r49 - in trunk: direct.openmoko.com direct.openmoko.com/admin direct.openmoko.com/admin/backups direct.openmoko.com/admin/feeds direct.openmoko.com/admin/help direct.openmoko.com/admin/images direct.openmoko.com/admin/images/categories direct.openmoko.com/admin/images/graphs direct.openmoko.com/admin/images/icons direct.openmoko.com/admin/images/img direct.openmoko.com/admin/includes direct.openmoko.com/admin/includes/boxes direct.openmoko.com/admin/includes/classes direct.openmoko.com/admin/includes/css direct.openmoko.com/admin/includes/functions direct.openmoko.com/admin/includes/graphs direct.openmoko.com/admin/includes/header direct.openmoko.com/admin/includes/javascript direct.openmoko.com/admin/includes/javascript/spiffyCal direct.openmoko.com/admin/includes/javascript/spiffyCal/images direct.openmoko.com/admin/includes/javascript/tabpane direct.openmoko.com/admin/includes/javascript/tabpane/local direct.openmoko.com/admin/includes/javascript/tiny_mce direct.openmoko.com/admin/includes/javascript/tiny_mce/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/css direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/jscripts direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/css direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/jscripts direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/css direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/jscripts direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/interface direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/temp direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/css direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/jscripts direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/themes direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/langs direct.openmoko.com/admin/includes/javascript/tiny_mce/utils direct.openmoko.com/admin/includes/languages direct.openmoko.com/admin/includes/languages/english direct.openmoko.com/admin/includes/languages/english/help direct.openmoko.com/admin/includes/languages/english/help/doc direct.openmoko.com/admin/includes/languages/english/help/encrypt direct.openmoko.com/admin/includes/languages/english/help/encrypt/images direct.openmoko.com/admin/includes/languages/english/help/ep direct.openmoko.com/admin/includes/languages/english/help/ep/images direct.openmoko.com/admin/includes/languages/english/help/et direct.openmoko.com/admin/includes/languages/english/help/et/images direct.openmoko.com/admin/includes/languages/english/help/payment direct.openmoko.com/admin/includes/languages/english/help/payment/paypal direct.openmoko.com/admin/includes/languages/english/images direct.openmoko.com/admin/includes/languages/english/images/buttons direct.openmoko.com/admin/includes/languages/english/modules direct.openmoko.com/admin/includes/languages/english/modules/newsletters direct.openmoko.com/admin/includes/languages/espanol direct.openmoko.com/admin/includes/languages/espanol/help direct.openmoko.com/admin/includes/languages/espanol/help/doc direct.openmoko.com/admin/includes/languages/espanol/help/encrypt direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images direct.openmoko.com/admin/includes/languages/espanol/help/ep direct.openmoko.com/admin/includes/languages/espanol/help/ep/images direct.openmoko.com/admin/includes/languages/espanol/help/et direct.openmoko.com/admin/includes/languages/espanol/help/et/images direct.openmoko.com/admin/includes/languages/espanol/help/payment direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal direct.openmoko.com/admin/includes/languages/espanol/images direct.openmoko.com/admin/includes/languages/espanol/images/buttons direct.openmoko.com/admin/includes/languages/espanol/modules direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters direct.openmoko.com/admin/includes/languages/french direct.openmoko.com/admin/includes/languages/french/help direct.openmoko.com/admin/includes/languages/french/help/doc direct.openmoko.com/admin/includes/languages/french/help/encrypt direct.openmoko.com/admin/includes/languages/french/help/encrypt/images direct.openmoko.com/admin/includes/languages/french/help/ep direct.openmoko.com/admin/includes/languages/french/help/ep/images direct.openmoko.com/admin/includes/languages/french/help/et direct.openmoko.com/admin/includes/languages/french/help/et/images direct.openmoko.com/admin/includes/languages/french/help/payment direct.openmoko.com/admin/includes/languages/french/help/payment/paypal direct.openmoko.com/admin/includes/languages/french/images direct.openmoko.com/admin/includes/languages/french/images/buttons direct.openmoko.com/admin/includes/languages/french/modules direct.openmoko.com/admin/includes/languages/french/modules/newsletters direct.openmoko.com/admin/includes/languages/german direct.openmoko.com/admin/includes/languages/german/help direct.openmoko.com/admin/includes/languages/german/help/doc direct.openmoko.com/admin/includes/languages/german/help/encrypt direct.openmoko.com/admin/includes/languages/german/help/encrypt/images direct.openmoko.com/admin/includes/languages/german/help/ep direct.openmoko.com/admin/includes/languages/german/help/ep/images direct.openmoko.com/admin/includes/languages/german/help/et direct.openmoko.com/admin/includes/languages/german/help/et/images direct.openmoko.com/admin/includes/languages/german/help/payment direct.openmoko.com/admin/includes/languages/german/help/payment/paypal direct.openmoko.com/admin/includes/languages/german/images direct.openmoko.com/admin/includes/languages/german/images/buttons direct.openmoko.com/admin/includes/languages/german/modules direct.openmoko.com/admin/includes/languages/german/modules/newsletters direct.openmoko.com/admin/includes/local direct.openmoko.com/admin/includes/modules direct.openmoko.com/admin/includes/modules/afs_v1.0 direct.openmoko.com/admin/includes/modules/afs_v1.0/images direct.openmoko.com/admin/includes/modules/newsletters direct.openmoko.com/cache direct.openmoko.com/cache/phpthumb direct.openmoko.com/cert direct.openmoko.com/debug direct.openmoko.com/download direct.openmoko.com/ext direct.openmoko.com/ext/modules direct.openmoko.com/ext/modules/payment direct.openmoko.com/ext/modules/payment/paypal_wpp direct.openmoko.com/images direct.openmoko.com/images/banners direct.openmoko.com/images/cards direct.openmoko.com/images/categories direct.openmoko.com/images/default direct.openmoko.com/images/dvd direct.openmoko.com/images/events_images direct.openmoko.com/images/gift direct.openmoko.com/images/gt_interactive direct.openmoko.com/images/icons direct.openmoko.com/images/infobox direct.openmoko.com/images/mail direct.openmoko.com/images/matrox direct.openmoko.com/images/microsoft direct.openmoko.com/images/paypal direct.openmoko.com/images/sierra direct.openmoko.com/includes direct.openmoko.com/includes/classes direct.openmoko.com/includes/functions direct.openmoko.com/includes/javascript direct.openmoko.com/includes/key direct.openmoko.com/includes/languages direct.openmoko.com/includes/languages/english direct.openmoko.com/includes/languages/english/images direct.openmoko.com/includes/languages/english/modules direct.openmoko.com/includes/languages/english/modules/checkout_success direct.openmoko.com/includes/languages/english/modules/order_total direct.openmoko.com/includes/languages/english/modules/payment direct.openmoko.com/includes/languages/english/modules/shipping direct.openmoko.com/includes/languages/espanol direct.openmoko.com/includes/languages/espanol/images direct.openmoko.com/includes/languages/espanol/modules direct.openmoko.com/includes/languages/espanol/modules/checkout_success direct.openmoko.com/includes/languages/espanol/modules/order_total direct.openmoko.com/includes/languages/espanol/modules/payment direct.openmoko.com/includes/languages/espanol/modules/shipping direct.openmoko.com/includes/languages/french direct.openmoko.com/includes/languages/french/images direct.openmoko.com/includes/languages/french/modules direct.openmoko.com/includes/languages/french/modules/checkout_success direct.openmoko.com/includes/languages/french/modules/order_total direct.openmoko.com/includes/languages/french/modules/payment direct.openmoko.com/includes/languages/french/modules/shipping direct.openmoko.com/includes/languages/german direct.openmoko.com/includes/languages/german/images direct.openmoko.com/includes/languages/german/modules direct.openmoko.com/includes/languages/german/modules/checkout_success direct.openmoko.com/includes/languages/german/modules/order_total direct.openmoko.com/includes/languages/german/modules/payment direct.openmoko.com/includes/languages/german/modules/shipping direct.openmoko.com/includes/local direct.openmoko.com/includes/modules direct.openmoko.com/includes/modules/checkout_success direct.openmoko.com/includes/modules/order_total direct.openmoko.com/includes/modules/payment direct.openmoko.com/includes/modules/payment/paypal direct.openmoko.com/includes/modules/payment/paypal/admin direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/languages direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/languages/english direct.openmoko.com/includes/modules/payment/paypal/admin/languages direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english direct.openmoko.com/includes/modules/payment/paypal/catalog direct.openmoko.com/includes/modules/payment/paypal/catalog/languages direct.openmoko.com/includes/modules/payment/paypal/catalog/languages/english direct.openmoko.com/includes/modules/payment/paypal/classes direct.openmoko.com/includes/modules/payment/paypal/classes/Client direct.openmoko.com/includes/modules/payment/paypal/classes/Debug direct.openmoko.com/includes/modules/payment/paypal/classes/IPN direct.openmoko.com/includes/modules/payment/paypal/classes/Page direct.openmoko.com/includes/modules/payment/paypal/classes/TransactionDetails direct.openmoko.com/includes/modules/payment/paypal/classes/osC direct.openmoko.com/includes/modules/payment/paypal/functions direct.openmoko.com/includes/modules/payment/paypal/images direct.openmoko.com/includes/modules/payment/paypal/languages direct.openmoko.com/includes/modules/payment/paypal/languages/english direct.openmoko.com/includes/modules/payment/paypal/templates direct.openmoko.com/includes/modules/payment/paypal/templates/css direct.openmoko.com/includes/modules/payment/paypal/templates/js direct.openmoko.com/includes/modules/shipping direct.openmoko.com/includes/modules/shipping/bak direct.openmoko.com/includes/modules/wishlist direct.openmoko.com/pear direct.openmoko.com/pear/Auth direct.openmoko.com/pear/Auth/SASL direct.openmoko.com/pear/DB direct.openmoko.com/pear/HTTP direct.openmoko.com/pear/HTTP/Request direct.openmoko.com/pear/Log direct.openmoko.com/pear/Mail direct.openmoko.com/pear/Net direct.openmoko.com/pear/Services direct.openmoko.com/pear/Services/PayPal direct.openmoko.com/pear/Services/PayPal/Profile direct.openmoko.com/pear/Services/PayPal/Profile/Handler direct.openmoko.com/pear/Services/PayPal/SDK direct.openmoko.com/pear/Services/PayPal/SOAP direct.openmoko.com/pear/Services/PayPal/SOAP/Server direct.openmoko.com/pear/Services/PayPal/SOAP/Transport direct.openmoko.com/pear/Services/PayPal/SOAP/Type direct.openmoko.com/pear/Services/PayPal/Type direct.openmoko.com/pear/Services/PayPal/build direct.openmoko.com/pear/Services/PayPal/cert direct.openmoko.com/pear/Services/PayPal/conf direct.openmoko.com/pear/Services/PayPal/wsdl direct.openmoko.com/pub direct.openmoko.com/temp direct.openmoko.com/templates direct.openmoko.com/templates/E-vector direct.openmoko.com/templates/E-vector/boxes direct.openmoko.com/templates/E-vector/doc direct.openmoko.com/templates/E-vector/images direct.openmoko.com/templates/E-vector/images/buttons direct.openmoko.com/templates/E-vector/images/buttons/english direct.openmoko.com/templates/E-vector/images/infobox direct.openmoko.com/templates/E-vector/mainpage_modules direct.openmoko.com/templates/Evector_ats direct.openmoko.com/templates/Evector_ats/doc direct.openmoko.com/templates/Evector_ats/images direct.openmoko.com/templates/Evector_ats/images/buttons direct.openmoko.com/templates/Evector_ats/images/buttons/english direct.openmoko.com/templates/Evector_ats/images/infobox direct.openmoko.com/templates/Helius direct.openmoko.com/templates/Helius/boxes direct.openmoko.com/templates/Helius/doc direct.openmoko.com/templates/Helius/images direct.openmoko.com/templates/Helius/images/buttons direct.openmoko.com/templates/Helius/images/buttons/english direct.openmoko.com/templates/Helius/images/infobox direct.openmoko.com/templates/Helius/mainpage_modules direct.openmoko.com/templates/Helius1 direct.openmoko.com/templates/Helius1/doc direct.openmoko.com/templates/Helius1/images direct.openmoko.com/templates/Helius1/images/buttons direct.openmoko.com/templates/Helius1/images/buttons/english direct.openmoko.com/templates/Helius1/images/infobox direct.openmoko.com/templates/OpenMoko direct.openmoko.com/templates/OpenMoko/boxes direct.openmoko.com/templates/OpenMoko/images direct.openmoko.com/templates/OpenMoko/images/buttons direct.openmoko.com/templates/OpenMoko/images/buttons/english direct.openmoko.com/templates/OpenMoko/images/buttons/espanol direct.openmoko.com/templates/OpenMoko/images/buttons/french direct.openmoko.com/templates/OpenMoko/images/buttons/german direct.openmoko.com/templates/OpenMoko/images/icons direct.openmoko.com/templates/OpenMoko/images/infobox direct.openmoko.com/templates/OpenMoko/images/label direct.openmoko.com/templates/OpenMoko/images/navigation direct.openmoko.com/templates/OpenMoko/mainpage_modules direct.openmoko.com/templates/OpenMoko/modules direct.openmoko.com/templates/OpenMokoBackup direct.openmoko.com/templates/OpenMokoBackup/boxes direct.openmoko.com/templates/OpenMokoBackup/images direct.openmoko.com/templates/OpenMokoBackup/images/buttons direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german direct.openmoko.com/templates/OpenMokoBackup/images/infobox direct.openmoko.com/templates/OpenMokoBackup/images/label direct.openmoko.com/templates/OpenMokoBackup/images/navigation direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules direct.openmoko.com/templates/Original direct.openmoko.com/templates/Original/boxes direct.openmoko.com/templates/Original/images direct.openmoko.com/templates/Original/images/buttons direct.openmoko.com/templates/Original/images/buttons/english direct.openmoko.com/templates/Original/images/buttons/espanol direct.openmoko.com/templates/Original/images/buttons/french direct.openmoko.com/templates/Original/images/buttons/german direct.openmoko.com/templates/Original/images/infobox direct.openmoko.com/templates/Original/mainpage_modules direct.openmoko.com/templates/Original1 direct.openmoko.com/templates/Original1/images direct.openmoko.com/templates/Original1/images/buttons direct.openmoko.com/templates/Original1/images/buttons/english direct.openmoko.com/templates/Original1/images/buttons/espanol direct.openmoko.com/templates/Original1/images/buttons/french direct.openmoko.com/templates/Original1/images/buttons/german direct.openmoko.com/templates/Original1/images/infobox direct.openmoko.com/templates/Pixame_v1 direct.openmoko.com/templates/Pixame_v1/boxes direct.openmoko.com/templates/Pixame_v1/doc direct.openmoko.com/templates/Pixame_v1/images direct.openmoko.com/templates/Pixame_v1/images/buttons direct.openmoko.com/templates/Pixame_v1/images/buttons/english direct.openmoko.com/templates/Pixame_v1/images/infobox direct.openmoko.com/templates/Pixame_v1/mainpage_modules direct.openmoko.com/templates/Pixame_v1ats direct.openmoko.com/templates/Pixame_v1ats/doc direct.openmoko.com/templates/Pixame_v1ats/images direct.openmoko.com/templates/Pixame_v1ats/images/buttons direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english direct.openmoko.com/templates/Pixame_v1ats/images/infobox direct.openmoko.com/templates/content direct.openmoko.com/templates/default direct.openmoko.com/templates/default/boxes direct.openmoko.com/templates/default/images direct.openmoko.com/templates/default/mainpage_modules direct.openmoko.com/templates/default/modules direct.openmoko.com/tmp www.openmoko.com www.openmoko.com/images www.openmoko.com/images/a www.openmoko.com/images/a/icons www.openmoko.com/images/a/label www.openmoko.com/images/a/navigation www.openmoko.com/images/a/navigation/accessories www.openmoko.com/images/a/navigation/default www.openmoko.com/images/a/navigation/phone www.openmoko.com/images/a/navigation/products www.openmoko.com/images/a/navigation/semi www.openmoko.com/images/a/products www.openmoko.com/images/a/products/accessories www.openmoko.com/images/a/products/accessories/a www.openmoko.com/images/bak www.openmoko.com/images/bak/icons www.openmoko.com/images/bak/label www.openmoko.com/images/bak/navigation www.openmoko.com/images/bak/navigation/accessories www.openmoko.com/images/bak/navigation/default www.openmoko.com/images/bak/navigation/phone www.openmoko.com/images/bak/navigation/products www.openmoko.com/images/bak/navigation/semi www.openmoko.com/images/bak/products www.openmoko.com/images/bak/products/accessories www.openmoko.com/images/bak/products/accessories/a www.openmoko.com/images/icons www.openmoko.com/images/label www.openmoko.com/images/navigation www.openmoko.com/images/navigation/accessories www.openmoko.com/images/navigation/default www.openmoko.com/images/navigation/phone www.openmoko.com/images/navigation/products www.openmoko.com/images/navigation/semi www.openmoko.com/images/products www.openmoko.com/images/products/accessories www.openmoko.com/images/products/accessories/a www.openmoko.com/inc www.openmoko.com/js www.openmoko.com/textpattern www.openmoko.com/textpattern/include www.openmoko.com/textpattern/include/import www.openmoko.com/textpattern/lang www.openmoko.com/textpattern/lib www.openmoko.com/textpattern/publish www.openmoko.com/textpattern/txp_img www.openmoko.com/textpattern/update www.openmoko.com/uploaded_images

roh at sita.openmoko.org roh at sita.openmoko.org
Wed Jun 6 10:28:17 CEST 2007


Author: roh
Date: 2007-06-06 10:25:52 +0200 (Wed, 06 Jun 2007)
New Revision: 49

Added:
   trunk/direct.openmoko.com/Order_Info.php
   trunk/direct.openmoko.com/Order_Info_Process.php
   trunk/direct.openmoko.com/account.php
   trunk/direct.openmoko.com/account_edit.php
   trunk/direct.openmoko.com/account_history.php
   trunk/direct.openmoko.com/account_history_info.php
   trunk/direct.openmoko.com/account_newsletters.php
   trunk/direct.openmoko.com/account_notifications.php
   trunk/direct.openmoko.com/account_password.php
   trunk/direct.openmoko.com/add_checkout_success.php
   trunk/direct.openmoko.com/address_book.php
   trunk/direct.openmoko.com/address_book_process.php
   trunk/direct.openmoko.com/admin/
   trunk/direct.openmoko.com/admin/abandoned_orders.php
   trunk/direct.openmoko.com/admin/account_details.php
   trunk/direct.openmoko.com/admin/admin_account.php
   trunk/direct.openmoko.com/admin/admin_files.php
   trunk/direct.openmoko.com/admin/admin_members.php
   trunk/direct.openmoko.com/admin/affiliate_affiliates.php
   trunk/direct.openmoko.com/admin/affiliate_banners.php
   trunk/direct.openmoko.com/admin/affiliate_clicks.php
   trunk/direct.openmoko.com/admin/affiliate_contact.php
   trunk/direct.openmoko.com/admin/affiliate_invoice.php
   trunk/direct.openmoko.com/admin/affiliate_news.php
   trunk/direct.openmoko.com/admin/affiliate_newsletters.php
   trunk/direct.openmoko.com/admin/affiliate_payment.php
   trunk/direct.openmoko.com/admin/affiliate_popup_image.php
   trunk/direct.openmoko.com/admin/affiliate_sales.php
   trunk/direct.openmoko.com/admin/affiliate_statistics.php
   trunk/direct.openmoko.com/admin/affiliate_summary.php
   trunk/direct.openmoko.com/admin/affiliate_validcats.php
   trunk/direct.openmoko.com/admin/affiliate_validproducts.php
   trunk/direct.openmoko.com/admin/article_reviews.php
   trunk/direct.openmoko.com/admin/articles.php
   trunk/direct.openmoko.com/admin/articles_config.php
   trunk/direct.openmoko.com/admin/articles_xsell.php
   trunk/direct.openmoko.com/admin/authnet_help.php
   trunk/direct.openmoko.com/admin/authors.php
   trunk/direct.openmoko.com/admin/backup.php
   trunk/direct.openmoko.com/admin/backup_mysql.php
   trunk/direct.openmoko.com/admin/backups/
   trunk/direct.openmoko.com/admin/backups/.htaccess
   trunk/direct.openmoko.com/admin/backups/delete_me_for_zip_only.txt
   trunk/direct.openmoko.com/admin/banner_manager.php
   trunk/direct.openmoko.com/admin/banner_statistics.php
   trunk/direct.openmoko.com/admin/c_orders.php
   trunk/direct.openmoko.com/admin/cache.php
   trunk/direct.openmoko.com/admin/categories.php
   trunk/direct.openmoko.com/admin/check_lang.php
   trunk/direct.openmoko.com/admin/configuration.php
   trunk/direct.openmoko.com/admin/countries.php
   trunk/direct.openmoko.com/admin/coupon_admin.php
   trunk/direct.openmoko.com/admin/coupon_restrict.php
   trunk/direct.openmoko.com/admin/creat_infoheading.php
   trunk/direct.openmoko.com/admin/create_account.php
   trunk/direct.openmoko.com/admin/create_account_process.php
   trunk/direct.openmoko.com/admin/create_account_success.php
   trunk/direct.openmoko.com/admin/create_order.php
   trunk/direct.openmoko.com/admin/create_order_admin.php
   trunk/direct.openmoko.com/admin/create_order_payment.php
   trunk/direct.openmoko.com/admin/create_order_process.php
   trunk/direct.openmoko.com/admin/create_order_shipping.php
   trunk/direct.openmoko.com/admin/crypt.php
   trunk/direct.openmoko.com/admin/crypt_purge.php
   trunk/direct.openmoko.com/admin/crypt_test.php
   trunk/direct.openmoko.com/admin/crypt_update.php
   trunk/direct.openmoko.com/admin/currencies.php
   trunk/direct.openmoko.com/admin/customers.php
   trunk/direct.openmoko.com/admin/data.php
   trunk/direct.openmoko.com/admin/data_admin.php
   trunk/direct.openmoko.com/admin/data_help.php
   trunk/direct.openmoko.com/admin/define_language.php
   trunk/direct.openmoko.com/admin/define_mainpage.php
   trunk/direct.openmoko.com/admin/dot.htaccess
   trunk/direct.openmoko.com/admin/easypopulate_basic_export.php
   trunk/direct.openmoko.com/admin/easypopulate_basic_import.php
   trunk/direct.openmoko.com/admin/easypopulate_export.php
   trunk/direct.openmoko.com/admin/easypopulate_import.php
   trunk/direct.openmoko.com/admin/edit_key.php
   trunk/direct.openmoko.com/admin/edit_key_help.php
   trunk/direct.openmoko.com/admin/edit_orders.php
   trunk/direct.openmoko.com/admin/edit_textdata.php
   trunk/direct.openmoko.com/admin/edit_textdata_help.php
   trunk/direct.openmoko.com/admin/email_subjects.php
   trunk/direct.openmoko.com/admin/epconfigure.php
   trunk/direct.openmoko.com/admin/event_drop_dns.php
   trunk/direct.openmoko.com/admin/events_manager.php
   trunk/direct.openmoko.com/admin/faq_categories.php
   trunk/direct.openmoko.com/admin/faq_form.php
   trunk/direct.openmoko.com/admin/faq_list.php
   trunk/direct.openmoko.com/admin/faq_manager.php
   trunk/direct.openmoko.com/admin/faq_view.php
   trunk/direct.openmoko.com/admin/faq_view_all.php
   trunk/direct.openmoko.com/admin/feature_not_present.php
   trunk/direct.openmoko.com/admin/featured.php
   trunk/direct.openmoko.com/admin/feeds/
   trunk/direct.openmoko.com/admin/feeds/delete_me_for_zip_only.txt
   trunk/direct.openmoko.com/admin/feeds/test.txt
   trunk/direct.openmoko.com/admin/forbiden.php
   trunk/direct.openmoko.com/admin/froogle.php
   trunk/direct.openmoko.com/admin/froogle_admin.php
   trunk/direct.openmoko.com/admin/froogle_pre.php
   trunk/direct.openmoko.com/admin/froogle_pre1.php
   trunk/direct.openmoko.com/admin/geo_zones.php
   trunk/direct.openmoko.com/admin/gv_mail.php
   trunk/direct.openmoko.com/admin/gv_queue.php
   trunk/direct.openmoko.com/admin/gv_report.php
   trunk/direct.openmoko.com/admin/gv_sent.php
   trunk/direct.openmoko.com/admin/header_navigation2.php
   trunk/direct.openmoko.com/admin/header_tags_controller.php
   trunk/direct.openmoko.com/admin/header_tags_english.php
   trunk/direct.openmoko.com/admin/header_tags_fill_tags.php
   trunk/direct.openmoko.com/admin/header_tags_popup_help.php
   trunk/direct.openmoko.com/admin/help/
   trunk/direct.openmoko.com/admin/help/stats_monthly_sales.php
   trunk/direct.openmoko.com/admin/images/
   trunk/direct.openmoko.com/admin/images/00add_button.gif
   trunk/direct.openmoko.com/admin/images/120x35ecomm.gif
   trunk/direct.openmoko.com/admin/images/468x60ecomm.gif
   trunk/direct.openmoko.com/admin/images/Book-4-mockup.jpg
   trunk/direct.openmoko.com/admin/images/admin_logo.gif
   trunk/direct.openmoko.com/admin/images/admin_logo_right.gif
   trunk/direct.openmoko.com/admin/images/ani_send_email.gif
   trunk/direct.openmoko.com/admin/images/arrow_down.gif
   trunk/direct.openmoko.com/admin/images/arrow_up.gif
   trunk/direct.openmoko.com/admin/images/button_upgrade_now.gif
   trunk/direct.openmoko.com/admin/images/cal_close_small.gif
   trunk/direct.openmoko.com/admin/images/cal_date_down.gif
   trunk/direct.openmoko.com/admin/images/cal_date_over.gif
   trunk/direct.openmoko.com/admin/images/cal_date_up.gif
   trunk/direct.openmoko.com/admin/images/cal_del_small.gif
   trunk/direct.openmoko.com/admin/images/categories/
   trunk/direct.openmoko.com/admin/images/categories/administrator.gif
   trunk/direct.openmoko.com/admin/images/categories/affiliate.gif
   trunk/direct.openmoko.com/admin/images/categories/catalog.gif
   trunk/direct.openmoko.com/admin/images/categories/configuration.gif
   trunk/direct.openmoko.com/admin/images/categories/customers.gif
   trunk/direct.openmoko.com/admin/images/categories/design_controls.gif
   trunk/direct.openmoko.com/admin/images/categories/faq.gif
   trunk/direct.openmoko.com/admin/images/categories/gift.gif
   trunk/direct.openmoko.com/admin/images/categories/info.gif
   trunk/direct.openmoko.com/admin/images/categories/links.gif
   trunk/direct.openmoko.com/admin/images/categories/localization.gif
   trunk/direct.openmoko.com/admin/images/categories/location.gif
   trunk/direct.openmoko.com/admin/images/categories/modules.gif
   trunk/direct.openmoko.com/admin/images/categories/my_account.gif
   trunk/direct.openmoko.com/admin/images/categories/news.gif
   trunk/direct.openmoko.com/admin/images/categories/paypalipn.gif
   trunk/direct.openmoko.com/admin/images/categories/reports.gif
   trunk/direct.openmoko.com/admin/images/categories/tools.gif
   trunk/direct.openmoko.com/admin/images/close_window.jpg
   trunk/direct.openmoko.com/admin/images/colortable.gif
   trunk/direct.openmoko.com/admin/images/covers-BOTH-100x125.gif
   trunk/direct.openmoko.com/admin/images/cre_header_slice.gif
   trunk/direct.openmoko.com/admin/images/crebook.jpg
   trunk/direct.openmoko.com/admin/images/default.gif
   trunk/direct.openmoko.com/admin/images/down.gif
   trunk/direct.openmoko.com/admin/images/graph_hbar_blue.gif
   trunk/direct.openmoko.com/admin/images/graph_hbar_red.gif
   trunk/direct.openmoko.com/admin/images/graphs/
   trunk/direct.openmoko.com/admin/images/graphs/dummy
   trunk/direct.openmoko.com/admin/images/header_administration.gif
   trunk/direct.openmoko.com/admin/images/header_checkout.gif
   trunk/direct.openmoko.com/admin/images/header_support.gif
   trunk/direct.openmoko.com/admin/images/help1.gif
   trunk/direct.openmoko.com/admin/images/icon_arrow_down.gif
   trunk/direct.openmoko.com/admin/images/icon_arrow_right.gif
   trunk/direct.openmoko.com/admin/images/icon_arrow_up.gif
   trunk/direct.openmoko.com/admin/images/icon_info.gif
   trunk/direct.openmoko.com/admin/images/icon_infobox_green.gif
   trunk/direct.openmoko.com/admin/images/icon_infobox_green_light.gif
   trunk/direct.openmoko.com/admin/images/icon_infobox_red.gif
   trunk/direct.openmoko.com/admin/images/icon_infobox_red_light.gif
   trunk/direct.openmoko.com/admin/images/icon_n_red.gif
   trunk/direct.openmoko.com/admin/images/icon_n_red_light.gif
   trunk/direct.openmoko.com/admin/images/icon_popup.gif
   trunk/direct.openmoko.com/admin/images/icon_reset.gif
   trunk/direct.openmoko.com/admin/images/icon_save.gif
   trunk/direct.openmoko.com/admin/images/icon_status_blue.gif
   trunk/direct.openmoko.com/admin/images/icon_status_gold.gif
   trunk/direct.openmoko.com/admin/images/icon_status_gold_border.gif
   trunk/direct.openmoko.com/admin/images/icon_status_green.gif
   trunk/direct.openmoko.com/admin/images/icon_status_green_border_light.gif
   trunk/direct.openmoko.com/admin/images/icon_status_green_light.gif
   trunk/direct.openmoko.com/admin/images/icon_status_red.gif
   trunk/direct.openmoko.com/admin/images/icon_status_red_border_light.gif
   trunk/direct.openmoko.com/admin/images/icon_status_red_light.gif
   trunk/direct.openmoko.com/admin/images/icon_status_white.gif
   trunk/direct.openmoko.com/admin/images/icon_status_yellow.gif
   trunk/direct.openmoko.com/admin/images/icon_y_green.gif
   trunk/direct.openmoko.com/admin/images/icon_y_green_light.gif
   trunk/direct.openmoko.com/admin/images/icons/
   trunk/direct.openmoko.com/admin/images/icons/arrow_checkall.gif
   trunk/direct.openmoko.com/admin/images/icons/confirm_red.gif
   trunk/direct.openmoko.com/admin/images/icons/cross.gif
   trunk/direct.openmoko.com/admin/images/icons/current_folder.gif
   trunk/direct.openmoko.com/admin/images/icons/delete.gif
   trunk/direct.openmoko.com/admin/images/icons/edit.gif
   trunk/direct.openmoko.com/admin/images/icons/edit_2.gif
   trunk/direct.openmoko.com/admin/images/icons/error.gif
   trunk/direct.openmoko.com/admin/images/icons/file.gif
   trunk/direct.openmoko.com/admin/images/icons/file_download.gif
   trunk/direct.openmoko.com/admin/images/icons/folder.gif
   trunk/direct.openmoko.com/admin/images/icons/icon_status_green.gif
   trunk/direct.openmoko.com/admin/images/icons/icon_status_green_light.gif
   trunk/direct.openmoko.com/admin/images/icons/icon_status_red.gif
   trunk/direct.openmoko.com/admin/images/icons/icon_status_red_light.gif
   trunk/direct.openmoko.com/admin/images/icons/icon_status_yellow.gif
   trunk/direct.openmoko.com/admin/images/icons/locked.gif
   trunk/direct.openmoko.com/admin/images/icons/preview.gif
   trunk/direct.openmoko.com/admin/images/icons/preview_upload.gif
   trunk/direct.openmoko.com/admin/images/icons/previous_level.gif
   trunk/direct.openmoko.com/admin/images/icons/sort.gif
   trunk/direct.openmoko.com/admin/images/icons/statistics.gif
   trunk/direct.openmoko.com/admin/images/icons/success.gif
   trunk/direct.openmoko.com/admin/images/icons/tick.gif
   trunk/direct.openmoko.com/admin/images/icons/unlocked.gif
   trunk/direct.openmoko.com/admin/images/icons/warning.gif
   trunk/direct.openmoko.com/admin/images/icons/warning_big.gif
   trunk/direct.openmoko.com/admin/images/img/
   trunk/direct.openmoko.com/admin/images/img/base.gif
   trunk/direct.openmoko.com/admin/images/img/cd.gif
   trunk/direct.openmoko.com/admin/images/img/empty.gif
   trunk/direct.openmoko.com/admin/images/img/folder.gif
   trunk/direct.openmoko.com/admin/images/img/folderopen.gif
   trunk/direct.openmoko.com/admin/images/img/globe.gif
   trunk/direct.openmoko.com/admin/images/img/imgfolder.gif
   trunk/direct.openmoko.com/admin/images/img/join.gif
   trunk/direct.openmoko.com/admin/images/img/joinbottom.gif
   trunk/direct.openmoko.com/admin/images/img/line.gif
   trunk/direct.openmoko.com/admin/images/img/minus.gif
   trunk/direct.openmoko.com/admin/images/img/minusbottom.gif
   trunk/direct.openmoko.com/admin/images/img/musicfolder.gif
   trunk/direct.openmoko.com/admin/images/img/nolines_minus.gif
   trunk/direct.openmoko.com/admin/images/img/nolines_plus.gif
   trunk/direct.openmoko.com/admin/images/img/page.gif
   trunk/direct.openmoko.com/admin/images/img/plus.gif
   trunk/direct.openmoko.com/admin/images/img/plusbottom.gif
   trunk/direct.openmoko.com/admin/images/img/question.gif
   trunk/direct.openmoko.com/admin/images/img/trash.gif
   trunk/direct.openmoko.com/admin/images/loaded_3box_ad.jpg
   trunk/direct.openmoko.com/admin/images/loaded_header_logo.gif
   trunk/direct.openmoko.com/admin/images/logo-banner_02.gif
   trunk/direct.openmoko.com/admin/images/logo-banner_03.gif
   trunk/direct.openmoko.com/admin/images/logo-banner_bg.gif
   trunk/direct.openmoko.com/admin/images/mark_check.jpg
   trunk/direct.openmoko.com/admin/images/mark_x.jpg
   trunk/direct.openmoko.com/admin/images/oscommerce.gif
   trunk/direct.openmoko.com/admin/images/pithy-anim-2.0.gif
   trunk/direct.openmoko.com/admin/images/pixel_black.gif
   trunk/direct.openmoko.com/admin/images/pixel_trans.gif
   trunk/direct.openmoko.com/admin/images/shipwire_logo.gif
   trunk/direct.openmoko.com/admin/images/thinktank.jpg
   trunk/direct.openmoko.com/admin/images/up.gif
   trunk/direct.openmoko.com/admin/includes/
   trunk/direct.openmoko.com/admin/includes/account_check.js.php
   trunk/direct.openmoko.com/admin/includes/add_ccgvdc_application_top.php
   trunk/direct.openmoko.com/admin/includes/affiliate_application_top.php
   trunk/direct.openmoko.com/admin/includes/affiliate_configure.php
   trunk/direct.openmoko.com/admin/includes/application_bottom.php
   trunk/direct.openmoko.com/admin/includes/application_top.php
   trunk/direct.openmoko.com/admin/includes/attributes_display.php
   trunk/direct.openmoko.com/admin/includes/boxes/
   trunk/direct.openmoko.com/admin/includes/boxes/administrator.php
   trunk/direct.openmoko.com/admin/includes/boxes/affiliate.php
   trunk/direct.openmoko.com/admin/includes/boxes/articles.php
   trunk/direct.openmoko.com/admin/includes/boxes/catalog.php
   trunk/direct.openmoko.com/admin/includes/boxes/configuration.php
   trunk/direct.openmoko.com/admin/includes/boxes/crypt.php
   trunk/direct.openmoko.com/admin/includes/boxes/customers.php
   trunk/direct.openmoko.com/admin/includes/boxes/data.php
   trunk/direct.openmoko.com/admin/includes/boxes/design_controls.php
   trunk/direct.openmoko.com/admin/includes/boxes/faq.php
   trunk/direct.openmoko.com/admin/includes/boxes/gv_admin.php
   trunk/direct.openmoko.com/admin/includes/boxes/header_tags_controller.php
   trunk/direct.openmoko.com/admin/includes/boxes/information.php
   trunk/direct.openmoko.com/admin/includes/boxes/links.php
   trunk/direct.openmoko.com/admin/includes/boxes/localization.php
   trunk/direct.openmoko.com/admin/includes/boxes/marketing.php
   trunk/direct.openmoko.com/admin/includes/boxes/modules.php
   trunk/direct.openmoko.com/admin/includes/boxes/reports.php
   trunk/direct.openmoko.com/admin/includes/boxes/taxes.php
   trunk/direct.openmoko.com/admin/includes/boxes/techsupport.php
   trunk/direct.openmoko.com/admin/includes/boxes/tools.php
   trunk/direct.openmoko.com/admin/includes/classes/
   trunk/direct.openmoko.com/admin/includes/classes/box.php
   trunk/direct.openmoko.com/admin/includes/classes/currencies.php
   trunk/direct.openmoko.com/admin/includes/classes/email.php
   trunk/direct.openmoko.com/admin/includes/classes/file_layout.php
   trunk/direct.openmoko.com/admin/includes/classes/language.php
   trunk/direct.openmoko.com/admin/includes/classes/logger.php
   trunk/direct.openmoko.com/admin/includes/classes/message_stack.php
   trunk/direct.openmoko.com/admin/includes/classes/mime.php
   trunk/direct.openmoko.com/admin/includes/classes/object_info.php
   trunk/direct.openmoko.com/admin/includes/classes/order.php
   trunk/direct.openmoko.com/admin/includes/classes/payment_module_info.php
   trunk/direct.openmoko.com/admin/includes/classes/phplot.php
   trunk/direct.openmoko.com/admin/includes/classes/rci.php
   trunk/direct.openmoko.com/admin/includes/classes/sales_report2.php
   trunk/direct.openmoko.com/admin/includes/classes/sessions.php
   trunk/direct.openmoko.com/admin/includes/classes/shopping_cart.php
   trunk/direct.openmoko.com/admin/includes/classes/split_page_results.php
   trunk/direct.openmoko.com/admin/includes/classes/table_block.php
   trunk/direct.openmoko.com/admin/includes/classes/upload.php
   trunk/direct.openmoko.com/admin/includes/classes/xmldocument.php
   trunk/direct.openmoko.com/admin/includes/column_left.php
   trunk/direct.openmoko.com/admin/includes/configure.php
   trunk/direct.openmoko.com/admin/includes/configure.php.bak
   trunk/direct.openmoko.com/admin/includes/configure_dist.php
   trunk/direct.openmoko.com/admin/includes/css/
   trunk/direct.openmoko.com/admin/includes/css/helptip.css
   trunk/direct.openmoko.com/admin/includes/css/index.css
   trunk/direct.openmoko.com/admin/includes/css/stylesheet.css
   trunk/direct.openmoko.com/admin/includes/database_tables.php
   trunk/direct.openmoko.com/admin/includes/filenames.php
   trunk/direct.openmoko.com/admin/includes/footer.php
   trunk/direct.openmoko.com/admin/includes/form_check.js.php
   trunk/direct.openmoko.com/admin/includes/functions/
   trunk/direct.openmoko.com/admin/includes/functions/affiliate_functions.php
   trunk/direct.openmoko.com/admin/includes/functions/articles.php
   trunk/direct.openmoko.com/admin/includes/functions/attributes_sorter_added_functions.php
   trunk/direct.openmoko.com/admin/includes/functions/c_orders.php
   trunk/direct.openmoko.com/admin/includes/functions/categories_description.php
   trunk/direct.openmoko.com/admin/includes/functions/compatibility.php
   trunk/direct.openmoko.com/admin/includes/functions/crypt.php
   trunk/direct.openmoko.com/admin/includes/functions/data.php
   trunk/direct.openmoko.com/admin/includes/functions/database.php
   trunk/direct.openmoko.com/admin/includes/functions/downloads_controller.php
   trunk/direct.openmoko.com/admin/includes/functions/easypopulate_functions.php
   trunk/direct.openmoko.com/admin/includes/functions/edit_key.php
   trunk/direct.openmoko.com/admin/includes/functions/edit_text.php
   trunk/direct.openmoko.com/admin/includes/functions/faq.php
   trunk/direct.openmoko.com/admin/includes/functions/general.php
   trunk/direct.openmoko.com/admin/includes/functions/general.php.orig
   trunk/direct.openmoko.com/admin/includes/functions/header_tags.php
   trunk/direct.openmoko.com/admin/includes/functions/html_graphs.php
   trunk/direct.openmoko.com/admin/includes/functions/html_output.php
   trunk/direct.openmoko.com/admin/includes/functions/information_html_output.php
   trunk/direct.openmoko.com/admin/includes/functions/languages.php
   trunk/direct.openmoko.com/admin/includes/functions/links.php
   trunk/direct.openmoko.com/admin/includes/functions/localization.php
   trunk/direct.openmoko.com/admin/includes/functions/pages.php
   trunk/direct.openmoko.com/admin/includes/functions/password_funcs.php
   trunk/direct.openmoko.com/admin/includes/functions/rss2html.php
   trunk/direct.openmoko.com/admin/includes/functions/sessions.php
   trunk/direct.openmoko.com/admin/includes/functions/validations.php
   trunk/direct.openmoko.com/admin/includes/general.js
   trunk/direct.openmoko.com/admin/includes/graphs/
   trunk/direct.openmoko.com/admin/includes/graphs/banner_daily.php
   trunk/direct.openmoko.com/admin/includes/graphs/banner_infobox.php
   trunk/direct.openmoko.com/admin/includes/graphs/banner_monthly.php
   trunk/direct.openmoko.com/admin/includes/graphs/banner_yearly.php
   trunk/direct.openmoko.com/admin/includes/header.php
   trunk/direct.openmoko.com/admin/includes/header/
   trunk/direct.openmoko.com/admin/includes/header/admin_logo.gif
   trunk/direct.openmoko.com/admin/includes/header/bg.gif
   trunk/direct.openmoko.com/admin/includes/header/header.php
   trunk/direct.openmoko.com/admin/includes/header/header_blue.jpg
   trunk/direct.openmoko.com/admin/includes/header/security.png
   trunk/direct.openmoko.com/admin/includes/header_navigation.php
   trunk/direct.openmoko.com/admin/includes/helptip.css
   trunk/direct.openmoko.com/admin/includes/index.css
   trunk/direct.openmoko.com/admin/includes/javascript/
   trunk/direct.openmoko.com/admin/includes/javascript/calendar.css
   trunk/direct.openmoko.com/admin/includes/javascript/calendarcode.js
   trunk/direct.openmoko.com/admin/includes/javascript/dtree.js
   trunk/direct.openmoko.com/admin/includes/javascript/editor.php
   trunk/direct.openmoko.com/admin/includes/javascript/general.js
   trunk/direct.openmoko.com/admin/includes/javascript/helptip.js
   trunk/direct.openmoko.com/admin/includes/javascript/menu.js
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_close_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_disabled.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_down.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_over.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_up.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_disabled.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_down.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_over.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_up.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_disabled.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_down.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_over.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_up.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_del_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_info.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/s.gif
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/spiffycal.cur
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/spiffycal2.cur
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/spiffycal3.cur
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/spiffyCal_v2_1.css
   trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/spiffyCal_v2_1.js
   trunk/direct.openmoko.com/admin/includes/javascript/tabpane/
   trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/
   trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/howto.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxapi.css
   trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxapi.js
   trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxlayout.js
   trunk/direct.openmoko.com/admin/includes/javascript/tabpane/tab.webfx.css
   trunk/direct.openmoko.com/admin/includes/javascript/tabpane/tabpane.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/blank.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/langs/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/license.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/css/advimage.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/image.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/images/sample.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/jscripts/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/jscripts/functions.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/css/advlink.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/jscripts/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/jscripts/functions.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/link.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/css/contextmenu.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/images/spacer.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/images/ltr.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/images/rtl.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/config.inc.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/selectableelements.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/selectabletablerows.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/sortabletable.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/files.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/functions.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/blank.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_Corner.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_create.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_delete.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_move.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_open.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_rename.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_up.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/downsimple.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/binary_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/def_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/doc_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/folder_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/gif_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/gz_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/html_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/image_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/jpg_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/mov_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/no_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/pdf_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/png_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/ppt_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/rar_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/script_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/sound_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/txt_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/xls_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/zip_small.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/unlocked.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/upsimple.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/insert_file.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/dialog.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/functions.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/popup.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/selectableelements.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/selectabletablerows.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/sortabletable.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-de.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-en.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-nl.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/move.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/images/filemanager.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css/content.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css/flash.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/flash.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/images/flash.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/jscripts/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/jscripts/flash.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/fullscreen.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/images/fullscreen.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config/config.inc.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config/index.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css/index.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css/style.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/changelog.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/license.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/ibrowser.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/about.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/about_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/alert.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/alert_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/buttonbar.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/buttonbar_gs.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/defaultIcon.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/delimg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/delimg_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dir.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dir_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dirview.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dirview_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/explorer.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/explorer.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/favicon.ico
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/firefox.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/firefox.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/help.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/help_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/ib.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/ibrowser.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_at.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_at_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_cr.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_cr_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_in.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_in_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_po.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_po_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_size.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_size_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/index.html
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/info.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/info_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noImg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noImg.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noPop.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noPop.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/okclick.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/okclick_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/paypal.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/prev.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/prev_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/randomImg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/randomImg.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/renimg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/renimg_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/spacer.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/symbols.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/symbols_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/textflow.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/thbCrop.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/upimg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/upimg_off.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/index.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/interface/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/interface/common.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/cs.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/da.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/de.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/de.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/en.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/es.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/fr.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/fr.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/index.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/it.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/lang.class.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/nl.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/pl.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/pt_br.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/sk.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/index.html
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/loadmsg.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.changelog.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.faq.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.license.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/index.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.config.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.config.php.org
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.bmp.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.class.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.filters.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.functions.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.gif.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.ico.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.unsharp.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/popup.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/random.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/rdirs.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/resizeDialog.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/rfiles.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/symbols.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/validateForm.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/temp/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/temp/index.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/images/iespell.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/absolute.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/backward.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/forward.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/insert_layer.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/images/lorem.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs/hu.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/loremipsum.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/text.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/blank.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css/blank.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css/pasteword.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/pastetext.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/pasteword.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/selectall.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts/pastetext.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts/pasteword.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/pastetext.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/pasteword.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/example.html
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/images/preview.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/preview.php
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/images/replace.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/images/search.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts/replace.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts/search.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/replace.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/search.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/css/props.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/images/apply_button_bg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/images/style_info.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/jscripts/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/jscripts/props.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/props.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/cell.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/cell.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/row.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/table.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/editor_plugin.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/editor_plugin_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/buttons.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_cell_props.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_delete.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_delete_col.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_delete_row.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_col_after.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_col_before.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_row_after.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_row_before.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_merge_cells.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_row_props.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_split_cells.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/cell.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/merge_cells.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/row.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/table.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/merge_cells.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/readme.txt
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/row.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/table.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/about.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/anchor.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/charmap.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/color_picker.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_content.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_popup.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_ui.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/about.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/common_buttons.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/create_accessible_content.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_anchor_window.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_image_window.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_link_window.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_table_window.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/index.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_anchor_button.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_image_button.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_link_button.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_table_button.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/style.css
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/editor_template.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/editor_template_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/image.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/anchor.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/anchor_symbol.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/backcolor.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_de_se.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_es.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_fr.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_ru.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_tw.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/browse.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bullist.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/button_menu.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/buttons.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/cancel_button_bg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/charmap.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/cleanup.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/close.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/code.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/color.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/copy.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/custom_1.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/cut.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/forecolor.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/help.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/hr.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/image.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/indent.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/insert_button_bg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_de_se.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_es.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_ru.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_tw.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifycenter.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifyfull.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifyleft.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifyright.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/link.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/menu_check.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/newdocument.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/numlist.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/opacity.png
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/outdent.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/paste.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/redo.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/removeformat.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/separator.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/spacer.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/statusbar_resize.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/strikethrough.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/sub.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/sup.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_es.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_fr.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_ru.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_tw.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/undo.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/unlink.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/visualaid.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_bg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_end.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tabs_bg.gif
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/about.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/anchor.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/charmap.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/color_picker.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/image.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/link.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/source_editor.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/langs/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/langs/en.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/link.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/source_editor.htm
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce_popup.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce_src.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/editable_selects.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/form_utils.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/mclayer.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/mctabs.js
   trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/validate.js
   trunk/direct.openmoko.com/admin/includes/javascript/webmakers_added_js.php
   trunk/direct.openmoko.com/admin/includes/languages/
   trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_english.php
   trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_espanol.php
   trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_french.php
   trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_german.php
   trunk/direct.openmoko.com/admin/includes/languages/affiliate_english.php
   trunk/direct.openmoko.com/admin/includes/languages/affiliate_espanol.php
   trunk/direct.openmoko.com/admin/includes/languages/affiliate_french.php
   trunk/direct.openmoko.com/admin/includes/languages/affiliate_german.php
   trunk/direct.openmoko.com/admin/includes/languages/english.php
   trunk/direct.openmoko.com/admin/includes/languages/english/
   trunk/direct.openmoko.com/admin/includes/languages/english/abandoned_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/english/admin_account.php
   trunk/direct.openmoko.com/admin/includes/languages/english/admin_files.php
   trunk/direct.openmoko.com/admin/includes/languages/english/admin_members.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_affiliates.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_banner_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_banners.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_clicks.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_contact.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_invoice.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_news.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_newsletters.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_payment.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_sales.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_summary.php
   trunk/direct.openmoko.com/admin/includes/languages/english/algo_fraud_screener.php
   trunk/direct.openmoko.com/admin/includes/languages/english/article_reviews.php
   trunk/direct.openmoko.com/admin/includes/languages/english/article_search.php
   trunk/direct.openmoko.com/admin/includes/languages/english/articles.php
   trunk/direct.openmoko.com/admin/includes/languages/english/articles_config.php
   trunk/direct.openmoko.com/admin/includes/languages/english/articles_xsell.php
   trunk/direct.openmoko.com/admin/includes/languages/english/attributes_sorter.php
   trunk/direct.openmoko.com/admin/includes/languages/english/authors.php
   trunk/direct.openmoko.com/admin/includes/languages/english/backup.php
   trunk/direct.openmoko.com/admin/includes/languages/english/backup_mysql.php
   trunk/direct.openmoko.com/admin/includes/languages/english/banner_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/english/banner_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/english/c_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/english/cache.php
   trunk/direct.openmoko.com/admin/includes/languages/english/categories.php
   trunk/direct.openmoko.com/admin/includes/languages/english/check_lang.php
   trunk/direct.openmoko.com/admin/includes/languages/english/configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/english/countries.php
   trunk/direct.openmoko.com/admin/includes/languages/english/coupon_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/english/coupon_restrict.php
   trunk/direct.openmoko.com/admin/includes/languages/english/create_account.php
   trunk/direct.openmoko.com/admin/includes/languages/english/create_account_process.php
   trunk/direct.openmoko.com/admin/includes/languages/english/create_account_success.php
   trunk/direct.openmoko.com/admin/includes/languages/english/create_order.php
   trunk/direct.openmoko.com/admin/includes/languages/english/create_order_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/english/create_order_payment.php
   trunk/direct.openmoko.com/admin/includes/languages/english/create_order_process.php
   trunk/direct.openmoko.com/admin/includes/languages/english/create_order_shipping.php
   trunk/direct.openmoko.com/admin/includes/languages/english/crypt.php
   trunk/direct.openmoko.com/admin/includes/languages/english/crypt_convert.php
   trunk/direct.openmoko.com/admin/includes/languages/english/crypt_convert_1.php
   trunk/direct.openmoko.com/admin/includes/languages/english/crypt_purge.php
   trunk/direct.openmoko.com/admin/includes/languages/english/crypt_update.php
   trunk/direct.openmoko.com/admin/includes/languages/english/currencies.php
   trunk/direct.openmoko.com/admin/includes/languages/english/customers.php
   trunk/direct.openmoko.com/admin/includes/languages/english/customers_groups.php
   trunk/direct.openmoko.com/admin/includes/languages/english/data.php
   trunk/direct.openmoko.com/admin/includes/languages/english/data_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/english/define_language.php
   trunk/direct.openmoko.com/admin/includes/languages/english/define_mainpage.php
   trunk/direct.openmoko.com/admin/includes/languages/english/document.php
   trunk/direct.openmoko.com/admin/includes/languages/english/easypopulate.php
   trunk/direct.openmoko.com/admin/includes/languages/english/edit_key.php
   trunk/direct.openmoko.com/admin/includes/languages/english/edit_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/english/edit_textdata.php
   trunk/direct.openmoko.com/admin/includes/languages/english/email_subjects.php
   trunk/direct.openmoko.com/admin/includes/languages/english/events_calendar.php
   trunk/direct.openmoko.com/admin/includes/languages/english/events_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/english/faq.php
   trunk/direct.openmoko.com/admin/includes/languages/english/faq_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/english/feature_not_present.php
   trunk/direct.openmoko.com/admin/includes/languages/english/featured.php
   trunk/direct.openmoko.com/admin/includes/languages/english/file_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/english/forbiden.php
   trunk/direct.openmoko.com/admin/includes/languages/english/froogle.php
   trunk/direct.openmoko.com/admin/includes/languages/english/froogle_pre.php
   trunk/direct.openmoko.com/admin/includes/languages/english/geo_zones.php
   trunk/direct.openmoko.com/admin/includes/languages/english/gv_mail.php
   trunk/direct.openmoko.com/admin/includes/languages/english/gv_queue.php
   trunk/direct.openmoko.com/admin/includes/languages/english/gv_report.php
   trunk/direct.openmoko.com/admin/includes/languages/english/gv_sent.php
   trunk/direct.openmoko.com/admin/includes/languages/english/header_tags_controller.php
   trunk/direct.openmoko.com/admin/includes/languages/english/header_tags_popup_help.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/data_help.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index2.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index3.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index4.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index5.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/none.txt
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_cat.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_misc.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/edit_key_help.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/edit_textdata_help.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/data_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/edit_key_help.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page1.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page2.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page3.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page4.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page5.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page6.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7a.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7b.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7c.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/cofigure_filename.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure1a.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure2.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure3.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure_filename1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_button.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_nobutton.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_not.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_ok.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/d_c_main.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/d_c_main_all.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/e_c_order.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/e_c_order1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/e_c_order_d_e.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/encrypt1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/encrypt2.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/item_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_createt.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_edit.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_main.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_new_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_new_saved.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_save.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_saved.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_start.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/order_edit.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/order_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/pixel_trans.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/test1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/test2.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_basicexport.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_basicimport.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_epbasic.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_error.txt
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_export.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_feed_intro.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_frooglebacisgettingstarted.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_froogleconfigure.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_froogleconfigure1.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_frooglerun.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_import.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_intro.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_spreadsheet.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_export_results.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_field_group.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_add.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_delete.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_split.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_start.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_uploaded_insert.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_uploaded_results.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_limit_cat.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_limit_man.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_limit_prodid.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_sel_export.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_sortorder.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_start.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export_mesg.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export_sel_feld.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export_sel_loc.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_import.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_import_mesg.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_import_select.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_config.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_config1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_new_config.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_start.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_catbuild.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_catbuilddone.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_feedbuilddone.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_feedsend_error1.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/import_results.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/item_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_edit_file.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_edit_restore.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_list.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_search_t_before.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_search_t_results.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_searcht.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_main.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_select_lng.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_dir.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_file.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_insert.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_lngr.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_lngr_grem.png
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index2.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index3.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index4.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index5.html
   trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/authnet_help.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/paypal/
   trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/paypal/Help_Config.inc.php
   trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/paypal/Help_FAQs.inc.php
   trunk/direct.openmoko.com/admin/includes/languages/english/images/
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_activate.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_add_article.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_add_field.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_add_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_files.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_group.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_groups.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_home.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_member.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_members.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_permission.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_remove.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_banners.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_billing.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_sales.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_back.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_backup.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_blank.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_browse.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_cancel.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_cancel_edit_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_check_link.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_check_links.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_confirm.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_confirm_red.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_continue.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_convert.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_copy.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_copy_to.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_create.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_create_customer.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_create_order.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_decrypt.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_delete.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_details.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_download.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_attributes.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_footer.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_header.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_infoboxes.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_key.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_lang_define.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_mainpage.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_order.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_small.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_status.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_values.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_email.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_encrypt.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_file_manager.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_free_signup.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_insert.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_insert_into_db.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_invoice.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_lock.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_module_install.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_module_remove.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_move.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_article.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_author.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_banner.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_category.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_country.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_currency.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_event.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_faq.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_file.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_folder.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_language.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_link.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_news_item.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_newsletter.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_package.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_sale.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_tax_class.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_tax_rate.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_topic.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_zone.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_next.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_orders.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_packingslip.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_preview.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_preview_upload.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_print.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_print_page.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_process.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_quick_save.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_release.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_remove_fields.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_removeccinfo.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_report.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_reset.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_restore.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_return.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_review_approve.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_review_disapprove.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_run.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save_edit_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save_finish.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save_reload.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_search.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_select.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_send.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_send_mail.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_split_file.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_spllit_files.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_start_file_creation.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_template_admin.psd
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_unlock.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_box_positions.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_currencies.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_fields.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_status.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_upload.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_verify.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/ic_down.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/ic_up.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/review_approve.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/review_disapprove.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/sync.gif
   trunk/direct.openmoko.com/admin/includes/languages/english/index.php
   trunk/direct.openmoko.com/admin/includes/languages/english/index_new.php
   trunk/direct.openmoko.com/admin/includes/languages/english/infobox_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/english/infobox_configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/english/information.php
   trunk/direct.openmoko.com/admin/includes/languages/english/invoice.php
   trunk/direct.openmoko.com/admin/includes/languages/english/languages.php
   trunk/direct.openmoko.com/admin/includes/languages/english/link_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/english/links.php
   trunk/direct.openmoko.com/admin/includes/languages/english/links_contact.php
   trunk/direct.openmoko.com/admin/includes/languages/english/login.php
   trunk/direct.openmoko.com/admin/includes/languages/english/logoff.php
   trunk/direct.openmoko.com/admin/includes/languages/english/mail.php
   trunk/direct.openmoko.com/admin/includes/languages/english/manufacturers.php
   trunk/direct.openmoko.com/admin/includes/languages/english/members.php
   trunk/direct.openmoko.com/admin/includes/languages/english/modules.php
   trunk/direct.openmoko.com/admin/includes/languages/english/modules/
   trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/
   trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/affiliate_newsletter.php
   trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/newsletter.php
   trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/product_notification.php
   trunk/direct.openmoko.com/admin/includes/languages/english/navmenu.php
   trunk/direct.openmoko.com/admin/includes/languages/english/newsletters.php
   trunk/direct.openmoko.com/admin/includes/languages/english/orderlist.php
   trunk/direct.openmoko.com/admin/includes/languages/english/orders.php
   trunk/direct.openmoko.com/admin/includes/languages/english/orders_status.php
   trunk/direct.openmoko.com/admin/includes/languages/english/packaging.php
   trunk/direct.openmoko.com/admin/includes/languages/english/packingslip.php
   trunk/direct.openmoko.com/admin/includes/languages/english/pages.php
   trunk/direct.openmoko.com/admin/includes/languages/english/pages_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/english/popup_data_help.php
   trunk/direct.openmoko.com/admin/includes/languages/english/popup_ep_help.php
   trunk/direct.openmoko.com/admin/includes/languages/english/popup_infobox_help.php
   trunk/direct.openmoko.com/admin/includes/languages/english/product_extra_fields.php
   trunk/direct.openmoko.com/admin/includes/languages/english/product_list_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/english/products_attributes.php
   trunk/direct.openmoko.com/admin/includes/languages/english/products_expected.php
   trunk/direct.openmoko.com/admin/includes/languages/english/products_multi.php
   trunk/direct.openmoko.com/admin/includes/languages/english/removezip.php
   trunk/direct.openmoko.com/admin/includes/languages/english/reviews.php
   trunk/direct.openmoko.com/admin/includes/languages/english/salemaker.php
   trunk/direct.openmoko.com/admin/includes/languages/english/salemaker_info.php
   trunk/direct.openmoko.com/admin/includes/languages/english/server_info.php
   trunk/direct.openmoko.com/admin/includes/languages/english/shipwire.php
   trunk/direct.openmoko.com/admin/includes/languages/english/shopbyprice.php
   trunk/direct.openmoko.com/admin/includes/languages/english/specials.php
   trunk/direct.openmoko.com/admin/includes/languages/english/specialsbycategory.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_articles_viewed.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_credits.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_customers.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_customers_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_daily_products_sales_report.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_monthly_sales.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_not_valid_users.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_notifications.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_purchased.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_viewed.php
   trunk/direct.openmoko.com/admin/includes/languages/english/stats_sales_report2.php
   trunk/direct.openmoko.com/admin/includes/languages/english/tax_classes.php
   trunk/direct.openmoko.com/admin/includes/languages/english/tax_rates.php
   trunk/direct.openmoko.com/admin/includes/languages/english/template_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/english/template_configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/english/validate_new.php
   trunk/direct.openmoko.com/admin/includes/languages/english/whos_online.php
   trunk/direct.openmoko.com/admin/includes/languages/english/xsell_products.php
   trunk/direct.openmoko.com/admin/includes/languages/english/zones.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/abandoned_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_account.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_files.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_members.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_affiliates.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_banner_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_banners.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_clicks.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_contact.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_invoice.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_news.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_newsletters.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_payment.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_sales.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_summary.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/algo_fraud_screener.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/article_reviews.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/article_search.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/articles.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/articles_config.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/articles_xsell.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/attributes_sorter.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/authors.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/backup.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/backup_mysql.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/banner_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/banner_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/c_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/cache.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/categories.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/check_lang.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/countries.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/coupon_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/coupon_restrict.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account_process.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account_success.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_payment.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_process.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_shipping.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_convert.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_convert_1.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_purge.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_update.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/currencies.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/customers.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/customers_groups.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/data.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/data_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/define_language.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/define_mainpage.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/document.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/easypopulate.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_key.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_textdata.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/email_subjects.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/events_calendar.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/events_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/faq.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/faq_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/feature_not_present.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/featured.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/file_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/forbiden.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/froogle.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/froogle_pre.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/geo_zones.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_mail.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_queue.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_report.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_sent.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/header_tags_controller.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/header_tags_popup_help.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/data_help.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index2.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index3.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index4.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index5.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/none.txt
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_cat.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_misc.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/edit_key_help.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/edit_textdata_help.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/data_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/edit_key_help.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page1.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page2.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page3.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page4.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page5.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page6.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7a.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7b.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7c.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/cofigure_filename.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure1a.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure2.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure3.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure_filename1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_button.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_nobutton.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_not.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_ok.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/d_c_main.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/d_c_main_all.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/e_c_order.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/e_c_order1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/e_c_order_d_e.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/encrypt1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/encrypt2.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/item_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_createt.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_edit.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_main.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_new_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_new_saved.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_save.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_saved.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_start.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/order_edit.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/order_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/pixel_trans.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/test1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/test2.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_basicexport.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_basicimport.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_epbasic.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_error.txt
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_export.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_feed_intro.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_frooglebacisgettingstarted.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_froogleconfigure.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_froogleconfigure1.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_frooglerun.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_import.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_intro.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_spreadsheet.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_export_results.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_field_group.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_add.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_delete.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_split.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_start.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_uploaded_insert.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_uploaded_results.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_limit_cat.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_limit_man.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_limit_prodid.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_sel_export.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_sortorder.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_start.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export_mesg.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export_sel_feld.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export_sel_loc.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_import.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_import_mesg.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_import_select.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_config.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_config1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_new_config.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_start.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_catbuild.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_catbuilddone.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_feedbuilddone.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_feedsend_error1.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/import_results.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/item_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_edit_file.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_edit_restore.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_list.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_search_t_before.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_search_t_results.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_searcht.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_main.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_select_lng.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_dir.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_file.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_insert.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_lngr.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_lngr_grem.png
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index2.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index3.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index4.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index5.html
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/authnet_help.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal/Help_Config.inc.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal/Help_FAQs.inc.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_activate.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_add_article.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_add_field.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_add_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_files.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_group.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_groups.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_home.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_member.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_members.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_permission.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_remove.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_banners.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_billing.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_sales.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_back.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_backup.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_blank.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_browse.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_cancel.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_cancel_edit_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_check_link.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_check_links.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_confirm.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_confirm_red.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_continue.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_convert.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_copy.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_copy_to.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_create.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_create_customer.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_create_order.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_decrypt.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_delete.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_details.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_download.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_attributes.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_footer.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_header.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_infoboxes.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_key.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_lang_define.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_mainpage.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_order.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_small.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_status.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_values.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_email.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_encrypt.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_file_manager.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_free_signup.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_insert.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_insert_into_db.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_invoice.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_lock.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_module_install.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_module_remove.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_move.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_article.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_author.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_banner.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_category.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_country.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_currency.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_event.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_faq.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_file.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_folder.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_language.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_link.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_news_item.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_newsletter.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_sale.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_tax_class.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_tax_rate.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_topic.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_zone.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_next.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_orders.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_packingslip.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_preview.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_preview_upload.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_print.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_print_page.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_process.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_quick_save.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_release.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_remove_fields.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_removeccinfo.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_report.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_reset.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_restore.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_return.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_review_approve.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_review_disapprove.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_run.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save_edit_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save_finish.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save_reload.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_search.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_select.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_send.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_send_mail.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_split_file.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_spllit_files.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_start_file_creation.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_template_admin.psd
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_unlock.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_box_positions.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_currencies.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_fields.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_status.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_upload.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_verify.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/ic_down.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/ic_up.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/review_approve.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/review_disapprove.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/sync.gif
   trunk/direct.openmoko.com/admin/includes/languages/espanol/index.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/index_new.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/infobox_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/infobox_configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/information.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/invoice.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/languages.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/link_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/links.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/links_contact.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/login.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/logoff.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/mail.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/manufacturers.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/members.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/modules.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/
   trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/affiliate_newsletter.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/newsletter.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/product_notification.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/navmenu.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/newsletters.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/orderlist.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/orders.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/orders_status.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/packingslip.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/pages.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/pages_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_data_help.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_ep_help.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_infobox_help.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/product_extra_fields.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/product_list_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/products_attributes.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/products_expected.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/products_multi.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/removezip.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/reviews.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/salemaker.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/salemaker_info.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/server_info.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/shipwire.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/shopbyprice.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/specials.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/specialsbycategory.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_articles_viewed.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_credits.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_customers.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_customers_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_daily_products_sales_report.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_monthly_sales.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_not_valid_users.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_notifications.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_purchased.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_viewed.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_sales_report2.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/tax_classes.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/tax_rates.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/template_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/template_configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/validate_new.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/whos_online.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/xsell_products.php
   trunk/direct.openmoko.com/admin/includes/languages/espanol/zones.php
   trunk/direct.openmoko.com/admin/includes/languages/french.php
   trunk/direct.openmoko.com/admin/includes/languages/french/
   trunk/direct.openmoko.com/admin/includes/languages/french/abandoned_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/french/add_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/french/admin_account.php
   trunk/direct.openmoko.com/admin/includes/languages/french/admin_files.php
   trunk/direct.openmoko.com/admin/includes/languages/french/admin_members.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_affiliates.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_banner_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_banners.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_clicks.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_contact.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_invoice.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_news.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_newsletters.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_payment.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_sales.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_summary.php
   trunk/direct.openmoko.com/admin/includes/languages/french/algo_fraud_screener.php
   trunk/direct.openmoko.com/admin/includes/languages/french/article_reviews.php
   trunk/direct.openmoko.com/admin/includes/languages/french/article_search.php
   trunk/direct.openmoko.com/admin/includes/languages/french/articles.php
   trunk/direct.openmoko.com/admin/includes/languages/french/articles_config.php
   trunk/direct.openmoko.com/admin/includes/languages/french/articles_xsell.php
   trunk/direct.openmoko.com/admin/includes/languages/french/attributes_sorter.php
   trunk/direct.openmoko.com/admin/includes/languages/french/authors.php
   trunk/direct.openmoko.com/admin/includes/languages/french/backup.php
   trunk/direct.openmoko.com/admin/includes/languages/french/backup_mysql.php
   trunk/direct.openmoko.com/admin/includes/languages/french/banner_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/french/banner_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/french/c_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/french/cache.php
   trunk/direct.openmoko.com/admin/includes/languages/french/categories.php
   trunk/direct.openmoko.com/admin/includes/languages/french/check_lang.php
   trunk/direct.openmoko.com/admin/includes/languages/french/configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/french/countries.php
   trunk/direct.openmoko.com/admin/includes/languages/french/coupon_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/french/coupon_restrict.php
   trunk/direct.openmoko.com/admin/includes/languages/french/create_account.php
   trunk/direct.openmoko.com/admin/includes/languages/french/create_account_process.php
   trunk/direct.openmoko.com/admin/includes/languages/french/create_account_success.php
   trunk/direct.openmoko.com/admin/includes/languages/french/create_order.php
   trunk/direct.openmoko.com/admin/includes/languages/french/create_order_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/french/create_order_payment.php
   trunk/direct.openmoko.com/admin/includes/languages/french/create_order_process.php
   trunk/direct.openmoko.com/admin/includes/languages/french/create_order_shipping.php
   trunk/direct.openmoko.com/admin/includes/languages/french/crypt.php
   trunk/direct.openmoko.com/admin/includes/languages/french/crypt_convert.php
   trunk/direct.openmoko.com/admin/includes/languages/french/crypt_convert_1.php
   trunk/direct.openmoko.com/admin/includes/languages/french/crypt_purge.php
   trunk/direct.openmoko.com/admin/includes/languages/french/crypt_update.php
   trunk/direct.openmoko.com/admin/includes/languages/french/currencies.php
   trunk/direct.openmoko.com/admin/includes/languages/french/customers.php
   trunk/direct.openmoko.com/admin/includes/languages/french/customers_groups.php
   trunk/direct.openmoko.com/admin/includes/languages/french/data.php
   trunk/direct.openmoko.com/admin/includes/languages/french/data_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/french/define_language.php
   trunk/direct.openmoko.com/admin/includes/languages/french/define_mainpage.php
   trunk/direct.openmoko.com/admin/includes/languages/french/document.php
   trunk/direct.openmoko.com/admin/includes/languages/french/easypopulate.php
   trunk/direct.openmoko.com/admin/includes/languages/french/edit_key.php
   trunk/direct.openmoko.com/admin/includes/languages/french/edit_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/french/edit_textdata.php
   trunk/direct.openmoko.com/admin/includes/languages/french/email_subjects.php
   trunk/direct.openmoko.com/admin/includes/languages/french/events_calendar.php
   trunk/direct.openmoko.com/admin/includes/languages/french/events_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/french/faq.php
   trunk/direct.openmoko.com/admin/includes/languages/french/faq_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/french/feature_not_present.php
   trunk/direct.openmoko.com/admin/includes/languages/french/featured.php
   trunk/direct.openmoko.com/admin/includes/languages/french/file_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/french/forbiden.php
   trunk/direct.openmoko.com/admin/includes/languages/french/froogle.php
   trunk/direct.openmoko.com/admin/includes/languages/french/froogle_pre.php
   trunk/direct.openmoko.com/admin/includes/languages/french/geo_zones.php
   trunk/direct.openmoko.com/admin/includes/languages/french/gv_mail.php
   trunk/direct.openmoko.com/admin/includes/languages/french/gv_queue.php
   trunk/direct.openmoko.com/admin/includes/languages/french/gv_report.php
   trunk/direct.openmoko.com/admin/includes/languages/french/gv_sent.php
   trunk/direct.openmoko.com/admin/includes/languages/french/header_tags_controller.php
   trunk/direct.openmoko.com/admin/includes/languages/french/header_tags_popup_help.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/data_help.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/images/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index2.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index3.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index4.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index5.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/none.txt
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_cat.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_misc.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/edit_key_help.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/edit_textdata_help.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/data_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/edit_key_help.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page1.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page2.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page3.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page4.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page5.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page6.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7a.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7b.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7c.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/cofigure_filename.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure1a.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure2.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure3.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure_filename1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_button.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_nobutton.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_not.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_ok.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/d_c_main.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/d_c_main_all.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/e_c_order.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/e_c_order1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/e_c_order_d_e.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/encrypt1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/encrypt2.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/item_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_createt.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_edit.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_main.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_new_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_new_saved.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_save.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_saved.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_start.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/order_edit.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/order_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/pixel_trans.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/test1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/test2.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_basicexport.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_basicimport.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_epbasic.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_error.txt
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_export.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_feed_intro.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_frooglebacisgettingstarted.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_froogleconfigure.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_froogleconfigure1.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_frooglerun.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_import.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_intro.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_spreadsheet.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_export_results.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_field_group.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_add.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_delete.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_split.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_start.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_uploaded_insert.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_uploaded_results.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_limit_cat.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_limit_man.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_limit_prodid.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_sel_export.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_sortorder.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_start.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export_mesg.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export_sel_feld.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export_sel_loc.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_import.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_import_mesg.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_import_select.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_config.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_config1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_new_config.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_start.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_catbuild.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_catbuilddone.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_feedbuilddone.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_feedsend_error1.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/import_results.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/item_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_edit_file.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_edit_restore.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_list.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_search_t_before.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_search_t_results.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_searcht.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_main.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_select_lng.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_dir.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_file.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_insert.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_lngr.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_lngr_grem.png
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index2.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index3.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index4.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index5.html
   trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/authnet_help.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/paypal/
   trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/paypal/Help_Config.inc.php
   trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/paypal/Help_FAQs.inc.php
   trunk/direct.openmoko.com/admin/includes/languages/french/images/
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_activate.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_add_article.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_add_field.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_add_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_files.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_group.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_groups.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_home.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_member.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_members.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_permission.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_remove.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_banners.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_billing.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_sales.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_back.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_backup.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_base.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_blank.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_browse.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_cancel.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_cancel_edit_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_check_link.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_check_links.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_confirm.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_confirm_red.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_continue.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_convert.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_copy.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_copy_to.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_create.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_create_customer.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_create_order.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_decrypt.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_define.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_delete.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_details.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_download.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_attributes.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_footer.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_header.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_infoboxes.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_key.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_lang_define.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_mainpage.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_order.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_small.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_status.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_values.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_email.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_encrypt.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_file_manager.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_free_signup.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_insert.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_insert_into_db.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_invoice.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_lock.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_module_install.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_module_remove.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_move.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_article.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_author.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_banner.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_category.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_country.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_currency.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_event.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_faq.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_file.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_folder.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_language.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_link.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_news_item.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_newsletter.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_sale.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_tax_class.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_tax_rate.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_topic.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_zone.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_next.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_orders.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_packingslip.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_preview.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_preview_upload.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_print.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_print_page.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_process.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_quick_save.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_release.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_remove_fields.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_removeccinfo.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_report.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_reset.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_restore.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_return.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_review_approve.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_review_disapprove.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_run.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save_edit_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save_finish.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save_reload.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_search.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_select.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_send.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_send_mail.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_split_file.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_spllit_files.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_start_file_creation.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_template_admin.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_template_admin.psd
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_unlock.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_box_positions.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_currencies.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_fields.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_status.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_upload.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_verify.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/ic_down.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/ic_up.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/review_approve.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/review_disapprove.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/sync.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/images/icon.gif
   trunk/direct.openmoko.com/admin/includes/languages/french/index.php
   trunk/direct.openmoko.com/admin/includes/languages/french/index_new.php
   trunk/direct.openmoko.com/admin/includes/languages/french/infobox_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/french/infobox_configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/french/information.php
   trunk/direct.openmoko.com/admin/includes/languages/french/invoice.php
   trunk/direct.openmoko.com/admin/includes/languages/french/languages.php
   trunk/direct.openmoko.com/admin/includes/languages/french/link_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/french/links.php
   trunk/direct.openmoko.com/admin/includes/languages/french/links_contact.php
   trunk/direct.openmoko.com/admin/includes/languages/french/login.php
   trunk/direct.openmoko.com/admin/includes/languages/french/logoff.php
   trunk/direct.openmoko.com/admin/includes/languages/french/mail.php
   trunk/direct.openmoko.com/admin/includes/languages/french/manufacturers.php
   trunk/direct.openmoko.com/admin/includes/languages/french/members.php
   trunk/direct.openmoko.com/admin/includes/languages/french/modules.php
   trunk/direct.openmoko.com/admin/includes/languages/french/modules/
   trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/
   trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/affiliate_newsletter.php
   trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/newsletter.php
   trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/product_notification.php
   trunk/direct.openmoko.com/admin/includes/languages/french/navmenu.php
   trunk/direct.openmoko.com/admin/includes/languages/french/newsletters.php
   trunk/direct.openmoko.com/admin/includes/languages/french/orderlist.php
   trunk/direct.openmoko.com/admin/includes/languages/french/orders.php
   trunk/direct.openmoko.com/admin/includes/languages/french/orders_status.php
   trunk/direct.openmoko.com/admin/includes/languages/french/packingslip.php
   trunk/direct.openmoko.com/admin/includes/languages/french/pages.php
   trunk/direct.openmoko.com/admin/includes/languages/french/pages_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/french/popup_data_help.php
   trunk/direct.openmoko.com/admin/includes/languages/french/popup_ep_help.php
   trunk/direct.openmoko.com/admin/includes/languages/french/popup_infobox_help.php
   trunk/direct.openmoko.com/admin/includes/languages/french/product_extra_fields.php
   trunk/direct.openmoko.com/admin/includes/languages/french/product_list_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/french/products_attributes.php
   trunk/direct.openmoko.com/admin/includes/languages/french/products_expected.php
   trunk/direct.openmoko.com/admin/includes/languages/french/products_multi.php
   trunk/direct.openmoko.com/admin/includes/languages/french/removezip.php
   trunk/direct.openmoko.com/admin/includes/languages/french/reviews.php
   trunk/direct.openmoko.com/admin/includes/languages/french/salemaker.php
   trunk/direct.openmoko.com/admin/includes/languages/french/salemaker_info.php
   trunk/direct.openmoko.com/admin/includes/languages/french/server_info.php
   trunk/direct.openmoko.com/admin/includes/languages/french/shipwire.php
   trunk/direct.openmoko.com/admin/includes/languages/french/shopbyprice.php
   trunk/direct.openmoko.com/admin/includes/languages/french/specials.php
   trunk/direct.openmoko.com/admin/includes/languages/french/specialsbycategory.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_articles_viewed.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_credits.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_customers.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_customers_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_daily_products_sales_report.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_monthly_sales.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_not_valid_users.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_notifications.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_purchased.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_viewed.php
   trunk/direct.openmoko.com/admin/includes/languages/french/stats_sales_report2.php
   trunk/direct.openmoko.com/admin/includes/languages/french/tax_classes.php
   trunk/direct.openmoko.com/admin/includes/languages/french/tax_rates.php
   trunk/direct.openmoko.com/admin/includes/languages/french/template_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/french/template_configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/french/validate_new.php
   trunk/direct.openmoko.com/admin/includes/languages/french/whos_online.php
   trunk/direct.openmoko.com/admin/includes/languages/french/xsell_products.php
   trunk/direct.openmoko.com/admin/includes/languages/french/zones.php
   trunk/direct.openmoko.com/admin/includes/languages/german.php
   trunk/direct.openmoko.com/admin/includes/languages/german/
   trunk/direct.openmoko.com/admin/includes/languages/german/abandoned_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/german/admin_account.php
   trunk/direct.openmoko.com/admin/includes/languages/german/admin_files.php
   trunk/direct.openmoko.com/admin/includes/languages/german/admin_members.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_affiliates.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_banner_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_banners.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_clicks.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_contact.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_invoice.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_news.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_newsletters.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_payment.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_sales.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_summary.php
   trunk/direct.openmoko.com/admin/includes/languages/german/algo_fraud_screener.php
   trunk/direct.openmoko.com/admin/includes/languages/german/article_reviews.php
   trunk/direct.openmoko.com/admin/includes/languages/german/article_search.php
   trunk/direct.openmoko.com/admin/includes/languages/german/articles.php
   trunk/direct.openmoko.com/admin/includes/languages/german/articles_config.php
   trunk/direct.openmoko.com/admin/includes/languages/german/articles_xsell.php
   trunk/direct.openmoko.com/admin/includes/languages/german/attributes_sorter.php
   trunk/direct.openmoko.com/admin/includes/languages/german/authors.php
   trunk/direct.openmoko.com/admin/includes/languages/german/backup.php
   trunk/direct.openmoko.com/admin/includes/languages/german/backup_mysql.php
   trunk/direct.openmoko.com/admin/includes/languages/german/banner_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/german/banner_statistics.php
   trunk/direct.openmoko.com/admin/includes/languages/german/c_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/german/cache.php
   trunk/direct.openmoko.com/admin/includes/languages/german/categories.php
   trunk/direct.openmoko.com/admin/includes/languages/german/check_lang.php
   trunk/direct.openmoko.com/admin/includes/languages/german/configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/german/countries.php
   trunk/direct.openmoko.com/admin/includes/languages/german/coupon_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/german/coupon_restrict.php
   trunk/direct.openmoko.com/admin/includes/languages/german/create_account.php
   trunk/direct.openmoko.com/admin/includes/languages/german/create_account_process.php
   trunk/direct.openmoko.com/admin/includes/languages/german/create_account_success.php
   trunk/direct.openmoko.com/admin/includes/languages/german/create_order.php
   trunk/direct.openmoko.com/admin/includes/languages/german/create_order_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/german/create_order_payment.php
   trunk/direct.openmoko.com/admin/includes/languages/german/create_order_process.php
   trunk/direct.openmoko.com/admin/includes/languages/german/create_order_shipping.php
   trunk/direct.openmoko.com/admin/includes/languages/german/crypt.php
   trunk/direct.openmoko.com/admin/includes/languages/german/crypt_convert.php
   trunk/direct.openmoko.com/admin/includes/languages/german/crypt_convert_1.php
   trunk/direct.openmoko.com/admin/includes/languages/german/crypt_purge.php
   trunk/direct.openmoko.com/admin/includes/languages/german/crypt_update.php
   trunk/direct.openmoko.com/admin/includes/languages/german/currencies.php
   trunk/direct.openmoko.com/admin/includes/languages/german/customers.php
   trunk/direct.openmoko.com/admin/includes/languages/german/customers_groups.php
   trunk/direct.openmoko.com/admin/includes/languages/german/data.php
   trunk/direct.openmoko.com/admin/includes/languages/german/data_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/german/define_language.php
   trunk/direct.openmoko.com/admin/includes/languages/german/define_mainpage.php
   trunk/direct.openmoko.com/admin/includes/languages/german/document.php
   trunk/direct.openmoko.com/admin/includes/languages/german/easypopulate.php
   trunk/direct.openmoko.com/admin/includes/languages/german/edit_key.php
   trunk/direct.openmoko.com/admin/includes/languages/german/edit_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/german/edit_textdata.php
   trunk/direct.openmoko.com/admin/includes/languages/german/email_subjects.php
   trunk/direct.openmoko.com/admin/includes/languages/german/events_calendar.php
   trunk/direct.openmoko.com/admin/includes/languages/german/events_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/german/faq.php
   trunk/direct.openmoko.com/admin/includes/languages/german/faq_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/german/feature_not_present.php
   trunk/direct.openmoko.com/admin/includes/languages/german/featured.php
   trunk/direct.openmoko.com/admin/includes/languages/german/file_manager.php
   trunk/direct.openmoko.com/admin/includes/languages/german/forbiden.php
   trunk/direct.openmoko.com/admin/includes/languages/german/froogle.php
   trunk/direct.openmoko.com/admin/includes/languages/german/froogle_pre.php
   trunk/direct.openmoko.com/admin/includes/languages/german/geo_zones.php
   trunk/direct.openmoko.com/admin/includes/languages/german/gv_mail.php
   trunk/direct.openmoko.com/admin/includes/languages/german/gv_queue.php
   trunk/direct.openmoko.com/admin/includes/languages/german/gv_report.php
   trunk/direct.openmoko.com/admin/includes/languages/german/gv_sent.php
   trunk/direct.openmoko.com/admin/includes/languages/german/header_tags_controller.php
   trunk/direct.openmoko.com/admin/includes/languages/german/header_tags_popup_help.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/data_help.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/images/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index2.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index3.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index4.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index5.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/none.txt
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_cat.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_misc.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/edit_key_help.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/edit_textdata_help.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/data_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/edit_key_help.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page1.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page2.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page3.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page4.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page5.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page6.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7a.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7b.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7c.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/cofigure_filename.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure1a.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure2.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure3.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure_filename1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_button.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_nobutton.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_not.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_ok.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/d_c_main.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/d_c_main_all.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/e_c_order.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/e_c_order1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/e_c_order_d_e.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/encrypt1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/encrypt2.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/item_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_createt.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_edit.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_main.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_new_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_new_saved.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_save.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_saved.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_start.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/order_edit.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/order_edit1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/pixel_trans.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/test1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/test2.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_basicexport.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_basicimport.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_epbasic.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_error.txt
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_export.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_feed_intro.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_frooglebacisgettingstarted.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_froogleconfigure.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_froogleconfigure1.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_frooglerun.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_import.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_intro.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_intro.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_spreadsheet.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_export_results.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_field_group.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_add.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_delete.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_split.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_start.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_uploaded_insert.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_uploaded_results.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_limit_cat.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_limit_man.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_limit_prodid.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_sel_export.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_sortorder.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_start.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export_mesg.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export_sel_feld.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export_sel_loc.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_import.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_import_mesg.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_import_select.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_config.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_config1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_new_config.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_start.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_catbuild.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_catbuilddone.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_feedbuilddone.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_feedsend_error1.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/item_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_edit_file.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_edit_restore.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_list.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_search_t_before.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_search_t_results.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_searcht.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_main.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_select_lng.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_dir.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_file.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_insert.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_lngr.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_lngr_grem.png
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index2.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index3.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index4.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index5.html
   trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/authnet_help.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/paypal/
   trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/paypal/Help_Config.inc.php
   trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/paypal/Help_FAQs.inc.php
   trunk/direct.openmoko.com/admin/includes/languages/german/images/
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_activate.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_add_article.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_add_field.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_add_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_files.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_group.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_groups.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_home.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_member.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_members.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_permission.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_remove.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_banners.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_billing.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_sales.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_back.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_backup.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_blank.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_browse.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_cancel.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_cancel_edit_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_check_link.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_check_links.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_confirm.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_confirm_red.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_continue.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_convert.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_copy.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_copy_to.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_create.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_create_customer.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_create_order.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_decrypt.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_delete.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_details.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_download.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_attributes.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_footer.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_header.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_infoboxes.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_key.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_lang_define.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_mainpage.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_order.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_small.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_status.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_values.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_email.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_encrypt.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_file_manager.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_free_signup.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_help.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_insert.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_insert_into_db.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_invoice.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_lock.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_module_install.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_module_remove.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_move.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_article.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_author.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_banner.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_category.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_country.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_currency.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_event.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_faq.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_file.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_folder.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_language.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_link.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_news_item.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_newsletter.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_sale.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_tax_class.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_tax_rate.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_topic.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_zone.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_next.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_orders.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_packingslip.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_preview.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_preview_upload.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_print.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_print_page.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_process.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_quick_save.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_release.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_remove_fields.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_removeccinfo.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_report.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_reset.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_restore.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_return.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_review_approve.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_review_disapprove.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_run.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save_edit_product.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save_finish.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save_reload.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_search.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_select.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_send.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_send_mail.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_split_file.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_spllit_files.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_start_file_creation.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_template_admin.psd
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_unlock.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_box_positions.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_currencies.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_fields.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_status.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_upload.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_verify.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/ic_down.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/ic_up.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/review_approve.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/review_disapprove.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/sync.gif
   trunk/direct.openmoko.com/admin/includes/languages/german/index.php
   trunk/direct.openmoko.com/admin/includes/languages/german/index_new.php
   trunk/direct.openmoko.com/admin/includes/languages/german/infobox_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/german/infobox_configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/german/information.php
   trunk/direct.openmoko.com/admin/includes/languages/german/invoice.php
   trunk/direct.openmoko.com/admin/includes/languages/german/languages.php
   trunk/direct.openmoko.com/admin/includes/languages/german/link_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/german/links.php
   trunk/direct.openmoko.com/admin/includes/languages/german/links_contact.php
   trunk/direct.openmoko.com/admin/includes/languages/german/login.php
   trunk/direct.openmoko.com/admin/includes/languages/german/logoff.php
   trunk/direct.openmoko.com/admin/includes/languages/german/mail.php
   trunk/direct.openmoko.com/admin/includes/languages/german/manufacturers.php
   trunk/direct.openmoko.com/admin/includes/languages/german/members.php
   trunk/direct.openmoko.com/admin/includes/languages/german/modules.php
   trunk/direct.openmoko.com/admin/includes/languages/german/modules/
   trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/
   trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/affiliate_newsletter.php
   trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/newsletter.php
   trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/product_notification.php
   trunk/direct.openmoko.com/admin/includes/languages/german/navmenu.php
   trunk/direct.openmoko.com/admin/includes/languages/german/newsletters.php
   trunk/direct.openmoko.com/admin/includes/languages/german/orderlist.php
   trunk/direct.openmoko.com/admin/includes/languages/german/orders.php
   trunk/direct.openmoko.com/admin/includes/languages/german/orders_status.php
   trunk/direct.openmoko.com/admin/includes/languages/german/packingslip.php
   trunk/direct.openmoko.com/admin/includes/languages/german/pages.php
   trunk/direct.openmoko.com/admin/includes/languages/german/pages_categories.php
   trunk/direct.openmoko.com/admin/includes/languages/german/popup_data_help.php
   trunk/direct.openmoko.com/admin/includes/languages/german/popup_ep_help.php
   trunk/direct.openmoko.com/admin/includes/languages/german/popup_infobox_help.php
   trunk/direct.openmoko.com/admin/includes/languages/german/product_extra_fields.php
   trunk/direct.openmoko.com/admin/includes/languages/german/product_list_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/german/products_attributes.php
   trunk/direct.openmoko.com/admin/includes/languages/german/products_expected.php
   trunk/direct.openmoko.com/admin/includes/languages/german/products_multi.php
   trunk/direct.openmoko.com/admin/includes/languages/german/removezip.php
   trunk/direct.openmoko.com/admin/includes/languages/german/reviews.php
   trunk/direct.openmoko.com/admin/includes/languages/german/salemaker.php
   trunk/direct.openmoko.com/admin/includes/languages/german/salemaker_info.php
   trunk/direct.openmoko.com/admin/includes/languages/german/server_info.php
   trunk/direct.openmoko.com/admin/includes/languages/german/shipwire.php
   trunk/direct.openmoko.com/admin/includes/languages/german/shopbyprice.php
   trunk/direct.openmoko.com/admin/includes/languages/german/specials.php
   trunk/direct.openmoko.com/admin/includes/languages/german/specialsbycategory.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_articles_viewed.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_credits.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_customers.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_customers_orders.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_daily_products_sales_report.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_monthly_sales.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_not_valid_users.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_notifications.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_purchased.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_viewed.php
   trunk/direct.openmoko.com/admin/includes/languages/german/stats_sales_report2.php
   trunk/direct.openmoko.com/admin/includes/languages/german/tax_classes.php
   trunk/direct.openmoko.com/admin/includes/languages/german/tax_rates.php
   trunk/direct.openmoko.com/admin/includes/languages/german/template_admin.php
   trunk/direct.openmoko.com/admin/includes/languages/german/template_configuration.php
   trunk/direct.openmoko.com/admin/includes/languages/german/validate_new.php
   trunk/direct.openmoko.com/admin/includes/languages/german/whos_online.php
   trunk/direct.openmoko.com/admin/includes/languages/german/xsell_products.php
   trunk/direct.openmoko.com/admin/includes/languages/german/zones.php
   trunk/direct.openmoko.com/admin/includes/languages/order_edit_english.php
   trunk/direct.openmoko.com/admin/includes/languages/order_edit_espanol.php
   trunk/direct.openmoko.com/admin/includes/languages/order_edit_french.php
   trunk/direct.openmoko.com/admin/includes/languages/order_edit_german.php
   trunk/direct.openmoko.com/admin/includes/local/
   trunk/direct.openmoko.com/admin/includes/local/README
   trunk/direct.openmoko.com/admin/includes/menu.css
   trunk/direct.openmoko.com/admin/includes/menu.js
   trunk/direct.openmoko.com/admin/includes/modules/
   trunk/direct.openmoko.com/admin/includes/modules/account_details.php
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/FraudScreenClient.php
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/algo_fraud_screener.php
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_footer_left.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_footer_r.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_header_r.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_header_right.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/icon-maps.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r0g5.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r1g4.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r2g3.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r3g2.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r4g1.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r5g0.gif
   trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/map.php
   trunk/direct.openmoko.com/admin/includes/modules/create_order_details.php
   trunk/direct.openmoko.com/admin/includes/modules/newsletters/
   trunk/direct.openmoko.com/admin/includes/modules/newsletters/affiliate_newsletter.php
   trunk/direct.openmoko.com/admin/includes/modules/newsletters/newsletter.php
   trunk/direct.openmoko.com/admin/includes/modules/newsletters/product_notification.php
   trunk/direct.openmoko.com/admin/includes/printer.css
   trunk/direct.openmoko.com/admin/includes/runtime/
   trunk/direct.openmoko.com/admin/includes/stylesheet.css
   trunk/direct.openmoko.com/admin/includes/tld.txt
   trunk/direct.openmoko.com/admin/includes/version.php
   trunk/direct.openmoko.com/admin/includes/warnings.php
   trunk/direct.openmoko.com/admin/index.php
   trunk/direct.openmoko.com/admin/infobox_admin.php
   trunk/direct.openmoko.com/admin/infobox_configuration.php
   trunk/direct.openmoko.com/admin/information_form.php
   trunk/direct.openmoko.com/admin/information_list.php
   trunk/direct.openmoko.com/admin/information_manager.php
   trunk/direct.openmoko.com/admin/install-explain.php
   trunk/direct.openmoko.com/admin/invoice.php
   trunk/direct.openmoko.com/admin/ipn_test_panel.php
   trunk/direct.openmoko.com/admin/languages.php
   trunk/direct.openmoko.com/admin/link_categories.php
   trunk/direct.openmoko.com/admin/links.php
   trunk/direct.openmoko.com/admin/links_contact.php
   trunk/direct.openmoko.com/admin/listcategories.php
   trunk/direct.openmoko.com/admin/listproducts.php
   trunk/direct.openmoko.com/admin/login.php
   trunk/direct.openmoko.com/admin/logoff.php
   trunk/direct.openmoko.com/admin/mail.php
   trunk/direct.openmoko.com/admin/manufacturers.php
   trunk/direct.openmoko.com/admin/members.php
   trunk/direct.openmoko.com/admin/menu.css
   trunk/direct.openmoko.com/admin/menu.js
   trunk/direct.openmoko.com/admin/modules.php
   trunk/direct.openmoko.com/admin/navmenu.php
   trunk/direct.openmoko.com/admin/newsletters.php
   trunk/direct.openmoko.com/admin/options_categories.php
   trunk/direct.openmoko.com/admin/orderlist-styles.css
   trunk/direct.openmoko.com/admin/orderlist.php
   trunk/direct.openmoko.com/admin/orders.php
   trunk/direct.openmoko.com/admin/orders_status.php
   trunk/direct.openmoko.com/admin/packaging.php
   trunk/direct.openmoko.com/admin/packingslip.php
   trunk/direct.openmoko.com/admin/pages.php
   trunk/direct.openmoko.com/admin/pages_categories.php
   trunk/direct.openmoko.com/admin/password_forgotten.php
   trunk/direct.openmoko.com/admin/paypal.php
   trunk/direct.openmoko.com/admin/popup_data_help.php
   trunk/direct.openmoko.com/admin/popup_encrypt_help.php
   trunk/direct.openmoko.com/admin/popup_ep_help.php
   trunk/direct.openmoko.com/admin/popup_image.php
   trunk/direct.openmoko.com/admin/popup_infobox_help.php
   trunk/direct.openmoko.com/admin/print.css
   trunk/direct.openmoko.com/admin/product_list_admin.php
   trunk/direct.openmoko.com/admin/products_attributes.php
   trunk/direct.openmoko.com/admin/products_expected.php
   trunk/direct.openmoko.com/admin/products_multi.php
   trunk/direct.openmoko.com/admin/quick_attributes_popup.php
   trunk/direct.openmoko.com/admin/quick_products_popup.php
   trunk/direct.openmoko.com/admin/quickcom_help.php
   trunk/direct.openmoko.com/admin/results.inc.php
   trunk/direct.openmoko.com/admin/reviews.php
   trunk/direct.openmoko.com/admin/rsslink.php
   trunk/direct.openmoko.com/admin/salemaker.php
   trunk/direct.openmoko.com/admin/salemaker_info.php
   trunk/direct.openmoko.com/admin/select_color.htm
   trunk/direct.openmoko.com/admin/server_info.php
   trunk/direct.openmoko.com/admin/shipwire.php
   trunk/direct.openmoko.com/admin/shopbyprice.php
   trunk/direct.openmoko.com/admin/specials.php
   trunk/direct.openmoko.com/admin/ssl_check.php
   trunk/direct.openmoko.com/admin/stats_articles_viewed.php
   trunk/direct.openmoko.com/admin/stats_credits.php
   trunk/direct.openmoko.com/admin/stats_customers.php
   trunk/direct.openmoko.com/admin/stats_customers_orders.php
   trunk/direct.openmoko.com/admin/stats_daily_products_sales_report.php
   trunk/direct.openmoko.com/admin/stats_explain_queries.php
   trunk/direct.openmoko.com/admin/stats_monthly_sales.php
   trunk/direct.openmoko.com/admin/stats_not_valid_users.php
   trunk/direct.openmoko.com/admin/stats_products_notifications.php
   trunk/direct.openmoko.com/admin/stats_products_purchased.php
   trunk/direct.openmoko.com/admin/stats_products_viewed.php
   trunk/direct.openmoko.com/admin/stats_sales_report2.php
   trunk/direct.openmoko.com/admin/stats_wishlist.php
   trunk/direct.openmoko.com/admin/tax_classes.php
   trunk/direct.openmoko.com/admin/tax_rates.php
   trunk/direct.openmoko.com/admin/template_admin.php
   trunk/direct.openmoko.com/admin/template_configuration.php
   trunk/direct.openmoko.com/admin/treeview.php
   trunk/direct.openmoko.com/admin/validate_new.php
   trunk/direct.openmoko.com/admin/validcategories.php
   trunk/direct.openmoko.com/admin/validproducts.php
   trunk/direct.openmoko.com/admin/whos_online.php
   trunk/direct.openmoko.com/admin/worldpay_help.php
   trunk/direct.openmoko.com/admin/xsell_products.php
   trunk/direct.openmoko.com/admin/zones.php
   trunk/direct.openmoko.com/advanced_search.php
   trunk/direct.openmoko.com/advanced_search_result.php
   trunk/direct.openmoko.com/affiliate_affiliate.php
   trunk/direct.openmoko.com/affiliate_banners.php
   trunk/direct.openmoko.com/affiliate_banners_banners.php
   trunk/direct.openmoko.com/affiliate_banners_build.php
   trunk/direct.openmoko.com/affiliate_banners_build_cat.php
   trunk/direct.openmoko.com/affiliate_banners_category.php
   trunk/direct.openmoko.com/affiliate_banners_product.php
   trunk/direct.openmoko.com/affiliate_banners_text.php
   trunk/direct.openmoko.com/affiliate_clicks.php
   trunk/direct.openmoko.com/affiliate_contact.php
   trunk/direct.openmoko.com/affiliate_details.php
   trunk/direct.openmoko.com/affiliate_details_ok.php
   trunk/direct.openmoko.com/affiliate_faq.php
   trunk/direct.openmoko.com/affiliate_help1.php
   trunk/direct.openmoko.com/affiliate_help10.php
   trunk/direct.openmoko.com/affiliate_help11.php
   trunk/direct.openmoko.com/affiliate_help12.php
   trunk/direct.openmoko.com/affiliate_help13.php
   trunk/direct.openmoko.com/affiliate_help14.php
   trunk/direct.openmoko.com/affiliate_help15.php
   trunk/direct.openmoko.com/affiliate_help16.php
   trunk/direct.openmoko.com/affiliate_help17.php
   trunk/direct.openmoko.com/affiliate_help18.php
   trunk/direct.openmoko.com/affiliate_help19.php
   trunk/direct.openmoko.com/affiliate_help2.php
   trunk/direct.openmoko.com/affiliate_help20.php
   trunk/direct.openmoko.com/affiliate_help21.php
   trunk/direct.openmoko.com/affiliate_help22.php
   trunk/direct.openmoko.com/affiliate_help3.php
   trunk/direct.openmoko.com/affiliate_help4.php
   trunk/direct.openmoko.com/affiliate_help5.php
   trunk/direct.openmoko.com/affiliate_help6.php
   trunk/direct.openmoko.com/affiliate_help7.php
   trunk/direct.openmoko.com/affiliate_help8.php
   trunk/direct.openmoko.com/affiliate_help9.php
   trunk/direct.openmoko.com/affiliate_info.php
   trunk/direct.openmoko.com/affiliate_logout.php
   trunk/direct.openmoko.com/affiliate_news.php
   trunk/direct.openmoko.com/affiliate_newsletter.php
   trunk/direct.openmoko.com/affiliate_password.php
   trunk/direct.openmoko.com/affiliate_password_forgotten.php
   trunk/direct.openmoko.com/affiliate_payment.php
   trunk/direct.openmoko.com/affiliate_reports.php
   trunk/direct.openmoko.com/affiliate_sales.php
   trunk/direct.openmoko.com/affiliate_show_banner.php
   trunk/direct.openmoko.com/affiliate_signup.php
   trunk/direct.openmoko.com/affiliate_signup_ok.php
   trunk/direct.openmoko.com/affiliate_summary.php
   trunk/direct.openmoko.com/affiliate_terms.php
   trunk/direct.openmoko.com/affiliate_terms_popup.php
   trunk/direct.openmoko.com/affiliate_validcats.php
   trunk/direct.openmoko.com/affiliate_validproducts.php
   trunk/direct.openmoko.com/all_prodcats.php
   trunk/direct.openmoko.com/all_prodmanf.php
   trunk/direct.openmoko.com/allprods.php
   trunk/direct.openmoko.com/article_info.php
   trunk/direct.openmoko.com/article_reviews.php
   trunk/direct.openmoko.com/article_reviews_info.php
   trunk/direct.openmoko.com/article_reviews_write.php
   trunk/direct.openmoko.com/article_search.php
   trunk/direct.openmoko.com/articles.php
   trunk/direct.openmoko.com/articles_new.php
   trunk/direct.openmoko.com/cache/
   trunk/direct.openmoko.com/cache/index.php
   trunk/direct.openmoko.com/cache/phpthumb/
   trunk/direct.openmoko.com/cache/phpthumb/index.php
   trunk/direct.openmoko.com/calendar_content.php
   trunk/direct.openmoko.com/cert/
   trunk/direct.openmoko.com/cert/cert_key_pem.txt
   trunk/direct.openmoko.com/check_lang.php
   trunk/direct.openmoko.com/checkout_confirmation.php
   trunk/direct.openmoko.com/checkout_payment.php
   trunk/direct.openmoko.com/checkout_payment_address.php
   trunk/direct.openmoko.com/checkout_paypalipn.php
   trunk/direct.openmoko.com/checkout_process.php
   trunk/direct.openmoko.com/checkout_shipping.php
   trunk/direct.openmoko.com/checkout_shipping_address.php
   trunk/direct.openmoko.com/checkout_success.php
   trunk/direct.openmoko.com/contact_us.php
   trunk/direct.openmoko.com/cookie_usage.php
   trunk/direct.openmoko.com/create_account.php
   trunk/direct.openmoko.com/create_account_success.php
   trunk/direct.openmoko.com/cvv.html
   trunk/direct.openmoko.com/debug/
   trunk/direct.openmoko.com/debug/.htaccess
   trunk/direct.openmoko.com/debug/authnet_debug.txt
   trunk/direct.openmoko.com/debug/firepay_debug.txt
   trunk/direct.openmoko.com/debug/plugnpay_debug.txt
   trunk/direct.openmoko.com/debug/propay_debug.txt
   trunk/direct.openmoko.com/debug/quickcommerce_debug.txt
   trunk/direct.openmoko.com/doc/
   trunk/direct.openmoko.com/down_for_maintenance.php
   trunk/direct.openmoko.com/download.php
   trunk/direct.openmoko.com/download/
   trunk/direct.openmoko.com/download/unreal.zip
   trunk/direct.openmoko.com/events_calendar.php
   trunk/direct.openmoko.com/ext/
   trunk/direct.openmoko.com/ext/modules/
   trunk/direct.openmoko.com/ext/modules/payment/
   trunk/direct.openmoko.com/ext/modules/payment/paypal_wpp/
   trunk/direct.openmoko.com/ext/modules/payment/paypal_wpp/ec.php
   trunk/direct.openmoko.com/faq.php
   trunk/direct.openmoko.com/featured_products.php
   trunk/direct.openmoko.com/gv_faq.php
   trunk/direct.openmoko.com/gv_redeem.php
   trunk/direct.openmoko.com/gv_send.php
   trunk/direct.openmoko.com/iam.php
   trunk/direct.openmoko.com/images/
   trunk/direct.openmoko.com/images/.htaccess
   trunk/direct.openmoko.com/images/00add_button.gif
   trunk/direct.openmoko.com/images/Book-4-mockup.jpg
   trunk/direct.openmoko.com/images/SPWstarwarskotorepublicgrn.gif.GIF
   trunk/direct.openmoko.com/images/SPWstarwarskotorepublicgrn.jpg
   trunk/direct.openmoko.com/images/account_notifications.gif
   trunk/direct.openmoko.com/images/account_orders.gif
   trunk/direct.openmoko.com/images/account_personal.gif
   trunk/direct.openmoko.com/images/affiliate_account.gif
   trunk/direct.openmoko.com/images/affiliate_clicks.gif
   trunk/direct.openmoko.com/images/affiliate_contact_us.gif
   trunk/direct.openmoko.com/images/affiliate_links.gif
   trunk/direct.openmoko.com/images/affiliate_news.gif
   trunk/direct.openmoko.com/images/affiliate_notifications.gif
   trunk/direct.openmoko.com/images/affiliate_orders.gif
   trunk/direct.openmoko.com/images/affiliate_payment.gif
   trunk/direct.openmoko.com/images/affiliate_reports.gif
   trunk/direct.openmoko.com/images/affiliate_sales.gif
   trunk/direct.openmoko.com/images/affiliate_summary.gif
   trunk/direct.openmoko.com/images/arrow_down.gif
   trunk/direct.openmoko.com/images/arrow_east_south.gif
   trunk/direct.openmoko.com/images/arrow_green.gif
   trunk/direct.openmoko.com/images/arrow_south_east.gif
   trunk/direct.openmoko.com/images/banners/
   trunk/direct.openmoko.com/images/banners/120x35ecomm.gif
   trunk/direct.openmoko.com/images/banners/120x60ecomm.gif
   trunk/direct.openmoko.com/images/banners/468x60ecomm.gif
   trunk/direct.openmoko.com/images/banners/blue-steel.gif
   trunk/direct.openmoko.com/images/banners/button-anim-manuals.gif
   trunk/direct.openmoko.com/images/banners/cre-button.gif
   trunk/direct.openmoko.com/images/banners/logo.gif
   trunk/direct.openmoko.com/images/banners/osc-offer.gif
   trunk/direct.openmoko.com/images/banners/oscommerce.gif
   trunk/direct.openmoko.com/images/banners/small_oscommerce.gif
   trunk/direct.openmoko.com/images/bannersosc-offer.gif
   trunk/direct.openmoko.com/images/blue-steel.gif
   trunk/direct.openmoko.com/images/box_products_notifications.gif
   trunk/direct.openmoko.com/images/box_products_notifications_remove.gif
   trunk/direct.openmoko.com/images/box_write_review.gif
   trunk/direct.openmoko.com/images/boxnboard.gif
   trunk/direct.openmoko.com/images/boxnboard.jpg
   trunk/direct.openmoko.com/images/car_kit.png
   trunk/direct.openmoko.com/images/car_kit_small.png
   trunk/direct.openmoko.com/images/car_kit_small2.png
   trunk/direct.openmoko.com/images/car_mount_small.png
   trunk/direct.openmoko.com/images/cards/
   trunk/direct.openmoko.com/images/cards/AMEX1.gif
   trunk/direct.openmoko.com/images/cards/Amex.gif
   trunk/direct.openmoko.com/images/cards/Amex_sm.gif
   trunk/direct.openmoko.com/images/cards/Australian_BankCard.gif
   trunk/direct.openmoko.com/images/cards/CS.gif
   trunk/direct.openmoko.com/images/cards/Carte_Blanche.gif
   trunk/direct.openmoko.com/images/cards/Delta.gif
   trunk/direct.openmoko.com/images/cards/Diners_Club.gif
   trunk/direct.openmoko.com/images/cards/Discover.gif
   trunk/direct.openmoko.com/images/cards/Discover_sm.gif
   trunk/direct.openmoko.com/images/cards/Eurocard.gif
   trunk/direct.openmoko.com/images/cards/JCB.gif
   trunk/direct.openmoko.com/images/cards/Logo_CreditCard_CarteBlanche.gif
   trunk/direct.openmoko.com/images/cards/Mastercard.gif
   trunk/direct.openmoko.com/images/cards/Mastercard_sm.gif
   trunk/direct.openmoko.com/images/cards/Mastro.gif
   trunk/direct.openmoko.com/images/cards/Solo.gif
   trunk/direct.openmoko.com/images/cards/UK_Electron.gif
   trunk/direct.openmoko.com/images/cards/UK_Switch.gif
   trunk/direct.openmoko.com/images/cards/Visa.gif
   trunk/direct.openmoko.com/images/cards/Visa_sm.gif
   trunk/direct.openmoko.com/images/cards/banner_euros.gif
   trunk/direct.openmoko.com/images/cards/cards.gif
   trunk/direct.openmoko.com/images/cards/cards1.gif
   trunk/direct.openmoko.com/images/cards/cards2.gif
   trunk/direct.openmoko.com/images/cards/credit_cards.gif
   trunk/direct.openmoko.com/images/cards/credit_cardsvm.gif
   trunk/direct.openmoko.com/images/cards/icon_amex.gif
   trunk/direct.openmoko.com/images/cards/icon_discover.gif
   trunk/direct.openmoko.com/images/cards/icon_mastercard.gif
   trunk/direct.openmoko.com/images/cards/icon_visa.gif
   trunk/direct.openmoko.com/images/cards/logo-xclick_paypal.gif
   trunk/direct.openmoko.com/images/cards/maestro.gif
   trunk/direct.openmoko.com/images/cards/mc_small.gif
   trunk/direct.openmoko.com/images/cards/paypal.bmp
   trunk/direct.openmoko.com/images/cards/paypal_logo.gif
   trunk/direct.openmoko.com/images/cards/pp3.gif
   trunk/direct.openmoko.com/images/cards/visa_small.gif
   trunk/direct.openmoko.com/images/cards/x-click_butcc_donate.gif
   trunk/direct.openmoko.com/images/carolynatmicrophone.jpg
   trunk/direct.openmoko.com/images/carrycover_small.png
   trunk/direct.openmoko.com/images/carrying_case.png
   trunk/direct.openmoko.com/images/carrying_tape.png
   trunk/direct.openmoko.com/images/cat_arrow_down.gif
   trunk/direct.openmoko.com/images/cat_arrow_other.gif
   trunk/direct.openmoko.com/images/cat_arrow_right.gif
   trunk/direct.openmoko.com/images/categories/
   trunk/direct.openmoko.com/images/categories/affiliate.gif
   trunk/direct.openmoko.com/images/category_dvd_movies.gif
   trunk/direct.openmoko.com/images/category_hardware.gif
   trunk/direct.openmoko.com/images/category_software.gif
   trunk/direct.openmoko.com/images/checkout_bullet.gif
   trunk/direct.openmoko.com/images/close_window.jpg
   trunk/direct.openmoko.com/images/crebook.jpg
   trunk/direct.openmoko.com/images/credit_cards.gif
   trunk/direct.openmoko.com/images/credit_cardsvm.gif
   trunk/direct.openmoko.com/images/cvm_help1.jpg
   trunk/direct.openmoko.com/images/cvm_help2.jpg
   trunk/direct.openmoko.com/images/cvv.jpg
   trunk/direct.openmoko.com/images/default.gif
   trunk/direct.openmoko.com/images/default/
   trunk/direct.openmoko.com/images/default/1.gif
   trunk/direct.openmoko.com/images/default/2.gif
   trunk/direct.openmoko.com/images/default/3.gif
   trunk/direct.openmoko.com/images/default/4.gif
   trunk/direct.openmoko.com/images/dvd/
   trunk/direct.openmoko.com/images/dvd/a_bugs_life.gif
   trunk/direct.openmoko.com/images/dvd/beloved.gif
   trunk/direct.openmoko.com/images/dvd/blade_runner.gif
   trunk/direct.openmoko.com/images/dvd/courage_under_fire.gif
   trunk/direct.openmoko.com/images/dvd/die_hard_3.gif
   trunk/direct.openmoko.com/images/dvd/fire_down_below.gif
   trunk/direct.openmoko.com/images/dvd/frantic.gif
   trunk/direct.openmoko.com/images/dvd/lethal_weapon.gif
   trunk/direct.openmoko.com/images/dvd/no_picture.gif
   trunk/direct.openmoko.com/images/dvd/red_corner.gif
   trunk/direct.openmoko.com/images/dvd/replacement_killers.gif
   trunk/direct.openmoko.com/images/dvd/speed.gif
   trunk/direct.openmoko.com/images/dvd/speed_2.gif
   trunk/direct.openmoko.com/images/dvd/the_matrix.gif
   trunk/direct.openmoko.com/images/dvd/theres_something_about_mary.gif
   trunk/direct.openmoko.com/images/dvd/under_siege.gif
   trunk/direct.openmoko.com/images/dvd/under_siege2.gif
   trunk/direct.openmoko.com/images/dvd/youve_got_mail.gif
   trunk/direct.openmoko.com/images/events_images/
   trunk/direct.openmoko.com/images/events_images/SaintJoTshirt_thumb.jpg
   trunk/direct.openmoko.com/images/events_images/Unbrella_thumb.jpg
   trunk/direct.openmoko.com/images/events_images/cart.gif
   trunk/direct.openmoko.com/images/faqdesk_test_osc_action.gif
   trunk/direct.openmoko.com/images/faqdesk_test_osc_cartoons.gif
   trunk/direct.openmoko.com/images/faqdesk_test_osc_graphic.gif
   trunk/direct.openmoko.com/images/fish.gif
   trunk/direct.openmoko.com/images/gallery_large03.jpg
   trunk/direct.openmoko.com/images/gallery_large03_1.jpg
   trunk/direct.openmoko.com/images/gift/
   trunk/direct.openmoko.com/images/gift/giftcert-25-lrg.gif
   trunk/direct.openmoko.com/images/gift/giftcert-25-sm.gif
   trunk/direct.openmoko.com/images/gift/giftcert-25.gif
   trunk/direct.openmoko.com/images/gift/giftcert-25.jpg
   trunk/direct.openmoko.com/images/gift/gv_100.gif
   trunk/direct.openmoko.com/images/gift/gv_25.gif
   trunk/direct.openmoko.com/images/gift/gv_25_lrg.gif
   trunk/direct.openmoko.com/images/gift/gv_50.gif
   trunk/direct.openmoko.com/images/giftcert-25-sm.gif
   trunk/direct.openmoko.com/images/gt_interactive/
   trunk/direct.openmoko.com/images/gt_interactive/disciples.gif
   trunk/direct.openmoko.com/images/gt_interactive/unreal_tournament.gif
   trunk/direct.openmoko.com/images/gt_interactive/wheel_of_time.gif
   trunk/direct.openmoko.com/images/gv_100.gif
   trunk/direct.openmoko.com/images/gv_25.gif
   trunk/direct.openmoko.com/images/gv_50.gif
   trunk/direct.openmoko.com/images/hackers_lunch_box.png
   trunk/direct.openmoko.com/images/hackers_lunchbox_small
   trunk/direct.openmoko.com/images/hackers_orange_small.png
   trunk/direct.openmoko.com/images/hackers_silver_small.png
   trunk/direct.openmoko.com/images/header_account.gif
   trunk/direct.openmoko.com/images/header_cart.gif
   trunk/direct.openmoko.com/images/header_checkout.gif
   trunk/direct.openmoko.com/images/icons/
   trunk/direct.openmoko.com/images/icons/Amex.gif
   trunk/direct.openmoko.com/images/icons/Discover.gif
   trunk/direct.openmoko.com/images/icons/Mastercard.gif
   trunk/direct.openmoko.com/images/icons/Visa.gif
   trunk/direct.openmoko.com/images/icons/cart.gif
   trunk/direct.openmoko.com/images/icons/confirm_red.gif
   trunk/direct.openmoko.com/images/icons/delete.gif
   trunk/direct.openmoko.com/images/icons/edit.gif
   trunk/direct.openmoko.com/images/icons/edit_2.gif
   trunk/direct.openmoko.com/images/icons/error.gif
   trunk/direct.openmoko.com/images/icons/icon_status_green.gif
   trunk/direct.openmoko.com/images/icons/icon_status_green_light.gif
   trunk/direct.openmoko.com/images/icons/icon_status_red.gif
   trunk/direct.openmoko.com/images/icons/icon_status_red_light.gif
   trunk/direct.openmoko.com/images/icons/icon_status_yellow.gif
   trunk/direct.openmoko.com/images/icons/period_ani.gif
   trunk/direct.openmoko.com/images/icons/shipping_canadapost.gif
   trunk/direct.openmoko.com/images/icons/shipping_fedex.gif
   trunk/direct.openmoko.com/images/icons/shipping_free_shipper.jpg
   trunk/direct.openmoko.com/images/icons/shipping_ups.gif
   trunk/direct.openmoko.com/images/icons/shipping_usps.gif
   trunk/direct.openmoko.com/images/icons/sort.gif
   trunk/direct.openmoko.com/images/icons/success.gif
   trunk/direct.openmoko.com/images/icons/warning.gif
   trunk/direct.openmoko.com/images/infobox/
   trunk/direct.openmoko.com/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/images/lj1100xi.gif
   trunk/direct.openmoko.com/images/loaded6-banner.gif
   trunk/direct.openmoko.com/images/loaded_3box_ad.jpg
   trunk/direct.openmoko.com/images/mail/
   trunk/direct.openmoko.com/images/mail/background.gif
   trunk/direct.openmoko.com/images/main_category_accessories.png
   trunk/direct.openmoko.com/images/manufacturer_canon.gif
   trunk/direct.openmoko.com/images/manufacturer_fox.gif
   trunk/direct.openmoko.com/images/manufacturer_gt_interactive.gif
   trunk/direct.openmoko.com/images/manufacturer_hewlett_packard.gif
   trunk/direct.openmoko.com/images/manufacturer_logitech.gif
   trunk/direct.openmoko.com/images/manufacturer_matrox.gif
   trunk/direct.openmoko.com/images/manufacturer_microsoft.gif
   trunk/direct.openmoko.com/images/manufacturer_sierra.gif
   trunk/direct.openmoko.com/images/manufacturer_warner.gif
   trunk/direct.openmoko.com/images/matrox/
   trunk/direct.openmoko.com/images/matrox/boxnboard.jpg
   trunk/direct.openmoko.com/images/matrox/mg200mms.gif
   trunk/direct.openmoko.com/images/matrox/mg400-32mb.gif
   trunk/direct.openmoko.com/images/microsoft/
   trunk/direct.openmoko.com/images/microsoft/imexplorer.gif
   trunk/direct.openmoko.com/images/microsoft/intkeyboardps2.gif
   trunk/direct.openmoko.com/images/microsoft/msimpro.gif
   trunk/direct.openmoko.com/images/msimpro.gif
   trunk/direct.openmoko.com/images/neo_orange_big.png
   trunk/direct.openmoko.com/images/neo_orange_big.png_1
   trunk/direct.openmoko.com/images/neo_orange_medium.png
   trunk/direct.openmoko.com/images/neo_orange_small.png
   trunk/direct.openmoko.com/images/neo_range_medium.png
   trunk/direct.openmoko.com/images/neo_silver_small.png
   trunk/direct.openmoko.com/images/newsdesk_test_osc_action.gif
   trunk/direct.openmoko.com/images/newsdesk_test_osc_cartoons.gif
   trunk/direct.openmoko.com/images/newsdesk_test_osc_graphic.gif
   trunk/direct.openmoko.com/images/newsdesk_test_osc_sticky.gif
   trunk/direct.openmoko.com/images/newsdesk_test_osc_thanks.gif
   trunk/direct.openmoko.com/images/no_cammera.gif
   trunk/direct.openmoko.com/images/no_picture.gif
   trunk/direct.openmoko.com/images/osc-offer.gif
   trunk/direct.openmoko.com/images/oscommerce.gif
   trunk/direct.openmoko.com/images/paypal/
   trunk/direct.openmoko.com/images/paypal/4cards.gif
   trunk/direct.openmoko.com/images/pixel_black.gif
   trunk/direct.openmoko.com/images/pixel_silver.gif
   trunk/direct.openmoko.com/images/pixel_trans.gif
   trunk/direct.openmoko.com/images/printimage.gif
   trunk/direct.openmoko.com/images/printimage_over.gif
   trunk/direct.openmoko.com/images/printorder.gif
   trunk/direct.openmoko.com/images/shipwire_banner.gif
   trunk/direct.openmoko.com/images/sierra/
   trunk/direct.openmoko.com/images/sierra/swat_3.gif
   trunk/direct.openmoko.com/images/standard_orange_small.png
   trunk/direct.openmoko.com/images/stars_1.gif
   trunk/direct.openmoko.com/images/stars_2.gif
   trunk/direct.openmoko.com/images/stars_3.gif
   trunk/direct.openmoko.com/images/stars_4.gif
   trunk/direct.openmoko.com/images/stars_5.gif
   trunk/direct.openmoko.com/images/stylus.png
   trunk/direct.openmoko.com/images/stylus_small.png
   trunk/direct.openmoko.com/images/subcategory.gif
   trunk/direct.openmoko.com/images/subcategory_action.gif
   trunk/direct.openmoko.com/images/subcategory_action_games.gif
   trunk/direct.openmoko.com/images/subcategory_cartoons.gif
   trunk/direct.openmoko.com/images/subcategory_cdrom_drives.gif
   trunk/direct.openmoko.com/images/subcategory_comedy.gif
   trunk/direct.openmoko.com/images/subcategory_drama.gif
   trunk/direct.openmoko.com/images/subcategory_graphic_cards.gif
   trunk/direct.openmoko.com/images/subcategory_keyboards.gif
   trunk/direct.openmoko.com/images/subcategory_memory.gif
   trunk/direct.openmoko.com/images/subcategory_mice.gif
   trunk/direct.openmoko.com/images/subcategory_monitors.gif
   trunk/direct.openmoko.com/images/subcategory_printers.gif
   trunk/direct.openmoko.com/images/subcategory_science_fiction.gif
   trunk/direct.openmoko.com/images/subcategory_simulation.gif
   trunk/direct.openmoko.com/images/subcategory_speakers.gif
   trunk/direct.openmoko.com/images/subcategory_strategy.gif
   trunk/direct.openmoko.com/images/subcategory_thriller.gif
   trunk/direct.openmoko.com/images/table_background_account.gif
   trunk/direct.openmoko.com/images/table_background_address_book.gif
   trunk/direct.openmoko.com/images/table_background_browse.gif
   trunk/direct.openmoko.com/images/table_background_cart.gif
   trunk/direct.openmoko.com/images/table_background_checkout.gif
   trunk/direct.openmoko.com/images/table_background_confirmation.gif
   trunk/direct.openmoko.com/images/table_background_contact_us.gif
   trunk/direct.openmoko.com/images/table_background_default.gif
   trunk/direct.openmoko.com/images/table_background_delivery.gif
   trunk/direct.openmoko.com/images/table_background_history.gif
   trunk/direct.openmoko.com/images/table_background_list.gif
   trunk/direct.openmoko.com/images/table_background_login.gif
   trunk/direct.openmoko.com/images/table_background_man_on_board.gif
   trunk/direct.openmoko.com/images/table_background_password_forgotten.gif
   trunk/direct.openmoko.com/images/table_background_payment.gif
   trunk/direct.openmoko.com/images/table_background_products_new.gif
   trunk/direct.openmoko.com/images/table_background_reviews.gif
   trunk/direct.openmoko.com/images/table_background_reviews_new.gif
   trunk/direct.openmoko.com/images/table_background_specials.gif
   trunk/direct.openmoko.com/images/table_background_wishlist.gif
   trunk/direct.openmoko.com/images/test_image200x160.jpg
   trunk/direct.openmoko.com/images/test_image500x320.jpg
   trunk/direct.openmoko.com/images/the_matrix.gif
   trunk/direct.openmoko.com/images/whitelanyard_small.png
   trunk/direct.openmoko.com/images/x-click_butcc_donate.gif
   trunk/direct.openmoko.com/images/xphone.png
   trunk/direct.openmoko.com/images/xphone2.png
   trunk/direct.openmoko.com/images/xphone3.png
   trunk/direct.openmoko.com/images/xphone3_small.png
   trunk/direct.openmoko.com/includes/
   trunk/direct.openmoko.com/includes/.htaccess
   trunk/direct.openmoko.com/includes/ATS_template_application_top.php
   trunk/direct.openmoko.com/includes/CRE_template_application_top.php
   trunk/direct.openmoko.com/includes/__nusoap.php
   trunk/direct.openmoko.com/includes/add_ccgvdc_application_top.php
   trunk/direct.openmoko.com/includes/affiliate_application_top.php
   trunk/direct.openmoko.com/includes/affiliate_checkout_process.php
   trunk/direct.openmoko.com/includes/affiliate_configure.php
   trunk/direct.openmoko.com/includes/application_bottom.php
   trunk/direct.openmoko.com/includes/application_top.php
   trunk/direct.openmoko.com/includes/application_top_cre_setting.php
   trunk/direct.openmoko.com/includes/categories_tab.php
   trunk/direct.openmoko.com/includes/classes/
   trunk/direct.openmoko.com/includes/classes/PriceFormatter.php
   trunk/direct.openmoko.com/includes/classes/boxes.php
   trunk/direct.openmoko.com/includes/classes/breadcrumb.php
   trunk/direct.openmoko.com/includes/classes/calendar.php
   trunk/direct.openmoko.com/includes/classes/cc_validation.php
   trunk/direct.openmoko.com/includes/classes/cc_validation1.php
   trunk/direct.openmoko.com/includes/classes/checkout_success.php
   trunk/direct.openmoko.com/includes/classes/currencies.php
   trunk/direct.openmoko.com/includes/classes/email.php
   trunk/direct.openmoko.com/includes/classes/http_client.php
   trunk/direct.openmoko.com/includes/classes/language.php
   trunk/direct.openmoko.com/includes/classes/message_stack.php
   trunk/direct.openmoko.com/includes/classes/mime.php
   trunk/direct.openmoko.com/includes/classes/navigation_history.php
   trunk/direct.openmoko.com/includes/classes/order.php
   trunk/direct.openmoko.com/includes/classes/order_total.php
   trunk/direct.openmoko.com/includes/classes/page_cache.php
   trunk/direct.openmoko.com/includes/classes/payment.php
   trunk/direct.openmoko.com/includes/classes/rci.php
   trunk/direct.openmoko.com/includes/classes/sessions.php
   trunk/direct.openmoko.com/includes/classes/shipping.php
   trunk/direct.openmoko.com/includes/classes/shopping_cart.php
   trunk/direct.openmoko.com/includes/classes/split_page_results.php
   trunk/direct.openmoko.com/includes/classes/xmldocument.php
   trunk/direct.openmoko.com/includes/column_left.php
   trunk/direct.openmoko.com/includes/column_right.php
   trunk/direct.openmoko.com/includes/configure.php
   trunk/direct.openmoko.com/includes/configure_dist.php
   trunk/direct.openmoko.com/includes/counter.php
   trunk/direct.openmoko.com/includes/database_tables.php
   trunk/direct.openmoko.com/includes/filenames.php
   trunk/direct.openmoko.com/includes/footer.php
   trunk/direct.openmoko.com/includes/form_check.js.php
   trunk/direct.openmoko.com/includes/functions/
   trunk/direct.openmoko.com/includes/functions/affiliate_functions.php
   trunk/direct.openmoko.com/includes/functions/article_header_tags.php
   trunk/direct.openmoko.com/includes/functions/articles.php
   trunk/direct.openmoko.com/includes/functions/banner.php
   trunk/direct.openmoko.com/includes/functions/cache.php
   trunk/direct.openmoko.com/includes/functions/categories_lookup.php
   trunk/direct.openmoko.com/includes/functions/clean_html_comments.php
   trunk/direct.openmoko.com/includes/functions/compatibility.php
   trunk/direct.openmoko.com/includes/functions/crypt.php
   trunk/direct.openmoko.com/includes/functions/database.php
   trunk/direct.openmoko.com/includes/functions/downloads_controller.php
   trunk/direct.openmoko.com/includes/functions/faqdesk_general.php
   trunk/direct.openmoko.com/includes/functions/featured.php
   trunk/direct.openmoko.com/includes/functions/general.php
   trunk/direct.openmoko.com/includes/functions/gv_functions.php
   trunk/direct.openmoko.com/includes/functions/gzip_compression.php
   trunk/direct.openmoko.com/includes/functions/header_tags.php
   trunk/direct.openmoko.com/includes/functions/html_output.php
   trunk/direct.openmoko.com/includes/functions/information_html_output.php
   trunk/direct.openmoko.com/includes/functions/links.php
   trunk/direct.openmoko.com/includes/functions/newsdesk_general.php
   trunk/direct.openmoko.com/includes/functions/password_funcs.php
   trunk/direct.openmoko.com/includes/functions/sessions.php
   trunk/direct.openmoko.com/includes/functions/specials.php
   trunk/direct.openmoko.com/includes/functions/validations.php
   trunk/direct.openmoko.com/includes/functions/visual_verify_code.php
   trunk/direct.openmoko.com/includes/functions/webmakers_added_functions.php
   trunk/direct.openmoko.com/includes/functions/whos_online.php
   trunk/direct.openmoko.com/includes/general.js
   trunk/direct.openmoko.com/includes/header.php
   trunk/direct.openmoko.com/includes/header_tags.php
   trunk/direct.openmoko.com/includes/javascript/
   trunk/direct.openmoko.com/includes/javascript/account.js
   trunk/direct.openmoko.com/includes/javascript/account_edit.php
   trunk/direct.openmoko.com/includes/javascript/account_newsletters.js
   trunk/direct.openmoko.com/includes/javascript/account_notifications.js
   trunk/direct.openmoko.com/includes/javascript/account_password.php
   trunk/direct.openmoko.com/includes/javascript/address_book.js
   trunk/direct.openmoko.com/includes/javascript/address_book_process.php
   trunk/direct.openmoko.com/includes/javascript/advanced_search.js
   trunk/direct.openmoko.com/includes/javascript/advanced_search.js.php
   trunk/direct.openmoko.com/includes/javascript/affiliate_summary.js.php
   trunk/direct.openmoko.com/includes/javascript/article_info.js
   trunk/direct.openmoko.com/includes/javascript/cart_links.js.php
   trunk/direct.openmoko.com/includes/javascript/checkout_confirmation.js.php
   trunk/direct.openmoko.com/includes/javascript/checkout_payment.js.php
   trunk/direct.openmoko.com/includes/javascript/checkout_payment_address.js.php
   trunk/direct.openmoko.com/includes/javascript/checkout_shipping.js
   trunk/direct.openmoko.com/includes/javascript/checkout_shipping_address.js.php
   trunk/direct.openmoko.com/includes/javascript/cvvpopup.js.php
   trunk/direct.openmoko.com/includes/javascript/form_article_check.js.php
   trunk/direct.openmoko.com/includes/javascript/form_check.js.php
   trunk/direct.openmoko.com/includes/javascript/general.js
   trunk/direct.openmoko.com/includes/javascript/links_submit.js
   trunk/direct.openmoko.com/includes/javascript/login.js
   trunk/direct.openmoko.com/includes/javascript/popup_image.js
   trunk/direct.openmoko.com/includes/javascript/popup_window.js
   trunk/direct.openmoko.com/includes/javascript/popup_window_print.js
   trunk/direct.openmoko.com/includes/javascript/product_reviews_write.js
   trunk/direct.openmoko.com/includes/key/
   trunk/direct.openmoko.com/includes/key/.htaccess
   trunk/direct.openmoko.com/includes/key/bak.htaccess
   trunk/direct.openmoko.com/includes/key/cc_key.bkp
   trunk/direct.openmoko.com/includes/key/cc_key.php
   trunk/direct.openmoko.com/includes/key/new_cc_key.bkp
   trunk/direct.openmoko.com/includes/key/new_cc_key.php
   trunk/direct.openmoko.com/includes/languages/
   trunk/direct.openmoko.com/includes/languages/affiliate_english.php
   trunk/direct.openmoko.com/includes/languages/affiliate_espanol.php
   trunk/direct.openmoko.com/includes/languages/affiliate_french.php
   trunk/direct.openmoko.com/includes/languages/affiliate_german.php
   trunk/direct.openmoko.com/includes/languages/english.php
   trunk/direct.openmoko.com/includes/languages/english/
   trunk/direct.openmoko.com/includes/languages/english/account.php
   trunk/direct.openmoko.com/includes/languages/english/account_edit.php
   trunk/direct.openmoko.com/includes/languages/english/account_history.php
   trunk/direct.openmoko.com/includes/languages/english/account_history_info.php
   trunk/direct.openmoko.com/includes/languages/english/account_newsletters.php
   trunk/direct.openmoko.com/includes/languages/english/account_notifications.php
   trunk/direct.openmoko.com/includes/languages/english/account_password.php
   trunk/direct.openmoko.com/includes/languages/english/address_book.php
   trunk/direct.openmoko.com/includes/languages/english/address_book_process.php
   trunk/direct.openmoko.com/includes/languages/english/advanced_search.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_affiliate.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_banners.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_banners.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_build.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_build_cat.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_category.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_product.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_text.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_clicks.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_contact.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_details.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_details_ok.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_faq.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_info.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_logout.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_news.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_newsletter.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_password.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_password_forgotten.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_payment.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_reports.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_sales.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_signup.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_signup_ok.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_summary.php
   trunk/direct.openmoko.com/includes/languages/english/affiliate_terms.php
   trunk/direct.openmoko.com/includes/languages/english/all_prodcats.php
   trunk/direct.openmoko.com/includes/languages/english/all_prodmanf.php
   trunk/direct.openmoko.com/includes/languages/english/allprods.php
   trunk/direct.openmoko.com/includes/languages/english/article_info.php
   trunk/direct.openmoko.com/includes/languages/english/article_mainpage.php
   trunk/direct.openmoko.com/includes/languages/english/article_reviews.php
   trunk/direct.openmoko.com/includes/languages/english/article_reviews_info.php
   trunk/direct.openmoko.com/includes/languages/english/article_reviews_write.php
   trunk/direct.openmoko.com/includes/languages/english/article_search.php
   trunk/direct.openmoko.com/includes/languages/english/articles.php
   trunk/direct.openmoko.com/includes/languages/english/articles_new.php
   trunk/direct.openmoko.com/includes/languages/english/attributes_sorter.php
   trunk/direct.openmoko.com/includes/languages/english/cards1_box.php
   trunk/direct.openmoko.com/includes/languages/english/checkout_confirmation.php
   trunk/direct.openmoko.com/includes/languages/english/checkout_payment.php
   trunk/direct.openmoko.com/includes/languages/english/checkout_payment_address.php
   trunk/direct.openmoko.com/includes/languages/english/checkout_process.php
   trunk/direct.openmoko.com/includes/languages/english/checkout_shipping.php
   trunk/direct.openmoko.com/includes/languages/english/checkout_shipping_address.php
   trunk/direct.openmoko.com/includes/languages/english/checkout_success.php
   trunk/direct.openmoko.com/includes/languages/english/contact_us.php
   trunk/direct.openmoko.com/includes/languages/english/cookie_usage.php
   trunk/direct.openmoko.com/includes/languages/english/create_account.php
   trunk/direct.openmoko.com/includes/languages/english/create_account_success.php
   trunk/direct.openmoko.com/includes/languages/english/cvs_help.php
   trunk/direct.openmoko.com/includes/languages/english/down_for_maintenance.php
   trunk/direct.openmoko.com/includes/languages/english/download.php
   trunk/direct.openmoko.com/includes/languages/english/downloadbox.php
   trunk/direct.openmoko.com/includes/languages/english/events_calendar.php
   trunk/direct.openmoko.com/includes/languages/english/faq.php
   trunk/direct.openmoko.com/includes/languages/english/faq_mainpage.php
   trunk/direct.openmoko.com/includes/languages/english/featured_products.php
   trunk/direct.openmoko.com/includes/languages/english/gv_faq.php
   trunk/direct.openmoko.com/includes/languages/english/gv_redeem.php
   trunk/direct.openmoko.com/includes/languages/english/gv_send.php
   trunk/direct.openmoko.com/includes/languages/english/header_tags.php
   trunk/direct.openmoko.com/includes/languages/english/images/
   trunk/direct.openmoko.com/includes/languages/english/images/icon.gif
   trunk/direct.openmoko.com/includes/languages/english/images/icon.png
   trunk/direct.openmoko.com/includes/languages/english/index.php
   trunk/direct.openmoko.com/includes/languages/english/info_shopping_cart.php
   trunk/direct.openmoko.com/includes/languages/english/information.php
   trunk/direct.openmoko.com/includes/languages/english/informationbox.php
   trunk/direct.openmoko.com/includes/languages/english/ipn.lng.php
   trunk/direct.openmoko.com/includes/languages/english/links.php
   trunk/direct.openmoko.com/includes/languages/english/links_submit.php
   trunk/direct.openmoko.com/includes/languages/english/links_submit_success.php
   trunk/direct.openmoko.com/includes/languages/english/login.php
   trunk/direct.openmoko.com/includes/languages/english/loginbox.php
   trunk/direct.openmoko.com/includes/languages/english/logoff.php
   trunk/direct.openmoko.com/includes/languages/english/mainpage.php
   trunk/direct.openmoko.com/includes/languages/english/modules/
   trunk/direct.openmoko.com/includes/languages/english/modules/checkout_success/
   trunk/direct.openmoko.com/includes/languages/english/modules/checkout_success/notifications.php
   trunk/direct.openmoko.com/includes/languages/english/modules/checkout_success/shipwire.php
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_coupon.php
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_gv.php
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_lev_discount.php
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_loworderfee.php
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_qty_discount.php
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_shipping.php
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_subtotal.php
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_tax.php
   trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_total.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/SecurePay.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/authorizenet.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_cvc.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_old.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_uk.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/ccerr.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/citibank.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/ckmerchantpartners.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/cod.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/efsnet.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/egold.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/epssecurenet.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/eustandardtransfer.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/firepay.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/freecharger.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/geotrust.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/ipayment.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/merchantpartners.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/moneyorder.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/nochex.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/paybox.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/payflowpro.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/payjunction.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal_dp.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal_ec.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypalipn.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/plugnpay.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/pm2checkout.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/psigate.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/qchex.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/quickcommerce.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/secpay.php
   trunk/direct.openmoko.com/includes/languages/english/modules/payment/worldpay.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspost.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostair.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/ausposteconomy.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostexpress.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostsea.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/canadapost.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/cod.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/fedex1.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/flat.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/freeshipper.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/item.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/percent.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/reg.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/spec.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/spu.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/stand.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/table.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/ups.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/upsxml.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/usps.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/zones.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping/zones_single.php
   trunk/direct.openmoko.com/includes/languages/english/modules/shipping_estimator.php
   trunk/direct.openmoko.com/includes/languages/english/modules/xsell_products.php
   trunk/direct.openmoko.com/includes/languages/english/navmenu.php
   trunk/direct.openmoko.com/includes/languages/english/pages.php
   trunk/direct.openmoko.com/includes/languages/english/password_forgotten.php
   trunk/direct.openmoko.com/includes/languages/english/popup_affiliate_help.php
   trunk/direct.openmoko.com/includes/languages/english/popup_coupon_help.php
   trunk/direct.openmoko.com/includes/languages/english/popup_image.php
   trunk/direct.openmoko.com/includes/languages/english/printorder.php
   trunk/direct.openmoko.com/includes/languages/english/product_info.php
   trunk/direct.openmoko.com/includes/languages/english/product_info_configureable.php
   trunk/direct.openmoko.com/includes/languages/english/product_reviews.php
   trunk/direct.openmoko.com/includes/languages/english/product_reviews_info.php
   trunk/direct.openmoko.com/includes/languages/english/product_reviews_write.php
   trunk/direct.openmoko.com/includes/languages/english/products_new.php
   trunk/direct.openmoko.com/includes/languages/english/pw.php
   trunk/direct.openmoko.com/includes/languages/english/reviews.php
   trunk/direct.openmoko.com/includes/languages/english/shop_by_price.php
   trunk/direct.openmoko.com/includes/languages/english/shopping_cart.php
   trunk/direct.openmoko.com/includes/languages/english/specials.php
   trunk/direct.openmoko.com/includes/languages/english/ssl_check.php
   trunk/direct.openmoko.com/includes/languages/english/tell_a_friend.php
   trunk/direct.openmoko.com/includes/languages/english/tell_a_friend_article.php
   trunk/direct.openmoko.com/includes/languages/english/upcoming_products.php
   trunk/direct.openmoko.com/includes/languages/english/validate_new.php
   trunk/direct.openmoko.com/includes/languages/english/whos_onlinebox.php
   trunk/direct.openmoko.com/includes/languages/english/wishlist.php
   trunk/direct.openmoko.com/includes/languages/english/wishlist_email.php
   trunk/direct.openmoko.com/includes/languages/english/wishlist_help.php
   trunk/direct.openmoko.com/includes/languages/english/wpcallback.php
   trunk/direct.openmoko.com/includes/languages/espanol.php
   trunk/direct.openmoko.com/includes/languages/espanol/
   trunk/direct.openmoko.com/includes/languages/espanol/account.php
   trunk/direct.openmoko.com/includes/languages/espanol/account_edit.php
   trunk/direct.openmoko.com/includes/languages/espanol/account_history.php
   trunk/direct.openmoko.com/includes/languages/espanol/account_history_info.php
   trunk/direct.openmoko.com/includes/languages/espanol/account_newsletters.php
   trunk/direct.openmoko.com/includes/languages/espanol/account_notifications.php
   trunk/direct.openmoko.com/includes/languages/espanol/account_password.php
   trunk/direct.openmoko.com/includes/languages/espanol/address_book.php
   trunk/direct.openmoko.com/includes/languages/espanol/address_book_process.php
   trunk/direct.openmoko.com/includes/languages/espanol/advanced_search.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_affiliate.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_banners.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_build.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_build_cat.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_category.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_product.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_text.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_clicks.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_contact.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_details.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_details_ok.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_faq.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_info.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_logout.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_news.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_newsletter.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_password.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_password_forgotten.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_payment.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_reports.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_sales.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_signup.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_signup_ok.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_summary.php
   trunk/direct.openmoko.com/includes/languages/espanol/affiliate_terms.php
   trunk/direct.openmoko.com/includes/languages/espanol/all_prodcats.php
   trunk/direct.openmoko.com/includes/languages/espanol/all_prodmanf.php
   trunk/direct.openmoko.com/includes/languages/espanol/allprods.php
   trunk/direct.openmoko.com/includes/languages/espanol/article_info.php
   trunk/direct.openmoko.com/includes/languages/espanol/article_mainpage.php
   trunk/direct.openmoko.com/includes/languages/espanol/article_reviews.php
   trunk/direct.openmoko.com/includes/languages/espanol/article_reviews_info.php
   trunk/direct.openmoko.com/includes/languages/espanol/article_reviews_write.php
   trunk/direct.openmoko.com/includes/languages/espanol/article_search.php
   trunk/direct.openmoko.com/includes/languages/espanol/articles.php
   trunk/direct.openmoko.com/includes/languages/espanol/articles_new.php
   trunk/direct.openmoko.com/includes/languages/espanol/attributes_sorter.php
   trunk/direct.openmoko.com/includes/languages/espanol/cards1_box.php
   trunk/direct.openmoko.com/includes/languages/espanol/checkout_confirmation.php
   trunk/direct.openmoko.com/includes/languages/espanol/checkout_payment.php
   trunk/direct.openmoko.com/includes/languages/espanol/checkout_payment_address.php
   trunk/direct.openmoko.com/includes/languages/espanol/checkout_process.php
   trunk/direct.openmoko.com/includes/languages/espanol/checkout_shipping.php
   trunk/direct.openmoko.com/includes/languages/espanol/checkout_shipping_address.php
   trunk/direct.openmoko.com/includes/languages/espanol/checkout_success.php
   trunk/direct.openmoko.com/includes/languages/espanol/contact_us.php
   trunk/direct.openmoko.com/includes/languages/espanol/cookie_usage.php
   trunk/direct.openmoko.com/includes/languages/espanol/create_account.php
   trunk/direct.openmoko.com/includes/languages/espanol/create_account_success.php
   trunk/direct.openmoko.com/includes/languages/espanol/cvs_help.php
   trunk/direct.openmoko.com/includes/languages/espanol/down_for_maintenance.php
   trunk/direct.openmoko.com/includes/languages/espanol/download.php
   trunk/direct.openmoko.com/includes/languages/espanol/downloadbox.php
   trunk/direct.openmoko.com/includes/languages/espanol/events_calendar.php
   trunk/direct.openmoko.com/includes/languages/espanol/faq.php
   trunk/direct.openmoko.com/includes/languages/espanol/faq_mainpage.php
   trunk/direct.openmoko.com/includes/languages/espanol/featured_products.php
   trunk/direct.openmoko.com/includes/languages/espanol/gv_faq.php
   trunk/direct.openmoko.com/includes/languages/espanol/gv_redeem.php
   trunk/direct.openmoko.com/includes/languages/espanol/gv_send.php
   trunk/direct.openmoko.com/includes/languages/espanol/header_tags.php
   trunk/direct.openmoko.com/includes/languages/espanol/images/
   trunk/direct.openmoko.com/includes/languages/espanol/images/icon.gif
   trunk/direct.openmoko.com/includes/languages/espanol/images/icon.png
   trunk/direct.openmoko.com/includes/languages/espanol/index.php
   trunk/direct.openmoko.com/includes/languages/espanol/info_shopping_cart.php
   trunk/direct.openmoko.com/includes/languages/espanol/information.php
   trunk/direct.openmoko.com/includes/languages/espanol/informationbox.php
   trunk/direct.openmoko.com/includes/languages/espanol/ipn.lng.php
   trunk/direct.openmoko.com/includes/languages/espanol/links.php
   trunk/direct.openmoko.com/includes/languages/espanol/links_submit.php
   trunk/direct.openmoko.com/includes/languages/espanol/links_submit_success.php
   trunk/direct.openmoko.com/includes/languages/espanol/login.php
   trunk/direct.openmoko.com/includes/languages/espanol/loginbox.php
   trunk/direct.openmoko.com/includes/languages/espanol/logoff.php
   trunk/direct.openmoko.com/includes/languages/espanol/mainpage.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/
   trunk/direct.openmoko.com/includes/languages/espanol/modules/checkout_success/
   trunk/direct.openmoko.com/includes/languages/espanol/modules/checkout_success/notifications.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/checkout_success/shipwire.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_coupon.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_gv.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_lev_discount.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_loworderfee.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_qty_discount.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_shipping.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_subtotal.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_tax.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_total.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/SecurePay.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/authorizenet.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_cvc.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_old.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_uk.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ccerr.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ckmerchantpartners.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cod.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/efsnet.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/egold.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/epssecurenet.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/eustandardtransfer.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/firepay.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/freecharger.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/geotrust.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ipayment.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/merchantpartners.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/moneyorder.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/nochex.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paybox.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/payflowpro.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/payjunction.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal_dp.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal_ec.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypalipn.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/plugnpay.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/pm2checkout.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/psigate.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/qchex.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/quickcommerce.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/secpay.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/worldpay.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspost.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostair.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/ausposteconomy.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostexpress.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostsea.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/canadapost.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/cod.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/fedex1.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/flat.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/freeshipper.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/item.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/percent.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/reg.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/spec.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/spu.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/stand.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/table.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/ups.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/usps.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/zones.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/zones_single.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping_estimator.php
   trunk/direct.openmoko.com/includes/languages/espanol/modules/xsell_products.php
   trunk/direct.openmoko.com/includes/languages/espanol/navmenu.php
   trunk/direct.openmoko.com/includes/languages/espanol/pages.php
   trunk/direct.openmoko.com/includes/languages/espanol/password_forgotten.php
   trunk/direct.openmoko.com/includes/languages/espanol/popup_affiliate_help.php
   trunk/direct.openmoko.com/includes/languages/espanol/popup_coupon_help.php
   trunk/direct.openmoko.com/includes/languages/espanol/popup_image.php
   trunk/direct.openmoko.com/includes/languages/espanol/printorder.php
   trunk/direct.openmoko.com/includes/languages/espanol/product_info.php
   trunk/direct.openmoko.com/includes/languages/espanol/product_info_configureable.php
   trunk/direct.openmoko.com/includes/languages/espanol/product_reviews.php
   trunk/direct.openmoko.com/includes/languages/espanol/product_reviews_info.php
   trunk/direct.openmoko.com/includes/languages/espanol/product_reviews_write.php
   trunk/direct.openmoko.com/includes/languages/espanol/products_new.php
   trunk/direct.openmoko.com/includes/languages/espanol/pw.php
   trunk/direct.openmoko.com/includes/languages/espanol/reviews.php
   trunk/direct.openmoko.com/includes/languages/espanol/shop_by_price.php
   trunk/direct.openmoko.com/includes/languages/espanol/shopping_cart.php
   trunk/direct.openmoko.com/includes/languages/espanol/specials.php
   trunk/direct.openmoko.com/includes/languages/espanol/ssl_check.php
   trunk/direct.openmoko.com/includes/languages/espanol/tell_a_friend.php
   trunk/direct.openmoko.com/includes/languages/espanol/tell_a_friend_article.php
   trunk/direct.openmoko.com/includes/languages/espanol/upcoming_products.php
   trunk/direct.openmoko.com/includes/languages/espanol/validate_new.php
   trunk/direct.openmoko.com/includes/languages/espanol/whos_onlinebox.php
   trunk/direct.openmoko.com/includes/languages/espanol/wishlist.php
   trunk/direct.openmoko.com/includes/languages/espanol/wishlist_email.php
   trunk/direct.openmoko.com/includes/languages/espanol/wishlist_help.php
   trunk/direct.openmoko.com/includes/languages/espanol/wpcallback.php
   trunk/direct.openmoko.com/includes/languages/french.php
   trunk/direct.openmoko.com/includes/languages/french/
   trunk/direct.openmoko.com/includes/languages/french/account.php
   trunk/direct.openmoko.com/includes/languages/french/account_edit.php
   trunk/direct.openmoko.com/includes/languages/french/account_history.php
   trunk/direct.openmoko.com/includes/languages/french/account_history_info.php
   trunk/direct.openmoko.com/includes/languages/french/account_newsletters.php
   trunk/direct.openmoko.com/includes/languages/french/account_notifications.php
   trunk/direct.openmoko.com/includes/languages/french/account_password.php
   trunk/direct.openmoko.com/includes/languages/french/address_book.php
   trunk/direct.openmoko.com/includes/languages/french/address_book_process.php
   trunk/direct.openmoko.com/includes/languages/french/advanced_search.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_affiliate.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_banners.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_banners.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_build.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_build_cat.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_category.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_product.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_text.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_clicks.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_contact.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_details.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_details_ok.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_faq.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_info.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_logout.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_news.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_newsletter.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_password.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_password_forgotten.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_payment.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_reports.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_sales.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_signup.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_signup_ok.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_summary.php
   trunk/direct.openmoko.com/includes/languages/french/affiliate_terms.php
   trunk/direct.openmoko.com/includes/languages/french/all_prodcats.php
   trunk/direct.openmoko.com/includes/languages/french/all_prodmanf.php
   trunk/direct.openmoko.com/includes/languages/french/allprods.php
   trunk/direct.openmoko.com/includes/languages/french/article_header_tags.php
   trunk/direct.openmoko.com/includes/languages/french/article_info.php
   trunk/direct.openmoko.com/includes/languages/french/article_mainpage.php
   trunk/direct.openmoko.com/includes/languages/french/article_reviews.php
   trunk/direct.openmoko.com/includes/languages/french/article_reviews_info.php
   trunk/direct.openmoko.com/includes/languages/french/article_reviews_write.php
   trunk/direct.openmoko.com/includes/languages/french/article_search.php
   trunk/direct.openmoko.com/includes/languages/french/articles.php
   trunk/direct.openmoko.com/includes/languages/french/articles_new.php
   trunk/direct.openmoko.com/includes/languages/french/attributes_sorter.php
   trunk/direct.openmoko.com/includes/languages/french/cards1_box.php
   trunk/direct.openmoko.com/includes/languages/french/checkout_confirmation.php
   trunk/direct.openmoko.com/includes/languages/french/checkout_payment.php
   trunk/direct.openmoko.com/includes/languages/french/checkout_payment_address.php
   trunk/direct.openmoko.com/includes/languages/french/checkout_process.php
   trunk/direct.openmoko.com/includes/languages/french/checkout_shipping.php
   trunk/direct.openmoko.com/includes/languages/french/checkout_shipping_address.php
   trunk/direct.openmoko.com/includes/languages/french/checkout_success.php
   trunk/direct.openmoko.com/includes/languages/french/contact_us.php
   trunk/direct.openmoko.com/includes/languages/french/cookie_usage.php
   trunk/direct.openmoko.com/includes/languages/french/create_account.php
   trunk/direct.openmoko.com/includes/languages/french/create_account_success.php
   trunk/direct.openmoko.com/includes/languages/french/cvs_help.php
   trunk/direct.openmoko.com/includes/languages/french/down_for_maintenance.php
   trunk/direct.openmoko.com/includes/languages/french/download.php
   trunk/direct.openmoko.com/includes/languages/french/downloadbox.php
   trunk/direct.openmoko.com/includes/languages/french/events_calendar.php
   trunk/direct.openmoko.com/includes/languages/french/faq.php
   trunk/direct.openmoko.com/includes/languages/french/faq_mainpage.php
   trunk/direct.openmoko.com/includes/languages/french/featured_products.php
   trunk/direct.openmoko.com/includes/languages/french/gv_faq.php
   trunk/direct.openmoko.com/includes/languages/french/gv_redeem.php
   trunk/direct.openmoko.com/includes/languages/french/gv_send.php
   trunk/direct.openmoko.com/includes/languages/french/header_tags.php
   trunk/direct.openmoko.com/includes/languages/french/images/
   trunk/direct.openmoko.com/includes/languages/french/images/icon.gif
   trunk/direct.openmoko.com/includes/languages/french/images/icon.png
   trunk/direct.openmoko.com/includes/languages/french/index.php
   trunk/direct.openmoko.com/includes/languages/french/info_shopping_cart.php
   trunk/direct.openmoko.com/includes/languages/french/information.php
   trunk/direct.openmoko.com/includes/languages/french/informationbox.php
   trunk/direct.openmoko.com/includes/languages/french/ipn.lng.php
   trunk/direct.openmoko.com/includes/languages/french/links.php
   trunk/direct.openmoko.com/includes/languages/french/links_submit.php
   trunk/direct.openmoko.com/includes/languages/french/links_submit_success.php
   trunk/direct.openmoko.com/includes/languages/french/login.php
   trunk/direct.openmoko.com/includes/languages/french/loginbox.php
   trunk/direct.openmoko.com/includes/languages/french/logoff.php
   trunk/direct.openmoko.com/includes/languages/french/mainpage.php
   trunk/direct.openmoko.com/includes/languages/french/modules/
   trunk/direct.openmoko.com/includes/languages/french/modules/checkout_success/
   trunk/direct.openmoko.com/includes/languages/french/modules/checkout_success/notifications.php
   trunk/direct.openmoko.com/includes/languages/french/modules/checkout_success/shipwire.php
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_coupon.php
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_gv.php
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_lev_discount.php
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_loworderfee.php
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_qty_discount.php
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_shipping.php
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_subtotal.php
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_tax.php
   trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_total.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/SecurePay.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/authorizenet.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_cvc.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_old.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_uk.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/ccerr.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/ckmerchantpartners.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/cod.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/efsnet.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/egold.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/epssecurenet.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/eustandardtransfer.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/firepay.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/freecharger.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/geotrust.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/ipayment.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/merchantpartners.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/moneyorder.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/nochex.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/paybox.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/payflowpro.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/payjunction.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal_dp.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal_ec.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypalipn.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/plugnpay.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/pm2checkout.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/psigate.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/qchex.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/quickcommerce.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/secpay.php
   trunk/direct.openmoko.com/includes/languages/french/modules/payment/worldpay.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspost.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostair.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/ausposteconomy.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostexpress.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostsea.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/canadapost.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/cod.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/fedex1.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/flat.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/freeshipper.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/item.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/percent.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/reg.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/spec.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/spu.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/stand.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/table.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/ups.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/usps.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/zones.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping/zones_single.php
   trunk/direct.openmoko.com/includes/languages/french/modules/shipping_estimator.php
   trunk/direct.openmoko.com/includes/languages/french/modules/xsell_products.php
   trunk/direct.openmoko.com/includes/languages/french/navmenu.php
   trunk/direct.openmoko.com/includes/languages/french/pages.php
   trunk/direct.openmoko.com/includes/languages/french/password_forgotten.php
   trunk/direct.openmoko.com/includes/languages/french/popup_affiliate_help.php
   trunk/direct.openmoko.com/includes/languages/french/popup_coupon_help.php
   trunk/direct.openmoko.com/includes/languages/french/popup_image.php
   trunk/direct.openmoko.com/includes/languages/french/printorder.php
   trunk/direct.openmoko.com/includes/languages/french/product_info.php
   trunk/direct.openmoko.com/includes/languages/french/product_info_configureable.php
   trunk/direct.openmoko.com/includes/languages/french/product_reviews.php
   trunk/direct.openmoko.com/includes/languages/french/product_reviews_info.php
   trunk/direct.openmoko.com/includes/languages/french/product_reviews_write.php
   trunk/direct.openmoko.com/includes/languages/french/products_new.php
   trunk/direct.openmoko.com/includes/languages/french/pw.php
   trunk/direct.openmoko.com/includes/languages/french/reviews.php
   trunk/direct.openmoko.com/includes/languages/french/shop_by_price.php
   trunk/direct.openmoko.com/includes/languages/french/shopping_cart.php
   trunk/direct.openmoko.com/includes/languages/french/specials.php
   trunk/direct.openmoko.com/includes/languages/french/ssl_check.php
   trunk/direct.openmoko.com/includes/languages/french/tell_a_friend.php
   trunk/direct.openmoko.com/includes/languages/french/tell_a_friend_article.php
   trunk/direct.openmoko.com/includes/languages/french/upcoming_products.php
   trunk/direct.openmoko.com/includes/languages/french/validate_new.php
   trunk/direct.openmoko.com/includes/languages/french/whos_onlinebox.php
   trunk/direct.openmoko.com/includes/languages/french/wishlist.php
   trunk/direct.openmoko.com/includes/languages/french/wishlist_email.php
   trunk/direct.openmoko.com/includes/languages/french/wishlist_help.php
   trunk/direct.openmoko.com/includes/languages/french/wpcallback.php
   trunk/direct.openmoko.com/includes/languages/german.php
   trunk/direct.openmoko.com/includes/languages/german/
   trunk/direct.openmoko.com/includes/languages/german/account.php
   trunk/direct.openmoko.com/includes/languages/german/account_edit.php
   trunk/direct.openmoko.com/includes/languages/german/account_history.php
   trunk/direct.openmoko.com/includes/languages/german/account_history_info.php
   trunk/direct.openmoko.com/includes/languages/german/account_newsletters.php
   trunk/direct.openmoko.com/includes/languages/german/account_notifications.php
   trunk/direct.openmoko.com/includes/languages/german/account_password.php
   trunk/direct.openmoko.com/includes/languages/german/address_book.php
   trunk/direct.openmoko.com/includes/languages/german/address_book_process.php
   trunk/direct.openmoko.com/includes/languages/german/advanced_search.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_affiliate.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_banners.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_banners.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_build.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_build_cat.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_category.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_product.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_text.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_clicks.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_contact.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_details.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_details_ok.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_faq.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_info.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_logout.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_news.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_newsletter.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_password.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_password_forgotten.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_payment.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_reports.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_sales.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_signup.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_signup_ok.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_summary.php
   trunk/direct.openmoko.com/includes/languages/german/affiliate_terms.php
   trunk/direct.openmoko.com/includes/languages/german/all_prodcats.php
   trunk/direct.openmoko.com/includes/languages/german/all_prodmanf.php
   trunk/direct.openmoko.com/includes/languages/german/allprods.php
   trunk/direct.openmoko.com/includes/languages/german/article_info.php
   trunk/direct.openmoko.com/includes/languages/german/article_mainpage.php
   trunk/direct.openmoko.com/includes/languages/german/article_reviews.php
   trunk/direct.openmoko.com/includes/languages/german/article_reviews_info.php
   trunk/direct.openmoko.com/includes/languages/german/article_reviews_write.php
   trunk/direct.openmoko.com/includes/languages/german/article_search.php
   trunk/direct.openmoko.com/includes/languages/german/articles.php
   trunk/direct.openmoko.com/includes/languages/german/articles_new.php
   trunk/direct.openmoko.com/includes/languages/german/attributes_sorter.php
   trunk/direct.openmoko.com/includes/languages/german/cards1_box.php
   trunk/direct.openmoko.com/includes/languages/german/checkout_confirmation.php
   trunk/direct.openmoko.com/includes/languages/german/checkout_payment.php
   trunk/direct.openmoko.com/includes/languages/german/checkout_payment_address.php
   trunk/direct.openmoko.com/includes/languages/german/checkout_process.php
   trunk/direct.openmoko.com/includes/languages/german/checkout_shipping.php
   trunk/direct.openmoko.com/includes/languages/german/checkout_shipping_address.php
   trunk/direct.openmoko.com/includes/languages/german/checkout_success.php
   trunk/direct.openmoko.com/includes/languages/german/contact_us.php
   trunk/direct.openmoko.com/includes/languages/german/cookie_usage.php
   trunk/direct.openmoko.com/includes/languages/german/create_account.php
   trunk/direct.openmoko.com/includes/languages/german/create_account_success.php
   trunk/direct.openmoko.com/includes/languages/german/cvs_help.php
   trunk/direct.openmoko.com/includes/languages/german/down_for_maintenance.php
   trunk/direct.openmoko.com/includes/languages/german/download.php
   trunk/direct.openmoko.com/includes/languages/german/downloadbox.php
   trunk/direct.openmoko.com/includes/languages/german/events_calendar.php
   trunk/direct.openmoko.com/includes/languages/german/faq.php
   trunk/direct.openmoko.com/includes/languages/german/faq_mainpage.php
   trunk/direct.openmoko.com/includes/languages/german/featured_products.php
   trunk/direct.openmoko.com/includes/languages/german/gv_faq.php
   trunk/direct.openmoko.com/includes/languages/german/gv_redeem.php
   trunk/direct.openmoko.com/includes/languages/german/gv_send.php
   trunk/direct.openmoko.com/includes/languages/german/header_tags.php
   trunk/direct.openmoko.com/includes/languages/german/images/
   trunk/direct.openmoko.com/includes/languages/german/images/icon.gif
   trunk/direct.openmoko.com/includes/languages/german/images/icon.png
   trunk/direct.openmoko.com/includes/languages/german/index.php
   trunk/direct.openmoko.com/includes/languages/german/info_shopping_cart.php
   trunk/direct.openmoko.com/includes/languages/german/information.php
   trunk/direct.openmoko.com/includes/languages/german/informationbox.php
   trunk/direct.openmoko.com/includes/languages/german/ipn.lng.php
   trunk/direct.openmoko.com/includes/languages/german/links.php
   trunk/direct.openmoko.com/includes/languages/german/links_submit.php
   trunk/direct.openmoko.com/includes/languages/german/links_submit_success.php
   trunk/direct.openmoko.com/includes/languages/german/login.php
   trunk/direct.openmoko.com/includes/languages/german/loginbox.php
   trunk/direct.openmoko.com/includes/languages/german/logoff.php
   trunk/direct.openmoko.com/includes/languages/german/mainpage.php
   trunk/direct.openmoko.com/includes/languages/german/modules/
   trunk/direct.openmoko.com/includes/languages/german/modules/checkout_success/
   trunk/direct.openmoko.com/includes/languages/german/modules/checkout_success/notifications.php
   trunk/direct.openmoko.com/includes/languages/german/modules/checkout_success/shipwire.php
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_coupon.php
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_gv.php
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_lev_discount.php
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_loworderfee.php
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_qty_discount.php
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_shipping.php
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_subtotal.php
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_tax.php
   trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_total.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/SecurePay.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/authorizenet.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_cvc.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_old.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_uk.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/ccerr.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/ckmerchantpartners.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/cod.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/efsnet.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/egold.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/epssecurenet.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/eustandardtransfer.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/firepay.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/freecharger.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/geotrust.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/ipayment.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/merchantpartners.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/moneyorder.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/nochex.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/paybox.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/payflowpro.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/payjunction.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal_dp.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal_ec.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypalipn.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/plugnpay.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/pm2checkout.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/psigate.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/qchex.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/quickcommerce.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/secpay.php
   trunk/direct.openmoko.com/includes/languages/german/modules/payment/worldpay.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspost.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostair.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/ausposteconomy.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostexpress.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostsea.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/canadapost.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/cod.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/fedex1.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/flat.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/freeshipper.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/item.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/percent.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/reg.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/spec.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/spu.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/stand.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/table.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/ups.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/usps.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/zones.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping/zones_single.php
   trunk/direct.openmoko.com/includes/languages/german/modules/shipping_estimator.php
   trunk/direct.openmoko.com/includes/languages/german/modules/xsell_products.php
   trunk/direct.openmoko.com/includes/languages/german/navmenu.php
   trunk/direct.openmoko.com/includes/languages/german/pages.php
   trunk/direct.openmoko.com/includes/languages/german/password_forgotten.php
   trunk/direct.openmoko.com/includes/languages/german/popup_affiliate_help.php
   trunk/direct.openmoko.com/includes/languages/german/popup_coupon_help.php
   trunk/direct.openmoko.com/includes/languages/german/popup_image.php
   trunk/direct.openmoko.com/includes/languages/german/printorder.php
   trunk/direct.openmoko.com/includes/languages/german/product_info.php
   trunk/direct.openmoko.com/includes/languages/german/product_info_configureable.php
   trunk/direct.openmoko.com/includes/languages/german/product_reviews.php
   trunk/direct.openmoko.com/includes/languages/german/product_reviews_info.php
   trunk/direct.openmoko.com/includes/languages/german/product_reviews_write.php
   trunk/direct.openmoko.com/includes/languages/german/products_new.php
   trunk/direct.openmoko.com/includes/languages/german/pw.php
   trunk/direct.openmoko.com/includes/languages/german/reviews.php
   trunk/direct.openmoko.com/includes/languages/german/shop_by_price.php
   trunk/direct.openmoko.com/includes/languages/german/shopping_cart.php
   trunk/direct.openmoko.com/includes/languages/german/specials.php
   trunk/direct.openmoko.com/includes/languages/german/ssl_check.php
   trunk/direct.openmoko.com/includes/languages/german/tell_a_friend.php
   trunk/direct.openmoko.com/includes/languages/german/tell_a_friend_article.php
   trunk/direct.openmoko.com/includes/languages/german/upcoming_products.php
   trunk/direct.openmoko.com/includes/languages/german/validate_new.php
   trunk/direct.openmoko.com/includes/languages/german/whos_onlinebox.php
   trunk/direct.openmoko.com/includes/languages/german/wishlist.php
   trunk/direct.openmoko.com/includes/languages/german/wishlist_email.php
   trunk/direct.openmoko.com/includes/languages/german/wishlist_help.php
   trunk/direct.openmoko.com/includes/languages/german/wpcallback.php
   trunk/direct.openmoko.com/includes/languages/tell_a_friend_article.php
   trunk/direct.openmoko.com/includes/languages_in_header.php
   trunk/direct.openmoko.com/includes/local/
   trunk/direct.openmoko.com/includes/local/README
   trunk/direct.openmoko.com/includes/login_acc.php
   trunk/direct.openmoko.com/includes/login_pwa.php
   trunk/direct.openmoko.com/includes/login_pwa_optimal.php
   trunk/direct.openmoko.com/includes/modules/
   trunk/direct.openmoko.com/includes/modules/Order_Info_Check.php
   trunk/direct.openmoko.com/includes/modules/additional_images.php
   trunk/direct.openmoko.com/includes/modules/address_book_details.php
   trunk/direct.openmoko.com/includes/modules/affiliate_account_details.php
   trunk/direct.openmoko.com/includes/modules/affiliate_news.php
   trunk/direct.openmoko.com/includes/modules/affiliate_signup_details.php
   trunk/direct.openmoko.com/includes/modules/also_purchased_products.php
   trunk/direct.openmoko.com/includes/modules/an_example.php
   trunk/direct.openmoko.com/includes/modules/article_listing.php
   trunk/direct.openmoko.com/includes/modules/articles_upcoming.php
   trunk/direct.openmoko.com/includes/modules/articles_xsell.php
   trunk/direct.openmoko.com/includes/modules/authorizenet_direct.php
   trunk/direct.openmoko.com/includes/modules/checkout_new_address.php
   trunk/direct.openmoko.com/includes/modules/checkout_success/
   trunk/direct.openmoko.com/includes/modules/checkout_success/notifications.php
   trunk/direct.openmoko.com/includes/modules/checkout_success/shipwire.php
   trunk/direct.openmoko.com/includes/modules/default_specials.php
   trunk/direct.openmoko.com/includes/modules/downloads.php
   trunk/direct.openmoko.com/includes/modules/example.html
   trunk/direct.openmoko.com/includes/modules/featured.php
   trunk/direct.openmoko.com/includes/modules/featured_products.php
   trunk/direct.openmoko.com/includes/modules/link_listing.php
   trunk/direct.openmoko.com/includes/modules/mainpage.php
   trunk/direct.openmoko.com/includes/modules/new_products.php
   trunk/direct.openmoko.com/includes/modules/order_total/
   trunk/direct.openmoko.com/includes/modules/order_total/ot_coupon.php
   trunk/direct.openmoko.com/includes/modules/order_total/ot_gv.php
   trunk/direct.openmoko.com/includes/modules/order_total/ot_lev_discount.php
   trunk/direct.openmoko.com/includes/modules/order_total/ot_loworderfee.php
   trunk/direct.openmoko.com/includes/modules/order_total/ot_qty_discount.php
   trunk/direct.openmoko.com/includes/modules/order_total/ot_shipping.php
   trunk/direct.openmoko.com/includes/modules/order_total/ot_subtotal.php
   trunk/direct.openmoko.com/includes/modules/order_total/ot_tax.php
   trunk/direct.openmoko.com/includes/modules/order_total/ot_total.php
   trunk/direct.openmoko.com/includes/modules/payment/
   trunk/direct.openmoko.com/includes/modules/payment/SecurePay.php
   trunk/direct.openmoko.com/includes/modules/payment/authorizenet.php
   trunk/direct.openmoko.com/includes/modules/payment/cc_cvc.php
   trunk/direct.openmoko.com/includes/modules/payment/cc_old.php
   trunk/direct.openmoko.com/includes/modules/payment/cc_uk.php
   trunk/direct.openmoko.com/includes/modules/payment/ccerr.php
   trunk/direct.openmoko.com/includes/modules/payment/citibank.php
   trunk/direct.openmoko.com/includes/modules/payment/ckmerchantpartners.php
   trunk/direct.openmoko.com/includes/modules/payment/cod.php
   trunk/direct.openmoko.com/includes/modules/payment/efsnet.php
   trunk/direct.openmoko.com/includes/modules/payment/freecharger.php
   trunk/direct.openmoko.com/includes/modules/payment/geotrust.php
   trunk/direct.openmoko.com/includes/modules/payment/ipayment.php
   trunk/direct.openmoko.com/includes/modules/payment/merchantpartners.php
   trunk/direct.openmoko.com/includes/modules/payment/moneyorder.php
   trunk/direct.openmoko.com/includes/modules/payment/nochex.php
   trunk/direct.openmoko.com/includes/modules/payment/paybox.php
   trunk/direct.openmoko.com/includes/modules/payment/payflowpro.php
   trunk/direct.openmoko.com/includes/modules/payment/payjunction.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/AcceptOrder.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/PayPal.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/Results.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/TestPanel.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/languages/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/languages/english/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/languages/english/Help.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TransactionDetails.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TransactionSummaryLogs.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/ipn_test_panel.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_Config.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_Config.inc_notes.txt
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_FAQs.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/TransactionDetails.lng.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/paypal.lng.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/orders.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/results.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/application_bottom.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/application_top.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_process.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_process.inc_modified.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_splash.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_update.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/languages/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/languages/english/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/languages/english/info_cc.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/order_send_money.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Client/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Client/Connector.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Debug/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Debug/Debug.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/IPN/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/IPN/IPN.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Page/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Page/Page.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/TransactionDetails/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/TransactionDetails/TransactionDetails.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/debug.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/ipn.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/ipn_query.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/orders_session.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/osC/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/osC/Order.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/osC/osC.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/paypal_order.class.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/database_tables.inc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/addressbook.func.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/general.func.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/paypal.fnc.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/PayPal-ContinueCheckout.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/PayPal-no-account-Click-Here.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/act_accept.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/act_deny.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/amex.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/bulb.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/contents.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/discover.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/hdr_ipn_240x120.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/hdr_ppGlobev4_160x76.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/help.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/icon_error_40x40.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/logo.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/mastercard.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/oscommerce.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/paypal_intl.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/paypal_logo.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/period_ani.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/pixel.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/scr_symQuestion.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/top.png
   trunk/direct.openmoko.com/includes/modules/payment/paypal/images/visa.gif
   trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/english.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/english/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/english/ipn.lng.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/css/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/css/general.css
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/css/stylesheet.css
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/default.tpl.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/js/
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/js/general.js
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/osC_Admin.tpl.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/osC_Catalog.tpl.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/popup.tpl.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal_dp.php
   trunk/direct.openmoko.com/includes/modules/payment/paypal_ec.php
   trunk/direct.openmoko.com/includes/modules/payment/plugnpay.php
   trunk/direct.openmoko.com/includes/modules/payment/pm2checkout.php
   trunk/direct.openmoko.com/includes/modules/payment/psigate.php
   trunk/direct.openmoko.com/includes/modules/payment/qchex.php
   trunk/direct.openmoko.com/includes/modules/payment/quickcommerce.php
   trunk/direct.openmoko.com/includes/modules/payment/secpay.php
   trunk/direct.openmoko.com/includes/modules/payment/worldpay.php
   trunk/direct.openmoko.com/includes/modules/plugnpay_api.php
   trunk/direct.openmoko.com/includes/modules/product_listing.php
   trunk/direct.openmoko.com/includes/modules/product_listing_col.php
   trunk/direct.openmoko.com/includes/modules/quickcommerce_direct.php
   trunk/direct.openmoko.com/includes/modules/shipping/
   trunk/direct.openmoko.com/includes/modules/shipping/auspost.php
   trunk/direct.openmoko.com/includes/modules/shipping/auspostair.php
   trunk/direct.openmoko.com/includes/modules/shipping/ausposteconomy.php
   trunk/direct.openmoko.com/includes/modules/shipping/auspostexpress.php
   trunk/direct.openmoko.com/includes/modules/shipping/auspostsea.php
   trunk/direct.openmoko.com/includes/modules/shipping/bak/
   trunk/direct.openmoko.com/includes/modules/shipping/bak/upsxml.php
   trunk/direct.openmoko.com/includes/modules/shipping/canadapost.php
   trunk/direct.openmoko.com/includes/modules/shipping/fedex1.php
   trunk/direct.openmoko.com/includes/modules/shipping/flat.php
   trunk/direct.openmoko.com/includes/modules/shipping/freeshipper.php
   trunk/direct.openmoko.com/includes/modules/shipping/item.php
   trunk/direct.openmoko.com/includes/modules/shipping/percent.php
   trunk/direct.openmoko.com/includes/modules/shipping/reg.php
   trunk/direct.openmoko.com/includes/modules/shipping/spec.php
   trunk/direct.openmoko.com/includes/modules/shipping/spu.php
   trunk/direct.openmoko.com/includes/modules/shipping/stand.php
   trunk/direct.openmoko.com/includes/modules/shipping/table.php
   trunk/direct.openmoko.com/includes/modules/shipping/ups.php
   trunk/direct.openmoko.com/includes/modules/shipping/upsxml.php
   trunk/direct.openmoko.com/includes/modules/shipping/usps.php
   trunk/direct.openmoko.com/includes/modules/shipping/zones.php
   trunk/direct.openmoko.com/includes/modules/shipping/zones_single.php
   trunk/direct.openmoko.com/includes/modules/shipping_estimator.php
   trunk/direct.openmoko.com/includes/modules/upcoming_products.php
   trunk/direct.openmoko.com/includes/modules/wishlist/
   trunk/direct.openmoko.com/includes/modules/wishlist/wishlist.php
   trunk/direct.openmoko.com/includes/modules/wishlist/wishlist.php.txt
   trunk/direct.openmoko.com/includes/modules/xsell_products_buynow.php
   trunk/direct.openmoko.com/includes/nusoap.php
   trunk/direct.openmoko.com/includes/redirect_login_to.php
   trunk/direct.openmoko.com/includes/runtime/
   trunk/direct.openmoko.com/includes/search_in_header.php
   trunk/direct.openmoko.com/includes/spiders.txt
   trunk/direct.openmoko.com/includes/template_application_top.php
   trunk/direct.openmoko.com/includes/tld.txt
   trunk/direct.openmoko.com/includes/version.php
   trunk/direct.openmoko.com/includes/warnings.php
   trunk/direct.openmoko.com/index.php
   trunk/direct.openmoko.com/info_shopping_cart.php
   trunk/direct.openmoko.com/information.php
   trunk/direct.openmoko.com/ipn.php
   trunk/direct.openmoko.com/links.php
   trunk/direct.openmoko.com/links_submit.php
   trunk/direct.openmoko.com/links_submit_success.php
   trunk/direct.openmoko.com/login.php
   trunk/direct.openmoko.com/logoff.php
   trunk/direct.openmoko.com/pages.php
   trunk/direct.openmoko.com/password_forgotten.php
   trunk/direct.openmoko.com/paypal_notify.php
   trunk/direct.openmoko.com/pear/
   trunk/direct.openmoko.com/pear/.htaccess
   trunk/direct.openmoko.com/pear/Auth/
   trunk/direct.openmoko.com/pear/Auth/SASL.php
   trunk/direct.openmoko.com/pear/Auth/SASL/
   trunk/direct.openmoko.com/pear/Auth/SASL/Anonymous.php
   trunk/direct.openmoko.com/pear/Auth/SASL/Common.php
   trunk/direct.openmoko.com/pear/Auth/SASL/CramMD5.php
   trunk/direct.openmoko.com/pear/Auth/SASL/DigestMD5.php
   trunk/direct.openmoko.com/pear/Auth/SASL/Login.php
   trunk/direct.openmoko.com/pear/Auth/SASL/Plain.php
   trunk/direct.openmoko.com/pear/DB.php
   trunk/direct.openmoko.com/pear/DB/
   trunk/direct.openmoko.com/pear/DB/common.php
   trunk/direct.openmoko.com/pear/DB/dbase.php
   trunk/direct.openmoko.com/pear/DB/fbsql.php
   trunk/direct.openmoko.com/pear/DB/ibase.php
   trunk/direct.openmoko.com/pear/DB/ifx.php
   trunk/direct.openmoko.com/pear/DB/msql.php
   trunk/direct.openmoko.com/pear/DB/mssql.php
   trunk/direct.openmoko.com/pear/DB/mysql.php
   trunk/direct.openmoko.com/pear/DB/mysqli.php
   trunk/direct.openmoko.com/pear/DB/oci8.php
   trunk/direct.openmoko.com/pear/DB/odbc.php
   trunk/direct.openmoko.com/pear/DB/pgsql.php
   trunk/direct.openmoko.com/pear/DB/sqlite.php
   trunk/direct.openmoko.com/pear/DB/storage.php
   trunk/direct.openmoko.com/pear/DB/sybase.php
   trunk/direct.openmoko.com/pear/HTTP/
   trunk/direct.openmoko.com/pear/HTTP/Request.php
   trunk/direct.openmoko.com/pear/HTTP/Request/
   trunk/direct.openmoko.com/pear/HTTP/Request/Listener.php
   trunk/direct.openmoko.com/pear/Log.php
   trunk/direct.openmoko.com/pear/Log/
   trunk/direct.openmoko.com/pear/Log/composite.php
   trunk/direct.openmoko.com/pear/Log/console.php
   trunk/direct.openmoko.com/pear/Log/daemon.php
   trunk/direct.openmoko.com/pear/Log/display.php
   trunk/direct.openmoko.com/pear/Log/error_log.php
   trunk/direct.openmoko.com/pear/Log/file.php
   trunk/direct.openmoko.com/pear/Log/mail.php
   trunk/direct.openmoko.com/pear/Log/mcal.php
   trunk/direct.openmoko.com/pear/Log/mdb2.php
   trunk/direct.openmoko.com/pear/Log/null.php
   trunk/direct.openmoko.com/pear/Log/observer.php
   trunk/direct.openmoko.com/pear/Log/sql.php
   trunk/direct.openmoko.com/pear/Log/sqlite.php
   trunk/direct.openmoko.com/pear/Log/syslog.php
   trunk/direct.openmoko.com/pear/Log/win.php
   trunk/direct.openmoko.com/pear/Mail/
   trunk/direct.openmoko.com/pear/Mail/mime.php
   trunk/direct.openmoko.com/pear/Mail/mimeDecode.php
   trunk/direct.openmoko.com/pear/Mail/mimePart.php
   trunk/direct.openmoko.com/pear/Mail/smtp.php
   trunk/direct.openmoko.com/pear/Net/
   trunk/direct.openmoko.com/pear/Net/DIME.php
   trunk/direct.openmoko.com/pear/Net/SMTP.php
   trunk/direct.openmoko.com/pear/Net/Socket.php
   trunk/direct.openmoko.com/pear/Net/URL.php
   trunk/direct.openmoko.com/pear/PEAR.php
   trunk/direct.openmoko.com/pear/Services/
   trunk/direct.openmoko.com/pear/Services/PayPal.php
   trunk/direct.openmoko.com/pear/Services/PayPal/
   trunk/direct.openmoko.com/pear/Services/PayPal/CallerServices.php
   trunk/direct.openmoko.com/pear/Services/PayPal/CallerServices.php.in
   trunk/direct.openmoko.com/pear/Services/PayPal/EWPServices.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Error.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Profile.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Profile/
   trunk/direct.openmoko.com/pear/Services/PayPal/Profile/API.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Profile/EWP.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler/
   trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler/Array.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler/File.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SDK.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SDK/
   trunk/direct.openmoko.com/pear/Services/PayPal/SDK/Generator.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Base.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Client.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Disco.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Fault.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Parser.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/Email.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/Email_Gateway.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/TCP.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/HTTP.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/SMTP.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/TCP.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/dateTime.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/duration.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/hexBinary.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Value.php
   trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/WSDL.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AbstractRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AbstractResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AccountEntryType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AccountSummaryType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AdditionalAccountType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressVerifyRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressVerifyResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AmountType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AttributeSetType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AttributeType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/AuctionInfoType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateResponseDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/BasicAmountType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/BillUserRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/BillUserResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/BuyerType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/CalculatedShippingRateType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/CategoryArrayType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/CategoryType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/CharityType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/CreditCardDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/CrossPromotionsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/CustomSecurityHeaderType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureResponseDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentRequestDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentRequestDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentResponseDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoReauthorizationRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoReauthorizationResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoVoidRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoVoidResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ErrorParameterType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ErrorType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/FaultDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/FeeType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/FeesType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/FlatShippingRateType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsResponseDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetTransactionDetailsRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetTransactionDetailsResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ItemArrayType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ItemType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListOfAttributeSetType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListingDesignerType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListingDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayRequestItemType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/MeasureType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullInfoType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullPaymentResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullPaymentType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ModifiedFieldType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/OptionType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaginationResultType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaginationType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PayerInfoType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentDetailsItemType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentInfoType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentItemInfoType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentItemType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentMeansType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentTransactionSearchResultType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentTransactionType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PersonNameType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/PromotedItemType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/QuantityType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ReceiverInfoType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/RefundTransactionRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/RefundTransactionResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ReviseStatusType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SalesTaxType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SchedulingInfoType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SellerType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SellingStatusType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutRequestDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ShippingCarrierDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ShippingDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SiteHostedPictureType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/StorefrontType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SubscriptionInfoType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/SubscriptionTermsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionSearchRequestType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionSearchResponseType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionStatusType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/UserIdPasswordType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/UserType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/VATDetailsType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/ValType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/VendorHostedPictureType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/XSDSimpleType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/Type/XSDType.php
   trunk/direct.openmoko.com/pear/Services/PayPal/build/
   trunk/direct.openmoko.com/pear/Services/PayPal/build/README
   trunk/direct.openmoko.com/pear/Services/PayPal/cert/
   trunk/direct.openmoko.com/pear/Services/PayPal/cert/api_cert_chain.crt
   trunk/direct.openmoko.com/pear/Services/PayPal/cert/live.paypal.com.pem
   trunk/direct.openmoko.com/pear/Services/PayPal/cert/sandbox.paypal.com.pem
   trunk/direct.openmoko.com/pear/Services/PayPal/conf/
   trunk/direct.openmoko.com/pear/Services/PayPal/conf/paypal-sdk.php.dist
   trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/
   trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/CoreComponentTypes.xsd
   trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/PayPalSvc.wsdl
   trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/eBLBaseComponents.xsd
   trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/paypal-endpoints.php
   trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/paypal-endpoints.xml
   trunk/direct.openmoko.com/pear/configure.php
   trunk/direct.openmoko.com/popup_affiliate_help.php
   trunk/direct.openmoko.com/popup_coupon_help.php
   trunk/direct.openmoko.com/popup_cvs_help.php
   trunk/direct.openmoko.com/popup_image.php
   trunk/direct.openmoko.com/popup_links_help.php
   trunk/direct.openmoko.com/popup_paypal.php
   trunk/direct.openmoko.com/popup_search_help.php
   trunk/direct.openmoko.com/popup_wishlist_help.php
   trunk/direct.openmoko.com/print.css
   trunk/direct.openmoko.com/printorder.php
   trunk/direct.openmoko.com/product_info.php
   trunk/direct.openmoko.com/product_info_configureable.php
   trunk/direct.openmoko.com/product_reviews.php
   trunk/direct.openmoko.com/product_reviews_info.php
   trunk/direct.openmoko.com/product_reviews_write.php
   trunk/direct.openmoko.com/products_new.php
   trunk/direct.openmoko.com/pub/
   trunk/direct.openmoko.com/pub/.htaccess
   trunk/direct.openmoko.com/pw.php
   trunk/direct.openmoko.com/redirect.php
   trunk/direct.openmoko.com/reviews.php
   trunk/direct.openmoko.com/robots.txt
   trunk/direct.openmoko.com/rss.php
   trunk/direct.openmoko.com/shipping_estimator_popup.php
   trunk/direct.openmoko.com/shop_by_price.php
   trunk/direct.openmoko.com/shopping_cart.php
   trunk/direct.openmoko.com/specials.php
   trunk/direct.openmoko.com/ssl_check.php
   trunk/direct.openmoko.com/style.css
   trunk/direct.openmoko.com/tell_a_friend.php
   trunk/direct.openmoko.com/tell_a_friend_article.php
   trunk/direct.openmoko.com/temp/
   trunk/direct.openmoko.com/temp/.htaccess
   trunk/direct.openmoko.com/temp/delete_me_for_zip_only.txt
   trunk/direct.openmoko.com/templates/
   trunk/direct.openmoko.com/templates/E-vector/
   trunk/direct.openmoko.com/templates/E-vector/E-vector.sql
   trunk/direct.openmoko.com/templates/E-vector/boxes.tpl.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/
   trunk/direct.openmoko.com/templates/E-vector/boxes/affiliate.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/articles.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/asearch.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/authors.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/best_sellers.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/boxad.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/calendar.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/card1.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/categories.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/categories1.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/categories2.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/categories3.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/categories4.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/categories5.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/currencies.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/customer_gv.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/donate.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/downloads.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/example.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/faq.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/featured.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/googlead.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/information_table.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/languages.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/links.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/loginbox.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/manufacturer_info.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/manufacturers.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/navmenu.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/order_history.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/pages.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/product_notifications.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/reviews.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/search.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/search1.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/shop_by_price.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/shopping_cart.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/specials.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/tell_a_friend.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/theme_select.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/whats_new.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/whos_online.php
   trunk/direct.openmoko.com/templates/E-vector/boxes/wishlist.php
   trunk/direct.openmoko.com/templates/E-vector/doc/
   trunk/direct.openmoko.com/templates/E-vector/doc/buttonspec.txt
   trunk/direct.openmoko.com/templates/E-vector/doc/evector.btn
   trunk/direct.openmoko.com/templates/E-vector/doc/readmetabs.txt
   trunk/direct.openmoko.com/templates/E-vector/extra_html_output.php
   trunk/direct.openmoko.com/templates/E-vector/header.php
   trunk/direct.openmoko.com/templates/E-vector/images/
   trunk/direct.openmoko.com/templates/E-vector/images/E-vector.gif
   trunk/direct.openmoko.com/templates/E-vector/images/Evector.gif
   trunk/direct.openmoko.com/templates/E-vector/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_.psd
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_done.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_download.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_more_reviews.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_view_cart.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/readme.txt
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/E-vector/images/chr01.gif
   trunk/direct.openmoko.com/templates/E-vector/images/chr02.gif
   trunk/direct.openmoko.com/templates/E-vector/images/chr03.gif
   trunk/direct.openmoko.com/templates/E-vector/images/chr04.gif
   trunk/direct.openmoko.com/templates/E-vector/images/chr05.gif
   trunk/direct.openmoko.com/templates/E-vector/images/contact_us.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_007.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_01a.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_01ab.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_01d.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_02.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_03.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_04.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_05.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_07.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_09.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_11.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_13.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_15.gif
   trunk/direct.openmoko.com/templates/E-vector/images/header_17.gif
   trunk/direct.openmoko.com/templates/E-vector/images/home.gif
   trunk/direct.openmoko.com/templates/E-vector/images/infobox/
   trunk/direct.openmoko.com/templates/E-vector/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/E-vector/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/E-vector/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/E-vector/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/E-vector/images/infobox/pixel.gif
   trunk/direct.openmoko.com/templates/E-vector/images/login.gif
   trunk/direct.openmoko.com/templates/E-vector/images/logoff.gif
   trunk/direct.openmoko.com/templates/E-vector/images/my_account.gif
   trunk/direct.openmoko.com/templates/E-vector/images/pixel.gif
   trunk/direct.openmoko.com/templates/E-vector/images/pixel_trans.gif
   trunk/direct.openmoko.com/templates/E-vector/images/pointer_blue.gif
   trunk/direct.openmoko.com/templates/E-vector/images/pointer_blue_light.gif
   trunk/direct.openmoko.com/templates/E-vector/images/spacer.gif
   trunk/direct.openmoko.com/templates/E-vector/images/specials.gif
   trunk/direct.openmoko.com/templates/E-vector/images/under_header.gif
   trunk/direct.openmoko.com/templates/E-vector/images/under_headerbg.gif
   trunk/direct.openmoko.com/templates/E-vector/images/whatsnew.gif
   trunk/direct.openmoko.com/templates/E-vector/main_page.tpl.php
   trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/
   trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/default_specials.php
   trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/example.html
   trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/featured.php
   trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/main_categories.php
   trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/mainpage.php
   trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/new_products.php
   trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/upcoming_products.php
   trunk/direct.openmoko.com/templates/E-vector/stylesheet.css
   trunk/direct.openmoko.com/templates/Evector_ats/
   trunk/direct.openmoko.com/templates/Evector_ats/Evector_ats.sql
   trunk/direct.openmoko.com/templates/Evector_ats/doc/
   trunk/direct.openmoko.com/templates/Evector_ats/doc/buttonspec.txt
   trunk/direct.openmoko.com/templates/Evector_ats/doc/evector.btn
   trunk/direct.openmoko.com/templates/Evector_ats/doc/readmetabs.txt
   trunk/direct.openmoko.com/templates/Evector_ats/header.php
   trunk/direct.openmoko.com/templates/Evector_ats/images/
   trunk/direct.openmoko.com/templates/Evector_ats/images/Evector.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/Evector_ats.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_.psd
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_done.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_download.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_more_reviews.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/readme.txt
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/chr01.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/chr02.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/chr03.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/chr04.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/chr05.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/contact_us.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_007.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_01a.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_01ab.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_01d.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_02.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_03.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_04.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_05.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_07.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_09.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_11.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_13.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_15.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/header_17.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/home.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/arrow_main.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background_bot.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background_box.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background_main.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/backgroundfb.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/bm.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/bottom_center.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/box_bg_l.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/box_bg_r.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left_bot.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left_flip.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left_right.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right_bot.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right_flip.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/no_arrow_right.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/pixel.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/pixel_trans.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/q1.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/q2.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/r1.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/r2.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/login.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/logoff.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/my_account.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/pixel.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/pixel_trans.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/pointer_blue.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/pointer_blue_light.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/spacer.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/specials.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/under_header.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/under_headerbg.gif
   trunk/direct.openmoko.com/templates/Evector_ats/images/whatsnew.gif
   trunk/direct.openmoko.com/templates/Evector_ats/main_page.tpl.php
   trunk/direct.openmoko.com/templates/Evector_ats/stylesheet.css
   trunk/direct.openmoko.com/templates/Evector_ats/template.php
   trunk/direct.openmoko.com/templates/Helius/
   trunk/direct.openmoko.com/templates/Helius/Helius.sql
   trunk/direct.openmoko.com/templates/Helius/boxes.tpl.php
   trunk/direct.openmoko.com/templates/Helius/boxes/
   trunk/direct.openmoko.com/templates/Helius/boxes/affiliate.php
   trunk/direct.openmoko.com/templates/Helius/boxes/articles.php
   trunk/direct.openmoko.com/templates/Helius/boxes/asearch.php
   trunk/direct.openmoko.com/templates/Helius/boxes/authors.php
   trunk/direct.openmoko.com/templates/Helius/boxes/best_sellers.php
   trunk/direct.openmoko.com/templates/Helius/boxes/boxad.php
   trunk/direct.openmoko.com/templates/Helius/boxes/calendar.php
   trunk/direct.openmoko.com/templates/Helius/boxes/card1.php
   trunk/direct.openmoko.com/templates/Helius/boxes/categories.php
   trunk/direct.openmoko.com/templates/Helius/boxes/categories1.php
   trunk/direct.openmoko.com/templates/Helius/boxes/categories2.php
   trunk/direct.openmoko.com/templates/Helius/boxes/categories3.php
   trunk/direct.openmoko.com/templates/Helius/boxes/categories4.php
   trunk/direct.openmoko.com/templates/Helius/boxes/categories5.php
   trunk/direct.openmoko.com/templates/Helius/boxes/currencies.php
   trunk/direct.openmoko.com/templates/Helius/boxes/customer_gv.php
   trunk/direct.openmoko.com/templates/Helius/boxes/donate.php
   trunk/direct.openmoko.com/templates/Helius/boxes/downloads.php
   trunk/direct.openmoko.com/templates/Helius/boxes/example.php
   trunk/direct.openmoko.com/templates/Helius/boxes/faq.php
   trunk/direct.openmoko.com/templates/Helius/boxes/featured.php
   trunk/direct.openmoko.com/templates/Helius/boxes/googlead.php
   trunk/direct.openmoko.com/templates/Helius/boxes/information_table.php
   trunk/direct.openmoko.com/templates/Helius/boxes/languages.php
   trunk/direct.openmoko.com/templates/Helius/boxes/links.php
   trunk/direct.openmoko.com/templates/Helius/boxes/loginbox.php
   trunk/direct.openmoko.com/templates/Helius/boxes/manufacturer_info.php
   trunk/direct.openmoko.com/templates/Helius/boxes/manufacturers.php
   trunk/direct.openmoko.com/templates/Helius/boxes/navmenu.php
   trunk/direct.openmoko.com/templates/Helius/boxes/order_history.php
   trunk/direct.openmoko.com/templates/Helius/boxes/pages.php
   trunk/direct.openmoko.com/templates/Helius/boxes/product_notifications.php
   trunk/direct.openmoko.com/templates/Helius/boxes/reviews.php
   trunk/direct.openmoko.com/templates/Helius/boxes/search.php
   trunk/direct.openmoko.com/templates/Helius/boxes/search1.php
   trunk/direct.openmoko.com/templates/Helius/boxes/shop_by_price.php
   trunk/direct.openmoko.com/templates/Helius/boxes/shopping_cart.php
   trunk/direct.openmoko.com/templates/Helius/boxes/specials.php
   trunk/direct.openmoko.com/templates/Helius/boxes/tell_a_friend.php
   trunk/direct.openmoko.com/templates/Helius/boxes/theme_select.php
   trunk/direct.openmoko.com/templates/Helius/boxes/whats_new.php
   trunk/direct.openmoko.com/templates/Helius/boxes/whos_online.php
   trunk/direct.openmoko.com/templates/Helius/boxes/wishlist.php
   trunk/direct.openmoko.com/templates/Helius/doc/
   trunk/direct.openmoko.com/templates/Helius/doc/buttonspec.txt
   trunk/direct.openmoko.com/templates/Helius/doc/helius.btn
   trunk/direct.openmoko.com/templates/Helius/extra_html_output.php
   trunk/direct.openmoko.com/templates/Helius/images/
   trunk/direct.openmoko.com/templates/Helius/images/Helius.gif
   trunk/direct.openmoko.com/templates/Helius/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/Helius/images/button_blank_left.gif
   trunk/direct.openmoko.com/templates/Helius/images/button_blank_middle.gif
   trunk/direct.openmoko.com/templates/Helius/images/button_blank_right.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_.psd
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_view_cart.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/Helius/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/Helius/images/chr01.gif
   trunk/direct.openmoko.com/templates/Helius/images/chr02.gif
   trunk/direct.openmoko.com/templates/Helius/images/chr03.gif
   trunk/direct.openmoko.com/templates/Helius/images/chr04.gif
   trunk/direct.openmoko.com/templates/Helius/images/chr05.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/
   trunk/direct.openmoko.com/templates/Helius/images/infobox/7px.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/arrow_main.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/background.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/background_bot.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/background_box.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/background_box.psd
   trunk/direct.openmoko.com/templates/Helius/images/infobox/background_main.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/backgroundfb.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/bm.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/bottom_center.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/box_bg_l.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/box_bg_r.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left_bot.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left_flip.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left_right.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right_bot.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right_flip.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/no_arrow_right.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/pixel_trans.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/q1.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/q2.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/r1.gif
   trunk/direct.openmoko.com/templates/Helius/images/infobox/r2.gif
   trunk/direct.openmoko.com/templates/Helius/images/logo.gif
   trunk/direct.openmoko.com/templates/Helius/images/logo2.gif
   trunk/direct.openmoko.com/templates/Helius/images/logobk.gif
   trunk/direct.openmoko.com/templates/Helius/images/topbg2.gif
   trunk/direct.openmoko.com/templates/Helius/main_page.tpl.php
   trunk/direct.openmoko.com/templates/Helius/mainpage_modules/
   trunk/direct.openmoko.com/templates/Helius/mainpage_modules/default_specials.php
   trunk/direct.openmoko.com/templates/Helius/mainpage_modules/example.html
   trunk/direct.openmoko.com/templates/Helius/mainpage_modules/featured.php
   trunk/direct.openmoko.com/templates/Helius/mainpage_modules/main_categories.php
   trunk/direct.openmoko.com/templates/Helius/mainpage_modules/mainpage.php
   trunk/direct.openmoko.com/templates/Helius/mainpage_modules/new_products.php
   trunk/direct.openmoko.com/templates/Helius/mainpage_modules/upcoming_products.php
   trunk/direct.openmoko.com/templates/Helius/stylesheet.css
   trunk/direct.openmoko.com/templates/Helius1/
   trunk/direct.openmoko.com/templates/Helius1/Helius1.sql
   trunk/direct.openmoko.com/templates/Helius1/doc/
   trunk/direct.openmoko.com/templates/Helius1/doc/buttonspec.txt
   trunk/direct.openmoko.com/templates/Helius1/doc/helius.btn
   trunk/direct.openmoko.com/templates/Helius1/images/
   trunk/direct.openmoko.com/templates/Helius1/images/Helius.gif
   trunk/direct.openmoko.com/templates/Helius1/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/Helius1/images/button_blank_left.gif
   trunk/direct.openmoko.com/templates/Helius1/images/button_blank_middle.gif
   trunk/direct.openmoko.com/templates/Helius1/images/button_blank_right.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/7px.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/arrow_main.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/background.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_bot.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_box.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_box.psd
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_main.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/backgroundfb.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/bm.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/bottom_center.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/box_bg_l.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/box_bg_r.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left_bot.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left_flip.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left_right.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right_bot.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right_flip.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/no_arrow_right.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/pixel_trans.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/q1.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/q2.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/r1.gif
   trunk/direct.openmoko.com/templates/Helius1/images/infobox/r2.gif
   trunk/direct.openmoko.com/templates/Helius1/images/logo.gif
   trunk/direct.openmoko.com/templates/Helius1/images/logo2.gif
   trunk/direct.openmoko.com/templates/Helius1/images/logobk.gif
   trunk/direct.openmoko.com/templates/Helius1/images/topbg2.gif
   trunk/direct.openmoko.com/templates/Helius1/main_page.tpl.php
   trunk/direct.openmoko.com/templates/Helius1/stylesheet.css
   trunk/direct.openmoko.com/templates/Helius1/template.php
   trunk/direct.openmoko.com/templates/OpenMoko/
   trunk/direct.openmoko.com/templates/OpenMoko/OpenMoko.sql
   trunk/direct.openmoko.com/templates/OpenMoko/account.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/account_edit.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/account_history.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/account_history_info.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/account_newsletters.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/account_notifications.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/account_password.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/address_book.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/address_book_process.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/affiliate.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/articles.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/asearch.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/authors.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/best_sellers.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/boxad.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/calendar.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/card1.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories1.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories2.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories3.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories4.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories5.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/currencies.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/customer_gv.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/donate.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/downloads.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/example.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/faq.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/featured.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/googlead.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/information_table.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/languages.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/links.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/loginbox.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/manufacturer_info.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/manufacturers.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/navmenu.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/order_history.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/pages.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/product_notifications.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/reviews.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/search.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/search1.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/shop_by_price.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/shopping_cart.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/specials.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/tell_a_friend.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/theme_select.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/whats_new.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/whos_online.php
   trunk/direct.openmoko.com/templates/OpenMoko/boxes/wishlist.php
   trunk/direct.openmoko.com/templates/OpenMoko/checkout_confirmation.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/checkout_payment.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/checkout_shipping.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/checkout_shipping_address.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/checkout_success.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/column_right.php
   trunk/direct.openmoko.com/templates/OpenMoko/create_account.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/create_account_success.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/extra_html_output.php
   trunk/direct.openmoko.com/templates/OpenMoko/extra_html_output.php.bak
   trunk/direct.openmoko.com/templates/OpenMoko/footer.php
   trunk/direct.openmoko.com/templates/OpenMoko/header.php
   trunk/direct.openmoko.com/templates/OpenMoko/images/
   trunk/direct.openmoko.com/templates/OpenMoko/images/Original.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/admin_logo_right.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/back_bullet.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/breadcrumbs_back.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/button_buy.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/button_buy.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/button_accessories.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/button_products.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_.psd
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_download.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_red.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_view_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_add_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_address_book.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_back.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_banners.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_buy_now.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_change_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_checkout.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_confirm.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_continue.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_create_account.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_delete.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_download.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_edit_account.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_history.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_in_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_login.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_printorder.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_quick_find.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_redeem.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_reviews.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_search.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_send.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_submit_link.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_update.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_update_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_view_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_write_review.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/image_enlarge.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/small_delete.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/small_edit.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/small_view.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_add_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_address_book.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_back.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_banners.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_buy_now.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_change_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_checkout.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_confirm.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_continue.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_create_account.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_delete.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_download.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_edit_account.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_history.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_in_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_login.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_printorder.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_quick_find.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_redeem.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_reviews.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_search.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_send.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_submit_link.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_update.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_update_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_view_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_write_review.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/image_enlarge.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/small_delete.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/small_edit.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/small_view.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_add_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_address_book.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_back.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_banners.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_buy_now.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_change_address.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_checkout.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_confirm.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_continue.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_create_account.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_delete.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_download.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_edit_account.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_history.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_in_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_login.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_printorder.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_quick_find.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_redeem.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_reviews.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_search.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_send.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_submit_link.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_update.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_update_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_view_cart.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_write_review.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/image_enlarge.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/small_delete.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/small_edit.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/small_view.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/checkout_bullet.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/chr01.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/chr02.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/chr03.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/chr04.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/chr05.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/icons/
   trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_decrease_font.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_first.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_last.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_next.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_previous.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/
   trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/label/
   trunk/direct.openmoko.com/templates/OpenMoko/images/label/neo1973_title.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/label/search_openmoko.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/label/search_openmoko_gray.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/list_bullet.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/logo-banner_02.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/logo-banner_03.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/logo-banner_bg.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/main_category_accessories.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/main_category_phones.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/about.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/careers.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/contact.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/developers.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/home.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/network.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/press.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/products.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/shop.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/navigation_background.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/neo_advanced.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/no_cammera.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/openmoko_logo.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/original_background.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/oscommerce.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_bottom.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_h2.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_tile.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_top.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/stars_0.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/stars_1.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/stars_2.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/stars_3.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/stars_4.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/stars_5.gif
   trunk/direct.openmoko.com/templates/OpenMoko/images/toptab_left.png
   trunk/direct.openmoko.com/templates/OpenMoko/images/toptab_right.png
   trunk/direct.openmoko.com/templates/OpenMoko/index_default.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/index_products.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/login.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/login_acc.php
   trunk/direct.openmoko.com/templates/OpenMoko/login_pwa.php
   trunk/direct.openmoko.com/templates/OpenMoko/main_page.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/
   trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/default_specials.php
   trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/example.html
   trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/featured.php
   trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/main_categories.php
   trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/mainpage.php
   trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/new_products.php
   trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/upcoming_products.php
   trunk/direct.openmoko.com/templates/OpenMoko/modules/
   trunk/direct.openmoko.com/templates/OpenMoko/modules/address_book_details.php
   trunk/direct.openmoko.com/templates/OpenMoko/modules/product_listing.php
   trunk/direct.openmoko.com/templates/OpenMoko/modules/product_listing_col.php
   trunk/direct.openmoko.com/templates/OpenMoko/modules/shipping_estimator.php
   trunk/direct.openmoko.com/templates/OpenMoko/product_info.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/product_reviews.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/product_reviews_info.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/shopping_cart.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/stylesheet.css
   trunk/direct.openmoko.com/templates/OpenMoko/stylesheet.css.bak
   trunk/direct.openmoko.com/templates/OpenMoko/wishlist.tpl.php
   trunk/direct.openmoko.com/templates/OpenMoko/wishlist_email.tpl.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/OpenMoko.sql
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes.tpl.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/affiliate.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/articles.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/asearch.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/authors.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/best_sellers.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/boxad.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/calendar.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/card1.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories1.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories2.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories3.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories4.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories5.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/currencies.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/customer_gv.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/donate.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/downloads.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/example.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/faq.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/featured.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/googlead.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/information_table.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/languages.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/links.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/loginbox.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/manufacturer_info.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/manufacturers.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/navmenu.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/order_history.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/pages.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/product_notifications.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/reviews.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/search.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/search1.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/shop_by_price.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/shopping_cart.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/specials.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/tell_a_friend.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/theme_select.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/whats_new.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/whos_online.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/wishlist.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/extra_html_output.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/footer.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/header.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/Original.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/admin_logo_right.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_.psd
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_download.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_view_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_add_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_address_book.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_back.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_banners.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_buy_now.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_change_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_checkout.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_confirm.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_continue.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_create_account.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_delete.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_download.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_edit_account.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_history.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_in_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_login.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_printorder.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_quick_find.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_redeem.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_reviews.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_search.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_send.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_submit_link.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_update.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_update_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_view_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_write_review.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/image_enlarge.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/small_delete.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/small_edit.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/small_view.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_add_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_address_book.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_back.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_banners.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_buy_now.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_change_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_checkout.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_confirm.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_continue.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_create_account.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_delete.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_download.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_edit_account.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_history.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_in_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_login.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_printorder.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_quick_find.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_redeem.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_reviews.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_search.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_send.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_submit_link.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_update.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_update_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_view_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_write_review.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/image_enlarge.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/small_delete.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/small_edit.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/small_view.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_add_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_address_book.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_back.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_banners.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_buy_now.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_change_address.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_checkout.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_confirm.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_continue.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_create_account.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_delete.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_download.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_edit_account.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_history.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_in_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_login.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_printorder.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_quick_find.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_redeem.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_reviews.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_search.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_send.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_submit_link.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_update.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_update_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_view_cart.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_write_review.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/image_enlarge.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/small_delete.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/small_edit.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/small_view.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr01.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr02.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr03.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr04.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr05.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/neo1973_title.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/search_openmoko.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/search_openmoko_gray.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/logo-banner_02.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/logo-banner_03.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/logo-banner_bg.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/about.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/careers.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/contact.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/developers.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/home.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/network.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/press.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/products.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/openmoko_logo.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/original_background.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/oscommerce.gif
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/sidebox_bottom.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/sidebox_tile.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/sidebox_top.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/toptab_left.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/images/toptab_right.png
   trunk/direct.openmoko.com/templates/OpenMokoBackup/main_page.tpl.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/
   trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/default_specials.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/example.html
   trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/featured.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/main_categories.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/mainpage.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/new_products.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/upcoming_products.php
   trunk/direct.openmoko.com/templates/OpenMokoBackup/stylesheet.css
   trunk/direct.openmoko.com/templates/OpenMokoBackup/stylesheet.css.bak
   trunk/direct.openmoko.com/templates/Original/
   trunk/direct.openmoko.com/templates/Original/Original.sql
   trunk/direct.openmoko.com/templates/Original/boxes.tpl.php
   trunk/direct.openmoko.com/templates/Original/boxes/
   trunk/direct.openmoko.com/templates/Original/boxes/affiliate.php
   trunk/direct.openmoko.com/templates/Original/boxes/articles.php
   trunk/direct.openmoko.com/templates/Original/boxes/asearch.php
   trunk/direct.openmoko.com/templates/Original/boxes/authors.php
   trunk/direct.openmoko.com/templates/Original/boxes/best_sellers.php
   trunk/direct.openmoko.com/templates/Original/boxes/boxad.php
   trunk/direct.openmoko.com/templates/Original/boxes/calendar.php
   trunk/direct.openmoko.com/templates/Original/boxes/card1.php
   trunk/direct.openmoko.com/templates/Original/boxes/categories.php
   trunk/direct.openmoko.com/templates/Original/boxes/categories1.php
   trunk/direct.openmoko.com/templates/Original/boxes/categories2.php
   trunk/direct.openmoko.com/templates/Original/boxes/categories3.php
   trunk/direct.openmoko.com/templates/Original/boxes/categories4.php
   trunk/direct.openmoko.com/templates/Original/boxes/categories5.php
   trunk/direct.openmoko.com/templates/Original/boxes/currencies.php
   trunk/direct.openmoko.com/templates/Original/boxes/customer_gv.php
   trunk/direct.openmoko.com/templates/Original/boxes/donate.php
   trunk/direct.openmoko.com/templates/Original/boxes/downloads.php
   trunk/direct.openmoko.com/templates/Original/boxes/example.php
   trunk/direct.openmoko.com/templates/Original/boxes/faq.php
   trunk/direct.openmoko.com/templates/Original/boxes/featured.php
   trunk/direct.openmoko.com/templates/Original/boxes/googlead.php
   trunk/direct.openmoko.com/templates/Original/boxes/information_table.php
   trunk/direct.openmoko.com/templates/Original/boxes/languages.php
   trunk/direct.openmoko.com/templates/Original/boxes/links.php
   trunk/direct.openmoko.com/templates/Original/boxes/loginbox.php
   trunk/direct.openmoko.com/templates/Original/boxes/manufacturer_info.php
   trunk/direct.openmoko.com/templates/Original/boxes/manufacturers.php
   trunk/direct.openmoko.com/templates/Original/boxes/navmenu.php
   trunk/direct.openmoko.com/templates/Original/boxes/order_history.php
   trunk/direct.openmoko.com/templates/Original/boxes/pages.php
   trunk/direct.openmoko.com/templates/Original/boxes/product_notifications.php
   trunk/direct.openmoko.com/templates/Original/boxes/reviews.php
   trunk/direct.openmoko.com/templates/Original/boxes/search.php
   trunk/direct.openmoko.com/templates/Original/boxes/search1.php
   trunk/direct.openmoko.com/templates/Original/boxes/shop_by_price.php
   trunk/direct.openmoko.com/templates/Original/boxes/shopping_cart.php
   trunk/direct.openmoko.com/templates/Original/boxes/specials.php
   trunk/direct.openmoko.com/templates/Original/boxes/tell_a_friend.php
   trunk/direct.openmoko.com/templates/Original/boxes/theme_select.php
   trunk/direct.openmoko.com/templates/Original/boxes/whats_new.php
   trunk/direct.openmoko.com/templates/Original/boxes/whos_online.php
   trunk/direct.openmoko.com/templates/Original/boxes/wishlist.php
   trunk/direct.openmoko.com/templates/Original/extra_html_output.php
   trunk/direct.openmoko.com/templates/Original/footer.php
   trunk/direct.openmoko.com/templates/Original/header.php
   trunk/direct.openmoko.com/templates/Original/images/
   trunk/direct.openmoko.com/templates/Original/images/Original.gif
   trunk/direct.openmoko.com/templates/Original/images/admin_logo_right.gif
   trunk/direct.openmoko.com/templates/Original/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_.psd
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_download.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_view_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_add_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_address_book.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_back.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_banners.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_change_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_checkout.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_confirm.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_continue.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_create_account.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_delete.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_download.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_history.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_login.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_notifications.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_printorder.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_redeem.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_reviews.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_search.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_send.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_update.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_view_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_write_review.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/small_delete.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/small_edit.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/small_view.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_add_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_address_book.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_back.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_banners.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_change_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_checkout.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_confirm.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_continue.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_create_account.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_delete.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_download.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_history.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_login.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_notifications.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_printorder.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_redeem.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_reviews.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_search.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_send.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_update.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_view_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_write_review.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/small_delete.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/small_edit.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/french/small_view.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_add_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_address_book.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_back.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_banners.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_change_address.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_checkout.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_confirm.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_continue.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_create_account.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_delete.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_download.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_history.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_login.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_notifications.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_printorder.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_redeem.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_reviews.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_search.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_send.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_update.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_view_cart.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_write_review.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/small_delete.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/small_edit.gif
   trunk/direct.openmoko.com/templates/Original/images/buttons/german/small_view.gif
   trunk/direct.openmoko.com/templates/Original/images/chr01.gif
   trunk/direct.openmoko.com/templates/Original/images/chr02.gif
   trunk/direct.openmoko.com/templates/Original/images/chr03.gif
   trunk/direct.openmoko.com/templates/Original/images/chr04.gif
   trunk/direct.openmoko.com/templates/Original/images/chr05.gif
   trunk/direct.openmoko.com/templates/Original/images/infobox/
   trunk/direct.openmoko.com/templates/Original/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/Original/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/Original/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/Original/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/Original/images/logo-banner_02.gif
   trunk/direct.openmoko.com/templates/Original/images/logo-banner_03.gif
   trunk/direct.openmoko.com/templates/Original/images/logo-banner_bg.gif
   trunk/direct.openmoko.com/templates/Original/images/logo.gif
   trunk/direct.openmoko.com/templates/Original/images/openmoko_logo.png
   trunk/direct.openmoko.com/templates/Original/images/original_background.gif
   trunk/direct.openmoko.com/templates/Original/images/oscommerce.gif
   trunk/direct.openmoko.com/templates/Original/main_page.tpl.php
   trunk/direct.openmoko.com/templates/Original/mainpage_modules/
   trunk/direct.openmoko.com/templates/Original/mainpage_modules/default_specials.php
   trunk/direct.openmoko.com/templates/Original/mainpage_modules/example.html
   trunk/direct.openmoko.com/templates/Original/mainpage_modules/featured.php
   trunk/direct.openmoko.com/templates/Original/mainpage_modules/main_categories.php
   trunk/direct.openmoko.com/templates/Original/mainpage_modules/mainpage.php
   trunk/direct.openmoko.com/templates/Original/mainpage_modules/new_products.php
   trunk/direct.openmoko.com/templates/Original/mainpage_modules/upcoming_products.php
   trunk/direct.openmoko.com/templates/Original/stylesheet.css
   trunk/direct.openmoko.com/templates/Original1/
   trunk/direct.openmoko.com/templates/Original1/Original1.sql
   trunk/direct.openmoko.com/templates/Original1/footer.php
   trunk/direct.openmoko.com/templates/Original1/header.php
   trunk/direct.openmoko.com/templates/Original1/images/
   trunk/direct.openmoko.com/templates/Original1/images/Original.gif
   trunk/direct.openmoko.com/templates/Original1/images/admin_logo_right.gif
   trunk/direct.openmoko.com/templates/Original1/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_download.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_add_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_address_book.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_back.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_banners.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_change_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_checkout.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_confirm.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_continue.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_create_account.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_delete.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_download.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_history.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_login.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_notifications.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_printorder.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_redeem.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_reviews.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_search.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_send.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_update.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_write_review.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/small_delete.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/small_edit.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/small_view.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_add_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_address_book.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_back.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_banners.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_change_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_checkout.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_confirm.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_continue.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_create_account.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_delete.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_download.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_history.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_login.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_notifications.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_printorder.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_redeem.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_reviews.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_search.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_send.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_update.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_write_review.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/small_delete.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/small_edit.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/french/small_view.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_add_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_address_book.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_back.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_banners.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_change_address.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_checkout.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_confirm.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_continue.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_create_account.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_delete.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_download.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_history.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_login.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_notifications.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_printorder.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_redeem.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_reviews.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_search.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_send.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_update.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_write_review.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/small_delete.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/small_edit.gif
   trunk/direct.openmoko.com/templates/Original1/images/buttons/german/small_view.gif
   trunk/direct.openmoko.com/templates/Original1/images/chr01.gif
   trunk/direct.openmoko.com/templates/Original1/images/chr02.gif
   trunk/direct.openmoko.com/templates/Original1/images/chr03.gif
   trunk/direct.openmoko.com/templates/Original1/images/chr04.gif
   trunk/direct.openmoko.com/templates/Original1/images/chr05.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/
   trunk/direct.openmoko.com/templates/Original1/images/infobox/arrow_main.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/background.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/background_bot.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/background_box.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/background_main.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/backgroundfb.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/bm.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/bottom_center.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/box_bg_l.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/box_bg_r.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left_bot.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left_flip.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left_right.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_bot.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_flip.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_left_flip.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/no_arrow_right.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/pixel_trans.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/q1.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/q2.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/r1.gif
   trunk/direct.openmoko.com/templates/Original1/images/infobox/r2.gif
   trunk/direct.openmoko.com/templates/Original1/images/logo-banner_02.gif
   trunk/direct.openmoko.com/templates/Original1/images/logo-banner_03.gif
   trunk/direct.openmoko.com/templates/Original1/images/logo-banner_bg.gif
   trunk/direct.openmoko.com/templates/Original1/images/logo.gif
   trunk/direct.openmoko.com/templates/Original1/images/original_background.gif
   trunk/direct.openmoko.com/templates/Original1/images/oscommerce.gif
   trunk/direct.openmoko.com/templates/Original1/main_page.tpl.php
   trunk/direct.openmoko.com/templates/Original1/stylesheet.css
   trunk/direct.openmoko.com/templates/Original1/template.php
   trunk/direct.openmoko.com/templates/Pixame_v1/
   trunk/direct.openmoko.com/templates/Pixame_v1/Pixame_v1.sql
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes.tpl.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/affiliate.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/articles.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/asearch.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/authors.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/best_sellers.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/boxad.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/calendar.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/card1.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories1.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories2.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories3.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories4.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories5.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/currencies.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/customer_gv.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/donate.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/downloads.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/example.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/faq.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/featured.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/googlead.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/information_table.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/languages.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/links.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/loginbox.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/manufacturer_info.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/manufacturers.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/navmenu.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/order_history.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/pages.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/product_notifications.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/reviews.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/search.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/search1.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/shop_by_price.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/shopping_cart.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/specials.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/tell_a_friend.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/theme_select.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/whats_new.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/whos_online.php
   trunk/direct.openmoko.com/templates/Pixame_v1/boxes/wishlist.php
   trunk/direct.openmoko.com/templates/Pixame_v1/doc/
   trunk/direct.openmoko.com/templates/Pixame_v1/doc/buttonspec.txt
   trunk/direct.openmoko.com/templates/Pixame_v1/extra_html_output.php
   trunk/direct.openmoko.com/templates/Pixame_v1/footer.php
   trunk/direct.openmoko.com/templates/Pixame_v1/header.php
   trunk/direct.openmoko.com/templates/Pixame_v1/images/
   trunk/direct.openmoko.com/templates/Pixame_v1/images/Pixame_v1.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/Pixel.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/arrow.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/block_space_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/block_space_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_.psd
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_view_cart.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/chr01.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/chr02.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/chr03.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/chr04.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/chr05.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/footer_left_b.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/footer_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/footer_right_b.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/header_background.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/header_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/header_title.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/background.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/bar_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/bar_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/bar_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/box_bg_l.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/box_bg_r.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/center_footer_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/center_footer_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/center_footer_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/infobox_footer_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/infobox_footer_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/infobox_footer_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/q1.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/q2.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/r1.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/r2.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/kart1.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/links_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/links_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/links_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/pointer_blue.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/pointer_blue_light.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/slogan.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/slogan_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/space_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/images/space_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1/links.htm
   trunk/direct.openmoko.com/templates/Pixame_v1/links1.htm
   trunk/direct.openmoko.com/templates/Pixame_v1/main_page.tpl.php
   trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/
   trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/default_specials.php
   trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/example.html
   trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/featured.php
   trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/main_categories.php
   trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/mainpage.php
   trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/new_products.php
   trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/upcoming_products.php
   trunk/direct.openmoko.com/templates/Pixame_v1/stylesheet.css
   trunk/direct.openmoko.com/templates/Pixame_v1ats/
   trunk/direct.openmoko.com/templates/Pixame_v1ats/doc/
   trunk/direct.openmoko.com/templates/Pixame_v1ats/doc/buttonspec.txt
   trunk/direct.openmoko.com/templates/Pixame_v1ats/footer.php
   trunk/direct.openmoko.com/templates/Pixame_v1ats/header.php
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/Pixame_v1.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/Pixel.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/arrow.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/bg_cat4.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/block_space_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/block_space_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_add_address.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_add_wishlist.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_address.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_address_book.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_banners.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_build_a_link.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_clickthroughs.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_sales.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_back.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_banners.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_buy_now.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_change_address.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_checkout.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_confirm.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_confirm_order.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_continue.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_continue_shopping.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_create_account.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_delete.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_edit_account.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_history.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_in_cart.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_login.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_notifications.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_ppcheckout.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_printorder.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_quick_find.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_redeem.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_remove_notifications.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_reviews.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_search.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_send.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_shipping_options.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_submit_link.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_tell_a_friend.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_update.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_update_cart.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_write_review.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/image_enlarge.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/small_delete.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/small_edit.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/small_view.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr01.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr02.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr03.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr04.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr05.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/footer_left_b.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/footer_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/footer_right_b.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/header_background.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/header_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/header_title.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/arrow_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/background.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/backgroundfb.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bar_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bar_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bar_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bottom_center.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/box_bg_l.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/box_bg_r.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left_bot.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left_flip.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right_bot.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right_flip.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/infobox_footer_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/infobox_footer_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/infobox_footer_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/no_arrow_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/pixel.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/pixel_trans.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/q1.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/q2.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/r1.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/r2.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/kart1.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/links_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/links_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/links_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/pointer_blue.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/pointer_blue_light.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/slogan.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/slogan_middle.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/space_left.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/images/space_right.gif
   trunk/direct.openmoko.com/templates/Pixame_v1ats/install.sql
   trunk/direct.openmoko.com/templates/Pixame_v1ats/links.htm
   trunk/direct.openmoko.com/templates/Pixame_v1ats/links1.htm
   trunk/direct.openmoko.com/templates/Pixame_v1ats/main_page.tpl.php
   trunk/direct.openmoko.com/templates/Pixame_v1ats/stylesheet.css
   trunk/direct.openmoko.com/templates/Pixame_v1ats/template.php
   trunk/direct.openmoko.com/templates/content/
   trunk/direct.openmoko.com/templates/content/Order_Info.tpl.php
   trunk/direct.openmoko.com/templates/content/Order_Info_Process.tpl.php
   trunk/direct.openmoko.com/templates/content/account.tpl.php
   trunk/direct.openmoko.com/templates/content/account_edit.tpl.php
   trunk/direct.openmoko.com/templates/content/account_history.tpl.php
   trunk/direct.openmoko.com/templates/content/account_history_info.tpl.php
   trunk/direct.openmoko.com/templates/content/account_newsletters.tpl.php
   trunk/direct.openmoko.com/templates/content/account_notifications.tpl.php
   trunk/direct.openmoko.com/templates/content/account_password.tpl.php
   trunk/direct.openmoko.com/templates/content/address_book.tpl.php
   trunk/direct.openmoko.com/templates/content/address_book_process.tpl.php
   trunk/direct.openmoko.com/templates/content/advanced_search.tpl.php
   trunk/direct.openmoko.com/templates/content/advanced_search_result.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_affiliate.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_banners.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_clicks.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_contact.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_details.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_details_ok.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_logout.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_password_forgotten.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_payment.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_sales.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_signup.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_signup_ok.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_summary.tpl.php
   trunk/direct.openmoko.com/templates/content/affiliate_terms.tpl.php
   trunk/direct.openmoko.com/templates/content/all_prodcats.tpl.php
   trunk/direct.openmoko.com/templates/content/all_prodmanf.tpl.php
   trunk/direct.openmoko.com/templates/content/allprods.tpl.php
   trunk/direct.openmoko.com/templates/content/article_info.tpl.php
   trunk/direct.openmoko.com/templates/content/article_reviews.tpl.php
   trunk/direct.openmoko.com/templates/content/article_reviews_info.tpl.php
   trunk/direct.openmoko.com/templates/content/article_reviews_write.tpl.php
   trunk/direct.openmoko.com/templates/content/article_search.tpl.php
   trunk/direct.openmoko.com/templates/content/articles.tpl.php
   trunk/direct.openmoko.com/templates/content/articles_new.tpl.php
   trunk/direct.openmoko.com/templates/content/checkout_confirmation.tpl.php
   trunk/direct.openmoko.com/templates/content/checkout_payment.tpl.php
   trunk/direct.openmoko.com/templates/content/checkout_payment_address.tpl.php
   trunk/direct.openmoko.com/templates/content/checkout_shipping.tpl.php
   trunk/direct.openmoko.com/templates/content/checkout_shipping_address.tpl.php
   trunk/direct.openmoko.com/templates/content/checkout_success.tpl.php
   trunk/direct.openmoko.com/templates/content/contact_us.tpl.php
   trunk/direct.openmoko.com/templates/content/cookie_usage.tpl.php
   trunk/direct.openmoko.com/templates/content/create_account.tpl.php
   trunk/direct.openmoko.com/templates/content/create_account_success.tpl.php
   trunk/direct.openmoko.com/templates/content/down_for_maintenance.tpl.php
   trunk/direct.openmoko.com/templates/content/events_calendar.tpl.php
   trunk/direct.openmoko.com/templates/content/faq.tpl.php
   trunk/direct.openmoko.com/templates/content/featured_products.tpl.php
   trunk/direct.openmoko.com/templates/content/gv_faq.tpl.php
   trunk/direct.openmoko.com/templates/content/gv_redeem.tpl.php
   trunk/direct.openmoko.com/templates/content/gv_send.tpl.php
   trunk/direct.openmoko.com/templates/content/index_default.tpl.php
   trunk/direct.openmoko.com/templates/content/index_nested.tpl.php
   trunk/direct.openmoko.com/templates/content/index_products.tpl.php
   trunk/direct.openmoko.com/templates/content/information.tpl.php
   trunk/direct.openmoko.com/templates/content/links.tpl.php
   trunk/direct.openmoko.com/templates/content/links_submit.tpl.php
   trunk/direct.openmoko.com/templates/content/links_submit_success.tpl.php
   trunk/direct.openmoko.com/templates/content/login.tpl.php
   trunk/direct.openmoko.com/templates/content/logoff.tpl.php
   trunk/direct.openmoko.com/templates/content/pages.tpl.php
   trunk/direct.openmoko.com/templates/content/password_forgotten.tpl.php
   trunk/direct.openmoko.com/templates/content/popup_image.tpl.php
   trunk/direct.openmoko.com/templates/content/popup_links_help.php
   trunk/direct.openmoko.com/templates/content/popup_search_help.tpl.php
   trunk/direct.openmoko.com/templates/content/product_info.tpl.php
   trunk/direct.openmoko.com/templates/content/product_reviews.tpl.php
   trunk/direct.openmoko.com/templates/content/product_reviews_info.tpl.php
   trunk/direct.openmoko.com/templates/content/product_reviews_write.tpl.php
   trunk/direct.openmoko.com/templates/content/products_new.tpl.php
   trunk/direct.openmoko.com/templates/content/pw.tpl.php
   trunk/direct.openmoko.com/templates/content/reviews.tpl.php
   trunk/direct.openmoko.com/templates/content/shop_by_price.tpl.php
   trunk/direct.openmoko.com/templates/content/shopping_cart.tpl.php
   trunk/direct.openmoko.com/templates/content/specials.tpl.php
   trunk/direct.openmoko.com/templates/content/ssl_check.tpl.php
   trunk/direct.openmoko.com/templates/content/static.tpl.php
   trunk/direct.openmoko.com/templates/content/tell_a_friend.tpl.php
   trunk/direct.openmoko.com/templates/content/tell_a_friend_article.tpl.php
   trunk/direct.openmoko.com/templates/content/upcoming_products.tpl.php
   trunk/direct.openmoko.com/templates/content/validate_new.tpl.php
   trunk/direct.openmoko.com/templates/content/wishlist.tpl.php
   trunk/direct.openmoko.com/templates/content/wishlist_email.tpl.php
   trunk/direct.openmoko.com/templates/content/wpcallback.tpl.php
   trunk/direct.openmoko.com/templates/default/
   trunk/direct.openmoko.com/templates/default/boxes.tpl.php
   trunk/direct.openmoko.com/templates/default/boxes/
   trunk/direct.openmoko.com/templates/default/boxes/affiliate.php
   trunk/direct.openmoko.com/templates/default/boxes/articles.php
   trunk/direct.openmoko.com/templates/default/boxes/asearch.php
   trunk/direct.openmoko.com/templates/default/boxes/authors.php
   trunk/direct.openmoko.com/templates/default/boxes/best_sellers.php
   trunk/direct.openmoko.com/templates/default/boxes/boxad.php
   trunk/direct.openmoko.com/templates/default/boxes/calendar.php
   trunk/direct.openmoko.com/templates/default/boxes/card1.php
   trunk/direct.openmoko.com/templates/default/boxes/categories.php
   trunk/direct.openmoko.com/templates/default/boxes/categories1.php
   trunk/direct.openmoko.com/templates/default/boxes/categories2.php
   trunk/direct.openmoko.com/templates/default/boxes/categories3.php
   trunk/direct.openmoko.com/templates/default/boxes/categories4.php
   trunk/direct.openmoko.com/templates/default/boxes/categories5.php
   trunk/direct.openmoko.com/templates/default/boxes/currencies.php
   trunk/direct.openmoko.com/templates/default/boxes/customer_gv.php
   trunk/direct.openmoko.com/templates/default/boxes/donate.php
   trunk/direct.openmoko.com/templates/default/boxes/downloads.php
   trunk/direct.openmoko.com/templates/default/boxes/example.php
   trunk/direct.openmoko.com/templates/default/boxes/faq.php
   trunk/direct.openmoko.com/templates/default/boxes/featured.php
   trunk/direct.openmoko.com/templates/default/boxes/googlead.php
   trunk/direct.openmoko.com/templates/default/boxes/information_table.php
   trunk/direct.openmoko.com/templates/default/boxes/languages.php
   trunk/direct.openmoko.com/templates/default/boxes/links.php
   trunk/direct.openmoko.com/templates/default/boxes/loginbox.php
   trunk/direct.openmoko.com/templates/default/boxes/manufacturer_info.php
   trunk/direct.openmoko.com/templates/default/boxes/manufacturers.php
   trunk/direct.openmoko.com/templates/default/boxes/navmenu.php
   trunk/direct.openmoko.com/templates/default/boxes/order_history.php
   trunk/direct.openmoko.com/templates/default/boxes/pages.php
   trunk/direct.openmoko.com/templates/default/boxes/product_notifications.php
   trunk/direct.openmoko.com/templates/default/boxes/reviews.php
   trunk/direct.openmoko.com/templates/default/boxes/search.php
   trunk/direct.openmoko.com/templates/default/boxes/search1.php
   trunk/direct.openmoko.com/templates/default/boxes/shop_by_price.php
   trunk/direct.openmoko.com/templates/default/boxes/shopping_cart.php
   trunk/direct.openmoko.com/templates/default/boxes/specials.php
   trunk/direct.openmoko.com/templates/default/boxes/tell_a_friend.php
   trunk/direct.openmoko.com/templates/default/boxes/theme_select.php
   trunk/direct.openmoko.com/templates/default/boxes/whats_new.php
   trunk/direct.openmoko.com/templates/default/boxes/whos_online.php
   trunk/direct.openmoko.com/templates/default/boxes/wishlist.php
   trunk/direct.openmoko.com/templates/default/extra_html_output.php
   trunk/direct.openmoko.com/templates/default/images/
   trunk/direct.openmoko.com/templates/default/images/chr01.gif
   trunk/direct.openmoko.com/templates/default/images/chr02.gif
   trunk/direct.openmoko.com/templates/default/images/chr03.gif
   trunk/direct.openmoko.com/templates/default/images/chr04.gif
   trunk/direct.openmoko.com/templates/default/images/chr05.gif
   trunk/direct.openmoko.com/templates/default/images/logo.gif
   trunk/direct.openmoko.com/templates/default/mainpage_modules/
   trunk/direct.openmoko.com/templates/default/mainpage_modules/articles.php
   trunk/direct.openmoko.com/templates/default/mainpage_modules/default_specials.php
   trunk/direct.openmoko.com/templates/default/mainpage_modules/example.html
   trunk/direct.openmoko.com/templates/default/mainpage_modules/faq.php
   trunk/direct.openmoko.com/templates/default/mainpage_modules/featured.php
   trunk/direct.openmoko.com/templates/default/mainpage_modules/featured_products.php
   trunk/direct.openmoko.com/templates/default/mainpage_modules/main_categories.php
   trunk/direct.openmoko.com/templates/default/mainpage_modules/mainpage.php
   trunk/direct.openmoko.com/templates/default/mainpage_modules/new_products.php
   trunk/direct.openmoko.com/templates/default/mainpage_modules/upcoming_products.php
   trunk/direct.openmoko.com/templates/default/modules/
   trunk/direct.openmoko.com/templates/default/modules/additional_images.php
   trunk/direct.openmoko.com/templates/default/modules/also_purchased_products.php
   trunk/direct.openmoko.com/templates/default/modules/an_example.php
   trunk/direct.openmoko.com/templates/default/modules/featured_products.php
   trunk/direct.openmoko.com/templates/default/modules/product_attributes.php
   trunk/direct.openmoko.com/templates/default/modules/product_buttons.php
   trunk/direct.openmoko.com/templates/default/modules/product_discription.php
   trunk/direct.openmoko.com/templates/default/modules/product_extra_feilds.php
   trunk/direct.openmoko.com/templates/default/modules/products_more_information.php
   trunk/direct.openmoko.com/templates/default/modules/shipping_estimator.php
   trunk/direct.openmoko.com/templates/default/modules/xsell_products_buynow.php
   trunk/direct.openmoko.com/tmp/
   trunk/direct.openmoko.com/tmp/delete_me_for_zip_only.txt
   trunk/direct.openmoko.com/upcoming_products.php
   trunk/direct.openmoko.com/validate_new.php
   trunk/direct.openmoko.com/vvc_display.php
   trunk/direct.openmoko.com/wishlist.php
   trunk/direct.openmoko.com/wishlist_email.php
   trunk/direct.openmoko.com/wishlist_help.php
   trunk/direct.openmoko.com/wpcallback.php
   trunk/www.openmoko.com/HISTORY.txt
   trunk/www.openmoko.com/README.txt
   trunk/www.openmoko.com/errors.txt
   trunk/www.openmoko.com/files/
   trunk/www.openmoko.com/ie6fix.css
   trunk/www.openmoko.com/images/
   trunk/www.openmoko.com/images/__sample_accessory_1.png
   trunk/www.openmoko.com/images/__sample_accessory_2.png
   trunk/www.openmoko.com/images/__sample_banner_1.png
   trunk/www.openmoko.com/images/__sample_banner_2.png
   trunk/www.openmoko.com/images/__sample_headset.png
   trunk/www.openmoko.com/images/a/
   trunk/www.openmoko.com/images/a/__sample_accessory_1.png
   trunk/www.openmoko.com/images/a/__sample_accessory_2.png
   trunk/www.openmoko.com/images/a/__sample_banner_1.png
   trunk/www.openmoko.com/images/a/__sample_banner_2.png
   trunk/www.openmoko.com/images/a/__sample_headset.png
   trunk/www.openmoko.com/images/a/accessories_back.png
   trunk/www.openmoko.com/images/a/accessories_back2.png
   trunk/www.openmoko.com/images/a/accessories_tabs_left.png
   trunk/www.openmoko.com/images/a/accessories_tabs_left_alt.png
   trunk/www.openmoko.com/images/a/accessories_tabs_right.png
   trunk/www.openmoko.com/images/a/accessories_tabs_right_alt.png
   trunk/www.openmoko.com/images/a/accessory_featured_tile.png
   trunk/www.openmoko.com/images/a/accessory_featured_top.png
   trunk/www.openmoko.com/images/a/accessory_tile.png
   trunk/www.openmoko.com/images/a/accessory_tile_alt.png
   trunk/www.openmoko.com/images/a/accessory_top.png
   trunk/www.openmoko.com/images/a/accessory_top_alt.png
   trunk/www.openmoko.com/images/a/article_bullet.png
   trunk/www.openmoko.com/images/a/article_bullet_hover.png
   trunk/www.openmoko.com/images/a/banner_about.jpg
   trunk/www.openmoko.com/images/a/banner_accessories.jpg
   trunk/www.openmoko.com/images/a/banner_careers.jpg
   trunk/www.openmoko.com/images/a/banner_contact.jpg
   trunk/www.openmoko.com/images/a/banner_details.png
   trunk/www.openmoko.com/images/a/banner_developers.jpg
   trunk/www.openmoko.com/images/a/banner_featured_accessory.jpg
   trunk/www.openmoko.com/images/a/banner_featured_accessory.png
   trunk/www.openmoko.com/images/a/banner_press.jpg
   trunk/www.openmoko.com/images/a/banner_products.jpg
   trunk/www.openmoko.com/images/a/banner_search.jpg
   trunk/www.openmoko.com/images/a/blank.gif
   trunk/www.openmoko.com/images/a/bullet_back_to_accessories.png
   trunk/www.openmoko.com/images/a/button_add_to_cart.png
   trunk/www.openmoko.com/images/a/button_add_to_cart_gray.png
   trunk/www.openmoko.com/images/a/button_add_to_cart_white.png
   trunk/www.openmoko.com/images/a/button_all_accessories.png
   trunk/www.openmoko.com/images/a/button_all_accessories_whit.png
   trunk/www.openmoko.com/images/a/button_buy_it_now.png
   trunk/www.openmoko.com/images/a/button_by_it_now.png
   trunk/www.openmoko.com/images/a/button_enlarge.png
   trunk/www.openmoko.com/images/a/button_go.png
   trunk/www.openmoko.com/images/a/button_go_homepage.png
   trunk/www.openmoko.com/images/a/button_more_details.png
   trunk/www.openmoko.com/images/a/button_more_details_gray.png
   trunk/www.openmoko.com/images/a/button_news_archive.png
   trunk/www.openmoko.com/images/a/button_read_more.png
   trunk/www.openmoko.com/images/a/button_read_more_gray.png
   trunk/www.openmoko.com/images/a/button_select.png
   trunk/www.openmoko.com/images/a/favicon.ico
   trunk/www.openmoko.com/images/a/home_background.png
   trunk/www.openmoko.com/images/a/home_banner.jpg
   trunk/www.openmoko.com/images/a/home_quote.png
   trunk/www.openmoko.com/images/a/icon_rss.png
   trunk/www.openmoko.com/images/a/icons/
   trunk/www.openmoko.com/images/a/icons/icon_decrease_font.png
   trunk/www.openmoko.com/images/a/icons/icon_first.png
   trunk/www.openmoko.com/images/a/icons/icon_last.png
   trunk/www.openmoko.com/images/a/icons/icon_next.png
   trunk/www.openmoko.com/images/a/icons/icon_previous.png
   trunk/www.openmoko.com/images/a/label/
   trunk/www.openmoko.com/images/a/label/neo1973_title.png
   trunk/www.openmoko.com/images/a/label/search_openmoko.png
   trunk/www.openmoko.com/images/a/label/search_openmoko_gray.png
   trunk/www.openmoko.com/images/a/link_bullet.png
   trunk/www.openmoko.com/images/a/list_bullet.png
   trunk/www.openmoko.com/images/a/middleblock_left.png
   trunk/www.openmoko.com/images/a/middleblock_right.png
   trunk/www.openmoko.com/images/a/middleblock_tabs_left.png
   trunk/www.openmoko.com/images/a/middleblock_tabs_right.png
   trunk/www.openmoko.com/images/a/middleblock_tile.png
   trunk/www.openmoko.com/images/a/navigation/
   trunk/www.openmoko.com/images/a/navigation/about.png
   trunk/www.openmoko.com/images/a/navigation/accessories/
   trunk/www.openmoko.com/images/a/navigation/accessories/about.png
   trunk/www.openmoko.com/images/a/navigation/accessories/careers.png
   trunk/www.openmoko.com/images/a/navigation/accessories/contact.png
   trunk/www.openmoko.com/images/a/navigation/accessories/developers.png
   trunk/www.openmoko.com/images/a/navigation/accessories/home.png
   trunk/www.openmoko.com/images/a/navigation/accessories/press.png
   trunk/www.openmoko.com/images/a/navigation/accessories/products.png
   trunk/www.openmoko.com/images/a/navigation/accessories/shop.png
   trunk/www.openmoko.com/images/a/navigation/careers.png
   trunk/www.openmoko.com/images/a/navigation/contact.png
   trunk/www.openmoko.com/images/a/navigation/default/
   trunk/www.openmoko.com/images/a/navigation/default/about.png
   trunk/www.openmoko.com/images/a/navigation/default/careers.png
   trunk/www.openmoko.com/images/a/navigation/default/contact.png
   trunk/www.openmoko.com/images/a/navigation/default/developers.png
   trunk/www.openmoko.com/images/a/navigation/default/home.png
   trunk/www.openmoko.com/images/a/navigation/default/press.png
   trunk/www.openmoko.com/images/a/navigation/default/products.png
   trunk/www.openmoko.com/images/a/navigation/default/shop.png
   trunk/www.openmoko.com/images/a/navigation/developers.png
   trunk/www.openmoko.com/images/a/navigation/home.png
   trunk/www.openmoko.com/images/a/navigation/phone/
   trunk/www.openmoko.com/images/a/navigation/phone/about.png
   trunk/www.openmoko.com/images/a/navigation/phone/careers.png
   trunk/www.openmoko.com/images/a/navigation/phone/contact.png
   trunk/www.openmoko.com/images/a/navigation/phone/developers.png
   trunk/www.openmoko.com/images/a/navigation/phone/home.png
   trunk/www.openmoko.com/images/a/navigation/phone/press.png
   trunk/www.openmoko.com/images/a/navigation/phone/products.png
   trunk/www.openmoko.com/images/a/navigation/phone/shop.png
   trunk/www.openmoko.com/images/a/navigation/press.png
   trunk/www.openmoko.com/images/a/navigation/products.png
   trunk/www.openmoko.com/images/a/navigation/products/
   trunk/www.openmoko.com/images/a/navigation/products/about.png
   trunk/www.openmoko.com/images/a/navigation/products/careers.png
   trunk/www.openmoko.com/images/a/navigation/products/contact.png
   trunk/www.openmoko.com/images/a/navigation/products/developers.png
   trunk/www.openmoko.com/images/a/navigation/products/home.png
   trunk/www.openmoko.com/images/a/navigation/products/press.png
   trunk/www.openmoko.com/images/a/navigation/products/products.png
   trunk/www.openmoko.com/images/a/navigation/products/shop.png
   trunk/www.openmoko.com/images/a/navigation/semi/
   trunk/www.openmoko.com/images/a/navigation/semi/about.png
   trunk/www.openmoko.com/images/a/navigation/semi/careers.png
   trunk/www.openmoko.com/images/a/navigation/semi/contact.png
   trunk/www.openmoko.com/images/a/navigation/semi/developers.png
   trunk/www.openmoko.com/images/a/navigation/semi/home.png
   trunk/www.openmoko.com/images/a/navigation/semi/press.png
   trunk/www.openmoko.com/images/a/navigation/semi/products.png
   trunk/www.openmoko.com/images/a/navigation/semi/shop.png
   trunk/www.openmoko.com/images/a/navigation/shop.png
   trunk/www.openmoko.com/images/a/navigation_accessories.jpg
   trunk/www.openmoko.com/images/a/navigation_background.png
   trunk/www.openmoko.com/images/a/navigation_default.jpg
   trunk/www.openmoko.com/images/a/navigation_home.png
   trunk/www.openmoko.com/images/a/navigation_neo.png
   trunk/www.openmoko.com/images/a/navigation_products.jpg
   trunk/www.openmoko.com/images/a/openmoko_logo.png
   trunk/www.openmoko.com/images/a/openmoko_logo_2.png
   trunk/www.openmoko.com/images/a/orange_bullet.png
   trunk/www.openmoko.com/images/a/phone_toptab_left.png
   trunk/www.openmoko.com/images/a/phone_toptab_right.png
   trunk/www.openmoko.com/images/a/product_bottom_shadow.png
   trunk/www.openmoko.com/images/a/product_bottom_shadow_small.png
   trunk/www.openmoko.com/images/a/products/
   trunk/www.openmoko.com/images/a/products/accessories/
   trunk/www.openmoko.com/images/a/products/accessories/a/
   trunk/www.openmoko.com/images/a/products/accessories/a/14aaa.png
   trunk/www.openmoko.com/images/a/products/accessories/a/5f234.png
   trunk/www.openmoko.com/images/a/products/accessories/a/7aaa.png
   trunk/www.openmoko.com/images/a/products/accessories/a/dasd.png
   trunk/www.openmoko.com/images/a/products/accessories/car_kit.png
   trunk/www.openmoko.com/images/a/products/accessories/carrying_case.png
   trunk/www.openmoko.com/images/a/products/accessories/carrying_tape.png
   trunk/www.openmoko.com/images/a/products/accessories/hackers_lunch_box.png
   trunk/www.openmoko.com/images/a/products/accessories/stylus.png
   trunk/www.openmoko.com/images/a/products/banner_neo.png
   trunk/www.openmoko.com/images/a/products/banner_neo2.png
   trunk/www.openmoko.com/images/a/products/banner_neo2_thumb.png
   trunk/www.openmoko.com/images/a/products/banner_neo_thumb.png
   trunk/www.openmoko.com/images/a/products/featured.png
   trunk/www.openmoko.com/images/a/products/hackers.png
   trunk/www.openmoko.com/images/a/products/hackers_small.png
   trunk/www.openmoko.com/images/a/products_page.jpg
   trunk/www.openmoko.com/images/a/sidebox_bottom.png
   trunk/www.openmoko.com/images/a/sidebox_tile.png
   trunk/www.openmoko.com/images/a/sidebox_top.png
   trunk/www.openmoko.com/images/a/titlebar_accessories.jpg
   trunk/www.openmoko.com/images/a/titlebar_products.jpg
   trunk/www.openmoko.com/images/a/top_link.png
   trunk/www.openmoko.com/images/a/toptab_left.png
   trunk/www.openmoko.com/images/a/toptab_right.png
   trunk/www.openmoko.com/images/accessories_back.png
   trunk/www.openmoko.com/images/accessories_back2.png
   trunk/www.openmoko.com/images/accessories_tabs_left.png
   trunk/www.openmoko.com/images/accessories_tabs_left_alt.png
   trunk/www.openmoko.com/images/accessories_tabs_right.png
   trunk/www.openmoko.com/images/accessories_tabs_right_alt.png
   trunk/www.openmoko.com/images/accessory_featured_tile.png
   trunk/www.openmoko.com/images/accessory_featured_top.png
   trunk/www.openmoko.com/images/accessory_tile.png
   trunk/www.openmoko.com/images/accessory_tile_alt.png
   trunk/www.openmoko.com/images/accessory_top.png
   trunk/www.openmoko.com/images/accessory_top_alt.png
   trunk/www.openmoko.com/images/article_bullet.png
   trunk/www.openmoko.com/images/article_bullet_hover.png
   trunk/www.openmoko.com/images/bak/
   trunk/www.openmoko.com/images/bak/__sample_accessory_1.png
   trunk/www.openmoko.com/images/bak/__sample_accessory_2.png
   trunk/www.openmoko.com/images/bak/__sample_banner_1.png
   trunk/www.openmoko.com/images/bak/__sample_banner_2.png
   trunk/www.openmoko.com/images/bak/__sample_headset.png
   trunk/www.openmoko.com/images/bak/accessories_back.png
   trunk/www.openmoko.com/images/bak/accessories_back2.png
   trunk/www.openmoko.com/images/bak/accessories_tabs_left.png
   trunk/www.openmoko.com/images/bak/accessories_tabs_left_alt.png
   trunk/www.openmoko.com/images/bak/accessories_tabs_right.png
   trunk/www.openmoko.com/images/bak/accessories_tabs_right_alt.png
   trunk/www.openmoko.com/images/bak/accessory_featured_tile.png
   trunk/www.openmoko.com/images/bak/accessory_featured_top.png
   trunk/www.openmoko.com/images/bak/accessory_tile.png
   trunk/www.openmoko.com/images/bak/accessory_tile_alt.png
   trunk/www.openmoko.com/images/bak/accessory_top.png
   trunk/www.openmoko.com/images/bak/accessory_top_alt.png
   trunk/www.openmoko.com/images/bak/article_bullet.png
   trunk/www.openmoko.com/images/bak/article_bullet_hover.png
   trunk/www.openmoko.com/images/bak/banner_about.jpg
   trunk/www.openmoko.com/images/bak/banner_accessories.jpg
   trunk/www.openmoko.com/images/bak/banner_careers.jpg
   trunk/www.openmoko.com/images/bak/banner_contact.jpg
   trunk/www.openmoko.com/images/bak/banner_details.png
   trunk/www.openmoko.com/images/bak/banner_developers.jpg
   trunk/www.openmoko.com/images/bak/banner_featured_accessory.jpg
   trunk/www.openmoko.com/images/bak/banner_featured_accessory.png
   trunk/www.openmoko.com/images/bak/banner_press.jpg
   trunk/www.openmoko.com/images/bak/banner_products.jpg
   trunk/www.openmoko.com/images/bak/banner_search.jpg
   trunk/www.openmoko.com/images/bak/blank.gif
   trunk/www.openmoko.com/images/bak/bullet_back_to_accessories.png
   trunk/www.openmoko.com/images/bak/button_add_to_cart.png
   trunk/www.openmoko.com/images/bak/button_add_to_cart_gray.png
   trunk/www.openmoko.com/images/bak/button_add_to_cart_white.png
   trunk/www.openmoko.com/images/bak/button_all_accessories.png
   trunk/www.openmoko.com/images/bak/button_all_accessories_whit.png
   trunk/www.openmoko.com/images/bak/button_buy_it_now.png
   trunk/www.openmoko.com/images/bak/button_by_it_now.png
   trunk/www.openmoko.com/images/bak/button_enlarge.png
   trunk/www.openmoko.com/images/bak/button_go.png
   trunk/www.openmoko.com/images/bak/button_go_homepage.png
   trunk/www.openmoko.com/images/bak/button_more_details.png
   trunk/www.openmoko.com/images/bak/button_more_details_gray.png
   trunk/www.openmoko.com/images/bak/button_news_archive.png
   trunk/www.openmoko.com/images/bak/button_read_more.png
   trunk/www.openmoko.com/images/bak/button_read_more_gray.png
   trunk/www.openmoko.com/images/bak/button_select.png
   trunk/www.openmoko.com/images/bak/favicon.ico
   trunk/www.openmoko.com/images/bak/home_background.png
   trunk/www.openmoko.com/images/bak/home_banner.jpg
   trunk/www.openmoko.com/images/bak/home_quote.png
   trunk/www.openmoko.com/images/bak/icon_rss.png
   trunk/www.openmoko.com/images/bak/icons/
   trunk/www.openmoko.com/images/bak/icons/icon_decrease_font.png
   trunk/www.openmoko.com/images/bak/icons/icon_first.png
   trunk/www.openmoko.com/images/bak/icons/icon_last.png
   trunk/www.openmoko.com/images/bak/icons/icon_next.png
   trunk/www.openmoko.com/images/bak/icons/icon_previous.png
   trunk/www.openmoko.com/images/bak/label/
   trunk/www.openmoko.com/images/bak/label/neo1973_title.png
   trunk/www.openmoko.com/images/bak/label/search_openmoko.png
   trunk/www.openmoko.com/images/bak/label/search_openmoko_gray.png
   trunk/www.openmoko.com/images/bak/link_bullet.png
   trunk/www.openmoko.com/images/bak/list_bullet.png
   trunk/www.openmoko.com/images/bak/middleblock_left.png
   trunk/www.openmoko.com/images/bak/middleblock_right.png
   trunk/www.openmoko.com/images/bak/middleblock_tabs_left.png
   trunk/www.openmoko.com/images/bak/middleblock_tabs_right.png
   trunk/www.openmoko.com/images/bak/middleblock_tile.png
   trunk/www.openmoko.com/images/bak/navigation/
   trunk/www.openmoko.com/images/bak/navigation/about.png
   trunk/www.openmoko.com/images/bak/navigation/accessories/
   trunk/www.openmoko.com/images/bak/navigation/accessories/about.png
   trunk/www.openmoko.com/images/bak/navigation/accessories/careers.png
   trunk/www.openmoko.com/images/bak/navigation/accessories/contact.png
   trunk/www.openmoko.com/images/bak/navigation/accessories/developers.png
   trunk/www.openmoko.com/images/bak/navigation/accessories/home.png
   trunk/www.openmoko.com/images/bak/navigation/accessories/press.png
   trunk/www.openmoko.com/images/bak/navigation/accessories/products.png
   trunk/www.openmoko.com/images/bak/navigation/accessories/shop.png
   trunk/www.openmoko.com/images/bak/navigation/careers.png
   trunk/www.openmoko.com/images/bak/navigation/contact.png
   trunk/www.openmoko.com/images/bak/navigation/default/
   trunk/www.openmoko.com/images/bak/navigation/default/about.png
   trunk/www.openmoko.com/images/bak/navigation/default/careers.png
   trunk/www.openmoko.com/images/bak/navigation/default/contact.png
   trunk/www.openmoko.com/images/bak/navigation/default/developers.png
   trunk/www.openmoko.com/images/bak/navigation/default/home.png
   trunk/www.openmoko.com/images/bak/navigation/default/press.png
   trunk/www.openmoko.com/images/bak/navigation/default/products.png
   trunk/www.openmoko.com/images/bak/navigation/default/shop.png
   trunk/www.openmoko.com/images/bak/navigation/developers.png
   trunk/www.openmoko.com/images/bak/navigation/home.png
   trunk/www.openmoko.com/images/bak/navigation/phone/
   trunk/www.openmoko.com/images/bak/navigation/phone/about.png
   trunk/www.openmoko.com/images/bak/navigation/phone/careers.png
   trunk/www.openmoko.com/images/bak/navigation/phone/contact.png
   trunk/www.openmoko.com/images/bak/navigation/phone/developers.png
   trunk/www.openmoko.com/images/bak/navigation/phone/home.png
   trunk/www.openmoko.com/images/bak/navigation/phone/press.png
   trunk/www.openmoko.com/images/bak/navigation/phone/products.png
   trunk/www.openmoko.com/images/bak/navigation/phone/shop.png
   trunk/www.openmoko.com/images/bak/navigation/press.png
   trunk/www.openmoko.com/images/bak/navigation/products.png
   trunk/www.openmoko.com/images/bak/navigation/products/
   trunk/www.openmoko.com/images/bak/navigation/products/about.png
   trunk/www.openmoko.com/images/bak/navigation/products/careers.png
   trunk/www.openmoko.com/images/bak/navigation/products/contact.png
   trunk/www.openmoko.com/images/bak/navigation/products/developers.png
   trunk/www.openmoko.com/images/bak/navigation/products/home.png
   trunk/www.openmoko.com/images/bak/navigation/products/press.png
   trunk/www.openmoko.com/images/bak/navigation/products/products.png
   trunk/www.openmoko.com/images/bak/navigation/products/shop.png
   trunk/www.openmoko.com/images/bak/navigation/semi/
   trunk/www.openmoko.com/images/bak/navigation/semi/about.png
   trunk/www.openmoko.com/images/bak/navigation/semi/careers.png
   trunk/www.openmoko.com/images/bak/navigation/semi/contact.png
   trunk/www.openmoko.com/images/bak/navigation/semi/developers.png
   trunk/www.openmoko.com/images/bak/navigation/semi/home.png
   trunk/www.openmoko.com/images/bak/navigation/semi/press.png
   trunk/www.openmoko.com/images/bak/navigation/semi/products.png
   trunk/www.openmoko.com/images/bak/navigation/semi/shop.png
   trunk/www.openmoko.com/images/bak/navigation/shop.png
   trunk/www.openmoko.com/images/bak/navigation_accessories.jpg
   trunk/www.openmoko.com/images/bak/navigation_background.png
   trunk/www.openmoko.com/images/bak/navigation_default.jpg
   trunk/www.openmoko.com/images/bak/navigation_home.png
   trunk/www.openmoko.com/images/bak/navigation_neo.png
   trunk/www.openmoko.com/images/bak/navigation_products.jpg
   trunk/www.openmoko.com/images/bak/openmoko_logo.png
   trunk/www.openmoko.com/images/bak/openmoko_logo_2.png
   trunk/www.openmoko.com/images/bak/orange_bullet.png
   trunk/www.openmoko.com/images/bak/phone_toptab_left.png
   trunk/www.openmoko.com/images/bak/phone_toptab_right.png
   trunk/www.openmoko.com/images/bak/product_bottom_shadow.png
   trunk/www.openmoko.com/images/bak/product_bottom_shadow_small.png
   trunk/www.openmoko.com/images/bak/products/
   trunk/www.openmoko.com/images/bak/products/accessories/
   trunk/www.openmoko.com/images/bak/products/accessories/a/
   trunk/www.openmoko.com/images/bak/products/accessories/a/14aaa.png
   trunk/www.openmoko.com/images/bak/products/accessories/a/5f234.png
   trunk/www.openmoko.com/images/bak/products/accessories/a/7aaa.png
   trunk/www.openmoko.com/images/bak/products/accessories/a/dasd.png
   trunk/www.openmoko.com/images/bak/products/accessories/car_kit.png
   trunk/www.openmoko.com/images/bak/products/accessories/carrying_case.png
   trunk/www.openmoko.com/images/bak/products/accessories/carrying_tape.png
   trunk/www.openmoko.com/images/bak/products/accessories/hackers_lunch_box.png
   trunk/www.openmoko.com/images/bak/products/accessories/stylus.png
   trunk/www.openmoko.com/images/bak/products/banner_neo.png
   trunk/www.openmoko.com/images/bak/products/banner_neo2.png
   trunk/www.openmoko.com/images/bak/products/banner_neo2_thumb.png
   trunk/www.openmoko.com/images/bak/products/banner_neo_thumb.png
   trunk/www.openmoko.com/images/bak/products/featured.png
   trunk/www.openmoko.com/images/bak/products/hackers.png
   trunk/www.openmoko.com/images/bak/products/hackers_small.png
   trunk/www.openmoko.com/images/bak/products_page.jpg
   trunk/www.openmoko.com/images/bak/sidebox_bottom.png
   trunk/www.openmoko.com/images/bak/sidebox_tile.png
   trunk/www.openmoko.com/images/bak/sidebox_top.png
   trunk/www.openmoko.com/images/bak/titlebar_accessories.jpg
   trunk/www.openmoko.com/images/bak/titlebar_products.jpg
   trunk/www.openmoko.com/images/bak/top_link.png
   trunk/www.openmoko.com/images/bak/toptab_left.png
   trunk/www.openmoko.com/images/bak/toptab_right.png
   trunk/www.openmoko.com/images/banner_about.jpg
   trunk/www.openmoko.com/images/banner_accessories.jpg
   trunk/www.openmoko.com/images/banner_careers.jpg
   trunk/www.openmoko.com/images/banner_contact.jpg
   trunk/www.openmoko.com/images/banner_details.png
   trunk/www.openmoko.com/images/banner_developers.jpg
   trunk/www.openmoko.com/images/banner_featured_accessory.jpg
   trunk/www.openmoko.com/images/banner_featured_accessory.png
   trunk/www.openmoko.com/images/banner_press.jpg
   trunk/www.openmoko.com/images/banner_products.jpg
   trunk/www.openmoko.com/images/banner_search.jpg
   trunk/www.openmoko.com/images/blank.gif
   trunk/www.openmoko.com/images/bullet_back_to_accessories.png
   trunk/www.openmoko.com/images/button_add_to_cart.png
   trunk/www.openmoko.com/images/button_add_to_cart_gray.png
   trunk/www.openmoko.com/images/button_add_to_cart_white.png
   trunk/www.openmoko.com/images/button_all_accessories.png
   trunk/www.openmoko.com/images/button_all_accessories_whit.png
   trunk/www.openmoko.com/images/button_buy_it_now.png
   trunk/www.openmoko.com/images/button_by_it_now.png
   trunk/www.openmoko.com/images/button_enlarge.png
   trunk/www.openmoko.com/images/button_go.png
   trunk/www.openmoko.com/images/button_go_homepage.png
   trunk/www.openmoko.com/images/button_more_details.png
   trunk/www.openmoko.com/images/button_more_details_gray.png
   trunk/www.openmoko.com/images/button_news_archive.png
   trunk/www.openmoko.com/images/button_read_more.png
   trunk/www.openmoko.com/images/button_read_more_gray.png
   trunk/www.openmoko.com/images/button_select.png
   trunk/www.openmoko.com/images/contact_map.png
   trunk/www.openmoko.com/images/favicon.ico
   trunk/www.openmoko.com/images/home_background.png
   trunk/www.openmoko.com/images/home_banner.jpg
   trunk/www.openmoko.com/images/home_quote.png
   trunk/www.openmoko.com/images/icon_rss.png
   trunk/www.openmoko.com/images/icons/
   trunk/www.openmoko.com/images/icons/icon_decrease_font.png
   trunk/www.openmoko.com/images/icons/icon_first.png
   trunk/www.openmoko.com/images/icons/icon_last.png
   trunk/www.openmoko.com/images/icons/icon_next.png
   trunk/www.openmoko.com/images/icons/icon_previous.png
   trunk/www.openmoko.com/images/label/
   trunk/www.openmoko.com/images/label/neo1973_title.png
   trunk/www.openmoko.com/images/label/search_openmoko.png
   trunk/www.openmoko.com/images/label/search_openmoko_gray.png
   trunk/www.openmoko.com/images/link_bullet.png
   trunk/www.openmoko.com/images/list_bullet.png
   trunk/www.openmoko.com/images/middleblock_left.png
   trunk/www.openmoko.com/images/middleblock_right.png
   trunk/www.openmoko.com/images/middleblock_tabs_left.png
   trunk/www.openmoko.com/images/middleblock_tabs_right.png
   trunk/www.openmoko.com/images/middleblock_tile.jpg
   trunk/www.openmoko.com/images/middleblock_tile.png
   trunk/www.openmoko.com/images/navigation/
   trunk/www.openmoko.com/images/navigation/about.png
   trunk/www.openmoko.com/images/navigation/accessories/
   trunk/www.openmoko.com/images/navigation/accessories/about.png
   trunk/www.openmoko.com/images/navigation/accessories/careers.png
   trunk/www.openmoko.com/images/navigation/accessories/contact.png
   trunk/www.openmoko.com/images/navigation/accessories/developers.png
   trunk/www.openmoko.com/images/navigation/accessories/home.png
   trunk/www.openmoko.com/images/navigation/accessories/press.png
   trunk/www.openmoko.com/images/navigation/accessories/products.png
   trunk/www.openmoko.com/images/navigation/accessories/shop.png
   trunk/www.openmoko.com/images/navigation/careers.png
   trunk/www.openmoko.com/images/navigation/contact.png
   trunk/www.openmoko.com/images/navigation/default/
   trunk/www.openmoko.com/images/navigation/default/about.png
   trunk/www.openmoko.com/images/navigation/default/careers.png
   trunk/www.openmoko.com/images/navigation/default/contact.png
   trunk/www.openmoko.com/images/navigation/default/developers.png
   trunk/www.openmoko.com/images/navigation/default/home.png
   trunk/www.openmoko.com/images/navigation/default/press.png
   trunk/www.openmoko.com/images/navigation/default/products.png
   trunk/www.openmoko.com/images/navigation/default/shop.png
   trunk/www.openmoko.com/images/navigation/developers.png
   trunk/www.openmoko.com/images/navigation/home.png
   trunk/www.openmoko.com/images/navigation/phone/
   trunk/www.openmoko.com/images/navigation/phone/about.png
   trunk/www.openmoko.com/images/navigation/phone/careers.png
   trunk/www.openmoko.com/images/navigation/phone/contact.png
   trunk/www.openmoko.com/images/navigation/phone/developers.png
   trunk/www.openmoko.com/images/navigation/phone/home.png
   trunk/www.openmoko.com/images/navigation/phone/press.png
   trunk/www.openmoko.com/images/navigation/phone/products.png
   trunk/www.openmoko.com/images/navigation/phone/shop.png
   trunk/www.openmoko.com/images/navigation/press.png
   trunk/www.openmoko.com/images/navigation/products.png
   trunk/www.openmoko.com/images/navigation/products/
   trunk/www.openmoko.com/images/navigation/products/about.png
   trunk/www.openmoko.com/images/navigation/products/careers.png
   trunk/www.openmoko.com/images/navigation/products/contact.png
   trunk/www.openmoko.com/images/navigation/products/developers.png
   trunk/www.openmoko.com/images/navigation/products/home.png
   trunk/www.openmoko.com/images/navigation/products/press.png
   trunk/www.openmoko.com/images/navigation/products/products.png
   trunk/www.openmoko.com/images/navigation/products/shop.png
   trunk/www.openmoko.com/images/navigation/semi/
   trunk/www.openmoko.com/images/navigation/semi/about.png
   trunk/www.openmoko.com/images/navigation/semi/careers.png
   trunk/www.openmoko.com/images/navigation/semi/contact.png
   trunk/www.openmoko.com/images/navigation/semi/developers.png
   trunk/www.openmoko.com/images/navigation/semi/home.png
   trunk/www.openmoko.com/images/navigation/semi/press.png
   trunk/www.openmoko.com/images/navigation/semi/products.png
   trunk/www.openmoko.com/images/navigation/semi/shop.png
   trunk/www.openmoko.com/images/navigation/shop.png
   trunk/www.openmoko.com/images/navigation_accessories.jpg
   trunk/www.openmoko.com/images/navigation_background.png
   trunk/www.openmoko.com/images/navigation_default.jpg
   trunk/www.openmoko.com/images/navigation_home.png
   trunk/www.openmoko.com/images/navigation_neo.png
   trunk/www.openmoko.com/images/navigation_products.jpg
   trunk/www.openmoko.com/images/openmoko_logo.png
   trunk/www.openmoko.com/images/openmoko_logo_2.png
   trunk/www.openmoko.com/images/orange_bullet.png
   trunk/www.openmoko.com/images/phone_toptab_left.png
   trunk/www.openmoko.com/images/phone_toptab_right.png
   trunk/www.openmoko.com/images/product_bottom_shadow.png
   trunk/www.openmoko.com/images/product_bottom_shadow_small.png
   trunk/www.openmoko.com/images/products/
   trunk/www.openmoko.com/images/products/accessories/
   trunk/www.openmoko.com/images/products/accessories/a/
   trunk/www.openmoko.com/images/products/accessories/a/14aaa.png
   trunk/www.openmoko.com/images/products/accessories/a/5f234.png
   trunk/www.openmoko.com/images/products/accessories/a/7aaa.png
   trunk/www.openmoko.com/images/products/accessories/a/dasd.png
   trunk/www.openmoko.com/images/products/accessories/car_kit.png
   trunk/www.openmoko.com/images/products/accessories/carrying_case.png
   trunk/www.openmoko.com/images/products/accessories/carrying_tape.png
   trunk/www.openmoko.com/images/products/accessories/hackers_lunch_box.png
   trunk/www.openmoko.com/images/products/accessories/stylus.png
   trunk/www.openmoko.com/images/products/banner_neo.png
   trunk/www.openmoko.com/images/products/banner_neo2.png
   trunk/www.openmoko.com/images/products/banner_neo2_thumb.png
   trunk/www.openmoko.com/images/products/banner_neo_thumb.png
   trunk/www.openmoko.com/images/products/featured.png
   trunk/www.openmoko.com/images/products/hackers.png
   trunk/www.openmoko.com/images/products/hackers_small.png
   trunk/www.openmoko.com/images/products_page.jpg
   trunk/www.openmoko.com/images/sidebox_bottom.png
   trunk/www.openmoko.com/images/sidebox_tile.png
   trunk/www.openmoko.com/images/sidebox_top.png
   trunk/www.openmoko.com/images/thumb_background.png
   trunk/www.openmoko.com/images/titlebar_accessories.jpg
   trunk/www.openmoko.com/images/titlebar_products.jpg
   trunk/www.openmoko.com/images/top_link.png
   trunk/www.openmoko.com/images/toptab_left.png
   trunk/www.openmoko.com/images/toptab_right.png
   trunk/www.openmoko.com/images/turn_left.png
   trunk/www.openmoko.com/images/turn_right.png
   trunk/www.openmoko.com/inc/
   trunk/www.openmoko.com/inc/about.html
   trunk/www.openmoko.com/inc/accessory.html
   trunk/www.openmoko.com/inc/accessory_alternative.html
   trunk/www.openmoko.com/inc/accessory_simple.html
   trunk/www.openmoko.com/inc/careers.html
   trunk/www.openmoko.com/inc/contact.html
   trunk/www.openmoko.com/inc/default.html
   trunk/www.openmoko.com/inc/developers.html
   trunk/www.openmoko.com/inc/old_prod.html
   trunk/www.openmoko.com/inc/press.html
   trunk/www.openmoko.com/inc/product_accessories.html
   trunk/www.openmoko.com/inc/product_hackers-lunch-box.html
   trunk/www.openmoko.com/inc/product_neo1973.html
   trunk/www.openmoko.com/inc/product_neo1973.html.bak
   trunk/www.openmoko.com/inc/products.html
   trunk/www.openmoko.com/inc/ptemplate-screenshots.html
   trunk/www.openmoko.com/inc/ptemplate-standard_kit.html
   trunk/www.openmoko.com/inc/search.html
   trunk/www.openmoko.com/index.php
   trunk/www.openmoko.com/js/
   trunk/www.openmoko.com/js/IEFixes.js
   trunk/www.openmoko.com/js/screenshots.js
   trunk/www.openmoko.com/js/tabs.js
   trunk/www.openmoko.com/print.css
   trunk/www.openmoko.com/style.css
   trunk/www.openmoko.com/textpattern/
   trunk/www.openmoko.com/textpattern/checksums.txt
   trunk/www.openmoko.com/textpattern/checksums.txt_orig
   trunk/www.openmoko.com/textpattern/config.php
   trunk/www.openmoko.com/textpattern/css.php
   trunk/www.openmoko.com/textpattern/include/
   trunk/www.openmoko.com/textpattern/include/import/
   trunk/www.openmoko.com/textpattern/include/import/BloggerImportTemplate.txt
   trunk/www.openmoko.com/textpattern/include/import/import_b2.php
   trunk/www.openmoko.com/textpattern/include/import/import_blogger.php
   trunk/www.openmoko.com/textpattern/include/import/import_mt.php
   trunk/www.openmoko.com/textpattern/include/import/import_mtdb.php
   trunk/www.openmoko.com/textpattern/include/import/import_wp.php
   trunk/www.openmoko.com/textpattern/include/txp_admin.php
   trunk/www.openmoko.com/textpattern/include/txp_article.php
   trunk/www.openmoko.com/textpattern/include/txp_article.php.bak
   trunk/www.openmoko.com/textpattern/include/txp_auth.php
   trunk/www.openmoko.com/textpattern/include/txp_category.php
   trunk/www.openmoko.com/textpattern/include/txp_css.php
   trunk/www.openmoko.com/textpattern/include/txp_diag.php
   trunk/www.openmoko.com/textpattern/include/txp_discuss.php
   trunk/www.openmoko.com/textpattern/include/txp_file.php
   trunk/www.openmoko.com/textpattern/include/txp_form.php
   trunk/www.openmoko.com/textpattern/include/txp_image.php
   trunk/www.openmoko.com/textpattern/include/txp_import.php
   trunk/www.openmoko.com/textpattern/include/txp_link.php
   trunk/www.openmoko.com/textpattern/include/txp_list.php
   trunk/www.openmoko.com/textpattern/include/txp_log.php
   trunk/www.openmoko.com/textpattern/include/txp_page.php
   trunk/www.openmoko.com/textpattern/include/txp_plugin.php
   trunk/www.openmoko.com/textpattern/include/txp_prefs.php
   trunk/www.openmoko.com/textpattern/include/txp_preview.php
   trunk/www.openmoko.com/textpattern/include/txp_section.php
   trunk/www.openmoko.com/textpattern/include/txp_tag.php
   trunk/www.openmoko.com/textpattern/index.php
   trunk/www.openmoko.com/textpattern/lang/
   trunk/www.openmoko.com/textpattern/lang/README
   trunk/www.openmoko.com/textpattern/lang/en-gb.txt
   trunk/www.openmoko.com/textpattern/lib/
   trunk/www.openmoko.com/textpattern/lib/IXRClass.php
   trunk/www.openmoko.com/textpattern/lib/admin_config.php
   trunk/www.openmoko.com/textpattern/lib/class.thumb.php
   trunk/www.openmoko.com/textpattern/lib/classTextile.php
   trunk/www.openmoko.com/textpattern/lib/constants.php
   trunk/www.openmoko.com/textpattern/lib/i18n-ascii.txt
   trunk/www.openmoko.com/textpattern/lib/taglib.php
   trunk/www.openmoko.com/textpattern/lib/txplib_db.php
   trunk/www.openmoko.com/textpattern/lib/txplib_forms.php
   trunk/www.openmoko.com/textpattern/lib/txplib_head.php
   trunk/www.openmoko.com/textpattern/lib/txplib_html.php
   trunk/www.openmoko.com/textpattern/lib/txplib_misc.php
   trunk/www.openmoko.com/textpattern/lib/txplib_update.php
   trunk/www.openmoko.com/textpattern/lib/txplib_wrapper.php
   trunk/www.openmoko.com/textpattern/license.txt
   trunk/www.openmoko.com/textpattern/publish.php
   trunk/www.openmoko.com/textpattern/publish/
   trunk/www.openmoko.com/textpattern/publish/atom.php
   trunk/www.openmoko.com/textpattern/publish/comment.php
   trunk/www.openmoko.com/textpattern/publish/log.php
   trunk/www.openmoko.com/textpattern/publish/rss.php
   trunk/www.openmoko.com/textpattern/publish/search.php
   trunk/www.openmoko.com/textpattern/publish/taghandlers.php
   trunk/www.openmoko.com/textpattern/textpattern.css
   trunk/www.openmoko.com/textpattern/textpattern.js
   trunk/www.openmoko.com/textpattern/tmp/
   trunk/www.openmoko.com/textpattern/txp_img/
   trunk/www.openmoko.com/textpattern/txp_img/carver.gif
   trunk/www.openmoko.com/textpattern/txp_img/down.gif
   trunk/www.openmoko.com/textpattern/txp_img/down2.gif
   trunk/www.openmoko.com/textpattern/txp_img/htmldown.gif
   trunk/www.openmoko.com/textpattern/txp_img/htmlup.gif
   trunk/www.openmoko.com/textpattern/txp_img/previewdown.gif
   trunk/www.openmoko.com/textpattern/txp_img/previewup.gif
   trunk/www.openmoko.com/textpattern/txp_img/tabs.gif
   trunk/www.openmoko.com/textpattern/txp_img/tabshadow.gif
   trunk/www.openmoko.com/textpattern/txp_img/textdown.gif
   trunk/www.openmoko.com/textpattern/txp_img/textpattern.gif
   trunk/www.openmoko.com/textpattern/txp_img/texttabshadow.gif
   trunk/www.openmoko.com/textpattern/txp_img/textup.gif
   trunk/www.openmoko.com/textpattern/txp_img/txp_slug105x45.gif
   trunk/www.openmoko.com/textpattern/txp_img/txp_slug105x70.gif
   trunk/www.openmoko.com/textpattern/txp_img/up.gif
   trunk/www.openmoko.com/textpattern/txp_img/up2.gif
   trunk/www.openmoko.com/textpattern/update/
   trunk/www.openmoko.com/textpattern/update/_to_1.0.0.php
   trunk/www.openmoko.com/textpattern/update/_to_4.0.2.php
   trunk/www.openmoko.com/textpattern/update/_to_4.0.3.php
   trunk/www.openmoko.com/textpattern/update/_to_4.0.4.php
   trunk/www.openmoko.com/textpattern/update/_update.php
   trunk/www.openmoko.com/textpattern/update/index.html
   trunk/www.openmoko.com/textsize.php
   trunk/www.openmoko.com/uploaded_images/
   trunk/www.openmoko.com/uploaded_images/10.png
   trunk/www.openmoko.com/uploaded_images/10t.png
   trunk/www.openmoko.com/uploaded_images/11.png
   trunk/www.openmoko.com/uploaded_images/11t.png
   trunk/www.openmoko.com/uploaded_images/12.png
   trunk/www.openmoko.com/uploaded_images/12t.png
   trunk/www.openmoko.com/uploaded_images/13.png
   trunk/www.openmoko.com/uploaded_images/13t.png
   trunk/www.openmoko.com/uploaded_images/14.png
   trunk/www.openmoko.com/uploaded_images/14t.png
   trunk/www.openmoko.com/uploaded_images/15.png
   trunk/www.openmoko.com/uploaded_images/15t.png
   trunk/www.openmoko.com/uploaded_images/16.png
   trunk/www.openmoko.com/uploaded_images/16t.png
   trunk/www.openmoko.com/uploaded_images/17.png
   trunk/www.openmoko.com/uploaded_images/17t.png
   trunk/www.openmoko.com/uploaded_images/18.png
   trunk/www.openmoko.com/uploaded_images/18t.png
   trunk/www.openmoko.com/uploaded_images/19.png
   trunk/www.openmoko.com/uploaded_images/19t.png
   trunk/www.openmoko.com/uploaded_images/20.png
   trunk/www.openmoko.com/uploaded_images/20t.png
   trunk/www.openmoko.com/uploaded_images/21.png
   trunk/www.openmoko.com/uploaded_images/21t.png
   trunk/www.openmoko.com/uploaded_images/22.png
   trunk/www.openmoko.com/uploaded_images/22t.png
   trunk/www.openmoko.com/uploaded_images/23.png
   trunk/www.openmoko.com/uploaded_images/23t.png
   trunk/www.openmoko.com/uploaded_images/24.png
   trunk/www.openmoko.com/uploaded_images/24t.png
   trunk/www.openmoko.com/uploaded_images/25.png
   trunk/www.openmoko.com/uploaded_images/25t.png
   trunk/www.openmoko.com/uploaded_images/26.png
   trunk/www.openmoko.com/uploaded_images/26t.png
   trunk/www.openmoko.com/uploaded_images/27.png
   trunk/www.openmoko.com/uploaded_images/27t.png
   trunk/www.openmoko.com/uploaded_images/28.png
   trunk/www.openmoko.com/uploaded_images/28t.png
   trunk/www.openmoko.com/uploaded_images/29.png
   trunk/www.openmoko.com/uploaded_images/29t.png
   trunk/www.openmoko.com/uploaded_images/3.png
   trunk/www.openmoko.com/uploaded_images/3t.png
   trunk/www.openmoko.com/uploaded_images/4.png
   trunk/www.openmoko.com/uploaded_images/4t.png
   trunk/www.openmoko.com/uploaded_images/5.png
   trunk/www.openmoko.com/uploaded_images/5t.png
   trunk/www.openmoko.com/uploaded_images/6.png
   trunk/www.openmoko.com/uploaded_images/6t.png
   trunk/www.openmoko.com/uploaded_images/7.png
   trunk/www.openmoko.com/uploaded_images/7t.png
   trunk/www.openmoko.com/uploaded_images/8.png
   trunk/www.openmoko.com/uploaded_images/8t.png
   trunk/www.openmoko.com/uploaded_images/9.png
   trunk/www.openmoko.com/uploaded_images/9t.png
Log:
check in after first cleanup (passwds, hardcoded configs, etc)


Added: trunk/direct.openmoko.com/Order_Info.php
===================================================================
--- trunk/direct.openmoko.com/Order_Info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/Order_Info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: Order_Info.php,v 0.52 2002/09/21 hpdl Exp $
+        by Cheng
+        OSCommerce v2.2 CVS (09/17/02)
+   Modified versions of create_account.php and related
+  files.  Allowing 'purchase without account'.
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+  Released under the GNU General Public License
+*/
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);
+  $breadcrumb->add(NAV_ORDER_INFO, tep_href_link('Order_Info.php', '', 'SSL'));
+$content = CONTENT_ORDER_INFO;
+$javascript = 'form_check.js.php';
+require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/Order_Info_Process.php
===================================================================
--- trunk/direct.openmoko.com/Order_Info_Process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/Order_Info_Process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,364 @@
+<?php
+/*
+  $Id: Order_Info_Process.php,v 0.56 2003/03/08 hpdl Exp $
+  by Richy C.
+
+        OSCommerce v2.2MS1
+
+   Modified versions of create_account.php and related
+  files.  Allowing 'purchase without account'.
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);
+
+  if (!@$HTTP_POST_VARS['action']) {
+    tep_redirect(tep_href_link(FILENAME_ORDER_INFO, '', 'NONSSL'));
+  }
+
+  $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
+  $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
+  $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
+  if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
+  $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
+  $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
+  $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
+  $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
+//  $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
+        $password = tep_db_prepare_input('');
+  $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);
+  $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
+  if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
+  if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
+  $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
+  $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
+  $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+  $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+  $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+
+  $error = false; // reset error flag
+
+  if (ACCOUNT_GENDER == 'true') {
+    if (($gender == 'm') || ($gender == 'f')) {
+      $entry_gender_error = false;
+    } else {
+      $error = true;
+      $entry_gender_error = true;
+    }
+  }
+
+  if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+    $error = true;
+    $entry_firstname_error = true;
+  } else {
+    $entry_firstname_error = false;
+  }
+
+  if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+    $error = true;
+    $entry_lastname_error = true;
+  } else {
+    $entry_lastname_error = false;
+  }
+
+  if (ACCOUNT_DOB == 'true') {
+    if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4))) {
+      $entry_date_of_birth_error = false;
+    } else {
+      $error = true;
+      $entry_date_of_birth_error = true;
+    }
+  }
+
+  if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
+    $error = true;
+    $entry_email_address_error = true;
+  } else {
+    $entry_email_address_error = false;
+  }
+
+  if (!tep_validate_email($email_address)) {
+    $error = true;
+    $entry_email_address_check_error = true;
+  } else {
+    $entry_email_address_check_error = false;
+  }
+
+  if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
+    $error = true;
+    $entry_street_address_error = true;
+  } else {
+    $entry_street_address_error = false;
+  }
+
+  if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
+    $error = true;
+    $entry_post_code_error = true;
+  } else {
+    $entry_post_code_error = false;
+  }
+
+  if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
+    $error = true;
+    $entry_city_error = true;
+  } else {
+    $entry_city_error = false;
+  }
+
+  if (!$country) {
+    $error = true;
+    $entry_country_error = true;
+  } else {
+    $entry_country_error = false;
+  }
+
+  if (ACCOUNT_STATE == 'true') {
+    if ($entry_country_error) {
+      $entry_state_error = true;
+    } else {
+      $zone_id = 0;
+      $entry_state_error = false;
+      $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "'");
+      $check_value = tep_db_fetch_array($check_query);
+      $entry_state_has_zones = ($check_value['total'] > 0);
+      if ($entry_state_has_zones) {
+        $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' and zone_name = '" . tep_db_input($state) . "'");
+        if (tep_db_num_rows($zone_query) == 1) {
+          $zone_values = tep_db_fetch_array($zone_query);
+          $zone_id = $zone_values['zone_id'];
+        } else {
+          $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' and zone_code = '" . tep_db_input($state) . "'");
+          if (tep_db_num_rows($zone_query) == 1) {
+            $zone_values = tep_db_fetch_array($zone_query);
+            $zone_id = $zone_values['zone_id'];
+          } else {
+            $error = true;
+            $entry_state_error = true;
+          }
+        }
+      } else {
+        if (!$state) {
+          $error = true;
+          $entry_state_error = true;
+        }
+      }
+    }
+  }
+
+  if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
+    $error = true;
+    $entry_telephone_error = true;
+  } else {
+    $entry_telephone_error = false;
+  }
+
+  $entry_password_error = false;
+  $entry_email_address_exists = false;
+
+  if ($error == true) {
+    $processed = true;
+
+    $breadcrumb->add(NAV_ORDER_INFO, tep_href_link(FILENAME_ORDER_INFO, '', 'NONSSL'));
+// DDB - 040622 - no need    $breadcrumb->add(NAVBAR_TITLE_2);
+
+$content = CONTENT_ORDER_INFO_PROCESS;
+require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+require(DIR_WS_INCLUDES . 'application_bottom.php');
+
+
+?>
+
+<?php
+  } else {
+
+    // PWA 0.70 : SELECT using new method of determining a customer has purchased without account:
+    $check_customer_query = tep_db_query("select customers_id, purchased_without_account,
+      customers_firstname, customers_password, customers_email_address,
+      customers_default_address_id from " . TABLE_CUSTOMERS . "
+      where upper(customers_email_address) = '" . tep_db_prepare_input(strtoupper($HTTP_POST_VARS['email_address'])) . "' and
+        upper(customers_firstname) = '" . tep_db_prepare_input(strtoupper($HTTP_POST_VARS['firstname'])) . "' and
+        upper(customers_lastname) = '" . tep_db_prepare_input(strtoupper($HTTP_POST_VARS['lastname'])) . "'");
+
+// if password is EMPTY (null) and e-mail address is same then we just load up their account information.
+// could be security flaw -- might want to setup password = somestring and have it recheck here (during the first initial
+// creation
+
+      $check_customer = tep_db_fetch_array($check_customer_query);
+
+      if (tep_db_num_rows($check_customer_query)) {
+
+        // PWA 0.70 added this for backwards compatibility with older versions of PWA
+        // that made a blank password, causing logins to fail:
+        if(!$check_customer['purchased_without_account']) {
+          list($md5hash, $salt) = explode(':',$check_customer['customers_password']);
+          if(md5($salt) == $md5hash) {
+            // password was blank; customer purchased without account using a previous version of PWA code
+            $check_customer['purchased_without_account'] = 1;
+          }
+        }
+
+        if ($check_customer['purchased_without_account'] != 1) {
+          tep_redirect(tep_href_link(FILENAME_LOGIN,
+            'login=fail&reason=' . urlencode(
+              str_replace('{EMAIL_ADDRESS}',$check_customer['customers_email_address'],PWA_FAIL_ACCOUNT_EXISTS)), 'SSL'));
+
+        } else {
+          $customer_id = $check_customer['customers_id'];
+          // now get latest address book entry:
+          $get_default_address = tep_db_query("select address_book_id, entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . "
+                where customers_id = '" . (int)$customer_id . "' ORDER BY address_book_id DESC LIMIT 1");
+          $default_address = tep_db_fetch_array($get_default_address);
+          $customer_default_address_id = $default_address['address_book_id'];
+          $customer_first_name = $check_customer['customers_firstname'];
+          $customer_country_id = $default_address['entry_country_id'];
+          $customer_zone_id = $default_address['entry_zone_id'];
+          tep_session_register('customer_id');
+          tep_session_register('customer_default_address_id');
+          tep_session_register('customer_first_name');
+          tep_session_register('customer_country_id');
+          tep_session_register('customer_zone_id');
+          // PWA 0.71 update returning customer's address book:
+         $customer_update = array('customers_firstname' => $firstname,
+                             'customers_lastname' => $lastname,
+                             'customers_telephone' => $telephone,
+                             'customers_fax' => $fax);
+   if (ACCOUNT_GENDER == 'true') $customer_update['customers_gender'] = $gender;
+      tep_db_perform(TABLE_CUSTOMERS, $customer_update, 'update', "customers_id = '".$customer_id."'");
+
+   $address_book_update = array('customers_id' => $customer_id,
+         'entry_firstname' => $firstname,
+                 'entry_lastname' => $lastname,
+                 'entry_street_address' => $street_address,
+                 'entry_postcode' => $postcode,
+                 'entry_city' => $city,
+                 'entry_country_id' => $country);
+                   if (ACCOUNT_GENDER == 'true') $address_book_update['entry_gender'] = $gender;
+    if (ACCOUNT_COMPANY == 'true') $address_book_update['entry_company'] = $company;
+    if (ACCOUNT_SUBURB == 'true') $address_book_update['entry_suburb'] = $suburb;
+    if (ACCOUNT_STATE == 'true') {
+     if ($zone_id > 0) {
+      $address_book_update['entry_zone_id'] = $zone_id;
+      $address_book_update['entry_state'] = '';
+     } else {
+      $address_book_update['entry_zone_id'] = '0';
+      $address_book_update['entry_state'] = $state;
+     }
+    }
+         tep_db_perform(TABLE_ADDRESS_BOOK, $address_book_update, 'update', "address_book_id = '".$customer_default_address_id."'");
+   } // if-else $pass_ok
+
+          if ($HTTP_POST_VARS['setcookie'] == '1') {
+            setcookie('email_address', $HTTP_POST_VARS['email_address'], time()+2592000);
+            setcookie('password', $HTTP_POST_VARS['password'], time()+2592000);
+            setcookie('first_name', $customer_first_name, time()+2592000);
+          } elseif ( ($HTTP_COOKIE_VARS['email_address']) && ($HTTP_COOKIE_VARS['password']) ) {
+            setcookie('email_address', '');
+            setcookie('password', '');
+            setcookie('first_name', '');
+          } // if cookies
+
+          $date_now = date('Ymd');
+          tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(),
+        customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");
+
+        } else {
+        // if customer_exist = NO
+
+    // PWA 0.70 : new way of determining a customer purchased without an account : just say so!
+    $sql_data_array = array('purchased_without_account' => 1,
+                            'customers_firstname' => $firstname,
+                            'customers_lastname' => $lastname,
+                            'customers_email_address' => $email_address,
+                            'customers_telephone' => $telephone,
+                            'customers_fax' => $fax,
+                            'customers_newsletter' => $newsletter,
+                            'customers_password' => tep_encrypt_password($password));
+//                            'customers_default_address_id' => 1);
+
+    if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
+    if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
+
+    tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
+
+    $customer_id = tep_db_insert_id();
+
+    $sql_data_array = array('customers_id' => $customer_id,
+                            'address_book_id' => (int)$address_id,
+                            'entry_firstname' => $firstname,
+                            'entry_lastname' => $lastname,
+                            'entry_street_address' => $street_address,
+                            'entry_postcode' => $postcode,
+                            'entry_city' => $city,
+                            'entry_country_id' => $country);
+
+    if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
+    if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
+    if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
+    if (ACCOUNT_STATE == 'true') {
+      if ($zone_id > 0) {
+        $sql_data_array['entry_zone_id'] = $zone_id;
+        $sql_data_array['entry_state'] = '';
+      } else {
+        $sql_data_array['entry_zone_id'] = '0';
+        $sql_data_array['entry_state'] = $state;
+      }
+    }
+
+    tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
+
+      $address_id = tep_db_insert_id();
+
+      tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");
+
+      tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");
+
+    $customer_first_name = $firstname;
+    $customer_default_address_id = $address_id;
+    $customer_country_id = $country;
+    $customer_zone_id = $zone_id;
+    tep_session_register('customer_id');
+    tep_session_register('customer_first_name');
+    tep_session_register('customer_default_address_id');
+    tep_session_register('customer_country_id');
+    tep_session_register('customer_zone_id');
+
+  } // ELSE CUSTOMER=NO
+
+// restore cart contents
+    $cart->restore_contents();
+
+    // build the message content
+// DDB - 040622 - no mail will be sent
+//    $name = $firstname . " " . $lastname;
+//
+//    if (ACCOUNT_GENDER == 'true') {
+//       if ($HTTP_POST_VARS['gender'] == 'm') {
+//         $email_text = EMAIL_GREET_MR;
+//       } else {
+//         $email_text = EMAIL_GREET_MS;
+//       }
+//    } else {
+//      $email_text = EMAIL_GREET_NONE;
+//    }
+//
+//    $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
+//    tep_mail($name, $email_address, EMAIL_SUBJECT, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');
+
+//    tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
+
+  tep_session_register('noaccount');
+
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+  }
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/account.php
===================================================================
--- trunk/direct.openmoko.com/account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  Id: account.php,v 1.1.1.1 2004/03/04 23:37:52 ccwjr Exp 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Copyright &copy; 2003-2005 Chain Reaction Works, Inc.
+  
+  Last Modified by : $AUTHOR$
+  Latest Revision  : $REVISION$
+  Last Revision Date : $DATE$
+  License :  GNU General Public License 2.0
+  
+  http://creloaded.com
+  http://creforge.com
+  
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+
+  $content = CONTENT_ACCOUNT;
+  $javascript = $content . '.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+
+?>

Added: trunk/direct.openmoko.com/account_edit.php
===================================================================
--- trunk/direct.openmoko.com/account_edit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/account_edit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,139 @@
+<?php
+/*
+  $Id: account_edit.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Copyright &copy; 2003-2005 Chain Reaction Works, Inc.
+  
+  Last Modified by : $Author$
+  Latest Revision  : $Revision: 208 $
+  Last Revision Date : $Date$
+  License :  GNU General Public License 2.0
+  
+  http://creloaded.com
+  http://creforge.com
+  
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_EDIT);
+
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
+    if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
+    $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
+    $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
+    if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
+    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
+    $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
+    $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
+
+    $error = false;
+
+    if (ACCOUNT_GENDER == 'true') {
+      if ( ($gender != 'm') && ($gender != 'f') ) {
+        $error = true;
+
+        $messageStack->add('account_edit', ENTRY_GENDER_ERROR);
+      }
+    }
+
+    if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('account_edit', ENTRY_FIRST_NAME_ERROR);
+    }
+
+    if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('account_edit', ENTRY_LAST_NAME_ERROR);
+    }
+
+    if (ACCOUNT_DOB == 'true') {
+      if (!checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4))) {
+        $error = true;
+
+        $messageStack->add('account_edit', ENTRY_DATE_OF_BIRTH_ERROR);
+      }
+    }
+
+    if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR);
+    }
+
+    if (!tep_validate_email($email_address)) {
+      $error = true;
+
+      $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
+    }
+
+    $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and customers_id != '" . (int)$customer_id . "'");
+    $check_email = tep_db_fetch_array($check_email_query);
+    if ($check_email['total'] > 0) {
+      $error = true;
+
+      $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
+    }
+
+    if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('account_edit', ENTRY_TELEPHONE_NUMBER_ERROR);
+    }
+
+    if ($error == false) {
+      $sql_data_array = array('customers_firstname' => $firstname,
+                              'customers_lastname' => $lastname,
+                              'customers_email_address' => $email_address,
+                              'customers_telephone' => $telephone,
+                              'customers_fax' => $fax);
+
+      if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
+      if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
+
+      tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
+
+      tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'");
+
+      $sql_data_array = array('entry_firstname' => $firstname,
+                              'entry_lastname' => $lastname);
+
+      tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'");
+
+// reset the session variables
+      $customer_first_name = $firstname;
+
+      $messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success');
+
+      tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+    }
+  }
+
+  $account_query = tep_db_query("select customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+  $account = tep_db_fetch_array($account_query);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'));
+
+  $content = CONTENT_ACCOUNT_EDIT;
+  $javascript = 'form_check.js.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/account_history.php
===================================================================
--- trunk/direct.openmoko.com/account_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/account_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: account_history.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Copyright &copy; 2003-2005 Chain Reaction Works, Inc.
+  
+  Last Modified by : $Author$
+  Latest Revision  : $Revision: 208 $
+  Last Revision Date : $Date$
+  License :  GNU General Public License 2.0
+  
+  http://creloaded.com
+  http://creforge.com
+  
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
+
+  $content = CONTENT_ACCOUNT_HISTORY;
+  $javascript = 'popup_window.js';
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/account_history_info.php
===================================================================
--- trunk/direct.openmoko.com/account_history_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/account_history_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: account_history_info.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Copyright &copy; 2003-2005 Chain Reaction Works, Inc.
+  
+  Last Modified by : $Author$
+  Latest Revision  : $Revision: 208 $
+  Last Revision Date : $Date$
+  License :  GNU General Public License 2.0
+  
+  http://creloaded.com
+  http://creforge.com
+  
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  if (!isset($HTTP_GET_VARS['order_id']) || (isset($HTTP_GET_VARS['order_id']) && !is_numeric($HTTP_GET_VARS['order_id']))) {
+    tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
+  }
+  
+  $customer_info_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '". (int)$HTTP_GET_VARS['order_id'] . "'");
+  $customer_info = tep_db_fetch_array($customer_info_query);
+  if ($customer_info['customers_id'] != $customer_id) {
+    tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY_INFO);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
+  $breadcrumb->add(sprintf(NAVBAR_TITLE_3, $HTTP_GET_VARS['order_id']), tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . (int)$HTTP_GET_VARS['order_id'], 'SSL'));
+
+  require(DIR_WS_CLASSES . 'order.php');
+  $order = new order($HTTP_GET_VARS['order_id']);
+
+  $content = CONTENT_ACCOUNT_HISTORY_INFO;
+  //$javascript = 'popup_window.js';
+ $javascript = 'popup_window_print.js';
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/account_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/account_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/account_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: account_newsletters.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_NEWSLETTERS);
+
+  $newsletter_query = tep_db_query("select customers_newsletter from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+  $newsletter = tep_db_fetch_array($newsletter_query);
+
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
+    if (isset($HTTP_POST_VARS['newsletter_general']) && is_numeric($HTTP_POST_VARS['newsletter_general'])) {
+      $newsletter_general = tep_db_prepare_input($HTTP_POST_VARS['newsletter_general']);
+    } else {
+      $newsletter_general = '0';
+    }
+
+    if ($newsletter_general != $newsletter['customers_newsletter']) {
+      $newsletter_general = (($newsletter['customers_newsletter'] == '1') ? '0' : '1');
+
+      tep_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '" . (int)$newsletter_general . "' where customers_id = '" . (int)$customer_id . "'");
+    }
+
+    $messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success');
+
+    tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL'));
+
+  $content = CONTENT_ACCOUNT_NEWSLETTERS;
+  $javascript = $content . '.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/account_notifications.php
===================================================================
--- trunk/direct.openmoko.com/account_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/account_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+/*
+  $Id: account_notifications.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_NOTIFICATIONS);
+
+  $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'");
+  $global = tep_db_fetch_array($global_query);
+
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
+    if (isset($HTTP_POST_VARS['product_global']) && is_numeric($HTTP_POST_VARS['product_global'])) {
+      $product_global = tep_db_prepare_input($HTTP_POST_VARS['product_global']);
+    } else {
+      $product_global = '0';
+    }
+
+    (array)$products = $HTTP_POST_VARS['products'];
+
+    if ($product_global != $global['global_product_notifications']) {
+      $product_global = (($global['global_product_notifications'] == '1') ? '0' : '1');
+
+      tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set global_product_notifications = '" . (int)$product_global . "' where customers_info_id = '" . (int)$customer_id . "'");
+    } elseif (sizeof($products) > 0) {
+      $products_parsed = array();
+      for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+        if (is_numeric($products[$i])) {
+          $products_parsed[] = $products[$i];
+        }
+      }
+
+      if (sizeof($products_parsed) > 0) {
+        $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "' and products_id not in (" . implode(',', $products_parsed) . ")");
+        $check = tep_db_fetch_array($check_query);
+
+        if ($check['total'] > 0) {
+          tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "' and products_id not in (" . implode(',', $products_parsed) . ")");
+        }
+      }
+    } else {
+      $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      if ($check['total'] > 0) {
+        tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'");
+      }
+    }
+
+    $messageStack->add_session('account', SUCCESS_NOTIFICATIONS_UPDATED, 'success');
+
+    tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
+
+  $content = CONTENT_ACCOUNT_NOTIFICATIONS;
+  $javascript = $content . '.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/account_password.php
===================================================================
--- trunk/direct.openmoko.com/account_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/account_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: account_password.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_PASSWORD);
+
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
+    $password_current = tep_db_prepare_input($HTTP_POST_VARS['password_current']);
+    $password_new = tep_db_prepare_input($HTTP_POST_VARS['password_new']);
+    $password_confirmation = tep_db_prepare_input($HTTP_POST_VARS['password_confirmation']);
+
+    $error = false;
+
+    if (strlen($password_current) < ENTRY_PASSWORD_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('account_password', ENTRY_PASSWORD_CURRENT_ERROR);
+    } elseif (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
+    } elseif ($password_new != $password_confirmation) {
+      $error = true;
+
+      $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
+    }
+
+    if ($error == false) {
+      $check_customer_query = tep_db_query("select customers_password from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+      $check_customer = tep_db_fetch_array($check_customer_query);
+
+      if (tep_validate_password($password_current, $check_customer['customers_password'])) {
+        tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password_new) . "' where customers_id = '" . (int)$customer_id . "'");
+
+        tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'");
+
+        $messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
+
+        tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+      } else {
+        $error = true;
+
+        $messageStack->add('account_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
+      }
+    }
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL'));
+
+  $content = CONTENT_ACCOUNT_PASSWORD;
+  $javascript = 'form_check.js.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/add_checkout_success.php
===================================================================
--- trunk/direct.openmoko.com/add_checkout_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/add_checkout_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: add_checkout_success.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//ICW ADDED FOR ORDER_TOTAL CREDIT SYSTEM - Start Addition
+  $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".(int)$HTTP_GET_VARS['customer_id']."'");
+  if ($gv_result=tep_db_fetch_array($gv_query)) {
+    if ($gv_result['amount'] > 0) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="center" class="main"><?php echo GV_HAS_VOUCHERA; echo tep_href_link(FILENAME_GV_SEND); echo GV_HAS_VOUCHERB; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}}
+//ICW ADDED FOR ORDER_TOTAL CREDIT SYSTEM - End Addition
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/address_book.php
===================================================================
--- trunk/direct.openmoko.com/address_book.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/address_book.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: address_book.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
+
+  $content = CONTENT_ADDRESS_BOOK;
+  $javascript = $content . '.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/address_book_process.php
===================================================================
--- trunk/direct.openmoko.com/address_book_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/address_book_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,268 @@
+<?php
+/*
+  $Id: address_book_process.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK_PROCESS);
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'deleteconfirm') && isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) {
+    tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['delete'] . "' and customers_id = '" . (int)$customer_id . "'");
+
+    $messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_DELETED, 'success');
+
+    tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
+  }
+
+// error checking when updating or adding an entry
+  $process = false;
+  if (isset($HTTP_POST_VARS['action']) && (($HTTP_POST_VARS['action'] == 'process') || ($HTTP_POST_VARS['action'] == 'update'))) {
+    $process = true;
+    $error = false;
+
+    if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
+    if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
+    $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
+    $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
+    $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
+    if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
+    $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
+    $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
+    $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+    if (ACCOUNT_STATE == 'true') {
+      if (isset($HTTP_POST_VARS['zone_id'])) {
+        $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+      } else {
+        $zone_id = false;
+      }
+      $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+    }
+
+    if (ACCOUNT_GENDER == 'true') {
+      if ( ($gender != 'm') && ($gender != 'f') ) {
+        $error = true;
+
+        $messageStack->add('addressbook', ENTRY_GENDER_ERROR);
+      }
+    }
+
+    if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('addressbook', ENTRY_FIRST_NAME_ERROR);
+    }
+
+    if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('addressbook', ENTRY_LAST_NAME_ERROR);
+    }
+
+    if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('addressbook', ENTRY_STREET_ADDRESS_ERROR);
+    }
+
+    if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('addressbook', ENTRY_POST_CODE_ERROR);
+    }
+
+    if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('addressbook', ENTRY_CITY_ERROR);
+    }
+
+    if (!is_numeric($country)) {
+      $error = true;
+
+      $messageStack->add('addressbook', ENTRY_COUNTRY_ERROR);
+    }
+
+    if (ACCOUNT_STATE == 'true') {
+      $zone_id = 0;
+      $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
+      $check = tep_db_fetch_array($check_query);
+      $entry_state_has_zones = ($check['total'] > 0);
+      if ($entry_state_has_zones == true) {
+//State abbreviation bug fix applied DMG 10/1/2004
+//Allows abbreviation of states and does not complain about capitalization
+$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' OR zone_code = '" . tep_db_input($state) . "')");
+        if (tep_db_num_rows($zone_query) == 1) {
+          $zone = tep_db_fetch_array($zone_query);
+          $zone_id = $zone['zone_id'];
+        } else {
+          $error = true;
+
+          $messageStack->add('addressbook', ENTRY_STATE_ERROR_SELECT);
+        }
+      } else {
+        if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
+          $error = true;
+
+          $messageStack->add('addressbook', ENTRY_STATE_ERROR);
+        }
+      }
+    }
+
+    if ($error == false) {
+      $sql_data_array = array('entry_firstname' => $firstname,
+                              'entry_lastname' => $lastname,
+                              'entry_street_address' => $street_address,
+                              'entry_postcode' => $postcode,
+                              'entry_city' => $city,
+                              'entry_country_id' => (int)$country);
+
+      if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
+      if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
+// Eversun mod for sppc and qty price breaks
+      if (ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id)) {
+        $sql_data_array['entry_company_tax_id'] = tep_db_prepare_input($company_tax_id);
+      }
+// Eversun mod for sppc and qty price breaks
+      if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
+      if (ACCOUNT_STATE == 'true') {
+        if ($zone_id > 0) {
+          $sql_data_array['entry_zone_id'] = (int)$zone_id;
+          $sql_data_array['entry_state'] = '';
+        } else {
+          $sql_data_array['entry_zone_id'] = '0';
+          $sql_data_array['entry_state'] = $state;
+        }
+      }
+
+      if ($HTTP_POST_VARS['action'] == 'update') {
+        tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "' and customers_id ='" . (int)$customer_id . "'");
+// Eversun mod for sppc and qty price breaks
+      if (ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id)) {
+        $sql_data_array2['customers_group_ra'] = '1';
+      tep_db_perform(TABLE_CUSTOMERS, $sql_data_array2, 'update', "customers_id ='" . (int)$customer_id . "'");
+
+      // if you would *not* like to have an email when a tax id number has been entered in
+      // the appropriate field, comment out this section. The alert in admin is raised anyway
+
+      $alert_email_text = "Please note that " . $firstname . " " . $lastname . " of the company: " . $company . " has added a tax id number to his account information.";
+      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, 'Tax id number added', $alert_email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+      }
+//Eversun mod for sppc and qty price breaks
+
+// reregister session variables
+        if ( (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) || ($HTTP_GET_VARS['edit'] == $customer_default_address_id) ) {
+
+          $customer_first_name = $firstname;
+          $customer_country_id = $country_id;
+          $customer_zone_id = (($zone_id > 0) ? (int)$zone_id : '0');
+          $customer_default_address_id = (int)$HTTP_GET_VARS['edit'];
+
+          $sql_data_array = array('customers_firstname' => $firstname,
+                                  'customers_lastname' => $lastname,
+                                  'customers_default_address_id' => (int)$HTTP_GET_VARS['edit']);
+
+          if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
+
+          tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
+        }
+      } else {
+        $sql_data_array['customers_id'] = (int)$customer_id;
+        tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
+
+        $new_address_book_id = tep_db_insert_id();
+
+// reregister session variables
+        if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) {
+          $customer_first_name = $firstname;
+          $customer_country_id = $country_id;
+          $customer_zone_id = (($zone_id > 0) ? (int)$zone_id : '0');
+          if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) $customer_default_address_id = $new_address_book_id;
+
+          $sql_data_array = array('customers_firstname' => $firstname,
+                                  'customers_lastname' => $lastname);
+
+          if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
+          if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) $sql_data_array['customers_default_address_id'] = $new_address_book_id;
+
+          tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
+        }
+      }
+
+      $messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED, 'success');
+
+      tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
+    }
+  }
+
+  if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
+    
+// Eversun mod for sppc and qty price breaks
+//  $entry_query = tep_db_query("select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "'");
+    $entry_query = tep_db_query("select entry_gender, entry_company, entry_company_tax_id, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "'");
+// Eversun mod for sppc and qty price breaks
+    if (!tep_db_num_rows($entry_query)) {
+      $messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
+
+      tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
+    }
+
+    $entry = tep_db_fetch_array($entry_query);
+  } elseif (isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) {
+    if ($HTTP_GET_VARS['delete'] == $customer_default_address_id) {
+      $messageStack->add_session('addressbook', WARNING_PRIMARY_ADDRESS_DELETION, 'warning');
+
+      tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
+    } else {
+      $check_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['delete'] . "' and customers_id = '" . (int)$customer_id . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      if ($check['total'] < 1) {
+        $messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
+
+        tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
+      }
+    }
+  } else {
+    $entry = array();
+  }
+
+  if (!isset($HTTP_GET_VARS['delete']) && !isset($HTTP_GET_VARS['edit'])) {
+    if (tep_count_customer_address_book_entries() >= MAX_ADDRESS_BOOK_ENTRIES) {
+      $messageStack->add_session('addressbook', ERROR_ADDRESS_BOOK_FULL);
+
+      tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
+    }
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
+
+  if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
+    $breadcrumb->add(NAVBAR_TITLE_MODIFY_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $HTTP_GET_VARS['edit'], 'SSL'));
+  } elseif (isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) {
+    $breadcrumb->add(NAVBAR_TITLE_DELETE_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'], 'SSL'));
+  } else {
+    $breadcrumb->add(NAVBAR_TITLE_ADD_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'SSL'));
+  }
+
+  $content = CONTENT_ADDRESS_BOOK_PROCESS;
+  $javascript = $content . '.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/admin/abandoned_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/abandoned_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/abandoned_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1697 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  Written by Jonathan Hilgeman of SiteCreative.com (osc at sitecreative.com)
+  Version History
+ 
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_FUNCTIONS . 'c_orders.php');
+  require(DIR_WS_CLASSES . 'currencies.php');
+//    require('../' . DIR_WS_CLASSES . 'shopping_cart.php');
+  $currencies = new currencies();
+
+  include(DIR_WS_CLASSES . 'order.php');
+
+  // New "Status History" table has different format.
+  $OldNewStatusValues = (tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "old_value") && tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "new_value"));
+  $CommentsWithStatus = tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "comments");
+  $SeparateBillingFields = tep_field_exists(TABLE_ORDERS, "billing_name");
+
+  // Optional Tax Rate/Percent
+  $AddShippingTax = "0.0"; // e.g. shipping tax of 17.5% is "17.5"
+
+  $orders_statuses = array();
+  $orders_status_array = array();
+  $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
+  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+    $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
+                               'text' => $orders_status['orders_status_name']);
+    $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
+  }
+
+  $orders_ship_method = array();
+  $orders_ship_method_array = array();
+  $orders_ship_method_query = tep_db_query("select ship_method from orders_ship_methods where ship_method_language = '" . (int)$languages_id . "'");
+  while ($orders_ship_methods = tep_db_fetch_array($orders_ship_method_query)) {
+    $orders_ship_method[] = array('id'   => $orders_ship_methods['ship_method'],
+                                  'text' => $orders_ship_methods['ship_method']);
+    $orders_ship_method_array[$orders_ship_methods['ship_method']] = $orders_ship_methods['ship_method'];
+  }
+
+  $orders_pay_method = array();
+  $orders_pay_method_array = array();
+  $orders_pay_method_query = tep_db_query("select pay_method from orders_pay_methods where pay_method_language =  '" . (int)$languages_id . "'");
+  while ($orders_pay_methods = tep_db_fetch_array($orders_pay_method_query)) {
+    $orders_pay_method[] = array('id'   => $orders_pay_methods['pay_method'],
+                                  'text' => $orders_pay_methods['pay_method']);
+    $orders_pay_method_array[$orders_pay_methods['pay_method']] = $orders_pay_methods['pay_method'];
+  }
+
+  //$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : 'edit');
+//UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+$order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "'");
+//UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+
+  // Update Order
+  case 'update_order':
+
+    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+    $order = new order($oID);
+    $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
+    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
+
+    // Update Order Info
+    $UpdateOrders = "update " . TABLE_ORDERS . " set
+      customers_name = '" . tep_db_input(stripslashes($update_customer_name)) . "',
+      customers_company = '" . tep_db_input(stripslashes($update_customer_company)) . "',
+      customers_street_address = '" . tep_db_input(stripslashes($update_customer_street_address)) . "',
+      customers_suburb = '" . tep_db_input(stripslashes($update_customer_suburb)) . "',
+      customers_city = '" . tep_db_input(stripslashes($update_customer_city)) . "',
+      customers_state = '" . tep_db_input(stripslashes($update_customer_state)) . "',
+      customers_postcode = '" . tep_db_input($update_customer_postcode) . "',
+      customers_country = '" . tep_db_input(stripslashes($update_customer_country)) . "',
+      customers_telephone = '" . tep_db_input($update_customer_telephone) . "',
+      customers_email_address = '" . tep_db_input($update_customer_email_address) . "',";
+
+    if($SeparateBillingFields)
+    {
+    $UpdateOrders .= "billing_name = '" . tep_db_input(stripslashes($update_billing_name)) . "',
+      billing_company = '" . tep_db_input(stripslashes($update_billing_company)) . "',
+      billing_street_address = '" . tep_db_input(stripslashes($update_billing_street_address)) . "',
+      billing_suburb = '" . tep_db_input(stripslashes($update_billing_suburb)) . "',
+      billing_city = '" . tep_db_input(stripslashes($update_billing_city)) . "',
+      billing_state = '" . tep_db_input(stripslashes($update_billing_state)) . "',
+      billing_postcode = '" . tep_db_input($update_billing_postcode) . "',
+      billing_country = '" . tep_db_input(stripslashes($update_billing_country)) . "',";
+    }
+
+    $UpdateOrders .= "delivery_name = '" . tep_db_input(stripslashes($update_delivery_name)) . "',
+      delivery_company = '" . tep_db_input(stripslashes($update_delivery_company)) . "',
+      delivery_street_address = '" . tep_db_input(stripslashes($update_delivery_street_address)) . "',
+      delivery_suburb = '" . tep_db_input(stripslashes($update_delivery_suburb)) . "',
+      delivery_city = '" . tep_db_input(stripslashes($update_delivery_city)) . "',
+      delivery_state = '" . tep_db_input(stripslashes($update_delivery_state)) . "',
+      delivery_postcode = '" . tep_db_input($update_delivery_postcode) . "',
+      delivery_country = '" . tep_db_input(stripslashes($update_delivery_country)) . "',
+      payment_method = '" . tep_db_input($update_info_payment_method) . "',
+      account_name = '" . tep_db_input($account_name) . "',
+      account_number = '" . tep_db_input($account_number) . "',
+      po_number = '" . tep_db_input($po_number) . "',
+      cc_type = '" . tep_db_input($update_info_cc_type) . "',
+      cc_owner = '" . tep_db_input($update_info_cc_owner) . "',
+      cc_ccv = '" . tep_db_input($update_info_cc_ccv) . "',     
+      cc_start = '" . tep_db_input($update_info_cc_start) . "',
+      cc_issue = '" . tep_db_input($update_info_cc_issue) . "',
+
+      
+      last_modified = now(),";
+
+    if(substr($update_info_cc_number,0,8) != "(Last 4)")
+    $UpdateOrders .= "cc_number = '$update_info_cc_number',";
+    $UpdateOrders .= "cc_expires = '$update_info_cc_expires',
+      orders_status = '" . tep_db_input($status) . "'";
+
+    if(!$CommentsWithStatus)
+    {
+      $UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'";
+    }
+
+    $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "';";
+
+    tep_db_query($UpdateOrders);
+
+    $Query1 = "update orders set last_modified = now() where orders_id = '" . tep_db_input($oID) . "';";
+    tep_db_query($Query1);
+    $order_updated = true;
+
+
+          $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+          $check_status = tep_db_fetch_array($check_status_query);
+
+    // Update Status History & Email Customer if Necessary
+    if ($order->info['orders_status'] != $status)
+    {
+      // Notify Customer
+              $customer_notified = '0';
+      if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on'))
+      {
+        $notify_comments = '';
+        if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
+          $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
+        }
+        $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
+        tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+        $customer_notified = '1';
+      }
+
+      // "Status History" table has gone through a few
+      // different changes, so here are different versions of
+      // the status update.
+
+      // NOTE: Theoretically, there shouldn't be a
+      //       orders_status field in the ORDERS table. It
+      //       should really just use the latest value from
+      //       this status history table.
+
+      if($CommentsWithStatus)
+      {
+      tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
+        (orders_id, orders_status_id, date_added, customer_notified, comments)
+        values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), " . tep_db_input($customer_notified) . ", '" . tep_db_input($comments)  . "')");
+      }
+      else
+      {
+        if($OldNewStatusValues)
+        {
+        tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
+          (orders_id, new_value, old_value, date_added, customer_notified)
+          values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', '" . $order->info['orders_status'] . "', now(), " . tep_db_input($customer_notified) . ")");
+        }
+        else
+        {
+        tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
+          (orders_id, orders_status_id, date_added, customer_notified)
+          values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), " . tep_db_input($customer_notified) . ")");
+        }
+      }
+    }
+
+    // check to see if there are products to update
+    if (count($update_products) > 0)
+    {
+    // Update Products
+    $RunningSubTotal = 0;
+    $RunningTax = 0;
+        // CWS EDIT (start) -- Check for existence of subtotals...
+        // Do pre-check for subtotal field existence
+    $ot_subtotal_found = false;
+      foreach($update_totals as $total_details)
+    {
+        extract($total_details,EXTR_PREFIX_ALL,"ot");
+      if($ot_class == "ot_subtotal")
+      {
+          $ot_subtotal_found = true;
+          break;
+      }
+    }
+    // CWS EDIT (end) -- Check for existence of subtotals...
+
+    foreach($update_products as $orders_products_id => $products_details)
+    {
+      // Update orders_products Table
+      //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+      $order = tep_db_fetch_array($order_query);
+      if ($products_details["qty"] != $order['products_quantity']) {
+        $quantity_difference = ($products_details["qty"] - $order['products_quantity']);
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $quantity_difference . ", products_ordered = products_ordered + " . $quantity_difference . " where products_id = '" . (int)$order['products_id'] . "'");
+      }
+      //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+      if($products_details["qty"] > 0)
+      {
+        $Query = "update " . TABLE_ORDERS_PRODUCTS . " set
+          products_model = '" . $products_details["model"] . "',
+          products_name = '" . str_replace("'", "&#39;", $products_details["name"]) . "',
+          final_price = '" . $products_details["final_price"] . "',
+          products_tax = '" . $products_details["tax"] . "',
+          products_quantity = '" . $products_details["qty"] . "'
+          where orders_products_id = '$orders_products_id';";
+        tep_db_query($Query);
+
+        // Update Tax and Subtotals
+        $RunningSubTotal += $products_details["qty"] * $products_details["final_price"];
+        $RunningTax += (($products_details["tax"]/100) * ($products_details["qty"] * $products_details["final_price"]));
+
+        // Update Any Attributes
+        if(IsSet($products_details[attributes]))
+        {
+          foreach($products_details["attributes"] as $orders_products_attributes_id => $attributes_details)
+          {
+            $Query = "update " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
+              products_options = '" . $attributes_details["option"] . "',
+              products_options_values = '" . $attributes_details["value"] . "'
+              where orders_products_attributes_id = '$orders_products_attributes_id';";
+            tep_db_query($Query);
+          }
+        }
+      }
+      else
+      {
+        // 0 Quantity = Delete
+        $Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '$orders_products_id';";
+        tep_db_query($Query);
+          //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+        $order = tep_db_fetch_array($order_query);
+          if ($products_details["qty"] != $order['products_quantity']){
+          $quantity_difference = ($products_details["qty"] - $order['products_quantity']);
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $quantity_difference . ", products_ordered = products_ordered + " . $quantity_difference . " where products_id = '" . (int)$order['products_id'] . "'");
+          }
+          //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+        $Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_products_id = '$orders_products_id';";
+        tep_db_query($Query);
+      }
+    }
+
+    // 1.4. UPDATE SHIPPING, DISCOUNT & CUSTOM TAXES #####
+    // Shipping Tax
+      foreach($update_totals as $total_index => $total_details)
+      {
+        extract($total_details,EXTR_PREFIX_ALL,"ot");
+        if($ot_class == "ot_shipping")
+        {
+          $RunningTax += (($AddShippingTax / 100) * $ot_value);
+        }
+      }
+
+    // Update Totals
+
+      $RunningTotal = 0;
+      $sort_order = 0;
+
+      // Do pre-check for Tax field existence
+        $ot_tax_found = 0;
+        foreach($update_totals as $total_details)
+        {
+          extract($total_details,EXTR_PREFIX_ALL,"ot");
+          if($ot_class == "ot_tax")
+          {
+            $ot_tax_found = 1;
+            break;
+          }
+        }
+
+      foreach($update_totals as $total_index => $total_details)
+      {
+        extract($total_details,EXTR_PREFIX_ALL,"ot");
+
+        if( trim(strtolower($ot_title)) == "tax" || trim(strtolower($ot_title)) == "tax:" )
+        {
+          if($ot_class != "ot_tax" && $ot_tax_found == 0)
+          {
+            // Inserting Tax
+            $ot_class = "ot_tax";
+            $ot_value = "x"; // This gets updated in the next step
+            $ot_tax_found = 1;
+          }
+        }
+
+        if( trim($ot_title) && trim($ot_value) )
+        {
+          $sort_order++;
+
+          // Update ot_subtotal, ot_tax, and ot_total classes
+            if($ot_class == "ot_subtotal")
+            $ot_value = $RunningSubTotal;
+
+            if($ot_class == "ot_tax")
+            {
+            $ot_value = $RunningTax;
+            // print "ot_value = $ot_value<br>\n";
+            }
+//disocunt
+
+
+
+     // CWS EDIT (start) -- Check for existence of subtotals...
+            if($ot_class == "ot_total")
+                        {
+
+                $ot_value = $RunningTotal ;
+                            if ( !$ot_subtotal_found )
+                            {
+                                // There was no subtotal on this order, lets add the running subtotal in.
+                                $ot_value = $ot_value + $RunningSubTotal;
+                            }
+                        }
+     // CWS EDIT (end) -- Check for existence of subtotals...
+
+          // Set $ot_text (display-formatted value)
+            // $ot_text = "\$" . number_format($ot_value, 2, '.', ',');
+
+            $order = new order($oID);
+            $ot_text = $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']);
+
+            if($ot_class == "ot_total")
+            $ot_text = "<b>" . $ot_text . "</b>";
+
+          if($ot_total_id > 0)
+          {
+            // In Database Already - Update
+            $Query = "update " . TABLE_ORDERS_TOTAL . " set
+              title = '$ot_title',
+              text = '$ot_text',
+              value = '$ot_value',
+              sort_order = '$sort_order'
+              where orders_total_id = '$ot_total_id'";
+            tep_db_query($Query);
+          }
+          else
+          {
+
+            // New Insert
+            $Query = "insert into " . TABLE_ORDERS_TOTAL . " set
+              orders_id = '$oID',
+              title = '$ot_title',
+              text = '$ot_text',
+              value = '$ot_value',
+              class = '$ot_class',
+              sort_order = '$sort_order'";
+            tep_db_query($Query);
+          }
+
+          if ($ot_class == "ot_shipping" || $ot_class == "ot_lev_discount" || $ot_class == "ot_customer_discount" || $ot_class == "ot_custom" || $ot_class == "ot_cod_fee") {
+            // Again, because products are calculated in terms of default currency, we need to align shipping, custom etc. values with default currency
+            $RunningTotal += $ot_value / $order->info['currency_value'];
+          }
+          else
+          {
+            if($ot_class != "ot_tax") {
+              $RunningTotal += $ot_value;
+            }
+            else if ( DISPLAY_PRICE_WITH_TAX == 'false') {
+               // For German friends, the tax is included in the price and should not be
+               // taken in account when calculating total (not sure about shipping part, though :) )
+               $RunningTotal += $ot_value;
+            }
+          }
+        
+            //  print $ot_value."<br>";
+        }
+      elseif (($ot_total_id > 0) && ($ot_class != "ot_shipping")) { // Delete Total Piece
+        
+          // Delete Total Piece
+          $Query = "delete from " . TABLE_ORDERS_TOTAL . " where orders_total_id = '$ot_total_id'";
+          tep_db_query($Query);
+        }
+
+      }
+    }
+    if ($order_updated)
+    {
+      $messageStack->add_session('search', SUCCESS_ORDER_UPDATED, 'success');
+    }
+
+            tep_redirect(tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('action')) . 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit', 'SSL'));
+
+  break;
+
+  // Add a Product
+  case 'add_product':
+    if($step == 5)
+    {
+      // Get Order Info
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+      $order = new order($oID);
+
+      $AddedOptionsPrice = 0;
+
+      // Get Product Attribute Info
+      if(IsSet($add_product_options))
+      {
+        foreach($add_product_options as $option_id => $option_value_id)
+        {
+          if (DOWNLOAD_ENABLED == 'true') {
+
+            $result = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON po.products_options_id=pa.options_id LEFT JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON pov.products_options_values_id=pa.options_values_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad on pad.products_attributes_id=pa.products_attributes_id WHERE products_id='$add_product_products_id' and options_id=$option_id and options_values_id=$option_value_id");
+          } else {
+
+            $result = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON po.products_options_id=pa.options_id LEFT JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov ON pov.products_options_values_id=pa.options_values_id WHERE products_id='$add_product_products_id' and options_id=$option_id and options_values_id=$option_value_id");
+          }
+          $row = tep_db_fetch_array($result);
+          extract($row, EXTR_PREFIX_ALL, "opt");
+          $AddedOptionsPrice += $opt_options_values_price;
+          $option_value_details[$option_id][$option_value_id] = array ("options_values_price" => $opt_options_values_price);
+          $option_names[$option_id] = $opt_products_options_name;
+          $option_values_names[$option_value_id] = $opt_products_options_values_name;
+        }
+      }
+
+      // Get Product Info
+      $InfoQuery = "select p.products_model,p.products_price,pd.products_name,p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='$add_product_products_id' and p.products_id=pd.products_id";
+      $result = tep_db_query($InfoQuery);
+      $row = tep_db_fetch_array($result);
+      extract($row, EXTR_PREFIX_ALL, "p");
+
+      // risolviamo il bug delle offerte
+      $rs_offerte = tep_db_query("select * from specials where products_id ='". $add_product_products_id."' and status = 1 "  );
+      $offerte = tep_db_fetch_array($rs_offerte);
+      
+      
+      if ($offerte) 
+      {
+      $p_products_price = $offerte['specials_new_products_price'];
+      }
+      // Following functions are defined at the bottom of this file
+      $CountryID = tep_get_country_id($order->delivery["country"]);
+      $ZoneID = tep_get_zone_id($CountryID, $order->delivery["state"]);
+
+      $ProductsTax = tep_get_tax_rate($p_products_tax_class_id, $CountryID, $ZoneID);
+
+      $Query = "insert into " . TABLE_ORDERS_PRODUCTS . " set
+        orders_id = $oID,
+        products_id = $add_product_products_id,
+        products_model = '$p_products_model',
+        products_name = '" . str_replace("'", "&#39;", $p_products_name) . "',
+        products_price = '$p_products_price',
+        final_price = '" . ($p_products_price + $AddedOptionsPrice) . "',
+        products_tax = '$ProductsTax',
+        products_quantity = $add_product_quantity;";
+      tep_db_query($Query);
+      $new_product_id = tep_db_insert_id();
+      //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+      tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $add_product_quantity . ", products_ordered = products_ordered + " . $add_product_quantity . " where products_id = '" . $add_product_products_id . "'");
+      //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+      if(IsSet($add_product_options))
+      {
+        foreach($add_product_options as $option_id => $option_value_id)
+        {
+          $Query = "insert into " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
+            orders_id = $oID,
+            orders_products_id = $new_product_id,
+            products_options = '" . $option_names[$option_id] . "',
+            products_options_values = '" . $option_values_names[$option_value_id] . "',
+            options_values_price = '" . $option_value_details[$option_id][$option_value_id]["options_values_price"] . "',
+            price_prefix = '+';";
+          tep_db_query($Query);
+
+          if ((DOWNLOAD_ENABLED == 'true') && isset($opt_products_attributes_filename) && tep_not_null($opt_products_attributes_filename)) {
+            $sql_data_array = array('orders_id' => $oID,
+                                    'orders_products_id' => $new_product_id,
+                                    'orders_products_filename' => $opt_products_attributes_filename,
+                                    'download_maxdays' => $opt_products_attributes_maxdays,
+                                    'download_count' => $opt_products_attributes_maxcount);
+            tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
+          }
+        }
+      }
+
+      // Stock Update
+      $stock_chk_query = tep_db_query("select products_quantity from products where products_id = '" . $add_product_products_id . "'");
+      $stock_chk_values = tep_db_fetch_array($stock_chk_query);
+        $stock_chk_left = $stock_chk_values['products_quantity'] - $add_product_quantity;
+      tep_db_query("update products set products_quantity = '" . $stock_chk_left . "' where products_id = '" . $add_product_products_id . "'");
+
+      // Update products_ordered (for bestsellers list)
+      tep_db_query("update products set products_ordered = products_ordered + " . $add_product_quantity . " where products_id = '" . $add_product_products_id . "'");
+
+
+      // Calculate Tax and Sub-Totals
+      $order = new order($oID);
+      $RunningSubTotal = 0;
+      $RunningTax = 0;
+
+      for ($i=0; $i<sizeof($order->products); $i++)
+      {
+      $RunningSubTotal += ($order->products[$i]['qty'] * $order->products[$i]['final_price']);
+      $RunningTax += (($order->products[$i]['tax'] / 100) * ($order->products[$i]['qty'] * $order->products[$i]['final_price']));
+      }
+        //   echo 'running_tax ' . $RunningTax ;
+    if ($ot_class == "ot_shipping" || $ot_class == "ot_lev_discount" || $ot_class == "ot_customer_discount" || $ot_class == "ot_custom" || $ot_class == "ot_cod_fee") {
+      // Again, because products are calculated in terms of default currency, we need to align shipping, custom etc. values with default currency
+      $RunningTotal += $ot_value / $order->info['currency_value'];
+      }
+
+      // Tax
+      $Query = "update " . TABLE_ORDERS_TOTAL . " set
+        text = '\$" . number_format($RunningTax, 2, '.', ',') . "',
+        value = '" . $RunningTax . "'
+        where class='ot_tax' and orders_id=$oID";
+      tep_db_query($Query);
+
+      // Sub-Total
+      $Query = "update " . TABLE_ORDERS_TOTAL . " set
+        text = '\$" . number_format($RunningSubTotal, 2, '.', ',') . "',
+        value = '" . $RunningSubTotal . "'
+        where class='ot_subtotal' and orders_id=$oID";
+      tep_db_query($Query);
+
+      // Total
+      $Query = "select sum(value) as total_value from " . TABLE_ORDERS_TOTAL . " where class != 'ot_total' and orders_id=$oID";
+      $result = tep_db_query($Query);
+      $row = tep_db_fetch_array($result);
+      $Total = $row["total_value"];
+
+      $Query = "update " . TABLE_ORDERS_TOTAL . " set
+        text = '<b>\$" . number_format($Total, 2, '.', ',') . "</b>',
+        value = '" . $Total . "'
+        where class='ot_total' and orders_id=$oID";
+      tep_db_query($Query);
+
+
+tep_redirect(tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('action')) . 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit', 'SSL'));
+
+    }
+  break;
+// BMC Delete CC info Start
+// Remove CVV Number
+    case 'deleteccinfo':
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+
+      tep_db_query("update " . TABLE_ORDERS . " set cc_ccv = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_number = '0000000000000000' where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_expires = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_start = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_issue = null where orders_id = '" . tep_db_input($oID) . "'");
+
+      tep_redirect(tep_href_link(FILENAME_ABANDONED_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit'));
+      break;
+    }
+  }
+
+  if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
+    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+    $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+    $order_exists = true;
+    if (!tep_db_num_rows($orders_query)) {
+      $order_exists = false;
+      $messageStack->add(sprintf('search', ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
+    }
+  }
+// BOF: WebMakers.com Added: Additional info for Orders
+// Look up things in orders
+$the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+$the_extra= tep_db_fetch_array($the_extra_query);
+$the_customers_id= $the_extra['customers_id'];
+// Look up things in customers
+$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");
+$the_extra= tep_db_fetch_array($the_extra_query);
+$the_customers_fax= $the_extra['customers_fax'];
+// EOF: WebMakers.com Added: Additional info for Orders
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php
+  require(DIR_WS_INCLUDES . 'header.php');
+?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+$totals_check_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' order by sort_order");
+if (tep_db_num_rows($totals_check_query) < 1) { 
+ $abandoned = 1;
+ }
+
+  if (($action == 'edit') && ($order_exists == true)) {
+    $order = new order($oID);
+?>
+      <tr>
+        <td width="100%">
+          <table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+     if ($abandoned == '1'){
+     ?>
+           <tr>     
+            <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+            <tr>
+              <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+      <td class="messageStackError"><?php echo HEADING_ABANDONED . $oID; ?></td></tr>
+      <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+    </table></td>
+   </tr>
+
+  <?php
+    } else{
+    ?>
+           <tr>     
+            <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+            <tr>
+              <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td class="pageHeading"><?php echo HEADING_TITLE . '  ' .$oID;  ?></td>
+                  <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                </tr>
+              </table></td>
+ </tr>
+<?php   
+    }
+?>
+
+          <tr>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('action')),  'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+
+<!-- Begin Addresses Block -->
+      <tr>
+      <?php // echo tep_draw_form('edit_order', FILENAME_ABANDONED_ORDERS,  tep_get_all_get_params(array('action','paycc')), 'action=update_order', 'post'); 
+      ?>
+
+<tr><?php echo tep_draw_form('edit_order', FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('action','paycc'), 'post', '', 'SSL') . 'action=update_order', 'post', '', 'SSL'); ?>
+  <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+    <tr>
+      <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+    </tr>
+    <tr>
+      <td valign="top">
+      <!-- Customer Info Block -->
+    <table border="0" cellspacing="0" cellpadding="2">
+    <tr>
+    <td colspan='2' class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
+    <td colspan='2' class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>
+    </tr>
+    <tr>
+    <td colspan='2' class="main">
+    <table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+      <tr>
+      <td class="editOrder"><b><?php echo ENTRY_NAME ?></b></font></td>
+      <td><input name='update_customer_name' size='37' value='<?php echo tep_html_quotes($order->customer['name']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_COMPANY ?></b></font></td>
+        <td><input name='update_customer_company' size='37' value='<?php echo tep_html_quotes($order->customer['company']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo CATEGORY_ADDRESS ?></b></font></td>
+        <td><input name='update_customer_street_address' size='37' value='<?php echo tep_html_quotes($order->customer['street_address']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_SUBURB ?></b></font></td>
+        <td><input name='update_customer_suburb' size='37' value='<?php echo tep_html_quotes($order->customer['suburb']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_CITY ?></b></font></td>
+        <td><input name='update_customer_city' size='15' value='<?php echo tep_html_quotes($order->customer['city']); ?>'> </td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_STATE ?></b></font></td>
+        <td><input name='update_customer_state' size='15' value='<?php echo tep_html_quotes($order->customer['state']); ?>'> </td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_POST_CODE ?></b></font></td>
+        <td><input name='update_customer_postcode' size='5' value='<?php echo $order->customer['postcode']; ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_COUNTRY ?></b></font></td>
+        <td><input name='update_customer_country' size='37' value='<?php echo tep_html_quotes($order->customer['country']); ?>'></td>
+      </tr>
+     </table>
+    </td>
+
+
+<?php if($SeparateBillingFields) { ?>
+      <td>
+       <!-- Billing Address Block -->
+       <table border="0" cellspacing="0" cellpadding="2">
+
+      <tr>
+        <td colspan='2' class="main">
+          <table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+          <tr>
+            <td class="editOrder"><b><?php echo ENTRY_NAME ?></b></font></td>
+              <td><input name='update_billing_name' size='37' value='<?php echo tep_html_quotes($order->billing['name']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COMPANY ?></b></font></td>
+              <td><input name='update_billing_company' size='37' value='<?php echo tep_html_quotes($order->billing['company']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo CATEGORY_ADDRESS ?></b></font></td>
+              <td><input name='update_billing_street_address' size='37' value='<?php echo tep_html_quotes($order->billing['street_address']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_SUBURB ?></b></font></td>
+              <td><input name='update_billing_suburb' size='37' value='<?php echo tep_html_quotes($order->billing['suburb']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_CITY ?></b></font></td>
+              <td><input name='update_billing_city' size='15' value='<?php echo tep_html_quotes($order->billing['city']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_STATE ?></b></font></td>
+              <td><input name='update_billing_state' size='15' value='<?php echo tep_html_quotes($order->billing['state']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_POST_CODE ?></b></font></td>
+              <td><input name='update_billing_postcode' size='5' value='<?php echo $order->billing['postcode']; ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COUNTRY ?></b></font></td>
+              <td><input name='update_billing_country' size='37' value='<?php echo tep_html_quotes($order->billing['country']); ?>'></td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+    </table>
+      </td>
+<?php } ?>
+
+    </tr>
+    </table>
+      </td>
+      </tr>
+
+      <tr>
+      <td valign="top">
+      <!-- Shipping Address Block -->
+    <table border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>
+      </tr>
+      <tr>
+        <td colspan='1' class="main">
+          <table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+          <tr>
+            <td class="editOrder"><b><?php echo ENTRY_NAME ?></b></font></td>
+              <td><input name='update_delivery_name' size='37' value='<?php echo tep_html_quotes($order->delivery['name']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COMPANY ?></b></font></td>
+              <td><input name='update_delivery_company' size='37' value='<?php echo tep_html_quotes($order->delivery['company']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo CATEGORY_ADDRESS ?></b></font></td>
+              <td><input name='update_delivery_street_address' size='37' value='<?php echo tep_html_quotes($order->delivery['street_address']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_SUBURB ?></b></font></td>
+              <td><input name='update_delivery_suburb' size='37' value='<?php echo tep_html_quotes($order->delivery['suburb']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_CITY ?></b></font></td>
+              <td><input name='update_delivery_city' size='15' value='<?php echo tep_html_quotes($order->delivery['city']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_STATE ?></b></font></td>
+              <td><input name='update_delivery_state' size='15' value='<?php echo tep_html_quotes($order->delivery['state']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_POST_CODE ?></b></font></td>
+              <td><input name='update_delivery_postcode' size='5' value='<?php echo $order->delivery['postcode']; ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COUNTRY ?></b></font></td>
+              <td><input name='update_delivery_country' size='37' value='<?php echo tep_html_quotes($order->delivery['country']); ?>'></td>
+            </tr>
+          </table>
+        </td>
+        <td class="main" align="center" valign="middle">
+          <font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" color="red"><b><?php echo HEADING_INSTRUCT1 ?></b></font><br><br>
+          <?php echo HEADING_INSTRUCT2 ?>
+
+        </td>
+       </tr>
+      </table>
+      </td>
+    </tr>
+  </table></td>
+      </tr>
+<!-- End Addresses Block -->
+
+      <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+<!-- Begin Phone/Email Block -->
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+          <tr>
+            <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>
+            <td class="main"><input name='update_customer_telephone' size='15' value='<?php echo $order->customer['telephone']; ?>'></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
+            <td class="main"><input name='update_customer_email_address' size='35' value='<?php echo $order->customer['email_address']; ?>'></td>
+          </tr>
+        </table></td>
+      </tr>
+<!-- End Phone/Email Block -->
+
+      <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+<!-- Begin Payment Block -->
+      <tr>
+   <?php   
+    if (strtolower($order->info['payment_method']) == 'paypal') {
+
+include(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/TransactionSummaryLogs.inc.php');
+
+}else{
+?> 
+  <td><table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+    <tr valine="middle">
+      <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
+      <?php
+            //list exsisting payment if not in current order_pay_meahtods table
+                 $orders_pay_methodA[] = array('id'   => $order->info['payment_method'],
+                                                       'text' => $order->info['payment_method']);
+                          // check to see if meathod in totals  is in same as in order_pay_meahtods table
+                          // if false merge if true dont merge
+                          if (!array_intersect ($orders_pay_method, $orders_pay_methodA)){
+                         $orders_pay_method1 = array_merge($orders_pay_methodA, $orders_pay_method) ;
+                                  }else{
+                               $orders_pay_method1 = $orders_pay_method;
+                                  }
+    
+//begin PayPal_Shopping_Cart_IPN V3.15 DMG
+    
+
+
+//}//else not paypal
+//end PayPal_Shopping_Cart_IPN
+?>
+      <td class="main"><?php echo tep_draw_pull_down_menu('update_info_payment_method', $orders_pay_method1, $order->info['payment_method']); ?>
+      <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+      <?php
+      if($order->info['payment_method'] != "Credit Card")
+      echo TEXT_VIEW_CC;
+      ?>
+      <?php
+    if($order->info['payment_method'] != "Purchase Order")
+    echo TEXT_VIEW_PO;
+      ?>
+      </td>
+    </tr>
+<?php
+// BMC CC Mod Start
+if ($order->info['cc_number'] != '0000000000000000') { 
+  if ( strtolower(CC_ENC) == 'true' ) {
+    $key = changeme;
+    $cipher_data = $order->info['cc_number'];
+    $order->info['cc_number'] = changedataout($cipher_data,$key);
+  }
+}
+// BMC CC Mod End
+    if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {
+?>
+    <!-- Begin Credit Card Info Block -->
+    <tr>
+      <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+    </tr>
+    <tr>
+      <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td>
+      <td class="main"><input name='update_info_cc_type' size='10' value='<?php echo $order->info['cc_type']; ?>'></td>
+    </tr>
+    <tr>
+      <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td>
+      <td class="main"><input name='update_info_cc_owner' size='20' value='<?php echo $order->info['cc_owner']; ?>'></td>
+    </tr>
+    <tr>
+      <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>
+      <td class="main"><input name='update_info_cc_number' size='20' value='<?php echo $order->info['cc_number']; ?>'></td>
+    </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_CCV; ?></td>
+            <td class="main"><input name='update_info_cc_ccv' size='4' value='<?php echo $order->info['cc_ccv']; ?>'></td>
+          </tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_START_DATE; ?></td>
+            <td class="main"><input name='update_info_cc_start' size='4' value='<?php echo $order->info['cc_start']; ?>'></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_ISSUE; ?></td>
+            <td class="main"><input name='update_info_cc_issue' size='4' value='<?php echo $order->info['cc_issue']; ?>'></td>
+          </tr>
+          <tr>
+      <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td>
+      <td class="main"><input name='update_info_cc_expires' size='4' value='<?php echo $order->info['cc_expires']; ?>'></td>
+    </tr>
+    <!-- End Credit Card Info Block -->
+
+
+    <?php
+        // purchaseorder start
+            } else if( (($order->info['account_name']) || ($order->info['account_number']) || $order->info['payment_method'] == "Purchase Order"|| ($order->info['po_number'])) ) {
+        ?>
+    <tr>
+          <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+    </tr>
+    <tr>
+    <td class="main" valign="top" align="left"><b><?php echo TEXT_INFO_PO ?></b></td>
+    <td>
+    <table border="0" cellspacing="0" cellpadding="2">
+    <tr>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><?php echo TEXT_INFO_NAME ?></td>
+      <td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><input type="text" name="account_name" value='<?php echo $order->info['account_name']; ?>'></td></td>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+    </tr>
+    <tr>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><?php echo TEXT_INFO_AC_NR ?></td>
+      <td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><input type="text" name="account_number" value='<?php echo $order->info['account_number']; ?>'></td>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+    </tr>
+    <tr>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><?php echo TEXT_INFO_PO_NR ?></td>
+      <td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><input type="text" name="po_number" value='<?php echo $order->info['po_number']; ?>'></td>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+    </tr>
+   </table>
+   </td>
+     </tr>
+  <?php } }?>
+  </table></td>
+      </tr>
+<!-- End Payment Block -->
+   <?php
+     if ($abandoned == '1'){
+     ?>
+           <tr>     
+            <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+            <tr>
+              <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+      <td class="messageStackError"><?php echo HEADING_ABANDONED . $oID; ?></td></tr>
+      <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+    </table></td>
+   </tr>
+<?php 
+} else {
+?>
+      <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php
+}
+?>
+<!-- Begin Products Listing Block -->
+      <tr>
+  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+    <tr class="dataTableHeadingRow">
+      <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+      <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
+      <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_TAX; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_BASE_PRICE; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_UNIT_PRICE; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_PRICE; ?></td>
+    </tr>
+
+  <!-- Begin Products Listings Block -->
+  <?php
+        // Override order.php Class's Field Limitations
+    $index = 0;
+    $order->products = array();
+    $orders_products_query = tep_db_query("select * from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "'");
+    while ($orders_products = tep_db_fetch_array($orders_products_query)) {
+    $order->products[$index] = array('qty' => $orders_products['products_quantity'],
+                                        'name' => str_replace("'", "&#39;", $orders_products['products_name']),
+                                        'model' => $orders_products['products_model'],
+                                        'tax' => $orders_products['products_tax'],
+                                        'price' => $orders_products['products_price'],
+                                        'final_price' => $orders_products['final_price'],
+                                        'orders_products_id' => $orders_products['orders_products_id']);
+
+    $subindex = 0;
+    $attributes_query_string = "select * from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'";
+    $attributes_query = tep_db_query($attributes_query_string);
+
+    if (tep_db_num_rows($attributes_query)) {
+    while ($attributes = tep_db_fetch_array($attributes_query)) {
+      $order->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
+                                                               'value' => $attributes['products_options_values'],
+                                                               'prefix' => $attributes['price_prefix'],
+                                                               'price' => $attributes['options_values_price'],
+                                                               'orders_products_attributes_id' => $attributes['orders_products_attributes_id']);
+    $subindex++;
+    }
+    }
+    $index++;
+    }
+
+  for ($i=0; $i<sizeof($order->products); $i++) {
+    $orders_products_id = $order->products[$i]['orders_products_id'];
+
+    $RowStyle = "dataTableContent";
+
+    echo '    <tr class="dataTableRow">' . "\n" .
+       '      <td class="' . $RowStyle . '" valign="top" align="right">' . "<input name='update_products[$orders_products_id][qty]' size='2' value='" . $order->products[$i]['qty'] . "'>&nbsp;x</td>\n" .
+       '      <td class="' . $RowStyle . '" valign="top">' . "<input name='update_products[$orders_products_id][name]' size='25' value='" . $order->products[$i]['name'] . "'>";
+
+    // Has Attributes?
+    if (sizeof($order->products[$i]['attributes']) > 0) {
+      for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) {
+        $orders_products_attributes_id = $order->products[$i]['attributes'][$j]['orders_products_attributes_id'];
+        echo '<br><nobr><small>&nbsp;<i> - ' . "<input name='update_products[$orders_products_id][attributes][$orders_products_attributes_id][option]' size='6' value='" . $order->products[$i]['attributes'][$j]['option'] . "'>" . ': ' . "<input name='update_products[$orders_products_id][attributes][$orders_products_attributes_id][value]' size='10' value='" . $order->products[$i]['attributes'][$j]['value'] . "' >" . $order->products[$i]['attributes'][$j]['prefix'] . ' ' . $currencies->format($order->products[$i]['attributes'][$j]['price']) ;
+        echo '</i></small></nobr>';
+      }
+    }
+
+    echo '      </td>' . "\n" .
+         '      <td class="' . $RowStyle . '" valign="top">' . "<input name='update_products[$orders_products_id][model]' size='12' value='" . $order->products[$i]['model'] . "'>" . '</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="center" valign="top">' . "<input name='update_products[$orders_products_id][tax]' size='3' value='" . tep_display_tax_value($order->products[$i]['tax']) . "'>" . '%</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="right" valign="top">' . "<input name='update_products[$orders_products_id][price]' size='5' value='" . number_format($order->products[$i]['price'], 2, '.', '') . "'>" . '</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="right" valign="top">' . "<input name='update_products[$orders_products_id][final_price]' size='5' value='" . number_format($order->products[$i]['final_price'], 2, '.', '') . "'>" . '</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="right" valign="top">' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
+         '    </tr>' . "\n";
+  }
+  ?>
+   <?php
+     if ($abandoned == '1'){
+     ?>
+<tr><td>Display basket</td></tr>
+   <?php
+}
+     ?>
+
+  <!-- Begin Order Total Block -->
+    <tr>
+      <td align="right" colspan="7">
+        <table border="0" cellspacing="0" cellpadding="2" width="100%">
+        <tr>
+        <td align='center' valign='top'><br><?php echo '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=add_product&step=1') . '">'. tep_image_button('button_add_product.gif', 'Add a product') . '&nbsp;</a></td>' ;?>
+        <td align='right'>
+        <table border="0" cellspacing="0" cellpadding="2">
+<?php
+
+        // Override order.php Class's Field Limitations
+    $totals_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' order by sort_order");
+    $order->totals = array();
+    while ($totals = tep_db_fetch_array($totals_query)) { $order->totals[] = array('title' => $totals['title'], 'text' => $totals['text'], 'class' => $totals['class'], 'value' => $totals['value'], 'orders_total_id' => $totals['orders_total_id']); }
+
+  $TotalsArray = array();
+  for ($i=0; $i<sizeof($order->totals); $i++) {
+    $TotalsArray[] = array("Name" => $order->totals[$i]['title'], "Price" => number_format($order->totals[$i]['value'], 2, '.', ''), "Class" => $order->totals[$i]['class'], "TotalID" => $order->totals[$i]['orders_total_id']);
+    $TotalsArray[] = array("Name" => "          ", "Price" => "", "Class" => "ot_custom", "TotalID" => "0");
+  }
+
+  array_pop($TotalsArray);
+  foreach($TotalsArray as $TotalIndex => $TotalDetails)
+  {
+    $TotalStyle = "smallText";
+    if(($TotalDetails["Class"] == "ot_subtotal") || ($TotalDetails["Class"] == "ot_total"))
+    {
+      echo  '       <tr>' . "\n" .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Price"] .
+            "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+            "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" .
+            "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+        '       </tr>' . "\n";
+    }
+    elseif($TotalDetails["Class"] == "ot_customer_discount")
+        {
+          echo  '       <tr>' . "\n" .
+            '   <td class="main" align="right">' . ENTRY_CUSTOMER_DISCOUNT . '<b>' . $TotalDetails["Name"] . '</b></td>' .
+            '   <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value=' " . $TotalDetails["Price"] . "'>" .
+                    "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+                "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+                "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+            '       </tr>' . "\n";
+    }
+
+    elseif($TotalDetails["Class"] == "ot_gv")
+        {
+          echo  '       <tr>' . "\n" .
+            '   <td class="main" align="right">' . ENTRY_CUSTOMER_GV . '<b>' . $TotalDetails["Name"] . '</b></td>' .
+            '   <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value=' " . $TotalDetails["Price"] . "'>" .
+                    "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+                "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+                "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+            '       </tr>' . "\n";
+    }
+    elseif($TotalDetails["Class"] == "ot_subtotal") 
+    {
+      echo '  <tr>' . "\n" .
+           '    <td align="right" class="' . $TotalStyle . '"><b>' . $TotalDetails["Name"] . '</b></td>' .
+           '    <td align="right" class="' . $TotalStyle . '"><b>' . $currencies->format($TotalDetails["Price"], true, $order->info['currency'], $order->info['currency_value']) . '</b>' . 
+                "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' size='" . strlen($TotalDetails["Name"]) . "' >" . 
+                "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" . 
+                "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" . 
+                "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' . 
+           '    <td align="right" class="' . $TotalStyle . '"><b>' . tep_draw_separator('pixel_trans.gif', '1', '17') . '</b>' . 
+           '  </tr>' . "\n";
+    }
+    elseif($TotalDetails["Class"] == "ot_tax")
+    {
+      echo  '       <tr>' . "\n" .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Price"] .
+                        "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+            "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" .
+            "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+        '       </tr>' . "\n";
+    }
+        //  Shipping
+    elseif($TotalDetails["Class"] == "ot_shipping")
+    { 
+      //list exsisting shipping if not in current order_ship_meahtods table
+           $orders_ship_methodA[] = array('id'   => $TotalDetails["Name"],
+                                                    'text' => $TotalDetails["Name"]);
+          
+                  //  $orders_ship_method1 = array_merge($orders_ship_method, $orders_ship_methodA) ;
+                  // check to see if meathod in totals  is in same as in order_ship_meahtods table
+                          // if false merge if true dont merge
+
+                         $orders_ship_method1 = array_merge($orders_ship_methodA, $orders_ship_method) ;
+     
+    
+      echo  ' <tr>' . "\n" .
+          '       <td align="right" class="' . $TotalStyle . '"><b><?php echo HEADING_SHIPPING ?></b>' . tep_draw_pull_down_menu('update_totals[$TotalIndex][title]', $orders_ship_method1, $TotalDetails["Name"]) . '</td>' . "\n";
+      echo  ' <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value='" . $TotalDetails["Price"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][class]' value='" . $TotalDetails["Class"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</td>' .
+        '       </tr>' . "\n";
+    }
+    // End Shipping
+    else
+    {
+      echo  '       <tr>' . "\n" .
+          '   <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
+        '   <td align="right" class="' . $TotalStyle . '">' . "<input type='hidden' name='update_totals[$TotalIndex][value]' size='6' value='" . $TotalDetails["Price"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][title]' value='" . trim($TotalDetails["Name"]) . "' >" .
+            "<input type='hidden' name='update_totals[$TotalIndex][class]' value='" . $TotalDetails["Class"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" .
+            '</td>' . "\n" .
+        '       </tr>' . "\n";
+    }
+  }
+?>
+        </table>
+        </td>
+        </tr>
+        </table>
+      </td>
+    </tr>
+  <!-- End Order Total Block -->
+
+  </table></td>
+      </tr>
+
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+      <tr>
+        <td class="main"><table border="1" cellspacing="0" cellpadding="5">
+          <tr>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>
+            <?php if($CommentsWithStatus) { ?>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+            <?php } ?>
+          </tr>
+<?php
+    $orders_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
+    if (tep_db_num_rows($orders_history_query)) {
+      while ($orders_history = tep_db_fetch_array($orders_history_query)) {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
+             '            <td class="smallText" align="center">';
+        if ($orders_history['customer_notified'] == '1') {
+          echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
+        } else {
+          echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
+        }
+        echo '            <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n";
+
+        if($CommentsWithStatus) {
+        echo '            <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . '&nbsp;</td>' . "\n";
+        }
+
+        echo '          </tr>' . "\n";
+      }
+    } else {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
+             '          </tr>' . "\n";
+    }
+?>
+        </table></td>
+      </tr>
+
+      <tr>
+        <td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+      </tr>
+      <tr>
+        <td class="main">
+        <?php
+        if($CommentsWithStatus) {
+          echo tep_draw_textarea_field('comments', 'soft', '60', '5');
+  }
+  else
+  {
+    echo tep_draw_textarea_field('comments', 'soft', '60', '5', $order->info['comments']);
+  }
+  ?>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', false); ?></td>
+          </tr>
+          <?php if($CommentsWithStatus) { ?>
+          <tr>
+                <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', false); ?></td>
+          </tr>
+          <?php } ?>
+        </table></td>
+      </tr>
+
+      <tr>
+  <td align='center' valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=deleteccinfo') . '">' . tep_image_button('button_removeccinfo.gif', RemoveCCV) . '&nbsp;</a>' . tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
+      </tr>
+      </form></tr>
+  <tr>
+        <?php  //Begin Paypal IPN V3.15 DMG (I improvised here.)
+
+if (strtolower($order->info['payment_method']) == 'paypal' && isset($HTTP_GET_VARS['referer']) && $HTTP_GET_VARS['referer'] == 'ipn'){
+?>
+<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=deleteccinfo') . '">' . tep_image_button('button_removeccinfo.gif', RemoveCVV) . '&nbsp;</a> <a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ABANDONED_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . '\')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a><a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ABANDONED_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . '\')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a><a href="' . tep_href_link(FILENAME_PAYPAL, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+
+<?php } else { //not paypal
+?>
+<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=deleteccinfo') . '">' . tep_image_button('button_removeccinfo.gif', RemoveCVV) . '&nbsp;</a><a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ABANDONED_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . '\')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a><a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ABANDONED_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . '\')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a><a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+<?php
+ }  //end PapPal IPN V3.15
+?>
+     </tr>
+<?php
+}else{
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr><?php echo tep_draw_form('orders', FILENAME_ABANDONED_ORDERS, '', 'get', '', 'SSL'); ?>
+                <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>
+              </form></tr>
+              <tr><?php echo tep_draw_form('status', FILENAME_ABANDONED_ORDERS, '', 'get', '', 'SSL'); ?>
+                <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td>
+              </form></tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $HEADING_CUSTOMERS = TABLE_HEADING_CUSTOMERS;
+  $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=ascending">';
+  $HEADING_CUSTOMERS .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=decending">';
+  $HEADING_CUSTOMERS .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+  $HEADING_DATE_PURCHASED = TABLE_HEADING_DATE_PURCHASED;
+  $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=ascending">';
+  $HEADING_DATE_PURCHASED .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=decending">';
+  $HEADING_DATE_PURCHASED .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+ ?>
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo $HEADING_CUSTOMERS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo $HEADING_DATE_PURCHASED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $sortorder = 'order by ';
+    if($_GET["sort"] == 'customer') {
+      if($_GET["order"] == 'ascending') {
+        $sortorder .= 'o.customers_name  asc, ';
+      } else {
+        $sortorder .= 'o.customers_name desc, ';
+      }
+    } elseif($_GET["sort"] == 'date') {
+      if($_GET["order"] == 'ascending') {
+        $sortorder .= 'o.date_purchased  asc, ';
+      } else {
+        $sortorder .= 'o.date_purchased desc, ';
+      }
+    }
+    $sortorder .= 'o.orders_id DESC';
+    if (isset($HTTP_GET_VARS['cID'])) {
+      $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+      $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and ot.orders_id = o.orders_id and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
+    } elseif (isset($HTTP_GET_VARS['status']) && (tep_not_null($HTTP_GET_VARS['status']))) {
+      $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+      $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' order by o.orders_id DESC";
+    } else {
+      $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' " . $sortorder;
+    }
+    
+    $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
+    $orders_query = tep_db_query($orders_query_raw);
+    while ($orders = tep_db_fetch_array($orders_query)) {
+   unset($order_total1);
+   $order_total1 = TEXT_INFO_ABANDONDED;
+   $orders_total_query_raw = "select ot.text as order_total from " . TABLE_ORDERS_TOTAL . " ot where  ot.orders_id = '" . $orders['orders_id'] . "' and ot.class = 'ot_total' ";
+   $orders_query_total = tep_db_query($orders_total_query_raw);
+    while ($orders1 = tep_db_fetch_array($orders_query_total)) {
+      $order_total1 = $orders1['order_total'];
+   
+     if (!$order_total1){
+      $order_total1 = TEXT_INFO_ABANDONDED;
+      }
+    }
+    
+    if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
+        $oInfo = new objectInfo($orders);
+      }
+   if ($order_total1 == TEXT_INFO_ABANDONDED){;
+      if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('oID', 'action'), 'SSL') . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit', 'SSL') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $orders['customers_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo strip_tags($order_total1); ?></td>
+                <td class="dataTableContent" align="center"><?php echo tep_datetime_short($orders['date_purchased']); ?></td>
+                <td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    } }
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>');
+
+      $contents = array('form' => tep_draw_form('orders', FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm', 'post' , '', 'SSL'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br>');
+      $contents[] = array('text' => TEXT_INFO_DELETE_DATA . '&nbsp;' . $oInfo->customers_name . '<br>');
+      $contents[] = array('text' => TEXT_INFO_DELETE_DATA_OID . '&nbsp;<b>' . $oInfo->orders_id . '</b><br>');
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id, 'SSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+
+
+    default:
+      if (isset($oInfo) && is_object($oInfo)) {
+        $heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']&nbsp;&nbsp;' . tep_datetime_short($oInfo->date_purchased) . '</b>');
+
+        if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
+     $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'SSL') . '">' . tep_image_button('button_edit_status.gif', IMAGE_EDIT_STATUS) . '</a> <a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete', 'SSL') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, 'oID=' . $oInfo->orders_id . '&action=edit', 'SSL'). '">' . tep_image_button('button_edit_order.gif', IMAGE_EDIT_ORDER) . '</a>');
+
+//     $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');
+     $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method);
+//begin PayPal_Shopping_Cart_IPN V3.15 DMG
+        if (strtolower($oInfo->payment_method) == 'paypal') {
+        include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/functions/general.func.php');
+        $contents[] = array('text' => TABLE_HEADING_PAYMENT_STATUS . ': ' .paypal_payment_status($oInfo->orders_id) );
+    }
+//end PayPal_shopping_Cart_IPN
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+}  }
+?>
+<?php
+if($action == "add_product")
+{
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo ADDING_TITLE; ?> #<?php echo $oID; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ABANDONED_ORDERS, tep_get_all_get_params(array('action', 'add_product')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+  // ############################################################################
+  //   Get List of All Products
+  // ############################################################################
+
+    $result = tep_db_query("SELECT products_name, p.products_id, cd.categories_name, ptc.categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id=ptc.categories_id and ptc.products_id=p.products_id and p.products_status = '1' and p.products_id=pd.products_id and pd.language_id = '" . (int)$languages_id . "' ORDER BY cd.categories_name");
+    while($row = tep_db_fetch_array($result))
+    {
+      extract($row,EXTR_PREFIX_ALL,"db");
+      $ProductList[$db_categories_id][$db_products_id] = $db_products_name;
+      $CategoryList[$db_categories_id] = $db_categories_name;
+      $LastCategory = $db_categories_name;
+    }
+
+    // ksort($ProductList);
+
+    $LastOptionTag = "";
+    //$ProductSelectOptions = "<option value='0'>Don't Add New Product" . $LastOptionTag . "\n";
+
+    $ProductSelectOptions = "<option value='0'>".DONT_ADD_NEW_PRODUCT . $LastOptionTag . "\n";
+    $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
+    foreach($ProductList as $Category => $Products)
+    {
+      $ProductSelectOptions .= "<option value='0'>$Category" . $LastOptionTag . "\n";
+      $ProductSelectOptions .= "<option value='0'>---------------------------" . $LastOptionTag . "\n";
+      asort($Products);
+      foreach($Products as $Product_ID => $Product_Name)
+      {
+        $ProductSelectOptions .= "<option value='$Product_ID'> &nbsp; $Product_Name" . $LastOptionTag . "\n";
+      }
+
+      if($Category != $LastCategory)
+      {
+        $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
+        $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
+      }
+    }
+
+
+  // ############################################################################
+  //   Add Products Steps
+  // ############################################################################
+
+    print "<tr><td><table border='0'>\n";
+
+    // Set Defaults
+      if(!IsSet($add_product_categories_id))
+      $add_product_categories_id = 0;
+
+      if(!IsSet($add_product_products_id))
+      $add_product_products_id = 0;
+
+    // Step 1: Choose Category
+      print "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=add_product' method='POST'>\n";
+      print "<td class='dataTableContent' align='right'><b><?php echo TEXT_ADD_PROD_STEP1 ?></b></td><td class='dataTableContent' valign='top'>";
+
+      $tree = tep_get_category_tree();
+      $dropdown= tep_draw_pull_down_menu('add_product_categories_id', $tree, '', ''); //single
+      echo $dropdown;
+
+
+      // print "<select name='add_product_categories_id'>\n";
+      // $CategoryOptions = "<option value='0'> TEXT_ADD_CAT_CHOOSE ";
+      // foreach($CategoryList as $CategoryID => $CategoryName)
+      // {
+      // $CategoryOptions .= "<option value='$CategoryID'> $CategoryName\n";
+      // }
+
+      $CategoryOptions = str_replace("value='$add_product_categories_id'","value='$add_product_categories_id' selected", $CategoryOptions);
+      print $CategoryOptions;
+      print "</td>\n";
+      print "<td class='dataTableContent' align='center'><input type='submit' value='" . TEXT_SELECT_CAT . "'>";
+      print "<input type='hidden' name='step' value='2'>";
+      print "</td>\n";
+      print "</form></tr>\n";
+
+      print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
+
+    // Step 2: Choose Product
+    if(($step > 1) && ($add_product_categories_id > 0))
+    {
+      print "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
+      print "<td class='dataTableContent' align='right'><b><?php echo TEXT_ADD_STEP2 ?></b></td><td class='dataTableContent' valign='top'><select name='add_product_products_id'>";
+      $ProductOptions = "<option value='0'> " . TEXT_ADD_PROD_CHOOSE;
+      asort($ProductList[$add_product_categories_id]);
+      foreach($ProductList[$add_product_categories_id] as $ProductID => $ProductName)
+      {
+      $ProductOptions .= "<option value='$ProductID'> $ProductName\n";
+      }
+      $ProductOptions = str_replace("value='$add_product_products_id'","value='$add_product_products_id' selected", $ProductOptions);
+      print $ProductOptions;
+      print "</select></td>\n";
+      print "<td class='dataTableContent' align='center'><input type='submit' value='" . TEXT_SELECT_PROD . "'>";
+      print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
+      print "<input type='hidden' name='step' value='3'>";
+      print "</td>\n";
+      print "</form></tr>\n";
+
+      print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
+    }
+
+    // Step 3: Choose Options
+    echo TEXT_ADD_PROD . $add_product_products_id;
+    if(($step > 2) && ($add_product_products_id > 0))
+    {
+      // Get Options for Products
+$result = tep_db_query("SELECT * FROM
+" . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+" . TABLE_PRODUCTS_OPTIONS . " po,
+" . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
+WHERE
+pa.options_id = po.products_options_id and
+pa.options_values_id = pov.products_options_values_id and
+products_id ='$add_product_products_id' ");
+
+
+      // Skip to Step 4 if no Options
+      if(tep_db_num_rows($result) == 0)
+      {
+        echo "<tr class=\"dataTableRow\">\n";
+        echo "<td class='dataTableContent' align='right'><b>" . TEXT_ADD_STEP3  . "</b></td><td class='dataTableContent' valign='top' colspan='2'><i>" . TEXT_SELECT_OPT_SKIP . "</i></td>";
+        echo "</tr>\n";
+        $step = 4;
+      }
+      else
+      {
+        while($row = tep_db_fetch_array($result))
+        {
+          extract($row,EXTR_PREFIX_ALL,"db");
+          $Options[$db_products_options_id] = $db_products_options_name;
+          $ProductOptionValues[$db_products_options_id][$db_products_options_values_id] = $db_products_options_values_name;
+        }
+                                 echo '<tr class=\"dataTableRow\">' . tep_draw_form('select_product', FILENAME_C_ORDERS, 'oID='.$oID . '&action=add_product', 'post', '', 'SSL') . "\n";
+
+        //echo "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
+        print "<td class='dataTableContent' align='right'><b>" . TEXT_ADD_STEP3 . "</b></td><td class='dataTableContent' valign='top'>";
+        foreach($ProductOptionValues as $OptionID => $OptionValues)
+        {
+          $OptionOption = "<b>" . $Options[$OptionID] . "</b> - <select name='add_product_options[$OptionID]'>";
+          foreach($OptionValues as $OptionValueID => $OptionValueName)
+          {
+          $OptionOption .= "<option value='$OptionValueID'> $OptionValueName\n";
+          }
+          $OptionOption .= "</select><br>\n";
+
+          if(IsSet($add_product_options))
+          $OptionOption = str_replace("value='" . $add_product_options[$OptionID] . "'","value='" . $add_product_options[$OptionID] . "' selected",$OptionOption);
+
+          print $OptionOption;
+        }
+        print "</td>";
+        print "<td class='dataTableContent' align='center'><input type='submit' value='Select These Options'>";
+        print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
+        print "<input type='hidden' name='add_product_products_id' value='$add_product_products_id'>";
+        print "<input type='hidden' name='step' value='4'>";
+        print "</td>\n";
+        print "</form></tr>\n";
+      }
+
+      print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
+    }
+
+    // Step 4: Confirm
+    if($step > 3)
+    {
+    
+         echo '<tr class=\"dataTableRow\">' . tep_draw_form('select_product', FILENAME_C_ORDERS, 'oID='.$oID . '&action=add_product', 'post', '', 'SSL') . "\n";
+                      //  echo "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
+      print "<td class='dataTableContent' align='right'><b>" . TEXT_ADD_STEP4 . "</b></td>";
+      print "<td class='dataTableContent' valign='top'><input name='add_product_quantity' size='2' value='1'>" . TEXT_ADD_QUANTITY . "</td>";
+      print "<td class='dataTableContent' align='center'><input type='submit' value='" . TEXT_ADD_NOW . "'>";
+
+      if(IsSet($add_product_options))
+      {
+        foreach($add_product_options as $option_id => $option_value_id)
+        {
+          echo "<input type='hidden' name='add_product_options[$option_id]' value='$option_value_id'>";
+        }
+      }
+      print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
+      print "<input type='hidden' name='add_product_products_id' value='$add_product_products_id'>";
+      print "<input type='hidden' name='step' value='5'>";
+      print "</td>\n";
+      print "</form></tr>\n";
+    }
+
+    print "</table></td></tr>\n";
+}
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php
+require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/account_details.php
===================================================================
--- trunk/direct.openmoko.com/admin/account_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/account_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,489 @@
+<?php
+/*
+  $Id: account_details.php,v 1 2003/08/24 23:22:27 frankl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+   
+  THIS IS BETA - Use at your own risk!
+  Step-By-Step Manual Order Entry Verion 0.5
+  Customer Entry through Admin
+*/
+
+  $newsletter_array = array(array('id' => '1',
+                                  'text' => ENTRY_NEWSLETTER_YES),
+                            array('id' => '0',
+                                  'text' => ENTRY_NEWSLETTER_NO));
+
+function sbs_get_zone_name($country_id, $zone_id) {
+    $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . $country_id . "' and zone_id = '" . $zone_id . "'");
+    if (tep_db_num_rows($zone_query)) {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_name'];
+    } else {
+      return $default_zone;
+    }
+  }
+ 
+ // Returns an array with countries
+// TABLES: countries
+  function sbs_get_countries($countries_id = '', $with_iso_codes = false) {
+    $countries_array = array();
+    if ($countries_id) {
+      if ($with_iso_codes) {
+        $countries = tep_db_query("select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "' order by countries_name");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name'],
+                                 'countries_iso_code_2' => $countries_values['countries_iso_code_2'],
+                                 'countries_iso_code_3' => $countries_values['countries_iso_code_3']);
+      } else {
+        $countries = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "'");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name']);
+      }
+    } else {
+      $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name");
+      while ($countries_values = tep_db_fetch_array($countries)) {
+        $countries_array[] = array('countries_id' => $countries_values['countries_id'],
+                                   'countries_name' => $countries_values['countries_name']);
+      }
+    }
+
+    return $countries_array;
+  } 
+  ////
+function sbs_get_country_list($name, $selected = '', $parameters = '') { 
+   $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT)); 
+   $countries = sbs_get_countries(); 
+   $size = sizeof($countries); 
+   for ($i=0; $i<$size; $i++) { 
+     $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); 
+   } 
+
+   return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters); 
+}
+
+
+////
+// Alias function to tep_get_countries, which also returns the countries iso codes
+ /* function tep_get_countries_with_iso_codes($countries_id) {
+    return tep_get_countries($countries_id, true);
+  }*/
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    $male = ($account['customers_gender'] == 'm') ? true : false;
+    $female = ($account['customers_gender'] == 'f') ? true : false;
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_GENDER; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo ($account['customers_gender'] == 'm') ? MALE : FEMALE;
+    } elseif ($error) {
+      if ($entry_gender_error) {
+        echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_ERROR;
+      } else {
+        echo ($gender == 'm') ? MALE : FEMALE;
+        echo tep_draw_hidden_field('gender');
+      }
+    } else {
+      echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_firstname'];
+  } elseif ($error) {
+    if ($entry_firstname_error) {
+      echo tep_draw_input_field('firstname') . '&nbsp;' . ENTRY_FIRST_NAME_ERROR;
+    } else {
+      echo $firstname . tep_draw_hidden_field('firstname');
+    }
+  } else {
+    echo tep_draw_input_field('firstname', $account['customers_firstname']) . '&nbsp;' . ENTRY_FIRST_NAME_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_lastname'];
+  } elseif ($error) {
+    if ($entry_lastname_error) {
+      echo tep_draw_input_field('lastname') . '&nbsp;' . ENTRY_LAST_NAME_ERROR;
+    } else {
+      echo $lastname . tep_draw_hidden_field('lastname');
+    }
+  } else {
+    echo tep_draw_input_field('lastname', $account['customers_lastname']) . '&nbsp;' . ENTRY_LAST_NAME_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_DOB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo tep_date_short($account['customers_dob']);
+    } elseif ($error) {
+      if ($entry_date_of_birth_error) {
+        echo tep_draw_input_field('dob') . '&nbsp;' . ENTRY_DATE_OF_BIRTH_ERROR;
+      } else {
+        echo $dob . tep_draw_hidden_field('dob');
+      }
+    } else {
+      echo tep_draw_input_field('dob', tep_date_short($account['customers_dob'])) . '&nbsp;' . ENTRY_DATE_OF_BIRTH_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_email_address'];
+  } elseif ($error) {
+    if ($entry_email_address_error) {
+      echo tep_draw_input_field('email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR;
+    } elseif ($entry_email_address_check_error) {
+      echo tep_draw_input_field('email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
+    } elseif ($entry_email_address_exists) {
+      echo tep_draw_input_field('email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
+    } else {
+      echo $email_address . tep_draw_hidden_field('email_address');
+    }
+  } else {
+    echo tep_draw_input_field('email_address', $account['customers_email_address']) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_TEXT;
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>  
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_COMPANY; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_COMPANY; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo $account['entry_company'];
+    } elseif ($error) {
+      if ($entry_company_error) {
+        echo tep_draw_input_field('company') . '&nbsp;' . ENTRY_COMPANY_ERROR;
+      } else {
+        echo $company . tep_draw_hidden_field('company');
+      }
+    } else {
+      echo tep_draw_input_field('company', $account['entry_company']) . '&nbsp;' . ENTRY_COMPANY_TEXT;
+    }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  }
+?>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_ADDRESS; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['entry_street_address'];
+  } elseif ($error) {
+    if ($entry_street_address_error) {
+      echo tep_draw_input_field('street_address') . '&nbsp;' . ENTRY_STREET_ADDRESS_ERROR;
+    } else {
+      echo $street_address . tep_draw_hidden_field('street_address');
+    }
+  } else {
+    echo tep_draw_input_field('street_address', $account['entry_street_address']) . '&nbsp;' . ENTRY_STREET_ADDRESS_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_SUBURB; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo $account['entry_suburb'];
+    } elseif ($error) {
+      if ($entry_suburb_error) {
+        echo tep_draw_input_field('suburb') . '&nbsp;' . ENTRY_SUBURB_ERROR;
+      } else {
+        echo $suburb . tep_draw_hidden_field('suburb');
+      }
+    } else {
+      echo tep_draw_input_field('suburb', $account['entry_suburb']) . '&nbsp;' . ENTRY_SUBURB_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['entry_postcode'];
+  } elseif ($error) {
+    if ($entry_post_code_error) {
+      echo tep_draw_input_field('postcode') . '&nbsp;' . ENTRY_POST_CODE_ERROR;
+    } else {
+      echo $postcode . tep_draw_hidden_field('postcode');
+    }
+  } else {
+    echo tep_draw_input_field('postcode', $account['entry_postcode']) . '&nbsp;' . ENTRY_POST_CODE_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_CITY; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['entry_city'];
+  } elseif ($error) {
+    if ($entry_city_error) {
+      echo tep_draw_input_field('city') . '&nbsp;' . ENTRY_CITY_ERROR;
+    } else {
+      echo $city . tep_draw_hidden_field('city');
+    }
+  } else {
+    echo tep_draw_input_field('city', $account['entry_city']) . '&nbsp;' . ENTRY_CITY_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STATE; ?></td>
+            <td class="main">&nbsp;
+<?php
+    $state = sbs_get_zone_name($country, $zone_id);
+    if ($is_read_only) {
+      echo sbs_get_zone_name($account['entry_country_id'], $account['entry_zone_id']);
+    } elseif ($error) {
+      if ($entry_state_error) {
+        if ($entry_state_has_zones) {
+          $zones_array = array();
+          $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' order by zone_name");
+          while ($zones_values = tep_db_fetch_array($zones_query)) {
+            $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+          }
+          echo tep_draw_pull_down_menu('state', $zones_array) . '&nbsp;' . ENTRY_STATE_ERROR;
+        } else {
+          echo tep_draw_input_field('state') . '&nbsp;' . ENTRY_STATE_ERROR;
+        }
+      } else {
+        echo $state . tep_draw_hidden_field('zone_id') . tep_draw_hidden_field('state');
+      }
+    } else {
+      echo tep_draw_input_field('state', sbs_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state'])) . '&nbsp;' . ENTRY_STATE_TEXT;
+    }
+?></td>
+             </tr>
+<?php
+     }
+?>
+             <tr>
+               <td class="main">&nbsp;
+<?php
+ echo ENTRY_COUNTRY;
+ ?></td>
+               <td class="main">&nbsp;
+<?php
+      $account['entry_country_id'] = STORE_COUNTRY;
+   if ($is_read_only) {       echo tep_get_country_name($account['entry_country_id']);     } 
+elseif 
+($error) {
+       if ($entry_country_error) {
+        
+     echo sbs_get_country_list('country') . '&nbsp;' . ENTRY_COUNTRY_ERROR;
+       } else {
+         echo tep_get_country_name($country) . tep_draw_hidden_field('country');
+       }
+     } else {
+       echo sbs_get_country_list('country', $account['entry_country_id']) . '&nbsp;' . ENTRY_COUNTRY_TEXT;
+     }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_CONTACT; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_telephone'];
+  } elseif ($error) {
+    if ($entry_telephone_error) {
+      echo tep_draw_input_field('telephone') . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_ERROR;
+    } else {
+      echo $telephone . tep_draw_hidden_field('telephone');
+    }
+  } else {
+    echo tep_draw_input_field('telephone', $account['customers_telephone']) . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FAX_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_fax'];
+  } elseif ($processed) {
+    echo $fax . tep_draw_hidden_field('fax');
+  } else {
+    echo tep_draw_input_field('fax', $account['customers_fax']) . '&nbsp;' . ENTRY_FAX_NUMBER_TEXT;
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_OPTIONS; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_NEWSLETTER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    if ($account['customers_newsletter'] == '1') {
+      echo ENTRY_NEWSLETTER_YES;
+    } else {
+      echo ENTRY_NEWSLETTER_NO;
+    }
+  } elseif ($processed) {
+    if ($newsletter == '1') {
+      echo ENTRY_NEWSLETTER_YES;
+    } else {
+      echo ENTRY_NEWSLETTER_NO;
+    }
+    echo tep_draw_hidden_field('newsletter');  
+  } else {
+    echo tep_draw_pull_down_menu('newsletter', $newsletter_array, $account['customers_newsletter']) . '&nbsp;' . ENTRY_NEWSLETTER_TEXT;
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php/*
+<?php
+  if (!$is_read_only) {
+?>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_PASSWORD; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_PASSWORD; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($error) {
+      if ($entry_password_error) {
+        echo tep_draw_password_field('password') . '&nbsp;' . ENTRY_PASSWORD_ERROR;
+      } else {
+        echo PASSWORD_HIDDEN . tep_draw_hidden_field('password') . tep_draw_hidden_field('confirmation');
+      }
+    } else {
+      echo tep_draw_password_field('password') . '&nbsp;' . ENTRY_PASSWORD_TEXT;
+    }
+?></td>
+         </tr>
+<?php
+    if ( (!$error) || ($entry_password_error) ) {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+            <td class="main">&nbsp;
+<?php
+      echo tep_draw_password_field('confirmation') . '&nbsp;' . ENTRY_PASSWORD_CONFIRMATION_TEXT;
+?></td>
+          </tr>
+<?php
+    }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+*/ ?>
+
+<?php
+ // }
+?>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/admin_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/admin_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/admin_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,242 @@
+<?php
+/*
+  $Id: admin_account.php,v 1.1.1.1 2004/03/04 23:38:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  
+  $current_boxes = DIR_FS_ADMIN . DIR_WS_BOXES;
+  
+  if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+      case 'check_password':
+        $check_pass_query = tep_db_query("select admin_password as confirm_password from " . TABLE_ADMIN . " where admin_id = '" . $HTTP_POST_VARS['id_info'] . "'");
+        $check_pass = tep_db_fetch_array($check_pass_query);
+        
+        // Check that password is good
+        if (!tep_validate_password($HTTP_POST_VARS['password_confirmation'], $check_pass['confirm_password'])) {
+          tep_redirect(tep_href_link(FILENAME_ADMIN_ACCOUNT, 'action=check_account&error=password'));
+        } else {
+          //$confirm = 'confirm_account';
+          tep_session_register('confirm_account');
+          tep_redirect(tep_href_link(FILENAME_ADMIN_ACCOUNT, 'action=edit_process'));
+        }
+
+        break;    
+      case 'save_account':
+        $admin_id = tep_db_prepare_input($HTTP_POST_VARS['id_info']);
+        $admin_email_address = tep_db_prepare_input($HTTP_POST_VARS['admin_email_address']);
+        $stored_email[] = 'NONE';
+        $hiddenPassword = '-hidden-';
+        
+        $check_email_query = tep_db_query("select admin_email_address from " . TABLE_ADMIN . " where admin_id <> " . $admin_id . "");
+        while ($check_email = tep_db_fetch_array($check_email_query)) {
+          $stored_email[] = $check_email['admin_email_address'];
+        }
+        
+        if (in_array($HTTP_POST_VARS['admin_email_address'], $stored_email)) {
+          tep_redirect(tep_href_link(FILENAME_ADMIN_ACCOUNT, 'action=edit_process&error=email'));
+        } else {
+          $sql_data_array = array('admin_firstname' => tep_db_prepare_input($HTTP_POST_VARS['admin_firstname']),
+                                  'admin_lastname' => tep_db_prepare_input($HTTP_POST_VARS['admin_lastname']),
+                                  'admin_email_address' => tep_db_prepare_input($HTTP_POST_VARS['admin_email_address']),
+                                  'admin_password' => tep_encrypt_password(tep_db_prepare_input($HTTP_POST_VARS['admin_password'])),
+                                  'admin_modified' => 'now()');
+        
+          tep_db_perform(TABLE_ADMIN, $sql_data_array, 'update', 'admin_id = \'' . $admin_id . '\'');
+
+          tep_mail($HTTP_POST_VARS['admin_firstname'] . ' ' . $HTTP_POST_VARS['admin_lastname'], $HTTP_POST_VARS['admin_email_address'], ADMIN_EMAIL_SUBJECT, sprintf(ADMIN_EMAIL_TEXT, $HTTP_POST_VARS['admin_firstname'], HTTP_SERVER . DIR_WS_ADMIN, $HTTP_POST_VARS['admin_email_address'], $hiddenPassword, STORE_OWNER), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+        
+          tep_redirect(tep_href_link(FILENAME_ADMIN_ACCOUNT, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $admin_id));
+        }
+        break;
+    }
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php require('includes/account_check.js.php'); ?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->    
+    <td width="100%" valign="top">
+      <?php if ($HTTP_GET_VARS['action'] == 'edit_process') { echo tep_draw_form('account', FILENAME_ADMIN_ACCOUNT, 'action=save_account', 'post', 'enctype="multipart/form-data"'); } elseif ($HTTP_GET_VARS['action'] == 'check_account') { echo tep_draw_form('account', FILENAME_ADMIN_ACCOUNT, 'action=check_password', 'post', 'enctype="multipart/form-data"'); } else { echo tep_draw_form('account', FILENAME_ADMIN_ACCOUNT, 'action=check_account', 'post', 'enctype="multipart/form-data"'); } ?>
+      <table border="0" width="100%" cellspacing="0" cellpadding="2">     
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
+          <tr>
+            <td valign="top">
+<?php
+  $my_account_query = tep_db_query ("select a.admin_id, a.admin_firstname, a.admin_lastname, a.admin_email_address, a.admin_created, a.admin_modified, a.admin_logdate, a.admin_lognum, g.admin_groups_name from " . TABLE_ADMIN . " a, " . TABLE_ADMIN_GROUPS . " g where a.admin_id= " . $login_id . " and g.admin_groups_id= " . $login_groups_id . "");
+  $myAccount = tep_db_fetch_array($my_account_query);
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2" align="center">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ACCOUNT; ?>
+                </td>
+              </tr>
+              <tr class="dataTableRow">
+                <td>
+                  <table border="0" cellspacing="0" cellpadding="3">
+<?php
+    if ( ($HTTP_GET_VARS['action'] == 'edit_process') && (tep_session_is_registered('confirm_account')) ) {
+?>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_FIRSTNAME; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo tep_draw_input_field('admin_firstname', $myAccount['admin_firstname']); ?></td>
+                    </tr>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_LASTNAME; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo tep_draw_input_field('admin_lastname', $myAccount['admin_lastname']); ?></td>
+                    </tr>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_EMAIL; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php if ($HTTP_GET_VARS['error']) { echo tep_draw_input_field('admin_email_address', $myAccount['admin_email_address']) . ' <nobr>' . TEXT_INFO_ERROR . '</nobr>'; } else { echo tep_draw_input_field('admin_email_address', $myAccount['admin_email_address']); } ?></td>
+                    </tr>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_PASSWORD; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo tep_draw_password_field('admin_password'); ?></td>
+                    </tr>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_PASSWORD_CONFIRM; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo tep_draw_password_field('admin_password_confirm'); ?></td>
+                    </tr>
+<?php
+    } else {
+    if (tep_session_is_registered('confirm_account')) {
+      tep_session_unregister('confirm_account');
+    }
+?>                        
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_FULLNAME; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo $myAccount['admin_firstname'] . ' ' . $myAccount['admin_lastname']; ?></td>
+                    </tr>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_EMAIL; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo $myAccount['admin_email_address']; ?></td>
+                    </tr>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_PASSWORD; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo TEXT_INFO_PASSWORD_HIDDEN; ?></td>
+                    </tr>
+                    <tr class="dataTableRowSelected">
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_GROUP; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo $myAccount['admin_groups_name']; ?></td>
+                    </tr>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_CREATED; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo $myAccount['admin_created']; ?></td>
+                    </tr>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_LOGNUM; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo $myAccount['admin_lognum']; ?></td>
+                    </tr>
+                    <tr>
+                      <td class="dataTableContent"><nobr><?php echo TEXT_INFO_LOGDATE; ?>&nbsp;&nbsp;&nbsp;</nobr></td>
+                      <td class="dataTableContent"><?php echo $myAccount['admin_logdate']; ?></td>
+                    </tr>
+<?php
+  }
+?>                       
+                  </table>
+                </td>
+              </tr>
+              <tr>
+                <td><table width="100%" border="0" cellspacing="0" cellpadding="3"><tr><td class="smallText" valign="top"><?php echo TEXT_INFO_MODIFIED . $myAccount['admin_modified']; ?></td><td align="right"><?php if ($HTTP_GET_VARS['action'] == 'edit_process') { echo '<a href="' . tep_href_link(FILENAME_ADMIN_ACCOUNT) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> '; if (tep_session_is_registered('confirm_account')) { echo tep_image_submit('button_save.gif', IMAGE_SAVE, 'onClick="validateForm();return document.returnValue"'); } } elseif ($HTTP_GET_VARS['action'] == 'check_account') { echo '&nbsp;'; } else { echo tep_image_submit('button_edit.gif', IMAGE_EDIT); } ?></td><tr></table></td>
+              </tr>              
+            </table>
+   
+   
+            </td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+    case 'edit_process':
+      $heading[] = array('text' => '<b>&nbsp;' . TEXT_INFO_HEADING_DEFAULT . '</b>');
+      
+      $contents[] = array('text' => TEXT_INFO_INTRO_EDIT_PROCESS . tep_draw_hidden_field('id_info', $myAccount['admin_id']));
+      //$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ADMIN_ACCOUNT) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> ' . tep_image_submit('button_confirm.gif', IMAGE_CONFIRM, 'onClick="validateForm();return document.returnValue"') . '<br>&nbsp');
+      break; 
+    case 'check_account':
+      $heading[] = array('text' => '<b>&nbsp;' . TEXT_INFO_HEADING_CONFIRM_PASSWORD . '</b>');
+      
+      $contents[] = array('text' => '&nbsp;' . TEXT_INFO_INTRO_CONFIRM_PASSWORD . tep_draw_hidden_field('id_info', $myAccount['admin_id']));
+      if ($HTTP_GET_VARS['error']) {
+        $contents[] = array('text' => '&nbsp;' . TEXT_INFO_INTRO_CONFIRM_PASSWORD_ERROR);
+      }
+      $contents[] = array('align' => 'center', 'text' => tep_draw_password_field('password_confirmation'));
+      $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ADMIN_ACCOUNT) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> ' . tep_image_submit('button_confirm.gif', IMAGE_CONFIRM) . '<br>&nbsp');
+      break; 
+    default:
+      $heading[] = array('text' => '<b>&nbsp;' . TEXT_INFO_HEADING_DEFAULT . '</b>');
+      
+      $contents[] = array('text' => TEXT_INFO_INTRO_DEFAULT);
+      //$contents[] = array('align' => 'center', 'text' => tep_image_submit('button_edit.gif', IMAGE_EDIT) . '<br>&nbsp');
+      if ($myAccount['admin_email_address'] == 'admin at localhost') {
+        $contents[] = array('text' => sprintf(TEXT_INFO_INTRO_DEFAULT_FIRST, $myAccount['admin_firstname']) . '<br>&nbsp');
+      } elseif (($myAccount['admin_modified'] == '0000-00-00 00:00:00') || ($myAccount['admin_logdate'] <= 1) ) {
+        $contents[] = array('text' => sprintf(TEXT_INFO_INTRO_DEFAULT_FIRST_TIME, $myAccount['admin_firstname']) . '<br>&nbsp');
+      }
+      
+  }
+  
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form></td>  
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/admin_files.php
===================================================================
--- trunk/direct.openmoko.com/admin/admin_files.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/admin_files.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,317 @@
+<?php
+/*
+  $Id: admin_files.php,v 1.1.1.1 2004/03/04 23:38:04 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $current_boxes = DIR_FS_ADMIN . DIR_WS_BOXES;
+  $current_files = DIR_FS_ADMIN;
+  
+  if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+      case 'box_store':       
+        $sql_data_array = array('admin_files_name' => tep_db_prepare_input($HTTP_GET_VARS['box']),
+                                'admin_files_is_boxes' => '1');
+        tep_db_perform(TABLE_ADMIN_FILES, $sql_data_array);
+        $admin_boxes_id = tep_db_insert_id();
+        
+        tep_redirect(tep_href_link(FILENAME_ADMIN_FILES, 'cID=' . $admin_boxes_id));
+        break;
+      case 'box_remove':
+        // NOTE: ALSO DELETE FILES STORED IN REMOVED BOX //
+        $admin_boxes_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+        tep_db_query("delete from " . TABLE_ADMIN_FILES . " where admin_files_id = '" . $admin_boxes_id . "' or admin_files_to_boxes = '" . $admin_boxes_id . "'");
+        
+        tep_redirect(tep_href_link(FILENAME_ADMIN_FILES));
+        break;
+      case 'file_store':
+        $sql_data_array = array('admin_files_name' => tep_db_prepare_input($HTTP_POST_VARS['admin_files_name']),
+                                'admin_files_to_boxes' => tep_db_prepare_input($HTTP_POST_VARS['admin_files_to_boxes']));
+        tep_db_perform(TABLE_ADMIN_FILES, $sql_data_array);
+        $admin_files_id = tep_db_insert_id();
+
+        tep_redirect(tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&fID=' . $admin_files_id));
+        break;
+      case 'file_remove':
+        $admin_files_id = tep_db_prepare_input($HTTP_POST_VARS['admin_files_id']);      
+        tep_db_query("delete from " . TABLE_ADMIN_FILES . " where admin_files_id = '" . $admin_files_id . "'");
+        
+        tep_redirect(tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath']));
+        break;
+    }
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top">
+<?php
+ if ($HTTP_GET_VARS['fID'] || $HTTP_GET_VARS['cPath']) {
+  //$current_box_query_raw = "select admin_files_name as admin_box_name from " . TABLE_ADMIN_FILES . " where admin_files_id = " . $HTTP_GET_VARS['cPath'] . " ";
+  $current_box_query = tep_db_query("select admin_files_name as admin_box_name from " . TABLE_ADMIN_FILES . " where admin_files_id = " . $HTTP_GET_VARS['cPath']);
+  $current_box = tep_db_fetch_array($current_box_query); 
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FILENAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $db_file_query_raw = "select * from " . TABLE_ADMIN_FILES . " where admin_files_to_boxes = " . $HTTP_GET_VARS['cPath'] . " order by admin_files_name";
+  $db_file_query = tep_db_query($db_file_query_raw);
+  $file_count = 0;
+  
+  while ($files = tep_db_fetch_array($db_file_query)) {
+    $file_count++;
+    
+    if (((!$HTTP_GET_VARS['fID']) || ($HTTP_GET_VARS['fID'] == $files['admin_files_id'])) && (!$fInfo) ) {
+      $fInfo = new objectInfo($files);
+    }
+
+    if ( (is_object($fInfo)) && ($files['admin_files_id'] == $fInfo->admin_files_id) ) {
+      echo '                  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&fID=' . $files['admin_files_id'] . '&action=edit_file') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&fID=' . $files['admin_files_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $files['admin_files_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($fInfo)) && ($files['admin_files_id'] == $fInfo->admin_files_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&fID=' . $files['admin_files_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  } 
+  
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo TEXT_COUNT_FILES . $file_count; ?></td>
+                    <td class="smallText" valign="top" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cID=' . $HTTP_GET_VARS['cPath']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>&nbsp<a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&action=store_file') . '">' . tep_image_button('button_admin_files.gif', IMAGE_INSERT_FILE) . '</a>'; ?>&nbsp;</td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table>
+<?php
+ } else {
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent" width="60%"><?php echo TABLE_HEADING_BOXES; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php 
+  $installed_boxes_query = tep_db_query("select admin_files_name as admin_boxes_name from " . TABLE_ADMIN_FILES . " where admin_files_is_boxes = 1 order by admin_files_name");
+  $installed_boxes = array();
+  while($db_boxes = tep_db_fetch_array($installed_boxes_query)) {
+    $installed_boxes[] = $db_boxes['admin_boxes_name'];
+  }
+  
+  $none = 0;
+  $boxes = array();
+  $dir = dir(DIR_WS_BOXES);
+  while ($boxes_file = $dir->read()) {
+    if ( (substr("$boxes_file", -4) == '.php') && !(in_array($boxes_file, $installed_boxes))){
+      $boxes[] = array('admin_boxes_name' => $boxes_file,
+                       'admin_boxes_id' => 'b' . $none);
+    } elseif ( (substr("$boxes_file", -4) == '.php') && (in_array($boxes_file, $installed_boxes))) {
+      $db_boxes_id_query = tep_db_query("select admin_files_id as admin_boxes_id from " . TABLE_ADMIN_FILES . " where admin_files_is_boxes = 1 and admin_files_name = '" . $boxes_file . "'");
+      $db_boxes_id = tep_db_fetch_array($db_boxes_id_query);
+      $boxes[] = array('admin_boxes_name' => $boxes_file,
+                       'admin_boxes_id' => $db_boxes_id['admin_boxes_id']);
+    }
+    
+  $none++;
+  }
+  $dir->close();
+  sort($boxes);
+  reset ($boxes);
+
+  
+  $boxnum = sizeof($boxes);
+  $i = 0;
+  while ($i < $boxnum) {
+    if (((!$HTTP_GET_VARS['cID']) || ($HTTP_GET_VARS['none'] == $boxes[$i]['admin_boxes_id']) || ($HTTP_GET_VARS['cID'] == $boxes[$i]['admin_boxes_id'])) && (!$cInfo) ) {
+      $cInfo = new objectInfo($boxes[$i]);
+    }
+    if ( (is_object($cInfo)) && ($boxes[$i]['admin_boxes_id'] == $cInfo->admin_boxes_id) ) {
+      if ( substr("$cInfo->admin_boxes_id", 0,1) == 'b') {
+        echo '                  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_ADMIN_FILES, 'cID=' . $boxes[$i]['admin_boxes_id']) . '\'">' . "\n";
+      } else {
+        echo '                  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $boxes[$i]['admin_boxes_id'] . '&action=store_file') . '\'">' . "\n";
+      }
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_ADMIN_FILES, 'cID=' . $boxes[$i]['admin_boxes_id']) . '\'">' . "\n";
+    }    
+?>
+                <td class="dataTableContent"><?php echo tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . ' <b>' . ucfirst (substr_replace ($boxes[$i]['admin_boxes_name'], '' , -4)) . '</b>'; ?></td>
+                <td class="dataTableContent" align="center"><?php
+                                               if ( (is_object($cInfo)) && ($HTTP_GET_VARS['cID'] == $boxes[$i]['admin_boxes_id'])) {
+                                                 if (substr($boxes[$i]['admin_boxes_id'], 0,1) == 'b') {
+                                                   echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', STATUS_BOX_NOT_INSTALLED, 10, 10) . '&nbsp;<a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cID=' . $boxes[$i]['admin_boxes_id'] . '&box=' . $boxes[$i]['admin_boxes_name'] . '&action=box_store') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', STATUS_BOX_INSTALL, 10, 10) . '</a>';
+                                                 } else {
+                                                   echo '<a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cID=' . $HTTP_GET_VARS['cID'] . '&action=box_remove') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', STATUS_BOX_REMOVE, 10, 10) . '</a>&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', STATUS_BOX_INSTALLED, 10, 10);
+                                                 }
+                                               } else {
+                                                 if (substr($boxes[$i]['admin_boxes_id'], 0,1) == 'b') {
+                                                   echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', '', 10, 10) . '&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', '', 10, 10) . '</a>';
+                                                 } else {
+                                                   echo tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', '', 10, 10) . '</a>&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', '', 10, 10);
+                                                 }
+                                               }
+                                             ?>
+                </td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($boxes[$i]['admin_boxes_id'] == $cInfo->admin_boxes_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cID=' . $db_cat['admin_boxes_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+   $i++;
+  }
+?>
+              <tr>
+                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php  echo TEXT_COUNT_BOXES . $boxnum; ?></td>
+                    <td class="smallText" valign="top" align="right">&nbsp;</td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table>
+<?php  
+ } 
+?>
+            </td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {  
+    case 'store_file': 
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_FILE . '</b>');
+      
+      $file_query = tep_db_query("select admin_files_name from " . TABLE_ADMIN_FILES . " where admin_files_is_boxes = '0' ");
+      while ($fetch_files = tep_db_fetch_array($file_query)) {
+        $files_array[] = $fetch_files['admin_files_name'];        
+      }
+
+      $file_dir = array();
+      $dir = dir(DIR_FS_ADMIN);
+
+      while ($file = $dir->read()) {
+        if ((substr("$file", -4) == '.php') && $file != FILENAME_DEFAULT && $file != FILENAME_LOGIN && $file != FILENAME_LOGOFF && $file != FILENAME_FORBIDEN && $file != FILENAME_POPUP_IMAGE && $file != FILENAME_PASSWORD_FORGOTTEN && $file != FILENAME_ADMIN_ACCOUNT && $file != 'invoice.php' && $file != 'packingslip.php') {
+            $file_dir[] = $file;
+        }
+      }
+      
+      $result = $file_dir;      
+      if (sizeof($files_array) > 0) {
+        $result = array_values (array_diff($file_dir, $files_array));
+      }
+      
+      sort ($result);
+      reset ($result);
+      while (list ($key, $val) = each ($result)) {
+        $show[] = array('id' => $val,
+                        'text' => $val);
+      }
+      
+      $contents = array('form' => tep_draw_form('store_file', FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&fID=' . $files['admin_files_id'] . '&action=file_store', 'post', 'enctype="multipart/form-data"')); 
+      $contents[] = array('text' => '<b>' . TEXT_INFO_NEW_FILE_BOX .  ucfirst(substr_replace ($current_box['admin_box_name'], '', -4)) . '</b>');
+      $contents[] = array('text' => TEXT_INFO_NEW_FILE_INTRO );
+      $contents[] = array('align' => 'left', 'text' => '<br>&nbsp;' . tep_draw_pull_down_menu('admin_files_name', $show, $show)); 
+      $contents[] = array('text' => tep_draw_hidden_field('admin_files_to_boxes', $HTTP_GET_VARS['cPath']));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');    
+      break;
+    case 'remove_file': 
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_FILE . '</b>');
+
+      $contents = array('form' => tep_draw_form('remove_file', FILENAME_ADMIN_FILES, 'action=file_remove&cPath=' . $HTTP_GET_VARS['cPath'] . '&fID=' . $files['admin_files_id'], 'post', 'enctype="multipart/form-data"')); 
+      $contents[] = array('text' => tep_draw_hidden_field('admin_files_id', $HTTP_GET_VARS['fID']));
+      $contents[] = array('text' =>  sprintf(TEXT_INFO_DELETE_FILE_INTRO, $fInfo->admin_files_name, ucfirst(substr_replace ($current_box['admin_box_name'], '', -4))) );    
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_confirm.gif', IMAGE_CONFIRM) . ' <a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&fID=' . $HTTP_GET_VARS['fID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');    
+      break;
+    default:
+      if (is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DEFAULT_BOXES . $cInfo->admin_boxes_name . '</b>');
+        if ( substr($cInfo->admin_boxes_id, 0,1) == 'b') {
+        $contents[] = array('text' => '<b>' . $cInfo->admin_boxes_name . ' ' . TEXT_INFO_DEFAULT_BOXES_NOT_INSTALLED . '</b><br>&nbsp;');
+        $contents[] = array('text' => TEXT_INFO_DEFAULT_BOXES_INTRO);
+        } else {
+        $contents = array('form' => tep_draw_form('newfile', FILENAME_ADMIN_FILES, 'cPath=' . $cInfo->admin_boxes_id . '&action=store_file', 'post', 'enctype="multipart/form-data"')); 
+        $contents[] = array('align' => 'center', 'text' => tep_image_submit('button_admin_files.gif', IMAGE_INSERT_FILE) );
+        $contents[] = array('text' => tep_draw_hidden_field('this_category', $cInfo->admin_boxes_id));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DEFAULT_BOXES_INTRO);
+        }
+        $contents[] = array('text' => '<br>');
+      }
+      if (is_object($fInfo)) {
+        $heading[] = array('text' => '<b>' . TEXT_INFO_NEW_FILE_BOX .  ucfirst(substr_replace ($current_box['admin_box_name'], '', -4)) . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&action=store_file') . '">' . tep_image_button('button_admin_files.gif', IMAGE_INSERT_FILE) . '</a> <a href="' . tep_href_link(FILENAME_ADMIN_FILES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&fID=' . $fInfo->admin_files_id . '&action=remove_file') . '">' . tep_image_button('button_admin_remove.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DEFAULT_FILE_INTRO . ucfirst(substr_replace ($current_box['admin_box_name'], '', -4)));
+      }      
+  }
+  
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/admin_members.php
===================================================================
--- trunk/direct.openmoko.com/admin/admin_members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/admin_members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,552 @@
+<?php
+/*
+  $Id: admin_members.php,v 1.2 2004/03/12 18:33:12 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  
+  $current_boxes = DIR_FS_ADMIN . DIR_WS_BOXES;
+  
+  if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+      case 'member_new':
+        $check_email_query = tep_db_query("select admin_email_address from " . TABLE_ADMIN . "");
+        while ($check_email = tep_db_fetch_array($check_email_query)) {
+          $stored_email[] = $check_email['admin_email_address'];
+        }
+        
+        if (in_array($HTTP_POST_VARS['admin_email_address'], $stored_email)) {
+          tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . 'mID=' . $HTTP_GET_VARS['mID'] . '&error=email&action=new_member'));
+        } else {
+          function randomize() {
+            $salt = "abchefghjkmnpqrstuvwxyz0123456789";
+            srand((double)microtime()*1000000); 
+            $i = 0;
+          while ($i <= 7) {
+        $num = rand() % 33;
+        $tmp = substr($salt, $num, 1);
+        $pass = $pass . $tmp;
+        $i++;
+        }
+        return $pass;
+          }
+          $makePassword = randomize();
+        
+          $sql_data_array = array('admin_groups_id' => tep_db_prepare_input($HTTP_POST_VARS['admin_groups_id']),
+                                  'admin_firstname' => tep_db_prepare_input($HTTP_POST_VARS['admin_firstname']),
+                                  'admin_lastname' => tep_db_prepare_input($HTTP_POST_VARS['admin_lastname']),
+                                  'admin_email_address' => tep_db_prepare_input($HTTP_POST_VARS['admin_email_address']),
+                                  'admin_password' => tep_encrypt_password($makePassword),
+                                  'admin_created' => 'now()');
+        
+          tep_db_perform(TABLE_ADMIN, $sql_data_array);
+          $admin_id = tep_db_insert_id();
+        
+          tep_mail($HTTP_POST_VARS['admin_firstname'] . ' ' . $HTTP_POST_VARS['admin_lastname'], $HTTP_POST_VARS['admin_email_address'], ADMIN_EMAIL_SUBJECT, sprintf(ADMIN_EMAIL_TEXT, $HTTP_POST_VARS['admin_firstname'], HTTP_SERVER . DIR_WS_ADMIN, $HTTP_POST_VARS['admin_email_address'], $makePassword, STORE_OWNER), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+        
+          tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $admin_id));
+        }
+        break;
+      case 'member_edit':
+        $admin_id = tep_db_prepare_input($HTTP_POST_VARS['admin_id']);
+        $hiddenPassword = '-hidden-';
+        $stored_email[] = 'NONE';
+        
+        $check_email_query = tep_db_query("select admin_email_address from " . TABLE_ADMIN . " where admin_id <> " . $admin_id . "");
+        while ($check_email = tep_db_fetch_array($check_email_query)) {
+          $stored_email[] = $check_email['admin_email_address'];
+        }
+        
+        if (in_array($HTTP_POST_VARS['admin_email_address'], $stored_email)) {
+          tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . 'mID=' . $HTTP_GET_VARS['mID'] . '&error=email&action=edit_member'));
+        } else {
+          $sql_data_array = array('admin_groups_id' => tep_db_prepare_input($HTTP_POST_VARS['admin_groups_id']),
+                                  'admin_firstname' => tep_db_prepare_input($HTTP_POST_VARS['admin_firstname']),
+                                  'admin_lastname' => tep_db_prepare_input($HTTP_POST_VARS['admin_lastname']),
+                                  'admin_email_address' => tep_db_prepare_input($HTTP_POST_VARS['admin_email_address']),
+                                  'admin_modified' => 'now()');
+        
+          tep_db_perform(TABLE_ADMIN, $sql_data_array, 'update', 'admin_id = \'' . $admin_id . '\'');
+        
+          tep_mail($HTTP_POST_VARS['admin_firstname'] . ' ' . $HTTP_POST_VARS['admin_lastname'], $HTTP_POST_VARS['admin_email_address'], ADMIN_EMAIL_EDIT_SUBJECT, sprintf(ADMIN_EMAIL_EDIT_TEXT, $HTTP_POST_VARS['admin_firstname'], HTTP_SERVER . DIR_WS_ADMIN, $HTTP_POST_VARS['admin_email_address'], $hiddenPassword, STORE_OWNER), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+          
+          tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $admin_id));
+        }
+        break;
+      case 'member_delete':
+        $admin_id = tep_db_prepare_input($HTTP_POST_VARS['admin_id']);
+        tep_db_query("delete from " . TABLE_ADMIN . " where admin_id = '" . $admin_id . "'");
+        
+        tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'group_define':
+        $selected_checkbox = $HTTP_POST_VARS['groups_to_boxes'];
+        
+        $define_files_query = tep_db_query("select admin_files_id from " . TABLE_ADMIN_FILES . " order by admin_files_id");
+        while ($define_files = tep_db_fetch_array($define_files_query)) {
+          $admin_files_id = $define_files['admin_files_id'];
+          
+          if (in_array ($admin_files_id, $selected_checkbox)) {
+            $sql_data_array = array('admin_groups_id' => tep_db_prepare_input($HTTP_POST_VARS['checked_' . $admin_files_id]));
+            //$set_group_id = $HTTP_POST_VARS['checked_' . $admin_files_id];
+          } else {
+            $sql_data_array = array('admin_groups_id' => tep_db_prepare_input($HTTP_POST_VARS['unchecked_' . $admin_files_id]));
+            //$set_group_id = $HTTP_POST_VARS['unchecked_' . $admin_files_id];
+          }
+          tep_db_perform(TABLE_ADMIN_FILES, $sql_data_array, 'update', 'admin_files_id = \'' . $admin_files_id . '\'');
+        }
+               
+        tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_POST_VARS['admin_groups_id']));
+        break;
+      case 'group_delete':
+        $set_groups_id = tep_db_prepare_input($HTTP_POST_VARS['set_groups_id']);
+        
+        tep_db_query("delete from " . TABLE_ADMIN_GROUPS . " where admin_groups_id = '" . $HTTP_GET_VARS['gID'] . "'");
+        tep_db_query("alter table " . TABLE_ADMIN_FILES . " change admin_groups_id admin_groups_id set( " . $set_groups_id . " ) NOT NULL DEFAULT '1' ");
+        tep_db_query("delete from " . TABLE_ADMIN . " where admin_groups_id = '" . $HTTP_GET_VARS['gID'] . "'");
+               
+        tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=groups'));
+        break;        
+      case 'group_edit':
+        $admin_groups_name = ucwords(strtolower(tep_db_prepare_input($HTTP_POST_VARS['admin_groups_name'])));
+        $name_replace = ereg_replace (" ", "%", $admin_groups_name);
+        
+        if (($admin_groups_name == '' || NULL) || (strlen($admin_groups_name) <= 5) ) {
+          tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS[gID] . '&gName=false&action=action=edit_group'));
+        } else {
+          $check_groups_name_query = tep_db_query("select admin_groups_name as group_name_edit from " . TABLE_ADMIN_GROUPS . " where admin_groups_id <> " . $HTTP_GET_VARS['gID'] . " and admin_groups_name like '%" . $name_replace . "%'");
+          $check_duplicate = tep_db_num_rows($check_groups_name_query);
+          if ($check_duplicate > 0){
+            tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS['gID'] . '&gName=used&action=edit_group'));
+          } else {
+            $admin_groups_id = $HTTP_GET_VARS['gID'];
+            tep_db_query("update " . TABLE_ADMIN_GROUPS . " set admin_groups_name = '" . $admin_groups_name . "' where admin_groups_id = '" . $admin_groups_id . "'");
+            tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $admin_groups_id));
+          }
+        }
+        break;              
+      case 'group_new':
+        $admin_groups_name = ucwords(strtolower(tep_db_prepare_input($HTTP_POST_VARS['admin_groups_name'])));
+        $name_replace = ereg_replace (" ", "%", $admin_groups_name);
+        
+        if (($admin_groups_name == '' || NULL) || (strlen($admin_groups_name) <= 5) ) {
+          tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS[gID] . '&gName=false&action=new_group'));
+        } else {
+          $check_groups_name_query = tep_db_query("select admin_groups_name as group_name_new from " . TABLE_ADMIN_GROUPS . " where admin_groups_name like '%" . $name_replace . "%'");
+          $check_duplicate = tep_db_num_rows($check_groups_name_query);
+          if ($check_duplicate > 0){
+            tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS['gID'] . '&gName=used&action=new_group'));
+          } else {
+            $sql_data_array = array('admin_groups_name' => $admin_groups_name);
+            tep_db_perform(TABLE_ADMIN_GROUPS, $sql_data_array);
+            $admin_groups_id = tep_db_insert_id();
+
+            $set_groups_id = tep_db_prepare_input($HTTP_POST_VARS['set_groups_id']);
+            $add_group_id = $set_groups_id . ',\'' . $admin_groups_id . '\'';
+            tep_db_query("alter table " . TABLE_ADMIN_FILES . " change admin_groups_id admin_groups_id set( " . $add_group_id . ") NOT NULL DEFAULT '1' ");
+            
+            tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $admin_groups_id));
+          }
+        }
+        break;        
+    }
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php require('includes/account_check.js.php'); ?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->    
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top">
+<?php
+ if ($HTTP_GET_VARS['gPath']) {
+   $group_name_query = tep_db_query("select admin_groups_name from " . TABLE_ADMIN_GROUPS . " where admin_groups_id = " . $HTTP_GET_VARS['gPath']);
+   $group_name = tep_db_fetch_array($group_name_query);
+  
+   if ($HTTP_GET_VARS['gPath'] == 1) {
+     echo tep_draw_form('defineForm', FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS['gPath']);
+   } elseif ($HTTP_GET_VARS['gPath'] != 1) {
+     echo tep_draw_form('defineForm', FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS['gPath'] . '&action=group_define', 'post', 'enctype="multipart/form-data"');
+     echo tep_draw_hidden_field('admin_groups_id', $HTTP_GET_VARS['gPath']); 
+   }
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td colspan=2 class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_GROUPS_DEFINE; ?></td>
+              </tr>
+<?php
+  $db_boxes_query = tep_db_query("select admin_files_id as admin_boxes_id, admin_files_name as admin_boxes_name, admin_groups_id as boxes_group_id from " . TABLE_ADMIN_FILES . " where admin_files_is_boxes = '1' order by admin_files_name");
+  while ($group_boxes = tep_db_fetch_array($db_boxes_query)) {
+    $group_boxes_files_query = tep_db_query("select admin_files_id, admin_files_name, admin_groups_id from " . TABLE_ADMIN_FILES . " where admin_files_is_boxes = '0' and admin_files_to_boxes = '" . $group_boxes['admin_boxes_id'] . "' order by admin_files_name");
+
+    $selectedGroups = $group_boxes['boxes_group_id'];
+    $groupsArray = explode(",", $selectedGroups);
+
+    if (in_array($HTTP_GET_VARS['gPath'], $groupsArray)) {     
+      $del_boxes = array($HTTP_GET_VARS['gPath']);
+      $result = array_diff ($groupsArray, $del_boxes);
+      sort($result);
+      $checkedBox = $selectedGroups;
+      $uncheckedBox = implode (",", $result);
+      $checked = true;
+    } else {
+      $add_boxes = array($HTTP_GET_VARS['gPath']);
+      $result = array_merge ($add_boxes, $groupsArray);
+      sort($result);
+      $checkedBox = implode (",", $result);
+      $uncheckedBox = $selectedGroups;
+      $checked = false;
+    }    
+?>
+              <tr class="dataTableRowBoxes">
+                <td class="dataTableContent" width="23"><?php echo tep_draw_checkbox_field('groups_to_boxes[]', $group_boxes['admin_boxes_id'], $checked, '', 'id="groups_' . $group_boxes['admin_boxes_id'] . '" onClick="checkGroups(this)"'); ?></td>
+                <td class="dataTableContent"><b><?php echo ucwords(substr_replace ($group_boxes['admin_boxes_name'], '', -4)) . ' ' . tep_draw_hidden_field('checked_' . $group_boxes['admin_boxes_id'], $checkedBox) . tep_draw_hidden_field('unchecked_' . $group_boxes['admin_boxes_id'], $uncheckedBox); ?></b></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent">&nbsp;</td>
+                <td class="dataTableContent">
+                  <table border="0" cellspacing="0" cellpadding="0">
+<?php
+     //$group_boxes_files_query = tep_db_query("select admin_files_id, admin_files_name, admin_groups_id from " . TABLE_ADMIN_FILES . " where admin_files_is_boxes = '0' and admin_files_to_boxes = '" . $group_boxes['admin_boxes_id'] . "' order by admin_files_name");
+     while($group_boxes_files = tep_db_fetch_array($group_boxes_files_query)) {
+       $selectedGroups = $group_boxes_files['admin_groups_id'];
+       $groupsArray = explode(",", $selectedGroups);
+
+       if (in_array($HTTP_GET_VARS['gPath'], $groupsArray)) {     
+         $del_boxes = array($HTTP_GET_VARS['gPath']);
+         $result = array_diff ($groupsArray, $del_boxes);
+         sort($result);
+         $checkedBox = $selectedGroups;
+         $uncheckedBox = implode (",", $result);
+         $checked = true;
+       } else {
+         $add_boxes = array($HTTP_GET_VARS['gPath']);
+         $result = array_merge ($add_boxes, $groupsArray);
+         sort($result);
+         $checkedBox = implode (",", $result);
+         $uncheckedBox = $selectedGroups;
+         $checked = false;
+       }
+?>
+                                       
+                    <tr>
+                      <td width="20"><?php echo tep_draw_checkbox_field('groups_to_boxes[]', $group_boxes_files['admin_files_id'], $checked, '', 'id="subgroups_' . $group_boxes['admin_boxes_id'] . '" onClick="checkSub(this)"'); ?></td>
+                      <td class="dataTableContent"><?php echo $group_boxes_files['admin_files_name'] . ' ' . tep_draw_hidden_field('checked_' . $group_boxes_files['admin_files_id'], $checkedBox) . tep_draw_hidden_field('unchecked_' . $group_boxes_files['admin_files_id'], $uncheckedBox);?></td>
+                    </tr>
+<?php       
+     }
+?>
+                  </table>
+                </td>
+              </tr>              
+<?php
+  }
+?>
+              <tr class="dataTableRowBoxes">
+                <td colspan=2 class="dataTableContent" valign="top" align="right"><?php if ($HTTP_GET_VARS['gPath'] != 1) { echo  '<a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS['gPath']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . tep_image_submit('button_save.gif', IMAGE_INSERT); } else { echo tep_image_submit('button_back.gif', IMAGE_BACK); } ?>&nbsp;</td>
+              </tr>
+            </table></form>
+<?php
+ } elseif ($HTTP_GET_VARS['gID']) {
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_GROUPS_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $db_groups_query = tep_db_query("select * from " . TABLE_ADMIN_GROUPS . " order by admin_groups_id");
+  
+  $add_groups_prepare = '\'0\'' ;
+  $del_groups_prepare = '\'0\'' ;
+  $count_groups = 0;
+  while ($groups = tep_db_fetch_array($db_groups_query)) {
+    $add_groups_prepare .= ',\'' . $groups['admin_groups_id'] . '\'' ;
+    if (((!$HTTP_GET_VARS['gID']) || ($HTTP_GET_VARS['gID'] == $groups['admin_groups_id']) || ($HTTP_GET_VARS['gID'] == 'groups')) && (!$gInfo) ) {
+      $gInfo = new objectInfo($groups);
+    }
+   
+    if ( (is_object($gInfo)) && ($groups['admin_groups_id'] == $gInfo->admin_groups_id) ) {
+      echo '                <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $groups['admin_groups_id'] . '&action=edit_group') . '\'">' . "\n";
+    } else {
+      echo '                <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $groups['admin_groups_id']) . '\'">' . "\n";
+      $del_groups_prepare .= ',\'' . $groups['admin_groups_id'] . '\'' ;
+    }
+?>
+                <td class="dataTableContent">&nbsp;<b><?php echo $groups['admin_groups_name']; ?></b></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($gInfo)) && ($groups['admin_groups_id'] == $gInfo->admin_groups_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $groups['admin_groups_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    $count_groups++;
+  } 
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo TEXT_COUNT_GROUPS . $count_groups; ?></td>
+                    <td class="smallText" valign="top" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $gInfo->admin_groups_id . '&action=new_group') . '">' . tep_image_button('button_admin_group.gif', IMAGE_NEW_GROUP) . '</a>'; ?>&nbsp;</td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table>
+<?php
+ } else {
+?> 
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NAME; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_EMAIL; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_GROUPS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LOGNUM; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $db_admin_query_raw = "select * from " . TABLE_ADMIN . " order by admin_firstname";
+  
+  $db_admin_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $db_admin_query_raw, $db_admin_query_numrows);
+  $db_admin_query = tep_db_query($db_admin_query_raw);
+  //$db_admin_num_row = tep_db_num_rows($db_admin_query);
+  
+  while ($admin = tep_db_fetch_array($db_admin_query)) {
+    $admin_group_query = tep_db_query("select admin_groups_name from " . TABLE_ADMIN_GROUPS . " where admin_groups_id = '" . $admin['admin_groups_id'] . "'");
+    $admin_group = tep_db_fetch_array ($admin_group_query);
+    if (((!$HTTP_GET_VARS['mID']) || ($HTTP_GET_VARS['mID'] == $admin['admin_id'])) && (!$mInfo) ) {
+      $mInfo_array = array_merge($admin, $admin_group);
+      $mInfo = new objectInfo($mInfo_array);
+    }
+   
+    if ( (is_object($mInfo)) && ($admin['admin_id'] == $mInfo->admin_id) ) {
+      echo '                  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $admin['admin_id'] . '&action=edit_member') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $admin['admin_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent">&nbsp;<?php echo $admin['admin_firstname']; ?>&nbsp;<?php echo $admin['admin_lastname']; ?></td>
+                <td class="dataTableContent"><?php echo $admin['admin_email_address']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $admin_group['admin_groups_name']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $admin['admin_lognum']; ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($mInfo)) && ($admin['admin_id'] == $mInfo->admin_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $admin['admin_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  } 
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $db_admin_split->display_count($db_admin_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_MEMBERS); ?><br><?php echo $db_admin_split->display_links($db_admin_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                    <td class="smallText" valign="top" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=groups') . '">' . tep_image_button('button_admin_groups.gif', IMAGE_GROUPS) . '</a>'; echo ' <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->admin_id . '&action=new_member') . '">' . tep_image_button('button_admin_member.gif', IMAGE_NEW_MEMBER) . '</a>'; ?>&nbsp;</td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table>
+<?php
+ }
+?>
+            </td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {  
+    case 'new_member': 
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW . '</b>');
+
+      $contents = array('form' => tep_draw_form('newmember', FILENAME_ADMIN_MEMBERS, 'action=member_new&page=' . $page . 'mID=' . $HTTP_GET_VARS['mID'], 'post', 'enctype="multipart/form-data"')); 
+      if ($HTTP_GET_VARS['error']) {
+        $contents[] = array('text' => TEXT_INFO_ERROR); 
+      }
+      $contents[] = array('text' => '<br>&nbsp;' . TEXT_INFO_FIRSTNAME . '<br>&nbsp;' . tep_draw_input_field('admin_firstname')); 
+      $contents[] = array('text' => '<br>&nbsp;' . TEXT_INFO_LASTNAME . '<br>&nbsp;' . tep_draw_input_field('admin_lastname'));
+      $contents[] = array('text' => '<br>&nbsp;' . TEXT_INFO_EMAIL . '<br>&nbsp;' . tep_draw_input_field('admin_email_address')); 
+      
+      $groups_array = array(array('id' => '0', 'text' => TEXT_NONE));
+      $groups_query = tep_db_query("select admin_groups_id, admin_groups_name from " . TABLE_ADMIN_GROUPS);
+      while ($groups = tep_db_fetch_array($groups_query)) {
+        $groups_array[] = array('id' => $groups['admin_groups_id'],
+                                'text' => $groups['admin_groups_name']);
+      }
+      $contents[] = array('text' => '<br>&nbsp;' . TEXT_INFO_GROUP . '<br>&nbsp;' . tep_draw_pull_down_menu('admin_groups_id', $groups_array, '0')); 
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT, 'onClick="validateForm();return document.returnValue"') . ' <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $HTTP_GET_VARS['mID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');    
+      break;
+    case 'edit_member': 
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW . '</b>');
+      
+      $contents = array('form' => tep_draw_form('newmember', FILENAME_ADMIN_MEMBERS, 'action=member_edit&page=' . $page . '&mID=' . $HTTP_GET_VARS['mID'], 'post', 'enctype="multipart/form-data"')); 
+      if ($HTTP_GET_VARS['error']) {
+        $contents[] = array('text' => TEXT_INFO_ERROR); 
+      }
+      $contents[] = array('text' => tep_draw_hidden_field('admin_id', $mInfo->admin_id)); 
+      $contents[] = array('text' => '<br>&nbsp;' . TEXT_INFO_FIRSTNAME . '<br>&nbsp;' . tep_draw_input_field('admin_firstname', $mInfo->admin_firstname)); 
+      $contents[] = array('text' => '<br>&nbsp;' . TEXT_INFO_LASTNAME . '<br>&nbsp;' . tep_draw_input_field('admin_lastname', $mInfo->admin_lastname));
+      $contents[] = array('text' => '<br>&nbsp;' . TEXT_INFO_EMAIL . '<br>&nbsp;' . tep_draw_input_field('admin_email_address', $mInfo->admin_email_address)); 
+      if ($mInfo->admin_id == $login_id || $mInfo->admin_email_address == STORE_OWNER_EMAIL_ADDRESS) {
+        $contents[] = array('text' => tep_draw_hidden_field('admin_groups_id', $mInfo->admin_groups_id));
+      } else {
+        $groups_array = array(array('id' => '0', 'text' => TEXT_NONE));
+        $groups_query = tep_db_query("select admin_groups_id, admin_groups_name from " . TABLE_ADMIN_GROUPS);
+        while ($groups = tep_db_fetch_array($groups_query)) {
+          $groups_array[] = array('id' => $groups['admin_groups_id'],
+                                  'text' => $groups['admin_groups_name']);
+        }
+        $contents[] = array('text' => '<br>&nbsp;' . TEXT_INFO_GROUP . '<br>&nbsp;' . tep_draw_pull_down_menu('admin_groups_id', $groups_array, $mInfo->admin_groups_id)); 
+      }
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT, 'onClick="validateForm();return document.returnValue"') . ' <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $HTTP_GET_VARS['mID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');    
+      break;
+    case 'del_member': 
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE . '</b>');
+      if ($mInfo->admin_id == $login_id || $mInfo->admin_email_address == STORE_OWNER_EMAIL_ADDRESS) {
+        $contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->admin_id) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a><br>&nbsp;');
+      } else {
+        $contents = array('form' => tep_draw_form('edit', FILENAME_ADMIN_MEMBERS, 'action=member_delete&page=' . $page . '&mID=' . $admin['admin_id'], 'post', 'enctype="multipart/form-data"')); 
+        $contents[] = array('text' => tep_draw_hidden_field('admin_id', $mInfo->admin_id));
+        $contents[] = array('align' => 'center', 'text' =>  sprintf(TEXT_INFO_DELETE_INTRO, $mInfo->admin_firstname . ' ' . $mInfo->admin_lastname));    
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $HTTP_GET_VARS['mID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');    
+      }
+      break;
+    case 'new_group':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_GROUPS . '</b>');
+
+      $contents = array('form' => tep_draw_form('new_group', FILENAME_ADMIN_MEMBERS, 'action=group_new&gID=' . $gInfo->admin_groups_id, 'post', 'enctype="multipart/form-data"')); 
+      if ($HTTP_GET_VARS['gName'] == 'false') {
+        $contents[] = array('text' => TEXT_INFO_GROUPS_NAME_FALSE . '<br>&nbsp;');
+      } elseif ($HTTP_GET_VARS['gName'] == 'used') {
+        $contents[] = array('text' => TEXT_INFO_GROUPS_NAME_USED . '<br>&nbsp;');
+      }
+      $contents[] = array('text' => tep_draw_hidden_field('set_groups_id', substr($add_groups_prepare, 4)) );
+      $contents[] = array('text' => TEXT_INFO_GROUPS_NAME . '<br>');      
+      $contents[] = array('align' => 'center', 'text' => tep_draw_input_field('admin_groups_name'));      
+      $contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $gInfo->admin_groups_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . tep_image_submit('button_next.gif', IMAGE_NEXT) );    
+      break;
+    case 'edit_group': 
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_GROUP . '</b>');
+
+      $contents = array('form' => tep_draw_form('edit_group', FILENAME_ADMIN_MEMBERS, 'action=group_edit&gID=' . $HTTP_GET_VARS['gID'], 'post', 'enctype="multipart/form-data"')); 
+      if ($HTTP_GET_VARS['gName'] == 'false') {
+        $contents[] = array('text' => TEXT_INFO_GROUPS_NAME_FALSE . '<br>&nbsp;');
+      } elseif ($HTTP_GET_VARS['gName'] == 'used') {
+        $contents[] = array('text' => TEXT_INFO_GROUPS_NAME_USED . '<br>&nbsp;');
+      }      
+      $contents[] = array('align' => 'center', 'text' => TEXT_INFO_EDIT_GROUP_INTRO . '<br>&nbsp;<br>' . tep_draw_input_field('admin_groups_name', $gInfo->admin_groups_name)); 
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $gInfo->admin_groups_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');    
+      break;
+    case 'del_group': 
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_GROUPS . '</b>');
+
+      $contents = array('form' => tep_draw_form('delete_group', FILENAME_ADMIN_MEMBERS, 'action=group_delete&gID=' . $gInfo->admin_groups_id, 'post', 'enctype="multipart/form-data"')); 
+      if ($gInfo->admin_groups_id == 1) {
+        $contents[] = array('align' => 'center', 'text' => sprintf(TEXT_INFO_DELETE_GROUPS_INTRO_NOT, $gInfo->admin_groups_name));
+        $contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS['gID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a><br>&nbsp;');
+      } else {
+        $contents[] = array('text' => tep_draw_hidden_field('set_groups_id', substr($del_groups_prepare, 4)) );
+        $contents[] = array('align' => 'center', 'text' => sprintf(TEXT_INFO_DELETE_GROUPS_INTRO, $gInfo->admin_groups_name));    
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS['gID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a><br>&nbsp;');    
+      }
+      break;
+    case 'define_group':      
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DEFINE . '</b>');
+        
+      $contents[] = array('text' => sprintf(TEXT_INFO_DEFINE_INTRO, $group_name['admin_groups_name']));
+      if ($HTTP_GET_VARS['gPath'] == 1) {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $HTTP_GET_VARS['gPath']) . '">' . tep_image_button('button_back.gif', IMAGE_CANCEL) . '</a><br>');      
+      }
+      break;
+    case 'show_group': 
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_GROUP . '</b>');
+        $check_email_query = tep_db_query("select admin_email_address from " . TABLE_ADMIN . "");
+        //$stored_email[];
+        while ($check_email = tep_db_fetch_array($check_email_query)) {
+          $stored_email[] = $check_email['admin_email_address'];
+        }
+        
+        if (in_array($HTTP_POST_VARS['admin_email_address'], $stored_email)) {
+          $checkEmail = "true";
+        } else {
+          $checkEmail = "false";
+        }
+      $contents = array('form' => tep_draw_form('show_group', FILENAME_ADMIN_MEMBERS, 'action=show_group&gID=groups', 'post', 'enctype="multipart/form-data"')); 
+      $contents[] = array('text' => $define_files['admin_files_name'] . tep_draw_input_field('level_edit', $checkEmail)); 
+      //$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $gInfo->admin_groups_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');    
+      break;
+    default:
+      if (is_object($mInfo)) {
+        $heading[] = array('text' => '<b>&nbsp;' . TEXT_INFO_HEADING_DEFAULT . '</b>');
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->admin_id . '&action=edit_member') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->admin_id . '&action=del_member') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br>&nbsp;');
+        $contents[] = array('text' => '&nbsp;<b>' . TEXT_INFO_FULLNAME . '</b><br>&nbsp;' . $mInfo->admin_firstname . ' ' . $mInfo->admin_lastname);
+        $contents[] = array('text' => '&nbsp;<b>' . TEXT_INFO_EMAIL . '</b><br>&nbsp;' . $mInfo->admin_email_address);
+        $contents[] = array('text' => '&nbsp;<b>' . TEXT_INFO_GROUP . '</b>' . $mInfo->admin_groups_name);
+        $contents[] = array('text' => '&nbsp;<b>' . TEXT_INFO_CREATED . '</b><br>&nbsp;' . $mInfo->admin_created);
+        $contents[] = array('text' => '&nbsp;<b>' . TEXT_INFO_MODIFIED . '</b><br>&nbsp;' . $mInfo->admin_modified);
+        $contents[] = array('text' => '&nbsp;<b>' . TEXT_INFO_LOGDATE . '</b><br>&nbsp;' . $mInfo->admin_logdate);
+        $contents[] = array('text' => '&nbsp;<b>' . TEXT_INFO_LOGNUM . '</b>' . $mInfo->admin_lognum);
+        $contents[] = array('text' => '<br>');
+      } elseif (is_object($gInfo)) {
+        $heading[] = array('text' => '<b>&nbsp;' . TEXT_INFO_HEADING_DEFAULT_GROUPS . '</b>');
+        
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gPath=' . $gInfo->admin_groups_id . '&action=define_group') . '">' . tep_image_button('button_admin_permission.gif', IMAGE_FILE_PERMISSION) . '</a> <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $gInfo->admin_groups_id . '&action=edit_group') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ADMIN_MEMBERS, 'gID=' . $gInfo->admin_groups_id . '&action=del_group') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DEFAULT_GROUPS_INTRO . '<br>&nbsp');
+      }
+  }
+  
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>  
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/affiliate_affiliates.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_affiliates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_affiliates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,614 @@
+<?php
+/*
+  $Id: affiliate_affiliates.php,v 1.1.1.1 2004/03/04 23:38:06 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+      case 'update':
+        $affiliate_id = tep_db_prepare_input($HTTP_GET_VARS['acID']);
+        $affiliate_gender = tep_db_prepare_input($HTTP_POST_VARS['affiliate_gender']);
+        $affiliate_firstname = tep_db_prepare_input($HTTP_POST_VARS['affiliate_firstname']);
+        $affiliate_lastname = tep_db_prepare_input($HTTP_POST_VARS['affiliate_lastname']);
+        $affiliate_dob = tep_db_prepare_input($HTTP_POST_VARS['affiliate_dob']);
+        $affiliate_email_address = tep_db_prepare_input($HTTP_POST_VARS['affiliate_email_address']);
+        $affiliate_company = tep_db_prepare_input($HTTP_POST_VARS['affiliate_company']);
+        $affiliate_company_taxid = tep_db_prepare_input($HTTP_POST_VARS['affiliate_company_taxid']);
+        $affiliate_payment_check = tep_db_prepare_input($HTTP_POST_VARS['affiliate_payment_check']);
+        $affiliate_payment_paypal = tep_db_prepare_input($HTTP_POST_VARS['affiliate_payment_paypal']);
+        $affiliate_payment_bank_name = tep_db_prepare_input($HTTP_POST_VARS['affiliate_payment_bank_name']);
+        $affiliate_payment_bank_branch_number = tep_db_prepare_input($HTTP_POST_VARS['affiliate_payment_bank_branch_number']);
+        $affiliate_payment_bank_swift_code = tep_db_prepare_input($HTTP_POST_VARS['affiliate_payment_bank_swift_code']);
+        $affiliate_payment_bank_account_name = tep_db_prepare_input($HTTP_POST_VARS['affiliate_payment_bank_account_name']);
+        $affiliate_payment_bank_account_number = tep_db_prepare_input($HTTP_POST_VARS['affiliate_payment_bank_account_number']);
+        $affiliate_street_address = tep_db_prepare_input($HTTP_POST_VARS['affiliate_street_address']);
+        $affiliate_suburb = tep_db_prepare_input($HTTP_POST_VARS['affiliate_suburb']);
+        $affiliate_postcode=tep_db_prepare_input($HTTP_POST_VARS['affiliate_postcode']);
+        $affiliate_city = tep_db_prepare_input($HTTP_POST_VARS['affiliate_city']);
+        $affiliate_country_id=tep_db_prepare_input($HTTP_POST_VARS['affiliate_country_id']);
+        $affiliate_telephone=tep_db_prepare_input($HTTP_POST_VARS['affiliate_telephone']);
+        $affiliate_fax=tep_db_prepare_input($HTTP_POST_VARS['affiliate_fax']);
+        $affiliate_homepage=tep_db_prepare_input($HTTP_POST_VARS['affiliate_homepage']);
+        $affiliate_state = tep_db_prepare_input($HTTP_POST_VARS['affiliate_state']);
+        $affiliatey_zone_id = tep_db_prepare_input($HTTP_POST_VARS['affiliate_zone_id']);
+        $affiliate_commission_percent = tep_db_prepare_input($HTTP_POST_VARS['affiliate_commission_percent']);
+        if ($affiliate_zone_id > 0) $affiliate_state = '';
+        // If someone uses , instead of .
+        $affiliate_commission_percent = str_replace (',' , '.' , $affiliate_commission_percent);
+
+        $sql_data_array = array('affiliate_firstname' => $affiliate_firstname,
+                                'affiliate_lastname' => $affiliate_lastname,
+                                'affiliate_email_address' => $affiliate_email_address,
+                                'affiliate_payment_check' => $affiliate_payment_check,
+                                'affiliate_payment_paypal' => $affiliate_payment_paypal,
+                                'affiliate_payment_bank_name' => $affiliate_payment_bank_name,
+                                'affiliate_payment_bank_branch_number' => $affiliate_payment_bank_branch_number,
+                                'affiliate_payment_bank_swift_code' => $affiliate_payment_bank_swift_code,
+                                'affiliate_payment_bank_account_name' => $affiliate_payment_bank_account_name,
+                                'affiliate_payment_bank_account_number' => $affiliate_payment_bank_account_number,
+                                'affiliate_street_address' => $affiliate_street_address,
+                                'affiliate_postcode' => $affiliate_postcode,
+                                'affiliate_city' => $affiliate_city,
+                                'affiliate_country_id' => $affiliate_country_id,
+                                'affiliate_telephone' => $affiliate_telephone,
+                                'affiliate_fax' => $affiliate_fax,
+                                'affiliate_homepage' => $affiliate_homepage,
+                                'affiliate_commission_percent' => $affiliate_commission_percent,
+                                'affiliate_agb' => '1');
+
+        if (ACCOUNT_DOB == 'true') $sql_data_array['affiliate_dob'] = tep_date_raw($affiliate_dob);
+        if (ACCOUNT_GENDER == 'true') $sql_data_array['affiliate_gender'] = $affiliate_gender;
+        if (ACCOUNT_COMPANY == 'true') {
+          $sql_data_array['affiliate_company'] = $affiliate_company;
+          $sql_data_array['affiliate_company_taxid'] =  $affiliate_company_taxid;
+        }
+        if (ACCOUNT_SUBURB == 'true') $sql_data_array['affiliate_suburb'] = $affiliate_suburb;
+        if (ACCOUNT_STATE == 'true') {
+          $sql_data_array['affiliate_state'] = $affiliate_state;
+          $sql_data_array['affiliate_zone_id'] = $affiliate_zone_id;
+        }
+
+        $sql_data_array['affiliate_date_account_last_modified'] = 'now()';
+
+        tep_db_perform(TABLE_AFFILIATE, $sql_data_array, 'update', "affiliate_id = '" . tep_db_input($affiliate_id) . "'");
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $affiliate_id));
+        break;
+      case 'deleteconfirm':
+        $affiliate_id = tep_db_prepare_input($HTTP_GET_VARS['acID']);
+
+        affiliate_delete(tep_db_input($affiliate_id)); 
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')))); 
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php
+  if ($HTTP_GET_VARS['action'] == 'edit') {
+?>
+<script language="javascript"><!--
+function resetStateText(theForm) {
+  theForm.affiliate_state.value = '';
+  if (theForm.affiliate_zone_id.options.length > 1) {
+    theForm.affiliate_state.value = '<?php echo JS_STATE_SELECT; ?>';
+  }
+}
+
+function resetZoneSelected(theForm) {
+  if (theForm.affiliate_state.value != '') {
+    theForm.affiliate_zone_id.selectedIndex = '0';
+    if (theForm.affiliate_zone_id.options.length > 1) {
+      theForm.affiliate_state.value = '<?php echo JS_STATE_SELECT; ?>';
+    }
+  }
+}
+
+function update_zone(theForm) {
+  var NumState = theForm.affiliate_zone_id.options.length;
+  var SelectedCountry = '';
+
+  while(NumState > 0) {
+    NumState--;
+    theForm.affiliate_zone_id.options[NumState] = null;
+  }
+
+  SelectedCountry = theForm.affiliate_country_id.options[theForm.affiliate_country_id.selectedIndex].value;
+
+<?php echo tep_js_zone_list('SelectedCountry', 'theForm', 'affiliate_zone_id'); ?>
+
+  resetStateText(theForm);
+}
+
+function check_form() {
+  var error = 0;
+  var error_message = "<?php echo JS_ERROR; ?>";
+
+  var affiliate_firstname = document.affiliate.affiliate_firstname.value;
+  var affiliate_lastname = document.affiliate.affiliate_lastname.value;
+<?php if (ACCOUNT_COMPANY == 'true') echo 'var affiliate_company = document.affiliate.affiliate_company.value;' . "\n"; ?>
+  var affiliate_email_address = document.affiliate.affiliate_email_address.value;  
+  var affiliate_street_address = document.affiliate.affiliate_street_address.value;
+  var affiliate_postcode = document.affiliate.affiliate_postcode.value;
+  var affiliate_city = document.affiliate.affiliate_city.value;
+  var affiliate_telephone = document.affiliate.affiliate_telephone.value;
+
+<?php if (ACCOUNT_GENDER == 'true') { ?>
+  if (document.affiliate.affiliate_gender[0].checked || document.affiliate.affiliate_gender[1].checked) {
+  } else {
+    error_message = error_message + "<?php echo JS_GENDER; ?>";
+    error = 1;
+  }
+<?php } ?>
+
+  if (affiliate_firstname = "" || affiliate_firstname.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_FIRST_NAME; ?>";
+    error = 1;
+  }
+
+  if (affiliate_lastname = "" || affiliate_lastname.length < <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_LAST_NAME; ?>";
+    error = 1;
+  }
+
+  if (affiliate_email_address = "" || affiliate_email_address.length < <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_EMAIL_ADDRESS; ?>";
+    error = 1;
+  }
+
+  if (affiliate_street_address = "" || affiliate_street_address.length < <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_ADDRESS; ?>";
+    error = 1;
+  }
+
+  if (affiliate_postcode = "" || affiliate_postcode.length < <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_POST_CODE; ?>";
+    error = 1;
+  }
+
+  if (affiliate_city = "" || affiliate_city.length < <?php echo ENTRY_CITY_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_CITY; ?>";
+    error = 1;
+  }
+
+<?php if (ACCOUNT_STATE == 'true') { ?>
+  if (document.affiliate.affiliate_zone_id.options.length <= 1) {
+    if (document.affiliate.affiliate_state.value == "" || document.affiliate.affiliate_state.length < 4 ) {
+       error_message = error_message + "<?php echo JS_STATE; ?>";
+       error = 1;
+    }
+  } else {
+    document.affiliate.affiliate_state.value = '';
+    if (document.affiliate.affiliate_zone_id.selectedIndex == 0) {
+       error_message = error_message + "<?php echo JS_ZONE; ?>";
+       error = 1;
+    }
+  }
+<?php } ?>
+
+  if (document.affiliate.affiliate_country_id.value == 0) {
+    error_message = error_message + "<?php echo JS_COUNTRY; ?>";
+    error = 1;
+  }
+
+  if (affiliate_telephone = "" || affiliate_telephone.length < <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_TELEPHONE; ?>";
+    error = 1;
+  }
+
+  if (error == 1) {
+    alert(error_message);
+    return false;
+  } else {
+    return true;
+  }
+}
+//--></script>
+<?php
+  }
+?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ($HTTP_GET_VARS['action'] == 'edit') {
+    $affiliate_query = tep_db_query("select * from " . TABLE_AFFILIATE . " where affiliate_id = '" . $HTTP_GET_VARS['acID'] . "'");
+    $affiliate = tep_db_fetch_array($affiliate_query);
+    $aInfo = new objectInfo($affiliate);
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('affiliate', FILENAME_AFFILIATE, tep_get_all_get_params(array('action')) . 'action=update', 'post', 'onSubmit="return check_form();"'); ?>
+        <td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+<?php
+    if (ACCOUNT_GENDER == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_GENDER; ?></td>
+            <td class="main"><?php echo tep_draw_radio_field('affiliate_gender', 'm', false, $aInfo->affiliate_gender) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('affiliate_gender', 'f', false, $aInfo->affiliate_gender) . '&nbsp;&nbsp;' . FEMALE; ?></td>
+          </tr>
+<?php
+    }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_firstname', $aInfo->affiliate_firstname, 'maxlength="32"', true); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_lastname', $aInfo->affiliate_lastname, 'maxlength="32"', true); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_email_address', $aInfo->affiliate_email_address, 'maxlength="96"', true); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php
+   if (AFFILATE_INDIVIDUAL_PERCENTAGE == 'true') {
+?>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_COMMISSION; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_COMMISSION; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_commission_percent', $aInfo->affiliate_commission_percent, 'maxlength="5"'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php
+    }
+?>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_COMPANY; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_COMPANY; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_company', $aInfo->affiliate_company, 'maxlength="32"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_COMPANY_TAXID; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_company_taxid', $aInfo->affiliate_company_taxid, 'maxlength="64"'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_PAYMENT_DETAILS; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+<?php
+  if (AFFILIATE_USE_CHECK == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_PAYMENT_CHECK; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_payment_check', $aInfo->affiliate_payment_check, 'maxlength="100"'); ?></td>
+          </tr>
+<?php
+  }
+  if (AFFILIATE_USE_PAYPAL == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_PAYMENT_PAYPAL; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_payment_paypal', $aInfo->affiliate_payment_paypal, 'maxlength="64"'); ?></td>
+          </tr>
+<?php
+  }
+  if (AFFILIATE_USE_BANK == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_PAYMENT_BANK_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_payment_bank_name', $aInfo->affiliate_payment_bank_name, 'maxlength="64"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_payment_bank_branch_number', $aInfo->affiliate_payment_bank_branch_number, 'maxlength="64"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_payment_bank_swift_code', $aInfo->affiliate_payment_bank_swift_code, 'maxlength="64"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_payment_bank_account_name', $aInfo->affiliate_payment_bank_account_name, 'maxlength="64"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_payment_bank_account_number', $aInfo->affiliate_payment_bank_account_number, 'maxlength="64"'); ?></td>
+          </tr>
+<?php
+  }
+?>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_ADDRESS; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_street_address', $aInfo->affiliate_street_address, 'maxlength="64"', true); ?></td>
+          </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_SUBURB; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_suburb', $aInfo->affiliate_suburb, 'maxlength="64"', false); ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_CITY; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_city', $aInfo->affiliate_city, 'maxlength="32"', true); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_postcode', $aInfo->affiliate_postcode, 'maxlength="8"', true); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('affiliate_country_id', tep_get_countries(), $aInfo->affiliate_country_id, 'onChange="update_zone(this.form);"'); ?></td>
+          </tr>
+<?php
+    if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_STATE; ?></td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('affiliate_zone_id', tep_prepare_country_zones_pull_down($aInfo->affiliate_country_id), $aInfo->affiliate_zone_id, 'onChange="resetStateText(this.form);"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;</td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_state', $aInfo->affiliate_state, 'maxlength="32" onChange="resetZoneSelected(this.form);"'); ?></td>
+          </tr>
+<?php
+    }
+?>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_CONTACT; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_telephone', $aInfo->affiliate_telephone, 'maxlength="32"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_fax', $aInfo->affiliate_fax, 'maxlength="32"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_AFFILIATE_HOMEPAGE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_homepage', $aInfo->affiliate_homepage, 'maxlength="64"', true); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+       <tr>
+        <td align="right" class="main"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('action'))) .'">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';?></td>
+      </tr></form>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('search', FILENAME_AFFILIATE, '', 'get'); ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_AFFILIATE_ID; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LASTNAME; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_COMMISSION; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_USERHOMEPAGE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $search = '';
+    if ( ($HTTP_GET_VARS['search']) && (tep_not_null($HTTP_GET_VARS['search'])) ) {
+      $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
+      $search = " where affiliate_id like '" . $keywords . "' or affiliate_firstname like '" . $keywords . "' or affiliate_lastname like '" . $keywords . "' or affiliate_email_address like '" . $keywords . "'";
+    }
+    $affiliate_query_raw = "select * from " . TABLE_AFFILIATE . $search . " order by affiliate_lastname";
+    $affiliate_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, 
+    $affiliate_query_raw, $affiliate_query_numrows);
+    $affiliate_query = tep_db_query($affiliate_query_raw);
+    while ($affiliate = tep_db_fetch_array($affiliate_query)) {
+      $info_query = tep_db_query("select affiliate_commission_percent, affiliate_date_account_created as date_account_created, affiliate_date_account_last_modified as date_account_last_modified, affiliate_date_of_last_logon as date_last_logon, affiliate_number_of_logons as number_of_logons from " . TABLE_AFFILIATE . " where affiliate_id = '" . $affiliate['affiliate_id'] . "'");
+      $info = tep_db_fetch_array($info_query);
+
+      if (((!$HTTP_GET_VARS['acID']) || (@$HTTP_GET_VARS['acID'] == $affiliate['affiliate_id'])) && (!$aInfo)) {
+        $country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . $affiliate['affiliate_country_id'] . "'");
+        $country = tep_db_fetch_array($country_query);
+
+        $affiliate_info = array_merge($country, $info);
+
+        $aInfo_array = array_merge($affiliate, $affiliate_info);
+        $aInfo = new objectInfo($aInfo_array);
+      }
+
+      if ( (is_object($aInfo)) && ($affiliate['affiliate_id'] == $aInfo->affiliate_id) ) {
+        echo '          <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID')) . 'acID=' . $affiliate['affiliate_id']) . '\'">' . "\n";
+      }
+      if (substr($affiliate['affiliate_homepage'],0,7) != "http://") $affiliate['affiliate_homepage']="http://".$affiliate['affiliate_homepage'];
+?>
+                <td class="dataTableContent"><?php echo $affiliate['affiliate_id']; ?></td>        
+                <td class="dataTableContent"><?php echo $affiliate['affiliate_lastname']; ?></td>
+                <td class="dataTableContent"><?php echo $affiliate['affiliate_firstname']; ?></td>
+                <td class="dataTableContent" align="right"><?php if($affiliate['affiliate_commission_percent'] > AFFILIATE_PERCENT) echo $affiliate['affiliate_commission_percent']; else echo  AFFILIATE_PERCENT; ?> %</td>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $affiliate['affiliate_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>'; echo '<a href="' . $affiliate['affiliate_homepage'] . '" target="_blank">' . $affiliate['affiliate_homepage'] . '</a>'; ?></td>
+                <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_STATISTICS, tep_get_all_get_params(array('acID')) . 'acID=' . $affiliate['affiliate_id']) . '">' . tep_image(DIR_WS_ICONS . 'statistics.gif', ICON_STATISTICS) . '</a>&nbsp;'; if ( (is_object($aInfo)) && ($affiliate['affiliate_id'] == $aInfo->affiliate_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID')) . 'acID=' . $affiliate['affiliate_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $affiliate_split->display_count($affiliate_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_AFFILIATES); ?></td>
+                    <td class="smallText" align="right"><?php echo $affiliate_split->display_links($affiliate_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'acID'))); ?></td>
+                  </tr>
+<?php
+    if (tep_not_null($HTTP_GET_VARS['search'])) {
+?>
+                  <tr>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+    case 'confirm':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '</b>');
+
+      $contents = array('form' => tep_draw_form('affiliate', FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO . '<br><br><b>' . $aInfo->affiliate_firstname . ' ' . $aInfo->affiliate_lastname . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($aInfo)) {
+        $heading[] = array('text' => '<b>' . $aInfo->affiliate_firstname . ' ' . $aInfo->affiliate_lastname . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT, 'selected_box=affiliate&affiliate=' . $aInfo->affiliate_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
+
+$affiliate_sales_raw = "select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment 
+from " . TABLE_AFFILIATE_SALES . " a,
+" . TABLE_ORDERS . " o
+where
+o.orders_id = a.affiliate_orders_id and
+o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and
+a.affiliate_id = '" . $aInfo->affiliate_id . "' ";
+        $affiliate_sales_values = tep_db_query($affiliate_sales_raw);
+        $affiliate_sales = tep_db_fetch_array($affiliate_sales_values);
+
+        $contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_CREATED . ' ' . tep_date_short($aInfo->date_account_created));
+        $contents[] = array('text' => '' . TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . tep_date_short($aInfo->date_account_last_modified));
+        $contents[] = array('text' => '' . TEXT_INFO_DATE_LAST_LOGON . ' '  . tep_date_short($aInfo->date_last_logon));
+        $contents[] = array('text' => '' . TEXT_INFO_NUMBER_OF_LOGONS . ' ' . $aInfo->number_of_logons);
+        $contents[] = array('text' => '' . TEXT_INFO_COMMISSION . ' ' . $aInfo->affiliate_commission_percent . ' %');
+        $contents[] = array('text' => '' . TEXT_INFO_COUNTRY . ' ' . $aInfo->countries_name);
+        $contents[] = array('text' => '' . TEXT_INFO_NUMBER_OF_SALES . ' ' . $affiliate_sales['count'],'');
+        $contents[] = array('text' => '' . TEXT_INFO_SALES_TOTAL . ' ' . $currencies->display_price($affiliate_sales['total'],''));
+        $contents[] = array('text' => '' . TEXT_INFO_AFFILIATE_TOTAL . ' ' . $currencies->display_price($affiliate_sales['payment'],''));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,404 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $affiliate_banner_extension = tep_banner_image_extension();
+
+  if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+      case 'setaffiliate_flag':
+        if ( ($HTTP_GET_VARS['affiliate_flag'] == '0') || ($HTTP_GET_VARS['affiliate_flag'] == '1') ) {
+          tep_set_banner_status($HTTP_GET_VARS['abID'], $HTTP_GET_VARS['affiliate_flag']);
+          $messageStack->add_session('search', SUCCESS_BANNER_STATUS_UPDATED, 'success');
+        } else {
+          $messageStack->add_session('search', ERROR_UNKNOWN_STATUS_FLAG, 'error');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $HTTP_GET_VARS['abID']));
+        break;
+      case 'insert':
+      case 'update':
+        $affiliate_banners_id = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_id']);
+        $affiliate_banners_title = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_title']);
+        $affiliate_products_id  = tep_db_prepare_input($HTTP_POST_VARS['affiliate_products_id']);
+// Added Category Banners
+        $affiliate_category_id  = tep_db_prepare_input($HTTP_POST_VARS['affiliate_category_id']);
+// End Category Banners
+        $new_affiliate_banners_group = tep_db_prepare_input($HTTP_POST_VARS['new_affiliate_banners_group']);
+        $affiliate_banners_group = (empty($new_affiliate_banners_group)) ? tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_group']) : $new_affiliate_banners_group;
+        $affiliate_banners_image_target = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_image_target']);
+        $affiliate_html_text = tep_db_prepare_input($HTTP_POST_VARS['affiliate_html_text']);
+        $affiliate_banners_image_local = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_image_local']);
+        $affiliate_banners_image_target = tep_db_prepare_input($HTTP_POST_VARS['affiliate_banners_image_target']);
+        $db_image_location = '';
+
+        $affiliate_banner_error = false;
+        if (empty($affiliate_banners_title)) {
+          $messageStack->add('search', ERROR_BANNER_TITLE_REQUIRED, 'error');
+          $affiliate_banner_error = true;
+        }
+/*      if (empty($affiliate_banners_group)) {
+          $messageStack->add('search', ERROR_BANNER_GROUP_REQUIRED, 'error');
+          $affiliate_banner_error = true;
+        }
+*/
+        if ( ($affiliate_banners_image) && ($affiliate_banners_image != 'none') && (is_uploaded_file($affiliate_banners_image)) ) {
+          if (!is_writeable(DIR_FS_CATALOG_IMAGES . $affiliate_banners_image_target)) {
+            if (is_dir(DIR_FS_CATALOG_IMAGES . $affiliate_banners_image_target)) {
+              $messageStack->add('search', ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
+            } else {
+              $messageStack->add('search', ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
+            }
+            $affiliate_banner_error = true;
+          }
+        }
+
+        if (!$affiliate_banner_error) {
+          if (empty($affiliate_html_text)) {
+            if ( ($affiliate_banners_image) && ($affiliate_banners_image != 'none') && (is_uploaded_file($affiliate_banners_image)) ) {
+              $image_location = DIR_FS_CATALOG_IMAGES . $affiliate_banners_image_target . $affiliate_banners_image_name;
+              copy($affiliate_banners_image, $image_location);
+            }
+            $db_image_location = (!empty($affiliate_banners_image_local)) ? $affiliate_banners_image_local : $affiliate_banners_image_target . $affiliate_banners_image_name;
+          }
+
+          if (!$affiliate_products_id) $affiliate_products_id="0";
+// Added Category Banners
+          if (!$affiliate_category_id) $affiliate_category_id="0";
+// End Category Banners
+            $sql_data_array = array('affiliate_banners_title' => $affiliate_banners_title,
+                                    'affiliate_products_id' => $affiliate_products_id,
+// Added Category Banners
+                                    'affiliate_category_id' => $affiliate_category_id,
+// End Category Banners
+                                    'affiliate_banners_image' => $db_image_location,
+                                    'affiliate_banners_group' => $affiliate_banners_group);
+
+          if ($HTTP_GET_VARS['action'] == 'insert') {
+            $insert_sql_data = array('affiliate_date_added' => 'now()',
+                                     'affiliate_status' => '1');
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+            tep_db_perform(TABLE_AFFILIATE_BANNERS, $sql_data_array);
+            $affiliate_banners_id = tep_db_insert_id();
+
+          // Banner ID 1 is generic Product Banner
+            if ($affiliate_banners_id==1) tep_db_query("update " . TABLE_AFFILIATE_BANNERS . " set affiliate_banners_id = affiliate_banners_id + 1");
+            $messageStack->add_session('search', SUCCESS_BANNER_INSERTED, 'success');
+          } elseif ($HTTP_GET_VARS['action'] == 'update') {
+            $insert_sql_data = array('affiliate_date_status_change' => 'now()');
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+            tep_db_perform(TABLE_AFFILIATE_BANNERS, $sql_data_array, 'update', 'affiliate_banners_id = \'' . $affiliate_banners_id . '\'');
+            $messageStack->add_session('search', SUCCESS_BANNER_UPDATED, 'success');
+          }
+
+          tep_redirect(tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $affiliate_banners_id));
+        } else {
+          $HTTP_GET_VARS['action'] = 'new';
+        }
+        break;
+      case 'deleteconfirm':
+        $affiliate_banners_id = tep_db_prepare_input($HTTP_GET_VARS['abID']);
+        $delete_image = tep_db_prepare_input($HTTP_POST_VARS['delete_image']);
+
+        if ($delete_image == 'on') {
+          $affiliate_banner_query = tep_db_query("select affiliate_banners_image from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . tep_db_input($affiliate_banners_id) . "'");
+          $affiliate_banner = tep_db_fetch_array($affiliate_banner_query);
+          if (is_file(DIR_FS_CATALOG_IMAGES . $affiliate_banner['affiliate_banners_image'])) {
+            if (is_writeable(DIR_FS_CATALOG_IMAGES . $affiliate_banner['affiliate_banners_image'])) {
+              unlink(DIR_FS_CATALOG_IMAGES . $affiliate_banner['affiliate_banners_image']);
+            } else {
+              $messageStack->add_session('search', ERROR_IMAGE_IS_NOT_WRITEABLE, 'error');
+            }
+          } else {
+            $messageStack->add_session('search', ERROR_IMAGE_DOES_NOT_EXIST, 'error');
+          }
+        }
+
+        tep_db_query("delete from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . tep_db_input($affiliate_banners_id) . "'");
+        tep_db_query("delete from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . tep_db_input($affiliate_banners_id) . "'");
+
+        $messageStack->add_session('search', SUCCESS_BANNER_REMOVED, 'success');
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript"><!--
+function popupImageWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=300,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=300,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($HTTP_GET_VARS['action'] == 'new') {
+    $form_action = 'insert';
+    if ($HTTP_GET_VARS['abID']) {
+      $abID = tep_db_prepare_input($HTTP_GET_VARS['abID']);
+      $form_action = 'update';
+
+      $affiliate_banner_query = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . tep_db_input($abID) . "'");
+      $affiliate_banner = tep_db_fetch_array($affiliate_banner_query);
+
+      $abInfo = new objectInfo($affiliate_banner);
+    } elseif ($HTTP_POST_VARS) {
+      $abInfo = new objectInfo($HTTP_POST_VARS);
+    } else {
+      $abInfo = new objectInfo(array());
+    }
+
+    $groups_array = array();
+    $groups_query = tep_db_query("select distinct affiliate_banners_group from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_group");
+    while ($groups = tep_db_fetch_array($groups_query)) {
+      $groups_array[] = array('id' => $groups['affiliate_banners_group'], 'text' => $groups['affiliate_banners_group']);
+    }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('new_banner', FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"'); if ($form_action == 'update') echo tep_draw_hidden_field('affiliate_banners_id', $abID); ?>
+        <td><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_BANNERS_TITLE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_banners_title', $abInfo->affiliate_banners_title, '', true); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_BANNERS_LINKED_PRODUCT; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_products_id', $abInfo->affiliate_products_id, '', false); ?></td>
+          </tr>
+          <tr>
+            <td class="main" colspan=2><?php echo TEXT_BANNERS_LINKED_PRODUCT_NOTE ?></td>
+          </tr>
+          <tr>
+            <td class="main" colspan=2>&nbsp;&nbsp;</b><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_VALIDPRODUCTS) . '\')"><b>' . TEXT_AFFILIATE_VALIDPRODUCTS . '</b></a>'; ?>&nbsp;&nbsp;<?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW;?></td>
+          </tr>
+          <tr>
+            <td class="main" colspan=2><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP;?>
+          </tr>
+<?php  // Added Category Banners - commented out due to no code being present for this feature.   changed to 6.3 feature request.
+?>
+          <!-- tr>
+            <td class="main"><?php echo TEXT_BANNERS_LINKED_CATEGORY; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('affiliate_category_id', $abInfo->affiliate_category_id, '', false); ?></td>
+          </tr>
+          <tr>
+            <td class="main" colspan=2><?php echo TEXT_BANNERS_LINKED_CATEGORY_NOTE ?></td>
+          </tr>
+          <tr>
+            <td class="main" colspan=2>&nbsp;&nbsp;</b><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_VALIDCATS) . '\')"><b>' . TEXT_AFFILIATE_VALIDPRODUCTS . '</b></a>'; ?>&nbsp;&nbsp;<?php echo TEXT_AFFILIATE_CATEGORY_BANNER_VIEW;?></td>
+          </tr -->
+<?php // End Category Banners
+?>
+          <!-- tr>
+            <td class="main" colspan=2><?php echo TEXT_AFFILIATE_CATEGORY_BANNER_HELP;?>
+          </tr -->
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+/*
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_BANNERS_GROUP; ?></td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('affiliate_banners_group', $groups_array, $abInfo->affiliate_banners_group) . TEXT_BANNERS_NEW_GROUP . '<br>' . tep_draw_input_field('new_affiliate_banners_group', '', '', ((sizeof($groups_array) > 0) ? false : true)); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+*/
+?>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_BANNERS_IMAGE; ?></td>
+            <td class="main"><?php echo tep_draw_file_field('affiliate_banners_image') . ' ' . TEXT_BANNERS_IMAGE_LOCAL . '<br>' . DIR_FS_CATALOG_IMAGES . tep_draw_input_field('affiliate_banners_image_local', $abInfo->affiliate_banners_image); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_BANNERS_IMAGE_TARGET; ?></td>
+            <td class="main"><?php echo DIR_FS_CATALOG_IMAGES . tep_draw_input_field('affiliate_banners_image_target'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" align="right" valign="top" nowrap><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $HTTP_GET_VARS['abID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </form></tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_BANNERS; ?></td>
+<?php // Added Category Banners
+?>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CATEGORY_ID; ?></td>
+<?php // End Category Banners
+?>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCT_ID; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATISTICS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $affiliate_banners_query_raw = "select * from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_title, affiliate_banners_group";
+    $affiliate_banners_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $affiliate_banners_query_raw, $affiliate_banners_query_numrows);
+    $affiliate_banners_query = tep_db_query($affiliate_banners_query_raw);
+    while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_query)) {
+      $info_query = tep_db_query("select sum(affiliate_banners_shown) as affiliate_banners_shown, sum(affiliate_banners_clicks) as affiliate_banners_clicks from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . $affiliate_banners['affiliate_banners_id'] . "'");
+      $info = tep_db_fetch_array($info_query);
+
+      if (((!$HTTP_GET_VARS['abID']) || ($HTTP_GET_VARS['abID'] == $affiliate_banners['affiliate_banners_id'])) && (!$abInfo) && (substr($HTTP_GET_VARS['action'], 0, 3) != 'new')) {
+        $abInfo_array = array_merge($affiliate_banners, $info);
+        $abInfo = new objectInfo($abInfo_array);
+      }
+
+      $affiliate_banners_shown = ($info['affiliate_banners_shown'] != '') ? $info['affiliate_banners_shown'] : '0';
+      $affiliate_banners_clicked = ($info['affiliate_banners_clicks'] != '') ? $info['affiliate_banners_clicks'] : '0';
+
+      if ( (is_object($abInfo)) && ($affiliate_banners['affiliate_banners_id'] == $abInfo->affiliate_banners_id) ) {
+        echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_BANNERS,'abID=' . $abInfo->affiliate_banners_id . '&action=new')  . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_BANNERS, 'abID=' . $affiliate_banners['affiliate_banners_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="javascript:popupImageWindow(\'' . FILENAME_AFFILIATE_POPUP_IMAGE . '?banner=' . $affiliate_banners['affiliate_banners_id'] . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_popup.gif', ICON_PREVIEW) . '</a>&nbsp;' . $affiliate_banners['affiliate_banners_title']; ?></td>
+<?php // Added Category Banners
+?>
+                <td class="dataTableContent" align="right"><?php if ($affiliate_banners['affiliate_category_id']>0) echo $affiliate_banners['affiliate_category_id']; else echo '&nbsp;'; ?></td>
+<?php // End Category Banners
+?>
+                <td class="dataTableContent" align="right"><?php if ($affiliate_banners['affiliate_products_id']>0) echo $affiliate_banners['affiliate_products_id']; else echo '&nbsp;'; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $affiliate_banners_shown . ' / ' . $affiliate_banners_clicked; ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($abInfo)) && ($affiliate_banners['affiliate_banners_id'] == $abInfo->affiliate_banners_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $affiliate_banners['affiliate_banners_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $affiliate_banners_split->display_count($affiliate_banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_BANNERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $affiliate_banners_split->display_links($affiliate_banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                  <tr>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&action=new') . '">' . tep_image_button('button_new_banner.gif', IMAGE_NEW_BANNER) . '</a>'; ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . $abInfo->affiliate_banners_title . '</b>');
+
+      $contents = array('form' => tep_draw_form('affiliate_banners', FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $abInfo->affiliate_banners_title . '</b>');
+      if ($abInfo->affiliate_banners_image) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $HTTP_GET_VARS['abID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($abInfo)) {
+        $sql = "select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $abInfo->affiliate_products_id . "' and language_id = '" . $languages_id . "'"; 
+        $product_description_query = tep_db_query($sql);
+        $product_description = tep_db_fetch_array($product_description_query);
+        $heading[] = array('text' => '<b>' . $abInfo->affiliate_banners_title . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'selected_box=affiliate&page=' . $HTTP_GET_VARS['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => $product_description['products_name']);
+        $contents[] = array('text' => '<br>' . TEXT_BANNERS_DATE_ADDED . ' ' . tep_date_short($abInfo->affiliate_date_added));
+        $contents[] = array('text' => '' . sprintf(TEXT_BANNERS_STATUS_CHANGE, tep_date_short($abInfo->affiliate_date_status_change)));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,186 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.1.1.1 2004/03/04 23:38:07 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if ($HTTP_GET_VARS['acID'] > 0) {
+/*
+$affiliate_clickthroughs_raw = "select ac.*, pd.products_name, a.affiliate_firstname, a.affiliate_lastname from
+" . TABLE_AFFILIATE_CLICKTHROUGHS . " ac,
+" . TABLE_PRODUCTS . " p,
+" . TABLE_PRODUCTS_DESCRIPTION . " pd,
+" . TABLE_AFFILIATE . " a
+where
+a.affiliate_id = '" . $HTTP_GET_VARS['acID'] . "' and
+ac.affiliate_id = a.affiliate_id and
+ac.affiliate_products_id = p.products_id and
+pd.products_id = p.products_id and
+pd.language_id = '" . $languages_id . "'
+ORDER BY ac.affiliate_clientdate desc";
+*/
+    $affiliate_clickthroughs_raw = "select ac.*, pd.products_name, a.affiliate_firstname, a.affiliate_lastname from
+" . TABLE_AFFILIATE_CLICKTHROUGHS . " ac left join 
+" . TABLE_PRODUCTS . " p on ac.affiliate_products_id = p.products_id left join
+" . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "',
+" . TABLE_AFFILIATE . " a
+where
+a.affiliate_id = '" . $HTTP_GET_VARS['acID'] . "' and
+ac.affiliate_id = a.affiliate_id
+ORDER BY ac.affiliate_clientdate desc";
+
+    $affiliate_clickthroughs_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $affiliate_clickthroughs_raw, $affiliate_clickthroughs_numrows);
+  } else {
+/*
+$affiliate_clickthroughs_raw = "select ac.*, pd.products_name, a.affiliate_firstname, a.affiliate_lastname from
+" . TABLE_AFFILIATE_CLICKTHROUGHS . " ac,
+" . TABLE_PRODUCTS . " p,
+" . TABLE_PRODUCTS_DESCRIPTION . " pd,
+" . TABLE_AFFILIATE . " a 
+where
+ac.affiliate_products_id = p.products_id and
+pd.products_id = p.products_id and
+pd.language_id = '" . $languages_id . "' and
+ac.affiliate_id = a.affiliate_id
+ORDER BY ac.affiliate_clientdate desc";
+*/
+    $affiliate_clickthroughs_raw = "select ac.*, pd.products_name, a.affiliate_firstname, a.affiliate_lastname from
+" . TABLE_AFFILIATE_CLICKTHROUGHS . " ac left join
+" . TABLE_PRODUCTS . " p on ac.affiliate_products_id = p.products_id left join
+" . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "',
+" . TABLE_AFFILIATE . " a 
+where
+ac.affiliate_id = a.affiliate_id
+ORDER BY ac.affiliate_clientdate desc";
+
+    $affiliate_clickthroughs_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $affiliate_clickthroughs_raw, $affiliate_clickthroughs_numrows);
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+<?php 
+  if ($HTTP_GET_VARS['acID'] > 0) {
+?>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_STATISTICS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+<?php
+  } else {
+?>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+<?php
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_AFFILIATE_USERNAME .'/<br>' . TABLE_HEADING_IPADDRESS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ENTRY_DATE .'/<br>' . TABLE_HEADING_REFERRAL_URL; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CLICKED_PRODUCT; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_BROWSER; ?></td>
+              </tr>
+<?php
+  if ($affiliate_clickthroughs_numrows > 0) {
+    $affiliate_clickthroughs_values = tep_db_query($affiliate_clickthroughs_raw);
+    $number_of_clickthroughs = '0';
+    while ($affiliate_clickthroughs = tep_db_fetch_array($affiliate_clickthroughs_values)) {
+      $number_of_clickthroughs++;
+
+      if ( ($number_of_clickthroughs / 2) == floor($number_of_clickthroughs / 2) ) {
+        echo '                  <tr class="productListing-even">';
+      } else {
+        echo '                  <tr class="productListing-odd">';
+      }
+?>
+                <td class="dataTableContent"><?php echo $affiliate_clickthroughs['affiliate_firstname'] . " " . $affiliate_clickthroughs['affiliate_lastname']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo tep_date_short($affiliate_clickthroughs['affiliate_clientdate']); ?></td>
+<?php
+      if ($affiliate_clickthroughs['affiliate_products_id'] > 0) $link_to = '<a href="' . tep_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id=' . $affiliate_clickthroughs['affiliate_products_id']) . '" target="_blank">' . $affiliate_clickthroughs['products_name'] . '</a>';
+      else $link_to = "Startpage";
+?>
+                <td class="dataTableContent"><?php echo $link_to; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $affiliate_clickthroughs['affiliate_clientbrowser']; ?></td>
+              </tr>
+              <tr>
+                <td class="dataTableContent"><?php echo $affiliate_clickthroughs['affiliate_clientip']; ?></td>
+                <td class="dataTableContent" colspan="3"><?php  echo $affiliate_clickthroughs['affiliate_clientreferer']; ?></td>
+              </tr>
+              <tr>
+                <td class="dataTableContent" colspan="4"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
+              </tr>
+<?php
+    }
+  } else {
+?>
+              <tr class="productListing-odd">
+                <td colspan="7" class="smallText"><?php echo TEXT_NO_CLICKS; ?></td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td class="smallText" colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $affiliate_clickthroughs_split->display_count($affiliate_clickthroughs_numrows,  MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CLICKS); ?></td>
+                    <td class="smallText" align="right"><?php echo $affiliate_clickthroughs_split->display_links($affiliate_clickthroughs_numrows,  MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php');?>

Added: trunk/direct.openmoko.com/admin/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,235 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.1.1.1 2004/03/04 23:38:08 ccwjr Exp $
+
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if ( ($HTTP_GET_VARS['action'] == 'send_email_to_user') && ($HTTP_POST_VARS['affiliate_email_address']) && (!$HTTP_POST_VARS['back_x']) ) {
+    switch ($HTTP_POST_VARS['affiliate_email_address']) {
+      case '***':
+        $mail_query = tep_db_query("select affiliate_firstname, affiliate_lastname, affiliate_email_address from " . TABLE_AFFILIATE . " ");
+        $mail_sent_to = TEXT_ALL_AFFILIATES;
+        break;
+//      case '**D':
+//        $mail_query = tep_db_query("select affiliate_firstname, affiliate_lastname, affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_newsletter = '1'");
+//        $mail_sent_to = TEXT_NEWSLETTER_AFFILIATE;
+//        break;
+      default:
+        $affiliate_email_address = tep_db_prepare_input($HTTP_POST_VARS['affiliate_email_address']);
+
+        $mail_query = tep_db_query("select affiliate_firstname, affiliate_lastname, affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . tep_db_input($affiliate_email_address) . "'");
+        $mail_sent_to = $HTTP_POST_VARS['affiliate_email_address'];
+        break;
+    }
+
+    $from = tep_db_prepare_input($HTTP_POST_VARS['from']);
+    $subject = tep_db_prepare_input($HTTP_POST_VARS['subject']);
+    $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
+
+    // Instantiate a new mail object
+    $mimemessage = new email(array('X-Mailer: osC mailer'));
+
+    // Build the text version
+    $text = strip_tags($text);
+    if (EMAIL_USE_HTML == 'true') {
+      $mimemessage->add_html($message);
+    } else {
+      $mimemessage->add_text($message);
+    }
+
+    // Send message
+    $mimemessage->build_message();
+    while ($mail = tep_db_fetch_array($mail_query)) {
+      $mimemessage->send($mail['affiliate_firstname'] . ' ' . $mail['affiliate_lastname'], $mail['affiliate_email_address'], '', $from, $subject);
+    }
+
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE_CONTACT, 'mail_sent_to=' . urlencode($mail_sent_to)));
+  }
+
+  if ( ($HTTP_GET_VARS['action'] == 'preview') && (!$HTTP_POST_VARS['affiliate_email_address']) ) {
+    $messageStack->add('search', ERROR_NO_AFFILIATE_SELECTED, 'error');
+  }
+
+  if (tep_not_null($HTTP_GET_VARS['mail_sent_to'])) {
+    $messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $HTTP_GET_VARS['mail_sent_to']), 'notice');
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/javascript/menu.js"></script>
+<?php include('includes/javascript/tiny_mce.php');?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ( ($HTTP_GET_VARS['action'] == 'preview') && ($HTTP_POST_VARS['affiliate_email_address']) ) {
+    switch ($HTTP_POST_VARS['affiliate_email_address']) {
+      case '***':
+        $mail_sent_to = TEXT_ALL_AFFILIATES;
+        break;
+//      case '**D':
+//        $mail_sent_to = TEXT_NEWSLETTER_AFFILIATES;
+//        break;
+      default:
+        $mail_sent_to = $HTTP_POST_VARS['affiliate_email_address'];
+        break;
+    }
+?>
+          <tr><?php echo tep_draw_form('mail', FILENAME_AFFILIATE_CONTACT, 'action=send_email_to_user'); ?>
+            <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_AFFILIATE; ?></b><br><?php echo $mail_sent_to; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_FROM; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['from'])); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_SUBJECT; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['subject'])); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_MESSAGE; ?></b><br><?php echo nl2br(htmlspecialchars(stripslashes($HTTP_POST_VARS['message']))); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td>
+<?php
+/* Re-Post all POST'ed variables */
+    reset($HTTP_POST_VARS);
+    while (list($key, $value) = each($HTTP_POST_VARS)) {
+      if (!is_array($HTTP_POST_VARS[$key])) {
+        echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+      }
+    }
+?>
+                <table border="0" width="100%" cellpadding="0" cellspacing="2">
+                  <tr>
+                    <td><?php echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="back"'); ?></td>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </form></tr>
+<?php
+  } else {
+?>
+          <tr><?php echo tep_draw_form('mail', FILENAME_AFFILIATE_CONTACT, 'action=preview'); ?>
+            <td><table border="0" cellpadding="0" cellspacing="2">
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+<?php
+    $affiliate = array();
+    $affiliate[] = array('id' => '', 'text' => TEXT_SELECT_AFFILIATE);
+    $affiliate[] = array('id' => '***', 'text' => TEXT_ALL_AFFILIATES);
+//    $affiliate[] = array('id' => '**D', 'text' => TEXT_NEWSLETTER_AFFILIATES);
+    $mail_query = tep_db_query("select affiliate_email_address, affiliate_firstname, affiliate_lastname from " . TABLE_AFFILIATE . " order by affiliate_lastname");
+    while($affiliate_values = tep_db_fetch_array($mail_query)) {
+      $affiliate[] = array('id' => $affiliate_values['affiliate_email_address'],
+                           'text' => $affiliate_values['affiliate_lastname'] . ', ' . $affiliate_values['affiliate_firstname'] . ' (' . $affiliate_values['affiliate_email_address'] . ')');
+    }
+?>
+              <tr>
+                <td class="main"><?php echo TEXT_AFFILIATE; ?></td>
+                <td><?php echo tep_draw_pull_down_menu('affiliate_email_address', $affiliate, $HTTP_GET_VARS['affiliate']);?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_FROM; ?></td>
+                <td><?php echo tep_draw_input_field('from', AFFILIATE_EMAIL_ADDRESS, 'size="60"'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_SUBJECT; ?></td>
+                <td><?php echo tep_draw_input_field('subject', '', 'size="60"'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td valign="top" class="main"><?php echo TEXT_MESSAGE; ?></td>
+                <td><?php echo tep_draw_textarea_field('message', 'soft', '60', '20','','style="width: 100%" mce_editable="true"'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2" align="right"><?php echo tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
+              </tr>
+            </table></td>
+          </form></tr>
+<?php
+  }
+?>
+<!-- body_text_eof //-->
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/affiliate_invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,135 @@
+<?php
+/*
+  $Id: affiliate_invoice.php,v 1.1.1.1 2004/03/04 23:38:08 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $payments_query = tep_db_query("select * from " . TABLE_AFFILIATE_PAYMENT . " where affiliate_payment_id = '" . $HTTP_GET_VARS['pID'] . "'");
+  $payments = tep_db_fetch_array($payments_query);
+
+  $affiliate_address['firstname'] = $payments['affiliate_firstname'];
+  $affiliate_address['lastname'] = $payments['affiliate_lastname'];
+  $affiliate_address['street_address'] = $payments['affiliate_street_address'];
+  $affiliate_address['suburb'] = $payments['affiliate_suburb'];
+  $affiliate_address['city'] = $payments['affiliate_city'];
+  $affiliate_address['state'] = $payments['affiliate_state'];
+  $affiliate_address['country'] = $payments['affiliate_country'];
+  $affiliate_address['postcode'] = $payments['affiliate_postcode']
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+
+<!-- body_text //-->
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
+        <td class="pageHeading" align="center"><?php echo HEADING_TITLE; ?></td>
+        <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td valign="top"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" valign="top"><b><?php echo TEXT_AFFILIATE; ?></b></td>
+            <td class="main"><?php echo tep_address_format($payments['affiliate_address_format_id'], $affiliate_address, 1, '&nbsp;', '<br>'); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+          </tr>
+        <tr>
+             <td class="main"><b><?php echo TEXT_AFFILIATE_PAYMENT; ?></b></td>
+             <td class="main">&nbsp;<?php echo $currencies->format($payments['affiliate_payment_total']); ?></td>
+          </tr>
+          <tr>
+             <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+          </tr>
+          <tr>
+             <td class="main"><b><?php echo TEXT_AFFILIATE_BILLED; ?></b></td>
+             <td class="main">&nbsp;<?php echo tep_date_short($payments['affiliate_payment_date']); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr class="dataTableHeadingRow">
+        <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_ID; ?></td>
+        <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ORDER_DATE; ?></td>
+        <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_VALUE; ?></td>
+        <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_COMMISSION_RATE; ?></td>
+        <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_COMMISSION_VALUE; ?></td>
+      </tr>
+<?php
+  $affiliate_payment_query = tep_db_query("select * from " . TABLE_AFFILIATE_PAYMENT . " where affiliate_payment_id = '" . $HTTP_GET_VARS['pID'] . "'");
+  $affiliate_payment = tep_db_fetch_array($affiliate_payment_query);
+  $affiliate_sales_query = tep_db_query("select * from " . TABLE_AFFILIATE_SALES . " where affiliate_payment_id = '" . $payments['affiliate_payment_id'] . "' order by affiliate_payment_date desc");
+  while ($affiliate_sales = tep_db_fetch_array($affiliate_sales_query)) {
+?>
+
+      <tr class="dataTableRow">
+        <td class="dataTableContent" align="right" valign="top"><?php echo $affiliate_sales['affiliate_orders_id']; ?></td>
+        <td class="dataTableContent" align="center" valign="top"><?php echo tep_date_short($affiliate_sales['affiliate_date']); ?></td>
+        <td class="dataTableContent" align="right" valign="top"><b><?php echo $currencies->display_price($affiliate_sales['affiliate_value'], ''); ?></b></td>
+        <td class="dataTableContent" align="right" valign="top"><?php echo $affiliate_sales['affiliate_percent']; ?><?php echo ENTRY_PERCENT; ?></td>
+        <td class="dataTableContent" align="right" valign="top"><b><?php echo $currencies->display_price($affiliate_sales['affiliate_payment'], ''); ?></b></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+  </tr>
+  <tr>
+    <td align="right" colspan="5"><table border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td align="right" class="smallText"><?php echo TEXT_SUB_TOTAL; ?></td>
+        <td align="right" class="smallText"><?php echo $currencies->display_price($affiliate_payment['affiliate_payment'], ''); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="smallText"><?php echo TEXT_TAX; ?></td>
+        <td align="right" class="smallText"><?php echo $currencies->display_price($affiliate_payment['affiliate_payment_tax'], ''); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="smallText"><b><?php echo TEXT_TOTAL; ?></b></td>
+        <td align="right" class="smallText"><b><?php echo $currencies->display_price($affiliate_payment['affiliate_payment_total'], ''); ?></b></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>
+<!-- body_text_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php');?>

Added: trunk/direct.openmoko.com/admin/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,374 @@
+<?php
+/*
+  $Id: affiliate_news.php,v 3.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+//  Build language list
+    $languages_array = array();
+    $languages = tep_get_languages();
+    $lng_exists = false;
+    for ($i = 0, $n = sizeof($languages); $i < $n; $i++)
+    {
+        if ($languages[$i]['directory'] == $HTTP_GET_VARS['lngdir']) {
+         $lng_exists = true;
+         $lng_display_id = $languages[$i]['id'];
+        }
+
+        $languages_array[] = array('id' => $languages[$i]['directory'],
+            'text' => $languages[$i]['name']);
+    }
+
+    if (!$lng_exists)
+    {
+        $HTTP_POST_VARS ['lngdir'] = $language;
+        $HTTP_GET_VARS ['lngdir'] = $language;
+    }
+
+  if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+      case 'setflag': //set the status of a news item.
+        if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
+          if ($HTTP_GET_VARS['affiliate_news_id']) {
+            tep_db_query("update " . TABLE_AFFILIATE_NEWS . " set news_status = '" . $HTTP_GET_VARS['flag'] . "' where news_id = '" . $HTTP_GET_VARS['affiliate_news_id'] . "'");
+          }
+        }
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWS, isset($HTTP_GET_VARS['lngdir']) ? 'lngdir=' . $HTTP_GET_VARS['lngdir']:''));
+        break;
+
+      case 'delete_affiliate_news_confirm': //user has confirmed deletion of news article.
+        if ($HTTP_POST_VARS['affiliate_news_id']) {
+          $affiliate_news_id = tep_db_prepare_input($HTTP_POST_VARS['affiliate_news_id']);
+          tep_db_query("delete from " . TABLE_AFFILIATE_NEWS . " where news_id = '" . tep_db_input($affiliate_news_id) . "'");
+          tep_db_query("delete from " . TABLE_AFFILIATE_NEWS_CONTENTS . " where affiliate_news_id = '" . tep_db_input($affiliate_news_id) . "'");
+        }
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWS, isset($HTTP_GET_VARS['lngdir']) ? 'lngdir=' . $HTTP_GET_VARS['lngdir']:''));
+        break;
+
+      case 'insert_affiliate_news': //insert a new news article.
+         $a_headlines_array = $HTTP_POST_VARS['headlines'];
+         $a_contents_array = $HTTP_POST_VARS['contents'];
+         $a_languages_check_array = $HTTP_POST_VARS['a_languages_check'];
+         $languages = tep_get_languages();
+         for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $a_languages_id = $languages[$i]['id'];
+          $a_headlines = $a_headlines_array[$a_languages_id];
+          $a_news = $a_contents_array[$a_languages_id];
+          if ($a_headlines != NULL) {
+           if (!$a_news_id) {
+            $insert_sql_data = array('date_added' => 'now()', //uses the inbuilt mysql function 'now'
+                                     'news_status'     => '1'
+            );
+            tep_db_perform(TABLE_AFFILIATE_NEWS, $insert_sql_data);
+            $a_news_id = tep_db_insert_id(); //not actually used ATM -- just there in case
+           }
+            $sql_data_array = array('affiliate_news_id' =>  tep_db_prepare_input($a_news_id),
+                                   'affiliate_news_languages_id' => tep_db_prepare_input($a_languages_id),
+                                   'affiliate_news_headlines' => tep_db_prepare_input($a_headlines),
+                                   'affiliate_news_contents' => tep_db_prepare_input($a_news)
+            );
+            tep_db_perform(TABLE_AFFILIATE_NEWS_CONTENTS, $sql_data_array);
+          }
+         }
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWS, isset($HTTP_GET_VARS['lngdir']) ? 'lngdir=' . $HTTP_GET_VARS['lngdir']:''));
+        break;
+
+      case 'update_affiliate_news': //user wants to modify a news article.
+        if(isset($HTTP_GET_VARS['affiliate_news_id'])) {
+         $a_news_id = tep_db_prepare_input($HTTP_GET_VARS['affiliate_news_id']);
+         $a_headlines_array = $HTTP_POST_VARS['headlines'];
+         $a_contents_array = $HTTP_POST_VARS['contents'];
+         $a_languages_check_array = $HTTP_POST_VARS['a_languages_check'];
+         $a_delete_lng_news_array = $HTTP_POST_VARS['delete_news'];
+         $a_count_lng_def = $HTTP_POST_VARS['a_count'];
+         $languages = tep_get_languages();
+         for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $a_languages_id = $languages[$i]['id'];
+          $a_headlines = $a_headlines_array[$a_languages_id];
+          $a_news = $a_contents_array[$a_languages_id];
+          if (($a_languages_check_array[$a_languages_id] == 'not_set' and $a_news != '' and $a_headlines != '')) {
+           $insert_sql_data = array('affiliate_news_id' => $a_news_id,
+//                                  'date_added' => 'now()'
+                                    'affiliate_news_languages_id' => tep_db_prepare_input($a_languages_id)
+           );
+           $a_count_lng_def++;
+           $sql_data_array = array('affiliate_news_headlines' => tep_db_prepare_input($a_headlines),
+                                   'affiliate_news_contents'  => tep_db_prepare_input($a_news));
+           $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+           tep_db_perform(TABLE_AFFILIATE_NEWS_CONTENTS, $sql_data_array, 'insert');
+          } else {
+           if ($a_delete_lng_news_array[$a_languages_id] == 1) {
+            tep_db_query('delete from ' . TABLE_AFFILIATE_NEWS_CONTENTS . " where affiliate_news_id = '" . tep_db_prepare_input($a_news_id) . "' and affiliate_news_languages_id = '" . (int)$a_languages_id . "'");
+            if( $a_count_lng_def == 1) {
+             tep_db_query('delete from ' . TABLE_AFFILIATE_NEWS . " where news_id = '" . tep_db_prepare_input($a_news_id) . "'");
+
+            } elseif ($a_count_lng_def > 0 ) {
+             $a_count_lng_def--;
+            }
+           } else {
+           $sql_data_array = array('affiliate_news_headlines' => tep_db_prepare_input($a_headlines),
+                                   'affiliate_news_contents'  => tep_db_prepare_input($a_news));
+           tep_db_perform(TABLE_AFFILIATE_NEWS_CONTENTS, $sql_data_array, 'update', "affiliate_news_id = '" . $a_news_id . "' and affiliate_news_languages_id = '" . (int)$a_languages_id . "'");
+           }
+          }
+         }
+        }
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWS, isset($HTTP_GET_VARS['lngdir']) ? 'lngdir=' . $HTTP_GET_VARS['lngdir']:''));
+        break;
+    }
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/javascript/general.js"></script>
+<script language="javascript" src="includes/javascript/menu.js"></script>
+<?php include('includes/javascript/tiny_mce.php');?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ($HTTP_GET_VARS['action'] == 'new_affiliate_news') { //insert or edit a news item
+
+// npe update begin multilingual 040908
+//      $affiliate_news_query = tep_db_query("se lect news_id, headline, content from " . TABLE_AFFILIATE_NEWS . " where news_id = '" . $HTTP_GET_VARS['affiliate_news_id'] . "' and languages_id ='" . $a_language . "'");
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo TABLE_HEADING_AFFILIATE_NEWS; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('new_affiliate_news', FILENAME_AFFILIATE_NEWS, (isset($HTTP_GET_VARS['affiliate_news_id']) ? 'affiliate_news_id=' . $HTTP_GET_VARS['affiliate_news_id'] . '&action=update_affiliate_news' : 'action=insert_affiliate_news' ). (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:''), 'post', 'enctype="multipart/form-data"'); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+ <?php
+              $languages = tep_get_languages();
+              for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+               $a_languages_id = $languages[$i]['id'];
+               if ( isset($HTTP_GET_VARS['affiliate_news_id']) ) { //editing exsiting news item
+      $affiliate_news_query = tep_db_query("select news_id, affiliate_news_contents_id, affiliate_news_headlines as headline, affiliate_news_contents as content, date_added, news_status from " . TABLE_AFFILIATE_NEWS . ", " . TABLE_AFFILIATE_NEWS_CONTENTS . " where news_id = '" . $HTTP_GET_VARS['affiliate_news_id'] . "' and news_id = affiliate_news_id and affiliate_news_languages_id ='" . $a_languages_id . "'");
+      $affiliate_news = tep_db_fetch_array($affiliate_news_query);
+//      tep_draw_hidden_field('a_languages_check[' . $i . ']', 'set');
+    } else { //adding new news item
+      $affiliate_news = array();
+    }
+    if ($affiliate_news['affiliate_news_contents_id'] == NULL) {
+     echo tep_draw_hidden_field('a_languages_check[' . $a_languages_id . ']', 'not_set' );
+    } else {
+     $a_count_lng_def++;
+    }
+    echo  '<tr><td class="main">' . TEXT_AFFILIATE_NEWS_HEADLINE  . tep_draw_separator('pixel_trans.gif', '24', '15') . '</td>';
+    echo '<td class="main">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('headlines[' . $a_languages_id . ']', $affiliate_news['headline'], '', true) . '</td>'; ?>
+          <td class="main" valign = "top"><?php echo tep_draw_checkbox_field('delete_news[' . $a_languages_id . ']', 1) .  ' ' . TEXT_AFFILIATE_NEWS_CONTENT_DELETE; ?></td>
+          </tr>
+          <tr>
+            <td colspan = 2><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main" valign = "top"><?php echo TEXT_AFFILIATE_NEWS_CONTENT; ?></td>
+            <td class="main"><?php echo tep_draw_textarea_field('contents[' . $a_languages_id . ']', 'soft', '70', '20', stripslashes($affiliate_news['content']),'style="width: 100%" mce_editable="true"'); ?>
+            </td>
+        <td class="main" align="right">
+          <?php
+            isset($HTTP_GET_VARS['affiliate_news_id']) ? $cancel_button = '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'affiliate_news_id=' . $HTTP_GET_VARS['affiliate_news_id']) . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' : $cancel_button = '';
+            echo (isset($HTTP_GET_VARS['affiliate_news_id']) ? tep_image_submit('button_update.gif', IMAGE_UPDATE) : tep_image_submit('button_insert.gif', IMAGE_INSERT) )  . $cancel_button ;
+          ?>
+        </td>
+          </tr>
+          <tr>
+            <td colspan = 2><?php echo tep_draw_separator('pixel_black.gif', '1', '10') .  tep_black_line() . tep_draw_separator('pixel_black.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+              } //end for-language-loop
+              echo tep_draw_hidden_field('a_count', $a_count_lng_def);
+?>
+        </table>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      </form></tr>
+<?php
+
+  } else {
+?>
+
+      </tr>
+      <tr>
+<!-- npe admin begin add language selection to news #add !-->
+
+          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php
+// npe admin begin edit languages on affiliate_news.php 040809 #change
+//          echo tep_draw_form('lng', FILENAME_AFFILIATE_NEWS, '', 'get');
+          echo tep_draw_form('lng', FILENAME_AFFILIATE_NEWS, '', 'get');
+          if (isset($HTTP_GET_VARS[tep_session_name()])) {
+            echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+          }
+          if (isset($HTTP_GET_VARS['page'])) echo tep_draw_hidden_field('page', $HTTP_GET_VARS['page']);
+          if (isset($HTTP_GET_VARS['affiliate_news_id'])) echo tep_draw_hidden_field('affiliate_news_id', $HTTP_GET_VARS['affiliate_news_id']);
+// npe admin end edit languages on edit_textdata.php 040809 #change
+?>            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', HEADING_IMAGE_HEIGHT); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_pull_down_menu('lngdir', $languages_array, '', 'onChange="this.form.submit();"'); ?></td>
+          </form></tr>
+        </table></td>
+
+<!-- npe admin end add language selection to news #add !-->
+
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_AFFILIATE_NEWS_HEADLINE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_AFFILIATE_NEWS_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_AFFILIATE_NEWS_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $rows = 0;
+
+    $affiliate_news_count = 0;
+//<!-- npe admin begin add language selection to news #change !-->
+
+    if (!isset($lng_display_id)) $lng_display_id = $languages_id;
+    $affiliate_news_query = tep_db_query('select news_id, affiliate_news_headlines as headline, affiliate_news_contents as content, news_status from ' . TABLE_AFFILIATE_NEWS . ', ' . TABLE_AFFILIATE_NEWS_CONTENTS . " where news_id = affiliate_news_id and affiliate_news_languages_id = '" . $lng_display_id . "' order by date_added desc");
+
+// <!-- npe admin end add language selection to news #change !-->
+
+    while ($affiliate_news = tep_db_fetch_array($affiliate_news_query)) {
+      $affiliate_news_count++;
+      $rows++;
+
+      if ( ((!$HTTP_GET_VARS['affiliate_news_id']) || (@$HTTP_GET_VARS['affiliate_news_id'] == $affiliate_news['news_id'])) && (!$selected_item) && (substr($HTTP_GET_VARS['action'], 0, 4) != 'new_') ) {
+        $selected_item = $affiliate_news;
+      }
+      if ( (is_array($selected_item)) && ($affiliate_news['news_id'] == $selected_item['news_id']) ) {
+        echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'affiliate_news_id=' . $affiliate_news['news_id']) . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'affiliate_news_id=' . $affiliate_news['news_id']) . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'') . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '&nbsp;' . $affiliate_news['headline']; ?></td>
+                <td class="dataTableContent" align="center">
+<?php
+      if ($affiliate_news['news_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'action=setflag&flag=0&affiliate_news_id=' . $affiliate_news['news_id'] . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'')) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'action=setflag&flag=1&affiliate_news_id=' . $affiliate_news['news_id'])  . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if ($affiliate_news['news_id'] == $HTTP_GET_VARS['affiliate_news_id']) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'affiliate_news_id=' . $affiliate_news['news_id']) . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'') . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+
+?>
+              <tr>
+                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText"><?php echo '<br>' . TEXT_NEWS_ITEMS . '&nbsp;' . $affiliate_news_count; ?></td>
+                    <td align="right" class="smallText"><?php echo '&nbsp;<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'action=new_affiliate_news'  . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'')) . '">' . tep_image_button('button_new_news_item.gif', IMAGE_NEW_NEWS_ITEM) . '</a>'; ?>&nbsp;</td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+    $heading = array();
+    $contents = array();
+    switch ($HTTP_GET_VARS['action']) {
+      case 'delete_affiliate_news': //generate box for confirming a news article deletion
+        $heading[] = array('text'   => '<b>' . TEXT_INFO_HEADING_DELETE_ITEM . '</b>');
+        
+        $contents = array('form'    => tep_draw_form('news', FILENAME_AFFILIATE_NEWS, 'action=delete_affiliate_news_confirm' . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'')) . tep_draw_hidden_field('affiliate_news_id', $HTTP_GET_VARS['affiliate_news_id']));
+        $contents[] = array('text'  => TEXT_DELETE_ITEM_INTRO);
+        $contents[] = array('text'  => '<br><b>' . $selected_item['headline'] . '</b>');
+        
+        $contents[] = array('align' => 'center',
+                            'text'  => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'affiliate_news_id=' . $selected_item['news_id']) . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+
+      default:
+        if ($rows > 0) {
+          if (is_array($selected_item)) { //an item is selected, so make the side box
+            $heading[] = array('text' => '<b>' . $selected_item['headline'] . '</b>');
+
+            $contents[] = array('align' => 'center', 
+                                'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'affiliate_news_id=' . $selected_item['news_id'] . '&action=new_affiliate_news' . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'') ) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, 'affiliate_news_id=' . $selected_item['news_id'] . '&action=delete_affiliate_news' . (isset($HTTP_GET_VARS['lngdir']) ? '&lngdir=' . $HTTP_GET_VARS['lngdir']:'')) . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+            $contents[] = array('text' => '<br>' . $selected_item['content']);
+          }
+        } else { // create category/product info
+          $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');
+
+          $contents[] = array('text' => sprintf(TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS, $parent_categories_name));
+        }
+        break;
+    }
+
+    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+      echo '            <td width="25%" valign="top">' . "\n";
+
+      $box = new box;
+      echo $box->infoBox($heading, $contents);
+
+      echo '            </td>' . "\n";
+    }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/affiliate_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,411 @@
+<?php
+/*
+  $Id: affiliate_newsletters.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'lock':
+      case 'unlock':
+        $affiliate_newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+        $status = (($action == 'lock') ? '1' : '0');
+
+        tep_db_query("update " . TABLE_AFFILIATE_NEWSLETTERS . " set locked = '" . $status . "' where affiliate_newsletters_id = '" . (int)$affiliate_newsletter_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
+        break;
+      case 'insert':
+      case 'update':
+        if (isset($HTTP_POST_VARS['newsletter_id'])) $affiliate_newsletter_id = tep_db_prepare_input($HTTP_POST_VARS['newsletter_id']);
+        $affiliate_newsletter_module = tep_db_prepare_input($HTTP_POST_VARS['module']);
+        $title = tep_db_prepare_input($HTTP_POST_VARS['title']);
+        $content = tep_db_prepare_input($HTTP_POST_VARS['content']);
+
+        $affiliate_newsletter_error = false;
+        if (empty($title)) {
+          $messageStack->add('search', ERROR_NEWSLETTER_TITLE, 'error');
+          $affiliate_newsletter_error = true;
+        }
+
+        if (empty($module)) {
+          $messageStack->add('search', ERROR_NEWSLETTER_MODULE, 'error');
+          $affiliate_newsletter_error = true;
+        }
+
+        if ($affiliate_newsletter_error == false) {
+          $sql_data_array = array('title' => $title,
+                                  'content' => $content,
+                                  'module' => $affiliate_newsletter_module);
+
+          if ($action == 'insert') {
+            $sql_data_array['date_added'] = 'now()';
+            $sql_data_array['status'] = '0';
+            $sql_data_array['locked'] = '0';
+
+            tep_db_perform(TABLE_AFFILIATE_NEWSLETTERS, $sql_data_array);
+            $affiliate_newsletter_id = tep_db_insert_id();
+          } elseif ($action == 'update') {
+            tep_db_perform(TABLE_AFFILIATE_NEWSLETTERS, $sql_data_array, 'update', "affiliate_newsletters_id = '" . (int)$affiliate_newsletter_id . "'");
+          }
+
+          tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'nID=' . $affiliate_newsletter_id));
+        } else {
+          $action = 'new';
+        }
+        break;
+      case 'deleteconfirm':
+        $affiliate_newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+        tep_db_query("delete from " . TABLE_AFFILIATE_NEWSLETTERS . " where affiliate_newsletters_id = '" . (int)$affiliate_newsletter_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'delete':
+      case 'new': if (!isset($HTTP_GET_VARS['nID'])) break;
+      case 'send':
+      case 'confirm_send':
+        $affiliate_newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+        $check_query = tep_db_query("select locked from " . TABLE_AFFILIATE_NEWSLETTERS . " where affiliate_newsletters_id = '" . (int)$affiliate_newsletter_id . "'");
+        $check = tep_db_fetch_array($check_query);
+
+        if ($check['locked'] < 1) {
+          switch ($action) {
+            case 'delete': $error = ERROR_REMOVE_UNLOCKED_NEWSLETTER; break;
+            case 'new': $error = ERROR_EDIT_UNLOCKED_NEWSLETTER; break;
+            case 'send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
+            case 'confirm_send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
+          }
+
+          $messageStack->add_session('search', $error, 'error');
+
+          tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
+        }
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/javascript/general.js"></script>
+<script language="javascript" src="includes/javascript/menu.js"></script>
+<?php include('includes/javascript/tiny_mce.php');?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($action == 'new') {
+    $form_action = 'insert';
+
+    $parameters = array('title' => '',
+                        'content' => '',
+                        'module' => '');
+
+    $nInfo = new objectInfo($parameters);
+
+    if (isset($HTTP_GET_VARS['nID'])) {
+      $form_action = 'update';
+
+      $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+      $affiliate_newsletter_query = tep_db_query("select title, content, module from " . TABLE_AFFILIATE_NEWSLETTERS . " where affiliate_newsletters_id = '" . (int)$nID . "'");
+      $affiliate_newsletter = tep_db_fetch_array($affiliate_newsletter_query);
+
+      $nInfo->objectInfo($affiliate_newsletter);
+    } elseif ($HTTP_POST_VARS) {
+      $nInfo->objectInfo($HTTP_POST_VARS);
+    }
+
+    $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+    $directory_array = array();
+    if ($dir = dir(DIR_WS_MODULES . 'newsletters/')) {
+      while ($file = $dir->read()) {
+        if (!is_dir(DIR_WS_MODULES . 'newsletters/' . $file)) {
+          if (substr($file, strrpos($file, '.')) == $file_extension) {
+            $directory_array[] = $file;
+          }
+        }
+      }
+      sort($directory_array);
+      $dir->close();
+    }
+
+    for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) {
+      $modules_array[] = array('id' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')), 'text' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')));
+    }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('newsletter', FILENAME_AFFILIATE_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'action=' . $form_action); if ($form_action == 'update') echo tep_draw_hidden_field('newsletter_id', $nID); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_NEWSLETTER_MODULE; ?></td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('module', $modules_array, $nInfo->module); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_NEWSLETTER_TITLE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('title', $nInfo->title, '', true); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_NEWSLETTER_CONTENT; ?></td>
+            <td class="main"><?php echo tep_draw_textarea_field('content', 'soft', '100%', '20', $nInfo->content,'style="width: 100%" mce_editable="true"'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" align="right"><?php echo (($form_action == 'insert') ? tep_image_submit('button_save.gif', IMAGE_SAVE) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . (isset($HTTP_GET_VARS['nID']) ? 'nID=' . $HTTP_GET_VARS['nID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </form></tr>
+<?php
+  } elseif ($action == 'preview') {
+    $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+    $affiliate_newsletter_query = tep_db_query("select title, content, module from " . TABLE_AFFILIATE_NEWSLETTERS . " where affiliate_newsletters_id = '" . (int)$nID . "'");
+    $affiliate_newsletter = tep_db_fetch_array($affiliate_newsletter_query);
+
+    $nInfo = new objectInfo($affiliate_newsletter);
+?>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+      <tr>
+        <td><tt><?php echo nl2br($nInfo->content); ?></tt></td>
+      </tr>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+  } elseif ($action == 'send') {
+    $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+    $affiliate_newsletter_query = tep_db_query("select title, content, module from " . TABLE_AFFILIATE_NEWSLETTERS . " where affiliate_newsletters_id = '" . (int)$nID . "'");
+    $affiliate_newsletter = tep_db_fetch_array($affiliate_newsletter_query);
+
+    $nInfo = new objectInfo($affiliate_newsletter);
+
+    include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    $module_name = $nInfo->module;
+    $module = new $module_name($nInfo->title, $nInfo->content);
+?>
+      <tr>
+        <td><?php if ($module->show_choose_audience) { echo $module->choose_audience(); } else { echo $module->confirm(); } ?></td>
+      </tr>
+<?php
+  } elseif ($action == 'confirm') {
+    $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+    $affiliate_newsletter_query = tep_db_query("select title, content, module from " . TABLE_AFFILIATE_NEWSLETTERS . " where affiliate_newsletters_id = '" . (int)$nID . "'");
+    $affiliate_newsletter = tep_db_fetch_array($affiliate_newsletter_query);
+
+    $nInfo = new objectInfo($affiliate_newsletter);
+
+    include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    $module_name = $nInfo->module;
+    $module = new $module_name($nInfo->title, $nInfo->content);
+?>
+      <tr>
+        <td><?php echo $module->confirm(); ?></td>
+      </tr>
+<?php
+  } elseif ($action == 'confirm_send') {
+    $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+    $affiliate_newsletter_query = tep_db_query("select affiliate_newsletters_id, title, content, module from " . TABLE_AFFILIATE_NEWSLETTERS . " where affiliate_newsletters_id = '" . (int)$nID . "'");
+    $affiliate_newsletter = tep_db_fetch_array($affiliate_newsletter_query);
+
+    $nInfo = new objectInfo($affiliate_newsletter);
+
+    include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    $module_name = $nInfo->module;
+    $module = new $module_name($nInfo->title, $nInfo->content);
+?>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'ani_send_email.gif', IMAGE_ANI_SEND_EMAIL); ?></td>
+            <td class="main" valign="middle"><b><?php echo TEXT_PLEASE_WAIT; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  tep_set_time_limit(0);
+  flush();
+  $module->send($nInfo->affiliate_newsletters_id);
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><font color="#ff0000"><b><?php echo TEXT_FINISHED_SENDING_EMAILS; ?></b></font></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NEWSLETTERS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SIZE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_MODULE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SENT; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $affiliate_newsletters_query_raw = "select affiliate_newsletters_id, title, length(content) as content_length, module, date_added, date_sent, status, locked from " . TABLE_AFFILIATE_NEWSLETTERS . " order by date_added desc";
+    $affiliate_newsletters_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $affiliate_newsletters_query_raw, $affiliate_newsletters_query_numrows);
+    $affiliate_newsletters_query = tep_db_query($affiliate_newsletters_query_raw);
+    while ($affiliate_newsletters = tep_db_fetch_array($affiliate_newsletters_query)) {
+    if ((!isset($HTTP_GET_VARS['nID']) || (isset($HTTP_GET_VARS['nID']) && ($HTTP_GET_VARS['nID'] == $affiliate_newsletters['affiliate_newsletters_id']))) && !isset($nInfo) && (substr($action, 0, 3) != 'new')) {
+        $nInfo = new objectInfo($affiliate_newsletters);
+      }
+
+      if (isset($nInfo) && is_object($nInfo) && ($affiliate_newsletters['affiliate_newsletters_id'] == $nInfo->affiliate_newsletters_id) ) {
+        echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->affiliate_newsletters_id . '&action=preview') . '\'">' . "\n";
+      } else {
+        echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $affiliate_newsletters['affiliate_newsletters_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $affiliate_newsletters['affiliate_newsletters_id'] . '&action=preview') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $affiliate_newsletters['title']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo number_format($affiliate_newsletters['content_length']) . ' bytes'; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $affiliate_newsletters['module']; ?></td>
+                <td class="dataTableContent" align="center"><?php if ($affiliate_newsletters['status'] == '1') { echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK); } else { echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS); } ?></td>
+                <td class="dataTableContent" align="center"><?php if ($affiliate_newsletters['locked'] > 0) { echo tep_image(DIR_WS_ICONS . 'locked.gif', ICON_LOCKED); } else { echo tep_image(DIR_WS_ICONS . 'unlocked.gif', ICON_UNLOCKED); } ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($nInfo) && is_object($nInfo) && ($affiliate_newsletters['affiliate_newsletters_id'] == $nInfo->affiliate_newsletters_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $affiliate_newsletters['affiliate_newsletters_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $affiliate_newsletters_split->display_count($affiliate_newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $affiliate_newsletters_split->display_links($affiliate_newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                  <tr>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'action=new') . '">' . tep_image_button('button_new_newsletter.gif', IMAGE_NEW_NEWSLETTER) . '</a>'; ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . $nInfo->title . '</b>');
+
+      $contents = array('form' => tep_draw_form('newsletters', FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->affiliate_newsletters_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $nInfo->title . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($nInfo)) {
+        $heading[] = array('text' => '<b>' . $nInfo->title . '</b>');
+
+        if ($nInfo->locked > 0) {
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->affiliate_newsletters_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->affiliate_newsletters_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->affiliate_newsletters_id . '&action=preview') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->affiliate_newsletters_id . '&action=send') . '">' . tep_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->affiliate_newsletters_id . '&action=unlock') . '">' . tep_image_button('button_unlock.gif', IMAGE_UNLOCK) . '</a>');
+        } else {
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->affiliate_newsletters_id . '&action=preview') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->affiliate_newsletters_id . '&action=lock') . '">' . tep_image_button('button_lock.gif', IMAGE_LOCK) . '</a>');
+        }
+        $contents[] = array('text' => '<br>' . TEXT_NEWSLETTER_DATE_ADDED . ' ' . tep_date_short($nInfo->date_added));
+        if ($nInfo->status == '1') $contents[] = array('text' => TEXT_NEWSLETTER_DATE_SENT . ' ' . tep_date_short($nInfo->date_sent));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,479 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.1.1.1 2004/03/04 23:38:09 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $payments_statuses = array();
+  $payments_status_array = array();
+  $payments_status_query = tep_db_query("select affiliate_payment_status_id, affiliate_payment_status_name from " . TABLE_AFFILIATE_PAYMENT_STATUS . " where affiliate_language_id = '" . $languages_id . "'");
+  while ($payments_status = tep_db_fetch_array($payments_status_query)) {
+    $payments_statuses[] = array('id' => $payments_status['affiliate_payment_status_id'],
+                                 'text' => $payments_status['affiliate_payment_status_name']);
+    $payments_status_array[$payments_status['affiliate_payment_status_id']] = $payments_status['affiliate_payment_status_name'];
+  }
+
+  switch ($HTTP_GET_VARS['action']) {
+    case 'start_billing':
+// Billing can be a lengthy process
+      tep_set_time_limit(0);
+// We are only billing orders which are AFFILIATE_BILLING_TIME days old
+      $time = mktime(1, 1, 1, date("m"), date("d") - AFFILIATE_BILLING_TIME, date("Y"));
+      $oldday = date("Y-m-d", $time);
+// Select all affiliates who earned enough money since last payment
+      $sql="
+        SELECT a.affiliate_id, sum(a.affiliate_payment) as affiliate_payment 
+          FROM " . TABLE_AFFILIATE_SALES . " a, " . TABLE_ORDERS . " o 
+          WHERE a.affiliate_billing_status != 1 and a.affiliate_orders_id = o.orders_id and o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and a.affiliate_date <= '" . $oldday . "' 
+          GROUP by a.affiliate_id 
+          having sum(a.affiliate_payment) >= '" . AFFILIATE_THRESHOLD . "'
+        ";
+      $affiliate_payment_query = tep_db_query($sql);
+
+
+// Start Billing:
+      while ($affiliate_payment = tep_db_fetch_array($affiliate_payment_query)) {
+
+// mysql does not support joins in update (planned in 4.x)
+
+// Get all orders which are AFFILIATE_BILLING_TIME days old
+        $sql="
+        SELECT a.affiliate_orders_id 
+          FROM " . TABLE_AFFILIATE_SALES . " a, " . TABLE_ORDERS . " o 
+          WHERE a.affiliate_billing_status!=1 and a.affiliate_orders_id=o.orders_id and o.orders_status>=" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and a.affiliate_id='" . $affiliate_payment['affiliate_id'] . "' and a.affiliate_date <= '" . $oldday . "'
+        ";
+        $affiliate_orders_query=tep_db_query ($sql);
+        $orders_id ="(";
+        while ($affiliate_orders = tep_db_fetch_array($affiliate_orders_query)) {
+          $orders_id .= $affiliate_orders['affiliate_orders_id'] . ",";
+        }
+        $orders_id = substr($orders_id, 0, -1) .")";
+
+// Set the Sales to Temp State (it may happen that an order happend while billing)
+        $sql="UPDATE " . TABLE_AFFILIATE_SALES . " 
+        set affiliate_billing_status=99 
+          where affiliate_id='" .  $affiliate_payment['affiliate_id'] . "' 
+          and affiliate_orders_id in " . $orders_id . " 
+        ";
+        tep_db_query ($sql);
+
+// Get Sum of payment (Could have changed since last selects);
+        $sql="
+        SELECT sum(affiliate_payment) as affiliate_payment
+          FROM " . TABLE_AFFILIATE_SALES . " 
+          WHERE affiliate_id='" .  $affiliate_payment['affiliate_id'] . "' and  affiliate_billing_status=99 
+        ";
+        $affiliate_billing_query = tep_db_query ($sql);
+        $affiliate_billing = tep_db_fetch_array($affiliate_billing_query);
+
+// Get affiliate Informations
+        $sql="
+          SELECT a.*, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id 
+          from " . TABLE_AFFILIATE . " a, 
+          " . TABLE_ZONES . " z, 
+          " . TABLE_COUNTRIES . " c 
+          WHERE a.affiliate_id = '" . $affiliate_payment['affiliate_id'] . "' and 
+          z.zone_id = a.affiliate_zone_id  and 
+          c.countries_id = a.affiliate_country_id ";
+        $affiliate_query=tep_db_query ($sql);
+        $affiliate = tep_db_fetch_array($affiliate_query);
+
+// Get need tax informations for the affiliate
+        $affiliate_tax_rate = tep_get_affiliate_tax_rate(AFFILIATE_TAX_ID, $affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id']);
+        $affiliate_tax = tep_round(($affiliate_billing['affiliate_payment'] * $affiliate_tax_rate / 100), 2); // Netto-Provision
+        $affiliate_payment_total = $affiliate_billing['affiliate_payment'] + $affiliate_tax;
+// Bill the order
+        $affiliate['affiliate_state'] = tep_get_zone_code($affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id'], $affiliate['affiliate_state']);
+        $sql_data_array = array('affiliate_id' => $affiliate_payment['affiliate_id'],
+                                'affiliate_payment' => $affiliate_billing['affiliate_payment'],
+                                'affiliate_payment_tax' => $affiliate_tax,
+                                'affiliate_payment_total' => $affiliate_payment_total,
+                                'affiliate_payment_date' => 'now()',
+                                'affiliate_payment_status' => '0',
+                                'affiliate_firstname' => $affiliate['affiliate_firstname'],
+                                'affiliate_lastname' => $affiliate['affiliate_lastname'],
+                                'affiliate_street_address' => $affiliate['affiliate_street_address'],
+                                'affiliate_suburb' => $affiliate['affiliate_suburb'],
+                                'affiliate_city' => $affiliate['affiliate_city'],
+                                'affiliate_country' => $affiliate['countries_name'],
+                                'affiliate_postcode' => $affiliate['affiliate_postcode'],
+                                'affiliate_company' => $affiliate['affiliate_company'],
+                                'affiliate_state' => $affiliate['affiliate_state'],
+                                'affiliate_address_format_id' => $affiliate['address_format_id']);
+        tep_db_perform(TABLE_AFFILIATE_PAYMENT, $sql_data_array);
+
+        $insert_id = tep_db_insert_id(); 
+// Set the Sales to Final State 
+        tep_db_query("update " . TABLE_AFFILIATE_SALES . " set affiliate_payment_id = '" . $insert_id . "', affiliate_billing_status = 1, affiliate_payment_date = now() where affiliate_id = '" . $affiliate_payment['affiliate_id'] . "' and affiliate_billing_status = 99");
+
+// Notify Affiliate
+        if (AFFILIATE_NOTIFY_AFTER_BILLING == 'true') {
+          $check_status_query = tep_db_query("select af.affiliate_email_address, ap.affiliate_lastname, ap.affiliate_firstname, ap.affiliate_payment_status, ap.affiliate_payment_date, ap.affiliate_payment_date from " . TABLE_AFFILIATE_PAYMENT . " ap, " . TABLE_AFFILIATE . " af where affiliate_payment_id  = '" . $insert_id . "' and af.affiliate_id = ap.affiliate_id ");
+          $check_status = tep_db_fetch_array($check_status_query);
+          $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_AFFILIATE_PAYMENT_INFO, 'payment_id=' . $insert_id, 'SSL') . "\n" . EMAIL_TEXT_PAYMENT_BILLED . ' ' . tep_date_long($check_status['affiliate_payment_date']) . "\n\n" . EMAIL_TEXT_NEW_PAYMENT;
+          tep_mail($check_status['affiliate_firstname'] . ' ' . $check_status['affiliate_lastname'], $check_status['affiliate_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, AFFILIATE_EMAIL_ADDRESS);
+        }
+      }
+      $messageStack->add_session('search', SUCCESS_BILLING, 'success');
+
+      tep_redirect(tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('action')) . 'action=edit'));
+      break;
+    case 'update_payment':
+      $pID = tep_db_prepare_input($HTTP_GET_VARS['pID']);
+      $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
+
+      $payment_updated = false;
+      $check_status_query = tep_db_query("select af.affiliate_email_address, ap.affiliate_lastname, ap.affiliate_firstname, ap.affiliate_payment_status, ap.affiliate_payment_date, ap.affiliate_payment_date from " . TABLE_AFFILIATE_PAYMENT . " ap, " . TABLE_AFFILIATE . " af where affiliate_payment_id = '" . tep_db_input($pID) . "' and af.affiliate_id = ap.affiliate_id ");
+      $check_status = tep_db_fetch_array($check_status_query);
+      if ($check_status['affiliate_payment_status'] != $status) {
+        tep_db_query("update " . TABLE_AFFILIATE_PAYMENT . " set affiliate_payment_status = '" . tep_db_input($status) . "', affiliate_last_modified = now() where affiliate_payment_id = '" . tep_db_input($pID) . "'");
+        $affiliate_notified = '0';
+// Notify Affiliate
+        if ($HTTP_POST_VARS['notify'] == 'on') {
+          $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER . ' ' . $pID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_AFFILIATE_PAYMENT_INFO, 'payment_id=' . $pID, 'SSL') . "\n" . EMAIL_TEXT_PAYMENT_BILLED . ' ' . tep_date_long($check_status['affiliate_payment_date']) . "\n\n" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $payments_status_array[$status]);
+          tep_mail($check_status['affiliate_firstname'] . ' ' . $check_status['affiliate_lastname'], $check_status['affiliate_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, AFFILIATE_EMAIL_ADDRESS);
+          $affiliate_notified = '1';
+        }
+
+        tep_db_query("insert into " . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " (affiliate_payment_id, affiliate_new_value, affiliate_old_value, affiliate_date_added, affiliate_notified) values ('" . tep_db_input($pID) . "', '" . tep_db_input($status) . "', '" . $check_status['affiliate_payment_status'] . "', now(), '" . $affiliate_notified . "')");
+        $order_updated = true;
+      }
+
+      if ($order_updated) {
+       $messageStack->add_session('search', SUCCESS_PAYMENT_UPDATED, 'success');
+      }
+
+      tep_redirect(tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('action')) . 'action=edit'));
+      break;
+    case 'deleteconfirm':
+      $pID = tep_db_prepare_input($HTTP_GET_VARS['pID']);
+
+      tep_db_query("delete from " . TABLE_AFFILIATE_PAYMENT . " where affiliate_payment_id = '" . tep_db_input($pID) . "'");
+      tep_db_query("delete from " . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " where affiliate_payment_id = '" . tep_db_input($pID) . "'");
+
+      tep_redirect(tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('pID', 'action'))));
+      break;
+  }
+
+  if ( ($HTTP_GET_VARS['action'] == 'edit') && tep_not_null($HTTP_GET_VARS['pID']) ) {
+    $pID = tep_db_prepare_input($HTTP_GET_VARS['pID']);
+    $payments_query = tep_db_query("select p.*,  a.affiliate_payment_check, a.affiliate_payment_paypal, a.affiliate_payment_bank_name, a.affiliate_payment_bank_branch_number, a.affiliate_payment_bank_swift_code, a.affiliate_payment_bank_account_name, a.affiliate_payment_bank_account_number from " .  TABLE_AFFILIATE_PAYMENT . " p, " . TABLE_AFFILIATE . " a where affiliate_payment_id = '" . tep_db_input($pID) . "' and a.affiliate_id = p.affiliate_id");
+    $payments_exists = true;
+    if (!$payments = tep_db_fetch_array($payments_query)) {
+      $payments_exists = false;
+      $messageStack->add(sprintf('search', ERROR_PAYMENT_DOES_NOT_EXIST, $pID), 'error');
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php
+  require(DIR_WS_INCLUDES . 'header.php');
+?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ( ($HTTP_GET_VARS['action'] == 'edit') && ($payments_exists) ) {
+    $affiliate_address['firstname'] = $payments['affiliate_firstname'];
+    $affiliate_address['lastname'] = $payments['affiliate_lastname'];
+    $affiliate_address['street_address'] = $payments['affiliate_street_address'];
+    $affiliate_address['suburb'] = $payments['affiliate_suburb'];
+    $affiliate_address['city'] = $payments['affiliate_city'];
+    $affiliate_address['state'] = $payments['affiliate_state'];
+    $affiliate_address['country'] = $payments['affiliate_country'];
+    $affiliate_address['postcode'] = $payments['affiliate_postcode'];
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td valign="top"><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main" valign="top"><b><?php echo TEXT_AFFILIATE; ?></b></td>
+                <td class="main"><?php echo tep_address_format($payments['affiliate_address_format_id'], $affiliate_address, 1, '&nbsp;', '<br>'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><b><?php echo TEXT_AFFILIATE_PAYMENT; ?></b></td>
+                <td class="main">&nbsp;<?php echo $currencies->format($payments['affiliate_payment_total']); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><b><?php echo TEXT_AFFILIATE_BILLED; ?></b></td>
+                <td class="main">&nbsp;<?php echo tep_date_short($payments['affiliate_payment_date']); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+              </tr>
+              <tr>
+                <td class="main" valign="top"><b><?php echo TEXT_AFFILIATE_PAYING_POSSIBILITIES; ?></b></td>
+                <td class="main"><table border="1" cellspacing="0" cellpadding="5">
+                  <tr>
+<?php
+  if (AFFILIATE_USE_BANK == 'true') {
+?>
+                    <td class="main"  valign="top"><?php echo '<b>' . TEXT_AFFILIATE_PAYMENT_BANK_TRANSFER . '</b><br><br>' . TEXT_AFFILIATE_PAYMENT_BANK_NAME . ' ' . $payments['affiliate_payment_bank_name'] . '<br>' . TEXT_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER . ' ' . $payments['affiliate_payment_bank_branch_number'] . '<br>' . TEXT_AFFILIATE_PAYMENT_BANK_SWIFT_CODE . ' ' . $payments['affiliate_payment_bank_swift_code'] . '<br>' . TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME . ' ' . $payments['affiliate_payment_bank_account_name'] . '<br>' . TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER . ' ' . $payments['affiliate_payment_bank_account_number'] . '<br>'; ?></td>
+<?php
+  }
+  if (AFFILIATE_USE_PAYPAL == 'true') {
+?>
+                    <td class="main"  valign="top"><?php echo '<b>' . TEXT_AFFILIATE_PAYMENT_PAYPAL . '</b><br><br>' . TEXT_AFFILIATE_PAYMENT_PAYPAL_EMAIL . '<br>' . $payments['affiliate_payment_paypal'] . '<br>'; ?></td>
+<?php
+  }
+  if (AFFILIATE_USE_CHECK == 'true') {
+?>
+                    <td class="main"  valign="top"><?php echo '<b>' . TEXT_AFFILIATE_PAYMENT_CHECK . '</b><br><br>' . TEXT_AFFILIATE_PAYMENT_CHECK_PAYEE . '<br>' . $payments['affiliate_payment_check'] . '<br>'; ?></td>
+<?php
+  }
+?>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+<?php echo tep_draw_form('status', FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('action')) . 'action=update_payment'); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo PAYMENT_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $payments_statuses, $payments['affiliate_payment_status']); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><b><?php echo PAYMENT_NOTIFY_AFFILIATE; ?></b><?php echo tep_draw_checkbox_field('notify', '', true); ?></td>
+              </tr>
+            </table></td>
+            <td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
+          </tr>
+        </table></td>
+      </form></tr>
+
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><table border="1" cellspacing="0" cellpadding="5">
+          <tr>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_NEW_VALUE; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_OLD_VALUE; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_AFFILIATE_NOTIFIED; ?></b></td>
+          </tr>
+<?php
+    $affiliate_history_query = tep_db_query("select affiliate_new_value, affiliate_old_value, affiliate_date_added, affiliate_notified from " . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " where affiliate_payment_id = '" . tep_db_input($pID) . "' order by affiliate_status_history_id desc");
+    if (tep_db_num_rows($affiliate_history_query)) {
+      while ($affiliate_history = tep_db_fetch_array($affiliate_history_query)) {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText">' . $payments_status_array[$affiliate_history['affiliate_new_value']] . '</td>' . "\n" .
+             '            <td class="smallText">' . (tep_not_null($affiliate_history['affiliate_old_value']) ? $payments_status_array[$affiliate_history['affiliate_old_value']] : '&nbsp;') . '</td>' . "\n" .
+             '            <td class="smallText" align="center">' . tep_date_short($affiliate_history['affiliate_date_added']) . '</td>' . "\n" .
+             '            <td class="smallText" align="center">';
+        if ($affiliate_history['affiliate_notified'] == '1') {
+          echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK);
+        } else {
+          echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS);
+        }
+        echo '          </tr>' . "\n";
+      }
+    } else {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" colspan="4">' . TEXT_NO_PAYMENT_HISTORY . '</td>' . "\n" .
+             '          </tr>' . "\n";
+    }
+?>
+        </table></td>
+      </tr>
+      <tr>
+        <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_INVOICE, 'pID=' . $HTTP_GET_VARS['pID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, 'pID=' . $pInfo->affiliate_payment_id. '&action=start_billing' ) . '">' . tep_image_button('button_affiliate_billing.gif', IMAGE_AFFILIATE_BILLING) . '</a>'; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr><?php echo tep_draw_form('orders', FILENAME_AFFILIATE_PAYMENT, '', 'get'); 
+                  if (isset($HTTP_GET_VARS[tep_session_name()])) {
+                    echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+                  }
+              ?>
+                <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('sID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>
+              </form></tr>
+              <tr><?php echo tep_draw_form('status', FILENAME_AFFILIATE_PAYMENT, '', 'get'); 
+                  if (isset($HTTP_GET_VARS[tep_session_name()])) {
+                    echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+                  }
+              ?>
+                <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_PAYMENTS)), $payments_statuses), '', 'onChange="this.form.submit();"'); ?></td>
+              </form></tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_AFILIATE_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_NET_PAYMENT; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PAYMENT; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_BILLED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    if ($HTTP_GET_VARS['sID']) {
+      // Search only payment_id by now
+      $sID = tep_db_prepare_input($HTTP_GET_VARS['sID']);
+      $payments_query_raw = "select p.* , s.affiliate_payment_status_name from " . TABLE_AFFILIATE_PAYMENT . " p , " . TABLE_AFFILIATE_PAYMENT_STATUS . " s where p.affiliate_payment_id = '" . tep_db_input($sID) . "' and p.affiliate_payment_status = s.affiliate_payment_status_id and s.affiliate_language_id = '" . $languages_id . "' order by p.affiliate_payment_id DESC";
+    } elseif (is_numeric($HTTP_GET_VARS['status'])) {
+      $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+      $payments_query_raw = "select p.* , s.affiliate_payment_status_name from " . TABLE_AFFILIATE_PAYMENT . " p , " . TABLE_AFFILIATE_PAYMENT_STATUS . " s where s.affiliate_payment_status_id = '" . tep_db_input($status) . "' and p.affiliate_payment_status = s.affiliate_payment_status_id and s.affiliate_language_id = '" . $languages_id . "' order by p.affiliate_payment_id DESC";
+    } else {
+      $payments_query_raw = "select p.* , s.affiliate_payment_status_name from " . TABLE_AFFILIATE_PAYMENT . " p , " . TABLE_AFFILIATE_PAYMENT_STATUS . " s where p.affiliate_payment_status = s.affiliate_payment_status_id and s.affiliate_language_id = '" . $languages_id . "' order by p.affiliate_payment_id DESC";
+    }
+    $payments_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $payments_query_raw, $payments_query_numrows);
+    $payments_query = tep_db_query($payments_query_raw);
+    while ($payments = tep_db_fetch_array($payments_query)) {
+      if (((!$HTTP_GET_VARS['pID']) || ($HTTP_GET_VARS['pID'] == $payments['affiliate_payment_id'])) && (!$pInfo)) {
+        $pInfo = new objectInfo($payments);
+      }
+
+      if ( (is_object($pInfo)) && ($payments['affiliate_payment_id'] == $pInfo->affiliate_payment_id) ) {
+        echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->affiliate_payment_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('pID')) . 'pID=' . $payments['affiliate_payment_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->affiliate_payment_id . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $payments['affiliate_firstname'] . ' ' . $payments['affiliate_lastname']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $currencies->format(strip_tags($payments['affiliate_payment'])); ?></td>
+                <td class="dataTableContent" align="right"><?php echo $currencies->format(strip_tags($payments['affiliate_payment'] + $payments['affiliate_payment_tax'])); ?></td>
+                <td class="dataTableContent" align="center"><?php echo tep_date_short($payments['affiliate_payment_date']); ?></td>
+                <td class="dataTableContent" align="right"><?php echo $payments['affiliate_payment_status_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($pInfo)) && ( $payments['affiliate_payment_id'] == $pInfo->affiliate_payment_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('pID')) . 'pID=' . $payments['affiliate_payment_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $payments_split->display_count($payments_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PAYMENTS); ?></td>
+                    <td class="smallText" align="right"><?php echo $payments_split->display_links($payments_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'pID', 'action'))); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_PAYMENT . '</b>');
+
+      $contents = array('form' => tep_draw_form('payment', FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->affiliate_payment_id. '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(AFFILIATE_PAYMENT, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->affiliate_payment_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($pInfo)) {
+        $heading[] = array('text' => '<b>[' . $pInfo->affiliate_payment_id . ']&nbsp;&nbsp;' . tep_datetime_short($pInfo->affiliate_payment_date) . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->affiliate_payment_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->affiliate_payment_id  . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_INVOICE, 'pID=' . $pInfo->affiliate_payment_id ) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> ');
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td  width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+    require(DIR_WS_INCLUDES . 'footer.php');
+?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/affiliate_popup_image.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_popup_image.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_popup_image.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: affiliate_popup_image.php,v 1.1.1.1 2004/03/04 23:38:09 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  reset($HTTP_GET_VARS);
+  while (list($key, ) = each($HTTP_GET_VARS)) {
+    switch ($key) {
+      case 'banner':
+        $banners_id = tep_db_prepare_input($HTTP_GET_VARS['banner']);
+
+        $banner_query = tep_db_query("select affiliate_banners_title, affiliate_banners_image, affiliate_banners_html_text from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . tep_db_input($banners_id) . "'");
+        $banner = tep_db_fetch_array($banner_query);
+
+        $page_title = $banner['affiliate_banners_title'];
+
+        if ($banner['affiliate_banners_html_text']) {
+          $image_source = $banner['affiliate_banners_html_text'];
+        } elseif ($banner['affiliate_banners_image']) {
+          $image_source = tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $banner['affiliate_banners_image'], $page_title);
+        }
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<title><?php echo $page_title; ?></title>
+<script language="javascript"><!--
+var i=0;
+
+function resize() {
+  if (navigator.appName == 'Netscape') i = 40;
+  window.resizeTo(document.images[0].width + 30, document.images[0].height + 60 - i);
+}
+//--></script>
+</head>
+
+<body onload="resize();">
+
+<?php echo $image_source; ?>
+
+</body>
+
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,166 @@
+<?php
+/*
+  $Id: affiliate_sales.php,v 1.1.1.1 2004/03/04 23:38:09 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  if ($HTTP_GET_VARS['acID'] > 0) {
+
+    $affiliate_sales_raw = "
+      select asale.*, os.orders_status_name as orders_status, a.affiliate_firstname, a.affiliate_lastname
+      from " . TABLE_AFFILIATE_SALES . " asale ,
+           " . TABLE_ORDERS . " o,
+           " . TABLE_ORDERS_STATUS . " os,
+           " . TABLE_AFFILIATE . " a
+      where asale.affiliate_id = '" . $HTTP_GET_VARS['acID'] . "'
+        and a.affiliate_id = '" . $HTTP_GET_VARS['acID'] . "'
+        and asale.affiliate_orders_id = o.orders_id
+        and os.orders_status_id = o.orders_status
+        and language_id = " . $languages_id . "
+      order by affiliate_date desc 
+      ";
+    $affiliate_sales_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $affiliate_sales_raw, $affiliate_sales_numrows);
+
+  } else {
+
+    $affiliate_sales_raw = "
+      select asale.*, os.orders_status_name as orders_status, a.affiliate_firstname, a.affiliate_lastname
+      from " . TABLE_AFFILIATE_SALES . " asale, 
+           " . TABLE_ORDERS . " o,
+           " . TABLE_ORDERS_STATUS . " os,
+           " . TABLE_AFFILIATE . " a
+      where  asale.affiliate_orders_id = o.orders_id
+        and a.affiliate_id = asale.affiliate_id
+        and o.orders_status = os.orders_status_id
+        and language_id = " . $languages_id . "
+      order by affiliate_date desc 
+      ";
+    $affiliate_sales_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $affiliate_sales_raw, $affiliate_sales_numrows);
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+<?php 
+  if ($HTTP_GET_VARS['acID'] > 0) {
+?>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_STATISTICS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+<?php
+  } else {
+?>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+<?php
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="4">
+          <tr class="dataTableHeadingRow">
+            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_AFFILIATE; ?></td>
+            <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_ID; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_VALUE; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PERCENTAGE; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SALES; ?></td>
+            <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
+          </tr>
+<?php
+  if ($affiliate_sales_numrows > 0) {
+    $affiliate_sales_values = tep_db_query($affiliate_sales_raw);
+    $number_of_sales = '0';
+    while ($affiliate_sales = tep_db_fetch_array($affiliate_sales_values)) {
+      $number_of_sales++;
+      if (($number_of_sales / 2) == floor($number_of_sales / 2)) {
+        echo '          <tr class="dataTableRowSelected">';
+      } else {
+        echo '          <tr class="dataTableRow">';
+      }
+
+      $link_to = '<a href="orders.php?action=edit&oID=' . $affiliate_sales['affiliate_orders_id'] . '">' . $affiliate_sales['affiliate_orders_id'] . '</a>';
+?>
+            <td class="dataTableContent"><?php echo $affiliate_sales['affiliate_firstname'] . " ". $affiliate_sales['affiliate_lastname']; ?></td>
+            <td class="dataTableContent" align="center"><?php echo tep_date_short($affiliate_sales['affiliate_date']); ?></td>
+            <td class="dataTableContent" align="right"><?php echo $link_to; ?></td>
+            <td class="dataTableContent" align="right">&nbsp;&nbsp;<?php echo $currencies->display_price($affiliate_sales['affiliate_value'], ''); ?></td>
+            <td class="dataTableContent" align="right"><?php echo $affiliate_sales['affiliate_percent'] . "%" ; ?></td>
+            <td class="dataTableContent" align="right">&nbsp;&nbsp;<?php echo $currencies->display_price($affiliate_sales['affiliate_payment'], ''); ?></td>
+            <td class="dataTableContent" align="center"><?php if ($affiliate_sales['orders_status']) echo $affiliate_sales['orders_status']; else echo TEXT_DELETED_ORDER_BY_ADMIN; ?></td>
+<?php
+    }
+  } else {
+?>
+          <tr class="dataTableRowSelected">
+            <td colspan="7" class="smallText"><?php echo TEXT_NO_SALES; ?></td>
+          </tr>
+<?php
+  }
+  if ($affiliate_sales_numrows > 0 && (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3')) {
+?>
+          <tr>
+            <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php echo $affiliate_sales_split->display_count($affiliate_sales_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SALES); ?></td>
+                <td class="smallText" align="right"><?php echo $affiliate_sales_split->display_links($affiliate_sales_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+<?php
+  }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php');?>

Added: trunk/direct.openmoko.com/admin/affiliate_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,172 @@
+<?php
+/*
+  $Id: affiliate_statistics.php,v 1.1.1.1 2004/03/04 23:38:09 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $affiliate_banner_history_raw = "select sum(affiliate_banners_shown) as count from " . TABLE_AFFILIATE_BANNERS_HISTORY .  " where affiliate_banners_affiliate_id  = '" .  $HTTP_GET_VARS['acID'] . "'";
+  $affiliate_banner_history_query = tep_db_query($affiliate_banner_history_raw);
+  $affiliate_banner_history = tep_db_fetch_array($affiliate_banner_history_query);
+  $affiliate_impressions = $affiliate_banner_history['count'];
+  if ($affiliate_impressions == 0) $affiliate_impressions = "n/a"; 
+  
+  $affiliate_query = tep_db_query("select * from " . TABLE_AFFILIATE . " where affiliate_id ='" . $HTTP_GET_VARS['acID'] . "'");
+ 
+  $affiliate = tep_db_fetch_array($affiliate_query);
+  $affiliate_percent = 0;
+  $affiliate_percent = $affiliate['affiliate_commission_percent'];
+  if ($affiliate_percent < AFFILIATE_PERCENT) $affiliate_percent = AFFILIATE_PERCENT;
+  
+  $affiliate_clickthroughs_raw = "select count(*) as count from " . TABLE_AFFILIATE_CLICKTHROUGHS . " where affiliate_id = '" . $HTTP_GET_VARS['acID'] . "'";
+  $affiliate_clickthroughs_query = tep_db_query($affiliate_clickthroughs_raw);
+  $affiliate_clickthroughs = tep_db_fetch_array($affiliate_clickthroughs_query);
+  $affiliate_clickthroughs = $affiliate_clickthroughs['count'];
+
+  $affiliate_sales_raw = "
+  select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from
+    " . TABLE_AFFILIATE_SALES . " a, 
+    " . TABLE_ORDERS . " o 
+    where a.affiliate_id = '" . $HTTP_GET_VARS['acID'] . "' and
+    o.orders_id = a.affiliate_orders_id and
+    o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . "
+    ";  $affiliate_sales_query = tep_db_query($affiliate_sales_raw);
+  $affiliate_sales = tep_db_fetch_array($affiliate_sales_query);
+
+  $affiliate_transactions=$affiliate_sales['count'];
+  if ($affiliate_clickthroughs > 0) {
+    $affiliate_conversions = tep_round(($affiliate_transactions / $affiliate_clickthroughs)*100,2) . "%";
+  } else {
+    $affiliate_conversions = "n/a";
+  }
+
+  if ($affiliate_sales['total'] > 0) {
+    $affiliate_average = $affiliate_sales['total'] / $affiliate_sales['count'];
+  } else {
+    $affiliate_average = 0;
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=120,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TEXT_SUMMARY_TITLE; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table width="100%" border="0" cellpadding="4" cellspacing="2" class="dataTableContent">
+              <center>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><b><?php echo TEXT_AFFILIATE_NAME; ?></b>&nbsp;&nbsp;&nbsp;&nbsp;</td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate['affiliate_firstname'] . ' ' . $affiliate['affiliate_lastname']; ?></td>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_AFFILIATE_JOINDATE; ?>&nbsp;&nbsp;&nbsp;&nbsp;</td>
+                  <td width="15%" class="dataTableContent"><?php echo tep_date_short($affiliate['affiliate_date_account_created']); ?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_IMPRESSIONS; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_1) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_impressions; ?></td>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_VISITS; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_2) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_clickthroughs; ?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_TRANSACTIONS; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_3) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_sales['count']; ?></td>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_CONVERSION; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_4) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_conversions.' %';?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_AMOUNT; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_5) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $currencies->display_price($affiliate_sales['total'], ''); ?></td>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_AVERAGE; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_6) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $currencies->display_price($affiliate_average, ''); ?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_COMMISSION_RATE; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_7) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_percent, ' %'; ?></td>
+                  <td width="35%" align="right" class="dataTableContent"><b><?php echo TEXT_COMMISSION; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_8) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></b></td>
+                  <td width="15%" class="dataTableContent"><b><?php echo $currencies->display_price($affiliate_sales['payment'], ''); ?></b></td>
+                </tr>
+                <tr>
+                  <td colspan="4"><?php echo tep_draw_separator(); ?></td>
+                </tr>
+                <tr>
+                  <td align="center" class="dataTableContent" colspan="4"><b><?php echo TEXT_SUMMARY; ?></b></td>
+                </tr>
+                <tr>
+                  <td colspan="4"><?php echo tep_draw_separator(); ?></td>
+                </tr>
+                <tr>
+                  <td align="right" class="dataTableContent" colspan="4"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, 'acID=' . $HTTP_GET_VARS['acID']) . '">' . tep_image_button('button_affiliate_clickthroughs.gif', IMAGE_CLICKTHROUGHS) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, 'acID=' . $HTTP_GET_VARS['acID']) . '">' . tep_image_button('button_affiliate_sales.gif', IMAGE_SALES) . '</a>'; ?></td>
+                </tr>
+              </center>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php');?>

Added: trunk/direct.openmoko.com/admin/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,187 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 1.1.1.1 2004/03/04 23:38:10 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  // delete clickthroughs
+  if (AFFILIATE_DELETE_CLICKTHROUGHS != 'false' && is_numeric(AFFILIATE_DELETE_CLICKTHROUGHS)) {
+    $time = mktime (1,1,1,date("m"),date("d") - AFFILIATE_DELETE_CLICKTHROUGHS, date("Y"));
+    $time = date("Y-m-d", $time);
+    tep_db_query("delete from " . TABLE_AFFILIATE_CLICKTHROUGHS . " where affiliate_clientdate < '". $time . "'");
+  }
+  // delete old records from affiliate_banner_history
+  if (AFFILIATE_DELETE_AFFILIATE_BANNER_HISTORY != 'false' && is_numeric(AFFILIATE_DELETE_AFFILIATE_BANNER_HISTORY)) {
+    $time = mktime (1,1,1,date("m"),date("d") - AFFILIATE_DELETE_AFFILIATE_BANNER_HISTORY, date("Y"));
+    $time = date("Y-m-d", $time);
+    tep_db_query("delete from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_history_date < '". $time . "'");
+  }
+
+
+  $affiliate_banner_history_raw = "select sum(affiliate_banners_shown) as count from " . TABLE_AFFILIATE_BANNERS_HISTORY . "";
+  $affiliate_banner_history_query = tep_db_query($affiliate_banner_history_raw);
+  $affiliate_banner_history = tep_db_fetch_array($affiliate_banner_history_query);
+  $affiliate_impressions = $affiliate_banner_history['count'];
+  if ($affiliate_impressions == 0) $affiliate_impressions = "n/a";
+
+  $affiliate_clickthroughs_raw = "select count(*) as count from " . TABLE_AFFILIATE_CLICKTHROUGHS . "";
+  $affiliate_clickthroughs_query = tep_db_query($affiliate_clickthroughs_raw);
+  $affiliate_clickthroughs = tep_db_fetch_array($affiliate_clickthroughs_query);
+  $affiliate_clickthroughs = $affiliate_clickthroughs['count'];
+
+  $affiliate_sales_raw = "
+  select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment
+            from " . TABLE_AFFILIATE_SALES . " a,
+            " . TABLE_ORDERS . " o 
+            where
+            o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and
+            o.orders_id = a.affiliate_orders_id ";
+
+  $affiliate_sales_query= tep_db_query($affiliate_sales_raw);
+  $affiliate_sales= tep_db_fetch_array($affiliate_sales_query);
+
+  $affiliate_transactions = $affiliate_sales['count'];
+  if ($affiliate_clickthroughs > 0) {
+  $affiliate_conversions = tep_round(($affiliate_transactions / $affiliate_clickthroughs)*100,2) . "%";
+  } else {
+    $affiliate_conversions = "n/a";
+  }
+
+  $affiliate_amount = $affiliate_sales['total'];
+  if ($affiliate_transactions > 0) {
+  $affiliate_average = tep_round($affiliate_amount / $affiliate_transactions, 2);
+  } else {
+    $affiliate_average = "n/a";
+  }
+
+  $affiliate_commission = $affiliate_sales['payment'];
+
+  $affiliates_raw = "select count(*) as count from " . TABLE_AFFILIATE . "";
+  $affiliates_raw_query = tep_db_query($affiliates_raw);
+  $affiliates_raw = tep_db_fetch_array($affiliates_raw_query);
+  $affiliate_number = $affiliates_raw['count'];
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=120,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TEXT_SUMMARY_TITLE; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table width="100%" border="0" cellpadding="4" cellspacing="2" class="dataTableContent">
+              <center>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_AFFILIATES; ?>&nbsp;&nbsp;&nbsp;&nbsp;</td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_number; ?></td>
+                  <td width="35%" align="right" class="dataTableContent"></td>
+                  <td width="15%" class="dataTableContent"></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_IMPRESSIONS; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_1) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_impressions; ?></td>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_VISITS; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_2) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_clickthroughs; ?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_TRANSACTIONS; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_3) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_transactions; ?></td>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_CONVERSION; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_4) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $affiliate_conversions;?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_AMOUNT; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_5) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $currencies->display_price($affiliate_amount, ''); ?></td>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_AVERAGE; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_6) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo $currencies->display_price($affiliate_average, ''); ?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_COMMISSION_RATE; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_7) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="dataTableContent"><?php echo tep_round(AFFILIATE_PERCENT, 2) . ' %'; ?></td>
+                  <td width="35%" align="right" class="dataTableContent"><b><?php echo TEXT_COMMISSION; ?><?php echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_8) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></b></td>
+                  <td width="15%" class="dataTableContent"><b><?php echo $currencies->display_price($affiliate_commission, ''); ?></b></td>
+                </tr>
+                <tr>
+                  <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                </tr>
+                <tr>
+                  <td align="center" class="dataTableContent" colspan="4"><b><?php echo TEXT_SUMMARY; ?></b></td>
+                </tr>
+                <tr>
+                  <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                </tr>
+                <tr>
+                  <td align="right" class="dataTableContent" colspan="4"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS, '') . '">' . tep_image_button('button_affiliate_banners.gif', IMAGE_BANNERS) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '') . '">' . tep_image_button('button_affiliate_clickthroughs.gif', IMAGE_CLICKTHROUGHS) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '') . '">' . tep_image_button('button_affiliate_sales.gif', IMAGE_SALES) . '</a>'; ?></td>
+                </tr>
+              </center>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php');?>

Added: trunk/direct.openmoko.com/admin/affiliate_validcats.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_validcats.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_validcats.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: affiliate_validcats.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<?php
+// BOF: WebMakers.com Changed: Header Tag Controller v1.0
+if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
+    require(DIR_WS_INCLUDES . 'header_tags.php');
+  } else {
+    ?> 
+      <title><?php echo TITLE; ?></title>
+      <?php
+    }
+    ?>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<head>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+ 
+  <table width="580" class="infoBoxContents">
+<tr>
+<td colspan="2" class="infoBoxHeading" align="center"><?php echo TEXT_VALID_CATEGORIES_LIST; ?></td>
+</tr>
+<?php 
+    echo "<tr><td><b>". TEXT_VALID_CATEGORIES_ID . "</b></td><td><b>" . TEXT_VALID_CATEGORIES_NAME . "</b></td></tr><tr>";
+    $result = mysql_query("SELECT * FROM categories, categories_description WHERE categories.categories_id = categories_description.categories_id and categories_description.language_id = '" . $languages_id . "' ORDER BY categories_description.categories_name");
+    if ($row = mysql_fetch_array($result)) {
+        do {
+            echo "<td class='infoBoxContents'> ".$row["categories_id"]."</td>\n";
+            echo "<td class='infoBoxContents'>".$row["categories_name"]."</td>\n";
+            echo "</tr>\n";
+        }
+        while($row = mysql_fetch_array($result));
+    }
+    echo "</table>\n";
+?>
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?>&nbsp;&nbsp;&nbsp;</p>
+<br>
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/affiliate_validproducts.php
===================================================================
--- trunk/direct.openmoko.com/admin/affiliate_validproducts.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/affiliate_validproducts.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: affiliate_validproducts.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<head>
+<body>
+<table width="580" class="infoBoxContents">
+<tr>
+<td colspan="2" class="infoBoxHeading" align="center"><?php echo TEXT_VALID_PRODUCTS_LIST; ?></td>
+</tr>
+<?php 
+    echo "<tr><td><b>". TEXT_VALID_PRODUCTS_ID . "</b></td><td><b>" . TEXT_VALID_PRODUCTS_NAME . "</b></td></tr><tr>";
+    $result = mysql_query("SELECT * FROM products, products_description WHERE products.products_id = products_description.products_id and products_description.language_id = '" . $languages_id . "' ORDER BY products_description.products_name");
+    if ($row = mysql_fetch_array($result)) {
+        do {
+            echo "<td class='infoBoxContents'> ".$row["products_id"]."</td>\n";
+            echo "<td class='infoBoxContents'>".$row["products_name"]."</td>\n";
+            echo "</tr>\n";
+        }
+        while($row = mysql_fetch_array($result));
+    }
+    echo "</table>\n";
+?>
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?>&nbsp;&nbsp;&nbsp;</p>
+<br>
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,323 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'update':
+        $reviews_id = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+        $reviews_rating = tep_db_prepare_input($HTTP_POST_VARS['reviews_rating']);
+        $last_modified = tep_db_prepare_input($HTTP_POST_VARS['last_modified']);
+        $reviews_text = tep_db_prepare_input($HTTP_POST_VARS['reviews_text']);
+
+        tep_db_query("update " . TABLE_ARTICLE_REVIEWS . " set reviews_rating = '" . tep_db_input($reviews_rating) . "', last_modified = now() where reviews_id = '" . (int)$reviews_id . "'");
+        tep_db_query("update " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " set reviews_text = '" . tep_db_input($reviews_text) . "' where reviews_id = '" . (int)$reviews_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews_id));
+        break;
+      case 'deleteconfirm':
+        $reviews_id = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+
+        tep_db_query("delete from " . TABLE_ARTICLE_REVIEWS . " where reviews_id = '" . (int)$reviews_id . "'");
+        tep_db_query("delete from " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$reviews_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'approve_review':
+        $reviews_id = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+        tep_db_query("update " . TABLE_ARTICLE_REVIEWS . " set approved=1 where reviews_id = " . $reviews_id);
+        tep_redirect(tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews_id));
+        break;
+      case 'disapprove_review':
+        $reviews_id = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+        tep_db_query("update " . TABLE_ARTICLE_REVIEWS . " set approved=0 where reviews_id = " . $reviews_id);
+        tep_redirect(tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews_id));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<?php
+// BOF: WebMakers.com Changed: Header Tag Controller v1.0
+// Replaced by header_tags.php
+if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
+  require(DIR_WS_INCLUDES . 'header_tags.php');
+} else {
+?> 
+  <title><?php echo TITLE ?></title>
+<?php
+}
+// EOF: WebMakers.com Changed: Header Tag Controller v1.0
+?>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($action == 'edit') {
+    $rID = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+
+    $reviews_query = tep_db_query("select r.reviews_id, r.articles_id, r.customers_name, r.date_added, r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating from " . TABLE_ARTICLE_REVIEWS . " r, " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$rID . "' and r.reviews_id = rd.reviews_id");
+    $reviews = tep_db_fetch_array($reviews_query);
+
+    $articles_name_query = tep_db_query("select articles_name from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$reviews['articles_id'] . "' and language_id = '" . (int)$languages_id . "'");
+    $articles_name = tep_db_fetch_array($articles_name_query);
+
+    $rInfo_array = array_merge($reviews, $articles, $articles_name);
+    $rInfo = new objectInfo($rInfo_array);
+?>
+      <tr><?php echo tep_draw_form('review', FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $HTTP_GET_VARS['rID'] . '&action=preview'); ?>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="main" valign="top" colspan="2"><b><?php echo ENTRY_ARTICLE; ?></b> <?php echo $rInfo->articles_name; ?><br><b><?php echo ENTRY_FROM; ?></b> <?php echo $rInfo->customers_name; ?><br><br><b><?php echo ENTRY_DATE; ?></b> <?php echo tep_date_short($rInfo->date_added); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table witdh="100%" border="0" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="main" valign="top"><b><?php echo ENTRY_REVIEW; ?></b><br><br><?php echo tep_draw_textarea_field('reviews_text', 'soft', '60', '15', $rInfo->reviews_text); ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="right"><?php echo ENTRY_REVIEW_TEXT; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo ENTRY_RATING; ?></b>&nbsp;<?php echo TEXT_BAD; ?>&nbsp;<?php for ($i=1; $i<=5; $i++) echo tep_draw_radio_field('reviews_rating', $i, '', $rInfo->reviews_rating) . '&nbsp;'; echo TEXT_GOOD; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><?php echo tep_draw_hidden_field('reviews_id', $rInfo->reviews_id) . tep_draw_hidden_field('articles_id', $rInfo->articles_id) . tep_draw_hidden_field('customers_name', $rInfo->customers_name) . tep_draw_hidden_field('articles_name', $rInfo->articles_name) . tep_draw_hidden_field('date_added', $rInfo->date_added) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' <a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $HTTP_GET_VARS['rID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form></tr>
+<?php
+  } elseif ($action == 'preview') {
+    if (tep_not_null($HTTP_POST_VARS)) {
+      $rInfo = new objectInfo($HTTP_POST_VARS);
+    } else {
+      $rID = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+
+      $reviews_query = tep_db_query("select r.reviews_id, r.articles_id, r.customers_name, r.date_added, r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating from " . TABLE_ARTICLE_REVIEWS . " r, " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$rID . "' and r.reviews_id = rd.reviews_id");
+      $reviews = tep_db_fetch_array($reviews_query);
+
+      $articles_name_query = tep_db_query("select articles_name from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$reviews['articles_id'] . "' and language_id = '" . (int)$languages_id . "'");
+      $articles_name = tep_db_fetch_array($articles_name_query);
+
+      $rInfo_array = array_merge($reviews, $articles, $articles_name);
+      $rInfo = new objectInfo($rInfo_array);
+    }
+?>
+      <tr><?php echo tep_draw_form('update', FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $HTTP_GET_VARS['rID'] . '&action=update', 'post', 'enctype="multipart/form-data"'); ?>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="main" valign="top" colspan="2"><b><?php echo ENTRY_ARTICLE; ?></b> <?php echo $rInfo->articles_name; ?><br><b><?php echo ENTRY_FROM; ?></b> <?php echo $rInfo->customers_name; ?><br><br><b><?php echo ENTRY_DATE; ?></b> <?php echo tep_date_short($rInfo->date_added); ?></td>
+          </tr>
+        </table>
+      </tr>
+      <tr>
+        <td><table witdh="100%" border="0" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top" class="main"><b><?php echo ENTRY_REVIEW; ?></b><br><br><?php echo nl2br(tep_db_output(tep_break_string($rInfo->reviews_text, 15))); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo ENTRY_RATING; ?></b>&nbsp;<?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif', sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating)); ?>&nbsp;<small>[<?php echo sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating); ?>]</small></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php
+    if (tep_not_null($HTTP_POST_VARS)) {
+/* Re-Post all POST'ed variables */
+      reset($HTTP_POST_VARS);
+      while(list($key, $value) = each($HTTP_POST_VARS)) echo tep_draw_hidden_field($key, $value);
+?>
+      <tr>
+        <td align="right" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> ' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form></tr>
+<?php
+    } else {
+      if (isset($HTTP_GET_VARS['origin'])) {
+        $back_url = $HTTP_GET_VARS['origin'];
+        $back_url_params = '';
+      } else {
+        $back_url = FILENAME_ARTICLE_REVIEWS;
+        $back_url_params = 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id;
+      }
+?>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+    }
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ARTICLES; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_RATING; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_ADDED; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TEXT_APPROVED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $reviews_query_raw = "select reviews_id, articles_id, date_added, last_modified, reviews_rating, approved from " . TABLE_ARTICLE_REVIEWS . " order by date_added DESC";
+    $reviews_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $reviews_query_raw, $reviews_query_numrows);
+    $reviews_query = tep_db_query($reviews_query_raw);
+    while ($reviews = tep_db_fetch_array($reviews_query)) {
+      if ((!isset($HTTP_GET_VARS['rID']) || (isset($HTTP_GET_VARS['rID']) && ($HTTP_GET_VARS['rID'] == $reviews['reviews_id']))) && !isset($rInfo)) {
+        $reviews_text_query = tep_db_query("select r.reviews_read, r.customers_name, length(rd.reviews_text) as reviews_text_size from " . TABLE_ARTICLE_REVIEWS . " r, " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$reviews['reviews_id'] . "' and r.reviews_id = rd.reviews_id");
+        $reviews_text = tep_db_fetch_array($reviews_text_query);
+
+        $articles_name_query = tep_db_query("select articles_name from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$reviews['articles_id'] . "' and language_id = '" . (int)$languages_id . "'");
+        $articles_name = tep_db_fetch_array($articles_name_query);
+
+        $reviews_average_query = tep_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_ARTICLE_REVIEWS . " where articles_id = '" . (int)$reviews['articles_id'] . "'");
+        $reviews_average = tep_db_fetch_array($reviews_average_query);
+
+        $review_info = array_merge($reviews_text, $reviews_average, $articles_name);
+        $rInfo_array = array_merge($reviews, $review_info);
+        $rInfo = new objectInfo($rInfo_array);
+      }
+
+      if (isset($rInfo) && is_object($rInfo) && ($reviews['reviews_id'] == $rInfo->reviews_id) ) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=preview') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews['reviews_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews['reviews_id'] . '&action=preview') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . tep_get_articles_name($reviews['articles_id']); ?></td>
+                <td class="dataTableContent" align="right"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif'); ?></td>
+                <td class="dataTableContent" align="right"><?php echo tep_date_short($reviews['date_added']); ?></td>
+                <td class="dataTableContent" align="center"><?php echo $reviews['approved']==1?tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10):tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($rInfo)) && ($reviews['reviews_id'] == $rInfo->reviews_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $reviews_split->display_count($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                    <td class="smallText" align="right"><?php echo $reviews_split->display_links($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+    $heading = array();
+    $contents = array();
+
+    switch ($action) {
+      case 'delete':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_REVIEW . '</b>');
+
+        $contents = array('form' => tep_draw_form('reviews', FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=deleteconfirm'));
+        $contents[] = array('text' => TEXT_INFO_DELETE_REVIEW_INTRO);
+        $contents[] = array('text' => '<br><b>' . $rInfo->articles_name . '</b>');
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      default:
+      if (isset($rInfo) && is_object($rInfo)) {
+        $heading[] = array('text' => '<b>' . $rInfo->articles_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($rInfo->date_added));
+        if (tep_not_null($rInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($rInfo->last_modified));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_REVIEW_AUTHOR . ' ' . $rInfo->customers_name);
+        $contents[] = array('text' => TEXT_INFO_REVIEW_RATING . ' ' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif'));
+        $contents[] = array('text' => TEXT_INFO_REVIEW_READ . ' ' . $rInfo->reviews_read);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_REVIEW_SIZE . ' ' . $rInfo->reviews_text_size . ' bytes');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_ARTICLES_AVERAGE_RATING . ' ' . number_format($rInfo->average_rating, 2) . '%');
+        if($rInfo->approved==0){
+          $contents[] = array('align' => 'left', 'text' => '<br>' . TEXT_APPROVED . ': ' . TEXT_NO );
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params(array('action', 'info')) . 'action=approve_review&rID=' . $rInfo->reviews_id, 'NONSSL') . '">' . tep_image_button('review_approve.gif', TEXT_APPROVE) . '</a>');
+          }
+        elseif($rInfo->approved==1) {
+          $contents[] = array('align' => 'left', 'text' => '<br>' . TEXT_APPROVED . ': ' . TEXT_YES );
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params(array('action', 'info')) . 'action=disapprove_review&rID=' . $rInfo->reviews_id, 'NONSSL') . '">' . tep_image_button('review_disapprove.gif', TEXT_DISAPPROVE) . '</a>');
+          }
+        else{  
+          $contents[] = array('align' => 'left', 'text' => '<br>&nbsp;' . TEXT_APPROVED . ': ' . "Unknown" );        
+          }
+      }
+        break;
+    }
+
+    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+      echo '            <td width="25%" valign="top">' . "\n";
+
+      $box = new box;
+      echo $box->infoBox($heading, $contents);
+
+      echo '            </td>' . "\n";
+    }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/articles.php
===================================================================
--- trunk/direct.openmoko.com/admin/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1286 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'setflag':
+        if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
+          if (isset($HTTP_GET_VARS['aID'])) {
+            tep_set_article_status($HTTP_GET_VARS['aID'], $HTTP_GET_VARS['flag']);
+          }
+
+          if (USE_CACHE == 'true') {
+            tep_reset_cache_block('topics');
+          }
+        }
+
+        tep_redirect(tep_href_link(FILENAME_ARTICLES, 'tPath=' . $HTTP_GET_VARS['tPath'] . '&aID=' . $HTTP_GET_VARS['aID']));
+        break;
+      case 'new_topic':
+      case 'edit_topic':
+        $HTTP_GET_VARS['action']=$HTTP_GET_VARS['action'] . '_ACD';
+        break;
+      case 'insert_topic':
+      case 'update_topic':
+        if ( ($HTTP_POST_VARS['edit_x']) || ($HTTP_POST_VARS['edit_y']) ) {
+          $HTTP_GET_VARS['action'] = 'edit_topic_ACD';
+        } else {
+        if (isset($HTTP_POST_VARS['topics_id'])) $topics_id = tep_db_prepare_input($HTTP_POST_VARS['topics_id']);
+          if ($topics_id == '') {
+            $topics_id = tep_db_prepare_input($HTTP_GET_VARS['tID']);
+            }
+        $sort_ordera = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);
+
+        $sql_data_array = array('sort_order' => $sort_ordera);
+
+        if ($action == 'insert_topic') {
+          $insert_sql_data = array('parent_id' => $current_topic_id,
+                                   'date_added' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+          tep_db_perform(TABLE_TOPICS, $sql_data_array);
+
+          $topics_id = tep_db_insert_id();
+        } elseif ($action == 'update_topic') {
+          $update_sql_data = array('last_modified' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+          tep_db_perform(TABLE_TOPICS, $sql_data_array, 'update', "topics_id = '" . (int)$topics_id . "'");
+        }
+
+        $languages = tep_get_languages();
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+
+          $language_id = $languages[$i]['id'];
+
+          $sql_data_array = array('topics_name' => tep_db_prepare_input($HTTP_POST_VARS['topics_name'][$language_id]),
+                                  'topics_heading_title' => tep_db_prepare_input($HTTP_POST_VARS['topics_heading_title'][$language_id]),
+                                  'topics_description' => tep_db_prepare_input($HTTP_POST_VARS['topics_description'][$language_id]));
+
+          if ($action == 'insert_topic') {
+            $insert_sql_data = array('topics_id' => $topics_id,
+                                     'language_id' => $languages[$i]['id']);
+
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_TOPICS_DESCRIPTION, $sql_data_array);
+          } elseif ($action == 'update_topic') {
+            tep_db_perform(TABLE_TOPICS_DESCRIPTION, $sql_data_array, 'update', "topics_id = '" . (int)$topics_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
+          }
+        }
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('topics');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $topics_id));
+        break;
+        }
+      case 'delete_topic_confirm':
+        if (isset($HTTP_POST_VARS['topics_id'])) {
+          $topics_id = tep_db_prepare_input($HTTP_POST_VARS['topics_id']);
+
+          $topics = tep_get_topic_tree($topics_id, '', '0', '', true);
+          $articles = array();
+          $articles_delete = array();
+
+          for ($i=0, $n=sizeof($topics); $i<$n; $i++) {
+            $article_ids_query = tep_db_query("select articles_id from " . TABLE_ARTICLES_TO_TOPICS . " where topics_id = '" . (int)$topics[$i]['id'] . "'");
+
+            while ($article_ids = tep_db_fetch_array($article_ids_query)) {
+              $articles[$article_ids['articles_id']]['topics'][] = $topics[$i]['id'];
+            }
+          }
+
+          reset($articles);
+          while (list($key, $value) = each($articles)) {
+            $topic_ids = '';
+
+            for ($i=0, $n=sizeof($value['topics']); $i<$n; $i++) {
+              $topic_ids .= "'" . (int)$value['topics'][$i] . "', ";
+            }
+            $topic_ids = substr($topic_ids, 0, -2);
+
+            $check_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES_TO_TOPICS . " where articles_id = '" . (int)$key . "' and topics_id not in (" . $topic_ids . ")");
+            $check = tep_db_fetch_array($check_query);
+            if ($check['total'] < '1') {
+              $articles_delete[$key] = $key;
+            }
+          }
+
+// removing topics can be a lengthy process
+          tep_set_time_limit(0);
+          for ($i=0, $n=sizeof($topics); $i<$n; $i++) {
+            tep_remove_topic($topics[$i]['id']);
+          }
+
+          reset($articles_delete);
+          while (list($key) = each($articles_delete)) {
+            tep_remove_article($key);
+          }
+        }
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('topics');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath));
+        break;
+      case 'delete_article_confirm':
+        if (isset($HTTP_POST_VARS['articles_id']) && isset($HTTP_POST_VARS['article_topics']) && is_array($HTTP_POST_VARS['article_topics'])) {
+          $article_id = tep_db_prepare_input($HTTP_POST_VARS['articles_id']);
+          $article_topics = $HTTP_POST_VARS['article_topics'];
+
+          for ($i=0, $n=sizeof($article_topics); $i<$n; $i++) {
+            tep_db_query("delete from " . TABLE_ARTICLES_TO_TOPICS . " where articles_id = '" . (int)$article_id . "' and topics_id = '" . (int)$article_topics[$i] . "'");
+          }
+
+          $article_topics_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES_TO_TOPICS . " where articles_id = '" . (int)$article_id . "'");
+          $article_topics = tep_db_fetch_array($article_topics_query);
+
+          if ($article_topics['total'] == '0') {
+            tep_remove_article($article_id);
+          }
+        }
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('topics');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath));
+        break;
+      case 'move_topic_confirm':
+        if (isset($HTTP_POST_VARS['topics_id']) && ($HTTP_POST_VARS['topics_id'] != $HTTP_POST_VARS['move_to_topic_id'])) {
+          $topics_id = tep_db_prepare_input($HTTP_POST_VARS['topics_id']);
+          $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_topic_id']);
+
+          $path = explode('_', tep_get_generated_topic_path_ids($new_parent_id));
+
+          if (in_array($topics_id, $path)) {
+            $messageStack->add_session('search', ERROR_CANNOT_MOVE_TOPIC_TO_PARENT, 'error');
+
+            tep_redirect(tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $topics_id));
+          } else {
+            tep_db_query("update " . TABLE_TOPICS . " set parent_id = '" . (int)$new_parent_id . "', last_modified = now() where topics_id = '" . (int)$topics_id . "'");
+
+            if (USE_CACHE == 'true') {
+              tep_reset_cache_block('topics');
+            }
+
+            tep_redirect(tep_href_link(FILENAME_ARTICLES, 'tPath=' . $new_parent_id . '&tID=' . $topics_id));
+          }
+        }
+
+        break;
+      case 'move_article_confirm':
+        $articles_id = tep_db_prepare_input($HTTP_POST_VARS['articles_id']);
+        $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_topic_id']);
+
+        $duplicate_check_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES_TO_TOPICS . " where articles_id = '" . (int)$articles_id . "' and topics_id = '" . (int)$new_parent_id . "'");
+        $duplicate_check = tep_db_fetch_array($duplicate_check_query);
+        if ($duplicate_check['total'] < 1) tep_db_query("update " . TABLE_ARTICLES_TO_TOPICS . " set topics_id = '" . (int)$new_parent_id . "' where articles_id = '" . (int)$articles_id . "' and topics_id = '" . (int)$current_topic_id . "'");
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('topics');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_ARTICLES, 'tPath=' . $new_parent_id . '&aID=' . $articles_id));
+        break;
+      case 'insert_article':
+      case 'update_article':
+        if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {
+          $action = 'new_article';
+        } else {
+          if (isset($HTTP_GET_VARS['aID'])) $articles_id = tep_db_prepare_input($HTTP_GET_VARS['aID']);
+          $articles_date_available = tep_db_prepare_input($HTTP_POST_VARS['articles_date_available']);
+
+          $articles_date_available = (date('Y-m-d') < $articles_date_available) ? $articles_date_available : 'null';
+
+          $sql_data_array = array('articles_date_available' => $articles_date_available,
+                                  'articles_status' => tep_db_prepare_input($HTTP_POST_VARS['articles_status']),
+                                  'authors_id' => tep_db_prepare_input($HTTP_POST_VARS['authors_id']));
+
+          if ($action == 'insert_article') {
+            // If expected article then articles_date _added becomes articles_date_available
+            if (isset($HTTP_POST_VARS['articles_date_available']) && tep_not_null($HTTP_POST_VARS['articles_date_available'])) {
+              $insert_sql_data = array('articles_date_added' => tep_db_prepare_input($HTTP_POST_VARS['articles_date_available']));
+            } else {
+              $insert_sql_data = array('articles_date_added' => 'now()');
+            }
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_ARTICLES, $sql_data_array);
+            $articles_id = tep_db_insert_id();
+
+            tep_db_query("insert into " . TABLE_ARTICLES_TO_TOPICS . " (articles_id, topics_id) values ('" . (int)$articles_id . "', '" . (int)$current_topic_id . "')");
+          } elseif ($action == 'update_article') {
+            $update_sql_data = array('articles_last_modified' => 'now()');
+            // If expected article then articles_date _added becomes articles_date_available
+            if (isset($HTTP_POST_VARS['articles_date_available']) && tep_not_null($HTTP_POST_VARS['articles_date_available'])) {
+              $update_sql_data = array('articles_date_added' => tep_db_prepare_input($HTTP_POST_VARS['articles_date_available']));
+            }
+
+            $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+            tep_db_perform(TABLE_ARTICLES, $sql_data_array, 'update', "articles_id = '" . (int)$articles_id . "'");
+          }
+
+          $languages = tep_get_languages();
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+            $language_id = $languages[$i]['id'];
+
+            $sql_data_array = array('articles_name' => tep_db_prepare_input($HTTP_POST_VARS['articles_name'][$language_id]),
+                                    'articles_description' => tep_db_prepare_input($HTTP_POST_VARS['articles_description'][$language_id]),
+                                    'articles_url' => tep_db_prepare_input($HTTP_POST_VARS['articles_url'][$language_id]),
+                                    'articles_head_title_tag' => tep_db_prepare_input($HTTP_POST_VARS['articles_head_title_tag'][$language_id]),
+                                    'articles_head_desc_tag' => tep_db_prepare_input($HTTP_POST_VARS['articles_head_desc_tag'][$language_id]),
+                                    'articles_head_keywords_tag' => tep_db_prepare_input($HTTP_POST_VARS['articles_head_keywords_tag'][$language_id]));
+
+            if ($action == 'insert_article') {
+              $insert_sql_data = array('articles_id' => $articles_id,
+                                       'language_id' => $language_id);
+
+              $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+              tep_db_perform(TABLE_ARTICLES_DESCRIPTION, $sql_data_array);
+            } elseif ($action == 'update_article') {
+              tep_db_perform(TABLE_ARTICLES_DESCRIPTION, $sql_data_array, 'update', "articles_id = '" . (int)$articles_id . "' and language_id = '" . (int)$language_id . "'");
+            }
+          }
+
+          if (USE_CACHE == 'true') {
+            tep_reset_cache_block('topics');
+          }
+
+          tep_redirect(tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles_id));
+        }
+        break;
+      case 'copy_to_confirm':
+        if (isset($HTTP_POST_VARS['articles_id']) && isset($HTTP_POST_VARS['topics_id'])) {
+          $articles_id = tep_db_prepare_input($HTTP_POST_VARS['articles_id']);
+          $topics_id = tep_db_prepare_input($HTTP_POST_VARS['topics_id']);
+
+          if ($HTTP_POST_VARS['copy_as'] == 'link') {
+            if ($topics_id != $current_topic_id) {
+              $check_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES_TO_TOPICS . " where articles_id = '" . (int)$articles_id . "' and topics_id = '" . (int)$topics_id . "'");
+              $check = tep_db_fetch_array($check_query);
+              if ($check['total'] < '1') {
+                tep_db_query("insert into " . TABLE_ARTICLES_TO_TOPICS . " (articles_id, topics_id) values ('" . (int)$articles_id . "', '" . (int)$topics_id . "')");
+              }
+            } else {
+              $messageStack->add_session('search', ERROR_CANNOT_LINK_TO_SAME_TOPIC, 'error');
+            }
+          } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {
+            $article_query = tep_db_query("select articles_date_available, authors_id from " . TABLE_ARTICLES . " where articles_id = '" . (int)$articles_id . "'");
+            $article = tep_db_fetch_array($article_query);
+
+            tep_db_query("insert into " . TABLE_ARTICLES . " (articles_date_added, articles_date_available, articles_status, authors_id) values (now(), '" . tep_db_input($article['articles_date_available']) . "', '0', '" . (int)$article['authors_id'] . "')");
+            $dup_articles_id = tep_db_insert_id();
+
+            $description_query = tep_db_query("select language_id, articles_name, articles_description, articles_url, articles_head_title_tag, articles_head_desc_tag, articles_head_keywords_tag from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$articles_id . "'");
+            while ($description = tep_db_fetch_array($description_query)) {
+              tep_db_query("insert into " . TABLE_ARTICLES_DESCRIPTION . " (articles_id, language_id, articles_name, articles_description, articles_url, articles_head_title_tag, articles_head_desc_tag, articles_head_keywords_tag, articles_viewed) values ('" . (int)$dup_articles_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['articles_name']) . "', '" . tep_db_input($description['articles_description']) . "', '" . tep_db_input($description['articles_url']) . "', '" . tep_db_input($description['articles_head_title_tag']) . "', '" . tep_db_input($description['articles_head_desc_tag']) . "', '" . tep_db_input($description['articles_head_keywords_tag']) . "', '0')");
+            }
+
+            tep_db_query("insert into " . TABLE_ARTICLES_TO_TOPICS . " (articles_id, topics_id) values ('" . (int)$dup_articles_id . "', '" . (int)$topics_id . "')");
+            $articles_id = $dup_articles_id;
+          }
+
+          if (USE_CACHE == 'true') {
+            tep_reset_cache_block('topics');
+          }
+        }
+
+        tep_redirect(tep_href_link(FILENAME_ARTICLES, 'tPath=' . $topics_id . '&aID=' . $articles_id));
+        break;
+    }
+  }
+
+// check if the catalog image directory exists
+  if (is_dir(DIR_FS_CATALOG_IMAGES)) {
+    if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add('search', ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
+  } else {
+    $messageStack->add('search', ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
+  }
+
+// check if the authors table is empty.  articles must be assigned an author to be shown in storefront.        
+  $authors_query = tep_db_query("select * from " . TABLE_AUTHORS);
+  if (tep_db_num_rows($authors_query) == 0){
+    $add_str = '<a href="' . tep_href_link(FILENAME_AUTHORS, '&action=new') . '">' . tep_image_button('button_new_author.gif', IMAGE_NEW_AUTHOR) . '</a>';
+    $messageStack->add('search', TEXT_WARNING_NO_AUTHORS, 'warning');
+  }else{
+    $add_str = '<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&action=new_article') . '">' . tep_image_button('button_new_article.gif', IMAGE_NEW_ARTICLE) . '</a>';
+  }
+?>
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo HEADING_TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/javascript/general.js"></script>
+<script language="javascript" src="includes/javascript/menu.js"></script>
+<!-- Tabs code -->
+<script type="text/javascript" src="includes/javascript/tabpane/local/webfxlayout.js"></script>
+<link type="text/css" rel="stylesheet" href="includes/javascript/tabpane/tab.webfx.css">
+<style type="text/css">
+.dynamic-tab-pane-control h2 {
+  text-align: center;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control h2 a {
+  display:  inline;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control a:hover {
+  background: transparent;
+}
+</style>
+<script type="text/javascript" src="includes/javascript/tabpane/tabpane.js"></script>
+<!-- End Tabs -->
+<?php include('includes/javascript/editor.php');?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <?php
+   //----- new_topic / edit_topic  -----
+  if ($HTTP_GET_VARS['action'] == 'new_topic_ACD' || $HTTP_GET_VARS['action'] == 'edit_topic_ACD') {
+    if ( ($HTTP_GET_VARS['tID']) && (!$HTTP_POST_VARS) ) {
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, td.topics_heading_title, td.topics_description, t.parent_id, t.sort_order, t.date_added, t.last_modified from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.topics_id = '" . $HTTP_GET_VARS['tID'] . "' and t.topics_id = td.topics_id and td.language_id = '" . $languages_id . "' order by t.sort_order, td.topics_name");
+      $topic = tep_db_fetch_array($topics_query);
+
+      $tInfo = new objectInfo($topic);
+    } elseif ($HTTP_POST_VARS) {
+      $tInfo = new objectInfo($HTTP_POST_VARS);
+      $topics_name = $HTTP_POST_VARS['topics_name'];
+      $topics_heading_title = $HTTP_POST_VARS['topics_heading_title'];
+      $topics_description = $HTTP_POST_VARS['topics_description'];
+      $topics_url = $HTTP_POST_VARS['topics_url'];
+    } else {
+      $tInfo = new objectInfo(array());
+    }
+
+    $languages = tep_get_languages();
+
+    $text_new_or_edit = ($HTTP_GET_VARS['action']=='new_topic_ACD') ? TEXT_INFO_HEADING_NEW_TOPIC : TEXT_INFO_HEADING_EDIT_TOPIC;
+?>
+  <?php echo tep_draw_form('new_topic', FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $HTTP_GET_VARS['tID'] . '&action=new_topic_preview', 'post', 'enctype="multipart/form-data"'); ?>
+
+   <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo sprintf($text_new_or_edit, tep_output_generated_topic_path($current_topic_id)); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+</table>
+    <table border="0" cellspacing="0" cellpadding="0">
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_EDIT_SORT_ORDER; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('sort_order', $tInfo->sort_order, 'size="2"'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table>
+<?php 
+// Load Editor
+echo tep_load_html_editor();
+  for ($i=0; $i<sizeof($languages); $i++) {
+      $topics_description_elements .= 'topics_description[' . $languages[$i]['id'] . '],'; 
+    } 
+echo tep_insert_html_editor($topics_description_elements);
+?>
+<div class="tab-pane" id="tabPane1">
+<script type="text/javascript">tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ) );
+</script>
+<?php
+    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+              <div class="tab-page" id="<?php echo $languages[$i]['name'];?>">
+                <h2 class="tab"><nobr><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name'],'align="absmiddle" style="height:16px; width:30px;"') . '&nbsp;' .$languages[$i]['name'];?></nobr></h2>
+                <script type="text/javascript">tp1.addTabPage( document.getElementById( "<?php echo $languages[$i]['name'];?>" ) );</script>
+                <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="tab table">
+                  <tr>
+                    <td valign="top">
+<table border="0" cellspacing="0" cellpadding="2" width="100%">
+<?php
+//    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><?php echo TEXT_EDIT_TOPICS_NAME; ?></td>
+            <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('topics_name[' . $languages[$i]['id'] . ']', (($topics_name[$languages[$i]['id']]) ? stripslashes($topics_name[$languages[$i]['id']]) : tep_get_topic_name($tInfo->topics_id, $languages[$i]['id']))); ?></td>
+          </tr>
+<?php
+ //   }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+ // for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><?php echo TEXT_EDIT_TOPICS_HEADING_TITLE; ?></td>
+            <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('topics_heading_title[' . $languages[$i]['id'] . ']', (($topics_name[$languages[$i]['id']]) ? stripslashes($topics_name[$languages[$i]['id']]) : tep_get_topic_heading_title($tInfo->topics_id, $languages[$i]['id']))); ?></td>
+          </tr>
+<?php
+//  }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+  //  for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_EDIT_TOPICS_DESCRIPTION; ?></td>
+            <td><table border="0" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="main" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
+                <td class="main"><?php echo tep_draw_textarea_field('topics_description[' . $languages[$i]['id'] . ']', 'soft', '70', '20', (($topics_description[$languages[$i]['id']]) ? stripslashes($topics_description[$languages[$i]['id']]) : tep_get_topic_description($tInfo->topics_id, $languages[$i]['id'])),' style="width: 100%" mce_editable="true"'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+
+<?php
+//    }
+?>
+</table>
+</td>
+                  </tr>
+                </table>
+              </div>
+<?php
+    }
+?>
+            </div>
+<script type="text/javascript">
+//<![CDATA[
+setupAllTabs();
+//]]>
+</script>
+    </td>
+      </tr>
+</table>
+  <table border="0" cellspacing="0" cellpadding="2" width="90%">
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main" align="right"><?php echo tep_draw_hidden_field('topics_date_added', (($tInfo->date_added) ? $tInfo->date_added : date('Y-m-d'))) . tep_draw_hidden_field('parent_id', $tInfo->parent_id) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $HTTP_GET_VARS['tID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form></tr>
+<?php
+  //MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 Articles Description HTML - </form>
+  if (ARTICLE_WYSIWYG_ENABLE == 'Enable') {
+?>
+
+<?php
+  }
+  //----- new_topic_preview -----
+  } elseif ($HTTP_GET_VARS['action'] == 'new_topic_preview') {
+    if ($HTTP_POST_VARS) {
+      $tInfo = new objectInfo($HTTP_POST_VARS);
+      $topics_name = $HTTP_POST_VARS['topics_name'];
+      $topics_heading_title = $HTTP_POST_VARS['topics_heading_title'];
+      $topics_description = $HTTP_POST_VARS['topics_description'];
+    } else {
+      $topic_query = tep_db_query("select t.topics_id, td.language_id, td.topics_name, td.topics_heading_title, td.topics_description, t.sort_order, t.date_added, t.last_modified from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.topics_id = td.topics_id and t.topics_id = '" . $HTTP_GET_VARS['tID'] . "'");
+      $topic = tep_db_fetch_array($topic_query);
+
+      $tInfo = new objectInfo($topic);
+    }
+
+    $form_action = ($HTTP_GET_VARS['tID']) ? 'update_topic' : 'insert_topic';
+
+    echo tep_draw_form($form_action, FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $HTTP_GET_VARS['tID'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');
+
+    $languages = tep_get_languages();
+    for ($i=0; $i<sizeof($languages); $i++) {
+      if ($HTTP_GET_VARS['read'] == 'only') {
+        $tInfo->topics_name = tep_get_topic_name($tInfo->topics_id, $languages[$i]['id']);
+        $tInfo->topics_heading_title = tep_get_topic_heading_title($tInfo->topics_id, $languages[$i]['id']);
+        $tInfo->topics_description = tep_get_topic_description($tInfo->topics_id, $languages[$i]['id']);
+      } else {
+        $tInfo->topics_name = tep_db_prepare_input($topics_name[$languages[$i]['id']]);
+        $tInfo->topics_heading_title = tep_db_prepare_input($topics_heading_title[$languages[$i]['id']]);
+        $tInfo->topics_description = tep_db_prepare_input($topics_description[$languages[$i]['id']]);
+      }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $tInfo->topics_heading_title; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo $tInfo->topics_description; ?></td>
+      </tr>
+
+<?php
+    }
+    if ($HTTP_GET_VARS['read'] == 'only') {
+      if ($HTTP_GET_VARS['origin']) {
+        $pos_params = strpos($HTTP_GET_VARS['origin'], '?', 0);
+        if ($pos_params != false) {
+          $back_url = substr($HTTP_GET_VARS['origin'], 0, $pos_params);
+          $back_url_params = substr($HTTP_GET_VARS['origin'], $pos_params + 1);
+        } else {
+          $back_url = $HTTP_GET_VARS['origin'];
+          $back_url_params = '';
+        }
+      } else {
+        $back_url = FILENAME_ARTICLES;
+        $back_url_params = 'tPath=' . $tPath . '&tID=' . $tInfo->topics_id;
+      }
+?>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+    } else {
+?>
+      <tr>
+        <td align="right" class="smallText">
+<?php
+/* Re-Post all POST'ed variables */
+      reset($HTTP_POST_VARS);
+      while (list($key, $value) = each($HTTP_POST_VARS)) {
+        if (!is_array($HTTP_POST_VARS[$key])) {
+          echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+        }
+      }
+      $languages = tep_get_languages();
+      for ($i=0; $i<sizeof($languages); $i++) {
+        echo tep_draw_hidden_field('topics_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($topics_name[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('topics_heading_title[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($topics_heading_title[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('topics_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($topics_description[$languages[$i]['id']])));
+      }
+
+      echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '&nbsp;&nbsp;';
+
+      if ($HTTP_GET_VARS['tID']) {
+        echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
+      } else {
+        echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
+      }
+      echo '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $HTTP_GET_VARS['tID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+?></td>
+      </form></tr>
+<?php
+    }
+  } elseif ($action == 'new_article') {
+    $parameters = array('articles_name' => '',
+                       'articles_description' => '',
+                       'articles_url' => '',
+                       'articles_head_title_tag' => '',
+                       'articles_head_desc_tag' => '',
+                       'articles_head_keywords' => '',
+                       'articles_id' => '',
+                       'articles_date_added' => '',
+                       'articles_last_modified' => '',
+                       'articles_date_available' => '',
+                       'articles_status' => '',
+                       'authors_id' => '');
+
+    $aInfo = new objectInfo($parameters);
+
+    if (isset($HTTP_GET_VARS['aID']) && empty($HTTP_POST_VARS)) {
+      $article_query = tep_db_query("select ad.articles_name, ad.articles_description, ad.articles_url, ad.articles_head_title_tag, ad.articles_head_desc_tag, ad.articles_head_keywords_tag, a.articles_id, a.articles_date_added, a.articles_last_modified, date_format(a.articles_date_available, '%Y-%m-%d') as articles_date_available, a.articles_status, a.authors_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_id = '" . (int)$HTTP_GET_VARS['aID'] . "' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "'");
+      $article = tep_db_fetch_array($article_query);
+
+      $aInfo->objectInfo($article);
+    } elseif (tep_not_null($HTTP_POST_VARS)) {
+      $aInfo->objectInfo($HTTP_POST_VARS);
+      $articles_name = $HTTP_POST_VARS['articles_name'];
+      $articles_description = $HTTP_POST_VARS['articles_description'];
+      $articles_url = $HTTP_POST_VARS['articles_url'];
+      $articles_head_title_tag = $HTTP_POST_VARS['articles_head_title_tag'];
+      $articles_head_desc_tag = $HTTP_POST_VARS['articles_head_desc_tag'];
+      $articles_head_keywords_tag = $HTTP_POST_VARS['articles_head_keywords_tag'];
+    }
+
+    $authors_array = array(array('id' => '', 'text' => TEXT_NONE));
+    $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name");
+    while ($authors = tep_db_fetch_array($authors_query)) {
+      $authors_array[] = array('id' => $authors['authors_id'],
+                                     'text' => $authors['authors_name']);
+    }
+
+    $languages = tep_get_languages();
+
+    if (!isset($aInfo->articles_status)) $aInfo->articles_status = '1';
+    switch ($aInfo->articles_status) {
+      case '0': $in_status = false; $out_status = true; break;
+      case '1':
+      default: $in_status = true; $out_status = false;
+    }
+?>
+<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
+<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
+<script language="javascript">
+<!--
+  var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_article", "articles_date_available","btnDate1","<?php echo $aInfo->articles_date_available; ?>",scBTNMODE_CUSTOMBLUE);
+-->
+</script>
+    <?php echo tep_draw_form('new_article', FILENAME_ARTICLES, 'tPath=' . $tPath . (isset($HTTP_GET_VARS['aID']) ? '&aID=' . $HTTP_GET_VARS['aID'] : '') . '&action=article_preview', 'post', 'enctype="multipart/form-data"'); ?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo sprintf(TEXT_NEW_ARTICLE, tep_output_generated_topic_path($current_topic_id)); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_ARTICLES_STATUS; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_radio_field('articles_status', '0', $out_status) . '&nbsp;' . TEXT_ARTICLE_NOT_AVAILABLE . '&nbsp;' . tep_draw_radio_field('articles_status', '1', $in_status) . '&nbsp;' . TEXT_ARTICLE_AVAILABLE; ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_ARTICLES_DATE_AVAILABLE; ?><br><small><!-- (YYYY-MM-DD) --><?php echo DATE_FORMAT?></small></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+          <tr>
+            <td class="main"><?php echo TEXT_ARTICLES_AUTHOR; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('authors_id', $authors_array, $aInfo->authors_id); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+</table>
+<?php 
+// Load Editor
+echo tep_load_html_editor();
+  for ($i=0; $i<sizeof($languages); $i++) {
+      $articles_description_elements .= 'articles_description[' . $languages[$i]['id'] . '],'; 
+    } 
+echo tep_insert_html_editor($articles_description_elements);
+?>
+<div class="tab-pane" id="tabPane1">
+<script type="text/javascript">tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ) );
+</script>
+<?php
+    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+              <div class="tab-page" id="<?php echo $languages[$i]['name'];?>">
+                <h2 class="tab"><nobr><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name'],'align="absmiddle" style="height:16px; width:30px;"') . '&nbsp;' .$languages[$i]['name'];?></nobr></h2>
+                <script type="text/javascript">tp1.addTabPage( document.getElementById( "<?php echo $languages[$i]['name'];?>" ) );</script>
+                <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="tab table">
+                  <tr>
+                    <td valign="top">
+<table border="0" cellspacing="0" cellpadding="2" width="100%">
+<?php
+  //  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+?>
+          <tr>
+            <td class="main"><?php echo TEXT_ARTICLES_NAME; ?></td>
+            <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('articles_name[' . $languages[$i]['id'] . ']', (isset($articles_name[$languages[$i]['id']]) ? $articles_name[$languages[$i]['id']] : tep_get_articles_name($aInfo->articles_id, $languages[$i]['id'])), 'size="35"'); ?></td>
+          </tr>
+<?php
+  //  }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+  // for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+?>
+          <tr>
+            <td class="main"><?php  echo TEXT_ARTICLES_HEAD_TITLE_TAG; ?></td>
+            <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('articles_head_title_tag[' . $languages[$i]['id'] . ']', (isset($articles_head_title_tag[$languages[$i]['id']]) ? $articles_head_title_tag[$languages[$i]['id']] : tep_get_articles_head_title_tag($aInfo->articles_id, $languages[$i]['id'])), 'size="35"'); ?></td>
+          </tr>
+<?php
+//    }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+ //   for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+?>
+          <tr>
+            <td class="main" valign="top"><?php  echo sprintf(TEXT_ARTICLES_HEAD_DESC_TAG, MAX_ARTICLE_ABSTRACT_LENGTH); ?></td>
+            <td><table border="0" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="main" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
+                <td class="main"><?php echo tep_draw_textarea_field('articles_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '5', (isset($articles_head_desc_tag[$languages[$i]['id']]) ? $articles_head_desc_tag[$languages[$i]['id']] : tep_get_articles_head_desc_tag($aInfo->articles_id, $languages[$i]['id']))); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+<?php
+  //  }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+ //   for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+?>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_ARTICLES_HEAD_KEYWORDS_TAG; ?></td>
+            <td><table border="0" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="main" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
+                <td class="main"><?php echo tep_draw_textarea_field('articles_head_keywords_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '5', (isset($articles_head_keywords_tag[$languages[$i]['id']]) ? $articles_head_keywords_tag[$languages[$i]['id']] : tep_get_articles_head_keywords_tag($aInfo->articles_id, $languages[$i]['id']))); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+<?php
+ //   }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+
+<?php
+//    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+?>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_ARTICLES_DESCRIPTION; ?></td>
+            <td><table border="0" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="main" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
+                <td class="main"><?php echo tep_draw_textarea_field('articles_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($articles_description[$languages[$i]['id']]) ? $articles_description[$languages[$i]['id']] : tep_get_articles_description($aInfo->articles_id, $languages[$i]['id'])),' style="width: 100%" mce_editable="true"'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+<?php
+//    }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+//    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+?>
+          <tr>
+            <td class="main"><?php  echo TEXT_ARTICLES_URL . '<br><small>' . TEXT_ARTICLES_URL_WITHOUT_HTTP . '</small>'; ?></td>
+            <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('articles_url[' . $languages[$i]['id'] . ']', (isset($articles_url[$languages[$i]['id']]) ? $articles_url[$languages[$i]['id']] : tep_get_articles_url($aInfo->articles_id, $languages[$i]['id'])), 'size="35"'); ?></td>
+          </tr>
+<?php
+//    }
+?>
+        </table>
+</td>
+                  </tr>
+                </table>
+              </div>
+<?php
+    }
+?>
+            </div>
+<script type="text/javascript">
+//<![CDATA[
+setupAllTabs();
+//]]>
+</script>
+    </td>
+      </tr>
+</table><table border="0" cellspacing="0" cellpadding="0" width="80%">
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main" align="right"><?php echo tep_draw_hidden_field('articles_date_added', (tep_not_null($aInfo->articles_date_added) ? $aInfo->articles_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . (isset($HTTP_GET_VARS['aID']) ? '&aID=' . $HTTP_GET_VARS['aID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </tr>
+    </table></form>
+<?php
+  } elseif ($action == 'article_preview') {
+    if (tep_not_null($HTTP_POST_VARS)) {
+      $aInfo = new objectInfo($HTTP_POST_VARS);
+      $articles_name = $HTTP_POST_VARS['articles_name'];
+      $articles_description = $HTTP_POST_VARS['articles_description'];
+      $articles_url = $HTTP_POST_VARS['articles_url'];
+      $articles_head_title_tag = $HTTP_POST_VARS['articles_head_title_tag'];
+      $articles_head_desc_tag = $HTTP_POST_VARS['articles_head_desc_tag'];
+      $articles_head_keywords_tag = $HTTP_POST_VARS['articles_head_keywords_tag'];
+    } else {
+      $article_query = tep_db_query("select a.articles_id, ad.language_id, ad.articles_name, ad.articles_description, ad.articles_url, ad.articles_head_title_tag, ad.articles_head_desc_tag, ad.articles_head_keywords_tag, a.articles_date_added, a.articles_last_modified, a.articles_date_available, a.articles_status, a.authors_id  from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_id = ad.articles_id and a.articles_id = '" . (int)$HTTP_GET_VARS['aID'] . "'");
+      $article = tep_db_fetch_array($article_query);
+
+      $aInfo = new objectInfo($article);
+    }
+
+    $form_action = (isset($HTTP_GET_VARS['aID'])) ? 'update_article' : 'insert_article';
+
+    echo tep_draw_form($form_action, FILENAME_ARTICLES, 'tPath=' . $tPath . (isset($HTTP_GET_VARS['aID']) ? '&aID=' . $HTTP_GET_VARS['aID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');
+
+    $languages = tep_get_languages();
+    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+      if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {
+        $aInfo->articles_name = tep_get_articles_name($aInfo->articles_id, $languages[$i]['id']);
+        $aInfo->articles_description = tep_get_articles_description($aInfo->articles_id, $languages[$i]['id']);
+        $aInfo->articles_url = tep_get_articles_url($aInfo->articles_id, $languages[$i]['id']);
+        $aInfo->articles_head_title_tag = tep_get_articles_head_title_tag($aInfo->articles_id, $languages[$i]['id']);
+        $aInfo->articles_head_desc_tag = tep_get_articles_head_desc_tag($aInfo->articles_id, $languages[$i]['id']);
+        $aInfo->articles_head_keywords_tag = tep_get_articles_head_keywords_tag($aInfo->articles_id, $languages[$i]['id']);
+      } else {
+        $aInfo->articles_name = tep_db_prepare_input($articles_name[$languages[$i]['id']]);
+        $aInfo->articles_description = tep_db_prepare_input($articles_description[$languages[$i]['id']]);
+        $aInfo->articles_url = tep_db_prepare_input($articles_url[$languages[$i]['id']]);
+        $aInfo->articles_head_title_tag = tep_db_prepare_input($articles_head_title_tag[$languages[$i]['id']]);
+        $aInfo->articles_head_desc_tag = tep_db_prepare_input($articles_head_desc_tag[$languages[$i]['id']]);
+        $aInfo->articles_head_keywords_tag = tep_db_prepare_input($articles_head_keywords_tag[$languages[$i]['id']]);
+      }
+?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" colspan="2"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $aInfo->articles_name; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+      if ($aInfo->articles_description) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo $aInfo->articles_description; ?></td>
+      </tr>
+<?php
+      }
+?>
+<?php
+      if ($aInfo->articles_url) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo sprintf(TEXT_ARTICLE_MORE_INFORMATION, $aInfo->articles_url); ?></td>
+      </tr>
+<?php
+      }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php
+      if ($aInfo->articles_date_available > date('Y-m-d')) {
+?>
+      <tr>
+        <td align="center" class="smallText"><?php echo sprintf(TEXT_ARTICLE_DATE_AVAILABLE, tep_date_long($aInfo->articles_date_available)); ?></td>
+      </tr>
+<?php
+      } else {
+?>
+      <tr>
+        <td align="center" class="smallText"><?php echo sprintf(TEXT_ARTICLE_DATE_ADDED, tep_date_long($aInfo->articles_date_added)); ?></td>
+      </tr>
+<?php
+      }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php
+    }
+
+    if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {
+      if (isset($HTTP_GET_VARS['origin'])) {
+        $pos_params = strpos($HTTP_GET_VARS['origin'], '?', 0);
+        if ($pos_params != false) {
+          $back_url = substr($HTTP_GET_VARS['origin'], 0, $pos_params);
+          $back_url_params = substr($HTTP_GET_VARS['origin'], $pos_params + 1);
+        } else {
+          $back_url = $HTTP_GET_VARS['origin'];
+          $back_url_params = '';
+        }
+      } else {
+        $back_url = FILENAME_ARTICLES;
+        $back_url_params = 'tPath=' . $tPath . '&aID=' . $aInfo->articles_id;
+      }
+?>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+    } else {
+?>
+      <tr>
+        <td align="right" class="smallText">
+<?php
+/* Re-Post all POST'ed variables */
+      reset($HTTP_POST_VARS);
+      while (list($key, $value) = each($HTTP_POST_VARS)) {
+        if (!is_array($HTTP_POST_VARS[$key])) {
+          echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+        }
+      }
+      $languages = tep_get_languages();
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        echo tep_draw_hidden_field('articles_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($articles_name[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('articles_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($articles_description[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('articles_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($articles_url[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('articles_head_title_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($articles_head_title_tag[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('articles_head_desc_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($articles_head_desc_tag[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('articles_head_keywords_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($articles_head_keywords_tag[$languages[$i]['id']])));
+      }
+
+      echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '&nbsp;&nbsp;';
+
+      if (isset($HTTP_GET_VARS['aID'])) {
+        echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
+      } else {
+        echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
+      }
+      echo '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . (isset($HTTP_GET_VARS['aID']) ? '&aID=' . $HTTP_GET_VARS['aID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+?></td>
+      </tr>
+    </table></form>
+<?php
+    }
+  } else {
+?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="smallText" align="right">
+<?php
+    echo tep_draw_form('search', FILENAME_ARTICLES, '', 'get');
+    echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search');
+    if (isset($HTTP_GET_VARS[tep_session_name()])) {
+      echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+    }
+    echo '</form>';
+?>
+                </td>
+              </tr>
+              <tr>
+                <td class="smallText" align="right">
+<?php
+    echo tep_draw_form('goto', FILENAME_ARTICLES, '', 'get');
+    echo HEADING_TITLE_GOTO . ' ' . tep_draw_pull_down_menu('tPath', tep_get_topic_tree(), $current_topic_id, 'onChange="this.form.submit();"');
+    if (isset($HTTP_GET_VARS[tep_session_name()])) {
+      echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+    }
+    echo '</form>';
+?>
+                </td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TOPICS_ARTICLES; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $topics_count = 0;
+    $rows = 0;
+    if (isset($HTTP_GET_VARS['search'])) {
+      $search = tep_db_prepare_input($HTTP_GET_VARS['search']);
+
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id, t.sort_order, t.date_added, t.last_modified from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' and td.topics_name like '%" . tep_db_input($search) . "%' order by t.sort_order, td.topics_name");
+    } else {
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id, t.sort_order, t.date_added, t.last_modified from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$current_topic_id . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by t.sort_order, td.topics_name");
+    }
+    while ($topics = tep_db_fetch_array($topics_query)) {
+      $topics_count++;
+      $rows++;
+
+// Get parent_id for subtopics if search
+      if (isset($HTTP_GET_VARS['search'])) $tPath= $topics['parent_id'];
+
+      if ((!isset($HTTP_GET_VARS['tID']) && !isset($HTTP_GET_VARS['aID']) || (isset($HTTP_GET_VARS['tID']) && ($HTTP_GET_VARS['tID'] == $topics['topics_id']))) && !isset($tInfo) && (substr($action, 0, 3) != 'new')) {
+        $topic_childs = array('childs_count' => tep_childs_in_topic_count($topics['topics_id']));
+        $topic_articles = array('articles_count' => tep_articles_in_topic_count($topics['topics_id']));
+
+        $tInfo_array = array_merge($topics, $topic_childs, $topic_articles);
+        $tInfo = new objectInfo($tInfo_array);
+      }
+
+      if (isset($tInfo) && is_object($tInfo) && ($topics['topics_id'] == $tInfo->topics_id) ) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, tep_get_topic_path($topics['topics_id'])) . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $topics['topics_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLES, tep_get_topic_path($topics['topics_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;<b>' . $topics['topics_name'] . '</b>'; ?></td>
+                <td class="dataTableContent" align="center">&nbsp;</td>
+                <td class="dataTableContent" align="right"><?php if (isset($tInfo) && is_object($tInfo) && ($topics['topics_id'] == $tInfo->topics_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $topics['topics_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+
+    $articles_count = 0;
+    if (isset($HTTP_GET_VARS['search'])) {
+      $articles_query = tep_db_query("select a.articles_id, ad.articles_name, a.articles_date_added, a.articles_last_modified, a.articles_date_available, a.articles_status, a2t.topics_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad, " . TABLE_ARTICLES_TO_TOPICS . " a2t where a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and a.articles_id = a2t.articles_id and ad.articles_name like '%" . tep_db_input($search) . "%' order by ad.articles_name");
+    } else {
+      $articles_query = tep_db_query("select a.articles_id, ad.articles_name, a.articles_date_added, a.articles_last_modified, a.articles_date_available, a.articles_status from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad, " . TABLE_ARTICLES_TO_TOPICS . " a2t where a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and a.articles_id = a2t.articles_id and a2t.topics_id = '" . (int)$current_topic_id . "' order by ad.articles_name");
+    }
+    while ($articles = tep_db_fetch_array($articles_query)) {
+      $articles_count++;
+      $rows++;
+
+// Get topics_id for article if search
+      if (isset($HTTP_GET_VARS['search'])) $tPath = $articles['topics_id'];
+
+      if ( (!isset($HTTP_GET_VARS['aID']) && !isset($HTTP_GET_VARS['tID']) || (isset($HTTP_GET_VARS['aID']) && ($HTTP_GET_VARS['aID'] == $articles['articles_id']))) && !isset($aInfo) && !isset($tInfo) && (substr($action, 0, 3) != 'new')) {
+// find out the rating average from customer reviews
+        $reviews_query = tep_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_ARTICLE_REVIEWS . " where articles_id = '" . (int)$articles['articles_id'] . "'");
+        $reviews = tep_db_fetch_array($reviews_query);
+        $aInfo_array = array_merge($articles, $reviews);
+        $aInfo = new objectInfo($aInfo_array);
+      }
+
+      if (isset($aInfo) && is_object($aInfo) && ($articles['articles_id'] == $aInfo->articles_id) ) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id'] . '&action=article_preview&read=only') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id'] . '&action=article_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $articles['articles_name']; ?></td>
+                <td class="dataTableContent" align="center">
+<?php
+      if ($articles['articles_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES, 'action=setflag&flag=0&aID=' . $articles['articles_id'] . '&tPath=' . $tPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_ARTICLES, 'action=setflag&flag=1&aID=' . $articles['articles_id'] . '&tPath=' . $tPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($aInfo) && is_object($aInfo) && ($articles['articles_id'] == $aInfo->articles_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $articles['articles_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+
+    $tPath_back = '';
+    if (sizeof($tPath_array) > 0) {
+      for ($i=0, $n=sizeof($tPath_array)-1; $i<$n; $i++) {
+        if (empty($tPath_back)) {
+          $tPath_back .= $tPath_array[$i];
+        } else {
+          $tPath_back .= '_' . $tPath_array[$i];
+        }
+      }
+    }
+
+    $tPath_back = (tep_not_null($tPath_back)) ? 'tPath=' . $tPath_back . '&' : '';
+?>
+              <tr>
+                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText"><?php echo TEXT_TOPICS . '&nbsp;' . $topics_count . '<br>' . TEXT_ARTICLES . '&nbsp;' . $articles_count; ?></td>
+                    <td align="right" class="smallText"><?php if (sizeof($tPath_array) > 0) echo '<a href="' . tep_href_link(FILENAME_ARTICLES, $tPath_back . 'tID=' . $current_topic_id) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>&nbsp;'; if (!isset($HTTP_GET_VARS['search'])) echo '<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&action=new_topic') . '">' . tep_image_button('button_new_topic.gif', IMAGE_NEW_TOPIC) . '</a>&nbsp;' . $add_str; ?>&nbsp;</td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+    $heading = array();
+    $contents = array();
+    switch ($action) {
+      case 'new_topic':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_TOPIC . '</b>');
+
+        $contents = array('form' => tep_draw_form('newtopic', FILENAME_ARTICLES, 'action=insert_topic&tPath=' . $tPath, 'post', 'enctype="multipart/form-data"'));
+        $contents[] = array('text' => TEXT_NEW_TOPIC_INTRO);
+
+        $topic_inputs_string = '';
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $topic_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('topics_name[' . $languages[$i]['id'] . ']');
+        }
+
+        $contents[] = array('text' => '<br>' . TEXT_TOPICS_NAME . $topic_inputs_string);
+        $contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', '', 'size="2"'));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'edit_topic':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_TOPIC . '</b>');
+
+        $contents = array('form' => tep_draw_form('topics', FILENAME_ARTICLES, 'action=update_topic&tPath=' . $tPath, 'post', 'enctype="multipart/form-data"') . tep_draw_hidden_field('topics_id', $tInfo->topics_id));
+        $contents[] = array('text' => TEXT_EDIT_INTRO);
+
+        $topic_inputs_string = '';
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $topic_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('topics_name[' . $languages[$i]['id'] . ']', tep_get_topic_name($tInfo->topics_id, $languages[$i]['id']));
+        }
+
+        $contents[] = array('text' => '<br>' . TEXT_EDIT_TOPICS_NAME . $topic_inputs_string);
+        $contents[] = array('text' => '<br>' . TEXT_EDIT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', $tInfo->sort_order, 'size="2"'));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $tInfo->topics_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'delete_topic':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_TOPIC . '</b>');
+
+        $contents = array('form' => tep_draw_form('topics', FILENAME_ARTICLES, 'action=delete_topic_confirm&tPath=' . $tPath) . tep_draw_hidden_field('topics_id', $tInfo->topics_id));
+        $contents[] = array('text' => TEXT_DELETE_TOPIC_INTRO);
+        $contents[] = array('text' => '<br><b>' . $tInfo->topics_name . '</b>');
+        if ($tInfo->childs_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_CHILDS, $tInfo->childs_count));
+        if ($tInfo->articles_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_ARTICLES, $tInfo->articles_count));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $tInfo->topics_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'move_topic':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_TOPIC . '</b>');
+
+        $contents = array('form' => tep_draw_form('topics', FILENAME_ARTICLES, 'action=move_topic_confirm&tPath=' . $tPath) . tep_draw_hidden_field('topics_id', $tInfo->topics_id));
+        $contents[] = array('text' => sprintf(TEXT_MOVE_TOPICS_INTRO, $tInfo->topics_name));
+        $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $tInfo->topics_name) . '<br>' . tep_draw_pull_down_menu('move_to_topic_id', tep_get_topic_tree(), $current_topic_id));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $tInfo->topics_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'delete_article':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ARTICLE . '</b>');
+
+        $contents = array('form' => tep_draw_form('articles', FILENAME_ARTICLES, 'action=delete_article_confirm&tPath=' . $tPath) . tep_draw_hidden_field('articles_id', $aInfo->articles_id));
+        $contents[] = array('text' => TEXT_DELETE_ARTICLE_INTRO);
+        $contents[] = array('text' => '<br><b>' . $aInfo->articles_name . '</b>');
+
+        $article_topics_string = '';
+        $article_topics = tep_generate_topic_path($aInfo->articles_id, 'article');
+        for ($i = 0, $n = sizeof($article_topics); $i < $n; $i++) {
+          $topic_path = '';
+          for ($j = 0, $k = sizeof($article_topics[$i]); $j < $k; $j++) {
+            $topic_path .= $article_topics[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
+          }
+          $topic_path = substr($topic_path, 0, -16);
+          $article_topics_string .= tep_draw_checkbox_field('article_topics[]', $article_topics[$i][sizeof($article_topics[$i])-1]['id'], true) . '&nbsp;' . $topic_path . '<br>';
+        }
+        $article_topics_string = substr($article_topics_string, 0, -4);
+
+        $contents[] = array('text' => '<br>' . $article_topics_string);
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $aInfo->articles_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'move_article':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_ARTICLE . '</b>');
+
+        $contents = array('form' => tep_draw_form('articles', FILENAME_ARTICLES, 'action=move_article_confirm&tPath=' . $tPath) . tep_draw_hidden_field('articles_id', $aInfo->articles_id));
+        $contents[] = array('text' => sprintf(TEXT_MOVE_ARTICLES_INTRO, $aInfo->articles_name));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_TOPICS . '<br><b>' . tep_output_generated_topic_path($aInfo->articles_id, 'article') . '</b>');
+        $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $aInfo->articles_name) . '<br>' . tep_draw_pull_down_menu('move_to_topic_id', tep_get_topic_tree(), $current_topic_id));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $aInfo->articles_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'copy_to':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
+
+        $contents = array('form' => tep_draw_form('copy_to', FILENAME_ARTICLES, 'action=copy_to_confirm&tPath=' . $tPath) . tep_draw_hidden_field('articles_id', $aInfo->articles_id));
+        $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_TOPICS . '<br><b>' . tep_output_generated_topic_path($aInfo->articles_id, 'article') . '</b>');
+        $contents[] = array('text' => '<br>' . TEXT_TOPICS . '<br>' . tep_draw_pull_down_menu('topics_id', tep_get_topic_tree(), $current_topic_id));
+        $contents[] = array('text' => '<br>' . TEXT_HOW_TO_COPY . '<br>' . tep_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br>' . tep_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $aInfo->articles_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+
+      default:
+        if ($rows > 0) {
+          if (isset($tInfo) && is_object($tInfo)) { // topic info box contents
+            $heading[] = array('text' => '<b>' . $tInfo->topics_name . '</b>');
+
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $tInfo->topics_id . '&action=edit_topic') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $tInfo->topics_id . '&action=delete_topic') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&tID=' . $tInfo->topics_id . '&action=move_topic') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');
+            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($tInfo->date_added));
+            if (tep_not_null($tInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($tInfo->last_modified));
+            $contents[] = array('text' => '<br>' . TEXT_SUBTOPICS . ' ' . $tInfo->childs_count . '<br>' . TEXT_ARTICLES . ' ' . $tInfo->articles_count);
+          } elseif (isset($aInfo) && is_object($aInfo)) { // article info box contents
+            $heading[] = array('text' => '<b>' . tep_get_articles_name($aInfo->articles_id, $languages_id) . '</b>');
+
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $aInfo->articles_id . '&action=new_article') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $aInfo->articles_id . '&action=delete_article') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $aInfo->articles_id . '&action=move_article') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $tPath . '&aID=' . $aInfo->articles_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($aInfo->articles_date_added));
+            if (tep_not_null($aInfo->articles_last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($aInfo->articles_last_modified));
+            if (date('Y-m-d') < $aInfo->articles_date_available) $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . tep_date_short($aInfo->articles_date_available));
+            $contents[] = array('text' => '<br>' . TEXT_ARTICLES_AVERAGE_RATING . ' ' . number_format($aInfo->average_rating, 2) . '%');
+          }
+        } else { // create topic/article info
+          $heading[] = array('text' => '<b>' . EMPTY_TOPIC . '</b>');
+
+          $contents[] = array('text' => TEXT_NO_CHILD_TOPICS_OR_ARTICLES);
+        }
+        break;
+    }
+
+    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+      echo '            <td width="25%" valign="top">' . "\n";
+
+      $box = new box;
+      echo $box->infoBox($heading, $contents);
+
+      echo '            </td>' . "\n";
+    }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+<?php
+  }
+?>
+    </td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/articles_config.php
===================================================================
--- trunk/direct.openmoko.com/admin/articles_config.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/articles_config.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,167 @@
+<?php
+/*
+  $Id: articles_config.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  // Set configuration ID
+  $gID = 456;
+  require('includes/application_top.php');
+
+  if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+      case 'save':
+        $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);
+        $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . tep_db_input($cID) . "'");
+        tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $gID . '&cID=' . $cID));
+        break;
+    }
+  }
+
+  $cfg_group_query = tep_db_query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '" . $gID . "'");
+  $cfg_group = tep_db_fetch_array($cfg_group_query);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '" . $gID . "' order by sort_order");
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+    if (tep_not_null($configuration['use_function'])) {
+      $use_function = $configuration['use_function'];
+      if (ereg('->', $use_function)) {
+        $class_method = explode('->', $use_function);
+        if (!is_object(${$class_method[0]})) {
+          include(DIR_WS_CLASSES . $class_method[0] . '.php');
+          ${$class_method[0]} = new $class_method[0]();
+        }
+        $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
+      } else {
+        $cfgValue = tep_call_function($use_function, $configuration['configuration_value']);
+      }
+    } else {
+      $cfgValue = $configuration['configuration_value'];
+    }
+
+    if (((!$HTTP_GET_VARS['cID']) || (@$HTTP_GET_VARS['cID'] == $configuration['configuration_id'])) && (!$cInfo) && (substr($HTTP_GET_VARS['action'], 0, 3) != 'new')) {
+      $cfg_extra_query = tep_db_query("select configuration_key, configuration_description, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . $configuration['configuration_id'] . "'");
+      $cfg_extra = tep_db_fetch_array($cfg_extra_query);
+
+      $cInfo_array = array_merge($configuration, $cfg_extra);
+      $cInfo = new objectInfo($cInfo_array);
+    }
+
+    if ( (is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
+      echo '                  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $gID . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $gID . '&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $configuration['configuration_title']; ?></td>
+                <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $gID . '&cID=' . $configuration['configuration_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+    case 'edit':
+      $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function) {
+        eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value) . '");');
+      } else {
+        $value_field = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
+      }
+
+      $contents = array('form' => tep_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $gID . '&cID=' . $cInfo->configuration_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $gID . '&cID=' . $cInfo->configuration_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $gID . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+        $contents[] = array('text' => '<br>' . $cInfo->configuration_description);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
+        if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/articles_xsell.php
===================================================================
--- trunk/direct.openmoko.com/admin/articles_xsell.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/articles_xsell.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,313 @@
+<?php
+/*
+  $Id: articles_xsell.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  cross.sale.php created By Isaac Mualem im at imwebdesigning.com
+
+  Modified by Andrew Edmond (osc at aravia.com)
+  Sept 16th, 2002
+
+  Further Modified by Rob Anderson 12 Dec 03
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<title><?php echo TITLE; ?></title>
+
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php include(DIR_WS_INCLUDES . 'header.php');?>
+<!-- header_eof //-->
+
+
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+<td valign='top' align='left' width="100%">
+
+    <table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table>
+    
+     <table width="100%" border="0" cellpadding="0"  cellspacing="0">
+        <tr><td align=left>
+        <?php
+  /* general_db_conct($query) function */
+  /* calling the function:  list ($test_a, $test_b) = general_db_conct($query); */
+  function general_db_conct($query_1)
+  {
+    $result_1 = tep_db_query($query_1);
+      $num_of_rows = mysql_num_rows($result_1);
+    for ($i=0;$i<$num_of_rows;$i++)
+    {
+      $fields = mysql_fetch_row($result_1);
+      $a_to_pass[$i]= $fields[$y=0];
+      $b_to_pass[$i]= $fields[++$y];
+          $c_to_pass[$i]= $fields[++$y];
+      $d_to_pass[$i]= $fields[++$y];
+      $e_to_pass[$i]= $fields[++$y];
+      $f_to_pass[$i]= $fields[++$y];
+      $g_to_pass[$i]= $fields[++$y];
+      $h_to_pass[$i]= $fields[++$y];
+      $i_to_pass[$i]= $fields[++$y];
+      $j_to_pass[$i]= $fields[++$y];
+      $k_to_pass[$i]= $fields[++$y];
+      $l_to_pass[$i]= $fields[++$y];
+      $m_to_pass[$i]= $fields[++$y];
+      $n_to_pass[$i]= $fields[++$y];
+      $o_to_pass[$i]= $fields[++$y];
+    }
+  return array($a_to_pass,$b_to_pass,$c_to_pass,$d_to_pass,$e_to_pass,$f_to_pass,$g_to_pass,$h_to_pass,$i_to_pass,$j_to_pass,$k_to_pass,$l_to_pass,$m_to_pass,$n_to_pass,$o_to_pass);
+  }//end of function  
+
+        // first major piece of the program
+        // we have no instructions, so just dump a full list of products and their status for cross selling 
+
+  if (!$add_related_article_ID )
+  {
+        $query = "select a.articles_id, ad.articles_name, ad.articles_description, ad.articles_url from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where ad.articles_id = a.articles_id and ad.language_id = '" . (int)$languages_id . "' order by ad.articles_name";
+  list ($articles_id, $articles_name, $articles_description, $articles_url) = general_db_conct($query);
+  ?>
+        
+            <table border="0" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
+              <tr class="dataTableHeadingRow"> 
+                <td class="dataTableHeadingContent" align="center" nowrap><!-- ID --><?php echo HEADING_ARTICLE_ID?></td>
+                <td class="dataTableHeadingContent"><?php echo HEADING_ARTICLE_NAME; ?></td>
+                <td class="dataTableHeadingContent" nowrap><?php echo HEADING_CROSS_ASSOCIATION; ?></td>
+                <td class="dataTableHeadingContent" colspan="3" align="center" nowrap><?php echo HEADING_CROSS_SELL_ACTIONS; ?></td>
+              </tr>
+               <?php 
+         $num_of_articles = sizeof($articles_id);
+        for ($i=0; $i < $num_of_articles; $i++)
+          {
+          /* now we will query the DB for existing related items */
+                    $query = "select pd.products_name, ax.xsell_id from " . TABLE_ARTICLES_XSELL . " ax, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = ax.xsell_id and ax.articles_id ='".$articles_id[$i]."' and pd.language_id = '" . (int)$languages_id . "' order by ax.sort_order";
+          list ($Related_items, $xsell_ids) = general_db_conct($query);
+
+          echo "<tr bgcolor='#FFFFFF'>";
+          echo "<td class=\"dataTableContent\" valign=\"top\">&nbsp;".$articles_id[$i]."&nbsp;</td>\n";
+          echo "<td class=\"dataTableContent\" valign=\"top\">&nbsp;".$articles_name[$i]."&nbsp;</td>\n";
+          if ($Related_items)
+          {
+              echo "<td  class=\"dataTableContent\"><ol>";
+            foreach ($Related_items as $display)
+            echo '<li>'. $display .'&nbsp;';
+            echo"</ol></td>\n";
+            }
+          else
+            echo "<td class=\"dataTableContent\">--</td>\n";
+          echo '<td class="dataTableContent"  valign="top">&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES_XSELL, 'add_related_article_ID=' . $articles_id[$i], 'NONSSL') . '">Add/Remove</a></td>';
+                  
+          if (count($Related_items)>1)
+          {
+            echo '<td class="dataTableContent" valign="top">&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES_XSELL, 'sort=1&add_related_article_ID=' . $articles_id[$i], 'NONSSL') . '">Sort</a>&nbsp;</td>';
+          } else {
+            echo "<td class=\"dataTableContent\" valign=top align=center>--</td>";
+            }
+          echo "</tr>\n";
+          unset($Related_items);
+          }
+        ?>
+
+            </table>
+            <?php 
+      } // the end of -> if (!$add_related_article_ID)
+
+  if ($_POST && !$sort)
+  {
+      if ($_POST[run_update]==true)
+    {
+      $query ="DELETE FROM " . TABLE_ARTICLES_XSELL . " WHERE articles_id = '".$_POST[add_related_article_ID]."'";
+      if (!tep_db_query($query))
+    exit(TEXT_NO_DELETE);
+    }
+    if ($_POST[xsell_id])
+    foreach ($_POST[xsell_id] as $temp)
+      {
+      $query = "INSERT INTO " . TABLE_ARTICLES_XSELL . " VALUES ('',$_POST[add_related_article_ID],$temp,1)";
+      if (!tep_db_query($query))
+    exit(TEXT_NO_INSERT);
+    } ?>
+              <tr>
+                  <td class="main"><?php echo TEXT_DATABASE_UPDATED; ?></td>
+                </tr>
+                <tr>
+                  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                </tr>
+                <tr>
+                  <td class="main"><?php echo sprintf(TEXT_LINK_SORT_PRODUCTS, tep_href_link(FILENAME_ARTICLES_XSELL, '&sort=1&add_related_article_ID=' . $add_related_article_ID, 'NONSSL')); ?></td>
+                </tr>
+                <tr>
+                  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                </tr>
+                <tr>
+                  <td class="main"><?php echo sprintf(TEXT_LINK_MAIN_PAGE, tep_href_link(FILENAME_ARTICLES_XSELL, '', 'NONSSL')); ?></td>
+                </tr>
+                <tr>
+                  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                </tr>
+    <?php
+
+//    if ($_POST[xsell_id])
+  //  echo '<a href="' . tep_href_link(FILENAME_ARTICLES_XSELL, 'sort=1&add_related_article_ID=' . $_POST[add_related_article_ID], 'NONSSL') . '">Click here to sort (top to bottom) the added cross sale</a>' . "\n";
+  }
+    
+        if ($add_related_article_ID && ! $_POST && !$sort)
+  { ?>
+    <table border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
+               <form action="<?php tep_href_link(FILENAME_ARTICLES_XSELL, '', 'NONSSL'); ?>" method="post">
+                <tr class="dataTableHeadingRow">
+                  <td class="dataTableHeadingContent">&nbsp;</td>
+                  <td class="dataTableHeadingContent" nowrap><!-- ID --><?php echo HEADING_ARTICLE_ID?></td>
+                  <td class="dataTableHeadingContent"><?php echo HEADING_PRODUCT_NAME; ?></td>
+                </tr>
+  
+                <?php 
+
+        $query = "select p.products_id, pd.products_name, pd.products_description, pd.products_url from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name";
+
+      list ($products_id, $products_name, $products_description, $products_url  ) = general_db_conct($query);
+       $num_of_products = sizeof($products_id);
+        $query = "select * from " . TABLE_ARTICLES_XSELL . " where articles_id = '".$add_related_article_ID."'";
+            list ($ID_PR, $products_id_pr, $xsell_id_pr) = general_db_conct($query);
+          for ($i=0; $i < $num_of_products; $i++)
+          {
+          ?><tr bgcolor="#FFFFFF">
+            <td class="dataTableContent">
+          
+          <input <?php /* this is to see it it is in the DB */
+            $run_update=false; // set to false to insert new entry in the DB
+            if ($xsell_id_pr) foreach ($xsell_id_pr as $compare_checked)if ($products_id[$i]===$compare_checked) {echo "checked"; $run_update=true;} ?> size="20"  size="20"  name="xsell_id[]" type="checkbox" value="<?php echo $products_id[$i]; ?>"></td>
+          
+          <?php echo "<td  class=\"dataTableContent\" align=center>".$products_id[$i]."</td>\n"
+            ."<td class=\"dataTableContent\">".$products_name[$i]."</td>\n";
+          }?>
+          <tr>
+                      <td>&nbsp;</td>
+                      <td>&nbsp;</td>
+                      <td bgcolor="#CCCCCC">
+                        <input type="hidden" name="run_update" value="<?php if ($run_update==true) echo "true"; else echo "false" ?>">
+                <input type="hidden" name="add_related_article_ID" value="<?php echo $add_related_article_ID; ?>">
+                        <?php  echo tep_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES_XSELL) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?>
+                      </td>
+                </tr>
+              </form>
+            </table>
+    <?php }
+
+        // sort routines
+  if ($sort==1)
+  {
+  //  first lets take care of the DB update.
+      $run_once=0;
+    if ($_POST)
+    foreach ($_POST as $key_a => $value_a)
+    {
+    tep_db_connect();
+    $query = "UPDATE " . TABLE_ARTICLES_XSELL . " SET sort_order = '".$value_a."' WHERE xsell_id= '$key_a' ";
+    if ($value_a != 'Update')
+      if (!tep_db_query($query))
+        exit(TEXT_NO_UPDATE);
+      else
+        if ($run_once==0)
+        { ?>
+                <tr>
+                  <td class="main"><?php echo TEXT_DATABASE_UPDATED; ?></td>
+                </tr>
+                <tr>
+                  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                </tr>
+                <tr>
+                  <td class="main"><?php echo sprintf(TEXT_LINK_MAIN_PAGE, tep_href_link(FILENAME_ARTICLES_XSELL, '', 'NONSSL')); ?></td>
+                </tr>
+                <tr>
+                  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                </tr>
+      <?php
+            $run_once++;
+            }
+
+  }// end of foreach.
+  ?>
+  <form method="post" action="<?php tep_href_link(FILENAME_ARTICLES_XSELL, 'sort=1&add_related_article_ID=' . $add_related_article_ID, 'NONSSL'); ?>">
+              <table cellpadding="3" cellspacing="1" bgcolor="#CCCCCC" border="0">
+                <tr class="dataTableHeadingRow">
+                  <td class="dataTableHeadingContent"><!-- ID --><?php echo HEADING_ARTICLE_ID?></td>
+                  <td class="dataTableHeadingContent"><?php echo HEADING_PRODUCT_NAME; ?></td>
+                  <td class="dataTableHeadingContent"><?php echo HEADING_PRODUCT_ORDER; ?></td>
+                </tr>
+        <?php 
+        $query = "select * from " . TABLE_ARTICLES_XSELL . " where articles_id = '".$add_related_article_ID."'";
+        list ($ID_PR, $products_id_pr, $xsell_id_pr, $order_PR) = general_db_conct($query);
+        $ordering_size =sizeof($ID_PR);
+        for ($i=0;$i<$ordering_size;$i++)
+          {
+
+        $query = "select p.products_id, pd.products_name, pd.products_description, pd.products_url from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = ".$xsell_id_pr[$i]."";
+
+          list ($products_id, $products_name, $products_description, $products_url) = general_db_conct($query);
+
+          ?>
+          <tr class="dataTableContentRow" bgcolor="#FFFFFF">
+            <td class="dataTableContent"><?php echo $products_id[0]; ?></td>
+            <td class="dataTableContent"><?php echo $products_name[0]; ?></td>
+            <td class="dataTableContent" align="center"><select name="<?php echo $products_id[0]; ?>">
+              <?php for ($y=1;$y<=$ordering_size;$y++)
+                  {
+                echo "<option value=\"$y\"";
+                  if (!(strcmp($y, "$order_PR[$i]"))) {echo "SELECTED";}
+                  echo ">$y</option>";
+                }
+                ?>
+            </select></td>
+          </tr>
+          <?php } // the end of foreach
+                    ?>
+                <tr>
+                  <td>&nbsp;</td>
+                  <td bgcolor="#CCCCCC"><?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES_XSELL) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+                  <td>&nbsp;</td>
+                </tr>
+              </table>
+            </form>
+      
+      <?php }?>
+    
+    
+          </td>
+        </tr> 
+  </table>
+
+    
+</td>
+</tr>
+</table>
+<!-- body_text_eof //-->
+<!-- footer //-->
+<?php include(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php include(DIR_WS_INCLUDES . 'application_bottom.php');?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/authnet_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/authnet_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/authnet_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,164 @@
+<?php
+/*
+  $Id: invoice.php,v 1.2 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"><html <?php echo HTML_PARAMS; ?>>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><!-- Authorize.net Consolidated CRE Help Screen --><?php echo AUTHORIZE_NET_HELP_TITLE?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="admin/includes/general.js"></script>
+</head>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+
+
+     <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><!-- Authorize.net Consolidated CRE Edition --><?php echo AUTHORIZE_NET_HELP_MSG_1?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+       <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+         <td class="main">
+
+<div align="center"><h2><!-- Configuration Help Screen --><?php echo AUTHORIZE_NET_HELP_MSG_2?></h2></div>
+</td>
+</tr>
+<tr>
+ <td align="center">
+<!-- <a href="http://ecommexchange.com"><h2>Link to Apply for Authorize.net account</h2></a><br>
+(support the CRE project by using our Authorize.net partner) -->
+<?php echo AUTHORIZE_NET_HELP_MSG_3?>
+</td>
+</tr>
+<tr>
+<td>
+<hr align="center" size="4" width="450">
+</td>
+</tr>
+<tr>
+<td>
+<!-- User your browser back button to return to the Authorize.net edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Authorize.net testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Authorize.net Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Authorize.net User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Authorize.net Consolidated uses the AIM method of
+connecting to Authorize.net.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Authorize.net gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don't know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Authorize.net Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Authorize.net Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>
+<li>Trouble Shooting Notes </li>
+<p>If you experience high levels of transaction failure, you may need to adjust your sessions configuration.  Consult your technical support team for more information</p>  --><?php echo AUTHORIZE_NET_HELP_MSG_4?>
+
+<hr align="center" size="4" width="450">
+  </tr>
+        </td></table>
+          </tr>
+         </td>
+
+   </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/authors.php
===================================================================
--- trunk/direct.openmoko.com/admin/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,483 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+      case 'save':
+        if (isset($HTTP_GET_VARS['auID'])) $authors_id = tep_db_prepare_input($HTTP_GET_VARS['auID']);
+        $authors_name = tep_db_prepare_input($HTTP_POST_VARS['authors_name']);
+
+        $sql_data_array = array('authors_name' => $authors_name);
+
+        if ($action == 'insert') {
+          $insert_sql_data = array('date_added' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+          tep_db_perform(TABLE_AUTHORS, $sql_data_array);
+          $authors_id = tep_db_insert_id();
+        } elseif ($action == 'save') {
+          $update_sql_data = array('last_modified' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+          tep_db_perform(TABLE_AUTHORS, $sql_data_array, 'update', "authors_id = '" . (int)$authors_id . "'");
+        }
+
+        $languages = tep_get_languages();
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $authors_desc_array = $HTTP_POST_VARS['authors_description'];
+          $authors_url_array = $HTTP_POST_VARS['authors_url'];
+          $language_id = $languages[$i]['id'];
+
+          $sql_data_array = array('authors_description' => tep_db_prepare_input($authors_desc_array[$language_id]),
+                                  'authors_url' => tep_db_prepare_input($authors_url_array[$language_id]));
+
+          if ($action == 'insert') {
+            $insert_sql_data = array('authors_id' => $authors_id,
+                                     'languages_id' => $language_id);
+
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_AUTHORS_INFO, $sql_data_array);
+          } elseif ($action == 'save') {
+            tep_db_perform(TABLE_AUTHORS_INFO, $sql_data_array, 'update', "authors_id = '" . (int)$authors_id . "' and languages_id = '" . (int)$language_id . "'");
+          }
+        }
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('authors');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_AUTHORS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'auID=' . $authors_id));
+        break;
+      case 'deleteconfirm':
+        $authors_id = tep_db_prepare_input($HTTP_GET_VARS['auID']);
+
+        tep_db_query("delete from " . TABLE_AUTHORS . " where authors_id = '" . (int)$authors_id . "'");
+        tep_db_query("delete from " . TABLE_AUTHORS_INFO . " where authors_id = '" . (int)$authors_id . "'");
+
+        if (isset($HTTP_POST_VARS['delete_articles']) && ($HTTP_POST_VARS['delete_articles'] == 'on')) {
+          $articles_query = tep_db_query("select articles_id from " . TABLE_ARTICLES . " where authors_id = '" . (int)$authors_id . "'");
+          while ($articles = tep_db_fetch_array($articles_query)) {
+            tep_remove_article($articles['articles_id']);
+          }
+        } else {
+          tep_db_query("update " . TABLE_ARTICLES . " set authors_id = '' where authors_id = '" . (int)$authors_id . "'");
+        }
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('authors');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<?php
+// BOF: WebMakers.com Changed: Header Tag Controller v1.0
+// Replaced by header_tags.php
+if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
+  require(DIR_WS_INCLUDES . 'header_tags.php');
+} else {
+?> 
+  <title><?php echo TITLE ?></title>
+<?php
+}
+// EOF: WebMakers.com Changed: Header Tag Controller v1.0
+?>
+<script language="Javascript1.2"><!-- // load htmlarea
+// MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 - 2.2 MS2 Articles Description HTML - Head
+        _editor_url = "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>htmlarea/";  // URL to htmlarea files
+          var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
+           if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
+            if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
+             if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
+         <?php if (ARTICLE_MANAGER_WYSIWYG_BASIC == 'Basic'){ ?>  if (win_ie_ver >= 5.5) {
+         document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_basic.js"');
+         document.write(' language="Javascript1.2"></scr' + 'ipt>');
+            } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
+         <?php } else{ ?> if (win_ie_ver >= 5.5) {
+         document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_advanced.js"');
+         document.write(' language="Javascript1.2"></scr' + 'ipt>');
+            } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
+         <?php }?>
+// --></script>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupImageWindow(url) {
+  window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ($action == 'new') {
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_HEADING_NEW_AUTHOR; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('authors', FILENAME_AUTHORS, 'action=insert', 'post', 'enctype="multipart/form-data"'); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" colspan="2"><?php echo TEXT_NEW_INTRO; ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_AUTHORS_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('authors_name', '', 'size="20"'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+  $languages = tep_get_languages();
+  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+?>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_AUTHORS_DESCRIPTION; ?></td>
+            <td>
+              <table border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td class="main" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;'; ?></td>
+                  <td class="main" valign="top"><?php echo tep_draw_textarea_field('authors_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', ''); ?></td>
+                </tr>
+              </table>
+            </td>
+          <tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_AUTHORS_URL; ?></td>
+            <td class="main" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('authors_url[' . $languages[$i]['id'] . ']', '', 'size="30"'); ?></td>
+          <tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+  }
+  // MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 Authors Description HTML - Head
+  if (ARTICLE_WYSIWYG_ENABLE == 'Enable') {
+?>
+      <script language="JavaScript1.2" defer>
+           var config = new Object();
+           config.width = "<?php echo ARTICLE_MANAGER_WYSIWYG_WIDTH; ?>px";
+           config.height = "<?php echo ARTICLE_MANAGER_WYSIWYG_HEIGHT; ?>px";
+           config.bodyStyle = 'background-color: <?php echo ARTICLE_MANAGER_WYSIWYG_BG_COLOUR; ?>; font-family: "<?php echo ARTICLE_MANAGER_WYSIWYG_FONT_TYPE; ?>"; color: <?php echo ARTICLE_MANAGER_WYSIWYG_FONT_COLOUR; ?>; font-size: <?php echo ARTICLE_MANAGER_WYSIWYG_FONT_SIZE; ?>pt;';
+           config.debug = <?php echo ARTICLE_MANAGER_WYSIWYG_DEBUG; ?>;
+      <?php for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { ?>
+        editor_generate('authors_description[<?php echo $languages[$i]['id']; ?>]',config);
+      <?php } ?>
+      </script>
+<?php
+  }
+?>
+      <tr>
+        <td class="main">&nbsp;</td>
+        <td class="main" align="left"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $HTTP_GET_VARS['auID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form>
+      </tr>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  } elseif ($action == 'edit') {
+
+    $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " where authors_id = '" . $HTTP_GET_VARS['auID'] . "'");
+    $authors = tep_db_fetch_array($authors_query);
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_HEADING_EDIT_AUTHOR; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('authors', FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $authors['authors_id'] . '&action=save', 'post', 'enctype="multipart/form-data"'); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" colspan="2"><?php echo TEXT_EDIT_INTRO; ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_AUTHORS_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('authors_name', $authors['authors_name'], 'size="20"'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+  $languages = tep_get_languages();
+  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+?>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_AUTHORS_DESCRIPTION; ?></td>
+            <td>
+              <table border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td class="main" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;'; ?></td>
+                  <td class="main" valign="top"><?php echo tep_draw_textarea_field('authors_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', tep_get_author_description($authors['authors_id'], $languages[$i]['id'])); ?></td>
+                </tr>
+              </table>
+            </td>
+          <tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_AUTHORS_URL; ?></td>
+            <td class="main" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('authors_url[' . $languages[$i]['id'] . ']', tep_get_author_url($authors['authors_id'], $languages[$i]['id']), 'size="30"'); ?></td>
+          <tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+  }
+  // MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.7 Authors Description HTML - Head
+  if (ARTICLE_WYSIWYG_ENABLE == 'Enable') {
+?>
+      <script language="JavaScript1.2" defer>
+           var config = new Object();
+           config.width = "<?php echo ARTICLE_MANAGER_WYSIWYG_WIDTH; ?>px";
+           config.height = "<?php echo ARTICLE_MANAGER_WYSIWYG_HEIGHT; ?>px";
+           config.bodyStyle = 'background-color: <?php echo ARTICLE_MANAGER_WYSIWYG_BG_COLOUR; ?>; font-family: "<?php echo ARTICLE_MANAGER_WYSIWYG_FONT_TYPE; ?>"; color: <?php echo ARTICLE_MANAGER_WYSIWYG_FONT_COLOUR; ?>; font-size: <?php echo ARTICLE_MANAGER_WYSIWYG_FONT_SIZE; ?>pt;';
+           config.debug = <?php echo ARTICLE_MANAGER_WYSIWYG_DEBUG; ?>;
+      <?php for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { ?>
+        editor_generate('authors_description[<?php echo $languages[$i]['id']; ?>]',config);
+      <?php } ?>
+      </script>
+<?php
+  }
+?>
+      <tr>
+        <td class="main">&nbsp;</td>
+        <td class="main" align="left"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $authors['authors_id']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form>
+      </tr>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  } elseif ($action == 'preview') {
+
+    $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " where authors_id = '" . $HTTP_GET_VARS['auID'] . "'");
+    $authors = tep_db_fetch_array($authors_query)
+
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_ARTICLE_BY . $authors['authors_name']; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  $languages = tep_get_languages();
+  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+?>
+          <tr>
+            <td class="main" colspan="2" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?></td>
+          <tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main" valign="top"><?php echo tep_get_author_description($authors['authors_id'], $languages[$i]['id']); ?></td>
+          <tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <?php if(tep_not_null(tep_get_author_url($authors['authors_id'], $languages[$i]['id']))) { ?>
+          <tr>
+            <td class="main" valign="top"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_get_author_url($authors['authors_id'], $languages[$i]['id'])); ?></td>
+          <tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <?php } ?>
+<?php
+  }
+?>
+      <tr>
+        <td class="main" colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $authors['authors_id']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </form>
+      </tr>
+          </tr>
+        </table></td>
+      </tr>
+<?php } else { ?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_AUTHORS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $authors_query_raw = "select authors_id, authors_name, date_added, last_modified from " . TABLE_AUTHORS . " order by authors_name";
+  $authors_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $authors_query_raw, $authors_query_numrows);
+  $authors_query = tep_db_query($authors_query_raw);
+  while ($authors = tep_db_fetch_array($authors_query)) {
+    if ((!isset($HTTP_GET_VARS['auID']) || (isset($HTTP_GET_VARS['auID']) && ($HTTP_GET_VARS['auID'] == $authors['authors_id']))) && !isset($auInfo) && (substr($action, 0, 3) != 'new')) {
+      $author_articles_query = tep_db_query("select count(*) as articles_count from " . TABLE_ARTICLES . " where authors_id = '" . (int)$authors['authors_id'] . "'");
+      $author_articles = tep_db_fetch_array($author_articles_query);
+
+     $auInfo_array = array_merge($authors, $author_articles);
+      $auInfo = new objectInfo($auInfo_array);
+    }
+
+    if (isset($auInfo) && is_object($auInfo) && ($authors['authors_id'] == $auInfo->authors_id)) {
+      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $authors['authors_id'] . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $authors['authors_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $authors['authors_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($auInfo) && is_object($auInfo) && ($authors['authors_id'] == $auInfo->authors_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $authors['authors_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $authors_split->display_count($authors_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_AUTHORS); ?></td>
+                    <td class="smallText" align="right"><?php echo $authors_split->display_links($authors_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+<?php
+  if (empty($action)) {
+?>
+              <tr>
+                <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $auInfo->authors_id . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_DELETE_AUTHOR . '</b>');
+
+      $contents = array('form' => tep_draw_form('authors', FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $auInfo->authors_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $auInfo->authors_name . '</b>');
+
+      if ($auInfo->articles_count > 0) {
+        $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_articles') . ' ' . TEXT_DELETE_ARTICLES);
+        $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_ARTICLES, $auInfo->articles_count));
+      }
+
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $auInfo->authors_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($auInfo) && is_object($auInfo)) {
+        $heading[] = array('text' => '<b>' . $auInfo->authors_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $auInfo->authors_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $auInfo->authors_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br>' . ' <a href="' . tep_href_link(FILENAME_AUTHORS, 'page=' . $HTTP_GET_VARS['page'] . '&auID=' . $HTTP_GET_VARS['auID']) . '&action=preview' . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($auInfo->date_added));
+        if (tep_not_null($auInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($auInfo->last_modified));
+        $contents[] = array('text' => '<br>' . TEXT_ARTICLES . ' ' . $auInfo->articles_count);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/backup.php
===================================================================
--- trunk/direct.openmoko.com/admin/backup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/backup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,498 @@
+<?php
+/*
+  $Id: backup.php,v 1.1.1.1 2004/03/04 23:38:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'forget':
+        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'");
+
+        $messageStack->add_session('search', SUCCESS_LAST_RESTORE_CLEARED, 'success');
+
+        tep_redirect(tep_href_link(FILENAME_BACKUP));
+        break;
+      case 'backupnow':
+        tep_set_time_limit(0);
+        $backup_file = 'db_' . DB_DATABASE . '-' . date('YmdHis') . '.sql';
+        $fp = fopen(DIR_FS_BACKUP . $backup_file, 'w');
+
+        $schema = '# osCommerce, Open Source E-Commerce Solutions' . "\n" .
+                  '# http://www.oscommerce.com' . "\n" .
+                  '#' . "\n" .
+                  '# Database Backup For ' . STORE_NAME . "\n" .
+                  '# Copyright (c) ' . date('Y') . ' ' . STORE_OWNER . "\n" .
+                  '#' . "\n" .
+                  '# Database: ' . DB_DATABASE . "\n" .
+                  '# Database Server: ' . DB_SERVER . "\n" .
+                  '#' . "\n" .
+                  '# Backup Date: ' . date(PHP_DATE_TIME_FORMAT) . "\n\n";
+        fputs($fp, $schema);
+
+        $tables_query = tep_db_query('show tables');
+        while ($tables = tep_db_fetch_array($tables_query)) {
+          list(,$table) = each($tables);
+
+          $schema = 'drop table if exists ' . $table . ';' . "\n" .
+                    'create table ' . $table . ' (' . "\n";
+
+          $table_list = array();
+          $fields_query = tep_db_query("show fields from " . $table);
+          while ($fields = tep_db_fetch_array($fields_query)) {
+            $table_list[] = $fields['Field'];
+
+            $schema .= '  ' . $fields['Field'] . ' ' . $fields['Type'];
+
+            if (strlen($fields['Default']) > 0) $schema .= ' default \'' . $fields['Default'] . '\'';
+
+            if ($fields['Null'] != 'YES') $schema .= ' not null';
+
+            if (isset($fields['Extra'])) $schema .= ' ' . $fields['Extra'];
+
+            $schema .= ',' . "\n";
+          }
+
+          $schema = ereg_replace(",\n$", '', $schema);
+
+// add the keys
+          $index = array();
+          $keys_query = tep_db_query("show keys from " . $table);
+          while ($keys = tep_db_fetch_array($keys_query)) {
+            $kname = $keys['Key_name'];
+
+            if (!isset($index[$kname])) {
+              $index[$kname] = array('unique' => !$keys['Non_unique'],
+                                     'columns' => array());
+            }
+
+            $index[$kname]['columns'][] = $keys['Column_name'];
+          }
+
+          while (list($kname, $info) = each($index)) {
+            $schema .= ',' . "\n";
+
+            $columns = implode($info['columns'], ', ');
+
+            if ($kname == 'PRIMARY') {
+              $schema .= '  PRIMARY KEY (' . $columns . ')';
+            } elseif ($info['unique']) {
+              $schema .= '  UNIQUE ' . $kname . ' (' . $columns . ')';
+            } else {
+              $schema .= '  KEY ' . $kname . ' (' . $columns . ')';
+            }
+          }
+
+          $schema .= "\n" . ');' . "\n\n";
+          fputs($fp, $schema);
+
+// dump the data
+          $rows_query = tep_db_query("select " . implode(',', $table_list) . " from " . $table);
+          while ($rows = tep_db_fetch_array($rows_query)) {
+            $schema = 'insert into ' . $table . ' (' . implode(', ', $table_list) . ') values (';
+
+            reset($table_list);
+            while (list(,$i) = each($table_list)) {
+              if (!isset($rows[$i])) {
+                $schema .= 'NULL, ';
+              } elseif (tep_not_null($rows[$i])) {
+                $row = addslashes($rows[$i]);
+                $row = ereg_replace("\n#", "\n".'\#', $row);
+
+                $schema .= '\'' . $row . '\', ';
+              } else {
+                $schema .= '\'\', ';
+              }
+            }
+
+            $schema = ereg_replace(', $', '', $schema) . ');' . "\n";
+            fputs($fp, $schema);
+
+          }
+        }
+
+        fclose($fp);
+
+        if (isset($HTTP_POST_VARS['download']) && ($HTTP_POST_VARS['download'] == 'yes')) {
+          switch ($HTTP_POST_VARS['compress']) {
+            case 'gzip':
+              exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file);
+              $backup_file .= '.gz';
+              break;
+            case 'zip':
+              exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
+              unlink(DIR_FS_BACKUP . $backup_file);
+              $backup_file .= '.zip';
+          }
+          header('Content-type: application/x-octet-stream');
+          header('Content-disposition: attachment; filename=' . $backup_file);
+
+          readfile(DIR_FS_BACKUP . $backup_file);
+          unlink(DIR_FS_BACKUP . $backup_file);
+
+          exit;
+        } else {
+          switch ($HTTP_POST_VARS['compress']) {
+            case 'gzip':
+              exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file);
+              break;
+            case 'zip':
+              exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
+              unlink(DIR_FS_BACKUP . $backup_file);
+          }
+
+          $messageStack->add_session('search', SUCCESS_DATABASE_SAVED, 'success');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_BACKUP));
+        break;
+      case 'restorenow':
+      case 'restorelocalnow':
+        tep_set_time_limit(0);
+
+        if ($action == 'restorenow') {
+          $read_from = $HTTP_GET_VARS['file'];
+
+          if (file_exists(DIR_FS_BACKUP . $HTTP_GET_VARS['file'])) {
+            $restore_file = DIR_FS_BACKUP . $HTTP_GET_VARS['file'];
+            $extension = substr($HTTP_GET_VARS['file'], -3);
+
+            if ( ($extension == 'sql') || ($extension == '.gz') || ($extension == 'zip') ) {
+              switch ($extension) {
+                case 'sql':
+                  $restore_from = $restore_file;
+                  $remove_raw = false;
+                  break;
+                case '.gz':
+                  $restore_from = substr($restore_file, 0, -3);
+                  exec(LOCAL_EXE_GUNZIP . ' ' . $restore_file . ' -c > ' . $restore_from);
+                  $remove_raw = true;
+                  break;
+                case 'zip':
+                  $restore_from = substr($restore_file, 0, -4);
+                  exec(LOCAL_EXE_UNZIP . ' ' . $restore_file . ' -d ' . DIR_FS_BACKUP);
+                  $remove_raw = true;
+              }
+
+              if (isset($restore_from) && file_exists($restore_from) && (filesize($restore_from) > 15000)) {
+                $fd = fopen($restore_from, 'rb');
+                $restore_query = fread($fd, filesize($restore_from));
+                fclose($fd);
+              }
+            }
+          }
+        } elseif ($action == 'restorelocalnow') {
+          $sql_file = new upload('sql_file');
+
+          if ($sql_file->parse() == true) {
+            $restore_query = fread(fopen($sql_file->tmp_filename, 'r'), filesize($sql_file->tmp_filename));
+            $read_from = $sql_file->filename;
+          }
+        }
+
+        if (isset($restore_query)) {
+          $sql_array = array();
+          $sql_length = strlen($restore_query);
+          $pos = strpos($restore_query, ';');
+          for ($i=$pos; $i<$sql_length; $i++) {
+            if ($restore_query[0] == '#') {
+              $restore_query = ltrim(substr($restore_query, strpos($restore_query, "\n")));
+              $sql_length = strlen($restore_query);
+              $i = strpos($restore_query, ';')-1;
+              continue;
+            }
+            if ($restore_query[($i+1)] == "\n") {
+              for ($j=($i+2); $j<$sql_length; $j++) {
+                if (trim($restore_query[$j]) != '') {
+                  $next = substr($restore_query, $j, 6);
+                  if ($next[0] == '#') {
+// find out where the break position is so we can remove this line (#comment line)
+                    for ($k=$j; $k<$sql_length; $k++) {
+                      if ($restore_query[$k] == "\n") break;
+                    }
+                    $query = substr($restore_query, 0, $i+1);
+                    $restore_query = substr($restore_query, $k);
+// join the query before the comment appeared, with the rest of the dump
+                    $restore_query = $query . $restore_query;
+                    $sql_length = strlen($restore_query);
+                    $i = strpos($restore_query, ';')-1;
+                    continue 2;
+                  }
+                  break;
+                }
+              }
+              if ($next == '') { // get the last insert query
+                $next = 'insert';
+              }
+              if ( (eregi('create', $next)) || (eregi('insert', $next)) || (eregi('drop t', $next)) ) {
+                $next = '';
+                $sql_array[] = substr($restore_query, 0, $i);
+                $restore_query = ltrim(substr($restore_query, $i+1));
+                $sql_length = strlen($restore_query);
+                $i = strpos($restore_query, ';')-1;
+              }
+            }
+          }
+
+          tep_db_query("drop table if exists address_book, address_format, banners, banners_history, categories, categories_description, configuration, configuration_group, counter, counter_history, countries, currencies, customers, customers_basket, customers_basket_attributes, customers_info, languages, manufacturers, manufacturers_info, orders, orders_products, orders_status, orders_status_history, orders_products_attributes, orders_products_download, products, products_attributes, products_attributes_download, prodcts_description, products_options, products_options_values, products_options_values_to_products_options, products_to_categories, reviews, reviews_description, sessions, specials, tax_class, tax_rates, geo_zones, whos_online, zones, zones_to_geo_zones");
+
+          for ($i=0, $n=sizeof($sql_array); $i<$n; $i++) {
+            tep_db_query($sql_array[$i]);
+          }
+
+          tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'");
+          tep_db_query("insert into " . TABLE_CONFIGURATION . " values ('', 'Last Database Restore', 'DB_LAST_RESTORE', '" . $read_from . "', 'Last database restore file', '6', '', '', now(), '', '')");
+
+          if (isset($remove_raw) && ($remove_raw == true)) {
+            unlink($restore_from);
+          }
+
+          $messageStack->add_session('search', SUCCESS_DATABASE_RESTORED, 'success');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_BACKUP));
+        break;
+      case 'download':
+        $extension = substr($HTTP_GET_VARS['file'], -3);
+
+        if ( ($extension == 'zip') || ($extension == '.gz') || ($extension == 'sql') ) {
+          if ($fp = fopen(DIR_FS_BACKUP . $HTTP_GET_VARS['file'], 'rb')) {
+            $buffer = fread($fp, filesize(DIR_FS_BACKUP . $HTTP_GET_VARS['file']));
+            fclose($fp);
+
+            header('Content-type: application/x-octet-stream');
+            header('Content-disposition: attachment; filename=' . $HTTP_GET_VARS['file']);
+
+            echo $buffer;
+
+            exit;
+          }
+        } else {
+          $messageStack->add('search', ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE, 'error');
+        }
+        break;
+      case 'deleteconfirm':
+        if (strstr($HTTP_GET_VARS['file'], '..')) tep_redirect(tep_href_link(FILENAME_BACKUP));
+
+        tep_remove(DIR_FS_BACKUP . '/' . $HTTP_GET_VARS['file']);
+
+        if (!$tep_remove_error) {
+          $messageStack->add_session('search', SUCCESS_BACKUP_DELETED, 'success');
+
+          tep_redirect(tep_href_link(FILENAME_BACKUP));
+        }
+        break;
+    }
+  }
+
+// check if the backup directory exists
+  $dir_ok = false;
+  if (is_dir(DIR_FS_BACKUP)) {
+    if (is_writeable(DIR_FS_BACKUP)) {
+      $dir_ok = true;
+    } else {
+      $messageStack->add('search', ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE, 'error');
+    }
+  } else {
+    $messageStack->add('search', ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST, 'error');
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TITLE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_FILE_DATE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_FILE_SIZE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  if ($dir_ok == true) {
+    $dir = dir(DIR_FS_BACKUP);
+    $contents = array();
+    while ($file = $dir->read()) {
+      if (!is_dir(DIR_FS_BACKUP . $file)) {
+        $contents[] = $file;
+      }
+    }
+    sort($contents);
+
+    for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+      $entry = $contents[$i];
+
+      $check = 0;
+
+      if ((!isset($HTTP_GET_VARS['file']) || (isset($HTTP_GET_VARS['file']) && ($HTTP_GET_VARS['file'] == $entry))) && !isset($buInfo) && ($action != 'backup') && ($action != 'restorelocal')) {
+        $file_array['file'] = $entry;
+        $file_array['date'] = date(PHP_DATE_TIME_FORMAT, filemtime(DIR_FS_BACKUP . $entry));
+        //$file_array['size'] = number_format(filesize(DIR_FS_BACKUP . $entry)) . ' bytes';
+
+        $file_array['size'] = number_format(filesize(DIR_FS_BACKUP . $entry)) . BYTES;
+
+        switch (substr($entry, -3)) {
+          case 'zip': $file_array['compression'] = 'ZIP'; break;
+          case '.gz': $file_array['compression'] = 'GZIP'; break;
+          default: $file_array['compression'] = TEXT_NO_EXTENSION; break;
+        }
+
+        $buInfo = new objectInfo($file_array);
+      }
+
+      if (isset($buInfo) && is_object($buInfo) && ($entry == $buInfo->file)) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
+        $onclick_link = 'file=' . $buInfo->file . '&action=restore';
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
+        $onclick_link = 'file=' . $entry;
+      }
+?>
+                <td class="dataTableContent" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP, $onclick_link); ?>'"><?php echo '<a href="' . tep_href_link(FILENAME_BACKUP, 'action=download&file=' . $entry) . '">' . tep_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD) . '</a>&nbsp;' . $entry; ?></td>
+                <td class="dataTableContent" align="center" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP, $onclick_link); ?>'"><?php echo date(PHP_DATE_TIME_FORMAT, filemtime(DIR_FS_BACKUP . $entry)); ?></td>
+                <td class="dataTableContent" align="right" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP, $onclick_link); ?>'"><?php echo number_format(filesize(DIR_FS_BACKUP . $entry)); ?> <!-- bytes --><?php echo BYTES?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($buInfo) && is_object($buInfo) && ($entry == $buInfo->file)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $entry) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+    $dir->close();
+  }
+?>
+              <tr>
+                <td class="smallText" colspan="3"><?php echo TEXT_BACKUP_DIRECTORY . ' ' . DIR_FS_BACKUP; ?></td>
+                <td align="right" class="smallText"><?php if ( ($action != 'backup') && (isset($dir)) ) echo '<a href="' . tep_href_link(FILENAME_BACKUP, 'action=backup') . '">' . tep_image_button('button_backup.gif', IMAGE_BACKUP) . '</a>'; if ( ($action != 'restorelocal') && isset($dir) ) echo '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_BACKUP, 'action=restorelocal') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a>'; ?></td>
+              </tr>
+<?php
+  if (defined('DB_LAST_RESTORE')) {
+?>
+              <tr>
+                <td class="smallText" colspan="4"><?php echo TEXT_LAST_RESTORATION . ' ' . DB_LAST_RESTORE . ' <a href="' . tep_href_link(FILENAME_BACKUP, 'action=forget') . '">' . TEXT_FORGET . '</a>'; ?></td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'backup':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_BACKUP . '</b>');
+
+      $contents = array('form' => tep_draw_form('backup', FILENAME_BACKUP, 'action=backupnow'));
+      $contents[] = array('text' => TEXT_INFO_NEW_BACKUP);
+
+      $contents[] = array('text' => '<br>' . tep_draw_radio_field('compress', 'no', true) . ' ' . TEXT_INFO_USE_NO_COMPRESSION);
+      if (file_exists(LOCAL_EXE_GZIP)) $contents[] = array('text' => '<br>' . tep_draw_radio_field('compress', 'gzip') . ' ' . TEXT_INFO_USE_GZIP);
+      if (file_exists(LOCAL_EXE_ZIP)) $contents[] = array('text' => tep_draw_radio_field('compress', 'zip') . ' ' . TEXT_INFO_USE_ZIP);
+
+      if ($dir_ok == true) {
+        $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('download', 'yes') . ' ' . TEXT_INFO_DOWNLOAD_ONLY . '*<br><br>*' . TEXT_INFO_BEST_THROUGH_HTTPS);
+      } else {
+        $contents[] = array('text' => '<br>' . tep_draw_radio_field('download', 'yes', true) . ' ' . TEXT_INFO_DOWNLOAD_ONLY . '*<br><br>*' . TEXT_INFO_BEST_THROUGH_HTTPS);
+      }
+
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_backup.gif', IMAGE_BACKUP) . '&nbsp;<a href="' . tep_href_link(FILENAME_BACKUP) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'restore':
+      $heading[] = array('text' => '<b>' . $buInfo->date . '</b>');
+
+      $contents[] = array('text' => tep_break_string(sprintf(TEXT_INFO_RESTORE, DIR_FS_BACKUP . (($buInfo->compression != TEXT_NO_EXTENSION) ? substr($buInfo->file, 0, strrpos($buInfo->file, '.')) : $buInfo->file), ($buInfo->compression != TEXT_NO_EXTENSION) ? TEXT_INFO_UNPACK : ''), 35, ' '));
+      $contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=restorenow') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a>&nbsp;<a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'restorelocal':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_RESTORE_LOCAL . '</b>');
+
+      $contents = array('form' => tep_draw_form('restore', FILENAME_BACKUP, 'action=restorelocalnow', 'post', 'enctype="multipart/form-data"'));
+      $contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL . '<br><br>' . TEXT_INFO_BEST_THROUGH_HTTPS);
+      $contents[] = array('text' => '<br>' . tep_draw_file_field('sql_file'));
+      $contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL_RAW_FILE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_restore.gif', IMAGE_RESTORE) . '&nbsp;<a href="' . tep_href_link(FILENAME_BACKUP) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . $buInfo->date . '</b>');
+
+      $contents = array('form' => tep_draw_form('delete', FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $buInfo->file . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($buInfo) && is_object($buInfo)) {
+        $heading[] = array('text' => '<b>' . $buInfo->date . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=restore') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a> <a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE . ' ' . $buInfo->date);
+        $contents[] = array('text' => TEXT_INFO_SIZE . ' ' . $buInfo->size);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COMPRESSION . ' ' . $buInfo->compression);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/backup_mysql.php
===================================================================
--- trunk/direct.openmoko.com/admin/backup_mysql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/backup_mysql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,519 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// |zen-cart Open Source E-commerce                                       |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 2003 The zen-cart developers                           |
+// |                                                                      |
+// | http://www.zen-cart.com/index.php                                    |
+// |                                                                      |
+// | Portions Copyright (c) 2003 osCommerce                               |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the GPL license,       |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available through the world-wide-web at the following url:           |
+// | http://www.zen-cart.com/license/2_0.txt.                             |
+// | If you did not receive a copy of the zen-cart license and are unable |
+// | to obtain it through the world-wide-web, please send a note to       |
+// | license at zen-cart.com so we can mail you a copy immediately.          |
+// +----------------------------------------------------------------------+
+// $Id: backup_mysql.php,v 1.2.0.2 2004/09/02 00:00:00 DrByte Exp $
+//
+
+  require('includes/application_top.php');
+ //$debug='ON';
+
+  if (isset($_GET['debug']) && $_GET['debug']=='ON') $debug='ON';
+
+// Note that LOCAL_EXE_MYSQL and LOCAL_EXE_MYSQL_DUMP are defined in the /admin/includes/languages/backup_mysql.php file
+// These can occasionally be overridden in the URL by specifying &tool=/path/to/foo/bar/plus/utilname, depending on server support
+// Do not change them here ... edit the LANGUAGES file instead.
+// the following 7 lines check to be sure that they've been entered correctly in the language file
+  $pathsearch=array(str_replace('mysql','',LOCAL_EXE_MYSQL).'/','/usr/bin/','/usr/local/bin/','c:/mysql/bin/','d:/mysql/bin/','e:/mysql/bin/','/usr/local/bin/', 'c:/apache2triad/mysql/bin/', 'd:/apache2triad/mysql/bin/', 'e:/apache2triad/mysql/bin/', 'c:/appserv/mysql/bin/', 'd:/appserv/mysql/bin/', 'e:/appserv/mysql/bin/');
+  foreach($pathsearch as $path){
+    $path = str_replace('\\','/',$path); // convert backslashes
+    $path = str_replace('//','/',$path); // convert double slashes to singles
+    $path = (substr($path,-1)!='/') ? $path . '/' : $path; // add a '/' to the end if missing
+    if (tep_not_null($mysql_exe)) continue;
+    if (file_exists($path.'mysql')) $mysql_exe = $path.'mysql';
+    if (file_exists($path.'mysql.exe')) $mysql_exe = $path.'mysql.exe';
+    if (tep_not_null($mysqldump_exe)) continue;
+    if (file_exists($path.'mysqldump')) $mysqldump_exe = $path.'mysqldump';
+    if (file_exists($path.'mysqldump.exe')) $mysqldump_exe = $path.'mysqldump.exe';
+
+    //if ($debug=='ON') $messageStack->add_session('search', 'Checking Path: '.$path.'<br>','caution');
+
+    if ($debug=='ON') $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_1.$path.'<br>','caution');
+  }
+  if (!$mysql_exe){
+    $mysql_exe =     ((file_exists($mysql_exe) ? $mysql_exe : 'mysql' ) );
+  }
+  if (!$mysqldump_exe){
+    $mysqldump_exe = ((file_exists($mysqldump_exe) ? $mysqldump_exe : 'mysqldump' ) );
+  }
+  if ($debug=='ON') $messageStack->add_session('search', '<br>','caution');
+  //if ($debug=='ON') $messageStack->add_session('search', 'COMMAND FILES FOUND/SELECTED:','caution');
+  if ($debug=='ON') $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_2,'caution');
+  if ($debug=='ON') $messageStack->add_session('search', 'mysqlexe='.$mysql_exe.'<br>','caution');
+  if ($debug=='ON') $messageStack->add_session('search', 'mysqldumpexe='.$mysqldump_exe.'<br><br>','caution');
+
+  $action = (isset($_GET['action']) ? $_GET['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'forget':
+        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'");
+        $messageStack->add_session('search', SUCCESS_LAST_RESTORE_CLEARED, 'success');
+        tep_redirect(tep_href_link(FILENAME_BACKUP_MYSQL, '', 'SSL'));
+        break;
+      case 'backupnow':
+        tep_set_time_limit(250);  // not sure if this is needed anymore?
+
+        $backup_file = 'db_' . DB_DATABASE . '-' . date('YmdHis') . '.sql';
+
+        $dump_params .= ' --host=' . DB_SERVER;
+        $dump_params .= ' --user=' . DB_SERVER_USERNAME;
+        $dump_params .= ' --password=' . DB_SERVER_PASSWORD;
+   //     $dump_params .= ' --opt';   //"optimized" -- turns on all "fast" and optimized export methods
+        $dump_params .= ' --complete-insert';  // undo optimization slightly and do "complete inserts"--lists all column names for benefit of restore of diff systems
+     $dump_params .= ' --add-drop-table ' ; //adds drop table
+
+//        $dump_params .= ' --skip-comments'; // mysqldump inserts '--' as comment delimiters, which is invalid on import (only for mysql v4.01+)
+//        $dump_params .= ' --skip-quote-names';
+//        $dump_params .= ' --force';  // ignore SQL errors if they occur
+//        $dump_params .= ' --compatible=postgresql'; // other options are: ,mysql323, mysql40
+        $dump_params .= ' --result-file=' . DIR_FS_BACKUP . $backup_file;
+        $dump_params .= ' ' . DB_DATABASE;
+
+        // if using the "--tables" parameter, this should be the last parameter, and tables should be space-delimited
+        // fill $tables_to_export with list of tables, separated by spaces, if wanna just export certain tables
+        $dump_params .= (($tables_to_export=='') ? '' : ' --tables ' . $tables_to_export);
+        $dump_params .= " 2>&1";
+
+        $toolfilename = (isset($_GET['tool']) && $_GET['tool'] != '') ? $_GET['tool'] : $mysqldump_exe;
+      //  if ($debug=='ON') $messageStack->add_session('search', 'COMMAND: '.$toolfilename . ' ' . $dump_params, 'caution');
+
+        if ($debug=='ON') $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_3.$toolfilename . ' ' . $dump_params, 'caution');
+        $resultcodes=exec($toolfilename . $dump_params , $output, $dump_results );
+        exec("exit(0)");
+
+        #parse the value that comes back from the script
+        list($strA, $strB) = split ('[|]', $resultcodes);
+        /*if ($debug=='ON') $messageStack->add_session('search', "valueA: " . $strA,'error');
+        if ($debug=='ON') $messageStack->add_session('search', "valueB: " . $strB,'error');*/
+
+     if ($debug=='ON') $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_4 . $strA,'error');
+        if ($debug=='ON') $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_5 . $strB,'error');
+
+
+
+        //if ($debug=='ON' || (tep_not_null($dump_results) && $dump_results!='0')) $messageStack->add_session('search', 'Result code: '.$dump_results, 'caution');
+
+        if ($debug=='ON' || (tep_not_null($dump_results) && $dump_results!='0')) $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_6.$dump_results, 'caution');
+
+
+        foreach($output as $key=>$value) {$messageStack->add_session('search', "$key => $value<br />",'caution'); }
+        //$output contains response strings from execution. This displays if needed.
+
+        if (file_exists(DIR_FS_BACKUP . $backup_file) && ($dump_results == '0' || $dump_results=='')) { // display success message noting that MYSQLDUMP was used
+          $messageStack->add_session('search', '<a href="' . ((ENABLE_SSL_ADMIN == 'true') ? DIR_WS_HTTPS_ADMIN : DIR_WS_ADMIN) . 'backups/' . $backup_file . '">' . SUCCESS_DATABASE_SAVED . '</a>', 'success');
+        } elseif ($dump_results=='127') {
+          $messageStack->add_session('search', FAILURE_DATABASE_NOT_SAVED_UTIL_NOT_FOUND, 'error');
+        } else {
+          $messageStack->add_session('search', FAILURE_DATABASE_NOT_SAVED, 'error');
+        }
+
+        //compress the file as requested & optionally download
+        if (isset($_POST['download']) && ($_POST['download'] == 'yes')) {
+          switch ($_POST['compress']) {
+            case 'gzip':
+              exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file);
+              $backup_file .= '.gz';
+              break;
+            case 'zip':
+              exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
+              unlink(DIR_FS_BACKUP . $backup_file);
+              $backup_file .= '.zip';
+          }
+      if (preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) {
+            header('Content-Type: application/octetstream');
+//            header('Content-Disposition: inline; filename="' . $backup_file . '"');
+            header('Content-Disposition: attachment; filename=' . $backup_file);
+            header("Expires: Mon, 26 Jul 2001 05:00:00 GMT");
+            header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+            header("Cache-Control: must_revalidate, post-check=0, pre-check=0");
+            header("Pragma: public");
+            header("Cache-control: private");
+      } else {
+            header('Content-Type: application/x-octet-stream');
+            header('Content-Disposition: attachment; filename=' . $backup_file);
+            header("Expires: Mon, 26 Jul 2001 05:00:00 GMT");
+            header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+            header("Pragma: no-cache");
+      }
+
+          readfile(DIR_FS_BACKUP . $backup_file);
+          unlink(DIR_FS_BACKUP . $backup_file);
+
+          exit;
+        } else {
+          switch ($_POST['compress']) {
+            case 'gzip':
+              exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file);
+              break;
+            case 'zip':
+              exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
+              unlink(DIR_FS_BACKUP . $backup_file);
+          }
+        }
+        tep_redirect(tep_href_link(FILENAME_BACKUP_MYSQL, '', 'SSL'));
+        break;
+      case 'restorenow':
+      case 'restorelocalnow':
+        tep_set_time_limit(300);
+          $specified_restore_file = (isset($_GET['file'])) ? $_GET['file'] : '';
+
+          if ($specified_restore_file !='' && file_exists(DIR_FS_BACKUP . $specified_restore_file)) {
+            $restore_file = DIR_FS_BACKUP . $specified_restore_file;
+            $extension = substr($specified_restore_file, -3);
+
+            //determine file format and unzip if needed
+            if ( ($extension == 'sql') || ($extension == '.gz') || ($extension == 'zip') ) {
+              switch ($extension) {
+                case 'sql':
+                  $restore_from = $restore_file;
+                  $remove_raw = false;
+                  break;
+                case '.gz':
+                  $restore_from = substr($restore_file, 0, -3);
+                  exec(LOCAL_EXE_GUNZIP . ' ' . $restore_file . ' -c > ' . $restore_from);
+                  $remove_raw = true;
+                  break;
+                case 'zip':
+                  $restore_from = substr($restore_file, 0, -4);
+                  exec(LOCAL_EXE_UNZIP . ' ' . $restore_file . ' -d ' . DIR_FS_BACKUP);
+                  $remove_raw = true;
+              }
+            }
+        } elseif ($action == 'restorelocalnow') {
+            $sql_file = new upload('sql_file', DIR_FS_BACKUP);
+            $specified_restore_file = $sql_file->filename;
+            $restore_from = DIR_FS_BACKUP . $specified_restore_file;
+        }
+
+        //Restore using "mysql"
+        $load_params  = ' --database=' . DB_DATABASE;
+        $load_params .= ' --host=' . DB_SERVER;
+        $load_params .= ' --user=' . DB_SERVER_USERNAME;
+        $load_params .= ((DB_SERVER_PASSWORD =='') ? '' : ' --password=' . DB_SERVER_PASSWORD);
+        $load_params .= ' ' . DB_DATABASE; // this needs to be the 2nd-last parameter
+        $load_params .= ' < ' . $restore_from; // this needs to be the LAST parameter
+        $load_params .= " 2>&1";
+        //DEBUG echo $mysql_exe . ' ' . $load_params;
+
+        if (file_exists($restore_from) && $specified_restore_file != '') {
+          $toolfilename = (isset($_GET['tool']) && $_GET['tool'] != '') ? $_GET['tool'] : $mysql_exe;
+          //if ($debug=='ON') $messageStack->add_session('search', 'COMMAND: '.$toolfilename . ' ' . $dump_params, 'caution');
+          if ($debug=='ON') $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_3.$toolfilename . ' ' . $dump_params, 'caution');
+
+          $resultcodes=exec($toolfilename . $load_params , $output, $load_results );
+          exec("exit(0)");
+          #parse the value that comes back from the script
+          list($strA, $strB) = split ('[|]', $resultcodes);
+          /*if ($debug=='ON') $messageStack->add_session('search', "valueA: " . $strA,'error');
+          if ($debug=='ON') $messageStack->add_session('search', "valueB: " . $strB,'error');
+          if ($debug=='ON' || (tep_not_null($load_results) && $load_results!='0')) $messageStack->add_session('search', 'Result code: '.$load_results, 'caution');
+      */
+
+       if ($debug=='ON') $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_4 . $strA,'error');
+          if ($debug=='ON') $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_5 . $strB,'error');
+          if ($debug=='ON' || (tep_not_null($load_results) && $load_results!='0')) $messageStack->add_session('search', BACKUP_MYSQl_ERROR_MSG_6.$load_results, 'caution');
+
+
+          if ($load_results == '0') {
+            // store the last-restore-date, if successful
+            tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'");
+            tep_db_query("insert into " . TABLE_CONFIGURATION . " values ('', 'Last Database Restore', 'DB_LAST_RESTORE', '" . $specified_restore_file . "', 'Last database restore file', '6', '', '', now(), '', '')");
+            $messageStack->add_session('search', '<a href="' . ((ENABLE_SSL_ADMIN == 'true') ? DIR_WS_HTTPS_ADMIN : DIR_WS_ADMIN) . 'backups/' . $specified_restore_file . '">' . SUCCESS_DATABASE_RESTORED . '</a>', 'success');
+            } elseif ($load_results == '127') {
+            $messageStack->add_session('search', FAILURE_DATABASE_NOT_RESTORED_UTIL_NOT_FOUND, 'error');
+            } else {
+            $messageStack->add_session('search', FAILURE_DATABASE_NOT_RESTORED, 'error');
+            } // endif $load_results
+          } else {
+          $messageStack->add_session('search', sprintf(FAILURE_DATABASE_NOT_RESTORED_FILE_NOT_FOUND, '[' . $restore_from .']'), 'error');
+          } // endif file_exists
+
+        tep_redirect(tep_href_link(FILENAME_BACKUP_MYSQL, '', 'SSL'));
+        break;
+      case 'download':
+        $extension = substr($_GET['file'], -3);
+
+        if ( ($extension == 'zip') || ($extension == '.gz') || ($extension == 'sql') ) {
+          if ($fp = fopen(DIR_FS_BACKUP . $_GET['file'], 'rb')) {
+            $buffer = fread($fp, filesize(DIR_FS_BACKUP . $_GET['file']));
+            fclose($fp);
+
+            header('Content-type: application/x-octet-stream');
+            header('Content-disposition: attachment; filename=' . $_GET['file']);
+
+            echo $buffer;
+
+            exit;
+          }
+        } else {
+          $messageStack->add('search', ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE, 'error');
+        }
+        break;
+      case 'deleteconfirm':
+        if (strstr($_GET['file'], '..')) tep_redirect(tep_href_link(FILENAME_BACKUP_MYSQL, '', 'SSL'));
+
+        tep_remove(DIR_FS_BACKUP . '/' . $_GET['file']);
+
+        if (!$tep_remove_error) {
+          $messageStack->add_session('search', SUCCESS_BACKUP_DELETED, 'success');
+
+          tep_redirect(tep_href_link(FILENAME_BACKUP_MYSQL, '', 'SSL'));
+        }
+        break;
+    }
+  }
+
+// check if the backup directory exists
+  $dir_ok = false;
+  if (is_dir(DIR_FS_BACKUP)) {
+    if (is_writeable(DIR_FS_BACKUP)) {
+      $dir_ok = true;
+    } else {
+      $messageStack->add('search', ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE, 'error');
+    }
+  } else {
+    $messageStack->add('search', ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST, 'error');
+  }
+
+// check to see if safe_mode is on -- can't use mysqldump in safe mode
+  if (get_cfg_var('safe_mode')) {
+    $messageStack->add('search', ERROR_CANT_BACKUP_IN_SAFE_MODE, 'error');
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+        </tr>
+</table></td>
+<?php if (ENABLE_SSL != 'true') {  // display security warning about downloads if not SSL
+?>
+          <tr>
+            <td class="main"><?php //  echo WARNING_NOT_SECURE_FOR_DOWNLOADS;
+             ?></td>
+            <td class="main" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php } ?>
+<!--        </table></td> //-->
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TITLE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_FILE_DATE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_FILE_SIZE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+//  if (!get_cfg_var('safe_mode') && $dir_ok == true) {
+    $dir = dir(DIR_FS_BACKUP);
+    $contents = array();
+    while ($file = $dir->read()) {
+      if (!is_dir(DIR_FS_BACKUP . $file)) {
+        if ($file != '.empty' && $file != 'empty.txt') {
+          $contents[] = $file;
+        }
+      }
+    }
+    sort($contents);
+
+    for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+      $entry = $contents[$i];
+
+      $check = 0;
+
+      if ((!isset($_GET['file']) || (isset($_GET['file']) && ($_GET['file'] == $entry))) && !isset($buInfo) && ($action != 'backup') && ($action != 'restorelocal')) {
+        $file_array['file'] = $entry;
+        $file_array['date'] = date(PHP_DATE_TIME_FORMAT, filemtime(DIR_FS_BACKUP . $entry));
+       // $file_array['size'] = number_format(filesize(DIR_FS_BACKUP . $entry)) . ' bytes';
+        $file_array['size'] = number_format(filesize(DIR_FS_BACKUP . $entry)) . BYTES;
+        switch (substr($entry, -3)) {
+          case 'zip': $file_array['compression'] = 'ZIP'; break;
+          case '.gz': $file_array['compression'] = 'GZIP'; break;
+          default: $file_array['compression'] = TEXT_NO_EXTENSION; break;
+        }
+
+        $buInfo = new objectInfo($file_array);
+      }
+
+      if (isset($buInfo) && is_object($buInfo) && ($entry == $buInfo->file)) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
+        $onclick_link = 'file=' . $buInfo->file . '&action=restore';
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
+        $onclick_link = 'file=' . $entry;
+      }
+?>
+<!--                 <td class="dataTableContent" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP_MYSQL, $onclick_link); ?>'"><?php echo '<a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'action=download&file=' . $entry) . '">' . tep_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD) . '</a>&nbsp;' . $entry; ?></td> -->
+                <td class="dataTableContent" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP_MYSQL, $onclick_link); ?>'"><?php echo '<a href="' . ((ENABLE_SSL_ADMIN == 'true') ? DIR_WS_HTTPS_ADMIN : DIR_WS_ADMIN) . 'backups/' . $entry . '">' . tep_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD) . '</a>&nbsp;' . $entry; ?></td>
+                <td class="dataTableContent" align="center" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP_MYSQL, $onclick_link); ?>'"><?php echo date(PHP_DATE_TIME_FORMAT, filemtime(DIR_FS_BACKUP . $entry)); ?></td>
+                <td class="dataTableContent" align="right" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP_MYSQL, $onclick_link); ?>'"><?php echo number_format(filesize(DIR_FS_BACKUP . $entry)); ?> <!-- bytes --><?php echo BYTES?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($buInfo) && is_object($buInfo) && ($entry == $buInfo->file)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'file=' . $entry) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+    $dir->close();
+//  } // endif safe-mode & dir_ok
+
+// now let's display the backup/restore buttons below filelist
+?>
+              <tr>
+                <td class="smallText" colspan="4"><table border="0" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td><?php echo TEXT_BACKUP_DIRECTORY . ' ' . DIR_FS_BACKUP; ?></td>
+                    <td align="right" class="smallText">
+                      <?php if ( ($action != 'backup') && (isset($dir)) && !get_cfg_var('safe_mode') && $dir_ok == true ) {
+                              echo '<a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'action=backup'.(($debug=='ON')?'&debug=ON':''), 'SSL') . '">' .
+                                   tep_image_button('button_backup.gif', IMAGE_BACKUP) . '</a>&nbsp;&nbsp;';
+                            }
+                            if ( ($action != 'restorelocal') && isset($dir) ) {
+                              echo '<a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'action=restorelocal'.(($debug=='ON')?'&debug=ON':''), 'SSL') . '">' .
+                                   tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a>';
+                            } ?>
+                    </td>
+                  </tr>
+                </table></td>  
+              </tr>
+<?php
+  if (defined('DB_LAST_RESTORE')) {
+?>
+              <tr>
+                <td class="smallText" colspan="4"><?php echo TEXT_LAST_RESTORATION . ' ' . DB_LAST_RESTORE . ' <a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'action=forget') . '">' . TEXT_FORGET . '</a>'; ?></td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'backup':
+      $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_NEW_BACKUP . '</strong>');
+
+      $contents = array('form' => tep_draw_form('backup', FILENAME_BACKUP_MYSQL, 'action=backupnow'.(($debug=='ON')?'&debug=ON':''), 'post', '', 'SSL'));
+      $contents[] = array('text' => TEXT_INFO_NEW_BACKUP);
+
+      $contents[] = array('text' => '<br />' . tep_draw_radio_field('compress', 'no', true) . ' ' . TEXT_INFO_USE_NO_COMPRESSION);
+      if (file_exists(LOCAL_EXE_GZIP)) $contents[] = array('text' => '<br />' . tep_draw_radio_field('compress', 'gzip') . ' ' . TEXT_INFO_USE_GZIP);
+      if (file_exists(LOCAL_EXE_ZIP)) $contents[] = array('text' => tep_draw_radio_field('compress', 'zip') . ' ' . TEXT_INFO_USE_ZIP);
+
+
+      // Download to file --- Should only be done if SSL is active, otherwise database is exposed as clear text
+      if ($dir_ok == true) {
+        $contents[] = array('text' => '<br />' . tep_draw_checkbox_field('download', 'yes') . ' ' . TEXT_INFO_DOWNLOAD_ONLY . '*<br /><span class="errorText">*' . TEXT_INFO_BEST_THROUGH_HTTPS . '</span>');
+      } else {
+        $contents[] = array('text' => '<br />' . tep_draw_radio_field('download', 'yes', true) . ' ' . TEXT_INFO_DOWNLOAD_ONLY . '*<br /><span class="errorText">*' . TEXT_INFO_BEST_THROUGH_HTTPS . '</span>');
+      }
+
+      // display backup button
+      $contents[] = array('align' => 'center', 'text' => '<br />' . tep_image_submit('button_backup.gif', IMAGE_BACKUP) . '&nbsp;<a href="' . tep_href_link(FILENAME_BACKUP_MYSQL,(($debug=='ON')?'debug=ON':''), 'SSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'restore':
+      $heading[] = array('text' => '<strong>' . $buInfo->date . '</strong>');
+
+      $contents[] = array('text' => tep_break_string(sprintf(TEXT_INFO_RESTORE, DIR_FS_BACKUP . (($buInfo->compression != TEXT_NO_EXTENSION) ? substr($buInfo->file, 0, strrpos($buInfo->file, '.')) : $buInfo->file), ($buInfo->compression != TEXT_NO_EXTENSION) ? TEXT_INFO_UNPACK : ''), 35, ' '));
+      $contents[] = array('align' => 'center', 'text' => '<br /><a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'file=' . $buInfo->file . '&action=restorenow'.(($debug=='ON')?'&debug=ON':''), 'SSL') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a>&nbsp;<a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'file=' . $buInfo->file.(($debug=='ON')?'&debug=ON':''), 'SSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'restorelocal':
+      $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_RESTORE_LOCAL . '</strong>');
+
+      $contents = array('form' => tep_draw_form('restore', FILENAME_BACKUP_MYSQL, 'action=restorelocalnow'.(($debug=='ON')?'&debug=ON':''), 'post', 'enctype="multipart/form-data"', 'SSL'));
+      $contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL . '<br /><br />' . TEXT_INFO_BEST_THROUGH_HTTPS);
+      $contents[] = array('text' => '<br />' . tep_draw_file_field('sql_file'));
+      $contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL_RAW_FILE);
+      $contents[] = array('align' => 'center', 'text' => '<br />' . tep_image_submit('button_restore.gif', IMAGE_RESTORE) . '&nbsp;<a href="' . tep_href_link(FILENAME_BACKUP_MYSQL,(($debug=='ON')?'debug=ON':''), 'SSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      if ($dir_ok == false) continue;
+      $heading[] = array('text' => '<strong>' . $buInfo->date . '</strong>');
+
+      $contents = array('form' => tep_draw_form('delete', FILENAME_BACKUP_MYSQL, 'file=' . $buInfo->file . '&action=deleteconfirm', 'post', '', 'SSL'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO);
+      $contents[] = array('text' => '<br /><strong>' . $buInfo->file . '</strong>');
+      $contents[] = array('align' => 'center', 'text' => '<br />' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'file=' . $buInfo->file, 'SSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($buInfo) && is_object($buInfo)) {
+        $heading[] = array('text' => '<strong>' . $buInfo->date . '</strong>');
+
+        $contents[] = array('align' => 'center',
+                            'text' => '<a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'file=' . $buInfo->file . '&action=restore'.(($debug=='ON')?'&debug=ON':''), 'SSL') . '">' .
+                                                    tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a> ' .
+                                      (($dir_ok==true) ? '<a href="' . tep_href_link(FILENAME_BACKUP_MYSQL, 'file=' . $buInfo->file . '&action=delete', 'SSL') . '">' .
+                                                    tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' : '' ) );
+        $contents[] = array('text' => '<br />' . TEXT_INFO_DATE . ' ' . $buInfo->date);
+        $contents[] = array('text' => TEXT_INFO_SIZE . ' ' . $buInfo->size);
+        $contents[] = array('text' => '<br />' . TEXT_INFO_COMPRESSION . ' ' . $buInfo->compression);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br />
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/backups/.htaccess
===================================================================
--- trunk/direct.openmoko.com/admin/backups/.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/backups/.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<files *>
+order allow,deny
+deny from all
+</files>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/backups/delete_me_for_zip_only.txt
===================================================================

Added: trunk/direct.openmoko.com/admin/banner_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/banner_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/banner_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,467 @@
+<?php
+/*
+  $Id: banner_manager.php,v 1.1.1.1 2004/03/04 23:38:12 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  $banner_extension = tep_banner_image_extension();
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'setflag':
+        if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
+          tep_set_banner_status($HTTP_GET_VARS['bID'], $HTTP_GET_VARS['flag']);
+
+          $messageStack->add_session('search', SUCCESS_BANNER_STATUS_UPDATED, 'success');
+        } else {
+          $messageStack->add_session('search', ERROR_UNKNOWN_STATUS_FLAG, 'error');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID']));
+        break;
+      case 'insert':
+      case 'update':
+        if (isset($HTTP_POST_VARS['banners_id'])) $banners_id = tep_db_prepare_input($HTTP_POST_VARS['banners_id']);
+        $banners_title = tep_db_prepare_input($HTTP_POST_VARS['banners_title']);
+        $banners_url = tep_db_prepare_input($HTTP_POST_VARS['banners_url']);
+        $new_banners_group = tep_db_prepare_input($HTTP_POST_VARS['new_banners_group']);
+        $banners_group = (empty($new_banners_group)) ? tep_db_prepare_input($HTTP_POST_VARS['banners_group']) : $new_banners_group;
+        $banners_html_text = tep_db_prepare_input($HTTP_POST_VARS['banners_html_text']);
+        $banners_image_local = tep_db_prepare_input($HTTP_POST_VARS['banners_image_local']);
+        $banners_image_target = tep_db_prepare_input($HTTP_POST_VARS['banners_image_target']);
+        $db_image_location = '';
+        $expires_date = tep_db_prepare_input($HTTP_POST_VARS['expires_date']);
+        $expires_impressions = tep_db_prepare_input($HTTP_POST_VARS['expires_impressions']);
+        $date_scheduled = tep_db_prepare_input($HTTP_POST_VARS['date_scheduled']);
+
+        $banner_error = false;
+        if (empty($banners_title)) {
+          $messageStack->add('search', ERROR_BANNER_TITLE_REQUIRED, 'error');
+          $banner_error = true;
+        }
+
+        if (empty($banners_group)) {
+          $messageStack->add('search', ERROR_BANNER_GROUP_REQUIRED, 'error');
+          $banner_error = true;
+        }
+
+        if (empty($banners_html_text)) {
+          if (empty($banners_image_local)) {
+            $banners_image = new upload('banners_image');
+            $banners_image->set_destination(DIR_FS_CATALOG_IMAGES . $banners_image_target);
+            if ( ($banners_image->parse() == false) || ($banners_image->save() == false) ) {
+              $banner_error = true;
+            }
+          }
+        }
+
+        if ($banner_error == false) {
+          $db_image_location = (tep_not_null($banners_image_local)) ? $banners_image_local : $banners_image_target . $banners_image->filename;
+          $sql_data_array = array('banners_title' => $banners_title,
+                                  'banners_url' => $banners_url,
+                                  'banners_image' => $db_image_location,
+                                  'banners_group' => $banners_group,
+                                  'banners_html_text' => $banners_html_text);
+
+          if ($action == 'insert') {
+            $insert_sql_data = array('date_added' => 'now()',
+                                     'status' => '1');
+
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_BANNERS, $sql_data_array);
+
+            $banners_id = tep_db_insert_id();
+
+            $messageStack->add_session('search', SUCCESS_BANNER_INSERTED, 'success');
+          } elseif ($action == 'update') {
+            tep_db_perform(TABLE_BANNERS, $sql_data_array, 'update', "banners_id = '" . (int)$banners_id . "'");
+
+            $messageStack->add_session('search', SUCCESS_BANNER_UPDATED, 'success');
+          }
+
+          if (tep_not_null($expires_date)) {
+            list($day, $month, $year) = explode('/', $expires_date);
+
+            $expires_date = $year .
+                            ((strlen($month) == 1) ? '0' . $month : $month) .
+                            ((strlen($day) == 1) ? '0' . $day : $day);
+
+            tep_db_query("update " . TABLE_BANNERS . " set expires_date = '" . tep_db_input($expires_date) . "', expires_impressions = null where banners_id = '" . (int)$banners_id . "'");
+          } elseif (tep_not_null($expires_impressions)) {
+            tep_db_query("update " . TABLE_BANNERS . " set expires_impressions = '" . tep_db_input($expires_impressions) . "', expires_date = null where banners_id = '" . (int)$banners_id . "'");
+          }
+
+          if (tep_not_null($date_scheduled)) {
+            list($day, $month, $year) = explode('/', $date_scheduled);
+
+            $date_scheduled = $year .
+                              ((strlen($month) == 1) ? '0' . $month : $month) .
+                              ((strlen($day) == 1) ? '0' . $day : $day);
+
+            tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_scheduled = '" . tep_db_input($date_scheduled) . "' where banners_id = '" . (int)$banners_id . "'");
+          }
+
+          tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'bID=' . $banners_id));
+        } else {
+          $action = 'new';
+        }
+        break;
+      case 'deleteconfirm':
+        $banners_id = tep_db_prepare_input($HTTP_GET_VARS['bID']);
+
+        if (isset($HTTP_POST_VARS['delete_image']) && ($HTTP_POST_VARS['delete_image'] == 'on')) {
+          $banner_query = tep_db_query("select banners_image from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'");
+          $banner = tep_db_fetch_array($banner_query);
+
+          if (is_file(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
+            if (is_writeable(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
+              unlink(DIR_FS_CATALOG_IMAGES . $banner['banners_image']);
+            } else {
+              $messageStack->add_session('search', ERROR_IMAGE_IS_NOT_WRITEABLE, 'error');
+            }
+          } else {
+            $messageStack->add_session('search', ERROR_IMAGE_DOES_NOT_EXIST, 'error');
+          }
+        }
+
+        tep_db_query("delete from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'");
+        tep_db_query("delete from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banners_id . "'");
+
+        if (function_exists('imagecreate') && tep_not_null($banner_extensio)) {
+          if (is_file(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension)) {
+            if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension)) {
+              unlink(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension);
+            }
+          }
+
+          if (is_file(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension)) {
+            if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension)) {
+              unlink(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension);
+            }
+          }
+
+          if (is_file(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension)) {
+            if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension)) {
+              unlink(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension);
+            }
+          }
+
+          if (is_file(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) {
+            if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) {
+              unlink(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension);
+            }
+          }
+        }
+
+        $messageStack->add_session('search', SUCCESS_BANNER_REMOVED, 'success');
+
+        tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+
+// check if the graphs directory exists
+  $dir_ok = false;
+  if (function_exists('imagecreate') && tep_not_null($banner_extension)) {
+    if (is_dir(DIR_WS_IMAGES . 'graphs')) {
+      if (is_writeable(DIR_WS_IMAGES . 'graphs')) {
+        $dir_ok = true;
+      } else {
+        $messageStack->add('search', ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
+      }
+    } else {
+      $messageStack->add('search', ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error');
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupImageWindow(url) {
+  window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($action == 'new') {
+    $form_action = 'insert';
+
+    $parameters = array('expires_date' => '',
+                        'date_scheduled' => '',
+                        'banners_title' => '',
+                        'banners_url' => '',
+                        'banners_group' => '',
+                        'banners_image' => '',
+                        'banners_html_text' => '',
+                        'expires_impressions' => '');
+
+    $bInfo = new objectInfo($parameters);
+
+    if (isset($HTTP_GET_VARS['bID'])) {
+      $form_action = 'update';
+
+      $bID = tep_db_prepare_input($HTTP_GET_VARS['bID']);
+
+      $banner_query = tep_db_query("select banners_title, banners_url, banners_image, banners_group, banners_html_text, status, date_format(date_scheduled, '%d/%m/%Y') as date_scheduled, date_format(expires_date, '%d/%m/%Y') as expires_date, expires_impressions, date_status_change from " . TABLE_BANNERS . " where banners_id = '" . (int)$bID . "'");
+      $banner = tep_db_fetch_array($banner_query);
+
+      $bInfo->objectInfo($banner);
+    } elseif (tep_not_null($HTTP_POST_VARS)) {
+      $bInfo->objectInfo($HTTP_POST_VARS);
+    }
+
+    $groups_array = array();
+    $groups_query = tep_db_query("select distinct banners_group from " . TABLE_BANNERS . " order by banners_group");
+    while ($groups = tep_db_fetch_array($groups_query)) {
+      $groups_array[] = array('id' => $groups['banners_group'], 'text' => $groups['banners_group']);
+    }
+?>
+<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
+<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
+<script language="javascript">
+  var dateExpires = new ctlSpiffyCalendarBox("dateExpires", "new_banner", "expires_date","btnDate1","<?php echo $bInfo->expires_date; ?>",scBTNMODE_CUSTOMBLUE);
+  var dateScheduled = new ctlSpiffyCalendarBox("dateScheduled", "new_banner", "date_scheduled","btnDate2","<?php echo $bInfo->date_scheduled; ?>",scBTNMODE_CUSTOMBLUE);
+</script>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('new_banner', FILENAME_BANNER_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'action=' . $form_action, 'post', 'enctype="multipart/form-data"'); if ($form_action == 'update') echo tep_draw_hidden_field('banners_id', $bID); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_BANNERS_TITLE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('banners_title', $bInfo->banners_title, '', true); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_BANNERS_URL; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('banners_url', $bInfo->banners_url); ?></td>
+          </tr>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_BANNERS_GROUP; ?></td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('banners_group', $groups_array, $bInfo->banners_group) . TEXT_BANNERS_NEW_GROUP . '<br>' . tep_draw_input_field('new_banners_group', '', '', ((sizeof($groups_array) > 0) ? false : true)); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main" valign="top"><?php echo TEXT_BANNERS_IMAGE; ?></td>
+            <td class="main"><?php echo tep_draw_file_field('banners_image') . ' ' . TEXT_BANNERS_IMAGE_LOCAL . '<br>' . DIR_FS_CATALOG_IMAGES . tep_draw_input_field('banners_image_local', (isset($bInfo->banners_image) ? $bInfo->banners_image : '')); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_BANNERS_IMAGE_TARGET; ?></td>
+            <td class="main"><?php echo DIR_FS_CATALOG_IMAGES . tep_draw_input_field('banners_image_target'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td valign="top" class="main"><?php echo TEXT_BANNERS_HTML_TEXT; ?></td>
+            <td class="main"><?php echo tep_draw_textarea_field('banners_html_text', 'soft', '60', '5', $bInfo->banners_html_text); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_BANNERS_SCHEDULED_AT; ?><br><small><!-- (dd/mm/yyyy) --><?php echo DATE_FORMAT?></small></td>
+            <td valign="top" class="main"><script language="javascript">dateScheduled.writeControl(); dateScheduled.dateFormat="dd/MM/yyyy";</script></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td valign="top" class="main"><?php echo TEXT_BANNERS_EXPIRES_ON; ?><br><small><!-- (dd/mm/yyyy) --><?php echo DATE_FORMAT?></small></td>
+            <td class="main"><script language="javascript">dateExpires.writeControl(); dateExpires.dateFormat="dd/MM/yyyy";</script><?php echo TEXT_BANNERS_OR_AT . '<br>' . tep_draw_input_field('expires_impressions', $bInfo->expires_impressions, 'maxlength="7" size="7"') . ' ' . TEXT_BANNERS_IMPRESSIONS; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_BANNERS_BANNER_NOTE . '<br>' . TEXT_BANNERS_INSERT_NOTE . '<br>' . TEXT_BANNERS_EXPIRCY_NOTE . '<br>' . TEXT_BANNERS_SCHEDULE_NOTE; ?></td>
+            <td class="main" align="right" valign="top" nowrap><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . (isset($HTTP_GET_VARS['bID']) ? 'bID=' . $HTTP_GET_VARS['bID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </form></tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_BANNERS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_GROUPS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATISTICS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $banners_query_raw = "select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added from " . TABLE_BANNERS . " order by banners_title, banners_group";
+    $banners_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $banners_query_raw, $banners_query_numrows);
+    $banners_query = tep_db_query($banners_query_raw);
+    while ($banners = tep_db_fetch_array($banners_query)) {
+      $info_query = tep_db_query("select sum(banners_shown) as banners_shown, sum(banners_clicked) as banners_clicked from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banners['banners_id'] . "'");
+      $info = tep_db_fetch_array($info_query);
+
+      if ((!isset($HTTP_GET_VARS['bID']) || (isset($HTTP_GET_VARS['bID']) && ($HTTP_GET_VARS['bID'] == $banners['banners_id']))) && !isset($bInfo) && (substr($action, 0, 3) != 'new')) {
+        $bInfo_array = array_merge($banners, $info);
+        $bInfo = new objectInfo($bInfo_array);
+      }
+
+      $banners_shown = ($info['banners_shown'] != '') ? $info['banners_shown'] : '0';
+      $banners_clicked = ($info['banners_clicked'] != '') ? $info['banners_clicked'] : '0';
+
+      if (isset($bInfo) && is_object($bInfo) && ($banners['banners_id'] == $bInfo->banners_id)) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_BANNER_STATISTICS, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id) . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="javascript:popupImageWindow(\'' . FILENAME_POPUP_IMAGE . '?banner=' . $banners['banners_id'] . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_popup.gif', 'View Banner') . '</a>&nbsp;' . $banners['banners_title']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $banners['banners_group']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $banners_shown . ' / ' . $banners_clicked; ?></td>
+                <td class="dataTableContent" align="right">
+<?php
+      if ($banners['status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', 'Active', 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id'] . '&action=setflag&flag=0') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', 'Set Inactive', 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id'] . '&action=setflag&flag=1') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', 'Set Active', 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Inactive', 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_BANNER_STATISTICS, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id']) . '">' . tep_image(DIR_WS_ICONS . 'statistics.gif', ICON_STATISTICS) . '</a>&nbsp;'; if (isset($bInfo) && is_object($bInfo) && ($banners['banners_id'] == $bInfo->banners_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $banners_split->display_count($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_BANNERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $banners_split->display_links($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                  <tr>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'action=new') . '">' . tep_image_button('button_new_banner.gif', IMAGE_NEW_BANNER) . '</a>'; ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . $bInfo->banners_title . '</b>');
+
+      $contents = array('form' => tep_draw_form('banners', FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $bInfo->banners_title . '</b>');
+      if ($bInfo->banners_image) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($bInfo)) {
+        $heading[] = array('text' => '<b>' . $bInfo->banners_title . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_BANNERS_DATE_ADDED . ' ' . tep_date_short($bInfo->date_added));
+
+        if ( (function_exists('imagecreate')) && ($dir_ok) && ($banner_extension) ) {
+          $banner_id = $bInfo->banners_id;
+          $days = '3';
+          include(DIR_WS_INCLUDES . 'graphs/banner_infobox.php');
+          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banner_id . '.' . $banner_extension));
+        } else {
+          include(DIR_WS_FUNCTIONS . 'html_graphs.php');
+          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_banner_graph_infoBox($bInfo->banners_id, '3'));
+        }
+
+        $contents[] = array('text' => tep_image(DIR_WS_IMAGES . 'graph_hbar_blue.gif', 'Blue', '5', '5') . ' ' . TEXT_BANNERS_BANNER_VIEWS . '<br>' . tep_image(DIR_WS_IMAGES . 'graph_hbar_red.gif', 'Red', '5', '5') . ' ' . TEXT_BANNERS_BANNER_CLICKS);
+
+        if ($bInfo->date_scheduled) $contents[] = array('text' => '<br>' . sprintf(TEXT_BANNERS_SCHEDULED_AT_DATE, tep_date_short($bInfo->date_scheduled)));
+
+        if ($bInfo->expires_date) {
+          $contents[] = array('text' => '<br>' . sprintf(TEXT_BANNERS_EXPIRES_AT_DATE, tep_date_short($bInfo->expires_date)));
+        } elseif ($bInfo->expires_impressions) {
+          $contents[] = array('text' => '<br>' . sprintf(TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS, $bInfo->expires_impressions));
+        }
+
+        if ($bInfo->date_status_change) $contents[] = array('text' => '<br>' . sprintf(TEXT_BANNERS_STATUS_CHANGE, tep_date_short($bInfo->date_status_change)));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/banner_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/banner_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/banner_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,180 @@
+<?php
+/*
+  $Id: banner_statistics.php,v 1.1.1.1 2004/03/04 23:38:12 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $type = (isset($HTTP_GET_VARS['type']) ? $HTTP_GET_VARS['type'] : '');
+
+  $banner_extension = tep_banner_image_extension();
+
+// check if the graphs directory exists
+  $dir_ok = false;
+  if (function_exists('imagecreate') && tep_not_null($banner_extension)) {
+    if (is_dir(DIR_WS_IMAGES . 'graphs')) {
+      if (is_writeable(DIR_WS_IMAGES . 'graphs')) {
+        $dir_ok = true;
+      } else {
+        $messageStack->add('search', ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
+      }
+    } else {
+      $messageStack->add('search', ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error');
+    }
+  }
+
+  $banner_query = tep_db_query("select banners_title from " . TABLE_BANNERS . " where banners_id = '" . (int)$HTTP_GET_VARS['bID'] . "'");
+  $banner = tep_db_fetch_array($banner_query);
+
+  $years_array = array();
+  $years_query = tep_db_query("select distinct year(banners_history_date) as banner_year from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$HTTP_GET_VARS['bID'] . "'");
+  while ($years = tep_db_fetch_array($years_query)) {
+    $years_array[] = array('id' => $years['banner_year'],
+                           'text' => $years['banner_year']);
+  }
+
+  $months_array = array();
+  for ($i=1; $i<13; $i++) {
+    $months_array[] = array('id' => $i,
+                            'text' => strftime('%B', mktime(0,0,0,$i)));
+  }
+
+  $type_array = array(array('id' => 'daily',
+                            'text' => STATISTICS_TYPE_DAILY),
+                      array('id' => 'monthly',
+                            'text' => STATISTICS_TYPE_MONTHLY),
+                      array('id' => 'yearly',
+                            'text' => STATISTICS_TYPE_YEARLY));
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('year', FILENAME_BANNER_STATISTICS, '', 'get'); ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="main" align="right"><?php echo TITLE_TYPE . ' ' . tep_draw_pull_down_menu('type', $type_array, (tep_not_null($type) ? $type : 'daily'), 'onChange="this.form.submit();"'); ?><noscript><input type="submit" value="GO"></noscript><br>
+<?php
+  switch ($type) {
+    case 'yearly': break;
+    case 'monthly':
+      echo TITLE_YEAR . ' ' . tep_draw_pull_down_menu('year', $years_array, (isset($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y')), 'onChange="this.form.submit();"') . '<noscript><input type="submit" value="GO"></noscript>';
+      break;
+    default:
+    case 'daily':
+      echo TITLE_MONTH . ' ' . tep_draw_pull_down_menu('month', $months_array, (isset($HTTP_GET_VARS['month']) ? $HTTP_GET_VARS['month'] : date('n')), 'onChange="this.form.submit();"') . '<noscript><input type="submit" value="GO"></noscript><br>' . TITLE_YEAR . ' ' . tep_draw_pull_down_menu('year', $years_array, (isset($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y')), 'onChange="this.form.submit();"') . '<noscript><input type="submit" value="GO"></noscript>';
+      break;
+  }
+?>
+            </td>
+          <?php echo tep_draw_hidden_field('page', $HTTP_GET_VARS['page']) . tep_draw_hidden_field('bID', $HTTP_GET_VARS['bID']); ?></form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="center">
+<?php
+  if (function_exists('imagecreate') && ($dir_ok == true) && tep_not_null($banner_extension)) {
+    $banner_id = (int)$HTTP_GET_VARS['bID'];
+
+    switch ($type) {
+      case 'yearly':
+        include(DIR_WS_INCLUDES . 'graphs/banner_yearly.php');
+        echo tep_image(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banner_id . '.' . $banner_extension);
+        break;
+      case 'monthly':
+        include(DIR_WS_INCLUDES . 'graphs/banner_monthly.php');
+        echo tep_image(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banner_id . '.' . $banner_extension);
+        break;
+      default:
+      case 'daily':
+        include(DIR_WS_INCLUDES . 'graphs/banner_daily.php');
+        echo tep_image(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banner_id . '.' . $banner_extension);
+        break;
+    }
+?>
+          <table border="0" width="600" cellspacing="0" cellpadding="2">
+            <tr class="dataTableHeadingRow">
+             <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SOURCE; ?></td>
+             <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_VIEWS; ?></td>
+             <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CLICKS; ?></td>
+           </tr>
+<?php
+    for ($i=0, $n=sizeof($stats); $i<$n; $i++) {
+      echo '            <tr class="dataTableRow">' . "\n" .
+           '              <td class="dataTableContent">' . $stats[$i][0] . '</td>' . "\n" .
+           '              <td class="dataTableContent" align="right">' . number_format($stats[$i][1]) . '</td>' . "\n" .
+           '              <td class="dataTableContent" align="right">' . number_format($stats[$i][2]) . '</td>' . "\n" .
+           '            </tr>' . "\n";
+    }
+?>
+          </table>
+<?php
+  } else {
+    include(DIR_WS_FUNCTIONS . 'html_graphs.php');
+
+    switch ($type) {
+      case 'yearly':
+        echo tep_banner_graph_yearly($HTTP_GET_VARS['bID']);
+        break;
+      case 'monthly':
+        echo tep_banner_graph_monthly($HTTP_GET_VARS['bID']);
+        break;
+      default:
+      case 'daily':
+        echo tep_banner_graph_daily($HTTP_GET_VARS['bID']);
+        break;
+    }
+  }
+?>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/c_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/c_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/c_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1668 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  Written by Jonathan Hilgeman of SiteCreative.com (osc at sitecreative.com)
+
+  Version History
+ 
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_FUNCTIONS . 'c_orders.php');
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  include(DIR_WS_CLASSES . 'order.php');
+
+  // New "Status History" table has different format.
+  $OldNewStatusValues = (tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "old_value") && tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "new_value"));
+  $CommentsWithStatus = tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "comments");
+  $SeparateBillingFields = tep_field_exists(TABLE_ORDERS, "billing_name");
+
+  // Optional Tax Rate/Percent
+  $AddShippingTax = "0.0"; // e.g. shipping tax of 17.5% is "17.5"
+
+  $orders_statuses = array();
+  $orders_status_array = array();
+  $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
+  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+    $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
+                               'text' => $orders_status['orders_status_name']);
+    $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
+  }
+//get shipping method
+  $orders_ship_method = array();
+  $orders_ship_method_array = array();
+  $orders_ship_method_query = tep_db_query("select ship_method from orders_ship_methods where ship_method_language = '" . (int)$languages_id . "'");
+  while ($orders_ship_methods = tep_db_fetch_array($orders_ship_method_query)) {
+    $orders_ship_method[] = array('id'   => $orders_ship_methods['ship_method'],
+                                  'text' => $orders_ship_methods['ship_method']);
+    $orders_ship_method_array[$orders_ship_methods['ship_method']] = $orders_ship_methods['ship_method'];
+  }
+//get pay method
+  $orders_pay_method = array();
+  $orders_pay_method_array = array();
+  $orders_pay_method_query = tep_db_query("select pay_method from orders_pay_methods where pay_method_language =  '" . (int)$languages_id . "'");
+  while ($orders_pay_methods = tep_db_fetch_array($orders_pay_method_query)) {
+    $orders_pay_method[] = array('id'   => $orders_pay_methods['pay_method'],
+                                  'text' => $orders_pay_methods['pay_method']);
+    $orders_pay_method_array[$orders_pay_methods['pay_method']] = $orders_pay_methods['pay_method'];
+  }
+
+// begin action
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : 'edit');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+
+  // Update Order
+  case 'update_order':
+
+    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+    $order = new order($oID);
+    $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
+    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
+
+    // Update Order Info
+    $UpdateOrders = "update " . TABLE_ORDERS . " set
+      customers_name = '" . tep_db_input(stripslashes($update_customer_name)) . "',
+      customers_company = '" . tep_db_input(stripslashes($update_customer_company)) . "',
+      customers_street_address = '" . tep_db_input(stripslashes($update_customer_street_address)) . "',
+      customers_suburb = '" . tep_db_input(stripslashes($update_customer_suburb)) . "',
+      customers_city = '" . tep_db_input(stripslashes($update_customer_city)) . "',
+      customers_state = '" . tep_db_input(stripslashes($update_customer_state)) . "',
+      customers_postcode = '" . tep_db_input($update_customer_postcode) . "',
+      customers_country = '" . tep_db_input(stripslashes($update_customer_country)) . "',
+      customers_telephone = '" . tep_db_input($update_customer_telephone) . "',
+      customers_email_address = '" . tep_db_input($update_customer_email_address) . "',";
+
+    if($SeparateBillingFields)
+    {
+    $UpdateOrders .= "billing_name = '" . tep_db_input(stripslashes($update_billing_name)) . "',
+      billing_company = '" . tep_db_input(stripslashes($update_billing_company)) . "',
+      billing_street_address = '" . tep_db_input(stripslashes($update_billing_street_address)) . "',
+      billing_suburb = '" . tep_db_input(stripslashes($update_billing_suburb)) . "',
+      billing_city = '" . tep_db_input(stripslashes($update_billing_city)) . "',
+      billing_state = '" . tep_db_input(stripslashes($update_billing_state)) . "',
+      billing_postcode = '" . tep_db_input($update_billing_postcode) . "',
+      billing_country = '" . tep_db_input(stripslashes($update_billing_country)) . "',";
+    }
+
+    $UpdateOrders .= "delivery_name = '" . tep_db_input(stripslashes($update_delivery_name)) . "',
+      delivery_company = '" . tep_db_input(stripslashes($update_delivery_company)) . "',
+      delivery_street_address = '" . tep_db_input(stripslashes($update_delivery_street_address)) . "',
+      delivery_suburb = '" . tep_db_input(stripslashes($update_delivery_suburb)) . "',
+      delivery_city = '" . tep_db_input(stripslashes($update_delivery_city)) . "',
+      delivery_state = '" . tep_db_input(stripslashes($update_delivery_state)) . "',
+      delivery_postcode = '" . tep_db_input($update_delivery_postcode) . "',
+      delivery_country = '" . tep_db_input(stripslashes($update_delivery_country)) . "',
+      payment_method = '" . tep_db_input($update_info_payment_method) . "',
+      account_name = '" . tep_db_input($account_name) . "',
+      account_number = '" . tep_db_input($account_number) . "',
+      po_number = '" . tep_db_input($po_number) . "',
+      cc_type = '" . tep_db_input($update_info_cc_type) . "',
+      cc_owner = '" . tep_db_input($update_info_cc_owner) . "',
+      cc_start = '" . tep_db_input($update_info_cc_start) . "',
+      cc_issue = '" . tep_db_input($update_info_cc_issue) . "',
+                        last_modified = now(),";
+      
+        
+// encrypt cc number begin                        
+         if ( (PAYMENT_CC_CRYPT == 'True') || (ereg ("([0-9]{1})", $order->info['cc_number'])) ) { 
+          $cc_number5 = $order->info['cc_number'];
+    }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{1})", $order->info['cc_number'])) ){
+      $cc_number5 = cc_decrypt($order->info['cc_number']);
+    }else{
+    $cc_number5 =$order->info['cc_number'];
+                  }
+          
+          if ($update_info_cc_number != $cc_number5){        
+                    if ( (PAYMENT_CC_CRYPT == 'True') || (ereg ("([0-9]{1})", $update_info_cc_number)) ) { 
+                  $cc_number10 = cc_encrypt($update_info_cc_number);
+              }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{1})", $update_info_cc_number)) ){
+         $cc_number10 = $update_info_cc_number;
+           }else{
+         $cc_number10 =$update_info_cc_number;
+                  }
+      
+    $UpdateOrders .= " cc_number = '$cc_number10',";
+                }
+//encrypt cc number end  ;              
+    //$UpdateOrders .= "cc_expires = '$update_info_cc_expires', '
+    //orders_status = '" . tep_db_input($status) . "'";
+// encrypt cc expire begin   ;                     
+         if ( (PAYMENT_CC_CRYPT == 'True') || (ereg ("([0-9]{1})", $order->info['cc_expires'])) ) { 
+          $cc_expires5 = $order->info['cc_expires'];
+    }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{1})", $order->info['cc_expires'])) ){
+      $cc_expires5 = cc_decrypt($order->info['cc_expires']);
+    }else{
+    $cc_expires5 =$order->info['cc_expires'];
+                  }
+          
+          if ($update_info_cc_number != $cc_nexpires5){        
+                    if ( (PAYMENT_CC_CRYPT == 'True') || (ereg ("([0-9]{1})", $update_info_cc_expires)) ) { 
+                  $cc_expires10 = cc_encrypt($update_info_cc_expires);
+              }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{1})", $update_info_cc_expires)) ){
+         $cc_expires10 = $update_info_cc_expires;
+           }else{
+         $cc_expires10 =$update_info_cc_expires;
+                  }
+      
+    $UpdateOrders .= " cc_expires = '$cc_expires10',";
+                }
+//encrypt cc expire end                
+
+//ccv  begin
+         if ( (PAYMENT_CC_CRYPT == 'True') || (ereg ("([0-9]{1})", $order->info['cc_ccv'])) ) { 
+          $cc_ccv5 = $order->info['cc_ccv'];
+    }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{1})", $order->info['cc_ccv'])) ){
+      $cc_ccv5 = cc_decrypt($order->info['cc_ccv']);
+    }else{
+          $cc_ccv5 =$order->info['cc_ccv'];
+    }
+
+         if ($update_info_cc_ccv != $cc_ccv5){        
+                    if ( (PAYMENT_CC_CRYPT == 'True') || (ereg ("([0-9]{1})", $update_info_cc_ccv)) ) { 
+                  $cc_ccv10 = cc_encrypt($update_info_cc_ccv);
+               }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{1})", $update_info_cc_ccv)) ){
+         $cc_ccv10 = $update_info_cc_ccv;
+           }else{
+         $cc_ccv10 = $update_info_cc_ccv;
+               }
+      }
+    $UpdateOrders .= " cc_ccv = '$cc_ccv10' ";
+  
+//ccv end 
+    if(!$CommentsWithStatus)
+    {
+      $UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'";
+    }
+
+    $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "' ";
+
+    tep_db_query($UpdateOrders);
+
+    $Query1 = "update orders set last_modified = now() where orders_id = '" . tep_db_input($oID) . "';";
+    tep_db_query($Query1);
+    $order_updated = true;
+
+
+          $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+          $check_status = tep_db_fetch_array($check_status_query);
+
+    // Update Status History & Email Customer if Necessary
+    if ($order->info['orders_status'] != $status)
+    {
+      // Notify Customer
+              $customer_notified = '0';
+      if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on'))
+      {
+        $notify_comments = '';
+        if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
+          $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
+        }
+        $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
+        tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+        $customer_notified = '1';
+      }
+
+      // "Status History" table has gone through a few
+      // different changes, so here are different versions of
+      // the status update.
+
+      // NOTE: Theoretically, there shouldn't be a
+      //       orders_status field in the ORDERS table. It
+      //       should really just use the latest value from
+      //       this status history table.
+
+      if($CommentsWithStatus)
+      {
+      tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
+        (orders_id, orders_status_id, date_added, customer_notified, comments)
+        values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), " . tep_db_input($customer_notified) . ", '" . tep_db_input($comments)  . "')");
+      }
+      else
+      {
+        if($OldNewStatusValues)
+        {
+        tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
+          (orders_id, new_value, old_value, date_added, customer_notified)
+          values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', '" . $order->info['orders_status'] . "', now(), " . tep_db_input($customer_notified) . ")");
+        }
+        else
+        {
+        tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
+          (orders_id, orders_status_id, date_added, customer_notified)
+          values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), " . tep_db_input($customer_notified) . ")");
+        }
+      }
+    }
+
+    // check to see if there are products to update
+    if (count($update_products) > 0)
+    {
+    // Update Products
+    $RunningSubTotal = 0;
+    $RunningTax = 0;
+        // CWS EDIT (start) -- Check for existence of subtotals...
+        // Do pre-check for subtotal field existence
+    $ot_subtotal_found = false;
+      foreach($update_totals as $total_details)
+    {
+        extract($total_details,EXTR_PREFIX_ALL,"ot");
+      if($ot_class == "ot_subtotal")
+      {
+          $ot_subtotal_found = true;
+          break;
+      }
+    }
+    // CWS EDIT (end) -- Check for existence of subtotals...
+
+    foreach($update_products as $orders_products_id => $products_details)
+    {
+      // Update orders_products Table
+      //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+      $order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '" . (int)$orders_products_id . "'");
+      if (tep_db_num_rows($order_query) > 0) {
+        $order_array = tep_db_fetch_array($order_query);
+      } else {
+        $order_array['products_quantity'] = 0;
+      }
+      if ($products_details["qty"] != $order_array['products_quantity']) {
+        $quantity_difference = (int)($products_details["qty"]) - (int)($order_array['products_quantity']);
+          $products_quantity = tep_db_fetch_array(tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$order_array['products_id'] . "'"));
+          $products_new_quantity = (int)$products_quantity['products_quantity'] - $quantity_difference;
+          $products_ordered = 0;
+          if ($order_array['products_quantity'] == 0) {
+            $products_ordered = 1;
+          }
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = " . $products_new_quantity . ", products_ordered = products_ordered + " . (int)$products_ordered . " where products_id = '" . (int)$order_array['products_id'] . "'");
+      }
+      //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+      if($products_details["qty"] > 0)
+      {
+        $Query = "update " . TABLE_ORDERS_PRODUCTS . " set
+          products_model = '" . $products_details["model"] . "',
+          products_name = '" . str_replace("'", "&#39;", $products_details["name"]) . "',
+          final_price = '" . $products_details["final_price"] . "',
+          products_tax = '" . $products_details["tax"] . "',
+          products_quantity = '" . $products_details["qty"] . "'
+          where orders_products_id = '$orders_products_id';";
+        tep_db_query($Query);
+
+        // Update Tax and Subtotals
+        $RunningSubTotal += $products_details["qty"] * $products_details["final_price"];
+        $RunningTax += (($products_details["tax"]/100) * ($products_details["qty"] * $products_details["final_price"]));
+
+        // Update Any Attributes
+        if(IsSet($products_details[attributes]))
+        {
+          foreach($products_details["attributes"] as $orders_products_attributes_id => $attributes_details)
+          {
+            $Query = "update " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
+              products_options = '" . $attributes_details["option"] . "',
+              products_options_values = '" . $attributes_details["value"] . "',
+              options_values_price = '" . $attributes_details["att_price"] . "',
+              price_prefix = '" . $attributes_details["att_prefix"] . "',
+              products_options_id = '" . $attributes_details["option_names"] . "',
+              products_options_values_id = '" . $attributes_details["value"] . "'
+              where orders_products_attributes_id = '$orders_products_attributes_id';";
+            tep_db_query($Query);
+          }
+        }
+      }
+      else
+      {
+        // 0 Quantity = Delete
+        $Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '$orders_products_id';";
+        tep_db_query($Query);
+          //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+//        $order = tep_db_fetch_array($order_query);
+//          if ($products_details["qty"] != $order['products_quantity']){
+//          $quantity_difference = ($products_details["qty"] - $order['products_quantity']);
+//          tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $quantity_difference . ", products_ordered = products_ordered + " . $quantity_difference . " where products_id = '" . (int)$order['products_id'] . "'");
+//          }
+          //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+        $Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_products_id = '$orders_products_id';";
+        tep_db_query($Query);
+      }
+    }
+
+    // Shipping Tax
+      foreach($update_totals as $total_index => $total_details)
+      {
+        extract($total_details,EXTR_PREFIX_ALL,"ot");
+        if($ot_class == "ot_shipping")
+        {
+          $RunningTax += (($AddShippingTax / 100) * $ot_value);
+        }
+      }
+
+    // Update Totals
+
+      $RunningTotal = 0;
+      $sort_order = 0;
+
+      // Do pre-check for Tax field existence
+        $ot_tax_found = 0;
+        foreach($update_totals as $total_details)
+        {
+          extract($total_details,EXTR_PREFIX_ALL,"ot");
+          if($ot_class == "ot_tax")
+          {
+            $ot_tax_found = 1;
+            break;
+          }
+        }
+
+      foreach($update_totals as $total_index => $total_details)
+      {
+        extract($total_details,EXTR_PREFIX_ALL,"ot");
+
+        if( trim(strtolower($ot_title)) == "tax" || trim(strtolower($ot_title)) == "tax:" )
+        {
+          if($ot_class != "ot_tax" && $ot_tax_found == 0)
+          {
+            // Inserting Tax
+            $ot_class = "ot_tax";
+            $ot_value = "x"; // This gets updated in the next step
+            $ot_tax_found = 1;
+          }
+        }
+
+        if( trim($ot_title) && trim($ot_value) )
+        {
+          $sort_order++;
+
+          // Update ot_subtotal, ot_tax, and ot_total classes
+            if($ot_class == "ot_subtotal")
+            $ot_value = $RunningSubTotal;
+
+            if($ot_class == "ot_tax")
+            {
+            $ot_value = $RunningTax;
+            // print "ot_value = $ot_value<br>\n";
+            }
+//disocunt
+
+
+
+     // CWS EDIT (start) -- Check for existence of subtotals...
+            if($ot_class == "ot_total")
+                        {
+
+                $ot_value = $RunningTotal ;
+                            if ( !$ot_subtotal_found )
+                            {
+                                // There was no subtotal on this order, lets add the running subtotal in.
+                                $ot_value = $ot_value + $RunningSubTotal;
+                            }
+                        }
+     // CWS EDIT (end) -- Check for existence of subtotals...
+
+          // Set $ot_text (display-formatted value)
+            // $ot_text = "\$" . number_format($ot_value, 2, '.', ',');
+
+            $order = new order($oID);
+            $ot_text = $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']);
+
+            if($ot_class == "ot_total")
+            $ot_text = "<b>" . $ot_text . "</b>";
+
+          if($ot_total_id > 0)
+          {
+            // In Database Already - Update
+            $Query = "update " . TABLE_ORDERS_TOTAL . " set
+              title = '$ot_title',
+              text = '$ot_text',
+              value = '$ot_value',
+              sort_order = '$sort_order'
+              where orders_total_id = '$ot_total_id'";
+            tep_db_query($Query);
+          }
+          else
+          {
+
+            // New Insert
+            $Query = "insert into " . TABLE_ORDERS_TOTAL . " set
+              orders_id = '$oID',
+              title = '$ot_title',
+              text = '$ot_text',
+              value = '$ot_value',
+              class = '$ot_class',
+              sort_order = '$sort_order'";
+            tep_db_query($Query);
+          }
+
+          if ($ot_class == "ot_shipping" || $ot_class == "ot_lev_discount" || $ot_class == "ot_customer_discount" || $ot_class == "ot_custom" || $ot_class == "ot_cod_fee") {
+            // Again, because products are calculated in terms of default currency, we need to align shipping, custom etc. values with default currency
+            $RunningTotal += $ot_value / $order->info['currency_value'];
+          }
+          else
+          {
+            if($ot_class != "ot_tax") {
+              $RunningTotal += $ot_value;
+            }
+            else if ( DISPLAY_PRICE_WITH_TAX == 'false') {
+               // For German friends, the tax is included in the price and should not be
+               // taken in account when calculating total (not sure about shipping part, though :) )
+               $RunningTotal += $ot_value;
+            }
+          }
+        
+            //  print $ot_value."<br>";
+        }
+      elseif (($ot_total_id > 0) && ($ot_class != "ot_shipping")) { // Delete Total Piece
+        
+          // Delete Total Piece
+          $Query = "delete from " . TABLE_ORDERS_TOTAL . " where orders_total_id = '$ot_total_id'";
+          tep_db_query($Query);
+        }
+
+      }
+    }
+    if ($order_updated)
+    {
+      $messageStack->add_session('search', SUCCESS_ORDER_UPDATED, 'success');
+    }
+
+    tep_redirect(tep_href_link(FILENAME_C_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit', 'SSL'));
+
+  break;
+
+  // Add a Product
+  case 'add_product':
+    if($step == 5) {
+      // Get Order Info
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+      $order = new order($oID);
+
+      $AddedOptionsPrice = 0;
+      
+      
+      // Get Product Info
+      $product_query = tep_db_query("select p.products_model,p.products_price,pd.products_name,p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='$add_product_products_id' and p.products_id=pd.products_id");
+      while ($order_prices = tep_db_fetch_array($product_query)) {
+             $p_products_model= $order_prices['products_model'];
+             $p_products_name = $order_prices['products_name'];
+             $p_products_tax_class_id = $order_prices['products_tax_class_id'];
+             $p_products_price = $order_prices['products_price'];
+             }                   
+      // 
+      
+      $special_query = tep_db_query("select s.specials_new_products_price from specials s where s.products_id ='" . $add_product_products_id . "' and s.status = 1 ");
+                      while ($special_prices = tep_db_fetch_array($special_query)) {
+                      $p_specials_price = $special_prices['specials_new_products_price'];
+                       }
+                     
+      if (tep_not_null($p_specials_price)){
+      $products_price = $p_specials_price ;
+      }else{
+      $products_price = $p_products_price;
+      }
+      echo 'price' . $p_products_price;
+      //}
+      
+      //print_r($special);
+      
+      
+      // Following functions are defined at the bottom of this file
+      $CountryID = tep_get_country_id($order->delivery["country"]);
+      $ZoneID = tep_get_zone_id($CountryID, $order->delivery["state"]);
+
+      $ProductsTax = tep_get_tax_rate($p_products_tax_class_id, $CountryID, $ZoneID);
+
+      $Query = "insert into " . TABLE_ORDERS_PRODUCTS . " set
+        orders_id = $oID,
+        products_id = $add_product_products_id,
+        products_model = '$p_products_model',
+        products_name = '" . str_replace("'", "&#39;", $p_products_name) . "',
+        products_price = '$products_price',
+        final_price = '" . ($products_price + $AddedOptionsPrice) . "',
+        products_tax = '$ProductsTax',
+        products_quantity = $add_product_quantity;";
+      tep_db_query($Query);
+      $new_product_id = tep_db_insert_id();
+
+//UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+      tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . (int)$add_product_quantity . ", products_ordered = products_ordered + 1 where products_id = '" . (int)$add_product_products_id . "'");
+//UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+
+  // Get Product Attribute Info
+
+   if(IsSet($add_product_options)){
+
+//split $add_product_options
+      foreach($add_product_options as $option_id => $option_value_id){
+// check to see if there is a downloadable file
+if (DOWNLOAD_ENABLED == 'true') {
+$attributes_query_check = tep_db_query("select pa.products_attributes_id, poval.products_options_values_id, pa.products_id, pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, poptt.products_options_name, poval.products_options_values_name, pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount  FROM
+" . TABLE_PRODUCTS_OPTIONS . " popt,
+" . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,
+" . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
+" . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+" . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad  
+WHERE
+pa.products_id = '" . $add_product_products_id . "'
+and pa.options_id = '" . $option_id. "' 
+and pa.options_values_id = '" . $option_value_id. "' 
+and pa.options_id = poptt.products_options_text_id 
+and poval.products_options_values_id =  pa.options_values_id 
+and poptt.language_id = '" . (int)$languages_id . "' 
+and poval.language_id = '" . (int)$languages_id . "'
+and pad.products_attributes_id = pa.products_attributes_id 
+order by pa.products_options_sort_order 
+limit 1"); 
+ if (tep_db_num_rows($attributes_query_check)) {
+$item_has_down = '1';
+  }
+}
+
+// get attibutes data
+if ( (DOWNLOAD_ENABLED == 'true') && ($item_has_down == '1') ) {
+$attributes_query = tep_db_query("select pa.products_attributes_id, poval.products_options_values_id, pa.products_id, pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, poptt.products_options_name, poval.products_options_values_name, pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount  FROM
+" . TABLE_PRODUCTS_OPTIONS . " popt,
+" . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,
+" . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
+" . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+" . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad  
+WHERE
+pa.products_id = '" . $add_product_products_id . "'
+and pa.options_id = '" . $option_id. "' 
+and pa.options_values_id = '" . $option_value_id. "' 
+and pa.options_id = poptt.products_options_text_id 
+and poval.products_options_values_id =  pa.options_values_id 
+and poptt.language_id = '" . (int)$languages_id . "' 
+and poval.language_id = '" . (int)$languages_id . "'
+and pad.products_attributes_id = pa.products_attributes_id 
+order by pa.products_options_sort_order 
+limit 1"); 
+    } else {
+$attributes_query = tep_db_query("select pa.products_attributes_id, poval.products_options_values_id, pa.products_id, pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, poptt.products_options_name, poval.products_options_values_name from
+" . TABLE_PRODUCTS_OPTIONS . " popt,
+" . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,
+" . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
+" . TABLE_PRODUCTS_ATTRIBUTES . " pa
+where
+pa.products_id = '" . $add_product_products_id . "'
+and pa.options_id = '" . $option_id. "' 
+and pa.options_values_id = '" . $option_value_id. "' 
+and pa.options_id = poptt.products_options_text_id 
+and poval.products_options_values_id =  pa.options_values_id 
+and poptt.language_id = '" . (int)$languages_id . "' 
+and poval.language_id = '" . (int)$languages_id . "'
+order by pa.products_options_sort_order
+limit 1
+"); 
+}
+while  ($attributes = tep_db_fetch_array($attributes_query)){
+  $orders_products_id = $new_product_id;
+  $products_options = $attributes['products_options_name'];
+  $products_options_values = $attributes['products_options_values_name'];
+  $options_values_price = $attributes['options_values_price'];
+  $price_prefix = $attributes['price_prefix'];
+  $products_options_id = $attributes['options_id'];
+  $products_options_values_id = $attributes['options_values_id'];
+
+//downloads
+$orders_products_filename = $attributes['products_attributes_filename'];
+$download_maxdays = $attributes['products_attributes_maxdays'];
+$download_count = $attributes['products_attributes_maxcount'];
+
+//add attibute price to product price
+if ($price_prefix == '+'){
+  $AddedOptionsPrice += $options_values_price;
+}else{
+  $AddedOptionsPrice -= $options_values_price;
+  }
+// $att_options_values_price = $att_price;  
+ 
+// update final price
+$product_price = tep_db_query("select final_price from
+                             " . TABLE_ORDERS_PRODUCTS . "
+                            where
+                            orders_id = $oID and
+                            orders_products_id = $new_product_id ");
+  while  ($product_price_array = tep_db_fetch_array($product_price)){
+    $Query = "update " . TABLE_ORDERS_PRODUCTS . " set
+     final_price = '" . ($product_price_array['final_price'] + $AddedOptionsPrice) . "'
+  where orders_id = $oID and orders_products_id = $orders_products_id ";
+   tep_db_query($Query);
+ }  
+ 
+//insert attrbutes
+   $Query = "insert into " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
+               orders_id = $oID,
+               orders_products_id = $orders_products_id,
+               products_options = '". $products_options . "',
+               products_options_values = '" . $products_options_values. "',
+               options_values_price = $options_values_price,
+               price_prefix = '" . $price_prefix . "',
+               products_options_id = $products_options_id,
+               products_options_values_id = $products_options_values_id;";
+    
+  tep_db_query($Query);
+// add download insert
+          if ((DOWNLOAD_ENABLED == 'true') && isset($orders_products_filename) && tep_not_null($orders_products_filename)) {
+            $sql_data_array = array('orders_id' => $oID,
+                                    'orders_products_id' => $new_product_id,
+                                    'orders_products_filename' => $orders_products_filename,
+                                    'download_maxdays' => $download_maxdays,
+                                    'download_count' => $download_count);
+            tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
+           }
+
+
+   }
+    }
+//add product info
+
+  //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+  tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $add_product_quantity . ", products_ordered = products_ordered + " . $add_product_quantity . " where products_id = '" . $add_product_products_id . "'");
+  //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+//end add product info
+
+      // Calculate Tax and Sub-Totals
+      $order = new order($oID);
+      $RunningSubTotal = 0;
+      $RunningTax = 0;
+
+      for ($i=0; $i<sizeof($order->products); $i++)
+      {
+      $RunningSubTotal += ($order->products[$i]['qty'] * $order->products[$i]['final_price']);
+      $RunningTax += (($order->products[$i]['tax'] / 100) * ($order->products[$i]['qty'] * $order->products[$i]['final_price']));
+      }
+        //   echo 'running_tax ' . $RunningTax ;
+    if ($ot_class == "ot_shipping" || $ot_class == "ot_lev_discount" || $ot_class == "ot_customer_discount" || $ot_class == "ot_custom" || $ot_class == "ot_cod_fee") {
+      // Again, because products are calculated in terms of default currency, we need to align shipping, custom etc. values with default currency
+      $RunningTotal += $ot_value / $order->info['currency_value'];
+      }
+
+      // Tax
+      $Query = "update " . TABLE_ORDERS_TOTAL . " set
+        text = '\$" . number_format($RunningTax, 2, '.', ',') . "',
+        value = '" . $RunningTax . "'
+        where class='ot_tax' and orders_id=$oID";
+      tep_db_query($Query);
+
+      // Sub-Total
+      $Query = "update " . TABLE_ORDERS_TOTAL . " set
+        text = '\$" . number_format($RunningSubTotal, 2, '.', ',') . "',
+        value = '" . $RunningSubTotal . "'
+        where class='ot_subtotal' and orders_id=$oID";
+      tep_db_query($Query);
+
+      // Total
+      $Query = "select sum(value) as total_value from " . TABLE_ORDERS_TOTAL . " where class != 'ot_total' and orders_id=$oID";
+      $result = tep_db_query($Query);
+      $row = tep_db_fetch_array($result);
+      $Total = $row["total_value"];
+
+      $Query = "update " . TABLE_ORDERS_TOTAL . " set
+        text = '<b>\$" . number_format($Total, 2, '.', ',') . "</b>',
+        value = '" . $Total . "'
+        where class='ot_total' and orders_id=$oID";
+      tep_db_query($Query);
+       }
+tep_redirect(tep_href_link(FILENAME_C_ORDERS, tep_get_all_get_params(array('action')) . 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit', 'SSL'));
+
+    }
+  break;
+      
+    } //end action
+  }// end action NUll
+
+  if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
+    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+    $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+    $order_exists = true;
+    if (!tep_db_num_rows($orders_query)) {
+      $order_exists = false;
+      $messageStack->add('search', sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php
+  require(DIR_WS_INCLUDES . 'header.php');
+?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (($action == 'edit') && ($order_exists == true)) {
+    $order = new order($oID);
+?>
+      <tr>
+        <td width="100%">
+          <table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+             <tr><td class=main><font color='#000000'><b><?php echo HEADING_STEP2 . $oID; ?></b></td></tr>
+
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+
+<!-- Begin Addresses Block -->
+      <tr><?php echo tep_draw_form('edit_order', FILENAME_C_ORDERS, tep_get_all_get_params(array('action','paycc')) . 'action=update_order', 'post', '', 'SSL'); ?>
+  <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+    <tr>
+      <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+    </tr>
+    <tr>
+      <td valign="top">
+      <!-- Customer Info Block -->
+    <table border="0" cellspacing="0" cellpadding="2">
+    <tr>
+    <td colspan='2' class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
+    <td colspan='2' class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>
+    </tr>
+    <tr>
+    <td colspan='2' class="main">
+    <table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+      <tr>
+      <td class="editOrder"><b><?php echo ENTRY_NAME ?></b></font></td>
+      <td><input name='update_customer_name' size='37' value='<?php echo tep_html_quotes($order->customer['name']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_COMPANY ?></b></font></td>
+        <td><input name='update_customer_company' size='37' value='<?php echo tep_html_quotes($order->customer['company']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo CATEGORY_ADDRESS ?></b></font></td>
+        <td><input name='update_customer_street_address' size='37' value='<?php echo tep_html_quotes($order->customer['street_address']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_SUBURB ?></b></font></td>
+        <td><input name='update_customer_suburb' size='37' value='<?php echo tep_html_quotes($order->customer['suburb']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_CITY ?></b></font></td>
+        <td><input name='update_customer_city' size='15' value='<?php echo tep_html_quotes($order->customer['city']); ?>'> </td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_STATE ?></b></font></td>
+        <td><input name='update_customer_state' size='15' value='<?php echo tep_html_quotes($order->customer['state']); ?>'> </td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_POST_CODE ?></b></font></td>
+        <td><input name='update_customer_postcode' size='5' value='<?php echo $order->customer['postcode']; ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_COUNTRY ?></b></font></td>
+        <td><input name='update_customer_country' size='37' value='<?php echo tep_html_quotes($order->customer['country']); ?>'></td>
+      </tr>
+     </table>
+    </td>
+
+
+<?php if($SeparateBillingFields) { ?>
+      <td>
+       <!-- Billing Address Block -->
+       <table border="0" cellspacing="0" cellpadding="2">
+
+      <tr>
+        <td colspan='2' class="main">
+          <table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+          <tr>
+            <td class="editOrder"><b><?php echo ENTRY_NAME ?></b></font></td>
+              <td><input name='update_billing_name' size='37' value='<?php echo tep_html_quotes($order->billing['name']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COMPANY ?></b></font></td>
+              <td><input name='update_billing_company' size='37' value='<?php echo tep_html_quotes($order->billing['company']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo CATEGORY_ADDRESS ?></b></font></td>
+              <td><input name='update_billing_street_address' size='37' value='<?php echo tep_html_quotes($order->billing['street_address']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_SUBURB ?></b></font></td>
+              <td><input name='update_billing_suburb' size='37' value='<?php echo tep_html_quotes($order->billing['suburb']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_CITY ?></b></font></td>
+              <td><input name='update_billing_city' size='15' value='<?php echo tep_html_quotes($order->billing['city']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_STATE ?></b></font></td>
+              <td><input name='update_billing_state' size='15' value='<?php echo tep_html_quotes($order->billing['state']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_POST_CODE ?></b></font></td>
+              <td><input name='update_billing_postcode' size='5' value='<?php echo $order->billing['postcode']; ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COUNTRY ?></b></font></td>
+              <td><input name='update_billing_country' size='37' value='<?php echo tep_html_quotes($order->billing['country']); ?>'></td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+    </table>
+      </td>
+<?php } ?>
+
+    </tr>
+    </table>
+      </td>
+      </tr>
+
+      <tr>
+      <td valign="top">
+      <!-- Shipping Address Block -->
+    <table border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>
+      </tr>
+      <tr>
+        <td colspan='1' class="main">
+          <table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+          <tr>
+            <td class="editOrder"><b><?php echo ENTRY_NAME ?></b></font></td>
+              <td><input name='update_delivery_name' size='37' value='<?php echo tep_html_quotes($order->delivery['name']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COMPANY ?></b></font></td>
+              <td><input name='update_delivery_company' size='37' value='<?php echo tep_html_quotes($order->delivery['company']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo CATEGORY_ADDRESS ?></b></font></td>
+              <td><input name='update_delivery_street_address' size='37' value='<?php echo tep_html_quotes($order->delivery['street_address']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_SUBURB ?></b></font></td>
+              <td><input name='update_delivery_suburb' size='37' value='<?php echo tep_html_quotes($order->delivery['suburb']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_CITY ?></b></font></td>
+              <td><input name='update_delivery_city' size='15' value='<?php echo tep_html_quotes($order->delivery['city']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_STATE ?></b></font></td>
+              <td><input name='update_delivery_state' size='15' value='<?php echo tep_html_quotes($order->delivery['state']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_POST_CODE ?></b></font></td>
+              <td><input name='update_delivery_postcode' size='5' value='<?php echo $order->delivery['postcode']; ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COUNTRY ?></b></font></td>
+              <td><input name='update_delivery_country' size='37' value='<?php echo tep_html_quotes($order->delivery['country']); ?>'></td>
+            </tr>
+          </table>
+        </td>
+        <td class="main" align="center" valign="middle">
+          <font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" color="red"><b><?php echo HEADING_INSTRUCT1 ?></b></font><br><br>
+          <?php echo HEADING_INSTRUCT2 ?>
+
+        </td>
+       </tr>
+      </table>
+      </td>
+    </tr>
+  </table></td>
+      </tr>
+<!-- End Addresses Block -->
+
+      <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+<!-- Begin Phone/Email Block -->
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+          <tr>
+            <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>
+            <td class="main"><input name='update_customer_telephone' size='15' value='<?php echo $order->customer['telephone']; ?>'></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
+            <td class="main"><input name='update_customer_email_address' size='35' value='<?php echo $order->customer['email_address']; ?>'></td>
+          </tr>
+               <tr>
+                <td class="main"><b><?php echo ENTRY_IPADDRESS; ?></b></td>
+                <td class="main"><?php echo $order->customer['ipaddy']; ?></td>
+    </tr>
+    <tr>
+    <td class="main"><b><?php echo ENTRY_IPISP; ?></b></td>
+    <td class="main"><?php echo $order->customer['ipisp']; ?></td>
+    </tr>
+        </table></td>
+      </tr>
+<!-- End Phone/Email Block -->
+
+      <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+<!-- Begin Payment Block -->
+      <tr>
+  <td><table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+    <tr valine="middle">
+      <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
+      <td class="main"><?php echo tep_draw_pull_down_menu('update_info_payment_method', $orders_pay_method, $order->info['payment_method']); ?>
+      <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+      <?php
+      if($order->info['payment_method'] != "Credit Card")
+      echo TEXT_VIEW_CC;
+      ?>
+      <?php
+    if($order->info['payment_method'] != "Purchase Order")
+    echo TEXT_VIEW_PO;
+      ?>
+      </td>
+    </tr>
+
+  <?php if ($order->info['cc_type'] || $order->info['cc_owner'] || $order->info['payment_method'] == "Credit Card" || $order->info['cc_number']) { ?>
+    <!-- Begin Credit Card Info Block -->
+    <tr>
+      <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+    </tr>
+    <tr>
+      <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td>
+      <td class="main"><input name='update_info_cc_type' size='10' value='<?php echo $order->info['cc_type']; ?>'></td>
+    </tr>
+    <tr>
+      <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td>
+      <td class="main"><input name='update_info_cc_owner' size='20' value='<?php echo $order->info['cc_owner']; ?>'></td>
+    </tr>
+    <tr>
+<?php  
+unset ($cc_number7) ;
+
+                   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{6})", $order->info['cc_number'])) && !($order->info['cc_number'] == '0000000000000000') ) { 
+                 $cc_number7 = $order->info['cc_number'];
+                 $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+              
+              }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{6})", $order->info['cc_number'])) ) {
+           $cc_number7 = cc_decrypt($order->info['cc_number']);
+           $text_encypt3= TEXT_CARD_ENCRPYT;
+          
+          }else if($order->info['cc_number'] == '0000000000000000') {
+            $cc_number7 = $order->info['cc_number'];
+          $text_encypt3= TEXT_CCV_REMOVED;
+ 
+           }else{
+            $cc_number7 = $order->info['cc_number'];
+            $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+                  }
+                  ?>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>
+      <td class="main"><input name='update_info_cc_number' size='20' value='<?php echo $cc_number7; ?>'></td>
+            <td class="main"><?php echo $text_encypt3; ?></td>
+          </tr>
+          <tr>
+       <?php
+                   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{4})", $order->info['cc_expires'])) ) { 
+                 $cc_expires7 = $order->info['cc_expires'];
+                 $text_encypt4 = TEXT_EXPIRES_NOT_ENCRPYT ;
+                
+              }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{4})", $order->info['cc_expires'])) && !($order->info['cc_expires'] == '')  ) {
+           $cc_expires7 = cc_decrypt($order->info['cc_expires']);
+           $text_encypt4= TEXT_EXPIRES_ENCRPYT;
+           
+          }else if($order->info['cc_expires'] == '') {
+           $cc_expires7 = $order->info['cc_expires'];
+           $text_encypt4 =  TEXT_EXPIRES_REMOVED ;
+           
+              }else{
+           $cc_expires7 =$order->info['cc_expires'];
+           $text_encypt4 =  TEXT_EXPIRES_NOT_ENCRPYT ;
+                  }
+                  ?>
+          
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td>
+      <td class="main"><input name='update_info_cc_expires' size='4' value='<?php echo $cc_expires7; ?>'></td>
+            <td class="main"><?php echo $text_encypt4; ?></td>
+
+          </tr>
+                    <tr>
+           <?php
+                 //    if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{4})", $order->info['cc_expires'])) ) { 
+
+                       if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{3})", $order->info['cc_ccv'])) ) {
+                     $cc_ccv7 = $order->info['cc_ccv'];
+                     $text_encypt5 = TEXT_CCV_NOT_ENCRPYT ;
+                           
+                  }else if ( (PAYMENT_CC_CRYPT == 'True') &&  !(ereg ("([0-9]{3})", $order->info['cc_ccv'])) && !($order->info['cc_ccv'] == '')  ) {
+               $cc_ccv7 = cc_decrypt($order->info['cc_ccv']);
+               $text_encypt5= TEXT_CCV_ENCRPYT;
+               
+              }else if($order->info['cc_ccv'] == '') {
+               $cc_ccv7 = $order->info['cc_ccv'];
+           $text_encypt5= TEXT_CCV_REMOVED;
+
+              }else {
+               $cc_ccv7 =$order->info['cc_ccv'];
+               $text_encypt5=  TEXT_CCV_NOT_ENCRPYT;
+                      }
+                      ?>
+              
+                <td class="main"><?php echo ENTRY_CREDIT_CARD_CCV; ?></td>
+                <td class="main"><input name='update_info_cc_ccv' size='4' value='<?php echo $cc_ccv7; ?>'></td>
+                <td class="main"><?php echo $text_encypt5; ?></td>
+    
+              </tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_START_DATE; ?></td>
+            <td class="main"><input name='update_info_cc_start' size='4' value='<?php echo $order->info['cc_start']; ?>'></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_ISSUE; ?></td>
+            <td class="main"><input name='update_info_cc_issue' size='4' value='<?php echo $order->info['cc_issue']; ?>'></td>
+          </tr>
+    <!-- End Credit Card Info Block -->
+    <?php
+        // purchaseorder start
+            } else if( (($order->info['account_name']) || ($order->info['account_number']) || $order->info['payment_method'] == "Purchase Order"|| ($order->info['po_number'])) ) {
+        ?>
+    <tr>
+          <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+    </tr>
+    <tr>
+    <td class="main" valign="top" align="left"><b><?php echo TEXT_INFO_PO ?></b></td>
+    <td>
+    <table border="0" cellspacing="0" cellpadding="2">
+    <tr>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><?php echo TEXT_INFO_NAME ?></td>
+      <td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><input type="text" name="account_name" value='<?php echo $order->info['account_name']; ?>'></td></td>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+    </tr>
+    <tr>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><?php echo TEXT_INFO_AC_NR ?></td>
+      <td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><input type="text" name="account_number" value='<?php echo $order->info['account_number']; ?>'></td>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+    </tr>
+    <tr>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><?php echo TEXT_INFO_PO_NR ?></td>
+      <td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><input type="text" name="po_number" value='<?php echo $order->info['po_number']; ?>'></td>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+    </tr>
+   </table>
+   </td>
+     </tr>
+  <?php } ?>
+  </table></td>
+      </tr>
+<!-- End Payment Block -->
+
+      <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+<!-- Begin Products Listing Block -->
+      <tr>
+  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+    <tr class="dataTableHeadingRow">
+      <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+      <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
+      <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_TAX; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_BASE_PRICE; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_UNIT_PRICE; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_PRICE; ?></td>
+    </tr>
+
+  <!-- Begin Products Listings Block -->
+  <?php
+        // Override order.php Class's Field Limitations
+    $index = 0;
+    $order->products = array();
+    $orders_products_query = tep_db_query("select * from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "'");
+    while ($orders_products = tep_db_fetch_array($orders_products_query)) {
+    $order->products[$index] = array('qty' => $orders_products['products_quantity'],
+                                        'name' => str_replace("'", "&#39;", $orders_products['products_name']),
+                                        'model' => $orders_products['products_model'],
+                                        'tax' => $orders_products['products_tax'],
+                                        'price' => $orders_products['products_price'],
+                                        'final_price' => $orders_products['final_price'],
+                                        'orders_products_id' => $orders_products['orders_products_id']);
+
+    $subindex = 0;
+    $attributes_query_string = "select * from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'";
+    $attributes_query = tep_db_query($attributes_query_string);
+
+    if (tep_db_num_rows($attributes_query)) {
+    while ($attributes = tep_db_fetch_array($attributes_query)) {
+      $order->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
+                                                               'value' => $attributes['products_options_values'],
+                                                               'prefix' => $attributes['price_prefix'],
+                                                               'price' => $attributes['options_values_price'],
+                                                               'orders_products_attributes_id' => $attributes['orders_products_attributes_id']);
+    $subindex++;
+    }
+    }
+    $index++;
+    }
+  $my_total = 0;
+  for ($i=0; $i<sizeof($order->products); $i++) {
+    $orders_products_id = $order->products[$i]['orders_products_id'];
+
+    $RowStyle = "dataTableContent";
+
+    echo '    <tr class="dataTableRow">' . "\n" .
+       '      <td class="' . $RowStyle . '" valign="top" align="right">' . "<input name='update_products[$orders_products_id][qty]' size='2' value='" . $order->products[$i]['qty'] . "'>&nbsp;x</td>\n" .
+       '      <td class="' . $RowStyle . '" valign="top">' . "<input name='update_products[$orders_products_id][name]' size='25' value='" . $order->products[$i]['name'] . "'>";
+
+    // Has Attributes?
+    if (sizeof($order->products[$i]['attributes']) > 0) {
+      for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) {
+        $orders_products_attributes_id = $order->products[$i]['attributes'][$j]['orders_products_attributes_id'];
+        echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ' : ' . $order->products[$i]['attributes'][$j]['value'] . ' ' . $order->products[$i]['attributes'][$j]['prefix'] . ' ' . $currencies->format($order->products[$i]['attributes'][$j]['price']) ;
+        echo '</i></small></nobr>';
+      }
+    }
+
+    echo '      </td>' . "\n" .
+         '      <td class="' . $RowStyle . '" valign="top">' . "<input name='update_products[$orders_products_id][model]' size='12' value='" . $order->products[$i]['model'] . "'>" . '</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="center" valign="top">' . "<input name='update_products[$orders_products_id][tax]' size='3' value='" . tep_display_tax_value($order->products[$i]['tax']) . "'>" . '%</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="right" valign="top">' . "<input name='update_products[$orders_products_id][price]' size='5' value='" . number_format($order->products[$i]['price'], 2, '.', '') . "'>" . '</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="right" valign="top">' . "<input name='update_products[$orders_products_id][final_price]' size='5' value='" . number_format($order->products[$i]['final_price'], 2, '.', '') . "'>" . '</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="right" valign="top">' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
+         '    </tr>' . "\n";
+    $my_total += $order->products[$i]['final_price'] * $order->products[$i]['qty'];
+  }
+  ?>
+  <!-- End Products Listings Block -->
+
+  <!-- Begin Order Total Block -->
+    <tr>
+      <td align="right" colspan="7">
+        <table border="0" cellspacing="0" cellpadding="2" width="100%">
+        <tr>
+        <td align='center' valign='top'><br><?php echo '<a href="' . tep_href_link(FILENAME_C_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=add_product&step=1') . '">'. tep_image_button('button_add_product.gif', 'Add a product') . '&nbsp;</a></td>' ;?>
+        <td align='right'>
+        <table border="0" cellspacing="0" cellpadding="2">
+<?php
+
+        // Override order.php Class's Field Limitations
+    $totals_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' order by sort_order");
+    $order->totals = array();
+    while ($totals = tep_db_fetch_array($totals_query)) { $order->totals[] = array('title' => $totals['title'], 'text' => $totals['text'], 'class' => $totals['class'], 'value' => $totals['value'], 'orders_total_id' => $totals['orders_total_id']); }
+
+  $TotalsArray = array();
+  for ($i=0; $i<sizeof($order->totals); $i++) {
+    $TotalsArray[] = array("Name" => $order->totals[$i]['title'], "Price" => number_format($order->totals[$i]['value'], 2, '.', ''), "Class" => $order->totals[$i]['class'], "TotalID" => $order->totals[$i]['orders_total_id']);
+    $TotalsArray[] = array("Name" => "          ", "Price" => "", "Class" => "ot_custom", "TotalID" => "0");
+  }
+
+  array_pop($TotalsArray);
+  foreach($TotalsArray as $TotalIndex => $TotalDetails)
+  {
+    $TotalStyle = "smallText";
+    if(($TotalDetails["Class"] == "ot_subtotal") || ($TotalDetails["Class"] == "ot_total"))
+    {
+      if ($TotalDetails["Price"] != '0.00') {
+        $my_total = $TotalDetails["Price"];
+      }
+      echo  '       <tr>' . "\n" .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
+        '   <td class="main" align="right"><b>' . $my_total .
+            "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+            "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" .
+            "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+        '       </tr>' . "\n";
+    }
+    elseif($TotalDetails["Class"] == "ot_customer_discount")
+        {
+          echo  '       <tr>' . "\n" .
+            '   <td class="main" align="right">' . ENTRY_CUSTOMER_DISCOUNT . '<b>' . $TotalDetails["Name"] . '</b></td>' .
+            '   <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value=' " . $TotalDetails["Price"] . "'>" .
+                    "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+                "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+                "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+            '       </tr>' . "\n";
+    }
+
+    elseif($TotalDetails["Class"] == "ot_gv")
+        {
+          echo  '       <tr>' . "\n" .
+            '   <td class="main" align="right">' . ENTRY_CUSTOMER_GV . '<b>' . $TotalDetails["Name"] . '</b></td>' .
+            '   <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value=' " . $TotalDetails["Price"] . "'>" .
+                    "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+                "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+                "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+            '       </tr>' . "\n";
+    }
+    elseif($TotalDetails["Class"] == "ot_subtotal") 
+    {
+      echo '  <tr>' . "\n" .
+           '    <td align="right" class="' . $TotalStyle . '"><b>' . $TotalDetails["Name"] . '</b></td>' .
+           '    <td align="right" class="' . $TotalStyle . '"><b>' . $currencies->format($TotalDetails["Price"], true, $order->info['currency'], $order->info['currency_value']) . '</b>' . 
+                "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' size='" . strlen($TotalDetails["Name"]) . "' >" . 
+                "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" . 
+                "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" . 
+                "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' . 
+           '    <td align="right" class="' . $TotalStyle . '"><b>' . tep_draw_separator('pixel_trans.gif', '1', '17') . '</b>' . 
+           '  </tr>' . "\n";
+    }
+    elseif($TotalDetails["Class"] == "ot_tax")
+    {
+      echo  '       <tr>' . "\n" .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Price"] .
+                        "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+            "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" .
+            "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+        '       </tr>' . "\n";
+    }
+        //  Shipping
+    elseif($TotalDetails["Class"] == "ot_shipping")
+    { 
+      //list exsisting shipping if not in current order_ship_meahtods table
+           $orders_ship_methodA[] = array('id'   => $TotalDetails["Name"],
+                                                    'text' => $TotalDetails["Name"]);
+          
+                  //  $orders_ship_method1 = array_merge($orders_ship_method, $orders_ship_methodA) ;
+                  // check to see if meathod in totals  is in same as in order_ship_meahtods table
+                          // if false merge if true dont merge
+
+                         $orders_ship_method1 = array_merge($orders_ship_methodA, $orders_ship_method) ;
+     
+    
+      echo  ' <tr>' . "\n" .
+          '       <td align="right" class="' . $TotalStyle . '"><b><?php echo HEADING_SHIPPING ?></b>' . tep_draw_pull_down_menu('update_totals[$TotalIndex][title]', $orders_ship_method1, $TotalDetails["Name"]) . '</td>' . "\n";
+      echo  ' <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value='" . $TotalDetails["Price"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][class]' value='" . $TotalDetails["Class"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</td>' .
+        '       </tr>' . "\n";
+    }
+    // End Shipping
+    else
+    {
+      echo  '       <tr>' . "\n" .
+          '   <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
+        '   <td align="right" class="' . $TotalStyle . '">' . "<input type='hidden' name='update_totals[$TotalIndex][value]' size='6' value='" . $TotalDetails["Price"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][title]' value='" . trim($TotalDetails["Name"]) . "' >" .
+            "<input type='hidden' name='update_totals[$TotalIndex][class]' value='" . $TotalDetails["Class"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" .
+            '</td>' . "\n" .
+        '       </tr>' . "\n";
+    }
+  }
+?>
+        </table>
+        </td>
+        </tr>
+        </table>
+      </td>
+    </tr>
+  <!-- End Order Total Block -->
+
+  </table></td>
+      </tr>
+
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+      <tr>
+        <td class="main"><table border="1" cellspacing="0" cellpadding="5">
+          <tr>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>
+            <?php if($CommentsWithStatus) { ?>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+            <?php } ?>
+          </tr>
+<?php
+    $orders_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
+    if (tep_db_num_rows($orders_history_query)) {
+      while ($orders_history = tep_db_fetch_array($orders_history_query)) {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
+             '            <td class="smallText" align="center">';
+        if ($orders_history['customer_notified'] == '1') {
+          echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
+        } else {
+          echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
+        }
+        echo '            <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n";
+
+        if($CommentsWithStatus) {
+        echo '            <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . '&nbsp;</td>' . "\n";
+        }
+
+        echo '          </tr>' . "\n";
+      }
+    } else {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
+             '          </tr>' . "\n";
+    }
+?>
+        </table></td>
+      </tr>
+
+      <tr>
+        <td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+      </tr>
+      <tr>
+        <td class="main">
+        <?php
+        if($CommentsWithStatus) {
+          echo tep_draw_textarea_field('comments', 'soft', '60', '5');
+  }
+  else
+  {
+    echo tep_draw_textarea_field('comments', 'soft', '60', '5', $order->info['comments']);
+  }
+  ?>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', false); ?></td>
+          </tr>
+          <?php if($CommentsWithStatus) { ?>
+          <tr>
+                <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', false); ?></td>
+          </tr>
+          <?php } ?>
+        </table></td>
+      </tr>
+
+      <tr>
+  <td align='center' valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
+  </tr>
+  <tr>
+  <td colspan="2" align="right"><?php 
+    if (isset($HTTP_GET_VARS[tep_session_name()])) {
+      $oscid = '&' . tep_session_name() . '=' . $HTTP_GET_VARS[tep_session_name()];
+    } else {
+      $oscid = '';
+    }
+    echo ' </a> <a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . $oscid . '\')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a><a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . $oscid . '\')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>'; ?></td>
+
+    
+    
+    </tr>
+      </form>
+<?php
+  }
+
+if($action == "add_product")
+{
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo ADDING_TITLE; ?> #<?php echo $oID; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+  // ############################################################################
+  //   Get List of All Products
+  // ############################################################################
+
+    $result = tep_db_query("SELECT products_name, p.products_id, cd.categories_name, ptc.categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id=ptc.categories_id and ptc.products_id=p.products_id and p.products_status = '1' and p.products_id=pd.products_id and pd.language_id = '" . (int)$languages_id . "' ORDER BY cd.categories_name");
+    while($row = tep_db_fetch_array($result))
+    {
+      extract($row,EXTR_PREFIX_ALL,"db");
+      $ProductList[$db_categories_id][$db_products_id] = $db_products_name;
+      $CategoryList[$db_categories_id] = $db_categories_name;
+      $LastCategory = $db_categories_name;
+    }
+
+    // ksort($ProductList);
+
+    $LastOptionTag = "";
+    $ProductSelectOptions = "<option value='0'>Don't Add New Product" . $LastOptionTag . "\n";
+    $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
+    foreach($ProductList as $Category => $Products)
+    {
+      $ProductSelectOptions .= "<option value='0'>$Category" . $LastOptionTag . "\n";
+      $ProductSelectOptions .= "<option value='0'>---------------------------" . $LastOptionTag . "\n";
+      asort($Products);
+      foreach($Products as $Product_ID => $Product_Name)
+      {
+        $ProductSelectOptions .= "<option value='$Product_ID'> &nbsp; $Product_Name" . $LastOptionTag . "\n";
+      }
+
+      if($Category != $LastCategory)
+      {
+        $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
+        $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
+      }
+    }
+
+
+  // ############################################################################
+  //   Add Products Steps
+  // ############################################################################
+
+    echo '<tr><td><table border=\'0\'>' . "\n";
+
+    // Set Defaults
+      if(!IsSet($add_product_categories_id))
+      $add_product_categories_id = 0;
+
+      if(!IsSet($add_product_products_id))
+      $add_product_products_id = 0;
+
+    // Step 1: Choose Category
+      print "<tr class=\"dataTableRow\"><form action='" . tep_href_link(FILENAME_C_ORDERS, 'oID='.$oID.'&action=add_product') . "' method='POST'>\n";
+      echo "<td class=\"dataTableContent\" align=\"right\"><b>" . TEXT_ADD_PROD_STEP1 . "</b></td><td class=\"dataTableContent\" valign=\"top\">";
+
+      $tree = tep_get_category_tree();
+      $dropdown= tep_draw_pull_down_menu('add_product_categories_id', $tree, '', ''); //single
+      echo $dropdown;
+
+
+      // print "<select name='add_product_categories_id'>\n";
+      // $CategoryOptions = "<option value='0'> TEXT_ADD_CAT_CHOOSE ";
+      // foreach($CategoryList as $CategoryID => $CategoryName)
+      // {
+      // $CategoryOptions .= "<option value='$CategoryID'> $CategoryName\n";
+      // }
+
+      $CategoryOptions = str_replace("value='$add_product_categories_id'","value='$add_product_categories_id' selected", $CategoryOptions);
+      print $CategoryOptions;
+      print "</td>\n";
+      print "<td class='dataTableContent' align='center'><input type='submit' value='" . TEXT_SELECT_CAT . "'>";
+      print "<input type='hidden' name='step' value='2'>";
+      print "</td>\n";
+      print "</form></tr>\n";
+
+      print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
+
+    // Step 2: Choose Product
+    if(($step > 1) && ($add_product_categories_id > 0))
+    {
+      print "<tr class=\"dataTableRow\"><form action='" . tep_href_link(FILENAME_C_ORDERS, 'oID='.$oID.'&action='.$action) . "' method='POST'>\n";
+      print "<td class='dataTableContent' align='right'><b><?php echo TEXT_ADD_STEP2 ?></b></td><td class='dataTableContent' valign='top'><select name='add_product_products_id'>";
+      $ProductOptions = "<option value='0'> " . TEXT_ADD_PROD_CHOOSE;
+      asort($ProductList[$add_product_categories_id]);
+      foreach($ProductList[$add_product_categories_id] as $ProductID => $ProductName)
+      {
+      $ProductOptions .= "<option value='$ProductID'> $ProductName\n";
+      }
+      $ProductOptions = str_replace("value='$add_product_products_id'","value='$add_product_products_id' selected", $ProductOptions);
+      print $ProductOptions;
+      print "</select></td>\n";
+      print "<td class='dataTableContent' align='center'><input type='submit' value='" . TEXT_SELECT_PROD . "'>";
+      print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
+      print "<input type='hidden' name='step' value='3'>";
+      print "</td>\n";
+      print "</form></tr>\n";
+
+      print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
+    }
+
+    // Step 3: Choose Options
+    echo TEXT_ADD_PROD . $add_product_products_id;
+    if(($step > 2) && ($add_product_products_id > 0))
+    {
+      // Get Options for Products
+$result = tep_db_query("SELECT * FROM
+" . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+" . TABLE_PRODUCTS_OPTIONS . " po,
+" . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
+WHERE
+pa.options_id = po.products_options_id and
+pa.options_values_id =pov.products_options_values_id and
+pa.products_id ='$add_product_products_id'
+order by pa.products_options_sort_order");
+
+
+      // Skip to Step 4 if no Options
+      if(tep_db_num_rows($result) == 0)
+      {
+        echo "<tr class=\"dataTableRow\">\n";
+        echo "<td class='dataTableContent' align='right'><b>" . TEXT_ADD_STEP3  . "</b></td><td class='dataTableContent' valign='top' colspan='2'><i>" . TEXT_SELECT_OPT_SKIP . "</i></td>";
+        echo "</tr>\n";
+        $step = 4;
+      }
+      else
+      {
+        while($row = tep_db_fetch_array($result))
+        {
+          extract($row,EXTR_PREFIX_ALL,"db");
+          $Options[$db_products_options_id] = $db_products_options_name;
+          $ProductOptionValues[$db_products_options_id][$db_products_options_values_id] = $db_products_options_values_name;
+        }
+                                 echo '<tr class=\"dataTableRow\">' . tep_draw_form('select_product', FILENAME_C_ORDERS, 'oID='.$oID . '&action=add_product', 'post', '', 'SSL') . "\n";
+
+        //echo "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
+        print "<td class='dataTableContent' align='right'><b>" . TEXT_ADD_STEP3 . "</b></td><td class='dataTableContent' valign='top'>";
+        foreach($ProductOptionValues as $OptionID => $OptionValues)
+        {
+          $OptionOption = "<b>" . $Options[$OptionID] . "</b> - <select name='add_product_options[$OptionID]'>";
+          foreach($OptionValues as $OptionValueID => $OptionValueName)
+          {
+          
+      //get price 
+      $price_query = tep_db_query("SELECT * FROM
+      " . TABLE_PRODUCTS_ATTRIBUTES . " pa
+      WHERE
+      pa.products_attributes_id = '" . $row['products_attributes_id'] . "' and
+      pa.options_values_id = $OptionValueID
+      ");
+        while($price_array = tep_db_fetch_array($price_query))
+        {
+
+        $option_price = $price_array['options_values_price'];
+        $option_price1 = ' ' . $price_array['price_prefix'] . ' ' . $currencies->format($option_price);
+                                }
+          $OptionOption .= "<option value='$OptionValueID'> $OptionValueName $option_price1 \n";
+          }
+          $OptionOption .= "</select><br>\n";
+
+          if(IsSet($add_product_options))
+          $OptionOption = str_replace("value='" . $add_product_options[$OptionID] . "'","value='" . $add_product_options[$OptionID] . "' selected",$OptionOption);
+
+          echo $OptionOption;
+        }
+        echo "</td>";
+        print "<td class='dataTableContent' align='center'><input type='submit' value='Select These Options'>";
+        print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
+        print "<input type='hidden' name='add_product_products_id' value='$add_product_products_id'>";
+        print "<input type='hidden' name='step' value='4'>";
+        print "</td>\n";
+        print "</form></tr>\n";
+      }
+
+      print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
+    }
+
+    // Step 4: Confirm
+    if($step > 3)
+    {
+    
+         echo '<tr class=\"dataTableRow\">' . tep_draw_form('select_product', FILENAME_C_ORDERS, 'oID='.$oID . '&action=add_product', 'post', '', 'SSL') . "\n";
+                      //  echo "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
+      print "<td class='dataTableContent' align='right'><b>" . TEXT_ADD_STEP4 . "</b></td>";
+      print "<td class='dataTableContent' valign='top'><input name='add_product_quantity' size='2' value='1'>" . TEXT_ADD_QUANTITY . "</td>";
+      print "<td class='dataTableContent' align='center'><input type='submit' value='" . TEXT_ADD_NOW . "'>";
+
+      if(IsSet($add_product_options))
+      {
+        foreach($add_product_options as $option_id => $option_value_id)
+        {
+          echo "<input type='hidden' name='add_product_options[$option_id]' value='$option_value_id'>";
+        }
+      }
+      print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
+      print "<input type='hidden' name='add_product_products_id' value='$add_product_products_id'>";
+      print "<input type='hidden' name='step' value='5'>";
+      print "</td>\n";
+      print "</form></tr>\n";
+    }
+
+    echo "</table></td></tr>\n";
+}
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php
+require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/admin/cache.php
===================================================================
--- trunk/direct.openmoko.com/admin/cache.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/cache.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,155 @@
+<?php
+/*
+  $Id: cache.php,v 1.1.1.1 2004/03/04 23:38:12 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/   
+
+  require('includes/application_top.php');
+ $dir_cache = DIR_FS_CATALOG . DIR_FS_CACHE ;
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    if ($action == 'reset') {
+      tep_reset_cache_block($HTTP_GET_VARS['block']);
+    }
+
+    tep_redirect(tep_href_link(FILENAME_CACHE));
+  }
+
+// check if the cache directory exists
+  if (is_dir($dir_cache)) {
+    if (!is_writeable($dir_cache)) $messageStack->add('search', ERROR_CACHE_DIRECTORY_NOT_WRITEABLE, 'error');
+  } else {
+    $messageStack->add('search', ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST, 'error');
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CACHE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_CREATED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  if ($messageStack->size < 1) {
+    $languages = tep_get_languages();
+    
+   // get default template
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+    
+   $template_query = tep_db_query("select tp.template_name from " . TABLE_TEMPLATE . " tp order by tp.template_name");
+      while ($template = tep_db_fetch_array($template_query)) {
+        $template_array[]=array(template=>$template['template_name']);
+        }
+  
+ 
+    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+      if ($languages[$i]['code'] == DEFAULT_LANGUAGE) {
+        $language = $languages[$i]['directory'];
+      }
+    }
+
+    for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) {
+      $cached_file = ereg_replace('.language', '.' . $language, $cache_blocks[$i]['file']);
+
+                              for ($j=0, $k=sizeof($template_array); $j<$k; $j++) {
+                             // echo $template_array[$j]['template'] . 'name';
+                    $cached_file_unlink = ereg_replace('-TEMPLATE_NAME', '-' . $template_array[$j]['template'] , $cached_file);
+//echo $cached_file_unlink . '<br>';
+      if (file_exists($dir_cache . $cached_file_unlink)) {
+        $cache_mtime = strftime(DATE_TIME_FORMAT, filemtime($dir_cache . $cached_file_unlink));
+      } else {
+        $cache_mtime = TEXT_FILE_DOES_NOT_EXIST;
+        $dir = dir($dir_cache);
+    
+ //echo $template_array['template_name'] . $cached_file . '  <br>';
+ 
+        while ($cached_file_unlink = $dir->read()) {
+         // $cached_file = ereg_replace('.language', '.' . $language, $cache_blocks[$i]['file']);
+
+          if (ereg('^' . $cached_file, $cache_file)) {
+            $cache_mtime = strftime(DATE_TIME_FORMAT, filemtime($dir_cache . $cached_file_unlink));
+            break;
+          }
+        }
+ }
+// echo $cached_file . '<br>';
+        $dir->close();
+      }
+?>
+              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
+                <td class="dataTableContent"><?php echo $cache_blocks[$i]['title']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $cache_mtime; ?></td>
+                <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CACHE, 'action=reset&block=' . $cache_blocks[$i]['code'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_reset.gif', 'Reset', 13, 13) . '</a>'; ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+  }
+?>
+              <tr>
+                <td class="smallText" colspan="3"><?php echo TEXT_CACHE_DIRECTORY . ' ' . $dir_cache; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,2751 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/29 00:18:17 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+//Added for Categories Description 1.5
+  require('includes/functions/categories_description.php');
+//End Categories Description 1.5
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'setflag':
+        if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
+          if (isset($HTTP_GET_VARS['pID'])) {
+            tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']);
+          }
+
+          if (USE_CACHE == 'true') {
+            tep_reset_cache_block('categories');
+            tep_reset_cache_block('also_purchased');
+          }
+        }
+
+        tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID']));
+        break;
+
+//Added for Categories Description 1.5
+      case 'new_category':
+      case 'edit_category':
+        if (ALLOW_CATEGORY_DESCRIPTIONS == 'true')
+          $HTTP_GET_VARS['action']=$HTTP_GET_VARS['action'] . '_ACD';
+        break;
+//End Categories Description 1.5
+
+      case 'insert_category':
+      case 'update_category':
+
+//Added for Categories Description 1.5
+ if ( ($HTTP_POST_VARS['edit_x']) || ($HTTP_POST_VARS['edit_y']) ) {
+          $HTTP_GET_VARS['action'] = 'edit_category_ACD';
+        } else {
+//End Categories Description 1.5
+
+        if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
+
+//Added for Categories Description 1.5
+        if ($categories_id == '') {
+           $categories_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+         }
+//End Categories Description 1.5
+
+        $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);
+
+        $sql_data_array = array('sort_order' => $sort_order);
+
+        if ($action == 'insert_category') {
+          $insert_sql_data = array('parent_id' => $current_category_id,
+                                   'date_added' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+          tep_db_perform(TABLE_CATEGORIES, $sql_data_array);
+
+          $categories_id = tep_db_insert_id();
+        } elseif ($action == 'update_category') {
+          $update_sql_data = array('last_modified' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+          tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "'");
+        }
+
+        $languages = tep_get_languages();
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $categories_name_array = $HTTP_POST_VARS['categories_name'];
+          //HTC BOC
+          $categories_htc_title_array = $HTTP_POST_VARS['categories_head_title_tag'];
+          $categories_htc_desc_array = $HTTP_POST_VARS['categories_head_desc_tag'];
+          $categories_htc_keywords_array = $HTTP_POST_VARS['categories_head_keywords_tag '];
+          $categories_htc_description_array = $HTTP_POST_VARS['categories_htc_description'];
+          //HTC EOC
+
+          $language_id = $languages[$i]['id'];
+
+          $sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]));
+
+//Added for Categories Description 1.5
+            if (ALLOW_CATEGORY_DESCRIPTIONS == 'true') {
+              $sql_data_array = array('categories_name' => tep_db_prepare_input($HTTP_POST_VARS['categories_name'][$language_id]),
+                                      'categories_heading_title' => tep_db_prepare_input($HTTP_POST_VARS['categories_heading_title'][$language_id]),
+                                      'categories_description' => tep_db_prepare_input($HTTP_POST_VARS['categories_description'][$language_id]),
+                                      'categories_head_title_tag' => tep_db_prepare_input($HTTP_POST_VARS['categories_head_title_tag'][$language_id]),
+                                      'categories_head_desc_tag' => tep_db_prepare_input($HTTP_POST_VARS['categories_head_desc_tag'][$language_id]),
+                                      'categories_head_keywords_tag' => tep_db_prepare_input($HTTP_POST_VARS['categories_head_keywords_tag'][$language_id]));
+        }
+//End Categories Description 1.5
+
+          if ($action == 'insert_category') {
+            $insert_sql_data = array('categories_id' => $categories_id,
+                                     'language_id' => $languages[$i]['id']);
+
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);
+          } elseif ($action == 'update_category') {
+            tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
+          }
+        }
+
+
+//Code commented out for Categories Description 1.5
+//        if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {
+//          tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . //tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");
+//        }
+//Added the following to replacce above code
+          if (ALLOW_CATEGORY_DESCRIPTIONS == 'true') {
+            tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $HTTP_POST_VARS['categories_image'] . "' where categories_id = '" .  tep_db_input($categories_id) . "'");
+            $categories_image = '';
+      } else {
+        if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {
+          tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");
+        }
+       }
+//End Categories Description 1.5
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('categories');
+          tep_reset_cache_block('also_purchased');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
+
+//Added for Categories Description 1.5
+        }
+//End Categories Description 1.5
+
+        break;
+      case 'delete_category_confirm':
+        if (isset($HTTP_POST_VARS['categories_id'])) {
+          $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
+
+          $categories = tep_get_category_tree($categories_id, '', '0', '', true);
+          $products = array();
+          $products_delete = array();
+
+          for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
+            $product_ids_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$categories[$i]['id'] . "'");
+
+            while ($product_ids = tep_db_fetch_array($product_ids_query)) {
+              $products[$product_ids['products_id']]['categories'][] = $categories[$i]['id'];
+            }
+          }
+
+          reset($products);
+          while (list($key, $value) = each($products)) {
+            $category_ids = '';
+
+            for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) {
+              $category_ids .= "'" . (int)$value['categories'][$i] . "', ";
+            }
+            $category_ids = substr($category_ids, 0, -2);
+
+            $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$key . "' and categories_id not in (" . $category_ids . ")");
+            $check = tep_db_fetch_array($check_query);
+            if ($check['total'] < '1') {
+              $products_delete[$key] = $key;
+            }
+          }
+
+// removing categories can be a lengthy process
+          tep_set_time_limit(0);
+          for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
+            tep_remove_category($categories[$i]['id']);
+          }
+
+          reset($products_delete);
+          while (list($key) = each($products_delete)) {
+            tep_remove_product($key);
+          }
+        }
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('categories');
+          tep_reset_cache_block('also_purchased');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
+        break;
+      case 'delete_product_confirm':
+        if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['product_categories']) && is_array($HTTP_POST_VARS['product_categories'])) {
+          $product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+          $product_categories = $HTTP_POST_VARS['product_categories'];
+
+          for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {
+            tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "' and categories_id = '" . (int)$product_categories[$i] . "'");
+          }
+
+// Eversun mod for sppc and qty price breaks
+        //  tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . tep_db_input($product_id) . "' ");
+// Eversun mod for sppc and qty price breaks
+
+          $product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'");
+          $product_categories = tep_db_fetch_array($product_categories_query);
+
+          if ($product_categories['total'] == '0') {
+            tep_remove_product($product_id);
+          }
+        }
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('categories');
+          tep_reset_cache_block('also_purchased');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
+        break;
+      case 'move_category_confirm':
+        if (isset($HTTP_POST_VARS['categories_id']) && ($HTTP_POST_VARS['categories_id'] != $HTTP_POST_VARS['move_to_category_id'])) {
+          $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
+          $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);
+
+          $path = explode('_', tep_get_generated_category_path_ids($new_parent_id));
+
+          if (in_array($categories_id, $path)) {
+            $messageStack->add_session(ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error');
+
+            tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
+          } else {
+            tep_db_query("update " . TABLE_CATEGORIES . " set parent_id = '" . (int)$new_parent_id . "', last_modified = now() where categories_id = '" . (int)$categories_id . "'");
+
+            if (USE_CACHE == 'true') {
+              tep_reset_cache_block('categories');
+              tep_reset_cache_block('also_purchased');
+            }
+
+            tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&cID=' . $categories_id));
+          }
+        }
+
+        break;
+      case 'move_product_confirm':
+        $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+        $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);
+
+        $duplicate_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$new_parent_id . "'");
+        $duplicate_check = tep_db_fetch_array($duplicate_check_query);
+        if ($duplicate_check['total'] < 1) tep_db_query("update " . TABLE_PRODUCTS_TO_CATEGORIES . " set categories_id = '" . (int)$new_parent_id . "' where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$current_category_id . "'");
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('categories');
+          tep_reset_cache_block('also_purchased');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&pID=' . $products_id));
+        break;
+///////////////////////////////////////////////////////////////////////////////////////
+// BOF: WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
+      case 'create_copy_product_attributes':
+  // $products_id_to= $copy_to_products_id;
+  // $products_id_from = $pID;
+        tep_copy_products_attributes($pID,$copy_to_products_id);
+        break;
+// EOF: WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+// WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in a Category
+      case 'create_copy_product_attributes_categories':
+  // $products_id_to= $categories_products_copying['products_id'];
+  // $products_id_from = $make_copy_from_products_id;
+  //  echo 'Copy from products_id# ' . $make_copy_from_products_id . ' Copy to all products in category: ' . $cID . '<br>';
+        $categories_products_copying_query= tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $cID . "'");
+        while ( $categories_products_copying=tep_db_fetch_array($categories_products_copying_query) ) {
+          // process all products in category
+          tep_copy_products_attributes($make_copy_from_products_id,$categories_products_copying['products_id']);
+        }
+        break;
+// EOF: WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in a Category
+///////////////////////////////////////////////////////////////////////////////////////
+      case 'insert_product':
+      case 'update_product':
+        if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {
+          $action = 'new_product';
+        } else {
+
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+            if ($HTTP_POST_VARS['delete_image'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image']);
+            }
+            if ($HTTP_POST_VARS['delete_image_med'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_med']);
+            }
+            if ($HTTP_POST_VARS['delete_image_lrg'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_lrg']);
+            }
+            if ($HTTP_POST_VARS['delete_image_sm_1'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_1']);
+            }
+            if ($HTTP_POST_VARS['delete_image_xl_1'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_1']);
+            }
+            if ($HTTP_POST_VARS['delete_image_sm_2'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_2']);
+            }
+            if ($HTTP_POST_VARS['delete_image_xl_2'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_2']);
+            }
+            if ($HTTP_POST_VARS['delete_image_sm_3'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_3']);
+            }
+            if ($HTTP_POST_VARS['delete_image_xl_3'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_3']);
+            }
+            if ($HTTP_POST_VARS['delete_image_sm_4'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_4']);
+            }
+            if ($HTTP_POST_VARS['delete_image_xl_4'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_4']);
+            }
+            if ($HTTP_POST_VARS['delete_image_sm_5'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_5']);
+            }
+            if ($HTTP_POST_VARS['delete_image_xl_5'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_5']);
+            }
+            if ($HTTP_POST_VARS['delete_image_sm_6'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_6']);
+            }
+            if ($HTTP_POST_VARS['delete_image_xl_6'] == 'yes') {
+                unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_6']);
+            }
+// EOF MaxiDVD: Modified For Ultimate Images Pack!
+          if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);
+          $products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']);
+
+          $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';
+          $sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),
+                                  'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),
+                                  'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),
+                                  'products_date_available' => $products_date_available,
+                                  'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),
+                                  'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),
+                                  'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),
+                                  'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));
+
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+       if (($HTTP_POST_VARS['unlink_image'] == 'yes') or ($HTTP_POST_VARS['delete_image'] == 'yes')) {
+            $sql_data_array['products_image'] = '';
+           } else {
+         if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
+            $sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_med'] == 'yes') or ($HTTP_POST_VARS['delete_image_med'] == 'yes')) {
+            $sql_data_array['products_image_med'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_med']) && tep_not_null($HTTP_POST_VARS['products_image_med']) && ($HTTP_POST_VARS['products_image_med'] != 'none')) {
+            $sql_data_array['products_image_med'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_med']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_lrg'] == 'yes') or ($HTTP_POST_VARS['delete_image_lrg'] == 'yes')) {
+            $sql_data_array['products_image_lrg'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_lrg']) && tep_not_null($HTTP_POST_VARS['products_image_lrg']) && ($HTTP_POST_VARS['products_image_lrg'] != 'none')) {
+            $sql_data_array['products_image_lrg'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_lrg']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_sm_1'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_1'] == 'yes')) {
+            $sql_data_array['products_image_sm_1'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_sm_1']) && tep_not_null($HTTP_POST_VARS['products_image_sm_1']) && ($HTTP_POST_VARS['products_image_sm_1'] != 'none')) {
+            $sql_data_array['products_image_sm_1'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_1']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_xl_1'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_1'] == 'yes')) {
+            $sql_data_array['products_image_xl_1'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_xl_1']) && tep_not_null($HTTP_POST_VARS['products_image_xl_1']) && ($HTTP_POST_VARS['products_image_xl_1'] != 'none')) {
+            $sql_data_array['products_image_xl_1'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_1']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_sm_2'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_2'] == 'yes')) {
+            $sql_data_array['products_image_sm_2'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_sm_2']) && tep_not_null($HTTP_POST_VARS['products_image_sm_2']) && ($HTTP_POST_VARS['products_image_sm_2'] != 'none')) {
+            $sql_data_array['products_image_sm_2'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_2']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_xl_2'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_2'] == 'yes')) {
+            $sql_data_array['products_image_xl_2'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_xl_2']) && tep_not_null($HTTP_POST_VARS['products_image_xl_2']) && ($HTTP_POST_VARS['products_image_xl_2'] != 'none')) {
+            $sql_data_array['products_image_xl_2'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_2']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_sm_3'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_3'] == 'yes')) {
+            $sql_data_array['products_image_sm_3'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_sm_3']) && tep_not_null($HTTP_POST_VARS['products_image_sm_3']) && ($HTTP_POST_VARS['products_image_sm_3'] != 'none')) {
+            $sql_data_array['products_image_sm_3'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_3']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_xl_3'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_3'] == 'yes')) {
+            $sql_data_array['products_image_xl_3'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_xl_3']) && tep_not_null($HTTP_POST_VARS['products_image_xl_3']) && ($HTTP_POST_VARS['products_image_xl_3'] != 'none')) {
+            $sql_data_array['products_image_xl_3'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_3']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_sm_4'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_4'] == 'yes')) {
+            $sql_data_array['products_image_sm_4'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_sm_4']) && tep_not_null($HTTP_POST_VARS['products_image_sm_4']) && ($HTTP_POST_VARS['products_image_sm_4'] != 'none')) {
+            $sql_data_array['products_image_sm_4'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_4']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_xl_4'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_4'] == 'yes')) {
+            $sql_data_array['products_image_xl_4'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_xl_4']) && tep_not_null($HTTP_POST_VARS['products_image_xl_4']) && ($HTTP_POST_VARS['products_image_xl_4'] != 'none')) {
+            $sql_data_array['products_image_xl_4'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_4']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_sm_5'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_5'] == 'yes')) {
+            $sql_data_array['products_image_sm_5'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_sm_5']) && tep_not_null($HTTP_POST_VARS['products_image_sm_5']) && ($HTTP_POST_VARS['products_image_sm_5'] != 'none')) {
+            $sql_data_array['products_image_sm_5'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_5']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_xl_5'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_5'] == 'yes')) {
+            $sql_data_array['products_image_xl_5'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_xl_5']) && tep_not_null($HTTP_POST_VARS['products_image_xl_5']) && ($HTTP_POST_VARS['products_image_xl_5'] != 'none')) {
+            $sql_data_array['products_image_xl_5'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_5']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_sm_6'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_6'] == 'yes')) {
+            $sql_data_array['products_image_sm_6'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_sm_6']) && tep_not_null($HTTP_POST_VARS['products_image_sm_6']) && ($HTTP_POST_VARS['products_image_sm_6'] != 'none')) {
+            $sql_data_array['products_image_sm_6'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_6']);
+          }
+          }
+       if (($HTTP_POST_VARS['unlink_image_xl_6'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_6'] == 'yes')) {
+            $sql_data_array['products_image_xl_6'] = '';
+           } else {
+          if (isset($HTTP_POST_VARS['products_image_xl_6']) && tep_not_null($HTTP_POST_VARS['products_image_xl_6']) && ($HTTP_POST_VARS['products_image_xl_6'] != 'none')) {
+            $sql_data_array['products_image_xl_6'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_6']);
+          }
+          }
+// EOF MaxiDVD: Modified For Ultimate Images Pack!
+
+          if ($action == 'insert_product') {
+            $insert_sql_data = array('products_date_added' => 'now()');
+
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_PRODUCTS, $sql_data_array);
+            $products_id = tep_db_insert_id();
+
+            tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')");
+          } elseif ($action == 'update_product') {
+            $update_sql_data = array('products_last_modified' => 'now()');
+
+            $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+            tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");
+          }
+
+// Eversun mod for sppc and qty price breaks
+          $customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
+          while ($customers_group = tep_db_fetch_array($customers_group_query)) {
+            $attributes_query = tep_db_query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where ((products_id = '" . $products_id . "') && (customers_group_id = " . $customers_group['customers_group_id'] . ")) order by customers_group_id");
+            $attributes = tep_db_fetch_array($attributes_query);
+            $customers_group_price = $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']];
+            if ($customers_group_price == 0) {
+              $customers_group_price = $HTTP_POST_VARS['products_price'];
+            }
+            $customers_group_price1 = $HTTP_POST_VARS['sppcprice1'][$customers_group['customers_group_id']];
+            if ($customers_group_price1 == 0) {
+              $customers_group_price1 = $customers_group_price;
+            }
+            $customers_group_price2 = $HTTP_POST_VARS['sppcprice2'][$customers_group['customers_group_id']];
+            if ($customers_group_price2 == 0) {
+              $customers_group_price2 = $customers_group_price1;
+            }
+            $customers_group_price3 = $HTTP_POST_VARS['sppcprice3'][$customers_group['customers_group_id']];
+            if ($customers_group_price3 == 0) {
+              $customers_group_price3 = $customers_group_price2;
+            }
+            $customers_group_price4 = $HTTP_POST_VARS['sppcprice4'][$customers_group['customers_group_id']];
+            if ($customers_group_price4 == 0) {
+              $customers_group_price4 = $customers_group_price3;
+            }
+            $customers_group_price5 = $HTTP_POST_VARS['sppcprice5'][$customers_group['customers_group_id']];
+            if ($customers_group_price5 == 0) {
+              $customers_group_price5 = $customers_group_price4;
+            }
+            $customers_group_price6 = $HTTP_POST_VARS['sppcprice6'][$customers_group['customers_group_id']];
+            if ($customers_group_price6 == 0) {
+              $customers_group_price6 = $customers_group_price5;
+            }
+            $customers_group_price7 = $HTTP_POST_VARS['sppcprice7'][$customers_group['customers_group_id']];
+            if ($customers_group_price7 == 0) {
+              $customers_group_price7 = $customers_group_price6;
+            }
+            $customers_group_price8 = $HTTP_POST_VARS['sppcprice8'][$customers_group['customers_group_id']];
+            if ($customers_group_price8 == 0) {
+              $customers_group_price8 = $customers_group_price7;
+            }
+            $customers_group_price9 = $HTTP_POST_VARS['sppcprice9'][$customers_group['customers_group_id']];
+            if ($customers_group_price9 == 0) {
+              $customers_group_price9 = $customers_group_price8;
+            }
+            $customers_group_price10 = $HTTP_POST_VARS['sppcprice10'][$customers_group['customers_group_id']];
+            if ($customers_group_price10 == 0) {
+              $customers_group_price10 = $customers_group_price9;
+            }
+            $customers_group_price11 = $HTTP_POST_VARS['sppcprice11'][$customers_group['customers_group_id']];
+            if ($customers_group_price11 == 0) {
+              $customers_group_price11 = $customers_group_price10;
+            }
+            if (tep_db_num_rows($attributes_query) > 0) {
+              if ($HTTP_POST_VARS['sppcoption'][$customers_group['customers_group_id']]) { // this is checking if the check box is checked
+                if ($attributes['customers_group_id'] == $customers_group['customers_group_id']) {
+          //      tep_db_query("update " . TABLE_PRODUCTS_GROUPS . " set customers_group_price = '" . $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] . "' where customers_group_id = '" . $attributes['customers_group_id'] . "' and products_id = '" . $products_id . "'");
+                  $sql_data_array = array('customers_group_price' => $customers_group_price,
+                                        'customers_group_price1' => $customers_group_price1,
+                          'customers_group_price2' => $customers_group_price2,
+                          'customers_group_price3' => $customers_group_price3,
+                          'customers_group_price4' => $customers_group_price4,
+                          'customers_group_price5' => $customers_group_price5,
+                          'customers_group_price6' => $customers_group_price6,
+                          'customers_group_price7' => $customers_group_price7,
+                          'customers_group_price8' => $customers_group_price8,
+                          'customers_group_price9' => $customers_group_price9,
+                          'customers_group_price10' => $customers_group_price10,
+                          'customers_group_price11' => $customers_group_price11);
+                  tep_db_perform(TABLE_PRODUCTS_GROUPS, $sql_data_array, 'update', "customers_group_id = '" . $attributes['customers_group_id'] . "' and products_id = '" . $products_id . "'");
+                  $attributes = tep_db_fetch_array($attributes_query);
+                }      
+              }
+              else {
+                tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
+                $attributes = tep_db_fetch_array($attributes_query);
+              }
+            } elseif ($HTTP_POST_VARS['sppcoption'][$customers_group['customers_group_id']]) {
+          //    tep_db_query("insert into " . TABLE_PRODUCTS_GROUPS . " (products_id, customers_group_id, customers_group_price) values ('" . $products_id . "', '" . $customers_group['customers_group_id'] . "', '" . $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] . "')");
+              $sql_data_array = array('products_id' => $products_id,
+                        'customers_group_id' => $customers_group['customers_group_id'],
+                        'customers_group_price' => $customers_group_price,
+                                    'customers_group_price1' => $customers_group_price1,
+                        'customers_group_price2' => $customers_group_price2,
+                        'customers_group_price3' => $customers_group_price3,
+                        'customers_group_price4' => $customers_group_price4,
+                        'customers_group_price5' => $customers_group_price5,
+                        'customers_group_price6' => $customers_group_price6,
+                        'customers_group_price7' => $customers_group_price7,
+                        'customers_group_price8' => $customers_group_price8,
+                        'customers_group_price9' => $customers_group_price9,
+                        'customers_group_price10' => $customers_group_price10,
+                        'customers_group_price11' => $customers_group_price11);
+              tep_db_perform(TABLE_PRODUCTS_GROUPS, $sql_data_array);
+              $attributes = tep_db_fetch_array($attributes_query);
+            }
+          }
+// Eversun mod end for sppc and qty price breaks
+
+          $languages = tep_get_languages();
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+            $language_id = $languages[$i]['id'];
+
+            $sql_data_array = array('products_name' => tep_db_encoder(tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id])),
+                                    'products_description' => tep_db_encoder(tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id])),
+                                    'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]),
+                        'products_head_title_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_title_tag'][$language_id]),
+         'products_head_desc_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_desc_tag'][$language_id]),
+         'products_head_keywords_tag' => tep_db_prepare_input($HTTP_POST_VARS['products_head_keywords_tag'][$language_id]));
+
+            if ($action == 'insert_product') {
+              $insert_sql_data = array('products_id' => $products_id,
+                                       'language_id' => $language_id);
+
+              $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+              tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
+            } elseif ($action == 'update_product') {
+              tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
+            }
+          }
+// START: Extra Fields Contribution  DMG
+          $extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id = " . (int)$products_id);
+          while ($products_extra_fields = tep_db_fetch_array($extra_fields_query)) {
+            $extra_product_entry[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
+          }
+
+          if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
+            foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
+              if (isset($extra_product_entry[$key])) { // an entry exists
+                if ($val == '') tep_db_query("DELETE FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = " . (int)$products_id . " AND  products_extra_fields_id = " . $key);
+                else tep_db_query("UPDATE " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " SET products_extra_fields_value = '" . tep_db_input($val) . "' WHERE products_id = " . (int)$products_id . " AND  products_extra_fields_id = " . $key);
+              }
+              else { // an entry does not exist
+                if ($val != '') tep_db_query("INSERT INTO " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_input($val) . "')");
+              }
+            }
+          } // Check to see if there are any need to update extra fields.
+// END: Extra Fields Contribution  DMG
+
+    /////////////////////////////////////////////////////////////////
+// BOF: WebMakers.com Added: Update Product Attributes and Sort Order
+// Update the changes to the attributes if any changes were made
+          // Update Product Attributes
+          $rows = 0;
+          $options_query = tep_db_query("select po.products_options_id, pot.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_OPTIONS_TEXT . " pot where pot.language_id = '" . $languages_id . "' and po.products_options_id = pot.products_options_text_id order by po.products_options_sort_order, pot.products_options_name");
+          while ($options = tep_db_fetch_array($options_query)) {
+            $values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "' order by pov.products_options_values_name");
+            while ($values = tep_db_fetch_array($values_query)) {
+              $rows ++;
+// original              $attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_id . "' and options_id = '" . $options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'");
+              $attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix, products_options_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_id . "' and options_id = '" . $options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'");
+              if (tep_db_num_rows($attributes_query) > 0) {
+                $attributes = tep_db_fetch_array($attributes_query);
+                if ($HTTP_POST_VARS['option'][$rows]) {
+                  if ( ($HTTP_POST_VARS['prefix'][$rows] <> $attributes['price_prefix']) || ($HTTP_POST_VARS['price'][$rows] <> $attributes['options_values_price']) || ($HTTP_POST_VARS['products_options_sort_order'][$rows] <> $attributes['products_options_sort_order']) ) {
+                    tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_values_price = '" . $HTTP_POST_VARS['price'][$rows] . "', price_prefix = '" . $HTTP_POST_VARS['prefix'][$rows] . "', products_options_sort_order = '" . $HTTP_POST_VARS['products_options_sort_order'][$rows] . "'  where products_attributes_id = '" . $attributes['products_attributes_id'] . "'");
+                  }
+                } else {
+                  tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id = '" . $attributes['products_attributes_id'] . "'");
+                }
+              } elseif ($HTTP_POST_VARS['option'][$rows]) {
+                tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "', '" . $HTTP_POST_VARS['products_options_sort_order'][$rows] . "')");
+              }
+            }
+          }
+// EOF: WebMakers.com Added: Update Product Attributes and Sort Order
+/////////////////////////////////////////////////////////////////////
+
+
+          if (USE_CACHE == 'true') {
+            tep_reset_cache_block('categories');
+            tep_reset_cache_block('also_purchased');
+          }
+
+          tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));
+        }
+        break;
+      case 'copy_to_confirm':
+        if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['categories_id'])) {
+          $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+          $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
+
+          if ($HTTP_POST_VARS['copy_as'] == 'link') {
+            if ($categories_id != $current_category_id) {
+              $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$categories_id . "'");
+              $check = tep_db_fetch_array($check_query);
+              if ($check['total'] < '1') {
+                tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$categories_id . "')");
+              }
+            } else {
+              $messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');
+            }
+          } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+
+// Eversun mod for sppc and qty price breaks
+//            $product_query = tep_db_query("select products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
+            $product_query = tep_db_query("select products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_price1, products_price2, products_price3, products_price4, products_price5, products_price6, products_price7, products_price8, products_price9, products_price10, products_price11, products_price1_qty, products_price2_qty, products_price3_qty, products_price4_qty, products_price5_qty, products_price6_qty, products_price7_qty, products_price8_qty, products_price9_qty, products_price10_qty, products_price11_qty, products_qty_blocks, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
+// Eversun mod end for sppc and qty price breaks
+            $product = tep_db_fetch_array($product_query);
+
+// Eversun mod for sppc and qty price breaks            
+//            tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_image_med']) . "', '" . tep_db_input($product['products_image_lrg']) . "', '" . tep_db_input($product['products_image_sm_1']) . "', '" . tep_db_input($product['products_image_xl_1']) . "', '" . tep_db_input($product['products_image_sm_2']) . "', '" . tep_db_input($product['products_image_xl_2']) . "', '" . tep_db_input($product['products_image_sm_3']) . "', '" . tep_db_input($product['products_image_xl_3']) . "', '" . tep_db_input($product['products_image_sm_4']) . "', '" . tep_db_input($product['products_image_xl_4']) . "', '" . tep_db_input($product['products_image_sm_5']) . "', '" . tep_db_input($product['products_image_xl_5']) . "', '" . tep_db_input($product['products_image_sm_6']) . "', '" . tep_db_input($product['products_image_xl_6']) . "', '" . tep_db_input($product['products_price']) . "',  now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
+            tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_price, products_price1, products_price2, products_price3, products_price4, products_price5, products_price6, products_price7, products_price8, products_price9, products_price10, products_price11, products_price1_qty, products_price2_qty, products_price3_qty, products_price4_qty, products_price5_qty, products_price6_qty, products_price7_qty, products_price8_qty, products_price9_qty, products_price10_qty, products_price11_qty, products_qty_blocks, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values 
+('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_image_med']) . "', '" . tep_db_input($product['products_image_lrg']) . "', '" . tep_db_input($product['products_image_sm_1']) . "', '" . tep_db_input($product['products_image_xl_1']) . "', '" . tep_db_input($product['products_image_sm_2']) . "', '" . tep_db_input($product['products_image_xl_2']) . "', '" . tep_db_input($product['products_image_sm_3']) . "', '" . tep_db_input($product['products_image_xl_3']) . "', '" . tep_db_input($product['products_image_sm_4']) . "', '" . tep_db_input($product['products_image_xl_4']) . "', '" . tep_db_input($product['products_image_sm_5']) . "', '" . tep_db_input($product['products_image_xl_5']) . "', '" . tep_db_input($product['products_image_sm_6']) . "', '" . tep_db_input($product['products_image_xl_6']) . "', '" . tep_db_input($product['products_price']) . "', 
+'" . tep_db_input($product['products_price1']) . "', '" . tep_db_input($product['products_price2']) . "', '" . tep_db_input($product['products_price3']) . "', '" . tep_db_input($product['products_price4']) . "', '" . tep_db_input($product['products_price5']) . "', '" . tep_db_input($product['products_price6']) . "', '" . tep_db_input($product['products_price7']) . "', '" . tep_db_input($product['products_price8']) . "', '" . tep_db_input($product['products_price9']) . "', '" . tep_db_input($product['products_price10']) . "', '" . tep_db_input($product['products_price11']) . "', '" . tep_db_input($product['products_price1_qty']) . "', '" . tep_db_input($product['products_price2_qty']) . "', '" . tep_db_input($product['products_price3_qty']) . "', '" . tep_db_input($product['products_price4_qty']) . "', '" . tep_db_input($product['products_price5_qty']) . "', '" . tep_db_input($product['products_price6_qty']) . "', '" . tep_db_input($product['products_price7_qty']) . "', '" . tep_db_input($product['products_price8_qty']) . "', '" . tep_db_input($product['products_price9_qty']) . "', '" . tep_db_input($product['products_price10_qty']) . "', '" . tep_db_input($product['products_price11_qty']) . "', '" . tep_db_input($product['products_qty_blocks']) . "',
+now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
+
+
+// Eversun mod end for sppc and qty price breaks
+
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+            $dup_products_id = tep_db_insert_id();
+
+            $description_query = tep_db_query("select language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");
+            while ($description = tep_db_fetch_array($description_query)) {
+              tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_head_title_tag']) . "', '" . tep_db_input($description['products_head_desc_tag']) . "', '" . tep_db_input($description['products_head_keywords_tag']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
+            }
+
+            tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
+// BOF: WebMakers.com Added: Attributes Copy on non-linked
+            $products_id_from=tep_db_input($products_id);
+            $products_id_to= $dup_products_id;
+            $products_id = $dup_products_id;
+if ( $HTTP_POST_VARS['copy_attributes']=='copy_attributes_yes' and $HTTP_POST_VARS['copy_as'] == 'duplicate' ) {
+// WebMakers.com Added: Copy attributes to duplicate product
+  // $products_id_to= $copy_to_products_id;
+  // $products_id_from = $pID;
+            $copy_attributes_delete_first='1';
+            $copy_attributes_duplicates_skipped='1';
+            $copy_attributes_duplicates_overwrite='0';
+
+            if (DOWNLOAD_ENABLED == 'true') {
+              $copy_attributes_include_downloads='1';
+              $copy_attributes_include_filename='1';
+            } else {
+              $copy_attributes_include_downloads='0';
+              $copy_attributes_include_filename='0';
+            }
+            tep_copy_products_attributes($products_id_from,$products_id_to);
+// EOF: WebMakers.com Added: Attributes Copy on non-linked
+}
+          }
+
+          if (USE_CACHE == 'true') {
+            tep_reset_cache_block('categories');
+            tep_reset_cache_block('also_purchased');
+          }
+        }
+
+        tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories_id . '&pID=' . $products_id));
+        break;
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+      case 'new_product_preview':
+// copy image only if modified
+   if (($HTTP_POST_VARS['unlink_image'] == 'yes') or ($HTTP_POST_VARS['delete_image'] == 'yes')) {
+        $products_image = '';
+        $products_image_name = '';
+//        } elseif ((HTML_AREA_WYSIWYG_DISABLE_JPSY == 'Disable') or (HTML_AREA_WYSIWYG_DISABLE == 'Disable')) {
+        } elseif ( true ) { // disable the Image Manager for now
+        $products_image = new upload('products_image');
+        $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image->parse() && $products_image->save()) {
+          $products_image_name = $products_image->filename;
+        } else {
+          $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
+        }
+        } else {
+          if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
+            $products_image_name = $HTTP_POST_VARS['products_image'];
+          } else {
+            $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
+          }
+        }
+   if (($HTTP_POST_VARS['unlink_image_med'] == 'yes') or ($HTTP_POST_VARS['delete_image_med'] == 'yes')) {
+        $products_image_med = '';
+        $products_image_med_name = '';
+//        } elseif ((HTML_AREA_WYSIWYG_DISABLE_JPSY == 'Disable') or (HTML_AREA_WYSIWYG_DISABLE == 'Disable')) {
+        } elseif ( true ) { // disable the Image Manager for now
+        $products_image_med = new upload('products_image_med');
+        $products_image_med->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_med->parse() && $products_image_med->save()) {
+          $products_image_med_name = $products_image_med->filename;
+        } else {
+          $products_image_med_name = (isset($HTTP_POST_VARS['products_previous_image_med']) ? $HTTP_POST_VARS['products_previous_image_med'] : '');
+        }
+        } else {
+          if (isset($HTTP_POST_VARS['products_image_med']) && tep_not_null($HTTP_POST_VARS['products_image_med']) && ($HTTP_POST_VARS['products_image_med'] != 'none')) {
+            $products_image_med_name = $HTTP_POST_VARS['products_image_med'];
+          } else {
+            $products_image_med_name = (isset($HTTP_POST_VARS['products_previous_image_med']) ? $HTTP_POST_VARS['products_previous_image_med'] : '');
+          }
+        }
+   if (($HTTP_POST_VARS['unlink_image_lrg'] == 'yes') or ($HTTP_POST_VARS['delete_image_lrg'] == 'yes')) {
+        $products_image_lrg = '';
+        $products_image_lrg_name = '';
+//        } elseif ((HTML_AREA_WYSIWYG_DISABLE_JPSY == 'Disable') or (HTML_AREA_WYSIWYG_DISABLE == 'Disable')) {
+        } elseif ( true ) { // disable the Image Manager for now
+        $products_image_lrg = new upload('products_image_lrg');
+        $products_image_lrg->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_lrg->parse() && $products_image_lrg->save()) {
+          $products_image_lrg_name = $products_image_lrg->filename;
+        } else {
+          $products_image_lrg_name = (isset($HTTP_POST_VARS['products_previous_image_lrg']) ? $HTTP_POST_VARS['products_previous_image_lrg'] : '');
+        }
+        } else {
+          if (isset($HTTP_POST_VARS['products_image_lrg']) && tep_not_null($HTTP_POST_VARS['products_image_lrg']) && ($HTTP_POST_VARS['products_image_lrg'] != 'none')) {
+            $products_image_lrg_name = $HTTP_POST_VARS['products_image_lrg'];
+          } else {
+            $products_image_lrg_name = (isset($HTTP_POST_VARS['products_previous_image_lrg']) ? $HTTP_POST_VARS['products_previous_image_lrg'] : '');
+          }
+        }
+   if (($HTTP_POST_VARS['unlink_image_sm_1'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_1'] == 'yes')) {
+        $products_image_sm_1 = '';
+        $products_image_sm_1_name = '';
+        } else {
+        $products_image_sm_1 = new upload('products_image_sm_1');
+        $products_image_sm_1->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_sm_1->parse() && $products_image_sm_1->save()) {
+          $products_image_sm_1_name = $products_image_sm_1->filename;
+        } else {
+          $products_image_sm_1_name = (isset($HTTP_POST_VARS['products_previous_image_sm_1']) ? $HTTP_POST_VARS['products_previous_image_sm_1'] : '');
+        }
+        }    if (($HTTP_POST_VARS['unlink_image_xl_1'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_1'] == 'yes')) {
+        $products_image_xl_1 = '';
+        $products_image_xl_1_name = '';
+        } else {
+        $products_image_xl_1 = new upload('products_image_xl_1');
+        $products_image_xl_1->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_xl_1->parse() && $products_image_xl_1->save()) {
+          $products_image_xl_1_name = $products_image_xl_1->filename;
+        } else {
+          $products_image_xl_1_name = (isset($HTTP_POST_VARS['products_previous_image_xl_1']) ? $HTTP_POST_VARS['products_previous_image_xl_1'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_sm_2'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_2'] == 'yes')) {
+        $products_image_sm_2 = '';
+        $products_image_sm_2_name = '';
+        } else {
+        $products_image_sm_2 = new upload('products_image_sm_2');
+        $products_image_sm_2->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_sm_2->parse() && $products_image_sm_2->save()) {
+          $products_image_sm_2_name = $products_image_sm_2->filename;
+        } else {
+          $products_image_sm_2_name = (isset($HTTP_POST_VARS['products_previous_image_sm_2']) ? $HTTP_POST_VARS['products_previous_image_sm_2'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_xl_2'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_2'] == 'yes')) {
+        $products_image_xl_2 = '';
+        $products_image_xl_2_name = '';
+        } else {
+        $products_image_xl_2 = new upload('products_image_xl_2');
+        $products_image_xl_2->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_xl_2->parse() && $products_image_xl_2->save()) {
+          $products_image_xl_2_name = $products_image_xl_2->filename;
+        } else {
+          $products_image_xl_2_name = (isset($HTTP_POST_VARS['products_previous_image_xl_2']) ? $HTTP_POST_VARS['products_previous_image_xl_2'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_sm_3'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_3'] == 'yes')) {
+        $products_image_sm_3 = '';
+        $products_image_sm_3_name = '';
+        } else {
+        $products_image_sm_3 = new upload('products_image_sm_3');
+        $products_image_sm_3->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_sm_3->parse() && $products_image_sm_3->save()) {
+          $products_image_sm_3_name = $products_image_sm_3->filename;
+        } else {
+          $products_image_sm_3_name = (isset($HTTP_POST_VARS['products_previous_image_sm_3']) ? $HTTP_POST_VARS['products_previous_image_sm_3'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_xl_3'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_3'] == 'yes')) {
+        $products_image_xl_3 = '';
+        $products_image_xl_3_name = '';
+        } else {
+        $products_image_xl_3 = new upload('products_image_xl_3');
+        $products_image_xl_3->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_xl_3->parse() && $products_image_xl_3->save()) {
+          $products_image_xl_3_name = $products_image_xl_3->filename;
+        } else {
+          $products_image_xl_3_name = (isset($HTTP_POST_VARS['products_previous_image_xl_3']) ? $HTTP_POST_VARS['products_previous_image_xl_3'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_sm_4'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_4'] == 'yes')) {
+        $products_image_sm_4 = '';
+        $products_image_sm_4_name = '';
+        } else {
+        $products_image_sm_4 = new upload('products_image_sm_4');
+        $products_image_sm_4->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_sm_4->parse() && $products_image_sm_4->save()) {
+          $products_image_sm_4_name = $products_image_sm_4->filename;
+        } else {
+          $products_image_sm_4_name = (isset($HTTP_POST_VARS['products_previous_image_sm_4']) ? $HTTP_POST_VARS['products_previous_image_sm_4'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_xl_4'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_4'] == 'yes')) {
+        $products_image_xl_4 = '';
+        $products_image_xl_4_name = '';
+        } else {
+        $products_image_xl_4 = new upload('products_image_xl_4');
+        $products_image_xl_4->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_xl_4->parse() && $products_image_xl_4->save()) {
+          $products_image_xl_4_name = $products_image_xl_4->filename;
+        } else {           $products_image_xl_4_name = (isset($HTTP_POST_VARS['products_previous_image_xl_4']) ? $HTTP_POST_VARS['products_previous_image_xl_4'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_sm_5'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_5'] == 'yes')) {
+        $products_image_sm_5 = '';
+        $products_image_sm_5_name = '';
+        } else {
+        $products_image_sm_5 = new upload('products_image_sm_5');
+        $products_image_sm_5->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_sm_5->parse() && $products_image_sm_5->save()) {
+          $products_image_sm_5_name = $products_image_sm_5->filename;
+        } else {
+          $products_image_sm_5_name = (isset($HTTP_POST_VARS['products_previous_image_sm_5']) ? $HTTP_POST_VARS['products_previous_image_sm_5'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_xl_5'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_5'] == 'yes')) {
+        $products_image_xl_5 = '';
+        $products_image_xl_5_name = '';
+        } else {
+        $products_image_xl_5 = new upload('products_image_xl_5');
+        $products_image_xl_5->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_xl_5->parse() && $products_image_xl_5->save()) {
+          $products_image_xl_5_name = $products_image_xl_5->filename;
+        } else {
+          $products_image_xl_5_name = (isset($HTTP_POST_VARS['products_previous_image_xl_5']) ? $HTTP_POST_VARS['products_previous_image_xl_5'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_sm_6'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_6'] == 'yes')) {
+        $products_image_sm_6 = '';
+        $products_image_sm_6_name = '';
+        } else {
+        $products_image_sm_6 = new upload('products_image_sm_6');
+        $products_image_sm_6->set_destination(DIR_FS_CATALOG_IMAGES);         if ($products_image_sm_6->parse() && $products_image_sm_6->save()) {
+          $products_image_sm_6_name = $products_image_sm_6->filename;
+        } else {
+          $products_image_sm_6_name = (isset($HTTP_POST_VARS['products_previous_image_sm_6']) ? $HTTP_POST_VARS['products_previous_image_sm_6'] : '');
+        }
+        }
+   if (($HTTP_POST_VARS['unlink_image_xl_6'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_6'] == 'yes')) {
+        $products_image_xl_6 = '';
+        $products_image_xl_6_name = '';
+        } else {
+        $products_image_xl_6 = new upload('products_image_xl_6');
+        $products_image_xl_6->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($products_image_xl_6->parse() && $products_image_xl_6->save()) {
+          $products_image_xl_6_name = $products_image_xl_6->filename;
+        } else {
+          $products_image_xl_6_name = (isset($HTTP_POST_VARS['products_previous_image_xl_6']) ? $HTTP_POST_VARS['products_previous_image_xl_6'] : '');
+        }
+        }
+        break;
+// EOF MaxiDVD: Modified For Ultimate Images Pack!
+    }
+  }
+
+// check if the catalog image directory exists
+  if (is_dir(DIR_FS_CATALOG_IMAGES)) {
+    if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
+  } else {
+    $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
+  }
+?>
+<?php
+// WebMakers.com Added: Display Order
+  switch (true) {
+    case (CATEGORIES_SORT_ORDER=="products_name"):
+      $order_it_by = "pd.products_name";
+      break;
+    case (CATEGORIES_SORT_ORDER=="products_name-desc"):
+      $order_it_by = "pd.products_name DESC";
+      break;
+    case (CATEGORIES_SORT_ORDER=="model"):
+      $order_it_by = "p.products_model";
+      break;
+    case (CATEGORIES_SORT_ORDER=="model-desc"):
+      $order_it_by = "p.products_model DESC";
+      break;
+    default:
+      $order_it_by = "pd.products_name";
+      break;
+    }
+?>
+<?php
+$go_back_to=$REQUEST_URI;
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript" src="includes/menu.js"></script>
+<!-- Tabs code -->
+<script type="text/javascript" src="includes/javascript/tabpane/local/webfxlayout.js"></script>
+<link type="text/css" rel="stylesheet" href="includes/javascript/tabpane/tab.webfx.css">
+<style type="text/css">
+.dynamic-tab-pane-control h2 {
+  text-align: center;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control h2 a {
+  display:  inline;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control a:hover {
+  background: transparent;
+}
+</style>
+<script type="text/javascript" src="includes/javascript/tabpane/tabpane.js"></script>
+<!-- End Tabs -->
+<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
+<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
+<?php
+// load editor functions
+include('includes/javascript/editor.php');
+// WebMakers.com Added: Java Scripts - popup window
+include(DIR_WS_INCLUDES . 'javascript/' . 'webmakers_added_js.php')
+?>
+<script language="javascript">
+<!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
+}
+//-->
+</script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+<tr>
+  <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+      <!-- left_navigation //-->
+      <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+      <!-- left_navigation_eof //-->
+    </table></td>
+  <!-- body_text //-->
+  <td width="100%" valign="top">
+  <table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <?php   //----- new_category / edit_category (when ALLOW_CATEGORY_DESCRIPTIONS is 'true') -----
+  if ($HTTP_GET_VARS['action'] == 'new_category_ACD' || $HTTP_GET_VARS['action'] == 'edit_category_ACD') {
+    if ( ($HTTP_GET_VARS['cID']) && (!$HTTP_POST_VARS) ) {
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, cd.categories_heading_title, cd.categories_description, cd.categories_head_title_tag, cd.categories_head_desc_tag, cd.categories_head_keywords_tag, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $HTTP_GET_VARS['cID'] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name");
+      $category = tep_db_fetch_array($categories_query);
+
+      $cInfo = new objectInfo($category);
+    } elseif ($HTTP_POST_VARS) {
+      $cInfo = new objectInfo($HTTP_POST_VARS);
+      $categories_name = $HTTP_POST_VARS['categories_name'];
+      $categories_heading_title = $HTTP_POST_VARS['categories_heading_title'];
+      $categories_description = $HTTP_POST_VARS['categories_description'];
+      $categories_head_title_tag = $HTTP_POST_VARS['categories_head_title_tag'];
+      $categories_head_desc_tag = $HTTP_POST_VARS['categories_head_desc_tag'];
+      $categories_head_keywords_tag = $HTTP_POST_VARS['categories_head_keywords_tag'];
+      $categories_url = $HTTP_POST_VARS['categories_url'];
+    } else {
+      $cInfo = new objectInfo(array());
+    }
+
+    $languages = tep_get_languages();
+
+    $text_new_or_edit = ($HTTP_GET_VARS['action']=='new_category_ACD') ? TEXT_INFO_HEADING_NEW_CATEGORY : TEXT_INFO_HEADING_EDIT_CATEGORY;
+  // Editor functions
+  echo tep_load_html_editor();
+  for ($i=0; $i<sizeof($languages); $i++) {
+      $category_elements .= 'categories_description[' . $languages[$i]['id'] . '],'; 
+    } 
+  echo tep_insert_html_editor($category_elements);
+// editor functions
+?>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+  </tr>
+  <tr>
+  <?php echo tep_draw_form('new_category', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID'] . '&action=new_category_preview', 'post', 'enctype="multipart/form-data"'); ?>
+  <td><fieldset>
+    <legend><?php echo sprintf($text_new_or_edit, tep_output_generated_category_path($current_category_id)); ?></legend>
+    <table width="80%" border="0" cellspacing="3" cellpadding="3" align="center" summary="category Image and sort order">
+      <tr valign="top">
+        <td width="33%" class="main"><strong><?php echo TEXT_EDIT_CATEGORIES_IMAGE; ?></strong><br>
+          <br>
+          <?php echo tep_draw_file_field('categories_image');?></td>
+        <td width="33%" class="main" align="center"><?php if ($cInfo->categories_image=='') { } else {?>
+          <strong><?php echo TEXT_EXISTING_CATEGORIES_IMAGE; ?></strong><br>
+          <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $cInfo->categories_image, $cInfo->categories_image, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="0" vspace="5"') . '<br>' . $cInfo->categories_image . '<br>' . tep_draw_hidden_field('categories_previous_image', $cInfo->categories_image);}?></td>
+        <td width="33%" class="main" align="right"><strong><?php echo TEXT_EDIT_SORT_ORDER; ?></strong><br>
+          <br>
+          <?php echo tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'); ?></td>
+      </tr>
+    </table>
+    </fieldset>
+    <?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
+  <table border="0" cellspacing="0" cellpadding="2" width="98%" align="center">
+  <tr>
+    <td colspan="2" class="main" valign="top" width="100%"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
+        <tr>
+          <td class="main" valign="top"><div class="tab-pane" id="tabPane1">
+              <script type="text/javascript">
+tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ) );
+</script>
+              <?php
+    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+              <div class="tab-page" id="<?php echo $languages[$i]['name'];?>">
+                <h2 class="tab"><nobr><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name'],'align="absmiddle" style="height:16px; width:30px;"') . '&nbsp;' .$languages[$i]['name'];?></nobr></h2>
+                <script type="text/javascript">tp1.addTabPage( document.getElementById( "<?php echo $languages[$i]['name'];?>" ) );</script>
+                <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="tab table">
+                  <tr>
+                    <td valign="top"><table border="0" cellspacing="5" cellpadding="4" summary="Title table">
+                  <tr valign="top">
+              <td class="main"><strong><?php echo TEXT_EDIT_CATEGORIES_NAME; ?></strong></td>
+            <td class="main"><?php echo tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', (($categories_name[$languages[$i]['id']]) ? stripslashes($categories_name[$languages[$i]['id']]) : tep_get_category_name($cInfo->categories_id, $languages[$i]['id']))); ?></td>
+          </tr>
+          <tr valign="top">
+            <td class="main"><?php echo TEXT_EDIT_CATEGORIES_HEADING_TITLE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('categories_heading_title[' . $languages[$i]['id'] . ']', (($categories_heading_title[$languages[$i]['id']]) ? stripslashes($categories_heading_title[$languages[$i]['id']]) : tep_get_category_heading_title($cInfo->categories_id, $languages[$i]['id']))); ?></td>
+          <tr>
+                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                </table>
+                    <table width="100%"  border="0" cellspacing="4" cellpadding="0" summary="description tabe">
+                        <tr valign="top">
+                          <td class="main"><strong><?php echo TEXT_EDIT_CATEGORIES_DESCRIPTION; ?></strong></td>
+                        </tr>
+                        <tr>
+                          <td><?php echo tep_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (($categories_description[$languages[$i]['id']]) ? stripslashes($categories_description[$languages[$i]['id']]) : tep_get_category_description($cInfo->categories_id, $languages[$i]['id']))); ?></td>
+                        </tr>
+                      </table>
+                      <table width="100%"  border="0" cellspacing="3" cellpadding="0" summary="meta content holder table">
+                        <tr>
+                          <td valign="top"><fieldset>
+<legend><?php echo TEXT_PRODUCT_METTA_INFO; ?></legend>
+<table width="100%"  border="0" cellspacing="3" cellpadding="3">
+  <tr>
+    <td class="main"><strong><?php echo TEXT_EDIT_CATEGORIES_TITLE_TAG;?></strong></td>
+  </tr>
+  <tr>
+    <td class="main"><?php echo tep_draw_textarea_field('categories_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '15', '2', (($categories_head_title_tag[$languages[$i]['id']]) ? stripslashes($categories_head_title_tag[$languages[$i]['id']]) : tep_get_category_head_title_tag($cInfo->categories_id, $languages[$i]['id'])),'style="width: 100%"'); ?></td>
+  </tr>
+</table>
+<table width="100%"  border="0" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="50%" class="main"><strong><?php echo TEXT_EDIT_CATEGORIES_DESC_TAG;?></strong></td>
+    <td width="50%" class="main"><strong><?php echo TEXT_EDIT_CATEGORIES_KEYWORDS_TAG; ?></strong></td>
+  </tr>
+  <tr>
+    <td class="main"><?php echo tep_draw_textarea_field('categories_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '25', '5', (($categories_head_desc_tag[$languages[$i]['id']]) ? stripslashes($categories_head_desc_tag[$languages[$i]['id']]) : tep_get_category_head_desc_tag($cInfo->categories_id, $languages[$i]['id'])),'style="width: 100%"'); ?></td>
+    <td class="main"><?php echo tep_draw_textarea_field('categories_head_keywords_tag[' . $languages[$i]['id'] . ']', 'soft', '25', '5', (($categories_head_keywords_tag[$languages[$i]['id']]) ? stripslashes($categories_head_keywords_tag[$languages[$i]['id']]) : tep_get_category_head_keywords_tag($cInfo->categories_id, $languages[$i]['id'])),'style="width: 100%"'); ?></td>
+  </tr>
+</table>
+</fieldset></td>
+                        </tr>
+                      </table></td>
+                  </tr>
+                </table>
+              </div>
+              <?php
+    }
+?>
+            </div>
+            <script type="text/javascript">
+//<![CDATA[
+setupAllTabs();
+//]]>
+</script>
+            <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?> </td>
+        </tr>
+        <tr>
+          <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+        </tr>
+      </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+  </tr>
+  <tr>
+    <td class="main" align="right"><?php echo tep_draw_hidden_field('categories_date_added', (($cInfo->date_added) ? $cInfo->date_added : date('Y-m-d'))) . tep_draw_hidden_field('parent_id', $cInfo->parent_id) . tep_image_submit('button_preview_upload.gif', IMAGE_PREVIEW) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+    </form>
+  </tr>
+  <?php
+  //----- new_category_preview (active when ALLOW_CATEGORY_DESCRIPTIONS is 'true') -----
+  } elseif ($HTTP_GET_VARS['action'] == 'new_category_preview') {
+    if ($HTTP_POST_VARS) {
+      $cInfo = new objectInfo($HTTP_POST_VARS);
+      $categories_name = $HTTP_POST_VARS['categories_name'];
+      $categories_heading_title = $HTTP_POST_VARS['categories_heading_title'];
+      $categories_description = $HTTP_POST_VARS['categories_description'];
+      $categories_head_title_tag = $HTTP_POST_VARS['categories_head_title_tag'];
+      $categories_head_desc_tag = $HTTP_POST_VARS['categories_head_desc_tag'];
+      $categories_head_keywords_tag = $HTTP_POST_VARS['categories_head_keywords_tag'];
+
+// copy image only if modified
+        $categories_image = new upload('categories_image');
+        $categories_image->set_destination(DIR_FS_CATALOG_IMAGES);
+        if ($categories_image->parse() && $categories_image->save()) {
+          $categories_image_name = $categories_image->filename;
+        } else {
+        $categories_image_name = $HTTP_POST_VARS['categories_previous_image'];
+      }
+#     if ( ($categories_image != 'none') && ($categories_image != '') ) {
+#       $image_location = DIR_FS_CATALOG_IMAGES . $categories_image_name;
+#       if (file_exists($image_location)) @unlink($image_location);
+#       copy($categories_image, $image_location);
+#     } else {
+#       $categories_image_name = $HTTP_POST_VARS['categories_previous_image'];
+#     }
+    } else {
+      $category_query = tep_db_query("select c.categories_id, cd.language_id, cd.categories_name, cd.categories_heading_title, cd.categories_description, cd.categories_head_title_tag, cd.categories_head_desc_tag, cd.categories_head_keywords_tag, c.categories_image, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.categories_id = '" . $HTTP_GET_VARS['cID'] . "'");
+      $category = tep_db_fetch_array($category_query);
+
+      $cInfo = new objectInfo($category);
+      $categories_image_name = $cInfo->categories_image;
+    }
+
+    $form_action = ($HTTP_GET_VARS['cID']) ? 'update_category' : 'insert_category';
+
+    echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');
+
+    $languages = tep_get_languages();
+    for ($i=0; $i<sizeof($languages); $i++) {
+      if ($HTTP_GET_VARS['read'] == 'only') {
+        $cInfo->categories_name = tep_get_category_name($cInfo->categories_id, $languages[$i]['id']);
+        $cInfo->categories_heading_title = tep_get_category_heading_title($cInfo->categories_id, $languages[$i]['id']);
+        $cInfo->categories_description = tep_get_category_description($cInfo->categories_id, $languages[$i]['id']);
+        $cInfo->category_template_id = tep_get_category_template_id($cInfo->categories_id, $languages[$i]['id']);
+        $cInfo->categories_head_title_tag = tep_get_category_head_title_tag($cInfo->categories_id, $languages[$i]['id']);
+        $cInfo->categories_head_desc_tag = tep_get_category_head_desc_tag($cInfo->categories_id, $languages[$i]['id']);
+        $cInfo->categories_head_keywords_tag = tep_get_category_head_keywords_tag($cInfo->categories_id, $languages[$i]['id']);
+      } else {
+        $cInfo->categories_name = tep_db_prepare_input($categories_name[$languages[$i]['id']]);
+        $cInfo->categories_heading_title = tep_db_prepare_input($categories_heading_title[$languages[$i]['id']]);
+        $cInfo->categories_description = tep_db_prepare_input($categories_description[$languages[$i]['id']]);
+        $cInfo->category_template_id = tep_db_prepare_input($category_template_id[$languages[$i]['id']]);
+        $cInfo->categories_head_title_tag = tep_db_prepare_input($categories_head_title_tag[$languages[$i]['id']]);
+        $cInfo->categories_head_desc_tag = tep_db_prepare_input($categories_head_desc_tag[$languages[$i]['id']]);
+        $cInfo->categories_head_keywords_tag = tep_db_prepare_input($categories_head_keywords_tag[$languages[$i]['id']]);
+
+    }
+?>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td class="pageHeading"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $cInfo->categories_heading_title; ?></td>
+        </tr>
+      </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+  </tr>
+  <tr>
+    <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $categories_image_name, $cInfo->categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $cInfo->categories_description; ?></td>
+  </tr>
+  <?php
+    }
+    if ($HTTP_GET_VARS['read'] == 'only') {
+      if ($HTTP_GET_VARS['origin']) {
+        $pos_params = strpos($HTTP_GET_VARS['origin'], '?', 0);
+        if ($pos_params != false) {
+          $back_url = substr($HTTP_GET_VARS['origin'], 0, $pos_params);
+          $back_url_params = substr($HTTP_GET_VARS['origin'], $pos_params + 1);
+        } else {
+          $back_url = $HTTP_GET_VARS['origin'];
+          $back_url_params = '';
+        }
+      } else {
+        $back_url = FILENAME_CATEGORIES;
+        $back_url_params = 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id;
+      }
+?>
+  <tr>
+    <td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+  </tr>
+  <?php
+    } else {
+?>
+  <tr>
+    <td align="right" class="smallText"><?php
+/* Re-Post all POST'ed variables */
+      reset($HTTP_POST_VARS);
+      while (list($key, $value) = each($HTTP_POST_VARS)) {
+        
+// Eversun mod for sppc and qty price breaks
+//        if (!is_array($HTTP_POST_VARS[$key])) {
+        if (is_array($value)) {
+          while (list($k, $v) = each($value)) {
+            echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v)));
+          }
+        } else {
+// Eversun mod end for sppc and qty price breaks
+          echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+        }
+      }
+      $languages = tep_get_languages();
+      for ($i=0; $i<sizeof($languages); $i++) {
+        echo tep_draw_hidden_field('categories_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_name[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('categories_heading_title[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_heading_title[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('categories_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_description[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('categories_head_title_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_head_title_tag[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('categories_head_desc_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_head_desc_tag[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('categories_head_keywords_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($categories_head_keywords_tag[$languages[$i]['id']])));
+
+     }
+      echo tep_draw_hidden_field('X_categories_image', stripslashes($categories_image_name));
+      echo tep_draw_hidden_field('categories_image', stripslashes($categories_image_name));
+
+      echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '&nbsp;&nbsp;';
+
+      if ($HTTP_GET_VARS['cID']) {
+        echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
+      } else {
+        echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
+      }
+      echo '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $HTTP_GET_VARS['cID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+?></td>
+    </form>
+  </tr>
+  <?php
+    }
+
+
+  } elseif ($action == 'new_product') {
+    $parameters = array('products_name' => '',
+                       'products_description' => '',
+                       'products_url' => '',
+                       'products_id' => '',
+                       'products_quantity' => '',
+                       'products_model' => '',
+                       'products_image' => '',
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+                       'products_image_med' => '',
+                       'products_image_lrg' => '',
+                       'products_image_sm_1' => '',
+                       'products_image_xl_1' => '',
+                       'products_image_sm_2' => '',
+                       'products_image_xl_2' => '',
+                       'products_image_sm_3' => '',
+                       'products_image_xl_3' => '',
+                       'products_image_sm_4' => '',
+                       'products_image_xl_4' => '',
+                       'products_image_sm_5' => '',
+                       'products_image_xl_5' => '',
+                       'products_image_sm_6' => '',
+                       'products_image_xl_6' => '',
+// EOF MaxiDVD: Modified For Ultimate Images Pack!
+                       'products_price' => '',
+                       'products_weight' => '',
+                       'products_date_added' => '',
+                       'products_last_modified' => '',
+                       'products_date_available' => '',
+                       'products_status' => '',
+                       'products_tax_class_id' => '',
+                       'manufacturers_id' => '');
+
+    $pInfo = new objectInfo($parameters);
+
+    if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
+// START: Extra Fields Contribution  DMG    
+      $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
+      while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
+        $extra_field[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
+      }
+    $extra_field_array=array('extra_field'=>$extra_field);
+    $pInfo->objectInfo($extra_field_array);
+// END: Extra Fields Contribution DMG
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+
+// Eversun mod for sppc and qty price breaks
+      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
+//modified      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price9, p.products_price10, p.products_price11, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_price9_qty, p.products_price10_qty, p.products_price11_qty, p.products_qty_blocks, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
+// Eversun mod end for sppc and qty price breaks
+
+// EOF MaxiDVD: Modified For Ultimate Images Pack!
+      $product = tep_db_fetch_array($product_query);
+
+      $pInfo->objectInfo($product);
+    } elseif (tep_not_null($HTTP_POST_VARS)) {
+      $pInfo->objectInfo($HTTP_POST_VARS);
+      $products_name = $HTTP_POST_VARS['products_name'];
+      $products_description = $HTTP_POST_VARS['products_description'];
+      $products_url = $HTTP_POST_VARS['products_url'];
+    }
+
+    $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
+    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+      $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
+                                     'text' => $manufacturers['manufacturers_name']);
+    }
+
+    $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
+    $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
+    while ($tax_class = tep_db_fetch_array($tax_class_query)) {
+      $tax_class_array[] = array('id' => $tax_class['tax_class_id'],
+                                 'text' => $tax_class['tax_class_title']);
+    }
+
+    $languages = tep_get_languages();
+
+    if (!isset($pInfo->products_status)) $pInfo->products_status = '1';
+    switch ($pInfo->products_status) {
+      case '0': $in_status = false; $out_status = true; break;
+      case '1':
+      default: $in_status = true; $out_status = false;
+    }
+?>
+  <script language="javascript">
+<!--
+  var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);
+//-->
+</script>
+  <script language="javascript"><!--
+var tax_rates = new Array();
+<?php
+    for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {
+      if ($tax_class_array[$i]['id'] > 0) {
+        echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";
+      }
+    }
+?>
+
+function doRound(x, places) {
+  return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
+}
+
+function getTaxRate() {
+  var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;
+  var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;
+
+  if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {
+    return tax_rates[parameterVal];
+  } else {
+    return 0;
+  }
+}
+
+function updateGross() {
+  var taxRate = getTaxRate();
+  var grossValue = document.forms["new_product"].products_price.value;
+
+  if (taxRate > 0) {
+    grossValue = grossValue * ((taxRate / 100) + 1);
+  }
+
+  document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);
+}
+
+function updateNet() {
+  var taxRate = getTaxRate();
+  var netValue = document.forms["new_product"].products_price_gross.value;
+
+  if (taxRate > 0) {
+    netValue = netValue / ((taxRate / 100) + 1);
+  }
+
+  document.forms["new_product"].products_price.value = doRound(netValue, 4);
+}
+
+// MOD begin of sub products
+function checkdelete() {
+  var thereturnvalue = true;
+  for(i=0; i < document.new_product.elements.length; i++) {
+    if (document.new_product.elements[i].name == 'subproddelete[]') {
+      if (document.new_product.elements[i].checked) {
+        var agree=confirm("Are you sure you want to delete these sub-products?");
+        if (agree) {
+          thereturnvalue = true;
+          break;
+        }
+        else {
+          thereturnvalue = false;
+          break;
+        }
+      }
+    }
+  }
+  return thereturnvalue;
+}
+// MOD end of sub products
+
+//--></script>
+<?php
+// Editor functions
+  echo tep_load_html_editor();
+  for ($i=0; $i<sizeof($languages); $i++) {
+      $products_elements .= 'products_description[' . $languages[$i]['id'] . '],'; 
+    } 
+  echo tep_insert_html_editor($products_elements);
+// editor functions
+
+if ( isset($HTTP_GET_VARS['pID']) ) {
+  $form_action_text = 'update';
+  $form_action_button = tep_image_submit('button_quick_save.gif',IMAGE_UPDATE,'name="Operation" onClick="document.pressed=this.value" VALUE="'.$form_action_text.'"');
+} else {
+  $form_action_text = 'insert';
+  $form_action_button = tep_image_submit('button_'.$form_action_text.'.gif',IMAGE_UPDATE,'name="Operation" onClick="document.pressed=this.value" VALUE="'.$form_action_text.'"');
+}
+// $form_action_text = (isset($HTTP_GET_VARS['pID'])) ? 'update' : 'insert';
+$form_action_add_update = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product';
+?>
+ <script language="JavaScript">
+function OnSubmitForm()
+{
+  if(document.pressed == '<?php echo $form_action_text;?>')
+  {
+    document.new_product.action ="<?php echo tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action_add_update); ?>";
+  }
+  else
+  if(document.pressed == 'Preview')
+  {
+    document.new_product.action ="<?php echo tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=new_product_preview'); ?>";
+  }
+  return true;
+}
+</script>
+ <form name="new_product" method="post" enctype="multipart/form-data" onSubmit="return OnSubmitForm();return checkdelete()">
+  <table border="0" width="98%" cellspacing="0" cellpadding="2" align="center">
+    <tr>
+      <td colspan="2"><fieldset><legend><?php echo sprintf(TEXT_NEW_PRODUCT, tep_output_generated_category_path($current_category_id)); ?></legend>
+    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
+  <tr valign="top">
+    <td width="50%"><table  border="0" cellspacing="2" cellpadding="2">
+     <tr>
+        <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>
+        <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_radio_field('products_status', '1', $in_status) . '&nbsp;' . TEXT_PRODUCT_AVAILABLE . '&nbsp;' . tep_draw_radio_field('products_status', '0', $out_status) . '&nbsp;' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td>
+      </tr>
+      <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br>
+          <small><!-- (YYYY-MM-DD) --><?php echo DATE_FORMAT?></small></td>
+        <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'; ?>
+          <script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td>
+      </tr>
+      <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>
+        <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>
+      </tr>
+     </table></td>
+    <td width="50%"><table  border="0" cellspacing="2" cellpadding="2">
+    <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td>
+        <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td>
+      </tr>
+      <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td>
+        <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_model', $pInfo->products_model); ?></td>
+      </tr>
+      <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+    <tr>
+        <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>
+        <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>
+      </tr>
+    <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>
+  <table width="100%"  border="0" cellspacing="2" cellpadding="2">
+      <tr bgcolor="#ebebff">
+        <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>
+        <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>
+      </tr>
+      <!-- Eversun mod for sppc and qty price breaks -->
+      <tr bgcolor="#ebebff">
+        <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
+        <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>
+      </tr>
+      <!-- Eversun mod end for sppc and qty price breaks -->
+      <tr bgcolor="#ebebff">
+        <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
+        <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td>
+      </tr>
+</table></fieldset></td>
+    </tr> 
+      <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>   
+   <script language="javascript">
+<!--
+updateGross();
+//-->
+</script>
+      <tr>
+        <td colspan="2"><!-- tabs -->
+
+<table border="0" cellspacing="0" cellpadding="2" width="98%" align="center">
+  <tr>
+    <td class="main" valign="top" width="100%"><div class="tab-pane" id="tabPane1">
+        <script type="text/javascript">tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ) );</script>
+        <?php
+    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+        <div class="tab-page" id="<?php echo $languages[$i]['name'];?>">
+          <h2 class="tab"><nobr><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name'],'align="absmiddle" style="height:16px; width:30px;"') . '&nbsp;' .$languages[$i]['name'];?></nobr></h2>
+          <script type="text/javascript">tp1.addTabPage( document.getElementById( "<?php echo $languages[$i]['name'];?>" ) );</script>
+          <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="tab table">
+            <tr>
+              <td valign="top"><table border="0" cellspacing="5" cellpadding="4" summary="Title table">
+                  <tr valign="top">
+              <td class="main"><strong><?php echo TEXT_PRODUCTS_NAME; ?></strong></td>
+            <td class="main"><?php echo tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id'])), 'size="64",maxlength="255"'); ?></td>
+          </tr>
+          <tr valign="top">
+            <td class="main"><?php echo '<strong>' . TEXT_PRODUCTS_URL . '</strong><br><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? $products_url[$languages[$i]['id']] : tep_get_products_url($pInfo->products_id, $languages[$i]['id'])), 'size="64",maxlength="255"'); ?></td>
+          <tr>
+                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                </table>
+                <table width="100%"  border="0" cellspacing="4" cellpadding="0" summary="description tabe">
+                  <tr valign="top">
+                    <td class="main"><strong><?php echo TEXT_PRODUCTS_DESCRIPTION;; ?></strong></td>
+                  </tr>
+                  <tr>
+                    <td><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>
+                  </tr>
+                </table>
+                <table width="100%"  border="0" cellspacing="3" cellpadding="0" summary="meta content holder table">
+                  <tr>
+                    <td class="main"><fieldset>
+<legend><?php echo TEXT_PRODUCT_METTA_INFO; ?></legend>
+<table width="100%"  border="0" cellspacing="3" cellpadding="3">
+  <tr>
+    <td class="main"><strong><?php echo TEXT_PRODUCTS_PAGE_TITLE;?></strong></td>
+  </tr>
+  <tr>
+    <td class="main"><?php echo tep_draw_textarea_field('products_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '15', '2', (isset($products_head_title_tag[$languages[$i]['id']]) ? $products_head_title_tag[$languages[$i]['id']] : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id'])),'style="width:100%"'); ?></td>
+  </tr>
+</table>
+<table width="100%"  border="0" cellspacing="3" cellpadding="3">
+  <tr class="main">
+    <td width="50%"><strong><?php echo TEXT_PRODUCTS_HEADER_DESCRIPTION;?></strong></td>
+    <td width="50%"><strong><?php echo TEXT_PRODUCTS_KEYWORDS; ?></strong></td>
+  </tr>
+  <tr class="main">
+    <td><?php echo tep_draw_textarea_field('products_head_desc_tag[' . $languages[$i]['id'] . ']', 'soft', '35', '5', (isset($products_head_desc_tag[$languages[$i]['id']]) ? $products_head_desc_tag[$languages[$i]['id']] : tep_get_products_head_desc_tag($pInfo->products_id, $languages[$i]['id'])),'style="width:100%"'); ?></td>
+    <td><?php echo tep_draw_textarea_field('products_head_keywords_tag[' . $languages[$i]['id'] . ']', 'soft', '35', '5', (isset($products_head_keywords_tag[$languages[$i]['id']]) ? $products_head_keywords_tag[$languages[$i]['id']] : tep_get_products_head_keywords_tag($pInfo->products_id, $languages[$i]['id'])),'style="width:100%"'); ?></td>
+  </tr>
+</table>
+<br>
+</fieldset>
+</strong></td>
+                  </tr>
+                </table></td>
+            </tr>
+          </table>
+        </div>
+        <?php
+    }
+?>
+      </div>
+      <script type="text/javascript">
+//<![CDATA[
+setupAllTabs();
+//]]>
+</script>
+    </td>
+  </tr>
+</table>
+</td>
+      </tr>
+
+      <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+</table>
+<fieldset><legend><!-- Product Images --><?php echo TEXT_PRODUCT_IMAGES?></legend>
+<table border="0" cellpadding="2" cellspacing="2" width="100%">
+      <!-- // BOF: MaxiDVD Added for Ulimited Images Pack! -->
+      <tr>
+        <td class="dataTableRow" valign="top"><span class="main"><?php echo TEXT_PRODUCTS_IMAGE_NOTE; ?></span></td>
+        <?php // if ((HTML_AREA_WYSIWYG_DISABLE_JPSY == 'Disable') or (HTML_AREA_WYSIWYG_DISABLE == 'Disable')){ ?>
+        <?php if ( true ) { // disable the Image Manager for now?>
+        <td class="dataTableRow" valign="top">
+        <span class="smallText">
+        <?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_file_field('products_image') . '<br>'; ?>
+        <?php } else { ?>
+        <td class="dataTableRow" valign="top"><span class="smallText"><?php echo '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="main">' . tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp; </td><td class="dataTableRow">' . tep_draw_IM_field('products_image', $pInfo->products_image) . tep_draw_hidden_field('products_previous_image', $pInfo->products_image) . '</td></tr></table>';
+           } if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image) != '')
+           echo tep_draw_separator('pixel_trans.gif', '24', '17" align="left') . $pInfo->products_image . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image, $pInfo->products_image, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . tep_draw_hidden_field('products_previous_image', $pInfo->products_image) . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span></td>
+      </tr>
+      <tr>
+        <td class="dataTableRow" valign="top"><span class="main"><?php echo TEXT_PRODUCTS_IMAGE_MEDIUM; ?></span></td>
+        <?php // if ((HTML_AREA_WYSIWYG_DISABLE_JPSY == 'Disable') or (HTML_AREA_WYSIWYG_DISABLE == 'Disable')){ ?>
+        <?php if ( true ) { // disable the Image Manager for now?>
+        <td class="dataTableRow" valign="top">
+        <span class="smallText">
+        <?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_file_field('products_image_med') . '<br>'; ?>
+        <?php } else { ?>
+        <td class="dataTableRow" valign="top"><span class="smallText"><?php echo '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="main">' . tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp; </td><td class="dataTableRow">' . tep_draw_IM_field('products_image_med', $pInfo->products_image_med) . tep_draw_hidden_field('products_previous_image_med', $pInfo->products_image_med) . '</td></tr></table>';
+           } if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_med) != '')
+           echo tep_draw_separator('pixel_trans.gif', '24', '17" align="left') . $pInfo->products_image_med . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_med, $pInfo->products_image_med, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . tep_draw_hidden_field('products_previous_image_med', $pInfo->products_image_med) . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_med" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_med" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span></td>
+      </tr>
+      <tr>
+        <td class="dataTableRow" valign="top"><span class="main"><?php echo TEXT_PRODUCTS_IMAGE_LARGE; ?></span></td>
+        <?php // if ((HTML_AREA_WYSIWYG_DISABLE_JPSY == 'Disable') or (HTML_AREA_WYSIWYG_DISABLE == 'Disable')){ ?>
+        <?php if ( true ) { // disable the Image Manager for now?>
+        <td class="dataTableRow" valign="top">
+        <span class="smallText">
+        <?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_file_field('products_image_lrg') . '<br>'; ?>
+        <?php } else { ?>
+        <td class="dataTableRow" valign="top"><span class="smallText"><?php echo '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="main">' . tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp; </td><td class="dataTableRow">' . tep_draw_IM_field('products_image_lrg', $pInfo->products_image_lrg) . tep_draw_hidden_field('products_previous_image_lrg', $pInfo->products_image_lrg) . '</td></tr></table>';
+           } if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_lrg) != '')
+           echo tep_draw_separator('pixel_trans.gif', '24', '17" align="left') . $pInfo->products_image_lrg . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_lrg, $pInfo->products_image_lrg, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . tep_draw_hidden_field('products_previous_image_lrg', $pInfo->products_image_lrg) . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_lrg" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_lrg" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span></td>
+      </tr>
+</table>
+</fieldset>
+<table border="0" cellpadding="2" cellspacing="0" width="100%">
+<?php
+      if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') {
+ ?>
+      <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
+      </tr>
+      <tr>
+        <td class="main" colspan="3"><fieldset><legend><?php echo TEXT_PRODUCTS_IMAGE_ADDITIONAL;?></legend>
+  <table border="0" cellpadding="2" cellspacing="0" width="100%">
+      <tr>
+        <td class="smalltext"><table border="0" cellpadding="2" cellspacing="0" width="100%">
+            <tr>
+              <td class="smalltext" colspan="2" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_TH_NOTICE; ?></td>
+              <td class="smalltext" colspan="2" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_XL_NOTICE; ?></td>
+            </tr>
+      </table>
+      <table border="0" cellpadding="2" cellspacing="0" width="100%">
+            <tr>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_SM_1; ?></span></td>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_sm_1') . tep_draw_hidden_field('products_previous_image_sm_1', $pInfo->products_image_sm_1); ?></span></td>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_XL_1; ?></span></td>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_xl_1') . tep_draw_hidden_field('products_previous_image_xl_1', $pInfo->products_image_xl_1); ?></span></td>
+            </tr>
+            <?php
+      if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_1) != '' or ($pInfo->products_image_xl_1) != '') {
+    ?>
+            <tr>
+              <td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_sm_1)) { ?>
+                <span class="smallText"><?php echo $pInfo->products_image_sm_1 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_1, $pInfo->products_image_sm_1, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_sm_1" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_sm_1" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>
+                <?php } ?></td>
+              <td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_xl_1)) { ?>
+                <span class="smallText"><?php echo $pInfo->products_image_xl_1 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_1, $pInfo->products_image_xl_1, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_xl_1" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_xl_1" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>
+                <?php } ?></td>
+            </tr>
+            <?php
+     }
+   ?>
+            <tr>
+              <td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_SM_2; ?></td>
+              <td class="smallText" valign="top"><?php echo tep_draw_file_field('products_image_sm_2') . tep_draw_hidden_field('products_previous_image_sm_2', $pInfo->products_image_sm_2); ?></td>
+              <td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_XL_2; ?></td>
+              <td class="smallText" valign="top"><?php echo tep_draw_file_field('products_image_xl_2') . tep_draw_hidden_field('products_previous_image_xl_2', $pInfo->products_image_xl_2); ?></td>
+            </tr>
+            <?php
+      if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_2) != '' or ($pInfo->products_image_xl_2) != '') {
+    ?>
+            <tr>
+              <td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_sm_2)) { ?>
+                <?php echo $pInfo->products_image_sm_2 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_2, $pInfo->products_name_sm_2, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_sm_2" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_sm_2" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>
+                <?php } ?></td>
+              <td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_xl_2)) { ?>
+                <?php echo $pInfo->products_image_xl_2 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_2, $pInfo->products_name_xl_2, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_xl_2" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_xl_2" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>
+                <?php } ?></td>
+            </tr>
+            <?php
+     }
+   ?>
+            <tr>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_SM_3; ?></span></td>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_sm_3') . tep_draw_hidden_field('products_previous_image_sm_3', $pInfo->products_image_sm_3); ?></span></td>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_XL_3; ?></span></td>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_xl_3') . tep_draw_hidden_field('products_previous_image_xl_3', $pInfo->products_image_xl_3); ?></span></td>
+            </tr>
+            <?php
+      if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_3) != '' or ($pInfo->products_image_xl_3) != '') {
+    ?>
+            <tr>
+              <td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_sm_3)) { ?>
+                <span class="smallText"><?php echo $pInfo->products_image_sm_3 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_3, $pInfo->products_name_sm_3, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_sm_3" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_sm_3" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>
+                <?php } ?></td>
+              <td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_xl_3)) { ?>
+                <span class="smallText"><?php echo $pInfo->products_image_xl_3 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_3, $pInfo->products_name_xl_3, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_xl_3" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_xl_3" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>
+                <?php } ?></td>
+            </tr>
+            <?php
+     }
+   ?>
+            <tr>
+              <td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_SM_4; ?></td>
+              <td class="smallText" valign="top"><?php echo tep_draw_file_field('products_image_sm_4') . tep_draw_hidden_field('products_previous_image_sm_4', $pInfo->products_image_sm_4); ?></td>
+              <td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_XL_4; ?></td>
+              <td class="smallText" valign="top"><?php echo tep_draw_file_field('products_image_xl_4') . tep_draw_hidden_field('products_previous_image_xl_4', $pInfo->products_image_xl_4); ?></td>
+            </tr>
+            <?php
+      if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_4) != '' or ($pInfo->products_image_xl_4) != '') {
+    ?>
+            <tr>
+              <td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_sm_4)) { ?>
+                <?php echo $pInfo->products_image_sm_4 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_4, $pInfo->products_name_sm_4, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_sm_4" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_sm_4" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>
+                <?php } ?></td>
+              <td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_xl_4)) { ?>
+                <?php echo $pInfo->products_image_xl_4 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_4, $pInfo->products_name_xl_4, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_xl_4" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_xl_4" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>
+                <?php } ?></td>
+            </tr>
+            <?php
+     }
+   ?>
+            <tr>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_SM_5; ?></span></td>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_sm_5') . tep_draw_hidden_field('products_previous_image_sm_5', $pInfo->products_image_sm_5); ?></span></td>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo TEXT_PRODUCTS_IMAGE_XL_5; ?></span></td>
+              <td class="dataTableRow" valign="top"><span class="smallText"><?php echo tep_draw_file_field('products_image_xl_5') . tep_draw_hidden_field('products_previous_image_xl_5', $pInfo->products_image_xl_5); ?></span></td>
+            </tr>
+            <?php
+      if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_5) != '' or ($pInfo->products_image_xl_5) != '') {
+    ?>
+            <tr>
+              <td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_sm_5)) { ?>
+                <span class="smallText"><?php echo $pInfo->products_image_sm_5 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_5, $pInfo->products_name_sm_5, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_sm_5" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_sm_5" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>
+                <?php } ?></td>
+              <td class="dataTableRow" colspan="2" valign="top"><?php if (tep_not_null($pInfo->products_image_xl_5)) { ?>
+                <span class="smallText"><?php echo $pInfo->products_image_xl_5 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_5, $pInfo->products_name_xl_5, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_xl_5" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_xl_5" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?></span>
+                <?php } ?></td>
+            </tr>
+            <?php
+     }
+   ?>
+            <tr>
+              <td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_SM_6; ?></td>
+              <td class="smalltext" valign="top"><?php echo tep_draw_file_field('products_image_sm_6') . tep_draw_hidden_field('products_previous_image_sm_6', $pInfo->products_image_sm_6); ?></td>
+              <td class="smallText" valign="top"><?php echo TEXT_PRODUCTS_IMAGE_XL_6; ?></td>
+              <td class="smalltext" valign="top"><?php echo tep_draw_file_field('products_image_xl_6') . tep_draw_hidden_field('products_previous_image_xl_6', $pInfo->products_image_xl_6); ?></td>
+            </tr>
+            <?php
+      if (($HTTP_GET_VARS['pID']) && ($pInfo->products_image_sm_6) != '' or ($pInfo->products_image_xl_6) != '') {
+    ?>
+            <tr>
+              <td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_sm_6)) { ?>
+                <?php echo $pInfo->products_image_sm_6 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_sm_6, $pInfo->products_name_sm_6, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_sm_6" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_sm_6" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>
+                <?php } ?></td>
+              <td class="smallText" valign="top" colspan="2"><?php if (tep_not_null($pInfo->products_image_xl_6)) { ?>
+                <?php echo $pInfo->products_image_xl_6 . '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $pInfo->products_image_xl_6, $pInfo->products_name_xl_6, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="left" hspace="0" vspace="5"') . '<br>'. tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="unlink_image_xl_6" value="yes">' . TEXT_PRODUCTS_IMAGE_REMOVE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;<input type="checkbox" name="delete_image_xl_6" value="yes">' . TEXT_PRODUCTS_IMAGE_DELETE_SHORT . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '42'); ?>
+                <?php } ?></td>
+            </tr>
+            <?php
+     }
+   ?>
+          </table></td>
+      </tr>
+      <?php
+  } else {
+   echo tep_draw_hidden_field('products_previous_image_sm_1', $pInfo->products_image_sm_1) .
+        tep_draw_hidden_field('products_previous_image_xl_1', $pInfo->products_image_xl_1) .
+        tep_draw_hidden_field('products_previous_image_sm_2', $pInfo->products_image_sm_2) .
+        tep_draw_hidden_field('products_previous_image_xl_2', $pInfo->products_image_xl_2) .
+        tep_draw_hidden_field('products_previous_image_sm_3', $pInfo->products_image_sm_3) .
+        tep_draw_hidden_field('products_previous_image_xl_3', $pInfo->products_image_xl_3) .
+        tep_draw_hidden_field('products_previous_image_sm_4', $pInfo->products_image_sm_4) .
+        tep_draw_hidden_field('products_previous_image_xl_4', $pInfo->products_image_xl_4) .
+        tep_draw_hidden_field('products_previous_image_sm_5', $pInfo->products_image_sm_5) .
+        tep_draw_hidden_field('products_previous_image_xl_5', $pInfo->products_image_xl_5) .
+        tep_draw_hidden_field('products_previous_image_sm_6', $pInfo->products_image_sm_6) .
+        tep_draw_hidden_field('products_previous_image_xl_6', $pInfo->products_image_xl_6);
+     };
+// EOF: MaxiDVD Added for Ulimited Images Pack!
+?>
+</td></tr></table></fieldset>
+  <fieldset><legend><!-- Extra Fields --><?php echo TEXT_EXTRA_FIELDS?></legend>
+  <table cellpadding="0" cellpadding="2" width="100%">
+      <tr>
+        <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+       <tr>
+        <td class="main">
+    <table><tr><td>
+        <!-- End of sub products div as well as looking its products up -->
+        <?php 
+// START: Extra Fields Contribution (chapter 1.4) DMG
+      // Sort language by ID  
+    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+      $languages_array[$languages[$i]['id']]=$languages[$i];
+    }
+      $extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS . " ORDER BY products_extra_fields_order");
+      while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
+    // Display language icon or blank space
+        if ($extra_fields['languages_id']==0) {
+        $m=tep_draw_separator('pixel_trans.gif', '24', '15');
+      } else $m= tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages_array[$extra_fields['languages_id']]['directory'] . '/images/' . $languages_array[$extra_fields['languages_id']]['image'], $languages_array[$extra_fields['languages_id']]['name']);
+?>
+        <tr bgcolor="#ebebff">
+          <td class="main"><?php echo $extra_fields['products_extra_fields_name']; ?>:</td>
+          <td class="main"><?php echo $m . '&nbsp;' . tep_draw_input_field("extra_field[".$extra_fields['products_extra_fields_id']."]", $pInfo->extra_field[$extra_fields['products_extra_fields_id']]); ?></td>
+        </tr>
+        <?php 
+}
+// END: Extra Fields Contribution DMG
+?>
+</table>
+</td></tr></table>
+
+</fieldset>
+
+  <table cellpadding="0" cellpadding="2" width="100%">
+  
+<?php
+/////////////////////////////////////////////////////////////////////
+// BOF: WebMakers.com Added: Draw Attribute Tables
+?>
+      <tr>
+        <td><table border="3" cellspacing="5" cellpadding="2" align="center" bgcolor="000000">
+<?php
+    $rows = 0;
+    $options_query = tep_db_query("select po.products_options_id, pot.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_OPTIONS_TEXT . " pot where pot.language_id = '" . $languages_id . "' and po.products_options_id = pot.products_options_text_id order by po.products_options_sort_order, pot.products_options_name");
+    while ($options = tep_db_fetch_array($options_query)) {
+      $values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "' order by pov.products_options_values_name");
+      $header = false;
+      while ($values = tep_db_fetch_array($values_query)) {
+        $rows ++;
+        if (!$header) {
+          $header = true;
+?>
+          <tr valign="top">
+            <td><table border="2" cellpadding="2" cellspacing="2" bgcolor="FFFFFF">
+              <tr class="dataTableHeadingRow">
+              <td colspan="4" class="attributeBoxContent" align="center"><!-- Active Attributes --><?php echo TEXT_ACTIVE_ATTRIBUTES?></td>
+             </tr>
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent" width="250" align="left"><?php echo $options['products_options_name']; ?></td>
+                <td class="dataTableHeadingContent" width="50" align="center"><?php echo 'Prefix'; ?></td>
+                <td class="dataTableHeadingContent" width="70" align="center"><?php echo 'Price'; ?></td>
+                <td class="dataTableHeadingContent" width="70" align="center"><?php echo 'Sort Order'; ?></td>
+              </tr>
+<?php
+        }
+        $attributes = array();
+        if (sizeof($HTTP_POST_VARS) > 0) {
+          if ($HTTP_POST_VARS['option'][$rows]) {
+            $attributes = array(
+                                'products_attributes_id' => $HTTP_POST_VARS['option'][$rows],
+                                'options_values_price' => $HTTP_POST_VARS['price'][$rows],
+                                'price_prefix' => $HTTP_POST_VARS['prefix'][$rows],
+                                'products_options_sort_order' => $HTTP_POST_VARS['products_options_sort_order'][$rows],
+                                    );
+          }
+        } else {
+          $attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix, products_options_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $pInfo->products_id . "' and options_id = '" . $options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'");
+          if (tep_db_num_rows($attributes_query) > 0) {
+            $attributes = tep_db_fetch_array($attributes_query);
+          }
+        }
+?>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo tep_draw_checkbox_field('option[' . $rows . ']', $attributes['products_attributes_id'], $attributes['products_attributes_id']) . '&nbsp;' . $values['products_options_values_name']; ?>&nbsp;</td>
+                <td class="dataTableContent" width="50" align="center"><?php echo tep_draw_input_field('prefix[' . $rows . ']', $attributes['price_prefix'], 'size="2"'); ?></td>
+                <td class="dataTableContent" width="70" align="center"><?php echo tep_draw_input_field('price[' . $rows . ']', $attributes['options_values_price'], 'size="7"'); ?></td>
+                <td class="dataTableContent" width="70" align="center"><?php echo tep_draw_input_field('products_options_sort_order[' . $rows . ']', $attributes['products_options_sort_order'], 'size="7"'); ?></td>
+                             </tr>
+<?php
+      }
+      if ($header) {
+?>
+            </table></td>
+<?php
+      }
+    }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// EOF: WebMakers.com Added: Draw Attribute Tables
+/////////////////////////////////////////////////////////////////////
+?>
+
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td valign="top" align="right"> <table align="right">
+      <tr>
+        <td class="main" align="right"><?php echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview_upload.gif', IMAGE_PREVIEW,'name="Operation" onClick="document.pressed=this.value" VALUE="Preview"'). '&nbsp;&nbsp;' . tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))).$form_action_button; ?></td>
+        <td class="main" align="right"><?php echo  '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </tr>
+    </table></td>
+      </tr>
+
+    </table>
+    </form>
+    
+    <?php
+  } elseif ($action == 'new_product_preview') {
+    if (tep_not_null($HTTP_POST_VARS)) {
+      $pInfo = new objectInfo($HTTP_POST_VARS);
+      $products_name = $HTTP_POST_VARS['products_name'];
+      $products_description = $HTTP_POST_VARS['products_description'];
+      $products_head_title_tag = $HTTP_POST_VARS['products_head_title_tag'];
+      $products_head_desc_tag = $HTTP_POST_VARS['products_head_desc_tag'];
+      $products_head_keywords_tag = $HTTP_POST_VARS['products_head_keywords_tag'];
+      $products_url = $HTTP_POST_VARS['products_url'];
+    } else {
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+
+// Eversun mod for sppc and qty price breaks
+      $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
+//mod      $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price9, p.products_price10, p.products_price11, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price1_qty, p.products_price7_qty, p.products_price8_qty, p.products_price9_qty, p.products_price10_qty, products_price11_qty, p.products_qty_blocks, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
+// Eversun mod end for sppc and qty price breaks  
+
+// EOF MaxiDVD: Modified For Ultimate Images Pack!
+      $product = tep_db_fetch_array($product_query);
+
+      $pInfo = new objectInfo($product);
+      $products_image_name = $pInfo->products_image;
+      $products_image_med_name = $pInfo->products_image_med;
+      $products_image_lrg_name = $pInfo->products_image_lrg;
+      $products_image_sm_1_name = $pInfo->products_image_sm_1;
+      $products_image_sm_2_name = $pInfo->products_image_sm_2;
+      $products_image_sm_3_name = $pInfo->products_image_sm_3;
+      $products_image_sm_4_name = $pInfo->products_image_sm_4;
+      $products_image_sm_5_name = $pInfo->products_image_sm_5;
+      $products_image_sm_6_name = $pInfo->products_image_sm_6;
+      $products_image_xl_1_name = $pInfo->products_image_xl_1;
+      $products_image_xl_2_name = $pInfo->products_image_xl_2;
+      $products_image_xl_3_name = $pInfo->products_image_xl_3;
+      $products_image_xl_4_name = $pInfo->products_image_xl_4;
+      $products_image_xl_5_name = $pInfo->products_image_xl_5;
+      $products_image_xl_6_name = $pInfo->products_image_xl_6;
+    }
+
+    $form_action = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product';
+
+    echo tep_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');
+
+    $languages = tep_get_languages();
+    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+      if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {
+        $pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']);
+        $pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']);
+        $pInfo->products_head_title_tag = tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]);
+        $pInfo->products_head_desc_tag = tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]);
+        $pInfo->products_head_keywords_tag = tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]);
+        $pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']);
+      } else {
+        $pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]);
+        $pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]);
+        $pInfo->products_head_title_tag = tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]);
+        $pInfo->products_head_desc_tag = tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]);
+        $pInfo->products_head_keywords_tag = tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]);
+        $pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);
+      }
+?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+            <tr>
+              <td class="pageHeading"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $pInfo->products_name; ?></td>
+              <td class="pageHeading" align="right"><?php echo $currencies->format($pInfo->products_price); ?></td>
+            </tr>
+          </table></td>
+      </tr>
+      <!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! // -->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php if ($products_image_med_name) { ?>
+          <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_med_name, $products_image_med_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"'); } elseif ($products_image_lrg_name) { ?>
+          <script language="javascript">
+<!--
+      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_lrg_name) . '\\\')">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_name, $products_image_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . '</a>'; ?>');
+//-->
+</script>
+          <?php } elseif ($products_image_name) { ?>
+          <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_name, $products_image_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"');}; ?> <?php echo $pInfo->products_description . '<br><br>'; 
+
+ // START: Extra Fields Contribution (chapter 1.5)  DMG
+          if ($HTTP_GET_VARS['read'] == 'only') {
+            $products_extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " WHERE products_id=" . (int)$HTTP_GET_VARS['pID']);
+            while ($products_extra_fields = tep_db_fetch_array($products_extra_fields_query)) {
+              $extra_fields_array[$products_extra_fields['products_extra_fields_id']] = $products_extra_fields['products_extra_fields_value'];
+            }
+          }
+          else {
+            $extra_fields_array = $HTTP_POST_VARS['extra_field'];
+          }
+
+?> <br>
+          <br>
+<?php
+          $extra_fields_names_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS. " WHERE languages_id='0' or languages_id='".(int)$languages[$i]['id']."' ORDER BY products_extra_fields_order");
+          if ( tep_db_num_rows($extra_fields_names_query) > 0 ) {
+?>
+          <b><!-- Extra Fields --><?php echo TEXT_EXTRA_FIELDS?></b><br>
+          <table border="0" cellspacing="2" cellpadding="2">
+<?php
+            while ($extra_fields_names = tep_db_fetch_array($extra_fields_names_query)) {
+              $extra_field_name[$extra_fields_names['products_extra_fields_id']] = $extra_fields_names['products_extra_fields_name'];
+//Kiran Mod
+?>
+            <tr bgcolor="#F0F9FF">
+              <td class="main" align="right"><b><?php echo $extra_fields_names['products_extra_fields_name'];?> : </b></td>
+              <td class="main" align="left"><b><?php echo $extra_fields_array[$extra_fields_names['products_extra_fields_id']];?></b></td>
+            </tr>
+<?php
+            }     
+?>
+          </table>
+          <br>
+<?php
+           }
+//Kiran Mod End
+// END: Extra Fields Contribution
+?>
+        </td>
+        </td>
+      </tr>
+      <?php
+      if ($pInfo->products_url) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url); ?></td>
+      </tr>
+      <?php
+      }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <?php
+      if ($pInfo->products_date_available > date('Y-m-d')) {
+?>
+      <tr>
+        <td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_AVAILABLE, tep_date_long($pInfo->products_date_available)); ?></td>
+      </tr>
+      <?php
+      } else {
+?>
+      <tr>
+        <td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_ADDED, tep_date_long($pInfo->products_date_added)); ?></td>
+      </tr>
+      <?php
+      }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <?php
+    }
+//Kiran mod
+?>
+      <tr>
+        <td><fieldset>
+          <legend><b><!-- Extra Images --><?php echo TEXT_EXTRA_IMAGES?></b></legend>
+          <!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! // -->
+          <?php if ($products_image_xl_1_name) { ?>
+          <script language="javascript"><!--
+      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_sm_1_name) . '\\\')">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_1_name, $products_image_sm_1_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"') . '</a>'; ?>');
+//--></script>
+          <?php } elseif ($products_image_sm_1_name) { ?>
+          <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_1_name, $products_image_sm_1_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"'); }; ?>
+          <?php if ($products_image_xl_2_name) { ?>
+          <script language="javascript"><!--
+      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_sm_2_name) . '\\\')">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_2_name, $products_image_sm_2_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"') . '</a>'; ?>');
+//--></script>
+          <?php } elseif ($products_image_sm_2_name) { ?>
+          <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_2_name, $products_image_sm_2_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"'); }; ?>
+          <?php if ($products_image_xl_3_name) { ?>
+          <script language="javascript"><!--
+      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_sm_3_name) . '\\\')">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_3_name, $products_image_sm_3_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"') . '</a>'; ?>');
+//--></script>
+          <?php } elseif ($products_image_sm_3_name) { ?>
+          <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_3_name, $products_image_sm_3_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"'); }; ?>
+          <?php if ($products_image_xl_4_name) { ?>
+          <script language="javascript"><!--
+      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_sm_4_name) . '\\\')">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_4_name, $products_image_sm_4_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"') . '</a>'; ?>');
+//--></script>
+          <?php } elseif ($products_image_sm_4_name) { ?>
+          <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_4_name, $products_image_sm_4_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"'); }; ?>
+          <?php if ($products_image_xl_5_name) { ?>
+          <script language="javascript"><!--
+      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_sm_5_name) . '\\\')">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_5_name, $products_image_sm_5_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"') . '</a>'; ?>');
+//--></script>
+          <?php } elseif ($products_image_sm_5_name) { ?>
+          <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_5_name, $products_image_sm_5_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="5" vspace="5"'); }; ?>
+          <?php if ($products_image_xl_6_name) { ?>
+          <script language="javascript"><!--
+      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'image=' . $products_image_sm_6_name) . '\\\')">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_6_name, $products_image_sm_6_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="6" vspace="6"') . '</a>'; ?>');
+//--></script>
+          <?php } elseif ($products_image_sm_6_name) { ?>
+          <?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $products_image_sm_6_name, $products_image_sm_6_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="center" hspace="6" vspace="6"'); };?>
+          <!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! // -->
+          </fieldset></td>
+      </tr>
+      <?php
+//kiran mod End
+    if (isset($HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {
+      if (isset($HTTP_GET_VARS['origin'])) {
+        $pos_params = strpos($HTTP_GET_VARS['origin'], '?', 0);
+        if ($pos_params != false) {
+          $back_url = substr($HTTP_GET_VARS['origin'], 0, $pos_params);
+          $back_url_params = substr($HTTP_GET_VARS['origin'], $pos_params + 1);
+        } else {
+          $back_url = $HTTP_GET_VARS['origin'];
+          $back_url_params = '';
+        }
+      } else {
+        $back_url = FILENAME_CATEGORIES;
+        $back_url_params = 'cPath=' . $cPath . '&pID=' . $pInfo->products_id;
+      }
+?>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+      <?php
+    } else {
+?>
+      <tr>
+        <td align="right" class="smallText"><?php
+/////////////////////////////////////////////////////////////////////
+// BOF: WebMakers.com Added: Preview Back
+/* Re-Post all POST'ed variables */
+      reset($HTTP_POST_VARS);
+      while (list($key, $value) = each($HTTP_POST_VARS)) {
+        if (!is_array($HTTP_POST_VARS[$key])) {
+          echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+        } else {
+          while (list($k, $v) = each($value)) {
+            echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v)));
+          }
+        }
+      }
+      $languages = tep_get_languages();
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('products_head_title_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_title_tag[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('products_head_desc_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_desc_tag[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('products_head_keywords_tag[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_head_keywords_tag[$languages[$i]['id']])));
+        echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
+      }
+// START: Extra Fields Contribution DMG
+      if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields.
+        foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) {
+          echo tep_draw_hidden_field('extra_field['.$key.']', stripslashes($val));
+        }
+      } // Check to see if there are any need to update extra fields.
+// END: Extra Fields Contribution DMG
+
+// EOF: WebMakers.com Added: Preview Back
+/////////////////////////////////////////////////////////////////////
+?>
+          <?php
+/////////////////////////////////////////////////////////////////////
+// BOF: WebMakers.com Added: Modified to include Attributes Code
+/* Re-Post all POST'ed variables */
+      reset($HTTP_POST_VARS);
+      while (list($key, $value) = each($HTTP_POST_VARS)) {
+        if (is_array($value)) {
+          while (list($k, $v) = each($value)) {
+            echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v)));
+          }
+        } else {
+          echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+        }
+      }
+// EOF: WebMakers.com Added: Modified to include Attributes Code
+/////////////////////////////////////////////////////////////////////
+      echo tep_draw_hidden_field('products_image', stripslashes($products_image_name));
+// BOF MaxiDVD: Added For Ultimate Images Pack!
+      echo tep_draw_hidden_field('products_image_med', stripslashes($products_image_med_name));
+      echo tep_draw_hidden_field('products_image_lrg', stripslashes($products_image_lrg_name));
+      echo tep_draw_hidden_field('products_image_sm_1', stripslashes($products_image_sm_1_name));
+      echo tep_draw_hidden_field('products_image_xl_1', stripslashes($products_image_xl_1_name));
+      echo tep_draw_hidden_field('products_image_sm_2', stripslashes($products_image_sm_2_name));
+      echo tep_draw_hidden_field('products_image_xl_2', stripslashes($products_image_xl_2_name));
+      echo tep_draw_hidden_field('products_image_sm_3', stripslashes($products_image_sm_3_name));
+      echo tep_draw_hidden_field('products_image_xl_3', stripslashes($products_image_xl_3_name));
+      echo tep_draw_hidden_field('products_image_sm_4', stripslashes($products_image_sm_4_name));
+      echo tep_draw_hidden_field('products_image_xl_4', stripslashes($products_image_xl_4_name));
+      echo tep_draw_hidden_field('products_image_sm_5', stripslashes($products_image_sm_5_name));
+      echo tep_draw_hidden_field('products_image_xl_5', stripslashes($products_image_xl_5_name));
+      echo tep_draw_hidden_field('products_image_sm_6', stripslashes($products_image_sm_6_name));
+      echo tep_draw_hidden_field('products_image_xl_6', stripslashes($products_image_xl_6_name));
+// EOF MaxiDVD: Added For Ultimate Images Pack!
+      echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '&nbsp;&nbsp;';
+
+      if (isset($HTTP_GET_VARS['pID'])) {
+        echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
+      } else {
+        echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
+      }
+      echo '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+?></td>
+      </tr>
+    </table>
+    </form>
+    
+    <?php
+    }
+  } else {
+?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+            <tr>
+              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+              <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+              <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td class="smallText" align="right"><?php
+    echo tep_draw_form('search', FILENAME_CATEGORIES);
+    echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search');
+    echo '</form>';
+?>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td class="smallText" align="right"><?php
+    echo tep_draw_form('goto', FILENAME_CATEGORIES, '', 'get');
+    echo HEADING_TITLE_GOTO . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
+    if (isset($HTTP_GET_VARS[tep_session_name()])) {
+      echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+    }
+    echo '</form>';
+?>
+                    </td>
+                  </tr>
+                </table></td>
+            </tr>
+          </table></td>
+      </tr>
+      <tr>
+        <td>
+        <table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top">
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+              <?php
+    $categories_count = 0;
+    $rows = 0;
+    if (isset($HTTP_POST_VARS['search'])) {
+      $search = tep_db_prepare_input($HTTP_POST_VARS['search']);
+
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and cd.categories_name like '%" . tep_db_input($search) . "%' order by c.sort_order, cd.categories_name");
+    } else {
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");
+    }
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      if ( ! $cID ) $cID = $categories['categories_id'];  // set it if this is the very first time thru
+      $categories_count++;
+      $rows++;
+
+// Get parent_id for subcategories if search
+      if (isset($HTTP_POST_VARS['search'])) $cPath= $categories['parent_id'];
+
+      if ((!isset($HTTP_GET_VARS['cID']) && !isset($HTTP_GET_VARS['pID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $categories['categories_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+        $category_childs = array('childs_count' => tep_childs_in_category_count($categories['categories_id']));
+        $category_products = array('products_count' => tep_products_in_category_count($categories['categories_id']));
+
+        $cInfo_array = array_merge($categories, $category_childs, $category_products);
+        $cInfo = new objectInfo($cInfo_array);
+      }
+
+      if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id) ) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\'">' . "\n";
+      }
+?>
+              <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;<b>' . $categories['categories_name'] . '</b>'; ?></td>
+                <td class="dataTableContent" align="center">&nbsp;</td>
+                <!--td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->
+                categories_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;
+              </td -->
+              
+              <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id'] . '&action=edit_category') . '">' . tep_image(DIR_WS_ICONS . 'edit.gif', ICON_EDIT) . '</a>'; ?>&nbsp;&nbsp;
+                  <?php if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
+&nbsp;</td>
+              </tr>
+              <?php
+    }
+
+    $products_count = 0;
+    if (isset($HTTP_POST_VARS['search'])) {
+      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
+    } else {
+
+// Eversun mod for sppc and qty price breaks    
+      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
+//mod      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price9, p.products_price10, p.products_price11, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_price9_qty, p.products_price10_qty, p.products_price11_qty, p.products_qty_blocks, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
+// Eversun mod end for sppc and qty price breaks 
+
+    }
+    while ($products = tep_db_fetch_array($products_query)) {
+      $products_count++;
+      $rows++;
+
+// Get categories_id for product if search
+      if (isset($HTTP_POST_VARS['search'])) $cPath = $products['categories_id'];
+
+      if ( (!isset($HTTP_GET_VARS['pID']) && !isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['pID']) && ($HTTP_GET_VARS['pID'] == $products['products_id']))) && !isset($pInfo) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+// find out the rating average from customer reviews
+        $reviews_query = tep_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int)$products['products_id'] . "'");
+        $reviews = tep_db_fetch_array($reviews_query);
+        $pInfo_array = array_merge($products, $reviews);
+        $pInfo = new objectInfo($pInfo_array);
+      }
+
+      if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id) ) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '\'">' . "\n";
+      }
+?>
+              <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $products['products_name']; ?></td>
+                <td class="dataTableContent" align="center"><?php
+      if ($products['products_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=0&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products['products_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <!--td class="dataTableContent" align="right"><?php if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->
+                products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;
+              </td -->
+              
+              <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product') . '">' . tep_image(DIR_WS_ICONS . 'edit.gif', ICON_EDIT) . '</a>'; ?>&nbsp;&nbsp;
+                  <?php if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
+&nbsp;</td>
+              </tr>
+              <?php
+    }
+
+    $cPath_back = '';
+    if (sizeof($cPath_array) > 0) {
+      for ($i=0, $n=sizeof($cPath_array)-1; $i<$n; $i++) {
+        if (empty($cPath_back)) {
+          $cPath_back .= $cPath_array[$i];
+        } else {
+          $cPath_back .= '_' . $cPath_array[$i];
+        }
+      }
+    }
+
+    $cPath_back = (tep_not_null($cPath_back)) ? 'cPath=' . $cPath_back . '&' : '';
+?>
+              <tr>
+                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                    <tr>
+                      <td class="smallText"><?php echo TEXT_CATEGORIES . '&nbsp;' . $categories_count . '<br>' . TEXT_PRODUCTS . '&nbsp;' . $products_count; ?></td>
+                      <td align="right" class="smallText"><?php if (sizeof($cPath_array) > 0) echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, $cPath_back . 'cID=' . $current_category_id) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>&nbsp;'; if (!isset($HTTP_POST_VARS['search'])) echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_category') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>&nbsp;<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=new_product') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?>
+&nbsp;</td>
+                    </tr>
+                  </table></td>
+              </tr>
+            </table>
+            </td>
+            <?php
+    $heading = array();
+    $contents = array();
+    switch ($action) {
+      case 'new_category':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_CATEGORY . '</b>');
+
+        $contents = array('form' => tep_draw_form('newcategory', FILENAME_CATEGORIES, 'action=insert_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"'));
+        $contents[] = array('text' => TEXT_NEW_CATEGORY_INTRO);
+
+        $category_inputs_string = '';
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $category_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']');
+        }
+
+        $contents[] = array('text' => '<br>' . TEXT_CATEGORIES_NAME . $category_inputs_string);
+        $contents[] = array('text' => '<br>' . TEXT_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));
+        $contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', '', 'size="2"'));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'edit_category':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CATEGORY . '</b>');
+
+        $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"') . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
+        $contents[] = array('text' => TEXT_EDIT_INTRO);
+
+        $category_inputs_string = '';
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $category_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', tep_get_category_name($cInfo->categories_id, $languages[$i]['id']));
+        }
+
+        $contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
+        $contents[] = array('text' => '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $cInfo->categories_image, $cInfo->categories_name) . '<br>' . DIR_WS_CATALOG_IMAGES . '<br><b>' . $cInfo->categories_image . '</b>');
+        $contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));
+        $contents[] = array('text' => '<br>' . TEXT_EDIT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'delete_category':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CATEGORY . '</b>');
+
+        $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=delete_category_confirm&cPath=' . $cPath) . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
+        $contents[] = array('text' => TEXT_DELETE_CATEGORY_INTRO);
+        $contents[] = array('text' => '<br><b>' . $cInfo->categories_name . '</b>');
+        if ($cInfo->childs_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_CHILDS, $cInfo->childs_count));
+        if ($cInfo->products_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $cInfo->products_count));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'move_category':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_CATEGORY . '</b>');
+
+        $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=move_category_confirm&cPath=' . $cPath) . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
+        $contents[] = array('text' => sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name));
+        $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $cInfo->categories_name) . '<br>' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'delete_product':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_PRODUCT . '</b>');
+
+        $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=delete_product_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
+        $contents[] = array('text' => TEXT_DELETE_PRODUCT_INTRO);
+        $contents[] = array('text' => '<br><b>' . $pInfo->products_name . '</b>');
+
+        $product_categories_string = '';
+        $product_categories = tep_generate_category_path($pInfo->products_id, 'product');
+        for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) {
+          $category_path = '';
+          for ($j = 0, $k = sizeof($product_categories[$i]); $j < $k; $j++) {
+            $category_path .= $product_categories[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
+          }
+          $category_path = substr($category_path, 0, -16);
+          $product_categories_string .= tep_draw_checkbox_field('product_categories[]', $product_categories[$i][sizeof($product_categories[$i])-1]['id'], true) . '&nbsp;' . $category_path . '<br>';
+        }
+        $product_categories_string = substr($product_categories_string, 0, -4);
+
+        $contents[] = array('text' => '<br>' . $product_categories_string);
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'move_product':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_PRODUCT . '</b>');
+
+        $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=move_product_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
+        $contents[] = array('text' => sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
+        $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $pInfo->products_name) . '<br>' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'copy_to':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
+
+        $contents = array('form' => tep_draw_form('copy_to', FILENAME_CATEGORIES, 'action=copy_to_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
+        $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
+        $contents[] = array('text' => '<br>' . TEXT_CATEGORIES . '<br>' . tep_draw_pull_down_menu('categories_id', tep_get_category_tree(), $current_category_id));
+        $contents[] = array('text' => '<br>' . TEXT_HOW_TO_COPY . '<br>' . tep_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br>' . tep_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);
+// BOF: WebMakers.com Added: Attributes Copy
+        $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+        // only ask about attributes if they exist
+        if (tep_has_product_attributes($pInfo->products_id)) {
+          $contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES_ONLY);
+          $contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);
+          $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'));
+          $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+        }
+// EOF: WebMakers.com Added: Attributes Copy
+
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+
+/////////////////////////////////////////////////////////////////////
+// WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
+      case 'copy_product_attributes':
+        $copy_attributes_delete_first='1';
+        $copy_attributes_duplicates_skipped='1';
+        $copy_attributes_duplicates_overwrite='0';
+
+        if (DOWNLOAD_ENABLED == 'true') {
+          $copy_attributes_include_downloads='1';
+          $copy_attributes_include_filename='1';
+        } else {
+          $copy_attributes_include_downloads='0';
+          $copy_attributes_include_filename='0';
+        }
+
+        //$heading[] = array('text' => '<b>' . 'Copy Attributes to another product' . '</b>');
+        $heading[] = array('text' => '<b>' . TEXT_COPY_ATTRIBUTES_TO_ANOTHER_PRODUCT . '</b>');
+        $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes&cPath=' . $cPath . '&pID=' . $pInfo->products_id) . tep_draw_hidden_field('products_id', $pInfo->products_id) . tep_draw_hidden_field('products_name', $pInfo->products_name));
+        $contents[] = array('text' => '<br>'.TEXT_COPYING_ATTRIBUTES_FROM.' #' . $pInfo->products_id . '<br><b>' . $pInfo->products_name . '</b>');
+       // $contents[] = array('text' => 'Copying Attributes to #&nbsp;' . tep_draw_input_field('copy_to_products_id', $copy_to_products_id, 'size="3"'));
+        $contents[] = array('text' => TEXT_COPYING_ATTRIBUTES_TO.' #&nbsp;' . tep_draw_input_field('copy_to_products_id', $copy_to_products_id, 'size="3"'));
+       // $contents[] = array('text' => '<br>Delete ALL Attributes and Downloads before copying&nbsp;' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
+        $contents[] = array('text' => '<br>'.TEXT_DELETE_ALL_ATTRIBUTE.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
+        $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+        //$contents[] = array('text' => '<br>' . 'Otherwise ...');
+        $contents[] = array('text' => '<br>' . TEXT_OTHERWISE);
+        //$contents[] = array('text' => 'Duplicate Attributes should be skipped&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
+        $contents[] = array('text' => TEXT_DUPLICATE_ATTRIBUTES_SKIPPED.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
+      //  $contents[] = array('text' => '&nbsp;&nbsp;&nbsp;Duplicate Attributes should be overwritten&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
+        $contents[] = array('text' => '&nbsp;&nbsp;&nbsp;'.TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
+        if (DOWNLOAD_ENABLED == 'true') {
+          //$contents[] = array('text' => '<br>Copy Attributes with Downloads&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
+
+          $contents[] = array('text' => '<br>'.TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
+
+          // Not used at this time - download name copies if download attribute is copied
+          // $contents[] = array('text' => '&nbsp;&nbsp;&nbsp;Include Download Filenames&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_filename',$copy_attributes_include_filename, 'size="2"'));
+        }
+        $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . PRODUCT_NAMES_HELPER);
+        if ($pID) {
+          $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER);
+        } else {
+          //$contents[] = array('align' => 'center', 'text' => '<br>Select a product for display');
+          $contents[] = array('align' => 'center', 'text' => '<br>'.TEXT_SELECT_PRODUCT_FOR_DISPLAY);
+        }
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', 'Copy Attribtues') . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+// WebMakers.com Added: Copy Attributes Existing Product to All Products in Category
+      case 'copy_product_attributes_categories':
+        $copy_attributes_delete_first='1';
+        $copy_attributes_duplicates_skipped='1';
+        $copy_attributes_duplicates_overwrite='0';
+
+        if (DOWNLOAD_ENABLED == 'true') {
+          $copy_attributes_include_downloads='1';
+          $copy_attributes_include_filename='1';
+        } else {
+          $copy_attributes_include_downloads='0';
+          $copy_attributes_include_filename='0';
+        }
+
+       // $heading[] = array('text' => '<b>' . 'Copy Product Attributes to Category ...' . '</b>');
+        $heading[] = array('text' => '<b>' . TEXT_COPY_PRODUCT_ATTRIBUTES_TO_CATEGORY . '</b>');
+        $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes_categories&cPath=' . $cPath . '&cID=' . $cID . '&make_copy_from_products_id=' . $copy_from_products_id));
+       
+    //$contents[] = array('text' => 'Copy Product Attributes from Product ID#&nbsp;' . tep_draw_input_field('make_copy_from_products_id', $make_copy_from_products_id, 'size="3"'));
+
+    $contents[] = array('text' => TEXT_COPY_PRODUCT_ATTRIBUTES_FROM_PRODUCT_ID.'#&nbsp;' . tep_draw_input_field('make_copy_from_products_id', $make_copy_from_products_id, 'size="3"'));
+
+        //$contents[] = array('text' => '<br>Copying to all products in Category ID#&nbsp;' . $cID . '<br>Category Name: <b>' . tep_get_category_name($cID, $languages_id) . '</b>');
+        $contents[] = array('text' => '<br>'.TEXT_COPYING_TO_ALL_PRODUCTS_IN_CATEGORY_ID.'#&nbsp;' . $cID . '<br>'.TEXT_CATEGORY_NAME.'<b>' . tep_get_category_name($cID, $languages_id) . '</b>');
+
+        //$contents[] = array('text' => '<br>Delete ALL Attributes and Downloads before copying&nbsp;' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
+        $contents[] = array('text' => '<br>'.TEXT_DELETE_ALL_ATTRIBUTE.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
+
+
+        $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+       // $contents[] = array('text' => '<br>' . 'Otherwise ...');
+        $contents[] = array('text' => '<br>' . TEXT_OTHERWISE);
+        //$contents[] = array('text' => 'Duplicate Attributes should be skipped&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
+        $contents[] = array('text' => TEXT_DUPLICATE_ATTRIBUTES_SKIPPED.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
+
+        //$contents[] = array('text' => '&nbsp;&nbsp;&nbsp;Duplicate Attributes should be overwritten&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
+        $contents[] = array('text' => '&nbsp;&nbsp;&nbsp;'.TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
+        if (DOWNLOAD_ENABLED == 'true') {
+          //$contents[] = array('text' => '<br>Copy Attributes with Downloads&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
+          $contents[] = array('text' => '<br>'.TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS.'&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
+          // Not used at this time - download name copies if download attribute is copied
+          // $contents[] = array('text' => '&nbsp;&nbsp;&nbsp;Include Download Filenames&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_filename',$copy_attributes_include_filename, 'size="2"'));
+        }
+        $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . PRODUCT_NAMES_HELPER);
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', 'Copy Attribtues') . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      default:
+        if ($rows > 0) {
+          if (isset($cInfo) && is_object($cInfo)) { // category info box contents
+            $heading[] = array('text' => '<b>' . $cInfo->categories_name . '</b>');
+
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');
+            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
+            if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
+            $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->categories_image);
+            $contents[] = array('text' => '<br>' . TEXT_SUBCATEGORIES . ' ' . $cInfo->childs_count . '<br>' . TEXT_PRODUCTS . ' ' . $cInfo->products_count);
+            if ($cInfo->childs_count==0 and $cInfo->products_count >= 1) {
+// WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in Category
+              $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+              if ($cID) {
+                $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID . '&action=copy_product_attributes_categories') . '">' . 'Copy Product Attributes to <br>ALL products in Category: ' . tep_get_category_name($cID, $languages_id) . '<br>' . tep_image_button('button_copy_to.gif', 'Copy Attributes') . '</a>');
+              } else {
+                $contents[] = array('align' => 'center', 'text' => '<br>Select a Category to copy attributes to');
+              }
+            }
+          } elseif (isset($pInfo) && is_object($pInfo)) { // product info box contents
+            $heading[] = array('text' => '<b>' . tep_get_products_name($pInfo->products_id, $languages_id) . '</b>');
+
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>'); // VJ attrib admin changed
+
+            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($pInfo->products_date_added));
+            if (tep_not_null($pInfo->products_last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($pInfo->products_last_modified));
+            if (date('Y-m-d') < $pInfo->products_date_available) $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . tep_date_short($pInfo->products_date_available));
+            $contents[] = array('text' => '<br>' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $pInfo->products_image);
+            $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
+            $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');
+// WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
+            $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_product_attributes') . '">' . 'Products Attributes Copier:<br>' . tep_image_button('button_copy_to.gif', 'Copy Attributes') . '</a>');
+            if ($pID) {
+              $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'));
+            } else {
+              //$contents[] = array('align' => 'center', 'text' => '<br>Select a product to display attributes');
+              $contents[] = array('align' => 'center', 'text' => '<br>'.TEXT_SELECT_PRODUCT_TO_DISPLAY_ATTRIBUTES);
+            }
+          }
+        } else { // create category/product info
+          $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');
+
+          $contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS);
+        }
+        break;
+    }
+
+    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+      echo '            <td width="25%" valign="top">' . "\n";
+
+      $box = new box;
+      echo $box->infoBox($heading, $contents);
+
+      echo '            </td>' . "\n";
+    }
+?>
+          </tr>
+        </table>
+        </td>
+      </tr>
+    </table>
+    <?php
+  }
+?>
+    </td>
+    
+    <!-- body_text_eof //-->
+    </tr>
+    
+  </table>
+  <!-- body_eof //-->
+  <!-- footer //-->
+  <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+  <!-- footer_eof //-->
+  <br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/check_lang.php
===================================================================
--- trunk/direct.openmoko.com/admin/check_lang.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/check_lang.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,495 @@
+<?php
+// W Godefroy
+//  OSCommerce language integrity verification
+//
+// For latest info check:
+// http://buzzy.belgoline.com/hacks/fldr_checklang
+//
+// Copyright (C) 2005 W Godefroy
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+
+//require('includes/application_top.php');
+define('DIR_WS_INCLUDES', "includes/");
+
+$timeparts = explode(' ',microtime());
+$starttime = $timeparts[1].substr($timeparts[0],1);
+
+function tep_show_array_table(&$myarray, $title, $lev=0) 
+{
+    if($lev) 
+  echo "<table >";
+    else
+  echo "<table border=1 >";
+
+    echo "\n<tr><th colspan=2>$title</th></tr>";
+    foreach($myarray as $key => $values) {
+  echo "<tr><td> $key </td>\n  <td>";
+  if(is_array($values)) {
+      tep_show_array_table($values, $key, $lev + 1);
+  } else {
+      echo "$values";
+  }
+  echo "</td></tr>\n";
+    }
+    echo "</table>";
+}
+
+function tep_show_env() 
+{
+    
+    global $HTTP_SERVER_VARS, $HTTP_ENV_VARS, $HTTP_COOKIE_VARS, $HTTP_GET_VARS;
+    global $HTTP_POST_VARS, $HTTP_SESSION_VARS;
+
+    tep_show_array_table($HTTP_SERVER_VARS, "HTTP_SERVER_VARS");
+    echo"<br>";
+    
+    tep_show_array_table($HTTP_ENV_VARS, "HTTP_ENV_VARS");
+    echo"<br>";
+
+    tep_show_array_table($HTTP_COOKIE_VARS, "HTTP_COOCKIE_VARS");
+    echo"<br>";
+
+    tep_show_array_table($HTTP_GET_VARS, "HTTP_GET_VARS");
+    echo"<br>";
+
+    tep_show_array_table($HTTP_POST_VARS, "HTTP_POST_VARS");
+    echo"<br>";
+
+    tep_show_array_table($HTTP_SESSION_VARS, "HTTP_SESSION_VARS");
+    echo"<br>";
+}
+  
+
+function tep_scan_lang_dirs(&$lar, $lang_dir) {
+    if(is_dir($lang_dir)) {
+  if ($dh = opendir($lang_dir)) {
+      while (false !== ($file = readdir($dh))) {
+    $fpath = $lang_dir . $file;
+      
+    if(is_file($fpath)) {
+        if($lang_name = tep_is_lang_file($fpath)) {
+      $lar[$lang_name]["__filename__"] = $fpath;
+        }
+    }
+      }
+  closedir($dh);
+  }
+    } else {
+  //die("FATAL ERROR: Cannot open language dir: $lang_dir");
+  die(ERROR_CANNOT_OPEN_LANGUAGE_DIR.$lang_dir);
+    }
+}
+
+function tep_is_lang_file($file_name) 
+{
+    $match_pattern = '/(\w+)\.php$/';
+
+    if(preg_match($match_pattern,$file_name,$matches)) {
+  return $matches[1];
+    } else {
+  return 0;
+    }    
+}
+
+function tep_read_files_in_dir($dir_name) 
+{
+    $result = array();
+
+
+    $dirlist = array($dir_name);
+    
+    while($dirlist) {
+  $currdir = array_pop($dirlist);
+  
+  if($dh = opendir($currdir)) {
+      
+      while(false !== ($dire = readdir($dh))) {
+    $fpath = $currdir . '/' . $dire;
+    
+    if(is_file($fpath)) {
+        $result[] = $fpath;
+    } elseif(is_dir($fpath) && $dire != ".." && $dire != "." && $dire != "CVS") {
+        $dirlist[] = $fpath;
+    }
+      }
+      
+      
+  }
+    }
+    
+    return $result;
+}
+
+
+function tep_read_lang_files(&$lar) 
+{
+    foreach ($lar as $key => $value) {
+  //read lang directory
+  $landir = dirname($value["__filename__"]) . "/$key";
+
+  $lar[$key] += tep_read_files_in_dir($landir);
+    }
+}
+
+
+function tep_neuter_lang($lname, $str) 
+{
+    if(preg_match("/(.+)\/$lname(.+)/",$str,$matches)) {
+  return $matches[2];
+    } else {
+  return basename($str);
+    }
+}
+
+
+function tep_create_lang_neutral(&$lar) 
+{
+    $neutral_file_list = array();
+    foreach($lar as $lang => $flist) 
+  foreach($flist as $fname) {
+      $neutral_file = tep_neuter_lang($lang, $fname);
+      if(!(array_search($neutral_file, $neutral_file_list) !== false))
+    $neutral_file_list[] = $neutral_file;
+  }
+
+    return $neutral_file_list;
+}
+
+
+function tep_new_show_missing_files(&$lar) 
+{
+    $lang_list = array_keys($lar);
+
+    $neutral_file_list = tep_create_lang_neutral($lar);
+
+    echo "<table border=1>";
+    echo "<tr><th>".CHECK_LANG_FILENAME."</th><th>".CHECK_LANG_MISSING_IN."</th></tr>\n";
+    $found_errors = 0;
+    foreach($neutral_file_list as $file_name) {
+  $total = 0;
+  $missing = 0;
+  foreach($lang_list as $lang) {
+      $lang_file = DIR_WS_INCLUDES . "languages/$lang" . $file_name;
+
+      $total++;
+      if(!is_file($lang_file)) {
+    $missing++;
+    $missing_lang .= " [$lang]";
+      } else
+    $lang_found = $lang;
+  }
+
+  if($missing_lang) {
+      $found_errors = 1;
+      
+      $gen_file = "languages/<i>[LANG_NAME]</i>" . $file_name;
+      echo "<tr><td>$gen_file</td><td>";
+
+      if($missing >= $total - 1) 
+    echo "<i>".CHECK_LANG_ALL_BUT." $lang_found</i>";
+      else
+    echo $missing_lang;
+
+      echo "</td></tr>\n";
+  }
+    }
+    if(!$found_errors) 
+  echo "<tr><td colspan=2><i>".CHECK_LANG_NONE_FOUND."</i></td></tr>\n";
+    
+    echo "</table>";
+}
+
+function tep_read_lang_words($lang, $file_base) {
+    $file_name = DIR_WS_INCLUDES . "languages/$lang" . $file_base;
+
+    $result = array();
+    
+    if(is_file($file_name)) {
+  $handle = fopen($file_name, "r");
+  while(!feof($handle)) {
+      $fline = fgets($handle);
+      if(preg_match("/define\s*\(\s*(\'|\")(\w+)(\'|\")\s*,\s*(.+)\s*\)\s*;/",$fline,$matches)) {
+    $result[$matches[2]] = $matches[4];
+      }
+  }
+    }
+
+    return $result;
+}
+
+// this function is equal to tep_new_show_missing_def but a few subtile
+// differences which would make a single function for both just unreadable
+function tep_new_show_equal_def(&$lar) 
+{
+    global $my_url;
+
+    $file_defs_checked = array();
+
+    $lang_list = array_keys($lar);
+
+    $neutral_file_list = tep_create_lang_neutral($lar);
+
+    echo "<table border=1>";
+    echo "<tr><th>".CHECK_LANG_FOUND_IN."</th><th>".CHECK_LANG_DEFINITION_NAME."</th><th>".CHECK_LANG_EQUAL_TO."</th><th>".CHECK_LANG_REFERENCES."</th></tr>\n";
+    foreach($neutral_file_list as $neuter_file) {
+  $first_missing_in_file = 1;
+
+  //create word-definition array
+  $war = array();
+  foreach($lang_list as $lang) 
+      $war[$lang] = tep_read_lang_words($lang, $neuter_file);
+  
+  $def_lang_checked = array();
+  foreach($war as $lang => $lang_def) {
+      foreach($lang_def as $def_name => $def_val) {
+    $total = 0;
+    $matches = 0;
+    $lang_equal = "";
+
+    //keep list of verified ($def_name,$lang)'s to avoid dupes
+    $def_lang = "$def_name $lang";
+    if(!(array_search($def_lang, $def_lang_checked) !== false)) {
+        $def_lang_checked[] = $def_lang;
+
+        foreach($lang_list as $lang_comp) 
+      if($lang_comp != $lang) {
+          $total++;
+
+          if($war[$lang][$def_name] == $war[$lang_comp][$def_name]) {
+        $matches++;
+        $lang_equal .= " [$lang_comp]";
+
+        //add to the list to avoid dupes
+        $def_lang = "$def_name $lang_comp";
+        $def_lang_checked[] = $def_lang;
+          }
+      }
+
+        if($matches) {
+      if($first_missing_in_file) {
+          $first_missing_in_file = 0;
+          echo "<tr><th colspan=3>includes/<i>[LANG_NAME]</i>$neuter_file</th><td></td></tr>\n";
+      }
+
+      echo "<tr><td>$lang</td><td>$def_name</td><td>";
+      if($matches == $total) 
+          echo "<i>".CHECK_LANG_ALL_EQUAL."</i>";
+      else
+          echo $lang_equal;
+
+      echo "</td><td><a href='$my_url?find_def=$def_name&file_name=$neuter_file'>".CHECK_LANG_WHERE_USED."</a></td></tr>\n";   
+        }
+    }
+      }
+  }
+    }
+    echo "</table>";
+}
+
+function tep_new_show_missing_def(&$lar) 
+{
+    global $my_url;
+
+    $file_defs_checked = array();
+
+    $lang_list = array_keys($lar);
+
+    $neutral_file_list = tep_create_lang_neutral($lar);
+
+    //itterate all files to find missing files
+    echo "<table border=1>";
+    echo "<tr><th>".CHECK_LANG_FOUND_FOR."</th><th>".CHECK_LANG_DEFINITION_NAME."</th><th>'".CHECK_LANG_MISSING_FOR."'</th><th>".CHECK_LANG_REFERENCES."</th></tr>\n";
+
+    foreach ($neutral_file_list as $neuter_file) {
+  $first_missing_in_file = 1;
+  
+  //create word-definition array
+  $war = array();
+  foreach($lang_list as $lang) 
+      $war[$lang] = tep_read_lang_words($lang, $neuter_file);
+
+  //check definitions are present for all files
+  $defs_checked = array();
+  foreach($war as $lang => $lang_def) {
+      foreach($lang_def as $def_name => $def_val) {
+    $total = 0;
+    $missing = 0;
+    $lang_missing = "";
+
+    //keep list of verified $def_name's to avoid dupes
+    if(!(array_search($def_name, $defs_checked) !== false)) {
+        $defs_checked[] = $def_name;
+
+        foreach($lang_list as $lang_comp) 
+      if($lang_comp != $lang) {
+          $total++;
+
+//          echo "<br>search $def_name ($lang_comp) in";
+//          print_r($war[$lang_comp]);
+          
+          if(!isset($war[$lang_comp][$def_name])) {
+        $missing++;
+        $lang_missing .= " [$lang_comp]";
+          }
+      }
+
+        if($missing) {
+      if($first_missing_in_file) {
+          $first_missing_in_file = 0;
+          echo "<tr><th colspan=3>includes/<i>[LANG_NAME]</i>$neuter_file</th><td></td></tr>\n";          
+      }
+
+      echo "<tr><td>$lang</td><td>$def_name</td><td>";
+
+      if($missing == $total) 
+          echo "<i>".CHECK_LANG_ALL_BUT." $lang</i>";
+      else
+          echo $lang_missing;
+
+
+      echo "</td><td><a href='$my_url?find_def=$def_name&file_name=$neuter_file'>".CHECK_LANG_WHERE_USED."</a></td></tr>\n";   
+        }
+    }
+      }
+  }
+    }
+    echo "</table>";
+}
+
+function tep_file_contains($def_name, $file_name) 
+{    
+    $contents = file_get_contents($file_name);
+
+    if(strstr($contents, $def_name))
+  return 1;
+    else
+  return 0;
+}    
+    
+function tep_find_occurences($def_name, $dir, $bstr = "") 
+{
+    global $my_url;
+
+    $file_list = tep_read_files_in_dir($dir);
+
+    $none_found = 1;
+    $line_buf = "";
+    echo "<table>\n<tr><th>".CHECK_LANG_FILE_NAME."</th></tr>\n";
+    foreach($file_list as $file) {
+  if(!strstr($file,"/languages/") &&
+     is_file($file) &&
+     tep_file_contains($def_name, $file)) {
+      $none_found = 0;
+      
+      if(strstr($file, $bstr)) 
+    echo "<tr><td><b>$file</b></td></tr>\n";
+      else
+    $line_buf .= "<tr><td>$file</td></tr>\n";
+  }
+    }
+    
+    
+    if($none_found) 
+  echo "<tr><td cospan=2 align=center><i>".CHECK_LANG_NONE_FOUND."</i></td></tr>\n";
+    elseif($line_buf)
+  echo $line_buf;
+  
+    echo "</table><br>";
+}
+
+function tep_show_main_menu($my_url) 
+{
+    echo "<table>
+<tr><th colspan=2>".CHECK_LANG_SELECT_OPTION."</th></tr>
+<tr><td>".CHECK_LANG_TO_CHECK_FILE_CONSISTENCY."</td>      <td><a href='$my_url?check_file=1'>".CHECK_LANG_CLICK_HERE."</a></td></tr>
+<tr><td>".CHECK_LANG_TO_CHECK_DEFINITION_CONSISTENCY."</td><td><a href='$my_url?check_def=1'>".CHECK_LANG_CLICK_HERE."</a></td></tr>
+<tr><td>".CHECK_LANG_TO_CHECK_EQUAL_DEFINITIONS."</td>     <td><a href='$my_url?check_eq=1'>".CHECK_LANG_CLICK_HERE."</a></td></tr>
+</table>";
+
+}
+
+function tep_show_footer($my_url, $my_ref, $starttime) {
+    
+    echo "\n\n<br><a href='$my_url'>".CHECK_LANG_HOME."</a> - <a href='$my_ref'>".CHECK_LANG_BACK."</a>";
+    
+    $timeparts = explode(' ',microtime());
+    $endtime = $timeparts[1].substr($timeparts[0],1);
+    echo "<br><h6> ".CHECK_LANG_W_GODEFROY." - check_lang.php\n";
+    echo " - ".CHECK_LANG_EXECUTION_TIME." " . bcsub($endtime,$starttime,6);
+    echo " s </h6>";
+}
+
+
+//////////////////////////// PROGRAM START \\\\\\\\\\\\\\\\\\\\\\\\\ 
+
+echo "<html>
+<head>
+<title>".CHECK_LANG_TITLE."</title>
+</head>
+<body>\n";
+
+//tep_show_env();
+
+$lang_dir = DIR_WS_INCLUDES . 'languages/';
+$my_url = $HTTP_SERVER_VARS["PHP_SELF"];
+$my_file = $HTTP_SERVER_VARS["PATH_TRANSLATED"];
+$my_ref = $HTTP_SERVER_VARS["HTTP_REFERER"];
+
+if(isset($HTTP_GET_VARS["find_def"])) {
+    echo "<h3>".CHECK_LANG_LIST_OF_FILES_USING." " . $HTTP_GET_VARS["find_def"] . "</h3><br>\n";
+    
+    tep_find_occurences($HTTP_GET_VARS["find_def"],
+      dirname($my_file),
+      $HTTP_GET_VARS["file_name"]);
+
+} elseif(isset($HTTP_GET_VARS["check_file"])) {
+    $lar = array();
+
+    echo "<h3>".CHECK_LANG_LIST_OF_FILES_PRESENT_FOR_ONE_LANGUAGE."</h3><br>\n";
+
+    tep_scan_lang_dirs($lar, $lang_dir);
+    
+    tep_read_lang_files($lar);
+    
+//    tep_show_missing_files($lar);
+    tep_new_show_missing_files($lar);
+
+} elseif(isset($HTTP_GET_VARS["check_def"])) {
+echo "<h3>".CHECK_LANG_LIST_OF_PHRASE_PRESENT_FOR_ONE_LANGUAGE."</h3><br>\n";
+
+    tep_scan_lang_dirs($lar, $lang_dir);
+    tep_read_lang_files($lar);    
+    //tep_show_missing_equal_def($lar);
+    tep_new_show_missing_def($lar);
+
+} elseif(isset($HTTP_GET_VARS["check_eq"])) {
+    echo "<h3>".CHECK_LANG_LIST_OF_PHRASE_DEFINITIONS_EQUAL."</h3><br>\n";
+    tep_scan_lang_dirs($lar, $lang_dir);
+    tep_read_lang_files($lar);
+    //tep_show_missing_equal_def($lar, 1);
+    tep_new_show_equal_def($lar);
+    
+}  else {
+    tep_show_main_menu($my_url);
+}
+
+
+tep_show_footer($my_url, $my_ref, $starttime);
+
+echo "</body></html>\n";
+
+?>

Added: trunk/direct.openmoko.com/admin/configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,203 @@
+<?php
+/*
+  $Id: configuration.php,v 1.1.1.1 2004/03/04 23:38:18 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+Header("Cache-control: private, no-cache");
+Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Past date
+Header("Pragma: no-cache");
+
+  require('includes/application_top.php');
+
+  // #CP - local dir to the template directory where you are uploading the company logo
+  $template_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_TEMPLATE'");
+  $template = tep_db_fetch_array($template_query);
+  $CURR_TEMPLATE = $template['configuration_value'] . '/';
+
+  $upload_fs_dir = DIR_FS_TEMPLATES.$CURR_TEMPLATE.DIR_WS_IMAGES;
+  $upload_ws_dir = DIR_WS_TEMPLATES.$CURR_TEMPLATE.DIR_WS_IMAGES;
+  // #CP
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'save':
+        $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);
+        $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+        break;
+// #CP - supporting functions to upload company logo to template images directory
+    }
+// #CP
+  }
+
+  $gID = (isset($HTTP_GET_VARS['gID'])) ? $HTTP_GET_VARS['gID'] : 1;
+
+  $cfg_group_query = tep_db_query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '" . (int)$gID . "'");
+  $cfg_group = tep_db_fetch_array($cfg_group_query);
+
+// check if the template image directory exists
+//  if (is_dir($upload_fs_dir)) {
+//     $messageStack->add('search', ERROR_TEMPLATE_IMAGE_DIRECTORY_DOES_NOT_EXIST . $upload_fs_dir, 'error');
+//  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo $cfg_group['configuration_group_title']; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '" . (int)$gID . "' order by sort_order");
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+    if (tep_not_null($configuration['use_function'])) {
+      $use_function = $configuration['use_function'];
+      if (ereg('->', $use_function)) {
+        $class_method = explode('->', $use_function);
+        if (!is_object(${$class_method[0]})) {
+          include(DIR_WS_CLASSES . $class_method[0] . '.php');
+          ${$class_method[0]} = new $class_method[0]();
+        }
+        $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
+      } else {
+        $cfgValue = tep_call_function($use_function, $configuration['configuration_value']);
+      }
+    } else {
+      $cfgValue = $configuration['configuration_value'];
+    }
+
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cfg_extra_query = tep_db_query("select configuration_key, configuration_description, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . (int)$configuration['configuration_id'] . "'");
+      $cfg_extra = tep_db_fetch_array($cfg_extra_query);
+
+      $cInfo_array = array_merge($configuration, $cfg_extra);
+      $cInfo = new objectInfo($cInfo_array);
+    }
+
+    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
+      if($cInfo->set_function == 'file_upload'){
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=upload') . '\'">' . "\n";
+      } else {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
+      }
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $configuration['configuration_title']; ?></td>
+                <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'edit':
+      $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function) {
+        eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value) . '");');
+      } else {
+        $value_field = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
+      }
+
+      $contents = array('form' => tep_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function == 'file_upload') {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=upload') . '">' . tep_image_button('button_upload.gif', IMAGE_EDIT) . '</a>'.'<p>');
+        $contents[] = array('align' => 'center', 'text' => tep_image($upload_ws_dir . $cInfo->configuration_value, IMAGE_EDIT));
+      } else {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+      }
+        $contents[] = array('text' => '<br>' . $cInfo->configuration_description);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
+        if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
+      }
+
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/countries.php
===================================================================
--- trunk/direct.openmoko.com/admin/countries.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/countries.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,204 @@
+<?php
+/*
+  $Id: countries.php,v 1.1.1.1 2004/03/04 23:38:18 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+        $countries_name = tep_db_prepare_input($HTTP_POST_VARS['countries_name']);
+        $countries_iso_code_2 = tep_db_prepare_input($HTTP_POST_VARS['countries_iso_code_2']);
+        $countries_iso_code_3 = tep_db_prepare_input($HTTP_POST_VARS['countries_iso_code_3']);
+        $address_format_id = tep_db_prepare_input($HTTP_POST_VARS['address_format_id']);
+
+        tep_db_query("insert into " . TABLE_COUNTRIES . " (countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) values ('" . tep_db_input($countries_name) . "', '" . tep_db_input($countries_iso_code_2) . "', '" . tep_db_input($countries_iso_code_3) . "', '" . (int)$address_format_id . "')");
+
+        tep_redirect(tep_href_link(FILENAME_COUNTRIES));
+        break;
+      case 'save':
+        $countries_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+        $countries_name = tep_db_prepare_input($HTTP_POST_VARS['countries_name']);
+        $countries_iso_code_2 = tep_db_prepare_input($HTTP_POST_VARS['countries_iso_code_2']);
+        $countries_iso_code_3 = tep_db_prepare_input($HTTP_POST_VARS['countries_iso_code_3']);
+        $address_format_id = tep_db_prepare_input($HTTP_POST_VARS['address_format_id']);
+
+        tep_db_query("update " . TABLE_COUNTRIES . " set countries_name = '" . tep_db_input($countries_name) . "', countries_iso_code_2 = '" . tep_db_input($countries_iso_code_2) . "', countries_iso_code_3 = '" . tep_db_input($countries_iso_code_3) . "', address_format_id = '" . (int)$address_format_id . "' where countries_id = '" . (int)$countries_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $countries_id));
+        break;
+      case 'deleteconfirm':
+        $countries_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("delete from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="center" colspan="2"><?php echo TABLE_HEADING_COUNTRY_CODES; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $countries_query_raw = "select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id from " . TABLE_COUNTRIES . " order by countries_name";
+  $countries_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $countries_query_raw, $countries_query_numrows);
+  $countries_query = tep_db_query($countries_query_raw);
+  while ($countries = tep_db_fetch_array($countries_query)) {
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $countries['countries_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cInfo = new objectInfo($countries);
+    }
+
+    if (isset($cInfo) && is_object($cInfo) && ($countries['countries_id'] == $cInfo->countries_id)) {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $countries['countries_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $countries['countries_name']; ?></td>
+                <td class="dataTableContent" align="center" width="40"><?php echo $countries['countries_iso_code_2']; ?></td>
+                <td class="dataTableContent" align="center" width="40"><?php echo $countries['countries_iso_code_3']; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($countries['countries_id'] == $cInfo->countries_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $countries['countries_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $countries_split->display_count($countries_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_COUNTRIES); ?></td>
+                    <td class="smallText" align="right"><?php echo $countries_split->display_links($countries_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_country.gif', IMAGE_NEW_COUNTRY) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_COUNTRY . '</b>');
+
+      $contents = array('form' => tep_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert'));
+      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . tep_draw_input_field('countries_name'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . '<br>' . tep_draw_input_field('countries_iso_code_2'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . '<br>' . tep_draw_input_field('countries_iso_code_3'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . '<br>' . tep_draw_pull_down_menu('address_format_id', tep_get_address_formats()));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . '&nbsp;<a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_COUNTRY . '</b>');
+
+      $contents = array('form' => tep_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . tep_draw_input_field('countries_name', $cInfo->countries_name));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . '<br>' . tep_draw_input_field('countries_iso_code_2', $cInfo->countries_iso_code_2));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . '<br>' . tep_draw_input_field('countries_iso_code_3', $cInfo->countries_iso_code_3));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . '<br>' . tep_draw_pull_down_menu('address_format_id', tep_get_address_formats(), $cInfo->address_format_id));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_COUNTRY . '</b>');
+
+      $contents = array('form' => tep_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->countries_name . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->countries_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . $cInfo->countries_name);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . ' ' . $cInfo->countries_iso_code_2);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . ' ' . $cInfo->countries_iso_code_3);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . ' ' . $cInfo->address_format_id);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/coupon_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/coupon_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/coupon_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1082 @@
+<?php
+/*
+  $Id: coupon_admin.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+  $Id: coupon_admin.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  if ($HTTP_GET_VARS['selected_box']) {
+    $HTTP_GET_VARS['action']='';
+    $HTTP_GET_VARS['old_action']='';
+  }
+
+  if (($HTTP_GET_VARS['action'] == 'send_email_to_user') && ($HTTP_POST_VARS['customers_email_address']) && (!$HTTP_POST_VARS['back_x'])) {
+    switch ($HTTP_POST_VARS['customers_email_address']) {
+    case '***':
+      $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS);
+      $mail_sent_to = TEXT_ALL_CUSTOMERS;
+      break;
+    case '**D':
+      $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
+      $mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
+      break;
+    default:
+      $customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']);
+      $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "'");
+      $mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
+      break;
+    }
+    $coupon_query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "'");
+    $coupon_result = tep_db_fetch_array($coupon_query);
+    $coupon_name_query = tep_db_query("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "' and language_id = '" . $languages_id . "'");
+    $coupon_name = tep_db_fetch_array($coupon_name_query);
+
+    $from = tep_db_prepare_input($HTTP_POST_VARS['from']);
+    $subject = tep_db_prepare_input($HTTP_POST_VARS['subject']);
+    while ($mail = tep_db_fetch_array($mail_query)) {
+      $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
+      $message .= TEXT_TO_REDEEM;
+      $message .= TEXT_WHICH_IS . $coupon_result['coupon_code'] . TEXT_IN_CASE . "\n\n";
+      $message .= '<a href="' .  HTTP_SERVER  . DIR_WS_CATALOG . 'gv_redeem.php?gv_no='. $coupon_result['coupon_code'] . '">' .  HTTP_SERVER  . DIR_WS_CATALOG . 'gv_redeem.php' . '?gv_no='. $coupon_result['coupon_code'] . '</a>' . "\n\n";
+      $message .= TEXT_OR_VISIT . '<a href="' .  HTTP_SERVER  . DIR_WS_CATALOG . '">' . HTTP_SERVER  . DIR_WS_CATALOG  . '</a>' . TEXT_ENTER_CODE;
+      $message .= '<strong> ' . TEXT_VOUCHER_IS .'<font color="Red">'. $coupon_result['coupon_code'] . '</font></strong>' . "\n";
+      $message .= TEXT_TO_REDEEM1 ;
+      $message .= TEXT_REMEMBER . "\n";
+
+      //Let's build a message object using the email class
+      $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
+      // add the message to the object
+    if (EMAIL_USE_HTML == 'false') {
+    $mimemessage->add_text($message);
+    } else {
+    $mimemessage->add_html($message);
+    }
+      $mimemessage->build_message();
+      $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);
+      // Now create the coupon email entry
+   //   $insert_query = tep_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $id1 . "', 'G', '" . $HTTP_POST_VARS['amount'] . "', now())");
+    //  $insert_id = tep_db_insert_id($insert_query);
+      $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $HTTP_GET_VARS['cid'] ."', '0', 'Admin', '" . $mail['customers_email_address'] . "', now() )");
+    }
+
+    tep_redirect(tep_href_link(FILENAME_COUPON_ADMIN, 'mail_sent_to=' . urlencode($mail_sent_to)));
+  }
+
+  if ( ($HTTP_GET_VARS['action'] == 'preview_email') && (!$HTTP_POST_VARS['customers_email_address']) ) {
+    $HTTP_GET_VARS['action'] = 'email';
+    $messageStack->add('search', ERROR_NO_CUSTOMER_SELECTED, 'error');
+  }
+
+  if ($HTTP_GET_VARS['mail_sent_to']) {
+    $messageStack->add('search', sprintf(NOTICE_EMAIL_SENT_TO, $HTTP_GET_VARS['mail_sent_to']), 'success');
+  }
+  $coupon_id = ((isset($HTTP_GET_VARS['cid'])) ? tep_db_prepare_input($HTTP_GET_VARS['cid']) : '');
+
+  switch ($HTTP_GET_VARS['action']) {
+    case 'setflag':
+      if ( ($HTTP_GET_VARS['flag'] == 'N') || ($HTTP_GET_VARS['flag'] == 'Y') ) {
+        if (isset($HTTP_GET_VARS['cid'])) {
+          tep_set_coupon_status($coupon_id, $HTTP_GET_VARS['flag']);
+        }
+      }
+      tep_redirect(tep_href_link(FILENAME_COUPON_ADMIN, '&cid=' . $HTTP_GET_VARS['cid']));
+      break;
+    case 'confirmdelete':
+      $delete_query=tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id='".$HTTP_GET_VARS['cid']."'");
+      break;
+    case 'update':
+      // get all HTTP_POST_VARS and validate
+      $HTTP_POST_VARS['coupon_code'] = trim($HTTP_POST_VARS['coupon_code']);
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $language_id = $languages[$i]['id'];
+          if ($HTTP_POST_VARS['coupon_name'][$language_id]) $HTTP_POST_VARS['coupon_name'][$language_id] = trim($HTTP_POST_VARS['coupon_name'][$language_id]);
+          if ($HTTP_POST_VARS['coupon_desc'][$language_id]) $HTTP_POST_VARS['coupon_desc'][$language_id] = trim($HTTP_POST_VARS['coupon_desc'][$language_id]);
+        }
+      $HTTP_POST_VARS['coupon_amount'] = trim($HTTP_POST_VARS['coupon_amount']);
+      $update_errors = 0;
+      if (!$HTTP_POST_VARS['coupon_name']) {
+        $update_errors = 1;
+        $messageStack->add('search', ERROR_NO_COUPON_NAME, 'error');
+      }
+      if ((!$HTTP_POST_VARS['coupon_amount']) && (!$HTTP_POST_VARS['coupon_free_ship'])) {
+        $update_errors = 1;
+        $messageStack->add('search', ERROR_NO_COUPON_AMOUNT, 'error');
+      }
+      if (!$HTTP_POST_VARS['coupon_code']) {
+        $coupon_code = create_coupon_code();
+      }
+      if ($HTTP_POST_VARS['coupon_code']) $coupon_code = $HTTP_POST_VARS['coupon_code'];
+      $query1 = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . tep_db_prepare_input($coupon_code) . "'");
+      if (tep_db_num_rows($query1) && $HTTP_POST_VARS['coupon_code'] && $HTTP_GET_VARS['oldaction'] != 'voucheredit')  {
+        $update_errors = 1;
+        $messageStack->add('search', ERROR_COUPON_EXISTS, 'error');
+      }
+      if ($update_errors != 0) {
+        $HTTP_GET_VARS['action'] = 'new';
+      } else {
+        $HTTP_GET_VARS['action'] = 'update_preview';
+      }
+      break;
+    case 'update_confirm':
+      if ( ($HTTP_POST_VARS['back_x']) || ($HTTP_POST_VARS['back_y']) ) {
+        $HTTP_GET_VARS['action'] = 'new';
+      } else {
+        $coupon_type = "F";
+        $coupon_amount = $HTTP_POST_VARS['coupon_amount'];
+        if (substr($HTTP_POST_VARS['coupon_amount'], -1) == '%') $coupon_type='P';
+        if ($HTTP_POST_VARS['coupon_free_ship']) {
+          $coupon_type = 'S';
+          $coupon_amount = 0;
+        }
+        $sql_data_array = array('coupon_active' => tep_db_prepare_input($HTTP_POST_VARS['coupon_status']),
+                                'coupon_code' => tep_db_prepare_input($HTTP_POST_VARS['coupon_code']),
+                                'coupon_amount' => tep_db_prepare_input($coupon_amount),
+                                'coupon_type' => tep_db_prepare_input($coupon_type),
+                                'uses_per_coupon' => tep_db_prepare_input($HTTP_POST_VARS['coupon_uses_coupon']),
+                                'uses_per_user' => tep_db_prepare_input($HTTP_POST_VARS['coupon_uses_user']),
+                                'coupon_minimum_order' => tep_db_prepare_input($HTTP_POST_VARS['coupon_min_order']),
+                                'restrict_to_products' => tep_db_prepare_input($HTTP_POST_VARS['coupon_products']),
+                                'restrict_to_categories' => tep_db_prepare_input($HTTP_POST_VARS['coupon_categories']),
+                                'coupon_start_date' => $HTTP_POST_VARS['coupon_startdate'],
+                                'coupon_expire_date' => $HTTP_POST_VARS['coupon_finishdate'],
+                                'date_created' => (($HTTP_POST_VARS['date_created'] != '0') ? $HTTP_POST_VARS['date_created'] : 'now()'),
+                                'date_modified' => 'now()');
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $language_id = $languages[$i]['id'];
+          $sql_data_marray[$i] = array('coupon_name' => tep_db_prepare_input($HTTP_POST_VARS['coupon_name'][$language_id]),
+                                 'coupon_description' => tep_db_prepare_input($HTTP_POST_VARS['coupon_desc'][$language_id])
+                                 );
+        }
+//        $query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . tep_db_prepare_input($HTTP_POST_VARS['coupon_code']) . "'");
+//        if (!tep_db_num_rows($query)) {
+        if ($HTTP_GET_VARS['oldaction']=='voucheredit') {
+          tep_db_perform(TABLE_COUPONS, $sql_data_array, 'update', "coupon_id='" . $HTTP_GET_VARS['cid']."'");
+          for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $language_id = $languages[$i]['id'];
+            $update = tep_db_query("update " . TABLE_COUPONS_DESCRIPTION . " set coupon_name = '" . tep_db_prepare_input($HTTP_POST_VARS['coupon_name'][$language_id]) . "', coupon_description = '" . tep_db_prepare_input($HTTP_POST_VARS['coupon_desc'][$language_id]) . "' where coupon_id = '" . $HTTP_GET_VARS['cid'] . "' and language_id = '" . $language_id . "'");
+//            tep_db_perform(TABLE_COUPONS_DESCRIPTION, $sql_data_marray[$i], 'update', "coupon_id='" . $HTTP_GET_VARS['cid']."'");
+          }
+        } else {
+          $query = tep_db_perform(TABLE_COUPONS, $sql_data_array);
+          $insert_id = tep_db_insert_id($query);
+
+          for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+            $language_id = $languages[$i]['id'];
+            $sql_data_marray[$i]['coupon_id'] = $insert_id;
+            $sql_data_marray[$i]['language_id'] = $language_id;
+            tep_db_perform(TABLE_COUPONS_DESCRIPTION, $sql_data_marray[$i]);
+          }
+//        }
+      }
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
+<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
+<script language="javascript">
+  var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);
+</script>
+<!-- Tabs code -->
+<script type="text/javascript" src="includes/javascript/tabpane/local/webfxlayout.js"></script>
+<link type="text/css" rel="stylesheet" href="includes/javascript/tabpane/tab.webfx.css">
+<style type="text/css">
+.dynamic-tab-pane-control h2 {
+  text-align: center;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control h2 a {
+  display:  inline;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control a:hover {
+  background: transparent;
+}
+</style>
+<script type="text/javascript" src="includes/javascript/tabpane/tabpane.js"></script>
+<!-- End Tabs -->
+
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+
+<?php
+  switch ($HTTP_GET_VARS['action']) {
+  case 'report':
+?>
+      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo CUSTOMER_ID; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo CUSTOMER_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo IP_ADDRESS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo REDEEM_DATE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "'";
+    $cc_query = tep_db_query($cc_query_raw);
+    $cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
+
+    while ($cc_list = tep_db_fetch_array($cc_query)) {
+      $rows++;
+      if (strlen($rows) < 2) {
+        $rows = '0' . $rows;
+      }
+      if (((!$HTTP_GET_VARS['uid']) || (@$HTTP_GET_VARS['uid'] == $cc_list['unique_id'])) && (!$cInfo)) {
+        $cInfo = new objectInfo($cc_list);
+      }
+      if ( (is_object($cInfo)) && ($cc_list['unique_id'] == $cInfo->unique_id) ) {
+        echo '          <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link('coupon_admin.php', tep_get_all_get_params(array('cid', 'action', 'uid')) . 'cid=' . $cInfo->coupon_id . '&action=report&uid=' . $cinfo->unique_id) . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link('coupon_admin.php', tep_get_all_get_params(array('cid', 'action', 'uid')) . 'cid=' . $cc_list['coupon_id'] . '&action=report&uid=' . $cc_list['unique_id']) . '\'">' . "\n";
+      }
+$customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $cc_list['customer_id'] . "'");
+$customer = tep_db_fetch_array($customer_query);
+
+?>
+                <td class="dataTableContent"><?php echo $cc_list['customer_id']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $customer['customers_firstname'] . ' ' . $customer['customers_lastname']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $cc_list['redeem_ip']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo tep_date_short($cc_list['redeem_date']); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($cc_list['unique_id'] == $cInfo->unique_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_COUPON_ADMIN, 'page=' . $HTTP_GET_VARS['page'] . '&cid=' . $cc_list['coupon_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+
+
+
+             </table></td>
+<?php
+    $heading = array();
+    $contents = array();
+      $coupon_description_query = tep_db_query("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "' and language_id = '" . $languages_id . "'");
+      $coupon_desc = tep_db_fetch_array($coupon_description_query);
+      $count_customers = tep_db_query("select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "' and customer_id = '" . $cInfo->customer_id . "'");
+
+      $heading[] = array('text' => '<b>[' . $HTTP_GET_VARS['cid'] . ']' . COUPON_NAME . ' ' . $coupon_desc['coupon_name'] . '</b>');
+      $contents[] = array('text' => '<b>' . TEXT_REDEMPTIONS . '</b>');
+      $contents[] = array('text' => TEXT_REDEMPTIONS_TOTAL . '=' . tep_db_num_rows($cc_query));
+      $contents[] = array('text' => TEXT_REDEMPTIONS_CUSTOMER . ':' . tep_db_num_rows($count_customers));
+      $contents[] = array('text' => '');
+?>
+    <td width="25%" valign="top">
+<?php
+      $box = new box;
+      echo $box->infoBox($heading, $contents);
+      echo '            </td>' . "\n";
+?>
+<?php
+    break;
+  case 'preview_email':
+    $coupon_query = tep_db_query("select coupon_code from " .TABLE_COUPONS . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "'");
+    $coupon_result = tep_db_fetch_array($coupon_query);
+    $coupon_name_query = tep_db_query("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "' and language_id = '" . $languages_id . "'");
+    $coupon_name = tep_db_fetch_array($coupon_name_query);
+    switch ($HTTP_POST_VARS['customers_email_address']) {
+    case '***':
+      $mail_sent_to = TEXT_ALL_CUSTOMERS;
+      break;
+    case '**D':
+      $mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
+      break;
+    default:
+      $mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
+      break;
+    }
+?>
+      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+          <tr><?php echo tep_draw_form('mail', FILENAME_COUPON_ADMIN, 'action=send_email_to_user&cid=' . $HTTP_GET_VARS['cid']); ?>
+            <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_CUSTOMER; ?></b><br><?php echo $mail_sent_to; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_COUPON; ?></b><br><?php echo $coupon_name['coupon_name']; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_FROM; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['from'])); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_SUBJECT; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['subject'])); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b>
+                <?php if (EMAIL_USE_HTML == 'false') { 
+                echo (stripslashes($HTTP_POST_VARS['message']));
+                } else { 
+                echo htmlspecialchars(stripslashes($HTTP_POST_VARS['message'])); 
+                } 
+                ?>
+                </td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td>
+<?php
+/* Re-Post all POST'ed variables */
+    reset($HTTP_POST_VARS);
+    while (list($key, $value) = each($HTTP_POST_VARS)) {
+      if (!is_array($HTTP_POST_VARS[$key])) {
+        echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+   //     echo tep_draw_hidden_field($key, stripslashes($value));
+      }
+    }
+?>
+                <table border="0" width="100%" cellpadding="0" cellspacing="2">
+                  <tr>
+                    <td><?php ?>&nbsp;</td>
+                     <tr>
+                     <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_COUPON_ADMIN) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
+
+                           </tr>
+                    <td class="smallText">
+                <?php if (EMAIL_USE_HTML == 'false'){
+                echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="back"');
+                } ?>
+                <?php if (EMAIL_USE_HTML == 'false'){
+                       echo(TEXT_EMAIL_BUTTON_HTML);
+                 } else {
+                       echo(TEXT_EMAIL_BUTTON_TEXT); 
+                   } ?>
+                    </td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </form></tr>
+<?php 
+  break;
+  case 'email':
+  $coupon_query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "'");
+  $coupon_result = tep_db_fetch_array($coupon_query);
+  $coupon_name_query = tep_db_query("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "' and language_id = '" . $languages_id . "'");
+  $coupon_name = tep_db_fetch_array($coupon_name_query);
+?>
+<?php 
+   if (EMAIL_USE_HTML == 'true'){
+ // Load Editor
+include('includes/javascript/editor.php');
+echo tep_load_html_editor();
+ 
+echo tep_insert_html_editor(message,'advanced','400');
+ }
+?>
+
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?>
+<div class="tab-pane" id="tabPane1">
+<script type="text/javascript">tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ) );
+</script>
+
+      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+
+          <tr><?php echo tep_draw_form('mail', FILENAME_COUPON_ADMIN, 'action=preview_email&cid='. $HTTP_GET_VARS['cid']); ?>
+            <td><table border="0" cellpadding="0" cellspacing="2">
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+<?php
+    $customers = array();
+    $customers[] = array('id' => '', 'text' => TEXT_SELECT_CUSTOMER);
+    $customers[] = array('id' => '***', 'text' => TEXT_ALL_CUSTOMERS);
+    $customers[] = array('id' => '**D', 'text' => TEXT_NEWSLETTER_CUSTOMERS);
+    $mail_query = tep_db_query("select customers_email_address, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " order by customers_lastname");
+    while($customers_values = tep_db_fetch_array($mail_query)) {
+      $customers[] = array('id' => $customers_values['customers_email_address'],
+                           'text' => $customers_values['customers_lastname'] . ', ' . $customers_values['customers_firstname'] . ' (' . $customers_values['customers_email_address'] . ')');
+    }
+?>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_COUPON; ?>&nbsp;&nbsp;</td>
+                <td><?php echo $coupon_name['coupon_name']; ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_CUSTOMER; ?>&nbsp;&nbsp;</td>
+                <td><?php echo tep_draw_pull_down_menu('customers_email_address', $customers, $HTTP_GET_VARS['customer']);?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_FROM; ?>&nbsp;&nbsp;</td>
+                <td><?php echo tep_draw_input_field('from', EMAIL_FROM); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+<?php
+/*
+              <tr>
+                <td class="main"><?php echo TEXT_RESTRICT; ?>&nbsp;&nbsp;</td>
+                <td><?php echo tep_draw_checkbox_field('customers_restrict', $customers_restrict);?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+*/
+?>
+              <tr>
+                <td class="main"><?php echo TEXT_SUBJECT; ?>&nbsp;&nbsp;</td>
+                <td><?php echo tep_draw_input_field('subject'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td valign="top" class="main"><?php echo TEXT_MESSAGE; ?></td>
+                <td class="main">
+                <?php
+                 echo tep_draw_textarea_field('message', 'hard', 60, 3, $message, 'style="width: 100%" '); ?></td>
+           
+             </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+                 </table>
+ <?php if (EMAIL_USE_HTML == 'true'){
+ ;?>
+<script type="text/javascript">
+//<![CDATA[
+setupAllTabs();
+//]]>
+</script> 
+  <?php  
+  };?>
+        <tr>   
+                 <td  align="center">
+                 <?php if (EMAIL_USE_HTML == 'false'){ echo tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL, 'onClick="validate();return returnVal;"');
+                   } else {
+                echo tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); }?>
+                </td>
+              </tr>
+            </table></td>
+          </form></tr>
+
+      </tr>
+      </td>
+<?php      
+    break;
+  case 'update_preview':
+
+  $coupon_min_order = (($HTTP_POST_VARS['coupon_min_order'] == round($HTTP_POST_VARS['coupon_min_order'])) ? number_format($HTTP_POST_VARS['coupon_min_order']) : number_format($HTTP_POST_VARS['coupon_min_order'],2));
+  $coupon_amount = (($HTTP_POST_VARS['coupon_amount'] == round($HTTP_POST_VARS['coupon_amount'])) ? number_format($HTTP_POST_VARS['coupon_amount']) : number_format($HTTP_POST_VARS['coupon_amount'],2));
+?>
+      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+      <td>
+<?php echo tep_draw_form('coupon', 'coupon_admin.php', 'action=update_confirm&oldaction=' . $HTTP_GET_VARS['oldaction'] . '&cid=' . $HTTP_GET_VARS['cid']); ?>
+      <table border="0" width="100%" cellspacing="0" cellpadding="6">
+      <tr>
+        <td align="left"><?php echo COUPON_STATUS; ?></td>
+        <td align="left"><?php echo (($HTTP_POST_VARS['coupon_status'] == 'Y') ? IMAGE_ICON_STATUS_GREEN : IMAGE_ICON_STATUS_RED); ?></td>
+      </tr>
+<?php
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+            $language_id = $languages[$i]['id'];
+?>
+      <tr>
+        <td align="left"><?php echo COUPON_NAME; ?></td>
+        <td align="left"><?php echo $HTTP_POST_VARS['coupon_name'][$language_id]; ?></td>
+      </tr>
+<?php
+}
+?>
+<?php
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+            $language_id = $languages[$i]['id'];
+?>
+      <tr>
+        <td align="left"><?php echo COUPON_DESC; ?></td>
+        <td align="left"><?php echo $HTTP_POST_VARS['coupon_desc'][$language_id]; ?></td>
+      </tr>
+<?php
+}
+?>
+      <tr>
+        <td align="left"><?php echo COUPON_AMOUNT; ?></td>
+        <td align="left"><?php if (!$HTTP_POST_VARS['coupon_free_ship']) echo $coupon_amount; ?></td>
+      </tr>
+ 
+      <tr>
+        <td align="left"><?php echo COUPON_MIN_ORDER; ?></td>
+        <td align="left"><?php echo $coupon_min_order; ?></td>
+      </tr>
+
+      <tr>
+        <td align="left"><?php echo COUPON_FREE_SHIP; ?></td>
+<?php
+    if ($HTTP_POST_VARS['coupon_free_ship']) {
+?>
+        <td align="left"><?php echo TEXT_FREE_SHIPPING; ?></td>
+<?php
+    } else { 
+?>
+        <td align="left"><?php echo TEXT_NO_FREE_SHIPPING; ?></td>
+<?php
+    }
+?>
+      </tr>
+      <tr>
+        <td align="left"><?php echo COUPON_CODE; ?></td>
+<?php
+    if ($HTTP_POST_VARS['coupon_code']) {
+      $c_code = $HTTP_POST_VARS['coupon_code'];
+    } else {
+      $c_code = $coupon_code;
+    }
+?>
+        <td align="left"><?php echo $coupon_code; ?></td>
+      </tr>
+
+      <tr>
+        <td align="left"><?php echo COUPON_USES_COUPON; ?></td>
+        <td align="left"><?php echo $HTTP_POST_VARS['coupon_uses_coupon']; ?></td>
+      </tr>
+
+      <tr>
+        <td align="left"><?php echo COUPON_USES_USER; ?></td>
+        <td align="left"><?php echo $HTTP_POST_VARS['coupon_uses_user']; ?></td>
+      </tr>
+
+       <tr>
+        <td align="left"><?php echo COUPON_PRODUCTS; ?></td>
+        <td align="left"><?php echo $HTTP_POST_VARS['coupon_products']; ?></td>
+      </tr>
+
+
+      <tr>
+        <td align="left"><?php echo COUPON_CATEGORIES; ?></td>
+        <td align="left"><?php echo $HTTP_POST_VARS['coupon_categories']; ?></td>
+      </tr>
+      <tr>
+        <td align="left"><?php echo COUPON_STARTDATE; ?></td>
+<?php
+    $start_date = date(DATE_FORMAT, mktime(0, 0, 0, $HTTP_POST_VARS['coupon_startdate_month'],$HTTP_POST_VARS['coupon_startdate_day'] ,$HTTP_POST_VARS['coupon_startdate_year'] ));
+?>
+        <td align="left"><?php echo $start_date; ?></td>
+      </tr>
+
+      <tr>
+        <td align="left"><?php echo COUPON_FINISHDATE; ?></td>
+<?php
+    $finish_date = date(DATE_FORMAT, mktime(0, 0, 0, $HTTP_POST_VARS['coupon_finishdate_month'],$HTTP_POST_VARS['coupon_finishdate_day'] ,$HTTP_POST_VARS['coupon_finishdate_year'] ));
+    echo date('Y-m-d', mktime(0, 0, 0, $HTTP_POST_VARS['coupon_startdate_month'],$HTTP_POST_VARS['coupon_startdate_day'] ,$HTTP_POST_VARS['coupon_startdate_year'] ));
+?>
+        <td align="left"><?php echo $finish_date; ?></td>
+      </tr>
+<?php
+    echo tep_draw_hidden_field('coupon_status', $HTTP_POST_VARS['coupon_status']);
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $language_id = $languages[$i]['id'];
+          echo tep_draw_hidden_field('coupon_name[' . $languages[$i]['id'] . ']', $HTTP_POST_VARS['coupon_name'][$language_id]);
+          echo tep_draw_hidden_field('coupon_desc[' . $languages[$i]['id'] . ']', $HTTP_POST_VARS['coupon_desc'][$language_id]);
+       }
+    echo tep_draw_hidden_field('coupon_amount', $HTTP_POST_VARS['coupon_amount']);
+    echo tep_draw_hidden_field('coupon_min_order', $HTTP_POST_VARS['coupon_min_order']);
+    echo tep_draw_hidden_field('coupon_free_ship', $HTTP_POST_VARS['coupon_free_ship']);
+    echo tep_draw_hidden_field('coupon_code', $c_code);
+    echo tep_draw_hidden_field('coupon_uses_coupon', $HTTP_POST_VARS['coupon_uses_coupon']);
+    echo tep_draw_hidden_field('coupon_uses_user', $HTTP_POST_VARS['coupon_uses_user']);
+    echo tep_draw_hidden_field('coupon_products', $HTTP_POST_VARS['coupon_products']);
+    echo tep_draw_hidden_field('coupon_categories', $HTTP_POST_VARS['coupon_categories']);
+    echo tep_draw_hidden_field('coupon_startdate', date('Y-m-d', mktime(0, 0, 0, $HTTP_POST_VARS['coupon_startdate_month'],$HTTP_POST_VARS['coupon_startdate_day'] ,$HTTP_POST_VARS['coupon_startdate_year'] )));
+    echo tep_draw_hidden_field('coupon_finishdate', date('Y-m-d', mktime(0, 0, 0, $HTTP_POST_VARS['coupon_finishdate_month'],$HTTP_POST_VARS['coupon_finishdate_day'] ,$HTTP_POST_VARS['coupon_finishdate_year'] )));
+    echo tep_draw_hidden_field('date_created', ((tep_not_null($HTTP_POST_VARS['date_created'])) ? date('Y-m-d', strtotime($HTTP_POST_VARS['date_created'])) : '0'));
+?>
+     <tr>
+        <td align="left"><?php echo tep_image_submit('button_back.gif',COUPON_BUTTON_BACK, 'name=back'); ?></td>
+        <td align="left"><?php echo tep_image_submit('button_confirm.gif',COUPON_BUTTON_CONFIRM); ?></td>
+      </td>
+      </tr>
+
+      </td></table></form>
+      </tr>
+
+      </table></td>
+<?php      
+   
+    break;
+  case 'voucheredit':
+    $languages = tep_get_languages();
+    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+      $language_id = $languages[$i]['id'];
+      $coupon_query = tep_db_query("select coupon_name,coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" .  $HTTP_GET_VARS['cid'] . "' and language_id = '" . $language_id . "'");
+      $coupon = tep_db_fetch_array($coupon_query);
+      $coupon_name[$language_id] = $coupon['coupon_name'];
+      $coupon_desc[$language_id] = $coupon['coupon_description'];
+    }
+    $coupon_query=tep_db_query("select coupon_active, coupon_code, coupon_amount, coupon_type, coupon_minimum_order, coupon_start_date, coupon_expire_date, date_created, uses_per_coupon, uses_per_user, restrict_to_products, restrict_to_categories from " . TABLE_COUPONS . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "'");
+    $coupon=tep_db_fetch_array($coupon_query);
+    $coupon_amount = (($coupon['coupon_amount'] == round($coupon['coupon_amount'])) ? number_format($coupon['coupon_amount']) : number_format($coupon['coupon_amount'],2));
+    if ($coupon['coupon_type']=='P') {
+      // not floating point value, don't display decimal info
+      $coupon_amount = (($coupon_amount == round($coupon_amount)) ? number_format($coupon_amount) : number_format($coupon_amount,2)) . '%';
+    }
+    if ($coupon['coupon_type']=='S') {
+      $coupon_free_ship .= true;
+    }
+    $coupon_min_order = (($coupon['coupon_minimum_order'] == round($coupon['coupon_minimum_order'])) ? number_format($coupon['coupon_minimum_order']) : number_format($coupon['coupon_minimum_order'],2));
+    $coupon_code = $coupon['coupon_code'];
+    $coupon_uses_coupon = $coupon['uses_per_coupon'];
+    $coupon_uses_user = $coupon['uses_per_user'];
+    $coupon_products = $coupon['restrict_to_products'];
+    $coupon_categories = $coupon['restrict_to_categories'];
+    $date_created = $coupon['date_created'];
+    $coupon_status = $coupon['coupon_active'];
+  case 'new':
+// molafish: set default if not editing an existing coupon or showing an error
+    if ($HTTP_GET_VARS['action'] == 'new' && !$HTTP_GET_VARS['oldaction'] == 'new') {
+      if (!$coupon_uses_user) {
+        $coupon_uses_user=1;
+      }
+      if (!$date_created) {
+        $date_created = '0';
+      }
+    }
+    if (!isset($coupon_status)) $coupon_status = 'Y';
+    switch ($coupon_status) {
+      case 'N': $in_status = false; $out_status = true; break;
+      case 'Y':
+      default: $in_status = true; $out_status = false;
+    }
+
+// set some defaults
+    if (!$coupon_uses_user) $coupon_uses_user=1;
+?>
+
+      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+      <td>
+<?php 
+    echo tep_draw_form('coupon', 'coupon_admin.php', 'action=update&oldaction='. (($HTTP_GET_VARS['oldaction'] == 'voucheredit') ? $HTTP_GET_VARS['oldaction'] : $HTTP_GET_VARS['action']) . '&cid=' . $HTTP_GET_VARS['cid']);
+?>
+      <table border="0" width="100%" cellspacing="0" cellpadding="6">
+
+      <tr>
+        <td align="left" class="main"><?php echo COUPON_STATUS; ?></td>
+        <td align="left"><?php echo tep_draw_radio_field('coupon_status', 'Y', $in_status) . '&nbsp;' . IMAGE_ICON_STATUS_GREEN . '&nbsp;' . tep_draw_radio_field('coupon_status', 'N', $out_status) . '&nbsp;' . IMAGE_ICON_STATUS_RED; ?></td>
+        <td align="left" class="main"><?php echo COUPON_STATUS_HELP; ?></td>
+      </tr>
+
+<?php
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $language_id = $languages[$i]['id'];
+?>
+      <tr>
+        <td align="left" class="main"><?php if ($i==0) echo COUPON_NAME; ?></td>
+        <td align="left"><?php echo tep_draw_input_field('coupon_name[' . $languages[$i]['id'] . ']', $coupon_name[$language_id]) . '&nbsp;' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?></td>
+        <td align="left" class="main" width="40%"><?php if ($i==0) echo COUPON_NAME_HELP; ?></td>
+      </tr>
+<?php
+}
+?>
+<?php
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $language_id = $languages[$i]['id'];
+?>
+
+      <tr>
+        <td align="left" valign="top" class="main"><?php if ($i==0) echo COUPON_DESC; ?></td>
+        <td align="left" valign="top"><?php echo tep_draw_textarea_field('coupon_desc[' . $languages[$i]['id'] . ']','physical','24','3', $coupon_desc[$language_id]) . '&nbsp;' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?></td>
+        <td align="left" valign="top" class="main"><?php if ($i==0) echo COUPON_DESC_HELP; ?></td>
+      </tr>
+<?php
+}
+?>
+      <tr>
+        <td align="left" class="main"><?php echo COUPON_AMOUNT; ?></td>
+        <td align="left"><?php echo tep_draw_input_field('coupon_amount', $coupon_amount); ?></td>
+        <td align="left" class="main"><?php echo COUPON_AMOUNT_HELP; ?></td>
+      </tr>
+      <tr>
+        <td align="left" class="main"><?php echo COUPON_MIN_ORDER; ?></td>
+        <td align="left"><?php echo tep_draw_input_field('coupon_min_order', $coupon_min_order); ?></td>
+        <td align="left" class="main"><?php echo COUPON_MIN_ORDER_HELP; ?></td>
+      </tr>
+      <tr>
+        <td align="left" class="main"><?php echo COUPON_FREE_SHIP; ?></td>
+        <td align="left"><?php echo tep_draw_checkbox_field('coupon_free_ship', $coupon_free_ship); ?></td>
+        <td align="left" class="main"><?php echo COUPON_FREE_SHIP_HELP; ?></td>
+      </tr>
+      <tr>
+        <td align="left" class="main"><?php echo COUPON_CODE; ?></td>
+        <td align="left"><?php echo tep_draw_input_field('coupon_code', $coupon_code); ?></td>
+        <td align="left" class="main"><?php echo COUPON_CODE_HELP; ?></td>
+      </tr>
+      <tr>
+        <td align="left" class="main"><?php echo COUPON_USES_COUPON; ?></td>
+        <td align="left"><?php echo tep_draw_input_field('coupon_uses_coupon', $coupon_uses_coupon); ?></td>
+        <td align="left" class="main"><?php echo COUPON_USES_COUPON_HELP; ?></td>
+      </tr>
+      <tr>
+        <td align="left" class="main"><?php echo COUPON_USES_USER; ?></td>
+        <td align="left"><?php echo tep_draw_input_field('coupon_uses_user', $coupon_uses_user); ?></td>
+        <td align="left" class="main"><?php echo COUPON_USES_USER_HELP; ?></td>
+      </tr>
+       <tr>
+        <td align="left" class="main"><?php echo COUPON_PRODUCTS; ?></td>
+        <td align="left"><?php echo tep_draw_input_field('coupon_products', $coupon_products); ?> <input type=button name=open_popup ONCLICK="window.open('treeview.php', 'popuppage', 'scrollbars=yes,resizable=yes,menubar=yes,width=400,height=600'); " value=" View "></td>
+        <td align="left" class="main"><?php echo COUPON_PRODUCTS_HELP; ?></td>
+      </tr>
+      <tr>
+        <td align="left" class="main"><?php echo COUPON_CATEGORIES; ?></td>
+        <td align="left"><?php echo tep_draw_input_field('coupon_categories', $coupon_categories); ?> <input type=button name=open_popup ONCLICK="window.open('treeview.php', 'popuppage', 'scrollbars=yes,resizable=yes,menubar=yes,width=400,height=600'); " value=" View "></td>
+        <td align="left" class="main"><?php echo COUPON_CATEGORIES_HELP; ?></td>
+      </tr>
+      <tr>
+<?php
+// molafish: fixed reset to default of dates when editing an existing coupon or showing an error message
+    if ($HTTP_GET_VARS['action'] == 'new' && !$HTTP_POST_VARS['coupon_startdate'] && !$HTTP_GET_VARS['oldaction'] == 'new') {
+      $coupon_startdate = split("[-]", date('Y-m-d'));
+    } elseif (tep_not_null($HTTP_POST_VARS['coupon_startdate'])) {
+      $coupon_startdate = split("[-]", $HTTP_POST_VARS['coupon_startdate']);
+    } elseif (!$HTTP_GET_VARS['oldaction'] == 'new') {   // for action=voucheredit
+      $coupon_startdate = split("[-]", date('Y-m-d', strtotime($coupon['coupon_start_date'])));
+    } else {   // error is being displayed
+      $coupon_startdate = split("[-]", date('Y-m-d', mktime(0, 0, 0, $HTTP_POST_VARS['coupon_startdate_month'],$HTTP_POST_VARS['coupon_startdate_day'] ,$HTTP_POST_VARS['coupon_startdate_year'] )));
+    }
+    if ($HTTP_GET_VARS['action'] == 'new' && !$HTTP_POST_VARS['coupon_finishdate'] && !$HTTP_GET_VARS['oldaction'] == 'new') {
+      $coupon_finishdate = split("[-]", date('Y-m-d'));
+      $coupon_finishdate[0] = $coupon_finishdate[0] + 1;
+    } elseif (tep_not_null($HTTP_POST_VARS['coupon_finishdate'])) {
+      $coupon_finishdate = split("[-]", $HTTP_POST_VARS['coupon_finishdate']);
+    } elseif (!$HTTP_GET_VARS['oldaction'] == 'new') {   // for action=voucheredit
+      $coupon_finishdate = split("[-]", date('Y-m-d', strtotime($coupon['coupon_expire_date'])));
+    } else {   // error is being displayed
+      $coupon_finishdate = split("[-]", date('Y-m-d', mktime(0, 0, 0, $HTTP_POST_VARS['coupon_finishdate_month'],$HTTP_POST_VARS['coupon_finishdate_day'] ,$HTTP_POST_VARS['coupon_finishdate_year'] )));
+    }
+?>
+        <td align="left" class="main"><?php echo COUPON_STARTDATE; ?></td>
+        <td align="left"><?php echo tep_draw_date_selector('coupon_startdate', mktime(0,0,0, $coupon_startdate[1], $coupon_startdate[2], $coupon_startdate[0], 0)); ?></td>
+        <td align="left" class="main"><?php echo COUPON_STARTDATE_HELP; ?></td>
+      </tr>
+      <tr>
+        <td align="left" class="main"><?php echo COUPON_FINISHDATE; ?></td>
+        <td align="left"><?php echo tep_draw_date_selector('coupon_finishdate', mktime(0,0,0, $coupon_finishdate[1], $coupon_finishdate[2], $coupon_finishdate[0], 0)); ?></td>
+        <td align="left" class="main"><?php echo COUPON_FINISHDATE_HELP; ?></td>
+      </tr>
+<?php
+      echo tep_draw_hidden_field('date_created', $date_created);
+?>
+      <tr>
+        <td align="left"><?php echo '&nbsp;&nbsp;<a href="' . tep_href_link('coupon_admin.php', ''); ?>"><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>
+        <td align="center"><?php echo tep_image_submit('button_preview.gif',COUPON_BUTTON_PREVIEW); ?></td>
+      </td>
+      </tr>
+      </td></table></form>
+      </tr>
+
+      </table></td>
+<?php
+    break;
+  default:
+?>    
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="main"><?php echo tep_draw_form('status', FILENAME_COUPON_ADMIN, '', 'get'); ?>
+<?php
+    $status_array[] = array('id' => 'Y', 'text' => TEXT_COUPON_ACTIVE);
+    $status_array[] = array('id' => 'N', 'text' => TEXT_COUPON_INACTIVE);
+    $status_array[] = array('id' => 'R', 'text' => TEXT_COUPON_REDEEMED);
+    $status_array[] = array('id' => '*', 'text' => TEXT_COUPON_ALL);
+
+    if ($HTTP_GET_VARS['status']) {
+      $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+    } else { 
+      $status = 'Y';
+    } 
+    echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', $status_array, $status, 'onChange="this.form.submit();"'); 
+?>
+              </form>
+           </td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo COUPON_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo COUPON_AMOUNT; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo COUPON_CODE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TEXT_REDEMPTIONS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo COUPON_STATUS; ?></td>  
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    if ($HTTP_GET_VARS['page'] > 1) $rows = $HTTP_GET_VARS['page'] * 20 - 20;
+    if ($status == 'Y' || $status == 'N') {
+      $cc_query_raw = "select coupon_active, coupon_id, coupon_code, coupon_amount, coupon_minimum_order, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified from " . TABLE_COUPONS ." where coupon_active='" . tep_db_input($status) . "' and coupon_type != 'G'";
+    } else {
+      $cc_query_raw = "select coupon_active, coupon_id, coupon_code, coupon_amount, coupon_minimum_order, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified from " . TABLE_COUPONS . " where coupon_type != 'G'";
+    }
+    $cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
+    $cc_query = tep_db_query($cc_query_raw);
+    while ($cc_list = tep_db_fetch_array($cc_query)) {
+      $redeem_query = tep_db_query("select redeem_date from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $cc_list['coupon_id'] . "'");
+      if ($status == 'R' && tep_db_num_rows($redeem_query) == 0) {
+        continue;
+      }
+      $rows++;
+      if (strlen($rows) < 2) {
+        $rows = '0' . $rows;
+      }
+      if (((!$HTTP_GET_VARS['cid']) || (@$HTTP_GET_VARS['cid'] == $cc_list['coupon_id'])) && (!$cInfo)) {
+        $cInfo = new objectInfo($cc_list);
+      }
+      if ( (is_object($cInfo)) && ($cc_list['coupon_id'] == $cInfo->coupon_id) ) {
+        echo '          <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link('coupon_admin.php', tep_get_all_get_params(array('cid', 'action')) . 'cid=' . $cInfo->coupon_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link('coupon_admin.php', tep_get_all_get_params(array('cid', 'action')) . 'cid=' . $cc_list['coupon_id']) . '\'">' . "\n";
+      }
+      $coupon_description_query = tep_db_query("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $cc_list['coupon_id'] . "' and language_id = '" . $languages_id . "'");
+      $coupon_desc = tep_db_fetch_array($coupon_description_query);
+?>
+                <td class="dataTableContent"><?php echo $coupon_desc['coupon_name']; ?></td>
+                <td class="dataTableContent" align="center">
+<?php  
+      if ($cc_list['coupon_type'] == 'P') {
+        // not floating point value, don't display decimal info
+        echo (($cc_list['coupon_amount'] == round($cc_list['coupon_amount'])) ? number_format($cc_list['coupon_amount']) : number_format($cc_list['coupon_amount'],2)) . '%';
+      } elseif ($cc_list['coupon_type'] == 'S') {
+        echo TEXT_FREE_SHIPPING;
+      } else {
+        echo $currencies->format($cc_list['coupon_amount']);
+      }
+?>
+            &nbsp;</td>
+                <td class="dataTableContent" align="center"><?php echo $cc_list['coupon_code']; ?></td>
+                <td class="dataTableContent" align="center">
+<?php
+      echo tep_db_num_rows($redeem_query);   // number of redemptions
+?>
+                <td class="dataTableContent" align="center">
+<?php
+      if ($cc_list['coupon_active'] == 'Y') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_COUPON_ADMIN, 'action=setflag&flag=N&cid=' . $cc_list['coupon_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_COUPON_ADMIN, 'action=setflag&flag=Y&cid=' . $cc_list['coupon_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($cc_list['coupon_id'] == $cInfo->coupon_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_COUPON_ADMIN, 'page=' . $HTTP_GET_VARS['page'] . '&cid=' . $cc_list['coupon_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+      $redeem_date = '';
+      while ($redeem_list = tep_db_fetch_array($redeem_query)) {   // retrieve last redeem date
+        $redeem_date = $redeem_list['redeem_date'];
+      }
+      if ( (is_object($cInfo)) && ($cc_list['coupon_id'] == $cInfo->coupon_id) ) {   // store for later
+        $rInfo = new objectInfo(array('redeem_date' => $redeem_date));
+      }
+    }
+?>
+          <tr>
+            <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText">&nbsp;<?php echo $cc_split->display_count($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_COUPONS); ?>&nbsp;</td>
+                <td align="right" class="smallText">&nbsp;<?php echo $cc_split->display_links($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], 'status=' . $status); ?>&nbsp;</td>
+              </tr>
+
+              <tr>
+                <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . tep_href_link('coupon_admin.php', 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->coupon_id . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+
+<?php
+
+    $heading = array();
+    $contents = array();
+
+    switch ($HTTP_GET_VARS['action']) {
+    case 'release':
+      break;
+    case 'report':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_COUPON_REPORT . '</b>');
+      $contents[] = array('text' => TEXT_NEW_INTRO);
+      break;
+    case 'neww':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_COUPON . '</b>');
+      $contents[] = array('text' => TEXT_NEW_INTRO);
+      $contents[] = array('text' => '<br>' . COUPON_NAME . '<br>' . tep_draw_input_field('name'));
+      $contents[] = array('text' => '<br>' . COUPON_AMOUNT . '<br>' . tep_draw_input_field('voucher_amount'));
+      $contents[] = array('text' => '<br>' . COUPON_CODE . '<br>' . tep_draw_input_field('voucher_code'));
+      $contents[] = array('text' => '<br>' . COUPON_USES_COUPON . '<br>' . tep_draw_input_field('voucher_number_of'));
+      break;
+    default:
+      $heading[] = array('text'=>'['.$cInfo->coupon_id.']  '.$cInfo->coupon_code);
+      $amount = $cInfo->coupon_amount;
+      if ($cInfo->coupon_type == 'P') {
+        // not floating point value, don't display decimal info
+        $amount = (($amount == round($amount)) ? number_format($amount) : number_format($amount,2)) . '%';
+      } else {
+        $amount = $currencies->format($amount);
+      }
+      $coupon_min_order = $currencies->format($cInfo->coupon_minimum_order);
+      if ($HTTP_GET_VARS['action'] == 'voucherdelete') {
+        $contents[] = array('text'=> TEXT_CONFIRM_DELETE . '</br></br>' . 
+                '<a href="'.tep_href_link('coupon_admin.php','cid='.$cInfo->coupon_id,'NONSSL').'">'.tep_image_button('button_cancel.gif',IMAGE_CANCEL).'</a>' .
+                '<a href="'.tep_href_link('coupon_admin.php','action=confirmdelete&status=' . $status . (($HTTP_GET_VARS['page'] > 1) ? '&page=' . $HTTP_GET_VARS['page']: '') . '&cid='.$HTTP_GET_VARS['cid'],'NONSSL').'">'.tep_image_button('button_confirm.gif',IMAGE_CONFIRM).'</a>'
+                );
+      } else {
+        $prod_details = NONE;
+        if ($cInfo->restrict_to_products) {
+          $prod_details = '<A HREF="listproducts.php?cid=' . $cInfo->coupon_id . '" TARGET="_blank" ONCLICK="window.open(\'listproducts.php?cid=' . $cInfo->coupon_id . '\', \'Valid_Categories\', \'scrollbars=yes,resizable=yes,menubar=yes,width=600,height=600\'); return false">View</A>';
+        }     
+        $cat_details = NONE;
+        if ($cInfo->restrict_to_categories) {
+          $cat_details = '<A HREF="listcategories.php?cid=' . $cInfo->coupon_id . '" TARGET="_blank" ONCLICK="window.open(\'listcategories.php?cid=' . $cInfo->coupon_id . '\', \'Valid_Categories\', \'scrollbars=yes,resizable=yes,menubar=yes,width=600,height=600\'); return false">View</A>';
+        }
+        $coupon_name_query = tep_db_query("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $cInfo->coupon_id . "' and language_id = '" . $languages_id . "'");
+        $coupon_name = tep_db_fetch_array($coupon_name_query);
+        $contents[] = array('text'=>COUPON_NAME . '&nbsp;:&nbsp;' . $coupon_name['coupon_name'] . '<br>' .
+                     COUPON_AMOUNT . '&nbsp;:&nbsp;' . $amount . '<br>' .
+                     REDEEM_DATE_LAST . '&nbsp;:&nbsp;' . ((isset($rInfo->redeem_date)) ? tep_date_short($rInfo->redeem_date) : '') . '<br>' .
+                     COUPON_MIN_ORDER . '&nbsp;:&nbsp;' . $coupon_min_order . '<br>' .
+                     COUPON_STARTDATE . '&nbsp;:&nbsp;' . tep_date_short($cInfo->coupon_start_date) . '<br>' .
+                     COUPON_FINISHDATE . '&nbsp;:&nbsp;' . tep_date_short($cInfo->coupon_expire_date) . '<br>' .
+                     COUPON_USES_COUPON . '&nbsp;:&nbsp;' . $cInfo->uses_per_coupon . '<br>' .
+                     COUPON_USES_USER . '&nbsp;:&nbsp;' . $cInfo->uses_per_user . '<br>' .
+                     COUPON_PRODUCTS . '&nbsp;:&nbsp;' . $prod_details . '<br>' .
+                     COUPON_CATEGORIES . '&nbsp;:&nbsp;' . $cat_details . '<br>' .
+                     DATE_CREATED . '&nbsp;:&nbsp;' . tep_date_short($cInfo->date_created) . '<br>' .
+                     DATE_MODIFIED . '&nbsp;:&nbsp;' . tep_date_short($cInfo->date_modified) . '<br><br>' .
+                     '<center><a href="'.tep_href_link('coupon_admin.php','action=email&cid='.$cInfo->coupon_id,'NONSSL').'">'.tep_image_button('button_email.gif',COUPON_BUTTON_EMAIL_VOUCHER).'</a>' .
+                     '<a href="'.tep_href_link('coupon_admin.php','action=voucheredit&cid='.$cInfo->coupon_id,'NONSSL').'">'.tep_image_button('button_edit.gif',COUPON_BUTTON_EDIT_VOUCHER).'</a>' .
+                     '<a href="'.tep_href_link('coupon_admin.php','action=voucherdelete&status=' . $status . (($HTTP_GET_VARS['page'] > 1) ? '&page=' . $HTTP_GET_VARS['page']: '') . '&cid='.$cInfo->coupon_id,'NONSSL').'">'.tep_image_button('button_delete.gif',COUPON_BUTTON_DELETE_VOUCHER).'</a>' .
+                     '<br><a href="'.tep_href_link('coupon_admin.php','action=report&cid='.$cInfo->coupon_id,'NONSSL').'">'.tep_image_button('button_report.gif',COUPON_BUTTON_VOUCHER_REPORT).'</a></center>');
+        }
+        break;
+      }
+?>                       
+    <td width="25%" valign="top">
+<?php
+      $box = new box;
+      echo $box->infoBox($heading, $contents);
+    echo '            </td>' . "\n";
+    }
+?>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/coupon_restrict.php
===================================================================
--- trunk/direct.openmoko.com/admin/coupon_restrict.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/coupon_restrict.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,107 @@
+<?php
+/*
+  $Id: coupon_restrict.php,v 1.1.1.1 2004/03/04 23:38:20 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $system = tep_get_system_information();
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" cellspacing="0" cellpadding="3">
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_SERVER_HOST; ?></b></td>
+                <td class="smallText"><?php echo $system['host'] . ' (' . $system['ip'] . ')'; ?></td>
+                <td class="smallText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><?php echo TITLE_DATABASE_HOST; ?></b></td>
+                <td class="smallText"><?php echo $system['db_server'] . ' (' . $system['db_ip'] . ')'; ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_SERVER_OS; ?></b></td>
+                <td class="smallText"><?php echo $system['system'] . ' ' . $system['kernel']; ?></td>
+                <td class="smallText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><?php echo TITLE_DATABASE; ?></b></td>
+                <td class="smallText"><?php echo $system['db_version']; ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_SERVER_DATE; ?></b></td>
+                <td class="smallText"><?php echo $system['date']; ?></td>
+                <td class="smallText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><?php echo TITLE_DATABASE_DATE; ?></b></td>
+                <td class="smallText"><?php echo $system['db_date']; ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_SERVER_UP_TIME; ?></b></td>
+                <td colspan="3" class="smallText"><?php echo $system['uptime']; ?></td>
+              </tr>
+              <tr>
+                <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_HTTP_SERVER; ?></b></td>
+                <td colspan="3" class="smallText"><?php echo $system['http_server']; ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_PHP_VERSION; ?></b></td>
+                <td colspan="3" class="smallText"><?php echo $system['php'] . ' (' . TITLE_ZEND_VERSION . ' ' . $system['zend'] . ')'; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><?php phpinfo(); ?></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/creat_infoheading.php
===================================================================
--- trunk/direct.openmoko.com/admin/creat_infoheading.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/creat_infoheading.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/* create infobox heading entries
+*/
+    case 'add_language_files': //create language heading entries.
+// pull infobox info
+     $infobox_query = tep_db_query("select box_heading, date_added, infobox_id from " . TABLE_INFOBOX_CONFIGURATION);
+     $infobox = tep_db_fetch_array($infobox_query);
+          $languages = tep_get_languages();
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $language_id = $languages[$i]['id'];
+          $box_heading = $infobox['box_heading'];
+          $infobox_id = $infobox['infobox_id']
+          
+           tep_db_query("insert into " . TABLE_INFOBOX_HEADING . " (infobox_id, language_id, box_heading) values ('" . $infobox_id . "', '" . $language_id . "', '" . $box_heading . "')");
+       }
+       tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+
+        break;
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/create_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,99 @@
+<?php
+/*
+  $Id: create_account.php,v 1.1.1.1 2004/03/04 23:38:20 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+ THIS IS BETA - Use at your own risk!
+  Step-By-Step Manual Order Entry Verion 0.5
+  Customer Entry through Admin
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php require('includes/form_check.js.php'); ?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+
+
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><form name="account_edit" method="post" <?php echo 'action="' . tep_href_link(FILENAME_CREATE_ACCOUNT_PROCESS, '', 'SSL') . '"'; ?> onSubmit="return check_form();"><input type="hidden" name="action" value="process"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if (sizeof($navigation->snapshot) > 0) {
+?>
+      <tr>
+        <td class="smallText"><br><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td>
+<?php
+  //$email_address = tep_db_prepare_input($HTTP_GET_VARS['email_address']);
+  $account['entry_country_id'] = STORE_COUNTRY;
+  $account['entry_zone_id'] = STORE_ZONE;
+
+  require(DIR_WS_MODULES . 'account_details.php');
+?>
+        </td>
+      </tr>
+      <tr>
+        <td align="right" class="main">
+         <br><?php echo tep_image_submit('button_confirm.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+      </tr>
+    </table></form></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+    require(DIR_WS_INCLUDES . 'footer.php');
+?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/create_account_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/create_account_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/create_account_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,377 @@
+<?php
+/*
+  $Id: create_account_process.php,v 1.3 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  THIS IS BETA - Use at your own risk!
+  Step-By-Step Manual Order Entry Verion 1.0
+  Customer Entry through Admin
+*/
+
+  require('includes/application_top.php');
+
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT_PROCESS);
+
+if (!@$HTTP_POST_VARS['action']) {
+   tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
+ }
+
+  $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
+  $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
+  $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
+  $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
+  $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
+  $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
+  $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
+  $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
+  $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
+  $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);
+  $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
+  $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
+  $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
+  $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
+  $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
+  $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+  $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+  $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+
+
+  /////////////////      RAMDOMIZING SCRIPT BY PATRIC VEVERKA       \\\\\\\\\\\\\\\\\\
+
+$t1 = date("mdy");
+srand ((float) microtime() * 10000000);
+$input = array ("A", "a", "B", "b", "C", "c", "D", "d", "E", "e", "F", "f", "G", "g", "H", "h", "I", "i", "J", "j", "K", "k", "L", "l", "M", "m", "N", "n", "O", "o", "P", "p", "Q", "q", "R", "r", "S", "s", "T", "t", "U", "u", "V", "v", "W", "w", "X", "x", "Y", "y", "Z", "z");
+$rand_keys = array_rand ($input, 3);
+$l1 = $input[$rand_keys[0]];
+$r1 = rand(0,9);
+$l2 = $input[$rand_keys[1]];
+$l3 = $input[$rand_keys[2]];
+$r2 = rand(0,9);
+
+$password = $l1.$r1.$l2.$l3.$r2;
+
+/////////////////    End of Randomizing Script   \\\\\\\\\\\\\\\\\\\
+
+
+
+  $error = false; // reset error flag
+
+  if (ACCOUNT_GENDER == 'true') {
+    if (($gender == 'm') || ($gender == 'f')) {
+      $entry_gender_error = false;
+    } else {
+      $error = true;
+      $entry_gender_error = true;
+    }
+  }
+
+  if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+    $error = true;
+    $entry_firstname_error = true;
+  } else {
+    $entry_firstname_error = false;
+  }
+
+  if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+    $error = true;
+    $entry_lastname_error = true;
+  } else {
+    $entry_lastname_error = false;
+  }
+
+  if (ACCOUNT_DOB == 'true') {
+    if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4))) {
+      $entry_date_of_birth_error = false;
+    } else {
+      $error = true;
+      $entry_date_of_birth_error = true;
+    }
+  }
+
+  if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
+    $error = true;
+    $entry_email_address_error = true;
+  } else {
+    $entry_email_address_error = false;
+  }
+
+ if (!tep_validate_email($email_address)) {
+    $error = true;
+    $entry_email_address_check_error = true;
+  } else {
+    $entry_email_address_check_error = false;
+  }
+
+  if (ACCOUNT_COMPANY == 'true') {
+    if (strlen($company) < ENTRY_COMPANY_MIN_LENGTH) {
+      $error = true;
+      $entry_company_error = true;
+    } else {
+      $entry_company_error = false;
+    }
+  }
+
+  if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
+    $error = true;
+    $entry_street_address_error = true;
+  } else {
+    $entry_street_address_error = false;
+  }
+
+  if (ACCOUNT_SUBURB == 'true') {
+    if (!$suburb) {
+      $entry_suburb_error = true;
+    } else {
+      $entry_suburb_error = false;
+    }
+  }
+
+  if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
+    $error = true;
+    $entry_post_code_error = true;
+  } else {
+    $entry_post_code_error = false;
+  }
+
+  if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
+    $error = true;
+    $entry_city_error = true;
+  } else {
+    $entry_city_error = false;
+  }
+
+  if (!$country) {
+    $error = true;
+    $entry_country_error = true;
+  } else {
+    $entry_country_error = false;
+  }
+
+  if (ACCOUNT_STATE == 'true') {
+    if ($entry_country_error) {
+      $entry_state_error = true;
+    } else {
+      $zone_id = 0;
+      $entry_state_error = false;
+      $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "'");
+      $check_value = tep_db_fetch_array($check_query);
+      $entry_state_has_zones = ($check_value['total'] > 0);
+      if ($entry_state_has_zones) {
+        $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' and zone_name = '" . tep_db_input($state) . "'");
+        if (tep_db_num_rows($zone_query) == 1) {
+          $zone_values = tep_db_fetch_array($zone_query);
+          $zone_id = $zone_values['zone_id'];
+        } else {
+          $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' and zone_code = '" . tep_db_input($state) . "'");
+          if (tep_db_num_rows($zone_query) == 1) {
+            $zone_values = tep_db_fetch_array($zone_query);
+            $zone_id = $zone_values['zone_id'];
+          } else {
+            $error = true;
+            $entry_state_error = true;
+          }
+        }
+      } else {
+        if (!$state) {
+          $error = true;
+          $entry_state_error = true;
+        }
+      }
+    }
+  }
+
+  if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
+    $error = true;
+    $entry_telephone_error = true;
+  } else {
+    $entry_telephone_error = false;
+  }
+
+  if (!$fax) {
+    $entry_fax_error = true;
+  } else {
+    $entry_fax_error = false;
+  }
+
+/*  $passlen = strlen($password);
+  if ($passlen < ENTRY_PASSWORD_MIN_LENGTH) {
+    $error = true;
+    $entry_password_error = true;
+  } else {
+    $entry_password_error = false;
+  }
+
+  if ($password != $confirmation) {
+    $error = true;
+    $entry_password_error = true;
+  }*/
+
+  $check_email = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and customers_id <> '" . tep_db_input($customer_id) . "'");
+  if (tep_db_num_rows($check_email)) {
+    $error = true;
+    $entry_email_address_exists = true;
+  } else {
+    $entry_email_address_exists = false;
+  }
+
+  if ($error == true) {
+    $processed = true;
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+  <title><?php echo TITLE ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<?php require('includes/form_check.js.php'); ?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php
+  require(DIR_WS_INCLUDES . 'header.php');
+?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><form name="account_edit" method="post" <?php echo 'action="' . tep_href_link(FILENAME_CREATE_ACCOUNT_PROCESS, '', 'SSL') . '"'; ?> onSubmit="return check_form();"><input type="hidden" name="action" value="process"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if (sizeof($navigation->snapshot) > 0) {
+?>
+      <tr>
+        <td class="smallText"><br><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td>
+<?php
+  //$email_address = tep_db_prepare_input($HTTP_GET_VARS['email_address']);
+  $account['entry_country_id'] = STORE_COUNTRY;
+
+  require(DIR_WS_MODULES . 'account_details.php');
+?>
+        </td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><br><?php echo tep_image_submit('button_confirm.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+      </tr>
+    </table></form></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php include(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php
+  } else  {
+    $sql_data_array = array('customers_firstname' => $firstname,
+                            'customers_lastname' => $lastname,
+                            'customers_email_address' => $email_address,
+                            'customers_telephone' => $telephone,
+                            'customers_fax' => $fax,
+                            'customers_newsletter' => $newsletter,
+              'customers_validation' => '1',
+                           'customers_password' => tep_encrypt_password($password));
+
+    if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
+    if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
+
+    tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
+
+    $customer_id = tep_db_insert_id();
+
+    $sql_data_array = array('customers_id' => $customer_id,
+                              'entry_firstname' => $firstname,
+                              'entry_lastname' => $lastname,
+                              'entry_street_address' => $street_address,
+                              'entry_postcode' => $postcode,
+                              'entry_city' => $city,
+                              'entry_country_id' => $country);
+
+    if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
+    if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
+    if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
+    if (ACCOUNT_STATE == 'true') {
+      if ($zone_id > 0) {
+        $sql_data_array['entry_zone_id'] = $zone_id;
+        $sql_data_array['entry_state'] = '';
+      } else {
+        $sql_data_array['entry_zone_id'] = '0';
+        $sql_data_array['entry_state'] = $state;
+      }
+    }
+
+    tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
+
+    $address_id = tep_db_insert_id();
+
+    tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");
+
+    tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");
+
+    $customer_first_name = $firstname;
+    $customer_default_address_id = 1;
+    $customer_default_address_id = $address_id;
+    $customer_country_id = $country;
+    $customer_zone_id = $zone_id;
+    tep_session_register('customer_id');
+    tep_session_register('customer_first_name');
+    tep_session_register('customer_default_address_id');
+    tep_session_register('customer_country_id');
+    tep_session_register('customer_zone_id');
+
+    // build the message content
+    $name = $firstname . " " . $lastname;
+
+    if (ACCOUNT_GENDER == 'true') {
+       if ($HTTP_POST_VARS['gender'] == 'm') {
+         $email_text = EMAIL_GREET_MR;
+       } else {
+         $email_text = EMAIL_GREET_MS;
+       }
+    } else {
+      $email_text = EMAIL_GREET_NONE;
+    }
+
+    $email_text .= EMAIL_WELCOME . EMAIL_PASS_1 . $password . EMAIL_PASS_2 . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
+    tep_mail($name, $email_address, EMAIL_SUBJECT, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+
+    tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
+  }
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/admin/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,105 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.1.1.1 2004/03/04 23:38:21 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  THIS IS BETA - Use at your own risk!
+  Step-By-Step Manual Order Entry Verion 0.5
+  Customer Entry through Admin
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT_SUCCESS);
+
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+  <title><?php echo TITLE ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td valign="top" class="main"><div align="center" class="pageHeading"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_ACCOUNT_CREATED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td>
+          <table BORDER=0 CELLPADDING=0 WIDTH=80%>
+            <tr>
+              <td align="right"><?php echo BUTTON_TITLE1;?></td>
+              <td WIDTH=10>&nbsp;</td>
+              <td align="left">
+                <?php echo '<a href="' . tep_href_link(FILENAME_CREATE_ORDER, '', 'SSL') . '">' . tep_image_button('button_create_order.gif', IMAGE_BUTTON_CREATE_ORDER) . '</a>'; ?>
+              </td>
+            </tr>
+            <tr>
+              <td>&nbsp;</td>
+              <td WIDTH=10>&nbsp;</td>
+              <td>&nbsp;</td>
+            </tr>
+            <tr>
+              <td align="right"><?php echo BUTTON_TITLE2; ?></td>
+              <td WIDTH=10>&nbsp;</td>
+              <td>
+                <?php echo '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_create_customer.gif', IMAGE_BUTTON_CREATE_CUSTOMER) . '</a>'; ?>
+              </td>
+            </tr>
+            <tr>
+              <td>&nbsp;</td>
+              <td WIDTH=10>&nbsp;</td>
+              <td>&nbsp;</td>
+            </tr>
+            <tr>
+              <td align="right"><?php echo BUTTON_TITLE3; ?></td>
+              <td WIDTH=10>&nbsp;</td>
+              <td>
+                <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'SSL') . '">' . tep_image_button('button_admin_home.gif', IMAGE_BUTTON_ADMIN_HOME) . '</a>'; ?>
+               </td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/create_order.php
===================================================================
--- trunk/direct.openmoko.com/admin/create_order.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/create_order.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,189 @@
+<?php
+/*
+  $Id: create_order.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ORDER);
+
+// #### Get Available Customers
+
+  $query = tep_db_query("select customers_id, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " ORDER BY customers_lastname DESC");
+    $result = $query;
+
+
+  if (tep_db_num_rows($result) > 0)
+{
+   // Query Successful
+     $SelectCustomerBox = "<select name='Customer'><option value=''>". BUTTON_TEXT_CHOOSE_CUST . "</option>\n";
+     while($db_Row = tep_db_fetch_array($result))
+     { $SelectCustomerBox .= "<option value='" . $db_Row["customers_id"] . "'";
+     if(IsSet($HTTP_GET_VARS['Customer']) and $db_Row["customers_id"]==$HTTP_GET_VARS['Customer'])
+    $SelectCustomerBox .= " SELECTED ";
+    //$SelectCustomerBox .= ">" . $db_Row["customers_lastname"] . " , " . $db_Row["customers_firstname"] . " - " . $db_Row["customers_id"] . "</option>\n";
+     $SelectCustomerBox .= ">" . $db_Row["customers_lastname"] . " , " . $db_Row["customers_firstname"] . "</option>\n";
+
+    }
+
+    $SelectCustomerBox .= "</select>\n";
+  }
+//newcode below
+  $query = tep_db_query("select code, value from " . TABLE_CURRENCIES . " ORDER BY code");
+  $result = $query;
+  
+  if (tep_db_num_rows($result) > 0)
+  {
+    // Query Successful
+    $SelectCurrencyBox = "<select name='Currency'><option value='' SELECTED>" . TEXT_SELECT_CURRENCY . "</option>\n";
+    while($db_Row = tep_db_fetch_array($result))
+    { 
+      $SelectCurrencyBox .= "<option value='" . $db_Row["code"] . " , " . $db_Row["value"] . "'";
+        $SelectCurrencyBox .= ">" . $db_Row["code"] . "</option>\n";
+    }
+    
+    $SelectCurrencyBox .= "</select>\n";
+  }
+
+if(IsSet($HTTP_GET_VARS['Customer']))
+{
+ $account_query = tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $HTTP_GET_VARS['Customer'] . "'");
+ $account = tep_db_fetch_array($account_query);
+ $customer = $account['customers_id'];
+ $address_query = tep_db_query("select * from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $HTTP_GET_VARS['Customer'] . "'");
+ $address = tep_db_fetch_array($address_query);
+ //$customer = $account['customers_id'];
+} elseif (IsSet($HTTP_GET_VARS['Customer_nr']))
+{
+ $account_query = tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $HTTP_GET_VARS['Customer_nr'] . "'");
+ $account = tep_db_fetch_array($account_query);
+ $customer = $account['customers_id'];
+ $address_query = tep_db_query("select * from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $HTTP_GET_VARS['Customer_nr'] . "'");
+ $address = tep_db_fetch_array($address_query);
+ //$customer = $account['customers_id'];
+}
+
+// #### Generate Page
+  ?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+  <title><?php echo TITLE_1?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php require('includes/form_check.js.php'); ?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+
+
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+
+<td valign="top">
+    <table border='0' bgcolor='#7c6bce' width='100%'>
+      <tr><td class=main><font color='#ffffff'><b><?php echo HEADING_STEP1 ?></b></td></tr>
+    </table>
+    <table border='0' cellpadding='7'>
+     <tr>
+     <td class="main" valign="top">
+
+<?php
+echo tep_draw_form('select_customer', FILENAME_CREATE_ORDER, tep_get_all_get_params(array('action','select_customer')) . '', 'get', '', 'SSL') ;
+if (isset($HTTP_GET_VARS[tep_session_name()])) {
+  echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+}
+echo  '<table border="0"><tr>' . "\n";
+echo  '<td><font class="main"><b>' . TEXT_SELECT_CUST . '</b></font><br>' . $SelectCustomerBox . '</td>' . "\n";
+echo  '<td valign="bottom"><input type="submit" value="' . BUTTON_TEXT_SELECT_CUST . '"></td>' . "\n";
+echo  '</tr></table></form>' . "\n";
+?>
+<?php
+echo tep_draw_form('select_customer', FILENAME_CREATE_ORDER, tep_get_all_get_params(array('action','select_customer')) . '', 'get', '', 'SSL') ;
+//echo  '<form action="' . FILENAME_CREATE_ORDER . '" method="GET">' . "\n";
+if (isset($HTTP_GET_VARS[tep_session_name()])) {
+  echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+}
+echo  '<table border="0"><tr>' . "\n";
+echo  '<td><font class="main"><b>' . TEXT_OR_BY . '</b></font><br><input type="text" name="Customer_nr"></td>' . "\n";
+echo  '<td valign="bottom"><input type="submit" value="' . BUTTON_TEXT_CHOOSE_CUST . '"></td>' . "\n";
+echo  '</tr></table></form>' . "\n";
+?>
+
+    <tr>
+
+    <td width="100%" valign="top">
+<?php echo tep_draw_form('create_order', FILENAME_CREATE_ORDER_PROCESS, tep_get_all_get_params(array('action','create_order')) . '', 'post', '', 'SSL') . tep_draw_hidden_field('customers_id', $account->customers_id); ?>
+    
+     <table border="0" width="100%" cellspacing="0" cellpadding="0">
+
+   </tr> <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_CREATE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td>
+<?php
+
+//onSubmit="return check_form();"
+
+  require(DIR_WS_MODULES . 'create_order_details.php');
+
+?>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+            <td class="main" align="right"><?php echo tep_image_submit('button_confirm.gif', IMAGE_BUTTON_CONFIRM); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form></td>
+<!-- body_text_eof //-->
+
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php
+require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/admin/create_order_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/create_order_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/create_order_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: create_order_admin.php,v 1.1 2004/08/19 23:38:51 teo Exp $
+
+  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');
+
+ ?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+              <tr> 
+               <td>
+               <?php echo TEXT_CREATE_ORDERS_ADMIN_HELP ;?>
+               </td>
+              </tr> 
+              <td>
+<?php echo TEXT_LABEL_CREATE_ORDERS_ADMIN_PAYMENT . tep_draw_separator('pixel_trans.gif', '1', '10') . ' <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_PAY) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <br>' ;
+      echo TEXT_LABEL_CREATE_ORDERS_ADMIN_SHIPPING . tep_draw_separator('pixel_trans.gif', '1', '10') . ' <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>';
+  ?>        </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/create_order_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/create_order_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/create_order_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,271 @@
+<?php
+/*
+  $Id: create_order_payment.php,v 1.1 2004/08/19 23:38:51 teo Exp $
+  http://www.chainreactionworks.com
+
+  Copyright (c) 2005 chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+Header("Cache-control: private, no-cache");
+Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Past date
+Header("Pragma: no-cache");
+  require('includes/application_top.php');
+  
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+
+      case 'save':
+      if (isset($HTTP_GET_VARS['payID'])) $pay_methods_id = tep_db_prepare_input($HTTP_GET_VARS['payID']);
+       //print_r(
+
+         $languages = tep_get_languages();
+      for ($i=0; $i<sizeof($languages); $i++) {
+            $language_id = $languages[$i]['id'] ;
+               // echo 'pay_method ' . $pay_method[$language_id] . '<br>';  
+                     $pay_methods_id = tep_db_prepare_input($HTTP_GET_VARS['payID']) ;
+                     
+                 $sql_data_array1 = array('pay_method' => tep_db_prepare_input($HTTP_POST_VARS['pay_method'][$language_id]),
+                                      'pay_method_language'=> tep_db_prepare_input($language_id),
+                                            'pay_method_sort'=> tep_db_prepare_input($HTTP_POST_VARS['pay_method_sort']));
+                 
+             tep_db_perform(TABLE_ORDERS_PAY_METHODS, $sql_data_array1, 'update', 'pay_methods_id = \'' . $pay_methods_id . '\'and pay_method_language = \'' . $language_id . '\'');
+
+             } 
+        //    tep_redirect(tep_href_link(FILENAME_CREATE_ORDERS_PAY,'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $pay_methods_id));
+              break;
+      case 'insert':
+          if ($action == 'insert') {
+               $pay_methods_id = '$payID';
+            if (empty($pay_methods_id)) {
+              $next_id_query = tep_db_query("select max(pay_methods_id) as pay_methods_id from " . TABLE_ORDERS_PAY_METHODS . "");
+              $next_id = tep_db_fetch_array($next_id_query);
+              $pay_methods_id = $next_id['pay_methods_id'] + 1;
+            }
+      $languages = tep_get_languages();
+ 
+     for ($i = 0; $i < sizeof($languages); $i++) {
+        $language_id=$languages[$i]['id'];
+   $sql_data_array = array('pay_method_sort' => tep_db_prepare_input($HTTP_POST_VARS['sort'][$language_id]),
+                            'pay_method' => tep_db_prepare_input($HTTP_POST_VARS['pay_method'][$language_id]),
+                            'date_added' => 'now()');
+ 
+      $insert_sql_data = array('pay_methods_id' => $payID,
+         'pay_method_language' => $language_id);
+  $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+  tep_db_perform(TABLE_ORDERS_PAY_METHODS, $sql_data_array);
+           }
+//  tep_redirect(tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $pay_methods_id));
+
+ 
+ 
+ 
+ 
+       $languages = tep_get_languages();
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $pay_methods_id = $pay_methods_id;
+          $pay_method_language = $HTTP_POST_VARS['pay_method_language'];
+          $pay_method_sort = $HTTP_POST_VARS['pay_method_sort'];
+          $pay_method = $HTTP_POST_VARS['pay_method'];
+
+            $insert_sql_data = array('pay_methods_id' => $pay_methods_id,
+                                     'pay_method_language' => $pay_method_language,
+                                     'pay_method_sort' => $pay_method_sort,
+                                     'pay_method' => $pay_method,
+                                     'date_added' => 'now()',
+                                     );
+
+           $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_ORDERS_PAY_METHODS, $insert_sql_data);
+            }
+        }
+
+               tep_redirect(tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $pay_methods_id));
+        break;
+      case 'deleteconfirm':
+        $payID = tep_db_prepare_input($HTTP_GET_VARS['payID']);
+        tep_db_query("delete from " . TABLE_ORDERS_PAY_METHODS . " where pay_methods_id = '" . tep_db_input($payID) . "'");
+
+        tep_redirect(tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'delete':
+        $payID = tep_db_prepare_input($HTTP_GET_VARS['payID']);
+
+           $remove_status = true;
+         
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CREATE_ORDERS_ADMIN; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CREATE_ORDERS_SORT; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $payment_module_query_raw = "select pay_methods_id, pay_method_language, pay_method_sort, pay_method, date_added from " . TABLE_ORDERS_PAY_METHODS . " where pay_method_language ='" . $languages_id . "' order by pay_methods_id";
+  $payment_module_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $payment_module_query_raw, $payment_module_query_numrows);
+  $payment_module_query = tep_db_query($payment_module_query_raw);
+  while ($payment_module = tep_db_fetch_array($payment_module_query)) {
+    if ((!isset($HTTP_GET_VARS['payID']) || (isset($HTTP_GET_VARS['payID']) && ($HTTP_GET_VARS['payID'] == $payment_module['pay_methods_id']))) && !isset($oInfo) && (substr($action, 0, 3) != 'new')) {
+      $oInfo = new objectInfo($payment_module);
+    }
+
+    if (isset($oInfo) && is_object($oInfo) && ($payment_module['pay_methods_id'] == $oInfo->pay_methods_id)) {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $oInfo->pay_methods_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $payment_module['pay_methods_id']) . '\'">' . "\n";
+    }
+    
+      echo '                <td class="dataTableContent">' . $payment_module['pay_method'] . '</td>' . "\n";
+      echo '                <td class="dataTableContent">' . $payment_module['pay_method_sort'] . '</td>' . "\n";
+
+?>
+                <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($payment_module['pay_methods_id'] == $oInfo->pay_methods_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $payment_module['pay_methods_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $payment_module_split->display_count($payment_module_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES); ?></td>
+                    <td class="smallText" align="right"><?php echo $payment_module_split->display_links($payment_module_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_PAYMENT . '</b>');
+
+      $contents = array('form' => tep_draw_form('status', FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert', 'post')) ; 
+      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+
+      $payment_module_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        $payment_module_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('pay_method[' . $languages[$i]['id'] . ']');
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_MODULES_NAME . $payment_module_inputs_string);
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_PAYMENT . '</b>');
+     $contents = array('form' => tep_draw_form('status', FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $oInfo->pay_methods_id  . '&action=save')) ; 
+     $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+       $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+    
+      $payment_module_inputs_string .= '<br>'. tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('pay_method[' . $languages[$i]['id'] . ']', tep_get_pay_method($HTTP_GET_VARS['payID'] . '[' . $languages[$i]['id'] . ']' ));
+    }
+    $payment_module_inputs_string .= '<br>' . TEXT_INFO_SORT_ORDER . ' &nbsp;'. tep_draw_input_field(pay_method_sort , $oInfo->pay_method_sort);
+    $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_MODULES_NAME . $payment_module_inputs_string);
+    $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $oInfo->pay_methods_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_DELETE_INTRO . '</b>');
+
+      $contents = array('form' => tep_draw_form('status', FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $oInfo->pay_methods_id  . '&action=deleteconfirm')) ; 
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $oInfo->pay_method . '</b>');
+      if ($remove_status) $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $oInfo->pay_methods_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($oInfo) && is_object($oInfo)) {
+        $heading[] = array('text' => '<b>' . $oInfo->pay_method . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $oInfo->pay_methods_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_PAY, 'page=' . $HTTP_GET_VARS['page'] . '&payID=' . $oInfo->pay_methods_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+
+        $payment_module_inputs_string = '';
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $payment_module_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_get_pay_method($oInfo->pay_methods_id, $languages[$i]['id']);
+       }
+
+        $contents[] = array('text' => $payment_module_inputs_string);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/create_order_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/create_order_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/create_order_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,168 @@
+<?php
+/*
+  $Id: create_order_process.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  // include currencies class and create an instance
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+ // if ($HTTP_POST_VARS['action'] != 'process') {
+  //  tep_redirect(tep_href_link(FILENAME_CREATE_ORDER, '', 'SSL'));
+  //}
+  $customer_id = tep_db_prepare_input($HTTP_POST_VARS['customers_id']);
+  $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
+  $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
+  $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
+  $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
+  $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
+  $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
+  $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
+  $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
+  $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
+  $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);
+  $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
+  $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
+  $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
+  $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
+  $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
+  $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+  $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+  $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+  $format_id = "1";
+  $size = "1";
+  $payment_method = DEFAULT_PAYMENT_METHOD; //changed 1.5
+  $new_value = "1";
+  $error = false; // reset error flag
+  $temp_amount = "0";
+  $temp_amount = number_format($temp_amount, 2, '.', '');
+// modified to the system defaults
+  $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
+  $currency_value = $currencies->currencies[$currency]['value'];
+//
+
+
+    include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ORDER_PROCESS);
+
+?>
+<?php
+
+    $sql_data_array = array('customers_id' => $customer_id,
+              'customers_name' => $firstname . ' ' . $lastname,
+              'customers_company' => $company,
+                            'customers_street_address' => $street_address,
+              'customers_suburb' => $suburb,
+              'customers_city' => $city,
+              'customers_postcode' => $postcode,
+              'customers_state' => $state,
+              'customers_country' => $country,
+              'customers_telephone' => $telephone,
+                            'customers_email_address' => $email_address,
+              'customers_address_format_id' => $format_id,
+              'delivery_name' => $firstname . ' ' . $lastname,
+              'delivery_company' => $company,
+                            'delivery_street_address' => $street_address,
+              'delivery_suburb' => $suburb,
+              'delivery_city' => $city,
+              'delivery_postcode' => $postcode,
+              'delivery_state' => $state,
+              'delivery_country' => $country,
+              'delivery_address_format_id' => $format_id,
+              'billing_name' => $firstname . ' ' . $lastname,
+              'billing_company' => $company,
+                            'billing_street_address' => $street_address,
+              'billing_suburb' => $suburb,
+              'billing_city' => $city,
+              'billing_postcode' => $postcode,
+              'billing_state' => $state,
+              'billing_country' => $country,
+              'billing_address_format_id' => $format_id,
+              'date_purchased' => 'now()',
+                            'orders_status' => DEFAULT_ORDERS_STATUS_ID,
+              'currency' => $currency,
+              'currency_value' => $currency_value,
+              'payment_method' => $payment_method,
+              ); 
+
+
+  //  }
+
+
+
+
+  //old
+  tep_db_perform(TABLE_ORDERS, $sql_data_array);
+  $insert_id = tep_db_insert_id();
+
+
+    $sql_data_array = array('orders_id' => $insert_id,
+          'orders_status_id' => $new_value,
+          'date_added' => 'now()');
+  tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
+
+
+    $sql_data_array = array('orders_id' => $insert_id,
+                            'title' => "Sub-Total:",
+                            'text' => $temp_amount,
+                            'value' => "0.00",
+                            'class' => "ot_subtotal",
+                            'sort_order' => "1");
+    tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
+   $sql_data_array = array('orders_id' => $insert_id,
+                            'title' => "Customer Discount:",
+                            'text' => $temp_amount,
+                            'value' => "0.00",
+                            'class' => "ot_customer_discount",
+                            'sort_order' => "2");
+   tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
+
+
+    $sql_data_array = array('orders_id' => $insert_id,
+                            'title' => "Tax:",
+                            'text' => $temp_amount,
+                            'value' => "0.00",
+                            'class' => "ot_tax",
+                            'sort_order' => "2");
+    tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
+
+
+    $sql_data_array = array('orders_id' => $insert_id,
+                            'title' => "Shipping:",
+                            'text' => $temp_amount,
+                            'value' => "0.00",
+                            'class' => "ot_shipping",
+                            'sort_order' => "3");
+    tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
+
+
+
+      $sql_data_array = array('orders_id' => $insert_id,
+                            'title' => "Total:",
+                            'text' => $temp_amount,
+                            'value' => "0.00",
+                            'class' => "ot_total",
+                            'sort_order' => "4");
+    tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
+
+  /*$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
+  $sql_data_array = array('orders_id' => $insert_id,
+                          'new_value' => DEFAULT_ORDERS_STATUS_ID,
+                          'date_added' => 'now()',
+                          'customer_notified' => $customer_notification);
+  tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);*/
+
+    tep_redirect(tep_href_link(FILENAME_C_ORDERS, 'oID=' . $insert_id, 'SSL'));
+  //tep_href_link(update_order. '.'.php, 'OrderID=' . $oInfo->orders_id) .
+  //}
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/admin/create_order_shipping.php
===================================================================
--- trunk/direct.openmoko.com/admin/create_order_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/create_order_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,265 @@
+<?php
+/*
+  $Id: create_order_shipping.php,v 1.1 2004/08/19 23:38:51 teo Exp $
+  http://www.chainreactionworks.com
+
+  Copyright (c) 2005 chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+
+      case 'save':
+        if (isset($HTTP_GET_VARS['shipID'])) $ship_methods_id = tep_db_prepare_input($HTTP_GET_VARS['shipID']);
+       
+         $languages = tep_get_languages();
+      for ($i=0; $i<sizeof($languages); $i++) {
+            $language_id = $languages[$i]['id'];
+
+          $sql_data_array = array('ship_method' => tep_db_prepare_input($HTTP_POST_VARS['ship_method'][$language_id]),
+                                  'ship_method_sort'=> tep_db_prepare_input($HTTP_POST_VARS['ship_method_sort']),
+          );
+         
+          tep_db_perform(TABLE_ORDERS_SHIP_METHODS, $sql_data_array, 'update', 'ship_methods_id = \'' . $shipID . '\' and ship_method_language = \'' . $language_id . '\'');
+              }
+
+  //          tep_redirect(tep_href_link(FILENAME_CREATE_ORDERS_SHIP,'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $ship_methods_id));
+              break;
+      case 'insert':
+          if ($action == 'insert') {
+               $ship_methods_id = '$shipID';
+            if (empty($ship_methods_id)) {
+              $next_id_query = tep_db_query("select max(ship_methods_id) as ship_methods_id from " . TABLE_ORDERS_SHIP_METHODS . "");
+              $next_id = tep_db_fetch_array($next_id_query);
+              $ship_methods_id = $next_id['ship_methods_id'] + 1;
+            }
+      $languages = tep_get_languages();
+ 
+     for ($i = 0; $i < sizeof($languages); $i++) {
+        $language_id=$languages[$i]['id'];
+   $sql_data_array = array('ship_method_sort' => tep_db_prepare_input($HTTP_POST_VARS['sort'][$language_id]),
+                            'ship_method' => tep_db_prepare_input($HTTP_POST_VARS['ship_method'][$language_id]),
+                            'date_added' => 'now()');
+ 
+      $insert_sql_data = array('ship_methods_id' => $shipID,
+                'ship_method_language' => $language_id);
+  $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+  tep_db_perform(TABLE_ORDERS_SHIP_METHODS, $sql_data_array);
+           }
+  tep_redirect(tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $ship_methods_id));
+
+ 
+ 
+ 
+ 
+       $languages = tep_get_languages();
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $ship_methods_id = $ship_methods_id;
+          $ship_method_language = $HTTP_POST_VARS['ship_method_language'];
+          $ship_method_sort = $HTTP_POST_VARS['ship_method_sort'];
+          $ship_method = $HTTP_POST_VARS['ship_method'];
+
+            $insert_sql_data = array('ship_methods_id' => $ship_methods_id,
+                                     'ship_method_language' => $ship_method_language,
+                                     'ship_method_sort' => $ship_method_sort,
+                                     'ship_method' => $ship_method,
+                                     'date_ad ded' => 'now()',
+                                     );
+
+           $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_ORDERS_SHIP_METHODS, $insert_sql_data);
+            }
+        }
+
+               tep_redirect(tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $ship_methods_id));
+        break;
+      case 'deleteconfirm':
+        $shipID = tep_db_prepare_input($HTTP_GET_VARS['shipID']);
+        tep_db_query("delete from " . TABLE_ORDERS_SHIP_METHODS . " where ship_methods_id = '" . tep_db_input($shipID) . "'");
+
+        tep_redirect(tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'delete':
+        $shipID = tep_db_prepare_input($HTTP_GET_VARS['shipID']);
+
+           $remove_status = true;
+         
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CREATE_ORDERS_ADMIN; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $payment_module_query_raw = "select ship_methods_id, ship_method_language, ship_method_sort, ship_method, date_added from " . TABLE_ORDERS_SHIP_METHODS . " where ship_method_language ='" . $languages_id . "' order by ship_method_sort";
+  $ship_module_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $payment_module_query_raw, $payment_module_query_numrows);
+  $payment_module_query = tep_db_query($payment_module_query_raw);
+  while ($payment_module = tep_db_fetch_array($payment_module_query)) {
+    if ((!isset($HTTP_GET_VARS['shipID']) || (isset($HTTP_GET_VARS['shipID']) && ($HTTP_GET_VARS['shipID'] == $payment_module['ship_methods_id']))) && !isset($oInfo) && (substr($action, 0, 3) != 'new')) {
+      $oInfo = new objectInfo($payment_module);
+    }
+
+    if (isset($oInfo) && is_object($oInfo) && ($payment_module['ship_methods_id'] == $oInfo->ship_methods_id)) {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $oInfo->ship_methods_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $payment_module['ship_methods_id']) . '\'">' . "\n";
+    }
+
+    if ($payment_module['ship_method_sort'] == '1') {
+      echo '                <td class="dataTableContent"><b>' . $payment_module['ship_method'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
+    } else {
+      echo '                <td class="dataTableContent">' . $payment_module['ship_method'] . '</td>' . "\n";
+    }
+?>
+                <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($payment_module['ship_methods_id'] == $oInfo->ship_methods_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $payment_module['ship_methods_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $ship_module_split->display_count($payment_module_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES); ?></td>
+                    <td class="smallText" align="right"><?php echo $ship_module_split->display_links($payment_module_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_SHIPPING . '</b>');
+
+      $contents = array('form' => tep_draw_form('status', FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert', 'post')) ; 
+      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+
+      $payment_module_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        $payment_module_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('ship_method[' . $languages[$i]['id'] . ']');
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_INFO_SHIPPING_MODULES_NAME . $payment_module_inputs_string);
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_SHIPPING . '</b>');
+     $contents = array('form' => tep_draw_form('status', FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $oInfo->ship_methods_id  . '&action=save')) ; 
+     $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+      $payment_module_inputs_string .= '<br>'. tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('ship_method[' . $languages[$i]['id'] . ']', tep_get_ship_method($HTTP_GET_VARS['shipID'], $languages[$i]['id']) );
+    }
+      $payment_module_inputs_string .= '<br>' . TEXT_INFO_SORT_ORDER . ' &nbsp;'. tep_draw_input_field(ship_method_sort, $oInfo->ship_method_sort);
+    $contents[] = array('text' => '<br>' . TEXT_INFO_SHIPPING_MODULES_NAME . $payment_module_inputs_string);
+    $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $oInfo->ship_methods_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_DELETE_INTRO . '</b>');
+
+      $contents = array('form' => tep_draw_form('status', FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $oInfo->ship_methods_id  . '&action=deleteconfirm')) ; 
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $oInfo->ship_method . '</b>');
+      if ($remove_status) $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $oInfo->ship_methods_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($oInfo) && is_object($oInfo)) {
+        $heading[] = array('text' => '<b>' . $oInfo->ship_method . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $oInfo->ship_methods_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CREATE_ORDERS_SHIP, 'page=' . $HTTP_GET_VARS['page'] . '&shipID=' . $oInfo->ship_methods_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+
+        $payment_module_inputs_string = '';
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $payment_module_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_get_ship_method($oInfo->ship_methods_id, $languages[$i]['id']);
+       }
+
+        $contents[] = array('text' => $payment_module_inputs_string);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/crypt.php
===================================================================
--- trunk/direct.openmoko.com/admin/crypt.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/crypt.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,230 @@
+<?php
+/*
+  $Id: crypt_configuration.php,v 1.1.1.1 2004/03/04 23:38:18 ccwjr Exp $
+
+    Copyright (c) 2005 Chainreaction Works
+
+  Released under the GNU General Public License
+*/
+
+
+Header("Cache-control: private, no-cache");
+Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Past date
+Header("Pragma: no-cache");
+
+  require('includes/application_top.php');
+
+  /*  Removed because the configuration keys are already loaded
+  $crypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+  $crypt = tep_db_fetch_array($crypt_query);
+  $CURR_CRYPT = $crypt['configuration_value'];
+  */
+  if ( defined('PAYMENT_CC_CRYPT_PATH') ) $CURR_CRYPT = PAYMENT_CC_CRYPT_PATH;
+  
+  $file_name= 'cc_key.php';
+  $file_name_new1= 'new_cc_key.php';
+  $upload_fs_dir = DIR_FS_CATALOG.DIR_WS_INCLUDES.$CURR_CRYPT;
+  $upload_ws_dir = DIR_WS_CATALOF.DIR_WS_INCLUDES.$CURR_CRYPT;
+ 
+
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'save':
+        $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);
+        $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_CRYPT, 'gID=209&cID=' . $cID));
+        break;
+// #CP - supporting functions to upload key file to crypt  directory
+      case 'processuploads':
+
+        if (isset($GLOBALS['file_name_new']) && tep_not_null($GLOBALS['file_name_new'])) {
+
+          $up_load = new upload('file_name_new', $upload_fs_dir);
+          $file_name_new = $up_load->filename_new;
+
+          if($file_name_new != "new_cc_key.php"){
+          unlink($upload_fs_dir.$file_name_new1);
+         rename($upload_fs_dir.$file_name_new, $upload_fs_dir."new_cc_key.php");
+          }
+        }
+
+       tep_redirect(tep_href_link(FILENAME_CRYPT, 'gID=' . $HTTP_GET_VARS['gID']));
+        break;
+      case 'upload':
+        $directory_writeable = true;
+        if (!is_writeable($upload_fs_dir)) {
+          $directory_writeable = false;
+          $messageStack->add('search', sprintf(ERROR_KEY_DIRECTORY_NOT_WRITEABLE, $upload_fs_dir), 'error');
+        }
+        break;
+    }
+
+  }
+
+  $cfg_group_query = tep_db_query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '209'");
+  $cfg_group = tep_db_fetch_array($cfg_group_query);
+
+// check if the crypt image directory exists
+  if (is_dir($upload_fs_dir)) {
+    if (!is_writeable($upload_fs_dir)) {
+    $messageStack->add('search', ERROR_KEY_DIRECTORY_NOT_WRITEABLE . $upload_fs_dir, 'error');
+    }
+  } else {
+    $messageStack->add('search', ERROR_KEY_DIRECTORY_DOES_NOT_EXIST . $upload_fs_dir, 'error');
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo $cfg_group['configuration_group_title']; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+
+  $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '209' order by sort_order");
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+    if (tep_not_null($configuration['use_function'])) {
+      $use_function = $configuration['use_function'];
+      if (ereg('->', $use_function)) {
+        $class_method = explode('->', $use_function);
+        if (!is_object(${$class_method[0]})) {
+          include(DIR_WS_CLASSES . $class_method[0] . '.php');
+          ${$class_method[0]} = new $class_method[0]();
+        }
+        $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
+      } else {
+        $cfgValue = tep_call_function($use_function, $configuration['configuration_value']);
+      }
+    } else {
+      $cfgValue = $configuration['configuration_value'];
+    }
+
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cfg_extra_query = tep_db_query("select configuration_key, configuration_description, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . (int)$configuration['configuration_id'] . "'");
+      $cfg_extra = tep_db_fetch_array($cfg_extra_query);
+
+      $cInfo_array = array_merge($configuration, $cfg_extra);
+      $cInfo = new objectInfo($cInfo_array);
+    }
+
+    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
+      if($cInfo->set_function == 'file_upload'){
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CRYPT, 'gID=209&cID=' . $cInfo->configuration_id . '&action=upload') . '\'">' . "\n";
+      } else {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CRYPT, 'gID=209&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
+      }
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CRYPT, 'gID=209&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $configuration['configuration_title']; ?></td>
+                <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CRYPT, 'gID=209&cID=' . $configuration['configuration_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'edit':
+      $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function)  {
+        if (!($cInfo->set_function == 'file_upload')) {
+           eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value) . '");');
+        } else {
+           $value_field = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
+         }
+      } else {
+        $value_field = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
+      }
+
+      $contents = array('form' => tep_draw_form('configuration', FILENAME_CRYPT, 'gID=209&cID=' . $cInfo->configuration_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_CRYPT, 'gID=209&cID=' . $cInfo->configuration_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CRYPT, 'gID=209&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+        $contents[] = array('text' => '<br>' . $cInfo->configuration_description);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
+        if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
+      }
+
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/crypt_purge.php
===================================================================
--- trunk/direct.openmoko.com/admin/crypt_purge.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/crypt_purge.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,297 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1.1.1 2004/03/04 23:38:18 zip1 Exp $
+  Copyright (c) 2005 Chainreaction Works
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require('includes/functions/edit_text.php');
+  /*  Removed because the configuration keys are already loaded
+  $crypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+  $crypt = tep_db_fetch_array($crypt_query);
+  $CURR_CRYPT = $crypt['configuration_value'];
+  $crypt_query1 = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_FILE'");
+  $crypt1 = tep_db_fetch_array($crypt_query1);
+  $file_name = $crypt1['configuration_value'];
+  */
+  if ( defined('PAYMENT_CC_CRYPT_PATH') ) $CURR_CRYPT = PAYMENT_CC_CRYPT_PATH;
+  if ( defined('PAYMENT_CC_CRYPT_FILE') ) $file_name  = PAYMENT_CC_CRYPT_FILE;
+  
+  $fs_dir = DIR_FS_CATALOG.DIR_WS_INCLUDES.$CURR_CRYPT;
+  $ws_dir = DIR_WS_CATALOG.DIR_WS_INCLUDES.$CURR_CRYPT;
+  $dir1 = $fs_dir ;
+  $gID = '209';
+  $crypt_file = $dir1 . $file_name;
+  $crypt_file_new = $dir1 . 'new_' . $file_name;
+  $crypt_file_old = $dir1 . 'old_' . $file_name . 'bckp';
+   
+  if (tep_not_null($action)) {
+    switch ($HTTP_GET_VARS['action']) {
+  //encrypt cc number that are not encrypted
+       
+        // Remove CVV Number
+      case 'deleteallccinfo':
+        $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+        tep_db_query("update " . TABLE_ORDERS . " set cc_ccv = null");
+        tep_db_query("update " . TABLE_ORDERS . " set cc_number = '0000000000000000'");
+        tep_db_query("update " . TABLE_ORDERS . " set cc_expires = null");
+        tep_db_query("update " . TABLE_ORDERS . " set cc_start = null ");
+        tep_db_query("update " . TABLE_ORDERS . " set cc_issue = null ");
+  
+        tep_redirect(tep_href_link(FILENAME_CRYPT_PURGE, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit'));
+        break;
+  // Remove CVV Number
+    case 'deleteccinfo':
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+      tep_db_query("update " . TABLE_ORDERS . " set cc_ccv = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_number = '0000000000000000' where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_expires = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_start = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_issue = null where orders_id = '" . tep_db_input($oID) . "'");
+
+      tep_redirect(tep_href_link(FILENAME_CRYPT_PURGE, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit'));
+      break;
+    
+
+ } //end switch
+}// end if
+
+
+Header("Cache-control: private, no-cache");
+Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Past date
+Header("Pragma: no-cache");
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top">
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table>
+        </td>
+      </tr>
+
+ <?php   
+ if ($err_msg == '1'){
+   echo CC_ENCYPT_ERROR_01 ;
+   unset ($err_msg);
+   }
+if ($err_msg == '2'){
+   echo CC_ENCYPT_ERROR_02 ;
+   unset ($err_msg);
+       }   
+//------------------------------------------------------------------             
+//search for cc feild that have cc's             
+$the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where cc_number != 'NULL ' ");
+$the_extra= tep_db_fetch_array($the_extra_query);
+$the_customers_id= $the_extra['customers_id'];
+// Look up things in customers
+$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");
+$the_extra= tep_db_fetch_array($the_extra_query);
+ ?>            
+        <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+           </tr>
+        </table></td></tr>
+      <tr>
+ 
+ <?php // ckeck to see if key is empty
+      If (parseFileData($crypt_file) != ''){
+            $key_status = TEXT_KEY_STATUS_02;
+            $key_statusA = 0 ;
+            }else{
+            $key_status = TEXT_KEY_STATUS_01;
+            $key_statusA = 1 ;
+            }
+            ;?> 
+    
+           <td><?php echo TEXT_KEY_CURRENT . ' ' .$file_name . $key_status ;?></td>
+           </td>
+  </tr>
+           
+            </tr>
+            <tr>
+           <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+               <tr>
+             <td> <?php echo TEXT_PURGE_ALL . '&nbsp;' . tep_draw_form('convert', FILENAME_CRYPT_PURGE, '&action=convert', 'post', '', 'SSL');
+echo '<a href="' . tep_href_link(FILENAME_CRYPT_PURGE, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=deleteallccinfo') . '">' . tep_image_button('button_removeccinfo.gif', RemoveCVV);
+?>
+               </form>
+             </td>
+
+            </tr>   
+  </table></td>
+            </tr>
+            <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $HEADING_CUSTOMERS = TABLE_HEADING_CUSTOMERS;
+  $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=ascending">';
+  $HEADING_CUSTOMERS .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=decending">';
+  $HEADING_CUSTOMERS .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+  $HEADING_DATE_PURCHASED = TABLE_HEADING_DATE_PURCHASED;
+  $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=ascending">';
+  $HEADING_DATE_PURCHASED .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=decending">';
+  $HEADING_DATE_PURCHASED .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+ ?>
+              <tr class="dataTableHeadingRow">
+              <td class="dataTableHeadingContent"><?php echo $HEADING_CUSTOMERS; ?></td>
+              <td class="dataTableHeadingContent"><?php echo HEADING_TITLE_OID; ?></td>
+              <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_IS_ENCRYPTED; ?></td>
+              </tr>
+<?php
+    $sortorder = 'order by ';
+    if($_GET["sort"] == 'customer') {
+      if($_GET["order"] == 'ascending') {
+        $sortorder .= 'o.customers_name  asc, ';
+      } else {
+        $sortorder .= 'o.customers_name desc, ';
+      }
+    } elseif($_GET["sort"] == 'date') {
+      if($_GET["order"] == 'ascending') {
+        $sortorder .= 'o.date_purchased  asc, ';
+      } else {
+        $sortorder .= 'o.date_purchased desc, ';
+      }
+    }
+    $sortorder .= 'o.orders_id DESC';
+    
+    if (isset($HTTP_GET_VARS['cID'])) {
+      $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+      $orders_query_raw = "select o.orders_id, o.cc_number, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.cc_number > '1' and o.customers_id = '" . (int)$cID . "' and ot.orders_id = o.orders_id and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
+    } elseif (isset($HTTP_GET_VARS['status']) && (tep_not_null($HTTP_GET_VARS['status']))) {
+      $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+      $orders_query_raw = "select o.orders_id, o.cc_number, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.cc_number > '1' and o.orders_status = s.orders_status_id and ot.orders_id = o.orders_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
+    } else {
+      $orders_query_raw = "select o.orders_id, o.cc_number, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.cc_number > '1' and o.orders_status = s.orders_status_id and ot.orders_id = o.orders_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' " . $sortorder;
+    }
+    $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
+    $orders_query = tep_db_query($orders_query_raw);
+    while ($orders = tep_db_fetch_array($orders_query)) {
+       
+    
+    if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
+        $oInfo = new objectInfo($orders);
+      }
+
+      if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CRYPT_PURGE, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CRYPT_PURGE, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
+      }
+
+                    if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{6})", $orders['cc_number'])) ) { 
+                     $cc_number7 = $order->info['cc_number'];
+                     $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+                  }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{6})", $orders['cc_number'])) ) {
+               $cc_number7 = cc_decrypt($order->info['cc_number']);
+               $text_encypt3= TEXT_CARD_ENCRPYT;
+              }else{
+               $cc_number7 =$order->info['cc_number'];
+               $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+                      }
+?> 
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CRYPT_PURGET, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=deleteccinfo') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $orders['customers_name']; ?></td>
+                <td class="dataTableContent" align="left"><?php echo $orders['orders_id'] ; ?></td>
+                <td class="dataTableContent" align="left"><?php echo $text_encypt3 ; ?></td>
+               </tr>
+              
+<?php
+}
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>');
+
+      $contents = array('form' => tep_draw_form('orders', FILENAME_CRYPT_UPDATE, 'oID=' . $oInfo->orders_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br>');
+      $contents[] = array('text' => TEXT_INFO_DELETE_DATA . '&nbsp;' . $oInfo->customers_name . '<br>');
+      $contents[] = array('text' => TEXT_INFO_DELETE_DATA_OID . '&nbsp;<b>' . $oInfo->orders_id . '</b><br>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CRYPT_UPDATE, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+
+    default:
+      if (isset($oInfo) && is_object($oInfo)) {
+        $heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']&nbsp;&nbsp;' . tep_datetime_short($oInfo->date_purchased) . '</b>');
+
+        if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
+     $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CRYPT_PURGE, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=deleteccinfo') . '">' . tep_image_button('button_removeccinfo.gif', RemoveCVV));
+     $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
+     $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method);
+         }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+
+   
+?>             
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/crypt_test.php
===================================================================
--- trunk/direct.openmoko.com/admin/crypt_test.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/crypt_test.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: crypt_test.php,v 1.1.1.1 2004/03/04 23:38:18 ccwjr Exp $
+
+  Copyright (c) 2005 Chainreaction Works
+
+  Released under the GNU General Public License
+*/
+
+Header("Cache-control: private, no-cache");
+Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Past date
+Header("Pragma: no-cache");
+
+  require('includes/application_top.php');
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo 'Encrypt - Decrypt test '?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+             </tr>
+             <td>
+             <?php @mcrypt_check_sanity(); ?>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/crypt_update.php
===================================================================
--- trunk/direct.openmoko.com/admin/crypt_update.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/crypt_update.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,406 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1.1.1 2004/03/04 23:38:18 ccwjr Exp $
+  Copyright (c) 2005 Chainreaction Works
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  
+  if (tep_not_null($action)) {
+    switch ($HTTP_GET_VARS['action']) {
+  //encrypt cc number that are not encrypted
+     case 'encrypt_all':
+ //get all data
+      $orders_query_raw2 = tep_db_query("select orders_id, cc_number, cc_ccv, cc_expires from " . TABLE_ORDERS ." where cc_number > ' ' ");
+while ($orders_2 = tep_db_fetch_array($orders_query_raw2)) {
+       $orders_id_cur = $orders_2['orders_id'];
+       $cc_number_cur = $orders_2['cc_number'];
+       $cc_ccv_cur = $orders_2['cc_ccv'];
+       $cc_expires_cur = $orders_2['cc_expires'];
+
+ //check to see if cc number is encrypted       
+   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{6})", $cc_number_cur)) ) { 
+      //test if first 6 number 0 - 9 its not encrypted
+      $encypt1 = 'false' ;
+   }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{6})", $cc_number_cur)) ) {
+      //test if first 6 number not 0 - 9 its encrypted
+      $encypt1= 'true' ;
+   }else{
+      $encypt1 = 'false' ;
+      }
+//encyrpt current cc number if it is not encrypted
+  If ( ($encypt1 == 'false') && ($cc_number_cur != ' ' || $cc_number_cur != 'NULL') ){
+    // if its   
+      $cc_number_new = cc_encrypt($cc_number_cur);
+        $cc_ccv_new = cc_encrypt($cc_ccv_cur);      
+        $cc_expires_new = cc_encrypt($cc_expires_cur);      
+
+           $sql_data_array = array('cc_number' => $cc_number_new,
+                                   'cc_ccv' => $cc_ccv_new,
+                                   'cc_expires' => $cc_expires_new,
+                                    );
+       tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . $orders_id_cur . "'");                              
+     } 
+     }
+ tep_redirect(tep_href_link(FILENAME_CRYPT_UPDATE, '&err_msg=' . $err_msg, 'SSL'));
+
+
+        break;
+     case 'decrypt_all':
+ //get all data
+      $orders_query_raw2 = tep_db_query("select orders_id, cc_number, cc_ccv, cc_expires from " . TABLE_ORDERS ." where cc_number > ' ' ");
+while ($orders_2 = tep_db_fetch_array($orders_query_raw2)) {
+       $orders_id_cur = $orders_2['orders_id'];
+       $cc_number_cur = $orders_2['cc_number'];
+       $cc_ccv_cur = $orders_2['cc_ccv'];
+       $cc_expires_cur = $orders_2['cc_expires'];
+
+ //check to see if cc number is encrypted       
+   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{6})", $cc_number_cur)) ) { 
+      $encypt1 = 'false' ;
+   }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{6})", $cc_number_cur)) ) {
+      $encypt1= 'true' ;
+   }else{
+      $encypt1 = 'false' ;
+      }
+//encyrpt current cc number if it is not encrypted
+ If (($encypt1 == 'true') && ($cc_number_cur != ' ' || $cc_number_cur != 'NULL')){
+    //test: if it's encrypted and not null or empty 
+        $cc_number_new = cc_decrypt($cc_number_cur);
+        $cc_ccv_new = cc_decrypt($cc_ccv_cur);      
+        $cc_expires_new = cc_decrypt($cc_expires_cur);      
+
+           $sql_data_array = array('cc_number' => $cc_number_new,
+                                   'cc_ccv' => $cc_ccv_new,
+                                   'cc_expires' => $cc_expires_new,
+                                    );
+       tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . $orders_id_cur . "'");                              
+     } 
+    }
+ tep_redirect(tep_href_link(FILENAME_CRYPT_UPDATE, '&err_msg=' . $err_msg, 'SSL'));
+
+
+        break;
+  
+  
+     case 'encrypt':
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+   if (isset($HTTP_GET_VARS['oID'])) {
+ //get data
+
+      $orders_query_raw1 = tep_db_query("select cc_number, cc_ccv, cc_expires from " . TABLE_ORDERS . " where orders_id = '" . $HTTP_GET_VARS['oID']  . "' ");
+while ($orders_1 = tep_db_fetch_array($orders_query_raw1)) {
+       $cc_number_cur = $orders_1['cc_number'];
+       $cc_ccv_cur = $orders_1['cc_ccv'];
+       $cc_expires_cur = $orders_1['cc_expires'];
+}
+ //check to see if cc number is encrypted       
+   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{6})", $cc_number_cur)) ) { 
+      $encypt1 = 'false' ;
+   }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{6})", $cc_number_cur)) ) {
+      $encypt1= 'true' ;
+   }else{
+      $encypt1 = 'false' ;
+      }
+//decyrpt current cc number
+
+ If ($encypt1 == 'false'){
+      $cc_number_new = cc_encrypt($cc_number_cur);
+        $cc_ccv_new = cc_encrypt($cc_ccv_cur);      
+        $cc_expires_new = cc_encrypt($cc_expires_cur);      
+
+           $sql_data_array = array('cc_number' => $cc_number_new,
+                                   'cc_ccv' => $cc_ccv_new,
+                                   'cc_expires' => $cc_expires_new,
+                                    );
+       tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . (int)$oID . "'");                              
+     } else {
+     unset($err_msg);
+     $err_msg = '1';
+     }
+ tep_redirect(tep_href_link(FILENAME_CRYPT_UPDATE, 'oID=' . $oID . '&err_msg=' . $err_msg, 'SSL'));
+  }
+ //insert encrypted cc number
+        break;
+ 
+ case 'decrypt':
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+   if (isset($HTTP_GET_VARS['oID'])) {
+ //get data
+
+      $orders_query_raw1 = tep_db_query("select cc_number, cc_ccv, cc_expires from " . TABLE_ORDERS . " where orders_id = '" . $HTTP_GET_VARS['oID']  . "' ");
+while ($orders_1 = tep_db_fetch_array($orders_query_raw1)) {
+       $cc_number_cur = $orders_1['cc_number'];
+       $cc_ccv_cur = $orders_1['cc_ccv'];
+       $cc_expires_cur = $orders_1['cc_expires'];
+}
+ //check to see if cc number is encrypted       
+   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{6})", $cc_number_cur)) ) { 
+      $encypt1 = 'false' ;
+   }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{6})", $cc_number_cur)) ) {
+      $encypt1= 'true' ;
+   }else{
+      $encypt1 = 'false' ;
+      }
+//decyrpt current cc number
+
+ If ($encypt1 == 'true'){
+      $cc_number_new = cc_decrypt($cc_number_cur);
+        $cc_ccv_new = cc_decrypt($cc_ccv_cur);      
+        $cc_expires_new = cc_decrypt($cc_expires_cur);      
+
+           $sql_data_array = array('cc_number' => $cc_number_new,
+                                   'cc_ccv' => $cc_ccv_new,
+                                   'cc_expires' => $cc_expires_new,
+                                    );
+       tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . (int)$oID . "'");                              
+     } else {
+     unset($err_msg);
+     $err_msg = '2';
+     }
+ tep_redirect(tep_href_link(FILENAME_CRYPT_UPDATE, 'oID=' . $oID . '&err_msg=' . $err_msg, 'SSL'));
+   }
+   break;
+
+ } //end switch
+}// end if
+
+
+Header("Cache-control: private, no-cache");
+Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Past date
+Header("Pragma: no-cache");
+
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+
+
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top">
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table>
+        </td>
+      </tr>
+
+     <?php   
+     if ($err_msg == '1'){
+       echo CC_ENCYPT_ERROR_01 ;
+       unset ($err_msg);
+       }
+    if ($err_msg == '2'){
+       echo CC_ENCYPT_ERROR_02 ;
+       unset ($err_msg);
+       }   
+    //------------------------------------------------------------------             
+    //search for cc feild that have cc's             
+    $the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where cc_number != 'NULL ' ");
+    $the_extra= tep_db_fetch_array($the_extra_query);
+    $the_customers_id= $the_extra['customers_id'];
+    // Look up things in customers
+    $the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");
+    $the_extra= tep_db_fetch_array($the_extra_query);
+     ?>     
+        <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+           </tr>
+        </table></td></tr>
+      <tr>
+ 
+           </td>
+  </tr>
+           
+            </tr>
+            <tr>
+           <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+               <tr>
+             <td> <?php echo TEXT_ENCRPYT_ALL . '&nbsp;' . tep_draw_form('encrypt_all', FILENAME_CRYPT_UPDATE, '&action=encrypt_all', 'post', '', 'SSL');
+                  echo tep_image_submit('button_encrypt.gif', IMAGE_ENCRYPT); ?>
+               </form>
+             </td>
+           <td> <?php echo TEXT_DECRYPT_ALL . '&nbsp;' . tep_draw_form('decrypt_all', FILENAME_CRYPT_UPDATE, '&action=decrypt_all', 'post', '', 'SSL');
+                      echo tep_image_submit('button_decrypt.gif', IMAGE_DECRYPT);?>
+            </form>
+  </td>
+  
+  </table></td>
+            </tr>
+            <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $HEADING_CUSTOMERS = TABLE_HEADING_CUSTOMERS;
+  $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=ascending">';
+  $HEADING_CUSTOMERS .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=decending">';
+  $HEADING_CUSTOMERS .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+  $HEADING_DATE_PURCHASED = TABLE_HEADING_DATE_PURCHASED;
+  $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=ascending">';
+  $HEADING_DATE_PURCHASED .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=decending">';
+  $HEADING_DATE_PURCHASED .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+ ?>
+              <tr class="dataTableHeadingRow">
+              <td class="dataTableHeadingContent"><?php echo $HEADING_CUSTOMERS; ?></td>
+              <td class="dataTableHeadingContent"><?php echo HEADING_TITLE_OID; ?></td>
+              <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_IS_ENCRYPTED; ?></td>
+              <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $sortorder = 'order by ';
+    if($_GET["sort"] == 'customer') {
+      if($_GET["order"] == 'ascending') {
+        $sortorder .= 'o.customers_name  asc, ';
+      } else {
+        $sortorder .= 'o.customers_name desc, ';
+      }
+    } elseif($_GET["sort"] == 'date') {
+      if($_GET["order"] == 'ascending') {
+        $sortorder .= 'o.date_purchased  asc, ';
+      } else {
+        $sortorder .= 'o.date_purchased desc, ';
+      }
+    }
+    $sortorder .= 'o.orders_id DESC';
+    
+    if (isset($HTTP_GET_VARS['cID'])) {
+      $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+      $orders_query_raw = "select o.orders_id, o.cc_number, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.cc_number > '1' and o.customers_id = '" . (int)$cID . "' and ot.orders_id = o.orders_id and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
+    } elseif (isset($HTTP_GET_VARS['status']) && (tep_not_null($HTTP_GET_VARS['status']))) {
+      $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+      $orders_query_raw = "select o.orders_id, o.cc_number, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.cc_number > '1' and o.orders_status = s.orders_status_id and ot.orders_id = o.orders_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
+    } else {
+      $orders_query_raw = "select o.orders_id, o.cc_number, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.cc_number > '1' and o.orders_status = s.orders_status_id and ot.orders_id = o.orders_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' " . $sortorder;
+    }
+    $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
+    $orders_query = tep_db_query($orders_query_raw);
+    while ($orders = tep_db_fetch_array($orders_query)) {
+       
+    
+    if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
+        $oInfo = new objectInfo($orders);
+      }
+
+      if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CRYPT_UPDATE, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CRYPT_UPDATE, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
+      }
+
+                    if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{6})", $orders['cc_number'])) ) { 
+                     $cc_number7 = $order->info['cc_number'];
+                     $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+                  }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{6})", $orders['cc_number'])) ) {
+               $cc_number7 = cc_decrypt($order->info['cc_number']);
+               $text_encypt3= TEXT_CARD_ENCRPYT;
+              }else{
+               $cc_number7 =$order->info['cc_number'];
+               $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+                      }
+?> 
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CRYPT_UPDATE, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $orders['customers_name']; ?></td>
+                <td class="dataTableContent" align="left"><?php echo $orders['orders_id'] ; ?></td>
+                <td class="dataTableContent" align="left"><?php echo $text_encypt3 ; ?></td>
+                <td class="dataTableContent" align="left"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CRYPT_UPDATE, 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+              
+<?php
+}
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>');
+
+      $contents = array('form' => tep_draw_form('orders', FILENAME_CRYPT_UPDATE, 'oID=' . $oInfo->orders_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br>');
+      $contents[] = array('text' => TEXT_INFO_DELETE_DATA . '&nbsp;' . $oInfo->customers_name . '<br>');
+      $contents[] = array('text' => TEXT_INFO_DELETE_DATA_OID . '&nbsp;<b>' . $oInfo->orders_id . '</b><br>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CRYPT_UPDATE, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+
+    default:
+      if (isset($oInfo) && is_object($oInfo)) {
+        $heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']&nbsp;&nbsp;' . tep_datetime_short($oInfo->date_purchased) . '</b>');
+
+        if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
+     $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CRYPT_UPDATE, 'oID=' . $oInfo->orders_id . '&action=encrypt') . '">' . tep_image_button('button_encrypt.gif', IMAGE_ENCRYPT) . '</a> <a href="' . tep_href_link(FILENAME_CRYPT_UPDATE, 'oID=' . $oInfo->orders_id . '&action=decrypt') . '">' . tep_image_button('button_decrypt.gif', IMAGE_DECRYPT) . '</a>');
+     $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method);
+         }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+
+?>             
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+    require(DIR_WS_INCLUDES . 'footer.php');
+?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
+

Added: trunk/direct.openmoko.com/admin/currencies.php
===================================================================
--- trunk/direct.openmoko.com/admin/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,289 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:38:22 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+      case 'save':
+        if (isset($HTTP_GET_VARS['cID'])) $currency_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+        $title = tep_db_prepare_input($HTTP_POST_VARS['title']);
+        $code = tep_db_prepare_input($HTTP_POST_VARS['code']);
+        $symbol_left = tep_db_prepare_input($HTTP_POST_VARS['symbol_left']);
+        $symbol_right = tep_db_prepare_input($HTTP_POST_VARS['symbol_right']);
+        $decimal_point = tep_db_prepare_input($HTTP_POST_VARS['decimal_point']);
+        $thousands_point = tep_db_prepare_input($HTTP_POST_VARS['thousands_point']);
+        $decimal_places = tep_db_prepare_input($HTTP_POST_VARS['decimal_places']);
+        $value = tep_db_prepare_input($HTTP_POST_VARS['value']);
+
+        $sql_data_array = array('title' => $title,
+                                'code' => $code,
+                                'symbol_left' => $symbol_left,
+                                'symbol_right' => $symbol_right,
+                                'decimal_point' => $decimal_point,
+                                'thousands_point' => $thousands_point,
+                                'decimal_places' => $decimal_places,
+                                'value' => $value);
+
+        if ($action == 'insert') {
+          tep_db_perform(TABLE_CURRENCIES, $sql_data_array);
+          $currency_id = tep_db_insert_id();
+        } elseif ($action == 'save') {
+          tep_db_perform(TABLE_CURRENCIES, $sql_data_array, 'update', "currencies_id = '" . (int)$currency_id . "'");
+        }
+
+        if (isset($HTTP_POST_VARS['default']) && ($HTTP_POST_VARS['default'] == 'on')) {
+          tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($code) . "' where configuration_key = 'DEFAULT_CURRENCY'");
+        }
+
+        tep_redirect(tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $currency_id));
+        break;
+      case 'deleteconfirm':
+        $currencies_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        $currency_query = tep_db_query("select currencies_id from " . TABLE_CURRENCIES . " where code = '" . DEFAULT_CURRENCY . "'");
+        $currency = tep_db_fetch_array($currency_query);
+
+        if ($currency['currencies_id'] == $currencies_id) {
+          tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '' where configuration_key = 'DEFAULT_CURRENCY'");
+        }
+
+        tep_db_query("delete from " . TABLE_CURRENCIES . " where currencies_id = '" . (int)$currencies_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'update':
+        $server_used = CURRENCY_SERVER_PRIMARY;
+
+        $currency_query = tep_db_query("select currencies_id, code, title from " . TABLE_CURRENCIES);
+        while ($currency = tep_db_fetch_array($currency_query)) {
+          $quote_function = 'quote_' . CURRENCY_SERVER_PRIMARY . '_currency';
+          $rate = $quote_function($currency['code']);
+
+          if (empty($rate) && (tep_not_null(CURRENCY_SERVER_BACKUP))) {
+            $messageStack->add_session('search', sprintf(WARNING_PRIMARY_SERVER_FAILED, CURRENCY_SERVER_PRIMARY, $currency['title'], $currency['code']), 'warning');
+
+            $quote_function = 'quote_' . CURRENCY_SERVER_BACKUP . '_currency';
+            $rate = $quote_function($currency['code']);
+
+            $server_used = CURRENCY_SERVER_BACKUP;
+          }
+
+          if (tep_not_null($rate)) {
+            tep_db_query("update " . TABLE_CURRENCIES . " set value = '" . $rate . "', last_updated = now() where currencies_id = '" . (int)$currency['currencies_id'] . "'");
+
+            $messageStack->add_session('search', sprintf(TEXT_INFO_CURRENCY_UPDATED, $currency['title'], $currency['code'], $server_used), 'success');
+          } else {
+            $messageStack->add_session('search', sprintf(ERROR_CURRENCY_INVALID, $currency['title'], $currency['code'], $server_used), 'error');
+          }
+        }
+
+        tep_redirect(tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $HTTP_GET_VARS['cID']));
+        break;
+      case 'delete':
+        $currencies_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        $currency_query = tep_db_query("select code from " . TABLE_CURRENCIES . " where currencies_id = '" . (int)$currencies_id . "'");
+        $currency = tep_db_fetch_array($currency_query);
+
+        $remove_currency = true;
+        if ($currency['code'] == DEFAULT_CURRENCY) {
+          $remove_currency = false;
+          $messageStack->add('search', ERROR_REMOVE_DEFAULT_CURRENCY, 'error');
+        }
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CURRENCY_NAME; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CURRENCY_CODES; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CURRENCY_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $currency_query_raw = "select currencies_id, title, code, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, last_updated, value from " . TABLE_CURRENCIES . " order by title";
+  $currency_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $currency_query_raw, $currency_query_numrows);
+  $currency_query = tep_db_query($currency_query_raw);
+  while ($currency = tep_db_fetch_array($currency_query)) {
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $currency['currencies_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cInfo = new objectInfo($currency);
+    }
+
+    if (isset($cInfo) && is_object($cInfo) && ($currency['currencies_id'] == $cInfo->currencies_id) ) {
+      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $currency['currencies_id']) . '\'">' . "\n";
+    }
+
+    if (DEFAULT_CURRENCY == $currency['code']) {
+      echo '                <td class="dataTableContent"><b>' . $currency['title'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
+    } else {
+      echo '                <td class="dataTableContent">' . $currency['title'] . '</td>' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $currency['code']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo number_format($currency['value'], 8); ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($currency['currencies_id'] == $cInfo->currencies_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $currency['currencies_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $currency_split->display_count($currency_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CURRENCIES); ?></td>
+                    <td class="smallText" align="right"><?php echo $currency_split->display_links($currency_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td><?php if (CURRENCY_SERVER_PRIMARY) { echo '<a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=update') . '">' . tep_image_button('button_update_currencies.gif', IMAGE_UPDATE_CURRENCIES) . '</a>'; } ?></td>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=new') . '">' . tep_image_button('button_new_currency.gif', IMAGE_NEW_CURRENCY) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_CURRENCY . '</b>');
+
+      $contents = array('form' => tep_draw_form('currencies', FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . (isset($cInfo) ? '&cID=' . $cInfo->currencies_id : '') . '&action=insert'));
+      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_TITLE . '<br>' . tep_draw_input_field('title'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_CODE . '<br>' . tep_draw_input_field('code'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . '<br>' . tep_draw_input_field('symbol_left'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_RIGHT . '<br>' . tep_draw_input_field('symbol_right'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_POINT . '<br>' . tep_draw_input_field('decimal_point'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_THOUSANDS_POINT . '<br>' . tep_draw_input_field('thousands_point'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_PLACES . '<br>' . tep_draw_input_field('decimal_places'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_VALUE . '<br>' . tep_draw_input_field('value'));
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_INFO_SET_AS_DEFAULT);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $HTTP_GET_VARS['cID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CURRENCY . '</b>');
+
+      $contents = array('form' => tep_draw_form('currencies', FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_TITLE . '<br>' . tep_draw_input_field('title', $cInfo->title));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_CODE . '<br>' . tep_draw_input_field('code', $cInfo->code));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . '<br>' . tep_draw_input_field('symbol_left', $cInfo->symbol_left));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_RIGHT . '<br>' . tep_draw_input_field('symbol_right', $cInfo->symbol_right));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_POINT . '<br>' . tep_draw_input_field('decimal_point', $cInfo->decimal_point));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_THOUSANDS_POINT . '<br>' . tep_draw_input_field('thousands_point', $cInfo->thousands_point));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_PLACES . '<br>' . tep_draw_input_field('decimal_places', $cInfo->decimal_places));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_VALUE . '<br>' . tep_draw_input_field('value', $cInfo->value));
+      if (DEFAULT_CURRENCY != $cInfo->code) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_INFO_SET_AS_DEFAULT);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CURRENCY . '</b>');
+
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->title . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . (($remove_currency) ? '<a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=deleteconfirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' : '') . ' <a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->title . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_TITLE . ' ' . $cInfo->title);
+        $contents[] = array('text' => TEXT_INFO_CURRENCY_CODE . ' ' . $cInfo->code);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . ' ' . $cInfo->symbol_left);
+        $contents[] = array('text' => TEXT_INFO_CURRENCY_SYMBOL_RIGHT . ' ' . $cInfo->symbol_right);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_POINT . ' ' . $cInfo->decimal_point);
+        $contents[] = array('text' => TEXT_INFO_CURRENCY_THOUSANDS_POINT . ' ' . $cInfo->thousands_point);
+        $contents[] = array('text' => TEXT_INFO_CURRENCY_DECIMAL_PLACES . ' ' . $cInfo->decimal_places);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_LAST_UPDATED . ' ' . tep_date_short($cInfo->last_updated));
+        $contents[] = array('text' => TEXT_INFO_CURRENCY_VALUE . ' ' . number_format($cInfo->value, 8));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_EXAMPLE . '<br>' . $currencies->format('30', false, DEFAULT_CURRENCY) . ' = ' . $currencies->format('30', true, $cInfo->code));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1356 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  $error = false;
+  $processed = false;
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'update':
+        $customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+        $customers_firstname = tep_db_prepare_input($HTTP_POST_VARS['customers_firstname']);
+        $customers_lastname = tep_db_prepare_input($HTTP_POST_VARS['customers_lastname']);
+        $customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']);
+        $customers_telephone = tep_db_prepare_input($HTTP_POST_VARS['customers_telephone']);
+        $customers_fax = tep_db_prepare_input($HTTP_POST_VARS['customers_fax']);
+        $customers_newsletter = tep_db_prepare_input($HTTP_POST_VARS['customers_newsletter']);
+    $customers_emailvalidated= tep_db_prepare_input($HTTP_POST_VARS['customers_emailvalidated']);
+// BOF Separate Pricing per Customer
+  $customers_group_id = tep_db_prepare_input($HTTP_POST_VARS['customers_group_id']);
+  $customers_group_ra = tep_db_prepare_input($HTTP_POST_VARS['customers_group_ra']);
+  $entry_company_tax_id = tep_db_prepare_input($HTTP_POST_VARS['entry_company_tax_id']);
+  if ($HTTP_POST_VARS['customers_payment_allowed'] && $HTTP_POST_VARS['customers_payment_settings'] == '1') {
+  $customers_payment_allowed = tep_db_prepare_input($HTTP_POST_VARS['customers_payment_allowed']);
+  } else { // no error with subsequent re-posting of variables
+  $customers_payment_allowed = '';
+  if ($HTTP_POST_VARS['payment_allowed'] && $HTTP_POST_VARS['customers_payment_settings'] == '1') {
+    while(list($key, $val) = each($HTTP_POST_VARS['payment_allowed'])) {
+        if ($val == true) {
+        $customers_payment_allowed .= tep_db_prepare_input($val).';';
+        }
+     } // end while
+      $customers_payment_allowed = substr($customers_payment_allowed,0,strlen($customers_payment_allowed)-1);
+  } // end if ($HTTP_POST_VARS['payment_allowed'])
+  } // end else ($HTTP_POST_VARS['customers_payment_allowed']
+  if ($HTTP_POST_VARS['customers_shipment_allowed'] && $HTTP_POST_VARS['customers_shipment_settings'] == '1') {
+  $customers_shipment_allowed = tep_db_prepare_input($HTTP_POST_VARS['customers_shipment_allowed']);
+  } else { // no error with subsequent re-posting of variables
+
+    $customers_shipment_allowed = '';
+    if ($HTTP_POST_VARS['shipping_allowed'] && $HTTP_POST_VARS['customers_shipment_settings'] == '1') {
+      while(list($key, $val) = each($HTTP_POST_VARS['shipping_allowed'])) {
+        if ($val == true) {
+        $customers_shipment_allowed .= tep_db_prepare_input($val).';';
+        }
+      } // end while
+      $customers_shipment_allowed = substr($customers_shipment_allowed,0,strlen($customers_shipment_allowed)-1);
+    } // end if ($HTTP_POST_VARS['shipment_allowed'])
+  } // end else ($HTTP_POST_VARS['customers_shipment_allowed']
+
+// EOF Separate Pricing per Customer
+
+        $customers_gender = tep_db_prepare_input($HTTP_POST_VARS['customers_gender']);
+        $customers_dob = tep_db_prepare_input($HTTP_POST_VARS['customers_dob']);
+
+        $default_address_id = tep_db_prepare_input($HTTP_POST_VARS['default_address_id']);
+        $entry_street_address = tep_db_prepare_input($HTTP_POST_VARS['entry_street_address']);
+        $entry_suburb = tep_db_prepare_input($HTTP_POST_VARS['entry_suburb']);
+        $entry_postcode = tep_db_prepare_input($HTTP_POST_VARS['entry_postcode']);
+        $entry_city = tep_db_prepare_input($HTTP_POST_VARS['entry_city']);
+        $entry_country_id = tep_db_prepare_input($HTTP_POST_VARS['entry_country_id']);
+
+        $entry_company = tep_db_prepare_input($HTTP_POST_VARS['entry_company']);
+        $entry_state = tep_db_prepare_input($HTTP_POST_VARS['entry_state']);
+        if (isset($HTTP_POST_VARS['entry_zone_id'])) $entry_zone_id = tep_db_prepare_input($HTTP_POST_VARS['entry_zone_id']);
+
+        if (strlen($customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+          $error = true;
+          $entry_firstname_error = true;
+        } else {
+          $entry_firstname_error = false;
+        }
+
+        if (strlen($customers_lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+          $error = true;
+          $entry_lastname_error = true;
+        } else {
+          $entry_lastname_error = false;
+        }
+
+        if (ACCOUNT_DOB == 'true') {
+          if (checkdate(substr(tep_date_raw($customers_dob), 4, 2), substr(tep_date_raw($customers_dob), 6, 2), substr(tep_date_raw($customers_dob), 0, 4))) {
+            $entry_date_of_birth_error = false;
+          } else {
+            $error = true;
+            $entry_date_of_birth_error = true;
+          }
+        }
+
+        if (strlen($customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
+          $error = true;
+          $entry_email_address_error = true;
+        } else {
+          $entry_email_address_error = false;
+        }
+
+        if (!tep_validate_email($customers_email_address)) {
+          $error = true;
+          $entry_email_address_check_error = true;
+        } else {
+          $entry_email_address_check_error = false;
+        }
+
+        if (strlen($entry_street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
+          $error = true;
+          $entry_street_address_error = true;
+        } else {
+          $entry_street_address_error = false;
+        }
+
+        if (strlen($entry_postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
+          $error = true;
+          $entry_post_code_error = true;
+        } else {
+          $entry_post_code_error = false;
+        }
+
+        if (strlen($entry_city) < ENTRY_CITY_MIN_LENGTH) {
+          $error = true;
+          $entry_city_error = true;
+        } else {
+          $entry_city_error = false;
+        }
+
+        if ($entry_country_id == false) {
+          $error = true;
+          $entry_country_error = true;
+        } else {
+          $entry_country_error = false;
+        }
+
+        if (ACCOUNT_STATE == 'true') {
+          if ($entry_country_error == true) {
+            $entry_state_error = true;
+          } else {
+            $zone_id = 0;
+            $entry_state_error = false;
+            $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "'");
+            $check_value = tep_db_fetch_array($check_query);
+            $entry_state_has_zones = ($check_value['total'] > 0);
+            if ($entry_state_has_zones == true) {
+              $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "' and zone_name = '" . tep_db_input($entry_state) . "'");
+              if (tep_db_num_rows($zone_query) == 1) {
+                $zone_values = tep_db_fetch_array($zone_query);
+                $entry_zone_id = $zone_values['zone_id'];
+              } else {
+                $error = true;
+                $entry_state_error = true;
+              }
+            } else {
+              if ($entry_state == false) {
+                $error = true;
+                $entry_state_error = true;
+              }
+            }
+         }
+      }
+
+      if (strlen($customers_telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
+        $error = true;
+        $entry_telephone_error = true;
+      } else {
+        $entry_telephone_error = false;
+      }
+
+      $check_email = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "' and customers_id != '" . (int)$customers_id . "'");
+      if (tep_db_num_rows($check_email)) {
+        $error = true;
+        $entry_email_address_exists = true;
+      } else {
+        $entry_email_address_exists = false;
+      }
+
+      if ($error == false) {
+
+        $sql_data_array = array('customers_firstname' => $customers_firstname,
+                                'customers_lastname' => $customers_lastname,
+                                'customers_email_address' => $customers_email_address,
+                                'customers_telephone' => $customers_telephone,
+                                'customers_fax' => $customers_fax,
+                'customers_validation' => $customers_emailvalidated,
+ 'customers_newsletter' => $customers_newsletter,
+// BOF Separate Pricing per Customer
+                                'customers_group_id' => $customers_group_id,
+                                'customers_group_ra' => $customers_group_ra,
+        'customers_payment_allowed' => $customers_payment_allowed,
+        'customers_shipment_allowed' => $customers_shipment_allowed);
+// EOF Separate Pricing per Customer
+
+        if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $customers_gender;
+        if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($customers_dob);
+
+        tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "'");
+
+        tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customers_id . "'");
+
+        if ($entry_zone_id > 0) $entry_state = '';
+
+        $sql_data_array = array('entry_firstname' => $customers_firstname,
+                                'entry_lastname' => $customers_lastname,
+                                'entry_street_address' => $entry_street_address,
+                                'entry_postcode' => $entry_postcode,
+                                'entry_city' => $entry_city,
+                                'entry_country_id' => $entry_country_id);
+
+// BOF Separate Pricing Per Customer
+        if (ACCOUNT_COMPANY == 'true') {
+        $sql_data_array['entry_company'] = $entry_company;
+         $sql_data_array['entry_company_tax_id'] = $entry_company_tax_id;
+        }
+// EOF Separate Pricing Per Customer
+
+        if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $entry_suburb;
+
+        if (ACCOUNT_STATE == 'true') {
+          if ($entry_zone_id > 0) {
+            $sql_data_array['entry_zone_id'] = $entry_zone_id;
+            $sql_data_array['entry_state'] = '';
+          } else {
+            $sql_data_array['entry_zone_id'] = '0';
+            $sql_data_array['entry_state'] = $entry_state;
+          }
+        }
+
+        tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id));
+
+        } else if ($error == true) {
+          $cInfo = new objectInfo($HTTP_POST_VARS);
+          $processed = true;
+        }
+
+        break;
+      case 'deleteconfirm':
+        $customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        if (isset($HTTP_POST_VARS['delete_reviews']) && ($HTTP_POST_VARS['delete_reviews'] == 'on')) {
+          $reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'");
+          while ($reviews = tep_db_fetch_array($reviews_query)) {
+            tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$reviews['reviews_id'] . "'");
+          }
+
+          tep_db_query("delete from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'");
+        } else {
+          tep_db_query("update " . TABLE_REVIEWS . " set customers_id = null where customers_id = '" . (int)$customers_id . "'");
+        }
+
+// BOF Separate Pricing Per Customer
+// Once all customers with a specific customers_group_id have been deleted from
+// the table customers, the next time a customer is deleted, all entries in the table products_groups
+// that have the (now apparently obsolete) customers_group_id will be deleted!
+// If you don't want that, leave this section out, or comment it out
+// Note that when customers groups are deleted from the table customers_groups, all the
+// customers with that specific customer_group_id will be changed to customer_group_id = '0' (default/Retail)
+$multiple_groups_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS_GROUPS . " ");
+while ($group_ids = tep_db_fetch_array($multiple_groups_query)) {
+  $multiple_customers_query = tep_db_query("select distinct customers_group_id from " . TABLE_CUSTOMERS . " where customers_group_id = " . $group_ids['customers_group_id'] . " ");
+  if (!($multiple_groups = tep_db_fetch_array($multiple_customers_query))) {
+    tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $group_ids['customers_group_id'] . "'");
+  }
+}
+// EOF Separate Pricing Per Customer
+
+        tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customers_id . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customers_id . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customers_id . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customers_id . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customers_id . "'");
+        tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$customers_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action'))));
+        break;
+      default:
+/*$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id from
+" . TABLE_CUSTOMERS . " c, 
+" . TABLE_ADDRESS_BOOK . " a 
+where
+a.customers_id = c.customers_id and
+a.address_book_id = c.customers_default_address_id and
+c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");
+        $customers = tep_db_fetch_array($customers_query);
+        $cInfo = new objectInfo($customers);
+*/
+// BOF Separate Pricing Per Customer
+        $customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_company_tax_id, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_group_id,  c.customers_group_ra, c.customers_payment_allowed, c.customers_shipment_allowed, c.customers_default_address_id,c.customers_validation from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");
+
+        $module_directory = DIR_FS_CATALOG_MODULES . 'payment/';
+        $ship_module_directory = DIR_FS_CATALOG_MODULES . 'shipping/';
+
+        $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+        $directory_array = array();
+        if ($dir = @dir($module_directory)) {
+        while ($file = $dir->read()) {
+        if (!is_dir($module_directory . $file)) {
+           if (substr($file, strrpos($file, '.')) == $file_extension) {
+              $directory_array[] = $file; // array of all the payment modules present in includes/modules/payment
+                  }
+               }
+            }
+        sort($directory_array);
+        $dir->close();
+        }
+
+        $ship_directory_array = array();
+        if ($dir = @dir($ship_module_directory)) {
+        while ($file = $dir->read()) {
+        if (!is_dir($ship_module_directory . $file)) {
+           if (substr($file, strrpos($file, '.')) == $file_extension) {
+              $ship_directory_array[] = $file; // array of all shipping modules present in includes/modules/shipping
+                }
+              }
+            }
+            sort($ship_directory_array);
+            $dir->close();
+        }
+
+  $existing_customers_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
+
+// EOF Separate Pricing Per Customer
+        $customers = tep_db_fetch_array($customers_query);
+        $cInfo = new objectInfo($customers);
+// BOF Separate Pricing Per Customer
+  //      $shipment_allowed = explode (";",$cInfo->customers_shipment_allowed);
+// EOF Separate Pricing Per Customer
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php
+  if ($action == 'edit' || $action == 'update') {
+?>
+<script language="javascript"><!--
+
+function check_form() {
+  var error = 0;
+  var error_message = "<?php echo JS_ERROR; ?>";
+
+  var customers_firstname = document.customers.customers_firstname.value;
+  var customers_lastname = document.customers.customers_lastname.value;
+<?php if (ACCOUNT_COMPANY == 'true') echo 'var entry_company = document.customers.entry_company.value;' . "\n"; ?>
+<?php if (ACCOUNT_DOB == 'true') echo 'var customers_dob = document.customers.customers_dob.value;' . "\n"; ?>
+  var customers_email_address = document.customers.customers_email_address.value;
+  var entry_street_address = document.customers.entry_street_address.value;
+  var entry_postcode = document.customers.entry_postcode.value;
+  var entry_city = document.customers.entry_city.value;
+  var customers_telephone = document.customers.customers_telephone.value;
+
+<?php if (ACCOUNT_GENDER == 'true') { ?>
+  if (document.customers.customers_gender[0].checked || document.customers.customers_gender[1].checked) {
+  } else {
+    error_message = error_message + "<?php echo JS_GENDER; ?>";
+    error = 1;
+  }
+<?php } ?>
+
+  if (customers_firstname == "" || customers_firstname.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_FIRST_NAME; ?>";
+    error = 1;
+  }
+
+  if (customers_lastname == "" || customers_lastname.length < <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_LAST_NAME; ?>";
+    error = 1;
+  }
+
+<?php if (ACCOUNT_DOB == 'true') { ?>
+  if (customers_dob == "" || customers_dob.length < <?php echo ENTRY_DOB_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_DOB; ?>";
+    error = 1;
+  }
+<?php } ?>
+
+  if (customers_email_address == "" || customers_email_address.length < <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_EMAIL_ADDRESS; ?>";
+    error = 1;
+  }
+
+  if (entry_street_address == "" || entry_street_address.length < <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_ADDRESS; ?>";
+    error = 1;
+  }
+
+  if (entry_postcode == "" || entry_postcode.length < <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_POST_CODE; ?>";
+    error = 1;
+  }
+
+  if (entry_city == "" || entry_city.length < <?php echo ENTRY_CITY_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_CITY; ?>";
+    error = 1;
+  }
+
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+  if (document.customers.elements['entry_state'].type != "hidden") {
+    if (document.customers.entry_state.value == '' || document.customers.entry_state.value.length < <?php echo ENTRY_STATE_MIN_LENGTH; ?> ) {
+       error_message = error_message + "<?php echo JS_STATE; ?>";
+       error = 1;
+    }
+  }
+<?php
+  }
+?>
+
+  if (document.customers.elements['entry_country_id'].type != "hidden") {
+    if (document.customers.entry_country_id.value == 0) {
+      error_message = error_message + "<?php echo JS_COUNTRY; ?>";
+      error = 1;
+    }
+  }
+
+  if (customers_telephone == "" || customers_telephone.length < <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_TELEPHONE; ?>";
+    error = 1;
+  }
+
+  if (error == 1) {
+    alert(error_message);
+    return false;
+  } else {
+    return true;
+  }
+}
+//--></script>
+<?php
+  }
+?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ($action == 'edit' || $action == 'update') {
+    $newsletter_array = array(array('id' => '0', 'text' => ENTRY_NEWSLETTER_NO),
+                              array('id' => '1', 'text' => ENTRY_NEWSLETTER_YES));
+  
+  $emailvalidated_array = array(array('id' => '0', 'text' => ENTRY_EMAILVALIDATE_NO),
+                              array('id' => '1', 'text' => ENTRY_EMAILVALIDATE_YES));               
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('action')) . 'action=update', 'post', 'onSubmit="return check_form();"') . tep_draw_hidden_field('default_address_id', $cInfo->customers_default_address_id); ?>
+        <td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+<?php
+    if (ACCOUNT_GENDER == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_GENDER; ?></td>
+            <td class="main">
+<?php
+    if ($error == true) {
+      if ($entry_gender_error == true) {
+        echo tep_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_ERROR;
+      } else {
+        echo ($cInfo->customers_gender == 'm') ? MALE : FEMALE;
+        echo tep_draw_hidden_field('customers_gender');
+      }
+    } else {
+      echo tep_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . '&nbsp;&nbsp;' . FEMALE;
+    }
+?></td>
+          </tr>
+<?php
+    }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_firstname_error == true) {
+      echo tep_draw_input_field('customers_firstname', $cInfo->customers_firstname, 'maxlength="32"') . '&nbsp;' . ENTRY_FIRST_NAME_ERROR;
+    } else {
+      echo $cInfo->customers_firstname . tep_draw_hidden_field('customers_firstname');
+    }
+  } else {
+    echo tep_draw_input_field('customers_firstname', $cInfo->customers_firstname, 'maxlength="32"', true);
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_lastname_error == true) {
+      echo tep_draw_input_field('customers_lastname', $cInfo->customers_lastname, 'maxlength="32"') . '&nbsp;' . ENTRY_LAST_NAME_ERROR;
+    } else {
+      echo $cInfo->customers_lastname . tep_draw_hidden_field('customers_lastname');
+    }
+  } else {
+    echo tep_draw_input_field('customers_lastname', $cInfo->customers_lastname, 'maxlength="32"', true);
+  }
+?></td>
+          </tr>
+<?php
+    if (ACCOUNT_DOB == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+            <td class="main">
+
+<?php
+    if ($error == true) {
+      if ($entry_date_of_birth_error == true) {
+        echo tep_draw_input_field('customers_dob', tep_date_short($cInfo->customers_dob), 'maxlength="10"') . '&nbsp;' . ENTRY_DATE_OF_BIRTH_ERROR;
+      } else {
+        echo $cInfo->customers_dob . tep_draw_hidden_field('customers_dob');
+      }
+    } else {
+      echo tep_draw_input_field('customers_dob', tep_date_short($cInfo->customers_dob), 'maxlength="10"', true);
+    }
+?></td>
+          </tr>
+<?php
+    }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_email_address_error == true) {
+      echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR;
+    } elseif ($entry_email_address_check_error == true) {
+      echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
+    } elseif ($entry_email_address_exists == true) {
+      echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
+    } else {
+      echo $customers_email_address . tep_draw_hidden_field('customers_email_address');
+    }
+  } else {
+    echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"', true);
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+    if (ACCOUNT_COMPANY == 'true') {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_COMPANY; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_COMPANY; ?></td>
+            <td class="main">
+<?php
+    if ($error == true) {
+      if ($entry_company_error == true) {
+        echo tep_draw_input_field('entry_company', $cInfo->entry_company, 'maxlength="32"') . '&nbsp;' . ENTRY_COMPANY_ERROR;
+      } else {
+        echo $cInfo->entry_company . tep_draw_hidden_field('entry_company');
+      }
+    } else {
+      echo tep_draw_input_field('entry_company', $cInfo->entry_company, 'maxlength="32"');
+    }
+?></td>
+<!-- BOF Separate Pricing Per Customer -->
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_COMPANY_TAX_ID; ?></td>
+            <td class="main">
+<?php
+    if ($error == true) {
+      if ($entry_company_tax_id_error == true) {
+        echo tep_draw_input_field('entry_company_tax_id', $cInfo->entry_company_tax_id, 'maxlength="32"') . '&nbsp;' . ENTRY_COMPANY_TAX_ID_ERROR;
+      } else {
+        echo $cInfo->entry_company . tep_draw_hidden_field('entry_company_tax_id');
+      }
+    } else {
+      echo tep_draw_input_field('entry_company_tax_id', $cInfo->entry_company_tax_id, 'maxlength="32"');
+      }
+?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CUSTOMERS_GROUP_REQUEST_AUTHENTICATION; ?></td>
+            <td class="main">
+<?php
+    if ($error == true) {
+      if ($customers_group_ra_error == true) {
+        echo tep_draw_radio_field('customers_group_ra', '0', false, $cInfo->customers_group_ra) . '&nbsp;&nbsp;' . ENTRY_CUSTOMERS_GROUP_RA_NO . '&nbsp;&nbsp;' . tep_draw_radio_field('customers_group_ra', '1', false, $cInfo->customers_group_ra) . '&nbsp;&nbsp;' . ENTRY_CUSTOMERS_GROUP_RA_YES . '&nbsp;' . ENTRY_CUSTOMERS_GROUP_RA_ERROR;
+      } else {
+        echo ($cInfo->customers_group_ra == '0') ? ENTRY_CUSTOMERS_GROUP_RA_NO : ENTRY_CUSTOMERS_GROUP_RA_YES;
+        echo tep_draw_hidden_field('customers_group_ra');
+      }
+    } else {
+      echo tep_draw_radio_field('customers_group_ra', '0', false, $cInfo->customers_group_ra) . '&nbsp;&nbsp;' . ENTRY_CUSTOMERS_GROUP_RA_NO . '&nbsp;&nbsp;' . tep_draw_radio_field('customers_group_ra', '1', false, $cInfo->customers_group_ra) . '&nbsp;&nbsp;' . ENTRY_CUSTOMERS_GROUP_RA_YES;
+    }
+?></td>
+          </tr>
+<!-- EOF Separate Pricing Per Customer -->
+          </tr>
+
+
+</td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+    }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_ADDRESS; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_street_address_error == true) {
+      echo tep_draw_input_field('entry_street_address', $cInfo->entry_street_address, 'maxlength="64"') . '&nbsp;' . ENTRY_STREET_ADDRESS_ERROR;
+    } else {
+      echo $cInfo->entry_street_address . tep_draw_hidden_field('entry_street_address');
+    }
+  } else {
+    echo tep_draw_input_field('entry_street_address', $cInfo->entry_street_address, 'maxlength="64"', true);
+  }
+?></td>
+          </tr>
+<?php
+    if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_SUBURB; ?></td>
+            <td class="main">
+<?php
+    if ($error == true) {
+      if ($entry_suburb_error == true) {
+        echo tep_draw_input_field('suburb', $cInfo->entry_suburb, 'maxlength="32"') . '&nbsp;' . ENTRY_SUBURB_ERROR;
+      } else {
+        echo $cInfo->entry_suburb . tep_draw_hidden_field('entry_suburb');
+      }
+    } else {
+      echo tep_draw_input_field('entry_suburb', $cInfo->entry_suburb, 'maxlength="32"');
+    }
+?></td>
+          </tr>
+<?php
+    }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_post_code_error == true) {
+      echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"') . '&nbsp;' . ENTRY_POST_CODE_ERROR;
+    } else {
+      echo $cInfo->entry_postcode . tep_draw_hidden_field('entry_postcode');
+    }
+  } else {
+    echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"', true);
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CITY; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_city_error == true) {
+      echo tep_draw_input_field('entry_city', $cInfo->entry_city, 'maxlength="32"') . '&nbsp;' . ENTRY_CITY_ERROR;
+    } else {
+      echo $cInfo->entry_city . tep_draw_hidden_field('entry_city');
+    }
+  } else {
+    echo tep_draw_input_field('entry_city', $cInfo->entry_city, 'maxlength="32"', true);
+  }
+?></td>
+          </tr>
+<?php
+    if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_STATE; ?></td>
+            <td class="main">
+<?php
+    $entry_state = tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state);
+    if ($error == true) {
+      if ($entry_state_error == true) {
+        if ($entry_state_has_zones == true) {
+          $zones_array = array();
+          $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($cInfo->entry_country_id) . "' order by zone_name");
+          while ($zones_values = tep_db_fetch_array($zones_query)) {
+            $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+          }
+          echo tep_draw_pull_down_menu('entry_state', $zones_array) . '&nbsp;' . ENTRY_STATE_ERROR;
+        } else {
+          echo tep_draw_input_field('entry_state', tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)) . '&nbsp;' . ENTRY_STATE_ERROR;
+        }
+      } else {
+        echo $entry_state . tep_draw_hidden_field('entry_zone_id') . tep_draw_hidden_field('entry_state');
+      }
+    } else {
+      echo tep_draw_input_field('entry_state', tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state));
+    }
+
+?></td>
+         </tr>
+<?php
+    }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_country_error == true) {
+      echo tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id) . '&nbsp;' . ENTRY_COUNTRY_ERROR;
+    } else {
+      echo tep_get_country_name($cInfo->entry_country_id) . tep_draw_hidden_field('entry_country_id');
+    }
+  } else {
+    echo tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id);
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_CONTACT; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_telephone_error == true) {
+      echo tep_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"') . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_ERROR;
+    } else {
+      echo $cInfo->customers_telephone . tep_draw_hidden_field('customers_telephone');
+    }
+  } else {
+    echo tep_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"', true);
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
+            <td class="main">
+<?php
+  if ($processed == true) {
+    echo $cInfo->customers_fax . tep_draw_hidden_field('customers_fax');
+  } else {
+    echo tep_draw_input_field('customers_fax', $cInfo->customers_fax, 'maxlength="32"');
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_OPTIONS; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
+            <td class="main">
+<?php
+  if ($processed == true) {
+    if ($cInfo->customers_newsletter == '1') {
+      echo ENTRY_NEWSLETTER_YES;
+    } else {
+      echo ENTRY_NEWSLETTER_NO;
+    }
+    echo tep_draw_hidden_field('customers_newsletter');
+  } else {
+    echo tep_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0'));
+  }
+?></td>
+          </tr>
+       <!--  BOF Separate Pricing per Customer -->
+<tr>
+  <td class="main"><?php echo ENTRY_CUSTOMERS_GROUP_NAME; ?></td>
+  <?php
+  if ($processed != true) {
+    $index = 0;
+    while ($existing_customers =  tep_db_fetch_array($existing_customers_query)) {
+      $existing_customers_array[] = array("id" => $existing_customers['customers_group_id'], "text" => "&#160;".$existing_customers['customers_group_name']."&#160;");
+      ++$index;
+    }
+  } // end if ($processed != true )
+?>
+  <td class="main">
+  <?php 
+  if ($processed == true) {
+    echo $cInfo->customers_group_id . tep_draw_hidden_field('customers_group_id');
+  }else{
+    echo tep_draw_pull_down_menu('customers_group_id', $existing_customers_array, $cInfo->customers_group_id);
+  } 
+  ?></td>
+</tr>
+<tr>
+  <td class="main"><?php echo ENTRY_CUSTOMERS_EMAIL_VALIDATED;?>  </td>
+  </td>
+  <td class="main">
+  <?php
+  if(ACCOUNT_EMAIL_CONFIRMATION=='true')  { 
+    echo tep_draw_pull_down_menu('customers_emailvalidated', $emailvalidated_array, $cInfo->customers_validation);
+  }else{
+     echo  TEXT_EMAIL_VALIDATE_FEATURE . tep_draw_hidden_field('customers_emailvalidated', $cInfo->customers_validation);
+  }
+  ?>   
+  </td>
+</tr>  
+<!-- EOF Separate Pricing per Customer -->
+        </table></td>
+      </tr>
+<!-- BOF Separate Pricing per Customer -->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php include_once(DIR_WS_LANGUAGES . $language . '/modules.php');
+  echo HEADING_TITLE_MODULES_PAYMENT; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr bgcolor="#DEE4E8">
+            <td class="main" colspan="2"><?php if ($processed == true) {
+            if ($cInfo->customers_payment_settings == '1') {
+    echo ENTRY_CUSTOMERS_PAYMENT_SET ;
+    echo ' : ';
+      } else {
+    echo ENTRY_CUSTOMERS_PAYMENT_DEFAULT;
+      }
+      echo tep_draw_hidden_field('customers_payment_settings');
+            } else { // $processed != true
+            echo tep_draw_radio_field('customers_payment_settings', '1', false, (tep_not_null($cInfo->customers_payment_allowed)? '1' : '0' )) . '&nbsp;&nbsp;' . ENTRY_CUSTOMERS_PAYMENT_SET . '&nbsp;&nbsp;' . tep_draw_radio_field('customers_payment_settings', '0', false, (tep_not_null($cInfo->customers_payment_allowed)? '1' : '0' )) . '&nbsp;&nbsp;' . ENTRY_CUSTOMERS_PAYMENT_DEFAULT ; } ?></td>
+    </tr>
+<?php if ($processed != true) {
+    $payments_allowed = explode (";",$cInfo->customers_payment_allowed);
+    $module_active = explode (";",MODULE_PAYMENT_INSTALLED);
+    $installed_modules = array();
+    for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) {
+    $file = $directory_array[$i];
+    if (in_array ($directory_array[$i], $module_active)) {
+      include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/payment/' . $file);
+      include($module_directory . $file);
+
+     $class = substr($file, 0, strrpos($file, '.'));
+     if (tep_class_exists($class)) {
+       $module = new $class;
+       if ($module->check() > 0) {
+         $installed_modules[] = $file;
+       }
+     } // end if (tep_class_exists($class))
+?>
+          <tr>
+            <td class="main" colspan="2"><?php echo tep_draw_checkbox_field('payment_allowed[' . $i . ']', $module->code.".php" , (in_array ($module->code.".php", $payments_allowed)) ?  1 : 0); ?>&#160;&#160;<?php echo $module->title; ?></td>
+    </tr>
+<?php
+  } // end if (in_array ($directory_array[$i], $module_active))
+ } // end for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++)
+  ?>
+     <tr>
+            <td class="main" colspan="2" style="padding-left: 30px; padding-right: 10px; padding-top: 10px;"><?php echo ENTRY_CUSTOMERS_PAYMENT_SET_EXPLAIN ?></td>
+           </tr>
+<?php
+   } else { // end if ($processed != true)
+?>
+      <tr>
+            <td class="main" colspan="2"><?php if ($cInfo->customers_payment_settings == '1') {
+    echo $customers_payment_allowed;
+      } else {
+    echo ENTRY_CUSTOMERS_PAYMENT_DEFAULT;
+      }
+      echo tep_draw_hidden_field('customers_payment_allowed'); ?></td>
+    </tr>
+<?php
+ } // end else: $processed == true
+?>
+     </td>
+    </tr>
+   </table>
+  </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo HEADING_TITLE_MODULES_SHIPPING; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr bgcolor="#DEE4E8">
+            <td class="main" colspan="2"><?php if ($processed == true) {
+            if ($cInfo->customers_shipment_settings == '1') {
+    echo ENTRY_CUSTOMERS_SHIPPING_SET ;
+    echo ' : ';
+      } else {
+    echo ENTRY_CUSTOMERS_SHIPPING_DEFAULT;
+      }
+      echo tep_draw_hidden_field('customers_shipment_settings');
+            } else { // $processed != true
+            echo tep_draw_radio_field('customers_shipment_settings', '1', false, (tep_not_null($cInfo->customers_shipment_allowed)? '1' : '0' )) . '&nbsp;&nbsp;' . ENTRY_CUSTOMERS_SHIPPING_SET . '&nbsp;&nbsp;' . tep_draw_radio_field('customers_shipment_settings', '0', false, (tep_not_null($cInfo->customers_shipment_allowed)? '1' : '0' )) . '&nbsp;&nbsp;' . ENTRY_CUSTOMERS_SHIPPING_DEFAULT ; } ?></td>
+    </tr>
+<?php if ($processed != true) {
+    $shipment_allowed = explode (";",$cInfo->customers_shipment_allowed);
+    $ship_module_active = explode (";",MODULE_SHIPPING_INSTALLED);
+    $installed_shipping_modules = array();
+    for ($i = 0, $n = sizeof($ship_directory_array); $i < $n; $i++) {
+    $file = $ship_directory_array[$i];
+    if (in_array ($ship_directory_array[$i], $ship_module_active)) {
+      include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/shipping/' . $file);
+      include($ship_module_directory . $file);
+
+     $ship_class = substr($file, 0, strrpos($file, '.'));
+     if (tep_class_exists($ship_class)) {
+       $ship_module = new $ship_class;
+       if ($ship_module->check() > 0) {
+         $installed_shipping_modules[] = $file;
+       }
+     } // end if (tep_class_exists($ship_class))
+?>
+          <tr>
+            <td class="main" colspan="2"><?php echo tep_draw_checkbox_field('shipping_allowed[' . $i . ']', $ship_module->code.".php" , (in_array ($ship_module->code.".php", $shipment_allowed)) ?  1 : 0); ?>&#160;&#160;<?php echo $ship_module->title; ?></td>
+    </tr>
+<?php
+  } // end if (in_array ($ship_directory_array[$i], $ship_module_active))
+ } // end for ($i = 0, $n = sizeof($ship_directory_array); $i < $n; $i++)
+  ?>
+     <tr>
+            <td class="main" colspan="2" style="padding-left: 30px; padding-right: 10px; padding-top: 10px;"><?php echo ENTRY_CUSTOMERS_SHIPPING_SET_EXPLAIN ?></td>
+           </tr>
+<?php
+   } else { // end if ($processed != true)
+?>
+      <tr>
+            <td class="main" colspan="2"><?php if ($cInfo->customers_shipment_settings == '1') {
+    echo $customers_shipment_allowed;
+      } else {
+    echo ENTRY_CUSTOMERS_SHIPPING_DEFAULT;
+      }
+      echo tep_draw_hidden_field('customers_shipment_allowed'); ?></td>
+    </tr>
+<?php
+ } // end else: $processed == true
+?>
+     </td>
+    </tr>
+   </table>
+  </td>
+      </tr>
+<!-- EOF Separate Pricing per Customer -->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('action'))) .'">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </tr></form>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php 
+            echo tep_draw_form('search', FILENAME_CUSTOMERS, '', 'get'); 
+            if (isset($HTTP_GET_VARS[tep_session_name()])) {
+              echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+            }          
+          ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+<?php
+
+// BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
+          switch ($listing) {
+              case "id-asc":
+              $order = "c.customers_id";
+            break;
+            case "cg_name":
+              $order = "cg.customers_group_name, c.customers_lastname";
+            break;
+              case "cg_name-desc":
+              $order = "cg.customers_group_name DESC, c.customers_lastname";
+              break;
+              case "firstname":
+              $order = "c.customers_firstname";
+              break;
+              case "firstname-desc":
+              $order = "c.customers_firstname DESC";
+              break;
+              case "company":
+              $order = "a.entry_company, c.customers_lastname";
+              break;
+              case "company-desc":
+              $order = "a.entry_company DESC,c .customers_lastname DESC";
+              break;
+              case "ra":
+              $order = "c.customers_group_ra DESC, c.customers_id DESC";
+              break;
+              case "ra-desc":
+              $order = "c.customers_group_ra, c.customers_id DESC";
+              break;
+              case "lastname":
+              $order = "c.customers_lastname, c.customers_firstname";
+              break;
+              case "lastname-desc":
+              $order = "c.customers_lastname DESC, c.customers_firstname";
+              break;
+              default:
+              $order = "c.customers_id DESC";
+          }
+          if (isset($HTTP_GET_VARS[tep_session_name()])) {
+            $oscid = '&' . tep_session_name() . '=' . $HTTP_GET_VARS[tep_session_name()];
+          } else {
+            $oscid = '';
+          }
+
+/*  $HEADING_LASTNAME = TABLE_HEADING_LASTNAME;
+  $HEADING_LASTNAME .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=lastname&order=ascending">';
+  $HEADING_LASTNAME .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_LASTNAME .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=lastname&order=decending">';
+  $HEADING_LASTNAME .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+  $HEADING_FIRSTNAME = TABLE_HEADING_FIRSTNAME;
+  $HEADING_FIRSTNAME .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=firstname&order=ascending">';
+  $HEADING_FIRSTNAME .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_FIRSTNAME .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=firstname&order=decending">';
+  $HEADING_FIRSTNAME .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+  $HEADING_ACCOUNT_CREATED = TABLE_HEADING_ACCOUNT_CREATED;
+  $HEADING_ACCOUNT_CREATED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=account_created&order=ascending">';
+  $HEADING_ACCOUNT_CREATED .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_ACCOUNT_CREATED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=account_created&order=decending">';
+  $HEADING_ACCOUNT_CREATED .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+
+                <td class="dataTableHeadingContent"><?php echo $HEADING_LASTNAME; ?></td>
+                <td class="dataTableHeadingContent"><?php echo $HEADING_FIRSTNAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo $HEADING_ACCOUNT_CREATED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+*/?>
+                <td class="dataTableHeadingContent" valign="top"><a href="<?php echo "$PHP_SELF?listing=company" . $oscid; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . ENTRY_COMPANY . ALT_IC_UP); ?></a>&nbsp;<a href="<?php echo "$PHP_SELF?listing=company-desc" . $oscid; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . ENTRY_COMPANY . ALT_IC_DOWN); ?></a><br><?php echo ENTRY_COMPANY; ?></td>
+                <td class="dataTableHeadingContent" valign="top"><a href="<?php echo "$PHP_SELF?listing=lastname" . $oscid; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_LASTNAME . ALT_IC_UP); ?></a>&nbsp;<a href="<?php echo "$PHP_SELF?listing=lastname-desc" . $oscid; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_LASTNAME . ALT_IC_DOWN); ?></a><br><?php echo TABLE_HEADING_LASTNAME; ?></td>
+                <td class="dataTableHeadingContent" valign="top"><a href="<?php echo "$PHP_SELF?listing=firstname" . $oscid; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_FIRSTNAME . ALT_IC_UP); ?></a>&nbsp;<a href="<?php echo "$PHP_SELF?listing=firstname-desc" . $oscid; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_FIRSTNAME . ALT_IC_DOWN); ?></a><br><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
+    <td class="dataTableHeadingContent" valign="top"><a href="<?php echo "$PHP_SELF?listing=cg_name" . $oscid; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_CUSTOMERS_GROUPS . ALT_IC_UP); ?></a>&nbsp;<a href="<?php echo "$PHP_SELF?listing=cg_name-desc" . $oscid; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_CUSTOMERS_GROUPS . ALT_IC_DOWN); ?></a><br><?php echo TABLE_HEADING_CUSTOMERS_GROUPS; ?></td>
+                <td class="dataTableHeadingContent" align="right" valign="top"><a href="<?php echo "$PHP_SELF?listing=id-asc" . $oscid; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_ACCOUNT_CREATED . ALT_IC_UP_NUM); ?></a>&nbsp;<a href="<?php echo "$PHP_SELF?listing=id-desc" . $oscid; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_ACCOUNT_CREATED . ALT_IC_DOWN_NUM); ?></a><br><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?>
+                                </td><td class="dataTableHeadingContent" align="middle" valign="top"><a href="<?php echo "$PHP_SELF?listing=ra" . $oscid; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_REQUEST_AUTHENTICATION . ' --> RA first (to Top) '); ?></a>&nbsp;<a href="<?php echo "$PHP_SELF?listing=ra-desc" . $oscid; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_REQUEST_AUTHENTICATION . ' --> RA last (to Bottom)'); ?></a><br><?php echo TABLE_HEADING_REQUEST_AUTHENTICATION; ?>&nbsp;</td>
+                </td><td class="dataTableHeadingContent" align="right" valign="top"><?php echo tep_draw_separator('pixel_trans.gif', '11', '12'); ?>&nbsp;<br><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  // EOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
+    $search = '';
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+      $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
+     // $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'";
+     $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'";
+    }
+    // BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
+    $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_id, c.customers_group_ra, a.entry_country_id, a.entry_company, cg.customers_group_name from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join customers_groups cg on c.customers_group_id = cg.customers_group_id " . $search . " order by $order";
+    // c.customers_lastname, c.customers_firstname";
+    // EOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer
+  
+/*    $search = '';
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+      $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
+      $search = " and c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'";
+    }
+    // BOM Mod:provide an order by option
+    $sortorder = 'order by c.customers_lastname, c.customers_firstname';
+    switch ($_GET["sort"]) {
+      case 'lastname':
+        if($_GET["order"]==ascending) {
+          $sortorder = 'order by c.customers_lastname  asc';
+        } else {
+          $sortorder = 'order by c.customers_lastname  desc';
+        }
+        break;
+      case 'firstname':
+        if($_GET["order"]==ascending) {
+          $sortorder = 'order by c.customers_firstname  asc';
+        } else {
+          $sortorder = 'order by c.customers_firstname  desc';
+        }
+        break;
+      default:
+        if($_GET["order"]==ascending) {
+          $sortorder = 'order by c.customers_id  asc';
+        } else {
+          $sortorder = 'order by c.customers_id  desc';
+        }
+        break;
+    }
+
+//    $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";
+/*$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from
+" . TABLE_CUSTOMERS . " c, 
+" . TABLE_ADDRESS_BOOK . " a
+where
+a.customers_id = c.customers_id and
+a.address_book_id = c.customers_default_address_id 
+" . $search . $sortorder;
+*/
+// EOM mod
+    $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);
+    $customers_query = tep_db_query($customers_query_raw);
+    while ($customers = tep_db_fetch_array($customers_query)) {
+      $info_query = tep_db_query("select customers_info_date_account_created as date_account_created, customers_info_date_account_last_modified as date_account_last_modified, customers_info_date_of_last_logon as date_last_logon, customers_info_number_of_logons as number_of_logons from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'");
+      $info = tep_db_fetch_array($info_query);
+
+      if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $customers['customers_id']))) && !isset($cInfo)) {
+        $country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$customers['entry_country_id'] . "'");
+        if ( !$country = tep_db_fetch_array($country_query) ) {
+          $country = array();
+        }
+
+        $reviews_query = tep_db_query("select count(*) as number_of_reviews from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers['customers_id'] . "'");
+        if ( !$reviews = tep_db_fetch_array($reviews_query) ) {
+          $reviews = array();
+        }
+
+        $customer_info = @array_merge($country, $info, $reviews);
+
+        $cInfo_array = @array_merge($customers, $customer_info);
+        $cInfo = new objectInfo($cInfo_array);
+      }
+
+      if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) {
+        echo '          <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '\'">' . "\n";
+      }
+
+// BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer 
+?>
+                <td class="dataTableContent"><?php
+                if (strlen($customers['entry_company']) > 16 ) {
+             print ("<acronym title=\"".$customers['entry_company']."\">".substr($customers['entry_company'], 0, 16)."&#160;</acronym>");
+             } else {
+                echo $customers['entry_company']; } ?></td>
+                <td class="dataTableContent"><?php
+                if (strlen($customers['customers_lastname']) > 15 ) {
+             print ("<acronym title=\"".$customers['customers_lastname']."\">".substr($customers['customers_lastname'], 0, 15)."&#160;</acronym>");
+             } else {
+                echo $customers['customers_lastname']; } ?></td>
+                <td class="dataTableContent"><?php
+                if (strlen($customers['customers_firstname']) > 15 ) {
+             print ("<acronym title=\"".$customers['customers_firstname']."\">".substr($customers['customers_firstname'], 0, 15)."&#160;</acronym>");
+             } else {
+            echo $customers['customers_firstname']; } ?></td>
+    <td class="dataTableContent"><?php
+                if (strlen($customers['customers_group_name']) > 17 ) {
+             print ("<acronym title=\"".$customers['customers_group_name']."\"> ".substr($customers['customers_group_name'], 0, 17)."&#160;</acronym>");
+             } else {
+                echo $customers['customers_group_name'] ;
+                }
+// EOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer ?></td>
+                <td class="dataTableContent" align="right"><?php echo tep_date_short($info['date_account_created']); ?></td>
+                <td  class="dataTableContent" align="middle">
+<?php
+      if ($customers['customers_group_ra'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_GREEN, 10, 10);
+        } else {
+        echo tep_draw_separator('pixel_trans.gif', '10', '10');
+        } ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr><!-- BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer colspan 4 to 7 -->
+                <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<!-- EOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer -->
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
+                  </tr>
+<?php
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+?>
+                  <tr>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+              </tr>
+<!-- BOF Separate Pricing Per Customer: show numbers of customers in each customers group -->
+<?php
+   if (!isset($HTTP_GET_VARS['search'])) {
+   $customers_groups_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
+   while ($existing_customers_groups =  tep_db_fetch_array($customers_groups_query)) {
+   $existing_customers_groups_array[] = array("id" => $existing_customers_groups['customers_group_id'], "text" => $existing_customers_groups['customers_group_name']);
+   }
+   $count_groups_query = tep_db_query("select customers_group_id, count(*) as count from " . TABLE_CUSTOMERS . " group by customers_group_id order by count desc");
+   while ($count_groups = tep_db_fetch_array($count_groups_query)) {
+  for ($n = 0; $n < sizeof($existing_customers_groups_array); $n++) {
+    if ($count_groups['customers_group_id'] == $existing_customers_groups_array[$n]['id']) {
+      $count_groups['customers_group_name'] = $existing_customers_groups_array[$n]['text'];
+    }
+  } // end for ($n = 0; $n < sizeof($existing_customers_groups_array); $n++)
+  $count_groups_array[] = array("id" => $count_groups['customers_group_id'], "number_in_group" => $count_groups['count'], "name" => $count_groups['customers_group_name']);
+   }
+?>
+              <tr>
+           <td style="padding-top: 10px;" align="center" colspan="7"><table border="0" cellspacing="0" cellpadding="2" style="border: 1px solid #c9c9c9">
+     <tr class="dataTableHeadingRow">
+     <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS_GROUPS ?></td>
+     <td class="dataTableHeadingContent">&#160;</td>
+     <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CUSTOMERS_NO?></td>
+     </tr>
+<?php $c = '0'; // variable used for background coloring of rows
+   for ($z = 0; $z < sizeof($count_groups_array); $z++) {
+    $bgcolor = ($c++ & 1) ? ' class="dataTableRow"' : '';
+     ?>
+     <tr<?php echo $bgcolor; ?>>
+     <td class="dataTableContent"><?php echo $count_groups_array[$z]['name']; ?></td>
+     <td class="dataTableContent">&#160;</td>
+     <td class="dataTableContent" align="right"><?php echo $count_groups_array[$z]['number_in_group'] ?></td>
+     </tr>
+<?php
+   } // end for ($z = 0; $z < sizeof($count_groups_array); $z++)
+?>     </table>
+     </td>
+              <tr>
+<?php
+  } // end if (!isset($HTTP_GET_VARS['search']))
+?>
+<!-- EOF Separate Pricing Per Customer: show numbers of customers in each customers group -->
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'confirm':
+// BOF Separate Pricing Per Customer: dark grey field with customer name higher
+      $heading[] = array('text' => ''. tep_draw_separator('pixel_trans.gif', '11', '12') .'&nbsp;<br><b>' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '</b>');
+// EOF Separate Pricing Per Customer
+      $contents = array('form' => tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
+      if (isset($cInfo->number_of_reviews) && ($cInfo->number_of_reviews) > 0) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+// BOF Separate Pricing Per Customer: dark grey field with customer name higher
+        $heading[] = array('text' => ''. tep_draw_separator('pixel_trans.gif', '11', '12') .'&nbsp;<br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
+// EOF Separate Pricing Per Customer
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_orders.gif', IMAGE_ORDERS) . '</a> <a href="' . tep_href_link(FILENAME_MAIL, 'selected_box=tools&customer=' . $cInfo->customers_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a> <a href="' . tep_href_link(FILENAME_CREATE_ORDER, 'Customer=' . $cInfo->customers_id) . '">' . tep_image_button('button_create_order.gif', IMAGE_BUTTON_CREATE_ORDER) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_CREATED . ' ' . tep_date_short($cInfo->date_account_created));
+        $contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->date_account_last_modified));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_LAST_LOGON . ' '  . tep_date_short($cInfo->date_last_logon));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_OF_LOGONS . ' ' . $cInfo->number_of_logons);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . ' ' . $cInfo->countries_name);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_OF_REVIEWS . ' ' . $cInfo->number_of_reviews);
+    if(ACCOUNT_EMAIL_CONFIRMATION=='true')
+    {
+      $contents[] = array('text' => '<br>' .'<a href="' . tep_href_link(FILENAME_VALIDATE_NEW, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirm') . '">Resend Validation Email</a>');
+    }
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/data.php
===================================================================
--- trunk/direct.openmoko.com/admin/data.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/data.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,105 @@
+<?php
+/*
+  $Id: server_info.php,v 1.6 2003/06/30 13:13:49 dgw_ Exp $
+
+
+  Copyright (c) 2005 Chainreactionworks.com
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="menuBoxHeading">
+                         <tr>
+                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                       <tr>
+                         <td class="pageHeading"><?php echo HEADING_TITLE ; ?></td>
+                        </tr>
+                        <tr>
+                        <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                       </tr>
+                     </table></td>
+                   </tr>
+<tr class="attributeBoxContent">
+
+ <td>
+ <?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'  ; ?>
+</td>
+</tr>
+    <tr class="content_heading">
+        <td>
+        <!-- Welcome to the Data Export/Import system -->
+    <?php echo WELCOME_TO_DATA_EXPORT_IMPORT_SYSTEM?>
+        </td>
+        </tr>
+        <tr class="content">
+        <td>
+  <!--  Please use the menu box to the left to select your task.<br><br>
+   
+   For in depth help use one of the links below <br><br> -->
+   <?php echo MSG_1?>
+     
+</td></tr><tr class="content"><td> <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=1') . '"> '.MSG_2.' </a> <br><br>'; ?>
+</td></tr><tr class="content"><td>&nbsp; <?php echo MSG_3?> 
+</td></tr><tr><td> &nbsp;&nbsp;&nbsp; <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=2') . '"> '.MSG_4.' </a>'; ?>
+</td></tr><tr><td> &nbsp;&nbsp;&nbsp; <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=3') . '"> '.MSG_5.' </a>'; ?>                  
+</td></tr><tr><td> &nbsp;&nbsp;&nbsp; <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=4') . '"> '.MSG_6.'</a>'; ?>              
+</td></tr><tr><td> &nbsp;&nbsp;&nbsp; <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=5') . '"> '.MSG_7.'</a>'; ?>              
+</td></tr><tr><td> &nbsp;&nbsp;&nbsp; <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=6') . '"> '.MSG_8.'</a>'; ?>              
+   
+</td></tr><tr><td class="content"> &nbsp; <!-- Data Feeder: --> <?php echo MSG_9?>
+</td></tr><tr><td> &nbsp;&nbsp;&nbsp; <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=9') . '">'.MSG_10.'</a>'; ?>
+</td></tr><tr><td> &nbsp;&nbsp;&nbsp; <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=10') . '"> '.MSG_11.'</a>'; ?>
+</td></tr><tr><td> &nbsp;&nbsp;&nbsp; <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=11') . '"> '.MSG_12.'</a>'; ?>
+</td></tr><tr><td> &nbsp;&nbsp;&nbsp; <?php echo '<a href="' . tep_href_link(FILENAME_DATA_HELP, 'help_id=12') . '"> '.MSG_13.'</a>'; ?>
+
+         </td>
+      </tr>
+      <tr>
+              <td>
+             </td>
+
+      </tr>
+
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/data_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/data_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/data_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,532 @@
+<?php
+/*
+  $Id: data_admin.php,v 1.6 2003/06/30 13:13:49 dgw_ Exp $
+
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  function tep_set_data_status($data_files_id, $data_status) {
+    if ($data_status == '1') {
+      return tep_db_query("update " .TABLE_DATA_FILES . " set data_status = '1' where data_files_id = '" . $data_files_id . "'");
+    } elseif ($data_status == '0') {
+      return tep_db_query("update " .TABLE_DATA_FILES . " set data_status = '0' where data_files_id = '" . $data_files_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+  switch ($HTTP_GET_VARS['action']) {
+
+      case 'returnsetflag':
+        tep_set_data_status($HTTP_GET_VARS['dID'], $HTTP_GET_VARS['flag']);
+        tep_redirect(tep_href_link(FILENAME_DATA_ADMIN, 'dID=' . $HTTP_GET_VARS['dID'] . '&action=edit', 'NONSSL') );
+        break;
+
+    case 'setflag':
+      tep_set_data_status($HTTP_GET_VARS['dID'], $HTTP_GET_VARS['flag']);
+      tep_redirect(tep_href_link(FILENAME_DATA_ADMIN, 'dID=' . $HTTP_GET_VARS['dID'], 'NONSSL'));
+      break;
+    case 'insert':
+
+   $insert_sql_data = array('data_files_type' => tep_db_prepare_input($HTTP_POST_VARS['data_files_type']), 
+                                 'data_name' => tep_db_prepare_input($HTTP_POST_VARS['data_name']), 
+                           'data_files_disc' => tep_db_prepare_input($HTTP_POST_VARS['data_files_disc']), 
+                           'data_files_type' => tep_db_prepare_input($HTTP_POST_VARS['data_files_type']), 
+                          'data_files_type1' => tep_db_prepare_input($HTTP_POST_VARS['data_files_type1']), 
+                        'data_files_service' => tep_db_prepare_input($HTTP_POST_VARS['data_files_service']),
+                               'data_status' => tep_db_prepare_input($HTTP_POST_VARS['data_status']),
+                           'data_files_name' => tep_db_prepare_input($HTTP_POST_VARS['data_files_name']),
+                            'data_image_url' => tep_db_prepare_input($HTTP_POST_VARS['data_image_url']),
+                          'data_product_url' => tep_db_prepare_input($HTTP_POST_VARS['data_product_url']),
+                           'data_ftp_server' => tep_db_prepare_input($HTTP_POST_VARS['data_ftp_server']),
+                        'data_ftp_user_name' => tep_db_prepare_input($HTTP_POST_VARS['data_ftp_user_name']),
+                        'data_ftp_user_pass' => tep_db_prepare_input($HTTP_POST_VARS['data_ftp_user_pass']),
+                        'data_ftp_directory' => tep_db_prepare_input($HTTP_POST_VARS['data_ftp_directory']),
+                         'data_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['data_tax_class_id']),
+                          'data_convert_cur' => tep_db_prepare_input($HTTP_POST_VARS['data_convert_cur']),
+                              'data_cur_use' => tep_db_prepare_input($HTTP_POST_VARS['data_cur_use']),
+                                  'data_cur' => tep_db_prepare_input($HTTP_POST_VARS['data_cur']),
+                             'data_lang_use' => tep_db_prepare_input($HTTP_POST_VARS['data_lang_use']),
+                            'data_lang_char' => tep_db_prepare_input($HTTP_POST_VARS['data_lang_char']),
+                                 );
+
+($insert_sql_data);     
+   tep_db_perform(TABLE_DATA_FILES, $insert_sql_data, 'insert');
+  //  tep_db_perform(TABLE_DATA_FILES, $insert_sql_data);
+      tep_redirect(tep_href_link(FILENAME_DATA_ADMIN, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'dID=' . $data_files_id));
+
+//      tep_redirect(tep_href_link(FILENAME_DATA_ADMIN, 'dID=' . (int)$data_files_id));));
+      break;
+    case 'update':
+    $sql_data_array = array('data_files_type' => tep_db_prepare_input($HTTP_POST_VARS['data_files_type']), 
+                                 'data_name' => tep_db_prepare_input($HTTP_POST_VARS['data_name']), 
+                           'data_files_disc' => tep_db_prepare_input($HTTP_POST_VARS['data_files_disc']), 
+                           'data_files_type' => tep_db_prepare_input($HTTP_POST_VARS['data_files_type']), 
+                          'data_files_type1' => tep_db_prepare_input($HTTP_POST_VARS['data_files_type1']), 
+                        'data_files_service' => tep_db_prepare_input($HTTP_POST_VARS['data_files_service']),
+                           'data_files_name' => tep_db_prepare_input($HTTP_POST_VARS['data_files_name']),
+                            'data_image_url' => tep_db_prepare_input($HTTP_POST_VARS['data_image_url']),
+                          'data_product_url' => tep_db_prepare_input($HTTP_POST_VARS['data_product_url']),
+                           'data_ftp_server' => tep_db_prepare_input($HTTP_POST_VARS['data_ftp_server']),
+                        'data_ftp_user_name' => tep_db_prepare_input($HTTP_POST_VARS['data_ftp_user_name']),
+                        'data_ftp_user_pass' => tep_db_prepare_input($HTTP_POST_VARS['data_ftp_user_pass']),
+                        'data_ftp_directory' => tep_db_prepare_input($HTTP_POST_VARS['data_ftp_directory']),
+                         'data_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['data_tax_class_id']),
+                          'data_convert_cur' => tep_db_prepare_input($HTTP_POST_VARS['data_convert_cur']),
+                              'data_cur_use' => tep_db_prepare_input($HTTP_POST_VARS['data_cur_use']),
+                                  'data_cur' => tep_db_prepare_input($HTTP_POST_VARS['data_cur']),
+                             'data_lang_use' => tep_db_prepare_input($HTTP_POST_VARS['data_lang_use']),
+                            'data_lang_char' => tep_db_prepare_input($HTTP_POST_VARS['data_lang_char']),
+                                 );
+//print_r($sql_data_array); 
+ 
+      tep_db_perform(TABLE_DATA_FILES, $sql_data_array, 'update', "data_files_id = '" . (int)$data_files_id . "'");
+      tep_redirect(tep_href_link(FILENAME_DATA_ADMIN, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'dID=' . $data_files_id));
+
+ //    tep_redirect(tep_href_link(FILENAME_DATA_ADMIN, 'dID=' . (int)$data_files_id));
+      break;
+    case 'deleteconfirm':
+      $data_files_id = tep_db_prepare_input($HTTP_GET_VARS['dID']);
+
+      tep_db_query("delete from " .TABLE_DATA_FILES . " where data_files_id = '" . tep_db_input($data_files_id) . "'");
+
+      tep_redirect(tep_href_link(FILENAME_DATA_ADMIN, 'page=1&dID=' ));
+      break;
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+<link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE . '&nbsp;' ; 
+            echo $HTTP_GET_VARS['action'];
+            $HTTP_GET_VARS['action']?> </td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+        <?php
+  if ( ($HTTP_GET_VARS['action'] == 'new') || ($HTTP_GET_VARS['action'] == 'edit') ) {
+    $form_action = 'insert';
+    if ( ($HTTP_GET_VARS['action'] == 'edit') && ($HTTP_GET_VARS['dID']) ) {
+    $form_action = 'update';
+
+     $data_query = tep_db_query("select * from " . TABLE_DATA_FILES . " where data_files_id = '" . $HTTP_GET_VARS['dID'] . "' order by data_files_service ");
+      $data = tep_db_fetch_array($data_query);
+
+      $dInfo = new objectInfo($data);
+    } else {
+      $dInfo = new objectInfo(array());
+
+// create an array of data datas, which will be excluded from the pull down menu of datas
+// (when creating a new data data)
+      $data_array = array();
+      $data_query = tep_db_query("select data_files_id from " . TABLE_DATA_FILES . " s where s.data_files_id = data_files_id");
+      while ($data = tep_db_fetch_array($data_query)) {
+        $data_array[] = $data['data_files_id'];
+      }
+    }
+?>
+      <tr><form name="new_data" <?php echo 'action="' . tep_href_link(FILENAME_DATA_ADMIN, tep_get_all_get_params(array('action', 'info', 'dID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('data_files_id', $HTTP_GET_VARS['dID']); ?>
+        <td><br><table border="0" cellspacing="0" cellpadding="2">
+  <?php // build new/edit settings form 
+  
+  if ($HTTP_GET_VARS['action'] == 'new'){
+  $heading=  HEADING_TITLE_1;
+  }else if ($HTTP_GET_VARS['action'] == 'edit'){
+  $heading=  HEADING_TITLE_2;
+  }
+           ?>
+           
+                 <tr>
+             <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+               <tr>
+                 <td class="pageHeading"><?php echo $heading; ?></td>
+                </tr>
+                <tr>
+                <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+               </tr>
+             </table></td>
+           </tr>
+          <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_NAME . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=froogle_feed_name') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main"><?php echo tep_draw_input_field('data_name', ($dInfo->data_name), 'size="12"'); ?> </td>
+            </tr>
+
+          <?php
+              $file_type_array = array(array('id' => 'basic', 'text' => TEXT_TYPE_BASIC) ,
+                                 array('id' => 'advance', 'text' => TEXT_TYPE_ADVANCE));
+          ?>
+          <tr>     
+            <td class="main"><?php echo TABLE_HEADING_FEED_TYPE_PRODUCT .'&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FILE_TYPE_PRODUCT') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?></td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('data_files_type', $file_type_array, ($dInfo->data_files_type), ''); ?> </td>
+        
+         </tr>
+
+          <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_DISC . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FEED_DISC') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?></td>
+          <td class="main"><?php echo tep_draw_textarea_field('data_files_disc', 'soft', '32', '1', ($dInfo->data_files_disc) ? stripslashes($dInfo->data_files_disc) : ($dInfo->data_files_disc) ); ?></td>
+
+          
+           </tr>
+          <?php
+              $file_type_array1 = array(array('id' => 'none', 'text' => TEXT_TYPE_NONE) ,
+                                 array('id' => 'products', 'text' => TEXT_TYPE_PRODUCTS) ,
+                                 array('id' => 'business', 'text' => TEXT_TYPE_BUSINESS));
+          ?>
+          <tr>     
+            <td class="main"><?php echo TABLE_HEADING_FEED_FILE_TYPE . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FILE_TYPE') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?></td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('data_files_type1', $file_type_array1, ($dInfo->data_files_type1)); ?> </td>
+        
+         </tr>
+          <?php
+                 $file_feed_array = array(array('id' => 'none', 'text' => TEXT_TYPE_NONE) ,
+                                   array('id' => 'froogle', 'text' => TEXT_FEED_FROOGLE) ,
+                                   array('id' => 'yahoo', 'text' => TEXT_FEED_YAHOO));
+             ?>
+
+          <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_FEED_SERVICE . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FEED_SERVICE') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            <td class="main"><?php echo tep_draw_pull_down_menu('data_files_service', $file_feed_array, ($dInfo->data_files_service), ''); ?> </td>
+            </td>
+            </tr>
+            
+          <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_STATUS. '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FEED_STATUS') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?></td>
+            <td class="main"><?php
+      if ($data['data_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_DATA_ADMIN, tep_get_all_get_params(array('dID')) . 'action=returnsetflag&flag=0&dID=' . $data['data_files_id'] , 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_DATA_ADMIN, tep_get_all_get_params(array('dID')) . 'action=returnsetflag&flag=1&dID=' . $HTTP_GET_VARS['dID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+            </tr>
+          <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_FILE . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FEED_FILE') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main"><?php echo tep_draw_input_field('data_files_name', ($dInfo->data_files_name), 'size="25"'); ?> </td>
+            </tr>
+          <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_IMAGE . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FEED_IMAGE') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main"><?php echo tep_draw_input_field('data_image_url', ($dInfo->data_image_url), 'size="25"'); ?> </td>
+            </tr>
+            <tr>
+      <td class="main"><?php echo TABLE_HEADING_FEED . '&nbsp';   ?>
+            </td>
+                  </tr>
+               <tr>
+
+           <tr>
+            <td class="main">&nbsp;&nbsp;&nbsp;
+             <?php echo TABLE_HEADING_FEED_FTP_SERVER . '&nbsp';
+                   echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FTP_SERVER') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+                 ?>
+               </td>
+           
+           <td class="main">&nbsp;&nbsp;&nbsp;<?php echo tep_draw_input_field('data_ftp_server', ($dInfo->data_ftp_server), 'size="15"'); ?> </td>
+            </tr>
+         <tr>
+            <td class="main">&nbsp;&nbsp;&nbsp;<?php echo TABLE_HEADING_FEED_FTP_USER . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FTP_USER') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main">&nbsp;&nbsp;&nbsp;<?php echo tep_draw_input_field('data_ftp_user_name', ($dInfo->data_ftp_user_name), 'size="15"'); ?> </td>
+            </tr>
+          <tr>
+            <td class="main">&nbsp;&nbsp;&nbsp;<?php echo TABLE_HEADING_FEED_FTP_PASSWORD . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FTP_PASSWORD') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main">&nbsp;&nbsp;&nbsp;<?php echo tep_draw_input_field('data_ftp_user_pass', ($dInfo->data_ftp_user_pass), 'size="15"'); ?> </td>
+            </tr>
+          <tr>
+            <td class="main">&nbsp;&nbsp;&nbsp;<?php echo TABLE_HEADING_FEED_FTP_DIRECTORY . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FTP_DIRECTORY') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main">&nbsp;&nbsp;&nbsp;<?php echo tep_draw_input_field('data_ftp_directory', ($dInfo->data_ftp_directory), 'size="32"'); ?> </td>
+            </tr>
+    </tr>
+      <td class="main"><?php echo TABLE_HEADING_FEED_ADVANCE . '&nbsp';   ?>
+            </td>
+      </tr>
+            
+          <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_CUR . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FEED_CUR') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+     <?php
+  if (!isset($dInfo->data_cur_use)) $dInfo->data_cur_use = 'TRUE';   
+   switch ($dInfo->data_cur_use) {
+      case 'false':
+        $data_cur_use_false_status = false;
+         $data_cur_use_true_status = true;
+      break;
+      case 'true':
+      default: 
+        $data_cur_use_false_status = true; 
+        $data_cur_use_true_status = false; 
+      break;
+    }
+     ?>
+   <td class="main"><?php echo '&nbsp;' . tep_draw_radio_field('data_cur_use', 'true', $data_cur_use_false_status) . '&nbsp;' . TEXT_DATA_CUR_USE_FALSE . '&nbsp;' . tep_draw_radio_field('data_cur_use', 'false', $data_cur_use_true_status) . '&nbsp;' . TEXT_DATA_CUR_USE_TRUE; ?></td>
+            </tr>
+          <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_CUR_USE . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_CUR_USE') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main"><?php echo tep_draw_input_field('data_cur', ($dInfo->data_cur), 'size="15"'); ?> </td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_CUR_CON . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_CUR_CON') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            
+                <?php
+        if (!isset($dInfo->data_convert_cur)) $dInfo->data_convert_cur = 'TRUE';   
+         switch ($dInfo->data_convert_cur) {
+            case 'false':
+               $data_convert_cur_false_status = true;
+               $data_convert_cur_true_status = false;
+            break;
+            case 'true':
+              $data_convert_cur_false_status = false; 
+              $data_convert_cur_true_status = true; 
+            break;
+          }
+           ?>
+         <td class="main"><?php echo '&nbsp;' . tep_draw_radio_field('data_convert_cur', 'false', $data_convert_cur_false_status) . '&nbsp;' . TEXT_DATA_CUR_CONVERT_FALSE . '&nbsp;' . tep_draw_radio_field('data_convert_cur', 'true', $data_convert_cur_true_status) . '&nbsp;' . TEXT_DATA_CUR_CONVERT_TRUE; ?></td>
+
+            </tr>
+          <tr>
+                <?php
+        if (!isset($dInfo->data_lang_use)) $dInfo->data_lang_use = 'true';   
+         switch ($dInfo->data_lang_use) {
+            case 'false':
+               $data_lang_use_false = false;
+               $data_lang_use_cur_true = true;
+            break;
+            case 'true':
+            default: 
+              $data_lang_use_false = true; 
+              $data_lang_use_true = false; 
+            break;
+          }
+           ?>
+          
+            <td class="main"><?php echo TABLE_HEADING_FEED_LANG . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FEED_LANG') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main"><?php echo '&nbsp;' . tep_draw_radio_field('data_lang_use', 'true', $data_lang_use_false) . '&nbsp;' . TEXT_DATA_CUR_LANG_FALSE . '&nbsp;' . tep_draw_radio_field('data_lang_use', 'false', $data_lang_use_true) . '&nbsp;' . TEXT_DATA_CUR_LANG_TRUE; ?></td>
+           
+            </tr>
+          <tr>
+          <?php
+                 $file_lang_array = array(array('id' => 'en', 'text' => TEXT_LANG_EN) ,
+                                   array('id' => 'fr', 'text' => TEXT_LANG_FR) ,
+                                   array('id' => 'de', 'text' => TEXT_LANG_DE),
+                                   array('id' => 'it', 'text' => TEXT_LANG_IT),
+                                   array('id' => 'es', 'text' => TEXT_LANG_ES),
+                                   array('id' => 'ja', 'text' => TEXT_LANG_JA));
+             ?>
+          
+            <td class="main"><?php echo TABLE_HEADING_FEED_LANG_USE . '&nbsp';
+            echo '</td><td>'. '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FEED_LANG_USE') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('data_lang_char', $file_lang_array, ($dInfo->data_lang_char)); ?> </td>
+           </tr>
+         
+         <tr>
+            <td class="main"><?php echo TABLE_HEADING_FEED_TAX . '&nbsp';
+            echo '</td><td>' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=FROOGLE_FEED_TAX') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+             ?>
+            </td>
+            <td class="main"><?php echo tep_draw_input_field('data_tax_class_id', ($dInfo->data_tax_class_id), 'size="8"'); ?> </td>
+            </tr>
+
+            </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_DATA_ADMIN, 'dID=' . $data['data_files_id']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </form></tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TEXT_DATA_FEED_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="right">&nbsp;<?php echo TABLE_HEADING_FEED_FEED_SERVICE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_FEED_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $data_query_raw1 = "select * from  " . TABLE_DATA_FILES . " order by data_files_service ";
+    $data_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $data_query_raw1, $data_query_numrows1);
+    $data_query1 = tep_db_query($data_query_raw1);
+    while ($data1 = tep_db_fetch_array($data_query1)) {
+    if ((!isset($HTTP_GET_VARS['dID']) || (isset($HTTP_GET_VARS['dID']) && ($HTTP_GET_VARS['dID'] == $data1['data_files_id']))) && !isset($dInfo) && (substr($action, 0, 3) != 'new')) {
+        $dInfo_array1 = $data1;
+        $dInfo1 = new objectInfo($dInfo_array1);
+   }
+         
+      if ( isset($dInfo1) && is_object($dInfo1) && ($data1['data_files_id'] == $dInfo1->data_files_id) ) {
+        echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_DATA_ADMIN, tep_get_all_get_params(array('dID', 'action')) . 'dID=' . $dInfo1->data_files_id . '&action=edit') . '\'">' . "\n";
+       } else {
+        echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_DATA_ADMIN, tep_get_all_get_params(array('dID')) . 'dID=' . $data1['data_files_id']) . '\'">' . "\n";
+      }
+     
+  ?>
+                <td  class="dataTableContent"><?php echo $data1['data_name'] ; ?></td>
+                <td  class="dataTableContent" align="right">&nbsp;<?php echo $data1['data_files_service']; ?></td>
+                <td  class="dataTableContent" align="right">
+<?php
+      if ($data1['data_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_DATA_ADMIN, 'action=setflag&flag=0&dID=' . $data['data_files_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_DATA_ADMIN, 'action=setflag&flag=1&dID=' . $data1['data_files_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($dInfo1) && is_object($dInfo1) && ($data1['data_files_id'] == $dInfo1->data_files_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_DATA_ADMIN, tep_get_all_get_params(array('dID')) . 'dID=' . $data1['data_files_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+      
+      </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $data_split->display_count($data_query_numrows1, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_DATA); ?></td>
+                    <td class="smallText" align="right"><?php echo $data_split->display_links($data_query_numrows1, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+ // if (!$HTTP_GET_VARS['action']) {
+?>
+                  <tr> 
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DATA_ADMIN, '&action=new') . '">' . tep_image_button('button_new.gif', IMAGE_NEW_SETTING) . '</a>'; ?></td>
+                  </tr>
+<?php
+ // }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_DATA . '</b>');
+
+      $contents = array('form' => tep_draw_form('data', FILENAME_DATA_ADMIN, tep_get_all_get_params(array('dID')) . 'dID=' . $dInfo1->data_files_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $dInfo1->data_name . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(tep_get_all_get_params(array('dID')) . 'dID=' . $dInfo1->data_files_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($dInfo1)) {
+        $heading[] = array('text' => '<b>' . $dInfo1->data_files_disc . '</b>');
+
+      if ($dInfo1->data_status == '1'){
+         $data_status1 = TEXT_DATA_ID_ACTIVE;
+         }else{
+         $data_status1 = TEXT_DATA_ID_DEACTIVE;
+         }
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_DATA_ADMIN, tep_get_all_get_params(array('dID')) . 'dID=' . $dInfo1->data_files_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_DATA_ADMIN, tep_get_all_get_params(array('dID')) . 'dID=' . $dInfo1->data_files_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_FEED_NAME . ' ' . $dInfo1->data_name);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_FEED_TYPE . ' ' . $dInfo1->data_files_type);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_FEED_SERVICE . ' ' . $dInfo1->data_files_service);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_FEED_STATUS . ' <b>' . $data_status1 . '</b>');
+      }
+      break;
+  }
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+}
+?>
+               </td>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+  require('includes/application_top.php');
+  //basic langage defines
+require(DIR_WS_LANGUAGES . $language . '/help/data_help.php')
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+
+<?php if ($help_id == '1') {  
+define('HEADING_TITLE', HEADING_TITLE1);
+}
+if ($help_id == '2') {  
+define('HEADING_TITLE', HEADING_TITLE2);
+}
+if ($help_id == '3') {  
+define('HEADING_TITLE', HEADING_TITLE3);
+}
+if ($help_id == '4') {  
+define('HEADING_TITLE', HEADING_TITLE4);
+}
+if ($help_id == '5') {  
+define('HEADING_TITLE', HEADING_TITLE5);
+}
+if ($help_id == '6') {  
+define('HEADING_TITLE', HEADING_TITLE6);
+}
+if ($help_id == '9') {  
+define('HEADING_TITLE', HEADING_TITLE9);
+}
+if ($help_id == '10') {  
+define('HEADING_TITLE', HEADING_TITLE10);
+}
+if ($help_id == '11') {  
+define('HEADING_TITLE', HEADING_TITLE11);
+}
+if ($help_id == '12') {  
+define('HEADING_TITLE', HEADING_TITLE12);
+}
+
+?>
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="menuBoxHeading">
+                         <tr>
+                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                       <tr>
+                         <td class="pageHeading"><?php echo HEADING_TITLE ; ?></td>
+                        </tr>
+                        <tr>
+                        <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                       </tr>
+                     </table></td>
+                   </tr>
+<tr class="attributeBoxContent">
+
+ <td>
+ <?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'  ; ?>
+</td>
+</tr>
+    <tr>
+        <td>
+<?php
+if ($help_id == '1') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_intro.html') ;
+}
+if ($help_id == '2') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_import.html') ;
+}
+ if ($help_id == '3') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_export.html') ;
+}
+ if ($help_id == '4') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_basicimport.html') ;
+}
+ if ($help_id == '5') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_basicexport.html') ;
+}
+ if ($help_id == '6') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_spreadsheet.html') ;
+}
+if ($help_id == '9') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_feed_intro.html') ;
+}
+if ($help_id == '10') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_frooglebacisgettingstarted.html') ;
+}
+if ($help_id == '11') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_froogleconfigure.html') ;
+}
+if ($help_id == '12') {  
+include(DIR_WS_LANGUAGES . $language . '/help/ep/data_frooglerun.html') ;
+}
+
+?>
+       </td>
+      </tr>
+  <tr>
+   <td>
+   </td>
+   </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
+
+

Added: trunk/direct.openmoko.com/admin/define_language.php
===================================================================
--- trunk/direct.openmoko.com/admin/define_language.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/define_language.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,194 @@
+<?php
+/*
+  $Id: define_language.php,v 1.1.1.1 2004/03/04 23:38:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!isset($HTTP_GET_VARS['lngdir'])) $HTTP_GET_VARS['lngdir'] = $language;
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'save':
+        if (isset($HTTP_GET_VARS['lngdir']) && isset($HTTP_GET_VARS['filename'])) {
+          if ($HTTP_GET_VARS['filename'] == $HTTP_GET_VARS['lngdir'] . '.php') {
+            $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
+          } else {
+            $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'] . '/' . $HTTP_GET_VARS['filename'];
+          }
+
+          if (file_exists($file)) {
+            if (file_exists('bak' . $file)) {
+              @unlink('bak' . $file);
+            }
+
+            @rename($file, 'bak' . $file);
+
+            $new_file = fopen($file, 'w');
+  $file_contents = stripslashes($HTTP_POST_VARS['file_contents']);
+  //          $file_contents = $HTTP_POST_VARS['file_contents'];
+            fwrite($new_file, $file_contents, strlen($file_contents));
+            fclose($new_file);
+          }
+          tep_redirect(tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']));
+        }
+        break;
+    }
+  }
+
+  $languages_array = array();
+  $languages = tep_get_languages();
+  $lng_exists = false;
+  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+    if ($languages[$i]['directory'] == $HTTP_GET_VARS['lngdir']) $lng_exists = true;
+
+    $languages_array[] = array('id' => $languages[$i]['directory'],
+                               'text' => $languages[$i]['name']);
+  }
+
+  if (!$lng_exists) $HTTP_GET_VARS['lngdir'] = $language;
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('lng', FILENAME_DEFINE_LANGUAGE, '', 'get'); ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_pull_down_menu('lngdir', $languages_array, $language, 'onChange="this.form.submit();"'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (isset($HTTP_GET_VARS['lngdir']) && isset($HTTP_GET_VARS['filename'])) {
+    if ($HTTP_GET_VARS['filename'] == $HTTP_GET_VARS['lngdir'] . '.php') {
+      $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
+    } else {
+      $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'] . '/' . $HTTP_GET_VARS['filename'];
+    }
+
+    if (file_exists($file)) {
+      $file_array = file($file);
+      $contents = implode('', $file_array);
+
+      $file_writeable = true;
+      if (!is_writeable($file)) {
+        $file_writeable = false;
+        $messageStack->reset();
+        $messageStack->add('language_error', sprintf(ERROR_FILE_NOT_WRITEABLE, $file), 'error');
+      if ($messageStack->size('language_error') > 0) {
+        echo $messageStack->output(language_error);
+         }
+      }
+
+?>
+          <tr><?php echo tep_draw_form('language', FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $HTTP_GET_VARS['filename'] . '&action=save'); ?>
+            <td><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo $HTTP_GET_VARS['filename']; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo tep_draw_textarea_field('file_contents', 'soft', '80', '20', $contents, (($file_writeable) ? '' : 'readonly')); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td align="right"><?php if ($file_writeable == true) { echo tep_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;<a href="' . tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; } ?></td>
+              </tr>
+            </table></td>
+          </form></tr>
+<?php
+    } else {
+?>
+          <tr>
+            <td class="main"><b><?php echo TEXT_FILE_DOES_NOT_EXIST; ?></b></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo '<a href="' . tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+<?php
+    }
+  } else {
+    $filename = $HTTP_GET_VARS['lngdir'] . '.php';
+?>
+          <tr>
+            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="smallText"><a href="<?php echo tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $filename); ?>"><b><?php echo $filename; ?></b></a></td>
+<?php
+    $left = false;
+    if ($dir = dir(DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'])) {
+      $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+      while ($file = $dir->read()) {
+        if (substr($file, strrpos($file, '.')) == $file_extension) {
+          echo '                <td class="smallText"><a href="' . tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $file) . '">' . $file . '</a></td>' . "\n";
+          if (!$left) {
+            echo '              </tr>' . "\n" .
+                 '              <tr>' . "\n";
+          }
+          $left = !$left;
+        }
+      }
+      $dir->close();
+    }
+?>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+  }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/define_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/admin/define_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/define_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,224 @@
+<?php
+/*
+  $Id: define_mainpage.php,v 1.1.1.1 2004/03/04 23:38:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  //////////////////////////////////////////////////////////////////////////
+
+  define_mainpage.php Version 1.2
+
+  DESCRIPTION:
+
+  An extremely simple hack of define_languages.php, this file
+  ALWAYS looks for the file mainpage.php in the language directory.
+  This is a nice example to show how easy you can adapt existing code
+  to your needs; apart from the translation and filename(s) I only had to
+  add ONE SINGLE LINE to define_languages.php to make it into this.
+
+  06/04/02 Matthijs (mattice at xs4all.nl)
+
+  This file has been edit to be up to date with the current snapshot...some
+  minor and slight additions where added and simple little things where fixed:
+  July 29, 2002
+
+  Steven Pignataro (steven_joseph_p at yahoo.com)
+
+  /////////////////////////////////////////////////////////////////////////
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// This will cause it to look for 'mainpage.php'
+
+  $HTTP_GET_VARS['filename'] = 'mainpage.php';
+
+  switch ($HTTP_GET_VARS['action']) {
+    case 'save':
+      if ( ($HTTP_GET_VARS['lngdir']) && ($HTTP_GET_VARS['filename']) ) {
+        if ($HTTP_GET_VARS['filename'] == $language . '.php') {
+          $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
+        } else {
+          $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'] . '/' . $HTTP_GET_VARS['filename'];
+        }
+        if (file_exists($file)) {
+          if (file_exists('bak' . $file)) {
+            @unlink('bak' . $file);
+          }
+          @rename($file, 'bak' . $file);
+          $new_file = fopen($file, 'w');
+          $file_contents = stripslashes($HTTP_POST_VARS['file_contents']);
+          fwrite($new_file, $file_contents, strlen($file_contents));
+          fclose($new_file);
+        }
+        tep_redirect(tep_href_link(FILENAME_DEFINE_MAINPAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']));
+      }
+      break;
+  }
+
+  if (!$HTTP_GET_VARS['lngdir']) $HTTP_GET_VARS['lngdir'] = $language;
+
+  $languages_array = array();
+  $languages = tep_get_languages();
+  $lng_exists = false;
+  for ($i=0; $i<sizeof($languages); $i++) {
+    if ($languages[$i]['directory'] == $HTTP_GET_VARS['lngdir']) $lng_exists = true;
+
+    $languages_array[] = array('id' => $languages[$i]['directory'],
+                               'text' => $languages[$i]['name']);
+  }
+  if (!$lng_exists) $HTTP_GET_VARS['lngdir'] = $language;
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/javascript/menu.js"></script>
+<?php 
+// Load Editor
+include('includes/javascript/editor.php');
+echo tep_load_html_editor();
+echo tep_insert_html_editor('file_contents');
+?>
+
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('lng', FILENAME_DEFINE_MAINPAGE, '', 'get'); ?>
+            <td class="pageHeading"><?php echo BOX_CATALOG_DEFINE_MAINPAGE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php #echo tep_draw_pull_down_menu('lngdir', $languages_array, '', 'onChange="this.form.submit();"'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ( ($HTTP_GET_VARS['lngdir']) && ($HTTP_GET_VARS['filename']) ) {
+    if ($HTTP_GET_VARS['filename'] == $language . '.php') {
+      $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
+    } else {
+      $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'] . '/' . $HTTP_GET_VARS['filename'];
+    }
+    if (file_exists($file)) {
+      $file_array = @file($file);
+      $file_contents = @implode('', $file_array);
+
+      $file_writeable = true;
+      if (!is_writeable($file)) {
+        $file_writeable = false;
+        $messageStack->reset();
+        $messageStack->add('mainpage', sprintf(ERROR_FILE_NOT_WRITEABLE, $file), 'error');
+       if ($messageStack->size('mainpage') > 0) {
+          echo $messageStack->output('mainpage');
+         }    
+      }
+
+?>
+          <tr><?php echo tep_draw_form('language', FILENAME_DEFINE_MAINPAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $HTTP_GET_VARS['filename'] . '&action=save'); ?>
+            <td><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo $HTTP_GET_VARS['filename']; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo tep_draw_textarea_field('file_contents', 'soft', '80', '20', $file_contents,' style="width: 100%" mce_editable="true"', (($file_writeable) ? '' : 'readonly')); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td align="right"><?php if ($file_writeable) { echo tep_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;<a href="' . tep_href_link(FILENAME_DEFINE_MAINPAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_DEFINE_MAINPAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; } ?></td>
+              </tr>
+            </table></td>
+          </form></tr>
+<?php
+    } else {
+?>
+          <tr>
+            <td class="main"><b><?php echo TEXT_FILE_DOES_NOT_EXIST; ?></b></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo '<a href="' . tep_href_link(FILENAME_DEFINE_MAINPAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+<?php
+    }
+  } else {
+    $filename = $HTTP_GET_VARS['lngdir'] . '.php';
+?>
+          <tr>
+            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="smallText"><a href="<?php echo tep_href_link(FILENAME_DEFINE_MAINPAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $filename); ?>"><b><?php echo $filename; ?></b></a></td>
+<?php
+    $dir = dir(DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir']);
+    $left = false;
+    if ($dir) {
+      $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+      while ($file = $dir->read()) {
+        if (substr($file, strrpos($file, '.')) == $file_extension) {
+          echo '                <td class="smallText"><a href="' . tep_href_link(FILENAME_DEFINE_MAINPAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $file) . '">' . $file . '</a></td>' . "\n";
+          if (!$left) {
+            echo '              </tr>' . "\n" .
+                 '              <tr>' . "\n";
+          }
+          $left = !$left;
+        }
+      }
+      $dir->close();
+    }
+?>
+
+
+
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_FILE_MANAGER, 'current_path=' . DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_file_manager.gif', IMAGE_FILE_MANAGER) . '</a>'; ?></td>
+          </tr>
+<?php
+  }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/dot.htaccess
===================================================================
--- trunk/direct.openmoko.com/admin/dot.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/dot.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+# $Id: .htaccess,v 1.1.1.1 2004/03/04 23:38:03 ccwjr Exp $
+#
+# This is used with Apache WebServers
+#
+# For this to work, you must include the parameter 'Options' to
+# the AllowOverride configuration
+#
+# Example:
+#
+# <Directory "/usr/local/apache/htdocs">
+#   AllowOverride Options
+# </Directory>
+#
+# 'All' with also work. (This configuration is in the
+# apache/conf/httpd.conf file)
+
+# The following makes adjustments to the SSL protocol for Internet
+# Explorer browsers
+
+<IfModule mod_setenvif.c>
+  <IfDefine SSL>
+    SetEnvIf User-Agent ".*MSIE.*" \
+             nokeepalive ssl-unclean-shutdown \
+             downgrade-1.0 force-response-1.0
+  </IfDefine>
+</IfModule>
+
+# Fix certain PHP values
+
+#<IfModule mod_php4.c>
+#  php_value session.use_trans_sid 0
+#  php_value register_globals 1
+#</IfModule>

Added: trunk/direct.openmoko.com/admin/easypopulate_basic_export.php
===================================================================
--- trunk/direct.openmoko.com/admin/easypopulate_basic_export.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/easypopulate_basic_export.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,738 @@
+<?php
+
+
+/*
+  $Id: easypopulate_basic.php,v 3.01 2005/09/06 $
+  
+*/
+
+// Current EP Version
+$curver = '3.01 Basic';
+
+require('epconfigure.php');
+include ('includes/functions/easypopulate_functions.php');
+include (DIR_WS_LANGUAGES . $language . '/easypopulate.php');
+
+
+//  Start TIMER
+//  -----------
+$stimer = explode( ' ', microtime() );
+$stimer = $stimer[1] + $stimer[0];
+global $filelayout, $filelayout_count, $filelayout_sql, $langcode, $fileheaders;
+
+//elari check default language_id from configuration table DEFAULT_LANGUAGE
+$epdlanguage_query = tep_db_query("select languages_id, name, code from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . "'");
+if (tep_db_num_rows($epdlanguage_query)) {
+  $epdlanguage = tep_db_fetch_array($epdlanguage_query);
+  $epdlanguage_id   = $epdlanguage['languages_id'];
+  $epdlanguage_name = $epdlanguage['name'];
+  $epdlanguage_code = $epdlanguage['code'];
+} else {
+  $msg_error = EASY_ERROR_1;
+}
+
+$langcode = ep_get_languages();
+
+//end intilization
+// queries to pull data
+if ( $dltype != '' ){
+  // if dltype is set, then create the filelayout.  Otherwise it gets read from the uploaded file
+
+  global $GLOBALS, $filelayout, $filelayout_count, $filelayout_sql, $langcode, $fileheaders, $max_categories, $rangebegin, $rangeend, $catsort, $catfilter, $BEGIN1, $BEEND1, $limit_man, $limit_cat, $categories_range;
+  // depending on the type of the download the user wanted, create a file layout for it.
+  $fieldmap = array(); // default to no mapping to change internal field names to external.
+  switch( $dltype ){
+  case 'full':
+    // The file layout is dynamically made depending on the number of languages
+    $iii = 0;
+    $filelayout = array(
+      'v_products_model'    => $iii++,
+      'v_products_image'    => $iii++,
+      'v_products_image_med'    => $iii++,
+      'v_products_image_lrg'    => $iii++,
+      'v_products_image_sm_1'   => $iii++,
+      'v_products_image_xl_1'   => $iii++,
+      'v_products_image_sm_2'   => $iii++,
+      'v_products_image_xl_2'   => $iii++,
+      'v_products_image_sm_3'   => $iii++,
+      'v_products_image_xl_3'   => $iii++,
+      'v_products_image_sm_4'   => $iii++,
+      'v_products_image_xl_4'   => $iii++,
+      'v_products_image_sm_5'   => $iii++,
+      'v_products_image_xl_5'   => $iii++,
+      'v_products_image_sm_6'   => $iii++,
+      'v_products_image_xl_6'   => $iii++
+      );
+
+    foreach ($langcode as $key => $lang){
+      $l_id = $lang['id'];
+      // uncomment the head_title, head_desc, and head_keywords to use
+      // Linda's Header Tag Controller 2.0
+      //echo $langcode['id'] . $langcode['code'];
+      $filelayout  = array_merge($filelayout , array(
+          'v_products_name_' . $l_id    => $iii++,
+          //'v_products_description_' . $l_id => $iii++,
+          'v_products_description_' . $l_id => (str_replace('"', '\"', $iii++)),
+          'v_products_url_' . $l_id => $iii++,
+          'v_products_head_title_tag_'.$l_id  => $iii++,
+          'v_products_head_desc_tag_'.$l_id => $iii++,
+          'v_products_head_keywords_tag_'.$l_id => $iii++,
+          ));
+    }
+
+
+    // uncomment the customer_price and customer_group to support multi-price per product contrib
+
+    // VJ product attribs begin
+     $header_array = array(
+      'v_products_price'    => $iii++,
+      'v_products_weight'   => $iii++,
+      'v_date_avail'      => $iii++,
+      'v_date_added'      => $iii++,
+      'v_products_quantity'   => $iii++,
+      );
+
+      $languages = tep_get_languages();
+
+    $header_array['v_manufacturers_name'] = $iii++;
+
+    $filelayout = array_merge($filelayout, $header_array);
+    // VJ product attribs end
+
+    // build the categories name section of the array based on the number of categores the user wants to have
+    for($i=1;$i<$max_categories+1;$i++){
+      $filelayout = array_merge($filelayout, array('v_categories_name_' . $i => $iii++));
+    }
+
+    $filelayout = array_merge($filelayout, array(
+      'v_tax_class_title'   => $iii++,
+      'v_status'      => $iii++,
+      ));
+
+    $filelayout_sql = "SELECT
+      p.products_id as v_products_id,
+      p.products_model as v_products_model,
+      p.products_image as v_products_image,
+      p.products_image_med as v_products_image_med,
+      p.products_image_lrg as v_products_image_lrg,
+      p.products_image_sm_1 as v_products_image_sm_1,
+      p.products_image_xl_1 as v_products_image_xl_1,
+      p.products_image_sm_2 as v_products_image_sm_2,
+      p.products_image_xl_2 as v_products_image_xl_2,
+      p.products_image_sm_3 as v_products_image_sm_3,
+      p.products_image_xl_3 as v_products_image_xl_3,
+      p.products_image_sm_4 as v_products_image_sm_4,
+      p.products_image_xl_4 as v_products_image_xl_4,
+      p.products_image_sm_5 as v_products_image_sm_5,
+      p.products_image_xl_5 as v_products_image_xl_5,
+      p.products_image_sm_6 as v_products_image_sm_6,
+      p.products_image_xl_6 as v_products_image_xl_6,
+      p.products_price as v_products_price,
+      p.products_weight as v_products_weight,
+      p.products_date_available as v_date_avail,
+      p.products_date_added as v_date_added,
+      p.products_tax_class_id as v_tax_class_id,
+      p.products_quantity as v_products_quantity,
+      p.manufacturers_id as v_manufacturers_id,
+      subc.categories_id as v_categories_id,
+      p.products_status as v_status
+      FROM
+      ".TABLE_PRODUCTS." as p,
+      ".TABLE_CATEGORIES." as subc,
+      ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc
+      WHERE
+      p.products_id = ptoc.products_id AND
+      ptoc.categories_id = subc.categories_id
+      ";
+
+    break;
+
+  case 'priceqty':
+    $iii = 0;
+    // uncomment the customer_price and customer_group to support multi-price per product contrib
+    $filelayout = array(
+      'v_products_model'    => $iii++,
+      'v_products_price'    => $iii++,
+      'v_products_quantity'   => $iii++,
+      #'v_customer_price_1'   => $iii++,
+      #'v_customer_group_id_1'    => $iii++,
+      #'v_customer_price_2'   => $iii++,
+      #'v_customer_group_id_2'    => $iii++,
+      #'v_customer_price_3'   => $iii++,
+      #'v_customer_group_id_3'    => $iii++,
+      #'v_customer_price_4'   => $iii++,
+      #'v_customer_group_id_4'    => $iii++,
+        );
+    $filelayout_sql = "SELECT
+      p.products_id as v_products_id,
+      p.products_model as v_products_model,
+      p.products_price as v_products_price,
+      p.products_quantity as v_products_quantity
+      FROM
+      ".TABLE_PRODUCTS." as p
+      ";
+
+    break;
+
+  case 'category':
+    // The file layout is dynamically made depending on the number of languages
+    $iii = 0;
+    $filelayout = array(
+      'v_products_model'    => $iii++,
+    );
+
+    // build the categories name section of the array based on the number of categores the user wants to have
+    for($i=1;$i<$max_categories+1;$i++){
+      $filelayout = array_merge($filelayout, array('v_categories_name_' . $i => $iii++));
+    }
+
+
+    $filelayout_sql = "SELECT
+      p.products_id as v_products_id,
+      p.products_model as v_products_model,
+      subc.categories_id as v_categories_id
+      FROM
+      ".TABLE_PRODUCTS." as p,
+      ".TABLE_CATEGORIES." as subc,
+      ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc
+      WHERE
+      p.products_id = ptoc.products_id AND
+      ptoc.categories_id = subc.categories_id
+      ";
+    break;
+
+
+// VJ product attributes begin
+  case 'attrib':
+// VJ product attributes begin
+
+$attribute_options_array = array();
+
+if ($products_with_attributes == true) {
+  if (is_array($attribute_options_select) && (count($attribute_options_select) > 0)) {
+    foreach ($attribute_options_select as $value) {
+      $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " where products_options_name = '" . $value . "'";
+
+      $attribute_options_values = tep_db_query($attribute_options_query);
+
+      if ($attribute_options = tep_db_fetch_array($attribute_options_values)){
+        $attribute_options_array[] = array('products_options_id' => $attribute_options['products_options_id']);
+      }
+    }
+  } else {
+    $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " order by products_options_id";
+
+    $attribute_options_values = tep_db_query($attribute_options_query);
+
+    while ($attribute_options = tep_db_fetch_array($attribute_options_values)){
+      $attribute_options_array[] = array('products_options_id' => $attribute_options['products_options_id']);
+    }
+  }
+ }
+
+  
+    $iii = 0;
+    $filelayout = array(
+      'v_products_model'  => $iii++,
+      );
+
+    $header_array = array();
+
+    $languages = tep_get_languages();
+
+    global $attribute_options_array;
+
+    $attribute_options_count = 1;
+    foreach ($attribute_options_array as $attribute_options_values) {
+      $key1 = 'v_attribute_options_id_' . $attribute_options_count;
+      $header_array[$key1] = $iii++;
+
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        $l_id = $languages[$i]['id'];
+
+        $key2 = 'v_attribute_options_name_' . $attribute_options_count . '_' . $l_id;
+        $header_array[$key2] = $iii++;
+      }
+
+      $attribute_values_query = "select products_options_values_id  from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options_values['products_options_id'] . "' order by products_options_values_id";
+
+      $attribute_values_values = tep_db_query($attribute_values_query);
+
+      $attribute_values_count = 1;
+      while ($attribute_values = tep_db_fetch_array($attribute_values_values)) {
+        $key3 = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count;
+        $header_array[$key3] = $iii++;
+
+        $key4 = 'v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count;
+        $header_array[$key4] = $iii++;
+
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $l_id = $languages[$i]['id'];
+
+          $key5 = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $l_id;
+          $header_array[$key5] = $iii++;
+        }
+
+        $attribute_values_count++;
+      }
+
+      $attribute_options_count++;
+    }
+
+    $filelayout = array_merge($filelayout, $header_array);
+
+    $filelayout_sql = "SELECT
+      p.products_id as v_products_id,
+      p.products_model as v_products_model
+      FROM
+      ".TABLE_PRODUCTS." as p
+      ";
+
+    break;
+// VJ product attributes end
+  }
+  $filelayout_count = count($filelayout);
+
+//end output
+}
+
+//build downlaod file
+if ( $download == 'stream' or  $download == 'tempfile' ){
+  //*******************************
+  //*******************************
+  // DOWNLOAD FILE
+  //*******************************
+  //*******************************
+  $filestring = ""; // this holds the csv file we want to download
+
+
+  $result = tep_db_query($filelayout_sql);
+  $row =  tep_db_fetch_array($result);
+
+  // Here we need to allow for the mapping of internal field names to external field names
+  // default to all headers named like the internal ones
+  // the field mapping array only needs to cover those fields that need to have their name changed
+  if ( count($fileheaders) != 0 ){
+    $filelayout_header = $fileheaders; // if they gave us fileheaders for the dl, then use them
+  } else {
+    $filelayout_header = $filelayout; // if no mapping was spec'd use the internal field names for header names
+  }
+  //We prepare the table heading with layout values
+  foreach( $filelayout_header as $key => $value ){
+    $filestring .= $key . $separator;
+  }
+  // now lop off the trailing tab
+  $filestring = substr($filestring, 0, strlen($filestring)-1);
+
+  // set the type
+    $endofrow = $separator . 'EOREOR' . "\n";
+  $filestring .= $endofrow;
+
+  $num_of_langs = count($langcode);
+
+  while ($row){
+
+    // names and descriptions require that we loop thru all languages that are turned on in the store
+    foreach ($langcode as $key => $lang){
+      $lid = $lang['id'];
+      $lcd = $lang['code'];
+
+      // for each language, get the description and set the vals
+      $sql2 = "SELECT *
+        FROM ".TABLE_PRODUCTS_DESCRIPTION."
+        WHERE
+          products_id = " . $row['v_products_id'] . " AND
+          language_id = '" . $lid . "'
+
+         ";
+      $result2 = tep_db_query($sql2);
+      $row2 =  tep_db_fetch_array($result2);
+
+//added cpath
+      // for the categories, we need to keep looping until we find the root category
+      // start with v_categories_id
+      // Get the category description
+      // set the appropriate variable name
+      // if parent_id is not null, then follow it up.
+      // we'll populate an aray first, then decide where it goes in the
+      $thecategory_id1 = $row['v_categories_id'];
+      $fullcategory1 = ''; // this will have the entire category stack for froogle
+      for( $categorylevel=1; $categorylevel<$max_categories+1; $categorylevel++){
+        if ($thecategory_id1){
+          // now get the parent ID if there was one
+          $sq23 = "SELECT parent_id
+            FROM ".TABLE_CATEGORIES."
+            WHERE categories_id = " . $thecategory_id1;
+          $result23 = tep_db_query($sq23);
+          $row23 =  tep_db_fetch_array($result23);
+          $theparent_id1 = $row23['parent_id'];
+        }
+        $cPath = $theparent_id1 .  '_'  . $row['v_categories_id'];
+      }
+
+      // I'm only doing this for the first language, since right now froogle is US only.. Fix later!
+      // adding url for froogle, but it should be available no matter what
+
+      $row['v_products_name_' . $lid]   = $row2['products_name'];
+      $row['v_products_description_' . $lid]  = $row2['products_description'];
+      $row['v_products_url_' . $lid]    = $row2['products_url'];
+
+
+      // support for Linda's Header Controller 2.0 here
+      if(isset($filelayout['v_products_head_title_tag_' . $lid])){
+        $row['v_products_head_title_tag_' . $lid]   = $row2['products_head_title_tag'];
+        $row['v_products_head_desc_tag_' . $lid]  = $row2['products_head_desc_tag'];
+        $row['v_products_head_keywords_tag_' . $lid]  = $row2['products_head_keywords_tag'];
+      }
+      // end support for Header Controller 2.0
+    }
+
+    // for the categories, we need to keep looping until we find the root category
+
+    // start with v_categories_id
+    // Get the category description
+    // set the appropriate variable name
+    // if parent_id is not null, then follow it up.
+    // we'll populate an aray first, then decide where it goes in the
+    $thecategory_id = $row['v_categories_id'];
+    $fullcategory = ''; // this will have the entire category stack for froogle
+    for( $categorylevel=1; $categorylevel<$max_categories+1; $categorylevel++){
+      if ($thecategory_id){
+        $sql2 = "SELECT categories_name
+          FROM ".TABLE_CATEGORIES_DESCRIPTION."
+          WHERE
+            categories_id = " . $thecategory_id . " AND
+            language_id = " . $epdlanguage_id ;
+
+        $result2 = tep_db_query($sql2);
+        $row2 =  tep_db_fetch_array($result2);
+        // only set it if we found something
+        $temprow['v_categories_name_' . $categorylevel] = $row2['categories_name'];
+        // now get the parent ID if there was one
+        $sql3 = "SELECT parent_id
+          FROM ".TABLE_CATEGORIES."
+          WHERE
+            categories_id = " . $thecategory_id;
+        $result3 = tep_db_query($sql3);
+        $row3 =  tep_db_fetch_array($result3);
+        $theparent_id = $row3['parent_id'];
+        if ($theparent_id != ''){
+          // there was a parent ID, lets set thecategoryid to get the next level
+          $thecategory_id = $theparent_id;
+        } else {
+          // we have found the top level category for this item,
+          $thecategory_id = false;
+        }
+        //$fullcategory .= " > " . $row2['categories_name'];
+        $fullcategory = $row2['categories_name'] . " > " . $fullcategory;
+      } else {
+        $temprow['v_categories_name_' . $categorylevel] = '';
+      }
+    }
+    // now trim off the last ">" from the category stack
+    $row['v_category_fullpath'] = substr($fullcategory,0,strlen($fullcategory)-3);
+
+    // temprow has the old style low to high level categories.
+    $newlevel = 1;
+    // let's turn them into high to low level categories
+    for( $categorylevel=6; $categorylevel>0; $categorylevel--){
+      if ($temprow['v_categories_name_' . $categorylevel] != ''){
+        $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel];
+      }
+    }
+    // if the filelayout says we need a manufacturers name, get it
+    if (isset($filelayout['v_manufacturers_name'])){
+      if ($row['v_manufacturers_id'] != ''){
+        $sql2 = "SELECT manufacturers_name
+          FROM ".TABLE_MANUFACTURERS."
+          WHERE
+          manufacturers_id = " . $row['v_manufacturers_id']
+          ;
+        $result2 = tep_db_query($sql2);
+        $row2 =  tep_db_fetch_array($result2);
+        $row['v_manufacturers_name'] = $row2['manufacturers_name'];
+      }
+    }
+
+
+    // If you have other modules that need to be available, put them here
+
+    // VJ product attribs begin
+    if (isset($filelayout['v_attribute_options_id_1'])){
+      $languages = tep_get_languages();
+
+      $attribute_options_count = 1;
+      foreach ($attribute_options_array as $attribute_options) {
+        $row['v_attribute_options_id_' . $attribute_options_count]  = $attribute_options['products_options_id'];
+
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $lid = $languages[$i]['id'];
+
+          $attribute_options_languages_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' and language_id = '" . (int)$lid . "'";
+
+          $attribute_options_languages_values = tep_db_query($attribute_options_languages_query);
+
+          $attribute_options_languages = tep_db_fetch_array($attribute_options_languages_values);
+
+          $row['v_attribute_options_name_' . $attribute_options_count . '_' . $lid] = $attribute_options_languages['products_options_name'];
+        }
+
+        $attribute_values_query = "select products_options_values_id from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' order by products_options_values_id";
+
+        $attribute_values_values = tep_db_query($attribute_values_query);
+
+        $attribute_values_count = 1;
+        while ($attribute_values = tep_db_fetch_array($attribute_values_values)) {
+          $row['v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count]   = $attribute_values['products_options_values_id'];
+
+          $attribute_values_price_query = "select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$row['v_products_id'] . "' and options_id = '" . (int)$attribute_options['products_options_id'] . "' and options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "'";
+
+          $attribute_values_price_values = tep_db_query($attribute_values_price_query);
+
+          $attribute_values_price = tep_db_fetch_array($attribute_values_price_values);
+
+          $row['v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count]  = $attribute_values_price['price_prefix'] . $attribute_values_price['options_values_price'];
+
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+            $lid = $languages[$i]['id'];
+
+            $attribute_values_languages_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "' and language_id = '" . (int)$lid . "'";
+
+            $attribute_values_languages_values = tep_db_query($attribute_values_languages_query);
+
+            $attribute_values_languages = tep_db_fetch_array($attribute_values_languages_values);
+
+            $row['v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid] = $attribute_values_languages['products_options_values_name'];
+          }
+
+          $attribute_values_count++;
+        }
+
+        $attribute_options_count++;
+      }
+    }
+    // VJ product attribs end
+
+    // this is for the separate price per customer module
+    if (isset($filelayout['v_customer_price_1'])){
+      $sql2 = "SELECT
+          customers_group_price,
+          customers_group_id
+        FROM
+          ".TABLE_PRODUCTS_GROUPS."
+        WHERE
+        products_id = " . $row['v_products_id'] . "
+        ORDER BY
+        customers_group_id"
+        ;
+      $result2 = tep_db_query($sql2);
+      $ll = 1;
+      $row2 =  tep_db_fetch_array($result2);
+      while( $row2 ){
+        $row['v_customer_group_id_' . $ll]  = $row2['customers_group_id'];
+        $row['v_customer_price_' . $ll]   = $row2['customers_group_price'];
+        $row2 = tep_db_fetch_array($result2);
+        $ll++;
+      }
+    }
+
+    //elari -
+    //We check the value of tax class and title instead of the id
+    //Then we add the tax to price if $price_with_tax is set to 1
+    $row_tax_multiplier     = tep_get_tax_class_rate($row['v_tax_class_id']);
+    $row['v_tax_class_title']   = tep_get_tax_class_title($row['v_tax_class_id']);
+    $row['v_products_price']  = $row['v_products_price'] +
+              ($price_with_tax * round($row['v_products_price'] * $row_tax_multiplier / 100,2));
+
+
+    // Now set the status to a word the user specd in the config vars
+    if ( $row['v_status'] == '1' ){
+      $row['v_status'] = $active;
+    } else {
+      $row['v_status'] = $inactive;
+    }
+
+    // remove any bad things in the texts that could confuse EasyPopulate
+    $therow = '';
+    foreach( $filelayout as $key => $value ){
+      //echo "The field was $key<br>";
+
+      $thetext = $row[$key];
+      // kill the carriage returns and tabs in the descriptions, they're killing me!
+      $thetext = str_replace("\r",' ',$thetext);
+      $thetext = str_replace("\n",' ',$thetext);
+      $thetext = str_replace("\t",' ',$thetext);
+      // and put the text into the output separated by tabs
+      $therow .= $thetext . $separator;
+    }
+
+    // lop off the trailing tab, then append the end of row indicator
+    $therow = substr($therow,0,strlen($therow)-1) . $endofrow;
+
+    $filestring .= $therow;
+    // grab the next row from the db
+    $row =  tep_db_fetch_array($result);
+  }
+
+//End of create download
+  #$EXPORT_TIME=time();
+  $EXPORT_TIME = strftime('%Y%b%d-%H%I');
+    $EXPORT_TIME = "EPB" . $EXPORT_TIME;
+
+  // now either stream it to them or put it in the temp directory for all files
+  if ($download == 'stream'){
+    //*******************************
+    // STREAM FILE
+    //*******************************
+    header("Content-type: application/vnd.ms-excel");
+    header("Content-disposition: attachment; filename=$EXPORT_TIME.txt");
+    header("Pragma: no-cache");
+    header("Expires: 0");
+    echo $filestring;
+    die();
+
+    //tep_redirect(tep_href_link(FILENAME_EASYPOPULATE_BASIC_EXPORT, 'mesID=MSG2&name=' . $EXPORT_TIME));
+  } else {
+    //*******************************
+    // PUT FILE IN TEMP DIR
+    //*******************************
+    $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "$EXPORT_TIME.txt";
+    //unlink($tmpfname);
+    $fp = fopen( $tmpfname, "w+");
+    fwrite($fp, $filestring);
+    fclose($fp);
+    //echo EASY_FILE_LOCATE . $tempdir .  $EXPORT_TIME . ".txt" ;
+          tep_redirect(tep_href_link(FILENAME_EASYPOPULATE_BASIC_EXPORT, 'mesID=MSG1&name=' . $EXPORT_TIME));
+    //echo  '<a href="easypopulate_export.php">' . EASY_FILE_RETURN . '</a><br>';
+
+
+    //die();
+  }
+}   // *** END *** download section
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+<tr>
+<td width="<?php echo BOX_WIDTH; ?>" valign="top" height="27">
+<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<?php require(DIR_WS_INCLUDES . 'column_left.php');?>
+</table></td>
+<?php
+//$title = ' ';
+?>
+
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo EASY_VERSION_B . EASY_VER_B . EASY_EXPORT; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+
+<?php
+if ($mesID == MSG1){
+       echo '<tr class="epa_msg"><td>' . EASY_FILE_LOCATE . $tempdir .  $name . ".txt" . '</td></tr>';
+       
+}
+
+if ($mesID == MSG2){
+       echo '<tr><td>' . EASY_FILE_LOCATE2 .  $name . ".txt" . '</td></tr>';
+}
+?>
+               </tr>
+        <tr class="dataTableHeadingRow">
+                <td>
+<b><?php echo EASY_LABEL_CREATE . '</b>' ;
+         echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_export') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+?>                 </td>
+               </tr>
+               <tr>
+               <td>
+ <?php echo tep_draw_form('localfile_export', 'easypopulate_basic_export.php', 'action=export', 'post', 'enctype="multipart/form-data"'); ?>
+                 </td>
+               </tr>
+               <tr>
+                 <td>
+                 <b><?php echo EASY_LABEL_CREATE_SELECT. '</b>' ;
+         echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_select_method') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+         echo '&nbsp;';?>
+      <select name="download">
+      <option selected value ="stream" size="10"><?php echo EASY_LABEL_DOWNLOAD . '<b> ';?>
+      <option value="tempfile" size="10"><?php echo EASY_LABEL_CREATE_SAVE;?>
+      </select>
+                   </td>
+      </tr>
+      <tr>
+       <td>
+
+      
+ <b><?php echo EASY_LABEL_SELECT_DOWN . '</b>';
+  echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_select_down') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+        echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'?>
+      <select name="dltype">
+      <option selected value ="full" size="10"><?php echo EASY_LABEL_COMPLETE //full;?>
+      <option value="priceqty" size="10"><?php echo EASY_LABEL_MPQ //model price qty;?>
+      <option value="category" size="10"><?php echo EASY_LABEL_EP_MC //model category;?>
+<?php // <option value="attrib" size="10"><?php echo EASY_LABEL_EP_ATTRIB //attibutes
+ ;?>
+      </select>
+       </td>
+      </tr>
+      <tr>
+       <td>
+                <?php echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_start_file_creation.gif', EASY_LABEL_PRODUCT_START); ?>
+        </form>
+        </td>
+                 </tr>
+                 <tr>
+                 <td>
+<?php
+//  End TIMER
+//  ---------
+$etimer = explode( ' ', microtime() );
+$etimer = $etimer[1] + $etimer[0];
+echo '<p style="margin:auto; text-align:center">';
+printf( TEXT_INFO_TIMER . " <b>%f</b> "  . TEXT_INFO_SECOND, ($etimer-$stimer) );
+echo '</p>';
+//  ---------
+ ?>                
+               
+                 </td>
+                 </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+
+<?php
+
+require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/easypopulate_basic_import.php
===================================================================
--- trunk/direct.openmoko.com/admin/easypopulate_basic_import.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/easypopulate_basic_import.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1321 @@
+<?php
+/*
+  $Id: easypopulate_basic.php,v 3.01 2005/09/06  $
+
+  Released under the GNU General Public License
+*/
+
+// Current EP Version
+$curver = '3.01 Basic';
+
+require('epconfigure.php');
+include (DIR_WS_LANGUAGES . $language . '/easypopulate.php');
+include ('includes/functions/easypopulate_functions.php');
+
+//  Start TIMER
+//  -----------
+$stimer = explode( ' ', microtime() );
+$stimer = $stimer[1] + $stimer[0];
+//  -----------
+
+
+global $msg_output, $msg_epb, $msg_error;
+// VJ product attributes begin
+global $attribute_options_array;
+
+//elari check default language_id from configuration table DEFAULT_LANGUAGE
+$epdlanguage_query = tep_db_query("select languages_id, name, code from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . "'");
+if (tep_db_num_rows($epdlanguage_query)) {
+  $epdlanguage = tep_db_fetch_array($epdlanguage_query);
+  $epdlanguage_id   = $epdlanguage['languages_id'];
+  $epdlanguage_name = $epdlanguage['name'];
+  $epdlanguage_code = $epdlanguage['code'];
+} else {
+  $msg_error = EASY_ERROR_1;
+}
+
+$langcode = ep_get_languages();
+
+//if ($dltype != ''){
+   // if dltype is set, then create the filelayout.  Otherwise it gets read from the uploaded file
+//    ep_create_filelayout($dltype); // get the right filelayout for this download
+//}
+
+//*******************************
+//*******************************
+// E N D
+// INITIALIZATION
+//*******************************
+//*******************************
+ $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+ $split = (isset($HTTP_GET_VARS['split']) ? $HTTP_GET_VARS['split'] : '');
+ 
+if (tep_not_null($action)) {
+  if ( (($action == 'upload') || ($action == 'local')) && ($split == 0) ) { 
+
+//if ($localfile or (is_uploaded_file($usrfl) && $split==0)) {
+  //*******************************
+  //*******************************
+  // UPLOAD AND INSERT FILE
+  //*******************************
+  //*******************************
+//  check files name for EPA
+
+      if (strstr($localfile, 'EPA')){
+      $msg_error = EASY_ERROR_5 .  ' ' . EASY_ERROR_5a . '</a><br>';
+     }else{
+      }
+
+if (strstr($usrfl_name, 'EPA')){
+     $msg_error =  EASY_ERROR_5 .  ' ' . EASY_ERROR_5a . '</a><br>';
+//   die();
+     }else{
+      }
+
+  if ($action == 'upload'){
+          // $HTTP_POST_VARS['usrfl']
+        //  $usrfl=$HTTP_POST_VARS['usrfl'];
+    // move the file to where we can work with it
+    $file = tep_get_uploaded_file('usrfl');
+    if (is_uploaded_file($file['tmp_name'])) {
+      tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir);
+    }
+      $msg_epb =  EASY_UPLOAD_FILE . '<br>' . EASY_UPLOAD_TEMP . $usrfl . '<br>' . EASY_UPLOAD_USER_FILE . $usrfl_name . '<br>' .  EASY_SIZE . $usrfl_size . '<br>';
+
+
+    // get the entire file into an array
+    $readed = file(DIR_FS_DOCUMENT_ROOT . $tempdir . $usrfl_name);
+  }
+  if ($action == 'local'){
+    // move the file to where we can work with it
+    $file = tep_get_uploaded_file('usrfl'); 
+            $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " order by products_options_id";
+      $attribute_options_values = tep_db_query($attribute_options_query);
+      $attribute_options_count = 1;
+      //while ($attribute_options = tep_db_fetch_array($attribute_options_values)){
+    if (is_uploaded_file($file['tmp_name'])) {
+      tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir);
+      }
+          $msg_epb = EASY_LABEL_FILE_INSERT_LOCAL .  EASY_FILENAME . $localfile . '<br>';
+    // get the entire file into an array
+    $readed = file(DIR_FS_DOCUMENT_ROOT . $tempdir . $localfile);
+  }
+
+  // now we string the entire thing together in case there were carriage returns in the data
+  $newreaded = "";
+  foreach ($readed as $read){
+    $newreaded .= $read;
+  }
+
+  // now newreaded has the entire file together without the carriage returns.
+  // if for some reason excel put qoutes around our EOREOR, remove them then split into rows
+  $newreaded = str_replace('"EOREOR"', 'EOREOR', $newreaded);
+  $readed = explode( $separator . 'EOREOR',$newreaded);
+
+
+  // Now we'll populate the filelayout based on the header row.
+  $theheaders_array = explode( $separator, $readed[0] ); // explode the first row, it will be our filelayout
+  $lll = 0;
+  $filelayout = array();
+  foreach( $theheaders_array as $header ){
+    $cleanheader = str_replace( '"', '', $header);
+  //  echo "Fileheader was $header<br><br><br>";
+    $filelayout[ $cleanheader ] = $lll++; //
+  }
+  unset($readed[0]); //  we don't want to process the headers with the data
+
+  // now we've got the array broken into parts by the expicit end-of-row marker.
+
+//array_walk($readed, 'walk');
+foreach ($readed as $readed_record) {
+walk($readed_record);
+}
+
+}
+
+//if is_uploaded_file($usrfl){
+if ( (is_uploaded_file($usrfl)) && ($action == 'upload') && ($split == 1)) { 
+
+  //*******************************
+  //*******************************
+  // UPLOAD AND SPLIT FILE
+  //*******************************
+  //*******************************
+
+  //  check files name for EPA
+
+        if (strstr($usrfl_name, 'EPA')){
+    $msg_error =  EASY_ERROR_5 .  ' ' . EASY_ERROR_5a . '</a><br>';
+
+  tep_redirect(easypopulate_basic_import.php);
+  // die();
+       }else{
+        }
+
+  // move the file to where we can work with it
+  $file = tep_get_uploaded_file('usrfl');
+  //echo "Trying to move file...";
+  if (is_uploaded_file($file['tmp_name'])) {
+    tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir);
+  }
+
+  $infp = fopen(DIR_FS_DOCUMENT_ROOT . $tempdir . $usrfl_name, "r");
+
+  //toprow has the field headers
+  $toprow = fgets($infp,32768);
+
+  $filecount = 1;
+  #$EXPORT_TIME=time();
+  $EXPORT_TIME = strftime('%Y%b%d-%H%I');
+  
+
+  $msg_epb = EASY_LABEL_FILE_COUNT_1A . $filecount . EASY_LABEL_FILE_COUNT_2;
+  $tmpfname1 = HTTP_SERVER . DIR_WS_CATALOG . $tempdir . "EPB_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+  $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EPB_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+  $fp = fopen( $tmpfname, "w+");
+  fwrite($fp, $toprow);
+
+  $linecount = 0;
+  $line = fgets($infp,32768);
+  while ($line){
+    // walking the entire file one row at a time
+    // but a line is not necessarily a complete row, we need to split on rows that have "EOREOR" at the end
+    $line = str_replace('"EOREOR"', 'EOREOR', $line);
+    fwrite($fp, $line);
+    if (strpos($line, 'EOREOR')){
+      // we found the end of a line of data, store it
+      $linecount++; // increment our line counter
+      if ($linecount >= $maxrecs){
+        $msg_epb = EASY_LABEL_LINE_COUNT_1 . $linecount . EASY_LABEL_LINE_COUNT_2 . '<Br>';
+        $linecount = 0; // reset our line counter
+        // close the existing file and open another;
+        fclose($fp);
+        // increment filecount
+        $filecount++;
+         $tmpfname1 = HTTP_SERVER . DIR_WS_CATALOG . $tempdir . "EPB_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+               $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EPB_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+        //Open next file name
+        $fp = fopen( $tmpfname, "w+");
+        fwrite($fp, $toprow);
+      }
+    }
+    $line=fgets($infp,32768);
+  }
+  $msg_epb = EASY_LABEL_FILE_CLOSE_1 . $linecount . EASY_LABEL_FILE_CLOSE_2 . '<br>';
+  fclose($fp);
+  fclose($infp);
+  $msg_epb = EASY_SPLIT_DOWN . $tmpfname1;
+  }
+//if is_uploaded_file($usrfl){
+if ( ($action == 'local') && ($split == 1)) { 
+
+  //*******************************
+  //*******************************
+  // server file splitSPLIT FILE
+  //*******************************
+  //*******************************
+//  check files name for EPA
+      if (strstr($localfile1, 'EPB')){   
+     }else{
+                $msg_error = EASY_ERROR_6 .  '<a href="' . tep_href_link(FILENAME_EASYPOPULATE) . '">' . EASY_ERROR_6a . '</a><br>';
+      // die();
+
+      }
+    $file = tep_get_uploaded_file('localfile1');  
+
+    if (is_uploaded_file($file['tmp_name'])) {
+      tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir);
+      }
+
+  $infp = fopen(DIR_FS_DOCUMENT_ROOT . $tempdir . $file['tmp_name'], "r");
+
+  //toprow has the field headers
+  $toprow = fgets($infp,32768);
+
+  $filecount = 1;
+  #$EXPORT_TIME=time();
+  $EXPORT_TIME = strftime('%Y%b%d-%H%I');
+
+  $msg_epa = EASY_LABEL_FILE_COUNT_1A . $filecount . EASY_LABEL_FILE_COUNT_2;
+  $tmpfname1 = HTTP_SERVER . DIR_WS_CATALOG . $tempdir . "EPB_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+  $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EPB_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+  $fp = fopen( $tmpfname, "w+");
+  fwrite($fp, $toprow);
+
+  $linecount = 0;
+  $line = fgets($infp,32768);
+  while ($line){
+    // walking the entire file one row at a time
+    // but a line is not necessarily a complete row, we need to split on rows that have "EOREOR" at the end
+    $line = str_replace('"EOREOR"', 'EOREOR', $line);
+    fwrite($fp, $line);
+    if (strpos($line, 'EOREOR')){
+      // we found the end of a line of data, store it
+      $linecount++; // increment our line counter
+      if ($linecount >= $maxrecs){
+        $msg_epa = EASY_LABEL_LINE_COUNT_1 . $linecount . EASY_LABEL_LINE_COUNT_2 . '<Br>';
+        $linecount = 0; // reset our line counter
+        // close the existing file and open another;
+        fclose($fp);
+        // increment filecount
+        $filecount++;
+         $tmpfname1 = HTTP_SERVER . DIR_WS_CATALOG . $tempdir . "EPB_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+               $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EPB_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+        //Open next file name
+        $fp = fopen( $tmpfname, "w+");
+        fwrite($fp, $toprow);
+      }
+    }
+    $line=fgets($infp,32768);
+  }
+  $msg_epa = EASY_LABEL_FILE_CLOSE_1 . $linecount . EASY_LABEL_FILE_CLOSE_2 . '<br>';
+  fclose($fp);
+  fclose($infp);
+  $msg_epa = EASY_SPLIT_DOWN . $tmpfname1;
+  }
+}
+
+
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+<tr>
+<td width="<?php echo BOX_WIDTH; ?>" valign="top" height="27">
+<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<?php require(DIR_WS_INCLUDES . 'column_left.php');?>
+</table></td>
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo EASY_VERSION_B . EASY_VER_B . EASY_IMPORT; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+
+<?php
+if ($mesID == MSG1){
+       echo '<tr class="epa_msg"><td>' . EASY_FILE_LOCATE . $tempdir .  $name . ".txt" . '</td></tr>';
+       
+}
+
+if ($mesID == MSG2){
+       echo '<tr><td>' . EASY_FILE_LOCATE2 .  $name . ".txt" . '</td></tr>';
+}
+?>
+               </tr>
+        <tr>
+                <td>
+ <?php echo tep_draw_form('localfile_insert', 'easypopulate_basic_import.php', 'action=upload&split=0', 'post', 'ENCTYPE="multipart/form-data"'); ?>
+             
+ <?php ECHO '<b>' . EASY_UPLOAD_EP_FILE . '</b>';
+       ECHO '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_upload') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+ ?>
+                  </td>
+                  </tr>
+                  <tr>
+                    <td>
+                  <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000000">
+     <?php echo  tep_draw_file_field('usrfl', '50') ;?>
+     <?php echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_insert_into_db.gif', TEXT_INSERT_INTO_DB); ?>
+              </form>
+          </td>
+          </tr>
+          <tr >
+          <td>
+<?php echo tep_draw_form('localfile_insert', 'easypopulate_basic_import.php', '&action=upload&split=1', 'post', 'ENCTYPE="multipart/form-data"'); ?>
+                <b> <?php echo EASY_SPLIT_EP_FILE . '</b>' ;
+      echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_upload_split') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+?>       
+             </td>
+           </tr>
+           <tr>
+           <td>
+                 <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000000">
+             <?php echo  tep_draw_file_field('usrfl', '50') ;?>
+       <?php echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_split_file.gif', TEXT_SPLIT); ?>
+             </form>
+
+          </td>
+          </tr>
+          <tr>
+          <td>
+                        <b> <?php echo EASY_SPLIT_EP_LOCAL . '</b>' ;  
+         echo tep_draw_form('localfile_split', 'easypopulate_basic_import.php', '&action=local&split=1', 'post', 'ENCTYPE="multipart/form-data"'); 
+      echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_split') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+     ?> 
+           </td>
+           </tr>
+           <tr>
+             <td>
+    <?php
+        $dir = dir(DIR_FS_CATALOG . $tempdir);
+        $contents1 = array(array('id' => '', 'text' => TEXT_SELECT_TWO));
+        while ($file1 = $dir->read()) {
+          if ( ($file1 != '.') && ($file1 != 'CVS') && ($file1 != '..') && ($file1 != '.htaccess') && !(strstr($file1, 'EPA')) && !(strstr($file1, 'EPA_Split')) ) {
+            $contents1[] = array('id' => $file1, 'text' => $file1);
+          }
+        }
+        echo tep_draw_pull_down_menu('localfile1', $contents1, $localfile1);
+echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_split_file.gif', TEXT_SPLIT); ?>
+
+           </form>
+                </td>
+               </tr>          
+          <tr>
+          <td>
+   <?php echo tep_draw_form('localfile_insert', 'easypopulate_basic_import.php', '&action=local&split=0', 'post', 'ENCTYPE="multipart/form-data"'); ?>
+
+      <b><?php echo sprintf(TEXT_IMPORT_TEMP, $tempdir) . '</b>';
+      echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_insert') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+     ?> 
+           </td>
+           </tr>
+           <tr>
+             <td>
+    <?php
+        $dir = dir(DIR_FS_CATALOG . $tempdir);
+        $contents = array(array('id' => '', 'text' => TEXT_SELECT_ONE));
+        while ($file = $dir->read()) {
+          if ( ($file != '.') && ($file != 'CVS') && ($file != '..') && !(strstr($file, 'EPA')) && ($file != '.htaccess')) {
+            //$file_size = filesize(DIR_FS_CATALOG . $tempdir . $file);
+
+            $contents[] = array('id' => $file, 'text' => $file);
+          }
+        }
+        echo tep_draw_pull_down_menu('localfile', $contents, $localfile);
+echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_insert_into_db.gif', TEXT_INSERT_INTO_DB); ?>
+
+           </form>
+                </td>
+               </tr>
+               
+                <tr>
+<?php // echo error
+ if ($msg_error != ''){
+    echo  '<td><p class="smallText"><font color=\'red\'>' . $msg_error . '</font></p></td></tr>';
+ }    
+ ?>  
+ 
+ <?php // echo epa message
+  if ($msg_epb != ''){
+     echo  '<td><p class="smallText">' . $msg_epb . '</p></td></tr>';
+ }    ?>  
+ 
+ <?php // echo line by line results
+  if ($msg_output != ''){
+     echo  '<td><p class="smallText">' . $msg_output . '</p></td></tr>';
+ }    ?>  
+      <td>
+      </td>
+     </tr>
+     <tr>
+      <td>
+<?php
+ //  End TIMER
+  //  ---------
+   $etimer = explode( ' ', microtime() );
+   $etimer = $etimer[1] + $etimer[0];
+echo '<p style="margin:auto; text-align:center">';
+printf( TEXT_INFO_TIMER . " <b>%f</b> "  . TEXT_INFO_SECOND, ($etimer-$stimer) );
+echo '</p>';
+//  ---------
+?>                
+  </td></tr>
+      </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+
+
+function walk( $item1 ) {
+  global $GLOBALS, $filelayout, $filelayout_count, $modelsize;
+  global $active, $inactive, $langcode, $default_these, $deleteit, $zero_qty_inactive;
+        global $epdlanguage_id, $replace_quotes, $v_products_id1;
+  global $default_images, $default_image_manufacturer, $default_image_product, $default_image_category;
+  global $separator, $max_categories, $msg_error, $msg_epa, $msg_output ;
+  // first we clean up the row of data
+
+  // chop blanks from each end
+  $item1 = ltrim(rtrim($item1));
+
+  // blow it into an array, splitting on the tabs
+  $items = explode($separator, $item1);
+
+  // make sure all non-set things are set to '';
+  // and strip the quotes from the start and end of the stings.
+  // escape any special chars for the database.
+  foreach( $filelayout as $key=> $value){
+    $i = $filelayout[$key];
+    if (isset($items[$i]) == false) {
+      $items[$i]='';
+    } else {
+      // Check to see if either of the magic_quotes are turned on or off;
+      // And apply filtering accordingly.
+      if (function_exists('ini_get')) {
+        //echo "Getting ready to check magic quotes<br>";
+        if (ini_get('magic_quotes_runtime') == 1){
+          // The magic_quotes_runtime are on, so lets account for them
+          // check if the last character is a quote;
+          // if it is, chop off the quotes.
+          if (substr($items[$i],-1) == '"'){
+            $items[$i] = substr($items[$i],2,strlen($items[$i])-4);
+          }
+          // now any remaining doubled double quotes should be converted to one doublequote
+          $items[$i] = str_replace('\"\"',"\"",$items[$i]);
+        } else { // no magic_quotes are on
+          // check if the last character is a quote;
+          // if it is, chop off the 1st and last character of the string.
+          if (substr($items[$i],-1) == '"'){
+            $items[$i] = substr($items[$i],1,strlen($items[$i])-2);
+          }
+          // now any remaining doubled double quotes should be converted to one doublequote
+          $items[$i] = str_replace('""',"\"",$items[$i]);
+          if ($replace_quotes){
+            $items[$i] = str_replace('"',"\"",$items[$i]);
+            $items[$i] = str_replace("'","\'",$items[$i]);
+          }
+        }
+      }
+    }
+  }
+
+  // now do a query to get the record's current contents
+  $sql = "SELECT
+    p.products_id as v_products_id,
+    p.products_model as v_products_model,
+    p.products_image as v_products_image,
+    p.products_image_med as v_products_image_med,
+    p.products_image_lrg as v_products_image_lrg,
+    p.products_image_sm_1 as v_products_image_sm_1,
+    p.products_image_xl_1 as v_products_image_xl_1,
+    p.products_image_sm_2 as v_products_image_sm_2,
+    p.products_image_xl_2 as v_products_image_xl_2,
+    p.products_image_sm_3 as v_products_image_sm_3,
+    p.products_image_xl_3 as v_products_image_xl_3,
+    p.products_image_sm_4 as v_products_image_sm_4,
+    p.products_image_xl_4 as v_products_image_xl_4,
+    p.products_image_sm_5 as v_products_image_sm_5,
+    p.products_image_xl_5 as v_products_image_xl_5,
+    p.products_image_sm_6 as v_products_image_sm_6,
+    p.products_image_xl_6 as v_products_image_xl_6,
+    p.products_price as v_products_price,
+    p.products_weight as v_products_weight,
+    p.products_date_added as v_date_avail,
+    p.products_tax_class_id as v_tax_class_id,
+    p.products_quantity as v_products_quantity,
+    p.manufacturers_id as v_manufacturers_id,
+    subc.categories_id as v_categories_id
+    FROM
+    ".TABLE_PRODUCTS." as p,
+    ".TABLE_CATEGORIES." as subc,
+    ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc
+    WHERE
+    p.products_id = ptoc.products_id AND
+    p.products_model = '" . $items[$filelayout['v_products_model']] . "' AND
+    ptoc.categories_id = subc.categories_id
+    ";
+
+  $result = tep_db_query($sql);
+  $row =  tep_db_fetch_array($result);
+
+
+  while ($row){
+    // OK, since we got a row, the item already exists.
+    // Let's get all the data we need and fill in all the fields that need to be defaulted to the current values
+    // for each language, get the description and set the vals
+    foreach ($langcode as $key => $lang){
+      //echo "Inside defaulting loop";
+      //echo "key is $key<br>";
+      //echo "langid is " . $lang['id'] . "<br>";
+      $sql2 = "SELECT *
+        FROM ".TABLE_PRODUCTS_DESCRIPTION."
+        WHERE
+          products_id = " . $row['v_products_id'] . " AND
+          language_id = '" . $lang['id'] . "'
+        ";
+      $result2 = tep_db_query($sql2);
+      $row2 =  tep_db_fetch_array($result2);
+                        // Need to report from ......_name_1 not ..._name_0
+      $row['v_products_name_' . $lang['id']]    = $row2['products_name'];
+      $row['v_products_description_' . $lang['id']]   = $row2['products_description'];
+      $row['v_products_url_' . $lang['id']]     = $row2['products_url'];
+
+      // support for Linda's Header Controller 2.0 here
+      if(isset($filelayout['v_products_head_title_tag_' . $lang['id'] ])){
+        $row['v_products_head_title_tag_' . $lang['id']]  = $row2['products_head_title_tag'];
+        $row['v_products_head_desc_tag_' . $lang['id']]   = $row2['products_head_desc_tag'];
+        $row['v_products_head_keywords_tag_' . $lang['id']]   = $row2['products_head_keywords_tag'];
+      }
+      // end support for Header Controller 2.0
+    }
+
+    // start with v_categories_id
+    // Get the category description
+    // set the appropriate variable name
+    // if parent_id is not null, then follow it up.
+    $thecategory_id = $row['v_categories_id'];
+
+    for( $categorylevel=1; $categorylevel<$max_categories+1; $categorylevel++){
+      if ($thecategory_id){
+        $sql2 = "SELECT categories_name
+          FROM ".TABLE_CATEGORIES_DESCRIPTION."
+          WHERE
+            categories_id = " . $thecategory_id . " AND
+            language_id = " . $epdlanguage_id ;
+
+        $result2 = tep_db_query($sql2);
+        $row2 =  tep_db_fetch_array($result2);
+        // only set it if we found something
+        $temprow['v_categories_name_' . $categorylevel] = $row2['categories_name'];
+        // now get the parent ID if there was one
+        $sql3 = "SELECT parent_id
+          FROM ".TABLE_CATEGORIES."
+          WHERE
+            categories_id = " . $thecategory_id;
+        $result3 = tep_db_query($sql3);
+        $row3 =  tep_db_fetch_array($result3);
+        $theparent_id = $row3['parent_id'];
+        if ($theparent_id != ''){
+          // there was a parent ID, lets set thecategoryid to get the next level
+          $thecategory_id = $theparent_id;
+        } else {
+          // we have found the top level category for this item,
+          $thecategory_id = false;
+        }
+      } else {
+          $temprow['v_categories_name_' . $categorylevel] = '';
+      }
+    }
+    // temprow has the old style low to high level categories.
+    $newlevel = 1;
+    // let's turn them into high to low level categories
+    for( $categorylevel=$max_categories+1; $categorylevel>0; $categorylevel--){
+      if ($temprow['v_categories_name_' . $categorylevel] != ''){
+        $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel];
+      }
+    }
+
+    if ($row['v_manufacturers_id'] != ''){
+      $sql2 = "SELECT manufacturers_name
+        FROM ".TABLE_MANUFACTURERS."
+        WHERE
+        manufacturers_id = " . $row['v_manufacturers_id']
+        ;
+      $result2 = tep_db_query($sql2);
+      $row2 =  tep_db_fetch_array($result2);
+      $row['v_manufacturers_name'] = $row2['manufacturers_name'];
+    }
+
+    //elari -
+    //We check the value of tax class and title instead of the id
+    //Then we add the tax to price if $price_with_tax is set to true
+    $row_tax_multiplier = tep_get_tax_class_rate($row['v_tax_class_id']);
+    $row['v_tax_class_title'] = tep_get_tax_class_title($row['v_tax_class_id']);
+    if ($price_with_tax){
+      $row['v_products_price'] = $row['v_products_price'] + round($row['v_products_price']* $row_tax_multiplier / 100,2);
+    }
+
+    // now create the internal variables that will be used
+    // the $$thisvar is on purpose: it creates a variable named what ever was in $thisvar and sets the value
+    foreach ($default_these as $thisvar){
+      $$thisvar = $row[$thisvar];
+    }
+
+    $row =  tep_db_fetch_array($result);
+  }
+// Begin writting new data to current data
+
+  // this is an important loop.  What it does is go thru all the fields in the incoming file and set the internal vars.
+  // Internal vars not set here are either set in the loop above for existing records, or not set at all (null values)
+  // the array values are handled separatly, although they will set variables in this loop, we won't use them.
+  foreach( $filelayout as $key => $value ){
+    $$key = $items[ $value ];
+  }
+
+        // so how to handle these?  we shouldn't built the array unless it's been giving to us.
+  // The assumption is that if you give us names and descriptions, then you give us name and description for all applicable languages
+  foreach ($langcode as $lang){
+    //echo "Langid is " . $lang['id'] . "<br>";
+    $l_id = $lang['id'];
+    if (isset($filelayout['v_products_name_' . $l_id ])){
+      //we set dynamically the language values
+      $v_products_name[$l_id]   = $items[$filelayout['v_products_name_' . $l_id]];
+      $v_products_description[$l_id]  = $items[$filelayout['v_products_description_' . $l_id ]];
+      $v_products_url[$l_id]    = $items[$filelayout['v_products_url_' . $l_id ]];
+      // support for Linda's Header Controller 2.0 here
+      if(isset($filelayout['v_products_head_title_tag_' . $l_id])){
+        $v_products_head_title_tag[$l_id]   = $items[$filelayout['v_products_head_title_tag_' . $l_id]];
+        $v_products_head_desc_tag[$l_id]  = $items[$filelayout['v_products_head_desc_tag_' . $l_id]];
+        $v_products_head_keywords_tag[$l_id]  = $items[$filelayout['v_products_head_keywords_tag_' . $l_id]];
+      }
+      // end support for Header Controller 2.0
+    }
+  }
+  //elari... we get the tax_clas_id from the tax_title
+  //on screen will still be displayed the tax_class_title instead of the id....
+  if ( isset( $v_tax_class_title) ){
+    $v_tax_class_id          = tep_get_tax_title_class_id($v_tax_class_title);
+  }
+  //we check the tax rate of this tax_class_id
+        $row_tax_multiplier = tep_get_tax_class_rate($v_tax_class_id);
+
+  //And we recalculate price without the included tax...
+  //Since it seems display is made before, the displayed price will still include tax
+  //This is same problem for the tax_clas_id that display tax_class_title
+  if ($price_with_tax){
+    $v_products_price        = round( $v_products_price / (1 + ( $row_tax_multiplier * $price_with_tax/100) ), 2);
+  }
+
+  // if they give us one category, they give us all 6 categories
+  unset ($v_categories_name); // default to not set.
+  if ( isset( $filelayout['v_categories_name_1'] ) ){
+    $newlevel = 1;
+    for( $categorylevel=6; $categorylevel>0; $categorylevel--){
+      if ( $items[$filelayout['v_categories_name_' . $categorylevel]] != ''){
+        $v_categories_name[$newlevel++] = $items[$filelayout['v_categories_name_' . $categorylevel]];
+      }
+    }
+    while( $newlevel < $max_categories+1){
+      $v_categories_name[$newlevel++] = ''; // default the remaining items to nothing
+    }
+  }
+
+  if (ltrim(rtrim($v_products_quantity)) == '') {
+    $v_products_quantity = 1;
+  }
+  if ($v_date_avail == '') {
+    $v_date_avail = "CURRENT_TIMESTAMP";
+  } else {
+    // we put the quotes around it here because we can't put them into the query, because sometimes
+    //   we will use the "current_timestamp", which can't have quotes around it.
+    $v_date_avail = '"' . $v_date_avail . '"';
+  }
+
+  if ($v_date_added == '') {
+    $v_date_added = "CURRENT_TIMESTAMP";
+  } else {
+    // we put the quotes around it here because we can't put them into the query, because sometimes
+    //   we will use the "current_timestamp", which can't have quotes around it.
+    $v_date_added = '"' . $v_date_added . '"';
+  }
+
+
+  // default the stock if they spec'd it or if it's blank
+  $v_db_status = '1'; // default to active
+  if ($v_status == $inactive){
+    // they told us to deactivate this item
+    $v_db_status = '0';
+  }
+  if ($zero_qty_inactive && $v_products_quantity == 0) {
+    // if they said that zero qty products should be deactivated, let's deactivate if the qty is zero
+    $v_db_status = '0';
+  }
+
+  if ($v_manufacturer_id==''){
+    $v_manufacturer_id="NULL";
+  }
+
+  if (trim($v_products_image)==''){
+    $v_products_image = $default_image_product;
+  }
+
+  if (strlen($v_products_model) > $modelsize ){
+    $msg_error = "<font color='red'>" . strlen($v_products_model) . $v_products_model . EASY_ERROR_2 . $modelsize . '</font>';
+    die();
+  }
+
+  // OK, we need to convert the manufacturer's name into id's for the database
+  if ( isset($v_manufacturers_name) && $v_manufacturers_name != '' ){
+    $sql = "SELECT man.manufacturers_id
+      FROM ".TABLE_MANUFACTURERS." as man
+      WHERE
+        man.manufacturers_name = '" . $v_manufacturers_name . "'";
+    $result = tep_db_query($sql);
+    $row =  tep_db_fetch_array($result);
+    if ( $row != '' ){
+      foreach( $row as $item ){
+        $v_manufacturer_id = $item;
+      }
+    } else {
+      // to add, we need to put stuff in categories and categories_description
+      $sql = "SELECT MAX( manufacturers_id) max FROM ".TABLE_MANUFACTURERS;
+      $result = tep_db_query($sql);
+      $row =  tep_db_fetch_array($result);
+      $max_mfg_id = $row['max']+1;
+      // default the id if there are no manufacturers yet
+      if (!is_numeric($max_mfg_id) ){
+        $max_mfg_id=1;
+      }
+
+        $sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
+        manufacturers_id,
+        manufacturers_name,
+        manufacturers_image,
+        date_added,
+        last_modified
+        ) VALUES (
+        $max_mfg_id,
+        '$v_manufacturers_name',
+        '$default_image_manufacturer',
+        CURRENT_TIMESTAMP,
+        CURRENT_TIMESTAMP
+        )";
+      $result = tep_db_query($sql);
+      $v_manufacturer_id = $max_mfg_id;
+    }
+  }
+  // if the categories names are set then try to update them
+  if ( isset($v_categories_name_1)){
+    // start from the highest possible category and work our way down from the parent
+    $v_categories_id = 0;
+    $theparent_id = 0;
+    for ( $categorylevel=$max_categories+1; $categorylevel>0; $categorylevel-- ){
+      $thiscategoryname = $v_categories_name[$categorylevel];
+      if ( $thiscategoryname != ''){
+        // we found a category name in this field
+
+        // now the subcategory
+        $sql = "SELECT cat.categories_id
+          FROM ".TABLE_CATEGORIES." as cat,
+               ".TABLE_CATEGORIES_DESCRIPTION." as des
+          WHERE
+            cat.categories_id = des.categories_id AND
+            des.language_id = $epdlanguage_id AND
+            cat.parent_id = " . $theparent_id . " AND
+            des.categories_name = '" . $thiscategoryname . "'";
+        $result = tep_db_query($sql);
+        $row =  tep_db_fetch_array($result);
+        if ( $row != '' ){
+          foreach( $row as $item ){
+            $thiscategoryid = $item;
+          }
+        } else {
+          // to add, we need to put stuff in categories and categories_description
+          $sql = "SELECT MAX( categories_id) max FROM ".TABLE_CATEGORIES;
+          $result = tep_db_query($sql);
+          $row =  tep_db_fetch_array($result);
+          $max_category_id = $row['max']+1;
+          if (!is_numeric($max_category_id) ){
+            $max_category_id=1;
+          }
+          $sql = "INSERT INTO ".TABLE_CATEGORIES."(
+            categories_id,
+            categories_image,
+            parent_id,
+            sort_order,
+            date_added,
+            last_modified
+            ) VALUES (
+            $max_category_id,
+            '$default_image_category',
+            $theparent_id,
+            0,
+            CURRENT_TIMESTAMP
+            ,CURRENT_TIMESTAMP
+            )";
+          $result = tep_db_query($sql);
+          $sql = "INSERT INTO ".TABLE_CATEGORIES_DESCRIPTION."(
+              categories_id,
+              language_id,
+              categories_name
+            ) VALUES (
+              $max_category_id,
+              '$epdlanguage_id',
+              '$thiscategoryname'
+            )";
+          $result = tep_db_query($sql);
+          $thiscategoryid = $max_category_id;
+        }
+        // the current catid is the next level's parent
+        $theparent_id = $thiscategoryid;
+        $v_categories_id = $thiscategoryid; // keep setting this, we need the lowest level category ID later
+      }
+    }
+  }
+
+  if ($v_products_model != "") {
+    //   products_model exists!
+    array_walk($items, 'print_el');
+
+    // First we check to see if this is a product in the current db.
+    $result = tep_db_query("SELECT products_id FROM ".TABLE_PRODUCTS." WHERE (products_model = '". $v_products_model . "')");
+
+    if (tep_db_num_rows($result) == 0)  {
+      //   insert into products
+
+      $sql = "SHOW TABLE STATUS LIKE '".TABLE_PRODUCTS."'";
+      $result = tep_db_query($sql);
+      $row =  tep_db_fetch_array($result);
+      $max_product_id = $row['Auto_increment'];
+      if (!is_numeric($max_product_id) ){
+        $max_product_id=1;
+      }
+      $v_products_id = $max_product_id;
+    //  $v_products_id1 = $max_product_id;
+      $msg_output .=  EASY_LABEL_NEW_PRODUCT ;
+
+      $query = "INSERT INTO ".TABLE_PRODUCTS." (
+          products_image,
+          products_image_med,
+          products_image_lrg,
+          products_image_sm_1,
+          products_image_xl_1,
+          products_image_sm_2,
+          products_image_xl_2,
+          products_image_sm_3,
+          products_image_xl_3,
+          products_image_sm_4,
+          products_image_xl_4,
+          products_image_sm_5,
+          products_image_xl_5,
+          products_image_sm_6,
+          products_image_xl_6,
+          products_model,
+          products_price,
+          products_status,
+          products_last_modified,
+          products_date_added,
+          products_date_available,
+          products_tax_class_id,
+          products_weight,
+          products_quantity,
+          manufacturers_id)
+            VALUES (
+              '$v_products_image',
+              '$v_products_image_med',
+              '$v_products_image_lrg',
+              '$v_products_image_sm_1',
+              '$v_products_image_xl_1',
+              '$v_products_image_sm_2',
+              '$v_products_image_xl_2',
+              '$v_products_image_sm_3',
+              '$v_products_image_xl_3',
+              '$v_products_image_sm_4',
+              '$v_products_image_xl_4',
+              '$v_products_image_sm_5',
+              '$v_products_image_xl_5',
+              '$v_products_image_sm_6',
+              '$v_products_image_xl_6',
+              '$v_products_model',
+                '$v_products_price',
+                '$v_db_status',
+                CURRENT_TIMESTAMP,
+                $v_date_added,
+                $v_date_avail,
+                '$v_tax_class_id',
+                '$v_products_weight',
+                '$v_products_quantity',
+                '$v_manufacturer_id')
+              ";
+        $result = tep_db_query($query);
+    } else {
+      // existing product, get the id from the query
+      // and update the product data
+      $row =  tep_db_fetch_array($result);
+      $v_products_id = $row['products_id'];
+      $msg_output .= EASY_LABEL_UPDATED;
+      $row =  tep_db_fetch_array($result);
+      $query = 'UPDATE '.TABLE_PRODUCTS.'
+          SET
+          products_price="'.$v_products_price.
+          '" ,products_image="'.$v_products_image;
+
+      // uncomment these lines if you are running the image mods
+
+        $query .=
+          '" ,products_image_med="'.$v_products_image_med.
+          '" ,products_image_lrg="'.$v_products_image_lrg.
+          '" ,products_image_sm_1="'.$v_products_image_sm_1.
+          '" ,products_image_xl_1="'.$v_products_image_xl_1.
+          '" ,products_image_sm_2="'.$v_products_image_sm_2.
+          '" ,products_image_xl_2="'.$v_products_image_xl_2.
+          '" ,products_image_sm_3="'.$v_products_image_sm_3.
+          '" ,products_image_xl_3="'.$v_products_image_xl_3.
+          '" ,products_image_sm_4="'.$v_products_image_sm_4.
+          '" ,products_image_xl_4="'.$v_products_image_xl_4.
+          '" ,products_image_sm_5="'.$v_products_image_sm_5.
+          '" ,products_image_xl_5="'.$v_products_image_xl_5.
+          '" ,products_image_sm_6="'.$v_products_image_sm_6.
+          '" ,products_image_xl_6="'.$v_products_image_xl_6;
+
+      $query .= '", products_weight="'.$v_products_weight .
+          '", products_tax_class_id="'.$v_tax_class_id .
+          '", products_date_available= ' . $v_date_avail .
+          ', products_date_added= ' . $v_date_added .
+          ', products_last_modified = CURRENT_TIMESTAMP
+          , products_quantity="' . $v_products_quantity .
+          '" ,manufacturers_id=' . $v_manufacturer_id .
+          ' , products_status=' . $v_db_status . '
+          WHERE
+            (products_id = "'. $v_products_id . '")';
+
+      $result = tep_db_query($query);
+    }
+
+    // the following is common in both the updating an existing product and creating a new product
+                if ( isset($v_products_name)){
+      foreach( $v_products_name as $key => $name){
+              if ($name!=''){
+          $sql = "SELECT * FROM ".TABLE_PRODUCTS_DESCRIPTION." WHERE
+              products_id = $v_products_id AND
+              language_id = " . $key;
+          $result = tep_db_query($sql);
+          if (tep_db_num_rows($result) == 0) {
+            // nope, this is a new product description
+            $result = tep_db_query($sql);
+            $sql =
+              "INSERT INTO ".TABLE_PRODUCTS_DESCRIPTION."
+                (products_id,
+                language_id,
+                products_name,
+                products_description,
+                products_url)
+                VALUES (
+                  '" . $v_products_id . "',
+                  " . $key . ",
+                  '" . $name . "',
+                  '". $v_products_description[$key] . "',
+                  '". $v_products_url[$key] . "'
+                  )";
+            // support for Linda's Header Controller 2.0
+            if (isset($v_products_head_title_tag)){
+              // override the sql if we're using Linda's contrib
+              $sql =
+                "INSERT INTO ".TABLE_PRODUCTS_DESCRIPTION."
+                  (products_id,
+                  language_id,
+                  products_name,
+                  products_description,
+                  products_url,
+                  products_head_title_tag,
+                  products_head_desc_tag,
+                  products_head_keywords_tag)
+                  VALUES (
+                    '" . $v_products_id . "',
+                    " . $key . ",
+                    '" . $name . "',
+                    '". $v_products_description[$key] . "',
+                    '". $v_products_url[$key] . "',
+                    '". $v_products_head_title_tag[$key] . "',
+                    '". $v_products_head_desc_tag[$key] . "',
+                    '". $v_products_head_keywords_tag[$key] . "')";
+            }
+            // end support for Linda's Header Controller 2.0
+            $result = tep_db_query($sql);
+          } else {
+            // already in the description, let's just update it
+            $sql =
+              "UPDATE ".TABLE_PRODUCTS_DESCRIPTION." SET
+                products_name='$name',
+                products_description='".$v_products_description[$key] . "',
+                products_url='" . $v_products_url[$key] . "'
+              WHERE
+                products_id = '$v_products_id' AND
+                language_id = '$key'";
+            // support for Lindas Header Controller 2.0
+            if (isset($v_products_head_title_tag)){
+              // override the sql if we're using Linda's contrib
+              $sql =
+                "UPDATE ".TABLE_PRODUCTS_DESCRIPTION." SET
+                  products_name = '$name',
+                  products_description = '".$v_products_description[$key] . "',
+                  products_url = '" . $v_products_url[$key] ."',
+                  products_head_title_tag = '" . $v_products_head_title_tag[$key] ."',
+                  products_head_desc_tag = '" . $v_products_head_desc_tag[$key] ."',
+                  products_head_keywords_tag = '" . $v_products_head_keywords_tag[$key] ."'
+                WHERE
+                  products_id = '$v_products_id' AND
+                  language_id = '$key'";
+            }
+            // end support for Linda's Header Controller 2.0
+            $result = tep_db_query($sql);
+          }
+        }
+      }
+    }
+    if (isset($v_categories_id)){
+      //find out if this product is listed in the category given
+      $result_incategory = tep_db_query('SELECT
+            '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id,
+            '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id
+            FROM
+              '.TABLE_PRODUCTS_TO_CATEGORIES.'
+            WHERE
+            '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id='.$v_products_id.' AND
+            '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id='.$v_categories_id);
+
+      if (tep_db_num_rows($result_incategory) == 0) {
+        // nope, this is a new category for this product
+        $res1 = tep_db_query('INSERT INTO '.TABLE_PRODUCTS_TO_CATEGORIES.' (products_id, categories_id)
+              VALUES ("' . $v_products_id . '", "' . $v_categories_id . '")');
+      } else {
+        // already in this category, nothing to do!
+      }
+    }
+    // for the separate prices per customer module
+    $ll=1;
+
+    if (isset($v_customer_price_1)){
+
+      if (($v_customer_group_id_1 == '') AND ($v_customer_price_1 != ''))  {
+        $msg_output .= EASY_ERROR_4;
+        die();
+      }
+      // they spec'd some prices, so clear all existing entries
+      $result = tep_db_query('
+            DELETE
+            FROM
+              '.TABLE_PRODUCTS_GROUPS.'
+            WHERE
+              products_id = ' . $v_products_id
+            );
+      // and insert the new record
+      if ($v_customer_price_1 != ''){
+        $result = tep_db_query('
+              INSERT INTO
+                '.TABLE_PRODUCTS_GROUPS.'
+              VALUES
+              (
+                ' . $v_customer_group_id_1 . ',
+                ' . $v_customer_price_1 . ',
+                ' . $v_products_id . ',
+                ' . $v_products_price .'
+                )'
+              );
+      }
+      if ($v_customer_price_2 != ''){
+        $result = tep_db_query('
+              INSERT INTO
+                '.TABLE_PRODUCTS_GROUPS.'
+              VALUES
+              (
+                ' . $v_customer_group_id_2 . ',
+                ' . $v_customer_price_2 . ',
+                ' . $v_products_id . ',
+                ' . $v_products_price . '
+                )'
+              );
+      }
+      if ($v_customer_price_3 != ''){
+        $result = tep_db_query('
+              INSERT INTO
+                '.TABLE_PRODUCTS_GROUPS.'
+              VALUES
+              (
+                ' . $v_customer_group_id_3 . ',
+                ' . $v_customer_price_3 . ',
+                ' . $v_products_id . ',
+                ' . $v_products_price . '
+                )'
+              );
+      }
+      if ($v_customer_price_4 != ''){
+        $result = tep_db_query('
+              INSERT INTO
+                '.TABLE_PRODUCTS_GROUPS.'
+              VALUES
+              (
+                ' . $v_customer_group_id_4 . ',
+                ' . $v_customer_price_4 . ',
+                ' . $v_products_id . ',
+                ' . $v_products_price . '
+                )'
+              );
+      }
+
+    }
+
+    // VJ product attribs begin insert
+    if (isset($v_attribute_options_id_1)){
+      $attribute_rows = 1; // master row count
+
+      $languages = tep_get_languages();
+
+      // product options count
+      $attribute_options_count = 1;
+      $v_attribute_options_id_var = 'v_attribute_options_id_' . $attribute_options_count;
+
+      while (isset($$v_attribute_options_id_var) && !empty($$v_attribute_options_id_var)) {
+        // remove product attribute options linked to this product before proceeding further
+        // this is useful for removing attributes linked to a product
+        $attributes_clean_query = "delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$v_products_id . "' and options_id = '" . (int)$$v_attribute_options_id_var . "'";
+
+        tep_db_query($attributes_clean_query);
+
+        $attribute_options_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$$v_attribute_options_id_var . "'";
+
+        $attribute_options_values = tep_db_query($attribute_options_query);
+
+        // option table update begin
+        if ($attribute_rows == 1) {
+          // insert into options table if no option exists
+          if (tep_db_num_rows($attribute_options_values) <= 0) {
+            for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+              $lid = $languages[$i]['id'];
+
+              $v_attribute_options_name_var = 'v_attribute_options_name_' . $attribute_options_count . '_' . $lid;
+
+              if (isset($$v_attribute_options_name_var)) {
+                $attribute_options_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, language_id, products_options_name) values ('" . (int)$$v_attribute_options_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_options_name_var . "')";
+
+                $attribute_options_insert = tep_db_query($attribute_options_insert_query);
+              }
+            }
+          } else { // update options table, if options already exists
+            for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+              $lid = $languages[$i]['id'];
+
+              $v_attribute_options_name_var = 'v_attribute_options_name_' . $attribute_options_count . '_' . $lid;
+
+              if (isset($$v_attribute_options_name_var)) {
+                $attribute_options_update_lang_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$$v_attribute_options_id_var . "' and language_id ='" . (int)$lid . "'";
+
+                $attribute_options_update_lang_values = tep_db_query($attribute_options_update_lang_query);
+
+                // if option name doesn't exist for particular language, insert value
+                if (tep_db_num_rows($attribute_options_update_lang_values) <= 0) {
+                  $attribute_options_lang_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, language_id, products_options_name) values ('" . (int)$$v_attribute_options_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_options_name_var . "')";
+
+                  $attribute_options_lang_insert = tep_db_query($attribute_options_lang_insert_query);
+                } else { // if option name exists for particular language, update table
+                  $attribute_options_update_query = "update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . $$v_attribute_options_name_var . "' where products_options_id ='" . (int)$$v_attribute_options_id_var . "' and language_id = '" . (int)$lid . "'";
+
+                  $attribute_options_update = tep_db_query($attribute_options_update_query);
+                }
+              }
+            }
+          }
+        }
+        // option table update end
+
+        // product option values count
+        $attribute_values_count = 1;
+        $v_attribute_values_id_var = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count;
+
+        while (isset($$v_attribute_values_id_var) && !empty($$v_attribute_values_id_var)) {
+          $attribute_values_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$$v_attribute_values_id_var . "'";
+
+          $attribute_values_values = tep_db_query($attribute_values_query);
+
+          // options_values table update begin
+          if ($attribute_rows == 1) {
+            // insert into options_values table if no option exists
+            if (tep_db_num_rows($attribute_values_values) <= 0) {
+              for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+                $lid = $languages[$i]['id'];
+
+                $v_attribute_values_name_var = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid;
+
+                if (isset($$v_attribute_values_name_var)) {
+                  $attribute_values_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int)$$v_attribute_values_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_values_name_var . "')";
+
+                  $attribute_values_insert = tep_db_query($attribute_values_insert_query);
+                }
+              }
+
+
+              // insert values to pov2po table
+              $attribute_values_pov2po_query = "insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_id, products_options_values_id) values ('" . (int)$$v_attribute_options_id_var . "', '" . (int)$$v_attribute_values_id_var . "')";
+
+              $attribute_values_pov2po = tep_db_query($attribute_values_pov2po_query);
+            } else { // update options table, if options already exists
+              for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+                $lid = $languages[$i]['id'];
+
+                $v_attribute_values_name_var = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid;
+
+                if (isset($$v_attribute_values_name_var)) {
+                  $attribute_values_update_lang_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$$v_attribute_values_id_var . "' and language_id ='" . (int)$lid . "'";
+
+                  $attribute_values_update_lang_values = tep_db_query($attribute_values_update_lang_query);
+
+                  // if options_values name doesn't exist for particular language, insert value
+                  if (tep_db_num_rows($attribute_values_update_lang_values) <= 0) {
+                    $attribute_values_lang_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int)$$v_attribute_values_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_values_name_var . "')";
+
+                    $attribute_values_lang_insert = tep_db_query($attribute_values_lang_insert_query);
+                  } else { // if options_values name exists for particular language, update table
+                    $attribute_values_update_query = "update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . $$v_attribute_values_name_var . "' where products_options_values_id ='" . (int)$$v_attribute_values_id_var . "' and language_id = '" . (int)$lid . "'";
+
+                    $attribute_values_update = tep_db_query($attribute_values_update_query);
+                  }
+                }
+              }
+            }
+          }
+          // options_values table update end
+
+          // options_values price update begin
+          $v_attribute_values_price_var = 'v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count;
+
+          if (isset($$v_attribute_values_price_var) && ($$v_attribute_values_price_var != '')) {
+            $attribute_prices_query = "select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$v_products_id . "' and options_id ='" . (int)$$v_attribute_options_id_var . "' and options_values_id = '" . (int)$$v_attribute_values_id_var . "'";
+
+            $attribute_prices_values = tep_db_query($attribute_prices_query);
+
+            $attribute_values_price_prefix = ($$v_attribute_values_price_var < 0) ? '-' : '+';
+
+            // options_values_prices table update begin
+            // insert into options_values_prices table if no price exists
+            if (tep_db_num_rows($attribute_prices_values) <= 0) {
+              $attribute_prices_insert_query = "insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix) values ('" . (int)$v_products_id . "', '" . (int)$$v_attribute_options_id_var . "', '" . (int)$$v_attribute_values_id_var . "', '" . (int)$$v_attribute_values_price_var . "', '" . $attribute_values_price_prefix . "')";
+
+              $attribute_prices_insert = tep_db_query($attribute_prices_insert_query);
+            } else { // update options table, if options already exists
+              $attribute_prices_update_query = "update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_values_price = '" . $$v_attribute_values_price_var . "', price_prefix = '" . $attribute_values_price_prefix . "' where products_id = '" . (int)$v_products_id . "' and options_id = '" . (int)$$v_attribute_options_id_var . "' and options_values_id ='" . (int)$$v_attribute_values_id_var . "'";
+
+              $attribute_prices_update = tep_db_query($attribute_prices_update_query);
+            }
+          }
+          // options_values price update end
+
+          $attribute_values_count++;
+          $v_attribute_values_id_var = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count;
+        }
+
+        $attribute_options_count++;
+        $v_attribute_options_id_var = 'v_attribute_options_id_' . $attribute_options_count;
+      }
+
+      $attribute_rows++;
+    }
+    // VJ product attribs end
+
+      } else {
+  //  // this record was missing the product_id
+    array_walk($items, 'print_el');
+    $msg_output .= EASY_ERROR_7 ;
+  }
+// end of row insertion code
+}
+
+
+require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/easypopulate_export.php
===================================================================
--- trunk/direct.openmoko.com/admin/easypopulate_export.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/easypopulate_export.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,973 @@
+<?php
+/*
+  $Id: easypopulate.php,v 3.01 2004/09/21  zip1 Exp $
+  
+    Released under the GNU General Public License
+*/
+$curver = '3.01 Advance';
+
+//*******************************
+// S T A R T
+// INITIALIZATION
+//*******************************
+
+require('epconfigure.php');
+include ('includes/functions/easypopulate_functions.php');
+include (DIR_WS_LANGUAGES . $language . '/easypopulate.php');
+//*******************************
+
+//  Start TIMER
+//  -----------
+$stimer = explode( ' ', microtime() );
+$stimer = $stimer[1] + $stimer[0];
+global $filelayout, $filelayout_count, $filelayout_sql, $langcode, $fileheaders;
+
+//elari check default language_id from configuration table DEFAULT_LANGUAGE
+$epdlanguage_query = tep_db_query("select languages_id, name, code from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . "'");
+if (tep_db_num_rows($epdlanguage_query)) {
+  $epdlanguage = tep_db_fetch_array($epdlanguage_query);
+  $epdlanguage_id   = $epdlanguage['languages_id'];
+  $epdlanguage_name = $epdlanguage['name'];
+  $epdlanguage_code = $epdlanguage['code'];
+} else {
+  $msg_error = EASY_ERROR_1;
+}
+
+$langcode = ep_get_languages();
+
+//end intilization
+// queries to pull data
+if ( $dltype != '' ){
+  // if dltype is set, then create the filelayout.  Otherwise it gets read from the uploaded file
+
+  global $GLOBALS, $filelayout, $filelayout_count, $filelayout_sql, $langcode, $fileheaders, $max_categories, $rangebegin, $rangeend, $catsort, $catfilter, $BEGIN1, $BEEND1, $limit_man, $limit_cat, $categories_range;
+  // depending on the type of the download the user wanted, create a file layout for it.
+  $fieldmap = array(); // default to no mapping to change internal field names to external.
+
+//category range to download
+ switch( $dltype ){
+        case 'full':
+  case 'category':
+if ($limit_cat == '0'){
+  }else{
+// for one level down
+$categories_range .= 'ptoc.categories_id =  \'' . $limit_cat. '\' and ';
+
+// for two levels down
+//  $catfeild=tep_get_category_treea($limit_cat);
+//          $categories_range .= "( ";
+//for ($i=0, $n=sizeof($catfeild); $i<$n; $i++) {
+//  $categories_range .= 'ptoc.categories_id = ' . "'"  . tep_output_string($catfeild[$i]['id'] . "' ");
+//if ($i<$n){
+// $categories_range .= ' or ';
+//         }
+//
+//    }
+//     $categories_range=substr_replace($categories_range, ')and ', -4);
+
+ }
+break;
+        case 'priceqty':
+  case 'attrib':
+    
+    if ($limit_cat == '0'){
+    }else{
+    $catfeild=tep_get_category_treea($limit_cat);
+            $categories_range .= "( ";
+  for ($i=0, $n=sizeof($catfeild); $i<$n; $i++) {
+    $categories_range .= 'ptoc.categories_id = ' . "'"  . tep_output_string($catfeild[$i]['id'] . "' ");
+  if ($i<$n){
+   $categories_range .= ' or ';
+           }
+
+      }
+       $categories_range=substr_replace($categories_range, ')and ', -4);
+ }
+
+break;
+ }
+//manufactur range to download
+
+switch( $dltype ){
+    case 'full':
+    case 'category':
+  if ($limit_man == '0'){
+  }else{
+ $limit_man1= 'p.manufacturers_id = \'' . $limit_man. '\' and ';
+   }
+  case 'attrib':
+        case 'priceqty':
+break;
+ }
+
+//product range to download
+switch( $dltype ){
+  case 'full':
+  case 'category':
+  if ($rangebegin != ''){
+   $BEGIN1= 'p.products_id >= \'' . $rangebegin . '\' and';
+    } else {
+   }
+
+  if ($rangeend != ''){
+   $BEEND1= 'p.products_id <= \'' . $rangeend . '\' and';
+    } else {
+   }
+break;
+
+case 'priceqty':
+case 'attrib':
+
+if ( ($rangebegin != '') and ($rangeend == '') ){
+   $BEGIN1= 'where p.products_id >= \'' . $rangebegin . '\' and';
+} else if ( ($rangebegin == '') && ($rangeend != '') ){
+   $BEEND1= 'where p.products_id <= \'' . $rangeend . '\' ';
+} else if ( ($rangeend != '') && ($rangeend != '') ){
+   $BEEND1= 'where  p.products_id >= \'' . $rangebegin . '\' and p.products_id <= \'' . $rangeend . '\' ';
+    } else {
+   }
+
+
+break;
+}
+//sort order by category,product, number, manufacture
+switch( $dltype ){
+
+  case 'full':
+  case 'category':
+        case 'priceqty':
+        
+  if ($dltype == 'attrib'){
+     }else{
+     $WHERE = 'WHERE';
+     }
+
+
+  if ($catsort == 'none'){
+    $catfil= '';
+     }
+        if (($catsort == 'category') && ($dltype!= 'attrib')) {
+     $catfil= 'ORDER BY subc.categories_id';
+    }
+
+    if($catsort == 'product'){
+      $catfil= 'ORDER BY p.products_id';
+    }
+    if ($catsort == 'manufacture'){
+        $catfil= 'ORDER BY p.manufacturers_id';
+    } ;
+
+case 'attrib':
+break;
+
+}
+  switch( $dltype ){
+
+  case 'full':
+    // The file layout is dynamically made depending on the number of languages
+    $iii = 0;
+    $filelayout = array(
+        'v_products_id'   => $iii++,
+      'v_products_model'    => $iii++,
+      'v_products_image'    => $iii++,
+      'v_products_image_med'    => $iii++,
+      'v_products_image_lrg'    => $iii++,
+      'v_products_image_sm_1'   => $iii++,
+      'v_products_image_xl_1'   => $iii++,
+      'v_products_image_sm_2'   => $iii++,
+      'v_products_image_xl_2'   => $iii++,
+      'v_products_image_sm_3'   => $iii++,
+      'v_products_image_xl_3'   => $iii++,
+      'v_products_image_sm_4'   => $iii++,
+      'v_products_image_xl_4'   => $iii++,
+      'v_products_image_sm_5'   => $iii++,
+      'v_products_image_xl_5'   => $iii++,
+      'v_products_image_sm_6'   => $iii++,
+      'v_products_image_xl_6'   => $iii++
+      );
+
+    foreach ($langcode as $key => $lang){
+      $l_id = $lang['id'];
+      // uncomment the head_title, head_desc, and head_keywords to use
+      // Linda's Header Tag Controller 2.0
+      //echo $langcode['id'] . $langcode['code'];
+      $filelayout  = array_merge($filelayout , array(
+          'v_products_name_' . $l_id    => $iii++,
+          //'v_products_description_' . $l_id => $iii++,
+          'v_products_description_' . $l_id => (str_replace('"', '\"', $iii++)),
+          'v_products_url_' . $l_id => $iii++,
+          'v_products_head_title_tag_'.$l_id  => $iii++,
+          'v_products_head_desc_tag_'.$l_id => $iii++,
+          'v_products_head_keywords_tag_'.$l_id => $iii++,
+          ));
+    }
+
+
+    // uncomment the customer_price and customer_group to support multi-price per product contrib
+
+
+     $header_array = array(
+      'v_products_price'    => $iii++,
+      'v_products_weight'   => $iii++,
+      'v_date_avail'      => $iii++,
+      'v_date_added'      => $iii++,
+      'v_products_quantity'   => $iii++,
+      );
+
+  $languages = tep_get_languages();
+
+    $header_array['v_manufacturers_name'] = $iii++;
+
+    $filelayout = array_merge($filelayout, $header_array);
+
+
+    // build the categories name section of the array based on the number of categores the user wants to have
+    for($i=1;$i<$max_categories+1;$i++){
+      $filelayout = array_merge($filelayout, array('v_categories_name_' . $i => $iii++));
+    }
+
+    $filelayout = array_merge($filelayout, array(
+      'v_tax_class_title'   => $iii++,
+      'v_status'      => $iii++,
+      'v_action'      => $iii++,
+      ));
+
+    $filelayout_sql = "SELECT
+      p.products_id as v_products_id,
+      p.products_model as v_products_model,
+      p.products_image as v_products_image,
+      p.products_image_med as v_products_image_med,
+      p.products_image_lrg as v_products_image_lrg,
+      p.products_image_sm_1 as v_products_image_sm_1,
+      p.products_image_xl_1 as v_products_image_xl_1,
+      p.products_image_sm_2 as v_products_image_sm_2,
+      p.products_image_xl_2 as v_products_image_xl_2,
+      p.products_image_sm_3 as v_products_image_sm_3,
+      p.products_image_xl_3 as v_products_image_xl_3,
+      p.products_image_sm_4 as v_products_image_sm_4,
+      p.products_image_xl_4 as v_products_image_xl_4,
+      p.products_image_sm_5 as v_products_image_sm_5,
+      p.products_image_xl_5 as v_products_image_xl_5,
+      p.products_image_sm_6 as v_products_image_sm_6,
+      p.products_image_xl_6 as v_products_image_xl_6,
+      p.products_price as v_products_price,
+      p.products_weight as v_products_weight,
+      p.products_date_available as v_date_avail,
+      p.products_date_added as v_date_added,
+      p.products_tax_class_id as v_tax_class_id,
+      p.products_quantity as v_products_quantity,
+      p.manufacturers_id as v_manufacturers_id,
+      subc.categories_id as v_categories_id,
+      p.products_status as v_status
+      FROM
+      ".TABLE_PRODUCTS." as p,
+      ".TABLE_CATEGORIES." as subc,
+      ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc
+      WHERE
+      ".$categories_range."
+      ".$limit_man1."
+      p.products_id = ptoc.products_id AND
+                        ".$BEGIN1."
+      ".$BEEND1."
+      ptoc.categories_id = subc.categories_id
+      ".$catfil."
+      ";
+
+    break;
+
+  case 'priceqty':
+    $iii = 0;
+    // uncomment the customer_price and customer_group to support multi-price per product contrib
+    $filelayout = array(
+        'v_products_id'   => $iii++,  //added
+      'v_products_model'    => $iii++,
+      'v_products_price'    => $iii++,
+      'v_products_quantity'   => $iii++,
+      #'v_customer_price_1'   => $iii++,
+      #'v_customer_group_id_1'  => $iii++,
+      #'v_customer_price_2'   => $iii++,
+      #'v_customer_group_id_2'  => $iii++,
+      #'v_customer_price_3'   => $iii++,
+      #'v_customer_group_id_3'  => $iii++,
+      #'v_customer_price_4'   => $iii++,
+      #'v_customer_group_id_4'  => $iii++,
+        );
+    $filelayout_sql = "SELECT
+      p.products_id as v_products_id,
+      p.products_model as v_products_model,
+      p.products_price as v_products_price,
+      p.products_quantity as v_products_quantity
+      FROM
+      ".TABLE_PRODUCTS." as p
+      ".$BEGIN1."
+      ".$BEEND1."
+      ".$categories_range."
+      ".$limit_man1."
+            ".$catfil."
+      ";
+
+    break;
+
+  case 'category':
+    // The file layout is dynamically made depending on the number of languages
+    $iii = 0;
+    $filelayout = array(
+        'v_products_id'   => $iii++,
+    'v_products_model'    => $iii++,
+    );
+
+    // build the categories name section of the array based on the number of categores the user wants to have
+    for($i=1;$i<$max_categories+1;$i++){
+      $filelayout = array_merge($filelayout, array('v_categories_name_' . $i => $iii++));
+    }
+           $filelayout = array_merge($filelayout, array('v_action' => $iii++));
+
+    $filelayout_sql = "SELECT
+      p.products_id as v_products_id,
+      p.products_model as v_products_model,
+      subc.categories_id as v_categories_id
+      FROM
+      ".TABLE_PRODUCTS." as p,
+      ".TABLE_CATEGORIES." as subc,
+      ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc
+      WHERE
+            ".$categories_range."
+      ".$limit_man1."
+      p.products_id = ptoc.products_id AND
+      ".$BEGIN1."
+            ".$BEEND1."
+      ptoc.categories_id = subc.categories_id
+      ".$catfil."
+      ";
+    break;
+
+
+  case 'attrib':
+// VJ product attributes begin
+
+$attribute_options_array = array();
+
+if ($products_with_attributes == true) {
+  if (is_array($attribute_options_select) && (count($attribute_options_select) > 0)) {
+    foreach ($attribute_options_select as $value) {
+      $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " where products_options_name = '" . $value . "'";
+
+      $attribute_options_values = tep_db_query($attribute_options_query);
+
+      if ($attribute_options = tep_db_fetch_array($attribute_options_values)){
+        $attribute_options_array[] = array('products_options_id' => $attribute_options['products_options_id']);
+      }
+    }
+  } else {
+    $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " order by products_options_id";
+
+    $attribute_options_values = tep_db_query($attribute_options_query);
+
+    while ($attribute_options = tep_db_fetch_array($attribute_options_values)){
+      $attribute_options_array[] = array('products_options_id' => $attribute_options['products_options_id']);
+    }
+  }
+ }
+
+  
+    $iii = 0;
+    $filelayout = array(
+            'v_products_id'   => $iii++,
+      'v_products_model'  => $iii++,
+      );
+
+    $header_array = array();
+
+    $languages = tep_get_languages();
+
+    global $attribute_options_array;
+
+    $attribute_options_count = 1;
+    foreach ($attribute_options_array as $attribute_options_values) {
+      $key1 = 'v_attribute_options_id_' . $attribute_options_count;
+      $header_array[$key1] = $iii++;
+
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        $l_id = $languages[$i]['id'];
+
+        $key2 = 'v_attribute_options_name_' . $attribute_options_count . '_' . $l_id;
+        $header_array[$key2] = $iii++;
+      }
+
+      $attribute_values_query = "select products_options_values_id  from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options_values['products_options_id'] . "' order by products_options_values_id";
+
+      $attribute_values_values = tep_db_query($attribute_values_query);
+
+      $attribute_values_count = 1;
+      while ($attribute_values = tep_db_fetch_array($attribute_values_values)) {
+        $key3 = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count;
+        $header_array[$key3] = $iii++;
+
+        $key4 = 'v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count;
+        $header_array[$key4] = $iii++;
+
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $l_id = $languages[$i]['id'];
+
+          $key5 = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $l_id;
+          $header_array[$key5] = $iii++;
+        }
+
+        $attribute_values_count++;
+      }
+
+      $attribute_options_count++;
+    }
+
+    $filelayout = array_merge($filelayout, $header_array);
+
+    $filelayout_sql = "SELECT
+      p.products_id as v_products_id,
+      p.products_model as v_products_model
+      FROM
+      ".TABLE_PRODUCTS." as p
+      ".$WHERE."
+      ".$categories_range."
+      ".$limit_man1."
+      ".$BEGIN1."
+                        ".$BEEND1."
+      ".$catfil."
+      ";
+
+    break;
+// VJ product attributes end
+  }
+  $filelayout_count = count($filelayout);
+
+
+//end output
+
+}
+
+//build downlaod file
+if ( $download == 'stream' or  $download == 'tempfile' ){
+  //*******************************
+  //*******************************
+  // DOWNLOAD FILE
+  //*******************************
+  //*******************************
+  $filestring = ""; // this holds the csv file we want to download
+
+
+  $result = tep_db_query($filelayout_sql);
+  $row =  tep_db_fetch_array($result);
+
+  // Here we need to allow for the mapping of internal field names to external field names
+  // default to all headers named like the internal ones
+  // the field mapping array only needs to cover those fields that need to have their name changed
+  if ( count($fileheaders) != 0 ){
+    $filelayout_header = $fileheaders; // if they gave us fileheaders for the dl, then use them
+  } else {
+    $filelayout_header = $filelayout; // if no mapping was spec'd use the internal field names for header names
+  }
+  //We prepare the table heading with layout values
+  foreach( $filelayout_header as $key => $value ){
+    $filestring .= $key . $separator;
+  }
+  // now lop off the trailing tab
+  $filestring = substr($filestring, 0, strlen($filestring)-1);
+
+  // set the type
+    $endofrow = $separator . 'EOREOR' . "\n";
+  $filestring .= $endofrow;
+
+  $num_of_langs = count($langcode);
+
+  while ($row){
+
+    // names and descriptions require that we loop thru all languages that are turned on in the store
+    foreach ($langcode as $key => $lang){
+      $lid = $lang['id'];
+      $lcd = $lang['code'];
+
+      // for each language, get the description and set the vals
+      $sql2 = "SELECT *
+        FROM ".TABLE_PRODUCTS_DESCRIPTION."
+        WHERE
+          products_id = " . $row['v_products_id'] . " AND
+          language_id = '" . $lid . "'
+
+         ";
+      $result2 = tep_db_query($sql2);
+      $row2 =  tep_db_fetch_array($result2);
+
+//added cpath
+      // for the categories, we need to keep looping until we find the root category
+      // start with v_categories_id
+      // Get the category description
+      // set the appropriate variable name
+      // if parent_id is not null, then follow it up.
+      // we'll populate an aray first, then decide where it goes in the
+      $thecategory_id1 = $row['v_categories_id'];
+      $fullcategory1 = ''; // this will have the entire category stack for froogle
+      for( $categorylevel=1; $categorylevel<$max_categories+1; $categorylevel++){
+        if ($thecategory_id1){
+          // now get the parent ID if there was one
+          $sq23 = "SELECT parent_id
+            FROM ".TABLE_CATEGORIES."
+            WHERE categories_id = " . $thecategory_id1;
+          $result23 = tep_db_query($sq23);
+          $row23 =  tep_db_fetch_array($result23);
+          $theparent_id1 = $row23['parent_id'];
+        }
+        $cPath = $theparent_id1 .  '_'  . $row['v_categories_id'];
+                    }
+
+      // I'm only doing this for the first language, since right now froogle is US only.. Fix later!
+      // adding url for froogle, but it should be available no matter what
+
+      $row['v_products_name_' . $lid]   = $row2['products_name'];
+      $row['v_products_description_' . $lid]  = $row2['products_description'];
+      $row['v_products_url_' . $lid]    = $row2['products_url'];
+
+
+      // support for Linda's Header Controller 2.0 here
+      if(isset($filelayout['v_products_head_title_tag_' . $lid])){
+        $row['v_products_head_title_tag_' . $lid]   = $row2['products_head_title_tag'];
+        $row['v_products_head_desc_tag_' . $lid]  = $row2['products_head_desc_tag'];
+        $row['v_products_head_keywords_tag_' . $lid]  = $row2['products_head_keywords_tag'];
+      }
+      // end support for Header Controller 2.0
+    }
+
+    // for the categories, we need to keep looping until we find the root category
+
+    // start with v_categories_id
+    // Get the category description
+    // set the appropriate variable name
+    // if parent_id is not null, then follow it up.
+    // we'll populate an aray first, then decide where it goes in the
+    $thecategory_id = $row['v_categories_id'];
+    $fullcategory = ''; // this will have the entire category stack for froogle
+    for( $categorylevel=1; $categorylevel<$max_categories+1; $categorylevel++){
+      if ($thecategory_id){
+        $sql2 = "SELECT categories_name
+          FROM ".TABLE_CATEGORIES_DESCRIPTION."
+          WHERE
+            categories_id = " . $thecategory_id . " AND
+            language_id = " . $epdlanguage_id ;
+
+        $result2 = tep_db_query($sql2);
+        $row2 =  tep_db_fetch_array($result2);
+        // only set it if we found something
+        $temprow['v_categories_name_' . $categorylevel] = $row2['categories_name'];
+        // now get the parent ID if there was one
+        $sql3 = "SELECT parent_id
+          FROM ".TABLE_CATEGORIES."
+          WHERE
+            categories_id = " . $thecategory_id;
+        $result3 = tep_db_query($sql3);
+        $row3 =  tep_db_fetch_array($result3);
+        $theparent_id = $row3['parent_id'];
+        if ($theparent_id != ''){
+          // there was a parent ID, lets set thecategoryid to get the next level
+          $thecategory_id = $theparent_id;
+        } else {
+          // we have found the top level category for this item,
+          $thecategory_id = false;
+        }
+        //$fullcategory .= " > " . $row2['categories_name'];
+        $fullcategory = $row2['categories_name'] . " > " . $fullcategory;
+      } else {
+        $temprow['v_categories_name_' . $categorylevel] = '';
+      }
+    }
+    // now trim off the last ">" from the category stack
+    $row['v_category_fullpath'] = substr($fullcategory,0,strlen($fullcategory)-3);
+
+    // temprow has the old style low to high level categories.
+    $newlevel = 1;
+    // let's turn them into high to low level categories
+    for( $categorylevel=6; $categorylevel>0; $categorylevel--){
+      if ($temprow['v_categories_name_' . $categorylevel] != ''){
+        $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel];
+      }
+    }
+    // if the filelayout says we need a manufacturers name, get it
+    if (isset($filelayout['v_manufacturers_name'])){
+      if ($row['v_manufacturers_id'] != ''){
+        $sql2 = "SELECT manufacturers_name
+          FROM ".TABLE_MANUFACTURERS."
+          WHERE
+          manufacturers_id = " . $row['v_manufacturers_id']
+          ;
+        $result2 = tep_db_query($sql2);
+        $row2 =  tep_db_fetch_array($result2);
+        $row['v_manufacturers_name'] = $row2['manufacturers_name'];
+      }
+    }
+
+
+    // If you have other modules that need to be available, put them here
+
+    // VJ product attribs begin
+    if (isset($filelayout['v_attribute_options_id_1'])){
+      $languages = tep_get_languages();
+
+      $attribute_options_count = 1;
+      foreach ($attribute_options_array as $attribute_options) {
+        $row['v_attribute_options_id_' . $attribute_options_count]  = $attribute_options['products_options_id'];
+
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $lid = $languages[$i]['id'];
+
+          $attribute_options_languages_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' and language_id = '" . (int)$lid . "'";
+
+          $attribute_options_languages_values = tep_db_query($attribute_options_languages_query);
+
+          $attribute_options_languages = tep_db_fetch_array($attribute_options_languages_values);
+
+          $row['v_attribute_options_name_' . $attribute_options_count . '_' . $lid] = $attribute_options_languages['products_options_name'];
+        }
+
+        $attribute_values_query = "select products_options_values_id from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' order by products_options_values_id";
+
+        $attribute_values_values = tep_db_query($attribute_values_query);
+
+        $attribute_values_count = 1;
+        while ($attribute_values = tep_db_fetch_array($attribute_values_values)) {
+          $row['v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count]   = $attribute_values['products_options_values_id'];
+
+          $attribute_values_price_query = "select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$row['v_products_id'] . "' and options_id = '" . (int)$attribute_options['products_options_id'] . "' and options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "'";
+
+          $attribute_values_price_values = tep_db_query($attribute_values_price_query);
+
+          $attribute_values_price = tep_db_fetch_array($attribute_values_price_values);
+
+          $row['v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count]  = $attribute_values_price['price_prefix'] . $attribute_values_price['options_values_price'];
+
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+            $lid = $languages[$i]['id'];
+
+            $attribute_values_languages_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "' and language_id = '" . (int)$lid . "'";
+
+            $attribute_values_languages_values = tep_db_query($attribute_values_languages_query);
+
+            $attribute_values_languages = tep_db_fetch_array($attribute_values_languages_values);
+
+            $row['v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid] = $attribute_values_languages['products_options_values_name'];
+          }
+
+          $attribute_values_count++;
+        }
+
+        $attribute_options_count++;
+      }
+    }
+    // VJ product attribs end
+
+    // this is for the separate price per customer module
+    if (isset($filelayout['v_customer_price_1'])){
+      $sql2 = "SELECT
+          customers_group_price,
+          customers_group_id
+        FROM
+          ".TABLE_PRODUCTS_GROUPS."
+        WHERE
+        products_id = " . $row['v_products_id'] . "
+        ORDER BY
+        customers_group_id"
+        ;
+      $result2 = tep_db_query($sql2);
+      $ll = 1;
+      $row2 =  tep_db_fetch_array($result2);
+      while( $row2 ){
+        $row['v_customer_group_id_' . $ll]  = $row2['customers_group_id'];
+        $row['v_customer_price_' . $ll]   = $row2['customers_group_price'];
+        $row2 = tep_db_fetch_array($result2);
+        $ll++;
+      }
+    }
+
+    //elari -
+    //We check the value of tax class and title instead of the id
+    //Then we add the tax to price if $price_with_tax is set to 1
+    
+    $row_tax_multiplier     = tep_get_tax_class_rate($row['v_tax_class_id']);
+    $row['v_tax_class_title']   = tep_get_tax_class_title($row['v_tax_class_id']);
+   if ($price_with_tax == 'true'){
+    $row['v_products_price']  = $row['v_products_price'] +
+              ($price_with_tax * round($row['v_products_price'] * $row_tax_multiplier / 100,2));
+               }
+
+    // Now set the status to a word the user specd in the config vars
+    if ( $row['v_status'] == '1' ){
+      $row['v_status'] = $active;
+    } else {
+      $row['v_status'] = $inactive;
+    }
+
+    // remove any bad things in the texts that could confuse EasyPopulate
+    $therow = '';
+    foreach( $filelayout as $key => $value ){
+      //echo "The field was $key<br>";
+
+      $thetext = $row[$key];
+      // kill the carriage returns and tabs in the descriptions, they're killing me!
+      $thetext = str_replace("\r",' ',$thetext);
+      $thetext = str_replace("\n",' ',$thetext);
+      $thetext = str_replace("\t",' ',$thetext);
+      // and put the text into the output separated by tabs
+      $therow .= $thetext . $separator;
+    }
+
+    // lop off the trailing tab, then append the end of row indicator
+    $therow = substr($therow,0,strlen($therow)-1) . $endofrow;
+
+    $filestring .= $therow;
+    // grab the next row from the db
+    $row =  tep_db_fetch_array($result);
+  }
+
+//End of create download
+  #$EXPORT_TIME=time();
+  $EXPORT_TIME = strftime('%Y%b%d-%H%I');
+    $EXPORT_TIME = "EPA" . $EXPORT_TIME;
+
+  // now either stream it to them or put it in the temp directory
+  if ($download == 'stream'){
+    //*******************************
+    // STREAM FILE
+    //*******************************
+    header("Content-type: application/vnd.ms-excel");
+    header("Content-disposition: attachment; filename=$EXPORT_TIME.txt");
+    header("Pragma: no-cache");
+    header("Expires: 0");
+    echo $filestring;
+    die();
+
+    // VJ disabled
+    //  tep_redirect(tep_href_link(FILENAME_EASYPOPULATE_EXPORT, 'mesID=MSG2&name=' . $EXPORT_TIME));
+  
+  } else {
+    //*******************************
+    // PUT FILE IN TEMP DIR
+    //*******************************
+    $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "$EXPORT_TIME.txt";
+    //unlink($tmpfname);
+    $fp = fopen( $tmpfname, "w+");
+    fwrite($fp, $filestring);
+    fclose($fp);
+    //echo EASY_FILE_LOCATE . $tempdir .  $EXPORT_TIME . ".txt" ;
+
+    // VJ disabled
+    //          tep_redirect(tep_href_link(FILENAME_EASYPOPULATE_EXPORT, 'mesID=MSG1&name=' . $EXPORT_TIME));
+    //echo  '<a href="easypopulate_export.php">' . EASY_FILE_RETURN . '</a><br>';
+
+
+    //die();
+  }
+}   // *** END *** download section
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+<tr>
+<td width="<?php echo BOX_WIDTH; ?>" valign="top" height="27">
+<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<?php require(DIR_WS_INCLUDES . 'column_left.php');?>
+</table></td>
+
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo EASY_VERSION_A . EASY_VER_A . EASY_EXPORT; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+
+<?php
+if ($mesID == MSG1){
+       echo '<tr class="epa_msg"><td>' . EASY_FILE_LOCATE . $tempdir .  $name . ".txt" . '</td></tr>';
+       
+}
+
+if ($mesID == MSG2){
+       echo '<tr><td>' . EASY_FILE_LOCATE2 .  $name . ".txt" . '</td></tr>';
+}
+?>
+               </tr>
+        <tr class="dataTableHeadingRow">
+                <td>
+<b><?php echo EASY_LABEL_CREATE . '</b>' ;
+         echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_export') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+?>                 </td>
+               </tr>
+               <tr>
+               <td>
+ <?php echo tep_draw_form('localfile_export', 'easypopulate_export.php', 'action=export', 'post', 'ENCTYPE="multipart/form-data"'); ?>
+                 </td>
+               </tr>
+               <tr>
+                 <td>
+                 <b><?php echo EASY_LABEL_CREATE_SELECT. '</b>' ;
+         echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_select_method') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+         echo '&nbsp;';?>
+      <select name="download">
+      <option selected value ="stream" size="10"><?php echo EASY_LABEL_DOWNLOAD . '<b> ';?>
+      <option value="tempfile" size="10"><?php echo EASY_LABEL_CREATE_SAVE;?>
+      </select>
+                   </td>
+      </tr>
+      <tr>
+       <td>
+      
+      
+ <b><?php echo EASY_LABEL_SELECT_DOWN . '</b>';
+  echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_select_down') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+        echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'?>
+      <select name="dltype">
+      <option selected value ="full" size="10"><?php echo EASY_LABEL_COMPLETE //full;?>
+      <option value="priceqty" size="10"><?php echo EASY_LABEL_MPQ //model price qty;?>
+      <option value="category" size="10"><?php echo EASY_LABEL_EP_MC //model category;?>
+<?php // <option value="attrib" size="10"><?php echo EASY_LABEL_EP_ATTRIB //attibutes
+ ;?>
+      </select>
+       </td>
+      </tr>
+      <tr>
+       <td>
+       <b><?php echo EASY_LABEL_SORT . '</b>';
+  echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_select_sort') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+        echo  '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'?>
+            <select name="catsort">
+            <option selected value ="none" size="10"><?php echo EASY_LABEL_NONE ;?>
+            <option value="category" size="10"><?php echo EASY_LABEL_CATEGORY ;?>
+            <option value="product" size="10"><?php echo EASY_LABEL_PRODUCT ;?>
+            <option value="manufacture" size="10"><?php echo EASY_LABEL_MANUFACTURE ;?>
+      </select>
+       </td>
+      </tr>
+      <tr>
+       <td>
+
+<b><?php echo EASY_LABEL_EP_LIMIT. '</b>';
+  echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_limit_rows') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+?>
+       </td>
+      </tr>
+      <tr>
+       <td>
+<b><?php echo '&nbsp;&nbsp;' . EASY_LABEL_LIMIT_CAT. '</b>';
+  echo '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_limit_cats') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+        echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';?></b>
+           <?php
+                $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id, c.sort_order from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name");
+                $category = tep_db_fetch_array($categories_query);
+                $current_category_id = '0';
+          echo  tep_draw_pull_down_menu('limit_cat', tep_get_category_tree(), $current_category_id);
+
+    ?>
+                </td>
+      </tr>
+      <tr>
+       <td>
+<b><?php echo '&nbsp;&nbsp;' . EASY_LABEL_LIMIT_MAN  . '</b>';
+   echo '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_limit_man') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+         echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';?></b>
+          <?php
+          $manufacturers_array = array();
+          $manufacturers_array[] = array('id' => '0', 'text' => PULL_DOWN_MANUFACTURES);
+
+          $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+        while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
+                                     'text' => $manufacturers['manufacturers_name']);
+              }
+
+         echo tep_draw_pull_down_menu('limit_man', $manufacturers_array, $localfile);
+    ?>
+      </td>
+          </tr>
+          <tr>
+       <td>
+         <?php // below are the queries to do the counts;
+         ?>
+<b><?php echo  '&nbsp;&nbsp;' . EASY_LABEL_PRODUCT_RANGE  . '</b>';
+   echo '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_limit_product') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+         echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';?></b> 
+          <?php echo EASY_LABEL_PRODUCT_BEGIN;?><INPUT TYPE="text" name="rangebegin" size="12">
+          <?php echo EASY_LABEL_PRODUCT_END;?><INPUT TYPE="text" name="rangeend" size="12">
+       
+        
+        <?php // below are the queries to do the counts
+                   $totalrows = tep_db_query("SELECT COUNT(*) FROM " . TABLE_PRODUCTS . "");
+                   $first_query = tep_db_query("SELECT products_id FROM " . TABLE_PRODUCTS . "  ORDER BY products_id ASC LIMIT 1");
+                     while ($firstid = tep_db_fetch_array($first_query)){
+                     $firstid1 =  $firstid['products_id'];
+                     }
+                    $first_query2 = tep_db_query("SELECT products_id FROM " . TABLE_PRODUCTS . "  ORDER BY products_id DESC LIMIT 1");
+                     while ($firstid2 = tep_db_fetch_array($first_query2)){
+                     $firstid2a =  $firstid2['products_id'];
+                     }
+                     $first_query3 = tep_db_query("SELECT products_id FROM " . TABLE_PRODUCTS . " ");
+                     while ($firstid3 = tep_db_fetch_array($first_query3)){
+                     $total3 = $total3 + 1 ;
+                     }
+             ?>
+                   </td>
+      </tr>
+      <tr>
+       <td>
+             
+      <?php echo EASY_LABEL_PRODUCT_AVAIL . $firstid1 . EASY_LABEL_PRODUCT_TO . $firstid2a . EASY_LABEL_PRODUCT_RECORDS . $total3;?><br>
+                <?php echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_start_file_creation.gif', EASY_LABEL_PRODUCT_START); ?>
+        </form>
+        </td>
+                 </tr>
+                 <tr>
+                 <td>
+<?php
+//  End TIMER
+//  ---------
+$etimer = explode( ' ', microtime() );
+$etimer = $etimer[1] + $etimer[0];
+echo '<p style="margin:auto; text-align:center">';
+printf( TEXT_INFO_TIMER . " <b>%f</b> "  . TEXT_INFO_SECOND, ($etimer-$stimer) );
+echo '</p>';
+//  ---------
+ ?>                
+               
+                 </td>
+                 </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+
+<?php
+
+require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/easypopulate_import.php
===================================================================
--- trunk/direct.openmoko.com/admin/easypopulate_import.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/easypopulate_import.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1330 @@
+<?php
+/*
+  $Id: easypopulate_import.php,v 3.01 2005/09/05  zip1 Exp $
+  
+    Released under the GNU General Public License
+*/
+
+//*******************************
+// S T A R T
+// INITIALIZATION
+//*******************************
+$curver = '3.01 Advance';
+
+require('epconfigure.php');
+include (DIR_WS_LANGUAGES . $language . '/easypopulate.php');
+include ('includes/functions/easypopulate_functions.php');
+
+
+//  Start TIMER
+//  -----------
+$stimer = explode( ' ', microtime() );
+$stimer = $stimer[1] + $stimer[0];
+//  -----------
+
+//*******************************
+global $msg_output, $msg_epa, $msg_error;
+// VJ product attributes begin
+global $attribute_options_array;
+
+//elari check default language_id from configuration table DEFAULT_LANGUAGE
+$epdlanguage_query = tep_db_query("select languages_id, name, code from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . "'");
+if (tep_db_num_rows($epdlanguage_query)) {
+  $epdlanguage = tep_db_fetch_array($epdlanguage_query);
+  $epdlanguage_id   = $epdlanguage['languages_id'];
+  $epdlanguage_name = $epdlanguage['name'];
+  $epdlanguage_code = $epdlanguage['code'];
+} else {
+  $msg_error = EASY_ERROR_1;
+}
+
+$langcode = ep_get_languages();
+
+//if ($dltype != ''){
+   // if dltype is set, then create the filelayout.  Otherwise it gets read from the uploaded file
+//    ep_create_filelayout($dltype); // get the right filelayout for this download
+//}
+
+
+//*******************************
+//*******************************
+// E N D
+// INITIALIZATION
+//*******************************
+//*******************************
+ $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+ $split = (isset($HTTP_GET_VARS['split']) ? $HTTP_GET_VARS['split'] : '');
+ 
+if (tep_not_null($action)) {
+  if ( (($action == 'upload') || ($action == 'local')) && ($split == 0) ) { 
+
+//if ($localfile or (is_uploaded_file($usrfl) && $split==0)) {
+  //*******************************
+  // UPLOAD AND INSERT FILE
+  //*******************************
+//  check files name for EPA
+    if ( (strstr($localfile, 'EPA')) or ( (strstr($usrfl_name, 'EPA')) && $split==0) )  {
+     }else{
+          $msg_error =  EASY_ERROR_6 .  '<a href="' . tep_href_link(FILENAME_EASYPOPULATE) . '">' . EASY_ERROR_6a . '</a><br>';
+//   die();
+      }
+
+  if ($action == 'upload'){
+          // $HTTP_POST_VARS['usrfl']
+        //  $usrfl=$HTTP_POST_VARS['usrfl'];
+    // move the file to where we can work with it
+    $file = tep_get_uploaded_file('usrfl');
+    if (is_uploaded_file($file['tmp_name'])) {
+      tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir);
+    }
+      $msg_epa =  EASY_UPLOAD_FILE . '<br>' . EASY_UPLOAD_TEMP . $usrfl . '<br>' . EASY_UPLOAD_USER_FILE . $usrfl_name . '<br>' .  EASY_SIZE . $usrfl_size . '<br>';
+    // get the entire file into an array
+    $readed = file(DIR_FS_DOCUMENT_ROOT . $tempdir . $usrfl_name);
+         }
+
+  
+  if ($action == 'local'){
+    // move the file to where we can work with it
+    $file = tep_get_uploaded_file('usrfl'); 
+            $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " order by products_options_id";
+      $attribute_options_values = tep_db_query($attribute_options_query);
+      $attribute_options_count = 1;
+      //while ($attribute_options = tep_db_fetch_array($attribute_options_values)){
+    if (is_uploaded_file($file['tmp_name'])) {
+      tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir);
+      }
+          $msg_epa = EASY_LABEL_FILE_INSERT_LOCAL .  EASY_FILENAME . $localfile . '<br>';
+    // get the entire file into an array
+    $readed = file(DIR_FS_DOCUMENT_ROOT . $tempdir . $localfile);
+         }
+  // now we string the entire thing together in case there were carriage returns in the data
+  $newreaded = "";
+  foreach ($readed as $read){
+    $newreaded .= $read;
+  }
+
+  // now newreaded has the entire file together without the carriage returns.
+  // if for some reason excel put qoutes around our EOREOR, remove them then split into rows
+  $newreaded = str_replace('"EOREOR"', 'EOREOR', $newreaded);
+  $readed = explode( $separator . 'EOREOR',$newreaded);
+
+
+  // Now we'll populate the filelayout based on the header row.
+  $theheaders_array = explode( $separator, $readed[0] ); // explode the first row, it will be our filelayout
+  $lll = 0;
+  $filelayout = array();
+  foreach( $theheaders_array as $header ){
+    $cleanheader = str_replace( '"', '', $header);
+  //  echo "Fileheader was $header<br><br><br>";
+    $filelayout[ $cleanheader ] = $lll++; //
+  }
+  unset($readed[0]); //  we don't want to process the headers with the data
+
+  // now we've got the array broken into parts by the expicit end-of-row marker.
+
+array_walk($readed, 'walk');
+//foreach ($readed as $readed_record) {
+//walk($readed_record);
+//}
+
+}
+
+//if is_uploaded_file($usrfl){
+if ( (is_uploaded_file($usrfl)) && ($action == 'upload') && ($split == 1)) { 
+
+  //*******************************
+  //*******************************
+  // UPLOAD AND SPLIT FILE
+  //*******************************
+  //*******************************
+//  check files name for EPA
+
+      if (strstr($usrfl_name, 'EPA')){
+     }else{
+          $msg_error = EASY_ERROR_6 .  '<a href="' . tep_href_link(FILENAME_EASYPOPULATE) . '">' . EASY_ERROR_6a . '</a><br>';
+  // die();
+      }
+  // move the file to where we can work with it
+  $file = tep_get_uploaded_file('usrfl');
+  //echo "Trying to move file...";
+  if (is_uploaded_file($file['tmp_name'])) {
+    tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir);
+  }
+
+  $infp = fopen(DIR_FS_DOCUMENT_ROOT . $tempdir . $usrfl_name, "r");
+
+  //toprow has the field headers
+  $toprow = fgets($infp,32768);
+
+  $filecount = 1;
+  #$EXPORT_TIME=time();
+  $EXPORT_TIME = strftime('%Y%b%d-%H%I');
+
+  $msg_epa = EASY_LABEL_FILE_COUNT_1A . $filecount . EASY_LABEL_FILE_COUNT_2;
+  $tmpfname1 = HTTP_SERVER . DIR_WS_CATALOG . $tempdir . "EPA_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+  $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EPA_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+  $fp = fopen( $tmpfname, "w+");
+  fwrite($fp, $toprow);
+
+  $linecount = 0;
+  $line = fgets($infp,32768);
+  while ($line){
+    // walking the entire file one row at a time
+    // but a line is not necessarily a complete row, we need to split on rows that have "EOREOR" at the end
+    $line = str_replace('"EOREOR"', 'EOREOR', $line);
+    fwrite($fp, $line);
+    if (strpos($line, 'EOREOR')){
+      // we found the end of a line of data, store it
+      $linecount++; // increment our line counter
+      if ($linecount >= $maxrecs){
+        $msg_epa = EASY_LABEL_LINE_COUNT_1 . $linecount . EASY_LABEL_LINE_COUNT_2 . '<Br>';
+        $linecount = 0; // reset our line counter
+        // close the existing file and open another;
+        fclose($fp);
+        // increment filecount
+        $filecount++;
+         $tmpfname1 = HTTP_SERVER . DIR_WS_CATALOG . $tempdir . "EPA_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+               $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EPA_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+        //Open next file name
+        $fp = fopen( $tmpfname, "w+");
+        fwrite($fp, $toprow);
+      }
+    }
+    $line=fgets($infp,32768);
+  }
+  $msg_epa = EASY_LABEL_FILE_CLOSE_1 . $linecount . EASY_LABEL_FILE_CLOSE_2 . '<br>';
+  fclose($fp);
+  fclose($infp);
+  $msg_epa = EASY_SPLIT_DOWN . $tmpfname1;
+  }
+  
+//if is_uploaded_file($usrfl){
+if ( ($action == 'local') && ($split == 1)) { 
+
+  //*******************************
+  //*******************************
+  // server file splitSPLIT FILE
+  //*******************************
+  //*******************************
+//  check files name for EPA
+      if (strstr($localfile1, 'EPA')){   
+     }else{
+                $msg_error = EASY_ERROR_6 .  '<a href="' . tep_href_link(FILENAME_EASYPOPULATE) . '">' . EASY_ERROR_6a . '</a><br>';
+      // die();
+
+      }
+    $file = tep_get_uploaded_file('localfile1');  
+
+    if (is_uploaded_file($file['tmp_name'])) {
+      tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir);
+      }
+
+  $infp = fopen(DIR_FS_DOCUMENT_ROOT . $tempdir . $file['tmp_name'], "r");
+
+  //toprow has the field headers
+  $toprow = fgets($infp,32768);
+
+  $filecount = 1;
+  #$EXPORT_TIME=time();
+  $EXPORT_TIME = strftime('%Y%b%d-%H%I');
+
+  $msg_epa = EASY_LABEL_FILE_COUNT_1A . $filecount . EASY_LABEL_FILE_COUNT_2;
+  $tmpfname1 = HTTP_SERVER . DIR_WS_CATALOG . $tempdir . "EPA_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+  $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EPA_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+  $fp = fopen( $tmpfname, "w+");
+  fwrite($fp, $toprow);
+
+  $linecount = 0;
+  $line = fgets($infp,32768);
+  while ($line){
+    // walking the entire file one row at a time
+    // but a line is not necessarily a complete row, we need to split on rows that have "EOREOR" at the end
+    $line = str_replace('"EOREOR"', 'EOREOR', $line);
+    fwrite($fp, $line);
+    if (strpos($line, 'EOREOR')){
+      // we found the end of a line of data, store it
+      $linecount++; // increment our line counter
+      if ($linecount >= $maxrecs){
+        $msg_epa = EASY_LABEL_LINE_COUNT_1 . $linecount . EASY_LABEL_LINE_COUNT_2 . '<Br>';
+        $linecount = 0; // reset our line counter
+        // close the existing file and open another;
+        fclose($fp);
+        // increment filecount
+        $filecount++;
+         $tmpfname1 = HTTP_SERVER . DIR_WS_CATALOG . $tempdir . "EPA_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+               $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "EPA_Split" . $filecount . '_' . $EXPORT_TIME . ".txt";
+        //Open next file name
+        $fp = fopen( $tmpfname, "w+");
+        fwrite($fp, $toprow);
+      }
+    }
+    $line=fgets($infp,32768);
+  }
+  $msg_epa = EASY_LABEL_FILE_CLOSE_1 . $linecount . EASY_LABEL_FILE_CLOSE_2 . '<br>';
+  fclose($fp);
+  fclose($infp);
+  $msg_epa = EASY_SPLIT_DOWN . $tmpfname1;
+  }
+}
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+<tr>
+<td width="<?php echo BOX_WIDTH; ?>" valign="top" height="27">
+<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<?php require(DIR_WS_INCLUDES . 'column_left.php');?>
+</table></td>
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo EASY_VERSION_A . EASY_VER_A . EASY_IMPORT; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+
+<?php
+if ($mesID == MSG1){
+       echo '<tr class="epa_msg"><td>' . EASY_FILE_LOCATE . $tempdir .  $name . ".txt" . '</td></tr>';
+       
+}
+
+if ($mesID == MSG2){
+       echo '<tr><td>' . EASY_FILE_LOCATE2 .  $name . ".txt" . '</td></tr>';
+}
+?>
+               </tr>
+        <tr>
+                <td>
+ <?php echo tep_draw_form('localfile_insert', 'easypopulate_import.php', 'action=upload&split=0', 'post', 'ENCTYPE="multipart/form-data"'); ?>
+             
+ <?php ECHO '<b>' . EASY_UPLOAD_EP_FILE . '</b>';
+       ECHO '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_upload') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+ ?>
+                  </td>
+                  </tr>
+                  <tr>
+                    <td>
+                  <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000000">
+     <?php echo  tep_draw_file_field('usrfl', '50') ;?>
+     <?php echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_insert_into_db.gif', TEXT_INSERT_INTO_DB); ?>
+              </form>
+          </td>
+          </tr>
+          <tr >
+          <td>
+<?php echo tep_draw_form('localfile_insert', 'easypopulate_import.php', '&action=upload&split=1', 'post', 'ENCTYPE="multipart/form-data"'); ?>
+                <b> <?php echo EASY_SPLIT_EP_FILE . '</b>' ;
+      echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_upload_split') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+?>       
+             </td>
+           </tr>
+           <tr>
+           <td>
+                 <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000000">
+             <?php echo  tep_draw_file_field('usrfl', '50') ;?>
+       <?php echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_split_file.gif', TEXT_SPLIT); ?>
+             </form>
+
+          </td>
+          </tr>
+          <tr>
+          <td>
+                        <b> <?php echo EASY_SPLIT_EP_LOCAL . '</b>' ;  
+         echo tep_draw_form('localfile_split', 'easypopulate_import.php', '&action=local&split=1', 'post', 'ENCTYPE="multipart/form-data"'); 
+      echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_split') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+     ?> 
+           </td>
+           </tr>
+           <tr>
+             <td>
+    <?php
+        $dir = dir(DIR_FS_CATALOG . $tempdir);
+        $contents1 = array(array('id' => '', 'text' => TEXT_SELECT_TWO));
+        while ($file1 = $dir->read()) {
+          if ( ($file1 != '.') && ($file1 != 'CVS') && ($file1 != '..') && ($file1 != '.htaccess') && !(strstr($file1, 'EPB')) && !(strstr($file1, 'EPA_Split')) ) {
+            $contents1[] = array('id' => $file1, 'text' => $file1);
+          }
+        }
+        echo tep_draw_pull_down_menu('localfile1', $contents1, $localfile1);
+echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_split_file.gif', TEXT_SPLIT); ?>
+
+           </form>
+                </td>
+               </tr>          
+          <tr>
+          <td>
+        <?php echo tep_draw_form('localfile_insert', 'easypopulate_import.php', '&action=local&split=0', 'post', 'ENCTYPE="multipart/form-data"'); ?>
+   
+      <b><?php echo sprintf(TEXT_IMPORT_TEMP, $tempdir) . '</b>';
+      echo '' .  '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_EP_HELP,'action=ep_file_insert') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+     ?> 
+           </td>
+           </tr>
+           <tr>
+             <td>
+    <?php
+        $dir = dir(DIR_FS_CATALOG . $tempdir);
+        $contents = array(array('id' => '', 'text' => TEXT_SELECT_ONE));
+        while ($file = $dir->read()) {
+          if ( ($file != '.') && ($file != 'CVS') && ($file != '..') && !(strstr($file, 'EPB')) && ($file != '.htaccess')) {
+            //$file_size = filesize(DIR_FS_CATALOG . $tempdir . $file);
+
+            $contents[] = array('id' => $file, 'text' => $file);
+          }
+        }
+        echo tep_draw_pull_down_menu('localfile', $contents, $localfile);
+echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_insert_into_db.gif', TEXT_INSERT_INTO_DB); ?>
+
+           </form>
+                </td>
+               </tr>
+                <tr>
+<?php // echo error
+ if ($msg_error != ''){
+    echo  '<td><p class="smallText"><font color=\'red\'>' . $msg_error . '</font></p></td></tr>';
+ }    
+ ?>  
+ 
+ <?php // echo epa message
+  if ($msg_epa != ''){
+     echo  '<td><p class="smallText">' . $msg_epa . '</p></td></tr>';
+ }    ?>  
+ 
+ <?php // echo line by line results
+  if ($msg_output != ''){
+     echo  '<td><p class="smallText">' . $msg_output . '</p></td></tr>';
+ }    ?>  
+      <td>
+      </td>
+     </tr>
+     <tr>
+      <td>
+<?php
+ //  End TIMER
+  //  ---------
+   $etimer = explode( ' ', microtime() );
+   $etimer = $etimer[1] + $etimer[0];
+echo '<p style="margin:auto; text-align:center">';
+printf( TEXT_INFO_TIMER . " <b>%f</b> "  . TEXT_INFO_SECOND, ($etimer-$stimer) );
+echo '</p>';
+//  ---------
+?>                
+  </td></tr>
+      </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+
+function walk( $item1 ) {
+  global $GLOBALS, $filelayout, $filelayout_count, $modelsize;
+  global $active, $inactive, $langcode, $default_these, $deleteit, $zero_qty_inactive;
+        global $epdlanguage_id, $replace_quotes, $v_products_id1;
+  global $default_images, $default_image_manufacturer, $default_image_product, $default_image_category;
+  global $separator, $max_categories, $msg_error, $msg_epa, $msg_output ;
+  // first we clean up the row of data
+
+  // chop blanks from each end
+  $item1 = ltrim(rtrim($item1));
+
+  // blow it into an array, splitting on the tabs
+  $items = explode($separator, $item1);
+
+  // make sure all non-set things are set to '';
+  // and strip the quotes from the start and end of the stings.
+  // escape any special chars for the database.
+  foreach( $filelayout as $key=> $value){
+    $i = $filelayout[$key];
+    if (isset($items[$i]) == false) {
+      $items[$i]='';
+    } else {
+      // Check to see if either of the magic_quotes are turned on or off;
+      // And apply filtering accordingly.
+      if (function_exists('ini_get')) {
+        //echo "Getting ready to check magic quotes<br>";
+        if (ini_get('magic_quotes_runtime') == 1){
+          // The magic_quotes_runtime are on, so lets account for them
+          // check if the last character is a quote;
+          // if it is, chop off the quotes.
+          if (substr($items[$i],-1) == '"'){
+            $items[$i] = substr($items[$i],2,strlen($items[$i])-4);
+          }
+          // now any remaining doubled double quotes should be converted to one doublequote
+          $items[$i] = str_replace('\"\"',"\"",$items[$i]);
+        } else { // no magic_quotes are on
+          // check if the last character is a quote;
+          // if it is, chop off the 1st and last character of the string.
+          if (substr($items[$i],-1) == '"'){
+            $items[$i] = substr($items[$i],1,strlen($items[$i])-2);
+          }
+          // now any remaining doubled double quotes should be converted to one doublequote
+          $items[$i] = str_replace('""',"\"",$items[$i]);
+          if ($replace_quotes){
+            $items[$i] = str_replace('"',"\"",$items[$i]);
+            $items[$i] = str_replace("'","\'",$items[$i]);
+          }
+        }
+      }
+    }
+  }
+
+  // now do a query to get the record's current contents
+
+  $sql = "SELECT
+    p.products_id as v_products_id,
+    p.products_model as v_products_model,
+    p.products_image as v_products_image,
+    p.products_image_med as v_products_image_med,
+    p.products_image_lrg as v_products_image_lrg,
+    p.products_image_sm_1 as v_products_image_sm_1,
+    p.products_image_xl_1 as v_products_image_xl_1,
+    p.products_image_sm_2 as v_products_image_sm_2,
+    p.products_image_xl_2 as v_products_image_xl_2,
+    p.products_image_sm_3 as v_products_image_sm_3,
+    p.products_image_xl_3 as v_products_image_xl_3,
+    p.products_image_sm_4 as v_products_image_sm_4,
+    p.products_image_xl_4 as v_products_image_xl_4,
+    p.products_image_sm_5 as v_products_image_sm_5,
+    p.products_image_xl_5 as v_products_image_xl_5,
+    p.products_image_sm_6 as v_products_image_sm_6,
+    p.products_image_xl_6 as v_products_image_xl_6,
+    p.products_price as v_products_price,
+    p.products_weight as v_products_weight,
+                p.products_date_available as v_date_avail,
+                p.products_date_added as v_date_added,
+                p.products_tax_class_id as v_tax_class_id,
+    p.products_quantity as v_products_quantity,
+    p.manufacturers_id as v_manufacturers_id,
+    subc.categories_id as v_categories_id
+    FROM
+    ".TABLE_PRODUCTS." as p,
+    ".TABLE_CATEGORIES." as subc,
+    ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc
+    WHERE
+    p.products_id = '" . $items[$filelayout['v_products_id']] . "' AND
+    p.products_id = ptoc.products_id AND
+    ptoc.categories_id = subc.categories_id
+    ";
+
+  $result = tep_db_query($sql);
+  $row =  tep_db_fetch_array($result);
+
+
+  while ($row){
+    // OK, since we got a row, the item already exists.
+    // Let's get all the data we need and fill in all the fields that need to be defaulted to the current values
+    // for each language, get the description and set the vals
+    foreach ($langcode as $key => $lang){
+      $sql2 = "SELECT *
+        FROM ".TABLE_PRODUCTS_DESCRIPTION."
+        WHERE
+          products_id = " . $row['v_products_id'] . " AND
+          language_id = '" . $lang['id'] . "'
+        ";
+      $result2 = tep_db_query($sql2);
+      $row2 =  tep_db_fetch_array($result2);
+                        // Need to report from ......_name_1 not ..._name_0
+      $row['v_products_name_' . $lang['id']]    = $row2['products_name'];
+      $row['v_products_description_' . $lang['id']]   = $row2['products_description'];
+      $row['v_products_url_' . $lang['id']]     = $row2['products_url'];
+
+      // support for  Header Controller 2.1 here
+      if(isset($filelayout['v_products_head_title_tag_' . $lang['id'] ])){
+        $row['v_products_head_title_tag_' . $lang['id']]  = $row2['products_head_title_tag'];
+        $row['v_products_head_desc_tag_' . $lang['id']]   = $row2['products_head_desc_tag'];
+        $row['v_products_head_keywords_tag_' . $lang['id']]   = $row2['products_head_keywords_tag'];
+      }
+      // end support for Header Controller 2.0
+    }
+
+    // start with v_categories_id
+    // Get the category description
+    // set the appropriate variable name
+    // if parent_id is not null, then follow it up.
+    $thecategory_id = $row['v_categories_id'];
+
+    for( $categorylevel=1; $categorylevel<$max_categories+1; $categorylevel++){
+      if ($thecategory_id){
+        $sql2 = "SELECT categories_name
+          FROM ".TABLE_CATEGORIES_DESCRIPTION."
+          WHERE
+            categories_id = " . $thecategory_id . " AND
+            language_id = " . $epdlanguage_id ;
+
+        $result2 = tep_db_query($sql2);
+        $row2 =  tep_db_fetch_array($result2);
+        // only set it if we found something
+        $temprow['v_categories_name_' . $categorylevel] = $row2['categories_name'];
+        // now get the parent ID if there was one
+        $sql3 = "SELECT parent_id
+          FROM ".TABLE_CATEGORIES."
+          WHERE
+            categories_id = " . $thecategory_id;
+        $result3 = tep_db_query($sql3);
+        $row3 =  tep_db_fetch_array($result3);
+        $theparent_id = $row3['parent_id'];
+        if ($theparent_id != ''){
+          // there was a parent ID, lets set thecategoryid to get the next level
+          $thecategory_id = $theparent_id;
+        } else {
+          // we have found the top level category for this item,
+          $thecategory_id = false;
+        }
+      } else {
+          $temprow['v_categories_name_' . $categorylevel] = '';
+      }
+    }
+    // temprow has the old style low to high level categories.
+    $newlevel = 1;
+    // let's turn them into high to low level categories
+    for( $categorylevel=$max_categories+1; $categorylevel>0; $categorylevel--){
+      if ($temprow['v_categories_name_' . $categorylevel] != ''){
+        $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel];
+      }
+    }
+
+    if ($row['v_manufacturers_id'] != ''){
+      $sql2 = "SELECT manufacturers_name
+        FROM ".TABLE_MANUFACTURERS."
+        WHERE
+        manufacturers_id = " . $row['v_manufacturers_id']
+        ;
+      $result2 = tep_db_query($sql2);
+      $row2 =  tep_db_fetch_array($result2);
+      $row['v_manufacturers_name'] = $row2['manufacturers_name'];
+    }
+
+    //elari -
+    //We check the value of tax class and title instead of the id
+    //Then we add the tax to price if $price_with_tax is set to true
+    $row_tax_multiplier = tep_get_tax_class_rate($row['v_tax_class_id']);
+    $row['v_tax_class_title'] = tep_get_tax_class_title($row['v_tax_class_id']);
+    if ($price_with_tax == 'true'){
+      $row['v_products_price'] = $row['v_products_price'] + round($row['v_products_price']* $row_tax_multiplier / 100,2);
+    }
+
+    // now create the internal variables that will be used
+    // the $$thisvar is on purpose: it creates a variable named what ever was in $thisvar and sets the value
+    foreach ($default_these as $thisvar){
+      $$thisvar = $row[$thisvar];
+    }
+
+    $row =  tep_db_fetch_array($result);
+  }
+// Begin writting new data to current data
+
+  // this is an important loop.  What it does is go thru all the fields in the incoming file and set the internal vars.
+  // Internal vars not set here are either set in the loop above for existing records, or not set at all (null values)
+  // the array values are handled separatly, although they will set variables in this loop, we won't use them.
+  foreach( $filelayout as $key => $value ){
+    $$key = $items[ $value ];
+  }
+
+        // so how to handle these?  we shouldn't built the array unless it's been giving to us.
+  // The assumption is that if you give us names and descriptions, then you give us name and description for all applicable languages
+  foreach ($langcode as $lang){
+    //echo "Langid is " . $lang['id'] . "<br>";
+    $l_id = $lang['id'];
+    if (isset($filelayout['v_products_name_' . $l_id ])){
+      //we set dynamically the language values
+      $v_products_name[$l_id]   = tep_db_encoder($items[$filelayout['v_products_name_' . $l_id]]);
+      $v_products_description[$l_id]  = tep_db_encoder($items[$filelayout['v_products_description_' . $l_id ]]);
+      $v_products_url[$l_id]    = $items[$filelayout['v_products_url_' . $l_id ]];
+      $v_products_head_title_tag[$l_id]   = $items[$filelayout['v_products_head_title_tag_' . $l_id]];
+      $v_products_head_desc_tag[$l_id]  = $items[$filelayout['v_products_head_desc_tag_' . $l_id]];
+      $v_products_head_keywords_tag[$l_id]  = $items[$filelayout['v_products_head_keywords_tag_' . $l_id]];
+
+    }
+  }
+  //elari... we get the tax_clas_id from the tax_title
+  //on screen will still be displayed the tax_class_title instead of the id....
+  if ( isset( $v_tax_class_title) ){
+    $v_tax_class_id          = tep_get_tax_title_class_id($v_tax_class_title);
+  }
+  //we check the tax rate of this tax_class_id
+        $row_tax_multiplier = tep_get_tax_class_rate($v_tax_class_id);
+
+  //And we recalculate price without the included tax...
+  //Since it seems display is made before, the displayed price will still include tax
+  //This is same problem for the tax_clas_id that display tax_class_title
+  if ($price_with_tax){
+    $v_products_price        = round( $v_products_price / (1 + ( $row_tax_multiplier * $price_with_tax/100) ), 2);
+  }
+
+  // if they give us one category, they give us all 6 categories
+  unset ($v_categories_name); // default to not set.
+  if ( isset( $filelayout['v_categories_name_1'] ) ){
+    $newlevel = 1;
+    for( $categorylevel=6; $categorylevel>0; $categorylevel--){
+      if ( $items[$filelayout['v_categories_name_' . $categorylevel]] != ''){
+        $v_categories_name[$newlevel++] = $items[$filelayout['v_categories_name_' . $categorylevel]];
+      }
+    }
+    while( $newlevel < $max_categories+1){
+      $v_categories_name[$newlevel++] = ''; // default the remaining items to nothing
+    }
+  }
+
+  if (ltrim(rtrim($v_products_quantity)) == '') {
+    $v_products_quantity = 1;
+  }
+  if ($v_date_avail == '') {
+    $v_date_avail = "CURRENT_TIMESTAMP";
+  } else {
+    // we put the quotes around it here because we can't put them into the query, because sometimes
+    //   we will use the "current_timestamp", which can't have quotes around it.
+    // Excel may change the format of the date, so we need to reformat it for mysql processing
+    $temp_ts = strtotime( $v_date_avail );
+    $v_date_avail = date( 'Y-m-d G:i:s', $temp_ts );
+    $v_date_avail = '"' . $v_date_avail . '"';
+  }
+
+  if ($v_date_added == '') {
+    $v_date_added = "CURRENT_TIMESTAMP";
+  } else {
+    // we put the quotes around it here because we can't put them into the query, because sometimes
+    //   we will use the "current_timestamp", which can't have quotes around it.
+    // Excel may change the format of the date, so we need to reformat it for mysql processing
+    $temp_ts = strtotime( $v_date_added );
+    $v_date_added = date( 'Y-m-d G:i:s', $temp_ts );
+    $v_date_added = '"' . $v_date_added . '"';
+  }
+
+
+  // default the stock if they spec'd it or if it's blank
+  $v_db_status = '1'; // default to active
+  if ($v_status == $inactive){
+    // they told us to deactivate this item
+    $v_db_status = '0';
+  }
+  if ($zero_qty_inactive && $v_products_quantity == 0) {
+    // if they said that zero qty products should be deactivated, let's deactivate if the qty is zero
+    $v_db_status = '0';
+  }
+
+  if ($v_manufacturer_id==''){
+    $v_manufacturer_id="NULL";
+  }
+
+  if (trim($v_products_image)==''){
+    $v_products_image = $default_image_product;
+  }
+
+  if (strlen($v_products_model) > $modelsize ){
+    $msg_error = "<font color='red'>" . strlen($v_products_model) . $v_products_model . EASY_ERROR_2 . $modelsize . '</font>';
+    die();
+  }
+  
+// Section:convert_id's to names
+
+  // OK, we need to convert the manufacturer's name into id's for the database
+  if ( isset($v_manufacturers_name) && $v_manufacturers_name != '' ){
+    $sql = "SELECT man.manufacturers_id
+      FROM ".TABLE_MANUFACTURERS." as man
+      WHERE
+        man.manufacturers_name = '" . $v_manufacturers_name . "'";
+    $result = tep_db_query($sql);
+    $row =  tep_db_fetch_array($result);
+    if ( $row != '' ){
+      foreach( $row as $item ){
+        $v_manufacturer_id = $item;
+      }
+    } else {
+      // to add, we need to put stuff in categories and categories_description
+      $sql = "SELECT MAX( manufacturers_id) max FROM ".TABLE_MANUFACTURERS;
+      $result = tep_db_query($sql);
+      $row =  tep_db_fetch_array($result);
+      $max_mfg_id = $row['max']+1;
+      // default the id if there are no manufacturers yet
+      if (!is_numeric($max_mfg_id) ){
+        $max_mfg_id=1;
+      }
+
+        $sql = "INSERT INTO ".TABLE_MANUFACTURERS."(
+        manufacturers_id,
+        manufacturers_name,
+        manufacturers_image,
+        date_added,
+        last_modified
+        ) VALUES (
+        $max_mfg_id,
+        '$v_manufacturers_name',
+        '$default_image_manufacturer',
+        CURRENT_TIMESTAMP,
+        CURRENT_TIMESTAMP
+        )";
+      $result = tep_db_query($sql);
+      $v_manufacturer_id = $max_mfg_id;
+    }
+  }
+  // if the categories names are set then try to update them
+  if ( isset($v_categories_name_1)){
+    // start from the highest possible category and work our way down from the parent
+    $v_categories_id = 0;
+    $theparent_id = 0;
+    for ( $categorylevel=$max_categories+1; $categorylevel>0; $categorylevel-- ){
+      $thiscategoryname = $v_categories_name[$categorylevel];
+      if ( $thiscategoryname != ''){
+        // we found a category name in this field
+
+        // now the subcategory
+        $sql = "SELECT cat.categories_id
+          FROM ".TABLE_CATEGORIES." as cat,
+               ".TABLE_CATEGORIES_DESCRIPTION." as des
+          WHERE
+            cat.categories_id = des.categories_id AND
+            des.language_id = $epdlanguage_id AND
+            cat.parent_id = " . $theparent_id . " AND
+            des.categories_name = '" . $thiscategoryname . "'";
+        $result = tep_db_query($sql);
+        $row =  tep_db_fetch_array($result);
+        if ( $row != '' ){
+          foreach( $row as $item ){
+            $thiscategoryid = $item;
+          }
+        } else {
+          // to add, we need to put stuff in categories and categories_description
+          $sql = "SELECT MAX( categories_id) max FROM ".TABLE_CATEGORIES;
+          $result = tep_db_query($sql);
+          $row =  tep_db_fetch_array($result);
+          $max_category_id = $row['max']+1;
+          if (!is_numeric($max_category_id) ){
+            $max_category_id=1;
+          }
+          $sql = "INSERT INTO ".TABLE_CATEGORIES."(
+            categories_id,
+            categories_image,
+            parent_id,
+            sort_order,
+            date_added,
+            last_modified
+            ) VALUES (
+            $max_category_id,
+            '$default_image_category',
+            $theparent_id,
+            0,
+             CURRENT_TIMESTAMP
+            ,CURRENT_TIMESTAMP
+            )";
+          $result = tep_db_query($sql);
+          $sql = "INSERT INTO ".TABLE_CATEGORIES_DESCRIPTION."(
+              categories_id,
+              language_id,
+              categories_name
+            ) VALUES (
+              $max_category_id,
+              '$epdlanguage_id',
+              '$thiscategoryname'
+            )";
+          $result = tep_db_query($sql);
+          $thiscategoryid = $max_category_id;
+        }
+        // the current catid is the next level's parent
+        $theparent_id = $thiscategoryid;
+        $v_categories_id = $thiscategoryid; // keep setting this, we need the lowest level category ID later
+      }
+    }
+  }
+
+//Section:Delete record
+  if ( $v_action == $deleteit ){
+    // they want to delete this product.
+$msg_output .= EASY_LABEL_DELETE_STATUS_1 . $v_products_id . EASY_LABEL_DELETE_STATUS_2 . '<br>';
+    // Get the ID
+        $delete_id = $v_products_id;
+ // get category ID       
+    // kill in the products_to_categories
+tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id ='" .  $delete_id . "'");
+tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id ='" .  $delete_id . "'");
+tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id ='" .  $delete_id . "' and categories_id = '" . $v_categories_id . "' ");
+
+  $prod_attrib_query = tep_db_query("select products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id ='" .  $delete_id . "'");
+ while ($prod_attrib1 = tep_db_fetch_array($prod_attrib_query)) {
+tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id  ='" .  $prod_attrib1[products_attributes_id]  . "'");
+}
+
+tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id ='" .  $delete_id . "'");
+
+    // Kill in the products table
+
+    return; // we're done deleteing!
+
+
+  } else if ($v_products_id != "") {
+    //   products_id exists!
+    array_walk($items, 'print_el');
+    
+//Begin to insert data
+
+// Section:Product_check   First we check to see if this is a product in the current db.
+
+  $result = tep_db_query("SELECT products_id FROM ".TABLE_PRODUCTS." WHERE (products_id = '". $v_products_id . "')");
+
+    if (tep_db_num_rows($result) == 0)  {
+      //   insert into products
+
+      $sql = "SHOW TABLE STATUS LIKE '".TABLE_PRODUCTS."'";
+      $result = tep_db_query($sql);
+      $row =  tep_db_fetch_array($result);
+      $max_product_id = $row['Auto_increment'];
+                        
+                        
+                    //check for insert new product
+                    if ($v_products_id == '0'){
+                  $v_products_id=$max_product_id;
+                            } else {
+                             $v_products_id=$v_products_id;
+                            }                        
+                        
+                        // checks for numeric product_id
+      if (!is_numeric($max_product_id) ){
+        $max_product_id=1;
+        $v_products_id = $max_product_id;
+      }
+
+    //  $v_products_id1 = $max_product_id;
+      $msg_output .=  EASY_LABEL_NEW_PRODUCT ;
+
+      $query = "INSERT INTO ".TABLE_PRODUCTS." (
+              products_id,
+          products_image,
+          products_image_med,
+          products_image_lrg,
+          products_image_sm_1,
+          products_image_xl_1,
+          products_image_sm_2,
+          products_image_xl_2,
+          products_image_sm_3,
+          products_image_xl_3,
+          products_image_sm_4,
+          products_image_xl_4,
+          products_image_sm_5,
+          products_image_xl_5,
+          products_image_sm_6,
+          products_image_xl_6,
+          products_model,
+          products_price,
+          products_status,
+          products_last_modified,
+          products_date_added,
+          products_date_available,
+          products_tax_class_id,
+          products_weight,
+          products_quantity,
+          manufacturers_id)
+            VALUES (
+                '$v_products_id',
+              '$v_products_image',
+              '$v_products_image_med',
+              '$v_products_image_lrg',
+              '$v_products_image_sm_1',
+              '$v_products_image_xl_1',
+              '$v_products_image_sm_2',
+              '$v_products_image_xl_2',
+              '$v_products_image_sm_3',
+              '$v_products_image_xl_3',
+              '$v_products_image_sm_4',
+              '$v_products_image_xl_4',
+              '$v_products_image_sm_5',
+              '$v_products_image_xl_5',
+              '$v_products_image_sm_6',
+              '$v_products_image_xl_6',
+              '$v_products_model',
+                '$v_products_price',
+                '$v_db_status',
+                  CURRENT_TIMESTAMP,
+                $v_date_added,
+                '$v_date_avail',
+                '$v_tax_class_id',
+                '$v_products_weight',
+                '$v_products_quantity',
+                '$v_manufacturer_id')
+              ";
+        $result = tep_db_query($query);
+    } else {
+      // existing product, get the id from the query
+      // and update the product data
+      $row =  tep_db_fetch_array($result);
+      $v_products_id = $row['products_id'];
+      $msg_output .= EASY_LABEL_UPDATED;
+      $row =  tep_db_fetch_array($result);
+      $query = 'UPDATE '.TABLE_PRODUCTS.'
+          SET
+          products_price="'.$v_products_price.
+          '" ,products_model="'.$v_products_model.
+          '" ,products_image="'.$v_products_image;
+
+      // uncomment these lines if you are running the image mods
+
+        $query .=
+          '" ,products_image_med="'.$v_products_image_med.
+          '" ,products_image_lrg="'.$v_products_image_lrg.
+          '" ,products_image_sm_1="'.$v_products_image_sm_1.
+          '" ,products_image_xl_1="'.$v_products_image_xl_1.
+          '" ,products_image_sm_2="'.$v_products_image_sm_2.
+          '" ,products_image_xl_2="'.$v_products_image_xl_2.
+          '" ,products_image_sm_3="'.$v_products_image_sm_3.
+          '" ,products_image_xl_3="'.$v_products_image_xl_3.
+          '" ,products_image_sm_4="'.$v_products_image_sm_4.
+          '" ,products_image_xl_4="'.$v_products_image_xl_4.
+          '" ,products_image_sm_5="'.$v_products_image_sm_5.
+          '" ,products_image_xl_5="'.$v_products_image_xl_5.
+          '" ,products_image_sm_6="'.$v_products_image_sm_6.
+          '" ,products_image_xl_6="'.$v_products_image_xl_6;
+
+      $query .= '", products_weight="'.$v_products_weight .
+          '", products_tax_class_id="'.$v_tax_class_id .
+          '", products_date_available= ' . $v_date_avail .
+          ', products_date_added= '  . $v_date_added .
+          ', products_last_modified = CURRENT_TIMESTAMP
+          , products_quantity="' . $v_products_quantity .
+          '" ,manufacturers_id=' . $v_manufacturer_id .
+          ' , products_status=' . $v_db_status . '
+          WHERE
+            (products_id = "'. $v_products_id . '")';
+
+      $result = tep_db_query($query);
+    }
+
+    // the following is common in both the updating an existing product and creating a new product
+                if ( isset($v_products_name)){
+      foreach( $v_products_name as $key => $name){
+              if ($name!=''){
+          $sql = "SELECT * FROM ".TABLE_PRODUCTS_DESCRIPTION." WHERE
+              products_id = $v_products_id AND
+              language_id = " . $key;
+          $result = tep_db_query($sql);
+          if (tep_db_num_rows($result) == 0) {
+            // nope, this is a new product description
+            $result = tep_db_query($sql);
+            $sql =
+              "INSERT INTO ".TABLE_PRODUCTS_DESCRIPTION."
+                (products_id,
+                language_id,
+                products_name,
+                products_description,
+                products_url,
+                products_head_title_tag,
+                products_head_desc_tag,
+                products_head_keywords_tag)
+                VALUES (
+                  '" . $v_products_id . "',
+                  " . $key . ",
+                  '" . $name . "',
+                  '". $v_products_description[$key] . "',
+                  '". $v_products_url[$key] . "',
+                  '". $v_products_head_title_tag[$key] . "',
+                  '". $v_products_head_desc_tag[$key] . "',
+                  '". $v_products_head_keywords_tag[$key] . "')";
+            $result = tep_db_query($sql);
+          } else {
+            // already in the description, let's just update it
+            $sql =
+              "UPDATE ".TABLE_PRODUCTS_DESCRIPTION." SET
+                products_name='$name',
+                products_description='".$v_products_description[$key] . "',
+                products_url='" . $v_products_url[$key] . "',
+                products_head_title_tag = '" . $v_products_head_title_tag[$key] ."',
+                products_head_desc_tag = '" . $v_products_head_desc_tag[$key] ."',
+                products_head_keywords_tag = '" . $v_products_head_keywords_tag[$key] ."'
+              WHERE
+                products_id = '$v_products_id' AND
+                language_id = '$key'";
+        
+            $result = tep_db_query($sql);
+          }
+        }
+      }
+    }
+    if (isset($v_categories_id)){
+      if ($v_products_id == "0"){
+          $v_products_id=$max_product_id;
+                    } else {
+                     $v_products_id=$v_products_id;
+                    }
+
+      //find out if this product is listed in the category given
+      $result_incategory = tep_db_query('SELECT
+            '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id,
+            '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id
+            FROM
+              '.TABLE_PRODUCTS_TO_CATEGORIES.'
+            WHERE
+            '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id='.$v_products_id.' AND
+            '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id='.$v_categories_id);
+
+      if (tep_db_num_rows($result_incategory) == 0) {
+        // nope, this is a new category for this product
+        $res1 = tep_db_query('INSERT INTO '.TABLE_PRODUCTS_TO_CATEGORIES.' (products_id, categories_id)
+              VALUES ("' . $v_products_id . '", "' . $v_categories_id . '")');
+      } else {
+        // already in this category, nothing to do!
+      }
+    }
+    // for the separate prices per customer module
+    $ll=1;
+
+    if (isset($v_customer_price_1)){
+
+      if (($v_customer_group_id_1 == '') AND ($v_customer_price_1 != ''))  {
+        $msg_output .= EASY_ERROR_4;
+        die();
+      }
+      // they spec'd some prices, so clear all existing entries
+      $result = tep_db_query('
+            DELETE
+            FROM
+              '.TABLE_PRODUCTS_GROUPS.'
+            WHERE
+              products_id = ' . $v_products_id
+            );
+      // and insert the new record
+      if ($v_customer_price_1 != ''){
+        $result = tep_db_query('
+              INSERT INTO
+                '.TABLE_PRODUCTS_GROUPS.'
+              VALUES
+              (
+                ' . $v_customer_group_id_1 . ',
+                ' . $v_customer_price_1 . ',
+                ' . $v_products_id . ',
+                ' . $v_products_price .'
+                )'
+              );
+      }
+      if ($v_customer_price_2 != ''){
+        $result = tep_db_query('
+              INSERT INTO
+                '.TABLE_PRODUCTS_GROUPS.'
+              VALUES
+              (
+                ' . $v_customer_group_id_2 . ',
+                ' . $v_customer_price_2 . ',
+                ' . $v_products_id . ',
+                ' . $v_products_price . '
+                )'
+              );
+      }
+      if ($v_customer_price_3 != ''){
+        $result = tep_db_query('
+              INSERT INTO
+                '.TABLE_PRODUCTS_GROUPS.'
+              VALUES
+              (
+                ' . $v_customer_group_id_3 . ',
+                ' . $v_customer_price_3 . ',
+                ' . $v_products_id . ',
+                ' . $v_products_price . '
+                )'
+              );
+      }
+      if ($v_customer_price_4 != ''){
+        $result = tep_db_query('
+              INSERT INTO
+                '.TABLE_PRODUCTS_GROUPS.'
+              VALUES
+              (
+                ' . $v_customer_group_id_4 . ',
+                ' . $v_customer_price_4 . ',
+                ' . $v_products_id . ',
+                ' . $v_products_price . '
+                )'
+              );
+      }
+
+    }
+
+    // VJ product attribs begin insert
+    if (isset($v_attribute_options_id_1)){
+      $attribute_rows = 1; // master row count
+
+      $languages = tep_get_languages();
+
+      // product options count
+      $attribute_options_count = 1;
+      $v_attribute_options_id_var = 'v_attribute_options_id_' . $attribute_options_count;
+
+      while (isset($$v_attribute_options_id_var) && !empty($$v_attribute_options_id_var)) {
+        // remove product attribute options linked to this product before proceeding further
+        // this is useful for removing attributes linked to a product
+        $attributes_clean_query = "delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$v_products_id . "' and options_id = '" . (int)$$v_attribute_options_id_var . "'";
+
+        tep_db_query($attributes_clean_query);
+
+        $attribute_options_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$$v_attribute_options_id_var . "'";
+
+        $attribute_options_values = tep_db_query($attribute_options_query);
+
+        // option table update begin
+        if ($attribute_rows == 1) {
+          // insert into options table if no option exists
+          if (tep_db_num_rows($attribute_options_values) <= 0) {
+            for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+              $lid = $languages[$i]['id'];
+
+              $v_attribute_options_name_var = 'v_attribute_options_name_' . $attribute_options_count . '_' . $lid;
+
+              if (isset($$v_attribute_options_name_var)) {
+                $attribute_options_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, language_id, products_options_name) values ('" . (int)$$v_attribute_options_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_options_name_var . "')";
+
+                $attribute_options_insert = tep_db_query($attribute_options_insert_query);
+              }
+            }
+          } else { // update options table, if options already exists
+            for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+              $lid = $languages[$i]['id'];
+
+              $v_attribute_options_name_var = 'v_attribute_options_name_' . $attribute_options_count . '_' . $lid;
+
+              if (isset($$v_attribute_options_name_var)) {
+                $attribute_options_update_lang_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$$v_attribute_options_id_var . "' and language_id ='" . (int)$lid . "'";
+
+                $attribute_options_update_lang_values = tep_db_query($attribute_options_update_lang_query);
+
+                // if option name doesn't exist for particular language, insert value
+                if (tep_db_num_rows($attribute_options_update_lang_values) <= 0) {
+                  $attribute_options_lang_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, language_id, products_options_name) values ('" . (int)$$v_attribute_options_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_options_name_var . "')";
+
+                  $attribute_options_lang_insert = tep_db_query($attribute_options_lang_insert_query);
+                } else { // if option name exists for particular language, update table
+                  $attribute_options_update_query = "update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . $$v_attribute_options_name_var . "' where products_options_id ='" . (int)$$v_attribute_options_id_var . "' and language_id = '" . (int)$lid . "'";
+
+                  $attribute_options_update = tep_db_query($attribute_options_update_query);
+                }
+              }
+            }
+          }
+        }
+        // option table update end
+
+        // product option values count
+        $attribute_values_count = 1;
+        $v_attribute_values_id_var = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count;
+
+        while (isset($$v_attribute_values_id_var) && !empty($$v_attribute_values_id_var)) {
+          $attribute_values_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$$v_attribute_values_id_var . "'";
+
+          $attribute_values_values = tep_db_query($attribute_values_query);
+
+          // options_values table update begin
+          if ($attribute_rows == 1) {
+            // insert into options_values table if no option exists
+            if (tep_db_num_rows($attribute_values_values) <= 0) {
+              for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+                $lid = $languages[$i]['id'];
+
+                $v_attribute_values_name_var = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid;
+
+                if (isset($$v_attribute_values_name_var)) {
+                  $attribute_values_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int)$$v_attribute_values_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_values_name_var . "')";
+
+                  $attribute_values_insert = tep_db_query($attribute_values_insert_query);
+                }
+              }
+
+
+              // insert values to pov2po table
+              $attribute_values_pov2po_query = "insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_id, products_options_values_id) values ('" . (int)$$v_attribute_options_id_var . "', '" . (int)$$v_attribute_values_id_var . "')";
+
+              $attribute_values_pov2po = tep_db_query($attribute_values_pov2po_query);
+            } else { // update options table, if options already exists
+              for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+                $lid = $languages[$i]['id'];
+
+                $v_attribute_values_name_var = 'v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid;
+
+                if (isset($$v_attribute_values_name_var)) {
+                  $attribute_values_update_lang_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$$v_attribute_values_id_var . "' and language_id ='" . (int)$lid . "'";
+
+                  $attribute_values_update_lang_values = tep_db_query($attribute_values_update_lang_query);
+
+                  // if options_values name doesn't exist for particular language, insert value
+                  if (tep_db_num_rows($attribute_values_update_lang_values) <= 0) {
+                    $attribute_values_lang_insert_query = "insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int)$$v_attribute_values_id_var . "', '" . (int)$lid . "', '" . $$v_attribute_values_name_var . "')";
+
+                    $attribute_values_lang_insert = tep_db_query($attribute_values_lang_insert_query);
+                  } else { // if options_values name exists for particular language, update table
+                    $attribute_values_update_query = "update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . $$v_attribute_values_name_var . "' where products_options_values_id ='" . (int)$$v_attribute_values_id_var . "' and language_id = '" . (int)$lid . "'";
+
+                    $attribute_values_update = tep_db_query($attribute_values_update_query);
+                  }
+                }
+              }
+            }
+          }
+          // options_values table update end
+
+          // options_values price update begin
+          $v_attribute_values_price_var = 'v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count;
+
+          if (isset($$v_attribute_values_price_var) && ($$v_attribute_values_price_var != '')) {
+            $attribute_prices_query = "select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$v_products_id . "' and options_id ='" . (int)$$v_attribute_options_id_var . "' and options_values_id = '" . (int)$$v_attribute_values_id_var . "'";
+
+            $attribute_prices_values = tep_db_query($attribute_prices_query);
+
+            $attribute_values_price_prefix = ($$v_attribute_values_price_var < 0) ? '-' : '+';
+
+            // options_values_prices table update begin
+            // insert into options_values_prices table if no price exists
+            if (tep_db_num_rows($attribute_prices_values) <= 0) {
+              $attribute_prices_insert_query = "insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix) values ('" . (int)$v_products_id . "', '" . (int)$$v_attribute_options_id_var . "', '" . (int)$$v_attribute_values_id_var . "', '" . (int)$$v_attribute_values_price_var . "', '" . $attribute_values_price_prefix . "')";
+
+              $attribute_prices_insert = tep_db_query($attribute_prices_insert_query);
+            } else { // update options table, if options already exists
+              $attribute_prices_update_query = "update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_values_price = '" . $$v_attribute_values_price_var . "', price_prefix = '" . $attribute_values_price_prefix . "' where products_id = '" . (int)$v_products_id . "' and options_id = '" . (int)$$v_attribute_options_id_var . "' and options_values_id ='" . (int)$$v_attribute_values_id_var . "'";
+
+              $attribute_prices_update = tep_db_query($attribute_prices_update_query);
+            }
+          }
+          // options_values price update end
+
+          $attribute_values_count++;
+          $v_attribute_values_id_var = 'v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count;
+        }
+
+        $attribute_options_count++;
+        $v_attribute_options_id_var = 'v_attribute_options_id_' . $attribute_options_count;
+      }
+
+      $attribute_rows++;
+    }
+    // VJ product attribs end
+
+      } else {
+  //  // this record was missing the product_id
+    array_walk($items, 'print_el');
+    $msg_output .= EASY_ERROR_3 ;
+  }
+// end of row insertion code
+}
+
+
+require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/edit_key.php
===================================================================
--- trunk/direct.openmoko.com/admin/edit_key.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/edit_key.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,435 @@
+<?php
+// edit_languages.php
+// A module of OSCommerce
+//
+// Version 1.00
+// 
+// Author: Julian Brown
+// Copyright (c) 2003 JLB Professional Services Inc.
+// Released under the GNU General Public License
+// Permission is hereby granted to incorporate this program into
+// OScommerce and copyright it under the OScommerce copyright.
+// Please notify me that you have.
+//
+// Julian Brown
+// julian at jlbprof.com
+//
+
+require('includes/application_top.php');
+  /*  Removed because the configuration keys are already loaded
+  $crypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+  $crypt = tep_db_fetch_array($crypt_query);
+  $CURR_CRYPT = $crypt['configuration_value'];
+  $crypt_query1 = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_FILE'");
+  $crypt1 = tep_db_fetch_array($crypt_query1);
+  $file_name = $crypt1['configuration_value'];
+  */
+  if ( defined('PAYMENT_CC_CRYPT_PATH') ) $CURR_CRYPT = PAYMENT_CC_CRYPT_PATH;
+  if ( defined('PAYMENT_CC_CRYPT_FILE') ) $file_name  = PAYMENT_CC_CRYPT_FILE;
+  
+  $fs_dir = DIR_FS_CATALOG.DIR_WS_INCLUDES.$CURR_CRYPT;
+  $ws_dir = DIR_WS_CATALOG.DIR_WS_INCLUDES.$CURR_CRYPT;
+  $dir1 = $fs_dir ;
+  $gID = '209';
+  $crypt_file = $dir1 . $file_name;
+  $crypt_file_new = $dir1 . 'new_' . $file_name;
+  $crypt_file_base = $dir1 . 'cc_key.bkp' ;
+  $crypt_file_base_1 = $dir1 . 'new_cc_key.bkp' ;
+  
+ // $crypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+ // $crypt = tep_db_fetch_array($crypt_query);
+ // $CURR_CRYPT = $crypt['configuration_value'];
+
+ // $file_name= 'cc_key.php';
+ // $file_name_new1= 'new_cc_key.php';
+ // $fs_dir = DIR_FS_CATALOG.DIR_WS_INCLUDES.$CURR_CRYPT;
+ // $ws_dir = DIR_WS_CATALOG.DIR_WS_INCLUDES.$CURR_CRYPT;
+ // $dir1 = $fs_dir ;
+  
+  
+// set these variables, so none can get passwords... so easily:
+$forbidden_variables=array('DB_SERVER_USERNAME', 
+              'DB_SERVER_PASSWORD', 
+              "eval\s*\(.*?\)", 
+              "system\s*\(.*?\)", 
+              "execute\s*\(.*?\)", 
+              "eval\s*\(.*?\)" );
+require('includes/functions/edit_key.php');
+$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');    
+              
+    global $languages_array;
+    global $HTTP_GET_VARS;
+    global $HTTP_POST_VARS;
+
+if ($action == 'restore'){
+            $backup = getVAR ('backup');
+            $file   = getVAR ('file');
+            copy ($backup, $file);
+}
+
+if ($action == 'create'){
+    if (file_exists ($crypt_file_base)) {
+     //create key file
+     if (!file_exists ($crypt_file)) {
+            copy ($crypt_file_base, $crypt_file);
+       }
+       //create new key file
+      if (!file_exists ($crypt_file_new)) {
+          copy ($crypt_file_base1, $crypt_file_new);
+        }
+      }  
+  }
+if ($action == 'save'){
+//         echo 'Saved :';
+    if (!$skip)
+      {
+        if (file_exists ($file))
+        {
+            $backup = $file . ".bkp";
+            $flag = 0;
+            if (file_exists ($backup))
+                $flag = 1;
+               $num_defines=parseFile ($file);
+   
+  }
+}
+             $file = $dir1  . $filename;
+            if (!is_writeable ($file))
+            {
+$err_msg = ERROR_TEXT_FILE_LOCKED . "XX:" . $filename  . ":" . $dir1 . ":" .  $file . ":";
+            }
+            else
+            {
+                $num_defines = getVAR ('num_defines');
+                $idx = 0;
+                $string1 = "start_" . $idx;
+               // $start_line = $string;
+                $start_line = $HTTP_POST_VARS[$string1];
+               
+                $string2 = "end_" . $idx;
+                $end_line = $HTTP_POST_VARS[$string2];
+
+                $string3 = "name_" . $idx;
+                //$name = $string;
+                $name = $HTTP_POST_VARS[$string3];
+                
+                $string4 = "text_" . $idx;
+                $text = str_replace("'", "\\'",str_replace("\\", "\\\\", $HTTP_POST_VARS[$string4]));
+
+                // OK to save the changes, we will open the file and
+                // read in one line at a time, till we get to the first
+                // start_line of the first define, we then write out the
+                // value of the define out, till the end_line, then start
+                // outputting data again till the next define.
+                // The defines must be in ascending order.
+                //
+                // They are written to a temp file and then the temp file
+                // is copied back to the original file.
+                //
+                //
+                $temp_fname = tempnam ("", "edit_");
+                $fin = fopen ($file, "rb");
+                $fout = fopen ($temp_fname, "wb");
+                $line_no = 0;
+                while (!feof ($fin))
+                {
+                    $line = fgets ($fin);
+        $xline = $line;
+                    $line = strip_crlf ($line);
+                    $line_no ++;
+                    if ($start_line == -1 ||
+                       $line_no < $start_line)
+                    {
+                        fwrite ($fout, $xline);
+                        continue;
+                    }
+                    if ($line_no == $end_line)
+                    {
+                        // output the define statement
+
+                        $string = "define('" . $name . "', ";
+
+                        if (strstr($text,"'"))
+                        {
+              // if the string has a quote inside it will be written like it is 
+              // (with quotes at start and end)
+              
+              // all quotes have been slashed and only quotes, that follow a "." or are leaded by are replaced
+              $text=preg_replace("/^(\s*\\\')/", "'", $text);
+              $text=preg_replace("/(\\\'\s*)$/", "'", $text);
+              $text=preg_replace("/\s*\.\s*\\\'/", " . '", $text);
+              $text=preg_replace("/\\\'\s*\.\s*/", "' . ", $text);
+              foreach($forbidden_variables as $forbidden){
+                $text=preg_replace("/".$forbidden."/i", "____", $text);
+              }
+                            $string .= $text . ");\n";
+                        }
+                        else
+                        {
+                            $string .= "'" . $text . "');\n";
+                        }
+                        fwrite ($fout, $string . "\n");
+                        // now get the next define
+                        $idx ++;
+                        if ($idx >= $num_defines)
+                        {
+                            $start_line = -1;
+                        }
+                        else
+                        {
+                            $string11 = "start_" . $idx;
+                            $start_line = getVAR ($string11);
+                            $string21 = "end_" . $idx;
+                            $end_line = getVAR ($string21);
+                            $string31 = "name_" . $idx;
+                            $name = getFromQuery ($string31);
+                            $string41 = "text_" . $idx;
+                            $text = str_replace("'", "\\'", str_replace("\\", "\\\\", $HTTP_POST_VARS[$string41]));
+                        }
+                    }
+                }
+                fclose ($fin);
+                fclose ($fout);
+                // save a copy of the original
+                $backup = $file . ".bkp";
+                copy ($file, $backup);
+                copy ($temp_fname, $file);
+                unlink ($temp_fname);
+            }
+        }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>"
+<!-- left_navigation //-->
+<?php
+
+ echo "<table border=\"0\" width=\"" . BOX_WIDTH . "\" cellspacing=\"1\" cellpadding=\"1\" class=\"columnLeft\"> ";
+ require(DIR_WS_INCLUDES . 'column_left.php');
+
+?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+          
+     if (is_writeable($crypt_file)) {
+      $err_msg1 = '2' ;
+      } else {
+      $err_msg1 = '1' ;
+      }
+      
+         if (isset($err_msg)){
+         ?>  <tr>
+                <td colspan=10><?php echo printf(ERROR_TEXT_FILE_LOCKED, $err_msg)?></td>
+             </tr>
+<?php
+}
+ 
+          if((isset($err_msg1)) && ($err_msg1 == 1) ){
+         ?>
+         <tr>
+                <td bgcolor= "#ff0000" colspan=10><font color= "#ffffff"> <?php echo sprintf(ERROR_TEXT_FILE_LOCKED1, $file_name) ?> </font></td>
+         </tr>
+<?php
+}
+          if((isset($err_msg1)) && ($err_msg1 == 2) ){
+         ?>
+         <tr>
+                <td bgcolor= "#0AC92B" colspan=10><font color= "#ffffff"> <?php echo sprintf(ERROR_TEXT_FILE_OK, $file_name) ?> </font></td>
+         </tr>
+<?php
+}
+?> 
+     <tr> 
+     <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', HEADING_IMAGE_HEIGHT); ?></td>
+     <?php  if ($err_msg) { ;?>
+        <tr><td colspan=5>><?php echo $err_msg ;?></td></tr>
+    <?php  } ;?>        
+        </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td>
+<?php
+//if no action then do list of directory
+if (($action == '')||($action == 'create') ){
+       ;  ?>
+           <tr>
+             <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+               
+               <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_FILE_TYPE; ?></td>
+                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_FILE_NAME; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_FILE_ACTION; ?>&nbsp;</td>
+              </tr>
+
+<?php
+   listFiles($dir1);
+ ?>
+  <tr>
+<td colspan="3" width="100%"><?php echo tep_draw_separator('pixel_black.gif', '100%', '2'); ?></td>
+        </tr>
+          </table>
+        </td>
+    </tr>
+ <?php  
+    }
+// if action is edit,save or restore show edit form
+ if ( ($action == 'edit') || ($action == 'save') || ($action == 'restore') ){
+          $file = $dir1  . getVAR ('filename');
+              if (file_exists ($file))
+              {
+                  $backup = $file . ".bkp";
+                  $flag = 0;
+                  if (file_exists ($backup))
+                      $flag = 1;
+                  $num_defines=parseFile ($file);
+      if  ($action == 'edit') {
+         //echo 'Edit :'  . $file;
+         echo EDIT_ACTION  . $file;
+         }
+         
+        if  ($action == 'save') {
+         //echo 'Saved file :'  . $file;
+         echo SAVED_ACTION  . $file;
+         }   
+           ?>
+            <table border=0 cellpadding="1" cellspacing="0" >
+      <?php
+                  for ($i = 0; $i < $num_defines; ++$i)
+                  {
+      ?>
+                          <tr>
+       <?php echo tep_draw_form('edit_key', FILENAME_EDIT_KEY, '&action=save', 'post', '', 'SSL');?>
+                       
+                          <input type=hidden name="num_defines" value="1">
+                          <input type=hidden name="filename" value="<?php echo $filename ; ?>">
+                          <input type=hidden name="name_0" value="<?php echo $defines[$i]['name']; ?>">
+                          <input type=hidden name="start_0" value="<?php echo $defines[$i]['start_line']; ?>">
+                          <input type=hidden name="end_0" value="<?php echo $defines[$i]['end_line']; ?>">
+                          <td>&nbsp;&nbsp;<?php echo $defines[$i]['name']; ?>&nbsp;&nbsp;</td>
+                          <td>
+      <TEXTAREA name="text_0" rows=<?php 
+      if (strlen($defines[$i]['data']) > 1000) echo 25; 
+      else if (strlen($defines[$i]['data']) > 500) echo 15; else echo 2;
+      ?> cols=60>
+      <?php echo htmlspecialchars(stripslashes($defines[$i]['data'])); ?>
+      </TEXTAREA>
+                          </td>
+                          <td>
+          <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) ; ?>
+
+                          </form>
+                          </td>
+                          </tr>
+      <?php
+                  }
+     //show restore button if file has been saved
+              if  ($action == 'save') {
+                              if ($flag)
+                        {
+        ?>
+                                <td>
+                <?php echo tep_draw_form('restore', FILENAME_EDIT_KEY, '&action=restore', 'post', '', 'SSL');?>
+                  <input type=hidden name="filename" value="<?php echo getVAR ('filename'); ?>">
+                  <input type=hidden name="backup" value="<?php echo $backup; ?>">
+                  <input type=hidden name="file" value="<?php echo $file; ?>">
+                  <?php echo tep_image_submit('button_restore.gif', IMAGE_RESTORE) ; ?>              
+                               </form>
+                                </td></tr>
+        <?php
+                        }
+               }   
+           ?>
+                          <tr>
+                          <td colspan=6>
+                          <table>
+                         <tr>
+       <?php
+ echo '<!-- end edit-->' ;      
+   }  
+}
+//always show footer
+?>
+<!-- Begin_footer -->
+      <tr>
+            <td colspan=5>
+              <table>
+                  <tr>
+                  <td>
+                 <?php echo tep_draw_form('search', FILENAME_EDIT_KEY, 'action=search', 'post', '', 'SSL'); ?>
+                  <?php echo tep_draw_input_field('search') ?>
+                   </td>
+                   <td>
+              <?php echo tep_image_submit('button_search.gif', IMAGE_SEARCH);?>
+                </form>
+                  </td>
+                  <td>
+             <?php echo tep_draw_separator('pixel_trans.gif', '1', '25'); ?>     
+                  </td>
+                  <td>
+              <?php echo tep_draw_form('return', FILENAME_EDIT_KEY, '', 'post', '', 'SSL');?>
+              <?php echo tep_image_submit('button_return.gif', IMAGE_RETURN) ; ?>
+                     </form>
+                   </td>
+                   <td>
+              <?php echo tep_draw_form('help', FILENAME_EDIT_KEY_HELP, '&help_id=1', 'post', '', 'SSL');?>
+              <?php echo tep_image_submit('button_help.gif', IMAGE_HELP) ; ?>
+                    </form>
+                   </td>
+                   <td>
+              <?php echo tep_draw_form('create', FILENAME_EDIT_KEY, '&action=create', 'post', '', 'SSL');?>
+              <?php echo tep_image_submit('button_create.gif', IMAGE_CREATE) ; ?>
+                   </form>
+                 </td>
+                </tr>
+              </table
+            </td>
+            <td>
+             </td>
+            </tr>
+             <tr>
+              <td>
+        <?php echo TEXT_HELP_HELP . '<br>'; 
+              echo TEXT_HELP_HELP1 . '<br>' ;
+              echo TEXT_HELP_HELP2 . '<br>';
+              echo TEXT_HELP_HELP3 . '<br>';
+              echo TEXT_HELP_HELP4 . '<br>';
+              echo TEXT_HELP_HELP5 ;
+         ;?>
+             </td>
+          </tr>
+          </table>
+          </tr>
+        </table></td>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/edit_key_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/edit_key_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/edit_key_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,206 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+        <!-- left_navigation //-->
+        <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+        <!-- left_navigation_eof //-->
+      </table></td>
+    <!-- body_text //-->
+    <?php
+ require(DIR_WS_LANGUAGES . $language . '/help/edit_key_help.php') ;
+
+//print("help_id : ".$help_id."<br>");
+
+ if ($help_id == '1') {  
+define('HEADING_TITLE', HEADING_TITLE_01);
+}
+ if ($help_id == '2') {  
+define('HEADING_TITLE', HEADING_TITLE_02);
+}
+if ($help_id == '3') {  
+define('HEADING_TITLE', HEADING_TITLE_03);
+}
+ if ($help_id == '4') {  
+define('HEADING_TITLE', HEADING_TITLE_04);
+}
+if ($help_id == '5') {  
+define('HEADING_TITLE', HEADING_TITLE_05);
+}
+if ($help_id == '6') {  
+define('HEADING_TITLE', HEADING_TITLE_06);
+}
+if ($help_id == '7a') {  
+define('HEADING_TITLE', HEADING_TITLE_07a);
+}
+if ($help_id == '7b') {  
+define('HEADING_TITLE', HEADING_TITLE_07b);
+}
+if ($help_id == '7c') {  
+define('HEADING_TITLE', HEADING_TITLE_07c);
+}
+?>
+
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="menuBoxHeading">
+        <tr>
+          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                       <tr>
+                <td class="pageHeading"><?php echo HEADING_TITLE ; ?></td>
+              </tr>
+              <tr>
+                <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+        </tr>
+        <tr class="attributeBoxContent">
+          <td><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'  ; ?> </td>
+        </tr>
+        <tr valign="top">
+          <td><p><font class="content_heading"><b><!-- Index --><?php echo TEXT_MAG_1?></font> <br>
+              <strong><!-- Introduction:  --><?php echo HEADING_TITLE_01?></strong></p>
+            <ol>
+              <li><a href="edit_key_help.php?&help_id=1"><!-- Pre install and installation of Encrypt and Decrypt --><?php echo TEXT_MAG_2?></a></li>
+              <li><a href="edit_key_help.php?&help_id=2"><!-- Configure Encrypt and Decrypt --><?php echo HEADING_TITLE_02?></a> </li>
+              <li><a href="edit_key_help.php?&help_id=3"><!-- Key management --><?php echo HEADING_TITLE_03?></a></li>
+              <li><a href="edit_key_help.php?&help_id=4"><!-- Encrypt and Decrypt data --><?php echo HEADING_TITLE_04?></a></li>
+              <li><a href="edit_key_help.php?&help_id=5"><!-- Changing your key --><?php echo HEADING_TITLE_05?></a> </li>
+              <li><a href="edit_key_help.php?&help_id=6"><!-- Test --><?php echo HEADING_TITLE_06?></a></li>
+              <li> <!-- Specific task: --> <?php echo TEXT_MAG_3?><br>
+                <a href="edit_key_help.php?&help_id=7a"><!-- A. Encrypted data --><?php echo TEXT_MAG_4?><br>
+                </a><a href="edit_key_help.php?&help_id=7b"><!-- B. Decrypting data --><?php echo TEXT_MAG_5?><br>
+                </a><a href="edit_key_help.php?&help_id=7c"><!-- C. Changing keys and updating encrypted data --><?php echo TEXT_MAG_6?></a></li>
+          </ol></td>
+        </tr>
+        <tr>
+          <td>
+                         <tr>
+                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                       <tr>
+                         <td class="pageHeading"><?php echo HEADING_TITLE ; ?></td>
+                        </tr>
+                        <tr>
+                        <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                       </tr>
+                     </table></td>
+                   </tr>
+<tr class="attributeBoxContent">
+
+ <td>
+ <?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'  ; ?>
+</td>
+</tr>
+  <tr>
+    <td>
+            <font face="Arial"><b><!-- Index --><?php echo TEXT_MAG_1?>
+            <br><a href="edit_key_help.php?&help_id=1"> Introduction:
+            <br> 1.<!--  Pre install and installation of Encrypt and Decrypt : --><?php echo TEXT_MAG_2?></a>
+            <br><a href="edit_key_help.php?&help_id=2">2. <!-- Configure Encrypt and Decrypt --><?php echo HEADING_TITLE_02?></a>
+      <br><a href="edit_key_help.php?&help_id=3">3. <!-- Key management --><?php echo HEADING_TITLE_03?>:</a>
+            <br><a href="edit_key_help.php?&help_id=4">4. <!-- Encrypt and Decrypt data --><?php echo HEADING_TITLE_04?>:</a>
+            <br><a href="edit_key_help.php?&help_id=5">5. <!-- Changing your key --><?php echo HEADING_TITLE_05?>:</a>
+            <br><a href="edit_key_help.php?&help_id=6">6. <?php echo HEADING_TITLE_06?>. </a>
+            <br>7. <!-- Specific task --><?php echo TEXT_MAG_3?>:
+            <br> &nbsp;&nbsp;<a href="edit_key_help.php?&help_id=7a"><!-- A. Encrypted data that is not encrypted: --><?php echo HEADING_TITLE_07a?></a>
+            <br> &nbsp;&nbsp;<a href="edit_key_help.php?&help_id=7b"><!-- B. Decrypting data that is encrypted --><?php echo HEADING_TITLE_07b?></a>
+            <br> &nbsp;&nbsp;<a href="edit_key_help.php?&help_id=7c"><!-- C. Changing keys and updating encrypted data --><?php echo HEADING_TITLE_07c?></b></font></a>
+    </td>
+   </tr>
+    <tr>
+        <td>
+ 
+   </tr>
+    <tr>
+        <td>
+ <?php if ($help_id == '1') {  
+include(DIR_WS_LANGUAGES . $language . '/help/encrypt/encrypt_page1.html') ;
+}
+ if ($help_id == '2') {  
+include(DIR_WS_LANGUAGES . $language . '/help/encrypt/encrypt_page2.html') ;
+}
+ if ($help_id == '3') {  
+include(DIR_WS_LANGUAGES . $language . '/help/encrypt/encrypt_page3.html') ;
+}
+ if ($help_id == '4') {  
+include(DIR_WS_LANGUAGES . $language . '/help/encrypt/encrypt_page4.html') ;
+}
+
+ if ($help_id == '5') {  
+include(DIR_WS_LANGUAGES . $language . '/help/encrypt/encrypt_page5.html') ;
+}
+
+ if ($help_id == '6') {  
+include(DIR_WS_LANGUAGES . $language . '/help/encrypt/encrypt_page6.html') ;
+}
+
+ if ($help_id == '7a') {  
+include(DIR_WS_LANGUAGES . $language . '/help/encrypt/encrypt_page7a.html') ;
+}
+
+ if ($help_id == '7b') {  
+include(DIR_WS_LANGUAGES . $language . '/help/encrypt/encrypt_page7b.html') ;
+}
+
+ if ($help_id == '7c') {  
+include(DIR_WS_LANGUAGES . $language . '/help/encrypt/encrypt_page7c.html') ;
+}
+
+?>
+
+</td>
+  </tr>
+<tr>
+ <td>
+&nbsp; &nbsp;  
+               <?php echo tep_draw_form('crypt', FILENAME_EDIT_KEY_HELP, '&selected_box=crypt&help_id=1', 'post', '', 'SSL');?>
+               <?php echo tep_image_submit('button_return.gif', IMAGE_return) ; ?>
+                     </form>
+
+ </td>
+</tr>      
+      
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/edit_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/edit_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/edit_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1743 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  Written by Jonathan Hilgeman of SiteCreative.com (osc at sitecreative.com)
+  Version History
+ 
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_FUNCTIONS . 'c_orders.php');
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  include(DIR_WS_CLASSES . 'order.php');
+
+  // New "Status History" table has different format.
+  $OldNewStatusValues = (tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "old_value") && tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "new_value"));
+  $CommentsWithStatus = tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "comments");
+  $SeparateBillingFields = tep_field_exists(TABLE_ORDERS, "billing_name");
+
+  // Optional Tax Rate/Percent
+  $AddShippingTax = "0.0"; // e.g. shipping tax of 17.5% is "17.5"
+
+  $orders_statuses = array();
+  $orders_status_array = array();
+  $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
+  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+    $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
+                               'text' => $orders_status['orders_status_name']);
+    $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
+  }
+//get shipping method
+  $orders_ship_method = array();
+  $orders_ship_method_array = array();
+  $orders_ship_method_query = tep_db_query("select ship_method from orders_ship_methods where ship_method_language = '" . (int)$languages_id . "'");
+  while ($orders_ship_methods = tep_db_fetch_array($orders_ship_method_query)) {
+    $orders_ship_method[] = array('id'   => $orders_ship_methods['ship_method'],
+                                  'text' => $orders_ship_methods['ship_method']);
+    $orders_ship_method_array[$orders_ship_methods['ship_method']] = $orders_ship_methods['ship_method'];
+  }
+//get pay method
+  $orders_pay_method = array();
+  $orders_pay_method_array = array();
+  $orders_pay_method_query = tep_db_query("select pay_method from orders_pay_methods where pay_method_language =  '" . (int)$languages_id . "'");
+  while ($orders_pay_methods = tep_db_fetch_array($orders_pay_method_query)) {
+    $orders_pay_method[] = array('id'   => $orders_pay_methods['pay_method'],
+                                  'text' => $orders_pay_methods['pay_method']);
+    $orders_pay_method_array[$orders_pay_methods['pay_method']] = $orders_pay_methods['pay_method'];
+  }
+
+// begin action
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : 'edit');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+
+  // Update Order
+  case 'update_order':
+
+    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+    $order = new order($oID);
+    $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
+    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
+
+    // Update Order Info
+    $UpdateOrders = "update " . TABLE_ORDERS . " set
+      customers_name = '" . tep_db_input(stripslashes($update_customer_name)) . "',
+      customers_company = '" . tep_db_input(stripslashes($update_customer_company)) . "',
+      customers_street_address = '" . tep_db_input(stripslashes($update_customer_street_address)) . "',
+      customers_suburb = '" . tep_db_input(stripslashes($update_customer_suburb)) . "',
+      customers_city = '" . tep_db_input(stripslashes($update_customer_city)) . "',
+      customers_state = '" . tep_db_input(stripslashes($update_customer_state)) . "',
+      customers_postcode = '" . tep_db_input($update_customer_postcode) . "',
+      customers_country = '" . tep_db_input(stripslashes($update_customer_country)) . "',
+      customers_telephone = '" . tep_db_input($update_customer_telephone) . "',
+      customers_email_address = '" . tep_db_input($update_customer_email_address) . "',";
+
+    if($SeparateBillingFields)
+    {
+    $UpdateOrders .= "billing_name = '" . tep_db_input(stripslashes($update_billing_name)) . "',
+      billing_company = '" . tep_db_input(stripslashes($update_billing_company)) . "',
+      billing_street_address = '" . tep_db_input(stripslashes($update_billing_street_address)) . "',
+      billing_suburb = '" . tep_db_input(stripslashes($update_billing_suburb)) . "',
+      billing_city = '" . tep_db_input(stripslashes($update_billing_city)) . "',
+      billing_state = '" . tep_db_input(stripslashes($update_billing_state)) . "',
+      billing_postcode = '" . tep_db_input($update_billing_postcode) . "',
+      billing_country = '" . tep_db_input(stripslashes($update_billing_country)) . "',";
+    }
+
+    $UpdateOrders .= "delivery_name = '" . tep_db_input(stripslashes($update_delivery_name)) . "',
+      delivery_company = '" . tep_db_input(stripslashes($update_delivery_company)) . "',
+      delivery_street_address = '" . tep_db_input(stripslashes($update_delivery_street_address)) . "',
+      delivery_suburb = '" . tep_db_input(stripslashes($update_delivery_suburb)) . "',
+      delivery_city = '" . tep_db_input(stripslashes($update_delivery_city)) . "',
+      delivery_state = '" . tep_db_input(stripslashes($update_delivery_state)) . "',
+      delivery_postcode = '" . tep_db_input($update_delivery_postcode) . "',
+      delivery_country = '" . tep_db_input(stripslashes($update_delivery_country)) . "',
+      payment_method = '" . tep_db_input($update_info_payment_method) . "',
+      account_name = '" . tep_db_input($account_name) . "',
+      account_number = '" . tep_db_input($account_number) . "',
+      po_number = '" . tep_db_input($po_number) . "',
+      cc_type = '" . tep_db_input($update_info_cc_type) . "',
+      cc_owner = '" . tep_db_input($update_info_cc_owner) . "',
+      cc_start = '" . tep_db_input($update_info_cc_start) . "',
+      cc_issue = '" . tep_db_input($update_info_cc_issue) . "',
+                        last_modified = now()";
+      
+    
+// encrypt cc number begin           
+      if (PAYMENT_CC_CRYPT == 'True') {
+        $cc_number5 = cc_decrypt($order->info['cc_number']);
+      }else{
+        $cc_number5 =$order->info['cc_number'];
+      }                   
+      if ($update_info_cc_number != $cc_number5){             
+        if (PAYMENT_CC_CRYPT == 'True') { 
+          $cc_number10 = cc_encrypt($update_info_cc_number);
+        }else{
+          $cc_number10 =$update_info_cc_number;
+        }
+        $UpdateOrders .= ", cc_number = '$cc_number10'";
+      }
+//encrypt cc number end  ;              
+
+// encrypt cc expire begin   ;  
+      if (PAYMENT_CC_CRYPT == 'True') {
+        $cc_expires5 = cc_decrypt($order->info['cc_expires']);
+      }else{
+        $cc_expires5 =$order->info['cc_expires'];
+      }                   
+      if ($update_info_cc_expires != $cc_expires5){
+        if (PAYMENT_CC_CRYPT == 'True') { 
+          $cc_expires10 = cc_encrypt($update_info_cc_expires);
+        }else{
+          $cc_expires10 =$update_info_cc_expires;
+        }
+        $UpdateOrders .= ", cc_expires = '$cc_expires10'";
+      }
+//encrypt cc expire end                
+
+//ccv  begin
+      if (PAYMENT_CC_CRYPT == 'True') {
+        $cc_ccv5 = cc_decrypt($order->info['cc_ccv']);
+      }else{
+        $cc_ccv5 =$order->info['cc_ccv'];
+      }
+      if ($update_info_cc_ccv != $cc_ccv5){        
+        if (PAYMENT_CC_CRYPT == 'True') { 
+          $cc_ccv10 = cc_encrypt($update_info_cc_ccv);
+        }else{
+          $cc_ccv10 = $update_info_cc_ccv;
+        }
+        $UpdateOrders .= ", cc_ccv = '$cc_ccv10' ";
+      }
+//ccv end 
+      
+    if(!$CommentsWithStatus)
+    {
+      $UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'";
+    }
+
+    $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "' ";
+
+    tep_db_query($UpdateOrders);
+
+    $Query1 = "update orders set last_modified = now() where orders_id = '" . tep_db_input($oID) . "';";
+    tep_db_query($Query1);
+    $order_updated = true;
+
+
+          $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+          $check_status = tep_db_fetch_array($check_status_query);
+
+    // Update Status History & Email Customer if Necessary
+    if ($order->info['orders_status'] != $status)
+    {
+      // Notify Customer
+              $customer_notified = '0';
+      if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on'))
+      {
+        $notify_comments = '';
+        if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
+          $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
+        }
+        $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
+        tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+        $customer_notified = '1';
+      }
+
+      // "Status History" table has gone through a few
+      // different changes, so here are different versions of
+      // the status update.
+
+      // NOTE: Theoretically, there shouldn't be a
+      //       orders_status field in the ORDERS table. It
+      //       should really just use the latest value from
+      //       this status history table.
+
+      if($CommentsWithStatus)
+      {
+      tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
+        (orders_id, orders_status_id, date_added, customer_notified, comments)
+        values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), " . tep_db_input($customer_notified) . ", '" . tep_db_input($comments)  . "')");
+      }
+      else
+      {
+        if($OldNewStatusValues)
+        {
+        tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
+          (orders_id, new_value, old_value, date_added, customer_notified)
+          values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', '" . $order->info['orders_status'] . "', now(), " . tep_db_input($customer_notified) . ")");
+        }
+        else
+        {
+        tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
+          (orders_id, orders_status_id, date_added, customer_notified)
+          values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), " . tep_db_input($customer_notified) . ")");
+        }
+      }
+    }
+
+    // check to see if there are products to update
+    if (count($update_products) > 0)
+    {
+    // Update Products
+    $RunningSubTotal = 0;
+    $RunningTax = 0;
+        // CWS EDIT (start) -- Check for existence of subtotals...
+        // Do pre-check for subtotal field existence
+    $ot_subtotal_found = false;
+      foreach($update_totals as $total_details)
+    {
+        extract($total_details,EXTR_PREFIX_ALL,"ot");
+      if($ot_class == "ot_subtotal")
+      {
+          $ot_subtotal_found = true;
+          break;
+      }
+    }
+    // CWS EDIT (end) -- Check for existence of subtotals...
+
+    foreach($update_products as $orders_products_id => $products_details)
+    {
+      // Update orders_products Table
+      //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+      $order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '" . (int)$orders_products_id . "'");
+      if (tep_db_num_rows($order_query) > 0) {
+        $order_array = tep_db_fetch_array($order_query);
+      } else {
+        $order_array['products_quantity'] = 0;
+      }
+      if ($products_details["qty"] != $order_array['products_quantity']) {
+        $quantity_difference = (int)($products_details["qty"]) - (int)($order_array['products_quantity']);
+          $products_quantity = tep_db_fetch_array(tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$order_array['products_id'] . "'"));
+          $products_new_quantity = (int)$products_quantity['products_quantity'] - $quantity_difference;
+          $products_ordered = 0;
+          if ($order_array['products_quantity'] == 0) {
+            $products_ordered = 1;
+          }
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = " . $products_new_quantity . ", products_ordered = products_ordered + " . (int)$products_ordered . " where products_id = '" . (int)$order_array['products_id'] . "'");
+      }
+      //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+      if($products_details["qty"] > 0)
+      {
+        $Query = "update " . TABLE_ORDERS_PRODUCTS . " set
+          products_model = '" . $products_details["model"] . "',
+          products_name = '" . str_replace("'", "&#39;", $products_details["name"]) . "',
+          final_price = '" . $products_details["final_price"] . "',
+          products_tax = '" . $products_details["tax"] . "',
+          products_quantity = '" . $products_details["qty"] . "'
+          where orders_products_id = '$orders_products_id';";
+        tep_db_query($Query);
+
+        // Update Tax and Subtotals
+        $RunningSubTotal += $products_details["qty"] * $products_details["final_price"];
+        $RunningTax += (($products_details["tax"]/100) * ($products_details["qty"] * $products_details["final_price"]));
+
+        // Update Any Attributes
+        if(IsSet($products_details[attributes]))
+        {
+          foreach($products_details["attributes"] as $orders_products_attributes_id => $attributes_details)
+          {
+            $Query = "update " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
+              products_options = '" . $attributes_details["option"] . "',
+              products_options_values = '" . $attributes_details["value"] . "',
+              options_values_price = '" . $attributes_details["att_price"] . "',
+              price_prefix = '" . $attributes_details["att_prefix"] . "',
+              products_options_id = '" . $attributes_details["option_names"] . "',
+              products_options_values_id = '" . $attributes_details["value"] . "'
+              where orders_products_attributes_id = '$orders_products_attributes_id';";
+            tep_db_query($Query);
+          }
+        }
+      }
+      else
+      {
+        // 0 Quantity = Delete
+        $Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '$orders_products_id';";
+        tep_db_query($Query);
+          //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+//        $order = tep_db_fetch_array($order_query);
+//          if ($products_details["qty"] != $order['products_quantity']){
+//          $quantity_difference = ($products_details["qty"] - $order['products_quantity']);
+//          tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $quantity_difference . ", products_ordered = products_ordered + " . $quantity_difference . " where products_id = '" . (int)$order['products_id'] . "'");
+//          }
+          //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+        $Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_products_id = '$orders_products_id';";
+        tep_db_query($Query);
+      }
+    }
+
+    // Shipping Tax
+      foreach($update_totals as $total_index => $total_details)
+      {
+        extract($total_details,EXTR_PREFIX_ALL,"ot");
+        if($ot_class == "ot_shipping")
+        {
+          $RunningTax += (($AddShippingTax / 100) * $ot_value);
+        }
+      }
+
+    // Update Totals
+
+      $RunningTotal = 0;
+      $sort_order = 0;
+
+      // Do pre-check for Tax field existence
+        $ot_tax_found = 0;
+        foreach($update_totals as $total_details)
+        {
+          extract($total_details,EXTR_PREFIX_ALL,"ot");
+          if($ot_class == "ot_tax")
+          {
+            $ot_tax_found = 1;
+            break;
+          }
+        }
+
+      foreach($update_totals as $total_index => $total_details)
+      {
+        extract($total_details,EXTR_PREFIX_ALL,"ot");
+
+        if( trim(strtolower($ot_title)) == "tax" || trim(strtolower($ot_title)) == "tax:" )
+        {
+          if($ot_class != "ot_tax" && $ot_tax_found == 0)
+          {
+            // Inserting Tax
+            $ot_class = "ot_tax";
+            $ot_value = "x"; // This gets updated in the next step
+            $ot_tax_found = 1;
+          }
+        }
+
+        if( trim($ot_title) && trim($ot_value) )
+        {
+          $sort_order++;
+
+          // Update ot_subtotal, ot_tax, and ot_total classes
+            if($ot_class == "ot_subtotal")
+            $ot_value = $RunningSubTotal;
+
+            if($ot_class == "ot_tax")
+            {
+            $ot_value = $RunningTax;
+            // print "ot_value = $ot_value<br>\n";
+            }
+//disocunt
+
+
+
+     // CWS EDIT (start) -- Check for existence of subtotals...
+            if($ot_class == "ot_total")
+                        {
+
+                $ot_value = $RunningTotal ;
+                            if ( !$ot_subtotal_found )
+                            {
+                                // There was no subtotal on this order, lets add the running subtotal in.
+                                $ot_value = $ot_value + $RunningSubTotal;
+                            }
+                        }
+     // CWS EDIT (end) -- Check for existence of subtotals...
+
+          // Set $ot_text (display-formatted value)
+            // $ot_text = "\$" . number_format($ot_value, 2, '.', ',');
+
+            $order = new order($oID);
+            $ot_text = $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']);
+
+            if($ot_class == "ot_total")
+            $ot_text = "<b>" . $ot_text . "</b>";
+
+          if($ot_total_id > 0)
+          {
+            // In Database Already - Update
+            $Query = "update " . TABLE_ORDERS_TOTAL . " set
+              title = '$ot_title',
+              text = '$ot_text',
+              value = '$ot_value',
+              sort_order = '$sort_order'
+              where orders_total_id = '$ot_total_id'";
+            tep_db_query($Query);
+          }
+          else
+          {
+
+            // New Insert
+            $Query = "insert into " . TABLE_ORDERS_TOTAL . " set
+              orders_id = '$oID',
+              title = '$ot_title',
+              text = '$ot_text',
+              value = '$ot_value',
+              class = '$ot_class',
+              sort_order = '$sort_order'";
+            tep_db_query($Query);
+          }
+
+          if ($ot_class == "ot_shipping" || $ot_class == "ot_lev_discount" || $ot_class == "ot_customer_discount" || $ot_class == "ot_custom" || $ot_class == "ot_cod_fee") {
+            // Again, because products are calculated in terms of default currency, we need to align shipping, custom etc. values with default currency
+            $RunningTotal += $ot_value / $order->info['currency_value'];
+          }
+          else
+          {
+            if($ot_class != "ot_tax") {
+              $RunningTotal += $ot_value;
+            }
+            else if ( DISPLAY_PRICE_WITH_TAX == 'false') {
+               // For German friends, the tax is included in the price and should not be
+               // taken in account when calculating total (not sure about shipping part, though :) )
+               $RunningTotal += $ot_value;
+            }
+          }
+        
+            //  print $ot_value."<br>";
+        }
+      elseif (($ot_total_id > 0) && ($ot_class != "ot_shipping")) { // Delete Total Piece
+        
+          // Delete Total Piece
+          $Query = "delete from " . TABLE_ORDERS_TOTAL . " where orders_total_id = '$ot_total_id'";
+          tep_db_query($Query);
+        }
+
+      }
+    }
+    if ($order_updated)
+    {
+      $messageStack->add_session('search', SUCCESS_ORDER_UPDATED, 'success');
+    }
+
+            tep_redirect(tep_href_link(FILENAME_EDIT_ORDERS, tep_get_all_get_params(array('action')) . 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit', 'SSL'));
+
+  break;
+ 
+  // Add a Product
+  case 'add_product':
+    if($step == 5) {
+      // Get Order Info
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+      $order = new order($oID);
+
+      $AddedOptionsPrice = 0;
+      
+      
+      // Get Product Info
+      $InfoQuery = "select p.products_model,p.products_price,pd.products_name,p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='$add_product_products_id' and p.products_id=pd.products_id";
+      $result = tep_db_query($InfoQuery);
+      $row = tep_db_fetch_array($result);
+      extract($row, EXTR_PREFIX_ALL, "p");
+
+      // risolviamo il bug delle specials
+      $rs_special = tep_db_query("select * from specials where products_id ='". $add_product_products_id."' and status = 1 "  );
+      $special = tep_db_fetch_array($rs_special);
+      
+                     
+      if ($special) 
+      {
+      $p_products_price = $special['specials_new_products_price'];
+      }
+      // Following functions are defined at the bottom of this file
+      $CountryID = tep_get_country_id($order->delivery["country"]);
+      $ZoneID = tep_get_zone_id($CountryID, $order->delivery["state"]);
+
+      $ProductsTax = tep_get_tax_rate($p_products_tax_class_id, $CountryID, $ZoneID);
+
+      $Query = "insert into " . TABLE_ORDERS_PRODUCTS . " set
+        orders_id = $oID,
+        products_id = $add_product_products_id,
+        products_model = '$p_products_model',
+        products_name = '" . str_replace("'", "&#39;", $p_products_name) . "',
+        products_price = '$p_products_price',
+        final_price = '" . ($p_products_price + $AddedOptionsPrice) . "',
+        products_tax = '$ProductsTax',
+        products_quantity = $add_product_quantity;";
+      tep_db_query($Query);
+      $new_product_id = tep_db_insert_id();
+
+//UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+      tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . (int)$add_product_quantity . ", products_ordered = products_ordered + 1 where products_id = '" . (int)$add_product_products_id . "'");
+//UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+
+  // Get Product Attribute Info
+
+   if(IsSet($add_product_options)){
+
+//split $add_product_options
+      foreach($add_product_options as $option_id => $option_value_id){
+// check to see if there is a downloadable file
+if (DOWNLOAD_ENABLED == 'true') {
+$attributes_query_check = tep_db_query("select pa.products_attributes_id, poval.products_options_values_id, pa.products_id, pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, poptt.products_options_name, poval.products_options_values_name, pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount  FROM
+" . TABLE_PRODUCTS_OPTIONS . " popt,
+" . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,
+" . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
+" . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+" . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad  
+WHERE
+pa.products_id = '" . $add_product_products_id . "'
+and pa.options_id = '" . $option_id. "' 
+and pa.options_values_id = '" . $option_value_id. "' 
+and pa.options_id = poptt.products_options_text_id 
+and poval.products_options_values_id =  pa.options_values_id 
+and poptt.language_id = '" . (int)$languages_id . "' 
+and poval.language_id = '" . (int)$languages_id . "'
+and pad.products_attributes_id = pa.products_attributes_id 
+order by pa.products_options_sort_order 
+limit 1"); 
+ if (tep_db_num_rows($attributes_query_check)) {
+$item_has_down = '1';
+  }
+}
+
+// get attibutes data
+if ( (DOWNLOAD_ENABLED == 'true') && ($item_has_down == '1') ) {
+$attributes_query = tep_db_query("select pa.products_attributes_id, poval.products_options_values_id, pa.products_id, pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, poptt.products_options_name, poval.products_options_values_name, pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount  FROM
+" . TABLE_PRODUCTS_OPTIONS . " popt,
+" . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,
+" . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
+" . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+" . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad  
+WHERE
+pa.products_id = '" . $add_product_products_id . "'
+and pa.options_id = '" . $option_id. "' 
+and pa.options_values_id = '" . $option_value_id. "' 
+and pa.options_id = poptt.products_options_text_id 
+and poval.products_options_values_id =  pa.options_values_id 
+and poptt.language_id = '" . (int)$languages_id . "' 
+and poval.language_id = '" . (int)$languages_id . "'
+and pad.products_attributes_id = pa.products_attributes_id 
+order by pa.products_options_sort_order 
+limit 1"); 
+    } else {
+$attributes_query = tep_db_query("select pa.products_attributes_id, poval.products_options_values_id, pa.products_id, pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, poptt.products_options_name, poval.products_options_values_name from
+" . TABLE_PRODUCTS_OPTIONS . " popt,
+" . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,
+" . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
+" . TABLE_PRODUCTS_ATTRIBUTES . " pa
+where
+pa.products_id = '" . $add_product_products_id . "'
+and pa.options_id = '" . $option_id. "' 
+and pa.options_values_id = '" . $option_value_id. "' 
+and pa.options_id = poptt.products_options_text_id 
+and poval.products_options_values_id =  pa.options_values_id 
+and poptt.language_id = '" . (int)$languages_id . "' 
+and poval.language_id = '" . (int)$languages_id . "'
+order by pa.products_options_sort_order
+limit 1
+"); 
+}
+while  ($attributes = tep_db_fetch_array($attributes_query)){
+  $orders_products_id = $new_product_id;
+  $products_options = $attributes['products_options_name'];
+  $products_options_values = $attributes['products_options_values_name'];
+  $options_values_price = $attributes['options_values_price'];
+  $price_prefix = $attributes['price_prefix'];
+  $products_options_id = $attributes['options_id'];
+  $products_options_values_id = $attributes['options_values_id'];
+
+//downloads
+$orders_products_filename = $attributes['products_attributes_filename'];
+$download_maxdays = $attributes['products_attributes_maxdays'];
+$download_count = $attributes['products_attributes_maxcount'];
+
+//add attibute price to product price
+if ($price_prefix == '+'){
+  $AddedOptionsPrice += $options_values_price;
+}else{
+  $AddedOptionsPrice -= $options_values_price;
+  }
+// $att_options_values_price = $att_price;  
+ 
+// update final price
+$product_price = tep_db_query("select final_price from
+                             " . TABLE_ORDERS_PRODUCTS . "
+                            where
+                            orders_id = $oID and
+                            orders_products_id = $new_product_id ");
+  while  ($product_price_array = tep_db_fetch_array($product_price)){
+    $Query = "update " . TABLE_ORDERS_PRODUCTS . " set
+     final_price = '" . ($product_price_array['final_price'] + $AddedOptionsPrice) . "'
+  where orders_id = $oID and orders_products_id = $orders_products_id ";
+   tep_db_query($Query);
+ }  
+ 
+//insert attrbutes
+   $Query = "insert into " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " set
+               orders_id = $oID,
+               orders_products_id = $orders_products_id,
+               products_options = '". $products_options . "',
+               products_options_values = '" . $products_options_values. "',
+               options_values_price = $options_values_price,
+               price_prefix = '" . $price_prefix . "',
+               products_options_id = $products_options_id,
+               products_options_values_id = $products_options_values_id;";
+    
+  tep_db_query($Query);
+// add download insert
+          if ((DOWNLOAD_ENABLED == 'true') && isset($orders_products_filename) && tep_not_null($orders_products_filename)) {
+            $sql_data_array = array('orders_id' => $oID,
+                                    'orders_products_id' => $new_product_id,
+                                    'orders_products_filename' => $orders_products_filename,
+                                    'download_maxdays' => $download_maxdays,
+                                    'download_count' => $download_count);
+            tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
+           }
+
+
+   }
+    }
+//add product info
+
+  //UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+  tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $add_product_quantity . ", products_ordered = products_ordered + " . $add_product_quantity . " where products_id = '" . $add_product_products_id . "'");
+  //UPDATE_INVENTORY_QUANTITY_END##############################################################################################################
+//end add product info
+
+      // Calculate Tax and Sub-Totals
+      $order = new order($oID);
+      $RunningSubTotal = 0;
+      $RunningTax = 0;
+
+      for ($i=0; $i<sizeof($order->products); $i++)
+      {
+      $RunningSubTotal += ($order->products[$i]['qty'] * $order->products[$i]['final_price']);
+      $RunningTax += (($order->products[$i]['tax'] / 100) * ($order->products[$i]['qty'] * $order->products[$i]['final_price']));
+      }
+        //   echo 'running_tax ' . $RunningTax ;
+    if ($ot_class == "ot_shipping" || $ot_class == "ot_lev_discount" || $ot_class == "ot_customer_discount" || $ot_class == "ot_custom" || $ot_class == "ot_cod_fee") {
+      // Again, because products are calculated in terms of default currency, we need to align shipping, custom etc. values with default currency
+      $RunningTotal += $ot_value / $order->info['currency_value'];
+      }
+
+      // Tax
+      $Query = "update " . TABLE_ORDERS_TOTAL . " set
+        text = '\$" . number_format($RunningTax, 2, '.', ',') . "',
+        value = '" . $RunningTax . "'
+        where class='ot_tax' and orders_id=$oID";
+      tep_db_query($Query);
+
+      // Sub-Total
+      $Query = "update " . TABLE_ORDERS_TOTAL . " set
+        text = '\$" . number_format($RunningSubTotal, 2, '.', ',') . "',
+        value = '" . $RunningSubTotal . "'
+        where class='ot_subtotal' and orders_id=$oID";
+      tep_db_query($Query);
+
+      // Total
+      $Query = "select sum(value) as total_value from " . TABLE_ORDERS_TOTAL . " where class != 'ot_total' and orders_id=$oID";
+      $result = tep_db_query($Query);
+      $row = tep_db_fetch_array($result);
+      $Total = $row["total_value"];
+
+      $Query = "update " . TABLE_ORDERS_TOTAL . " set
+        text = '<b>\$" . number_format($Total, 2, '.', ',') . "</b>',
+        value = '" . $Total . "'
+        where class='ot_total' and orders_id=$oID";
+      tep_db_query($Query);
+   
+    }
+tep_redirect(tep_href_link(FILENAME_EDIT_ORDERS, tep_get_all_get_params(array('action')) . 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit', 'SSL'));
+
+    }
+  break;
+
+// Remove CVV Number
+    case 'deleteccinfo':
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+
+      tep_db_query("update " . TABLE_ORDERS . " set cc_ccv = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_number = '0000000000000000' where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_expires = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_start = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_issue = null where orders_id = '" . tep_db_input($oID) . "'");
+
+      tep_redirect(tep_href_link(FILENAME_EDIT_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit'));
+      break;
+      
+    } //end action
+  }// end action NUll
+
+  if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
+    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+    $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+    $order_exists = true;
+    if (!tep_db_num_rows($orders_query)) {
+      $order_exists = false;
+      $messageStack->add('search', sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php
+  require(DIR_WS_INCLUDES . 'header.php');
+?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+$totals_check_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' order by sort_order");
+if (tep_db_num_rows($totals_check_query) < 1) { 
+ $abandoned = 1;
+ }
+
+  if (($action == 'edit') && ($order_exists == true)) {
+    $order = new order($oID);
+?>
+      <tr>
+        <td width="100%">
+          <table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+     if ($abandoned == '1'){
+     ?>
+           <tr>     
+            <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+            <tr>
+              <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+      <td class="messageStackError"><?php echo HEADING_ABANDONED . $oID; ?></td></tr>
+      <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+    </table></td>
+   </tr>
+
+  <?php
+    } else{
+    ?>
+           <tr>     
+            <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+            <tr>
+              <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td class="pageHeading"><?php echo HEADING_TITLE . '  ' .$oID;  ?></td>
+                  <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                </tr>
+              </table></td>
+ </tr>
+<?php   
+    }
+?>
+
+          <tr>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+
+<!-- Begin Addresses Block -->
+      <tr>
+      <?php // echo tep_draw_form('edit_order', FILENAME_EDIT_ORDERS,  tep_get_all_get_params(array('action','paycc')), 'action=update_order', 'post'); 
+      ?>
+
+<tr><?php echo tep_draw_form('edit_order', FILENAME_EDIT_ORDERS, tep_get_all_get_params(array('action','paycc'), 'post', '', 'SSL') . 'action=update_order', 'post', '', 'SSL'); ?>
+  <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+    <tr>
+      <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+    </tr>
+    <tr>
+      <td valign="top">
+      <!-- Customer Info Block -->
+    <table border="0" cellspacing="0" cellpadding="2">
+    <tr>
+    <td colspan='2' class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
+    <td colspan='2' class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>
+    </tr>
+    <tr>
+    <td colspan='2' class="main">
+    <table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+      <tr>
+      <td class="editOrder"><b><?php echo ENTRY_NAME ?></b></font></td>
+      <td><input name='update_customer_name' size='37' value='<?php echo tep_html_quotes($order->customer['name']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_COMPANY ?></b></font></td>
+        <td><input name='update_customer_company' size='37' value='<?php echo tep_html_quotes($order->customer['company']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo CATEGORY_ADDRESS ?></b></font></td>
+        <td><input name='update_customer_street_address' size='37' value='<?php echo tep_html_quotes($order->customer['street_address']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_SUBURB ?></b></font></td>
+        <td><input name='update_customer_suburb' size='37' value='<?php echo tep_html_quotes($order->customer['suburb']); ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_CITY ?></b></font></td>
+        <td><input name='update_customer_city' size='15' value='<?php echo tep_html_quotes($order->customer['city']); ?>'> </td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_STATE ?></b></font></td>
+        <td><input name='update_customer_state' size='15' value='<?php echo tep_html_quotes($order->customer['state']); ?>'> </td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_POST_CODE ?></b></font></td>
+        <td><input name='update_customer_postcode' size='5' value='<?php echo $order->customer['postcode']; ?>'></td>
+      </tr>
+      <tr>
+        <td class="editOrder"><b><?php echo ENTRY_COUNTRY ?></b></font></td>
+        <td><input name='update_customer_country' size='37' value='<?php echo tep_html_quotes($order->customer['country']); ?>'></td>
+      </tr>
+     </table>
+    </td>
+
+
+<?php if($SeparateBillingFields) { ?>
+      <td>
+       <!-- Billing Address Block -->
+       <table border="0" cellspacing="0" cellpadding="2">
+
+      <tr>
+        <td colspan='2' class="main">
+          <table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+          <tr>
+            <td class="editOrder"><b><?php echo ENTRY_NAME ?></b></font></td>
+              <td><input name='update_billing_name' size='37' value='<?php echo tep_html_quotes($order->billing['name']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COMPANY ?></b></font></td>
+              <td><input name='update_billing_company' size='37' value='<?php echo tep_html_quotes($order->billing['company']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo CATEGORY_ADDRESS ?></b></font></td>
+              <td><input name='update_billing_street_address' size='37' value='<?php echo tep_html_quotes($order->billing['street_address']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_SUBURB ?></b></font></td>
+              <td><input name='update_billing_suburb' size='37' value='<?php echo tep_html_quotes($order->billing['suburb']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_CITY ?></b></font></td>
+              <td><input name='update_billing_city' size='15' value='<?php echo tep_html_quotes($order->billing['city']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_STATE ?></b></font></td>
+              <td><input name='update_billing_state' size='15' value='<?php echo tep_html_quotes($order->billing['state']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_POST_CODE ?></b></font></td>
+              <td><input name='update_billing_postcode' size='5' value='<?php echo $order->billing['postcode']; ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COUNTRY ?></b></font></td>
+              <td><input name='update_billing_country' size='37' value='<?php echo tep_html_quotes($order->billing['country']); ?>'></td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+    </table>
+      </td>
+<?php } ?>
+
+    </tr>
+    </table>
+      </td>
+      </tr>
+
+      <tr>
+      <td valign="top">
+      <!-- Shipping Address Block -->
+    <table border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>
+      </tr>
+      <tr>
+        <td colspan='1' class="main">
+          <table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+          <tr>
+            <td class="editOrder"><b><?php echo ENTRY_NAME ?></b></font></td>
+              <td><input name='update_delivery_name' size='37' value='<?php echo tep_html_quotes($order->delivery['name']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COMPANY ?></b></font></td>
+              <td><input name='update_delivery_company' size='37' value='<?php echo tep_html_quotes($order->delivery['company']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo CATEGORY_ADDRESS ?></b></font></td>
+              <td><input name='update_delivery_street_address' size='37' value='<?php echo tep_html_quotes($order->delivery['street_address']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_SUBURB ?></b></font></td>
+              <td><input name='update_delivery_suburb' size='37' value='<?php echo tep_html_quotes($order->delivery['suburb']); ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_CITY ?></b></font></td>
+              <td><input name='update_delivery_city' size='15' value='<?php echo tep_html_quotes($order->delivery['city']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_STATE ?></b></font></td>
+              <td><input name='update_delivery_state' size='15' value='<?php echo tep_html_quotes($order->delivery['state']); ?>'> </td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_POST_CODE ?></b></font></td>
+              <td><input name='update_delivery_postcode' size='5' value='<?php echo $order->delivery['postcode']; ?>'></td>
+            </tr>
+            <tr>
+              <td class="editOrder"><b><?php echo ENTRY_COUNTRY ?></b></font></td>
+              <td><input name='update_delivery_country' size='37' value='<?php echo tep_html_quotes($order->delivery['country']); ?>'></td>
+            </tr>
+          </table>
+        </td>
+        <td class="main" align="center" valign="middle">
+          <font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" color="red"><b><?php echo HEADING_INSTRUCT1 ?></b></font><br><br>
+          <?php echo HEADING_INSTRUCT2 ?>
+
+        </td>
+       </tr>
+      </table>
+      </td>
+    </tr>
+  </table></td>
+      </tr>
+<!-- End Addresses Block -->
+
+      <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+<!-- Begin Phone/Email Block -->
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+          <tr>
+            <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>
+            <td class="main"><input name='update_customer_telephone' size='15' value='<?php echo $order->customer['telephone']; ?>'></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
+            <td class="main"><input name='update_customer_email_address' size='35' value='<?php echo $order->customer['email_address']; ?>'></td>
+          </tr>
+               <tr>
+                <td class="main"><b><?php echo ENTRY_IPADDRESS; ?></b></td>
+                <td class="main"><?php echo $order->customer['ipaddy']; ?></td>
+    </tr>
+    <tr>
+    <td class="main"><b><?php echo ENTRY_IPISP; ?></b></td>
+    <td class="main"><?php echo $order->customer['ipisp']; ?></td>
+    </tr>
+        </table></td>
+      </tr>
+<!-- End Phone/Email Block -->
+
+      <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+<!-- Begin Payment Block -->
+      <tr>
+   <?php   
+    if (strtolower($order->info['payment_method']) == 'paypal') {
+
+include(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/TransactionSummaryLogs.inc.php');
+}
+if (strtolower($order->info['payment_method']) == 'ignore') 
+{
+}else{
+?> 
+  <td><table border="0" cellspacing="0" cellpadding="2" class="infoBox">
+    <tr valine="middle">
+      <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
+      <?php
+            //list exsisting payment if not in current order_pay_meahtods table
+                 $orders_pay_methodA[] = array('id'   => $order->info['payment_method'],
+                                                       'text' => $order->info['payment_method']);
+                          // check to see if meathod in totals  is in same as in order_pay_meahtods table
+                          // if false merge if true dont merge
+                          if (!array_intersect ($orders_pay_method, $orders_pay_methodA)){
+                         $orders_pay_method1 = array_merge($orders_pay_methodA, $orders_pay_method) ;
+                                  }else{
+                               $orders_pay_method1 = $orders_pay_method;
+                                  }
+    
+//begin PayPal_Shopping_Cart_IPN V3.15 DMG
+    
+
+
+//}//else not paypal
+//end PayPal_Shopping_Cart_IPN
+?>
+      <td class="main"><?php echo tep_draw_pull_down_menu('update_info_payment_method', $orders_pay_method1, $order->info['payment_method']); ?>
+      <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>
+      <?php
+      if($order->info['payment_method'] != "Credit Card")
+      echo TEXT_VIEW_CC;
+      ?>
+      <?php
+    if($order->info['payment_method'] != "Purchase Order")
+    echo TEXT_VIEW_PO;
+      ?>
+      </td>
+    </tr>
+
+  <?php if ($order->info['payment_method'] == "Credit Card") { ?>
+    <!-- Begin Credit Card Info Block -->
+    <tr>
+      <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+    </tr>
+    <tr>
+      <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td>
+      <td class="main"><input name='update_info_cc_type' size='10' value='<?php echo $order->info['cc_type']; ?>'></td>
+    </tr>
+    <tr>
+      <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td>
+      <td class="main"><input name='update_info_cc_owner' size='20' value='<?php echo $order->info['cc_owner']; ?>'></td>
+    </tr>
+    <tr>
+    <?php
+unset ($cc_number7) ;
+
+                   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{6})", $order->info['cc_number'])) && !($order->info['cc_number'] == '0000000000000000') ) { 
+                 $cc_number7 = $order->info['cc_number'];
+                 $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+              
+              }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{6})", $order->info['cc_number'])) ) {
+           $cc_number7 = cc_decrypt($order->info['cc_number']);
+           $text_encypt3= TEXT_CARD_ENCRPYT;
+          
+          }else if($order->info['cc_number'] == '0000000000000000') {
+            $cc_number7 = $order->info['cc_number'];
+          $text_encypt3= TEXT_CCV_REMOVED;
+ 
+           }else{
+            $cc_number7 = $order->info['cc_number'];
+            $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+                  }
+                  ?>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>
+      <td class="main"><input name='update_info_cc_number' size='20' value='<?php echo $cc_number7; ?>'></td>
+            <td class="main"><?php echo $text_encypt3; ?></td>
+          </tr>
+          <tr>
+       <?php
+                   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{4})", $order->info['cc_expires'])) ) { 
+                 $cc_expires7 = $order->info['cc_expires'];
+                 $text_encypt4 = TEXT_EXPIRES_NOT_ENCRPYT ;
+                
+              }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{4})", $order->info['cc_expires'])) && !($order->info['cc_expires'] == '')  ) {
+           $cc_expires7 = cc_decrypt($order->info['cc_expires']);
+           $text_encypt4= TEXT_EXPIRES_ENCRPYT;
+           
+          }else if($order->info['cc_expires'] == '') {
+           $cc_expires7 = $order->info['cc_expires'];
+           $text_encypt4 =  TEXT_EXPIRES_REMOVED ;
+           
+              }else{
+           $cc_expires7 =$order->info['cc_expires'];
+           $text_encypt4 =  TEXT_EXPIRES_NOT_ENCRPYT ;
+                  }
+                  ?>
+          
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td>
+      <td class="main"><input name='update_info_cc_expires' size='4' value='<?php echo $cc_expires7; ?>'></td>
+            <td class="main"><?php echo $text_encypt4; ?></td>
+
+          </tr>
+                    <tr>
+           <?php
+                 //    if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{4})", $order->info['cc_expires'])) ) { 
+
+                       if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{3})", substr($order->info['cc_ccv'], 0, 3))) ) {
+                     $cc_ccv7 = $order->info['cc_ccv'];
+                     $text_encypt5 = TEXT_CCV_NOT_ENCRPYT ;
+                           
+                  }else if ( (PAYMENT_CC_CRYPT == 'True') &&  !(ereg ("([0-9]{3})", substr($order->info['cc_ccv'], 0, 3))) && !($order->info['cc_ccv'] == '')  ) {
+               $cc_ccv7 = cc_decrypt($order->info['cc_ccv']);
+               $text_encypt5= TEXT_CCV_ENCRPYT;
+               
+              }else if($order->info['cc_ccv'] == '') {
+               $cc_ccv7 = $order->info['cc_ccv'];
+           $text_encypt5= TEXT_CCV_REMOVED;
+
+              }else {
+               $cc_ccv7 =$order->info['cc_ccv'];
+               $text_encypt5=  TEXT_CCV_NOT_ENCRPYT;
+                      }
+                      ?>
+              
+                <td class="main"><?php echo ENTRY_CREDIT_CARD_CCV; ?></td>
+                <td class="main"><input name='update_info_cc_ccv' size='4' value='<?php echo $cc_ccv7; ?>'></td>
+                <td class="main"><?php echo $text_encypt5; ?></td>
+    
+              </tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_START_DATE; ?></td>
+            <td class="main"><input name='update_info_cc_start' size='4' value='<?php echo $order->info['cc_start']; ?>'></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_ISSUE; ?></td>
+            <td class="main"><input name='update_info_cc_issue' size='4' value='<?php echo $order->info['cc_issue']; ?>'></td>
+          </tr>
+    <!-- End Credit Card Info Block -->
+    <?php
+        // purchaseorder start
+            } else if( (($order->info['account_name']) || ($order->info['account_number']) || $order->info['payment_method'] == "Purchase Order"|| ($order->info['po_number'])) ) {
+        ?>
+    <tr>
+          <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+    </tr>
+    <tr>
+    <td class="main" valign="top" align="left"><b><?php echo TEXT_INFO_PO ?></b></td>
+    <td>
+    <table border="0" cellspacing="0" cellpadding="2">
+    <tr>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><?php echo TEXT_INFO_NAME ?></td>
+      <td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><input type="text" name="account_name" value='<?php echo $order->info['account_name']; ?>'></td></td>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+    </tr>
+    <tr>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><?php echo TEXT_INFO_AC_NR ?></td>
+      <td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><input type="text" name="account_number" value='<?php echo $order->info['account_number']; ?>'></td>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+    </tr>
+    <tr>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><?php echo TEXT_INFO_PO_NR ?></td>
+      <td><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+      <td class="main"><input type="text" name="po_number" value='<?php echo $order->info['po_number']; ?>'></td>
+      <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+    </tr>
+   </table>
+   </td>
+     </tr>
+  <?php } }?>
+  </table></td>
+      </tr>
+<!-- End Payment Block -->
+   <?php
+     if ($abandoned == '1'){
+     ?>
+           <tr>     
+            <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+            <tr>
+              <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+      <td class="messageStackError"><?php echo HEADING_ABANDONED . $oID; ?></td></tr>
+      <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+    </table></td>
+   </tr>
+<?php 
+} else {
+?>
+      <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php
+}
+?>
+<!-- Begin Products Listing Block -->
+      <tr>
+  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+    <tr class="dataTableHeadingRow">
+      <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+      <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
+      <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_TAX; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_BASE_PRICE; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_UNIT_PRICE; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_PRICE; ?></td>
+    </tr>
+
+  <!-- Begin Products Listings Block -->
+  <?php
+        // Override order.php Class's Field Limitations
+    $index = 0;
+    $order->products = array();
+    $orders_products_query = tep_db_query("select * from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "'");
+    while ($orders_products = tep_db_fetch_array($orders_products_query)) {
+    $order->products[$index] = array('qty' => $orders_products['products_quantity'],
+                                        'name' => str_replace("'", "&#39;", $orders_products['products_name']),
+                                        'model' => $orders_products['products_model'],
+                                        'tax' => $orders_products['products_tax'],
+                                        'price' => $orders_products['products_price'],
+                                        'final_price' => $orders_products['final_price'],
+                                        'orders_products_id' => $orders_products['orders_products_id']);
+
+    $subindex = 0;
+    $attributes_query_string = "select * from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'";
+    $attributes_query = tep_db_query($attributes_query_string);
+
+    if (tep_db_num_rows($attributes_query)) {
+    while ($attributes = tep_db_fetch_array($attributes_query)) {
+      $order->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
+                                                               'value' => $attributes['products_options_values'],
+                                                               'prefix' => $attributes['price_prefix'],
+                                                               'price' => $attributes['options_values_price'],
+                                                               'orders_products_attributes_id' => $attributes['orders_products_attributes_id']);
+    $subindex++;
+    }
+    }
+    $index++;
+    }
+
+  for ($i=0; $i<sizeof($order->products); $i++) {
+    $orders_products_id = $order->products[$i]['orders_products_id'];
+
+    $RowStyle = "dataTableContent";
+
+    echo '    <tr class="dataTableRow">' . "\n" .
+       '      <td class="' . $RowStyle . '" valign="top" align="right">' . "<input name='update_products[$orders_products_id][qty]' size='2' value='" . $order->products[$i]['qty'] . "'>&nbsp;x</td>\n" .
+       '      <td class="' . $RowStyle . '" valign="top">' . "<input name='update_products[$orders_products_id][name]' size='25' value='" . $order->products[$i]['name'] . "'>";
+
+    // Has Attributes?
+    if (sizeof($order->products[$i]['attributes']) > 0) {
+      for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) {
+        $orders_products_attributes_id = $order->products[$i]['attributes'][$j]['orders_products_attributes_id'];
+        echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ' : ' . $order->products[$i]['attributes'][$j]['value'] . ' ' . $order->products[$i]['attributes'][$j]['prefix'] . ' ' . $currencies->format($order->products[$i]['attributes'][$j]['price']) ;
+        echo '</i></small></nobr>';
+      }
+    }
+
+    echo '      </td>' . "\n" .
+         '      <td class="' . $RowStyle . '" valign="top">' . "<input name='update_products[$orders_products_id][model]' size='12' value='" . $order->products[$i]['model'] . "'>" . '</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="center" valign="top">' . "<input name='update_products[$orders_products_id][tax]' size='3' value='" . tep_display_tax_value($order->products[$i]['tax']) . "'>" . '%</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="right" valign="top">' . "<input name='update_products[$orders_products_id][price]' size='5' value='" . number_format($order->products[$i]['price'], 2, '.', '') . "'>" . '</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="right" valign="top">' . "<input name='update_products[$orders_products_id][final_price]' size='5' value='" . number_format($order->products[$i]['final_price'], 2, '.', '') . "'>" . '</td>' . "\n" .
+         '      <td class="' . $RowStyle . '" align="right" valign="top">' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
+         '    </tr>' . "\n";
+  }
+  ?>
+   <?php
+     if ($abandoned == '1'){
+     ?>
+<tr><td><!-- Display basket --><?php echo DISPLAY_BASKET?></td></tr>
+   <?php
+}
+     ?>
+
+  <!-- Begin Order Total Block -->
+    <tr>
+      <td align="right" colspan="7">
+        <table border="0" cellspacing="0" cellpadding="2" width="100%">
+        <tr>
+        <td align='center' valign='top'><br><?php echo '<a href="' . tep_href_link(FILENAME_EDIT_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=add_product&step=1') . '">'. tep_image_button('button_add_product.gif', 'Add a product') . '&nbsp;</a></td>' ;?>
+        <td align='right'>
+        <table border="0" cellspacing="0" cellpadding="2">
+<?php
+
+        // Override order.php Class's Field Limitations
+    $totals_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' order by sort_order");
+    $order->totals = array();
+    while ($totals = tep_db_fetch_array($totals_query)) { $order->totals[] = array('title' => $totals['title'], 'text' => $totals['text'], 'class' => $totals['class'], 'value' => $totals['value'], 'orders_total_id' => $totals['orders_total_id']); }
+
+  $TotalsArray = array();
+  for ($i=0; $i<sizeof($order->totals); $i++) {
+    $TotalsArray[] = array("Name" => $order->totals[$i]['title'], "Price" => number_format($order->totals[$i]['value'], 2, '.', ''), "Class" => $order->totals[$i]['class'], "TotalID" => $order->totals[$i]['orders_total_id']);
+    $TotalsArray[] = array("Name" => "          ", "Price" => "", "Class" => "ot_custom", "TotalID" => "0");
+  }
+
+  array_pop($TotalsArray);
+  foreach($TotalsArray as $TotalIndex => $TotalDetails)
+  {
+    $TotalStyle = "smallText";
+    if(($TotalDetails["Class"] == "ot_subtotal") || ($TotalDetails["Class"] == "ot_total"))
+    {
+      echo  '       <tr>' . "\n" .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Price"] .
+            "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+            "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" .
+            "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+        '       </tr>' . "\n";
+    }
+    elseif($TotalDetails["Class"] == "ot_customer_discount")
+        {
+          echo  '       <tr>' . "\n" .
+            '   <td class="main" align="right">' . ENTRY_CUSTOMER_DISCOUNT . '<b>' . $TotalDetails["Name"] . '</b></td>' .
+            '   <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value=' " . $TotalDetails["Price"] . "'>" .
+                    "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+                "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+                "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+            '       </tr>' . "\n";
+    }
+
+    elseif(($TotalDetails["Class"] == "ot_gv") || ($TotalDetails["Class"] == "ot_coupon"))
+        {
+          echo  '       <tr>' . "\n" .
+            '   <td class="main" align="right">' . ENTRY_CUSTOMER_GV . '<b>' . $TotalDetails["Name"] . '</b></td>' .
+            '   <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value=' " . $TotalDetails["Price"] . "'>" .
+                    "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+                "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+                "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+            '       </tr>' . "\n";
+    }
+    elseif($TotalDetails["Class"] == "ot_tax")
+    {
+      echo  '       <tr>' . "\n" .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
+        '   <td class="main" align="right"><b>' . $TotalDetails["Price"] .
+                        "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' >" .
+            "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" .
+            "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' .
+        '       </tr>' . "\n";
+    }
+        //  Shipping
+    elseif($TotalDetails["Class"] == "ot_shipping")
+    { 
+      //list exsisting shipping if not in current order_ship_meahtods table
+           $orders_ship_methodA[] = array('id'   => $TotalDetails["Name"],
+                                                    'text' => $TotalDetails["Name"]);
+          
+                  //  $orders_ship_method1 = array_merge($orders_ship_method, $orders_ship_methodA) ;
+                  // check to see if meathod in totals  is in same as in order_ship_meahtods table
+                          // if false merge if true dont merge
+
+                         $orders_ship_method1 = array_merge($orders_ship_methodA, $orders_ship_method) ;
+     
+    
+      echo  ' <tr>' . "\n" .
+          '       <td align="right" class="' . $TotalStyle . '"><b><?php echo HEADING_SHIPPING ?></b>' . tep_draw_pull_down_menu('update_totals[$TotalIndex][title]', $orders_ship_method1, $TotalDetails["Name"]) . '</td>' . "\n";
+      echo  ' <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value='" . $TotalDetails["Price"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][class]' value='" . $TotalDetails["Class"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</td>' .
+        '       </tr>' . "\n";
+    }
+    // End Shipping
+    else
+    {
+      echo  '       <tr>' . "\n" .
+          '   <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' .
+        '   <td align="right" class="' . $TotalStyle . '">' . "<input type='hidden' name='update_totals[$TotalIndex][value]' size='6' value='" . $TotalDetails["Price"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][title]' value='" . trim($TotalDetails["Name"]) . "' >" .
+            "<input type='hidden' name='update_totals[$TotalIndex][class]' value='" . $TotalDetails["Class"] . "'>" .
+            "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" .
+            '</td>' . "\n" .
+        '       </tr>' . "\n";
+    }
+  }
+?>
+        </table>
+        </td>
+        </tr>
+        </table>
+      </td>
+    </tr>
+  <!-- End Order Total Block -->
+
+  </table></td>
+      </tr>
+
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+      <tr>
+        <td class="main"><table border="1" cellspacing="0" cellpadding="5">
+          <tr>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>
+            <?php if($CommentsWithStatus) { ?>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+            <?php } ?>
+          </tr>
+<?php
+    $orders_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
+    if (tep_db_num_rows($orders_history_query)) {
+      while ($orders_history = tep_db_fetch_array($orders_history_query)) {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
+             '            <td class="smallText" align="center">';
+        if ($orders_history['customer_notified'] == '1') {
+          echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
+        } else {
+          echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
+        }
+        echo '            <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n";
+
+        if($CommentsWithStatus) {
+        echo '            <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . '&nbsp;</td>' . "\n";
+        }
+
+        echo '          </tr>' . "\n";
+      }
+    } else {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
+             '          </tr>' . "\n";
+    }
+?>
+        </table></td>
+      </tr>
+
+      <tr>
+        <td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+      </tr>
+      <tr>
+        <td class="main">
+        <?php
+        if($CommentsWithStatus) {
+          echo tep_draw_textarea_field('comments', 'soft', '60', '5');
+  }
+  else
+  {
+    echo tep_draw_textarea_field('comments', 'soft', '60', '5', $order->info['comments']);
+  }
+  ?>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', false); ?></td>
+          </tr>
+          <?php if($CommentsWithStatus) { ?>
+          <tr>
+                <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', false); ?></td>
+          </tr>
+          <?php } ?>
+        </table></td>
+      </tr>
+
+      <tr>
+  
+  <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_EDIT_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=deleteccinfo') . '">' . tep_image_button('button_removeccinfo.gif', RemoveCVV) . '&nbsp;</a>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')),  'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+  </tr>
+  <tr>
+  <td colspan="2" align="right"><?php 
+  if (isset($HTTP_GET_VARS[tep_session_name()])) {
+    $oscid = '&' . tep_session_name() . '=' . $HTTP_GET_VARS[tep_session_name()];
+  } else {
+    $oscid = '';
+  }
+  echo ' </a> <a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . $oscid . '\')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a><a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . $oscid . '\')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>'; ?></td>
+    </tr>
+      </form>
+<?php
+  }
+
+if($action == "add_product")
+{
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo ADDING_TITLE; ?> #<?php echo $oID; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action', 'add_product')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+  // ############################################################################
+  //   Get List of All Products
+  // ############################################################################
+
+    $result = tep_db_query("SELECT products_name, p.products_id, cd.categories_name, ptc.categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id=ptc.categories_id and ptc.products_id=p.products_id and p.products_status = '1' and p.products_id=pd.products_id and pd.language_id = '" . (int)$languages_id . "' ORDER BY cd.categories_name");
+    while($row = tep_db_fetch_array($result))
+    {
+      extract($row,EXTR_PREFIX_ALL,"db");
+      $ProductList[$db_categories_id][$db_products_id] = $db_products_name;
+      $CategoryList[$db_categories_id] = $db_categories_name;
+      $LastCategory = $db_categories_name;
+    }
+
+    // ksort($ProductList);
+
+    $LastOptionTag = "";
+    //$ProductSelectOptions = "<option value='0'>Don't Add New Product" . $LastOptionTag . "\n";
+    $ProductSelectOptions = "<option value='0'>".DONT_ADD_NEW_PRODUCT . $LastOptionTag . "\n";
+    $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
+    foreach($ProductList as $Category => $Products)
+    {
+      $ProductSelectOptions .= "<option value='0'>$Category" . $LastOptionTag . "\n";
+      $ProductSelectOptions .= "<option value='0'>---------------------------" . $LastOptionTag . "\n";
+      asort($Products);
+      foreach($Products as $Product_ID => $Product_Name)
+      {
+        $ProductSelectOptions .= "<option value='$Product_ID'> &nbsp; $Product_Name" . $LastOptionTag . "\n";
+      }
+
+      if($Category != $LastCategory)
+      {
+        $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
+        $ProductSelectOptions .= "<option value='0'>&nbsp;" . $LastOptionTag . "\n";
+      }
+    }
+
+
+  // ############################################################################
+  //   Add Products Steps
+  // ############################################################################
+
+    print "<tr><td><table border='0'>\n";
+
+    // Set Defaults
+      if(!IsSet($add_product_categories_id))
+      $add_product_categories_id = 0;
+
+      if(!IsSet($add_product_products_id))
+      $add_product_products_id = 0;
+
+    // Step 1: Choose Category
+      print "<tr class=\"dataTableRow\"><form action='" . tep_href_link(FILENAME_EDIT_ORDERS, 'oID='.$oID.'&action=add_product') . "' method='POST'>\n";
+      print "<td class='dataTableContent' align='right'><b><?php echo TEXT_ADD_PROD_STEP1 ?></b></td><td class='dataTableContent' valign='top'>";
+
+      $tree = tep_get_category_tree();
+      $dropdown= tep_draw_pull_down_menu('add_product_categories_id', $tree, '', ''); //single
+      echo $dropdown;
+      
+      // print "<select name='add_product_categories_id'>\n";
+      // $CategoryOptions = "<option value='0'> TEXT_ADD_CAT_CHOOSE ";
+      // foreach($CategoryList as $CategoryID => $CategoryName)
+      // {
+      // $CategoryOptions .= "<option value='$CategoryID'> $CategoryName\n";
+      // }
+
+      $CategoryOptions = str_replace("value='$add_product_categories_id'","value='$add_product_categories_id' selected", $CategoryOptions);
+      print $CategoryOptions;
+      print "</td>\n";
+      print "<td class='dataTableContent' align='center'><input type='submit' value='" . TEXT_SELECT_CAT . "'>";
+      print "<input type='hidden' name='step' value='2'>";
+      print "</td>\n";
+      print "</form></tr>\n";
+
+      print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
+
+    // Step 2: Choose Product
+    if(($step > 1) && ($add_product_categories_id > 0))
+    {
+      print "<tr class=\"dataTableRow\"><form action='" . tep_href_link(FILENAME_EDIT_ORDERS, 'oID='.$oID.'&action='.$action) . "' method='POST'>\n";
+      print "<td class='dataTableContent' align='right'><b><?php echo TEXT_ADD_STEP2 ?></b></td><td class='dataTableContent' valign='top'><select name='add_product_products_id'>";
+      $ProductOptions = "<option value='0'> " . TEXT_ADD_PROD_CHOOSE;
+      asort($ProductList[$add_product_categories_id]);
+      foreach($ProductList[$add_product_categories_id] as $ProductID => $ProductName)
+      {
+      $ProductOptions .= "<option value='$ProductID'> $ProductName\n";
+      }
+      $ProductOptions = str_replace("value='$add_product_products_id'","value='$add_product_products_id' selected", $ProductOptions);
+      print $ProductOptions;
+      print "</select></td>\n";
+      print "<td class='dataTableContent' align='center'><input type='submit' value='" . TEXT_SELECT_PROD . "'>";
+      print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
+      print "<input type='hidden' name='step' value='3'>";
+      print "</td>\n";
+      print "</form></tr>\n";
+
+      print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
+    }
+
+    
+    
+    // Step 3: Choose Options
+
+// Eversun mod for show product price
+    if ($add_product_products_id > 0) {
+      $rs_special = tep_db_query("select * from specials where products_id ='". $add_product_products_id."' and status = 1 "  );
+      $special = tep_db_fetch_array($rs_special);
+      if ($special) {
+        $p_products_price = $currencies->format($special['specials_new_products_price']);
+      } else {
+        $rs_price = tep_db_fetch_array(tep_db_query("select products_price from " . TABLE_PRODUCTS . " where products_id = '" . $add_product_products_id . "'"));
+        $p_products_price = $currencies->format($rs_price['products_price']);
+      }
+    } else {
+      $p_products_price = '';
+    }
+// Eversun mod end for show product price
+    
+    echo TEXT_ADD_PROD . $add_product_products_id . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Price: ' . $p_products_price;
+    if(($step > 2) && ($add_product_products_id > 0))
+    {
+      // Get Options for Products
+$result = tep_db_query("SELECT * FROM
+" . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+" . TABLE_PRODUCTS_OPTIONS . " po,
+" . TABLE_PRODUCTS_OPTIONS_TEXT . " pot,
+" . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
+WHERE
+pa.options_id = po.products_options_id and
+pa.options_id = pot.products_options_text_id and
+pa.options_values_id =pov.products_options_values_id and
+products_id ='$add_product_products_id' ");
+
+
+      // Skip to Step 4 if no Options
+      if(tep_db_num_rows($result) == 0)
+      {
+        echo "<tr class=\"dataTableRow\">\n";
+        echo "<td class='dataTableContent' align='right'><b>" . TEXT_ADD_STEP3  . "</b></td><td class='dataTableContent' valign='top' colspan='2'><i>" . TEXT_SELECT_OPT_SKIP . "</i></td>";
+        echo "</tr>\n";
+        $step = 4;
+      }
+      else
+      {
+        while($row = tep_db_fetch_array($result))
+        {
+          extract($row,EXTR_PREFIX_ALL,"db");
+          $Options[$db_products_options_id] = $db_products_options_name;
+          $ProductOptionValues[$db_products_options_id][$db_products_options_values_id] = $db_products_options_values_name;
+        }
+                                 echo '<tr class=\"dataTableRow\">' . tep_draw_form('select_product', FILENAME_EDIT_ORDERS, 'oID='.$oID . '&action=add_product', 'post', '', 'SSL') . "\n";
+
+        print "<td class='dataTableContent' align='right'><b>" . TEXT_ADD_STEP3 . "</b></td><td class='dataTableContent' valign='top'>";
+        foreach($ProductOptionValues as $OptionID => $OptionValues)
+        {
+        
+          $OptionOption = "<b>" . $Options[$OptionID] . "</b> - <select name='add_product_options[$OptionID]'>";
+          foreach($OptionValues as $OptionValueID => $OptionValueName)
+          {
+          
+      //get price 
+      $price_query = tep_db_query("SELECT * FROM
+      " . TABLE_PRODUCTS_ATTRIBUTES . " pa
+      WHERE
+      pa.products_attributes_id = '" . $row['products_attributes_id'] . "' and
+      pa.options_values_id = $OptionValueID
+      ");
+        while($price_array = tep_db_fetch_array($price_query))
+        {
+
+        $option_price = $price_array['options_values_price'];
+        $option_price1 = ' ' . $price_array['price_prefix'] . ' ' . $currencies->format($option_price);
+                                }
+          $OptionOption .= "<option value='$OptionValueID'> $OptionValueName $option_price1 \n";
+          }
+          $OptionOption .= "</select><br>\n";
+
+          if(IsSet($add_product_options))
+          $OptionOption = str_replace("value='" . $add_product_options[$OptionID] . "'","value='" . $add_product_options[$OptionID] . "' selected",$OptionOption);
+
+          print $OptionOption;
+        }
+        print "</td>";
+        print "<td class='dataTableContent' align='center'><input type='submit' value='".SELECT_THESE_OPTIONS."'>";
+        print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
+        print "<input type='hidden' name='add_product_products_id' value='$add_product_products_id'>";
+        print "<input type='hidden' name='step' value='4'>";
+        print "</td>\n";
+        print "</form></tr>\n";
+      }
+
+      print "<tr><td colspan='3'>&nbsp;</td></tr>\n";
+    }
+
+    // Step 4: Confirm
+    if($step > 3)
+    {
+    
+         echo '<tr class=\"dataTableRow\">' . tep_draw_form('select_product', FILENAME_EDIT_ORDERS, 'oID='.$oID . '&action=add_product', 'post', '', 'SSL') . "\n";
+                      //  echo "<tr class=\"dataTableRow\"><form action='$PHP_SELF?oID=$oID&action=$action' method='POST'>\n";
+      print "<td class='dataTableContent' align='right'><b>" . TEXT_ADD_STEP4 . "</b></td>";
+      print "<td class='dataTableContent' valign='top'><input name='add_product_quantity' size='2' value='1'>" . TEXT_ADD_QUANTITY . "</td>";
+      print "<td class='dataTableContent' align='center'><input type='submit' value='" . TEXT_ADD_NOW . "'>";
+
+      if(IsSet($add_product_options))
+      {
+        foreach($add_product_options as $option_id => $option_value_id)
+        {
+          echo "<input type='hidden' name='add_product_options[$option_id]' value='$option_value_id'>";
+        }
+      }
+      print "<input type='hidden' name='add_product_categories_id' value='$add_product_categories_id'>";
+      print "<input type='hidden' name='add_product_products_id' value='$add_product_products_id'>";
+      print "<input type='hidden' name='step' value='5'>";
+      print "</td>\n";
+      print "</form></tr>\n";
+    }
+
+    print "</table></td></tr>\n";
+}
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php
+require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/edit_textdata.php
===================================================================
--- trunk/direct.openmoko.com/admin/edit_textdata.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/edit_textdata.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,595 @@
+<?php
+// edit_languages.php
+// A module of OSCommerce
+//
+// Version 1.00
+// 
+// Author: Julian Brown
+// Copyright (c) 2003 JLB Professional Services Inc.
+// Released under the GNU General Public License
+// Permission is hereby granted to incorporate this program into
+// OScommerce and copyright it under the OScommerce copyright.
+// Please notify me that you have.
+//
+// Julian Brown
+// julian at jlbprof.com
+//
+
+
+require('includes/application_top.php');
+
+//constants
+  $fs_dir = DIR_FS_CATALOG.DIR_WS_LANGUAGES;
+  $ws_dir = DIR_WS_CATALOG.DIR_WS_LANGUAGES;
+  $dir1 = $fs_dir ;
+  $dir_language = $fs_dir;
+  
+  //build language array for drop down
+    $languages_array1 = array();
+    $languages = tep_get_languages();
+    $lng_exists = false;
+    for ($i = 0, $n = sizeof($languages); $i < $n; $i++)
+    {
+        if ($languages[$i]['directory'] == ('lngdir'))
+            $lng_exists = true;
+
+        $languages_array1[] = array('id' => $languages[$i]['directory'],
+                                 'text' => $languages[$i]['name']);
+    }
+
+    if (!$lng_exists)
+    {
+        $HTTP_POST_VARS ['lngdir'] = $language;
+        $HTTP_GET_VARS ['lngdir'] = $language;
+    }
+  
+  
+//set language
+ if ($lng == '' ){
+$language_edit = $language;
+$lng = $language;
+}else{
+$language_edit = $lng;
+//$lng = $current_language;
+  }
+ 
+$file_list1 = '' ;
+$file_list2 = $language_edit . '/';
+$file_list3 = $language_edit . '/modules/' ;
+$file_list4 = $language_edit . '/modules/order_total/' ;
+$file_list5 = $language_edit . '/modules/payment/' ;
+$file_list6 = $language_edit . '/modules/shipping/' ;
+$file_list7 = $language_edit . '/modules/wishlist/' ;
+
+   
+// set these variables, so none can get passwords... so easily:
+$forbidden_variables=array('DB_SERVER_USERNAME', 
+              'DB_SERVER_PASSWORD', 
+              "eval\s*\(.*?\)", 
+              "system\s*\(.*?\)", 
+              "execute\s*\(.*?\)", 
+              "eval\s*\(.*?\)" );
+require('includes/functions/edit_text.php');
+$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');    
+              
+    global $language_edits_array;
+    global $HTTP_GET_VARS;
+    global $HTTP_POST_VARS;
+
+if ($action == 'restore'){
+            $backup = getVAR ('backup');
+            $file   = getVAR ('file');
+            copy ($backup, $file);
+}
+//create new language define file
+if ($action == 'create_new'){
+    if (file_exists ($crypt_file_base)) {
+     //create key file
+     if (!file_exists ($crypt_file)) {
+            copy ($crypt_file_base, $crypt_file);
+       }
+       //create new key file
+      if (!file_exists ($crypt_file_new)) {
+          copy ($crypt_file_base1, $crypt_file_new);
+        }
+      }  
+  }
+ //create new language define In file
+if ($action == 'create_new_define'){ 
+  }
+  
+if ($action == 'save'){
+  $filename1 = $filename;
+  $file11 = $dir1 . $lngdir . $filename;
+    if (!$skip)
+      {
+        if (file_exists ($file))
+        {
+            $backup = $file11 . ".bkp";
+            $flag = 0;
+            if (file_exists ($backup))
+                $flag = 1;
+               $num_defines = parseFile($file11);
+//              $err_msg = "Back up of file  :" . $file11 ;
+  }
+}
+
+            if (!is_writeable ($file11))
+            {
+$err_msg = ERROR_TEXT_FILE_LOCKED . "ZZ:" . $filename  . " : " .  $file11 . ":";
+            }
+            else
+            {
+                $num_defines = getVAR ('num_defines');
+                $idx = 0;
+                $string1 = "start_" . $idx;
+               // $start_line = $string;
+                $start_line = $HTTP_POST_VARS[$string1];
+               
+                $string2 = "end_" . $idx;
+                $end_line = $HTTP_POST_VARS[$string2];
+
+                $string3 = "name_" . $idx;
+                //$name = $string;
+                $name = $HTTP_POST_VARS[$string3];
+                
+                $string4 = "text_" . $idx;
+               $text = $HTTP_POST_VARS[$string4];
+              // $text = str_replace("'", "\\'", $HTTP_POST_VARS[$string4]);
+
+                // OK to save the changes, we will open the file and
+                // read in one line at a time, till we get to the first
+                // start_line of the first define, we then write out the
+                // value of the define out, till the end_line, then start
+                // outputting data again till the next define.
+                // The defines must be in ascending order.
+                //
+                // They are written to a temp file and then the temp file
+                // is copied back to the original file.
+                //
+                //
+                $temp_fname = tempnam ("", "edit_");
+                $fin = fopen ($file11, "rb");
+                $fout = fopen ($temp_fname, "wb");
+                $line_no = 0;
+                while (!feof ($fin))
+                {
+                    $line = fgets ($fin);
+        $xline = $line;
+                    $line = strip_crlf ($line);
+                    $line_no ++;
+                    if ($start_line == -1 ||
+                       $line_no < $start_line)
+                    {
+                        fwrite ($fout, $xline);
+                        continue;
+                    }
+                    if ($line_no == $end_line)
+                    {
+                        // output the define statement
+
+                        $string = "define('" . $name . "', ";
+ // single quote as an apostrophy
+                        if ( (strstr($text,"'")) && (strstr($text,".")) )
+                        {
+              // if the string has a quote inside it will be written like it is 
+              // (with quotes at start and end)
+              
+              // all quotes have been slashed and only quotes, that follow a "." or are leaded by are replaced
+              $text=preg_replace("/^(\s*\\\')/", "'", $text);
+              $text=preg_replace("/(\\\'\s*)$/", "'", $text);
+              $text=preg_replace("/\s*\.\s*\\\'/", " . '", $text);
+              $text=preg_replace("/\\\'\s*\.\s*/", "' . ", $text);
+              //foreach($forbidden_variables as $forbidden){
+              //$text=preg_replace("/".$forbidden."/i", "____", $text);
+              
+              //}
+                             $string .= $text . ");\n";
+                        }
+                        else
+                        {
+                            $string .= "'" . $text . "');\n";
+                        }
+                        fwrite ($fout, $string);
+                        // now get the next define
+                        $idx ++;
+                        if ($idx >= $num_defines)
+                        {
+                            $start_line = -1;
+                        }
+                        else
+                        {
+                            $string11 = "start_" . $idx;
+                            $start_line = getVAR ($string11);
+                            $string21 = "end_" . $idx;
+                            $end_line = getVAR ($string21);
+                            $string31 = "name_" . $idx;
+                            $name = getFromQuery ($string31);
+                            $string41 = "text_" . $idx;
+                            $text = $HTTP_POST_VARS[$string41] ;
+                           //  $text = str_replace("'", "\\'", $HTTP_POST_VARS[$string4]);
+                           // $text = str_replace("'", "\\'", str_replace("\\", "\\\\", $HTTP_POST_VARS[$string41]));
+                        }
+                    }
+                }
+                fclose ($fin);
+                fclose ($fout);
+                // save a copy of the original
+                $backup = $file11 . ".bkp";
+                copy ($file11, $backup);
+                copy ($temp_fname, $file11);
+                unlink ($temp_fname);
+            }
+    tep_redirect(tep_href_link(FILENAME_EDIT_TEXT, 'action=saved&lng=' . $lng . '&lngdir=' . $lngdir . '&filename=' . $filename ));
+     //    echo  '<br>text= ' . $text . ' string ' . $string ; 
+        }
+
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>"
+<!-- left_navigation //-->
+<?php
+
+ echo "<table border=\"0\" width=\"" . BOX_WIDTH . "\" cellspacing=\"1\" cellpadding=\"1\" class=\"columnLeft\"> ";
+ require(DIR_WS_INCLUDES . 'column_left.php');
+
+?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php
+         if (isset($err_msg)){
+         ?>
+                <td colspan=10><?php echo sprintf(ERROR_TEXT_FILE_LOCKED, $err_msg)?></td>
+<?php
+}
+          echo tep_draw_form('lng', FILENAME_EDIT_TEXT, '', 'post');
+
+
+?>         <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+
+         <td class="main"><?php echo  tep_draw_pull_down_menu('lng', $languages_array1, '', 'onChange="this.form.submit();"'); ?>
+              </form>
+                </td>
+            <td colspan="6" class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', HEADING_IMAGE_HEIGHT); ?></td>
+     <?php  if ($err_msg) { ;?>
+        <tr><td colspan="6">><?php echo $err_msg ;?></td></tr>
+    <?php  } ;?>        
+        </tr>
+        </table></td>
+      </tr>
+      <tr>
+           <tr>
+             <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+               
+                   <table>
+                 </td>
+                 </tr>
+                  <tr>
+                  <td valign="top">
+                  <?php //  add if to detect which screen on 
+                
+       if ( ($action == 'edit') || ($action == 'saved') || ($action == 'restore') ){  
+                       
+               echo tep_draw_form('search', FILENAME_EDIT_TEXT, 'action=search&lng=' . $lng, 'post', '', 'SSL'); ?>
+                          <input type=hidden name="lngdir" value="<?php echo $lngdir ; ?>">
+                          <input type=hidden name="filename" value="<?php echo $filename ; ?>">
+                          <input type=hidden name="type" value="file">
+                          <?php // echo tep_draw_input_field('search')   ;
+        } else {
+       
+                echo tep_draw_form('search', FILENAME_EDIT_TEXT, 'action=search&lng=' . $lng, 'post', '', 'SSL'); ?>
+                    <input type=hidden name="lngdir" value="<?php echo $lngdir ; ?>">
+                    <input type=hidden name="filename" value="<?php echo $filename ; ?>">
+                    <input type=hidden name="type" value="dir">
+                   <?php // echo tep_draw_input_field('search') ;
+                 }
+               ; ?>
+       
+                   </td>
+                   <td>
+              <?php // echo tep_image_submit('button_search.gif', IMAGE_SEARCH);?>
+                </form>
+                  </td>
+                  <td valign="top">
+             <?php echo tep_draw_separator('pixel_trans.gif', '1', '25'); ?>     
+                  </td>
+                  <td>
+              <?php echo tep_draw_form('return', FILENAME_EDIT_TEXT, '&lng=' . $lng, 'post', '', 'SSL');?>
+              <?php echo tep_image_submit('button_return.gif', IMAGE_RETURN) ; ?>
+                     </form>
+                   </td>
+                   <td valign="top">
+              <?php // help button
+           if ( ($action == 'edit') || ($action == 'saved') || ($action == 'restore') ){  
+                     echo tep_draw_form('help', FILENAME_EDIT_TEXT_HELP, '&help_id=2', 'post', '', 'SSL');
+                    echo tep_image_submit('button_help.gif', IMAGE_HELP) ; 
+                    echo  '</form>';
+                    
+              } else { ;
+               echo tep_draw_form('help', FILENAME_EDIT_TEXT_HELP, '&help_id=1', 'post', '', 'SSL');
+               echo tep_image_submit('button_help.gif', IMAGE_HELP) ; 
+                    echo  '</form>';
+                  }
+                  ?>
+                   </td>
+                   <td>
+                 </td>
+                </tr>
+        
+              </table
+            </td> 
+           </tr>
+
+         <tr>
+           <td colspan="3">
+             <table width="100%" border="0" cellspacing="0" cellpadding="0">
+        
+<?php
+echo '<tr><td> List file in: </td></tr><tr>';
+echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $file_list1 ) . '" title="' . $file . '"> '.TEXT_LANGUGES.' </a></td>' . "\n";
+echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $file_list2 ) . '" title="' . $file . '">'. $file_list2 . '</a></td>' . "\n";
+echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $file_list3 ) . '" title="' . $file . '">'. $file_list3 . '</a></td>' . "\n";
+echo '</tr><tr><td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $file_list4 ) . '" title="' . $file . '">'. $file_list4 . '</a></td>' . "\n";
+echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $file_list5 ) . '" title="' . $file . '">'. $file_list5 . '</a></td>' . "\n";
+echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $file_list6 ) . '" title="' . $file . '">'. $file_list6 . '</a></td>' . "\n";
+echo '</tr><tr>';
+
+?>
+ </table>
+   </td>
+    </tr>
+
+<tr><td colspan="5" width="100%"><?php echo tep_draw_separator('pixel_black.gif', '100%', '2'); ?></td>
+
+  </tr>
+  <tr>
+        <tr>
+               <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+<?php
+//if no action then do list of directory
+if (($action == '')||($action == 'create') || ($action == 'search') ){
+if ($lngdir == '') {
+//echo '<td>List 1 langdir ' . $lngdir . ' type ' . $type . ' action ' . $action . '</td>';
+
+   echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $lngdir . '&action=edit&filename=' . $language_edit . '.php') . '" title="' . $language_edit . '.php">'  . $language_edit . '.php' . '</a></td>' . "\n" ;
+   echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $lngdir . '&action=edit&filename=affiliate_' . $language_edit . '.php') . '" title="affiliate_' . $language_edit . '.php">'  . 'affiliate_' . $language_edit . '.php' . '</a></td>' . "\n" ;
+   echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $lngdir . '&action=edit&filename=add_ccgvdc_' . $language_edit . '.php') . '" title="add_ccgvdc_' . $language_edit . '.php">add_ccgvdc_'  . $language_edit . '.php' . '</a></td>' . "\n" ;
+   echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $lngdir . '&action=edit&filename=' . $language_edit . '_newsdesk.php') . '" title="' . $language_edit . '_newsdesk.php">'  . $language_edit . '_newsdesk.php' . '</a></td>' . "\n" ;
+   echo '<td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, '&lng=' . $lng . '&lngdir=' . $lngdir . '&action=edit&filename=' . $language_edit . '.php') . '" title="' . $language_edit . '_faqdesk.php">'  . $language_edit . '_faqdesk.php' . '</a></td>' . "\n" ;
+
+}else{
+//list 2
+//echo '<td>List 2 langdir ' . $lngdir . ' type ' . $type . ' action ' . $action . '</td>';
+
+     $file_list = dir(DIR_FS_CATALOG_LANGUAGES . '/'. $lngdir);
+     $left = true;
+
+     if ($file_list)
+     {
+         $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+         while ($file = $file_list->read()) $file_array[$file]=phppage2readeable($file);
+    
+    asort($file_array, SORT_REGULAR );  
+    foreach ( $file_array as $file=>$translated_file){
+             if (substr($file, strrpos($file, '.')) == $file_extension)
+             {
+                 if ( ($action == 'search') || ($type == 'dir') ){
+             //   echo $lngdir . $type . $action;
+                if (!stristr ($translated_file, $search)){
+                               continue;
+                  }
+              } 
+
+                 echo '                <td class="smallText"><a href="' .
+                     tep_href_link(FILENAME_EDIT_LANGUAGES, 'lngdir=' . $lngdir . '&action=edit&lng=' . $lng . '&filename=' . $file) . '" title="' . $file . '">' . ($translated_file) . '</a></td>' . "\n";
+                 if (!$left)
+                 {
+                     echo '              </tr>' . "\n" .
+                          '              <tr>' . "\n";
+                 }
+                 $left = !$left;
+             }
+         }
+         $file_list->close();
+     }
+}
+}
+
+if ( ($action == 'Search') || ($type == 'dir') ){
+
+            $lngdir   = getVAR ('lngdir');
+            $filename = getVAR ('filename');
+
+            // OK put together a list of files
+
+            $files = getFiles (DIR_FS_CATALOG_LANGUAGES . $lngdir);
+            $search = getVAR ('search');
+            $idx = 0;
+  }          
+ ?>
+  </td>
+  </tr>
+          </table>
+        </td>
+    </tr>
+ <?php  
+
+// if action is edit,save or restore show edit form
+ if ( ($action == 'edit') || ($action == 'saved') || ($action == 'restore') || ($action == 'search')){
+
+           $file15 = DIR_FS_CATALOG_LANGUAGES . $lngdir . $filename;
+    if (file_exists ($file15))
+              {
+                  $backup = $file15 . ".bkp";
+                  $flag = 0;
+                  if (file_exists ($backup))
+                      $flag = 1;
+                  $num_defines= parseFile($file15);
+                  
+      if  ( ($action == 'edit') || ($action == 'search') ) {
+         echo '<tr><td>' . TEXT_EDIT_FILE . $file15 . '</td></tr>';
+         }
+      if  ($action == 'restore') {
+    echo '<tr><td>' . TEXT_SAVE_FILE . $file15 . '</td></tr>';
+  }
+      if  ($action == 'saved') {
+   echo '<tr><td>' . TEXT_RESTORE_FILE  . $file15 . '</td></tr>';
+  }
+  
+  
+      if  ( ($action == 'saved') || ($action == 'restore') || ($action == 'search')) {
+         ?>
+         <tr>
+         <td>
+
+         
+                     <?php echo tep_draw_form('restore', FILENAME_EDIT_TEXT, '&action=restore&lng=' . $lng, 'post', '', 'SSL');?>
+                        <input type=hidden name="lngdir" value="<?php echo $lngdir ; ?>">
+                        <input type=hidden name="filename" value="<?php echo $filename ; ?>">
+                  <input type=hidden name="backup" value="<?php echo $backup; ?>">
+                  <input type=hidden name="file" value="<?php echo $file; ?>">
+                  <?php echo tep_image_submit('button_restore.gif', IMAGE_RESTORE) ; ?>              
+                </form>
+       
+         
+                     <?php echo tep_draw_form('cancel', FILENAME_EDIT_TEXT, '&action=edit&lng=' . $lng, 'post', '', 'SSL');?>
+                        <input type=hidden name="lngdir" value="<?php echo $lngdir ; ?>">
+                        <input type=hidden name="filename" value="<?php echo $filename ; ?>">
+                  <input type=hidden name="backup" value="<?php echo $backup; ?>">
+                  <input type=hidden name="file" value="<?php echo $file; ?>">
+                  <?php echo tep_image_submit('button_cancel.gif', IMAGE_CANCEL) ; ?>              
+                </form>
+          </td></tr>
+          
+        <?php
+           }   
+         ?>
+            <table border=0 cellpadding="1" cellspacing="0" >
+              <tr>
+                <td>&nbsp;&nbsp;<?php echo TEXT_DEFINE_LABEL ; ?>&nbsp;&nbsp;</td>
+    <td>&nbsp;&nbsp;<?php echo TEXT_DEFINE_TEXT ; ?>&nbsp;&nbsp;</td>
+              </tr>
+      <?php
+                  for ($i = 0; $i < $num_defines; ++$i)
+                  {
+                   if (($action == 'search') || ($type == 'file') ){
+                       if (!stristr ($defines [$i]['data'], $search)){
+                      // Echo 'No matching defines found' ;
+                       Echo TEXT_MSG_1 ;
+                        continue;
+                        }
+                       } 
+
+ ?>  
+               <tr>
+       <?php echo tep_draw_form('edit', FILENAME_EDIT_TEXT, '&action=save&lng=' . $lng, 'post', '', 'SSL');?>
+                       
+                          <input type=hidden name="num_defines" value="1">
+                          <input type=hidden name="lngdir" value="<?php echo $lngdir ; ?>">
+                          <input type=hidden name="filename" value="<?php echo $filename ; ?>">
+                          <input type=hidden name="name_0" value="<?php echo $defines[$i]['name']; ?>">
+                          <input type=hidden name="start_0" value="<?php echo $defines[$i]['start_line']; ?>">
+                          <input type=hidden name="end_0" value="<?php echo $defines[$i]['end_line']; ?>">
+                          <td class="smalltext">&nbsp;&nbsp;<?php
+                            echo $defines[$i]['name'];
+                            if ( $defines[$i]['disable'] ) echo '<br>' . sprintf(TEXT_MIXED_CONSTANT,'<a href="' . tep_href_link(FILENAME_EDIT_LANGUAGES, tep_get_all_get_params(array('lngdir')) . '&lngdir=' . $HTTP_GET_VARS['lngdir'] . '/') . '#advEditor">', '</a>' );
+                            ?>&nbsp;&nbsp;</td>
+                          <td>
+<?php
+              if (strlen($defines[$i]['data']) > 1000) {
+              $row_size = '25'; 
+              } elseif (strlen($defines[$i]['data']) > 500) {
+              $row_size ='15'; 
+              } else {
+              $row_size = '2';
+              };
+              $insert_start_line = $defines[$i]['start_line'] ;
+              $insert_end_line = $defines[$i]['end_line'];
+              if ( $defines[$i]['disable'] ) $disabled = 'disabled';
+              else  $disabled = '';;
+?>                  
+                            <TEXTAREA name="text_0" rows="<?php echo $row_size; ?>" cols="50" <?php echo $disabled; ?>><?php echo htmlspecialchars(stripslashes($defines[$i]['data'])); ?></TEXTAREA>
+                          </td>
+                          <td>
+<?php
+              if ( $defines[$i]['disable'] ) echo '&nbsp;';
+              else  echo tep_image_submit('button_save.gif', IMAGE_SAVE) ;
+?>
+                          </form>
+                          </tr>
+      <?php
+        }
+       ?>
+               <tr>  
+                <?php echo tep_draw_form('create_new_define', FILENAME_EDIT_TEXT, '&action=create_new_define&lng=' . $lng, 'post', '', 'SSL');?>
+                                   
+                          <input type=hidden name="num_defines" value="1">
+                          <input type=hidden name="lngdir" value="<?php echo $lngdir ; ?>">
+                          <input type=hidden name="filename" value="<?php echo $filename ; ?>">
+                          <input type=hidden name="start_0" value="<?php echo $insert_start_line + 1; ?>">
+                          <input type=hidden name="end_0" value="<?php echo $insert_end_line  + 1; ?>">
+              <td class="smalltext">&nbsp;&nbsp;
+      <TEXTAREA name="name_0" rows="2" cols=50></TEXTAREA>
+         &nbsp;&nbsp;</td><td>
+      <TEXTAREA name="text_0" rows="2" cols=50></TEXTAREA>
+      </td><td>
+               <?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT) ; ?>  
+                 </form>
+               </td></tr>  
+       <?php
+ echo '<!-- end edit-->' ;      
+   }  
+}
+//always show footer
+?>
+<!-- Begin_footer -->
+  <tr>
+<td colspan="5" width="100%"><?php echo tep_draw_separator('pixel_black.gif', '100%', '2'); ?></td>
+        </tr>
+
+             <tr>
+              <td>
+        <?php echo TEXT_HELP_HELP . '<br>'; 
+              echo TEXT_HELP_HELP1 . '<br>' ;
+              echo TEXT_HELP_HELP2 . '<br>';
+              echo TEXT_HELP_HELP3 . '<br>';
+              echo TEXT_HELP_HELP4 . '<br>';
+              echo TEXT_HELP_HELP5 ;
+         ;?>
+             <p><?php echo '<a name="advEditor" id="advEditor" href="' . tep_href_link(FILENAME_DEFINE_LANGUAGE, tep_get_all_get_params(array())) . '">' . TEXT_ADV_EDITOR . '</a>'; ?></p>
+             </td>
+            </tr>
+        </table></td>
+      </tr>
+    </table></td><!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/edit_textdata_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/edit_textdata_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/edit_textdata_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,137 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+<?php
+ require(DIR_WS_LANGUAGES . $language . '/help/edit_textdata_help.php') ;
+ if ($help_id == '1') {  
+define('HEADING_TITLE', HEADING_TITLE_01);
+}
+ if ($help_id == '2') {  
+define('HEADING_TITLE', HEADING_TITLE_02);
+}
+if ($help_id == '3') {  
+define('HEADING_TITLE', HEADING_TITLE_03);
+}
+ if ($help_id == '4') {  
+define('HEADING_TITLE', HEADING_TITLE_04);
+}
+if ($help_id == '5') {  
+define('HEADING_TITLE', HEADING_TITLE_05);
+}
+
+?>
+
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="menuBoxHeading">
+                         <tr>
+                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                       <tr>
+                         <td class="pageHeading"><?php echo HEADING_TITLE ; ?></td>
+                        </tr>
+                        <tr>
+                        <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                       </tr>
+                     </table></td>
+                   </tr>
+<tr class="attributeBoxContent">
+
+ <td>
+ <?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'  ; ?>
+</td>
+</tr>
+  <tr>
+    <td>
+            <b><!-- Language Editor Help Index --> <?php echo TEXT_MSG_1?> </b>
+            <br><a href="<?php echo tep_href_link(FILENAME_EDIT_TEXT_HELP, '&help_id=1') . '">'. MENU_ITEM_01 . '</a>' ;?>
+            <br><a href="<?php echo tep_href_link(FILENAME_EDIT_TEXT_HELP, '&help_id=2') . '">'. MENU_ITEM_02 . '</a>' ;?>
+      <br><a href="<?php echo tep_href_link(FILENAME_EDIT_TEXT_HELP, '&help_id=3') . '">'. MENU_ITEM_03 . '</a>' ;?>
+            <br><a href="<?php echo tep_href_link(FILENAME_EDIT_TEXT_HELP, '&help_id=4') . '">'. MENU_ITEM_04 . '</a>' ;?>
+            <br><a href="<?php echo tep_href_link(FILENAME_EDIT_TEXT_HELP, '&help_id=5') . '">'. MENU_ITEM_05 . '</a>' ;?>
+    </td>
+   </tr>
+    <tr>
+        <td>
+ <?php if ($help_id == '1') {  
+include(DIR_WS_LANGUAGES . $language . '/help/et/index.html') ;
+}
+ if ($help_id == '2') {  
+include(DIR_WS_LANGUAGES . $language . '/help/et/index2.html') ;
+}
+ if ($help_id == '3') {  
+include(DIR_WS_LANGUAGES . $language . '/help/et/index3.html') ;
+}
+ if ($help_id == '4') {  
+include(DIR_WS_LANGUAGES . $language . '/help/et/index4.html') ;
+}
+
+ if ($help_id == '5') {  
+include(DIR_WS_LANGUAGES . $language . '/help/et/index5.html') ;
+}
+
+
+?>
+
+</td>
+  </tr>
+<tr>
+ <td>
+&nbsp; &nbsp;  
+              <?php echo tep_draw_form('return', FILENAME_EDIT_TEXT, '&lng=' . $lng, 'post', '', 'SSL');?>
+              <?php echo tep_image_submit('button_return.gif', IMAGE_RETURN) ; ?>
+                     </form>
+
+ </td>
+</tr>      
+      
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
+
+

Added: trunk/direct.openmoko.com/admin/email_subjects.php
===================================================================
--- trunk/direct.openmoko.com/admin/email_subjects.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/email_subjects.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,219 @@
+<?php
+/*
+  $Id: email_subjects.php, v1 07/11/2005
+
+  Copyright (c) 2005 PassionSeed
+  http://PassionSeed.com
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+      case 'save':
+        if (isset($HTTP_GET_VARS['gID'])) $email_subjects_id = tep_db_prepare_input($HTTP_GET_VARS['gID']);
+        $email_subjects_name = tep_db_prepare_input($HTTP_POST_VARS['email_subjects_name']);
+        $email_subjects_category = tep_db_prepare_input($HTTP_POST_VARS['email_subjects_category']);
+
+        $sql_data_array = array('email_subjects_name' => $email_subjects_name,
+                                'email_subjects_category' => $email_subjects_category);
+
+        if ($action == 'insert') {
+          $insert_sql_data = array('date_added' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+          tep_db_perform(TABLE_EMAIL_SUBJECTS, $sql_data_array);
+          $email_subjects_id = tep_db_insert_id();
+        } elseif ($action == 'save') {
+          $update_sql_data = array('last_modified' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+          tep_db_perform(TABLE_EMAIL_SUBJECTS, $sql_data_array, 'update', "email_subjects_id = '" . (int)$email_subjects_id . "'");
+        }
+
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('email_subjects');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_EMAIL_SUBJECTS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'gID=' . $email_subjects_id));
+        break;
+      case 'deleteconfirm':
+        $email_subjects_id = tep_db_prepare_input($HTTP_GET_VARS['gID']);
+
+        tep_db_query("delete from " . TABLE_EMAIL_SUBJECTS . " where email_subjects_id = '" . (int)$email_subjects_id . "'");
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('email_subjects');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script type="text/javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_EMAIL_SUBJECTS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_EMAIL_SUBJECTS_CATEGORY; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $email_subjects_query_raw = "select email_subjects_id, email_subjects_name, email_subjects_category, date_added, last_modified from " . TABLE_EMAIL_SUBJECTS . " order by email_subjects_name";
+  $email_subjects_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $email_subjects_query_raw, $email_subjects_query_numrows);
+  $email_subjects_query = tep_db_query($email_subjects_query_raw);
+  while ($email_subjects = tep_db_fetch_array($email_subjects_query)) {
+    if ((!isset($HTTP_GET_VARS['gID']) || (isset($HTTP_GET_VARS['gID']) && ($HTTP_GET_VARS['gID'] == $email_subjects['email_subjects_id']))) && !isset($mInfo) && (substr($action, 0, 3) != 'new')) {
+
+      $mInfo_array = array_merge($email_subjects);
+      $mInfo = new objectInfo($mInfo_array);
+    }
+
+    if (isset($mInfo) && is_object($mInfo) && ($email_subjects['email_subjects_id'] == $mInfo->email_subjects_id)) {
+      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $email_subjects['email_subjects_id'] . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $email_subjects['email_subjects_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $email_subjects['email_subjects_name']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $email_subjects['email_subjects_category']; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($mInfo) && is_object($mInfo) && ($email_subjects['email_subjects_id'] == $mInfo->email_subjects_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $email_subjects['email_subjects_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $email_subjects_split->display_count($email_subjects_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_EMAIL_SUBJECTS); ?></td>
+                    <td class="smallText" align="right"><?php echo $email_subjects_split->display_links($email_subjects_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+<?php
+  if (empty($action)) {
+?>
+              <tr>
+                <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $mInfo->email_subjects_id . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_EMAIL_SUBJECT . '</b>');
+
+      $contents = array('form' => tep_draw_form('email_subjects', FILENAME_EMAIL_SUBJECTS, 'action=insert', 'post', 'enctype="multipart/form-data"'));
+      $contents[] = array('text' => TEXT_NEW_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_EMAIL_SUBJECTS_NAME . '<br>' . tep_draw_input_field('email_subjects_name'));
+      $contents[] = array('text' => '<br>' . TEXT_EMAIL_SUBJECTS_CATEGORY . '<br>' . tep_draw_input_field('email_subjects_category', $email_subjects_category) . '<br>' . TEXT_EMAIL_SUBJECTS_CATEGORY_CHOICE);
+
+      $email_subject_inputs_string = '';
+      $languages = tep_get_languages();
+
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $HTTP_GET_VARS['gID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_EMAIL_SUBJECT . '</b>');
+
+      $contents = array('form' => tep_draw_form('email_subjects', FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $mInfo->email_subjects_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
+      $contents[] = array('text' => TEXT_EDIT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_EMAIL_SUBJECTS_NAME . '<br>' . tep_draw_input_field('email_subjects_name', $mInfo->email_subjects_name));
+      $contents[] = array('text' => '<br>' . TEXT_EMAIL_SUBJECTS_CATEGORY . '<br>' . tep_draw_input_field('email_subjects_category', $mInfo->email_subjects_category) . '<br>' . TEXT_EMAIL_SUBJECTS_CATEGORY_CHOICE);
+
+      $email_subject_inputs_string = '';
+      $languages = tep_get_languages();
+
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $mInfo->email_subjects_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_DELETE_EMAIL_SUBJECT . '</b>');
+
+      $contents = array('form' => tep_draw_form('email_subjects', FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $mInfo->email_subjects_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $mInfo->email_subjects_name . '</b>');
+
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $mInfo->email_subjects_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($mInfo) && is_object($mInfo)) {
+        $heading[] = array('text' => '<b>' . $mInfo->email_subjects_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $mInfo->email_subjects_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_EMAIL_SUBJECTS, 'page=' . $HTTP_GET_VARS['page'] . '&gID=' . $mInfo->email_subjects_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($mInfo->date_added));
+        if (tep_not_null($mInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($mInfo->last_modified));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/epconfigure.php
===================================================================
--- trunk/direct.openmoko.com/admin/epconfigure.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/epconfigure.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: epconfigure.php,v 1.0 2005/08/30 zip1 $
+*/
+
+//
+//*******************************
+//*******************************
+// C O N F I G U R A T I O N
+// V A R I A B L E S
+//*******************************
+//*******************************
+
+// **** Temp directory ****
+// if you changed your directory structure from stock and do not have /catalog/temp/, then you'll need to change this accordingly.
+//
+$tempdir = "temp/";
+$tempdir2 = "/temp/";
+
+//**** File Splitting Configuration ****
+// we attempt to set the timeout limit longer for this script to avoid having to split the files
+// NOTE:  If your server is running in safe mode, this setting cannot override the timeout set in php.ini
+// uncomment this if you are not on a safe mode server and you are getting timeouts
+// set_time_limit(330);
+
+// if you are splitting files, this will set the maximum number of records to put in each file.
+// if you set your php.ini to a long time, you can make this number bigger
+global $maxrecs;
+$maxrecs = 1500; // default, seems to work for most people.  Reduce if you hit timeouts
+//$maxrecs = 4; // for testing
+
+//**** Image Defaulting ****
+global $default_images, $default_image_manufacturer, $default_image_product, $default_image_category;
+
+// set them to your own default "We don't have any picture" gif
+//$default_image_manufacturer = 'no_image_manufacturer.gif';
+//$default_image_product = 'no_image_product.gif';
+//$default_image_category = 'no_image_category.gif';
+
+// or let them get set to nothing
+$default_image_manufacturer = '';
+$default_image_product = '';
+$default_image_category = '';
+
+//**** Status Field Setting ****
+// Set the v_status field to "Inactive" if you want the status=0 in the system
+// Set the v_status field to "Delete" if you want to remove the item from the system <- THIS IS NOT WORKING YET!
+// If zero_qty_inactive is true, then items with zero qty will automatically be inactive in the store.
+global $active, $inactive, $zero_qty_inactive, $deleteit;
+$active = 'Active';
+$inactive = 'Inactive';
+$deleteit = 'delete'; // functional for EP Advance
+$zero_qty_inactive = false;
+
+//**** Size of products_model in products table ****
+// set this to the size of your model number field in the db.  We check to make sure all models are no longer than this value.
+// this prevents the database from getting fubared.  Just making this number bigger won't help your database!  They must match!
+global $modelsize;
+$modelsize = 25;
+
+//**** Price includes tax? ****
+// Set the v_price_with_tax to
+// false if you want the price without the tax included
+// true if you want the price to be defined for import & export including tax.
+global $price_with_tax;
+$price_with_tax = false;
+
+// **** Quote -> Escape character conversion ****
+// If you have extensive html in your descriptions and it's getting mangled on upload, turn this off
+// set to true = replace quotes with escape characters
+// set to false = no quote replacement
+global $replace_quotes;
+$replace_quotes = true;
+
+// **** Field Separator ****
+// change this if you can't use the default of tabs
+// Tab is the default, comma and semicolon are commonly supported by various progs
+// Remember, if your descriptions contain this character, you will confuse EP!
+global $separator;
+$separator = "\t"; // tab is default
+//$separator = ","; // comma
+//$separator = ";"; // semi-colon
+//$separator = "~"; // tilde
+//$separator = "-"; // dash
+//$separator = "*"; // splat
+
+// **** Max Category Levels ****
+// change this if you need more or fewer categories
+global $max_categories;
+$max_categories = 4; // 4 is default
+
+// VJ product attributes begin
+// **** Product Attributes ****
+// change this to false, if do not want to download product attributes
+global $products_with_attributes;
+$products_with_attributes = true;
+
+// change this if you want to download selected product options
+// this might be handy, if you have a lot of product options, and your output file exceeds 256 columns (which is the max. limit MS Excel is able to handle)
+global $attribute_options_select;
+//$attribute_options_select = array('Size', 'Model'); // uncomment and fill with product options name you wish to download // comment this line, if you wish to download all product options
+// VJ product attributes end
+
+require('includes/application_top.php');
+require('includes/database_tables.php');
+
+global $filelayout, $filelayout_count, $filelayout_sql, $langcode, $fileheaders;
+
+// these are the fields that will be defaulted to the current values in the database if they are not found in the incoming file
+global $default_these;
+$default_these = array(
+  'v_products_image',
+  'v_products_image_med',
+  'v_products_image_lrg',
+  'v_products_image_sm_1',
+  'v_products_image_xl_1',
+  'v_products_image_sm_2',
+  'v_products_image_xl_2',
+  'v_products_image_sm_3',
+  'v_products_image_xl_3',
+  'v_products_image_sm_4',
+  'v_products_image_xl_4',
+  'v_products_image_sm_5',
+  'v_products_image_xl_5',
+  'v_products_image_sm_6',
+  'v_products_image_xl_6',
+  'v_categories_id',
+  'v_products_price',
+  'v_products_quantity',
+  'v_products_weight',
+  'v_date_avail',
+  'v_instock',
+  'v_tax_class_title',
+  'v_manufacturers_name',
+  'v_manufacturers_id',
+  'v_products_dim_type',
+  'v_products_length',
+  'v_products_width',
+  'v_products_height'
+  );
+
+//*******************************
+//*******************************
+// E N D
+// C O N F I G U R A T I O N
+// V A R I A B L E S
+//*******************************
+//*******************************
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/event_drop_dns.php
===================================================================
--- trunk/direct.openmoko.com/admin/event_drop_dns.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/event_drop_dns.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,141 @@
+<?php
+/*
+  $Id: event_calendar.php,v 2.0 2003/05/09 13:25:51 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2001 osCommerce
+  Released under the GNU General Public License
+*/
+?>
+
+<td width="33%" align="center">
+
+<!-- manufacturers //-->
+<?php
+  $heading = array();
+  $heading[] = array('align' => 'center', 'text'  => TEXT_CHOOSE_MANUFACTURER);
+  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+
+    $select_box = '<select name="manufacturers_id" onChange="submit();">';
+    if (MAX_MANUFACTURERS_LIST < 2) {
+      $select_box .= '<option value=""></option>';
+    }
+    while ($manufacturers_values = tep_db_fetch_array($manufacturers_query)) {
+      $select_box .= '<option value="' . $manufacturers_values['manufacturers_id'] . '"';
+      //if ($HTTP_POST_VARS['manufacturers_id'] == $manufacturers_values['manufacturers_id']) $select_box .= ' SELECTED';
+      $select_box .= '>' . substr($manufacturers_values['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
+    }
+    $select_box .= "</select>";
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '', 'align' => 'left', 'text'  => $select_box );
+  $box = new box;
+  echo $box->menuBox($heading, $info_box_contents);
+?>
+<!-- manufacturers_end //-->
+
+</td><td width="33%" align="center">
+
+<!-- categories //-->
+<?php
+  $heading = array();
+  $heading[] = array('align' => 'center', 'text'  => TEXT_CHOOSE_CATEGORY);
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '', 'align' => 'left', 'text'  => tep_draw_pull_down_menu('cPath', tep_get_category_tree(), '', 'onChange="submit();"'));
+  $box = new box;
+  echo $box->menuBox($heading, $info_box_contents);
+?>
+<!-- categories_end //-->
+
+</td><td width="33%" align="center" valign="top">
+
+<!-- products //-->
+<?php
+$date = date('Y-m-d H:i:s');
+if ($HTTP_POST_VARS['manufacturers_id']) {
+// We show all products by that manufacturer
+        $listing_query = tep_db_query("select p.products_id, pd.products_name from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where
+                                     p.manufacturers_id = '" . $HTTP_POST_VARS['manufacturers_id'] . "' and
+                                     pd.products_id = p.products_id and
+                                     pd.language_id = '" . $languages_id . "' ");
+
+} else if ($HTTP_POST_VARS['cPath']){
+// We show all products in a specific category where status = 1
+        $listing_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where
+                                     pd.language_id = '" . $languages_id . "' and
+                                     p2c.categories_id = '" . $HTTP_POST_VARS['cPath'] . "' and
+                                     p.products_id = p2c.products_id and
+                                     pd.products_id = p2c.products_id ");
+      }else {        
+          $listing_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where
+                                     pd.language_id = '" . $languages_id . "' and
+                                     p2c.categories_id = '0' and
+                                     p.products_id = p2c.products_id and
+                                     pd.products_id = p2c.products_id ");
+
+      
+     }
+      
+if (tep_db_num_rows($listing_query) > 0) {
+
+  $heading = array();
+  $heading[] = array('align' => 'center', 'text' => TEXT_CHOOSE_PRODUCT );
+  $info_box_contents = array();
+  $products_array = array(array('id' => '', 'text' => ''));
+  while ($listing_products = tep_db_fetch_array($listing_query)) {
+  $products_array[] = array('id' => $listing_products['products_id'], 'text' => $listing_products['products_name']);
+  }
+  $info_box_contents[] = array('form' => '', 'align' => 'left', 'text' => tep_draw_pull_down_menu('products_id', $products_array, '','onChange="submit();"'));
+  $box = new box;
+  echo $box->menuBox($heading, $info_box_contents);
+} else {
+  $products_array[] = array('id' => 0, 'text' => TEXT_CHOOSE_PRODUCT );
+  $heading = array();
+  $heading[] = array('align' => 'center', 'text' => TEXT_CHOOSE_PRODUCT );
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => '', 'align' => 'left', 'text' => tep_draw_pull_down_menu('products_id', $products_array, '','onChange="submit();"'));
+  $box = new box;
+  echo $box->menuBox($heading, $info_box_contents);
+}
+?>
+<!-- products end//-->
+
+</td></tr><tr><td colspan="3" >
+
+<!-- upcoming products //-->
+<?php
+// We select all products not available yet
+  $upcoming_query = tep_db_query("select p.products_id, p.products_date_available, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where
+                                     pd.language_id = '" . $languages_id . "' and
+                                     p.products_id = pd.products_id and
+                                     p.products_date_available != 0");
+
+if (tep_db_num_rows($upcoming_query) > 0) {
+
+  $heading = array();
+  $heading[] = array('align' => 'center', 'text' => TEXT_CHOOSE_UPCOMING );
+  $info_box_contents = array();
+  $upcoming_array = array(array('id' => '', 'text' => ''));
+  while ($upcoming_products = tep_db_fetch_array($upcoming_query)) {
+  $upcoming_array[] = array('id' => $upcoming_products['products_id'], 'text' => $upcoming_products['products_name'] .' |   expected: '. substr($upcoming_products['products_date_available'],0,10));
+  }
+  
+  $info_box_contents[] = array('form' => '', 'align' => 'left', 'text' => (tep_draw_pull_down_menu('upcoming', $upcoming_array, ' ','onChange="submit();"')));
+  $box = new box;
+  
+  echo $box->menuBox($heading, $info_box_contents);
+} else {
+  $heading = array();
+  $heading[] = array('align' => 'left', 'text' => TEXT_NO_UPCOMING_PRODUCTS );
+  $info_box_contents = array();
+  $upcoming_array = array(array('id' => '1', 'text' => TEXT_NO_UPCOMING_PRODUCTS));
+//  $upcoming_array[] = array('id' => '1', 'text' => TEXT_NO_UPCOMING_PRODUCTS);
+  $info_box_contents[] = array('form' => '', 'align' => 'left', 'text' => (tep_draw_pull_down_menu('upcoming', $upcoming_array, ' ','onChange="submit();"')));
+
+  $box = new box;
+  echo $box->menuBox($heading, $info_box_contents);
+}
+?>
+<!-- upcoming products end//-->
+</td>
+

Added: trunk/direct.openmoko.com/admin/events_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/events_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/events_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,576 @@
+<?php
+/*
+  $Id: events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  define(FILENAME_DEFAULT_CATALOG, 'index.php');
+  define(FILENAME_PRODUCT_INFO, 'product_info.php');
+
+  $languages = tep_get_languages();
+
+    if ($HTTP_GET_VARS['action']) {
+
+    switch ($HTTP_GET_VARS['action']) {
+      case 'edit':
+        $HTTP_GET_VARS['action'] = 'new';
+        break;
+
+      case 'preview':
+      case 'insert':
+      case 'update':
+
+      if (!$HTTP_POST_VARS['preview_x']) {
+      if (($HTTP_POST_VARS['edit_x']) || ($HTTP_POST_VARS['edit_y']) || ($HTTP_POST_VARS['manufacturers_id']) || ($HTTP_POST_VARS['cPath']) || ($HTTP_POST_VARS['products_id']) || ($HTTP_POST_VARS['upcoming']) ) {
+          $HTTP_GET_VARS['action'] = 'new';
+          break;
+        }
+      }
+      
+        $event_id = $HTTP_POST_VARS['eID'];
+        $start_event = $HTTP_POST_VARS['start'];
+        $event_error = false;
+        
+        if (empty($start_event)) {
+          $messageStack->add('search', ERROR_EVENT_START_DATE, 'error');
+          $event_error = true;
+        }
+        
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $language_id = $languages[$i]['id'];
+          $event_title = $HTTP_POST_VARS['title'][$language_id];
+          if (empty($event_title)) {
+          $messageStack->add('search', ERROR_EVENT_TITLE, 'error');
+          $event_error = true;
+          }
+        }
+
+        if (!$event_error) {
+          if ($HTTP_GET_VARS['action'] == 'preview') {
+          break;
+          }
+          for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $language_id = $languages[$i]['id'];
+
+          $sql_data_array = array('start_date' => tep_db_prepare_input($HTTP_POST_VARS['start']),
+                                  'end_date' => tep_db_prepare_input($HTTP_POST_VARS['end']),
+                                  'title' => tep_db_prepare_input($HTTP_POST_VARS['title'][$language_id]),
+                                  'description' => tep_db_prepare_input($HTTP_POST_VARS['description'][$language_id]),
+                                  'event_image' => tep_db_prepare_input($HTTP_POST_VARS['event_image']),
+                                  'OSC_link' =>  tep_db_prepare_input($HTTP_POST_VARS['OSC_link']),
+                                  'link' =>  tep_db_prepare_input($HTTP_POST_VARS['link']));
+
+          if ($HTTP_GET_VARS['action'] == 'insert') {
+            $sql_data_array['event_id'] = $event_id;
+            $sql_data_array['language_id'] = $language_id;
+            $sql_data_array['date_added'] = 'now()';
+            tep_db_perform(TABLE_EVENTS_CALENDAR, $sql_data_array);
+
+            $event_id = tep_db_insert_id();
+
+          } elseif ($HTTP_GET_VARS['action'] == 'update') {
+            tep_db_perform(TABLE_EVENTS_CALENDAR, $sql_data_array, 'update', 'event_id = \'' . tep_db_input($event_id) . '\' and language_id = \'' . $language_id . '\'');
+          }
+        }
+
+          tep_redirect(tep_href_link(FILENAME_EVENTS_MANAGER));
+
+        } else {
+          $HTTP_GET_VARS['action'] = 'new';
+        }
+        break;
+
+      case 'delete_event':
+        $HTTP_GET_VARS['action'] = 'delete_event';
+        break;
+
+      case 'delete_confirm':
+        $event_id = tep_db_prepare_input($HTTP_GET_VARS['eID']);
+        tep_db_query("delete from " . TABLE_EVENTS_CALENDAR . " where event_id = '" . tep_db_input($event_id) . "'");
+        tep_redirect(tep_href_link(FILENAME_EVENTS_MANAGER));
+        break;
+        
+      case 'delete_events':
+        $HTTP_GET_VARS['action'] = 'delete_events';
+        break;
+
+      case 'delete_events_confirm':
+        $before = tep_db_prepare_input($HTTP_GET_VARS['b_date']);
+        tep_db_query("delete from " . TABLE_EVENTS_CALENDAR . " where start_date < '" . tep_db_input($before) . "'");
+        tep_redirect(tep_href_link(FILENAME_EVENTS_MANAGER));
+        break;
+    }
+  }
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?> ">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<style type="text/css">
+<!--
+TD.main, P.main { font-family: Verdana, Arial, sans-serif; font-size: 11px; line-height: 1.5; }
+.event { font-family: Arial, Verdana; font-size: 11px; color: #000000; background-color: #FFFFFF; text-decoration: none; border:1px solid #E6E6E6; }
+-->
+</style>
+<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
+<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
+
+<script language="javascript"><!--
+
+var submitted = false;
+function check_delete_events() {
+  var error = 0;
+  var error_message = "<?php echo EVENTS_ERROR; ?>";
+  var before = document.delete_events.before.value;
+
+  if (document.delete_events.elements['before'].type != "hidden") {
+    if (before == '' || before == "yyyy-MM-dd" ) {
+      error_message = error_message + "<?php echo DELETE_EVENTS_ERROR; ?>";
+      error = 1;
+    }
+  }
+  if (error == 1) {
+    alert(error_message);
+    return false;
+  } else {
+    submitted = true;
+    return true;
+  }
+}
+//--></script>
+
+</head>
+
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?> " valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?> " cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+        </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top">
+    <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td valign="top">
+        <table border="0" width="600" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" height="36"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right">
+            <?php echo '<a href="' . tep_href_link(FILENAME_EVENTS_MANAGER, 'action=new') . '">' . tep_image_button('button_new_event.gif', IMAGE_NEW_EVENT, 'align=absmiddle' ) . '</a>'; ?></td>
+          </tr>
+        </table>
+        </td>
+      </tr>
+      <tr>
+      <td valign="top">
+<?php
+if ($HTTP_GET_VARS['action'] == 'new') {
+    $form_action = 'preview';
+    if ($HTTP_GET_VARS['eID']) {
+      $eID = tep_db_prepare_input($HTTP_GET_VARS['eID']);
+      $form_action = 'preview';
+      $events_query = tep_db_query("select event_id, start_date, end_date, event_image, link, OSC_link, date_added from " . TABLE_EVENTS_CALENDAR . " where event_id = '" . tep_db_input($eID) . "'");
+
+      $events = tep_db_fetch_array($events_query);
+      }
+      $start_d =($HTTP_POST_VARS['start'] ? $HTTP_POST_VARS['start'] : $events['start_date']);
+      $end_d =($HTTP_POST_VARS['end'] ? $HTTP_POST_VARS['end'] : $events['end_date']);
+      //print_r ($events);
+      $languages = tep_get_languages();
+          for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $language_id = $languages[$i]['id'];
+
+          $events_language_query = tep_db_query("select title, description from " . TABLE_EVENTS_CALENDAR . " where event_id = '" . tep_db_input($eID) . "' and language_id = '" . $languages[$i]['id'] . "'");
+          $events_language[$i] = tep_db_fetch_array($events_language_query);
+          //print_r ($events_language[$i]);
+      }
+?>
+
+<?php
+if ($HTTP_POST_VARS['upcoming']){
+      $available_query = tep_db_query("select products_date_available from " . TABLE_PRODUCTS . " where products_id = '" . $HTTP_POST_VARS['upcoming'] . "'");
+      $available = tep_db_fetch_array($available_query);
+      $start_d = substr($available['products_date_available'],0 ,10);
+      $end_d = '';
+   }
+?>
+
+<script language="javascript">
+var scImgPath = '../includes/javascript/spiffyCal/images/';
+var start_date = new ctlSpiffyCalendarBox("start_date", "events", "start", "btnDate1","<?php echo $start_d ; ?>",scBTNMODE_CUSTOMBLUE);
+var end_date = new ctlSpiffyCalendarBox("end_date", "events", "end", "btnDate2","<?php echo $end_d ; ?>",scBTNMODE_CUSTOMBLUE);
+</script>
+
+<table border="0" width="600" cellspacing="2" cellpadding="2">
+<tr>
+<?php echo tep_draw_form('events', FILENAME_EVENTS_MANAGER, '&eID='. $eID .'&action=' . $form_action, 'post', 'enctype="multipart/form-data"'); if ($HTTP_GET_VARS['eID']) echo tep_draw_hidden_field('eID', $eID); ?>
+  <td>
+    <table width="600" border="0" cellspacing="2" cellpadding="4"  class="columnLeft">
+     <?php
+     if ($HTTP_GET_VARS['eID'])
+     echo '<tr>'.
+          '<td class="main" colspan="2">'. TEXT_EVENT_ID .'&nbsp;'. $events['event_id'] .'&nbsp;&nbsp;&nbsp;&nbsp;'. TEXT_EVENT_DATE_ADDED .'&nbsp;'. $events['date_added'] .'</td></tr>'.
+          '</tr>';
+     ?>
+    <tr>
+     <td colspan="2">
+       <table border="0" cellspacing="0" cellpadding="0">
+         <tr>
+           <td class="main"><?php echo TEXT_EVENT_START; ?>&nbsp;&nbsp;&nbsp;&nbsp;</td>
+           <td class="main"><script language="javascript">start_date.writeControl(); start_date.dateFormat="yyyy-MM-dd";</script>&nbsp;<font color="red"><!--  * required --> <?php echo ERROR_REQUIRED_FIELDS?></font></td>
+           <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+           <td class="main"><?php echo TEXT_EVENT_END; ?>&nbsp;&nbsp;</td>
+           <td class="main"><script language="javascript">end_date.writeControl(); end_date.dateFormat="yyyy-MM-dd";</script></td>
+        </tr>
+     </table>
+     </td>
+     </tr>
+     
+<?php
+    $languages = tep_get_languages();
+    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+    $language_id = $languages[$i]['id'];
+?>
+
+     <tr>
+      <?php if ($i == 0) echo '<td class="main" valign="top" rowspan="'. $n .'" nowrap>'. TEXT_EVENT_TITLE; ?></td>
+      <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' .
+      tep_draw_input_field('title[' . $language_id . ']',(($HTTP_POST_VARS['title'][$language_id]) ? $HTTP_POST_VARS['title'][$language_id] : $events_language[$i]['title']), 'size="50"', false); ?>&nbsp;<font color="red"> * required </font></td>
+     </tr>
+<?php
+    }
+?>
+     <tr>
+<?php
+    $languages = tep_get_languages();
+    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+    $language_id = $languages[$i]['id'];
+?>
+      <?php if ($i == 0) echo '<td class="main" valign="top" rowspan="'. $n .'" nowrap>'. TEXT_EVENT_DESCRIPTION; ?></td>
+      <td class="main" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_textarea_field('description[' . $language_id . ']', 'soft', '80%', '6', (($HTTP_POST_VARS['description'][$language_id]) ? $HTTP_POST_VARS['description'][$language_id] : $events_language[$i]['description']) ); ?></td>
+     </tr>
+<?php
+    }
+            if($HTTP_POST_VARS['manufacturers_id']!= ''){
+
+///////////////////
+    $manufacturers_query = tep_db_query("select manufacturers_name from ". TABLE_MANUFACTURERS ." where manufacturers_id = '" . $HTTP_POST_VARS['manufacturers_id'] . "'");
+    if ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+    $manufacturers_name = $manufacturers['manufacturers_name'];
+    }
+///////////////////
+
+             $OSC_link = tep_catalog_href_link(FILENAME_DEFAULT_CATALOG , 'manufacturers_id='. $HTTP_POST_VARS['manufacturers_id'] );
+             $OSC_links = '<a href='. $OSC_link .' target=_blank>'. $manufacturers_name .'</a>';
+
+            }elseif($HTTP_POST_VARS['cPath']!= 0){
+             $OSC_link = tep_catalog_href_link(FILENAME_DEFAULT_CATALOG , 'cPath='. $HTTP_POST_VARS['cPath'] );
+             $OSC_links = '<a href='. $OSC_link .' target=_blank>'. tep_get_category_name($HTTP_POST_VARS['cPath'], $languages_id) .'</a>';
+
+            }elseif($HTTP_POST_VARS['products_id'] != ''){
+             $OSC_link = tep_catalog_href_link(FILENAME_PRODUCT_INFO , 'products_id='. $HTTP_POST_VARS['products_id'] );
+             $OSC_links = '<a href='. $OSC_link .'>'. tep_get_products_name($HTTP_POST_VARS['products_id']) .'</a>';
+
+            }elseif($HTTP_POST_VARS['upcoming'] != ''){
+             $OSC_link = tep_catalog_href_link(FILENAME_PRODUCT_INFO , 'products_id='. substr($HTTP_POST_VARS['upcoming'],0,$sep) );
+             $OSC_links = '<a href='. $OSC_link .'>'. tep_get_products_name($HTTP_POST_VARS['upcoming']) .'</a>';
+
+            }else{
+             $OSC_links = (($HTTP_POST_VARS['OSC_link']) ? $HTTP_POST_VARS['OSC_link'] : $events['OSC_link']);
+            }
+?>
+      
+      <tr>
+      <td colspan="2">
+       <table border="0" width="100%" cellspacing="0" cellpadding="2" class="columnLeft">
+        <tr>
+         <td colspan="3" class="main"><b><?php echo TEXT_EVENT_OSC_LINK ; ?></b>&nbsp;&nbsp;<font class="smalltext"><?php echo TEXT_EVENT_OSC_LINK_HELP ; ?></font></td>
+        </tr>
+        <tr>
+         <?php include('event_drop_dns.php'); ?>
+        </tr>
+        <tr>
+         <td colspan="3" class="smalltext"><?php echo TEXT_START_DATE_NOTE; ?></td>
+        </tr>
+        <?php if ($OSC_links){
+        ?>
+        <tr>
+         <td colspan="3" align="center" height="24" bgcolor="#DDE0E6" class="main"><?php if ($OSC_links) echo TEXT_CURRENT_OSC_LINK .'&nbsp;'. $OSC_links . tep_draw_hidden_field('OSC_link', $OSC_links); ?></td>
+        </tr>
+        <?php 
+        }
+        ?>
+       </table>
+      </td>
+     </tr>
+     <tr>
+      <td class="main"><?php echo TEXT_EVENT_LINK; ?></td>
+      <td class="main"><?php echo tep_draw_input_field('link', $events['link'], 'size="50"', false); ?><br><font class="smalltext"><?php echo TEXT_EVENT_LINK_HELP ; ?></font></td>
+     </tr>
+     <tr>
+      <td class="main"><?php echo TEXT_EVENT_IMAGE; ?></td>
+      <td class="main">
+      <table border="0" width="100%" cellspacing="0" cellpadding="0">
+       <tr>
+        <td class="main">
+      <?php
+      echo tep_draw_file_field('event_image') . tep_draw_hidden_field('event_previous_image', (($HTTP_POST_VARS['event_image']) ? $HTTP_POST_VARS['event_image'] : $events['event_image'])) .'<td><td class="main">'. (($HTTP_POST_VARS['event_image']) ? $HTTP_POST_VARS['event_image'] : $events['event_image']) .'&nbsp;&nbsp</td>';
+      if ($HTTP_POST_VARS['event_image'] || $events['event_image']) {
+      $event_image = ($HTTP_POST_VARS['event_image'] ? $HTTP_POST_VARS['event_image'] : $events['event_image']);
+      echo '<td class="main">'. tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES .'events_images/' . $event_image , $HTTP_POST_VARS['title'][$language_id], 50, 50, 'align="right" hspace="2" vspace="2"') .'</td>'.
+           '<td class="main">&nbsp'. TEXT_EVENT_NO_IMAGE .'&nbsp;&nbsp;'. tep_draw_checkbox_field('no_image', $value = '', $checked = false, $compare = '') .'</td>';
+       }
+      ?>
+        </tr>
+       </table>
+      </td>
+     </tr>
+    </table>
+      </td>
+     </tr>
+     <tr>
+      <td>
+         <table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" align="right">
+            <?php if ($HTTP_GET_VARS['eID']) echo '<a href="' . tep_href_link(FILENAME_EVENTS_MANAGER, '&eID=' . tep_db_input($eID) . '&action=delete_event') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' ?>
+            <?php echo tep_image_submit('button_preview.gif', IMAGE_PREVIEW, 'name="preview"') . '&nbsp;' . tep_image_button('button_reset.gif', IMAGE_RESET ,'onClick=reset()') ; ?></td>
+          </tr>
+        </table>
+      </td>
+      </form>
+     </tr>
+    </table>
+<?php
+} elseif ($HTTP_GET_VARS['action'] == 'preview') {
+    $form_action = 'insert';
+    if ($HTTP_GET_VARS['eID']) {
+      $eID = tep_db_prepare_input($HTTP_GET_VARS['eID']);
+      $form_action = 'update';
+      }
+
+      if($HTTP_POST_VARS['no_image']) {
+         $event_image = '';
+      }else{
+      if ($event_image = new upload('event_image', DIR_FS_CATALOG_IMAGES . 'events_images/')) {
+        $event_image = $event_image->filename;
+      } else {
+        $event_image = $HTTP_POST_VARS['event_previous_image'];
+      }
+}
+
+?>
+<table width="600" border="0" cellspacing="1" cellpadding="2">
+<?php echo tep_draw_form('events', FILENAME_EVENTS_MANAGER, '&eID='. $eID .'&action=' . $form_action); if ($form_action == 'update' || $form_action == 'insert') echo tep_draw_hidden_field('eID', $eID); ?>
+  <tr>
+    <td colspan="3" align="center" class="main"><b><?php echo TEXT_EVENT_PREVIEW; ?></b></td>
+  </tr>
+  <tr>
+    <td colspan="3">&nbsp;</td>
+  </tr>
+
+<?php
+    $languages = tep_get_languages();
+    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+    $language_id = $languages[$i]['id'];
+    
+          $clsp = 2;
+          echo '<tr><td class="main" valign="top">'. tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;</td>';
+          echo '<td width="100%" >';
+          echo '<table border="0" width="100%" cellspacing="0" cellpadding="4" class="event">'.
+               '<tr>'.
+               '<td width="100%" bgcolor="#D9DEE6" class="main" style="border-bottom: 1px solid #D9DEE6" nowrap>'. TEXT_EVENT_TITLE .'&nbsp;&nbsp;'. $HTTP_POST_VARS['title'][$language_id] .  tep_draw_hidden_field('title[' . $language_id . ']', $HTTP_POST_VARS['title'][$language_id]) .'</td>';
+          if($HTTP_POST_VARS['end']){
+          echo '<td bgcolor="#D9DEE6" align="center" nowrap><div class="event" style="border: 1px inset #F2F4F7">&nbsp;&nbsp;'. TEXT_EVENT_START .'&nbsp;&nbsp;'. $HTTP_POST_VARS['start'] .'&nbsp;&nbsp;</div></td><td bgcolor="#D9DEE6" align="center" nowrap><div class="event" style="border: 1px inset #F2F4F7">&nbsp;&nbsp;'. TEXT_EVENT_END .'&nbsp;&nbsp;'. $HTTP_POST_VARS['end'] .'&nbsp;&nbsp;</div></td>';
+          $clsp++;
+          }
+          echo '</tr><tr>'.
+               '<td colspan="'. $clsp . '" class="main">'. TEXT_EVENT_DESCRIPTION .'<br>';
+
+               if ($event_image != ''){
+                  echo'<table border="0" cellspacing="0" cellpadding="0" align="right"><tr>'.
+                      '<td class="main">'. tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES .'events_images/' . $event_image , $HTTP_POST_VARS['title'][$language_id], '', '', 'align="right" hspace="5" vspace="5"') .'</td>'.
+                      '</tr></table>';
+                      }
+
+          echo $HTTP_POST_VARS['description'][$language_id] . tep_draw_hidden_field('description[' . $language_id . ']',  $HTTP_POST_VARS['description'][$language_id]) .'</td>';
+
+          if($HTTP_POST_VARS['OSC_link']){
+          echo '</tr><tr>'.
+               '<td colspan="'. $clsp . '"  bgcolor="#F5F5F5" align="left" class="main">'. TEXT_EVENT_OSC_LINK .'&nbsp;&nbsp;'. $HTTP_POST_VARS['OSC_link'] . '</a>'. tep_draw_hidden_field('OSC_link', $HTTP_POST_VARS['OSC_link']) .'</td>';
+          }
+          if($HTTP_POST_VARS['link']){
+          echo '</tr><tr>'.
+               '<td colspan="'. $clsp . '"  bgcolor="#F5F5F5" align="left" class="main">'. TEXT_EVENT_LINK .'&nbsp;&nbsp;<a href="http://'. $HTTP_POST_VARS['link'] .'" target="_blank">'. $HTTP_POST_VARS['link'] .'</a>'. tep_draw_hidden_field('link', $HTTP_POST_VARS['link']) .'</td>';
+          }
+          echo '</tr></table>';
+    }
+    echo'</td></tr>';
+?>
+     <tr>
+      <td colspan="3" class="main" valign="top"><?php echo TEXT_EVENT_START .'&nbsp;&nbsp;'. $HTTP_POST_VARS['start'] . tep_draw_hidden_field('start', $HTTP_POST_VARS['start']) . tep_draw_hidden_field('event_image', $event_image_name); ?></td>
+     </tr>
+
+     <?php
+     if ($HTTP_POST_VARS['end'])
+     echo '<tr><td colspan="3" class="main">'. TEXT_EVENT_END .'&nbsp;&nbsp;'. $HTTP_POST_VARS['end'] . tep_draw_hidden_field('end', $HTTP_POST_VARS['end']) .'</td></tr>';
+     if ($HTTP_POST_VARS['OSC_link'])
+     echo '<tr><td colspan="3" class="main">'. TEXT_EVENT_OSC_LINK .'&nbsp;&nbsp;'. $HTTP_POST_VARS['OSC_link'] . tep_draw_hidden_field('OSC_link', $HTTP_POST_VARS['OSC_link']) .'</td></tr>';
+     if ($HTTP_POST_VARS['link'])
+     echo '<tr><td colspan="3" class="main">'. TEXT_EVENT_LINK .'&nbsp;&nbsp;<a href="http://'. $HTTP_POST_VARS['link'] .'" target="_blank">'. $HTTP_POST_VARS['link'] .'</a>'. tep_draw_hidden_field('link', $HTTP_POST_VARS['link']) .'</td></tr>';
+     ?>
+     <tr>
+      <td colspan="3">
+         <table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" align="right">
+            <?php echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit" align="absmiddle"') . '&nbsp;'; ?>
+            <?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT, 'align="absmiddle"') : tep_image_submit('button_update.gif', IMAGE_UPDATE, 'align="absmiddle"')); ?>
+            </td>
+          </tr>
+        </table>
+       </td>
+     </tr>
+     </form>
+   </table>
+<?php
+} elseif  ($HTTP_GET_VARS['action'] == 'delete_event')  {
+?>
+<table border="0" width="600" cellspacing="0" cellpadding="2">
+  <?php echo tep_draw_form('events', FILENAME_EVENTS_MANAGER, '&eID='. $eID .'&action=delete_confirm'); ?>
+    <tr>
+      <td class="main" height="60"><?php echo TEXT_EVENT_DELETE_CONFIRM ?>&nbsp;&nbsp;<?php echo tep_image_submit('button_delete.gif', IMAGE_DELETE, 'align="absmiddle"'); ?>
+        <?php echo '<a href="' . tep_href_link(FILENAME_EVENTS_MANAGER) . '">' . tep_image_button('button_back.gif', IMAGE_BACK, 'align="absmiddle"') . '</a>' ?>
+    </tr>
+  </table>
+<?php
+} else {
+
+if ($HTTP_GET_VARS['action'] == 'delete_events')  {
+$query_before = 'and start_date < "'. $HTTP_POST_VARS['before'] .'"';
+$bgcolor = 'style =" background: #FFB3B5 ;"';
+?>
+
+<table border="0" width="600" cellspacing="0" cellpadding="2">
+  <?php echo tep_draw_form('events', FILENAME_EVENTS_MANAGER, '&b_date='. $before .'&action=delete_events_confirm'); ?>
+    <tr>
+      <td class="main" height="60"><?php echo TEXT_EVENTS_DELETE_CONFIRM ?>&nbsp;&nbsp;<?php echo tep_image_submit('button_delete.gif', IMAGE_DELETE, 'align="absmiddle"'); ?>
+        <?php echo '<a href="' . tep_href_link(FILENAME_EVENTS_MANAGER) . '">' . tep_image_button('button_back.gif', IMAGE_BACK, 'align="absmiddle"') . '</a>' ?>
+    </tr>
+  </table>
+
+<?php
+}
+?>
+
+<script language="javascript">
+var scImgPath = '../includes/javascript/spiffyCal/images/';
+var before_date = new ctlSpiffyCalendarBox("before_date", "delete_events", "before", "btnDate3","yyyy-MM-dd",scBTNMODE_CUSTOMBLUE);
+</script>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_ID; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SIZE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_TITLE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_ADDED; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_START; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_END; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LINKS; ?></td>
+<?php if (!isset($query_before)){
+?>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ACTION; ?></td>
+<?php
+}
+?>
+              </tr>
+<?php
+$events_query = tep_db_query("select *, LENGTH(description) as content_length from ". TABLE_EVENTS_CALENDAR ." where language_id = '" . $languages_id . "' $query_before order by start_date");
+   if(tep_db_num_rows($events_query)>0){
+      while ($events = tep_db_fetch_array($events_query)){
+          list ($year, $month, $day) = split ('[/.-]', $events['start_date']);
+          $date_start = date("F j, Y", mktime(0,0,0,$month,$day,$year));
+          if($events['end_date']){
+          list ($year_end, $month_end, $day_end) = split ('[/.-]', $events['end_date']);
+          $date_end = date("F j, Y", mktime(0,0,0,$month_end,$day_end,$year_end));
+          }
+          $events_array = array('id' => $events['event_id'],
+                               'size' => $events['content_length'],
+                               'title' => $events['title'],
+                               'date_added' => $events['date_added'],
+                               'OSC_link' => $events['OSC_link'],
+                               'link' => $events['link'],
+                               'first_day' => $date_start,
+                               'last_day' => $date_end);
+                               
+        echo '<tr class="dataTableRow" '. $bgcolor .' onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_EVENTS_MANAGER, '&eID=' . $events_array['id'] . '&action=edit') . '\'">' . "\n";
+?>
+                <td height="20" class="dataTableContent" align="center"><?php echo $events_array['id']; ?></td>
+                <td class="dataTableContent" align="left"><?php echo number_format($events_array['size']) . ' bytes'; ?></td>
+                <td class="dataTableContent" align="left" nowrap><?php echo $events_array['title']; ?></td>
+                <td class="dataTableContent" align="left"><?php echo tep_date_short($events_array['date_added']); ?></td>
+                <td class="dataTableContent" align="lef"><?php echo $events_array['first_day']; ?></td>
+                <td class="dataTableContent" align="left"><?php echo(($events['end_date']) ? $events_array['last_day'] : '-'); ?></td>
+                <td class="dataTableContent" align="left"><?php echo '<a href="http://' . $events_array['link'] . '">' . $events_array['link'] . '</a><br>' . $events_array['OSC_link'] . '</a>'; ?></td>
+<?php if (!isset($query_before)){
+?>
+                <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_EVENTS_MANAGER, '&eID=' . $events_array['id'] . '&action=delete_event') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' ?>
+                <?php echo '<a href="' . tep_href_link(FILENAME_EVENTS_MANAGER, '&eID=' . $events_array['id'] . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>' ?></td>
+<?php
+}
+?>
+              </tr>
+              <tr>
+                <td colspan="8"></td>
+              </tr>
+<?php
+  }
+if (!isset($query_before)){
+?>
+              <tr>
+                 <td class="main" colspan="8" height="60">
+                <?php echo tep_draw_form('delete_events', FILENAME_EVENTS_MANAGER, 'action=delete_events', 'post', 'onSubmit="return check_delete_events()"') . TEXT_DELETE_EVENTS; ?>&nbsp;&nbsp;&nbsp;<script language="javascript">before_date.writeControl(); before_date.dateFormat="yyyy-MM-dd";</script>&nbsp;&nbsp;&nbsp;<?php echo tep_image_submit('button_delete.gif', IMAGE_DELETE, 'align="absmiddle"'); ?></form>
+                </td>
+              </tr>
+<?php
+ }
+}else{
+?>
+             <tr>
+              <td colspan="8" class="dataTableContent"><br><?php echo TEXT_NO_EVENTS; ?></td>
+             </tr>
+<?php
+  }
+}
+?>
+        </table>
+<?php echo tep_draw_separator(); ?>
+      </td>
+     </tr>
+    </table>
+   </td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/faq_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/faq_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/faq_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,330 @@
+<?php
+/*
+  $Id: faq_categories.php,v 1.1.1.1 2004/03/04 23:38:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+require('includes/application_top.php');
+
+// define functions
+require(DIR_WS_FUNCTIONS . 'faq.php');
+
+// clean variables
+$cID = '';
+if (isset($HTTP_POST_VARS['cID']) && tep_not_null($HTTP_POST_VARS['cID'])) {
+  $cID = (int)$HTTP_POST_VARS['cID'];
+} elseif (isset($HTTP_GET_VARS['cID']) && tep_not_null($HTTP_GET_VARS['cID'])) {
+  $cID = (int)$HTTP_GET_VARS['cID'];
+}
+
+$action = '';
+if (isset($HTTP_POST_VARS['action']) && tep_not_null($HTTP_POST_VARS['action'])) {
+  $action = tep_db_prepare_input($HTTP_POST_VARS['action']);
+} elseif (isset($HTTP_GET_VARS['action']) && tep_not_null($HTTP_GET_VARS['action'])) {
+  $action = tep_db_prepare_input($HTTP_GET_VARS['action']);
+} 
+
+$error = false;
+$processed = false;
+
+switch ($action) {
+ case 'setflag':
+   $status = tep_db_prepare_input($HTTP_GET_VARS['flag']);
+
+   if ($status == '1') {
+     tep_db_query("update " . TABLE_FAQ_CATEGORIES . " set categories_status = '1' where categories_id = '" . (int)$cID . "'");
+   } elseif ($status == '0') {
+     tep_db_query("update " . TABLE_FAQ_CATEGORIES . " set categories_status = '0' where categories_id = '" . (int)$cID . "'");
+   }
+
+   tep_redirect(tep_href_link(FILENAME_FAQ_CATEGORIES, '&cID=' . $cID));
+   break;
+ case 'insert':
+ case 'update':
+   $categories_sort_order = tep_db_prepare_input($HTTP_POST_VARS['categories_sort_order']);
+   $categories_status = ((tep_db_prepare_input($HTTP_POST_VARS['categories_status']) == 'on') ? '1' : '0');
+
+   $sql_data_array = array('categories_sort_order' => $categories_sort_order,
+         'categories_status' => $categories_status);
+
+   if ($action == 'insert') {
+     $insert_sql_data = array('categories_date_added' => 'now()');
+
+     $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+     tep_db_perform(TABLE_FAQ_CATEGORIES, $sql_data_array);
+
+     $cID = tep_db_insert_id();
+   } elseif ($action == 'update') {
+     $update_sql_data = array('categories_last_modified' => 'now()');
+
+     $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+     tep_db_perform(TABLE_FAQ_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . (int)$cID . "'");
+   }
+
+   $languages = tep_get_languages();
+   for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+     $categories_name_array = $HTTP_POST_VARS['categories_name'];
+     $categories_description_array = $HTTP_POST_VARS['categories_description'];
+
+     $language_id = $languages[$i]['id'];
+
+     $sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]),
+           'categories_description' => tep_db_prepare_input($categories_description_array[$language_id]));
+
+     if ($action == 'insert') {
+       $insert_sql_data = array('categories_id' => $cID,
+        'language_id' => $languages[$i]['id']);
+
+       $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+       tep_db_perform(TABLE_FAQ_CATEGORIES_DESCRIPTION, $sql_data_array);
+     } elseif ($action == 'update') {
+       tep_db_perform(TABLE_FAQ_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$cID . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
+     }
+   }
+
+   if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {
+     tep_db_query("update " . TABLE_FAQ_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$cID . "'");
+   }
+
+   tep_redirect(tep_href_link(FILENAME_FAQ_CATEGORIES, '&cID=' . $cID));
+   break;
+ case 'delete_confirm':
+   if (tep_not_null($cID)) {
+     $faq_ids_query = tep_db_query("select faq_id from " . TABLE_FAQ_TO_CATEGORIES . " where categories_id = '" . (int)$cID . "'");
+
+     while ($faq_ids = tep_db_fetch_array($faq_ids_query)) {
+       tep_faq_remove_faq($faq_ids['faq_id']);
+     }
+
+     tep_faq_remove_category($cID);
+   }
+
+   tep_redirect(tep_href_link(FILENAME_FAQ_CATEGORIES));
+   break;
+}
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('search', FILENAME_FAQ_CATEGORIES, '', 'get'); 
+            if (isset($HTTP_GET_VARS[tep_session_name()])) {
+              echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+            }
+          ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $search = '';
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+      $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
+      $search = " and icd.categories_name like '%" . $keywords . "%'";
+
+      $categories_query_raw = "select ic.categories_id, ic.categories_image, ic.categories_status, ic.categories_sort_order, ic.categories_date_added, ic.categories_last_modified, icd.categories_name, icd.categories_description from " . TABLE_FAQ_CATEGORIES . " ic left join " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd on ic.categories_id = icd.categories_id where icd.language_id = '" . (int)$languages_id . "'" . $search . " order by ic.categories_sort_order, icd.categories_name";
+    } else {
+      $categories_query_raw = "select ic.categories_id, ic.categories_image, ic.categories_status, ic.categories_sort_order, ic.categories_date_added, ic.categories_last_modified, icd.categories_name, icd.categories_description from " . TABLE_FAQ_CATEGORIES . " ic left join " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd on ic.categories_id = icd.categories_id where icd.language_id = '" . (int)$languages_id . "' order by ic.categories_sort_order, icd.categories_name";
+    }
+
+    $categories_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $categories_query_raw, $categories_query_numrows);
+    $categories_query = tep_db_query($categories_query_raw);
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $categories['categories_id']))) && !isset($cInfo)) {
+        $faq_count_query = tep_db_query("select count(*) as categories_faq_count from " . TABLE_FAQ_TO_CATEGORIES . " where categories_id = '" . (int)$categories['categories_id'] . "'");
+        $faq_count = tep_db_fetch_array($faq_count_query);
+
+        $cInfo_array = array_merge($categories, $faq_count);
+        $cInfo = new objectInfo($cInfo_array);
+      }
+
+      if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id)) {
+        echo '          <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_FAQ_CATEGORIES, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_FAQ_CATEGORIES, tep_get_all_get_params(array('cID')) . 'cID=' . $categories['categories_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo $categories['categories_name']; ?></td>
+                <td  class="dataTableContent" align="right">
+<?php
+      if ($categories['categories_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES, 'action=setflag&flag=0&cID=' . $categories['categories_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES, 'action=setflag&flag=1&cID=' . $categories['categories_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES, tep_get_all_get_params(array('cID')) . 'cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $categories_split->display_count($categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_FAQ_CATEGORIES); ?></td>
+                    <td class="smallText" align="right"><?php echo $categories_split->display_links($categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'pages', 'x', 'y', 'cID'))); ?></td>
+                  </tr>
+                  <tr>
+<?php
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+?>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>'; ?></td>
+<?php
+    } else {
+?>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>'; ?></td>
+<?php
+    }
+?>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_FAQ_HEADING_NEW_FAQ_CATEGORY . '</b>');
+
+      $contents = array('form' => tep_draw_form('categories_new', FILENAME_FAQ_CATEGORIES, 'action=insert', 'post', 'enctype="multipart/form-data"'));
+      $contents[] = array('text' => TEXT_NEW_FAQ_CATEGORIES_INTRO);
+
+      $category_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $category_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']');
+      }
+
+      $category_description_inputs_string = '';
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $category_description_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;<br>' . tep_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '40', '5');
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_NAME . $category_inputs_string);
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_DESCRIPTION . $category_description_inputs_string);
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_SORT_ORDER . '&nbsp;' . tep_draw_input_field('categories_sort_order', '', 'size="2"'));
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_STATUS . '&nbsp;&nbsp;' . tep_draw_radio_field('categories_status', 'on', true) . ' ' . TEXT_FAQ_CATEGORIES_STATUS_ENABLE . '&nbsp;&nbsp;' . tep_draw_radio_field('categories_status', 'off') . ' ' . TEXT_FAQ_CATEGORIES_STATUS_DISABLE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_FAQ_HEADING_EDIT_FAQ_CATEGORY . '</b>');
+
+      $contents = array('form' => tep_draw_form('categories_edit', FILENAME_FAQ_CATEGORIES, 'action=update', 'post', 'enctype="multipart/form-data"') . tep_draw_hidden_field('cID', $cInfo->categories_id));
+      $contents[] = array('text' => TEXT_EDIT_FAQ_CATEGORIES_INTRO);
+
+      $category_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $category_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', tep_faq_get_category_name($cInfo->categories_id, $languages[$i]['id']));
+      }
+
+      $category_description_inputs_string = '';
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $category_description_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;<br>' . tep_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '40', '5', tep_faq_get_category_description($cInfo->categories_id, $languages[$i]['id']));
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_NAME . $category_inputs_string);
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_DESCRIPTION . $category_description_inputs_string);
+      $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name) . '<br>' . $cInfo->categories_image);
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_SORT_ORDER . '&nbsp;' . tep_draw_input_field('categories_sort_order', $cInfo->categories_sort_order, 'size="2"'));
+      $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORIES_STATUS . '&nbsp;&nbsp;' . tep_draw_radio_field('categories_status', 'on', ($cInfo->categories_status == '1') ? true : false) . ' ' . TEXT_FAQ_CATEGORIES_STATUS_ENABLE . '&nbsp;&nbsp;' . tep_draw_radio_field('categories_status', 'off', ($cInfo->categories_status == '0') ? true : false) . ' ' . TEXT_FAQ_CATEGORIES_STATUS_DISABLE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES, 'cID=' . $cInfo->categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_FAQ_HEADING_DELETE_FAQ_CATEGORY . '</b>');
+
+      $contents = array('form' => tep_draw_form('categories_delete', FILENAME_FAQ_CATEGORIES, 'action=delete_confirm') . tep_draw_hidden_field('cID', $cInfo->categories_id));
+      $contents[] = array('text' => TEXT_DELETE_FAQ_CATEGORIES_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->categories_name . '</b>');
+      if ($cInfo->categories_faq_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_PAGES, $cInfo->categories_faq_count));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES, 'cID=' . $cInfo->categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->categories_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_FAQ_CATEGORIES, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+
+        $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->categories_image);
+        $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORY_DESCRIPTION . ' ' . $cInfo->categories_description);
+        $contents[] = array('text' => '<br>' . TEXT_DATE_FAQ_CATEGORY_CREATED . ' ' . tep_date_short($cInfo->categories_date_added));
+        if (tep_not_null($cInfo->categories_last_modified)) {
+          $contents[] = array('text' => '<br>' . TEXT_DATE_FAQ_CATEGORY_LAST_MODIFIED . ' ' . tep_date_short($cInfo->categories_last_modified));
+        }
+        $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORY_COUNT . ' '  . $cInfo->categories_faq_count);
+        $contents[] = array('text' => '<br>' . TEXT_FAQ_CATEGORY_SORT_ORDER . ' '  . $cInfo->categories_sort_order);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/faq_form.php
===================================================================
--- trunk/direct.openmoko.com/admin/faq_form.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/faq_form.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,148 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+?>
+<?php // Load Editor
+include('includes/javascript/editor.php');
+echo tep_load_html_editor();
+echo tep_insert_html_editor('question','simple','200');
+echo tep_insert_html_editor('answer','advanced','400');
+?>
+<script language="JavaScript">
+  var MaxLen = 512;
+  function countMe(form) {
+    inputStr = form.question.value;
+    strlength= inputStr.length;
+    if (strlength > MaxLen ) form.question.value = inputStr.substring(0,MaxLen);
+    form.num.value = (MaxLen - form.question.value.length);
+    form.question.focus();
+  }
+  
+  function change_lang(lang) {
+    <?php echo "window.location.href = '" . FILENAME_FAQ_MANAGER . '?faq_action=' . $HTTP_GET_VARS['faq_action'] . '&' . "faq_lang='+lang;"; ?>
+  }
+</script>
+<tr class="pageHeading"><td><?php echo $title; ?></td></tr>
+<tr class="headerBar"><td class="headerBarContent">
+<?php 
+  echo FAQ_QUEUE_LIST;
+  $data = browse_faq($language,$HTTP_GET_VARS);
+  $no = 1;
+  if (sizeof($data) > 0) {
+    while (list($key, $val) = each($data)) {
+    echo $val[v_order] . ', ';
+    $no++;
+  }
+  } 
+?>
+</td></tr>
+<tr><td>
+<table border="0" cellpadding=0 cellspacing=2" width="80%">
+<tr><td class="main"><?php echo FAQ_QUEUE;?></td>
+<td class="main">
+<?php 
+  if ($edit[v_order]) {
+    $no = $edit[v_order];
+  };
+  echo tep_draw_input_field('v_order', "$no", 'size=3 maxlength=4');
+?>
+</td>
+</tr>
+<tr>
+<td valign="top" class="main"><?php echo FAQ_VISIBLE; ?></td>
+<td valign="top" class="main">
+<?php
+  if ($edit[visible]) {
+    $checked = "checked";
+  };
+  echo tep_draw_checkbox_field('visible', '1', $checked);
+  /*
+  // Not needed, remove comments to show
+  if ($edit[visible]==1) {
+  echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', FAQ_ID_ACTIVE);
+  }else{
+  echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', FAQ_ID_DEACTIVE);
+  }
+  */
+?>
+</td>
+</tr>
+<?php 
+  if ($HTTP_GET_VARS['faq_action'] != 'Edit') {
+?>
+<tr>
+<td valign="top" class="main"><?php echo FAQ_LANGUAGE; ?></td>
+<td valign="top" class="main">
+<?php
+  $lang_query = tep_db_query("select directory from " . TABLE_LANGUAGES . " order by languages_id desc");
+  while ($get_lang = tep_db_fetch_array($lang_query)) {
+    $langs[] = array('id' => $get_lang['directory'], 'text' => $get_lang['directory']);
+  }
+  if ($HTTP_GET_VARS['faq_lang']) {
+    $def_lang = $HTTP_GET_VARS['faq_lang'];
+  } else {
+    $def_lang = $language;
+  }
+  echo tep_draw_pull_down_menu('faq_language',$langs,$def_lang,'onchange="change_lang(this.value);"');
+?>
+</td>
+</tr>
+<?php
+  }
+?>
+
+<?php
+    $categories_array = array();
+    $categories_array[] = array('id' => '', 'text' => TEXT_NO_CATEGORY);
+    $categories_query = tep_db_query("select icd.categories_id, icd.categories_name from " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd where language_id = '" . (int)$languages_id . "' order by icd.categories_name");
+    while ($categories_values = tep_db_fetch_array($categories_query)) {
+      $categories_array[] = array('id' => $categories_values['categories_id'], 'text' => $categories_values['categories_name']);
+    }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_CATEGORY; ?></td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('faq_category', $categories_array, $edit['categories_id']); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+
+<tr><td valign="top" class="main"><b><?php echo FAQ_QUESTION; ?></b><br>
+<script>
+  document.write("(max. "+MaxLen+")");
+</script>
+<br>
+<?php echo tep_draw_input_field('num', '', 'size=3 readonly STYLE="color: red" '); ?>
+</td>
+<td valign="top">
+<?php echo tep_draw_textarea_field('question', '', '60', '15', $edit['question'], 'style="width: 100%" onChange="countMe(document.forms[0])" onKeyUp="countMe(document.forms[0])" '); ?>
+
+</td>
+</tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
+          </tr>
+<tr>
+<td valign="top" class="main"><b><?php echo FAQ_ANSWER; ?></b></td>
+<td valign="top">
+<?php echo tep_draw_textarea_field('answer', '', '60', '25', $edit['answer'],' style="width: 100%" mce_editable="true"'); ?>
+</td>
+</tr>
+<tr><td></td>
+<td align="right">
+<?php
+  echo tep_image_submit('button_save.gif', IMAGE_SAVE);
+  echo '<a href="' . tep_href_link(FILENAME_FAQ_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+?>
+</td>
+</tr>
+</table>
+</form>
+</td></tr>

Added: trunk/direct.openmoko.com/admin/faq_list.php
===================================================================
--- trunk/direct.openmoko.com/admin/faq_list.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/faq_list.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+?>
+<tr class="pageHeading"><td><?php echo $title ?></td></tr>
+<tr><td><table border="0" width="100%" cellpadding="2" cellspacing="1" bgcolor="#ffffff">
+  <tr class="dataTableHeadingRow">
+  <td align="center" class="dataTableHeadingContent"><?php echo FAQ_NUMBER;?></td>
+  <td align="center" class="dataTableHeadingContent"><?php echo FAQ_DATE;?></td>
+  <td align="center" class="dataTableHeadingContent"><?php echo tep_image(DIR_WS_IMAGES . 'icons/sort.gif', FAQ_SORT_BY); ?></td>
+  <td align="center" class="dataTableHeadingContent"><?php echo FAQ_QUESTION;?></td>
+  <td align="center" class="dataTableHeadingContent"><?php echo FAQ_ID;?></td>
+  <td align="center" class="dataTableHeadingContent"><?php echo FAQ_STATUS;?></td>
+  <td align="center" class="dataTableHeadingContent" colspan="2"><?php echo FAQ_ACTION;?></td>
+  </tr>
+<?php 
+  $no = 1;
+  if (sizeof($data) > 0) {
+    while (list($key, $val) = each($data)) {
+      $no % 2 ? $bgcolor="#DEE4E8" : $bgcolor="#F0F1F1";
+?>
+  <tr bgcolor="<?php echo $bgcolor?>">
+    <td align="center" class="dataTableContent"><?php echo $no;?></td>
+    <td align="center" class="dataTableContent"nowrap><?php echo $val['d']?></td>
+    <td align="center" class="dataTableContent"><?php echo $val['v_order'];?></td>
+    <td align="left" class="dataTableContent"><?php echo $val['question'] . ' (' . $val['language'] . ')';?></td>
+    <td align="center" class="dataTableContent"><?php echo $val['faq_id'];?></td>
+    <td align="center" class="dataTableContent" nowrap>
+<?php 
+      if ($val['visible'] == 1) {
+    echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;
+    <a href="' . tep_href_link(FILENAME_FAQ_MANAGER, "faq_action=Visible&faq_id=$val[faq_id]&visible=$val[visible]") . '">
+    ' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', FAQ_DEACTIVATION_ID . " $val[faq_id]", 10, 10) . '</a>';
+      }else {
+    echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10) . '&nbsp;&nbsp;
+    <a href="' . tep_href_link(FILENAME_FAQ_MANAGER, "faq_action=Visible&faq_id=$val[faq_id]&visible=$val[visible]") . '">
+    ' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', FAQ_ACTIVATION_ID . " $val[faq_id]", 10, 10) . '</a>';
+      };
+?>
+</td>
+<td align=center class="dataTableContent">
+<?php echo '<a href="' . tep_href_link(FILENAME_FAQ_MANAGER, "faq_action=Edit&faq_id=$val[faq_id]&faq_lang=$val[language]", 'NONSSL') . '">' . tep_image(DIR_WS_ICONS . 'edit.gif', FAQ_EDIT_ID . " $val[faq_id]") . '</a>'; ?>
+</td>
+<td align=center class="dataTableContent">
+<?php echo '<a href="' . tep_href_link(FILENAME_FAQ_MANAGER, "faq_action=Delete&faq_id=$val[faq_id]", 'NONSSL') . '">' . tep_image(DIR_WS_ICONS . 'delete.gif', FAQ_DELETE_ID . " $val[faq_id]") . '</a>'; ?>
+</td>
+</tr>
+<?php 
+      $no++;
+    }
+  } else {
+?>
+   <tr bgcolor="#DEE4E8">
+    <td colspan="7"><?php echo FAQ_ALERT; ?></td>
+   </tr>
+<?php 
+  }
+?>
+</table>
+</td></tr>
+<tr><td align="right">
+<?php echo '<a href="' . tep_href_link(FILENAME_FAQ_MANAGER, 'faq_action=Added', 'NONSSL') . '">' . tep_image_button('button_insert.gif', FAQ_ADD) . '</a>'; ?>
+<?php echo '<a href="' . tep_href_link(FILENAME_FAQ_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?>
+</td></tr>

Added: trunk/direct.openmoko.com/admin/faq_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/faq_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/faq_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,219 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/faq.php');
+  require(DIR_WS_FUNCTIONS . '/faq.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo FAQ_SYSTEM; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/javascript/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top">
+<table border=0 width="100%">
+<?php
+
+switch($faq_action) {
+
+  case "Added":
+  $data = browse_faq($language,$HTTP_GET_VARS);
+  $no = 1;
+  if (sizeof($data) > 0) {
+    while (list($key, $val) = each($data)) {
+      $no++;
+    }
+  };
+  $title = FAQ_ADD . ' #' . $no;
+  echo tep_draw_form('',FILENAME_FAQ_MANAGER, 'faq_action=AddSure');
+  include('faq_form.php');
+  break;
+
+  case "AddSure":
+  function add_faq ($data) {
+    $query = "INSERT INTO " . TABLE_FAQ . " VALUES(null, '$data[visible]', '$data[v_order]', '$data[question]', '$data[answer]', NOW(''),'$data[faq_language]')";
+    tep_db_query($query);
+
+    // update category info
+    $fID = tep_db_insert_id();
+    tep_db_query("insert into " . TABLE_FAQ_TO_CATEGORIES . " (faq_id, categories_id) values ('" . (int)$fID . "', '" . (int)$data['faq_category'] . "')");
+
+    unset($HTTP_POST_VARS);
+  }
+  if ($v_order && $answer && $question) {
+    if ((INT)$v_order) {
+    add_faq($HTTP_POST_VARS);
+    $data = browse_faq($language,$HTTP_GET_VARS);
+    $title = FAQ_CREATED . ' ' . FAQ_ADD_QUEUE . ' ' . $v_order;
+    include('faq_list.php');
+    } else {
+      $error = 20;
+    }
+  } else {
+    $error = 80;
+  }
+  break;
+
+  case "Edit":
+  if ($faq_id) {
+    $edit = read_data($faq_id);
+
+    $data = browse_faq($language,$HTTP_GET_VARS);
+    $button = array("Update");
+    $title = FAQ_EDIT_ID . ' ' . $faq_id;
+    echo tep_draw_form('',FILENAME_FAQ_MANAGER, 'faq_action=Update');
+    echo tep_draw_hidden_field('faq_id', $faq_id);
+    include('faq_form.php');
+  } else {
+    $error = 80;
+  }
+  break;
+
+  case "Update":
+  function update_faq ($data) {
+    tep_db_query("UPDATE " . TABLE_FAQ . " SET question='$data[question]', answer='$data[answer]', visible='$data[visible]', v_order=$data[v_order], date = now() WHERE faq_id=$data[faq_id]");
+
+    $category_check_query = tep_db_query("select categories_id from " . TABLE_FAQ_TO_CATEGORIES . " where faq_id = '" . (int)$data['faq_id'] . "'");
+
+    if (tep_db_fetch_array($category_check_query)) { // if category exists
+      // update category info
+      tep_db_query("update " . TABLE_FAQ_TO_CATEGORIES . " set categories_id = '" . (int)$data['faq_category'] . "' where faq_id = '" . (int)$data['faq_id'] . "'");
+    } else { 
+      tep_db_query("insert into " . TABLE_FAQ_TO_CATEGORIES . " (faq_id, categories_id) values ('" . (int)$data['faq_id'] . "', '" . (int)$data['faq_category'] . "')");
+    }
+  }
+  if ($faq_id && $question && $answer && $v_order) {
+    if ((INT)$v_order) {
+    update_faq($HTTP_POST_VARS);
+    $data = browse_faq($language,$HTTP_GET_VARS);
+    $title = FAQ_UPDATED_ID . ' ' . $faq_id;
+    include('faq_list.php');
+    } else {
+      $error = 20;
+    } 
+  } else {
+    $error = 80;
+  }
+  break;
+
+  case 'Visible':
+  function tep_set_faq_visible($faq_id, $HTTP_GET_VARS) {
+    if ($HTTP_GET_VARS['visible'] == 1) {
+    return tep_db_query("update " . TABLE_FAQ . " set visible = '0', date = now() where faq_id = '" . $faq_id . "'");
+    } else{
+    return tep_db_query("update " . TABLE_FAQ . " set visible = '1', date = now() where faq_id = '" . $faq_id . "'");
+    } 
+  }
+  tep_set_faq_visible($faq_id, $HTTP_GET_VARS);
+  $data = browse_faq($language,$HTTP_GET_VARS);
+  if ($HTTP_GET_VARS['visible'] == 1) {
+    $vivod = FAQ_DEACTIVATED_ID;
+  } else {
+    $vivod = FAQ_ACTIVATED_ID;
+  }
+  $title = $vivod . ' ' . $faq_id;
+  include('faq_list.php');
+  break;
+
+  case "Delete":
+  if ($faq_id) {
+    $delete = read_data($faq_id);
+    $data = browse_faq($language,$HTTP_GET_VARS);
+    $title = FAQ_DELETE_CONFITMATION_ID . ' ' . $faq_id;
+    echo '
+      <tr class="pageHeading"><td>' . $title . '</td></tr>
+      <tr><td class="dataTableContent"><b>' . FAQ_QUESTION . ':</b></td></tr>
+      <tr><td class="dataTableContent">' . $delete[question] . '</td></tr>
+      <tr><td class="dataTableContent"><b>' . FAQ_ANSWER . ':</b></td></tr>
+      <tr><td class="dataTableContent">' . $delete[answer] . '</td></tr>
+      <tr><td align="right">
+    ';
+    echo tep_draw_form('',FILENAME_FAQ_MANAGER, 'faq_action=DelSure&faq_id='.$val[faq_id]);
+    echo tep_draw_hidden_field('faq_id', $faq_id);
+    echo tep_image_submit('button_delete.gif', IMAGE_DELETE);
+    echo '<a href="' . tep_href_link(FILENAME_FAQ_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+    echo '</form></td></tr>';
+  } else {
+    $error = 80;
+  }
+  break;
+
+
+  case "DelSure":
+  function delete_faq ($faq_id) {
+    tep_db_query("DELETE FROM " . TABLE_FAQ . " WHERE faq_id=$faq_id");
+    tep_db_query("delete from " . TABLE_FAQ_TO_CATEGORIES . " where faq_id = '" . (int)$faq_id . "'");
+  }
+  if ($faq_id) {
+    delete_faq($faq_id);
+    $data = browse_faq($language,$HTTP_GET_VARS);
+    $title = FAQ_DELETED_ID . ' ' . $faq_id;
+    include('faq_list.php');
+  } else {
+    $error = 80;
+  }
+  break;
+
+
+  default:
+  $data = browse_faq($language,$HTTP_GET_VARS);
+  $title = FAQ_MANAGER;
+  include('faq_list.php');
+  break;
+}
+
+if ($error) {
+  $content = error_message($error);
+  echo $content;
+  $data = browse_faq($language,$HTTP_GET_VARS);
+  $no = 1;
+  if (sizeof($data) > 0) {
+    while (list($key, $val) = each($data)) {
+      $no++; 
+    }
+  };
+  $title = FAQ_ADD_QUEUE . ' ' . $no;
+  echo tep_draw_form('',FILENAME_FAQ_MANAGER, 'faq_action=AddSure');
+  include('faq_form.php');
+}
+?>
+</table>
+</td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/faq_view.php
===================================================================
--- trunk/direct.openmoko.com/admin/faq_view.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/faq_view.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,85 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/faq.php');
+  require(DIR_WS_FUNCTIONS . '/faq.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo FAQ_SYSTEM; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<style>.list {line-height: 18px;}</style>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+<td width="100%" valign="top">
+<table border=0 width="100%">
+<tr class="pageHeading"><td><?php echo FAQ_VIEW . ' (' . $language . ')';?></td></tr>
+<tr><td><br></td></tr>
+<tr class="dataTableRow"><td class="dataTableContent"><ol>
+<?php 
+  while ($faq = faq_toc($language)) {
+?>
+<li class="list"><?php echo $faq['toc'];?>
+<?php 
+  }
+?>
+</ol>
+</td></tr>
+<tr>
+<td><br></td>
+</tr>
+<tr class="dataTableContent"><td>
+<ol>
+<?php 
+  while ($faq = read_faq($language)) {
+?>
+<li>
+<span id="<?php echo $faq['faq_id']?>">
+<b><?php echo $faq['question'];?></b><br>
+<?php echo $faq['answer'];?>
+</li><br>
+<?php 
+  }
+?>
+</ol>
+</td></tr>
+<tr><td align="right">
+<?php echo '<a href="' . tep_href_link(FILENAME_FAQ_MANAGER, 'faq_action=Added&faq_lang='.$language, 'NONSSL') . '">' . tep_image_button('button_insert.gif', FAQ_ADD) . '</a>'; ?>
+</td></tr>
+</table>
+</td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/faq_view_all.php
===================================================================
--- trunk/direct.openmoko.com/admin/faq_view_all.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/faq_view_all.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,91 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+require('includes/application_top.php');
+require(DIR_WS_LANGUAGES . $language . '/faq.php');
+require(DIR_WS_FUNCTIONS . '/faq.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<style>.list {line-height: 22px;}</style>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top">
+<table border=0 width="100%">
+<tr class="pageHeading"><td><?php echo FAQ_VIEW_ALL;?></td></tr>
+<?php
+  $query = tep_db_query("select directory from " . TABLE_LANGUAGES . " order by languages_id desc");
+  while($get_lang = tep_db_fetch_array($query)) {
+?>
+<tr><td><br></td></tr>
+<tr><td class="dataTableContent"><?php echo $get_lang['directory']; ?></td></tr>
+<tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td></tr>
+<tr class="dataTableRow"><td class="dataTableContent">
+<ol>
+<?php
+  while ($faq = faq_toc($get_lang['directory'])) {
+?>
+<li class="list"><?php echo $faq['toc'];?>
+<?php
+  }
+?>
+</ol>
+</td></tr>
+<tr><td><br></td></tr>
+<tr class="dataTableContent"><td>
+<ol>
+<?php 
+  while ($faq = read_faq($get_lang['directory'])) {
+?>
+<li>
+<span id="<?php echo $faq[faq_id]?>"><b><?php echo $faq['question'];?></b></span><br>
+<?php echo $faq['answer'];?>
+</li><br>
+<?php
+  }
+?>
+</ol>
+</td></tr>
+<?php
+  }
+?>
+<tr><td align="right">
+<?php echo '<a href="' . tep_href_link(FILENAME_FAQ_MANAGER, 'faq_action=Added', 'NONSSL') . '">' . tep_image_button('button_insert.gif', ADD_FAQ) . '</a>'; ?>
+</td></tr>
+</table>
+</td>
+<!-- body_text_eof //-->
+</tr>
+</table>
+<!-- body_eof //-->
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/feature_not_present.php
===================================================================
--- trunk/direct.openmoko.com/admin/feature_not_present.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/feature_not_present.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,94 @@
+<?php
+/*
+  $Id: validate_New.php,v 1.1.1.1 2004/03/04 23:38:20 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+ THIS IS BETA - Use at your own risk!
+  Step-By-Step Manual Order Entry Verion 0.5
+  Customer Entry through Admin
+*/
+
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+
+
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+      <!-- left_navigation //-->
+      <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+      <!-- left_navigation_eof //-->
+    </table></td>
+    <!-- body_text //-->
+    <td width="30">&nbsp;</td>
+    <td width="100%" valign="top">
+      <table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+           <tr>
+              <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            </tr>
+          </table></td>
+        </tr>
+        <!--    <tr><td class="smallText"><br><br>PUT YOUR TEXT HERE</td></tr> -->
+        <!-- Advertising Insert Start -->
+        <p><img src="<?php echo DIR_WS_IMAGES . 'loaded_3box_ad.jpg'; ?>" width="550" height="198" alt="box ad" /><br /></p>
+        <table width="550" border="0" cellspacing="1" cellpadding="2">
+          <tr>
+            <td>
+              <p class="style4">CRE Loaded Professional Version is the perfect application
+              to power your e-Commerce websites. However, if you need features that
+              only a powerfull Business to Business level application can deliver, please take 
+              a look at all the powerful options our B2B Version adds. Our CRE Loaded B2B 
+              has added features to enhance sales and productivity.</p>
+              <p class="style4">Feel free to contact us for more details or usage guidelines. </p>
+            </td>
+          </tr>
+          <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
+          <tr>
+            <td align="center">
+              <a href="http://www.creloaded.com/index.php?cPath=30_31)" target="_blank"><img border="0" src="<?php echo DIR_WS_IMAGES . 'button_upgrade_now.gif'; ?>" ALT="IMAGE_UPGRADE"></a>
+            </td>
+          </tr>
+          <tr>
+            <td>&nbsp;</td>
+          </tr>
+        </table>
+        <!-- Advertising Insert End -->   
+      </table></form>
+    </td>
+    <!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+<!-- footer //-->
+<?php
+    require(DIR_WS_INCLUDES . 'footer.php');
+?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/featured.php
===================================================================
--- trunk/direct.openmoko.com/admin/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,261 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Featured Products admin
+*/
+
+  require('includes/application_top.php');
+
+  function tep_set_featured_status($featured_id, $status) {
+    if ($status == '1') {
+      return tep_db_query("update " . TABLE_FEATURED . " set status = '1', expires_date = NULL, date_status_change = NULL where featured_id = '" . $featured_id . "'");
+    } elseif ($status == '0') {
+      return tep_db_query("update " . TABLE_FEATURED . " set status = '0', date_status_change = now() where featured_id = '" . $featured_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  switch ($HTTP_GET_VARS['action']) {
+    case 'setflag':
+      tep_set_featured_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']);
+      tep_redirect(tep_href_link(FILENAME_FEATURED, '', 'NONSSL'));
+      break;
+    case 'insert':
+      $expires_date = '';
+      if ($HTTP_POST_VARS['day'] && $HTTP_POST_VARS['month'] && $HTTP_POST_VARS['year']) {
+        $expires_date = $HTTP_POST_VARS['year'];
+        $expires_date .= (strlen($HTTP_POST_VARS['month']) == 1) ? '0' . $HTTP_POST_VARS['month'] : $HTTP_POST_VARS['month'];
+        $expires_date .= (strlen($HTTP_POST_VARS['day']) == 1) ? '0' . $HTTP_POST_VARS['day'] : $HTTP_POST_VARS['day'];
+      }
+
+      tep_db_query("insert into " . TABLE_FEATURED . " (products_id, featured_date_added, expires_date, status) values ('" . $HTTP_POST_VARS['products_id'] . "', now(), '" . $expires_date . "', '1')");
+      tep_redirect(tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page']));
+      break;
+    case 'update':
+      $expires_date = '';
+      if ($HTTP_POST_VARS['day'] && $HTTP_POST_VARS['month'] && $HTTP_POST_VARS['year']) {
+        $expires_date = $HTTP_POST_VARS['year'];
+        $expires_date .= (strlen($HTTP_POST_VARS['month']) == 1) ? '0' . $HTTP_POST_VARS['month'] : $HTTP_POST_VARS['month'];
+        $expires_date .= (strlen($HTTP_POST_VARS['day']) == 1) ? '0' . $HTTP_POST_VARS['day'] : $HTTP_POST_VARS['day'];
+      }
+
+      tep_db_query("update " . TABLE_FEATURED . " set featured_last_modified = now(), expires_date = '" . $expires_date . "' where featured_id = '" . $HTTP_POST_VARS['featured_id'] . "'");
+      tep_redirect(tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $featured_id));
+      break;
+    case 'deleteconfirm':
+      $featured_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);
+
+      tep_db_query("delete from " . TABLE_FEATURED . " where featured_id = '" . tep_db_input($featured_id) . "'");
+
+      tep_redirect(tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page']));
+      break;
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php
+  if ( ($HTTP_GET_VARS['action'] == 'new') || ($HTTP_GET_VARS['action'] == 'edit') ) {
+?>
+<link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
+<script language="JavaScript" src="includes/javascript/calendarcode.js"></script>
+<?php
+  }
+?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<div id="popupcalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ( ($HTTP_GET_VARS['action'] == 'new') || ($HTTP_GET_VARS['action'] == 'edit') ) {
+    $form_action = 'insert';
+    if ( ($HTTP_GET_VARS['action'] == 'edit') && ($HTTP_GET_VARS['sID']) ) {
+    $form_action = 'update';
+
+      $product_query = tep_db_query("select p.products_id, pd.products_name, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_FEATURED . " s where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id and s.featured_id = '" . $HTTP_GET_VARS['sID'] . "' order by pd.products_name");
+      $product = tep_db_fetch_array($product_query);
+
+      $sInfo = new objectInfo($product);
+    } else {
+      $sInfo = new objectInfo(array());
+
+// create an array of featured products, which will be excluded from the pull down menu of products
+// (when creating a new featured product)
+      $featured_array = array();
+      $featured_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s where s.products_id = p.products_id");
+      while ($featured = tep_db_fetch_array($featured_query)) {
+        $featured_array[] = $featured['products_id'];
+      }
+    }
+?>
+      <tr><form name="new_feature" <?php echo 'action="' . tep_href_link(FILENAME_FEATURED, tep_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('featured_id', $HTTP_GET_VARS['sID']); ?>
+        <td><br><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_FEATURED_PRODUCT; ?>&nbsp;</td>
+            <td class="main"><?php echo ($sInfo->products_name) ? $sInfo->products_name : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $featured_array); echo tep_draw_hidden_field('products_price', $sInfo->products_price); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_FEATURED_EXPIRES_DATE; ?>&nbsp;</td>
+            <td class="main"><?php echo tep_draw_input_field('day', substr($sInfo->expires_date, 8, 2), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', substr($sInfo->expires_date, 5, 2), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', substr($sInfo->expires_date, 0, 4), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_feature','dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $HTTP_GET_VARS['sID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </form></tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+                <td class="dataTableHeadingContent" align="right">&nbsp;</td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $featured_query_raw = "select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id order by pd.products_name";
+    $featured_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $featured_query_raw, $featured_query_numrows);
+    $featured_query = tep_db_query($featured_query_raw);
+    while ($featured = tep_db_fetch_array($featured_query)) {
+      if ( ((!$HTTP_GET_VARS['sID']) || ($HTTP_GET_VARS['sID'] == $featured['featured_id'])) && (!$sInfo) ) {
+
+        $products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $featured['products_id'] . "'");
+        $products = tep_db_fetch_array($products_query);
+        $sInfo_array = array_merge($featured, $products);
+        $sInfo = new objectInfo($sInfo_array);
+      }
+
+      if ( (is_object($sInfo)) && ($featured['featured_id'] == $sInfo->featured_id) ) {
+        echo '                  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '                  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $featured['featured_id']) . '\'">' . "\n";
+      }
+?>
+                <td  class="dataTableContent"><?php echo $featured['products_name']; ?></td>
+                <td  class="dataTableContent" align="right">&nbsp;</td>
+                <td  class="dataTableContent" align="right">
+<?php
+      if ($featured['status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_FEATURED, 'action=setflag&flag=0&id=' . $featured['featured_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_FEATURED, 'action=setflag&flag=1&id=' . $featured['featured_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($sInfo)) && ($featured['featured_id'] == $sInfo->featured_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $featured['featured_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+      </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $featured_split->display_count($featured_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_FEATURED); ?></td>
+                    <td class="smallText" align="right"><?php echo $featured_split->display_links($featured_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (!$HTTP_GET_VARS['action']) {
+?>
+                  <tr>
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_FEATURED . '</b>');
+
+      $contents = array('form' => tep_draw_form('featured', FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $sInfo->products_name . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($sInfo)) {
+        $heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_FEATURED, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->featured_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->featured_date_added));
+        $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->featured_last_modified));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
+
+        $contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . tep_date_short($sInfo->expires_date) . '</b>');
+        $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . tep_date_short($sInfo->date_status_change));
+      }
+      break;
+  }
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+}
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/feeds/delete_me_for_zip_only.txt
===================================================================

Added: trunk/direct.openmoko.com/admin/feeds/test.txt
===================================================================
--- trunk/direct.openmoko.com/admin/feeds/test.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/feeds/test.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+product_url    name    description   price   image_url   category    offer_id
+http://192.168.1.35/loaded615test/product_info.php?products_id=1  Matrox G200 MMS Reinforcing its position as a multi-monitor trailblazer, Matrox Graphics Inc. has once again developed the most flexible and highly advanced solution in the industry. Introducing the new Matrox G200 Multi-Monitor Series; the first graphics card ever to support up to four DVI digital flat panel displays on a single 8" PCI board.  With continuing demand for digital flat panels in the financial workplace, the Matrox G200 MMS is the ultimate in flexible solutions. The Matrox G200 MMS also supports the new digital video interface (DVI) created by the Digital Display Working Group (DDWG) designed to ease the adoption of digital flat panels. Other configurations include composite video capture ability and onboard TV tuner, making the Matrox G200 MMS the complete solution for business needs.  Based on the award-winning MGA-G200 graphics chip, the Matrox G200 Multi-Monitor Series provides superior 2D/3D graphics acceleration to meet the demanding needs of business applications such as real-time stock quotes (Versus), live video feeds (Reuters &amp; Bloombergs), multiple windows applications, word processing, spreadsheets and CAD.  299.99  http://192.168.1.35/loaded615test/images/matrox/mg200mms.gif   Hardware > Graphics Cards  1 
+http://192.168.1.35/loaded615test/product_info.php?products_id=2  Matrox G400 32MB  Dramatically Different High Performance Graphics   Introducing the Millennium G400 Series - a dramatically different, high performance graphics experience. Armed with the industry&#39s fastest graphics chip, the Millennium G400 Series takes explosive acceleration two steps further by adding unprecedented image quality, along with the most versatile display options for all your 3D, 2D and DVD applications. As the most powerful and innovative tools in your PC&#39s arsenal, the Millennium G400 Series will not only change the way you see graphics, but will revolutionize the way you use your computer.   Key features:   New Matrox G400 256-bit DualBus graphics chip  Explosive 3D, 2D and DVD performance  DualHead Display  Superior DVD and TV output  3D Environment-Mapped Bump Mapping  Vibrant Color Quality rendering   UltraSharp DAC of up to 360 MHz  3D Rendering Array Processor  Support for 16 or 32 MB of memory 499.99  http://192.168.1.35/loaded615test/images/matrox/mg400-32mb.gif   Hardware > Graphics Cards  2 
+http://192.168.1.35/loaded615test/product_info.php?products_id=3  Microsoft IntelliMouse Pro  Every element of IntelliMouse Pro - from its unique arched shape to the texture of the rubber grip around its base - is the product of extensive customer and ergonomic research. Microsoft&#39s popular wheel control, which now allows zooming and universal scrolling functions, gives IntelliMouse Pro outstanding comfort and efficiency.  49.99 http://192.168.1.35/loaded615test/images/microsoft/msimpro.gif   Hardware > Mice  3 
+http://192.168.1.35/loaded615test/product_info.php?products_id=4  The Replacement Killers Regional Code: 2 (Japan, Europe, Middle East, South Africa). Languages: English, Deutsch. Subtitles: English, Deutsch, Spanish. Audio: Dolby Surround 5.1. Picture Format: 16:9 Wide-Screen. Length: (approx) 80 minutes. Other: Interactive Menus, Chapter Selection, Subtitles (more languages).  42.00 http://192.168.1.35/loaded615test/images/dvd/replacement_killers.gif   DVD Movies > Action  4 
+http://192.168.1.35/loaded615test/product_info.php?products_id=5  Blade Runner - Director&#39s Cut  Regional Code: 2 (Japan, Europe, Middle East, South Africa). Languages: English, Deutsch. Subtitles: English, Deutsch, Spanish. Audio: Dolby Surround 5.1. Picture Format: 16:9 Wide-Screen. Length: (approx) 112 minutes. Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 35.99 http://192.168.1.35/loaded615test/images/dvd/blade_runner.gif  DVD Movies > Science Fiction 5 
+http://192.168.1.35/loaded615test/product_info.php?products_id=6  The Matrix  Regional Code: 2 (Japan, Europe, Middle East, South Africa).  Languages: English, Deutsch.  Subtitles: English, Deutsch.  Audio: Dolby Surround.  Picture Format: 16:9 Wide-Screen.  Length: (approx) 131 minutes.  Other: Interactive Menus, Chapter Selection, Making Of. 39.99 http://192.168.1.35/loaded615test/images/the_matrix.gif  DVD Movies > Action  6 
+http://192.168.1.35/loaded615test/product_info.php?products_id=7  You&#39ve Got Mail  Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch, Spanish.   Subtitles: English, Deutsch, Spanish, French, Nordic, Polish.   Audio: Dolby Digital 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 115 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 34.99 http://192.168.1.35/loaded615test/images/dvd/youve_got_mail.gif  DVD Movies > Comedy  7 
+http://192.168.1.35/loaded615test/product_info.php?products_id=8  A Bug&#39s Life Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Digital 5.1 / Dobly Surround Stereo.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 91 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 32.3910 http://192.168.1.35/loaded615test/images/dvd/a_bugs_life.gif   DVD Movies > Cartoons  8 
+http://192.168.1.35/loaded615test/product_info.php?products_id=9  Under Siege Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 98 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages).  29.99 http://192.168.1.35/loaded615test/images/dvd/under_siege.gif   DVD Movies > Action  9 
+http://192.168.1.35/loaded615test/product_info.php?products_id=10 Under Siege 2 - Dark Territory  Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 98 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages).  29.99 http://192.168.1.35/loaded615test/images/dvd/under_siege2.gif  DVD Movies > Action  10 
+http://192.168.1.35/loaded615test/product_info.php?products_id=11 Fire Down Below Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 100 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 29.99 http://192.168.1.35/loaded615test/images/dvd/fire_down_below.gif   DVD Movies > Action  11 
+http://192.168.1.35/loaded615test/product_info.php?products_id=12 Die Hard With A Vengeance Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 122 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 39.99 http://192.168.1.35/loaded615test/images/dvd/die_hard_3.gif  DVD Movies > Action  12 
+http://192.168.1.35/loaded615test/product_info.php?products_id=13 Lethal Weapon Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 100 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 34.99 http://192.168.1.35/loaded615test/images/dvd/lethal_weapon.gif   DVD Movies > Action  13 
+http://192.168.1.35/loaded615test/product_info.php?products_id=14 Red Corner  Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 117 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 32.00 http://192.168.1.35/loaded615test/images/dvd/red_corner.gif  DVD Movies > Drama 14 
+http://192.168.1.35/loaded615test/product_info.php?products_id=15 Frantic Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 115 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 35.00 http://192.168.1.35/loaded615test/images/dvd/frantic.gif   DVD Movies > Thriller  15 
+http://192.168.1.35/loaded615test/product_info.php?products_id=16 Courage Under Fire  Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 112 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 38.99 http://192.168.1.35/loaded615test/images/dvd/courage_under_fire.gif  DVD Movies > Drama 16 
+http://192.168.1.35/loaded615test/product_info.php?products_id=17 Speed Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 112 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 39.99 http://192.168.1.35/loaded615test/images/dvd/speed.gif   DVD Movies > Action  17 
+http://192.168.1.35/loaded615test/product_info.php?products_id=18 Speed 2: Cruise Control Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 120 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 42.00 http://192.168.1.35/loaded615test/images/dvd/speed_2.gif   DVD Movies > Action  18 
+http://192.168.1.35/loaded615test/product_info.php?products_id=19 There&#39s Something About Mary Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 114 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 49.99 http://192.168.1.35/loaded615test/images/dvd/theres_something_about_mary.gif   DVD Movies > Comedy  19 
+http://192.168.1.35/loaded615test/product_info.php?products_id=20 Beloved Regional Code: 2 (Japan, Europe, Middle East, South Africa).   Languages: English, Deutsch.   Subtitles: English, Deutsch, Spanish.   Audio: Dolby Surround 5.1.   Picture Format: 16:9 Wide-Screen.   Length: (approx) 164 minutes.   Other: Interactive Menus, Chapter Selection, Subtitles (more languages). 54.99 http://192.168.1.35/loaded615test/images/dvd/beloved.gif   DVD Movies > Drama 20 
+http://192.168.1.35/loaded615test/product_info.php?products_id=21 SWAT 3: Close Quarters Battle Windows 95/98   211 in progress with shots fired. Officer down. Armed suspects with hostages. Respond Code 3! Los Angles, 2005, In the next seven days, representatives from every nation around the world will converge on Las Angles to witness the signing of the United Nations Nuclear Abolishment Treaty. The protection of these dignitaries falls on the shoulders of one organization, LAPD SWAT. As part of this elite tactical organization, you and your team have the weapons and all the training necessary to protect, to serve, and &#34When needed&#34 to use deadly force to keep the peace. It takes more than weapons to make it through each mission. Your arsenal includes C2 charges, flashbangs, tactical grenades. opti-Wand mini-video cameras, and other devices critical to meeting your objectives and keeping your men free of injury. Uncompromised Duty, Honor and Valor! 79.99 http://192.168.1.35/loaded615test/images/sierra/swat_3.gif   Software > Simulation  21 
+http://192.168.1.35/loaded615test/product_info.php?products_id=22 Unreal Tournament From the creators of the best-selling Unreal, comes Unreal Tournament. A new kind of single player experience. A ruthless multiplayer revolution.  This stand-alone game showcases completely new team-based gameplay, groundbreaking multi-faceted single player action or dynamic multi-player mayhem. It's a fight to the finish for the title of Unreal Grand Master in the gladiatorial arena. A single player experience like no other! Guide your team of 'bots' (virtual teamates) against the hardest criminals in the galaxy for the ultimate title - the Unreal Grand Master.  89.99 http://192.168.1.35/loaded615test/images/gt_interactive/unreal_tournament.gif  Software > Action  22 
+http://192.168.1.35/loaded615test/product_info.php?products_id=23 The Wheel Of Time The world in which The Wheel of Time takes place is lifted directly out of Jordan&#39s pages; it&#39s huge and consists of many different environments. How you navigate the world will depend largely on which game - single player or multipayer - you&#39re playing. The single player experience, with a few exceptions, will see Elayna traversing the world mainly by foot (with a couple notable exceptions). In the multiplayer experience, your character will have more access to travel via Ter&#39angreal, Portal Stones, and the Ways. However you move around, though, you&#39ll quickly discover that means of locomotion can easily become the least of the your worries...  During your travels, you quickly discover that four locations are crucial to your success in the game. Not surprisingly, these locations are the homes of The Wheel of Time&#39s main characters. Some of these places are ripped directly from the pages of Jordan&#39s books, made flesh with Legend&#39s unparalleled pixel-pushing ways. Other places are specific to the game, conceived and executed with the intent of expanding this game world even further. Either way, they provide a backdrop for some of the most intense first person action and strategy you&#39ll have this year.  99.99 http://192.168.1.35/loaded615test/images/gt_interactive/wheel_of_time.gif  Software > Strategy  23 
+http://192.168.1.35/loaded615test/product_info.php?products_id=24 Disciples: Sacred Lands A new age is dawning...  Enter the realm of the Sacred Lands, where the dawn of a New Age has set in motion the most momentous of wars. As the prophecies long foretold, four races now clash with swords and sorcery in a desperate bid to control the destiny of their gods. Take on the quest as a champion of the Empire, the Mountain Clans, the Legions of the Damned, or the Undead Hordes and test your faith in battles of brute force, spellbinding magic and acts of guile. Slay demons, vanquish giants and combat merciless forces of the dead and undead. But to ensure the salvation of your god, the hero within must evolve.  The day of reckoning has come... and only the chosen will survive. 90.00 http://192.168.1.35/loaded615test/images/gt_interactive/disciples.gif  Software > Strategy  24 
+http://192.168.1.35/loaded615test/product_info.php?products_id=25 Microsoft Internet Keyboard PS/2  The Internet Keyboard has 10 Hot Keys on a comfortable standard keyboard design that also includes a detachable palm rest. The Hot Keys allow you to browse the web, or check e-mail directly from your keyboard. The IntelliType Pro software also allows you to customize your hot keys - make the Internet Keyboard work the way you want it to! 69.99 http://192.168.1.35/loaded615test/images/microsoft/intkeyboardps2.gif  Hardware > Keyboards 25 
+http://192.168.1.35/loaded615test/product_info.php?products_id=26 Microsoft IntelliMouse Explorer Microsoft introduces its most advanced mouse, the IntelliMouse Explorer! IntelliMouse Explorer features a sleek design, an industrial-silver finish, a glowing red underside and taillight, creating a style and look unlike any other mouse. IntelliMouse Explorer combines the accuracy and reliability of Microsoft IntelliEye optical tracking technology, the convenience of two new customizable function buttons, the efficiency of the scrolling wheel and the comfort of expert ergonomic design. All these great features make this the best mouse for the PC!  64.95 http://192.168.1.35/loaded615test/images/microsoft/imexplorer.gif  Hardware > Mice  26 
+http://192.168.1.35/loaded615test/product_info.php?products_id=27 Hewlett Packard LaserJet 1100Xi HP has always set the pace in laser printing technology. The new generation HP LaserJet 1100 series sets another impressive pace, delivering a stunning 8 pages per minute print speed. The 600 dpi print resolution with HP's Resolution Enhancement technology (REt) makes every document more professional.  Enhanced print speed and laser quality results are just the beginning. With 2MB standard memory, HP LaserJet 1100xi users will be able to print increasingly complex pages. Memory can be increased to 18MB to tackle even more complex documents with ease. The HP LaserJet 1100xi supports key operating systems including Windows 3.1, 3.11, 95, 98, NT 4.0, OS/2 and DOS. Network compatibility available via the optional HP JetDirect External Print Servers.  HP LaserJet 1100xi also features The Document Builder for the Web Era from Trellix Corp. (featuring software to create Web documents). 499.99  http://192.168.1.35/loaded615test/images/lj1100xi.gif  Hardware > Printers  27 
+http://192.168.1.35/loaded615test/product_info.php?products_id=28 $25 Gift Certificate  Buy a Gift Certificate for your friends or family 25.00 http://192.168.1.35/loaded615test/images/giftcert-25-sm.gif  Gift Certificate 28 

Added: trunk/direct.openmoko.com/admin/forbiden.php
===================================================================
--- trunk/direct.openmoko.com/admin/forbiden.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/forbiden.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+/*
+  $Id: forbiden.php,v 1.1.1.1 2004/03/04 23:38:34 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $current_boxes = DIR_FS_ADMIN . DIR_WS_BOXES;
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top">
+      <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2" align="center">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo NAVBAR_TITLE; ?></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td align="left" class="dataTableContent"><?php echo TEXT_MAIN; ?></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td align="left"><?php echo '&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>&nbsp;'; ?></td>
+              </tr>
+            </table>
+        </td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/froogle.php
===================================================================
--- trunk/direct.openmoko.com/admin/froogle.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/froogle.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,184 @@
+<?php
+/*
+  $Id: froogle.php,v 1.1.1.1 2004/03/04 23:38:07 zip1 Exp $
+  http://www.oscommerce.com
+   Froogle Data Feeder!
+   
+  Copyright (c) 2002 - 2005 Calvin K
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+
+
+//  Start TIMER
+//  -----------
+$stimer = explode( ' ', microtime() );
+$stimer = $stimer[1] + $stimer[0];
+//  -----------
+    $data_files_id1 = (int)$HTTP_POST_VARS['feed_froogle'];
+    //$data_files_id1 = '2';
+    $data_query_raw = tep_db_query("select * from  " . TABLE_DATA_FILES . " where data_files_id = '" . $data_files_id1 . "' order by data_files_service ");
+    while ($data = tep_db_fetch_array($data_query_raw)) {
+  $data_files_id = $data[data_files_id];
+  $data_files_type = $data[data_files_type];
+  $data_files_disc = $data[data_files_disc];
+  $data_files_type1 = $data[data_files_type1];
+  $data_files_service = $data[data_files_service];
+  $data_status = $data[data_status];
+  $data_files_name = $data[data_files_name];
+  $data_image_url = $data[data_image_url];
+  $ftp_server = $data[data_ftp_server];
+  $ftp_user_name = $data[data_ftp_user_name];
+  $ftp_user_pass = $data[data_ftp_user_pass];
+  $ftp_directory = $data[data_ftp_directory];
+  $data_tax_class_id = $data[data_tax_class_id];
+  $data_convert_cur = $data[data_convert_cur];
+  $data_cur_use = $data[data_cur_use];
+  $data_cur = $data[data_cur];
+  $data_lang_use = $data[data_lang_use];
+  $data_lang = $data[data_lang];
+  }
+  
+$OutFile = $data_files_name; 
+$source_file = DIR_FS_ADMIN . "feeds/" . $data_files_name;
+$destination_file= $data_files_name;
+
+$already_sent = array();
+
+// end configuration information
+//Start FTP to Froogle
+
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="menuBoxHeading">
+                         <tr>
+                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                       <tr>
+                         <td class="pageHeading"><?php echo HEADING_TITLE ; ?></td>
+                        </tr>
+                        <tr>
+                        <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                       </tr>
+                     </table></td>
+                   </tr>
+
+    <tr>
+        <td>
+
+<?php
+function ftp_file( $ftpservername, $ftpusername, $ftppassword, $ftpsourcefile, $ftpdirectory, $ftpdestinationfile )
+{
+// set up basic connection
+$conn_id = ftp_connect($ftpservername);
+if ( $conn_id == false )
+{
+echo TEXT_INFO_FTP_ERROR1 . $ftpservername . "<BR>\n" ;
+return false;
+}
+
+// login with username and password
+$login_result = ftp_login($conn_id, $ftpusername, $ftppassword);
+
+// check connection
+if ((!$conn_id) || (!$login_result)) {
+echo TEXT_INFO_FTP_ERROR2 . "<BR>\n";
+echo TEXT_INFO_FTP_ERROR3 . $ftpservername . TEXT_INFO_FTP_ERROR4 . $ftpusername . "<BR>\n";
+return false;
+} else {
+echo TEXT_INFO_FTP_ERROR5 . $ftpservername . TEXT_INFO_FTP_ERROR4 . $ftpusername . "<BR>\n";
+}
+
+if ( strlen( $ftpdirectory ) > 0 )
+{
+if (ftp_chdir($conn_id, $ftpdirectory )) {
+echo TEXT_INFO_FTP_ERROR6 . ftp_pwd($conn_id) . "<BR>\n";
+} else {
+echo TEXT_INFO_FTP_ERROR7 . $ftpservername . "<BR>\n";
+return false;
+}
+}
+
+ftp_pasv ( $conn_id, true ) ;
+// upload the file
+$upload = ftp_put( $conn_id, $ftpdestinationfile, $ftpsourcefile, FTP_ASCII );
+//echo $conn_id . $ftpdestinationfile . $ftpsourcefile ;
+// check upload status
+if (!$upload) {
+echo $ftpservername . ' ' . $upload . TEXT_INFO_FTP_ERROR8 . "<BR>\n";
+return false;
+} else {
+echo sprintf(TEXT_INFO_FTP_ERROR9, $ftpsourcefile, $ftpservername, $ftpdestinationfile) . "<BR>\n";
+}
+
+// close the FTP stream
+ftp_close($conn_id);
+
+return true;
+}
+
+ftp_file( $ftp_server, $ftp_user_name, $ftp_user_pass, $source_file, $ftp_directory, $destination_file);
+
+//End FTP to Froogle
+
+
+//  End TIMER
+//  ---------
+$etimer = explode( ' ', microtime() );
+$etimer = $etimer[1] + $etimer[0];
+echo '<tr><td> <p style="margin:auto; text-align:center">';
+echo printf( TEXT_INFO_FTP_SCRITP_TIMER , ($etimer-$stimer) ) ;
+echo tep_draw_form('data', FILENAME_FROOGLE_ADMIN, '', 'post', ''); 
+
+echo '</p></td><td>';
+
+
+//  ---------
+
+
+?>
+<tr>
+<td align="left" class="main"><br><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?>
+</form>
+</td>
+</tr>
+ 
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
+
+?>
+?>

Added: trunk/direct.openmoko.com/admin/froogle_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/froogle_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/froogle_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,127 @@
+<?php
+/*
+  $Id: server_info.php,v 1.6 2003/06/30 13:13:49 dgw_ Exp $
+
+
+  Copyright (c) 2005 Chainreactionworks.com
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+include (DIR_WS_LANGUAGES . $language . '/' . FILENAME_DATA);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="menuBoxHeading">
+                         <tr>
+                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                       <tr>
+                         <td class="pageHeading"><?php echo HEADING_TITLE . TEXT_FEED_FROOGLE; ?></td>
+                        </tr>
+                        <tr>
+                        <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                       </tr>
+                     </table></td>
+                   </tr>
+<tr class="attributeBoxContent">
+
+ <td>
+ <?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'  ; ?>
+</td>
+</tr>
+    <tr>
+        <td><?php
+        // froogle
+        $data_query = tep_db_query("select data_files_id, data_name from " . TABLE_DATA_FILES . " where data_status = '1' and data_files_service = 'froogle' ");
+        while ($data = tep_db_fetch_array($data_query)) {
+        
+              $file_type_array[] = array('id' => $data['data_files_id'], 'text' => $data['data_name']) ;
+         }
+
+    ?>
+
+      <tr>
+       <td>
+        <?php 
+          //configure
+        
+          echo '&nbsp;' . TEXT_CONFIGURE . tep_draw_form('run', FILENAME_DATA_ADMIN, 'page=1', 'post', ''); 
+          echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . TEXT_FEED_CONFIGURE_HELP1 ;
+          echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_run.gif', TEXT_SET_CATEGORIES) . '</form>'; 
+
+          echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=froogle_configure') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+
+         //set category string
+         echo '<br> &nbsp;' . TEXT_SET_CATEGORIES . tep_draw_form('run', FILENAME_FROOGLE_PRE1, 'action=run', 'post', ''); 
+   echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . TEXT_SET_CATEGORIES_HELP1 ;
+   echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_run.gif', TEXT_SET_CATEGORIES) . '</form>'; 
+         echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=froogle_category') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+
+         //run pre feed
+         echo '<br> &nbsp;' . TEXT_FEED_PRE_FEED . tep_draw_form('run', FILENAME_FROOGLE_PRE, 'action=run', 'post', ''); 
+         echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . TEXT_FEED_PRE_FEED_HELP1 ;      
+         echo tep_draw_separator('pixel_trans.gif', '5', '15') . tep_draw_pull_down_menu('feed_froogle', $file_type_array, $data['data_files_id']) ;
+         echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_run.gif', TEXT_FEED_FROOGLE) . '</form>'; 
+         echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=froogle_preprocess') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+
+        // send to froogle
+         echo '<br> &nbsp;' . TEXT_FEED_RUN . tep_draw_form('run_feed', FILENAME_FROOGLE, 'action=run', 'post', ''); 
+         echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . TEXT_FEED_RUN_HELP1 ;     
+         echo tep_draw_separator('pixel_trans.gif', '5', '15') . tep_draw_pull_down_menu('feed_froogle', $file_type_array, $data['data_files_id']) ;
+         echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_run.gif', TEXT_FEED_FROOGLE);
+         echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp; &nbsp; <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_DATA_HELP,'action=froogle_send') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> ';
+
+        ?>
+        </td> </form>
+      </tr>
+      <tr>
+              <td>
+              <?php echo TEXT_FEED_HELP . '<br>';?>
+              <?php echo TEXT_FEED_HELP_CONFIGURE . '<br>';?>
+              <?php echo TEXT_FEED_HELP_SELECT . '<br>';?>
+              <?php echo TEXT_FEED_HELP_PREFEED . '<br>';?>
+              <?php echo TEXT_FEED_HELP_RUN . '<br>';?>
+          
+             </td>
+
+      </tr>
+
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/froogle_pre.php
===================================================================
--- trunk/direct.openmoko.com/admin/froogle_pre.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/froogle_pre.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,486 @@
+<?php
+/*
+  $Id: froogle_pre.php,v 1.1.1.1  zip1 Exp $
+  http://www.oscommerce.com
+   Froogle Data Feeder!
+   
+  Copyright (c) 2002 - 2005 Calvin K
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="menuBoxHeading">
+                         <tr>
+                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                       <tr>
+                         <td class="pageHeading"><?php echo HEADING_TITLE ; ?></td>
+                        </tr>
+                        <tr>
+                        <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                       </tr>
+                     </table></td>
+                   </tr>
+
+    <tr>
+        <td>
+ <?php       
+
+
+//  Start TIMER
+//  -----------
+$stimer = explode( ' ', microtime() );
+$stimer = $stimer[1] + $stimer[0];
+//  -----------
+    $data_files_id1 = (int)$HTTP_POST_VARS['feed_froogle'];
+    //$data_files_id1 = '2';
+    $data_query_raw = tep_db_query("select * from  " . TABLE_DATA_FILES . " where data_files_id = '" . $data_files_id1 . "' order by data_files_service ");
+    while ($data = tep_db_fetch_array($data_query_raw)) {
+  $data_files_id = $data[data_files_id];
+  $data_files_type = $data[data_files_type];
+  $data_files_disc = $data[data_files_disc];
+  $data_files_type1 = $data[data_files_type1];
+  $data_files_service = $data[data_files_service];
+  $data_status = $data[data_status];
+  $data_files_name = $data[data_files_name];
+  $data_image_url = $data[data_image_url];
+  $ftp_server = $data[data_ftp_server];
+  $ftp_user_name = $data[data_ftp_user_name];
+  $ftp_user_pass = $data[data_ftp_user_pass];
+  $ftp_directory = $data[data_ftp_directory];
+  $data_tax_class_id = $data[data_tax_class_id];
+  $data_convert_cur = $data[data_convert_cur];
+  $data_cur_use = $data[data_cur_use];
+  $data_cur = $data[data_cur];
+  $data_lang_use = $data[data_lang_use];
+  $data_lang = $data[data_lang];
+  }
+  
+  
+  
+$OutFile = DIR_FS_ADMIN . "feeds/" . $data_files_name; 
+$destination_file = DIR_WS_ADMIN . "feeds/" . $data_files_name;
+$source_file = $OutFile;
+$imageURL = HTTP_SERVER . DIR_WS_CATALOG . 'images/' . $data_image_url ;
+$productURL1 = HTTP_SERVER . DIR_WS_CATALOG .'product_info.php?products_id=';
+
+$already_sent = array();
+
+$taxRate = 0; //default = 0 (e.g. for 17.5% tax use "$taxRate = 17.5;")
+$taxCalc = ($taxRate/100) + 1;  //Do not edit
+$convertCur = $data_convert_cur; //default = false
+$curType = $data_cur; // Converts Currency to any defined currency (eg. USD, EUR, GBP)
+if($convertCur == 'true')
+{
+$productURL1 = HTTP_SERVER . DIR_WS_CATALOG . "product_info.php?currency=" . $curType . "&products_id=";  //where CURTYPE is your currency type (eg. USD, EUR, GBP)
+}
+
+//START Advance Optional Values
+
+//(0=False 1=True) (optional_sec must be enabled to use any options)
+if ($data_files_type = basic){
+   $optional_sec = '0';
+ } elseif ($data_files_type == 'advance'){  
+  $optional_sec = '1';
+  }
+$instock = 0;
+$shipping = 0;
+  $lowestShipping = "4.95";  //this is not binary.
+$brand = 0;
+$upc = 0;   //Not supported by default osC
+$manufacturer_id = 0;  //Not supported by default osC
+$product_type = 0;
+$currency = 0;
+  $default_currency = "USD";  //this is not binary.
+$feed_language = 0;
+  $default_feed_language = "en";  //this is not binary.
+$ship_to = 0;
+  $default_ship_to = "ALL"; //this is not binary, not supported by default osC for individual products.
+$ship_from = 0;
+  $default_ship_from = "USD"; //this is not binary, not supported by default osC for individual products.
+
+//END of Advance Optional Values
+
+
+$sql = "SELECT products.products_id AS product_url,
+               products_model AS prodModel,
+               products_weight,
+               manufacturers.manufacturers_name AS mfgName,
+               manufacturers.manufacturers_id,
+               products.products_id AS id,
+               products_description.products_name AS name,
+               products_description.products_description AS description,
+               products.products_quantity AS quantity,
+               products.products_status AS prodStatus,
+               FORMAT( IFNULL(specials.specials_new_products_price, products.products_price) ,2) AS price,
+               CONCAT( '" . $imageURL . "' ,products.products_image) AS image_url,
+               products_to_categories.categories_id AS prodCatID,
+               categories.parent_id AS catParentID,
+               categories_description.categories_name AS catName
+        FROM categories,
+             categories_description,
+             products_description,
+             products_to_categories,
+             products
+        left join manufacturers on ( manufacturers.manufacturers_id = products.manufacturers_id )
+        left join specials on ( specials.products_id = products.products_id AND ( ( (specials.expires_date > CURRENT_DATE) OR (specials.expires_date = 0) ) AND ( specials.status = 1 ) ) )
+        WHERE products.products_id=products_description.products_id
+          AND products.products_id=products_to_categories.products_id
+          AND products_to_categories.categories_id=categories.categories_id
+          AND categories.categories_id=categories_description.categories_id
+        ORDER BY products.products_id ASC, 
+                 prodModel
+       ";
+function tep_get_products_special_price($product_id) {
+
+global $link;
+
+$product_sql = "select products_price, products_model from products where products_id = '" . $product_id . "'";
+//echo $sql."<BR>";
+
+$product_query = tep_db_query($product_sql);
+if (tep_db_num_rows($product_query)) {
+$product = tep_db_fetch_array($product_query);
+$product_price = $product['products_price'];
+} else {
+return false;
+}
+
+$specials_query = tep_db_query("select specials_new_products_price from specials where products_id = '" . $product_id . "' and status");
+if (tep_db_num_rows($specials_query)) {
+$special = tep_db_fetch_array($specials_query);
+$special_price = $special['specials_new_products_price'];
+} else {
+$special_price = false;
+}
+
+if(substr($product['products_model'], 0, 4) == 'GIFT') { //Never apply a salededuction to Ian Wilson's Giftvouchers
+return $special_price;
+}
+
+$product_to_categories_query = tep_db_query("select categories_id from products_to_categories where products_id = '" . $product_id . "'");
+$product_to_categories = tep_db_fetch_array($product_to_categories_query);
+$category = $product_to_categories['categories_id'];
+
+$sale_query = tep_db_query("select sale_specials_condition, sale_deduction_value, sale_deduction_type from salemaker_sales where sale_categories_all like '%," . $category . ",%' and sale_status = '1' and (sale_date_start <= now() or sale_date_start = '0000-00-00') and (sale_date_end >= now() or sale_date_end = '0000-00-00') and (sale_pricerange_from <= '" . $product_price . "' or sale_pricerange_from = '0') and (sale_pricerange_to >= '" . $product_price . "' or sale_pricerange_to = '0')");
+if (tep_db_num_rows($sale_query)) {
+$sale = tep_db_fetch_array($sale_query);
+} else {
+return $special_price;
+}
+
+if (!$special_price) {
+$tmp_special_price = $product_price;
+} else {
+$tmp_special_price = $special_price;
+}
+
+switch ($sale['sale_deduction_type']) {
+case 0:
+$sale_product_price = $product_price - $sale['sale_deduction_value'];
+$sale_special_price = $tmp_special_price - $sale['sale_deduction_value'];
+break;
+case 1:
+$sale_product_price = $product_price - (($product_price * $sale['sale_deduction_value']) / 100);
+$sale_special_price = $tmp_special_price - (($tmp_special_price * $sale['sale_deduction_value']) / 100);
+break;
+case 2:
+$sale_product_price = $sale['sale_deduction_value'];
+$sale_special_price = $sale['sale_deduction_value'];
+break;
+default:
+return $special_price;
+}
+
+if ($sale_product_price < 0) {
+$sale_product_price = 0;
+}
+
+if ($sale_special_price < 0) {
+$sale_special_price = 0;
+}
+
+if (!$special_price) {
+return number_format($sale_product_price, 4, '.', '');
+} else {
+switch($sale['sale_specials_condition']){
+case 0:
+return number_format($sale_product_price, 4, '.', '');
+break;
+case 1:
+return number_format($special_price, 4, '.', '');
+break;
+case 2:
+return number_format($sale_special_price, 4, '.', '');
+break;
+default:
+return number_format($special_price, 4, '.', '');
+}
+}
+}
+//Salesmaker changes... Show correct price... .... End
+
+  function tep_get_category_feed_path($products_id) {
+     $category_query = tep_db_query("select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int)$products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id limit 1");
+    if (tep_db_num_rows($category_query)) {
+     $category = mysql_fetch_object($category_query);
+      $category_query1 = tep_db_query("select * from " . TABLE_DATA_CAT . " where cat_id = '" . $category.p2c.categories_id . "'");
+     $category1 = mysql_fetch_object($category_query1);
+     }
+$feed_cat= $category1['cat_tree'];
+    return $feed_cat;
+  }
+
+$_strip_search = array(
+"![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars
+'%[\r\n]+%m'); // remove CRs and newlines
+$_strip_replace = array(
+'',
+'');
+$_cleaner_array = array(">" => "> ", "&reg;" => "", "®" => "", "&trade;" => "", "™" => "");
+
+if ( file_exists( $OutFile ) )
+unlink( $OutFile );
+
+//$output = "product_url \t name \t description \t price \t image_url \t category \t offer_id";
+$output = TEXT_OUTPUT_1;
+
+//create optional section
+if($optional_sec == 1)
+{
+  /*
+  if($instock == 1)
+    $output .= "\t instock ";
+  if($shipping == 1)
+    $output .= "\t shipping ";
+  if($brand == 1)
+    $output .= "\t brand ";
+  if($upc == 1)
+    $output .= "\t upc ";
+  if($manufacturer_id == 1)
+    $output .= "\t manufacturer_id ";
+  if($product_type == 1)
+    $output .= "\t product_type ";
+  if($currency == 1)
+    $output .= "\t currency ";
+  if($feed_language == 1)
+    $output .= "\t language ";
+  if($ship_to == 1)
+    $output .= "\t ship_to ";
+  if($ship_from == 1)
+    $output .= "\t ship_from ";
+
+    */
+
+    if($instock == 1)
+    $output .= TEXT_OUTPUT_2;
+  if($shipping == 1)
+    $output .= TEXT_OUTPUT_3;
+  if($brand == 1)
+    $output .= TEXT_OUTPUT_4;
+  if($upc == 1)
+    $output .= TEXT_OUTPUT_5;
+  if($manufacturer_id == 1)
+    $output .= TEXT_OUTPUT_6;
+  if($product_type == 1)
+    $output .= TEXT_OUTPUT_7;
+  if($currency == 1)
+    $output .= TEXT_OUTPUT_8;
+  if($feed_language == 1)
+    $output .= TEXT_OUTPUT_9;
+  if($ship_to == 1)
+    $output .= TEXT_OUTPUT_10;
+  if($ship_from == 1)
+    $output .= TEXT_OUTPUT_11;
+
+}
+$output .= "\n";
+$result=tep_db_query( $sql )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql = " . htmlentities($sql) );
+
+//Currency Information uses store currency
+if($convertCur == 'true')
+{
+  $sql3 = "
+  SELECT
+  currencies.value AS curUSD
+  FROM
+  currencies
+  WHERE currencies.code = '$curType'
+  ";
+
+  $result3=mysql_fetch_object( $sql3 );
+  //or die( $FunctionName . ": SQL error " . tep_db_error() . "| sql3 = " . htmlentities($sql3) );
+  $row3 = mysql_fetch_object( $result3 );
+}
+
+$loop_counter = 0;
+
+while( $row = mysql_fetch_object( $result ) )
+{
+  //Salesmaker changes... Show correct price....... Begin
+
+   $products_price = $row->price;
+
+   if ($new_price = tep_get_products_special_price($row->id)) {
+     $products_price = number_format($new_price, 4, '.', '');
+     }
+  
+  $row->price = $products_price;
+
+  if (isset($already_sent[$row->id])) continue; // if we've sent this one, skip the rest of the while loop
+
+  if( $row->prodStatus == 1 || ($optional_sec == 1 && $instock == 1) )
+  {
+              // convert to another currency currency must be installed in cart.
+    if($convertCur == 'true')
+     {
+      $row->price = ereg_replace("[^.0-9]", "", $row->price);
+      $row->price = $row->price *  $row3->curUSD;
+      $row->price = number_format($row->price, 2, '.', ',');
+     }
+  // calculate Taxes
+            
+         if ($data_tax_class_id == '0'){
+         }else{
+          $class_id = $data_tax_class_id;
+          $tax = tep_get_tax_rate_value($class_id);
+    $row->price = number_format($row->price + ($row->price * $tax / 100), 2, '.', ',');
+    } 
+    
+   // get category  data_cat table that was pre built
+     $category_query = tep_db_query("select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . $row->id . "' and p.products_status = '1' and p.products_id = p2c.products_id limit 1");
+     $category = mysql_fetch_object($category_query);
+      $category_query1 = tep_db_query("select * from " . TABLE_DATA_CAT . " where cat_id = '" . $category->categories_id . "' limit 1");
+     $category1 = mysql_fetch_object($category_query1);
+
+$feed_cat= $category1->cat_tree;
+
+//start to build output string
+    $output .= $productURL1 . $row->product_url . "\t" .
+    preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" .
+    preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ) . "\t" .
+    $row->price . "\t" .
+    $row->image_url . "\t" .
+    $feed_cat . "\t" .
+    $row->id;
+
+  //optional values section
+  if($optional_sec == 1)
+  {
+    if($instock == 1)
+    {
+      if($row->prodStatus == 1)
+      {
+        $prodStatusOut = "Y";
+      }
+      else
+      {
+        $prodStatusOut = "N";
+      }
+      $output .= " \t " . $prodStatusOut;
+    }
+    if($shipping == 1)
+      $output .= " \t " . $lowestShipping;
+    if($brand == 1)
+      $output .= " \t " . $row->mfgName;
+    if($upc == 1)
+      $output .= " \t " . "Not Supported";
+    if($manufacturer_id == 1)
+      $output .= " \t " . "Not Supported";
+    if($product_type == 1)
+    {
+      $catNameTemp = strtolower($catName);
+      if($catNameTemp == "books")
+        $productTypeOut = "book";
+      else if($catNameTemp == "music")
+        $productTypeOut = "music";
+      else if($catNameTemp == "videos")
+        $productTypeOut = "video";
+      else
+        $productTypeOut = "other";
+
+      $output .= " \t " . $productTypeOut;
+    }
+    if($currency == 1)
+      $output .= " \t " . $default_currency;
+    if($feed_language == 1)
+      $output .= " \t " . $default_feed_language;
+    if($ship_to == 1)
+      $output .= " \t " . $default_ship_to;
+    if($ship_from == 1)
+      $output .= " \t " . $default_ship_from;
+  }
+  $output .= " \n";
+  }
+  $already_sent[$row->id] = 1;
+
+
+  $loop_counter++;
+  if ($loop_counter>750) {
+  $fp = fopen( $OutFile , "a" );
+  $fout = fwrite( $fp , $output );
+  fclose( $fp );
+  $loop_counter = 0;
+  $output = "";
+ }
+}
+
+
+$fp = fopen( $OutFile , "a" );
+$fout = fwrite( $fp , $output );
+fclose( $fp );
+chmod($OutFile, 0777);
+
+echo TEXT_OUTPUT_17 . $data_files_type . ' ' . $data_files_disc .  ' ' .  $data_files_type1 = $data[data_files_type1] . '<br>';
+echo TEXT_OUTPUT_18."<a href=\"" . $destination_file . "\" target=\"_blank\">" . $destination_file . "</a><br>\n";
+echo TEXT_OUTPUT_19; 
+
+//  End TIMER
+//  ---------
+$etimer = explode( ' ', microtime() );
+$etimer = $etimer[1] + $etimer[0];
+echo '<p style="margin:auto; text-align:center">';
+printf( TEXT_INFO_TIMER . " <b>%f</b> "  . TEXT_INFO_SECOND, ($etimer-$stimer) );
+echo '</p>';
+//  ---------
+echo '<br> &nbsp;' . TEXT_INFO_DONE . tep_draw_form('run', FILENAME_FROOGLE_ADMIN, 'action=run', 'post', ''); 
+echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_return.gif', TEXT_INFO_DONE) . '</form>'; 
+
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
+
+?>

Added: trunk/direct.openmoko.com/admin/froogle_pre1.php
===================================================================
--- trunk/direct.openmoko.com/admin/froogle_pre1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/froogle_pre1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,201 @@
+<?php
+/*
+  $Id: froogle_pre.php,v 1.1.1.1  zip1 Exp $
+  http://www.oscommerce.com
+   Froogle Data Feeder!
+   
+  Copyright (c) 2002 - 2005 Calvin K
+
+  Released under the GNU General Public License
+*/
+  require('includes/application_top.php');
+//  require(DIR_WS_LANGUAGES . froogle_pre.php');
+  include(DIR_WS_LANGUAGES . $language . '/froogle_pre.php'); 
+  
+  function tep_get_parent_categories(&$categories, $categories_id) {
+    $parent_categories_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$categories_id . "'");
+    while ($parent_categories = tep_db_fetch_array($parent_categories_query)) {
+      if ($parent_categories['parent_id'] == 0) return true;
+      $categories[sizeof($categories)] = $parent_categories['parent_id'];
+      if ($parent_categories['parent_id'] != $categories_id) {
+        tep_get_parent_categories($categories, $parent_categories['parent_id']);
+      }
+    }
+  }
+
+  function tep_get_product_path($products_id) {
+    $cPath = '';
+
+    $category_query = tep_db_query("select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int)$products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id limit 1");
+    if (tep_db_num_rows($category_query)) {
+      $category = tep_db_fetch_array($category_query);
+
+      $categories = array();
+      tep_get_parent_categories($categories, $category['categories_id']);
+
+      $categories = array_reverse($categories);
+
+      $cPath = implode(' > ', $categories);
+
+      if (tep_not_null($cPath)) $cPath .= ' > ';
+      $cPath .= $category['categories_id'];
+    }
+
+    return $cPath;
+  }
+  
+
+ function tep_get_categories_name($cats_id) {
+   $categories_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id = '" . (int)$cats_id . "' ");
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $cats_name = $categories['categories_name'];
+      }
+
+ return $cats_name;
+
+ }
+
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="menuBoxHeading">
+                         <tr>
+                     <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                       <tr>
+                         <td class="pageHeading"><?php echo HEADING_TITLE ; ?></td>
+                        </tr>
+                        <tr>
+                        <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                       </tr>
+                     </table></td>
+                   </tr>
+    <tr>
+        <td>
+<!--   Run category build        run feed build    
+ -->   <?php echo TEXT_OUTPUT_20?>     </td>
+      </tr>
+   <tr>
+        <td>      
+ <?php       
+
+//if ($action == categories)
+//  Start TIMER
+//  -----------
+$stimer = explode( ' ', microtime() );
+$stimer = $stimer[1] + $stimer[0];
+
+//  -----------
+    $data_files_id1 = (int)$HTTP_POST_VARS['feed_froogle'];
+    //$data_files_id1 = '2';
+    $data_query_raw = tep_db_query("select * from  " . TABLE_DATA_FILES . " where data_files_id = '" . $data_files_id1 . "' order by data_files_service ");
+    while ($data = tep_db_fetch_array($data_query_raw)) {
+  $data_files_id = $data[data_files_id];
+  $data_files_type = $data[data_files_type];
+  $data_files_disc = $data[data_files_disc];
+  $data_files_type1 = $data[data_files_type1];
+  $data_files_service = $data[data_files_service];
+  $data_status = $data[data_status];
+  $data_files_name = $data[data_files_name];
+  $data_image_url = $data[data_image_url];
+  $ftp_server = $data[data_ftp_server];
+  $ftp_user_name = $data[data_ftp_user_name];
+  $ftp_user_pass = $data[data_ftp_user_pass];
+  $ftp_directory = $data[data_ftp_directory];
+  $data_tax_class_id = $data[data_tax_class_id];
+  $data_convert_cur = $data[data_convert_cur];
+  $data_cur_use = $data[data_cur_use];
+  $data_cur = $data[data_cur];
+  $data_lang_use = $data[data_lang_use];
+  $data_lang = $data[data_lang];
+ 
+  }
+
+
+$sql = "
+SELECT
+products_id AS id,
+categories_id AS prodCatID
+FROM 
+products_to_categories
+";
+
+
+
+
+$result=tep_db_query( $sql )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql = " . htmlentities($sql) );
+
+
+
+$loop_counter = 0;
+
+while( $row = tep_db_fetch_array( $result ) )
+{
+$PROD_tree=tep_get_product_path($row[id]);    
+
+$catPath = explode(' > ', $PROD_tree);
+$value1 = ' ';
+foreach ($catPath as $value) {
+   $value1 .= tep_get_categories_name($value) . ' > ';
+   $value2 = rtrim($value1, "> ");
+   }
+   $cat_query = tep_db_query("select * from  " . TABLE_DATA_CAT . " where cat_id = '" . $row[prodCatID] ."' ");
+if (tep_db_num_rows($cat_query) < '1') {
+
+ $sql_data_array13 = array('cat_id'  => $row[prodCatID],
+                           'cat_tree'  => $value2);
+
+ tep_db_perform(TABLE_DATA_CAT, $sql_data_array13, 'insert' );
+ }
+if (tep_db_num_rows($cat_query) < '1') {
+     }
+}
+
+
+
+//  End TIMER
+//  ---------
+$etimer = explode( ' ', microtime() );
+$etimer = $etimer[1] + $etimer[0];
+echo '<p style="margin:auto; text-align:center">';
+printf( TEXT_INFO_TIMER . " <b>%f</b> "  . TEXT_INFO_SECOND, ($etimer-$stimer) );
+echo '</p>';
+//  ---------
+echo '<br> &nbsp;' . TEXT_INFO_DONE . tep_draw_form('run', FILENAME_FROOGLE_ADMIN, 'action=run', 'post', ''); 
+echo tep_draw_separator('pixel_trans.gif', '5', '15') . '&nbsp;' . tep_image_submit('button_return.gif', TEXT_INFO_DONE) . '</form>'; 
+
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
+
+?>

Added: trunk/direct.openmoko.com/admin/geo_zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/geo_zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/geo_zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,359 @@
+<?php
+/*
+  $Id: geo_zones.php,v 1.1.1.1 2004/03/04 23:38:35 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $saction = (isset($HTTP_GET_VARS['saction']) ? $HTTP_GET_VARS['saction'] : '');
+
+  if (tep_not_null($saction)) {
+    switch ($saction) {
+      case 'insert_sub':
+        $zID = tep_db_prepare_input($HTTP_GET_VARS['zID']);
+        $zone_country_id = tep_db_prepare_input($HTTP_POST_VARS['zone_country_id']);
+        $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+
+        tep_db_query("insert into " . TABLE_ZONES_TO_GEO_ZONES . " (zone_country_id, zone_id, geo_zone_id, date_added) values ('" . (int)$zone_country_id . "', '" . (int)$zone_id . "', '" . (int)$zID . "', now())");
+        $new_subzone_id = tep_db_insert_id();
+
+        tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $new_subzone_id));
+        break;
+      case 'save_sub':
+        $sID = tep_db_prepare_input($HTTP_GET_VARS['sID']);
+        $zID = tep_db_prepare_input($HTTP_GET_VARS['zID']);
+        $zone_country_id = tep_db_prepare_input($HTTP_POST_VARS['zone_country_id']);
+        $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+
+        tep_db_query("update " . TABLE_ZONES_TO_GEO_ZONES . " set geo_zone_id = '" . (int)$zID . "', zone_country_id = '" . (int)$zone_country_id . "', zone_id = " . (tep_not_null($zone_id) ? "'" . (int)$zone_id . "'" : 'null') . ", last_modified = now() where association_id = '" . (int)$sID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $HTTP_GET_VARS['sID']));
+        break;
+      case 'deleteconfirm_sub':
+        $sID = tep_db_prepare_input($HTTP_GET_VARS['sID']);
+
+        tep_db_query("delete from " . TABLE_ZONES_TO_GEO_ZONES . " where association_id = '" . (int)$sID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage']));
+        break;
+    }
+  }
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert_zone':
+        $geo_zone_name = tep_db_prepare_input($HTTP_POST_VARS['geo_zone_name']);
+        $geo_zone_description = tep_db_prepare_input($HTTP_POST_VARS['geo_zone_description']);
+
+        tep_db_query("insert into " . TABLE_GEO_ZONES . " (geo_zone_name, geo_zone_description, date_added) values ('" . tep_db_input($geo_zone_name) . "', '" . tep_db_input($geo_zone_description) . "', now())");
+        $new_zone_id = tep_db_insert_id();
+
+        tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $new_zone_id));
+        break;
+      case 'save_zone':
+        $zID = tep_db_prepare_input($HTTP_GET_VARS['zID']);
+        $geo_zone_name = tep_db_prepare_input($HTTP_POST_VARS['geo_zone_name']);
+        $geo_zone_description = tep_db_prepare_input($HTTP_POST_VARS['geo_zone_description']);
+
+        tep_db_query("update " . TABLE_GEO_ZONES . " set geo_zone_name = '" . tep_db_input($geo_zone_name) . "', geo_zone_description = '" . tep_db_input($geo_zone_description) . "', last_modified = now() where geo_zone_id = '" . (int)$zID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID']));
+        break;
+      case 'deleteconfirm_zone':
+        $zID = tep_db_prepare_input($HTTP_GET_VARS['zID']);
+
+        tep_db_query("delete from " . TABLE_GEO_ZONES . " where geo_zone_id = '" . (int)$zID . "'");
+        tep_db_query("delete from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int)$zID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php
+  if (isset($HTTP_GET_VARS['zID']) && (($saction == 'edit') || ($saction == 'new'))) {
+?>
+<script language="javascript"><!--
+function resetZoneSelected(theForm) {
+  if (theForm.state.value != '') {
+    theForm.zone_id.selectedIndex = '0';
+    if (theForm.zone_id.options.length > 0) {
+      theForm.state.value = '<?php echo JS_STATE_SELECT; ?>';
+    }
+  }
+}
+
+function update_zone(theForm) {
+  var NumState = theForm.zone_id.options.length;
+  var SelectedCountry = "";
+
+  while(NumState > 0) {
+    NumState--;
+    theForm.zone_id.options[NumState] = null;
+  }
+
+  SelectedCountry = theForm.zone_country_id.options[theForm.zone_country_id.selectedIndex].value;
+
+<?php echo tep_js_zone_list('SelectedCountry', 'theForm', 'zone_id'); ?>
+
+}
+//--></script>
+<?php
+  }
+?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; if (isset($HTTP_GET_VARS['zone'])) echo '<br><span class="smallText">' . tep_get_geo_zone_name($HTTP_GET_VARS['zone']) . '</span>'; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top">
+<?php
+  if ($action == 'list') {
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY_ZONE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $rows = 0;
+    $zones_query_raw = "select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name
+                        from " . TABLE_ZONES_TO_GEO_ZONES . " a
+                        left join " . TABLE_ZONES . " z using(zone_id)
+                        left join " . TABLE_COUNTRIES . " c on a.zone_country_id = c.countries_id
+                        where a.geo_zone_id = " . $HTTP_GET_VARS['zID'] . "
+                        order by association_id";
+    $zones_split = new splitPageResults($HTTP_GET_VARS['spage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
+    $zones_query = tep_db_query($zones_query_raw);
+    while ($zones = tep_db_fetch_array($zones_query)) {
+      $rows++;
+      if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $zones['association_id']))) && !isset($sInfo) && (substr($action, 0, 3) != 'new')) {
+        $sInfo = new objectInfo($zones);
+      }
+      if (isset($sInfo) && is_object($sInfo) && ($zones['association_id'] == $sInfo->association_id)) {
+        echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '\'">' . "\n";
+      } else {
+        echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $zones['association_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo (($zones['countries_name']) ? $zones['countries_name'] : TEXT_ALL_COUNTRIES); ?></td>
+                <td class="dataTableContent"><?php echo (($zones['zone_id']) ? $zones['zone_name'] : PLEASE_SELECT); ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($zones['association_id'] == $sInfo->association_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $zones['association_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $zones_split->display_count($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['spage'], TEXT_DISPLAY_NUMBER_OF_COUNTRIES); ?></td>
+                    <td class="smallText" align="right"><?php echo $zones_split->display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['spage'], 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list', 'spage'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+              <tr>
+                <td align="right" colspan="3"><?php if (empty($saction)) echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&' . (isset($sInfo) ? 'sID=' . $sInfo->association_id . '&' : '') . 'saction=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+              </tr>
+            </table>
+<?php
+  } else {
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_ZONES; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $zones_query_raw = "select geo_zone_id, geo_zone_name, geo_zone_description, last_modified, date_added from " . TABLE_GEO_ZONES . " order by geo_zone_name";
+    $zones_split = new splitPageResults($HTTP_GET_VARS['zpage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
+    $zones_query = tep_db_query($zones_query_raw);
+    while ($zones = tep_db_fetch_array($zones_query)) {
+      if ((!isset($HTTP_GET_VARS['zID']) || (isset($HTTP_GET_VARS['zID']) && ($HTTP_GET_VARS['zID'] == $zones['geo_zone_id']))) && !isset($zInfo) && (substr($action, 0, 3) != 'new')) {
+        $num_zones_query = tep_db_query("select count(*) as num_zones from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int)$zones['geo_zone_id'] . "' group by geo_zone_id");
+        $num_zones = tep_db_fetch_array($num_zones_query);
+
+        if ($num_zones['num_zones'] > 0) {
+          $zones['num_zones'] = $num_zones['num_zones'];
+        } else {
+          $zones['num_zones'] = 0;
+        }
+
+        $zInfo = new objectInfo($zones);
+      }
+      if (isset($zInfo) && is_object($zInfo) && ($zones['geo_zone_id'] == $zInfo->geo_zone_id)) {
+        echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=list') . '\'">' . "\n";
+      } else {
+        echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zones['geo_zone_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zones['geo_zone_id'] . '&action=list') . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;' . $zones['geo_zone_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($zInfo) && is_object($zInfo) && ($zones['geo_zone_id'] == $zInfo->geo_zone_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zones['geo_zone_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText"><?php echo $zones_split->display_count($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['zpage'], TEXT_DISPLAY_NUMBER_OF_TAX_ZONES); ?></td>
+                    <td class="smallText" align="right"><?php echo $zones_split->display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['zpage'], '', 'zpage'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+              <tr>
+                <td align="right" colspan="2"><?php if (!$action) echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=new_zone') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+              </tr>
+            </table>
+<?php
+  }
+?>
+            </td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  if ($action == 'list') {
+    switch ($saction) {
+      case 'new':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '</b>');
+
+        $contents = array('form' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&' . (isset($HTTP_GET_VARS['sID']) ? 'sID=' . $HTTP_GET_VARS['sID'] . '&' : '') . 'saction=insert_sub'));
+        $contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . tep_draw_pull_down_menu('zone_country_id', tep_get_countries(TEXT_ALL_COUNTRIES), '', 'onChange="update_zone(this.form);"'));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . tep_draw_pull_down_menu('zone_id', tep_prepare_country_zones_pull_down()));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&' . (isset($HTTP_GET_VARS['sID']) ? 'sID=' . $HTTP_GET_VARS['sID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'edit':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '</b>');
+
+        $contents = array('form' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id . '&saction=save_sub'));
+        $contents[] = array('text' => TEXT_INFO_EDIT_SUB_ZONE_INTRO);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . tep_draw_pull_down_menu('zone_country_id', tep_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'onChange="update_zone(this.form);"'));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . tep_draw_pull_down_menu('zone_id', tep_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'delete':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '</b>');
+
+        $contents = array('form' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id . '&saction=deleteconfirm_sub'));
+        $contents[] = array('text' => TEXT_INFO_DELETE_SUB_ZONE_INTRO);
+        $contents[] = array('text' => '<br><b>' . $sInfo->countries_name . '</b>');
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      default:
+        if (isset($sInfo) && is_object($sInfo)) {
+          $heading[] = array('text' => '<b>' . $sInfo->countries_name . '</b>');
+
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id . '&saction=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+          $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->date_added));
+          if (tep_not_null($sInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->last_modified));
+        }
+        break;
+    }
+  } else {
+    switch ($action) {
+      case 'new_zone':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_ZONE . '</b>');
+
+        $contents = array('form' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=insert_zone'));
+        $contents[] = array('text' => TEXT_INFO_NEW_ZONE_INTRO);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_NAME . '<br>' . tep_draw_input_field('geo_zone_name'));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . tep_draw_input_field('geo_zone_description'));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'edit_zone':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_ZONE . '</b>');
+
+        $contents = array('form' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=save_zone'));
+        $contents[] = array('text' => TEXT_INFO_EDIT_ZONE_INTRO);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_NAME . '<br>' . tep_draw_input_field('geo_zone_name', $zInfo->geo_zone_name));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . tep_draw_input_field('geo_zone_description', $zInfo->geo_zone_description));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'delete_zone':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ZONE . '</b>');
+
+        $contents = array('form' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=deleteconfirm_zone'));
+        $contents[] = array('text' => TEXT_INFO_DELETE_ZONE_INTRO);
+        $contents[] = array('text' => '<br><b>' . $zInfo->geo_zone_name . '</b>');
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      default:
+        if (isset($zInfo) && is_object($zInfo)) {
+          $heading[] = array('text' => '<b>' . $zInfo->geo_zone_name . '</b>');
+
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=edit_zone') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=delete_zone') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=list') . '">' . tep_image_button('button_details.gif', IMAGE_DETAILS) . '</a>');
+          $contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_ZONES . ' ' . $zInfo->num_zones);
+          $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($zInfo->date_added));
+          if (tep_not_null($zInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($zInfo->last_modified));
+          $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . $zInfo->geo_zone_description);
+        }
+        break;
+    }
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/gv_mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/gv_mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/gv_mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,377 @@
+<?php
+/*
+  $Id: gv_mail.php,v 1.1.1.1 2004/03/04 23:38:35 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+
+function tep_get_current_language($language_id) {
+    $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " where languages_id = '" . $language_id . "' order by sort_order");
+    while ($languages = tep_db_fetch_array($languages_query)) {
+      $languages_array1 = array('id' => $languages['languages_id'],
+                                 'name' => $languages['name'],
+                                 'code' => $languages['code'],
+                                 'image' => $languages['image'],
+                                 'directory' => $languages['directory']);
+    }
+
+    return $languages_array1;
+  }
+
+$languages = tep_get_languages();
+//    $languages_name = $lng->language['name'];
+//    $languages_image = $lng->language['image'];
+//    $languages_directory = $lng->$languages['directory'];
+  
+$cur_language = tep_get_current_language($languages_id);
+     $languages_name = $cur_language['name'];
+     $languages_image = $cur_language['image'];
+     $languages_directory = $cur_language['directory'];
+
+
+
+//print_r($cur_language);
+
+
+  if ( ($HTTP_GET_VARS['action'] == 'send_email_to_user') && ($HTTP_POST_VARS['customers_email_address'] || $HTTP_POST_VARS['email_to']) && (!$HTTP_POST_VARS['back_x']) ) {
+    switch ($HTTP_POST_VARS['customers_email_address']) {
+      case '***':
+        $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS);
+        $mail_sent_to = TEXT_ALL_CUSTOMERS;
+        break;
+      case '**D':
+        $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
+        $mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
+        break;
+      default:
+        $customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']);
+        $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "'");
+        $mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
+        if ($HTTP_POST_VARS['email_to']) {
+          $mail_sent_to = $HTTP_POST_VARS['email_to'];
+        }
+        break;
+    }
+
+
+
+    $from = tep_db_prepare_input($HTTP_POST_VARS['from']);
+    $subject = tep_db_prepare_input($HTTP_POST_VARS['subject']);
+    if ($HTTP_POST_VARS['email_to']) {
+      $id1 = create_coupon_code($HTTP_POST_VARS['email_to']);
+      $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
+      $message .= "\n\n" . TEXT_GV_WORTH  . $currencies->format($HTTP_POST_VARS['amount']) . "\n\n";
+      $message .= TEXT_TO_REDEEM;
+      $message .= TEXT_WHICH_IS . $id1 . TEXT_IN_CASE . "\n\n";
+      $message .= '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG . 'gv_redeem.php' . '?gv_no='.$id1 .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . 'gv_redeem.php' . '?gv_no='.$id1 . '</a>' . "\n\n";
+      $message .= TEXT_OR_VISIT . '<a href="' .  HTTP_SERVER  . DIR_WS_CATALOG . '">' . HTTP_SERVER  . DIR_WS_CATALOG  . '</a>' . TEXT_ENTER_CODE;
+      $message .= TEXT_TO_REDEEM1 ;
+      $message .= TEXT_REMEMBER . "\n";
+
+      //Let's build a message object using the email class
+      $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
+      // add the message to the object
+    if (EMAIL_USE_HTML == 'false') {
+    $mimemessage->add_text($message);
+    } else {
+    $mimemessage->add_html($message);
+    }
+
+      $mimemessage->build_message();
+      $mimemessage->send('Friend', $HTTP_POST_VARS['email_to'], '', $from, $subject);
+      // Now create the coupon email entry
+      $insert_query = tep_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $id1 . "', 'G', '" . $HTTP_POST_VARS['amount'] . "', now())");
+      $insert_id = tep_db_insert_id($insert_query);
+      $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $HTTP_POST_VARS['email_to'] . "', now() )");
+    }
+    tep_redirect(tep_href_link(FILENAME_GV_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
+  }
+
+  if ( ($HTTP_GET_VARS['action'] == 'preview') && (!$HTTP_POST_VARS['customers_email_address']) && (!$HTTP_POST_VARS['email_to']) ) {
+    $messageStack->add('search', ERROR_NO_CUSTOMER_SELECTED, 'error');
+  }
+
+  if ( ($HTTP_GET_VARS['action'] == 'preview') && (!$HTTP_POST_VARS['amount']) ) {
+    $messageStack->add('search', ERROR_NO_AMOUNT_SELECTED, 'error');
+  }
+
+  if ($HTTP_GET_VARS['mail_sent_to']) {
+    $messageStack->add('search', sprintf(NOTICE_EMAIL_SENT_TO, $HTTP_GET_VARS['mail_sent_to']), 'success');
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/javascript/menu.js"></script>
+<!-- Tabs code -->
+<script type="text/javascript" src="includes/javascript/tabpane/local/webfxlayout.js"></script>
+<link type="text/css" rel="stylesheet" href="includes/javascript/tabpane/tab.webfx.css">
+<style type="text/css">
+.dynamic-tab-pane-control h2 {
+  text-align: center;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control h2 a {
+  display:  inline;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control a:hover {
+  background: transparent;
+}
+</style>
+<script type="text/javascript" src="includes/javascript/tabpane/tabpane.js"></script>
+<!-- End Tabs -->
+
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+  if ( ($HTTP_GET_VARS['action'] == 'preview') && ($HTTP_POST_VARS['customers_email_address'] || $HTTP_POST_VARS['email_to']) ) {
+    switch ($HTTP_POST_VARS['customers_email_address']) {
+      case '***':
+        $mail_sent_to = TEXT_ALL_CUSTOMERS;
+        break;
+      case '**D':
+        $mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
+        break;
+      default:
+        $mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
+        if ($HTTP_POST_VARS['email_to']) {
+          $mail_sent_to = $HTTP_POST_VARS['email_to'];
+        }
+        break;
+    }
+    
+?>
+          <tr><?php echo tep_draw_form('mail', FILENAME_GV_MAIL, 'action=send_email_to_user'); ?>
+            <td><table border="0" width="100%" cellpadding="2" cellspacing="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_CUSTOMER; ?></b><br><?php echo $mail_sent_to; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_FROM; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['from'])); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_SUBJECT; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['subject'])); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_AMOUNT; ?></b><br><?php echo nl2br(htmlspecialchars(stripslashes($HTTP_POST_VARS['amount']))); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b>
+                <?php if (EMAIL_USE_HTML == 'false') { 
+                echo (stripslashes($HTTP_POST_VARS['message']));
+                } else { 
+                echo htmlspecialchars(stripslashes($HTTP_POST_VARS['message'])); 
+                } 
+                ?>
+                </td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td>
+<?php
+/* Re-Post all POST'ed variables */
+    reset($HTTP_POST_VARS);
+    while (list($key, $value) = each($HTTP_POST_VARS)) {
+      if (!is_array($HTTP_POST_VARS[$key])) {
+        echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+      }
+    }
+?>
+                <table border="0" width="100%" cellpadding="2" cellspacing="2">
+                  <tr>
+
+                     <tr>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_MAIL) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
+                    </tr>
+                    <td class="smallText">
+                <?php if (EMAIL_USE_HTML == 'false'){
+                echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="back"');
+                } ?>
+                <?php if (EMAIL_USE_HTML == 'false'){
+                       echo(TEXT_EMAIL_BUTTON_HTML);
+                 } else {
+                       echo(TEXT_EMAIL_BUTTON_TEXT); 
+                   } ?>
+                    </td>
+                  </tr>
+                </table></td>
+             </tr>
+            </table></td>
+          </form></tr>
+<?php
+  } else {
+?>
+<?php 
+   if (EMAIL_USE_HTML == 'true'){
+ // Load Editor
+include('includes/javascript/editor.php');
+echo tep_load_html_editor();
+ 
+echo tep_insert_html_editor(message,'advanced','400');
+ }
+?>
+
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?>
+<div class="tab-pane" id="tabPane1">
+<script type="text/javascript">tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ) );
+</script>
+
+     <?php echo tep_draw_form('mail', FILENAME_GV_MAIL, 'action=preview'); ?>
+                <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="tab table">
+                 <tr>
+                    <td valign="top">
+    <table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+<?php
+    $customers = array();
+    $customers[] = array('id' => '', 'text' => TEXT_SELECT_CUSTOMER);
+    $customers[] = array('id' => '***', 'text' => TEXT_ALL_CUSTOMERS);
+    $customers[] = array('id' => '**D', 'text' => TEXT_NEWSLETTER_CUSTOMERS);
+    $mail_query = tep_db_query("select customers_email_address, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " order by customers_lastname");
+    while($customers_values = tep_db_fetch_array($mail_query)) {
+      $customers[] = array('id' => $customers_values['customers_email_address'],
+                           'text' => $customers_values['customers_lastname'] . ', ' . $customers_values['customers_firstname'] . ' (' . $customers_values['customers_email_address'] . ')');
+    }
+?>
+              <tr>
+                <td class="main"><?php echo TEXT_CUSTOMER; ?></td>
+                <td><?php echo tep_draw_pull_down_menu('customers_email_address', $customers, $HTTP_GET_VARS['customer']);?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+               <tr>
+                <td class="main"><?php echo TEXT_TO; ?></td>
+                <td><?php echo tep_draw_input_field('email_to'); ?><?php echo '&nbsp;&nbsp;' . TEXT_SINGLE_EMAIL; ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+             <tr>
+                <td class="main"><?php echo TEXT_FROM; ?></td>
+                <td><?php echo tep_draw_input_field('from', EMAIL_FROM); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_SUBJECT; ?></td>
+                <td><?php echo tep_draw_input_field('subject'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td valign="top" class="main"><?php echo TEXT_AMOUNT; ?></td>
+                <td><?php echo tep_draw_input_field('amount'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td valign="top" class="main"><?php echo TEXT_MESSAGE; ?></td>
+                <td class="main">
+                <?php
+                 echo tep_draw_textarea_field('message', 'hard', 60, 3, $message, 'style="width: 100%" '); ?></td>
+           
+             </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+                 </table>
+ <?php if (EMAIL_USE_HTML == 'true'){
+ ;?>
+<script type="text/javascript">
+//<![CDATA[
+setupAllTabs();
+//]]>
+</script> 
+  <?php  
+  };?>
+        <tr>   
+                 <td  align="center">
+                 <?php if (EMAIL_USE_HTML == 'false'){ echo tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL, 'onClick="validate();return returnVal;"');
+                   } else {
+                echo tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); }?>
+                </td>
+              </tr>
+            </table></td>
+          </form></tr>
+<?php
+  }
+?>
+<!-- body_text_eof //-->
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/gv_queue.php
===================================================================
--- trunk/direct.openmoko.com/admin/gv_queue.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/gv_queue.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,171 @@
+<?php
+/*
+  $Id: gv_queue.php,v 1.1.1.1 2004/03/04 23:38:36 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  if ($HTTP_GET_VARS['action']=='confirmrelease' && isset($HTTP_GET_VARS['gid'])) {
+    $gv_query=tep_db_query("select release_flag from " . TABLE_COUPON_GV_QUEUE . " where unique_id='".$HTTP_GET_VARS['gid']."'");
+    $gv_result=tep_db_fetch_array($gv_query);
+    if ($gv_result['release_flag']=='N') {
+      $gv_query=tep_db_query("select customer_id, amount from " . TABLE_COUPON_GV_QUEUE ." where unique_id='".$HTTP_GET_VARS['gid']."'");
+      if ($gv_resulta=tep_db_fetch_array($gv_query)) {
+      $gv_amount = $gv_resulta['amount'];
+      //Let's build a message object using the email class
+      $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . $gv_resulta['customer_id'] . "'");
+      $mail = tep_db_fetch_array($mail_query);
+      $message = TEXT_REDEEM_COUPON_MESSAGE_HEADER;
+      $message .= sprintf(TEXT_REDEEM_COUPON_MESSAGE_AMOUNT, $currencies->format($gv_amount));
+      $message .= TEXT_REDEEM_COUPON_MESSAGE_BODY;
+      $message .= TEXT_REDEEM_COUPON_MESSAGE_FOOTER;
+      $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
+      // add the message to the object
+      $mimemessage->add_text($message);
+      $mimemessage->build_message();
+
+      $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, TEXT_REDEEM_COUPON_SUBJECT );
+      $gv_amount=$gv_resulta['amount'];
+      $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$gv_resulta['customer_id']."'");
+      $customer_gv=false;
+      $total_gv_amount=0;
+      if ($gv_result=tep_db_fetch_array($gv_query)) {
+        $total_gv_amount=$gv_result['amount'];
+        $customer_gv=true;
+      }
+      $total_gv_amount=$total_gv_amount+$gv_amount;
+      if ($customer_gv) {
+        $gv_update=tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount='".$total_gv_amount."' where customer_id='".$gv_resulta['customer_id']."'");
+      } else {
+        $gv_insert=tep_db_query("insert into " .TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('".$gv_resulta['customer_id']."','".$total_gv_amount."')");
+      }
+        $gv_update=tep_db_query("update " . TABLE_COUPON_GV_QUEUE . " set release_flag='Y' where unique_id='".$HTTP_GET_VARS['gid']."'");
+      }
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ORDERS_ID; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_VOUCHER_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $gv_query_raw = "select c.customers_firstname, c.customers_lastname, gv.unique_id, gv.date_created, gv.amount, gv.order_id from " . TABLE_CUSTOMERS . " c, " . TABLE_COUPON_GV_QUEUE . " gv where (gv.customer_id = c.customers_id and gv.release_flag = 'N')";
+  $gv_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $gv_query_raw, $gv_query_numrows);
+  $gv_query = tep_db_query($gv_query_raw);
+  while ($gv_list = tep_db_fetch_array($gv_query)) {
+    if (((!$HTTP_GET_VARS['gid']) || (@$HTTP_GET_VARS['gid'] == $gv_list['unique_id'])) && (!$gInfo)) {
+      $gInfo = new objectInfo($gv_list);
+    }
+    if ( (is_object($gInfo)) && ($gv_list['unique_id'] == $gInfo->unique_id) ) {
+      echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link('gv_queue.php', tep_get_all_get_params(array('gid', 'action')) . 'gid=' . $gInfo->unique_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link('gv_queue.php', tep_get_all_get_params(array('gid', 'action')) . 'gid=' . $gv_list['unique_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $gv_list['customers_firstname'] . ' ' . $gv_list['customers_lastname']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $gv_list['order_id']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $currencies->format($gv_list['amount']); ?></td>
+                <td class="dataTableContent" align="right"><?php echo tep_datetime_short($gv_list['date_created']); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($gInfo)) && ($gv_list['unique_id'] == $gInfo->unique_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_GV_QUEUE, 'page=' . $HTTP_GET_VARS['page'] . '&gid=' . $gv_list['unique_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $gv_split->display_count($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $gv_split->display_links($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+    case 'release':
+      $heading[] = array('text' => '[' . $gInfo->unique_id . '] ' . tep_datetime_short($gInfo->date_created) . ' ' . $currencies->format($gInfo->amount));
+
+      $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link('gv_queue.php','action=confirmrelease&gid='.$gInfo->unique_id,'NONSSL').'">'.tep_image_button('button_confirm_red.gif', IMAGE_CONFIRM) . '</a> <a href="' . tep_href_link('gv_queue.php','action=cancel&gid=' . $gInfo->unique_id,'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      $heading[] = array('text' => '[' . $gInfo->unique_id . '] ' . tep_datetime_short($gInfo->date_created) . ' ' . $currencies->format($gInfo->amount));
+
+      $contents[] = array('align' => 'center','text' => '<a href="' . tep_href_link('gv_queue.php','action=release&gid=' . $gInfo->unique_id,'NONSSL'). '">' . tep_image_button('button_release.gif', IMAGE_RELEASE) . '</a>');
+      break;
+   }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/gv_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/gv_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/gv_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,148 @@
+<?php
+/*
+  $Id: FILENAME_GV_REPORT,v 1.1.1.1 2004/03/04 23:38:36 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="content_heading"><?php echo HEADING_SUB_TITLE; ?></td>
+            <td class="content_heading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ORDERS_ID; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_VOUCHER_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+ $gv_report_raw="select gv.unique_id, c.customers_id  from " . TABLE_CUSTOMERS . " c, " . TABLE_COUPON_GV_QUEUE . " gv where gv.customer_id = c.customers_id )";
+
+
+  $gv_query_raw = "select c.customers_firstname, c.customers_lastname, gv.unique_id, gv.date_created, gv.amount, gv.order_id, gv.release_flag from " . TABLE_CUSTOMERS . " c, " . TABLE_COUPON_GV_QUEUE . " gv where (gv.customer_id = c.customers_id )";
+  $gv_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $gv_query_raw, $gv_query_numrows);
+  $gv_query = tep_db_query($gv_query_raw);
+  while ($gv_list = tep_db_fetch_array($gv_query)) {
+    if (((!$HTTP_GET_VARS['gid']) || (@$HTTP_GET_VARS['gid'] == $gv_list['unique_id'])) && (!$gInfo)) {
+      $gInfo = new objectInfo($gv_list);
+    }
+    if ( (is_object($gInfo)) && ($gv_list['unique_id'] == $gInfo->unique_id) ) {
+      echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_GV_REPORT, tep_get_all_get_params(array('gid', 'action')) . 'gid=' . $gInfo->unique_id . '&action=view') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_GV_REPORT, tep_get_all_get_params(array('gid', 'action')) . 'gid=' . $gv_list['unique_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $gv_list['customers_firstname'] . ' ' . $gv_list['customers_lastname']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $gv_list['order_id']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $currencies->format($gv_list['amount']); ?></td>
+                <td class="dataTableContent" align="right"><?php echo tep_datetime_short($gv_list['date_created']); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($gInfo)) && ($gv_list['unique_id'] == $gInfo->unique_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_GV_REPORT, 'page=' . $HTTP_GET_VARS['page'] . '&gid=' . $gv_list['unique_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $gv_split->display_count($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $gv_split->display_links($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+
+if ($gInfo->release_flag == 'Y'){
+   $release = 'Yes' ;
+   }
+if ($gInfo->release_flag == 'N'){
+   $release = 'No' ;
+   }
+   
+
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+
+    default:
+     $heading[] = array('text' => $gInfo->unique_id . ' ' . $gInfo->customers_firstname . ' ' . $gInfo->customers_lastname );
+      if ($gInfo->release_flag == 'N'){
+      $contents[] = array('align' => 'center','text' => '<a href="' . tep_href_link(FILENAME_GV_QUEUE,'&gid=' . $gInfo->unique_id,'NONSSL'). '">' . tep_image_button('button_release.gif', IMAGE_RELEASE) . '</a>');
+      }
+      $contents[] = array('text' => '[' . $gInfo->unique_id . '] ' . tep_datetime_short($gInfo->date_created) . ' ' . $currencies->format($gInfo->amount));
+      $contents[] = array('align' => 'center','text' => TEXT_GV_REPORT_RELEASED . $release );
+      break;
+   }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/gv_sent.php
===================================================================
--- trunk/direct.openmoko.com/admin/gv_sent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/gv_sent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,143 @@
+<?php
+/*
+  $Id: gv_sent.php,v 1.1.1.1 2004/03/04 23:38:36 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SENDERS_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VOUCHER_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VOUCHER_CODE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_SENT; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $gv_query_raw = "select c.coupon_amount, c.coupon_code, c.coupon_id, et.sent_firstname, et.sent_lastname, et.customer_id_sent, et.emailed_to, et.date_sent, c.coupon_id from " . TABLE_COUPONS . " c, " . TABLE_COUPON_EMAIL_TRACK . " et where c.coupon_id = et.coupon_id";
+  $gv_query = tep_db_query($gv_query_raw);
+  $gv_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $gv_query_raw, $gv_query_numrows);
+
+  while ($gv_list = tep_db_fetch_array($gv_query)) {
+    if (((!$HTTP_GET_VARS['gid']) || (@$HTTP_GET_VARS['gid'] == $gv_list['coupon_id'])) && (!$gInfo)) {
+    $gInfo = new objectInfo($gv_list);
+    }
+    if ( (is_object($gInfo)) && ($gv_list['coupon_id'] == $gInfo->coupon_id) ) {
+      echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link('gv_sent.php', tep_get_all_get_params(array('gid', 'action')) . 'gid=' . $gInfo->coupon_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link('gv_sent.php', tep_get_all_get_params(array('gid', 'action')) . 'gid=' . $gv_list['coupon_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $gv_list['sent_firstname'] . ' ' . $gv_list['sent_lastname']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $currencies->format($gv_list['coupon_amount']); ?></td>
+                <td class="dataTableContent" align="center"><?php echo $gv_list['coupon_code']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo tep_date_short($gv_list['date_sent']); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($gInfo)) && ($gv_list['coupon_id'] == $gInfo->coupon_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_GV_SENT, 'page=' . $HTTP_GET_VARS['page'] . '&gid=' . $gv_list['coupon_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $gv_split->display_count($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $gv_split->display_links($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text' => '[' . $gInfo->coupon_id . '] ' . ' ' . $currencies->format($gInfo->coupon_amount));
+  $redeem_query = tep_db_query("select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $gInfo->coupon_id . "'");
+  $redeemed = 'No';
+  if (tep_db_num_rows($redeem_query) > 0) $redeemed = 'Yes';
+  $contents[] = array('text' => TEXT_INFO_SENDERS_ID . ' ' . $gInfo->customer_id_sent);
+  $contents[] = array('text' => TEXT_INFO_AMOUNT_SENT . ' ' . $currencies->format($gInfo->coupon_amount));
+  $contents[] = array('text' => TEXT_INFO_DATE_SENT . ' ' . tep_date_short($gInfo->date_sent));
+  $contents[] = array('text' => TEXT_INFO_VOUCHER_CODE . ' ' . $gInfo->coupon_code);
+  $contents[] = array('text' => TEXT_INFO_EMAIL_ADDRESS . ' ' . $gInfo->emailed_to);
+  if ($redeemed=='Yes') {
+    $redeem = tep_db_fetch_array($redeem_query);
+    $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_REDEEMED . ' ' . tep_date_short($redeem['redeem_date']));
+    $contents[] = array('text' => TEXT_INFO_IP_ADDRESS . ' ' . $redeem['redeem_ip']);
+    $contents[] = array('text' => TEXT_INFO_CUSTOMERS_ID . ' ' . $redeem['customer_id']);
+  } else {
+    $contents[] = array('text' => '<br>' . TEXT_INFO_NOT_REDEEMED);
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/header_navigation2.php
===================================================================
--- trunk/direct.openmoko.com/admin/header_navigation2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/header_navigation2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: header_navigation.php,v 1.1.1.1 2004/03/04 23:39:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  Updated by Gnidhal (fx at geniehalles.com)
+*/
+
+   $menu_dhtml = MENU_DHTML;
+  $box_files_list = array(  array('administrator'   , 'administrator.php', BOX_HEADING_ADMINISTRATOR),
+             array('configuration'   , 'configuration.php', BOX_HEADING_CONFIGURATION),
+                            array('catalog'         , 'catalog.php', BOX_HEADING_CATALOG),
+                            array('information'     , 'information.php', BOX_HEADING_INFORMATION),
+                            array('newsdesk'        , 'newsdesk.php', BOX_HEADING_NEWSDESK),
+                            array('faqdesk'         , 'faqdesk.php', BOX_HEADING_FAQDESK),
+                            array('modules'         , 'modules.php' , BOX_HEADING_MODULES),
+                            array('gv_admin'        , 'gv_admin.php' , BOX_HEADING_GV_ADMIN),
+                            array('customers'       , 'customers.php' , BOX_HEADING_CUSTOMERS),
+                          );
+                                              
+  $box_files_list02 = array(  array('affiliate'       , 'affiliate.php', BOX_HEADING_AFFILIATE),
+                            array('taxes'           , 'taxes.php' , BOX_HEADING_LOCATION_AND_TAXES),
+                            array('localization'    , 'localization.php' , BOX_HEADING_LOCALIZATION),
+                            array('design_controls' , 'design_controls.php' , BOX_HEADING_DESIGN_CONTROLS),
+                            array('links'          , 'links.php' , BOX_HEADING_LINKS),
+                            array('reports'         , 'reports.php' , BOX_HEADING_REPORTS),
+                            array('tools'           , 'tools.php' , BOX_HEADING_TOOLS)
+                          );
+
+   echo '<!-- Menu bar #1. --> <div class="menuBar" style="width:100%;">';
+   foreach($box_files_list as $item_menu) {
+  if (tep_admin_check_boxes($item_menu[1]) == true) {
+     echo "<a class=\"menuButton\" href=\"\" onclick=\"return buttonClick(event, '".$item_menu[0]."Menu');\" onmouseover=\"buttonMouseover(event, '".$item_menu[0]."Menu');\">".$item_menu[2]."</a>" ;
+   }
+}
+   echo "</div>";
+    
+   echo '<!-- Menu bar #2. --> <div class="menuBar" style="width:100%;">';
+   foreach($box_files_list02 as $item_menu) {
+  if (tep_admin_check_boxes($item_menu[1]) == true) {
+     echo "<a class=\"menuButton\" href=\"\" onclick=\"return buttonClick(event, '".$item_menu[0]."Menu');\" onmouseover=\"buttonMouseover(event, '".$item_menu[0]."Menu');\">".$item_menu[2]."</a>" ;
+   }
+}
+   echo "</div>";
+
+foreach($box_files_list as $item_menu) require(DIR_WS_BOXES. $item_menu[1] );
+foreach($box_files_list02 as $item_menu) require(DIR_WS_BOXES. $item_menu[1] );
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/header_tags_controller.php
===================================================================
--- trunk/direct.openmoko.com/admin/header_tags_controller.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/header_tags_controller.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,573 @@
+<?php
+/*
+  $Id: header_tags_controller.php,v 1.2 2004/08/07 22:50:52 hpdl Exp $
+  header_tags_controller Originally Created by: Jack York
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+ 
+  require('includes/application_top.php');
+  require('includes/functions/header_tags.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_HEADER_TAGS_CONTROLLER);
+  
+  $filenameInc =  DIR_FS_CATALOG . 'includes/header_tags.php';
+  $filenameEng = DIR_FS_CATALOG . DIR_WS_LANGUAGES . $language . '/header_tags.php';
+  $action       = (isset($HTTP_POST_VARS['action']) ? $HTTP_POST_VARS['action'] : '');
+  $actionDelete = (isset($HTTP_POST_VARS['action_delete']) ? $HTTP_POST_VARS['action_delete'] : '');
+  $actionCheck  = (isset($HTTP_POST_VARS['action_check']) ? $HTTP_POST_VARS['action_check'] : '');
+  
+  
+  if (tep_not_null($action)) 
+  {
+    $args = array();
+    $args['page'] = $_POST['page'];
+    $args['title'] = $_POST['title'];
+    $args['desc'] = addslashes($_POST['desc']);
+    $args['keyword'] = addslashes($_POST['keyword']);
+    $args['htta'] = ($_POST['htta'] == 'on') ? 1 : 0;
+    $args['htda'] = ($_POST['htda'] == 'on') ? 1 : 0;
+    $args['htka'] = ($_POST['htka'] == 'on') ? 1 : 0;
+    $args['htca'] = ($_POST['htca'] == 'on') ? 1 : 0;    
+    
+    if (($pos = strpos($args['page'], ".php")) !== FALSE)  //remove .php from page 
+       $args['page'] = substr($args['page'], 0, $pos);     //if present
+   
+    $fp = file($filenameEng);  
+    $checkOnce = true;
+    $lastSection = '';
+    $insertPoint = 0;
+    $markPoint = count($fp) - 1; 
+    
+    if (NotDuplicatePage($fp, $args['page']))
+    {
+      /*********************** ENGLISH SECTION ************************/
+      for ($idx = 0; $idx < count($fp); ++$idx)  //find where to insert the new page
+      {     
+         if ($checkOnce && strpos($fp[$idx], "// DEFINE TAGS FOR INDIVIDUAL PAGES") === FALSE)
+            continue;
+         
+         $checkOnce = false;   
+         $section = GetSectionName($fp[$idx]);   
+         
+         if (! empty($section))
+         {
+            if (strcasecmp($section, $args['page']) < 0)
+            {         
+               $lastSection = $section;    
+               $markPoint = $idx;       
+            }   
+            else if (strcasecmp($section, $args['page']) > 0)
+            {
+               if ($insertPoint == 0)
+                 $insertPoint = $idx;
+            }      
+         }
+      }
+      
+      if ($insertPoint != count($fp))              //backup one line for appearance
+        $insertPoint--;
+         
+      $fileUpper = strtoupper($args['page']);      //prepare the english array
+      $engArray = array();
+      $engArray['page'] = sprintf("// %s.php\n", $args['page']);  
+      $engArray['htta'] = sprintf("define('HTTA_%s_ON','%d');\n", $fileUpper, $args['htta']);
+      $engArray['htda'] = sprintf("define('HTDA_%s_ON','%d');\n", $fileUpper, $args['htda']);
+      $engArray['htka'] = sprintf("define('HTKA_%s_ON','%d');\n", $fileUpper, $args['htka']);
+      $engArray['title'] = sprintf("define('HEAD_TITLE_TAG_%s','%s');\n", $fileUpper, $args['title']);
+      $engArray['desc'] = sprintf("define('HEAD_DESC_TAG_%s','%s');\n", $fileUpper, $args['desc']);
+      $engArray['keyword'] = sprintf("define('HEAD_KEY_TAG_%s','%s');\n", $fileUpper, $args['keyword']);
+    
+      array_splice($fp, $insertPoint, 0, $engArray);  
+      if (!is_writeable($filenameEng)) 
+    {
+          $messageStack->reset();
+          $messageStack->add('search',sprintf(ERROR_FILE_NOT_WRITEABLE, $filenameEng), 'error');          
+    }
+    else
+    {      
+      WriteHeaderTagsFile($filenameEng, $fp);   
+    }
+     
+    /*********************** INCLUDES SECTION ************************/     
+      $fp = file($filenameInc); 
+    $checkOnce = true;
+      $insertPoint = 0;
+      $markPoint = count($fp) - 1;
+      
+      for ($idx = 0; $idx < count($fp); ++$idx)  //find where to insert the new page
+      {     
+         if ($checkOnce && strpos($fp[$idx], "switch (true)") === FALSE)
+            continue;
+         $checkOnce = false;   
+         $section = GetSectionName($fp[$idx]);   
+                 
+         if (! empty($section))
+         {
+            if (strcasecmp($section, $args['page']) < 0)
+            {         
+               $lastSection = $section;    
+               $markPoint = $idx;       
+            }   
+            else if (strcasecmp($section, $args['page']) > 0)
+            {
+               if ($insertPoint == 0)
+                 $insertPoint = $idx;
+            }                  
+         }
+         else if (strpos($fp[$idx], "// ALL OTHER PAGES NOT DEFINED ABOVE") !== FALSE)
+         { 
+            $insertPoint = $idx;
+            break;
+         }    
+      }
+  
+      if ($insertPoint != count($fp))              //backup one line for appearance
+        $insertPoint--;      
+
+      $incArray = array();
+      $fileUpper = strtoupper($args['page']);
+      $spaces = 10;
+      $incArray['page'] = sprintf("\n// %s.php\n", $args['page']);  
+      $incArray['case'] = sprintf("  case (strstr(\$_SERVER['PHP_SELF'],FILENAME_%s) or strstr(\$PHP_SELF, FILENAME_%s));\n",$fileUpper, $fileUpper);
+      $incArray['line'] = sprintf("    \$tags_array = tep_header_tag_page(HTTA_%s_ON, HEAD_TITLE_TAG_%s, \n%38sHTDA_%s_ON, HEAD_DESC_TAG_%s, \n%38sHTKA_%s_ON, HEAD_KEY_TAG_%s );\n   break;\n",$fileUpper, $fileUpper, " ", $fileUpper, $fileUpper, " ", $fileUpper, $fileUpper );  
+     
+    array_splice($fp, $insertPoint, 0, $incArray);  
+    if (!is_writeable($filenameInc)) 
+    {
+          $messageStack->reset();
+          $messageStack->add('search', sprintf(ERROR_FILE_NOT_WRITEABLE, $filenameInc), 'error');         
+    }
+    else
+    {
+      WriteHeaderTagsFile($filenameInc, $fp);  
+    }
+  
+    } 
+    else
+    {
+       //$error = 'Page name is already entered -> ' .$args['page'];
+       $error = ERROR_PAGE_NAME_IS_ALREADY_ENTERED .$args['page'];
+       $messageStack->add('search', $error, 'error');
+    }
+  } 
+  else if (tep_not_null($actionDelete))
+  {
+     /****************** Delete the English entries ********************/
+   $page_to_delete = $_POST['delete_page'].'.php';
+     $fp = file($filenameEng);
+     $found = false; 
+     $delStart = 0;
+     $delStop = 0;
+     for ($idx = 0; $idx < count($fp); ++$idx)
+     {
+        if (! $found && strpos($fp[$idx], $page_to_delete) !== FALSE)
+        {
+            $delStart = $idx;   //adjust for 0 start
+            $found = true;
+        }
+        else if ($found && (tep_not_null($fp[$idx]) && strpos($fp[$idx], ".php") === FALSE))
+            $delStop++;
+        else if ($found && (! tep_not_null($fp[$idx]) || strpos($fp[$idx], ".php") !== FALSE))
+        {
+            $delStop++;
+            break;
+        }    
+     }
+
+     if ($found == true)          //page entry may not be present
+     {
+       // echo 'delete from English  '.$delStart. ' for  '.$delStop.'<br>'; 
+        echo ERROR_DELETE_FROM_ENGLISH_1.$delStart. ERROR_DELETE_FROM_ENGLISH_2.$delStop.'<br>'; 
+        array_splice($fp, $delStart, $delStop);
+     if (!is_writeable($filenameEng)) 
+       {
+          $messageStack->reset();
+          $messageStack->add('search', sprintf(ERROR_FILE_NOT_WRITEABLE, $filenameEng), 'error');         
+      }
+      else
+      {
+          WriteHeaderTagsFile($filenameEng, $fp);
+      }       
+     } 
+        
+     /******************** Delete the includes entries *******************/
+     $fp = file($filenameInc);
+     $checkOnce = true;
+     $found = false; 
+     $delStart = 0;
+     $delStop = 0;
+     
+     for ($idx = 0; $idx < count($fp); ++$idx)
+     {
+        if ($checkOnce && strpos($fp[$idx], "switch") === FALSE)
+           continue;
+        
+        $checkOnce = false;
+        if (! $found && (strpos($fp[$idx], $page_to_delete) !== FALSE || strpos($fp[$idx], strtoupper($page_to_delete))) !== FALSE)
+        {
+            $delStart = $idx; // + 1;  //adjust for 0 start
+            $found = true;
+        }
+        else if ($found && ( strpos($fp[$idx], "ALL OTHER PAGES NOT DEFINED ABOVE") === FALSE && strpos($fp[$idx], ".php") === FALSE))
+        {
+           $delStop++;
+        }   
+        else if ($found && (strpos($fp[$idx], "ALL OTHER PAGES NOT DEFINED ABOVE") !== FALSE  || strpos($fp[$idx], ".php") !== FALSE))
+        {
+           $delStop++; 
+           break;
+        }                  
+     }
+          
+     if ($found == true)          //page entry may not be present
+     {
+       array_splice($fp, $delStart, $delStop);
+     
+    //  echo 'delete from Includes '.$delStart. ' for  '.$delStop.'<br>';  
+         if (!is_writeable($filenameInc)) 
+       {
+           $messageStack->reset();
+            $messageStack->add('search', sprintf(ERROR_FILE_NOT_WRITEABLE, $filenameInc), 'error');         
+        }
+      else
+      {
+           WriteHeaderTagsFile($filenameInc, $fp);
+      }
+     }   
+  }
+  else if (tep_not_null($actionCheck)) 
+  {
+     $filelist = array();
+     $newfiles = array();
+     $fp = file($filenameEng);
+  
+     for ($idx = 0; $idx < count($fp); ++$idx) 
+     {
+        $section = GetSectionName($fp[$idx]);
+        if (empty($section) || strpos($section, "header_tags") !== FALSE || strpos($section, "WebMakers") !== FALSE)
+           continue;
+        $section .= '.php';
+        $section = str_replace("-", "_", $section);  //ensure the scoring is the same
+        $filelist[] = $section;
+     }
+ 
+     if ($handle = opendir(DIR_FS_CATALOG)) 
+     {
+        $fp = file($filenameEng); 
+        $found = false;
+        while (false !== ($file = readdir($handle))) 
+        { 
+           if (strpos($file, '.php') === FALSE)
+              continue;       
+ 
+           if (FileNotUsingHeaderTags($file))
+           {
+              foreach($filelist as $name) 
+              {           
+                 $tmp_file = str_replace("-", "_", $file);  //ensure the scoring is the same
+                 if (strcasecmp($name, $tmp_file) === 0)
+                 {
+                    $found = true;
+                    break;
+                 }
+              }   
+              if (! $found)
+                 $newfiles[] = array('id' => $file, 'text' => $file);
+              else
+                 $found = false;
+           }
+        }
+        closedir($handle); 
+     }
+  }
+  
+  $deleteArray = array();
+  $fp = file($filenameEng);
+  $checkOnce = true;
+  for ($idx = 0; $idx < count($fp); ++$idx)
+  {
+     if ($checkOnce && strpos($fp[$idx], "// DEFINE TAGS FOR INDIVIDUAL PAGES") === FALSE)
+        continue;
+     $checkOnce = false;
+     $l = GetSectionName($fp[$idx]);
+     if (tep_not_null($l))
+       $deleteArray[] = array('id' => $l, 'text' => $l);
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<style type="text/css">
+td.HTC_Head {color: sienna; font-size: 24px; font-weight: bold; } 
+td.HTC_subHead {color: sienna; font-size: 14px; } 
+</style>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+     <tr>
+      <td class="HTC_Head">
+      <?php 
+    $file_writeable = true;
+    if (!is_writeable($filenameEng)) 
+    {   
+      $file_writeable = false;
+      $messageStack->reset();
+        $messageStack->add(search, sprintf(ERROR_FILE_NOT_WRITEABLE, $filenameEng), 'error');
+      echo $messageStack->output(search);
+    }
+    else
+    { 
+      if (!is_writeable($filenameInc)) 
+      {
+        $file_writeable = false;
+        $messageStack->reset();
+            $messageStack->add(search, sprintf(ERROR_FILE_NOT_WRITEABLE, $filenameInc), 'error');
+        echo $messageStack->output(search);
+      }
+    }
+    ?>
+    
+    <?php echo HEADING_TITLE_CONTROLLER; ?>
+    </td>
+     </tr>
+     <tr>
+      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+     <tr>
+      <td class="HTC_subHead"><?php echo TEXT_PAGE_TAGS; ?></td>
+     </tr>
+     <tr>
+      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+     </tr>
+ 
+     <!-- Begin of Header Tags - Add a Page -->
+     <tr>
+      <td><?php echo tep_black_line(); ?></td>
+     </tr>
+     <tr>
+      <td class="main"><?php echo TEXT_INFORMATION_ADD_PAGE; ?></td>
+     </tr>
+     
+     <tr>
+      <td align="right"><?php echo tep_draw_form('header_tags', FILENAME_HEADER_TAGS_CONTROLLER, '', 'post') . tep_draw_hidden_field('action', 'process'); ?></td>
+       <tr>
+        <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+     
+         <tr>
+          <td><table border="0" width="100%">
+           <tr>
+            <td class="smallText" width="10%" style="font-weight: bold;"><!-- Page Name --><?php PAGE_NAME?></td>
+            <td class="smallText" >
+      <?php 
+         $newfiles = array();
+         $filelist = array();
+    
+         $fp = file($filenameEng);
+      
+         for ($idx = 0; $idx < count($fp); ++$idx) 
+         {
+            $section = GetSectionName($fp[$idx]);
+            if (empty($section) || strpos($section, "header_tags") !== FALSE || strpos($section, "WebMakers") !== FALSE)
+               continue;
+            $section .= '.php';
+            $section = str_replace("-", "_", $section);  //ensure the scoring is the same
+            $filelist[] = $section;
+         }
+       if ($handle = opendir(DIR_FS_CATALOG)) 
+         {
+            $fp = file($filenameEng); 
+            $found = false;
+            while (false !== ($file = readdir($handle))) 
+            { 
+               if (strpos($file, '.php') === FALSE)
+                  continue;       
+     
+               if (FileNotUsingHeaderTags($file))
+               {
+                  foreach($filelist as $name) 
+                  {           
+                     $tmp_file = str_replace("-", "_", $file);  //ensure the scoring is the same
+                     if (strcasecmp($name, $tmp_file) === 0)
+                     {
+                        $found = true;
+                        break;
+                     }
+                  }   
+                  if (! $found)
+                     $newfiles[] = array('id' => $file, 'text' => $file);
+                  else
+                     $found = false;
+               }
+            }
+            closedir($handle); 
+         }
+     
+      
+      echo tep_draw_pull_down_menu('page', $newfiles, '', '', false); 
+      ?> </td>
+           <tr>             
+          </table></td>
+         </tr>
+         
+         <tr>
+          <td><table border="0" width="100%">
+           <tr>
+            <td class="smallText" width="13%" style="font-weight: bold;"><!-- Switches: --><?php SWITCHES?></td>
+            <td class="smallText"><?php HTTA?> </td>
+            <td align="left"><?php echo tep_draw_checkbox_field('htta', '', FALSE, ''); ?> </td>
+            <td class="smallText"><!-- HTDA: --><?php HTDA?> </td>
+            <td ><?php echo tep_draw_checkbox_field('htda', '', FALSE, ''); ?> </td>
+            <td class="smallText"><!-- HTKA: --> <?php HTKA?> </td>
+            <td ><?php echo tep_draw_checkbox_field('htka', '', FALSE, ''); ?> </td>
+            <td class="smallText"><!-- HTCA: --> <?php HTCA?> </td>
+            <td ><?php echo tep_draw_checkbox_field('htca', '', FALSE, ''); ?> </td>
+            <td width="50%" class="smallText"> <script>document.writeln('<a style="cursor:hand" onclick="javascript:popup=window.open('
+                                           + '\'header_tags_popup_help.php\',\'popup\','
+                                           + '\'scrollbars,resizable,width=520,height=550,left=50,top=50\'); popup.focus(); return false;">'
+                                           + '<font color="red"><u><?php echo EXPLAIN ;?></u></font></a>');
+            </script> </td>
+           </tr>
+          </table></td>
+         </tr>
+         
+         <tr>
+          <td><table border="0" width="100%">
+           <tr>
+            <td class="smallText" width="10%" style="font-weight: bold;"><!-- Title --><?php TITLE_TITLE?></td>
+            <td class="smallText" ><?php echo tep_draw_input_field('title', tep_not_null($title) ? $title : '', 'maxlength="255", size="60"', false); ?> </td>
+           <tr> 
+           <tr>
+            <td class="smallText" style="font-weight: bold;"><!-- Descriptions --><?php DESCRIPTIONS?></td>
+            <td class="smallText" ><?php echo tep_draw_input_field('desc', tep_not_null($desc) ? $desc : '', 'maxlength="255", size="60"', false); ?> </td>
+           <tr> 
+           <tr>
+            <td class="smallText" style="font-weight: bold;"><!-- Keyword(s) --><?php KEYWORD?></td>
+            <td class="smallText" ><?php echo tep_draw_input_field('keyword', tep_not_null($key) ? $key : '', 'maxlength="255", size="60"', false); ?> </td>
+           <tr>
+          </table></td>
+         </tr>
+         
+       <tr> 
+        <td align="center">
+    <?php 
+    if($file_writeable=='true')
+    {
+      echo (tep_image_submit('button_update.gif', IMAGE_UPDATE) ) . ' <a href="' . tep_href_link(FILENAME_HEADER_TAGS_CONTROLLER, '') .'">' . '</a>'; 
+    }
+    ?>
+    </td>
+       </tr>
+       
+       <tr>
+        <td><?php echo tep_black_line(); ?></td>
+       </tr>
+       
+      </form>
+      </td>
+     </tr>
+     <!-- end of Header Tags - Add a Page-->
+        
+     <!-- Begin of Header Tags - Delete a Page -->
+     <tr>
+      <td><?php echo tep_black_line(); ?></td>
+     </tr>
+     <tr>
+      <td class="main"><?php echo TEXT_INFORMATION_DELETE_PAGE; ?></td>
+     </tr>     
+     <tr>
+      <td align="right"><?php echo tep_draw_form('header_tags_delete', FILENAME_HEADER_TAGS_CONTROLLER, '', 'post') . tep_draw_hidden_field('action_delete', 'process'); ?></td>
+       <tr>
+        <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+         <tr>
+          <td><table border="0" width="100%">
+           <tr>
+            <td class="smallText" width="10%" style="font-weight: bold;"><!-- Page Name --><?php PAGE_NAME?></td>
+            <td align="left"><?php   echo tep_draw_pull_down_menu('delete_page', $deleteArray, '', '', false);?></td>
+           <tr>             
+          </table></td>
+         </tr>        
+       <tr> 
+        <td align="center">
+    <?php 
+    if($file_writeable=='true')
+    {
+      echo (tep_image_submit('button_update.gif', IMAGE_UPDATE) ) . ' <a href="' . tep_href_link(FILENAME_HEADER_TAGS_CONTROLLER, '') .'">' . '</a>'; 
+    }
+    ?>
+    </td>
+       </tr>       
+       <tr>
+        <td><?php echo tep_black_line(); ?></td>
+       </tr>      
+      </form>
+      </td>
+     </tr>
+     <!-- end of Header Tags - Delete a Page-->  
+     
+     <!-- Begin of Header Tags - Auto Add Pages -->
+     <!-- Removing this on SALs reques, Jagdish as we have merged the ADD/Check Missing in ONE
+   <tr>
+      <td><?php echo tep_black_line(); ?></td>
+     </tr>
+     <tr>
+      <td class="main"><?php echo TEXT_INFORMATION_CHECK_PAGES; ?></td>
+     </tr>     
+     <tr>
+      <td align="right"><?php echo tep_draw_form('header_tags_auto', FILENAME_HEADER_TAGS_CONTROLLER, '', 'post') . tep_draw_hidden_field('action_check', 'process'); ?></td>
+       <tr>
+        <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+        <tr>
+          <td><table border="0" width="100%">
+           <tr>
+            <td class="smallText" width="10%" style="font-weight: bold;">Page Name</td>
+            <td align="left"><?php   echo tep_draw_pull_down_menu('new_files', $newfiles, '', '', false);?></td>
+           <tr>             
+          </table></td>
+         </tr>            
+       <tr> 
+        <td align="center"><?php echo (tep_image_submit('button_update.gif', IMAGE_UPDATE) ) . ' <a href="' . tep_href_link(FILENAME_HEADER_TAGS_CONTROLLER, '') .'">' . '</a>'; ?></td>
+       </tr> 
+     
+     -->
+           
+       <tr>
+        <td><?php echo tep_black_line(); ?></td>
+       </tr>      
+      </form>
+      </td>
+     </tr>
+     <!-- end of Header Tags - Auto Add Pages-->  
+   
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/header_tags_english.php
===================================================================
--- trunk/direct.openmoko.com/admin/header_tags_english.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/header_tags_english.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,283 @@
+<?php
+/*
+  $Id: header_tags_controller.php,v 1.0 2005/04/08 22:50:52 hpdl Exp $
+  Originally Created by: Jack York - http://www.oscommerce-solution.com
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+ 
+  require('includes/application_top.php');
+  require('includes/functions/header_tags.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_HEADER_TAGS_CONTROLLER);
+  
+  $filename = DIR_FS_CATALOG . DIR_WS_LANGUAGES . $language . '/header_tags.php';
+  $formActive = false;
+  
+  /****************** READ IN FORM DATA ******************/
+  $action = (isset($HTTP_POST_VARS['action']) ? $HTTP_POST_VARS['action'] : '');
+  
+  if (tep_not_null($action)) 
+  {
+      $main['title'] = addslashes($_POST['main_title']);  //read in the knowns
+      $main['desc'] = addslashes($_POST['main_desc']);
+      $main['keyword'] = addslashes($_POST['main_keyword']);
+ 
+      $formActive = true;
+      $args_new = array();
+      $c = 0;
+      $pageCount = TotalPages($filename);
+      for ($t = 0, $c = 0; $t < $pageCount; ++$t, $c += 3) //read in the unknowns
+      {
+         $args_new['title'][$t] = $_POST[$c];
+         $args_new['desc'][$t] = $_POST[$c+1];
+         $args_new['keyword'][$t] = $_POST[$c+2];
+        
+         $boxID = sprintf("HTTA_%d", $t); 
+         $args_new['HTTA'][$t] = $_POST[$boxID];
+         $boxID = sprintf("HTDA_%d", $t); 
+         $args_new['HTDA'][$t] = $_POST[$boxID];
+         $boxID = sprintf("HTKA_%d", $t); 
+         $args_new['HTKA'][$t] = $_POST[$boxID];
+         $boxID = sprintf("HTCA_%d", $t); 
+         $args_new['HTCA'][$t] = $_POST[$boxID];
+      }   
+  }
+  
+  /***************** READ IN DISK FILE ******************/
+  $main_title = '';
+  $main_desc = '';
+  $main_key = '';
+  $sections = array();      //used for unknown titles
+  $args = array();          //used for unknown titles
+  $ctr = 0;                 //used for unknown titles
+  $findTitles = false;      //used for unknown titles
+  $fp = file($filename);  
+ 
+  for ($idx = 0; $idx < count($fp); ++$idx)
+  { 
+      if (strpos($fp[$idx], "define('HEAD_TITLE_TAG_ALL','") !== FALSE)
+      {
+          $main_title = GetMainArgument($fp[$idx], $main_title, $main['title'], $formActive);
+      } 
+      else if (strpos($fp[$idx], "define('HEAD_DESC_TAG_ALL") !== FALSE)
+      {
+          $main_desc = GetMainArgument($fp[$idx], $main_desc, $main['desc'], $formActive);
+      } 
+      else if (strpos($fp[$idx], "define('HEAD_KEY_TAG_ALL") !== FALSE)
+      {
+          $main_key = GetMainArgument($fp[$idx], $main_key, $main['keyword'], $formActive);             
+          $findTitles = true;  //enable next section            
+      } 
+      else if ($findTitles)
+      {
+          if (($pos = strpos($fp[$idx], '.php')) !== FALSE) //get the section titles
+          {
+              $sections['titles'][$ctr] = GetSectionName($fp[$idx]);   
+              $ctr++; 
+          }
+          else                                   //get the rest of the items in this section
+          {
+              if (! IsComment($fp[$idx])) // && tep_not_null($fp[$idx]))
+              {
+                  $c = $ctr - 1;
+                  if (IsTitleSwitch($fp[$idx]))
+                  {
+                     $args['title_switch'][$c] = GetSwitchSetting($fp[$idx]);
+                     $args['title_switch_name'][$c] = sprintf("HTTA_%d",$c);                     
+                     if ($formActive)
+                     {
+                       $fp[$idx] = ChangeSwitch($fp[$idx], $args_new['HTTA'][$c]);
+                       $args['title_switch'][$c] = GetSwitchSetting($fp[$idx]);
+                       $args['title_switch_name'][$c] = sprintf("HTTA_%d",$c); 
+                     }                      
+                  }
+                  else if (IsDescriptionSwitch($fp[$idx]))
+                  {
+                     $args['desc_switch'][$c] = GetSwitchSetting($fp[$idx]);
+                     $args['desc_switch_name'][$c] = sprintf("HTDA_%d",$c);  
+                     if ($formActive)
+                     {
+                       $fp[$idx] = ChangeSwitch($fp[$idx], $args_new['HTDA'][$c]);
+                       $args['desc_switch'][$c] = GetSwitchSetting($fp[$idx]);
+                       $args['desc_switch_name'][$c] = sprintf("HTDA_%d",$c);  
+                     } 
+                  }
+                  if (IsKeywordSwitch($fp[$idx]))
+                  {
+                     $args['keyword_switch'][$c] = GetSwitchSetting($fp[$idx]);
+                     $args['keyword_switch_name'][$c] = sprintf("HTKA_%d",$c);
+                     if ($formActive)
+                     {
+                       $fp[$idx] = ChangeSwitch($fp[$idx], $args_new['HTKA'][$c]);
+                       $args['keyword_switch'][$c] = GetSwitchSetting($fp[$idx]);
+                       $args['keyword_switch_name'][$c] = sprintf("HTKA_%d",$c);
+                     }   
+                  }
+                  else if (IsCatSwitch($fp[$idx]))
+                  {
+                     $args['cat_switch'][$c] = GetSwitchSetting($fp[$idx]);
+                     $args['cat_switch_name'][$c] = sprintf("HTCA_%d",$c);
+                     if ($formActive)
+                       $fp[$idx] = ChangeSwitch($fp[$idx], $args_new['HTCA'][$c]); 
+                  }
+                  else if (IsTitleTag($fp[$idx]))
+                  {
+                     $args['title'][$c] = GetArgument($fp[$idx], $args_new['title'][$c], $formActive);
+                  } 
+                  else if (IsDescriptionTag($fp[$idx])) 
+                  {
+                     $args['desc'][$c] = GetArgument($fp[$idx], $args_new['desc'][$c], $formActive);                   
+                  }
+                  else if (IsKeywordTag($fp[$idx])) 
+                  {
+                    $args['keyword'][$c] = GetArgument($fp[$idx], $args_new['keyword'][$c], $formActive);
+                  }                                   
+              }
+          }
+      }
+  }
+
+  /***************** WRITE THE FILE ******************/
+  if ($formActive)
+  {      
+     WriteHeaderTagsFile($filename, $fp);  
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<style type="text/css">
+td.HTC_Head {color: sienna; font-size: 24px; font-weight: bold; } 
+td.HTC_subHead {color: sienna; font-size: 14px; } 
+</style> 
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+     <tr>
+      <td class="HTC_Head"><?php echo HEADING_TITLE_ENGLISH; ?></td>
+     </tr>
+     <tr>
+      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+     <tr>
+      <td class="HTC_subHead"><?php echo TEXT_ENGLISH_TAGS; ?></td>
+     </tr>
+     <tr>
+      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+     </tr>
+     
+     <!-- Begin of Header Tags -->
+     <tr>
+      <td align="right"><?php echo tep_draw_form('header_tags', FILENAME_HEADER_TAGS_ENGLISH, '', 'post') . tep_draw_hidden_field('action', 'process'); ?></td>
+       <tr>
+        <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+     
+         <tr>
+          <td class="smallText" width="20%" style="font-weight: bold;"><!-- Default Title --><?php echo HEADER_TAGS_ENGLISH_TXT_1?></td>
+          <td class="smallText" ><?php echo tep_draw_input_field('main_title', tep_not_null($main_title) ? $main_title : '', 'maxlength="255", size="60"', false); ?> </td>
+         <tr> 
+         <tr>
+          <td class="smallText" width="20%" style="font-weight: bold;"><!-- Default Descriptions --><?php echo HEADER_TAGS_ENGLISH_TXT_2?></td>
+          <td class="smallText" ><?php echo tep_draw_input_field('main_desc', tep_not_null($main_desc) ? $main_desc : '', 'maxlength="255", size="60"', false); ?> </td>
+         <tr> 
+         <tr>
+          <td class="smallText" width="20%" style="font-weight: bold;"><!-- Default Keyword(s) --><?php echo HEADER_TAGS_ENGLISH_TXT_3?></td>
+          <td class="smallText" ><?php echo tep_draw_input_field('main_keyword', tep_not_null($main_key) ? $main_key : '', 'maxlength="255", size="60"', false); ?> </td>
+         <tr> 
+         
+         <?php for ($i = 0, $id = 0; $i < count($sections['titles']); ++$i, $id += 3) { ?>
+         <tr>
+          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+         </tr>
+         
+         <tr>
+          <td colspan="3" ><table border="0" width="100%">
+         <tr>
+          <td colspan="3" class="smallText" width="20%" style="font-weight: bold;"><?php echo $sections['titles'][$i]; ?></td>
+          <td class="smallText"><!-- HTTA:  --><?php echo HEADER_TAGS_ENGLISH_TXT_4?></td>
+          <td align="left"><?php echo tep_draw_checkbox_field($args['title_switch_name'][$i], '', $args['title_switch'][$i], ''); ?> </td>
+          <td class="smallText"><!-- HTDA: --><?php echo HEADER_TAGS_ENGLISH_TXT_5?> </td>
+          <td align="left"><?php echo tep_draw_checkbox_field($args['desc_switch_name'][$i], '', $args['desc_switch'][$i], ''); ?> </td>
+          <td class="smallText"><!-- HTKA: --> <?php echo HEADER_TAGS_ENGLISH_TXT_6?></td>
+          <td align="left"><?php echo tep_draw_checkbox_field($args['keyword_switch_name'][$i], '', $args['keyword_switch'][$i], ''); ?> </td>
+          <td class="smallText"><!-- HTCA: --> <?php echo HEADER_TAGS_ENGLISH_TXT_7?></td>
+          <td align="left"><?php echo tep_draw_checkbox_field($args['cat_switch_name'][$i], '', $args['cat_switch'][$i], ''); ?> </td>
+         
+          <td width="50%" class="smallText"> <script>document.writeln('<a style="cursor:hand" onclick="javascript:popup=window.open('
+                                           + '\'header_tags_popup_help.php\',\'popup\','
+                                           + '\'scrollbars,resizable,width=520,height=550,left=50,top=50\'); popup.focus(); return false;">'
+                                           + '<font color="red"><u><?php  echo HEADER_TAGS_ENGLISH_TXT_8 ;?></u></font></a>');
+         </script> </td>
+     
+         </tr>
+          </table></td>
+         </tr>
+         
+         <tr>
+          <td colspan="3" ><table border="0" width="100%">
+           <tr>
+            <td width="2%">&nbsp;</td>
+            <td class="smallText" width="12%"><!-- Title: --><?php echo HEADER_TAGS_ENGLISH_TXT_9?></td>
+            <td class="smallText" ><?php echo tep_draw_input_field($id, $args['title'][$i], 'maxlength="255", size="60"', false, 300); ?> </td>
+           </tr>
+           <tr>
+            <td width="2%">&nbsp;</td>
+            <td class="smallText" width="12%"><!-- Description: --><?php echo HEADER_TAGS_ENGLISH_TXT_10?></td>
+            <td class="smallText" ><?php echo tep_draw_input_field($id+1, $args['desc'][$i], 'maxlength="255", size="60"', false); ?> </td>
+           </tr>
+           <tr>
+            <td width="2%">&nbsp;</td>
+            <td class="smallText" width="12%"><!-- Keyword(s): --><?php echo HEADER_TAGS_ENGLISH_TXT_11?></td>
+            <td class="smallText" ><?php echo tep_draw_input_field($id+2, $args['keyword'][$i], 'maxlength="255", size="60"', false); ?> </td>
+           </tr>
+          </table></td>
+         </tr>
+         <?php } ?> 
+        </table>
+        </td>
+       </tr>  
+       <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+       </tr>
+       <tr> 
+        <td align="center"><?php echo (tep_image_submit('button_update.gif', IMAGE_UPDATE) ) . ' <a href="' . tep_href_link(FILENAME_HEADER_TAGS_ENGLISH, tep_get_all_get_params(array('action'))) .'">' . '</a>'; ?></td>
+       </tr>
+      </form>
+      </td>
+     </tr>
+     <!-- end of Header Tags -->
+
+         
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/header_tags_fill_tags.php
===================================================================
--- trunk/direct.openmoko.com/admin/header_tags_fill_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/header_tags_fill_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,221 @@
+<?php
+/*
+  $Id: header_tags_fill_tags.php,v 1.0 2005/08/25
+  Originally Created by: Jack York - http://www.oscommerce-solution.com
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+ 
+  require('includes/application_top.php'); 
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_HEADER_TAGS_CONTROLLER);
+ 
+  /****************** READ IN FORM DATA ******************/
+  $categories_fill = $_POST['group1'];
+  $products_fill = $_POST['group2'];
+  
+  $checkedCats = array();
+  $checkedProds = array();
+  
+  $languages = tep_get_languages();
+  $languages_array = array();
+  for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+    $languages_array[] = array('id' => $i + 1, //$languages[$i]['id'],
+                               'text' => $languages[$i]['name']);
+  }
+  $langID = $languages_id;
+  
+  /****************** FILL THE CATEGORIES ******************/
+   
+  if (isset($categories_fill))
+  {
+    $langID = $_POST['fill_language'];
+    
+    if ($categories_fill == 'none') 
+    {
+       $checkedCats['none'] = 'Checked';
+    }
+    else
+    { 
+      $categories_tags_query = tep_db_query("select categories_name, categories_id, categories_htc_title_tag, categories_htc_desc_tag, categories_htc_keywords_tag, language_id from categories_description where language_id = '" . $langID . "'");
+      while ($categories_tags = tep_db_fetch_array($categories_tags_query))
+      {
+        $updateDP = false;
+        
+        if ($categories_fill == 'empty')
+        {
+           if (! tep_not_null($categories_tags['categories_htc_title_tag']))
+             $updateDB = true;
+           $checkedCats['empty'] = 'Checked';
+        }
+        else if ($categories_fill == 'full')
+        {
+           $updateDB = true;
+           $checkedCats['full'] = 'Checked';
+        }
+        else      //assume clear all
+        {
+           tep_db_query("update categories_description set categories_htc_title_tag='', categories_htc_desc_tag = '', categories_htc_keywords_tag = '' where categories_id = '" . $categories_tags['categories_id']."' and language_id  = '" . $langID . "'");
+           $checkedCats['clear'] = 'Checked';
+        }
+           
+        
+        if ($updateDB)
+          tep_db_query("update categories_description set categories_htc_title_tag='".addslashes($categories_tags['categories_name'])."', categories_htc_desc_tag = '". addslashes($categories_tags['categories_name'])."', categories_htc_keywords_tag = '". addslashes($categories_tags['categories_name']) . "' where categories_id = '" . $categories_tags['categories_id']."' and language_id  = '" . $langID . "'");
+      }
+    }
+  }
+  else
+    $checkedCats['none'] = 'Checked';
+   
+  /****************** FILL THE PRODUCTS ******************/  
+
+  
+  if (isset($products_fill))
+  {
+    $langID = $_POST['fill_language'];
+    
+    if ($products_fill == 'none') 
+    {
+       $checkedProds['none'] = 'Checked';
+    }
+    else
+    { 
+      $products_tags_query = tep_db_query("select products_name, products_description, products_id, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, language_id from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . $langID . "'");
+      while ($products_tags = tep_db_fetch_array($products_tags_query))
+      {
+        $updateDP = false;
+        
+        if ($products_fill == 'empty')
+        {
+          if (! tep_not_null($products_tags['products_head_title_tag']))
+            $updateDB = true;
+          $checkedProds['empty'] = 'Checked';
+        }
+        else if ($products_fill == 'full')
+        {
+          $updateDB = true;
+          $checkedProds['full'] = 'Checked';
+        }
+        else      //assume clear all
+        {
+          tep_db_query("update products_description set products_head_title_tag='', products_head_desc_tag = '', products_head_keywords_tag =  '' where products_id = '" . $products_tags['products_id'] . "' and language_id='". $langID ."'");
+          $checkedProds['clear'] = 'Checked';
+        }
+      
+        if ($updateDB)
+          tep_db_query("update products_description set products_head_title_tag='".addslashes($products_tags['products_name'])."', products_head_desc_tag = '". addslashes(strip_tags($products_tags['products_name']))."', products_head_keywords_tag =  '" . addslashes($products_tags['products_name']) . "' where products_id = '" . $products_tags['products_id'] . "' and language_id='". $langID ."'");
+      }  
+    }
+  }
+  else
+    $checkedProds['none'] = 'Checked';
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<style type="text/css">
+td.HTC_Head {color: sienna; font-size: 24px; font-weight: bold; } 
+td.HTC_subHead {color: sienna; font-size: 14px; } 
+</style>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+     <tr>
+      <td class="HTC_Head"><?php echo HEADING_TITLE_FILL_TAGS; ?></td>
+     </tr>
+     <tr>
+      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+     <tr>
+      <td class="HTC_subHead"><?php echo TEXT_FILL_TAGS; ?></td>
+     </tr>
+     
+     <!-- Begin of Header Tags -->      
+     
+     <tr>
+      <td align="right"><?php echo tep_draw_form('header_tags', FILENAME_HEADER_TAGS_FILL_TAGS, '', 'post') . tep_draw_hidden_field('action', 'process'); ?></td>
+       <tr>
+      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+     </tr>
+     <tr>
+      <td class="main" ><?php echo 'Language' . ' '. tep_draw_pull_down_menu('fill_language', $languages_array, $langID);?></tr>
+     </tr>     
+       <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+       </tr>
+       
+       <tr>
+        <td><table border="0" width="40%">
+         <tr class="smallText">
+          <th><!-- CATEGORIES --><?php echo HEADER_TAGS_FILL_TAGS_TXT_1?></th>
+          <th><!-- PRODUCTS --><?php echo HEADER_TAGS_FILL_TAGS_TXT_2?></th>
+         </tr> 
+         <tr class="smallText">          
+          <td align=left><INPUT TYPE="radio" NAME="group1" VALUE="none" <?php echo $checkedCats['none']; ?>> <?php echo HEADER_TAGS_FILL_TAGS_TXT_3?></td>
+          <td align=left><INPUT TYPE="radio" NAME="group2" VALUE="none" <?php echo $checkedProds['none']; ?>> <?php echo HEADER_TAGS_FILL_TAGS_TXT_3?></td>
+         </tr>
+         <tr class="smallText"> 
+          <td align=left><INPUT TYPE="radio" NAME="group1" VALUE="empty"<?php echo $checkedCats['empty']; ?> > <?php echo HEADER_TAGS_FILL_TAGS_TXT_4?></td>
+          <td align=left><INPUT TYPE="radio" NAME="group2" VALUE="empty" <?php echo $checkedProds['empty']; ?>> <?php echo HEADER_TAGS_FILL_TAGS_TXT_4?></td>
+         </tr>
+         <tr class="smallText"> 
+          <td align=left><INPUT TYPE="radio" NAME="group1" VALUE="full" <?php echo $checkedCats['full']; ?>> <?php echo HEADER_TAGS_FILL_TAGS_TXT_5?></td>
+          <td align=left><INPUT TYPE="radio" NAME="group2" VALUE="full" <?php echo $checkedProds['full']; ?>> <?php echo HEADER_TAGS_FILL_TAGS_TXT_5?></td>
+         </tr>
+         <tr class="smallText"> 
+          <td align=left><INPUT TYPE="radio" NAME="group1" VALUE="clear" <?php echo $checkedCats['clear']; ?>> <?php echo HEADER_TAGS_FILL_TAGS_TXT_6?></td>
+          <td align=left><INPUT TYPE="radio" NAME="group2" VALUE="clear" <?php echo $checkedProds['clear']; ?>> <?php echo HEADER_TAGS_FILL_TAGS_TXT_6?></td>
+         </tr>
+        </table></td>
+       </tr> 
+       
+       <tr>
+        <td><table border="0" width="40%">
+         <tr>
+          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+         </tr>
+         <tr> 
+          <td align="center"><?php echo (tep_image_submit('button_update.gif', IMAGE_UPDATE) ) . ' <a href="' . tep_href_link(FILENAME_HEADER_TAGS_ENGLISH, tep_get_all_get_params(array('action'))) .'">' . '</a>'; ?></td>
+         </tr>
+        </table></td>
+       </tr>
+      </form>
+      </td>
+     </tr>
+     <!-- end of Header Tags -->
+
+         
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/header_tags_popup_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/header_tags_popup_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/header_tags_popup_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+/*
+  $Id: header_tags_popup_help.php,v 1.0 2005/09/22 13:45:11 devosc Exp $
+  produced by Jack_mcs
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+ 
+  require("includes/application_top.php");
+?>

Added: trunk/direct.openmoko.com/admin/help/stats_monthly_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/help/stats_monthly_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/help/stats_monthly_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+// $Id help/stats_monthly_sales.php 1.0a
+//
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title>Monthly Sales/Tax Report</title>
+<link rel="stylesheet" type="text/css" href="../includes/stylesheet.css">
+</head>
+<BODY>
+<center>
+<table width="95%"><tr><td>
+<p class="main" align="center">
+<b>How to view and use the store income summary report</b>
+<p class="main" align="justify">
+<b>Selected from the Reports menu</b>
+<p class="smallText" align="justify">
+When initially selected from the Reports menu, this report displays a financial summary of all orders in the store database.  Each month of the store's history is summarized in a row, showing all store income and its components, divided into taxable and exempt sales, and listing the amounts of taxes, shipping and handling charges, low order fees and gift vouchers. (If the store does not have low order fees or gift vouchers enabled, these columns are omitted from the report.)
+<p class="smallText" align="justify">
+The top row is the current month, and the rows under it summarize each month of the store's order history.  Beneath the rows of each calendar year is a footer line, summarizing that year's totals in each column of the report.
+<p class="main" align="justify">
+<b>What the columns represent (headers explained)</b>
+<p class="smallText" align="justify">
+On the left, the month and year of the row are stated.  The other columns are, left to right:
+<ul><li class="smallText"><b>Gross Income</b> - the sum total of all sales, taxes and other charges accumulated from the orders made in that month
+<li class="smallText"><b>Product sales</b> - the total sales of products purchased in the month
+<br>Then, the product sales are broken into two categories:
+<li class="smallText"><b>Exempt sales</b> - product sales which were shipped outside the store's zone (exempt from sales tax), and
+<li class="smallText"><b>Taxable sales</b> - product sales which were shipped within the store's zone (subject to sales tax)
+<li class="smallText"><b>Taxes paid</b> - the amount charged to customers and included in their order amount for taxes
+<li class="smallText"><b>Shipping & handling</b> - the total shipping and handling charges for the orders
+<li class="smallText"><b>Low order fees</b> and <b>Gift Vouchers</b> - if the store has low order fees enabled, and/or gift vouchers, the totals of these are shown in separate columns
+</ul>
+<p class="main" align="justify">
+<b>Selecting report summary by status</b>
+<p class="smallText" align="justify">
+To show the monthly summary information for just one Order Status, select the status in the drop-down box at the upper right of the report screen.  Depending on the store's setup for these values, there may be a status for "Pending" or "Shipped" for instance.  Change this status and the report will be recalculated and displayed.
+<p class="main" align="justify">
+<b>Printing the report</b>
+<p class="smallText" align="justify">
+To view the report in a printer-friendly window, click on the Print button next to the File and Help buttons, then user your browser's print command in the File menu.  The store name and headers are added to show what orders were selected, and when the report was generated.
+<p class="main" align="justify">
+<b>Saving report values to a file</b>
+<p class="smallText" align="justify">
+<i>If 'File' does not appear between 'Print' and 'Help' on your system, this feature has been disabled by your system administrator, whom you should consult for further information.</i>
+<p class="smallText" align="justify">
+To save the values of the report to a file, click on the File button between the Print and Help buttons.  The report values will be sent to your browser in a text file, and you will be prompted with a Save File dialog box to choose where to save the file.  The contents of the file are in Comma Separated Value (CSV) format, with a line for each row of the report beginning with the header line, and each value in the row is separated by commas. This file can be conveniently and accurately imported to common spreadsheet financial and statistical tools, such as Excel and QuattroPro. The file is provided to your browser with a suggested file name consisting of the report name, status selected, and date/time. <br><br>
+</td></tr>
+</table>
+</BODY>
+</HTML>

Added: trunk/direct.openmoko.com/admin/images/00add_button.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/00add_button.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/120x35ecomm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/120x35ecomm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/468x60ecomm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/468x60ecomm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/Book-4-mockup.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/Book-4-mockup.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/admin_logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/admin_logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/admin_logo_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/admin_logo_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/ani_send_email.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/ani_send_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/arrow_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/arrow_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/arrow_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/arrow_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/button_upgrade_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/button_upgrade_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/cal_close_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/cal_close_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/cal_date_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/cal_date_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/cal_date_over.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/cal_date_over.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/cal_date_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/cal_date_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/cal_del_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/cal_del_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/administrator.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/administrator.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/affiliate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/affiliate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/catalog.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/catalog.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/configuration.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/configuration.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/customers.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/customers.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/design_controls.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/design_controls.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/faq.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/faq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/gift.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/gift.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/info.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/info.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/links.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/links.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/localization.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/localization.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/location.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/location.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/modules.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/modules.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/my_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/my_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/news.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/news.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/paypalipn.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/paypalipn.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/reports.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/reports.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/categories/tools.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/categories/tools.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/close_window.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/close_window.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/colortable.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/colortable.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/covers-BOTH-100x125.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/covers-BOTH-100x125.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/cre_header_slice.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/cre_header_slice.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/crebook.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/crebook.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/default.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/default.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/graph_hbar_blue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/graph_hbar_blue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/graph_hbar_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/graph_hbar_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/graphs/dummy
===================================================================

Added: trunk/direct.openmoko.com/admin/images/header_administration.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/header_administration.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/header_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/header_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/header_support.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/header_support.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/help1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/help1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_arrow_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_arrow_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_arrow_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_arrow_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_info.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_info.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_infobox_green.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_infobox_green.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_infobox_green_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_infobox_green_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_infobox_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_infobox_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_infobox_red_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_infobox_red_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_n_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_n_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_n_red_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_n_red_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_popup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_popup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_reset.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_reset.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_save.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_blue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_blue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_gold.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_gold.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_gold_border.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_gold_border.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_green.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_green.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_green_border_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_green_border_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_green_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_green_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_red_border_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_red_border_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_red_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_red_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_white.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_white.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_status_yellow.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_status_yellow.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_y_green.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_y_green.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icon_y_green_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icon_y_green_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/arrow_checkall.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/arrow_checkall.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/confirm_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/confirm_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/cross.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/cross.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/current_folder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/current_folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/edit_2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/edit_2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/error.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/error.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/file.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/file.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/file_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/file_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/folder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/icon_status_green.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/icon_status_green.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/icon_status_green_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/icon_status_green_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/icon_status_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/icon_status_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/icon_status_red_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/icon_status_red_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/icon_status_yellow.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/icon_status_yellow.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/locked.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/locked.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/preview.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/preview.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/preview_upload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/preview_upload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/previous_level.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/previous_level.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/sort.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/sort.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/statistics.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/statistics.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/success.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/success.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/tick.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/tick.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/unlocked.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/unlocked.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/warning.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/warning.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/icons/warning_big.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/icons/warning_big.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/base.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/base.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/cd.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/cd.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/empty.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/empty.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/folder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/folderopen.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/folderopen.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/globe.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/globe.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/imgfolder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/imgfolder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/join.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/join.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/joinbottom.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/joinbottom.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/line.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/line.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/minus.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/minus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/minusbottom.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/minusbottom.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/musicfolder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/musicfolder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/nolines_minus.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/nolines_minus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/nolines_plus.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/nolines_plus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/page.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/page.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/plus.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/plus.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/plusbottom.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/plusbottom.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/question.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/question.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/img/trash.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/img/trash.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/loaded_3box_ad.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/loaded_3box_ad.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/loaded_header_logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/loaded_header_logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/logo-banner_02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/logo-banner_02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/logo-banner_03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/logo-banner_03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/logo-banner_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/logo-banner_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/mark_check.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/mark_check.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/mark_x.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/mark_x.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/oscommerce.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/oscommerce.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/pithy-anim-2.0.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/pithy-anim-2.0.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/pixel_black.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/pixel_black.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/shipwire_logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/shipwire_logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/thinktank.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/thinktank.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/images/up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/images/up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/account_check.js.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/account_check.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/account_check.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+  $Id: account_check.js.php,v 1.1.1.1 2004/03/04 23:39:39 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+
+<?php
+if (substr(basename($PHP_SELF), 0, 12) == 'admin_member') {
+?>
+
+<script language="JavaScript" type="text/JavaScript">
+<!--
+function validateForm() {
+  var p,z,xEmail,errors='',dbEmail,result=0,i;
+
+  var adminName1 = document.newmember.admin_firstname.value;
+  var adminName2 = document.newmember.admin_lastname.value;
+  var adminEmail = document.newmember.admin_email_address.value;
+
+  if (adminName1 == '') {
+    errors+='<?php echo JS_ALERT_FIRSTNAME; ?>';
+  } else if (adminName1.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
+    //errors+='- Firstname length must over  <?php echo (ENTRY_FIRST_NAME_MIN_LENGTH); ?>\n';
+    errors+=' <?php echo JS_ALERT_FIRSTNAME_1.(ENTRY_FIRST_NAME_MIN_LENGTH); ?>\n';
+  }
+
+  if (adminName2 == '') {
+    errors+='<?php echo JS_ALERT_LASTNAME; ?>';
+  } else if (adminName2.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
+    errors+=' <?php echo JS_ALERT_LASTNAME_1. (ENTRY_LAST_NAME_MIN_LENGTH);  ?>\n';
+  }
+
+  if (adminEmail == '') {
+    errors+='<?php echo JS_ALERT_EMAIL; ?>';
+  } else if (adminEmail.indexOf("@") <= 1 || adminEmail.indexOf("@") >= (adminEmail.length - 3) || adminEmail.indexOf(".") <= 3 || adminEmail.indexOf(".") >= (adminEmail.length - 2) || adminEmail.indexOf("@.") >= 0 ) {
+    errors+='<?php echo JS_ALERT_EMAIL_FORMAT; ?>';
+  } else if (adminEmail.length < <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>) {
+    errors+='<?php echo JS_ALERT_EMAIL_FORMAT; ?>';
+  }
+
+  //if (errors) alert('The following error(s) occurred:\n'+errors);
+  if (errors) alert('<?php echo JS_ALERT_ERROR; ?>:\n'+errors);
+  document.returnValue = (errors == '');
+}
+
+
+function checkGroups(obj) {
+  var subgroupID,i;
+  subgroupID = eval("this.defineForm.subgroups_"+parseFloat((obj.id).substring(7)));
+
+  if (subgroupID.length > 0) {
+    for (i=0; i<subgroupID.length; i++) {
+      if (obj.checked == true) { subgroupID[i].checked = true; }
+      else { subgroupID[i].checked = false; }
+    }
+  } else {
+    if (obj.checked == true) { subgroupID.checked = true; }
+    else { subgroupID.checked = false; }
+  }
+}
+
+function checkSub(obj) {
+  var groupID,subgroupID,i,num=0;
+  groupID = eval("this.defineForm.groups_"+parseFloat((obj.id).substring(10)));
+  subgroupID = eval("this.defineForm."+(obj.id));
+
+  if (subgroupID.length > 0) {
+    for (i=0; i < subgroupID.length; i++) {
+      if (subgroupID[i].checked == true) num++;
+    }
+  } else {
+    if (subgroupID.checked == true) num++;
+  }
+  if (num>0) { groupID.checked = true; }
+  else { groupID.checked = false; }
+}
+//-->
+</script>
+
+<?php
+} else {
+?>
+
+<script language="JavaScript" type="text/JavaScript">
+<!--
+function validateForm() {
+  var p,z,xEmail,errors='',dbEmail,result=0,i;
+
+  var adminName1 = document.account.admin_firstname.value;
+  var adminName2 = document.account.admin_lastname.value;
+  var adminEmail = document.account.admin_email_address.value;
+  var adminPass1 = document.account.admin_password.value;
+  var adminPass2 = document.account.admin_password_confirm.value;
+
+  if (adminName1 == '') {
+    errors+='<?php echo JS_ALERT_FIRSTNAME; ?>';
+  } else if (adminName1.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
+    errors+='<?php echo JS_ALERT_FIRSTNAME_LENGTH . ENTRY_FIRST_NAME_MIN_LENGTH; ?>\n';
+  }
+
+  if (adminName2 == '') {
+    errors+='<?php echo JS_ALERT_LASTNAME; ?>';
+  } else if (adminName2.length < <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>) {
+    errors+='<?php echo JS_ALERT_LASTNAME_LENGTH . ENTRY_LAST_NAME_MIN_LENGTH;  ?>\n';
+  }
+
+  if (adminEmail == '') {
+    errors+='<?php echo JS_ALERT_EMAIL; ?>';
+  } else if (adminEmail.indexOf("@") <= 1 || adminEmail.indexOf("@") >= (adminEmail.length - 3) || adminEmail.indexOf(".") <= 3 || adminEmail.indexOf(".") >= (adminEmail.length - 2) || adminEmail.indexOf("@.") >= 0 ) {
+    errors+='<?php echo JS_ALERT_EMAIL_FORMAT; ?>';
+  } else if (adminEmail.length < <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>) {
+    errors+='<?php echo JS_ALERT_EMAIL_FORMAT; ?>';
+  }
+
+  if (adminPass1 == '') {
+    errors+='<?php echo JS_ALERT_PASSWORD; ?>';
+  } else if (adminPass1.length < <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>) {
+    errors+='<?php echo JS_ALERT_PASSWORD_LENGTH . ENTRY_PASSWORD_MIN_LENGTH; ?>\n';
+  } else if (adminPass1 != adminPass2) {
+    errors+='<?php echo JS_ALERT_PASSWORD_CONFIRM; ?>';
+  }
+
+  //if (errors) alert('The following error(s) occurred:\n'+errors);
+  if (errors) alert('<?php echo JS_ALERT_ERROR; ?>:\n'+errors);
+  document.returnValue = (errors == '');
+}
+
+//-->
+</script>
+
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/admin/includes/add_ccgvdc_application_top.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/add_ccgvdc_application_top.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/add_ccgvdc_application_top.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,98 @@
+<?php
+DEFINE('FILENAME_GV_QUEUE', 'gv_queue.php');
+DEFINE('FILENAME_GV_MAIL', 'gv_mail.php');
+DEFINE('FILENAME_GV_SENT', 'gv_sent.php');
+define('FILENAME_COUPON_ADMIN', 'coupon_admin.php');
+define('FILENAME_GV_REPORT', 'gv_report.php');
+
+define('TABLE_COUPON_GV_QUEUE', 'coupon_gv_queue');
+define('TABLE_COUPON_GV_CUSTOMER', 'coupon_gv_customer');
+define('TABLE_COUPON_EMAIL_TRACK', 'coupon_email_track');
+define('TABLE_COUPON_REDEEM_TRACK', 'coupon_redeem_track');
+define('TABLE_COUPONS', 'coupons');
+define('TABLE_COUPONS_DESCRIPTION', 'coupons_description');
+
+// Below are some defines which affect the way the discount coupon/gift voucher system work
+// Be careful when editing them.
+//
+// Set the length of the redeem code, the longer the more secure
+
+define('SECURITY_CODE_LENGTH', '6');
+
+////
+// Create a Coupon Code. length may be between 1 and 16 Characters
+// $salt needs some thought.
+
+  function create_coupon_code($salt="secret", $length=SECURITY_CODE_LENGTH) {
+    $ccid = md5(uniqid("","salt"));
+    $ccid .= md5(uniqid("","salt"));
+    $ccid .= md5(uniqid("","salt"));
+    $ccid .= md5(uniqid("","salt"));
+    srand((double)microtime()*1000000); // seed the random number generator
+    $random_start = @rand(0, (128-$length));
+    $good_result = 0;
+    while ($good_result == 0) {
+      $id1=substr($ccid, $random_start,$length);
+      $query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . $id1 . "'");
+      if (tep_db_num_rows($query) == 0) $good_result = 1;
+    }
+    return $id1;
+  }
+////
+// Update the Customers GV account
+  function tep_gv_account_update($customer_id, $gv_id) {
+    $customer_gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $coupon_gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
+    $coupon_gv = tep_db_fetch_array($coupon_gv_query);
+    if (tep_db_num_rows($customer_gv_query) > 0) {
+      $customer_gv = tep_db_fetch_array($customer_gv_query);
+      $new_gv_amount = $customer_gv['amount'] + $coupon_gv['coupon_amount'];
+ $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "' where customer_id = '" . $customer_id . "'");
+    } else {
+      $gv_query = tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $coupon_gv['coupon_amount'] . "')");
+    }
+  }
+////
+// Output a day/month/year dropdown selector
+  function tep_draw_date_selector($prefix, $date='') {
+    $month_array = array();
+    $month_array[1] =_JANUARY;
+    $month_array[2] =_FEBRUARY;
+    $month_array[3] =_MARCH;
+    $month_array[4] =_APRIL;
+    $month_array[5] =_MAY;
+    $month_array[6] =_JUNE;
+    $month_array[7] =_JULY;
+    $month_array[8] =_AUGUST;
+    $month_array[9] =_SEPTEMBER;
+    $month_array[10] =_OCTOBER;
+    $month_array[11] =_NOVEMBER;
+    $month_array[12] =_DECEMBER;
+    $usedate = getdate($date);
+    $day = $usedate['mday'];
+    $month = $usedate['mon'];
+    $year = $usedate['year'];
+    $date_selector = '<select name="'. $prefix .'_day">';
+    for ($i=1;$i<32;$i++){
+      $date_selector .= '<option value="' . $i . '"';
+      if ($i==$day) $date_selector .= 'selected';
+      $date_selector .= '>' . $i . '</option>';
+    }
+    $date_selector .= '</select>';
+    $date_selector .= '<select name="'. $prefix .'_month">';
+    for ($i=1;$i<13;$i++){
+      $date_selector .= '<option value="' . $i . '"';
+      if ($i==$month) $date_selector .= 'selected';
+      $date_selector .= '>' . $month_array[$i] . '</option>';
+    }
+    $date_selector .= '</select>';
+    $date_selector .= '<select name="'. $prefix .'_year">';
+    for ($i=2001;$i<2019;$i++){
+      $date_selector .= '<option value="' . $i . '"';
+      if ($i==$year) $date_selector .= 'selected';
+      $date_selector .= '>' . $i . '</option>';
+    }
+    $date_selector .= '</select>';
+    return $date_selector;
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/affiliate_application_top.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/affiliate_application_top.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/affiliate_application_top.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: affiliate_application_top.php,v 1.1.1.1 2004/03/04 23:39:39 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// Set the local configuration parameters - mainly for developers
+  if (file_exists(DIR_WS_INCLUDES . 'local/affiliate_configure.php')) include(DIR_WS_INCLUDES . 'local/affiliate_configure.php');
+
+  require(DIR_WS_INCLUDES . 'affiliate_configure.php');
+  require(DIR_WS_FUNCTIONS . 'affiliate_functions.php');
+
+  define('FILENAME_AFFILIATE', 'affiliate_affiliates.php');
+  define('FILENAME_AFFILIATE_BANNERS', 'affiliate_banners.php');
+  define('FILENAME_AFFILIATE_BANNER_MANAGER', 'affiliate_banners.php');
+  define('FILENAME_AFFILIATE_CLICKS', 'affiliate_clicks.php');
+  define('FILENAME_AFFILIATE_CONTACT', 'affiliate_contact.php');
+  define('FILENAME_AFFILIATE_HELP_1', 'affiliate_help1.php');
+  define('FILENAME_AFFILIATE_HELP_2', 'affiliate_help2.php');
+  define('FILENAME_AFFILIATE_HELP_3', 'affiliate_help3.php');
+  define('FILENAME_AFFILIATE_HELP_4', 'affiliate_help4.php');
+  define('FILENAME_AFFILIATE_HELP_5', 'affiliate_help5.php');
+  define('FILENAME_AFFILIATE_HELP_6', 'affiliate_help6.php');
+  define('FILENAME_AFFILIATE_HELP_7', 'affiliate_help7.php');
+  define('FILENAME_AFFILIATE_HELP_8', 'affiliate_help8.php');
+  define('FILENAME_AFFILIATE_INVOICE', 'affiliate_invoice.php');
+  define('FILENAME_AFFILIATE_NEWS', 'affiliate_news.php');
+  define('FILENAME_AFFILIATE_NEWSLETTERS', 'affiliate_newsletters.php');
+  define('FILENAME_AFFILIATE_PAYMENT', 'affiliate_payment.php');
+  define('FILENAME_AFFILIATE_POPUP_IMAGE', 'affiliate_popup_image.php');
+  define('FILENAME_AFFILIATE_SALES', 'affiliate_sales.php');
+  define('FILENAME_AFFILIATE_STATISTICS', 'affiliate_statistics.php');
+  define('FILENAME_AFFILIATE_SUMMARY', 'affiliate_summary.php');
+  define('FILENAME_AFFILIATE_RESET', 'affiliate_reset.php');
+  define('FILENAME_AFFILIATE_VALIDPRODUCTS', 'affiliate_validproducts.php');
+  define('FILENAME_AFFILIATE_VALIDCATS', 'affiliate_validcats.php');
+  define('FILENAME_CATALOG_AFFILIATE_PAYMENT_INFO','affiliate_payment.php');
+  define('FILENAME_CATALOG_PRODUCT_INFO', 'product_info.php');
+
+
+  define('TABLE_AFFILIATE', 'affiliate_affiliate');
+  define('TABLE_AFFILIATE_NEWS', 'affiliate_news');
+  define('TABLE_AFFILIATE_NEWSLETTERS', 'affiliate_newsletters');
+  define('TABLE_AFFILIATE_BANNERS', 'affiliate_banners');
+  define('TABLE_AFFILIATE_BANNERS_HISTORY', 'affiliate_banners_history');
+  define('TABLE_AFFILIATE_CLICKTHROUGHS', 'affiliate_clickthroughs');
+  define('TABLE_AFFILIATE_PAYMENT', 'affiliate_payment');
+  define('TABLE_AFFILIATE_PAYMENT_STATUS', 'affiliate_payment_status');
+  define('TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY', 'affiliate_payment_status_history');
+  define('TABLE_AFFILIATE_SALES', 'affiliate_sales');
+  define('TABLE_AFFILIATE_NEWS_CONTENTS', 'affiliate_news_contents');
+
+// include the language translations
+  require(DIR_WS_LANGUAGES . 'affiliate_' . $language . '.php');
+
+// If an order is deleted delete the sale too (optional)
+  if ($HTTP_GET_VARS['action'] == 'deleteconfirm' && basename($HTTP_SERVER_VARS['SCRIPT_FILENAME']) == FILENAME_ORDERS && AFFILIATE_DELETE_ORDERS == 'true') {
+    $affiliate_oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+    tep_db_query("delete from " . TABLE_AFFILIATE_SALES . " where affiliate_orders_id = '" . tep_db_input($affiliate_oID) . "' and affiliate_billing_status != 1");
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/affiliate_configure.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/affiliate_configure.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/affiliate_configure.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_configure.php,v 1.1.1.1 2004/03/04 23:39:39 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define ('AFFILIATE_NOTIFY_AFTER_BILLING','true'); // Nofify affiliate if he got a new invoice
+  define ('AFFILIATE_DELETE_ORDERS','false');       // Delete affiliate_sales if an order is deleted (Warning: Only not yet billed sales are deleted)
+
+  define ('AFFILIATE_TAX_ID','1');  // Tax Rates used for billing the affiliates
+                                   // you get this from the URl (tID) when you select you Tax Rate at the admin: tax_rates.php?tID=1
+// If set, the following actions take place each time you call the admin/affiliate_summary
+  define ('AFFILIATE_DELETE_CLICKTHROUGHS','false');  // (days / false) To keep the clickthrough report small you can set the days after which they are deleted (when calling affiliate_summary in the admin)
+  define ('AFFILIATE_DELETE_AFFILIATE_BANNER_HISTORY','false');  // (days / false) To keep thethe table AFFILIATE_BANNER_HISTORY small you can set the days after which they are deleted (when calling affiliate_summary in the admin)
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/application_bottom.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/application_bottom.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/application_bottom.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: application_bottom.php,v 1.1.1.1 2004/03/04 23:39:39 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// close session (store variables)
+  tep_session_close();
+
+  if (STORE_PAGE_PARSE_TIME == 'true') {
+    if (!is_object($logger)) $logger = new logger;
+    echo $logger->timer_stop(DISPLAY_PAGE_PARSE_TIME);
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/application_top.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/application_top.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/application_top.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,329 @@
+<?php
+/*
+  $Id: application_top.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//// Added for gzip compression
+function compress_output($output) 
+{ 
+// We can perform additional manipulation on $output here, such  
+// as stripping whitespace, etc. 
+    return gzencode($output); 
+} 
+
+// Check if the browser supports gzip encoding, HTTP_ACCEPT_ENCODING 
+if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
+ 
+// Start output buffering, and register compress_output() (see  
+// below) 
+  ob_start("compress_output");
+
+// Tell the browser the content is compressed with gzip 
+header("Content-Encoding: gzip"); 
+} 
+
+// End Gzip compression
+
+// Start the clock for the page parse time log
+  define('PAGE_PARSE_START_TIME', microtime());
+
+// Set the level of error reporting
+  error_reporting(E_ALL & ~E_NOTICE);
+
+// Check if register_globals is enabled.
+// Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
+  if (function_exists('ini_get')) {
+    ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');
+  }
+
+// Set the local configuration parameters - mainly for developers
+  if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');
+
+// Include application configuration parameters
+  require('includes/configure.php');
+
+// define the project version
+include('includes/version.php');
+
+// set the type of request (secure or not)
+  $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
+
+// set php_self in the local scope
+  if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
+
+  if ($request_type == 'NONSSL') {
+    define('DIR_WS_ADMIN', DIR_WS_HTTP_ADMIN);
+    define('BASE_HREF', HTTP_SERVER . DIR_WS_HTTP_ADMIN);
+  } else {
+    define('DIR_WS_ADMIN', DIR_WS_HTTPS_ADMIN);
+    define('BASE_HREF', HTTPS_SERVER . DIR_WS_HTTPS_ADMIN);
+  }
+  
+  // this is patch up code to support sites with configuration file built
+  // before 6.2.08.  The only define was for the DIR_WS_CATALOG
+  // the instal routines were updated to provide additional references
+  // Values are forced to prevent problems, however this will still be a 
+  // problem for sites using shared ssl certificates htat havea different 
+  // file names
+  if ( !defined('DIR_WS_HTTPS_CATALOG') || !defined('DIR_WS_HTTP_CATALOG') ) {
+    define('DIR_WS_HTTPS_CATALOG', DIR_WS_CATALOG);
+    define('DIR_WS_HTTP_CATALOG', DIR_WS_CATALOG);
+  }
+
+// set php_self in the local scope
+  $PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);
+
+// Used in the "Backup Manager" to compress backups
+  define('LOCAL_EXE_GZIP', '/usr/bin/gzip');
+  define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');
+  define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');
+  define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');
+
+// include the list of project filenames
+  require(DIR_WS_INCLUDES . 'filenames.php');
+
+// include the list of project database tables
+  require(DIR_WS_INCLUDES . 'database_tables.php');
+
+//     define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)
+// define('MENU_DHTML', false);
+
+// Define how do we update currency exchange rates
+// Possible values are 'oanda' 'xe' or ''
+  define('CURRENCY_SERVER_PRIMARY', 'oanda');
+  define('CURRENCY_SERVER_BACKUP', 'xe');
+
+// include the database functions
+  require(DIR_WS_FUNCTIONS . 'database.php');
+
+// make a connection to the database... now
+  tep_db_connect() or die('Unable to connect to database server!');
+
+// set application wide parameters
+  $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+    define($configuration['cfgKey'], $configuration['cfgValue']);
+  }
+
+// define our general functions used application-wide
+  require(DIR_WS_FUNCTIONS . 'general.php');
+
+  require(DIR_WS_FUNCTIONS . 'html_output.php');
+  
+  // initialize the logger class
+    require(DIR_WS_CLASSES . 'logger.php');
+
+  
+//Admin begin
+// set the cookie domain
+  $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);
+  $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH);
+ require(DIR_WS_FUNCTIONS . 'password_funcs.php');
+//Admin end
+
+
+// include shopping cart class
+  require(DIR_WS_CLASSES . 'shopping_cart.php');
+  
+if (PAYMENT_CC_CRYPT == 'True'){
+require(DIR_WS_FUNCTIONS . 'crypt.php');
+}
+
+// some code to solve compatibility issues
+  require(DIR_WS_FUNCTIONS . 'compatibility.php');
+
+// define how the session functions will be used
+  require(DIR_WS_FUNCTIONS . 'sessions.php');
+
+// set the session name and save path
+  tep_session_name('osCAdminID');
+  tep_session_save_path(SESSION_WRITE_DIRECTORY);
+
+// set the session cookie parameters
+   session_set_cookie_params(0, $cookie_path, $cookie_domain);
+  
+// set the session ID if it exists
+   if ( isset($_COOKIE[tep_session_name()]) ) {
+     tep_session_id($_COOKIE[tep_session_name()]);
+   } elseif ( isset($_POST[tep_session_name()]) ) {
+     tep_session_id($_POST[tep_session_name()]);
+   } elseif ( ($request_type == 'SSL') && isset($_GET[tep_session_name()]) ) {
+     tep_session_id($_GET[tep_session_name()]);
+   }
+
+// lets start our session
+  tep_session_start();
+  $session_started = true;
+// verify the ssl_session_id if the feature is enabled
+  if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {
+    $ssl_session_id = getenv('SSL_SESSION_ID');
+    if (!tep_session_is_registered('SSL_SESSION_ID')) {
+      $SESSION_SSL_ID = $ssl_session_id;
+      tep_session_register('SESSION_SSL_ID');
+    }
+
+   if ($SESSION_SSL_ID != $ssl_session_id) {
+    tep_session_destroy();
+      tep_redirect(tep_href_link(FILENAME_SSL_CHECK));
+    }
+  }
+
+
+// set the language
+  if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
+    if (!tep_session_is_registered('language')) {
+      tep_session_register('language');
+      tep_session_register('languages_id');
+    }
+
+    include(DIR_WS_CLASSES . 'language.php');
+    $lng = new language();
+
+    if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
+      $lng->set_language($HTTP_GET_VARS['language']);
+    } else {
+      $lng->get_browser_language();
+    }
+
+    $language = $lng->language['directory'];
+    $languages_id = $lng->language['id'];
+  }
+
+// include the language translations
+  require(DIR_WS_LANGUAGES . $language . '.php');
+  $current_page = basename($PHP_SELF);
+  if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
+    include(DIR_WS_LANGUAGES . $language . '/' . $current_page);
+  }
+
+// currency
+  if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {
+    if (!tep_session_is_registered('currency')) tep_session_register('currency');
+
+    if (isset($HTTP_GET_VARS['currency'])) {
+      if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
+    } else {
+      $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
+    }
+  }
+
+// define our localization functions
+  require(DIR_WS_FUNCTIONS . 'localization.php');
+
+// Include validation functions (right now only email address)
+  require(DIR_WS_FUNCTIONS . 'validations.php');
+
+// setup our boxes
+  require(DIR_WS_CLASSES . 'table_block.php');
+  require(DIR_WS_CLASSES . 'box.php');
+
+// initialize the message stack for output messages
+  require(DIR_WS_CLASSES . 'message_stack.php');
+  $messageStack = new messageStack;
+// set which precautions should be checked
+  define('WARN_INSTALL_EXISTENCE', 'true');
+  define('WARN_CONFIG_WRITEABLE', 'true');
+  define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
+  define('WARN_SESSION_AUTO_START', 'true');
+  define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
+
+// split-page-results
+  require(DIR_WS_CLASSES . 'split_page_results.php');
+
+// entry/item info classes
+  require(DIR_WS_CLASSES . 'object_info.php');
+
+// email classes
+  require(DIR_WS_CLASSES . 'mime.php');
+  require(DIR_WS_CLASSES . 'email.php');
+
+// file uploading class
+  require(DIR_WS_CLASSES . 'upload.php');
+
+// calculate category path
+  if (isset($HTTP_GET_VARS['cPath'])) {
+    $cPath = $HTTP_GET_VARS['cPath'];
+  } else {
+    $cPath = '';
+  }
+
+  if (tep_not_null($cPath)) {
+    $cPath_array = tep_parse_category_path($cPath);
+    $cPath = implode('_', $cPath_array);
+    $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
+  } else {
+    $current_category_id = 0;
+  }
+
+// default open navigation box
+  if (!tep_session_is_registered('selected_box')) {
+    tep_session_register('selected_box');
+ //   $selected_box = 'configuration';
+  }
+ 
+  if (isset($HTTP_GET_VARS['selected_box'])) {
+    $selected_box = $HTTP_GET_VARS['selected_box'];
+  }
+
+  //Cache control system 
+//  include(DIR_WS_INCLUDES . 'cache_configure.php');
+  $cache_blocks = array(array('title' => TEXT_CACHE_COOLMENU, 'code' => 'coolmenu', 'file' => 'coolmenu-language.cache', 'multiple' => true),
+                        array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true),
+                        array('title' => TEXT_CACHE_CATEGORIES1, 'code' => 'categories1', 'file' => 'categories1_box-language.cache', 'multiple' => true),
+                        array('title' => TEXT_CACHE_CATEGORIES2, 'code' => 'categories2', 'file' => 'categories2_box-language.cache', 'multiple' => true),
+                        array('title' => TEXT_CACHE_CATEGORIES3, 'code' => 'categories3', 'file' => 'categories3_box-language.cache', 'multiple' => true),
+                        array('title' => TEXT_CACHE_CATEGORIES4, 'code' => 'categories4', 'file' => 'categories4_box-language.cache', 'multiple' => true),
+                        array('title' => TEXT_CACHE_CATEGORIES5, 'code' => 'categories5', 'file' => 'categories5_box-language.cache', 'multiple' => true),
+                        array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-TEMPLATE_NAME.language.cache', 'multiple' => true),
+                        array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true));
+
+
+//Admin begin
+  if (basename($PHP_SELF) != FILENAME_LOGIN && basename($PHP_SELF) != FILENAME_PASSWORD_FORGOTTEN) {
+    tep_admin_check_login();
+  }
+//Admin end
+// Include OSC-AFFILIATE
+ require('includes/affiliate_application_top.php');
+// include giftvoucher
+ REQUIRE(DIR_WS_INCLUDES . 'add_ccgvdc_application_top.php');
+
+// WebMakers.com Added: Includes Functions for Attribute Sorter and Copier
+require(DIR_WS_FUNCTIONS . 'attributes_sorter_added_functions.php');
+
+
+// Article Manager additions DMG
+
+// include the articles functions
+  require(DIR_WS_FUNCTIONS . 'articles.php');
+
+// Article Manager
+  if (isset($HTTP_GET_VARS['tPath'])) {
+    $tPath = $HTTP_GET_VARS['tPath'];
+  } else {
+    $tPath = '';
+  }
+
+  if (tep_not_null($tPath)) {
+    $tPath_array = tep_parse_topic_path($tPath);
+    $tPath = implode('_', $tPath_array);
+    $current_topic_id = $tPath_array[(sizeof($tPath_array)-1)];
+  } else {
+    $current_topic_id = 0;
+  }
+
+
+if (file_exists('includes/application_top_newsdesk.php'))
+        include('includes/application_top_newsdesk.php');
+
+if (file_exists('includes/application_top_faqdesk.php'))
+        include('includes/application_top_faqdesk.php');
+
+  
+?>

Added: trunk/direct.openmoko.com/admin/includes/attributes_display.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/attributes_display.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/attributes_display.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,425 @@
+<?php
+/*
+  /includes/attributes_display.php
+
+  Shoppe Enhancement Controller - Copyright (c) 2003 WebMakers.com
+  Linda McGrath - osCommerce at WebMakers.com
+*/
+/////////////////////////////////////////////////////////////////////////////
+// BOF: ATTRIBUTES //////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+?>
+<?php
+if (false) { // for testing
+echo '<br>' . ' int ' . $products_id;
+echo '<br>' . ' $products_id ' . $products_id;
+echo '<br>' . ' look_it_up ' . $look_it_up;
+echo '<br>' . ' PRODUCTS_OPTIONS_SORT_ORDER ' . PRODUCTS_OPTIONS_SORT_ORDER;
+echo '<br>' . ' $languages_id ' . $languages_id;
+}
+
+//    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $products_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'");
+    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $products_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'");
+    $products_attributes = tep_db_fetch_array($products_attributes_query);
+    if ($products_attributes['total'] > 0) {
+      echo '<b>' . TEXT_PRODUCT_OPTIONS . '</b><br>' .
+           '<table border="0" cellpadding="0" cellspacing="0">';
+// WebMakers.com Added: sort order
+      if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
+        $options_order_by= ' order by LPAD(popt.products_options_sort_order,11,"0")';
+      } else {
+        $options_order_by= ' order by popt.products_options_name';
+      }
+
+      $one_time_attributes_note='false';
+      $attributes_qty_prices_onetime_counter=0;
+
+      // dogu 2003-02-28 update query to pull option_type
+      // clr 2003-03-15 add order by statement to query
+      // "' order by popt.products_options_id"
+
+      $new_fields_attributes_text= ", popt.products_options_type, popt.products_options_length, popt.products_options_comment, popt.products_options_size";
+      $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name" . $new_fields_attributes_text . " from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $products_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'" . $options_order_by);
+      while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
+//dogu 2003-02-28 BEGIN Add if statement to check product option type.  If add more option types, then change this to a case statement.
+
+// BOF: prepare info on attributes with Text
+        if ($products_options_name['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT) {
+          $new_fields=', patrib.products_options_sort_order, patrib.attributes_price_onetime, patrib.attributes_display_only, patrib.product_attribute_is_free, patrib.products_attributes_weight, patrib.products_attributes_weight_prefix, patrib.attributes_default, patrib.attributes_qty_prices_onetime, patrib.attributes_discounted, patrib.attributes_price_factor, patrib.attributes_price_factor_offset';
+          $new_fields_weight=', patrib.products_attributes_weight_prefix, patrib.products_attributes_weight ';
+          $products_options_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix" . $new_fields . $new_fields_weight . " from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $products_id . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
+          $products_options = tep_db_fetch_array($products_options_query);
+
+          $show_details='';
+          $show_weight='';
+          $show_free='';
+
+// old          $show_attributes_price = $products_options['options_values_price'] + (tep_get_products_price_quantity_discount_price($product_info['products_id'],1,false,true) * (($products_options['attributes_price_factor'] - $products_options['attributes_price_factor_offset'])) );
+          $the_products_price = tep_get_products_price(tep_get_prid($products_id),true);
+          $show_attributes_price= ($products_options['options_values_price'] + tep_get_attributes_price_factor($the_products_price, tep_get_products_special_price($product_info['products_id']), $products_options['attributes_price_factor'], $products_options['attributes_price_factor_offset']));
+
+          if (!empty($products_options['attributes_qty_prices_onetime'])) {
+            $attributes_qty_prices_onetime_counter++;
+          }
+
+          if ($products_options['attributes_price_onetime'] !=0 ) {
+            $one_time_attributes_note='true';
+          }
+
+// mark free attributes
+          if ($products_options['product_attribute_is_free']=='1') {
+            $show_free=' - FREE';
+          }
+
+// show weight
+          if ($products_options['products_attributes_weight']!=0) {
+            // show attribute weight on dropdown
+            if (SHOW_PRODUCT_INFO_ATTRIBUTES_WEIGHT=='1') {
+              if ($products_options['products_attributes_weight']) {
+                $show_weight=' (' . $products_options['products_attributes_weight_prefix'] . round($products_options['products_attributes_weight'],2) . PRODUCTS_WEIGHT_UNITS_TEXT . ')';
+              }
+            }
+          }
+
+// prices on everything except display only
+//          if ($products_options['attributes_price_onetime'] != '0') {
+          if ($products_options['options_values_price'] != '0' or $products_options['attributes_price_onetime'] != 0) {
+            $show_details = '(';
+            $show_details .= ($show_attributes_price !=0 ? $products_options['price_prefix'] . $currencies->display_price($show_attributes_price, tep_get_tax_rate($product_info['products_tax_class_id'])) : '');
+            $show_details .= ( ($products_options['attributes_price_onetime']) !=0 ? ' *' . $currencies->display_price( ($products_options['attributes_price_onetime']), tep_get_tax_rate($product_info['products_tax_class_id']) ) : '');
+            $show_details .= ')&nbsp';
+          }
+
+          $show_details .= $show_weight . $show_free;
+        } // EOF: TEXT attribute preparation
+// EOF: prepare info on attribute with Text
+
+// show in infobox or text
+        switch (true) {
+// show in infoboxes
+        case ($products_options_name['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT and SHOW_ATTRIBUTES_OPTION_TEXT_INFOBOX=='1'):
+          // dogu 2003-02-28 add query to pull attribute price and price_prefix
+?>
+        <table border="1" width="100%"><tr><td>
+          <tr>
+            <td colspan="2" valign="top">
+<?php
+          // dogu 2003-02-28 add query to pull attribute price and price_prefix
+          echo '<tr><td class="main" valign="top">' . $products_options_name['products_options_name'] . '&nbsp;</td>';
+          switch (true) {
+          // show price and weight details
+            case ($show_details):
+              echo '<td class="main" valign="top">' . '&nbsp;' . $show_details . '</td></tr>';
+              echo '<tr><td>&nbsp;</td><td class="main" valign="top">';
+              echo ($products_options_name['products_options_comment'] ? $products_options_name['products_options_comment'] . '<br>' : '');
+              echo '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_size'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="">';
+              break;
+          // no price and weight details
+            default:
+              echo '<td class="main" valign="top">';
+              echo ($products_options_name['products_options_comment'] ? $products_options_name['products_options_comment'] . '<br>' : '');
+              echo '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_size'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="">';
+              echo '</td>';
+              break;
+          }
+          echo '</td></tr>';
+?>
+            </td>
+          </tr>
+        </td></tr></table>
+
+<?php
+          break;
+
+// show as text no infobox
+        case ($products_options_name['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT):
+          // dogu 2003-02-28 add query to pull attribute price and price_prefix
+            echo '<tr><td colspan="2" valign="top">' . tep_draw_separator('pixel_trans.gif', '100%', '2'). '</td></tr>';
+          echo '<tr><td class="main" valign="top">' . $products_options_name['products_options_name'] . '&nbsp;</td>';
+          switch (true) {
+          // show price and weight details
+            case ($show_details):
+              echo '<td class="main" valign="top">' . '&nbsp;' . $show_details . '</td></tr>';
+              echo '<tr><td>&nbsp;</td><td class="main" valign="top">';
+              echo ($products_options_name['products_options_comment'] ? $products_options_name['products_options_comment'] . '<br>' : '');
+              echo '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_size'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="">';
+              break;
+          // no price and weight details
+            default:
+              echo '<td class="main" valign="top">';
+              echo ($products_options_name['products_options_comment'] ? $products_options_name['products_options_comment'] . '<br>' : '');
+              echo '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_size'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="">';
+              break;
+          }
+          echo '</td></tr>';
+          echo '<tr><td colspan="2" valign="top">' . tep_draw_separator('pixel_trans.gif', '100%', '2'). '</td></tr>';
+
+          break;
+//dogu 2003-02-28 END CASE statement to check product option type TEXT.
+////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////
+// radio buttons
+          case ($products_options_name['products_options_type'] == PRODUCTS_OPTIONS_TYPE_RADIO):
+            //CLR 2003-03-18 Add logic for radio buttons
+            echo '<tr><td class="main" valign="top">' . $products_options_name['products_options_name'] . ':&nbsp;</td><td class="main" valign="top">';
+// WebMakers.com Added: Attributes Sorter and Quantity Discounts
+            $new_fields=', pa.products_options_sort_order, pa.attributes_price_onetime, pa.attributes_display_only, pa.product_attribute_is_free, pa.products_attributes_weight, pa.products_attributes_weight_prefix, pa.attributes_default, pa.attributes_qty_prices_onetime, pa.attributes_discounted, pa.attributes_price_factor, pa.attributes_price_factor_offset';
+            $new_fields_weight=', pa.products_attributes_weight_prefix, pa.products_attributes_weight ';
+            if ( PRODUCTS_OPTIONS_SORT_BY_PRICE =='1' ) {
+              $order_by= ' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name';
+            } else {
+              $order_by= ' order by LPAD(pa.products_options_sort_order,11,"0"), pa.options_values_price';
+            }
+            $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix" . $new_fields . $new_fields_weight . " from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $products_id . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . $order_by);
+            $count_it = tep_db_num_rows($products_options_query);
+            while ($products_options = tep_db_fetch_array($products_options_query)) {
+              $show_details='';
+              $show_weight='';
+              $show_free='';
+
+          $the_products_price = tep_get_products_price(tep_get_prid($products_id),true);
+          $show_attributes_price= ($products_options['options_values_price'] + tep_get_attributes_price_factor($the_products_price, tep_get_products_special_price($product_info['products_id']), $products_options['attributes_price_factor'], $products_options['attributes_price_factor_offset']));
+
+// fix here
+              if (!empty($products_options['attributes_qty_prices_onetime'])) {
+                $attributes_qty_prices_onetime_counter++;
+              }
+
+              if ($products_options['attributes_price_onetime'] !=0 ) {
+                $one_time_attributes_note='true';
+              }
+
+// mark free attributes
+              if ($products_options['product_attribute_is_free']=='1') {
+                $show_free=' - FREE';
+              }
+// show weight
+              if ($products_options['products_attributes_weight']!=0) {
+// BOF: WebMakers.com Added: Shoppe Enhancement Controller
+            // show attribute weight on dropdown
+                if (SHOW_PRODUCT_INFO_ATTRIBUTES_WEIGHT=='1') {
+                  if ($products_options['products_attributes_weight']) {
+                    $show_weight=' (' . $products_options['products_attributes_weight_prefix'] . round($products_options['products_attributes_weight'],2) . PRODUCTS_WEIGHT_UNITS_TEXT . ')';
+                  }
+                }
+              }
+
+              if ($products_options['options_values_price'] != '0' or $products_options['attributes_price_onetime'] != 0) {
+                $show_details = '(';
+                $show_details .= ($show_attributes_price !=0 ? $products_options['price_prefix'] . $currencies->display_price($show_attributes_price, tep_get_tax_rate($product_info['products_tax_class_id'])) : '');
+                $show_details .= ( ($products_options['attributes_price_onetime']) !=0 ? ' *' . $currencies->display_price( ($products_options['attributes_price_onetime']), tep_get_tax_rate($product_info['products_tax_class_id']) ) : '');
+                $show_details .= ')&nbsp';
+              }
+              $show_details .= $show_weight . $show_free;
+
+                if ($count_it==1) {
+                  echo tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options['products_options_values_id'], true );
+                } else {
+                  echo tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options['products_options_values_id'], ($products_options['attributes_default']=='1' ? true : false) );
+                }
+
+              echo $products_options['products_options_values_name'] . '&nbsp;' . $show_details;
+              echo '<br>';
+            }
+            echo '</td></tr>';
+            echo '<tr><td colspan="2" valign="top">' . tep_draw_separator('pixel_trans.gif', '100%', '2'). '</td></tr>';
+            break;
+
+////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////
+// Normal Attributes without Text
+        default:
+          $selected = 0;
+          $products_options_array = array();
+// WebMakers.com Added: Attributes Sorter and Quantity Discounts
+          $new_fields=', pa.products_options_sort_order, pa.attributes_price_onetime, pa.attributes_display_only, pa.product_attribute_is_free, pa.products_attributes_weight, pa.products_attributes_weight_prefix, pa.attributes_default, pa.attributes_qty_prices_onetime, pa.attributes_discounted, pa.attributes_price_factor, pa.attributes_price_factor_offset';
+          $new_fields_weight=', pa.products_attributes_weight_prefix, pa.products_attributes_weight ';
+          if ( PRODUCTS_OPTIONS_SORT_BY_PRICE =='1' ) {
+            $order_by= ' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name';
+          } else {
+            $order_by= ' order by LPAD(pa.products_options_sort_order,11,"0"), pa.options_values_price';
+          }
+          $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix" . $new_fields . $new_fields_weight . " from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $products_id . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . $order_by);
+          $count_it = tep_db_num_rows($products_options_query);
+          if ($count_it==1) {
+            echo '<tr><td class="main" valign="top">' . $products_options_name['products_options_name'] . ':&nbsp;</td><td class="main" valign="top">';
+            while ($products_options = tep_db_fetch_array($products_options_query)) {
+
+              $show_details='';
+              $show_weight='';
+              $show_free='';
+
+          $the_products_price = tep_get_products_price(tep_get_prid($products_id),true);
+          $show_attributes_price= ($products_options['options_values_price'] + tep_get_attributes_price_factor($the_products_price, tep_get_products_special_price($product_info['products_id']), $products_options['attributes_price_factor'], $products_options['attributes_price_factor_offset']));
+
+              if (!empty($products_options['attributes_qty_prices_onetime'])) {
+                $attributes_qty_prices_onetime_counter++;
+              }
+
+              if ($products_options['attributes_price_onetime'] !=0 ) {
+                $one_time_attributes_note='true';
+              }
+
+// mark free attributes
+              if ($products_options['product_attribute_is_free']=='1') {
+                $show_free=' - FREE';
+              }
+
+// show weight
+              if ($products_options['products_attributes_weight']!=0) {
+                if (SHOW_PRODUCT_INFO_ATTRIBUTES_WEIGHT=='1') {
+                  if ($products_options['products_attributes_weight']) {
+                    $show_weight=' (' . $products_options['products_attributes_weight_prefix'] . round($products_options['products_attributes_weight'],2) . PRODUCTS_WEIGHT_UNITS_TEXT . ')';
+                  }
+                }
+              }
+
+              if ($products_options['options_values_price'] != '0' or $products_options['attributes_price_onetime'] != 0) {
+                $show_details = '(';
+                $show_details .= ($show_attributes_price !=0 ? $products_options['price_prefix'] . $currencies->display_price($show_attributes_price, tep_get_tax_rate($product_info['products_tax_class_id'])) : '');
+                $show_details .= ( ($products_options['attributes_price_onetime']) !=0 ? ' *' . $currencies->display_price( ($products_options['attributes_price_onetime']), tep_get_tax_rate($product_info['products_tax_class_id']) ) : '');
+                $show_details .= ')&nbsp';
+              }
+              $show_details .= $show_weight . $show_free;
+
+              echo tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options['products_options_values_id'], true );
+
+              echo $products_options['products_options_values_name'] . '&nbsp;' . $show_details;
+              echo '<br>';
+            } // EOF: while options
+/////////////////////////////////////////////////////////////////////////////////
+          } else { // count > 1
+            echo '<tr><td class="main" valign="top">' . $products_options_name['products_options_name'] . ':&nbsp;</td><td valign="top">' . "\n";
+            while ($products_options = tep_db_fetch_array($products_options_query)) {
+// WebMakers.com Added: Attributes Sorter and Quantity Discounts - one time attributes
+              if (!empty($products_options['attributes_qty_prices_onetime'])) {
+                $attributes_qty_prices_onetime_counter++;
+              }
+
+              if ($products_options['attributes_price_onetime'] !=0 ) {
+                $one_time_attributes_note='true';
+              }
+
+          $the_products_price = tep_get_products_price(tep_get_prid($products_id),true);
+          $show_attributes_price= ($products_options['options_values_price'] + tep_get_attributes_price_factor($the_products_price, tep_get_products_special_price($product_info['products_id']), $products_options['attributes_price_factor'], $products_options['attributes_price_factor_offset']));
+
+              $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
+
+              if ($show_attributes_price != 0 or $products_options['attributes_price_onetime'] != 0) {
+                  $products_options_array[sizeof($products_options_array)-1]['text'] .=
+                  ' (' .
+                  ($show_attributes_price !=0 ? $products_options['price_prefix'] . $currencies->display_price($show_attributes_price, tep_get_tax_rate($product_info['products_tax_class_id'])) : '') .
+                  ( ($products_options['attributes_price_onetime']) !=0 ? ' *' . $currencies->display_price( ($products_options['attributes_price_onetime']), tep_get_tax_rate($product_info['products_tax_class_id'])) : '') .
+                  ')';
+              }
+// mark free attributes
+              if ($products_options['product_attribute_is_free']=='1') {
+                $products_options_array[sizeof($products_options_array)-1]['text'].=' - FREE';
+              }
+
+// show weight
+              if ($products_options['products_attributes_weight']!=0) {
+                if (SHOW_PRODUCT_INFO_ATTRIBUTES_WEIGHT=='1') {
+                  if (!$products_options['products_attributes_weight']) {
+                    $show_weight='';
+                  } else {
+                    $show_weight=' (' . $products_options['products_attributes_weight_prefix'] . round($products_options['products_attributes_weight'],2) . PRODUCTS_WEIGHT_UNITS_TEXT . ')';
+                  }
+                  $products_options_array[sizeof($products_options_array)-1]['text'].= $show_weight;
+                }
+              }
+
+// find default attribute if set to default
+              if ($products_options['attributes_default']=='1') {
+                $selected_dropdown=$products_options['products_options_values_id'];
+              }
+            }
+
+// default attribute based on attributes_default
+              echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_dropdown );
+          } // if count
+          echo '</td></tr>';
+          break;
+////////////////////////////////////////////////////////////////////
+        } // end case
+
+
+// BOF: WebMakers.com Added: Include separate spacing for between attributes
+        if ($products_options_name['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT and SHOW_SPACE_TEXT_ATTRIBUTES > 0) {
+          echo '<tr><td colspan="2" valign="top">' . tep_draw_separator('pixel_trans.gif', '100%', SHOW_SPACE_TEXT_ATTRIBUTES) . '</td></tr>';
+        }
+        if ($products_options_name['products_options_type'] != PRODUCTS_OPTIONS_TYPE_TEXT and SHOW_SPACE_NORMAL_ATTRIBUTES > 0) {
+          echo '<tr><td colspan="2" valign="top">' . tep_draw_separator('pixel_trans.gif', '100%', SHOW_SPACE_NORMAL_ATTRIBUTES) . '</td></tr>';
+        }
+// EOF: WebMakers.com Added: Include separate spacing for between attributes
+
+// dogu 2003-02-28 insert closing bracket due to if statement
+      } // if attribute count
+
+      echo '</table>';
+?>
+
+<?php
+// BOF: WebMakers.com Added: If Attributes prices, note price discounts based on attributes_price_onetime
+if ($one_time_attributes_note=='true') {
+?>
+      <tr>
+        <td class="main" valign="top"><?php echo ONE_TIME_CHARGES_APPLY; ?></td>
+      </tr>
+<?php
+}
+?>
+
+<?php
+////////////////////////////////////////////////////////////////////////
+// BOF: WebMakers.com Added: Attributes Qty:Prices Ontime Charges Table
+// if ($products_options['attributes_qty_prices_onetime'] !=0 or $products_options_array['attributes_qty_prices_onetime'] !=0) {
+if ($attributes_qty_prices_onetime_counter != 0) {
+  if (SHOW_ATTRIBUTES_QTY_PRICES_ONETIME_TABLE=='0') {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td colspan="2"><table border="2" cellpadding="2" cellspacing="2">
+          <tr>
+            <td align="center" class="main"><a href="<?php echo 'attributes_qty_prices_table_popup.php?products_id=' . $products_id . '&tax=' . tep_get_tax_rate($product_info['products_tax_class_id']); ?>" onclick="NewWindow(this.href,'name','600','500','yes');return false;"><?php echo tep_image(DIR_WS_IMAGES . SHOW_ATTRIBUTES_QTY_PRICES_ONETIME_IMAGE,ATTRIBUTES_QTY_PRICE_ONETIME_TITLE); ?><br><?php echo '&nbsp;' . ATTRIBUTES_QTY_PRICE_ONETIME_TITLE . '&nbsp;'; ?></a></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  } else {
+    require(DIR_WS_INCLUDES . 'attributes_qty_prices_table.php');
+  }
+}
+// EOF: WebMakers.com Added: Attributes Qty:Prices Ontime Charges Table
+////////////////////////////////////////////////////////////////////////
+?>
+
+<?php
+// BOF: WebMakers.com Added: If Attributes prices, note price discounts
+?>
+<?php
+if ($product_info['products_priced_by_attribute']=='1' and tep_get_products_price_quantity_discount_on($product_info['products_id'])) {
+?>
+      <tr>
+        <td class="main"><!-- **Discounts may vary based on selected options --><?php echo ATTRIBUTES_DISPLAY_MSG;?></td>
+      </tr>
+<?php
+}
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+
+<?php
+// EOF: WebMakers.com Added: If Attributes prices, note price discounts
+    } // attributes > 0
+?>
+
+<?php
+/////////////////////////////////////////////////////////////////////////////
+// BOF: ATTRIBUTES //////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////
+?>

Added: trunk/direct.openmoko.com/admin/includes/boxes/administrator.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/administrator.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/administrator.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+  
+  Chain Reaction Works, Inc
+  Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 707 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- catalog //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_ADMINISTRATOR,
+                     'link'  => tep_href_link(FILENAME_ADMIN_MEMBERS, tep_get_all_get_params(array('selected_box')) . 'selected_box=administrator'));
+
+  if ($selected_box == 'administrator' || $menu_dhtml == true) {
+    $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_ADMIN_MEMBERS, BOX_ADMINISTRATOR_MEMBERS, 'NONSSL') .
+                                   tep_admin_files_boxes(FILENAME_ADMIN_MEMBERS, BOX_ADMINISTRATOR_GROUPS,'NONSSL','gID=groups') .
+                                   tep_admin_files_boxes(FILENAME_ADMIN_ACCOUNT, BOX_ADMINISTRATOR_ACCOUNT_UPDATE, 'NONSSL') .
+                                   tep_admin_files_boxes(FILENAME_ADMIN_FILES, BOX_ADMINISTRATOR_BOXES, 'NONSSL'));
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- catalog_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/affiliate.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: affiliate.php,v 1.1.1.1 2004/03/04 23:39:43 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc
+  Copyright (c) 2006
+  
+  Last Modified by : $Author$
+  Last Modified on : $Date$
+  Latest Revision :  $Revision: 2468 $
+*/
+?>
+<!-- affiliates //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_AFFILIATE,
+                             'link'  => tep_href_link(FILENAME_AFFILIATE_SUMMARY, 'selected_box=affiliate'));
+
+  if ($selected_box == 'affiliate' || $menu_dhtml == true) {
+    $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_AFFILIATE_SUMMARY,BOX_AFFILIATE_SUMMARY) .
+                                   tep_admin_files_boxes(FILENAME_AFFILIATE,BOX_AFFILIATE)  .
+                                   tep_admin_files_boxes(FILENAME_AFFILIATE_PAYMENT,BOX_AFFILIATE_PAYMENT, 'SSL') .
+                                   tep_admin_files_boxes(FILENAME_AFFILIATE_SALES,BOX_AFFILIATE_SALES)  .
+                                   tep_admin_files_boxes(FILENAME_AFFILIATE_CLICKS,BOX_AFFILIATE_CLICKS) .
+                                   tep_admin_files_boxes(FILENAME_AFFILIATE_BANNER_MANAGER,BOX_AFFILIATE_BANNERS)  .
+                                   tep_admin_files_boxes(FILENAME_AFFILIATE_NEWS,BOX_AFFILIATE_NEWS)  .
+                                   tep_admin_files_boxes(FILENAME_AFFILIATE_NEWSLETTERS,BOX_AFFILIATE_NEWSLETTER_MANAGER) .
+                                   tep_admin_files_boxes(FILENAME_AFFILIATE_CONTACT,BOX_AFFILIATE_CONTACT));
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- affiliates_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/articles.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+  
+  Chain Reaction Works, Inc
+  Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 707 $
+
+  Released under the GNU General Public License
+*/
+
+?>
+<!-- articles //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_ARTICLES,
+                     'link'  => tep_href_link(FILENAME_ARTICLES, 'selected_box=articles'));
+
+  if ($selected_box == 'articles' || $menu_dhtml == true) {
+      $contents[] = array('text' => tep_admin_files_boxes(FILENAME_ARTICLES,  BOX_TOPICS_ARTICLES)  .
+                                    tep_admin_files_boxes(FILENAME_ARTICLES_CONFIG,  BOX_ARTICLES_CONFIG)  .
+                                    tep_admin_files_boxes(FILENAME_AUTHORS, BOX_ARTICLES_AUTHORS)  .
+                                    tep_admin_files_boxes(FILENAME_ARTICLE_REVIEWS,  BOX_ARTICLES_REVIEWS)  .
+                                    tep_admin_files_boxes(FILENAME_ARTICLES_XSELL,  BOX_ARTICLES_XSELL));
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- articles_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/boxes/catalog.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/catalog.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/catalog.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Chain Reaction Works, Inc
+  Copyright (c) 2005 - 2006 Chain Reaction Works, Inc.
+
+  Last Modified By : $Author:$
+  Last Modified On : $Date:$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- catalog //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_CATALOG,
+                     'link'  => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'));
+
+  if ($selected_box == 'catalog' || $menu_dhtml == true) {
+    $contents[] = array('text'  =>
+                                   tep_admin_files_boxes(FILENAME_CATEGORIES, BOX_CATALOG_CATEGORIES_PRODUCTS) .
+                                   tep_admin_files_boxes(FILENAME_PRODUCTS_ATTRIBUTES, BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES) .
+                       tep_admin_files_boxes(FILENAME_PRODUCTS_CATEGORY_OPTIONS, BOX_CATALOG_CATEGORIES_PRODUCTS_CATEGORY_OPTIONS) .
+                                   tep_admin_files_boxes(FILENAME_MANUFACTURERS, BOX_CATALOG_MANUFACTURERS) .
+                                   tep_admin_files_boxes(FILENAME_REVIEWS, BOX_CATALOG_REVIEWS) .
+                                   tep_admin_files_boxes(FILENAME_SHOPBYPRICE, BOX_CATALOG_SHOP_BY_PRICE) .
+                       tep_admin_files_boxes(FILENAME_XSELL_PRODUCTS, BOX_CATALOG_XSELL_PRODUCTS) .
+                                   tep_admin_files_boxes(FILENAME_FEATURED, BOX_CATALOG_FEATURED) .
+                                   tep_admin_files_boxes(FILENAME_PRODUCTS_EXPECTED, BOX_CATALOG_PRODUCTS_EXPECTED).
+                       tep_admin_files_boxes(FILENAME_PRODUCTS_EXTRA_FIELDS,BOX_CATALOG_PRODUCTS_EXTRA_FIELDS));
+//Admin end
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- catalog_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: configuration.php,v 1.1.1.1 2004/03/04 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+       
+       Chain Reaction Works, Inc
+  Copyright (c) 2005 - 2006 Chain Reaction Works, Inc.
+
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- configuration //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_CONFIGURATION,
+                     'link'  => tep_href_link(FILENAME_CONFIGURATION, 'gID=1&selected_box=configuration'));
+
+  if ($selected_box == 'configuration' || $menu_dhtml == true) {
+    $cfg_groups = '';
+    $configuration_groups_query = tep_db_query("select configuration_group_id as cgID, configuration_group_title as cgTitle from " . TABLE_CONFIGURATION_GROUP . " where visible = '1' order by sort_order");
+    while ($configuration_groups = tep_db_fetch_array($configuration_groups_query)) { 
+      $cfg_groups .=  tep_admin_files_boxes(FILENAME_CONFIGURATION,  $configuration_groups['cgTitle'], 'NONSSL', 'gID=' . $configuration_groups['cgID'] );
+    }
+
+    $contents[] = array('text'  => $cfg_groups);
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- configuration_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/crypt.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/crypt.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/crypt.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: crypt.php,v 1.1.1.1 2004/03/04 23:39:43  $
+
+  Chain Reaction Works, Inc.
+  Copyright &copy; 2005-2006 
+  
+  Last Modified By : $Author: Author $
+  Last Modifed On :  $Date: LastChangeDate$
+  Latest Revision :  $Revision: 2308 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- customers //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_CRYPT,
+                     'link'  => tep_href_link(FILENAME_CRYPT, 'selected_box=crypt'));
+
+  if ($selected_box == 'crypt' || $menu_dhtml == true) {
+    $contents[] = array('text'  =>
+//Admin begin
+                                   tep_admin_files_boxes(FILENAME_CRYPT, BOX_CRYPT_CONFIGURATION, 'SSL') .
+                                   tep_admin_files_boxes(FILENAME_EDIT_KEY, BOX_CRYPT_KEYS, 'SSL') . 
+                                   tep_admin_files_boxes('', BOX_CRYPT_CC_DATA) . 
+                                   '&nbsp;&nbsp;' . tep_admin_files_boxes(FILENAME_CRYPT_UPDATE, BOX_CRYPT_UPDATE, 'SSL') .
+                               // '&nbsp;&nbsp;' . tep_admin_files_boxes(FILENAME_CRYPT_CONVERT, BOX_CRYPT_CONVERT, 'SSL') .
+                                   '&nbsp;&nbsp;' . tep_admin_files_boxes(FILENAME_CRYPT_PURGE, BOX_CRYPT_PURGE, 'SSL') .
+                                   tep_admin_files_boxes(FILENAME_EDIT_KEY_HELP, BOX_CRYPT_HELP) .
+                                   tep_admin_files_boxes(FILENAME_CRYPT_TEST, BOX_CRYPT_TEST, 'SSL'));
+
+
+//Admin end
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- customers_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Chain Reaction Works, Inc
+  Copyright (c) 2005 - 2006 Chain Reaction Works, Inc.
+
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 774 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- customers //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_CUSTOMERS,
+                     'link'  => tep_href_link(FILENAME_ORDERS, 'selected_box=customers', 'SSL'));
+
+ if ($selected_box == 'customers' || $menu_dhtml == true) {
+    $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_ORDERS, BOX_CUSTOMERS_ORDERS, 'SSL') .
+                                   tep_admin_files_boxes(FILENAME_CREATE_ORDER, BOX_MANUAL_ORDER_CREATE_ORDER, 'SSL') .
+                                   tep_admin_files_boxes(FILENAME_CREATE_ORDERS_ADMIN, BOX_CREATE_ORDERS_ADMIN, 'SSL') .
+                                   tep_admin_files_boxes(FILENAME_PAYPAL, BOX_CUSTOMERS_PAYPAL, 'SSL') .
+                                   tep_admin_files_boxes('', BOX_CUSTOMERS_MENU).
+           tep_admin_files_boxes(FILENAME_CUSTOMERS, BOX_CUSTOMERS_CUSTOMERS, 'SSL') .
+           tep_admin_files_boxes(FILENAME_CUSTOMERS_GROUPS, BOX_CUSTOMERS_GROUPS, 'SSL') .
+                                   tep_admin_files_boxes(FILENAME_CREATE_ACCOUNT, BOX_MANUAL_ORDER_CREATE_ACCOUNT, 'SSL' ) .
+                                   tep_admin_files_boxes(FILENAME_SHIPWIRE, BOX_SHIPWIRE)
+);
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- customers_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/data.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/data.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/data.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+/*
+  $Id: data.php,v 1.1.1.1 2004/03/04 23:39:43 zip1 Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+  
+  Chain Reaction Works, Inc
+  Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- data //-->
+          <tr>
+            <td>
+<?php
+//Note: this file uses a modified function tep_admin_files_boxes to that you canhave a title and subtitle with offseet.
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_DATA,
+                     'link'  => tep_href_link(FILENAME_DATA, 'selected_box=data'));
+
+  if ($selected_box == 'data' || $menu_dhtml == true) {
+    $contents[] = array('text'  =>
+                                   tep_admin_files_boxes('', BOX_DATA_EASYPOPULATE) .
+                                   tep_admin_files_boxes(FILENAME_EASYPOPULATE_EXPORT, BOX_DATA_EASYPOPULATE_EXPORT, 'NONSSL' , '', '2') .
+                                   tep_admin_files_boxes(FILENAME_EASYPOPULATE_IMPORT, BOX_DATA_EASYPOPULATE_IMPORT, 'NONSSL' , '', '2') .
+                                  
+                                   tep_admin_files_boxes('', BOX_DATA_EASYPOPULATE_BASIC) .
+                                   tep_admin_files_boxes(FILENAME_EASYPOPULATE_BASIC_EXPORT, BOX_DATA_EASYPOPULATE_BASIC_EXPORT, 'NONSSL' , '', '2') .
+                                   tep_admin_files_boxes(FILENAME_EASYPOPULATE_BASIC_IMPORT, BOX_DATA_EASYPOPULATE_BASIC_IMPORT, 'NONSSL' , '', '2') .
+                                   
+                                   tep_admin_files_boxes('', BOX_DATA) . 
+                                 //  tep_admin_files_boxes(FILENAME_BIZRATE_ADMIN, BOX_FEEDERS_BIZRATE, 'NONSSL' , '', '2') .
+                                   tep_admin_files_boxes(FILENAME_FROOGLE_ADMIN, BOX_FEEDERS_FROOGLE, 'NONSSL' , '', '2') .
+                                  // tep_admin_files_boxes(FILENAME_YAHOO_ADMIN, BOX_FEEDERS_YAHOO, 'NONSSL' , '', '2') .
+                                   tep_admin_files_boxes(FILENAME_DATA, BOX_DATA_HELP) );
+
+//Admin end
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- data_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/design_controls.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/design_controls.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/design_controls.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,64 @@
+<?php
+/*
+  $Id: design_controls.php,v 1.1.1.1 2004/03/04 23:39:43 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chainreaction Works, Inc
+  Copyright &copy; 2005 Chainreaction Works, Inc
+  
+  Last Modifed by : $Author$
+  Last Modified on : $Date$
+  Latest Revision : $Revision: 2482 $
+*/
+?>
+<!-- Design Controls //-->
+          <tr>
+            <td>
+<?php
+
+$template_id_select_query = tep_db_query("select template_id from " . TABLE_TEMPLATE . "  where template_name = '" . DEFAULT_TEMPLATE . "'");
+$template_id_select =  tep_db_fetch_array($template_id_select_query);
+
+if (MENU_DHTML != 'True') {
+$default_temp_link = '&amp;cID=' . $template_id_select[template_id];
+}
+
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_DESIGN_CONTROLS,
+                   'link'  => tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'selected_box=design_controls' . $default_temp_link));
+
+  if ($selected_box == 'design_controls' || $menu_dhtml == true) {
+    $contents[] = array('text'  =>  tep_admin_files_boxes('',BOX_HEADING_TEMPLATE_HEADER_TAGS ) .
+                                    tep_admin_files_boxes(FILENAME_HEADER_TAGS_CONTROLLER, BOX_HEADER_TAGS_ADD_A_PAGE, 'NONSSL' , '', '2' ) .
+                                    tep_admin_files_boxes(FILENAME_HEADER_TAGS_ENGLISH, BOX_HEADER_TAGS_ENGLISH, 'NONSSL' , '', '2' ).
+                                    tep_admin_files_boxes(FILENAME_HEADER_TAGS_FILL_TAGS,  BOX_HEADER_TAGS_FILL_TAGS, 'NONSSL' , '', '2') .
+                                    //Template Admin
+                                    tep_admin_files_boxes('', BOX_HEADING_DESIGN_TEMPLATE) .
+                                    tep_admin_files_boxes(FILENAME_TEMPLATE_ADMIN, BOX_HEADING_TEMPLATE_MANAGEMENT , 'NONSSL' , '', '2') .
+                                    tep_admin_files_boxes(FILENAME_TEMPLATE_CONFIGURATION, BOX_HEADING_TEMPLATE_CONFIGURATION, 'NONSSL' ,'cID=' . $template_id_select[template_id],'2') .
+                                    //Infobox Admin
+                                    tep_admin_files_boxes('', BOX_HEADING_DESIGN_INFOBOX) .
+                                  //  tep_admin_files_boxes(FILENAME_INFOBOX_ADMIN, BOX_HEADING_BOXES, 'NONSSL' , '', '2') .
+                                    tep_admin_files_boxes(FILENAME_INFOBOX_CONFIGURATION, BOX_HEADING_BOXES_ADMIN, 'NONSSL', 'gID=' . $template_id_select[template_id],'2') );
+                                  //  tep_admin_files_boxes(FILENAME_NAVMENU, BOX_TEMPLATE_NAVMENU, 'NONSSL' , '', '2') .
+                                  //  Layout Admin
+                                  //  tep_admin_files_boxes('', BOX_HEADING_DESIGN_LAYOUT) .
+                                  //  tep_admin_files_boxes(FILENAME_PRODUCT_LIST_ADMIN, BOX_HEADING_DESIGN_PRODUCT_LISTING, 'NONSSL' , '', '2')
+
+//Admin end
+  }
+
+   $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- design controls _eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/faq.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+  
+  Chain Reaction Works, Inc
+  Copyright &copy; 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 311 $
+*/
+?>
+<!-- faq //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_FAQ,
+                     'link'  => tep_href_link(FILENAME_FAQ_MANAGER, 'selected_box=faq'));
+
+  if ($selected_box == 'faq' || $menu_dhtml == true) {
+    $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_FAQ_MANAGER, BOX_FAQ_MANAGER) .
+                                   tep_admin_files_boxes(FILENAME_FAQ_CATEGORIES, BOX_FAQ_CATEGORIES) .
+                                   tep_admin_files_boxes(FILENAME_FAQ_VIEW, BOX_FAQ_VIEW) .
+                                   tep_admin_files_boxes(FILENAME_FAQ_VIEW_ALL,BOX_FAQ_VIEW_ALL));
+
+}
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- faq-eof //--->

Added: trunk/direct.openmoko.com/admin/includes/boxes/gv_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/gv_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/gv_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: gv_admin.php,v 1.1.1.1 2004/03/04 23:39:43 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+  
+  Chainreaction Works, Inc
+  Copyright &copy; 2003-2006  Chain Reaction Works, Inc
+  
+  Last Modified By : $Author$
+  Last Modified On : $LastChangedDate$
+  Latest Revision :  $Revision: 302 $
+  
+*/
+?>
+<!-- gv_admin //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_GV_ADMIN,
+                     'link'  => tep_href_link(FILENAME_COUPON_ADMIN, 'selected_box=gv_admin'));
+
+  if ($selected_box == 'gv_admin' || $menu_dhtml == true) {
+ $contents[] = array('text'  => 
+        tep_admin_files_boxes(FILENAME_COUPON_ADMIN , BOX_COUPON_ADMIN) .
+        tep_admin_files_boxes(FILENAME_GV_REPORT , BOX_GV_REPORT) .
+        tep_admin_files_boxes(FILENAME_GV_QUEUE , BOX_GV_ADMIN_QUEUE) .
+        tep_admin_files_boxes(FILENAME_GV_MAIL , BOX_GV_ADMIN_MAIL) .
+        tep_admin_files_boxes(FILENAME_GV_SENT , BOX_GV_ADMIN_SENT));
+ }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- gv_admin_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/header_tags_controller.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/header_tags_controller.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/header_tags_controller.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: header_tags_controller.php,v 1.00 2003/10/02 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  Copyright &copy; 2006
+  
+  Last Modified By : $Author$
+  Last Modified On : $Date$
+  Latest Revision  : $Revision$
+*/
+?>
+<!-- header_tags_controller //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_HEADER_TAGS_CONTROLLER,
+                     'link'  => tep_href_link(FILENAME_HEADER_TAGS_CONTROLLER, 'selected_box=header tags'));
+
+  if ($selected_box == 'header tags' || $menu_dhtml == true) {
+    $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_HEADER_TAGS_CONTROLLER, BOX_HEADER_TAGS_ADD_A_PAGE ) .
+                                   tep_admin_files_boxes(FILENAME_HEADER_TAGS_ENGLISH, BOX_HEADER_TAGS_ENGLISH ).
+                                   tep_admin_files_boxes(FILENAME_HEADER_TAGS_FILL_TAGS,  BOX_HEADER_TAGS_FILL_TAGS));
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- header_tags_controller_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/information.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+ 
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1186 $
+
+  Released under the GNU General Public License
+  */
+?>
+<!-- information //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_INFORMATION,
+                     'link'  => tep_href_link(FILENAME_PAGES_CATEGORIES, 'selected_box=information'));
+
+if ($selected_box == 'information' || $menu_dhtml == true) {
+  $contents[] = array('text'  =>  tep_admin_files_boxes('', BOX_HEADING_PAGE_MANAGER, '', '', '') . 
+          tep_admin_files_boxes(FILENAME_PAGES_CATEGORIES, BOX_PAGES_CATEGORIES, 'NONSSL', '', '2') .
+          tep_admin_files_boxes(FILENAME_PAGES, BOX_PAGES, 'NONSSL' , '', '1') . 
+          tep_admin_files_boxes('','FAQ System') .
+          tep_admin_files_boxes(FILENAME_FAQ_MANAGER, BOX_FAQ_MANAGER, 'NONSSL' , '', '1') .
+                                        tep_admin_files_boxes(FILENAME_FAQ_CATEGORIES, BOX_FAQ_CATEGORIES, 'NONSSL' , '', '1') .
+                                    //tep_admin_files_boxes(FILENAME_FAQ_VIEW, BOX_FAQ_VIEW, 'NONSSL' , '', '1') .
+                                    //tep_admin_files_boxes(FILENAME_FAQ_VIEW_ALL,BOX_FAQ_VIEW_ALL, 'NONSSL' , '', '1') .
+          tep_admin_files_boxes(FILENAME_DEFINE_MAINPAGE, BOX_CATALOG_DEFINE_MAINPAGE) . 
+          tep_admin_files_boxes(FILENAME_INFORMATION_MANAGER, BOX_INFORMATION_MANAGER)); 
+  }
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/links.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: links.php,v 1.1.1.1 2004/03/04 23:39:43 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  Copyright (c) 2005
+  
+  Last Modified by : $Author$
+  Last Modifed on :  $Date$
+  Latest Revision :  $Revision: 225 $
+*/
+?>
+<!-- links //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_LINKS,
+                     'link'  => tep_href_link(FILENAME_LINKS, 'selected_box=links'));
+
+ if ($selected_box == 'links' || $menu_dhtml == true) {
+    $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_LINKS, BOX_LINKS_LINKS) .
+                                   tep_admin_files_boxes(FILENAME_LINK_CATEGORIES, BOX_LINKS_LINK_CATEGORIES) .
+                                   tep_admin_files_boxes(FILENAME_LINKS_CONTACT, BOX_LINKS_LINKS_CONTACT));
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- links_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/localization.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/localization.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/localization.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: localization.php,v 1.1.1.1 2004/03/04 23:39:43 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+  
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- localization //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_LOCALIZATION,
+                     'link'  => tep_href_link(FILENAME_CURRENCIES, 'selected_box=localization'));
+
+  if ($selected_box == 'localization' || $menu_dhtml == true) {
+    $contents[] = array('text'  =>
+                                   tep_admin_files_boxes(FILENAME_CURRENCIES, BOX_LOCALIZATION_CURRENCIES) .
+                                   tep_admin_files_boxes(FILENAME_LANGUAGES, BOX_LOCALIZATION_LANGUAGES) .
+                                   tep_admin_files_boxes(FILENAME_ORDERS_STATUS, BOX_LOCALIZATION_ORDERS_STATUS));
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- localization_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/marketing.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/marketing.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/marketing.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: marketing.php,v 1.1.1.1 2004/03/04 23:39:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  Copyright &copy; 2005-2006 
+  
+  Last Modified By : $Author$
+  Last Modifed On :  $Date$
+  Latest Revision :  $Revision: 263 $
+ Released under the GNU General Public License  
+*/
+?>
+<!-- marketing //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_MARKETING,
+            'link'  => tep_href_link(FILENAME_EVENTS_MANAGER, 'selected_box=marketing'));
+
+  if ($selected_box == 'marketing' || $menu_dhtml == true) {
+    $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_EVENTS_MANAGER, BOX_MARKETING_EVENTS_MANAGER).
+                                   tep_admin_files_boxes(FILENAME_BANNER_MANAGER, BOX_MARKETING_BANNER_MANAGER) .
+                                   tep_admin_files_boxes(FILENAME_SALEMAKER, BOX_MARKETING_SALEMAKER) .
+                             tep_admin_files_boxes(FILENAME_SPECIALS, BOX_MARKETING_SPECIALS) .
+           tep_admin_files_boxes(FILENAME_SPECIALSBYCAT, BOX_MARKETING_SPECIALSBYCAT) 
+                                   );
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- marketing_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/modules.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/modules.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/modules.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: modules.php,v 1.1.1.1 2004/03/04 23:39:43 ccwjr Exp $
+
+  
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 707 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- modules //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_MODULES,
+                     'link'  => tep_href_link(FILENAME_MODULES, 'set=payment&selected_box=modules', 'SSL'));
+
+  if ($selected_box == 'modules' || $menu_dhtml == true) {
+
+  $contents[] = array('text'  =>tep_admin_files_boxes(FILENAME_MODULES, BOX_MODULES_PAYMENT, 'SSL' , 'set=payment') . 
+          tep_admin_files_boxes(FILENAME_MODULES, BOX_MODULES_SHIPPING, 'NONSSL' , 'set=shipping') . 
+          tep_admin_files_boxes(FILENAME_MODULES, BOX_MODULES_ORDER_TOTAL, 'NONSSL' , 'set=ordertotal') . 
+          tep_admin_files_boxes(FILENAME_MODULES, BOX_MODULES_CHECKOUT_SUCCESS, 'NONSSL' , 'set=checkout_success'));
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- modules_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/reports.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/reports.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/reports.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: reports.php,v 1.1.1.1 2004/03/04 23:39:43 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Chain Reaction Works, Inc
+  Copyright &copy; 2003-2006
+
+  Last Modified By : $Author$
+  Last Modifed On :  $Date$
+  Latest Revision :  $Revision: 2927 $
+*/
+?>
+<!-- reports //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_REPORTS,
+                     'link'  => tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED, 'selected_box=reports'));
+
+  if ($selected_box == 'reports' || $menu_dhtml == true) {
+    $contents[] = array('text'  =>
+//Admin begin
+                                   tep_admin_files_boxes(FILENAME_STATS_PRODUCTS_VIEWED, BOX_REPORTS_PRODUCTS_VIEWED) .
+                                   tep_admin_files_boxes(FILENAME_STATS_PRODUCTS_PURCHASED, BOX_REPORTS_PRODUCTS_PURCHASED) .
+                                   tep_admin_files_boxes(FILENAME_STATS_ARTICLES_VIEWED,BOX_REPORTS_ARTICLES_VIEWED) .
+                                   tep_admin_files_boxes(FILENAME_STATS_WISHLIST, BOX_REPORTS_CUSTOMER_WISHLIST) .
+                                   tep_admin_files_boxes(FILENAME_STATS_CUSTOMERS, BOX_REPORTS_ORDERS_TOTAL) .
+                                   tep_admin_files_boxes(FILENAME_ORDERLIST, BOX_REPORTS_ORDERLIST) .
+                                   tep_admin_files_boxes(FILENAME_STATS_NOT_VALID_USER, BOX_REPORTS_NOT_VALID_USER) .
+                                   tep_admin_files_boxes(FILENAME_STATS_SALES_REPORT2, BOX_REPORTS_SALES_REPORT2) .
+                                   tep_admin_files_boxes(FILENAME_STATS_DAILY_SALES_REPORT, BOX_REPORTS_DAILY_PRODUCTS_ORDERS) .
+                                   tep_admin_files_boxes(FILENAME_STATS_CUSTOMERS_ORDERS, BOX_REPORTS_CUSTOMERS_ORDERS) .
+                         //          tep_admin_files_boxes(FILENAME_STATS_ZIPCODE_MATCH, BOX_REPORTS_ZIPCODE_MATCH) .
+                                   tep_admin_files_boxes(FILENAME_STATS_PRODUCTS_NOTIFICATIONS, BOX_REPORTS_PRODUCTS_NOTIFICATIONS) .
+                                   tep_admin_files_boxes(FILENAME_STATS_MONTHLY_SALES, BOX_REPORTS_MONTHLY_SALES) .
+                                   tep_admin_files_boxes(FILENAME_STATS_CREDITS, BOX_REPORTS_CREDITS));
+//Admin end
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- reports_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/taxes.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/taxes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/taxes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: taxes.php,v 1.1.1.1 2004/03/04 23:39:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  Copyright &copy; 2005-2006
+  
+  Last Modifed By : $Author$
+  Last Modified On : $Date$
+  Latest Revision :  $Revision: 707 $
+*/
+?>
+<!-- taxes //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_LOCATION_AND_TAXES,
+                     'link'  => tep_href_link(FILENAME_COUNTRIES, 'selected_box=taxes'));
+
+  if ($selected_box == 'taxes' || $menu_dhtml == true) {
+    $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_COUNTRIES, BOX_TAXES_COUNTRIES) .
+                                   tep_admin_files_boxes(FILENAME_ZONES, BOX_TAXES_ZONES) .
+                                   tep_admin_files_boxes(FILENAME_GEO_ZONES, BOX_TAXES_GEO_ZONES) .
+                                   tep_admin_files_boxes(FILENAME_TAX_CLASSES, BOX_TAXES_TAX_CLASSES) .
+                                   tep_admin_files_boxes(FILENAME_TAX_RATES, BOX_TAXES_TAX_RATES));
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- taxes_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/techsupport.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/techsupport.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/techsupport.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+  /*
+  Module: Technical Support Center
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+ 
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $LastChangedBy$
+  Last Modifed on : $LastChangedDate$
+  Latest Revision : $Revision: 707 $
+
+  Released under the GNU General Public License
+  */
+?>
+<!-- Tech Support //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_TECH_SUPPORT,
+                     'link'  => tep_href_link('FILENAME_INSTALL_EXPLAIN'));
+
+if ($selected_box == 'information' || $menu_dhtml == true) {
+  $contents[] = array('text'  =>  tep_admin_files_boxes(FILENAME_INSTALL_EXPLAIN, BOX_HEADING_INSTALL_EXPLAIN) .
+                                  tep_admin_files_boxes(FILENAME_STATS_EXPLAIN,BOX_REPORTS_EXPLAIN)); 
+  }
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- Tech Support_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/boxes/tools.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/boxes/tools.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/boxes/tools.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: tools.php,v 1.1.1.1 2004/03/04 23:39:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  Copyright &copy; 2005-2006 
+  
+  Last Modified By : $Author: Author $
+  Last Modifed On :  $Date: LastChangeDate$
+  Latest Revision :  $Revision: 1444 $
+*/
+?>
+<!-- tools //-->
+          <tr>
+            <td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  $heading[] = array('text'  => BOX_HEADING_TOOLS,
+                     'link'  => tep_href_link(FILENAME_BACKUP_MYSQL, 'selected_box=tools'));
+
+  if ($selected_box == 'tools' || $menu_dhtml == true) {
+    $contents[] = array('text'  => tep_admin_files_boxes(FILENAME_BACKUP_MYSQL, BOX_TOOLS_MYSQL_BACKUP, 'SSL') .
+                                   tep_admin_files_boxes(FILENAME_BACKUP,BOX_TOOLS_BACKUP) .
+                                   tep_admin_files_boxes(FILENAME_CACHE, BOX_TOOLS_CACHE) .
+                                   tep_admin_files_boxes(FILENAME_EDIT_LANGUAGES, BOX_TOOLS_DEFINE_LANGUAGE) .
+                                   tep_admin_files_boxes(FILENAME_EMAIL_SUBJECTS, BOX_TOOLS_EMAIL_SUBJECTS ) .
+                                   tep_admin_files_boxes(FILENAME_MAIL, BOX_TOOLS_MAIL) .
+                                   tep_admin_files_boxes(FILENAME_NEWSLETTERS, BOX_TOOLS_NEWSLETTER_MANAGER) .
+                                   tep_admin_files_boxes(FILENAME_SERVER_INFO, BOX_TOOLS_SERVER_INFO) .
+                                   tep_admin_files_boxes(FILENAME_WHOS_ONLINE, BOX_TOOLS_WHOS_ONLINE));
+//Admin end
+  }
+
+  $box = new box;
+  echo $box->menuBox($heading, $contents);
+?>
+            </td>
+          </tr>
+<!-- tools_eof //-->

Added: trunk/direct.openmoko.com/admin/includes/classes/box.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/box.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/box.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: box.php,v 1.1.1.1 2004/03/04 23:39:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  Example usage:
+
+  $heading = array();
+  $heading[] = array('params' => 'class="menuBoxHeading"',
+                     'text'  => BOX_HEADING_TOOLS,
+                     'link'  => tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('selected_box')) . 'selected_box=tools'));
+
+  $contents = array();
+  $contents[] = array('text'  => SOME_TEXT);
+
+  $box = new box;
+  echo $box->infoBox($heading, $contents);
+*/
+
+  class box extends tableBlock {
+    function box() {
+      $this->heading = array();
+      $this->contents = array();
+    }
+
+    function infoBox($heading, $contents) {
+      $this->table_row_parameters = 'class="infoBoxHeading"';
+      $this->table_data_parameters = 'class="infoBoxHeading"';
+      $this->heading = $this->tableBlock($heading);
+
+      $this->table_row_parameters = '';
+      $this->table_data_parameters = 'class="infoBoxContent"';
+      $this->contents = $this->tableBlock($contents);
+
+      return $this->heading . $this->contents;
+    }
+
+    function menuBox($heading, $contents) {
+
+    global $menu_dhtml, $selected;              // add for dhtml_menu
+    if ($menu_dhtml == false ) {     // add for dhtml_menu
+
+      $this->table_data_parameters = 'class="menuBoxHeading"';
+      if ($heading[0]['link']) {
+        $this->table_data_parameters .= ' onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . $heading[0]['link'] . '\'"';
+        $heading[0]['text'] = '&nbsp;<a href="' . $heading[0]['link'] . '" class="menuBoxHeadingLink">' . $heading[0]['text'] . '</a>&nbsp;';
+      } else {
+        $heading[0]['text'] = '&nbsp;' . $heading[0]['text'] . '&nbsp;';
+      }
+      $this->heading = $this->tableBlock($heading);
+      $this->table_data_parameters = 'class="menuBoxContent"';
+      $this->contents = $this->tableBlock($contents);
+      return $this->heading . $this->contents . $dhtml_contents;
+// ## add for dhtml_menu
+    } else {
+     // populate $selected variable
+    //trim everthing left selected box
+      $selected1 = substr(strstr($heading[0]['link'], 'selected_box='), 13);
+      //if sid is present remove it
+      $selected = str_replace(strstr($selected1, '&osCAdminID='), '', $selected1 );
+      
+      $dhtml_contents = $contents[0]['text'];
+      $change_style = array ('<br>'=>' ','<BR>'=>' ', 'a href='=> 'a class="menuItem" href=','class="menuBoxContentLink"'=>' ');
+      $dhtml_contents = strtr($dhtml_contents,$change_style);
+      $dhtml_contents = '<div id="'.$selected.'Menu" class="menu" onmouseover="menuMouseover(event)">'. $dhtml_contents . '</div>';
+      return $dhtml_contents;
+      }
+// ## eof add for dhtml_menu
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/currencies.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:39:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// Class to handle currencies
+// TABLES: currencies
+  class currencies {
+    var $currencies;
+
+// class constructor
+    function currencies() {
+      $this->currencies = array();
+      $currencies_query = tep_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES);
+      while ($currencies = tep_db_fetch_array($currencies_query)) {
+      $this->currencies[$currencies['code']] = array('title' => $currencies['title'],
+                                                       'symbol_left' => $currencies['symbol_left'],
+                                                       'symbol_right' => $currencies['symbol_right'],
+                                                       'decimal_point' => $currencies['decimal_point'],
+                                                       'thousands_point' => $currencies['thousands_point'],
+                                                       'decimal_places' => $currencies['decimal_places'],
+                                                       'value' => $currencies['value']);
+      }
+    }
+
+// class methods
+    function format($number, $calculate_currency_value = true, $currency_type = DEFAULT_CURRENCY, $currency_value = '') {
+      if ($calculate_currency_value) {
+        $rate = ($currency_value) ? $currency_value : $this->currencies[$currency_type]['value'];
+        $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format($number * $rate, $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
+// if the selected currency is in the european euro-conversion and the default currency is euro,
+// the currency will displayed in the national currency and euro currency
+        if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {
+          $format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';
+        }
+      } else {
+        $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format($number, $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
+      }
+
+      return $format_string;
+    }
+
+    function get_value($code) {
+      return $this->currencies[$code]['value'];
+    }
+
+    function display_price($products_price, $products_tax, $quantity = 1) {
+      return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/email.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/email.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/email.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,570 @@
+<?php
+/*
+  $Id: email.php,v 1.1.1.1 2004/03/04 23:39:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  mail.php - a class to assist in building mime-HTML eMails
+
+  The original class was made by Richard Heyes <richard at phpguru.org>
+  and can be found here: http://www.phpguru.org
+
+  Renamed and Modified by Jan Wildeboer for osCommerce
+*/
+
+  class email {
+    var $html;
+    var $text;
+    var $output;
+    var $html_text;
+    var $html_images;
+    var $image_types;
+    var $build_params;
+    var $attachments;
+    var $headers;
+
+    function email($headers = '') {
+      if ($headers == '') $headers = array();
+
+      $this->html_images = array();
+      $this->headers = array();
+
+      if (EMAIL_LINEFEED == 'CRLF') {
+        $this->lf = "\r\n";
+      } else {
+        $this->lf = "\n";
+      }
+
+/**
+ * If you want the auto load functionality
+ * to find other mime-image/file types, add the
+ * extension and content type here.
+ */
+
+      $this->image_types = array('gif' => 'image/gif',
+                                 'jpg' => 'image/jpeg',
+                                 'jpeg' => 'image/jpeg',
+                                 'jpe' => 'image/jpeg',
+                                 'bmp' => 'image/bmp',
+                                 'png' => 'image/png',
+                                 'tif' => 'image/tiff',
+                                 'tiff' => 'image/tiff',
+                                 'swf' => 'application/x-shockwave-flash');
+
+      $this->build_params['html_encoding'] = 'quoted-printable';
+      $this->build_params['text_encoding'] = '7bit';
+      $this->build_params['html_charset'] = constant('CHARSET');
+      $this->build_params['text_charset'] = constant('CHARSET');
+      $this->build_params['text_wrap'] = 998;
+
+/**
+ * Make sure the MIME version header is first.
+ */
+
+      $this->headers[] = 'MIME-Version: 1.0';
+
+      reset($headers);
+      while (list(,$value) = each($headers)) {
+        if (tep_not_null($value)) {
+          $this->headers[] = $value;
+        }
+      }
+    }
+
+/**
+ * This function will read a file in
+ * from a supplied filename and return
+ * it. This can then be given as the first
+ * argument of the the functions
+ * add_html_image() or add_attachment().
+ */
+
+    function get_file($filename) {
+      $return = '';
+
+      if ($fp = fopen($filename, 'rb')) {
+        while (!feof($fp)) {
+          $return .= fread($fp, 1024);
+        }
+        fclose($fp);
+
+        return $return;
+      } else {
+        return false;
+      }
+    }
+
+/**
+ * Function for extracting images from
+ * html source. This function will look
+ * through the html code supplied by add_html()
+ * and find any file that ends in one of the
+ * extensions defined in $obj->image_types.
+ * If the file exists it will read it in and
+ * embed it, (not an attachment).
+ *
+ * Function contributed by Dan Allen
+ */
+
+    function find_html_images($images_dir) {
+// Build the list of image extensions
+      while (list($key, ) = each($this->image_types)) {
+        $extensions[] = $key;
+      }
+
+      preg_match_all('/"([^"]+\.(' . implode('|', $extensions).'))"/Ui', $this->html, $images);
+
+      for ($i=0; $i<count($images[1]); $i++) {
+        if (file_exists($images_dir . $images[1][$i])) {
+          $html_images[] = $images[1][$i];
+          $this->html = str_replace($images[1][$i], basename($images[1][$i]), $this->html);
+        }
+      }
+
+      if (tep_not_null($html_images)) {
+// If duplicate images are embedded, they may show up as attachments, so remove them.
+        $html_images = array_unique($html_images);
+        sort($html_images);
+
+        for ($i=0; $i<count($html_images); $i++) {
+          if ($image = $this->get_file($images_dir . $html_images[$i])) {
+            $content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)];
+            $this->add_html_image($image, basename($html_images[$i]), $content_type);
+          }
+        }
+      }
+    }
+
+/**
+ * Adds plain text. Use this function
+ * when NOT sending html email
+ */
+
+    function add_text($text = '') {
+      $this->text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);
+    }
+
+/**
+ * Adds a html part to the mail.
+ * Also replaces image names with
+ * content-id's.
+ */
+
+    function add_html($html, $text = NULL, $images_dir = NULL) {
+      $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html);
+      $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);
+
+      if (isset($images_dir)) $this->find_html_images($images_dir);
+    }
+
+/**
+ * Adds an image to the list of embedded
+ * images.
+ */
+
+    function add_html_image($file, $name = '', $c_type='application/octet-stream') {
+      $this->html_images[] = array('body' => $file,
+                                   'name' => $name,
+                                   'c_type' => $c_type,
+                                   'cid' => md5(uniqid(time())));
+    }
+
+/**
+ * Adds a file to the list of attachments.
+ */
+
+    function add_attachment($file, $name = '', $c_type='application/octet-stream', $encoding = 'base64') {
+      $this->attachments[] = array('body' => $file,
+                                   'name' => $name,
+                                   'c_type' => $c_type,
+                                   'encoding' => $encoding);
+    }
+
+/**
+ * Adds a text subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_text_part(&$obj, $text) {
+    function add_text_part(&$obj, $text) {
+      $params['content_type'] = 'text/plain';
+      $params['encoding'] = $this->build_params['text_encoding'];
+      $params['charset'] = $this->build_params['text_charset'];
+
+      if (is_object($obj)) {
+        return $obj->addSubpart($text, $params);
+      } else {
+        return new mime($text, $params);
+      }
+    }
+
+/**
+ * Adds a html subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_html_part(&$obj) {
+    function add_html_part(&$obj) {
+      $params['content_type'] = 'text/html';
+      $params['encoding'] = $this->build_params['html_encoding'];
+      $params['charset'] = $this->build_params['html_charset'];
+
+      if (is_object($obj)) {
+        return $obj->addSubpart($this->html, $params);
+      } else {
+        return new mime($this->html, $params);
+      }
+    }
+
+/**
+ * Starts a message with a mixed part
+ */
+
+/* HPDL PHP3 */
+//    function &add_mixed_part() {
+    function add_mixed_part() {
+      $params['content_type'] = 'multipart/mixed';
+
+      return new mime('', $params);
+    }
+
+/**
+ * Adds an alternative part to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_alternative_part(&$obj) {
+    function add_alternative_part(&$obj) {
+      $params['content_type'] = 'multipart/alternative';
+
+      if (is_object($obj)) {
+        return $obj->addSubpart('', $params);
+      } else {
+        return new mime('', $params);
+      }
+    }
+
+/**
+ * Adds a html subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_related_part(&$obj) {
+    function add_related_part(&$obj) {
+      $params['content_type'] = 'multipart/related';
+
+      if (is_object($obj)) {
+        return $obj->addSubpart('', $params);
+      } else {
+        return new mime('', $params);
+      }
+    }
+
+/**
+ * Adds an html image subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_html_image_part(&$obj, $value) {
+    function add_html_image_part(&$obj, $value) {
+      $params['content_type'] = $value['c_type'];
+      $params['encoding'] = 'base64';
+      $params['disposition'] = 'inline';
+      $params['dfilename'] = $value['name'];
+      $params['cid'] = $value['cid'];
+
+      $obj->addSubpart($value['body'], $params);
+    }
+
+/**
+ * Adds an attachment subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_attachment_part(&$obj, $value) {
+    function add_attachment_part(&$obj, $value) {
+      $params['content_type'] = $value['c_type'];
+      $params['encoding'] = $value['encoding'];
+      $params['disposition'] = 'attachment';
+      $params['dfilename'] = $value['name'];
+
+      $obj->addSubpart($value['body'], $params);
+    }
+
+/**
+ * Builds the multipart message from the
+ * list ($this->_parts). $params is an
+ * array of parameters that shape the building
+ * of the message. Currently supported are:
+ *
+ * $params['html_encoding'] - The type of encoding to use on html. Valid options are
+ *                            "7bit", "quoted-printable" or "base64" (all without quotes).
+ *                            7bit is EXPRESSLY NOT RECOMMENDED. Default is quoted-printable
+ * $params['text_encoding'] - The type of encoding to use on plain text Valid options are
+ *                            "7bit", "quoted-printable" or "base64" (all without quotes).
+ *                            Default is 7bit
+ * $params['text_wrap']     - The character count at which to wrap 7bit encoded data.
+ *                            Default this is 998.
+ * $params['html_charset']  - The character set to use for a html section.
+ *                            Default is iso-8859-1
+ * $params['text_charset']  - The character set to use for a text section.
+ *                          - Default is iso-8859-1
+ */
+
+/* HPDL PHP3 */
+//    function build_message($params = array()) {
+    function build_message($params = '') {
+      if ($params == '') $params = array();
+
+      if (count($params) > 0) {
+        reset($params);
+        while(list($key, $value) = each($params)) {
+          $this->build_params[$key] = $value;
+        }
+      }
+
+      if (tep_not_null($this->html_images)) {
+        reset($this->html_images);
+        while (list(,$value) = each($this->html_images)) {
+          $this->html = str_replace($value['name'], 'cid:' . $value['cid'], $this->html);
+        }
+      }
+
+      $null = NULL;
+      $attachments = ((tep_not_null($this->attachments)) ? true : false);
+      $html_images = ((tep_not_null($this->html_images)) ? true : false);
+      $html = ((tep_not_null($this->html)) ? true : false);
+      $text = ((tep_not_null($this->text)) ? true : false);
+      switch (true) {
+        case (($text == true) && ($attachments == false)  && ($html == false)):
+/* HPDL PHP3 */
+//          $message =& $this->add_text_part($null, $this->text);
+          $message = $this->add_text_part($null, $this->text);
+          break;
+        case (($text == false) && ($attachments == true) && ($html == false)):
+/* HPDL PHP3 */
+//          $message =& $this->add_mixed_part();
+          $message = $this->add_mixed_part();
+
+          for ($i=0; $i<count($this->attachments); $i++) {
+            $this->add_attachment_part($message, $this->attachments[$i]);
+          }
+          break;
+        case (($text == true) && ($attachments == true)):
+/* HPDL PHP3 */
+//          $message =& $this->add_mixed_part();
+          $message = $this->add_mixed_part();
+          $this->add_text_part($message, $this->text);
+
+          for ($i=0; $i<count($this->attachments); $i++) {
+            $this->add_attachment_part($message, $this->attachments[$i]);
+          }
+          break;
+        case (($html == true) && ($attachments == false) && ($html_images == false)):
+          if (tep_not_null($this->html_text)) {
+/* HPDL PHP3 */
+//            $message =& $this->add_alternative_part($null);
+            $message = $this->add_alternative_part($null);
+            $this->add_text_part($message, $this->html_text);
+            $this->add_html_part($message);
+          } else {
+/* HPDL PHP3 */
+//            $message =& $this->add_html_part($null);
+            $message = $this->add_html_part($null);
+          }
+          break;
+        case (($html == true) && ($attachments == false) && ($html_images == true)):
+          if (tep_not_null($this->html_text)) {
+/* HPDL PHP3 */
+//            $message =& $this->add_alternative_part($null);
+            $message = $this->add_alternative_part($null);
+            $this->add_text_part($message, $this->html_text);
+/* HPDL PHP3 */
+//            $related =& $this->add_related_part($message);
+            $related = $this->add_related_part($message);
+          } else {
+/* HPDL PHP3 */
+//            $message =& $this->add_related_part($null);
+//            $related =& $message;
+            $message = $this->add_related_part($null);
+            $related = $message;
+          }
+          $this->add_html_part($related);
+
+          for ($i=0; $i<count($this->html_images); $i++) {
+            $this->add_html_image_part($related, $this->html_images[$i]);
+          }
+          break;
+        case (($html == true) && ($attachments == true) && ($html_images == false)):
+/* HPDL PHP3 */
+//          $message =& $this->add_mixed_part();
+          $message = $this->add_mixed_part();
+          if (tep_not_null($this->html_text)) {
+/* HPDL PHP3 */
+//            $alt =& $this->add_alternative_part($message);
+            $alt = $this->add_alternative_part($message);
+            $this->add_text_part($alt, $this->html_text);
+            $this->add_html_part($alt);
+          } else {
+            $this->add_html_part($message);
+          }
+
+          for ($i=0; $i<count($this->attachments); $i++) {
+            $this->add_attachment_part($message, $this->attachments[$i]);
+          }
+          break;
+        case (($html == true) && ($attachments == true) && ($html_images == true)):
+/* HPDL PHP3 */
+//          $message =& $this->add_mixed_part();
+          $message = $this->add_mixed_part();
+
+          if (tep_not_null($this->html_text)) {
+/* HPDL PHP3 */
+//            $alt =& $this->add_alternative_part($message);
+            $alt = $this->add_alternative_part($message);
+            $this->add_text_part($alt, $this->html_text);
+/* HPDL PHP3 */
+//            $rel =& $this->add_related_part($alt);
+            $rel = $this->add_related_part($alt);
+          } else {
+/* HPDL PHP3 */
+//            $rel =& $this->add_related_part($message);
+            $rel = $this->add_related_part($message);
+          }
+          $this->add_html_part($rel);
+
+          for ($i=0; $i<count($this->html_images); $i++) {
+            $this->add_html_image_part($rel, $this->html_images[$i]);
+          }
+
+          for ($i=0; $i<count($this->attachments); $i++) {
+            $this->add_attachment_part($message, $this->attachments[$i]);
+          }
+          break;
+      }
+
+      if ( (isset($message)) && (is_object($message)) ) {
+        $output = $message->encode();
+        $this->output = $output['body'];
+
+        reset($output['headers']);
+        while (list($key, $value) = each($output['headers'])) {
+          $headers[] = $key . ': ' . $value;
+        }
+
+        $this->headers = array_merge($this->headers, $headers);
+
+        return true;
+      } else {
+        return false;
+      }
+    }
+
+/**
+ * Sends the mail.
+ */
+
+    function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') {
+      if ((strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false)) {
+        return false;
+      }
+      if ((strstr($to_addr, "\n") != false) || (strstr($to_addr, "\r") != false)) {
+        return false;
+      }
+      if ((strstr($subject, "\n") != false) || (strstr($subject, "\r") != false)) {
+        return false;
+      }
+      if ((strstr($from_name, "\n") != false) || (strstr($from_name, "\r") != false)) {
+        return false;
+      }
+      if ((strstr($from_addr, "\n") != false) || (strstr($from_addr, "\r") != false)) {
+        return false;
+      }
+      $to = (($to_name != '') ? '"' . $to_name . '" <' . $to_addr . '>' : $to_addr);
+      $from = (($from_name != '') ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr);
+      if (is_string($headers)) {
+        $headers = explode($this->lf, trim($headers));
+      }
+      for ($i=0; $i<count($headers); $i++) {
+        if (is_array($headers[$i])) {
+          for ($j=0; $j<count($headers[$i]); $j++) {
+            if ($headers[$i][$j] != '') {
+              $xtra_headers[] = $headers[$i][$j];
+            }
+          }
+        }
+
+        if ($headers[$i] != '') {
+          $xtra_headers[] = $headers[$i];
+        }
+      }
+
+      if (!isset($xtra_headers)) {
+        $xtra_headers = array();
+      }
+
+      if (EMAIL_TRANSPORT == 'smtp') {
+        return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));
+      } else {
+        return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));
+      }
+    }
+
+/**
+ * Use this method to return the email
+ * in message/rfc822 format. Useful for
+ * adding an email to another email as
+ * an attachment. there's a commented
+ * out example in example.php.
+ *
+ * string get_rfc822(string To name,
+ *       string To email,
+ *       string From name,
+ *       string From email,
+ *       [string Subject,
+ *        string Extra headers])
+ */
+
+    function get_rfc822($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') {
+// Make up the date header as according to RFC822
+      $date = 'Date: ' . date('D, d M y H:i:s');
+      $to = (($to_name != '') ? 'To: "' . $to_name . '" <' . $to_addr . '>' : 'To: ' . $to_addr);
+      $from = (($from_name != '') ? 'From: "' . $from_name . '" <' . $from_addr . '>' : 'From: ' . $from_addr);
+
+      if (is_string($subject)) {
+        $subject = 'Subject: ' . $subject;
+      }
+
+      if (is_string($headers)) {
+        $headers = explode($this->lf, trim($headers));
+      }
+
+      for ($i=0; $i<count($headers); $i++) {
+        if (is_array($headers[$i])) {
+          for ($j=0; $j<count($headers[$i]); $j++) {
+            if ($headers[$i][$j] != '') {
+              $xtra_headers[] = $headers[$i][$j];
+            }
+          }
+        }
+
+        if ($headers[$i] != '') {
+          $xtra_headers[] = $headers[$i];
+        }
+      }
+
+      if (!isset($xtra_headers)) {
+        $xtra_headers = array();
+      }
+
+      $headers = array_merge($this->headers, $xtra_headers);
+
+      return $date . $this->lf . $from . $this->lf . $to . $this->lf . $subject . $this->lf . implode($this->lf, $headers) . $this->lf . $this->lf . $this->output;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/file_layout.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/file_layout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/file_layout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,94 @@
+<?php
+/*
+  $Id: file_layout.php,v 1.0 2004/04/16 11:22:05 eCartz Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+  Copyright (c) 2004 eCartz.com, Inc.
+
+  Released under the GNU General Public License
+*/
+
+  class file_layout {
+    var $modules;
+
+// class constructor
+    function file_layout($module = '') {
+      global $language, $PHP_SELF, $HTTP_GET_VARS;
+
+      if (defined('MODULE_FILE_LAYOUTS_INSTALLED') && tep_not_null(MODULE_FILE_LAYOUTS_INSTALLED)) {
+        $this->modules = explode(';', MODULE_FILE_LAYOUTS_INSTALLED);
+
+        $this->include_modules = array();
+
+        if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {
+          $this->include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));
+        } else {
+          reset($this->modules);
+          while (list(, $value) = each($this->modules)) {
+            $class = substr($value, 0, strrpos($value, '.'));
+            $this->include_modules[] = array('class' => $class, 'file' => $value);
+          }
+        }
+
+        for ($i=0, $n=sizeof($this->include_modules); $i<$n; $i++) {
+          include('includes/languages/' . $language . '/modules/file_layouts/' . $this->include_modules[$i]['file']);
+          include(DIR_WS_MODULES . 'file_layouts/' . $this->include_modules[$i]['file']);
+
+          $GLOBALS[$this->include_modules[$i]['class']] = new $this->include_modules[$i]['class'];
+        }
+      } else {
+        $this->include_modules = array();
+      }
+      $this->selected = $HTTP_GET_VARS['dltype'];
+    }
+
+    function get_header () {
+      return $GLOBALS[$this->selected]->get_header();
+    }
+
+    function filename () {
+      return $GLOBALS[$this->selected]->filename();
+    }
+
+    function create() {
+      if (is_object($GLOBALS[$this->selected])) {
+        $GLOBALS[$this->selected]->create();
+      }
+    }
+
+    function select($module) {
+      $this->selected = $GLOBALS[$module];
+    }
+
+    function import_row($line) {
+
+    }
+
+    function export($file_pointer = '') {
+      return $GLOBALS[$this->selected]->export($file_pointer);
+    }
+
+    function import_selection() {
+      $import_array = array();
+      foreach ($this->include_modules as $module) {
+        $import_array[] = array('id' => $module['class']->code, 'text' => $module['class']->title);
+      }
+      return $import_array;
+    }
+
+    function export_selection() {
+      $download_selection = array();
+      $tempdir_selection = array();
+
+      foreach ($this->include_modules as $module) {
+        $download_selection[] = '<a href="' . tep_href_link(FILENAME_EXPORT, 'download=stream&dltype='   . /*$GLOBALS[*/$module['class']/*]->code*/) . '">' . sprintf(TEMPLATE_EXPORT_STREAM, $GLOBALS[$module['class']]->title) . '</a>';
+        $tempdir_selection[]  = '<a href="' . tep_href_link(FILENAME_EXPORT, 'download=tempfile&dltype=' . /*$GLOBALS[*/$module['class']/*]->code*/) . '">' . sprintf(TEMPLATE_EXPORT_TEMPDIR, $GLOBALS[$module['class']]->title) . '</a>';
+      }
+
+      return sprintf(TEMPLATE_EXPORT, implode('<br>', $download_selection), IMPORT_EXPORT_TEMP_DIR, implode('<br>', $tempdir_selection));
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/language.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/language.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/language.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/*
+  $Id: language.php,v 1.1.1.1 2004/03/04 23:39:45 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  browser language detection logic Copyright phpMyAdmin (select_lang.lib.php3 v1.24 04/19/2002)
+                                   Copyright Stephane Garin <sgarin at sgarin.com> (detect_language.php v0.1 04/02/2002)
+*/
+
+  class language {
+    var $languages, $catalog_languages, $browser_languages, $language;
+
+    function language($lng = '') {
+      $this->languages = array('ar' => 'ar([-_][[:alpha:]]{2})?|arabic',
+                               'bg' => 'bg|bulgarian',
+                               'br' => 'pt[-_]br|brazilian portuguese',
+                               'ca' => 'ca|catalan',
+                               'cs' => 'cs|czech',
+                               'da' => 'da|danish',
+                               'de' => 'de([-_][[:alpha:]]{2})?|german',
+                               'el' => 'el|greek',
+                               'en' => 'en([-_][[:alpha:]]{2})?|english',
+                               'es' => 'es([-_][[:alpha:]]{2})?|spanish',
+                               'et' => 'et|estonian',
+                               'fi' => 'fi|finnish',
+                               'fr' => 'fr([-_][[:alpha:]]{2})?|french',
+                               'gl' => 'gl|galician',
+                               'he' => 'he|hebrew',
+                               'hu' => 'hu|hungarian',
+                               'id' => 'id|indonesian',
+                               'it' => 'it|italian',
+                               'ja' => 'ja|japanese',
+                               'ko' => 'ko|korean',
+                               'ka' => 'ka|georgian',
+                               'lt' => 'lt|lithuanian',
+                               'lv' => 'lv|latvian',
+                               'nl' => 'nl([-_][[:alpha:]]{2})?|dutch',
+                               'no' => 'no|norwegian',
+                               'pl' => 'pl|polish',
+                               'pt' => 'pt([-_][[:alpha:]]{2})?|portuguese',
+                               'ro' => 'ro|romanian',
+                               'ru' => 'ru|russian',
+                               'sk' => 'sk|slovak',
+                               'sr' => 'sr|serbian',
+                               'sv' => 'sv|swedish',
+                               'th' => 'th|thai',
+                               'tr' => 'tr|turkish',
+                               'uk' => 'uk|ukrainian',
+                               'tw' => 'zh[-_]tw|chinese traditional',
+                               'zh' => 'zh|chinese simplified');
+
+      $this->catalog_languages = array();
+      $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
+      while ($languages = tep_db_fetch_array($languages_query)) {
+        $this->catalog_languages[$languages['code']] = array('id' => $languages['languages_id'],
+                                                             'name' => $languages['name'],
+                                                             'image' => $languages['image'],
+                                                             'directory' => $languages['directory']);
+      }
+
+      $this->browser_languages = '';
+      $this->language = '';
+
+      $this->set_language($lng);
+    }
+
+    function set_language($language) {
+      if ( (tep_not_null($language)) && (isset($this->catalog_languages[$language])) ) {
+        $this->language = $this->catalog_languages[$language];
+      } else {
+        $this->language = $this->catalog_languages[DEFAULT_LANGUAGE];
+      }
+    }
+
+    function get_browser_language() {
+      $this->browser_languages = explode(',', getenv('HTTP_ACCEPT_LANGUAGE'));
+
+      for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
+        reset($this->languages);
+        while (list($key, $value) = each($this->languages)) {
+          if (eregi('^(' . $value . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
+            $this->language = $this->catalog_languages[$key];
+            break 2;
+          }
+        }
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/logger.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/logger.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/logger.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: logger.php,v 1.1.1.1 2004/03/04 23:39:45 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class logger {
+    var $timer_start, $timer_stop, $timer_total;
+
+// class constructor
+    function logger() {
+      $this->timer_start();
+    }
+
+    function timer_start() {
+      if (defined("PAGE_PARSE_START_TIME")) {
+        $this->timer_start = PAGE_PARSE_START_TIME;
+      } else {
+        $this->timer_start = microtime();
+      }
+    }
+
+    function timer_stop($display = 'false') {
+      $this->timer_stop = microtime();
+
+      $time_start = explode(' ', $this->timer_start);
+      $time_end = explode(' ', $this->timer_stop);
+
+      $this->timer_total = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
+
+      $this->write(getenv('REQUEST_URI'), $this->timer_total . 's');
+
+      if ($display == 'true') {
+        return $this->timer_display();
+      }
+    }
+
+    function timer_display() {
+      return '<span class="smallText">Parse Time: ' . $this->timer_total . 's</span>';
+    }
+
+    function write($message, $type) {
+      error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' [' . $type . '] ' . $message . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/message_stack.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/message_stack.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/message_stack.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,155 @@
+<?php
+/*
+  $Id: message_stack.php,v 1.1.1.1 2004/03/04 23:40:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Example usage:
+
+  $messageStack = new messageStack();
+  $messageStack->add('general', 'Error: Error 1', 'error');
+  $messageStack->add('general', 'Error: Error 2', 'warning');
+  if ($messageStack->size('general') > 0) echo $messageStack->output('general');
+*/
+//Lango Added for template mod: BOF
+
+  class tableBoxMessagestack {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBoxMessagestack($contents, $direct_output = false) {
+      $tableBox1_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox1_string .= ' ' . $this->table_parameters;
+      $tableBox1_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox1_string .= $contents[$i]['form'] . "\n";
+        $tableBox1_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox1_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox1_string .= ' ' . $contents[$i]['params'];
+        $tableBox1_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox1_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox1_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox1_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox1_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox1_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox1_string .= $contents[$i][$x]['form'];
+              $tableBox1_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox1_string .= '</form>';
+              $tableBox1_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox1_string .= '    <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox1_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox1_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox1_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox1_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
+        }
+
+        $tableBox1_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox1_string .= '</form>' . "\n";
+      }
+
+      $tableBox1_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox1_string;
+
+      return $tableBox1_string;
+    }
+  }
+
+
+  class messageStack extends tableBoxMessagestack {
+//Lango Added for template mod: EOF
+
+// class constructor
+    function messageStack() {
+      global $messageToStack;
+
+      $this->messages = array();
+
+      if (tep_session_is_registered('messageToStack')) {
+        for ($i=0, $n=sizeof($messageToStack); $i<$n; $i++) {
+          $this->add($messageToStack[$i]['class'], $messageToStack[$i]['text'], $messageToStack[$i]['type']);
+        }
+        tep_session_unregister('messageToStack');
+      }
+    }
+
+// class methods
+    function add($class, $message, $type = 'error') {
+      if ($type == 'error') {
+        $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'error.gif', ICON_ERROR) . '&nbsp;' . $message);
+      } elseif ($type == 'warning') {
+        $this->messages[] = array('params' => 'class="messageStackWarning"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . '&nbsp;' . $message);
+      } elseif ($type == 'success') {
+        $this->messages[] = array('params' => 'class="messageStackSuccess"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . '&nbsp;' . $message);
+      } else {
+        $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => $message);
+      }
+    }
+
+    function add_session($class, $message, $type = 'error') {
+      global $messageToStack;
+
+      if (!tep_session_is_registered('messageToStack')) {
+        tep_session_register('messageToStack');
+        $messageToStack = array();
+      }
+
+      $messageToStack[] = array('class' => $class, 'text' => $message, 'type' => $type);
+    }
+
+    function reset() {
+      $this->messages = array();
+    }
+
+    function output($class) {
+      $this->table_data_parameters = 'class="messageBox"';
+
+      $output = array();
+      for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
+        if ($this->messages[$i]['class'] == $class) {
+          $output[] = $this->messages[$i];
+        }
+      }
+//Lango Added for template mod: BOF
+      return $this->tableBoxMessagestack($output);
+//Lango Added for template mod: EOF
+    }
+
+    function size($class) {
+      $count = 0;
+
+      for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
+        if ($this->messages[$i]['class'] == $class) {
+          $count++;
+        }
+      }
+
+      return $count;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/mime.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/mime.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/mime.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,250 @@
+<?php
+/*
+  $Id: mime.php,v 1.1.1.1 2004/03/04 23:39:45 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  mime.php - a class to assist in building mime-HTML eMails
+
+  The original class was made by Richard Heyes <richard at phpguru.org>
+  and can be found here: http://www.phpguru.org
+
+  Renamed and Modified by Jan Wildeboer for osCommerce
+*/
+
+  class mime {
+    var $_encoding;
+    var $_subparts;
+    var $_encoded;
+    var $_headers;
+    var $_body;
+
+/**
+ * Constructor.
+ *
+ * Sets up the object.
+ *
+ * @param $body   - The body of the mime part if any.
+ * @param $params - An associative array of parameters:
+ *                  content_type - The content type for this part eg multipart/mixed
+ *                  encoding     - The encoding to use, 7bit, base64, or quoted-printable
+ *                  cid          - Content ID to apply
+ *                  disposition  - Content disposition, inline or attachment
+ *                  dfilename    - Optional filename parameter for content disposition
+ *                  description  - Content description
+ * @access public
+ */
+
+    function mime($body, $params = '') {
+      if ($params == '') $params = array();
+
+// Make sure we use the correct linfeed sequence
+      if (EMAIL_LINEFEED == 'CRLF') {
+        $this->lf = "\r\n";
+      } else {
+        $this->lf = "\n";
+      }
+
+      reset($params);
+      while (list($key, $value) = each($params)) {
+        switch ($key) {
+          case 'content_type':
+            $headers['Content-Type'] = $value . (isset($charset) ? '; charset="' . $charset . '"' : '');
+            break;
+          case 'encoding':
+            $this->_encoding = $value;
+            $headers['Content-Transfer-Encoding'] = $value;
+            break;
+          case 'cid':
+            $headers['Content-ID'] = '<' . $value . '>';
+            break;
+          case 'disposition':
+            $headers['Content-Disposition'] = $value . (isset($dfilename) ? '; filename="' . $dfilename . '"' : '');
+            break;
+          case 'dfilename':
+            if (isset($headers['Content-Disposition'])) {
+              $headers['Content-Disposition'] .= '; filename="' . $value . '"';
+            } else {
+              $dfilename = $value;
+            }
+            break;
+          case 'description':
+            $headers['Content-Description'] = $value;
+            break;
+          case 'charset':
+            if (isset($headers['Content-Type'])) {
+              $headers['Content-Type'] .= '; charset="' . $value . '"';
+            } else {
+              $charset = $value;
+            }
+            break;
+        }
+      }
+
+// Default content-type
+      if (!isset($_headers['Content-Type'])) {
+        $_headers['Content-Type'] = 'text/plain';
+      }
+
+// Assign stuff to member variables
+      $this->_encoded = array();
+/* HPDL PHP3 */
+//      $this->_headers  =& $headers;
+      $this->_headers = $headers;
+      $this->_body = $body;
+    }
+
+/**
+ * encode()
+ *
+ * Encodes and returns the email. Also stores
+ * it in the encoded member variable
+ *
+ * @return An associative array containing two elements,
+ *         body and headers. The headers element is itself
+ *         an indexed array.
+ * @access public
+ */
+
+    function encode() {
+/* HPDL PHP3 */
+//      $encoded =& $this->_encoded;
+      $encoded = $this->_encoded;
+
+      if (tep_not_null($this->_subparts)) {
+        $boundary = '=_' . md5(uniqid(tep_rand()) . microtime());
+        $this->_headers['Content-Type'] .= ';' . $this->lf . chr(9) . 'boundary="' . $boundary . '"';
+
+// Add body parts to $subparts
+        for ($i=0; $i<count($this->_subparts); $i++) {
+          $headers = array();
+/* HPDL PHP3 */
+//          $tmp = $this->_subparts[$i]->encode();
+          $_subparts = $this->_subparts[$i];
+          $tmp = $_subparts->encode();
+
+          reset($tmp['headers']);
+          while (list($key, $value) = each($tmp['headers'])) {
+            $headers[] = $key . ': ' . $value;
+          }
+
+          $subparts[] = implode($this->lf, $headers) . $this->lf . $this->lf . $tmp['body'];
+        }
+
+        $encoded['body'] = '--' . $boundary . $this->lf . implode('--' . $boundary . $this->lf, $subparts) . '--' . $boundary.'--' . $this->lf;
+      } else {
+        $encoded['body'] = $this->_getEncodedData($this->_body, $this->_encoding) . $this->lf;
+      }
+
+// Add headers to $encoded
+/* HPDL PHP3 */
+//      $encoded['headers'] =& $this->_headers;
+      $encoded['headers'] = $this->_headers;
+
+      return $encoded;
+    }
+
+/**
+ * &addSubPart()
+ *
+ * Adds a subpart to current mime part and returns
+ * a reference to it
+ *
+ * @param $body   The body of the subpart, if any.
+ * @param $params The parameters for the subpart, same
+ *                as the $params argument for constructor.
+ * @return A reference to the part you just added. It is
+ *         crucial if using multipart/* in your subparts that
+ *         you use =& in your script when calling this function,
+ *         otherwise you will not be able to add further subparts.
+ * @access public
+ */
+
+/* HPDL PHP3 */
+//    function &addSubPart($body, $params) {
+    function addSubPart($body, $params) {
+      $this->_subparts[] = new mime($body, $params);
+
+      return $this->_subparts[count($this->_subparts) - 1];
+    }
+
+/**
+ * _getEncodedData()
+ *
+ * Returns encoded data based upon encoding passed to it
+ *
+ * @param $data     The data to encode.
+ * @param $encoding The encoding type to use, 7bit, base64,
+ *                  or quoted-printable.
+ * @access private
+ */
+
+    function _getEncodedData($data, $encoding) {
+      switch ($encoding) {
+       case '7bit':
+         return $data;
+         break;
+       case 'quoted-printable':
+         return $this->_quotedPrintableEncode($data);
+         break;
+       case 'base64':
+         return rtrim(chunk_split(base64_encode($data), 76, $this->lf));
+         break;
+      }
+    }
+
+/**
+ * quoteadPrintableEncode()
+ *
+ * Encodes data to quoted-printable standard.
+ *
+ * @param $input    The data to encode
+ * @param $line_max Optional max line length. Should
+ *                  not be more than 76 chars
+ *
+ * @access private
+ */
+
+    function _quotedPrintableEncode($input , $line_max = 76) {
+      $lines = preg_split("/\r\n|\r|\n/", $input);
+      $eol = $this->lf;
+      $escape = '=';
+      $output = '';
+
+      while (list(, $line) = each($lines)) {
+        $linlen = strlen($line);
+        $newline = '';
+
+        for ($i = 0; $i < $linlen; $i++) {
+          $char = substr($line, $i, 1);
+          $dec = ord($char);
+
+// convert space at eol only
+          if ( ($dec == 32) && ($i == ($linlen - 1)) ) {
+            $char = '=20';
+          } elseif ($dec == 9) {
+// Do nothing if a tab.
+          } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) {
+            $char = $escape . strtoupper(sprintf('%02s', dechex($dec)));
+          }
+
+// $this->lf is not counted
+          if ((strlen($newline) + strlen($char)) >= $line_max) {
+// soft line break; " =\r\n" is okay
+            $output .= $newline . $escape . $eol;
+            $newline = '';
+          }
+          $newline .= $char;
+        }
+        $output .= $newline . $eol;
+      }
+// Don't want last crlf
+      $output = substr($output, 0, -1 * strlen($eol));
+
+      return $output;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/object_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/object_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/object_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: object_info.php,v 1.1.1.1 2004/03/04 23:39:45 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class objectInfo {
+
+// class constructor
+    function objectInfo($object_array) {
+      reset($object_array);
+      while (list($key, $value) = each($object_array)) {
+        $this->$key = tep_db_prepare_input($value);
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/order.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/order.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/order.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,466 @@
+<?php
+/*
+  $Id: order.php,v 1.1.1.1 2004/03/04 23:39:45 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class order {
+    var $info, $totals, $products, $customer, $delivery, $content_type, $states, $country, $s_states, $s_country, $b_states, $b_country ;
+
+    function order($order_id = '') {
+      $this->info = array();
+      $this->totals = array();
+      $this->products = array();
+      $this->customer = array();
+      $this->delivery = array();
+      $this->billing = array();
+      
+      
+      if (tep_not_null($order_id)) {
+        $this->query($order_id);
+      } else {
+        $this->cart();
+      }
+    }
+
+    function query($order_id) {
+      global $languages_id;
+//begin PayPal_Shopping_Cart_IPN
+      $order_id = tep_db_prepare_input($order_id);
+      $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_ccv, cc_expires, currency, currency_value, date_purchased, orders_status, ipaddy, ipisp,  last_modified, payment_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
+//end PayPal_Shopping_Cart_IPN
+      $order = tep_db_fetch_array($order_query);
+
+      $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
+      while ($totals = tep_db_fetch_array($totals_query)) {
+        $this->totals[] = array('title' => $totals['title'],
+                                'text' => $totals['text']);
+      }
+
+// begin PayPal_Shopping_Cart_IPN V2.8 DMG
+      $order_total_query = tep_db_query("select text, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_total'");
+// end PayPal_Shopping_Cart_IPN
+      $order_total = tep_db_fetch_array($order_total_query);
+
+//begin PayPal_Shopping_Cart_IPN V2.8 DMG
+      $shipping_method_query = tep_db_query("select title, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_shipping'");
+//end PayPal_Shopping_Cart_IPN
+      $shipping_method = tep_db_fetch_array($shipping_method_query);
+
+      $order_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order['orders_status'] . "' and language_id = '" . (int)$languages_id . "'");
+      $order_status = tep_db_fetch_array($order_status_query);
+      $this->info = array('currency' => $order['currency'],
+                          'currency_value' => $order['currency_value'],
+                          'payment_method' => $order['payment_method'],
+                          'cc_type' => $order['cc_type'],
+                          'cc_owner' => $order['cc_owner'],
+                          'cc_number' => $order['cc_number'],
+                          'cc_start' => $order['cc_start'],
+                          'cc_issue' => $order['cc_issue'],
+                          'cc_ccv' => $order['cc_ccv'],
+                          'cc_expires' => $order['cc_expires'],
+                          'date_purchased' => $order['date_purchased'],
+                          //begin PayPal_Shopping_Cart_IPN
+                          'payment_id' => $order['payment_id'],
+                          //end PayPal_Shopping_Cart_IPN
+                          'orders_status' => $order['orders_status'],
+                          'shipping_cost' => $shipping_method['value'],
+                          'total_value' => $order_total['value'],
+//end PayPal_Shopping_Cart_IPN
+                          'orders_status' => $order_status['orders_status_name'],
+                          'orders_status_number' => $order['orders_status'],
+                          'last_modified' => $order['last_modified'],
+                          'total' => strip_tags($order_total['text']),
+                          'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])));
+
+      $this->customer = array('name' => $order['customers_name'],
+                              //begin PayPal_Shopping_Cart_IPN
+                              'id' => $order['customers_id'],
+                              //end PayPal_Shopping_Cart_IPN
+                              'company' => $order['customers_company'],
+                              'street_address' => $order['customers_street_address'],
+                              'suburb' => $order['customers_suburb'],
+                              'city' => $order['customers_city'],
+                              'postcode' => $order['customers_postcode'],
+                              'state' => $order['customers_state'],
+                              'country' => $order['customers_country'],
+                              'format_id' => $order['customers_address_format_id'],
+                              'telephone' => $order['customers_telephone'],
+                              'email_address' => $order['customers_email_address'],
+                              'ipaddy' => $order['ipaddy'],
+            'ipisp' => $order['ipisp']);
+                
+
+      $this->delivery = array('name' => $order['delivery_name'],
+                              'company' => $order['delivery_company'],
+                              'street_address' => $order['delivery_street_address'],
+                              'suburb' => $order['delivery_suburb'],
+                              'city' => $order['delivery_city'],
+                              'postcode' => $order['delivery_postcode'],
+                              'state' => $order['delivery_state'],
+                              'country' => $order['delivery_country'],
+                              'format_id' => $order['delivery_address_format_id']);
+
+      if (empty($this->delivery['name']) && empty($this->delivery['street_address'])) {
+        $this->delivery = false;
+      }
+
+      $this->billing = array('name' => $order['billing_name'],
+                             'company' => $order['billing_company'],
+                             'street_address' => $order['billing_street_address'],
+                             'suburb' => $order['billing_suburb'],
+                             'city' => $order['billing_city'],
+                             'postcode' => $order['billing_postcode'],
+                             'state' => $order['billing_state'],
+                             'country' => $order['billing_country'],
+                             'format_id' => $order['billing_address_format_id']);
+
+      $index = 0;
+      $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
+      while ($orders_products = tep_db_fetch_array($orders_products_query)) {
+       $this->products[$index] = array('qty' => $orders_products['products_quantity'],
+                                  'id' => $orders_products['products_id'],
+//begin PayPal_Shopping_Cart_IPN
+                                        'orders_products_id' => $orders_products['orders_products_id'],
+//end PayPal_Shopping_Cart_IPN
+                                        'name' => $orders_products['products_name'],
+                                        'model' => $orders_products['products_model'],
+                                        'tax' => $orders_products['products_tax'],
+                                        'price' => $orders_products['products_price'],
+                                        'final_price' => $orders_products['final_price']);
+
+  // Eversun mod for sppc and qty price breaks
+  if(!tep_session_is_registered('sppc_customer_group_id')) {
+    $customer_group_id = '0';
+  } else {
+    $customer_group_id = $sppc_customer_group_id;
+  }
+  if ($customer_group_id != '0'){
+    $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id . "' and products_id = '" . $products[$i]['id'] . "'");
+    if ($orders_customers = tep_db_fetch_array($orders_customers_price)){
+      $this->products[$index] = array('price' => $orders_customers['customers_group_price'], 'final_price' => $orders_customers['customers_group_price']);
+    }
+  }
+// Eversun mod for sppc and qty price breaks
+
+        $subindex = 0;
+//      $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
+        //begin PayPal_Shopping_Cart_IPN V2.8 DMG
+        $attributes_query = tep_db_query("select products_options_id, products_options, products_options_values_id, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
+        //end PayPal_Shopping_Cart_IPN
+        if (tep_db_num_rows($attributes_query)) {
+          while ($attributes = tep_db_fetch_array($attributes_query)) {
+            $this->products[$index]['attributes'][$subindex] = array(
+//begin PayPal_Shopping_Cart_IPN
+                                  'option_id' => $attributes['products_options_id'],
+                                  'value_id' => $attributes['products_options_values_id'],
+//end PayPal_Shopping_Cart_IPN
+                                  'value' => $attributes['products_options_values'],
+                                  'option' => $attributes['products_options'],
+                                  'option_name' => $attributes['products_options_name'],
+                                  'prefix' => $attributes['price_prefix'],
+                                  'price' => $attributes['options_values_price']);
+
+            $subindex++;
+          }
+        }
+
+        $this->info['tax_groups']["{$this->products[$index]['tax']}"] = '1';
+   //     $this->info['tax_groups'] = '1';
+        $index++;
+      }
+    }
+
+    function cart() {
+       global $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment, $statea, $country_title_s, $format_id_s;
+ 
+       $this->content_type = $cart->get_content_type();
+      $this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,
+                          'currency' => $currency,
+                          'currency_value' => $currencies->currencies[$currency]['value'],
+                          'payment_method' => $payment,
+                          'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),
+                          'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),
+                          'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),
+                          'cc_ccv' => (isset($GLOBALS['cc_ccv']) ? $GLOBALS['cc_ccv'] : ''),
+                          'cc_start' => (isset($GLOBALS['cc_start']) ? $GLOBALS['cc_start'] : ''),
+                          'cc_issue' => (isset($GLOBALS['cc_issue']) ? $GLOBALS['cc_issue'] : ''),
+                          'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),
+                          'shipping_method' => $shipping['title'],
+                          'shipping_cost' => $shipping['cost'],
+                          'subtotal' => 0,
+                          'tax' => 0,
+                          'tax_groups' => array(),
+                          'comments' => (isset($GLOBALS['comments']) ? $GLOBALS['comments'] : ''));
+
+      if (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment])) {
+        $this->info['payment_method'] = $GLOBALS[$payment]->title;
+
+        if ( isset($GLOBALS[$payment]->order_status) && is_numeric($GLOBALS[$payment]->order_status) && ($GLOBALS[$payment]->order_status > 0) ) {
+          $this->info['order_status'] = $GLOBALS[$payment]->order_status;
+        }
+      }
+// Get cutomeradress info
+      $customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, ab.entry_state, ab.entry_country_id from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab  where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and c.customers_default_address_id = ab.address_book_id"); 
+ while ( $customer_address = tep_db_fetch_array($customer_address_query) ){
+ 
+$customer_country_query = tep_db_query("select co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id from " . TABLE_COUNTRIES . " co  where co.countries_id = '" . $customer_address['entry_country_id'] . "'");
+ while ($customer_country = tep_db_fetch_array($customer_country_query) ) { 
+                              $country_array = array('id' => $customer_country['countries_id'], 'title' => $customer_country['countries_name'], 'iso_code_2' => $customer_country['countries_iso_code_2'], 'iso_code_3' => $customer_country['countries_iso_code_3']); 
+  $customer_zone_query = tep_db_query("select z.zone_name from " . TABLE_ZONES . " z where z.zone_id ='" . $customer_address['entry_zone_id'] . "' ");
+               if (tep_not_null($customer_address['entry_state'])){
+                   $states = $customer_address['entry_state']; 
+                  }else{
+       while ($customer_zone1 = tep_db_fetch_array($customer_zone_query) ) { 
+                   $states = $customer_zone1['zone_name'];
+                   }
+                }
+                
+                
+//build customer info array
+  $this->customer = array('firstname' => $customer_address['customers_firstname'],
+                              'lastname' => $customer_address['customers_lastname'],
+                              'company' => $customer_address['entry_company'],
+                              'street_address' => $customer_address['entry_street_address'],
+                              'suburb' => $customer_address['entry_suburb'],
+                              'city' => $customer_address['entry_city'],
+                              'postcode' => $customer_address['entry_postcode'],
+                              'state' => $states,
+                              'zone_id' => $customer_address['entry_zone_id'],
+                              'country' => $country_array, 
+                              'country_id' => $customer_address['entry_country_id'],
+                              'format_id' => $customer_country['address_format_id'],
+                              'telephone' => $customer_address['customers_telephone'],
+                              'email_address' => $customer_address['customers_email_address'],
+                              );
+
+}
+}
+     $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, ab.entry_country_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$sendto . "'");
+ while ($shipping_address = tep_db_fetch_array($shipping_address_query) ){
+
+    $shipping_zone_query= tep_db_query("select co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id from "  . TABLE_COUNTRIES . " co  where co.countries_id = '" . $shipping_address['entry_country_id'] ."'");
+   while ($shipping_zone = tep_db_fetch_array($shipping_zone_query) ) {
+                                   $s_country = array('id' => $shipping_zone['countries_id'], 'title' => $shipping_zone['countries_name'], 'iso_code_2' => $shipping_zone['countries_iso_code_2'], 'iso_code_3' => $shipping_zone['countries_iso_code_3']);
+                    
+
+      $shipping_zone_query1= tep_db_query("select  z.zone_name from " . TABLE_ZONES . " z where z.zone_id = '" . $shipping_address['entry_zone_id'] . "' ");
+               if (tep_not_null($shipping_address['entry_state'])){
+                            $s_states = $shipping_address['entry_state']; 
+                                }else{
+                   while ($shipping_zone1 = tep_db_fetch_array($shipping_zone_query1) ) {
+                                  $s_states = $shipping_zone1['zone_name'];
+                                  }
+                                }  
+                                
+$this->delivery = array('firstname' => $shipping_address['entry_firstname'],
+                              'lastname' => $shipping_address['entry_lastname'],
+                              'company' => $shipping_address['entry_company'],
+                              'street_address' => $shipping_address['entry_street_address'],
+                              'suburb' => $shipping_address['entry_suburb'],
+                              'city' => $shipping_address['entry_city'],
+                              'postcode' => $shipping_address['entry_postcode'],
+                              'state' => $s_states,
+                              'zone_id' => $shipping_address['entry_zone_id'],
+                              'country' =>  $s_country,
+                              'country_id' => $shipping_address['entry_country_id'],
+                              'format_id' => $shipping_zone['address_format_id']);
+  
+  }
+ }
+//}
+      $billing_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, ab.entry_country_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$billto . "'");
+      while ($billing_address = tep_db_fetch_array($billing_address_query) ){
+ 
+     
+        $billing_zone_query= tep_db_query("select co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id from " . TABLE_COUNTRIES . " co  where co.countries_id = '" . $billing_address['entry_country_id'] ."'");
+        while ($billing_zone = tep_db_fetch_array($billing_zone_query) ){
+                 $b_country = array('id' => $billing_zone['countries_id'], 'title' => $billing_zone['countries_name'], 'iso_code_2' => $billing_zone['countries_iso_code_2'], 'iso_code_3' => $billing_zone['countries_iso_code_3']);
+                   
+       $billing_zone_query1= tep_db_query("select z.zone_name from " . TABLE_ZONES . " z where z.zone_id ='" . $billing_address['entry_zone_id'] . "' ");
+         if (tep_not_null($billing_address['entry_state'])){
+                  $b_state = $billing_address['entry_state']; 
+              }else{
+          while ($billing_zone1 = tep_db_fetch_array($billing_zone_query1) ){
+              $b_state = $billing_zone1['zone_name'];
+              }
+           }
+      $this->billing = array('firstname' => $billing_address['entry_firstname'],
+                             'lastname' => $billing_address['entry_lastname'],
+                             'company' => $billing_address['entry_company'],
+                             'street_address' => $billing_address['entry_street_address'],
+                             'suburb' => $billing_address['entry_suburb'],
+                             'city' => $billing_address['entry_city'],
+                             'postcode' => $billing_address['entry_postcode'],
+                              'state' => $b_state,
+                              'zone_id' => $billing_address['entry_zone_id'],
+                              'country' => $b_country,
+                              'country_id' => $billing_address['entry_country_id'],
+                              'format_id' => $billing_zone['address_format_id']);
+  } 
+}
+      $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'");
+      $tax_address = tep_db_fetch_array($tax_address_query);
+    
+    $index = 0;
+      $products = $cart->get_products();
+      for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+        $this->products[$index] = array('qty' => $products[$i]['quantity'],
+                                        'name' => $products[$i]['name'],
+                                        'model' => $products[$i]['model'],
+                                        'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
+                                        'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
+                                        'price' => $products[$i]['price'],
+                                        'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
+                                        'weight' => $products[$i]['weight'],
+                                        'id' => $products[$i]['id']);
+        if ($products[$i]['attributes']) {
+          $subindex = 0;
+          reset($products[$i]['attributes']);
+          while (list($option, $value) = each($products[$i]['attributes'])) {
+            // BOM - Options Catagories
+            /*
+            $attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
+            $attributes = tep_db_fetch_array($attributes_query);
+
+            $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
+                                                                     'value' => $attributes['products_options_values_name'],
+                                                                     'option_id' => $option,
+                                                                     'value_id' => $value,
+                                                                     'prefix' => $attributes['price_prefix'],
+                                                                     'price' => $attributes['options_values_price']);
+
+            $subindex++;
+            */
+            if ( !is_array($value) ) {
+              $attributes_query = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, ov.products_options_values_name, op.options_values_price as price, op.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " op   
+                                                from " . TABLE_PRODUCTS_ATTRIBUTES . " op,
+                                                     " . TABLE_PRODUCTS_OPTIONS . " o,
+                                                     " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot,
+                                                     " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov
+                                                where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                                  and op.options_values_id = '" . $value . "'
+                                                  and op.options_id = '" . $option . "'
+                                                  and op.options_id = o.products_options_id
+                                                  and op.options_values_id = ov.products_options_values_id
+                                                  and ov.language_id = '" . (int)$languages_id . "'
+                                                  and op.options_id = ot.products_options_text_id
+                                                  and ot.language_id = '" . (int)$languages_id . "'
+                                               ");
+              $attributes = tep_db_fetch_array($attributes_query);
+              $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
+                                                                       'value' => $attributes['products_options_values_name'],
+                                                                       'option_id' => $option,
+                                                                       'value_id' => $value,
+                                                                       'prefix' => $attributes['price_prefix'],
+                                                                       'price' => $attributes['price']);
+              $subindex++;
+            } elseif ( isset($value['c'] ) ) {
+              foreach ($value['c'] as $v) {
+                $attributes_query = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, ov.products_options_values_name, op.options_values_price as price, op.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " op   
+                                                  from " . TABLE_PRODUCTS_ATTRIBUTES . " op,
+                                                     " . TABLE_PRODUCTS_OPTIONS . " o,
+                                                     " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot,
+                                                     " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov
+                                                  where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                                    and op.options_values_id = '" . $v . "'
+                                                    and op.options_id = '" . $option . "'
+                                                    and op.options_id = o.products_options_id
+                                                    and op.options_values_id = ov.products_options_values_id
+                                                    and ov.language_id = '" . (int)$languages_id . "'
+                                                    and op.options_id = ot.products_options_text_id
+                                                    and ot.language_id = '" . (int)$languages_id . "'
+                                                 ");
+                $attributes = tep_db_fetch_array($attributes_query);
+                $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
+                                                                       'value' => $attributes['products_options_values_name'],
+                                                                       'option_id' => $option,
+                                                                       'value_id' => $v,
+                                                                       'prefix' => $attributes['price_prefix'],
+                                                                       'price' => $attributes['price']);
+                $subindex++;
+              }
+            } elseif ( isset($value['t'] ) ) {
+              $attributes_query = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, op.options_values_price as price, op.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " op   
+                                                from " . TABLE_PRODUCTS_ATTRIBUTES . " op,
+                                                     " . TABLE_PRODUCTS_OPTIONS . " o,
+                                                     " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot
+                                                where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                                  and op.options_id = '" . $option . "'
+                                                  and op.options_id = o.products_options_id
+                                                  and op.options_id = ot.products_options_text_id
+                                                  and ot.language_id = '" . (int)$languages_id . "'
+                                               ");
+              $attributes = tep_db_fetch_array($attributes_query);
+              $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
+                                                                       'value' => $value['t'],
+                                                                       'option_id' => $option,
+                                                                       'value_id' => '0',
+                                                                       'prefix' => $attributes['price_prefix'],
+                                                                       'price' => $attributes['price']);
+              $subindex++;
+            }
+// EOM - Options Catagories
+          }
+        }
+
+        $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
+        $this->info['subtotal'] += $shown_price;
+
+        $products_tax = $this->products[$index]['tax'];
+        $products_tax_description = $this->products[$index]['tax_description'];
+       
+      // Eversun mod for sppc and qty price breaks
+//       if (DISPLAY_PRICE_WITH_TAX == 'true') {
+    global $sppc_customer_group_show_tax;
+    if(!tep_session_is_registered('sppc_customer_group_show_tax')) {
+      $customer_group_show_tax = '1';
+    } else {
+      $customer_group_show_tax = $sppc_customer_group_show_tax;
+    }
+    if (DISPLAY_PRICE_WITH_TAX == 'true' && $customer_group_show_tax == '1') {
+// Eversun mod for sppc and qty price breaks
+
+          $this->info['tax'] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
+          if (isset($this->info['tax_groups']["$products_tax_description"])) {
+            $this->info['tax_groups']["$products_tax_description"] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
+          } else {
+            $this->info['tax_groups']["$products_tax_description"] = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
+          }
+        } else {
+          $this->info['tax'] += ($products_tax / 100) * $shown_price;
+          if (isset($this->info['tax_groups']["$products_tax_description"])) {
+            $this->info['tax_groups']["$products_tax_description"] += ($products_tax / 100) * $shown_price;
+          } else {
+            $this->info['tax_groups']["$products_tax_description"] = ($products_tax / 100) * $shown_price;
+          }
+        }
+
+        $index++;
+      }
+
+      
+       //Eversun mod for sppc and qty price breaks
+//      if (DISPLAY_PRICE_WITH_TAX == 'true') {
+  global $sppc_customer_group_show_tax;
+        if(!tep_session_is_registered('sppc_customer_group_show_tax')) {
+        $customer_group_show_tax = '1';
+        } else {
+        $customer_group_show_tax = $sppc_customer_group_show_tax;
+        }
+        if ((DISPLAY_PRICE_WITH_TAX == 'true') && ($customer_group_show_tax == '1')) {
+// Eversun mod for sppc and qty price breaks
+        $this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];
+      } else {
+        $this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];
+      }
+    }
+
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/payment_module_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/payment_module_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/payment_module_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+  class paymentModuleInfo {
+    var $payment_code, $keys;
+
+// class constructor
+    function paymentModuleInfo($pmInfo_array) {
+      $this->payment_code = $pmInfo_array['payment_code'];
+
+      for ($i = 0, $n = sizeof($pmInfo_array) - 1; $i < $n; $i++) {
+        $key_value_query = tep_db_query("select configuration_title, configuration_value, configuration_description from " . TABLE_CONFIGURATION . " where configuration_key = '" . $pmInfo_array[$i] . "'");
+        $key_value = tep_db_fetch_array($key_value_query);
+
+        $this->keys[$pmInfo_array[$i]]['title'] = $key_value['configuration_title'];
+        $this->keys[$pmInfo_array[$i]]['value'] = $key_value['configuration_value'];
+        $this->keys[$pmInfo_array[$i]]['description'] = $key_value['configuration_description'];
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/phplot.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/phplot.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/phplot.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,2656 @@
+<?php
+/*
+  $Id: phplot.php,v 1.1.1.1 2004/03/04 23:39:48 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  PHPLOT 4.4.6 Copyright (c) 1998-2001 Afan Ottenheimer
+*/
+
+class PHPlot{
+
+  var $is_inline = 0;     //0 = Sends headers, 1 = sends just raw image data
+  var $browser_cache = '1'; // 0 = Sends headers for browser to not cache the image, (i.e. 0 = don't let browser cache image)
+                  // (only if is_inline = 0 also)
+  var $session_set = '';    //Do not change
+  var $scale_is_set = '';   //Do not change
+  var $draw_plot_area_background = '';
+
+  var $image_width; //Total Width in Pixels
+  var $image_height;  //Total Height in Pixels
+  var $image_border_type = ''; //raised, plain, ''
+  var $x_left_margin;
+  var $y_top_margin;
+  var $x_right_margin;
+  var $y_bot_margin;
+  var $plot_area = array(5,5,600,400);
+  var $x_axis_position = 0; //Where to draw the X_axis (world coordinates)
+  var $y_axis_position = '';  //Leave blank for Y axis at left of plot. (world coord.)
+  var $xscale_type = 'linear';  //linear or log
+  var $yscale_type = 'linear';
+
+//Use for multiple plots per image
+  var $print_image = 1;  //Used for multiple charts per image.
+
+//Fonts
+  var $use_ttf  = 0;      //Use TTF fonts (1) or not (0)
+  var $font_path = './';  //To be added
+  var $font = './benjamingothic.ttf';
+
+  ///////////Fonts: Small/Generic
+  var $small_ttffont_size = 12; //
+  //non-ttf
+  var $small_font = 2; // fonts = 1,2,3,4 or 5
+  var $small_font_width = 6.0; // width in pixels (2=6,3=8,4=8)
+  var $small_font_height = 8.0; // height in pixels (2=8,3=10,4=12)
+
+  //////////   Fonts:Title
+  var $title_ttffont = './benjamingothic.ttf';
+  var $title_ttffont_size = 14;
+  var $title_angle= 0;
+  //non-ttf
+  var $title_font = '4'; // fonts = 1,2,3,4,5
+
+  //////////////  Fonts:Axis
+  var $axis_ttffont = './benjamingothic.ttf';
+  var $axis_ttffont_size = 8;
+  var $x_datalabel_angle = 0;
+  //non-ttf
+  var $axis_font = 2;
+
+  ////////////////Fonts:Labels of Data
+  var $datalabel_font = '2';
+
+  //////////////// Fonts:Labels (Axis Titles)
+  var $x_label_ttffont = './benjamingothic.ttf';
+  var $x_label_ttffont_size = '12';
+  var $x_label_angle = '0';
+
+  var $y_label_ttffont = './benjamingothic.ttf';
+  var $y_label_ttffont_size = '12';
+  var $y_label_angle = 90;
+  var $y_label_width = '';
+
+//Formats
+  var $file_format = 'png';
+  var $file_name = '';  //For output to a file instead of stdout
+
+//Plot Colors
+  var $shading = 0;
+  var $color_array = 1; //1 = include small list
+              //2 = include large list
+              //array =  define your own color translation. See rgb.inc.php and SetRGBArray
+  var $bg_color;
+  var $plot_bg_color;
+  var $grid_color;
+  var $light_grid_color;
+  var $tick_color;
+  var $title_color;
+  var $label_color;
+  var $text_color;
+  var $i_light = '';
+
+//Data
+  var $data_type = 'text-data'; //text-data, data-data-error, data-data
+  var $plot_type= 'linepoints'; //bars, lines, linepoints, area, points, pie, thinbarline
+  var $line_width = 2;
+  var $line_style = array('solid','solid','solid','dashed','dashed','solid'); //Solid or dashed lines
+
+  var $data_color = ''; //array('blue','green','yellow',array(0,0,0));
+  var $data_border_color = '';
+
+  var $label_scale_position = '.5';  //1 = top, 0 = bottom
+  var $group_frac_width = '.7'; //value from 0 to 1 = width of bar
+  var $bar_width_adjust = '1'; //1 = bars of normal width, must be > 0
+
+  var $point_size = 10;
+  var $point_shape = 'diamond'; //rect,circle,diamond,triangle,dot,line,halfline
+  var $error_bar_shape = 'tee'; //tee, line
+  var $error_bar_size = 5; //right left size of tee
+  var $error_bar_line_width = ''; //If set then use it, else use $line_width for thickness
+  var $error_bar_color = '';
+  var $data_values;
+
+  var $plot_border_type = 'full'; //left, none, full
+  var $plot_area_width = '';
+  var $number_x_points;
+  var $plot_min_x; // Max and min of the plot area
+  var $plot_max_x= ''; // Max and min of the plot area
+  var $plot_min_y= ''; // Max and min of the plot area
+  var $plot_max_y = ''; // Max and min of the plot area
+  var $min_y = '';
+  var $max_y = '';
+  var $max_x = 10;  //Must not be = 0;
+  var $y_precision = '1';
+  var $x_precision = '1';
+  var $si_units = '';
+
+//Labels
+  var $draw_data_labels = '0';
+  var $legend = '';  //an array
+  var $legend_x_pos = '';
+  var $legend_y_pos = '';
+  var $title_txt = "";
+  var $y_label_txt = '';
+  var $x_label_txt = "";
+
+//DataAxis Labels (on each axis)
+  var $y_grid_label_type = 'data';    //data, none, time, other
+  var $y_grid_label_pos = 'plotleft'; //plotleft, plotright, yaxis, both
+  var $x_grid_label_type = 'data';    //data, title, none, time, other
+  var $draw_x_data_labels = '';       // 0=false, 1=true, ""=let program decide
+  var $x_time_format = "%H:%m:%s";    //See http://www.php.net/manual/html/function.strftime.html
+  var $x_datalabel_maxlength = 10;
+
+//Tick Formatting
+  var $tick_length = '10';   //pixels: tick length from axis left/downward
+  //tick_length2 to be implemented
+  //var $tick_length2 = '';  //pixels: tick length from axis line rightward/upward
+  var $draw_vert_ticks = 1;  //1 = draw ticks, 0 = don't draw ticks
+  var $num_vert_ticks = '';
+  var $vert_tick_increment=''; //Set num_vert_ticks or vert_tick_increment, not both.
+  var $vert_tick_position = 'both'; //plotright=(right of plot only), plotleft=(left of plot only),
+                //both = (both left and right of plot), yaxis=(crosses y axis)
+  var $horiz_tick_increment=''; //Set num_horiz_ticks or horiz_tick_increment, not both.
+  var $num_horiz_ticks='';
+  var $skip_top_tick = '0';
+  var $skip_bottom_tick = '0';
+
+//Grid Formatting
+  var $draw_x_grid = 0;
+  var $draw_y_grid = 1;
+
+
+//BEGIN CODE
+//////////////////////////////////////////////////////
+  //Constructor: Setup Img pointer, Colors and Size of Image
+  function PHPlot($which_width=600,$which_height=400,$which_output_file="",$which_input_file="") {
+
+    $this->SetRGBArray('2');
+    $this->background_done = 0; //Set to 1 after background image first drawn
+
+    if ($which_output_file != "") { $this->SetOutputFile($which_output_file);  };
+
+    if ($which_input_file != "") {
+      $this->SetInputFile($which_input_file) ;
+    } else {
+      $this->SetImageArea($which_width, $which_height);
+      $this->InitImage();
+    }
+
+    if ( ($this->session_set == 1) && ($this->img == "") ) {  //For sessions
+      //Do nothing
+    } else {
+      $this->SetDefaultColors();
+    }
+
+    $this->SetIndexColors();
+
+  }
+
+  //Set up the image and colors
+  function InitImage() {
+    //if ($this->img) {
+    //  ImageDestroy($this->img);
+    //}
+    $this->img = ImageCreate($this->image_width, $this->image_height);
+    return true;
+  }
+
+  function SetBrowserCache($which_browser_cache) {  //Submitted by Thiemo Nagel
+    $this->browser_cache = $which_browser_cache;
+    return true;
+  }
+
+  function SetPrintImage($which_pi) {
+    $this->print_image = $which_pi;
+    return true;
+  }
+
+  function SetIsInline($which_ii) {
+    $this->is_inline = $which_ii;
+    return true;
+  }
+
+  function SetUseTTF($which_ttf) {
+    $this->use_ttf = $which_ttf;
+    return true;
+  }
+
+  function SetTitleFontSize($which_tfs) {
+    //TTF
+    $this->title_ttffont_size = $which_tfs; //pt size
+
+    //Non-TTF settings
+    if (($which_tfs > 5) && (!$this->use_ttf)) {
+      //$this->DrawError('Non-TTF font size must be 1,2,3,4 or 5');
+      $this->DrawError(NON_TTF_FONT_ERROR);
+      return false;
+    } else {
+      $this->title_font = $which_tfs;
+      //$this->title_font_height = ImageFontHeight($which_tfs) // height in pixels
+      //$this->title_font_width = ImageFontWidth($which_tfs); // width in pixels
+    }
+    return true;
+  }
+
+  function SetLineStyles($which_sls){
+    $this->line_style = $which_sls;
+    return true;
+  }
+
+  function SetLegend($which_leg){
+    if (is_array($which_leg)) {
+      $this->legend = $which_leg;
+      return true;
+    } else {
+      //$this->DrawError('Error: SetLegend argument must be an array');
+      $this->DrawError(SETLEGEND_ERROR);
+      return false;
+    }
+  }
+
+  function SetLegendPixels($which_x,$which_y,$which_type) {
+    //which_type not yet used
+    $this->legend_x_pos = $which_x;
+    $this->legend_y_pos = $which_y;
+    return true;
+  }
+
+  function SetLegendWorld($which_x,$which_y,$which_type='') {
+    //which_type not yet used
+    //Must be called after scales are set up.
+    if ($this->scale_is_set != 1) { $this->SetTranslation(); };
+    $this->legend_x_pos = $this->xtr($which_x);
+    $this->legend_y_pos = $this->ytr($which_y);
+    return true;
+  }
+/* ***************************************
+  function SetFileFormat($which_file_format) { //Only works with PHP4
+    $asked = strtolower($which_file_format);
+    if( $asked =="jpg" || $asked =="png" || $asked =="gif" || $asked =="wbmp" ) {
+      if( $asked=="jpg" && !(imagetypes() & IMG_JPG) )
+        return false;
+      elseif( $asked=="png" && !(imagetypes() & IMG_PNG) )
+        return false;
+      elseif( $asked=="gif" && !(imagetypes() & IMG_GIF) )
+        return false;
+      elseif( $asked=="wbmp" && !(imagetypes() & IMG_WBMP) )
+        return false;
+      else {
+        $this->img_format=$asked;
+        return true;
+      }
+    }
+    else
+      return false;
+  }
+
+*************************************** */
+  function SetFileFormat($which_file_format) {
+  //eventually test to see if that is supported - if not then return false
+    $asked = strtolower(trim($which_file_format));
+    if( ($asked=='jpg') || ($asked=='png') || ($asked=='gif') || ($asked=='wbmp') ) {
+      $this->file_format = $asked;
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  function SetInputFile($which_input_file) {
+    //$this->SetFileFormat($which_frmt);
+    $size = GetImageSize($which_input_file);
+    $input_type = $size[2];
+
+    switch($input_type) {  //After SetFileFormat is in lower case
+      case "1":
+        $im = @ImageCreateFromGIF ($which_input_file);
+        if (!$im) { // See if it failed
+          //$this->PrintError("Unable to open $which_input_file as a GIF");
+          $this->PrintError(UNABLE_TO_OPEN_ERROR. $which_input_file. UNABLE_TO_OPEN_GIF_ERROR);
+          return false;
+        }
+      break;
+      case "3":
+        $im = @ImageCreateFromPNG ($which_input_file);
+        if (!$im) { // See if it failed
+          //$this->PrintError("Unable to open $which_input_file as a PNG");
+          $this->PrintError(UNABLE_TO_OPEN_ERROR. $which_input_file .UNABLE_TO_OPEN_PNG_ERROR);
+          return false;
+        }
+      break;
+      case "2":
+        $im = @ImageCreateFromJPEG ($which_input_file);
+        if (!$im) { // See if it failed
+          $this->PrintError(UNABLE_TO_OPEN_ERROR.$which_input_file .UNABLE_TO_OPEN_JPG_ERROR);
+          return false;
+        }
+      break;
+      default:
+        //$this->PrintError('Please select wbmp,gif,jpg, or png for image type!');
+        $this->PrintError(SELECT_IMAGE_ERROR);
+        return false;
+      break;
+    }
+
+    //Get Width and Height of Image
+    $this->SetImageArea($size[0],$size[1]);
+
+    $this->img = $im;
+
+    return true;
+
+  }
+
+  function SetOutputFile($which_output_file) {
+    $this->output_file = $which_output_file;
+    return true;
+  }
+
+  function SetImageArea($which_iw,$which_ih) {
+    //Note this is now an Internal function - please set w/h via PHPlot()
+    $this->image_width = $which_iw;
+    $this->image_height = $which_ih;
+
+    return true;
+  }
+
+
+  function SetYAxisPosition($which_pos) {
+    $this->y_axis_position = $which_pos;
+    return true;
+  }
+  function SetXAxisPosition($which_pos) {
+    $this->x_axis_position = $which_pos;
+    return true;
+  }
+  function SetXTimeFormat($which_xtf) {
+    $this->x_time_format = $which_xtf;
+    return true;
+  }
+  function SetXDataLabelMaxlength($which_xdlm) {
+    if ($which_xdlm >0 ) {
+      $this->x_datalabel_maxlength = $which_xdlm;
+      return true;
+    } else {
+      return false;
+    }
+  }
+  function SetXDataLabelAngle($which_xdla) {
+    $this->x_datalabel_angle = $which_xdla;
+    return true;
+  }
+  function SetXScaleType($which_xst) {
+    $this->xscale_type = $which_xst;
+    return true;
+  }
+  function SetYScaleType($which_yst) {
+    $this->yscale_type = $which_yst;
+    if ($this->x_axis_position <= 0) {
+      $this->x_axis_position = 1;
+    }
+    return true;
+  }
+
+  function SetPrecisionX($which_prec) {
+    $this->x_precision = $which_prec;
+    return true;
+  }
+  function SetPrecisionY($which_prec) {
+    $this->y_precision = $which_prec;
+    return true;
+  }
+
+
+  function SetIndexColors() { //Internal Method called to set colors and preserve state
+    //These are the colors of the image that are used. They are initialized
+    //to work with sessions and PHP.
+
+    $this->ndx_i_light = $this->SetIndexColor($this->i_light);
+    $this->ndx_i_dark  = $this->SetIndexColor($this->i_dark);
+    $this->ndx_bg_color= $this->SetIndexColor($this->bg_color);
+    $this->ndx_plot_bg_color= $this->SetIndexColor($this->plot_bg_color);
+
+    $this->ndx_title_color= $this->SetIndexColor($this->title_color);
+    $this->ndx_tick_color= $this->SetIndexColor($this->tick_color);
+    $this->ndx_label_color= $this->SetIndexColor($this->label_color);
+    $this->ndx_text_color= $this->SetIndexColor($this->text_color);
+    $this->ndx_light_grid_color= $this->SetIndexColor($this->light_grid_color);
+    $this->ndx_grid_color= $this->SetIndexColor($this->grid_color);
+
+    reset($this->error_bar_color);
+    unset($ndx_error_bar_color);
+    $i = 0;
+    while (list(, $col) = each($this->error_bar_color)) {
+      $this->ndx_error_bar_color[$i] = $this->SetIndexColor($col);
+      $i++;
+    }
+    //reset($this->data_border_color);
+    unset($ndx_data_border_color);
+    $i = 0;
+    while (list(, $col) = each($this->data_border_color)) {
+      $this->ndx_data_border_color[$i] = $this->SetIndexColor($col);
+      $i++;
+    }
+    //reset($this->data_color);
+    unset($ndx_data_color);
+    $i = 0;
+    while (list(, $col) = each($this->data_color)) {
+      $this->ndx_data_color[$i] = $this->SetIndexColor($col);
+      $i++;
+    }
+
+    return true;
+  }
+
+
+  function SetDefaultColors() {
+
+    $this->i_light = array(194,194,194);
+    $this->i_dark =  array(100,100,100);
+    $this->SetPlotBgColor(array(222,222,222));
+    $this->SetBackgroundColor(array(200,222,222)); //can use rgb values or "name" values
+    $this->SetLabelColor('black');
+    $this->SetTextColor('black');
+    $this->SetGridColor('black');
+    $this->SetLightGridColor(array(175,175,175));
+    $this->SetTickColor('black');
+    $this->SetTitleColor(array(0,0,0)); // Can be array or name
+    $this->data_color = array('blue','green','yellow','red','orange');
+    $this->error_bar_color = array('blue','green','yellow','red','orange');
+    $this->data_border_color = array('black');
+
+    $this->session_set = 1; //Mark it down for PHP session() usage.
+  }
+
+  function PrintImage() {
+
+    if ( ($this->browser_cache == 0) && ($this->is_inline == 0)) { //Submitted by Thiemo Nagel
+      header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+      header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . 'GMT');
+      header('Cache-Control: no-cache, must-revalidate');
+      header('Pragma: no-cache');
+    }
+
+    switch($this->file_format) {
+      case "png":
+        if ($this->is_inline == 0) {
+          Header('Content-type: image/png');
+        }
+        if ($this->is_inline == 1 && $this->output_file != "") {
+          ImagePng($this->img,$this->output_file);
+        } else {
+          ImagePng($this->img);
+        }
+        break;
+      case "jpg":
+        if ($this->is_inline == 0) {
+          Header('Content-type: image/jpeg');
+        }
+        if ($this->is_inline == 1 && $this->output_file != "") {
+          ImageJPEG($this->img,$this->output_file);
+        } else {
+          ImageJPEG($this->img);
+        }
+        break;
+      case "gif":
+        if ($this->is_inline == 0) {
+          Header('Content-type: image/gif');
+        }
+        if ($this->is_inline == 1 && $this->output_file != "") {
+          ImageGIF($this->img,$this->output_file);
+        } else {
+          ImageGIF($this->img);
+        }
+
+        break;
+      case "wbmp":
+        if ($this->is_inline == 0) {
+          Header('Content-type: image/wbmp');
+        }
+        if ($this->is_inline == 1 && $this->output_file != "") {
+          ImageWBMP($this->img,$this->output_file);
+        } else {
+          ImageWBMP($this->img);
+        }
+
+        break;
+      default:
+        //$this->PrintError('Please select an image type!<br>');
+        $this->PrintError(SELECT_IMAGE_TYPE_ERROR.'<br>');
+        break;
+    }
+    ImageDestroy($this->img);
+    return true;
+  }
+
+
+  function DrawBackground() {
+    //if ($this->img == "") { $this->InitImage(); };
+    if ($this->background_done == 0) { //Don't draw it twice if drawing two plots on one image
+      ImageFilledRectangle($this->img, 0, 0,
+        $this->image_width, $this->image_height, $this->ndx_bg_color);
+      $this->background_done = 1;
+    }
+    return true;
+  }
+
+  function DrawImageBorder() {
+    switch ($this->image_border_type) {
+      case "raised":
+        ImageLine($this->img,0,0,$this->image_width-1,0,$this->ndx_i_light);
+        ImageLine($this->img,1,1,$this->image_width-2,1,$this->ndx_i_light);
+        ImageLine($this->img,0,0,0,$this->image_height-1,$this->ndx_i_light);
+        ImageLine($this->img,1,1,1,$this->image_height-2,$this->ndx_i_light);
+        ImageLine($this->img,$this->image_width-1,0,$this->image_width-1,$this->image_height-1,$this->ndx_i_dark);
+        ImageLine($this->img,0,$this->image_height-1,$this->image_width-1,$this->image_height-1,$this->ndx_i_dark);
+        ImageLine($this->img,$this->image_width-2,1,$this->image_width-2,$this->image_height-2,$this->ndx_i_dark);
+        ImageLine($this->img,1,$this->image_height-2,$this->image_width-2,$this->image_height-2,$this->ndx_i_dark);
+      break;
+      case "plain":
+        ImageLine($this->img,0,0,$this->image_width,0,$this->ndx_i_dark);
+        ImageLine($this->img,$this->image_width-1,0,$this->image_width-1,$this->image_height,$this->ndx_i_dark);
+        ImageLine($this->img,$this->image_width-1,$this->image_height-1,0,$this->image_height-1,$this->ndx_i_dark);
+        ImageLine($this->img,0,0,0,$this->image_height,$this->ndx_i_dark);
+      break;
+      default:
+      break;
+    }
+    return true;
+  }
+
+  function SetPlotBorderType($which_pbt) {
+    $this->plot_border_type = $which_pbt; //left, none, anything else=full
+  }
+
+  function SetImageBorderType($which_sibt) {
+    $this->image_border_type = $which_sibt; //raised, plain
+  }
+
+  function SetDrawPlotAreaBackground($which_dpab) {
+    $this->draw_plot_area_background = $which_dpab;  // 1=true or anything else=false
+  }
+
+  function SetDrawDataLabels($which_ddl) {  //Draw next to datapoints
+    $this->draw_data_labels = $which_ddl;  // 1=true or anything else=false
+  }
+
+  function SetDrawXDataLabels($which_dxdl) {  //Draw on X Axis
+    $this->draw_x_data_labels = $which_dxdl;  // 1=true or anything else=false
+  }
+
+  function SetDrawYGrid($which_dyg) {
+    $this->draw_y_grid = $which_dyg;  // 1=true or anything else=false
+  }
+
+  function SetDrawXGrid($which_dxg) {
+    $this->draw_x_grid = $which_dxg;  // 1=true or anything else=false
+  }
+
+  function SetYGridLabelType($which_yglt) {
+    $this->y_grid_label_type = $which_yglt;
+    return true;
+  }
+
+  function SetXGridLabelType($which_xglt) {
+    $this->x_grid_label_type = $which_xglt;
+    return true;
+  }
+
+  function SetXLabel($xlbl) {
+    $this->x_label_txt = $xlbl;
+    return true;
+  }
+  function SetYLabel($ylbl) {
+    $this->y_label_txt = $ylbl;
+    return true;
+  }
+  function SetTitle($title) {
+    $this->title_txt = $title;
+    return true;
+  }
+
+  //function SetLabels($xlbl,$ylbl,$title) {
+  //  $this->title_txt = $title;
+  //  $this->x_label_txt = $xlbl;
+  //  $this->y_label_txt = $ylbl;
+  //}
+
+  function DrawLabels() {
+    $this->DrawTitle();
+    $this->DrawXLabel();
+    $this->DrawYLabel();
+    return true;
+  }
+
+  function DrawXLabel() {
+    if ($this->use_ttf == 1) {
+      $xpos = $this->xtr(($this->plot_max_x + $this->plot_min_x)/2.0) ;
+      $ypos = $this->ytr($this->plot_min_y) + $this->x_label_height/2.0;
+      $this->DrawText($this->x_label_ttffont, $this->x_label_angle,
+        $xpos, $ypos, $this->ndx_label_color, $this->x_label_ttffont_size, $this->x_label_txt,'center');
+    } else {
+      //$xpos = 0.0 - (ImageFontWidth($this->small_font)*strlen($this->x_label_txt)/2.0) + $this->xtr(($this->plot_max_x+$this->plot_min_x)/2.0) ;
+      $xpos = 0.0 + $this->xtr(($this->plot_max_x+$this->plot_min_x)/2.0) ;
+      $ypos = ($this->ytr($this->plot_min_y) + $this->x_label_height/2);
+
+      $this->DrawText($this->small_font, $this->x_label_angle,
+        $xpos, $ypos, $this->ndx_label_color, "", $this->x_label_txt, 'center');
+
+    }
+    return true;
+  }
+
+  function DrawYLabel() {
+    if ($this->use_ttf == 1) {
+      $size = $this->TTFBBoxSize($this->y_label_ttffont_size, 90, $this->y_label_ttffont, $this->y_label_txt);
+      $xpos = 8 + $size[0];
+      $ypos = ($size[1])/2 + $this->ytr(($this->plot_max_y + $this->plot_min_y)/2.0) ;
+      $this->DrawText($this->y_label_ttffont, 90,
+        $xpos, $ypos, $this->ndx_label_color, $this->y_label_ttffont_size, $this->y_label_txt);
+    } else {
+      $xpos = 8;
+      $ypos = (($this->small_font_width*strlen($this->y_label_txt)/2.0) +
+          $this->ytr(($this->plot_max_y + $this->plot_min_y)/2.0) );
+      $this->DrawText($this->small_font, 90,
+        $xpos, $ypos, $this->ndx_label_color, $this->y_label_ttffont_size, $this->y_label_txt);
+    }
+    return true;
+  }
+
+  function DrawText($which_font,$which_angle,$which_xpos,$which_ypos,$which_color,$which_size,$which_text,$which_halign='left',$which_valign='') {
+
+    if ($this->use_ttf == 1 ) {
+      $size = $this->TTFBBoxSize($which_size, $which_angle, $which_font, $which_text);
+      if ($which_valign == 'bottom') {
+        $which_ypos = $which_ypos + ImageFontHeight($which_font);
+      }
+      if ($which_halign == 'center') {
+        $which_xpos = $which_xpos - $size[0]/2;
+      }
+      ImageTTFText($this->img, $which_size, $which_angle,
+        $which_xpos, $which_ypos, $which_color, $which_font, $which_text);
+    } else {
+      if ($which_valign == 'top') {
+        $which_ypos = $which_ypos - ImageFontHeight($which_font);
+      }
+      $which_text = ereg_replace("\r","",$which_text);
+      $str = split("\n",$which_text); //multiple lines submitted by Remi Ricard
+      $height = ImageFontHeight($which_font);
+      $width = ImageFontWidth($which_font);
+      if ($which_angle == 90) {  //Vertical Code Submitted by Marlin Viss
+        for($i=0;$i<count($str);$i++) {
+          ImageStringUp($this->img, $which_font, ($i*$height + $which_xpos), $which_ypos, $str[$i], $which_color);
+        }
+      } else {
+        for($i=0;$i<count($str);$i++) {
+          if ($which_halign == 'center') {
+                      $xpos = $which_xpos - strlen($str[$i]) * $width/2;
+            ImageString($this->img, $which_font, $xpos, ($i*$height + $which_ypos), $str[$i], $which_color);
+          } else {
+            ImageString($this->img, $which_font, $which_xpos, ($i*$height + $which_ypos), $str[$i], $which_color);
+          }
+        }
+      }
+
+    }
+    return true;
+
+  }
+  function DrawTitle() {
+    if ($this->use_ttf == 1 ) {
+      $xpos = ($this->plot_area[0] + $this->plot_area_width / 2);
+      $ypos = $this->y_top_margin/2;
+      $this->DrawText($this->title_ttffont, $this->title_angle,
+        $xpos, $ypos, $this->ndx_title_color, $this->title_ttffont_size, $this->title_txt,'center');
+    } else {
+      $xpos = ($this->plot_area[0] + $this->plot_area_width / 2);
+      $ypos = ImageFontHeight($this->title_font);
+      $this->DrawText($this->title_font, $this->title_angle,
+        $xpos, $ypos, $this->ndx_title_color, '', $this->title_txt,'center');
+    }
+    return true;
+
+  }
+
+  function DrawPlotAreaBackground() {
+    ImageFilledRectangle($this->img,$this->plot_area[0],
+      $this->plot_area[1],$this->plot_area[2],$this->plot_area[3],
+      $this->ndx_plot_bg_color);
+  }
+
+  function SetBackgroundColor($which_color) {
+    $this->bg_color= $which_color;
+    $this->ndx_bg_color= $this->SetIndexColor($which_color);
+    return true;
+  }
+  function SetPlotBgColor($which_color) {
+    $this->plot_bg_color= $which_color;
+    $this->ndx_plot_bg_color= $this->SetIndexColor($which_color);
+    return true;
+  }
+
+  function SetShading($which_s) {
+    $this->shading = $which_s;
+    return true;
+  }
+
+  function SetTitleColor($which_color) {
+    $this->title_color= $which_color;
+    $this->ndx_title_color= $this->SetIndexColor($which_color);
+    return true;
+  }
+
+  function SetTickColor ($which_color) {
+    $this->tick_color= $which_color;
+    $this->ndx_tick_color= $this->SetIndexColor($which_color);
+    return true;
+  }
+
+  function SetLabelColor ($which_color) {
+    $this->label_color= $which_color;
+    $this->ndx_label_color= $this->SetIndexColor($which_color);
+    return true;
+  }
+
+  function SetTextColor ($which_color) {
+    $this->text_color= $which_color;
+    $this->ndx_text_color= $this->SetIndexColor($which_color);
+    return true;
+  }
+
+  function SetLightGridColor ($which_color) {
+    $this->light_grid_color= $which_color;
+    $this->ndx_light_grid_color= $this->SetIndexColor($which_color);
+    return true;
+  }
+
+  function SetGridColor ($which_color) {
+    $this->grid_color = $which_color;
+    $this->ndx_grid_color= $this->SetIndexColor($which_color);
+    return true;
+  }
+
+  function SetCharacterHeight() {
+    //to be set
+    return true;
+  }
+
+  function SetPlotType($which_pt) {
+    $accepted = "bars,lines,linepoints,area,points,pie,thinbarline";
+    $asked = trim($which_pt);
+    if (eregi($asked, $accepted)) {
+      $this->plot_type = $which_pt;
+      return true;
+    } else {
+      //$this->DrawError('$which_pt not an acceptable plot type');
+      $this->DrawError($which_pt.NOT_ACCEPTABLE_PLOT_TYPE_ERROR);
+      return false;
+    }
+  }
+
+  function FindDataLimits() {
+    //Text-Data is different than data-data graphs. For them what
+    // we have, instead of X values, is # of records equally spaced on data.
+    //text-data is passed in as $data[] = (title,y1,y2,y3,y4,...)
+    //data-data is passed in as $data[] = (title,x,y1,y2,y3,y4,...)
+
+    $this->number_x_points = count($this->data_values);
+
+    switch ($this->data_type) {
+      case "text-data":
+        $minx = 0; //valid for BAR TYPE GRAPHS ONLY
+        $maxx = $this->number_x_points - 1 ;  //valid for BAR TYPE GRAPHS ONLY
+        $miny = (double) $this->data_values[0][1];
+        $maxy = $miny;
+        if ($this->draw_x_data_labels == "") {
+          $this->draw_x_data_labels = 1;  //labels_note1: prevent both data labels and x-axis labels being both drawn and overlapping
+        }
+      break;
+      default:  //Everything else: data-data, etc.
+        $maxx = $this->data_values[0][1];
+        $minx = $maxx;
+        $miny = $this->data_values[0][2];
+        $maxy = $miny;
+        $maxy = $miny;
+      break;
+    }
+
+    $max_records_per_group = 0;
+    $total_records = 0;
+    $mine = 0; //Maximum value for the -error bar (assume error bars always > 0)
+    $maxe = 0; //Maximum value for the +error bar (assume error bars always > 0)
+
+    reset($this->data_values);
+    while (list($dat_key, $dat) = each($this->data_values)) {  //for each X barchart setting
+    //foreach($this->data_values as $dat)  //can use foreach only in php4
+
+      $tmp = 0;
+      $total_records += count($dat) - 1; // -1 for label
+
+      switch ($this->data_type) {
+        case "text-data":
+          //Find the relative Max and Min
+
+          while (list($key, $val) = each($dat)) {
+            if ($key != 0) {  //$dat[0] = label
+              SetType($val,"double");
+              if ($val > $maxy) {
+                $maxy = $val ;
+              }
+              if ($val < $miny) {
+                $miny = (double) $val ;
+              }
+            }
+            $tmp++;
+          }
+        break;
+        case "data-data":  //X-Y data is passed in as $data[] = (title,x,y,y2,y3,...) which you can use for multi-dimentional plots.
+
+          while (list($key, $val) = each($dat)) {
+            if ($key == 1) {  //$dat[0] = label
+              SetType($val,"double");
+              if ($val > $maxx) {
+                $maxx = $val;
+              } elseif ($val < $minx) {
+                $minx = $val;
+              }
+            } elseif ($key > 1) {
+              SetType($val,"double");
+              if ($val > $maxy) {
+                $maxy = $val ;
+              } elseif ($val < $miny) {
+                $miny = $val ;
+              }
+            }
+            $tmp++;
+          }
+          $tmp = $tmp - 1; //# records per group
+        break;
+        case "data-data-error":  //Assume 2-D for now, can go higher
+        //Regular X-Y data is passed in as $data[] = (title,x,y,error+,error-,y2,error2+,error2-)
+
+          while (list($key, $val) = each($dat)) {
+            if ($key == 1) {  //$dat[0] = label
+              SetType($val,'double');
+              if ($val > $maxx) {
+                $maxx = $val;
+              } elseif ($val < $minx) {
+                $minx = $val;
+              }
+            } elseif ($key%3 == 2) {
+              SetType($val,'double');
+              if ($val > $maxy) {
+                $maxy = $val ;
+              } elseif ($val < $miny) {
+                $miny = $val ;
+              }
+            } elseif ($key%3 == 0) {
+              SetType($val,'double');
+              if ($val > $maxe) {
+                $maxe = $val ;
+              }
+            } elseif ($key%3 == 1) {
+              SetType($val,'double');
+              if ($val > $mine) {
+                $mine = $val ;
+              }
+            }
+            $tmp++;
+          }
+          $maxy = $maxy + $maxe;
+          $miny = $miny - $mine; //assume error bars are always > 0
+
+        break;
+        default:
+          //$this->PrintError('ERROR: unknown chart type');
+          $this->PrintError(UNKNOWN_CHART_TYPE_ERROR);
+        break;
+      }
+      if ($tmp > $max_records_per_group) {
+        $max_records_per_group = $tmp;
+      }
+    }
+
+
+    $this->min_x = $minx;
+    $this->max_x = $maxx;
+    $this->min_y = $miny;
+    $this->max_y = $maxy;
+
+
+    if ($max_records_per_group > 1) {
+      $this->records_per_group = $max_records_per_group - 1;
+    } else {
+      $this->records_per_group = 1;
+    }
+
+
+    //$this->data_count = $total_records ;
+  } // function FindDataLimits
+
+  function SetMargins() {
+    /////////////////////////////////////////////////////////////////
+    // When the image is first created - set the margins
+    // to be the standard viewport.
+    // The standard viewport is the full area of the view surface (or panel),
+    // less a margin of 4 character heights all round for labelling.
+    // It thus depends on the current character size, set by SetCharacterHeight().
+    /////////////////////////////////////////////////////////////////
+
+    $str = split("\n",$this->title_txt);
+    $nbLines = count($str);
+
+    if ($this->use_ttf == 1) {
+      $title_size = $this->TTFBBoxSize($this->title_ttffont_size, $this->title_angle, $this->title_ttffont, 'X'); //An array
+      if ($nbLines == 1) {
+        $this->y_top_margin = $title_size[1] * 4;
+      } else {
+        $this->y_top_margin = $title_size[1] * ($nbLines+3);
+      }
+
+      //ajo working here
+      //$x_label_size = $this->TTFBBoxSize($this->x_label_ttffont_size, 0, $this->axis_ttffont, $this->x_label_txt);
+
+      $this->y_bot_margin = $this->x_label_height ;
+      $this->x_left_margin = $this->y_label_width * 2 + $this->tick_length;
+      $this->x_right_margin = 33.0; // distance between right and end of x axis in pixels
+    } else {
+      $title_size = array(ImageFontWidth($this->title_font) * strlen($this->title_txt),ImageFontHeight($this->title_font));
+      //$this->y_top_margin = ($title_size[1] * 4);
+      if ($nbLines == 1) {
+        $this->y_top_margin = $title_size[1] * 4;
+      } else {
+        $this->y_top_margin = $title_size[1] * ($nbLines+3);
+      }
+      if ($this->x_datalabel_angle == 90) {
+        $this->y_bot_margin = 76.0; // Must be integer
+      } else {
+        $this->y_bot_margin = 66.0; // Must be integer
+      }
+      $this->x_left_margin = 77.0; // distance between left and start of x axis in pixels
+      $this->x_right_margin = 33.0; // distance between right and end of x axis in pixels
+    }
+
+//exit;
+    $this->x_tot_margin = $this->x_left_margin + $this->x_right_margin;
+    $this->y_tot_margin = $this->y_top_margin + $this->y_bot_margin;
+
+    if ($this->plot_max_x && $this->plot_max_y && $this->plot_area_width ) { //If data has already been analysed then set translation
+      $this->SetTranslation();
+    }
+  }
+
+  function SetMarginsPixels($which_lm,$which_rm,$which_tm,$which_bm) {
+    //Set the plot area using margins in pixels (left, right, top, bottom)
+    $this->SetNewPlotAreaPixels($which_lm,$which_tm,($this->image_width - $which_rm),($this->image_height - $which_bm));
+    return true;
+  }
+
+  function SetNewPlotAreaPixels($x1,$y1,$x2,$y2) {
+    //Like in GD 0,0 is upper left set via pixel Coordinates
+    $this->plot_area = array($x1,$y1,$x2,$y2);
+    $this->plot_area_width = $this->plot_area[2] - $this->plot_area[0];
+    $this->plot_area_height = $this->plot_area[3] - $this->plot_area[1];
+    $this->y_top_margin = $this->plot_area[1];
+    if ($this->plot_max_x) {
+      $this->SetTranslation();
+    }
+    return true;
+  }
+
+  function SetPlotAreaPixels($x1,$y1,$x2,$y2) {
+    //Like in GD 0,0 is upper left
+    if (!$this->x_tot_margin) {
+      $this->SetMargins();
+    }
+    if ($x2 && $y2) {
+      $this->plot_area = array($x1,$y1,$x2,$y2);
+    } else {
+      $this->plot_area = array($this->x_left_margin, $this->y_top_margin,
+                $this->image_width - $this->x_right_margin,
+                $this->image_height - $this->y_bot_margin
+              );
+    }
+    $this->plot_area_width = $this->plot_area[2] - $this->plot_area[0];
+    $this->plot_area_height = $this->plot_area[3] - $this->plot_area[1];
+
+    return true;
+
+  }
+
+  function SetPlotAreaWorld($xmin,$ymin,$xmax,$ymax) {
+    if (($xmin == "")  && ($xmax == "")) {
+      //For automatic setting of data we need $this->max_x
+        if (!$this->max_y) {
+          $this->FindDataLimits() ;
+        }
+        if ($this->data_type == 'text-data') { //labels for text-data is done at data drawing time for speed.
+          $xmax = $this->max_x + 1 ;  //valid for BAR CHART TYPE GRAPHS ONLY
+          $xmin = 0 ;         //valid for BAR CHART TYPE GRAPHS ONLY
+        } else {
+          $xmax = $this->max_x * 1.02;
+          $xmin = $this->min_x;
+        }
+
+        $ymax = ceil($this->max_y * 1.2);
+        if ($this->min_y < 0) {
+          $ymin = floor($this->min_y * 1.2);
+        } else {
+          $ymin = 0;
+        }
+    }
+
+    $this->plot_min_x = $xmin;
+    $this->plot_max_x = $xmax;
+
+    if ($ymin == $ymax) {
+      $ymax += 1;
+    }
+    if ($this->yscale_type == "log") {
+      //extra error checking
+      if ($ymin <= 0) {
+        $ymin = 1;
+      }
+      if ($ymax <= 0) {
+        //$this->PrintError('Log plots need data greater than 0');
+        $this->PrintError(LOG_PLOTS_DATA_GREATER_ERROR);
+      }
+    }
+    $this->plot_min_y = $ymin;
+    $this->plot_max_y = $ymax;
+
+    if ($ymax <= $ymin) {
+      //$this->DrawError('Error in Data - max not gt min');
+      $this->DrawError(ERROR_IN_DATA);
+    }
+
+//Set the boundaries of the box for plotting in world coord
+//    if (!$this->x_tot_margin) { //We need to know the margins before we can calculate scale
+//      $this->SetMargins();
+//    }
+    //For this we have to reset the scale
+    if ($this->plot_area_width) {
+      $this->SetTranslation();
+    }
+
+    return true;
+
+  } //function SetPlotAreaWorld
+
+
+  function PrintError($error_message) {
+  // prints the error message to stdout and die
+    //echo "<p><b>Fatal error</b>: $error_message<p>";
+    echo "<p><b>".FATAL_ERROR."</b>: $error_message<p>";
+    die;
+  }
+
+  function DrawError($error_message) {
+  // prints the error message inline into
+  // the generated image
+
+    if (($this->img) == "") { $this->InitImage(); } ;
+
+    $ypos = $this->image_height/2;
+
+    if ($this->use_ttf == 1) {
+      ImageRectangle($this->img, 0,0,$this->image_width,$this->image_height,ImageColorAllocate($this->img,255,255,255));
+      ImageTTFText($this->img, $this->small_ttffont_size, 0, $xpos, $ypos, ImageColorAllocate($this->img,0,0,0), $this->axis_ttffont, $error_message);
+    } else {
+      ImageRectangle($this->img, 0,0,$this->image_width,$this->image_height,ImageColorAllocate($this->img,255,255,255));
+      ImageString($this->img, $this->small_font,1,$ypos,$error_message, ImageColorAllocate($this->img,0,0,0));
+    }
+
+    $this->PrintImage();
+    return true;
+  }
+
+  function TTFBBoxSize($size, $angle, $font, $string) {
+
+    //Assume angle < 90
+    $arr = ImageTTFBBox($size, 0, $font, $string);
+    $flat_width  = $arr[0] - $arr[2];
+    $flat_height = abs($arr[3] - $arr[5]);
+
+      // for 90deg:
+      //  $height = $arr[5] - $arr[7];
+      //  $width = $arr[2] - $arr[4];
+
+    $angle = deg2rad($angle);
+    $width  = ceil(abs($flat_width*cos($angle) + $flat_height*sin($angle))); //Must be integer
+    $height = ceil(abs($flat_width*sin($angle) + $flat_height*cos($angle))); //Must be integer
+
+    return array($width, $height);
+  }
+
+  function SetXLabelHeight() {
+
+    if ($this->use_ttf == 1) {
+      //Space for the X Label
+      $size = $this->TTFBBoxSize($this->x_label_ttffont_size, 0, $this->axis_ttffont, $this->x_label_txt);
+      $tmp = $size[1];
+
+      //$string = Str_Repeat('w', $this->x_datalabel_maxlength);
+      $i = 0;
+      $string = '';
+      while ($i < $this->x_datalabel_maxlength) {
+        $string .= 'w';
+        $i++;
+      }
+
+      //Space for the axis data labels
+      $size = $this->TTFBBoxSize($this->axis_ttffont_size, $this->x_datalabel_angle, $this->axis_ttffont, $string);
+
+      $this->x_label_height = 2*$tmp + $size[1] + 4;
+
+    } else {
+      //For Non-TTF fonts we can have only angles 0 or 90
+      if ($this->x_datalabel_angle == 90) {
+        $this->x_label_height = $this->x_datalabel_maxlength * ImageFontWidth($this->small_font) / 1.5;
+      } else {
+        $this->x_label_height = 5 * ImageFontHeight($this->small_font);
+      }
+    }
+
+    $this->SetMargins();
+
+    return true;
+  } //function SetXLabelHeight
+
+  function SetYLabelWidth() {
+    //$ylab = sprintf("%6.1f %s",$i,$si_units[0]);  //use for PHP2 compatibility
+    //the "." is for space. It isn't actually printed
+    $ylab = number_format($this->max_y, $this->y_precision, ".", ",") . $this->si_units . ".";
+
+    if ($this->use_ttf == 1) {
+      $size = $this->TTFBBoxSize($this->axis_ttffont_size, 0, $this->axis_ttffont, $ylab);
+    } else {
+      $size[0] = StrLen($ylab) * $this->small_font_width * .6;
+    }
+
+    $this->y_label_width = $size[0] * 2;
+//echo "SYLW: $this->y_label_width<br>";
+//exit;
+
+    $this->SetMargins();
+    return true;
+  }
+
+  function SetEqualXCoord() {
+    //for plots that have equally spaced x variables and multiple bars per x-point.
+
+    $space = ($this->plot_area[2] - $this->plot_area[0]) / ($this->number_x_points * 2) * $this->group_frac_width;
+    $group_width = $space * 2;
+    $bar_width = $group_width / $this->records_per_group;
+  //I think that eventually this space variable will be replaced by just graphing x.
+    $this->data_group_space = $space;
+    $this->record_bar_width = $bar_width;
+    return true;
+  }
+
+  function SetLabelScalePosition($which_blp) {
+    //0 to 1
+    $this->label_scale_position = $which_blp;
+    return true;
+  }
+
+  function SetErrorBarSize($which_ebs) {
+    //in pixels
+    $this->error_bar_size = $which_ebs;
+    return true;
+  }
+
+  function SetErrorBarShape($which_ebs) {
+    //in pixels
+    $this->error_bar_shape = $which_ebs;
+    return true;
+  }
+
+  function SetPointShape($which_pt) {
+    //in pixels
+    $this->point_shape = $which_pt;
+    return true;
+  }
+
+  function SetPointSize($which_ps) {
+    //in pixels
+    SetType($which_ps,'integer');
+    $this->point_size = $which_ps;
+
+    if ($this->point_shape == "diamond" or $this->point_shape == "triangle") {
+      if ($this->point_size % 2 != 0) {
+        $this->point_size++;
+      }
+    }
+    return true;
+  }
+
+  function SetDataType($which_dt) {
+    //The next three lines are for past compatibility.
+    if ($which_dt == "text-linear") { $which_dt = "text-data"; };
+    if ($which_dt == "linear-linear") { $which_dt = "data-data"; };
+    if ($which_dt == "linear-linear-error") { $which_dt = "data-data-error"; };
+
+    $this->data_type = $which_dt; //text-data, data-data, data-data-error
+    return true;
+  }
+
+  function SetDataValues($which_dv) {
+    $this->data_values = $which_dv;
+//echo $this->data_values
+    return true;
+  }
+
+//////////////COLORS
+  function SetRGBArray ($which_color_array) {
+    if ( is_array($which_color_array) ) {
+      //User Defined Array
+      $this->rgb_array = $which_color_array;
+      return true;
+    } elseif ($which_color_array == 2) { //Use the small predefined color array
+    $this->rgb_array = array(
+      "white"     => array(255, 255, 255),
+      "snow"      => array(255, 250, 250),
+      "PeachPuff"   => array(255, 218, 185),
+      "ivory"     => array(255, 255, 240),
+      "lavender"    => array(230, 230, 250),
+      "black"     => array(  0,   0,   0),
+      "DimGrey"     => array(105, 105, 105),
+      "gray"      => array(190, 190, 190),
+      "grey"      => array(190, 190, 190),
+      "navy"      => array(  0,   0, 128),
+      "SlateBlue"     => array(106,  90, 205),
+      "blue"      => array(  0,   0, 255),
+      "SkyBlue"     => array(135, 206, 235),
+      "cyan"      => array(  0, 255, 255),
+      "DarkGreen"     => array(  0, 100,   0),
+      "green"     => array(  0, 255,   0),
+      "YellowGreen"     => array(154, 205,  50),
+      "yellow"      => array(255, 255,   0),
+      "orange"      => array(255, 165,   0),
+      "gold"      => array(255, 215,   0),
+      "peru"      => array(205, 133,  63),
+      "beige"     => array(245, 245, 220),
+      "wheat"     => array(245, 222, 179),
+      "tan"     => array(210, 180, 140),
+      "brown"     => array(165,  42,  42),
+      "salmon"      => array(250, 128, 114),
+      "red"     => array(255,   0,   0),
+      "pink"      => array(255, 192, 203),
+      "maroon"      => array(176,  48,  96),
+      "magenta"     => array(255,   0, 255),
+      "violet"      => array(238, 130, 238),
+      "plum"      => array(221, 160, 221),
+      "orchid"      => array(218, 112, 214),
+      "purple"      => array(160,  32, 240),
+      "azure1"      => array(240, 255, 255),
+      "aquamarine1"   => array(127, 255, 212)
+      );
+      return true;
+    } elseif ($which_color_array == 1)  {
+      include("./rgb.inc.php"); //Get large $ColorArray
+      $this->rgb_array = $RGBArray;
+    } else {
+      $this->rgb_array = array("white" =>array(255,255,255), "black" => array(0,0,0));
+      exit;
+    }
+
+    return true;
+  }
+
+  function SetColor($which_color) {
+    //obsoleted by SetRGBColor
+    SetRgbColor($which_color);
+    return true;
+  }
+
+  function SetIndexColor($which_color) { //Color is passed in as anything
+      list ($r, $g, $b) = $this->SetRgbColor($which_color);  //Translate to RGB
+    $index = ImageColorExact($this->img, $r, $g, $b);
+    if ($index == -1) {
+          //return ImageColorAllocate($this->img, $r, $g, $b);
+          //return ImageColorClosest($this->img, $r, $g, $b);
+          return ImageColorResolve($this->img, $r, $g, $b); //requires PHP 3.0.2 and later
+    } else {
+          return $index;
+      }
+  }
+
+  function SetTransparentColor($which_color) {
+    ImageColorTransparent($this->img,$this->SetIndexColor($which_color));
+    return true;
+  }
+
+  function SetRgbColor($color_asked) {
+    //Returns an array in R,G,B format 0-255
+    if ($color_asked == "") { $color_asked = array(0,0,0); };
+
+    if ( count($color_asked) == 3 ) { //already array of 3 rgb
+        $ret_val =  $color_asked;
+    } else { // is asking for a color by string
+      if(substr($color_asked,0,1) == "#") {  //asking in #FFFFFF format.
+        $ret_val =  array(hexdec(substr($color_asked,1,2)), hexdec(substr($color_asked,3,2)), hexdec(substr($color,5,2)));
+      } else {
+        $ret_val =  $this->rgb_array[$color_asked];
+      }
+    }
+    return $ret_val;
+  }
+
+  function SetDataColors($which_data,$which_border) {
+    //Set the data to be displayed in a particular color
+    if (!$which_data) {
+      $which_data = array(array(0,255,0),array(0,0,248),'yellow',array(255,0,0),'orange');
+      $which_border = array('black');
+    }
+
+    $this->data_color = $which_data;  //an array
+    $this->data_border_color = $which_border;  //an array
+
+    unset($this->ndx_data_color);
+    reset($this->data_color);  //data_color can be an array of colors, one for each thing plotted
+    //while (list(, $col) = each($this->data_color))
+    $i = 0;
+    while (list(, $col) = each($which_data)) {
+      $this->ndx_data_color[$i] = $this->SetIndexColor($col);
+      $i++;
+    }
+
+    // border_color
+    //If we are also going to put a border on the data (bars, dots, area, ...)
+    //  then lets also set a border color as well.
+    //foreach($this->data_border_color as $col)
+    unset($this->ndx_data_border_color);
+    reset($this->data_border_color);
+    $i = 0;
+    while (list(, $col) = each($this->data_border_color)) {
+      $this->ndx_data_border_color[$i] = $this->SetIndexColor($col);
+      $i++;
+    }
+
+    //Set color of the error bars to be that of data if not already set.
+    if (!$this->error_bar_color) {
+        reset($which_data);
+        $this->SetErrorBarColors($which_data);
+    }
+
+    return true;
+
+  } //function SetDataColors
+
+  function SetErrorBarColors($which_data) {
+
+   //Set the data to be displayed in a particular color
+
+   if ($which_data) {
+    $this->error_bar_color = $which_data;  //an array
+    unset($this->ndx_error_bar_color);
+    reset($this->error_bar_color);  //data_color can be an array of colors, one for each thing plotted
+    $i = 0;
+    while (list(, $col) = each($this->error_bar_color)) {
+      $this->ndx_error_bar_color[$i] = $this->SetIndexColor($col);
+      $i++;
+    }
+    return true;
+    }
+    return false;
+  } //function SetErrorBarColors
+
+
+  function DrawPlotBorder() {
+    switch ($this->plot_border_type) {
+      case "left" :
+        ImageLine($this->img, $this->plot_area[0],$this->ytr($this->plot_min_y),
+          $this->plot_area[0],$this->ytr($this->plot_max_y),$this->ndx_grid_color);
+      break;
+      case "none":
+        //Draw No Border
+      break;
+      default:
+        ImageRectangle($this->img, $this->plot_area[0],$this->ytr($this->plot_min_y),
+          $this->plot_area[2],$this->ytr($this->plot_max_y),$this->ndx_grid_color);
+      break;
+    }
+    $this->DrawYAxis();
+    $this->DrawXAxis();
+    return true;
+  }
+
+
+  function SetHorizTickIncrement($which_ti) {
+    //Use either this or NumHorizTicks to set where to place x tick marks
+    if ($which_ti) {
+      $this->horiz_tick_increment = $which_ti;  //world coordinates
+    } else {
+      if (!$this->max_x) {
+        $this->FindDataLimits();  //Get maxima and minima for scaling
+      }
+      //$this->horiz_tick_increment = ( ceil($this->max_x * 1.2) - floor($this->min_x * 1.2) )/10;
+      $this->horiz_tick_increment =  ($this->plot_max_x  - $this->plot_min_x  )/10;
+    }
+    $this->num_horiz_ticks = ''; //either use num_vert_ticks or vert_tick_increment, not both
+    return true;
+  }
+
+  function SetDrawVertTicks($which_dvt) {
+    $this->draw_vert_ticks = $which_dvt;
+    return true;
+  }
+
+  function SetVertTickIncrement($which_ti) {
+    //Use either this or NumVertTicks to set where to place y tick marks
+    if ($which_ti) {
+      $this->vert_tick_increment = $which_ti;  //world coordinates
+    } else {
+      if (!$this->max_y) {
+        $this->FindDataLimits();  //Get maxima and minima for scaling
+      }
+      //$this->vert_tick_increment = ( ceil($this->max_y * 1.2) - floor($this->min_y * 1.2) )/10;
+      $this->vert_tick_increment =  ($this->plot_max_y  - $this->plot_min_y  )/10;
+    }
+    $this->num_vert_ticks = ''; //either use num_vert_ticks or vert_tick_increment, not both
+    return true;
+  }
+
+  function SetNumHorizTicks($which_nt) {
+    $this->num_horiz_ticks = $which_nt;
+    $this->horiz_tick_increment = '';  //either use num_horiz_ticks or horiz_tick_increment, not both
+    return true;
+  }
+
+  function SetNumVertTicks($which_nt) {
+    $this->num_vert_ticks = $which_nt;
+    $this->vert_tick_increment = '';  //either use num_vert_ticks or vert_tick_increment, not both
+    return true;
+  }
+  function SetVertTickPosition($which_tp) {
+    $this->vert_tick_position = $which_tp; //plotleft, plotright, both, yaxis
+    return true;
+  }
+  function SetSkipBottomTick($which_sbt) {
+    $this->skip_bottom_tick = $which_sbt;
+    return true;
+  }
+
+  function SetTickLength($which_tl) {
+    $this->tick_length = $which_tl;
+    return true;
+  }
+
+  function DrawYAxis() {
+    //Draw Line at left side or at this->y_axis_position
+    if ($this->y_axis_position != "") {
+      $yaxis_x = $this->xtr($this->y_axis_position);
+    } else {
+      $yaxis_x = $this->plot_area[0];
+    }
+
+    ImageLine($this->img, $yaxis_x, $this->plot_area[1],
+      $yaxis_x, $this->plot_area[3], $this->ndx_grid_color);
+      //$yaxis_x, $this->plot_area[3], 9);
+
+    if ($this->draw_vert_ticks == 1) {
+      $this->DrawVerticalTicks();
+    }
+
+  } //function DrawYAxis
+
+  function DrawXAxis() {
+    //Draw Tick and Label for Y axis
+    $ylab =$this->FormatYTickLabel($this->x_axis_position);
+    if ($this->skip_bottom_tick != 1) {
+      $this->DrawVerticalTick($ylab,$this->x_axis_position);
+    }
+
+    //Draw X Axis at Y=$x_axis_postion
+    ImageLine($this->img,$this->plot_area[0]+1,$this->ytr($this->x_axis_position),
+        $this->xtr($this->plot_max_x)-1,$this->ytr($this->x_axis_position),$this->ndx_tick_color);
+
+    //X Ticks and Labels
+    if ($this->data_type != 'text-data') { //labels for text-data done at data drawing time for speed.
+      $this->DrawHorizontalTicks();
+    }
+    return true;
+  }
+
+  function DrawHorizontalTicks() {
+    //Ticks and lables are drawn on the left border of PlotArea.
+    //Left Bottom
+    ImageLine($this->img,$this->plot_area[0],
+        $this->plot_area[3]+$this->tick_length,
+        $this->plot_area[0],$this->plot_area[3],$this->ndx_tick_color);
+
+    switch ($this->x_grid_label_type) {
+      case "title":
+        $xlab = $this->data_values[0][0];
+      break;
+      case "data":
+        $xlab = number_format($this->plot_min_x,$this->x_precision,".",",") . "$this->si_units";
+      break;
+      case "none":
+        $xlab = '';
+      break;
+      case "time":  //Time formatting suggested by Marlin Viss
+        $xlab = strftime($this->x_time_format,$this->plot_min_x);
+      break;
+      default:
+        //Unchanged from whatever format is passed in
+        $xlab = $this->plot_min_x;
+      break;
+    }
+
+    if ($this->x_datalabel_angle == 90) {
+      $xpos =  $this->plot_area[0] - $this->small_font_height/2;
+      $ypos = ( $this->small_font_width*strlen($xlab) + $this->plot_area[3] + $this->small_font_height);
+      ImageStringUp($this->img, $this->small_font,$xpos, $ypos, $xlab, $this->ndx_text_color);
+    } else {
+      $xpos = $this->plot_area[0] - $this->small_font_width*strlen($xlab)/2 ;
+      $ypos = $this->plot_area[3] + $this->small_font_height;
+      ImageString($this->img, $this->small_font,$xpos, $ypos, $xlab, $this->ndx_text_color);
+    }
+
+    //Will be changed to allow for TTF fonts in data as well.
+    //$this->DrawText($this->small_font, $this->x_datalabel_angle, $xpos, $ypos, $this->ndx_title_color, '', $xlab);
+
+    //Top
+
+    if ($this->horiz_tick_increment) {
+      $delta_x = $this->horiz_tick_increment;
+    } elseif ($this->num_horiz_ticks) {
+      $delta_x = ($this->plot_max_x - $this->plot_min_x) / $this->num_horiz_ticks;
+    } else {
+      $delta_x =($this->plot_max_x - $this->plot_min_x) / 10 ;
+    }
+
+    $i = 0;
+    $x_tmp = $this->plot_min_x;
+    SetType($x_tmp,'double');
+
+    while ($x_tmp <= $this->plot_max_x){
+      //$xlab = sprintf("%6.1f %s",$min_x,$si_units[0]);  //PHP2 past compatibility
+      switch ($this->x_grid_label_type) {
+        case "title":
+          $xlab = $this->data_values[$x_tmp][0];
+        break;
+        case "data":
+          $xlab = number_format($x_tmp,$this->x_precision,".",",") . "$this->si_units";
+        break;
+        case "none":
+          $xlab = '';
+        break;
+        case "time":  //Time formatting suggested by Marlin Viss
+          $xlab = strftime($this->x_time_format,$x_tmp);
+        break;
+        default:
+          //Unchanged from whatever format is passed in
+          $xlab = $x_tmp;
+        break;
+      }
+
+      $x_pixels = $this->xtr($x_tmp);
+
+      //Bottom Tick
+      ImageLine($this->img,$x_pixels,$this->plot_area[3] + $this->tick_length,
+        $x_pixels,$this->plot_area[3], $this->ndx_tick_color);
+      //Top Tick
+      //ImageLine($this->img,($this->xtr($this->plot_max_x)+$this->tick_length),
+      //  $y_pixels,$this->xtr($this->plot_max_x)-1,$y_pixels,$this->ndx_tick_color);
+
+      if ($this->draw_x_grid == 1) {
+        ImageLine($this->img,$x_pixels,$this->plot_area[1],
+          $x_pixels,$this->plot_area[3], $this->ndx_light_grid_color);
+      }
+
+      if ($this->x_datalabel_angle == 90) {  //Vertical Code Submitted by Marlin Viss
+         ImageStringUp($this->img, $this->small_font,
+        ( $x_pixels - $this->small_font_height/2),
+        ( $this->small_font_width*strlen($xlab) + $this->plot_area[3] + $this->small_font_height),$xlab, $this->ndx_text_color);
+      } else {
+        ImageString($this->img, $this->small_font,
+          ( $x_pixels - $this->small_font_width*strlen($xlab)/2) ,
+          ( $this->small_font_height + $this->plot_area[3]),$xlab, $this->ndx_text_color);
+      }
+
+      $i++;
+      $x_tmp += $delta_x;
+    }
+
+  } // function DrawHorizontalTicks
+
+  function FormatYTickLabel($which_ylab) {
+    switch ($this->y_grid_label_type) {
+      case "data":
+        $ylab = number_format($which_ylab,$this->y_precision,".",",") . "$this->si_units";
+      break;
+      case "none":
+        $ylab = '';
+      break;
+      case "time":
+        $ylab = strftime($this->y_time_format,$which_ylab);
+      break;
+      case "right":
+        //Make it right aligned
+        //$ylab = str_pad($which_ylab,$this->y_label_width," ",STR_PAD_LEFT); //PHP4 only
+        $sstr = "%".strlen($this->plot_max_y)."s";
+        $ylab = sprintf($sstr,$which_ylab);
+      break;
+      default:
+        //Unchanged from whatever format is passed in
+        $ylab = $which_ylab;
+      break;
+    }
+
+    return($ylab);
+
+  } //function FormatYTickLabel
+
+  function DrawVerticalTick($which_ylab,$which_ypos) {  //ylab in world coord.
+    //Draw Just one Tick, called from DrawVerticalTicks
+    //Ticks and datalables can be left of plot only, right of plot only,
+    //  both on the left and right of plot, or crossing a user defined Y-axis
+    //
+    //Its faster to draw both left and right ticks at same time
+    //  than first left and then right.
+
+    if ($this->y_axis_position != "") {
+      //Ticks and lables are drawn on the left border of yaxis
+      $yaxis_x = $this->xtr($this->y_axis_position);
+    } else {
+      //Ticks and lables are drawn on the left border of PlotArea.
+      $yaxis_x = $this->plot_area[0];
+    }
+
+    $y_pixels = $this->ytr($which_ypos);
+
+    //Lines Across the Plot Area
+    if ($this->draw_y_grid == 1) {
+      ImageLine($this->img,$this->plot_area[0]+1,$y_pixels,
+        $this->plot_area[2]-1,$y_pixels,$this->ndx_light_grid_color);
+    }
+
+    //Ticks to the Left of the Plot Area
+    if (($this->vert_tick_position == "plotleft") || ($this->vert_tick_position == "both") ) {
+      ImageLine($this->img,(-$this->tick_length+$yaxis_x),
+      $y_pixels,$yaxis_x,
+      $y_pixels, $this->ndx_tick_color);
+    }
+
+    //Ticks to the Right of the Plot Area
+    if (($this->vert_tick_position == "plotright") || ($this->vert_tick_position == "both") ) {
+      ImageLine($this->img,($this->plot_area[2]+$this->tick_length),
+      $y_pixels,$this->plot_area[2],
+      $y_pixels,$this->ndx_tick_color);
+    }
+
+    //Ticks on the Y Axis
+    if (($this->vert_tick_position == "yaxis") ) {
+      ImageLine($this->img,($yaxis_x - $this->tick_length),
+      $y_pixels,$yaxis_x,$y_pixels,$this->ndx_tick_color);
+    }
+
+    //DataLabel
+//ajo working
+    //$this->DrawText($this->y_label_ttffont, 0,($yaxis_x - $this->y_label_width - $this->tick_length/2),
+    //    $y_pixels, $this->ndx_text_color, $this->axis_ttffont_size, $which_ylab);
+    ImageString($this->img, $this->small_font, ($yaxis_x - $this->y_label_width - $this->tick_length/2),
+      ( -($this->small_font_height/2.0) + $y_pixels),$which_ylab, $this->ndx_text_color);
+  }
+
+  function DrawVerticalTicks() {
+
+    if ($this->skip_top_tick != 1) { //If tick increment doesn't hit the top
+      //Left Top
+      //ImageLine($this->img,(-$this->tick_length+$this->xtr($this->plot_min_x)),
+      //    $this->ytr($this->plot_max_y),$this->xtr($this->plot_min_x),$this->ytr($this->plot_max_y),$this->ndx_tick_color);
+      //$ylab = $this->FormatYTickLabel($plot_max_y);
+
+      //Right Top
+      //ImageLine($this->img,($this->xtr($this->plot_max_x)+$this->tick_length),
+      //    $this->ytr($this->plot_max_y),$this->xtr($this->plot_max_x-1),$this->ytr($this->plot_max_y),$this->ndx_tick_color);
+
+      //Draw Grid Line at Top
+      ImageLine($this->img,$this->plot_area[0]+1,$this->ytr($this->plot_max_y),
+          $this->plot_area[2]-1,$this->ytr($this->plot_max_y),$this->ndx_light_grid_color);
+
+    }
+
+    if ($this->skip_bottom_tick != 1) {
+      //Right Bottom
+      //ImageLine($this->img,($this->xtr($this->plot_max_x)+$this->tick_length),
+      //    $this->ytr($this->plot_min_y),$this->xtr($this->plot_max_x),
+      //    $this->ytr($this->plot_min_y),$this->ndx_tick_color);
+
+      //Draw Grid Line at Bottom of Plot
+      ImageLine($this->img,$this->xtr($this->plot_min_x)+1,$this->ytr($this->plot_min_y),
+          $this->xtr($this->plot_max_x),$this->ytr($this->plot_min_y),$this->ndx_light_grid_color);
+    }
+
+    // maxy is always > miny so delta_y is always positive
+    if ($this->vert_tick_increment) {
+      $delta_y = $this->vert_tick_increment;
+    } elseif ($this->num_vert_ticks) {
+      $delta_y = ($this->plot_max_y - $this->plot_min_y) / $this->num_vert_ticks;
+    } else {
+      $delta_y =($this->plot_max_y - $this->plot_min_y) / 10 ;
+    }
+
+    $y_tmp = $this->plot_min_y;
+    SetType($y_tmp,'double');
+    if ($this->skip_bottom_tick == 1) {
+      $y_tmp += $delta_y;
+    }
+
+    while ($y_tmp <= $this->plot_max_y){
+      //For log plots:
+      if (($this->yscale_type == "log") && ($this->plot_min_y == 1) &&
+        ($delta_y%10 == 0) && ($y_tmp == $this->plot_min_y)) {
+        $y_tmp = $y_tmp - 1; //Set first increment to 9 to get: 1,10,20,30,...
+      }
+
+      $ylab = $this->FormatYTickLabel($y_tmp);
+
+      $this->DrawVerticalTick($ylab,$y_tmp);
+
+      $y_tmp += $delta_y;
+    }
+
+    return true;
+
+  } // function DrawVerticalTicks
+
+  function SetTranslation() {
+    if ($this->xscale_type == "log") {
+      $this->xscale = ($this->plot_area_width)/(log10($this->plot_max_x) - log10($this->plot_min_x));
+    } else {
+      $this->xscale = ($this->plot_area_width)/($this->plot_max_x - $this->plot_min_x);
+    }
+    if ($this->yscale_type == "log") {
+      $this->yscale = ($this->plot_area_height)/(log10($this->plot_max_y) - log10($this->plot_min_y));
+    } else {
+      $this->yscale = ($this->plot_area_height)/($this->plot_max_y - $this->plot_min_y);
+    }
+
+    // GD defines x=0 at left and y=0 at TOP so -/+ respectively
+    if ($this->xscale_type == "log") {
+      $this->plot_origin_x = $this->plot_area[0] - ($this->xscale * log10($this->plot_min_x) );
+    } else {
+      $this->plot_origin_x = $this->plot_area[0] - ($this->xscale * $this->plot_min_x);
+    }
+    if ($this->yscale_type == "log") {
+      $this->plot_origin_y = $this->plot_area[3] + ($this->yscale * log10($this->plot_min_y));
+    } else {
+      $this->plot_origin_y = $this->plot_area[3] + ($this->yscale * $this->plot_min_y);
+    }
+
+    $this->scale_is_set = 1;
+  } // function SetTranslation
+
+  function xtr($x_world) {
+  //Translate world coordinates into pixel coordinates
+  //The pixel coordinates are those of the ENTIRE image, not just the plot_area
+    //$x_pixels =  $this->x_left_margin + ($this->image_width - $this->x_tot_margin)*(($x_world - $this->plot_min_x) / ($this->plot_max_x - $this->plot_min_x)) ;
+    //which with a little bit of math reduces to ...
+    if ($this->xscale_type == "log") {
+      $x_pixels =  $this->plot_origin_x + log10($x_world) * $this->xscale ;
+    } else {
+      $x_pixels =  $this->plot_origin_x + $x_world * $this->xscale ;
+    }
+    return($x_pixels);
+  }
+
+  function ytr($y_world) {
+    // translate y world coord into pixel coord
+    if ($this->yscale_type == "log") {
+      $y_pixels =  $this->plot_origin_y - log10($y_world) * $this->yscale ;  //minus because GD defines y=0 at top. doh!
+    } else {
+      $y_pixels =  $this->plot_origin_y - $y_world * $this->yscale ;
+    }
+    return ($y_pixels);
+  }
+
+
+  function DrawDataLabel($lab,$x_world,$y_world) {
+    //Depreciated. Use DrawText Instead.
+    //Data comes in in WORLD coordinates
+    //Draw data label near actual data point
+      //$y = $this->ytr($y_world) ;  //in pixels
+      //$x = $this->xtr($x_world) ;
+      //$this->DrawText($which_font,$which_angle,$which_xpos,$which_ypos,$which_color,$which_size,$which_text,$which_halign='left');
+      if ($this->use_ttf) {
+//ajjjo
+        $lab_size = $this->TTFBBoxSize($this->axis_ttffont_size, $this->x_datalabel_angle, $this->axis_ttffont, $lab); //An array
+        $y = $this->ytr($y_world) - $lab_size[1] ;  //in pixels
+        $x = $this->xtr($x_world) - $lab_size[0]/2;
+        ImageTTFText($this->img, $this->axis_ttffont_size, $this->x_datalabel_angle, $x, $y, $this->ndx_text_color, $this->axis_ttffont, $lab);
+      } else {
+        $lab_size = array($this->small_font_width*StrLen($lab), $this->small_font_height*3);
+        if ($this->x_datalabel_angle == 90) {
+          $y = $this->ytr($y_world) - $this->small_font_width*StrLen($lab); //in pixels
+          $x = $this->xtr($x_world) - $this->small_font_height;
+          ImageStringUp($this->img, $this->small_font,$x, $y ,$lab, $this->ndx_text_color);
+        } else {
+          $y = $this->ytr($y_world) - $this->small_font_height; //in pixels
+          $x = $this->xtr($x_world) - ($this->small_font_width*StrLen($lab))/2;
+          ImageString($this->img, $this->small_font,$x, $y ,$lab, $this->ndx_text_color);
+        }
+      }
+
+  }
+
+  function DrawXDataLabel($xlab,$xpos) {
+    //xpos comes in in PIXELS not in world coordinates.
+    //Draw an x data label centered at xlab
+      if ($this->use_ttf) {
+        $xlab_size = $this->TTFBBoxSize($this->axis_ttffont_size,
+          $this->x_datalabel_angle, $this->axis_ttffont, $xlab); //An array
+        $y = $this->plot_area[3] + $xlab_size[1] + 4;  //in pixels
+        $x = $xpos - $xlab_size[0]/2;
+        ImageTTFText($this->img, $this->axis_ttffont_size,
+          $this->x_datalabel_angle, $x, $y, $this->ndx_text_color, $this->axis_ttffont, $xlab);
+      } else {
+        $xlab_size = array(ImageFontWidth($this->axis_font)*StrLen($xlab), $this->small_font_height*3);
+        if ($this->x_datalabel_angle == 90) {
+          $y = $this->plot_area[3] + ImageFontWidth($this->axis_font)*StrLen($xlab); //in pixels
+          $x = $xpos - ($this->small_font_height);
+          ImageStringUp($this->img, $this->axis_font,$x, $y ,$xlab, $this->ndx_text_color);
+        } else {
+          $y = $this->plot_area[3] + ImageFontHeight($this->axis_font); //in pixels
+          $x = $xpos - (ImageFontWidth($this->axis_font)*StrLen($xlab))/2;
+          ImageString($this->img, $this->axis_font,$x, $y ,$xlab, $this->ndx_text_color);
+        }
+      }
+
+  }
+
+  function DrawPieChart() {
+    //$pi = '3.14159265358979323846';
+    $xpos = $this->plot_area[0] + $this->plot_area_width/2;
+    $ypos = $this->plot_area[1] + $this->plot_area_height/2;
+    $diameter = (min($this->plot_area_width, $this->plot_area_height)) ;
+    $radius = $diameter/2;
+
+    ImageArc($this->img, $xpos, $ypos, $diameter, $diameter, 0, 360, $this->ndx_grid_color);
+
+    $total = 0;
+    reset($this->data_values);
+    $tmp = $this->number_x_points - 1;
+    while (list($j, $row) = each($this->data_values)) {
+      //Get sum of each type
+      $color_index = 0;
+      $i = 0;
+      //foreach ($row as $v)
+      while (list($k, $v) = each($row)) {
+        if ($k != 0) {
+          if ($j == 0) {
+            $sumarr[$i] = $v;
+          } elseif ($j < $tmp) {
+            $sumarr[$i] += $v;
+          } else {
+            $sumarr[$i] += $v;
+          // NOTE!  sum > 0 to make pie charts
+            $sumarr[$i] = abs($sumarr[$i]);
+            $total += $sumarr[$i];
+          }
+        }
+      $i++;
+      }
+    }
+
+    $color_index = 0;
+    $start_angle = 0;
+
+    reset($sumarr);
+    $end_angle = 0;
+    while (list(, $val) = each($sumarr)) {
+      if ($color_index >= count($this->ndx_data_color)) $color_index=0;  //data_color = array
+      $label_txt = number_format(($val / $total * 100), $this->y_precision, ".", ",") . "%";
+      $val = 360 * ($val / $total);
+
+      $end_angle += $val;
+      $mid_angle = $end_angle - ($val / 2);
+
+      $slicecol = $this->ndx_data_color[$color_index];
+
+//Need this again for FillToBorder
+      ImageArc($this->img, $xpos, $ypos, $diameter, $diameter, 0, 360, $this->ndx_grid_color);
+
+      $out_x = $radius * cos(deg2rad($end_angle));
+      $out_y = - $radius * sin(deg2rad($end_angle));
+
+      $mid_x = $xpos + ($radius/2 * cos(deg2rad($mid_angle))) ;
+      $mid_y = $ypos + (- $radius/2 * sin(deg2rad($mid_angle)));
+
+      $label_x = $xpos + ($radius * cos(deg2rad($mid_angle))) * $this->label_scale_position;
+      $label_y = $ypos + (- $radius * sin(deg2rad($mid_angle))) * $this->label_scale_position;
+
+      $out_x = $xpos + $out_x;
+      $out_y = $ypos + $out_y;
+
+      ImageLine($this->img, $xpos, $ypos, $out_x, $out_y, $this->ndx_grid_color);
+      //ImageLine($this->img, $xpos, $ypos, $label_x, $label_y, $this->ndx_grid_color);
+      ImageFillToBorder($this->img, $mid_x, $mid_y, $this->ndx_grid_color, $slicecol);
+
+      if ($this->use_ttf) {
+        ImageTTFText($this->img, $this->axis_ttffont_size, 0, $label_x, $label_y, $this->ndx_grid_color, $this->axis_ttffont, $label_txt);
+      } else {
+        ImageString($this->img, $this->small_font, $label_x, $label_y, $label_txt, $this->ndx_grid_color);
+      }
+
+      $start_angle = $val;
+
+      $color_index++;
+    }
+
+  }
+
+  function DrawLinesError() {
+    //Draw Lines with Error Bars - data comes in as array("title",x,y,error+,error-,y2,error2+,error2-,...);
+    $start_lines = 0;
+
+    reset($this->data_values);
+    while (list(, $row) = each($this->data_values)) {
+      $color_index = 0;
+      $i = 0;
+
+      while (list($key, $val) = each($row)) {
+//echo "$key, $i, $val<br>";
+        if ($key == 0) {
+          $lab = $val;
+        } elseif ($key == 1) {
+          $x_now = $val;
+          $x_now_pixels = $this->xtr($x_now); //Use a bit more memory to save 2N operations.
+        } elseif ($key%3 == 2) {
+          $y_now = $val;
+          $y_now_pixels = $this->ytr($y_now);
+
+          //Draw Data Label
+          if ( $this->draw_data_labels == 1) {
+            $this->DrawDataLabel($lab,$x_now,$y_now);
+          }
+
+          if ($color_index >= count($this->ndx_data_color)) { $color_index=0;};
+          $barcol = $this->ndx_data_color[$color_index];
+          $error_barcol = $this->ndx_error_bar_color[$color_index];
+
+//echo "start = $start_lines<br>";
+          if ($start_lines == 1) {
+            for ($width = 0; $width < $this->line_width; $width++) {
+              ImageLine($this->img, $x_now_pixels, $y_now_pixels + $width,
+                $lastx[$i], $lasty[$i] + $width, $barcol);
+            }
+          }
+
+          $lastx[$i] = $x_now_pixels;
+          $lasty[$i] = $y_now_pixels;
+          $color_index++;
+          $i++;
+          $start_lines = 1;
+        } elseif ($key%3 == 0) {
+          $this->DrawYErrorBar($x_now,$y_now,$val,$this->error_bar_shape,$error_barcol);
+        } elseif ($key%3 == 1) {
+          $this->DrawYErrorBar($x_now,$y_now,-$val,$this->error_bar_shape,$error_barcol);
+        }
+      }
+    }
+  }
+
+  function DrawDotsError() {
+    //Draw Dots - data comes in as array("title",x,y,error+,error-,y2,error2+,error2-,...);
+    reset($this->data_values);
+    while (list(, $row) = each($this->data_values)) {
+      $color_index = 0;
+      //foreach ($row as $v)
+      while (list($key, $val) = each($row)) {
+        if ($key == 0) {
+        } elseif ($key == 1) {
+          $xpos = $val;
+        } elseif ($key%3 == 2) {
+          if ($color_index >= count($this->ndx_data_color)) $color_index=0;
+          $barcol = $this->ndx_data_color[$color_index];
+          $error_barcol = $this->ndx_error_bar_color[$color_index];
+          $ypos = $val;
+
+          $color_index++;
+          $this->DrawDot($xpos,$ypos,$this->point_shape,$barcol);
+        } elseif ($key%3 == 0) {
+          $this->DrawYErrorBar($xpos,$ypos,$val,$this->error_bar_shape,$error_barcol);
+        } elseif ($key%3 == 1) {
+          $mine = $val ;
+          $this->DrawYErrorBar($xpos,$ypos,-$val,$this->error_bar_shape,$error_barcol);
+        }
+      }
+    }
+
+  }
+
+  function DrawDots() {
+    //Draw Dots - data comes in as array("title",x,y1,y2,y3,...);
+    reset($this->data_values);
+    while (list($j, $row) = each($this->data_values)) {
+      $color_index = 0;
+      //foreach ($row as $v)
+      while (list($k, $v) = each($row)) {
+        if ($k == 0) {
+        } elseif (($k == 1) && ($this->data_type == "data-data"))  {
+          $xpos = $v;
+        } else {
+          if ($this->data_type == "text-data") {
+            $xpos = ($j+.5);
+          }
+          if ($color_index >= count($this->ndx_data_color)) $color_index=0;
+          $barcol = $this->ndx_data_color[$color_index];
+
+          //if (is_numeric($v))  //PHP4 only
+          if ((strval($v) != "") ) {   //Allow for missing Y data
+            $this->DrawDot($xpos,$v,$this->point_shape,$barcol);
+          }
+          $color_index++;
+        }
+      }
+    }
+
+  } //function DrawDots
+
+  function DrawDotSeries() {
+    //Depreciated: Use DrawDots
+    $this->DrawDots();
+  }
+
+  function DrawThinBarLines() {
+    //A clean,fast routine for when you just want charts like stock volume charts
+    //Data must be text-data since I didn't see a graphing need for equally spaced thin lines.
+    //If you want it - then write to afan at jeo.net and I might add it.
+
+    if ($this->data_type != "data-data") {
+      //$this->DrawError('Data Type for ThinBarLines must be data-data'); 
+      $this->DrawError(THINBARLINES_DATA_TYPE_ERROR); 
+      };
+    $y1 = $this->ytr($this->x_axis_position);
+
+    reset($this->data_values);
+    while (list(, $row) = each($this->data_values)) {
+      $color_index = 0;
+      while (list($k, $v) = each($row)) {
+        if ($k == 0) {
+            $xlab = $v;
+        } elseif ($k == 1) {
+          $xpos = $this->xtr($v);
+          if ( ($this->draw_x_data_labels == 1) )  { //See "labels_note1 above.
+            $this->DrawXDataLabel($xlab,$xpos);
+          }
+        } else {
+          if ($color_index >= count($this->ndx_data_color)) $color_index=0;
+          $barcol = $this->ndx_data_color[$color_index];
+
+          ImageLine($this->img,$xpos,$y1,$xpos,$this->ytr($v),$barcol);
+          $color_index++;
+        }
+      }
+    }
+
+  }  //function DrawThinBarLines
+
+  function DrawYErrorBar($x_world,$y_world,$error_height,$error_bar_type,$color) {
+    $x1 = $this->xtr($x_world);
+    $y1 = $this->ytr($y_world);
+    $y2 = $this->ytr($y_world+$error_height) ;
+
+    for ($width = 0; $width < $this->error_bar_line_width; $width++) {
+      ImageLine($this->img, $x1+$width, $y1 , $x1+$width, $y2, $color);
+      ImageLine($this->img, $x1-$width, $y1 , $x1-$width, $y2, $color);
+    }
+    switch ($error_bar_type) {
+      case "line":
+        break;
+      case "tee":
+        ImageLine($this->img, $x1-$this->error_bar_size, $y2, $x1+$this->error_bar_size, $y2, $color);
+        break;
+      default:
+        ImageLine($this->img, $x1-$this->error_bar_size, $y2, $x1+$this->error_bar_size, $y2, $color);
+        break;
+    }
+    return true;
+  }
+
+  function DrawDot($x_world,$y_world,$dot_type,$color) {
+    $half_point = $this->point_size / 2;
+    $x1 = $this->xtr($x_world) - $half_point;
+    $x2 = $this->xtr($x_world) + $half_point;
+    $y1 = $this->ytr($y_world) - $half_point;
+    $y2 = $this->ytr($y_world) + $half_point;
+
+    switch ($dot_type) {
+      case "halfline":
+        ImageFilledRectangle($this->img, $x1, $this->ytr($y_world), $this->xtr($x_world), $this->ytr($y_world), $color);
+        break;
+      case "line":
+        ImageFilledRectangle($this->img, $x1, $this->ytr($y_world), $x2, $this->ytr($y_world), $color);
+        break;
+      case "rect":
+        ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $color);
+        break;
+      case "circle":
+        ImageArc($this->img, $x1 + $half_point, $y1 + $half_point, $this->point_size, $this->point_size, 0, 360, $color);
+        break;
+      case "dot":
+        ImageArc($this->img, $x1 + $half_point, $y1 + $half_point, $this->point_size, $this->point_size, 0, 360, $color);
+        ImageFillToBorder($this->img, $x1 + $half_point, $y1 + $half_point, $color, $color);
+        break;
+      case "diamond":
+
+        $arrpoints = array(
+          $x1,$y1 + $half_point,
+          $x1 + $half_point, $y1,
+          $x2,$y1 + $half_point,
+          $x1 + $half_point, $y2
+        );
+
+        ImageFilledPolygon($this->img, $arrpoints, 4, $color);
+        break;
+      case "triangle":
+        $arrpoints = array( $x1, $y1 + $half_point,
+          $x2, $y1 + $half_point,
+          $x1 + $half_point, $y2
+        );
+        ImageFilledPolygon($this->img, $arrpoints, 3, $color);
+        break;
+      default:
+        ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $color);
+        break;
+    }
+    return true;
+  }
+
+  function SetErrorBarLineWidth($which_seblw) {
+    $this->error_bar_line_width = $which_seblw;
+    return true;
+  }
+
+
+  function SetLineWidth($which_lw) {
+    $this->line_width = $which_lw;
+    if (!$this->error_bar_line_width) {
+      $this->error_bar_line_width = $which_lw;
+    }
+    return true;
+  }
+
+  function DrawArea() {
+    //Data comes in as $data[]=("title",x,y,...);
+    //Set first and last datapoints of area
+    $i = 0;
+    while ($i < $this->records_per_group) {
+      $posarr[$i][] =  $this->xtr($this->min_x);  //x initial
+      $posarr[$i][] =  $this->ytr($this->x_axis_position);  //y initial
+      $i++;
+    }
+
+    reset($this->data_values);
+    while (list($j, $row) = each($this->data_values)) {
+      $color_index = 0;
+      //foreach ($row as $v)
+      while (list($k, $v) = each($row)) {
+        if ($k == 0) {
+          //Draw Data Labels
+          $xlab = SubStr($v,0,$this->x_datalabel_maxlength);
+        } elseif ($k == 1) {
+          $x = $this->xtr($v);
+          // DrawXDataLabel interferes with Numbers on x-axis
+          //$this->DrawXDataLabel($xlab,$x);
+        } else {
+          // Create Array of points for later
+
+          $y = $this->ytr($v);
+          $posarr[$color_index][] = $x;
+          $posarr[$color_index][] = $y;
+          $color_index++;
+        }
+      }
+    }
+
+    //Final_points
+    for ($i = 0; $i < $this->records_per_group; $i++) {
+      $posarr[$i][] =  $this->xtr($this->max_x);      //x final
+      $posarr[$i][] =  $this->ytr($this->x_axis_position);  //y final
+      }
+
+    $color_index=0;
+
+    //foreach($posarr as $row)
+    reset($posarr);
+    while (list(, $row) = each($posarr)) {
+      if ($color_index >= count($this->ndx_data_color)) $color_index=0;
+      $barcol = $this->ndx_data_color[$color_index];
+//echo "$row[0],$row[1],$row[2],$row[3],$row[4],$row[5],$row[6],$row[7],$row[8],$row[9],$row[10],$row[11],$row[12], $barcol<br>";
+      ImageFilledPolygon($this->img, $row, (count($row)) / 2, $barcol);
+      $color_index++;
+    }
+//exit;
+
+  }
+
+  function DrawAreaSeries() {
+
+    //Set first and last datapoints of area
+    $i = 0;
+    while ($i < $this->records_per_group) {
+      $posarr[$i][] =  $this->xtr(.5);      //x initial
+      $posarr[$i][] =  $this->ytr($this->x_axis_position);  //y initial
+      $i++;
+    }
+
+    reset($this->data_values);
+    while (list($j, $row) = each($this->data_values)) {
+      $color_index = 0;
+      //foreach ($row as $v)
+      while (list($k, $v) = each($row)) {
+        if ($k == 0) {
+          //Draw Data Labels
+          $xlab = SubStr($v,0,$this->x_datalabel_maxlength);
+          $this->DrawXDataLabel($xlab,$this->xtr($j + .5));
+        } else {
+          // Create Array of points for later
+
+          $x = round($this->xtr($j + .5 ));
+          $y = round($this->ytr($v));
+          $posarr[$color_index][] = $x;
+          $posarr[$color_index][] = $y;
+          $color_index++;
+        }
+      }
+    }
+
+    //Final_points
+    for ($i = 0; $i < $this->records_per_group; $i++) {
+      $posarr[$i][] =  round($this->xtr($this->max_x + .5));  //x final
+      $posarr[$i][] =  $this->ytr($this->x_axis_position);    //y final
+      }
+
+    $color_index=0;
+
+    //foreach($posarr as $row)
+    reset($posarr);
+    while (list(, $row) = each($posarr)) {
+      if ($color_index >= count($this->ndx_data_color)) $color_index=0;
+      $barcol = $this->ndx_data_color[$color_index];
+//echo "$row[0],$row[1],$row[2],$row[3],$row[4],$row[5],$row[6],$row[7],$row[8],$row[9],$row[10],$row[11],$row[12], $barcol<br>";
+      ImageFilledPolygon($this->img, $row, (count($row)) / 2, $barcol);
+      $color_index++;
+    }
+
+  }
+
+  function DrawLines() {
+    //Data comes in as $data[]=("title",x,y,...);
+    $start_lines = 0;
+    if ($this->data_type == "text-data") {
+      $lastx[0] = $this->xtr(0);
+      $lasty[0] = $this->xtr(0);
+    }
+
+    //foreach ($this->data_values as $row)
+    reset($this->data_values);
+    while (list($j, $row) = each($this->data_values)) {
+
+      $color_index = 0;
+      $i = 0;
+      //foreach ($row as $v)
+      while (list($k, $v) = each($row)) {
+        if ($k == 0) {
+          $xlab = SubStr($v,0,$this->x_datalabel_maxlength);
+        } elseif (($k == 1) && ($this->data_type == "data-data"))  {
+            $x_now = $this->xtr($v);
+        } else {
+          //(double) $v;
+          // Draw Lines
+          if ($this->data_type == "text-data") {
+            $x_now = $this->xtr($j+.5);
+          }
+
+          //if (is_numeric($v))  //PHP4 only
+          if ((strval($v) != "") ) {   //Allow for missing Y data
+            $y_now = $this->ytr($v);
+            if ($color_index >= count($this->ndx_data_color)) { $color_index=0;} ;
+            $barcol = $this->ndx_data_color[$color_index];
+
+            if ($start_lines == 1) {
+              for ($width = 0; $width < $this->line_width; $width++) {
+                if ($this->line_style[$i] == "dashed") {
+                  $this->DrawDashedLine($x_now, $y_now + $width, $lastx[$i], $lasty[$i] + $width, 4,4, $barcol);
+                } else {
+                  ImageLine($this->img, $x_now, $y_now + $width, $lastx[$i], $lasty[$i] + $width, $barcol);
+                }
+              }
+            }
+            $lastx[$i] = $x_now;
+          } else {
+            $y_now = $lasty[$i];
+            //Don't increment lastx[$i]
+          }
+          //$bordercol = $this->ndx_data_border_color[$colbarcount];
+
+          $lasty[$i] = $y_now;
+          $color_index++;
+          $i++;
+        }
+        //Now we are assured an x_value
+        if ( ($this->draw_x_data_labels == 1) && ($k == 1) )  { //See "labels_note1 above.
+          $this->DrawXDataLabel($xlab,$x_now);
+        }
+      } //while rows of data
+      $start_lines = 1;
+    }
+  }
+
+    //Data comes in as $data[]=("title",x,y,e+,e-,y2,e2+,e2-,...);
+
+  function DrawLineSeries() {
+    //This function is replaced by DrawLines
+    //Tests have shown not much improvement in speed by having separate routines for DrawLineSeries and DrawLines
+    //For ease of programming I have combined them
+    return false;
+  } //function DrawLineSeries
+
+  function DrawDashedLine($x1pix,$y1pix,$x2pix,$y2pix,$dash_length,$dash_space,$color) {
+    //Code based on work by Ariel Garza and James Pine
+    //I've decided to have this be in pixels only as a replacement for ImageLine
+    //$x1pix = $this->xtr($x1);
+    //$y1pix = $this->ytr($y1);
+    //$x2pix = $this->xtr($x2);
+    //$y2pix = $this->ytr($y2);
+
+    // Get the length of the line in pixels
+    $line_length = ceil (sqrt(pow(($x2pix - $x1pix),2) + pow(($y2pix - $y1pix),2)) );
+
+    $dx = ($x2pix - $x1pix) / $line_length;
+    $dy = ($y2pix - $y1pix) / $line_length;
+    $lastx  = $x1pix;
+    $lasty  = $y1pix;
+
+    // Draw the dashed line
+    for ($i = 0; $i < $line_length; $i += ($dash_length + $dash_space)) {
+      $xpix = ($dash_length * $dx) + $lastx;
+      $ypix = ($dash_length * $dy) + $lasty;
+
+      ImageLine($this->img,$lastx,$lasty,$xpix,$ypix,$color);
+      $lastx = $xpix + ($dash_space * $dx);
+      $lasty = $ypix + ($dash_space * $dy);
+    }
+  } // function DrawDashedLine
+
+  function DrawBars() {
+
+    if ($this->data_type != "text-data") {
+      //$this->DrawError('Bar plots must be text-data: use function SetDataType("text-data")');
+      $this->DrawError(BAR_PLOTS_DATA_TYPE_ERROR);
+    }
+
+    $xadjust = ($this->records_per_group * $this->record_bar_width )/4;
+
+    reset($this->data_values);
+    while (list($j, $row) = each($this->data_values)) {
+
+      $color_index = 0;
+      $colbarcount = 0;
+      $x_now = $this->xtr($j+.5);
+
+      while (list($k, $v) = each($row)) {
+        if ($k == 0) {
+          //Draw Data Labels
+          $xlab = SubStr($v,0,$this->x_datalabel_maxlength);
+          $this->DrawXDataLabel($xlab,$x_now);
+        } else {
+          // Draw Bars ($v)
+          $x1 = $x_now - $this->data_group_space + ($k-1)*$this->record_bar_width;
+          $x2 = $x1 + $this->record_bar_width*$this->bar_width_adjust;
+
+          if ($v < $this->x_axis_position) {
+            $y1 = $this->ytr($this->x_axis_position);
+            $y2 = $this->ytr($v);
+          } else {
+            $y1 = $this->ytr($v);
+            $y2 = $this->ytr($this->x_axis_position);
+          }
+
+          if ($color_index >= count($this->ndx_data_color)) $color_index=0;
+          if ($colbarcount >= count($this->ndx_data_border_color)) $colbarcount=0;
+          $barcol = $this->ndx_data_color[$color_index];
+          $bordercol = $this->ndx_data_border_color[$colbarcount];
+
+          if ((strval($v) != "") ) {   //Allow for missing Y data
+            if ($this->shading > 0) {
+              for($i=0;$i<($this->shading);$i++) {
+              //Shading set in SetDefaultColors
+              ImageFilledRectangle($this->img, $x1+$i, $y1-$i, $x2+$i, $y2-$i, $this->ndx_i_light);
+              }
+            }
+
+            ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $barcol);
+            ImageRectangle($this->img, $x1, $y1, $x2, $y2, $bordercol);
+            if ($this->draw_data_labels == '1') {  //ajo
+              $y1 = $this->ytr($this->label_scale_position * $v);
+              //$this->DrawDataLabel($v,$j + .5,$v*$this->label_scale_position);
+              $this->DrawText($this->x_label_ttffont, $this->x_label_angle,
+                $x1+$this->record_bar_width/2, $y1, $this->ndx_label_color, $this->x_label_ttffont_size, $v,'center','top');
+            }
+          }
+
+          $color_index++;
+          $colbarcount++;
+        }
+      }
+    }
+  } //function DrawBars
+
+  function DrawLegend($which_x1,$which_y1,$which_boxtype) {
+    //Base code submitted by Marlin Viss
+    $max_legend_length=0;
+    reset($this->legend);
+    while (list(,$leg) = each($this->legend)) {
+      $len = strlen($leg);
+      if ($max_legend_length < $len) {
+        $max_legend_length = $len;
+      }
+    }
+
+    $line_spacing = 1.25;
+    $vert_margin = $this->small_font_height/2 ;
+    $dot_height = $this->small_font_height*$line_spacing - 1;
+
+  //Upper Left
+    if ((!$which_x1) || (!$which_y1) ) {
+      $box_start_x = $this->plot_area[2] - $this->small_font_width*($max_legend_length+4);
+      $box_start_y = $this->plot_area[1] + 4;
+    } else {
+      $box_start_x = $which_x1;
+      $box_start_y = $which_y1;
+    }
+
+  //Lower Right
+    $box_end_y = $box_start_y + $this->small_font_height*(count($this->legend)+1) + 2*$vert_margin;
+    //$box_end_x = $this->plot_area[2] - 5;
+    $box_end_x = $box_start_x + $this->small_font_width*($max_legend_length+4) - 5;
+
+
+  // Draw box for legend
+    ImageFilledRectangle($this->img,
+      $box_start_x, $box_start_y,$box_end_x,
+      $box_end_y, $this->ndx_bg_color);
+    ImageRectangle($this->img,
+      $box_start_x, $box_start_y,$box_end_x,
+      $box_end_y, $this->ndx_grid_color);
+
+    $color_index=0;
+    $i = 0;
+
+
+    reset($this->legend);
+
+
+    while (list(,$leg) = each($this->legend)) {
+      $y_pos = $box_start_y + $this->small_font_height*($i)*($line_spacing) + $vert_margin;
+
+      ImageString($this->img, $this->small_font,
+      $box_start_x + $this->small_font_width*( $max_legend_length - strlen($leg) + 1 ) ,
+      $y_pos,
+      $leg, $this->ndx_text_color);
+
+      if ($color_index >= count($this->ndx_data_color)) $color_index=0;
+  // Draw a box in the data color
+      ImageFilledRectangle($this->img,
+        $box_end_x - $this->small_font_width*2,
+        $y_pos + 1, $box_end_x - $this->small_font_width,
+        $y_pos + $dot_height,
+        $this->ndx_data_color[$color_index]);
+
+      ImageRectangle($this->img,
+        $box_end_x - $this->small_font_width*2,
+        $y_pos + 1, $box_end_x - $this->small_font_width,
+        $y_pos + $dot_height,
+        $this->ndx_text_color);
+      $i++;
+      $color_index++;
+    }
+  } //function DrawLegend
+
+
+  function DrawGraph() {
+
+    if (($this->img) == "") {
+      //$this->DrawError('No Image Defined: DrawGraph');
+      $this->DrawError(NO_IMAGE_DEFINED_DRAWGRAPH_ERROR);
+            //$this->PHPlot();
+        }
+
+    if (! is_array($this->data_values)) {
+      $this->DrawBackground();
+      //$this->DrawError("No array of data in \$data_values");
+      $this->DrawError(NO_ARRAY_OF_DATA_IN_ERROR." \$data_values");
+    } else {
+      if (!$this->data_color) {
+        $this->SetDataColors(array('blue','green','yellow','red','orange','blue'),array('black'));
+      }
+
+      $this->FindDataLimits();  //Get maxima and minima for scaling
+
+      $this->SetXLabelHeight();   //Get data for bottom margin
+
+      $this->SetYLabelWidth();    //Get data for left margin
+
+      if (!$this->plot_area_width) {
+        $this->SetPlotAreaPixels('','','','');    //Set Margins
+      }
+
+      if (!$this->plot_max_y) {  //If not set by user call SetPlotAreaWorld,
+        $this->SetPlotAreaWorld('','','','');
+      }
+
+      if ($this->data_type == "text-data") {
+        $this->SetEqualXCoord();
+      }
+
+      $this->SetPointSize($this->point_size);
+
+      $this->DrawBackground();
+      $this->DrawImageBorder();
+
+      $this->SetTranslation();
+
+      if ($this->draw_plot_area_background == 1) {
+        $this->DrawPlotAreaBackground();
+      }
+//$foo = "$this->max_y, $this->min_y, $new_miny, $new_maxy, $this->x_label_height";
+//ImageString($this->img, 4, 20, 20, $foo, $this->ndx_text_color);
+
+      switch ($this->plot_type) {
+        case "bars":
+          $this->DrawPlotBorder();
+          $this->DrawLabels();
+          $this->DrawBars();
+          $this->DrawXAxis();
+          break;
+        case "thinbarline":
+          $this->DrawPlotBorder();
+          $this->DrawLabels();
+          $this->DrawThinBarLines();
+          break;
+        case "lines":
+          $this->DrawPlotBorder();
+          $this->DrawLabels();
+          if ( $this->data_type == "text-data") {
+            $this->DrawLines();
+          } elseif ( $this->data_type == "data-data-error") {
+            $this->DrawLinesError();
+          } else {
+            $this->DrawLines();
+          }
+          break;
+        case "area":
+          $this->DrawPlotBorder();
+          $this->DrawLabels();
+          if ( $this->data_type == "text-data") {
+            $this->DrawAreaSeries();
+          } else {
+            $this->DrawArea();
+          }
+          break;
+        case "linepoints":
+          $this->DrawPlotBorder();
+          $this->DrawLabels();
+          if ( $this->data_type == "text-data") {
+            $this->DrawLines();
+            $this->DrawDots();
+          } elseif ( $this->data_type == "data-data-error") {
+            $this->DrawLinesError();
+            $this->DrawDotsError();
+          } else {
+            $this->DrawLines();
+            $this->DrawDots();
+          }
+          break;
+        case "points";
+          $this->DrawPlotBorder();
+          $this->DrawLabels();
+          if ( $this->data_type == "text-data") {
+            $this->DrawDots();
+          } elseif ( $this->data_type == "data-data-error") {
+            $this->DrawDotsError();
+          } else {
+            $this->DrawDots();
+          }
+          break;
+        case "pie":
+          $this->DrawPieChart();
+          $this->DrawLabels();
+          break;
+        default:
+          $this->DrawPlotBorder();
+          $this->DrawLabels();
+          $this->DrawBars();
+          break;
+      }
+
+      if ($this->legend) {
+        $this->DrawLegend($this->legend_x_pos,$this->legend_y_pos,'');
+      }
+
+    }
+    if ($this->print_image == 1) {
+      $this->PrintImage();
+    }
+  } //function DrawGraph
+
+ }
+
+// $graph = new PHPlot;
+
+// $graph->DrawGraph();
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/rci.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/rci.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/rci.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,85 @@
+<?php
+/*
+  $Id: cre_RCI.php,v 1.0.0.0 2006/11/21 13:41:11 ccwjr Exp $
+
+  CRE Loaded, Open Source E-Commerce Solutions
+  http://www.creloaded.com
+
+  Copyright (c) 2006 CRE Loaded
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class cre_RCI {
+    var $_folders = array();
+
+    function cre_RCI() {
+      if ( ! isset($_SESSION['cre_RCI_data']) ) {
+        $_SESSION['cre_RCI_data'] = array('folders' => array() );
+      }
+      $this->_folders =& $_SESSION['cre_RCI_data']['folders'];
+    }
+
+    function get($pageName, $function, $display = true) {
+      $pageName = strtolower($pageName);
+      $function = strtolower($function);
+      $rci_holder = '';
+      
+      // if cache is allowed, see if the page name is known
+      if (USE_CACHE == 'false' || USE_CACHE == 'False' || ! array_key_exists($pageName, $this->_folders) ) {
+        $this->_build_folder($pageName);
+      }
+
+      if ( array_key_exists($function, $this->_folders[$pageName]) ) {
+        foreach( $this->_folders[$pageName][$function] as $fileName ) {
+          // safety check in case a fasle positive was received on the cache check
+          if ( ! file_exists(DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName) ) {
+            $this->_folders = array();  // invalid the cache since it is corrupt
+            continue;
+          }
+          $rci = '';
+          if ($pageName == 'stylesheet') {  // special case of a style sheet
+            $rci = '<link rel="stylesheet" type="text/css" href="' . DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName . '" />';
+          } else {
+            include(DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName);
+          }
+          if ((DISPLAY_PAGE_PARSE_TIME == 'true') && ($display == true)) {
+            $rci_holder .= '<!-- RCI [BOM] -' . $pageName . '-' . $function . ' : ' . DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName . ' --->' . $rci . '<!-- RCI [EOM] -' . $pageName . '-' . $function . ' : ' . DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName . ' --->';
+          } else {
+            $rci_holder .= $rci;
+          }
+        }
+      }
+      return $rci_holder;
+    }
+
+    function _build_folder($pageName) {
+      $this->_folders[$pageName] = array();    
+      if ( is_dir(DIR_WS_INCLUDES . 'runtime/' . $pageName) ) {
+        $filesFound = array();
+        if ($pageName == 'stylesheet') {
+          $pattern = '/(\w*)_*(\w+)_(\w+)_(\w+)\.css$/';
+        }else{
+          $pattern = '/(\w*)_*(\w+)_(\w+)_(\w+)\.php$/';
+        }
+        $dir = opendir(DIR_WS_INCLUDES . 'runtime/' . $pageName);
+        while( $file = readdir( $dir ) ) {
+          if ($file == '.'  || $file == '..') continue;
+          $match = array();
+          if ( preg_match($pattern, $file, $match) > 0 ) {
+            if ( $match[3] == $pageName ) {
+              $filesFound[$match[0]] = $match[4];
+            }
+          }
+        }
+        if ( count($filesFound) > 0) {
+          ksort($filesFound);
+          foreach( $filesFound as $file => $function ) {
+            $this->_folders[$pageName][$function][] = $file;
+          }
+        }
+      }
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/classes/sales_report2.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/sales_report2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/sales_report2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,226 @@
+<?php
+/*
+  $Id: sales_report2.php,v 1.00 2003/03/08 19:25:29 Exp $
+
+  Charly Wilhelm charly at yoshi.ch
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class sales_report {
+    var $mode, $globalStartDate, $startDate, $endDate, $actDate, $showDate, $showDateEnd, $sortString, $status, $outlet;
+
+    function sales_report($mode, $startDate = 0, $endDate = 0, $sort = 0, $statusFilter = 0, $filter = 0) {
+      // startDate and endDate have to be a unix timestamp. Use mktime !
+      // if set then both have to be valid startDate and endDate
+      $this->mode = $mode;
+      $this->tax_include = DISPLAY_PRICE_WITH_TAX;
+
+      $this->statusFilter = $statusFilter;
+            
+      // get date of first sale
+      $firstQuery = tep_db_query("select UNIX_TIMESTAMP(min(date_purchased)) as first FROM " . TABLE_ORDERS);
+      $first = tep_db_fetch_array($firstQuery);
+      $this->globalStartDate = mktime(0, 0, 0, date("m", $first['first']), date("d", $first['first']), date("Y", $first['first']));
+            
+      $statusQuery = tep_db_query("select * from orders_status");
+      $i = 0;
+      while ($outResp = tep_db_fetch_array($statusQuery)) {
+        $status[$i] = $outResp;
+        $i++;
+      }
+      $this->status = $status;
+
+      
+      if ($startDate == 0  or $startDate < $this->globalStartDate) {
+        // set startDate to globalStartDate
+        $this->startDate = $this->globalStartDate;
+      } else {
+        $this->startDate = $startDate;
+      }
+      if ($this->startDate > mktime(0, 0, 0, date("m"), date("d"), date("Y"))) {
+        $this->startDate = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
+      }
+
+      if ($endDate > mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"))) {
+        // set endDate to tomorrow
+        $this->endDate = mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"));
+      } else {
+        $this->endDate = $endDate;
+      }
+      if ($this->endDate < $this->startDate + 24 * 60 * 60) {
+        $this->endDate = $this->startDate + 24 * 60 * 60;
+      }
+
+      $this->actDate = $this->startDate;
+
+      // query for order count
+      $this->queryOrderCnt = "SELECT count(o.orders_id) as order_cnt FROM " . TABLE_ORDERS . " o";
+
+      // queries for item details count
+      $this->queryItemCnt = "SELECT o.orders_id, op.products_id as pid, op.orders_products_id, op.products_name as pname, sum(op.products_quantity) as pquant, sum(op.final_price * op.products_quantity) as psum, op.products_tax as ptax FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op WHERE o.orders_id = op.orders_id";
+
+      // query for attributes
+      $this->queryAttr = "SELECT count(op.products_id) as attr_cnt, o.orders_id, opa.orders_products_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " opa, " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op WHERE o.orders_id = opa.orders_id AND op.orders_products_id = opa.orders_products_id";
+
+      // query for shipping
+      $this->queryShipping = "SELECT sum(ot.value) as shipping FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot WHERE ot.orders_id = o.orders_id AND  ot.class = 'ot_shipping'";
+
+      switch ($sort) {
+        case '0':
+          $this->sortString = "";
+          break;
+        case '1':
+          $this->sortString = " order by pname asc ";
+          break;
+        case '2':
+          $this->sortString = " order by pname desc";
+          break;
+        case '3':
+          $this->sortString = " order by pquant asc, pname asc";
+          break;
+        case '4':
+          $this->sortString = " order by pquant desc, pname asc";
+          break;
+        case '5':
+          $this->sortString = " order by psum asc, pname asc";
+          break;
+        case '6':
+          $this->sortString = " order by psum desc, pname asc";
+          break;
+      }
+
+    }
+
+    function getNext() {
+      switch ($this->mode) {
+        // yearly
+        case '1':
+          $sd = $this->actDate;
+          $ed = mktime(0, 0, 0, date("m", $sd), date("d", $sd), date("Y", $sd) + 1);
+          break;
+        // monthly
+        case '2':
+          $sd = $this->actDate;
+          $ed = mktime(0, 0, 0, date("m", $sd) + 1, 1, date("Y", $sd));
+          break;
+        // weekly
+        case '3':
+          $sd = $this->actDate;
+          $ed = mktime(0, 0, 0, date("m", $sd), date("d", $sd) + 7, date("Y", $sd));
+          break;
+        // daily
+        case '4':
+          $sd = $this->actDate;
+          $ed = mktime(0, 0, 0, date("m", $sd), date("d", $sd) + 1, date("Y", $sd));
+          break;
+      }
+      if ($ed > $this->endDate) {
+        $ed = $this->endDate;
+      }
+
+      $filterString = "";
+      if ($this->statusFilter > 0) {
+        $filterString .= " AND o.orders_status = " . $this->statusFilter . " ";
+      }
+      $rqOrders = tep_db_query($this->queryOrderCnt . " WHERE o.date_purchased >= '" . tep_db_input(date("Y-m-d\TH:i:s", $sd)) . "' AND o.date_purchased < '" . tep_db_input(date("Y-m-d\TH:i:s", $ed)) . "'" . $filterString);
+      $order = tep_db_fetch_array($rqOrders);
+
+      $rqShipping = tep_db_query($this->queryShipping . " AND o.date_purchased >= '" . tep_db_input(date("Y-m-d\TH:i:s", $sd)) . "' AND o.date_purchased < '" . tep_db_input(date("Y-m-d\TH:i:s", $ed)) . "'" . $filterString);
+      $shipping = tep_db_fetch_array($rqShipping);
+
+      $rqItems = tep_db_query($this->queryItemCnt . " AND o.date_purchased >= '" . tep_db_input(date("Y-m-d\TH:i:s", $sd)) . "' AND o.date_purchased < '" . tep_db_input(date("Y-m-d\TH:i:s", $ed)) . "'" . $filterString . " group by pid " . $this->sortString);
+
+      // set the return values
+      $this->actDate = $ed;
+      $this->showDate = $sd;
+      $this->showDateEnd = $ed - 60 * 60 * 24;
+
+      // execute the query
+      $cnt = 0;
+      $itemTot = 0;
+      $sumTot = 0;
+      while ($resp[$cnt] = tep_db_fetch_array($rqItems)) {
+        // to avoid rounding differences round for every quantum
+        // multiply with the number of items afterwords.
+        $price = $resp[$cnt]['psum'] / $resp[$cnt]['pquant'];
+
+        // products_attributes
+        // are there any attributes for this order_id ?
+        $rqAttr = tep_db_query($this->queryAttr . " AND o.date_purchased >= '" . tep_db_input(date("Y-m-d\TH:i:s", $sd)) . "' AND o.date_purchased < '" . tep_db_input(date("Y-m-d\TH:i:s", $ed)) . "' AND op.products_id = " . $resp[$cnt]['pid'] . $filterString . " group by products_options_values order by orders_products_id");
+        $i = 0;
+        while ($attr[$i] = tep_db_fetch_array($rqAttr)) {
+          $i++;
+        }
+
+        // values per date
+        if ($i > 0) {
+          $price2 = 0;
+          $price3 = 0;
+          $option = array();
+          $k = -1;
+          $ord_pro_id_old = 0;
+          for ($j = 0; $j < $i; $j++) {
+            if ($attr[$j]['price_prefix'] == "-") {
+              $price2 += (-1) *  $attr[$j]['options_values_price'];
+              $price3 = (-1) * $attr[$j]['options_values_price'];
+              $prefix = "-";
+            } else {
+              $price2 += $attr[$j]['options_values_price'];
+              $price3 = $attr[$j]['options_values_price'];
+              $prefix = "+";
+            }
+            $ord_pro_id = $attr[$j]['orders_products_id'];
+            if ( $ord_pro_id != $ord_pro_id_old) {
+              $k++;
+              $l = 0;
+              // set values
+              $option[$k]['quant'] = $attr[$j]['attr_cnt'];
+              $option[$k]['options'][0] = $attr[$j]['products_options'];
+              $option[$k]['options_values'][0] = $attr[$j]['products_options_values'];
+              if ($price3 != 0) {
+                $option[$k]['price'][0] = tep_add_tax($price3, $resp[$cnt]['ptax']);
+              } else {
+                $option[$k]['price'][0] = 0;
+              }
+            } else {
+              $l++;
+              // update values
+              $option[$k]['options'][$l] = $attr[$j]['products_options'];
+              $option[$k]['options_values'][$l] = $attr[$j]['products_options_values'];
+              if ($price3 != 0) {
+                $option[$k]['price'][$l] = tep_add_tax($price3, $resp[$cnt]['ptax']);
+              } else {
+                $option[$k]['price'][$l] = 0;
+              }
+            }
+            $ord_pro_id_old = $ord_pro_id;
+          }
+          // set attr value
+          $resp[$cnt]['attr'] = $option;
+        } else {
+          $resp[$cnt]['attr'] = "";
+        }
+        $resp[$cnt]['price'] = tep_add_tax($price, $resp[$cnt]['ptax']);
+        $resp[$cnt]['psum'] = $resp[$cnt]['pquant'] * tep_add_tax($price, $resp[$cnt]['ptax']);
+        $resp[$cnt]['order'] = $order['order_cnt'];
+        $resp[$cnt]['shipping'] = $shipping['shipping'];
+
+        // values per date and item
+        $sumTot += $resp[$cnt]['psum'];
+        $itemTot += $resp[$cnt]['pquant'];
+        // add totsum and totitem until current row
+        $resp[$cnt]['totsum'] = $sumTot;
+        $resp[$cnt]['totitem'] = $itemTot;
+        $cnt++;
+      }
+
+      return $resp;
+    }
+}
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/sessions.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/sessions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/sessions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,521 @@
+<?php
+/*
+  $Id: sessions.php,v 1.1.1.1 2004/03/04 23:39:48 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  Original source from Web Application Development with PHP (Tobias Ratschiller, Till Gerken)
+  Copyright (c) 2000, New Riders Publishing
+*/
+
+  $SID = '';
+
+  class php3session {
+    var $name = PHP_SESSION_NAME;
+    var $auto_start = false;
+    var $referer_check = false;
+
+    var $save_path = PHP_SESSION_SAVE_PATH;
+    var $save_handler = 'php3session_files';
+
+    var $lifetime = 0;
+
+    var $cache_limiter = 'nocache';
+    var $cache_expire = 180;
+
+    var $use_cookies = true;
+    var $cookie_lifetime = 0;
+    var $cookie_path = PHP_SESSION_PATH;
+    var $cookie_domain = PHP_SESSION_DOMAIN;
+
+    var $gc_probability = 1;
+    var $gc_maxlifetime = 0;
+
+    var $serialize_handler = 'php';
+    var $ID;
+
+    var $nr_open_sessions = 0;
+    var $mod_name = '';
+    var $id;
+    var $delimiter = "\n";
+    var $delimiter_value = '[==]';
+
+    var $vars;
+    function php3session() {
+      $this->mod_name = $this->save_handler;
+      $this->vars = array();
+    }
+  }
+
+  class php3session_user {
+    var $open_func, $close_func, $read_func, $write_func, $destroy_func, $gc_func;
+
+    function open($save_path, $sess_name) {
+      $func = $this->open_func;
+      if (function_exists($func)) {
+        return $func($save_path, $sess_name);
+      }
+
+      return true;
+    }
+
+    function close($save_path, $sess_name) {
+      $func = $this->close_func;
+      if (function_exists($func)) {
+        return $func();
+      }
+
+      return true;
+    }
+
+    function read($sess_id) {
+      $func = $this->read_func;
+
+      return $func($sess_id);
+    }
+
+    function write($sess_id, $val) {
+      $func = $this->write_func;
+
+      return $func($sess_id, $val);
+    }
+
+    function destroy($sess_id) {
+      $func = $this->destroy_func;
+      if (function_exists($func)) {
+        return $func($sess_id);
+      }
+
+      return true;
+    }
+
+    function gc($max_lifetime) {
+      $func = $this->gc_func;
+      if (function_exists($func)) {
+        return $func($max_lifetime);
+      }
+
+      return true;
+    }
+  }
+
+  class php3session_files {
+    function open($save_path, $sess_name) {
+      return true;
+    }
+
+    function close() {
+      return true;
+    }
+
+    function read($sess_id) {
+      global $session;
+
+// Open, read in, close file with session data
+      $file = $session->save_path . '/sess_' . $sess_id;
+      if (!file_exists($file)) {
+// Create it
+        touch($file);
+      }
+     // $fp = fopen($file, 'r') or die('Could not open session file (' . $file . ').');
+      $fp = fopen($file, 'r') or die(SESSION_FILE_ERROR_1. $file . SESSION_FILE_ERROR_2);
+      $val = fread($fp, filesize($file));
+      fclose($fp);
+
+      return $val;
+    }
+
+    function write($sess_id, $val) {
+      global $session;
+
+// Open, write to, close file with session data
+      $file = $session->save_path . '/sess_' . $sess_id;
+      //$fp = fopen($file, 'w') or die('Could not write session file (' . $file . ')');
+      $fp = fopen($file, 'w') or die(SESSION_FILE_WRITE_ERROR_1 . $file . SESSION_FILE_WRITE_ERROR_2);
+      $val = fputs($fp, $val);
+      fclose($fp);
+
+      return true;
+    }
+
+    function destroy($sess_id) {
+      global $session;
+
+      $file = $session->save_path . '/sess_' . $sess_id;
+      unlink($file);
+
+      return true;
+    }
+
+    function gc($max_lifetime) {
+// We return true, since all cleanup should be handled by
+// an external entity (i.e. find -ctime x | xargs rm)
+      return true;
+    }
+  }
+
+  function _session_create_id() {
+    return md5(uniqid(microtime()));
+  }
+
+  function _session_cache_limiter() {
+    global $session;
+
+    switch ($session->cache_limiter) {
+      case 'nocache':
+                      header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
+                      header('Cache-Control: no-cache');
+                      header('Pragma: no-cache');
+                      break;
+      case 'private':
+                      header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
+                      header(sprintf('Cache-Control: private, max-age=%s', $session->cache_expire * 60));
+                      header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime(basename($GLOBALS['PHP_SELF']))) . ' GMT');
+                      break;
+      case 'public':
+                      $now = time();
+                      $now += $session->cache_expire * 60;
+                      $now = gmdate('D, d M Y H:i:s', $now) . ' GMT';
+                      header('Expires: ' . $now);
+                      header(sprintf('Cache-Control: public, max-age=%s', $session->cache_expire * 60));
+                      header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime(basename($GLOBALS['PHP_SELF']))) . ' GMT');
+                      break;
+      default:
+                      //die('Caching method ' . $session->cache_limiter . ' not implemented.');
+                      die(CACHING_METHOD_ERROR_1 . $session->cache_limiter . CACHING_METHOD_ERROR_2);
+    }
+  }
+
+  function _php_encode() {
+    global $session;
+
+    $ret = '';
+// Create a string containing the serialized variables
+    for (reset($session->vars); list($i)=each($session->vars);) {
+      $ret .= $session->vars[$i] . $session->delimiter_value . serialize($GLOBALS[$session->vars[$i]]) . $session->delimiter;
+    }
+
+    return $ret;
+  }
+
+  function _php_decode($data) {
+    global $session;
+
+    $data = trim($data);
+    $vars = explode($session->delimiter, $data);
+
+// Add the variables to the global namespace
+    for (reset($vars); list($i)=each($vars);) {
+      $tmp = explode($session->delimiter_value, $vars[$i]);
+      $name = trim($tmp[0]);
+      $value = trim($tmp[1]);
+      $GLOBALS[$name] = unserialize($value);
+      $session->vars[] = trim($name);
+    }
+  }
+
+  function _wddx_encode($data) {
+    global $session;
+
+    $ret = wddx_serialize_vars($session->vars);
+
+    return $ret;
+  }
+
+  function _wddx_decode($data) {
+    return wddx_deserialize($data);
+  }
+
+  function session_name($name = '') {
+    global $session;
+
+    if (empty($name)) {
+      return $session->name;
+    }
+
+    $session->name = $name;
+  }
+
+  function session_set_save_handler($open, $close, $read, $write, $destroy, $gc) {
+    global $session, $php3session_user;
+
+    $php3session_user = new php3session_user;
+    $php3session_user->open_func = $open;
+    $php3session_user->close_func = $close;
+    $php3session_user->read_func = $read;
+    $php3session_user->write_func = $write;
+    $php3session_user->destroy_func = $destroy;
+    $php3session_user->gc_func = $gc;
+    $session->mod_name = 'php3session_user';
+  }
+
+  function session_module_name($name = '') {
+    global $session;
+
+    if (empty($name)) {
+      return $session->mod_name;
+    }
+
+    $session->mod_name = $name;
+  }
+
+  function session_save_path($path = '') {
+    global $session;
+
+    if(empty($path)) {
+      return $session->save_path;
+    }
+
+    $session->save_path = $path;
+  }
+
+  function session_id($id = '') {
+    global $session;
+
+    if(empty($id)) {
+      return $session->id;
+    }
+
+    $session->id = $id;
+  }
+
+  function session_register($var) {
+    global $session;
+
+    if ($session->nr_open_sessions == 0) {
+      session_start();
+    }
+
+    $session->vars[] = trim($var);
+  }
+
+  function session_unregister($var) {
+    global $session;
+
+    for (reset($session->vars); list($i)=each($session->vars);) {
+      if ($session->vars[$i] == trim($var)) {
+        unset($session->vars[$i]);
+        break;
+      }
+    }
+  }
+
+  function session_is_registered($var) {
+    global $session;
+
+    for (reset($session->vars); list($i)=each($session->vars);) {
+      if ($session->vars[$i] == trim($var)) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  function session_encode() {
+    global $session;
+
+    $serializer = '_' . $session->serialize_handler . '_encode';
+    $ret = $serializer();
+
+    return $ret;
+  }
+
+  function session_decode($data) {
+    global $session;
+
+    $serializer = '_' . $session->serialize_handler . '_decode';
+    $ret = $serializer($data);
+
+    return $ret;
+  }
+
+  function session_start() {
+    global $session, $SID, $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS;
+
+// Define the global variable $SID?
+    $define_sid = true;
+
+// Send the session cookie?
+    $send_cookie = true;
+
+// Is track_vars enabled?
+    $track_vars = ( (isset($HTTP_COOKIE_VARS)) || (isset($HTTP_GET_VARS)) || (isset($HTTP_POST_VARS)) ) ? true : false;
+
+// Check if session_start() has been called once already
+    if ($session->nr_open_sessions != 0) {
+      return false;
+    }
+
+// If our only resource is the global symbol_table, then check it.
+// If track_vars are enabled, we prefer these, because they are more
+// reliable, and we always know whether the user has accepted the
+// cookie.
+    if ( (isset($GLOBALS[$session->name])) && (!empty($GLOBALS[$session->name])) && (!$track_vars) ) {
+      $session->id = $GLOBALS[$session->name];
+      $send_cookie = false;
+    }
+
+// Now check the track_vars. Cookies are preferred, because initially
+// cookie and get variables will be available.
+    if ( (empty($session->id)) && ($track_vars) ) {
+      if (isset($HTTP_COOKIE_VARS[$session->name])) {
+        $session->id = $HTTP_COOKIE_VARS[$session->name];
+        $define_sid = false;
+        $send_cookie = false;
+      }
+
+      if (isset($HTTP_GET_VARS[$session->name])) {
+        $session->id = $HTTP_GET_VARS[$session->name];
+      }
+
+      if (isset($HTTP_POST_VARS[$session->name])) {
+        $session->id = $HTTP_POST_VARS[$session->name];
+      }
+    }
+
+/*
+// Check the REQUEST_URI symbol for a string of the form
+// '<session-name>=<session-id>' to allow URLs of the form
+// http://yoursite/<session-name>=<session-id>/script.php
+    if (empty($session->id)) {
+      eregi($session->name . '=([^/]+)', $GLOBALS['REQUEST_URI'], $regs);
+      $regs[1] = trim($regs[1]);
+      if (!empty($regs[1])) {
+        $session->id = $regs[1];
+      }
+    }
+*/
+
+// Check whether the current request was referred to by
+// an external site which invalidates the previously found ID
+    if ( (!empty($session->id)) && ($session->referer_check) ) {
+      $url = parse_url($GLOBALS['HTTP_REFERER']);
+      if (trim($url['host']) != $GLOBALS['SERVER_NAME']) {
+        unset($session->id);
+        $send_cookie = true;
+        $define_sid = true;
+      }
+    }
+
+// Do we have an existing session ID?
+    if (empty($session->id)) {
+// Create new session ID
+      $session->id = _session_create_id();
+    }
+
+// Is use_cookies set to false?
+    if ( (!$session->use_cookies) && ($send_cookie) ) {
+      $define_sid = true;
+      $send_cookie = false;
+    }
+
+// Should we send a cookie?
+    if ($send_cookie) {
+      setcookie($session->name, $session->id, $session->cookie_lifetime, $session->cookie_path, $session->cookie_domain);
+    }
+
+// Should we define the SID?
+    if($define_sid) {
+      $SID = $session->name . '=' . $session->id;
+    }
+
+    $session->nr_open_sessions++;
+
+// Send caching headers
+
+// Start session
+    $mod = $GLOBALS[$session->mod_name];
+    if (!$mod->open($session->save_path, $session->name)) {
+     // die('Failed to initialize session module.');
+      die(INITIALIZE_SESSION_MODULE_ERROR);
+    }
+
+// Read session data
+    if ($val = $mod->read($session->id)) {
+// Decode session data
+      session_decode($val);
+    }
+
+// Send HTTP cache headers
+    _session_cache_limiter();
+
+// Check if we should clean up (call the garbage collection routines)
+    if ($session->gc_probability > 0) {
+      $randmax = getrandmax();
+      $nrand = (int)(100 * tep_rand() / $randmax);
+      if ($nrand < $session->gc_probability) {
+        $mod->gc($session->gc_maxlifetime);
+      }
+    }
+
+    if ($define_sid) {
+      define('SID', $SID);
+    } else {
+      define('SID', '');
+    }
+
+    return true;
+  }
+
+  function session_destroy() {
+    global $session;
+
+    if ($session->nr_open_sessions == 0) {
+      return false;
+    }
+
+// Destroy session
+    $mod = $GLOBALS[$session->mod_name];
+    if (!$mod->destroy($session->id)) {
+      return false;
+    }
+    unset($session);
+    $session = new php3session;
+
+    return true;
+  }
+
+  function session_close() {
+    global $session, $SID;
+
+    if ($session->nr_open_sessions == 0) {
+      return false;
+    }
+// Encode session
+    $val = session_encode();
+    $len = strlen($val);
+
+// Save session
+    $mod = $GLOBALS[$session->mod_name];
+    if (!$mod->write($session->id, $val)) {
+     // die('Session could not be saved.');
+      die(SESSION_NOT_SAVED_ERROR);
+    }
+// Close session
+    if ( (function_exists($session->mod_name . '->close')) && (!$mod->close()) ) {
+      //die('Session could not be closed.');
+      die(SESSION_NOT_CLOSED_ERROR);
+    }
+    $SID = '';
+    $session->nr_open_sessions--;
+
+    return true;
+  }
+
+  $session = new php3session;
+  $mod = $session->save_handler;
+  $$mod = new $mod;
+
+  if ($session->auto_start) {
+   // $ret = session_start() or die('Session could not be started.');
+    $ret = session_start() or die(SESSION_NOT_STARTED_ERROR);
+  }
+
+  register_shutdown_function('session_close');
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,306 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.1.1.1 2004/03/04 23:39:49 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class shoppingCart {
+    var $contents, $total, $weight;
+
+    function shoppingCart() {
+      $this->reset();
+    }
+
+    function restore_contents() {
+      global $customer_id;
+
+      if (!$customer_id) return 0;
+
+// insert current cart contents in database
+      if ($this->contents) {
+        reset($this->contents);
+        while (list($products_id, ) = each($this->contents)) {
+          $qty = $this->contents[$products_id]['qty'];
+          $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+          if (!tep_db_num_rows($product_query)) {
+            tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . tep_db_input($qty) . "', '" . date('Ymd') . "')");
+            if ($this->contents[$products_id]['attributes']) {
+              reset($this->contents[$products_id]['attributes']);
+              while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
+                tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
+              }
+            }
+          } else {
+            tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . tep_db_input($qty) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+          }
+        }
+      }
+
+// reset per-session cart contents, but not the database contents
+      $this->reset(FALSE);
+
+      $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
+      while ($products = tep_db_fetch_array($products_query)) {
+        $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']);
+// attributes
+        $attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
+        while ($attributes = tep_db_fetch_array($attributes_query)) {
+          $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
+        }
+      }
+
+      $this->cleanup();
+    }
+
+    function reset($reset_database = FALSE) {
+      global $customer_id;
+
+      $this->contents = array();
+      $this->total = 0;
+
+      if ($customer_id && $reset_database) {
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'");
+      }
+    }
+
+    function add_cart($products_id, $qty = '', $attributes = '') {
+      global $new_products_id_in_cart, $customer_id;
+
+      $products_id = tep_get_uprid($products_id, $attributes);
+
+      if ($this->in_cart($products_id)) {
+        $this->update_quantity($products_id, $qty, $attributes);
+      } else {
+        if ($qty == '') $qty = '1'; // if no quantity is supplied, then add '1' to the customers basket
+
+        $this->contents[] = array($products_id);
+        $this->contents[$products_id] = array('qty' => $qty);
+// insert into database
+        if ($customer_id) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . tep_db_input($qty) . "', '" . date('Ymd') . "')");
+
+        if (is_array($attributes)) {
+          reset($attributes);
+          while (list($option, $value) = each($attributes)) {
+            $this->contents[$products_id]['attributes'][$option] = $value;
+// insert into database
+            if ($customer_id) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
+          }
+        }
+        $new_products_id_in_cart = $products_id;
+        tep_session_register('new_products_id_in_cart');
+      }
+      $this->cleanup();
+    }
+
+    function update_quantity($products_id, $quantity = '', $attributes = '') {
+      global $customer_id;
+
+      if ($quantity == '') return true; // nothing needs to be updated if theres no quantity, so we return true..
+
+      $this->contents[$products_id] = array('qty' => $quantity);
+// update database
+      if ($customer_id) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . tep_db_input($quantity) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+
+      if (is_array($attributes)) {
+        reset($attributes);
+        while (list($option, $value) = each($attributes)) {
+          $this->contents[$products_id]['attributes'][$option] = $value;
+// update database
+          if ($customer_id) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
+        }
+      }
+    }
+
+    function cleanup() {
+      global $customer_id;
+
+      reset($this->contents);
+      while (list($key,) = each($this->contents)) {
+        if ($this->contents[$key]['qty'] < 1) {
+          unset($this->contents[$key]);
+// remove from database
+          if ($customer_id) {
+            tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
+            tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
+          }
+        }
+      }
+    }
+
+    function count_contents() {  // get total number of items in cart
+        $total_items = 0;
+        if (is_array($this->contents)) {
+            reset($this->contents);
+            while (list($products_id, ) = each($this->contents)) {
+                $total_items += $this->get_quantity($products_id);
+            }
+        }
+        return $total_items;
+    }
+
+    function get_quantity($products_id) {
+      if ($this->contents[$products_id]) {
+        return $this->contents[$products_id]['qty'];
+      } else {
+        return 0;
+      }
+    }
+
+    function in_cart($products_id) {
+      if ($this->contents[$products_id]) {
+        return true;
+      } else {
+        return false;
+      }
+    }
+
+    function remove($products_id) {
+      global $customer_id;
+
+      unset($this->contents[$products_id]);
+// remove from database
+      if ($customer_id) {
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+      }
+    }
+
+    function remove_all() {
+      $this->reset();
+    }
+
+    function get_product_id_list() {
+      $product_id_list = '';
+      if (is_array($this->contents))
+      {
+        reset($this->contents);
+        while (list($products_id, ) = each($this->contents)) {
+          $product_id_list .= ', ' . $products_id;
+        }
+      }
+      return substr($product_id_list, 2);
+    }
+
+    function calculate() {
+      $this->total = 0;
+      $this->weight = 0;
+      if (!is_array($this->contents)) return 0;
+
+      reset($this->contents);
+      while (list($products_id, ) = each($this->contents)) {
+        $qty = $this->contents[$products_id]['qty'];
+
+// products price
+        $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id='" . (int)tep_get_prid($products_id) . "'");
+        if ($product = tep_db_fetch_array($product_query)) {
+          $prid = $product['products_id'];
+          $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
+          $products_price = $product['products_price'];
+          $products_weight = $product['products_weight'];
+
+          $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
+          if (tep_db_num_rows ($specials_query)) {
+            $specials = tep_db_fetch_array($specials_query);
+            $products_price = $specials['specials_new_products_price'];
+          }
+
+          $this->total += tep_add_tax($products_price, $products_tax) * $qty;
+          $this->weight += ($qty * $products_weight);
+        }
+
+// attributes price
+        if (isset($this->contents[$products_id]['attributes'])) {
+          reset($this->contents[$products_id]['attributes']);
+          while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
+            $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
+            $attribute_price = tep_db_fetch_array($attribute_price_query);
+            if ($attribute_price['price_prefix'] == '+') {
+              $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
+            } else {
+              $this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
+            }
+          }
+        }
+      }
+    }
+
+    function attributes_price($products_id) {
+      $attributes_price = 0;
+
+      if (isset($this->contents[$products_id]['attributes'])) {
+        reset($this->contents[$products_id]['attributes']);
+        while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
+          $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
+          $attribute_price = tep_db_fetch_array($attribute_price_query);
+          if ($attribute_price['price_prefix'] == '+') {
+            $attributes_price += $attribute_price['options_values_price'];
+          } else {
+            $attributes_price -= $attribute_price['options_values_price'];
+          }
+        }
+      }
+
+      return $attributes_price;
+    }
+
+function get_products() {
+     global $languages_id;
+$languages_id = '1';
+     if (!is_array($this->contents)) return false;
+     $products_array = array();
+     reset($this->contents);
+      while (list($products_id, ) = each($this->contents)) {
+        $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='" . (int)tep_get_prid($products_id) . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
+        if ($products = tep_db_fetch_array($products_query)) {
+          $prid = $products['products_id'];
+          $products_price = $products['products_price'];
+
+          $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
+          if (tep_db_num_rows($specials_query)) {
+            $specials = tep_db_fetch_array($specials_query);
+            $products_price = $specials['specials_new_products_price'];
+          }
+
+          $products_array[] = array('id' => $products_id,
+                                    'name' => $products['products_name'],
+                                    'model' => $products['products_model'],
+                                    'price' => $products_price,
+                                    'quantity' => $this->contents[$products_id]['qty'],
+                                    'weight' => $products['products_weight'],
+                                    'final_price' => ($products_price + $this->attributes_price($products_id)),
+                                    'tax_class_id' => $products['products_tax_class_id'],
+                                    'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
+        }
+      }
+      return $products_array;
+    }
+
+    function show_total() {
+      $this->calculate();
+
+      return $this->total;
+    }
+
+    function show_weight() {
+      $this->calculate();
+
+      return $this->weight;
+    }
+
+    function unserialize($broken) {
+      for(reset($broken);$kv=each($broken);) {
+        $key=$kv['key'];
+        if (gettype($this->$key)!="user function")
+        $this->$key=$kv['value'];
+      }
+    }
+
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/split_page_results.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/split_page_results.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/split_page_results.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,107 @@
+<?php
+/*
+  $Id: split_page_results.php,v 1.1.1.1 2004/03/04 23:39:49 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class splitPageResults {
+    function splitPageResults(&$current_page_number, $max_rows_per_page, &$sql_query, &$query_num_rows) {
+      if (empty($current_page_number)) $current_page_number = 1;
+
+      $pos_to = strlen($sql_query);
+      $pos_from = strpos($sql_query, ' from', 0);
+
+      $pos_group_by = strpos($sql_query, ' group by', $pos_from);
+      if (($pos_group_by < $pos_to) && ($pos_group_by != false)) $pos_to = $pos_group_by;
+
+      $pos_having = strpos($sql_query, ' having', $pos_from);
+      if (($pos_having < $pos_to) && ($pos_having != false)) $pos_to = $pos_having;
+
+      $pos_order_by = strpos($sql_query, ' order by', $pos_from);
+      if (($pos_order_by < $pos_to) && ($pos_order_by != false)) $pos_to = $pos_order_by;
+
+      $reviews_count_query = tep_db_query("select count(*) as total " . substr($sql_query, $pos_from, ($pos_to - $pos_from)));
+      $reviews_count = tep_db_fetch_array($reviews_count_query);
+      $query_num_rows = $reviews_count['total'];
+
+      $num_pages = ceil($query_num_rows / $max_rows_per_page);
+      if ($current_page_number > $num_pages) {
+        $current_page_number = $num_pages;
+      }
+      $offset = ($max_rows_per_page * ($current_page_number - 1));
+      //newer version of mysql can not handle neg number in limit, temp fix
+      if ($offset < '0'){
+         $offset = '1';
+         }
+      $sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
+    }
+
+    function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page') {
+      global $PHP_SELF;
+
+      if ( tep_not_null($parameters) && (substr($parameters, -1) != '&') ) $parameters .= '&';
+
+// calculate number of pages needing links
+      $num_pages = ceil($query_numrows / $max_rows_per_page);
+
+      $pages_array = array();
+      for ($i=1; $i<=$num_pages; $i++) {
+        $pages_array[] = array('id' => $i, 'text' => $i);
+      }
+
+      if ($num_pages > 1) {
+        $display_links = tep_draw_form('pages', basename($PHP_SELF), '', 'get');
+
+        if ($current_page_number > 1) {
+          $display_links .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number - 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a>&nbsp;&nbsp;';
+        } else {
+          $display_links .= PREVNEXT_BUTTON_PREV . '&nbsp;&nbsp;';
+        }
+
+        $display_links .= sprintf(TEXT_RESULT_PAGE, tep_draw_pull_down_menu($page_name, $pages_array, $current_page_number, 'onChange="this.form.submit();"'), $num_pages);
+
+        if (($current_page_number < $num_pages) && ($num_pages != 1)) {
+          $display_links .= '&nbsp;&nbsp;<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number + 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . '</a>';
+        } else {
+          $display_links .= '&nbsp;&nbsp;' . PREVNEXT_BUTTON_NEXT;
+        }
+
+        if ($parameters != '') {
+          if (substr($parameters, -1) == '&') $parameters = substr($parameters, 0, -1);
+          $pairs = explode('&', $parameters);
+          while (list(, $pair) = each($pairs)) {
+            list($key,$value) = explode('=', $pair);
+            $display_links .= tep_draw_hidden_field(rawurldecode($key), rawurldecode($value));
+          }
+        }
+
+        if (SID) $display_links .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
+
+        $display_links .= '</form>';
+      } else {
+        $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
+      }
+
+      return $display_links;
+    }
+
+    function display_count($query_numrows, $max_rows_per_page, $current_page_number, $text_output) {
+      $to_num = ($max_rows_per_page * $current_page_number);
+      if ($to_num > $query_numrows) $to_num = $query_numrows;
+      $from_num = ($max_rows_per_page * ($current_page_number - 1));
+      if ($to_num == 0) {
+        $from_num = 0;
+      } else {
+        $from_num++;
+      }
+
+      return sprintf($text_output, $from_num, $to_num, $query_numrows);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/table_block.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/table_block.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/table_block.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: table_block.php,v 1.1.1.1 2004/03/04 23:39:49 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBlock {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+    function tableBlock($contents) {
+      $tableBox_string = '';
+
+      $form_set = false;
+      if (isset($contents['form'])) {
+        $tableBox_string .= $contents['form'] . "\n";
+        $form_set = true;
+        array_shift($contents);
+      }
+
+      $tableBox_string .= '<table border="' . $this->table_border . '" width="' . $this->table_width . '" cellspacing="' . $this->table_cellspacing . '" cellpadding="' . $this->table_cellpadding . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
+      $tableBox_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        $tableBox_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
+        $tableBox_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $y=sizeof($contents[$i]); $x<$y; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null(isset($contents[$i][$x]['text']))) {
+              $tableBox_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . $contents[$i][$x]['align'] . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null(isset($contents[$i][$x]['params']))) {
+                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
+              $tableBox_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
+              $tableBox_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox_string .= '    <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . $contents[$i]['align'] . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
+        }
+
+        $tableBox_string .= '  </tr>' . "\n";
+      }
+
+      $tableBox_string .= '</table>' . "\n";
+
+      if ($form_set == true) $tableBox_string .= '</form>' . "\n";
+
+      return $tableBox_string;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/upload.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/upload.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/upload.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,192 @@
+<?php
+/*
+  $Id: upload.php,v 1.1.1.1 2004/03/04 23:39:49 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class upload {
+    var $file, $filename, $destination, $permissions, $extensions, $tmp_filename, $message_location;
+
+    function upload($file = '', $destination = '', $permissions = '777', $extensions = '') {
+      $this->set_file($file);
+      $this->set_destination($destination);
+      $this->set_permissions($permissions);
+      $this->set_extensions($extensions);
+
+      $this->set_output_messages('direct');
+
+      if (tep_not_null($this->file) && tep_not_null($this->destination)) {
+        $this->set_output_messages('session');
+
+        if ( ($this->parse() == true) && ($this->save() == true) ) {
+          return true;
+        } else {
+// self destruct
+         // $this = null;
+         unset($this);
+// JACK COMMENTED THIS OUT TO MAKE THE ADMIN WORK FOR PHP 5.0.3 ,
+// Tom added new unset for php5
+   
+          return false;
+        }
+      }
+    }
+
+    function parse() {
+      global $messageStack;
+
+      if (isset($_FILES[$this->file])) {
+        $file = array('name' => $_FILES[$this->file]['name'],
+                      'type' => $_FILES[$this->file]['type'],
+                      'size' => $_FILES[$this->file]['size'],
+                      'tmp_name' => $_FILES[$this->file]['tmp_name']);
+      } elseif (isset($GLOBALS['HTTP_POST_FILES'][$this->file])) {
+        global $HTTP_POST_FILES;
+
+        $file = array('name' => $HTTP_POST_FILES[$this->file]['name'],
+                      'type' => $HTTP_POST_FILES[$this->file]['type'],
+                      'size' => $HTTP_POST_FILES[$this->file]['size'],
+                      'tmp_name' => $HTTP_POST_FILES[$this->file]['tmp_name']);
+      } else {
+        $file = array('name' => (isset($GLOBALS[$this->file . '_name']) ? $GLOBALS[$this->file . '_name'] : ''),
+                      'type' => (isset($GLOBALS[$this->file . '_type']) ? $GLOBALS[$this->file . '_type'] : ''),
+                      'size' => (isset($GLOBALS[$this->file . '_size']) ? $GLOBALS[$this->file . '_size'] : ''),
+                      'tmp_name' => (isset($GLOBALS[$this->file]) ? $GLOBALS[$this->file] : ''));
+      }
+
+      if ( tep_not_null($file['tmp_name']) && ($file['tmp_name'] != 'none') && is_uploaded_file($file['tmp_name']) ) {
+        if (sizeof($this->extensions) > 0) {
+          if (!in_array(strtolower(substr($file['name'], strrpos($file['name'], '.')+1)), $this->extensions)) {
+            if ($this->message_location == 'direct') {
+              $messageStack->add('search', ERROR_FILETYPE_NOT_ALLOWED, 'error');
+            } else {
+              $messageStack->add_session('search', ERROR_FILETYPE_NOT_ALLOWED, 'error');
+            }
+
+            return false;
+          }
+        }
+
+        $this->set_file($file);
+        $this->set_filename($file['name']);
+        $this->set_tmp_filename($file['tmp_name']);
+
+        return $this->check_destination();
+      } else {
+// BOF: MaxiDVD added remove annoying no-image uploaded message
+        if (WYSIWYG_USE_PHP_IMAGE_MANAGER == 'Disable') {
+// EOF: MaxiDVD added remove annoying no-image uploaded message
+        if ($this->message_location == 'direct') {
+          $messageStack->add('search', WARNING_NO_FILE_UPLOADED, 'warning');
+        } else {
+          $messageStack->add_session('search', WARNING_NO_FILE_UPLOADED, 'warning');
+        }
+
+        return false;
+      }
+    }
+// BOF: MaxiDVD added remove annoying no-image uploaded message
+  }
+// EOF: MaxiDVD added remove annoying no-image uploaded message
+
+    function save() {
+      global $messageStack;
+
+      if (substr($this->destination, -1) != '/') $this->destination .= '/';
+
+      if (move_uploaded_file($this->file['tmp_name'], $this->destination . $this->filename)) {
+        chmod($this->destination . $this->filename, $this->permissions);
+
+        if ($this->message_location == 'direct') {
+          $messageStack->add('search', SUCCESS_FILE_SAVED_SUCCESSFULLY, 'success');
+        } else {
+          $messageStack->add_session('search', SUCCESS_FILE_SAVED_SUCCESSFULLY, 'success');
+        }
+
+        return true;
+      } else {
+        if ($this->message_location == 'direct') {
+          $messageStack->add('search', ERROR_FILE_NOT_SAVED, 'error');
+        } else {
+          $messageStack->add_session('search', ERROR_FILE_NOT_SAVED, 'error');
+        }
+
+        return false;
+      }
+    }
+
+    function set_file($file) {
+      $this->file = $file;
+    }
+
+    function set_destination($destination) {
+      $this->destination = $destination;
+    }
+
+    function set_permissions($permissions) {
+      $this->permissions = octdec($permissions);
+    }
+
+    function set_filename($filename) {
+      $this->filename = $filename;
+    }
+
+    function set_tmp_filename($filename) {
+      $this->tmp_filename = $filename;
+    }
+
+    function set_extensions($extensions) {
+      if (tep_not_null($extensions)) {
+        if (is_array($extensions)) {
+          $this->extensions = $extensions;
+        } else {
+          $this->extensions = array($extensions);
+        }
+      } else {
+        $this->extensions = array();
+      }
+    }
+
+    function check_destination() {
+      global $messageStack;
+
+      if (!is_writeable($this->destination)) {
+        if (is_dir($this->destination)) {
+          if ($this->message_location == 'direct') {
+            $messageStack->add('search', sprintf(ERROR_DESTINATION_NOT_WRITEABLE, $this->destination), 'error');
+          } else {
+            $messageStack->add_session('search', sprintf(ERROR_DESTINATION_NOT_WRITEABLE, $this->destination), 'error');
+          }
+        } else {
+          if ($this->message_location == 'direct') {
+            $messageStack->add('search', sprintf(ERROR_DESTINATION_DOES_NOT_EXIST, $this->destination), 'error');
+          } else {
+            $messageStack->add_session('search', sprintf(ERROR_DESTINATION_DOES_NOT_EXIST, $this->destination), 'error');
+          }
+        }
+
+        return false;
+      } else {
+        return true;
+      }
+    }
+
+    function set_output_messages($location) {
+      switch ($location) {
+        case 'session':
+          $this->message_location = 'session';
+          break;
+        case 'direct':
+        default:
+          $this->message_location = 'direct';
+          break;
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/classes/xmldocument.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/classes/xmldocument.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/classes/xmldocument.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,302 @@
+<?php
+/*
+    $Id: xmldocument.php,v 1.5 2003/06/27 01:03:03 torinwalker Exp $
+    
+    Written by Torin Walker
+    torinwalker at rogers.com
+    
+    Generic XML Document support for when there is none.
+    
+    Copyright(c) 2003 by Torin Walker, All rights reserved.
+    
+    Released under the GNU General Public License
+*/
+
+define("ELEMENT", 0);
+define("TEXTELEMENT", 1);
+
+//*****************
+class XMLDocument {
+    var $root;
+    var $children;
+
+    function XMLDocument() {
+    }
+
+    function createElement($name) {
+        $node = new Node();
+        $node->setName($name);
+        $node->setType(ELEMENT);
+        return $node;
+    }
+
+    function createTextElement($text) {
+        $node = new Node();
+        $node->setType(TEXTELEMENT);
+        $node->setValue($text);
+        return $node;
+    }
+
+    function getRoot() {
+        return $this->root;
+    }
+
+    function setRoot($node) {
+        $this->root = $node;
+    }
+
+    function toString() {
+        if ($this->root) {
+            return $this->root->toString();
+        } else {
+            return "DOCUMENT ROOT NOT SET";
+        }
+    }
+
+    function getValueByPath($path) {
+        $pathArray = split("/", $path);
+        if ($pathArray[0] == $this->root->getName()) {
+            //print_r("Looking for " . $pathArray[0] . "<br>");
+            array_shift($pathArray);
+            $newPath = implode("/", $pathArray);
+            return $this->root->getValueByPath($newPath);
+        }
+    }
+}
+
+//*********
+class Node {
+    var $name;
+    var $type;
+    var $text;
+    var $parent;
+    var $children;
+    var $attributes;
+
+    function Node() {
+        $this->children = array();
+        $this->attributes = array();
+    }
+
+    function getName() {
+        return $this->name;
+    }
+
+    function setName($name) {
+        $this->name = $name;
+    }
+
+    function setParent(&$node) {
+        $this->parent =& $node;
+    }
+
+    function &getParent() {
+        return $this->parent;
+    }
+
+    function &getChildren() {
+        return $this->children;
+    }
+
+    function getType() {
+        return $this->type;
+    }
+
+    function setType($type) {
+        $this->type = $type;
+    }
+
+    function getElementByName($name) {
+        for ($i = 0; $i < count($this->children); $i++) {
+            if ($this->children[$i]->getType() == ELEMENT) {
+                if ($this->children[$i]->getName() == $name) {
+                    return $this->children[$i];
+                }
+            }
+        }
+        return null;
+    }
+
+    function getElementsByName($name) {
+        $elements = array();
+        for ($i = 0; $i < count($this->children); $i++) {
+            if ($this->children[$i]->getType() == ELEMENT) {
+                if ($this->children[$i]->getName() == $name) {
+                    $elements[] = $this->children[$i];
+                }
+            }
+        }
+        return $elements;
+    }
+
+    function getValueByPath($path) {
+        $pathArray = split('/', $path);
+        $node = $this;
+        for ($i = 0; $i < count($pathArray); $i++) {
+            //print_r("Looking for " . $pathArray[$i] ."<br>");
+            if ($node->getChildren()) {
+                for ($j = 0; $j < count($node->getChildren()); $j++) {
+                    if ($node->children[$j]->getType() == ELEMENT) {
+                        if ($node->children[$j]->getName() == $pathArray[$i]) {
+                            //print_r("Found " . $pathArray[$i] ."<br>");
+                            $node = $node->children[$j];
+                        }
+                    }
+                }
+            }
+        }
+        return $node->getValue();
+    } 
+
+    function getText() {
+        return $this->text();
+    }
+
+    function setValue($text) {
+        $this->text = $text;
+    }
+
+    function getValue() {
+        $value = NULL;
+        if ($this->getType() == ELEMENT) {
+            for ($i = 0; $i < count($this->children); $i++) {
+                $value .= $this->children[$i]->getValue();
+            }
+        } elseif ($this->getType() == TEXTELEMENT) {
+            $value .= $this->text;
+        }
+        return $value;
+    }
+
+    function setAttribute($name, $value) {
+        $attributes[$name] = $value;
+    }
+
+    function getAttribute($name) {
+        return $attributes[$name];
+    }
+
+    function addNode(&$node) {
+        $this->children[] =& $node;
+        $node->parent =& $this;
+    }
+
+    function parentToString($node) {
+        while($node->parent) {
+            //print_r("Node " . $node->name . " has parent<br>");
+            $node = $node->parent;
+        }
+        //print_r("Node contents from root: " . $node->toString() . "<br>");
+    }
+
+    function toString() {
+        $string = NULL;    
+        //print_r("toString child count " . $this->name . " contains " . count($this->children) . "<br>");    
+        if ($this->type == ELEMENT) {
+            $string .= '{' . $this->name . '}';
+            for ($i = 0; $i < count($this->children); $i++) {
+                $string .= $this->children[$i]->toString();
+            }
+            $string .= '{/' . $this->name . '}';
+        } else {
+            $string .= $this->getValue();
+        }
+        return $string;
+    }
+}
+
+//**************
+class XMLParser {
+    var $xp;
+    var $document;
+    var $current;
+    var $error;
+
+    function XMLParser() {
+        $this->document = new XMLDocument();
+        $this->error = array();
+    }
+    
+    function setDocument($document) {
+        $this->document = $document;
+    }
+    
+    function getDocument() {
+        return $this->document;
+    }
+    
+    function destruct(){
+        xml_parser_free($this->xp);
+    }
+    
+    // return 1 for an error, 0 for no error
+    function hasErrors() {
+        if (sizeof($this->error) > 0) {
+            return 1;
+        } else {
+            return 0;
+        }
+    }
+
+    // return array of error messages
+    function getError() {
+        return $this->error;
+    }
+
+    // process xml start tag
+    function startElement($xp, $name, $attrs) {
+        //print_r("Found Start Tag: " . $name . "<br>");
+        $node =& $this->document->createElement($name);
+        if ($this->document->getRoot()) {
+            $this->current->addNode($node);
+        } else {
+            $this->document->root =& $node;
+        }
+        $this->current =& $node;
+    }
+
+    // process xml end tag
+    function endElement($xp, $name){
+        //print_r("Found End Tag: " . $name . "<br>");
+        if ($this->current->getParent()) {
+            $this->current =& $this->current->getParent();
+        }
+    }
+
+    // process data between xml tags
+    function dataHandler($xp, $text) {
+        //print_r("Adding Data: \"" . $text . "\"<br>");
+        $node =& $this->document->createTextElement($text);
+        $this->current->addNode($node);
+    }
+
+    // parse xml document from string
+    function parse($xmlString) {
+        if(!($this->xp = @xml_parser_create())) {
+            $this->error['description'] = 'Could not create xml parser';
+        }
+        if(!$this->hasErrors()) {
+            if(!@xml_set_object($this->xp, $this)) {
+                $this->error['description'] = 'Could not set xml parser for object';
+            }
+        }
+        if(!$this->hasErrors()) {
+            if(!@xml_set_element_handler($this->xp, 'startElement', 'endElement')) {
+                $this->error['description'] = 'Could not set xml element handler';
+            }
+        }
+        if(!$this->hasErrors()) {
+            if(!@xml_set_character_data_handler($this->xp, 'dataHandler')) {
+                $this->error['description'] = 'Could not set xml character handler';
+            }
+        } 
+        xml_parser_set_option($this->xp, XML_OPTION_CASE_FOLDING, false);    
+        if (!$this->hasErrors()) {
+            if(!@xml_parse($this->xp, $xmlString)) {
+                $this->error['description'] = xml_error_string(xml_get_error_code($this->xp));
+                $this->error['line'] = xml_get_current_line_number($this->xp);
+            }
+        }
+    }
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/column_left.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/column_left.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/column_left.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,90 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Chain Reaction Works, Inc
+  Copyright (c) 2005 - 2006 Chain Reaction Works, Inc.
+
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1042 $
+
+  Released under the GNU General Public License
+*/
+
+  if (MENU_DHTML != 'True') {
+ define('BOX_WIDTH', 170);
+
+    if (tep_admin_check_boxes('administrator.php') == true) {
+    require(DIR_WS_BOXES . 'administrator.php');
+  }
+    if (tep_admin_check_boxes('configuration.php') == true) {
+    require(DIR_WS_BOXES . 'configuration.php');
+  }
+    if (tep_admin_check_boxes('catalog.php') == true) {
+    require(DIR_WS_BOXES . 'catalog.php');
+  }
+    if (tep_admin_check_boxes('customers.php') == true) {
+    require(DIR_WS_BOXES . 'customers.php');
+  }
+    if (tep_admin_check_boxes('marketing.php') == true) {
+    require(DIR_WS_BOXES . 'marketing.php');
+  }
+    if (tep_admin_check_boxes('gv_admin.php') == true) {
+    require(DIR_WS_BOXES . 'gv_admin.php');
+  }
+    if (tep_admin_check_boxes('affiliate.php') == true) {
+    require(DIR_WS_BOXES . 'affiliate.php');
+  }
+  if (tep_admin_check_boxes('reports.php') == true) {
+    require(DIR_WS_BOXES . 'reports.php');
+  }
+  if (tep_admin_check_boxes('data.php') == true) {
+    require(DIR_WS_BOXES . 'data.php');
+  }
+    if (tep_admin_check_boxes('information.php') == true) {
+    require(DIR_WS_BOXES . 'information.php');
+  }
+    if (tep_admin_check_boxes('articles.php') == true) {
+    require(DIR_WS_BOXES . 'articles.php');
+  }
+    if (tep_admin_check_boxes('design_controls.php') == true) {
+    require(DIR_WS_BOXES . 'design_controls.php');
+  }
+   if (tep_admin_check_boxes('links.php') == true) {
+    require(DIR_WS_BOXES . 'links.php');
+  }
+  if (tep_admin_check_boxes('modules.php') == true) {
+    require(DIR_WS_BOXES . 'modules.php');
+  }
+  if (tep_admin_check_boxes('taxes.php') == true) {
+    require(DIR_WS_BOXES . 'taxes.php');
+  }
+  if (tep_admin_check_boxes('localization.php') == true) {
+    require(DIR_WS_BOXES . 'localization.php');
+  }
+   if (tep_admin_check_boxes('crypt.php') == true) {
+    require(DIR_WS_BOXES . 'crypt.php');
+  }
+  if (tep_admin_check_boxes('tools.php') == true) {
+   require(DIR_WS_BOXES . 'tools.php');
+  }
+  if (tep_admin_check_boxes('techsupport.php') == true) {
+   require(DIR_WS_BOXES . 'techsupport.php');
+  }
+if (file_exists('includes/boxes/newsdesk.php')){
+  if (tep_admin_check_boxes('newsdesk.php') == true) {
+   require(DIR_WS_BOXES . 'newsdesk.php');
+  }
+}
+if (file_exists('includes/boxes/faqdesk.php')){
+  if (tep_admin_check_boxes('faqdesk.php') == true) {
+   require(DIR_WS_BOXES . 'faqdesk.php');
+  }
+}
+//Admin Column Left end
+}
+?>

Added: trunk/direct.openmoko.com/admin/includes/configure.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/configure.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/configure.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+require_once '../../openmoko_common_cfg.php';
+
+// Define the webserver and path parameters
+// * DIR_FS_* = Filesystem directories (local/physical)
+// * DIR_WS_* = Webserver directories (virtual/URL)
+  define('HTTP_SERVER',			'http://'.OPENMOKO_SHOP_HOST); // eg, http://localhost - should not be empty for productive servers
+  define('HTTPS_SERVER',		'https://'.OPENMOKO_SHOP_HOST); // eg, https://localhost - should not be empty for productive servers
+  define('HTTP_CATALOG_SERVER',		'http://'.OPENMOKO_SHOP_HOST);
+  define('HTTPS_CATALOG_SERVER',	'https://'.OPENMOKO_SHOP_HOST);
+  define('HTTPS_ADMIN_SERVER', '');
+  define('HTTP_COOKIE_DOMAIN',		OPENMOKO_SHOP_HOST);
+  define('HTTPS_COOKIE_DOMAIN',		OPENMOKO_SHOP_HOST);
+  define('HTTP_COOKIE_PATH',		OPENMOKO_SHOP_WS_PATH.'/');
+  define('HTTPS_COOKIE_PATH',		OPENMOKO_SHOP_WS_PATH.'/');
+  define('ENABLE_SSL',			'true'); // secure webserver for checkout procedure?
+  define('ENABLE_SSL_CATALOG',		'true'); // secure webserver for catalog module
+  define('DIR_WS_HTTP_ADMIN',		OPENMOKO_SHOP_WS_PATH.'/admin/');
+  define('DIR_WS_HTTPS_ADMIN',		OPENMOKO_SHOP_WS_PATH.'/admin/');
+  define('DIR_FS_DOCUMENT_ROOT',	OPENMOKO_SHOP_FS_PATH.'/'); // where the pages are located on the server
+  define('DIR_FS_ADMIN',		OPENMOKO_SHOP_FS_PATH.'/admin/'); // absolute path required
+  define('DIR_WS_CATALOG',		OPENMOKO_SHOP_WS_PATH.'/'); // absolute path required
+  define('DIR_WS_HTTP_CATALOG',		OPENMOKO_SHOP_WS_PATH);
+  define('DIR_WS_HTTPS_CATALOG',	OPENMOKO_SHOP_WS_PATH);
+  define('DIR_FS_CATALOG',		OPENMOKO_SHOP_FS_PATH.'/'); // absolute path required
+  define('DIR_WS_IMAGES', 'images/');
+  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
+  define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
+  define('DIR_WS_INCLUDES', 'includes/');
+  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
+  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
+  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
+  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
+  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
+  define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
+  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
+  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
+  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
+  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
+
+// Added for Templating
+  define('DIR_FS_CATALOG_MAINPAGE_MODULES', DIR_FS_CATALOG_MODULES . 'mainpage_modules/');
+  define('DIR_WS_TEMPLATES', DIR_WS_CATALOG . 'templates/');
+  define('DIR_FS_TEMPLATES', DIR_FS_CATALOG . 'templates/');
+
+// define our database connection
+  define('DB_SERVER',		OPENMOKO_SHOP_DB_HOST); // eg, localhost - should not be empty for productive servers
+  define('DB_SERVER_USERNAME',	OPENMOKO_SHOP_DB_USER);
+  define('DB_SERVER_PASSWORD',	OPENMOKO_SHOP_DB_PASSWD);
+  define('DB_DATABASE',		OPENMOKO_SHOP_DB_NAME);
+  define('USE_PCONNECT', 'true'); // use persisstent connections?
+  define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/configure.php.bak
===================================================================
--- trunk/direct.openmoko.com/admin/includes/configure.php.bak	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/configure.php.bak	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// Define the webserver and path parameters
+// * DIR_FS_* = Filesystem directories (local/physical)
+// * DIR_WS_* = Webserver directories (virtual/URL)
+  define('HTTP_SERVER', 'http://38one.servehttp.com'); // eg, http://localhost - should not be empty for productive servers
+  define('HTTP_CATALOG_SERVER', 'http://38one.servehttp.com');
+  define('HTTPS_CATALOG_SERVER', '');
+  define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers
+  define('HTTPS_ADMIN_SERVER', '');
+  define('HTTP_COOKIE_DOMAIN', 'localhost');
+  define('HTTPS_COOKIE_DOMAIN', '');
+  define('HTTP_COOKIE_PATH', '/openmoko_shop/');
+  define('HTTPS_COOKIE_PATH', '');
+  define('ENABLE_SSL',  'false'); // secure webserver for checkout procedure?
+  define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
+  define('DIR_WS_HTTP_ADMIN',  '/openmoko_shop/admin/');
+  define('DIR_WS_HTTPS_ADMIN',  'admin/');
+  define('DIR_FS_DOCUMENT_ROOT', 'D:/!www/_htdocs/openmoko_shop/'); // where the pages are located on the server
+  define('DIR_FS_ADMIN', 'D:/!www/_htdocs/openmoko_shop/admin/'); // absolute path required
+  define('DIR_WS_CATALOG', '/openmoko_shop/'); // absolute path required
+  define('DIR_WS_HTTP_CATALOG', '/openmoko_shop/');
+  define('DIR_WS_HTTPS_CATALOG', '');
+  define('DIR_FS_CATALOG', 'D:/!www/_htdocs/openmoko_shop/'); // absolute path required
+  define('DIR_WS_IMAGES', 'images/');
+  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
+  define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
+  define('DIR_WS_INCLUDES', 'includes/');
+  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
+  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
+  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
+  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
+  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
+  define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
+  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
+  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
+  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
+  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
+
+// Added for Templating
+  define('DIR_FS_CATALOG_MAINPAGE_MODULES', DIR_FS_CATALOG_MODULES . 'mainpage_modules/');
+  define('DIR_WS_TEMPLATES', DIR_WS_CATALOG . 'templates/');
+  define('DIR_FS_TEMPLATES', DIR_FS_CATALOG . 'templates/');
+
+// define our database connection
+  define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
+  define('DB_SERVER_USERNAME', 'root');
+  define('DB_SERVER_PASSWORD', 'nista');
+  define('DB_DATABASE', 'openmoko_shop2');
+  define('USE_PCONNECT', 'true'); // use persisstent connections?
+  define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/configure_dist.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/configure_dist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/configure_dist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// Define the webserver and path parameters
+// * DIR_FS_* = Filesystem directories (local/physical)
+// * DIR_WS_* = Webserver directories (virtual/URL)
+  define('HTTP_SERVER', 'http://192.168.1.35'); // eg, http://localhost - should not be empty for productive servers
+  define('HTTP_CATALOG_SERVER', 'http://192.168.1.35');
+  define('HTTPS_CATALOG_SERVER', '');
+  define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers
+  define('HTTPS_ADMIN_SERVER', '');
+  define('HTTP_COOKIE_DOMAIN', '192.168.1.35');
+  define('HTTPS_COOKIE_DOMAIN', '');
+  define('HTTP_COOKIE_PATH', '/acremainsvn/branches/loaded62free/');
+  define('HTTPS_COOKIE_PATH', '');
+  define('ENABLE_SSL',  'false'); // secure webserver for checkout procedure?
+  define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module
+  define('DIR_WS_HTTP_ADMIN',  '/acremainsvn/branches/loaded62free/admin/');
+  define('DIR_WS_HTTPS_ADMIN',  'admin/');
+  define('DIR_FS_DOCUMENT_ROOT', 'C:/aserve/apachefriends/xampp/htdocs/acremainsvn/branches/loaded62free/'); // where the pages are located on the server
+  define('DIR_WS_ADMIN', '/acremainsvn/branches/loaded62free/admin/'); // absolute path required
+  define('DIR_FS_ADMIN', 'C:/aserve/apachefriends/xampp/htdocs/acremainsvn/branches/loaded62free/admin/'); // absolute path required
+  define('DIR_WS_CATALOG', '/acretest/'); // absolute path required
+  define('DIR_WS_HTTP_CATALOG', '/acretest/');
+  define('DIR_WS_HTTPS_CATALOG', '/acretest/');
+  define('DIR_FS_CATALOG', 'C:/aserve/apachefriends/xampp/htdocs/acremainsvn/branches/loaded62free/'); // absolute path required
+  define('DIR_WS_IMAGES', 'images/');
+  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
+  define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
+  define('DIR_WS_INCLUDES', 'includes/');
+  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
+  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
+  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
+  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
+  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
+  define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
+  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
+  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
+  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
+  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
+
+// Added for Templating
+  define('DIR_FS_CATALOG_MAINPAGE_MODULES', DIR_FS_CATALOG_MODULES . 'mainpage_modules/');
+  define('DIR_WS_TEMPLATES', DIR_WS_CATALOG . 'templates/');
+  define('DIR_FS_TEMPLATES', DIR_FS_CATALOG . 'templates/');
+
+// define our database connection
+  define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
+  define('DB_SERVER_USERNAME', 'root');
+  define('DB_SERVER_PASSWORD', '');
+  define('DB_DATABASE', '62free5');
+  define('USE_PCONNECT', 'false'); // use persisstent connections?
+  define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/css/helptip.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/css/helptip.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/css/helptip.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+/*
+  Notice that IE has a display problem if the help link is on
+  the last line of a container with no padding. If this is the
+  case increase the padding bottom to at least 1px
+*/
+
+a.helpLink {
+  color:        Green;
+  text-decoration:  none;
+  border-bottom:    1px dashed Green;
+  cursor:       help;
+}
+
+a.helpLink:hover {
+  color:        Red;
+  text-decoration:  none;
+  border-bottom:    1px dashed Red;
+}
+
+#hintbox{ /*CSS for pop up hint box */
+  position:     absolute;
+  top:          0;
+  background-color: lightyellow;
+  width:        150px; /*Default width of hint.*/ 
+  padding:      3px;
+  border:       1px solid black;
+  font:         normal 11px Verdana;
+  line-height:    18px;
+  z-index:        100;
+  border-right:     3px solid black;
+  border-bottom:  3px solid black;
+  visibility:     hidden;
+}
+
+.hintanchor{ /*CSS for link that shows hint onmouseover*/
+  font-weight:    bold;
+  color:        navy;
+  margin:         3px 8px;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/css/index.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/css/index.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/css/index.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+body { 
+    background: #FFFFFF; 
+}
+body, table {
+  font-family: Verdana, Arial, Helvetica, sans-serif; 
+  text-align: left;
+  font-size: 11px;
+}
+
+.body
+{
+    FONT-WEIGHT: normal;
+    FONT-SIZE: 11px;
+    COLOR: #4e4f4f;
+    FONT-FAMILY: Tahoma, verdana, helvetica, sans-serif;
+    TEXT-DECORATION: none
+}
+fieldset{
+  border:1px solid #CCCCCC;
+  padding: 5px;
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+  color: #000000;
+/*  height: 100%;
+  margin: 3px;*/
+}
+legend{
+  background-color: #F7F7F7;
+  text-align: center;
+  border:1px solid #CCCCCC;
+  padding: 3px;
+  color:#000066;
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+  font-weight: bold;
+}
+.admin_text {
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 12px;
+  color: #000000;
+}
+a.admin_text:link, a.admin_text:visited {
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+  color: #000000;
+  font-weight:bold;
+}
+a.admin_text:hover {
+  color: #FF0000;
+  text-decoration:underline;
+}
+li {
+  list-style-position: outside;
+  list-style-type: square;
+}
+a.adminLink:link, a.adminLink:visited {
+  color: #000000;
+  text-decoration:none;
+  border-bottom:  1px solid #CCCCCC;
+}
+a.adminLink:hover {
+  color: #FF0000;
+  text-decoration:none;
+  border-bottom:1px dashed Red;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/css/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/css/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/css/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+ at import url("../includes/stylesheet.css");
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/database_tables.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/database_tables.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/database_tables.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,170 @@
+<?php
+/*
+  $Id: database_tables.php,v 1.1.1.1 2004/03/04 23:39:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//Admin begin
+  define('TABLE_ADMIN', 'admin');
+  define('TABLE_ADMIN_FILES', 'admin_files');
+  define('TABLE_ADMIN_GROUPS', 'admin_groups');
+//Admin end
+
+// Lango Added Line For Infobox & Template configuration: BOF
+  define('TABLE_INFOBOX_CONFIGURATION', 'infobox_configuration');
+  define('TABLE_TEMPLATE', 'template');
+  define('TABLE_INFOBOX_HEADING', 'infobox_heading');
+// Lango Added Line For Infobox & Template configuration: BOF
+
+// Lango Added Line For Salemaker Mod: BOF
+  define('TABLE_SALEMAKER_SALES', 'salemaker_sales');
+// Lango Added Line For Salemaker Mod: EOF
+
+// BOF: Lango Added for Featured product MOD
+  define('TABLE_FEATURED', 'featured');
+// EOF: Lango Added for Featured product MOD
+
+// define the database table names used in the project
+  define('TABLE_AFFILIATE_AFFILIATE','affiliate_affiliate');
+  define('TABLE_ADDRESS_BOOK', 'address_book');
+  define('TABLE_ADDRESS_FORMAT', 'address_format');
+  define('TABLE_BANNERS', 'banners');
+  define('TABLE_BANNERS_HISTORY', 'banners_history');
+  define('TABLE_CATEGORIES', 'categories');
+  define('TABLE_CATEGORIES_DESCRIPTION', 'categories_description');
+  define('TABLE_CONFIGURATION', 'configuration');
+  define('TABLE_CONFIGURATION_GROUP', 'configuration_group');
+  define('TABLE_COUNTRIES', 'countries');
+  define('TABLE_CURRENCIES', 'currencies');
+  define('TABLE_CUSTOMERS', 'customers');
+  define('TABLE_CUSTOMERS_BASKET', 'customers_basket');
+  define('TABLE_CUSTOMERS_BASKET_ATTRIBUTES', 'customers_basket_attributes');
+  define('TABLE_CUSTOMERS_INFO', 'customers_info');
+  define('TABLE_LANGUAGES', 'languages');
+  define('TABLE_MANUFACTURERS', 'manufacturers');
+  define('TABLE_MANUFACTURERS_INFO', 'manufacturers_info');
+  define('TABLE_NEWSLETTERS', 'newsletters');
+  define('TABLE_ORDERS', 'orders');
+  define('TABLE_ORDERS_PAY_METHODS', 'orders_pay_methods');
+  define('TABLE_ORDERS_SHIP_METHODS', 'orders_ship_methods');
+  define('TABLE_ORDERS_PRODUCTS', 'orders_products');
+  define('TABLE_ORDERS_PRODUCTS_ATTRIBUTES', 'orders_products_attributes');
+  define('TABLE_ORDERS_PRODUCTS_ATTRIBUTES_TEXT', 'orders_products_attributes_text');
+  define('TABLE_ORDERS_PRODUCTS_DOWNLOAD', 'orders_products_download');
+  define('TABLE_ORDERS_STATUS', 'orders_status');
+  define('TABLE_ORDERS_STATUS_HISTORY', 'orders_status_history');
+  define('TABLE_ORDERS_TOTAL', 'orders_total');
+  define('TABLE_PRODUCTS', 'products');
+  define('TABLE_PRODUCTS_ATTRIBUTES', 'products_attributes');
+  define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', 'products_attributes_download');
+  define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');
+  define('TABLE_PRODUCTS_NOTIFICATIONS', 'products_notifications');
+  define('TABLE_PRODUCTS_OPTIONS', 'products_options');
+  define('TABLE_PRODUCTS_OPTIONS_TEXT', 'products_options_text');
+  define('TABLE_PRODUCTS_OPTIONS_VALUES', 'products_options_values');
+  define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', 'products_options_values_to_products_options');
+  define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');
+  define('TABLE_PRODUCTS_XSELL', 'products_xsell');
+  define('TABLE_REVIEWS', 'reviews');
+  define('TABLE_REVIEWS_DESCRIPTION', 'reviews_description');
+  define('TABLE_SESSIONS', 'sessions');
+  define('TABLE_SPECIALS', 'specials');
+  define('TABLE_TAX_CLASS', 'tax_class');
+  define('TABLE_TAX_RATES', 'tax_rates');
+  define('TABLE_GEO_ZONES', 'geo_zones');
+  define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones');
+  define('TABLE_WHOS_ONLINE', 'whos_online');
+  define('TABLE_ZONES', 'zones');
+
+// VJ Links Manager v1.00 begin
+  define('TABLE_LINK_CATEGORIES', 'link_categories');
+  define('TABLE_LINK_CATEGORIES_DESCRIPTION', 'link_categories_description');
+  define('TABLE_LINKS', 'links');
+  define('TABLE_LINKS_DESCRIPTION', 'links_description');
+  define('TABLE_LINKS_TO_LINK_CATEGORIES', 'links_to_link_categories');
+  define('TABLE_LINKS_STATUS', 'links_status');
+// VJ Links Manager v1.00 end
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  define('TABLE_INFORMATION', 'information');
+//DWD Modify End
+
+//begin PayPal_Shopping_Cart_IPN
+  define('TABLE_PAYPAL','paypal');
+  define('TABLE_PAYPAL_PAYMENT_STATUS','paypal_payment_status');
+  define('TABLE_ORDERS_SESSION_INFO', 'orders_session_info');
+//end PayPal_Shopping_Cart_IPN
+ define('TABLE_DATA_FILES', 'data_files');
+ define('TABLE_DATA_CAT', 'data_cat');
+
+  define('TABLE_BLACKLIST', 'card_blacklist');
+
+//calender
+define('TABLE_EVENTS_CALENDAR', 'events_calendar');
+
+// Article Manager  DMG
+
+  define('TABLE_ARTICLE_REVIEWS', 'article_reviews');
+  define('TABLE_ARTICLE_REVIEWS_DESCRIPTION', 'article_reviews_description');
+  define('TABLE_ARTICLES', 'articles');
+  define('TABLE_ARTICLES_DESCRIPTION', 'articles_description');
+  define('TABLE_ARTICLES_TO_TOPICS', 'articles_to_topics');
+  define('TABLE_ARTICLES_XSELL', 'articles_xsell');
+  define('TABLE_AUTHORS', 'authors');
+  define('TABLE_AUTHORS_INFO', 'authors_info');
+  define('TABLE_TOPICS', 'topics');
+  define('TABLE_TOPICS_DESCRIPTION', 'topics_description');
+  
+
+// START: Product Extra Fields  DMG
+  define('TABLE_PRODUCTS_EXTRA_FIELDS', 'products_extra_fields');
+  define('TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS', 'products_to_products_extra_fields');
+// END: Product Extra Fields  DMG
+
+//  Contact US Email Subjects
+
+  define('TABLE_EMAIL_SUBJECTS', 'email_subjects');
+
+// VJ navmenu begin
+define('TABLE_NAVMENU_CATEGORIES', 'navmenu_categories');
+define('TABLE_NAVMENU_CATEGORIES_DESCRIPTION', 'navmenu_categories_description');
+define('TABLE_NAVMENU_LINKS', 'navmenu_links');
+define('TABLE_NAVMENU_LINKS_DESCRIPTION', 'navmenu_links_description');
+define('TABLE_NAVMENU_LINKS_TO_CATEGORIES', 'navmenu_links_to_categories');
+// VJ navmenu end
+
+// VJ  CRE Page Manager begin
+  define('TABLE_PAGES_CATEGORIES', 'pages_categories');
+  define('TABLE_PAGES_CATEGORIES_DESCRIPTION', 'pages_categories_description');
+  define('TABLE_PAGES', 'pages');
+  define('TABLE_PAGES_DESCRIPTION', 'pages_description');
+  define('TABLE_PAGES_TO_CATEGORIES', 'pages_to_categories');
+// VJ Page Manager end
+
+define('TABLE_FAQ', 'faq');
+
+// VJ faq manager added
+  define('TABLE_FAQ_CATEGORIES', 'faq_categories');
+  define('TABLE_FAQ_CATEGORIES_DESCRIPTION', 'faq_categories_description');
+  define('TABLE_FAQ_TO_CATEGORIES', 'faq_to_categories');
+
+// Eversun mod for sppc and qty price breaks
+  define('TABLE_PRODUCTS_GROUPS', 'products_groups');
+  define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');
+// Eversun mod end for sppc and qty price breaks
+// CCGV
+define('TABLE_COUPON_GV_QUEUE', 'coupon_gv_queue');
+define('TABLE_COUPON_GV_CUSTOMER', 'coupon_gv_customer');
+define('TABLE_COUPON_EMAIL_TRACK', 'coupon_email_track');
+define('TABLE_COUPON_REDEEM_TRACK', 'coupon_redeem_track');
+define('TABLE_COUPONS', 'coupons');
+define('TABLE_COUPONS_DESCRIPTION', 'coupons_description');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/filenames.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/filenames.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/filenames.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,294 @@
+<?php
+/*
+  $Id: filenames.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('FILENAME_STATS_NOT_VALID_USER', 'stats_not_valid_users.php');   
+
+// CCGV
+DEFINE('FILENAME_GV_QUEUE', 'gv_queue.php');
+DEFINE('FILENAME_GV_MAIL', 'gv_mail.php');
+DEFINE('FILENAME_GV_SENT', 'gv_sent.php');
+define('FILENAME_COUPON_ADMIN', 'coupon_admin.php');
+define('FILENAME_ZIPCODE_VALIDATE','zipcode_validate.php');
+
+//Index Page
+define('FILENAME_BUG_TRACKER','/tracker/');
+define('FILENAME_FEATURE_REQUESTS','/tracker/');
+define('FILENAME_SVN_REPOSITORY','/scm/');
+define('FILENAME_SUPPORT_REQUEST','/tracker/');
+define('FILENAME_FILE_RELEASES','/frs/');
+
+//Index Page End
+
+//Admin begin
+  define('FILENAME_ADMIN_ACCOUNT', 'admin_account.php');
+  define('FILENAME_ADMIN_FILES', 'admin_files.php');
+  define('FILENAME_ADMIN_MEMBERS', 'admin_members.php');
+  define('FILENAME_FORBIDEN', 'forbiden.php');
+  define('FILENAME_LOGIN', 'login.php');
+  define('FILENAME_LOGOFF', 'logoff.php');
+  define('FILENAME_PASSWORD_FORGOTTEN', 'password_forgotten.php');
+//Admin end
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+  define('FILENAME_DEFINE_MAINPAGE', 'define_mainpage.php');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// Lango Added Line For Infobox configuration: BOF
+  define('FILENAME_TEMPLATE_ADMIN', 'template_admin.php');
+  define('FILENAME_TEMPLATE_CONFIGURATION', 'template_configuration.php');
+  define('FILENAME_INFOBOX_CONFIGURATION', 'infobox_configuration.php');
+  define('FILENAME_TEMPLATE_CONFIGURATION1', 'template_configuration1.php');
+  define('FILENAME_INFOBOX_ADMIN', 'infobox_admin.php');
+  
+  define('FILENAME_PRODUCT_LIST_ADMIN', 'product_list_admin.php');
+  
+  define('FILENAME_POPUP_INFOBOX_HELP', 'popup_infobox_help.php');
+// Lango Added Line For Infobox configuration: EOF
+
+// Lango Added Line For Salemaker Mod: BOF
+  define('FILENAME_SALEMAKER', 'salemaker.php');
+  define('FILENAME_SALEMAKER_INFO', 'salemaker_info.php');
+// Lango Added Line For Salemaker Mod: EOF
+
+// BOF: Lango Added for Featured product MOD
+  define('FILENAME_FEATURED', 'featured.php');
+// EOF: Lango Added for Featured product MOD
+
+// BOF: Lango Added for Order_edit MOD
+  define('FILENAME_CREATE_ACCOUNT', 'create_account.php');
+  define('FILENAME_CREATE_ACCOUNT_PROCESS', 'create_account_process.php');
+  define('FILENAME_CREATE_ACCOUNT_SUCCESS', 'create_account_success.php');
+  define('FILENAME_CREATE_ORDER_PROCESS', 'create_order_process.php');
+  define('FILENAME_CREATE_ORDER', 'create_order.php');
+  define('FILENAME_EDIT_ORDERS', 'edit_orders.php');
+  define('FILENAME_C_ORDERS', 'c_orders.php');
+  define('FILENAME_ORDERS_STATUS', 'orders_status.php');
+  define('FILENAME_CREATE_ORDERS_ADMIN', 'create_order_admin.php');
+  define('FILENAME_CREATE_ORDERS_PAY', 'create_order_payment.php');
+  define('FILENAME_CREATE_ORDERS_SHIP', 'create_order_shipping.php');
+  define('FILENAME_ABANDONED_ORDERS', 'abandoned_orders.php');  
+
+// BOF: Lango Added for Sales Stats MOD
+define('FILENAME_STATS_MONTHLY_SALES', 'stats_monthly_sales.php');
+// EOF: Lango Added for Sales Stats MOD
+
+// define the filenames used in the project
+  define('FILENAME_BACKUP', 'backup.php');
+  define('FILENAME_BANNER_MANAGER', 'banner_manager.php');
+  define('FILENAME_BANNER_STATISTICS', 'banner_statistics.php');
+  define('FILENAME_CACHE', 'cache.php');
+  define('FILENAME_CATALOG_ACCOUNT_HISTORY_INFO', 'account_history_info.php');
+  define('FILENAME_CATEGORIES', 'categories.php');
+  define('FILENAME_CONFIGURATION', 'configuration.php');
+  define('FILENAME_COUNTRIES', 'countries.php');
+  define('FILENAME_CURRENCIES', 'currencies.php');
+  define('FILENAME_CUSTOMERS', 'customers.php');
+  define('FILENAME_DEFAULT', 'index.php');
+  define('FILENAME_DEFINE_LANGUAGE', 'define_language.php');
+  define('FILENAME_FILE_MANAGER', 'file_manager.php');
+  define('FILENAME_GEO_ZONES', 'geo_zones.php');
+  define('FILENAME_LANGUAGES', 'languages.php');
+  define('FILENAME_MAIL', 'mail.php');
+  define('FILENAME_MANUFACTURERS', 'manufacturers.php');
+  define('FILENAME_MODULES', 'modules.php');
+  define('FILENAME_NEWSLETTERS', 'newsletters.php');
+  define('FILENAME_ORDERS', 'orders.php');
+  define('FILENAME_ORDERS_STATUS','orders_status.php');
+  define('FILENAME_ORDERS_INVOICE', 'invoice.php');
+  define('FILENAME_ORDERS_PACKINGSLIP', 'packingslip.php');
+  define('FILENAME_CREATE_ORDERS_ADMIN', 'orders_status.php');
+  define('FILENAME_POPUP_IMAGE', 'popup_image.php');
+  define('FILENAME_PRODUCTS_ATTRIBUTES', 'products_attributes.php');
+  define('FILENAME_PRODUCTS_EXPECTED', 'products_expected.php');
+  define('FILENAME_REVIEWS', 'reviews.php');
+  define('FILENAME_SERVER_INFO', 'server_info.php');
+  define('FILENAME_SHIPPING_MODULES', 'shipping_modules.php');
+  define('FILENAME_SPECIALS', 'specials.php');
+  define('FILENAME_STATS_CUSTOMERS', 'stats_customers.php');
+  define('FILENAME_STATS_PRODUCTS_PURCHASED', 'stats_products_purchased.php');
+  define('FILENAME_STATS_PRODUCTS_VIEWED', 'stats_products_viewed.php');
+  define('FILENAME_TAX_CLASSES', 'tax_classes.php');
+  define('FILENAME_TAX_RATES', 'tax_rates.php');
+  define('FILENAME_WHOS_ONLINE', 'whos_online.php');
+  define('FILENAME_ZONES', 'zones.php');
+  define('FILENAME_XSELL_PRODUCTS', 'xsell_products.php'); // X-Sell
+  define('FILENAME_EDIT_ORDERS', 'edit_orders.php');
+  define('FILENAME_PAYPAL', 'paypal.php');
+  define('FILENAME_EDIT_LANGUAGES', 'edit_textdata.php');
+// VJ Links Manager v1.00 begin
+  define('FILENAME_LINKS', 'links.php');
+  define('FILENAME_LINK_CATEGORIES', 'link_categories.php');
+  define('FILENAME_LINKS_CONTACT', 'links_contact.php');
+// VJ Links Manager v1.00 end
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  define('FILENAME_INFORMATION_MANAGER', 'information_manager.php');
+//DWD Modify End
+
+  define('FILENAME_FAQ_MANAGER', 'faq_manager.php');
+ define('FILENAME_SHOPBYPRICE', 'shopbyprice.php');
+
+// product notifications
+define('FILENAME_PRODUCT_NOTIFICATION','product_notifications.php');
+
+//added for Backup mySQL (provided Courtesy Zen-Cart Team) DMG
+define('FILENAME_BACKUP_MYSQL','backup_mysql.php');
+
+define('FILENAME_EDIT_TEXT','edit_textdata.php');
+define('FILENAME_EDIT_TEXT_HELP','edit_textdata_help.php');
+//data import/export
+  define('FILENAME_EASYPOPULATE', 'easypopulate.php');
+  define('FILENAME_EASYPOPULATE_EXPORT', 'easypopulate_export.php');
+  define('FILENAME_EASYPOPULATE_IMPORT', 'easypopulate_import.php');
+  define('FILENAME_EASYPOPULATE_BASIC', 'easypopulate_basic.php');
+  define('FILENAME_EASYPOPULATE_BASIC_IMPORT', 'easypopulate_basic_import.php');
+  define('FILENAME_EASYPOPULATE_BASIC_EXPORT', 'easypopulate_basic_export.php');
+  define('FILENAME_DATA_HELP', 'data_help.php');
+  define('FILENAME_DATA', 'data.php');
+  define('FILENAME_FROOGLE_ADMIN', 'froogle_admin.php');
+  define('FILENAME_FROOGLE', 'froogle.php');
+  define('FILENAME_FROOGLE_PRE1', 'froogle_pre1.php');
+  define('FILENAME_FROOGLE_PRE', 'froogle_pre.php');
+  define('FILENAME_POPUP_DATA_HELP', 'popup_data_help.php');
+  define('FILENAME_POPUP_EP_HELP', 'popup_ep_help.php');
+  define('FILENAME_DATA_ADMIN', 'data_admin.php');
+  define('FILENAME_FROOGLE_ADMIN', 'froogle_admin.php');
+  define('FILENAME_FEEDERS', 'feeders.php');
+  define('FILENAME_AMAZON', 'amazon.php');
+  define('FILENAME_BIZRATE', 'bizrate.php');
+
+define('FILENAME_STATS_WISHLIST', 'stats_wishlist.php');
+
+define('FILENAME_DOCUMENT', 'document.php');
+define('FILENAME_DOCUMENT_HELP', 'document_help.php');
+
+// Orderlist 3.1 report added DMG
+
+  define('FILENAME_ORDERLIST', 'feature_not_present.php');
+
+  define('FILENAME_EVENTS_CALENDAR', 'events_calendar.php');
+  define('FILENAME_EVENTS_CALENDAR_CONTENT', 'calendar_content.php');
+  define('FILENAME_EVENTS_MANAGER', 'events_manager.php');
+
+// VJ member approval added
+  define('FILENAME_MEMBERS', 'members.php');
+  
+// DMG Sales Report 2
+  define('FILENAME_STATS_SALES_REPORT2', 'stats_sales_report2.php');
+  
+  define('FILENAME_STATS_DAILY_SALES_REPORT', 'stats_daily_products_sales_report.php');
+//DMG Zipcode Match report
+  define('FILENAME_STATS_ZIPCODE_MATCH','feature_not_present.php');
+  
+//DMG : Create Order Admin by Tom O'Neill
+ define('FILENAME_CREATE_ORDERS_PAY','create_order_payment.php');
+ define('FILENAME_CREATE_ORDERS_SHIP','create_order_shipping.php');
+ 
+//DMG :  FAQ System 2.1
+
+  define('FILENAME_FAQ_MANAGER', 'faq_manager.php');
+  define('FILENAME_FAQ_VIEW', 'faq_view.php');
+  define('FILENAME_FAQ_VIEW_ALL', 'faq_view_all.php');
+  
+// VJ faq manager added
+  define('FILENAME_FAQ_CATEGORIES', 'faq_categories.php');
+  
+//DMG : Article Manager
+
+  define('FILENAME_ARTICLE_REVIEWS', 'article_reviews.php');
+  define('FILENAME_ARTICLES', 'articles.php');
+  define('FILENAME_ARTICLES_CONFIG', 'articles_config.php');
+  define('FILENAME_ARTICLES_XSELL', 'articles_xsell.php');
+  define('FILENAME_AUTHORS', 'authors.php');
+// Article Statistics DMG
+
+  define('FILENAME_STATS_ARTICLES_VIEWED', 'stats_articles_viewed.php');
+// Article Search Filename  DMG
+  define('FILENAME_ARTICLE_SEARCH', 'article_search.php');
+// Multiple Products Admin
+
+define('FILENAME_PRODUCTS_MULTI', 'feature_not_present.php');
+
+// Specials by Category
+define('FILENAME_SPECIALSBYCAT', 'feature_not_present.php');
+ 
+ define('FILENAME_CRYPT','crypt.php');
+ define('FILENAME_CRYPT_TEST','crypt_test.php');
+ define('FILENAME_CRYPT_CONVERT','crypt_convert.php');
+ define('FILENAME_CRYPT_PURGE','crypt_purge.php');
+ 
+// START: Product Extra Fields  DMG
+  define('FILENAME_PRODUCTS_EXTRA_FIELDS', 'feature_not_present.php');
+// END: Product Extra Fields DMG
+
+
+// Customers Orders Report DMG
+  define('FILENAME_STATS_CUSTOMERS_ORDERS', 'stats_customers_orders.php');
+  
+// Daily Product Reports DMG
+  define('FILENAME_STATS_DAILY_SALES_REPORT', 'stats_daily_products_sales_report.php');
+  
+// GV Report DMG
+
+  define('FILENAME_GV_REPORT','gv_report.php');
+  
+// Contact US Email Subjects : DMG
+
+  define('FILENAME_EMAIL_SUBJECTS', 'email_subjects.php');
+
+// VJ navmenu begin
+define('FILENAME_NAVMENU', 'navmenu.php');
+// VJ navmenu end
+
+// VJ infosystem begin
+define('FILENAME_PAGES_CATEGORIES','pages_categories.php');
+define('FILENAME_PAGES','pages.php');
+// VJ infosystem end
+  
+// osC Explain : DMG
+define('FILENAME_INSTALL_EXPLAIN','install-explain.php');
+define('FILENAME_STATS_EXPLAIN','stats_explain_queries.php');
+define('FILENAME_EDIT_KEY_HELP', 'edit_key_help.php');
+define('FILENAME_ENCRYPT_HELP', 'encrypt_help.php');
+define('FILENAME_POPUP_ENCRYPT_HELP', 'popup_encrypt_help.php');
+define('FILENAME_CRYPT','crypt.php');
+define('FILENAME_CRYPT_TEST','crypt_test.php');
+define('FILENAME_CRYPT_UPDATE','crypt_update.php');
+define('FILENAME_CRYPT_CONVERT','crypt_convert.php');
+define('FILENAME_CRYPT_CONVERT1','crypt_convert_1.php');
+define('FILENAME_EDIT_KEY','edit_key.php');
+// Product Extra Fields
+
+    define('FILENAME_PRODUCTS_EXTRA_FIELDS', 'product_extra_fields.php');
+    
+// Eversun mod for sppp
+define('FILENAME_CUSTOMERS_GROUPS', 'feature_not_present.php');
+// Eversun mod end for sppp
+
+  define('FILENAME_HEADER_TAGS_CONTROLLER', 'header_tags_controller.php');
+  define('FILENAME_HEADER_TAGS_ENGLISH', 'header_tags_english.php');
+  define('FILENAME_HEADER_TAGS_FILL_TAGS', 'header_tags_fill_tags.php');
+  define('FILENAME_HEADER_TAGS_INCLUDES', 'header_tags_includes.php');
+  
+//DMG mod for product notifications v3
+  define('FILENAME_STATS_PRODUCTS_NOTIFICATIONS', 'stats_products_notifications.php');//Products Notifications V3
+
+
+  define('FILENAME_STATS_PRODUCTS_NOTIFICATIONS', 'stats_products_notifications.php');//Products Notifications V3
+
+  define('FILENAME_SHIPWIRE', 'shipwire.php');
+  
+  define('FILENAME_OPTION_CATEGORIES','options_categories.php');
+   define('FILENAME_VALIDATE_NEW','validate_new.php');
+   
+  define('FILENAME_INSTALL_EXPLAIN','install-explain.php');
+?>

Added: trunk/direct.openmoko.com/admin/includes/footer.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/footer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/footer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,79 @@
+<?php
+/*
+  $Id: footer.php,v 1.1.1.1 2004/03/04 23:39:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc
+  
+  Copyright &copy; 2003-2006
+  
+  Last Modified By : $Author$
+  Last Modified On : $LastChangeDate$
+  Latest Revision :  $Revision: 2972 $
+  
+*/
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+
+    <td align="center">
+<!--     <a href="http://www.ecommexchange.com" target="_blank"><?php echo tep_image(DIR_WS_IMAGES . '468x60ecomm.gif', '', '468', '60') ;?></a> -->
+<script language='JavaScript' type='text/javascript' src='https://adserver.authsecure.com/adx.js'></script>
+<script language='JavaScript' type='text/javascript'>
+<!--
+   if (!document.phpAds_used) document.phpAds_used = ',';
+   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
+   
+   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
+   document.write ("https://adserver.authsecure.com/adjs.php?n=" + phpAds_random);
+   document.write ("&amp;what=zone:5&amp;block=1&amp;blockcampaign=1");
+   document.write ("&amp;exclude=" + document.phpAds_used);
+   if (document.referrer)
+      document.write ("&amp;referer=" + escape(document.referrer));
+   document.write ("'><" + "/script>");
+//-->
+</script><noscript><a href='https://adserver.authsecure.com/adclick.php?n=a0842127' target='_blank'><img src='https://adserver.authsecure.com/adview.php?what=zone:5&amp;n=a0842127' border='0' alt=''></a></noscript>
+
+     </tr>
+     <tr>
+
+
+    <td align="center" class="smallText">
+<?php
+/*
+  The following copyright announcement is in compliance
+  to section 2c of the GNU General Public License, and
+  thus can not be removed, or can only be modified
+  appropriately.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+?>
+<!-- E-Commerce Engine Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a> Portions Copyright &copy; 2003 - 2006 <a href="http://www.creloaded.com" target="_blank">CRE Loaded Project</a><br>
+osCommerce provides no warranty and is redistributable under the <a href="http://www.fsf.org/licenses/gpl.txt" target="_blank">GNU General Public License</a><br>
+<a href="http://www.chainreactionworks.com" target="_blank">Chain Reaction Works, Inc</a> provides no warranty except as to associated support contracts<br>which are limited by and to the Service Level Agreement.</br> -->
+<?php echo FOOTER_TEXT_1?>
+    </td>
+  </tr>
+  <tr>
+   <td><?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5'); ?></td>
+  </tr>
+  <tr>
+    <td align="center" class="smallText"><!-- Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.creloaded.com" target="_blank">CRE Loaded</a> -->
+  <?php echo FOOTER_TEXT_2?>
+  </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/form_check.js.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/form_check.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/form_check.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+<?php
+/*
+  $Id: form_check.js.php,v 1.1.1.1 2004/03/04 23:39:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+
+<script language="javascript"><!--
+
+var submitted = false;
+
+function check_form() {
+  var error = 0;
+  var error_message = "<?php echo JS_ERROR; ?>";
+
+  if(submitted){
+    alert( "<?php echo JS_ERROR_SUBMITTED; ?>");
+    return false;
+  }
+
+  var first_name = document.account_edit.firstname.value;
+  var last_name = document.account_edit.lastname.value;
+<?php
+   if (ACCOUNT_DOB == 'true') echo '  var dob = document.account_edit.dob.value;' . "\n";
+?>
+  var email_address = document.account_edit.email_address.value;
+  var street_address = document.account_edit.street_address.value;
+  var postcode = document.account_edit.postcode.value;
+  var city = document.account_edit.city.value;
+  var telephone = document.account_edit.telephone.value;
+  var password = document.account_edit.password.value;
+  var confirmation = document.account_edit.confirmation.value;
+
+<?php
+   if (ACCOUNT_GENDER == 'true') {
+?>
+  if (document.account_edit.elements['gender'].type != "hidden") {
+    if (document.account_edit.gender[0].checked || document.account_edit.gender[1].checked) {
+    } else {
+      error_message = error_message + "<?php echo JS_GENDER; ?>";
+      error = 1;
+    }
+  }
+<?php
+  }
+?>
+
+  if (document.account_edit.elements['firstname'].type != "hidden") {
+    if (first_name == '' || first_name.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
+      error_message = error_message + "<?php echo JS_FIRST_NAME; ?>";
+      error = 1;
+    }
+  }
+
+  if (document.account_edit.elements['lastname'].type != "hidden") {
+    if (last_name == '' || last_name.length < <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>) {
+      error_message = error_message + "<?php echo JS_LAST_NAME; ?>";
+      error = 1;
+    }
+  }
+
+<?php
+   if (ACCOUNT_DOB == 'true') {
+?>
+  if (document.account_edit.elements['dob'].type != "hidden") {
+    if (dob == '' || dob.length < <?php echo ENTRY_DOB_MIN_LENGTH; ?>) {
+      error_message = error_message + "<?php echo JS_DOB; ?>";
+      error = 1;
+    }
+  }
+<?php
+  }
+?>
+  if (document.account_edit.elements['email_address'].type != "hidden") {
+    if (email_address == '' || email_address.length < <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>) {
+      error_message = error_message + "<?php echo JS_EMAIL_ADDRESS; ?>";
+      error = 1;
+    }
+  }
+
+  if (document.account_edit.elements['street_address'].type != "hidden") {
+    if (street_address == '' || street_address.length < <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>) {
+      error_message = error_message + "<?php echo JS_ADDRESS; ?>";
+      error = 1;
+    }
+  }
+
+  if (document.account_edit.elements['postcode'].type != "hidden") {
+    if (postcode == '' || postcode.length < <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>) {
+      error_message = error_message + "<?php echo JS_POST_CODE; ?>";
+      error = 1;
+    }
+  }
+
+  if (document.account_edit.elements['city'].type != "hidden") {
+    if (city == '' || city.length < <?php echo ENTRY_CITY_MIN_LENGTH; ?>) {
+      error_message = error_message + "<?php echo JS_CITY; ?>";
+      error = 1;
+    }
+  }
+
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+  if (document.account_edit.elements['state'].type != "hidden") {
+    if (document.account_edit.state.value == '' || document.account_edit.state.value.length < <?php echo ENTRY_STATE_MIN_LENGTH; ?> ) {
+       error_message = error_message + "<?php echo JS_STATE; ?>";
+       error = 1;
+    }
+  }
+<?php
+  }
+?>
+
+  if (document.account_edit.elements['country'].type != "hidden") {
+    if (document.account_edit.country.value == 0) {
+      error_message = error_message + "<?php echo JS_COUNTRY; ?>";
+      error = 1;
+    }
+  }
+
+  if (document.account_edit.elements['telephone'].type != "hidden") {
+    if (telephone == '' || telephone.length < <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>) {
+      error_message = error_message + "<?php echo JS_TELEPHONE; ?>";
+      error = 1;
+    }
+  }
+
+  if (document.account_edit.elements['password'].type != "hidden") {
+    if ((password != confirmation) || (password == '' || password.length < <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>)) {
+      error_message = error_message + "<?php echo JS_PASSWORD; ?>";
+      error = 1;
+    }
+  }
+
+  if (error == 1) {
+    alert(error_message);
+    return false;
+  } else {
+    submitted = true;
+    return true;
+  }
+}
+//--></script>

Added: trunk/direct.openmoko.com/admin/includes/functions/affiliate_functions.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/affiliate_functions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/affiliate_functions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,116 @@
+<?php
+/*
+  $Id: affiliate_functions.php,v 1.1.1.1 2004/03/04 23:39:49 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+function affiliate_delete ($affiliate_id) {
+  $affiliate_query = tep_db_query("SELECT affiliate_rgt, affiliate_lft, affiliate_root  FROM " . TABLE_AFFILIATE . " WHERE affiliate_id = '" . $affiliate_id . "' ");
+  if ($affiliate = tep_db_fetch_array($affiliate_query)) {
+    if ($affiliate['affiliate_root'] == $affiliate_id) {
+      // a root entry is deleted -> his childs get root
+      $affiliate_child_query = tep_db_query("
+                    SELECT aa1.affiliate_id, aa1.affiliate_lft, aa1.affiliate_rgt,  COUNT(*) AS level
+                    FROM affiliate_affiliate AS aa1, affiliate_affiliate AS aa2
+                    WHERE aa1.affiliate_root = " . $affiliate['affiliate_root'] . "
+                          AND aa2.affiliate_root = aa1.affiliate_root
+                          AND aa1.affiliate_lft BETWEEN aa2.affiliate_lft AND aa2.affiliate_rgt
+                          AND aa1.affiliate_rgt BETWEEN aa2.affiliate_lft AND aa2.affiliate_rgt
+                    GROUP BY aa1.affiliate_id, aa1.affiliate_lft, aa1.affiliate_rgt
+                    HAVING level = 2
+                    ORDER BY aa1.affiliate_id
+                   ");
+
+      while ($affiliate_child = tep_db_fetch_array($affiliate_child_query)) {
+        tep_db_query ("UPDATE  " . TABLE_AFFILIATE . " SET affiliate_root = " . $affiliate_child['affiliate_id'] . " WHERE affiliate_root =  " . $affiliate['affiliate_root'] . "  AND affiliate_lft >= " . $affiliate_child['affiliate_lft']  . " AND affiliate_rgt <= " . $affiliate_child['affiliate_rgt']  . " ");
+        $substract =  $affiliate_child['affiliate_lft'] -1;
+        tep_db_query ("UPDATE  " . TABLE_AFFILIATE . " SET affiliate_lft = affiliate_lft - " . $substract . " WHERE  affiliate_root = " . $affiliate_child['affiliate_id']);
+        tep_db_query ("UPDATE  " . TABLE_AFFILIATE . " SET affiliate_rgt = affiliate_rgt - " . $substract . " WHERE  affiliate_root = " . $affiliate_child['affiliate_id']) ;
+      }
+      tep_db_query("DELETE FROM " . TABLE_AFFILIATE . "  WHERE affiliate_id = " . $affiliate_id);
+      tep_db_query("UNLOCK TABLES");
+    } else {
+      tep_db_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE");
+      tep_db_query("DELETE FROM " . TABLE_AFFILIATE . "  WHERE affiliate_id = " . $affiliate_id . " AND affiliate_root = " . $affiliate['affiliate_root'] . " ");
+
+      tep_db_query("UPDATE " . TABLE_AFFILIATE . "
+                  SET affiliate_lft = affiliate_lft -1, affiliate_rgt=affiliate_rgt-1
+                  WHERE affiliate_lft BETWEEN " . $affiliate['affiliate_lft'] . " and " . $affiliate['affiliate_rgt'] . "
+                  AND affiliate_root =  " . $affiliate['affiliate_root'] . "
+                ");
+      tep_db_query("UPDATE " . TABLE_AFFILIATE . "
+                  SET affiliate_lft = affiliate_lft-2
+                  WHERE affiliate_lft > " . $affiliate['affiliate_rgt'] . "
+                  AND affiliate_root =  " . $affiliate['affiliate_root'] . "
+                 ");
+      tep_db_query("UPDATE " . TABLE_AFFILIATE . "
+                  SET affiliate_rgt = affiliate_rgt-2
+                  WHERE affiliate_rgt > " . $affiliate['affiliate_rgt'] . "
+                  AND affiliate_root =  " . $affiliate['affiliate_root'] . "
+                 ");
+      tep_db_query("UNLOCK TABLES");
+    }
+  }
+}
+
+////
+// Compatibility to older Snapshots
+  if (!function_exists('tep_round')) {
+    function tep_round($value, $precision) {
+      if (PHP_VERSION < 4) {
+        $exp = pow(10, $precision);
+        return round($value * $exp) / $exp;
+      } else {
+        return round($value, $precision);
+      }
+    }
+  }
+
+////
+// Output a form
+  if (!function_exists('tep_draw_form')) {
+    function tep_draw_form($name, $action, $method = 'post', $parameters = '') {
+      $form = '<form name="' . tep_parse_input_field_data($name, array('"' => '&quot;')) . '" action="' . tep_parse_input_field_data($action, array('"' => '&quot;')) . '" method="' . tep_parse_input_field_data($method, array('"' => '&quot;')) . '"';
+
+      if (tep_not_null($parameters)) $form .= ' ' . $parameters;
+
+      $form .= '>';
+
+      return $form;
+    }
+  }
+
+////
+// Returns the tax rate for a zone / class
+// TABLES: tax_rates, zones_to_geo_zones
+  function tep_get_affiliate_tax_rate($class_id, $country_id, $zone_id) {
+
+    $tax_query = tep_db_query("select SUM(tax_rate) as tax_rate
+                               from " . TABLE_TAX_RATES . " tr
+                               left join " . TABLE_ZONES_TO_GEO_ZONES . " za ON tr.tax_zone_id = za.geo_zone_id
+                               left join " . TABLE_GEO_ZONES . " tz ON tz.geo_zone_id = tr.tax_zone_id
+                               WHERE (za.zone_country_id IS NULL OR za.zone_country_id = '0' OR za.zone_country_id = '" . $country_id . "')
+                                 AND (za.zone_id IS NULL OR za.zone_id = '0' OR za.zone_id = '" . $zone_id . "')
+                                 AND tr.tax_class_id = '" . $class_id . "'
+                               GROUP BY tr.tax_priority");
+    if (tep_db_num_rows($tax_query)) {
+      $tax_multiplier = 0;
+      while ($tax = tep_db_fetch_array($tax_query)) {
+        $tax_multiplier += $tax['tax_rate'];
+      }
+      return $tax_multiplier;
+    } else {
+      return 0;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/articles.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,332 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// Parse and secure the tPath parameter values
+  function tep_parse_topic_path($tPath) {
+// make sure the topic IDs are integers
+    $tPath_array = array_map('tep_string_to_int', explode('_', $tPath));
+
+// make sure no duplicate topic IDs exist which could lock the server in a loop
+    $tmp_array = array();
+    $n = sizeof($tPath_array);
+    for ($i=0; $i<$n; $i++) {
+      if (!in_array($tPath_array[$i], $tmp_array)) {
+        $tmp_array[] = $tPath_array[$i];
+      }
+    }
+
+    return $tmp_array;
+  }
+
+  function tep_get_topic_name($topic_id, $language_id) {
+    $topic_query = tep_db_query("select topics_name from " . TABLE_TOPICS_DESCRIPTION . " where topics_id = '" . (int)$topic_id . "' and language_id = '" . (int)$language_id . "'");
+    $topic = tep_db_fetch_array($topic_query);
+
+    return $topic['topics_name'];
+  }
+
+  function tep_get_topic_tree($parent_id = '0', $spacing = '', $exclude = '', $topic_tree_array = '', $include_itself = false) {
+    global $languages_id;
+
+    if (!is_array($topic_tree_array)) $topic_tree_array = array();
+    if ( (sizeof($topic_tree_array) < 1) && ($exclude != '0') ) $topic_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
+
+    if ($include_itself) {
+      $topic_query = tep_db_query("select cd.topics_name from " . TABLE_TOPICS_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.topics_id = '" . (int)$parent_id . "'");
+      $topic = tep_db_fetch_array($topic_query);
+      $topic_tree_array[] = array('id' => $parent_id, 'text' => $topic['topics_name']);
+    }
+
+    $topics_query = tep_db_query("select c.topics_id, cd.topics_name, c.parent_id from " . TABLE_TOPICS . " c, " . TABLE_TOPICS_DESCRIPTION . " cd where c.topics_id = cd.topics_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.topics_name");
+    while ($topics = tep_db_fetch_array($topics_query)) {
+      if ($exclude != $topics['topics_id']) $topic_tree_array[] = array('id' => $topics['topics_id'], 'text' => $spacing . $topics['topics_name']);
+      $topic_tree_array = tep_get_topic_tree($topics['topics_id'], $spacing . '&nbsp;&nbsp;&nbsp;', $exclude, $topic_tree_array);
+    }
+
+    return $topic_tree_array;
+  }
+
+  function tep_generate_topic_path($id, $from = 'topic', $topics_array = '', $index = 0) {
+    global $languages_id;
+
+    if (!is_array($topics_array)) $topics_array = array();
+
+    if ($from == 'article') {
+      $topics_query = tep_db_query("select topics_id from " . TABLE_ARTICLES_TO_TOPICS . " where articles_id = '" . (int)$id . "'");
+      while ($topics = tep_db_fetch_array($topics_query)) {
+        if ($topics['topics_id'] == '0') {
+          $topics_array[$index][] = array('id' => '0', 'text' => TEXT_TOP);
+        } else {
+          $topic_query = tep_db_query("select cd.topics_name, c.parent_id from " . TABLE_TOPICS . " c, " . TABLE_TOPICS_DESCRIPTION . " cd where c.topics_id = '" . (int)$topics['topics_id'] . "' and c.topics_id = cd.topics_id and cd.language_id = '" . (int)$languages_id . "'");
+          $topic = tep_db_fetch_array($topic_query);
+          $topics_array[$index][] = array('id' => $topics['topics_id'], 'text' => $topic['topics_name']);
+          if ( (tep_not_null($topic['parent_id'])) && ($topic['parent_id'] != '0') ) $topics_array = tep_generate_topic_path($topic['parent_id'], 'topic', $topics_array, $index);
+          $topics_array[$index] = array_reverse($topics_array[$index]);
+        }
+        $index++;
+      }
+    } elseif ($from == 'topic') {
+      $topic_query = tep_db_query("select cd.topics_name, c.parent_id from " . TABLE_TOPICS . " c, " . TABLE_TOPICS_DESCRIPTION . " cd where c.topics_id = '" . (int)$id . "' and c.topics_id = cd.topics_id and cd.language_id = '" . (int)$languages_id . "'");
+      $topic = tep_db_fetch_array($topic_query);
+      $topics_array[$index][] = array('id' => $id, 'text' => $topic['topics_name']);
+      if ( (tep_not_null($topic['parent_id'])) && ($topic['parent_id'] != '0') ) $topics_array = tep_generate_topic_path($topic['parent_id'], 'topic', $topics_array, $index);
+    }
+
+    return $topics_array;
+  }
+
+  function tep_output_generated_topic_path($id, $from = 'topic') {
+    $calculated_topic_path_string = '';
+    $calculated_topic_path = tep_generate_topic_path($id, $from);
+    for ($i=0, $n=sizeof($calculated_topic_path); $i<$n; $i++) {
+      for ($j=0, $k=sizeof($calculated_topic_path[$i]); $j<$k; $j++) {
+        $calculated_topic_path_string .= $calculated_topic_path[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
+      }
+      $calculated_topic_path_string = substr($calculated_topic_path_string, 0, -16) . '<br>';
+    }
+    $calculated_topic_path_string = substr($calculated_topic_path_string, 0, -4);
+
+    if (strlen($calculated_topic_path_string) < 1) $calculated_topic_path_string = TEXT_TOP;
+
+    return $calculated_topic_path_string;
+  }
+
+////
+// Generate a path to topics
+  function tep_get_topic_path($current_topic_id = '') {
+    global $tPath_array;
+
+    if (tep_not_null($current_topic_id)) {
+      $cp_size = sizeof($tPath_array);
+      if ($cp_size == 0) {
+        $tPath_new = $current_topic_id;
+      } else {
+        $tPath_new = '';
+        $last_topic_query = tep_db_query("select parent_id from " . TABLE_TOPICS . " where topics_id = '" . (int)$tPath_array[($cp_size-1)] . "'");
+        $last_topic = tep_db_fetch_array($last_topic_query);
+
+        $current_topic_query = tep_db_query("select parent_id from " . TABLE_TOPICS . " where topics_id = '" . (int)$current_topic_id . "'");
+        $current_topic = tep_db_fetch_array($current_topic_query);
+
+        if ($last_topic['parent_id'] == $current_topic['parent_id']) {
+          for ($i=0; $i<($cp_size-1); $i++) {
+            $tPath_new .= '_' . $tPath_array[$i];
+          }
+        } else {
+          for ($i=0; $i<$cp_size; $i++) {
+            $tPath_new .= '_' . $tPath_array[$i];
+          }
+        }
+        $tPath_new .= '_' . $current_topic_id;
+
+        if (substr($tPath_new, 0, 1) == '_') {
+          $tPath_new = substr($tPath_new, 1);
+        }
+      }
+    } else {
+      $tPath_new = implode('_', $tPath_array);
+    }
+
+    return 'tPath=' . $tPath_new;
+  }
+
+  function tep_get_generated_topic_path_ids($id, $from = 'topic') {
+    $calculated_topic_path_string = '';
+    $calculated_topic_path = tep_generate_topic_path($id, $from);
+    for ($i=0, $n=sizeof($calculated_topic_path); $i<$n; $i++) {
+      for ($j=0, $k=sizeof($calculated_topic_path[$i]); $j<$k; $j++) {
+        $calculated_topic_path_string .= $calculated_topic_path[$i][$j]['id'] . '_';
+      }
+      $calculated_topic_path_string = substr($calculated_topic_path_string, 0, -1) . '<br>';
+    }
+    $calculated_topic_path_string = substr($calculated_topic_path_string, 0, -4);
+
+    if (strlen($calculated_topic_path_string) < 1) $calculated_topic_path_string = TEXT_TOP;
+
+    return $calculated_topic_path_string;
+  }
+
+////
+// Return the authors URL in the needed language
+// TABLES: authors_info
+  function tep_get_author_url($author_id, $language_id) {
+    $author_query = tep_db_query("select authors_url from " . TABLE_AUTHORS_INFO . " where authors_id = '" . (int)$author_id . "' and languages_id = '" . (int)$language_id . "'");
+    $author = tep_db_fetch_array($author_query);
+
+    return $author['authors_url'];
+  }
+
+////
+// Return the authors description in the needed language
+// TABLES: authors_info
+  function tep_get_author_description($author_id, $language_id) {
+    $author_query = tep_db_query("select authors_description from " . TABLE_AUTHORS_INFO . " where authors_id = '" . (int)$author_id . "' and languages_id = '" . (int)$language_id . "'");
+    $author = tep_db_fetch_array($author_query);
+
+    return $author['authors_description'];
+  }
+
+////
+// Sets the status of an article
+  function tep_set_article_status($articles_id, $status) {
+    if ($status == '1') {
+      return tep_db_query("update " . TABLE_ARTICLES . " set articles_status = '1', articles_last_modified = now() where articles_id = '" . (int)$articles_id . "'");
+    } elseif ($status == '0') {
+      return tep_db_query("update " . TABLE_ARTICLES . " set articles_status = '0', articles_last_modified = now() where articles_id = '" . (int)$articles_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+  function tep_get_articles_name($article_id, $language_id = 0) {
+    global $languages_id;
+
+    if ($language_id == 0) $language_id = $languages_id;
+    $article_query = tep_db_query("select articles_name from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$article_id . "' and language_id = '" . (int)$language_id . "'");
+    $article = tep_db_fetch_array($article_query);
+
+    return $article['articles_name'];
+  }
+
+  function tep_get_articles_head_title_tag($article_id, $language_id = 0) {
+    global $languages_id;
+
+    if ($language_id == 0) $language_id = $languages_id;
+    $article_query = tep_db_query("select articles_head_title_tag from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$article_id . "' and language_id = '" . (int)$language_id . "'");
+    $article = tep_db_fetch_array($article_query);
+
+    return $article['articles_head_title_tag'];
+  }
+
+  function tep_get_articles_description($article_id, $language_id) {
+    $article_query = tep_db_query("select articles_description from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$article_id . "' and language_id = '" . (int)$language_id . "'");
+    $article = tep_db_fetch_array($article_query);
+
+    return $article['articles_description'];
+  }
+
+  function tep_get_articles_head_desc_tag($article_id, $language_id) {
+    $article_query = tep_db_query("select articles_head_desc_tag from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$article_id . "' and language_id = '" . (int)$language_id . "'");
+    $article = tep_db_fetch_array($article_query);
+
+    return $article['articles_head_desc_tag'];
+  }
+
+  function tep_get_articles_head_keywords_tag($article_id, $language_id) {
+    $article_query = tep_db_query("select articles_head_keywords_tag from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$article_id . "' and language_id = '" . (int)$language_id . "'");
+    $article = tep_db_fetch_array($article_query);
+
+    return $article['articles_head_keywords_tag'];
+  }
+
+  function tep_get_articles_url($article_id, $language_id) {
+    $article_query = tep_db_query("select articles_url from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$article_id . "' and language_id = '" . (int)$language_id . "'");
+    $article = tep_db_fetch_array($article_query);
+
+    return $article['articles_url'];
+  }
+
+
+////
+// Count how many articles exist in a topic
+// TABLES: articles, articles_to_topics, topics
+  function tep_articles_in_topic_count($topics_id, $include_deactivated = false) {
+    $articles_count = 0;
+
+    if ($include_deactivated) {
+      $articles_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES . " p, " . TABLE_ARTICLES_TO_TOPICS . " p2c where p.articles_id = p2c.articles_id and p2c.topics_id = '" . (int)$topics_id . "'");
+    } else {
+      $articles_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES . " p, " . TABLE_ARTICLES_TO_TOPICS . " p2c where p.articles_id = p2c.articles_id and p.articles_status = '1' and p2c.topics_id = '" . (int)$topics_id . "'");
+    }
+
+    $articles = tep_db_fetch_array($articles_query);
+
+    $articles_count += $articles['total'];
+
+    $childs_query = tep_db_query("select topics_id from " . TABLE_TOPICS . " where parent_id = '" . (int)$topics_id . "'");
+    if (tep_db_num_rows($childs_query)) {
+      while ($childs = tep_db_fetch_array($childs_query)) {
+        $articles_count += tep_articles_in_topic_count($childs['topics_id'], $include_deactivated);
+      }
+    }
+
+    return $articles_count;
+  }
+
+////
+// Count how many subtopics exist in a topic
+// TABLES: topics
+  function tep_childs_in_topic_count($topics_id) {
+    $topics_count = 0;
+
+    $topics_query = tep_db_query("select topics_id from " . TABLE_TOPICS . " where parent_id = '" . (int)$topics_id . "'");
+    while ($topics = tep_db_fetch_array($topics_query)) {
+      $topics_count++;
+      $topics_count += tep_childs_in_topic_count($topics['topics_id']);
+    }
+
+    return $topics_count;
+  }
+
+  function tep_remove_topic($topic_id) {
+    $topic_image_query = tep_db_query("select topics_image from " . TABLE_TOPICS . " where topics_id = '" . (int)$topic_id . "'");
+    $topic_image = tep_db_fetch_array($topic_image_query);
+
+    $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_TOPICS . " where topics_image = '" . tep_db_input($topic_image['topics_image']) . "'");
+    $duplicate_image = tep_db_fetch_array($duplicate_image_query);
+
+    if ($duplicate_image['total'] < 2) {
+      if (file_exists(DIR_FS_CATALOG_IMAGES . $topic_image['topics_image'])) {
+        @unlink(DIR_FS_CATALOG_IMAGES . $topic_image['topics_image']);
+      }
+    }
+
+    tep_db_query("delete from " . TABLE_TOPICS . " where topics_id = '" . (int)$topic_id . "'");
+    tep_db_query("delete from " . TABLE_TOPICS_DESCRIPTION . " where topics_id = '" . (int)$topic_id . "'");
+    tep_db_query("delete from " . TABLE_ARTICLES_TO_TOPICS . " where topics_id = '" . (int)$topic_id . "'");
+
+    if (USE_CACHE == 'true') {
+      tep_reset_cache_block('topics');
+      tep_reset_cache_block('also_purchased');
+    }
+  }
+
+  function tep_remove_article($article_id) {
+    tep_db_query("delete from " . TABLE_ARTICLES . " where articles_id = '" . (int)$article_id . "'");
+    tep_db_query("delete from " . TABLE_ARTICLES_TO_TOPICS . " where articles_id = '" . (int)$article_id . "'");
+    tep_db_query("delete from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$article_id . "'");
+
+    $article_reviews_query = tep_db_query("select reviews_id from " . TABLE_ARTICLE_REVIEWS . " where articles_id = '" . (int)$article_id . "'");
+    while ($article_reviews = tep_db_fetch_array($article_reviews_query)) {
+      tep_db_query("delete from " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$article_reviews['reviews_id'] . "'");
+    }
+    tep_db_query("delete from " . TABLE_ARTICLE_REVIEWS . " where articles_id = '" . (int)$article_id . "'");
+
+    if (USE_CACHE == 'true') {
+      tep_reset_cache_block('topics');
+      tep_reset_cache_block('also_purchased');
+    }
+  }
+
+// Topics Description contribution
+  function tep_get_topic_heading_title($topic_id, $language_id) {
+    $topic_query = tep_db_query("select topics_heading_title from " . TABLE_TOPICS_DESCRIPTION . " where topics_id = '" . $topic_id . "' and language_id = '" . $language_id . "'");
+    $topic = tep_db_fetch_array($topic_query);
+    return $topic['topics_heading_title'];
+  }
+
+  function tep_get_topic_description($topic_id, $language_id) {
+    $topic_query = tep_db_query("select topics_description from " . TABLE_TOPICS_DESCRIPTION . " where topics_id = '" . $topic_id . "' and language_id = '" . $language_id . "'");
+    $topic = tep_db_fetch_array($topic_query);
+    return $topic['topics_description'];
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/attributes_sorter_added_functions.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/attributes_sorter_added_functions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/attributes_sorter_added_functions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,226 @@
+<?php
+/*
+  WebMakers.com Added: attributes_sorter_added_functions.php
+  Additional functions for the admin
+
+  Shoppe Enhancement Controller - Copyright (c) 2003 WebMakers.com
+  Linda McGrath - osCommerce at WebMakers.com
+*/
+
+function tep_delete_products_attributes($delete_product_id) {
+  // delete products attributes
+//  tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "pad, " . TABLE_PRODUCT_ATTRIBUTES . 'pa where pa.products_id = '" . $delete_product_id . "'" . " and pad.products_attributes_id='" . pa.products_attributes_id . "'");
+
+  // delete associated downloads
+  $products_delete_from_query= tep_db_query("select pa.products_id, pad.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad  where pa.products_id='" . $delete_product_id . "' and pad.products_attributes_id= pa.products_attributes_id");
+  while ( $products_delete_from=tep_db_fetch_array($products_delete_from_query) ) {
+    tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . $products_delete_from['products_attributes_id'] . "'");
+  }
+//        tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_copy_to_check['products_id'] . "'");
+
+  tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $delete_product_id . "'");
+}
+
+function tep_copy_products_attributes($products_id_from,$products_id_to) {
+  global $copy_attributes_delete_first, $copy_attributes_duplicates_skipped, $copy_attributes_duplicates_overwrite, $copy_attributes_include_downloads, $copy_attributes_include_filename;
+  // $products_id_to= $copy_to_products_id;
+  // $products_id_from = $pID;
+  $products_copy_to_query= tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_id='" . $products_id_to . "'");
+  $products_copy_to_check_query= tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_id='" . $products_id_to . "'");
+  $products_copy_from_query= tep_db_query("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $products_id_from . "'");
+  $products_copy_from_check_query= tep_db_query("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $products_id_from . "'");
+
+// Check for errors in copy request
+  if (!$products_copy_from_check=tep_db_fetch_array($products_copy_from_check_query) or !$products_copy_to_check=tep_db_fetch_array($products_copy_to_check_query) or $products_id_to == $products_id_from ) {
+    echo '<table width="100%"><tr>';
+    if ($products_id_to == $products_id_from) {
+      // same products_id
+      //echo '<td class="messageStackError">' . tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . '<b>WARNING: Cannot copy from Product ID #' . $products_id_from . ' to Product ID # ' . $products_id_to . ' ... No copy was made</b>' . '</td>';
+
+      echo '<td class="messageStackError">' . tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . CANNOT_COPY_PRODUCT_ERROR_1 . $products_id_from . CANNOT_COPY_PRODUCT_ERROR_2 . $products_id_to . CANNOT_COPY_PRODUCT_ERROR_3 . '</td>';
+
+    } else {
+      if (!$products_copy_from_check) {
+        // no attributes found to copy
+        //echo '<td class="messageStackError">' . tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . '<b>WARNING: No Attributes to copy from Product ID #' . $products_id_from . ' for: ' . tep_get_products_name($products_id_from) . ' ... No copy was made</b>' . '</td>';
+
+        echo '<td class="messageStackError">' . tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . NO_ATTRIBUTES_COPY_ERROR_1 . $products_id_from . NO_ATTRIBUTES_COPY_ERROR_2 . tep_get_products_name($products_id_from) . NO_ATTRIBUTES_COPY_ERROR_3 . '</td>';
+      } else {
+        // invalid products_id
+       // echo '<td class="messageStackError">' . tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . '<b>WARNING: There is no Product ID #' . $products_id_to . ' ... No copy was made' . '</b>' . '</td>';
+
+        echo '<td class="messageStackError">' . tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . NO_PRODUCT_ERROR_1 . $products_id_to . NO_PRODUCT_ERROR_2 . '</td>';
+      }
+    }
+    echo '</tr></table>';
+  } else {
+
+if (false) { // Used for testing
+echo $products_id_from . 'x' . $products_id_to . '<br>';
+echo $copy_attributes_delete_first;
+echo $copy_attributes_duplicates_skipped;
+echo $copy_attributes_duplicates_overwrite;
+echo $copy_attributes_include_downloads;
+echo $copy_attributes_include_filename . '<br>';
+} // false for testing
+
+    if ($copy_attributes_delete_first=='1') {
+      // delete all attributes and downloads first
+        $products_delete_from_query= tep_db_query("select pa.products_id, pad.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad  where pa.products_id='" . $products_id_to . "' and pad.products_attributes_id= pa.products_attributes_id");
+        while ( $products_delete_from=tep_db_fetch_array($products_delete_from_query) ) {
+          tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . $products_delete_from['products_attributes_id'] . "'");
+        }
+        tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_copy_to_check['products_id'] . "'");
+    }
+
+    while ( $products_copy_from=tep_db_fetch_array($products_copy_from_query) ) {
+      $rows++;
+// This must match the structure of your products_attributes table
+// Current Field Order: products_attributes_id, options_values_price, price_prefix, products_options_sort_order, product_attributes_one_time, products_attributes_weight, products_attributes_weight_prefix, products_attributes_units, products_attributes_units_price
+// First test for existing attribute already being there
+      $check_attribute_query= tep_db_query("select products_id, products_attributes_id, options_id, options_values_id from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $products_id_to . "' and options_id='" . $products_copy_from['options_id'] . "' and options_values_id ='" . $products_copy_from['options_values_id'] . "'");
+      $check_attribute= tep_db_fetch_array($check_attribute_query);
+// Check if there is a download with this attribute
+      $check_attributes_download_query= tep_db_query("select * from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id ='" . $products_copy_from['products_attributes_id'] . "'");
+      $check_attributes_download=tep_db_fetch_array($check_attributes_download_query);
+
+// Process Attribute
+      $skip_it=false;
+      switch (true) {
+        case ($check_attribute and $copy_attributes_duplicates_skipped):
+          // skip duplicate attributes
+//          echo 'DUPLICATE ' . ' Option ' . $products_copy_from['options_id'] . ' Value ' . $products_copy_from['options_values_id'] . ' Price ' . $products_copy_from['options_values_price'] . ' SKIPPED<br>';
+          $skip_it=true;
+          break;
+        case (!$copy_attributes_include_downloads and $check_attributes_download['products_attributes_id']):
+          // skip download attributes
+//          echo 'Download - ' . ' Attribute ID ' . $check_attributes_download['products_attributes_id'] . ' do not copy it<br>';
+          $skip_it=true;
+          break;
+        default:
+//          echo '$check_attributes_download ' . $check_attributes_download['products_attributes_id'] . '<br>';
+          if ($check_attributes_download['products_attributes_id']) {
+            if (DOWNLOAD_ENABLED=='false' or !$copy_attributes_include_downloads) {
+              // do not copy this download
+//              echo 'This is a download not to be copied <br>';
+              $skip_it=true;
+            } else {
+              // copy this download
+//              echo 'This is a download to be copied <br>';
+            }
+          }
+
+// skip anything when $skip_it
+          if (!$skip_it) {
+            if ($check_attribute['products_id']) {
+              // Duplicate attribute - update it
+//              echo 'Duplicate - Update ' . $check_attribute['products_id'] . ' Option ' . $check_attribute['options_id'] . ' Value ' . $check_attribute['options_values_id'] . ' Price ' . $products_copy_from['options_values_price'] . '<br>';
+              // tep_db_query("update set " . TABLE_PRODUCTS_ATTRIBUTES . ' ' . options_id=$products_copy_from['options_id'] . "', '" . options_values_id=$products_copy_from['options_values_id'] . "', '" . options_values_price=$products_copy_from['options_values_price'] . "', '" . price_prefix=$products_copy_from['price_prefix'] . "', '" . products_options_sort_order=$products_copy_from['products_options_sort_order'] . "', '" . product_attributes_one_time=$products_copy_from['product_attributes_one_time'] . "', '" . products_attributes_weight=$products_copy_from['products_attributes_weight'] . "', '" . products_attributes_weight_prefix=$products_copy_from['products_attributes_weight_prefix'] . "', '" . products_attributes_units=$products_copy_from['products_attributes_units'] . "', '" . products_attributes_units_price=$products_copy_from['products_attributes_units_price'] . " where products_id='" . $products_id_to . "' and products_attributes_id='" . $check_attribute['products_attributes_id'] . "'");
+
+              $sql_data_array = array(
+                'options_id' => tep_db_prepare_input($products_copy_from['options_id']),
+                'options_values_id' => tep_db_prepare_input($products_copy_from['options_values_id']),
+                'options_values_price' => tep_db_prepare_input($products_copy_from['options_values_price']),
+                'price_prefix' => tep_db_prepare_input($products_copy_from['price_prefix']),
+                'products_options_sort_order' => tep_db_prepare_input($products_copy_from['products_options_sort_order']),
+              );
+
+              $cur_attributes_id = $check_attribute['products_attributes_id'];
+              tep_db_perform(TABLE_PRODUCTS_ATTRIBUTES, $sql_data_array, 'update', 'products_id = \'' . tep_db_input($products_id_to) . '\' and products_attributes_id=\'' . tep_db_input($cur_attributes_id) . '\'');
+            } else {
+              // New attribute - insert it
+//              echo 'New - Insert ' . 'Option ' . $products_copy_from['options_id'] . ' Value ' . $products_copy_from['options_values_id']  . ' Price ' . $products_copy_from['options_values_price'] . '<br>';
+              tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $products_id_to . "', '" . $products_copy_from['options_id'] . "', '" . $products_copy_from['options_values_id'] . "', '" . $products_copy_from['options_values_price'] . "', '" . $products_copy_from['price_prefix'] . "', '" . $products_copy_from['products_options_sort_order'] . "') ");
+            }
+
+// Manage download attribtues
+            if (DOWNLOAD_ENABLED == 'true') {
+              if ($check_attributes_download and $copy_attributes_include_downloads) {
+                // copy download attributes
+//                echo 'Download - ' . ' Attribute ID ' . $check_attributes_download['products_attributes_id'] . ' ' . $check_attributes_download['products_attributes_filename'] . ' copy it<br>';
+                $new_attribute_query= tep_db_query("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $products_id_to . "' and options_id='" . $products_copy_from['options_id'] . "' and options_values_id ='" . $products_copy_from['options_values_id'] . "'");
+                $new_attribute= tep_db_fetch_array($new_attribute_query);
+
+                $sql_data_array = array(
+                  'products_attributes_id' => tep_db_prepare_input($new_attribute['products_attributes_id']),
+                  'products_attributes_filename' => tep_db_prepare_input($check_attributes_download['products_attributes_filename']),
+                  'products_attributes_maxdays' => tep_db_prepare_input($check_attributes_download['products_attributes_maxdays']),
+                  'products_attributes_maxcount' => tep_db_prepare_input($check_attributes_download['products_attributes_maxcount'])
+                );
+
+                $cur_attributes_id = $check_attribute['products_attributes_id'];
+                tep_db_perform(TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD, $sql_data_array);
+              }
+            }
+          } // $skip_it
+          break;
+      } // end of switch
+    } // end of products attributes while loop
+  } // end of no attributes or other errors
+} // eof: tep_copy_products_attributes
+
+
+////
+// Check if product has attributes
+  function tep_has_product_attributes($products_id) {
+    $attributes_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_id . "'");
+    $attributes = tep_db_fetch_array($attributes_query);
+
+    if ($attributes['count'] > 0) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+
+////
+// Set attributes_discounted on/off
+  function tep_discount_products_attributes($products_id, $on_off='1') {
+    $attributes_discount_query = tep_db_query("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_id . "'");
+    while ($attributes_discount = tep_db_fetch_array($attributes_discount_query)) {
+//      echo $attributes_discount['products_attributes_id'] . ' - ' . $on_off . '<br>';
+        tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_discounted = '" . $on_off . "' where products_attributes_id = '" . $attributes_discount['products_attributes_id'] . "'");
+    }
+  }
+
+
+////
+// Set products_price_excluded on/off
+  function tep_products_price_excluded($products_id, $on_off='1') {
+    tep_db_query("update " . TABLE_PRODUCTS . " set products_price_excluded='" . $on_off . "' where products_id='" . $products_id . "'");
+  }
+
+////
+// Set Product Attributes Sort Order to Products Option Value Sort Order
+  function tep_update_attributes_products_option_values_sort_order($products_id) {
+    $attributes_sort_order_query = tep_db_query("select distinct pa.products_attributes_id, pa.options_id, pa.options_values_id, pa.products_options_sort_order, pov.products_options_values_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $products_id . "' and pa.options_values_id = pov.products_options_values_id");
+    while ($attributes_sort_order = tep_db_fetch_array($attributes_sort_order_query)) {
+      tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_options_sort_order = '" . $attributes_sort_order['products_options_values_sort_order'] . "' where products_id = '" . $products_id . "' and products_attributes_id = '" . $attributes_sort_order['products_attributes_id'] . "'");
+    }
+  }
+ //CLR 030312 add function to draw pulldown list of option types
+// Draw a pulldown for Option Types
+function draw_optiontype_pulldown($name, $default = '') {
+  $values = array();
+  $values[] = array('id' => 0, 'text' => 'Select');
+  $values[] = array('id' => 1, 'text' => 'Text');
+  $values[] = array('id' => 2, 'text' => 'Radio');
+  $values[] = array('id' => 3, 'text' => 'Checkbox');
+  $values[] = array('id' => 4, 'text' => 'Text Area');
+  return tep_draw_pull_down_menu($name, $values, $default);
+}
+
+//CLR 030312 add function to translate type_id to name
+// Translate option_type_values to english string
+function translate_type_to_name($opt_type) {
+  if ($opt_type == 0) return 'Select';
+  if ($opt_type == 1) return 'Text';
+  if ($opt_type == 2) return 'Radio';
+  if ($opt_type == 3) return 'Checkbox';
+  if ($opt_type == 4) return 'Text Area';
+  return 'Error ' . $opt_type;
+}
+ 
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/c_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/c_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/c_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,198 @@
+<?php
+/*
+  $Id: c_orders.php,v 1.1.   
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<?php
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_get_country_id
+  //
+  // Arguments   : country_name   country name string
+  //
+  // Return      : country_id
+  //
+  // Description : Function to retrieve the country_id based on the country's name
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_get_country_id($country_name) {
+
+    $country_id_query = tep_db_query("select * from " . TABLE_COUNTRIES . " where countries_name = '" . $country_name . "'");
+
+    if (!tep_db_num_rows($country_id_query)) {
+      return 0;
+    }
+    else {
+      $country_id_row = tep_db_fetch_array($country_id_query);
+      return $country_id_row['countries_id'];
+    }
+  }
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_get_country_iso_code_2
+  //
+  // Arguments   : country_id   country id number
+  //
+  // Return      : country_iso_code_2
+  //
+  // Description : Function to retrieve the country_iso_code_2 based on the country's id
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_get_country_iso_code_2($country_id) {
+
+    $country_iso_query = tep_db_query("select * from " . TABLE_COUNTRIES . " where countries_id = '" . $country_id . "'");
+
+    if (!tep_db_num_rows($country_iso_query)) {
+      return 0;
+    }
+    else {
+      $country_iso_row = tep_db_fetch_array($country_iso_query);
+      return $country_iso_row['countries_iso_code_2'];
+    }
+  }
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_get_zone_id
+  //
+  // Arguments   : country_id   country id string
+  //               zone_name    state/province name
+  //
+  // Return      : zone_id
+  //
+  // Description : Function to retrieve the zone_id based on the zone's name
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_get_zone_id($country_id, $zone_name) {
+
+    $zone_id_query = tep_db_query("select * from " . TABLE_ZONES . " where zone_country_id = '" . $country_id . "' and zone_name = '" . $zone_name . "'");
+
+    if (!tep_db_num_rows($zone_id_query)) {
+      return 0;
+    }
+    else {
+      $zone_id_row = tep_db_fetch_array($zone_id_query);
+      return $zone_id_row['zone_id'];
+    }
+  }
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_field_exists
+  //
+  // Arguments   : table  table name
+  //               field  field name
+  //
+  // Return      : true/false
+  //
+  // Description : Function to check the existence of a database field
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_field_exists($table,$field) {
+
+    $describe_query = tep_db_query("describe $table");
+    while($d_row = tep_db_fetch_array($describe_query))
+    {
+      if ($d_row["Field"] == "$field")
+      return true;
+    }
+
+    return false;
+  }
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_html_quotes
+  //
+  // Arguments   : string any string
+  //
+  // Return      : string with single quotes converted to html equivalent
+  //
+  // Description : Function to change quotes to HTML equivalents for form inputs.
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_html_quotes($string) {
+    return str_replace("'", "&#39;", $string);
+  }
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_html_unquote
+  //
+  // Arguments   : string any string
+  //
+  // Return      : string with html equivalent converted back to single quotes
+  //
+  // Description : Function to change HTML equivalents back to quotes
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_html_unquote($string) {
+    return str_replace("&#39;", "'", $string);
+  }
+
+
+function sbs_get_zone_name($country_id, $zone_id) {
+    $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . $country_id . "' and zone_id = '" . $zone_id . "'");
+    if (tep_db_num_rows($zone_query)) {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_name'];
+    } else {
+      return $default_zone;
+    }
+  }
+
+ // Returns an array with countries
+// TABLES: countries
+  function sbs_get_countries($countries_id = '', $with_iso_codes = false) {
+    $countries_array = array();
+    if ($countries_id) {
+      if ($with_iso_codes) {
+        $countries = tep_db_query("select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "' order by countries_name");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name'],
+                                 'countries_iso_code_2' => $countries_values['countries_iso_code_2'],
+                                 'countries_iso_code_3' => $countries_values['countries_iso_code_3']);
+      } else {
+        $countries = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "'");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name']);
+      }
+    } else {
+      $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name");
+      while ($countries_values = tep_db_fetch_array($countries)) {
+        $countries_array[] = array('countries_id' => $countries_values['countries_id'],
+                                   'countries_name' => $countries_values['countries_name']);
+      }
+    }
+
+    return $countries_array;
+  }
+  ////
+function sbs_get_country_list($name, $selected = '', $parameters = '') {
+   $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
+   $countries = sbs_get_countries();
+   $size = sizeof($countries);
+   for ($i=0; $i<$size; $i++) {
+     $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
+   }
+
+   return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
+}
+
+
+////
+// Alias function to tep_get_countries, which also returns the countries iso codes
+ /* function tep_get_countries_with_iso_codes($countries_id) {
+    return tep_get_countries($countries_id, true);
+  }*/
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/categories_description.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/categories_description.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/categories_description.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+  //---------------------------------------------------------------------------//
+  //
+  //  Code: categories_description
+  //  Author: Brian Lowe <blowe at wpcusrgrp.org>
+  //  Date: June 2002
+  //
+  //  Contains code snippets for the categories_description contribution to
+  //  osCommerce.
+  //---------------------------------------------------------------------------//
+  //  Code: categories_description MS2 1.5
+  //  Editor: Lord Illicious <shaolin-venoms at illicious.net>
+  //  Date: July 2003
+  //
+  //---------------------------------------------------------------------------//
+
+  //---------------------------------------------------------------------------//
+  //  Get a category heading_title or description
+  // These should probably be in admin/includes/functions/general.php, but since
+  // this is a contribution and not part of the base code, they are here instead
+  //---------------------------------------------------------------------------//
+  function tep_get_category_heading_title($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_heading_title from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $category_id . "' and language_id = '" . $language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+    return $category['categories_heading_title'];
+  }
+
+  function tep_get_category_description($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $category_id . "' and language_id = '" . $language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+    return $category['categories_description'];
+  }
+ function tep_get_category_head_title_tag($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_head_title_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $category_id . "' and language_id = '" . $language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+    return $category['categories_head_title_tag'];
+  }
+   function tep_get_category_head_desc_tag($category_id, $language_id) {
+      $category_query = tep_db_query("select categories_head_desc_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $category_id . "' and language_id = '" . $language_id . "'");
+      $category = tep_db_fetch_array($category_query);
+      return $category['categories_head_desc_tag'];
+  }
+   function tep_get_category_head_keywords_tag($category_id, $language_id) {
+      $category_query = tep_db_query("select categories_head_keywords_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $category_id . "' and language_id = '" . $language_id . "'");
+      $category = tep_db_fetch_array($category_query);
+      return $category['categories_head_keywords_tag'];
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/compatibility.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/compatibility.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/compatibility.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,156 @@
+<?php
+/*
+  $Id: compatibility.php,v 1.1.1.1 2004/03/04 23:39:50 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// Recursively handle magic_quotes_gpc turned off.
+// This is due to the possibility of have an array in
+// $HTTP_xxx_VARS
+// Ie, products attributes
+  function do_magic_quotes_gpc(&$ar) {
+    if (!is_array($ar)) return false;
+
+    while (list($key, $value) = each($ar)) {
+      if (is_array($value)) {
+        do_magic_quotes_gpc($value);
+      } else {
+        $ar[$key] = addslashes($value);
+      }
+    }
+  }
+
+// $HTTP_xxx_VARS are always set on php4
+  if (!is_array($HTTP_GET_VARS)) $HTTP_GET_VARS = array();
+  if (!is_array($HTTP_POST_VARS)) $HTTP_POST_VARS = array();
+  if (!is_array($HTTP_COOKIE_VARS)) $HTTP_COOKIE_VARS = array();
+
+// handle magic_quotes_gpc turned off.
+  if (!get_magic_quotes_gpc()) {
+    do_magic_quotes_gpc($HTTP_GET_VARS);
+    do_magic_quotes_gpc($HTTP_POST_VARS);
+    do_magic_quotes_gpc($HTTP_COOKIE_VARS);
+  }
+
+  if (!function_exists('is_numeric')) {
+    function is_numeric($param) {
+      return ereg("^[0-9]{1,50}.?[0-9]{0,50}$", $param);
+    }
+  }
+
+  if (!function_exists('is_uploaded_file')) {
+    function is_uploaded_file($filename) {
+      if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
+        $tmp_file = dirname(tempnam('', ''));
+      }
+
+      if (strchr($tmp_file, '/')) {
+        if (substr($tmp_file, -1) != '/') $tmp_file .= '/';
+      } elseif (strchr($tmp_file, '\\')) {
+        if (substr($tmp_file, -1) != '\\') $tmp_file .= '\\';
+      }
+
+      return file_exists($tmp_file . basename($filename));
+    }
+  }
+
+  if (!function_exists('move_uploaded_file')) {
+    function move_uploaded_file($file, $target) {
+      return copy($file, $target);
+    }
+  }
+
+  if (!function_exists('checkdnsrr')) {
+    function checkdnsrr($host, $type) {
+      if(tep_not_null($host) && tep_not_null($type)) {
+        @exec("nslookup -type=$type $host", $output);
+        while(list($k, $line) = each($output)) {
+          if(eregi("^$host", $line)) {
+            return true;
+          }
+        }
+      }
+      return false;
+    }
+  }
+
+  if (!function_exists('in_array')) {
+    function in_array($lookup_value, $lookup_array) {
+      reset($lookup_array);
+      while (list($key, $value) = each($lookup_array)) {
+        if ($value == $lookup_value) return true;
+      }
+
+      return false;
+    }
+  }
+
+  if (!function_exists('array_merge')) {
+    function array_merge($array1, $array2, $array3 = '') {
+      if ($array3 == '') $array3 = array();
+
+      while (list($key, $val) = each($array1)) $array_merged[$key] = $val;
+      while (list($key, $val) = each($array2)) $array_merged[$key] = $val;
+
+      if (sizeof($array3) > 0) while (list($key, $val) = each($array3)) $array_merged[$key] = $val;
+
+      return (array)$array_merged;
+    }
+  }
+
+  if (!function_exists('array_shift')) {
+    function array_shift(&$array) {
+      $i = 0;
+      $shifted_array = array();
+      reset($array);
+      while (list($key, $value) = each($array)) {
+        if ($i > 0) {
+          $shifted_array[$key] = $value;
+        } else {
+          $return = $array[$key];
+        }
+        $i++;
+      }
+      $array = $shifted_array;
+
+      return $return;
+    }
+  }
+
+  if (!function_exists('array_reverse')) {
+    function array_reverse($array) {
+      $reversed_array = array();
+
+      for ($i=sizeof($array)-1; $i>=0; $i--) {
+        $reversed_array[] = $array[$i];
+      }
+
+      return $reversed_array;
+    }
+  }
+
+  if (!function_exists('array_slice')) {
+    function array_slice($array, $offset, $length = '0') {
+      $length = abs($length);
+
+      if ($length == 0) {
+        $high = sizeof($array);
+      } else {
+        $high = $offset+$length;
+      }
+
+      for ($i=$offset; $i<$high; $i++) {
+        $new_array[$i-$offset] = $array[$i];
+      }
+
+      return $new_array;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/crypt.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/crypt.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/crypt.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,206 @@
+<?php
+/*
+  $Id: crypt.php,v 1.1.1.1 2004/03/04 23:40:48 ccwjr Exp $
+
+    Copyright (c) 2005 
+
+  Released under the GNU General Public License
+*/
+// This function makes a new key from a plaintext phrase.
+ function get_encrypt_config(){
+  //this is entended to be used to get configuration data
+  }
+
+  function tep_encrypt_key($plain) {
+    $key = '';
+    for ($i=0; $i<24; $i++) {
+      $key .= tep_rand();
+    }
+    $salt = substr(md5($key), 0, 2);
+    $key = md5($salt . $plain) . ':' . $salt;
+    return $key;
+  }
+
+  function cc_encrypt($text) {
+    /*  Removed because the configuration keys are already loaded
+    $encrypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+    $encrypt = tep_db_fetch_array($encrypt_query);
+    $encrypt_path = $encrypt['configuration_value'];
+    $crypt_query1 = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_FILE'");
+    $encrypt1 = tep_db_fetch_array($crypt_query1);
+    $encrypt_file = $encrypt1['configuration_value'];
+    */
+    if ( defined('PAYMENT_CC_CRYPT_PATH') ) $encrypt_path = PAYMENT_CC_CRYPT_PATH;
+    if ( defined('PAYMENT_CC_CRYPT_FILE') ) $encrypt_file = PAYMENT_CC_CRYPT_FILE;
+
+  //get key 
+    include (DIR_FS_CATALOG . DIR_WS_INCLUDES . $encrypt_path . $encrypt_file);
+
+   $key = CC_KEY;
+   $key = md5($key);
+   $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
+   $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+   $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
+   
+  
+  return base64_encode($crypttext);
+   }
+   
+function cc_decrypt($enc) {
+  /*  Removed because the configuration keys are already loaded
+  $encrypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+  $encrypt = tep_db_fetch_array($encrypt_query);
+  $encrypt_path = $encrypt['configuration_value'];
+  $crypt_query1 = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_FILE'");
+  $encrypt1 = tep_db_fetch_array($crypt_query1);
+  $encrypt_file = $encrypt1['configuration_value'];
+  */
+  if ( defined('PAYMENT_CC_CRYPT_PATH') ) $encrypt_path = PAYMENT_CC_CRYPT_PATH;
+  if ( defined('PAYMENT_CC_CRYPT_FILE') ) $encrypt_file = PAYMENT_CC_CRYPT_FILE;
+
+  //get key 
+include (DIR_FS_CATALOG . DIR_WS_INCLUDES . $encrypt_path . $encrypt_file);
+$key = CC_KEY;
+$enc =base64_decode($enc);
+$key = md5($key);
+$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
+$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+$decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $enc, MCRYPT_MODE_ECB, $iv);
+$decrypttext1 = trim($decrypttext);
+return ($decrypttext1) ;
+}
+
+  function cc_encrypt_conv($text1) {
+  //get key path and key filename
+  $encrypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+  $encrypt = tep_db_fetch_array($encrypt_query);
+  $encrypt_path = $encrypt['configuration_value'];
+  $crypt_query1 = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_FILE'");
+  $encrypt1 = tep_db_fetch_array($crypt_query1);
+  $encrypt_file1 = $encrypt1['configuration_value'];
+  $encrypt_file1a = 'new_' . $encrypt_file1;
+   
+     include (DIR_FS_CATALOG . DIR_WS_INCLUDES . $encrypt_path . 'new_' . $encrypt_file1);
+   $key1 = CC_KEY1;
+   $key1 = md5($key1);
+   $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
+   $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+   $crypttext1 = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key1, $text1, MCRYPT_MODE_ECB, $iv);
+   
+ 
+ return base64_encode($crypttext1);
+   }
+   
+/* run a self-test through every listed cipher and mode */
+function mcrypt_check_sanity() {
+$modes = mcrypt_list_modes();
+$algorithms = mcrypt_list_algorithms();
+echo "<!-- start list -->";
+echo "<table border=0>";
+//echo "<tr><td align=center><strong>Mcrypt Algorithms and Modes</strong>";
+echo "<tr><td align=center><strong>".MCRYPT_ALGORITHMS_AND_MODES."</strong>";
+//echo "<tr><td align=center><strong>Algorithm</strong></td align=center><td><strong>Status</strong></td>";
+echo "<tr><td align=center><strong>".MCRYPT_ALGORITHM."</strong></td align=center><td><strong>".MCRYPT_Status."</strong></td>";
+foreach ($modes as $mode) echo "<td align=center><strong>".strtoupper($mode)."</strong></td>";
+echo "</tr>";
+ foreach ($algorithms as $cipher) {
+   echo "<tr><td bgcolor=f0f0ff align=left>".strtoupper($cipher)."</td>";
+   if(mcrypt_module_self_test($cipher)) {
+     //  print "<td bgcolor=green align=center>OK</td>";
+       print "<td bgcolor=green align=center>".MCRYPT_OK."</td>";
+   } else {
+       //print "<td bgcolor=red align=center>NOT OK</td>";
+       print "<td bgcolor=red align=center>".MCRYPT_NOT_OK."</td>";
+   }
+ 
+   
+   foreach ($modes as $mode) {
+       if($mode == 'stream') {
+          // $result = "<td bgcolor=gray align=center>NOT TESTED</td>";
+           $result = "<td bgcolor=gray align=center>".MCRYPT_NOT_TESTED."</td>";
+       } else if(mcrypt_test_module_mode($cipher,$mode)) {
+             //$result = "<td bgcolor=green align=center><strong>OK</strong></td>";
+             $result = "<td bgcolor=green align=center><strong>".MCRYPT_OK."</strong></td>";
+       } else {
+            // $result = "<td bgcolor=red align=center>NOT OK</td>";
+             $result = "<td bgcolor=red align=center>".MCRYPT_NOT_OK."</td>";
+       }
+       print $result;
+   }
+   echo "</tr>";
+ }
+echo "</table>";
+
+  $td = mcrypt_module_open($cipher, '', $mode, '');
+  //$size = mcrypt_module_get_supported_key_sizes($cipher, $modes);
+  $algorithms = mcrypt_list_algorithms();
+
+//echo "<tr><td align=center><strong>Maximum Key Sizes Allowed</strong></td align=center></tr>";
+echo "<tr><td align=center><strong>".MCRYPT_MAXIMUM_KEY_SIZES_ALLOWED."</strong></td align=center></tr>";
+
+echo "<td align=center><table border=1>\n";
+
+//echo "<tr><td align=center><strong>Algorithm</strong></td align=center>";
+echo "<tr><td align=center><strong>".MCRYPT_ALGORITHM."</strong></td align=center>";
+//echo "<td align=center><strong>Maximum Key Size</strong></td> </tr>";
+echo "<td align=center><strong>".MCRYPT_MAXIMUM_KEY_SIZE."</strong></td> </tr>";
+
+foreach ($algorithms as $cipher) {
+
+       echo "<tr><td>" . $cipher . "</td><td bgcolor=green align=center>";
+       $ksizes = mcrypt_module_get_supported_key_sizes($cipher);
+       if($ksizes==NULL) echo mcrypt_module_get_algo_key_size($cipher);
+       else foreach ($ksizes as $size) {
+               echo $size . " ";
+       }
+       echo "</td></tr>\n";
+}
+echo "</td></table>\n";
+
+ }
+
+// a variant on the example posted in mdecrypt_generic
+function mcrypt_test_module_mode($module,$mode) {
+ /* Data */
+// $key = 'this is a very long key, even too long for the cipher';
+ $key = MCRYPT_KEY_TEXT;
+ //$plain_text = 'very important data';
+ $plain_text = MCRYPT_PLAIN_TEXT;
+
+ /* Open module, and create IV */
+ $td = mcrypt_module_open($module, '',$mode, '');
+ $key = substr($key, 0, mcrypt_enc_get_key_size($td));
+ $iv_size = mcrypt_enc_get_iv_size($td);
+ $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+
+ /* Initialize encryption handle */
+if (mcrypt_generic_init($td, $key, $iv) != -1) {
+
+ /* Encrypt data */
+ $c_t = mcrypt_generic($td, $plain_text);
+ mcrypt_generic_deinit($td);
+ 
+ // close the module
+ mcrypt_module_close($td);
+
+ /* Reinitialize buffers for decryption */
+ /* Open module */
+ $td = mcrypt_module_open($module, '', $mode, '');
+ $key = substr($key, 0, mcrypt_enc_get_key_size($td));
+
+ mcrypt_generic_init($td, $key, $iv);
+ $p_t = trim(mdecrypt_generic($td, $c_t)); //trim to remove padding
+
+ /* Clean up */
+mcrypt_generic_deinit($td);
+ mcrypt_module_close($td);
+ }
+ 
+ if (strncmp($p_t, $plain_text, strlen($plain_text)) == 0) {
+   return TRUE;
+ } else {
+   return FALSE;
+ }
+ }
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/data.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/data.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/data.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: data.php,v 1.1.   
+
+  
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+// Draw a pulldown for currency type
+function draw_currency_pulldown($name, $default = '') {
+  $values = array();
+  $values[] = array('id' => USD, 'text' => 'US Dollar');
+  $values[] = array('id' => EUR, 'text' => 'Euro');
+  $values[] = array('id' => GPB, 'text' => 'British Pound');
+  $values[] = array('id' => JOD, 'text' => 'Japan Yen');
+  $values[] = array('id' => CAD, 'text' => 'Canadian Dollar');
+  $values[] = array('id' => AUD, 'text' => 'Australia, Dollars');
+  return tep_draw_pull_down_menu($name, $values, $default);
+}
+
+// Translate currency to english string
+function translate_curr_type_to_name($curr_type) {
+  if ($curr_type == USD) return 'US Dollar';
+  if ($curr_type == EUR) return 'Euro';
+  if ($curr_type == GPB) return 'British Pound';
+  if ($curr_type == JOD) return 'Japan Yen';
+  if ($curr_type == CAD) return 'Canadian Dollar';
+  if ($curr_type == AUD) return 'Australia, Dollars';
+  
+  return 'Error ' . $curr_type;
+}
+
+// Draw a pulldown for language type
+function draw_language_pulldown($name, $default = '') {
+  $values = array();
+  $values[] = array('id' => en, 'text' => 'English');
+  $values[] = array('id' => de, 'text' => 'German');
+  $values[] = array('id' => es, 'text' => 'Spanish');
+  $values[] = array('id' => fr, 'text' => 'French');
+  $values[] = array('id' => it, 'text' => 'Italian');
+  $values[] = array('id' => ja, 'text' => 'Japanese');
+  return tep_draw_pull_down_menu($name, $values, $default);
+}
+
+// Translate language to english string
+function translate_lang_type_to_name($lang_type) {
+  if ($lang_type == en) return 'English';
+  if ($lang_type == gr) return 'German';
+  if ($lang_type == es) return 'Spanish';
+  if ($lang_type == fr) return 'French';
+  if ($lang_type == it) return 'Italian';
+  if ($lang_type == ja) return 'Japanese';
+  return 'Error ' . $lang_type;
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/functions/database.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/database.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/database.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<?php
+/*
+  $Id: database.php,v 1.1.1.1 2004/03/04 23:39:50 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
+    global $$link;
+
+    if (USE_PCONNECT == 'true') {
+      $$link = mysql_pconnect($server, $username, $password);
+    } else {
+      $$link = mysql_connect($server, $username, $password);
+    }
+
+    if ($$link) mysql_select_db($database);
+
+    return $$link;
+  }
+
+  function tep_db_close($link = 'db_link') {
+    global $$link;
+
+    return mysql_close($$link);
+  }
+
+  function tep_db_error($query, $errno, $error) {
+   // die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');
+    die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">'.DATABASE_TEP_DB_ERROR.'</font></small><br><br></b></font>');
+  }
+
+ function tep_db_query($query, $link = 'db_link') {
+    global $$link, $logger;
+
+    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
+      if (!is_object($logger)) $logger = new logger;
+      $logger->write($query, 'QUERY');
+    }
+
+    $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());
+
+    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
+      if (mysql_error()) $logger->write(mysql_error(), 'ERROR');
+    }
+
+    return $result;
+  }
+
+
+  function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') {
+    reset($data);
+    if ($action == 'insert') {
+      $query = 'insert into ' . $table . ' (';
+      while (list($columns, ) = each($data)) {
+        $query .= $columns . ', ';
+      }
+      $query = substr($query, 0, -2) . ') values (';
+      reset($data);
+      while (list(, $value) = each($data)) {
+        switch ((string)$value) {
+          case 'now()':
+            $query .= 'now(), ';
+            break;
+          case 'null':
+            $query .= 'null, ';
+            break;
+          default:
+            $query .= '\'' . tep_db_input($value) . '\', ';
+            break;
+        }
+      }
+      $query = substr($query, 0, -2) . ')';
+    } elseif ($action == 'update') {
+      $query = 'update ' . $table . ' set ';
+      while (list($columns, $value) = each($data)) {
+        switch ((string)$value) {
+          case 'now()':
+            $query .= $columns . ' = now(), ';
+            break;
+          case 'null':
+            $query .= $columns .= ' = null, ';
+            break;
+          default:
+            $query .= $columns . ' = \'' . tep_db_input($value) . '\', ';
+            break;
+        }
+      }
+      $query = substr($query, 0, -2) . ' where ' . $parameters;
+    }
+
+    return tep_db_query($query, $link);
+  }
+
+  function tep_db_fetch_array($db_query) {
+    return mysql_fetch_array($db_query, MYSQL_ASSOC);
+  }
+
+  function tep_db_result($result, $row, $field = '') {
+    return mysql_result($result, $row, $field);
+  }
+
+  function tep_db_num_rows($db_query) {
+    return mysql_num_rows($db_query);
+  }
+
+  function tep_db_data_seek($db_query, $row_number) {
+    return mysql_data_seek($db_query, $row_number);
+  }
+
+  function tep_db_insert_id() {
+    return mysql_insert_id();
+  }
+
+  function tep_db_free_result($db_query) {
+    return mysql_free_result($db_query);
+  }
+
+  function tep_db_fetch_fields($db_query) {
+    return mysql_fetch_field($db_query);
+  }
+
+  function tep_db_output($string) {
+    return htmlspecialchars($string);
+  }
+
+  function tep_db_input($string, $link = 'db_link') {
+    global $$link;
+
+    return addslashes($string);
+  }
+
+  function tep_db_prepare_input($string) {
+    if (is_string($string)) {
+      return trim(stripslashes($string));
+    } elseif (is_array($string)) {
+      reset($string);
+      while (list($key, $value) = each($string)) {
+        $string[$key] = tep_db_prepare_input($value);
+      }
+      return $string;
+    } else {
+      return $string;
+    }
+  }
+
+  function tep_db_fetch_object($db_query) {
+    return mysql_fetch_object($db_query);
+  }
+
+  function tep_db_encoder($string) {
+    $string = str_replace("'", '&#39', $string);
+    return $string;
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/functions/downloads_controller.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/downloads_controller.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/downloads_controller.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+
+  WebMakers.com Added: Downloads Controller Functions
+  NOTE: Some function may already exist in other Add-Ons I have created.
+
+*/
+?>
+<?php
+
+////
+// BOF: WebMakers.com Added: configuration key value lookup
+  function tep_get_configuration_key_value($lookup) {
+    $configuration_query_raw= tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key='" . $lookup . "'");
+    $configuration_query= tep_db_fetch_array($configuration_query_raw);
+    $lookup_value= $configuration_query['configuration_value'];
+    return $lookup_value;
+  }
+// EOF: WebMakers.com Added: configuration key value lookup
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/easypopulate_functions.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/easypopulate_functions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/easypopulate_functions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,102 @@
+<?php
+/*
+  $Id: easypopulate_functions.php,v 3.01 2005/09/06  $
+
+  Released under the GNU General Public License
+*/
+
+function ep_get_languages() {
+  $languages_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " order by sort_order");
+  // start array at one, the rest of the code expects it that way
+  $ll =1;
+  while ($ep_languages = tep_db_fetch_array($languages_query)) {
+    //will be used to return language_id en language code to report in product_name_code instead of product_name_id
+    $ep_languages_array[$ll++] = array(
+          'id' => $ep_languages['languages_id'],
+          'code' => $ep_languages['code']
+          );
+  }
+  return $ep_languages_array;
+};
+
+function tep_get_tax_class_rate($tax_class_id) {
+  $tax_multiplier = 0;
+  $tax_query = tep_db_query("select SUM(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " WHERE  tax_class_id = '" . $tax_class_id . "' GROUP BY tax_priority");
+  if (tep_db_num_rows($tax_query)) {
+    while ($tax = tep_db_fetch_array($tax_query)) {
+      $tax_multiplier += $tax['tax_rate'];
+    }
+  }
+  return $tax_multiplier;
+};
+
+function tep_get_tax_title_class_id($tax_class_title) {
+  $classes_query = tep_db_query("select tax_class_id from " . TABLE_TAX_CLASS . " WHERE tax_class_title = '" . $tax_class_title . "'" );
+  $tax_class_array = tep_db_fetch_array($classes_query);
+  $tax_class_id = $tax_class_array['tax_class_id'];
+  return $tax_class_id ;
+}
+
+function print_el( $item5 ) {
+global $msg_output;
+  $msg_output .= " | " . substr(strip_tags($item5), 0, 10);
+  //echo " | " . substr(strip_tags($item5), 0, 10);
+};
+
+function print_el1( $item6 ) {
+global $msg_output;
+  $msg_output .= sprintf("| %'.4s ", substr(strip_tags($item6), 0, 80));
+};
+
+function tep_get_category_treea($parent_id , $spacing = '', $exclude = '', $category_id_array = '', $include_itself = true) {
+    global $languages_id;
+
+    if (!is_array($category_id_array)) $category_tree_array = array();
+    if ( (sizeof($category_id_array) < 1) && ($exclude != '0') ) $category_id_array[] = array('id' => '0', 'text' => TEXT_TOP);
+
+    if ($include_itself) {
+      $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'");
+      $category = tep_db_fetch_array($category_query);
+      $category_tree_arraya[] = array('id' => $parent_id, 'text' => $category['categories_name']);
+    }
+
+    $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name");
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      if ($exclude != $categories['categories_id']) $category_id_array[] = array('id' => $categories['categories_id']);
+      $category_tree_array = tep_get_category_treea($categories['categories_id'],  $exclude, $category_id_array);
+    }
+
+    return $category_id_array;
+  }
+
+function tep_get_uploaded_file($filename) {
+  if (isset($_FILES[$filename])) {
+    $uploaded_file = array('name' => $_FILES[$filename]['name'],
+    'type' => $_FILES[$filename]['type'],
+    'size' => $_FILES[$filename]['size'],
+    'tmp_name' => $_FILES[$filename]['tmp_name']);
+  } elseif (isset($GLOBALS['HTTP_POST_FILES'][$filename])) {
+    global $HTTP_POST_FILES;
+
+    $uploaded_file = array('name' => $HTTP_POST_FILES[$filename]['name'],
+    'type' => $HTTP_POST_FILES[$filename]['type'],
+    'size' => $HTTP_POST_FILES[$filename]['size'],
+    'tmp_name' => $HTTP_POST_FILES[$filename]['tmp_name']);
+  } else {
+    $uploaded_file = array('name' => $GLOBALS[$filename . '_name'],
+    'type' => $GLOBALS[$filename . '_type'],
+    'size' => $GLOBALS[$filename . '_size'],
+    'tmp_name' => $GLOBALS[$filename]);
+  }
+
+return $uploaded_file;
+}
+
+// the $filename parameter is an array with the following elements:
+// name, type, size, tmp_name
+function tep_copy_uploaded_file($filename, $target) {
+    if (substr($target, -1) != '/') $target .= '';
+  $target .= $filename['name'];
+  move_uploaded_file($filename['tmp_name'], $target);
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/functions/edit_key.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/edit_key.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/edit_key.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,976 @@
+<?php
+/* /function2/edit_languages.php
+// A module of OSCommerce
+//
+// Version 1.00
+// 
+// Author: Julian Brown
+// Copyright (c) 2003 JLB Professional Services Inc.
+// Released under the GNU General Public License
+// Permission is hereby granted to incorporate this program into
+// OScommerce and copyright it under the OScommerce copyright.
+// Please notify me that you have.
+//
+// Julian Brown
+// julian at jlbprof.com
+//
+
+This file moves the function from the edit_XXX.php to one central location
+for use by a series of edit files. 
+*/
+function phppage2readeable($t){
+
+ return str_replace(" ", "&nbsp;",preg_replace("/\.php$/", "", str_replace("_", "&nbsp;", $t)));
+}
+// ---- end 
+
+
+function getFromQuery ($var)
+{
+    $query = $_SERVER['QUERY_STRING'];
+
+    $string = $var . "=";
+
+    $idx = strpos ($query, $string);
+    if ($idx === false)
+    {
+        return ("");
+    }
+
+    $string = substr ($query, $idx);
+    $idx = strpos ($string, "=");
+    $string = substr ($string, $idx + 1);
+    $idx = strpos ($string, "&");
+    if ($idx === false)
+    {
+    }
+    else
+    {
+        $string = substr ($string, 0, $idx);
+    }
+
+    $string = urldecode ($string);
+
+    return ($string);
+}
+
+// all this crap about seperating GET from POST variables is stupid
+// this function will return first from put if available otherwise
+// from get
+
+function getVAR ($var)
+{
+    global $HTTP_GET_VARS;
+    global $HTTP_POST_VARS;
+
+    if (strlen ($HTTP_POST_VARS[$var]) > 0)
+    {
+        return ($HTTP_POST_VARS[$var]);
+    }
+
+    return ($HTTP_GET_VARS[$var]);
+}
+
+// ok now strip off any carriage returns and line feeds
+
+function strip_crlf ($data)
+{
+    $len = strlen ($data);
+    for ($i = 0; $i < $len; ++$i)
+    {
+        $cc = substr ($data, $i, 1);
+        $cc1 = substr ($data, $i + 1, 1);
+
+        if ((ord ($cc) == 10) ||  // a new line char
+            (ord ($cc) == 13)     // a carriage return
+           )
+        {
+            $data = substr ($data, 0, $i);
+            break;
+        }
+    }
+
+    return ($data);
+}
+
+function getFiles ()
+{
+    global $languages_array;
+    global $PHP_SELF;
+
+    $dir1 = dir($fs_dir);
+    if ($dir1)
+    {
+        $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+        while ($file = $dir1->read())
+        {
+            if (substr($file, strrpos($file, '.')) == $file_extension)
+            {
+                $data [$idx++] = $file;
+            }
+        }
+        $dir1->close();
+    }
+
+    return ($data);
+}
+
+// this looks for all the files that we may want to edit
+
+function listFiles ($dir1)
+{
+    global $dir1, $filetype1, $PHP_SELF;
+
+    if ($dir1)
+    {   
+        $file_extension = '.php';
+        $d = dir($dir1);
+        while ($file = $d->read()){ 
+         $file_array[$file]=$file;
+    
+//  asort($file_array, SORT_REGULAR );  
+  foreach ( $file_array as $file){
+          while (false !== ($entry = $d->read())) {
+          // echo $entry."<br> \n";
+          // echo substr($entry, strrpos($entry, '.'));
+       if (substr($entry, strrpos($entry, '.')) == $file_extension){
+    // get filename and path from configuration
+     /*  Removed because the configuration keys are already loaded
+     $crypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+     $crypt = tep_db_fetch_array($crypt_query);
+     $CURR_CRYPT = $crypt['configuration_value'];
+     $crypt_query1 = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_FILE'");
+     $crypt1 = tep_db_fetch_array($crypt_query1);
+     $crypt_file = $crypt1['configuration_value'];
+     */
+    if ( defined('PAYMENT_CC_CRYPT_PATH') ) $CURR_CRYPT = PAYMENT_CC_CRYPT_PATH;
+    if ( defined('PAYMENT_CC_CRYPT_FILE') ) $crypt_file  = PAYMENT_CC_CRYPT_FILE;
+    
+    $crypt_file_new= 'new_' . $crypt_file;
+    $fs_dir = DIR_FS_CATALOG.DIR_WS_INCLUDES.$CURR_CRYPT;
+    $ws_dir = DIR_WS_CATALOG.DIR_WS_INCLUDES.$CURR_CRYPT;
+    $dir1 = $fs_dir ;
+
+    
+      if ($entry == $crypt_file){
+        $filetype1 = sprintf(TEXT_CRYPT_MESSAGE_1);
+        } else if ($entry == $crypt_file_new){
+  $filetype1 = sprintf(TEXT_CRYPT_MESSAGE_2);
+        } else{
+        $filetype1 = sprintf(TEXT_CRYPT_MESSAGE_3);
+        }
+       echo '<tr><td class="smallText">' . $filetype1 . '</td><td class="smallText">' . ($entry) . '</td><td class="smallText"><a href="' . tep_href_link(FILENAME_EDIT_KEY, '&action=edit&filename=' . $entry) . '" title="' . $entry . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a></td></tr>' . "\n";
+                  }
+              }
+           }  
+        }
+        $d->close();
+    }
+?>
+
+<?php
+}
+
+// These functions perform character reads for the file parser
+//
+// The parser will depend on reading one character at a time, so the
+// 2 routines getChar and readLine work together, getChar calls readLine
+// noone else does.
+//
+// read the next line in, to feed the getChar routine
+
+function readLine ()
+{
+    global $file_data;
+
+    // if we have reached the end of file, mark it as so
+
+    if (feof ($file_data ['handle']))
+    {
+        // We have reached the end of the file
+
+        $file_data ['eof'] = 1;
+        return;
+    }
+
+    // actually read in a line
+
+    $data = fgets ($file_data ['handle']);
+
+    // ok now strip off any carriage returns and line feeds and
+    // double comment slashes
+
+    $len = strlen ($data);
+    for ($i = 0; $i < $len; ++$i)
+    {
+        $cc = substr ($data, $i, 1);
+        $cc1 = substr ($data, $i + 1, 1);
+    $cc0 = substr ($data, $i - 1, 1);
+
+        if ((ord ($cc) == 10) ||  // a new line char
+            (ord ($cc) == 13) ||  // a carriage return
+            (
+                ($cc  == '/' &&
+                 $cc1 == '/' && 
+         $cc0!=":" // not a link
+         )
+            )
+           )
+        {
+            $data = substr ($data, 0, $i);
+            break;
+        }
+    }
+
+    // ok we have a clean line
+
+    $file_data ['data'] = $data;
+    $file_data ['len']  = strlen ($data);
+    $file_data ['idx']  = 0;
+    $file_data ['line'] ++;
+
+    if ($file_data['len'] == 0)
+    {
+        // recursively skip blank lines
+        return (readLine ());
+    }
+
+    return;
+}
+
+function getChar ()
+{
+    global $file_data;
+
+    // if we have exhausted our characters then read a new line in
+
+    if ($file_data ['idx'] >= $file_data ['len'])
+    {
+        readLine ();
+        if ($file_data ['eof'] == 1)
+            return;
+        
+        // mark that we have transitioned over an end of line
+        $file_data ['eol'] = 1;
+    }
+    else
+        $file_data ['eol'] = 0;
+
+    // ok save the last character, to check for escaped chars and such
+
+    $file_data ['last'] = $file_data ['current'];
+
+    // EOL cancels a back slash escape
+    if ($file_data ['eol'] == 1)
+        $file_data ['last'] = 0;
+
+    $file_data ['current'] = substr ($file_data ['data'],
+        $file_data ['idx'], 1);
+    $file_data ['idx'] ++;
+}
+
+// process_data, cleans up certain cases.  Typically the define
+// is pretty straightforward: define ('ABC', 'DEF');
+//
+// in that case we just need to strip off the surrounding
+// quotes, but here are some pathological cases
+//
+// define ('ABC', 'DEF' . 'GHI');
+// define ('ABC', TEP_STUFF . 'DEF');
+//
+// This routine checks to see if we should remove the
+// quotes or not, in the first case yes, in the other cases
+// no.
+//
+// look for the special cases where the entire string is quoted
+// also trim whitespace off of end
+
+function process_data ($data)
+{
+    $data = trim ($data);
+
+    $cc = substr ($data, 0, 1);
+    $end = strlen ($data) - 1;
+    $cc1 = substr ($data, $end, 1);
+
+    // check to see if the first and last characters are quotes
+
+    if (!strcmp ($cc, $cc1) &&
+        (!strcmp ($cc, '"') ||
+         !strcmp ($cc, "'")))
+    {
+        // ok check to see if we get dequoted somewhere in between
+
+        $len = strlen ($data) - 1; // we dont want to check last char
+        for ($i = 1; $i < $len; ++$i)
+        {
+            $cc1 = substr ($data, $i, 1);
+            $cc2 = substr ($data, $i - 1, 1);
+            if (!strcmp ($cc, $cc1) &&
+                strcmp ($cc2, '\\'))
+            {
+                // ok we were dequoted
+                // just return the data as is
+                //
+                // we do not remove the quotes in this case
+
+                return ($data);
+            }
+        }
+
+        // ok we were not dequoted, therefore strip the quotes
+
+        $data = substr ($data, 1, $len - 1);
+    }
+
+    return ($data);
+}
+
+// We will create a state machine driven parser
+
+function parseFile ($this_filename)
+{
+  // returns $num_defines
+    global $file_data;
+    global $defines;
+
+    $fh = fopen ($this_filename, "rb");
+
+    $file_data ['handle'] = $fh;
+    $file_data ['filename'] = $this_filename;
+    $file_data ['line'] = 0;
+    $file_data ['eof'] = 0;
+    $file_data ['len'] = 0;
+    $file_data ['idx'] = 0;
+    $file_data ['last'] = 0;
+
+    // Create the state table
+
+    // read the define portion
+    $state [0] = array ( 'string' => "define('",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // save all data upto the apostrophe
+    $state [1] = array ( 'string' => "'",
+                         'eatall' => 1,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // read till the comma
+    $state [2] = array ( 'string' => ",",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // State's 3 and 4 are too complex to anaylze in the normal way
+    //
+    // In state 3 we will read until we find the first non-whitespace
+    //
+    // In state 4 we will read and eat until we find an unquoted, unescaped
+    // close paren.
+    //
+    // Then we will determine what to do about the quotes and such
+    //
+
+    // read till the first non-whitespace
+    $state [3] = array ( 'string' => "",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // eat until we find a close paren
+    $state [4] = array ( 'string' => "",
+                         'eatall' => 1,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // After state's 3 and 4 we need to find the closing semi colon
+
+    // read till the semicolon
+    $state [5] = array ( 'string' => ";",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    $the_state = 0;
+    $num_defines = 0;
+
+    // keep reading characters till we reach the end of file
+
+    while ($file_data ['eof'] == 0)
+    {
+        // get the next character
+
+        getChar ();
+
+        $cc = $file_data ['current'];
+        $cc1 = $file_data ['last'];
+
+        // we ignore white space, unless we are in the eatall states
+
+        if (!$eatall &&
+            ($cc == ' ' || $cc == '\t'))
+        {
+            continue;
+        }
+
+        $idx = $state [$the_state]['sidx'];
+        $schar = substr ($state [$the_state]['string'], $idx, 1);
+        $eatall = $state [$the_state]['eatall'];
+       
+        // a special case when state is 3 and 4
+        // in state 3 we read until we find a non-whitespace
+
+        if ($the_state == 3)
+        {
+            if (strcmp ($cc, " ") &&
+                strcmp ($cc, "\t"))
+            {
+                // ok when we get to a non-white space let's
+                // transition to state 4
+
+                $state [$the_state]['sidx'] = 0;
+                $the_state ++;
+
+                $in_quote = 0;
+                $quote_type = "'";
+                $dequoted = 0;
+
+                if (!strcmp ($cc, "'") ||
+                    !strcmp ($cc, '"'))
+                {
+                    $in_quote = 1;
+                    $quote_type = $cc;
+                }
+
+                // put this character into the new state data
+
+                $state[$the_state]['data'] = $cc;
+            }
+
+            continue;
+        }
+
+        // in state 4 we eat until we find an unquoted, unescaped
+        // paren
+
+        if ($the_state == 4)
+        {
+            if ($cc == ')' &&
+                $cc1 != '\\' &&
+                $in_quote == 0)
+            {
+                // we have completed state 4
+                // call process_data to determine if we should
+                // remove the starting and ending quotes if they
+                // exist
+
+                $state [$the_state]['data'] = process_data (
+                    $state [$the_state]['data']);
+
+                $state [$the_state]['sidx'] = 0;
+
+                $the_state++;
+
+                continue;
+            }
+
+            // ok we need to check our quote status
+
+            if ($in_quote == 1 &&
+                !strcmp ($cc, $quote_type) &&
+                strcmp ($cc1, "\\")) // make sure not escaped
+            {
+                // ok we have been dequoted
+
+                $dequote = 1;
+                $in_quote = 0;
+
+                // if we pass an eol, append a newline
+
+                if ($file_data ['eol'] == 1)
+                    $state [$the_state]['data'] .= "\n";
+
+                // save the quote
+
+                $state [$the_state]['data'] .= $cc;
+
+                continue;
+            }
+
+            // ok are we being quoted
+
+            if ($in_quote == 0 &&
+                (!strcmp ($cc, '"') ||
+                 !strcmp ($cc, "'") ||
+                 !strcmp ($cc, '('))) // consider nonquoted, nonescaped
+                                      // interior parens as quotes
+            {
+                // ok we are quoted again
+
+                $in_quote = 1;
+                $quote_type = $cc;
+
+                // if we are quoted by parens, change the quote type 
+                // to be the close paren, to make the if statement
+                // easier
+
+                if (!strcmp ($cc, '('))
+                    $quote_type = ')';
+            }
+
+            // if we pass an eol, append a newline
+
+            if ($file_data ['eol'] == 1)
+            {
+                $state [$the_state]['data'] .= "\n";
+            }
+
+            // eat the character
+            $state [$the_state]['data'] .= $cc;
+            continue;
+        }
+
+        // normal states are here
+
+        // eatall == 1, means we eat all characters till the one
+        // in we are looking for, otherwise we skip characters till
+        // we find the character
+
+        if ($eatall == 0)
+        {
+            // ok we failed to finish the state machine,
+            // we will restart the state machine
+
+            if (strcmp ($cc, $schar))
+            {
+                // reset the states
+                for ($i = 0; $i < 7; ++$i)
+                {
+                    $state [$i]['sidx'] = 0;
+                    $state [$i]['data'] = '';
+                }
+
+                $the_state = 0;
+
+                continue;
+            }
+        }
+        else
+        {
+            if (strcmp ($cc, $schar) ||
+                !strcmp ($cc1, '\\'))
+            {
+                // ok we eatall till we find our char
+
+                if ($file_data ['eol'] == 1)
+                    $state [$the_state]['data'] .= "\n";
+                $state [$the_state]['data'] .= $cc;
+
+                continue;
+            }
+        }
+
+        // ok advance the state
+
+        $len = strlen ($state [$the_state]['string']);
+        $sidx = $state [$the_state]['sidx'];
+        $sidx ++;
+        $state [$the_state]['sidx'] = $sidx;
+
+        // only use this code on a non eatall
+
+        if ($eatall == 0)
+        {
+            if ($file_data ['eol'] == 1)
+                $state [$the_state]['data'] .= "\n";
+            $state [$the_state]['data'] .= $cc;
+        }
+
+        // special case when we find the d in define
+
+        if ($the_state == 0 && $sidx == 1)
+        {
+            // we have found the first character
+            //
+            // I want to store the starting and ending line numbers
+            // so that when we rebuild the file, it will make the
+            // assembly much easier.
+            //
+
+            $start_line = $file_data ['line'];
+        }
+
+        // check to see if we can advance the state
+
+        if ($sidx >= $len)
+        {
+            // advance the state
+
+            $state [$the_state]['sidx'] = 0;
+            $the_state ++;
+
+            if ($the_state == 6)
+            {
+                // bingo we have found a complete define statement
+
+                $end_line = $file_data ['line'];
+
+                // ok assemble an array
+
+                $this_define =
+                    array (
+                        'name'       => $state [1]['data'],
+                        'data'       => $state [4]['data'],
+                        'start_line' => $start_line,
+                        'end_line'   => $end_line);
+
+                // now save this
+
+                $defines [$num_defines] = $this_define;
+                $num_defines++;
+
+                // reset the states
+                for ($i = 0; $i < 7; ++$i)
+                {
+                    $state [$i]['sidx'] = 0;
+                    $state [$i]['data'] = '';
+                }
+
+                $the_state = 0;
+            }
+        }
+    }
+
+    // ok we are done with the file
+
+    fclose ($file_data ['handle']);
+  return $num_defines;
+
+}
+
+function parseFileData ($this_filename)
+{
+  // returns $num_defines
+    global $file_data;
+    global $defines;
+
+    $fh = fopen ($this_filename, "rb");
+
+    $file_data ['handle'] = $fh;
+    $file_data ['filename'] = $this_filename;
+    $file_data ['line'] = 0;
+    $file_data ['eof'] = 0;
+    $file_data ['len'] = 0;
+    $file_data ['idx'] = 0;
+    $file_data ['last'] = 0;
+
+    // Create the state table
+
+    // read the define portion
+    $state [0] = array ( 'string' => "define('",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // save all data upto the apostrophe
+    $state [1] = array ( 'string' => "'",
+                         'eatall' => 1,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // read till the comma
+    $state [2] = array ( 'string' => ",",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // State's 3 and 4 are too complex to anaylze in the normal way
+    //
+    // In state 3 we will read until we find the first non-whitespace
+    //
+    // In state 4 we will read and eat until we find an unquoted, unescaped
+    // close paren.
+    //
+    // Then we will determine what to do about the quotes and such
+    //
+
+    // read till the first non-whitespace
+    $state [3] = array ( 'string' => "",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // eat until we find a close paren
+    $state [4] = array ( 'string' => "",
+                         'eatall' => 1,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // After state's 3 and 4 we need to find the closing semi colon
+
+    // read till the semicolon
+    $state [5] = array ( 'string' => ";",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    $the_state = 0;
+    $num_defines = 0;
+
+    // keep reading characters till we reach the end of file
+
+    while ($file_data ['eof'] == 0)
+    {
+        // get the next character
+
+        getChar ();
+
+        $cc = $file_data ['current'];
+        $cc1 = $file_data ['last'];
+
+        // we ignore white space, unless we are in the eatall states
+
+        if (!$eatall &&
+            ($cc == ' ' || $cc == '\t'))
+        {
+            continue;
+        }
+
+        $idx = $state [$the_state]['sidx'];
+        $schar = substr ($state [$the_state]['string'], $idx, 1);
+        $eatall = $state [$the_state]['eatall'];
+       
+        // a special case when state is 3 and 4
+        // in state 3 we read until we find a non-whitespace
+
+        if ($the_state == 3)
+        {
+            if (strcmp ($cc, " ") &&
+                strcmp ($cc, "\t"))
+            {
+                // ok when we get to a non-white space let's
+                // transition to state 4
+
+                $state [$the_state]['sidx'] = 0;
+                $the_state ++;
+
+                $in_quote = 0;
+                $quote_type = "'";
+                $dequoted = 0;
+
+                if (!strcmp ($cc, "'") ||
+                    !strcmp ($cc, '"'))
+                {
+                    $in_quote = 1;
+                    $quote_type = $cc;
+                }
+
+                // put this character into the new state data
+
+                $state[$the_state]['data'] = $cc;
+            }
+
+            continue;
+        }
+
+        // in state 4 we eat until we find an unquoted, unescaped
+        // paren
+
+        if ($the_state == 4)
+        {
+            if ($cc == ')' &&
+                $cc1 != '\\' &&
+                $in_quote == 0)
+            {
+                // we have completed state 4
+                // call process_data to determine if we should
+                // remove the starting and ending quotes if they
+                // exist
+
+                $state [$the_state]['data'] = process_data (
+                    $state [$the_state]['data']);
+
+                $state [$the_state]['sidx'] = 0;
+
+                $the_state++;
+
+                continue;
+            }
+
+            // ok we need to check our quote status
+
+            if ($in_quote == 1 &&
+                !strcmp ($cc, $quote_type) &&
+                strcmp ($cc1, "\\")) // make sure not escaped
+            {
+                // ok we have been dequoted
+
+                $dequote = 1;
+                $in_quote = 0;
+
+                // if we pass an eol, append a newline
+
+                if ($file_data ['eol'] == 1)
+                    $state [$the_state]['data'] .= "\n";
+
+                // save the quote
+
+                $state [$the_state]['data'] .= $cc;
+
+                continue;
+            }
+
+            // ok are we being quoted
+
+            if ($in_quote == 0 &&
+                (!strcmp ($cc, '"') ||
+                 !strcmp ($cc, "'") ||
+                 !strcmp ($cc, '('))) // consider nonquoted, nonescaped
+                                      // interior parens as quotes
+            {
+                // ok we are quoted again
+
+                $in_quote = 1;
+                $quote_type = $cc;
+
+                // if we are quoted by parens, change the quote type 
+                // to be the close paren, to make the if statement
+                // easier
+
+                if (!strcmp ($cc, '('))
+                    $quote_type = ')';
+            }
+
+            // if we pass an eol, append a newline
+
+            if ($file_data ['eol'] == 1)
+            {
+                $state [$the_state]['data'] .= "\n";
+            }
+
+            // eat the character
+            $state [$the_state]['data'] .= $cc;
+            continue;
+        }
+
+        // normal states are here
+
+        // eatall == 1, means we eat all characters till the one
+        // in we are looking for, otherwise we skip characters till
+        // we find the character
+
+        if ($eatall == 0)
+        {
+            // ok we failed to finish the state machine,
+            // we will restart the state machine
+
+            if (strcmp ($cc, $schar))
+            {
+                // reset the states
+                for ($i = 0; $i < 7; ++$i)
+                {
+                    $state [$i]['sidx'] = 0;
+                    $state [$i]['data'] = '';
+                }
+
+                $the_state = 0;
+
+                continue;
+            }
+        }
+        else
+        {
+            if (strcmp ($cc, $schar) ||
+                !strcmp ($cc1, '\\'))
+            {
+                // ok we eatall till we find our char
+
+                if ($file_data ['eol'] == 1)
+                    $state [$the_state]['data'] .= "\n";
+                $state [$the_state]['data'] .= $cc;
+
+                continue;
+            }
+        }
+
+        // ok advance the state
+
+        $len = strlen ($state [$the_state]['string']);
+        $sidx = $state [$the_state]['sidx'];
+        $sidx ++;
+        $state [$the_state]['sidx'] = $sidx;
+
+        // only use this code on a non eatall
+
+        if ($eatall == 0)
+        {
+            if ($file_data ['eol'] == 1)
+                $state [$the_state]['data'] .= "\n";
+            $state [$the_state]['data'] .= $cc;
+        }
+
+        // special case when we find the d in define
+
+        if ($the_state == 0 && $sidx == 1)
+        {
+            // we have found the first character
+            //
+            // I want to store the starting and ending line numbers
+            // so that when we rebuild the file, it will make the
+            // assembly much easier.
+            //
+
+            $start_line = $file_data ['line'];
+        }
+
+        // check to see if we can advance the state
+
+        if ($sidx >= $len)
+        {
+            // advance the state
+
+            $state [$the_state]['sidx'] = 0;
+            $the_state ++;
+
+            if ($the_state == 6)
+            {
+                // bingo we have found a complete define statement
+
+                $end_line = $file_data ['line'];
+
+                // ok assemble an array
+
+                $this_define =
+                    array (
+                        'name'       => $state [1]['data'],
+                        'data'       => $state [4]['data'],
+                        'start_line' => $start_line,
+                        'end_line'   => $end_line);
+
+                // now save this
+
+                $defines [$num_defines] = $this_define;
+                $num_defines++;
+
+                // reset the states
+                for ($i = 0; $i < 7; ++$i)
+                {
+                    $state [$i]['sidx'] = 0;
+                    $state [$i]['data'] = '';
+                }
+
+                $the_state = 0;
+            }
+        }
+    }
+
+    // ok we are done with the file
+
+    fclose ($file_data ['handle']);
+  //return $num_defines;
+  return $this_define['data'] ;
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/functions/edit_text.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/edit_text.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/edit_text.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,977 @@
+<?php
+/* /function2/edit_languages.php
+// A module of OSCommerce
+//
+// Version 1.00
+// 
+// Author: Julian Brown
+// Copyright (c) 2003 JLB Professional Services Inc.
+// Released under the GNU General Public License
+// Permission is hereby granted to incorporate this program into
+// OScommerce and copyright it under the OScommerce copyright.
+// Please notify me that you have.
+//
+// Julian Brown
+// julian at jlbprof.com
+//
+
+This file moves the function from the edit_textdata.php to one central location
+for use by a series of edit files. 
+*/
+function phppage2readeable($t){
+
+ return str_replace(" ", "&nbsp;",preg_replace("/\.php$/", "", str_replace("_", "&nbsp;", $t)));
+}
+// ---- end 
+
+
+function getFromQuery ($var)
+{
+    $query = $_SERVER['QUERY_STRING'];
+
+    $string = $var . "=";
+
+    $idx = strpos ($query, $string);
+    if ($idx === false)
+    {
+        return ("");
+    }
+
+    $string = substr ($query, $idx);
+    $idx = strpos ($string, "=");
+    $string = substr ($string, $idx + 1);
+    $idx = strpos ($string, "&");
+    if ($idx === false)
+    {
+    }
+    else
+    {
+        $string = substr ($string, 0, $idx);
+    }
+
+    $string = urldecode ($string);
+
+    return ($string);
+}
+
+// all this crap about seperating GET from POST variables is stupid
+// this function will return first from put if available otherwise
+// from get
+
+function getVAR ($var)
+{
+    global $HTTP_GET_VARS;
+    global $HTTP_POST_VARS;
+
+    if (strlen ($HTTP_POST_VARS[$var]) > 0)
+    {
+        return ($HTTP_POST_VARS[$var]);
+    }
+
+    return ($HTTP_GET_VARS[$var]);
+}
+
+// ok now strip off any carriage returns and line feeds
+
+function strip_crlf ($data)
+{
+    $len = strlen ($data);
+    for ($i = 0; $i < $len; ++$i)
+    {
+        $cc = substr ($data, $i, 1);
+        $cc1 = substr ($data, $i + 1, 1);
+
+        if ((ord ($cc) == 10) ||  // a new line char
+            (ord ($cc) == 13)     // a carriage return
+           )
+        {
+            $data = substr ($data, 0, $i);
+            break;
+        }
+    }
+
+    return ($data);
+}
+
+function getFiles ($dir1)
+{
+    global $languages_array;
+    global $PHP_SELF;
+
+   $dir1 = dir($fs_dir);
+    if ($dir1)
+    {
+        $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+        while ($file = $dir1->read())
+        {
+            if (substr($file, strrpos($file, '.')) == $file_extension)
+            {
+                $data [$idx++] = $file;
+            }
+        }
+        $dir1->close();
+    }
+
+    return ($data);
+}
+
+// this looks for all the files that we may want to edit
+
+function listFiles ($dir)
+{
+    global $filetype1, $PHP_SELF;
+ if ($dir)
+    {   
+        $file_extension = '.php';
+        $d = dir($dir);
+        while ($file = $d->read()){ 
+         $file_array[$file]=$file;
+    
+//  asort($file_array, SORT_REGULAR );  
+  foreach ( $file_array as $file){
+          while (false !== ($entry = $d->read())) {
+          // echo $entry."<br> \n";
+          // echo substr($entry, strrpos($entry, '.'));
+       if (substr($entry, strrpos($entry, '.')) == $file_extension){
+ 
+       echo '<tr><td class="smallText">' . ' <a href="' . tep_href_link(FILENAME_EDIT_TEXT, '&action=edit&filename=' . $entry) . '" title="' . $entry . '">' . ($entry) . '</a></td></tr>' . "\n";
+                  }
+              }
+           }  
+        }
+        $d->close();
+    }
+}
+
+function listFiles1 ($dir)
+{
+    global $filetype1, $PHP_SELF;
+ if ($dir)
+    {   
+        $file_extension = '.php';
+        $d = dir($dir);
+        while ($file = $d->read()){ 
+         $file_array[$file]=$file;
+    
+//  asort($file_array, SORT_REGULAR );  
+  foreach ( $file_array as $file){
+          while (false !== ($entry = $d->read())) {
+          // echo $entry."<br> \n";
+          // echo substr($entry, strrpos($entry, '.'));
+       if (substr($entry, strrpos($entry, '.')) == $file_extension){
+ 
+       echo '<tr><td class="smallText">' . ' <a href="' . tep_href_link(FILENAME_EDIT_TEXT, '&action=edit&filename=' . $entry) . '" title="' . $entry . '">' . ($entry) . '</a></td></tr>' . "\n";
+                  }
+              }
+           }  
+        }
+        $d->close();
+    }
+}
+// These functions perform character reads for the file parser
+//
+// The parser will depend on reading one character at a time, so the
+// 2 routines getChar and readLine work together, getChar calls readLine
+// noone else does.
+//
+// read the next line in, to feed the getChar routine
+
+function readLine ()
+{
+    global $file_data;
+
+    // if we have reached the end of file, mark it as so
+
+    if (feof ($file_data ['handle']))
+    {
+        // We have reached the end of the file
+
+        $file_data ['eof'] = 1;
+        return;
+    }
+
+    // actually read in a line
+
+    $data = fgets ($file_data ['handle']);
+
+    // ok now strip off any carriage returns and line feeds and
+    // double comment slashes
+
+    $len = strlen ($data);
+    for ($i = 0; $i < $len; ++$i)
+    {
+        $cc = substr ($data, $i, 1);
+        $cc1 = substr ($data, $i + 1, 1);
+    $cc0 = substr ($data, $i - 1, 1);
+
+        if ((ord ($cc) == 10) ||  // a new line char
+            (ord ($cc) == 13) ||  // a carriage return
+            (
+                ($cc  == '/' &&
+                 $cc1 == '/' && 
+         $cc0!=":" // not a link
+         )
+            )
+           )
+        {
+            $data = substr ($data, 0, $i);
+            break;
+        }
+    }
+
+    // ok we have a clean line
+
+    $file_data ['data'] = $data;
+    $file_data ['len']  = strlen ($data);
+    $file_data ['idx']  = 0;
+    $file_data ['line'] ++;
+
+    if ($file_data['len'] == 0)
+    {
+        // recursively skip blank lines
+        return (readLine ());
+    }
+
+    return;
+}
+
+function getChar ()
+{
+    global $file_data;
+
+    // if we have exhausted our characters then read a new line in
+
+    if ($file_data ['idx'] >= $file_data ['len'])
+    {
+        readLine ();
+        if ($file_data ['eof'] == 1)
+            return;
+        
+        // mark that we have transitioned over an end of line
+        $file_data ['eol'] = 1;
+    }
+    else
+        $file_data ['eol'] = 0;
+
+    // ok save the last character, to check for escaped chars and such
+
+    $file_data ['last'] = $file_data ['current'];
+
+    // EOL cancels a back slash escape
+    if ($file_data ['eol'] == 1)
+        $file_data ['last'] = 0;
+
+    $file_data ['current'] = substr ($file_data ['data'],
+        $file_data ['idx'], 1);
+    $file_data ['idx'] ++;
+}
+
+// process_data, cleans up certain cases.  Typically the define
+// is pretty straightforward: define ('ABC', 'DEF');
+//
+// in that case we just need to strip off the surrounding
+// quotes, but here are some pathological cases
+//
+// define ('ABC', 'DEF' . 'GHI');
+// define ('ABC', TEP_STUFF . 'DEF');
+//
+// This routine checks to see if we should remove the
+// quotes or not, in the first case yes, in the other cases
+// no.
+//
+// look for the special cases where the entire string is quoted
+// also trim whitespace off of end
+
+function process_data ($data)
+{
+    $data = trim ($data);
+
+    $cc = substr ($data, 0, 1);
+    $end = strlen ($data) - 1;
+    $cc1 = substr ($data, $end, 1);
+
+    // check to see if the first and last characters are quotes
+
+    if (!strcmp ($cc, $cc1) &&
+        (!strcmp ($cc, '"') ||
+         !strcmp ($cc, "'")))
+    {
+        // ok check to see if we get dequoted somewhere in between
+
+        $len = strlen ($data) - 1; // we dont want to check last char
+        for ($i = 1; $i < $len; ++$i)
+        {
+            $cc1 = substr ($data, $i, 1);
+            $cc2 = substr ($data, $i - 1, 1);
+            if (!strcmp ($cc, $cc1) &&
+                strcmp ($cc2, '\\'))
+            {
+                // ok we were dequoted
+                // just return the data as is
+                //
+                // we do not remove the quotes in this case
+
+                return ($data);
+            }
+        }
+
+        // ok we were not dequoted, therefore strip the quotes
+
+        $data = substr ($data, 1, $len - 1);
+    }
+
+    return ($data);
+}
+
+// We will create a state machine driven parser
+
+function parseFile ($this_filename)
+{
+  // returns $num_defines
+    global $file_data;
+    global $defines;
+
+    $fh = fopen ($this_filename, "rb");
+
+    $file_data ['handle'] = $fh;
+    $file_data ['filename'] = $this_filename;
+    $file_data ['line'] = 0;
+    $file_data ['eof'] = 0;
+    $file_data ['len'] = 0;
+    $file_data ['idx'] = 0;
+    $file_data ['last'] = 0;
+
+    // Create the state table
+
+    // read the define portion
+    $state [0] = array ( 'string' => "define('",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // save all data upto the apostrophe
+    $state [1] = array ( 'string' => "'",
+                         'eatall' => 1,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // read till the comma
+    $state [2] = array ( 'string' => ",",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // State's 3 and 4 are too complex to anaylze in the normal way
+    //
+    // In state 3 we will read until we find the first non-whitespace
+    //
+    // In state 4 we will read and eat until we find an unquoted, unescaped
+    // close paren.
+    //
+    // Then we will determine what to do about the quotes and such
+    //
+
+    // read till the first non-whitespace
+    $state [3] = array ( 'string' => "",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // eat until we find a close paren
+    $state [4] = array ( 'string' => "",
+                         'eatall' => 1,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // After state's 3 and 4 we need to find the closing semi colon
+
+    // read till the semicolon
+    $state [5] = array ( 'string' => ";",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    $the_state = 0;
+    $num_defines = 0;
+
+    // keep reading characters till we reach the end of file
+
+    while ($file_data ['eof'] == 0)
+    {
+        // get the next character
+
+        getChar ();
+
+        $cc = $file_data ['current'];
+        $cc1 = $file_data ['last'];
+
+        // we ignore white space, unless we are in the eatall states
+
+        if (!$eatall &&
+            ($cc == ' ' || $cc == '\t'))
+        {
+            continue;
+        }
+
+        $idx = $state [$the_state]['sidx'];
+        $schar = substr ($state [$the_state]['string'], $idx, 1);
+        $eatall = $state [$the_state]['eatall'];
+       
+        // a special case when state is 3 and 4
+        // in state 3 we read until we find a non-whitespace
+
+        if ($the_state == 3)
+        {
+            if (strcmp ($cc, " ") &&
+                strcmp ($cc, "\t"))
+            {
+                // ok when we get to a non-white space let's
+                // transition to state 4
+
+                $state [$the_state]['sidx'] = 0;
+                $the_state ++;
+
+                $in_quote = 0;
+                $quote_type = "'";
+                $dequoted = 0;
+
+                if (!strcmp ($cc, "'") ||
+                    !strcmp ($cc, '"'))
+                {
+                    $in_quote = 1;
+                    $quote_type = $cc;
+                }
+
+                // put this character into the new state data
+
+                $state[$the_state]['data'] = $cc;
+            }
+
+            continue;
+        }
+
+        // in state 4 we eat until we find an unquoted, unescaped
+        // paren
+
+        if ($the_state == 4)
+        {
+            if ($cc == ')' &&
+                $cc1 != '\\' &&
+                $in_quote == 0)
+            {
+                // we have completed state 4
+                // call process_data to determine if we should
+                // remove the starting and ending quotes if they
+                // exist
+
+                $state [$the_state]['data'] = process_data (
+                    $state [$the_state]['data']);
+
+                $state [$the_state]['sidx'] = 0;
+
+                $the_state++;
+
+                continue;
+            }
+
+            // ok we need to check our quote status
+
+            if ($in_quote == 1 &&
+                !strcmp ($cc, $quote_type) &&
+                strcmp ($cc1, "\\")) // make sure not escaped
+            {
+                // ok we have been dequoted
+
+                $dequote = 1;
+                $in_quote = 0;
+
+                // if we pass an eol, append a newline
+
+                if ($file_data ['eol'] == 1)
+                    $state [$the_state]['data'] .= "\n";
+
+                // save the quote
+
+                $state [$the_state]['data'] .= $cc;
+
+                continue;
+            }
+
+            // ok are we being quoted
+
+            if ($in_quote == 0 &&
+                (!strcmp ($cc, '"') ||
+                 !strcmp ($cc, "'") ||
+                 !strcmp ($cc, '('))) // consider nonquoted, nonescaped
+                                      // interior parens as quotes
+            {
+                // ok we are quoted again
+
+                $in_quote = 1;
+                $quote_type = $cc;
+
+                // if we are quoted by parens, change the quote type 
+                // to be the close paren, to make the if statement
+                // easier
+
+                if (!strcmp ($cc, '('))
+                    $quote_type = ')';
+            }
+
+            // if we pass an eol, append a newline
+
+            if ($file_data ['eol'] == 1)
+            {
+                $state [$the_state]['data'] .= "\n";
+            }
+
+            // eat the character
+            $state [$the_state]['data'] .= $cc;
+            continue;
+        }
+
+        // normal states are here
+
+        // eatall == 1, means we eat all characters till the one
+        // in we are looking for, otherwise we skip characters till
+        // we find the character
+
+        if ($eatall == 0)
+        {
+            // ok we failed to finish the state machine,
+            // we will restart the state machine
+
+            if (strcmp ($cc, $schar))
+            {
+                // reset the states
+                for ($i = 0; $i < 7; ++$i)
+                {
+                    $state [$i]['sidx'] = 0;
+                    $state [$i]['data'] = '';
+                }
+
+                $the_state = 0;
+
+                continue;
+            }
+        }
+        else
+        {
+            if (strcmp ($cc, $schar) ||
+                !strcmp ($cc1, '\\'))
+            {
+                // ok we eatall till we find our char
+
+                if ($file_data ['eol'] == 1)
+                    $state [$the_state]['data'] .= "\n";
+                $state [$the_state]['data'] .= $cc;
+
+                continue;
+            }
+        }
+
+        // ok advance the state
+
+        $len = strlen ($state [$the_state]['string']);
+        $sidx = $state [$the_state]['sidx'];
+        $sidx ++;
+        $state [$the_state]['sidx'] = $sidx;
+
+        // only use this code on a non eatall
+
+        if ($eatall == 0)
+        {
+            if ($file_data ['eol'] == 1)
+                $state [$the_state]['data'] .= "\n";
+            $state [$the_state]['data'] .= $cc;
+        }
+
+        // special case when we find the d in define
+
+        if ($the_state == 0 && $sidx == 1)
+        {
+            // we have found the first character
+            //
+            // I want to store the starting and ending line numbers
+            // so that when we rebuild the file, it will make the
+            // assembly much easier.
+            //
+
+            $start_line = $file_data ['line'];
+        }
+
+        // check to see if we can advance the state
+
+        if ($sidx >= $len)
+        {
+            // advance the state
+
+            $state [$the_state]['sidx'] = 0;
+            $the_state ++;
+
+            if ($the_state == 6)
+            {
+                // bingo we have found a complete define statement
+
+                $end_line = $file_data ['line'];
+
+                // before aeembly, we need to see if we can handle this data
+                
+                if ( preg_match( "/'\s*.\s*\w+\s*.\s*'/", $state[4]['data'], $pattern_match) ) $data_disable = true;
+                else $data_disable = false;
+                
+                // ok assemble an array
+
+                $this_define =
+                    array (
+                        'name'       => $state [1]['data'],
+                        'data'       => $state [4]['data'],
+                        'start_line' => $start_line,
+                        'end_line'   => $end_line,
+                        'disable'    => $data_disable);
+
+                // now save this
+
+                $defines [$num_defines] = $this_define;
+                $num_defines++;
+
+                // reset the states
+                for ($i = 0; $i < 7; ++$i)
+                {
+                    $state [$i]['sidx'] = 0;
+                    $state [$i]['data'] = '';
+                }
+
+                $the_state = 0;
+            }
+        }
+    }
+    // ok we are done with the file
+
+    fclose ($file_data ['handle']);
+  return $num_defines;
+}
+
+function parseFileData ($this_filename)
+{
+  // returns $num_defines
+    global $file_data;
+    global $defines;
+
+    $fh = fopen ($this_filename, "rb");
+
+    $file_data ['handle'] = $fh;
+    $file_data ['filename'] = $this_filename;
+    $file_data ['line'] = 0;
+    $file_data ['eof'] = 0;
+    $file_data ['len'] = 0;
+    $file_data ['idx'] = 0;
+    $file_data ['last'] = 0;
+
+    // Create the state table
+
+    // read the define portion
+    $state [0] = array ( 'string' => "define('",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // save all data upto the apostrophe
+    $state [1] = array ( 'string' => "'",
+                         'eatall' => 1,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // read till the comma
+    $state [2] = array ( 'string' => ",",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // State's 3 and 4 are too complex to anaylze in the normal way
+    //
+    // In state 3 we will read until we find the first non-whitespace
+    //
+    // In state 4 we will read and eat until we find an unquoted, unescaped
+    // close paren.
+    //
+    // Then we will determine what to do about the quotes and such
+    //
+
+    // read till the first non-whitespace
+    $state [3] = array ( 'string' => "",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // eat until we find a close paren
+    $state [4] = array ( 'string' => "",
+                         'eatall' => 1,
+                         'data' => '',
+                         'sidx' => 0);
+
+    // After state's 3 and 4 we need to find the closing semi colon
+
+    // read till the semicolon
+    $state [5] = array ( 'string' => ";",
+                         'eatall' => 0,
+                         'data' => '',
+                         'sidx' => 0);
+
+    $the_state = 0;
+    $num_defines = 0;
+
+    // keep reading characters till we reach the end of file
+
+    while ($file_data ['eof'] == 0)
+    {
+        // get the next character
+
+        getChar ();
+
+        $cc = $file_data ['current'];
+        $cc1 = $file_data ['last'];
+
+        // we ignore white space, unless we are in the eatall states
+
+        if (!$eatall &&
+            ($cc == ' ' || $cc == '\t'))
+        {
+            continue;
+        }
+
+        $idx = $state [$the_state]['sidx'];
+        $schar = substr ($state [$the_state]['string'], $idx, 1);
+        $eatall = $state [$the_state]['eatall'];
+       
+        // a special case when state is 3 and 4
+        // in state 3 we read until we find a non-whitespace
+
+        if ($the_state == 3)
+        {
+            if (strcmp ($cc, " ") &&
+                strcmp ($cc, "\t"))
+            {
+                // ok when we get to a non-white space let's
+                // transition to state 4
+
+                $state [$the_state]['sidx'] = 0;
+                $the_state ++;
+
+                $in_quote = 0;
+                $quote_type = "'";
+                $dequoted = 0;
+
+                if (!strcmp ($cc, "'") ||
+                    !strcmp ($cc, '"'))
+                {
+                    $in_quote = 1;
+                    $quote_type = $cc;
+                }
+
+                // put this character into the new state data
+
+                $state[$the_state]['data'] = $cc;
+            }
+
+            continue;
+        }
+
+        // in state 4 we eat until we find an unquoted, unescaped
+        // paren
+
+        if ($the_state == 4)
+        {
+            if ($cc == ')' &&
+                $cc1 != '\\' &&
+                $in_quote == 0)
+            {
+                // we have completed state 4
+                // call process_data to determine if we should
+                // remove the starting and ending quotes if they
+                // exist
+
+                $state [$the_state]['data'] = process_data (
+                    $state [$the_state]['data']);
+
+                $state [$the_state]['sidx'] = 0;
+
+                $the_state++;
+
+                continue;
+            }
+
+            // ok we need to check our quote status
+
+            if ($in_quote == 1 &&
+                !strcmp ($cc, $quote_type) &&
+                strcmp ($cc1, "\\")) // make sure not escaped
+            {
+                // ok we have been dequoted
+
+                $dequote = 1;
+                $in_quote = 0;
+
+                // if we pass an eol, append a newline
+
+                if ($file_data ['eol'] == 1)
+                    $state [$the_state]['data'] .= "\n";
+
+                // save the quote
+
+                $state [$the_state]['data'] .= $cc;
+
+                continue;
+            }
+
+            // ok are we being quoted
+
+            if ($in_quote == 0 &&
+                (!strcmp ($cc, '"') ||
+                 !strcmp ($cc, "'") ||
+                 !strcmp ($cc, '('))) // consider nonquoted, nonescaped
+                                      // interior parens as quotes
+            {
+                // ok we are quoted again
+
+                $in_quote = 1;
+                $quote_type = $cc;
+
+                // if we are quoted by parens, change the quote type 
+                // to be the close paren, to make the if statement
+                // easier
+
+                if (!strcmp ($cc, '('))
+                    $quote_type = ')';
+            }
+
+            // if we pass an eol, append a newline
+
+            if ($file_data ['eol'] == 1)
+            {
+                $state [$the_state]['data'] .= "\n";
+            }
+
+            // eat the character
+            $state [$the_state]['data'] .= $cc;
+            continue;
+        }
+
+        // normal states are here
+
+        // eatall == 1, means we eat all characters till the one
+        // in we are looking for, otherwise we skip characters till
+        // we find the character
+
+        if ($eatall == 0)
+        {
+            // ok we failed to finish the state machine,
+            // we will restart the state machine
+
+            if (strcmp ($cc, $schar))
+            {
+                // reset the states
+                for ($i = 0; $i < 7; ++$i)
+                {
+                    $state [$i]['sidx'] = 0;
+                    $state [$i]['data'] = '';
+                }
+
+                $the_state = 0;
+
+                continue;
+            }
+        }
+        else
+        {
+            if (strcmp ($cc, $schar) ||
+                !strcmp ($cc1, '\\'))
+            {
+                // ok we eatall till we find our char
+
+                if ($file_data ['eol'] == 1)
+                    $state [$the_state]['data'] .= "\n";
+                $state [$the_state]['data'] .= $cc;
+
+                continue;
+            }
+        }
+
+        // ok advance the state
+
+        $len = strlen ($state [$the_state]['string']);
+        $sidx = $state [$the_state]['sidx'];
+        $sidx ++;
+        $state [$the_state]['sidx'] = $sidx;
+
+        // only use this code on a non eatall
+
+        if ($eatall == 0)
+        {
+            if ($file_data ['eol'] == 1)
+                $state [$the_state]['data'] .= "\n";
+            $state [$the_state]['data'] .= $cc;
+        }
+
+        // special case when we find the d in define
+
+        if ($the_state == 0 && $sidx == 1)
+        {
+            // we have found the first character
+            //
+            // I want to store the starting and ending line numbers
+            // so that when we rebuild the file, it will make the
+            // assembly much easier.
+            //
+
+            $start_line = $file_data ['line'];
+        }
+
+        // check to see if we can advance the state
+
+        if ($sidx >= $len)
+        {
+            // advance the state
+
+            $state [$the_state]['sidx'] = 0;
+            $the_state ++;
+
+            if ($the_state == 6)
+            {
+                // bingo we have found a complete define statement
+
+                $end_line = $file_data ['line'];
+
+                // ok assemble an array
+
+                $this_define =
+                    array (
+                        'name'       => $state [1]['data'],
+                        'data'       => $state [4]['data'],
+                        'start_line' => $start_line,
+                        'end_line'   => $end_line);
+
+                // now save this
+
+                $defines [$num_defines] = $this_define;
+                $num_defines++;
+
+                // reset the states
+                for ($i = 0; $i < 7; ++$i)
+                {
+                    $state [$i]['sidx'] = 0;
+                    $state [$i]['data'] = '';
+                }
+
+                $the_state = 0;
+            }
+        }
+    }
+
+    // ok we are done with the file
+
+    fclose ($file_data ['handle']);
+  //return $num_defines;
+  return $this_define['data'] ;
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/functions/faq.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,148 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+  function faq_toc ($language) {
+  static $old_faq_id;
+  
+  if ($old_faq_id) {
+    $exclude = explode("&", $old_faq_id);
+    while (list($dummy,$old_id) = each($exclude)) {
+    if ($old_id) {
+      $query .= 'faq_id != ' . $old_id . ' AND ';
+      unset($old_id);
+    }
+    }
+  }
+  $result = tep_db_fetch_array(tep_db_query("SELECT faq_id, question FROM " . TABLE_FAQ . " WHERE $query visible='1' AND language = '$language' ORDER BY v_order asc"));
+  if ($result['faq_id']) {
+    $old_faq_id .= $result['faq_id'] . '&';
+    $result['toc'] = '<a href="' . tep_href_link(FILENAME_FAQ_VIEW_ALL,'#' . $result['faq_id']) . '"><b>' . $result['question'] . '</b></a>';
+  }
+  return $result;
+  }
+
+  function read_faq ($language) {
+  static $old_faq_id;
+  
+  if ($old_faq_id) {
+    $exclude = explode("&", $old_faq_id);
+    while (list($dummy,$old_id) = each($exclude)) {
+    if ($old_id) {
+      $query .= 'faq_id != ' . $old_id . ' AND ';
+      unset($old_id);
+    }
+    }
+  }
+  $result = tep_db_fetch_array(tep_db_query("SELECT faq_id, question, answer FROM " . TABLE_FAQ . " WHERE $query visible='1' AND language = '$language' ORDER BY v_order asc"));
+
+  if ($result['faq_id']) {
+    global $languages_id;
+
+    $categories_query = tep_db_query("select icd.categories_id, icd.categories_name from " . TABLE_FAQ_TO_CATEGORIES . " ip2c left join " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd on icd.categories_id = ip2c.categories_id where ip2c.faq_id = '" . (int)$result['faq_id'] . "' and icd.language_id = '" . (int)$languages_id . "'");
+    $category = tep_db_fetch_array($categories_query);
+
+    $result = array_merge($result, $category);
+
+    $old_faq_id .= $result['faq_id'] . '&';
+    $result['faq'] = '<b><span id="' . $result['faq_id'] . '">' . $result['question'] . '</span></b><br>' . $result['answer'];
+  }
+    return $result;
+  }
+  
+  function browse_faq ($language,$HTTP_GET_VARS) {
+    if ($HTTP_GET_VARS['faq_lang'] != '') {
+      $query_lang = "WHERE language = '$HTTP_GET_VARS[faq_lang]'";
+    } elseif ($HTTP_GET_VARS['faq_action'] == 'Added') {
+      $query_lang = "WHERE language = '$language'";
+    }
+    $query = "SELECT *, DATE_FORMAT(date, '%d.%m.%y') AS d FROM " . TABLE_FAQ . " $query_lang ORDER BY v_order";
+    $daftar = tep_db_query($query);
+    $c=0;
+
+    global $languages_id;
+
+    while ($buffer = tep_db_fetch_array($daftar)) {
+      $categories_query = tep_db_query("select icd.categories_id, icd.categories_name from " . TABLE_FAQ_TO_CATEGORIES . " ip2c left join " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd on icd.categories_id = ip2c.categories_id where ip2c.faq_id = '" . (int)$buffer['faq_id'] . "' and icd.language_id = '" . (int)$languages_id . "'");
+      $category = tep_db_fetch_array($categories_query);
+
+      $buffer = array_merge($buffer, $category);
+
+      $result[$c] = $buffer;
+
+      $c++;
+    }
+
+    return $result;
+  }
+  
+  function read_data ($faq_id) {
+    $result = tep_db_fetch_array(tep_db_query("SELECT * FROM " . TABLE_FAQ . " WHERE faq_id=$faq_id"));
+
+    global $languages_id;
+    $categories_query = tep_db_query("select icd.categories_id, icd.categories_name from " . TABLE_FAQ_TO_CATEGORIES . " ip2c left join " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd on icd.categories_id = ip2c.categories_id where ip2c.faq_id = '" . (int)$faq_id . "' and icd.language_id = '" . (int)$languages_id . "'");
+    $category = tep_db_fetch_array($categories_query);
+
+    $result = array_merge($result, $category);
+
+    return $result;
+  }
+  
+  function error_message($error) {
+    switch ($error) {
+    case "20":
+      return '<tr class=messageStackError><td>' . tep_image(DIR_WS_IMAGES . 'icons/warning.gif', FAQ_WARNING) . ' ' . FAQ_ERROR_20 . '</td></tr>';
+      break;
+    case "80":
+      return '<tr class=messageStackError><td>' . tep_image(DIR_WS_IMAGES . 'icons/warning.gif', FAQ_WARNING) . ' ' . FAQ_ERROR_80 . '</td></tr>';
+      break;
+    default:
+      return $error;
+    }
+  }
+
+  function tep_faq_get_category_name($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_name from " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_name'];
+  }
+
+  function tep_faq_get_category_description($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_description from " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_description'];
+  }
+
+  function tep_faq_remove_category($category_id) {
+    $category_image_query = tep_db_query("select categories_image from " . TABLE_FAQ_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+    $category_image = tep_db_fetch_array($category_image_query);
+
+    // if same image is used for some other category, don't delete
+    $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_FAQ_CATEGORIES . " where categories_image = '" . tep_db_input($category_image['categories_image']) . "'");
+    $duplicate_image = tep_db_fetch_array($duplicate_image_query);
+
+    if ($duplicate_image['total'] < 2) {
+      if (file_exists(DIR_FS_CATALOG_IMAGES . $category_image['categories_image'])) {
+        @unlink(DIR_FS_CATALOG_IMAGES . $category_image['categories_image']);
+      }
+    }
+
+    tep_db_query("delete from " . TABLE_FAQ_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_FAQ_TO_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+  }
+
+  function tep_faq_remove_faq($faq_id) {
+    tep_db_query("delete from " . TABLE_FAQ . " where faq_id = '" . (int)$faq_id . "'");
+    tep_db_query("delete from " . TABLE_FAQ_TO_CATEGORIES . " where faq_id = '" . (int)$faq_id . "'");
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/general.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/general.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/general.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1680 @@
+<?php
+/*
+  $Id: general.php,v 1.1.1.1 2004/03/04 23:39:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Chain Reaction Works, Inc
+  Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3455 $
+
+  Released under the GNU General Public License
+*/
+
+function tep_return_broken($bad_string) {
+  $char_count = 35;
+  $formatted_string = '';
+  $countbefore = 0;
+  $i = 0;
+  while ($i < strlen($bad_string)) {
+    $formatted_string .= $bad_string[$i];
+    $countbefore ++;
+    if ($countbefore > $char_count) {
+      $formatted_string .= chr(13);
+      $countbefore = 0;
+    }
+    $i ++;
+  } // End of while loop on strlen of bad string
+  return $formatted_string;
+}
+
+////
+// Stop from parsing any further PHP code
+  function tep_exit() {
+   tep_session_close();
+   exit();
+  }
+
+
+// Redirect to another page or site
+  function tep_redirect($url) {
+    if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) { 
+      tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
+    }
+
+    if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page
+      if (substr($url, 0, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)) == HTTP_SERVER . DIR_WS_HTTP_CATALOG) { // NONSSL url
+        $url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL
+      }
+    }
+
+    header('Location: ' . $url);
+
+   tep_exit();
+  }
+
+//Admin begin
+////
+//Check login and file access
+function tep_admin_check_login() {
+  global $PHP_SELF, $login_groups_id;
+  if (!tep_session_is_registered('login_id')) {
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  } else {
+    // if they are in group 1, let them do whatever they need to do
+    if ( $login_groups_id != 1 ) {
+      $filename = basename( $PHP_SELF );
+      if ($filename != FILENAME_DEFAULT && $filename != FILENAME_FORBIDEN && $filename != FILENAME_LOGOFF && $filename != FILENAME_ADMIN_ACCOUNT && $filename != FILENAME_POPUP_IMAGE && $filename != 'packingslip.php' && $filename != 'invoice.php') {
+        $db_file_query = tep_db_query("select admin_files_name from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_name = '" . $filename . "'");
+        if (!tep_db_num_rows($db_file_query)) {
+          tep_redirect(tep_href_link(FILENAME_FORBIDEN));
+        }
+      }
+    }
+  }
+}
+
+////
+//Return 'true' or 'false' value to display boxes and files in index.php and column_left.php
+function tep_admin_check_boxes($filename, $boxes='') {
+  global $login_groups_id;
+
+  $is_boxes = 1;
+  if ($boxes == 'sub_boxes') {
+    $is_boxes = 0;
+  }
+  $dbquery = tep_db_query("select admin_files_id from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '" . $is_boxes . "' and admin_files_name = '" . $filename . "'");
+
+  $return_value = false;
+  if (tep_db_num_rows($dbquery)) {
+    $return_value = true;
+  }
+  return $return_value;
+}
+
+////
+//Return files stored in box that can be accessed by user
+function tep_admin_files_boxes ($filename = '', $sub_box_name = '', $connection = 'NONSSL', $parameters = '', $space = '') {
+  global $login_groups_id, $request_type, $spaces1;
+  $sub_boxes = '';
+  $spaces1= '';
+
+ if (MENU_DHTML != 'True') { // We don't need spaces when DHTML menu is ON
+  for ($i=0, $n=$space; $i<$n; $i++) {
+  $spaces1 .= '&nbsp;';
+  }
+} // We don't need spaces when DHTML menu is ON
+//    $connection = 'NONSSL';
+
+if ($filename != '' ){
+  $dbquery = tep_db_query("select admin_files_name from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '0' and admin_files_name = '" . $filename . "'");
+  if (tep_db_num_rows($dbquery)) {
+     $sub_boxes = $spaces1 . '<a href="' . tep_href_link($filename, $parameters, $connection) . '" class="menuBoxContentLink"><nobr>' . $sub_box_name . '</nobr></a><br>';
+     } else if ( (tep_db_num_rows($dbquery)) || ($connection == '') ) {
+     $sub_boxes = $spaces1 . '<a href="' . tep_href_link($filename, $parameters, $connection) . '" class="menuBoxContentLink"><nobr>' . $sub_box_name . '</nobr></a><br>';
+    }
+  } else  if ($filename == ''){
+      $sub_boxes = $spaces1 .  '<class="menuBoxHeadLink"><b><nobr>' . $sub_box_name . '</nobr></b><br>';
+   } else {
+        $sub_boxes = $spaces1 .  '<class="menuBoxHeadLink"><nobr>' . $sub_box_name . '</nobr><br>';
+    }
+  return $sub_boxes;
+}
+
+////
+//Get selected file for index.php
+function tep_selected_file($filename) {
+  global $login_groups_id;
+  $randomize = FILENAME_ADMIN_ACCOUNT;
+
+  $dbquery = tep_db_query("select admin_files_id as boxes_id from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '1' and admin_files_name = '" . $filename . "'");
+  if (tep_db_num_rows($dbquery)) {
+    $boxes_id = tep_db_fetch_array($dbquery);
+    $randomize_query = tep_db_query("select admin_files_name from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '0' and admin_files_to_boxes = '" . $boxes_id['boxes_id'] . "'");
+    if (tep_db_num_rows($randomize_query)) {
+      $file_selected = tep_db_fetch_array($randomize_query);
+      $randomize = $file_selected['admin_files_name'];
+    }
+  }
+  return $randomize;
+}
+//Admin end
+
+
+////
+// Parse the data used in the html tags to ensure the tags will not break
+  function tep_parse_input_field_data($data, $parse) {
+    return strtr(trim($data), $parse);
+  }
+
+  function tep_output_string($string, $translate = false, $protected = false) {
+    if ($protected == true) {
+      return htmlspecialchars($string);
+    } else {
+      if ($translate == false) {
+        return tep_parse_input_field_data($string, array('"' => '&quot;'));
+      } else {
+        return tep_parse_input_field_data($string, $translate);
+      }
+    }
+  }
+
+  function tep_output_string_protected($string) {
+    return tep_output_string($string, false, true);
+  }
+
+  function tep_sanitize_string($string) {
+    $string = ereg_replace(' +', ' ', $string);
+
+    return preg_replace("/[<>]/", '_', $string);
+  }
+
+  function tep_customers_name($customers_id) {
+    $customers = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customers_id . "'");
+    $customers_values = tep_db_fetch_array($customers);
+
+    return $customers_values['customers_firstname'] . ' ' . $customers_values['customers_lastname'];
+  }
+
+  function tep_get_path($current_category_id = '') {
+    global $cPath_array;
+
+    if ($current_category_id == '') {
+      $cPath_new = implode('_', $cPath_array);
+    } else {
+      if (sizeof($cPath_array) == 0) {
+        $cPath_new = $current_category_id;
+      } else {
+        $cPath_new = '';
+        $last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$cPath_array[(sizeof($cPath_array)-1)] . "'");
+        $last_category = tep_db_fetch_array($last_category_query);
+
+        $current_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
+        $current_category = tep_db_fetch_array($current_category_query);
+
+        if ($last_category['parent_id'] == $current_category['parent_id']) {
+          for ($i = 0, $n = sizeof($cPath_array) - 1; $i < $n; $i++) {
+            $cPath_new .= '_' . $cPath_array[$i];
+          }
+        } else {
+          for ($i = 0, $n = sizeof($cPath_array); $i < $n; $i++) {
+            $cPath_new .= '_' . $cPath_array[$i];
+          }
+        }
+
+        $cPath_new .= '_' . $current_category_id;
+
+        if (substr($cPath_new, 0, 1) == '_') {
+          $cPath_new = substr($cPath_new, 1);
+        }
+      }
+    }
+
+    return 'cPath=' . $cPath_new;
+  }
+
+  function tep_get_all_get_params($exclude_array = '') {
+    global $HTTP_GET_VARS;
+
+    if ($exclude_array == '') $exclude_array = array();
+
+    $get_url = '';
+
+    reset($HTTP_GET_VARS);
+    while (list($key, $value) = each($HTTP_GET_VARS)) {
+      if (($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array))) $get_url .= $key . '=' . $value . '&';
+    }
+
+    return $get_url;
+  }
+
+  function tep_date_long($raw_date) {
+    if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;
+
+    $year = (int)substr($raw_date, 0, 4);
+    $month = (int)substr($raw_date, 5, 2);
+    $day = (int)substr($raw_date, 8, 2);
+    $hour = (int)substr($raw_date, 11, 2);
+    $minute = (int)substr($raw_date, 14, 2);
+    $second = (int)substr($raw_date, 17, 2);
+
+    return strftime(DATE_FORMAT_LONG, mktime($hour, $minute, $second, $month, $day, $year));
+  }
+
+////
+// Output a raw date string in the selected locale date format
+// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
+// NOTE: Includes a workaround for dates before 01/01/1970 that fail on windows servers
+  function tep_date_short($raw_date) {
+    if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;
+
+    $year = substr($raw_date, 0, 4);
+    $month = (int)substr($raw_date, 5, 2);
+    $day = (int)substr($raw_date, 8, 2);
+    $hour = (int)substr($raw_date, 11, 2);
+    $minute = (int)substr($raw_date, 14, 2);
+    $second = (int)substr($raw_date, 17, 2);
+
+    if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
+      return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
+    } else {
+      return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
+    }
+
+  }
+
+  function tep_datetime_short($raw_datetime) {
+    if ( ($raw_datetime == '0000-00-00 00:00:00') || ($raw_datetime == '') ) return false;
+
+    $year = (int)substr($raw_datetime, 0, 4);
+    $month = (int)substr($raw_datetime, 5, 2);
+    $day = (int)substr($raw_datetime, 8, 2);
+    $hour = (int)substr($raw_datetime, 11, 2);
+    $minute = (int)substr($raw_datetime, 14, 2);
+    $second = (int)substr($raw_datetime, 17, 2);
+
+    return strftime(DATE_TIME_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
+  }
+
+  function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
+    global $languages_id;
+
+    if (!is_array($category_tree_array)) $category_tree_array = array();
+    if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
+
+    if ($include_itself) {
+      $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'");
+      $category = tep_db_fetch_array($category_query);
+      $category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);
+    }
+
+    $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name");
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      if ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']);
+      $category_tree_array = tep_get_category_tree($categories['categories_id'], $spacing . '&nbsp;&nbsp;&nbsp;', $exclude, $category_tree_array);
+    }
+
+    return $category_tree_array;
+  }
+
+  function tep_draw_products_pull_down($name, $parameters = '', $exclude = '') {
+    global $currencies, $languages_id;
+
+    if ($exclude == '') {
+      $exclude = array();
+    }
+
+    $select_string = '<select name="' . $name . '"';
+
+    if ($parameters) {
+      $select_string .= ' ' . $parameters;
+    }
+
+    $select_string .= '>';
+
+// Eversun mod for sppc and qty price breaks
+      $all_groups=array();
+      $customers_groups_query = tep_db_query("select customers_group_name, customers_group_id from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
+      while ($existing_groups =  tep_db_fetch_array($customers_groups_query)) {
+          $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
+      }
+// Eversun mod end for sppc and qty price breaks
+
+    $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");
+    while ($products = tep_db_fetch_array($products_query)) {
+
+// Eversun mod for sppc and qty price breaks
+/*      if (!in_array($products['products_id'], $exclude)) {
+        $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>'; */
+    if (!in_array($products['products_id'], $exclude)) {
+       $price_query=tep_db_query("select customers_group_price, customers_group_id from " . TABLE_PRODUCTS_GROUPS . " where products_id = " . $products['products_id']);
+       $product_prices=array();
+       while($prices_array=tep_db_fetch_array($price_query)){
+         $product_prices[$prices_array['customers_group_id']]=$prices_array['customers_group_price'];
+       }
+       reset($all_groups);
+       $price_string="";
+       $sde=0;
+       while(list($sdek,$sdev)=each($all_groups)){
+         if (!in_array((int)$products['products_id'].":".(int)$sdek, $exclude)) {
+           if($sde)
+            $price_string.=", ";
+            $price_string.=$sdev.": ".$currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek]:$products['products_price']);
+            $sde=1;
+           }
+         }
+         $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $price_string . ')</option>\n';
+       }
+// Eversun mod end for sppc and qty price breaks
+
+ }
+
+    $select_string .= '</select>';
+
+    return $select_string;
+  }
+
+  function tep_options_name($options_id) {
+    global $languages_id;
+
+    $options = tep_db_query("select products_options_name from " . TABLE_PRODUCTS_OPTIONS_TEXT . " where products_options_text_id = '" . (int)$options_id . "' and language_id = '" . (int)$languages_id . "'");
+    $options_values = tep_db_fetch_array($options);
+
+    return $options_values['products_options_name'];
+  }
+
+  function tep_values_name($values_id) {
+    global $languages_id;
+
+    $values = tep_db_query("select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$values_id . "' and language_id = '" . (int)$languages_id . "'");
+    $values_values = tep_db_fetch_array($values);
+
+    return $values_values['products_options_values_name'];
+  }
+
+  function tep_info_image($image, $alt, $width = '', $height = '') {
+    if (tep_not_null($image) && (file_exists(DIR_FS_CATALOG_IMAGES . $image)) ) {
+      $image = tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $image, $alt, $width, $height);
+    } else {
+      $image = TEXT_IMAGE_NONEXISTENT;
+    }
+
+    return $image;
+  }
+
+  function tep_break_string($string, $len, $break_char = '-') {
+    $l = 0;
+    $output = '';
+    for ($i=0, $n=strlen($string); $i<$n; $i++) {
+      $char = substr($string, $i, 1);
+      if ($char != ' ') {
+        $l++;
+      } else {
+        $l = 0;
+      }
+      if ($l > $len) {
+        $l = 1;
+        $output .= $break_char;
+      }
+      $output .= $char;
+    }
+
+    return $output;
+  }
+
+  function tep_get_country_name($country_id) {
+    $country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'");
+
+    if (!tep_db_num_rows($country_query)) {
+      return $country_id;
+    } else {
+      $country = tep_db_fetch_array($country_query);
+      return $country['countries_name'];
+    }
+  }
+
+  function tep_get_zone_name($country_id, $zone_id, $default_zone) {
+    $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' and zone_id = '" . (int)$zone_id . "'");
+    if (tep_db_num_rows($zone_query)) {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_name'];
+    } else {
+      return $default_zone;
+    }
+  }
+
+  function tep_not_null($value) {
+    if (is_array($value)) {
+      if (sizeof($value) > 0) {
+        return true;
+      } else {
+        return false;
+      }
+    } else {
+      if ( (is_string($value) || is_int($value)) && ($value != '') && ($value != 'NULL') && (strlen(trim($value)) > 0)) {
+        return true;
+      } else {
+        return false;
+      }
+    }
+  }
+
+  function tep_browser_detect($component) {
+    global $HTTP_USER_AGENT;
+
+    return stristr($HTTP_USER_AGENT, $component);
+  }
+
+  function tep_tax_classes_pull_down($parameters, $selected = '') {
+    $select_string = '<select ' . $parameters . '>';
+    $classes_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
+    while ($classes = tep_db_fetch_array($classes_query)) {
+      $select_string .= '<option value="' . $classes['tax_class_id'] . '"';
+      if ($selected == $classes['tax_class_id']) $select_string .= ' SELECTED';
+      $select_string .= '>' . $classes['tax_class_title'] . '</option>';
+    }
+    $select_string .= '</select>';
+
+    return $select_string;
+  }
+
+  function tep_geo_zones_pull_down($parameters, $selected = '') {
+    $select_string = '<select ' . $parameters . '>';
+    $zones_query = tep_db_query("select geo_zone_id, geo_zone_name from " . TABLE_GEO_ZONES . " order by geo_zone_name");
+    while ($zones = tep_db_fetch_array($zones_query)) {
+      $select_string .= '<option value="' . $zones['geo_zone_id'] . '"';
+      if ($selected == $zones['geo_zone_id']) $select_string .= ' SELECTED';
+      $select_string .= '>' . $zones['geo_zone_name'] . '</option>';
+    }
+    $select_string .= '</select>';
+
+    return $select_string;
+  }
+
+  function tep_get_geo_zone_name($geo_zone_id) {
+    $zones_query = tep_db_query("select geo_zone_name from " . TABLE_GEO_ZONES . " where geo_zone_id = '" . (int)$geo_zone_id . "'");
+
+    if (!tep_db_num_rows($zones_query)) {
+      $geo_zone_name = $geo_zone_id;
+    } else {
+      $zones = tep_db_fetch_array($zones_query);
+      $geo_zone_name = $zones['geo_zone_name'];
+    }
+
+    return $geo_zone_name;
+  }
+
+  function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
+    $address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
+    $address_format = tep_db_fetch_array($address_format_query);
+
+    $company = tep_output_string_protected($address['company']);
+    if (isset($address['firstname']) && tep_not_null($address['firstname'])) {
+      $firstname = tep_output_string_protected($address['firstname']);
+      $lastname = tep_output_string_protected($address['lastname']);
+    } elseif (isset($address['name']) && tep_not_null($address['name'])) {
+      $firstname = tep_output_string_protected($address['name']);
+      $lastname = '';
+    } else {
+      $firstname = '';
+      $lastname = '';
+    }
+    $street = tep_output_string_protected($address['street_address']);
+    $suburb = tep_output_string_protected($address['suburb']);
+    $city = tep_output_string_protected($address['city']);
+    $state = tep_output_string_protected($address['state']);
+    if (isset($address['country_id']) && tep_not_null($address['country_id'])) {
+      $country = tep_get_country_name($address['country_id']);
+
+      if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {
+        $state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);
+      }
+    } elseif (isset($address['country']) && tep_not_null($address['country'])) {
+      $country = tep_output_string_protected($address['country']);
+    } else {
+      $country = '';
+    }
+    $postcode = tep_output_string_protected($address['postcode']);
+    $zip = $postcode;
+
+    if ($html) {
+// HTML Mode
+      $HR = '<hr>';
+      $hr = '<hr>';
+      if ( ($boln == '') && ($eoln == "\n") ) { // Values not specified, use rational defaults
+        $CR = '<br>';
+        $cr = '<br>';
+        $eoln = $cr;
+      } else { // Use values supplied
+        $CR = $eoln . $boln;
+        $cr = $CR;
+      }
+    } else {
+// Text Mode
+      $CR = $eoln;
+      $cr = $CR;
+      $HR = '----------------------------------------';
+      $hr = '----------------------------------------';
+    }
+
+    $statecomma = '';
+    $streets = $street;
+    if ($suburb != '') $streets = $street . $cr . $suburb;
+    if ($country == '') $country = tep_output_string_protected($address['country']);
+    if ($state != '') $statecomma = $state . ', ';
+
+    $fmt = $address_format['format'];
+    eval("\$address = \"$fmt\";");
+
+    if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {
+      $address = $company . $cr . $address;
+    }
+
+    return $address;
+  }
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_get_zone_code
+  //
+  // Arguments   : country           country code string
+  //               zone              state/province zone_id
+  //               def_state         default string if zone==0
+  //
+  // Return      : state_prov_code   state/province code
+  //
+  // Description : Function to retrieve the state/province code (as in FL for Florida etc)
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_get_zone_code($country, $zone, $def_state) {
+
+    $state_prov_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and zone_id = '" . (int)$zone . "'");
+
+    if (!tep_db_num_rows($state_prov_query)) {
+      $state_prov_code = $def_state;
+    }
+    else {
+      $state_prov_values = tep_db_fetch_array($state_prov_query);
+      $state_prov_code = $state_prov_values['zone_code'];
+    }
+
+    return $state_prov_code;
+  }
+
+  function tep_get_uprid($prid, $params) {
+    $uprid = $prid;
+    if ( (is_array($params)) && (!strstr($prid, '{')) ) {
+      while (list($option, $value) = each($params)) {
+        $uprid = $uprid . '{' . $option . '}' . $value;
+      }
+    }
+
+    return $uprid;
+  }
+
+  function tep_get_prid($uprid) {
+    $pieces = explode('{', $uprid);
+
+    return $pieces[0];
+  }
+
+  function tep_get_languages() {
+    $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
+    while ($languages = tep_db_fetch_array($languages_query)) {
+      $languages_array[] = array('id' => $languages['languages_id'],
+                                 'name' => $languages['name'],
+                                 'code' => $languages['code'],
+                                 'image' => $languages['image'],
+                                 'directory' => $languages['directory']);
+    }
+
+    return $languages_array;
+  }
+
+  function tep_get_category_name($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_name'];
+  }
+
+    function tep_get_category_htc_title($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_head_title_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_head_title_tag'];
+  }
+    
+  function tep_get_category_htc_desc($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_head_desc_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_head_desc_tag'];
+  }
+   
+  function tep_get_category_htc_keywords($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_head_keywords_tag  from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_head_keywords_tag '];
+  }
+  
+  function tep_get_category_htc_description($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_htc_description'];
+  }
+  
+  function tep_get_orders_status_name($orders_status_id, $language_id = '') {
+    global $languages_id;
+
+    if (!$language_id) $language_id = $languages_id;
+    $orders_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . (int)$orders_status_id . "' and language_id = '" . (int)$language_id . "'");
+    $orders_status = tep_db_fetch_array($orders_status_query);
+
+    return $orders_status['orders_status_name'];
+  }
+
+  function tep_get_orders_status() {
+    global $languages_id;
+
+    $orders_status_array = array();
+    $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "' order by orders_status_id");
+    while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+      $orders_status_array[] = array('id' => $orders_status['orders_status_id'],
+                                     'text' => $orders_status['orders_status_name']);
+    }
+
+    return $orders_status_array;
+  }
+
+  function tep_get_products_name($product_id, $language_id = 0) {
+    global $languages_id;
+
+    if ($language_id == 0) $language_id = $languages_id;
+    $product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_name'];
+  }
+
+  function tep_get_infobox_file_name($infobox_id, $language_id = 0) {
+    global $languages_id;
+
+    if ($language_id == 0) $language_id = $languages_id;
+    $infobox_query = tep_db_query("select infobox_file_name from " . TABLE_INFOBOX_CONFIGURATION . " where infobox_id = '" . (int)$infobox_id . "' and language_id = '" . (int)$language_id . "'");
+    $infobox = tep_db_fetch_array($infobox_query);
+
+    return $infobox['infobox_file_name'];
+  }
+
+  function tep_get_products_description($product_id, $language_id) {
+    $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_description'];
+  }
+
+  function tep_get_products_head_title_tag($product_id, $language_id) {
+    $product_query = tep_db_query("select products_head_title_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_head_title_tag'];
+  }
+
+  function tep_get_products_head_desc_tag($product_id, $language_id) {
+    $product_query = tep_db_query("select products_head_desc_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_head_desc_tag'];
+  }
+
+  function tep_get_products_head_keywords_tag($product_id, $language_id) {
+    $product_query = tep_db_query("select products_head_keywords_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_head_keywords_tag'];
+  }
+
+  function tep_get_products_url($product_id, $language_id) {
+    $product_query = tep_db_query("select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_url'];
+  }
+
+////
+// Return the manufacturers URL in the needed language
+// TABLES: manufacturers_info
+  function tep_get_manufacturer_url($manufacturer_id, $language_id) {
+    $manufacturer_query = tep_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$manufacturer_id . "' and languages_id = '" . (int)$language_id . "'");
+    $manufacturer = tep_db_fetch_array($manufacturer_query);
+
+    return $manufacturer['manufacturers_url'];
+  }
+
+////
+// Wrapper for class_exists() function
+// This function is not available in all PHP versions so we test it before using it.
+  function tep_class_exists($class_name) {
+    if (function_exists('class_exists')) {
+      return class_exists($class_name);
+    } else {
+      return true;
+    }
+  }
+
+////
+// Count how many products exist in a category
+// TABLES: products, products_to_categories, categories
+  function tep_products_in_category_count($categories_id, $include_deactivated = false) {
+    $products_count = 0;
+
+    if ($include_deactivated) {
+      $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$categories_id . "'");
+    } else {
+      $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int)$categories_id . "'");
+    }
+
+    $products = tep_db_fetch_array($products_query);
+
+    $products_count += $products['total'];
+
+    $childs_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$categories_id . "'");
+    if (tep_db_num_rows($childs_query)) {
+      while ($childs = tep_db_fetch_array($childs_query)) {
+        $products_count += tep_products_in_category_count($childs['categories_id'], $include_deactivated);
+      }
+    }
+
+    return $products_count;
+  }
+
+////
+// Count how many subcategories exist in a category
+// TABLES: categories
+  function tep_childs_in_category_count($categories_id) {
+    $categories_count = 0;
+
+    $categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$categories_id . "'");
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $categories_count++;
+      $categories_count += tep_childs_in_category_count($categories['categories_id']);
+    }
+
+    return $categories_count;
+  }
+
+////
+// Returns an array with countries
+// TABLES: countries
+  function tep_get_countries($default = '') {
+    $countries_array = array();
+    if ($default) {
+      $countries_array[] = array('id' => '',
+                                 'text' => $default);
+    }
+    $countries_query = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name");
+    while ($countries = tep_db_fetch_array($countries_query)) {
+      $countries_array[] = array('id' => $countries['countries_id'],
+                                 'text' => $countries['countries_name']);
+    }
+
+    return $countries_array;
+  }
+
+////
+// return an array with country zones
+  function tep_get_country_zones($country_id) {
+    $zones_array = array();
+    $zones_query = tep_db_query("select zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' order by zone_name");
+    while ($zones = tep_db_fetch_array($zones_query)) {
+      $zones_array[] = array('id' => $zones['zone_id'],
+                             'text' => $zones['zone_name']);
+    }
+
+    return $zones_array;
+  }
+
+  function tep_prepare_country_zones_pull_down($country_id = '') {
+// preset the width of the drop-down for Netscape
+    $pre = '';
+    if ( (!tep_browser_detect('MSIE')) && (tep_browser_detect('Mozilla/4')) ) {
+      for ($i=0; $i<45; $i++) $pre .= '&nbsp;';
+    }
+
+    $zones = tep_get_country_zones($country_id);
+
+    if (sizeof($zones) > 0) {
+      $zones_select = array(array('id' => '', 'text' => PLEASE_SELECT));
+      $zones = array_merge($zones_select, $zones);
+    } else {
+      $zones = array(array('id' => '', 'text' => TYPE_BELOW));
+// create dummy options for Netscape to preset the height of the drop-down
+      if ( (!tep_browser_detect('MSIE')) && (tep_browser_detect('Mozilla/4')) ) {
+        for ($i=0; $i<9; $i++) {
+          $zones[] = array('id' => '', 'text' => $pre);
+        }
+      }
+    }
+
+    return $zones;
+  }
+
+////
+// Get list of address_format_id's
+  function tep_get_address_formats() {
+    $address_format_query = tep_db_query("select address_format_id from " . TABLE_ADDRESS_FORMAT . " order by address_format_id");
+    $address_format_array = array();
+    while ($address_format_values = tep_db_fetch_array($address_format_query)) {
+      $address_format_array[] = array('id' => $address_format_values['address_format_id'],
+                                      'text' => $address_format_values['address_format_id']);
+    }
+    return $address_format_array;
+  }
+
+////
+// Alias function for Store configuration values in the Administration Tool
+  function tep_cfg_pull_down_country_list($country_id) {
+    return tep_draw_pull_down_menu('configuration_value', tep_get_countries(), $country_id);
+  }
+
+  function tep_cfg_pull_down_zone_list($zone_id) {
+    return tep_draw_pull_down_menu('configuration_value', tep_get_country_zones(STORE_COUNTRY), $zone_id);
+  }
+
+  function tep_cfg_pull_down_tax_classes($tax_class_id, $key = '') {
+    $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+    $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
+    $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
+    while ($tax_class = tep_db_fetch_array($tax_class_query)) {
+      $tax_class_array[] = array('id' => $tax_class['tax_class_id'],
+                                 'text' => $tax_class['tax_class_title']);
+    }
+
+    return tep_draw_pull_down_menu($name, $tax_class_array, $tax_class_id);
+  }
+//++++ QT Pro: Begin Changed code
+////
+// Function to build menu of available class files given a file prefix
+// Used for configuring plug-ins for product information attributes
+  function tep_cfg_pull_down_class_files($prefix, $current_file) {
+    $d=DIR_FS_CATALOG . DIR_WS_CLASSES;
+    $function_directory = dir ($d);
+
+    while (false !== ($function = $function_directory->read())) {
+      if (preg_match('/^'.$prefix.'(.+)\.php$/',$function,$function_name)) {
+          $file_list[]=array('id'=>$function_name[1], 'text'=>$function_name[1]);
+      }
+    }
+    $function_directory->close();
+
+    return tep_draw_pull_down_menu('configuration_value', $file_list, $current_file);
+  }
+
+//++++ QT Pro: End Changed Code
+////
+// Function to read in text area in admin
+ function tep_cfg_textarea($text) {
+    return tep_draw_textarea_field('configuration_value', false, 35, 5, $text);
+  }
+
+  function tep_cfg_get_zone_name($zone_id) {
+    $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_id = '" . (int)$zone_id . "'");
+
+    if (!tep_db_num_rows($zone_query)) {
+      return $zone_id;
+    } else {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_name'];
+    }
+  }
+
+////
+// Sets the status of a banner
+  function tep_set_banner_status($banners_id, $status) {
+    if ($status == '1') {
+      return tep_db_query("update " . TABLE_BANNERS . " set status = '1', expires_impressions = NULL, expires_date = NULL, date_status_change = NULL where banners_id = '" . $banners_id . "'");
+    } elseif ($status == '0') {
+      return tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_status_change = now() where banners_id = '" . $banners_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+////
+// Sets the status of a product
+  function tep_set_product_status($products_id, $status) {
+    if ($status == '1') {
+      return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '1', products_last_modified = now() where products_id = '" . (int)$products_id . "'");
+    } elseif ($status == '0') {
+      return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0', products_last_modified = now() where products_id = '" . (int)$products_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+////
+// Sets the status of a product on special
+  function tep_set_specials_status($specials_id, $status) {
+    if ($status == '1') {
+      return tep_db_query("update " . TABLE_SPECIALS . " set status = '1', expires_date = NULL, date_status_change = NULL where specials_id = '" . (int)$specials_id . "'");
+    } elseif ($status == '0') {
+      return tep_db_query("update " . TABLE_SPECIALS . " set status = '0', date_status_change = now() where specials_id = '" . (int)$specials_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+////
+// Sets timeout for the current script.
+// Cant be used in safe mode.
+  function tep_set_time_limit($limit) {
+    if (!get_cfg_var('safe_mode')) {
+      set_time_limit($limit);
+    }
+  }
+
+////
+// Alias function for Store configuration values in the Administration Tool
+  function tep_cfg_select_option($select_array, $key_value, $key = '') {
+    $string = '';
+
+    for ($i=0, $n=sizeof($select_array); $i<$n; $i++) {
+      $name = ((tep_not_null($key)) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+      $string .= '<br><input type="radio" name="' . $name . '" value="' . $select_array[$i] . '"';
+
+      if ($key_value == $select_array[$i]) $string .= ' CHECKED';
+
+      $string .= '> ' . $select_array[$i];
+    }
+
+    return $string;
+  }
+
+////
+// Alias function for module configuration keys
+  function tep_mod_select_option($select_array, $key_name, $key_value) {
+    reset($select_array);
+    while (list($key, $value) = each($select_array)) {
+      if (is_int($key)) $key = $value;
+      $string .= '<br><input type="radio" name="configuration[' . $key_name . ']" value="' . $key . '"';
+      if ($key_value == $key) $string .= ' CHECKED';
+      $string .= '> ' . $value;
+    }
+
+    return $string;
+  }
+  
+  function tep_cfg_select_multioption($select_array, $key_value, $key = '') {
+    for ($i=0; $i<sizeof($select_array); $i++) {
+      $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+      $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+      $key_values = explode( ", ", $key_value);
+      if ( in_array($select_array[$i], $key_values) ) $string .= ' CHECKED';
+      $string .= '> ' . $select_array[$i];
+    } 
+    $string .= '<input type="hidden" name="' . $name . '" value="--none--">';
+    return $string;
+  }
+
+////
+// Retreive server information
+  function tep_get_system_information() {
+    global $HTTP_SERVER_VARS;
+
+    $db_query = tep_db_query("select now() as datetime");
+    $db = tep_db_fetch_array($db_query);
+
+    list($system, $host, $kernel) = preg_split('/[\s,]+/', @exec('uname -a'), 5);
+
+    return array('date' => tep_datetime_short(date('Y-m-d H:i:s')),
+                 'system' => $system,
+                 'kernel' => $kernel,
+                 'host' => $host,
+                 'ip' => gethostbyname($host),
+                 'uptime' => @exec('uptime'),
+                 'http_server' => $HTTP_SERVER_VARS['SERVER_SOFTWARE'],
+                 'php' => PHP_VERSION,
+                 'zend' => (function_exists('zend_version') ? zend_version() : ''),
+                 'db_server' => DB_SERVER,
+                 'db_ip' => gethostbyname(DB_SERVER),
+                 'db_version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''),
+                 'db_date' => tep_datetime_short($db['datetime']));
+  }
+
+  function tep_generate_category_path($id, $from = 'category', $categories_array = '', $index = 0) {
+    global $languages_id;
+
+    if (!is_array($categories_array)) $categories_array = array();
+
+    if ($from == 'product') {
+      $categories_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$id . "'");
+      while ($categories = tep_db_fetch_array($categories_query)) {
+        if ($categories['categories_id'] == '0') {
+          $categories_array[$index][] = array('id' => '0', 'text' => TEXT_TOP);
+        } else {
+          $category_query = tep_db_query("select cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$categories['categories_id'] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
+          $category = tep_db_fetch_array($category_query);
+          $categories_array[$index][] = array('id' => $categories['categories_id'], 'text' => $category['categories_name']);
+          if ( (tep_not_null($category['parent_id'])) && ($category['parent_id'] != '0') ) $categories_array = tep_generate_category_path($category['parent_id'], 'category', $categories_array, $index);
+          $categories_array[$index] = array_reverse($categories_array[$index]);
+        }
+        $index++;
+      }
+    } elseif ($from == 'category') {
+      $category_query = tep_db_query("select cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
+      $category = tep_db_fetch_array($category_query);
+      $categories_array[$index][] = array('id' => $id, 'text' => $category['categories_name']);
+      if ( (tep_not_null($category['parent_id'])) && ($category['parent_id'] != '0') ) $categories_array = tep_generate_category_path($category['parent_id'], 'category', $categories_array, $index);
+    }
+
+    return $categories_array;
+  }
+
+  function tep_output_generated_category_path($id, $from = 'category') {
+    $calculated_category_path_string = '';
+    $calculated_category_path = tep_generate_category_path($id, $from);
+    for ($i=0, $n=sizeof($calculated_category_path); $i<$n; $i++) {
+      for ($j=0, $k=sizeof($calculated_category_path[$i]); $j<$k; $j++) {
+        $calculated_category_path_string .= $calculated_category_path[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
+      }
+      $calculated_category_path_string = substr($calculated_category_path_string, 0, -16) . '<br>';
+    }
+    $calculated_category_path_string = substr($calculated_category_path_string, 0, -4);
+
+    if (strlen($calculated_category_path_string) < 1) $calculated_category_path_string = TEXT_TOP;
+
+    return $calculated_category_path_string;
+  }
+
+  function tep_get_generated_category_path_ids($id, $from = 'category') {
+    $calculated_category_path_string = '';
+    $calculated_category_path = tep_generate_category_path($id, $from);
+    for ($i=0, $n=sizeof($calculated_category_path); $i<$n; $i++) {
+      for ($j=0, $k=sizeof($calculated_category_path[$i]); $j<$k; $j++) {
+        $calculated_category_path_string .= $calculated_category_path[$i][$j]['id'] . '_';
+      }
+      $calculated_category_path_string = substr($calculated_category_path_string, 0, -1) . '<br>';
+    }
+    $calculated_category_path_string = substr($calculated_category_path_string, 0, -4);
+
+    if (strlen($calculated_category_path_string) < 1) $calculated_category_path_string = TEXT_TOP;
+
+    return $calculated_category_path_string;
+  }
+
+  function tep_remove_category($category_id) {
+    $category_image_query = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+    $category_image = tep_db_fetch_array($category_image_query);
+
+    $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where categories_image = '" . tep_db_input($category_image['categories_image']) . "'");
+    $duplicate_image = tep_db_fetch_array($duplicate_image_query);
+
+    if ($duplicate_image['total'] < 2) {
+      if (file_exists(DIR_FS_CATALOG_IMAGES . $category_image['categories_image'])) {
+        @unlink(DIR_FS_CATALOG_IMAGES . $category_image['categories_image']);
+      }
+    }
+
+    tep_db_query("delete from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+
+    if (USE_CACHE == 'true') {
+      tep_reset_cache_block('categories');
+      tep_reset_cache_block('also_purchased');
+    }
+  }
+
+  function tep_remove_product($product_id) {
+    $product_image_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
+    $product_image = tep_db_fetch_array($product_image_query);
+
+    $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " where products_image = '" . tep_db_input($product_image['products_image']) . "'");
+    $duplicate_image = tep_db_fetch_array($duplicate_image_query);
+
+    if ($duplicate_image['total'] < 2) {
+      if (file_exists(DIR_FS_CATALOG_IMAGES . $product_image['products_image'])) {
+        @unlink(DIR_FS_CATALOG_IMAGES . $product_image['products_image']);
+      }
+    }
+
+    tep_db_query("delete from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
+    
+// Eversun mod for sppc and qty price breaks    
+    tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$product_id . "'");
+// Eversun mod end for sppc and qty price breaks
+    
+    tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'");
+// START: Extra Fields Contribution  DMG
+    tep_db_query("delete from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = " . (int)$product_id);
+// END: Extra Fields Contribution
+    $product_reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where products_id = '" . (int)$product_id . "'");
+    while ($product_reviews = tep_db_fetch_array($product_reviews_query)) {
+      tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$product_reviews['reviews_id'] . "'");
+    }
+    tep_db_query("delete from " . TABLE_REVIEWS . " where products_id = '" . (int)$product_id . "'");
+
+    if (USE_CACHE == 'true') {
+      tep_reset_cache_block('categories');
+      tep_reset_cache_block('also_purchased');
+    }
+  }
+
+  function tep_remove_order($order_id, $restock) {
+    if ($restock == 'on') {
+      $order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
+      while ($order = tep_db_fetch_array($order_query)) {
+        tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . " where products_id = '" . (int)$order['products_id'] . "'");
+      }
+    }
+
+    //begin PayPal_Shopping_Cart_IPN 2.8 DMG
+ include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/functions/general.func.php');
+    paypal_remove_order($order_id);
+//end PayPal_Shopping_Cart_IPN
+    tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$order_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "'");
+  }
+
+  function tep_reset_cache_block($cache_block) {
+    global $cache_blocks;
+$dir_cache = DIR_FS_CATALOG . DIR_FS_CACHE ;
+   // get default template
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+     $template_query = tep_db_query("select template_name from " . TABLE_TEMPLATE . "  order by template_name");
+      while ($template = tep_db_fetch_array($template_query)) {
+        $template_array=array(template=>template_name);
+        }
+
+    
+    for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) {
+      if ($cache_blocks[$i]['code'] == $cache_block) {
+        if ($cache_blocks[$i]['multiple']) {
+          if ($dir = @opendir($dir_cache)) {
+            while ($cache_file = readdir($dir)) {
+              $cached_file = $cache_blocks[$i]['file'];
+              $languages = tep_get_languages();
+              for ($j=0, $k=sizeof($languages); $j<$k; $j++) {
+                $cached_file_unlink = ereg_replace('-language', '-' . $languages[$j]['directory'], $cached_file);
+                
+                              for ($j=0, $k=sizeof($template_array); $j<$k; $j++) {
+                    $cached_file_unlink = ereg_replace('-TEMPLATE_NAME', '-' . $template_array[$j]['template_name'] , $cached_file);
+              
+                
+                if (ereg('^' . $cached_file_unlink, $cache_file)) {
+                  @unlink($dir_cache . $cache_file);
+                  }
+                }
+              }
+            } 
+            closedir($dir);
+          }
+        } else {
+          $cached_file = $cache_blocks[$i]['file'];
+          $languages = tep_get_languages();
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+            $cached_file = ereg_replace('-language', '-' . $languages[$i]['directory'], $cached_file);
+            @unlink(DIR_FS_CACHE . $cached_file);
+          }
+        }
+        break;
+      }
+    }
+  }
+
+  function tep_get_file_permissions($mode) {
+// determine type
+    if ( ($mode & 0xC000) == 0xC000) { // unix domain socket
+      $type = 's';
+    } elseif ( ($mode & 0x4000) == 0x4000) { // directory
+      $type = 'd';
+    } elseif ( ($mode & 0xA000) == 0xA000) { // symbolic link
+      $type = 'l';
+    } elseif ( ($mode & 0x8000) == 0x8000) { // regular file
+      $type = '-';
+    } elseif ( ($mode & 0x6000) == 0x6000) { //bBlock special file
+      $type = 'b';
+    } elseif ( ($mode & 0x2000) == 0x2000) { // character special file
+      $type = 'c';
+    } elseif ( ($mode & 0x1000) == 0x1000) { // named pipe
+      $type = 'p';
+    } else { // unknown
+      $type = '?';
+    }
+
+// determine permissions
+    $owner['read']    = ($mode & 00400) ? 'r' : '-';
+    $owner['write']   = ($mode & 00200) ? 'w' : '-';
+    $owner['execute'] = ($mode & 00100) ? 'x' : '-';
+    $group['read']    = ($mode & 00040) ? 'r' : '-';
+    $group['write']   = ($mode & 00020) ? 'w' : '-';
+    $group['execute'] = ($mode & 00010) ? 'x' : '-';
+    $world['read']    = ($mode & 00004) ? 'r' : '-';
+    $world['write']   = ($mode & 00002) ? 'w' : '-';
+    $world['execute'] = ($mode & 00001) ? 'x' : '-';
+
+// adjust for SUID, SGID and sticky bit
+    if ($mode & 0x800 ) $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S';
+    if ($mode & 0x400 ) $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S';
+    if ($mode & 0x200 ) $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T';
+
+    return $type .
+           $owner['read'] . $owner['write'] . $owner['execute'] .
+           $group['read'] . $group['write'] . $group['execute'] .
+           $world['read'] . $world['write'] . $world['execute'];
+  }
+
+  function tep_remove($source) {
+    global $messageStack, $tep_remove_error;
+
+    if (isset($tep_remove_error)) $tep_remove_error = false;
+
+    if (is_dir($source)) {
+      $dir = dir($source);
+      while ($file = $dir->read()) {
+        if ( ($file != '.') && ($file != '..') ) {
+          if (is_writeable($source . '/' . $file)) {
+            tep_remove($source . '/' . $file);
+          } else {
+            $messageStack->add('search', sprintf(ERROR_FILE_NOT_REMOVEABLE, $source . '/' . $file), 'error');
+            $tep_remove_error = true;
+          }
+        }
+      }
+      $dir->close();
+
+      if (is_writeable($source)) {
+        rmdir($source);
+      } else {
+        $messageStack->add('search', sprintf(ERROR_DIRECTORY_NOT_REMOVEABLE, $source), 'error');
+        $tep_remove_error = true;
+      }
+    } else {
+      if (is_writeable($source)) {
+        unlink($source);
+      } else {
+        $messageStack->add('search', sprintf(ERROR_FILE_NOT_REMOVEABLE, $source), 'error');
+        $tep_remove_error = true;
+      }
+    }
+  }
+
+////
+// Output the tax percentage with optional padded decimals
+  function tep_display_tax_value($value, $padding = TAX_DECIMAL_PLACES) {
+    if (strpos($value, '.')) {
+      $loop = true;
+      while ($loop) {
+        if (substr($value, -1) == '0') {
+          $value = substr($value, 0, -1);
+        } else {
+          $loop = false;
+          if (substr($value, -1) == '.') {
+            $value = substr($value, 0, -1);
+          }
+        }
+      }
+    }
+
+    if ($padding > 0) {
+      if ($decimal_pos = strpos($value, '.')) {
+        $decimals = strlen(substr($value, ($decimal_pos+1)));
+        for ($i=$decimals; $i<$padding; $i++) {
+          $value .= '0';
+        }
+      } else {
+        $value .= '.';
+        for ($i=0; $i<$padding; $i++) {
+          $value .= '0';
+        }
+      }
+    }
+
+    return $value;
+  }
+
+  function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) {
+    if (SEND_EMAILS != 'true') return false;
+
+    // Instantiate a new mail object
+    $message = new email(array('X-Mailer: osCommerce'));
+
+    // Build the text version
+    $text = strip_tags($email_text);
+    if (EMAIL_USE_HTML == 'true') {
+      $message->add_html($email_text, $text);
+    } else {
+      $message->add_text($text);
+    }
+
+    // Send message
+    $message->build_message();
+    $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
+  }
+
+  function tep_get_tax_class_title($tax_class_id) {
+    if ($tax_class_id == '0') {
+      return TEXT_NONE;
+    } else {
+      $classes_query = tep_db_query("select tax_class_title from " . TABLE_TAX_CLASS . " where tax_class_id = '" . (int)$tax_class_id . "'");
+      $classes = tep_db_fetch_array($classes_query);
+
+      return $classes['tax_class_title'];
+    }
+  }
+
+  function tep_banner_image_extension() {
+    if (function_exists('imagetypes')) {
+      if (imagetypes() & IMG_PNG) {
+        return 'png';
+      } elseif (imagetypes() & IMG_JPG) {
+        return 'jpg';
+      } elseif (imagetypes() & IMG_GIF) {
+        return 'gif';
+      }
+    } elseif (function_exists('imagecreatefrompng') && function_exists('imagepng')) {
+      return 'png';
+    } elseif (function_exists('imagecreatefromjpeg') && function_exists('imagejpeg')) {
+      return 'jpg';
+    } elseif (function_exists('imagecreatefromgif') && function_exists('imagegif')) {
+      return 'gif';
+    }
+
+    return false;
+  }
+
+////
+// Wrapper function for round() for php3 compatibility
+  function tep_round($value, $precision) {
+    if (PHP_VERSION < 4) {
+      $exp = pow(10, $precision);
+      return round($value * $exp) / $exp;
+    } else {
+      return round($value, $precision);
+    }
+  }
+
+////
+// Add tax to a products price
+  function tep_add_tax($price, $tax) {
+    global $currencies;
+
+    if (DISPLAY_PRICE_WITH_TAX == 'true') {
+      return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax);
+    } else {
+      return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
+    }
+  }
+
+// Calculates Tax rounding the result
+  function tep_calculate_tax($price, $tax) {
+    global $currencies;
+
+    return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
+  }
+
+////
+// Returns the tax rate for a zone / class
+// TABLES: tax_rates, zones_to_geo_zones
+  function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
+    global $customer_zone_id, $customer_country_id;
+
+    if ( ($country_id == -1) && ($zone_id == -1) ) {
+      if (!tep_session_is_registered('customer_id')) {
+        $country_id = STORE_COUNTRY;
+        $zone_id = STORE_ZONE;
+      } else {
+        $country_id = $customer_country_id;
+        $zone_id = $customer_zone_id;
+      }
+    }
+
+    $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za ON tr.tax_zone_id = za.geo_zone_id left join " . TABLE_GEO_ZONES . " tz ON tz.geo_zone_id = tr.tax_zone_id WHERE (za.zone_country_id IS NULL OR za.zone_country_id = '0' OR za.zone_country_id = '" . (int)$country_id . "') AND (za.zone_id IS NULL OR za.zone_id = '0' OR za.zone_id = '" . (int)$zone_id . "') AND tr.tax_class_id = '" . (int)$class_id . "' GROUP BY tr.tax_priority");
+    if (tep_db_num_rows($tax_query)) {
+      $tax_multiplier = 0;
+      while ($tax = tep_db_fetch_array($tax_query)) {
+        $tax_multiplier += $tax['tax_rate'];
+      }
+      return $tax_multiplier;
+    } else {
+      return 0;
+    }
+  }
+
+////
+// Returns the tax rate for a tax class
+// TABLES: tax_rates
+  function tep_get_tax_rate_value($class_id) {
+    $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " where tax_class_id = '" . (int)$class_id . "' group by tax_priority");
+    if (tep_db_num_rows($tax_query)) {
+      $tax_multiplier = 0;
+      while ($tax = tep_db_fetch_array($tax_query)) {
+        $tax_multiplier += $tax['tax_rate'];
+      }
+      return $tax_multiplier;
+    } else {
+      return 0;
+    }
+  }
+
+  function tep_call_function($function, $parameter, $object = '') {
+    if ($object == '') {
+      return call_user_func($function, $parameter);
+    } elseif (PHP_VERSION < 4) {
+      return call_user_method($function, $object, $parameter);
+    } else {
+      return call_user_func(array($object, $function), $parameter);
+    }
+  }
+
+  function tep_get_zone_class_title($zone_class_id) {
+    if ($zone_class_id == '0') {
+      return TEXT_NONE;
+    } else {
+      $classes_query = tep_db_query("select geo_zone_name from " . TABLE_GEO_ZONES . " where geo_zone_id = '" . (int)$zone_class_id . "'");
+      $classes = tep_db_fetch_array($classes_query);
+
+      return $classes['geo_zone_name'];
+    }
+  }
+
+  function tep_cfg_pull_down_zone_classes($zone_class_id, $key = '') {
+    $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+    $zone_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
+    $zone_class_query = tep_db_query("select geo_zone_id, geo_zone_name from " . TABLE_GEO_ZONES . " order by geo_zone_name");
+    while ($zone_class = tep_db_fetch_array($zone_class_query)) {
+      $zone_class_array[] = array('id' => $zone_class['geo_zone_id'],
+                                  'text' => $zone_class['geo_zone_name']);
+    }
+
+    return tep_draw_pull_down_menu($name, $zone_class_array, $zone_class_id);
+  }
+
+  function tep_cfg_pull_down_order_statuses($order_status_id, $key = '') {
+    global $languages_id;
+
+    $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+    $statuses_array = array(array('id' => '0', 'text' => TEXT_DEFAULT));
+    $statuses_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "' order by orders_status_name");
+    while ($statuses = tep_db_fetch_array($statuses_query)) {
+      $statuses_array[] = array('id' => $statuses['orders_status_id'],
+                                'text' => $statuses['orders_status_name']);
+    }
+
+    return tep_draw_pull_down_menu($name, $statuses_array, $order_status_id);
+  }
+
+  function tep_get_order_status_name($order_status_id, $language_id = '') {
+    global $languages_id;
+
+    if ($order_status_id < 1) return TEXT_DEFAULT;
+
+    if (!is_numeric($language_id)) $language_id = $languages_id;
+
+    $status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . (int)$order_status_id . "' and language_id = '" . (int)$language_id . "'");
+    $status = tep_db_fetch_array($status_query);
+
+    return $status['orders_status_name'];
+  }
+
+////
+// Return a random value
+  function tep_rand($min = null, $max = null) {
+    static $seeded;
+
+    if (!$seeded) {
+      mt_srand((double)microtime()*1000000);
+      $seeded = true;
+    }
+
+    if (isset($min) && isset($max)) {
+      if ($min >= $max) {
+        return $min;
+      } else {
+        return mt_rand($min, $max);
+      }
+    } else {
+      return mt_rand();
+    }
+  }
+
+// nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n)
+  function tep_convert_linefeeds($from, $to, $string) {
+    if ((PHP_VERSION < "4.0.5") && is_array($from)) {
+      return ereg_replace('(' . implode('|', $from) . ')', $to, $string);
+    } else {
+      return str_replace($from, $to, $string);
+    }
+  }
+
+  function tep_string_to_int($string) {
+    return (int)$string;
+  }
+
+////
+// Parse and secure the cPath parameter values
+  function tep_parse_category_path($cPath) {
+// make sure the category IDs are integers
+    $cPath_array = array_map('tep_string_to_int', explode('_', $cPath));
+
+// make sure no duplicate category IDs exist which could lock the server in a loop
+    $tmp_array = array();
+    $n = sizeof($cPath_array);
+    for ($i=0; $i<$n; $i++) {
+      if (!in_array($cPath_array[$i], $tmp_array)) {
+        $tmp_array[] = $cPath_array[$i];
+      }
+    }
+
+    return $tmp_array;
+  }
+// Alias function for array of configuration values in the Administration Tool
+/*  function tep_cfg_select_multioption($select_array, $key_value, $key = '') {
+    for ($i=0; $i<sizeof($select_array); $i++) {
+      $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+      $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+      $key_values = explode( ", ", $key_value);
+      if ( in_array($select_array[$i], $key_values) ) $string .= 'CHECKED';
+      $string .= '> ' . $select_array[$i];
+    }
+    return $string;
+  }*/
+  
+//create a select list to display list of themes available for selection
+  function tep_cfg_pull_down_template_list($template_id, $key = '') {
+    $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+    $template_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " order by template_name");
+    while ($template = tep_db_fetch_array($template_query)) {
+      $template_array[] = array('id' => $template['template_name'],
+                                 'text' => $template['template_name']);
+    }
+
+    return tep_draw_pull_down_menu($name, $template_array, $template_id);
+  }
+
+
+// BOF: WebMakers.com Added: Downloads Controller
+require(DIR_WS_FUNCTIONS . 'downloads_controller.php');
+// EOF: WebMakers.com Added: Downloads Controller
+
+// Contact US Email Subjects : DMG
+// PassionSeed Contact Us Email Subject begin
+  function tep_get_email_subjects_list($subjects_array = '') {
+    if (!is_array($subjects_array)) $subjects_array = array();
+
+    $subjects_query = tep_db_query("select email_subjects_id, email_subjects_name from " . TABLE_EMAIL_SUBJECTS . " order by email_subjects_name");
+    while ($subjects = tep_db_fetch_array($subjects_query)) {
+      $subjects_array[] = array('id' => $subjects['email_subjects_name'], 'text' => $subjects['email_subjects_name']);
+    }
+
+    return $subjects_array;
+  }
+// PassionSeed Contact Us Email Subject end
+function tep_get_pay_method($pay_methods_id, $language_id = '') {
+    global $languages_id;
+
+    if (!$language_id) $language_id = $languages_id;
+    $pay_method_query1 = tep_db_query("select pay_method from " . TABLE_ORDERS_PAY_METHODS . " where pay_methods_id = '" . (int)$pay_methods_id . "' and pay_method_language = '" . (int)$language_id . "'");
+    $pay_method1 = tep_db_fetch_array($pay_method_query1);
+
+    return $pay_method1['pay_method'];
+  }
+function tep_get_ship_method($ship_methods_id, $language_id = '') {
+    global $languages_id;
+
+    if (!$language_id) $language_id = $languages_id;
+    $ship_method_query1 = tep_db_query("select ship_method from " . TABLE_ORDERS_SHIP_METHODS . " where ship_methods_id = '" . (int)$ship_methods_id . "' and ship_method_language = '" . (int)$language_id . "'");
+    $ship_method1 = tep_db_fetch_array($ship_method_query1);
+
+    return $ship_method1['ship_method'];
+  }
+
+  function tep_get_ip_address() {
+    if (isset($_SERVER)) {
+      if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+      } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
+        $ip = $_SERVER['HTTP_CLIENT_IP'];
+      } else {
+        $ip = $_SERVER['REMOTE_ADDR'];
+      }
+    } else {
+      if (getenv('HTTP_X_FORWARDED_FOR')) {
+        $ip = getenv('HTTP_X_FORWARDED_FOR');
+      } elseif (getenv('HTTP_CLIENT_IP')) {
+        $ip = getenv('HTTP_CLIENT_IP');
+      } else {
+        $ip = getenv('REMOTE_ADDR');
+      }
+    }
+
+    return $ip;
+  }
+
+  
+function tep_get_box_heading($infobox_id, $languages_id) {
+    $configuration_query12 = tep_db_query("select box_heading from " . TABLE_INFOBOX_HEADING . " where infobox_id = '" . (int)$infobox_id . "' and languages_id = '" . (int)$languages_id . "'");
+    $configuration12 = tep_db_fetch_array($configuration_query12);
+
+    return $configuration12['box_heading'];
+  }
+  
+/*function tep_cfg_select_multioption($select_array, $key_value, $key = '') {
+    for ($i=0; $i<sizeof($select_array); $i++) {
+      $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+      $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+      $key_values = explode( ", ", $key_value);
+      if ( in_array($select_array[$i], $key_values) ) $string .= 'CHECKED';
+      $string .= '> ' . $select_array[$i];
+    } 
+    return $string;
+  }*/
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/general.php.orig
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/general.php.orig	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/general.php.orig	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1668 @@
+<?php
+/*
+  $Id: general.php,v 1.1.1.1 2004/03/04 23:39:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Chain Reaction Works, Inc
+  Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3455 $
+
+  Released under the GNU General Public License
+*/
+
+function tep_return_broken($bad_string) {
+  $char_count = 35;
+  $formatted_string = '';
+  $countbefore = 0;
+  $i = 0;
+  while ($i < strlen($bad_string)) {
+    $formatted_string .= $bad_string[$i];
+    $countbefore ++;
+    if ($countbefore > $char_count) {
+      $formatted_string .= chr(13);
+      $countbefore = 0;
+    }
+    $i ++;
+  } // End of while loop on strlen of bad string
+  return $formatted_string;
+}
+
+////
+// Stop from parsing any further PHP code
+  function tep_exit() {
+   tep_session_close();
+   exit();
+  }
+
+
+// Redirect to another page or site
+  function tep_redirect($url) {
+    if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) { 
+      tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
+    }
+
+    if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page
+      if (substr($url, 0, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)) == HTTP_SERVER . DIR_WS_HTTP_CATALOG) { // NONSSL url
+        $url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL
+      }
+    }
+
+    header('Location: ' . $url);
+
+   tep_exit();
+  }
+
+//Admin begin
+////
+//Check login and file access
+function tep_admin_check_login() {
+  global $PHP_SELF, $login_groups_id;
+  if (!tep_session_is_registered('login_id')) {
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  } else {
+    // if they are in group 1, let them do whatever they need to do
+    if ( $login_groups_id != 1 ) {
+      $filename = basename( $PHP_SELF );
+      if ($filename != FILENAME_DEFAULT && $filename != FILENAME_FORBIDEN && $filename != FILENAME_LOGOFF && $filename != FILENAME_ADMIN_ACCOUNT && $filename != FILENAME_POPUP_IMAGE && $filename != 'packingslip.php' && $filename != 'invoice.php') {
+        $db_file_query = tep_db_query("select admin_files_name from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_name = '" . $filename . "'");
+        if (!tep_db_num_rows($db_file_query)) {
+          tep_redirect(tep_href_link(FILENAME_FORBIDEN));
+        }
+      }
+    }
+  }
+}
+
+////
+//Return 'true' or 'false' value to display boxes and files in index.php and column_left.php
+function tep_admin_check_boxes($filename, $boxes='') {
+  global $login_groups_id;
+
+  $is_boxes = 1;
+  if ($boxes == 'sub_boxes') {
+    $is_boxes = 0;
+  }
+  $dbquery = tep_db_query("select admin_files_id from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '" . $is_boxes . "' and admin_files_name = '" . $filename . "'");
+
+  $return_value = false;
+  if (tep_db_num_rows($dbquery)) {
+    $return_value = true;
+  }
+  return $return_value;
+}
+
+////
+//Return files stored in box that can be accessed by user
+function tep_admin_files_boxes ($filename = '', $sub_box_name = '', $connection = 'NONSSL', $parameters = '', $space = '') {
+  global $login_groups_id, $request_type, $spaces1;
+  $sub_boxes = '';
+  $spaces1= '';
+
+ if (MENU_DHTML != 'True') { // We don't need spaces when DHTML menu is ON
+  for ($i=0, $n=$space; $i<$n; $i++) {
+  $spaces1 .= '&nbsp;';
+  }
+} // We don't need spaces when DHTML menu is ON
+//    $connection = 'NONSSL';
+
+if ($filename != '' ){
+  $dbquery = tep_db_query("select admin_files_name from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '0' and admin_files_name = '" . $filename . "'");
+  if (tep_db_num_rows($dbquery)) {
+     $sub_boxes = $spaces1 . '<a href="' . tep_href_link($filename, $parameters, $connection) . '" class="menuBoxContentLink"><nobr>' . $sub_box_name . '</nobr></a><br>';
+     } else if ( (tep_db_num_rows($dbquery)) || ($connection == '') ) {
+     $sub_boxes = $spaces1 . '<a href="' . tep_href_link($filename, $parameters, $connection) . '" class="menuBoxContentLink"><nobr>' . $sub_box_name . '</nobr></a><br>';
+    }
+  } else  if ($filename == ''){
+      $sub_boxes = $spaces1 .  '<class="menuBoxHeadLink"><b><nobr>' . $sub_box_name . '</nobr></b><br>';
+   } else {
+        $sub_boxes = $spaces1 .  '<class="menuBoxHeadLink"><nobr>' . $sub_box_name . '</nobr><br>';
+    }
+  return $sub_boxes;
+}
+
+////
+//Get selected file for index.php
+function tep_selected_file($filename) {
+  global $login_groups_id;
+  $randomize = FILENAME_ADMIN_ACCOUNT;
+
+  $dbquery = tep_db_query("select admin_files_id as boxes_id from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '1' and admin_files_name = '" . $filename . "'");
+  if (tep_db_num_rows($dbquery)) {
+    $boxes_id = tep_db_fetch_array($dbquery);
+    $randomize_query = tep_db_query("select admin_files_name from " . TABLE_ADMIN_FILES . " where FIND_IN_SET( '" . $login_groups_id . "', admin_groups_id) and admin_files_is_boxes = '0' and admin_files_to_boxes = '" . $boxes_id['boxes_id'] . "'");
+    if (tep_db_num_rows($randomize_query)) {
+      $file_selected = tep_db_fetch_array($randomize_query);
+      $randomize = $file_selected['admin_files_name'];
+    }
+  }
+  return $randomize;
+}
+//Admin end
+
+
+////
+// Parse the data used in the html tags to ensure the tags will not break
+  function tep_parse_input_field_data($data, $parse) {
+    return strtr(trim($data), $parse);
+  }
+
+  function tep_output_string($string, $translate = false, $protected = false) {
+    if ($protected == true) {
+      return htmlspecialchars($string);
+    } else {
+      if ($translate == false) {
+        return tep_parse_input_field_data($string, array('"' => '&quot;'));
+      } else {
+        return tep_parse_input_field_data($string, $translate);
+      }
+    }
+  }
+
+  function tep_output_string_protected($string) {
+    return tep_output_string($string, false, true);
+  }
+
+  function tep_sanitize_string($string) {
+    $string = ereg_replace(' +', ' ', $string);
+
+    return preg_replace("/[<>]/", '_', $string);
+  }
+
+  function tep_customers_name($customers_id) {
+    $customers = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customers_id . "'");
+    $customers_values = tep_db_fetch_array($customers);
+
+    return $customers_values['customers_firstname'] . ' ' . $customers_values['customers_lastname'];
+  }
+
+  function tep_get_path($current_category_id = '') {
+    global $cPath_array;
+
+    if ($current_category_id == '') {
+      $cPath_new = implode('_', $cPath_array);
+    } else {
+      if (sizeof($cPath_array) == 0) {
+        $cPath_new = $current_category_id;
+      } else {
+        $cPath_new = '';
+        $last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$cPath_array[(sizeof($cPath_array)-1)] . "'");
+        $last_category = tep_db_fetch_array($last_category_query);
+
+        $current_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
+        $current_category = tep_db_fetch_array($current_category_query);
+
+        if ($last_category['parent_id'] == $current_category['parent_id']) {
+          for ($i = 0, $n = sizeof($cPath_array) - 1; $i < $n; $i++) {
+            $cPath_new .= '_' . $cPath_array[$i];
+          }
+        } else {
+          for ($i = 0, $n = sizeof($cPath_array); $i < $n; $i++) {
+            $cPath_new .= '_' . $cPath_array[$i];
+          }
+        }
+
+        $cPath_new .= '_' . $current_category_id;
+
+        if (substr($cPath_new, 0, 1) == '_') {
+          $cPath_new = substr($cPath_new, 1);
+        }
+      }
+    }
+
+    return 'cPath=' . $cPath_new;
+  }
+
+  function tep_get_all_get_params($exclude_array = '') {
+    global $HTTP_GET_VARS;
+
+    if ($exclude_array == '') $exclude_array = array();
+
+    $get_url = '';
+
+    reset($HTTP_GET_VARS);
+    while (list($key, $value) = each($HTTP_GET_VARS)) {
+      if (($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array))) $get_url .= $key . '=' . $value . '&';
+    }
+
+    return $get_url;
+  }
+
+  function tep_date_long($raw_date) {
+    if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;
+
+    $year = (int)substr($raw_date, 0, 4);
+    $month = (int)substr($raw_date, 5, 2);
+    $day = (int)substr($raw_date, 8, 2);
+    $hour = (int)substr($raw_date, 11, 2);
+    $minute = (int)substr($raw_date, 14, 2);
+    $second = (int)substr($raw_date, 17, 2);
+
+    return strftime(DATE_FORMAT_LONG, mktime($hour, $minute, $second, $month, $day, $year));
+  }
+
+////
+// Output a raw date string in the selected locale date format
+// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
+// NOTE: Includes a workaround for dates before 01/01/1970 that fail on windows servers
+  function tep_date_short($raw_date) {
+    if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;
+
+    $year = substr($raw_date, 0, 4);
+    $month = (int)substr($raw_date, 5, 2);
+    $day = (int)substr($raw_date, 8, 2);
+    $hour = (int)substr($raw_date, 11, 2);
+    $minute = (int)substr($raw_date, 14, 2);
+    $second = (int)substr($raw_date, 17, 2);
+
+    if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
+      return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
+    } else {
+      return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
+    }
+
+  }
+
+  function tep_datetime_short($raw_datetime) {
+    if ( ($raw_datetime == '0000-00-00 00:00:00') || ($raw_datetime == '') ) return false;
+
+    $year = (int)substr($raw_datetime, 0, 4);
+    $month = (int)substr($raw_datetime, 5, 2);
+    $day = (int)substr($raw_datetime, 8, 2);
+    $hour = (int)substr($raw_datetime, 11, 2);
+    $minute = (int)substr($raw_datetime, 14, 2);
+    $second = (int)substr($raw_datetime, 17, 2);
+
+    return strftime(DATE_TIME_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
+  }
+
+  function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
+    global $languages_id;
+
+    if (!is_array($category_tree_array)) $category_tree_array = array();
+    if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
+
+    if ($include_itself) {
+      $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'");
+      $category = tep_db_fetch_array($category_query);
+      $category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);
+    }
+
+    $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name");
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      if ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']);
+      $category_tree_array = tep_get_category_tree($categories['categories_id'], $spacing . '&nbsp;&nbsp;&nbsp;', $exclude, $category_tree_array);
+    }
+
+    return $category_tree_array;
+  }
+
+  function tep_draw_products_pull_down($name, $parameters = '', $exclude = '') {
+    global $currencies, $languages_id;
+
+    if ($exclude == '') {
+      $exclude = array();
+    }
+
+    $select_string = '<select name="' . $name . '"';
+
+    if ($parameters) {
+      $select_string .= ' ' . $parameters;
+    }
+
+    $select_string .= '>';
+
+// Eversun mod for sppc and qty price breaks
+      $all_groups=array();
+      $customers_groups_query = tep_db_query("select customers_group_name, customers_group_id from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
+      while ($existing_groups =  tep_db_fetch_array($customers_groups_query)) {
+          $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
+      }
+// Eversun mod end for sppc and qty price breaks
+
+    $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");
+    while ($products = tep_db_fetch_array($products_query)) {
+
+// Eversun mod for sppc and qty price breaks
+/*      if (!in_array($products['products_id'], $exclude)) {
+        $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>'; */
+    if (!in_array($products['products_id'], $exclude)) {
+       $price_query=tep_db_query("select customers_group_price, customers_group_id from " . TABLE_PRODUCTS_GROUPS . " where products_id = " . $products['products_id']);
+       $product_prices=array();
+       while($prices_array=tep_db_fetch_array($price_query)){
+         $product_prices[$prices_array['customers_group_id']]=$prices_array['customers_group_price'];
+       }
+       reset($all_groups);
+       $price_string="";
+       $sde=0;
+       while(list($sdek,$sdev)=each($all_groups)){
+         if (!in_array((int)$products['products_id'].":".(int)$sdek, $exclude)) {
+           if($sde)
+            $price_string.=", ";
+            $price_string.=$sdev.": ".$currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek]:$products['products_price']);
+            $sde=1;
+           }
+         }
+         $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $price_string . ')</option>\n';
+       }
+// Eversun mod end for sppc and qty price breaks
+
+ }
+
+    $select_string .= '</select>';
+
+    return $select_string;
+  }
+
+  function tep_options_name($options_id) {
+    global $languages_id;
+
+    $options = tep_db_query("select products_options_name from " . TABLE_PRODUCTS_OPTIONS_TEXT . " where products_options_text_id = '" . (int)$options_id . "' and language_id = '" . (int)$languages_id . "'");
+    $options_values = tep_db_fetch_array($options);
+
+    return $options_values['products_options_name'];
+  }
+
+  function tep_values_name($values_id) {
+    global $languages_id;
+
+    $values = tep_db_query("select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$values_id . "' and language_id = '" . (int)$languages_id . "'");
+    $values_values = tep_db_fetch_array($values);
+
+    return $values_values['products_options_values_name'];
+  }
+
+  function tep_info_image($image, $alt, $width = '', $height = '') {
+    if (tep_not_null($image) && (file_exists(DIR_FS_CATALOG_IMAGES . $image)) ) {
+      $image = tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $image, $alt, $width, $height);
+    } else {
+      $image = TEXT_IMAGE_NONEXISTENT;
+    }
+
+    return $image;
+  }
+
+  function tep_break_string($string, $len, $break_char = '-') {
+    $l = 0;
+    $output = '';
+    for ($i=0, $n=strlen($string); $i<$n; $i++) {
+      $char = substr($string, $i, 1);
+      if ($char != ' ') {
+        $l++;
+      } else {
+        $l = 0;
+      }
+      if ($l > $len) {
+        $l = 1;
+        $output .= $break_char;
+      }
+      $output .= $char;
+    }
+
+    return $output;
+  }
+
+  function tep_get_country_name($country_id) {
+    $country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'");
+
+    if (!tep_db_num_rows($country_query)) {
+      return $country_id;
+    } else {
+      $country = tep_db_fetch_array($country_query);
+      return $country['countries_name'];
+    }
+  }
+
+  function tep_get_zone_name($country_id, $zone_id, $default_zone) {
+    $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' and zone_id = '" . (int)$zone_id . "'");
+    if (tep_db_num_rows($zone_query)) {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_name'];
+    } else {
+      return $default_zone;
+    }
+  }
+
+  function tep_not_null($value) {
+    if (is_array($value)) {
+      if (sizeof($value) > 0) {
+        return true;
+      } else {
+        return false;
+      }
+    } else {
+      if ( (is_string($value) || is_int($value)) && ($value != '') && ($value != 'NULL') && (strlen(trim($value)) > 0)) {
+        return true;
+      } else {
+        return false;
+      }
+    }
+  }
+
+  function tep_browser_detect($component) {
+    global $HTTP_USER_AGENT;
+
+    return stristr($HTTP_USER_AGENT, $component);
+  }
+
+  function tep_tax_classes_pull_down($parameters, $selected = '') {
+    $select_string = '<select ' . $parameters . '>';
+    $classes_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
+    while ($classes = tep_db_fetch_array($classes_query)) {
+      $select_string .= '<option value="' . $classes['tax_class_id'] . '"';
+      if ($selected == $classes['tax_class_id']) $select_string .= ' SELECTED';
+      $select_string .= '>' . $classes['tax_class_title'] . '</option>';
+    }
+    $select_string .= '</select>';
+
+    return $select_string;
+  }
+
+  function tep_geo_zones_pull_down($parameters, $selected = '') {
+    $select_string = '<select ' . $parameters . '>';
+    $zones_query = tep_db_query("select geo_zone_id, geo_zone_name from " . TABLE_GEO_ZONES . " order by geo_zone_name");
+    while ($zones = tep_db_fetch_array($zones_query)) {
+      $select_string .= '<option value="' . $zones['geo_zone_id'] . '"';
+      if ($selected == $zones['geo_zone_id']) $select_string .= ' SELECTED';
+      $select_string .= '>' . $zones['geo_zone_name'] . '</option>';
+    }
+    $select_string .= '</select>';
+
+    return $select_string;
+  }
+
+  function tep_get_geo_zone_name($geo_zone_id) {
+    $zones_query = tep_db_query("select geo_zone_name from " . TABLE_GEO_ZONES . " where geo_zone_id = '" . (int)$geo_zone_id . "'");
+
+    if (!tep_db_num_rows($zones_query)) {
+      $geo_zone_name = $geo_zone_id;
+    } else {
+      $zones = tep_db_fetch_array($zones_query);
+      $geo_zone_name = $zones['geo_zone_name'];
+    }
+
+    return $geo_zone_name;
+  }
+
+  function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
+    $address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
+    $address_format = tep_db_fetch_array($address_format_query);
+
+    $company = tep_output_string_protected($address['company']);
+    if (isset($address['firstname']) && tep_not_null($address['firstname'])) {
+      $firstname = tep_output_string_protected($address['firstname']);
+      $lastname = tep_output_string_protected($address['lastname']);
+    } elseif (isset($address['name']) && tep_not_null($address['name'])) {
+      $firstname = tep_output_string_protected($address['name']);
+      $lastname = '';
+    } else {
+      $firstname = '';
+      $lastname = '';
+    }
+    $street = tep_output_string_protected($address['street_address']);
+    $suburb = tep_output_string_protected($address['suburb']);
+    $city = tep_output_string_protected($address['city']);
+    $state = tep_output_string_protected($address['state']);
+    if (isset($address['country_id']) && tep_not_null($address['country_id'])) {
+      $country = tep_get_country_name($address['country_id']);
+
+      if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {
+        $state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);
+      }
+    } elseif (isset($address['country']) && tep_not_null($address['country'])) {
+      $country = tep_output_string_protected($address['country']);
+    } else {
+      $country = '';
+    }
+    $postcode = tep_output_string_protected($address['postcode']);
+    $zip = $postcode;
+
+    if ($html) {
+// HTML Mode
+      $HR = '<hr>';
+      $hr = '<hr>';
+      if ( ($boln == '') && ($eoln == "\n") ) { // Values not specified, use rational defaults
+        $CR = '<br>';
+        $cr = '<br>';
+        $eoln = $cr;
+      } else { // Use values supplied
+        $CR = $eoln . $boln;
+        $cr = $CR;
+      }
+    } else {
+// Text Mode
+      $CR = $eoln;
+      $cr = $CR;
+      $HR = '----------------------------------------';
+      $hr = '----------------------------------------';
+    }
+
+    $statecomma = '';
+    $streets = $street;
+    if ($suburb != '') $streets = $street . $cr . $suburb;
+    if ($country == '') $country = tep_output_string_protected($address['country']);
+    if ($state != '') $statecomma = $state . ', ';
+
+    $fmt = $address_format['format'];
+    eval("\$address = \"$fmt\";");
+
+    if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {
+      $address = $company . $cr . $address;
+    }
+
+    return $address;
+  }
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_get_zone_code
+  //
+  // Arguments   : country           country code string
+  //               zone              state/province zone_id
+  //               def_state         default string if zone==0
+  //
+  // Return      : state_prov_code   state/province code
+  //
+  // Description : Function to retrieve the state/province code (as in FL for Florida etc)
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_get_zone_code($country, $zone, $def_state) {
+
+    $state_prov_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and zone_id = '" . (int)$zone . "'");
+
+    if (!tep_db_num_rows($state_prov_query)) {
+      $state_prov_code = $def_state;
+    }
+    else {
+      $state_prov_values = tep_db_fetch_array($state_prov_query);
+      $state_prov_code = $state_prov_values['zone_code'];
+    }
+
+    return $state_prov_code;
+  }
+
+  function tep_get_uprid($prid, $params) {
+    $uprid = $prid;
+    if ( (is_array($params)) && (!strstr($prid, '{')) ) {
+      while (list($option, $value) = each($params)) {
+        $uprid = $uprid . '{' . $option . '}' . $value;
+      }
+    }
+
+    return $uprid;
+  }
+
+  function tep_get_prid($uprid) {
+    $pieces = explode('{', $uprid);
+
+    return $pieces[0];
+  }
+
+  function tep_get_languages() {
+    $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
+    while ($languages = tep_db_fetch_array($languages_query)) {
+      $languages_array[] = array('id' => $languages['languages_id'],
+                                 'name' => $languages['name'],
+                                 'code' => $languages['code'],
+                                 'image' => $languages['image'],
+                                 'directory' => $languages['directory']);
+    }
+
+    return $languages_array;
+  }
+
+  function tep_get_category_name($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_name'];
+  }
+
+    function tep_get_category_htc_title($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_head_title_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_head_title_tag'];
+  }
+    
+  function tep_get_category_htc_desc($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_head_desc_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_head_desc_tag'];
+  }
+   
+  function tep_get_category_htc_keywords($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_head_keywords_tag  from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_head_keywords_tag '];
+  }
+  
+  function tep_get_category_htc_description($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_htc_description'];
+  }
+  
+  function tep_get_orders_status_name($orders_status_id, $language_id = '') {
+    global $languages_id;
+
+    if (!$language_id) $language_id = $languages_id;
+    $orders_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . (int)$orders_status_id . "' and language_id = '" . (int)$language_id . "'");
+    $orders_status = tep_db_fetch_array($orders_status_query);
+
+    return $orders_status['orders_status_name'];
+  }
+
+  function tep_get_orders_status() {
+    global $languages_id;
+
+    $orders_status_array = array();
+    $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "' order by orders_status_id");
+    while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+      $orders_status_array[] = array('id' => $orders_status['orders_status_id'],
+                                     'text' => $orders_status['orders_status_name']);
+    }
+
+    return $orders_status_array;
+  }
+
+  function tep_get_products_name($product_id, $language_id = 0) {
+    global $languages_id;
+
+    if ($language_id == 0) $language_id = $languages_id;
+    $product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_name'];
+  }
+
+  function tep_get_infobox_file_name($infobox_id, $language_id = 0) {
+    global $languages_id;
+
+    if ($language_id == 0) $language_id = $languages_id;
+    $infobox_query = tep_db_query("select infobox_file_name from " . TABLE_INFOBOX_CONFIGURATION . " where infobox_id = '" . (int)$infobox_id . "' and language_id = '" . (int)$language_id . "'");
+    $infobox = tep_db_fetch_array($infobox_query);
+
+    return $infobox['infobox_file_name'];
+  }
+
+  function tep_get_products_description($product_id, $language_id) {
+    $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_description'];
+  }
+
+  function tep_get_products_head_title_tag($product_id, $language_id) {
+    $product_query = tep_db_query("select products_head_title_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_head_title_tag'];
+  }
+
+  function tep_get_products_head_desc_tag($product_id, $language_id) {
+    $product_query = tep_db_query("select products_head_desc_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_head_desc_tag'];
+  }
+
+  function tep_get_products_head_keywords_tag($product_id, $language_id) {
+    $product_query = tep_db_query("select products_head_keywords_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_head_keywords_tag'];
+  }
+
+  function tep_get_products_url($product_id, $language_id) {
+    $product_query = tep_db_query("select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_url'];
+  }
+
+////
+// Return the manufacturers URL in the needed language
+// TABLES: manufacturers_info
+  function tep_get_manufacturer_url($manufacturer_id, $language_id) {
+    $manufacturer_query = tep_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$manufacturer_id . "' and languages_id = '" . (int)$language_id . "'");
+    $manufacturer = tep_db_fetch_array($manufacturer_query);
+
+    return $manufacturer['manufacturers_url'];
+  }
+
+////
+// Wrapper for class_exists() function
+// This function is not available in all PHP versions so we test it before using it.
+  function tep_class_exists($class_name) {
+    if (function_exists('class_exists')) {
+      return class_exists($class_name);
+    } else {
+      return true;
+    }
+  }
+
+////
+// Count how many products exist in a category
+// TABLES: products, products_to_categories, categories
+  function tep_products_in_category_count($categories_id, $include_deactivated = false) {
+    $products_count = 0;
+
+    if ($include_deactivated) {
+      $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$categories_id . "'");
+    } else {
+      $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int)$categories_id . "'");
+    }
+
+    $products = tep_db_fetch_array($products_query);
+
+    $products_count += $products['total'];
+
+    $childs_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$categories_id . "'");
+    if (tep_db_num_rows($childs_query)) {
+      while ($childs = tep_db_fetch_array($childs_query)) {
+        $products_count += tep_products_in_category_count($childs['categories_id'], $include_deactivated);
+      }
+    }
+
+    return $products_count;
+  }
+
+////
+// Count how many subcategories exist in a category
+// TABLES: categories
+  function tep_childs_in_category_count($categories_id) {
+    $categories_count = 0;
+
+    $categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$categories_id . "'");
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $categories_count++;
+      $categories_count += tep_childs_in_category_count($categories['categories_id']);
+    }
+
+    return $categories_count;
+  }
+
+////
+// Returns an array with countries
+// TABLES: countries
+  function tep_get_countries($default = '') {
+    $countries_array = array();
+    if ($default) {
+      $countries_array[] = array('id' => '',
+                                 'text' => $default);
+    }
+    $countries_query = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name");
+    while ($countries = tep_db_fetch_array($countries_query)) {
+      $countries_array[] = array('id' => $countries['countries_id'],
+                                 'text' => $countries['countries_name']);
+    }
+
+    return $countries_array;
+  }
+
+////
+// return an array with country zones
+  function tep_get_country_zones($country_id) {
+    $zones_array = array();
+    $zones_query = tep_db_query("select zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' order by zone_name");
+    while ($zones = tep_db_fetch_array($zones_query)) {
+      $zones_array[] = array('id' => $zones['zone_id'],
+                             'text' => $zones['zone_name']);
+    }
+
+    return $zones_array;
+  }
+
+  function tep_prepare_country_zones_pull_down($country_id = '') {
+// preset the width of the drop-down for Netscape
+    $pre = '';
+    if ( (!tep_browser_detect('MSIE')) && (tep_browser_detect('Mozilla/4')) ) {
+      for ($i=0; $i<45; $i++) $pre .= '&nbsp;';
+    }
+
+    $zones = tep_get_country_zones($country_id);
+
+    if (sizeof($zones) > 0) {
+      $zones_select = array(array('id' => '', 'text' => PLEASE_SELECT));
+      $zones = array_merge($zones_select, $zones);
+    } else {
+      $zones = array(array('id' => '', 'text' => TYPE_BELOW));
+// create dummy options for Netscape to preset the height of the drop-down
+      if ( (!tep_browser_detect('MSIE')) && (tep_browser_detect('Mozilla/4')) ) {
+        for ($i=0; $i<9; $i++) {
+          $zones[] = array('id' => '', 'text' => $pre);
+        }
+      }
+    }
+
+    return $zones;
+  }
+
+////
+// Get list of address_format_id's
+  function tep_get_address_formats() {
+    $address_format_query = tep_db_query("select address_format_id from " . TABLE_ADDRESS_FORMAT . " order by address_format_id");
+    $address_format_array = array();
+    while ($address_format_values = tep_db_fetch_array($address_format_query)) {
+      $address_format_array[] = array('id' => $address_format_values['address_format_id'],
+                                      'text' => $address_format_values['address_format_id']);
+    }
+    return $address_format_array;
+  }
+
+////
+// Alias function for Store configuration values in the Administration Tool
+  function tep_cfg_pull_down_country_list($country_id) {
+    return tep_draw_pull_down_menu('configuration_value', tep_get_countries(), $country_id);
+  }
+
+  function tep_cfg_pull_down_zone_list($zone_id) {
+    return tep_draw_pull_down_menu('configuration_value', tep_get_country_zones(STORE_COUNTRY), $zone_id);
+  }
+
+  function tep_cfg_pull_down_tax_classes($tax_class_id, $key = '') {
+    $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+    $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
+    $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
+    while ($tax_class = tep_db_fetch_array($tax_class_query)) {
+      $tax_class_array[] = array('id' => $tax_class['tax_class_id'],
+                                 'text' => $tax_class['tax_class_title']);
+    }
+
+    return tep_draw_pull_down_menu($name, $tax_class_array, $tax_class_id);
+  }
+//++++ QT Pro: Begin Changed code
+////
+// Function to build menu of available class files given a file prefix
+// Used for configuring plug-ins for product information attributes
+  function tep_cfg_pull_down_class_files($prefix, $current_file) {
+    $d=DIR_FS_CATALOG . DIR_WS_CLASSES;
+    $function_directory = dir ($d);
+
+    while (false !== ($function = $function_directory->read())) {
+      if (preg_match('/^'.$prefix.'(.+)\.php$/',$function,$function_name)) {
+          $file_list[]=array('id'=>$function_name[1], 'text'=>$function_name[1]);
+      }
+    }
+    $function_directory->close();
+
+    return tep_draw_pull_down_menu('configuration_value', $file_list, $current_file);
+  }
+
+//++++ QT Pro: End Changed Code
+////
+// Function to read in text area in admin
+ function tep_cfg_textarea($text) {
+    return tep_draw_textarea_field('configuration_value', false, 35, 5, $text);
+  }
+
+  function tep_cfg_get_zone_name($zone_id) {
+    $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_id = '" . (int)$zone_id . "'");
+
+    if (!tep_db_num_rows($zone_query)) {
+      return $zone_id;
+    } else {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_name'];
+    }
+  }
+
+////
+// Sets the status of a banner
+  function tep_set_banner_status($banners_id, $status) {
+    if ($status == '1') {
+      return tep_db_query("update " . TABLE_BANNERS . " set status = '1', expires_impressions = NULL, expires_date = NULL, date_status_change = NULL where banners_id = '" . $banners_id . "'");
+    } elseif ($status == '0') {
+      return tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_status_change = now() where banners_id = '" . $banners_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+////
+// Sets the status of a product
+  function tep_set_product_status($products_id, $status) {
+    if ($status == '1') {
+      return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '1', products_last_modified = now() where products_id = '" . (int)$products_id . "'");
+    } elseif ($status == '0') {
+      return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0', products_last_modified = now() where products_id = '" . (int)$products_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+////
+// Sets the status of a product on special
+  function tep_set_specials_status($specials_id, $status) {
+    if ($status == '1') {
+      return tep_db_query("update " . TABLE_SPECIALS . " set status = '1', expires_date = NULL, date_status_change = NULL where specials_id = '" . (int)$specials_id . "'");
+    } elseif ($status == '0') {
+      return tep_db_query("update " . TABLE_SPECIALS . " set status = '0', date_status_change = now() where specials_id = '" . (int)$specials_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+////
+// Sets timeout for the current script.
+// Cant be used in safe mode.
+  function tep_set_time_limit($limit) {
+    if (!get_cfg_var('safe_mode')) {
+      set_time_limit($limit);
+    }
+  }
+
+////
+// Alias function for Store configuration values in the Administration Tool
+  function tep_cfg_select_option($select_array, $key_value, $key = '') {
+    $string = '';
+
+    for ($i=0, $n=sizeof($select_array); $i<$n; $i++) {
+      $name = ((tep_not_null($key)) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+      $string .= '<br><input type="radio" name="' . $name . '" value="' . $select_array[$i] . '"';
+
+      if ($key_value == $select_array[$i]) $string .= ' CHECKED';
+
+      $string .= '> ' . $select_array[$i];
+    }
+
+    return $string;
+  }
+
+////
+// Alias function for module configuration keys
+  function tep_mod_select_option($select_array, $key_name, $key_value) {
+    reset($select_array);
+    while (list($key, $value) = each($select_array)) {
+      if (is_int($key)) $key = $value;
+      $string .= '<br><input type="radio" name="configuration[' . $key_name . ']" value="' . $key . '"';
+      if ($key_value == $key) $string .= ' CHECKED';
+      $string .= '> ' . $value;
+    }
+
+    return $string;
+  }
+
+////
+// Retreive server information
+  function tep_get_system_information() {
+    global $HTTP_SERVER_VARS;
+
+    $db_query = tep_db_query("select now() as datetime");
+    $db = tep_db_fetch_array($db_query);
+
+    list($system, $host, $kernel) = preg_split('/[\s,]+/', @exec('uname -a'), 5);
+
+    return array('date' => tep_datetime_short(date('Y-m-d H:i:s')),
+                 'system' => $system,
+                 'kernel' => $kernel,
+                 'host' => $host,
+                 'ip' => gethostbyname($host),
+                 'uptime' => @exec('uptime'),
+                 'http_server' => $HTTP_SERVER_VARS['SERVER_SOFTWARE'],
+                 'php' => PHP_VERSION,
+                 'zend' => (function_exists('zend_version') ? zend_version() : ''),
+                 'db_server' => DB_SERVER,
+                 'db_ip' => gethostbyname(DB_SERVER),
+                 'db_version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''),
+                 'db_date' => tep_datetime_short($db['datetime']));
+  }
+
+  function tep_generate_category_path($id, $from = 'category', $categories_array = '', $index = 0) {
+    global $languages_id;
+
+    if (!is_array($categories_array)) $categories_array = array();
+
+    if ($from == 'product') {
+      $categories_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$id . "'");
+      while ($categories = tep_db_fetch_array($categories_query)) {
+        if ($categories['categories_id'] == '0') {
+          $categories_array[$index][] = array('id' => '0', 'text' => TEXT_TOP);
+        } else {
+          $category_query = tep_db_query("select cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$categories['categories_id'] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
+          $category = tep_db_fetch_array($category_query);
+          $categories_array[$index][] = array('id' => $categories['categories_id'], 'text' => $category['categories_name']);
+          if ( (tep_not_null($category['parent_id'])) && ($category['parent_id'] != '0') ) $categories_array = tep_generate_category_path($category['parent_id'], 'category', $categories_array, $index);
+          $categories_array[$index] = array_reverse($categories_array[$index]);
+        }
+        $index++;
+      }
+    } elseif ($from == 'category') {
+      $category_query = tep_db_query("select cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
+      $category = tep_db_fetch_array($category_query);
+      $categories_array[$index][] = array('id' => $id, 'text' => $category['categories_name']);
+      if ( (tep_not_null($category['parent_id'])) && ($category['parent_id'] != '0') ) $categories_array = tep_generate_category_path($category['parent_id'], 'category', $categories_array, $index);
+    }
+
+    return $categories_array;
+  }
+
+  function tep_output_generated_category_path($id, $from = 'category') {
+    $calculated_category_path_string = '';
+    $calculated_category_path = tep_generate_category_path($id, $from);
+    for ($i=0, $n=sizeof($calculated_category_path); $i<$n; $i++) {
+      for ($j=0, $k=sizeof($calculated_category_path[$i]); $j<$k; $j++) {
+        $calculated_category_path_string .= $calculated_category_path[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
+      }
+      $calculated_category_path_string = substr($calculated_category_path_string, 0, -16) . '<br>';
+    }
+    $calculated_category_path_string = substr($calculated_category_path_string, 0, -4);
+
+    if (strlen($calculated_category_path_string) < 1) $calculated_category_path_string = TEXT_TOP;
+
+    return $calculated_category_path_string;
+  }
+
+  function tep_get_generated_category_path_ids($id, $from = 'category') {
+    $calculated_category_path_string = '';
+    $calculated_category_path = tep_generate_category_path($id, $from);
+    for ($i=0, $n=sizeof($calculated_category_path); $i<$n; $i++) {
+      for ($j=0, $k=sizeof($calculated_category_path[$i]); $j<$k; $j++) {
+        $calculated_category_path_string .= $calculated_category_path[$i][$j]['id'] . '_';
+      }
+      $calculated_category_path_string = substr($calculated_category_path_string, 0, -1) . '<br>';
+    }
+    $calculated_category_path_string = substr($calculated_category_path_string, 0, -4);
+
+    if (strlen($calculated_category_path_string) < 1) $calculated_category_path_string = TEXT_TOP;
+
+    return $calculated_category_path_string;
+  }
+
+  function tep_remove_category($category_id) {
+    $category_image_query = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+    $category_image = tep_db_fetch_array($category_image_query);
+
+    $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where categories_image = '" . tep_db_input($category_image['categories_image']) . "'");
+    $duplicate_image = tep_db_fetch_array($duplicate_image_query);
+
+    if ($duplicate_image['total'] < 2) {
+      if (file_exists(DIR_FS_CATALOG_IMAGES . $category_image['categories_image'])) {
+        @unlink(DIR_FS_CATALOG_IMAGES . $category_image['categories_image']);
+      }
+    }
+
+    tep_db_query("delete from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+
+    if (USE_CACHE == 'true') {
+      tep_reset_cache_block('categories');
+      tep_reset_cache_block('also_purchased');
+    }
+  }
+
+  function tep_remove_product($product_id) {
+    $product_image_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
+    $product_image = tep_db_fetch_array($product_image_query);
+
+    $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " where products_image = '" . tep_db_input($product_image['products_image']) . "'");
+    $duplicate_image = tep_db_fetch_array($duplicate_image_query);
+
+    if ($duplicate_image['total'] < 2) {
+      if (file_exists(DIR_FS_CATALOG_IMAGES . $product_image['products_image'])) {
+        @unlink(DIR_FS_CATALOG_IMAGES . $product_image['products_image']);
+      }
+    }
+
+    tep_db_query("delete from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
+    
+// Eversun mod for sppc and qty price breaks    
+    tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$product_id . "'");
+// Eversun mod end for sppc and qty price breaks
+    
+    tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where products_id = '" . (int)$product_id . "'");
+    tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where products_id = '" . (int)$product_id . "'");
+// START: Extra Fields Contribution  DMG
+    tep_db_query("delete from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = " . (int)$product_id);
+// END: Extra Fields Contribution
+    $product_reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where products_id = '" . (int)$product_id . "'");
+    while ($product_reviews = tep_db_fetch_array($product_reviews_query)) {
+      tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$product_reviews['reviews_id'] . "'");
+    }
+    tep_db_query("delete from " . TABLE_REVIEWS . " where products_id = '" . (int)$product_id . "'");
+
+    if (USE_CACHE == 'true') {
+      tep_reset_cache_block('categories');
+      tep_reset_cache_block('also_purchased');
+    }
+  }
+
+  function tep_remove_order($order_id, $restock) {
+    if ($restock == 'on') {
+      $order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
+      while ($order = tep_db_fetch_array($order_query)) {
+        tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity + " . $order['products_quantity'] . ", products_ordered = products_ordered - " . $order['products_quantity'] . " where products_id = '" . (int)$order['products_id'] . "'");
+      }
+    }
+
+    //begin PayPal_Shopping_Cart_IPN 2.8 DMG
+ include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/functions/general.func.php');
+    paypal_remove_order($order_id);
+//end PayPal_Shopping_Cart_IPN
+    tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$order_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "'");
+  }
+
+  function tep_reset_cache_block($cache_block) {
+    global $cache_blocks;
+$dir_cache = DIR_FS_CATALOG . DIR_FS_CACHE ;
+   // get default template
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+     $template_query = tep_db_query("select template_name from " . TABLE_TEMPLATE . "  order by template_name");
+      while ($template = tep_db_fetch_array($template_query)) {
+        $template_array=array(template=>template_name);
+        }
+
+    
+    for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) {
+      if ($cache_blocks[$i]['code'] == $cache_block) {
+        if ($cache_blocks[$i]['multiple']) {
+          if ($dir = @opendir($dir_cache)) {
+            while ($cache_file = readdir($dir)) {
+              $cached_file = $cache_blocks[$i]['file'];
+              $languages = tep_get_languages();
+              for ($j=0, $k=sizeof($languages); $j<$k; $j++) {
+                $cached_file_unlink = ereg_replace('-language', '-' . $languages[$j]['directory'], $cached_file);
+                
+                              for ($j=0, $k=sizeof($template_array); $j<$k; $j++) {
+                    $cached_file_unlink = ereg_replace('-TEMPLATE_NAME', '-' . $template_array[$j]['template_name'] , $cached_file);
+              
+                
+                if (ereg('^' . $cached_file_unlink, $cache_file)) {
+                  @unlink($dir_cache . $cache_file);
+                  }
+                }
+              }
+            } 
+            closedir($dir);
+          }
+        } else {
+          $cached_file = $cache_blocks[$i]['file'];
+          $languages = tep_get_languages();
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+            $cached_file = ereg_replace('-language', '-' . $languages[$i]['directory'], $cached_file);
+            @unlink(DIR_FS_CACHE . $cached_file);
+          }
+        }
+        break;
+      }
+    }
+  }
+
+  function tep_get_file_permissions($mode) {
+// determine type
+    if ( ($mode & 0xC000) == 0xC000) { // unix domain socket
+      $type = 's';
+    } elseif ( ($mode & 0x4000) == 0x4000) { // directory
+      $type = 'd';
+    } elseif ( ($mode & 0xA000) == 0xA000) { // symbolic link
+      $type = 'l';
+    } elseif ( ($mode & 0x8000) == 0x8000) { // regular file
+      $type = '-';
+    } elseif ( ($mode & 0x6000) == 0x6000) { //bBlock special file
+      $type = 'b';
+    } elseif ( ($mode & 0x2000) == 0x2000) { // character special file
+      $type = 'c';
+    } elseif ( ($mode & 0x1000) == 0x1000) { // named pipe
+      $type = 'p';
+    } else { // unknown
+      $type = '?';
+    }
+
+// determine permissions
+    $owner['read']    = ($mode & 00400) ? 'r' : '-';
+    $owner['write']   = ($mode & 00200) ? 'w' : '-';
+    $owner['execute'] = ($mode & 00100) ? 'x' : '-';
+    $group['read']    = ($mode & 00040) ? 'r' : '-';
+    $group['write']   = ($mode & 00020) ? 'w' : '-';
+    $group['execute'] = ($mode & 00010) ? 'x' : '-';
+    $world['read']    = ($mode & 00004) ? 'r' : '-';
+    $world['write']   = ($mode & 00002) ? 'w' : '-';
+    $world['execute'] = ($mode & 00001) ? 'x' : '-';
+
+// adjust for SUID, SGID and sticky bit
+    if ($mode & 0x800 ) $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S';
+    if ($mode & 0x400 ) $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S';
+    if ($mode & 0x200 ) $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T';
+
+    return $type .
+           $owner['read'] . $owner['write'] . $owner['execute'] .
+           $group['read'] . $group['write'] . $group['execute'] .
+           $world['read'] . $world['write'] . $world['execute'];
+  }
+
+  function tep_remove($source) {
+    global $messageStack, $tep_remove_error;
+
+    if (isset($tep_remove_error)) $tep_remove_error = false;
+
+    if (is_dir($source)) {
+      $dir = dir($source);
+      while ($file = $dir->read()) {
+        if ( ($file != '.') && ($file != '..') ) {
+          if (is_writeable($source . '/' . $file)) {
+            tep_remove($source . '/' . $file);
+          } else {
+            $messageStack->add('search', sprintf(ERROR_FILE_NOT_REMOVEABLE, $source . '/' . $file), 'error');
+            $tep_remove_error = true;
+          }
+        }
+      }
+      $dir->close();
+
+      if (is_writeable($source)) {
+        rmdir($source);
+      } else {
+        $messageStack->add('search', sprintf(ERROR_DIRECTORY_NOT_REMOVEABLE, $source), 'error');
+        $tep_remove_error = true;
+      }
+    } else {
+      if (is_writeable($source)) {
+        unlink($source);
+      } else {
+        $messageStack->add('search', sprintf(ERROR_FILE_NOT_REMOVEABLE, $source), 'error');
+        $tep_remove_error = true;
+      }
+    }
+  }
+
+////
+// Output the tax percentage with optional padded decimals
+  function tep_display_tax_value($value, $padding = TAX_DECIMAL_PLACES) {
+    if (strpos($value, '.')) {
+      $loop = true;
+      while ($loop) {
+        if (substr($value, -1) == '0') {
+          $value = substr($value, 0, -1);
+        } else {
+          $loop = false;
+          if (substr($value, -1) == '.') {
+            $value = substr($value, 0, -1);
+          }
+        }
+      }
+    }
+
+    if ($padding > 0) {
+      if ($decimal_pos = strpos($value, '.')) {
+        $decimals = strlen(substr($value, ($decimal_pos+1)));
+        for ($i=$decimals; $i<$padding; $i++) {
+          $value .= '0';
+        }
+      } else {
+        $value .= '.';
+        for ($i=0; $i<$padding; $i++) {
+          $value .= '0';
+        }
+      }
+    }
+
+    return $value;
+  }
+
+  function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) {
+    if (SEND_EMAILS != 'true') return false;
+
+    // Instantiate a new mail object
+    $message = new email(array('X-Mailer: osCommerce'));
+
+    // Build the text version
+    $text = strip_tags($email_text);
+    if (EMAIL_USE_HTML == 'true') {
+      $message->add_html($email_text, $text);
+    } else {
+      $message->add_text($text);
+    }
+
+    // Send message
+    $message->build_message();
+    $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
+  }
+
+  function tep_get_tax_class_title($tax_class_id) {
+    if ($tax_class_id == '0') {
+      return TEXT_NONE;
+    } else {
+      $classes_query = tep_db_query("select tax_class_title from " . TABLE_TAX_CLASS . " where tax_class_id = '" . (int)$tax_class_id . "'");
+      $classes = tep_db_fetch_array($classes_query);
+
+      return $classes['tax_class_title'];
+    }
+  }
+
+  function tep_banner_image_extension() {
+    if (function_exists('imagetypes')) {
+      if (imagetypes() & IMG_PNG) {
+        return 'png';
+      } elseif (imagetypes() & IMG_JPG) {
+        return 'jpg';
+      } elseif (imagetypes() & IMG_GIF) {
+        return 'gif';
+      }
+    } elseif (function_exists('imagecreatefrompng') && function_exists('imagepng')) {
+      return 'png';
+    } elseif (function_exists('imagecreatefromjpeg') && function_exists('imagejpeg')) {
+      return 'jpg';
+    } elseif (function_exists('imagecreatefromgif') && function_exists('imagegif')) {
+      return 'gif';
+    }
+
+    return false;
+  }
+
+////
+// Wrapper function for round() for php3 compatibility
+  function tep_round($value, $precision) {
+    if (PHP_VERSION < 4) {
+      $exp = pow(10, $precision);
+      return round($value * $exp) / $exp;
+    } else {
+      return round($value, $precision);
+    }
+  }
+
+////
+// Add tax to a products price
+  function tep_add_tax($price, $tax) {
+    global $currencies;
+
+    if (DISPLAY_PRICE_WITH_TAX == 'true') {
+      return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax);
+    } else {
+      return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
+    }
+  }
+
+// Calculates Tax rounding the result
+  function tep_calculate_tax($price, $tax) {
+    global $currencies;
+
+    return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
+  }
+
+////
+// Returns the tax rate for a zone / class
+// TABLES: tax_rates, zones_to_geo_zones
+  function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
+    global $customer_zone_id, $customer_country_id;
+
+    if ( ($country_id == -1) && ($zone_id == -1) ) {
+      if (!tep_session_is_registered('customer_id')) {
+        $country_id = STORE_COUNTRY;
+        $zone_id = STORE_ZONE;
+      } else {
+        $country_id = $customer_country_id;
+        $zone_id = $customer_zone_id;
+      }
+    }
+
+    $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za ON tr.tax_zone_id = za.geo_zone_id left join " . TABLE_GEO_ZONES . " tz ON tz.geo_zone_id = tr.tax_zone_id WHERE (za.zone_country_id IS NULL OR za.zone_country_id = '0' OR za.zone_country_id = '" . (int)$country_id . "') AND (za.zone_id IS NULL OR za.zone_id = '0' OR za.zone_id = '" . (int)$zone_id . "') AND tr.tax_class_id = '" . (int)$class_id . "' GROUP BY tr.tax_priority");
+    if (tep_db_num_rows($tax_query)) {
+      $tax_multiplier = 0;
+      while ($tax = tep_db_fetch_array($tax_query)) {
+        $tax_multiplier += $tax['tax_rate'];
+      }
+      return $tax_multiplier;
+    } else {
+      return 0;
+    }
+  }
+
+////
+// Returns the tax rate for a tax class
+// TABLES: tax_rates
+  function tep_get_tax_rate_value($class_id) {
+    $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " where tax_class_id = '" . (int)$class_id . "' group by tax_priority");
+    if (tep_db_num_rows($tax_query)) {
+      $tax_multiplier = 0;
+      while ($tax = tep_db_fetch_array($tax_query)) {
+        $tax_multiplier += $tax['tax_rate'];
+      }
+      return $tax_multiplier;
+    } else {
+      return 0;
+    }
+  }
+
+  function tep_call_function($function, $parameter, $object = '') {
+    if ($object == '') {
+      return call_user_func($function, $parameter);
+    } elseif (PHP_VERSION < 4) {
+      return call_user_method($function, $object, $parameter);
+    } else {
+      return call_user_func(array($object, $function), $parameter);
+    }
+  }
+
+  function tep_get_zone_class_title($zone_class_id) {
+    if ($zone_class_id == '0') {
+      return TEXT_NONE;
+    } else {
+      $classes_query = tep_db_query("select geo_zone_name from " . TABLE_GEO_ZONES . " where geo_zone_id = '" . (int)$zone_class_id . "'");
+      $classes = tep_db_fetch_array($classes_query);
+
+      return $classes['geo_zone_name'];
+    }
+  }
+
+  function tep_cfg_pull_down_zone_classes($zone_class_id, $key = '') {
+    $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+    $zone_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
+    $zone_class_query = tep_db_query("select geo_zone_id, geo_zone_name from " . TABLE_GEO_ZONES . " order by geo_zone_name");
+    while ($zone_class = tep_db_fetch_array($zone_class_query)) {
+      $zone_class_array[] = array('id' => $zone_class['geo_zone_id'],
+                                  'text' => $zone_class['geo_zone_name']);
+    }
+
+    return tep_draw_pull_down_menu($name, $zone_class_array, $zone_class_id);
+  }
+
+  function tep_cfg_pull_down_order_statuses($order_status_id, $key = '') {
+    global $languages_id;
+
+    $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+    $statuses_array = array(array('id' => '0', 'text' => TEXT_DEFAULT));
+    $statuses_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "' order by orders_status_name");
+    while ($statuses = tep_db_fetch_array($statuses_query)) {
+      $statuses_array[] = array('id' => $statuses['orders_status_id'],
+                                'text' => $statuses['orders_status_name']);
+    }
+
+    return tep_draw_pull_down_menu($name, $statuses_array, $order_status_id);
+  }
+
+  function tep_get_order_status_name($order_status_id, $language_id = '') {
+    global $languages_id;
+
+    if ($order_status_id < 1) return TEXT_DEFAULT;
+
+    if (!is_numeric($language_id)) $language_id = $languages_id;
+
+    $status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . (int)$order_status_id . "' and language_id = '" . (int)$language_id . "'");
+    $status = tep_db_fetch_array($status_query);
+
+    return $status['orders_status_name'];
+  }
+
+////
+// Return a random value
+  function tep_rand($min = null, $max = null) {
+    static $seeded;
+
+    if (!$seeded) {
+      mt_srand((double)microtime()*1000000);
+      $seeded = true;
+    }
+
+    if (isset($min) && isset($max)) {
+      if ($min >= $max) {
+        return $min;
+      } else {
+        return mt_rand($min, $max);
+      }
+    } else {
+      return mt_rand();
+    }
+  }
+
+// nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n)
+  function tep_convert_linefeeds($from, $to, $string) {
+    if ((PHP_VERSION < "4.0.5") && is_array($from)) {
+      return ereg_replace('(' . implode('|', $from) . ')', $to, $string);
+    } else {
+      return str_replace($from, $to, $string);
+    }
+  }
+
+  function tep_string_to_int($string) {
+    return (int)$string;
+  }
+
+////
+// Parse and secure the cPath parameter values
+  function tep_parse_category_path($cPath) {
+// make sure the category IDs are integers
+    $cPath_array = array_map('tep_string_to_int', explode('_', $cPath));
+
+// make sure no duplicate category IDs exist which could lock the server in a loop
+    $tmp_array = array();
+    $n = sizeof($cPath_array);
+    for ($i=0; $i<$n; $i++) {
+      if (!in_array($cPath_array[$i], $tmp_array)) {
+        $tmp_array[] = $cPath_array[$i];
+      }
+    }
+
+    return $tmp_array;
+  }
+// Alias function for array of configuration values in the Administration Tool
+  function tep_cfg_select_multioption($select_array, $key_value, $key = '') {
+    for ($i=0; $i<sizeof($select_array); $i++) {
+      $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+      $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+      $key_values = explode( ", ", $key_value);
+      if ( in_array($select_array[$i], $key_values) ) $string .= 'CHECKED';
+      $string .= '> ' . $select_array[$i];
+    }
+    return $string;
+  }
+  
+//create a select list to display list of themes available for selection
+  function tep_cfg_pull_down_template_list($template_id, $key = '') {
+    $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');
+
+    $template_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " order by template_name");
+    while ($template = tep_db_fetch_array($template_query)) {
+      $template_array[] = array('id' => $template['template_name'],
+                                 'text' => $template['template_name']);
+    }
+
+    return tep_draw_pull_down_menu($name, $template_array, $template_id);
+  }
+
+
+// BOF: WebMakers.com Added: Downloads Controller
+require(DIR_WS_FUNCTIONS . 'downloads_controller.php');
+// EOF: WebMakers.com Added: Downloads Controller
+
+// Contact US Email Subjects : DMG
+// PassionSeed Contact Us Email Subject begin
+  function tep_get_email_subjects_list($subjects_array = '') {
+    if (!is_array($subjects_array)) $subjects_array = array();
+
+    $subjects_query = tep_db_query("select email_subjects_id, email_subjects_name from " . TABLE_EMAIL_SUBJECTS . " order by email_subjects_name");
+    while ($subjects = tep_db_fetch_array($subjects_query)) {
+      $subjects_array[] = array('id' => $subjects['email_subjects_name'], 'text' => $subjects['email_subjects_name']);
+    }
+
+    return $subjects_array;
+  }
+// PassionSeed Contact Us Email Subject end
+function tep_get_pay_method($pay_methods_id, $language_id = '') {
+    global $languages_id;
+
+    if (!$language_id) $language_id = $languages_id;
+    $pay_method_query1 = tep_db_query("select pay_method from " . TABLE_ORDERS_PAY_METHODS . " where pay_methods_id = '" . (int)$pay_methods_id . "' and pay_method_language = '" . (int)$language_id . "'");
+    $pay_method1 = tep_db_fetch_array($pay_method_query1);
+
+    return $pay_method1['pay_method'];
+  }
+function tep_get_ship_method($ship_methods_id, $language_id = '') {
+    global $languages_id;
+
+    if (!$language_id) $language_id = $languages_id;
+    $ship_method_query1 = tep_db_query("select ship_method from " . TABLE_ORDERS_SHIP_METHODS . " where ship_methods_id = '" . (int)$ship_methods_id . "' and ship_method_language = '" . (int)$language_id . "'");
+    $ship_method1 = tep_db_fetch_array($ship_method_query1);
+
+    return $ship_method1['ship_method'];
+  }
+
+  function tep_get_ip_address() {
+    if (isset($_SERVER)) {
+      if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+      } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
+        $ip = $_SERVER['HTTP_CLIENT_IP'];
+      } else {
+        $ip = $_SERVER['REMOTE_ADDR'];
+      }
+    } else {
+      if (getenv('HTTP_X_FORWARDED_FOR')) {
+        $ip = getenv('HTTP_X_FORWARDED_FOR');
+      } elseif (getenv('HTTP_CLIENT_IP')) {
+        $ip = getenv('HTTP_CLIENT_IP');
+      } else {
+        $ip = getenv('REMOTE_ADDR');
+      }
+    }
+
+    return $ip;
+  }
+
+  
+function tep_get_box_heading($infobox_id, $languages_id) {
+    $configuration_query12 = tep_db_query("select box_heading from " . TABLE_INFOBOX_HEADING . " where infobox_id = '" . (int)$infobox_id . "' and languages_id = '" . (int)$languages_id . "'");
+    $configuration12 = tep_db_fetch_array($configuration_query12);
+
+    return $configuration12['box_heading'];
+  }
+  
+/*function tep_cfg_select_multioption($select_array, $key_value, $key = '') {
+    for ($i=0; $i<sizeof($select_array); $i++) {
+      $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+      $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+      $key_values = explode( ", ", $key_value);
+      if ( in_array($select_array[$i], $key_values) ) $string .= 'CHECKED';
+      $string .= '> ' . $select_array[$i];
+    } 
+    return $string;
+  }*/
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/header_tags.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/header_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/header_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,227 @@
+<?php
+/*
+  $Id: header_tags_controller.php,v 1.0 2005/04/08 22:50:52 hpdl Exp $
+  Originally Created by: Jack York - http://www.oscommerce-solution.com
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+function ChangeSwitch($line, $arg)
+{
+  if (isset($arg))
+   $line = str_replace("0", "1", $line);
+  else  
+   $line = str_replace("1", "0", $line);
+   
+  return $line; 
+}
+
+//returns true if line is a comment
+function IsComment($line)
+{   
+  return ((strpos($line, "//") === 0) ? true : false);
+}
+
+function IsTitleSwitch($line)
+{   
+  if (strpos($line, "define('HTTA") === 0 && strpos($line, "define('HTTA_CAT") === FALSE)
+    return true;
+  else
+    return false; 
+}
+
+function IsDescriptionSwitch($line)
+{   
+  return ((strpos($line, "define('HTDA") === 0) ? true : false);
+}
+
+function IsKeywordSwitch($line)
+{   
+  return ((strpos($line, "define('HTKA") === 0) ? true : false); 
+}
+
+function IsCatSwitch($line)
+{   
+  return ((strpos($line, "define('HTTA_CAT") === 0) ? true : false); 
+}
+
+function IsTitleTag($line)
+{   
+  return ((strpos($line, "define('HEAD_TITLE_TAG") === 0) ? true : false);  
+}
+
+function IsDescriptionTag($line)
+{   
+  return ((strpos($line, "define('HEAD_DESC_TAG") === 0) ? true : false);
+}
+
+function IsKeywordTag($line)
+{   
+  return ((strpos($line, "define('HEAD_KEY_TAG") === 0) ? true : false);
+}
+
+function FileNotUsingHeaderTags($file)
+{
+  $file = DIR_FS_CATALOG .$file;
+  $fp = file($file);
+  for ($i = 0; $i < count($fp); ++$i)
+  {
+      if (strpos($fp[$i], "Header Tags Generator") !== FALSE)
+        return false;
+  }
+  return true;
+}
+
+function GetArgument(&$line, $arg_new, $formActive)
+{
+  $arg = explode("'", $line);
+  
+  if ($formActive)
+  {
+    $line = ReplaceArg($line, $arg_new);
+  }
+  else
+  {             
+    for ($i = 4; $i < count($arg); ++$i)
+    {
+       if (strpos($arg[$i], ");") === FALSE)
+         $arg[3] .= $arg[$i];
+    }             
+  
+    $arg[3] = str_replace("\\", "'", $arg[3]);
+  }
+ 
+  return $arg[3];
+}
+
+function GetMainArgument(&$line, $arg, $arg2, $formActive)
+{
+  $def = explode("'", $line);
+  for ($i = 3; $i < count($def); ++$i)
+  {
+    if (strpos($def[$i], ");") === FALSE)
+    {
+      $arg .= $def[$i];
+    }  
+  }
+
+  $arg = str_replace("\\", "'",$arg);
+
+  if ($formActive)
+  {
+     if (! tep_not_null($arg))                      //the default tag is empty
+     {
+        $arg_tmp = "'xyz123'";                      //fill it with temp pattern
+        $arg = "xyz123";                            //match the original but no '' since they will be deleted
+        $line = str_replace("''", $arg_tmp, $line); //fill in the string so it can be replaced below 
+     }
+     else
+       $arg = addslashes($arg);
+  
+     $line = str_replace($arg, $arg2, $line);
+     $arg = $arg2;
+  }  
+  
+  return $arg;  
+}
+
+function GetSectionName($line)
+{
+  $name = explode(" ", $line);
+  $name[1] = trim($name[1]);
+  $pos = strpos($name[1], '.');
+  return (substr($name[1], 0, $pos)); 
+}
+
+function GetSwitchSetting($line)
+{
+  return ((strpos($line, "'0'") === FALSE) ? 1 : 0);     
+}
+
+function NotDuplicatePage($fp, $pagename)  //return false if the name entered is already present
+{
+  for ($idx = 0; $idx < count($fp); ++$idx)   
+  {
+     $section = GetSectionName($fp[$idx]);
+     if (! empty($section))
+     {
+        if (strcasecmp($section, $pagename) === 0)
+          return false;
+     }     
+  }
+  return true;
+}
+
+function ReplaceArg($line, $arg)
+{
+  $parts = explode("'", $line);         //break apart the line   
+  $parts[3] = $arg;                     //replace the argument  
+  
+  if (strpos($parts[3], "\\") === FALSE)
+    $parts[3] = addslashes($parts[3]);  
+   
+  $parts = $parts[0] . "'" . $parts[1] . "'" . $parts[2] . "'" . $parts[3] . '\');' . "\n";
+  return $parts; 
+  return implode("'", $parts);          //put line back together
+}
+
+function TotalPages($filename)
+{
+  $ctr = 0;
+  $findTitles = false;
+  $fp = file($filename);  
+      
+  for ($idx = 0; $idx < count($fp); ++$idx)
+  { 
+    $line=$fp[$idx];
+
+    if (strpos($line, "define('HEAD_TITLE_TAG_ALL','") !== FALSE)
+      continue;
+    else if (strpos($line, "define('HEAD_DESC_TAG_ALL") !== FALSE)
+      continue;
+    else if (strpos($line, "define('HEAD_KEY_TAG_ALL") !== FALSE)
+    {
+      $findTitles = true;  //enable next section
+      continue;
+    } 
+    else if ($findTitles)
+    {
+      if (($pos = strpos($fp[$idx], '.php')) !== FALSE)
+        $ctr++; 
+    }
+  }  
+  return $ctr;
+}
+
+function WriteHeaderTagsFile($filename, $fp)
+{
+  if (!is_writable($filename)) 
+  {
+     if (!chmod($filename, 0666)) {
+       // echo "Cannot change the mode of file ($filename)";
+        echo CANNOT_CHANGE_THE_MODE_OF_FILE." ($filename)";
+        exit;
+     }
+  }
+  $fpOut = fopen($filename, "w");
+ 
+  if (!fpOut)
+  {
+    // echo 'Failed to open file '.$filename;
+     echo FAILED_TO_OPEN_FILE.$filename;
+     exit;
+  }
+       
+  for ($idx = 0; $idx < count($fp); ++$idx)
+    if (fwrite($fpOut, $fp[$idx]) === FALSE)
+    {
+       //echo "Cannot write to file ($filename)";
+       echo CANNOT_WRITE_TO_FILE." ($filename)";
+       exit;
+    } 
+  fclose($fpOut);   
+}
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/html_graphs.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/html_graphs.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/html_graphs.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,568 @@
+<?php
+/*
+  $Id: html_graphs.php,v 1.1.1.1 2004/03/04 23:39:54 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  HTML_Graphs (v1.5 1998/11/05 06:15:52) by Phil Davis, http://www.pobox.com/~pdavis/
+*/
+
+////
+// calls routines to initialize defaults, set up table
+// print data, and close table.
+  function html_graph($names, $values, $bars, $vals, $dvalues = 0, $dbars = 0) {
+// set the error level on entry and exit so as not to interfear with anyone elses error checking.
+    $er = error_reporting(1);
+
+// set the values that the user didn't
+    $vals = hv_graph_defaults($vals);
+    $html_graph_string = start_graph($vals, $names);
+
+    if ($vals['type'] == 0) {
+      $html_graph_string .= horizontal_graph($names, $values, $bars, $vals);
+    } elseif ($vals['type'] == 1) {
+      $html_graph_string .= vertical_graph($names, $values, $bars, $vals);
+    } elseif ($vals['type'] == 2) {
+      $html_graph_string .= double_horizontal_graph($names, $values, $bars, $vals, $dvalues, $dbars);
+    } elseif ($vals['type'] == 3) {
+      $html_graph_string .= double_vertical_graph($names, $values, $bars, $vals, $dvalues, $dbars);
+    }
+
+    $html_graph_string .= end_graph();
+
+// Set the error level back to where it was.
+    error_reporting($er);
+
+    return $html_graph_string;
+  }
+
+////
+// sets up the $vals array by initializing all values to null. Used to avoid
+// warnings from error_reporting being set high. This routine only needs to be
+// called if you are worried about using uninitialized variables.
+  function html_graph_init() {
+    $vals = array('vlabel'=>'',
+                  'hlabel'=>'',
+                  'type'=>'',
+                  'cellpadding'=>'',
+                  'cellspacing'=>'',
+                  'border'=>'',
+                  'width'=>'',
+                  'background'=>'',
+                  'vfcolor'=>'',
+                  'hfcolor'=>'',
+                  'vbgcolor'=>'',
+                  'hbgcolor'=>'',
+                  'vfstyle'=>'',
+                  'hfstyle'=>'',
+                  'noshowvals'=>'',
+                  'scale'=>'',
+                  'namebgcolor'=>'',
+                  'valuebgcolor'=>'',
+                  'namefcolor'=>'',
+                  'valuefcolor'=>'',
+                  'namefstyle'=>'',
+                  'valuefstyle'=>'',
+                  'doublefcolor'=>'');
+
+    return($vals);
+  }
+
+////
+// prints out the table header and graph labels
+  function start_graph($vals, $names) {
+    $start_graph_string = '<table cellpadding="' . $vals['cellpadding'] . '" cellspacing="' . $vals['cellspacing'] . '" border="' . $vals['border'] . '"';
+
+    if ($vals['width'] != 0) $start_graph_string .= ' width="' . $vals['width'] . '"';
+    if ($vals['background']) $start_graph_string .= ' background="' . $vals['background'] . '"';
+
+    $start_graph_string .= '>' . "\n";
+
+    if ( ($vals['vlabel']) || ($vals['hlabel']) ) {
+      if ( ($vals['type'] == 0) || ($vals['type'] == 2) ) {
+// horizontal chart
+        $rowspan = sizeof($names) + 1;
+        $colspan = 3;
+      } elseif ( ($vals['type'] == 1) || ($vals['type'] == 3) ) {
+// vertical chart
+        $rowspan = 3;
+        $colspan = sizeof($names) + 1;
+      }
+
+      $start_graph_string .= '  <tr>' . "\n" .
+                             '    <td align="center" valign="center"';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $start_graph_string .= ' bgcolor="' . $vals['hbgcolor'] . '"';
+
+      $start_graph_string .= ' colspan="' . $colspan . '"><font color="' . $vals['hfcolor'] . '" style="' . $vals['hfstyle'] . '"><b>' . $vals['hlabel'] . '</b></font></td>' . "\n" .
+                             '  </tr>' . "\n" .
+                             '  <tr>' . "\n" .
+                             '    <td align="center" valign="center"';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $start_graph_string .= ' bgcolor="' . $vals['vbgcolor'] . '"';
+
+      $start_graph_string .=  ' rowspan="' . $rowspan . '"><font color="' . $vals['vfcolor'] . '" style="' . $vals['vfstyle'] . '"><b>' . $vals['vlabel'] . '</b></font></td>' . "\n" .
+                              '  </tr>' . "\n";
+    }
+
+    return $start_graph_string;
+  }
+
+////
+// prints out the table footer
+  function end_graph() {
+    return '</table>' . "\n";
+  }
+
+////
+// sets the default values for the $vals array
+  function hv_graph_defaults($vals) {
+    if (!$vals['vfcolor']) $vals['vfcolor'] = '#000000';
+    if (!$vals['hfcolor']) $vals['hfcolor'] = '#000000';
+    if (!$vals['vbgcolor']) $vals['vbgcolor'] = '#FFFFFF';
+    if (!$vals['hbgcolor']) $vals['hbgcolor'] = '#FFFFFF';
+    if (!$vals['cellpadding']) $vals['cellpadding'] = '0';
+    if (!$vals['cellspacing']) $vals['cellspacing'] = '0';
+    if (!$vals['border']) $vals['border'] = '0';
+    if (!$vals['scale']) $vals['scale'] = '1';
+    if (!$vals['namebgcolor']) $vals['namebgcolor'] = '#FFFFFF';
+    if (!$vals['valuebgcolor']) $vals['valuebgcolor'] = '#FFFFFF';
+    if (!$vals['namefcolor']) $vals['namefcolor'] = '#000000';
+    if (!$vals['valuefcolor']) $vals['valuefcolor'] = '#000000';
+    if (!$vals['doublefcolor']) $vals['doublefcolor'] = '#886666';
+
+    return $vals;
+  }
+
+////
+// prints out the actual data for the horizontal chart
+  function horizontal_graph($names, $values, $bars, $vals) {
+    $horizontal_graph_string = '';
+    for($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $horizontal_graph_string .= '  <tr>' . "\n" .
+                                  '    <td align="right"';
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $horizontal_graph_string .= ' bgcolor="' . $vals['namebgcolor'] . '"';
+
+      $horizontal_graph_string .= '><font size="-1" color="' . $vals['namefcolor'] . '" style="' . $vals['namefstyle'] . '">' . $names[$i] . '</font></td>' . "\n" .
+                                  '    <td';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $horizontal_graph_string .= ' bgcolor="' . $vals['valuebgcolor'] . '"';
+
+      $horizontal_graph_string .= '>';
+
+// decide if the value in bar is a color code or image.
+      if (ereg('^#', $bars[$i])) {
+        $horizontal_graph_string .= '<table cellpadding="0" cellspacing="0" bgcolor="' . $bars[$i] . '" width="' . ($values[$i] * $vals['scale']) . '">' . "\n" .
+                                    '  <tr>' . "\n" .
+                                    '    <td>&nbsp;</td>' . "\n" .
+                                    '  </tr>' . "\n" .
+                                    '</table>';
+      } else {
+        $horizontal_graph_string .= '<img src="' . $bars[$i] . '" height="10" width="' . ($values[$i] * $vals['scale']) . '">';
+      }
+
+      if (!$vals['noshowvals']) {
+        $horizontal_graph_string .= '<i><font size="-2" color="' . $vals['valuefcolor'] . '" style="' . $vals['valuefstyle'] . '">(' . $values[$i] . ')</font></i>';
+      }
+
+      $horizontal_graph_string .= '</td>' . "\n" .
+                                  '  </tr>' . "\n";
+    } // endfor
+
+    return $horizontal_graph_string;
+  }
+
+////
+// prints out the actual data for the vertical chart
+  function vertical_graph($names, $values, $bars, $vals) {
+    $vertical_graph_string = '  <tr>' . "\n";
+
+    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $vertical_graph_string .= '    <td align="center" valign="bottom"';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $vertical_graph_string .= ' bgcolor="' . $vals['valuebgcolor'] . '"';
+
+      $vertical_graph_string .= '>';
+
+      if (!$vals['noshowvals']) {
+        $vertical_graph_string .= '<i><font size="-2" color="' . $vals['valuefcolor'] . '" style="' . $vals['valuefstyle'] . '">(' . $values[$i] . ')</font></i><br>';
+      }
+
+      $vertical_graph_string .= '<img src="' . $bars[$i] . '" width="5" height="';
+
+// values of zero are displayed wrong because a image height of zero
+// gives a strange behavior in Netscape. For this reason the height
+// is set at 1 pixel if the value is zero. - Jan Diepens
+      if ($values[$i] != 0) {
+        $vertical_graph_string .= $values[$i] * $vals['scale'];
+      } else {
+        $vertical_graph_string .= '1';
+      }
+
+      $vertical_graph_string .= '"></td>' . "\n";
+    } // endfor
+
+    $vertical_graph_string .= '  </tr>' . "\n" .
+                              '  <tr>' . "\n";
+
+    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $vertical_graph_string .= '    <td align="center" valign="top"';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $vertical_graph_string .= ' bgcolor="' . $vals['namebgcolor'] . '"';
+
+      $vertical_graph_string .= '><font size="-1" color="' . $vals['namefcolor'] . '" style="' . $vals['namefstyle'] . '">' . $names[$i] . '</font></td>' . "\n";
+    } // endfor
+
+    $vertical_graph_string .= '  </tr>' . "\n";
+
+    return $vertical_graph_string;
+  }
+
+////
+// prints out the actual data for the double horizontal chart
+  function double_horizontal_graph($names, $values, $bars, $vals, $dvalues, $dbars) {
+    $double_horizontal_graph_string = '';
+    for($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $double_horizontal_graph_string .= '  <tr>' . "\n" .
+                                        '    <td align="right"';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $double_horizontal_graph_string .= ' bgcolor="' . $vals['namebgcolor'] . '"';
+
+      $double_horizontal_graph_string .= '><font size="-1" color="' . $vals['namefcolor'] . '" style="' . $vals['namefstyle'] . '">' . $names[$i] . '</font></td>' . "\n" .
+                                         '    <td';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $double_horizontal_graph_string .= ' bgcolor="' . $vals['valuebgcolor'] . '"';
+
+      $double_horizontal_graph_string .= '><table align="left" cellpadding="0" cellspacing="0" width="' . ($dvalues[$i] * $vals['scale']) . '">' . "\n" .
+                                         '      <tr>' . "\n" .
+                                         '        <td';
+
+// set background to a color if it starts with # or an image otherwise.
+      if (ereg('^#', $dbars[$i])) {
+        $double_horizontal_graph_string .= ' bgcolor="' . $dbars[$i] . '">';
+      } else {
+        $double_horizontal_graph_string .= ' background="' . $dbars[$i] . '">';
+      }
+
+      $double_horizontal_graph_string .= '<nowrap>';
+
+// decide if the value in bar is a color code or image.
+      if (ereg('^#', $bars[$i])) {
+        $double_horizontal_graph_string .= '<table align="left" cellpadding="0" cellspacing="0" bgcolor="' . $bars[$i] . '" width="' . ($values[$i] * $vals['scale']) . '">' . "\n" .
+                                           '  <tr>' . "\n" .
+                                           '    <td>&nbsp;</td>' . "\n" .
+                                           '  </tr>' . "\n" .
+                                           '</table>';
+      } else {
+        $double_horizontal_graph_string .= '<img src="' . $bars[$i] . '" height="10" width="' . ($values[$i] * $vals['scale']) . '">';
+      }
+
+      if (!$vals['noshowvals']) {
+        $double_horizontal_graph_string .= '<i><font size="-3" color="' . $vals['valuefcolor'] . '" style="' . $vals['valuefstyle'] . '">(' . $values[$i] . ')</font></i>';
+      }
+
+      $double_horizontal_graph_string .= '</nowrap></td>' . "\n" .
+                                         '        </tr>' . "\n" .
+                                         '      </table>';
+
+      if (!$vals['noshowvals']) {
+        $double_horizontal_graph_string .= '<i><font size="-3" color="' . $vals['doublefcolor'] . '" style="' . $vals['valuefstyle'] . '">(' . $dvalues[$i] . ')</font></i>';
+      }
+
+      $double_horizontal_graph_string .= '</td>' . "\n" .
+                                         '  </tr>' . "\n";
+    } // endfor
+
+    return $double_horizontal_graph_string;
+  }
+
+////
+// prints out the actual data for the double vertical chart
+  function double_vertical_graph($names, $values, $bars, $vals, $dvalues, $dbars) {
+    $double_vertical_graph_string = '  <tr>' . "\n";
+    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $double_vertical_graph_string .= '    <td align="center" valign="bottom"';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $double_vertical_graph_string .= ' bgcolor="' . $vals['valuebgcolor'] . '"';
+
+      $double_vertical_graph_string .= '><table>' . "\n" .
+                                       '      <tr>' . "\n" .
+                                       '        <td align="center" valign="bottom"';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $double_vertical_graph_string .= ' bgcolor="' . $vals['valuebgcolor'] . '"';
+
+      $double_vertical_graph_string .= '>';
+
+      if (!$vals['noshowvals'] && $values[$i]) {
+        $double_vertical_graph_string .= '<i><font size="-2" color="' . $vals['valuefcolor'] . '" style="' . $vals['valuefstyle'] . '">(' . $values[$i] . ')</font></i><br>';
+      }
+
+      $double_vertical_graph_string .= '<img src="' . $bars[$i] . '" width="10" height="';
+
+      if ($values[$i] != 0) {
+        $double_vertical_graph_string .= $values[$i] * $vals['scale'];
+      } else {
+        $double_vertical_graph_string .= '1';
+      }
+
+      $double_vertical_graph_string .= '"></td>' . "\n" .
+                                       '        <td align="center" valign="bottom"';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $double_vertical_graph_string .= ' bgcolor="' . $vals['valuebgcolor'] . '"';
+
+      $double_vertical_graph_string .= '>';
+
+      if (!$vals['noshowvals'] && $dvalues[$i]) {
+        $double_vertical_graph_string .= '<i><font size="-2" color="' . $vals['doublefcolor'] . '" style="' . $vals['valuefstyle'] . '">(' . $dvalues[$i] . ')</font></i><br>';
+      }
+
+      $double_vertical_graph_string .= '<img src="' . $dbars[$i] . '" width="10" height="';
+
+      if ($dvalues[$i] != 0) {
+        $double_vertical_graph_string .= $dvalues[$i] * $vals['scale'];
+      } else {
+        $double_vertical_graph_string .= '1';
+      }
+
+      $double_vertical_graph_string .= '"></td>' . "\n" .
+                                       '      </tr>' . "\n" .
+                                       '    </table></td>' . "\n";
+    } // endfor
+
+    $double_vertical_graph_string .= '  </tr>' . "\n" .
+                                     '  <tr>' . "\n";
+
+    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $double_vertical_graph_string .= '    <td align="center" valign="top"';
+
+// if a background was choosen don't print cell BGCOLOR
+      if (!$vals['background']) $double_vertical_graph_string .= ' bgcolor="' . $vals['namebgcolor'] . '"';
+
+      $double_vertical_graph_string .= '><font size="-1" color="' . $vals['namefcolor'] . '" style="' . $vals['namefstyle'] . '">' . $names[$i] . '</font></td>' . "\n";
+    } // endfor
+
+    $double_vertical_graph_string .= '  </tr>' . "\n";
+
+    return $double_vertical_graph_string;
+  }
+
+////
+// draws a double vertical bar graph for the banner views vs clicks statistics
+  function tep_banner_graph_infoBox($banner_id, $days) {
+    $names = array();
+    $values = array();
+    $dvalues = array();
+
+    $banner_stats_query = tep_db_query("select dayofmonth(banners_history_date) as name, banners_shown as value, banners_clicked as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and to_days(now()) - to_days(banners_history_date) < " . $days . " order by banners_history_date");
+    while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
+      $names[] = $banner_stats['name'];
+      $values[] = $banner_stats['value'];
+      $dvalues[] = $banner_stats['dvalue'];
+    }
+    $largest = @max($values);
+
+    $bars = array();
+    $dbars = array();
+    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $bars[$i] = DIR_WS_IMAGES . 'graph_hbar_blue.gif';
+      $dbars[$i] = DIR_WS_IMAGES . 'graph_hbar_red.gif';
+    }
+
+    $graph_vals = @array('vlabel'=>TEXT_BANNERS_DATA,
+                        'hlabel'=>TEXT_BANNERS_LAST_3_DAYS,
+                        'type'=>'3',
+                        'cellpadding'=>'',
+                        'cellspacing'=>'1',
+                        'border'=>'',
+                        'width'=>'',
+                        'vfcolor'=>'#ffffff',
+                        'hfcolor'=>'#ffffff',
+                        'vbgcolor'=>'#81a2b6',
+                        'hbgcolor'=>'#81a2b6',
+                        'vfstyle'=>'Verdana, Arial, Helvetica',
+                        'hfstyle'=>'Verdana, Arial, Helvetica',
+                        'scale'=>100/$largest,
+                        'namebgcolor'=>'#f3f5fe',
+                        'valuebgcolor'=>'#f3f5fe',
+                        'namefcolor'=>'',
+                        'valuefcolor'=>'#0000d0',
+                        'namefstyle'=>'Verdana, Arial, Helvetica',
+                        'valuefstyle'=>'',
+                        'doublefcolor'=>'#ff7339');
+
+    return html_graph($names, $values, $bars, $graph_vals, $dvalues, $dbars);
+  }
+
+////
+// draws a double vertical bar graph for the banner views vs clicks statistics
+  function tep_banner_graph_yearly($banner_id) {
+    global $banner, $HTTP_GET_VARS;
+
+    $banner_stats_query = tep_db_query("select year(banners_history_date) as year, sum(banners_shown) as value, sum(banners_clicked) as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' group by year(banners_history_date)");
+    while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
+      $names[] = $banner_stats['year'];
+      $values[] = (($banner_stats['value']) ? $banner_stats['value'] : '0');
+      $dvalues[] = (($banner_stats['dvalue']) ? $banner_stats['dvalue'] : '0');
+    }
+
+    $largest = @max($values);
+
+    $bars = array();
+    $dbars = array();
+    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $bars[$i] = DIR_WS_IMAGES . 'graph_hbar_blue.gif';
+      $dbars[$i] = DIR_WS_IMAGES . 'graph_hbar_red.gif';
+    }
+
+    $graph_vals = @array('vlabel'=>TEXT_BANNERS_DATA,
+                        'hlabel'=>sprintf(TEXT_BANNERS_YEARLY_STATISTICS, $banner['banners_title']),
+                        'type'=>'3',
+                        'cellpadding'=>'',
+                        'cellspacing'=>'1',
+                        'border'=>'',
+                        'width'=>'',
+                        'vfcolor'=>'#ffffff',
+                        'hfcolor'=>'#ffffff',
+                        'vbgcolor'=>'#81a2b6',
+                        'hbgcolor'=>'#81a2b6',
+                        'vfstyle'=>'Verdana, Arial, Helvetica',
+                        'hfstyle'=>'Verdana, Arial, Helvetica',
+                        'scale'=>100/$largest,
+                        'namebgcolor'=>'#f3f5fe',
+                        'valuebgcolor'=>'#f3f5fe',
+                        'namefcolor'=>'',
+                        'valuefcolor'=>'#0000d0',
+                        'namefstyle'=>'Verdana, Arial, Helvetica',
+                        'valuefstyle'=>'',
+                        'doublefcolor'=>'#ff7339');
+
+    return html_graph($names, $values, $bars, $graph_vals, $dvalues, $dbars);
+  }
+
+////
+// draws a double vertical bar graph for the banner views vs clicks statistics
+  function tep_banner_graph_monthly($banner_id) {
+    global $banner, $HTTP_GET_VARS;
+
+    $year = (($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y'));
+
+    for ($i=1; $i<13; $i++) {
+      $names[] = strftime('%b', mktime(0,0,0,$i));
+      $values[] = '0';
+      $dvalues[] = '0';
+    }
+
+    $banner_stats_query = tep_db_query("select month(banners_history_date) as banner_month, sum(banners_shown) as value, sum(banners_clicked) as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and year(banners_history_date) = '" . $year . "' group by month(banners_history_date)");
+    while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
+      $names[($banner_stats['banner_month']-1)] = strftime('%b', mktime(0,0,0,$banner_stats['banner_month']));
+      $values[($banner_stats['banner_month']-1)] = (($banner_stats['value']) ? $banner_stats['value'] : '0');
+      $dvalues[($banner_stats['banner_month']-1)] = (($banner_stats['dvalue']) ? $banner_stats['dvalue'] : '0');
+    }
+
+    $largest = @max($values);
+
+    $bars = array();
+    $dbars = array();
+    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $bars[$i] = DIR_WS_IMAGES . 'graph_hbar_blue.gif';
+      $dbars[$i] = DIR_WS_IMAGES . 'graph_hbar_red.gif';
+    }
+
+    $graph_vals = @array('vlabel'=>TEXT_BANNERS_DATA,
+                        'hlabel'=>sprintf(TEXT_BANNERS_MONTHLY_STATISTICS, $banner['banners_title'], date('Y')),
+                        'type'=>'3',
+                        'cellpadding'=>'',
+                        'cellspacing'=>'1',
+                        'border'=>'',
+                        'width'=>'',
+                        'vfcolor'=>'#ffffff',
+                        'hfcolor'=>'#ffffff',
+                        'vbgcolor'=>'#81a2b6',
+                        'hbgcolor'=>'#81a2b6',
+                        'vfstyle'=>'Verdana, Arial, Helvetica',
+                        'hfstyle'=>'Verdana, Arial, Helvetica',
+                        'scale'=>100/$largest,
+                        'namebgcolor'=>'#f3f5fe',
+                        'valuebgcolor'=>'#f3f5fe',
+                        'namefcolor'=>'',
+                        'valuefcolor'=>'#0000d0',
+                        'namefstyle'=>'Verdana, Arial, Helvetica',
+                        'valuefstyle'=>'',
+                        'doublefcolor'=>'#ff7339');
+
+    return html_graph($names, $values, $bars, $graph_vals, $dvalues, $dbars);
+  }
+
+////
+// draws a double vertical bar graph for the banner views vs clicks statistics
+  function tep_banner_graph_daily($banner_id) {
+    global $banner, $HTTP_GET_VARS;
+
+    $year = (isset($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y'));
+    $month = (isset($HTTP_GET_VARS['month']) ? $HTTP_GET_VARS['month'] : date('n'));
+
+    $days = (date('t', mktime(0,0,0,$month))+1);
+    $stats = array();
+    for ($i=1; $i<$days; $i++) {
+      $names[] = $i;
+      $values[] = '0';
+      $dvalues[] = '0';
+    }
+
+    $banner_stats_query = tep_db_query("select dayofmonth(banners_history_date) as banner_day, banners_shown as value, banners_clicked as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and month(banners_history_date) = '" . $month . "' and year(banners_history_date) = '" . $year . "'");
+    while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
+      $names[($banner_stats['banner_day']-1)] = $banner_stats['banner_day'];
+      $values[($banner_stats['banner_day']-1)] = (($banner_stats['value']) ? $banner_stats['value'] : '0');
+      $dvalues[($banner_stats['banner_day']-1)] = (($banner_stats['dvalue']) ? $banner_stats['dvalue'] : '0');
+    }
+
+    $largest = @max($values);
+
+    $bars = array();
+    $dbars = array();
+    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
+      $bars[$i] = DIR_WS_IMAGES . 'graph_hbar_blue.gif';
+      $dbars[$i] = DIR_WS_IMAGES . 'graph_hbar_red.gif';
+    }
+
+    $graph_vals = @array('vlabel'=>TEXT_BANNERS_DATA,
+                        'hlabel'=>sprintf(TEXT_BANNERS_DAILY_STATISTICS, $banner['banners_title'], strftime('%B', mktime(0,0,0,$month)), $year),
+                        'type'=>'3',
+                        'cellpadding'=>'',
+                        'cellspacing'=>'1',
+                        'border'=>'',
+                        'width'=>'',
+                        'vfcolor'=>'#ffffff',
+                        'hfcolor'=>'#ffffff',
+                        'vbgcolor'=>'#81a2b6',
+                        'hbgcolor'=>'#81a2b6',
+                        'vfstyle'=>'Verdana, Arial, Helvetica',
+                        'hfstyle'=>'Verdana, Arial, Helvetica',
+                        'scale'=>100/$largest,
+                        'namebgcolor'=>'#f3f5fe',
+                        'valuebgcolor'=>'#f3f5fe',
+                        'namefcolor'=>'',
+                        'valuefcolor'=>'#0000d0',
+                        'namefstyle'=>'Verdana, Arial, Helvetica',
+                        'valuefstyle'=>'',
+                        'doublefcolor'=>'#ff7339');
+
+    return html_graph($names, $values, $bars, $graph_vals, $dvalues, $dbars);
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/html_output.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,354 @@
+<?php
+/*
+  $Id: html_output.php,v 1.1.1.1 2004/03/04 23:39:54 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// The HTML href link wrapper function
+  function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
+    global $request_type, $session_started, $SID, $spider_flag;
+    if ($page == '') {
+      //die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
+
+      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000">'.UNABLE_TO_DETERMINE_PAGE_LINK.'tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
+    }
+    if ($connection == 'NONSSL') {
+      $link = HTTP_SERVER . DIR_WS_ADMIN;
+    } elseif ($connection == 'SSL') {
+      if (ENABLE_SSL == 'true') {
+        // A bug in the install routines cause the DIR_WS_ADMIN to be incorrectly set in the configuration file
+        // This is a generated value.  To by pass this issue, DIR_WS_HTTPS_ADMIN will be used
+        $link = HTTPS_SERVER . DIR_WS_HTTPS_ADMIN;
+      } else {
+        $link = HTTP_SERVER . DIR_WS_HTTP_ADMIN;
+      }
+    } else {
+      //die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
+
+      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000">'.UNABLE_TO_DETERMINE_CONNECTION_METHOD_ON_PAGE_LINK.'tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
+    }
+    if ($parameters == '') {
+      $link = $link . $page . '?' . SID;
+    } else {
+      $link = $link . $page . '?' . $parameters . '&' . SID;
+    }
+
+    while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);
+
+    return $link;
+  }
+
+  function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
+    global $request_type, $session_started, $SID, $spider_flag;
+
+    if ($connection == 'NONSSL') {
+      $link = HTTP_CATALOG_SERVER . DIR_WS_HTTP_CATALOG;
+    } elseif ($connection == 'SSL') {
+      if (ENABLE_SSL_CATALOG == 'true') {
+        $link = HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG;
+      } else {
+        $link = HTTP_CATALOG_SERVER . DIR_WS_HTTP_CATALOG;
+      }
+    } else {
+     // die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
+      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000">'.UNABLE_TO_DETERMINE_CONNECTION_METHOD_ON_PAGE_LINK.'tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
+    }
+    if ($parameters == '') {
+      $link .= $page;
+    } else {
+      $link .= $page . '?' . $parameters;
+    }
+
+    while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);
+
+    return $link;
+  }
+
+////
+// The HTML image wrapper function
+  function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {
+    $image = '<img src="' . $src . '" border="0" alt="' . $alt . '"';
+    if ($alt) {
+      $image .= ' title=" ' . $alt . ' "';
+    }
+    if ($width) {
+      $image .= ' width="' . $width . '"';
+    }
+    if ($height) {
+      $image .= ' height="' . $height . '"';
+    }
+    if ($params) {
+      $image .= ' ' . $params;
+    }
+    $image .= '>';
+
+    return $image;
+  }
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Draw a 1 pixel black line
+  function tep_black_line() {
+    return tep_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', '1');
+  }
+
+////
+// Output a separator either through whitespace, or with an image
+  function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') {
+    return tep_image(DIR_WS_IMAGES . $image, '', $width, $height);
+  }
+
+////
+// Output a function button in the selected language
+  function tep_image_button($image, $alt = '', $params = '') {
+    global $language;
+
+    return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $params);
+  }
+
+////
+// javascript to dynamically update the states/provinces list when the country is changed
+// TABLES: zones
+  function tep_js_zone_list($country, $form, $field) {
+    $countries_query = tep_db_query("select distinct zone_country_id from " . TABLE_ZONES . " order by zone_country_id");
+    $num_country = 1;
+    $output_string = '';
+    while ($countries = tep_db_fetch_array($countries_query)) {
+      if ($num_country == 1) {
+        $output_string .= '  if (' . $country . ' == "' . $countries['zone_country_id'] . '") {' . "\n";
+      } else {
+        $output_string .= '  } else if (' . $country . ' == "' . $countries['zone_country_id'] . '") {' . "\n";
+      }
+
+      $states_query = tep_db_query("select zone_name, zone_id from " . TABLE_ZONES . " where zone_country_id = '" . $countries['zone_country_id'] . "' order by zone_name");
+
+      $num_state = 1;
+      while ($states = tep_db_fetch_array($states_query)) {
+        if ($num_state == '1') $output_string .= '    ' . $form . '.' . $field . '.options[0] = new Option("' . PLEASE_SELECT . '", "");' . "\n";
+        $output_string .= '    ' . $form . '.' . $field . '.options[' . $num_state . '] = new Option("' . $states['zone_name'] . '", "' . $states['zone_id'] . '");' . "\n";
+        $num_state++;
+      }
+      $num_country++;
+    }
+    $output_string .= '  } else {' . "\n" .
+                      '    ' . $form . '.' . $field . '.options[0] = new Option("' . TYPE_BELOW . '", "");' . "\n" .
+                      '  }' . "\n";
+
+    return $output_string;
+  }
+
+////
+// Output a form
+  function tep_draw_form($name, $action, $parameters = '', $method = 'post', $params = '', $connection = 'NONSSL') {
+    $form = '<form name="' . tep_output_string($name) . '" action="';
+
+    if (tep_not_null($parameters)) {
+      $form .= tep_href_link($action, $parameters, $connection);
+    } else {
+      $form .= tep_href_link($action, '', $connection);
+    }
+    $form .= '" method="' . tep_output_string($method) . '"';
+    if (tep_not_null($params)) {
+      $form .= ' ' . $params;
+    }
+    $form .= '>';
+
+    return $form;
+  }
+
+////
+// Output a form input field
+  function tep_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true) {
+    $field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
+
+    if (isset($GLOBALS[$name]) && ($reinsert_value == true) && is_string($GLOBALS[$name])) {
+      $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';
+    } elseif (tep_not_null($value)) {
+      $field .= ' value="' . tep_output_string($value) . '"';
+    }
+
+    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
+
+    $field .= '>';
+
+    if ($required == true) $field .= TEXT_FIELD_REQUIRED;
+
+    return $field;
+  }
+
+////
+// Output a form password field
+  function tep_draw_password_field($name, $value = '', $required = false) {
+    $field = tep_draw_input_field($name, $value, 'maxlength="40"', $required, 'password', false);
+
+    return $field;
+  }
+
+////
+// Output a form filefield
+//  function tep_draw_file_field($name, $required = false) {
+//    $field = tep_draw_input_field($name, '', $required, 'file');
+//
+ //   return $field;
+ // }
+
+////
+// Output a form filefield
+ function tep_draw_file_field($name, $size = '25', $required = false) {
+    $field = tep_draw_input_field($name, '', 'size=' . $size, $required, 'file');
+
+    return $field;
+  }
+
+
+
+
+
+//Admin begin
+////
+// Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field()
+//  function tep_draw_selection_field($name, $type, $value = '', $checked = false, $compare = '') {
+//    $selection = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
+//
+//    if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($value) . '"';
+//
+//    if ( ($checked == true) || (isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && ($GLOBALS[$name] == 'on')) || (isset($value) && isset($GLOBALS[$name]) && (stripslashes($GLOBALS[$name]) == $value)) || (tep_not_null($value) && tep_not_null($compare) && ($value == $compare)) ) {
+//      $selection .= ' CHECKED';
+//    }
+//
+//    $selection .= '>';
+//
+//    return $selection;
+//  }
+//
+////
+// Output a form checkbox field
+//  function tep_draw_checkbox_field($name, $value = '', $checked = false, $compare = '') {
+//    return tep_draw_selection_field($name, 'checkbox', $value, $checked, $compare);
+//  }
+//
+////
+// Output a form radio field
+//  function tep_draw_radio_field($name, $value = '', $checked = false, $compare = '') {
+//    return tep_draw_selection_field($name, 'radio', $value, $checked, $compare);
+//  }
+////
+// Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field()
+  function tep_draw_selection_field($name, $type, $value = '', $checked = false, $compare = '', $parameter = '') {
+    $selection = '<input type="' . $type . '" name="' . $name . '"';
+    if ($value != '') {
+      $selection .= ' value="' . $value . '"';
+    }
+    if ( ($checked == true) || ($GLOBALS[$name] == 'on') || ($value && ($GLOBALS[$name] == $value)) || ($value && ($value == $compare)) ) {
+      $selection .= ' CHECKED';
+    }
+    if ($parameter != '') {
+      $selection .= ' ' . $parameter;
+    }
+    $selection .= '>';
+
+    return $selection;
+  }
+
+////
+// Output a form checkbox field
+  function tep_draw_checkbox_field($name, $value = '', $checked = false, $compare = '', $parameter = '') {
+    return tep_draw_selection_field($name, 'checkbox', $value, $checked, $compare, $parameter);
+  }
+
+
+////
+// Output a form radio field
+  function tep_draw_radio_field($name, $value = '', $checked = false, $compare = '', $parameter = '') {
+    return tep_draw_selection_field($name, 'radio', $value, $checked, $compare, $parameter);
+  }
+//Admin end
+
+////
+// Output a form textarea field
+  function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
+    // the wrap is removed because it is not W3C standard and creates problem in IE
+    $field = '<textarea name="' . tep_output_string($name) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
+
+    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
+
+    $field .= '>';
+
+    if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
+      $field .= stripslashes($GLOBALS[$name]);
+    } elseif (tep_not_null($text)) {
+      $field .= $text;
+    }
+
+    $field .= '</textarea>';
+
+    return $field;
+  }
+
+////
+// Output a form hidden field
+  function tep_draw_hidden_field($name, $value = '', $parameters = '') {
+    $field = '<input type="hidden" name="' . tep_output_string($name) . '"';
+
+    if (tep_not_null($value)) {
+      $field .= ' value="' . tep_output_string($value) . '"';
+    } elseif (isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) {
+      $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';
+    }
+
+    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
+
+    $field .= '>';
+
+    return $field;
+  }
+
+////
+// Output a form pull down menu
+  function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
+    $field = '<select name="' . tep_output_string($name) . '"';
+
+    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
+
+    $field .= '>';
+
+    if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);
+
+    for ($i=0, $n=sizeof($values); $i<$n; $i++) {
+      $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
+      if ($default == $values[$i]['id']) {
+        $field .= ' SELECTED';
+      }
+
+      $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>';
+    }
+    $field .= '</select>';
+
+    if ($required == true) $field .= TEXT_FIELD_REQUIRED;
+
+    return $field;
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/information_html_output.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/information_html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/information_html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+
+// Output a function button in the selected language
+  function tep_information_image_button($image, $alt = '', $params = '') {
+    global $language;
+
+    return tep_image(DIR_WS_LANGUAGES . $language . '/images/' . $image, $alt, '', '', $params);
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/languages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:39:54 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function tep_get_languages_directory($code) {
+    global $languages_id;
+
+    $language_query = tep_db_query("select languages_id, directory from " . TABLE_LANGUAGES . " where code = '" . tep_db_input($code) . "'");
+    if (tep_db_num_rows($language_query)) {
+      $language = tep_db_fetch_array($language_query);
+      $languages_id = $language['languages_id'];
+      return $language['directory'];
+    } else {
+      return false;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/links.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: links.php,v 1.1.1.1 2004/03/04 23:39:55 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function tep_get_link_category_name($link_category_id, $language_id) {
+    $link_category_query = tep_db_query("select link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_id = '" . (int)$link_category_id . "' and language_id = '" . (int)$language_id . "'");
+    $link_category = tep_db_fetch_array($link_category_query);
+
+    return $link_category['link_categories_name'];
+  }
+
+  function tep_get_link_category_description($link_category_id, $language_id) {
+    $link_category_query = tep_db_query("select link_categories_description from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_id = '" . (int)$link_category_id . "' and language_id = '" . (int)$language_id . "'");
+    $link_category = tep_db_fetch_array($link_category_query);
+
+    return $link_category['link_categories_description'];
+  }
+
+  function tep_remove_link_category($link_category_id) {
+    $link_category_image_query = tep_db_query("select link_categories_image from " . TABLE_LINK_CATEGORIES . " where link_categories_id = '" . (int)$link_category_id . "'");
+    $link_category_image = tep_db_fetch_array($link_category_image_query);
+
+    $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_LINK_CATEGORIES . " where link_categories_image = '" . tep_db_input($link_category_image['link_categories_image']) . "'");
+    $duplicate_image = tep_db_fetch_array($duplicate_image_query);
+
+    if ($duplicate_image['total'] < 2) {
+      if (file_exists(DIR_FS_CATALOG_IMAGES . $link_category_image['link_categories_image'])) {
+        @unlink(DIR_FS_CATALOG_IMAGES . $link_category_image['link_categories_image']);
+      }
+    }
+
+    tep_db_query("delete from " . TABLE_LINK_CATEGORIES . " where link_categories_id = '" . (int)$link_category_id . "'");
+    tep_db_query("delete from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_id = '" . (int)$link_category_id . "'");
+    tep_db_query("delete from " . TABLE_LINKS_TO_LINK_CATEGORIES . " where link_categories_id = '" . (int)$link_category_id . "'");
+  }
+
+  function tep_remove_link($link_id) {
+    tep_db_query("delete from " . TABLE_LINKS . " where links_id = '" . (int)$link_id . "'");
+    tep_db_query("delete from " . TABLE_LINKS_TO_LINK_CATEGORIES . " where links_id = '" . (int)$link_id . "'");
+    tep_db_query("delete from " . TABLE_LINKS_DESCRIPTION . " where links_id = '" . (int)$link_id . "'");
+  }
+
+// clone of tep_info_image() sans file_exists (which doesn't work on remote files)
+  function tep_link_info_image($image, $alt, $width = '', $height = '') {
+    if (tep_not_null($image)) {
+      $image = tep_image($image, $alt, $width, $height);
+    } else {
+      $image = TEXT_IMAGE_NONEXISTENT;
+    }
+
+    return $image;
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/localization.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/localization.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/localization.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: localization.php,v 1.1.1.1 2004/03/04 23:39:55 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function quote_oanda_currency($code, $base = DEFAULT_CURRENCY) {
+    $page = file('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $code .  '&format=CSV&dest=Get+Table&sel_list=' . $base);
+
+    $match = array();
+
+    preg_match('/(.+),(\w{3}),([0-9.]+),([0-9.]+)/i', implode('', $page), $match);
+
+    if (sizeof($match) > 0) {
+      return $match[3];
+    } else {
+      return false;
+    }
+  }
+
+  function quote_xe_currency($to, $from = DEFAULT_CURRENCY) {
+    $page = file('http://www.xe.net/ucc/convert.cgi?Amount=1&From=' . $from . '&To=' . $to);
+
+    $match = array();
+
+    preg_match('/[0-9.]+\s*' . $from . '\s*=\s*([0-9.]+)\s*' . $to . '/', implode('', $page), $match);
+
+    if (sizeof($match) > 0) {
+      return $match[1];
+    } else {
+      return false;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/pages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<?php
+/*
+  $Id: pages.php,v 1.1.1.1 2004/03/04 23:39:55 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function tep_pages_get_category_name($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_name from " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_name'];
+  }
+
+  function tep_pages_get_category_description($category_id, $language_id) {
+    $category_query = tep_db_query("select categories_description from " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['categories_description'];
+  }
+
+  function tep_pages_get_page_title($page_id, $language_id) {
+    $page_query = tep_db_query("select pages_title from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$page_id . "' and language_id = '" . (int)$language_id . "'");
+    $page = tep_db_fetch_array($page_query);
+
+    return $page['pages_title'];
+  }
+
+  function tep_pages_get_page_blurb($page_id, $language_id) {
+    $page_query = tep_db_query("select pages_blurb from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$page_id . "' and language_id = '" . (int)$language_id . "'");
+    $page = tep_db_fetch_array($page_query);
+
+    return $page['pages_blurb'];
+  }
+
+  function tep_pages_get_page_body($page_id, $language_id) {
+    $page_query = tep_db_query("select pages_body from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$page_id . "' and language_id = '" . (int)$language_id . "'");
+    $page = tep_db_fetch_array($page_query);
+
+    return $page['pages_body'];
+  }
+
+  function tep_pages_get_page_meta_title($page_id, $language_id) {
+    $page_query = tep_db_query("select pages_meta_title from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$page_id . "' and language_id = '" . (int)$language_id . "'");
+    $page = tep_db_fetch_array($page_query);
+
+    return $page['pages_meta_title'];
+  }
+
+  function tep_pages_get_page_meta_keywords($page_id, $language_id) {
+    $page_query = tep_db_query("select pages_meta_keywords from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$page_id . "' and language_id = '" . (int)$language_id . "'");
+    $page = tep_db_fetch_array($page_query);
+
+    return $page['pages_meta_keywords'];
+  }
+
+  function tep_pages_get_page_meta_description($page_id, $language_id) {
+    $page_query = tep_db_query("select pages_meta_description from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$page_id . "' and language_id = '" . (int)$language_id . "'");
+    $page = tep_db_fetch_array($page_query);
+
+    return $page['pages_meta_description'];
+  }
+
+  function tep_pages_remove_category($category_id) {
+    $category_image_query = tep_db_query("select categories_image from " . TABLE_PAGES_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+    $category_image = tep_db_fetch_array($category_image_query);
+
+    // if same image is used for some other category, don't delete
+    $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_PAGES_CATEGORIES . " where categories_image = '" . tep_db_input($category_image['categories_image']) . "'");
+    $duplicate_image = tep_db_fetch_array($duplicate_image_query);
+
+    if ($duplicate_image['total'] < 2) {
+      if (file_exists(DIR_FS_CATALOG_IMAGES . $category_image['categories_image'])) {
+        @unlink(DIR_FS_CATALOG_IMAGES . $category_image['categories_image']);
+      }
+    }
+
+    tep_db_query("delete from " . TABLE_PAGES_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_PAGES_TO_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
+  }
+
+  function tep_pages_remove_page($page_id) {
+    tep_db_query("delete from " . TABLE_PAGES . " where pages_id = '" . (int)$page_id . "'");
+    tep_db_query("delete from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$page_id . "'");
+    tep_db_query("delete from " . TABLE_PAGES_TO_CATEGORIES . " where pages_id = '" . (int)$page_id . "'");
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/password_funcs.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/password_funcs.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/password_funcs.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: password_funcs.php,v 1.1.1.1 2004/03/04 23:39:56 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// This funstion validates a plain text password with an
+// encrpyted password
+  function tep_validate_password($plain, $encrypted) {
+    if (tep_not_null($plain) && tep_not_null($encrypted)) {
+// split apart the hash / salt
+      $stack = explode(':', $encrypted);
+
+      if (sizeof($stack) != 2) return false;
+
+      if (md5($stack[1] . $plain) == $stack[0]) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+////
+// This function makes a new password from a plaintext password.
+  function tep_encrypt_password($plain) {
+    $password = '';
+
+    for ($i=0; $i<10; $i++) {
+      $password .= tep_rand();
+    }
+
+    $salt = substr(md5($password), 0, 2);
+
+    $password = md5($salt . $plain) . ':' . $salt;
+
+    return $password;
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/rss2html.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/rss2html.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/rss2html.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+<?php
+$_item = array();
+$_depth = array();
+$_tags = array("dummy");
+/* "dummy" prevents unecessary subtraction
+* in the $_depth indexes */
+
+function initArray()
+{
+    global $_item;
+    $_item = array("TITLE"=>"", "LINK"=>"", "DESCRIPTION"=>"", "URL"=>"", "ID"=>"");
+}
+
+function startElement($parser, $name){
+    global $_depth, $_tags, $_item;
+
+    if (($name=="ITEM") ||($name=="CHANNEL") || ($name=="IMAGE") || ($name=="ENTRY")) {
+        initArray();
+    }
+    @$_depth[$parser]++;
+    array_push($_tags, $name);
+}
+
+function endElement($parser, $name){
+    global $_depth, $_tags, $_item;
+
+    array_pop($_tags);
+    $_depth[$parser]--;
+    switch ($name) {
+
+        case "ITEM":
+//            echo "<a class=\"adminLink\" target=_blank href={$_item['LINK']}>{$_item['TITLE']}</a><!--br>".nl2br($_item['DESCRIPTION'])."--><br>\n";
+  Echo '  <style type=\"text/css\">; main { font-family: Verdana,Arial,sans-serif; font-size: 12px;} </style>' ;
+      echo "<a class=\"adminLink\" target=_blank href={$_item['LINK']}>{$_item['TITLE']}</a><br><br>\n";
+            initArray();
+            break;
+    }
+}
+
+function parseData($parser, $text){
+    global $_depth, $_tags, $_item;
+
+    $crap = preg_replace ("/\s/", "", $text);
+    /* is the data just whitespace?
+       if so, we don't want it! */
+
+    if ($crap) {
+        $text = preg_replace ("/^\s+/", "", $text);
+        /* get rid of leading whitespace */
+        if (@$_item[$_tags[$_depth[$parser]]]) {
+            $_item[$_tags[$_depth[$parser]]] .= $text;
+        } else {
+            $_item[$_tags[$_depth[$parser]]] = $text;
+        }
+    }
+}
+
+function parseRDF($file){
+    global $_depth, $_tags, $_item;
+
+    $xml_parser = xml_parser_create();
+    initArray();
+
+    /* Set up event handlers */
+    xml_set_element_handler($xml_parser, "startElement", "endElement");
+    xml_set_character_data_handler($xml_parser, "parseData");
+
+    /* Open up the file */
+    $fp = @fopen ($file, "r");
+    if ($fp===false) {
+// error reading or opening file
+   return false;
+       }
+       
+    while ($data = fread ($fp, 4096)) {
+        if (!xml_parse($xml_parser, $data, feof($fp))) {
+            die (sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)));
+        }
+    }
+
+    fclose($fp);
+    xml_parser_free($xml_parser);
+}
+
+//parseRDF("http://creloaded.com/rss/news2.php");
+//parseRDF("http://creforge.com/export/rss_sfnews.php");
+
+?>  
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/functions/sessions.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/sessions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/sessions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,179 @@
+<?php
+/*
+  $Id: sessions.php,v 1.1.1.1 2004/03/04 23:39:56 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (STORE_SESSIONS == 'mysql') {
+    if (defined('DIR_WS_ADMIN')) {
+      if (!$SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 1440)) {
+        $SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 1440);
+      }
+    } else {
+      if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
+        $SESS_LIFE = 9600;
+      }
+    }
+
+    function _sess_open($save_path, $session_name) {
+      return true;
+    }
+
+    function _sess_close() {
+      return true;
+    }
+
+    function _sess_read($key) {
+      $qid = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "' and expiry > '" . time() . "'");
+      $value = tep_db_fetch_array($qid);
+
+      if ($value['value']) {
+        return $value['value'];
+      }
+
+      return false;
+    }
+
+    function _sess_write($key, $val) {
+      global $SESS_LIFE;
+
+      $expiry = time() + $SESS_LIFE;
+      $value = $val;
+
+      $qid = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
+      $total = tep_db_fetch_array($qid);
+
+      if ($total['total'] > 0) {
+        return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . tep_db_input($expiry) . "', value = '" . tep_db_input($value) . "' where sesskey = '" . tep_db_input($key) . "'");
+      } else {
+        return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . tep_db_input($key) . "', '" . tep_db_input($expiry) . "', '" . tep_db_input($value) . "')");
+      }
+    }
+
+    function _sess_destroy($key) {
+      return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
+    }
+
+    function _sess_gc($maxlifetime) {
+      tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");
+
+      return true;
+    }
+
+    session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
+  }
+
+  function tep_session_start() {
+    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;
+
+    $sane_session_id = true;
+
+    if (isset($HTTP_GET_VARS[tep_session_name()])) {
+      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_GET_VARS[tep_session_name()]) == false) {
+        unset($HTTP_GET_VARS[tep_session_name()]);
+
+        $sane_session_id = false;
+      }
+    } elseif (isset($HTTP_POST_VARS[tep_session_name()])) {
+      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_POST_VARS[tep_session_name()]) == false) {
+        unset($HTTP_POST_VARS[tep_session_name()]);
+
+        $sane_session_id = false;
+      }
+    } elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {
+      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {
+        $session_data = session_get_cookie_params();
+
+        setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);
+
+        $sane_session_id = false;
+      }
+    }
+
+    if ($sane_session_id == false) {
+      tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
+    }
+
+    return session_start();
+  }
+
+  function tep_session_register($variable) {
+    global $session_started;
+
+    if ($session_started == true) {
+      return session_register($variable);
+    } else {
+      return false;
+    }
+  }
+
+  function tep_session_is_registered($variable) {
+    return session_is_registered($variable);
+  }
+
+  function tep_session_unregister($variable) {
+    return session_unregister($variable);
+  }
+
+  function tep_session_id($sessid = '') {
+    if (!empty($sessid)) {
+      return session_id($sessid);
+    } else {
+      return session_id();
+    }
+  }
+
+  function tep_session_name($name = '') {
+    if (!empty($name)) {
+      return session_name($name);
+    } else {
+      return session_name();
+    }
+  }
+
+  function tep_session_close() {
+    if (PHP_VERSION >= '4.0.4') {
+      return session_write_close();
+    } elseif (function_exists('session_close')) {
+      return session_close();
+    }
+  }
+
+  function tep_session_destroy() {
+    return session_destroy();
+  }
+
+  function tep_session_save_path($path = '') {
+    if (!empty($path)) {
+      return session_save_path($path);
+    } else {
+      return session_save_path();
+    }
+  }
+
+  function tep_session_recreate() {
+    if (PHP_VERSION >= 4.1) {
+      $session_backup = $_SESSION;
+
+      unset($_COOKIE[tep_session_name()]);
+
+      tep_session_destroy();
+
+      if (STORE_SESSIONS == 'mysql') {
+        session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
+      }
+
+      tep_session_start();
+
+      $_SESSION = $session_backup;
+      unset($session_backup);
+    }
+  }
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/functions/validations.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/functions/validations.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/functions/validations.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,122 @@
+<?php
+/*
+  $Id: validations.php,v 1.1.1.1 2004/03/04 23:39:56 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_validate_email
+  //
+  // Arguments   : email   email address to be checked
+  //
+  // Return      : true  - valid email address
+  //               false - invalid email address
+  //
+  // Description : function for validating email address that conforms to RFC 822 specs
+  //
+  //               This function is converted from a JavaScript written by
+  //               Sandeep V. Tamhankar (stamhankar at hotmail.com). The original JavaScript
+  //               is available at http://javascript.internet.com
+  //
+  // Sample Valid Addresses:
+  //
+  //    first.last at host.com
+  //    firstlast at host.to
+  //    "first last"@host.com
+  //    "first at last"@host.com
+  //    first-last at host.com
+  //    first.last@[123.123.123.123]
+  //
+  // Invalid Addresses:
+  //
+  //    first last at host.com
+  //
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_validate_email($email) {
+    $valid_address = true;
+
+    $mail_pat = '^(.+)@(.+)$';
+    $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
+    $atom = "$valid_chars+";
+    $quoted_user='(\"[^\"]*\")';
+    $word = "($atom|$quoted_user)";
+    $user_pat = "^$word(\.$word)*$";
+    $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
+    $domain_pat = "^$atom(\.$atom)*$";
+
+    if (eregi($mail_pat, $email, $components)) {
+      $user = $components[1];
+      $domain = $components[2];
+      // validate user
+      if (eregi($user_pat, $user)) {
+        // validate domain
+        if (eregi($ip_domain_pat, $domain, $ip_components)) {
+          // this is an IP address
+          for ($i=1;$i<=4;$i++) {
+            if ($ip_components[$i] > 255) {
+              $valid_address = false;
+              break;
+            }
+          }
+        }
+        else {
+          // Domain is a name, not an IP
+          if (eregi($domain_pat, $domain)) {
+            /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD
+               and that there's a hostname preceding the domain or country. */
+            $domain_components = explode(".", $domain);
+            // Make sure there's a host name preceding the domain.
+            if (sizeof($domain_components) < 2) {
+              $valid_address = false;
+            } else {
+              $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);
+              // Allow all 2-letter TLDs (ccTLDs)
+              if (eregi('^[a-z][a-z]$', $top_level_domain) != 1) {
+                $tld_pattern = '';
+                // Get authorized TLDs from text file
+                $tlds = file(DIR_WS_INCLUDES . 'tld.txt');
+                while (list(,$line) = each($tlds)) {
+                  // Get rid of comments
+                  $words = explode('#', $line);
+                  $tld = trim($words[0]);
+                  // TLDs should be 3 letters or more
+                  if (eregi('^[a-z]{3,}$', $tld) == 1) {
+                    $tld_pattern .= '^' . $tld . '$|';
+                  }
+                }
+                // Remove last '|'
+                $tld_pattern = substr($tld_pattern, 0, -1);
+                if (eregi("$tld_pattern", $top_level_domain) == 0) {
+                    $valid_address = false;
+                }
+              }
+            }
+          }
+          else {
+            $valid_address = false;
+          }
+        }
+      }
+      else {
+        $valid_address = false;
+      }
+    }
+    else {
+      $valid_address = false;
+    }
+    if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') {
+      if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) {
+        $valid_address = false;
+      }
+    }
+    return $valid_address;
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/general.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/general.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/general.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+function SetFocus() {
+//  if (document.forms.length > 0) {
+//    var field = document.forms[0];
+//    for (i=0; i<field.length; i++) {
+//      if ( (field.elements[i].type != "image") &&
+//           (field.elements[i].type != "hidden") &&
+//           (field.elements[i].type != "reset") &&
+//           (field.elements[i].type != "submit") ) {
+//
+//        document.forms[0].elements[i].focus();
+//
+//        if ( (field.elements[i].type == "text") ||
+//             (field.elements[i].type == "password") )
+//          document.forms[0].elements[i].select();
+//
+//        break;
+//      }
+//    }
+//  }
+}
+
+function rowOverEffect(object) {
+  if (object.className == 'dataTableRow') object.className = 'dataTableRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'dataTableRowOver') object.className = 'dataTableRow';
+}

Added: trunk/direct.openmoko.com/admin/includes/graphs/banner_daily.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/graphs/banner_daily.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/graphs/banner_daily.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: banner_daily.php,v 1.1.1.1 2004/03/04 23:39:56 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  include(DIR_WS_CLASSES . 'phplot.php');
+
+  $year = (($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y'));
+  $month = (($HTTP_GET_VARS['month']) ? $HTTP_GET_VARS['month'] : date('n'));
+
+  $days = (date('t', mktime(0,0,0,$month))+1);
+  $stats = array();
+  for ($i=1; $i<$days; $i++) {
+    $stats[] = array($i, '0', '0');
+  }
+
+  $banner_stats_query = tep_db_query("select dayofmonth(banners_history_date) as banner_day, banners_shown as value, banners_clicked as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and month(banners_history_date) = '" . $month . "' and year(banners_history_date) = '" . $year . "'");
+  while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
+    $stats[($banner_stats['banner_day']-1)] = array($banner_stats['banner_day'], (($banner_stats['value']) ? $banner_stats['value'] : '0'), (($banner_stats['dvalue']) ? $banner_stats['dvalue'] : '0'));
+  }
+
+  $graph = new PHPlot(600, 350, 'images/graphs/banner_daily-' . $banner_id . '.' . $banner_extension);
+
+  $graph->SetFileFormat($banner_extension);
+  $graph->SetIsInline(1);
+  $graph->SetPrintImage(0);
+
+  $graph->SetSkipBottomTick(1);
+  $graph->SetDrawYGrid(1);
+  $graph->SetPrecisionY(0);
+  $graph->SetPlotType('lines');
+
+  $graph->SetPlotBorderType('left');
+  $graph->SetTitleFontSize('4');
+  $graph->SetTitle(sprintf(TEXT_BANNERS_DAILY_STATISTICS, $banner['banners_title'], strftime('%B', mktime(0,0,0,$month)), $year));
+
+  $graph->SetBackgroundColor('white');
+
+  $graph->SetVertTickPosition('plotleft');
+  $graph->SetDataValues($stats);
+  $graph->SetDataColors(array('blue','red'),array('blue', 'red'));
+
+  $graph->DrawGraph();
+
+  $graph->PrintImage();
+?>

Added: trunk/direct.openmoko.com/admin/includes/graphs/banner_infobox.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/graphs/banner_infobox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/graphs/banner_infobox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: banner_infobox.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  include(DIR_WS_CLASSES . 'phplot.php');
+
+  $stats = array();
+  $banner_stats_query = tep_db_query("select dayofmonth(banners_history_date) as name, banners_shown as value, banners_clicked as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and to_days(now()) - to_days(banners_history_date) < " . $days . " order by banners_history_date");
+  while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
+    $stats[] = array($banner_stats['name'], $banner_stats['value'], $banner_stats['dvalue']);
+  }
+
+  if (sizeof($stats) < 1) $stats = array(array(date('j'), 0, 0));
+
+  $graph = new PHPlot(200, 220, 'images/graphs/banner_infobox-' . $banner_id . '.' . $banner_extension);
+
+  $graph->SetFileFormat($banner_extension);
+  $graph->SetIsInline(1);
+  $graph->SetPrintImage(0);
+
+  $graph->draw_vert_ticks = 0;
+  $graph->SetSkipBottomTick(1);
+  $graph->SetDrawXDataLabels(0);
+  $graph->SetDrawYGrid(0);
+  $graph->SetPlotType('bars');
+  $graph->SetDrawDataLabels(1);
+  $graph->SetLabelScalePosition(1);
+  $graph->SetMarginsPixels(15,15,15,30);
+
+  $graph->SetTitleFontSize('4');
+  $graph->SetTitle(TEXT_BANNERS_LAST_3_DAYS);
+
+  $graph->SetDataValues($stats);
+  $graph->SetDataColors(array('blue','red'),array('blue', 'red'));
+
+  $graph->DrawGraph();
+
+  $graph->PrintImage();
+?>

Added: trunk/direct.openmoko.com/admin/includes/graphs/banner_monthly.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/graphs/banner_monthly.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/graphs/banner_monthly.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: banner_monthly.php,v 1.1.1.1 2004/03/04 23:39:56 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  include(DIR_WS_CLASSES . 'phplot.php');
+
+  $year = (($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y'));
+
+  $stats = array();
+  for ($i=1; $i<13; $i++) {
+    $stats[] = array(strftime('%b', mktime(0,0,0,$i)), '0', '0');
+  }
+
+  $banner_stats_query = tep_db_query("select month(banners_history_date) as banner_month, sum(banners_shown) as value, sum(banners_clicked) as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and year(banners_history_date) = '" . $year . "' group by banner_month");
+  while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
+    $stats[($banner_stats['banner_month']-1)] = array(strftime('%b', mktime(0,0,0,$banner_stats['banner_month'])), (($banner_stats['value']) ? $banner_stats['value'] : '0'), (($banner_stats['dvalue']) ? $banner_stats['dvalue'] : '0'));
+  }
+
+  $graph = new PHPlot(600, 350, 'images/graphs/banner_monthly-' . $banner_id . '.' . $banner_extension);
+
+  $graph->SetFileFormat($banner_extension);
+  $graph->SetIsInline(1);
+  $graph->SetPrintImage(0);
+
+  $graph->SetSkipBottomTick(1);
+  $graph->SetDrawYGrid(1);
+  $graph->SetPrecisionY(0);
+  $graph->SetPlotType('lines');
+
+  $graph->SetPlotBorderType('left');
+  $graph->SetTitleFontSize('4');
+  $graph->SetTitle(sprintf(TEXT_BANNERS_MONTHLY_STATISTICS, $banner['banners_title'], $year));
+
+  $graph->SetBackgroundColor('white');
+
+  $graph->SetVertTickPosition('plotleft');
+  $graph->SetDataValues($stats);
+  $graph->SetDataColors(array('blue','red'),array('blue', 'red'));
+
+  $graph->DrawGraph();
+
+  $graph->PrintImage();
+?>

Added: trunk/direct.openmoko.com/admin/includes/graphs/banner_yearly.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/graphs/banner_yearly.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/graphs/banner_yearly.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: banner_yearly.php,v 1.1.1.1 2004/03/04 23:39:56 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  include(DIR_WS_CLASSES . 'phplot.php');
+
+  $stats = array(array('0', '0', '0'));
+  $banner_stats_query = tep_db_query("select year(banners_history_date) as year, sum(banners_shown) as value, sum(banners_clicked) as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' group by year");
+  while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
+    $stats[] = array($banner_stats['year'], (($banner_stats['value']) ? $banner_stats['value'] : '0'), (($banner_stats['dvalue']) ? $banner_stats['dvalue'] : '0'));
+  }
+
+  $graph = new PHPlot(600, 350, 'images/graphs/banner_yearly-' . $banner_id . '.' . $banner_extension);
+
+  $graph->SetFileFormat($banner_extension);
+  $graph->SetIsInline(1);
+  $graph->SetPrintImage(0);
+
+  $graph->SetSkipBottomTick(1);
+  $graph->SetDrawYGrid(1);
+  $graph->SetPrecisionY(0);
+  $graph->SetPlotType('lines');
+
+  $graph->SetPlotBorderType('left');
+  $graph->SetTitleFontSize('4');
+  $graph->SetTitle(sprintf(TEXT_BANNERS_YEARLY_STATISTICS, $banner['banners_title']));
+
+  $graph->SetBackgroundColor('white');
+
+  $graph->SetVertTickPosition('plotleft');
+  $graph->SetDataValues($stats);
+  $graph->SetDataColors(array('blue','red'),array('blue', 'red'));
+
+  $graph->DrawGraph();
+
+  $graph->PrintImage();
+?>

Added: trunk/direct.openmoko.com/admin/includes/header/admin_logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/header/admin_logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/header/bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/header/bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/header/header.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/header/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/header/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,120 @@
+<style>
+body {
+  margin: 0px;
+  padding: 0px;
+  color : #333;
+  background-color : #FFF;
+  font-size : 11px;
+  font-family : Arial, Helvetica, sans-serif;
+}
+#wrapper {
+        border: 0px;
+        margin: 0px;
+        margin-left: auto;
+        margin-right: auto;
+        padding: 0px;
+}
+#header {
+        background-color: #FFF;
+        background-position: right top;
+        border-bottom: 4px solid #80B5D7;
+}
+#creHead {
+        position: relative;
+        width: 100%;
+        background: url(header/bg.gif);
+        margin: 0px;
+        padding: 0px;
+}
+#break {
+  height: 50px;
+}
+form {
+    margin: 0px;
+}
+.button {
+  border : solid 1px #cccccc;
+  background: #E9ECEF;
+  color : #666666;
+  font-weight : bold;
+  font-size : 11px;
+  padding: 4px;
+}
+.login {
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 6em;
+  padding: 15px;
+  border: 1px solid #cccccc;
+  width: 429px;
+  background: #F1F3F5;
+}
+.login h1 {
+  background-position: left top;
+  color: #333;
+  margin: 0px;
+  height: 50px;
+  padding: 15px 4px 0 50px;
+  text-align: left;
+  font-size: 1.5em;
+}
+.login p {
+  padding: 0 1em 0 1em;
+  }
+.form-block {
+  border: 1px solid #cccccc;
+  background: #E9ECEF;
+  padding-top: 15px;
+  padding-left: 10px;
+  padding-bottom: 10px;
+  padding-right: 10px;
+}
+.login-form {
+  text-align: left;
+  float: right;
+  width: 60%;
+}
+.login-text {
+  text-align: left;
+  width: 40%;
+  float: left;
+}
+.inputlabel {
+  font-weight: bold;
+  text-align: left;
+  }
+.inputbox {
+  width: 150px;
+  margin: 0 0 1em 0;
+  border: 1px solid #cccccc;
+  }
+.clr {
+    clear:both;
+    }
+.ctr {
+  text-align: center;
+}
+a.bdLink:link, a.bdLink:visited {
+  color: #000000;
+  font-weight: bold;
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 10px;
+}
+a.bdLink:hover {
+  color: #000000;
+  text-decoration:underline;
+}
+</style>
+<div id="wrapper">
+    <div id="header">
+           <div id="creHead">
+             <table width="100%"  border="0" cellspacing="0" cellpadding="0">
+               <tr>
+                 <td><img src="header/admin_logo.gif" alt="" /></td>
+                 <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="bdLink">' . HEADER_TITLE_ADMINISTRATION . '</a>';?>&nbsp;&nbsp;&nbsp; <?php echo '<a target=_blank href="' . tep_catalog_href_link() . '" class="bdLink" "target=_blank">';?>Catalog</a>
+&nbsp;&nbsp;&nbsp; <?php echo '<a target=_blank href="http://www.creloaded.com" class="bdLink" "target=_blank">';?><?php echo SUPPORT_DESK?></a> &nbsp;&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '" class="bdLink">' . HEADER_TITLE_LOGOFF . '</a>';?>&nbsp;&nbsp;&nbsp;&nbsp;</td>
+               </tr>
+             </table>
+           </div>
+    </div>
+</div>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/header/header_blue.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/header/header_blue.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/header/security.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/header/security.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/header.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,159 @@
+<?php
+/*
+  $Id: header.php,v 1.1.1.1 2004/03/04 23:39:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// Langauge code
+  $languages = tep_get_languages();
+  $languages_array = array();
+  $languages_selected = DEFAULT_LANGUAGE;
+  for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+    $languages_array[] = array('id' => $languages[$i]['code'],
+                               'text' => $languages[$i]['name']);
+    if ($languages[$i]['directory'] == $language) {
+      $languages_selected = $languages[$i]['code'];
+    }
+  }
+ 
+// Langauge code EOF  
+
+?>
+
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . 'warnings.php'); ?>
+<!-- warning_eof //-->
+
+<table width="100%"  border="0" cellpadding="2" cellspacing="2" bgcolor="#AEBDCC">
+  <tr>
+    <td width="39%" height="70"><img src="images/loaded_header_logo.gif" height="60" /></td>
+    <td width="61%" align="center">
+
+<!--Banner Script mods to fix TEXT ONLY ad area for Admin Header 
+    This ad area reserved for Security Alert System - Please DO NOT change! --> 
+<!--Banner Script Start-->
+<script language='JavaScript' type='text/javascript' src='https://adserver.authsecure.com/adx.js'></script>
+<script language='JavaScript' type='text/javascript'>
+<!--
+   if (!document.phpAds_used) document.phpAds_used = ',';
+   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
+   
+   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
+   document.write ("https://adserver.authsecure.com/adjs.php?n=" + phpAds_random);
+   document.write ("&amp;what=zone:4&amp;block=1&amp;blockcampaign=1");
+   document.write ("&amp;exclude=" + document.phpAds_used);
+   if (document.referrer)
+      document.write ("&amp;referer=" + escape(document.referrer));
+   document.write ("'><" + "/script>");
+//-->
+</script><noscript><a href='https://adserver.authsecure.com/adclick.php?n=ac18b95b' target='_blank'><img src='https://adserver.authsecure.com/adview.php?what=zone:4&amp;n=ac18b95b' border='0' alt=''></a></noscript>
+<!--Banner Script End-->
+  
+  
+  
+  </td>
+  </tr>
+  <tr class="main">
+    <td align="center"><a href="http://oscommerce.com" target="_blank">osCommerce.com</a> | <a href="http://creloaded.com" target="_blank">CRE Loaded.com</a> </td>
+    <td align="center"><a href="<?php echo tep_href_link(FILENAME_DEFAULT);?>" class="admin_text"><strong><?php echo TEXT_ADMIN_HOME;?></strong></a> | <a href="<?php echo tep_catalog_href_link();?>" class="admin_text"><strong><?php echo TEXT_VIEW_CATALOG;?></strong></a> | <a href="http://creloaded.com" target="_blank" class="admin_text"><strong><?php echo TEXT_FORUMS;?></strong></a> | <a href="http://www.creloaded.com/support/" target="_blank"><strong><font color="#0000FF"><?php echo TEXT_PURCHASE_SUPPORT;?></font></strong></a> | <a href="http://chainreactionworks.com" target="_blank" class="admin_text"><?php echo TEXT_HOSTING;?></a></td>
+  </tr>
+  <tr class="main">
+    <td colspan="2" align="center"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
+  </tr>
+</table>
+<?php
+// Hide tom bar when not loggedin
+ if (basename($PHP_SELF) != FILENAME_LOGIN && basename($PHP_SELF) != FILENAME_PASSWORD_FORGOTTEN && basename($PHP_SELF) != FILENAME_LOGOFF) {
+?>
+
+<table width="100%"  border="0" cellspacing="2" cellpadding="2" background="images/cre_header_slice.gif">
+         <tr class="main">
+          <td class="admin_text"><span class="main">
+      <?php echo tep_draw_form('frmcustsearch', FILENAME_CUSTOMERS, '', 'get')?>
+      <?php $custparams="size=12 onblur=\"javascript:document.frmcustsearch.search.value='Customers';\" onclick=\"javascript:document.frmcustsearch.search.value='';\"";
+        echo tep_draw_input_field('search','Customers',$custparams,false,'',false); 
+        if (isset($HTTP_GET_VARS[tep_session_name()])) {
+          echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+        }
+      ?>          
+      </form>     
+      <?php echo tep_draw_form('frmcustnew', FILENAME_CREATE_ACCOUNT, '', 'get')?>
+      <input type=submit value=new>
+      <?php
+        if (isset($HTTP_GET_VARS[tep_session_name()])) {
+          echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+        }
+      ?>
+      </form>
+       <?php $orderparams="size=8 onblur=\"javascript:document.frmordersearch.oID.value='Order ID';\" onfocus=\"javascript:document.frmordersearch.oID.value='';\"";?>
+      | <?php echo tep_draw_form('frmordersearch', FILENAME_ORDERS, '', 'get').tep_draw_input_field('oID','Order ID',$orderparams,false,'',false).tep_draw_input_field('action','edit','',false,'hidden',false)?>     
+      <?php
+        if (isset($HTTP_GET_VARS[tep_session_name()])) {
+          echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+        }
+      ?>  
+      </form> 
+      <?php echo tep_draw_form('frmordernew', 'create_order.php', '', 'get')?>
+      <input type=submit value=new>
+      <?php
+        if (isset($HTTP_GET_VARS[tep_session_name()])) {
+          echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+        }
+      ?>
+      </form> | 
+      <?php echo tep_draw_form('frmprodsearch', FILENAME_CATEGORIES, '', 'post')?>
+      <?php $prodparams="size=12 onblur=\"javascript:document.frmprodsearch.search.value='Products';\" onfocus=\"javascript:document.frmprodsearch.search.value='';\"";
+        echo tep_draw_input_field('search','Products',$prodparams,false,'',false);
+        echo tep_draw_input_field('selected_box','catalog','',false,'hidden',false);
+        if (isset($HTTP_GET_VARS[tep_session_name()])) {
+          echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+        }
+      ?>
+      </form>     
+      |       
+      <?php echo tep_draw_form('frmarticlesearch', FILENAME_ARTICLES, '', 'get')?>
+      <?php $articlesparams="size=12 onblur=\"javascript:document.frmarticlesearch.search.value='Articles';\" onfocus=\"javascript:document.frmarticlesearch.search.value='';\"";
+        echo tep_draw_input_field('search','Articles',$articlesparams,false,'',false);
+        if (isset($HTTP_GET_VARS[tep_session_name()])) {
+          echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+        }
+      ?>      
+      </form>        
+      | 
+      <?php echo tep_draw_form('frmpagesearch', FILENAME_PAGES, '', 'get')?>
+      <?php $articlesparams="size=12 onblur=\"javascript:document.frmpagesearch.search.value='Pages';\" onfocus=\"javascript:document.frmpagesearch.search.value='';\"";
+        echo tep_draw_input_field('search','Pages',$articlesparams,false,'',false);
+        if (isset($HTTP_GET_VARS[tep_session_name()])) {
+          echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+        }
+      ?>      
+      </form>   
+
+      <!--|  <input value=FAQ size=12> |-->
+      </span></td>
+          <td align="right" class="main"><span class="main"><?php echo TEXT_ADMIN_LANG . tep_draw_form('languages', 'index.php', '', 'get');
+      echo tep_draw_pull_down_menu('language', $languages_array, $languages_selected, 'onChange="this.form.submit();"'); 
+      if (isset($HTTP_GET_VARS[tep_session_name()])) {
+        echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+      }
+      ?>
+     | <a href="<?php echo tep_href_link(FILENAME_LOGOFF);?> " class="main"><?php echo TEXT_LOGOUT;?></a>
+      </form></span> </td>
+        </tr>
+</table>
+    
+ <script language="javascript" src="includes/menu.js"></script>
+<?php if (MENU_DHTML == 'True') require(DIR_WS_INCLUDES . 'header_navigation.php'); 
+
+            if ($messageStack->size('search') > 0) {
+          echo $messageStack->output('search');
+      }
+
+} // End Hide
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/header_navigation.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/header_navigation.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/header_navigation.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+  $Id: header_navigation.php,v 1.1.1.1 2004/03/04 23:39:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+    Chain Reaction Works, Inc
+  Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1939 $
+
+  Released under the GNU General Public License
+  Updated by Gnidhal (fx at geniehalles.com)
+*/
+
+  $menu_dhtml = MENU_DHTML;
+  $box_files_list = array(  array('administrator'   , 'administrator.php', BOX_HEADING_ADMINISTRATOR),
+                    array('configuration'   , 'configuration.php', BOX_HEADING_CONFIGURATION),
+                            array('catalog'         , 'catalog.php', BOX_HEADING_CATALOG),
+              array('customers'       , 'customers.php' , BOX_HEADING_CUSTOMERS),
+                      array('marketing'       , 'marketing.php', BOX_HEADING_MARKETING),
+                            array('gv_admin'        , 'gv_admin.php' , BOX_HEADING_GV_ADMIN),
+              array('affiliate'       , 'affiliate.php', BOX_HEADING_AFFILIATE),
+                            array('reports'         , 'reports.php' , BOX_HEADING_REPORTS),
+              array('data'            , 'data.php' , BOX_HEADING_DATA)
+                          );
+
+  $box_files_list02 = array(
+                            array('information'     , 'information.php', BOX_HEADING_INFORMATION),
+                            array('articles'        , 'articles.php' , BOX_HEADING_ARTICLES),
+                            array('design_controls' , 'design_controls.php' , BOX_HEADING_DESIGN_CONTROLS),
+                            array('links'           , 'links.php' , BOX_HEADING_LINKS),
+                            array('modules'         , 'modules.php' , BOX_HEADING_MODULES),
+                            array('taxes'           , 'taxes.php' , BOX_HEADING_LOCATION_AND_TAXES),
+                            array('localization'    , 'localization.php' , BOX_HEADING_LOCALIZATION),
+                      array('crypt'           , 'crypt.php', BOX_HEADING_CRYPT),
+                            array('tools'           , 'tools.php' , BOX_HEADING_TOOLS)
+                          );
+
+   echo '<!-- Menu bar #1. --> <div class="menuBar" style="width:100%;">';
+   foreach($box_files_list as $item_menu) {
+  if (tep_admin_check_boxes($item_menu[1]) == true) {
+     echo "<a class=\"menuButton\" href=\"\" onclick=\"return buttonClick(event, '".$item_menu[0]."Menu');\" onmouseover=\"buttonMouseover(event, '".$item_menu[0]."Menu');\">".$item_menu[2]."</a>" ;
+   }
+}
+   echo "</div>";
+
+   echo '<!-- Menu bar #2. --> <div class="menuBar" style="width:100%;">';
+   foreach($box_files_list02 as $item_menu) {
+  if (tep_admin_check_boxes($item_menu[1]) == true) {
+     echo "<a class=\"menuButton\" href=\"\" onclick=\"return buttonClick(event, '".$item_menu[0]."Menu');\" onmouseover=\"buttonMouseover(event, '".$item_menu[0]."Menu');\">".$item_menu[2]."</a>" ;
+   }
+}
+   echo "</div>";
+ foreach($box_files_list as $item_menu) require(DIR_WS_BOXES. $item_menu[1] );
+ foreach($box_files_list02 as $item_menu) require(DIR_WS_BOXES. $item_menu[1] );
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/helptip.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/helptip.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/helptip.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+/*
+  Notice that IE has a display problem if the help link is on
+  the last line of a container with no padding. If this is the
+  case increase the padding bottom to at least 1px
+*/
+
+a.helpLink {
+  color:        Green;
+  text-decoration:  none;
+  border-bottom:    1px dashed Green;
+  cursor:       help;
+}
+
+a.helpLink:hover {
+  color:        Red;
+  text-decoration:  none;
+  border-bottom:    1px dashed Red;
+}
+
+#hintbox{ /*CSS for pop up hint box */
+  position:     absolute;
+  top:          0;
+  background-color: lightyellow;
+  width:        150px; /*Default width of hint.*/ 
+  padding:      3px;
+  border:       1px solid black;
+  font:         normal 11px Verdana;
+  line-height:    18px;
+  z-index:        100;
+  border-right:     3px solid black;
+  border-bottom:  3px solid black;
+  visibility:     hidden;
+}
+
+.hintanchor{ /*CSS for link that shows hint onmouseover*/
+  font-weight:    bold;
+  color:        navy;
+  margin:         3px 8px;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/index.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/index.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/index.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+body { 
+    background: #FFFFFF; 
+}
+body, table {
+  font-family: Verdana, Arial, Helvetica, sans-serif; 
+  text-align: left;
+  font-size: 11px;
+}
+
+.body
+{
+    FONT-WEIGHT: normal;
+    FONT-SIZE: 11px;
+    COLOR: #4e4f4f;
+    FONT-FAMILY: Tahoma, verdana, helvetica, sans-serif;
+    TEXT-DECORATION: none
+}
+fieldset{
+  border:1px solid #CCCCCC;
+  padding: 5px;
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+  color: #000000;
+/*  height: 100%;
+  margin: 3px;*/
+}
+legend{
+  background-color: #F7F7F7;
+  text-align: center;
+  border:1px solid #CCCCCC;
+  padding: 3px;
+  color:#000066;
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+  font-weight: bold;
+}
+.admin_text {
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 12px;
+  color: #000000;
+}
+a.admin_text:link, a.admin_text:visited {
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+  color: #000000;
+  font-weight:bold;
+}
+a.admin_text:hover {
+  color: #FF0000;
+  text-decoration:underline;
+}
+li {
+  list-style-position: outside;
+  list-style-type: square;
+}
+a.adminLink:link, a.adminLink:visited {
+  color: #000000;
+  text-decoration:none;
+  border-bottom:  1px solid #CCCCCC;
+}
+a.adminLink:hover {
+  color: #FF0000;
+  text-decoration:none;
+  border-bottom:1px dashed Red;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/calendar.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/calendar.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/calendar.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,123 @@
+/*
+*  Popup Calendar Styles
+*/
+.head {
+  font-family: arial;
+  font-size: 12px;
+  font-weight: normal;
+}
+
+.text {
+  font-family: arial;
+  font-size: 12px;
+  font-weight: normal;
+  padding: 2px;
+}
+
+#popupcalendar {
+  width: 185px;
+  height:130px;
+  left: 0px;
+  top: 0px;
+  background-color: black;
+  position: absolute;
+  visibility: hidden;
+}
+
+
+a.cal-DayLink {
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    text-decoration: none;
+    color: black;
+    background-color: transparent;
+}
+a.cal-DayLink:hover {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+    text-decoration: none;
+    background-color: transparent;
+    color: Blue;
+}
+a.cal-DayLink:active {
+   font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    text-decoration: none;
+    background-color: transparent;
+    color: #0066FF;
+}
+.cal-TextBox{
+    color: Black;
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    background-color: #FFFFCC;
+}
+
+a.cal-TodayLink {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+    text-decoration: none;
+    color: red;
+    background-color: transparent;
+}
+a.cal-TodayLink:hover {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+    text-decoration: none;
+    background-color: transparent;
+    color: Blue;
+}
+a.cal-TodayLink:active {
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+    text-decoration: none;
+    background-color: transparent;
+    color: #0066FF;
+}
+
+.cal-GreyDate {
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    text-decoration: none;
+  background-color: #FFFFCC;
+    color: #999999;
+}
+
+.cal-GreyInvalidDate {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    text-decoration: line-through;
+  background-color: #FFFFCC;
+    color: #999999;
+}
+
+.cal-DayCell {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+  background-color:White; /*#FFFFCC;*/
+}
+
+.cal-HeadCell {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+  background-color: #99CCCC;/* #CCCC99; */
+}
+
+.cal-Table{
+  border-top-color: #99CCCC;
+  border-left-color: #99CCCC;
+  border-right-color: #99CCCC;
+  border-bottom-color:  #99CCCC;
+  background-color:black;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/calendarcode.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/calendarcode.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/calendarcode.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,466 @@
+/*
+ * Bazillyo's Spiffy DHTML Popup Calendar v. 1.0 © 2000 S. Ousta
+ *   - freeware with this comment
+ *   - for download size, you can strip all spaces & comments except the © notices
+ *   - Thanks to Chris for the domlay() function
+ *   - this requires calendarcode.js, calendar.css, and calendarTest.htm
+ *   - works in IE4.x, IE5.x, NS4.75 possibly 4.x, NS6 (with slight cosmetic issues)
+ *   - Netscape does display some controls overtop of the layer so layout is important
+ *
+ */
+ 
+// initialiZe variables... 
+var ppcIE=((navigator.appName == "Microsoft Internet Explorer") || ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5)));
+var ppcNN6=((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5));
+//var ppcIE=(navigator.appName == "Microsoft Internet Explorer");
+var ppcNN=((navigator.appName == "Netscape")&&(document.layers));
+var ppcX = 4;
+var ppcY = 4;
+
+var IsCalendarVisible;
+var calfrmName;
+var maxYearList;
+var minYearList;
+var todayDate = new Date; 
+var curDate = new Date; 
+var curImg;
+var curDateBox;
+var minDate = new Date;
+var maxDate = new Date;
+var hideDropDowns;
+var IsUsingMinMax;
+var FuncsToRun;
+var img_del;
+var img_close;
+img_del=new Image();
+img_del.src="./images/cal_del_small.gif";
+img_close=new Image();
+img_close.src="./images/cal_close_small.gif";
+
+minYearList=todayDate.getFullYear()-10;
+maxYearList=todayDate.getFullYear()+10;
+IsCalendarVisible=false;
+
+img_Date_UP=new Image();
+img_Date_UP.src="./images/cal_date_up.gif";
+
+img_Date_OVER=new Image();
+img_Date_OVER.src="./images/cal_date_over.gif";
+
+img_Date_DOWN=new Image();
+img_Date_DOWN.src="./images/cal_date_down.gif";
+
+
+function calSwapImg(whatID, NewImg,override) {
+    if (document.images) {
+     if (!( IsCalendarVisible && override )) {
+        document.images[whatID].src = eval(NewImg + ".src");
+     }
+    }
+    window.status=' ';
+    return true;
+}
+
+function getOffsetLeft (el) {
+    var ol = el.offsetLeft;
+    while ((el = el.offsetParent) != null)
+        ol += el.offsetLeft;
+    return ol+130;
+}
+
+function getOffsetTop (el) {
+    var ot = el.offsetTop;
+    while((el = el.offsetParent) != null)
+        ot += el.offsetTop;
+    return ot-50;
+}
+
+function showCalendar(frmName, dteBox,btnImg, hideDrops, MnDt, MnMo, MnYr, MxDt, MxMo, MxYr,runFuncs) {
+    hideDropDowns = hideDrops;
+    FuncsToRun = runFuncs;
+    calfrmName = frmName;
+    if (IsCalendarVisible) {
+        hideCalendar();
+    }
+    else {
+        if (document.images['calbtn1']!=null ) document.images['calbtn1'].src=img_del.src;
+        if (document.images['calbtn2']!=null ) document.images['calbtn2'].src=img_close.src;
+        
+        if (hideDropDowns) {toggleDropDowns('hidden');}
+        if ((MnDt!=null) && (MnMo!=null) && (MnYr!=null) && (MxDt!=null) && (MxMo!=null) && (MxYr!=null)) {
+            IsUsingMinMax = true;
+            minDate.setDate(MnDt);
+            minDate.setMonth(MnMo-1);
+            minDate.setFullYear(MnYr);
+            maxDate.setDate(MxDt);
+            maxDate.setMonth(MxMo-1);
+            maxDate.setFullYear(MxYr);
+        }
+        else {
+            IsUsingMinMax = false;
+        }
+        
+        curImg = btnImg;
+        curDateBox = dteBox;
+        if ( ppcIE ) {
+            ppcX = getOffsetLeft(document.images[btnImg]);
+            ppcY = getOffsetTop(document.images[btnImg]) + document.images[btnImg].height;
+        }
+        else if (ppcNN){
+            ppcX = document.images[btnImg].x + 90; 
+            ppcY = document.images[btnImg].y - 45;
+        }
+
+        domlay('popupcalendar',1,ppcX,ppcY,Calendar(todayDate.getMonth(),todayDate.getFullYear()));       
+
+        //domlay('popupcalendar',1,ppcX,ppcY,Calendar(curDate.getMonth(),curDate.getFullYear()));
+
+        IsCalendarVisible = true;
+    }
+}
+
+function toggleDropDowns(showHow){
+    var i; var j;
+    for (i=0;i<document.forms.length;i++) {
+        for (j=0;j<document.forms[i].elements.length;j++) {
+            if (document.forms[i].elements[j].tagName == "SELECT") {
+                if (document.forms[i].name != "Cal")
+                    document.forms[i].elements[j].style.visibility=showHow;
+            }
+        }
+    }
+}
+
+function hideCalendar(){
+    domlay('popupcalendar',0,ppcX,ppcY);
+    calSwapImg(curImg, 'img_Date_UP');    
+    IsCalendarVisible = false;
+    if (hideDropDowns) {toggleDropDowns('visible');}
+}
+
+function calClick() {
+        window.focus();
+}
+
+function domlay(id,trigger,lax,lay,content) {
+    /*
+     * Cross browser Layer visibility / Placement Routine
+     * Done by Chris Heilmann (mail at ichwill.net)
+     * Feel free to use with these lines included!
+     * Created with help from Scott Andrews.
+     * The marked part of the content change routine is taken
+     * from a script by Reyn posted in the DHTML
+     * Forum at Website Attraction and changed to work with
+     * any layername. Cheers to that!
+     * Welcome DOM-1, about time you got included... :)
+     */
+    // Layer visible
+    if (trigger=="1"){
+        if (document.layers) document.layers[''+id+''].visibility = "show"
+        else if (document.all) document.all[''+id+''].style.visibility = "visible"
+        else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"                
+        }
+    // Layer hidden
+    else if (trigger=="0"){
+        if (document.layers) document.layers[''+id+''].visibility = "hide"
+        else if (document.all) document.all[''+id+''].style.visibility = "hidden"
+        else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"             
+        }
+    // Set horizontal position  
+    if (lax){
+        if (document.layers){document.layers[''+id+''].left = lax}
+        else if (document.all){document.all[''+id+''].style.left=lax}
+        else if (document.getElementById){document.getElementById(''+id+'').style.left=lax+"px"}
+        }
+    // Set vertical position
+    if (lay){
+        if (document.layers){document.layers[''+id+''].top = lay}
+        else if (document.all){document.all[''+id+''].style.top=lay}
+        else if (document.getElementById){document.getElementById(''+id+'').style.top=lay+"px"}
+        }
+    // change content
+
+    if (content){
+    if (document.layers){
+        sprite=document.layers[''+id+''].document;
+        // add father layers if needed! document.layers[''+father+'']...
+        sprite.open();
+        sprite.write(content);
+        sprite.close();
+        }
+    else if (document.all) document.all[''+id+''].innerHTML = content;  
+    else if (document.getElementById){
+        //Thanx Reyn!
+        rng = document.createRange();
+        el = document.getElementById(''+id+'');
+        rng.setStartBefore(el);
+        htmlFrag = rng.createContextualFragment(content)
+        while(el.hasChildNodes()) el.removeChild(el.lastChild);
+        el.appendChild(htmlFrag);
+        // end of Reyn ;)
+        }
+    }
+}
+
+function Calendar(whatMonth,whatYear) {
+    var output = '';
+    var datecolwidth;
+    var startMonth;
+    var startYear;
+    startMonth=whatMonth;
+    startYear=whatYear;
+
+    curDate.setMonth(whatMonth);
+    curDate.setFullYear(whatYear);
+    curDate.setDate(todayDate.getDate());
+    if (ppcNN6) {
+        output += '<form name="Cal"><table width="185" border="3" class="cal-Table" cellspacing="0" cellpadding="0"><tr>';
+    }
+    else {
+        output += '<table width="185" border="3" class="cal-Table" cellspacing="0" cellpadding="0"><form name="Cal"><tr>';
+    }
+     
+    output += '<td class="cal-HeadCell" align="center" width="100%"><a href="javascript:clearDay();"><img name="calbtn1" src="./images/cal_del_small.gif" border="0" width="12" height="10"></a>&nbsp;&nbsp;<a href="javascript:scrollMonth(-1);" class="cal-DayLink">&lt;</a>&nbsp;<SELECT class="cal-TextBox" NAME="cboMonth" onChange="changeMonth();">';
+    for (month=0; month<12; month++) {
+        if (month == whatMonth) output += '<OPTION VALUE="' + month + '" SELECTED>' + names[month] + '<\/OPTION>';
+        else                output += '<OPTION VALUE="' + month + '">'          + names[month] + '<\/OPTION>';
+    }
+
+    output += '<\/SELECT><SELECT class="cal-TextBox" NAME="cboYear" onChange="changeYear();">';
+
+    for (year=minYearList; year<maxYearList; year++) {
+        if (year == whatYear) output += '<OPTION VALUE="' + year + '" SELECTED>' + year + '<\/OPTION>';
+        else              output += '<OPTION VALUE="' + year + '">'          + year + '<\/OPTION>';
+    }
+
+    output += '<\/SELECT>&nbsp;<a href="javascript:scrollMonth(1);" class="cal-DayLink">&gt;</a>&nbsp;&nbsp;<a href="javascript:hideCalendar();"><img name="calbtn2" src="./images/cal_close_small.gif" border="0" width="12" height="10"></a><\/td><\/tr><tr><td width="100%" align="center">';
+
+    firstDay = new Date(whatYear,whatMonth,1);
+    startDay = firstDay.getDay();
+
+    if (((whatYear % 4 == 0) && (whatYear % 100 != 0)) || (whatYear % 400 == 0))
+         days[1] = 29;
+    else
+         days[1] = 28;
+
+    output += '<table width="185" cellspacing="1" cellpadding="2" border="0"><tr>';
+
+    for (i=0; i<7; i++) {
+        if (i==0 || i==6) {
+            datecolwidth="15%"
+        }
+        else
+        {
+            datecolwidth="14%"
+        }
+        output += '<td class="cal-HeadCell" width="' + datecolwidth + '" align="center" valign="middle">'+ dow[i] +'<\/td>';
+    }
+    
+    output += '<\/tr><tr>';
+
+    var column = 0;
+    var lastMonth = whatMonth - 1;
+    var lastYear = whatYear;
+    if (lastMonth == -1) { lastMonth = 11; lastYear=lastYear-1;}
+
+    for (i=0; i<startDay; i++, column++) {
+        output += getDayLink((days[lastMonth]-startDay+i+1),true,lastMonth,lastYear);
+    }
+
+    for (i=1; i<=days[whatMonth]; i++, column++) {
+        output += getDayLink(i,false,whatMonth,whatYear);
+        if (column == 6) {
+            output += '<\/tr><tr>';
+            column = -1;
+        }
+    }
+    
+    var nextMonth = whatMonth+1;
+    var nextYear = whatYear;
+    if (nextMonth==12) { nextMonth=0; nextYear=nextYear+1;}
+    
+    if (column > 0) {
+        for (i=1; column<7; i++, column++) {
+            output +=  getDayLink(i,true,nextMonth,nextYear);
+        }
+        output += '<\/tr><\/table><\/td><\/tr>';
+    }
+    else {
+        output = output.substr(0,output.length-4); // remove the <tr> from the end if there's no last row
+        output += '<\/table><\/td><\/tr>';
+    }
+    
+    if (ppcNN6) {
+        output += '<\/table><\/form>';
+    }
+    else {
+        output += '<\/form><\/table>';
+    }
+    curDate.setDate(1);
+    curDate.setMonth(startMonth);
+    curDate.setFullYear(startYear);
+    return output;
+}
+
+function getDayLink(linkDay,isGreyDate,linkMonth,linkYear) {
+    var templink;
+    if (!(IsUsingMinMax)) {
+        if (isGreyDate) {
+            templink='<td align="center" class="cal-GreyDate">' + linkDay + '<\/td>';
+        }
+        else {
+            if (isDayToday(linkDay)) {
+                templink='<td align="center" class="cal-DayCell">' + '<a class="cal-TodayLink" onmouseover="self.status=\' \';return true" href="javascript:changeDay(' + linkDay + ');">' + linkDay + '<\/a>' +'<\/td>';
+            }
+            else {
+                templink='<td align="center" class="cal-DayCell">' + '<a class="cal-DayLink" onmouseover="self.status=\' \';return true" href="javascript:changeDay(' + linkDay + ');">' + linkDay + '<\/a>' +'<\/td>';
+            }
+        }
+    }
+    else {
+        if (isDayValid(linkDay,linkMonth,linkYear)) {
+
+            if (isGreyDate){
+                templink='<td align="center" class="cal-GreyDate">' + linkDay + '<\/td>';
+            }
+            else {
+                if (isDayToday(linkDay)) {
+                    templink='<td align="center" class="cal-DayCell">' + '<a class="cal-TodayLink" onmouseover="self.status=\' \';return true" href="javascript:changeDay(' + linkDay + ');">' + linkDay + '<\/a>' +'<\/td>';
+                }
+                else {
+                    templink='<td align="center" class="cal-DayCell">' + '<a class="cal-DayLink" onmouseover="self.status=\' \';return true" href="javascript:changeDay(' + linkDay + ');">' + linkDay + '<\/a>' +'<\/td>';
+                }
+            }
+        }
+        else {
+            templink='<td align="center" class="cal-GreyInvalidDate">'+ linkDay + '<\/td>';
+        }
+    }
+    return templink;
+}
+
+function isDayToday(isDay) {
+    if ((curDate.getFullYear() == todayDate.getFullYear()) && (curDate.getMonth() == todayDate.getMonth()) && (isDay == todayDate.getDate())) {
+        return true;
+    }
+    else {
+        return false;
+    }
+}
+
+function isDayValid(validDay, validMonth, validYear){
+    
+    curDate.setDate(validDay);
+    curDate.setMonth(validMonth);
+    curDate.setFullYear(validYear);
+    
+    if ((curDate>=minDate) && (curDate<=maxDate)) {
+        return true;
+    }
+    else {
+        return false;
+    }
+}
+
+function padout(number) { return (number < 10) ? '0' + number : number; }
+
+function clearDay() {
+    eval('document.' + calfrmName + '.day.value = \'\'');
+    eval('document.' + calfrmName + '.month.value = \'\'');
+    eval('document.' + calfrmName + '.year.value = \'\'');
+    hideCalendar();
+    if (FuncsToRun!=null)
+        eval(FuncsToRun); 
+}
+
+function changeDay(whatDay) {
+    curDate.setDate(whatDay);
+//    eval('document.' + calfrmName + '.' + curDateBox + '.value = "'+ padout(curDate.getDate()) + '-' + padout(curDate.getMonth()+1) + '-' + curDate.getFullYear() + '"');
+    eval('document.' + calfrmName + '.day.value = "'+ padout(curDate.getDate()) + '"');
+    eval('document.' + calfrmName + '.month.value = "'+ padout(curDate.getMonth()+1) + '"');
+    eval('document.' + calfrmName + '.year.value = "'+ curDate.getFullYear() + '"');
+    hideCalendar();
+    if (FuncsToRun!=null)
+        eval(FuncsToRun); 
+}
+
+function scrollMonth(amount) {
+    var monthCheck;
+    var yearCheck;
+    
+    if (ppcIE) {
+        monthCheck = document.forms["Cal"].cboMonth.selectedIndex + amount;
+    }
+    else if (ppcNN) {
+        monthCheck = document.popupcalendar.document.forms["Cal"].cboMonth.selectedIndex + amount;    
+    }
+    if (monthCheck < 0) {
+        yearCheck = curDate.getFullYear() - 1;
+        if ( yearCheck < minYearList ) {
+            yearCheck = minYearList;
+            monthCheck = 0;
+        }
+        else {
+            monthCheck = 11;
+        }
+        curDate.setFullYear(yearCheck);
+    }
+    else if (monthCheck >11) {
+        yearCheck = curDate.getFullYear() + 1;
+        if ( yearCheck > maxYearList-1 ) {
+            yearCheck = maxYearList-1;
+            monthCheck = 11;
+        }
+        else {
+            monthCheck = 0;
+        }      
+        curDate.setFullYear(yearCheck);
+    }
+    
+    if (ppcIE) {
+        curDate.setMonth(document.forms["Cal"].cboMonth.options[monthCheck].value);
+    }
+    else if (ppcNN) {
+        curDate.setMonth(document.popupcalendar.document.forms["Cal"].cboMonth.options[monthCheck].value );
+    }
+    domlay('popupcalendar',1,ppcX,ppcY,Calendar(curDate.getMonth(),curDate.getFullYear()));
+}
+
+function changeMonth() {
+
+    if (ppcIE) {        
+        curDate.setMonth(document.forms["Cal"].cboMonth.options[document.forms["Cal"].cboMonth.selectedIndex].value);
+        domlay('popupcalendar',1,ppcX,ppcY,Calendar(curDate.getMonth(),curDate.getFullYear()));
+    }
+    else if (ppcNN) {
+
+        curDate.setMonth(document.popupcalendar.document.forms["Cal"].cboMonth.options[document.popupcalendar.document.forms["Cal"].cboMonth.selectedIndex].value);
+        domlay('popupcalendar',1,ppcX,ppcY,Calendar(curDate.getMonth(),curDate.getFullYear()));
+    }
+
+}
+
+function changeYear() {
+    if (ppcIE) {
+
+        curDate.setFullYear(document.forms["Cal"].cboYear.options[document.forms["Cal"].cboYear.selectedIndex].value);
+        domlay('popupcalendar',1,ppcX,ppcY,Calendar(curDate.getMonth(),curDate.getFullYear()));
+
+
+    }
+    else if (ppcNN) {
+
+        curDate.setFullYear(document.popupcalendar.document.forms["Cal"].cboYear.options[document.popupcalendar.document.forms["Cal"].cboYear.selectedIndex].value);
+        domlay('popupcalendar',1,ppcX,ppcY,Calendar(curDate.getMonth(),curDate.getFullYear()));
+    }
+
+}
+
+function makeArray0() {
+    for (i = 0; i<makeArray0.arguments.length; i++)
+        this[i] = makeArray0.arguments[i];
+}
+
+var names     = new makeArray0('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
+var days      = new makeArray0(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+var dow       = new makeArray0('S','M','T','W','T','F','S');

Added: trunk/direct.openmoko.com/admin/includes/javascript/dtree.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/dtree.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/dtree.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,693 @@
+/*--------------------------------------------------|
+
+| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
+
+|---------------------------------------------------|
+
+| Copyright (c) 2002-2003 Geir Landrö               |
+
+|                                                   |
+
+| This script can be used freely as long as all     |
+
+| copyright messages are intact.                    |
+
+|                                                   |
+
+| Updated: 17.04.2003                               |
+
+|--------------------------------------------------*/
+
+
+
+// Node object
+
+function Node(id, pid, name, url, title, target, icon, iconOpen, open) {
+
+  this.id = id;
+
+  this.pid = pid;
+
+  this.name = name;
+
+  this.url = url;
+
+  this.title = title;
+
+  this.target = target;
+
+  this.icon = icon;
+
+  this.iconOpen = iconOpen;
+
+  this._io = open || false;
+
+  this._is = false;
+
+  this._ls = false;
+
+  this._hc = false;
+
+  this._ai = 0;
+
+  this._p;
+
+};
+
+
+
+// Tree object
+
+function dTree(objName) {
+
+  this.config = {
+
+    target          : null,
+
+    folderLinks     : true,
+
+    useSelection    : true,
+
+    useCookies      : true,
+
+    useLines        : true,
+
+    useIcons        : true,
+
+    useStatusText   : false,
+
+    closeSameLevel  : false,
+
+    inOrder         : false
+
+  }
+
+  this.icon = {
+
+    root        : 'images/img/base.gif',
+
+    folder      : 'images/img/folder.gif',
+
+    folderOpen  : 'images/img/folderopen.gif',
+
+    node        : 'images/img/page.gif',
+
+    empty       : 'images/img/empty.gif',
+
+    line        : 'images/img/line.gif',
+
+    join        : 'images/img/join.gif',
+
+    joinBottom  : 'images/img/joinbottom.gif',
+
+    plus        : 'images/img/plus.gif',
+
+    plusBottom  : 'images/img/plusbottom.gif',
+
+    minus       : 'images/img/minus.gif',
+
+    minusBottom : 'images/img/minusbottom.gif',
+
+    nlPlus      : 'images/img/nolines_plus.gif',
+
+    nlMinus     : 'images/img/nolines_minus.gif'
+
+  };
+
+  this.obj = objName;
+
+  this.aNodes = [];
+
+  this.aIndent = [];
+
+  this.root = new Node(-1);
+
+  this.selectedNode = null;
+
+  this.selectedFound = false;
+
+  this.completed = false;
+
+};
+
+
+
+// Adds a new node to the node array
+
+dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) {
+
+  this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open);
+
+};
+
+
+
+// Open/close all nodes
+
+dTree.prototype.openAll = function() {
+
+  this.oAll(true);
+
+};
+
+dTree.prototype.closeAll = function() {
+
+  this.oAll(false);
+
+};
+
+
+
+// Outputs the tree to the page
+
+dTree.prototype.toString = function() {
+
+  var str = '<div class="dtree">\n';
+
+  if (document.getElementById) {
+
+    if (this.config.useCookies) this.selectedNode = this.getSelected();
+
+    str += this.addNode(this.root);
+
+  } else str += 'Browser not supported.';
+
+  str += '</div>';
+
+  if (!this.selectedFound) this.selectedNode = null;
+
+  this.completed = true;
+
+  return str;
+
+};
+
+
+
+// Creates the tree structure
+
+dTree.prototype.addNode = function(pNode) {
+
+  var str = '';
+
+  var n=0;
+
+  if (this.config.inOrder) n = pNode._ai;
+
+  for (n; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n].pid == pNode.id) {
+
+      var cn = this.aNodes[n];
+
+      cn._p = pNode;
+
+      cn._ai = n;
+
+      this.setCS(cn);
+
+      if (!cn.target && this.config.target) cn.target = this.config.target;
+
+      if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
+
+      if (!this.config.folderLinks && cn._hc) cn.url = null;
+
+      if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
+
+          cn._is = true;
+
+          this.selectedNode = n;
+
+          this.selectedFound = true;
+
+      }
+
+      str += this.node(cn, n);
+
+      if (cn._ls) break;
+
+    }
+
+  }
+
+  return str;
+
+};
+
+
+
+// Creates the node icon, url and text
+
+dTree.prototype.node = function(node, nodeId) {
+
+  var str = '<div class="dTreeNode">' + this.indent(node, nodeId);
+
+  if (this.config.useIcons) {
+
+    if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
+
+    if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
+
+    if (this.root.id == node.pid) {
+
+      node.icon = this.icon.root;
+
+      node.iconOpen = this.icon.root;
+
+    }
+
+    str += node.title + '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
+
+  }
+
+  if (node.url) {
+
+    str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="' + node.url + '"';
+
+    //if (node.title) str += ' title="' + node.title + '"';
+
+    if (node.target) str += ' target="' + node.target + '"';
+
+    if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';
+
+    if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
+
+      str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';
+
+    str += '>';
+
+  }
+
+  else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
+
+    str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
+
+  str += node.name;
+
+  if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';
+
+  str += '</div>';
+
+  if (node._hc) {
+
+    str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
+
+    str += this.addNode(node);
+
+    str += '</div>';
+
+  }
+
+  this.aIndent.pop();
+
+  return str;
+
+};
+
+
+
+// Adds the empty and line icons
+
+dTree.prototype.indent = function(node, nodeId) {
+
+  var str = '';
+
+  if (this.root.id != node.pid) {
+
+    for (var n=0; n<this.aIndent.length; n++)
+
+      str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';
+
+    (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
+
+    if (node._hc) {
+
+      str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
+
+      if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
+
+      else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
+
+      str += '" alt="" /></a>';
+
+    } else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';
+
+  }
+
+  return str;
+
+};
+
+
+
+// Checks if a node has any children and if it is the last sibling
+
+dTree.prototype.setCS = function(node) {
+
+  var lastId;
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n].pid == node.id) node._hc = true;
+
+    if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
+
+  }
+
+  if (lastId==node.id) node._ls = true;
+
+};
+
+
+
+// Returns the selected node
+
+dTree.prototype.getSelected = function() {
+
+  var sn = this.getCookie('cs' + this.obj);
+
+  return (sn) ? sn : null;
+
+};
+
+
+
+// Highlights the selected node
+
+dTree.prototype.s = function(id) {
+
+  if (!this.config.useSelection) return;
+
+  var cn = this.aNodes[id];
+
+  if (cn._hc && !this.config.folderLinks) return;
+
+  if (this.selectedNode != id) {
+
+    if (this.selectedNode || this.selectedNode==0) {
+
+      eOld = document.getElementById("s" + this.obj + this.selectedNode);
+
+      eOld.className = "node";
+
+    }
+
+    eNew = document.getElementById("s" + this.obj + id);
+
+    eNew.className = "nodeSel";
+
+    this.selectedNode = id;
+
+    if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);
+
+  }
+
+};
+
+
+
+// Toggle Open or close
+
+dTree.prototype.o = function(id) {
+
+  var cn = this.aNodes[id];
+
+  this.nodeStatus(!cn._io, id, cn._ls);
+
+  cn._io = !cn._io;
+
+  if (this.config.closeSameLevel) this.closeLevel(cn);
+
+  if (this.config.useCookies) this.updateCookie();
+
+};
+
+
+
+// Open or close all nodes
+
+dTree.prototype.oAll = function(status) {
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
+
+      this.nodeStatus(status, n, this.aNodes[n]._ls)
+
+      this.aNodes[n]._io = status;
+
+    }
+
+  }
+
+  if (this.config.useCookies) this.updateCookie();
+
+};
+
+
+
+// Opens the tree to a specific node
+
+dTree.prototype.openTo = function(nId, bSelect, bFirst) {
+
+  if (!bFirst) {
+
+    for (var n=0; n<this.aNodes.length; n++) {
+
+      if (this.aNodes[n].id == nId) {
+
+        nId=n;
+
+        break;
+
+      }
+
+    }
+
+  }
+
+  var cn=this.aNodes[nId];
+
+  if (cn.pid==this.root.id || !cn._p) return;
+
+  cn._io = true;
+
+  cn._is = bSelect;
+
+  if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
+
+  if (this.completed && bSelect) this.s(cn._ai);
+
+  else if (bSelect) this._sn=cn._ai;
+
+  this.openTo(cn._p._ai, false, true);
+
+};
+
+
+
+// Closes all nodes on the same level as certain node
+
+dTree.prototype.closeLevel = function(node) {
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
+
+      this.nodeStatus(false, n, this.aNodes[n]._ls);
+
+      this.aNodes[n]._io = false;
+
+      this.closeAllChildren(this.aNodes[n]);
+
+    }
+
+  }
+
+}
+
+
+
+// Closes all children of a node
+
+dTree.prototype.closeAllChildren = function(node) {
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
+
+      if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
+
+      this.aNodes[n]._io = false;
+
+      this.closeAllChildren(this.aNodes[n]);    
+
+    }
+
+  }
+
+}
+
+
+
+// Change the status of a node(open or closed)
+
+dTree.prototype.nodeStatus = function(status, id, bottom) {
+
+  eDiv  = document.getElementById('d' + this.obj + id);
+
+  eJoin = document.getElementById('j' + this.obj + id);
+
+  if (this.config.useIcons) {
+
+    eIcon = document.getElementById('i' + this.obj + id);
+
+    eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
+
+  }
+
+  eJoin.src = (this.config.useLines)?
+
+  ((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):
+
+  ((status)?this.icon.nlMinus:this.icon.nlPlus);
+
+  eDiv.style.display = (status) ? 'block': 'none';
+
+};
+
+
+
+
+
+// [Cookie] Clears a cookie
+
+dTree.prototype.clearCookie = function() {
+
+  var now = new Date();
+
+  var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
+
+  this.setCookie('co'+this.obj, 'cookieValue', yesterday);
+
+  this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
+
+};
+
+
+
+// [Cookie] Sets value in a cookie
+
+dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
+
+  document.cookie =
+
+    escape(cookieName) + '=' + escape(cookieValue)
+
+    + (expires ? '; expires=' + expires.toGMTString() : '')
+
+    + (path ? '; path=' + path : '')
+
+    + (domain ? '; domain=' + domain : '')
+
+    + (secure ? '; secure' : '');
+
+};
+
+
+
+// [Cookie] Gets a value from a cookie
+
+dTree.prototype.getCookie = function(cookieName) {
+
+  var cookieValue = '';
+
+  var posName = document.cookie.indexOf(escape(cookieName) + '=');
+
+  if (posName != -1) {
+
+    var posValue = posName + (escape(cookieName) + '=').length;
+
+    var endPos = document.cookie.indexOf(';', posValue);
+
+    if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
+
+    else cookieValue = unescape(document.cookie.substring(posValue));
+
+  }
+
+  return (cookieValue);
+
+};
+
+
+
+// [Cookie] Returns ids of open nodes as a string
+
+dTree.prototype.updateCookie = function() {
+
+  var str = '';
+
+  for (var n=0; n<this.aNodes.length; n++) {
+
+    if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
+
+      if (str) str += '.';
+
+      str += this.aNodes[n].id;
+
+    }
+
+  }
+
+  this.setCookie('co' + this.obj, str);
+
+};
+
+
+
+// [Cookie] Checks if a node id is in a cookie
+
+dTree.prototype.isOpen = function(id) {
+
+  var aOpen = this.getCookie('co' + this.obj).split('.');
+
+  for (var n=0; n<aOpen.length; n++)
+
+    if (aOpen[n] == id) return true;
+
+  return false;
+
+};
+
+
+
+// If Push and pop is not implemented by the browser
+
+if (!Array.prototype.push) {
+
+  Array.prototype.push = function array_push() {
+
+    for(var i=0;i<arguments.length;i++)
+
+      this[this.length]=arguments[i];
+
+    return this.length;
+
+  }
+
+};
+
+if (!Array.prototype.pop) {
+
+  Array.prototype.pop = function array_pop() {
+
+    lastElement = this[this.length-1];
+
+    this.length = Math.max(this.length-1,0);
+
+    return lastElement;
+
+  }
+
+};

Added: trunk/direct.openmoko.com/admin/includes/javascript/editor.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/editor.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/editor.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+// configurations
+define('HTML_EDITOR_ENABLE','Enable'); //Automatically use the WYSIWYG interface Enable/Disable
+define('HTML_EDITOR_HEIGHT','300'); //Height, in pixels, of the WYSIWYG interface
+define('HTML_EDITOR_WIDTH','800'); //Height, in pixels, of the WYSIWYG interface
+define('HTML_EDITOR_LANG','en');//Force editor to use english language, if none, will use default admin language
+define('HTML_EDITOR_INTERFACE','tiny_mce'); // The WYSIWYG interface to use when editing pages, we may add more in future
+
+// TinyMCE Specific
+define('HTML_EDITOR_TOOLBAR_SET','advanced');//toolbar set options, simple, advanced, creloaded(default), for mailing scripts, it uses basic.
+define('HTML_EDITOR_TOOLBAR_LOCATION','top');// top or bottom
+define('HTML_EDITOR_PATH_LOCATION','top'); // top or bottom
+define('HTML_EDITOR_TOOLBAR_ALIGN','left'); // left / right / center
+define('HTML_EDITOR_COMPRESS','true');// Use gzip-compressed editor
+define('HTML_EDITOR_IMAGE_MANAGER','true');// show hide image manager in html editor, false will return default advimage plugin
+define('HTML_EDITOR_PLUGINS','emotions,paste,advimage,advlink,advhr,searchreplace,spellcheck');// Under development
+define('HTML_EDITOR_LOAD_CSS','true'); // load default template CSS
+define('HTML_EDITOR_CONVERT_NEW_LINE','false');// will allow "Enter" to <br>
+// end configurations
+
+
+//Main Functions for html editor calls
+if ((HTML_EDITOR_ENABLE == 'Enable') && (file_exists(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'javascript/' . HTML_EDITOR_INTERFACE . '.php'))){ 
+
+require(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'javascript/' . HTML_EDITOR_INTERFACE . '.php');
+
+} else {
+
+function tep_load_html_editor() {
+  echo '<!-- No editor loaded -->' . "\n";
+}
+function tep_insert_html_editor ( $textarea, $tool_bar_set = '', $editor_height = '' ) {  
+  echo '<!-- No editors to load -->' . "\n";
+}
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/general.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/general.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/general.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+function SetFocus() {
+//  if (document.forms.length > 0) {
+//    var field = document.forms[0];
+//    for (i=0; i<field.length; i++) {
+//      if ( (field.elements[i].type != "image") &&
+//           (field.elements[i].type != "hidden") &&
+//           (field.elements[i].type != "reset") &&
+//           (field.elements[i].type != "submit") ) {
+//
+//        document.forms[0].elements[i].focus();
+//
+//        if ( (field.elements[i].type == "text") ||
+//             (field.elements[i].type == "password") )
+//          document.forms[0].elements[i].select();
+//
+//        break;
+//      }
+//    }
+//  }
+}
+
+function rowOverEffect(object) {
+  if (object.className == 'dataTableRow') object.className = 'dataTableRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'dataTableRowOver') object.className = 'dataTableRow';
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/helptip.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/helptip.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/helptip.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+/***********************************************
+* Show Hint script- © Dynamic Drive (www.dynamicdrive.com)
+* This notice MUST stay intact for legal use
+* Visit http://www.dynamicdrive.com/ for this script and 100s more.
+***********************************************/
+    
+var horizontal_offset="9px" //horizontal offset of hint box from anchor link
+
+/////No further editting needed
+
+var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
+var ie=document.all
+var ns6=document.getElementById&&!document.all
+
+function getposOffset(what, offsettype){
+var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
+var parentEl=what.offsetParent;
+while (parentEl!=null){
+totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
+parentEl=parentEl.offsetParent;
+}
+return totaloffset;
+}
+
+function iecompattest(){
+return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
+}
+
+function clearbrowseredge(obj, whichedge){
+var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
+if (whichedge=="rightedge"){
+var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
+dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
+if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
+edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
+}
+else{
+var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
+dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
+if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
+edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
+}
+return edgeoffset
+}
+
+function showhint(menucontents, obj, e, tipwidth){
+if ((ie||ns6) && document.getElementById("hintbox")){
+dropmenuobj=document.getElementById("hintbox")
+dropmenuobj.innerHTML=menucontents
+dropmenuobj.style.left=dropmenuobj.style.top=-500
+if (tipwidth!=""){
+dropmenuobj.widthobj=dropmenuobj.style
+dropmenuobj.widthobj.width=tipwidth
+}
+dropmenuobj.x=getposOffset(obj, "left")
+dropmenuobj.y=getposOffset(obj, "top")
+dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
+dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
+dropmenuobj.style.visibility="visible"
+obj.onmouseout=hidetip
+}
+}
+
+function hidetip(e){
+dropmenuobj.style.visibility="hidden"
+dropmenuobj.style.left="-500px"
+}
+
+function createhintbox(){
+var divblock=document.createElement("div")
+divblock.setAttribute("id", "hintbox")
+document.body.appendChild(divblock)
+}
+
+if (window.addEventListener)
+window.addEventListener("load", createhintbox, false)
+else if (window.attachEvent)
+window.attachEvent("onload", createhintbox)
+else if (document.getElementById)
+window.onload=createhintbox
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/menu.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/menu.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/menu.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,582 @@
+
+//*****************************************************************************
+// Do not remove this notice.
+//
+// Copyright 2000-2004 by Mike Hall.
+// See http://www.brainjar.com for terms of use.
+//*****************************************************************************
+
+//----------------------------------------------------------------------------
+// Code to determine the browser and version.
+//----------------------------------------------------------------------------
+
+function Browser() {
+
+  var ua, s, i;
+
+  this.isIE    = false;  // Internet Explorer
+  this.isOP    = false;  // Opera
+  this.isNS    = false;  // Netscape
+  this.version = null;
+
+  ua = navigator.userAgent;
+
+  s = "Opera";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isOP = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  s = "Netscape6/";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  // Treat any other "Gecko" browser as Netscape 6.1.
+
+  s = "Gecko";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = 6.1;
+    return;
+  }
+
+  s = "MSIE";
+  if ((i = ua.indexOf(s))) {
+    this.isIE = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+}
+
+var browser = new Browser();
+
+//----------------------------------------------------------------------------
+// Code for handling the menu bar and active button.
+//----------------------------------------------------------------------------
+
+var activeButton = null;
+
+/* [MODIFIED] This code commented out, not needed for activate/deactivate
+   on mouseover.
+
+// Capture mouse clicks on the page so any active button can be
+// deactivated.
+
+if (browser.isIE)
+  document.onmousedown = pageMousedown;
+else
+  document.addEventListener("mousedown", pageMousedown, true);
+
+function pageMousedown(event) {
+
+  var el;
+
+  // If there is no active button, exit.
+
+  if (activeButton == null)
+    return;
+
+  // Find the element that was clicked on.
+
+  if (browser.isIE)
+    el = window.event.srcElement;
+  else
+    el = (event.target.tagName ? event.target : event.target.parentNode);
+
+  // If the active button was clicked on, exit.
+
+  if (el == activeButton)
+    return;
+
+  // If the element is not part of a menu, reset and clear the active
+  // button.
+
+  if (getContainerWith(el, "DIV", "menu") == null) {
+    resetButton(activeButton);
+    activeButton = null;
+  }
+}
+
+[END MODIFIED] */
+
+function buttonClick(event, menuId) {
+
+  var button;
+
+  // Get the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // Blur focus from the link to remove that annoying outline.
+
+  button.blur();
+
+  // Associate the named menu to this button if not already done.
+  // Additionally, initialize menu display.
+
+  if (button.menu == null) {
+    button.menu = document.getElementById(menuId);
+    if (button.menu.isInitialized == null)
+      menuInit(button.menu);
+  }
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the button, if not already done.
+
+  if (button.onmouseout == null)
+    button.onmouseout = buttonOrMenuMouseout;
+
+  // Exit if this button is the currently active one.
+
+  if (button == activeButton)
+    return false;
+
+  // [END MODIFIED]
+
+  // Reset the currently active button, if any.
+
+  if (activeButton != null)
+    resetButton(activeButton);
+
+  // Activate this button, unless it was the currently active one.
+
+  if (button != activeButton) {
+    depressButton(button);
+    activeButton = button;
+  }
+  else
+    activeButton = null;
+
+  return false;
+}
+
+function buttonMouseover(event, menuId) {
+
+  var button;
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Activates this button's menu if no other is currently active.
+
+  if (activeButton == null) {
+    buttonClick(event, menuId);
+    return;
+  }
+
+  // [END MODIFIED]
+
+  // Find the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // If any other button menu is active, make this one active instead.
+
+  if (activeButton != null && activeButton != button)
+    buttonClick(event, menuId);
+}
+
+function depressButton(button) {
+
+  var x, y;
+
+  // Update the button's style class to make it look like it's
+  // depressed.
+
+  button.className += " menuButtonActive";
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the button, if not already done.
+
+  if (button.onmouseout == null)
+    button.onmouseout = buttonOrMenuMouseout;
+  if (button.menu.onmouseout == null)
+    button.menu.onmouseout = buttonOrMenuMouseout;
+
+  // [END MODIFIED]
+
+  // Position the associated drop down menu under the button and
+  // show it.
+
+  x = getPageOffsetLeft(button);
+  y = getPageOffsetTop(button) + button.offsetHeight;
+
+  // For IE, adjust position.
+
+  if (browser.isIE) {
+    x += button.offsetParent.clientLeft;
+    y += button.offsetParent.clientTop;
+  }
+
+  button.menu.style.left = x + "px";
+  button.menu.style.top  = y + "px";
+  button.menu.style.visibility = "visible";
+
+  // For IE; size, position and show the menu's IFRAME as well.
+
+  if (button.menu.iframeEl != null)
+  {
+    button.menu.iframeEl.style.left = button.menu.style.left;
+    button.menu.iframeEl.style.top  = button.menu.style.top;
+    button.menu.iframeEl.style.width  = button.menu.offsetWidth + "px";
+    button.menu.iframeEl.style.height = button.menu.offsetHeight + "px";
+    button.menu.iframeEl.style.display = "";
+  }
+}
+
+function resetButton(button) {
+
+  // Restore the button's style class.
+
+  removeClassName(button, "menuButtonActive");
+
+  // Hide the button's menu, first closing any sub menus.
+
+  if (button.menu != null) {
+    closeSubMenu(button.menu);
+    button.menu.style.visibility = "hidden";
+
+    // For IE, hide menu's IFRAME as well.
+
+    if (button.menu.iframeEl != null)
+      button.menu.iframeEl.style.display = "none";
+  }
+}
+
+//----------------------------------------------------------------------------
+// Code to handle the menus and sub menus.
+//----------------------------------------------------------------------------
+
+function menuMouseover(event) {
+
+  var menu;
+
+  // Find the target menu element.
+
+  if (browser.isIE)
+    menu = getContainerWith(window.event.srcElement, "DIV", "menu");
+  else
+    menu = event.currentTarget;
+
+  // Close any active sub menu.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+}
+
+function menuItemMouseover(event, menuId) {
+
+  var item, menu, x, y;
+
+  // Find the target item element and its parent menu element.
+
+  if (browser.isIE)
+    item = getContainerWith(window.event.srcElement, "A", "menuItem");
+  else
+    item = event.currentTarget;
+  menu = getContainerWith(item, "DIV", "menu");
+
+  // Close any active sub menu and mark this one as active.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+  menu.activeItem = item;
+
+  // Highlight the item element.
+
+  item.className += " menuItemHighlight";
+
+  // Initialize the sub menu, if not already done.
+
+  if (item.subMenu == null) {
+    item.subMenu = document.getElementById(menuId);
+    if (item.subMenu.isInitialized == null)
+      menuInit(item.subMenu);
+  }
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the sub menu, if not already done.
+
+  if (item.subMenu.onmouseout == null)
+    item.subMenu.onmouseout = buttonOrMenuMouseout;
+
+  // [END MODIFIED]
+
+  // Get position for submenu based on the menu item.
+
+  x = getPageOffsetLeft(item) + item.offsetWidth;
+  y = getPageOffsetTop(item);
+
+  // Adjust position to fit in view.
+
+  var maxX, maxY;
+
+  if (browser.isIE) {
+    maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) +
+      (document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth);
+    maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) +
+      (document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight);
+  }
+  if (browser.isOP) {
+    maxX = document.documentElement.scrollLeft + window.innerWidth;
+    maxY = document.documentElement.scrollTop  + window.innerHeight;
+  }
+  if (browser.isNS) {
+    maxX = window.scrollX + window.innerWidth;
+    maxY = window.scrollY + window.innerHeight;
+  }
+  maxX -= item.subMenu.offsetWidth;
+  maxY -= item.subMenu.offsetHeight;
+
+  if (x > maxX)
+    x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
+      + (menu.offsetWidth - item.offsetWidth));
+  y = Math.max(0, Math.min(y, maxY));
+
+  // Position and show the sub menu.
+
+  item.subMenu.style.left       = x + "px";
+  item.subMenu.style.top        = y + "px";
+  item.subMenu.style.visibility = "visible";
+
+  // For IE; size, position and display the menu's IFRAME as well.
+
+  if (item.subMenu.iframeEl != null)
+  {
+    item.subMenu.iframeEl.style.left    = item.subMenu.style.left;
+    item.subMenu.iframeEl.style.top     = item.subMenu.style.top;
+    item.subMenu.iframeEl.style.width   = item.subMenu.offsetWidth + "px";
+    item.subMenu.iframeEl.style.height  = item.subMenu.offsetHeight + "px";
+    item.subMenu.iframeEl.style.display = "";
+  }
+
+  // Stop the event from bubbling.
+
+  if (browser.isIE)
+    window.event.cancelBubble = true;
+  else
+    event.stopPropagation();
+}
+
+function closeSubMenu(menu) {
+
+  if (menu == null || menu.activeItem == null)
+    return;
+
+  // Recursively close any sub menus.
+
+  if (menu.activeItem.subMenu != null) {
+    closeSubMenu(menu.activeItem.subMenu);
+    menu.activeItem.subMenu.style.visibility = "hidden";
+
+    // For IE, hide the sub menu's IFRAME as well.
+
+    if (menu.activeItem.subMenu.iframeEl != null)
+      menu.activeItem.subMenu.iframeEl.style.display = "none";
+
+    menu.activeItem.subMenu = null;
+  }
+
+  // Deactivate the active menu item.
+
+  removeClassName(menu.activeItem, "menuItemHighlight");
+  menu.activeItem = null;
+}
+
+// [MODIFIED] Added for activate/deactivate on mouseover. Handler for mouseout
+// event on buttons and menus.
+
+function buttonOrMenuMouseout(event) {
+
+  var el;
+
+  // If there is no active button, exit.
+
+  if (activeButton == null)
+    return;
+
+  // Find the element the mouse is moving to.
+
+  if (browser.isIE)
+    el = window.event.toElement;
+  else if (event.relatedTarget != null)
+      el = (event.relatedTarget.tagName ? event.relatedTarget : event.relatedTarget.parentNode);
+
+  // If the element is not part of a menu, reset the active button.
+
+  if (getContainerWith(el, "DIV", "menu") == null) {
+    resetButton(activeButton);
+    activeButton = null;
+  }
+}
+
+// [END MODIFIED]
+
+//----------------------------------------------------------------------------
+// Code to initialize menus.
+//----------------------------------------------------------------------------
+
+function menuInit(menu) {
+
+  var itemList, spanList;
+  var textEl, arrowEl;
+  var itemWidth;
+  var w, dw;
+  var i, j;
+
+  // For IE, replace arrow characters.
+
+  if (browser.isIE) {
+    menu.style.lineHeight = "2.5ex";
+    spanList = menu.getElementsByTagName("SPAN");
+    for (i = 0; i < spanList.length; i++)
+      if (hasClassName(spanList[i], "menuItemArrow")) {
+        spanList[i].style.fontFamily = "Webdings";
+        spanList[i].firstChild.nodeValue = "4";
+      }
+  }
+
+  // Find the width of a menu item.
+
+  itemList = menu.getElementsByTagName("A");
+  if (itemList.length > 0)
+    itemWidth = itemList[0].offsetWidth;
+  else
+    return;
+
+  // For items with arrows, add padding to item text to make the
+  // arrows flush right.
+
+  for (i = 0; i < itemList.length; i++) {
+    spanList = itemList[i].getElementsByTagName("SPAN");
+    textEl  = null;
+    arrowEl = null;
+    for (j = 0; j < spanList.length; j++) {
+      if (hasClassName(spanList[j], "menuItemText"))
+        textEl = spanList[j];
+      if (hasClassName(spanList[j], "menuItemArrow"))
+        arrowEl = spanList[j];
+    }
+    if (textEl != null && arrowEl != null) {
+      textEl.style.paddingRight = (itemWidth 
+        - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
+      // For Opera, remove the negative right margin to fix a display bug.
+      if (browser.isOP)
+        arrowEl.style.marginRight = "0px";
+    }
+  }
+
+  // Fix IE hover problem by setting an explicit width on first item of
+  // the menu.
+
+  if (browser.isIE) {
+    w = itemList[0].offsetWidth;
+    itemList[0].style.width = w + "px";
+    dw = itemList[0].offsetWidth - w;
+    w -= dw;
+    itemList[0].style.width = w + "px";
+  }
+
+  // Fix the IE display problem (SELECT elements and other windowed controls
+  // overlaying the menu) by adding an IFRAME under the menu.
+
+  if (browser.isIE) {
+    menu.iframeEl = menu.parentNode.insertBefore(document.createElement("IFRAME"), menu);
+    menu.iframeEl.style.display = "none";
+    menu.iframeEl.style.position = "absolute";
+  }
+
+  // Mark menu as initialized.
+
+  menu.isInitialized = true;
+}
+
+//----------------------------------------------------------------------------
+// General utility functions.
+//----------------------------------------------------------------------------
+
+function getContainerWith(node, tagName, className) {
+
+  // Starting with the given node, find the nearest containing element
+  // with the specified tag name and style class.
+
+  while (node != null) {
+    if (node.tagName != null && node.tagName == tagName &&
+        hasClassName(node, className))
+      return node;
+    node = node.parentNode;
+  }
+
+  return node;
+}
+
+function hasClassName(el, name) {
+
+  var i, list;
+
+  // Return true if the given element currently has the given class
+  // name.
+
+  list = el.className.split(" ");
+  for (i = 0; i < list.length; i++)
+    if (list[i] == name)
+      return true;
+
+  return false;
+}
+
+function removeClassName(el, name) {
+
+  var i, curList, newList;
+
+  if (el.className == null)
+    return;
+
+  // Remove the given class name from the element's className property.
+
+  newList = new Array();
+  curList = el.className.split(" ");
+  for (i = 0; i < curList.length; i++)
+    if (curList[i] != name)
+      newList.push(curList[i]);
+  el.className = newList.join(" ");
+}
+
+function getPageOffsetLeft(el) {
+
+  var x;
+
+  // Return the x coordinate of an element relative to the page.
+
+  x = el.offsetLeft;
+  if (el.offsetParent != null)
+    x += getPageOffsetLeft(el.offsetParent);
+
+  return x;
+}
+
+function getPageOffsetTop(el) {
+
+  var y;
+
+  // Return the x coordinate of an element relative to the page.
+
+  y = el.offsetTop;
+  if (el.offsetParent != null)
+    y += getPageOffsetTop(el.offsetParent);
+
+  return y;
+}
+

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_close_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_close_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_disabled.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_disabled.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_over.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_over.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date1_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_disabled.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_disabled.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_over.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_over.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date2_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_disabled.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_disabled.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_over.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_over.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_date_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_del_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_del_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_info.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/btn_info.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/s.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/s.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/spiffycal.cur
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/spiffycal.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/spiffycal2.cur
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/spiffycal2.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/spiffycal3.cur
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/images/spiffycal3.cur
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/spiffyCal_v2_1.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/spiffyCal_v2_1.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/spiffyCal_v2_1.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,192 @@
+/*
+*  Bazillyo's Spiffy Popup Calendar Styles v2.1 Copyright S. Ousta
+*/
+#spiffycalendar {
+  width: 185px;
+  height:130px;
+  left: 0px;
+  top: 0px;
+  background-color: black;
+  position: absolute;
+  visibility: hidden;
+}
+
+.cal-SymbolBtn {
+  font-family: Webdings;
+  font-size: 8pt;
+  outline-style : none;
+  outline-width: 0px; 
+}
+
+.cal-BtnLink {
+  outline-style : none;
+  outline-width: 0px;
+}
+
+a.cal-DayLink {
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    text-decoration: none;
+    color: black;
+    background-color: transparent;
+  cursor: url('includes/javascript/spiffyCal/images/spiffycal2.cur');
+
+}
+a.cal-DayLink:hover {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+    text-decoration: none;
+    background-color: transparent;
+    color: Blue;
+  cursor: url('includes/javascript/spiffyCal/images/spiffycal2.cur');
+}
+a.cal-DayLink:active {
+   font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    text-decoration: none;
+    background-color: transparent;
+    color: #0066FF;
+  cursor: url('includes/javascript/spiffyCal/images/spiffycal2.cur');
+}
+.cal-TextBox{
+    color: Black;
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    background-color: #FFFFCC;
+}
+
+.cal-TextBoxInvalid{
+    color: #660000;
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+  border-color: Red;
+  border-style:solid;
+}
+
+.cal-TextBoxDisabled{
+    color: #808080;
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+  border-color: silver;
+  border-style:solid;
+  /*  background-color: #C0C0C0;*/
+}
+
+
+.cal-ComboBox{
+    color: Navy;
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    background-color: #EAFFFF;
+}
+
+.cal-Today {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+    text-decoration: none;
+    color: red;
+    background-color: transparent;
+}
+
+.cal-Day {
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    text-decoration: none;
+    color: black;
+    background-color: transparent;
+}
+
+
+a.cal-TodayLink {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+    text-decoration: none;
+    color: red;
+    background-color: transparent;
+  cursor: url('includes/javascript/spiffyCal/images/spiffycal.cur');
+}
+a.cal-TodayLink:hover {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+    text-decoration: none;
+    background-color: transparent;
+    color: Blue;
+  cursor: url('includes/javascript/spiffyCal/images/spiffycal.cur');
+}
+a.cal-TodayLink:active {
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+    text-decoration: none;
+    background-color: transparent;
+    color: #0066FF;
+  cursor: url('includes/javascript/spiffyCal/images/spiffycal.cur');
+}
+
+.cal-GreyDate {
+    font-family: Verdana,  Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    text-decoration: none;
+  background-color: #FFFFCC;
+    color: #999999;
+}
+
+.cal-GreyInvalidDate {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+    text-decoration: line-through;
+  background-color: #FFFFCC;
+    color: #999999;
+}
+
+.cal-DayCell {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+  background-color:White; 
+}
+
+.cal-WeekendCell {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+  background-color: #B0C4DE; 
+}
+
+.cal-HolidayCell {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: normal;
+  background-color: #99FF99;
+}
+.cal-HeadCell {
+    font-family: Verdana, Arial, sans-serif;
+    font-size: 8pt;
+    font-weight: bold;
+  color: Black;
+  background-color: #99CCFF;  /*#CCCC99; */
+}
+
+.cal-Table{
+  border-top-color: #6666FF;
+  border-left-color: #6666FF;
+  border-right-color: #6666FF;
+  border-bottom-color:  #6666FF;
+  background-color: #6666CC;
+  border-width:1px;
+  border-style: solid;
+  cursor: url('includes/javascript/spiffyCal/images/spiffycal3.cur');
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/spiffyCal_v2_1.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/spiffyCal_v2_1.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/spiffyCal/spiffyCal_v2_1.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1383 @@
+/*
+ * Bazillyo's Spiffy DHTML Popup Calendar Control - version 2.1
+ * ©2001 S. Ousta 
+ * see the included readme.htm file for license information and release notes.
+ * 
+ * For more information see:
+ * http://www.geocities.com/bazillyo/spiffy/calendar/index.htm or
+ * http://groups.yahoo.com/group/spiffyDHTML or
+ * email me: bazillyo at yahoo.com
+ *
+ */
+
+// GLOBAL variables
+var scImgPath = './includes/javascript/spiffyCal/images/';
+
+var scIE=((navigator.appName == "Microsoft Internet Explorer") || ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5)));
+var scNN6=((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5));
+var scNN=((navigator.appName == "Netscape")&&(document.layers));
+
+var img_Del=new Image();
+var img_Close=new Image();
+
+img_Del.src= scImgPath +"btn_del_small.gif";
+img_Close.src= scImgPath +"btn_close_small.gif";
+
+var scBTNMODE_DEFAULT=0;
+var scBTNMODE_CUSTOMBLUE=1;
+var scBTNMODE_CALBTN=2;
+
+var focusHack;
+
+/*================================================================================
+ * Calendar Manager Object
+ *
+ *  the functions:
+ *    isDate(), formatDate(), _isInteger(), _getInt(), and getDateFromFormat()
+ *  are based on ones courtesy of Matt Kruse (mkruse at netexpress.net) http://www.mattkruse.com/javascript/
+ *  with some modifications by myself and Michael Brydon
+ *
+ */
+
+function spiffyCalManager() {
+
+  this.showHelpAlerts = false;
+  this.defaultDateFormat='dd-MMM-yyyy';
+  this.lastSelectedDate=new Date();
+  this.calendars=new Array();
+  this.matchedFormat="";
+  this.DefBtnImgPath=scImgPath; //'./js/common/calendar/';
+
+  // methods   ----------------------------------------------------------------------
+  this.getCount= new Function("return this.calendars.length;");
+
+  function addCalendar(objWhatCal) {
+    var intIndex = this.calendars.length;
+    this.calendars[intIndex] = objWhatCal;
+  }
+  this.addCalendar=addCalendar;
+
+
+  function hideAllCalendars(objExceptThisOne) {
+    var i=0;
+    for (i=0;i<this.calendars.length;i++) {
+      if (objExceptThisOne!=this.calendars[i]) {
+        this.calendars[i].hide();
+      }
+    }
+
+  }
+  this.hideAllCalendars=hideAllCalendars;
+
+  function swapImg(objWhatCal, strToWhat, blnStick) {
+    if (document.images) {
+      // this makes it so that the button sticks down when the cal is visible
+      if ((!(objWhatCal.visible) || (blnStick))&& (objWhatCal.enabled)) {
+        document.images[objWhatCal.btnName].src = eval(objWhatCal.varName+strToWhat + ".src");
+      }
+    }
+    window.status=' ';
+  //  return true;
+  }
+  this.swapImg=swapImg;
+
+  // *** HOLIDAYS ***************************
+  
+  this.Holidays = new Array("Dec-25","Jul-4", "Feb-14","Mar-17","Oct-31");
+  this.HolidaysDesc = new Array("Christmas Day","Independance Day","Valentine's Day","St. Patrick's Day","Halloween");
+
+  //*****************************************
+  
+  function isHoliday(whatDate) {
+    var i=0;var found=-1;
+    for (i=0;i<this.Holidays.length;i++) {
+      if (whatDate==this.Holidays[i]) {
+        found=i;
+        break;
+      }
+    }
+    return found;
+  }
+  this.isHoliday=isHoliday;
+
+
+  this.AllowedFormats = new Array(
+// Days first list
+'d.M',
+'d-M',
+'d/M',
+
+'d.MMM',
+'d-MMM',
+'d/MMM',
+
+'d.M.yy',
+'d-M-yy',
+'d/M/yy',
+
+'d.M.yyyy',
+'d-M-yyyy',
+'d/M/yyyy',
+
+'d.MM.yyyy',
+'d-MM-yyyy',
+'d/MM/yyyy',
+
+'d.MMM.yy',
+'d-MMM-yy',
+'d/MMM/yy',
+
+'d.MMM.yyyy',
+'d-MMM-yyyy',
+'d/MMM/yyyy',
+
+'d.MM.yy',
+'d-MM-yy',
+'d/MM/yy',
+
+'dd.MM.yy',
+'dd-MM-yy',
+'dd/MM/yy',
+
+'dd.M.yy',
+'dd-M-yy',
+'dd/M/yy',
+
+'dd.MM.yyyy',
+'dd-MM-yyyy',
+'dd/MM/yyyy',
+
+'dd.MMM.yy',
+'dd-MMM-yy',
+'dd/MMM/yy',
+
+'dd.MMM.yyyy',
+'dd-MMM-yyyy',
+'dd/MMM/yyyy',
+
+'M.d',
+'M-d',
+'M/d',
+
+// Months first list
+
+'MMM.d',
+'MMM-d',
+'MMM/d',
+
+'M.d.yy',
+'M-d-yy',
+'M/d/yy',
+
+'MM.d.yyyy',
+'MM-d-yyyy',
+'MM/d/yyyy',
+
+'MMM.d.yy',
+'MMM-d-yy',
+'MMM/d/yy',
+
+'MMM.d.yyyy',
+'MMM-d-yyyy',
+'MMM/d/yyyy',
+
+'MM.d.yy',
+'MM-d-yy',
+'MM/d/yy',
+
+'MM.dd.yy',
+'MM-dd-yy',
+'MM/dd/yy',
+
+'M.dd.yy',
+'M-dd-yy',
+'M/dd/yy',
+
+'MM.dd.yyyy',
+'MM-dd-yyyy',
+'MM/dd/yyyy',
+
+'MMM.dd.yy',
+'MMM-dd-yy',
+'MMM/dd/yy',
+
+'MMM.dd.yyyy',
+'MMM-dd-yyyy',
+'MMM/dd/yyyy'
+
+);
+  var MONTH_NAMES = new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
+
+  this.lastBoxValidated=null;
+
+
+  function validateDate(eInput, bRequired, dStartDate, dEndDate){
+    var i = 0; var strTemp=''; var formatMatchCount=0; var firstMatchAt=0;var secondMatchAt=0;
+    var bOK = false; var bIsEmpty=false;
+
+        if (typeof(dStartDate) != "undefined") {
+      var strStart=MONTH_NAMES[dStartDate.getMonth()]+'-'+dStartDate.getDate()+'-'+dStartDate.getFullYear();
+        } else {
+          var strStart='';
+        }
+        if (typeof(dEndDate) != "undefined") {
+      var strEnd=MONTH_NAMES[dEndDate.getMonth()]+'-'+dEndDate.getDate()+'-'+dEndDate.getFullYear();
+        } else {
+          var strEnd='';
+        }
+
+    var rangeMsg = 'This input box is set up to accept dates between:\n\n   '+
+          strStart+'\n\nand\n\n   '+strEnd+'\n\nPlease enter a date no ';
+
+    this.lastBoxValidated=eInput;
+    this.matchedFormat="";
+    bIsEmpty=(eInput.value=='' || eInput.value==null);
+    if (!(bRequired && bIsEmpty)) {
+      for(i=0;i<this.AllowedFormats.length;i++){
+//alert('checking=eInput.value='+eInput.value+'  this.AllowedFormats[i]='+this.AllowedFormats[i]+'\nisDate='+isDate(eInput.value, this.AllowedFormats[i]));
+        if (isDate(eInput.value, this.AllowedFormats[i])==true){
+          bOK = true;
+          formatMatchCount+=1;
+          if (formatMatchCount==1) {firstMatchAt=i;}
+          if (formatMatchCount>1) {
+
+            if (this.AllowedFormats[i].substr(0,1)!=this.AllowedFormats[firstMatchAt].substr(0,1)) {
+              secondMatchAt=i; break;
+            }
+            else { // don't count same format with padded zeros as a different format
+              formatMatchCount=1;
+            }
+          }
+        }
+      }
+    }
+//alert('formatMatchCount='+formatMatchCount);
+    if (formatMatchCount>1) {
+
+      if (this.showHelpAlerts) {
+
+        var date1=getDateFromFormat(eInput.value,this.AllowedFormats[firstMatchAt]);
+        var choice1 = MONTH_NAMES[date1.getMonth()]+'-'+date1.getDate()+'-'+date1.getFullYear();
+        var date2=getDateFromFormat(eInput.value,this.AllowedFormats[secondMatchAt]);
+        var choice2 = MONTH_NAMES[date2.getMonth()]+'-'+date2.getDate()+'-'+date2.getFullYear();
+        if (date1.getTime()!=date2.getTime()) {
+          var Msg='You have entered an ambiguous date.\n\n Click OK for:\n'+ choice1 +'\n\nor Click Cancel for:\n'+choice2;
+          if (confirm(Msg)) {
+            bOK=true;
+          }
+          else {
+            firstMatchAt=secondMatchAt;
+            bOK=true;
+            //return false;
+          }
+          eInput.focus();
+          eInput.select();
+        }
+      }
+      else {
+        // continue and take first match in list
+        bOK=true;
+      }
+    }
+//alert('TEST    '+dThis.getDate()+"-"+dThis.getMonth());
+
+    if (bOK==true) {
+      eInput.className = "cal-TextBox";
+      //Check for Start/End Dates
+
+      if (dStartDate!=null) {
+        var dThis = getDateFromFormat(eInput.value,this.AllowedFormats[i]);
+        if (dStartDate>dThis){
+          eInput.className = "cal-TextBoxInvalid";
+          if (this.showHelpAlerts) { alert(rangeMsg + 'earlier than  '+ strStart + '.');}
+          eInput.focus();
+          eInput.select();
+          return false;
+        }
+      }
+      if (dEndDate!=null) {
+        var dThis = getDateFromFormat(eInput.value,this.AllowedFormats[i]);
+        if (dEndDate<dThis) {
+          eInput.className = "cal-TextBoxInvalid";
+          if (this.showHelpAlerts) {  alert(rangeMsg +'later than  '+ strEnd + '.');}
+          eInput.focus();
+          eInput.select();
+          return false;
+        }
+      }
+      this.matchedFormat=this.AllowedFormats[firstMatchAt];
+
+      this.lastBoxValidated = null;
+    }
+    else {
+
+      if (bRequired && bIsEmpty) {
+        eInput.className = "cal-TextBoxInvalid";
+        if (this.showHelpAlerts) {
+          alert('This date field is required.\n\nPlease enter a valid date before proceeding.');
+        }
+      }
+      else {
+        if (!bRequired && bIsEmpty) {
+          eInput.className = "cal-TextBox";
+        }
+        else {
+          eInput.className = "cal-TextBoxInvalid";
+          if (this.showHelpAlerts) {
+            for(i=0;i<this.AllowedFormats.length;i++){
+              strTemp+=this.AllowedFormats[i]+'\t';
+            }
+            alert('Please enter a valid date.\n\nExample 01-Jan-2002\n\nValid formats are:\n\n'+strTemp);
+          }
+        }
+      }
+      eInput.focus();
+      eInput.select();
+      focusHack=eInput;
+
+      setTimeout('focusHack.focus();focusHack.select();');
+      return false;
+    }
+  }
+  this.validateDate=validateDate;
+
+
+  function formatDate(eInput, strFormat) {
+    //Always called directly following validateDate  - put validate in onchange and format in onblur.
+    if(this.matchedFormat!="") {
+      var d = getDateFromFormat(eInput.value,this.matchedFormat);
+      if(d!=0){
+        eInput.value = scFormatDate(d, strFormat);
+      }
+    }
+  }
+  this.formatDate=formatDate;
+
+  function isDate(val,format) {
+    var date = getDateFromFormat(val,format);
+    if (date == 0) { return false; }
+    return true;
+  }
+  this.isDate=isDate;
+
+
+  function scFormatDate(date,format) {
+    format = format+"";
+    var result = "";
+    var i_format = 0;
+    var c = "";
+    var token = "";
+    var y = date.getFullYear()+"";
+    var M = date.getMonth()+1;
+    var d = date.getDate();
+    var h = date.getHours();
+    var m = date.getMinutes();
+    var s = date.getSeconds();
+    var yyyy,yy,MMM,MM,dd;
+    // Convert real date parts into formatted versions
+    // Year
+    if (y.length < 4) {
+      y = y-0+1900;
+      }
+    y = ""+y;
+    yyyy = y;
+    yy = y.substring(2,4);
+    // Month
+    if (M < 10) { MM = "0"+M; }
+      else { MM = M; }
+    MMM = MONTH_NAMES[M-1+12];
+    // Date
+    if (d < 10) { dd = "0"+d; }
+      else { dd = d; }
+    // Now put them all into an object!
+    var value = new Object();
+    value["yyyy"] = yyyy;
+    value["yy"] = yy;
+    value["y"] = y;
+    value["MMM"] = MMM;
+    value["MM"] = MM;
+    value["M"] = M;
+    value["dd"] = dd;
+    value["d"] = d;
+
+    while (i_format < format.length) {
+      // Get next token from format string
+      c = format.charAt(i_format);
+      token = "";
+      while ((format.charAt(i_format) == c) && (i_format < format.length)) {
+        token += format.charAt(i_format);
+        i_format++;
+        }
+      if (value[token] != null) {
+        result = result + value[token];
+        }
+      else {
+        result = result + token;
+        }
+      }
+    return result;
+  }
+  this.scFormatDate=scFormatDate;
+
+  function _isInteger(val) {
+    var digits = "1234567890";
+    for (var i=0; i < val.length; i++) {
+      if (digits.indexOf(val.charAt(i)) == -1) { return false; }
+      }
+    return true;
+  }
+
+  function _getInt(str,i,minlength,maxlength) {
+    for (x=maxlength; x>=minlength; x--) {
+      var token = str.substring(i,i+x);
+      if (_isInteger(token)) {
+        return token;
+        }
+      }
+    return null;
+  }
+
+  function getDateFromFormat(val,format) {
+    val = val+"";
+    format = format+"";
+    var i_val = 0;
+    var i_format = 0;
+    var c = "";
+    var token = "";
+    var token2= "";
+    var x,y;
+    var year  = 0;
+    var month = 0;
+    var date  = 0;
+    var bYearProvided = false;
+    while (i_format < format.length) {
+      // Get next token from format string
+      c = format.charAt(i_format);
+      token = "";
+
+      while ((format.charAt(i_format) == c) && (i_format < format.length)) {
+        token += format.charAt(i_format);
+        i_format++;
+      }
+
+      // Extract contents of value based on format token
+      if (token=="yyyy" || token=="yy" || token=="y") {
+        if (token=="yyyy") { x=4;y=4; }// 4-digit year
+        if (token=="yy")   { x=2;y=2; }// 2-digit year
+        if (token=="y")    { x=2;y=4; }// 2-or-4-digit year
+        year = _getInt(val,i_val,x,y);
+        bYearProvided = true;
+        if (year == null) {
+          return 0;
+          //Default to current year
+        }
+        if (year.length != token.length){
+          return 0;
+        }
+
+        i_val += year.length;
+      }
+      else if (token=="MMM") { // Month name
+        month = 0;
+        for (var i=0; i<MONTH_NAMES.length; i++) {
+          var month_name = MONTH_NAMES[i];
+          if (val.substring(i_val,i_val+month_name.length).toLowerCase() == month_name.toLowerCase()) {
+            month = i+1;
+            if (month>12) { month -= 12; }
+            i_val += month_name.length;
+            break;
+          }
+        }
+
+        if (month == 0) { return 0; }
+        if ((month < 1) || (month>12)) {
+          return 0
+        }
+      }
+      else if (token=="MM" || token=="M") {
+        x=token.length; y=2;
+        month = _getInt(val,i_val,x,y);
+        if (month == null) { return 0; }
+        if ((month < 1) || (month > 12)) { return 0; }
+        i_val += month.length;
+      }
+      else if (token=="dd" || token=="d") {
+        x=token.length; y=2;
+        date = _getInt(val,i_val,x,y);
+        if (date == null) { return 0; }
+        if ((date < 1) || (date>31)) { return 0; }
+        i_val += date.length;
+      }
+      else {
+        if (val.substring(i_val,i_val+token.length) != token) {
+          return 0;
+        }
+        else {
+          i_val += token.length;
+        }
+      }
+    }
+    // If there are any trailing characters left in the value, it doesn't match
+    if (i_val != val.length) {
+      return 0;
+    }
+    // Is date valid for month?
+
+    if (month == 2) {
+      // Check for leap year
+      if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) { // leap year
+        if (date > 29){ return false; }
+      }
+      else {
+        if (date > 28) { return false; }
+      }
+    }
+    if ((month==4)||(month==6)||(month==9)||(month==11)) {
+      if (date > 30) { return false; }
+    }
+
+    //JS dates uses 0 based months.
+    month = month - 1;
+
+    if (bYearProvided==false) {
+      //Default to current
+      var dCurrent = new Date();
+      year = dCurrent.getFullYear();
+    }
+
+    var lYear = parseInt(year);
+    if (lYear<=20) {
+      year = 2000 + lYear;
+    }
+    else if (lYear >=21 && lYear<=99) {
+      year = 1900 + lYear;
+    }
+
+    var newdate = new Date(year,month,date,0,0,0);
+
+    return newdate;
+  }
+  this.getDateFromFormat=getDateFromFormat;
+
+
+}
+
+
+
+var calMgr = new spiffyCalManager();
+
+
+
+//================================================================================
+// Calendar Object
+
+function ctlSpiffyCalendarBox(strVarName, strFormName, strTextBoxName, strBtnName, strDefaultValue, intBtnMode) {
+
+  var msNames     = new makeArray0('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
+  var msDays      = new makeArray0(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+  var msDOW       = new makeArray0('S','M','T','W','T','F','S');
+
+
+  var blnInConstructor=true;
+  var img_DateBtn_UP=new Image();
+  var img_DateBtn_OVER=new Image();
+  var img_DateBtn_DOWN=new Image();
+  var img_DateBtn_DISABLED=new Image();
+
+  var strBtnW;
+  var strBtnH;
+  var strBtnImg;
+
+  var dteToday=new Date;
+  var dteCur=new Date;
+
+  var dteMin=new Date;
+  var dteMax=new Date;
+
+  var scX=4; // default where to display calendar
+  var scY=4;
+
+  // Defaults
+  var strDefDateFmt='dd-MMM-yyyy';
+
+  var intDefBtnMode=0;
+  var strDefBtnImgPath=calMgr.DefBtnImgPath;
+  /* PROPERTIES =============================================================
+   *
+   */
+  // Generic Properties
+  this.varName=strVarName;
+  this.enabled=true;
+  this.readonly=false;
+  this.focusClick=false;
+  this.hideButton=false;
+  this.visible=false;
+  this.displayLeft=false;
+  this.displayTop=false;
+  // Name Properties
+  this.formName=strFormName;
+  this.textBoxName=strTextBoxName;
+  this.btnName=strBtnName;
+  this.required=false;
+  this.x=scX;
+  this.y=scY;
+
+  this.imgUp=img_DateBtn_UP;
+  this.imgOver=img_DateBtn_OVER;
+  this.imgDown=img_DateBtn_DOWN;
+  this.imgDisabled=img_DateBtn_DISABLED;
+
+  // look
+  this.showWeekends=true;
+  this.showHolidays=true;
+  this.disableWeekends=false;
+  this.disableHolidays=false;
+
+  this.textBoxWidth=160;
+  this.textBoxHeight=20;
+  this.btnImgWidth=strBtnW;
+  this.btnImgHeight=strBtnH;
+  if ((intBtnMode==null)||(intBtnMode<0 && intBtnMode>2)) {
+    intBtnMode=intDefBtnMode
+  }
+  switch (intBtnMode) {
+    case 0 :
+      strBtnImg=strDefBtnImgPath+'btn_date_up.gif';
+      img_DateBtn_UP.src=strDefBtnImgPath+'btn_date_up.gif';
+      img_DateBtn_OVER.src=strDefBtnImgPath+'btn_date_over.gif';
+      img_DateBtn_DOWN.src=strDefBtnImgPath+'btn_date_down.gif';
+      img_DateBtn_DISABLED.src=strDefBtnImgPath+'btn_date_disabled.gif';
+      strBtnW = '18';
+      strBtnH = '20';
+      break;
+    case 1 :
+      strBtnImg=strDefBtnImgPath+'btn_date1_up.gif';
+      img_DateBtn_UP.src=strDefBtnImgPath+'btn_date1_up.gif';
+      img_DateBtn_OVER.src=strDefBtnImgPath+'btn_date1_over.gif';
+      img_DateBtn_DOWN.src=strDefBtnImgPath+'btn_date1_down.gif';
+      img_DateBtn_DISABLED.src=strDefBtnImgPath+'btn_date1_disabled.gif';
+      strBtnW = '22';
+      strBtnH = '17';
+      break;
+    case 2 :
+      strBtnImg=strDefBtnImgPath+'btn_date2_up.gif';
+      img_DateBtn_UP.src=strDefBtnImgPath+'btn_date2_up.gif';
+      img_DateBtn_OVER.src=strDefBtnImgPath+'btn_date2_over.gif';
+      img_DateBtn_DOWN.src=strDefBtnImgPath+'btn_date2_down.gif';
+      img_DateBtn_DISABLED.src=strDefBtnImgPath+'btn_date2_disabled.gif';
+      strBtnW = '34';
+      strBtnH = '21';
+      break;
+  }
+  // Date Properties
+  this.dateFormat=strDefDateFmt;
+  this.useDateRange=false;
+
+  this.minDate=new Date;
+  this.maxDate=new Date(dteToday.getFullYear()+1, dteToday.getMonth(), dteToday.getDate());
+
+  this.minDay = function() {
+    return this.minDate.getDate();
+  }
+  this.minMonth = function() {
+    return this.minDate.getMonth();
+  }
+  this.minYear = function() {
+    return this.minDate.getFullYear();
+  }
+
+  this.maxDay = function() {
+    return this.maxDate.getDate();
+  }
+  this.maxMonth = function() {
+    return this.maxDate.getMonth();
+  }
+  this.maxYear = function() {
+    return this.maxYear.getFullYear();
+  }
+
+  function setMinDate(intYear, intMonth, intDay) {
+    this.minDate = new Date(intYear, intMonth-1, intDay);
+  }
+  this.setMinDate=setMinDate;
+
+
+  function setMaxDate(intYear, intMonth, intDay) {
+    this.maxDate = new Date(intYear, intMonth-1, intDay);
+  }
+  this.setMaxDate=setMaxDate;
+
+  this.minYearChoice=dteToday.getFullYear()-10;
+  this.maxYearChoice=dteToday.getFullYear()+10;
+  this.textBox= function() {
+    if (!blnInConstructor) {
+      return eval('document.'+this.formName+'.'+this.textBoxName);
+    }
+  }
+
+  this.getSelectedDate = function () {
+    var strTempVal=''; var objEle;
+    if ((typeof this.formName !='undefined') && (typeof this.textBoxName!='undefined')) {
+      objEle=eval('document.'+this.formName+'.'+this.textBoxName);
+      if (objEle && !blnInConstructor) {
+        strTempVal=eval('document.'+this.formName+'.'+this.textBoxName+'.value');
+      }
+      else {
+        strTempVal=strDefaultValue;
+      }
+    }
+    else {
+      strTempVal=strDefaultValue;
+    }
+    return strTempVal;
+  }
+
+  function setSelectedDate(strWhat) {
+    var strTempVal=''; var objEle;
+    eval('document.'+this.formName+'.'+this.textBoxName).value=strWhat;
+
+    if (!calMgr.isDate(quote(strWhat),quote(this.dateFormat))) {
+      eval('document.'+this.formName+'.'+this.textBoxName).className = "cal-TextBoxInvalid";
+    }
+    else {
+      eval('document.'+this.formName+'.'+this.textBoxName).className = "cal-TextBox";
+    }
+  }
+  this.setSelectedDate=setSelectedDate;
+
+
+  function disable() {
+    this.hide();
+    calMgr.swapImg(this,'.imgDisabled',false);
+    this.enabled=false;
+    eval('document.'+this.formName+'.'+this.textBoxName).disabled=true;
+        eval('document.'+this.formName+'.'+this.textBoxName).className = "cal-TextBoxDisabled";
+    if (scNN) {
+      eval('document.'+this.formName+'.'+this.textBoxName).onFocus= function() {this.blur();};
+    }
+  }
+  this.disable=disable;
+
+  function enable() {
+    this.enabled=true;
+    calMgr.swapImg(this,'.imgUp',false);
+    eval('document.'+this.formName+'.'+this.textBoxName).disabled=false;
+        eval('document.'+this.formName+'.'+this.textBoxName).className = "cal-TextBox";
+    if (scNN) {
+      eval('document.'+this.formName+'.'+this.textBoxName).onFocus= null;
+    }
+
+    if (!calMgr.isDate(quote(this.getSelectedDate()),quote(this.dateFormat))) {
+      eval('document.'+this.formName+'.'+this.textBoxName).className = "cal-TextBoxInvalid";
+    }
+  }
+  this.enable=enable;
+
+
+
+  // behavior Properties
+  this.JStoRunOnSelect='';
+  this.JStoRunOnClear='';
+  this.JStoRunOnCancel='';
+  this.hideCombos=true;
+
+
+  /* METHODS ===============================================================
+   *
+   */
+
+  function makeCalendar(intWhatMonth,intWhatYear,bViewOnly) {
+    if (bViewOnly) {intWhatMonth-=1;}
+    var strOutput = '';
+    var intStartMonth=intWhatMonth;
+    var intStartYear=intWhatYear;
+    var intLoop;
+    var strTemp='';
+    var strDateColWidth;
+    var isWE = false;
+
+    dteCur.setMonth(intWhatMonth);
+    dteCur.setFullYear(intWhatYear);
+    dteCur.setDate(dteToday.getDate());
+    dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0);
+    if (!(bViewOnly)) {
+      strTemp='<form name="spiffyCal">';
+    }
+    // special case for form not to be inside table in Netscape 6
+    if (scNN6) {
+      strOutput += strTemp +'<table width="185" border="3" class="cal-Table" cellspacing="0" cellpadding="0"><tr>';
+    }
+    else {
+      strOutput += '<table width="185" border="3" class="cal-Table" cellspacing="0" cellpadding="0">'+strTemp+'<tr>';
+    }
+
+    if (!(bViewOnly)) {
+      strOutput += '<td class="cal-HeadCell" align="center" width="100%"><a href="javascript:'+this.varName+'.clearDay();"><img name="calbtn1" src="'+strDefBtnImgPath+'btn_del_small.gif" border="0" width="12" height="10"></a>&nbsp;&nbsp;<a href="javascript:'+this.varName+'.scrollMonth(-1);" class="cal-DayLink">&lt;</a>&nbsp;<SELECT class="cal-ComboBox" NAME="cboMonth" onChange="'+this.varName+'.changeMonth();">';
+
+
+      for (intLoop=0; intLoop<12; intLoop++) {
+        if (intLoop == intWhatMonth) strOutput += '<OPTION VALUE="' + intLoop + '" SELECTED>' + msNames[intLoop] + '<\/OPTION>';
+        else  strOutput += '<OPTION VALUE="' + intLoop + '">' + msNames[intLoop] + '<\/OPTION>';
+      }
+
+
+      strOutput += '<\/SELECT><SELECT class="cal-ComboBox" NAME="cboYear" onChange="'+this.varName+'.changeYear();">';
+
+      for (intLoop=this.minYearChoice; intLoop<this.maxYearChoice; intLoop++) {
+        if (intLoop == intWhatYear) strOutput += '<OPTION VALUE="' + intLoop + '" SELECTED>' + intLoop + '<\/OPTION>';
+        else strOutput += '<OPTION VALUE="' + intLoop + '">' + intLoop + '<\/OPTION>';
+      }
+
+      strOutput += '<\/SELECT>&nbsp;<a href="javascript:'+this.varName+'.scrollMonth(1);" class="cal-DayLink">&gt;</a>&nbsp;&nbsp;<a href="javascript:'+this.varName+'.hide();"><img name="calbtn2" src="'+strDefBtnImgPath+'btn_close_small.gif" border="0" width="12" height="10"></a><\/td><\/tr><tr><td width="100%" align="center">';
+    }
+    else {
+      strOutput += '<td class="cal-HeadCell" align="center" width="100%">'+msNames[intWhatMonth]+'-'+intWhatYear+'<\/td><\/tr><tr><td width="100%" align="center">';
+    }
+
+
+    firstDay = new Date(intWhatYear,intWhatMonth,1);
+    startDay = firstDay.getDay();
+
+    if (((intWhatYear % 4 == 0) && (intWhatYear % 100 != 0)) || (intWhatYear % 400 == 0))
+      msDays[1] = 29;
+    else
+      msDays[1] = 28;
+
+    strOutput += '<table width="185" cellspacing="1" cellpadding="2" border="0"><tr>';
+    // Header ROW showing days of week here
+    for (intLoop=0; intLoop<7; intLoop++) {
+      if (intLoop==0 || intLoop==6) {
+        strDateColWidth="15%"
+      }
+      else
+      {
+        strDateColWidth="14%"
+      }
+      strOutput += '<td class="cal-HeadCell" width="' + strDateColWidth + '" align="center" valign="middle">'+ msDOW[intLoop] +'<\/td>';
+    }
+
+    strOutput += '<\/tr><tr>';
+
+    var intColumn = 0;
+    var intLastMonth = intWhatMonth - 1;
+    var intLastYear = intWhatYear;
+
+    if (intLastMonth == -1) { intLastMonth = 11; intLastYear=intLastYear-1;}
+    // Show last month's days in first row
+    for (intLoop=0; intLoop<startDay; intLoop++, intColumn++) {
+      strOutput += this.getDayLink(true,(msDays[intLastMonth]-startDay+intLoop+1),intLastMonth,intLastYear,bViewOnly,isWE);
+    }
+    // Show this month's days
+    for (intLoop=1; intLoop<=msDays[intWhatMonth]; intLoop++, intColumn++) {
+      if ((intColumn % 6)==0) {isWE=true } else {isWE=false}
+      strOutput += this.getDayLink(false,intLoop,intWhatMonth,intWhatYear,bViewOnly,isWE);
+      if (intColumn == 6) {
+        strOutput += '<\/tr><tr>';
+        intColumn = -1;
+      }
+    }
+
+    var intNextMonth = intWhatMonth+1;
+    var intNextYear = intWhatYear;
+
+    if (intNextMonth==12) { intNextMonth=0; intNextYear=intNextYear+1;}
+    // Show next month's days in last row
+    if (intColumn > 0) {
+      for (intLoop=1; intColumn<7; intLoop++, intColumn++) {
+        strOutput +=  this.getDayLink(true,intLoop,intNextMonth,intNextYear,bViewOnly);
+      }
+      strOutput += '<\/tr><\/table><\/td><\/tr>';
+    }
+    else {
+      strOutput = strOutput.substr(0,strOutput.length-4); // remove the <tr> from the end if there's no last row
+      strOutput += '<\/table><\/td><\/tr>';
+    }
+
+    if (scNN6) {
+      strOutput += '<\/table><\/form>';
+    }
+    else {
+      strOutput += '<\/form><\/table>';
+    }
+    dteCur.setDate(1);
+    dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0);
+
+    dteCur.setMonth(intStartMonth);
+    dteCur.setFullYear(intStartYear);
+
+    return strOutput;
+  }
+  this.makeCalendar=makeCalendar;
+
+
+  // writeControl -------------------------------------
+  //
+  function writeControl() {
+    var strHold='';
+    var strTemp='';
+    var strTempMinDate='';
+    var strTempMaxDate='';
+
+    // specify whether you can type in the date box and validate them as well
+    // or whether you must use the calendar only to select a date
+    if (this.readonly) {
+      strTemp=' onFocus="this.blur();" readonly ';
+    }
+    if (this.focusClick) {
+      strTemp=' onFocus="'+this.varName+'.show();" ';
+    }
+
+    if (!(this.useDateRange)) {
+      strTemp+=' onChange="calMgr.validateDate(document.'+this.formName+'.'+this.textBoxName+','+this.varName+'.required);" onBlur="calMgr.formatDate(document.'+this.formName+'.'+this.textBoxName+','+this.varName+'.dateFormat);" ';
+    }
+    else {
+      strTempMinDate=this.minDate.getDate()+'-'+msNames[this.minDate.getMonth()]+'-'+this.minDate.getFullYear();
+      strTempMaxDate=this.maxDate.getDate()+'-'+msNames[this.maxDate.getMonth()]+'-'+this.maxDate.getFullYear();
+      strTemp+=' onChange="calMgr.validateDate('+'document.'+this.formName+'.'+this.textBoxName+','+this.varName+'.required,'+this.varName+'.minDate,'+this.varName+'.maxDate);" onBlur="calMgr.formatDate(document.'+this.formName+'.'+this.textBoxName+','+this.varName+'.dateFormat);" ';
+    }
+
+    strHold='<input class="cal-TextBox" type="text" name="' + this.textBoxName + '"' + strTemp + 'size="12" value="' + this.getSelectedDate() + '">';
+    if (!scIE) {
+      strTemp=' href="javascript:calClick();return false;" ';
+    }
+    else {
+      strTemp='';
+    }
+    if ((this.focusClick==false) || (this.focusClick==true && this.hideButton==false))  {
+      strHold+='<a class="so-BtnLink"'+strTemp;
+
+      strHold+=' onmouseover="calMgr.swapImg(' + this.varName + ',\'.imgOver\',false);" ';
+
+      strHold+='onmouseout="calMgr.swapImg(' + this.varName + ',\'.imgUp\',false);" ';
+
+      strHold+='onclick="calMgr.swapImg(' + this.varName + ',\'.imgDown\',true);';
+
+  //    strHold+=this.varName+'.show();return false;">';
+      strHold+=this.varName+'.show();">';
+
+      strHold+='<img align="absmiddle" border="0" name="' + this.btnName + '" src="' + strBtnImg +'" width="'+ strBtnW +'" height="'+ strBtnH +'"></a>';
+    }
+    document.write(strHold);
+  }
+  this.writeControl=writeControl;
+
+
+  // show -------------------------------------
+  //
+  function show() {
+    var strCurSelDate = calMgr.lastSelectedDate;
+
+    if (!this.enabled) { return }
+    calMgr.hideAllCalendars(this);
+    if (this.visible) {
+      this.hide();
+    }
+    else {
+// put these next 2 lines in when the tiny cal btns seem to randomly disappear
+      if (document.images['calbtn1']!=null ) document.images['calbtn1'].src=img_Del.src;
+      if (document.images['calbtn2']!=null ) document.images['calbtn2'].src=img_Close.src;
+
+      if (this.focusClick==true && this.hideButton==true) {
+        //if no dropdown button then use user-provided location for it
+        scX=this.x;
+        scY=this.y;
+      }
+      else {
+        // get correct position of date btn
+        if ( scIE ) {
+          if (this.displayLeft) {
+            scX = getOffsetLeft(document.images[this.btnName])-192+ document.images[this.btnName].width ;
+          }
+          else {
+            scX = getOffsetLeft(document.images[this.btnName]);
+          }
+          if (this.displayTop) {
+            scY = getOffsetTop(document.images[this.btnName]) -138 ;
+          }
+          else {
+            scY = getOffsetTop(document.images[this.btnName]) + document.images[this.btnName].height + 2;
+          }
+        }
+        else if (scNN){
+          if (this.displayLeft) {
+            scX = document.images[this.btnName].x - 192+  document.images[this.btnName].width;
+          }
+          else {
+            scX = document.images[this.btnName].x;
+          }
+          if (this.displayTop) {
+            scY = document.images[this.btnName].y -134;
+          }
+          else {
+            scY = document.images[this.btnName].y + document.images[this.btnName].height + 2;
+          }
+        }
+      }
+      // hide all combos underneath it
+      if (this.hideCombos) {toggleCombos('hidden');}
+
+      // pop calendar up to the correct month and year if there's a date there
+      // otherwise pop it up using today's month and year
+      if (this.getSelectedDate()==''){
+        if (!(dteCur)) {
+          domlay('spiffycalendar',1,scX,scY,this.makeCalendar(dteToday.getMonth(),dteToday.getFullYear()));
+        }
+        else {
+          domlay('spiffycalendar',1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()));
+        }
+      }
+      else {
+        if (calMgr.isDate(quote(this.getSelectedDate()),quote(this.dateFormat))) {
+            dteCur = calMgr.getDateFromFormat(quote(this.getSelectedDate()),quote(this.dateFormat));
+          dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0);
+
+        }
+        else {
+          dteCur=calMgr.lastSelectedDate;
+        }
+        domlay('spiffycalendar',1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()));
+      }
+
+      this.visible=true;
+    }
+
+  }
+  this.show=show;
+
+
+  // hide -------------------------------------
+  //
+  function hide() {
+
+    domlay('spiffycalendar',0,scX,scY);
+    this.visible = false;
+    calMgr.swapImg(this,'.imgUp',false);
+    if (this.hideCombos) {toggleCombos('visible');}
+  }
+  this.hide=hide;
+
+
+  // clearDay -------------------------------------
+  //
+  function clearDay() {
+    eval('document.' + this.formName + '.' + this.textBoxName + '.value = \'\'');
+    this.hide();
+    if (this.JStoRunOnClear!=null)
+      eval(unescape(this.JStoRunOnClear));
+
+    eval('document.'+this.formName+'.'+this.textBoxName).className = "cal-TextBox";
+    if (this.required) {
+      eval('document.'+this.formName+'.'+this.textBoxName).className = "cal-TextBoxInvalid";
+    }
+  }
+  this.clearDay=clearDay;
+
+
+  // changeDay -------------------------------------
+  //
+  function changeDay(intWhatDay) {
+    dteCur.setDate(intWhatDay);
+    dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0);
+
+    this.textBox().value=calMgr.scFormatDate(dteCur,this.dateFormat);
+    this.hide();
+    if (this.JStoRunOnSelect!=null)
+      eval(unescape(this.JStoRunOnSelect));
+
+    eval('document.'+this.formName+'.'+this.textBoxName).className = "cal-TextBox";
+
+  }
+  this.changeDay=changeDay;
+
+  // scrollMonth -------------------------------------
+  //
+  function scrollMonth(intAmount) {
+    var intMonthCheck;
+    var intYearCheck;
+
+    if (scIE) {
+      intMonthCheck = document.forms["spiffyCal"].cboMonth.selectedIndex + intAmount;
+    }
+    else if (scNN) {
+      intMonthCheck = document.spiffycalendar.document.forms["spiffyCal"].cboMonth.selectedIndex + intAmount;
+    }
+    if (intMonthCheck < 0) {
+      intYearCheck = dteCur.getFullYear() - 1;
+      if ( intYearCheck < this.minYearChoice ) {
+        intYearCheck = this.minYearChoice;
+        intMonthCheck = 0;
+      }
+      else {
+        intMonthCheck = 11;
+      }
+      dteCur.setFullYear(intYearCheck);
+    }
+    else if (intMonthCheck >11) {
+      intYearCheck = dteCur.getFullYear() + 1;
+      if ( intYearCheck > this.maxYearChoice-1 ) {
+        intYearCheck = this.maxYearChoice-1;
+        intMonthCheck = 11;
+      }
+      else {
+        intMonthCheck = 0;
+      }
+      dteCur.setFullYear(intYearCheck);
+    }
+
+    if (scIE) {
+      dteCur.setMonth(document.forms["spiffyCal"].cboMonth.options[intMonthCheck].value);
+    }
+    else if (scNN) {
+      dteCur.setMonth(document.spiffycalendar.document.forms["spiffyCal"].cboMonth.options[intMonthCheck].value );
+    }
+    domlay('spiffycalendar',1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()));
+  }
+  this.scrollMonth=scrollMonth;
+
+
+  // changeMonth -------------------------------------
+  //
+  function changeMonth() {
+    if (scIE) {
+      dteCur.setMonth(document.forms["spiffyCal"].cboMonth.options[document.forms["spiffyCal"].cboMonth.selectedIndex].value);
+      domlay('spiffycalendar',1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()));
+    }
+    else if (scNN) {
+      dteCur.setMonth(document.spiffycalendar.document.forms["spiffyCal"].cboMonth.options[document.spiffycalendar.document.forms["spiffyCal"].cboMonth.selectedIndex].value);
+      domlay('spiffycalendar',1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()));
+    }
+  }
+  this.changeMonth=changeMonth;
+
+
+  // changeYear -------------------------------------
+  //
+  function changeYear() {
+    if (scIE) {
+      dteCur.setFullYear(document.forms["spiffyCal"].cboYear.options[document.forms["spiffyCal"].cboYear.selectedIndex].value);
+      domlay('spiffycalendar',1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()));
+    }
+    else if (scNN) {
+      dteCur.setFullYear(document.spiffycalendar.document.forms["spiffyCal"].cboYear.options[document.spiffycalendar.document.forms["spiffyCal"].cboYear.selectedIndex].value);
+      domlay('spiffycalendar',1,scX,scY,this.makeCalendar(dteCur.getMonth(),dteCur.getFullYear()));
+    }
+  }
+  this.changeYear=changeYear;
+
+  function getDayLink(blnIsGreyDate,intLinkDay,intLinkMonth,intLinkYear,bViewOnly,isWE) {
+    var templink; var tempLinkClass='calDay-Link';
+    var tempClass='cal-DayCell';
+    var tempDt=''; var isHol=-1; var holTxt='';
+    if (isWE==true && this.showWeekends==true) {tempClass='cal-WeekendCell';}
+    tempDt=msNames[intLinkMonth]+'-'+intLinkDay;
+    if (this.showHolidays) {isHol=calMgr.isHoliday(tempDt); if (isHol!=-1) {holTxt=' title="'+calMgr.HolidaysDesc[isHol]+'"'; tempClass='cal-HolidayCell';}}
+    if (!(this.useDateRange)) {
+      if (blnIsGreyDate) {
+        templink='<td align="center" class="cal-GreyDate">' + intLinkDay + '<\/td>';
+      }
+      else {
+        if (isDayToday(intLinkDay)) {
+          if (!(bViewOnly)) {
+            templink='<td align="center" class="'+tempClass+'">' + '<a class="cal-TodayLink" '+holTxt+' onmouseover="self.status=\' \';return true" href="javascript:'+this.varName+'.changeDay(' + intLinkDay + ');">' + intLinkDay + '<\/a><\/td>';
+          }
+          else {
+            templink='<td align="center" class="'+tempClass+'"><span class="cal-Today">' + intLinkDay +'<\/span><\/td>';
+          }
+        }
+        else {
+          if (!(bViewOnly)) {
+            templink='<td align="center" class="'+tempClass+'">' + '<a class="cal-DayLink" '+holTxt+' onmouseover="self.status=\' \';return true" href="javascript:'+this.varName+'.changeDay(' + intLinkDay + ');">' + intLinkDay + '<\/a>' +'<\/td>';
+          }
+          else {
+            templink='<td align="center" class="'+tempClass+'"><span class="cal-Day">' + intLinkDay + '<\/span><\/td>';
+          }
+        }
+      }
+    }
+    else {
+      if (this.isDayValid(intLinkDay,intLinkMonth,intLinkYear)) {
+
+        if (blnIsGreyDate){
+          templink='<td align="center" class="cal-GreyDate">' + intLinkDay + '<\/td>';
+        }
+        else {
+          if (isDayToday(intLinkDay)) {
+            if (!(bViewOnly)) {
+              templink='<td align="center" class="'+tempClass+'">' + '<a class="cal-TodayLink" '+holTxt+' onmouseover="self.status=\' \';return true" href="javascript:'+this.varName+'.changeDay(' + intLinkDay + ');">' + intLinkDay + '<\/a>' +'<\/td>';
+            }
+            else {
+              templink='<td align="center" class="'+tempClass+'"><span class="cal-Today">' + intLinkDay + '<\/span><\/td>';
+            }
+          }
+          else {
+            if (!(bViewOnly)) {
+              templink='<td align="center" class="'+tempClass+'">' + '<a class="cal-DayLink" '+holTxt+' onmouseover="self.status=\' \';return true" href="javascript:'+this.varName+'.changeDay(' + intLinkDay + ');">' + intLinkDay + '<\/a>' +'<\/td>';
+            }
+            else {
+              templink='<td align="center" class="'+tempClass+'"><span class="cal-Day">' +  intLinkDay  +'<\/span><\/td>';
+            }
+          }
+        }
+      }
+      else {
+        templink='<td align="center" class="cal-GreyInvalidDate">'+ intLinkDay + '<\/td>';
+      }
+    }
+    return templink;
+  }
+  this.getDayLink=getDayLink;
+
+
+  // EXTRA Private FUNCTIONS ===============================================================
+
+  function toggleCombos(showHow){
+    var i; var j;
+    var cboX; var cboY;
+    for (i=0;i<document.forms.length;i++) {
+      for (j=0;j<document.forms[i].elements.length;j++) {
+        if (document.forms[i].elements[j].tagName == "SELECT") {
+          if (document.forms[i].name != "spiffyCal") {
+            cboX = getOffsetLeft(document.forms[i].elements[j]);
+            cboY = getOffsetTop(document.forms[i].elements[j]);
+              if ( ((cboX>=scX-15) && (cboX<=scX+200)) && ((cboY>=scY-15) && (cboY<=scY+145)) )
+                document.forms[i].elements[j].style.visibility=showHow;
+              //Check for right hand side overlapping.
+              cboX = cboX + parseInt(document.forms[i].elements[j].style.width);
+              cboY=cboY+15;//cbo height (default)
+              if ( ((cboX>=scX+15) && (cboX<=scX+200)) && ((cboY>=scY-15) && (cboY<=scY+145)) )
+                document.forms[i].elements[j].style.visibility=showHow;
+          }
+        }
+      }
+    }
+  }
+
+
+
+  function isDayToday(intWhatDay) {
+    if ((dteCur.getFullYear() == dteToday.getFullYear()) && (dteCur.getMonth() == dteToday.getMonth()) && (intWhatDay == dteToday.getDate())) {
+      return true;
+    }
+    else {
+      return false;
+    }
+  }
+
+
+  function isDayValid(intWhatDay, intWhatMonth, intWhatYear){
+    dteCur.setDate(intWhatDay);
+    dteCur.setMonth(intWhatMonth);
+    dteCur.setFullYear(intWhatYear);
+    dteCur.setHours(0);dteCur.setMinutes(0);dteCur.setSeconds(0);dteCur.setMilliseconds(0);
+    if ((dteCur>=this.minDate) && (dteCur<=this.maxDate)) {
+      return true;
+    }
+    else {
+      return false;
+    }
+  }
+  this.isDayValid=isDayValid;
+
+  calMgr.addCalendar(this);
+
+  blnInConstructor=false;
+}
+
+
+
+// Utility functions----------------------------------
+
+
+function quote(sWhat) {
+  return '\''+sWhat+'\'';
+}
+
+
+function getOffsetLeft (el) {
+  var ol = el.offsetLeft;
+  while ((el = el.offsetParent) != null)
+    ol += el.offsetLeft;
+  return ol;
+}
+
+
+function getOffsetTop (el) {
+  var ot = el.offsetTop;
+  while((el = el.offsetParent) != null)
+    ot += el.offsetTop;
+  return ot;
+}
+
+function calClick() {
+  window.focus();
+}
+
+function domlay(id,trigger,lax,lay,content) {
+  /*
+   * Cross browser Layer visibility / Placement Routine
+   * Done by Chris Heilmann (mail at ichwill.net)
+   * http://www.ichwill.net/mom/domlay/
+   * Feel free to use with these lines included!
+   * Created with help from Scott Andrews.
+   * The marked part of the content change routine is taken
+   * from a script by Reyn posted in the DHTML
+   * Forum at Website Attraction and changed to work with
+   * any layername. Cheers to that!
+   * Welcome DOM-1, about time you got included... :)
+   */
+  // Layer visible
+  if (trigger=="1"){
+    if (document.layers) document.layers[''+id+''].visibility = "show"
+    else if (document.all) document.all[''+id+''].style.visibility = "visible"
+    else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
+    }
+  // Layer hidden
+  else if (trigger=="0"){
+    if (document.layers) document.layers[''+id+''].visibility = "hide"
+    else if (document.all) document.all[''+id+''].style.visibility = "hidden"
+    else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
+    }
+  // Set horizontal position
+  if (lax){
+    if (document.layers){document.layers[''+id+''].left = lax}
+    else if (document.all){document.all[''+id+''].style.left=lax}
+    else if (document.getElementById){document.getElementById(''+id+'').style.left=lax+"px"}
+    }
+  // Set vertical position
+  if (lay){
+    if (document.layers){document.layers[''+id+''].top = lay}
+    else if (document.all){document.all[''+id+''].style.top=lay}
+    else if (document.getElementById){document.getElementById(''+id+'').style.top=lay+"px"}
+    }
+  // change content
+
+  if (content){
+  if (document.layers){
+    sprite=document.layers[''+id+''].document;
+    // add father layers if needed! document.layers[''+father+'']...
+    sprite.open();
+    sprite.write(content);
+    sprite.close();
+    }
+  else if (document.all) document.all[''+id+''].innerHTML = content;
+  else if (document.getElementById){
+    //Thanx Reyn!
+    rng = document.createRange();
+    el = document.getElementById(''+id+'');
+    rng.setStartBefore(el);
+    htmlFrag = rng.createContextualFragment(content)
+    while(el.hasChildNodes()) el.removeChild(el.lastChild);
+    el.appendChild(htmlFrag);
+    // end of Reyn ;)
+    }
+  }
+}
+
+
+function makeArray0() {
+  for (i = 0; i<makeArray0.arguments.length; i++)
+    this[i] = makeArray0.arguments[i];
+}
+
+//---------------------------------------
+

Added: trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/howto.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/howto.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/howto.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3 @@
+Creata a sub folder in the zip directory and copy all these files to that dir.
+Replace the include statements of webfxlayout.js and webfxapi.js to point at local/webfxlayout.js and
+local/webfxapi.js
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxapi.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxapi.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxapi.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+/* This style sheet is used for WebFX Api pages */

a.helpLink,
+a.helpLink:hover {
+  color:        rgb(0,66,174);
+  border-bottom-color:rgb(0,66,174);
+}
+
+.help-tooltip {
+  width:  auto;
+}
+
+.help-tooltip h4,
+.help-tooltip table,
+.help-tooltip p {
+  width:  auto;
+}
+
+.methodContainer {
+  display:  none;
+}
+
+.methodInfo h4,
+.methodInfo thead td {
+  font-size:    13px;
+  background:   none;
+  border-bottom:  0;
+}
+
+.methodInfo h4,
+.methodInfo p, 
+.methodInfo table {
+  margin:   5px;
+  padding:  0;
+}
+
+td {
+  vertical-align: top;
+}
+
+td code {
+  white-space:  nowrap;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxapi.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxapi.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxapi.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+/*
+ *  This script is used for WebFX Api pages
+ *
+ *  It defines one funtion and includes helptip.js, helptip.css and webfxapi.css
+ */
+
+//document.write( "<script type='text/javascript' src='local/helptip.js'><\/script>" );
+//document.write( "<link type='text/css' rel='stylesheet' href='local/helptip.css' />" );
+//document.write( "<link type='text/css' rel='stylesheet' href='local/webfxapi.css' />" );
+
+function toggleMethodArguments( e, a ) {
+  if ( a && a.nextSibling &&
+    typeof a.nextSibling.innerHTML != "undefined" &&
+    typeof showHelpTip != "undefined" ) {
+  
+    showHelpTip( e, a.nextSibling.innerHTML );
+    
+  }
+}
+  
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxlayout.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxlayout.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tabpane/local/webfxlayout.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,111 @@
+/* this is a dummy webfxlayout file to be used in download zip files */
+
+
+/* Do includes */
+
+if (window.pathToRoot == null)
+  pathToRoot = "./";
+
+document.write('<link type="text/css" rel="stylesheet" href="local/webfxlayout.css">');
+webfxMenuDefaultImagePath = pathToRoot + "images/";
+
+/* end includes */
+
+/* set up browser checks and add a simple emulation for IE4 */
+
+// check browsers
+var op = /opera 5|opera\/5/i.test(navigator.userAgent);
+var ie = !op && /msie/i.test(navigator.userAgent);  // preventing opera to be identified as ie
+var mz = !op && /mozilla\/5/i.test(navigator.userAgent);  // preventing opera to be identified as mz
+
+if (ie && document.getElementById == null) {  // ie4
+  document.getElementById = function(sId) {
+    return document.all[sId];
+  };
+}
+
+/* end browser checks */
+
+webfxLayout = {
+  writeTitle    : function (s, s2) {
+    document.write("<div id='webfx-title-background'></div>");
+    if (op) {
+      document.write("<h1 id='webfx-title' style='top:9px;'>" + s + "</h1>");
+    }
+    else {
+      document.write("<h1 id='webfx-title'>" + s + "</h1>");
+    }
+
+    if (s2 == null)
+      s2 = "WebFX - What you never thought possible!";
+    
+    if (op) {
+      document.write("<span id='webfx-sub-title' style='top:46px;'>" + s2 + "</span>");
+    }
+    else {
+      document.write("<span id='webfx-sub-title'>" + s2 + "</span>");
+    }
+  },
+  writeMainTitle  : function () {
+    this.writeTitle("WebFX", "What you never thought possible!"); 
+  },
+  writeTopMenuBar   : function () {
+    document.write("<div id='webfx-menu-bar-1'></div>");
+    if (op) {
+      document.write("<style>.webfx-menu-bar a {padding-top:3px;}</style>");
+      document.write("<div id='webfx-menu-bar-2' style='height:2px;'></div>");
+    }
+    else
+      document.write("<div id='webfx-menu-bar-2'></div>");
+    document.write("<div id='webfx-menu-bar'>");// div is closed in writeBottomMenuBar
+  },
+  writeBottomMenuBar  : function () {
+    document.write("</div>");
+    if (op)
+      document.write("<div id='webfx-menu-bar-3' style='height:0px;'></div>");
+    else
+      document.write("<div id='webfx-menu-bar-3'></div>");
+    document.write("<div id='webfx-menu-bar-4'></div>");
+    document.write("<div id='webfx-menu-bar-5'></div>");
+  },
+  writeMenu     : function () {
+    this.writeTopMenuBar();
+    //document.write(webfxMenuBar);
+    document.write("<div class='webfx-menu-bar'><a href='http://webfx.eae.net'>WebFX Home</a></div>");
+    this.writeBottomMenuBar();
+  },
+  writeDesignedByEdger  : function () {
+    if (ie && document.body.currentStyle.writingMode != null)
+      document.write("<div id='webfx-about'>Page designed and maintained by " +
+          "<a href='mailto:erik at eae.net'>Erik Arvidsson</a> &amp; " +
+          "<a href='mailto:eae at eae.net'>Emil A Eklund</a>.</div>");
+  }
+};
+
+if (ie && window.attachEvent) {
+  window.attachEvent("onload", function () {
+    var scrollBorderColor = "";
+    var scrollFaceColor   = "";
+    with (document.body.style) {
+      scrollbarDarkShadowColor  = scrollBorderColor;
+      scrollbar3dLightColor   = scrollBorderColor;
+      scrollbarArrowColor     = "black";
+      scrollbarBaseColor      = scrollFaceColor;
+      scrollbarFaceColor      = scrollFaceColor;
+      scrollbarHighlightColor   = scrollFaceColor;
+      scrollbarShadowColor    = scrollFaceColor;
+      scrollbarTrackColor     = "white";
+    }
+  });
+}
+
+/* we also need some dummy constructors */
+webfxMenuBar = {
+  add : function () {}
+};
+function WebFXMenu() {
+  this.add = function () {};
+}
+function WebFXMenuItem() {}
+function WebFXMenuSeparator() {}
+function WebFXMenuButton() {}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tabpane/tab.webfx.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tabpane/tab.webfx.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tabpane/tab.webfx.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+/*
+
+bright: rgb(234,242,255);
+normal: rgb(120,172,255);
+dark: rgb(0,66,174);
+
+*/
+.dynamic-tab-pane-control.tab-pane {
+  position: relative;
+  width:    100%;
+}
+
+.dynamic-tab-pane-control .tab-row .tab {
+  font-family:  Verdana, Helvetica, Arial;
+  font-size:    12px;
+  display:    inline;
+  margin:     1px -5px 1px 5px;
+  float:      left;
+  padding:    3px 6px 3px 6px;
+  background:   #F3F3F3;
+  border:     1px solid;
+  border-color: rgb(120,172,255);
+  border-left:  0;
+  border-bottom:  0;
+  border-top:   0;
+  
+  cursor:     pointer;
+  
+  z-index:    1;
+  position:   relative;
+  top:      0;
+}
+
+.dynamic-tab-pane-control .tab-row .tab.selected {
+  border:     1px solid rgb(120,172,255);
+  border-bottom:  0;
+  z-index:    3;
+  padding:    2px 6px 5px 6px;
+  margin:     1px -6px -2px 0px;
+  top:      -2px;
+  background:   #F0F8FF;
+}
+
+.dynamic-tab-pane-control .tab-row .tab a {
+  font-family:    Verdana, Helvetica, Arial;
+  font-size:      13px;
+  color:        rgb(0,66,174);
+  text-decoration:  none;
+  cursor:     pointer;  
+}
+
+.dynamic-tab-pane-control .tab-row .hover a {
+  color:  rgb(0,66,174);
+}
+
+.dynamic-tab-pane-control .tab-row .tab.selected a {
+  font-weight:  bold;
+}
+
+.dynamic-tab-pane-control .tab-page {
+  clear: both;
+  border: 1px solid rgb(120,172,255);
+  background: White;
+  z-index: 2;
+  position: relative;
+  top: -2px;
+  color: Black;
+  font-family: Verdana, Helvetica, Arial;
+  font-size: 13px;
+  padding: 10px;
+}
+
+.dynamic-tab-pane-control .tab-row {
+  z-index:    1;
+  white-space:  nowrap;
+  /*background:   rgb(234,242,255);*/
+  height:     1.85em;
+  width:      100%;
+}
+.text_area {
+        border : 1px solid #ccc;
+        z-index: -3;
+        font-size: 11px
+}
+INPUT, TEXTAREA, SELECT {
+  z-index : -3;
+  font-size: 11px;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tabpane/tabpane.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tabpane/tabpane.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tabpane/tabpane.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,368 @@
+/*----------------------------------------------------------------------------\
+|                               Tab Pane 1.02                                 |
+|-----------------------------------------------------------------------------|
+|                         Created by Erik Arvidsson                           |
+|                  (http://webfx.eae.net/contact.html#erik)                   |
+|                      For WebFX (http://webfx.eae.net/)                      |
+|-----------------------------------------------------------------------------|
+|                  Copyright (c) 1998 - 2003 Erik Arvidsson                   |
+|-----------------------------------------------------------------------------|
+| This software is provided "as is", without warranty of any kind, express or |
+| implied, including  but not limited  to the warranties of  merchantability, |
+| fitness for a particular purpose and noninfringement. In no event shall the |
+| authors or  copyright  holders be  liable for any claim,  damages or  other |
+| liability, whether  in an  action of  contract, tort  or otherwise, arising |
+| from,  out of  or in  connection with  the software or  the  use  or  other |
+| dealings in the software.                                                   |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| This  software is  available under the  three different licenses  mentioned |
+| below.  To use this software you must chose, and qualify, for one of those. |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Non-Commercial License          http://webfx.eae.net/license.html |
+| Permits  anyone the right to use the  software in a  non-commercial context |
+| free of charge.                                                             |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Commercial license           http://webfx.eae.net/commercial.html |
+| Permits the  license holder the right to use  the software in a  commercial |
+| context. Such license must be specifically obtained, however it's valid for |
+| any number of  implementations of the licensed software.                    |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| GPL - The GNU General Public License    http://www.gnu.org/licenses/gpl.txt |
+| Permits anyone the right to use and modify the software without limitations |
+| as long as proper  credits are given  and the original  and modified source |
+| code are included. Requires  that the final product, software derivate from |
+| the original  source or any  software  utilizing a GPL  component, such  as |
+| this, is also licensed under the GPL license.                               |
+|-----------------------------------------------------------------------------|
+| 2002-01-?? | First working version                                          |
+| 2002-02-17 | Cleaned up for 1.0 public version                              |
+| 2003-02-18 | Changed from javascript uri for anchors to return false        |
+| 2003-03-03 | Added dispose methods to release IE memory                     |
+|-----------------------------------------------------------------------------|
+| Dependencies: *.css           a css file to define the layout               |
+|-----------------------------------------------------------------------------|
+| Created 2002-01-?? | All changes are in the log above. | Updated 2003-03-03 |
+\----------------------------------------------------------------------------*/
+
+// This function is used to define if the browser supports the needed
+// features
+function hasSupport() {
+
+  if (typeof hasSupport.support != "undefined")
+    return hasSupport.support;
+  
+  var ie55 = /msie 5\.[56789]/i.test( navigator.userAgent );
+  
+  hasSupport.support = ( typeof document.implementation != "undefined" &&
+      document.implementation.hasFeature( "html", "1.0" ) || ie55 )
+      
+  // IE55 has a serious DOM1 bug... Patch it!
+  if ( ie55 ) {
+    document._getElementsByTagName = document.getElementsByTagName;
+    document.getElementsByTagName = function ( sTagName ) {
+      if ( sTagName == "*" )
+        return document.all;
+      else
+        return document._getElementsByTagName( sTagName );
+    };
+  }
+
+  return hasSupport.support;
+}
+
+///////////////////////////////////////////////////////////////////////////////////
+// The constructor for tab panes
+//
+// el : HTMLElement   The html element used to represent the tab pane
+// bUseCookie : Boolean Optional. Default is true. Used to determine whether to us
+//            persistance using cookies or not
+//
+function WebFXTabPane( el, bUseCookie ) {
+  if ( !hasSupport() || el == null ) return;
+  
+  this.element = el;
+  this.element.tabPane = this;
+  this.pages = [];
+  this.selectedIndex = null;
+  this.useCookie = bUseCookie != null ? bUseCookie : true;
+  
+  // add class name tag to class name
+  this.element.className = this.classNameTag + " " + this.element.className;
+  
+  // add tab row
+  this.tabRow = document.createElement( "div" );
+  this.tabRow.className = "tab-row";
+  el.insertBefore( this.tabRow, el.firstChild );
+
+  var tabIndex = 0;
+  if ( this.useCookie ) {
+    tabIndex = Number( WebFXTabPane.getCookie( "webfxtab_" + this.element.id ) );
+    if ( isNaN( tabIndex ) )
+      tabIndex = 0;
+  }
+  this.selectedIndex = tabIndex;
+  
+  // loop through child nodes and add them
+  var cs = el.childNodes;
+  var n;
+  for (var i = 0; i < cs.length; i++) {
+    if (cs[i].nodeType == 1 && cs[i].className == "tab-page") {
+      this.addTabPage( cs[i] );
+    }
+  }
+}
+
+WebFXTabPane.prototype.classNameTag = "dynamic-tab-pane-control";
+
+WebFXTabPane.prototype.setSelectedIndex = function ( n ) {
+  if (this.selectedIndex != n) {
+    if (this.selectedIndex != null && this.pages[ this.selectedIndex ] != null )
+      this.pages[ this.selectedIndex ].hide();
+    this.selectedIndex = n;
+    this.pages[ this.selectedIndex ].show();
+    
+    if ( this.useCookie )
+      WebFXTabPane.setCookie( "webfxtab_" + this.element.id, n ); // session cookie
+  }
+};
+  
+WebFXTabPane.prototype.getSelectedIndex = function () {
+  return this.selectedIndex;
+};
+  
+WebFXTabPane.prototype.addTabPage = function ( oElement ) {
+  if ( !hasSupport() ) return;
+  
+  if ( oElement.tabPage == this ) // already added
+    return oElement.tabPage;
+
+  var n = this.pages.length;
+  var tp = this.pages[n] = new WebFXTabPage( oElement, this, n );
+  tp.tabPane = this;
+  
+  // move the tab out of the box
+  this.tabRow.appendChild( tp.tab );
+      
+  if ( n == this.selectedIndex )
+    tp.show();
+  else
+    tp.hide();
+    
+  return tp;
+};
+  
+WebFXTabPane.prototype.dispose = function () {
+  this.element.tabPane = null;
+  this.element = null;    
+  this.tabRow = null;
+  
+  for (var i = 0; i < this.pages.length; i++) {
+    this.pages[i].dispose();
+    this.pages[i] = null;
+  }
+  this.pages = null;
+};
+
+
+
+// Cookie handling
+WebFXTabPane.setCookie = function ( sName, sValue, nDays ) {
+  var expires = "";
+  if ( nDays ) {
+    var d = new Date();
+    d.setTime( d.getTime() + nDays * 24 * 60 * 60 * 1000 );
+    expires = "; expires=" + d.toGMTString();
+  }
+
+  document.cookie = sName + "=" + sValue + expires + "; path=/";
+};
+
+WebFXTabPane.getCookie = function (sName) {
+  var re = new RegExp( "(\;|^)[^;]*(" + sName + ")\=([^;]*)(;|$)" );
+  var res = re.exec( document.cookie );
+  return res != null ? res[3] : null;
+};
+
+WebFXTabPane.removeCookie = function ( name ) {
+  setCookie( name, "", -1 );
+};
+
+
+
+
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////////
+// The constructor for tab pages. This one should not be used.
+// Use WebFXTabPage.addTabPage instead
+//
+// el : HTMLElement     The html element used to represent the tab pane
+// tabPane : WebFXTabPane The parent tab pane
+// nindex : Number      The index of the page in the parent pane page array
+//
+function WebFXTabPage( el, tabPane, nIndex ) {
+  if ( !hasSupport() || el == null ) return;
+  
+  this.element = el;
+  this.element.tabPage = this;
+  this.index = nIndex;
+  
+  var cs = el.childNodes;
+  for (var i = 0; i < cs.length; i++) {
+    if (cs[i].nodeType == 1 && cs[i].className == "tab") {
+      this.tab = cs[i];
+      break;
+    }
+  }
+  
+  // insert a tag around content to support keyboard navigation
+  
+  
+  var a = document.createElement( "A" );
+  this.aElement = a;
+  a.href = "#";
+  a.onclick = function () { return false; };
+  while ( this.tab.hasChildNodes() )
+    a.appendChild( this.tab.firstChild );
+  this.tab.appendChild( a );
+
+  
+  // hook up events, using DOM0
+  var oThis = this;
+  this.tab.onclick = function () { oThis.select(); };
+  this.tab.onmouseover = function () { WebFXTabPage.tabOver( oThis ); };
+  this.tab.onmouseout = function () { WebFXTabPage.tabOut( oThis ); };
+}
+
+WebFXTabPage.prototype.show = function () {
+  var el = this.tab;
+  var s = el.className + " selected";
+  s = s.replace(/ +/g, " ");
+  el.className = s;
+  
+  this.element.style.display = "block";
+};
+
+WebFXTabPage.prototype.hide = function () {
+  var el = this.tab;
+  var s = el.className;
+  s = s.replace(/ selected/g, "");
+  el.className = s;
+
+  this.element.style.display = "none";
+};
+  
+WebFXTabPage.prototype.select = function () {
+  this.tabPane.setSelectedIndex( this.index );
+};
+  
+WebFXTabPage.prototype.dispose = function () {
+  this.aElement.onclick = null;
+  this.aElement = null;
+  this.element.tabPage = null;
+  this.tab.onclick = null;
+  this.tab.onmouseover = null;
+  this.tab.onmouseout = null;
+  this.tab = null;
+  this.tabPane = null;
+  this.element = null;
+};
+
+WebFXTabPage.tabOver = function ( tabpage ) {
+  var el = tabpage.tab;
+  var s = el.className + " hover";
+  s = s.replace(/ +/g, " ");
+  el.className = s;
+};
+
+WebFXTabPage.tabOut = function ( tabpage ) {
+  var el = tabpage.tab;
+  var s = el.className;
+  s = s.replace(/ hover/g, "");
+  el.className = s;
+};
+
+
+// This function initializes all uninitialized tab panes and tab pages
+function setupAllTabs() {
+  if ( !hasSupport() ) return;
+
+  var all = document.getElementsByTagName( "*" );
+  var l = all.length;
+  var tabPaneRe = /tab\-pane/;
+  var tabPageRe = /tab\-page/;
+  var cn, el;
+  var parentTabPane;
+  
+  for ( var i = 0; i < l; i++ ) {
+    el = all[i]
+    cn = el.className;
+
+    // no className
+    if ( cn == "" ) continue;
+    
+    // uninitiated tab pane
+    if ( tabPaneRe.test( cn ) && !el.tabPane )
+      new WebFXTabPane( el );
+  
+    // unitiated tab page wit a valid tab pane parent
+    else if ( tabPageRe.test( cn ) && !el.tabPage &&
+          tabPaneRe.test( el.parentNode.className ) ) {
+      el.parentNode.tabPane.addTabPage( el );     
+    }
+  }
+}
+
+function disposeAllTabs() {
+  if ( !hasSupport() ) return;
+  
+  var all = document.getElementsByTagName( "*" );
+  var l = all.length;
+  var tabPaneRe = /tab\-pane/;
+  var cn, el;
+  var tabPanes = [];
+  
+  for ( var i = 0; i < l; i++ ) {
+    el = all[i]
+    cn = el.className;
+
+    // no className
+    if ( cn == "" ) continue;
+    
+    // tab pane
+    if ( tabPaneRe.test( cn ) && el.tabPane )
+      tabPanes[tabPanes.length] = el.tabPane;
+  }
+  
+  for (var i = tabPanes.length - 1; i >= 0; i--) {
+    tabPanes[i].dispose();
+    tabPanes[i] = null;
+  }
+}
+
+
+// initialization hook up
+
+// DOM2
+if ( typeof window.addEventListener != "undefined" )
+  window.addEventListener( "load", setupAllTabs, false );
+
+// IE 
+else if ( typeof window.attachEvent != "undefined" ) {
+  window.attachEvent( "onload", setupAllTabs );
+  window.attachEvent( "onunload", disposeAllTabs );
+}
+
+else {
+  if ( window.onload != null ) {
+    var oldOnload = window.onload;
+    window.onload = function ( e ) {
+      oldOnload( e );
+      setupAllTabs();
+    };
+  }
+  else 
+    window.onload = setupAllTabs;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/blank.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/blank.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/blank.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>blank_page</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+</head>
+<body class="mceContentBody">
+
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+bold_desc : 'Bold (Ctrl+B)',
+italic_desc : 'Italic (Ctrl+I)',
+underline_desc : 'Underline (Ctrl+U)',
+striketrough_desc : 'Strikethrough',
+justifyleft_desc : 'Align left',
+justifycenter_desc : 'Align center',
+justifyright_desc : 'Align right',
+justifyfull_desc : 'Align full',
+bullist_desc : 'Unordered list',
+numlist_desc : 'Ordered list',
+outdent_desc : 'Outdent',
+indent_desc : 'Indent',
+undo_desc : 'Undo (Ctrl+Z)',
+redo_desc : 'Redo (Ctrl+Y)',
+link_desc : 'Insert/edit link',
+unlink_desc : 'Unlink',
+image_desc : 'Insert/edit image',
+cleanup_desc : 'Cleanup messy code',
+focus_alert : 'A editor instance must be focused before using this command.',
+edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?',
+insert_link_title : 'Insert/edit link',
+insert : 'Insert',
+update : 'Update',
+cancel : 'Cancel',
+insert_link_url : 'Link URL',
+insert_link_target : 'Target',
+insert_link_target_same : 'Open link in the same window',
+insert_link_target_blank : 'Open link in a new window',
+insert_image_title : 'Insert/edit image',
+insert_image_src : 'Image URL',
+insert_image_alt : 'Image description',
+help_desc : 'Help',
+bold_img : "bold.gif",
+italic_img : "italic.gif",
+underline_img : "underline.gif",
+clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
+popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/langs/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/langs/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/langs/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,7 @@
+Language packs are from version 2.0.5 removed from the core but can be downloadable from the TinyMCE website.
+http://tinymce.moxiecode.com/download.php
+
+The language pack codes are based on ISO-639-1
+http://www.loc.gov/standards/iso639-2/englangn.html
+
+Try using entires if possible. &aring; etc.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/license.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/license.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/license.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,437 @@
+      GNU LIBRARY GENERAL PUBLIC LICENSE
+           Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+          Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+.
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+.
+      GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+.
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+.
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+.
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+.
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+.
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+.
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+          NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+         END OF TERMS AND CONDITIONS

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/css/advimage.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/css/advimage.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/css/advimage.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+/* CSS file for advimage plugin popup */
+
+.mceImageList {
+  width: 280px;
+}
+
+.mceActionPanel {
+  margin-top: 7px;
+}
+
+.alignPreview {
+  border: 1px solid black;
+  width: 140px;
+  height: 140px;
+  overflow: hidden;
+  padding: 5px;
+}
+
+.checkbox {
+  border: 0;
+}
+
+.panel_wrapper div.current {
+  height: 305px;
+}
+
+#prev {
+  margin: 0;
+  border: 1px
+  solid black;
+  width: 99%;
+  height: 150px;
+  overflow: auto;
+}
+
+#align, #classlist {
+  width: 150px;
+}
+
+#width, #height {
+  vertical-align: middle;
+  width: 50px;
+  text-align: center;
+}
+
+#vspace, #hspace, #border {
+  vertical-align: middle;
+  width: 30px;
+  text-align: center;
+}
+
+#classlist {
+  width: 180px;
+}
+
+input {
+  width: 280px;
+}
+
+#constrain, #onmousemovecheck {
+  width: auto;
+}
+
+#id, #dir, #lang, #usemap, #longdesc {
+  width: 200px;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('advimage','en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk,da');var TinyMCE_AdvancedImagePlugin={getInfo:function(){return{longname:'Advanced image',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advimage.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"image":return tinyMCE.getButtonHTML(cn,'lang_image_desc','{$themeurl}/images/image.gif','mceAdvImage');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvImage":var template=new Array();template['file']='../../plugins/advimage/image.htm';template['width']=480;template['height']=380;template['width']+=tinyMCE.getLang('lang_advimage_delta_width',0);template['height']+=tinyMCE.getLang('lang_advimage_delta_height',0);var inst=tinyMCE.getInstanceById(editor_id);var elm=inst.getFocusElement();if(elm!=null&&tinyMCE.getAttrib(elm,'class').indexOf('mceItem')!=-1)return true;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;}return false;},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){if(tinyMCE.getParam('convert_urls'))src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);imgs[i].setAttribute('onmouseover',"this.src='"+src+"';");}if((src=this._getImageSrc(onmouseout))!=""){if(tinyMCE.getParam('convert_urls'))src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);imgs[i].setAttribute('onmouseout',"this.src='"+src+"';");}}break;case"get_from_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('onmouseover',"this.src='"+src+"';");}if((src=this._getImageSrc(onmouseout))!=""){if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('onmouseout',"this.src='"+src+"';");}}break;}return content;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&tinyMCE.getAttrib(node,'class').indexOf('mceItem')==-1){tinyMCE.switchClass(editor_id+'_advimage','mceButtonSelected');return true;}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_advimage','mceButtonNormal');return true;},_getImageSrc:function(s){var sr,p=-1;if(!s)return"";if((p=s.indexOf('this.src='))!=-1){sr=s.substring(p+10);sr=sr.substring(0,sr.indexOf('\''));return sr;}return"";}};tinyMCE.addPlugin("advimage",TinyMCE_AdvancedImagePlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.30 $
+ * $Date: 2006/02/10 16:29:37 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('advimage', 'en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk,da');
+
+var TinyMCE_AdvancedImagePlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Advanced image',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advimage.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  getControlHTML : function(cn) {
+    switch (cn) {
+      case "image":
+        return tinyMCE.getButtonHTML(cn, 'lang_image_desc', '{$themeurl}/images/image.gif', 'mceAdvImage');
+    }
+
+    return "";
+  },
+
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    switch (command) {
+      case "mceAdvImage":
+        var template = new Array();
+
+        template['file']   = '../../plugins/advimage/image.htm';
+        template['width']  = 480;
+        template['height'] = 380;
+
+        // Language specific width and height addons
+        template['width']  += tinyMCE.getLang('lang_advimage_delta_width', 0);
+        template['height'] += tinyMCE.getLang('lang_advimage_delta_height', 0);
+
+        var inst = tinyMCE.getInstanceById(editor_id);
+        var elm = inst.getFocusElement();
+
+        if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1)
+          return true;
+
+        tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+
+        return true;
+    }
+
+    return false;
+  },
+
+  cleanup : function(type, content) {
+    switch (type) {
+      case "insert_to_editor_dom":
+        var imgs = content.getElementsByTagName("img");
+        for (var i=0; i<imgs.length; i++) {
+          var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
+          var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
+
+          if ((src = this._getImageSrc(onmouseover)) != "") {
+            if (tinyMCE.getParam('convert_urls'))
+              src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
+
+            imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
+          }
+
+          if ((src = this._getImageSrc(onmouseout)) != "") {
+            if (tinyMCE.getParam('convert_urls'))
+              src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
+
+            imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
+          }
+        }
+        break;
+
+      case "get_from_editor_dom":
+        var imgs = content.getElementsByTagName("img");
+        for (var i=0; i<imgs.length; i++) {
+          var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
+          var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
+
+          if ((src = this._getImageSrc(onmouseover)) != "") {
+            if (tinyMCE.getParam('convert_urls'))
+              src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
+
+            imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
+          }
+
+          if ((src = this._getImageSrc(onmouseout)) != "") {
+            if (tinyMCE.getParam('convert_urls'))
+              src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
+
+            imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
+          }
+        }
+        break;
+    }
+
+    return content;
+  },
+
+  handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+    if (node == null)
+      return;
+
+    do {
+      if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
+        tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonSelected');
+        return true;
+      }
+    } while ((node = node.parentNode));
+
+    tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonNormal');
+
+    return true;
+  },
+
+  /**
+   * Returns the image src from a scripted mouse over image str.
+   *
+   * @param {string} s String to get real src from.
+   * @return Image src from a scripted mouse over image str.
+   * @type string
+   */
+  _getImageSrc : function(s) {
+    var sr, p = -1;
+
+    if (!s)
+      return "";
+
+    if ((p = s.indexOf('this.src=')) != -1) {
+      sr = s.substring(p + 10);
+      sr = sr.substring(0, sr.indexOf('\''));
+
+      return sr;
+    }
+
+    return "";
+  }
+};
+
+tinyMCE.addPlugin("advimage", TinyMCE_AdvancedImagePlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/image.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/image.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/image.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,240 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_insert_image_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
+  <link href="css/advimage.css" rel="stylesheet" type="text/css" />
+  <base target="_self" />
+</head>
+<body id="advimage" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+    <form onsubmit="insertAction();return false;" action="#"> 
+    <div class="tabs">
+      <ul>
+        <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_advimage_tab_general}</a></span></li>
+        <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{$lang_advimage_tab_appearance}</a></span></li>
+        <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_advimage_tab_advanced}</a></span></li>
+      </ul>
+    </div>
+
+    <div class="panel_wrapper">
+      <div id="general_panel" class="panel current">
+        <fieldset>
+            <legend>{$lang_advimage_general}</legend>
+
+            <table class="properties">
+              <tr>
+                <td class="column1"><label id="srclabel" for="src">{$lang_insert_image_src}</label></td>
+                <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
+                  <tr> 
+                    <td><input name="src" type="text" id="src" value="" onchange="showPreviewImage(this.value);" /></td> 
+                    <td id="srcbrowsercontainer">&nbsp;</td>
+                  </tr>
+                  </table></td>
+              </tr>
+              <tr id="imagelistsrcrow">
+                <td class="column1"><label for="imagelistsrc">{$lang_image_list}</label></td>
+                <td colspan="2" id="imagelistsrccontainer">&nbsp;</td>
+              </tr>
+              <tr> 
+                <td class="column1"><label id="altlabel" for="alt">{$lang_insert_image_alt}</label></td> 
+                <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td> 
+              </tr> 
+              <tr> 
+                <td class="column1"><label id="titlelabel" for="title">{$lang_advimage_title}</label></td> 
+                <td colspan="2"><input id="title" name="title" type="text" value="" /></td> 
+              </tr>
+            </table>
+        </fieldset>
+
+        <fieldset>
+          <legend>{$lang_advimage_preview}</legend>
+          <div id="prev"></div>
+        </fieldset>
+      </div>
+
+      <div id="appearance_panel" class="panel">
+        <fieldset>
+          <legend>{$lang_advimage_tab_appearance}</legend>
+
+          <table border="0" cellpadding="4" cellspacing="0">
+            <tr> 
+              <td class="column1"><label id="alignlabel" for="align">{$lang_insert_image_align}</label></td> 
+              <td><select id="align" name="align" onchange="changeAppearance();"> 
+                  <option value="">{$lang_insert_image_align_default}</option> 
+                  <option value="baseline">{$lang_insert_image_align_baseline}</option> 
+                  <option value="top">{$lang_insert_image_align_top}</option> 
+                  <option value="middle">{$lang_insert_image_align_middle}</option> 
+                  <option value="bottom">{$lang_insert_image_align_bottom}</option> 
+                  <option value="texttop">{$lang_insert_image_align_texttop}</option> 
+                  <option value="absmiddle">{$lang_insert_image_align_absmiddle}</option> 
+                  <option value="absbottom">{$lang_insert_image_align_absbottom}</option> 
+                  <option value="left">{$lang_insert_image_align_left}</option> 
+                  <option value="right">{$lang_insert_image_align_right}</option> 
+                </select> 
+              </td>
+              <td rowspan="6" valign="top">
+                <div class="alignPreview">
+                  <img id="alignSampleImg" src="images/sample.gif" alt="{$lang_advimage_example_img}" />
+                  Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
+                  nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
+                  edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
+                  erat volutpat.
+                </div>
+              </td>
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="widthlabel" for="width">{$lang_insert_image_dimensions}</label></td>
+              <td nowrap="nowrap">
+                <input name="width" type="text" id="width" value="" size="5" maxlength="5" onchange="changeHeight();" /> x 
+                <input name="height" type="text" id="height" value="" size="5" maxlength="5" onchange="changeWidth();" /> px
+              </td>
+            </tr>
+
+            <tr>
+              <td>&nbsp;</td>
+              <td><table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
+                    <td><label id="constrainlabel" for="constrain">{$lang_advimage_constrain_proportions}</label></td>
+                  </tr>
+                </table></td>
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="vspacelabel" for="vspace">{$lang_insert_image_vspace}</label></td> 
+              <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" onchange="changeAppearance();updateStyle();" />
+              </td>
+            </tr>
+
+            <tr> 
+              <td class="column1"><label id="hspacelabel" for="hspace">{$lang_insert_image_hspace}</label></td> 
+              <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" onchange="changeAppearance();updateStyle();" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="borderlabel" for="border">{$lang_insert_image_border}</label></td> 
+              <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changeAppearance();updateStyle();" /></td> 
+            </tr>
+
+            <tr>
+              <td><label id="classlabel" for="classlist">{$lang_class_name}</label></td>
+              <td colspan="2">
+                 <select id="classlist" name="classlist">
+                  <option value="" selected>{$lang_not_set}</option>
+                 </select>
+              </td>
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="stylelabel" for="style">{$lang_advimage_style}</label></td> 
+              <td colspan="2"><input id="style" name="style" type="text" value="" onchange="styleUpdated();" /></td> 
+            </tr>
+
+            <!-- <tr>
+              <td class="column1"><label id="classeslabel" for="classes">{$lang_advimage_classes}</label></td> 
+              <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> 
+            </tr> -->
+          </table>
+        </fieldset>
+      </div>
+
+      <div id="advanced_panel" class="panel">
+        <fieldset>
+          <legend>{$lang_advimage_swap_image}</legend>
+
+          <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="changeMouseMove();" />
+          <label id="onmousemovechecklabel" for="onmousemovecheck">{$lang_advimage_alt_image}</label>
+
+          <table border="0" cellpadding="4" cellspacing="0" width="100%">
+              <tr>
+                <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{$lang_advimage_mouseover}</label></td> 
+                <td><table border="0" cellspacing="0" cellpadding="0"> 
+                  <tr> 
+                    <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td> 
+                    <td id="onmouseoversrccontainer">&nbsp;</td>
+                  </tr>
+                  </table></td>
+              </tr>
+              <tr id="imagelistoverrow">
+                <td class="column1"><label for="imagelistover">{$lang_image_list}</label></td>
+                <td id="imagelistovercontainer">&nbsp;</td>
+              </tr>
+              <tr> 
+                <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{$lang_advimage_mouseout}</label></td> 
+                <td class="column2"><table border="0" cellspacing="0" cellpadding="0"> 
+                  <tr> 
+                    <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td> 
+                    <td id="onmouseoutsrccontainer">&nbsp;</td>
+                  </tr> 
+                  </table></td> 
+              </tr>
+              <tr id="imagelistoutrow">
+                <td class="column1"><label for="imagelistout">{$lang_image_list}</label></td>
+                <td id="imagelistoutcontainer">&nbsp;</td>
+              </tr>
+          </table>
+        </fieldset>
+
+        <fieldset>
+          <legend>{$lang_advimage_misc}</legend>
+
+          <table border="0" cellpadding="4" cellspacing="0">
+            <tr>
+              <td class="column1"><label id="idlabel" for="id">{$lang_advimage_id}</label></td> 
+              <td><input id="id" name="id" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="dirlabel" for="dir">{$lang_advimage_langdir}</label></td> 
+              <td>
+                <select id="dir" name="dir" onchange="changeAppearance();"> 
+                    <option value="">{$lang_not_set}</option> 
+                    <option value="ltr">{$lang_advimage_ltr}</option> 
+                    <option value="rtl">{$lang_advimage_rtl}</option> 
+                </select>
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="langlabel" for="lang">{$lang_advimage_langcode}</label></td> 
+              <td>
+                <input id="lang" name="lang" type="text" value="" />
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="usemaplabel" for="usemap">{$lang_advimage_image_map}</label></td> 
+              <td>
+                <input id="usemap" name="usemap" type="text" value="" />
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="longdesclabel" for="longdesc">{$lang_advimage_long_desc}</label></td>
+              <td><table border="0" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td><input id="longdesc" name="longdesc" type="text" value="" /></td>
+                    <td id="longdesccontainer">&nbsp;</td>
+                  </tr>
+                </table></td> 
+            </tr>
+          </table>
+        </fieldset>
+      </div>
+    </div>
+
+    <div class="mceActionPanel">
+      <div style="float: left">
+        <input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAction();" />
+      </div>
+
+      <div style="float: right">
+        <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="cancelAction();" />
+      </div>
+    </div>
+    </form>
+</body> 
+</html> 

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/images/sample.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/images/sample.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/jscripts/functions.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/jscripts/functions.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/jscripts/functions.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,545 @@
+/* Functions for the advimage plugin popup */
+
+var preloadImg = null;
+var orgImageWidth, orgImageHeight;
+
+function preinit() {
+  // Initialize
+  tinyMCE.setWindowArg('mce_windowresize', false);
+
+  // Import external list url javascript
+  var url = tinyMCE.getParam("external_image_list_url");
+  if (url != null) {
+    // Fix relative
+    if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+      url = tinyMCE.documentBasePath + "/" + url;
+
+    document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+  }
+}
+
+function convertURL(url, node, on_save) {
+  return eval("tinyMCEPopup.windowOpener." + tinyMCE.settings['urlconverter_callback'] + "(url, node, on_save);");
+}
+
+function getImageSrc(str) {
+  var pos = -1;
+
+  if (!str)
+    return "";
+
+  if ((pos = str.indexOf('this.src=')) != -1) {
+    var src = str.substring(pos + 10);
+
+    src = src.substring(0, src.indexOf('\''));
+
+    if (tinyMCE.getParam('convert_urls'))
+      src = convertURL(src, null, true);
+
+    return src;
+  }
+
+  return "";
+}
+
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  var formObj = document.forms[0];
+  var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+  var elm = inst.getFocusElement();
+  var action = "insert";
+  var html = "";
+
+  // Image list src
+  html = getImageListHTML('imagelistsrc','src','onSelectMainImage');
+  if (html == "")
+    document.getElementById("imagelistsrcrow").style.display = 'none';
+  else
+    document.getElementById("imagelistsrccontainer").innerHTML = html;
+
+  // Image list oversrc
+  html = getImageListHTML('imagelistover','onmouseoversrc');
+  if (html == "")
+    document.getElementById("imagelistoverrow").style.display = 'none';
+  else
+    document.getElementById("imagelistovercontainer").innerHTML = html;
+
+  // Image list outsrc
+  html = getImageListHTML('imagelistout','onmouseoutsrc');
+  if (html == "")
+    document.getElementById("imagelistoutrow").style.display = 'none';
+  else
+    document.getElementById("imagelistoutcontainer").innerHTML = html;
+
+  // Src browser
+  html = getBrowserHTML('srcbrowser','src','image','advimage');
+  document.getElementById("srcbrowsercontainer").innerHTML = html;
+
+  // Over browser
+  html = getBrowserHTML('oversrcbrowser','onmouseoversrc','image','advimage');
+  document.getElementById("onmouseoversrccontainer").innerHTML = html;
+
+  // Out browser
+  html = getBrowserHTML('outsrcbrowser','onmouseoutsrc','image','advimage');
+  document.getElementById("onmouseoutsrccontainer").innerHTML = html;
+
+  // Longdesc browser
+  html = getBrowserHTML('longdescbrowser','longdesc','file','advimage');
+  document.getElementById("longdesccontainer").innerHTML = html;
+
+  // Resize some elements
+  if (isVisible('srcbrowser'))
+    document.getElementById('src').style.width = '260px';
+
+  if (isVisible('oversrcbrowser'))
+    document.getElementById('onmouseoversrc').style.width = '260px';
+
+  if (isVisible('outsrcbrowser'))
+    document.getElementById('onmouseoutsrc').style.width = '260px';
+
+  if (isVisible('longdescbrowser'))
+    document.getElementById('longdesc').style.width = '180px';
+
+  // Check action
+  if (elm != null && elm.nodeName == "IMG")
+    action = "update";
+
+  formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); 
+
+  if (action == "update") {
+    var src = tinyMCE.getAttrib(elm, 'src');
+    var onmouseoversrc = getImageSrc(tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseover')));
+    var onmouseoutsrc = getImageSrc(tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseout')));
+
+    src = convertURL(src, elm, true);
+
+    // Use mce_src if found
+    var mceRealSrc = tinyMCE.getAttrib(elm, 'mce_src');
+    if (mceRealSrc != "") {
+      src = mceRealSrc;
+
+      if (tinyMCE.getParam('convert_urls'))
+        src = convertURL(src, elm, true);
+    }
+
+    if (onmouseoversrc != "" && tinyMCE.getParam('convert_urls'))
+      onmouseoversrc = convertURL(onmouseoversrc, elm, true);
+
+    if (onmouseoutsrc != "" && tinyMCE.getParam('convert_urls'))
+      onmouseoutsrc = convertURL(onmouseoutsrc, elm, true);
+
+    // Setup form data
+    var style = tinyMCE.parseStyle(tinyMCE.getAttrib(elm, "style"));
+
+    // Store away old size
+    orgImageWidth = trimSize(getStyle(elm, 'width'))
+    orgImageHeight = trimSize(getStyle(elm, 'height'));
+
+    formObj.src.value    = src;
+    formObj.alt.value    = tinyMCE.getAttrib(elm, 'alt');
+    formObj.title.value  = tinyMCE.getAttrib(elm, 'title');
+    formObj.border.value = trimSize(getStyle(elm, 'border', 'borderWidth'));
+    formObj.vspace.value = tinyMCE.getAttrib(elm, 'vspace');
+    formObj.hspace.value = tinyMCE.getAttrib(elm, 'hspace');
+    formObj.width.value  = orgImageWidth;
+    formObj.height.value = orgImageHeight;
+    formObj.onmouseoversrc.value = onmouseoversrc;
+    formObj.onmouseoutsrc.value  = onmouseoutsrc;
+    formObj.id.value  = tinyMCE.getAttrib(elm, 'id');
+    formObj.dir.value  = tinyMCE.getAttrib(elm, 'dir');
+    formObj.lang.value  = tinyMCE.getAttrib(elm, 'lang');
+    formObj.longdesc.value  = tinyMCE.getAttrib(elm, 'longdesc');
+    formObj.usemap.value  = tinyMCE.getAttrib(elm, 'usemap');
+    formObj.style.value  = tinyMCE.serializeStyle(style);
+
+    // Select by the values
+    if (tinyMCE.isMSIE)
+      selectByValue(formObj, 'align', getStyle(elm, 'align', 'styleFloat'));
+    else
+      selectByValue(formObj, 'align', getStyle(elm, 'align', 'cssFloat'));
+
+    addClassesToList('classlist', 'advimage_styles');
+
+    selectByValue(formObj, 'classlist', tinyMCE.getAttrib(elm, 'class'));
+    selectByValue(formObj, 'imagelistsrc', src);
+    selectByValue(formObj, 'imagelistover', onmouseoversrc);
+    selectByValue(formObj, 'imagelistout', onmouseoutsrc);
+
+    updateStyle();
+    showPreviewImage(src, true);
+    changeAppearance();
+
+    window.focus();
+  } else
+    addClassesToList('classlist', 'advimage_styles');
+
+  // If option enabled default contrain proportions to checked
+  if (tinyMCE.getParam("advimage_constrain_proportions", true))
+    formObj.constrain.checked = true;
+
+  // Check swap image if valid data
+  if (formObj.onmouseoversrc.value != "" || formObj.onmouseoutsrc.value != "")
+    setSwapImageDisabled(false);
+  else
+    setSwapImageDisabled(true);
+}
+
+function setSwapImageDisabled(state) {
+  var formObj = document.forms[0];
+
+  formObj.onmousemovecheck.checked = !state;
+
+  setBrowserDisabled('overbrowser', state);
+  setBrowserDisabled('outbrowser', state);
+
+  if (formObj.imagelistover)
+    formObj.imagelistover.disabled = state;
+
+  if (formObj.imagelistout)
+    formObj.imagelistout.disabled = state;
+
+  formObj.onmouseoversrc.disabled = state;
+  formObj.onmouseoutsrc.disabled  = state;
+}
+
+function setAttrib(elm, attrib, value) {
+  var formObj = document.forms[0];
+  var valueElm = formObj.elements[attrib];
+
+  if (typeof(value) == "undefined" || value == null) {
+    value = "";
+
+    if (valueElm)
+      value = valueElm.value;
+  }
+
+  if (value != "") {
+    elm.setAttribute(attrib, value);
+
+    if (attrib == "style")
+      attrib = "style.cssText";
+
+    if (attrib == "longdesc")
+      attrib = "longDesc";
+
+    if (attrib == "width") {
+      attrib = "style.width";
+      value = value + "px";
+    }
+
+    if (attrib == "height") {
+      attrib = "style.height";
+      value = value + "px";
+    }
+
+    if (attrib == "class")
+      attrib = "className";
+
+    eval('elm.' + attrib + "=value;");
+  } else
+    elm.removeAttribute(attrib);
+}
+
+function makeAttrib(attrib, value) {
+  var formObj = document.forms[0];
+  var valueElm = formObj.elements[attrib];
+
+  if (typeof(value) == "undefined" || value == null) {
+    value = "";
+
+    if (valueElm)
+      value = valueElm.value;
+  }
+
+  if (value == "")
+    return "";
+
+  // XML encode it
+  value = value.replace(/&/g, '&amp;');
+  value = value.replace(/\"/g, '&quot;');
+  value = value.replace(/</g, '&lt;');
+  value = value.replace(/>/g, '&gt;');
+
+  return ' ' + attrib + '="' + value + '"';
+}
+
+function insertAction() {
+  var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+  var elm = inst.getFocusElement();
+  var formObj = document.forms[0];
+  var src = formObj.src.value;
+  var onmouseoversrc = formObj.onmouseoversrc.value;
+  var onmouseoutsrc = formObj.onmouseoutsrc.value;
+
+  if (tinyMCE.getParam("accessibility_warnings")) {
+    if (formObj.alt.value == "") {
+      var answer = confirm(tinyMCE.getLang('lang_advimage_missing_alt', '', true));
+      if (answer == true) {
+        formObj.alt.value = " ";
+      }
+    } else {
+      var answer = true;
+    }
+
+    if (!answer)
+      return;
+  }
+
+  if (onmouseoversrc && onmouseoversrc != "")
+    onmouseoversrc = "this.src='" + convertURL(onmouseoversrc, tinyMCE.imgElement) + "';";
+
+  if (onmouseoutsrc && onmouseoutsrc != "")
+    onmouseoutsrc = "this.src='" + convertURL(onmouseoutsrc, tinyMCE.imgElement) + "';";
+
+  if (elm != null && elm.nodeName == "IMG") {
+    setAttrib(elm, 'src', convertURL(src, tinyMCE.imgElement));
+    setAttrib(elm, 'mce_src', src);
+    setAttrib(elm, 'alt');
+    setAttrib(elm, 'title');
+    setAttrib(elm, 'border');
+    setAttrib(elm, 'vspace');
+    setAttrib(elm, 'hspace');
+    setAttrib(elm, 'width');
+    setAttrib(elm, 'height');
+    setAttrib(elm, 'onmouseover', onmouseoversrc);
+    setAttrib(elm, 'onmouseout', onmouseoutsrc);
+    setAttrib(elm, 'id');
+    setAttrib(elm, 'dir');
+    setAttrib(elm, 'lang');
+    setAttrib(elm, 'longdesc');
+    setAttrib(elm, 'usemap');
+    setAttrib(elm, 'style');
+    setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
+    setAttrib(elm, 'align', getSelectValue(formObj, 'align'));
+
+    //tinyMCEPopup.execCommand("mceRepaint");
+
+    // Repaint if dimensions changed
+    if (formObj.width.value != orgImageWidth || formObj.height.value != orgImageHeight)
+      inst.repaint();
+
+    // Refresh in old MSIE
+    if (tinyMCE.isMSIE5)
+      elm.outerHTML = elm.outerHTML;
+  } else {
+    var html = "<img";
+
+    html += makeAttrib('src', convertURL(src, tinyMCE.imgElement));
+    html += makeAttrib('mce_src', src);
+    html += makeAttrib('alt');
+    html += makeAttrib('title');
+    html += makeAttrib('border');
+    html += makeAttrib('vspace');
+    html += makeAttrib('hspace');
+    html += makeAttrib('width');
+    html += makeAttrib('height');
+    html += makeAttrib('onmouseover', onmouseoversrc);
+    html += makeAttrib('onmouseout', onmouseoutsrc);
+    html += makeAttrib('id');
+    html += makeAttrib('dir');
+    html += makeAttrib('lang');
+    html += makeAttrib('longdesc');
+    html += makeAttrib('usemap');
+    html += makeAttrib('style');
+    html += makeAttrib('class', getSelectValue(formObj, 'classlist'));
+    html += makeAttrib('align', getSelectValue(formObj, 'align'));
+    html += " />";
+
+    tinyMCEPopup.execCommand("mceInsertContent", false, html);
+  }
+
+  tinyMCE._setEventsEnabled(inst.getBody(), false);
+  tinyMCEPopup.close();
+}
+
+function cancelAction() {
+  tinyMCEPopup.close();
+}
+
+function changeAppearance() {
+  var formObj = document.forms[0];
+  var img = document.getElementById('alignSampleImg');
+
+  if (img) {
+    img.align = formObj.align.value;
+    img.border = formObj.border.value;
+    img.hspace = formObj.hspace.value;
+    img.vspace = formObj.vspace.value;
+  }
+}
+
+function changeMouseMove() {
+  var formObj = document.forms[0];
+
+  setSwapImageDisabled(!formObj.onmousemovecheck.checked);
+}
+
+function updateStyle() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  if (tinyMCE.getParam('inline_styles', false)) {
+    st['width'] = formObj.width.value == '' ? '' : formObj.width.value + "px";
+    st['height'] = formObj.height.value == '' ? '' : formObj.height.value + "px";
+    st['border-width'] = formObj.border.value == '' ? '' : formObj.border.value + "px";
+    st['margin-top'] = formObj.vspace.value == '' ? '' : formObj.vspace.value + "px";
+    st['margin-bottom'] = formObj.vspace.value == '' ? '' : formObj.vspace.value + "px";
+    st['margin-left'] = formObj.hspace.value == '' ? '' : formObj.hspace.value + "px";
+    st['margin-right'] = formObj.hspace.value == '' ? '' : formObj.hspace.value + "px";
+  } else {
+    st['width'] = st['height'] = st['border-width'] = null;
+
+    if (st['margin-top'] == st['margin-bottom'])
+      st['margin-top'] = st['margin-bottom'] = null;
+
+    if (st['margin-left'] == st['margin-right'])
+      st['margin-left'] = st['margin-right'] = null;
+  }
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function styleUpdated() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  if (st['width'])
+    formObj.width.value = st['width'].replace('px', '');
+
+  if (st['height'])
+    formObj.height.value = st['height'].replace('px', '');
+
+  if (st['margin-top'] && st['margin-top'] == st['margin-bottom'])
+    formObj.vspace.value = st['margin-top'].replace('px', '');
+
+  if (st['margin-left'] && st['margin-left'] == st['margin-right'])
+    formObj.hspace.value = st['margin-left'].replace('px', '');
+
+  if (st['border-width'])
+    formObj.border.value = st['border-width'].replace('px', '');
+}
+
+function changeHeight() {
+  var formObj = document.forms[0];
+
+  if (!formObj.constrain.checked || !preloadImg) {
+    updateStyle();
+    return;
+  }
+
+  if (formObj.width.value == "" || formObj.height.value == "")
+    return;
+
+  var temp = (formObj.width.value / preloadImg.width) * preloadImg.height;
+  formObj.height.value = temp.toFixed(0);
+  updateStyle();
+}
+
+function changeWidth() {
+  var formObj = document.forms[0];
+
+  if (!formObj.constrain.checked || !preloadImg) {
+    updateStyle();
+    return;
+  }
+
+  if (formObj.width.value == "" || formObj.height.value == "")
+    return;
+
+  var temp = (formObj.height.value / preloadImg.height) * preloadImg.width;
+  formObj.width.value = temp.toFixed(0);
+  updateStyle();
+}
+
+function onSelectMainImage(target_form_element, name, value) {
+  var formObj = document.forms[0];
+
+  formObj.alt.value = name;
+  formObj.title.value = name;
+
+  resetImageData();
+  showPreviewImage(formObj.elements[target_form_element].value, false);
+}
+
+function showPreviewImage(src, start) {
+  var formObj = document.forms[0];
+
+  selectByValue(document.forms[0], 'imagelistsrc', src);
+
+  var elm = document.getElementById('prev');
+  var src = src == "" ? src : tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
+
+  if (!start && tinyMCE.getParam("advimage_update_dimensions_onchange", true))
+    resetImageData();
+
+  if (src == "")
+    elm.innerHTML = "";
+  else
+    elm.innerHTML = '<img src="' + src + '" border="0" />'
+
+  getImageData(src);
+}
+
+function getImageData(src) {
+  preloadImg = new Image();
+
+  tinyMCE.addEvent(preloadImg, "load", updateImageData);
+  tinyMCE.addEvent(preloadImg, "error", resetImageData);
+
+  preloadImg.src = src;
+}
+
+function updateImageData() {
+  var formObj = document.forms[0];
+
+  if (formObj.width.value == "")
+    formObj.width.value = preloadImg.width;
+
+  if (formObj.height.value == "")
+    formObj.height.value = preloadImg.height;
+
+  updateStyle();
+}
+
+function resetImageData() {
+  var formObj = document.forms[0];
+  formObj.width.value = formObj.height.value = "";  
+}
+
+function getSelectValue(form_obj, field_name) {
+  var elm = form_obj.elements[field_name];
+
+  if (elm == null || elm.options == null)
+    return "";
+
+  return elm.options[elm.selectedIndex].value;
+}
+
+function getImageListHTML(elm_id, target_form_element, onchange_func) {
+  if (typeof(tinyMCEImageList) == "undefined" || tinyMCEImageList.length == 0)
+    return "";
+
+  var html = "";
+
+  html += '<select id="' + elm_id + '" name="' + elm_id + '"';
+  html += ' class="mceImageList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
+  html += 'this.options[this.selectedIndex].value;';
+
+  if (typeof(onchange_func) != "undefined")
+    html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
+
+  html += '"><option value="">---</option>';
+
+  for (var i=0; i<tinyMCEImageList.length; i++)
+    html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
+
+  html += '</select>';
+
+  return html;
+
+  // tinyMCE.debug('-- image list start --', html, '-- image list end --');
+}
+
+// While loading
+preinit();

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+// UK lang variables
+
+tinyMCE.addToLang('advimage',{
+tab_general : 'General',
+tab_appearance : 'Appearance',
+tab_advanced : 'Advanced',
+general : 'General',
+title : 'Title',
+preview : 'Preview',
+constrain_proportions : 'Constrain proportions',
+langdir : 'Language direction',
+langcode : 'Language code',
+long_desc : 'Long description link',
+style : 'Style',
+classes : 'Classes',
+ltr : 'Left to right',
+rtl : 'Right to left',
+id : 'Id',
+image_map : 'Image map',
+swap_image : 'Swap image',
+alt_image : 'Alternative image',
+mouseover : 'for mouse over',
+mouseout : 'for mouse out',
+misc : 'Miscellaneous',
+example_img : 'Appearance&nbsp;preview&nbsp;image',
+missing_alt : 'Are you sure you want to continue without including an Image Description? Without  it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advimage/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/css/advlink.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/css/advlink.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/css/advlink.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+/* CSS file for advimage plugin popup */
+
+.mceLinkList, .mceAnchorList, #targetlist {
+  width: 280px;
+}
+
+.mceActionPanel {
+  margin-top: 7px;
+}
+
+.panel_wrapper div.current {
+  height: 320px;
+}
+
+#classlist, #title, #href {
+  width: 280px;
+}
+
+#popupurl, #popupname {
+  width: 200px;
+}
+
+#popupwidth, #popupheight, #popupleft, #popuptop {
+  width: 30px;
+  vertical-align: middle;
+  text-align: center;
+}
+
+#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {
+  width: 200px;
+}
+
+#events_panel input {
+  width: 200px;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('advlink','en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk,da');var TinyMCE_AdvancedLinkPlugin={getInfo:function(){return{longname:'Advanced link',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advlink.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){inst.addShortcut('ctrl','k','lang_advlink_desc','mceAdvLink');},getControlHTML:function(cn){switch(cn){case"link":return tinyMCE.getButtonHTML(cn,'lang_link_desc','{$themeurl}/images/link.gif','mceAdvLink');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvLink":var anySelection=false;var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var selectedText=inst.selection.getSelectedText();if(tinyMCE.selectedElement)anySelection=(tinyMCE.selectedElement.nodeName.toLowerCase()=="img")||(selectedText&&selectedText.length>0);if(anySelection||(focusElm!=null&&focusElm.nodeName=="A")){var template=new Array();template['file']='../../plugins/advlink/link.htm';template['width']=480;template['height']=400;template['width']+=tinyMCE.getLang('lang_advlink_delta_width',0);template['height']+=tinyMCE.getLang('lang_advlink_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="A"&&tinyMCE.getAttrib(node,'href')!=""){tinyMCE.switchClass(editor_id+'_advlink','mceButtonSelected');return true;}}while((node=node.parentNode));if(any_selection){tinyMCE.switchClass(editor_id+'_advlink','mceButtonNormal');return true;}tinyMCE.switchClass(editor_id+'_advlink','mceButtonDisabled');return true;}};tinyMCE.addPlugin("advlink",TinyMCE_AdvancedLinkPlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,90 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.24 $
+ * $Date: 2006/02/10 16:29:38 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('advlink', 'en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk,da');
+
+var TinyMCE_AdvancedLinkPlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Advanced link',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advlink.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  initInstance : function(inst) {
+    inst.addShortcut('ctrl', 'k', 'lang_advlink_desc', 'mceAdvLink');
+  },
+
+  getControlHTML : function(cn) {
+    switch (cn) {
+      case "link":
+        return tinyMCE.getButtonHTML(cn, 'lang_link_desc', '{$themeurl}/images/link.gif', 'mceAdvLink');
+    }
+
+    return "";
+  },
+
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    switch (command) {
+      case "mceAdvLink":
+        var anySelection = false;
+        var inst = tinyMCE.getInstanceById(editor_id);
+        var focusElm = inst.getFocusElement();
+        var selectedText = inst.selection.getSelectedText();
+
+        if (tinyMCE.selectedElement)
+          anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);
+
+        if (anySelection || (focusElm != null && focusElm.nodeName == "A")) {
+          var template = new Array();
+
+          template['file']   = '../../plugins/advlink/link.htm';
+          template['width']  = 480;
+          template['height'] = 400;
+
+          // Language specific width and height addons
+          template['width']  += tinyMCE.getLang('lang_advlink_delta_width', 0);
+          template['height'] += tinyMCE.getLang('lang_advlink_delta_height', 0);
+
+          tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+        }
+
+        return true;
+    }
+
+    return false;
+  },
+
+  handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+    if (node == null)
+      return;
+
+    do {
+      if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "") {
+        tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonSelected');
+        return true;
+      }
+    } while ((node = node.parentNode));
+
+    if (any_selection) {
+      tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonNormal');
+      return true;
+    }
+
+    tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonDisabled');
+
+    return true;
+  }
+};
+
+tinyMCE.addPlugin("advlink", TinyMCE_AdvancedLinkPlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/jscripts/functions.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/jscripts/functions.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/jscripts/functions.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,568 @@
+/* Functions for the advlink plugin popup */
+
+var templates = {
+  "window.open" : "window.open('${url}','${target}','${options}')"
+};
+
+function preinit() {
+  // Initialize
+  tinyMCE.setWindowArg('mce_windowresize', false);
+
+  // Import external list url javascript
+  var url = tinyMCE.getParam("external_link_list_url");
+  if (url != null) {
+    // Fix relative
+    if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+      url = tinyMCE.documentBasePath + "/" + url;
+
+    document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+  }
+}
+
+function changeClass() {
+  var formObj = document.forms[0];
+  formObj.classes.value = getSelectValue(formObj, 'classlist');
+}
+
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  var formObj = document.forms[0];
+  var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+  var elm = inst.getFocusElement();
+  var action = "insert";
+  var html;
+
+  document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
+  document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
+  document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
+  document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
+  document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
+
+  // Link list
+  html = getLinkListHTML('linklisthref','href');
+  if (html == "")
+    document.getElementById("linklisthrefrow").style.display = 'none';
+  else
+    document.getElementById("linklisthrefcontainer").innerHTML = html;
+
+  // Resize some elements
+  if (isVisible('hrefbrowser'))
+    document.getElementById('href').style.width = '260px';
+
+  if (isVisible('popupurlbrowser'))
+    document.getElementById('popupurl').style.width = '180px';
+
+  elm = tinyMCE.getParentElement(elm, "a");
+  if (elm != null && elm.nodeName == "A")
+    action = "update";
+
+  formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); 
+
+  setPopupControlsDisabled(true);
+
+  if (action == "update") {
+    var href = tinyMCE.getAttrib(elm, 'href');
+
+    href = convertURL(href, elm, true);
+
+    // Use mce_href if found
+    var mceRealHref = tinyMCE.getAttrib(elm, 'mce_href');
+    if (mceRealHref != "") {
+      href = mceRealHref;
+
+      if (tinyMCE.getParam('convert_urls'))
+        href = convertURL(href, elm, true);
+    }
+
+    var onclick = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onclick'));
+
+    // Setup form data
+    setFormValue('href', href);
+    setFormValue('title', tinyMCE.getAttrib(elm, 'title'));
+    setFormValue('id', tinyMCE.getAttrib(elm, 'id'));
+    setFormValue('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(tinyMCE.getAttrib(elm, "style"))));
+    setFormValue('rel', tinyMCE.getAttrib(elm, 'rel'));
+    setFormValue('rev', tinyMCE.getAttrib(elm, 'rev'));
+    setFormValue('charset', tinyMCE.getAttrib(elm, 'charset'));
+    setFormValue('hreflang', tinyMCE.getAttrib(elm, 'hreflang'));
+    setFormValue('dir', tinyMCE.getAttrib(elm, 'dir'));
+    setFormValue('lang', tinyMCE.getAttrib(elm, 'lang'));
+    setFormValue('tabindex', tinyMCE.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
+    setFormValue('accesskey', tinyMCE.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
+    setFormValue('type', tinyMCE.getAttrib(elm, 'type'));
+    setFormValue('onfocus', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onfocus')));
+    setFormValue('onblur', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onblur')));
+    setFormValue('onclick', onclick);
+    setFormValue('ondblclick', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'ondblclick')));
+    setFormValue('onmousedown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousedown')));
+    setFormValue('onmouseup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseup')));
+    setFormValue('onmouseover', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseover')));
+    setFormValue('onmousemove', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousemove')));
+    setFormValue('onmouseout', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseout')));
+    setFormValue('onkeypress', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeypress')));
+    setFormValue('onkeydown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeydown')));
+    setFormValue('onkeyup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeyup')));
+    setFormValue('target', tinyMCE.getAttrib(elm, 'target'));
+    setFormValue('classes', tinyMCE.getAttrib(elm, 'class'));
+
+    // Parse onclick data
+    if (onclick != null && onclick.indexOf('window.open') != -1)
+      parseWindowOpen(onclick);
+    else
+      parseFunction(onclick);
+
+    // Select by the values
+    selectByValue(formObj, 'dir', tinyMCE.getAttrib(elm, 'dir'));
+    selectByValue(formObj, 'rel', tinyMCE.getAttrib(elm, 'rel'));
+    selectByValue(formObj, 'rev', tinyMCE.getAttrib(elm, 'rev'));
+    selectByValue(formObj, 'linklisthref', href);
+
+    if (href.charAt(0) == '#')
+      selectByValue(formObj, 'anchorlist', href);
+
+    addClassesToList('classlist', 'advlink_styles');
+
+    selectByValue(formObj, 'classlist', tinyMCE.getAttrib(elm, 'class'), true);
+    selectByValue(formObj, 'targetlist', tinyMCE.getAttrib(elm, 'target'), true);
+  } else
+    addClassesToList('classlist', 'advlink_styles');
+
+  window.focus();
+}
+
+function setFormValue(name, value) {
+  document.forms[0].elements[name].value = value;
+}
+
+function convertURL(url, node, on_save) {
+  return eval("tinyMCEPopup.windowOpener." + tinyMCE.settings['urlconverter_callback'] + "(url, node, on_save);");
+}
+
+function parseWindowOpen(onclick) {
+  var formObj = document.forms[0];
+
+  // Preprocess center code
+  if (onclick.indexOf('return false;') != -1) {
+    formObj.popupreturn.checked = true;
+    onclick = onclick.replace('return false;', '');
+  } else
+    formObj.popupreturn.checked = false;
+
+  var onClickData = parseLink(onclick);
+
+  if (onClickData != null) {
+    formObj.ispopup.checked = true;
+    setPopupControlsDisabled(false);
+
+    var onClickWindowOptions = parseOptions(onClickData['options']);
+    var url = onClickData['url'];
+
+    if (tinyMCE.getParam('convert_urls'))
+      url = convertURL(url, null, true);
+
+    formObj.popupname.value = onClickData['target'];
+    formObj.popupurl.value = url;
+    formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
+    formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
+
+    formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
+    formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
+
+    if (formObj.popupleft.value.indexOf('screen') != -1)
+      formObj.popupleft.value = "c";
+
+    if (formObj.popuptop.value.indexOf('screen') != -1)
+      formObj.popuptop.value = "c";
+
+    formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
+    formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
+    formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
+    formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
+    formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
+    formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
+    formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
+
+    buildOnClick();
+  }
+}
+
+function parseFunction(onclick) {
+  var formObj = document.forms[0];
+  var onClickData = parseLink(onclick);
+
+  // TODO: Add stuff here
+}
+
+function getOption(opts, name) {
+  return typeof(opts[name]) == "undefined" ? "" : opts[name];
+}
+
+function setPopupControlsDisabled(state) {
+  var formObj = document.forms[0];
+
+  formObj.popupname.disabled = state;
+  formObj.popupurl.disabled = state;
+  formObj.popupwidth.disabled = state;
+  formObj.popupheight.disabled = state;
+  formObj.popupleft.disabled = state;
+  formObj.popuptop.disabled = state;
+  formObj.popuplocation.disabled = state;
+  formObj.popupscrollbars.disabled = state;
+  formObj.popupmenubar.disabled = state;
+  formObj.popupresizable.disabled = state;
+  formObj.popuptoolbar.disabled = state;
+  formObj.popupstatus.disabled = state;
+  formObj.popupreturn.disabled = state;
+  formObj.popupdependent.disabled = state;
+
+  setBrowserDisabled('popupurlbrowser', state);
+}
+
+function parseLink(link) {
+  link = link.replace(new RegExp('&#39;', 'g'), "'");
+
+  var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
+
+  // Is function name a template function
+  var template = templates[fnName];
+  if (template) {
+    // Build regexp
+    var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
+    var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
+    var replaceStr = "";
+    for (var i=0; i<variableNames.length; i++) {
+      // Is string value
+      if (variableNames[i].indexOf("'${") != -1)
+        regExp += "'(.*)'";
+      else // Number value
+        regExp += "([0-9]*)";
+
+      replaceStr += "$" + (i+1);
+
+      // Cleanup variable name
+      variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
+
+      if (i != variableNames.length-1) {
+        regExp += "\\s*,\\s*";
+        replaceStr += "<delim>";
+      } else
+        regExp += ".*";
+    }
+
+    regExp += "\\);?";
+
+    // Build variable array
+    var variables = new Array();
+    variables["_function"] = fnName;
+    var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
+    for (var i=0; i<variableNames.length; i++)
+      variables[variableNames[i]] = variableValues[i];
+
+    return variables;
+  }
+
+  return null;
+}
+
+function parseOptions(opts) {
+  if (opts == null || opts == "")
+    return new Array();
+
+  // Cleanup the options
+  opts = opts.toLowerCase();
+  opts = opts.replace(/;/g, ",");
+  opts = opts.replace(/[^0-9a-z=,]/g, "");
+
+  var optionChunks = opts.split(',');
+  var options = new Array();
+
+  for (var i=0; i<optionChunks.length; i++) {
+    var parts = optionChunks[i].split('=');
+
+    if (parts.length == 2)
+      options[parts[0]] = parts[1];
+  }
+
+  return options;
+}
+
+function buildOnClick() {
+  var formObj = document.forms[0];
+
+  if (!formObj.ispopup.checked) {
+    formObj.onclick.value = "";
+    return;
+  }
+
+  var onclick = "window.open('";
+  var url = formObj.popupurl.value;
+
+  if (tinyMCE.getParam('convert_urls'))
+    url = convertURL(url, null, true);
+
+  onclick += url + "','";
+  onclick += formObj.popupname.value + "','";
+
+  if (formObj.popuplocation.checked)
+    onclick += "location=yes,";
+
+  if (formObj.popupscrollbars.checked)
+    onclick += "scrollbars=yes,";
+
+  if (formObj.popupmenubar.checked)
+    onclick += "menubar=yes,";
+
+  if (formObj.popupresizable.checked)
+    onclick += "resizable=yes,";
+
+  if (formObj.popuptoolbar.checked)
+    onclick += "toolbar=yes,";
+
+  if (formObj.popupstatus.checked)
+    onclick += "status=yes,";
+
+  if (formObj.popupdependent.checked)
+    onclick += "dependent=yes,";
+
+  if (formObj.popupwidth.value != "")
+    onclick += "width=" + formObj.popupwidth.value + ",";
+
+  if (formObj.popupheight.value != "")
+    onclick += "height=" + formObj.popupheight.value + ",";
+
+  if (formObj.popupleft.value != "") {
+    if (formObj.popupleft.value != "c")
+      onclick += "left=" + formObj.popupleft.value + ",";
+    else
+      onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
+  }
+
+  if (formObj.popuptop.value != "") {
+    if (formObj.popuptop.value != "c")
+      onclick += "top=" + formObj.popuptop.value + ",";
+    else
+      onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
+  }
+
+  if (onclick.charAt(onclick.length-1) == ',')
+    onclick = onclick.substring(0, onclick.length-1);
+
+  onclick += "');";
+
+  if (formObj.popupreturn.checked)
+    onclick += "return false;";
+
+  // tinyMCE.debug(onclick);
+
+  formObj.onclick.value = onclick;
+
+  if (formObj.href.value == "")
+    formObj.href.value = url;
+}
+
+function setAttrib(elm, attrib, value) {
+  var formObj = document.forms[0];
+  var valueElm = formObj.elements[attrib.toLowerCase()];
+
+  if (typeof(value) == "undefined" || value == null) {
+    value = "";
+
+    if (valueElm)
+      value = valueElm.value;
+  }
+
+  if (value != "") {
+    elm.setAttribute(attrib.toLowerCase(), value);
+
+    if (attrib == "style")
+      attrib = "style.cssText";
+
+    if (attrib.substring(0, 2) == 'on')
+      value = 'return true;' + value;
+
+    if (attrib == "class")
+      attrib = "className";
+
+    eval('elm.' + attrib + "=value;");
+  } else
+    elm.removeAttribute(attrib);
+}
+
+function getAnchorListHTML(id, target) {
+  var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+  var nodes = inst.getBody().getElementsByTagName("a");
+
+  var html = "";
+
+  html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';
+  html += 'this.options[this.selectedIndex].value;">';
+  html += '<option value="">---</option>';
+
+  for (var i=0; i<nodes.length; i++) {
+    if ((name = tinyMCE.getAttrib(nodes[i], "name")) != "")
+      html += '<option value="#' + name + '">' + name + '</option>';
+  }
+
+  html += '</select>';
+
+  return html;
+}
+
+function insertAction() {
+  var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+  var elm = inst.getFocusElement();
+
+  elm = tinyMCE.getParentElement(elm, "a");
+
+  tinyMCEPopup.execCommand("mceBeginUndoLevel");
+
+  // Create new anchor elements
+  if (elm == null) {
+    if (tinyMCE.isSafari)
+      tinyMCEPopup.execCommand("mceInsertContent", false, '<a href="#mce_temp_url#">' + inst.selection.getSelectedHTML() + '</a>');
+    else
+      tinyMCEPopup.execCommand("createlink", false, "#mce_temp_url#");
+
+    var elementArray = tinyMCE.getElementsByAttributeValue(inst.getBody(), "a", "href", "#mce_temp_url#");
+    for (var i=0; i<elementArray.length; i++) {
+      var elm = elementArray[i];
+
+      // Move cursor behind the new anchor
+      if (tinyMCE.isGecko) {
+        var sp = inst.getDoc().createTextNode(" ");
+
+        if (elm.nextSibling)
+          elm.parentNode.insertBefore(sp, elm.nextSibling);
+        else
+          elm.parentNode.appendChild(sp);
+
+        // Set range after link
+        var rng = inst.getDoc().createRange();
+        rng.setStartAfter(elm);
+        rng.setEndAfter(elm);
+
+        // Update selection
+        var sel = inst.getSel();
+        sel.removeAllRanges();
+        sel.addRange(rng);
+      }
+
+      setAllAttribs(elm);
+    }
+  } else
+    setAllAttribs(elm);
+
+  tinyMCE._setEventsEnabled(inst.getBody(), false);
+  tinyMCEPopup.execCommand("mceEndUndoLevel");
+  tinyMCEPopup.close();
+}
+
+function setAllAttribs(elm) {
+  var formObj = document.forms[0];
+  var href = formObj.href.value;
+  var target = getSelectValue(formObj, 'targetlist');
+
+  // Make anchors absolute
+  if (href.charAt(0) == '#' && tinyMCE.getParam('convert_urls'))
+    href = tinyMCE.settings['document_base_url'] + href;
+
+  setAttrib(elm, 'href', convertURL(href, elm));
+  setAttrib(elm, 'mce_href', href);
+  setAttrib(elm, 'title');
+  setAttrib(elm, 'target', target == '_self' ? '' : target);
+  setAttrib(elm, 'id');
+  setAttrib(elm, 'style');
+  setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
+  setAttrib(elm, 'rel');
+  setAttrib(elm, 'rev');
+  setAttrib(elm, 'charset');
+  setAttrib(elm, 'hreflang');
+  setAttrib(elm, 'dir');
+  setAttrib(elm, 'lang');
+  setAttrib(elm, 'tabindex');
+  setAttrib(elm, 'accesskey');
+  setAttrib(elm, 'type');
+  setAttrib(elm, 'onfocus');
+  setAttrib(elm, 'onblur');
+  setAttrib(elm, 'onclick');
+  setAttrib(elm, 'ondblclick');
+  setAttrib(elm, 'onmousedown');
+  setAttrib(elm, 'onmouseup');
+  setAttrib(elm, 'onmouseover');
+  setAttrib(elm, 'onmousemove');
+  setAttrib(elm, 'onmouseout');
+  setAttrib(elm, 'onkeypress');
+  setAttrib(elm, 'onkeydown');
+  setAttrib(elm, 'onkeyup');
+
+  // Refresh in old MSIE
+  if (tinyMCE.isMSIE5)
+    elm.outerHTML = elm.outerHTML;
+}
+
+function getSelectValue(form_obj, field_name) {
+  var elm = form_obj.elements[field_name];
+
+  if (elm == null || elm.options == null)
+    return "";
+
+  return elm.options[elm.selectedIndex].value;
+}
+
+function getLinkListHTML(elm_id, target_form_element, onchange_func) {
+  if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
+    return "";
+
+  var html = "";
+
+  html += '<select id="' + elm_id + '" name="' + elm_id + '"';
+  html += ' class="mceLinkList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
+  html += 'this.options[this.selectedIndex].value;';
+
+  if (typeof(onchange_func) != "undefined")
+    html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
+
+  html += '"><option value="">---</option>';
+
+  for (var i=0; i<tinyMCELinkList.length; i++)
+    html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
+
+  html += '</select>';
+
+  return html;
+
+  // tinyMCE.debug('-- image list start --', html, '-- image list end --');
+}
+
+function getTargetListHTML(elm_id, target_form_element) {
+  var targets = tinyMCE.getParam('theme_advanced_link_targets', '').split(';');
+  var html = '';
+
+  html += '<select id="' + elm_id + '" name="' + elm_id + '" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
+  html += 'this.options[this.selectedIndex].value;">';
+
+  html += '<option value="_self">' + tinyMCE.getLang('lang_advlink_target_same') + '</option>';
+  html += '<option value="_blank">' + tinyMCE.getLang('lang_advlink_target_blank') + ' (_blank)</option>';
+  html += '<option value="_parent">' + tinyMCE.getLang('lang_advlink_target_parent') + ' (_parent)</option>';
+  html += '<option value="_top">' + tinyMCE.getLang('lang_advlink_target_top') + ' (_top)</option>';
+
+  for (var i=0; i<targets.length; i++) {
+    var key, value;
+
+    if (targets[i] == "")
+      continue;
+
+    key = targets[i].split('=')[0];
+    value = targets[i].split('=')[1];
+
+    html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
+  }
+
+  html += '</select>';
+
+  return html;
+}
+
+// While loading
+preinit();

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+// UK lang variables
+
+tinyMCE.addToLang('advlink',{
+general_tab : 'General',
+popup_tab : 'Popup',
+events_tab : 'Events',
+advanced_tab : 'Advanced',
+general_props : 'General properties',
+popup_props : 'Popup properties',
+event_props : 'Events',
+advanced_props : 'Advanced properties',
+popup_opts : 'Options',
+anchor_names : 'Anchors',
+target_same : 'Open in this window / frame',
+target_parent : 'Open in parent window / frame',
+target_top : 'Open in top frame (replaces all frames)',
+target_blank : 'Open in new window',
+popup : 'Javascript popup',
+popup_url : 'Popup URL',
+popup_name : 'Window name',
+popup_return : 'Insert \'return false\'',
+popup_scrollbars : 'Show scrollbars',
+popup_statusbar : 'Show status bar',
+popup_toolbar : 'Show toolbars',
+popup_menubar : 'Show menu bar',
+popup_location : 'Show location bar',
+popup_resizable : 'Make window resizable',
+popup_dependent : 'Dependent (Mozilla/Firefox only)',
+popup_size : 'Size',
+popup_position : 'Position (X/Y)',
+id : 'Id',
+style: 'Style',
+classes : 'Classes',
+target_name : 'Target name',
+langdir : 'Language direction',
+target_langcode : 'Target language',
+langcode : 'Language code',
+encoding : 'Target character encoding',
+mime : 'Target MIME type',
+rel : 'Relationship page to target',
+rev : 'Relationship target to page',
+tabindex : 'Tabindex',
+accesskey : 'Accesskey',
+ltr : 'Left to right',
+rtl : 'Right to left'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/link.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/link.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/link.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,334 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_insert_link_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
+  <link href="css/advlink.css" rel="stylesheet" type="text/css" />
+  <base target="_self" />
+</head>
+<body id="advlink" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+    <form onsubmit="insertAction();return false;" action="#">
+    <div class="tabs">
+      <ul>
+        <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_advlink_general_tab}</a></span></li>
+        <li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{$lang_advlink_popup_tab}</a></span></li>
+        <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_advlink_events_tab}</a></span></li>
+        <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_advlink_advanced_tab}</a></span></li>
+      </ul>
+    </div>
+
+    <div class="panel_wrapper">
+      <div id="general_panel" class="panel current">
+        <fieldset>
+          <legend>{$lang_advlink_general_props}</legend>
+
+          <table border="0" cellpadding="4" cellspacing="0">
+            <tr>
+              <td nowrap="nowrap"><label id="hreflabel" for="href">{$lang_insert_link_url}</label></td>
+              <td><table border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td><input id="href" name="href" type="text" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
+                  <td id="hrefbrowsercontainer">&nbsp;</td>
+                </tr>
+                </table></td>
+            </tr>
+            <tr id="linklisthrefrow">
+              <td class="column1"><label for="linklisthref">{$lang_link_list}</label></td>
+              <td colspan="2" id="linklisthrefcontainer">&nbsp;</td>
+            </tr>
+            <tr>
+              <td class="column1"><label for="anchorlist">{$lang_advlink_anchor_names}</label></td>
+              <td colspan="2" id="anchorlistcontainer">&nbsp;</td>
+            </tr>
+            <tr>
+              <td><label id="targetlistlabel" for="targetlist">{$lang_insert_link_target}</label></td>
+              <td id="targetlistcontainer">&nbsp;</td>
+            </tr>
+            <tr>
+              <td nowrap="nowrap"><label id="titlelabel" for="title">{$lang_theme_insert_link_titlefield}</label></td>
+              <td><input id="title" name="title" type="text" value="" /></td>
+            </tr>
+            <tr>
+              <td><label id="classlabel" for="classlist">{$lang_class_name}</label></td>
+              <td>
+                 <select id="classlist" name="classlist" onchange="changeClass();">
+                  <option value="" selected>{$lang_not_set}</option>
+                 </select>
+              </td>
+            </tr>
+          </table>
+        </fieldset>
+      </div>
+
+      <div id="popup_panel" class="panel">
+        <fieldset>
+          <legend>{$lang_advlink_popup_props}</legend>
+
+          <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
+          <label id="ispopuplabel" for="ispopup">{$lang_advlink_popup}</label>
+
+          <table border="0" cellpadding="0" cellspacing="4">
+            <tr>
+              <td nowrap="nowrap"><label for="popupurl">{$lang_advlink_popup_url}</label>&nbsp;</td>
+              <td>
+                <table border="0" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
+                    <td id="popupurlbrowsercontainer">&nbsp;</td>
+                  </tr>
+                </table>
+              </td>
+            </tr>
+            <tr>
+              <td nowrap="nowrap"><label for="popupname">{$lang_advlink_popup_name}</label>&nbsp;</td>
+              <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
+            </tr>
+            <tr>
+              <td nowrap="nowrap"><label>{$lang_advlink_popup_size}</label>&nbsp;</td>
+              <td nowrap="nowrap">
+                <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
+                <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
+              </td>
+            </tr>
+            <tr>
+              <td nowrap="nowrap" id="labelleft"><label>{$lang_advlink_popup_position}</label>&nbsp;</td>
+              <td nowrap="nowrap">
+                <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /                                
+                <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
+              </td>
+            </tr>
+          </table>
+
+          <fieldset>
+            <legend>{$lang_advlink_popup_opts}</legend>
+
+            <table border="0" cellpadding="0" cellspacing="4">
+              <tr>
+                <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
+                <td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{$lang_advlink_popup_location}</label></td>
+                <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
+                <td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{$lang_advlink_popup_scrollbars}</label></td>
+              </tr>
+              <tr>
+                <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
+                <td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{$lang_advlink_popup_menubar}</label></td>
+                <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
+                <td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{$lang_advlink_popup_resizable}</label></td>
+              </tr>
+              <tr>
+                <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
+                <td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{$lang_advlink_popup_toolbar}</label></td>
+                <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
+                <td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{$lang_advlink_popup_dependent}</label></td>
+              </tr>
+              <tr>
+                <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
+                <td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{$lang_advlink_popup_statusbar}</label></td>
+                <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
+                <td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{$lang_advlink_popup_return}</label></td>
+              </tr>
+            </table>
+          </fieldset>
+        </fieldset>
+      </div>
+
+      <div id="advanced_panel" class="panel">
+      <fieldset>
+          <legend>{$lang_advlink_advanced_props}</legend>
+
+          <table border="0" cellpadding="0" cellspacing="4">
+            <tr>
+              <td class="column1"><label id="idlabel" for="id">{$lang_advlink_id}</label></td> 
+              <td><input id="id" name="id" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td><label id="stylelabel" for="style">{$lang_advlink_style}</label></td>
+              <td><input type="text" id="style" name="style" value="" /></td>
+            </tr>
+
+            <tr>
+              <td><label id="classeslabel" for="classes">{$lang_advlink_classes}</label></td>
+              <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
+            </tr>
+
+            <tr>
+              <td><label id="targetlabel" for="target">{$lang_advlink_target_name}</label></td>
+              <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="dirlabel" for="dir">{$lang_advlink_langdir}</label></td> 
+              <td>
+                <select id="dir" name="dir"> 
+                    <option value="">{$lang_not_set}</option> 
+                    <option value="ltr">{$lang_advlink_ltr}</option> 
+                    <option value="rtl">{$lang_advlink_rtl}</option> 
+                </select>
+              </td> 
+            </tr>
+
+            <tr>
+              <td><label id="hreflanglabel" for="hreflang">{$lang_advlink_target_langcode}</label></td>
+              <td><input type="text" id="hreflang" name="hreflang" value="" /></td>
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="langlabel" for="lang">{$lang_advlink_langcode}</label></td> 
+              <td>
+                <input id="lang" name="lang" type="text" value="" />
+              </td> 
+            </tr>
+
+            <tr>
+              <td><label id="charsetlabel" for="charset">{$lang_advlink_encoding}</label></td>
+              <td><input type="text" id="charset" name="charset" value="" /></td>
+            </tr>
+
+            <tr>
+              <td><label id="typelabel" for="type">{$lang_advlink_mime}</label></td>
+              <td><input type="text" id="type" name="type" value="" /></td>
+            </tr>
+
+            <tr>
+              <td><label id="rellabel" for="rel">{$lang_advlink_rel}</label></td>
+              <td><select id="rel" name="rel"> 
+                  <option value="">{$lang_not_set}</option> 
+                  <option value="alternate">Alternate</option> 
+                  <option value="designates">Designates</option> 
+                  <option value="stylesheet">Stylesheet</option> 
+                  <option value="start">Start</option> 
+                  <option value="next">Next</option> 
+                  <option value="prev">Prev</option> 
+                  <option value="contents">Contents</option> 
+                  <option value="index">Index</option> 
+                  <option value="glossary">Glossary</option> 
+                  <option value="copyright">Copyright</option> 
+                  <option value="chapter">Chapter</option> 
+                  <option value="subsection">Subsection</option> 
+                  <option value="appendix">Appendix</option> 
+                  <option value="help">Help</option> 
+                  <option value="bookmark">Bookmark</option> 
+                </select> 
+              </td>
+            </tr>
+
+            <tr>
+              <td><label id="revlabel" for="rev">{$lang_advlink_rev}</label></td>
+              <td><select id="rev" name="rev"> 
+                  <option value="">{$lang_not_set}</option> 
+                  <option value="alternate">Alternate</option> 
+                  <option value="designates">Designates</option> 
+                  <option value="stylesheet">Stylesheet</option> 
+                  <option value="start">Start</option> 
+                  <option value="next">Next</option> 
+                  <option value="prev">Prev</option> 
+                  <option value="contents">Contents</option> 
+                  <option value="index">Index</option> 
+                  <option value="glossary">Glossary</option> 
+                  <option value="copyright">Copyright</option> 
+                  <option value="chapter">Chapter</option> 
+                  <option value="subsection">Subsection</option> 
+                  <option value="appendix">Appendix</option> 
+                  <option value="help">Help</option> 
+                  <option value="bookmark">Bookmark</option> 
+                </select> 
+              </td>
+            </tr>
+
+            <tr>
+              <td><label id="tabindexlabel" for="tabindex">{$lang_advlink_tabindex}</label></td>
+              <td><input type="text" id="tabindex" name="tabindex" value="" /></td>
+            </tr>
+
+            <tr>
+              <td><label id="accesskeylabel" for="accesskey">{$lang_advlink_accesskey}</label></td>
+              <td><input type="text" id="accesskey" name="accesskey" value="" /></td>
+            </tr>
+          </table>
+        </fieldset>
+      </div>
+
+      <div id="events_panel" class="panel">
+      <fieldset>
+          <legend>{$lang_advlink_event_props}</legend>
+
+          <table border="0" cellpadding="0" cellspacing="4">
+            <tr>
+              <td class="column1"><label for="onfocus">onfocus</label></td> 
+              <td><input id="onfocus" name="onfocus" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onblur">onblur</label></td> 
+              <td><input id="onblur" name="onblur" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onclick">onclick</label></td> 
+              <td><input id="onclick" name="onclick" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="ondblclick">ondblclick</label></td> 
+              <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onmousedown">onmousedown</label></td> 
+              <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onmouseup">onmouseup</label></td> 
+              <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onmouseover">onmouseover</label></td> 
+              <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onmousemove">onmousemove</label></td> 
+              <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onmouseout">onmouseout</label></td> 
+              <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onkeypress">onkeypress</label></td> 
+              <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onkeydown">onkeydown</label></td> 
+              <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="onkeyup">onkeyup</label></td> 
+              <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> 
+            </tr>
+          </table>
+        </fieldset>
+      </div>
+    </div>
+
+    <div class="mceActionPanel">
+      <div style="float: left">
+        <input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAction();" />
+      </div>
+
+      <div style="float: right">
+        <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+      </div>
+    </div>
+    </form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/advlink/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/editor_plugin.js
===================================================================

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,12 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.10 $
+ * $Date: 2006/02/10 16:29:38 $
+ *
+ * Experimental plugin for new Cleanup routine, this logic will be moved into the core ones it's stable enougth.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Dummy file since cleanup is now moved to core */

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/cleanup/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Dummy plugin since cleanup is now moved into core.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/css/contextmenu.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/css/contextmenu.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/css/contextmenu.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+.contextMenuIEPopup {
+  padding: 0;
+  margin: 0;
+  border: 0;
+  overflow: hidden;
+}
+
+.contextMenu {
+  position: absolute;
+  cursor: default;
+  z-index: 1000;
+  border: 1px solid #D4D0C8;
+  background-color: #FFFFFF;
+}
+
+.contextMenuItem, .contextMenuItemOver {
+}
+
+.contextMenuSeparator {
+  width: 100%;
+  background-color: #D4D0C8;
+  border: 0;
+}
+
+.contextMenuImage, .contextMenuItemDisabled {
+  border: 0;
+}
+
+.contextMenuIcon {
+  background-color: #F0F0EE;
+}
+
+.contextMenuItemOver .contextMenuIcon {
+  background-color: #B6BDD2;
+}
+
+.contextMenuIcon {
+  background-color: #F0F0EE;
+}
+
+.contextMenuItemDisabled img {
+  filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+  -moz-opacity:0.3;
+  opacity: 0.3;
+}
+
+.contextMenuText {
+  font-family: Tahoma, Verdana, Arial, Helvetica;
+  font-size: 11px;
+  line-height: 20px;
+}
+
+.contextMenuItemDisabled {
+  color: #AAAAAA;
+}
+
+.contextMenuText a {
+  display: block;
+  line-height: 20px;
+  width: 100%;
+  text-decoration: none;
+  color: black;
+  font-weight: normal;
+  margin: 0;
+  padding: 0;
+}
+
+.contextMenuText a:hover {
+  background-color: #B6BDD2;
+  text-decoration: none !important;
+  font-weight: normal;
+  margin: 0;
+  padding: 0;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+if(!tinyMCE.settings['contextmenu_skip_plugin_css']){tinyMCE.loadCSS(tinyMCE.baseURL+"/plugins/contextmenu/css/contextmenu.css");}var TinyMCE_ContextMenuPlugin={_contextMenu:null,getInfo:function(){return{longname:'Context menus',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isMSIE5_0&&tinyMCE.isOpera)return;TinyMCE_ContextMenuPlugin._contextMenu=new TinyMCE_ContextMenu({commandhandler:"TinyMCE_ContextMenuPlugin._commandHandler",spacer_image:tinyMCE.baseURL+"/plugins/contextmenu/images/spacer.gif"});tinyMCE.addEvent(inst.getDoc(),"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"contextmenu",function(e){TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?inst.contentWindow.event:e,inst);});}else tinyMCE.addEvent(inst.getDoc(),"contextmenu",TinyMCE_ContextMenuPlugin._onContextMenu);},_onContextMenu:function(e){var elm=tinyMCE.isMSIE?e.srcElement:e.target;var targetInst,body;if((body=tinyMCE.getParentElement(elm,"body"))!=null){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(body==inst.getBody()){targetInst=inst;break;}}return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?targetInst.contentWindow.event:e,targetInst);}},_showContextMenu:function(e,inst){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}var x,y,elm,contextMenu;var pos=tinyMCE.getAbsPosition(inst.iframeElement);x=tinyMCE.isMSIE?e.screenX:pos.absLeft+(e.pageX-inst.getBody().scrollLeft);y=tinyMCE.isMSIE?e.screenY:pos.absTop+(e.pageY-inst.getBody().scrollTop);elm=tinyMCE.isMSIE?e.srcElement:e.target;contextMenu=this._contextMenu;contextMenu.inst=inst;window.setTimeout(function(){var theme=tinyMCE.getParam("theme");contextMenu.clearAll();var sel=inst.selection.getSelectedText().length!=0||elm.nodeName=="IMG";contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_cut_desc","Cut","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_copy_desc","Copy","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_paste_desc","Paste","",false);if(sel||(elm?(elm.nodeName=='A')||(elm.nodeName=='IMG'):false)){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/link.gif","$lang_link_desc",inst.hasPlugin("advlink")?"mceAdvLink":"mceLink");contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/unlink.gif","$lang_unlink_desc","unlink","",(elm?(elm.nodeName!='A')&&(elm.nodeName!='IMG'):true));}elm=tinyMCE.getParentElement(elm,"img,table,td"+(inst.hasPlugin("advhr")?',hr':''));if(elm){switch(elm.nodeName){case"IMG":contextMenu.addSeparator();if(tinyMCE.getAttrib(elm,'class').indexOf('mceItemFlash')!=-1)contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_flash_props","mceFlash");else contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/image.gif","$lang_image_props_desc",inst.hasPlugin("advimage")?"mceAdvImage":"mceImage");break;case"HR":contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/advhr/images/advhr.gif","$lang_insert_advhr_desc","mceAdvancedHr");break;case"TABLE":case"TD":if(inst.hasPlugin("table")){var colspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"colspan");var rowspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_table_cut_row_desc","mceTableCutRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_table_copy_row_desc","mceTableCopyRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_before_desc","mceTablePasteRowBefore","",inst.tableRowClipboard==null);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_after_desc","mceTablePasteRowAfter","",inst.tableRowClipboard==null);contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_props_desc","mceInsertTable");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_cell_props.gif","$lang_table_cell_desc","mceTableCellProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete.gif","$lang_table_del","mceTableDelete");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_row_props.gif","$lang_table_row_desc","mceTableRowProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_before.gif","$lang_table_row_before_desc","mceTableInsertRowBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_after.gif","$lang_table_row_after_desc","mceTableInsertRowAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_row.gif","$lang_table_delete_row_desc","mceTableDeleteRow");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_before.gif","$lang_table_col_before_desc","mceTableInsertColBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_after.gif","$lang_table_col_after_desc","mceTableInsertColAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_col.gif","$lang_table_delete_col_desc","mceTableDeleteCol");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_split_cells.gif","$lang_table_split_cells_desc","mceTableSplitCells","",(colspan=="1"&&rowspan=="1"));contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_merge_cells.gif","$lang_table_merge_cells_desc","mceTableMergeCells","",false);}break;}}else{if(inst.hasPlugin("table")){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");}}contextMenu.show(x,y);},10);tinyMCE.cancelEvent(e);return false;},_hideContextMenu:function(){if(TinyMCE_ContextMenuPlugin._contextMenu)TinyMCE_ContextMenuPlugin._contextMenu.hide();},_commandHandler:function(command,value){var cm=TinyMCE_ContextMenuPlugin._contextMenu;cm.hide();var ui=false;if(command=="mceInsertTable"||command=="mceTableCellProps"||command=="mceTableRowProps"||command=="mceTableMergeCells")ui=true;if(command=="Paste")value=null;if(tinyMCE.getParam("dialog_type")=="modal"&&tinyMCE.isMSIE){window.setTimeout(function(){cm.inst.execCommand(command,ui,value);},100);}else cm.inst.execCommand(command,ui,value);}};tinyMCE.addPlugin("contextmenu",TinyMCE_ContextMenuPlugin);function TinyMCE_ContextMenu(settings){function defParam(key,def_val){settings[key]=typeof(settings[key])!="undefined"?settings[key]:def_val;}var self=this;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="contextMenu";this.contextMenuDiv.setAttribute("class","contextMenu");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position='absolute';this.contextMenuDiv.style.zindex=1000;this.contextMenuDiv.style.left='0';this.contextMenuDiv.style.top='0';this.contextMenuDiv.unselectable="on";document.body.appendChild(this.contextMenuDiv);defParam("commandhandler","");defParam("spacer_image","images/spacer.gif");this.items=new Array();this.settings=settings;this.html="";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop=window.createPopup();doc=this.pop.document;doc.open();doc.write('<html><head><link href="'+tinyMCE.baseURL+'/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');doc.close();}};TinyMCE_ContextMenu.prototype={clearAll:function(){this.html="";this.contextMenuDiv.innerHTML="";},addSeparator:function(){this.html+='<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="'+this.settings['spacer_image']+'" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="'+this.settings['spacer_image']+'" /></td></tr>';},addItem:function(icon,title,command,value,disabled){if(title.charAt(0)=='$')title=tinyMCE.getLang(title.substring(1));var onMouseDown='';var html='';if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)onMouseDown='contextMenu.execCommand(\''+command+'\', \''+value+'\');return false;';else onMouseDown=this.settings['commandhandler']+'(\''+command+'\', \''+value+'\');return false;';if(icon=="")icon=this.settings['spacer_image'];if(!disabled)html+='<tr class="contextMenuItem">';else html+='<tr class="contextMenuItemDisabled">';html+='<td class="contextMenuIcon"><img src="'+icon+'" width="20" height="20" class="contextMenuImage" /></td>';html+='<td><div class="contextMenuText">';html+='<a href="javascript:void(0);" onclick="'+onMouseDown+'" onmousedown="return false;">&#160;';html+=title;html+='&#160;</a>';html+='</div></td>';html+='</tr>';this.html+=html;},show:function(x,y){var vp,width,height;if(this.html=="")return;var html='';html+='<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';html+=this.html;html+='</table>';this.contextMenuDiv.innerHTML=html;this.contextMenuDiv.style.display="block";width=this.contextMenuDiv.offsetWidth;height=this.contextMenuDiv.offsetHeight;this.contextMenuDiv.style.display="none";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop.document.body.innerHTML='<div class="contextMenu">'+html+"</div>";this.pop.document.tinyMCE=tinyMCE;this.pop.document.contextMenu=this;this.pop.show(x,y,width,height);}else{vp=this.getViewPort();this.contextMenuDiv.style.left=(x>vp.width-width?vp.width-width:x)+'px';this.contextMenuDiv.style.top=(y>vp.height-height?vp.height-height:y)+'px';this.contextMenuDiv.style.display="block";}},getViewPort:function(){return{width:document.documentElement.offsetWidth||document.body.offsetWidth,height:self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight};},hide:function(){if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera)this.pop.hide();else this.contextMenuDiv.style.display="none";},execCommand:function(command,value){eval(this.settings['commandhandler']+"(command, value);");}};
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,356 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.31 $
+ * $Date: 2006/05/03 10:46:41 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+//tinyMCE.importPluginLanguagePack('contextmenu', 'en,tr,zh_cn,cs,fa,fr_ca,fr,de,nb');
+if (!tinyMCE.settings['contextmenu_skip_plugin_css']) {
+  tinyMCE.loadCSS(tinyMCE.baseURL + "/plugins/contextmenu/css/contextmenu.css");
+}
+
+var TinyMCE_ContextMenuPlugin = {
+  // Private fields
+  _contextMenu : null,
+
+  getInfo : function() {
+    return {
+      longname : 'Context menus',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  initInstance : function(inst) {
+    // Is not working on MSIE 5.0 or Opera no contextmenu event
+    if (tinyMCE.isMSIE5_0 && tinyMCE.isOpera)
+      return;
+
+    TinyMCE_ContextMenuPlugin._contextMenu = new TinyMCE_ContextMenu({
+      commandhandler : "TinyMCE_ContextMenuPlugin._commandHandler",
+      spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif"
+    });
+
+    // Add hide event handles
+    tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
+    tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
+    tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
+    tinyMCE.addEvent(document, "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
+    tinyMCE.addEvent(document, "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
+    tinyMCE.addEvent(document, "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
+
+    // Attach contextmenu event
+    if (tinyMCE.isGecko) {
+      tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);});
+    } else
+      tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_ContextMenuPlugin._onContextMenu);
+  },
+
+  // Private plugin internal methods
+
+  _onContextMenu : function(e) {
+    var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
+    var targetInst, body;
+
+    // Find instance
+    if ((body = tinyMCE.getParentElement(elm, "body")) != null) {
+      for (var n in tinyMCE.instances) {
+        var inst = tinyMCE.instances[n];
+        if (!tinyMCE.isInstance(inst))
+          continue;
+
+        if (body == inst.getBody()) {
+          targetInst = inst;
+          break;
+        }
+      }
+
+      return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst);
+    }
+  },
+
+  _showContextMenu : function(e, inst) {
+    function getAttrib(elm, name) {
+      return elm.getAttribute(name) ? elm.getAttribute(name) : "";
+    }
+
+    var x, y, elm, contextMenu;
+    var pos = tinyMCE.getAbsPosition(inst.iframeElement);
+
+    x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft);
+    y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop);
+    elm = tinyMCE.isMSIE ? e.srcElement : e.target;
+
+    contextMenu = this._contextMenu;
+    contextMenu.inst = inst;
+
+    // Mozilla needs some time
+    window.setTimeout(function () {
+      var theme = tinyMCE.getParam("theme");
+
+      contextMenu.clearAll();
+      var sel = inst.selection.getSelectedText().length != 0 || elm.nodeName == "IMG";
+
+      // Default items
+      contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel);
+      contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel);
+      contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false);
+
+      if (sel || (elm ? (elm.nodeName == 'A') || (elm.nodeName == 'IMG') : false)) {
+        contextMenu.addSeparator();
+        contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/link.gif", "$lang_link_desc", inst.hasPlugin("advlink") ? "mceAdvLink" : "mceLink");
+        contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/unlink.gif", "$lang_unlink_desc", "unlink", "", (elm ? (elm.nodeName != 'A') && (elm.nodeName != 'IMG') : true));
+      }
+
+      // Get element
+      elm = tinyMCE.getParentElement(elm, "img,table,td" + (inst.hasPlugin("advhr") ? ',hr' : ''));
+      if (elm) {
+        switch (elm.nodeName) {
+          case "IMG":
+            contextMenu.addSeparator();
+
+            // If flash
+            if (tinyMCE.getAttrib(elm, 'class').indexOf('mceItemFlash') != -1)
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash");
+            else
+              contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", inst.hasPlugin("advimage") ? "mceAdvImage" : "mceImage");
+            break;
+
+          case "HR":
+            contextMenu.addSeparator();
+            contextMenu.addItem(tinyMCE.baseURL + "/plugins/advhr/images/advhr.gif", "$lang_insert_advhr_desc", "mceAdvancedHr");
+            break;
+
+          case "TABLE":
+          case "TD":
+            // Is table plugin loaded
+            if (inst.hasPlugin("table")) {
+              var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan");
+              var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan");
+
+              colspan = colspan == "" ? "1" : colspan;
+              rowspan = rowspan == "" ? "1" : rowspan;
+
+              contextMenu.addSeparator();
+              contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow");
+              contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow");
+              contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null);
+              contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null);
+
+  /*            contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyleft.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false);
+              contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifycenter.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false);
+              contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyright.gif", "$lang_justifyright_desc", "JustifyRight", "", false);
+              contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyfull.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/
+              contextMenu.addSeparator();
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable");
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps");
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete.gif", "$lang_table_del", "mceTableDelete");
+              contextMenu.addSeparator();
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps");
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_row_before_desc", "mceTableInsertRowBefore");
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_row_after_desc", "mceTableInsertRowAfter");
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow");
+              contextMenu.addSeparator();
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_col_before_desc", "mceTableInsertColBefore");
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_col_after_desc", "mceTableInsertColAfter");
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol");
+              contextMenu.addSeparator();
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1"));
+              contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false);
+            }
+            break;
+        }
+      }  else {
+        // Add table specific
+        if (inst.hasPlugin("table")) {
+          contextMenu.addSeparator();
+          contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
+        }
+      }
+
+      contextMenu.show(x, y);
+    }, 10);
+
+    // Cancel default handeling
+    tinyMCE.cancelEvent(e);
+    return false;
+  },
+
+  _hideContextMenu : function() {
+    if (TinyMCE_ContextMenuPlugin._contextMenu)
+      TinyMCE_ContextMenuPlugin._contextMenu.hide();
+  },
+
+  _commandHandler : function(command, value) {
+    var cm = TinyMCE_ContextMenuPlugin._contextMenu;
+
+    cm.hide();
+
+    // UI must be true on these
+    var ui = false;
+    if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells")
+      ui = true;
+
+    if (command == "Paste")
+      value = null;
+
+    if (tinyMCE.getParam("dialog_type") == "modal" && tinyMCE.isMSIE) {
+      // Cell properties will generate access denied error is this isn't done?!
+      window.setTimeout(function() {
+        cm.inst.execCommand(command, ui, value);
+      }, 100);
+    } else
+      cm.inst.execCommand(command, ui, value);
+  }
+};
+
+tinyMCE.addPlugin("contextmenu", TinyMCE_ContextMenuPlugin);
+
+// Context menu class
+
+function TinyMCE_ContextMenu(settings) {
+  // Default value function
+  function defParam(key, def_val) {
+    settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val;
+  }
+
+  var self = this;
+
+  this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+
+  // Setup contextmenu div
+  this.contextMenuDiv = document.createElement("div");
+  this.contextMenuDiv.className = "contextMenu";
+  this.contextMenuDiv.setAttribute("class", "contextMenu");
+  this.contextMenuDiv.style.display = "none";
+  this.contextMenuDiv.style.position = 'absolute';
+  this.contextMenuDiv.style.zindex = 1000;
+  this.contextMenuDiv.style.left = '0';
+  this.contextMenuDiv.style.top = '0';
+  this.contextMenuDiv.unselectable = "on";
+
+  document.body.appendChild(this.contextMenuDiv);
+
+  // Setup default values
+  defParam("commandhandler", "");
+  defParam("spacer_image", "images/spacer.gif");
+
+  this.items = new Array();
+  this.settings = settings;
+  this.html = "";
+
+  // IE Popup
+  if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
+    this.pop = window.createPopup();
+    doc = this.pop.document;
+    doc.open();
+    doc.write('<html><head><link href="' + tinyMCE.baseURL + '/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');
+    doc.close();
+  }
+};
+
+TinyMCE_ContextMenu.prototype = {
+  clearAll : function() {
+    this.html = "";
+    this.contextMenuDiv.innerHTML = "";
+  },
+
+  addSeparator : function() {
+    this.html += '<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="' + this.settings['spacer_image'] + '" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="' + this.settings['spacer_image'] + '" /></td></tr>';
+  },
+
+  addItem : function(icon, title, command, value, disabled) {
+    if (title.charAt(0) == '$')
+      title = tinyMCE.getLang(title.substring(1));
+
+    var onMouseDown = '';
+    var html = '';
+
+    if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0)
+      onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;';
+    else
+      onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;';
+
+    if (icon == "")
+      icon = this.settings['spacer_image'];
+
+    if (!disabled)
+      html += '<tr class="contextMenuItem">';
+    else
+      html += '<tr class="contextMenuItemDisabled">';
+
+    html += '<td class="contextMenuIcon"><img src="' + icon + '" width="20" height="20" class="contextMenuImage" /></td>';
+    html += '<td><div class="contextMenuText">';
+    html += '<a href="javascript:void(0);" onclick="' + onMouseDown + '" onmousedown="return false;">&#160;';
+
+    // Add text
+    html += title;
+
+    html += '&#160;</a>';
+    html += '</div></td>';
+    html += '</tr>';
+
+    // Add to main
+    this.html += html;
+  },
+
+  show : function(x, y) {
+    var vp, width, height;
+
+    if (this.html == "")
+      return;
+
+    var html = '';
+
+    html += '<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';
+    html += this.html;
+    html += '</table>';
+
+    this.contextMenuDiv.innerHTML = html;
+
+    // Get dimensions
+    this.contextMenuDiv.style.display = "block";
+    width = this.contextMenuDiv.offsetWidth;
+    height = this.contextMenuDiv.offsetHeight;
+    this.contextMenuDiv.style.display = "none";
+
+    if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
+      // Setup popup and show
+      this.pop.document.body.innerHTML = '<div class="contextMenu">' + html + "</div>";
+      this.pop.document.tinyMCE = tinyMCE;
+      this.pop.document.contextMenu = this;
+      this.pop.show(x, y, width, height);
+    } else {
+      vp = this.getViewPort();
+
+      this.contextMenuDiv.style.left = (x > vp.width - width ? vp.width - width : x) + 'px';
+      this.contextMenuDiv.style.top = (y > vp.height - height ? vp.height - height : y) + 'px';
+      this.contextMenuDiv.style.display = "block";
+    }
+  },
+
+  getViewPort : function() {
+    return {
+      width : document.documentElement.offsetWidth || document.body.offsetWidth,
+      height : self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
+    };
+  },
+
+  hide : function() {
+    if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera)
+      this.pop.hide();
+    else
+      this.contextMenuDiv.style.display = "none";
+  },
+
+  execCommand : function(command, value) {
+    eval(this.settings['commandhandler'] + "(command, value);");
+  }
+};

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/images/spacer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/images/spacer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/contextmenu/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('directionality','en,tr,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');var TinyMCE_DirectionalityPlugin={getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"ltr":return tinyMCE.getButtonHTML(cn,'lang_directionality_ltr_desc','{$pluginurl}/images/ltr.gif','mceDirectionLTR');case"rtl":return tinyMCE.getButtonHTML(cn,'lang_directionality_rtl_desc','{$pluginurl}/images/rtl.gif','mceDirectionRTL');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceDirectionLTR":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","ltr");tinyMCE.triggerNodeChange(false);return true;case"mceDirectionRTL":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","rtl");tinyMCE.triggerNodeChange(false);return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}if(node==null)return;var elm=tinyMCE.getParentElement(node,"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(!elm){tinyMCE.switchClass(editor_id+'_ltr','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_rtl','mceButtonDisabled');return true;}tinyMCE.switchClass(editor_id+'_ltr','mceButtonNormal');tinyMCE.switchClass(editor_id+'_rtl','mceButtonNormal');var dir=getAttrib(elm,"dir");if(dir=="ltr"||dir=="")tinyMCE.switchClass(editor_id+'_ltr','mceButtonSelected');else tinyMCE.switchClass(editor_id+'_rtl','mceButtonSelected');return true;}};tinyMCE.addPlugin("directionality",TinyMCE_DirectionalityPlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.16 $
+ * $Date: 2006/02/10 21:34:28 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('directionality', 'en,tr,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');
+
+var TinyMCE_DirectionalityPlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Directionality',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  getControlHTML : function(cn) {
+    switch (cn) {
+      case "ltr":
+        return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR');
+
+      case "rtl":
+        return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL');
+    }
+
+    return "";
+  },
+
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    // Handle commands
+    switch (command) {
+      case "mceDirectionLTR":
+        var inst = tinyMCE.getInstanceById(editor_id);
+        var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+
+        if (elm)
+          elm.setAttribute("dir", "ltr");
+
+        tinyMCE.triggerNodeChange(false);
+        return true;
+
+      case "mceDirectionRTL":
+        var inst = tinyMCE.getInstanceById(editor_id);
+        var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+
+        if (elm)
+          elm.setAttribute("dir", "rtl");
+
+        tinyMCE.triggerNodeChange(false);
+        return true;
+    }
+
+    // Pass to next handler in chain
+    return false;
+  },
+
+  handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+    function getAttrib(elm, name) {
+      return elm.getAttribute(name) ? elm.getAttribute(name) : "";
+    }
+
+    if (node == null)
+      return;
+
+    var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+    if (!elm) {
+      tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled');
+      tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled');
+      return true;
+    }
+
+    tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal');
+
+    var dir = getAttrib(elm, "dir");
+    if (dir == "ltr" || dir == "")
+      tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected');
+    else
+      tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected');
+
+    return true;
+  }
+};
+
+tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/images/ltr.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/images/ltr.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/images/rtl.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/images/rtl.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,6 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+directionality_ltr_desc : 'Direction left to right',
+directionality_rtl_desc : 'Direction right to left'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/directionality/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/config.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/config.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/config.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,157 @@
+<?php
+/***********************************************************************
+** Title.........:    Insert File Dialog, File Manager
+** Version.......:    1.1
+** Authors.......:    Al Rashid <alrashid at klokan.sk>
+**                    Xiang Wei ZHUO <wei at zhuo.org>
+** Filename......:    config.php
+** URL...........:    http://alrashid.klokan.sk/insFile/
+** Last changed..:    23 July 2004
+***********************************************************************/
+
+/*
+ MY_DOCUMENT_ROOT
+ File system path to the directory you want to manage the files and folders
+ NOTE: This directory requires write permission by PHP. That is,
+       PHP must be able to create files in this directory.
+ NOTE2: without trailing slash
+*/
+$MY_DOCUMENT_ROOT     = DIR_FS_DOCUMENT_ROOT . 'pub';//'/server/www/loaded62pro/download'; //* system path to the directory you want to manage the files and folders
+
+/* MY_BASE_URL  Not used in htmlarea3-plugin version  */
+$MY_BASE_URL          = HTTP_SERVER . DIR_WS_CATALOG . 'pub';//"http://wa4u/loaded62pro/";
+
+/*
+ MY_URL_TO_OPEN_FILE
+ The URL to the MY_DOCUMENT_ROOT path, the web browser needs to be able to see it.
+ It can be protected via .htaccess on apache or directory permissions on IIS,
+ check you web server documentation for futher information on directory protection
+ If this directory needs to be publicly accessiable, remove scripting capabilities
+ for this directory (i.e. disable PHP, Perl, CGI). We only want to store documents
+ in this directory and its subdirectories.
+ NOTE: without trailing slash
+*/
+$MY_URL_TO_OPEN_FILE  = HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'pub'; 
+
+/* MY_ALLOW_CREATE   Boolean (false or true) whether creating folders is allowed or not. */
+$MY_ALLOW_CREATE     = true;
+/* $MY_ALLOW_DELETE  Boolean (false or true) whether deleting files and folders is allowed or not. */
+$MY_ALLOW_DELETE     = true;
+/* $MY_ALLOW_RENAME  Boolean (false or true) whether renaming files and folders is allowed or not. */
+$MY_ALLOW_RENAME     = ture;
+/* $MY_ALLOW_MOVE    Boolean (false or true) whether moving files and folders is allowed or not. */
+$MY_ALLOW_MOVE       = true;
+/* $MY_ALLOW_UPLOAD  Boolean (false or true) whether uploading files is allowed or not. */
+$MY_ALLOW_UPLOAD     = true;
+/* MY_LIST_EXTENSIONS This array specifies which files are listed in dialog. Setting to null causes that all files are listed,case insensitive. */
+$MY_LIST_EXTENSIONS  = array('html', 'doc', 'xls', 'txt', 'gif', 'jpeg', 'jpg', 'png', 'pdf', 'zip', 'pdf');
+/*
+ MY_ALLOW_EXTENSIONS
+ MY_DENY_EXTENSIONS
+ MY_ALLOW_EXTENSIONS and MY_DENY_EXTENSIONS arrays specify which file types can be uploaded.
+ Setting to null skips this check. The scheme is:
+ 1) If MY_DENY_EXTENSIONS is not null check if it does _not_ contain file extension of the file to be uploaded.
+    If it does skip the upload procedure.
+ 2) If MY_ALLOW_EXTENSIONS is not null check if it _does_ contain file extension of the file to be uploaded.
+    If it doesn't skip the upload procedure.
+ 3) Upload file.
+ NOTE: File extensions arrays are case insensitive.
+        You should always include server side executable file types in MY_DENY_EXTENSIONS !!!
+*/
+$MY_ALLOW_EXTENSIONS = array('html', 'doc', 'xls', 'txt', 'gif', 'jpeg', 'jpg', 'png', 'pdf', 'zip', 'pdf');
+$MY_DENY_EXTENSIONS  = array('php', 'php3', 'php4', 'phtml', 'shtml', 'cgi', 'pl');
+/*
+ $MY_ALLOW_UPLOAD
+ Maximum allowed size for uploaded files (in bytes).
+ NOTE2: see also upload_max_filesize setting in your php.ini file
+ NOTE: 2*1024*1024 means 2 MB (megabytes) which is the default php.ini setting
+*/
+$MY_MAX_FILE_SIZE                 = 2*1024*1024;
+
+/*
+ $MY_LANG
+ Interface language. See the lang directory for translation files.
+ NOTE: You should set appropriately MY_CHARSET and $MY_DATETIME_FORMAT variables
+*/
+$MY_LANG                = 'en';
+
+/*
+ $MY_CHARSET
+ Character encoding for all Insert File dialogs.
+ WARNING: For non english and non iso-8859-1 / utf8 users mostly !!!
+ This setting affect also how the name of folder you create via Insert File Dialog
+ and the name of file uploaded via Insert File Dialog will be encoded on your remote
+ server filesystem. Note also the difference between how file names in multipart/data
+ form are encoded by Internet Explorer (plain text depending on the webpage charset)
+ and Mozilla (encoded according to RFC 1738).
+ This should be fixed in next versions. Any help is VERY appreciated.
+*/
+$MY_CHARSET             = 'iso-8859-1';
+
+/*
+ MY_DATETIME_FORMAT
+ Datetime format for displaying file modification time in Insert File Dialog and in inserted link, see MY_LINK_FORMAT
+*/
+$MY_DATETIME_FORMAT                = "d.m.Y H:i";
+
+/*
+ MY_LINK_FORMAT
+ The string to be inserted into textarea.
+ This is the most crucial setting. I apologize for not using the DOM functions any more,
+ but inserting raw string allow more customization for everyone.
+ The following strings are replaced by corresponding values of selected files/folders:
+ _editor_url  the url of htmlarea root folder - you should set it in your document (see htmlarea help)
+ IF_ICON      file type icon filename (see plugins/InsertFile/images/ext directory)
+ IF_URL       relative path to file relative to $MY_DOCUMENT_ROOT
+ IF_CAPTION   file/folder name
+ IF_SIZE      file size in (B, kB, or MB)
+ IF_DATE      last modification time acording to $MY_DATETIME_FORMAT format
+*/
+//$MY_LINK_FORMAT         = '<span class="filelink"><img src="editor_url/plugins/filemanager/InsertFile/IF_ICON" alt="IF_URL" border="0">&nbsp;<a href="IF_URL">IF_CAPTION</a> &nbsp;<span style="font-size:70%">IF_SIZE &nbsp;IF_DATE</span></span>&nbsp;';
+//$MY_LINK_FORMAT         = '<span class="filelink"><img src="'.DIR_WS_HTTP_ADMIN.'editor_url/plugins/filemanager/InsertFile/IF_ICON" alt="IF_URL" border="0">&nbsp;<a href="IF_URL">IF_CAPTION</a> &nbsp;<span style="font-size:70%">IF_SIZE &nbsp;IF_DATE</span></span>&nbsp;';
+
+/* parse_icon function  please insert additional file types (extensions) and theis corresponding icons in switch statement */
+function parse_icon($ext) {
+        switch (strtolower($ext)) {
+                case 'doc': return 'doc_small.gif';
+                case 'rtf': return 'doc_small.gif';
+                case 'txt': return 'txt_small.gif';
+                case 'xls': return 'xls_small.gif';
+                case 'csv': return 'xls_small.gif';
+                case 'ppt': return 'ppt_small.gif';
+                case 'html': return 'html_small.gif';
+                case 'htm': return 'html_small.gif';
+                case 'php': return 'script_small.gif';
+                case 'php3': return 'script_small.gif';
+                case 'cgi': return 'script_small.gif';
+                case 'pdf': return 'pdf_small.gif';
+                case 'rar': return 'rar_small.gif';
+                case 'zip': return 'zip_small.gif';
+                case 'gz': return 'gz_small.gif';
+                case 'jpg': return 'jpg_small.gif';
+                case 'gif': return 'gif_small.gif';
+                case 'png': return 'png_small.gif';
+                case 'bmp': return 'image_small.gif';
+                case 'exe': return 'binary_small.gif';
+                case 'bin': return 'binary_small.gif';
+                case 'avi': return 'mov_small.gif';
+                case 'mpg': return 'mov_small.gif';
+                case 'moc': return 'mov_small.gif';
+                case 'asf': return 'mov_small.gif';
+                case 'mp3': return 'sound_small.gif';
+                case 'wav': return 'sound_small.gif';
+                case 'org': return 'sound_small.gif';
+        default:
+                return 'def_small.gif';
+        }
+}
+
+// DO NOT EDIT BELOW
+$MY_NAME = 'insertfiledialog';
+$lang_file = 'lang/lang-'.$MY_LANG.'.php';
+if (is_file($lang_file)) require($lang_file);
+else require('lang/lang-en.php');
+///$MY_PATH = $MY_URL_TO_OPEN_FILE . '/';
+//$MY_UP_PATH = $MY_URL_TO_OPEN_FILE . '/';
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/selectableelements.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/selectableelements.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/selectableelements.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,375 @@
+/*----------------------------------------------------------------------------\
+|                          Selectable Elements 1.02                           |
+|-----------------------------------------------------------------------------|
+|                         Created by Erik Arvidsson                           |
+|                  (http://webfx.eae.net/contact.html#erik)                   |
+|                      For WebFX (http://webfx.eae.net/)                      |
+|-----------------------------------------------------------------------------|
+|          A script that allows children of any element to be selected        |
+|-----------------------------------------------------------------------------|
+|                  Copyright (c) 1999 - 2004 Erik Arvidsson                   |
+|-----------------------------------------------------------------------------|
+| This software is provided "as is", without warranty of any kind, express or |
+| implied, including  but not limited  to the warranties of  merchantability, |
+| fitness for a particular purpose and noninfringement. In no event shall the |
+| authors or  copyright  holders be  liable for any claim,  damages or  other |
+| liability, whether  in an  action of  contract, tort  or otherwise, arising |
+| from,  out of  or in  connection with  the software or  the  use  or  other |
+| dealings in the software.                                                   |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| This  software is  available under the  three different licenses  mentioned |
+| below.  To use this software you must chose, and qualify, for one of those. |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Non-Commercial License          http://webfx.eae.net/license.html |
+| Permits  anyone the right to use the  software in a  non-commercial context |
+| free of charge.                                                             |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Commercial license           http://webfx.eae.net/commercial.html |
+| Permits the  license holder the right to use  the software in a  commercial |
+| context. Such license must be specifically obtained, however it's valid for |
+| any number of  implementations of the licensed software.                    |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| GPL - The GNU General Public License    http://www.gnu.org/licenses/gpl.txt |
+| Permits anyone the right to use and modify the software without limitations |
+| as long as proper  credits are given  and the original  and modified source |
+| code are included. Requires  that the final product, software derivate from |
+| the original  source or any  software  utilizing a GPL  component, such  as |
+| this, is also licensed under the GPL license.                               |
+|-----------------------------------------------------------------------------|
+| 2002-09-19 | Original Version Posted.                                       |
+| 2002-09-27 | Fixed a bug in IE when mouse down and up occured on different  |
+|            | rows.                                                          |
+| 2003-02-11 | Minor problem with addClassName and removeClassName that       |
+|            | triggered a bug in Opera 7. Added destroy method               |
+|-----------------------------------------------------------------------------|
+| Created 2002-09-04 | All changes are in the log above. | Updated 2003-02-11 |
+\----------------------------------------------------------------------------*/
+
+function SelectableElements(oElement, bMultiple) {
+  if (oElement == null)
+    return;
+
+  this._htmlElement = oElement;
+  this._multiple = Boolean(bMultiple);
+
+  this._selectedItems = [];
+  this._fireChange = true;
+
+  var oThis = this;
+  this._onclick = function (e) {
+    if (e == null) e = oElement.ownerDocument.parentWindow.event;
+    oThis.click(e);
+  };
+
+  if (oElement.addEventListener)
+    oElement.addEventListener("click", this._onclick, false);
+  else if (oElement.attachEvent)
+    oElement.attachEvent("onclick", this._onclick);
+}
+
+SelectableElements.prototype.setItemSelected = function (oEl, bSelected) {
+  if (!this._multiple) {
+    if (bSelected) {
+      var old = this._selectedItems[0]
+      if (oEl == old)
+        return;
+      if (old != null)
+        this.setItemSelectedUi(old, false);
+      this.setItemSelectedUi(oEl, true);
+      this._selectedItems = [oEl];
+      this.fireChange();
+    }
+    else {
+      if (this._selectedItems[0] == oEl) {
+        this.setItemSelectedUi(oEl, false);
+        this._selectedItems = [];
+      }
+    }
+  }
+  else {
+    if (Boolean(oEl._selected) == Boolean(bSelected))
+      return;
+
+    this.setItemSelectedUi(oEl, bSelected);
+
+    if (bSelected)
+      this._selectedItems[this._selectedItems.length] = oEl;
+    else {
+      // remove
+      var tmp = [];
+      var j = 0;
+      for (var i = 0; i < this._selectedItems.length; i++) {
+        if (this._selectedItems[i] != oEl)
+          tmp[j++] = this._selectedItems[i];
+      }
+      this._selectedItems = tmp;
+    }
+    this.fireChange();
+  }
+};
+
+// This method updates the UI of the item
+SelectableElements.prototype.setItemSelectedUi = function (oEl, bSelected) {
+  if (bSelected)
+    addClassName(oEl, "selected");
+  else
+    removeClassName(oEl, "selected");
+
+  oEl._selected = bSelected;
+};
+
+SelectableElements.prototype.getItemSelected = function (oEl) {
+  return Boolean(oEl._selected);
+};
+
+SelectableElements.prototype.fireChange = function () {
+  if (!this._fireChange)
+    return;
+  if (typeof this.onchange == "string")
+    this.onchange = new Function(this.onchange);
+  if (typeof this.onchange == "function")
+    this.onchange();
+};
+
+
+SelectableElements.prototype.click = function (e) {
+  var oldFireChange = this._fireChange;
+  this._fireChange = false;
+
+  // create a copy to compare with after changes
+  var selectedBefore = this.getSelectedItems(); // is a cloned array
+
+  // find row
+  var el = e.target != null ? e.target : e.srcElement;
+  while (el != null && !this.isItem(el))
+    el = el.parentNode;
+
+  if (el == null) { // happens in IE when down and up occur on different items
+    this._fireChange = oldFireChange;
+    return;
+  }
+
+  var rIndex = el;
+  var aIndex = this._anchorIndex;
+
+  // test whether the current row should be the anchor
+  if (this._selectedItems.length == 0 || (e.ctrlKey && !e.shiftKey && this._multiple)) {
+    aIndex = this._anchorIndex = rIndex;
+  }
+
+  if (!e.ctrlKey && !e.shiftKey || !this._multiple) {
+    // deselect all
+    var items = this._selectedItems;
+    for (var i = items.length - 1; i >= 0; i--) {
+      if (items[i]._selected && items[i] != el)
+        this.setItemSelectedUi(items[i], false);
+    }
+    this._anchorIndex = rIndex;
+    if (!el._selected) {
+      this.setItemSelectedUi(el, true);
+    }
+    this._selectedItems = [el];
+  }
+
+  // ctrl
+  else if (this._multiple && e.ctrlKey && !e.shiftKey) {
+    this.setItemSelected(el, !el._selected);
+    this._anchorIndex = rIndex;
+  }
+
+  // ctrl + shift
+  else if (this._multiple && e.ctrlKey && e.shiftKey) {
+    // up or down?
+    var dirUp = this.isBefore(rIndex, aIndex);
+
+    var item = aIndex;
+    while (item != null && item != rIndex) {
+      if (!item._selected && item != el)
+        this.setItemSelected(item, true);
+      item = dirUp ? this.getPrevious(item) : this.getNext(item);
+    }
+
+    if (!el._selected)
+      this.setItemSelected(el, true);
+  }
+
+  // shift
+  else if (this._multiple && !e.ctrlKey && e.shiftKey) {
+    // up or down?
+    var dirUp = this.isBefore(rIndex, aIndex);
+
+    // deselect all
+    var items = this._selectedItems;
+    for (var i = items.length - 1; i >= 0; i--)
+      this.setItemSelectedUi(items[i], false);
+    this._selectedItems = [];
+
+    // select items in range
+    var item = aIndex;
+    while (item != null) {
+      this.setItemSelected(item, true);
+      if (item == rIndex)
+        break;
+      item = dirUp ? this.getPrevious(item) : this.getNext(item);
+    }
+  }
+
+  // find change!!!
+  var found;
+  var changed = selectedBefore.length != this._selectedItems.length;
+  if (!changed) {
+    for (var i = 0; i < selectedBefore.length; i++) {
+      found = false;
+      for (var j = 0; j < this._selectedItems.length; j++) {
+        if (selectedBefore[i] == this._selectedItems[j]) {
+          found = true;
+          break;
+        }
+      }
+      if (!found) {
+        changed = true;
+        break;
+      }
+    }
+  }
+
+  this._fireChange = oldFireChange;
+  if (changed && this._fireChange)
+    this.fireChange();
+};
+
+SelectableElements.prototype.getSelectedItems = function () {
+  //clone
+  var items = this._selectedItems;
+  var l = items.length;
+  var tmp = new Array(l);
+  for (var i = 0; i < l; i++)
+    tmp[i] = items[i];
+  return tmp;
+};
+
+SelectableElements.prototype.isItem = function (node) {
+  return node != null && node.nodeType == 1 && node.parentNode == this._htmlElement;
+};
+
+SelectableElements.prototype.destroy = function () {
+  if (this._htmlElement.removeEventListener)
+    this._htmlElement.removeEventListener("click", this._onclick, false);
+  else if (this._htmlElement.detachEvent)
+    this._htmlElement.detachEvent("onclick", this._onclick);
+
+  this._htmlElement = null;
+  this._onclick = null;
+  this._selectedItems = null;
+};
+
+/* Traversable Collection Interface */
+
+SelectableElements.prototype.getNext = function (el) {
+  var n = el.nextSibling;
+  if (n == null || this.isItem(n))
+    return n;
+  return this.getNext(n);
+};
+
+SelectableElements.prototype.getPrevious = function (el) {
+  var p = el.previousSibling;
+  if (p == null || this.isItem(p))
+    return p;
+  return this.getPrevious(p);
+};
+
+SelectableElements.prototype.isBefore = function (n1, n2) {
+  var next = this.getNext(n1);
+  while (next != null) {
+    if (next == n2)
+      return true;
+    next = this.getNext(next);
+  }
+  return false;
+};
+
+/* End Traversable Collection Interface */
+
+/* Indexable Collection Interface */
+
+SelectableElements.prototype.getItems = function () {
+  var tmp = [];
+  var j = 0;
+  var cs = this._htmlElement.childNodes;
+  var l = cs.length;
+  for (var i = 0; i < l; i++) {
+    if (cs[i].nodeType == 1)
+      tmp[j++] = cs[i]
+  }
+  return tmp;
+};
+
+SelectableElements.prototype.getItem = function (nIndex) {
+  var j = 0;
+  var cs = this._htmlElement.childNodes;
+  var l = cs.length;
+  for (var i = 0; i < l; i++) {
+    if (cs[i].nodeType == 1) {
+      if (j == nIndex)
+        return cs[i];
+      j++;
+    }
+  }
+  return null;
+};
+
+SelectableElements.prototype.getSelectedIndexes = function () {
+  var items = this.getSelectedItems();
+  var l = items.length;
+  var tmp = new Array(l);
+  for (var i = 0; i < l; i++)
+    tmp[i] = this.getItemIndex(items[i]);
+  return tmp;
+};
+
+
+SelectableElements.prototype.getItemIndex = function (el) {
+  var j = 0;
+  var cs = this._htmlElement.childNodes;
+  var l = cs.length;
+  for (var i = 0; i < l; i++) {
+    if (cs[i] == el)
+      return j;
+    if (cs[i].nodeType == 1)
+      j++;
+  }
+  return -1;
+};
+
+/* End Indexable Collection Interface */
+
+
+
+function addClassName(el, sClassName) {
+  var s = el.className;
+  var p = s.split(" ");
+  if (p.length == 1 && p[0] == "")
+    p = [];
+
+  var l = p.length;
+  for (var i = 0; i < l; i++) {
+    if (p[i] == sClassName)
+      return;
+  }
+  p[p.length] = sClassName;
+  el.className = p.join(" ");
+}
+
+function removeClassName(el, sClassName) {
+  var s = el.className;
+  var p = s.split(" ");
+  var np = [];
+  var l = p.length;
+  var j = 0;
+  for (var i = 0; i < l; i++) {
+    if (p[i] != sClassName)
+      np[j++] = p[i];
+  }
+  el.className = np.join(" ");
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/selectabletablerows.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/selectabletablerows.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/selectabletablerows.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+/*----------------------------------------------------------------------------\
+|                          Selectable Elements 1.02                           |
+|-----------------------------------------------------------------------------|
+|                         Created by Erik Arvidsson                           |
+|                  (http://webfx.eae.net/contact.html#erik)                   |
+|                      For WebFX (http://webfx.eae.net/)                      |
+|-----------------------------------------------------------------------------|
+|          A script that allows children of any element to be selected        |
+|-----------------------------------------------------------------------------|
+|                  Copyright (c) 1999 - 2004 Erik Arvidsson                   |
+|-----------------------------------------------------------------------------|
+| This software is provided "as is", without warranty of any kind, express or |
+| implied, including  but not limited  to the warranties of  merchantability, |
+| fitness for a particular purpose and noninfringement. In no event shall the |
+| authors or  copyright  holders be  liable for any claim,  damages or  other |
+| liability, whether  in an  action of  contract, tort  or otherwise, arising |
+| from,  out of  or in  connection with  the software or  the  use  or  other |
+| dealings in the software.                                                   |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| This  software is  available under the  three different licenses  mentioned |
+| below.  To use this software you must chose, and qualify, for one of those. |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Non-Commercial License          http://webfx.eae.net/license.html |
+| Permits  anyone the right to use the  software in a  non-commercial context |
+| free of charge.                                                             |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Commercial license           http://webfx.eae.net/commercial.html |
+| Permits the  license holder the right to use  the software in a  commercial |
+| context. Such license must be specifically obtained, however it's valid for |
+| any number of  implementations of the licensed software.                    |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| GPL - The GNU General Public License    http://www.gnu.org/licenses/gpl.txt |
+| Permits anyone the right to use and modify the software without limitations |
+| as long as proper  credits are given  and the original  and modified source |
+| code are included. Requires  that the final product, software derivate from |
+| the original  source or any  software  utilizing a GPL  component, such  as |
+| this, is also licensed under the GPL license.                               |
+|-----------------------------------------------------------------------------|
+| 2002-09-19 | Original Version Posted.                                       |
+| 2002-09-27 | Fixed a bug in IE when mouse down and up occured on different  |
+|            | rows.                                                          |
+| 2003-02-11 | Minor problem with addClassName and removeClassName that       |
+|            | triggered a bug in Opera 7. Added destroy method               |
+|-----------------------------------------------------------------------------|
+| Created 2002-09-04 | All changes are in the log above. | Updated 2003-02-11 |
+\----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------\
+| This file requires that SelectableElements is first defined. This class can |
+| be found in the file selectableelements.js at WebFX                         |
+\----------------------------------------------------------------------------*/
+
+function SelectableTableRows(oTableElement, bMultiple) {
+  SelectableElements.call(this, oTableElement, bMultiple);
+}
+SelectableTableRows.prototype = new SelectableElements;
+
+SelectableTableRows.prototype.isItem = function (node) {
+  return node != null && node.tagName == "TR" &&
+    node.parentNode.tagName == "TBODY" &&
+    node.parentNode.parentNode == this._htmlElement;
+};
+
+/* Indexable Collection Interface */
+
+SelectableTableRows.prototype.getItems = function () {
+  return this._htmlElement.rows;
+};
+
+SelectableTableRows.prototype.getItemIndex = function (el) {
+  return el.rowIndex;
+};
+
+SelectableTableRows.prototype.getItem = function (i) {
+  return this._htmlElement.rows[i];
+};
+
+/* End Indexable Collection Interface */
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/sortabletable.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/sortabletable.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/css/sortabletable.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+.sort-table {
+  font:   Icon;
+  border:   0px Solid Window;       
+  background: Window;
+  color:    WindowText;
+}
+
+.sort-table thead {
+  background: ButtonFace;
+}
+
+.sort-table td {
+  padding:  2px 5px;
+}
+
+.sort-table thead td {
+  border:     1px solid;
+  border-color: ButtonHighlight ButtonShadow
+          ButtonShadow ButtonHighlight;
+  cursor:     pointer;
+}
+
+.sort-table thead td:active {
+  border-color: ButtonShadow ButtonHighlight 
+          ButtonHighlight ButtonShadow;
+  padding:    3px 4px 1px 6px;
+}
+
+.sort-arrow {
+  width:          11px;
+  height:         11px;
+  background-position:  center center;
+  background-repeat:    no-repeat;
+  margin:         0 2px;
+}
+
+.sort-arrow.descending {
+  background-image:   url("../img/downsimple.png");
+  
+}
+
+.sort-arrow.ascending {
+  background-image:   url("../img/upsimple.png");
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/files.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/files.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/files.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,629 @@
+<?php
+/***********************************************************************
+** Title.........:    Insert File Dialog, File Manager
+** Version.......:    1.1
+** Authors.......:    Al Rashid <alrashid at klokan.sk>
+**                    Xiang Wei ZHUO <wei at zhuo.org>
+** URL...........:    http://alrashid.klokan.sk/insFile/
+** Filename......:    files.php
+** Last changed..:    23 July 2004
+***********************************************************************/
+  chdir('../../../../../../');
+  include_once('includes/configure.php');
+  include(DIR_FS_ADMIN.'includes/application_top.php'); // Needed for admin security
+
+require('config.inc.php');
+require('functions.php');
+
+//Reset auth variables
+
+$refresh_dirs = false;
+$clear_upload = false;
+$err = false;
+
+
+if (isset($_REQUEST['refresh'])) {
+        $refresh_dirs = true;
+}
+if (isset($_REQUEST['path'])) {
+        //$path = $_REQUEST['path'];
+        $path = checkName($_REQUEST['path']);
+        $path = unsanitize($path);
+        $path = pathSlashes($path);
+} else {
+        $path = '/';
+}
+
+$MY_PATH = $path;
+$MY_UP_PATH = substr($MY_PATH,0,strrpos(substr($MY_PATH,0,strlen($MY_PATH)-1),'/'))."/";
+//echo "PATH:".$MY_PATH;
+//echo "<br>UPP:".$MY_UP_PATH;
+
+function createFolder() {
+        global $MY_ALLOW_CREATE, $MY_MESSAGES, $MY_DOCUMENT_ROOT, $refresh_dirs;
+        global $MY_PATH;
+        if (!$MY_ALLOW_CREATE) return ($MY_MESSAGES['nopermtocreatefolder']);
+        if (!(is_dir($MY_DOCUMENT_ROOT.$MY_PATH))) return ($MY_MESSAGES['pathnotfound']);
+        if ( !isset($_REQUEST['file'])) return ($MY_MESSAGES['foldernamemissing']);
+        $Folder = checkName($_REQUEST['file']);
+        //$Folder = utf8RawUrlDecode($Folder);
+        $newFolder = $MY_DOCUMENT_ROOT.$MY_PATH.$Folder;
+        if (is_dir($newFolder)) return ($MY_MESSAGES['folderalreadyexists']);
+        $newFolder = unsanitize($newFolder);
+        if (!(@mkdir($newFolder,0755))) return ($MY_MESSAGES['mkdirfailed']);
+        chmod($newFolder,0755);
+        $refresh_dirs = true;
+        return false;
+}
+
+function deleteFile() {
+        $error = false;
+        global $MY_ALLOW_DELETE, $MY_MESSAGES, $MY_DOCUMENT_ROOT, $MY_PATH ;
+        if (!$MY_ALLOW_DELETE) return ($MY_MESSAGES['nopermtodelete']);
+        if (isset($_REQUEST['folders']) && is_array($_REQUEST['folders'])) {
+            foreach ($_REQUEST['folders'] as $folder) {
+                        $folder = unsanitize($folder);
+                        deldir($MY_DOCUMENT_ROOT.$MY_PATH.$folder);
+            }
+        }
+        if (isset($_REQUEST['files']) && is_array($_REQUEST['files'])) {
+            foreach ($_REQUEST['files'] as $file) {
+                        $file = unsanitize($file);
+                        $delFile = $MY_DOCUMENT_ROOT.$MY_PATH.$file;
+                        if (is_file($delFile)) {
+                                if (!(unlink($delFile))) $error = $error.'\n'.alertSanitize($MY_MESSAGES['unlinkfailed'].' ('.$delFile.')');
+                        } else {
+                                $error = $error.'\n'.alertSanitize($MY_MESSAGES['filenotfound'].' ('.$delFile.')');
+                        }
+            }
+        }
+        $refresh_dirs = true;
+        return $error;
+}
+
+function deldir($dir){
+ $current_dir = opendir($dir);
+ while (false !== ($entryname = readdir($current_dir))) {
+    if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!="..")){
+       deldir("${dir}/${entryname}");
+    }elseif($entryname != "." and $entryname!=".."){
+       unlink("${dir}/${entryname}");
+    }
+ }
+ closedir($current_dir);
+ rmdir($dir);
+}
+
+function renameFile() {
+        global $MY_ALLOW_RENAME, $MY_MESSAGES, $MY_DOCUMENT_ROOT, $MY_PATH, $refresh_dirs;
+        global $MY_ALLOW_EXTENSIONS, $MY_DENY_EXTENSIONS ;
+        $error = false;
+        if (!$MY_ALLOW_RENAME) return ($MY_MESSAGES['nopermtorename']);
+        if (isset($_REQUEST['folders']) && is_array($_REQUEST['folders'])) {
+            foreach ($_REQUEST['folders'] as $file) {
+                        $oldname = checkName(unsanitize($file['oldname']));
+                        $newname = checkName(unsanitize($file['newname']));
+                           $oldFile = $MY_DOCUMENT_ROOT.$MY_PATH.$oldname;
+                           $newFile = $MY_DOCUMENT_ROOT.$MY_PATH.$newname;
+                        if (is_dir($oldFile)) {
+                                if (is_dir($newFile)) {
+                                        $error = $error.'\n'.alertSanitize($MY_MESSAGES['folderalreadyexists'].' ('.$oldFile.' -> '.$newFile.')');
+                                } else {
+                                        if (!rename($oldFile, $newFile)) $error = $error.'\n'.alertSanitize($MY_MESSAGES['renamefailed'].' ('.$oldFile.' -> '.$newFile.')');
+                                }
+                        } else {
+                                $error = $error.'\n'.alertSanitize($MY_MESSAGES['foldernotfound'].' ('.$oldFile.')');
+                        }
+            }
+         }
+
+        if (isset($_REQUEST['files']) && is_array($_REQUEST['files'])) {
+            foreach ($_REQUEST['files'] as $file) {
+                        $oldname = checkName(unsanitize($file['oldname']));
+                        $newname = checkName(unsanitize($file['newname']));
+                        $parts = explode('.', $newname);
+                        $ext = strtolower($parts[count($parts)-1]);
+                        if (is_array($MY_DENY_EXTENSIONS )) {
+                                if (in_array($ext, $MY_DENY_EXTENSIONS)) $error = $error.'\n'.$MY_MESSAGES['extnotallowed'];
+                        }
+                        if (is_array($MY_ALLOW_EXTENSIONS )) {
+                                if (!in_array($ext, $MY_ALLOW_EXTENSIONS)) $error = $error.'\n'.$MY_MESSAGES['extnotallowed'];
+                        }
+                           $oldFile = $MY_DOCUMENT_ROOT.$MY_PATH.$oldname;
+                           $newFile = $MY_DOCUMENT_ROOT.$MY_PATH.$newname;
+                        if (is_file($oldFile)) {
+                                if (is_file($newFile)) {
+                                        $error = $error.'\n'.alertSanitize($MY_MESSAGES['filealreadyexists'].' ('.$oldFile.' -> '.$newFile.')');
+                                } else {
+                                        if (!rename($oldFile, $newFile)) $error = $error.'\n'.alertSanitize($MY_MESSAGES['renamefailed'].' ('.$oldFile.' -> '.$newFile.')');
+                                }
+                    } else {
+                                $error = $error.'\n'.alertSanitize($MY_MESSAGES['filenotfound'].' ('.$oldFile.')');
+                        }
+            }
+         }
+
+        $refresh_dirs = true;
+        return $error;
+}
+
+function moveFile() {
+        global $MY_ALLOW_MOVE, $MY_MESSAGES, $MY_DOCUMENT_ROOT, $MY_PATH, $refresh_dirs;
+        global $MY_ALLOW_EXTENSIONS, $MY_DENY_EXTENSIONS ;
+        $error = false;
+        if (!$MY_ALLOW_MOVE) return ($MY_MESSAGES['nopermtomove']);
+        $newPath = pathSlashes(checkName($_REQUEST['newpath']));
+         if (!(is_dir($MY_DOCUMENT_ROOT.$newPath))) return ($MY_MESSAGES['pathnotfound']);
+        if (isset($_REQUEST['folders']) && is_array($_REQUEST['folders'])) {
+            foreach ($_REQUEST['folders'] as $file) {
+                        $name = checkName(unsanitize($file));
+                      $oldFile = $MY_DOCUMENT_ROOT.$MY_PATH.$name;
+                      $newFile = $MY_DOCUMENT_ROOT.$newPath.$name;
+                        if (is_dir($oldFile)) {
+                            if (is_dir($newFile)) {
+                                        $error = $error.'\n'.alertSanitize($MY_MESSAGES['folderalreadyexists'].' ('.$oldFile.' -> '.$newFile.')');
+                                } else {
+                                        if (!rename($oldFile, $newFile)) $error = $error.'\n'.alertSanitize($MY_MESSAGES['renamefailed'].' ('.$oldFile.' -> '.$newFile.')');
+                                }
+                        } else {
+                                $error = $error.'\n'.alertSanitize($MY_MESSAGES['foldernotfound'].' ('.$oldFile.')');
+                        }
+            }
+         }
+        if (isset($_REQUEST['files']) && is_array($_REQUEST['files'])) {
+            foreach ($_REQUEST['files'] as $file) {
+                        $name = checkName(unsanitize($file));
+                           $oldFile = $MY_DOCUMENT_ROOT.$MY_PATH.$name;
+                           $newFile = $MY_DOCUMENT_ROOT.$newPath.$name;
+                        if (is_file($oldFile)) {
+                            if (is_file($newFile)) {
+                                        $error = $error.'\n'.alertSanitize($MY_MESSAGES['filealreadyexists'].' ('.$oldFile.' -> '.$newFile.')');
+                                } else {
+                                        if (!rename($oldFile, $newFile)) $error = $error.'\n'.alertSanitize($MY_MESSAGES['renamefailed'].' ('.$oldFile.' -> '.$newFile.')');
+                                }
+                        } else {
+                                $error = $error.'\n'.alertSanitize($MY_MESSAGES['filenotfound'].' ('.$oldFile.')');
+                        }
+            }
+         }
+        $refresh_dirs = true;
+        return $error;
+}
+
+function uploadFile() {
+        global $MY_ALLOW_UPLOAD, $MY_MESSAGES, $MY_DOCUMENT_ROOT, $MY_PATH, $clear_upload;
+        global $MY_ALLOW_EXTENSIONS, $MY_DENY_EXTENSIONS, $MY_MAX_FILE_SIZE ;
+        if (!$MY_ALLOW_UPLOAD) return ($MY_MESSAGES['nopermtoupload']);
+        if (!(is_dir($MY_DOCUMENT_ROOT.$MY_PATH))) return ($MY_MESSAGES['pathnotfound']);
+        $filename = checkName($_FILES['uploadFile']['name']);
+        $newFile = $MY_DOCUMENT_ROOT.$MY_PATH.$filename;
+        $parts = explode('.', $filename);
+        $ext = strtolower($parts[count($parts)-1]);
+        if (is_file($newFile))  return ($MY_MESSAGES['uploadfilealreadyexists']);
+        if (is_array($MY_DENY_EXTENSIONS )) {
+                if (in_array($ext, $MY_DENY_EXTENSIONS)) return ($MY_MESSAGES['extnotallowed']);
+        }
+        if (is_array($MY_ALLOW_EXTENSIONS )) {
+                if (!in_array($ext, $MY_ALLOW_EXTENSIONS)) return ($MY_MESSAGES['extnotallowed']);
+        }
+        if ($MY_MAX_FILE_SIZE) {
+                if ($_FILES['uploadFile']['size'] > $MY_MAX_FILE_SIZE) return ($MY_MESSAGES['filesizeexceedlimit'].' of '.($MY_MAX_FILE_SIZE/1024).'kB.');
+        }
+        if (!is_file($_FILES['uploadFile']['tmp_name']))  return ($MY_MESSAGES['filenotuploaded']);
+        move_uploaded_file($_FILES['uploadFile']['tmp_name'], $newFile);
+        chmod($newFile, 0666);
+        $clear_upload = true;
+        return false;
+}
+
+if (isset($_REQUEST['action'])) {
+        if ('delete' == $_REQUEST['action'])        $err = deleteFile();
+        if ('rename' == $_REQUEST['action'])        $err = renameFile();
+        if ('move' == $_REQUEST['action'])          $err = moveFile();
+        if ('createFolder' == $_REQUEST['action'])  $err = createFolder();
+}
+if (isset($_FILES['uploadFile']) && is_array($_FILES['uploadFile']))        $err = uploadFile();
+
+
+function parse_size($size) {
+        if($size < 1024)
+                return $size.' bytes';
+        else if($size >= 1024 && $size < 1024*1024) {
+                return sprintf('%01.2f',$size/1024.0).' KB';
+        } else {
+                return sprintf('%01.2f',$size/(1024.0*1024)).' MB';
+        }
+}
+
+function parse_time($timestamp) {
+        global $MY_DATETIME_FORMAT;
+        return date($MY_DATETIME_FORMAT, $timestamp);
+}
+
+
+function draw_no_results() {
+        global $MY_MESSAGES;
+        echo '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:Window;"> <tr>
+            <td><div align="center" style="font-size:large;font-weight:bold;color:#CCCCCC;font-family: Helvetica, sans-serif;">';
+        echo $MY_MESSAGES['nofiles'];
+        echo '</div></td></tr></table>';
+}
+
+function draw_no_dir() {
+        global $MY_MESSAGES;
+        global $MY_DOCUMENT_ROOT;
+        echo '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:Window;"><tr>
+            <td><div align="center" style="font-size:small;font-weight:bold;color:#CC0000;font-family: Helvetica, sans-serif;">';
+        echo $MY_MESSAGES['configproblem']." ".$MY_DOCUMENT_ROOT;
+        echo '</div></td></tr></table>';
+}
+
+?>
+<html>
+        <head>
+                <title>File Browser</title>
+                <?php
+                        echo '<meta http-equiv="content-language" content="'.$MY_LANG.'" />'."\n";
+                        echo '<meta http-equiv="Content-Type" content="text/html; charset='.$MY_CHARSET.'" />'."\n";
+                        echo '<meta name="author" content="AlRashid, www: http://alrashid.klokan.sk; mailto:alrashid at klokan.sk" />'."\n";
+                ?>
+
+                <style type="text/css">
+                        <!--
+                        body {
+                                font-family:        Verdana, Helvetica, Arial, Sans-Serif;
+                                font:        message-box;
+                                background:        ThreedFace;
+                        }
+                        code {
+                                font-size:        1em;
+                        }
+
+                        a {
+                                color: black;
+                        }
+
+                        a:visited {
+                                color: black;
+                        }
+                        .selected a {
+        background:        Highlight;
+        color:                HighlightText;
+                        }
+                        .selected a:visited {
+        background:        Highlight;
+        color:                HighlightText;
+                        }
+
+
+.selected {
+        background:        Highlight;
+        color:                HighlightText;
+}
+
+
+/*
+table {
+        border-collapse:        collapse;
+        border:                                1px solid ThreeDShadow;
+        border:                                1px solid;
+        border-color:                ThreeDShadow ThreeDHighLight
+                                                ThreeDHighLight ThreeDShadow;
+
+        background:                        Window;
+}
+*/
+td {
+        font:                                icon;
+        padding:                        2px 5px;
+        cursor:                                default;
+        -moz-user-select:        none;
+}
+                        -->
+                </style>
+        <link type="text/css" rel="StyleSheet" href="css/sortabletable.css" />
+        <script type="text/javascript" src="js/sortabletable.js"></script>
+        <script type="text/javascript" src="js/selectableelements.js"></script>
+        <script type="text/javascript" src="js/selectabletablerows.js"></script>
+
+
+        <script language="JavaScript" type="text/JavaScript">
+/*<![CDATA[*/
+
+function MM_findObj(n, d) { //v4.01
+  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
+    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
+  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
+  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
+  if(!x && d.getElementById) x=d.getElementById(n); return x;
+}
+
+function MM_showHideLayers() { //v6.0
+  var i,p,v,obj,args=MM_showHideLayers.arguments;
+  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i],window.top.document))!=null) { v=args[i+2];
+    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
+    obj.visibility=v; }
+}
+
+function changeLoadingStatus(state) {
+        var statusText = null;
+        if(state == 'load') {
+                statusText = '<?php echo $MY_MESSAGES['loading']; ?>';
+        }
+        else if(state == 'upload') {
+                statusText = '<?php echo $MY_MESSAGES['uploading']; ?>';
+        }
+        if(statusText != null) {
+                var obj = MM_findObj('loadingStatus', window.top.document);
+                if (obj != null && obj.innerHTML != null)
+                        obj.innerHTML = statusText;
+                MM_showHideLayers('loading','','show')
+        }
+}
+
+function changeDir(nb) {
+        changeLoadingStatus('load');
+        var postForm2 = document.getElementById('form2');
+        postForm2.elements["action"].value="changeDir";
+        postForm2.elements["path"].value=postForm2.elements["path"].value+folderJSArray[nb][1];
+        postForm2.submit();
+}
+
+function setSortBy(column, noclick) {
+        switch (column) {
+            case 0: st2.sort(4);
+                    if (noclick) st.sort(0);
+                                 break;
+                  case 2: st2.sort(5);
+                          if (noclick) st.sort(2);
+                                break;
+                case 3: st1.sort(6);
+                        st2.sort(6);
+                        if (noclick) st.sort(3);
+                        break;
+                default: st1.sort(1);
+                         st2.sort(1);
+                         if (noclick) st.sort(1);
+        }
+        var topDoc = window.top.document.forms[0];
+        topDoc.sortby.value = column;
+}
+
+function getSortBy() {
+        var topDoc = window.top.document.forms[0];
+        return (topDoc.sortby.value);
+}
+
+function fileSelected(filename, caption) {
+        var topDoc = window.top.document.forms[0];
+        topDoc.f_url.value = filename;
+        topDoc.f_caption.value = caption;
+}
+
+function updateDir() {
+        var newPath = "<?php echo $MY_PATH; ?>";
+        if(window.top.document.forms[0] != null) {
+                var allPaths = window.top.document.forms[0].path.options;
+                for(i=0; i<allPaths.length; i++)  {
+                        allPaths.item(i).selected = false;
+                        if((allPaths.item(i).value)==newPath) {
+                                allPaths.item(i).selected = true;
+                        }
+                }
+        }
+}
+
+<?php
+ if($clear_upload) {
+        echo '
+                var topDoc = window.top.document.forms[0];
+                topDoc.uploadFile.value = null;
+                ';
+}
+if ($refresh_dirs) { ?>
+function refreshDirs() {
+        var allPaths = window.top.document.forms[0].path.options;
+        var fields = ['/' <?php dirs($MY_DOCUMENT_ROOT,'');?>];
+        var newPath = '<?php echo sanitize($MY_PATH); ?>';
+         for(i = allPaths.length; i > 0; i--) {
+                        allPaths[i-1]=null;
+                }
+
+        for(i=0; i<fields.length; i++) {
+                var newElem =        document.createElement("OPTION");
+                var newValue = fields[i];
+                newElem.text = newValue;
+                newElem.value = newValue;
+                if(newValue == newPath)
+                        newElem.selected = true;
+                else
+                        newElem.selected = false;
+                allPaths.add(newElem);
+        }
+}
+refreshDirs();
+<?php
+}
+if ($err) {
+        echo 'alert(\''.$err.'\');';
+}
+ ?>
+
+
+        /*]]>*/
+</script>
+</head>
+<body onload="updateDir();">
+<form action="files.php?dialogname=<?php echo $MY_NAME; ?>&refresh=1" id="form2" name="form2" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="action" id="action" value="" />
+ <input type="hidden" name="path" id="path" value="<?php echo $MY_PATH; ?>" />
+ <input type="hidden" name="uppath" id="uppath" value="<?php echo $MY_UP_PATH; ?>" />
+ <input type="hidden" name="newpath" id="newpath" value="" />
+ <input type="hidden" name="file" id="file" value="" />
+</form>
+
+<?php
+$d = @dir($MY_DOCUMENT_ROOT.$MY_PATH);
+if($d) {
+        $t_header = '<table class="sort-table" id="tableHeader" cellspacing="0" width="100%"  border="0" >
+        <col />
+        <col />
+        <col style="text-align: right" />
+        <col />
+        <thead>
+                <tr>
+                        <td width="4%" id="sortmefirst" onclick="setSortBy(0, false);">'.$MY_MESSAGES['type'].'</td>
+                        <td width="50%" title="CaseInsensitiveString" onclick="setSortBy(1, false);">'.$MY_MESSAGES['name'].'</td>
+                        <td width="13%" onclick="setSortBy(2, false);">'.$MY_MESSAGES['size'].'</td>
+                        <td width="25%" onclick="setSortBy(3, false);">'.$MY_MESSAGES['datemodified'].'</td>
+                </tr>
+        </thead>
+        <tbody style="display: none;"  >
+                <tr>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                </tr>
+        </tbody>
+</table>
+';
+$t_folders = '<table class="sort-table" id="tableFolders" onselectstart="return false" cellspacing="0" width="100%" border="0" >
+        <col />
+        <col />
+        <col style="text-align: right" />
+        <col />
+        <col />
+        <col />
+        <col />
+        <thead style="display: none;">
+                <tr>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                </tr>
+        </thead>
+        <tbody>
+';
+        $t_files='<table class="sort-table" id="tableFiles" onselectstart="return false" cellspacing="0" width="100%" border="0" >
+        <col />
+        <col />
+        <col style="text-align: right" />
+        <col />
+        <col />
+        <col />
+        <col />
+        <thead style="display: none;">
+                <tr>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                </tr>
+        </thead>
+        <tbody>';
+
+
+        $entries_cnt = 0;
+        $fileNb=0;
+        $folderNb=0;
+        $fileJSArray='var fileJSArray = [';
+        $folderJSArray='var folderJSArray = [';
+        while (false !== ($entry = $d->read())) {
+                if(substr($entry,0,1) != '.') {
+                        $relativePath = $MY_PATH.$entry;
+                        $absolutePath = $MY_DOCUMENT_ROOT.$relativePath;
+                        if (is_dir($absolutePath)) {
+                                $entries_cnt++;
+                                $time = filemtime($absolutePath);
+                                $parsed_time = parse_time($time);
+                                $t_folders .= '<tr id="D'.$folderNb.'">
+                                <td width="4%"><img src="img/ext/folder_small.gif" width="16" height="16" border="0" alt="'.$entry.'" /></td>
+                                <td width="50%"><div style="height:15px; overflow:hidden;"><a href="javascript:changeDir('.$folderNb.');" title="'.$entry.'">'.$entry.'</a></div></td>
+                                <td width="18%" align="right">'.$MY_MESSAGES['folder'].'</td>
+                                <td width="25%">'.$parsed_time.'</td>
+                                <td width="0px" style="display: none;">&nbsp;</td>
+                                <td width="0px" style="display: none;">&nbsp;</td>
+                            <td width="0px" style="display: none;">'.$time.'</td>
+                                </tr>';
+                                $folderJSArray .= "['images/ext/folder_small.gif', '".sanitize($entry)."', '".$MY_MESSAGES['folder']."', '".$parsed_time."'],\n";
+                $folderNb++;
+                        } else {
+                                $entries_cnt++;
+                                $ext = substr(strrchr($entry, '.'), 1);
+                                if (is_array($MY_LIST_EXTENSIONS)) {
+                                                if (!in_array(strtolower($ext), $MY_LIST_EXTENSIONS)) continue;
+                                }
+                                $size = filesize($absolutePath);
+                                $time = filemtime($absolutePath);
+                                $parsed_size = parse_size($size);
+                                $parsed_time = parse_time($time);
+                                $parsed_icon = 'img/ext/'.parse_icon($ext);
+                                $t_files .= '<tr id="F'.$fileNb++.'">
+                                <td width="4%"><img src="'.$parsed_icon.'" width="16" height="16" border="0" alt="'.$entry.'" /></td>
+                                <td width="50%"><div style="height:15px; overflow:hidden;"><a href="javascript:;" onClick="javascript:fileSelected(\''.$MY_BASE_URL.$relativePath.'\',\''.$entry.'\');">'.$entry.'</div></td>
+                                <td width="18%" align="right">'.$parsed_size.'</td>
+                                <td width="25%">'.$parsed_time.'</td>
+                                <td width="0px" style="display: none;">'.$ext.'</td>
+                                <td width="0px" style="display: none;">'.$size.'</td>
+                                <td width="0px" style="display: none;">'.$time.'</td>
+                                </tr>';
+                                $fileJSArray .= "['".$parsed_icon."', '".sanitize($entry)."', '".$parsed_size."', '".$parsed_time."'],\n";
+                        }
+                }
+        }
+        $d->close();
+        $folderJSArray .= "['', '', '', '']];\n";
+        $fileJSArray .= "['', '', '', '']];\n";
+
+
+        $t_folders .= '</tbody> </table>';
+        $t_files .= '</tbody> </table>';
+
+
+        if ($entries_cnt) {
+                echo $t_header."\n<div style=\"height:90%; overflow: auto; overflow-y: scroll; background-color:window;\">".$t_folders."\n".$t_files."</div>"."\n";
+?>
+
+<script type="text/javascript">
+        /*<![CDATA[*/
+        var st = new SortableTable(document.getElementById("tableHeader"), ["CaseInsensitiveString", "CaseInsensitiveString", "Number", "Number"]);
+        var st1 = new SortableTable(document.getElementById("tableFolders"), ["None", "CaseInsensitiveString", "None", "None", "CaseInsensitiveString", "Number", "Number"]);
+        var st2 = new SortableTable(document.getElementById("tableFiles"), ["None", "CaseInsensitiveString", "None", "None", "CaseInsensitiveString", "Number", "Number"]);
+        var sta = new SelectableTableRows(document.getElementById("tableFolders"), true);
+        var stb = new SelectableTableRows(document.getElementById("tableFiles"), true);
+
+        var colmn = parseInt(getSortBy());
+        setSortBy(colmn, true);
+        <?php
+                echo $folderJSArray;
+                echo $fileJSArray;
+         ?>
+        /*]]>*/
+</script>
+<?php
+        } else {
+        draw_no_results();
+        }
+}
+else
+{
+ draw_no_dir();
+}
+
+?>
+
+<script language="JavaScript" type="text/JavaScript">
+/*<![CDATA[*/
+        MM_showHideLayers('loading','','hide')
+/*]]>*/
+</script>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/functions.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/functions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/functions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/***********************************************************************
+** Title.........:    Insert File Dialog, File Manager
+** Version.......:    1.1
+** Authors.......:    Al Rashid <alrashid at klokan.sk>
+**                    Xiang Wei ZHUO <wei at zhuo.org>
+** Filename......:    functions.php
+** URL...........:    http://alrashid.klokan.sk/insFile/
+** Last changed..:    23 July 2004
+***********************************************************************/
+
+
+function dirs($dir,$abs_path) {
+        $d = dir($dir);
+        $dirs = array();
+        while (false !== ($entry = $d->read())) {
+                if(is_dir($dir.'/'.$entry) && substr($entry,0,1) != '.')  {
+                        $path['path'] = $dir.'/'.$entry;
+                        $path['name'] = $entry;
+                        $dirs[$entry] = $path;
+                }
+        }
+        $d->close();
+        ksort($dirs);
+        $cntDir = count($dirs);
+        for($i=0; $i<$cntDir; $i++) {
+                $name = key($dirs);
+                $current_dir = $abs_path.'/'.$dirs[$name]['name'];
+                echo ", '".sanitize($current_dir)."/'\n";
+                dirs($dirs[$name]['path'],$current_dir);
+                next($dirs);
+        }
+}
+
+function checkName($name) {
+        $name = str_replace('../', '', $name);
+        $name = str_replace('./', '', $name);
+        return $name;
+}
+function sanitize($name) {
+        return str_replace("'", "\'", $name);
+}
+
+function unsanitize($name) {
+        return str_replace("\'", "'", $name);
+}
+
+function pathSlashes($path) {
+        if ('/' != substr($path,0,1)) $path =  '/'.$path;
+        if ('/' != substr($path,-1,1)) $path = $path.'/';
+        return $path;
+}
+function alertSanitize($path) {
+        return ( sanitize(str_replace("\\", "\\\\", $path)) );
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/blank.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/blank.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_Corner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_Corner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_create.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_create.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_move.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_move.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_open.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_open.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_rename.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_rename.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/btn_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/downsimple.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/downsimple.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/binary_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/binary_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/def_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/def_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/doc_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/doc_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/folder_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/folder_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/gif_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/gif_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/gz_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/gz_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/html_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/html_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/image_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/image_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/jpg_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/jpg_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/mov_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/mov_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/no_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/no_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/pdf_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/pdf_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/png_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/png_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/ppt_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/ppt_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/rar_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/rar_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/script_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/script_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/sound_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/sound_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/txt_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/txt_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/xls_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/xls_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/zip_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/ext/zip_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/unlocked.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/unlocked.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/upsimple.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/img/upsimple.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/insert_file.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/insert_file.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/insert_file.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,561 @@
+<?php
+/***********************************************************************
+** Title.........:    Insert File Dialog, File Manager
+** Version.......:    1.1
+** Authors.......:    Al Rashid <alrashid at klokan.sk>
+**                    Xiang Wei ZHUO <wei at zhuo.org>
+** Filename......:    insert_file.php
+** URL...........:    http://alrashid.klokan.sk/insFile/
+** Last changed..:    23 July 2004
+***********************************************************************/
+  chdir('../../../../../../');
+  include_once('includes/configure.php');
+  include(DIR_FS_ADMIN.'includes/application_top.php'); // Needed for admin security
+  
+require('config.inc.php');
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+        <head>
+        <title>Insert File</title>
+        <?php
+                echo '<META HTTP-EQUIV="Pragma" CONTENT="no-cache">'."\n";
+                echo '<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">'."\n";
+                echo '<META HTTP-EQUIV="Expires" CONTENT="Fri, Oct 24 1976 00:00:00 GMT">'."\n";
+                echo '<meta http-equiv="content-language" content="'.$MY_LANG.'" />'."\n";
+                echo '<meta http-equiv="Content-Type" content="text/html; charset='.$MY_CHARSET.'" />'."\n";
+                echo '<meta name="author" content="AlRashid, www: http://alrashid.klokan.sk; mailto:alrashid at klokan.sk" />'."\n";
+//        <script type="text/javascript" src="../../popups/popup.js"></script>
+//        <script type="text/javascript" src="../../dialog.js"></script>
+        ?>
+        <script type="text/javascript" src="js/popup.js"></script>
+        <script type="text/javascript" src="js/dialog.js"></script>
+        <script language="javascript" src="../../../tiny_mce_popup.js"></script>
+        <style type="text/css">
+                body { padding: 5px; }
+                table {
+                  font: 11px Tahoma,Verdana,sans-serif;
+                }
+                form p {
+                  margin-top: 5px;
+                  margin-bottom: 5px;
+                }
+                fieldset { padding: 0px 10px 5px 5px; }
+                select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+                button { width: 70px; }
+
+                .title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+                border-bottom: 1px solid black; letter-spacing: 2px;
+                }
+                form { padding: 0px; margin: 0px; }
+                a { padding: 2px; border: 1px solid ButtonFace;        }
+                a img        { border: 0px; vertical-align:bottom; }
+                a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; }
+
+        </style>
+
+        <script language="JavaScript" type="text/JavaScript">
+        /*<![CDATA[*/
+                var preview_window = null;
+                var resize_iframe_constant = 150;
+                <?php
+                if (is_array($MY_DENY_EXTENSIONS)) {
+                        echo 'var DenyExtensions = [';
+                        foreach($MY_DENY_EXTENSIONS as $value) echo '"'.$value.'", ';
+                        echo '""];
+                        ';
+                }
+                if (is_array($MY_ALLOW_EXTENSIONS)) {
+                        echo 'var AllowExtensions = [';
+                        foreach($MY_ALLOW_EXTENSIONS as $value) echo '"'.$value.'", ';
+                        echo '""];
+                        ';
+                }
+                ?>
+
+                function Init() {
+                };
+
+                function onOK() {
+                         if (window.opener) {
+                         var required = {
+                         "f_url": "You must enter the URL",
+                         "f_caption": "Please enter the caption text"
+                         };
+                        for (var i in required) {
+                              var el = MM_findObj(i);
+                              if (!el.value) {
+                              alert(required[i]);
+                              el.focus();
+                              return false;
+                        }
+                }
+
+                        var myPath = fileManager.document.getElementById('form2').elements["path"].value;
+                        var fileItems = fileManager.stb.getSelectedItems();
+                        var fileItemsLength = fileItems.length;
+                        var returnFiles = new Array();
+
+                        for (var i=0; i<fileItemsLength; i++) {
+                                        var strId = fileItems[i].getAttribute("id").toString();
+                                        var trId = parseInt(strId.substring(1, strId.length));
+                                        returnFiles[i] = new Array();
+                                        returnFiles[i][0] = fileManager.fileJSArray[trId][0];
+                                        returnFiles[i][1] = fileManager.fileJSArray[trId][1];
+                                        returnFiles[i][2] = fileManager.fileJSArray[trId][2];
+                                        returnFiles[i][3] = fileManager.fileJSArray[trId][3];
+                        }
+
+                var formObj = document.forms[0];
+                   var base_path = '<?php echo $MY_BASE_URL; ?>';
+                   var files      = returnFiles;
+                   var path       = base_path+myPath;
+                   editor_url   = tinyMCE.baseURL;
+                   plugin_url = "/plugins/filemanager/InsertFile/";
+
+                   var f_url = formObj.f_url.value;
+                   var f_caption = formObj.f_caption.value;
+
+               for (var k in files){
+                        var fileValues = files[k];
+                        var f_icon = editor_url+plugin_url+fileValues[0];
+                        var f_size = fileValues[2];
+                        var f_date = fileValues[3];
+               }
+
+                var icon = "";
+                var caption = "";
+
+                if (formObj.f_addicon.checked==true) {
+                        icon = '<img src="' + f_icon + '" alt="' + f_caption + '">&nbsp;';
+                }
+                if (formObj.f_addsize.checked==true || formObj.f_adddate.checked==true) caption = caption + ' (';
+                if (formObj.f_addsize.checked==true) caption = caption + f_size;
+                if (formObj.f_adddate.checked==true) caption = caption + ' ' + f_date;
+                if (formObj.f_addsize.checked==true || formObj.f_adddate.checked==true) caption = caption + ') ';
+                alink = icon + '<a href="' + f_url + '">' + f_caption + '</a>' + caption;
+
+                        tinyMCE.execCommand("mceInsertContent",true,alink);
+                        top.close();
+                }
+
+        };
+
+                function onCancel() {
+                  top.close();
+                  return false;
+                };
+
+                function changeDir(selection) {
+                        changeLoadingStatus('load');
+                        var newDir = selection.options[selection.selectedIndex].value;
+                        var postForm2 = fileManager.document.getElementById('form2');
+                        postForm2.elements["action"].value="changeDir";
+                        postForm2.elements["path"].value=newDir;
+                        postForm2.submit();
+                }
+
+                function goUpDir() {
+                        var selection = document.forms[0].path;
+                        var dir = selection.options[selection.selectedIndex].value;
+                        if(dir != '/'){
+                            changeLoadingStatus('load');
+                                var postForm2 = fileManager.document.getElementById('form2');
+                                postForm2.elements["action"].value="changeDir";
+                                postForm2.elements["path"].value=postForm2.elements["uppath"].value;
+                                postForm2.submit();
+                        }
+                }
+
+                function newFolder() {
+                        var selection = document.forms[0].path;
+                        var path = selection.options[selection.selectedIndex].value;
+                        var folder = prompt('<?php echo $MY_MESSAGES['newfolder']; ?>','');
+                        if (folder) {
+                            changeLoadingStatus('load');
+                                var postForm2 = fileManager.document.getElementById('form2');
+                                postForm2.elements["action"].value="createFolder";
+                                postForm2.elements["file"].value=folder;
+                                postForm2.submit();
+                        }
+                        return false
+                }
+
+                function deleteFile() {
+                        var folderItems = fileManager.sta.getSelectedItems();
+                        var folderItemsLength = folderItems.length;
+                        var fileItems = fileManager.stb.getSelectedItems();
+                        var fileItemsLength = fileItems.length;
+                        var message = "<?php echo $MY_MESSAGES['delete']; ?>";
+            if ((folderItemsLength == 0) && (fileItemsLength == 0)) return false;
+                        if (folderItemsLength > 0) {
+                                message = message + " " + folderItemsLength + " " + "<?php echo $MY_MESSAGES['folders']; ?>";
+                        }
+                        if (fileItemsLength > 0) {
+                                message = message + " " + fileItemsLength + " " + "<?php echo $MY_MESSAGES['files']; ?>";
+                        }
+                        if (confirm(message+" ?")) {
+                                var postForm2 = fileManager.document.getElementById('form2');
+                                for (var i=0; i<folderItemsLength; i++) {
+                                        var strId = folderItems[i].getAttribute("id").toString();
+                                        var trId = parseInt(strId.substring(1, strId.length));
+                                           var i_field = fileManager.document.createElement('INPUT');
+                                        i_field.type = 'hidden';
+                                        i_field.name = 'folders[' + i.toString() + ']';
+                                          i_field.value = fileManager.folderJSArray[trId][1];
+                                        postForm2.appendChild(i_field);
+                                }
+                                for (var i=0; i<fileItemsLength; i++) {
+                                        var strId = fileItems[i].getAttribute("id").toString();
+                                        var trId = parseInt(strId.substring(1, strId.length));
+                                           var i_field = fileManager.document.createElement('INPUT');
+                                        i_field.type = 'hidden';
+                                        i_field.name = 'files[' + i.toString() + ']';
+                                          i_field.value = fileManager.fileJSArray[trId][1];
+                                        postForm2.appendChild(i_field);
+                                }
+                                changeLoadingStatus('load');
+                                postForm2.elements["action"].value="delete";
+                                postForm2.submit();
+                        }
+                }
+
+                function renameFile() {
+                        var folderItems = fileManager.sta.getSelectedItems();
+                        var folderItemsLength = folderItems.length;
+                        var fileItems = fileManager.stb.getSelectedItems();
+                        var fileItemsLength = fileItems.length;
+                        var postForm2 = fileManager.document.getElementById('form2');
+                        if ((folderItemsLength == 0) && (fileItemsLength == 0)) return false;
+                        if (!confirm('<?php echo $MY_MESSAGES['renamewarning']; ?>')) return false;
+                        for (var i=0; i<folderItemsLength; i++) {
+                                var strId = folderItems[i].getAttribute("id").toString();
+                                var trId = parseInt(strId.substring(1, strId.length));
+                var newname = prompt('<?php echo $MY_MESSAGES['renamefolder']; ?>', fileManager.folderJSArray[trId][1]);
+                                if (!newname) continue;
+                                if (!newname == fileManager.folderJSArray[trId][1]) continue;
+                                var i_field = fileManager.document.createElement('INPUT');
+                                i_field.type = 'hidden';
+                                i_field.name = 'folders[' + i.toString() + '][oldname]';
+                                  i_field.value = fileManager.folderJSArray[trId][1];
+                                postForm2.appendChild(i_field);
+                                var ii_field = fileManager.document.createElement('INPUT');
+                                ii_field.type = 'hidden';
+                                ii_field.name = 'folders[' + i.toString() + '][newname]';
+                                  ii_field.value = newname;
+                                postForm2.appendChild(ii_field);
+                        }
+                        for (var i=0; i<fileItemsLength; i++) {
+                                var strId = fileItems[i].getAttribute("id").toString();
+                                var trId = parseInt(strId.substring(1, strId.length));
+                                var        newname = getNewFileName(fileManager.fileJSArray[trId][1]);
+                                if (!newname) continue;
+                                if (newname == fileManager.fileJSArray[trId][1]) continue;
+                                   var i_field = fileManager.document.createElement('INPUT');
+                                i_field.type = 'hidden';
+                                i_field.name = 'files[' + i.toString() + '][oldname]';
+                                  i_field.value = fileManager.fileJSArray[trId][1];
+                                postForm2.appendChild(i_field);
+                                var ii_field = fileManager.document.createElement('INPUT');
+                                ii_field.type = 'hidden';
+                                ii_field.name = 'files[' + i.toString() + '][newname]';
+                                  ii_field.value = newname;
+                                postForm2.appendChild(ii_field);
+                        }
+                        changeLoadingStatus('load');
+                        postForm2.elements["action"].value="rename";
+                        postForm2.submit();
+                   }
+
+                function moveFile() {
+                        var folderItems = fileManager.sta.getSelectedItems();
+                        var folderItemsLength = folderItems.length;
+                        var fileItems = fileManager.stb.getSelectedItems();
+                        var fileItemsLength = fileItems.length;
+                        var postForm2 = fileManager.document.getElementById('form2');
+                        if ((folderItemsLength == 0) && (fileItemsLength == 0)) return false;
+                        if (!confirm('<?php echo $MY_MESSAGES['renamewarning']; ?>')) return false;
+                        var postForm2 = fileManager.document.getElementById('form2');
+                        Dialog("move.php", function(param) {
+                                if (!param) // user must have pressed Cancel
+                                        return false;
+                                else {
+                                    postForm2.elements["newpath"].value=param['newpath'];
+                                    moveFiles();
+                                }
+                        }, null);
+                }
+
+        function moveFiles() {
+                        var folderItems = fileManager.sta.getSelectedItems();
+                        var folderItemsLength = folderItems.length;
+                        var fileItems = fileManager.stb.getSelectedItems();
+                        var fileItemsLength = fileItems.length;
+                        var postForm2 = fileManager.document.getElementById('form2');
+                        for (var i=0; i<folderItemsLength; i++) {
+                                var strId = folderItems[i].getAttribute("id").toString();
+                                var trId = parseInt(strId.substring(1, strId.length));
+                                   var i_field = fileManager.document.createElement('INPUT');
+                                i_field.type = 'hidden';
+                                i_field.name = 'folders[' + i.toString() + ']';
+                                  i_field.value = fileManager.folderJSArray[trId][1];
+                                postForm2.appendChild(i_field);
+                        }
+                        for (var i=0; i<fileItemsLength; i++) {
+                                var strId = fileItems[i].getAttribute("id").toString();
+                                var trId = parseInt(strId.substring(1, strId.length));
+                                var i_field = fileManager.document.createElement('INPUT');
+                                i_field.type = 'hidden';
+                                i_field.name = 'files[' + i.toString() + ']';
+                                  i_field.value = fileManager.fileJSArray[trId][1];
+                                postForm2.appendChild(i_field);
+                        }
+                        changeLoadingStatus('load');
+                        postForm2.elements["action"].value="move";
+                        postForm2.submit();
+                }
+
+                function openFile() {
+                        var urlPrefix = "<?php echo $MY_URL_TO_OPEN_FILE; ?>";
+                        var myPath = fileManager.document.getElementById('form2').elements["path"].value;
+                        var folderItems = fileManager.sta.getSelectedItems();
+                        var folderItemsLength = folderItems.length;
+                        var fileItems = fileManager.stb.getSelectedItems();
+                        var fileItemsLength = fileItems.length;
+
+                        for (var i=0; i<folderItemsLength; i++) {
+                                var strId = folderItems[i].getAttribute("id").toString();
+                                var trId = parseInt(strId.substring(1, strId.length));
+                            window.open(urlPrefix+myPath+fileManager.folderJSArray[trId][1],'','');
+                          }
+                        for (var i=0; i<fileItemsLength; i++) {
+                                var strId = fileItems[i].getAttribute("id").toString();
+                                var trId = parseInt(strId.substring(1, strId.length));
+                                  window.open(urlPrefix+myPath+fileManager.fileJSArray[trId][1],'','');
+                        }
+                }
+
+                function doUpload() {
+                        var isOK = 1;
+                        var fileObj = document.forms[0].uploadFile;
+                        if (fileObj == null) return false;
+
+                        newname = fileObj.value;
+                        isOK = checkExtension(newname);
+                        if (isOK == -2) {
+                                 alert('<?php echo $MY_MESSAGES['extnotallowed']; ?>');
+                                 return false;
+                        }
+                        if (isOK == -1) {
+                                alert('<?php echo $MY_MESSAGES['extmissing']; ?>');
+                                return false;
+                        }
+                        changeLoadingStatus('upload');
+                }
+
+                function checkExtension(name) {
+                        var regexp = /\/|\\/;
+                        var parts = name.split(regexp);
+                        var filename = parts[parts.length-1].split(".");
+                        if (filename.length <= 1) {
+                                return(-1);
+                        }
+                        var ext = filename[filename.length-1].toLowerCase();
+
+                        for (i=0; i<DenyExtensions.length; i++) {
+                                if (ext == DenyExtensions[i]) return(-2);
+                        }
+                        for (i=0; i<AllowExtensions.length; i++) {
+                                if (ext == AllowExtensions[i])        return(1);
+                        }
+                        return(-2);
+                }
+
+                function getNewFileName(name) {
+                        var isOK = 1;
+                        var newname='';
+                        do {
+                                newname = prompt('<?php echo $MY_MESSAGES['renamefile']; ?>', name);
+                                if (!newname) return false;
+                                isOK = checkExtension(newname);
+                                if (isOK == -2) alert('<?php echo $MY_MESSAGES['extnotallowed']; ?>');
+                                if (isOK == -1) alert('<?php echo $MY_MESSAGES['extmissing']; ?>');
+                        } while (isOK != 1);
+                          return(newname);
+                }
+
+                function selectFolder() {
+                        Dialog("move.php", function(param) {
+                                if (!param) // user must have pressed Cancel
+                                        return false;
+                                else {
+                                        var postForm2 = fileManager.document.getElementById('form2');
+                                        postForm2.elements["newpath"].value=param['newpath'];
+                                }
+                        }, null);
+
+                }
+
+                function refreshPath(){
+                        var selection = document.forms[0].path;
+                        changeDir(selection);
+                }
+
+                function winH() {
+                   if (window.innerHeight)
+                      return window.innerHeight;
+                   else if
+                   (document.documentElement &&
+                   document.documentElement.clientHeight)
+                      return document.documentElement.clientHeight;
+                   else if
+                   (document.body && document.body.clientHeight)
+                      return document.body.clientHeight;
+                   else
+                      return null;
+                }
+
+                function resize_iframe() {
+                        document.getElementById("fileManager").height=winH()-resize_iframe_constant;//resize the iframe according to the size of the window
+                }
+
+                function MM_findObj(n, d) { //v4.01
+                  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
+                    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
+                  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
+                  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
+                  if(!x && d.getElementById) x=d.getElementById(n); return x;
+                }
+
+                function MM_showHideLayers() { //v6.0
+                  var i,p,v,obj,args=MM_showHideLayers.arguments;
+                  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
+                    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
+                    obj.visibility=v; }
+                }
+
+                function changeLoadingStatus(state) {
+                        var statusText = null;
+                        if(state == 'load') {
+                                statusText = '<?php echo $MY_MESSAGES['loading']; ?> ';
+                        }
+                        else if(state == 'upload') {
+                                statusText = '<?php echo $MY_MESSAGES['uploading']; ?>';
+                        }
+                        if(statusText != null) {
+                                var obj = MM_findObj('loadingStatus');
+                                if (obj != null && obj.innerHTML != null)
+                                        obj.innerHTML = statusText;
+                                MM_showHideLayers('loading','','show')
+                        }
+                }
+
+         /*]]>*/
+        </script>
+</head>
+<body onload="Init();">
+                <div class="title"><img src="../images/filemanager.gif" border="0" align="absmiddle">
+                        <?php echo $MY_MESSAGES['insertfile']; ?>
+                </div>
+                <form action="files.php?dialogname=<?php echo $MY_NAME; ?>" name="form1" method="post" target="fileManager" enctype="multipart/form-data">
+                        <div id="loading" style="position:absolute; left:200px; top:130px; width:184px; height:48px; z-index:1" class="statusLayer">
+                                <div id= "loadingStatus" align="center" style="font-size:large;font-weight:bold;color:#CCCCCC;font-family: Helvetica, sans-serif; z-index:2;  ">
+                                <?php echo $MY_MESSAGES['loading']; ?>
+                                </div>
+                        </div>
+                          <fieldset>
+                                <legend>
+                                        <?php
+                                        echo $MY_MESSAGES['filemanager'];
+                                        echo '<span style="font-size:x-small; "> - '.$MY_MESSAGES['ctrlshift'].'</span>';
+                                        ?>
+                                </legend>
+                                <div style="margin:5px;">
+                                        <label for="path">
+                                                <?php echo $MY_MESSAGES['directory']; ?>
+                                        </label>
+                                          <select name="path" id="path" style="width:35em" onChange="changeDir(this)">
+                                                  <option value="/">/</option>
+                                        </select>
+
+                                        <?php
+                                                echo '<a href="#" onClick="javascript:goUpDir();"><img src="img/btn_up.gif" width="18" height="18" border="0" title="'.$MY_MESSAGES['up'].'" /></a>';
+                                                if ($MY_ALLOW_CREATE) {
+                                                        echo '<a href="#" onClick="javascript:newFolder();"><img src="img/btn_create.gif"  width="18" height="18" border="0" title="'.$MY_MESSAGES['newfolder'].'" /></a>';
+                                                }
+                                                if ($MY_ALLOW_DELETE) {
+                                                        echo '<a href="#" onClick="javascript:deleteFile();"><img src="img/btn_delete.gif" width="18" height="18" border="0" title="'.$MY_MESSAGES['delete'].'" /></a>';
+                                                }
+                                                if ($MY_ALLOW_RENAME) {
+                                                        echo '<a href="#" onClick="javascript:renameFile();"><img src="img/btn_rename.gif" width="18" height="18" border="0" title="'.$MY_MESSAGES['rename'].'" /></a>';
+                                                }
+                                                if ($MY_ALLOW_MOVE) {
+                                                        echo '<a href="#" onClick="javascript:moveFile();"><img src="img/btn_move.gif" width="18" height="18" border="0" title="'.$MY_MESSAGES['move'].'" /></a>';
+                                                }
+                                                echo '<a href="#" onClick="javascript:openFile();"><img src="img/btn_open.gif"  width="18" height="18" border="0" title="'.$MY_MESSAGES['openfile'].'" /></a>';
+
+                                     ?>
+
+                                                        <input id="sortby" type="hidden" value="0" />
+                                </div>
+
+                                <div style="margin:5px;">
+                                <!--
+                                        <iframe src="files.php?dialogname=<?php echo $MY_NAME; ?>&amp;refresh=1" name="fileManager" id="fileManager" background: Window;" marginwidth="0" marginheight="0" align="top" scrolling="no" frameborder="0" hspace="0" vspace="0" width="100%"></iframe>
+                                        -->
+                                   <iframe src="files.php?dialogname=<?php echo $MY_NAME; ?>&amp;refresh=1" name="fileManager" id="fileManager" background="Window" marginwidth="0" marginheight="0" valign:"top" scrolling="no" frameborder="0" hspace="0" vspace="0" width="600px" height="250px" style="background-color: Window; margin:0px; padding:0px; border:0px; vertical-align:top;"></iframe>
+                                </div>
+      <table border="0" align="center" cellpadding="2" cellspacing="2">
+          <tr>
+            <td nowrap><div align="right">URL</div></td>
+            <td><input name="url" id="f_url" type="text" style="width:20em" size="30"></td>
+            <td nowrap><div align="right">Caption</div></td>
+            <td><input name="caption" id="f_caption" type="text" style="width:20em" size="30"></td>
+          </tr>
+      </table>
+          <table border="0" align="center" cellpadding="2" cellspacing="2">
+          <tr>
+            <td>
+             <input id="f_addicon" value="f_addicon" type="checkbox">
+            </td><td>
+                                <div align="left">Insert filetype icon</div>
+                        </td>
+                       <td>
+                               <input id="f_addsize" value="f_addsize" type="checkbox">
+            </td><td>
+                                <div align="left">Insert file size</div>
+                        </td>
+                       <td>
+                               <input id="f_adddate" value="f_adddate" type="checkbox">
+            </td><td>
+                                <div align="left">Insert file modification date</div>
+                        </td>
+                  </tr>
+      </table>
+                                <div style="text-align:center; padding:2px;">
+                    <?php
+                                if ($MY_ALLOW_UPLOAD) {
+                        ?>
+                                        <label for="uploadFile">
+                                        <?php echo $MY_MESSAGES['upload']; ?>
+                                        </label>
+                                           <input name="uploadFile" type="file" id="uploadFile" size="72" />
+                            <input type="submit" style="width:5em" value="<?php echo $MY_MESSAGES['upload']; ?>" onClick="javascript:return doUpload();" />
+                    <?php
+                                 }
+                        ?>
+                                </div>
+                    </fieldset>
+
+                         <div style="text-align: right; margin-top:5px;">
+                                  <input type="button" name="refresh" value="Refresh" onclick="return refreshPath();">
+                                  <input type="button" name="cancel" value="Cancel" onclick="return onCancel();">
+                                  <input type="reset" name="reset" value="Reset">
+                                  <input type="button" name="ok" value="OK" onclick="return onOK();">
+                     </div>
+                     <div style="position:absolute; bottom:-5px; right:-3px;">
+                                 <img src="img/btn_Corner.gif" width="14" height="14" border="0" alt="" />
+                           </div>
+                </form>
+        </body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/dialog.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/dialog.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/dialog.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,111 @@
+// Dialog v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+//   http://dynarch.com/mishoo
+//
+// $Id: dialog.js 26 2004-03-31 02:35:21Z Wei Zhuo $
+
+// Though "Dialog" looks like an object, it isn't really an object.  Instead
+// it's just namespace for protecting global symbols.
+
+function Dialog(url, action, init) {
+  if (typeof init == "undefined") {
+    init = window;  // pass this window object by default
+  }
+  Dialog._geckoOpenModal(url, action, init);
+};
+
+Dialog._parentEvent = function(ev) {
+  setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
+  if (Dialog._modal && !Dialog._modal.closed) {
+    Dialog._stopEvent(ev);
+  }
+};
+
+
+// should be a function, the return handler of the currently opened dialog.
+Dialog._return = null;
+
+// constant, the currently opened dialog
+Dialog._modal = null;
+
+// the dialog will read it's args from this variable
+Dialog._arguments = null;
+
+Dialog._geckoOpenModal = function(url, action, init) {
+  //var urlLink = "hadialog"+url.toString();
+  var myURL = "hadialog"+url;
+  var regObj = /\W/g;
+  myURL = myURL.replace(regObj,'_');
+  var dlg = window.open(url, myURL,
+            "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
+            "scrollbars=no,resizable=yes,modal=yes,dependable=yes");
+  Dialog._modal = dlg;
+  Dialog._arguments = init;
+
+  // capture some window's events
+  function capwin(w) {
+    Dialog._addEvent(w, "click", Dialog._parentEvent);
+    Dialog._addEvent(w, "mousedown", Dialog._parentEvent);
+    Dialog._addEvent(w, "focus", Dialog._parentEvent);
+  };
+  // release the captured events
+  function relwin(w) {
+    Dialog._removeEvent(w, "click", Dialog._parentEvent);
+    Dialog._removeEvent(w, "mousedown", Dialog._parentEvent);
+    Dialog._removeEvent(w, "focus", Dialog._parentEvent);
+  };
+  capwin(window);
+  // capture other frames
+  for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+  // make up a function to be called when the Dialog ends.
+  Dialog._return = function (val) {
+    if (val && action) {
+      action(val);
+    }
+    relwin(window);
+    // capture other frames
+    for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+    Dialog._modal = null;
+  };
+};
+
+
+// event handling
+
+Dialog._addEvent = function(el, evname, func) {
+  if (Dialog.is_ie) {
+    el.attachEvent("on" + evname, func);
+  } else {
+    el.addEventListener(evname, func, true);
+  }
+};
+
+
+Dialog._removeEvent = function(el, evname, func) {
+  if (Dialog.is_ie) {
+    el.detachEvent("on" + evname, func);
+  } else {
+    el.removeEventListener(evname, func, true);
+  }
+};
+
+
+Dialog._stopEvent = function(ev) {
+  if (Dialog.is_ie) {
+    ev.cancelBubble = true;
+    ev.returnValue = false;
+  } else {
+    ev.preventDefault();
+    ev.stopPropagation();
+  }
+};
+
+Dialog.agt = navigator.userAgent.toLowerCase();
+Dialog.is_ie     = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1));

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/functions.js
===================================================================

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/popup.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/popup.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/popup.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,123 @@
+// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+//   http://dynarch.com/mishoo
+//
+// $Id: popup.js 26 2004-03-31 02:35:21Z Wei Zhuo $
+
+// Slightly modified for the ImageManager, window resizing is done only
+// by each window's script. Added translation for a few other HTML elements.
+
+function getAbsolutePos(el) {
+  var r = { x: el.offsetLeft, y: el.offsetTop };
+  if (el.offsetParent) {
+    var tmp = getAbsolutePos(el.offsetParent);
+    r.x += tmp.x;
+    r.y += tmp.y;
+  }
+  return r;
+};
+
+function comboSelectValue(c, val) {
+  var ops = c.getElementsByTagName("option");
+  for (var i = ops.length; --i >= 0;) {
+    var op = ops[i];
+    op.selected = (op.value == val);
+  }
+  c.value = val;
+};
+
+function __dlg_onclose() {
+  if(opener.Dialog._return)
+    opener.Dialog._return(null);
+};
+
+function __dlg_init(bottom) {
+  var body = document.body;
+  var body_height = 0;
+  if (typeof bottom == "undefined") {
+    var div = document.createElement("div");
+    body.appendChild(div);
+    var pos = getAbsolutePos(div);
+    body_height = pos.y;
+  } else {
+    var pos = getAbsolutePos(bottom);
+    body_height = pos.y + bottom.offsetHeight;
+  }
+  if(opener && opener.Dialog && opener.Dialog._arguments)
+    window.dialogArguments = opener.Dialog._arguments;
+  if (!document.all) {
+    //window.sizeToContent();
+    //window.sizeToContent(); // for reasons beyond understanding,
+          // only if we call it twice we get the
+          // correct size.
+    window.addEventListener("unload", __dlg_onclose, true);
+    // center on parent
+    var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+    var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
+    window.moveTo(x, y);
+    //window.innerWidth = body.offsetWidth + 5;
+    //window.innerHeight = body_height + 2;
+  } else {
+    // window.dialogHeight = body.offsetHeight + 50 + "px";
+    // window.dialogWidth = body.offsetWidth + "px";
+    //window.resizeTo(body.offsetWidth, body_height);
+    var ch = body.clientHeight;
+    var cw = body.clientWidth;
+    //window.resizeBy(body.offsetWidth - cw, body_height - ch);
+    var W = body.offsetWidth;
+    var H = 2 * body_height - ch;
+    if(ch <= 0) H = body_height;
+    var x = (screen.availWidth - W) / 2;
+    var y = (screen.availHeight - H) / 2;
+    
+    window.moveTo(x, y);
+  }
+  document.body.onkeypress = __dlg_close_on_esc;
+};
+
+function __dlg_translate(i18n) {
+  var types = ["span", "option", "td", "button", "div", "label", "a","img", "legend"];
+  for (var type in types) {
+    var spans = document.getElementsByTagName(types[type]);
+    for (var i = spans.length; --i >= 0;) {
+      var span = spans[i];
+      if (span.firstChild && span.firstChild.data) {        
+        var txt = i18n[span.firstChild.data];
+        if (txt) span.firstChild.data = txt;
+      }
+      if(span.title){
+        var txt = i18n[span.title];
+        if(txt) span.title = txt;
+      }
+      if(span.alt){
+        var txt = i18n[span.alt];
+        if(txt) span.alt = txt;
+      }
+    }
+  }
+  var txt = i18n[document.title];
+  if (txt)
+    document.title = txt;
+};
+
+// closes the dialog and passes the return info upper.
+function __dlg_close(val) {
+  opener.Dialog._return(val);
+  window.close();
+};
+
+function __dlg_close_on_esc(ev) {
+  ev || (ev = window.event);
+  if (ev.keyCode == 27) {
+    window.close();
+    return false;
+  }
+  return true;
+};

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/selectableelements.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/selectableelements.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/selectableelements.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,375 @@
+/*----------------------------------------------------------------------------\
+|                          Selectable Elements 1.02                           |
+|-----------------------------------------------------------------------------|
+|                         Created by Erik Arvidsson                           |
+|                  (http://webfx.eae.net/contact.html#erik)                   |
+|                      For WebFX (http://webfx.eae.net/)                      |
+|-----------------------------------------------------------------------------|
+|          A script that allows children of any element to be selected        |
+|-----------------------------------------------------------------------------|
+|                  Copyright (c) 1999 - 2004 Erik Arvidsson                   |
+|-----------------------------------------------------------------------------|
+| This software is provided "as is", without warranty of any kind, express or |
+| implied, including  but not limited  to the warranties of  merchantability, |
+| fitness for a particular purpose and noninfringement. In no event shall the |
+| authors or  copyright  holders be  liable for any claim,  damages or  other |
+| liability, whether  in an  action of  contract, tort  or otherwise, arising |
+| from,  out of  or in  connection with  the software or  the  use  or  other |
+| dealings in the software.                                                   |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| This  software is  available under the  three different licenses  mentioned |
+| below.  To use this software you must chose, and qualify, for one of those. |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Non-Commercial License          http://webfx.eae.net/license.html |
+| Permits  anyone the right to use the  software in a  non-commercial context |
+| free of charge.                                                             |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Commercial license           http://webfx.eae.net/commercial.html |
+| Permits the  license holder the right to use  the software in a  commercial |
+| context. Such license must be specifically obtained, however it's valid for |
+| any number of  implementations of the licensed software.                    |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| GPL - The GNU General Public License    http://www.gnu.org/licenses/gpl.txt |
+| Permits anyone the right to use and modify the software without limitations |
+| as long as proper  credits are given  and the original  and modified source |
+| code are included. Requires  that the final product, software derivate from |
+| the original  source or any  software  utilizing a GPL  component, such  as |
+| this, is also licensed under the GPL license.                               |
+|-----------------------------------------------------------------------------|
+| 2002-09-19 | Original Version Posted.                                       |
+| 2002-09-27 | Fixed a bug in IE when mouse down and up occured on different  |
+|            | rows.                                                          |
+| 2003-02-11 | Minor problem with addClassName and removeClassName that       |
+|            | triggered a bug in Opera 7. Added destroy method               |
+|-----------------------------------------------------------------------------|
+| Created 2002-09-04 | All changes are in the log above. | Updated 2003-02-11 |
+\----------------------------------------------------------------------------*/
+
+function SelectableElements(oElement, bMultiple) {
+  if (oElement == null)
+    return;
+
+  this._htmlElement = oElement;
+  this._multiple = Boolean(bMultiple);
+
+  this._selectedItems = [];
+  this._fireChange = true;
+
+  var oThis = this;
+  this._onclick = function (e) {
+    if (e == null) e = oElement.ownerDocument.parentWindow.event;
+    oThis.click(e);
+  };
+
+  if (oElement.addEventListener)
+    oElement.addEventListener("click", this._onclick, false);
+  else if (oElement.attachEvent)
+    oElement.attachEvent("onclick", this._onclick);
+}
+
+SelectableElements.prototype.setItemSelected = function (oEl, bSelected) {
+  if (!this._multiple) {
+    if (bSelected) {
+      var old = this._selectedItems[0]
+      if (oEl == old)
+        return;
+      if (old != null)
+        this.setItemSelectedUi(old, false);
+      this.setItemSelectedUi(oEl, true);
+      this._selectedItems = [oEl];
+      this.fireChange();
+    }
+    else {
+      if (this._selectedItems[0] == oEl) {
+        this.setItemSelectedUi(oEl, false);
+        this._selectedItems = [];
+      }
+    }
+  }
+  else {
+    if (Boolean(oEl._selected) == Boolean(bSelected))
+      return;
+
+    this.setItemSelectedUi(oEl, bSelected);
+
+    if (bSelected)
+      this._selectedItems[this._selectedItems.length] = oEl;
+    else {
+      // remove
+      var tmp = [];
+      var j = 0;
+      for (var i = 0; i < this._selectedItems.length; i++) {
+        if (this._selectedItems[i] != oEl)
+          tmp[j++] = this._selectedItems[i];
+      }
+      this._selectedItems = tmp;
+    }
+    this.fireChange();
+  }
+};
+
+// This method updates the UI of the item
+SelectableElements.prototype.setItemSelectedUi = function (oEl, bSelected) {
+  if (bSelected)
+    addClassName(oEl, "selected");
+  else
+    removeClassName(oEl, "selected");
+
+  oEl._selected = bSelected;
+};
+
+SelectableElements.prototype.getItemSelected = function (oEl) {
+  return Boolean(oEl._selected);
+};
+
+SelectableElements.prototype.fireChange = function () {
+  if (!this._fireChange)
+    return;
+  if (typeof this.onchange == "string")
+    this.onchange = new Function(this.onchange);
+  if (typeof this.onchange == "function")
+    this.onchange();
+};
+
+
+SelectableElements.prototype.click = function (e) {
+  var oldFireChange = this._fireChange;
+  this._fireChange = false;
+
+  // create a copy to compare with after changes
+  var selectedBefore = this.getSelectedItems(); // is a cloned array
+
+  // find row
+  var el = e.target != null ? e.target : e.srcElement;
+  while (el != null && !this.isItem(el))
+    el = el.parentNode;
+
+  if (el == null) { // happens in IE when down and up occur on different items
+    this._fireChange = oldFireChange;
+    return;
+  }
+
+  var rIndex = el;
+  var aIndex = this._anchorIndex;
+
+  // test whether the current row should be the anchor
+  if (this._selectedItems.length == 0 || (e.ctrlKey && !e.shiftKey && this._multiple)) {
+    aIndex = this._anchorIndex = rIndex;
+  }
+
+  if (!e.ctrlKey && !e.shiftKey || !this._multiple) {
+    // deselect all
+    var items = this._selectedItems;
+    for (var i = items.length - 1; i >= 0; i--) {
+      if (items[i]._selected && items[i] != el)
+        this.setItemSelectedUi(items[i], false);
+    }
+    this._anchorIndex = rIndex;
+    if (!el._selected) {
+      this.setItemSelectedUi(el, true);
+    }
+    this._selectedItems = [el];
+  }
+
+  // ctrl
+  else if (this._multiple && e.ctrlKey && !e.shiftKey) {
+    this.setItemSelected(el, !el._selected);
+    this._anchorIndex = rIndex;
+  }
+
+  // ctrl + shift
+  else if (this._multiple && e.ctrlKey && e.shiftKey) {
+    // up or down?
+    var dirUp = this.isBefore(rIndex, aIndex);
+
+    var item = aIndex;
+    while (item != null && item != rIndex) {
+      if (!item._selected && item != el)
+        this.setItemSelected(item, true);
+      item = dirUp ? this.getPrevious(item) : this.getNext(item);
+    }
+
+    if (!el._selected)
+      this.setItemSelected(el, true);
+  }
+
+  // shift
+  else if (this._multiple && !e.ctrlKey && e.shiftKey) {
+    // up or down?
+    var dirUp = this.isBefore(rIndex, aIndex);
+
+    // deselect all
+    var items = this._selectedItems;
+    for (var i = items.length - 1; i >= 0; i--)
+      this.setItemSelectedUi(items[i], false);
+    this._selectedItems = [];
+
+    // select items in range
+    var item = aIndex;
+    while (item != null) {
+      this.setItemSelected(item, true);
+      if (item == rIndex)
+        break;
+      item = dirUp ? this.getPrevious(item) : this.getNext(item);
+    }
+  }
+
+  // find change!!!
+  var found;
+  var changed = selectedBefore.length != this._selectedItems.length;
+  if (!changed) {
+    for (var i = 0; i < selectedBefore.length; i++) {
+      found = false;
+      for (var j = 0; j < this._selectedItems.length; j++) {
+        if (selectedBefore[i] == this._selectedItems[j]) {
+          found = true;
+          break;
+        }
+      }
+      if (!found) {
+        changed = true;
+        break;
+      }
+    }
+  }
+
+  this._fireChange = oldFireChange;
+  if (changed && this._fireChange)
+    this.fireChange();
+};
+
+SelectableElements.prototype.getSelectedItems = function () {
+  //clone
+  var items = this._selectedItems;
+  var l = items.length;
+  var tmp = new Array(l);
+  for (var i = 0; i < l; i++)
+    tmp[i] = items[i];
+  return tmp;
+};
+
+SelectableElements.prototype.isItem = function (node) {
+  return node != null && node.nodeType == 1 && node.parentNode == this._htmlElement;
+};
+
+SelectableElements.prototype.destroy = function () {
+  if (this._htmlElement.removeEventListener)
+    this._htmlElement.removeEventListener("click", this._onclick, false);
+  else if (this._htmlElement.detachEvent)
+    this._htmlElement.detachEvent("onclick", this._onclick);
+
+  this._htmlElement = null;
+  this._onclick = null;
+  this._selectedItems = null;
+};
+
+/* Traversable Collection Interface */
+
+SelectableElements.prototype.getNext = function (el) {
+  var n = el.nextSibling;
+  if (n == null || this.isItem(n))
+    return n;
+  return this.getNext(n);
+};
+
+SelectableElements.prototype.getPrevious = function (el) {
+  var p = el.previousSibling;
+  if (p == null || this.isItem(p))
+    return p;
+  return this.getPrevious(p);
+};
+
+SelectableElements.prototype.isBefore = function (n1, n2) {
+  var next = this.getNext(n1);
+  while (next != null) {
+    if (next == n2)
+      return true;
+    next = this.getNext(next);
+  }
+  return false;
+};
+
+/* End Traversable Collection Interface */
+
+/* Indexable Collection Interface */
+
+SelectableElements.prototype.getItems = function () {
+  var tmp = [];
+  var j = 0;
+  var cs = this._htmlElement.childNodes;
+  var l = cs.length;
+  for (var i = 0; i < l; i++) {
+    if (cs[i].nodeType == 1)
+      tmp[j++] = cs[i]
+  }
+  return tmp;
+};
+
+SelectableElements.prototype.getItem = function (nIndex) {
+  var j = 0;
+  var cs = this._htmlElement.childNodes;
+  var l = cs.length;
+  for (var i = 0; i < l; i++) {
+    if (cs[i].nodeType == 1) {
+      if (j == nIndex)
+        return cs[i];
+      j++;
+    }
+  }
+  return null;
+};
+
+SelectableElements.prototype.getSelectedIndexes = function () {
+  var items = this.getSelectedItems();
+  var l = items.length;
+  var tmp = new Array(l);
+  for (var i = 0; i < l; i++)
+    tmp[i] = this.getItemIndex(items[i]);
+  return tmp;
+};
+
+
+SelectableElements.prototype.getItemIndex = function (el) {
+  var j = 0;
+  var cs = this._htmlElement.childNodes;
+  var l = cs.length;
+  for (var i = 0; i < l; i++) {
+    if (cs[i] == el)
+      return j;
+    if (cs[i].nodeType == 1)
+      j++;
+  }
+  return -1;
+};
+
+/* End Indexable Collection Interface */
+
+
+
+function addClassName(el, sClassName) {
+  var s = el.className;
+  var p = s.split(" ");
+  if (p.length == 1 && p[0] == "")
+    p = [];
+
+  var l = p.length;
+  for (var i = 0; i < l; i++) {
+    if (p[i] == sClassName)
+      return;
+  }
+  p[p.length] = sClassName;
+  el.className = p.join(" ");
+}
+
+function removeClassName(el, sClassName) {
+  var s = el.className;
+  var p = s.split(" ");
+  var np = [];
+  var l = p.length;
+  var j = 0;
+  for (var i = 0; i < l; i++) {
+    if (p[i] != sClassName)
+      np[j++] = p[i];
+  }
+  el.className = np.join(" ");
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/selectabletablerows.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/selectabletablerows.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/selectabletablerows.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+/*----------------------------------------------------------------------------\
+|                          Selectable Elements 1.02                           |
+|-----------------------------------------------------------------------------|
+|                         Created by Erik Arvidsson                           |
+|                  (http://webfx.eae.net/contact.html#erik)                   |
+|                      For WebFX (http://webfx.eae.net/)                      |
+|-----------------------------------------------------------------------------|
+|          A script that allows children of any element to be selected        |
+|-----------------------------------------------------------------------------|
+|                  Copyright (c) 1999 - 2004 Erik Arvidsson                   |
+|-----------------------------------------------------------------------------|
+| This software is provided "as is", without warranty of any kind, express or |
+| implied, including  but not limited  to the warranties of  merchantability, |
+| fitness for a particular purpose and noninfringement. In no event shall the |
+| authors or  copyright  holders be  liable for any claim,  damages or  other |
+| liability, whether  in an  action of  contract, tort  or otherwise, arising |
+| from,  out of  or in  connection with  the software or  the  use  or  other |
+| dealings in the software.                                                   |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| This  software is  available under the  three different licenses  mentioned |
+| below.  To use this software you must chose, and qualify, for one of those. |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Non-Commercial License          http://webfx.eae.net/license.html |
+| Permits  anyone the right to use the  software in a  non-commercial context |
+| free of charge.                                                             |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Commercial license           http://webfx.eae.net/commercial.html |
+| Permits the  license holder the right to use  the software in a  commercial |
+| context. Such license must be specifically obtained, however it's valid for |
+| any number of  implementations of the licensed software.                    |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| GPL - The GNU General Public License    http://www.gnu.org/licenses/gpl.txt |
+| Permits anyone the right to use and modify the software without limitations |
+| as long as proper  credits are given  and the original  and modified source |
+| code are included. Requires  that the final product, software derivate from |
+| the original  source or any  software  utilizing a GPL  component, such  as |
+| this, is also licensed under the GPL license.                               |
+|-----------------------------------------------------------------------------|
+| 2002-09-19 | Original Version Posted.                                       |
+| 2002-09-27 | Fixed a bug in IE when mouse down and up occured on different  |
+|            | rows.                                                          |
+| 2003-02-11 | Minor problem with addClassName and removeClassName that       |
+|            | triggered a bug in Opera 7. Added destroy method               |
+|-----------------------------------------------------------------------------|
+| Created 2002-09-04 | All changes are in the log above. | Updated 2003-02-11 |
+\----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------\
+| This file requires that SelectableElements is first defined. This class can |
+| be found in the file selectableelements.js at WebFX                         |
+\----------------------------------------------------------------------------*/
+
+function SelectableTableRows(oTableElement, bMultiple) {
+  SelectableElements.call(this, oTableElement, bMultiple);
+}
+SelectableTableRows.prototype = new SelectableElements;
+
+SelectableTableRows.prototype.isItem = function (node) {
+  return node != null && node.tagName == "TR" &&
+    node.parentNode.tagName == "TBODY" &&
+    node.parentNode.parentNode == this._htmlElement;
+};
+
+/* Indexable Collection Interface */
+
+SelectableTableRows.prototype.getItems = function () {
+  return this._htmlElement.rows;
+};
+
+SelectableTableRows.prototype.getItemIndex = function (el) {
+  return el.rowIndex;
+};
+
+SelectableTableRows.prototype.getItem = function (i) {
+  return this._htmlElement.rows[i];
+};
+
+/* End Indexable Collection Interface */
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/sortabletable.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/sortabletable.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/js/sortabletable.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,323 @@
+
+/*----------------------------------------------------------------------------\
+|                            Sortable Table 1.04                              |
+|-----------------------------------------------------------------------------|
+|                         Created by Erik Arvidsson                           |
+|                  (http://webfx.eae.net/contact.html#erik)                   |
+|                      For WebFX (http://webfx.eae.net/)                      |
+|-----------------------------------------------------------------------------|
+| A DOM 1 based script that allows an ordinary HTML table to be sortable.     |
+|-----------------------------------------------------------------------------|
+|                  Copyright (c) 1998 - 2002 Erik Arvidsson                   |
+|-----------------------------------------------------------------------------|
+| This software is provided "as is", without warranty of any kind, express or |
+| implied, including  but not limited  to the warranties of  merchantability, |
+| fitness for a particular purpose and noninfringement. In no event shall the |
+| authors or  copyright  holders be  liable for any claim,  damages or  other |
+| liability, whether  in an  action of  contract, tort  or otherwise, arising |
+| from,  out of  or in  connection with  the software or  the  use  or  other |
+| dealings in the software.                                                   |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| This  software is  available under the  three different licenses  mentioned |
+| below.  To use this software you must chose, and qualify, for one of those. |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Non-Commercial License          http://webfx.eae.net/license.html |
+| Permits  anyone the right to use the  software in a  non-commercial context |
+| free of charge.                                                             |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| The WebFX Commercial license           http://webfx.eae.net/commercial.html |
+| Permits the  license holder the right to use  the software in a  commercial |
+| context. Such license must be specifically obtained, however it's valid for |
+| any number of  implementations of the licensed software.                    |
+| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
+| GPL - The GNU General Public License    http://www.gnu.org/licenses/gpl.txt |
+| Permits anyone the right to use and modify the software without limitations |
+| as long as proper  credits are given  and the original  and modified source |
+| code are included. Requires  that the final product, software derivate from |
+| the original  source or any  software  utilizing a GPL  component, such  as |
+| this, is also licensed under the GPL license.                               |
+|-----------------------------------------------------------------------------|
+| 2003-01-10 | First version                                                  |
+| 2003-01-19 | Minor changes to the date parsing                              |
+| 2003-01-28 | JScript 5.0 fixes (no support for 'in' operator)               |
+| 2003-02-01 | Sloppy typo like error fixed in getInnerText                   |
+| 2003-07-04 | Added workaround for IE cellIndex bug.                         |
+|-----------------------------------------------------------------------------|
+| Created 2003-01-10 | All changes are in the log above. | Updated 2003-07-04 |
+\----------------------------------------------------------------------------*/
+
+
+function SortableTable(oTable, oSortTypes) {
+
+  this.element = oTable;
+  this.tHead = oTable.tHead;
+  this.tBody = oTable.tBodies[0];
+  this.document = oTable.ownerDocument || oTable.document;
+
+  this.sortColumn = null;
+  this.descending = null;
+
+  var oThis = this;
+  this._headerOnclick = function (e) {
+    oThis.headerOnclick(e);
+  };
+
+
+  // only IE needs this
+  var win = this.document.defaultView || this.document.parentWindow;
+  this._onunload = function () {
+    oThis.destroy();
+  };
+  if (win && typeof win.attachEvent != "undefined") {
+    win.attachEvent("onunload", this._onunload);
+  }
+
+  this.initHeader(oSortTypes || []);
+}
+
+SortableTable.gecko = navigator.product == "Gecko";
+SortableTable.msie = /msie/i.test(navigator.userAgent);
+// Mozilla is faster when doing the DOM manipulations on
+// an orphaned element. MSIE is not
+SortableTable.removeBeforeSort = SortableTable.gecko;
+
+SortableTable.prototype.onsort = function () {};
+
+// adds arrow containers and events
+// also binds sort type to the header cells so that reordering columns does
+// not break the sort types
+SortableTable.prototype.initHeader = function (oSortTypes) {
+  var cells = this.tHead.rows[0].cells;
+  var l = cells.length;
+  var img, c;
+  for (var i = 0; i < l; i++) {
+    c = cells[i];
+    img = this.document.createElement("IMG");
+    img.src = "img/blank.png";
+    c.appendChild(img);
+    if (oSortTypes[i] != null) {
+      c._sortType = oSortTypes[i];
+    }
+    if (typeof c.addEventListener != "undefined")
+      c.addEventListener("click", this._headerOnclick, false);
+    else if (typeof c.attachEvent != "undefined")
+      c.attachEvent("onclick", this._headerOnclick);
+  }
+  this.updateHeaderArrows();
+};
+
+// remove arrows and events
+SortableTable.prototype.uninitHeader = function () {
+  var cells = this.tHead.rows[0].cells;
+  var l = cells.length;
+  var c;
+  for (var i = 0; i < l; i++) {
+    c = cells[i];
+    c.removeChild(c.lastChild);
+    if (typeof c.removeEventListener != "undefined")
+      c.removeEventListener("click", this._headerOnclick, false);
+    else if (typeof c.detachEvent != "undefined")
+      c.detachEvent("onclick", this._headerOnclick);
+  }
+};
+
+SortableTable.prototype.updateHeaderArrows = function () {
+  var cells = this.tHead.rows[0].cells;
+  var l = cells.length;
+  var img;
+  for (var i = 0; i < l; i++) {
+    img = cells[i].lastChild;
+    if (i == this.sortColumn)
+      img.className = "sort-arrow " + (this.descending ? "descending" : "ascending");
+    else
+      img.className = "sort-arrow";
+  }
+};
+
+SortableTable.prototype.headerOnclick = function (e) {
+  // find TD element
+  var el = e.target || e.srcElement;
+  while (el.tagName != "TD")
+    el = el.parentNode;
+
+  this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex);
+};
+
+// IE returns wrong cellIndex when columns are hidden
+SortableTable.getCellIndex = function (oTd) {
+  var cells = oTd.parentNode.childNodes
+  var l = cells.length;
+  var i;
+  for (i = 0; cells[i] != oTd && i < l; i++)
+    ;
+  return i;
+};
+
+SortableTable.prototype.getSortType = function (nColumn) {
+  var cell = this.tHead.rows[0].cells[nColumn];
+  var val = cell._sortType;
+  if (val != "")
+    return val;
+  return "String";
+};
+
+// only nColumn is required
+// if bDescending is left out the old value is taken into account
+// if sSortType is left out the sort type is found from the sortTypes array
+
+SortableTable.prototype.sort = function (nColumn, bDescending, sSortType) {
+  if (sSortType == null)
+    sSortType = this.getSortType(nColumn);
+
+  // exit if None
+  if (sSortType == "None")
+    return;
+
+  if (bDescending == null) {
+    if (this.sortColumn != nColumn)
+      this.descending = true;
+    else
+      this.descending = !this.descending;
+  }
+
+  this.sortColumn = nColumn;
+
+  if (typeof this.onbeforesort == "function")
+    this.onbeforesort();
+
+  var f = this.getSortFunction(sSortType, nColumn);
+  var a = this.getCache(sSortType, nColumn);
+  var tBody = this.tBody;
+
+  a.sort(f);
+
+  if (this.descending)
+    a.reverse();
+
+  if (SortableTable.removeBeforeSort) {
+    // remove from doc
+    var nextSibling = tBody.nextSibling;
+    var p = tBody.parentNode;
+    p.removeChild(tBody);
+  }
+
+  // insert in the new order
+  var l = a.length;
+  for (var i = 0; i < l; i++)
+    tBody.appendChild(a[i].element);
+
+  if (SortableTable.removeBeforeSort) {
+    // insert into doc
+    p.insertBefore(tBody, nextSibling);
+  }
+
+  this.updateHeaderArrows();
+
+  this.destroyCache(a);
+
+  if (typeof this.onsort == "function")
+    this.onsort();
+};
+
+SortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) {
+  var oThis = this;
+  this._asyncsort = function () {
+    oThis.sort(nColumn, bDescending, sSortType);
+  };
+  window.setTimeout(this._asyncsort, 1);
+};
+
+SortableTable.prototype.getCache = function (sType, nColumn) {
+  var rows = this.tBody.rows;
+  var l = rows.length;
+  var a = new Array(l);
+  var r;
+  for (var i = 0; i < l; i++) {
+    r = rows[i];
+    a[i] = {
+      value:    this.getRowValue(r, sType, nColumn),
+      element:  r
+    };
+  };
+  return a;
+};
+
+SortableTable.prototype.destroyCache = function (oArray) {
+  var l = oArray.length;
+  for (var i = 0; i < l; i++) {
+    oArray[i].value = null;
+    oArray[i].element = null;
+    oArray[i] = null;
+  }
+}
+
+SortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {
+  var s;
+  var c = oRow.cells[nColumn];
+  if (typeof c.innerText != "undefined")
+    s = c.innerText;
+  else
+    s = SortableTable.getInnerText(c);
+  return this.getValueFromString(s, sType);
+};
+
+SortableTable.getInnerText = function (oNode) {
+  var s = "";
+  var cs = oNode.childNodes;
+  var l = cs.length;
+  for (var i = 0; i < l; i++) {
+    switch (cs[i].nodeType) {
+      case 1: //ELEMENT_NODE
+        s += SortableTable.getInnerText(cs[i]);
+        break;
+      case 3: //TEXT_NODE
+        s += cs[i].nodeValue;
+        break;
+    }
+  }
+  return s;
+}
+
+SortableTable.prototype.getValueFromString = function (sText, sType) {
+  switch (sType) {
+    case "Number":
+      return Number(sText);
+    case "CaseInsensitiveString":
+      return sText.toUpperCase();
+    case "Date":
+      var parts = sText.split("-");
+      var d = new Date(0);
+      d.setFullYear(parts[0]);
+      d.setDate(parts[2]);
+      d.setMonth(parts[1] - 1);
+      return d.valueOf();
+  }
+  return sText;
+};
+
+SortableTable.prototype.getSortFunction = function (sType, nColumn) {
+  return function compare(n1, n2) {
+    if (n1.value < n2.value)
+      return -1;
+    if (n2.value < n1.value)
+      return 1;
+    return 0;
+  };
+};
+
+SortableTable.prototype.destroy = function () {
+  this.uninitHeader();
+  var win = this.document.parentWindow;
+  if (win && typeof win.detachEvent != "undefined") { // only IE needs this
+    win.detachEvent("onunload", this._onunload);
+  }
+  this._onunload = null;
+  this.element = null;
+  this.tHead = null;
+  this.tBody = null;
+  this.document = null;
+  this._headerOnclick = null;
+  this.sortTypes = null;
+  this._asyncsort = null;
+  this.onsort = null;
+};

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Al Rashid, http://alrashid.klokan.sk
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+InsertFile.I18N = {
+  "InsertFileTooltip"       : "Insert link to file"
+};
+/*
+
+
+*/
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-de.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-de.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-de.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+// $Id: lang-de.php, v 1.0 2004/04/19 20:20:14 bpfeifer Exp $
+/**
+* HTMLArea3 XTD addon - FileManager
+* Based on AlRashid's FileManager
+* @package Mambo Open Source
+* @Copyright © 2004 Bernhard Pfeifer aka novocaine
+* @ All rights reserved
+* @ Mambo Open Source is Free Software
+* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
+* @version $Revision: 1.0 $
+**/
+$MY_MESSAGES = array();
+$MY_MESSAGES['extmissing'] = 'Bitte laden Sie eine Datei mit einer Dateiendung hoch, z. B. "bild.jpg".';
+$MY_MESSAGES['loading'] = 'Lade Dateien...';
+$MY_MESSAGES['uploading'] = 'Lade hoch...';
+$MY_MESSAGES['nopermtodeletefile'] = 'Keine ausreichende Berechtigung zum Löschen der Datei.';
+$MY_MESSAGES['filenotfound'] = 'Datei nicht gefunden.';
+$MY_MESSAGES['unlinkfailed'] = 'Löschen fehlgeschlagen.';
+$MY_MESSAGES['rmdirfailed'] = 'Verzeichnis löschen fehlgeschlagen.';
+$MY_MESSAGES['nopermtodeletefolder'] = 'Keine ausreichende Berechtigung zum Löschen des Verzeichnisses.';
+$MY_MESSAGES['foldernotfound'] = 'Verzeichnis nicht gefunden.';
+$MY_MESSAGES['foldernotempty'] = 'Verzeichnis ist nicht leer.\nBitte löschen Sie zuerst alle darin enthaltenen Dateien.';
+$MY_MESSAGES['nopermtocreatefolder'] = 'Keine ausreichende Berechtigung zum Erstellen eines Verzeichnisses.';
+$MY_MESSAGES['pathnotfound'] = 'Pfad nicht gefunden.';
+$MY_MESSAGES['foldernamemissing'] = 'Verzeichnisname fehlt.';
+$MY_MESSAGES['folderalreadyexists'] = 'Verzeichnis existiert bereits.';
+$MY_MESSAGES['mkdirfailed'] = 'Verzeichnis erstellen fehlgeschlagen.';
+$MY_MESSAGES['nopermtoupload'] = 'Keine ausreichende Berechtigung zum Hochladen von Dateien.';
+$MY_MESSAGES['extnotallowed'] = 'Dateien mit dieser Dateiendung sind nicht erlaubt.';
+$MY_MESSAGES['filesizeexceedlimit'] = 'Datei überschreitet die zulässige Kapazität.';
+$MY_MESSAGES['filenotuploaded'] = 'Datei wurde nicht hochgeladen.';
+$MY_MESSAGES['nofiles'] = 'Keine Dateien...';
+$MY_MESSAGES['configproblem'] = 'Konfigurationsproblem ';
+$MY_MESSAGES['deletefile'] = 'Datei löschen';
+$MY_MESSAGES['deletefolder'] = 'Verzeichnis löschen';
+$MY_MESSAGES['refresh'] = 'Aktualisieren';
+$MY_MESSAGES['folder'] = 'Verzeichnis';
+$MY_MESSAGES['type'] = 'Typ';
+$MY_MESSAGES['name'] = 'Name';
+$MY_MESSAGES['size'] = 'Grösse';
+$MY_MESSAGES['datemodified'] = 'Geändert am';
+$MY_MESSAGES['url'] = 'Pfad';
+$MY_MESSAGES['comment'] = 'Kommentar';
+$MY_MESSAGES['caption'] = 'Text';
+$MY_MESSAGES['upload'] = 'Hochladen';
+$MY_MESSAGES['insertfile'] = "Datei einfügen";
+$MY_MESSAGES['filemanager'] = "Datei Manager";
+$MY_MESSAGES['directory'] = "Verzeichnis";
+$MY_MESSAGES['enterurl'] = "Bitte geben Sie eine URL ein.";
+$MY_MESSAGES['entercaption'] = 'Bitte geben Sie einen Text für die Datei ein.';
+$MY_MESSAGES['inserticon'] = 'Icon für Dateityp hinzufügen';
+$MY_MESSAGES['insertsize'] = 'Angaben über Dateigrösse hinzufügen';
+$MY_MESSAGES['insertdate'] = 'Angaben über Änderungsdatum hinzufügen';
+$MY_MESSAGES['newfolder'] = 'Name des Verzeichnisses:';
+$MY_MESSAGES['cancel'] = 'Abbrechen';
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-en.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-en.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-en.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,69 @@
+<?php
+/***********************************************************************
+** Title.........:    Insert File Dialog, File Manager
+** Version.......:    1.1
+** Author........:    Al Rashid <alrashid at klokan.sk>
+** Filename......:    lang-en.php (english language file)
+** URL...........:    http://alrashid.klokan.sk/insFile/
+** Last changed..:    8 Jun 2004
+***********************************************************************/
+$MY_MESSAGES = array();
+$MY_MESSAGES['extmissing'] = 'Only files with extensions are permited, e.g. "imagefile.jpg".';
+$MY_MESSAGES['loading'] = 'Loading files';
+$MY_MESSAGES['uploading'] = 'Uploading...';
+$MY_MESSAGES['nopermtodelete'] = 'No permission to delete file.';
+$MY_MESSAGES['filenotfound'] = 'File not found.';
+$MY_MESSAGES['unlinkfailed'] = 'Unlink failed.';
+$MY_MESSAGES['rmdirfailed'] = 'Rmdir failed.';
+$MY_MESSAGES['foldernotfound'] = 'Folder not found.';
+$MY_MESSAGES['nopermtocreatefolder'] = 'No permission to create folder.';
+$MY_MESSAGES['pathnotfound'] = 'Path not found.';
+$MY_MESSAGES['foldernamemissing'] = 'Folder name missing.';
+$MY_MESSAGES['folderalreadyexists'] = 'Folder already exists.';
+$MY_MESSAGES['mkdirfailed'] = 'Mkdir failed.';
+$MY_MESSAGES['nopermtoupload'] = 'No permission to upload.';
+$MY_MESSAGES['extnotallowed'] = 'Files with this extension are not allowed.';
+$MY_MESSAGES['filesizeexceedlimit'] = 'File exceeds the size limit';
+$MY_MESSAGES['filenotuploaded'] = 'File was not uploaded.';
+$MY_MESSAGES['nofiles'] = 'No files...';
+$MY_MESSAGES['configproblem'] = 'Configuration problem ';
+$MY_MESSAGES['delete'] = 'Delete';
+$MY_MESSAGES['folders'] = 'folder(s)';
+$MY_MESSAGES['files'] = 'file(s)';
+$MY_MESSAGES['refresh'] = 'Refresh';
+$MY_MESSAGES['folder'] = 'Folder';
+$MY_MESSAGES['type'] = '';
+$MY_MESSAGES['name'] = 'Name';
+$MY_MESSAGES['size'] = 'Size';
+$MY_MESSAGES['datemodified'] = 'Date Modified';
+$MY_MESSAGES['url'] = 'URL';
+$MY_MESSAGES['comment'] = 'Comment';
+$MY_MESSAGES['caption'] = 'Caption';
+$MY_MESSAGES['upload'] = 'Upload';
+$MY_MESSAGES['insertfile'] = "Insert File";
+$MY_MESSAGES['filemanager'] = "File manager";
+$MY_MESSAGES['directory'] = "Directory";
+$MY_MESSAGES['enterurl'] = "You must enter the URL";
+$MY_MESSAGES['entercaption'] = 'Please enter the caption text';
+$MY_MESSAGES['newfolder'] = 'New folder';
+$MY_MESSAGES['newfoldernamemissing'] = 'New folder name missing!';
+$MY_MESSAGES['renamefolder'] = 'New folder name:';
+$MY_MESSAGES['renamewarning'] = 'Warning!\n Renaming or moving folders and files will break existing links in your documents. Continue?';
+$MY_MESSAGES['renamefile'] = 'New file name:';
+$MY_MESSAGES['nopermtorename'] = 'No permission to rename files and folders.';
+$MY_MESSAGES['newfilenamemissing'] = 'New file name missing!';
+$MY_MESSAGES['filealreadyexists'] = 'File with specified new name already exists. File was not renamed/moved.';
+$MY_MESSAGES['folderalreadyexists'] = 'Folder with specified new name already exists. Folder was not renamed/moved.';
+$MY_MESSAGES['uploadfilealreadyexists'] = 'File already exists. File was not uploaded.';
+$MY_MESSAGES['cancel'] = 'Cancel';
+$MY_MESSAGES['ok'] = 'OK';
+$MY_MESSAGES['openfile'] = 'Open file in new window';
+$MY_MESSAGES['up'] = 'Up';
+$MY_MESSAGES['rename'] = 'Rename';
+$MY_MESSAGES['renamefailed'] = 'Rename failed';
+$MY_MESSAGES['move'] = 'Move';
+$MY_MESSAGES['nopermtomove'] = 'No permission to move files and folders.';
+$MY_MESSAGES['selectfolder'] = 'Choose directory to move selected folders and files to.';
+$MY_MESSAGES['ctrlshift'] = 'Use Ctrl and/or Shift to select multiple items.';
+$MY_MESSAGES['filename'] = 'File:';
+?>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-nl.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-nl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/lang/lang-nl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php 
+/*********************************************************************** 
+** Title.........: Insert File Dialog, File Manager 
+** Version.......: 1.00 
+** Author........: Thomas van Ditzhuijsen, ditzhuijsen at hotmail.com 
+** Filename......: lang-nl.php 
+** Last changed..: 8 Jan 2004 
+dutch language file 
+***********************************************************************/ 
+$MY_MESSAGES = array(); 
+$MY_MESSAGES['extmissing'] = 'Het te upload bestand moet een extensie (iets achter de punt) hebben, bijv. "imagefile.jpg".'; 
+$MY_MESSAGES['loading'] = 'Bestanden worden geladen'; 
+$MY_MESSAGES['uploading'] = 'Uploaden...'; 
+$MY_MESSAGES['nopermtodeletefile'] = 'Je hebt niet de rechten om bestanden te verwijderen.'; 
+$MY_MESSAGES['filenotfound'] = 'Bestand niet gevonden.'; 
+$MY_MESSAGES['unlinkfailed'] = 'Verwijderen niet gelukt.'; 
+$MY_MESSAGES['rmdirfailed'] = 'Verwijderen van de map is niet gelukt.'; 
+$MY_MESSAGES['nopermtodeletefolder'] = 'Je hebt niet de rechten om een map te verwijderen.'; 
+$MY_MESSAGES['foldernotfound'] = 'map niet gevonden.'; 
+$MY_MESSAGES['foldernotempty'] = 'Folder is niet leeg. Verwijder alle bestanden aub eerst.'; 
+$MY_MESSAGES['nopermtocreatefolder'] = 'Je hebt niet de rechten om een folder te maken.'; 
+$MY_MESSAGES['pathnotfound'] = 'map niet gevonden.'; 
+$MY_MESSAGES['foldernamemissing'] = 'map naam ontbreekt.'; 
+$MY_MESSAGES['folderalreadyexists'] = 'map bestaat al.'; 
+$MY_MESSAGES['mkdirfailed'] = 'Het maken van de map is niet gelukt.'; 
+$MY_MESSAGES['nopermtoupload'] = 'Je hebt niet de rechten om te uploaden.'; 
+$MY_MESSAGES['extnotallowed'] = 'Bestanden met deze extensie zijn niet toegestaan.'; 
+$MY_MESSAGES['filesizeexceedlimit'] = 'Bestand is groter dan de maximale bestands grootte.'; 
+$MY_MESSAGES['filenotuploaded'] = 'Bestand is niet geupload.'; 
+$MY_MESSAGES['nofiles'] = 'Geen bestanden...'; 
+$MY_MESSAGES['configproblem'] = 'Configuratie probleem '; 
+$MY_MESSAGES['deletefile'] = 'Verwijder bestand'; 
+$MY_MESSAGES['deletefolder'] = 'Verwijdermap'; 
+$MY_MESSAGES['refresh'] = 'Vernieuw'; 
+$MY_MESSAGES['folder'] = 'Map'; 
+$MY_MESSAGES['type'] = ''; 
+$MY_MESSAGES['name'] = 'Naam'; 
+$MY_MESSAGES['size'] = 'Grootte'; 
+$MY_MESSAGES['datemodified'] = 'Datum gewijzigd'; 
+$MY_MESSAGES['url'] = 'URL'; 
+$MY_MESSAGES['comment'] = 'Commentaar'; 
+$MY_MESSAGES['caption'] = 'Titel'; 
+$MY_MESSAGES['upload'] = 'Upload'; 
+$MY_MESSAGES['insertfile'] = "Voeg bestand toe"; 
+$MY_MESSAGES['filemanager'] = "Bestands beheer"; 
+$MY_MESSAGES['directory'] = "map"; 
+$MY_MESSAGES['enterurl'] = "Je moet een URL invoeren"; 
+$MY_MESSAGES['entercaption'] = 'Type aub een Titel tekst'; 
+$MY_MESSAGES['inserticon'] = 'Insert filetype icon';
+$MY_MESSAGES['insertsize'] = 'Insert file size';
+$MY_MESSAGES['insertdate'] = 'Insert file modification date';
+$MY_MESSAGES['newfolder'] = 'New folder name:';
+
+
+?> 

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/move.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/move.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/InsertFile/move.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,99 @@
+<?php
+/***********************************************************************
+** Title.........:    Insert File Dialog, File Manager
+** Version.......:    1.1
+** Authors.......:    Al Rashid <alrashid at klokan.sk>
+**                    Xiang Wei ZHUO <wei at zhuo.org>
+** Filename......:    move.php
+** URL...........:    http://alrashid.klokan.sk/insFile/
+** Last changed..:    23 July 2004
+***********************************************************************/
+
+require('config.inc.php');
+require('functions.php');
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+        <head>
+        <title>Folder dialog</title>
+        <?php
+                echo '<meta http-equiv="content-language" content="'.$MY_LANG.'" />'."\n";
+                echo '<meta http-equiv="Content-Type" content="text/html; charset='.$MY_CHARSET.'" />'."\n";
+                echo '<meta name="author" content="AlRashid, www: http://alrashid.klokan.sk; mailto:alrashid at klokan.sk" />'."\n";
+        ?>
+
+<style type="text/css">
+ /*<![CDATA[*/
+ html, body {  background-color: ButtonFace;  color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;}
+body { padding: 5px; }
+ .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px  solid black; letter-spacing: 2px;}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+.buttons { width: 70px; text-align: center; }
+form { padding: 0px;  margin: 0;}
+form .elements{
+        padding: 10px; text-align: center;
+}
+ /*]]>*/
+ </style>
+        <script type="text/javascript" src="js/popup.js"></script>
+        <script type="text/javascript">
+        /*<![CDATA[*/
+                window.resizeTo(550, 200);
+
+                  function onCancel() {
+                        __dlg_close(null);
+                        return false;
+                }
+
+                function onOK() {
+                        // pass data back to the calling window
+                        var param = new Object();
+                        var selection = document.forms[0].newpath;
+                        var newDir = selection.options[selection.selectedIndex].value;
+                        param['newpath'] = newDir;
+                          __dlg_close(param);
+                          return false;
+                }
+
+                function Init() {
+                        __dlg_init();
+                }
+
+                function refreshDirs() {
+                        var allPaths = document.forms[0].newpath.options;
+                        var fields = ["/" <?php dirs($MY_DOCUMENT_ROOT,'');?>];
+                        for(i=0; i<fields.length; i++) {
+                                var newElem =        document.createElement("OPTION");
+                                var newValue = fields[i];
+                                newElem.text = newValue;
+                                newElem.value = newValue;
+                                allPaths.add(newElem);
+                        }
+                }
+/*]]>*/
+</script>
+</head>
+<body onload="Init()">
+        <div class="title"><?php echo $MY_MESSAGES['selectfolder']; ?></div>
+        <form action="">
+                <div class="elements">
+                        <label for="newpath">
+                                        <?php echo $MY_MESSAGES['directory']; ?>
+                        </label>
+                        <select name="newpath" id="newpath" style="width:35em">
+                        </select>
+                </div>
+                <div style="text-align: right;">
+                         <hr />
+                        <button type="button" class="buttons" onclick="return onCancel();"><?php echo $MY_MESSAGES['cancel']; ?></button>
+                        <button type="button" class="buttons" onclick="return onOK();"><?php echo $MY_MESSAGES['ok']; ?></button>
+                </div>
+        </form>
+        <script type="text/javascript">
+        /*<![CDATA[*/
+                refreshDirs();
+        /*]]>*/
+        </script>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+/* Import theme specific language pack */
+tinyMCE.importPluginLanguagePack('filemanager', 'en');
+
+function TinyMCE_filemanager_getControlHTML(control_name) {
+    switch (control_name) {
+        case "filemanager":
+            return '<img id="{$editor_id}_filemanager" src="{$pluginurl}/images/filemanager.gif" title="{$lang_insert_filemanager}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceFilemanager\');" />';
+    }
+    return "";
+}
+
+/**
+ * Executes the mceFilemanager command.
+ */
+function TinyMCE_filemanager_execCommand(editor_id, element, command, user_interface, value) {
+    // Handle commands
+    switch (command) {
+        case "mceFilemanager":
+            var template = new Array();
+            template['file']   = '../../plugins/filemanager/InsertFile/insert_file.php'; // Relative to theme
+            template['width']  = 660;
+            template['height'] = 500;
+
+            tinyMCE.openWindow(template, {editor_id : editor_id});
+       return true;
+   }
+   // Pass to next handler in chain
+   return false;
+}
+
+

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/images/filemanager.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/images/filemanager.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3 @@
+// UK lang variables
+
+tinyMCELang['lang_insert_filemanager'] = 'Insert File Link';
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/filemanager/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+ file Manager plugin for TinyMCE
+---------------------------------
+
+Installation instructions:
+  * Copy the ibrowser directory to the plugins directory of TinyMCE (/jscripts/tiny_mce/plugins).
+  * Add plugin to TinyMCE plugin option list example: plugins : "filemanager".
+  * Add the ibrowser button name to button list, example: theme_advanced_buttons3_add : "filemanager".
+  * Modify the ..../jscripts/tiny_mce/plugins/filemanager/insertfile/config.inc.php
+
+Configuration example:
+$MY_DOCUMENT_ROOT     = 'C:/appserv/www/tinymce142/resource/insfile'; //* system path to the directory you want to manage the files and folders
+$MY_BASE_URL          = "http://localhost/tinymce142/resource/insfile";
+$MY_URL_TO_OPEN_FILE  = "http://localhost/tinymce142/resource/insfile"; 
+$MY_ALLOW_EXTENSIONS = array('html', 'doc', 'xls', 'txt', 'gif', 'jpeg', 'jpg', 'png', 'pdf', 'zip', 'pdf');
+$MY_DENY_EXTENSIONS  = array('php', 'php3', 'php4', 'phtml', 'shtml', 'cgi', 'pl');
+$MY_LIST_EXTENSIONS  = array('html', 'doc', 'xls', 'txt', 'gif', 'jpeg', 'jpg', 'png', 'pdf', 'zip', 'pdf');
+$MY_ALLOW_CREATE     = true; // Boolean (false or true) whether creating folders is allowed or not.
+$MY_ALLOW_DELETE     = true; // Boolean (false or true) whether deleting files and folders is allowed or not.
+$MY_ALLOW_RENAME     = true; // Boolean (false or true) whether renaming files and folders is allowed or not.
+$MY_ALLOW_MOVE       = true; // Boolean (false or true) whether moving files and folders is allowed or not.
+$MY_ALLOW_UPLOAD     = true; // Boolean (false or true) whether uploading files is allowed or not.
+
+
+
+Initialization example:
+  tinyMCE.init({
+    theme : "advanced",
+    elements: "ta",
+    mode : "exact",
+    plugins : "filemanager",
+    theme_advanced_buttons3_add : "filemanager"
+  });
+
+

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css/content.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css/content.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css/content.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,7 @@
+.mceItemFlash {
+  border: 1px dotted #cc0000;
+  background-image: url('../images/flash.gif');
+  background-position: center;
+  background-repeat: no-repeat;
+  background-color: #ffffcc;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css/flash.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css/flash.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/css/flash.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,11 @@
+.panel_wrapper div.current {
+  height: 100px;
+}
+
+#width, #height {
+  width: 50px;
+}
+
+#file {
+  width: 250px;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('flash','en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk,pt_br');var TinyMCE_FlashPlugin={getInfo:function(){return{longname:'Flash',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_flash.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(!tinyMCE.settings['flash_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/flash/css/content.css");},getControlHTML:function(cn){switch(cn){case"flash":return tinyMCE.getButtonHTML(cn,'lang_flash_desc','{$pluginurl}/images/flash.gif','mceFlash');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceFlash":var name="",swffile="",swfwidth="",swfheight="",action="insert";var template=new Array();var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();template['file']='../../plugins/flash/flash.htm';template['width']=430;template['height']=175;template['width']+=tinyMCE.getLang('lang_flash_delta_width',0);template['height']+=tinyMCE.getLang('lang_flash_delta_height',0);if(focusElm!=null&&focusElm.nodeName.toLowerCase()=="img"){name=tinyMCE.getAttrib(focusElm,'class');if(name.indexOf('mceItemFlash')==-1)return true;swffile=tinyMCE.getAttrib(focusElm,'alt');if(tinyMCE.getParam('convert_urls'))swffile=eval(tinyMCE.settings['urlconverter_callback']+"(swffile, null, true);");swfwidth=tinyMCE.getAttrib(focusElm,'width');swfheight=tinyMCE.getAttrib(focusElm,'height');action="update";}tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",swffile:swffile,swfwidth:swfwidth,swfheight:swfheight,action:action});return true;}return false;},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":if(tinyMCE.getParam('convert_urls')){var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){if(tinyMCE.getAttrib(imgs[i],"class")=="mceItemFlash"){var src=tinyMCE.getAttrib(imgs[i],"alt");if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('alt',src);imgs[i].setAttribute('title',src);}}}break;case"get_from_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){if(tinyMCE.getAttrib(imgs[i],"class")=="mceItemFlash"){var src=tinyMCE.getAttrib(imgs[i],"alt");if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('alt',src);imgs[i].setAttribute('title',src);}}break;case"insert_to_editor":var startPos=0;var embedList=new Array();content=content.replace(new RegExp('<[ ]*embed','gi'),'<embed');content=content.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');content=content.replace(new RegExp('<[ ]*object','gi'),'<object');content=content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');while((startPos=content.indexOf('<embed',startPos+1))!=-1){var endPos=content.indexOf('>',startPos);var attribs=TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos+6,endPos));embedList[embedList.length]=attribs;}var index=0;while((startPos=content.indexOf('<object',startPos))!=-1){if(index>=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('</object>',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+='<img width="'+attribs["width"]+'" height="'+attribs["height"]+'"';content+=' src="'+(tinyMCE.getParam("theme_href")+'/images/spacer.gif')+'" title="'+attribs["src"]+'"';content+=' alt="'+attribs["src"]+'" class="mceItemFlash" />'+content.substring(endPos);content+=contentAfter;index++;startPos++;}var index=0;while((startPos=content.indexOf('<embed',startPos))!=-1){if(index>=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('>',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+='<img width="'+attribs["width"]+'" height="'+attribs["height"]+'"';content+=' src="'+(tinyMCE.getParam("theme_href")+'/images/spacer.gif')+'" title="'+attribs["src"]+'"';content+=' alt="'+attribs["src"]+'" class="mceItemFlash" />'+content.substring(endPos);content+=contentAfter;index++;startPos++;}break;case"get_from_editor":var startPos=-1;while((startPos=content.indexOf('<img',startPos+1))!=-1){var endPos=content.indexOf('/>',startPos);var attribs=TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos+4,endPos));if(attribs['class']!="mceItemFlash")continue;endPos+=2;var embedHTML='';var wmode=tinyMCE.getParam("flash_wmode","");var quality=tinyMCE.getParam("flash_quality","high");var menu=tinyMCE.getParam("flash_menu","false");embedHTML+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';embedHTML+=' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';embedHTML+=' width="'+attribs["width"]+'" height="'+attribs["height"]+'">';embedHTML+='<param name="movie" value="'+attribs["title"]+'" />';embedHTML+='<param name="quality" value="'+quality+'" />';embedHTML+='<param name="menu" value="'+menu+'" />';embedHTML+='<param name="wmode" value="'+wmode+'" />';embedHTML+='<embed src="'+attribs["title"]+'" wmode="'+wmode+'" quality="'+quality+'" menu="'+menu+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+attribs["width"]+'" height="'+attribs["height"]+'"></embed></object>';chunkBefore=content.substring(0,startPos);chunkAfter=content.substring(endPos);content=chunkBefore+embedHTML+chunkAfter;}break;}return content;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&tinyMCE.getAttrib(node,'class').indexOf('mceItemFlash')==0){tinyMCE.switchClass(editor_id+'_flash','mceButtonSelected');return true;}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_flash','mceButtonNormal');return true;},_parseAttributes:function(attribute_string){var attributeName="";var attributeValue="";var withInName;var withInValue;var attributes=new Array();var whiteSpaceRegExp=new RegExp('^[ \n\r\t]+','g');if(attribute_string==null||attribute_string.length<2)return null;withInName=withInValue=false;for(var i=0;i<attribute_string.length;i++){var chr=attribute_string.charAt(i);if((chr=='"'||chr=="'")&&!withInValue)withInValue=true;else if((chr=='"'||chr=="'")&&withInValue){withInValue=false;var pos=attributeName.lastIndexOf(' ');if(pos!=-1)attributeName=attributeName.substring(pos+1);attributes[attributeName.toLowerCase()]=attributeValue.substring(1);attributeName="";attributeValue="";}else if(!whiteSpaceRegExp.test(chr)&&!withInName&&!withInValue)withInName=true;if(chr=='='&&withInName)withInName=false;if(withInName)attributeName+=chr;if(withInValue)attributeValue+=chr;}return attributes;}};tinyMCE.addPlugin("flash",TinyMCE_FlashPlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,287 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.34 $
+ * $Date: 2006/02/10 16:29:39 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('flash', 'en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk,pt_br');
+
+var TinyMCE_FlashPlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Flash',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_flash.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  initInstance : function(inst) {
+    if (!tinyMCE.settings['flash_skip_plugin_css'])
+      tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/flash/css/content.css");
+  },
+
+  getControlHTML : function(cn) {
+    switch (cn) {
+      case "flash":
+        return tinyMCE.getButtonHTML(cn, 'lang_flash_desc', '{$pluginurl}/images/flash.gif', 'mceFlash');
+    }
+
+    return "";
+  },
+
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    // Handle commands
+    switch (command) {
+      case "mceFlash":
+        var name = "", swffile = "", swfwidth = "", swfheight = "", action = "insert";
+        var template = new Array();
+        var inst = tinyMCE.getInstanceById(editor_id);
+        var focusElm = inst.getFocusElement();
+
+        template['file']   = '../../plugins/flash/flash.htm'; // Relative to theme
+        template['width']  = 430;
+        template['height'] = 175;
+
+        template['width'] += tinyMCE.getLang('lang_flash_delta_width', 0);
+        template['height'] += tinyMCE.getLang('lang_flash_delta_height', 0);
+
+        // Is selection a image
+        if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
+          name = tinyMCE.getAttrib(focusElm, 'class');
+
+          if (name.indexOf('mceItemFlash') == -1) // Not a Flash
+            return true;
+
+          // Get rest of Flash items
+          swffile = tinyMCE.getAttrib(focusElm, 'alt');
+
+          if (tinyMCE.getParam('convert_urls'))
+            swffile = eval(tinyMCE.settings['urlconverter_callback'] + "(swffile, null, true);");
+
+          swfwidth = tinyMCE.getAttrib(focusElm, 'width');
+          swfheight = tinyMCE.getAttrib(focusElm, 'height');
+          action = "update";
+        }
+
+        tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", swffile : swffile, swfwidth : swfwidth, swfheight : swfheight, action : action});
+      return true;
+     }
+
+     // Pass to next handler in chain
+     return false;
+  },
+
+  cleanup : function(type, content) {
+    switch (type) {
+      case "insert_to_editor_dom":
+        // Force relative/absolute
+        if (tinyMCE.getParam('convert_urls')) {
+          var imgs = content.getElementsByTagName("img");
+          for (var i=0; i<imgs.length; i++) {
+            if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
+              var src = tinyMCE.getAttrib(imgs[i], "alt");
+
+              if (tinyMCE.getParam('convert_urls'))
+                src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
+
+              imgs[i].setAttribute('alt', src);
+              imgs[i].setAttribute('title', src);
+            }
+          }
+        }
+        break;
+
+      case "get_from_editor_dom":
+        var imgs = content.getElementsByTagName("img");
+        for (var i=0; i<imgs.length; i++) {
+          if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
+            var src = tinyMCE.getAttrib(imgs[i], "alt");
+
+            if (tinyMCE.getParam('convert_urls'))
+              src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
+
+            imgs[i].setAttribute('alt', src);
+            imgs[i].setAttribute('title', src);
+          }
+        }
+        break;
+
+      case "insert_to_editor":
+        var startPos = 0;
+        var embedList = new Array();
+
+        // Fix the embed and object elements
+        content = content.replace(new RegExp('<[ ]*embed','gi'),'<embed');
+        content = content.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');
+        content = content.replace(new RegExp('<[ ]*object','gi'),'<object');
+        content = content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');
+
+        // Parse all embed tags
+        while ((startPos = content.indexOf('<embed', startPos+1)) != -1) {
+          var endPos = content.indexOf('>', startPos);
+          var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 6, endPos));
+          embedList[embedList.length] = attribs;
+        }
+
+        // Parse all object tags and replace them with images from the embed data
+        var index = 0;
+        while ((startPos = content.indexOf('<object', startPos)) != -1) {
+          if (index >= embedList.length)
+            break;
+
+          var attribs = embedList[index];
+
+          // Find end of object
+          endPos = content.indexOf('</object>', startPos);
+          endPos += 9;
+
+          // Insert image
+          var contentAfter = content.substring(endPos);
+          content = content.substring(0, startPos);
+          content += '<img width="' + attribs["width"] + '" height="' + attribs["height"] + '"';
+          content += ' src="' + (tinyMCE.getParam("theme_href") + '/images/spacer.gif') + '" title="' + attribs["src"] + '"';
+          content += ' alt="' + attribs["src"] + '" class="mceItemFlash" />' + content.substring(endPos);
+          content += contentAfter;
+          index++;
+
+          startPos++;
+        }
+
+        // Parse all embed tags and replace them with images from the embed data
+        var index = 0;
+        while ((startPos = content.indexOf('<embed', startPos)) != -1) {
+          if (index >= embedList.length)
+            break;
+
+          var attribs = embedList[index];
+
+          // Find end of embed
+          endPos = content.indexOf('>', startPos);
+          endPos += 9;
+
+          // Insert image
+          var contentAfter = content.substring(endPos);
+          content = content.substring(0, startPos);
+          content += '<img width="' + attribs["width"] + '" height="' + attribs["height"] + '"';
+          content += ' src="' + (tinyMCE.getParam("theme_href") + '/images/spacer.gif') + '" title="' + attribs["src"] + '"';
+          content += ' alt="' + attribs["src"] + '" class="mceItemFlash" />' + content.substring(endPos);
+          content += contentAfter;
+          index++;
+
+          startPos++;
+        }
+
+        break;
+
+      case "get_from_editor":
+        // Parse all img tags and replace them with object+embed
+        var startPos = -1;
+
+        while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
+          var endPos = content.indexOf('/>', startPos);
+          var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 4, endPos));
+
+          // Is not flash, skip it
+          if (attribs['class'] != "mceItemFlash")
+            continue;
+
+          endPos += 2;
+
+          var embedHTML = '';
+          var wmode = tinyMCE.getParam("flash_wmode", "");
+          var quality = tinyMCE.getParam("flash_quality", "high");
+          var menu = tinyMCE.getParam("flash_menu", "false");
+
+          // Insert object + embed
+          embedHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
+          embedHTML += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
+          embedHTML += ' width="' + attribs["width"] + '" height="' + attribs["height"] + '">';
+          embedHTML += '<param name="movie" value="' + attribs["title"] + '" />';
+          embedHTML += '<param name="quality" value="' + quality + '" />';
+          embedHTML += '<param name="menu" value="' + menu + '" />';
+          embedHTML += '<param name="wmode" value="' + wmode + '" />';
+          embedHTML += '<embed src="' + attribs["title"] + '" wmode="' + wmode + '" quality="' + quality + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + attribs["width"] + '" height="' + attribs["height"] + '"></embed></object>';
+
+          // Insert embed/object chunk
+          chunkBefore = content.substring(0, startPos);
+          chunkAfter = content.substring(endPos);
+          content = chunkBefore + embedHTML + chunkAfter;
+        }
+        break;
+    }
+
+    // Pass through to next handler in chain
+    return content;
+  },
+
+  handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+    if (node == null)
+      return;
+
+    do {
+      if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItemFlash') == 0) {
+        tinyMCE.switchClass(editor_id + '_flash', 'mceButtonSelected');
+        return true;
+      }
+    } while ((node = node.parentNode));
+
+    tinyMCE.switchClass(editor_id + '_flash', 'mceButtonNormal');
+
+    return true;
+  },
+
+  // Private plugin internal functions
+
+  _parseAttributes : function(attribute_string) {
+    var attributeName = "";
+    var attributeValue = "";
+    var withInName;
+    var withInValue;
+    var attributes = new Array();
+    var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
+
+    if (attribute_string == null || attribute_string.length < 2)
+      return null;
+
+    withInName = withInValue = false;
+
+    for (var i=0; i<attribute_string.length; i++) {
+      var chr = attribute_string.charAt(i);
+
+      if ((chr == '"' || chr == "'") && !withInValue)
+        withInValue = true;
+      else if ((chr == '"' || chr == "'") && withInValue) {
+        withInValue = false;
+
+        var pos = attributeName.lastIndexOf(' ');
+        if (pos != -1)
+          attributeName = attributeName.substring(pos+1);
+
+        attributes[attributeName.toLowerCase()] = attributeValue.substring(1);
+
+        attributeName = "";
+        attributeValue = "";
+      } else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
+        withInName = true;
+
+      if (chr == '=' && withInName)
+        withInName = false;
+
+      if (withInName)
+        attributeName += chr;
+
+      if (withInValue)
+        attributeValue += chr;
+    }
+
+    return attributes;
+  }
+};
+
+tinyMCE.addPlugin("flash", TinyMCE_FlashPlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/flash.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/flash.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/flash.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_flash_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/flash.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+  <link href="css/flash.css" rel="stylesheet" type="text/css" />
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+    <form onsubmit="insertFlash();return false;" action="#">
+    <div class="tabs">
+      <ul>
+        <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_flash_general}</a></span></li>
+      </ul>
+    </div>
+
+    <div class="panel_wrapper">
+      <div id="general_panel" class="panel current">
+        <fieldset>
+          <legend>{$lang_flash_general}</legend>
+
+          <table border="0" cellpadding="4" cellspacing="0">
+              <tr>
+              <td nowrap="nowrap"><label for="file">{$lang_flash_file}</label></td>
+                <td nowrap="nowrap">
+                  <table border="0" cellspacing="0" cellpadding="0">
+                    <tr>
+                    <td><input id="file" name="file" type="text" value="" onfocus="this.select();" /></td>
+                    <td id="filebrowsercontainer">&nbsp;</td>
+                    </tr>
+                  </table>
+                </td>
+              </tr>
+              <tr id="linklistrow">
+                <td><label for="linklist">{$lang_flash_list}</label></td>
+                <td id="linklistcontainer">&nbsp;</td>
+              </tr>
+              <tr>
+                <td nowrap="nowrap"><label>{$lang_flash_size}</label></td>
+                <td nowrap="nowrap">
+                  <input type="text" id="width" name="width" value="" onfocus="this.select();" />
+                  <select name="width2" id="width2" style="width: 50px">
+                    <option value="">px</option>
+                    <option value="%">%</option>
+                  </select>&nbsp;x&nbsp;<input id="height" name="height" type="text"  value="" onfocus="this.select();" />
+                  <select name="height2" id="height2" style="width: 50px">
+                    <option value="">px</option>
+                    <option value="%">%</option>
+                  </select>
+                </td>
+              </tr>
+          </table>
+        </fieldset>
+      </div>
+    </div>
+
+    <div class="mceActionPanel">
+      <div style="float: left">
+        <input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertFlash();" />
+      </div>
+
+      <div style="float: right">
+        <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+      </div>
+    </div>
+  </form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/images/flash.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/images/flash.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/jscripts/flash.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/jscripts/flash.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/jscripts/flash.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,107 @@
+var url = tinyMCE.getParam("flash_external_list_url");
+if (url != null) {
+  // Fix relative
+  if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+    url = tinyMCE.documentBasePath + "/" + url;
+
+  document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+}
+
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  document.getElementById("filebrowsercontainer").innerHTML = getBrowserHTML('filebrowser','file','flash','flash');
+
+  // Image list outsrc
+  var html = getFlashListHTML('filebrowser','file','flash','flash');
+  if (html == "")
+    document.getElementById("linklistrow").style.display = 'none';
+  else
+    document.getElementById("linklistcontainer").innerHTML = html;
+
+  var formObj = document.forms[0];
+  var swffile   = tinyMCE.getWindowArg('swffile');
+  var swfwidth  = '' + tinyMCE.getWindowArg('swfwidth');
+  var swfheight = '' + tinyMCE.getWindowArg('swfheight');
+
+  if (swfwidth.indexOf('%')!=-1) {
+    formObj.width2.value = "%";
+    formObj.width.value  = swfwidth.substring(0,swfwidth.length-1);
+  } else {
+    formObj.width2.value = "px";
+    formObj.width.value  = swfwidth;
+  }
+
+  if (swfheight.indexOf('%')!=-1) {
+    formObj.height2.value = "%";
+    formObj.height.value  = swfheight.substring(0,swfheight.length-1);
+  } else {
+    formObj.height2.value = "px";
+    formObj.height.value  = swfheight;
+  }
+
+  formObj.file.value = swffile;
+  formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true);
+
+  selectByValue(formObj, 'linklist', swffile);
+
+  // Handle file browser
+  if (isVisible('filebrowser'))
+    document.getElementById('file').style.width = '230px';
+
+  // Auto select flash in list
+  if (typeof(tinyMCEFlashList) != "undefined" && tinyMCEFlashList.length > 0) {
+    for (var i=0; i<formObj.linklist.length; i++) {
+      if (formObj.linklist.options[i].value == tinyMCE.getWindowArg('swffile'))
+        formObj.linklist.options[i].selected = true;
+    }
+  }
+}
+
+function getFlashListHTML() {
+  if (typeof(tinyMCEFlashList) != "undefined" && tinyMCEFlashList.length > 0) {
+    var html = "";
+
+    html += '<select id="linklist" name="linklist" style="width: 250px" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.file.value=this.options[this.selectedIndex].value;">';
+    html += '<option value="">---</option>';
+
+    for (var i=0; i<tinyMCEFlashList.length; i++)
+      html += '<option value="' + tinyMCEFlashList[i][1] + '">' + tinyMCEFlashList[i][0] + '</option>';
+
+    html += '</select>';
+
+    return html;
+  }
+
+  return "";
+}
+
+function insertFlash() {
+  var formObj = document.forms[0];
+  var html      = '';
+  var file      = formObj.file.value;
+  var width     = formObj.width.value;
+  var height    = formObj.height.value;
+  if (formObj.width2.value=='%') {
+    width = width + '%';
+  }
+  if (formObj.height2.value=='%') {
+    height = height + '%';
+  }
+
+  if (width == "")
+    width = 100;
+
+  if (height == "")
+    height = 100;
+
+  html += ''
+    + '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" mce_src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '
+    + 'width="' + width + '" height="' + height + '" '
+    + 'border="0" alt="' + file + '" title="' + file + '" class="mceItemFlash" />';
+
+  tinyMCEPopup.execCommand("mceInsertContent", true, html);
+  tinyMCE.selectedInstance.repaint();
+
+  tinyMCEPopup.close();
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,11 @@
+// UK lang variables
+
+tinyMCE.addToLang('flash',{
+title : 'Insert / edit Flash Movie',
+desc : 'Insert / edit Flash Movie',
+file : 'Flash-File (.swf)',
+size : 'Size',
+list : 'Flash files',
+props : 'Flash properties',
+general : 'General'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/flash/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('fullscreen','en,tr,sv,cs,fr_ca,zh_cn,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');var TinyMCE_FullScreenPlugin={getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_fullscreen.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"fullscreen":return tinyMCE.getButtonHTML(cn,'lang_fullscreen_desc','{$pluginurl}/images/fullscreen.gif','mceFullScreen');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceFullScreen":if(tinyMCE.getParam('fullscreen_is_enabled')){window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'),'mceSetContent',false,tinyMCE.getContent(editor_id));top.close();}else{tinyMCE.setWindowArg('editor_id',editor_id);var win=window.open(tinyMCE.baseURL+"/plugins/fullscreen/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(tinyMCE.getParam('fullscreen_is_enabled'))tinyMCE.switchClass(editor_id+'_fullscreen','mceButtonSelected');return true;}};tinyMCE.addPlugin("fullscreen",TinyMCE_FullScreenPlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.16 $
+ * $Date: 2006/03/14 17:33:39 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('fullscreen', 'en,tr,sv,cs,fr_ca,zh_cn,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');
+
+var TinyMCE_FullScreenPlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Fullscreen',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_fullscreen.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  getControlHTML : function(cn) {
+    switch (cn) {
+      case "fullscreen":
+        return tinyMCE.getButtonHTML(cn, 'lang_fullscreen_desc', '{$pluginurl}/images/fullscreen.gif', 'mceFullScreen');
+    }
+
+    return "";
+  },
+
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    // Handle commands
+    switch (command) {
+      case "mceFullScreen":
+        if (tinyMCE.getParam('fullscreen_is_enabled')) {
+          // In fullscreen mode
+          window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'), 'mceSetContent', false, tinyMCE.getContent(editor_id));
+          top.close();
+        } else {
+          tinyMCE.setWindowArg('editor_id', editor_id);
+
+          var win = window.open(tinyMCE.baseURL + "/plugins/fullscreen/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
+          try { win.resizeTo(screen.availWidth, screen.availHeight); } catch (e) {}
+        }
+    
+        return true;
+    }
+
+    // Pass to next handler in chain
+    return false;
+  },
+
+  handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+    if (tinyMCE.getParam('fullscreen_is_enabled'))
+      tinyMCE.switchClass(editor_id + '_fullscreen', 'mceButtonSelected');
+
+    return true;
+  }
+};
+
+tinyMCE.addPlugin("fullscreen", TinyMCE_FullScreenPlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/fullscreen.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/fullscreen.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/fullscreen.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,91 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_fullscreen_title}</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <script language="javascript" type="text/javascript" src="../../tiny_mce.js"></script>
+  <script language="javascript" type="text/javascript">
+    function patchCallback(settings, key) {
+      if (settings[key])
+        settings[key] = "window.opener." + settings[key];
+    }
+
+    var settings = new Array();
+
+    // Clone array
+    for (var name in window.opener.tinyMCE.settings)
+      settings[name] = window.opener.tinyMCE.settings[name];
+
+    // Override options for fullscreen
+    for (var name in window.opener.tinyMCE.settings.fullscreen_settings)
+      settings[name] = window.opener.tinyMCE.settings.fullscreen_settings[name];
+
+    // Patch callbacks, make them point to window.opener
+    patchCallback(settings, 'urlconverter_callback');
+    patchCallback(settings, 'insertlink_callback');
+    patchCallback(settings, 'insertimage_callback');
+    patchCallback(settings, 'setupcontent_callback');
+    patchCallback(settings, 'save_callback');
+    patchCallback(settings, 'onchange_callback');
+    patchCallback(settings, 'init_instance_callback');
+    patchCallback(settings, 'file_browser_callback');
+    patchCallback(settings, 'cleanup_callback');
+    patchCallback(settings, 'execcommand_callback');
+    patchCallback(settings, 'oninit');
+
+    // Set options
+    settings['mode'] = 'exact';
+    settings['elements'] = 'fullscreenarea';
+    settings['ask'] = false;
+    settings['setupcontent_callback'] = 'setupContent';
+    settings['fullscreen_is_enabled'] = true;
+    settings['fullscreen_editor_id'] = window.opener.tinyMCE.getWindowArg("editor_id");
+    settings['theme_advanced_resizing'] = false;
+
+    // Init
+    tinyMCE.init(settings);
+    tinyMCE.documentBasePath = window.opener.tinyMCE.documentBasePath;
+
+    function setupContent(editor_id, body, doc) {
+      var inst = tinyMCE.getInstanceById(editor_id);
+      var content = window.opener.tinyMCE.getContent(tinyMCE.getParam('fullscreen_editor_id'));
+
+      // Setup title
+      var divElm = document.createElement("div");
+      divElm.innerHTML = tinyMCELang['lang_fullscreen_title'];
+      document.title = divElm.innerHTML;
+
+      // Get content
+      inst.execCommand('mceSetContent', false, content);
+    }
+
+    function unloadHandler(e) {
+      moveContent();
+    }
+
+    function moveContent() {
+      var doc = tinyMCE.isMSIE ? window.frames['mce_editor_0'].window.document : document.getElementById('mce_editor_0').contentDocument;
+      window.opener.tinyMCE.setInnerHTML(window.opener.tinyMCE.selectedInstance.getBody(), doc.body.innerHTML);
+    }
+
+    // Add onunload
+    tinyMCE.addEvent(window, "beforeunload", unloadHandler);
+
+    function doParentSubmit() {
+      moveContent();
+
+      if (window.opener.tinyMCE.selectedInstance.formElement.form)
+        window.opener.tinyMCE.selectedInstance.formElement.form.submit();
+
+      window.close();
+
+      return false;
+    }
+  </script>
+  <base target="_self" />
+</head>
+<body style="margin: 0; overflow: hidden; height: 100%" scrolling="no" scroll="no">
+<form onsubmit="doParentSubmit();" style="height: 100%">
+<textarea id="fullscreenarea" style="width: 100%; height: 100%"></textarea>
+</form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/images/fullscreen.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/images/fullscreen.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,6 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+fullscreen_title : 'Fullscreen mode',
+fullscreen_desc : 'Toggle fullscreen mode'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/fullscreen/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config/config.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config/config.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config/config.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,101 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser - configuration
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.3.6                 Date: 08/02/2006
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // INSTRUCTIONS:
+  //
+  //  Please make sure that all of the following directories have writing permissions:
+  //  1. image libraries (chmod 0755 or 0777)
+  //  2. ibrowser/scripts/phpThumb/cache  (chmod 0755 or 0777)
+  //  3. ibrowser/temp (chmod 0755 or 0777)
+  
+  //  see readme.txt for further instructions 
+  
+  //------------------------------------------------------------------------- 
+  $cfg['lang']      = 'en';                           // default language; e.g. 'en'    
+  $cfg['valid']     = array('gif', 'jpg', 'jpeg', 'png');           // valid extentions for image files 
+  $cfg['upload']    = true;                           // allow uploading of image: 'true' or 'false'
+  $cfg['umax']    = 1;                            // max. number of image files to be uploaded; default: 1; value > 1
+  $cfg['create']    = true;                           // allow to create directory: 'true' or 'false'
+  $cfg['delete']    = true;                           // allow deletion of image: 'true' or 'false' 
+  $cfg['rename']    = true;                           // allow renaming of image: 'true' or 'false'
+  $cfg['attrib']    = false;                          // allow changing image attributes: 'true' or 'false'; default = false;   
+  $cfg['furl']    = true;                           // default: true; if set to true, full url incl. domain will be added to image src
+  $cfg['random']      = '&w=150&h=150&zc=1';                    // random image parameters (see phpThumb readme for more information)
+  $cfg['style'] = array (                             // css styles for images ('class' => 'descr'); - please make sure that the classes exist in your css file
+      'left'        => 'align left',                  // image: float left
+      'right'       => 'align right',                 // image: float right
+      'capDivRightBrd'  => 'align right, border',             // caption: float right with border
+      'capDivRight'     => 'align right',                 // caption: float right
+      'capDivLeftBrd'   => 'align left, border',              // caption: float left with border
+      'capDivLeft'    => 'align left',                  // caption: float left
+  );
+  $cfg['list']    = true;                           // default: true; if set to true, image selection will be shown as list; if set to false, image selection will show thumbnails
+  //-------------------------------------------------------------------------
+  // set image formats  
+  $cfg['thumbs'] = array (                              
+    /* array (                                  //        settings                                  
+      'size'    => '*',                           //        'size' = if set to '*' or '0', no image resizing will be done, otherwise set to desired width or height, e.g. 640
+      'ext'     => '*',                           //        'ext'  = if set to '*' width or height will be set as identifier. If set to '', no identifier will be set.
+      'crop'      => false,                         //        'crop' = if set to true, image will be zoom cropped resulting in a square image                 
+    ), */
+    array (
+      'size'    => '*',                       
+      'ext'     => '*',
+      'crop'      => false,
+    ),
+    array (
+      'size'    => 200,                       
+      'ext'     => '*',
+      'crop'      => false,
+    ),
+    array (
+      'size'    => 120,                       
+      'ext'     => '*',
+      'crop'      => false,
+    ),
+
+  );
+  //-------------------------------------------------------------------------
+  // use static image libraries 
+/*  $cfg['ilibs'] = array (                               // image library path with slashes; absolute to root directory - please make sure that the directories have write permissions 
+    array (                                   
+      'value'     => '/dev/im/assets/images/',                        
+      'text'      => 'Site Pictures',
+    ),
+    array (
+      'value'     => '/dev/im/assets/gallery/',         
+      'text'      => 'Gallery',
+    ),  
+  );*/
+  //-------------------------------------------------------------------------
+  // use dynamic image libraries - if $cfg['ilibs_inc'] is set, static image libraries above are ignored
+  // image directories to be scanned
+  $cfg['ilibs_dir']      = array(DIR_WS_CATALOG_IMAGES);                // image library path with slashes; absolute to root directory - please make sure that the directories have write permissions
+  $cfg['ilibs_dir_show'] = true;                            // show main library (true) or only sub-dirs (false)
+  $cfg['ilibs_inc']      = realpath(dirname(__FILE__) . '/../scripts/rdirs.php');   // file to include in ibrowser.php (useful for setting $cfg['ilibs] dynamically
+  //-------------------------------------------------------------------------
+  // you shouldn't need to make any changes to the config variable beyond this line!
+  //-------------------------------------------------------------------------
+  $osslash = ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') ? '\\' : '/');
+  $cfg['ver']     = '1.3.6 - build 08022006';                   // iBrowser version 
+  //$cfg['root_dir']  = realpath((getenv('DOCUMENT_ROOT') && ereg('^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))), realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace($osslash, '/', dirname(__FILE__))));
+  $cfg['root_dir']    = ((@$_SERVER['DOCUMENT_ROOT'] && file_exists(@$_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF'])) ? $_SERVER['DOCUMENT_ROOT'] : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace('\\', '/', realpath('.'))));
+  $cfg['base_url']  = 'http://' . $_SERVER['SERVER_NAME'];              // base url; e.g. 'http://localhost/' 
+  //$cfg['main_dir']  = dirname($_SERVER['PHP_SELF']);                // iBrowser main dir; e.g. '/home/domain/public_html/ibrowser/' 
+  $cfg['main_dir']    = ereg_replace("//", "/", dirname($_SERVER['PHP_SELF']));
+  $cfg['scripts']   = $cfg['main_dir'] . '/scripts/';                 // scripts dir; e.g. '/home/domain/public_html/ibrowser/scripts/' 
+  $cfg['pop_url']     = $cfg['scripts'] . 'popup.php';                // popup dir; relative to 'script' dir  
+# $cfg['temp']      = DIR_FS_CATALOG . DIR_FS_CACHE; //realpath(dirname(__FILE__) . '/../temp');          // temp dir; e.g. 'D:/www/temp' 
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/config/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+header('Location: /');
+exit;
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+header('Location: /');
+exit;
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css/style.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css/style.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/css/style.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,657 @@
+/* ================================================
+// PHP image browser - iBrowser 
+// ================================================
+// iBrowser - style definitions
+// ================================================
+// Developed: net4visions.com
+// Copyright: net4visions.com
+// License: GPL - see license.txt
+// (c)2005 All rights reserved.
+// ================================================
+// Revision: 1.0                   Date: 12/10/2005
+// ================================================*/
+
+body {
+   margin: 5px;
+   padding: 0px;
+   color: #333333;
+  background-color: #efefef;
+  scrollbar-3dlight-color:#f5f5f5;
+  scrollbar-arrow-color:#666666;
+  scrollbar-base-color:#F0F0EE;
+  scrollbar-darkshadow-color:#DDDDDD;
+  scrollbar-face-color:#E0E0DD;
+  scrollbar-highlight-color:#F0F0EE;
+  scrollbar-shadow-color:#F0F0EE;
+  scrollbar-track-color:#F5F5F5;
+}
+/* ---------------------------------------------------------------
+- font settings
+*/
+body, form, table {
+  font-size:10px; 
+  font-family:Verdana,Arial,Helvetica,sans-serif;
+  font-weight: normal;  
+}
+body {
+  color: #000000;
+  background-color: #efefef;
+  filter:progid:dximagetransform.microsoft.gradient(gradienttype=0,startcolorstr=#D7D7D7,endcolorstr=#FCFBFF);  
+}
+body p {
+  line-height: 18px;
+  margin-top: 0px;
+}
+/* ---------------------------------------------------------------
+- links
+*/
+a:link, a:visited, a:active {
+  color: #666666;
+  background-color: transparent;
+}
+a:hover {
+  color: #000000;
+  background-color: transparent;
+  text-decoration: none;
+}
+/* ---------------------------------------------------------------
+- page layout
+*/
+/* outer div */
+#outerDivWrap {     
+  width: 640px;
+}
+/* main- and sub content */
+#mainDivWrap {
+  margin-left: 110px;
+}
+/* menu- and main div */
+#menuDiv, #mainDiv { /* Firefox */
+  min-height: 320px;  
+}
+*html #menuDiv, *html #mainDiv { /* IE */
+  height: 320px;
+}
+/* footer div */
+#ftDivWrap {  
+  margin-left: 110px; 
+  margin-top: 10px;
+  padding: 10px;
+}
+#ftDiv {
+  text-align: center;
+}
+/* menu wrap */
+#menuDivWrap {  
+  width: 100px; 
+  position: absolute;
+  z-index:1;
+}
+/* border and padding */
+div.brdPad {
+  padding: 10px;
+  border: 1px solid #003399;  
+}
+/* headers */
+#outerDivWrap .headerDiv {
+  background-image:url(../images/buttonbar.gif);
+  background-repeat:repeat-x;
+  color: #003399;
+  background-color: #96b3de; 
+}
+#menuDivWrap .headerDiv, #mainDivWrap .headerDiv, #dialog .headerDiv {
+  background-image:url(../images/buttonbar_gs.gif);
+  background-repeat:repeat-x;
+  color: #003399;
+  background-color: #ff9900;    
+}
+div.headerDiv { 
+  padding-left: 10px;
+  padding-right: 10px;
+  border: 1px solid #003399;
+  border-bottom: none;
+  line-height: 22px;  
+  font-weight: bold;
+  vertical-align: middle; 
+}
+/* columns */
+div.colLeft {   
+  float: left;
+  width: 300px; 
+  margin-right: 10px; 
+}
+div.colRight {  
+  margin-left: 310px;
+  width: 176px; 
+}
+* html div.colLeft {
+  margin-right: 7px;
+}
+* html div.colRight {
+  margin-left: 307px;
+}
+/* float wrap */
+div.floatWrap {
+  display: inline-block;
+  margin-bottom: 10px;  
+}
+/* IE Win only Hack \*/
+* html div.floatWrap {
+  height: 1%;
+}
+div.floatWrap {
+  display: block;
+}
+/* end IE Hack */
+div.floatWrap:after {
+  content: ".";
+  display: block;
+  height: 0px;
+  clear: both;
+  visibility: hidden; 
+}
+/* ---------------------------------------------------------------
+- main menu buttons
+*/
+#menuBarDiv {
+  color:#000000;  
+  background-color:transparent;
+  border-top:1px solid threedshadow;
+  border-bottom:1px solid threedhighlight;
+  border-left:1px solid threedshadow;
+  border-right:1px solid threedhighlight; 
+}
+#menuBarDiv ul {
+  list-style-type:none;
+  margin: 0px;
+  padding: 0px; 
+}
+#menuBarDiv li {  
+  text-align: center;
+  height: 75px;
+  cursor: pointer;  
+}
+#menuBarDiv li img {
+  margin-top: 10px; 
+}
+#menuBarDiv li div {
+  margin-bottom: 0px; 
+}
+/* ---------------------------------------------------------------
+- menu buttons
+*/
+li.btnUp {  
+  border: 1px solid threedface;
+  /* background-color: threedface; */
+  background-color: #efefef;
+  filter:progid:dximagetransform.microsoft.gradient(gradienttype=0,startcolorstr=#FCFBFF,endcolorstr=#D7D7D7);  
+}
+li.btnDown {  
+  border-top: 1px solid buttonshadow;
+  border-left: 1px solid buttonshadow;
+  border-bottom: 1px solid buttonhighlight;
+  border-right: 1px solid buttonhighlight;
+  background-color: #efefef;  
+  filter:progid:dximagetransform.microsoft.gradient(gradienttype=0,startcolorstr=#D7D7D7,endcolorstr=#FCFBFF);  
+}
+li.btnOver {  
+  border-bottom: 1px solid buttonshadow;
+  border-right: 1px solid buttonshadow;
+  border-top: 1px solid buttonhighlight;
+  border-left: 1px solid buttonhighlight;
+  background-color: threedface; 
+  filter:progid:dximagetransform.microsoft.gradient(gradienttype=0,startcolorstr=#D7D7D7,endcolorstr=#FCFBFF);  
+}
+/* ---------------------------------------------------------------
+- form settings
+*/
+form, fieldset, label, input, select {
+  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+fieldset {
+  border: none;
+  padding: 0px;
+  margin: 0px;
+}
+div.rowDiv {
+  clear: left;
+  float: none;    
+}
+div.rowDiv label, div.rowDiv input, div.rowDiv select, span.frmText {
+  display: block;
+  float: left;
+  margin-bottom: 2px;
+}
+div.rowDiv label {
+  width: 100px;
+  margin-right: 5px;
+  padding-top: 3px;
+  padding-bottom: 3px;  
+}
+div.rowDiv label span.title {
+  color: #666666;
+  background-color:transparent;
+  font-weight: bold;
+}
+div.rowDiv input, div.rowDiv select {
+  border: 1px solid #cccccc;
+  color: #333333;
+  background-color: #ffffff;
+}
+div.rowDiv input {
+  height: 14px;
+}
+* html div.rowDiv input { 
+  height: 19px;   
+}
+div.rowDiv input.chkBox {
+  border: none;
+  background-color: transparent;
+}
+* html div.rowDiv input.chkBox {
+  margin-left: -3px;
+}
+div.rowDiv input.readonly {
+  color: #666666;
+  background-color: #efefef;  
+  border: 1px solid #cccccc;  
+}
+div.rowDiv input[type="file"] { /* firefox */
+  background-color: #efefef;
+  height: auto; 
+}
+div.rowDiv span.frmText {
+  margin-left: 5px;
+  padding-top: 3px;
+  padding-bottom: 3px;
+}
+div.rowDiv input.fldlg, div.rowDiv select.fldlg {
+  width: 355px;
+}
+* html div.rowDiv input.fldlg, * html div.rowDiv select.fldlg {
+  width: 357px;
+}
+div.rowDiv input.fldmlg {
+  width: 334px;
+}
+*html div.rowDiv input.fldmlg {
+  width: 336px;
+}
+div.rowDiv input.fldm, div.rowDiv select.fldm {
+  width: 98px;
+}
+*html div.rowDiv input.fldm, *html div.rowDiv select.fldm {
+  width: 100px;
+}
+div.rowDiv input.fldsm, div.rowDiv select.fldsm {
+  width: 58px;
+}
+* html div.rowDiv input.fldsm, * html div.rowDiv select.fldsm {
+  width: 60px;
+}
+/* save/cancel buttons */
+input.btn { 
+  width: 70px;
+  color: #666666;
+  border: 1px solid #cccccc;  
+  cursor: pointer;  
+  padding-top: 1px;
+  padding-bottom: 1px;  
+  filter:progid:dximagetransform.microsoft.gradient(gradienttype=0,startcolorstr=#D7D7D7,endcolorstr=#FCFBFF);
+  margin-left: 0px; 
+}
+/* ---------------------------------------------------------------
+- preview frames
+*/
+#inPrevDiv, #atPrevDiv {
+  width: 150px;
+  height: 150px;  
+  margin: 0px;
+  border: 1px solid #cccccc;  
+  color: #333333;
+  background-color: #ffffff;
+  overflow: hidden; 
+}
+/* attributes preview */
+#atPrevDiv {
+  line-height: normal;  
+}
+#atPrevDiv p {
+  padding: 5px;
+  margin: 0px;
+  font-size: 8px; 
+  line-height: normal;
+}
+* html #inPrevDiv, * html #atPrevDiv {
+  float: left;
+}
+/* ---------------------------------------------------------------
+- image selection
+*/
+#inSelDiv {
+  width: 274px;
+  height: 150px;  
+  margin: 0px;
+  border: 1px solid #cccccc;
+  float: left;  
+}
+/* ---------------------------------------------------------------
+- image list (frame)
+*/
+div#iselDiv { /* IE, Firefox */
+  color: #000000; 
+  background-color: #ffffff;  
+  margin: 0px;
+  height: 150px;
+  width: 274px;
+  overflow: auto; 
+}
+* html div#iselDiv {
+  margin-left: -1px;
+}
+div#iselDiv ul {
+  white-space: nowrap;
+  line-height: 12px;
+  list-style: none;
+  cursor: pointer;
+  margin: 0px;
+  padding: 0px;
+  margin-top: 2px;  
+  margin-bottom: 2px;
+}
+li.cimgover {
+  color: #000000;
+  background-color: #e4e4e4;
+}
+li.cimgout {
+  color: #000000;
+  background-color: #ffffff;
+}
+li.cimgdown {
+  color: #000000;
+  background-color: #e4e4e4;
+}
+li.cimgup {
+  color: #000000;
+  background-color: #ffffff;
+}
+/* ---------------------------------------------------------------
+- select image formats
+*/
+#fmtDiv { 
+  margin-top: 0px;
+  margin-bottom: 0px;
+  margin-right: 0px;  
+  width: 357px;
+  height: auto; 
+  clear: none;
+  float: left;
+}
+#fmtDiv div {
+  float:left;
+  clear: none;
+  margin-right: 10px;
+  margin-bottom: 5px;
+  white-space: nowrap;  
+  width: 90px;
+  display: block; 
+  overflow: hidden; 
+}
+#fmtDiv input.chkBox {  
+  margin-left: 0px; 
+}
+* html #fmtDiv input.chkBox {
+  margin-left: -3px;
+}
+#fmtDiv img {
+  cursor: pointer;
+  margin-left: 5px; 
+}
+#fileDiv {
+  margin-top: 10px;
+}
+/* ---------------------------------------------------------------
+- load message
+*/
+#dialogLoadMessage {
+  position:absolute; 
+  z-index:1000; 
+  display:block;
+  width:100%; 
+  height:100%;
+}
+#loadMessage {
+  background-color:#96b3de; 
+  border:1px solid #003399; 
+  padding: 10px; 
+  width: 150px; 
+  color:#ffffff; 
+  font-family: verdana,arial,helvetica,sans-serif; 
+  font-size:12px; 
+  font-weight:bold
+}
+/* ---------------------------------------------------------------
+- info div
+*/
+#infoDiv {  
+  position: absolute; 
+  width:140px;  
+  z-index:1;    
+  left: 0px;
+  top: 0px;
+  border: 1px solid #cccccc;
+  color: #000000;
+  background-color: #f1f1f1;
+  padding: 5px;
+  font-size: 9px; 
+  filter:alpha(opacity=90); 
+  -moz-opacity:0.9;
+}
+* html div#infoDiv {
+  width: 150px;
+}
+#infoDiv div {  
+  clear: both;
+  margin-bottom: 2px; 
+}
+#infoDiv label  {
+  width: 55px;
+  display: block; 
+  float: left;
+  overflow: hidden; 
+  padding: 0px; 
+}
+#infoDiv span {
+  width: 75px;
+  display: block; 
+  text-align: right;  
+  overflow: hidden; 
+}
+/* ---------------------------------------------------------------
+- popupWrap
+*/
+div#poDelDiv {
+  clear: left;
+}
+div.poPrevDiv {
+  background-color: #ffffff;
+  border: 1px solid #cccccc;  
+  width: 80px;
+  height: 60px;
+  float: right; 
+  overflow: hidden;
+  margin-bottom: 2px; 
+}
+/* ---------------------------------------------------------------
+- version info
+*/
+span.ver {
+  font-size: 9px;
+  color: #adadad;
+  background-color: transparent;
+}
+/* ---------------------------------------------------------------
+- show/hide 
+*/
+.showit {
+  display: inline-block;
+}
+.hideit {
+  display: none;
+}
+/* ---------------------------------------------------------------
+- padding
+*/
+.pad5 {
+  padding-left: 5px;
+}
+.pad10 {
+  padding-left: 10px;
+}
+.pad20 {
+  padding-left: 20px;
+}
+.pad30 {
+  padding-left: 30px;
+}
+/* ---------------------------------------------------------------
+- margin
+*/
+.mtop5 {
+  margin-top: 5px;
+}
+.mtop10 {
+  margin-top: 10px;
+}
+.mtop15 {
+  margin-top: 15px;
+}
+.mbottom5 {
+  margin-bottom: 5px;
+}
+/* ---------------------------------------------------------------
+- clear floats
+*/
+.clrFloat {
+  clear: both;  
+  visibility: hidden; 
+}
+.clrFloatRight {
+  clear: right;
+  visibility: hidden;
+}
+/* ---------------------------------------------------------------
+- image buttons
+*/
+div.btnRight {  
+  float: right; 
+}
+div.btnRight img {
+  cursor: pointer;
+  margin-left: 5px;
+  margin-top: 1px;    
+}
+/* - help button - */
+div.btnRight img.hlpBtn {
+  cursor: help;
+  margin-left: 8px; 
+}
+div.btnRight span img {
+  margin-bottom: 5px; 
+}
+/* ---------------------------------------------------------------
+- image orientation
+*/
+img.left {
+  float: left;
+  margin-bottom: 5px;
+  margin-right: 5px;
+}
+img.right {
+  float: right;
+  margin-bottom: 5px;
+  margin-left: 5px;
+}
+/* --------------------------------------------------------------- 
+- symbols (special characters
+*/
+.charmap, .charmapOver {
+  color: #000000;
+  border: 1px solid #cccccc;  
+  cursor: pointer;
+  text-align: center;
+  vertical-align: middle; 
+}
+.charmapOver {
+  border: 1px solid #ff9900;  
+  background-color: #efefef;
+}
+a.charmap {
+  color: #000000;
+  text-decoration: none
+}
+/* - character preview - */
+td.charPrev {
+   font-size: 25px;
+   height: 60px;
+   background-color: #ffffff;
+   border: 1px solid #cccccc;
+   text-align: center;
+   vertical-align: middle;
+}
+/* --------------------------------------------------------------- 
+- hilight color
+*/
+.hilight {
+  color: #FF9933;
+}
+/* --------------------------------------------------------------- 
+- image caption
+*/
+span.capDivRightBrd {
+  float: right;
+  border: 1px solid #cccccc;
+  background-color: #f0f0ee;
+  padding: 5px; 
+  height: auto;
+  margin-left: 10px;
+  margin-bottom: 5px;
+}
+span.capDivRight {
+  float: right;
+  padding: 5px; 
+  height: auto;
+  margin-left: 10px;
+  margin-bottom: 5px;
+}
+span.capDivLeftBrd {
+  float: left;
+  border: 1px solid #cccccc;
+  background-color: #f0f0ee;
+  padding: 5px; 
+  height: auto;
+  margin-right: 10px;
+  margin-bottom: 5px;
+}
+span.capDivLeft {
+  float: left;
+  padding: 5px; 
+  height: auto;
+  margin-right: 10px;
+  margin-bottom: 5px;
+}
+span.caption {
+  font-family: Geneva, Arial, Helvetica, sans-serif;
+  font-size: 10px;
+  text-align: center; 
+  line-height: 12px;  
+  color: #666666;
+  background-color: transparent;
+  margin: 0px;
+  margin-top: 5px;  
+  padding: 0px;
+  display: block; 
+}
+/* EOF STYLES */
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/changelog.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/changelog.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/changelog.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,214 @@
+--------------------------------------
+08/02/2006 - release of iBrowser V 1.3.6 build 08022006
+
+- fixed a security in the renaming function
+
+--------------------------------------
+07/26/2006 - release of iBrowser V 1.3.5 build 07262006
+
+- language pack added: portuguese - provided by Ronaldo Chevalier
+
+--------------------------------------
+07/18/2006 - release of iBrowser V 1.3.5 build 07182006
+- updated phpThumb to latest version - 1.7.3-07112006
+--------------------------------------
+
+07/15/2006 - release of iBrowser V 1.3.4 build 07152006
+
+- fixed an issue with the loading message in the popup preview window
+
+--------------------------------------
+06/30/2006 - release of iBrowser V 1.3.3 build 06302006
+
+- language pack added: slovak - provided by Martin Sereday
+
+--------------------------------------
+06/08/2006 - release of iBrowser V 1.3.3 build 06082006
+
+- updated phpThumb to latest version - 1.7.2-May 2006
+- fixed an issue with FCKeditor V 2.3
+
+--------------------------------------
+05/03/2006 - release of iBrowser V 1.3.3 build 05032006
+
+- added new interface files for tinyMCE 2.05 and higher
+- updated phpThumb to latest version - 1.7.1-03162006
+
+--------------------------------------
+02/18/2006 - release of iBrowser V 1.3.2 build 02182006
+
+- language pack added: czech - provided by Tomas Vaverka
+
+--------------------------------------
+02/03/2006 - release of iBrowser V 1.3.2 build 02032006
+
+- language pack added: italian - provided by Luca Aru
+
+--------------------------------------
+12/31/2005 - release of iBrowser V 1.3.2 build 12312005
+
+- added plugin info for tinyMCE
+- updated phpThumb to latest version - 1.6.3-200512181059
+
+--------------------------------------
+12/10/2005 - release of iBrowser V 1.3.2 build 12122005
+
+- fixed an issue with dynamic libraries
+
+--------------------------------------
+12/10/2005 - release of iBrowser V 1.3.2 build 12102005
+
+- fixed some layout issues with Firefox V 1.5
+- updated phpThumb to latest version - 1.6.3 December
+
+--------------------------------------
+11/01/2005 - release of iBrowser V 1.3.1 build 11012005
+
+- fixed a bug in rdirs.php where first letter got cut off in directory names (dynamic libraries only)
+- updated phpThumb to latest version - 1.6.2 November
+
+--------------------------------------
+10/21/2005 - release of iBrowser V 1.3.1 build 10072005
+
+- language pack added: polish - provided by Kaziz
+
+--------------------------------------
+10/07/2005 - release of iBrowser V 1.3.1 build 10072005
+
+- fixed an issue with the caption function; replaced 'div' and 'p' tags with 'span'
+
+--------------------------------------
+09/12/2005 - release of iBrowser V 1.3 build 09122005
+
+- fixed an issue with the full size preview popup
+- updated phpThumb to latest version
+
+--------------------------------------
+08/12/2005 - release of iBrowser V 1.3 build 08122005
+
+- fixed some issues with German umlauts in alert boxes (escapeHTML added)
+
+--------------------------------------
+08/06/2005 - release of iBrowser V 1.3 build 08062005
+
+- fixed some issues when iBrowser was used together with iManager
+- added reset of width and height when switched to random
+- language pack added: french - provided by Gazou
+- language pack added: german - provided by Schnappi
+- language pack added: spanish - provided by Diego
+
+--------------------------------------
+08/05/2005 - release of iBrowser V 1.3 build 08052005
+
+- updated phpThumb to V 1.6 - please see phpThumb changelog for details
+- simplified the WYSIWYG editor interface files
+- added interface file for the HTMLarea editor
+- added random image - parameters: $cfg['random'];
+  please see phpThumb readme for detailed settings
+- added image caption function
+
+--------------------------------------
+07/07/2005 - release of iBrowser V 1.2 build 07072005
+
+- image selection: added a button to switch between thumbnail- and list view
+- added message when uploading image
+
+--------------------------------------
+06/28/2005 - release of iBrowser V 1.2 build 06282005
+
+- fixed an issue with the full size preview window
+- fixed an issue with the tinyMCE file and the 'onclick' event
+- fixed an issue with all the interface files if iBrowser is used together with iManager
+
+--------------------------------------
+06/23/2005 - release of iBrowser V 1.2 build 06232005
+
+- changed tinyMCE file to be compatible with V 1.45
+  if you like to use iBrowser with an earlier version of tinyMCE, please change 
+  'urlconverter_callback' to 'urlconvertor_callback' in the editor_plugin.js file
+- language pack added: danish - provided by Kim Michael Nielsen
+
+--------------------------------------
+06/14/2005 - release of iBrowser V 1.2 build 06142005
+
+- some layout changes
+- added $cfg['list'] parameter (default = true); if set to false, image selection dropdown will show thumbnail instead   of image list
+- some code simplifications
+- some bug fixes
+- added rotating function while uploading files
+- fixed an issue with the language class - thanks to René de Kat and Henry-Paul Benveniste
+- fixed some upload issues when image is smaller than pre-defined size
+
+--------------------------------------
+06/07/2005 - release of iBrowser V 1.1 build 06072005
+
+- language pack added: simplyfied chinese - provided by cube316
+
+--------------------------------------
+06/01/2005 - release of iBrowser V 1.1 build 06012005
+
+- language pack added: dutch - provided by René de Kat
+- fixed a bug when $cfg['upload'] was set to 'false'; thanks to - René de Kat
+- fixed the appearance of the file div although, all file functions were set to false
+- fixed some minor bugs if $cfg[''delete'] and $cfg['rename'] were set to false
+
+--------------------------------------
+05/27/2005 - release of iBrowser V 1.1 build 05272005
+
+- updated phpThumb to 1.5.4
+- changed readme file for SPAW installation
+
+--------------------------------------
+05/24/2005 - release of iBrowser V 1.1 build 05242005
+
+- rewrote the uploading procedure, allowing a user to set multiple 
+  images to be created while uploading
+- fixed an issue with the renaming of images
+
+--------------------------------------
+05/19/2005 - release of iBrowser V 1.1 build 05192005
+
+- added interface file for Xinha
+- fixed create directory procedure
+
+--------------------------------------
+05/15/2005 - release of iBrowser V 1.1 build 05152005
+
+- added interface file for FCKeditor
+
+--------------------------------------
+05/13/2005 - release of iBrowser V 1.1 build 05132005
+
+- fixed an issue with the popup window
+- resize window fixed when clicking upload button
+
+--------------------------------------
+05/10/2005 - release of iBrowser V 1.1 build 05102005
+
+- fixed some minor path issues
+- fixed bug with info layer
+
+--------------------------------------
+05/09/2005 - release of iBrowser V 1.1 build 05092005
+
+- added multiple image upload
+- update phpThumb to latest version
+
+--------------------------------------
+05/08/2005 - release of iBrowser V 1.1 build 05082005
+
+- added config parameter: $cfg['attrib']; if set to true, image width and height can be changed in the properties screen.
+
+--------------------------------------
+05/07/2005 - release of iBrowser V 1.1 build 05072005
+
+- improved layout
+- creating thumbnails while uploading
+- resizing images and thumbnails
+- renaming and deleting images
+- creating directories/libraries
+- creating image popup
+- supporting css tags for image tags
+
+--------------------------------------
+12/10/2004 - release of iBrowser V 1.0
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/license.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/license.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/license.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,133 @@
+iBrowser
+License:       GNU General Public Licence (GPL) - http://www.gnu.org/copyleft/gpl.html
+Copyright:     (c) 2005, net4visions.com
+Information:   http://www.net4visions.com
+
+Copyright:     © 2005 net4visions.com
+
+This iBrowser script is free software - you can redistribute
+it and/or modify it under the terms of the GNU General Public
+Licence (GPL) as published by the Free Software Foundation;
+either version 2.1 of the License, or any later version.
+
+This script is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public Licence (GPL)for more details.
+
+You should have received a copy of the GNU General Public Licence (GPL)
+along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+-------------------------------------------------------------------
+Licenses of used scripts:
+
+- SPAW         (WYSIWYG-Editor)
+  License:     GNU General Public Licence (GPL)
+  Copyright:   (c) 2003, Solmetra
+  Information: http://www.solmetra.com/spaw
+    
+- tinyMCE      (WYSIWYG-Editor)
+  License:     GNU General Public Licence (LGPL)
+  Copyright:   (c) 2004, MoxieCode Systems AB 
+  Information: http://tinymce.moxiecode.com
+  
+- phpThumb     (create/edit thumbnails) 
+  License:     GNU General Public Licence (GPL)
+  Copyright:   (c) 2004 James Heinrich  
+  Information: http://phpthumb.sourceforge.net
+
+-------------------------------------------------------------------
+
+
+GNU GENERAL PUBLIC LICENSE
+Version 2, June 1991 
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.  
+59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+Preamble
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. 
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. 
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. 
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. 
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. 
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. 
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. 
+
+The precise terms and conditions for copying, distribution and modification follow. 
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". 
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 
+
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. 
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: 
+
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. 
+
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. 
+
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) 
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. 
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. 
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: 
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 
+
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 
+
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) 
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. 
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. 
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. 
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. 
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. 
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
+
+
+END OF TERMS AND CONDITIONS
+

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/docs/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,223 @@
+// ================================================
+// PHP image browser - iBrowser 
+// ================================================
+// iBrowser - readme.txt
+// ================================================
+// Developed: net4visions.com
+// Copyright: net4visions.com
+// License: GPL - see readme.txt
+// (c)2005 All rights reserved.
+// ================================================
+// Revision: 1.0                   Date: 10/07/2005
+// ================================================
+
+---------------------------------------------------
+ - Thank you
+---------------------------------------------------
+
+Let me take this opportunity to thank everbody who has contributed
+to iBrowser - I could not have realized this project without the 
+patient help of James, Alan, Johan(Spoke), and Slava.
+
+
+---------------------------------------------------
+ - Introduction
+---------------------------------------------------
+
+iBrowser allows you to manage your image files on your webserver.
+You can create directories, upload file, rename and delete them. It also
+helps you to change the image properties.
+
+
+iBrowser currently works with tinyMCE, SPAW, FCKeditor, Xinha, and HTMLarea.
+
+If you're using the random picture function, please see the phpThumb readme for the parameter settings.
+
+If you need more features like image processing, please have a look at the
+net4visions.com iManager.
+ 
+
+---------------------------------------------------
+ - Installation
+---------------------------------------------------
+
+iBrowser has been confirmed to work with the latest version of
+Microsoft Internet Explorer and Firefox. In case you've a previous version of iBrowser installed,
+please delete it first!
+
+
+1. Prerequisites
+---------------------------------------------------
+   You will need to compile PHP with the GD library of image functions for iBrowser to work.
+   If you use CSS styles for images and/or image caption, please make sure that the used css styles also exist in 
+   your site's stylesheet AND the wysiwyg editor content area stylesheet.
+
+   
+2. Permission settings
+---------------------------------------------------
+   Make sure the following directories have writing
+   permission (chmod to 0755):
+
+  ibrowser/scripts/phpThumb/cache - should there be any files already, plese delete those!!!
+  ibrowser/temp
+
+  all the image libraries you set up in the iBrowser config file!
+
+
+3. Configuration
+---------------------------------------------------
+   Check configuration settings
+   The configuration of iBrowser if fairly easy - it depends a little
+   on what wysiwyg editor you're using
+
+   Setting up image libraries:
+   ---------------------------
+
+   You can set up your image libraries in two ways (static or dynamically):
+
+   - static: set your libraries like:
+    $cfg['ilibs'] = array ( 
+    array (
+      'value'     => '/dev/im/assets/images/',        
+      'text'      => 'Site Pictures',
+    ),
+    array (
+      'value'     => '/dev/im/assets/gallery/',         
+      'text'      => 'Gallery',
+    ),
+  );
+  
+
+
+   - dynamically: set your libraries like:
+  uncomment the following line in your config file - the following settings will
+  automatically override the static libary settings
+
+  $cfg['ilibs_dir']   = array('/dev/pictures/','/dev/images/');
+  
+
+  The aforementioned main directories will be scanned for sub-directories and
+  all directories found will be listed as directories.
+
+
+4. WYSIWYG editor interfaces
+---------------------------------------------------
+
+   You'll find some predefined files in the ibrowser/interfaces directory.
+   As per now, interfaces for tinyMCE, SPAW, FCKeditor, Xinha, and HTMLarea
+   are provided.
+
+
+   tinyMCE interface
+   -----------------
+
+   copy the provided interface file: tinyMCE.editor_plugin.js file into your iBrowser plugin
+   directory and rename it to "editor_plugin.js". make a copy of it and rename it to editor_plugin_src.js.
+
+   adding plugin to tinyMCE:
+
+  tinyMCE.init({ 
+    ... 
+    plugins : "ibrowser", 
+    theme_advanced_buttons3_add : "ibrowser",
+  
+  }); 
+
+   For further information on how to use a plugin with tinyMCE be it iBrowser or any other plugin,
+   please see the tinyMCE instructions manual!
+
+
+   FCKeditor interface
+   -------------------
+
+   copy the provided interface file: FCKeditor.editor_plugin.js file into your FCKeditor iBrowser plugin
+   directory and rename it to "fckplugin.js".
+
+   In the fckconfig.js file, add 'ibrowser' to the FCKConfig.ToolbarSets. Register the iBrowser plugin with
+   the following statement: FCKConfig.Plugins.Add( 'ibrowser') ; 
+
+   For further information on how to use a plugin with FCKeditor, be it iBrowser or any other plugin,
+   please see the FCKeditor instructions manual!
+
+
+   Xinha interface
+   -------------------
+
+   copy the provided interface file: xinha.editor_plugin.js file into your Xinha iBrowser plugin
+   directory and rename it to "ibrowser.js".
+
+   add iBrowser to the following array: xinha_plugins = xinha_plugins ? xinha_plugins :
+      [
+       'CharacterMap',
+       'ContextMenu',       
+       'ListType',       
+       'Stylist',      
+       'TableOperations',
+       'ibrowser'
+      ];
+
+
+   For further information on how to use a plugin with Xinha, be it iBrowser or any other plugin,
+   please see the Xinha instructions manual!
+
+   HTMLarea interface
+   -------------------
+
+   copy the provided interface file: HTMLarea.editor_plugin.js file into your HTMLarea iBrowser plugin
+   directory and rename it to "ibrowser.js".
+
+   load the iBrowser plugin as follows:
+    HTMLArea.loadPlugin("ibrowser");
+
+   register the iBrowser plugin as follows:
+  editor.registerPlugin(ibrowser);
+
+
+   For further information on how to use a plugin with HTMLarea, be it iBrowser or any other plugin,
+   please see the HTMLarea instructions manual!
+
+
+   SPAW interface
+   --------------
+
+   unfortunately, the plugin integration into SPAW isn't as easy as with tinyMCE or other editors. However, if you follow the next
+   steps, it shouldn't be a problem to get iBrowser to work with SPAW either.
+
+  1. in the spaw directory, create a directory called "plugins" with a sub-directory called "ibrowser".
+     unzip all the ibrowser files into the "ibrowser" directory
+  
+  2. edit the following two files in the spaw/class directory and add the iBrowser include just before the
+           SPAW_showColorPicker(editor,curcolor) line:
+
+    IE: scripts.js.php
+      <?php include $spaw_root . 'plugins/ibrowser/interface/SPAW.editor_plugin.js'; ?>
+
+    Firefox: scripts+gecko.js.php   
+      <?php include $spaw_root . 'plugins/ibrowser/interface/SPAW.editor_plugin.js'; ?>
+
+
+  3. edit the following two file in the spaw/lib/toolbars/default directory
+     (if you don't use the default toolbar, use the one you use)
+    - default_toolbar_data_inc.php
+    - default_toolbar_data.gecko.inc.php
+
+    array(
+                  'name' => 'ibrowser',
+                  'type' => SPAW_TBI_BUTTON
+              ),
+
+    if you like to not longer use the regular SPAW image function, just comment those lines.
+
+  4. copy the four button images in the ibrowser/interface/images/spaw directory into the spaw/libs/themes/img directory
+
+  5. in the spaw/lib/lang/en directory, edit the "en_lang_data.inc.php" file and add the following:
+
+    'ibrowser' => array(
+         'title' => 'iBrowser'
+      ),
+
+    This will create the title for the toolbar image button.  
+
+  
+
+    

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+// ================================================
+// PHP image browser - iBrowser 
+// ================================================
+// iBrowser - tinyMCE editor interface (IE & Gecko)
+// ================================================
+// Developed: net4visions.com
+// Copyright: net4visions.com
+// File: editor_plugin.js
+// License: GPL - see license.txt
+// (c)2005 All rights reserved.
+// ================================================
+// Revision: 1.0                   Date: 05/03/2006
+// ================================================
+
+  /* Import plugin specific language pack */
+  tinyMCE.importPluginLanguagePack('ibrowser', 'en,de');
+  
+  //-------------------------------------------------------------------------
+  var TinyMCE_ibrowserPlugin = {
+    getInfo: function() {     
+      return {
+        longname  : 'iBrowser',
+        author    : 'net4visions.com',
+        authorurl : 'http://net4visions.com',
+        infourl   : 'http://net4visions.com',
+        version   : '1.3.3'
+      };
+    },
+    
+    getControlHTML: function(cn) {
+      switch (cn) {
+        case 'ibrowser':
+          return tinyMCE.getButtonHTML(cn, 'lang_ibrowser_desc', '{$pluginurl}/images/ibrowser.gif', 'mceIbrowser');
+      } 
+      return '';
+    },
+    
+    execCommand: function(editor_id, element, command, user_interface, value) {
+      switch (command) {
+        case 'mceIbrowser':
+          ib.isMSIE  = (navigator.appName == 'Microsoft Internet Explorer');
+          ib.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
+          ib.oEditor = tinyMCE.getInstanceById(editor_id);
+          ib.editor  = ib.oEditor;
+          ib.selectedElement = ib.oEditor.getFocusElement();          
+          ib.baseURL = tinyMCE.baseURL + '/plugins/ibrowser/ibrowser.php';  
+          
+          iBrowser_open(); // starting iBrowser
+          return true;
+      }
+      return false;
+    },
+    
+    handleNodeChange: function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+      if (node == null)
+        return;
+  
+      do {
+        if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
+          tinyMCE.switchClass(editor_id + '_ibrowser', 'mceButtonSelected');
+          return true;
+        }
+      } while ((node = node.parentNode));
+  
+      tinyMCE.switchClass(editor_id + '_ibrowser', 'mceButtonNormal');
+  
+      return true;
+    }
+  };
+  
+  //-------------------------------------------------------------------------
+  // include common interface code
+  var js  = document.createElement('script');
+  js.type = 'text/javascript';
+  js.src  = tinyMCE.baseURL + '/plugins/ibrowser/interface/common.js';  
+  // Add the new object to the HEAD element.
+  document.getElementsByTagName('head')[0].appendChild(js); 
+  //------------------------------------------------------------------------- 
+  
+  tinyMCE.addPlugin('ibrowser', TinyMCE_ibrowserPlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+// ================================================
+// PHP image browser - iBrowser 
+// ================================================
+// iBrowser - tinyMCE editor interface (IE & Gecko)
+// ================================================
+// Developed: net4visions.com
+// Copyright: net4visions.com
+// File: editor_plugin.js
+// License: GPL - see license.txt
+// (c)2005 All rights reserved.
+// ================================================
+// Revision: 1.0                   Date: 05/03/2006
+// ================================================
+
+  /* Import plugin specific language pack */
+  tinyMCE.importPluginLanguagePack('ibrowser', 'en,de');
+  
+  //-------------------------------------------------------------------------
+  var TinyMCE_ibrowserPlugin = {
+    getInfo: function() {     
+      return {
+        longname  : 'iBrowser',
+        author    : 'net4visions.com',
+        authorurl : 'http://net4visions.com',
+        infourl   : 'http://net4visions.com',
+        version   : '1.3.3'
+      };
+    },
+    
+    getControlHTML: function(cn) {
+      switch (cn) {
+        case 'ibrowser':
+          return tinyMCE.getButtonHTML(cn, 'lang_ibrowser_desc', '{$pluginurl}/images/ibrowser.gif', 'mceIbrowser');
+      } 
+      return '';
+    },
+    
+    execCommand: function(editor_id, element, command, user_interface, value) {
+      switch (command) {
+        case 'mceIbrowser':
+          ib.isMSIE  = (navigator.appName == 'Microsoft Internet Explorer');
+          ib.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
+          ib.oEditor = tinyMCE.getInstanceById(editor_id);
+          ib.editor  = ib.oEditor;
+          ib.selectedElement = ib.oEditor.getFocusElement();          
+          ib.baseURL = tinyMCE.baseURL + '/plugins/ibrowser/ibrowser.php';  
+          
+          iBrowser_open(); // starting iBrowser
+          return true;
+      }
+      return false;
+    },
+    
+    handleNodeChange: function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+      if (node == null)
+        return;
+  
+      do {
+        if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
+          tinyMCE.switchClass(editor_id + '_ibrowser', 'mceButtonSelected');
+          return true;
+        }
+      } while ((node = node.parentNode));
+  
+      tinyMCE.switchClass(editor_id + '_ibrowser', 'mceButtonNormal');
+  
+      return true;
+    }
+  };
+  
+  //-------------------------------------------------------------------------
+  // include common interface code
+  var js  = document.createElement('script');
+  js.type = 'text/javascript';
+  js.src  = tinyMCE.baseURL + '/plugins/ibrowser/interface/common.js';  
+  // Add the new object to the HEAD element.
+  document.getElementsByTagName('head')[0].appendChild(js); 
+  //------------------------------------------------------------------------- 
+  
+  tinyMCE.addPlugin('ibrowser', TinyMCE_ibrowserPlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/ibrowser.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/ibrowser.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/ibrowser.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1503 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser dialog
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // File: ibrowser.php
+  // ================================================
+  // Revision: 1.3                   Date: 12/10/2005
+  // ================================================
+  
+  chdir('../../../../../');
+  include_once('includes/configure.php');
+  include(DIR_FS_ADMIN.'includes/application_top.php'); // Needed for admin security
+
+  //-------------------------------------------------------------------------
+  // unset $cfg['ilibs_incl'] - dynamic image library
+  if (isset($cfg['ilibs_inc'])) {
+    unset($cfg['ilibs_inc']);
+  }
+  //-------------------------------------------------------------------------
+  // include configuration settings
+  include dirname(__FILE__) . '/config/config.inc.php';
+  include dirname(__FILE__) . '/langs/lang.class.php';
+  //-------------------------------------------------------------------------
+  // language settings  
+  $l = (isset($_REQUEST['lang']) ? new PLUG_Lang($_REQUEST['lang']) : new PLUG_Lang($cfg['lang']));
+  $l->setBlock('ibrowser'); 
+  //-------------------------------------------------------------------------
+  // if set, include file specified in $cfg['ilibs_incl']; hardcoded libraries will be ignored! 
+  if (!empty($cfg['ilibs_inc'])) {
+    include $cfg['ilibs_inc'];
+  } 
+  //-------------------------------------------------------------------------   
+  // set current image library  
+  $clib = (isset($_REQUEST['clib']) ? $_REQUEST['clib'] : '');
+  //------------------------------------------------------------------------- 
+  $value_found = false;
+  // callback function for preventing listing of non-library directory
+  function is_array_value($value, $key, $tlib) {
+    global $value_found;
+    if (is_array($value)) {
+      array_walk($value, 'is_array_value', $tlib);
+    }
+    if ($value == $tlib) {
+      $value_found = true;
+    }
+  } 
+  //------------------------------------------------------------------------- 
+  array_walk($cfg['ilibs'], 'is_array_value', $clib); 
+  if (!$value_found || empty($clib)) {
+    $clib = $cfg['ilibs'][0]['value'];
+  }   
+  //-------------------------------------------------------------------------
+  // create library dropdown
+  $lib_options = liboptions($cfg['ilibs'], '', $clib,'');
+?>
+<!-- do not delete this line - it's need for proper working of the resizeDialogToContent() function -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<head>
+<title><?php echo $l->m('im_002'); ?></title>
+<meta http-equiv="Pragma" content="no-cache">
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $l->getCharset(); ?>">
+<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
+<style type="text/css">
+<!--
+  @import url("css/style.css");
+-->
+</style>
+<script language="javascript" type="text/javascript" src="scripts/resizeDialog.js"></script>
+<script language="JavaScript" type="text/javascript" src="scripts/validateForm.js"></script>
+<script language="JavaScript" type="text/JavaScript">
+<!--
+// ============================================================
+// = global instance V 1.0, date: 04/07/2005                  =
+// ============================================================
+  function iBrowser() {
+    // browser check
+    this.isMSIE  = (navigator.appName == 'Microsoft Internet Explorer');
+    this.isGecko = navigator.userAgent.indexOf('Gecko') != -1;    
+  };
+  var iBrowser = new iBrowser();
+
+// ============================================================
+// = iBrowser init V 1.0, date: 12/03/2004                    =
+// ============================================================
+  function init() {     
+    var formObj = document.forms[0];    
+    btnInit();   // init menu buttons   
+    document.getElementById('mainDivHeader').innerHTML = setTitle('imDiv');     
+    //-------------------------------------------------------------------------     
+    // hide library selection if there is only one library available!
+    if (formObj.ilibs.options.length > 1) {
+      changeClass(0,'ilibsDiv','showit');
+    }
+    //-------------------------------------------------------------------------
+    // window arguments     
+    var args = window.dialogArguments;    
+    if (args) {                   // if dialog argument are available
+      if (args.src) {               // source is image and maybe also link        
+        initImageArgs();            // init and set image attributes          
+      } else if (args.a) {            // source is popup image only
+        setImagePopup(args.popSrc);       // update popup preview       
+        formObj.popSrc.value = args.popSrc;   // popup image url
+        formObj.popTitle.value = args.popTitle; // link title
+        for (var i = 0; i < formObj.popClassName.options.length; i++) { // CLASS value
+          if (formObj.popClassName.options[i].value == args.popClassName) {
+            formObj.popClassName.options.selectedIndex = i;       
+          }
+        }
+        if (args.rsrc) {            // random image with popup link
+          setRandom(0);
+        }   
+      } else if (args.rsrc) {           // random image
+        setRandom(0);
+      }
+    }
+         
+    //-------------------------------------------------------------------------
+    preloadImages('images/firefox.gif','images/explorer.gif','images/img_in.gif','images/img_at.gif','images/img_po.gif','images/help.gif','images/help_off.gif','images/about.gif','images/about_off.gif','images/im.gif','images/dir_off.gif','images/dir.gif','images/prev_off.gif','images/prev.gif','images/symbols_off.gif','images/symbols.gif','images/alert_off.gif','images/alert.gif','images/dirview_off.gif','images/dirview.gif'); // preload images        
+    btnStage();
+    resizeDialogToContent();    
+    window.focus();   
+  }
+// ============================================================
+// = image buttons init V 1.0, date: 05/27/2005               =
+// ============================================================
+  function btnInit() {    
+    var x = document.getElementById('menuBarDiv').getElementsByTagName('li');
+    for (var i = 0; i < x.length; i++) {
+      if (x[i].className   == 'btnUp') {
+        x[i].onmouseover = btn_over;
+        x[i].onmouseout  = btn_out;
+        x[i].onmousedown = btn_down;
+        x[i].onclick     = btn_click;
+      }
+    }   
+  }
+// ============================================================
+// = menu buttons V 1.0, date: 06/03/2005                     =
+// ============================================================ 
+  function btn_over() { // menu button hover
+    if (this.className != 'btnDown') {
+      this.className  = 'btnOver';
+    }
+  } 
+  function btn_out() {  // menu button out
+    if (this.className != 'btnDown') {
+      this.className  = 'btnUp';
+    }
+  }
+  function btn_down() { // menu button down
+    if (this.className != 'btnDown') {
+      this.className  = 'btnDown';
+    }
+  }
+  function btn_click() {  // menu button click    
+    var formObj = document.forms[0];
+    var args = btn_click.arguments;
+    if(document.getElementById(args[0]) != null) {        
+      this.id = document.getElementById(args[0]).id;        
+    }
+    var x = document.getElementById('menuBarDiv').getElementsByTagName('li');
+    for (var i = 0; i < x.length; i++) {
+      if (x[i].className == 'btnDown') {        
+        if (x[i].id != this.id) {         
+          x[i].className = 'btnUp';
+        }
+      }
+    } 
+        
+    // check whether image has been selected or not
+    if (this.id == 'mbtn_at') { // properties functions
+      if(!btnStage()) {
+        var msg = escapeHTML('<?php echo $l->m('er_001') . ': ' . $l->m('er_002'); ?>');
+        alert(msg);
+        this.className = 'btnUp';
+        return;
+      }
+    }
+    
+    // reset all classes to "hideit"
+    changeClass(0,'imDiv','hideit','inDiv','hideit','atDiv','hideit','hideit','raDiv','hideit');    
+    // get element, set title     
+    elm = this.id.substring(this.id.length-2, this.id.length);      
+    elm = elm + 'Div';      
+    document.getElementById('mainDivHeader').innerHTML = setTitle(elm);
+      
+    if (this.id == 'mbtn_po') {     
+      var iProps = window.dialogArguments;      
+      if (iProps && iProps.a) { // show remove link only if link       
+        changeClass(1,'fileDivWrap','hideit','fileDiv','hideit','img_ren','hideit','img_del','hideit','inDiv','showit','poDiv','showit','poDelDiv','showit','raDiv','hideit');
+      } else {
+        changeClass(1,'fileDivWrap','hideit','fileDiv','hideit','img_ren','hideit','img_del','hideit','inDiv','showit','poDiv','showit','poDelDiv','hideit','raDiv','hideit');
+      }
+    } else {            
+      <?php if (($cfg['create'] && isset($cfg['ilibs_inc'])) || $cfg['upload'] || $cfg['rename'] || $cfg['delete']) { ?>
+        changeClass(1,'poDiv','hideit','fileDivWrap','showit','img_ren','showit','img_del','showit',elm,'showit','raDiv','showit');
+      <?php } else { ?>
+        changeClass(1,'poDiv','hideit','fileDivWrap','hideit','img_ren','showit','img_del','showit',elm,'showit','raDiv','showit');
+      <?php }; ?>
+    }
+  }
+// ============================================================
+// = set title - V 1.0, date: 06/03/2005                      =
+// ============================================================
+  function setTitle(elm) {
+    var retstr;
+    switch(elm) {
+      case 'imDiv':
+        retstr = '<?php echo $l->m('im_004'); ?>';
+        break;    
+      case 'inDiv':
+        retstr = '<?php echo $l->m('im_008'); ?>';
+        break;
+      case 'atDiv':
+        retstr = '<?php echo $l->m('im_010'); ?>';
+        break;
+      case 'poDiv':
+        retstr = '<?php echo $l->m('im_014'); ?>';
+        break;
+      default:
+        retstr = '<?php echo $l->m('im_016'); ?>';    
+    }
+    return retstr;  
+  }
+// ============================================================
+// = get image path and update ilist V 1.0, date: 04/25/2005  =
+// ============================================================
+  function initImageArgs() {
+    var formObj = document.forms[0];    
+    var args = window.dialogArguments;
+    
+    // in case of full url, remove 'http://
+    var pos = args.src.indexOf('://');
+    if (pos != -1) {      
+        pos = args.src.indexOf('/', pos + 3 ); // + length of '://'         
+      args.src = args.src.substring(pos);     
+    } 
+    
+    // set current image file, and library
+    var pos   = args.src.lastIndexOf('/');
+    var cfile = args.src.slice(pos+1,args.src.length);    
+    var clib  = absPath(args.src.slice(0,pos+1)); // relative path to library   
+    // set current directory/library & update image list
+    for (var i = 0; i < formObj.ilibs.options.length; i++) {
+      if (formObj.ilibs.options[i].value == clib) {
+        formObj.ilibs.options.selectedIndex = i;  
+        formObj.param.value = 'update' + '|' + cfile;     
+        formObj.submit();           
+      }
+    }   
+  }
+// ============================================================
+// = set image properties V 1.0, date: 04/25/2005             =
+// ============================================================   
+  function setImageArgs() {
+    var formObj = document.forms[0];    
+    var args = window.dialogArguments;          
+    
+    if (args.tsrc) {                      // dynamic thumbnail
+      formObj.pr_src.value = args.tsrc;
+      changeClass(0,'alertImg','showit');           // show warning   
+    }
+    if (args.rset) {
+      formObj.pr_src.value = args.rsrc;
+    }
+    
+    formObj.pr_width.value  = args.width  ? args.width  : ''; // WIDTH value    
+    formObj.pr_height.value = args.height ? args.height : ''; // HEIGHT value
+    formObj.pr_alt.value  = args.alt;             // ALT text   
+    formObj.pr_title.value  = args.title;           // DESCR text
+    formObj.pr_border.value = args.border ? args.border : ''; // BORDER value 
+    formObj.pr_vspace.value = args.vspace ? args.vspace : ''; // VSPACE value       
+    formObj.pr_hspace.value = args.hspace ? args.hspace : ''; // HSPACE value
+    
+    if (args.caption == 1) { // if image caption
+      formObj.pr_chkCaption.checked = true;
+      for (var i = 0; i < formObj.pr_captionClass.options.length; i++) {  // CLASS value
+        if (formObj.pr_captionClass.options[i].value == args.captionClass) {
+          formObj.pr_captionClass.options.selectedIndex = i;        
+        }
+      }
+    }
+    
+    for (var i = 0; i < formObj.pr_align.options.length; i++) { // ALIGN value 
+      if (formObj.pr_align.options[i].value == args.align) {
+        formObj.pr_align.options.selectedIndex = i;       
+      }
+    }
+    
+    for (var i = 0; i < formObj.pr_class.options.length; i++) { // CLASS value
+      if (formObj.pr_class.options[i].value == args.className) {
+        formObj.pr_class.options.selectedIndex = i;       
+      }
+    }
+    // set popup preview in case it's a popup
+    if (args.popSrc) {          
+      setImagePopup(args.popSrc);       // update popup preview     
+      formObj.popTitle.value = args.popTitle; // link title
+      for (var i = 0; i < formObj.popClassName.options.length; i++) { // CLASS value
+        if (formObj.popClassName.options[i].value == args.popClassName) {
+          formObj.popClassName.options.selectedIndex = i;       
+        }
+      }   
+    }
+    formObj.param.value = ''; // resetting param value    
+  }
+// ============================================================
+// = set popup image src preview V 1.0, date: 05/13/2005      =
+// ============================================================ 
+  function setImagePopup(popSrc) {    
+    var formObj = document.forms[0];
+    var src = '<?php echo $cfg['scripts']; ?>' + 'phpThumb/phpThumb.php'; // command      
+    src     = src + '?src=' + popSrc;           // popup source image       
+    src     = src + '&w=80';              // image width
+    src     = src + '&h=60';              // image height
+    src     = src + '&zc=1';              // zoom crop      
+    document.getElementById('poPrevFrame').src = src;   // update preview 
+    formObj.popSrc.value = popSrc;
+  }
+// ============================================================
+// = insertImage, date: 08/03/2005                            =
+// ============================================================
+  function insertImage() {
+    var formObj = document.forms[0];
+    var args = {};
+    // get active menu button
+    var x = document.getElementById('menuBarDiv').getElementsByTagName('li');
+    for (var i = 0; i < x.length; i++) {
+      if (x[i].className == 'btnDown') {
+        if (x[i].id == 'mbtn_po') { // popup mode
+          if(formObj.chkP.checked) {                
+            args.action    = 2; // delete popup link
+          } else { // create / edit link to popup image
+            args.action    = 1; 
+            args.popUrl    = '<?php echo $cfg['pop_url']; ?>'; // link to popup.php           
+            args.popSrc    = (formObj.popSrc.value)   ? (formObj.popSrc.value)   : '';            
+            args.popTitle  = (formObj.popTitle.value) ? (formObj.popTitle.value) : '';
+            args.popTxt    = '<?php echo $l->m('in_036'); ?>';
+            if (formObj.popClassName.selectedIndex > 0) { // if class style is selected
+              args.popClassName = (formObj.popClassName.options[formObj.popClassName.selectedIndex].value) ? (formObj.popClassName.options[formObj.popClassName.selectedIndex].value) : '';
+            }
+            // caption parameters
+            args.caption      = formObj.pr_chkCaption.checked ? formObj.pr_chkCaption.value : '';
+            args.captionClass = (formObj.pr_captionClass.options[formObj.pr_captionClass.selectedIndex].value) ? (formObj.pr_captionClass.options[formObj.pr_captionClass.selectedIndex].value) : '';
+          }             
+        }
+      }
+    }
+    //-------------------------------------------------------------------------
+    // check if valid image is selected   
+    if (!args.action) { // if not popup mode, check whether there is a valid image selected   
+      if (formObj.pr_src.value == '') { // no valid picture has been selected       
+        var msg = escapeHTML('<?php echo $l->m('er_001') . ': ' . $l->m('er_002'); ?>');
+        alert(msg);
+        return;
+      }
+      
+      args.src = (formObj.pr_src.value) ? (formObj.pr_src.value) : '';                  
+      if ('<?php echo $cfg['furl']; ?>' == true) { // create full url incl. e.g. http://localhost....
+        args.src = '<?php echo $cfg['base_url']; ?>' + args.src;        
+      }
+            
+      args.width  = (formObj.pr_width.value)  ? (formObj.pr_width.value)  : '';
+      args.height = (formObj.pr_height.value) ? (formObj.pr_height.value) : '';       
+      args.align  = (formObj.pr_align.value)  ? (formObj.pr_align.value)  : '';
+      args.border = (formObj.pr_border.value) ? (formObj.pr_border.value) : '';       
+      args.alt  = (formObj.pr_alt.value)    ? (formObj.pr_alt.value)    : '';
+      args.title  = (formObj.pr_title.value)  ? (formObj.pr_title.value)  : '';
+      args.hspace = (formObj.pr_hspace.value) ? (formObj.pr_hspace.value) : '';
+      args.vspace = (formObj.pr_vspace.value) ? (formObj.pr_vspace.value) : ''; 
+      if (formObj.pr_class.selectedIndex > 0) { // if class style is selected
+        args.className = (formObj.pr_class.options[formObj.pr_class.selectedIndex].value) ? (formObj.pr_class.options[formObj.pr_class.selectedIndex].value) : '';
+      }
+      // caption parameters
+      args.caption = formObj.pr_chkCaption.checked ? formObj.pr_chkCaption.value : '';
+      args.captionClass = (formObj.pr_captionClass.options[formObj.pr_captionClass.selectedIndex].value) ? (formObj.pr_captionClass.options[formObj.pr_captionClass.selectedIndex].value) : '';
+    } else { // check whether there is valid popup image
+      if (formObj.popSrc.value == '') { // no valid picture has been selected       
+        var msg = escapeHTML('<?php echo $l->m('er_001') . ': ' . $l->m('er_002'); ?>');
+        alert(msg);
+        return;
+      }
+    }   
+              
+    //------------------------------------------------------------------------- 
+    // save image to wysiwyg editor and close window    
+    window.returnValue = args;
+    window.close();       
+    
+    if (iBrowser.isGecko) { // Gecko        
+      <?php         
+        if (!empty($_REQUEST['callback'])) {                  
+          echo "opener." . @$_REQUEST['callback'] . "('" . @$_REQUEST['editor'] . "',this);\n";
+        };
+      ?>  
+    } 
+  }
+// ============================================================
+// = image change - set attributes V 1.0, date: 12/03/2004    =
+// ============================================================
+  function imageChange() {    
+    var formObj = document.forms[0];
+    var args  = imageChange.arguments;                          // image change arguments - set by rfiles.php           
+    var clib    = absPath(formObj.ilibs.options[formObj.ilibs.selectedIndex].value);  // current library - absolute path    
+    var cfile   = document.getElementById('cimg').attributes['cfile'].value;      // get current image
+    var cwidth  = document.getElementById('cimg').attributes['cwidth'].value;     // get current width  
+    var cheight = document.getElementById('cimg').attributes['cheight'].value;      // get current height   
+    var csize   = document.getElementById('cimg').attributes['csize'].value.split('|'); // get current size (array)
+    var ctype   = document.getElementById('cimg').attributes['ctype'].value.split('|'); // get current type (array) 
+      
+    //-------------------------------------------------------------------------
+    // set default image attributes
+    formObj.pr_src.value    = clib + cfile;   
+    formObj.pr_width.value  = cwidth;
+    formObj.pr_height.value = cheight;    
+    formObj.pr_size.value   = csize[0];   
+    formObj.pr_align.options.selectedIndex = 0;
+    formObj.pr_class.options.selectedIndex = 0;
+    document.getElementById('pr_sizeUnit').innerHTML = csize[1]; // e.g. kb   
+    formObj.pr_alt.value  = cfile.substr(0, cfile.length-4);
+    formObj.pr_title.value  = cfile.substr(0, cfile.length-4);    
+    changeClass(0,'alertImg','hideit');
+    //-------------------------------------------------------------------------
+    // update preview window  
+    var sizes = resizePreview(cwidth, cheight, 150, 150);   
+    var src = '<?php echo $cfg['scripts']; ?>' + 'phpThumb/phpThumb.php'; // command
+    src = src + '?src=' + clib + cfile; // source file
+    src = src + '&w=' + sizes['w']; // width    
+    document.getElementById('inPrevFrame').src = src; // update regular preview
+    
+    //-------------------------------------------------------------------------
+    // reset rename and delete info
+    if ('<?php echo $cfg['rename']; ?>' == true) {
+      formObj.in_srcnew.value  = cfile.substr(0, cfile.length-4); // default rename value     
+    }
+    if ('<?php echo $cfg['delete']; ?>' == true) {
+      formObj.in_delinfo.value = cfile;               // default delete value
+    }
+    
+    //-------------------------------------------------------------------------
+    // change image attributes in case it's an existing image   
+    if (args[0] == 'update') {  // if argument from rfiles.php received       
+      setImageArgs();     // update image attributes
+    } else if (args[0] == 'delete') { // image was deleted
+      document.getElementById('cimg').attributes['cfile'].value = '';     
+      document.getElementById('in_srcnew').value  = '';
+      document.getElementById('in_delinfo').value = '';     
+      document.getElementById('inPrevFrame').src = 'images/noImg.gif'; // update preview
+    }
+      
+    //-------------------------------------------------------------------------
+    // update popup preview and set popup default attributes
+    if (document.getElementById('mbtn_po').className == 'btnDown') {
+      var popSrc = clib + cfile; 
+      setImagePopup(popSrc);      
+      formObj.popTitle.value = cfile.substr(0, cfile.length-4);     
+    }
+    //-------------------------------------------------------------------------
+    // random image
+    formObj.chkRandom.checked = false; // uncheck random on image change
+    changeClass(1,'raParamDiv','hideit');
+    //-------------------------------------------------------------------------
+    updateStyle();    
+    btnStage(); 
+  }
+// ============================================================
+// = update style frame V 1.0, date: 12/13/2004               =
+// ============================================================ 
+  function updateStyle() {
+    var formObj = document.forms[0];      
+    document.getElementById('atPrevImg').align    = formObj.pr_align.options[formObj.pr_align.selectedIndex].value;     
+    document.getElementById('atPrevImg').vspace   = formObj.pr_vspace.value;
+    document.getElementById('atPrevImg').hspace   = formObj.pr_hspace.value;
+    document.getElementById('atPrevImg').border   = formObj.pr_border.value;
+    document.getElementById('atPrevImg').alt    = formObj.pr_alt.value;
+    document.getElementById('atPrevImg').title    = formObj.pr_title.value;
+    document.getElementById('atPrevImg').className  = formObj.pr_class.options[formObj.pr_class.selectedIndex].value; 
+  }
+// ============================================================
+// = enable/disable menu buttons, date: 03/21/2005            =
+// ============================================================ 
+  function btnStage() {
+    var formObj = document.forms[0];          
+    var cfile   = document.getElementById('cimg').attributes['cfile'].value; // current image 
+    if (cfile  == '') {     
+      formObj.img_at.src = 'images/img_at_off.gif';     
+      if (formObj.img_cr) {
+        formObj.img_cr.src = 'images/img_cr_off.gif'; 
+      }   
+      return false;
+    }
+    formObj.img_at.src = 'images/img_at.gif';
+    if (formObj.img_cr) {
+      formObj.img_cr.src = 'images/img_cr.gif';
+    }
+    return true;    
+  }
+// ============================================================
+// = resize image to fit preview V 1.0, date: 12/19/2004      =
+// ============================================================ 
+  function resizePreview(w,h,mw,mh) { // width, height, max width, max height       
+    var sizes = new Array();    
+    if (w > mw || h > mh) { // thumbnailing required
+      f = w / h; // proportions of image: (f > 1) = landscape; (f < 1) = portrait; (f = 1) = square     
+      if (f > 1) { // landscape and square
+        w = mw;
+        h = Math.round(w / f);      
+      } else if (f <= 1) {  // portrait
+        h = mh;       
+        w = Math.round(h * f);      
+      } 
+    }       
+    sizes['w'] = w;
+    sizes['h'] = h;
+    return sizes;
+  }
+// ============================================================
+// = insert special characters V 1.0, date: 03/31/2005        =
+// ============================================================   
+  function selSymbol(elm) {       
+    var wArgs = {};
+    wArgs.iBrowser = iBrowser;
+    wArgs.elm = elm;  // passing calling element to function
+    if ((iBrowser.isMSIE)) { 
+      var rArgs = showModalDialog('<?php echo $cfg['scripts']; ?>symbols.php?lang=<?php echo $l->lang; ?>', wArgs, 
+      'dialogHeight:300px; dialogWidth:400px; scrollbars: no; menubar: no; toolbar: no; resizable: no; status: no;');                         
+      if (rArgs) {        
+        setSymbol(null, null, rArgs);
+      }     
+    } else if (iBrowser.isGecko) {
+      var wnd = window.open('<?php echo $cfg['scripts']; ?>symbols.php?lang=<?php echo $l->lang; ?>&callback=setSymbol', 'symbols', 'status=no, modal=yes, width=400, height=300');       
+      wnd.dialogArguments = wArgs;
+    }   
+  }
+  // set symbol callback
+  function setSymbol(editor, sender, rArgs) {   
+    if (!rArgs) { // Gecko    
+      var rArgs = sender.returnValue;       
+    }
+    if (rArgs.chr != null) {
+      var chr = rArgs.chr;
+      var elm = rArgs.elm;        
+      chr = String.fromCharCode(chr.substring(2, chr.length -1)); // e.g. returns &#220;    
+      document.getElementById(elm).value = document.getElementById(elm).value + ' ' + chr;
+    }     
+  }    
+// ============================================================
+// = preload Images, date: 11/13/2004                         =
+// ============================================================   
+  function preloadImages() {
+      var d=document;
+    if(d.images) {
+      if(!d.MM_p)
+        d.MM_p = new Array();
+          var i,j=d.MM_p.length,a = preloadImages.arguments;
+        for(i= 0; i < a.length; i++)
+            if (a[i].indexOf("#") != 0) {
+            d.MM_p[j] = new Image;
+            d.MM_p[j++].src = a[i];
+      }
+    }
+  }
+// ============================================================
+// = change image library V 1.0, date: 04/22/2005             =
+// ============================================================
+  function ilibsClick() {   
+    var formObj = document.forms[0];    
+    formObj.param.value = ''; // clear param values;    
+    formObj.submit(); 
+    // reset values 
+    document.getElementById('inPrevFrame').src = 'images/noImg.gif'; // update preview
+    document.getElementById('cimg').attributes['cfile'].value = '';
+    btnStage();     
+  }
+// ============================================================
+// = upload image, date: 05/24/2005                           =
+// ============================================================
+  function uploadClick() {
+    var formObj = document.forms[0];    
+    if (!checkUpload()) {
+      var msg = escapeHTML('<?php echo $l->m('er_001') . ': ' . $l->m('er_023'); ?>');
+      alert(msg);
+      return;
+    }
+    if (confirm('<?php echo $l->m('er_021'); ?>')) {      
+      formObj.param.value = 'upload'; // parameter: <action>      
+      showloadmessage();
+      formObj.submit();           
+    }
+  }
+  // check whether image file is selected for uploading
+  function checkUpload() {    
+    var formObj = document.forms[0];  
+    var upload = false;
+    var x = document.getElementById('fiUplDiv').getElementsByTagName('input');
+    for (var i = 0; i < x.length; i++) {
+      if (x[i].type == 'file') {
+        if (x[i].value != '') { // check whether files has been selected for upload         
+          
+          for (z=0; document.getElementById('chkThumbSize['+ z +']'); z++) {            
+            if(document.getElementById('chkThumbSize['+ z +']').checked) {
+              upload = true;              
+            }           
+          }
+        }
+      }     
+    }
+    return upload;  
+  }
+// ============================================================
+// = delete image V 1.0, date: 04/22/2005                     =
+// ============================================================
+  function deleteClick() {
+    var formObj = document.forms[0];    
+    var cfile = document.getElementById('cimg').attributes['cfile'].value;
+    if (cfile == '') { // check if image is selected  
+      var msg = escapeHTML('<?php echo $l->m('er_001') . ': ' . $l->m('er_002'); ?>');
+      alert(msg);
+      return;
+    }
+        
+    if (confirm('<?php echo $l->m('er_008'); ?> ' + cfile + '!')) {       
+      formObj.param.value = 'delete' + '|' + cfile; // parameter: <action>|<file>       
+      formObj.submit(); 
+    }     
+  } 
+// ============================================================
+// = rename image V 1.0, date: 04/22/2005                     =
+// ============================================================
+  function renameClick() {
+    var formObj = document.forms[0];
+    var clib =  formObj.ilibs.options[formObj.ilibs.selectedIndex].value; // current library
+    var cfile = document.getElementById('cimg').attributes['cfile'].value;    
+    var ctype = document.getElementById('cimg').attributes['ctype'].value.split('|');   
+        
+    if (cfile == '') { // check if image is selected
+      var msg = escapeHTML('<?php echo $l->m('er_001') . ': ' . $l->m('er_002'); ?>');
+      alert(msg);
+      return;
+    }   
+    
+    var ctype = '.' + imageType(ctype[0]);    
+    if (formObj.in_srcnew.value == '' || formObj.in_srcnew.value + ctype == cfile) { // new name is either empty or hasn't changed
+      var msg = escapeHTML('<?php echo $l->m('er_011'); ?>');
+      alert(msg);
+      return;
+    }
+        
+    if (confirm('<?php echo $l->m('er_010'); ?>: ' + formObj.in_srcnew.value + ctype)) { // do rename         
+      var nfile = formObj.in_srcnew.value + ctype;         
+      formObj.param.value = 'rename' + '|' + cfile + '|' + nfile; // parameter: <action>|<filename>|<newname>   
+      formObj.submit();       
+    }       
+  }
+// ============================================================
+// = switch list view V 1.0, date: 07/06/2005                 =
+// ============================================================
+  function switchList() {
+    var formObj = document.forms[0];      
+    if (formObj.flist.value == 1) { // check if image is selected 
+      formObj.flist.value = 0;
+    } else {
+      formObj.flist.value = 1;
+    }   
+    // refresh list view    
+    var cfile = document.getElementById('cimg').attributes['cfile'].value;
+    if (cfile.length > 0) {
+      formObj.param.value = 'switch' + '|' + cfile; 
+    }
+    formObj.submit(); 
+  } 
+// ============================================================
+// = create directory V 1.0, date: 04/22/2005                 =
+// ============================================================
+  function createClick() {
+    var formObj = document.forms[0];
+    var clib    = formObj.ilibs.options[formObj.ilibs.selectedIndex].value;     // current library
+    
+    if (clib == '') { // check if library is selected
+      var msg = escapeHTML('<?php echo $l->m('er_001') . ': ' . $l->m('er_002'); ?>');
+      alert(msg);
+      return;
+    }     
+    if (formObj.in_dirnew.value == '') { // check if user has entered a new directory name
+      var msg = escapeHTML('<?php echo $l->m('er_011'); ?>');
+      alert(msg);
+      return;
+    }
+        
+    if (confirm('<?php echo $l->m('in_026'); ?>: ' + clib + formObj.in_dirnew.value)) {         
+      var nfile = formObj.in_dirnew.value;             
+      formObj.param.value = 'create' + '|' + nfile; // parameter: <action>|<newdir>   
+      formObj.submit();       
+    }       
+  }
+// ============================================================
+// = set random image, date: 07/17/2005                       =
+// ============================================================
+  function setRandom() {
+    var formObj = document.forms[0];
+    var action = setRandom.arguments;
+    if (action[0] == 0) { // set arguments on init
+      var args = window.dialogArguments;  
+      var formObj = document.forms[0];
+      
+      for (var i = 0; i < formObj.ilibs.options.length; i++) { // random library
+        var pos = args.rlib.indexOf(formObj.ilibs.options[i].value);
+        if (pos != -1) {
+          formObj.ilibs.options.selectedIndex = i;  
+        }
+      }
+      
+      ilibsClick();
+      formObj.chkRandom.checked = true;
+      formObj.randomParam.value = args.rset;
+      var src = 'images/randomImg.gif';
+      document.getElementById('inPrevFrame').src = src;
+      document.getElementById('cimg').attributes['cfile'].value = src;
+      changeClass(1,'raParamDiv','showit');
+      setImageArgs();
+      btnStage();
+    } else if (action[0] == 1) {
+      if (formObj.chkRandom.checked) {
+        document.getElementById('inPrevFrame').src = 'images/randomImg.gif'; // update preview
+        var clib= formObj.ilibs.options[formObj.ilibs.selectedIndex].value; 
+        var src = '<?php echo $cfg['scripts']; ?>' + 'random.php'; // command         
+        src     = src + unescape('?dir=<?php echo str_replace('\\','/', $cfg['root_dir']); ?>' + clib);
+        src     = src + formObj.randomParam.value;        
+        formObj.pr_src.value    = src;
+        formObj.pr_alt.value    = '<?php echo $l->m('in_053'); ?>';
+        formObj.pr_title.value  = '<?php echo $l->m('in_053'); ?>';
+        formObj.pr_width.value  = '';
+        formObj.pr_height.value = '';
+        changeClass(1,'raParamDiv','showit');
+        document.getElementById('cimg').attributes['cfile'].value = src;        
+        btnStage();
+        formObj.param.value = '';
+        formObj.submit(); 
+      } else {
+        document.getElementById('inPrevFrame').src = 'images/noImg.gif'; // update preview
+        formObj.param.value = '';
+        formObj.pr_src.value = '';
+        changeClass('raParamDiv','hideit');
+        document.getElementById('cimg').attributes['cfile'].value = '';
+        btnStage();
+        formObj.submit();   
+      }
+    } else if (action[0] == 2) { // resetting parameter values to config value
+      formObj.randomParam.value = '<?php echo $cfg['random']; ?>';
+    }
+  }
+
+// ============================================================
+// = full size preview V 1.0, date: 12/18/2004                =
+// ============================================================ 
+  function fullSizeView() {
+    var formObj = document.forms[0];    
+    var clib    = formObj.ilibs.options[formObj.ilibs.selectedIndex].value;   // current library
+    var cfile   = document.getElementById('cimg').attributes['cfile'].value;  // current image      
+    var cwidth  = document.getElementById('cimg').attributes['cwidth'].value; // current width
+    var cheight = document.getElementById('cimg').attributes['cheight'].value;  // current height
+    if (cfile != '') {  
+      var sizes;    
+      sizes = resizePreview(cwidth,cheight,512,512);      
+      if (sizes['w'] > 150 || sizes['h'] > 150) { // open external window if size &gt; 150 which is the size of the preview window      
+      } else {
+        var msg = escapeHTML('<?php echo $l->m('er_001') . ': ' . $l->m('er_032'); ?>');
+        alert(msg);
+        return;
+      }
+      var src;            
+      src = '<?php echo $cfg['scripts']; ?>' + 'phpThumb/phpThumb.php'; // command              
+      src = src + '?src=' + absPath(clib) + cfile; // source image
+      src = src + '&w='+sizes['w']; //image width           
+    
+      var windowName = 'fullView';              
+      var features =
+      'width='        + sizes['w'] +
+      ',height='      + sizes['h'] +            
+      ',top='         + '10'  +
+      ',left='        + '10'  +
+      ',location='    + 'no'  +
+      ',menubar='     + 'no'  +
+      ',scrollbars='  + 'no'  +
+      ',status='      + 'no'  +
+      ',toolbar='     + 'no'  +
+      ',resizable='   + 'no';     
+      // open full view popup window
+      window.open('<?php echo $cfg['pop_url']; ?>?url=' + escape(src) + '&clTxt=' + '<?php echo $l->m('in_036'); ?>', windowName, features);        
+    }
+  }
+// ============================================================
+// = change class, date: 12/01/2004                           =
+// ============================================================
+  function changeClass() {    
+    var args = changeClass.arguments;     
+    if (args[0] == 0 || args[0] == 1) { // 0 = no resizeDialogToContent; 1 = resizeDialogToContent
+      var start = 1;
+    } else {
+      var start = 0;
+    }
+    
+    for(var i = start; i < args.length; i += 2) {
+      if(document.getElementById(args[i]) != null) {        
+        document.getElementById(args[i]).className = args[i+1];
+      }
+    }
+    // resize dialog to content
+    if (args[0] == 1) {         
+      resizeDialogToContent();
+    }   
+  } 
+// ============================================================
+// = image dimension change, date: 05/08/2005                 =
+// ============================================================   
+  function changeDim(sel) {   
+    var formObj = document.forms[0];
+    var cwidth  = document.getElementById('cimg').attributes['cwidth'].value;     // get current width  
+    var cheight = document.getElementById('cimg').attributes['cheight'].value;      // get current height 
+    
+    if (eval(formObj.pr_width.value) > cwidth || eval(formObj.pr_height.value) > cheight) {     // check for enlarging      
+      var msg = escapeHTML('<?php echo $l->m('er_001') . ': ' . $l->m('er_035'); ?>');
+      alert(msg);
+      resetDim();
+      return;
+    }   
+    
+    f = cheight/cwidth; // factor   
+    if (sel == 1) {                                   // height changed       
+      formObj.pr_width.value  = Math.round(formObj.pr_height.value / f);
+    } else if (sel == 0) {                                // width changed      
+      formObj.pr_height.value = Math.round(formObj.pr_width.value * f);     
+    }   
+  }
+  
+  function resetDim() { // reset dimensions
+    var formObj = document.forms[0];
+    var cwidth  = document.getElementById('cimg').attributes['cwidth'].value;     // get current width  
+    var cheight = document.getElementById('cimg').attributes['cheight'].value;      // get current height 
+    formObj.pr_width.value  = cwidth;
+    formObj.pr_height.value = cheight;
+  }     
+// ============================================================
+// = show about, date: 06/04/2005                             =
+// ============================================================ 
+  function about() {    
+    var formObj = document.forms[0];    
+    if (document.getElementById('imDiv').className == 'hideit') {
+      var x = document.getElementById('menuBarDiv').getElementsByTagName('li');
+      for (var i = 0; i < x.length; i++) {
+        if (x[i].className == 'btnDown') {        
+          formObj.param.value = (x[i].id);
+          elm = x[i].id.substring(x[i].id.length-2, x[i].id.length);      
+          if (elm == 'po') { // popup windows - uses inDiv
+            elm = 'in'
+          }
+          elm = elm + 'Div';
+          document.getElementById('mainDivHeader').innerHTML = setTitle('imDiv');     
+          changeClass(1,elm,'hideit','imDiv','showit');                     
+        }
+      }
+    } else if (document.getElementById('imDiv').className == 'showit' && formObj.param.value != '') {
+      elm = formObj.param.value;      
+      btn_click(elm);     
+    }
+  }
+// ============================================================
+// = image file type extension V 1.0, date: 11/27/2004        =
+// ============================================================ 
+  function imageType(type) {    
+    var ext;    
+    switch(parseInt(type)) {
+      case 1 : ext = 'gif'; break;
+        case 2 : ext = 'jpg'; break;
+      case 3 : ext = 'png'; break;
+      case 6 : ext = 'bmp'; break;
+        default: ext = 'unknown';   
+    }   
+    return ext;
+  }
+// ============================================================
+// = show/hide load message, date: 07/07/2005                 =
+// ============================================================
+  function showloadmessage() {
+    document.getElementById('dialogLoadMessage').style.display = 'block';
+  } 
+  function hideloadmessage() {
+    document.getElementById('dialogLoadMessage').style.display = 'none';
+  } 
+// ============================================================
+// = show image info layer, date: 04/22/2005                  =
+// ============================================================
+  function showInfo() {
+    var formObj = document.forms[0];
+    if (formObj.chkRandom.checked) { // random image
+      return false;
+    }   
+    if (document.getElementById('cimg').attributes['cfile'].value != '') {      
+      var obj  = document.getElementById('inPrevDiv');
+      var oDiv = document.getElementById('infoDiv');        
+      
+      if (oDiv.className == 'showit') {
+        changeClass(0,oDiv.id,'hideit');
+      } else {
+        document.getElementById('inf_cwidth').innerHTML  = document.getElementById('cimg').attributes['cwidth'].value  + ' px';
+        document.getElementById('inf_cheight').innerHTML = document.getElementById('cimg').attributes['cheight'].value + ' px';
+        ctype = document.getElementById('cimg').attributes['ctype'].value.split('|'); 
+        document.getElementById('inf_ctype').innerHTML   = ctype[1];    
+        csize = document.getElementById('cimg').attributes['csize'].value.split('|');
+        document.getElementById('inf_csize').innerHTML   = csize[0] + ' ' + csize[1];       
+        document.getElementById('inf_ccdate').innerHTML  = document.getElementById('cimg').attributes['ccdate'].value; 
+        document.getElementById('inf_cmdate').innerHTML  = document.getElementById('cimg').attributes['cmdate'].value;    
+        if (iBrowser.isMSIE) {
+          moveInfoTo(obj, oDiv, 0, 0); // object to move to (destination), object being moved, x offset, y offset   
+        } else if (iBrowser.isGecko) {
+          moveInfoTo(obj, oDiv, 0, 0); // object to move to (destination), object being moved, x offset, y offset
+        }           
+        changeClass(0, oDiv.id, 'showit');
+      }
+    } 
+  }
+// ============================================================
+// = move layer/div to object, date: 04/22/2005               =
+// ============================================================
+  function moveInfoTo(obj, oDiv, ox, oy) {      
+      var newX = getPosX(obj) + ox;
+      var newY = getPosY(obj) + oy;     
+      document.getElementById(oDiv.id).style.left = newX + 'px';
+      document.getElementById(oDiv.id).style.top  = newY + 'px';          
+  }
+// ============================================================
+// = get object's position, date: 04/22/2005                  =
+// ============================================================
+  function getPosX(obj) { // get X position
+    var cleft = 0;
+    if (obj.offsetParent) {
+      while (obj.offsetParent) {
+        cleft += obj.offsetLeft
+        obj    = obj.offsetParent;
+      }
+    } else if (obj.x) {
+      cleft += obj.x;
+    }
+    return cleft;   
+  }
+
+  function getPosY(obj) { // get Y position
+    var ctop = 0;
+    if (obj.offsetParent) {
+      while (obj.offsetParent) {
+        ctop += obj.offsetTop
+        obj   = obj.offsetParent;
+      }
+    } else if (obj.y) {
+      ctop += obj.y;
+    }
+    return ctop;
+  }
+// ============================================================
+// = returns absolute path, date: 04/22/2005                  =
+// ============================================================
+  function absPath(path) {
+    if (path.charAt(0) != '/') {
+      path = '/' + path;      
+    }
+    return path;
+  }
+// ============================================================
+// = escapeHTML, date: 08/12/2005                             =
+// ============================================================
+  function escapeHTML(str) {    
+    var divElm = document.createElement('div');
+    divElm.innerHTML = str; 
+    str = divElm.innerHTML;
+    return str;
+    }
+//-->
+</script>
+</head>
+<body onLoad="init(); hideloadmessage();" dir="<?php echo $l->getDir(); ?>">
+<?php include dirname(__FILE__) . '/scripts/loadmsg.php'; ?>
+<!- image info layer (cimg) -->
+<div id="infoDiv" class="hideit">
+  <div>
+    <label><?php echo $l->m('in_028'); ?>:</label>
+    <span id="inf_cwidth"> </span>
+  </div>
+  <div>
+    <label><?php echo $l->m('in_029'); ?>:</label>
+    <span id="inf_cheight"> </span>
+  </div>
+  <div>
+    <label><?php echo $l->m('in_030'); ?>:</label>
+    <span id="inf_ctype"> </span>
+  </div>
+  <div>
+    <label><?php echo $l->m('in_031'); ?>:</label>
+    <span id="inf_csize"> </span>
+  </div>
+  <div>
+    <label><?php echo $l->m('in_033'); ?>:</label>
+    <span id="inf_ccdate"> </span>
+  </div>
+  <div>
+    <label><?php echo $l->m('in_034'); ?>:</label>
+    <span id="inf_cmdate"> </span>
+  </div>
+</div>
+<form id="iBrowser" name="iBrowser" method="post" action="scripts/rfiles.php" enctype="multipart/form-data" target="inSelFrame">
+  <input type="hidden" name="lang" value="<?php echo $l->lang; ?>" />
+  <input type="hidden" id="param" name="param" value="" />
+  <input type="hidden" id="flist" name="flist" value="<?php echo $cfg['list']; ?>" />
+  <input type="hidden" id="cimg" name="cimg" value="" cfile="" cwidth="" cheight="" csize="" ctype="" ccdate="" cmdate="" />
+  <div id="outerDivWrap">
+    <div class="headerDiv">
+      <div class="btnRight">
+        <img src="images/about_off.gif" alt="<?php echo $l->m('im_015'); ?>" width="16" height="16" border="0" align="middle" title="<?php echo $l->m('im_015'); ?>" onClick="about();" onMouseOver="this.src='images/about.gif';" onMouseOut="this.src='images/about_off.gif';" />
+      </div>
+      <?php echo $l->m('im_002'); ?>
+    </div>
+    <div class="brdPad">
+      <!- MAIN MENU --------------------------------------------------------- -->
+      <div id="menuDivWrap">
+        <div class="headerDiv">
+          <?php echo $l->m('im_003'); ?>
+        </div>
+        <div class="brdPad">
+          <div id="menuDiv">
+            <div id="menuBarDiv" >
+              <ul>
+                <li id="mbtn_in" class="btnUp"><img id="img_in" src="images/img_in.gif" width="40" height="40" />
+                  <div>
+                    <?php echo $l->m('im_007'); ?>
+                  </div>
+                </li>
+                <li id="mbtn_at" class="btnUp"><img id="img_at" src="images/img_at.gif" width="40" height="40" />
+                  <div>
+                    <?php echo $l->m('im_009'); ?>
+                  </div>
+                </li>
+                <li id="mbtn_po" class="btnUp"><img id="img_po" src="images/img_po.gif" width="40" height="40" />
+                  <div>
+                    <?php echo $l->m('im_013'); ?>
+                  </div>
+                </li>
+              </ul>
+            </div>
+          </div>
+        </div>
+      </div>
+      <!- // menuDivWrap -->
+      <!- MAIN CONTENT ------------------------------------------------------ -->
+      <div id="mainDivWrap">
+        <div id="mainDivHeader" class="headerDiv">
+          <?php echo $l->m('im_016'); ?>
+        </div>
+        <div class="brdPad">
+          <div id="mainDiv">
+            <!- WELCOME ----------------------------------------------------------- -->
+            <div id="imDiv" class="showit">
+              <!--p><img class="right" src="images/ib.gif" alt="<?php echo $l->m('im_001'); ?>" title="<?php echo $l->m('im_001'); ?>" width="48" height="48" border="0" /><strong>net<span class="hilight">4</span>visions.com</strong> - the image browser plugin for WYSIWYG editors like FCKeditor, SPAW, tinyMCE, Xinha, and HTMLarea!</p>
+              <p> <strong> <span class="hilight">i</span>Browser</strong> does upload images and supply file management functions. Images can be resized on the fly. If you need even more advanced features, have a look at <strong> <span class="hilight">i</span>Manager</strong>, another <strong>net<span class="hilight">4</span>visions.com</strong> plugin - it adds truecolor image editing functions like: resize, flip, crop, add text, gamma correct, merge into other image, and many others.</p -->
+              <p><strong> <span class="hilight">i</span>Browser</strong> is written and distributed under the GNU General Public License which means that its source code is freely-distributed and available to the general public.</p>
+              <p>&nbsp;</p>
+              <p>
+              <!--div class="btnRight">
+                <img src="images/firefox.gif" alt="" title="" width="80" height="15" align="absmiddle" /><img src="images/explorer.gif" alt="" title="" width="80" height="15" align="absmiddle" />
+              </div -->
+              <span class="ver"> Version: <?php echo $cfg['ver']; ?> </span>
+              </p>
+            </div>
+            <!- // imDiv -->
+            <!- INSERT/CHANGE ----------------------------------------------------- -->
+            <div id="inDiv" class="hideit">
+              <fieldset>
+              <!- select library ---------------------------------------------------- -->
+              <div id="ilibsDiv" class="showit">
+                <div class="rowDiv">
+                  <div class="btnRight">
+                    <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" title="<?php echo $l->m('in_003'); ?>" alt="<?php echo $l->m('in_003'); ?>" width="16" height="16" border="0" />
+                  </div>
+                  <label for="ilibs"> <span class="title"> <?php echo $l->m('in_002'); ?> </span> </label>
+                  <select class="fldlg" id="ilibs" name="ilibs" size="1" onChange="ilibsClick(this);">
+                    <?php echo $lib_options; ?>
+                  </select>
+                </div>
+              </div>
+              </fieldset>
+              <div class="floatWrap">
+                <!- left column ------------------------------------------------------- -->
+                <div class="colLeft">
+                  <div style="float: left;">
+                    <!- select image ------------------------------------------------------ -->
+                    <div class="rowDiv">
+                      <div class="btnRight">
+                        <img id="alertImg" class="hideit" src="images/alert_off.gif" onClick="alert(this.alt);" onMouseOver="this.src='images/alert.gif';" onMouseOut="this.src='images/alert_off.gif';" alt="<?php echo $l->m('in_051'); ?>" title="<?php echo $l->m('in_051'); ?>" width="16" height="16" border="0" />
+                      </div>
+                      <label> <span class="title"> <?php echo $l->m('in_004'); ?> </span> </label>
+                    </div>
+                    <div class="rowDiv">
+                      <div class="btnRight">
+                        <span><img src="images/info_off.gif" onMouseOver="this.src='images/info.gif'; showInfo();" onMouseOut="this.src='images/info_off.gif'; showInfo();" alt="" title="" width="16" height="16" border="0" /><br />
+                        <img src="images/dirview_off.gif" onClick="switchList();" onMouseOver="this.src='images/dirview.gif';" onMouseOut="this.src='images/dirview_off.gif';" alt="<?php echo $l->m('in_052'); ?>" title="<?php echo $l->m('in_052'); ?>" width="16" height="16" border="0" /></span>
+                      </div>
+                      <div id="inSelDiv">
+                        <iframe name="inSelFrame" id="inSelFrame" src="scripts/rfiles.php?clib=<?php echo $clib; ?>" style="width: 100%; height: 100%;" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+                <!- // colLeft -->
+                <!- right column ----------------------------------------------------- -->
+                <div class="colRight">
+                  <div style="float: left;">
+                    <!- preview image ---------------------------------------------------- -->
+                    <div class="rowDiv">
+                      <label> <span class="title"> <?php echo $l->m('in_005'); ?> </span> </label>
+                    </div>
+                    <div class="rowDiv">
+                      <div class="btnRight">
+                        <img onClick="fullSizeView('in'); return false;" src="images/prev_off.gif" onMouseOver="this.src='images/prev.gif';" onMouseOut="this.src='images/prev_off.gif';" alt="<?php echo $l->m('in_007'); ?>" title="<?php echo $l->m('in_007'); ?>" width="16" height="16" border="0" />
+                      </div>
+                      <div id="inPrevDiv">
+                        <iframe name="inPrevFrame" id="inPrevFrame" src="images/noImg.gif" style="width: 100%; height: 100%;" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+              <!- // colRight -->
+              <!- random section --------------------------------------------------- -->
+              <div id="raDiv" class="showit">
+                <div class="mbottom5">
+                  <div class="rowDiv">
+                    <div class="btnRight">
+                      <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" alt="<?php echo $l->m('in_054'); ?>" title="<?php echo $l->m('in_054'); ?>" width="16" height="16" border="0" />
+                    </div>
+                    <label> <span class="title"> <?php echo $l->m('in_053'); ?> </span> </label>
+                    <input name="chkRandom" id="chkRandom" type="checkbox" value="" class="chkBox" onClick="setRandom(1);" />
+                    <span class="frmText"> <?php echo $l->m('in_055'); ?> </span>
+                  </div>
+                  <div class="rowDiv">
+                    <div id="raParamDiv" class="hideit">
+                      <div class="btnRight">
+                        <img src="images/img_size_off.gif" onMouseOver="this.src='images/img_size.gif';" onMouseOut="this.src='images/img_size_off.gif';" onClick="setRandom(2);" alt="<?php echo $l->m('in_057'); ?>" title="<?php echo $l->m('in_057'); ?>" width="16" height="16" border="0" />
+                      </div>
+                      <label for="randomParam"> <span class="pad10"> <?php echo $l->m('in_056'); ?> </span> </label>
+                      <input class="fldlg" id="randomParam" name="randomParam" type="text" value="<?php echo $cfg['random']; ?>" />
+                    </div>
+                  </div>
+                </div>
+              </div>
+              <!- // raDiv -->
+              <!- popup section ---------------------------------------------------- -->
+              <div id="poDiv" class="hideit">
+                <div class="btnRight">
+                  <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" alt="<?php echo $l->m('in_013'); ?>" title="<?php echo $l->m('in_013'); ?>" width="16" height="16" border="0" />
+                </div>
+                <div class="poPrevDiv">
+                  <iframe id="poPrevFrame" name="poPrevFrame" src="images/noPop.gif" style="width: 100%; height: 100%;" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>
+                </div>
+                <div class="rowDiv">
+                  <label> <span class="title"> <?php echo $l->m('in_010'); ?> </span> </label>
+                </div>
+                <div id="poDelDiv" class="hideit">
+                  <div class="rowDiv">
+                    <label for="chkP"> <span class="pad10"> <?php echo $l->m('in_024'); ?> </span> </label>
+                    <input type="checkbox" id="chkP" name="chkP" value="" class="chkBox"/>
+                    <span class="frmText"> (<?php echo $l->m('in_014'); ?>) </span>
+                  </div>
+                </div>
+                <div class="rowDiv">
+                  <label for="popClassName"> <span class="pad10"> <?php echo $l->m('at_009'); ?> </span> </label>
+                  <select class="fldm" id="popClassName" name="popClassName" />
+                  
+                  <option value="default" selected="selected"><?php echo $l->m('at_099'); ?></option>
+                  <?php echo getStyles(false); ?>
+                  </select>
+                </div>
+                <!- clear floats ------------------------------------------------------ -->
+                <div class="clrFloatRight">
+                </div>
+                <div class="rowDiv">
+                  <label for="popTitle"> <span class="pad10"> <?php echo $l->m('at_002'); ?> </span> </label>
+                  <input class="fldlg" id="popSrc" name="popSrc" type="text" value="" disabled="true" readonly="true"/>
+                </div>
+                <div class="rowDiv">
+                  <div class="btnRight">
+                    <img onClick="selSymbol('popTitle');" src="images/symbols_off.gif" onMouseOver="this.src='images/symbols.gif';" onMouseOut="this.src='images/symbols_off.gif';" title="<?php echo $l->m('at_029'); ?>" alt="<?php echo $l->m('at_029'); ?>" width="16" height="16" border="0" /><img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" alt="<?php echo $l->m('at_004'); ?>" title="<?php echo $l->m('at_004'); ?>" width="16" height="16" border="0" />
+                  </div>
+                  <label for="popTitle"> <span class="pad10"> <?php echo $l->m('at_003'); ?> </span> </label>
+                  <input class="fldmlg" id="popTitle" name="popTitle" type="text" value="" />
+                </div>
+              </div>
+              <!- // poDiv -->
+              <!- file section ----------------------------------------------------- -->
+              <div id="fileDivWrap" class="showit">
+                <div class="rowDiv">
+                  <div class="btnRight">
+            <?php if ($cfg['create'] && isset($cfg['ilibs_inc'])) {; ?>
+                    <img src="images/dir_off.gif" onClick="changeClass(0,'fileDiv','showit','fiDirDiv','showit','fiUplDiv','hideit','fiRenDiv','hideit','fiDelDiv','hideit');" onMouseOver="this.src='images/dir.gif';" onMouseOut="this.src='images/dir_off.gif';" alt="<?php echo $l->m('in_027'); ?>" title="<?php echo $l->m('in_027'); ?>" width="16" height="16" />
+                    <?php }; ?>
+                    <?php if ($cfg['upload']) {; ?>
+                    <img src="images/upimg_off.gif" onClick="changeClass(1,'fileDiv','showit','fiDirDiv','hideit','fiUplDiv','showit','fiRenDiv','hideit','fiDelDiv','hideit');" onMouseOver="this.src='images/upimg.gif';" onMouseOut="this.src='images/upimg_off.gif';" alt="<?php echo $l->m('in_019'); ?>" title="<?php echo $l->m('in_019'); ?>" width="16" height="16" />
+                    <?php }; ?>
+                    <?php if ($cfg['rename']) {; ?>
+                    <img class="isecbtn"src="images/renimg_off.gif" onClick="changeClass(0,'fileDiv','showit','fiDirDiv','hideit','fiRenDiv','showit','fiUplDiv','hideit','fiDelDiv','hideit');" onMouseOver="this.src='images/renimg.gif';" onMouseOut="this.src='images/renimg_off.gif';" alt="<?php echo $l->m('in_017'); ?>" title="<?php echo $l->m('in_017'); ?>" width="16" height="16" border="0" />
+                    <?php }; ?>
+                    <?php if ($cfg['delete']) {; ?>
+                    <img src="images/delimg_off.gif" onClick="changeClass(0,'fileDiv','showit','fiDirDiv','hideit','fiDelDiv','showit','fiRenDiv','hideit','fiUplDiv','hideit');" onMouseOver="this.src='images/delimg.gif';" onMouseOut="this.src='images/delimg_off.gif';" alt="<?php echo $l->m('in_006'); ?>" title="<?php echo $l->m('in_006'); ?>" width="16" height="16" border="0" />
+                    <?php }; ?>
+                    <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" alt="<?php echo $l->m('in_008'); ?>" title="<?php echo $l->m('in_008'); ?>" width="16" height="16" border="0" />
+                  </div>
+                  <label> <span class="title"> <?php echo $l->m('in_015'); ?> </span> </label>
+                </div>
+                <!- clear floats ------------------------------------------------------ -->
+                <div class="clrFloatRight">
+                </div>
+                <div id="fileDiv" class="showit">
+                  <?php if ($cfg['delete']) { ?>
+                  <div id="fiDelDiv" class="hideit">
+                    <div class="rowDiv">
+                      <div class="btnRight">
+                        <img onClick="deleteClick();" src="images/okclick_off.gif" onMouseOver="this.src='images/okclick.gif';" onMouseOut="this.src='images/okclick_off.gif';" alt="<?php echo $l->m('in_006'); ?>" title="<?php echo $l->m('in_006'); ?>" width="16" height="16" border="0" />
+                      </div>
+                      <label for="in_srcnew"> <span class="pad10"> <?php echo $l->m('in_024'); ?> </span> </label>
+                      <input class="fldlg readonly" id="in_delinfo" name="in_delinfo" type="text" value="" disabled="true" readonly="true" />
+                    </div>
+                  </div>
+                  <?php }; ?>
+                  <?php if ($cfg['rename']) { ?>
+                  <div id="fiRenDiv" class="hideit">
+                    <div class="rowDiv">
+                      <div class="btnRight">
+                        <img onClick="renameClick();" src="images/okclick_off.gif" onMouseOver="this.src='images/okclick.gif';" onMouseOut="this.src='images/okclick_off.gif';" alt="<?php echo $l->m('in_017'); ?>" title="<?php echo $l->m('in_017'); ?>" width="16" height="16" border="0" />
+                      </div>
+                      <label for="in_srcnew"> <span class="pad10"> <?php echo $l->m('in_016'); ?> </span> </label>
+                      <input class="fldlg" id="in_srcnew" name="in_srcnew" type="text" value="" onKeyUp="RemoveInvalidChars(this, '[^A-Za-z0-9 \_]'); ForceLowercase(this); CharacterReplace(this, ' ', '_'); return false;"  />
+                    </div>
+                  </div>
+                  <?php }; ?>
+                  <?php if ($cfg['create']) { ?>
+                  <div id="fiDirDiv" class="hideit">
+                    <div class="rowDiv">
+                      <div class="btnRight">
+                        <img onClick="createClick();" src="images/okclick_off.gif" onMouseOver="this.src='images/okclick.gif';" onMouseOut="this.src='images/okclick_off.gif';" alt="<?php echo $l->m('in_026'); ?>" title="<?php echo $l->m('in_026'); ?>" width="16" height="16" border="0" />
+                      </div>
+                      <label for="in_srcnew"> <span class="pad10"> <?php echo $l->m('in_025'); ?> </span> </label>
+                      <input class="fldlg" id="in_dirnew" name="in_dirnew" type="text" value="" onKeyUp="RemoveInvalidChars(this, '[^A-Za-z0-9 \_]'); ForceLowercase(this); CharacterReplace(this, ' ', '_'); return false;" />
+                    </div>
+                  </div>
+                  <?php }; ?>
+                  <?php if ($cfg['upload']) {; ?>
+                  <div id="fiUplDiv" class="hideit">
+                    <div class="rowDiv">
+                      <div class="btnRight">
+                        <img onClick="uploadClick();" src="images/okclick_off.gif" onMouseOver="this.src='images/okclick.gif';" onMouseOut="this.src='images/okclick_off.gif';" alt="<?php echo $l->m('in_019'); ?>" title="<?php echo $l->m('in_019'); ?>" width="16" height="16" />
+                      </div>
+                      <?php 
+              $max = isset($cfg['umax']) && $cfg['umax'] >= 1 ? $cfg['umax'] : 1;         
+              for($i=1; $i <= $max; $i++) {; ?>
+                      <label for="nfile"> <span class="pad10"> <?php echo $l->m('in_018'); if ($max > 1){ echo ' (' . $i . ')';} ?> </span> </label>
+                      <input name="nfile[]" type="file" class="fldlg" id="nfile[]" size="53" accept="image/*" />
+                      <?php }; ?>
+                    </div>
+                    <div class="rowDiv">
+                      <div class="btnRight">
+                        <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" title="<?php echo $l->m('in_021'); ?>" alt="<?php echo $l->m('in_021'); ?>" width="16" height="16" border="0" />
+                      </div>
+                      <label for="chkThumbSize[]"> <span class="pad20"> <?php echo $l->m('in_020'); ?> </span> </label>
+                      <div id="fmtDiv">
+                        <?php echo thumbSizes($cfg['thumbs']); ?>
+                      </div>
+                    </div>
+                    <div class="rowDiv">
+                      <div class="btnRight">
+                        <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" title="<?php echo $l->m('in_038'); ?>" alt="<?php echo $l->m('in_038'); ?>" width="16" height="16" border="0" />
+                      </div>
+                      <label for="rotateDiv"> <span class="pad20"> <?php echo $l->m('in_037'); ?> </span> </label>
+                      <select class="fldm" id="selRotate" name="selRotate">
+                        <option value="" selected="selected"><?php echo $l->m('in_041'); ?></option>
+                        <optgroup label="<?php echo $l->m('in_043'); ?>">
+                        <option value="P" ><?php echo $l->m('in_044'); ?></option>
+                        <option value="p" ><?php echo $l->m('in_045'); ?></option>
+                        </optgroup>
+                        <optgroup label="<?php echo $l->m('in_046'); ?>">
+                        <option value="l" ><?php echo $l->m('in_047'); ?></option>
+                        <option value="L"><?php echo $l->m('in_048'); ?></option>
+                        </optgroup>
+                        <optgroup label="<?php echo $l->m('in_049'); ?>">
+                        <option value="x"><?php echo $l->m('in_050'); ?></option>
+                        </optgroup>
+                      </select>
+                      <span class="frmText">(<?php echo $l->m('in_099'); ?>: <?php echo $l->m('in_042'); ?>)</span>
+                    </div>
+                  </div>
+                  <?php }; ?>
+                </div>
+              </div>
+              <!- // fiDiv -->
+            </div>
+            <!- // inDiv -->
+            <!- ATTRIBUTES -------------------------------------------------------- -->
+            <div id="atDiv" class="hideit">
+              <fieldset>
+              <div class="rowDiv">
+                <label for="pr_src"> <span class="title"> <?php echo $l->m('at_002'); ?> </span> </label>
+                <input class="fldlg readonly" id="pr_src" name="pr_src" type="text" value="" disabled="true" readonly="true" />
+              </div>
+              <div class="rowDiv">
+                <div class="btnRight">
+                  <img onClick="selSymbol('pr_title');" src="images/symbols_off.gif" onMouseOver="this.src='images/symbols.gif';" onMouseOut="this.src='images/symbols_off.gif';" title="<?php echo $l->m('at_029'); ?>" alt="<?php echo $l->m('at_029'); ?>" width="16" height="16" border="0" /><img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" alt="<?php echo $l->m('at_004'); ?>" title="<?php echo $l->m('at_004'); ?>" width="16" height="16" border="0" />
+                </div>
+                <label for="pr_title"> <span class="title"> <?php echo $l->m('at_003'); ?> </span> </label>
+                <input class="fldmlg" id="pr_title" name="pr_title" type="text" value="" onChange="updateStyle()" />
+              </div>
+              <div class="rowDiv">
+                <div class="btnRight">
+                  <img onClick="selSymbol('pr_alt');" src="images/symbols_off.gif" onMouseOver="this.src='images/symbols.gif';" onMouseOut="this.src='images/symbols_off.gif';" title="<?php echo $l->m('at_030'); ?>" alt="<?php echo $l->m('at_030'); ?>" width="16" height="16" border="0" /><img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" alt="<?php echo $l->m('at_006'); ?>" title="<?php echo $l->m('at_006'); ?>" width="16" height="16" border="0" />
+                </div>
+                <label for="pr_alt"> <span class="title"> <?php echo $l->m('at_005'); ?> </span> </label>
+                <input class="fldmlg" id="pr_alt" name="pr_alt" type="text" value="" onChange="updateStyle()" />
+              </div>
+              </fieldset>
+              <div class="floatWrap">
+                <!- left column ------------------------------------------------------ -->
+                <div class="colLeft">
+                  <div class="rowDiv">
+                    <label> <span class="title"> <?php echo $l->m('at_007'); ?> </span> </label>
+                  </div>
+                  <div class="rowDiv">
+                    <div class="btnRight">
+                      <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" alt="<?php echo $l->m('at_008'); ?>" title="<?php echo $l->m('at_008'); ?>" width="16" height="16" border="0" />
+                    </div>
+                    <label for="pr_class"> <span class="pad10"> <?php echo $l->m('at_009'); ?> </span> </label>
+                    <select class="fldm" id="pr_class" name="pr_class" onChange="updateStyle()">
+                      <option value="default" selected="selected"><?php echo $l->m('at_099'); ?></option>
+                      <?php echo getStyles(false); ?>
+                    </select>
+                  </div>
+                  <div class="rowDiv">
+                    <div class="btnRight">
+                      <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" title="<?php echo $l->m('at_011'); ?>" alt="<?php echo $l->m('at_011'); ?>" width="16" height="16" border="0" />
+                    </div>
+                    <label> <span class="title"> <?php echo $l->m('at_010'); ?> </span> </label>
+                  </div>
+                  <div class="rowDiv">
+                    <label for="pr_align"> <span class="pad10"> <?php echo $l->m('at_012'); ?> </span> </label>
+                    <select class="fldm" id="pr_align" name="pr_align" onChange="updateStyle()">
+                      <option value=""><?php echo $l->m('at_013'); ?></option>
+                      <option value="left"><?php echo $l->m('at_014'); ?></option>
+                      <option value="right"><?php echo $l->m('at_015'); ?></option>
+                      <option value="top"><?php echo $l->m('at_016'); ?></option>
+                      <option value="middle"><?php echo $l->m('at_017'); ?></option>
+                      <option value="bottom"><?php echo $l->m('at_018'); ?></option>
+                    </select>
+                  </div>
+                  <div class="rowDiv">
+                    <label for="pr_size"> <span class="pad10"> <?php echo $l->m('at_022'); ?> </span> </label>
+                    <input class="fldsm readonly" id="pr_size" name="pr_size" type="text"value="" maxlength="8" disabled="true" readonly="true" />
+                    <span class="frmText">(<span id="pr_sizeUnit"></span>)</span>
+                  </div>
+                  <div class="rowDiv">
+                    <?php if ($cfg['attrib'] == true) {; ?>
+                    <div class="btnRight">
+                      <img src="images/img_size_off.gif" onMouseOver="this.src='images/img_size.gif';" onMouseOut="this.src='images/img_size_off.gif';" onClick="resetDim();" alt="<?php echo $l->m('at_031'); ?>" title="<?php echo $l->m('at_031'); ?>" width="16" height="16" border="0" />
+                    </div>
+                    <?php }; ?>
+                    <label for="pr_width"> <span class="pad10"> <?php echo $l->m('at_023'); ?> </span> </label>
+                    <input id="pr_width" name="pr_width" type="text"value="" maxlength="4" <?php if ($cfg['attrib'] != true) {; ?> class="fldsm readonly" disabled="true" readonly="true" <?php } else {; ?> class="fldsm" onchange="changeDim(0);" onkeyup="RemoveInvalidChars(this, '[^0-9]');" <?php }; ?> />
+                    <span class="frmText"> (px) </span>
+                  </div>
+                  <div class="rowDiv">
+                    <label for="pr_height"> <span class="pad10"> <?php echo $l->m('at_024'); ?> </span> </label>
+                    <input id="pr_height" name="pr_height" type="text"value="" maxlength="4" <?php if ($cfg['attrib'] != true) {; ?> class="fldsm readonly" disabled="true" readonly="true" <?php } else {; ?> class="fldsm" onchange="changeDim(1);" onkeyup="RemoveInvalidChars(this, '[^0-9]');" <?php }; ?> />
+                    <span class="frmText"> (px) </span>
+                  </div>
+                  <div class="rowDiv">
+                    <label for="pr_border"> <span class="pad10"> <?php echo $l->m('at_025'); ?> </span> </label>
+                    <input class="fldsm" id="pr_border" name="pr_border" type="text"value="" maxlength="2" onChange="updateStyle();" onKeyUp="RemoveInvalidChars(this, '[^0-9]');"  />
+                    <span class="frmText"> (px) </span>
+                  </div>
+                  <div class="rowDiv">
+                    <label for="pr_vspace"> <span class="pad10"> <?php echo $l->m('at_026'); ?> </span> </label>
+                    <input class="fldsm" id="pr_vspace" name="pr_vspace" type="text" value="" maxlength="2" onChange="updateStyle();" onKeyUp="RemoveInvalidChars(this, '[^0-9]');" />
+                    <span class="frmText"> (px) </span>
+                  </div>
+                  <div class="rowDiv">
+                    <label for="pr_hspace"> <span class="pad10"> <?php echo $l->m('at_027'); ?> </span> </label>
+                    <input class="fldsm" id="pr_hspace" name="pr_hspace" type="text" value="" maxlength="2" onChange="updateStyle();" onKeyUp="RemoveInvalidChars(this, '[^0-9]');" />
+                    <span class="frmText"> (px) </span>
+                  </div>
+                </div>
+                <!- // colLeft -->
+                <!- right column ----------------------------------------------------- -->
+                <div class="colRight">
+                  <div style="float: left;">
+                    <div class="rowDiv">
+                      <label> <span class="title"> <?php echo $l->m('at_028'); ?> </span> </label>
+                    </div>
+                    <div class="rowDiv">
+                      <div id="atPrevDiv">
+                        <p><img id="atPrevImg" src="images/textflow.gif" width="45" height="45" alt="" title="" hspace="" vspace="" border="" class="" />Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exercitation ullamcorper suscipit. Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+                <!- // colRight -->
+                <div class="rowDiv">
+                  <div class="btnRight">
+                    <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" alt="<?php echo $l->m('at_033'); ?>" title="<?php echo $l->m('at_033'); ?>" width="16" height="16" border="0" />
+                  </div>
+                  <label for="pr_chkCaption"> <span class="title"> <?php echo $l->m('at_032'); ?> </span> </label>
+                  <input name="pr_chkCaption" type="checkbox" class="chkBox" id="pr_chkCaption" onChange="updateStyle()" value="1" />
+                  <span class="frmText">(<?php echo $l->m('at_034'); ?>)</span>
+                </div>
+                <div class="rowDiv">
+                  <div class="btnRight">
+                    <img class="hlpBtn" src="images/help_off.gif" onMouseOver="this.src='images/help.gif';" onMouseOut="this.src='images/help_off.gif';" onClick="alert(this.alt);" alt="<?php echo $l->m('at_008'); ?>" title="<?php echo $l->m('at_008'); ?>" width="16" height="16" border="0" />
+                  </div>
+                  <label for="pr_captionClass"> <span class="pad10"> <?php echo $l->m('at_009'); ?> </span> </label>
+                  <select class="fldm" id="pr_captionClass" name="pr_captionClass" onChange="updateStyle()">
+                    <option value="default" selected="selected"><?php echo $l->m('at_099'); ?></option>
+                    <?php echo getStyles(true); ?>
+                  </select>
+                </div>
+              </div>
+            </div>
+            <!- // atDiv -->
+          </div>
+        </div>
+      </div>
+      <!- // mainDivWrap -->
+      <!- footer ----------------------------------------------------------- -->
+      <div id="ftDivWrap">
+        <div id="ftDiv">
+          <input type="button" value="<?php echo $l->m('im_005'); ?>" class="btn" onClick="insertImage();" />
+          <span class="pad5">
+          <input type="button" value="<?php echo $l->m('im_006'); ?>" class="btn" onClick="top.window.close();" />
+          </span>
+        </div>
+      </div>
+      <!- // ftDivWrap -->
+    </div>
+  </div>
+  <!- // outerDivWrap -->
+</form>
+</body>
+</html><?php
+// ============================================================
+// = create library list V 1.0, date: 05/10/2005              =
+// ============================================================
+  function liboptions($arr, $prefix = '', $sel = '') {
+      $retval = '';
+      foreach($arr as $lib) {     
+        $retval .= '<option value="' . absPath($lib['value']) . '"' . (($lib['value'] == $sel) ? ' selected="selected"' : '') . '>' . $prefix . $lib['text'] . '</option>' . "\n";
+      }
+      return $retval;
+  }
+// ============================================================
+// = create thumb sizes V 1.0, date: 05/23/2005               =
+// ============================================================
+  function thumbSizes($arr, $sel = '') {
+      global $l;
+    $retval = '';
+      foreach($arr as $key => $thumb) {     
+      $retval .= '<div>' . '<input id="chkThumbSize[' . $key . ']" name="chkThumbSize[' . $key . ']" class="chkBox" type="checkbox" value="' . $key . '"' . (($key == 0) ? ' checked="checked"' : '') . ' />' . '<span class="frmText">' . (($thumb['size'] == '*') ? $l->m('in_022') . '&nbsp;'  : $thumb['size'] . ' px' ) . '</span>' . (($thumb['crop'] == true) ? '<img src="images/thbCrop.gif" align="absmiddle" width="10px" height="10px" alt="' . $l->m('in_023') . '" title="' . $l->m('in_023') . '" />' : '') . '</div>' . "\n";
+    }
+      return $retval;
+  }
+// ============================================================
+// = abs path - add slashes V 1.0, date: 05/10/2005           =
+// ============================================================
+  function absPath($path) {   
+    if (substr($path,-1)  != '/') $path .= '/';
+    if (substr($path,0,1) != '/') $path  = '/' . $path;
+    return $path;
+  }
+// ============================================================
+// = css styles V 1.0, date: 08/03/2005                       =
+// ============================================================
+  function getStyles($cap) {
+    $styles = '';
+    global $cfg;
+    foreach ($cfg['style'] as $key => $value) {
+      $pos = strrpos($key,'capDiv'); // is caption style
+      if ($cap == false && $pos === false) {
+          $styles .= '<option value="'. $key . '">' . $value . '</option>';
+      } elseif ($cap == true && $pos !== false) {
+          $styles .= '<option value="'. $key . '">' . $value . '</option>';
+      }
+    }
+    return $styles;
+  }
+//-------------------------------------------------------------------------
+?>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/about.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/about.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/about_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/about_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/alert.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/alert.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/alert_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/alert_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/buttonbar.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/buttonbar.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/buttonbar_gs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/buttonbar_gs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/defaultIcon.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/defaultIcon.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/delimg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/delimg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/delimg_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/delimg_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dir.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dir.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dir_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dir_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dirview.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dirview.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dirview_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/dirview_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/explorer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/explorer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/explorer.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/explorer.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/favicon.ico
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/favicon.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/firefox.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/firefox.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/firefox.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/firefox.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/help_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/help_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/ib.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/ib.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/ibrowser.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/ibrowser.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_at.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_at.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_at_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_at_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_cr.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_cr.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_cr_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_cr_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_in.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_in.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_in_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_in_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_po.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_po.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_po_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_po_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_size.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_size.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_size_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/img_size_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Nothing to see here people, move along!
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/info.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/info.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/info_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/info_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noImg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noImg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noImg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noImg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noPop.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noPop.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noPop.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/noPop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/okclick.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/okclick.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/okclick_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/okclick_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/paypal.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/paypal.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/prev.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/prev.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/prev_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/prev_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/randomImg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/randomImg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/randomImg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/randomImg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/renimg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/renimg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/renimg_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/renimg_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/spacer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/spacer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/symbols.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/symbols.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/symbols_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/symbols_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/textflow.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/textflow.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/thbCrop.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/thbCrop.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/upimg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/upimg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/upimg_off.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/images/upimg_off.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+header('Location: /');
+exit;
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/interface/common.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/interface/common.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/interface/common.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,421 @@
+// ================================================
+// PHP image browser - iBrowser 
+// ================================================
+// iBrowser - wysiwyg editor interface (IE & Gecko)
+// for tinyMCE, FCKeditor, SPAW, Xinha, and HTMLarea
+// ================================================
+// Developed: net4visions.com
+// Copyright: net4visions.com
+// License: GPL - see license.txt
+// (c)2005 All rights reserved.
+// File: common.js
+// ================================================
+// Revision: 1.0                   Date: 10/07/2005
+// ================================================ 
+  //=========================================================================
+  // common code for all wysiwyg editor interfaces like tinyMCE, FCKeditor,
+  // SPAW, Xinha, and HTMLarea
+  //=========================================================================
+  // initiate iBrowser object
+  function iBrowser() {   
+  }
+  var ib = new iBrowser;
+  //-------------------------------------------------------------------------
+  // open iBrowser
+  function iBrowser_open() {    
+    ib.oEditor.contentWindow.focus();
+    var wArgs = {};
+    var elm = ib.selectedElement;   
+    if (elm != null) { // if element    
+      if (elm.nodeName.toLowerCase() == 'img') { // selected object is image        
+        var oImageElement   = elm;        
+        var oLinkElement    = oImageElement.parentNode.nodeName.toLowerCase() == 'a' ? oImageElement.parentNode : null;
+        var oCaptionElement = ib.getNextSiblingByName(oImageElement, 'span');
+        ib.getImgParam(oImageElement, wArgs); // set image parameters       )
+        if (oLinkElement) { // set popup parameters         
+          var oCaptionElement = ib.getNextSiblingByName(oLinkElement, 'span');
+          ib.getLinkParam(oLinkElement, wArgs);
+        }       
+      } else if (elm.nodeName.toLowerCase() == 'a') { // selected object is link
+        var oLinkElement    = elm;
+        var oImageElement   = oLinkElement.childNodes[0].nodeName.toLowerCase() == 'img' ? oLinkElement.childNodes[0] : null;
+        var oCaptionElement = ib.getNextSiblingByName(oLinkElement, 'span');
+        ib.getLinkParam(oLinkElement, wArgs); // set popup parameters
+        if (oImageElement) { // if first child is image         
+          ib.getImgParam(oImageElement, wArgs); // set image parameters
+        }
+      } else if (elm.nodeName.toLowerCase() == 'span') { // selected element is caption container       
+        var oCaptionElement = ib.getChildByName(elm, 'span');
+        if (ib.isCaption(oCaptionElement)) { // check to see whether it is a caption element          
+          if (elm.childNodes[0].nodeName.toLowerCase() == 'img') {
+            var oImageElement = elm.childNodes[0];
+            ib.getImgParam(oImageElement, wArgs);
+          } else if (elm.childNodes[0].nodeName.toLowerCase() == 'a') {
+            var oLinkElement  = elm.childNodes[0];
+            var oImageElement = oLinkElement.childNodes[0].nodeName.toLowerCase() == 'img' ? oLinkElement.childNodes[0] : null;
+            ib.getLinkParam(oLinkElement, wArgs); // set popup parameters
+            if (oImageElement) { // if first child is image             
+              ib.getImgParam(oImageElement, wArgs); // set image parameters 
+            }
+          }         
+        } else { // selected element is caption text
+          oCaptionElement = elm;
+          if (ib.isCaption(oCaptionElement)) { // check to see whether it is a caption element        
+            if (oCaptionElement.previousSibling.nodeName.toLowerCase() == 'img') {            
+              var oImageElement = oCaptionElement.previousSibling;            
+              ib.getImgParam(oImageElement, wArgs);
+            } else if (oCaptionElement.previousSibling.nodeName.toLowerCase() == 'a') {
+              var oLinkElement = oCaptionElement.previousSibling;
+              var oImageElement = oLinkElement.childNodes[0].nodeName.toLowerCase() == 'img' ? oLinkElement.childNodes[0] : null;
+              ib.getLinkParam(oLinkElement, wArgs); // set popup parameters
+              if (oImageElement) { // if first child is image           
+                ib.getImgParam(oImageElement, wArgs); // set image parameters         
+              }
+            }
+          }
+        }
+      }
+      //-------------------------------------------------------------------------
+      // set caption argument       
+      ib.isCaption(oCaptionElement) ? wArgs.caption = 1 : '';
+      ib.isCaption(oCaptionElement) ? wArgs.captionClass = oCaptionElement.parentNode.attributes['class'].value : '';
+    }   
+    //-------------------------------------------------------------------------
+    // open iBrowser dialog   
+    if (ib.isMSIE) { // IE
+      var rArgs = showModalDialog(ib.baseURL, wArgs, 'dialogHeight:500px; dialogWidth:580px; scrollbars: no; menubar: no; toolbar: no; resizable: no; status: no;');  
+      if (rArgs) { // returning from iBrowser (IE) and calling callback function        
+        iBrowser_callback('','',rArgs);
+      }
+    } else if (ib.isGecko) { // Gecko 
+      var wnd = window.open(ib.baseURL + '?editor=' + ib.editor + '&callback=iBrowser_callback', 'ibrowser', 'status=no, modal=yes, width=625, height=530');
+      wnd.dialogArguments = wArgs;
+    }
+  }
+  //-------------------------------------------------------------------------
+  // iBrowser callback
+  function iBrowser_callback(editor, sender, iArgs) {   
+    if (iArgs) { // IE      
+      var rArgs = iArgs;
+    } else { // Gecko
+      var rArgs = sender.returnValue;
+    }
+    ib.oEditor.contentWindow.focus();
+    var elm = ib.selectedElement; 
+    if (elm != null) {
+      if (elm.nodeName.toLowerCase() == 'img') { // is current cell a image ?
+        var oImageElement = elm;
+      }
+      if (elm.nodeName.toLowerCase() == 'a') { // is current cell a link ?
+        var oLinkElement = elm;
+      }
+      if (elm.nodeName.toLowerCase() == 'span') {
+        if (elm.childNodes[0] && elm.childNodes[0].nodeName.toLowerCase() == 'img') { // caption container        
+          var oImageElement = elm.childNodes[0];          
+        } else if (elm.previousSibling && elm.previousSibling.nodeName.toLowerCase() == 'img') { // caption text        
+          var oImageElement = elm.previousSibling;          
+        }
+      }
+    }
+    
+    if (rArgs) {
+      if (!rArgs.action) { // no action set - image       
+        if (!oImageElement) { // new image// no image - create new image
+          ib.oEditor.contentWindow.document.execCommand('insertimage', false, rArgs.src);
+          oImageElement = ib.getElementByAttributeValue(ib.oEditor.contentWindow.document, 'img', 'src', rArgs.src);    
+        }
+        
+        // set image attributes
+        ib.setAttrib(oImageElement, 'src', rArgs.src, true);        
+        ib.setAttrib(oImageElement, 'alt', rArgs.alt, true);
+        ib.setAttrib(oImageElement, 'title', rArgs.title, true);
+        ib.setAttrib(oImageElement, 'align', rArgs.align, true);
+        ib.setAttrib(oImageElement, 'border', rArgs.border);
+        ib.setAttrib(oImageElement, 'hspace', rArgs.hspace);
+        ib.setAttrib(oImageElement, 'vspace', rArgs.vspace);
+        ib.setAttrib(oImageElement, 'width', rArgs.width);
+        ib.setAttrib(oImageElement, 'height', rArgs.height);        
+        ib.isMSIE ? ib.setAttrib(oImageElement, 'className', rArgs.className, true) : ib.setAttrib(oImageElement, 'class', rArgs.className, true);
+        
+        // set caption
+        if (oImageElement.parentNode.nodeName.toLowerCase() == 'a') { // popup image
+          var oLinkElement = oImageElement.parentNode;
+          ib.setCaption(oLinkElement,rArgs.caption,oImageElement.getAttribute('title'),rArgs.captionClass);
+        } else {
+          ib.setCaption(oImageElement,rArgs.caption,oImageElement.getAttribute('title'),rArgs.captionClass);
+        } 
+      } else if (rArgs.action == 1) { // action set - image popup               
+        if (oLinkElement) { // edit exiting popup link                
+          a.href        = "javascript:void(0);";
+          rArgs.popSrc  = escape(rArgs.popSrc);         
+          ib.setAttrib(oLinkElement, 'title', rArgs.popTitle, true);
+          ib.isMSIE ? ib.setAttrib(oLinkElement, 'className', rArgs.popClassName, true) : ib.setAttrib(oLinkElement, 'class', rArgs.popClassName, true);                    
+              ib.setAttrib(oLinkElement, 'onclick', "window.open('" + rArgs.popUrl + "?url=" + rArgs.popSrc + '&clTxt=' + rArgs.popTxt + "','Image', 'width=500, height=300, scrollbars=no, toolbar=no, location=no, status=no, resizable=yes, screenX=100, screenY=100'); return false;", true);
+        } else { // create new popup link   
+          var oLinkElement = ib.oEditor.contentWindow.document.createElement('A');
+          oLinkElement.href = "javascript:void(0)";
+          rArgs.popSrc  = escape(rArgs.popSrc);       
+          ib.setAttrib(oLinkElement, 'title', rArgs.popTitle, true);
+          ib.isMSIE ? ib.setAttrib(oLinkElement, 'className', rArgs.popClassName, true) : ib.setAttrib(oLinkElement, 'class', rArgs.popClassName, true);                    
+          ib.setAttrib(oLinkElement, 'onclick', "window.open('" + rArgs.popUrl + "?url=" + rArgs.popSrc + '&clTxt=' + rArgs.popTxt + "','Image', 'width=500, height=300, scrollbars=no, toolbar=no, location=no, status=no, resizable=yes, screenX=100, screenY=100'); return false;", true);
+          
+          if (ib.isMSIE) { // IE
+             if (elm.nodeName.toLowerCase() == 'span' || elm.nodeName.toLowerCase() == 'img') {               
+              if (elm.lastChild && elm.lastChild.className == 'caption') {
+                oLinkElement.innerHTML = elm.firstChild.outerHTML;
+                elm.firstChild.outerHTML = oLinkElement.outerHTML;
+              } else if (elm.nodeName.toLowerCase() == 'img') {
+                oLinkElement.innerHTML = elm.outerHTML;
+                elm.outerHTML = oLinkElement.outerHTML;
+              } else if (elm.nodeName.toLowerCase() == 'span' && elm.className == 'caption') {
+                elm = elm.previousSibling;
+                oLinkElement.innerHTML = elm.outerHTML;
+                elm.outerHTML = oLinkElement.outerHTML;
+              }
+            } else {
+              var rng = ib.oEditor.contentWindow.document.selection.createRange();
+              if (rng.text == '') {               
+                oLinkElement.innerHTML = '#';
+              } else {
+                oLinkElement.innerHTML = rng.htmlText;                
+              }
+                          rng.pasteHTML(oLinkElement.outerHTML);              
+            }
+          } else if (ib.isGecko) { // Gecko
+            var sel = ib.oEditor.contentWindow.getSelection();            
+            if (sel.rangeCount > 0 && sel.getRangeAt(0).startOffset != sel.getRangeAt(0).endOffset) {
+              oLinkElement.appendChild(sel.getRangeAt(0).cloneContents());
+            } else {              
+              oLinkElement.innerHTML = '#';
+            }        
+            ib.insertNodeAtSelection(ib.oEditor.contentWindow, oLinkElement);
+          }
+        }
+      //-------------------------------------------------------------------------
+      } else if (rArgs.action == 2) { // action set - delete popup link       
+        ib.oEditor.contentWindow.document.execCommand('Unlink');
+      }
+    }
+    return;
+    } 
+  //-------------------------------------------------------------------------
+  // set image attributes
+  iBrowser.prototype.getImgParam = function (oImageElement, wArgs) {
+    var tsrc = oImageElement.src;
+    if (tsrc.lastIndexOf('?') >= 0) { // dynamic thumbnail or random image        
+      var str = tsrc.substring(tsrc.lastIndexOf('?')+1, tsrc.length);
+      firstIndexOf    = str.indexOf('&');
+      if (tsrc.lastIndexOf('?src') >= 0) {
+        wArgs.src   = str.substring(4, firstIndexOf); // image part of src
+        wArgs.tsrc  = tsrc; // full src incl. dynamic parameters
+      } else if (tsrc.lastIndexOf('?dir') >= 0) { // random image       
+        wArgs.rsrc  = tsrc; // full url
+        wArgs.rlib  = str.substring(4,firstIndexOf); // image library for random picture
+        wArgs.rset  = str.substring(firstIndexOf, str.lenght); // random parameter string
+      }
+    } else { // regular image
+      wArgs.src = tsrc;
+    }
+    
+    wArgs.alt       = oImageElement.alt;
+    wArgs.title     = oImageElement.title;
+    if (!wArgs.rsrc) { // if not random picture
+      wArgs.width   = oImageElement.style.width  ? oImageElement.style.width  : oImageElement.width;
+      wArgs.height  = oImageElement.style.height ? oImageElement.style.height : oImageElement.height;
+    }
+    wArgs.border    = oImageElement.border;
+    wArgs.align     = oImageElement.align;
+    if (oImageElement.hspace >= 0) { // (-1 when not set under gecko for some reason)
+      wArgs.hspace    = oImageElement.attributes['hspace'].nodeValue;
+    }
+    if (oImageElement.vspace >= 0) { // // (-1 when not set under gecko for some reason)
+      wArgs.vspace    = oImageElement.attributes['vspace'].nodeValue;
+    } 
+    wArgs.className   = oImageElement.className;  
+    return wArgs;   
+  }
+  //-------------------------------------------------------------------------
+  // set popup link attributes
+  iBrowser.prototype.getLinkParam = function (oLinkElement, wArgs) {    
+    wArgs.a = oLinkElement;
+    var str = oLinkElement.getAttribute('onclick') ? oLinkElement.attributes['onclick'].value : oLinkElement.attributes['mce_onclick'].value;   
+    wArgs.popSrc = unescape(str.substring(str.indexOf('?url=')+5, str.indexOf('&'))); // popup image src      
+    wArgs.popTitle     = oLinkElement.title;
+    wArgs.popClassName = oLinkElement.className;
+    return wArgs;
+  }
+  //-------------------------------------------------------------------------
+  // set image caption
+  iBrowser.prototype.setCaption = function (elm,chkCaption, caption, captionClass) {
+    if (chkCaption == 1) { // set caption
+      var doc = ib.oEditor.contentWindow.document;
+      if (elm.nextSibling && elm.nextSibling.className == 'caption') { // existing caption
+        var capDiv = elm.parentNode;
+        var newtext = elm.nextSibling.firstChild.nodeValue.replace(elm.nextSibling.firstChild.nodeValue, caption);        // change caption text
+        ib.isMSIE ? ib.setAttrib(capDiv, 'className', captionClass, true) : ib.setAttrib(capDiv, 'class', captionClass, true);  // change class
+        elm.nextSibling.firstChild.nodeValue = newtext;
+      } else { // new caption         
+        var capDiv = doc.createElement('span');
+        var capText = doc.createElement('span');
+        capText.appendChild(doc.createTextNode(caption));
+        if (ib.isMSIE) { // IE
+          ib.setAttrib(capDiv, 'className', captionClass, true);  // set class for caption container
+          ib.setAttrib(capText, 'className', 'caption', true);  // set class for caption text
+          capDiv.innerHTML = elm.outerHTML;
+          capDiv.appendChild(capText);  
+          elm.outerHTML = capDiv.outerHTML;
+        } else if (ib.isGecko) { // Gecko
+          ib.setAttrib(capDiv, 'class', captionClass, true);    // set class for caption container
+          ib.setAttrib(capText, 'class', 'caption', true);    // set class for caption text 
+          var sel = ib.oEditor.contentWindow.getSelection();            
+          capDiv.appendChild(capText);
+          capDiv.insertBefore(elm,capDiv.firstChild);
+          ib.insertNodeAtSelection(ib.oEditor.contentWindow, capDiv);
+        }
+      }
+    } else { // no caption set - if caption, remove it        
+      if (elm.nextSibling && elm.nextSibling.className == 'caption') {                                        
+        var parent = elm.parentNode;                                
+        parent.parentNode.replaceChild(elm, elm.parentNode);                                
+      };
+    }
+  }
+  //-------------------------------------------------------------------------
+  // check if caption
+  iBrowser.prototype.isCaption = function (elm) {
+    if (elm && elm.className == 'caption') {
+      return true;
+    }
+    return false;
+  }
+  //-------------------------------------------------------------------------
+  // get selected element (focus element)
+  iBrowser.prototype.getSelectedElement = function () {   
+    if (ib.isMSIE) {
+      var sel = ib.oEditor.contentWindow.document.selection;
+      var rng = sel.createRange();    
+      if (sel.type != 'Control') {
+        return rng.parentElement();
+      } else {
+        return rng(0);    
+      }
+    } else if (ib.isGecko) {
+      var elm = null;
+      var sel = ib.oEditor.contentWindow.getSelection();    
+      if (sel && sel.rangeCount > 0) {
+        var rng = sel.getRangeAt(0);
+        elm = rng.startContainer;
+        if (elm.nodeType != 1) {
+          elm = elm.parentNode;
+        }
+      }
+      return elm;
+    }
+  }
+  //-------------------------------------------------------------------------
+  // get element by attribute value
+  iBrowser.prototype.getElementByAttributeValue = function (node, element_name, attrib, value) {
+    var elements = ib.getElementsByAttributeValue(node, element_name, attrib, value);
+    if (elements.length == 0) {
+      return null;
+    }
+    return elements[0];
+  };
+  //-------------------------------------------------------------------------
+  // get elements by attribute value
+  iBrowser.prototype.getElementsByAttributeValue = function (node, element_name, attrib, value) {
+    var elements = new Array();
+    if (node && node.nodeName.toLowerCase() == element_name) {
+      if (node.getAttribute(attrib) && node.getAttribute(attrib).indexOf(value) != -1) {
+        elements[elements.length] = node;
+      }
+    }
+  
+    if (node.hasChildNodes) {
+      for (var x=0, n=node.childNodes.length; x<n; x++) {
+        var childElements = ib.getElementsByAttributeValue(node.childNodes[x], element_name, attrib, value);
+        for (var i=0, m=childElements.length; i<m; i++) {
+          elements[elements.length] = childElements[i];
+        }
+      }
+    }
+    return elements;
+  };
+  //-------------------------------------------------------------------------
+  // set attributes
+  iBrowser.prototype.setAttrib = function (element, name, value, fixval) {
+    if (!fixval && value != null) {
+      var re = new RegExp('[^0-9%]', 'g');
+      value = value.replace(re, '');
+    }
+    if (value != null && value != '') {
+      element.setAttribute(name, value);
+    } else {
+      element.removeAttribute(name);
+    }
+  }
+  //-------------------------------------------------------------------------
+  // insert node at selection
+  iBrowser.prototype.insertNodeAtSelection = function (win, insertNode) { // Gecko      
+    var sel   = win.getSelection(); // get current selection
+      var range = sel.getRangeAt(0); // get the first range of the selection -(there's almost always only one range)
+    sel.removeAllRanges(); // deselect everything
+    range.deleteContents(); // remove content of current selection from document
+      var container = range.startContainer; // get location of current selection
+      var pos = range.startOffset;
+    range   = document.createRange(); // make a new range for the new selection
+  
+    if (container.nodeType == 3 && insertNode.nodeType == 3) {  
+      container.insertData(pos, insertNode.nodeValue); // if we insert text in a textnode, do optimized insertion
+      range.setEnd(container, pos+insertNode.length); // put cursor after inserted text
+      range.setStart(container, pos+insertNode.length); 
+    } else {  
+      var afterNode;
+      if (container.nodeType == 3 ) { // text node
+          // when inserting into a textnode, we create 2 new textnodes and put the insertNode in between
+        var textNode   = container;
+        container      = textNode.parentNode;
+        var text       = textNode.nodeValue;
+        var textBefore = text.substr(0,pos); // text before the split
+        var textAfter  = text.substr(pos); // text after the split
+        var beforeNode = document.createTextNode(textBefore);
+        var afterNode  = document.createTextNode(textAfter);
+          
+        container.insertBefore(afterNode, textNode); // insert the 3 new nodes before the old one
+        container.insertBefore(insertNode, afterNode);
+        container.insertBefore(beforeNode, insertNode);
+        container.removeChild(textNode); // remove the old node
+  
+      } else {  
+        afterNode = container.childNodes[pos]; // else simply insert the node
+        container.insertBefore(insertNode, afterNode);
+      }
+  
+      range.setEnd(afterNode, 0);
+      range.setStart(afterNode, 0);
+    }
+        sel.addRange(range);
+        win.getSelection().removeAllRanges(); // remove all ranges
+  }
+  //------------------------------------------------------------------------- 
+  // get next sibling element by name
+  iBrowser.prototype.getNextSiblingByName = function (node, name) {
+    while ((node = node.nextSibling) != null) {
+      if (node.nodeName.toLowerCase() == name) {
+        return node;
+      }
+    }
+    return null;
+  }
+  //------------------------------------------------------------------------- 
+  // get child element by name
+  iBrowser.prototype.getChildByName = function (node, name) {
+    var nodes = node.childNodes;
+    for (var i=0; i<nodes.length; i++) {
+      if (nodes[i].nodeName.toLowerCase() == name) {
+        return nodes[i];
+      }
+    }
+    return null;
+  }
+  //------------------------------------------------------------------------- 
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/cs.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/cs.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/cs.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,184 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser - language file: Czech
+  // Translated by Tomas Vaverka (Pche)
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.1                   Date: 17/02/2006
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  // pouzita znakova sada
+  $lang_charset = 'utf-8';
+  // text direction for the current language to be used in dialogs
+  // smer textu v danem jazyce
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+  
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (  
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Image browser',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'V&#237;tejte',
+    'im_005' => 'Vlo&#382;it',
+    'im_006' => 'Storno',
+    'im_007' => 'Vlo&#382;it',    
+    'im_008' => 'Vlo&#382;it/Zm&#283;nit',
+    'im_009' => 'Vlastnosti',
+    'im_010' => 'Vlastnosti obr&#225;zku',
+    'im_013' => 'Vyskakovac&#237; okna',
+    'im_014' => 'Obr&#225;zek ve vyskakovac&#237;m okn&#283;',
+    'im_015' => 'O programu',
+    'im_016' => 'Sekce',
+    'im_097' => 'Chvilku strpen&#237;, nahr&#225;v&#225;m...',
+    'im_098' => 'Otev&#345;&#237;t sekci',
+    'im_099' => 'Zav&#345;&#237;t sekci',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in  
+    'in_001' => 'Vlo&#382;it/Zm&#283;nit obr&#225;zek',
+    'in_002' => 'Knihovna',
+    'in_003' => 'Vyberte knihovnu obr&#225;zk&#367;',
+    'in_004' => 'Obr&#225;zky',
+    'in_005' => 'N&#225;hled',
+    'in_006' => 'Smazat obr&#225;zek',
+    'in_007' => 'Klikn&#283;te pro zv&#283;t&#353;en&#237; obr&#225;zku',
+    'in_008' => 'Otev&#345;&#237;t upload obr&#225;zku, p&#345;ejmenov&#225;n&#237;, nebo smaz&#225;n&#237; sekce', 
+    'in_009' => 'Informace',
+    'in_010' => 'Vyskakovac&#237; okno',    
+    'in_013' => 'Vytvo&#345;en&#237; odkazu na obr&#225;zek otv&#237;ran&#253; v nov&#233;m okn&#283;.',
+    'in_014' => 'Odstranit odkaz na vyskakovac&#237; okno', 
+    'in_015' => 'Soubor', 
+    'in_016' => 'P&#345;ejmenovat',
+    'in_017' => 'P&#345;ejmenovat obr&#225;zek',
+    'in_018' => 'Upload',
+    'in_019' => 'Uploadovat obr&#225;zek',  
+    'in_020' => 'Velikost(i)',
+    'in_021' => 'Za&#353;krtn&#283;te po&#382;adovan&#233; velikosti pro upload obr&#225;zk&#367;',
+    'in_022' => 'Origin&#225;l',
+    'in_023' => 'Obr&#225;zek bude o&#345;&#237;znut',
+    'in_024' => 'Smazat',
+    'in_025' => 'Adres&#225;&#345;',
+    'in_026' => 'Klikn&#283;te pro vytvo&#345;en&#237; adres&#225;&#345;e',
+    'in_027' => 'Vytvo&#345;it adres&#225;&#345;',
+    'in_028' => '&#352;&#237;&#345;ka',
+    'in_029' => 'V&#253;&#353;ka',
+    'in_030' => 'Typ',
+    'in_031' => 'Velikost',
+    'in_032' => 'Jm&#233;no',
+    'in_033' => 'Vytvo&#345;eno',
+    'in_034' => 'Zm&#283;n&#283;no',
+    'in_035' => 'Informace o obr&#225;zku',
+    'in_036' => 'Klikn&#283;te na obr&#225;zek pro zav&#345;en&#237; okna',
+    'in_037' => 'Oto&#269;it',
+    'in_038' => 'Automatick&#233; oto&#269;en&#237;: nastavit na EXIF informace, pro pou&#382;it&#237; EXIF orientace ulo&#382;en&#233; fotoapar&#225;tem. Tak&#233; m&#367;&#382;e b&#253;t nastaveno na +180&deg; nebo -180&deg; pro obr&#225;zek na &#353;&#237;&#345;ku, nebo +90&deg; nebo -90&deg; pro obr&#225;zek na v&#253;&#353;ku. Kladn&#233; hodnoty pro posun ve sm&#283;ru hodinov&#253;ch ru&#269;i&#269;ek, z&#225;porn&#233; proti sm&#283;ru.',
+    'in_041' => '',
+    'in_042' => '&#382;&#225;dn&#253;',   
+    'in_043' => 'na v&#253;&#353;ku',
+    'in_044' => '+ 90&deg;',  
+    'in_045' => '- 90&deg;',
+    'in_046' => 'na &#353;&#237;&#345;ku',  
+    'in_047' => '+ 180&deg;', 
+    'in_048' => '- 180&deg;',
+    'in_049' => 'fotoapar&#225;t',  
+    'in_050' => 'exif informace',
+    'in_051' => 'POZOR: Tento obr&#225;zek je dynamick&#253; n&#225;hled vytvo&#345;en&#253; iManagerem - parametry budou ztraceny p&#345;i zm&#283;n&#283; obr&#225;zku.',
+    'in_052' => 'Klikn&#283;te pro zm&#283;nu n&#225;hledu vybran&#233;ho obr&#225;zku',
+    'in_053' => 'N&#225;hodn&#283;',
+    'in_054' => 'Je-li za&#353;krtnuto, bude vybr&#225;n n&#225;hodn&#253; obr&#225;zek',
+    'in_055' => 'Za&#353;krtn&#283;te pro vlo&#382;en&#237; n&#225;hodn&#233;ho obr&#225;zku',
+    'in_056' => 'Parametry',
+    'in_057' => 'klikn&#283;te pro nastaven&#237; parametr&#367; na v&#253;choz&#237;',
+    'in_099' => 'v&#253;choz&#237;',  
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Vlastnosti obr&#225;zku',
+    'at_002' => 'Zdroj',
+    'at_003' => 'Titulek',
+    'at_004' => 'TITLE - titulek obr&#225;zku, zobraz&#237; se po p&#345;ejet&#237; my&#353;&#237; nad obr&#225;zek',
+    'at_005' => 'Popis',
+    'at_006' => 'ALT -  alternativn&#237; text obr&#225;zku, zobraz&#237; se p&#345;i nena&#269;ten&#237; obr&#225;zku',
+    'at_007' => 'Styl',
+    'at_008' => 'Ujist&#283;te se, &#382;e zadan&#253; styl existuje ve va&#353;i definici styl&#367;.',
+    'at_009' => 'CSS-styl', 
+    'at_010' => 'Atributy',
+    'at_011' => 'Atributy \'align\', \'border\', \'hspace\', and \'vspace\' elementu IMAGE nejsou podporov&#225;ny v XHTML 1.0 Strict DTD. Pou&#382;ijte m&#237;sto toho CSS styly.',
+    'at_012' => 'Zarovn&#225;n&#237;',  
+    'at_013' => 'v&#253;choz&#237;',
+    'at_014' => 'vlevo',
+    'at_015' => 'vpravo',
+    'at_016' => 'nahoru',
+    'at_017' => 'doprost&#345;ed',
+    'at_018' => 'dol&#367;',
+    'at_019' => 'st&#345;ed obr&#225;zku zarovnan&#253; se st&#345;edem textu',
+    'at_020' => 'vr&#353;ek obr&#225;zku zarovnan&#253; s vr&#353;kem textu',
+    'at_021' => '&#250;&#269;a&#345;&#237;',    
+    'at_022' => 'Velikost',
+    'at_023' => '&#352;&#237;&#345;ka',
+    'at_024' => 'V&#253;&#353;ka',
+    'at_025' => 'R&#225;me&#269;ek',
+    'at_026' => 'V-odsazen&#237;',
+    'at_027' => 'H-odsazen&#237;',
+    'at_028' => 'N&#225;hled',  
+    'at_029' => 'Klikn&#283;te pro vlo&#382;en&#237; speci&#225;ln&#237;ch znak&#367; do pole titulku',
+    'at_030' => 'Klikn&#283;te pro vlo&#382;en&#237; speci&#225;ln&#237;ch znak&#367; do pole popisu',
+    'at_031' => 'Nastavit v&#253;choz&#237; rozm&#283;ry obr&#225;zku',
+    'at_032' => 'Z&#225;hlav&#237;',
+    'at_033' => 'za&#353;krtnuto: nastavit z&#225;hlav&#237; obr&#225;zku / neza&#353;krtnuto: bez z&#225;hlav&#237; nebo zru&#353;en&#237; z&#225;hlav&#237;',
+    'at_034' => 'nastavit z&#225;hlav&#237; obr&#225;zku',
+    'at_099' => 'v&#253;choz&#237;',  
+    //-------------------------------------------------------------------------   
+    // error messages - er
+    'er_001' => 'Chyba',
+    'er_002' => 'Nen&#237; vybr&#225;n obr&#225;zek!',
+    'er_003' => '&#352;&#237;&#345;ka nen&#237; &#269;&#237;slo',
+    'er_004' => 'V&#253;&#353;ka nen&#237; &#269;&#237;slo',
+    'er_005' => 'R&#225;me&#269;ek nen&#237; &#269;&#237;slo',
+    'er_006' => 'Horizont&#225;ln&#237; odsazen&#237; nen&#237; &#269;&#237;slo',
+    'er_007' => 'Vertik&#225;ln&#237; odsazen&#237; nen&#237; &#269;&#237;slo',
+    'er_008' => 'Klikn&#283;te na OK pro smaz&#225;n&#237; obr&#225;zku',
+    'er_009' => 'P&#345;ejmenov&#225;n&#237; n&#225;hled&#367; nen&#237; povoleno! P&#345;ejmenujte obr&#225;zek, chcete-li p&#345;ejmenovat jeho n&#225;hled.',
+    'er_010' => 'Klikn&#283;te na OK pro p&#345;ejmenov&#225;n&#237; obr&#225;zku na',
+    'er_011' => 'Nov&#233; jm&#233;no je pr&#225;zdn&#233;, nebo nebylo zm&#283;n&#283;no!',
+    'er_014' => 'Zadejte nov&#233; jm&#233;no souboru!',
+    'er_015' => 'Zadejte validn&#237; jm&#233;no souboru!',
+    'er_016' => 'N&#225;hled nen&#237; k dispozivi! Pro zapnut&#237; n&#225;hled&#367; nastavte velikost n&#225;hled&#367; v konfigura&#269;n&#237;m souboru.',
+    'er_021' => 'Klikn&#283;te na OK pro upload obr&#225;zku.',
+    'er_022' => 'Upload obr&#225;zku - pros&#237;m vydr&#382;te...',
+    'er_023' => 'Nebyl vybr&#225;n &#382;&#225;dn&#253; obr&#225;zek, nebo nebyl ozna&#269;en &#382;&#225;dn&#253; soubor.',
+    'er_024' => 'Soubor',
+    'er_025' => 'u&#382; existuje! Klikn&#283;te na OK pro p&#345;eps&#225;n&#237;...',
+    'er_026' => 'Zadejte nov&#233; jm&#233;no souboru!',
+    'er_027' => 'Adres&#225;r fyzicky neexistuje',
+    'er_028' => 'Do&#353;lo k chyb&#283; p&#345;i obsluze uploadu souboru. Zkuste to pros&#237;m znovu.',
+    'er_029' => '&#352;patn&#253; typ obrazov&#233;ho souboru',
+    'er_030' => 'Maz&#225;n&#237; selhalo! Zkuste to pros&#237;m znovu.',
+    'er_031' => 'P&#345;epsat',
+    'er_032' => 'N&#225;hled skute&#269;n&#233; velikosti funguje jen pro obr&#225;zky v&#283;t&#353;&#237;ch rozm&#283;r&#367; jako okno n&#225;hledu',
+    'er_033' => 'P&#345;ejmenov&#225;n&#237; souboru selhalo! Zkuste to pros&#237;m znovu.',
+    'er_034' => 'Vytvo&#345;en&#237; adres&#225;&#345;e selhalo! Zkuste to pros&#237;m znovu.',
+    'er_035' => 'Zv&#283;t&#353;en&#237; nen&#237; podporov&#225;no!',
+    'er_036' => 'Chyba p&#345;i vytv&#225;&#345;en&#237; seznamu obr&#225;zk&#367;!',
+    ),    
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Symboly',
+    'ok'      => 'OK',
+    'cancel'    => 'Storno',
+    ),    
+  )
+?>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/da.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/da.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/da.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,182 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser
+  // ================================================
+  // iBrowser - language file: English
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.1                   Date: 05/25/2005
+  // ================================================
+
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  $lang_charset = 'iso-8859-1';
+  // text direction for the current language to be used in dialogs
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Billed browser',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'Velkommen',
+    'im_005' => 'Indsæt',
+    'im_006' => 'Afbryd',
+    'im_007' => 'Indsæt',
+    'im_008' => 'Indsæt/rediger',
+    'im_009' => 'Egenskaber',
+    'im_010' => 'Billed egenskaber',
+    'im_013' => 'Popup',
+    'im_014' => 'Billed popup',
+    'im_015' => 'Om iBrowser',
+    'im_016' => 'Afsnit',
+    'im_097' => 'Please wait while loading...',
+    'im_098' => 'Åben afsnit',
+    'im_099' => 'Luk afsnit',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in
+    'in_001' => 'Indsæt/rediger billede',
+    'in_002' => 'Mapper',
+    'in_003' => 'Vælg en billed mappe',
+    'in_004' => 'Billeder',
+    'in_005' => 'Preview',
+    'in_006' => 'Slet billede',
+    'in_007' => 'Klik for større billede',
+    'in_008' => 'Åben billed upload, omdøb, eller slet sektion',
+    'in_009' => 'Information',
+    'in_010' => 'Popup',
+    'in_013' => 'Opret et link således billedet åbnes i et ny vindue.',
+    'in_014' => 'Fjern popup link',
+    'in_015' => 'File',
+    'in_016' => 'Omdøb',
+    'in_017' => 'Omdøb billede',
+    'in_018' => 'Upload',
+    'in_019' => 'Upload billede',
+    'in_020' => 'Størrelse(r)',
+    'in_021' => 'Marker den ønskede størrelse(r) som billed(er) skal uploadesi',
+    'in_022' => 'Original',
+    'in_023' => 'Billedet vil blive beskåret',
+    'in_024' => 'Slet',
+    'in_025' => 'Folder',
+    'in_026' => 'Klik for at oprette en ny mappe',
+    'in_027' => 'Opret en mappe',
+    'in_028' => 'Brede',
+    'in_029' => 'Højde',
+    'in_030' => 'Type',
+    'in_031' => 'Størrelse',
+    'in_032' => 'Navn',
+    'in_033' => 'Oprettet',
+    'in_034' => 'Ændret',
+    'in_035' => 'Billed info',
+    'in_036' => 'Klik på billedet for at lukke vinduet',
+    'in_037' => 'Roter',
+    'in_038' => 'Auto roter: sat til exif info, for at bruge EXIF orientering 
+gemt af kamera. Kan også sættes til +180&grader; eller -180&grader; for 
+landskab, eller +90&grader; eller -90&grader; for portræt. Positive værdier 
+for med-uret og negative værdier for mod-uret.',
+    'in_041' => '',
+    'in_042' => 'intet',
+    'in_043' => 'portræt',
+    'in_044' => '+ 90&grader;',
+    'in_045' => '- 90&grader;',
+    'in_046' => 'landskab',
+    'in_047' => '+ 180&grader;',
+    'in_048' => '- 180&grader;',
+    'in_049' => 'Kamera',
+    'in_050' => 'exif info',
+    'in_051' => 'ADVARSEL: Følgende billede er et dynamisk thumbnail oprettet 
+af iManager - parameterne vil gå tabet hvis billedet ændres.',
+    'in_052' => 'Switch image selection view',
+    'in_099' => 'grundindstilling',
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Billed egenskaber',
+    'at_002' => 'Kilde',
+    'at_003' => 'Titel',
+    'at_004' => 'TITEL - Viser billed beskrivelse ved mouse-over',
+    'at_005' => 'Beskrivelse',
+    'at_006' => 'ALT -  tekst udskiftning for billede, til fremvisning eller 
+istedet for billedet',
+    'at_007' => 'Style',
+    'at_008' => 'Check venligst at den valgte style findes i dit stylesheet!',
+    'at_009' => 'CSS-style',
+    'at_010' => 'Indstillinger',
+    'at_011' => 'På række\', \'Border\', \'H-afstand\', og \'V-afstand\' 
+indstillinger for billede er ikke understøttet i XHTML 1.0 Kun DTD. Brug 
+CSS-style istedet for.',
+    'at_012' => 'På række',
+    'at_013' => 'Grundindstilling',
+    'at_014' => 'Venstre',
+    'at_015' => 'Højre',
+    'at_016' => 'Top',
+    'at_017' => 'Midt i',
+    'at_018' => 'Bund',
+    'at_019' => 'absolut-midt',
+    'at_020' => 'tekst-top',
+    'at_021' => 'grundlinie',
+    'at_022' => 'Størrelse',
+    'at_023' => 'Brede',
+    'at_024' => 'Højde',
+    'at_025' => 'Border',
+    'at_026' => 'V-afstand',
+    'at_027' => 'H-afstand',
+    'at_028' => 'Preview',
+    'at_029' => 'Klik for at indsætte speciale karaktere ind i titel feltet',
+    'at_030' => 'Klik for at indsætte speciale karaktere ind i beskrivelses 
+feltet',
+    'at_031' => 'Nulstil billed dimensioner til forud valgte værdier',
+    'at_099' => 'Grundindstillingt',
+    //-------------------------------------------------------------------------
+    // error messages - er
+    'er_001' => 'Fejl',
+    'er_002' => 'Der er ikke valgt noget billede !',
+    'er_003' => 'Brede er ikke et tal',
+    'er_004' => 'Højde er ikke et tal',
+    'er_005' => 'Border er ikke et tal',
+    'er_006' => 'Horisontal afstand er ikke et tal',
+    'er_007' => 'Vertikal afstand er ikke et tal',
+    'er_008' => 'Klik OK for at slette billedet',
+    'er_009' => 'Omdøbning af Miniature er ikke tilladt! Omdøb original billedet, hvis du vil have nyt navn for Miniature billedet.',
+    'er_010' => 'Klik OK for at omdøbe billedet til',
+    'er_011' => 'Nyt navn er enten tomt eller ikke ændret!',
+    'er_014' => 'Indsæt nyt file navn!',
+    'er_015' => 'Indsæt venligst korrekt navn!',
+    'er_016' => 'Miniature er ikke tilgængelig! Sæt Miniature størrelsen i config filen.',
+    'er_021' => 'Klik OK for at uploade billede(r) .',
+    'er_022' => 'Uploader billede - Vent venligst...',
+    'er_023' => 'Der er ikke valgt noget billede eller file størrelsen er markeret.',
+    'er_024' => 'File',
+    'er_025' => 'Eksistere allerede! Klik OK for at overskrive filen...',
+    'er_026' => 'Indsæt nyt file navn!',
+    'er_027' => 'Mappen eksistere ikke',
+    'er_028' => 'Der opstod en fejl under oploadning af filen. Prøv igen.',
+    'er_029' => 'Forkert billed file type',
+    'er_030' => 'Fejl ved sletning! Prøv igen.',
+    'er_031' => 'Overskriv',
+    'er_032' => 'Fuld størrelse preview virker kun for billeder større end preview størrelsen',
+    'er_033' => 'Fejl ved omdøbning af file! Prøv igen.',
+    'er_034' => 'Fejl ved oprettelse af mappe! Prøv igen.',
+    'er_035' => 'Forstørrelse er ikke tilladt!',
+    'er_036' => 'Fejl ved opbygning af billed liste!',
+    ),
+    
+//-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Symbols',
+    'ok'      => 'OK',
+    'cancel'    => 'Fortryd',
+    ),
+  )
+?>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/de.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/de.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/de.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+// German lang variables
+tinyMCE.addToLang('ibrowser', {
+title: 'Bild hinzuf&uuml;gen/&auml;ndern',
+desc:  'iBrowser'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/de.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/de.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/de.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,181 @@
+<?php
+  // ================================================
+  // PHP Bild browser - iBrowser 
+  // ================================================
+  // iBrowser - language file: German
+  // ================================================
+  // Developed: baumedia.net
+  // Copyright: baumedia.net
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.1                   Date: 09/08/2005
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  $lang_charset = 'iso-8859-1';
+  // text direction for the current language to be used in dialogs
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+  
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (  
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Bild browser',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'Willkommen',
+    'im_005' => 'Einf&uuml;gen',
+    'im_006' => 'Abbrechen',
+    'im_007' => 'Einf&uuml;gen',    
+    'im_008' => 'Einf&uuml;gen/&auml;ndern',
+    'im_009' => 'Attribute',
+    'im_010' => 'Bild Attribute',
+    'im_013' => 'Popup',
+    'im_014' => 'Bild PopUp',
+    'im_015' => '&Uuml;ber iBrowser',
+    'im_016' => 'Abschnitt',
+    'im_097' => 'Bitte warten...',
+    'im_098' => 'Abschnitt &ouml;ffnen',
+    'im_099' => 'Abschnitt schlie&szlig;en',
+    //-------------------------------------------------------------------------
+    // Einf&uuml;gen/change screen - in 
+    'in_001' => 'Einf&uuml;gen/Bild &auml;ndern',
+    'in_002' => 'Ordner',
+    'in_003' => 'Ordner ausw&auml;hlen',
+    'in_004' => 'Bilder',
+    'in_005' => 'Vorschau',
+    'in_006' => 'Bild l&ouml;schen',
+    'in_007' => 'F&uuml;r Gro&szlig;ansicht klicken',
+    'in_008' => 'Bild hochladen, l&ouml;schen oder umbenennen', 
+    'in_009' => 'Information',
+    'in_010' => 'Popup',    
+    'in_013' => 'Erstellt einen Link zu einem im PopUp ge&ouml;ffneten Bild',
+    'in_014' => 'PopUp Link entfernen', 
+    'in_015' => 'Datei',  
+    'in_016' => 'Umbenennen',
+    'in_017' => 'Bild umbenennen',
+    'in_018' => 'Upload',
+    'in_019' => 'Bild Upload',  
+    'in_020' => 'Gr&ouml;&szlig;e',
+    'in_021' => 'Gew&uuml;nschte Gr&ouml;&szlig;e',
+    'in_022' => 'Original',
+    'in_023' => 'Bild wird beschnitten',
+    'in_024' => 'L&ouml;schen',
+    'in_025' => 'Ordner',
+    'in_026' => 'Ordner erstellen',
+    'in_027' => 'Ordner erstellen',
+    'in_028' => 'Breite',
+    'in_029' => 'H&ouml;he',
+    'in_030' => 'Typ',
+    'in_031' => 'Gr&ouml;&szlig;e',
+    'in_032' => 'Name',
+    'in_033' => 'erstellt am',
+    'in_034' => 'ge&auml;ndert am',
+    'in_035' => 'Bild Info',
+    'in_036' => 'Zum schlie&szlig;en auf das Bild klicken',
+    'in_037' => 'Drehen',
+    'in_038' => 'Automatisches Drehen: benutzt die exif Informationen der Kamera. +180&deg; oder -180&deg; f&uuml;r Querformat setzen, +90&deg; oder -90&deg; f&uuml;r Hochformat. Positive Werte drehen im Uhrzeigersinn, negative entgegen.',
+    'in_041' => '',
+    'in_042' => 'nichts',   
+    'in_043' => 'Hochformat',
+    'in_044' => '+ 90&deg;',  
+    'in_045' => '- 90&deg;',
+    'in_046' => 'Querformat', 
+    'in_047' => '+ 180&deg;', 
+    'in_048' => '- 180&deg;',
+    'in_049' => 'Kamera', 
+    'in_050' => 'EXIF Info',
+    'in_051' => 'ACHTUNG: Das Bild ist ein dynamisch vom iManager generiertes Thumbnail - Einstellungen gehen bei Bildver&auml;nderungen verloren.',
+    'in_052' => 'Bildansicht &auml;ndern',
+    'in_053' => 'Zufall',
+    'in_054' => 'Zuf&auml;lliges Bild einf&uuml;gen',
+    'in_055' => 'Zuf&auml;lliges Bild einf&uuml;gen',
+    'in_056' => 'Parameter',
+    'in_057' => 'Standardeinstellungen herstellen',
+    'in_099' => 'Standardeinstellungen',  
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Bild Attribute',
+    'at_002' => 'Quelle',
+    'at_003' => 'Titel',
+    'at_004' => 'Bildtitel - wird bei MouseOver angezeigt',
+    'at_005' => 'Beschreibung',
+    'at_006' => 'ALT-Tag des Bilds',
+    'at_007' => 'Stil',
+    'at_008' => 'Der eingestellte Stil muss im Stylesheet vorhanden sein.',
+    'at_009' => 'CSS-Stil', 
+    'at_010' => 'Attribute',
+    'at_011' => 'Die \'align\', \'border\', \'hspace\', and \'vspace\' Eigenschaften werden vom XHTML 1.0 Strict DTD nicht unterst&uuml;tzt. Bitte die CSS-Stile statt dessen verwenden',
+    'at_012' => 'Ausrichtung',  
+    'at_013' => 'Standard',
+    'at_014' => 'Links',
+    'at_015' => 'Rechts',
+    'at_016' => 'Oben',
+    'at_017' => 'Mittig',
+    'at_018' => 'Unten',
+    'at_019' => 'Absolut mittig',
+    'at_020' => 'Oben b&uuml;ndig',
+    'at_021' => 'Grundlinie',   
+    'at_022' => 'Gr&ouml;&szlig;e',
+    'at_023' => 'Breite',
+    'at_024' => 'H&ouml;he',
+    'at_025' => 'Rahmen',
+    'at_026' => 'V-Abstand',
+    'at_027' => 'H-Abstand',
+    'at_028' => 'Vorschau', 
+    'at_029' => 'Sonderzeichen einf&uuml;gen',
+    'at_030' => 'Sonderzeichen einf&uuml;gen',
+    'at_031' => 'Bildgr&ouml;&szlig;e wiederherstellen',
+    'at_032' => 'Bildbeschreibung',
+    'at_033' => 'Bildbeschreibung anzeigen.',
+    'at_034' => 'Bildbeschreibung anzeigen.',
+    'at_099' => 'Standard', 
+    //-------------------------------------------------------------------------   
+    // error messages - er
+    'er_001' => 'Fehler',
+    'er_002' => 'Kein Bild ausgew&auml;hlt!',
+    'er_003' => 'Breite ist keine Zahl',
+    'er_004' => 'H&ouml;he ist keine Zahl',
+    'er_005' => 'Rahmengr&ouml;&szlig;e ist keine Zahl',
+    'er_006' => 'H-Abstand muss Zahl sein',
+    'er_007' => 'V-Abstand muss Zahl sein',
+    'er_008' => 'Mit "OK" l&ouml;schen best&auml;tigen',
+    'er_009' => 'Umbenennen der Thumbnails ist nicht m&ouml;glich! Bitte nennen Sie das Hauptbild um, wenn Sie das Thumbnail umbenennen wollen',
+    'er_010' => 'Mit "OK" Bild umbenennen!',
+    'er_011' => 'Der neue Name ist entweder leer oder nicht ge&auml;ndert!',
+    'er_014' => 'Bitte neuen Dateinamen eingeben!',
+    'er_015' => 'Bitte g&uuml;ltigen Dateinamen eingeben!',
+    'er_016' => 'Thumbnailing ist nicht aktiviert! Um Thumbnails zu erstellen, m&uuml;ssen Sie die Konfiguration anpassen.',
+    'er_021' => 'Mit "OK" Bilder uploaden!',
+    'er_022' => 'Bild wird hochgeladen - bitte warten...',
+    'er_023' => 'Entweder kein Bild ausgew&auml;hlt oder Dateigr&ouml;&szlig;e wurde nicht erfasst.',
+    'er_024' => 'Datei',
+    'er_025' => 'Datei existiert - "OK" dr&uuml;cken zum &uuml;berschreiben',
+    'er_026' => 'Neuen Dateinamen eingeben!',
+    'er_027' => 'Ordner nicht vorhanden',
+    'er_028' => 'Es ist ein Fehler w&auml;hrend des Uploadvorganges aufgetreten. Bitte versuchen Sie es noch einmal.',
+    'er_029' => 'Falscher Dateityp',
+    'er_030' => 'L&ouml;schen fehlgeschlagen - Bitte noch einmal versuchen.',
+    'er_031' => '&Uuml;berschreiben',
+    'er_032' => 'Bilder k&ouml;nnen nur in Gro&szlig;ansicht angezeigt werden, wenn Sie gr&ouml;&szlig;er als die Vorschau sind.',
+    'er_033' => 'Umbenennen fehlgeschlagen - bitte noch einmal versuchen!',
+    'er_034' => 'Ordner anlegen fehlgeschlagen - bitte noch einmal versuchen!',
+    'er_035' => 'Vergr&ouml;&szlig;ern ist nicht erlaubt!',
+    'er_036' => 'Fehler bei der Dateianzeige!',
+    ),    
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Symbole',
+    'ok'      => 'OK',
+    'cancel'    => 'Abbrechen',
+    ),    
+  )
+?>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+// English lang variables
+tinyMCE.addToLang('ibrowser', {
+title: 'Add/edit image',
+desc:  'iBrowser'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/en.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/en.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/en.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,181 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser - language file: English
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.1                   Date: 07/07/2005
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  $lang_charset = 'iso-8859-1';
+  // text direction for the current language to be used in dialogs
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+  
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (  
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Image browser',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'Welcome',
+    'im_005' => 'Insert',
+    'im_006' => 'Cancel',
+    'im_007' => 'Insert',   
+    'im_008' => 'Insert/change',
+    'im_009' => 'Properties',
+    'im_010' => 'Image properties',
+    'im_013' => 'Popup',
+    'im_014' => 'Image popup',
+    'im_015' => 'About iBrowser',
+    'im_016' => 'Section',
+    'im_097' => 'Please wait while loading...',
+    'im_098' => 'Open section',
+    'im_099' => 'Close section',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in  
+    'in_001' => 'Insert/Change image',
+    'in_002' => 'Library',
+    'in_003' => 'Select an image library',
+    'in_004' => 'Images',
+    'in_005' => 'Preview',
+    'in_006' => 'Delete image',
+    'in_007' => 'Click for a larger view of picture',
+    'in_008' => 'Open the image upload, rename, or delete section', 
+    'in_009' => 'Information',
+    'in_010' => 'Popup',    
+    'in_013' => 'Create a link to an image to be opened in a new window.',
+    'in_014' => 'remove popup link',  
+    'in_015' => 'File', 
+    'in_016' => 'Rename',
+    'in_017' => 'Rename image',
+    'in_018' => 'Upload',
+    'in_019' => 'Upload image', 
+    'in_020' => 'Size(s)',
+    'in_021' => 'Check the desired size(s) to be created while uploading image(s)',
+    'in_022' => 'Original',
+    'in_023' => 'Image will be cropped',
+    'in_024' => 'Delete',
+    'in_025' => 'Directory',
+    'in_026' => 'Click to create a directory',
+    'in_027' => 'Create a directory',
+    'in_028' => 'Width',
+    'in_029' => 'Height',
+    'in_030' => 'Type',
+    'in_031' => 'Size',
+    'in_032' => 'Name',
+    'in_033' => 'Created',
+    'in_034' => 'Modified',
+    'in_035' => 'Image info',
+    'in_036' => 'Click on image to close window',
+    'in_037' => 'Rotate',
+    'in_038' => 'Auto rotate: set to exif info, to use EXIF orientation stored by camera. Can also be set to +180&deg; or -180&deg; for landscape, or +90&deg; or -90&deg; for portrait. Positive values for clockwise and negative values for counterclockwise.',
+    'in_041' => '',
+    'in_042' => 'none',   
+    'in_043' => 'portrait',
+    'in_044' => '+ 90&deg;',  
+    'in_045' => '- 90&deg;',
+    'in_046' => 'landscape',  
+    'in_047' => '+ 180&deg;', 
+    'in_048' => '- 180&deg;',
+    'in_049' => 'camera', 
+    'in_050' => 'exif info',
+    'in_051' => 'WARNING: Current image is a dynamic thumbnail created by iManager - parameters will be lost on image change.',
+    'in_052' => 'Click to switch image selection view',
+    'in_053' => 'Random',
+    'in_054' => 'If checked, random image will be inserted',
+    'in_055' => 'Check to insert random image',
+    'in_056' => 'Parameters',
+    'in_057' => 'click to reset parameters to default values',
+    'in_099' => 'default',  
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Image attributes',
+    'at_002' => 'Source',
+    'at_003' => 'Title',
+    'at_004' => 'TITLE - displays image description onmouseover',
+    'at_005' => 'Description',
+    'at_006' => 'ALT -  textual replacement for the image, to be displayed or otherwise used in place of the image',
+    'at_007' => 'Style',
+    'at_008' => 'Please make sure that the selected style exists in your stylesheet!',
+    'at_009' => 'CSS-style',  
+    'at_010' => 'Attributes',
+    'at_011' => 'The \'align\', \'border\', \'hspace\', and \'vspace\' attributes of the image element are not supported in XHTML 1.0 Strict DTD. Please use the CSS-style instead.',
+    'at_012' => 'Align',  
+    'at_013' => 'default',
+    'at_014' => 'left',
+    'at_015' => 'right',
+    'at_016' => 'top',
+    'at_017' => 'middle',
+    'at_018' => 'bottom',
+    'at_019' => 'absmiddle',
+    'at_020' => 'texttop',
+    'at_021' => 'baseline',   
+    'at_022' => 'Size',
+    'at_023' => 'Width',
+    'at_024' => 'Height',
+    'at_025' => 'Border',
+    'at_026' => 'V-space',
+    'at_027' => 'H-space',
+    'at_028' => 'Preview',  
+    'at_029' => 'Click to enter special character into title field',
+    'at_030' => 'Click to enter special character into description field',
+    'at_031' => 'Reset image dimensions to default values',
+    'at_032' => 'Caption',
+    'at_033' => 'checked: set image caption / unchecked: no image caption set or remove image caption',
+    'at_034' => 'set image caption',
+    'at_099' => 'default',  
+    //-------------------------------------------------------------------------   
+    // error messages - er
+    'er_001' => 'Error',
+    'er_002' => 'No image is selected!',
+    'er_003' => 'Width is not a number',
+    'er_004' => 'Height is not a number',
+    'er_005' => 'Border is not a number',
+    'er_006' => 'Horizontal space is not a number',
+    'er_007' => 'Vertical space is not a number',
+    'er_008' => 'Click OK to delete the image',
+    'er_009' => 'Renaming of thumbnails is not allowed! Please rename the main image if you like to rename the thumbnail image.',
+    'er_010' => 'Click OK to rename image to',
+    'er_011' => 'New name is either empty or has not changed!',
+    'er_014' => 'Please enter new file name!',
+    'er_015' => 'Please enter valid file name!',
+    'er_016' => 'Thumbnailing not available! Please set thumbnail size in config file in order to enable thumbnailing.',
+    'er_021' => 'Click OK to upload image(s).',
+    'er_022' => 'Uploading image - please wait...',
+    'er_023' => 'No image has been selected or no file size has been checked.',
+    'er_024' => 'File',
+    'er_025' => 'already exists! Please click OK to overwrite file...',
+    'er_026' => 'Please enter new file name!',
+    'er_027' => 'Directory doesn\'t physically exist',
+    'er_028' => 'An error occured while handling file upload. Please try again.',
+    'er_029' => 'Wrong image file type',
+    'er_030' => 'Delete failed! Please try again.',
+    'er_031' => 'Overwrite',
+    'er_032' => 'Full size preview only works for pictures larger than the preview size',
+    'er_033' => 'Renaming file failed! Please try again.',
+    'er_034' => 'Creating directory failed! Please try again.',
+    'er_035' => 'Enlarging is not allowed!',
+    'er_036' => 'Error building image list!',
+    ),    
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Symbols',
+    'ok'      => 'OK',
+    'cancel'    => 'Cancel',
+    ),    
+  )
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/es.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/es.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/es.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,184 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser - language file: Spanish
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.3                   Date: 08/08/2005
+  // Contributor: Diego de Lucas
+  //        diegodelucas at gmail.com
+  //        www.dlgsoftware.net
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  $lang_charset = 'iso-8859-1';
+  // text direction for the current language to be used in dialogs
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+  
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (  
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Navegador de im&aacute;genes',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Men&uacute;',
+    'im_004' => 'Bienvenido',
+    'im_005' => 'Insertar',
+    'im_006' => 'Cancelar',
+    'im_007' => 'Insertar',   
+    'im_008' => 'Insertar/Cambiar',
+    'im_009' => 'Propiedades',
+    'im_010' => 'Propiedades de la imagen',
+    'im_013' => 'Emergente',
+    'im_014' => 'Imagen emergente',
+    'im_015' => 'Acerca de iBrowser',
+    'im_016' => 'Secci&oacute;n',
+    'im_097' => 'Cargando... Espere...',
+    'im_098' => 'Abrir secci&oacute;n',
+    'im_099' => 'Cerrar secci&oacute;n',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in  
+    'in_001' => 'Insertar/Cambiar imagen',
+    'in_002' => 'Librer&iacute;a/Directorio',
+    'in_003' => 'Selecciona una librer&iacute;a o directorio',
+    'in_004' => 'Im&aacute;genes',
+    'in_005' => 'Vista previa',
+    'in_006' => 'Borrar imagen',
+    'in_007' => 'Click para ampliar la imagen',
+    'in_008' => 'Abre la secci&oacute;n de subir, renombrar o borrar imagen', 
+    'in_009' => 'Informaci&oacute;n',
+    'in_010' => 'Emergente',    
+    'in_013' => 'Crea un enlace a una imagen para ser abierto en una ventana nueva.',
+    'in_014' => 'Elimina enlace emergente', 
+    'in_015' => 'Archivo',  
+    'in_016' => 'Renombrar',
+    'in_017' => 'Renombrar imagen',
+    'in_018' => 'Subir',
+    'in_019' => 'Subir imagen', 
+    'in_020' => 'Tama&ntilde;o(s)',
+    'in_021' => 'Marcar tama&ntilde;o(s) deseado(s) para ser creados mientras se sube(n) la(s) imagen(es)',
+    'in_022' => 'Original',
+    'in_023' => 'La imagen ser&aacute; ajustada en ambas dimensiones',
+    'in_024' => 'Borrar',
+    'in_025' => 'Directorio',
+    'in_026' => 'Click OK para crear el directorio',
+    'in_027' => 'Crear directorio',
+    'in_028' => 'Ancho',
+    'in_029' => 'Alto',
+    'in_030' => 'Tipo',
+    'in_031' => 'Tama&ntilde;o',
+    'in_032' => 'Nombre',
+    'in_033' => 'Creado',
+    'in_034' => 'Modificado',
+    'in_035' => 'Informaci&oacute;n de la imagen',
+    'in_036' => 'Click en la imagen para cerrar la ventana',
+    'in_037' => 'Rotar',
+    'in_038' => 'Auto rotar: seleccionar \'exif info\', para usar la orientaci&oacute;n EXIF almacenada por la c&aacute;mara. Tambi&eacute;n puede seleccionar +180&deg; o -180&deg; para paisaje, o +90&deg; o -90&deg; para retrato. Los valores positivos en sentido de las agujas del reloj, y los negativos en sentido contrario.',
+    'in_041' => '',
+    'in_042' => 'none',   
+    'in_043' => 'retrato',
+    'in_044' => '+ 90&deg;',  
+    'in_045' => '- 90&deg;',
+    'in_046' => 'paisaje',  
+    'in_047' => '+ 180&deg;', 
+    'in_048' => '- 180&deg;',
+    'in_049' => 'c&aacute;mara',  
+    'in_050' => 'exif info',
+    'in_051' => 'ATENCI&Oacute;N: la imagen actual es una imagen en miniatura din&aacute;mica creada con iManager - los par&aacute;metros se perder&aacute;n al cambiar de imagen.',
+    'in_052' => 'Click para cambiar la vista de selecci&oacute;n de imagen',
+    'in_053' => 'Aleatorio',
+    'in_054' => 'Si se marca, se insertar&aacute; una imagen aleatoriamente',
+    'in_055' => 'Marcar para insertar una imagen aleatoriamente',
+    'in_056' => 'Par&aacute;metros',
+    'in_057' => 'Click para inicializar los par&aacute;metros a sus valores por defecto',
+    'in_099' => 'por defecto',  
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Atributos de la imagen',
+    'at_002' => 'Fuente',
+    'at_003' => 'T&iacute;tulo',
+    'at_004' => 'TITLE - muestra la descripci&oacute;n de la imagen cuando situamos el rat&oacute;n encima de &eacute;sta',
+    'at_005' => 'Descripci&oacute;n',
+    'at_006' => 'ALT - reemplazo textual de la imagen, para ser mostrado o usado en lugar de la imagen',
+    'at_007' => 'Estilo',
+    'at_008' => 'Asegurese de que el estilo seleccionado existe en la hoja de estilos',
+    'at_009' => 'Estilo CSS', 
+    'at_010' => 'Atributos',
+    'at_011' => 'Los atributos \'align\', \'border\', \'hspace\', y \'vspace\' de un elemento imagen no son soportados en XHTML 1.0 Strict DTD. Use estilos CSS en su lugar.',
+    'at_012' => 'Alineado', 
+    'at_013' => 'por defecto',
+    'at_014' => 'izquierda',
+    'at_015' => 'derecha',
+    'at_016' => 'arriba',
+    'at_017' => 'medio',
+    'at_018' => 'abajo',
+    'at_019' => 'absmiddle',    
+    'at_020' => 'texttop',
+    'at_021' => 'baseline',   
+    'at_022' => 'Tama&ntilde;o',
+    'at_023' => 'Ancho',
+    'at_024' => 'Alto',
+    'at_025' => 'Borde',
+    'at_026' => 'Espaciado vert.',
+    'at_027' => 'Espaciado horiz.',
+    'at_028' => 'Vista previa', 
+    'at_029' => 'Click para insertar un car&aacute;cter especial en el campo de t&iacute;tulo',
+    'at_030' => 'Click para insertar un car&aacute;cter especial en el campo de descripci&oacute;n',
+    'at_031' => 'Ajusta las dimensiones de la imagen a los valores por defecto',
+    'at_032' => 'Subt&iacute;tulo',
+    'at_033' => 'Marcado: Pone subt&iacute;tulo a la imagen / Desmarcado: imagen sin subt&iacute;tulo o borra el subt&iacute;tulo de la imagen',
+    'at_034' => 'Fija el subt&iacute;tulo de la imagen',
+    'at_099' => 'por defecto',  
+    //-------------------------------------------------------------------------   
+    // error messages - er
+    'er_001' => 'Error',
+    'er_002' => 'No se ha seleccionado una imagen!',
+    'er_003' => 'El ancho no es un n&uacute;mero',
+    'er_004' => 'El alto no es un n&uacute;mero',
+    'er_005' => 'El borde no es un n&uacute;mero',
+    'er_006' => 'El espaciado horizontal no es un n&uacute;mero',
+    'er_007' => 'El espaciado vertical no es un n&uacute;mero',
+    'er_008' => 'Click OK para borrar la imagen',
+    'er_009' => 'El renombrado de las im&aacute;genes en miniatura no est&aacute; permitido! Renombre la imagen principal si quiere renombrar la imagen en miniatura.',
+    'er_010' => 'Click OK para renombrar la imagen a',
+    'er_011' => 'El nuevo nombre está vacío o no ha cambiado!',
+    'er_014' => 'Introduzca un nuevo nombre para el archivo!',
+    'er_015' => 'Introduzca un nombre v&aacute;lido!',
+    'er_016' => 'La creaci&oacute;n de im&aacute;genes en miniatura no est&aacute; habilitada! Fije el tama&ntilde;o de las miniaturas en el fichero de configuraci&oacute;n para habilitarlo.',
+    'er_021' => 'Click OK para subir la(s) imagen(es).',
+    'er_022' => 'Subiendo imagen - por favor, espere...',
+    'er_023' => 'No ha seleccionado una imagen o no ha marcado un tamaño.',
+    'er_024' => 'El archivo',
+    'er_025' => 'ya existe! Click OK para sobreescribir el archivo...',
+    'er_026' => 'Introduzca un nuevo nombre de archivo!',
+    'er_027' => 'El directorio no existe físicamente',
+    'er_028' => 'Ha ocurrido un error mientras se sub&iacute;a el archivo. Int&eacute;ntelo de nuevo.',
+    'er_029' => 'Tipo de archivo de imagen incorrecto',
+    'er_030' => 'El borrado ha fallado! Int&eacute;ntelo de nuevo.',
+    'er_031' => 'Sobreescribir',
+    'er_032' => 'La vista previa a tamaño completo sólo funciona para imágenes mayores que el tamaño de la previsualización',
+    'er_033' => 'El renombrado del archivo ha fallado! Int&eacute;ntelo de nuevo.',
+    'er_034' => 'La creaci&oacute;n del directorio ha fallado! Int&eacute;ntelo de nuevo.',
+    'er_035' => 'El agrandamiento no está  permitido!',
+    'er_036' => 'Error creando la lista de im&aacute;genes!',
+    ),    
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Símbolos',
+    'ok'      => 'OK',
+    'cancel'    => 'Cancelar',
+    ),    
+  )
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/fr.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/fr.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/fr.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+// French lang variables
+tinyMCE.addToLang('ibrowser', {
+title: 'Ajouter/modifier image',
+desc:  'iBrowser'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/fr.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/fr.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/fr.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,182 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser
+  // ================================================
+  // iBrowser - language file: French
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.2                   Date: 07/05/2006
+    // Contributor     Simon BILLETTE (simon at billette.fr)
+  // ================================================
+
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  $lang_charset = 'iso-8859-1';
+  // text direction for the current language to be used in dialogs
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Image browser',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'Bienvenue',
+    'im_005' => 'Insérer',
+    'im_006' => 'Annuler',
+    'im_007' => 'Insérer',
+    'im_008' => 'Insérer/Changer',
+    'im_009' => 'Propriétés',
+    'im_010' => 'Propriétés de l\\\'image',
+    'im_013' => 'Popup',
+    'im_014' => 'Image en popup',
+    'im_015' => 'A propos de iBrowser',
+    'im_016' => 'Section',
+    'im_097' => 'Chargement en cours...',
+    'im_098' => 'Ouvrir la section',
+    'im_099' => 'Fermer la section',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in
+    'in_001' => 'Insérer/Changer une image',
+    'in_002' => 'Librairie',
+    'in_003' => 'Selectionner une image de la librairie',
+    'in_004' => 'Images',
+    'in_005' => 'Preview',
+    'in_006' => 'Supprimer cette image',
+    'in_007' => 'Cliquer pour voir cette image en taille réelle',
+    'in_008' => 'Ouvrir la section de mise en ligne, de renommage et de suppression des images',
+    'in_009' => 'Information',
+    'in_010' => 'Popup',
+    'in_013' => 'Créer une lien vers cette image pour l\'ouvrir dans une nouvelle fenêtre.',
+    'in_014' => 'supprimer le lien popup',
+    'in_015' => 'Fichier',
+    'in_016' => 'Renommer',
+    'in_017' => 'Renommer cette image',
+    'in_018' => 'Uploader',
+    'in_019' => 'Uploader une image',
+    'in_020' => 'Taille(s)',
+    'in_021' => 'Cocher la ou les taille(s) désirée(s) pendant l\'upload de l\'image.',
+    'in_022' => 'Original',
+    'in_023' => 'Cette image sera découppée',
+    'in_024' => 'Supprimer',
+    'in_025' => 'Répertoire',
+    'in_026' => 'Cliquer pour créer un répertoire',
+    'in_027' => 'Créer un répertoire',
+    'in_028' => 'Largeur',
+    'in_029' => 'Hauteur',
+    'in_030' => 'Type',
+    'in_031' => 'Taille',
+    'in_032' => 'Nom',
+    'in_033' => 'Créée',
+    'in_034' => 'Modifiée',
+    'in_035' => 'Info image',
+    'in_036' => 'Cliquer sur cette image pour fermer la fenêtre',
+    'in_037' => 'Pivoter',
+    'in_038' => 'Autorotation: en fonction des informations exif fournies par l\'appareil photo. Peut aussi être fixé à +180&deg; ou -180&deg; pour l\'afichage paysage, ou +90&deg; ou -90&deg; pour l\'affiche portrait. Les valeurs seront positives pour le sens des aiguilles d\'une montre et négatives pour le sens contraire des aiguilles d\'une montre.',
+    'in_041' => '',
+    'in_042' => 'aucun',
+    'in_043' => 'portrait',
+    'in_044' => '+ 90&deg;',
+    'in_045' => '- 90&deg;',
+    'in_046' => 'paysage',
+    'in_047' => '+ 180&deg;',
+    'in_048' => '- 180&deg;',
+    'in_049' => 'camera',
+    'in_050' => 'info exif',
+    'in_051' => 'AVERTISSEMENT: Cette image est une vignette dynamique créée par iBrowser - Les paramètres seront perdus lors de la modification de cette image.',
+    'in_052' => 'Cliquer pour basculer la vue des images',
+    'in_053' => 'Aléatoire',
+    'in_054' => 'Si coché, une image aléatoirement choisie sera insérée',
+    'in_055' => 'Cocher pour insérer une image aléatoire',
+    'in_056' => 'Paramètres',
+    'in_057' => 'cliquer pour réinitialiser les paramètres à leurs valeurs d\'origine',
+    'in_099' => 'défaut',
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Attributs de cette image',
+    'at_002' => 'Source',
+    'at_003' => 'Titre',
+    'at_004' => 'TITRE - affiche la description de cette image en onmouseover',
+    'at_005' => 'Description',
+    'at_006' => 'ALT -  texte de remplacement pour cette image, il sera affiché à la place de l\'image si celle-ci n\'apparait pas',
+    'at_007' => 'Style',
+    'at_008' => 'Veuillez vérifier que le style sélectionné existe dans votre feuille de style !',
+    'at_009' => 'Style CSS',
+    'at_010' => 'Attributs',
+    'at_011' => 'Les attributs \'align\', \'border\', \'hspace\', et \'vspace\' ne sont pas supportés pour les images en XHTML 1.0 Strict DTD. Veuillez plutôt utiliser les propriétés CSS.',
+    'at_012' => 'Alignement',
+    'at_013' => 'par défaut',
+    'at_014' => 'gauche',
+    'at_015' => 'droite',
+    'at_016' => 'haut',
+    'at_017' => 'milieu',
+    'at_018' => 'bas',
+    'at_019' => 'bas absolu',
+    'at_020' => 'texttop',
+    'at_021' => 'baseline',
+    'at_022' => 'Taille',
+    'at_023' => 'Largeur',
+    'at_024' => 'Hauteur',
+    'at_025' => 'Bordure',
+    'at_026' => 'V-space',
+    'at_027' => 'H-space',
+    'at_028' => 'Preview',
+    'at_029' => 'Cliquer pour entrer des caractères spéciaux dans le champs titre',
+    'at_030' => 'Cliquer pour entrer des caractères spéciaux dans le champs description',
+    'at_031' => 'Réinitialiser les dimensions à leures valeurs initiales',
+    'at_032' => 'Sous Titre',
+    'at_033' => 'coché: définir le sous-titre de l\'image / décoché: aucun sous-titre pour l\'image défini ou suppression du sous-titre',
+    'at_034' => 'définir le sous-titre de l\'image',
+    'at_099' => 'par défaut',
+    //-------------------------------------------------------------------------
+    // error messages - er
+    'er_001' => 'Erreur',
+    'er_002' => 'Aucune image sélectionnée!',
+    'er_003' => 'La largeur n\'est pas un nombre',
+    'er_004' => 'La hauteur n\'est pas un nombre',
+    'er_005' => 'La bordure n\'est pas un nombre',
+    'er_006' => 'L\'espace horizontal n\'est pas un nombre',
+    'er_007' => 'L\'espace vertical n\'est pas un nombre',
+    'er_008' => 'Cliquer sur OK pour supprimer l\\\'image',
+    'er_009' => 'Le renommage des vignettes n\'est pas autorisé! Veuillez renommer l\'image originale si vous souhaitez renommer la vignette.',
+    'er_010' => 'Cliquer sur OK pour renommer l\\\'image en',
+    'er_011' => 'Le nouveau nom est vide ou n\\\'a pas changé!',
+    'er_014' => 'Veuillez entrer un nouveau nom de fichier!',
+    'er_015' => 'Veuillez entre un nom de fichier valide!',
+    'er_016' => 'Vignette non disponible! Veuillez spécifier la taille des vignettes dans le fichier de configuration pour activer la fonctionnalité.',
+    'er_021' => 'Cliquer sur OK pour uploader la ou les image(s).',
+    'er_022' => 'Upload de l\'image en cours - veuillez patienter ...',
+    'er_023' => 'Aucune image n\\\'a été sélectionnée ou aucune taille de fichier n\\\'a été cochée.',
+    'er_024' => 'Fichier',
+    'er_025' => 'existe déjà! Veuiller cliquer sur OK pour remplacer le fichier ...',
+    'er_026' => 'Veuillez entrer le nouveau nom de fichier!',
+    'er_027' => 'Le répertoire n\'existe pas physiquement!',
+    'er_028' => 'Une erreur a été rencontrée lors de l\'upload du fichier. Veuillez recommencer.',
+    'er_029' => 'Mauvais type d\'image',
+    'er_030' => 'Echec de la suppression! Veuillez recommencer.',
+    'er_031' => 'Remplacer',
+    'er_032' => 'La visualisation en taille réelle ne fonctionne que pour les images dont la taille est supérieure à celle de la vignette',
+    'er_033' => 'Echec du renommage du fichier! Veuillez recommencer.',
+    'er_034' => 'Echec de la création du répertoire! Veuillez recommencer.',
+    'er_035' => 'Augmenter la taille n\\\'est pas autorisé!',
+    'er_036' => 'Erreur lors de la création de la liste d\'image(s)!',
+    ),
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Symbols',
+    'ok'      => 'OK',
+    'cancel'    => 'Annuler',
+    ),
+  )
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+header('Location: /');
+exit;
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/it.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/it.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/it.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,181 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser - language file: Italian
+  // ================================================
+  // Developed: Luca Aru
+  // Copyright: Luca Aru
+  // License: GPL - see license.txt
+  // (c)2006 All rights reserved.
+  // ================================================
+  // Revision: 1.0                 Date: 31/01/2006
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  $lang_charset = 'iso-8859-1';
+  // text direction for the current language to be used in dialogs
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+  
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (  
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Image browser',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'Benvenuto',
+    'im_005' => 'Inserisci',
+    'im_006' => 'Elimina',
+    'im_007' => 'Inserisci',    
+    'im_008' => 'Inserisci/cambia',
+    'im_009' => 'Propriet&agrave;',
+    'im_010' => 'Propriet&agrave; dell&#39;immagine',
+    'im_013' => 'Popup',
+    'im_014' => 'Immagine popup',
+    'im_015' => 'Informazioni su iBrowser',
+    'im_016' => 'Sezione',
+    'im_097' => 'Caricamento in corso, attendere...',
+    'im_098' => 'Apri sezione',
+    'im_099' => 'Chiudi sezione',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in  
+    'in_001' => 'Inserisci/Cambia immagine',
+    'in_002' => 'Libreria',
+    'in_003' => 'Scegli una libreria di immagini',
+    'in_004' => 'Immagini',
+    'in_005' => 'Anteprima',
+    'in_006' => 'Elimina immagini',
+    'in_007' => 'Clicca per ingrandire l&#39;immagine',
+    'in_008' => 'Apri la sezione di caricamento, eliminazione e modifica del nome dell&#39;immagine', 
+    'in_009' => 'Informazione',
+    'in_010' => 'Popup',    
+    'in_013' => 'Crea un link a un&#39;immagine che sar&agrave; aperto in una nuova finestra.',
+    'in_014' => 'rimuovi il link popup',  
+    'in_015' => 'File', 
+    'in_016' => 'Rinomina',
+    'in_017' => 'Rinomina immagine',
+    'in_018' => 'Carica',
+    'in_019' => 'Carica immagine',  
+    'in_020' => 'Dimensione/i',
+    'in_021' => 'Seleziona le dimensioni che verranno create mentre carichi le immmagini',
+    'in_022' => 'Originale',
+    'in_023' => 'L&#39;immagine verr&agrave; troncata',
+    'in_024' => 'Elimina',
+    'in_025' => 'Directory',
+    'in_026' => 'Clicca per creare una directory',
+    'in_027' => 'Crea una directory',
+    'in_028' => 'Larghezza',
+    'in_029' => 'Altezza',
+    'in_030' => 'Tipo',
+    'in_031' => 'Dimensione',
+    'in_032' => 'Nome',
+    'in_033' => 'Creata',
+    'in_034' => 'Modificata',
+    'in_035' => 'Informazioni sull&#39;immagine',
+    'in_036' => 'Clicca sull&#39;immagine per chiudere la finestra',
+    'in_037' => 'Ruota',
+    'in_038' => 'Ruota automaticamente: imposta su &#39;exif info&#39; per utilizzare l&#39;orientazione EXIF memorizzata dalla fotocamera. Puoi anche impostare +180&deg; o -180&deg; per foto panoramica, o +90&deg; o -90&deg; per ritratto (Valori positivi ruotano l&#39;immagine in senso orario, valori negativi in senso antiorario).',
+    'in_041' => '',
+    'in_042' => 'nessuna',    
+    'in_043' => 'ritratto',
+    'in_044' => '+ 90&deg;',  
+    'in_045' => '- 90&deg;',
+    'in_046' => 'panorama', 
+    'in_047' => '+ 180&deg;', 
+    'in_048' => '- 180&deg;',
+    'in_049' => 'camera', 
+    'in_050' => 'info exif',
+    'in_051' => 'ATTENZIONE: L&#39;immagine corrente &egrave; una miniatura creata da iManager - i parametri saranno persi al cambio di immagine.',
+    'in_052' => 'Clicca per passare alla &#39;vista immagine&#39;',
+    'in_053' => 'Casuale',
+    'in_054' => 'Se spuntato, verr&agrave inserita un&#39;immagine casuale',
+    'in_055' => 'Spunta per inserire un&#39;immagine casuale',
+    'in_056' => 'Parametri',
+    'in_057' => 'clicca per reimpostare i parametri ai valori di default',
+    'in_099' => 'default',  
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Attributi dell&#39;immagine',
+    'at_002' => 'Sorgente',
+    'at_003' => 'Titolo',
+    'at_004' => 'TITLE - mostra una descrizione dell&#39;immagine al passaggio del mouse',
+    'at_005' => 'Descrizione',
+    'at_006' => 'ALT -  Alternativa testuale per l&#39;immagine,sar&agrave; mostrata o utilizzata al posto dell&#39;immagine',
+    'at_007' => 'Stile',
+    'at_008' => 'Verifica che lo stile scelto esista nel tuo foglio di stile!',
+    'at_009' => 'CSS-stile',  
+    'at_010' => 'Attributi',
+    'at_011' => 'Gli attributi &#39;align&#39;, &#39;border&#39;, &#39;hspace&#39;, and &#39;vspace&#39; dell&#39;elemento non sono supportati in XHTML 1.0 Strict DTD. Usa i CSS al posto di questi attributi',
+    'at_012' => 'Allineamento', 
+    'at_013' => 'default',
+    'at_014' => 'sinistra',
+    'at_015' => 'destra',
+    'at_016' => 'alto',
+    'at_017' => 'mezzo',
+    'at_018' => 'basso',
+    'at_019' => 'absmiddle',
+    'at_020' => 'texttop',
+    'at_021' => 'baseline',   
+    'at_022' => 'Dimensione',
+    'at_023' => 'Larghezza',
+    'at_024' => 'Altezza',
+    'at_025' => 'Bordo',
+    'at_026' => 'V-space',
+    'at_027' => 'H-space',
+    'at_028' => 'Anteprima',  
+    'at_029' => 'Clicca per inserire un carattere speciale nel campo title',
+    'at_030' => 'Clicca per inserire un carattere speciale nel campo descrizione',
+    'at_031' => 'Riporta le dimensioni dell&#39;immagine ai valori di default',
+    'at_032' => 'Didascalia',
+    'at_033' => 'selezionato: seleziona la didascalia per l&#39;immagine&#39; / non selezionato: nessuna didascalia / rimuove la didascalia per l&#39;immagine',
+    'at_034' => ' didascalia dell&#39;immagine',
+    'at_099' => 'default',  
+    //-------------------------------------------------------------------------   
+    // error messages - er
+    'er_001' => 'Errore',
+    'er_002' => 'Nessuna immagine selezionata!',
+    'er_003' => 'Inserire un valore numerico per la larghezza!',
+    'er_004' => 'Inserire un valore numerico per l&#39;altezza!',
+    'er_005' => 'Inserire un valore numerico per il bordo!',
+    'er_006' => 'Inserire un valore numerico per H-space',
+    'er_007' => 'Inserire un valore numerico per V-Space',
+    'er_008' => 'Clicca su OK per cancellare l&#39;immagine',
+    'er_009' => 'Non &grave;  possibile rinominare le miniature. Rinomina le immagini originali se vuoi rinominare le miniature.',
+    'er_010' => 'Clicca su OK per rinominare l&#39;immagine:',
+    'er_011' => 'Il nuovo nome &egrave vuoto oppure non &egrave; stato cambiato!',
+    'er_014' => 'Inserisci un nuovo nome per il file!',
+    'er_015' => 'Inserisci un nome di file valido!',
+    'er_016' => 'Miniature non disponibili! Indica la grandezza delle miniature nel file di configurazione prima di abilitare la creazione delle miniature.',
+    'er_021' => 'Clicca OK per caricare le immagini.',
+    'er_022' => 'Caricamento immagine in corso - attendere prego...',
+    'er_023' => 'Non &grave; selezionata nessuna immagine oppure non &grave; stata indicata la dimensione del file.',
+    'er_024' => 'File',
+    'er_025' => 'esiste gi&agrave;! Clicca su OK per sovrascrivere il file...',
+    'er_026' => 'Inserisci un nuovo nome per il file!',
+    'er_027' => 'La directory non esiste',
+    'er_028' => '&Egrave; avvenuto un errore durante il caricamento del file. Riprova.',
+    'er_029' => 'Tipo di file immagine non valido',
+    'er_030' => 'Eliminazione non riuscita! Riprova.',
+    'er_031' => 'Sovrascrivi',
+    'er_032' => 'L&#39;anteprima a grandezza piena funziona solo per immagini pi&ugrave; grandi dell&#39;immagine di anteprima',
+    'er_033' => 'File non rinominato correttamente! Riprova.',
+    'er_034' => 'Creazione della directory non riuscita! Riprova.',
+    'er_035' => 'Ingrandimento dell&#39;immagine non consentito!',
+    'er_036' => 'Errore nella creazione della lista delle immagini!',
+    ),    
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Simboli',
+    'ok'      => 'OK',
+    'cancel'    => 'Elimina',
+    ),    
+  )
+?>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/lang.class.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/lang.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/lang.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+<?php
+// ================================================
+// PHP image browser - iBrowser
+// ================================================
+// iBrowser - language class
+// ================================================
+// Developed: net4visions.com
+// Copyright: net4visions.com
+// License: GPL - see readme.txt
+// (c)2005 All rights reserved.
+// ================================================
+// Revision: 1.0                   Date: 2005/04/27
+// ================================================
+
+class PLUG_Lang {
+  // current language
+  var $lang;
+  // accessors
+  function setLang( $value ) {
+    $this -> lang = $value;
+  }
+  function getLang() {
+    $this -> lang = $value;
+  }
+
+  // variable to hold current language block
+  var $block;
+  // accessors
+  function setBlock( $value ) {
+    $this -> block = $value;
+  }
+  function getBlock() {
+    return $this -> block;
+  }
+
+  // charset for the current language
+  var $charset;
+  // accessors
+  function getCharset() {
+    return $this -> charset;
+  }
+
+  // text direction for the current language
+  var $dir;
+  // accessors
+  function getDir() {
+    return $this -> dir;
+  }
+
+  // language data
+  var $lang_data;
+  // default language data
+  var $default_lang_data;
+
+  // constructor
+  function PLUG_Lang( $lang = '' ) {
+    global $cfg;
+    if ( $lang == '' ) {
+      $this -> lang = $cfg['lang'];
+    } else {
+      $this -> lang = $lang;
+    }
+    $this -> loadData();
+  }
+
+  // load language data
+  function loadData() {
+    global $cfg;
+    include( dirname(__FILE__) . '/' . $this -> lang.'.php' );
+    $this -> charset = $lang_charset;
+    $this -> dir = $lang_direction;
+    $this -> lang_data = $lang_data;
+    unset( $lang_data );
+    include( dirname(__FILE__) . '/' . $cfg['lang'].'.php' );
+    $this -> default_lang_data = $lang_data;
+  }
+
+  // return message
+  function showMessage( $message, $block = '' ) {
+    $_block = ( $block == '' ) ? $this -> block: $block;
+    if ( !empty( $this -> lang_data[ $_block][ $message ] ) ) {
+      // return message
+      return $this -> lang_data[ $_block][ $message ];
+    } else {
+      // if message is not present in current language data
+      // return message from default language
+      return ( isset( $this -> default_lang_data[ $_block][ $message ] ) ? $this -> default_lang_data[ $_block][ $message ] : '' );
+    }
+  }
+
+  // shortcut for showMessage
+  function m( $message, $block = '' ) {
+    return $this -> showMessage( $message, $block );
+  }
+
+  // sets the root point for the data
+  function setRoot( $block = '' ) {
+    // if no block passed -> reload data
+    if ( $block == '' ) {
+      $this -> loadData();
+    } else {
+      // "move pointer"
+      $this -> lang_data = $this -> lang_data[ $block ];
+      $this -> default_lang_data = $this -> default_lang_data[ $block ];
+    }
+  }
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/nl.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/nl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/nl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,173 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser - language file: Dutch
+  // ================================================
+  // Developed: Ematic Interactive
+  // Copyright: Ematic Interactive
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.0                   Date: 06/01/2005
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  $lang_charset = 'iso-8859-1';
+  // text direction for the current language to be used in dialogs
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+  
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (  
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Afbeeldingen verkenner',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'Welkom',
+    'im_005' => 'Invoegen',
+    'im_006' => 'Annuleren',
+    'im_007' => 'Invoegen',   
+    'im_008' => 'Invoegen/ wijzigen',
+    'im_009' => 'Eigenschappen',
+    'im_010' => 'Afbeelding eigenschappen',
+    'im_013' => 'Popup',
+    'im_014' => 'Afbeelding popup',
+    'im_015' => 'Over iBrowser',
+    'im_016' => 'Sectie',
+    'im_097' => 'Please wait while loading...',
+    'im_098' => 'Open sectie',
+    'im_099' => 'Sluit sectie',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in  
+    'in_001' => 'Invoegen/Wijzigen afbeelding',
+    'in_002' => 'Bibliotheek',
+    'in_003' => 'Selecteer een afbeeldingen bibliotheek',
+    'in_004' => 'Afbeeldingen',
+    'in_005' => 'Voorbeeld',
+    'in_006' => 'Verwijder afbeelding',
+    'in_007' => 'Klik voor een grotere weergave van de afbeelding',
+    'in_008' => 'Open de afbeelding uploaden, hernoemen of verwijder sectie', 
+    'in_009' => 'Informatie',
+    'in_010' => 'Popup',    
+    'in_013' => 'Creeer een link naar een afbeelding die geopend moet worden in een nieuw venster.',
+    'in_014' => 'Verwijder popup link', 
+    'in_015' => 'Bestand',  
+    'in_016' => 'Hernoemen',
+    'in_017' => 'Hernoem afbeelding',
+    'in_018' => 'Upload',
+    'in_019' => 'Upload afbeelding',  
+    'in_020' => 'Grootte(n)',
+    'in_021' => 'Controleer de gewenste afmetingen die aangemaakt moeten worden tijdens het uploaden van de afbeelding(en)',
+    'in_022' => 'Origineel',
+    'in_023' => 'Afbeelding wordt gecropped',
+    'in_024' => 'Verwijder',
+    'in_025' => 'Map',
+    'in_026' => 'Klik om een map aan te maken',
+    'in_027' => 'Maak een map',
+    'in_028' => 'Breedte',
+    'in_029' => 'Hoogte',
+    'in_030' => 'Type',
+    'in_031' => 'Grootte',
+    'in_032' => 'Naam',
+    'in_033' => 'Aangemaakt',
+    'in_034' => 'Gewijzigd',
+    'in_035' => 'Afbeelding info',
+    'in_036' => 'Klik op de afbeelding om het venster te sluiten',
+    'in_037' => 'Roteren',
+    'in_038' => 'Auto roteren: zet op exif info, om EXIF orientatie van de camera te gebruiken. Kan ook op +180&deg; of -180&deg; worden gezet voor landschap, of op +90&deg; of -90&deg; voor portret. Positieve waarden voor met de klok mee en negatieve waarden voor tegen de klok in roteren.',
+    'in_041' => '',
+    'in_042' => 'geen',
+    'in_043' => 'portret',
+    'in_044' => '+ 90&deg;',
+    'in_045' => '- 90&deg;',
+    'in_046' => 'landschap',
+    'in_047' => '+ 180&deg;',
+    'in_048' => '- 180&deg;',
+    'in_049' => 'camera',
+    'in_050' => 'exif info',    
+    'in_051' => 'WAARSCHUWING: Huidige afbeelding is een dynamische thumbnail gecreëerd door iManager - parameters zullen verloren gaan bij het wijzigen van de afbeelding.',
+    'in_052' => 'Switch image selection view',
+    'in_099' => 'standaard',  
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Afbeelding attributen',
+    'at_002' => 'Bron',
+    'at_003' => 'Titel',
+    'at_004' => 'TITEL - geeft de afbeelding mouseover weer',
+    'at_005' => 'Omschrijving',
+    'at_006' => 'ALT -  textuele vervanging voor de afbeelding, welke wordt getoond ipv de afbeelding',
+    'at_007' => 'Stijl',
+    'at_008' => 'Let op dat de geselecteerde stijl voorkomt in uw stylesheet!',
+    'at_009' => 'CSS-stijl',  
+    'at_010' => 'Attributen',
+    'at_011' => 'De \'align\', \'border\', \'hspace\', and \'vspace\' attributen van het afbeeldings element worden niet ondersteund in XHTML 1.0 Strict DTD. Gebruik hiervoor in de plaats CSS-stijl.',
+    'at_012' => 'Uitlijnen',  
+    'at_013' => 'standaard',
+    'at_014' => 'links',
+    'at_015' => 'rechts',
+    'at_016' => 'boven',
+    'at_017' => 'midden',
+    'at_018' => 'onder',
+    'at_019' => 'abs midden',
+    'at_020' => 'Tekst bovenkant',
+    'at_021' => 'basis',    
+    'at_022' => 'Afmetingen',
+    'at_023' => 'Breedte',
+    'at_024' => 'Hoogte',
+    'at_025' => 'Rand',
+    'at_026' => 'V-space',
+    'at_027' => 'H-space',
+    'at_028' => 'Voorbeeld',  
+    'at_029' => 'Klik om een speciaal karakter in het titel veld in te voegen',
+    'at_030' => 'Klik om een speciaal karakter in het omschrijving veld in te voegen',
+    'at_031' => 'Herstel naar de originele afbeeldings dimensies',
+    'at_099' => 'standaard',  
+    //-------------------------------------------------------------------------   
+    // error messages - er
+    'er_001' => 'Fout',
+    'er_002' => 'Geen afbeelding geselecteerd!',
+    'er_003' => 'Breedte is geen getal',
+    'er_004' => 'Hoogte is geen getal',
+    'er_005' => 'Rand is geen getal',
+    'er_006' => 'Horizontale spatiering is geen getal',
+    'er_007' => 'Vertikale spatiering is geen getal',
+    'er_008' => 'Klik op OK om de afbeelding te verwijderen',
+    'er_009' => 'Hernoemen van thumbnails is niet toegestaan! Hernoem de originele afbeelding om de thumbnail te hernoemen.',
+    'er_010' => 'Klik op OK om de afbeelding te hernoemen naar',
+    'er_011' => 'De nieuwe naam is of leeg of is niet gewijzigd!',
+    'er_014' => 'Geef een nieuwe bestandsnaam op!',
+    'er_015' => 'Geef een geldige bestandsnaam op!',
+    'er_016' => 'Creeren van thumbnails is niet aanwezig! Zet de thumbnail afmetingen in het configuratie bestand file om het aanmaken van thumbnails te activeren.',
+    'er_021' => 'Klik op OK om de afbeelding(en) te uploaden.',
+    'er_022' => 'Afbeelding uploaden - even geduld...',
+    'er_023' => 'Er is geen afbeelding geselecteerd of er is geen afmetingen aangevinkt.',
+    'er_024' => 'Bestand',
+    'er_025' => 'bestaat reeds! Klik op OK om het bestand te overschrijven...',
+    'er_026' => 'Geef een nieuwe bestandsnaam!',
+    'er_027' => 'Folder bestaat niet fysiek',
+    'er_028' => 'Er is een fout opgetreden tijdens het uploaden. Probeer het opnieuw.',
+    'er_029' => 'Verkeerde afbeeldings bestandstype',
+    'er_030' => 'Verwijderen is niet gelukt! Probeer het opnieuw.',
+    'er_031' => 'Overschrijven',
+    'er_032' => 'Volledige afmetingen voorbeeldweergave werkt alleen met afbeeldingen die groter zijn dan de preview afmetingen',
+    'er_033' => 'Hernoemen van bestand is niet gelukt! Probeer het opnieuw.',
+    'er_034' => 'Folder aanmaken is niet gelukt! Probeer het opnieuw.',
+    'er_035' => 'Vergroten is niet toegestaan!',
+    'er_036' => 'Fout tijdens het bouwen van de afbeeldingenlijst!',
+    ),    
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Symbolen',
+    'ok'      => 'OK',
+    'cancel'    => 'Annuleren',
+    ),    
+  )
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/pl.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/pl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/pl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,181 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser - language file: Polish
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.1                   Date: 10/21/2005
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  $lang_charset = 'utf-8';
+  // text direction for the current language to be used in dialogs
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+  
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (  
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Przegl&#261;darka obraz&#243;w',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'Witaj',
+    'im_005' => 'Wstaw',
+    'im_006' => 'Rezygnuj',
+    'im_007' => 'Wstaw',    
+    'im_008' => 'Wstaw/zamie&#324;',
+    'im_009' => 'W&#322;a&#347;ciwo&#347;ci',
+    'im_010' => 'W&#322;a&#347;ciwo&#347;ci obrazu',
+    'im_013' => 'Wyskakuj&#261;ce okno',
+    'im_014' => 'Wyskakuj&#261;cy obraz',
+    'im_015' => 'O iBrowser',
+    'im_016' => 'Sekcja',
+    'im_097' => 'Prosz&#281; czeka&#263;, trwa &#322;&#261;dowanie...',
+    'im_098' => 'Otw&#243;rz sekcj&#281;',
+    'im_099' => 'Zamknij sekcj&#281;',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in  
+    'in_001' => 'Wstaw/zamie&#324; obraz',
+    'in_002' => 'Biblioteka',
+    'in_003' => 'Wybierz bibliotek&#281; obraz&#243;w',
+    'in_004' => 'Obrazy',
+    'in_005' => 'Podgl&#261;d',
+    'in_006' => 'Usu&#324; obraz',
+    'in_007' => 'Kliknij aby powi&#281;kszy&#263;',
+    'in_008' => 'Sekcja &#322;adowania, zmiany nazwy i kasowania obraz&#243;w', 
+    'in_009' => 'Informacja',
+    'in_010' => 'Wyskakuj&#261;ce okno',    
+    'in_013' => 'Stw&#243;rz link do obrazu otwieraj&#261;cego si&#281; w nowym oknie',
+    'in_014' => 'Usu&#324; link do wyskakuj&#261;cego okna',  
+    'in_015' => 'Plik', 
+    'in_016' => 'Zmie&#324; nazw&#281;',
+    'in_017' => 'Zmie&#324; nazw&#281; obrazu',
+    'in_018' => 'Za&#322;aduj',
+    'in_019' => 'Za&#322;aduj obraz', 
+    'in_020' => 'Rozmiar',
+    'in_021' => 'Zaznacz oczekiwany rozmiar &#322;adowanego obrazu',
+    'in_022' => 'Orygina&#322;',
+    'in_023' => 'Obraz zostanie przyci&#281;ty',
+    'in_024' => 'Usu&#324;',
+    'in_025' => 'Folder',
+    'in_026' => 'Kliknij aby stworzy&#263; folder',
+    'in_027' => 'Stw&#243;rz folder',
+    'in_028' => 'Szeroko&#347;&#263;',
+    'in_029' => 'Wysoko&#347;&#263;',
+    'in_030' => 'Typ',
+    'in_031' => 'Rozmiar',
+    'in_032' => 'Nazwa',
+    'in_033' => 'Stworzony',
+    'in_034' => 'Zmodyfikowany',
+    'in_035' => 'Informacja o obrazie',
+    'in_036' => 'Kliknij w obraz aby zamkn&#261;&#263; okno',
+    'in_037' => 'Rotacja',
+    'in_038' => 'Auto-rotacja: ustaw exif info, aby korzysta&#263; z informacji EXIF z aparatu cyfrowego. Mo&#380;na r&#243;wnie&#380; ustawi&#263; obr&#243;t +180&#176; lub -180&#176; dla pejza&#380;u i +90&#176; lub -90&#176; dla portretu. Positive values for clockwise and negative values for counterclockwise.',
+    'in_041' => '',
+    'in_042' => 'brak',   
+    'in_043' => 'portret',
+    'in_044' => '+ 90&#176;', 
+    'in_045' => '- 90&#176;',
+    'in_046' => 'pejza&#380;',  
+    'in_047' => '+ 180&#176;',  
+    'in_048' => '- 180&#176;',
+    'in_049' => 'aparat', 
+    'in_050' => 'exif info',
+    'in_051' => 'UWAGA: Bie&#380;&#261;cy obraz jest dynamiczn&#261; miniatur&#261; stworzon&#261; przez iManager - parametry zostan&#261; zagubione podczas modyfikacji obrazu.',
+    'in_052' => 'Kliknij aby zmieni&#263; widok selekcji obrazu',
+    'in_053' => 'Losowo',
+    'in_054' => 'Zaznaczenie pola spowoduje wstawienie losowego obrazu',
+    'in_055' => 'Zaznacz aby wstawi&#263; losowy obraz',
+    'in_056' => 'Parametry',
+    'in_057' => 'kliknij aby zresetowa&#263; warto&#347;ci',
+    'in_099' => 'standardowa',  
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Atrybuty obrazu',
+    'at_002' => '&#346;cie&#380;ka',
+    'at_003' => 'Tytu&#322;',
+    'at_004' => 'TITLE - opis obrazu pojawiaj&#261;cy si&#281; po najechaniu mysz&#261;',
+    'at_005' => 'Opis',
+    'at_006' => 'ALT - tekst alternatywny wy&#347;wietlany w zast&#281;pstwie obrazu',
+    'at_007' => 'Styl',
+    'at_008' => 'Prosz&#281; si&#281; upewni&#263;, &#380;e styl istnieje w arkuszu styl&#243;w!',
+    'at_009' => 'Styl CSS', 
+    'at_010' => 'Atrybuty',
+    'at_011' => 'Atrybuty \'align\', \'border\', \'hspace\', i \'vspace\' definiowane dla obrazu nie s&#261; wspierane w XHTML 1.0 Strict DTD. Prosz&#281; u&#380;ywa&#263; styl&#243;w CSS zamiast nich.',
+    'at_012' => 'Uk&#322;ad', 
+    'at_013' => 'standardowy',
+    'at_014' => 'do lewej',
+    'at_015' => 'do prawej',
+    'at_016' => 'do g&#243;ry',
+    'at_017' => 'do &#347;rodka',
+    'at_018' => 'do do&#322;u',
+    'at_019' => '&#347;rodek obrazka zr&#243;wnany z s&#261;siaduj&#261;cym tekstem',
+    'at_020' => 'g&#243;ra obrazka zr&#243;wnana z s&#261;siaduj&#261;cym tekstem',
+    'at_021' => 'd&#243;&#322; obrazka zr&#243;wnany z s&#261;siaduj&#261;cym tekstem',   
+    'at_022' => 'Rozmiar',
+    'at_023' => 'Szeroko&#347;&#263;',
+    'at_024' => 'Wysoko&#347;&#263;',
+    'at_025' => 'Ramka',
+    'at_026' => 'Odleg&#322;o&#347;&#263; V',
+    'at_027' => 'Odleg&#322;o&#347;&#263; H',
+    'at_028' => 'Podgl&#261;d', 
+    'at_029' => 'Kliknij aby wprowadzi&#263; specjalny znak do pola tytu&#322;u',
+    'at_030' => 'Kliknij aby wprowadzi&#263; specjalny znak do pola opisu',
+    'at_031' => 'Zresetuj wymiary obrazka do standardowych warto&#347;ci',
+    'at_032' => 'Podpis',
+    'at_033' => 'zaznaczone: podpis ustawiony / odznaczone: brak lub usuni&#281;cie podpisu',
+    'at_034' => 'ustaw podpis',
+    'at_099' => 'standardowy',  
+    //-------------------------------------------------------------------------   
+    // error messages - er
+    'er_001' => 'B&#322;&#261;d',
+    'er_002' => 'Obraz nie zosta&#322; zaznaczony!',
+    'er_003' => 'Szeroko&#347;&#263; nie jest liczb&#261;',
+    'er_004' => 'Wysoko&#347;&#263; nie jest liczb&#261;',
+    'er_005' => 'Szeroko&#347;&#263; ramki nie jest liczb&#261;',
+    'er_006' => 'Odleg&#322;o&#347;&#263; horyzontalna nie jest liczb&#261;',
+    'er_007' => 'Odleg&#322;o&#347;&#263; wertykalna nie jest liczb&#261;',
+    'er_008' => 'Kliknij OK aby skasowa&#263; obraz',
+    'er_009' => 'Zmiana nazwy miniatur nie jest dozwolona! Prosz&#281; zmieni&#263; nazw&#281; g&#322;&#243;wnego obrazu.',
+    'er_010' => 'Kliknij OK aby zmieni&#263; nazw&#281; na',
+    'er_011' => 'Nazwa jest pusta lub si&#281; nie zmieni&#322;a!',
+    'er_014' => 'Prosz&#281; wprowadzi&#263; now&#261; nazw&#281; pliku!',
+    'er_015' => 'Prosz&#281; wprowadzi&#263; prawid&#322;ow&#261; nazw&#281; pliku!',
+    'er_016' => 'Tworzenie miniatur niemo&#380;liwe! Prosz&#281; ustawi&#263; rozmiar miniatury w pliku konfiguracyjnym.',
+    'er_021' => 'Kliknij OK aby za&#322;adowa&#263; obraz(y)',
+    'er_022' => '&#321;adowanie obrazu - prosz&#281; czeka&#263;...',
+    'er_023' => '&#379;aden obraz nie zosta&#322; zaznaczony lub nie zdefiniowano jego wielko&#347;ci',
+    'er_024' => 'Plik',
+    'er_025' => 'ju&#380; istnieje! Naci&#347;nij OK aby go przepisa&#263;...',
+    'er_026' => 'Prosz&#281; wprowadzi&#263; now&#261; nazw&#281; pliku!',
+    'er_027' => 'Folder fizycznie nie istnieje',
+    'er_028' => 'Pojawi&#322; si&#281; b&#322;&#261;d podczas &#322;adowania pliku. Prosz&#281; spr&#243;bowa&#263; ponownie.',
+    'er_029' => 'B&#322;&#281;dny typ pliku',
+    'er_030' => 'Kasowanie nieudane! Prosz&#281; spr&#243;bowa&#263; ponownie.',
+    'er_031' => 'Nadpisz',
+    'er_032' => 'Pe&#322;ny rozmiar podgl&#261;du dzia&#322;a tylko dla obraz&#243;w wi&#281;kszych ni&#380; podgl&#261;d',
+    'er_033' => 'Zmiana nazwy pliku nieudana! Prosz&#281; spr&#243;bowa&#263; ponownie.',
+    'er_034' => 'Tworzenie katalogu nieudane! Prosz&#281; spr&#243;bowa&#263; ponownie.',
+    'er_035' => 'Powi&#281;kszanie nie jest dozwolone!',
+    'er_036' => 'Wyst&#261;pi&#322; b&#322;&#261;d podczas tworzenia listy plik&#243;w!',
+    ),    
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Symbole',
+    'ok'      => 'OK',
+    'cancel'    => 'Rezygnuj',
+    ),    
+  )
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/pt_br.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/pt_br.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/pt_br.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,182 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser - language file: Portugês - Brasil
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.1                   Date: 26/07/2006
+  // Por Ronaldo Chevalier - www.rcsigns.com.br
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  $lang_charset = 'iso-8859-1';
+  // text direction for the current language to be used in dialogs
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+  
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (  
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Visualização de Imagem',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'Bem Vindo',
+    'im_005' => 'Inserir',
+    'im_006' => 'Cancelar',
+    'im_007' => 'Inserir',    
+    'im_008' => 'Inserir/trocar',
+    'im_009' => 'Propriedades',
+    'im_010' => 'Propriedades da Imagem',
+    'im_013' => 'Janela Popup',
+    'im_014' => 'Imagem em popup',
+    'im_015' => 'Sobre iBrowser',
+    'im_016' => 'Seção',
+    'im_097' => 'Por favor aguarde enquanto carrega...',
+    'im_098' => 'Abrir seção',
+    'im_099' => 'Fechar seção',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in  
+    'in_001' => 'Inserir/trocar imagem',
+    'in_002' => 'Biblioteca',
+    'in_003' => 'Selecione uma imagem da biblioteca',
+    'in_004' => 'Imagens',
+    'in_005' => 'Visualização',
+    'in_006' => 'Deletar imagem',
+    'in_007' => 'Clique para visualizar a imagem em tamanho maior',
+    'in_008' => 'Abrir a imagem carregada, renomear ou deletar seção',  
+    'in_009' => 'Informação',
+    'in_010' => 'Janela Popup',   
+    'in_013' => 'Criar um link para uma imagem ser aberta em nova janela.',
+    'in_014' => 'Remover link popup', 
+    'in_015' => 'Aquivo', 
+    'in_016' => 'Renomear',
+    'in_017' => 'Renomear imagem',
+    'in_018' => 'Carregar',
+    'in_019' => 'Carregar imagem',  
+    'in_020' => 'Tamanho(s)',
+    'in_021' => 'Marque o(s) tamanho(s) desejado para criar enquanto a(s) imagem(ns) é carregada',
+    'in_022' => 'Original',
+    'in_023' => 'A Imagem será cortada',
+    'in_024' => 'Deletar',
+    'in_025' => 'Diretório',
+    'in_026' => 'Clique para criar um diretório',
+    'in_027' => 'Crie um diretório',
+    'in_028' => 'Largura',
+    'in_029' => 'Altura',
+    'in_030' => 'Tipo',
+    'in_031' => 'Tamanho',
+    'in_032' => 'Nome',
+    'in_033' => 'Criado',
+    'in_034' => 'Modificado',
+    'in_035' => 'Informação da Imagem',
+    'in_036' => 'Clique na imagem para fechar a janela',
+    'in_037' => 'Rotacionar',
+    'in_038' => 'Rotacionar Automático: ajuste a informação do exif, para usar a orientação pelo EXIF armazenado pela câmera. Você pode ajustar também para +180&deg; ou -180&deg; para tipo paisagem, ou +90&deg; ou -90&deg; para retrato. Valores positivos para sentido horário e valores negativos para sentido anti-horário.',
+    'in_041' => '',
+    'in_042' => 'Nenhum',   
+    'in_043' => 'Retrato',
+    'in_044' => '+ 90&deg;',  
+    'in_045' => '- 90&deg;',
+    'in_046' => 'Paisagem', 
+    'in_047' => '+ 180&deg;', 
+    'in_048' => '- 180&deg;',
+    'in_049' => 'Câmera', 
+    'in_050' => 'exif info',
+    'in_051' => 'AVISO: A imagem atual é uma miniatura criada dinâmicamente pelo iManager - os parâmetros serã perdidos na troca da imagem.',
+    'in_052' => 'Clique para visualizar outra imagem',
+    'in_053' => 'Aleatório',
+    'in_054' => 'Se marcado, uma imagem aleatória será inserida',
+    'in_055' => 'Marque para inserir uma imagem aleatória',
+    'in_056' => 'Parâmetros',
+    'in_057' => 'Clique para voltar os parâmetros para seus valores padrão',
+    'in_099' => 'Padrão', 
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Atributos da Imagem',
+    'at_002' => 'Código',
+    'at_003' => 'Título',
+    'at_004' => 'Título - mostrar descrição da imagem quando o mouse estiver em cima',
+    'at_005' => 'Descrição',
+    'at_006' => 'ALT - recolocação textual para a imagem, para ser indicado ou usado no lugar da imagem ',
+    'at_007' => 'Estilo',
+    'at_008' => 'Por favor, tenha certeza que o estilo selecionado existe na sua folha de estilos!',
+    'at_009' => 'Estilos CSS',  
+    'at_010' => 'Atributos',
+    'at_011' => 'Os \'align\', \'border\', \'hspace\', and \'vspace\' atributos dos elementos da imagem não são suportados pelo XHTML 1.0 Strict DTD. Por favor use o estilo CSS disponível.',
+    'at_012' => 'Alinhamento',  
+    'at_013' => 'padrão',
+    'at_014' => 'esquerda',
+    'at_015' => 'direita',
+    'at_016' => 'topo',
+    'at_017' => 'meio',
+    'at_018' => 'base',
+    'at_019' => 'absmeio',
+    'at_020' => 'texttop',
+    'at_021' => 'linha de base',    
+    'at_022' => 'Tamanho',
+    'at_023' => 'Largura',
+    'at_024' => 'Altura',
+    'at_025' => 'Borda',
+    'at_026' => 'Espaço Vertical',
+    'at_027' => 'Espaço Horizontal',
+    'at_028' => 'Visualizar', 
+    'at_029' => 'Clique para inserir caracteres especiais no campo de título',
+    'at_030' => 'Clique para inserir caracteres especiais no campo descrição',
+    'at_031' => 'Voltar dimensões da imagem à seus valores padrão',
+    'at_032' => 'Subtítulo',
+    'at_033' => 'marcado: ajustar subtítulo da imagem / desmarcado: sem subtítulo ou limpar subtítulo da imagem',
+    'at_034' => 'Ajustar subtítulo da imagem',
+    'at_099' => 'padrão', 
+    //-------------------------------------------------------------------------   
+    // error messages - er
+    'er_001' => 'Erro',
+    'er_002' => 'Nenhuma imagem selecionada!',
+    'er_003' => 'Largura não é número',
+    'er_004' => 'Altura não é número',
+    'er_005' => 'Borda não é número',
+    'er_006' => 'Espaço Horizontal não é número',
+    'er_007' => 'Espaço Vertical não é número',
+    'er_008' => 'Clique em OK para deletar a imagem',
+    'er_009' => 'Renomear miniatura não está disponível! Por favor renomeie a imagem principal se quiser renomear a miniatura.',
+    'er_010' => 'Cliqu OK renomear a imagem',
+    'er_011' => 'O novo nome está vazio ou não foi alterado!',
+    'er_014' => 'Entre com um novo nome para o arquivo!',
+    'er_015' => 'Entre com um novo válido!',
+    'er_016' => 'Miniaturas não disponível! Ajuste o tamanho da miniatura no arquivo de configuração para habilitar.',
+    'er_021' => 'Clique em OK to carregar a imagem(ns).',
+    'er_022' => 'Carregando imagem - por favor aguarde...',
+    'er_023' => 'Nenhuma imagem foi selecionada ou nenhum tamanho de arquivo foi marcado.',
+    'er_024' => 'Arquivo',
+    'er_025' => 'Este arquivo já existe! Clique em OK para regravar o arquivo...',
+    'er_026' => 'Entre com um novo nome!',
+    'er_027' => 'Pasta destino não existe fisicamente',
+    'er_028' => 'Ocorreu um erro enquanto carregava o arquivo. Por favor tente novamente.',
+    'er_029' => 'Tipo de imagem inválido',
+    'er_030' => 'Falha para deletar o arquivo! Por favor tente novamente.',
+    'er_031' => 'Regravado',
+    'er_032' => 'Visualização em tamanho maior somente funciona para imagens maiores que o tamanho visualizado.',
+    'er_033' => 'Renomear o arquivo falhou! Por favor tente novamente.',
+    'er_034' => 'Criar pasta falhou! Please try again.',
+    'er_035' => 'Aumentar não está disponível!',
+    'er_036' => 'Erro construindo lista de imagens!',
+    ),    
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Symbolos',
+    'ok'      => 'OK',
+    'cancel'    => 'Cancelar',
+    ),    
+  )
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/sk.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/sk.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/langs/sk.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,184 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser - language file: Czech
+  // Translated by Tomas Vaverka (Pche)
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.1                   Date: 17/02/2006
+  // ================================================
+  
+  //-------------------------------------------------------------------------
+  // charset to be used in dialogs
+  // pouzita znakova sada
+  $lang_charset = 'windows-1250';
+  // text direction for the current language to be used in dialogs
+  // smer textu v danem jazyce
+  $lang_direction = 'ltr';
+  //-------------------------------------------------------------------------
+  
+  // language text data array
+  // first dimension - block, second - exact phrase
+  //-------------------------------------------------------------------------
+  // iBrowser
+  $lang_data = array (  
+    'ibrowser' => array (
+    //-------------------------------------------------------------------------
+    // common - im
+    'im_001' => 'Image browser',
+    'im_002' => 'iBrowser',
+    'im_003' => 'Menu',
+    'im_004' => 'Vitajte',
+    'im_005' => 'Vložit',
+    'im_006' => 'Storno',
+    'im_007' => 'Vloži',   
+    'im_008' => 'Vložit/Zmeni',
+    'im_009' => 'Vlastnosti',
+    'im_010' => 'Vlastnosti obrázku',
+    'im_013' => 'Vyskakovacie okná',
+    'im_014' => 'Obrázok vo vyskakovacom okne;',
+    'im_015' => 'O programe',
+    'im_016' => 'Sekcie',
+    'im_097' => 'Chvi¾ku strpenia, nahrávam...',
+    'im_098' => 'Otvori sekciu',
+    'im_099' => 'Zatvori sekciu',
+    //-------------------------------------------------------------------------
+    // insert/change screen - in  
+    'in_001' => 'Vloži/Zmeni obrázok',
+    'in_002' => 'Knižnica',
+    'in_003' => 'Vyberte knižnicu obrázkov',
+    'in_004' => 'Obrázky',
+    'in_005' => 'Náh¾ad',
+    'in_006' => 'Zmaza obrázok',
+    'in_007' => 'Kliknite pre zväèenie obrázku',
+    'in_008' => 'Otvori upload obrázku, premenovanie, alebo zmazanie sekcie',  
+    'in_009' => 'Informácie',
+    'in_010' => 'Vyskakovacie okno',    
+    'in_013' => 'Vytvorenie odkazu na obrázok otváraný v novom okne.',
+    'in_014' => 'Odstrani odkaz na vyskakovacie okno', 
+    'in_015' => 'Súbor',  
+    'in_016' => 'Premenova',
+    'in_017' => 'Premenova obrázok',
+    'in_018' => 'Upload',
+    'in_019' => 'Uploadova obrázok', 
+    'in_020' => 'Ve¾kos(i)',
+    'in_021' => 'Zaškrtnite požadované ve¾kosti pre upload obrázkov',
+    'in_022' => 'Originál',
+    'in_023' => 'Obrázok bude orezaný',
+    'in_024' => 'Zmaza',
+    'in_025' => 'Adresár',
+    'in_026' => 'Kliknite pre vytvorenie adresára',
+    'in_027' => 'Vytvori adresár',
+    'in_028' => 'Šírka',
+    'in_029' => 'Výška',
+    'in_030' => 'Typ',
+    'in_031' => 'Ve¾kos',
+    'in_032' => 'Meno',
+    'in_033' => 'Vytvorené',
+    'in_034' => 'Zmenené',
+    'in_035' => 'Informácie o obrázku',
+    'in_036' => 'Kliknite na obrázok pre zazatvorenie okna',
+    'in_037' => 'Otoèit',
+    'in_038' => 'Automatické otoèenie: nastavi na EXIF informácie, pre použitie EXIF orientácie uložené fotoaparátom. Môže by tiež nastavené na +180&deg; alebo -180&deg; pre obrázok na šírku, alebo +90&deg; alebo -90&deg; pre obrázok na výšku. Kladné hodnoty pre posun v smere hodinových ruèièiek, záporné proti smeru.',
+    'in_041' => '',
+    'in_042' => 'žiadny',   
+    'in_043' => 'na výšku',
+    'in_044' => '+ 90&deg;',  
+    'in_045' => '- 90&deg;',
+    'in_046' => 'na šírku', 
+    'in_047' => '+ 180&deg;', 
+    'in_048' => '- 180&deg;',
+    'in_049' => 'fotoaparát', 
+    'in_050' => 'exif informácie',
+    'in_051' => 'POZOR: Tento obrázok je dynamický náh¾ad vytvorený iManagerom - parametre budú stratené pri zmmene obrázku.',
+    'in_052' => 'Kliknite pre zmenu náh¾adu vybraného obrázka',
+    'in_053' => 'Náhodný',
+    'in_054' => 'Ak je zaškrtnuté, bude vybrný náhodný obrázok',
+    'in_055' => 'Zaškrtnite pre vloženie náhodného obrázku',
+    'in_056' => 'Parametre',
+    'in_057' => 'Kliknite pre nastavenie východzích parametrov',
+    'in_099' => 'východzie',  
+    //-------------------------------------------------------------------------
+    // properties, attributes - at
+    'at_001' => 'Vlastnosti obrázku',
+    'at_002' => 'Zdroj',
+    'at_003' => 'Titulok',
+    'at_004' => 'TITLE - titulok obrázku, zobrazí sa po prejdení myšou nad obrázok',
+    'at_005' => 'Popis',
+    'at_006' => 'ALT -  alternatívny text obrázku, zobrazí sa pri nenaèítaní obrázku',
+    'at_007' => 'Štýl',
+    'at_008' => 'Uistite sa, že zadaný štýl existuje vo vašej definícii štýlov.',
+    'at_009' => 'CSS-štýl', 
+    'at_010' => 'Atribuúy',
+    'at_011' => 'Atribuúy \'umiestnenie\', \'okraj\', \'horiz_medzera\' a \'vert_medzera\' elementu IMAGE niesú podporované v XHTML 1.0 Strict DTD. Použite namiesto toho CSS štýly.',
+    'at_012' => 'Zarovnanie', 
+    'at_013' => 'východzie',
+    'at_014' => 'v¾avo',
+    'at_015' => 'vpravo',
+    'at_016' => 'nahor',
+    'at_017' => 'doprostred',
+    'at_018' => 'dole',
+    'at_019' => 'stred obrázku zarovnaný so stredom textu',
+    'at_020' => 'vrch obrázku zarovnaný s vrchom textu',
+    'at_021' => 'na èiaru',   
+    'at_022' => 've¾kos',
+    'at_023' => 'Šírka',
+    'at_024' => 'Výška',
+    'at_025' => 'Rámèek',
+    'at_026' => 'V-odsadenie',
+    'at_027' => 'H-odsadenie',
+    'at_028' => 'Náh¾ad', 
+    'at_029' => 'Kliknite pre vloženie špeciálnych znakov do po¾a titulku',
+    'at_030' => 'Kliknite pre vloženie špeciálnych znakov do po¾a popisu',
+    'at_031' => 'Nastavi východzie rozmery obrázku',
+    'at_032' => 'Záhlavie',
+    'at_033' => 'zaškrtnuté: nastavi záhlavie obrázku / nezaškrtnuté: bez záhlavia alebo zrušenie záhlavia',
+    'at_034' => 'nastavi záhlavie obrázku',
+    'at_099' => 'východzie',  
+    //-------------------------------------------------------------------------   
+    // error messages - er
+    'er_001' => 'Chyba',
+    'er_002' => 'Nie je vybraný obrázok!',
+    'er_003' => 'Šírka nie je èíslo',
+    'er_004' => 'Výška nie je èíslo',
+    'er_005' => 'Rámèek nie je èíslo',
+    'er_006' => 'Horizontálne odsadenie nie je èíslo',
+    'er_007' => 'Vertikálne odsadenie nie je èíslo',
+    'er_008' => 'Kliknite na OK pre zmazanie obrázku',
+    'er_009' => 'Premenovanie náh¾adu nie je dovolené! Premenujte obrázok, ak chcete premenovat jeho náh¾ad.',
+    'er_010' => 'Kliknite na OK pre premenovanie obrázku na',
+    'er_011' => 'Nové meno je prázdne, alebo nebolo zmenené!',
+    'er_014' => 'Zadajte nové meno súboru!',
+    'er_015' => 'Zadajte validní meno súboru!',
+    'er_016' => 'Náh¾ad nie je k dispozícii! Pre zapnutie náh¾adov nastavte ve¾kost náh¾adov v konfiguraènom súbore.',
+    'er_021' => 'Kliknite na OK pre upload obrázku.',
+    'er_022' => 'Upload obrázku - prosím vydržte...',
+    'er_023' => 'Nebol vybraný žiadnz obrázok, alebo nebol oznaèený žiadnz súbor.',
+    'er_024' => 'súbor',
+    'er_025' => 'už existuje! Kliknite na OK pre prepísanie...',
+    'er_026' => 'zadajte nové meno súboru!',
+    'er_027' => 'Adresár fyzicky neexistuje',
+    'er_028' => 'Došlo k chybe pri obsluhe uploadu súboru. Skúste to prosím znovu.',
+    'er_029' => 'Naplatný typ obrazového súboru',
+    'er_030' => 'Mazanie zlyhalo! Skúste to prosím znovu.',
+    'er_031' => 'Prepísa',
+    'er_032' => 'Náh¾ad skutoènej ve¾kosti funguje len pre obrázky väèších rozmerov ako okno náh¾adu',
+    'er_033' => 'Premenovanie súboru zlyhalo! Skúste to prosím znovu.',
+    'er_034' => 'Vytvorení adresáre zlyhalo! Skúste to prosím znovu.',
+    'er_035' => 'Zväèšenie nie je podporované!',
+    'er_036' => 'Chyba pri vytváraní zoznamu obrázkov!',
+    ),    
+    //-------------------------------------------------------------------------
+    // symbols
+    'symbols'   => array (
+    'title'     => 'Symboly',
+    'ok'      => 'OK',
+    'cancel'    => 'Storno',
+    ),    
+  )
+?>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Nothing to see here people, move along!
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/loadmsg.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/loadmsg.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/loadmsg.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser dialog - load message
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see readme.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.0                   Date: 07/15/2006
+  // ================================================ 
+  
+?>
+<?php
+  //-------------------------------------------------------------------------
+  // include configuration settings
+  if (!$l) {
+    include dirname(__FILE__) . '/../config/config.inc.php';
+    include dirname(__FILE__) . '/../langs/lang.class.php'; 
+    // language settings  
+    $l = (isset($_REQUEST['lang']) ? new PLUG_Lang($_REQUEST['lang']) : new PLUG_Lang($cfg['lang']));
+    $l->setBlock('ibrowser');
+  }
+?>
+<div align="center" id="dialogLoadMessage" style="display: block;">
+  <table width="100%" height="90%">
+    <tr>    
+      <td align="center" valign="middle"><div id="loadMessage"><?php echo $l->m('im_097'); ?></div></td>
+    </tr>
+  </table>
+</div>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.changelog.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.changelog.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.changelog.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1153 @@
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+
+¤ = structure change or important new feature
+* = less important new feature or change
+
+v1.7.3 - July 11, 2006
+  * Now returns useful message for HTTP sources if 404-file-
+    not-found (or similar) errors occur
+  * Added new fsockopen() section in SafeURLread()
+  * Removed PNG alpha warning for IE 7 (alpha PNGs now work)
+  * Bugfix: ImageMagick failing version check and dumping text
+    output  (thanks infoØdevsystem*net)
+  * Bugfix: curl_exec failing with text output
+    (thanks infoØdevsystem*net)
+  * Bugfix: workaround for PHP Bug #36102 (fopen(http) crash
+    in PHP v4.4.2
+  * Bugfix: "Unknown image type identified by..." problem when
+    opening http:// source images
+    (thanks webmasterØdanceage*com)
+
+
+v1.7.2 - June 22, 2006
+  ¤ [#1256693] Added $this->exif_raw_data which is returned
+    data from exif_read_data() on source image.
+    Requires PHP v4.2.0+  (thanks tebiØusers*sourceforge*net)
+  ¤ Added $this->outputImageData and RenderOutput() to allow
+    easy outputting of thumbnail data to a database or such.
+    Call RenderOutput() instead of RenderToFile() and then
+    access raw data in $this->outputImageData
+    (thanks r*cremerØswitch*nl)
+  ¤ Added 'crop' filter, which is applied after resizing (as
+    opposed to sx,sy,sw,sh which are before resizing)
+    (thanks scottØscottjehl*com)
+  * Enable creating new images with PATH_INFO style call
+    (thanks edenØinstyleit*com*au)
+  * Added warning message to encourage users not to use
+    full HTTP paths for "src" parameter
+  * Added fallback 'preg_quote' to phpthumb.functions.php in
+    case your PHP installation does not have preg_* functions
+    (thanks mortenØemeskay*dk)
+  * Added fallback 'imagesavealpha' if GD < v2.0.1
+    (thanks oliver*heegerØweb*de)
+  * Added fallback 'imagealphablending' if GD < v2.0.1
+    (thanks oliver*heegerØweb*de)
+  * Added 'nocache' parameter that suppresses writing to cache
+    file, but only if high_security_enabled is set
+    (thanks federicoØdonelleschi*com)
+  * Attempt to detect supported ImageMagick features
+    (thanks simonØjapancentre*com)
+  * Added temp dir detection to phpThumb.demo.check.php
+  * Added ImageMagick dir to phpThumb.demo.check.php
+  * Added ImageMagick features to phpThumb.demo.check.php
+  * Default (config_allow_src_above_docroot = true) when PHP
+    running in "cli" mode  (thanks flobeeØgmail*com)
+  * Bugfix: [#1470791] 'iar' not working properly with
+    ImageMagick  (thanks w1xØusers*sourceforge*net)
+  * Bugfix: [#1498564] illegal characters in cache filenames
+    (thanks carl-evertØusers*sourceforge*net)
+  * Bugfix: 'sx','sy','sw','sh','zc' cache parameters broken
+    (thanks federicoØdonelleschi*com)
+  * Bugfix: 'config_max_source_pixels' incorrectly handled
+    (thanks oliver*heegerØweb*de)
+  * Bugfix: 'aoe' not working properly
+    (thanks w1xØusers*sourceforge*net)
+  * Bugfix: setParameter() was broken for arrays
+  * Bugfix: setSourceFilename() wasn't setting 'src'
+  * Bugfix: suppress stat()-related file permission
+    notices  (thanks lanceØmainecoastdesign*com)
+  * Bugfix: image format now initialized during ErrorImage()
+  * Bugfix: domain matching now case-insensitive
+  * Bugfix: some versions of ImageMagick not detected
+    (thanks arvidØfys*ku*dk)
+  * Bugfix: sometimes no image returned in safe_mode
+    (thanks bkainersØgmail*com)
+  * Bugfix: 'far' not always handled correctly
+    (thanks matthew*newtonØrealworldweb*com)
+  * Bugfix: PATH_INFO method not working if no filters specified
+    (thanks jjimenezØpracticaldata*com)
+  * Bugfix: first (internal) call to ImageMagickVersion() failed
+    under Windows
+  * Bugfix: Images source-cropped AND resized with ImageMagick were
+    wrong size (cropped size, not resized size)
+    (thanks joao*saleiroØwebfuel*pt)
+  * Bugfix: stat() warnings in CleanUpCacheDirectory()
+    (thanks christianØhss-haage*de)
+  * Bugfix: $PHPTHUMB_DEFAULTS not working when no other processing
+    parameters specified  (thanks tbittnersØcox*net)
+
+
+v1.7.1 - March 16, 2006
+  * /demo/phpThumb.demo.check.php now checks:
+    - server software
+    - local and master config values (with ini_get and
+      get_cfg_var respectively)  (thanks nEUTRonØgmx*tm)
+    - existance of assorted PHP functions and explains their
+      importance
+  * Bugfix: config_error_die_on_error now defaults to FALSE to
+    prevent object-mode errors dying in an error image
+    (thanks moshØtobt*de; riteshgupta1974Øgmail*com)
+  * Bugfix: setParameter() now handles array parameters (such
+    as 'fltr') by appending $value to $parameter
+  * Bugfix: /demo/phpThumb.demo.check.php incorrect CURL value
+    under PHP5  (thanks nEUTRonØgmx*tm)
+  * Bugfix: [#1439110] Limit fread() calls to 8kB
+    (see http://bugs.php.net/bug.php?id=35859)
+    (thanks andig2Øusers*sourceforge*net)
+  * Bugfix: Prevent RenderToFilename() from trying to render
+    to URLs  (thanks Tim*MasseyØitrm*co*uk)
+  * Bugfix: [#1438657] missing path in phpThumbURL()
+    (thanks terracesØusers*sourceforge*net)
+  * Bugfix: zoomcrop was broken for non-square output
+    (thanks alisonØsemidivine*com, federicoØdonelleschi*com)
+  * Bugfix: suppress error messages when stat access to temp
+    dir is disabled  (thanks rfineØvnuinc*com)
+  * Bugfix: ImageMagick processing was broken for source
+    images of types not supported by GetImageSize
+    (thanks rfineØvnuinc*com)
+
+v1.7.0 - February 15, 2006
+  ¤ ImageMagick output is used directly far more frequently
+    for much improved speed and minor quality improvement.
+  ¤ ImageMagick now processes most of the image filters if
+    possible (will fall back to GD methods if unavailable)
+  ¤ GD support is now optional if ImageMagick is installed.
+    Known limitations include:
+    - no support for HTTP source images
+    - ICO output is buggy (in some ImageMagick versions)
+    - most &fltr[] filters don't work at all
+    - 'ar', 'ra', 'far' don't work
+  ¤ Added output support for ICO (icon) format (&f=ico).
+    Currently only supports single-image icons, but multi-
+    resolution support may be added in future versions
+    New file: phpthumb.ico.php
+  ¤ Added output support for BMP (bitmap) format (&f=bmp).
+    Currently only supports 24-bit RGB format (for simplicity)
+  ¤ Added new configuration & compatability checker
+    New file: demo/phpThumb.demo.check.php
+  * ImageMagick-generated thumbnails now have extra hidden
+    contents (EXIF data, etc) stripped (by using -thumbnail
+    instead of -resize) resulting in smaller filesizes
+  * Added background fill color, opacity and extent options to
+    'wmt' filter  (thanks craigØpc-fanatics*com)
+  * Added metacharacter (^*) support for 'wmt', currently:
+    source filesize in bytes (^Fb), kB (^Fk), MB (^Fm),
+    source image width (^X), source image height (^Y),
+    thumbnail width (^x), thumbnail height (^y) and caret (^^)
+    (Feature Request #1357815)
+    (thanks ticklemeozmoØusers*sourceforge*net)
+  * Moved ImageDestroy call from OutputThumbnail to end of
+    phpThumb.php to allow multiple calls to OutputThumbnail
+  * Added config_http_user_agent for site with browsersniffers
+    (thanks redrobØgmail*com)
+  * Added $PHPTHUMB_CONFIG['disable_pathinfo_parsing'] (default
+    false) which disables parsing $_SERVER[PATH_INFO] for
+    parameters. If you want to parse PATH_INFO, set to false
+  * Added $PHPTHUMB_CONFIG['disable_imagecopyresampled'] (default
+    false) which replaces ImageCopyResampled with
+    ImageCopyResampleBicubic for buggy PHP-GD versions
+    (thanks g*pelagattiØnetface*it)
+  * Added $PHPTHUMB_CONFIG['cache_prefix'] to allow sharing of
+    cache files across virtual servers (Feature Request #1395332)
+    (thanks doggyfrØusers*sourceforge*net)
+  * Added $PHPTHUMB_CONFIG['disable_onlycreateable_passthru'] with
+    default=true (increased speed) to allow direct passthru of
+    images that don't have GD support. (Feature Request #1396446)
+    (thanks zedboyØusers*sourceforge*net)
+  * Removed $PHPTHUMB_CONFIG['cache_differentiate_offsite'] because
+    it is now automatically tied in with nooffsitelink_enabled
+    (thanks doggysworldØlibertysurf*fr)
+  * Removed phpThumb.demo.cacheconvert2.php
+  * Debug messages are now passed back from filters
+  * $PHPTHUMB_CONFIG['cache_source_filemtime_ignore_remote'] now
+    defaults to true for much-improved cached performance
+    (thanks redrobØgmail*com)
+  * $PHPTHUMB_CONFIG['cache_differentiate_offsite'] now defaults
+    to false
+  * Added $PHPTHUMB_DEFAULTS['ar']='x' to phpThumb.config.php.default
+  * Added ImageDestroy($this->gdimg_source) to GenerateThumbnail()
+    to save memory before applying image filters
+  * gd_info() no longer member of phpthumb_functions
+  * cache files now default to using SERVER_NAME without 'www.'
+  * phpUnsharpMask::applyUnsharpMask() should be faster under PHP5 by
+    using ImageFilter(IMG_FILTER_GAUSSIAN_BLUR) when radius==1
+  * Added alternate CURL method for HTTP source images if
+    allow_url_fopen is disabled  (thanks webweberØmotiondraw*com)
+  * Replaced $this->osslash with DIRECTORY_SEPARATOR constant
+  * Bugfix: [#1398327] 'new' got broken (1x1 images)
+  * Bugfix: [#1412552] HTTP source images with special characters were
+      not getting urlencoded
+  * Bugfix: ImageSaveAlpha errors on GD v2.0.0
+  * Bugfix: phpThumbDebug now entirely disabled if high_security=true
+  * Bugfix: source images with transparency lost transparency when
+    rotated  (thanks roalklØyahoo*com)
+  * Bugfix: square source images were not resized when only (w|h)(p|l)
+    parameters passed
+  * Bugfix: source images are passed through unmodified in more cases
+  * Bugfix: ImageMagick not used on systems where it exists outside
+    defined open_basedir
+  * Bugfix: ImageMagickVersion() now returns correct versionstring
+  * Bugfix: ImageMagick warnings no longer cause ImageMagick to fail
+  * Bugfix: ErrorImage no longer fatal to phpThumbDebug
+  * Bugfix: "Array to string conversion" in foreach($a as $v) loops
+    (thanks zeeshanØtargetedmedia*co*uk)
+  * Bugfix: safe mode warnings in ImageCreateFromStringReplacement
+    (thanks adminØalex-home*net)
+  * Bugfix: nooffsitelink broken if !nooffsitelink_require_refer
+    (thanks depronØgmx*net)
+  * Bugfix: phpThumb failed when magic_quotes_runtime=true
+    (thanks stansawyerØyahoo*com)
+  * Bugfix: several issues with HTTP image sources
+    (thanks redrobØgmail*com)
+  * Bugfix: phpThumb_tempnam() would return incomplete temp filenames
+    under Windows, which may result in orphaned zero-byte temp files
+    in C:\ if multiple drives exist
+
+v1.6.2 - November 24, 2005
+  ¤ Animated GIF output is now possible if ImageMagick is
+    available and no filters (other than resize) are applied
+    (thanks brandenbassØgmail*com for idea)
+  * Added $PHPTHUMB_CONFIG['cache_force_passthru'] to work
+    around cached-image-only-works-second-time issue
+    (thanks yakoØ11y11*com)
+  * Bugfix: black borders on some image edges
+    (thanks atelierØdelirius*ch && chuckØcatalyststudio*com)
+  * Bugfix: uncaught PHP warning in RenderToFile DebugMessage
+  * Bugfix: allow phpThumbDebug in noGD PHP installations
+  * Bugfix: 'hash' warning in high_security mode
+    (thanks bernhardØwtf*at)
+  * Bugfix: non-TTF rotated text watermarks now work (unrotated)
+    with no warnings if ImageRotate is unavailable
+    (thanks aparviaiØusers*sourceforge*net)
+
+v1.6.1 - August 26, 2005
+  ¤ Filters now use GD functions where available (using
+    ImageFilter, only available in PHP v5.0.0+ with bundled
+    version of GD). Enabled for: colorize, negative,
+    grayscale, brightness, contrast, gaussian blur, selective
+    blur, mean removal  (thanks donlaurØmac*com)
+  ¤ Added config_prefer_imagemagick (defaults=true)
+  ¤ Added phpthumb_filters::Grayscale()        'gray'
+  ¤ Added phpthumb_filters::ReduceColorDepth() 'rcd'
+  ¤ Added phpthumb_filters::Brightness()       'brit'
+  ¤ Added phpthumb_filters::Contrast()         'cont'
+  ¤ Added phpthumb_filters::Saturation()       'sat'
+  ¤ Added phpthumb_filters::EdgeDetect()    'edge' [PHP5 only]
+  ¤ Added phpthumb_filters::BlurGaussian()  'gblr' [PHP5 only]
+  ¤ Added phpthumb_filters::BlurSelective() 'gblr' [PHP5 only]
+  ¤ Added phpthumb_filters::MeanRemoval()   'mean' [PHP5 only]
+  ¤ Added phpthumb_filters::Smooth()        'smth' [PHP5 only]
+  * New timing debug info in phpThumbDebug
+  * Added config_cache_differentiate_offsite
+  * config_die_on_error now defaults to false
+  * ResolveSource works better
+  * cache filenames with 'fltr' parameters have changed
+  * Filters now skip processing if amount=0 or similar
+  * [#1263051] 'far' now accepts L,R,T,B,C as values giving
+    alignment of left/right/top/bottom/center respectively.
+    Old value of '1' defaults to centered
+    (thanks webgrappaØusers*sourceforge*net)
+  * Bugfix: RenderToFile() now fails properly when output format
+    is unknown
+  * Bugfix: PNG transparency wasn't working with 'far'
+  * Bugfix: source images with EXIF thumbnails that differ in
+    aspect ratio no longer use EXIF thumbnails as source unless
+    no other options exist
+  * Bugfix: setting 'src' with setParameter now invokes
+    setSourceFilename to properly set $this->sourceFilename
+    (thanks Gazou)
+  * Bugfix: 'zc' had poor quality when used with ImageMagick
+  * Bugfix: 'aoe' parameter broken when not using ImageMagick
+    (thanks frankieali4Øhotmail*com)
+  * Bugfix: fixed issue with symbolic links
+    (thanks hornet136Øgmail*com)
+  * Bugfix: config_max_source_pixels now defaults to same
+    calculation as used in phpThumb.config.php
+    (thanks vukshaØhotmail*com)
+  * Bugfix: Offsite cached thumbnails no longer use unique
+    referer (now either nothing or "_offsite")
+    (thanks swaayeØyahoo*com)
+  * Bugfix: "Unknown image type identified by “<?ph”" errors
+    in some installations  (thanks frankieali4Øhotmail*com)
+
+v1.6.0 - July 18, 2005
+  ¤ Included new file phpThumb.demo.random.php to select a
+    random image from a specified folder, optionally only
+    landscape and/or portrait and/or square images, and to
+    display it to phpThumb.php
+    (thanks mikeØgdaymate*nl)
+  ¤ Added /docs/phpthumb.faq.txt
+  ¤ Added /demo/readme.demos.txt
+  ¤ Added 'wp', 'hp', 'wl', 'hl', 'ws', 'hs' parameters for
+    width and height of portrait, landscape and square
+    images. This allows you to display any image aspect
+    ratio at the size you want without knowing ahead of time
+    whether the image is wide or tall.
+    (thanks mikeØgdaymate*nl)
+  ¤ phpThumb.php can now also be called by passing parameters
+    in $_SERVER['PATH_INFO']. Please see phpthumb.readme.txt
+    (thanks javierØguegue*net)
+  ¤ MySQL data pulling configuration moved from phpThumb.php
+    to phpThumb.config.php
+  * "file" and "goto" parameters are now disabled by
+    default (configurable in phpThumb.config.php but not
+    recommended)
+  * Cached files are now used from first instance, avoiding
+    call to OutputThumbnail and preventing browser-side
+    cache failure
+  * Added config_allow_src_above_docroot (default=false) to
+    prevent browsing filesystem outside document_root
+    (thanks davidØint0x80*com)
+  * Added config_allow_src_above_phpthumb (default=true) to
+    prevent access to files except in subdirectories of
+    phpThumb installation  (thanks davidØint0x80*com)
+  * Added setParameter() and getParameter() functions
+    (thanks werner*kraussØhallstatt*net)
+  * SafeBackTick() renamed to SafeExec() and all execution
+    functions are tried (exec, shell_exec, system, passthru)
+    are tried in case one or more are disabled
+    (thanks bkainersØgmail*com)
+  * config_output_allow_enlarging has been removed from
+    phpthumb.class.php, and 'output_allow_enlarging' has
+    been removed from phpThumb.config.php
+  * New default detection method for
+    $PHPTHUMB_CONFIG['document_root']
+  * Bugfix: inconsitant handling of boolean parameters
+    passed "0" (isset vs !empty())  (thanks manniØzapto*de)
+  * Bugfix: text watermarks now support multiple lines
+    (thanks hanno*vandenbergØhccnet*nl)
+  * Bugfix: suppress error message in
+    ImageCreateFromStringReplacement()
+    (thanks srimandadapuØyahoo*com)
+  * Bugfix: 'aoe' was ignored in object mode
+    (thanks tonyØnylink*com)
+  * Bugfix: ResolveFilenameToAbsolute() failed on non-
+    existant filenames (file to be written, for example)
+  * Bugfix: 'aoe' parameter was ignored in cache filename
+    (thanks tonyØnylink*com)
+  * Bugfix: non-TTF watermark text had inverted opacity
+    scale. All 'wmt' is now 100=opaque, 0=transparent
+    (thanks mailØmmjaeger*com)
+  * Bugfix: cache file failed if document_root had
+    trailing slash.  (thanks lovingloboØgmail*com)
+  * Bugfix: [#1219422] Cache filename structure modified to
+    avoid excessively long filenames (cache filenames are
+    now limited to 142 characters + length of
+    $_SERVER['SERVER_NAME'])
+    (thanks trungieØusers*sourceforge*net)
+  * Bugfix: [#1211729] phpThumb.php fails to locate
+    phpThumb.config.php if the two files are in the same
+    directory but phpThumb.php is run through a sym link.
+    (thanks allanbushØusers*sourceforge*net)
+
+v1.5.4 - May 27, 2005
+  * Security issue with passthrough addressed
+    (thanks davidØint0x80*com)
+  * 'wmt' now reads TTF fonts from the config font
+    directory, or from anywhere if a path is specified in
+    the font filename
+    (thanks mailØmmjaeger*com)
+  * Changed default error_die_on_source_failure to true in
+    phpThumb.config.php
+  * Bugfix: Firefox (possibly other browsers) did not like
+    the new (faster) cache retrieval method with Location
+    header redirection if the cached filename does not have
+    a recognized filename extension (.jpeg, .png, .gif).
+    Cached images have therefore been renamed from *_jpeg to
+    *.jpeg and the _qXX parameter has been removed for PNG
+    and GIF output. Please use the included cache renamer:
+    /demo/phpThumb.demo.cacheconvert2.php
+    (thanks mailØmmjaeger*com)
+  * Bugfix: Changed "Content-type" to "Content-Type" in all
+    header calls
+  * Bugfix: 'wmt' text opacity was broken
+    (thanks mstuhuØweb*de)
+  * Bugfix: variable name typo in phpThumb.demo.object.php
+    (thanks mbØmarko-bischof*de)
+  * Bugfix: no GD support for source image format now
+    reported as such for remote images
+    (thanks andgu842Østudent*liu*se)
+  * Bugfix: very narrow images no longer produce Invalid
+    Image Dimensions error  (thanks mailØmmjaeger*com)
+
+v1.5.3 - May 4, 2005
+  ¤ Added new filters:
+    - 'wb' (White Balance) [ex: &fltr[]=wb|<c>]
+      where <c> is the target hex color to white balance
+      on, this color is what "should be" white, or light
+      gray. The filter attempts to maintain brightness so
+      any gray color can theoretically be used. If <c> is
+      omitted the filter guesses based on brightest pixels
+      in each of RGB
+  ¤ Cached files are used by a Location header instead of
+    being passed through phpThumb.php using readfile
+    (thanks newtnØthrillnerds*com)
+  * Added 'cache_source_filemtime_ignore_local' and
+    'cache_source_filemtime_ignore_remote' configurations
+    to ignore source modification and/or removal
+    (thanks raynerapeØgmail*com)
+  * Added 'md5s' parameter, which is the MD5 hash of the
+    source image -- if this parameter is passed with the
+    hash of the source image then the source image is not
+    checked for existance or modification and the cached
+    file is used (if available). If 'md5s' is passed an
+    empty string then phpThumb.php dies and outputs the
+    correct MD5 hash value.  This parameter is the single-
+    file equivalent of 'cache_source_filemtime_ignore_*'
+    configuration paramters  (thanks raynerapeØgmail*com)
+  * Added /demo/phpThumb.demo.object.php
+  * Unused parameter 'bgt' removed
+  * Added empty /cache/source/ directory to distribution
+  * Added /demo/ and /docs/ and /fonts/ directories
+  * Set default config_use_exif_thumbnail_for_speed = false
+  * Bugfix: Wrapped output buffering around all
+    include_once calls to prevent headers getting sent
+    accidentally
+  * Bugfix: md5_file and imagecolorallocatealpha calls
+    were undefined under PHP v4.1.x  (thanks tomØemile*com)
+  * Bugfix: default 'f' parameter ('jpeg') overrode
+    config_output_format in object mode
+    (thanks mailØmmjaeger*com)
+  * Bugfix: suppressed error message for IIS shell_exec
+    errors  (thanks tomØemile*com)
+  * Bugfix: Added PHP version check for stream_set_timeout
+    for HTTP sources  (thanks raynerapeØgmail*com)
+  * Bugfix: overlay margins of 0.5-1.0 cause invalid image
+    dimensions error  (thanks mailØmmjaeger*com)
+  * Bugfix: underlay margins were not working
+    (thanks mailØmmjaeger*com)
+  * Bugfix: [#1187735] EXIF thumbnails were incorrectly
+    output to the browser directly if requested thumbnail
+    exactly matched EXIF dimensions
+    (thanks rebootØusers*sourceforge*net)
+
+v1.5.2 - April 20, 2005
+  ¤ phpThumb.config.php is renamed to
+    phpThumb.config.php.default to prevent accidental
+    overwriting. Please migrate your old settings to the new
+    file, delete your old config and rename the default to
+    phpThumb.config.php
+  ¤ Added new filters:
+    - 'blur' (Blur) [ex: &fltr[]=blur|<radius>]
+      where (0 < <radius> < 25) (default = 1)
+      (thanks thoensiØnetcom*no for code)
+    - 'hist' (Histogram)
+      [ex: &fltr[]=hist|<b>|<c>|<w>|<h>|<a>|<o>|<m>]
+      Where <b> is the color band(s) to display, from back
+      to front (one or more of "rgba*" for Red Green Blue
+      Alpha and Grayscale respectively);
+      <c> is a semicolon-seperated list of hex colors to
+      use for each graph band (defaults to FF0000, 00FF00,
+      0000FF, 999999, FFFFFF respectively);
+      <w> and <h> are the width and height of the overlaid
+      histogram in pixels, or if <= 1 then percentage of
+      source image width/height;
+      <a> is the alignment (same as for "wmi" and "wmt");
+      <o> is opacity from 0 to 100;
+      <m> is the edge (and inter-tile) margin in percent
+    - 'over' (OVERlay/underlay image) overlays an image on
+      the thumbnail, or overlays the thumbnail on another
+      image (to create a picture frame for example)
+      [ex: &fltr[]=over|<i>|<u>|<m>|<o>]
+      where <i> is the image filename; <u> is "0" (default)
+      for overlay the image on top of the thumbnail or "1"
+      for overlay the thumbnail on top of the image; <m> is
+      the margin - can be absolute pixels, or if < 1 is a
+      percentage of the thumbnail size [must be < 0.5]
+      (default is 0 for overlay and 10% for underlay);
+      <o> is opacity (0 = transparent, 100 = opaque)
+      (thanks raynerapeØgmail*com, shabazz3Ømsu*edu)
+    - 'gray' (GRAYscale) [ex: &fltr[]=gray]
+      is an alias to 100% desaturation
+  * New configuration 'cache_source_directory' allows the
+    unprocessed source image to be cached when source is
+    HTTP or from a database  (thanks raynerapeØgmail*com)
+  * Added 'cache' subdirectory to phpThumb distribution
+    since this is the default location for the cache
+    folder.
+  * Default value for config_error_die_on_source_failure
+    changed to true  (thanks shabazz3Ømsu*edu)
+  * Added checks to make sure $this->gdimg_output is a
+    resource before allowing calls to RenderToFile or
+    OutputThumbnail
+  * Better error messages when phpThumb.config.php missing
+  * Bugfix: watermark overlay margins were wrong
+  * Bugfix: 'lvl' filter no longer processes if not needed
+  * Bugfix: off-server thumbnail error message was wrong
+  * Bugfix: several PHP safe mode fixes
+    (thanks virginiaØalertbutnotalarmed*com)
+  * Bugfix: cache filenames broken for filter parameters
+    with paths  (thanks srcericØusers.sourceforge.net)
+
+v1.5.1 - April 06, 2005
+  * Added some security upgrades:
+    - 'config_*' parameters cannot be passed by GETstring
+    - 'config_nooffsitelink_require_refer' is a new option
+      (disabled by default) that only allows calls to
+      phpThumb() from a refering domain listed in
+      'config_nooffsitelink_valid_domains'
+    - disallowed paramters now generate an error image if
+      present in the GETstring
+    - 'high_security_enabled' if set to true enabled new
+      mode of verification, and requires a small function
+      to generate a hash for calls to phpThumb:
+      echo '<img src="'.phpThumbURL('src=pic.jpg&w=50').'">';
+      This function is supplied at the bottom of
+      phpThumb.config.php  (thanks paulØstonie*co*uk)
+  ¤ Added new parameter "new" (phpThumb.php only) which can
+    create a new image without using "src" parameter. Set
+    "&new=<b>|<o>" where <b> is the background hex color,
+    <o> is (optional) opacity (0=transparent, 100=opaque).
+    (thanks mailØmmjaeger*com)
+  ¤ Added new filters:
+    - 'sep' (Sepia) [ex: &fltr[]=sep|<value>|<color>]
+      where <value> is a number between 0 and 100 for the
+      amount of colorization (default=50), and <color> is
+      the hex color to colorize to (default=A28065).
+      (thanks mailØmmjaeger*com)
+    - 'lvl' (Levels) [ex: &fltr[]=lvl|<channel>|<min>|<max>
+      where <channel> can be one of 'r', 'g', 'b', 'a' (for
+      Red, Green, Blue, Alpha respectively), or '*' for all
+      channels based on average grayscale value (default).
+      <min> and <max> are the clip points for the levels
+      (range = 0-255) and are set to clip 0.1% of each end
+      by default. Use -1 for min and/or max to invoke auto-
+      detect mode. Using default parameters (&fltr[]=lvl)
+      is similar to Auto Contrast in Adobe Photoshop.
+  * Bugfix: Image MIME header was incorrect for cached
+    images.
+  * Bugfix: Cache was broken for images pulled from a
+    database in phpThumb.php
+    (thanks dragutin*cvetkovicØdragontech-ltd*com)
+  * Bugfix: Hotlink/Offsite prevention was broken when
+    image was already cached.
+  * Bugfix: ImageMagick path was incorrect in some cases
+    (thanks joshgØtwcny*rr*com)
+  * Bugfix: ProportionalResize() in phpthumb.functions.php
+    had a broken check for default values
+    (thanks Bert*ClaeysØarinso*com)
+  * Bugfix: transparency now preserved for GIF & PNG input
+    (thanks tristanØcyrax*ch)
+  * Bugfix: transparency now supported for GIF output
+    (thanks j_ivanovØabv*bg)
+  * Bugfix: alpha transparency could be lost in ApplyMask()
+    (thanks analyzerxØgmail*com)
+  * Bugfix: errors on 16/32-bit BMPs
+    (thanks mattØhellstrominc*com)
+  * Bugfix: Added datestamp to cached filenames for remote
+    (HTTP) files, and better warning for caching
+    (thanks a*gambinoØabramo*it)
+  * Faster BMP parsing  (thanks sgeppertØmail*utexas*edu)
+  * Added 'error_die_on_source_failure' configuration to
+    allow invalid source images to show an error rather
+    than output unmodified source image.
+    (thanks mindpixelØgmail*com)
+  * Added $phpThumb->fatalerror which will contain the
+    text of the fatal error if 'error_die_on_error' is
+    false.  (thanks mindpixelØgmail*com)
+
+v1.5.0 - February 4, 2005
+  * Added new filter parameter 'fltr' that is an array and
+    can apply multiple effects in sequence. Current filters
+    that can be called are:
+    - 'gam' (Gamma Correction) [ex: &fltr[]=gam|<value>]
+      where <value> can be a number >0 to 10+ (default 1.0)
+    - 'ds' (DeSaturate) [ex: &fltr[]=ds|<value>]
+      where <value> is a number between zero (no change)
+      and 100 (complete desaturation -- grayscale), or it
+      can be a negative number for saturation boost.
+      (thanks mailØmmjaeger*com)
+    - 'clr' (Colorize) [ex: &fltr[]=clr|<value>|<color>]
+      where <value> is a number between 0 and 100 for the
+      amount of colorization, and <color> is the hex color
+      to colorize to.  (thanks mailØmmjaeger*com)
+    - 'neg' (Negative) [ex: &fltr[]=neg]
+      inverts the color
+    - 'th' (ThresHold) [ex: &fltr[]=th|<val>] (range 0-255)
+      every grayscale pixel brighter than <val> is set to
+      white, every darker pixel is set to black
+      (thanks mailØmmjaeger*com)
+    - 'usm' (UnSharpMask) [ex: &fltr[]=usm|<a>|<r>|<t>]
+      where <a> is the amount (default = 80), <r> is the
+      radius (default = 0.5), <t> is the threshold
+      (default = 3).
+    - 'wmi' (WaterMarkImage)
+      [ex: &fltr[]=wmi|<f>|<a>|<o>|<m>] where <f> is the
+      filename of the image to overlay, <a> is the
+      alignment (one of BR, BL, TR, TL, C, R, L, T, B, *
+      where B=bottom, T=top, L=left, R=right, C=centre,
+      *=tile), <o> is opacity from 0 to 100, <m> is the
+      edge (and inter-tile) margin in percent
+    - 'wmt' (WaterMarkText)
+      [ex: &fltr[]=wmt|<t>|<s>|<a>|<c>|<f>|<o>|<m>|<n>]
+      where:
+      <t> is the text to use as a watermark,
+      <s> is the font size (1-5 for built-in font, or point
+        size for TrueType fonts),
+      <a> is the alignment (one of BR, BL, TR, TL, C, R, L,
+        T, B, * where B=bottom, T=top, L=left, R=right,
+        C=centre, *=tile),
+      <c> is the hex color of the text
+      <f> is the filename of the TTF file (optional, if
+        omitted a built-in font will be used)
+      <o> is opacity from 0 to 100,
+      <m> is the edge (and inter-tile) margin in percent
+      <n> is the angle
+      (thanks mailØmmjaeger*com)
+    - 'flip' [ex: &fltr[]=flip|x   or   &fltr[]=flip|y]
+      flip image on X or Y axis
+      (thanks mailØmmjaeger*com)
+    - 'elip' [ex: &fltr[]=elip]
+      similar to rounded corners but more extreme
+      (thanks mailØmmjaeger*com)
+    - 'mask' [ex: &fltr[]=mask|filename.png]
+      greyscale values of mask are applied as the alpha
+      channel to the main image. White is opaque, black
+      is transparent.
+    - 'bvl' (BeVeL) [ex: &fltr[]=bvl|<w>|<c1>|<c2>]
+      where <w> is the bevel width, <c1> is the hex color
+      for the top and left shading, <c2> is the hex color
+      for the bottom and right shading
+      (thanks mailØmmjaeger*com)
+    - 'fram' (FRAMe) draws a frame, similar to border but
+      more configurable  (thanks mailØmmjaeger*com)
+      [ex: &fltr[]=fram|<w1>|<w2>|<c1>|<c2>|<c3>]
+      where <w1> is the width of the main border, <w2> is
+      the width of each side of the bevel part, <c1> is the
+      hex color of the main border, <c2> is the highlight
+      bevel color, <c3> is the shadow bevel color
+    - 'drop' (DROP shadow)
+      [ex: &fltr[]=drop|<d>|<w>|<clr>|<a>]
+      where <d> is distance from image to shadow, <w> is
+      width of shadow fade (not yet implemented), <clr> is
+      the hex color of the shadow, and <a> is the angle of
+      the shadow (default=225)
+    - 'ric' (Rounded Image Corners)
+      [ex: &fltr[]=ric|<x>|<y>]
+      where <x> is the horizontal corner radius,
+      <y> is the vertical corner radius
+  * Split out filter functions into phpthumb.filters.php
+  * 'usa','usr','ust' parameters have been removed and
+    replaced with the 'fltr' call (see above)
+  * 'wmf','wma','wmp','wmm' parameters have been removed
+    and replaced with the 'fltr' call (see above)
+  * 'brx','bry','bw' parameters have been removed
+    and replaced with the 'fltr' call (see above)
+  * 'bw=0' to force aspect ratio has been replaced by
+    'far=1' (force aspect ratio)
+  * Filters that produce transparent sections (such as
+    Rounded Corners, Ellipse, Mask, Rotate) are now output
+    as 32-bit/alpha PNG, or flattened with "bg" background
+    color for JPEG/GIF output  (thanks mailØmmjaeger*com)
+  * Added 'zc' (Zoom Crop) parameter
+    (thanks arcookeØgmail*com, mailØmmjaeger*com,
+    pl16056Ømacnews*de, kezzasmØusers*sourceforge*net, etc)
+  * AutoRotate now can use EXIF orientation tag ('ar=x')
+  * Added 'ttf_directory' configuration parameter for
+    TrueType watermarks  (thanks mailØmmjaeger*com)
+  * Added "Last-Modified" header to cache portion of
+    phpThumb.php which should allow better user-side
+    caching of thumbnails.  (thanks derekØnetsimple*net)
+  * Added 'cache_disable_warning' configuration which will
+    cause an error image to be displayed if the cache
+    directory isn't configured, unless explicitly disabled
+  * Added 'nooffsitelink_enabled' configuration which
+    prevents linking to thumbnails on your server from
+    another domain. Defaults to watermaking linked images
+    with text warning message.
+    (thanks anteØabstraktmedia*com)
+  * Added 'error_image_width' & 'error_image_height'
+    config variables  (thanks mailØmmjaeger*com)
+  * Rounded image corners now requires GD v2.0.1 and PHP
+    v4.3.2. Corners are transparent (for PNG output) and
+    antialiased.
+  * Rotate by arbitary angle ('ra') now has a transparent
+    background for PNG output
+  * Cached filenames now have an additional component for
+    applied filters
+  * Cached filenames now have an additional component for
+    HTTP referer, but only if the refering domain does not
+    match the domain of the server (designed to prevent
+    imaged linked from offsite with error message being
+    cached the same as the local cached version)
+  * Added setSourceImageResource() to allow use of an
+    existing GD image resource for thumbnailing
+    (thanks danØgonmad*co*uk)
+  * Now including phpThumb.demo.demo1.php (main demo page)
+    and phpThumb.demo.demo2.php (configurable demo page)
+    in the phpThumb() distribution
+    (thanks mailØmmjaeger*com)
+  * Added many more debugging/tracing message points
+  * Added set_time_limit(30) to phpThumb.php
+  * Bugfix: ImageMagick not used if `which convert` points
+    to a link and not a file  (thanks bkainersØgmail*com)
+  * Bugfix: 'bgt' parameter was sometimes misspelled 'bct'
+  * Bugfix: 'wmm' couldn't be set to zero
+  * Bugfix: 'wmm' parameter was only applied to top/left of
+    image
+  * Bugfix: auto-detection of document_root failed on
+    Windows  (thanks xbartvØhotmail*com)
+  * Bugfix: phpThumbDebug could be bypassed if EXIF
+    thumbnail present  (thanks olgradinØcheckfree*com)
+  * Bugfix: cache file wasn't being written if EXIF data
+    was used directly  (thanks olgradinØcheckfree*com)
+  * Bugfix: phpThumb.demo.showpic.php was broken by popup
+    blockers for images larger than the screen.
+    (thanks mailØmmjaeger*com)
+
+v1.4.11 - October 11, 2004
+  * Changed sx/sy/sw/sh parameters to allow decimal values
+    (>0 but <1) to represent percent of source image
+    (thanks mordorØdefault*co*yu)
+  * Added config_error_silent_die_on_error for no-output
+    die on fatal errors (thanks johannesØformformat*se)
+  * Added auto-detection of probable 'document_root' if
+    that key is not available in $_SERVER
+  * Bugfix: Check `which convert` failing with error
+    message (thanks chadØchadshome*com)
+  * Bugfix: Image cropping to invalid areas outside source
+    image caused text output (thanks mordorØdefault*co*yu)
+
+v1.4.10 - August 22, 2004
+  * Bugfix: cached files not written in most cases
+    (thanks kizerØcourtkizer*com, snuffØinbox*ru)
+  * Bugfix: ApacheLookupURIarray() crashes in CGI mode
+    (thanks hanskrentelØyahoo*de)
+  * Bugfix: phpthumb_bmpfile2gd() was broken
+    (thanks iØmindlace*net)
+
+v1.4.9 - August 9, 2004
+  * Bugfix: changed destination filename in RenderToFile()
+    (thanks alextkØwalla*com)
+  * Bugfix: problems with HTTP image source when called as
+    an object (thanks alextkØwalla*com)
+
+v1.4.8 - August 4, 2004
+  * $this->error has changed to $this->errors and is now
+    an array of strings (instead of a single string)
+  * A lot more error conditions (invalid cache directory,
+    etc) are now reported in $this->errors
+    (thanks aidan*slingsbyØlineone*net)
+  * Removed all define(CONSTANT) in the phpThumb()
+    constructor - you can now access:
+    - PHPTHUMB_VERSION   == $this->phpthumb_version;
+    - PHPTHUMB_OSSLASH   == $this->osslash;
+    - PHPTHUMB_ISWINDOWS == $this->iswindows;
+  * Bugfix: Error message from apache_lookup_uri() failing
+    under Apache2 now reported cleanly
+    (thanks derbaffØyahoo*com)
+  * Bugfix: missing phpthumb_functions:: class name for
+    ImageTypeToMIMEtype() call in ExtractEXIFgetImageSize()
+    (thanks aidan*slingsbyØlineone*net)
+  * Bugfix: ImageTypeToMIMEtype() was broken for PHP older
+    than v4.3.0  (thanks georg*schreiberØbatch-pc*es)
+  * Bugfix: RenderToFile() now returns false if it fails
+    (thanks phpthumbØsendthemtomir*com)
+  * Bugfix: Corrupt JPEG/PNG/GIF files that failed
+    ImageCreateFrom*() were not being passed to ImageMagick
+    for fallback, nor passed through unmodified if IM was
+    unavailable or failed  (thanks r*chongØmogenic*net)
+  * Bugfix: Improved backtick safe-mode limit detection
+    (thanks 1Øadamcarrington*com)
+  * Bugfix: EXIF thumbnails were being used as source when
+    they should not be  (thanks aidan*slingsbyØlineone*net)
+  * Bugfix: Cached files were not being created or used
+    properly  (thanks aidan*slingsbyØlineone*net)
+  * Bugfix: max_source_pixels not set correct on some PHP
+    versions  (thanks derbaffØyahoo*com)
+  * Bugfix: 'down' parameter ignored for unprocessed and
+    cached files  (thanks aidan*slingsbyØlineone*net)
+
+v1.4.7 - July 27, 2004
+  * Included a modified version of "module.graphic.bmp.php"
+    from getID3() [http://getid3.sourceforge.net] as
+    "phpthumb.bmp.php" for BMP reading support without
+    ImageMagick. It works, but it's *very* slow, especially
+    for large images (as in 640x480 or larger).
+  * Added check to prevent error messages when shell_exec
+    is disabled (thanks webmasterØneester*com)
+
+v1.4.6 - July 22, 2004
+  * Added new section to phpthumb.config.php where you can
+    easily specify defaults for any parameter you can set
+    in the URL. Normally URL parameters override these
+    default values, unless you set
+    $PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE to false
+  * Renamed phpthumb.config.php to phpThumb.config.php
+    since it's part of phpThumb.php, not part of
+    phpthumb.class.php (change of case only, will not
+    affect Windows servers, but will affect *nix)
+  * Changed cached filename of rawImageData-source images
+    from urlencode('') to md5(rawImageData). This should
+    make caching thumbnails from non-file sources more
+    reliable.
+  * Added ImageMagick debugging information
+  * Removed unneccesary default values from cached
+    filenames. This may invalidate some previously cached
+    files. phpthumb.demo.cacheconvert.php has been updated
+    to handle v1.4.1-1.4.5 => v1.4.6+ cache filenames.
+  * Bugfix: Cached filename did not have file-modified
+    datestamp when used as implmented in phpThumb.php
+  * Bugfix: RenderToFile() now accepts relative filenames
+    (thanks aidan*slingsbyØlineone*net)
+  * Bugfix: AllowOutputEnlargment setting was ignored when
+    falling back to ImageMagick
+  * Bugfix: IgnoreAspectRatio setting was ignored when
+    falling back to ImageMagick
+  * Bugfix: config_temp_directory was ignored in gd_info()
+    in PHP < v4.3.0 when phpinfo() returns no GD
+    information (due to safe mode restrictions)
+    (thanks mimyrtekØmyrtek*com)
+
+v1.4.5 - June 28, 2004
+  * Added new parameter 'down' where you can specify a
+    filename and OutputThumbnail() will cause the file
+    to be downloaded rather than displayed in the browser.
+    Demo images on silisoftware.com/scripts/phpThumb/demo/
+    can all be downloaded to show off this feature.
+    (thanks stuartscrumpØyahoo*co*uk)
+  * Added ability to remove old files from cache directory
+    based on last-access time and/or number of cached files
+    and/or total size of cached files
+    (thanks jrmhaigØyahoo*co*uk)
+  * Added public CleanUpCacheDirectory() for cache cleaning
+    (see above) if you need to call it manually
+  * Included new file phpThumb.demo.cacheconvert.php to
+    convert old-style cache names to the current (and
+    hopefully last!) standard naming convention.
+    (thanks joshgØtwcny*rr*com)
+  * Added configuration value 'document_root' for rare case
+    when $_SERVER['DOCUMENT_ROOT'] return incorrect value
+    (thanks joshgØtwcny*rr*com)
+  * Now tries to create thumbnail with ImageMagick if
+    ImageCreateFromJPEG etc fails, before falling back to
+    outputting unmodified source data.
+  * Bugfix: HTTP image sources were broken
+    (thanks fritz*weisshartØt-online*de)
+  * Bugfix: ImageMagick callout wasn't being used if EXIF
+    thumbnail was available
+    (thanks joshgØtwcny*rr*com)
+  * Bugfix: HTTP src with space in filename was broken
+    (thanks drØrhodes360*com)
+  * Bugfix: version_compare_replacement() was broken for
+    PHP v4.1.0+
+
+v1.4.4 - June 8, 2004
+  * Bugfix: network-share (Windows) source filenames were
+    not possible. Now works, but you must use the network
+    name and not a mapped drive name, for example:
+    \\othercomputer\file.jpg - good
+    \\192.168.2.1\file.jpg - good
+    z:\file.jpg - won't work
+    This is a PHP limitation (see www.php.net/file-exists)
+    Note: you may want to use "/" slashes instead of "\" if
+    you have magic_quotes_gpc enabled to avoid stripslashes
+    problems.
+    (thanks drØrhodes360*com)
+  * Bugfix: missing "phpthumb_functions::" in
+    ImageCreateFromStringReplacement()
+    (thanks zapletalØsoftwaremedia*cz)
+
+v1.4.3 - May 25, 2004
+  * Added new configuration variable 'config_temp_directory'
+    to allow you to specify a writable directory name for
+    temp files if you do not have access to the system temp
+    directory on your server (Safe Mode restrictions etc)
+    (thanks nickØregenmag*com)
+  * Added new configuration variable
+    'config_error_die_on_error' which can be set to false if
+    you want to retrieve the error message without having it
+    dumped as an image - the error message is now available
+    in $phpThumb->error
+  * Images are passed through directly with no processing
+    and no caching if no parameters are passed to alter the
+    image (resize, crop, sharpening, etc)
+    (thanks nchmuraØusers*sourceforge*net)
+  * Added new configuration variable 'config_disable_debug'
+    which disabled phpThumbDebug from working if you have
+    security concerns about the displayed information
+  * Bugfix: Added detection at the top of phpThumb.php for
+    no-GD errors to avoid parse errors later in the code
+    (thanks nickØregenmag*com)
+  * Bugfix: RoundedImageCorners() had some off-by-1 errors
+    (thanks ola*thunbergØhome*se)
+
+v1.4.2 - May 10, 2004
+  * Added IE-compatability mode for transparent corners
+    (set 'bct=256')
+  * Bugfix: version_compare_replacement() was broken in PHP
+    older than 4.1.0
+    (thanks nickØregenmag*com)
+
+v1.4.1.1 - May 9, 2004
+ * Bugfix: Removed ImageTrueColorToPalette hack.
+   See http://bugs.php.net/bug.php?id=28341
+ * Bugfix: 'maxb' option for PNG/GIF output incorrect
+   bit depth under some circumstances
+
+v1.4.1 - May 9, 2004
+ * Added 'maxb' (MAXimum Bytes) option to auto-set the
+   output image quality (JPEG) or bit depth (PNG/GIF) so
+   that the output thumbnail is less than 'maxb' bytes
+   (thanks e_belleØhotmail*com)
+ * Added 'bgt' parameter to make rounded corners from
+   'brx'/'bry' option transparent when used with PNG
+   output. Note: PHP/GD appears buggy at this time, so this
+   option must force output to 256-color mode for this
+   to work. The feature will be updated when a non-broken
+   version of PHP/GD is released.
+   (thanks javierØircorion*net)
+ * Bugfix: Caching was broken
+   (thanks mikeØgdaymate*nl, jurewiczØgo3*pl)
+
+v1.4.0 - April 30, 2004
+ * Rewritten as a PHP class. Split into several files:
+   - phpthumb.class.php        = most processing code
+   - phpthumb.functions.php    = support functions
+   - phpthumb.readme.txt       = usage instructions
+   - phpthumb.changelog.txt    = this file
+   - phpthumb.config.php       = configuration file
+   - phpthumb.gif.php          = Non-GD GIF reading support
+   - phpthumb.unsharp.php      = Unsharp Masking support
+   - phpThumb.php              = demo script that works
+       exactly as previous versions; this is a drop-in
+       replacement for existing phpThumb() installations
+   - phpThumb.demo.showpic.php = demo script that auto-
+       resizes a popup window to the size of the image
+       shown. Useful if you want popup images but do not
+       know the large image size beforehand
+ * Added optional call-out to ImageMagick (if avaible) if
+   source image is larger than PHP memory restrictions
+   allow. ImageMagick installation should be auto-detected
+   under *nix, but you should configure 'imagemagick_path'
+   for use under Windows.
+ * 'max_source_pixels' is now auto-calculated from PHP
+   configuration settings. Due to various server-level
+   restrictions that may override PHP settings this
+   calculated value may not always be correct, and you may
+   have to specify the value manually.
+ * Added rounded-corner border option. You must specify
+   both 'brx' (horizontal radius) and 'bry' (vertical
+   radius) as well as 'bw' (border width). If 'bw' is
+   greater than zero, the image will be shrunk to fit
+   inside the border with a margin of background color.
+   If 'bw' is zero, the corners of the image will be
+   cut off and filled with background color.
+   (thanks javierØircorion*net)
+ * Minor speed improvement for unsharp masking
+
+v1.3.7 - March 28, 2004
+ * Bugfix: GD version detection was broken on PHP <4.3.0
+   on servers where phpinfo() was disabled
+   (thanks javierØircorion*net)
+ * Bugfix: Non-GD GIF support was broken on restricted
+   PHP configurations
+   (thanks javierØircorion*net)
+ * Bugfix: phpThumb.gif.php output error messages if PHP
+   was running in Safe Mode
+ * Added 'iar' parameter (Ignore Aspect Ratio) to allow
+   non-proportional resizing (stretch image to fit).
+   You must specify 'h' and 'w' to use this option.
+   (thanks javierØircorion*net)
+
+v1.3.6 - March 14, 2004
+  * Bugfix: was broken when register_globals turned on
+    (thanks joshgØtwcny*rr*com)
+  * Bugfix: Images with transparent backgrounds now have
+    the background color filled with the color specified
+    by the 'bg' parameter
+  * Bugfix: ImageCreateFromString() is broken in the
+    non-bundled GD. Added workaround, but please use
+    the bundled version of GD if possible
+    (thanks dnØxbe*ch)
+  * Bugfix: EXIF thumbnail caching was broken
+  * Bugfix: EXIF thumbnail handling was broken for PHP
+    v4.2.x
+    (thanks smithk1Øshaw*ca)
+  * Bugfix: Image borders with GD2 were misaligned
+  * Bugfix: virtual paths/filenames like /~user/foo.jpg
+    should now work properly, if PHP is installed as an
+    Apache module (see www.php.net/apache-lookup-uri)
+  * Bugfix: contents of any non-image file could be
+    displayed (including PHP & HTML files)
+    (thanks arsyanØarsyan*com)
+  * Added rotation parameters 'ra' and 'ar'
+    (thanks drØrhodes360*com)
+  * Added $CONFIG['output_allow_enlarging'], defaulted
+    to false, to prevent smaller-than-max-size images
+    from being enlarged beyond their original size. If
+    you want to be able to enlarge images, set this to
+    false. Can be overridden with the 'aoe' parameter
+    (thanks dnØxbe*ch)
+  * Changed all configuration variables to be under one
+    array named $CONFIG
+  * Moved color and font options for ErrorImage() to
+    $CONFIG variables
+  * Changed cached filename structure (again) to a more
+    flexible format that can handle future expansion
+    (old cached files are invalid and will be recreated)
+  * Added more debugging code to phpThumbDebug
+
+v1.3.5 - February 29, 2004
+  * Added capability to use EXIF thumbnail that may be
+    embedded in source image (often is in digital camera
+    JPEGs) and source image dimensions are larger than
+    $config_max_source_pixels. This will overcome the
+    limitation where PHP runs out of memory processing
+    large images (usually >1600x1200). EXIF thumbnail
+    extraction requires PHP v4.2.0 or higher and EXIF
+    support compiled into PHP (or php_exif extension)
+  * Eliminated intermediate read-file-to-memory stage if
+    image is created from local file. Should allow
+    larger images to be processed without running out of
+    memory.
+  * Added optional 'goto' parameter to be used with the
+    'file' parameter, where 'goto' is a URL that is
+    redirected to after image is rendered to file
+    (thanks wimbleØwebdonors*com)
+  * Added optional 'xto' parameter that will bypass all
+    processing and just return the embedded EXIF
+    thumbnail, if available.
+  * Added error-handling if ImageTypes() is unavailable
+
+v1.3.4 - February 15, 2004
+  * Custom error image option (&err=img.jpg) which can
+    also be set as $config_error_message_image_default
+    (thanks carlØ4thstar*net)
+  * &f=text will now output plain-text error messages
+  * ErrorImage() now used for anti-hotlink messages (if
+    $config_nohotlink_erase_image is true)
+
+v1.3.3 - February 5, 2004
+  * Bugfix: Added stripslashes() to filenames if
+    magic_quotes_gpc is enabled
+    (thanks arsyanØarsyan*com)
+  * Output can now be rendered to a file only (not to
+    browser) specified by the 'file' parameter
+    (thanks arsyanØarsyan*com)
+  * JPEG quality now has a maximum of 95%, as specified
+    in the GD documentation
+
+v1.3.2.1 - February 3, 2004
+  * Bugfix: gd_version() was broken for GD v2.0+
+  * Bugfix: removed debugging code
+
+v1.3.2 - February 3, 2004
+  * Bugfix: when borders are enabled, portait images
+    with no width constraint, or landscape images with
+    no height constraint were smaller than neccesary by
+    double the border width
+    (thanks jjjØxs4all*nl)
+  * Added unsharp mask option thanks to Torstein Hønsi:
+    http://www.vikjavev.com/hovudsida/umtestside.php
+    Note: requires GD v2.x to function
+    (thanks jjjØxs4all*nl)
+  * Updated cache filenames to reflect new parameters,
+    this means old cached files will need to be deleted
+    (or not, they just will never get called again) and
+    new cached versions will be created.
+  * Added caching to gd_info() calls for minor speedup
+
+v1.3.1 - February 2, 2004
+  * Added optional border (width and color configurable)
+    (thanks arsyanØarsyan*com)
+  * Added option to create fixed-dimension thumbnails
+    regardless of source aspect ration. Set the 'bw'
+    (BorderWidth) parameter (even to 0) and this will be
+    enabled. Outside the actual image will be filled
+    with 'bg' color (default FFFFFF)
+    (thanks arsyanØarsyan*com)
+
+v1.3.0 - January 27, 2004
+  * Added watermarking option to overlay thumbnails with
+    a semi-transparent watermark image (copied from a
+    seperate source watermark image)
+    (thanks arsyanØarsyan*com)
+  * Added option for absolute filenames (on both Windows
+    and *nix) outside the DOCUMENT_ROOT directory
+  * Added debug output dump for diagnosing problems)
+
+v1.2.8 - January 19, 2004
+  * added ability to specify relative pathnames as well
+    as absolute pathnames (pathname is relative to the
+    location of phpThumb.php if the passed source does
+    not begin with "/"
+
+v1.2.7 - January 7, 2004
+  * Added patch to allow use of PHP older than 4.1.0
+    (or GD without PNG support) for non-GD GIF support
+    (thanks hostwebserverØhotmail*com)
+
+v1.2.6 - January 4, 2004
+  * Added patch to allow use of PHP older than 4.1.0
+    (without the superglobals arrays)
+
+v1.2.5 - December 26, 2003
+  * Added configuration options for default output image
+    format and max width/height
+
+v1.2.4 - December 20, 2003
+  * Bugfix: temp directory for non-native GD support not
+    always returning valid directory
+  * Caching feature reintroduced (see configuration)
+
+v1.2.3 - December 19, 2003
+  * Added anti-hotlink code so the thumbnail script on
+    one domain cannot be used by another domain. The
+    list of allowed domains defaults to the current
+    domain but is configurable below as
+    $config_nohotlink_valid_domains. The message, text
+    size, colors and whether to blank the image or not
+    are also configurable
+  * Bugfix: URL image sources were not able to use the
+    non-GD GIF-reading functions
+
+v1.2.2 - December 17, 2003
+  * Added option to use http:// URL as image source
+
+v1.2.1 - December 11, 2003
+  * Added option to get source data from a database
+    rather than a physical file
+  * Bugfix: resize not proportional when wide image
+    limited more by max height than max width
+    Thanks mathias_strasserØgmx*net
+  * Removed caching code
+
+v1.2.0 - December 10, 2003
+  * Added GIF support for versions of GD that do not
+    have built-in GIF support (v1.6.x) via the "GIF
+    Util" class by Fabien Ezber (www.yamasoft.com)
+    GD's built-in GIF-reading functions are faster, and
+    are present in PHP v4.3.0 or newer, but all versions
+    of GD can display resized GIF thumbnails now.
+
+v1.1.2 - October 26, 2003
+  * check for source image existance to prevent text
+    error messages
+  * if GD not available, a GIF saying "no GD" is shown
+    instead of showing the original image
+  * Cache feature introduced
+
+v1.1.1 - September 28, 2003
+  * better resize code by sfisher10Øcox*net
+
+v1.1.0 - September 1, 2003
+  * initial public release
+  * thumbnails can now be larger than source image
+  * graphical error messages
+
+v1.0.0 - January 7, 2002
+  * initial private release

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.faq.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.faq.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.faq.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,280 @@
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+//    Frequently Asked Questions (FAQ) about phpThumb()     //
+//                                                         ///
+//////////////////////////////////////////////////////////////
+
+
+Q: My question isn't answered here and I can't find any
+   forums, how do I get support?
+A: Please email me directly at info at silisoftware.com with
+   any questions, suggestions, donations, etc.
+
+
+Q: I think I found a bug, what's the first thing I should do?
+A: Please make sure you're using the latest version. There's
+   a good chance I may have already fixed the bug, so please
+   make sure you can reproduce it with the latest version
+   before reporting the bug.
+
+
+Q: phpThumb doesn't work as expected, and it may be a server
+   configuration issue -- how do I check?
+A: Please run /demo/demo.check.php to find out how your server
+   matches up with the recommended configuration and for
+   suggestions on what to change for improved performance.
+
+
+Q: What is the GPL? Can I use this for commercial sites?
+A: See the GPL FAQ: http://www.gnu.org/licenses/gpl-faq.html
+   In general, if you just want to call phpThumb.php in the
+   standard <img src="phpThumb.php?src=pic.jpg&w=100"> manner
+   then there is no problem, you're free to do this no matter
+   if you site is commercial or not, or what license your code
+   is released under.
+   If you're calling phpThumb() as an object then you will
+   probably run into license issues, so consult the above FAQ
+   and the GPL itself.
+   No matter if you use phpThumb() commercially or not, no
+   payment is required. However, donations are always welcome
+   and can be made at http://phpthumb.sourceforge.net
+
+
+Q: Some images generate thumbnails, but some fail (the original
+   non-resized image is output instead).
+A: Your PHP installation does not have a high enough memory_limit
+   and ImageMagick is not installed on the server. The PHP memory
+   required is 5 times the number of pixels in the image.
+   For example:
+     640x480x5   = 1.5MB
+     1600x1200x5 = 9.2MB
+   You can adjust the PHP memory limit in php.ini (if you have
+   permission on your server to do so), or (better yet) install
+   ImageMagick on the server and that will bypass the memory limit
+   issue. If you can't do either of the above, you can resize the
+   images manually (with your favourite image editor) to a size
+   that your memory_limit setting can handle, and/or you can
+   re-save the images with an image editor that can embed an EXIF
+   thumbnail (Photoshop for example) which phpThumb can use as an
+   image source (lower image quality, but perhaps better than
+   nothing).
+
+
+Q: I'm getting is this error message:
+   Failed: RenderToFile(<filename>) failed because
+   !is_resource($this->gdimg_output)
+A: You missed the call to GenerateThumbnail() before
+   RenderToFile() or OutputThumbnail.
+   See /demo/phpThumb.demo.object.php for an example.
+
+
+Q: I'm trying to save a phpThumb-generated image in Internet
+   Explorer and it saves in BMP format, why?
+A: This is not phpThumb's fault, it is an IE issue:
+   http://support.microsoft.com/default.aspx?scid=kb;en-us;810978
+   http://support.microsoft.com/default.aspx?scid=kb;en-us;260650
+
+
+Q: PNG images with transparent areas show up with gray background
+   in the areas that are supposed to be transparent.
+A: Internet Explorer has had a broken PNG alpha-channel display
+   implementation for a decade, so it may never get fixed. Other
+   major browsers generally handle alpha-transparent PNGs fine.
+   See http://www.silisoftware.com/png_transparency/
+   For an alpha-channel PNG display in IE hack, see this page:
+   http://www.koivi.com/ie-png-transparency/
+
+
+Q: I'm getting "<filename> does not exist" when I know the
+   file does exist
+A: Check that these two values are present and properly
+   configured in phpThumb.config.php (introduced in v1.6.0):
+    $PHPTHUMB_CONFIG['allow_src_above_docroot']  (default=false)
+    $PHPTHUMB_CONFIG['allow_src_above_phpthumb'] (default=true)
+   If your images are outside DOCUMENT_ROOT then you will have
+    to configure 'allow_src_above_docroot' to true.
+   Make sure whatever user the webserver is running as has read
+    permission to the file/directory you're reading from
+
+
+Q: Should I use phpThumb.php, or use phpThumb() as an object?
+A: phpThumb.php is easier to use (less coding) for basic uses.
+   phpThumb.php handles all caching; your own object will need
+   to have its own caching code. If you just want to display a
+   thumbnailed version of an existing image, use phpThumb.php
+   If you want to render one (or more) thumbnails to static
+   files (during upload, for example), that's an appropriate
+   use for the object mode. Also, phpThumb.config.php is only
+   used by phpThumb.php, so if you instantiate your own object
+   you need to manually set all configuration options because
+   phpThumb.config.php has NO effect. So, to repeat:
+   **always use phpThumb.php unless you NEED to have an object**
+
+
+Q: The first time I go to a page which contains thumbnails I
+   don't actually see the thumbnail, I just get a browser image
+   placeholder (or no image). As soon as I hit refresh, all the
+   thumbnail images pop into place really fast.
+A: You can try and see if it works better with
+     $PHPTHUMB_CONFIG['cache_force_passthru'] = false;
+   but typically the default setting works better.
+   This is something of an unresolved issue on some servers,
+   where for whatever reason I haven't (yet?) been able to
+   figure out a setting that always works the first time. If the
+   above config setting doesn't help, you might be stuck with
+   having to manually or automagically pre-cache thumbnails as
+   they're created.  Please email info at silisoftware.com if you
+   have a better solution...
+
+
+Q: Are there any front-end GUI interfaces to phpThumb()?
+A: See /demo/readme.demo.txt
+
+
+Q: Are there / have there been any security issues in phpThumb?
+A: http://secunia.com/product/5199/
+
+
+Q: Why can't Flash work with images output from phpThumb()?
+A: Flash doesn't like progressive JPEG. Set:
+   $PHPTHUMB_CONFIG['output_interlace'] = false;
+
+
+Q: Image quality is not very good - why?
+A: If you're using GD v1.x, no way around it. Upgrade to GD v2.x
+
+
+Q: Image quality is very bad, very pixelated -- why?
+A: You may be trying to resize images larger than the available
+   PHP memory, so phpThumb is simply extracting and using the
+   EXIF thumbnail as the image source, which is usually about
+   160x120 (so if you resize it to 640x480 it will look very bad).
+   To calculate the required size for memory_limit in php.ini,
+   calculate the number of pixels in the image and multiply by 5:
+   For example, 1600x1200 = 1600 * 1200 * 5 = 9600000 = 10M
+   Easy solution: install ImageMagick
+
+
+Q: Can I save the generated thumbnail to a file?
+A: Yes, there are several ways to do so; the best way is to call
+   phpThumb as an object and call RenderToFile() to save the
+   thumbnail to whatever filename you want.
+   See /demo/phpThumb.demo.object.php for an example.
+   The other way is to use the 'file' parameter (see
+   /docs/phpthumb.readme.txt) but this parameter is deprecated
+   and may not exist in future versions of phpThumb().
+
+
+Q: "Off-server thumbnailing is not allowed" -- how do I enable it?
+A: By default, phpThumb() only makes thumbnails for the same
+   domain that it is running on. To allow it to make thumbnails
+   for a limited number of other domains, add them
+   (in phpThumb.config.php) like this:
+     $PHPTHUMB_CONFIG['nohotlink_valid_domains'] = array(
+      @$_SERVER['HTTP_HOST'], 'example.com', 'www.example.com',
+      'subdomain.example.net', 'example.org');
+   To disable off-server thumbnail blocking, just set:
+     $PHPTHUMB_CONFIG['nohotlink_enabled'] = false;
+
+
+Q: Is it possible to set the parameters (like w/h/fltr[]) in
+   the config, so that they can't be changed over the URL?
+A: Take a look at $PHPTHUMB_DEFAULTS at the bottom of
+   phpThumb.config.php  You'll want to set
+     $PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE = false
+   possibly also
+     $PHPTHUMB_DEFAULTS_DISABLEGETPARAMS = true
+   You may also want to investigate
+     $PHPTHUMB_CONFIG['high_security_enabled'] = true
+   (see the example at the bottom of phpThumb.config.php
+   for how to call images in HighSecurity mode)
+
+
+Q: Is there a way to use phpThumb() object to create thumbnails
+   without the parameters in the URL showing the location of
+   the image etc?
+A: There is a demo in /demo/phpThumb.demo.object.php. You could
+   modify this into your own file, but there still remains the
+   problem of passing parameters to the file, whether it's
+   phpThumb.php or your own instantiation of a phpThumb() object.
+   I would suggest is putting as many of the common parameters
+   into phpThumb.config.php as possible under $PHPTHUMB_DEFAULTS,
+   so you then don't have to pass them for each image. If you
+   don't want people modifying the parameters, turn on
+   $PHPTHUMB_CONFIG['high_security_enabled'] and set a password
+   (you'll need to generate the <img> tags with phpThumbURL()
+   provided at the bottom of phpThumb.config.php). If you don't
+   want people accessing your source images at all, you can
+   place them outside DOCUMENT_ROOT on your server (as long as
+   phpThumb/PHP has read access to the directory). The other
+   option is to put your source images in a MySQL database
+   and set $PHPTHUMB_CONFIG['mysql_query'] and related
+   parameters in phpThumb.config.php to pull your source images
+   from the database. That way it's impossible to retrieve the
+   images except through phpThumb.php, and if high_security is
+   enabled, then nobody can modify the parameters to view
+   anything except what you want to show. So, yes, it's possible
+   to use your own object, but it's probably better to use
+   phpThumb.php if possible -- one notable issue is that
+   phpThumb.php handles all the caching, so you're on your own
+   to deal with that if you create your own object.
+
+
+Q: How do I write the output thumbnail back to a database instead
+   of outputting to the browser or a file?
+A: See /demo/phpThumb.demo.object.php  Basically you need to call
+   $this->GenerateThumbnail() then $this->RenderOutput() and then
+   the output raw image data is found in $this->outputImageData
+
+
+Q: phpThumb runs slowly, as if the images aren't cached, when I use HTTP source
+   images (not on my server). How can I make it go faster?
+A: $PHPTHUMB_CONFIG['cache_source_filemtime_ignore_remote'] = true;
+   // if true, remote source images will not be checked for modification date and
+   // cached image will be used if available, even if source image is changed or removed
+
+
+Q: What does the "cache_default_only_suffix" configuration option do?
+A: Cache files are normally created with big ugly names like
+   "phpThumb_cache_www.example.com_src1a482c2c760463795ff18faf073b389f_par3e099041c2f4a73041a7f5d7e7fc481a_dat1119952152.jpeg"
+   but if cache_default_only_suffix is enabled, cache filenames are simplified to
+   "pic_thumb.jpg" (for example). The problem is that only one version of that
+   thumbnail is possible, and you can never call it again with a different size,
+   or different filters, etc.  Generally you don't want that enabled, but it's
+   there because some people asked for it.
+
+
+Q: Why is the visual size of rotated images smaller than the unrotated images?
+A: phpThumb fits the rotated image into the 'w' and 'h' dimensions.
+   Try not specifying a 'w' parameter: phpThumb.php?src=file.png&ra=15
+   That should leave the image the apparent same size as the unrotated image
+   (in actual fact the canvas size is enlarged to fit the rotated image in it).
+
+
+Q: How can I purge cached files when I delete the source image?
+A: You can either let phpThumb's built-in cache purging features (see phpThumb.config.php)
+   take effect, or you can manually walk through your source images to delete and find
+   the matching cache files and delete them:
+     if ($dh = opendir($sourcedir)) {
+       while ($file = readddir($dh)) {
+         if ($file == $WhatIwantToDelete) {
+           $md5 = md5_file($sourcedir.'/'.$file);
+           unlink($phpthumb_cache_dir.'/phpThumb_cache_www.example.com_src'.$md5.'*.*');
+         }
+       }
+       closedir($dh);
+     }
+
+
+Q: What is the proper name for this script/program/library?
+A: The official name is "phpThumb()" but it may be written
+   as simply "phpThumb" in short form (or where parentheses
+   are not permitted), or "phpthumb" in case-insensitive
+   environments. The following is a non-exhaustive sample of
+   unacceptable forms: PHPthumb; phpThumbs; phpthump;
+   phpthumbnailer; phpThumbnail; PHP Thumb; Phpthumb; etc.
+
+

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.license.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.license.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.license.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,340 @@
+            GNU GENERAL PUBLIC LICENSE
+               Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+              59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+            GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+             END OF TERMS AND CONDITIONS
+
+        How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/docs/phpthumb.readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,549 @@
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+//       This code is released under the GNU GPL:           //
+//         http://www.gnu.org/copyleft/gpl.html             //
+//                                                          //
+//    +-----------------------------------------------+     //
+//    | phpThumb() is free to use according to the    |     //
+//    | terms of the GPL. Donations also gratefully   |     //
+//    | GPL FAQ: http://gnu.org/licenses/gpl-faq.html |     //
+//    |                                               |     //
+//    | Donations are gratefully accepted from happy  |     //
+//    | users :)  See http://phpthumb.sourceforge.net |     //
+//    |                                               |     //
+//    | If you like phpThumb(), please consider       |     //
+//    | writing a review at HotScripts.com:           |     //
+//    | http://www.hotscripts.com/Detailed/25654.html |     //
+//    |                                               |     //
+//    | If you do use this code somewhere, send me    |     //
+//    | an email and tell me how/where you used it.   |     //
+//    +-----------------------------------------------+     //
+//                                                         ///
+//////////////////////////////////////////////////////////////
+
+============
+Description:
+============
+
+phpThumb() uses the GD library to create thumbnails from
+images (GIF, PNG or JPEG) on the fly. The output size is
+configurable (can be larger or smaller than the source),
+and the source may be the entire image or only a portion
+of the original image. True color and resampling is used
+if GD v2.0+ is available, otherwise low-color and simple
+resizing is used. Source image can be a physical file on
+the server or can be retrieved from a database. GIFs are
+supported on all versions of GD even if GD does not have
+native GIF support thanks to the GIFutil class by Fabien
+Ezber. AntiHotlinking feature prevents other people from
+using your server to resize their thumbnails, or link to
+your  images  from  another  server.  The  cache feature
+reduces server load.
+
+
+========
+Support:
+========
+
+First, read this file.
+Then read phpthumb.faq.txt
+Then run /demo/phpThumb.demo.check.php
+If you still think it's a bug, email info at silisoftware.com
+
+
+======
+Usage:
+======
+
+Call phpThumb() just like you would a normal image.
+Examples:
+ <IMG SRC="phpThumb.php?src=/image.jpg&w=100">
+ <IMG SRC="phpThumb.php?src=http://example.com/foo.jpg">
+See the "demo" link on http://phpthumb.sourceforge.net
+for more usage examples). Parameters that can be passed
+are listed below under "URL Parameters".
+
+NOTE: It's recommended you use the local image filename
+wherever possible (rather than http://) because performance
+is much better, less (or no) use of temp files, and the
+last-modified check for cached files doesn't work for
+remote files.
+
+To access files over a LAN with Windows share names you
+must use the network name (or IP) and not a mapped drive
+name, for example:
+  //othercomputer/file.jpg - good
+  //192.168.2.1/file.jpg - good
+  z:/file.jpg - won't work
+This is a PHP limitation (see www.php.net/file-exists)
+Note: you may want to use "/" slashes instead of "\" if
+you have magic_quotes_gpc enabled to avoid stripslashes
+problems, although either slash should work if
+magic_quotes_gpc is disabled
+
+
+================================
+Alternate PATH_INFO-style Usage:
+================================
+
+phpThumb.php can also be called by passing parameters not
+after the usual "?" but like this:
+  phpThumb.php/<params>=<values>;<w>x<h>;<image>
+For example:
+  phpThumb.php/100;pic.jpg
+  phpThumb.php/100;images/pic.jpg
+  phpThumb.php/100;/images/pic.jpg
+  phpThumb.php/100x200;pic.jpg
+  phpThumb.php/x200;pic.jpg
+  phpThumb.php/f=jpeg;q=50;100x200;pic.jpg
+  phpThumb.php/fltr[]=usm;100;pic.jpg
+
+<image> must be the last item. Dimensions must be the second-
+last item. As many key/value pairs for parameters can be
+passed before those last two items, with each pair joined by
+equals ("=") and seperated by semicolon (";")
+
+
+==============================================
+Calling as an object (not using phpThumb.php):
+==============================================
+
+NOTE: most people don't need to and should not do this.
+If you just want to display resized images, please just
+use phpThumb.php, not the object mode. To render output
+to one (or more) files instead of the browser, you should
+skip phpThumb.php and instantiate your own object. Please
+take a look at /demo/phpThumb.demo.object.php for details.
+
+Note: phpThumb.php is where the caching code is located, if
+  you instantiate your own phpThumb() object that code is
+  bypassed and it's up to you to handle the reading and
+  writing of cached files.
+
+
+==============
+Configuration:
+==============
+
+There are some configuration options you may (but are
+not required to) change. Most configuration options can
+be set when you call phpThumb() - see list below), but
+default configuration options (such as cache directory)
+are in phpThumb.config.php - this is the only file you
+should ever modify.
+
+The configuration file is distributed as
+phpThumb.config.php.default to prevent accidental
+overwriting of old configuration settings. Please
+migrate your old settings to the new file (if upgrading),
+or delete your old config and rename the default to
+phpThumb.config.php
+
+
+The amount of memory required for phpThumb depends on
+several factors: the dimensions of the source image,
+the dimensions of the output image, whether unsharp
+masking is applied, whether watermarks are applied, etc.
+The auto-detection of memory limits works as a general
+"safe" value. You may be able to exceed the auto value
+by a small or large amount, depending on whether you
+apply watermarks and/or sharpening, and the output size
+of your thumbnails. I do not currently have a reliable
+formula for calculating such things, but I will attempt
+to craft one for future versions of phpThumb(). Until
+then, set "max_source_pixels" in phpThumb.config.php to a
+value that works well for you (or leave it alone if the
+defaults give you no problems).
+
+The configuration options you should maybe modify are:
+* cache_directory - thumbnailing is slow and processor-
+    intensive. Enabling caching will dramatically speed
+    up future thumbnail serving
+* max_source_pixels - This should be auto-detected, but
+    if auto-detection fails and you get an invalid image
+    from large source images, set this to about 20% of
+    your available PHP memory limit.
+* imagemagick_path - If the source image is larger than
+    max_source_pixels allows, but ImageMagick is available
+    phpThumb() will use it to generate the thumbnail.
+
+
+///////////////////////////////////////////////////////////
+Note: High-Security mode is recommended enabled if possible.
+  Set $PHPTHUMB_CONFIG['high_security_enabled'] in
+  phpThumb.config.php to enable it. Each call to phpThumb
+  needs to be made through the function supplied at the
+  bottom of phpThumb.config.php which create the hash:
+    require_once('phpThumb.config.php');
+    echo '<img src="'.phpThumbURL('src=pic.jpg&w=50').'">';
+///////////////////////////////////////////////////////////
+
+
+===============
+URL Parameters:
+===============
+
+ src = filename of source image
+ new = create new image, not thumbnail of existing image.
+       Requires "w" and "h" parameters set.
+       [ex: &new=FF0000|75] - red background, 75% opacity
+       Set to hex color string of background. Opacity is
+       optional (defaults to 100% opaque).
+   w = max width of output thumbnail in pixels
+   h = max height of output thumbnail in pixels
+  wp = max width for portrait images
+  hp = max height for portrait images
+  wl = max width for landscape images
+  hl = max height for landscape images
+  ws = max width for square images
+  hs = max height for square images
+   f = output image format ("jpeg", "png", or "gif")
+   q = JPEG compression (1=worst, 95=best, 75=default)
+  sx = left side of source rectangle (default = 0)
+       (values 0 < sx < 1 represent percentage)
+  sy = top side of source rectangle (default = 0)
+       (values 0 < sy < 1 represent percentage)
+  sw = width of source rectangle (default = fullwidth)
+       (values 0 < sw < 1 represent percentage)
+  sh = height of source rectangle (default = fullheight)
+       (values 0 < sh < 1 represent percentage)
+  zc = zoom-crop. Will auto-crop off the larger dimension
+       so that the image will fill the smaller dimension
+       (requires both "w" and "h"). Set "zc=1" to enable.
+       (overrides both "iar" and "far")
+  bg = background hex color (default = FFFFFF)
+  bc = border hex color (default = 000000)
+fltr = filter system. Call as an array as follows:
+       - "brit" (Brightness) [ex: &fltr[]=brit|<value>]
+         where <value> is the amount +/- to adjust brightness
+         (range -255 to 255)
+         Availble in PHP5 with bundled GD only.
+       - "cont" (Constrast) [ex: &fltr[]=cont|<value>]
+         where <value> is the amount +/- to adjust contrast
+         (range -255 to 255)
+         Availble in PHP5 with bundled GD only.
+       - "gam" (Gamma Correction) [ex: &fltr[]=gam|<value>]
+         where <value> can be a number >0 to 10+ (default 1.0)
+         Must be >0 (zero gives no effect). There is no max,
+         although beyond 10 is pretty useless. Negative
+         numbers actually do something, maybe not quite the
+         desired effect, but interesting nonetheless.
+       - "sat" (SATuration) [ex: &fltr[]=sat|<value>]
+         where <value> is a number between zero (no change)
+         and -100 (complete desaturation = grayscale), or it
+         can be any positive number for increased saturation.
+       - "ds" (DeSaturate) [ex: &fltr[]=ds|<value>]
+         is an alias for "sat" except values are inverted
+         (positive values remove color, negative values boost
+         saturation)
+       - "gray" (Grayscale) [ex: &fltr[]=gray]
+         remove all color from image, make it grayscale
+       - "th" (Threshold) [ex: &fltr[]=th|<value>]
+         makes image greyscale, then sets all pixels brighter
+         than <value> (range 0-255) to white, and all pixels
+         darker than <value> to black
+       - "rcd" (Reduce Color Depth) [ex: &fltr[]=rcd|<c>|<d>]
+         where <c> is the number of colors (2-256) you want
+         in the output image, and <d> is "1" for dithering
+         (deault) or "0" for no dithering
+       - "clr" (Colorize) [ex: &fltr[]=clr|<value>|<color>]
+         where <value> is a number between 0 and 100 for the
+         amount of colorization, and <color> is the hex color
+         to colorize to.
+       - "sep" (Sepia) [ex: &fltr[]=sep|<value>|<color>]
+         where <value> is a number between 0 and 100 for the
+         amount of colorization (default=50), and <color> is
+         the hex color to colorize to (default=A28065).
+         Note: this behaves differently when applied by
+         ImageMagick, in which case 80 is default, and lower
+         values give brighter/yellower images and higher
+         values give darker/bluer images
+       - "usm" (UnSharpMask) [ex: &fltr[]=usm|<a>|<r>|<t>]
+         where <a> is the amount (default = 80), <r> is the
+         radius (default = 0.5), <t> is the threshold
+         (default = 3).
+       - "blur" (Blur) [ex: &fltr[]=blur|<radius>]
+         where (0 < <radius> < 25) (default = 1)
+       - "gblr" (Gaussian Blur) [ex: &fltr[]=gblr]
+         Availble in PHP5 with bundled GD only.
+       - "sblr" (Selective Blur) [ex: &fltr[]=gblr]
+         Availble in PHP5 with bundled GD only.
+       - "smth" (Smooth) [ex: &fltr[]=smth|<value>]
+         where <value> is the weighting value for the matrix
+         (range -10 to 10, default 6)
+         Availble in PHP5 with bundled GD only.
+       - "lvl" (Levels) [ex: &fltr[]=lvl|<channel>|<min>|<max>
+         where <channel> can be one of 'r', 'g', 'b', 'a' (for
+         Red, Green, Blue, Alpha respectively), or '*' for all
+         channels based on average grayscale value (default).
+         <min> and <max> are the clip points for the levels
+         and are set to clip 0.1% of each end by default.
+         (range = 0-255) and are set to clip 0.1% of each end
+         by default. Use -1 for min and/or max to invoke auto-
+         detect mode. Using default parameters (&fltr[]=lvl)
+         is similar to Auto Contrast in Adobe Photoshop.
+       - "wb" (White Balance) [ex: &fltr[]=wb|<c>]
+         where <c> is the target hex color to white balance
+         on, this color is what "should be" white, or light
+         gray. The filter attempts to maintain brightness so
+         any gray color can theoretically be used. If <c> is
+         omitted the filter guesses based on brightest pixels
+         in each of RGB
+       - "hist" (Histogram)
+         [ex: &fltr[]=hist|<b>|<c>|<w>|<h>|<a>|<o>|<m>]
+         Where <b> is the color band(s) to display, from back
+         to front (one or more of "rgba*" for Red Green Blue
+         Alpha and Grayscale respectively);
+         <c> is a semicolon-seperated list of hex colors to
+         use for each graph band (defaults to FF0000, 00FF00,
+         0000FF, 999999, FFFFFF respectively);
+         <w> and <h> are the width and height of the overlaid
+         histogram in pixels, or if <= 1 then percentage of
+         source image width/height;
+         <a> is the alignment (same as for "wmi" and "wmt");
+         <o> is opacity from 0 (transparent) to 100 (opaque)
+             (requires PHP v4.3.2, otherwise 100% opaque);
+         <m> is the edge (and inter-tile) margin in percent
+       - "over" (OVERlay/underlay image) overlays an image on
+         the thumbnail, or overlays the thumbnail on another
+         image (to create a picture frame for example)
+         [ex: &fltr[]=over|<i>|<u>|<m>|<o>]
+         where <i> is the image filename; <u> is "0" (default)
+         for overlay the image on top of the thumbnail or "1"
+         for overlay the thumbnail on top of the image; <m> is
+         the margin - can be absolute pixels, or if < 1 is a
+         percentage of the thumbnail size [must be < 0.5]
+         (default is 0 for overlay and 10% for underlay);
+         <o> is opacity (0 = transparent, 100 = opaque)
+             (requires PHP v4.3.2, otherwise 100% opaque);
+         (thanks raynerapeØgmail*com, shabazz3Ømsu*edu)
+       - "wmi" (WaterMarkImage)
+         [ex: &fltr[]=wmi|<f>|<a>|<o>|<m>] where
+         <f> is the filename of the image to overlay;
+         <a> is the alignment (one of BR, BL, TR, TL, C,
+             R, L, T, B, *) where B=bottom, T=top, L=left,
+             R=right, C=centre, *=tile);
+         <o> is opacity from 0 (transparent) to 100 (opaque)
+             (requires PHP v4.3.2, otherwise 100% opaque);
+         <m> is the edge (and inter-tile) margin in percent
+       - "wmt" (WaterMarkText)
+         [ex: &fltr[]=wmt|<t>|<s>|<a>|<c>|<f>|<o>|<m>|<n>|<b>|<O>|<x>]
+         where:
+         <t> is the text to use as a watermark;
+             URLencoded Unicode HTMLentities must be used for
+               characters beyond chr(127). For example, the
+               "eighth note" character (U+266A) is represented
+               as "&#9834;" and then urlencoded to "%26%239834%3B"
+             Any instance of metacharacters will be replaced
+             with their calculated value. Currently supported:
+               ^Fb = source image filesize in bytes
+               ^Fk = source image filesize in kilobytes
+               ^Fm = source image filesize in megabytes
+               ^X  = source image width in pixels
+               ^Y  = source image height in pixels
+               ^x  = thumbnail width in pixels
+               ^y  = thumbnail height in pixels
+               ^^  = the character ^
+         <s> is the font size (1-5 for built-in font, or point
+           size for TrueType fonts);
+         <a> is the alignment (one of BR, BL, TR, TL, C, R, L,
+           T, B, * where B=bottom, T=top, L=left, R=right,
+           C=centre, *=tile);
+         <c> is the hex color of the text;
+         <f> is the filename of the TTF file (optional, if
+           omitted a built-in font will be used);
+         <o> is opacity from 0 (transparent) to 100 (opaque)
+             (requires PHP v4.3.2, otherwise 100% opaque);
+         <m> is the edge (and inter-tile) margin in percent;
+         <n> is the angle
+         <b> is the hex color of the background;
+         <O> is background opacity from 0 (transparent) to
+             100 (opaque)
+             (requires PHP v4.3.2, otherwise 100% opaque);
+         <x> is the direction(s) in which the background is
+             extended (either 'x' or 'y' (or both, but both
+             will obscure entire image))
+             Note: works with TTF fonts only, not built-in
+       - "flip" [ex: &fltr[]=flip|x   or   &fltr[]=flip|y]
+         flip image on X or Y axis
+       - "ric" [ex: &fltr[]=ric|<x>|<y>]
+         rounds off the corners of the image (to transparent
+         for PNG output), where <x> is the horizontal radius
+         of the curve and <y> is the vertical radius
+       - "elip" [ex: &fltr[]=elip]
+         similar to rounded corners but more extreme
+       - "mask" [ex: &fltr[]=mask|filename.png]
+         greyscale values of mask are applied as the alpha
+         channel to the main image. White is opaque, black
+         is transparent.
+       - "bvl" (BeVeL) [ex: &fltr[]=bvl|<w>|<c1>|<c2>]
+         where <w> is the bevel width, <c1> is the hex color
+         for the top and left shading, <c2> is the hex color
+         for the bottom and right shading
+       - "bord" (BORDer) [ex: &fltr[]=bord|<w>|<rx>|<ry>|<c>
+         where <w> is the width in pixels, <rx> and <ry> are
+         horizontal and vertical radii for rounded corners,
+         and <c> is the hex color of the border
+       - "fram" (FRAMe) draws a frame, similar to "bord" but
+         more configurable
+         [ex: &fltr[]=fram|<w1>|<w2>|<c1>|<c2>|<c3>]
+         where <w1> is the width of the main border, <w2> is
+         the width of each side of the bevel part, <c1> is the
+         hex color of the main border, <c2> is the highlight
+         bevel color, <c3> is the shadow bevel color
+       - "drop" (DROP shadow)
+         [ex: &fltr[]=drop|<d>|<w>|<clr>|<a>]
+         where <d> is distance from image to shadow, <w> is
+         width of shadow fade (not yet implemented), <clr> is
+         the hex color of the shadow, and <a> is the angle of
+         the shadow (default=225)
+       - "crop" (CROP image)
+         [ex: &fltr[]=crop|<l>|<r>|<t>|<b>]
+         where <l> is the number of pixels to crop from the left
+         side of the resized image; <r>, <t>, <b> are for right,
+         top and bottom respectively. Where (0 < x < 1) the
+         value will be used as a percentage of width/height.
+         Left and top crops take precedence over right and
+         bottom values. Cropping will be limited such that at
+         least 1 pixel of width and height always remains.
+file = if set then thumbnail will be rendered to this
+       filename, not output and not cached.
+       (Deprecated. Disabled by default since v1.6.0.
+       You should instantiate your own object instead)
+goto = URL to redirect to after rendering image to file
+       * Must begin with "http://"
+       * Requires file parameter set
+       (Deprecated. Disabled by default since v1.6.0.
+       You should instantiate your own object instead)
+ err = custom error image filename instead of showing
+       error messages (for use on production sites)
+md5s = MD5 hash of the source image -- if this parameter is
+       passed with the hash of the source image then the
+       source image is not checked for existance or
+       modification and the cached file is used (if
+       available). If 'md5s' is passed an empty string then
+       phpThumb.php dies and outputs the correct MD5 hash
+       value.  This parameter is the single-file equivalent
+       of 'cache_source_filemtime_ignore_*' configuration
+       paramters
+ xto = EXIF Thumbnail Only - set to only extract EXIF
+       thumbnail and not do any additional processing
+  ra = Rotate by Angle: angle of rotation in degrees
+       positive = counterclockwise, negative = clockwise
+  ar = Auto Rotate: set to "x" to use EXIF orientation
+       stored by camera. Can also be set to "l" or "L"
+       for landscape, or "p" or "P" for portrait. "l"
+       and "P" rotate the image clockwise, "L" and "p"
+       rotate the image counter-clockwise.
+ aoe = Output Allow Enlarging - override the setting for
+       $CONFIG['output_allow_enlarging'] (1=on, 0=off)
+       ("far" and "iar" both override this and allow output
+       larger than input)
+ iar = Ignore Aspect Ratio - disable proportional resizing
+       and stretch image to fit "h" & "w" (which must both
+       be set).  (1=on, 0=off)  (overrides "far")
+ far = Force Aspect Ratio - image will be created at size
+       specified by "w" and "h" (which must both be set).
+       Alignment: L=left,R=right,T=top,B=bottom,C=center
+       BL,BR,TL,TR use the appropriate direction if the
+       image is landscape or portrait.
+maxb = MAXimum Byte size - output quality is auto-set to
+       fit thumbnail into "maxb" bytes  (compression
+       quality is adjusted for JPEG, bit depth is adjusted
+       for PNG and GIF)
+down = filename to save image to. If this is set the
+       browser will prompt to save to this filename rather
+       than display the image
+
+
+
+==============
+General Notes:
+==============
+
+* Always use the local image filename wherever possible
+  rather than a full http:// URL because performance is
+  much better, less (or no) use of temp files, and the
+  last-modified check for cached files doesn't work for
+  remote files. For example:
+   good: phpThumb.php?src=/images/nicepic.jpg
+    bad: phpThumb.php?src=/home/httpd/example/images/nicepic.jpg
+  worse: phpThumb.php?src=http://example.com/images/nicepic.jpg
+
+* Thumbnails will be scaled proportionately to fit in a
+  box of at most (width * height) pixels
+  (unless "iar" is set)
+
+* Thumbnail caching for URL or database sources requires
+  an absolute directory name for $config_cache_directory
+  Physical file cached thumbnails will be recreated if
+  the source file changes, but remote/database files
+  cannot (modification time isn't readily available)
+
+* If you need a GUI interface to phpThumb(), or for a user
+  to specify crop settings, or something like that please
+  see the list of known programs in /demo/readme.demos.txt
+
+* Cropping images can be specified with either exact pixel
+  values for sx/sy/sw/sh parameters, or if those are set
+  to a value >0 and <1 then these are interpreted as a
+  percentage of the source image width/height. For example,
+  to crop 25% off all sides, you would specify parameters:
+  phpThumb.php?src=pic.jpg&sx=.25&sy=.25&sw=.5&sh=.5
+
+* phpThumb() may have tempfile access issues on servers
+  where Safe Mode is enabled, specificly when accessing
+  a file over HTTP, or when a non-bundled version of GD
+  is in use. Specifying "config_temp_directory" may help
+
+* Properly resolving /~user/ style filenames requires
+  apache_lookup_uri(), which is missing or broken in
+  Apache2, or if PHP is not installed as an Apache module.
+  phpThumb() does try and work around this if it is
+  unavailble, but you may have to specify a full filename
+  for "src" if you encounter problems.
+
+* phpThumb() should work with PHP v4.0.6+, but seems to
+   have a few quirks before v4.1.0
+  EXIF thumbnail extraction requires PHP v4.2.0+
+  Image rotation requires PHP v4.3.0+. There have been
+    reports of problems with PHP older than v4.3.3
+  Some image filters require PHP v5.0.0+
+  Run /demo/phpThumb.demo.check.php to examine your server
+
+* phpThumb() works better and faster when ImageMagick is
+  available. Most functions will work with only GD2, but
+  speed is much faster with ImageMagick, and much larger
+  images can be processed with ImageMagick than GD.
+
+* phpThumb() works with GD v1.x, but works better with
+   GD v2.0+ because of the true-color image support
+   and ImageCopyResampled(). Also, there appears to be a
+   bug in ImageCopyResized() which is used with GD v1.x
+   where the bottom and/or right line of pixels is set
+   to the background color (due to a rounding error?)
+  NOTE: Please use the bundled version of GD if at all
+   possible (with PHP v4.3.0+) because the non-bundled
+   version has bugs which may cause PHP to crash:
+   * http://bugs.php.net/bug.php?id=21518
+   * http://bugs.php.net/bug.php?id=24174
+   phpThumb() has a workaround for the above bug but
+   there may be other bugs, and the workaround is slow.
+  Alpha transparent output requires GD >= 2.0.1 and
+   PHP >= 4.3.2
+  Most (if not all) filters require GD v2.x to function
+   at all. But many filters can be handled by ImageMagick
+   instead of GD.
+
+* Filters handled by ImageMagick or GD:
+  - brit;cont;ds;sat;gray;clr;sep;gam;neg;th;rcd;flip;edge;
+    emb;lvl;blur;gblr;usm;
+* Filters handled only by ImageMagick:
+  - none yet
+* Filters handled only by GD + PHP5:
+  - sblr;mean;smth;
+* Filters handled only by GD2:
+  - bvl;wmi;wmt;over;wb;hist;fram;drop;mask;elip;ric;bord;

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3 @@
+<?php
+header('Location: demo/phpThumb.demo.demo1.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.config.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.config.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.config.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,232 @@
+<?php
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+// See: phpthumb.readme.txt for usage instructions          //
+//                                                         ///
+//////////////////////////////////////////////////////////////
+
+include_once('../../../../../../../includes/configure.php');
+
+ob_start();
+if (!file_exists(dirname(__FILE__).'/phpthumb.functions.php') || !include_once(dirname(__FILE__).'/phpthumb.functions.php')) {
+  ob_end_flush();
+  die('failed to include_once(phpthumb.functions.php) - realpath="'.realpath(dirname(__FILE__).'/phpthumb.functions.php').'"');
+}
+ob_end_clean();
+
+// START USER CONFIGURATION SECTION:
+
+// * DocumentRoot configuration
+$PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && ereg('^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))), realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__))));
+
+// * Cache directory configuration (choose only one of these - leave the other lines commented-out):
+$PHPTHUMB_CONFIG['cache_directory'] = DIR_FS_CATALOG.'cache/phpthumb/'; // set the cache directory to an absolute directory for all source images
+
+$PHPTHUMB_CONFIG['cache_disable_warning'] = false; // If [cache_directory] is non-existant or not writable, and [cache_disable_warning] is false, an error image will be generated warning to either set the cache directory or disable the warning (to avoid people not knowing about the cache)
+
+
+// * Cache culling: phpThumb can automatically limit the contents of the cache directory
+//   based on last-access date and/or number of files and/or total filesize.
+
+//$PHPTHUMB_CONFIG['cache_maxage'] = null;            // never delete cached thumbnails based on last-access time
+$PHPTHUMB_CONFIG['cache_maxage'] = 86400 * 7;        // delete cached thumbnails that haven't been accessed in more than [90 days] (value is maximum time since last access in seconds to avoid deletion)
+
+//$PHPTHUMB_CONFIG['cache_maxsize'] = null;           // never delete cached thumbnails based on byte size of cache directory
+$PHPTHUMB_CONFIG['cache_maxsize'] = 10 * 1024 * 1024; // delete least-recently-accessed cached thumbnails when more than [10MB] of cached files are present (value is maximum bytesize of all cached files)
+
+//$PHPTHUMB_CONFIG['cache_maxfiles'] = null;          // never delete cached thumbnails based on number of cached files
+$PHPTHUMB_CONFIG['cache_maxfiles'] = 500;             // delete least-recently-accessed cached thumbnails when more than [500] cached files are present (value is maximum number of cached files to keep)
+
+
+// * Source image cache configuration
+$PHPTHUMB_CONFIG['cache_source_enabled']   = false;                               // if true, source images obtained via HTTP are cached to $PHPTHUMB_CONFIG['cache_source_directory']
+$PHPTHUMB_CONFIG['cache_source_directory'] = dirname(__FILE__).'/cache/source/';  // set the cache directory for unprocessed source images
+
+// * cache source modification date configuration
+$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_local']  = false; // if true, local source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed
+$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_remote'] = true;  // if true, remote source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed. WARNING: cached performance MUCH slower if this is set to false.
+
+
+// * Simplified cache filename configuration
+// Instead of creating unique cache filenames for all parameter combinations, create "simple" cache files (eg: "pic_thumb.jpg")
+// If cache_default_only_suffix is non-empty, GETstring parameters (except 'src') are ignored and only $PHPTHUMB_DEFAULTS
+// parameters (set at the bottom of phpThumb.config.php) are used for processing.
+// The '*' character MUST be used to represent the source image name
+$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '';           // cached in normal phpThumb manner
+//$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '*_thumb';  // cache 'pic.jpg' becomes 'pic_thumb.jpg' (or 'pic_thumb.png' if PNG output is selected, etc)
+//$PHPTHUMB_CONFIG['cache_default_only_suffix'] = 'small-*';  // cache 'pic.jpg' becomes 'small-pic.jpg' (or 'small-pic.png' if PNG output is selected, etc)
+
+$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache_'.str_replace('www.', '', @$_SERVER['SERVER_NAME']);
+//$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache';                         // allow phpThumb to share 1 set of cached files even if accessed under different servername/domains on same server
+
+$PHPTHUMB_CONFIG['cache_force_passthru'] = true;  // if true, cached image data will always be passed to browser; if false, HTTP redirect will be used instead
+
+
+
+// * Temp directory configuration
+// phpThumb() may need to create temp files. Usually the system temp dir is writable and can be used.
+// Leave this value as NULL in most cases. If you get errors about "failed to open <filename> for writing"
+// you should change this to a full pathname to a directory you do have write access to.
+$PHPTHUMB_CONFIG['temp_directory'] = DIR_FS_CATALOG . 'tmp';
+//$PHPTHUMB_CONFIG['temp_directory'] = null;
+
+
+// maximum number of pixels in source image to attempt to process entire image.
+// If this is zero then no limit on source image dimensions.
+// If this is nonzero then this is the maximum number of pixels the source image
+// can have to be processed normally, otherwise the embedded EXIF thumbnail will
+// be used (if available) or an "image too large" notice will be displayed.
+// This is to be used for large source images (> 1600x1200) and low PHP memory
+// limits. If PHP runs out of memory the script will usually just die with no output.
+// To calculate this number, multiply the dimensions of the largest image
+// you can process with your memory limitation (e.g. 1600 * 1200 = 1920000)
+// As a general guideline, this number will be about 20% of your PHP memory
+// configuration, so 8M = 1,677,722; 16M = 3,355,443; 32M = 6,710,886; etc.
+if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.2', '>=') && !defined('memory_get_usage') && !@ini_get('memory_limit')) {
+  // memory_get_usage() will only be defined if your PHP is compiled with the --enable-memory-limit configuration option.
+  $PHPTHUMB_CONFIG['max_source_pixels'] = 0;         // no memory limit
+} else {
+  // calculate default max_source_pixels as 20% of memory limit configuration
+  $PHPTHUMB_CONFIG['max_source_pixels'] = round(max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576 * 0.20);
+  //$PHPTHUMB_CONFIG['max_source_pixels'] = 0;       // no memory limit
+  //$PHPTHUMB_CONFIG['max_source_pixels'] = 1920000; // allow 1600x1200 images (2Mpx), no larger (about 10MB memory required)
+  //$PHPTHUMB_CONFIG['max_source_pixels'] = 3355443; // 16MB memory limit
+  //$PHPTHUMB_CONFIG['max_source_pixels'] = 3871488; // allow 2272x1704 images (4Mpx), no larger (about 16MB memory required)
+}
+
+
+// ImageMagick configuration
+// If source image is larger than available memory limits as defined above in
+// 'max_source_pixels' AND ImageMagick's "convert" program is available, phpThumb()
+// will call ImageMagick to perform the thumbnailing of the source image to bypass
+// the memory limitation. Leaving the value as NULL will cause phpThumb() to
+// attempt to detect ImageMagick's presence with `which`
+if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
+  // Windows: set absolute pathname
+  $PHPTHUMB_CONFIG['imagemagick_path'] = 'C:/Program Files/ImageMagick-6.2.5-Q16/convert.exe';
+} else {
+  // *nix: set absolute pathname to "convert", or leave as null if "convert" is in the path
+  $PHPTHUMB_CONFIG['imagemagick_path'] = '/usr/local/bin/convert';
+  //$PHPTHUMB_CONFIG['imagemagick_path'] = null;
+}
+
+
+// * Default output configuration:
+$PHPTHUMB_CONFIG['output_format']    = 'jpeg'; // default output format ('jpeg', 'png' or 'gif') - thumbnail will be output in this format (if available in your version of GD). This is always overridden by ?f=___ GETstring parameter
+$PHPTHUMB_CONFIG['output_maxwidth']  = 0;      // default maximum thumbnail width.  If this is zero then default width  is the width  of the source image. This is always overridden by ?w=___ GETstring parameter
+$PHPTHUMB_CONFIG['output_maxheight'] = 0;      // default maximum thumbnail height. If this is zero then default height is the height of the source image. This is always overridden by ?h=___ GETstring parameter
+$PHPTHUMB_CONFIG['output_interlace'] = true;   // if true: interlaced output for GIF/PNG, progressive output for JPEG; if false: non-interlaced for GIF/PNG, baseline for JPEG.
+
+// * Error message configuration
+$PHPTHUMB_CONFIG['error_image_width']           = 150;      // default width for error images
+$PHPTHUMB_CONFIG['error_image_height']          = 150;      // default height for error images
+$PHPTHUMB_CONFIG['error_message_image_default'] = '';       // Set this to the name of a generic error image (e.g. '/images/error.png') that you want displayed in place of any error message that may occur. This setting is overridden by the 'err' parameter, which does the same thing.
+$PHPTHUMB_CONFIG['error_bgcolor']               = 'CCCCFF'; // background color of error message images
+$PHPTHUMB_CONFIG['error_textcolor']             = 'FF0000'; // color of text in error messages
+$PHPTHUMB_CONFIG['error_fontsize']              = 1;        // size of text in error messages, from 1 (smallest) to 5 (largest)
+$PHPTHUMB_CONFIG['error_die_on_error']          = true;     // die with error message on any fatal error (recommended with standalone phpThumb.php)
+$PHPTHUMB_CONFIG['error_silent_die_on_error']   = false;    // simply die with no output of any kind on fatal errors (not recommended)
+$PHPTHUMB_CONFIG['error_die_on_source_failure'] = true;     // die with error message if source image cannot be processed by phpThumb() (usually because source image is corrupt in some way). If false the source image will be passed through unprocessed, if true (default) an error message will be displayed.
+
+// * Off-server Thumbnailing Configuration:
+$PHPTHUMB_CONFIG['nohotlink_enabled']           = true;                                     // If false will allow thumbnailing from any source domain
+$PHPTHUMB_CONFIG['nohotlink_valid_domains']     = array(@$_SERVER['HTTP_HOST']);            // This is the list of domains for which thumbnails are allowed to be created. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format 'www.example.com'
+$PHPTHUMB_CONFIG['nohotlink_erase_image']       = true;                                     // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail
+$PHPTHUMB_CONFIG['nohotlink_text_message']      = 'Off-server thumbnailing is not allowed'; // text of error message
+
+// * Off-server Linking Configuration:
+$PHPTHUMB_CONFIG['nooffsitelink_enabled']       = true;                                       // If false will allow thumbnails to be linked to from any domain, if true only domains listed below in 'nooffsitelink_valid_domains' will be allowed.
+$PHPTHUMB_CONFIG['nooffsitelink_valid_domains'] = array(@$_SERVER['HTTP_HOST']);              // This is the list of domains for which thumbnails are allowed to be created. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format 'www.example.com'
+$PHPTHUMB_CONFIG['nooffsitelink_require_refer'] = false;                                      // If false will allow standalone calls to phpThumb(). If true then only requests with a $_SERVER['HTTP_REFERER'] value in 'nooffsitelink_valid_domains' are allowed.
+$PHPTHUMB_CONFIG['nooffsitelink_erase_image']   = true;                                       // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail
+$PHPTHUMB_CONFIG['nooffsitelink_text_message']  = 'Image taken from '.@$_SERVER['HTTP_HOST']; // text of error message
+
+
+// * Border & Background default colors
+$PHPTHUMB_CONFIG['border_hexcolor']     = '000000'; // Default border color - usual HTML-style hex color notation (overidden with 'bc' parameter)
+$PHPTHUMB_CONFIG['background_hexcolor'] = 'FFFFFF'; // Default background color when thumbnail aspect ratio does not match fixed-dimension box - usual HTML-style hex color notation (overridden with 'bg' parameter)
+
+// * Watermark configuration
+$PHPTHUMB_CONFIG['ttf_directory'] = dirname(__FILE__).'/fonts'; // Base directory for TTF font files
+//$PHPTHUMB_CONFIG['ttf_directory'] = 'c:/windows/fonts';
+
+
+// * MySQL configuration
+// You may want to pull data from a database rather than a physical file
+// If so, modify the $PHPTHUMB_CONFIG['mysql_query'] line to suit your database structure
+// Note: the data retrieved must be the actual binary data of the image, not a URL or filename
+// see http://www.billy-corgan.com/blog/archive/000143.php for a brief tutorial on this section
+
+$PHPTHUMB_CONFIG['mysql_query'] = '';
+//$PHPTHUMB_CONFIG['mysql_query'] = 'SELECT `picture` FROM `products` WHERE (`id` = \''.mysql_escape_string(@$_GET['id']).'\')';
+
+// These 4 values must be modified if $PHPTHUMB_CONFIG['mysql_query'] is not empty, but may be ignored if $PHPTHUMB_CONFIG['mysql_query'] is blank.
+$PHPTHUMB_CONFIG['mysql_hostname'] = 'localhost';
+$PHPTHUMB_CONFIG['mysql_username'] = '';
+$PHPTHUMB_CONFIG['mysql_password'] = '';
+$PHPTHUMB_CONFIG['mysql_database'] = '';
+
+
+// * Security configuration
+$PHPTHUMB_CONFIG['high_security_enabled']    = false;  // if enabled, requires 'high_security_password' set to at least 5 characters, and requires the use of phpThumbURL() function (at the bottom of phpThumb.config.php) to generate hashed URLs
+$PHPTHUMB_CONFIG['high_security_password']   = '';     // required if 'high_security_enabled' is true, must be at least 5 characters long
+$PHPTHUMB_CONFIG['disable_debug']            = false;  // prevent phpThumb from displaying any information about your system. If true, phpThumbDebug and error messages will be disabled
+$PHPTHUMB_CONFIG['allow_src_above_docroot']  = false;  // if true, allow src to be anywhere in filesystem; if false (default) only allow src within document_root
+$PHPTHUMB_CONFIG['allow_src_above_phpthumb'] = true;   // if true (default), allow src to be anywhere in filesystem; if false only allow src within sub-directory of phpThumb installation
+$PHPTHUMB_CONFIG['allow_parameter_file']     = false;  // if true, allow use of 'file' parameter; if false (default) the 'file' parameter is disabled/ignored
+$PHPTHUMB_CONFIG['allow_parameter_goto']     = false;  // if true, allow use of 'goto' parameter; if false (default) the 'goto' parameter is disabled/ignored
+
+
+// * HTTP UserAgent configuration
+//$PHPTHUMB_CONFIG['http_user_agent'] = '';                                                                                      // PHP default: none
+//$PHPTHUMB_CONFIG['http_user_agent'] = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';                                    // Windows XP, Internet Explorer
+$PHPTHUMB_CONFIG['http_user_agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7'; // Windows XP, Firefox
+
+
+// * Compatability settings
+$PHPTHUMB_CONFIG['disable_pathinfo_parsing']        = false;  // if true, $_SERVER[PATH_INFO] is not parsed. May be needed on some server configurations to allow normal behavior.
+$PHPTHUMB_CONFIG['disable_imagecopyresampled']      = false;  // if true, ImageCopyResampled is replaced with ImageCopyResampleBicubic. May be needed for buggy versions of PHP-GD.
+$PHPTHUMB_CONFIG['disable_onlycreateable_passthru'] = true;   // if true, any image that can be parsed by GetImageSize() can be passed through; if false, only images that can be converted to GD by ImageCreateFrom(JPEG|GIF|PNG) functions are allowed
+
+
+// * Speed optimizations configuration
+$PHPTHUMB_CONFIG['prefer_imagemagick']           = true;  // If true, use ImageMagick to resize thumbnails if possible, since it is usually faster than GD functions; if false only use ImageMagick if PHP memory limit is too low.
+$PHPTHUMB_CONFIG['use_exif_thumbnail_for_speed'] = false; // If true, and EXIF thumbnail is available, and is larger or equal to output image dimensions, use EXIF thumbnail rather than actual source image for generating thumbnail. Benefit is only speed, avoiding resizing large image.
+$PHPTHUMB_CONFIG['allow_local_http_src']         = false; // If true, 'src' parameter can be "http://<thishostname>/path/image.ext" instead of just "/path/image.ext"; if false then display warning message to encourage more efficient local-filename calling.
+
+// END USER CONFIGURATION SECTION
+
+///////////////////////////////////////////////////////////////////////////////
+
+// START DEFAULT PARAMETERS SECTION
+// If any parameters are constant across ALL images, you can set them here
+
+$PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE = true;  // if true, any parameters in the URL will override the defaults set here; if false, any parameters set here cannot be overridden in the URL
+$PHPTHUMB_DEFAULTS_DISABLEGETPARAMS  = false; // if true, GETstring parameters will be ignored (except for 'src') and only below default parameters will be used; if false, both default and GETstring parameters will be used (depending on $PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE). Will be auto-set true if !empty($PHPTHUMB_CONFIG['cache_default_only_suffix'])
+
+//$PHPTHUMB_DEFAULTS['w']    = 100;
+//$PHPTHUMB_DEFAULTS['fltr'] = array('blur|10');
+//$PHPTHUMB_DEFAULTS['q']    =  90;
+
+
+// END DEFAULT PARAMETERS SECTION
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Function for generating hashed calls to phpThumb if 'high_security_enabled'
+// example:
+//   require_once('phpThumb.config.php');
+//   echo '<img src="'.phpThumbURL('src=pic.jpg&w=50').'">';
+
+function phpThumbURL($ParameterString) {
+  global $PHPTHUMB_CONFIG;
+  return str_replace(@$PHPTHUMB_CONFIG['document_root'], '', dirname(__FILE__)).DIRECTORY_SEPARATOR.'phpThumb.php?'.$ParameterString.'&hash='.md5($ParameterString.@$PHPTHUMB_CONFIG['high_security_password']);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.config.php.org
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.config.php.org	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.config.php.org	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,245 @@
+<?php
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+// See: phpthumb.readme.txt for usage instructions          //
+//                                                         ///
+//////////////////////////////////////////////////////////////
+
+	chdir('../../../../../../../');
+	include_once('includes/configure.php');
+
+ob_start();
+if (!file_exists(dirname(__FILE__).'/phpthumb.functions.php') || !include_once(dirname(__FILE__).'/phpthumb.functions.php')) {
+	ob_end_flush();
+	die('failed to include_once(phpthumb.functions.php) - realpath="'.realpath(dirname(__FILE__).'/phpthumb.functions.php').'"');
+}
+ob_end_clean();
+
+// START USER CONFIGURATION SECTION:
+
+// * DocumentRoot configuration
+// phpThumb() depends on $_SERVER['DOCUMENT_ROOT'] to resolve path/filenames. This value is usually correct,
+// but has been known to be broken on some servers. This value allows you to override the default value.
+// Do not modify from the auto-detect default value unless you are having problems.
+//$PHPTHUMB_CONFIG['document_root'] = '/home/httpd/httpdocs';
+//$PHPTHUMB_CONFIG['document_root'] = 'c:\\webroot\\example.com\\www';
+//$PHPTHUMB_CONFIG['document_root'] = $_SERVER['DOCUMENT_ROOT'];
+//$PHPTHUMB_CONFIG['document_root'] = realpath((@$_SERVER['DOCUMENT_ROOT'] && file_exists(@$_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'])) ? $_SERVER['DOCUMENT_ROOT'] : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', realpath('.'))));
+$PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && ereg('^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))), realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__))));
+
+// * Cache directory configuration (choose only one of these - leave the other lines commented-out):
+// Note: this directory must be writable (usually chmod 777 is neccesary) for caching to work.
+// If the directory is not writable no error will be generated but caching will be disabled.
+$PHPTHUMB_CONFIG['cache_directory'] = dirname(__FILE__).'/cache/';                            // set the cache directory relative to the phpThumb() installation
+//$PHPTHUMB_CONFIG['cache_directory'] = $PHPTHUMB_CONFIG['document_root'].'/phpthumb/cache/'; // set the cache directory to an absolute directory for all source images
+//$PHPTHUMB_CONFIG['cache_directory'] = './cache/';                                           // set the cache directory relative to the source image - must start with '.' (will not work to cache URL- or database-sourced images, please use an absolute directory name)
+//$PHPTHUMB_CONFIG['cache_directory'] = null;                                                 // disable thumbnail caching (not recommended)
+
+$PHPTHUMB_CONFIG['cache_disable_warning'] = false; // If [cache_directory] is non-existant or not writable, and [cache_disable_warning] is false, an error image will be generated warning to either set the cache directory or disable the warning (to avoid people not knowing about the cache)
+
+
+// * Cache culling: phpThumb can automatically limit the contents of the cache directory
+//   based on last-access date and/or number of files and/or total filesize.
+
+//$PHPTHUMB_CONFIG['cache_maxage'] = null;            // never delete cached thumbnails based on last-access time
+$PHPTHUMB_CONFIG['cache_maxage'] = 86400 * 90;        // delete cached thumbnails that haven't been accessed in more than [90 days] (value is maximum time since last access in seconds to avoid deletion)
+
+//$PHPTHUMB_CONFIG['cache_maxsize'] = null;           // never delete cached thumbnails based on byte size of cache directory
+$PHPTHUMB_CONFIG['cache_maxsize'] = 10 * 1024 * 1024; // delete least-recently-accessed cached thumbnails when more than [10MB] of cached files are present (value is maximum bytesize of all cached files)
+
+//$PHPTHUMB_CONFIG['cache_maxfiles'] = null;          // never delete cached thumbnails based on number of cached files
+$PHPTHUMB_CONFIG['cache_maxfiles'] = 500;             // delete least-recently-accessed cached thumbnails when more than [500] cached files are present (value is maximum number of cached files to keep)
+
+
+// * Source image cache configuration
+$PHPTHUMB_CONFIG['cache_source_enabled']   = false;                               // if true, source images obtained via HTTP are cached to $PHPTHUMB_CONFIG['cache_source_directory']
+$PHPTHUMB_CONFIG['cache_source_directory'] = dirname(__FILE__).'/cache/source/';  // set the cache directory for unprocessed source images
+
+// * cache source modification date configuration
+$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_local']  = false; // if true, local source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed
+$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_remote'] = true;  // if true, remote source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed. WARNING: cached performance MUCH slower if this is set to false.
+
+
+// * Simplified cache filename configuration
+// Instead of creating unique cache filenames for all parameter combinations, create "simple" cache files (eg: "pic_thumb.jpg")
+// If cache_default_only_suffix is non-empty, GETstring parameters (except 'src') are ignored and only $PHPTHUMB_DEFAULTS
+// parameters (set at the bottom of phpThumb.config.php) are used for processing.
+// The '*' character MUST be used to represent the source image name
+$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '';           // cached in normal phpThumb manner
+//$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '*_thumb';  // cache 'pic.jpg' becomes 'pic_thumb.jpg' (or 'pic_thumb.png' if PNG output is selected, etc)
+//$PHPTHUMB_CONFIG['cache_default_only_suffix'] = 'small-*';  // cache 'pic.jpg' becomes 'small-pic.jpg' (or 'small-pic.png' if PNG output is selected, etc)
+
+$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache_'.str_replace('www.', '', @$_SERVER['SERVER_NAME']);
+//$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache';                         // allow phpThumb to share 1 set of cached files even if accessed under different servername/domains on same server
+
+$PHPTHUMB_CONFIG['cache_force_passthru'] = true;  // if true, cached image data will always be passed to browser; if false, HTTP redirect will be used instead
+
+
+
+// * Temp directory configuration
+// phpThumb() may need to create temp files. Usually the system temp dir is writable and can be used.
+// Leave this value as NULL in most cases. If you get errors about "failed to open <filename> for writing"
+// you should change this to a full pathname to a directory you do have write access to.
+//$PHPTHUMB_CONFIG['temp_directory'] = '/tmp/';
+$PHPTHUMB_CONFIG['temp_directory'] = null;
+
+
+// maximum number of pixels in source image to attempt to process entire image.
+// If this is zero then no limit on source image dimensions.
+// If this is nonzero then this is the maximum number of pixels the source image
+// can have to be processed normally, otherwise the embedded EXIF thumbnail will
+// be used (if available) or an "image too large" notice will be displayed.
+// This is to be used for large source images (> 1600x1200) and low PHP memory
+// limits. If PHP runs out of memory the script will usually just die with no output.
+// To calculate this number, multiply the dimensions of the largest image
+// you can process with your memory limitation (e.g. 1600 * 1200 = 1920000)
+// As a general guideline, this number will be about 20% of your PHP memory
+// configuration, so 8M = 1,677,722; 16M = 3,355,443; 32M = 6,710,886; etc.
+if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.2', '>=') && !defined('memory_get_usage') && !@ini_get('memory_limit')) {
+	// memory_get_usage() will only be defined if your PHP is compiled with the --enable-memory-limit configuration option.
+	$PHPTHUMB_CONFIG['max_source_pixels'] = 0;         // no memory limit
+} else {
+	// calculate default max_source_pixels as 20% of memory limit configuration
+	$PHPTHUMB_CONFIG['max_source_pixels'] = round(max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576 * 0.20);
+	//$PHPTHUMB_CONFIG['max_source_pixels'] = 0;       // no memory limit
+	//$PHPTHUMB_CONFIG['max_source_pixels'] = 1920000; // allow 1600x1200 images (2Mpx), no larger (about 10MB memory required)
+	//$PHPTHUMB_CONFIG['max_source_pixels'] = 3355443; // 16MB memory limit
+	//$PHPTHUMB_CONFIG['max_source_pixels'] = 3871488; // allow 2272x1704 images (4Mpx), no larger (about 16MB memory required)
+}
+
+
+// ImageMagick configuration
+// If source image is larger than available memory limits as defined above in
+// 'max_source_pixels' AND ImageMagick's "convert" program is available, phpThumb()
+// will call ImageMagick to perform the thumbnailing of the source image to bypass
+// the memory limitation. Leaving the value as NULL will cause phpThumb() to
+// attempt to detect ImageMagick's presence with `which`
+if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
+	// Windows: set absolute pathname
+	$PHPTHUMB_CONFIG['imagemagick_path'] = 'C:/Program Files/ImageMagick-6.2.5-Q16/convert.exe';
+} else {
+	// *nix: set absolute pathname to "convert", or leave as null if "convert" is in the path
+	//$PHPTHUMB_CONFIG['imagemagick_path'] = '/usr/local/bin/convert';
+	$PHPTHUMB_CONFIG['imagemagick_path'] = null;
+}
+
+
+// * Default output configuration:
+$PHPTHUMB_CONFIG['output_format']    = 'jpeg'; // default output format ('jpeg', 'png' or 'gif') - thumbnail will be output in this format (if available in your version of GD). This is always overridden by ?f=___ GETstring parameter
+$PHPTHUMB_CONFIG['output_maxwidth']  = 0;      // default maximum thumbnail width.  If this is zero then default width  is the width  of the source image. This is always overridden by ?w=___ GETstring parameter
+$PHPTHUMB_CONFIG['output_maxheight'] = 0;      // default maximum thumbnail height. If this is zero then default height is the height of the source image. This is always overridden by ?h=___ GETstring parameter
+$PHPTHUMB_CONFIG['output_interlace'] = true;   // if true: interlaced output for GIF/PNG, progressive output for JPEG; if false: non-interlaced for GIF/PNG, baseline for JPEG.
+
+// * Error message configuration
+$PHPTHUMB_CONFIG['error_image_width']           = 150;      // default width for error images
+$PHPTHUMB_CONFIG['error_image_height']          = 150;      // default height for error images
+$PHPTHUMB_CONFIG['error_message_image_default'] = '';       // Set this to the name of a generic error image (e.g. '/images/error.png') that you want displayed in place of any error message that may occur. This setting is overridden by the 'err' parameter, which does the same thing.
+$PHPTHUMB_CONFIG['error_bgcolor']               = 'CCCCFF'; // background color of error message images
+$PHPTHUMB_CONFIG['error_textcolor']             = 'FF0000'; // color of text in error messages
+$PHPTHUMB_CONFIG['error_fontsize']              = 1;        // size of text in error messages, from 1 (smallest) to 5 (largest)
+$PHPTHUMB_CONFIG['error_die_on_error']          = true;     // die with error message on any fatal error (recommended with standalone phpThumb.php)
+$PHPTHUMB_CONFIG['error_silent_die_on_error']   = false;    // simply die with no output of any kind on fatal errors (not recommended)
+$PHPTHUMB_CONFIG['error_die_on_source_failure'] = true;     // die with error message if source image cannot be processed by phpThumb() (usually because source image is corrupt in some way). If false the source image will be passed through unprocessed, if true (default) an error message will be displayed.
+
+// * Off-server Thumbnailing Configuration:
+$PHPTHUMB_CONFIG['nohotlink_enabled']           = true;                                     // If false will allow thumbnailing from any source domain
+$PHPTHUMB_CONFIG['nohotlink_valid_domains']     = array(@$_SERVER['HTTP_HOST']);            // This is the list of domains for which thumbnails are allowed to be created. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format 'www.example.com'
+$PHPTHUMB_CONFIG['nohotlink_erase_image']       = true;                                     // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail
+$PHPTHUMB_CONFIG['nohotlink_text_message']      = 'Off-server thumbnailing is not allowed'; // text of error message
+
+// * Off-server Linking Configuration:
+$PHPTHUMB_CONFIG['nooffsitelink_enabled']       = true;                                       // If false will allow thumbnails to be linked to from any domain, if true only domains listed below in 'nooffsitelink_valid_domains' will be allowed.
+$PHPTHUMB_CONFIG['nooffsitelink_valid_domains'] = array(@$_SERVER['HTTP_HOST']);              // This is the list of domains for which thumbnails are allowed to be created. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format 'www.example.com'
+$PHPTHUMB_CONFIG['nooffsitelink_require_refer'] = false;                                      // If false will allow standalone calls to phpThumb(). If true then only requests with a $_SERVER['HTTP_REFERER'] value in 'nooffsitelink_valid_domains' are allowed.
+$PHPTHUMB_CONFIG['nooffsitelink_erase_image']   = true;                                       // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail
+$PHPTHUMB_CONFIG['nooffsitelink_text_message']  = 'Image taken from '.@$_SERVER['HTTP_HOST']; // text of error message
+
+
+// * Border & Background default colors
+$PHPTHUMB_CONFIG['border_hexcolor']     = '000000'; // Default border color - usual HTML-style hex color notation (overidden with 'bc' parameter)
+$PHPTHUMB_CONFIG['background_hexcolor'] = 'FFFFFF'; // Default background color when thumbnail aspect ratio does not match fixed-dimension box - usual HTML-style hex color notation (overridden with 'bg' parameter)
+
+// * Watermark configuration
+$PHPTHUMB_CONFIG['ttf_directory'] = dirname(__FILE__).'/fonts'; // Base directory for TTF font files
+//$PHPTHUMB_CONFIG['ttf_directory'] = 'c:/windows/fonts';
+
+
+// * MySQL configuration
+// You may want to pull data from a database rather than a physical file
+// If so, modify the $PHPTHUMB_CONFIG['mysql_query'] line to suit your database structure
+// Note: the data retrieved must be the actual binary data of the image, not a URL or filename
+// see http://www.billy-corgan.com/blog/archive/000143.php for a brief tutorial on this section
+
+$PHPTHUMB_CONFIG['mysql_query'] = '';
+//$PHPTHUMB_CONFIG['mysql_query'] = 'SELECT `picture` FROM `products` WHERE (`id` = \''.mysql_escape_string(@$_GET['id']).'\')';
+
+// These 4 values must be modified if $PHPTHUMB_CONFIG['mysql_query'] is not empty, but may be ignored if $PHPTHUMB_CONFIG['mysql_query'] is blank.
+$PHPTHUMB_CONFIG['mysql_hostname'] = 'localhost';
+$PHPTHUMB_CONFIG['mysql_username'] = '';
+$PHPTHUMB_CONFIG['mysql_password'] = '';
+$PHPTHUMB_CONFIG['mysql_database'] = '';
+
+
+// * Security configuration
+$PHPTHUMB_CONFIG['high_security_enabled']    = false;  // if enabled, requires 'high_security_password' set to at least 5 characters, and requires the use of phpThumbURL() function (at the bottom of phpThumb.config.php) to generate hashed URLs
+$PHPTHUMB_CONFIG['high_security_password']   = '';     // required if 'high_security_enabled' is true, must be at least 5 characters long
+$PHPTHUMB_CONFIG['disable_debug']            = false;  // prevent phpThumb from displaying any information about your system. If true, phpThumbDebug and error messages will be disabled
+$PHPTHUMB_CONFIG['allow_src_above_docroot']  = false;  // if true, allow src to be anywhere in filesystem; if false (default) only allow src within document_root
+$PHPTHUMB_CONFIG['allow_src_above_phpthumb'] = true;   // if true (default), allow src to be anywhere in filesystem; if false only allow src within sub-directory of phpThumb installation
+$PHPTHUMB_CONFIG['allow_parameter_file']     = false;  // if true, allow use of 'file' parameter; if false (default) the 'file' parameter is disabled/ignored
+$PHPTHUMB_CONFIG['allow_parameter_goto']     = false;  // if true, allow use of 'goto' parameter; if false (default) the 'goto' parameter is disabled/ignored
+
+
+// * HTTP UserAgent configuration
+//$PHPTHUMB_CONFIG['http_user_agent'] = '';                                                                                      // PHP default: none
+//$PHPTHUMB_CONFIG['http_user_agent'] = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';                                    // Windows XP, Internet Explorer
+$PHPTHUMB_CONFIG['http_user_agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7'; // Windows XP, Firefox
+
+
+// * Compatability settings
+$PHPTHUMB_CONFIG['disable_pathinfo_parsing']        = false;  // if true, $_SERVER[PATH_INFO] is not parsed. May be needed on some server configurations to allow normal behavior.
+$PHPTHUMB_CONFIG['disable_imagecopyresampled']      = false;  // if true, ImageCopyResampled is replaced with ImageCopyResampleBicubic. May be needed for buggy versions of PHP-GD.
+$PHPTHUMB_CONFIG['disable_onlycreateable_passthru'] = true;   // if true, any image that can be parsed by GetImageSize() can be passed through; if false, only images that can be converted to GD by ImageCreateFrom(JPEG|GIF|PNG) functions are allowed
+
+
+// * Speed optimizations configuration
+$PHPTHUMB_CONFIG['prefer_imagemagick']           = true;  // If true, use ImageMagick to resize thumbnails if possible, since it is usually faster than GD functions; if false only use ImageMagick if PHP memory limit is too low.
+$PHPTHUMB_CONFIG['use_exif_thumbnail_for_speed'] = false; // If true, and EXIF thumbnail is available, and is larger or equal to output image dimensions, use EXIF thumbnail rather than actual source image for generating thumbnail. Benefit is only speed, avoiding resizing large image.
+$PHPTHUMB_CONFIG['allow_local_http_src']         = false; // If true, 'src' parameter can be "http://<thishostname>/path/image.ext" instead of just "/path/image.ext"; if false then display warning message to encourage more efficient local-filename calling.
+
+// END USER CONFIGURATION SECTION
+
+///////////////////////////////////////////////////////////////////////////////
+
+// START DEFAULT PARAMETERS SECTION
+// If any parameters are constant across ALL images, you can set them here
+
+$PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE = true;  // if true, any parameters in the URL will override the defaults set here; if false, any parameters set here cannot be overridden in the URL
+$PHPTHUMB_DEFAULTS_DISABLEGETPARAMS  = false; // if true, GETstring parameters will be ignored (except for 'src') and only below default parameters will be used; if false, both default and GETstring parameters will be used (depending on $PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE). Will be auto-set true if !empty($PHPTHUMB_CONFIG['cache_default_only_suffix'])
+
+//$PHPTHUMB_DEFAULTS['w']    = 100;
+//$PHPTHUMB_DEFAULTS['fltr'] = array('blur|10');
+//$PHPTHUMB_DEFAULTS['q']    =  90;
+
+
+// END DEFAULT PARAMETERS SECTION
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Function for generating hashed calls to phpThumb if 'high_security_enabled'
+// example:
+//   require_once('phpThumb.config.php');
+//   echo '<img src="'.phpThumbURL('src=pic.jpg&w=50').'">';
+
+function phpThumbURL($ParameterString) {
+	global $PHPTHUMB_CONFIG;
+	return str_replace(@$PHPTHUMB_CONFIG['document_root'], '', dirname(__FILE__)).DIRECTORY_SEPARATOR.'phpThumb.php?'.$ParameterString.'&hash='.md5($ParameterString.@$PHPTHUMB_CONFIG['high_security_password']);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpThumb.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,598 @@
+<?php
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+// See: phpthumb.changelog.txt for recent changes           //
+// See: phpthumb.readme.txt for usage instructions          //
+//                                                         ///
+//////////////////////////////////////////////////////////////
+
+error_reporting(E_ALL);
+ini_set('display_errors', '1');
+if (!@ini_get('safe_mode')) {
+  set_time_limit(60);  // shouldn't take nearly this long in most cases, but with many filter and/or a slow server...
+}
+ini_set('magic_quotes_runtime', '0');
+if (@ini_get('magic_quotes_runtime')) {
+  die('"magic_quotes_runtime" is set in php.ini, cannot run phpThumb with this enabled');
+}
+$starttime = array_sum(explode(' ', microtime()));
+
+// this script relies on the superglobal arrays, fake it here for old PHP versions
+if (phpversion() < '4.1.0') {
+  $_SERVER = $HTTP_SERVER_VARS;
+  $_GET    = $HTTP_GET_VARS;
+}
+
+// instantiate a new phpThumb() object
+ob_start();
+if (!include_once(dirname(__FILE__).'/phpthumb.class.php')) {
+  ob_end_flush();
+  die('failed to include_once("'.realpath(dirname(__FILE__).'/phpthumb.class.php').'")');
+}
+ob_end_clean();
+$phpThumb = new phpThumb();
+$phpThumb->DebugTimingMessage('phpThumb.php start', __FILE__, __LINE__, $starttime);
+
+// phpThumbDebug[0] used to be here, but may reveal too much
+// info when high_security_mode should be enabled (not set yet)
+
+if (file_exists(dirname(__FILE__).'/phpThumb.config.php')) {
+  ob_start();
+  if (include_once(dirname(__FILE__).'/phpThumb.config.php')) {
+    // great
+  } else {
+    ob_end_flush();
+    $phpThumb->ErrorImage('failed to include_once('.dirname(__FILE__).'/phpThumb.config.php) - realpath="'.realpath(dirname(__FILE__).'/phpThumb.config.php').'"');
+  }
+  ob_end_clean();
+} elseif (file_exists(dirname(__FILE__).'/phpThumb.config.php.default')) {
+  $phpThumb->ErrorImage('Please rename "phpThumb.config.php.default" to "phpThumb.config.php"');
+} else {
+  $phpThumb->ErrorImage('failed to include_once('.dirname(__FILE__).'/phpThumb.config.php) - realpath="'.realpath(dirname(__FILE__).'/phpThumb.config.php').'"');
+}
+
+if (!@$PHPTHUMB_CONFIG['disable_pathinfo_parsing'] && (empty($_GET) || isset($_GET['phpThumbDebug'])) && !empty($_SERVER['PATH_INFO'])) {
+  $_SERVER['PHP_SELF'] = str_replace($_SERVER['PATH_INFO'], '', @$_SERVER['PHP_SELF']);
+
+  $args = explode(';', substr($_SERVER['PATH_INFO'], 1));
+  $phpThumb->DebugMessage('PATH_INFO.$args set to ('.implode(')(', $args).')', __FILE__, __LINE__);
+  if (!empty($args)) {
+    $_GET['src'] = @$args[count($args) - 1];
+    if (eregi('^new\=([a-z0-9]+)', $_GET['src'], $matches)) {
+      unset($_GET['src']);
+      $_GET['new'] = $matches[1];
+    }
+  }
+  if (eregi('^([0-9]*)x?([0-9]*)$', @$args[count($args) - 2], $matches)) {
+    $_GET['w'] = $matches[1];
+    $_GET['h'] = $matches[2];
+    $phpThumb->DebugMessage('PATH_INFO."w"x"h" set to "'.$_GET['w'].'"x"'.$_GET['h'].'"', __FILE__, __LINE__);
+  }
+  for ($i = 0; $i < count($args) - 2; $i++) {
+    @list($key, $value) = explode('=', @$args[$i]);
+    if (substr($key, -2) == '[]') {
+      $array_key_name = substr($key, 0, -2);
+      $_GET[$array_key_name][] = $value;
+      $phpThumb->DebugMessage('PATH_INFO."'.$array_key_name.'[]" = "'.$value.'"', __FILE__, __LINE__);
+    } else {
+      $_GET[$key] = $value;
+      $phpThumb->DebugMessage('PATH_INFO."'.$key.'" = "'.$value.'"', __FILE__, __LINE__);
+    }
+  }
+}
+
+if (@$PHPTHUMB_CONFIG['high_security_enabled']) {
+  if (!@$_GET['hash']) {
+    $phpThumb->ErrorImage('ERROR: missing hash');
+  } elseif (strlen($PHPTHUMB_CONFIG['high_security_password']) < 5) {
+    $phpThumb->ErrorImage('ERROR: strlen($PHPTHUMB_CONFIG[high_security_password]) < 5');
+  } elseif ($_GET['hash'] != md5(str_replace('&hash='.$_GET['hash'], '', $_SERVER['QUERY_STRING']).$PHPTHUMB_CONFIG['high_security_password'])) {
+    $phpThumb->ErrorImage('ERROR: invalid hash');
+  }
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[0]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '0') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+// returned the fixed string if the evil "magic_quotes_gpc" setting is on
+if (get_magic_quotes_gpc()) {
+  $RequestVarsToStripSlashes = array('src', 'wmf', 'file', 'err', 'goto', 'down');
+  foreach ($RequestVarsToStripSlashes as $dummy => $key) {
+    if (isset($_GET[$key])) {
+      $_GET[$key] = stripslashes($_GET[$key]);
+    }
+  }
+}
+
+if (!@$_SERVER['PATH_INFO'] && !@$_SERVER['QUERY_STRING']) {
+  $phpThumb->ErrorImage('phpThumb() v'.$phpThumb->phpthumb_version.'<br><a href="http://phpthumb.sourceforge.net">http://phpthumb.sourceforge.net</a><br><br>ERROR: no parameters specified');
+}
+
+if (@$_GET['src'] && isset($_GET['md5s']) && empty($_GET['md5s'])) {
+  if (eregi('^(f|ht)tps?://', $_GET['src'])) {
+    if ($rawImageData = phpthumb_functions::SafeURLread($_GET['src'], $error)) {
+      $md5s = md5($rawImageData);
+    }
+  } else {
+    $SourceFilename = $phpThumb->ResolveFilenameToAbsolute($_GET['src']);
+    if (is_readable($SourceFilename)) {
+      $md5s = phpthumb_functions::md5_file_safe($SourceFilename);
+    } else {
+      $phpThumb->ErrorImage('ERROR: "'.$SourceFilename.'" cannot be read');
+    }
+  }
+  if (@$_SERVER['HTTP_REFERER']) {
+    $phpThumb->ErrorImage('&md5s='.$md5s);
+  } else {
+    die('&md5s='.$md5s);
+  }
+}
+
+if (!empty($PHPTHUMB_CONFIG)) {
+  foreach ($PHPTHUMB_CONFIG as $key => $value) {
+    $keyname = 'config_'.$key;
+    $phpThumb->setParameter($keyname, $value);
+    if (!eregi('password', $key)) {
+      $phpThumb->DebugMessage('setParameter('.$keyname.', '.$phpThumb->phpThumbDebugVarDump($value).')', __FILE__, __LINE__);
+    }
+  }
+} else {
+  $phpThumb->DebugMessage('$PHPTHUMB_CONFIG is empty', __FILE__, __LINE__);
+}
+
+if (@$_GET['src'] && !@$PHPTHUMB_CONFIG['allow_local_http_src'] && eregi('^http://'.@$_SERVER['HTTP_HOST'].'(.+)', @$_GET['src'], $matches)) {
+  $phpThumb->ErrorImage('It is MUCH better to specify the "src" parameter as "'.$matches[1].'" instead of "'.$matches[0].'".'."\n\n".'If you really must do it this way, enable "allow_local_http_src" in phpThumb.config.php');
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[1]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '1') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+$parsed_url_referer = parse_url(@$_SERVER['HTTP_REFERER']);
+if ($phpThumb->config_nooffsitelink_require_refer && !in_array(@$parsed_url_referer['host'], $phpThumb->config_nohotlink_valid_domains)) {
+  $phpThumb->ErrorImage('config_nooffsitelink_require_refer enabled and '.(@$parsed_url_referer['host'] ? '"'.$parsed_url_referer['host'].'" is not an allowed referer' : 'no HTTP_REFERER exists'));
+}
+$parsed_url_src = parse_url(@$_GET['src']);
+if ($phpThumb->config_nohotlink_enabled && $phpThumb->config_nohotlink_erase_image && eregi('^(f|ht)tps?://', @$_GET['src']) && !in_array(@$parsed_url_src['host'], $phpThumb->config_nohotlink_valid_domains)) {
+  $phpThumb->ErrorImage($phpThumb->config_nohotlink_text_message);
+}
+
+if ($phpThumb->config_mysql_query) {
+  if ($cid = @mysql_connect($phpThumb->config_mysql_hostname, $phpThumb->config_mysql_username, $phpThumb->config_mysql_password)) {
+    if (@mysql_select_db($phpThumb->config_mysql_database, $cid)) {
+      if ($result = @mysql_query($phpThumb->config_mysql_query, $cid)) {
+        if ($row = @mysql_fetch_array($result)) {
+
+          mysql_free_result($result);
+          mysql_close($cid);
+          $phpThumb->setSourceData($row[0]);
+          unset($row);
+
+        } else {
+          mysql_free_result($result);
+          mysql_close($cid);
+          $phpThumb->ErrorImage('no matching data in database.');
+        }
+      } else {
+        mysql_close($cid);
+        $phpThumb->ErrorImage('Error in MySQL query: "'.mysql_error($cid).'"');
+      }
+    } else {
+      mysql_close($cid);
+      $phpThumb->ErrorImage('cannot select MySQL database: "'.mysql_error($cid).'"');
+    }
+  } else {
+    $phpThumb->ErrorImage('cannot connect to MySQL server');
+  }
+  unset($_GET['id']);
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[2]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '2') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+if (@$PHPTHUMB_CONFIG['cache_default_only_suffix'] && (strpos($PHPTHUMB_CONFIG['cache_default_only_suffix'], '*') !== false)) {
+  $PHPTHUMB_DEFAULTS_DISABLEGETPARAMS = true;
+}
+$allowedGETparameters = array('src', 'new', 'w', 'h', 'wp', 'hp', 'wl', 'hl', 'ws', 'hs', 'f', 'q', 'sx', 'sy', 'sw', 'sh', 'zc', 'bc', 'bg', 'bgt', 'fltr', 'file', 'goto', 'err', 'xto', 'ra', 'ar', 'aoe', 'far', 'iar', 'maxb', 'down', 'phpThumbDebug', 'hash', 'md5s');
+if (!empty($PHPTHUMB_DEFAULTS) && is_array($PHPTHUMB_DEFAULTS)) {
+  $phpThumb->DebugMessage('setting $PHPTHUMB_DEFAULTS['.implode(';', array_keys($PHPTHUMB_DEFAULTS)).']', __FILE__, __LINE__);
+  foreach ($PHPTHUMB_DEFAULTS as $key => $value) {
+    if ($PHPTHUMB_DEFAULTS_GETSTRINGOVERRIDE || !isset($_GET[$key])) {
+      $_GET[$key] = $value;
+      $phpThumb->DebugMessage('PHPTHUMB_DEFAULTS assigning ('.$value.') to $_GET['.$key.']', __FILE__, __LINE__);
+      //$phpThumb->DebugMessage('PHPTHUMB_DEFAULTS.setParameter('.$key.', '.$phpThumb->phpThumbDebugVarDump($value).')', __FILE__, __LINE__);
+      //$phpThumb->setParameter($key, $value);
+    }
+  }
+}
+foreach ($_GET as $key => $value) {
+  if (@$PHPTHUMB_DEFAULTS_DISABLEGETPARAMS && ($key != 'src')) {
+    // disabled, do not set parameter
+    $phpThumb->DebugMessage('ignoring $_GET['.$key.'] because of $PHPTHUMB_DEFAULTS_DISABLEGETPARAMS', __FILE__, __LINE__);
+  } elseif (in_array($key, $allowedGETparameters)) {
+    $phpThumb->DebugMessage('setParameter('.$key.', '.$phpThumb->phpThumbDebugVarDump($value).')', __FILE__, __LINE__);
+    $phpThumb->setParameter($key, $value);
+  } else {
+    $phpThumb->ErrorImage('Forbidden parameter: '.$key);
+  }
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[3]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '3') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+//if (!@$_GET['phpThumbDebug'] && !$phpThumb->sourceFilename && !function_exists('ImageJPEG') && !function_exists('ImagePNG') && !function_exists('ImageGIF')) {
+if (!@$_GET['phpThumbDebug'] && !is_file($phpThumb->sourceFilename) && !phpthumb_functions::gd_version()) {
+  if (!headers_sent()) {
+    // base64-encoded error image in GIF format
+    $ERROR_NOGD = 'R0lGODlhIAAgALMAAAAAABQUFCQkJDY2NkZGRldXV2ZmZnJycoaGhpSUlKWlpbe3t8XFxdXV1eTk5P7+/iwAAAAAIAAgAAAE/vDJSau9WILtTAACUinDNijZtAHfCojS4W5H+qxD8xibIDE9h0OwWaRWDIljJSkUJYsN4bihMB8th3IToAKs1VtYM75cyV8sZ8vygtOE5yMKmGbO4jRdICQCjHdlZzwzNW4qZSQmKDaNjhUMBX4BBAlmMywFSRWEmAI6b5gAlhNxokGhooAIK5o/pi9vEw4Lfj4OLTAUpj6IabMtCwlSFw0DCKBoFqwAB04AjI54PyZ+yY3TD0ss2YcVmN/gvpcu4TOyFivWqYJlbAHPpOntvxNAACcmGHjZzAZqzSzcq5fNjxFmAFw9iFRunD1epU6tsIPmFCAJnWYE0FURk7wJDA0MTKpEzoWAAskiAAA7';
+    header('Content-Type: image/gif');
+    echo base64_decode($ERROR_NOGD);
+  } else {
+    echo '*** ERROR: No PHP-GD support available ***';
+  }
+  exit;
+}
+
+// check to see if file can be output from source with no processing or caching
+$CanPassThroughDirectly = true;
+if ($phpThumb->rawImageData) {
+  // data from SQL, should be fine
+} elseif (eregi('^(f|ht)tp\://', $phpThumb->src)) {
+  $phpThumb->DebugMessage('$CanPassThroughDirectly=false because eregi("^(f|ht)tp\://", '.$phpThumb->src.')', __FILE__, __LINE__);
+  $CanPassThroughDirectly = false;
+} elseif (!@is_file($phpThumb->sourceFilename)) {
+  $phpThumb->DebugMessage('$CanPassThroughDirectly=false because !@is_file('.$phpThumb->sourceFilename.')', __FILE__, __LINE__);
+  $CanPassThroughDirectly = false;
+} elseif (!@is_readable($phpThumb->sourceFilename)) {
+  $phpThumb->DebugMessage('$CanPassThroughDirectly=false because !@is_readable('.$phpThumb->sourceFilename.')', __FILE__, __LINE__);
+  $CanPassThroughDirectly = false;
+}
+foreach ($_GET as $key => $value) {
+  switch ($key) {
+    case 'src':
+      // allowed
+      break;
+
+    case 'w':
+    case 'h':
+      // might be OK if exactly matches original
+      break;
+
+    case 'phpThumbDebug':
+      // handled in direct-passthru code
+      break;
+
+    default:
+      // all other parameters will cause some processing,
+      // therefore cannot pass through original image unmodified
+      $CanPassThroughDirectly = false;
+      $UnAllowedGET[] = $key;
+      break;
+  }
+}
+if (!empty($UnAllowedGET)) {
+  $phpThumb->DebugMessage('$CanPassThroughDirectly=false because $_GET['.implode(';', array_unique($UnAllowedGET)).'] are set', __FILE__, __LINE__);
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[4]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '4') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+function SendSaveAsFileHeaderIfNeeded() {
+  if (headers_sent()) {
+    return false;
+  }
+  global $phpThumb;
+  if (@$_GET['down']) {
+    $downloadfilename = ereg_replace('[/\\:\*\?"<>|]', '_', $_GET['down']);
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '4.1.0', '>=')) {
+      $downloadfilename = trim($downloadfilename, '.');
+    }
+    if (@$downloadfilename) {
+      $phpThumb->DebugMessage('SendSaveAsFileHeaderIfNeeded() sending header: Content-Disposition: attachment; filename="'.$downloadfilename.'"', __FILE__, __LINE__);
+      header('Content-Disposition: attachment; filename="'.$downloadfilename.'"');
+      return true;
+    }
+  }
+  $phpThumb->DebugMessage('SendSaveAsFileHeaderIfNeeded() sending header: Content-Disposition: inline', __FILE__, __LINE__);
+  header('Content-Disposition: inline');
+  return true;
+}
+
+$phpThumb->DebugMessage('$CanPassThroughDirectly="'.intval($CanPassThroughDirectly).'" && $phpThumb->src="'.$phpThumb->src.'"', __FILE__, __LINE__);
+while ($CanPassThroughDirectly && $phpThumb->src) {
+  // no parameters set, passthru
+  $SourceFilename = $phpThumb->ResolveFilenameToAbsolute($phpThumb->src);
+
+  // security and size checks
+  if ($phpThumb->getimagesizeinfo = @GetImageSize($SourceFilename)) {
+    $phpThumb->DebugMessage('Direct passthru GetImageSize() returned [w='.$phpThumb->getimagesizeinfo[0].';h='.$phpThumb->getimagesizeinfo[1].';t='.$phpThumb->getimagesizeinfo[2].']', __FILE__, __LINE__);
+
+    if (!@$_GET['w'] && !@$_GET['wp'] && !@$_GET['wl'] && !@$_GET['ws'] && !@$_GET['h'] && !@$_GET['hp'] && !@$_GET['hl'] && !@$_GET['hs']) {
+      // no resizing needed
+      $phpThumb->DebugMessage('Passing "'.$SourceFilename.'" through directly, no resizing required ("'.$phpThumb->getimagesizeinfo[0].'"x"'.$phpThumb->getimagesizeinfo[1].'")', __FILE__, __LINE__);
+    } elseif (($phpThumb->getimagesizeinfo[0] <= @$_GET['w']) && ($phpThumb->getimagesizeinfo[1] <= @$_GET['h']) && ((@$_GET['w'] == $phpThumb->getimagesizeinfo[0]) || (@$_GET['h'] == $phpThumb->getimagesizeinfo[1]))) {
+      // image fits into 'w'x'h' box, and at least one dimension matches exactly, therefore no resizing needed
+      $phpThumb->DebugMessage('Passing "'.$SourceFilename.'" through directly, no resizing required ("'.$phpThumb->getimagesizeinfo[0].'"x"'.$phpThumb->getimagesizeinfo[1].'" fits inside "'.@$_GET['w'].'"x"'.@$_GET['h'].'")', __FILE__, __LINE__);
+    } else {
+      $phpThumb->DebugMessage('Not passing "'.$SourceFilename.'" through directly because resizing required (from "'.$phpThumb->getimagesizeinfo[0].'"x"'.$phpThumb->getimagesizeinfo[1].'" to "'.@$_GET['w'].'"x"'.@$_GET['h'].'")', __FILE__, __LINE__);
+      break;
+    }
+    switch ($phpThumb->getimagesizeinfo[2]) {
+      case 1: // GIF
+      case 2: // JPG
+      case 3: // PNG
+        // great, let it through
+        break;
+      default:
+        // browser probably can't handle format, remangle it to JPEG/PNG/GIF
+        $phpThumb->DebugMessage('Not passing "'.$SourceFilename.'" through directly because $phpThumb->getimagesizeinfo[2] = "'.$phpThumb->getimagesizeinfo[2].'"', __FILE__, __LINE__);
+        break 2;
+    }
+
+    $ImageCreateFunctions = array(1=>'ImageCreateFromGIF', 2=>'ImageCreateFromJPEG', 3=>'ImageCreateFromPNG');
+    $theImageCreateFunction = @$ImageCreateFunctions[$phpThumb->getimagesizeinfo[2]];
+    if ($phpThumb->config_disable_onlycreateable_passthru || (function_exists($theImageCreateFunction) && ($dummyImage = @$theImageCreateFunction($SourceFilename)))) {
+
+      // great
+      if (@is_resource($dummyImage)) {
+        unset($dummyImage);
+      }
+
+      if (headers_sent()) {
+        $phpThumb->ErrorImage('Headers already sent ('.basename(__FILE__).' line '.__LINE__.')');
+        exit;
+      }
+      if (@$_GET['phpThumbDebug']) {
+        $phpThumb->DebugTimingMessage('skipped direct $SourceFilename passthru', __FILE__, __LINE__);
+        $phpThumb->DebugMessage('Would have passed "'.$SourceFilename.'" through directly, but skipping due to phpThumbDebug', __FILE__, __LINE__);
+        break;
+      }
+
+      SendSaveAsFileHeaderIfNeeded();
+      header('Last-Modified: '.gmdate('D, d M Y H:i:s', @filemtime($SourceFilename)).' GMT');
+      if ($contentType = phpthumb_functions::ImageTypeToMIMEtype(@$phpThumb->getimagesizeinfo[2])) {
+        header('Content-Type: '.$contentType);
+      }
+      @readfile($SourceFilename);
+      exit;
+
+    } else {
+      $phpThumb->DebugMessage('Not passing "'.$SourceFilename.'" through directly because ($phpThumb->config_disable_onlycreateable_passthru = "'.$phpThumb->config_disable_onlycreateable_passthru.'") and '.$theImageCreateFunction.'() failed', __FILE__, __LINE__);
+      break;
+    }
+
+  } else {
+    $phpThumb->DebugMessage('Not passing "'.$SourceFilename.'" through directly because GetImageSize() failed', __FILE__, __LINE__);
+    break;
+  }
+  break;
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[5]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '5') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+function RedirectToCachedFile() {
+  global $phpThumb, $PHPTHUMB_CONFIG;
+
+  $nice_cachefile = str_replace(DIRECTORY_SEPARATOR, '/', $phpThumb->cache_filename);
+  $nice_docroot   = str_replace(DIRECTORY_SEPARATOR, '/', rtrim($PHPTHUMB_CONFIG['document_root'], '/\\'));
+
+  $parsed_url = @parse_url(@$_SERVER['HTTP_REFERER']);
+
+  $nModified  = filemtime($phpThumb->cache_filename);
+
+  if ($phpThumb->config_nooffsitelink_enabled && @$_SERVER['HTTP_REFERER'] && !in_array(@$parsed_url['host'], $phpThumb->config_nooffsitelink_valid_domains)) {
+
+    $phpThumb->DebugMessage('Would have used cached (image/'.$phpThumb->thumbnailFormat.') file "'.$phpThumb->cache_filename.'" (Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT), but skipping because $_SERVER[HTTP_REFERER] ('.@$_SERVER['HTTP_REFERER'].') is not in $phpThumb->config_nooffsitelink_valid_domains ('.implode(';', $phpThumb->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__);
+
+  } elseif ($phpThumb->phpThumbDebug) {
+
+    $phpThumb->DebugTimingMessage('skipped using cached image', __FILE__, __LINE__);
+    $phpThumb->DebugMessage('Would have used cached file, but skipping due to phpThumbDebug', __FILE__, __LINE__);
+    $phpThumb->DebugMessage('* Would have sent headers (1): Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT', __FILE__, __LINE__);
+    if ($getimagesize = @GetImageSize($phpThumb->cache_filename)) {
+      $phpThumb->DebugMessage('* Would have sent headers (2): Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2]), __FILE__, __LINE__);
+    }
+    if (ereg('^'.preg_quote($nice_docroot).'(.*)$', $nice_cachefile, $matches)) {
+      $phpThumb->DebugMessage('* Would have sent headers (3): Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1])), __FILE__, __LINE__);
+    } else {
+      $phpThumb->DebugMessage('* Would have sent data: readfile('.$phpThumb->cache_filename.')', __FILE__, __LINE__);
+    }
+
+  } else {
+
+    if (headers_sent()) {
+      $phpThumb->ErrorImage('Headers already sent ('.basename(__FILE__).' line '.__LINE__.')');
+      exit;
+    }
+    SendSaveAsFileHeaderIfNeeded();
+
+    header('Last-Modified: '.gmdate('D, d M Y H:i:s', $nModified).' GMT');
+    if (@$_SERVER['HTTP_IF_MODIFIED_SINCE'] && ($nModified == strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) && @$_SERVER['SERVER_PROTOCOL']) {
+      header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');
+      exit;
+    }
+
+    if ($getimagesize = @GetImageSize($phpThumb->cache_filename)) {
+      header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2]));
+    } elseif (eregi('\.ico$', $phpThumb->cache_filename)) {
+      header('Content-Type: image/x-icon');
+    }
+    if (!@$PHPTHUMB_CONFIG['cache_force_passthru'] && ereg('^'.preg_quote($nice_docroot).'(.*)$', $nice_cachefile, $matches)) {
+      header('Location: '.dirname($matches[1]).'/'.urlencode(basename($matches[1])));
+    } else {
+      @readfile($phpThumb->cache_filename);
+    }
+    exit;
+
+  }
+  return true;
+}
+
+// check to see if file already exists in cache, and output it with no processing if it does
+$phpThumb->SetCacheFilename();
+if (@is_file($phpThumb->cache_filename)) {
+  RedirectToCachedFile();
+} else {
+  $phpThumb->DebugMessage('Cached file "'.$phpThumb->cache_filename.'" does not exist, processing as normal', __FILE__, __LINE__);
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[6]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '6') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+if ($phpThumb->rawImageData) {
+
+  // great
+
+} elseif (@$_GET['new']) {
+
+  // generate a blank image resource of the specified size/background color/opacity
+  if (($phpThumb->w <= 0) || ($phpThumb->h <= 0)) {
+    $phpThumb->ErrorImage('"w" and "h" parameters required for "new"');
+  }
+  @list($bghexcolor, $opacity) = explode('|', $_GET['new']);
+  if (!phpthumb_functions::IsHexColor($bghexcolor)) {
+    $phpThumb->ErrorImage('BGcolor parameter for "new" is not valid');
+  }
+  $opacity = (strlen($opacity) ? $opacity : 100);
+  if ($phpThumb->gdimg_source = phpthumb_functions::ImageCreateFunction($phpThumb->w, $phpThumb->h)) {
+    $alpha = (100 - min(100, max(0, $opacity))) * 1.27;
+    if ($alpha) {
+      $phpThumb->setParameter('is_alpha', true);
+      ImageAlphaBlending($phpThumb->gdimg_source, false);
+      ImageSaveAlpha($phpThumb->gdimg_source, true);
+    }
+    $new_background_color = phpthumb_functions::ImageHexColorAllocate($phpThumb->gdimg_source, $bghexcolor, false, $alpha);
+    ImageFilledRectangle($phpThumb->gdimg_source, 0, 0, $phpThumb->w, $phpThumb->h, $new_background_color);
+  } else {
+    $phpThumb->ErrorImage('failed to create "new" image ('.$phpThumb->w.'x'.$phpThumb->h.')');
+  }
+
+} elseif (!$phpThumb->src) {
+
+  $phpThumb->ErrorImage('Usage: '.$_SERVER['PHP_SELF'].'?src=/path/and/filename.jpg'."\n".'read Usage comments for details');
+
+} elseif (eregi('^(f|ht)tp\://', $phpThumb->src)) {
+
+  if ($phpThumb->config_http_user_agent) {
+    ini_set('user_agent', $phpThumb->config_http_user_agent);
+  }
+  $basename = preg_quote(basename($phpThumb->src));
+  $encoded  = rawurlencode(basename($phpThumb->src));
+  $HTTPurl = ereg_replace('(.*)'.$basename.'$', '\\1'.$encoded, $phpThumb->src);
+  if ($rawImageData = phpthumb_functions::SafeURLread($HTTPurl, $error)) {
+    $phpThumb->setSourceData($rawImageData, urlencode($phpThumb->src));
+  } else {
+    $phpThumb->ErrorImage($error);
+  }
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[7]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '7') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+$phpThumb->GenerateThumbnail();
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[8]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '8') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+if ($phpThumb->config_allow_parameter_file && $phpThumb->file) {
+
+  $phpThumb->RenderToFile($phpThumb->ResolveFilenameToAbsolute($phpThumb->file));
+  if ($phpThumb->config_allow_parameter_goto && $phpThumb->goto && eregi('^(f|ht)tps?://', $phpThumb->goto)) {
+    // redirect to another URL after image has been rendered to file
+    header('Location: '.$phpThumb->goto);
+    exit;
+  }
+
+} elseif (@$PHPTHUMB_CONFIG['high_security_enabled'] && @$_GET['nocache']) {
+
+  // cache disabled, don't write cachefile
+
+} else {
+
+  if ((file_exists($phpThumb->cache_filename) && is_writable($phpThumb->cache_filename)) || is_writable(dirname($phpThumb->cache_filename))) {
+
+    $phpThumb->CleanUpCacheDirectory();
+    if ($phpThumb->RenderToFile($phpThumb->cache_filename) && is_readable($phpThumb->cache_filename)) {
+      chmod($phpThumb->cache_filename, 0644);
+      RedirectToCachedFile();
+    } else {
+      $phpThumb->DebugMessage('Failed: RenderToFile('.$phpThumb->cache_filename.')', __FILE__, __LINE__);
+    }
+
+  } else {
+
+    $phpThumb->DebugMessage('Cannot write to $phpThumb->cache_filename ('.$phpThumb->cache_filename.') because that directory ('.dirname($phpThumb->cache_filename).') is not writable', __FILE__, __LINE__);
+
+  }
+
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[9]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '9') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+if (!$phpThumb->OutputThumbnail()) {
+  $phpThumb->ErrorImage('Error in OutputThumbnail():'."\n".$phpThumb->debugmessages[(count($phpThumb->debugmessages) - 1)]);
+}
+
+////////////////////////////////////////////////////////////////
+// Debug output, to try and help me diagnose problems
+$phpThumb->DebugTimingMessage('phpThumbDebug[10]', __FILE__, __LINE__);
+if (@$_GET['phpThumbDebug'] == '10') {
+  $phpThumb->phpThumbDebug();
+}
+////////////////////////////////////////////////////////////////
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.bmp.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.bmp.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.bmp.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,874 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info at getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.graphic.bmp.php                                      //
+// module for analyzing BMP Image files                        //
+// dependencies: NONE                                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// Modified for use in phpThumb() - James Heinrich 2004.07.27  //
+//                                                             //
+/////////////////////////////////////////////////////////////////
+
+
+class phpthumb_bmp {
+
+  function phpthumb_bmp() {
+    return true;
+  }
+
+  function phpthumb_bmp2gd(&$BMPdata, $truecolor=true) {
+    $ThisFileInfo = array();
+    if ($this->getid3_bmp($BMPdata, $ThisFileInfo, true, true)) {
+      $gd = $this->PlotPixelsGD($ThisFileInfo['bmp'], $truecolor);
+      return $gd;
+    }
+    return false;
+  }
+
+  function phpthumb_bmpfile2gd($filename, $truecolor=true) {
+    if ($fp = @fopen($filename, 'rb')) {
+      $BMPdata = fread($fp, filesize($filename));
+      fclose($fp);
+      return $this->phpthumb_bmp2gd($BMPdata, $truecolor);
+    }
+    return false;
+  }
+
+  function GD2BMPstring(&$gd_image) {
+    $imageX = ImageSX($gd_image);
+    $imageY = ImageSY($gd_image);
+
+    $BMP = '';
+    for ($y = ($imageY - 1); $y >= 0; $y--) {
+      $thisline = '';
+      for ($x = 0; $x < $imageX; $x++) {
+        $argb = phpthumb_functions::GetPixelColor($gd_image, $x, $y);
+        $thisline .= chr($argb['blue']).chr($argb['green']).chr($argb['red']);
+      }
+      while (strlen($thisline) % 4) {
+        $thisline .= "\x00";
+      }
+      $BMP .= $thisline;
+    }
+
+    $bmpSize = strlen($BMP) + 14 + 40;
+    // BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp
+    $BITMAPFILEHEADER  = 'BM';                                                           // WORD    bfType;
+    $BITMAPFILEHEADER .= phpthumb_functions::LittleEndian2String($bmpSize, 4); // DWORD   bfSize;
+    $BITMAPFILEHEADER .= phpthumb_functions::LittleEndian2String(       0, 2); // WORD    bfReserved1;
+    $BITMAPFILEHEADER .= phpthumb_functions::LittleEndian2String(       0, 2); // WORD    bfReserved2;
+    $BITMAPFILEHEADER .= phpthumb_functions::LittleEndian2String(      54, 4); // DWORD   bfOffBits;
+
+    // BITMAPINFOHEADER - [40 bytes] http://msdn.microsoft.com/library/en-us/gdi/bitmaps_1rw2.asp
+    $BITMAPINFOHEADER  = phpthumb_functions::LittleEndian2String(      40, 4); // DWORD  biSize;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String( $imageX, 4); // LONG   biWidth;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String( $imageY, 4); // LONG   biHeight;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String(       1, 2); // WORD   biPlanes;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String(      24, 2); // WORD   biBitCount;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String(       0, 4); // DWORD  biCompression;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String(       0, 4); // DWORD  biSizeImage;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String(    2835, 4); // LONG   biXPelsPerMeter;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String(    2835, 4); // LONG   biYPelsPerMeter;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String(       0, 4); // DWORD  biClrUsed;
+    $BITMAPINFOHEADER .= phpthumb_functions::LittleEndian2String(       0, 4); // DWORD  biClrImportant;
+
+    return $BITMAPFILEHEADER.$BITMAPINFOHEADER.$BMP;
+  }
+
+  function getid3_bmp(&$BMPdata, &$ThisFileInfo, $ExtractPalette=false, $ExtractData=false) {
+
+      // shortcuts
+      $ThisFileInfo['bmp']['header']['raw'] = array();
+      $thisfile_bmp                         = &$ThisFileInfo['bmp'];
+      $thisfile_bmp_header                  = &$thisfile_bmp['header'];
+      $thisfile_bmp_header_raw              = &$thisfile_bmp_header['raw'];
+
+    // BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp
+    // all versions
+    // WORD    bfType;
+    // DWORD   bfSize;
+    // WORD    bfReserved1;
+    // WORD    bfReserved2;
+    // DWORD   bfOffBits;
+
+    $offset = 0;
+    $overalloffset = 0;
+    $BMPheader = substr($BMPdata, $overalloffset, 14 + 40);
+    $overalloffset += (14 + 40);
+
+    $thisfile_bmp_header_raw['identifier']  = substr($BMPheader, $offset, 2);
+    $offset += 2;
+
+    if ($thisfile_bmp_header_raw['identifier'] != 'BM') {
+      $ThisFileInfo['error'][] = 'Expecting "BM" at offset '.intval(@$ThisFileInfo['avdataoffset']).', found "'.$thisfile_bmp_header_raw['identifier'].'"';
+      unset($ThisFileInfo['fileformat']);
+      unset($ThisFileInfo['bmp']);
+      return false;
+    }
+
+    $thisfile_bmp_header_raw['filesize']    = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+    $offset += 4;
+    $thisfile_bmp_header_raw['reserved1']   = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+    $offset += 2;
+    $thisfile_bmp_header_raw['reserved2']   = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+    $offset += 2;
+    $thisfile_bmp_header_raw['data_offset'] = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+    $offset += 4;
+    $thisfile_bmp_header_raw['header_size'] = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+    $offset += 4;
+
+
+    // check if the hardcoded-to-1 "planes" is at offset 22 or 26
+    $planes22 = $this->LittleEndian2Int(substr($BMPheader, 22, 2));
+    $planes26 = $this->LittleEndian2Int(substr($BMPheader, 26, 2));
+    if (($planes22 == 1) && ($planes26 != 1)) {
+      $thisfile_bmp['type_os']      = 'OS/2';
+      $thisfile_bmp['type_version'] = 1;
+    } elseif (($planes26 == 1) && ($planes22 != 1)) {
+      $thisfile_bmp['type_os']      = 'Windows';
+      $thisfile_bmp['type_version'] = 1;
+    } elseif ($thisfile_bmp_header_raw['header_size'] == 12) {
+      $thisfile_bmp['type_os']      = 'OS/2';
+      $thisfile_bmp['type_version'] = 1;
+    } elseif ($thisfile_bmp_header_raw['header_size'] == 40) {
+      $thisfile_bmp['type_os']      = 'Windows';
+      $thisfile_bmp['type_version'] = 1;
+    } elseif ($thisfile_bmp_header_raw['header_size'] == 84) {
+      $thisfile_bmp['type_os']      = 'Windows';
+      $thisfile_bmp['type_version'] = 4;
+    } elseif ($thisfile_bmp_header_raw['header_size'] == 100) {
+      $thisfile_bmp['type_os']      = 'Windows';
+      $thisfile_bmp['type_version'] = 5;
+    } else {
+      $ThisFileInfo['error'][] = 'Unknown BMP subtype (or not a BMP file)';
+      unset($ThisFileInfo['fileformat']);
+      unset($ThisFileInfo['bmp']);
+      return false;
+    }
+
+    $ThisFileInfo['fileformat']                  = 'bmp';
+    $ThisFileInfo['video']['dataformat']         = 'bmp';
+    $ThisFileInfo['video']['lossless']           = true;
+    $ThisFileInfo['video']['pixel_aspect_ratio'] = (float) 1;
+
+    if ($thisfile_bmp['type_os'] == 'OS/2') {
+
+      // OS/2-format BMP
+      // http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm
+
+      // DWORD  Size;             /* Size of this structure in bytes */
+      // DWORD  Width;            /* Bitmap width in pixels */
+      // DWORD  Height;           /* Bitmap height in pixel */
+      // WORD   NumPlanes;        /* Number of bit planes (color depth) */
+      // WORD   BitsPerPixel;     /* Number of bits per pixel per plane */
+
+      $thisfile_bmp_header_raw['width']          = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+      $offset += 2;
+      $thisfile_bmp_header_raw['height']         = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+      $offset += 2;
+      $thisfile_bmp_header_raw['planes']         = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+      $offset += 2;
+      $thisfile_bmp_header_raw['bits_per_pixel'] = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+      $offset += 2;
+
+      $ThisFileInfo['video']['resolution_x']    = $thisfile_bmp_header_raw['width'];
+      $ThisFileInfo['video']['resolution_y']    = $thisfile_bmp_header_raw['height'];
+      $ThisFileInfo['video']['codec']           = 'BI_RGB '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit';
+      $ThisFileInfo['video']['bits_per_sample'] = $thisfile_bmp_header_raw['bits_per_pixel'];
+
+      if ($thisfile_bmp['type_version'] >= 2) {
+        // DWORD  Compression;      /* Bitmap compression scheme */
+        // DWORD  ImageDataSize;    /* Size of bitmap data in bytes */
+        // DWORD  XResolution;      /* X resolution of display device */
+        // DWORD  YResolution;      /* Y resolution of display device */
+        // DWORD  ColorsUsed;       /* Number of color table indices used */
+        // DWORD  ColorsImportant;  /* Number of important color indices */
+        // WORD   Units;            /* Type of units used to measure resolution */
+        // WORD   Reserved;         /* Pad structure to 4-byte boundary */
+        // WORD   Recording;        /* Recording algorithm */
+        // WORD   Rendering;        /* Halftoning algorithm used */
+        // DWORD  Size1;            /* Reserved for halftoning algorithm use */
+        // DWORD  Size2;            /* Reserved for halftoning algorithm use */
+        // DWORD  ColorEncoding;    /* Color model used in bitmap */
+        // DWORD  Identifier;       /* Reserved for application use */
+
+        $thisfile_bmp_header_raw['compression']      = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['bmp_data_size']    = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['resolution_h']     = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['resolution_v']     = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['colors_used']      = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['colors_important'] = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['resolution_units'] = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+        $offset += 2;
+        $thisfile_bmp_header_raw['reserved1']        = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+        $offset += 2;
+        $thisfile_bmp_header_raw['recording']        = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+        $offset += 2;
+        $thisfile_bmp_header_raw['rendering']        = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+        $offset += 2;
+        $thisfile_bmp_header_raw['size1']            = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['size2']            = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['color_encoding']   = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['identifier']       = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+
+        $thisfile_bmp_header['compression']          = $this->BMPcompressionOS2Lookup($thisfile_bmp_header_raw['compression']);
+
+        $ThisFileInfo['video']['codec'] = $thisfile_bmp_header['compression'].' '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit';
+      }
+
+    } elseif ($thisfile_bmp['type_os'] == 'Windows') {
+
+      // Windows-format BMP
+
+      // BITMAPINFOHEADER - [40 bytes] http://msdn.microsoft.com/library/en-us/gdi/bitmaps_1rw2.asp
+      // all versions
+      // DWORD  biSize;
+      // LONG   biWidth;
+      // LONG   biHeight;
+      // WORD   biPlanes;
+      // WORD   biBitCount;
+      // DWORD  biCompression;
+      // DWORD  biSizeImage;
+      // LONG   biXPelsPerMeter;
+      // LONG   biYPelsPerMeter;
+      // DWORD  biClrUsed;
+      // DWORD  biClrImportant;
+
+      $thisfile_bmp_header_raw['width']            = $this->LittleEndian2Int(substr($BMPheader, $offset, 4), true);
+      $offset += 4;
+      $thisfile_bmp_header_raw['height']           = $this->LittleEndian2Int(substr($BMPheader, $offset, 4), true);
+      $offset += 4;
+      $thisfile_bmp_header_raw['planes']           = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+      $offset += 2;
+      $thisfile_bmp_header_raw['bits_per_pixel']   = $this->LittleEndian2Int(substr($BMPheader, $offset, 2));
+      $offset += 2;
+      $thisfile_bmp_header_raw['compression']      = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+      $offset += 4;
+      $thisfile_bmp_header_raw['bmp_data_size']    = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+      $offset += 4;
+      $thisfile_bmp_header_raw['resolution_h']     = $this->LittleEndian2Int(substr($BMPheader, $offset, 4), true);
+      $offset += 4;
+      $thisfile_bmp_header_raw['resolution_v']     = $this->LittleEndian2Int(substr($BMPheader, $offset, 4), true);
+      $offset += 4;
+      $thisfile_bmp_header_raw['colors_used']      = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+      $offset += 4;
+      $thisfile_bmp_header_raw['colors_important'] = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+      $offset += 4;
+
+      $thisfile_bmp_header['compression'] = $this->BMPcompressionWindowsLookup($thisfile_bmp_header_raw['compression']);
+      $ThisFileInfo['video']['resolution_x']    = $thisfile_bmp_header_raw['width'];
+      $ThisFileInfo['video']['resolution_y']    = $thisfile_bmp_header_raw['height'];
+      $ThisFileInfo['video']['codec']           = $thisfile_bmp_header['compression'].' '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit';
+      $ThisFileInfo['video']['bits_per_sample'] = $thisfile_bmp_header_raw['bits_per_pixel'];
+
+      if (($thisfile_bmp['type_version'] >= 4) || ($thisfile_bmp_header_raw['compression'] == 3)) {
+        // should only be v4+, but BMPs with type_version==1 and BI_BITFIELDS compression have been seen
+        $BMPheader .= substr($BMPdata, $overalloffset, 44);
+        $overalloffset += 44;
+
+        // BITMAPV4HEADER - [44 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_2k1e.asp
+        // Win95+, WinNT4.0+
+        // DWORD        bV4RedMask;
+        // DWORD        bV4GreenMask;
+        // DWORD        bV4BlueMask;
+        // DWORD        bV4AlphaMask;
+        // DWORD        bV4CSType;
+        // CIEXYZTRIPLE bV4Endpoints;
+        // DWORD        bV4GammaRed;
+        // DWORD        bV4GammaGreen;
+        // DWORD        bV4GammaBlue;
+        $thisfile_bmp_header_raw['red_mask']     = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['green_mask']   = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['blue_mask']    = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['alpha_mask']   = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['cs_type']      = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['ciexyz_red']   =                         substr($BMPheader, $offset, 4);
+        $offset += 4;
+        $thisfile_bmp_header_raw['ciexyz_green'] =                         substr($BMPheader, $offset, 4);
+        $offset += 4;
+        $thisfile_bmp_header_raw['ciexyz_blue']  =                         substr($BMPheader, $offset, 4);
+        $offset += 4;
+        $thisfile_bmp_header_raw['gamma_red']    = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['gamma_green']  = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['gamma_blue']   = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+
+        $thisfile_bmp_header['ciexyz_red']   = $this->FixedPoint2_30(strrev($thisfile_bmp_header_raw['ciexyz_red']));
+        $thisfile_bmp_header['ciexyz_green'] = $this->FixedPoint2_30(strrev($thisfile_bmp_header_raw['ciexyz_green']));
+        $thisfile_bmp_header['ciexyz_blue']  = $this->FixedPoint2_30(strrev($thisfile_bmp_header_raw['ciexyz_blue']));
+      }
+
+      if ($thisfile_bmp['type_version'] >= 5) {
+        $BMPheader .= substr($BMPdata, $overalloffset, 16);
+        $overalloffset += 16;
+
+        // BITMAPV5HEADER - [16 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_7c36.asp
+        // Win98+, Win2000+
+        // DWORD        bV5Intent;
+        // DWORD        bV5ProfileData;
+        // DWORD        bV5ProfileSize;
+        // DWORD        bV5Reserved;
+        $thisfile_bmp_header_raw['intent']              = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['profile_data_offset'] = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['profile_data_size']   = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+        $thisfile_bmp_header_raw['reserved3']           = $this->LittleEndian2Int(substr($BMPheader, $offset, 4));
+        $offset += 4;
+      }
+
+    } else {
+
+      $ThisFileInfo['error'][] = 'Unknown BMP format in header.';
+      return false;
+
+    }
+
+    if ($ExtractPalette || $ExtractData) {
+      $PaletteEntries = 0;
+      if ($thisfile_bmp_header_raw['bits_per_pixel'] < 16) {
+        $PaletteEntries = pow(2, $thisfile_bmp_header_raw['bits_per_pixel']);
+      } elseif (isset($thisfile_bmp_header_raw['colors_used']) && ($thisfile_bmp_header_raw['colors_used'] > 0) && ($thisfile_bmp_header_raw['colors_used'] <= 256)) {
+        $PaletteEntries = $thisfile_bmp_header_raw['colors_used'];
+      }
+      if ($PaletteEntries > 0) {
+        $BMPpalette = substr($BMPdata, $overalloffset, 4 * $PaletteEntries);
+        $overalloffset += 4 * $PaletteEntries;
+
+        $paletteoffset = 0;
+        for ($i = 0; $i < $PaletteEntries; $i++) {
+          // RGBQUAD          - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_5f8y.asp
+          // BYTE    rgbBlue;
+          // BYTE    rgbGreen;
+          // BYTE    rgbRed;
+          // BYTE    rgbReserved;
+          $blue  = $this->LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1));
+          $green = $this->LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1));
+          $red   = $this->LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1));
+          if (($thisfile_bmp['type_os'] == 'OS/2') && ($thisfile_bmp['type_version'] == 1)) {
+            // no padding byte
+          } else {
+            $paletteoffset++; // padding byte
+          }
+          $thisfile_bmp['palette'][$i] = (($red << 16) | ($green << 8) | ($blue));
+        }
+      }
+    }
+
+    if ($ExtractData) {
+      $RowByteLength = ceil(($thisfile_bmp_header_raw['width'] * ($thisfile_bmp_header_raw['bits_per_pixel'] / 8)) / 4) * 4; // round up to nearest DWORD boundry
+
+      $BMPpixelData = substr($BMPdata, $thisfile_bmp_header_raw['data_offset'], $thisfile_bmp_header_raw['height'] * $RowByteLength);
+      $overalloffset = $thisfile_bmp_header_raw['data_offset'] + ($thisfile_bmp_header_raw['height'] * $RowByteLength);
+
+      $pixeldataoffset = 0;
+      switch (@$thisfile_bmp_header_raw['compression']) {
+
+        case 0: // BI_RGB
+          switch ($thisfile_bmp_header_raw['bits_per_pixel']) {
+            case 1:
+              for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
+                for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) {
+                  $paletteindexbyte = ord($BMPpixelData{$pixeldataoffset++});
+                  for ($i = 7; $i >= 0; $i--) {
+                    $paletteindex = ($paletteindexbyte & (0x01 << $i)) >> $i;
+                    $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
+                    $col++;
+                  }
+                }
+                while (($pixeldataoffset % 4) != 0) {
+                  // lines are padded to nearest DWORD
+                  $pixeldataoffset++;
+                }
+              }
+              break;
+
+            case 4:
+              for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
+                for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) {
+                  $paletteindexbyte = ord($BMPpixelData{$pixeldataoffset++});
+                  for ($i = 1; $i >= 0; $i--) {
+                    $paletteindex = ($paletteindexbyte & (0x0F << (4 * $i))) >> (4 * $i);
+                    $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
+                    $col++;
+                  }
+                }
+                while (($pixeldataoffset % 4) != 0) {
+                  // lines are padded to nearest DWORD
+                  $pixeldataoffset++;
+                }
+              }
+              break;
+
+            case 8:
+              for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
+                for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
+                  $paletteindex = ord($BMPpixelData{$pixeldataoffset++});
+                  $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
+                }
+                while (($pixeldataoffset % 4) != 0) {
+                  // lines are padded to nearest DWORD
+                  $pixeldataoffset++;
+                }
+              }
+              break;
+
+            case 24:
+              for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
+                for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
+                  $thisfile_bmp['data'][$row][$col] = (ord($BMPpixelData{$pixeldataoffset+2}) << 16) | (ord($BMPpixelData{$pixeldataoffset+1}) << 8) | ord($BMPpixelData{$pixeldataoffset});
+                  $pixeldataoffset += 3;
+                }
+                while (($pixeldataoffset % 4) != 0) {
+                  // lines are padded to nearest DWORD
+                  $pixeldataoffset++;
+                }
+              }
+              break;
+
+            case 32:
+              for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
+                for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
+                  $thisfile_bmp['data'][$row][$col] = (ord($BMPpixelData{$pixeldataoffset+3}) << 24) | (ord($BMPpixelData{$pixeldataoffset+2}) << 16) | (ord($BMPpixelData{$pixeldataoffset+1}) << 8) | ord($BMPpixelData{$pixeldataoffset});
+                  $pixeldataoffset += 4;
+                }
+                while (($pixeldataoffset % 4) != 0) {
+                  // lines are padded to nearest DWORD
+                  $pixeldataoffset++;
+                }
+              }
+              break;
+
+            case 16:
+              // ?
+              break;
+
+            default:
+              $ThisFileInfo['error'][] = 'Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data';
+              break;
+          }
+          break;
+
+
+        case 1: // BI_RLE8 - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_6x0u.asp
+          switch ($thisfile_bmp_header_raw['bits_per_pixel']) {
+            case 8:
+              $pixelcounter = 0;
+              while ($pixeldataoffset < strlen($BMPpixelData)) {
+                $firstbyte  = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                $secondbyte = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                if ($firstbyte == 0) {
+
+                  // escaped/absolute mode - the first byte of the pair can be set to zero to
+                  // indicate an escape character that denotes the end of a line, the end of
+                  // a bitmap, or a delta, depending on the value of the second byte.
+                  switch ($secondbyte) {
+                    case 0:
+                      // end of line
+                      // no need for special processing, just ignore
+                      break;
+
+                    case 1:
+                      // end of bitmap
+                      $pixeldataoffset = strlen($BMPpixelData); // force to exit loop just in case
+                      break;
+
+                    case 2:
+                      // delta - The 2 bytes following the escape contain unsigned values
+                      // indicating the horizontal and vertical offsets of the next pixel
+                      // from the current position.
+                      $colincrement = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                      $rowincrement = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                      $col = ($pixelcounter % $thisfile_bmp_header_raw['width']) + $colincrement;
+                      $row = ($thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width'])) - $rowincrement;
+                      $pixelcounter = ($row * $thisfile_bmp_header_raw['width']) + $col;
+                      break;
+
+                    default:
+                      // In absolute mode, the first byte is zero and the second byte is a
+                      // value in the range 03H through FFH. The second byte represents the
+                      // number of bytes that follow, each of which contains the color index
+                      // of a single pixel. Each run must be aligned on a word boundary.
+                      for ($i = 0; $i < $secondbyte; $i++) {
+                        $paletteindex = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                        $col = $pixelcounter % $thisfile_bmp_header_raw['width'];
+                        $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']);
+                        $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
+                        $pixelcounter++;
+                      }
+                      while (($pixeldataoffset % 2) != 0) {
+                        // Each run must be aligned on a word boundary.
+                        $pixeldataoffset++;
+                      }
+                      break;
+                  }
+
+                } else {
+
+                  // encoded mode - the first byte specifies the number of consecutive pixels
+                  // to be drawn using the color index contained in the second byte.
+                  for ($i = 0; $i < $firstbyte; $i++) {
+                    $col = $pixelcounter % $thisfile_bmp_header_raw['width'];
+                    $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']);
+                    $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$secondbyte];
+                    $pixelcounter++;
+                  }
+
+                }
+              }
+              break;
+
+            default:
+              $ThisFileInfo['error'][] = 'Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data';
+              break;
+          }
+          break;
+
+
+
+        case 2: // BI_RLE4 - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_6x0u.asp
+          switch ($thisfile_bmp_header_raw['bits_per_pixel']) {
+            case 4:
+              $pixelcounter = 0;
+              while ($pixeldataoffset < strlen($BMPpixelData)) {
+                $firstbyte  = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                $secondbyte = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                if ($firstbyte == 0) {
+
+                  // escaped/absolute mode - the first byte of the pair can be set to zero to
+                  // indicate an escape character that denotes the end of a line, the end of
+                  // a bitmap, or a delta, depending on the value of the second byte.
+                  switch ($secondbyte) {
+                    case 0:
+                      // end of line
+                      // no need for special processing, just ignore
+                      break;
+
+                    case 1:
+                      // end of bitmap
+                      $pixeldataoffset = strlen($BMPpixelData); // force to exit loop just in case
+                      break;
+
+                    case 2:
+                      // delta - The 2 bytes following the escape contain unsigned values
+                      // indicating the horizontal and vertical offsets of the next pixel
+                      // from the current position.
+                      $colincrement = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                      $rowincrement = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                      $col = ($pixelcounter % $thisfile_bmp_header_raw['width']) + $colincrement;
+                      $row = ($thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width'])) - $rowincrement;
+                      $pixelcounter = ($row * $thisfile_bmp_header_raw['width']) + $col;
+                      break;
+
+                    default:
+                      // In absolute mode, the first byte is zero. The second byte contains the number
+                      // of color indexes that follow. Subsequent bytes contain color indexes in their
+                      // high- and low-order 4 bits, one color index for each pixel. In absolute mode,
+                      // each run must be aligned on a word boundary.
+                      unset($paletteindexes);
+                      for ($i = 0; $i < ceil($secondbyte / 2); $i++) {
+                        $paletteindexbyte = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+                        $paletteindexes[] = ($paletteindexbyte & 0xF0) >> 4;
+                        $paletteindexes[] = ($paletteindexbyte & 0x0F);
+                      }
+                      while (($pixeldataoffset % 2) != 0) {
+                        // Each run must be aligned on a word boundary.
+                        $pixeldataoffset++;
+                      }
+
+                      foreach ($paletteindexes as $dummy => $paletteindex) {
+                        $col = $pixelcounter % $thisfile_bmp_header_raw['width'];
+                        $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']);
+                        $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
+                        $pixelcounter++;
+                      }
+                      break;
+                  }
+
+                } else {
+
+                  // encoded mode - the first byte of the pair contains the number of pixels to be
+                  // drawn using the color indexes in the second byte. The second byte contains two
+                  // color indexes, one in its high-order 4 bits and one in its low-order 4 bits.
+                  // The first of the pixels is drawn using the color specified by the high-order
+                  // 4 bits, the second is drawn using the color in the low-order 4 bits, the third
+                  // is drawn using the color in the high-order 4 bits, and so on, until all the
+                  // pixels specified by the first byte have been drawn.
+                  $paletteindexes[0] = ($secondbyte & 0xF0) >> 4;
+                  $paletteindexes[1] = ($secondbyte & 0x0F);
+                  for ($i = 0; $i < $firstbyte; $i++) {
+                    $col = $pixelcounter % $thisfile_bmp_header_raw['width'];
+                    $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']);
+                    $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindexes[($i % 2)]];
+                    $pixelcounter++;
+                  }
+
+                }
+              }
+              break;
+
+            default:
+              $ThisFileInfo['error'][] = 'Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data';
+              break;
+          }
+          break;
+
+
+        case 3: // BI_BITFIELDS
+          switch ($thisfile_bmp_header_raw['bits_per_pixel']) {
+            case 16:
+            case 32:
+              $redshift   = 0;
+              $greenshift = 0;
+              $blueshift  = 0;
+              if (!$thisfile_bmp_header_raw['red_mask'] || !$thisfile_bmp_header_raw['green_mask'] || !$thisfile_bmp_header_raw['blue_mask']) {
+                $ThisFileInfo['error'][] = 'missing $thisfile_bmp_header_raw[(red|green|blue)_mask]';
+                return false;
+              }
+              while ((($thisfile_bmp_header_raw['red_mask'] >> $redshift) & 0x01) == 0) {
+                $redshift++;
+              }
+              while ((($thisfile_bmp_header_raw['green_mask'] >> $greenshift) & 0x01) == 0) {
+                $greenshift++;
+              }
+              while ((($thisfile_bmp_header_raw['blue_mask'] >> $blueshift) & 0x01) == 0) {
+                $blueshift++;
+              }
+              for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
+                for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
+                  $pixelvalue = $this->LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset, $thisfile_bmp_header_raw['bits_per_pixel'] / 8));
+                  $pixeldataoffset += $thisfile_bmp_header_raw['bits_per_pixel'] / 8;
+
+                  $red   = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['red_mask'])   >> $redshift)   / ($thisfile_bmp_header_raw['red_mask']   >> $redshift))   * 255));
+                  $green = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['green_mask']) >> $greenshift) / ($thisfile_bmp_header_raw['green_mask'] >> $greenshift)) * 255));
+                  $blue  = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['blue_mask'])  >> $blueshift)  / ($thisfile_bmp_header_raw['blue_mask']  >> $blueshift))  * 255));
+                  $thisfile_bmp['data'][$row][$col] = (($red << 16) | ($green << 8) | ($blue));
+                }
+                while (($pixeldataoffset % 4) != 0) {
+                  // lines are padded to nearest DWORD
+                  $pixeldataoffset++;
+                }
+              }
+              break;
+
+            default:
+              $ThisFileInfo['error'][] = 'Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data';
+              break;
+          }
+          break;
+
+
+        default: // unhandled compression type
+          $ThisFileInfo['error'][] = 'Unknown/unhandled compression type value ('.$thisfile_bmp_header_raw['compression'].') - cannot decompress pixel data';
+          break;
+      }
+    }
+
+    return true;
+  }
+
+  function IntColor2RGB($color) {
+    $red   = ($color & 0x00FF0000) >> 16;
+    $green = ($color & 0x0000FF00) >> 8;
+    $blue  = ($color & 0x000000FF);
+    return array($red, $green, $blue);
+  }
+
+  function PlotPixelsGD(&$BMPdata, $truecolor=true) {
+    $imagewidth  = $BMPdata['header']['raw']['width'];
+    $imageheight = $BMPdata['header']['raw']['height'];
+
+    if ($truecolor) {
+
+      $gd = @ImageCreateTrueColor($imagewidth, $imageheight);
+
+    } else {
+
+      $gd = @ImageCreate($imagewidth, $imageheight);
+      if (!empty($BMPdata['palette'])) {
+        // create GD palette from BMP palette
+        foreach ($BMPdata['palette'] as $dummy => $color) {
+          list($r, $g, $b) = $this->IntColor2RGB($color);
+          ImageColorAllocate($gd, $r, $g, $b);
+        }
+      } else {
+        // create 216-color websafe palette
+        for ($r = 0x00; $r <= 0xFF; $r += 0x33) {
+          for ($g = 0x00; $g <= 0xFF; $g += 0x33) {
+            for ($b = 0x00; $b <= 0xFF; $b += 0x33) {
+              ImageColorAllocate($gd, $r, $g, $b);
+            }
+          }
+        }
+      }
+
+    }
+    if (!is_resource($gd)) {
+      return false;
+    }
+
+    foreach ($BMPdata['data'] as $row => $colarray) {
+      @set_time_limit(30);
+      foreach ($colarray as $col => $color) {
+        list($red, $green, $blue) = $this->IntColor2RGB($color);
+        if ($truecolor) {
+          $pixelcolor = ImageColorAllocate($gd, $red, $green, $blue);
+        } else {
+          $pixelcolor = ImageColorClosest($gd, $red, $green, $blue);
+        }
+        ImageSetPixel($gd, $col, $row, $pixelcolor);
+      }
+    }
+    return $gd;
+  }
+
+  function PlotBMP(&$BMPinfo) {
+    $starttime = time();
+    if (!isset($BMPinfo['bmp']['data']) || !is_array($BMPinfo['bmp']['data'])) {
+      echo 'ERROR: no pixel data<BR>';
+      return false;
+    }
+    set_time_limit(intval(round($BMPinfo['resolution_x'] * $BMPinfo['resolution_y'] / 10000)));
+    $im = $this->PlotPixelsGD($BMPinfo['bmp']);
+    if (headers_sent()) {
+      echo 'plotted '.($BMPinfo['resolution_x'] * $BMPinfo['resolution_y']).' pixels in '.(time() - $starttime).' seconds<BR>';
+      ImageDestroy($im);
+      exit;
+    } else {
+      header('Content-Type: image/png');
+      ImagePNG($im);
+      ImageDestroy($im);
+      return true;
+    }
+    return false;
+  }
+
+  function BMPcompressionWindowsLookup($compressionid) {
+    static $BMPcompressionWindowsLookup = array(
+      0 => 'BI_RGB',
+      1 => 'BI_RLE8',
+      2 => 'BI_RLE4',
+      3 => 'BI_BITFIELDS',
+      4 => 'BI_JPEG',
+      5 => 'BI_PNG'
+    );
+    return (isset($BMPcompressionWindowsLookup[$compressionid]) ? $BMPcompressionWindowsLookup[$compressionid] : 'invalid');
+  }
+
+  function BMPcompressionOS2Lookup($compressionid) {
+    static $BMPcompressionOS2Lookup = array(
+      0 => 'BI_RGB',
+      1 => 'BI_RLE8',
+      2 => 'BI_RLE4',
+      3 => 'Huffman 1D',
+      4 => 'BI_RLE24',
+    );
+    return (isset($BMPcompressionOS2Lookup[$compressionid]) ? $BMPcompressionOS2Lookup[$compressionid] : 'invalid');
+  }
+
+
+  // from getid3.lib.php
+
+  function trunc($floatnumber) {
+    // truncates a floating-point number at the decimal point
+    // returns int (if possible, otherwise float)
+    if ($floatnumber >= 1) {
+      $truncatednumber = floor($floatnumber);
+    } elseif ($floatnumber <= -1) {
+      $truncatednumber = ceil($floatnumber);
+    } else {
+      $truncatednumber = 0;
+    }
+    if ($truncatednumber <= 1073741824) { // 2^30
+      $truncatednumber = (int) $truncatednumber;
+    }
+    return $truncatednumber;
+  }
+
+  function LittleEndian2Int($byteword) {
+    $intvalue = 0;
+    $byteword = strrev($byteword);
+    $bytewordlen = strlen($byteword);
+    for ($i = 0; $i < $bytewordlen; $i++) {
+      $intvalue += ord($byteword{$i}) * pow(256, ($bytewordlen - 1 - $i));
+    }
+    return $intvalue;
+  }
+
+  function BigEndian2Int($byteword) {
+    return $this->LittleEndian2Int(strrev($byteword));
+  }
+
+  function BigEndian2Bin($byteword) {
+    $binvalue = '';
+    $bytewordlen = strlen($byteword);
+    for ($i = 0; $i < $bytewordlen; $i++) {
+      $binvalue .= str_pad(decbin(ord($byteword{$i})), 8, '0', STR_PAD_LEFT);
+    }
+    return $binvalue;
+  }
+
+  function FixedPoint2_30($rawdata) {
+    $binarystring = $this->BigEndian2Bin($rawdata);
+    return $this->Bin2Dec(substr($binarystring, 0, 2)) + (float) ($this->Bin2Dec(substr($binarystring, 2, 30)) / 1073741824);
+  }
+
+  function Bin2Dec($binstring, $signed=false) {
+    $signmult = 1;
+    if ($signed) {
+      if ($binstring{0} == '1') {
+        $signmult = -1;
+      }
+      $binstring = substr($binstring, 1);
+    }
+    $decvalue = 0;
+    for ($i = 0; $i < strlen($binstring); $i++) {
+      $decvalue += ((int) substr($binstring, strlen($binstring) - $i - 1, 1)) * pow(2, $i);
+    }
+    return $this->CastAsInt($decvalue * $signmult);
+  }
+
+  function CastAsInt($floatnum) {
+    // convert to float if not already
+    $floatnum = (float) $floatnum;
+
+    // convert a float to type int, only if possible
+    if ($this->trunc($floatnum) == $floatnum) {
+      // it's not floating point
+      if ($floatnum <= 1073741824) { // 2^30
+        // it's within int range
+        $floatnum = (int) $floatnum;
+      }
+    }
+    return $floatnum;
+  }
+
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.class.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3440 @@
+<?php
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+// See: phpthumb.readme.txt for usage instructions          //
+//                                                         ///
+//////////////////////////////////////////////////////////////
+
+ob_start();
+if (!include_once(dirname(__FILE__).'/phpthumb.functions.php')) {
+  ob_end_flush();
+  die('failed to include_once("'.realpath(dirname(__FILE__).'/phpthumb.functions.php').'")');
+}
+ob_end_clean();
+
+class phpthumb {
+
+  // public:
+  // START PARAMETERS (for object mode and phpThumb.php)
+  // See phpthumb.readme.txt for descriptions of what each of these values are
+  var $src  = null;     // SouRCe filename
+  var $new  = null;     // NEW image (phpThumb.php only)
+  var $w    = null;     // Width
+  var $h    = null;     // Height
+  var $wp   = null;     // Width  (Portrait Images Only)
+  var $hp   = null;     // Height (Portrait Images Only)
+  var $wl   = null;     // Width  (Landscape Images Only)
+  var $hl   = null;     // Height (Landscape Images Only)
+  var $ws   = null;     // Width  (Square Images Only)
+  var $hs   = null;     // Height (Square Images Only)
+  var $f    = null;     // Format
+  var $q    = 75;       // jpeg output Quality
+  var $sx   = null;     // Source crop top-left X position
+  var $sy   = null;     // Source crop top-left Y position
+  var $sw   = null;     // Source crop Width
+  var $sh   = null;     // Source crop Height
+  var $zc   = null;     // Zoom Crop
+  var $bc   = null;     // Border Color
+  var $bg   = null;     // BackGround color
+  var $fltr = array();  // FiLTeRs
+  var $goto = null;     // GO TO url after processing
+  var $err  = null;     // default ERRor image filename
+  var $xto  = null;     // extract eXif Thumbnail Only
+  var $ra   = null;     // Rotate by Angle
+  var $ar   = null;     // Auto Rotate
+  var $aoe  = null;     // Allow Output Enlargement
+  var $far  = null;     // Fixed Aspect Ratio
+  var $iar  = null;     // Ignore Aspect Ratio
+  var $maxb = null;     // MAXimum Bytes
+  var $down = null;     // DOWNload thumbnail filename
+  var $md5s = null;     // MD5 hash of Source image
+  var $file = null;     // >>deprecated, do not use<<
+
+  var $phpThumbDebug = null;
+  // END PARAMETERS
+
+
+  // public:
+  // START CONFIGURATION OPTIONS (for object mode only)
+  // See phpThumb.config.php for descriptions of what each of these settings do
+
+  // * Directory Configuration
+  var $config_cache_directory                      = null;
+  var $config_cache_disable_warning                = true;
+  var $config_cache_source_enabled                 = false;
+  var $config_cache_source_directory               = null;
+  var $config_temp_directory                       = null;
+  var $config_document_root                        = null;
+
+  // * Default output configuration:
+  var $config_output_format                        = 'jpeg';
+  var $config_output_maxwidth                      = 0;
+  var $config_output_maxheight                     = 0;
+  var $config_output_interlace                     = true;
+
+  // * Error message configuration
+  var $config_error_image_width                    = 400;
+  var $config_error_image_height                   = 100;
+  var $config_error_message_image_default          = '';
+  var $config_error_bgcolor                        = 'CCCCFF';
+  var $config_error_textcolor                      = 'FF0000';
+  var $config_error_fontsize                       = 1;
+  var $config_error_die_on_error                   = false;
+  var $config_error_silent_die_on_error            = false;
+  var $config_error_die_on_source_failure          = true;
+
+  // * Anti-Hotlink Configuration:
+  var $config_nohotlink_enabled                    = true;
+  var $config_nohotlink_valid_domains              = array();
+  var $config_nohotlink_erase_image                = true;
+  var $config_nohotlink_text_message               = 'Off-server thumbnailing is not allowed';
+  // * Off-server Linking Configuration:
+  var $config_nooffsitelink_enabled                = false;
+  var $config_nooffsitelink_valid_domains          = array();
+  var $config_nooffsitelink_require_refer          = false;
+  var $config_nooffsitelink_erase_image            = true;
+  var $config_nooffsitelink_text_message           = 'Off-server linking is not allowed';
+
+  // * Border & Background default colors
+  var $config_border_hexcolor                      = '000000';
+  var $config_background_hexcolor                  = 'FFFFFF';
+
+  // * TrueType Fonts
+  var $config_ttf_directory                        = '.';
+
+  var $config_max_source_pixels                    = null;
+  var $config_use_exif_thumbnail_for_speed         = false;
+  var $allow_local_http_src                        = false;
+
+  var $config_imagemagick_path                     = null;
+  var $config_prefer_imagemagick                   = true;
+
+  var $config_cache_maxage                         = null;
+  var $config_cache_maxsize                        = null;
+  var $config_cache_maxfiles                       = null;
+  var $config_cache_source_filemtime_ignore_local  = false;
+  var $config_cache_source_filemtime_ignore_remote = true;
+  var $config_cache_default_only_suffix            = false;
+  var $config_cache_force_passthru                 = true;
+  var $config_cache_prefix                         = '';    // default value set in the constructor below
+
+  // * MySQL
+  var $config_mysql_query                          = null;
+  var $config_mysql_hostname                       = null;
+  var $config_mysql_username                       = null;
+  var $config_mysql_password                       = null;
+  var $config_mysql_database                       = null;
+
+  // * Security
+  var $config_high_security_enabled                = false;
+  var $config_high_security_password               = null;
+  var $config_disable_debug                        = false;
+  var $config_allow_src_above_docroot              = false;
+  var $config_allow_src_above_phpthumb             = true;
+  var $config_allow_parameter_file                 = false;
+  var $config_allow_parameter_goto                 = false;
+
+  // * Compatability
+  var $config_disable_pathinfo_parsing             = false;
+  var $config_disable_imagecopyresampled           = false;
+  var $config_disable_onlycreateable_passthru      = false;
+
+  var $config_http_user_agent                      = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7';
+
+  // END CONFIGURATION OPTIONS
+
+
+  // public: error messages (read-only)
+  var $debugmessages = array();
+  var $debugtiming   = array();
+  var $fatalerror    = null;
+
+
+  // private: (should not be modified directly)
+  var $thumbnailQuality = 75;
+  var $thumbnailFormat  = null;
+
+  var $sourceFilename   = null;
+  var $rawImageData     = null;
+  var $IMresizedData    = null;
+  var $outputImageData  = null;
+
+  var $useRawIMoutput   = false;
+
+  var $gdimg_output     = null;
+  var $gdimg_source     = null;
+
+  var $getimagesizeinfo = null;
+
+  var $source_width  = null;
+  var $source_height = null;
+
+  var $thumbnailCropX = null;
+  var $thumbnailCropY = null;
+  var $thumbnailCropW = null;
+  var $thumbnailCropH = null;
+
+  var $exif_thumbnail_width  = null;
+  var $exif_thumbnail_height = null;
+  var $exif_thumbnail_type   = null;
+  var $exif_thumbnail_data   = null;
+  var $exif_raw_data         = null;
+
+  var $thumbnail_width        = null;
+  var $thumbnail_height       = null;
+  var $thumbnail_image_width  = null;
+  var $thumbnail_image_height = null;
+
+  var $cache_filename         = null;
+
+  var $AlphaCapableFormats = array('png', 'ico', 'gif');
+  var $is_alpha = false;
+
+  var $iswindows = null;
+
+  var $phpthumb_version = '1.7.3-200607111933';
+
+  //////////////////////////////////////////////////////////////////////
+
+  // public: constructor
+  function phpThumb() {
+    $this->DebugTimingMessage('phpThumb() constructor', __FILE__, __LINE__);
+    $this->DebugMessage('phpThumb() v'.$this->phpthumb_version, __FILE__, __LINE__);
+    $this->config_max_source_pixels = round(max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576 * 0.20); // 20% of memory_limit
+    $this->iswindows = (bool) (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN');
+    $this->config_temp_directory = realpath($this->config_temp_directory ? $this->config_temp_directory : (getenv('TMPDIR') ? getenv('TMPDIR') : getenv('TMP')));
+    $this->config_document_root = (@$_SERVER['DOCUMENT_ROOT'] ? $_SERVER['DOCUMENT_ROOT'] : $this->config_document_root);
+    $this->config_cache_prefix = 'phpThumb_cache_'.@$_SERVER['SERVER_NAME'];
+
+    $php_sapi_name = strtolower(function_exists('php_sapi_name') ? php_sapi_name() : '');
+    if ($php_sapi_name == 'cli') {
+      $this->config_allow_src_above_docroot = true;
+    }
+  }
+
+  // public:
+  function setSourceFilename($sourceFilename) {
+    $this->rawImageData   = null;
+    $this->sourceFilename = $sourceFilename;
+    $this->src            = $sourceFilename;
+    $this->DebugMessage('setSourceFilename('.$sourceFilename.') set $this->sourceFilename to "'.$this->sourceFilename.'"', __FILE__, __LINE__);
+    return true;
+  }
+
+  // public:
+  function setSourceData($rawImageData, $sourceFilename='') {
+    $this->sourceFilename = null;
+    $this->rawImageData   = $rawImageData;
+    $this->DebugMessage('setSourceData() setting $this->rawImageData ('.strlen($this->rawImageData).' bytes)', __FILE__, __LINE__);
+    if ($this->config_cache_source_enabled) {
+      $sourceFilename = ($sourceFilename ? $sourceFilename : md5($rawImageData));
+      if (!is_dir($this->config_cache_source_directory)) {
+        $this->ErrorImage('$this->config_cache_source_directory ('.$this->config_cache_source_directory.') is not a directory');
+      } elseif (!@is_writable($this->config_cache_source_directory)) {
+        $this->ErrorImage('$this->config_cache_source_directory ('.$this->config_cache_source_directory.') is not writable');
+      }
+      $this->DebugMessage('setSourceData() attempting to save source image to "'.$this->config_cache_source_directory.DIRECTORY_SEPARATOR.urlencode($sourceFilename).'"', __FILE__, __LINE__);
+      if ($fp = @fopen($this->config_cache_source_directory.DIRECTORY_SEPARATOR.urlencode($sourceFilename), 'wb')) {
+        fwrite($fp, $rawImageData);
+        fclose($fp);
+      } elseif (!$this->phpThumbDebug) {
+        $this->ErrorImage('setSourceData() failed to write to source cache ('.$this->config_cache_source_directory.DIRECTORY_SEPARATOR.urlencode($sourceFilename).')');
+      }
+    }
+    return true;
+  }
+
+  // public:
+  function setSourceImageResource($gdimg) {
+    $this->gdimg_source = $gdimg;
+    return true;
+  }
+
+  // public:
+  function setParameter($param, $value) {
+    if ($param == 'src') {
+      $this->setSourceFilename($this->ResolveFilenameToAbsolute($value));
+    } elseif (@is_array($this->$param)) {
+      if (is_array($value)) {
+        foreach ($value as $arraykey => $arrayvalue) {
+          array_push($this->$param, $arrayvalue);
+        }
+      } else {
+        array_push($this->$param, $value);
+      }
+    } else {
+      $this->$param = $value;
+    }
+    return true;
+  }
+
+  // public:
+  function getParameter($param) {
+    //if (property_exists('phpThumb', $param)) {
+      return $this->$param;
+    //}
+    //$this->DebugMessage('setParameter() attempting to get non-existant parameter "'.$param.'"', __FILE__, __LINE__);
+    //return false;
+  }
+
+
+  // public:
+  function GenerateThumbnail() {
+
+    $this->setOutputFormat();
+    $this->ResolveSource();
+    $this->SetCacheFilename();
+    $this->ExtractEXIFgetImageSize();
+    if ($this->useRawIMoutput) {
+      $this->DebugMessage('Skipping rest of GenerateThumbnail() because $this->useRawIMoutput', __FILE__, __LINE__);
+      return true;
+    }
+    if (!$this->SourceImageToGD()) {
+      $this->DebugMessage('SourceImageToGD() failed', __FILE__, __LINE__);
+      return false;
+    }
+    $this->Rotate();
+    $this->CreateGDoutput();
+
+    switch ($this->far) {
+      case 'L':
+      case 'TL':
+      case 'BL':
+        $destination_offset_x = 0;
+        $destination_offset_y = round(($this->thumbnail_height - $this->thumbnail_image_height) / 2);
+        break;
+      case 'R':
+      case 'TR':
+      case 'BR':
+        $destination_offset_x =  round($this->thumbnail_width  - $this->thumbnail_image_width);
+        $destination_offset_y = round(($this->thumbnail_height - $this->thumbnail_image_height) / 2);
+        break;
+      case 'T':
+      case 'TL':
+      case 'TR':
+        $destination_offset_x = round(($this->thumbnail_width  - $this->thumbnail_image_width)  / 2);
+        $destination_offset_y = 0;
+        break;
+      case 'B':
+      case 'BL':
+      case 'BR':
+        $destination_offset_x = round(($this->thumbnail_width  - $this->thumbnail_image_width)  / 2);
+        $destination_offset_y =  round($this->thumbnail_height - $this->thumbnail_image_height);
+        break;
+      case 'C':
+      default:
+        $destination_offset_x = round(($this->thumbnail_width  - $this->thumbnail_image_width)  / 2);
+        $destination_offset_y = round(($this->thumbnail_height - $this->thumbnail_image_height) / 2);
+    }
+
+//    // copy/resize image to appropriate dimensions
+//    $borderThickness = 0;
+//    if (!empty($this->fltr)) {
+//      foreach ($this->fltr as $key => $value) {
+//        if (ereg('^bord\|([0-9]+)', $value, $matches)) {
+//          $borderThickness = $matches[1];
+//          break;
+//        }
+//      }
+//    }
+//    if ($borderThickness > 0) {
+//      //$this->DebugMessage('Skipping ImageResizeFunction() because BorderThickness="'.$borderThickness.'"', __FILE__, __LINE__);
+//      $this->thumbnail_image_height /= 2;
+//    }
+    $this->ImageResizeFunction(
+      $this->gdimg_output,
+      $this->gdimg_source,
+      $destination_offset_x,
+      $destination_offset_y,
+      $this->thumbnailCropX,
+      $this->thumbnailCropY,
+      $this->thumbnail_image_width,
+      $this->thumbnail_image_height,
+      $this->thumbnailCropW,
+      $this->thumbnailCropH
+    );
+
+    $this->DebugMessage('memory_get_usage() after copy-resize = '.(function_exists('memory_get_usage') ? @memory_get_usage() : 'n/a'), __FILE__, __LINE__);
+    ImageDestroy($this->gdimg_source);
+    $this->DebugMessage('memory_get_usage() after ImageDestroy = '.(function_exists('memory_get_usage') ? @memory_get_usage() : 'n/a'), __FILE__, __LINE__);
+
+    $this->AntiOffsiteLinking();
+    $this->ApplyFilters();
+    $this->AlphaChannelFlatten();
+    $this->MaxFileSize();
+
+    $this->DebugMessage('GenerateThumbnail() completed successfully', __FILE__, __LINE__);
+    return true;
+  }
+
+
+  // public:
+  function RenderOutput() {
+    if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) {
+      $this->DebugMessage('RenderOutput() failed because !is_resource($this->gdimg_output)', __FILE__, __LINE__);
+      return false;
+    }
+    if (!$this->thumbnailFormat) {
+      $this->DebugMessage('RenderOutput() failed because $this->thumbnailFormat is empty', __FILE__, __LINE__);
+      return false;
+    }
+    if ($this->useRawIMoutput) {
+      $this->DebugMessage('RenderOutput copying $this->IMresizedData ('.strlen($this->IMresizedData).' bytes) to $this->outputImage', __FILE__, __LINE__);
+      $this->outputImageData = $this->IMresizedData;
+      return true;
+    }
+
+    $this->DebugMessage('RenderOutput() attempting Image'.strtoupper(@$this->thumbnailFormat).'($this->gdimg_output)', __FILE__, __LINE__);
+    ob_start();
+    switch ($this->thumbnailFormat) {
+      case 'jpeg':
+        ImageJPEG($this->gdimg_output, null, $this->thumbnailQuality);
+        $this->outputImageData = ob_get_contents();
+        break;
+
+      case 'png':
+        ImagePNG($this->gdimg_output);
+        $this->outputImageData = ob_get_contents();
+        break;
+
+      case 'gif':
+        ImageGIF($this->gdimg_output);
+        $this->outputImageData = ob_get_contents();
+        break;
+
+      case 'bmp':
+        $ImageOutFunction = '"builtin BMP output"';
+        if (!@include_once(dirname(__FILE__).'/phpthumb.bmp.php')) {
+          $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.bmp.php" which is required for BMP format output', __FILE__, __LINE__);
+          ob_end_clean();
+          return false;
+        }
+        $phpthumb_bmp = new phpthumb_bmp();
+        $this->outputImageData = $phpthumb_bmp->GD2BMPstring($this->gdimg_output);
+        unset($phpthumb_bmp);
+        break;
+
+      case 'ico':
+        $ImageOutFunction = '"builtin ICO output"';
+        if (!@include_once(dirname(__FILE__).'/phpthumb.ico.php')) {
+          $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.ico.php" which is required for ICO format output', __FILE__, __LINE__);
+          ob_end_clean();
+          return false;
+        }
+        $phpthumb_ico = new phpthumb_ico();
+        $arrayOfOutputImages = array($this->gdimg_output);
+        $this->outputImageData = $phpthumb_ico->GD2ICOstring($arrayOfOutputImages);
+        unset($phpthumb_ico);
+        break;
+
+      default:
+        $this->DebugMessage('RenderToFile failed because $this->thumbnailFormat "'.$this->thumbnailFormat.'" is not valid', __FILE__, __LINE__);
+        ob_end_clean();
+        return false;
+    }
+    ob_end_clean();
+    if (!$this->outputImageData) {
+      $this->DebugMessage('RenderOutput() for "'.$this->thumbnailFormat.'" failed', __FILE__, __LINE__);
+      ob_end_clean();
+      return false;
+    }
+    $this->DebugMessage('RenderOutput() completing with $this->outputImageData = '.strlen($this->outputImageData).' bytes', __FILE__, __LINE__);
+    return true;
+  }
+
+  function RenderToFile($filename) {
+    if (eregi('^(f|ht)tps?\://', $filename)) {
+      $this->DebugMessage('RenderToFile() failed because $filename ('.$filename.') is a URL', __FILE__, __LINE__);
+      return false;
+    }
+    // render thumbnail to this file only, do not cache, do not output to browser
+    //$renderfilename = $this->ResolveFilenameToAbsolute(dirname($filename)).DIRECTORY_SEPARATOR.basename($filename);
+    $renderfilename = $filename;
+    if (($filename{0} != '/') && ($filename{0} != '\\') && ($filename{1} != ':')) {
+      $renderfilename = $this->ResolveFilenameToAbsolute($renderfilename);
+    }
+    if (!@is_writable(dirname($renderfilename))) {
+      $this->DebugMessage('RenderToFile() failed because "'.dirname($renderfilename).'/" is not writable', __FILE__, __LINE__);
+      return false;
+    }
+    if (@is_file($renderfilename) && !@is_writable($renderfilename)) {
+      $this->DebugMessage('RenderToFile() failed because "'.$renderfilename.'" is not writable', __FILE__, __LINE__);
+      return false;
+    }
+
+    if ($this->RenderOutput()) {
+      if (file_put_contents($renderfilename, $this->outputImageData)) {
+        $this->DebugMessage('RenderToFile('.$renderfilename.') succeeded', __FILE__, __LINE__);
+        return true;
+      }
+      if (!@file_exists($renderfilename)) {
+        $this->DebugMessage('RenderOutput ['.$this->thumbnailFormat.'('.$renderfilename.')] did not appear to fail, but the output image does not exist either...', __FILE__, __LINE__);
+      }
+    } else {
+      $this->DebugMessage('RenderOutput ['.$this->thumbnailFormat.'('.$renderfilename.')] failed', __FILE__, __LINE__);
+    }
+    return false;
+  }
+
+
+  // public:
+  function OutputThumbnail() {
+    if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) {
+      $this->DebugMessage('OutputThumbnail() failed because !is_resource($this->gdimg_output)', __FILE__, __LINE__);
+      return false;
+    }
+    if (headers_sent()) {
+      return $this->ErrorImage('OutputThumbnail() failed - headers already sent');
+      exit;
+    }
+
+    if ($this->down) {
+      $downloadfilename = ereg_replace('[/\\:\*\?"<>|]', '_', $this->down);
+      if (phpthumb_functions::version_compare_replacement(phpversion(), '4.1.0', '>=')) {
+        $downloadfilename = trim($downloadfilename, '.');
+      }
+      if ($downloadfilename != $this->down) {
+        $this->DebugMessage('renaming output file for "down" from "'.$this->down.'" to "'.$downloadfilename.'"', __FILE__, __LINE__);
+      }
+      if ($downloadfilename) {
+        header('Content-Disposition: attachment; filename="'.$downloadfilename.'"');
+      } else {
+        $this->DebugMessage('failed to send Content-Disposition header because $downloadfilename is empty', __FILE__, __LINE__);
+      }
+    }
+
+    if ($this->useRawIMoutput) {
+
+      header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat));
+      echo $this->IMresizedData;
+
+    } else {
+
+      $this->DebugMessage('ImageInterlace($this->gdimg_output, '.intval($this->config_output_interlace).')', __FILE__, __LINE__);
+      ImageInterlace($this->gdimg_output, intval($this->config_output_interlace));
+      switch ($this->thumbnailFormat) {
+        case 'jpeg':
+          header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat));
+          $ImageOutFunction = 'image'.$this->thumbnailFormat;
+          @$ImageOutFunction($this->gdimg_output, '', $this->thumbnailQuality);
+          break;
+
+        case 'png':
+        case 'gif':
+          header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat));
+          $ImageOutFunction = 'image'.$this->thumbnailFormat;
+          @$ImageOutFunction($this->gdimg_output);
+          break;
+
+        case 'bmp':
+          if (!@include_once(dirname(__FILE__).'/phpthumb.bmp.php')) {
+            $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.bmp.php" which is required for BMP format output', __FILE__, __LINE__);
+            return false;
+          }
+          $phpthumb_bmp = new phpthumb_bmp();
+          if (is_object($phpthumb_bmp)) {
+            $bmp_data = $phpthumb_bmp->GD2BMPstring($this->gdimg_output);
+            unset($phpthumb_bmp);
+            if (!$bmp_data) {
+              $this->DebugMessage('$phpthumb_bmp->GD2BMPstring() failed', __FILE__, __LINE__);
+              return false;
+            }
+            header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat));
+            echo $bmp_data;
+          } else {
+            $this->DebugMessage('new phpthumb_bmp() failed', __FILE__, __LINE__);
+            return false;
+          }
+          break;
+
+        case 'ico':
+          if (!@include_once(dirname(__FILE__).'/phpthumb.ico.php')) {
+            $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.ico.php" which is required for ICO format output', __FILE__, __LINE__);
+            return false;
+          }
+          $phpthumb_ico = new phpthumb_ico();
+          if (is_object($phpthumb_ico)) {
+            $arrayOfOutputImages = array($this->gdimg_output);
+            $ico_data = $phpthumb_ico->GD2ICOstring($arrayOfOutputImages);
+            unset($phpthumb_ico);
+            if (!$ico_data) {
+              $this->DebugMessage('$phpthumb_ico->GD2ICOstring() failed', __FILE__, __LINE__);
+              return false;
+            }
+            header('Content-Type: '.phpthumb_functions::ImageTypeToMIMEtype($this->thumbnailFormat));
+            echo $ico_data;
+          } else {
+            $this->DebugMessage('new phpthumb_ico() failed', __FILE__, __LINE__);
+            return false;
+          }
+          break;
+
+        default:
+          $this->DebugMessage('OutputThumbnail failed because $this->thumbnailFormat "'.$this->thumbnailFormat.'" is not valid', __FILE__, __LINE__);
+          return false;
+          break;
+      }
+
+    }
+    return true;
+  }
+
+
+  // public:
+  function CleanUpCacheDirectory() {
+    if (($this->config_cache_maxage > 0) || ($this->config_cache_maxsize > 0) || ($this->config_cache_maxfiles > 0)) {
+      $CacheDirOldFilesAge  = array();
+      $CacheDirOldFilesSize = array();
+      if ($dirhandle = opendir($this->config_cache_directory)) {
+        while ($oldcachefile = readdir($dirhandle)) {
+          $fullfilename = $this->config_cache_directory.DIRECTORY_SEPARATOR.$oldcachefile;
+          if (eregi('^phpThumb_cache_', $oldcachefile) && file_exists($fullfilename)) {
+            $CacheDirOldFilesAge[$oldcachefile] = @fileatime($fullfilename);
+            if ($CacheDirOldFilesAge[$oldcachefile] == 0) {
+              $CacheDirOldFilesAge[$oldcachefile] = @filemtime($fullfilename);
+            }
+
+            $CacheDirOldFilesSize[$oldcachefile] = @filesize($fullfilename);
+          }
+        }
+      }
+      asort($CacheDirOldFilesAge);
+
+      if ($this->config_cache_maxfiles > 0) {
+        $TotalCachedFiles = count($CacheDirOldFilesAge);
+        $DeletedKeys = array();
+        foreach ($CacheDirOldFilesAge as $oldcachefile => $filedate) {
+          if ($TotalCachedFiles > $this->config_cache_maxfiles) {
+            $TotalCachedFiles--;
+            if (@unlink($fullfilename)) {
+              $DeletedKeys[] = $oldcachefile;
+            }
+          } else {
+            // there are few enough files to keep the rest
+            break;
+          }
+        }
+        foreach ($DeletedKeys as $dummy => $oldcachefile) {
+          unset($CacheDirOldFilesAge[$oldcachefile]);
+          unset($CacheDirOldFilesSize[$oldcachefile]);
+        }
+      }
+
+      if ($this->config_cache_maxage > 0) {
+        $mindate = time() - $this->config_cache_maxage;
+        $DeletedKeys = array();
+        foreach ($CacheDirOldFilesAge as $oldcachefile => $filedate) {
+          if ($filedate > 0) {
+            if ($filedate < $mindate) {
+              if (@unlink($fullfilename)) {
+                $DeletedKeys[] = $oldcachefile;
+              }
+            } else {
+              // the rest of the files are new enough to keep
+              break;
+            }
+          }
+        }
+        foreach ($DeletedKeys as $dummy => $oldcachefile) {
+          unset($CacheDirOldFilesAge[$oldcachefile]);
+          unset($CacheDirOldFilesSize[$oldcachefile]);
+        }
+      }
+
+      if ($this->config_cache_maxsize > 0) {
+        $TotalCachedFileSize = array_sum($CacheDirOldFilesSize);
+        $DeletedKeys = array();
+        foreach ($CacheDirOldFilesAge as $oldcachefile => $filedate) {
+          if ($TotalCachedFileSize > $this->config_cache_maxsize) {
+            $TotalCachedFileSize -= $CacheDirOldFilesSize[$oldcachefile];
+            if (@unlink($fullfilename)) {
+              $DeletedKeys[] = $oldcachefile;
+            }
+          } else {
+            // the total filesizes are small enough to keep the rest of the files
+            break;
+          }
+        }
+        foreach ($DeletedKeys as $dummy => $oldcachefile) {
+          unset($CacheDirOldFilesAge[$oldcachefile]);
+          unset($CacheDirOldFilesSize[$oldcachefile]);
+        }
+      }
+
+    }
+    return true;
+  }
+
+  //////////////////////////////////////////////////////////////////////
+
+  function ResolveSource() {
+    if (is_resource($this->gdimg_source)) {
+      $this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__);
+      return true;
+    }
+    if ($this->rawImageData) {
+      $this->sourceFilename = null;
+      $this->DebugMessage('ResolveSource() exiting because $this->rawImageData is set ('.number_format(strlen($this->rawImageData)).' bytes)', __FILE__, __LINE__);
+      return true;
+    }
+    if ($this->sourceFilename) {
+      $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->sourceFilename);
+      $this->DebugMessage('$this->sourceFilename set to "'.$this->sourceFilename.'"', __FILE__, __LINE__);
+    } else {
+      $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->src);
+      $this->DebugMessage('$this->sourceFilename set to "'.$this->sourceFilename.'" from $this->src ('.$this->src.')', __FILE__, __LINE__);
+    }
+    if ($this->iswindows && ((substr($this->sourceFilename, 0, 2) == '//') || (substr($this->sourceFilename, 0, 2) == '\\\\'))) {
+      // Windows \\share\filename.ext
+    } elseif (eregi('^(f|ht)tps?\://', $this->sourceFilename)) {
+      // URL
+      if ($this->config_http_user_agent) {
+        ini_set('user_agent', $this->config_http_user_agent);
+      }
+    } elseif (!@file_exists($this->sourceFilename)) {
+      return $this->ErrorImage('"'.$this->sourceFilename.'" does not exist');
+    } elseif (!@is_file($this->sourceFilename)) {
+      return $this->ErrorImage('"'.$this->sourceFilename.'" is not a file');
+    }
+    return true;
+  }
+
+  function setOutputFormat() {
+    static $alreadyCalled = false;
+    if ($this->thumbnailFormat && $alreadyCalled) {
+      return true;
+    }
+    $alreadyCalled = true;
+
+    $AvailableImageOutputFormats = array();
+    $AvailableImageOutputFormats[] = 'text';
+    if (@is_readable(dirname(__FILE__).'/phpthumb.ico.php')) {
+      $AvailableImageOutputFormats[] = 'ico';
+    }
+    if (@is_readable(dirname(__FILE__).'/phpthumb.bmp.php')) {
+      $AvailableImageOutputFormats[] = 'bmp';
+    }
+
+    $this->thumbnailFormat = 'ico';
+
+    // Set default output format based on what image types are available
+    if (function_exists('ImageTypes')) {
+      $imagetypes = ImageTypes();
+      if ($imagetypes & IMG_WBMP) {
+        $this->thumbnailFormat         = 'wbmp';
+        $AvailableImageOutputFormats[] = 'wbmp';
+      }
+      if ($imagetypes & IMG_GIF) {
+        $this->thumbnailFormat         = 'gif';
+        $AvailableImageOutputFormats[] = 'gif';
+      }
+      if ($imagetypes & IMG_PNG) {
+        $this->thumbnailFormat         = 'png';
+        $AvailableImageOutputFormats[] = 'png';
+      }
+      if ($imagetypes & IMG_JPG) {
+        $this->thumbnailFormat         = 'jpeg';
+        $AvailableImageOutputFormats[] = 'jpeg';
+      }
+    } else {
+      //return $this->ErrorImage('ImageTypes() does not exist - GD support might not be enabled?');
+      $this->DebugMessage('ImageTypes() does not exist - GD support might not be enabled?',  __FILE__, __LINE__);
+    }
+    if ($this->ImageMagickVersion()) {
+      $IMformats = array('jpeg', 'png', 'gif', 'bmp', 'ico');
+      $this->DebugMessage('Addding ImageMagick formats to $AvailableImageOutputFormats ('.implode(';', $AvailableImageOutputFormats).')', __FILE__, __LINE__);
+      foreach ($IMformats as $key => $format) {
+        $AvailableImageOutputFormats[] = $format;
+      }
+    }
+    $AvailableImageOutputFormats = array_unique($AvailableImageOutputFormats);
+    $this->DebugMessage('$AvailableImageOutputFormats = array('.implode(';', $AvailableImageOutputFormats).')', __FILE__, __LINE__);
+
+    if (strtolower($this->config_output_format) == 'jpg') {
+      $this->config_output_format = 'jpeg';
+    }
+    if (strtolower($this->f) == 'jpg') {
+      $this->f = 'jpeg';
+    }
+    if (phpthumb_functions::CaseInsensitiveInArray($this->config_output_format, $AvailableImageOutputFormats)) {
+      // set output format to config default if that format is available
+      $this->DebugMessage('$this->thumbnailFormat set to $this->config_output_format "'.strtolower($this->config_output_format).'"', __FILE__, __LINE__);
+      $this->thumbnailFormat = strtolower($this->config_output_format);
+    } elseif ($this->config_output_format) {
+      $this->DebugMessage('$this->thumbnailFormat staying as "'.$this->thumbnailFormat.'" because $this->config_output_format ('.strtolower($this->config_output_format).') is not in $AvailableImageOutputFormats', __FILE__, __LINE__);
+    }
+    if ($this->f && (phpthumb_functions::CaseInsensitiveInArray($this->f, $AvailableImageOutputFormats))) {
+      // override output format if $this->f is set and that format is available
+      $this->DebugMessage('$this->thumbnailFormat set to $this->f "'.strtolower($this->f).'"', __FILE__, __LINE__);
+      $this->thumbnailFormat = strtolower($this->f);
+    } elseif ($this->f) {
+      $this->DebugMessage('$this->thumbnailFormat staying as "'.$this->thumbnailFormat.'" because $this->f ('.strtolower($this->f).') is not in $AvailableImageOutputFormats', __FILE__, __LINE__);
+    }
+
+    // for JPEG images, quality 1 (worst) to 99 (best)
+    // quality < 25 is nasty, with not much size savings - not recommended
+    // problems with 100 - invalid JPEG?
+    $this->thumbnailQuality = max(1, min(99, ($this->q ? $this->q : 75)));
+    $this->DebugMessage('$this->thumbnailQuality set to "'.$this->thumbnailQuality.'"', __FILE__, __LINE__);
+
+    return true;
+  }
+
+  function setCacheDirectory() {
+    // resolve cache directory to absolute pathname
+    $this->DebugMessage('setCacheDirectory() starting with config_cache_directory = "'.$this->config_cache_directory.'"', __FILE__, __LINE__);
+    if (substr($this->config_cache_directory, 0, 1) == '.') {
+      if (eregi('^(f|ht)tps?\://', $this->src)) {
+        if (!$this->config_cache_disable_warning) {
+          $this->ErrorImage('$this->config_cache_directory ('.$this->config_cache_directory.') cannot be used for remote images. Adjust "cache_directory" or "cache_disable_warning" in phpThumb.config.php');
+        }
+      } elseif ($this->src) {
+        // resolve relative cache directory to source image
+        $this->config_cache_directory = dirname($this->ResolveFilenameToAbsolute($this->src)).DIRECTORY_SEPARATOR.$this->config_cache_directory;
+      } else {
+        // $this->new is probably set
+      }
+    }
+    if (substr($this->config_cache_directory, -1) == '/') {
+      $this->config_cache_directory = substr($this->config_cache_directory, 0, -1);
+    }
+    if ($this->iswindows) {
+      $this->config_cache_directory = str_replace('/', DIRECTORY_SEPARATOR, $this->config_cache_directory);
+    }
+    if ($this->config_cache_directory) {
+      $real_cache_path = realpath($this->config_cache_directory);
+      if (!$real_cache_path) {
+        $this->DebugMessage('realpath($this->config_cache_directory) failed for "'.$this->config_cache_directory.'"', __FILE__, __LINE__);
+        if (!is_dir($this->config_cache_directory)) {
+          $this->DebugMessage('!is_dir('.$this->config_cache_directory.')', __FILE__, __LINE__);
+        }
+      }
+      if ($real_cache_path) {
+        $this->DebugMessage('setting config_cache_directory to realpath('.$this->config_cache_directory.') = "'.$real_cache_path.'"', __FILE__, __LINE__);
+        $this->config_cache_directory = $real_cache_path;
+      }
+    }
+    if (!is_dir($this->config_cache_directory)) {
+      if (!$this->config_cache_disable_warning) {
+        $this->ErrorImage('$this->config_cache_directory ('.$this->config_cache_directory.') does not exist. Adjust "cache_directory" or "cache_disable_warning" in phpThumb.config.php');
+      }
+      $this->DebugMessage('$this->config_cache_directory ('.$this->config_cache_directory.') is not a directory', __FILE__, __LINE__);
+      $this->config_cache_directory = null;
+    } elseif (!@is_writable($this->config_cache_directory)) {
+      $this->DebugMessage('$this->config_cache_directory is not writable ('.$this->config_cache_directory.')', __FILE__, __LINE__);
+    }
+
+    if (!@is_dir($this->config_temp_directory) || !@is_writable($this->config_temp_directory) && @is_dir($this->config_cache_directory) && @is_writable($this->config_cache_directory)) {
+      $this->DebugMessage('setting $this->config_temp_directory = $this->config_cache_directory ('.$this->config_cache_directory.')', __FILE__, __LINE__);
+      $this->config_temp_directory = $this->config_cache_directory;
+    }
+    return true;
+  }
+
+
+  function ResolveFilenameToAbsolute($filename) {
+    //if (eregi('^(f|ht)tps?\://', $filename)) {
+    if (eregi('^[a-z0-9]+\:/{1,2}', $filename)) {
+      // eg: http://host/path/file.jpg (HTTP URL)
+      // eg: ftp://host/path/file.jpg  (FTP URL)
+      // eg: data1:/path/file.jpg      (Netware path)
+
+      //$AbsoluteFilename = $filename;
+      return $filename;
+
+    } elseif ($this->iswindows && ($filename{1} == ':')) {
+
+      // absolute pathname (Windows)
+      $AbsoluteFilename = $filename;
+
+    } elseif ($this->iswindows && ((substr($filename, 0, 2) == '//') || (substr($filename, 0, 2) == '\\\\'))) {
+
+      // absolute pathname (Windows)
+      $AbsoluteFilename = $filename;
+
+    } elseif ($filename{0} == '/') {
+
+      if (@is_readable($filename) && !@is_readable($this->config_document_root.$filename)) {
+
+        // absolute filename (*nix)
+        $AbsoluteFilename = $filename;
+
+      } elseif ($filename{1} == '~') {
+
+        // /~user/path
+        if ($ApacheLookupURIarray = phpthumb_functions::ApacheLookupURIarray($filename)) {
+          $AbsoluteFilename = $ApacheLookupURIarray['filename'];
+        } else {
+          $AbsoluteFilename = realpath($filename);
+          if (@is_readable($AbsoluteFilename)) {
+            $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.$filename.'", but the correct filename ('.$AbsoluteFilename.') seems to have been resolved with realpath($filename)', __FILE__, __LINE__);
+          } else {
+            return $this->ErrorImage('phpthumb_functions::ApacheLookupURIarray() failed for "'.$filename.'". This has been known to fail on Apache2 - try using the absolute filename for the source image (ex: "/home/user/httpdocs/image.jpg" instead of "/~user/image.jpg")');
+          }
+        }
+
+      } else {
+
+        // relative filename (any OS)
+        if (ereg('^'.preg_quote($this->config_document_root), $filename)) {
+          $AbsoluteFilename = $filename;
+          $this->DebugMessage('ResolveFilenameToAbsolute() NOT prepending $this->config_document_root ('.$this->config_document_root.') to $filename ('.$filename.') resulting in ($AbsoluteFilename = "'.$AbsoluteFilename.'")', __FILE__, __LINE__);
+        } else {
+          $AbsoluteFilename = $this->config_document_root.$filename;
+          $this->DebugMessage('ResolveFilenameToAbsolute() prepending $this->config_document_root ('.$this->config_document_root.') to $filename ('.$filename.') resulting in ($AbsoluteFilename = "'.$AbsoluteFilename.'")', __FILE__, __LINE__);
+        }
+
+      }
+
+    } else {
+
+      // relative to current directory (any OS)
+      $AbsoluteFilename = $this->config_document_root.dirname(@$_SERVER['PHP_SELF']).DIRECTORY_SEPARATOR.$filename;
+      //if (!@file_exists($AbsoluteFilename) && @file_exists(realpath($this->DotPadRelativeDirectoryPath($filename)))) {
+      //  $AbsoluteFilename = realpath($this->DotPadRelativeDirectoryPath($filename));
+      //}
+
+      if (substr(dirname(@$_SERVER['PHP_SELF']), 0, 2) == '/~') {
+        if ($ApacheLookupURIarray = phpthumb_functions::ApacheLookupURIarray(dirname(@$_SERVER['PHP_SELF']))) {
+          $AbsoluteFilename = $ApacheLookupURIarray['filename'].DIRECTORY_SEPARATOR.$filename;
+        } else {
+          $AbsoluteFilename = realpath('.').DIRECTORY_SEPARATOR.$filename;
+          if (@is_readable($AbsoluteFilename)) {
+            $this->DebugMessage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname(@$_SERVER['PHP_SELF']).'", but the correct filename ('.$AbsoluteFilename.') seems to have been resolved with realpath(.)/$filename', __FILE__, __LINE__);
+          } else {
+            return $this->ErrorImage('phpthumb_functions::ApacheLookupURIarray() failed for "'.dirname(@$_SERVER['PHP_SELF']).'". This has been known to fail on Apache2 - try using the absolute filename for the source image');
+          }
+        }
+      }
+
+    }
+    if (is_link($AbsoluteFilename)) {
+      $this->DebugMessage('is_link()==true, changing "'.$AbsoluteFilename.'" to "'.readlink($AbsoluteFilename).'"', __FILE__, __LINE__);
+      $AbsoluteFilename = readlink($AbsoluteFilename);
+    }
+    if (realpath($AbsoluteFilename)) {
+      $AbsoluteFilename = realpath($AbsoluteFilename);
+    }
+    if ($this->iswindows) {
+      $AbsoluteFilename = eregi_replace('^'.preg_quote(realpath($this->config_document_root)), realpath($this->config_document_root), $AbsoluteFilename);
+      $AbsoluteFilename = str_replace(DIRECTORY_SEPARATOR, '/', $AbsoluteFilename);
+    }
+    if (!$this->config_allow_src_above_docroot && !ereg('^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', realpath($this->config_document_root))), $AbsoluteFilename)) {
+      $this->DebugMessage('!$this->config_allow_src_above_docroot therefore setting "'.$AbsoluteFilename.'" (outside "'.realpath($this->config_document_root).'") to null', __FILE__, __LINE__);
+      return false;
+    }
+    if (!$this->config_allow_src_above_phpthumb && !ereg('^'.preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__))), $AbsoluteFilename)) {
+      $this->DebugMessage('!$this->config_allow_src_above_phpthumb therefore setting "'.$AbsoluteFilename.'" (outside "'.dirname(__FILE__).'") to null', __FILE__, __LINE__);
+      return false;
+    }
+    return $AbsoluteFilename;
+  }
+
+  function ImageMagickWhichConvert() {
+    static $WhichConvert = null;
+    if (is_null($WhichConvert)) {
+      if ($this->iswindows) {
+        $WhichConvert = false;
+      } else {
+        $WhichConvert = trim(phpthumb_functions::SafeExec('which convert'));
+      }
+    }
+    return $WhichConvert;
+  }
+
+  function ImageMagickCommandlineBase() {
+    static $commandline = null;
+    if (is_null($commandline)) {
+      $commandline = (!is_null($this->config_imagemagick_path) ? $this->config_imagemagick_path : '');
+
+      if ($this->config_imagemagick_path && ($this->config_imagemagick_path != realpath($this->config_imagemagick_path))) {
+        if (@is_executable(realpath($this->config_imagemagick_path))) {
+          $this->DebugMessage('Changing $this->config_imagemagick_path ('.$this->config_imagemagick_path.') to realpath($this->config_imagemagick_path) ('.realpath($this->config_imagemagick_path).')', __FILE__, __LINE__);
+          $this->config_imagemagick_path = realpath($this->config_imagemagick_path);
+        } else {
+          $this->DebugMessage('Leaving $this->config_imagemagick_path as ('.$this->config_imagemagick_path.') because !is_execuatable(realpath($this->config_imagemagick_path)) ('.realpath($this->config_imagemagick_path).')', __FILE__, __LINE__);
+        }
+      }
+      $this->DebugMessage('  file_exists('.$this->config_imagemagick_path.') = '.intval(  @file_exists($this->config_imagemagick_path)), __FILE__, __LINE__);
+      $this->DebugMessage('is_executable('.$this->config_imagemagick_path.') = '.intval(@is_executable($this->config_imagemagick_path)), __FILE__, __LINE__);
+      if (@file_exists($this->config_imagemagick_path)) {
+        $this->DebugMessage('using ImageMagick path from $this->config_imagemagick_path ('.$this->config_imagemagick_path.')', __FILE__, __LINE__);
+        if ($this->iswindows) {
+          $commandline = substr($this->config_imagemagick_path, 0, 2).' && cd "'.str_replace('/', DIRECTORY_SEPARATOR, substr(dirname($this->config_imagemagick_path), 2)).'" && '.basename($this->config_imagemagick_path);
+        } else {
+          $commandline = '"'.$this->config_imagemagick_path.'"';
+        }
+        return $commandline;
+      }
+
+      $which_convert = $this->ImageMagickWhichConvert();
+      $IMversion     = $this->ImageMagickVersion();
+
+      if ($which_convert && ($which_convert{0} == '/') && @file_exists($which_convert)) {
+
+        // `which convert` *should* return the path if "convert" exist, or nothing if it doesn't
+        // other things *may* get returned, like "sh: convert: not found" or "no convert in /usr/local/bin /usr/sbin /usr/bin /usr/ccs/bin"
+        // so only do this if the value returned exists as a file
+        $this->DebugMessage('using ImageMagick path from `which convert` ('.$which_convert.')', __FILE__, __LINE__);
+        $commandline = 'convert';
+
+      } elseif ($IMversion) {
+
+        $this->DebugMessage('setting ImageMagick path to $this->config_imagemagick_path ('.$this->config_imagemagick_path.') ['.$IMversion.']', __FILE__, __LINE__);
+        $commandline = $this->config_imagemagick_path;
+
+      } else {
+
+        $this->DebugMessage('ImageMagickThumbnailToGD() aborting because cannot find convert in $this->config_imagemagick_path ('.$this->config_imagemagick_path.'), and `which convert` returned ('.$which_convert.')', __FILE__, __LINE__);
+        $commandline = '';
+
+      }
+    }
+    return $commandline;
+  }
+
+  function ImageMagickVersion($returnRAW=false) {
+    static $versionstring = null;
+    if (is_null($versionstring)) {
+      $commandline = $this->ImageMagickCommandlineBase();
+      $commandline = (!is_null($commandline) ? $commandline : '');
+
+      $versionstring = array(0=>'', 1=>'');
+      if ($commandline) {
+        $commandline .= ' -version';
+        $this->DebugMessage('ImageMagick version checked with "'.$commandline.'"', __FILE__, __LINE__);
+        $versionstring[1] = trim(phpthumb_functions::SafeExec($commandline));
+        if (eregi('^Version: (.*) (http|file)\:', $versionstring[1], $matches)) {
+          $versionstring[0] = $matches[1];
+        } else {
+          $versionstring[0] = false;
+          $this->DebugMessage('ImageMagick did not return recognized version string ('.$versionstring[1].')', __FILE__, __LINE__);
+        }
+      }
+    }
+    return @$versionstring[intval($returnRAW)];
+  }
+
+  function ImageMagickSwitchAvailable($switchname) {
+    static $IMoptions = null;
+    if (is_null($IMoptions)) {
+      $IMoptions = array();
+      $commandline = $this->ImageMagickCommandlineBase();
+      if (!is_null($commandline)) {
+        $commandline .= ' -help';
+        $IMhelp_lines = explode("\n", phpthumb_functions::SafeExec($commandline));
+        foreach ($IMhelp_lines as $line) {
+          if (ereg('^[\+\-]([a-z\-]+) ', trim($line), $matches)) {
+            $IMoptions[$matches[1]] = true;
+          }
+        }
+      }
+    }
+    if (is_array($switchname)) {
+      $allOK = true;
+      foreach ($switchname as $key => $value) {
+        if (!isset($IMoptions[$value])) {
+          $allOK = false;
+          break;
+        }
+      }
+      $this->DebugMessage('ImageMagickSwitchAvailable('.implode(';', $switchname).') = '.intval($allOK).'', __FILE__, __LINE__);
+    } else {
+      $allOK = isset($IMoptions[$switchname]);
+      $this->DebugMessage('ImageMagickSwitchAvailable('.$switchname.') = '.intval($allOK).'', __FILE__, __LINE__);
+    }
+    return $allOK;
+  }
+
+  function ImageMagickThumbnailToGD() {
+    // http://www.imagemagick.org/script/command-line-options.php
+
+    $this->useRawIMoutput = true;
+    if (phpthumb_functions::gd_version()) {
+      //$UnAllowedParameters = array('sx', 'sy', 'sw', 'sh', 'xto', 'ra', 'ar', 'bg', 'bc', 'fltr');
+      $UnAllowedParameters = array('xto', 'ra', 'ar', 'bg', 'bc', 'fltr');
+      foreach ($UnAllowedParameters as $dummy => $parameter) {
+        if ($this->$parameter) {
+          $this->DebugMessage('$this->useRawIMoutput=false because "'.$parameter.'" is set', __FILE__, __LINE__);
+          $this->useRawIMoutput = false;
+          break;
+        }
+      }
+    }
+    $outputFormat = $this->thumbnailFormat;
+    if (phpthumb_functions::gd_version()) {
+      if ($this->useRawIMoutput) {
+        switch ($this->thumbnailFormat) {
+          case 'gif':
+            $ImageCreateFunction = 'ImageCreateFromGIF';
+            $this->is_alpha = true;
+            break;
+          case 'png':
+            $ImageCreateFunction = 'ImageCreateFromPNG';
+            $this->is_alpha = true;
+            break;
+          case 'jpg':
+          case 'jpeg':
+            $ImageCreateFunction = 'ImageCreateFromJPEG';
+            break;
+          default:
+            $outputFormat = 'png';
+            $ImageCreateFunction = 'ImageCreateFromPNG';
+            $this->is_alpha = true;
+            $this->useRawIMoutput = false;
+            break;
+        }
+        if (!function_exists(@$ImageCreateFunction)) {
+          // ImageMagickThumbnailToGD() depends on ImageCreateFromPNG/ImageCreateFromGIF
+          //$this->DebugMessage('ImageMagickThumbnailToGD() aborting because '.@$ImageCreateFunction.'() is not available', __FILE__, __LINE__);
+          $this->useRawIMoutput = true;
+          //return false;
+        }
+      } else {
+        $outputFormat = 'png';
+        $ImageCreateFunction = 'ImageCreateFromPNG';
+        $this->is_alpha = true;
+        $this->useRawIMoutput = false;
+      }
+    }
+
+    // http://freealter.org/doc_distrib/ImageMagick-5.1.1/www/convert.html
+    if (!$this->sourceFilename) {
+      $this->DebugMessage('ImageMagickThumbnailToGD() aborting because $this->sourceFilename is empty', __FILE__, __LINE__);
+      $this->useRawIMoutput = false;
+      return false;
+    }
+    if (ini_get('safe_mode')) {
+      $this->DebugMessage('ImageMagickThumbnailToGD() aborting because safe_mode is enabled', __FILE__, __LINE__);
+      $this->useRawIMoutput = false;
+      return false;
+    }
+
+    $commandline = $this->ImageMagickCommandlineBase();
+    if ($commandline) {
+      if ($IMtempfilename = $this->phpThumb_tempnam()) {
+
+        if (!eregi('('.implode('|', $this->AlphaCapableFormats).')', $outputFormat)) {
+          // not a transparency-capable format
+          $commandline .= ' -background "#'.($this->bg ? $this->bg : 'FFFFFF').'"';
+          $commandline .= ' -flatten';
+        }
+        $IMtempfilename = realpath($IMtempfilename);
+        if ($getimagesize = @GetImageSize($this->sourceFilename)) {
+          $this->DebugMessage('GetImageSize('.$this->sourceFilename.') returned [w='.$getimagesize[0].';h='.$getimagesize[1].';f='.$getimagesize[2].']', __FILE__, __LINE__);
+          $this->source_width  = $getimagesize[0];
+          $this->source_height = $getimagesize[1];
+          $this->DebugMessage('source dimensions set to '.$this->source_width.'x'.$this->source_height, __FILE__, __LINE__);
+          $this->SetOrientationDependantWidthHeight();
+
+          $commandline .= ' -coalesce'; // may be needed for animated GIFs
+          if ($this->source_width || $this->source_height) {
+            if ($this->zc) {
+
+              $borderThickness = 0;
+              if (!empty($this->fltr)) {
+                foreach ($this->fltr as $key => $value) {
+                  if (ereg('^bord\|([0-9]+)', $value, $matches)) {
+                    $borderThickness = $matches[1];
+                    break;
+                  }
+                }
+              }
+              $wAll = intval(max($this->w, $this->wp, $this->wl, $this->ws)) - (2 * $borderThickness);
+              $hAll = intval(max($this->h, $this->hp, $this->hl, $this->hs)) - (2 * $borderThickness);
+              $imAR = $this->source_width / $this->source_height;
+              //$zcAR = (($wAll && $hAll) ? $wAll / $hAll : $imAR);
+              $zcAR = (($wAll && $hAll) ? $wAll / $hAll : 1);
+//echo '<pre>';
+//var_dump($wAll);
+//var_dump($hAll);
+//var_dump($zcAR);
+              //if (($wAll > $borderThickness) && ($wAll > $borderThickness)) {
+              //  $zcAR = ($wAll - (2 * $borderThickness)) / ($hAll - (2 * $borderThickness));
+              //}
+//echo ($wAll - (2 * $borderThickness))."\n";
+//echo ($hAll - (2 * $borderThickness))."\n";
+//var_dump($zcAR);
+              $side  = phpthumb_functions::nonempty_min($this->source_width, $this->source_height, max($wAll, $hAll));
+              $sideX = phpthumb_functions::nonempty_min($this->source_width,                       $wAll, round($hAll * $zcAR));
+              $sideY = phpthumb_functions::nonempty_min(                     $this->source_height, $hAll, round($wAll / $zcAR));
+
+              //if ($zcAR > 1) {  // landscape
+                $thumbnailH = round(max($sideY, ($sideY * $zcAR) / $imAR));
+//echo '<pre>';
+//var_dump($sideY);
+//var_dump($zcAR);
+//var_dump($imAR);
+//var_dump($thumbnailH);
+
+                $commandline .= ' -thumbnail x'.$thumbnailH;
+              //} else {          // portrait or square
+              //  $thumbnailH = max($sideY, ($sideY * $zcAR) / $imAR);
+              //  $commandline .= ' -thumbnail '.$sideX.'x'.round($sideX / $zcAR);
+              //}
+//echo '<pre>';
+//var_dump($this->w);
+//var_dump($this->wp);
+//var_dump($this->wl);
+//var_dump($this->ws);
+//var_dump($wAll);
+//var_dump($side);
+//var_dump($sideX);
+//var_dump($sideY);
+//var_dump($zcAR);
+//var_dump($thumbnailH);
+//print_r($getimagesize);
+//echo '</pre>';
+
+              $commandline .= ' -gravity center';
+
+              if (($wAll > 0) && ($hAll > 0)) {
+                $commandline .= ' -crop '.$wAll.'x'.$hAll.'+0+0';
+              } else {
+                $commandline .= ' -crop '.$side.'x'.$side.'+0+0';
+              }
+              $commandline .= ' +repage';
+
+            } elseif ($this->sw || $this->sh || $this->sx || $this->sy) {
+
+              $commandline .= ' -crop '.($this->sw ? $this->sw : $this->source_width).'x'.($this->sh ? $this->sh : $this->source_height).'+'.$this->sx.'+'.$this->sy;
+              // this is broken for aoe=1, but unsure how to fix. Send advice to info at silisoftware.com
+              if ($this->w || $this->h) {
+                $commandline .= ' -repage';
+                $commandline .= ' -thumbnail '.$this->w.'x'.$this->h;
+              }
+
+            } else {
+
+              if ($this->iar && (intval($this->w) > 0) && (intval($this->h) > 0)) {
+                $commandline .= ' -thumbnail '.$this->w.'x'.$this->h.'!';
+              } else {
+//echo '<pre>';
+//print_r($getimagesize);
+//echo '</pre>';
+//echo $this->w.'x'.$this->h.'<br>';
+                $this->w = ((($this->aoe || $this->far) && $this->w) ? $this->w : ($this->w ? phpthumb_functions::nonempty_min($this->w, $getimagesize[0]) : ''));
+                $this->h = ((($this->aoe || $this->far) && $this->h) ? $this->h : ($this->h ? phpthumb_functions::nonempty_min($this->h, $getimagesize[1]) : ''));
+//echo $this->w.'x'.$this->h.'<br>';
+                if ($this->w || $this->h) {
+                  $commandline .= ' -thumbnail '.$this->w.'x'.$this->h;
+                }
+              }
+            }
+          }
+
+        } else {
+
+          $this->DebugMessage('GetImageSize('.$this->sourceFilename.') failed', __FILE__, __LINE__);
+          if ($this->w || $this->h) {
+            $commandline .= ' -thumbnail '.$this->w.'x'.$this->h;
+            if ($this->iar && (intval($this->w) > 0) && (intval($this->h) > 0)) {
+              $commandline .= '!';
+            }
+          }
+
+        }
+        foreach ($this->fltr as $filterkey => $filtercommand) {
+          @list($command, $parameter) = explode('|', $filtercommand, 2);
+          switch ($command) {
+            case 'brit':
+              if ($this->ImageMagickSwitchAvailable('modulate')) {
+                $commandline .= ' -modulate '.(100 + $parameter).',100,100';
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'cont':
+              if ($this->ImageMagickSwitchAvailable('contrast')) {
+                $contDiv10 = round($parameter / 10);
+                if ($contDiv10 > 0) {
+                  for ($i = 0; $i < $contDiv10; $i++) {
+                    $commandline .= ' -contrast'; // increase contrast by 10%
+                  }
+                } elseif ($contDiv10 < 0) {
+                  for ($i = $contDiv10; $i < 0; $i++) {
+                    $commandline .= ' +contrast'; // decrease contrast by 10%
+                  }
+                } else {
+                  // do nothing
+                }
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'ds':
+              if ($this->ImageMagickSwitchAvailable(array('colorspace', 'modulate'))) {
+                if ($parameter == 100) {
+                  $commandline .= ' -colorspace GRAY -modulate 100,0,100';
+                } else {
+                  $commandline .= ' -modulate 100,'.(100 - $parameter).',100';
+                }
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'sat':
+              if ($this->ImageMagickSwitchAvailable(array('colorspace', 'modulate'))) {
+                if ($parameter == -100) {
+                  $commandline .= ' -colorspace GRAY -modulate 100,0,100';
+                } else {
+                  $commandline .= ' -modulate 100,'.(100 + $parameter).',100';
+                }
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'gray':
+              if ($this->ImageMagickSwitchAvailable(array('colorspace', 'modulate'))) {
+                $commandline .= ' -colorspace GRAY -modulate 100,0,100';
+                //$commandline .= ' -colorspace GRAY';
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'clr':
+              if ($this->ImageMagickSwitchAvailable(array('fill', 'colorize'))) {
+                @list($amount, $color) = explode('|', $parameter);
+                $commandline .= ' -fill #'.$color.' -colorize '.$amount;
+              }
+              break;
+
+            case 'sep':
+              if ($this->ImageMagickSwitchAvailable('sepia-tone')) {
+                @list($amount, $color) = explode('|', $parameter);
+                $amount = ($amount ? $amount : 80);
+                if (!$color) {
+                  $commandline .= ' -sepia-tone '.$amount.'%';
+                  unset($this->fltr[$filterkey]);
+                }
+              }
+              break;
+
+            case 'gam':
+              if ($this->ImageMagickSwitchAvailable('gamma')) {
+                $commandline .= ' -gamma '.$parameter;
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'neg':
+              if ($this->ImageMagickSwitchAvailable('negate')) {
+                $commandline .= ' -negate';
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'th':
+              if ($this->ImageMagickSwitchAvailable(array('threshold', 'dither', 'monochrome'))) {
+                $commandline .= ' -threshold '.round($parameter / 2.55).'% -dither -monochrome';
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'rcd':
+              if ($this->ImageMagickSwitchAvailable(array('colors', 'dither'))) {
+                @list($colors, $dither) = explode('|', $parameter);
+                $colors = ($colors                ?  (int) $colors : 256);
+                $dither  = ((strlen($dither) > 0) ? (bool) $dither : true);
+                $commandline .= ' -colors '.max($colors, 8); // ImageMagick will otherwise fail with "cannot quantize to fewer than 8 colors"
+                $commandline .= ($dither ? ' -dither' : ' +dither');
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'flip':
+              if ($this->ImageMagickSwitchAvailable(array('flip', 'flop'))) {
+                if (strpos(strtolower($parameter), 'x') !== false) {
+                  $commandline .= ' -flop';
+                }
+                if (strpos(strtolower($parameter), 'y') !== false) {
+                  $commandline .= ' -flip';
+                }
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'edge':
+              if ($this->ImageMagickSwitchAvailable('edge')) {
+                $parameter = ($parameter ? $parameter : 2);
+                $commandline .= ' -edge '.($parameter ? $parameter : 1);
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'emb':
+              if ($this->ImageMagickSwitchAvailable(array('emboss', 'negate'))) {
+                $parameter = ($parameter ? $parameter : 2);
+                $commandline .= ' -emboss '.$parameter;
+                if ($parameter < 2) {
+                  $commandline .= ' -negate'; // ImageMagick negates the image for some reason with '-emboss 1';
+                }
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'lvl':
+              if ($this->ImageMagickSwitchAvailable(array('normalize', 'level'))) {
+                @list($band, $min, $max) = explode('|', $parameter);
+                $band = ($band              ? $band : '*');
+                $min  = ((strlen($min) > 0) ? $min  : '-1');
+                $max  = ((strlen($max) > 0) ? $max  : '-1');
+                if ($band == '*') {
+                  if (($min == -1) && ($max == -1)) {
+                    $commandline .= ' -normalize';
+                    unset($this->fltr[$filterkey]);
+                  } elseif (($min == -1) || ($max == -1)) {
+                    //
+                  } else {
+                    $commandline .= ' -level '.$min.'%,'.$max.'%';
+                    unset($this->fltr[$filterkey]);
+                  }
+                }
+              }
+              break;
+
+            case 'blur':
+              if ($this->ImageMagickSwitchAvailable('blur')) {
+                @list($radius) = explode('|', $parameter);
+                $radius = ($radius ? $radius : 1);
+                $commandline .= ' -blur '.$radius;
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'gblr':
+              if ($this->ImageMagickSwitchAvailable('gaussian')) {
+                @list($radius) = explode('|', $parameter);
+                $radius = ($radius ? $radius : 1);
+                $commandline .= ' -gaussian '.$radius;
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'usm':
+              if ($this->ImageMagickSwitchAvailable('unsharp')) {
+                @list($amount, $radius, $threshold) = explode('|', $parameter);
+                $amount    = ($amount            ? $amount    : 80);
+                $radius    = ($radius            ? $radius    : 0.5);
+                $threshold = (strlen($threshold) ? $threshold : 3);
+                $commandline .= ' -unsharp '.number_format(($radius * 2) - 1, 2).'x1+'.number_format($amount / 100, 2).'+'.number_format($threshold / 100, 2);
+                unset($this->fltr[$filterkey]);
+              }
+              break;
+
+            case 'bord':
+              if ($this->ImageMagickSwitchAvailable(array('border', 'bordercolor', 'thumbnail', 'crop'))) {
+                if (!$this->zc) {
+                  @list($width, $rX, $rY, $color) = explode('|', $parameter);
+                  if ($width && !$rX && !$rY) {
+                    if (!phpthumb_functions::IsHexColor($color)) {
+                      $color = ($this->bc ? $this->bc : '000000');
+                    }
+                    $commandline .= ' -border '.$width.' -bordercolor "#'.$color.'"';
+                    if (ereg(' \-crop ([0-9]+)x([0-9]+)\+0\+0 ', $commandline, $matches)) {
+                      $commandline = str_replace(' -crop '.$matches[1].'x'.$matches[2].'+0+0 ', ' -crop '.($matches[1] - (2 * $width)).'x'.($matches[2] - (2 * $width)).'+0+0 ', $commandline);
+                    } elseif (ereg(' \-thumbnail ([0-9]+)x([0-9]+) ', $commandline, $matches)) {
+                      $commandline = str_replace(' -thumbnail '.$matches[1].'x'.$matches[2].' ', ' -thumbnail '.($matches[1] - (2 * $width)).'x'.($matches[2] - (2 * $width)).' ', $commandline);
+                    }
+                    unset($this->fltr[$filterkey]);
+                  }
+                }
+              }
+              break;
+
+            case 'crop':
+              break;
+
+            case 'sblr':
+              break;
+
+            case 'mean':
+              break;
+
+            case 'smth':
+              break;
+
+            case 'bvl':
+              break;
+
+            case 'wmi':
+              break;
+
+            case 'wmt':
+              break;
+
+            case 'over':
+              break;
+
+            case 'wb':
+              break;
+
+            case 'hist':
+              break;
+
+            case 'fram':
+              break;
+
+            case 'drop':
+              break;
+
+            case 'mask':
+              break;
+
+            case 'elip':
+              break;
+
+            case 'ric':
+              break;
+
+          }
+          if (!isset($this->fltr[$filterkey])) {
+            $this->DebugMessage('Processed $this->fltr['.$filterkey.'] ('.$filtercommand.') with ImageMagick', __FILE__, __LINE__);
+          } else {
+            $this->DebugMessage('Skipping $this->fltr['.$filterkey.'] ('.$filtercommand.') with ImageMagick', __FILE__, __LINE__);
+          }
+        }
+        $this->DebugMessage('Remaining $this->fltr after ImageMagick: ('.$this->phpThumbDebugVarDump($this->fltr).')', __FILE__, __LINE__);
+
+        if (eregi('jpe?g', $outputFormat) && $this->q) {
+          if ($this->ImageMagickSwitchAvailable(array('quality', 'interlace'))) {
+            $commandline .= ' -quality '.$this->thumbnailQuality;
+            if ($this->config_output_interlace) {
+              // causes weird things with animated GIF... leave for JPEG only
+              $commandline .= ' -interlace line '; // Use Line or Plane to create an interlaced PNG or GIF or progressive JPEG image
+            }
+          }
+        }
+        $commandline .= ' "'.str_replace('/', DIRECTORY_SEPARATOR, $this->sourceFilename).(($outputFormat == 'gif') ? '' : '[0]').'"'; // [0] means first frame of (GIF) animation, can be ignored
+        $commandline .= ' '.$outputFormat.':"'.$IMtempfilename.'"';
+        $commandline .= ' 2>&1';
+        $this->DebugMessage('ImageMagick called as ('.$commandline.')', __FILE__, __LINE__);
+        $IMresult = phpthumb_functions::SafeExec($commandline);
+//echo '<pre>';
+//var_dump($commandline);
+////var_dump($ImageCreateFunction);
+////var_dump($IMresult);
+//echo '</pre>';
+//exit;
+        clearstatcache();
+        if (!@file_exists($IMtempfilename) || !@filesize($IMtempfilename)) {
+
+          $this->DebugMessage('ImageMagick failed with message ('.$IMresult.')', __FILE__, __LINE__);
+          if ($this->iswindows && !$IMresult) {
+            $this->DebugMessage('Check to make sure that PHP has read+write permissions to "'.dirname($IMtempfilename).'"', __FILE__, __LINE__);
+          }
+
+        } else {
+
+          $this->IMresizedData = file_get_contents($IMtempfilename);
+          if (function_exists(@$ImageCreateFunction) && ($this->gdimg_source = @$ImageCreateFunction($IMtempfilename))) {
+//header('Content-Type: image/png');
+//ImageSaveAlpha($this->gdimg_source, true);
+//ImagePNG($this->gdimg_source);
+//exit;
+            $this->source_width  = ImageSX($this->gdimg_source);
+            $this->source_height = ImageSY($this->gdimg_source);
+            $this->DebugMessage('ImageMagickThumbnailToGD::'.$ImageCreateFunction.'() succeeded, $this->gdimg_source is now ('.$this->source_width.'x'.$this->source_height.')', __FILE__, __LINE__);
+            $this->DebugMessage('ImageMagickThumbnailToGD() returning $IMresizedData ('.strlen($this->IMresizedData).' bytes)', __FILE__, __LINE__);
+          } else {
+            $this->useRawIMoutput = true;
+            $this->DebugMessage('$this->useRawIMoutput set to TRUE because '.@$ImageCreateFunction.'('.$IMtempfilename.') failed', __FILE__, __LINE__);
+          }
+          @unlink($IMtempfilename);
+          return true;
+
+        }
+        unlink($IMtempfilename);
+
+      } else {
+        $this->DebugMessage('ImageMagickThumbnailToGD() aborting, phpThumb_tempnam() failed', __FILE__, __LINE__);
+      }
+    } else {
+      $this->DebugMessage('ImageMagickThumbnailToGD() aborting because ImageMagickCommandlineBase() failed', __FILE__, __LINE__);
+    }
+    $this->useRawIMoutput = false;
+    return false;
+  }
+
+
+  function Rotate() {
+    if ($this->ra || $this->ar) {
+      if (!function_exists('ImageRotate')) {
+        $this->DebugMessage('!function_exists(ImageRotate)', __FILE__, __LINE__);
+        return false;
+      }
+      if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) {
+        $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.filters.php" which is required for applying filters ('.implode(';', $this->fltr).')', __FILE__, __LINE__);
+        return false;
+      }
+
+      $this->config_background_hexcolor = ($this->bg ? $this->bg : $this->config_background_hexcolor);
+      if (!phpthumb_functions::IsHexColor($this->config_background_hexcolor)) {
+        return $this->ErrorImage('Invalid hex color string "'.$this->config_background_hexcolor.'" for parameter "bg"');
+      }
+
+      $rotate_angle = 0;
+      if ($this->ra) {
+
+        $rotate_angle = floatval($this->ra);
+
+      } else {
+
+        if ($this->ar == 'x') {
+          if (phpthumb_functions::version_compare_replacement(phpversion(), '4.2.0', '>=')) {
+            if ($this->sourceFilename) {
+              if (function_exists('exif_read_data')) {
+                if ($exif_data = @exif_read_data($this->sourceFilename, 'IFD0')) {
+                  // http://sylvana.net/jpegcrop/exif_orientation.html
+                  switch (@$exif_data['Orientation']) {
+                    case 1:
+                      $rotate_angle = 0;
+                      break;
+                    case 3:
+                      $rotate_angle = 180;
+                      break;
+                    case 6:
+                      $rotate_angle = 270;
+                      break;
+                    case 8:
+                      $rotate_angle = 90;
+                      break;
+
+                    default:
+                      $this->DebugMessage('EXIF auto-rotate failed because unknown $exif_data[Orientation] "'.@$exif_data['Orientation'].'"', __FILE__, __LINE__);
+                      return false;
+                      break;
+                  }
+                  $this->DebugMessage('EXIF auto-rotate set to '.$rotate_angle.' degrees ($exif_data[Orientation] = "'.@$exif_data['Orientation'].'")', __FILE__, __LINE__);
+                } else {
+                  $this->DebugMessage('failed: exif_read_data('.$this->sourceFilename.')', __FILE__, __LINE__);
+                  return false;
+                }
+              } else {
+                $this->DebugMessage('!function_exists(exif_read_data)', __FILE__, __LINE__);
+                return false;
+              }
+            } else {
+              $this->DebugMessage('Cannot auto-rotate from EXIF data because $this->sourceFilename is empty', __FILE__, __LINE__);
+              return false;
+            }
+          } else {
+            $this->DebugMessage('Cannot auto-rotate from EXIF data because PHP is less than v4.2.0 ('.phpversion().')', __FILE__, __LINE__);
+            return false;
+          }
+        } elseif (($this->ar == 'l') && ($this->source_height > $this->source_width)) {
+          $rotate_angle = 270;
+        } elseif (($this->ar == 'L') && ($this->source_height > $this->source_width)) {
+          $rotate_angle = 90;
+        } elseif (($this->ar == 'p') && ($this->source_width > $this->source_height)) {
+          $rotate_angle = 90;
+        } elseif (($this->ar == 'P') && ($this->source_width > $this->source_height)) {
+          $rotate_angle = 270;
+        }
+
+      }
+      while ($rotate_angle < 0) {
+        $rotate_angle += 360;
+      }
+      $rotate_angle = $rotate_angle % 360;
+      if ($rotate_angle != 0) {
+
+        if ($rotate_angle % 90) {
+          $this->is_alpha = true;
+        }
+
+        $background_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_source, $this->config_background_hexcolor);
+
+        //if ((phpthumb_functions::gd_version() >= 2) && phpthumb_functions::CaseInsensitiveInArray($this->thumbnailFormat, $this->AlphaCapableFormats) && !$this->bg && ($rotate_angle % 90)) {
+        if ((phpthumb_functions::gd_version() >= 2) && !$this->bg && ($rotate_angle % 90)) {
+
+          $this->DebugMessage('Using alpha rotate', __FILE__, __LINE__);
+          if ($gdimg_rotate_mask = phpthumb_functions::ImageCreateFunction(ImageSX($this->gdimg_source), ImageSY($this->gdimg_source))) {
+
+            for ($i = 0; $i <= 255; $i++) {
+              $color_mask[$i] = ImageColorAllocate($gdimg_rotate_mask, $i, $i, $i);
+            }
+            ImageFilledRectangle($gdimg_rotate_mask, 0, 0, ImageSX($gdimg_rotate_mask), ImageSY($gdimg_rotate_mask), $color_mask[255]);
+            $imageX = ImageSX($this->gdimg_source);
+            $imageY = ImageSY($this->gdimg_source);
+            for ($x = 0; $x < $imageX; $x++) {
+              for ($y = 0; $y < $imageY; $y++) {
+                $pixelcolor = phpthumb_functions::GetPixelColor($this->gdimg_source, $x, $y);
+                ImageSetPixel($gdimg_rotate_mask, $x, $y, $color_mask[255 - round($pixelcolor['alpha'] * 255 / 127)]);
+              }
+            }
+            $gdimg_rotate_mask  = ImageRotate($gdimg_rotate_mask,  $rotate_angle, $color_mask[0]);
+            $this->gdimg_source = ImageRotate($this->gdimg_source, $rotate_angle, $background_color);
+
+            ImageAlphaBlending($this->gdimg_source, false);
+            ImageSaveAlpha($this->gdimg_source, true);
+            $this->is_alpha = true;
+            $phpThumbFilters = new phpthumb_filters();
+            $phpThumbFilters->phpThumbObject = $this;
+            $phpThumbFilters->ApplyMask($gdimg_rotate_mask, $this->gdimg_source);
+
+            ImageDestroy($gdimg_rotate_mask);
+            $this->source_width  = ImageSX($this->gdimg_source);
+            $this->source_height = ImageSY($this->gdimg_source);
+
+          } else {
+            $this->DebugMessage('ImageCreateFunction() failed', __FILE__, __LINE__);
+          }
+
+        } else {
+
+          if (phpthumb_functions::gd_version() < 2) {
+            $this->DebugMessage('Using non-alpha rotate because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+          } elseif ($this->bg) {
+            $this->DebugMessage('Using non-alpha rotate because $this->bg is "'.$this->bg.'"', __FILE__, __LINE__);
+          } elseif ($this->bg) {
+            $this->DebugMessage('Using non-alpha rotate because ($rotate_angle % 90) = "'.($rotate_angle % 90).'"', __FILE__, __LINE__);
+          } else {
+            $this->DebugMessage('Using non-alpha rotate because $this->thumbnailFormat is "'.$this->thumbnailFormat.'"', __FILE__, __LINE__);
+          }
+
+          if (ImageColorTransparent($this->gdimg_source) >= 0) {
+            // ImageRotate() forgets all about an image's transparency and sets the transparent color to black
+            // To compensate, flood-fill the transparent color of the source image with the specified background color first
+            // then rotate and the colors should match
+
+            if (!function_exists('ImageIsTrueColor') || !ImageIsTrueColor($this->gdimg_source)) {
+              // convert paletted image to true-color before rotating to prevent nasty aliasing artifacts
+
+              $this->source_width  = ImageSX($this->gdimg_source);
+              $this->source_height = ImageSY($this->gdimg_source);
+              $gdimg_newsrc = phpthumb_functions::ImageCreateFunction($this->source_width, $this->source_height);
+              $background_color = phpthumb_functions::ImageHexColorAllocate($gdimg_newsrc, $this->config_background_hexcolor);
+              ImageFilledRectangle($gdimg_newsrc, 0, 0, $this->source_width, $this->source_height, phpthumb_functions::ImageHexColorAllocate($gdimg_newsrc, $this->config_background_hexcolor));
+              ImageCopy($gdimg_newsrc, $this->gdimg_source, 0, 0, 0, 0, $this->source_width, $this->source_height);
+              ImageDestroy($this->gdimg_source);
+              unset($this->gdimg_source);
+              $this->gdimg_source = $gdimg_newsrc;
+              unset($gdimg_newsrc);
+
+            } else {
+
+              ImageColorSet(
+                $this->gdimg_source,
+                ImageColorTransparent($this->gdimg_source),
+                hexdec(substr($this->config_background_hexcolor, 0, 2)),
+                hexdec(substr($this->config_background_hexcolor, 2, 2)),
+                hexdec(substr($this->config_background_hexcolor, 4, 2)));
+
+              ImageColorTransparent($this->gdimg_source, -1);
+
+            }
+          }
+
+          $this->gdimg_source = ImageRotate($this->gdimg_source, $rotate_angle, $background_color);
+          $this->source_width  = ImageSX($this->gdimg_source);
+          $this->source_height = ImageSY($this->gdimg_source);
+
+        }
+      }
+    }
+    return true;
+  }
+
+
+  function FixedAspectRatio() {
+    // optional fixed-dimension images (regardless of aspect ratio)
+
+//echo $this->thumbnail_width.'x'.$this->thumbnail_height.'['.__LINE__.']<br>';
+    if (!$this->far) {
+      // do nothing
+      return true;
+    }
+
+    if (!$this->w || !$this->h) {
+      return false;
+    }
+    $this->thumbnail_width  = $this->w;
+    $this->thumbnail_height = $this->h;
+    $this->is_alpha = true;
+    if ($this->thumbnail_image_width >= $this->thumbnail_width) {
+//echo __LINE__.'<br>';
+
+      if ($this->w) {
+        $aspectratio = $this->thumbnail_image_height / $this->thumbnail_image_width;
+        $this->thumbnail_image_height = round($this->thumbnail_image_width * $aspectratio);
+        $this->thumbnail_height = ($this->h ? $this->h : $this->thumbnail_image_height);
+      } elseif ($this->thumbnail_image_height < $this->thumbnail_height) {
+        $this->thumbnail_image_height = $this->thumbnail_height;
+        $this->thumbnail_image_width  = round($this->thumbnail_image_height / $aspectratio);
+      }
+
+    } else {
+//echo __LINE__.'<br>';
+
+      if ($this->h) {
+        $aspectratio = $this->thumbnail_image_width / $this->thumbnail_image_height;
+        $this->thumbnail_image_width = round($this->thumbnail_image_height * $aspectratio);
+      } elseif ($this->thumbnail_image_width < $this->thumbnail_width) {
+        $this->thumbnail_image_width = $this->thumbnail_width;
+        $this->thumbnail_image_height  = round($this->thumbnail_image_width / $aspectratio);
+      }
+
+    }
+//echo $this->thumbnail_width.'x'.$this->thumbnail_height.'['.__LINE__.']<br>';
+//exit;
+    return true;
+  }
+
+
+  function AntiOffsiteLinking() {
+    // Optional anti-offsite hijacking of the thumbnail script
+    $allow = true;
+    if ($allow && $this->config_nooffsitelink_enabled && (@$_SERVER['HTTP_REFERER'] || $this->config_nooffsitelink_require_refer)) {
+      $this->DebugMessage('AntiOffsiteLinking() checking $_SERVER[HTTP_REFERER] "'.@$_SERVER['HTTP_REFERER'].'"', __FILE__, __LINE__);
+      $parsed_url = parse_url(@$_SERVER['HTTP_REFERER']);
+      if (!phpthumb_functions::CaseInsensitiveInArray(@$parsed_url['host'], $this->config_nooffsitelink_valid_domains)) {
+        $allow = false;
+        $erase   = $this->config_nooffsitelink_erase_image;
+        $message = $this->config_nooffsitelink_text_message;
+        $this->DebugMessage('AntiOffsiteLinking() - "'.@$parsed_url['host'].'" is NOT in $this->config_nooffsitelink_valid_domains ('.implode(';', $this->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__);
+      } else {
+        $this->DebugMessage('AntiOffsiteLinking() - "'.@$parsed_url['host'].'" is in $this->config_nooffsitelink_valid_domains ('.implode(';', $this->config_nooffsitelink_valid_domains).')', __FILE__, __LINE__);
+      }
+    }
+
+    if ($allow && $this->config_nohotlink_enabled && eregi('^(f|ht)tps?\://', $this->src)) {
+      $parsed_url = parse_url($this->src);
+      if (!phpthumb_functions::CaseInsensitiveInArray(@$parsed_url['host'], $this->config_nohotlink_valid_domains)) {
+        // This domain is not allowed
+        $allow = false;
+        $erase   = $this->config_nohotlink_erase_image;
+        $message = $this->config_nohotlink_text_message;
+        $this->DebugMessage('AntiOffsiteLinking() - "'.$parsed_url['host'].'" is NOT in $this->config_nohotlink_valid_domains ('.implode(';', $this->config_nohotlink_valid_domains).')', __FILE__, __LINE__);
+      } else {
+        $this->DebugMessage('AntiOffsiteLinking() - "'.$parsed_url['host'].'" is in $this->config_nohotlink_valid_domains ('.implode(';', $this->config_nohotlink_valid_domains).')', __FILE__, __LINE__);
+      }
+    }
+
+    if ($allow) {
+      $this->DebugMessage('AntiOffsiteLinking() says this is allowed', __FILE__, __LINE__);
+      return true;
+    }
+
+    if (!phpthumb_functions::IsHexColor($this->config_error_bgcolor)) {
+      return $this->ErrorImage('Invalid hex color string "'.$this->config_error_bgcolor.'" for $this->config_error_bgcolor');
+    }
+    if (!phpthumb_functions::IsHexColor($this->config_error_textcolor)) {
+      return $this->ErrorImage('Invalid hex color string "'.$this->config_error_textcolor.'" for $this->config_error_textcolor');
+    }
+    if ($erase) {
+
+      return $this->ErrorImage($message, $this->thumbnail_width, $this->thumbnail_height, $this->config_error_bgcolor, $this->config_error_textcolor, $this->config_error_fontsize);
+
+    } else {
+
+      $nohotlink_text_array = explode("\n", wordwrap($message, floor($this->thumbnail_width / ImageFontWidth($this->config_error_fontsize)), "\n"));
+      $nohotlink_text_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_output, $this->config_error_textcolor);
+
+      $topoffset = round(($this->thumbnail_height - (count($nohotlink_text_array) * ImageFontHeight($this->config_error_fontsize))) / 2);
+
+      $rowcounter = 0;
+      $this->DebugMessage('AntiOffsiteLinking() writing '.count($nohotlink_text_array).' lines of text "'.$message.'" (in #'.$this->config_error_textcolor.') on top of image', __FILE__, __LINE__);
+      foreach ($nohotlink_text_array as $dummy => $textline) {
+        $leftoffset = max(0, round(($this->thumbnail_width - (strlen($textline) * ImageFontWidth($this->config_error_fontsize))) / 2));
+        ImageString($this->gdimg_output, $this->config_error_fontsize, $leftoffset, $topoffset + ($rowcounter++ * ImageFontHeight($this->config_error_fontsize)), $textline, $nohotlink_text_color);
+      }
+
+    }
+    return true;
+  }
+
+
+  function AlphaChannelFlatten() {
+    if (!$this->is_alpha) {
+      // image doesn't have alpha transparency, no need to flatten
+      $this->DebugMessage('skipping AlphaChannelFlatten() because !$this->is_alpha', __FILE__, __LINE__);
+      return false;
+    }
+    switch ($this->thumbnailFormat) {
+      case 'png':
+      case 'ico':
+        // image has alpha transparency, but output as PNG or ICO which can handle it
+        $this->DebugMessage('skipping AlphaChannelFlatten() because ($this->thumbnailFormat == "'.$this->thumbnailFormat.'")', __FILE__, __LINE__);
+        return false;
+        break;
+
+      case 'gif':
+        // image has alpha transparency, but output as GIF which can handle only single-color transparency
+        $CurrentImageColorTransparent = ImageColorTransparent($this->gdimg_output);
+        if ($CurrentImageColorTransparent == -1) {
+          // no transparent color defined
+
+          if (phpthumb_functions::gd_version() < 2.0) {
+            $this->DebugMessage('AlphaChannelFlatten() failed because GD version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+            return false;
+          }
+
+          if ($img_alpha_mixdown_dither = @ImageCreateTrueColor(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output))) {
+
+            for ($i = 0; $i <= 255; $i++) {
+              $dither_color[$i] = ImageColorAllocate($img_alpha_mixdown_dither, $i, $i, $i);
+            }
+
+            // scan through current truecolor image copy alpha channel to temp image as grayscale
+            for ($x = 0; $x < $this->thumbnail_width; $x++) {
+              for ($y = 0; $y < $this->thumbnail_height; $y++) {
+                $PixelColor = phpthumb_functions::GetPixelColor($this->gdimg_output, $x, $y);
+                ImageSetPixel($img_alpha_mixdown_dither, $x, $y, $dither_color[($PixelColor['alpha'] * 2)]);
+              }
+            }
+
+            // dither alpha channel grayscale version down to 2 colors
+            ImageTrueColorToPalette($img_alpha_mixdown_dither, true, 2);
+
+            // reduce color palette to 256-1 colors (leave one palette position for transparent color)
+            ImageTrueColorToPalette($this->gdimg_output, true, 255);
+
+            // allocate a new color for transparent color index
+            $TransparentColor = ImageColorAllocate($this->gdimg_output, 1, 254, 253);
+            ImageColorTransparent($this->gdimg_output, $TransparentColor);
+
+            // scan through alpha channel image and note pixels with >50% transparency
+            $TransparentPixels = array();
+            for ($x = 0; $x < $this->thumbnail_width; $x++) {
+              for ($y = 0; $y < $this->thumbnail_height; $y++) {
+                $AlphaChannelPixel = phpthumb_functions::GetPixelColor($img_alpha_mixdown_dither, $x, $y);
+                if ($AlphaChannelPixel['red'] > 127) {
+                  ImageSetPixel($this->gdimg_output, $x, $y, $TransparentColor);
+                }
+              }
+            }
+            ImageDestroy($img_alpha_mixdown_dither);
+
+            $this->DebugMessage('AlphaChannelFlatten() set image to 255+1 colors with transparency for GIF output', __FILE__, __LINE__);
+            return true;
+
+          } else {
+            $this->DebugMessage('AlphaChannelFlatten() failed ImageCreate('.ImageSX($this->gdimg_output).', '.ImageSY($this->gdimg_output).')', __FILE__, __LINE__);
+            return false;
+          }
+
+        } else {
+          // a single transparent color already defined, leave as-is
+          $this->DebugMessage('skipping AlphaChannelFlatten() because ($this->thumbnailFormat == "'.$this->thumbnailFormat.'") and ImageColorTransparent returned "'.$CurrentImageColorTransparent.'"', __FILE__, __LINE__);
+          return true;
+        }
+        break;
+    }
+    $this->DebugMessage('continuing AlphaChannelFlatten() for output format "'.$this->thumbnailFormat.'"', __FILE__, __LINE__);
+
+    // image has alpha transparency, and is being output in a format that doesn't support it -- flatten
+    if ($gdimg_flatten_temp = phpthumb_functions::ImageCreateFunction($this->thumbnail_width, $this->thumbnail_height)) {
+
+      $this->config_background_hexcolor = ($this->bg ? $this->bg : $this->config_background_hexcolor);
+      if (!phpthumb_functions::IsHexColor($this->config_background_hexcolor)) {
+        return $this->ErrorImage('Invalid hex color string "'.$this->config_background_hexcolor.'" for parameter "bg"');
+      }
+      $background_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_output, $this->config_background_hexcolor);
+      ImageFilledRectangle($gdimg_flatten_temp, 0, 0, $this->thumbnail_width, $this->thumbnail_height, $background_color);
+      ImageCopy($gdimg_flatten_temp, $this->gdimg_output, 0, 0, 0, 0, $this->thumbnail_width, $this->thumbnail_height);
+
+      ImageAlphaBlending($this->gdimg_output, true);
+      ImageSaveAlpha($this->gdimg_output, false);
+      ImageColorTransparent($this->gdimg_output, -1);
+      ImageCopy($this->gdimg_output, $gdimg_flatten_temp, 0, 0, 0, 0, $this->thumbnail_width, $this->thumbnail_height);
+
+      ImageDestroy($gdimg_flatten_temp);
+      return true;
+
+    } else {
+      $this->DebugMessage('ImageCreateFunction() failed', __FILE__, __LINE__);
+    }
+    return false;
+  }
+
+
+  function ApplyFilters() {
+    if ($this->fltr && is_array($this->fltr)) {
+      if (!include_once(dirname(__FILE__).'/phpthumb.filters.php')) {
+        $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.filters.php" which is required for applying filters ('.implode(';', $this->fltr).')', __FILE__, __LINE__);
+        return false;
+      }
+      $phpthumbFilters = new phpthumb_filters();
+      $phpthumbFilters->phpThumbObject = $this;
+      foreach ($this->fltr as $dummy => $filtercommand) {
+        @list($command, $parameter) = explode('|', $filtercommand, 2);
+        $this->DebugMessage('Attempting to process filter command "'.$command.'('.$parameter.')"', __FILE__, __LINE__);
+        switch ($command) {
+          case 'brit':
+            $phpthumbFilters->Brightness($this->gdimg_output, $parameter);
+            break;
+
+          case 'cont':
+            $phpthumbFilters->Contrast($this->gdimg_output, $parameter);
+            break;
+
+          case 'ds':
+            $phpthumbFilters->Desaturate($this->gdimg_output, $parameter, '');
+            break;
+
+          case 'sat':
+            $phpthumbFilters->Saturation($this->gdimg_output, $parameter, '');
+            break;
+
+          case 'gray':
+            $phpthumbFilters->Grayscale($this->gdimg_output);
+            break;
+
+          case 'clr':
+            if (phpthumb_functions::gd_version() < 2) {
+              $this->DebugMessage('Skipping Colorize() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              break;
+            }
+            @list($amount, $color) = explode('|', $parameter);
+            $phpthumbFilters->Colorize($this->gdimg_output, $amount, $color);
+            break;
+
+          case 'sep':
+            if (phpthumb_functions::gd_version() < 2) {
+              $this->DebugMessage('Skipping Sepia() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              break;
+            }
+            @list($amount, $color) = explode('|', $parameter);
+            $phpthumbFilters->Sepia($this->gdimg_output, $amount, $color);
+            break;
+
+          case 'gam':
+            $phpthumbFilters->Gamma($this->gdimg_output, $parameter);
+            break;
+
+          case 'neg':
+            $phpthumbFilters->Negative($this->gdimg_output);
+            break;
+
+          case 'th':
+            $phpthumbFilters->Threshold($this->gdimg_output, $parameter);
+            break;
+
+          case 'rcd':
+            if (phpthumb_functions::gd_version() < 2) {
+              $this->DebugMessage('Skipping ReduceColorDepth() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              break;
+            }
+            @list($colors, $dither) = explode('|', $parameter);
+            $colors = ($colors                ?  (int) $colors : 256);
+            $dither  = ((strlen($dither) > 0) ? (bool) $dither : true);
+            $phpthumbFilters->ReduceColorDepth($this->gdimg_output, $colors, $dither);
+            break;
+
+          case 'flip':
+            $phpthumbFilters->Flip($this->gdimg_output, (strpos(strtolower($parameter), 'x') !== false), (strpos(strtolower($parameter), 'y') !== false));
+            break;
+
+          case 'edge':
+            $phpthumbFilters->EdgeDetect($this->gdimg_output);
+            break;
+
+          case 'emb':
+            $phpthumbFilters->Emboss($this->gdimg_output);
+            break;
+
+          case 'bvl':
+            @list($width, $color1, $color2) = explode('|', $parameter);
+            $phpthumbFilters->Bevel($this->gdimg_output, $width, $color1, $color2);
+            break;
+
+          case 'lvl':
+            @list($band, $min, $max) = explode('|', $parameter);
+            $band = ($band              ? $band : '*');
+            $min  = ((strlen($min) > 0) ? $min  : '-1');
+            $max  = ((strlen($max) > 0) ? $max  : '-1');
+            $phpthumbFilters->HistogramStretch($this->gdimg_output, $band, $min, $max);
+            break;
+
+          case 'wb':
+            $phpthumbFilters->WhiteBalance($this->gdimg_output, $parameter);
+            break;
+
+          case 'hist':
+            if (phpthumb_functions::gd_version() < 2) {
+              $this->DebugMessage('Skipping HistogramOverlay() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              break;
+            }
+            @list($bands, $colors, $width, $height, $alignment, $opacity, $margin) = explode('|', $parameter);
+            $bands     = ($bands     ? $bands     :  '*');
+            $colors    = ($colors    ? $colors    :   '');
+            $width     = ($width     ? $width     : 0.25);
+            $height    = ($height    ? $height    : 0.25);
+            $alignment = ($alignment ? $alignment : 'BR');
+            $opacity   = ($opacity   ? $opacity   :   50);
+            $margin    = ($margin    ? $margin    :    5);
+            $phpthumbFilters->HistogramOverlay($this->gdimg_output, $bands, $colors, $width, $height, $alignment, $opacity, $margin);
+            break;
+
+          case 'fram':
+            @list($frame_width, $edge_width, $color_frame, $color1, $color2) = explode('|', $parameter);
+            $phpthumbFilters->Frame($this->gdimg_output, $frame_width, $edge_width, $color_frame, $color1, $color2);
+            break;
+
+          case 'drop':
+            if (phpthumb_functions::gd_version() < 2) {
+              $this->DebugMessage('Skipping DropShadow() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              return false;
+            }
+            $this->is_alpha = true;
+            @list($distance, $width, $color, $angle, $fade) = explode('|', $parameter);
+            $phpthumbFilters->DropShadow($this->gdimg_output, $distance, $width, $color, $angle, $fade);
+            break;
+
+          case 'mask':
+            if (phpthumb_functions::gd_version() < 2) {
+              $this->DebugMessage('Skipping Mask() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              return false;
+            }
+            $mask_filename = $this->ResolveFilenameToAbsolute($parameter);
+            if (@is_readable($mask_filename) && ($fp_mask = @fopen($mask_filename, 'rb'))) {
+              $MaskImageData = '';
+              do {
+                $buffer = fread($fp_mask, 8192);
+                $MaskImageData .= $buffer;
+              } while (strlen($buffer) > 0);
+              fclose($fp_mask);
+              if ($gdimg_mask = $this->ImageCreateFromStringReplacement($MaskImageData)) {
+                $this->is_alpha = true;
+                $phpthumbFilters->ApplyMask($gdimg_mask, $this->gdimg_output);
+                ImageDestroy($gdimg_mask);
+              } else {
+                $this->DebugMessage('ImageCreateFromStringReplacement() failed for "'.$mask_filename.'"', __FILE__, __LINE__);
+              }
+            } else {
+              $this->DebugMessage('Cannot open mask file "'.$mask_filename.'"', __FILE__, __LINE__);
+            }
+            break;
+
+          case 'elip':
+            if (phpthumb_functions::gd_version() < 2) {
+              $this->DebugMessage('Skipping Elipse() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              return false;
+            }
+            $this->is_alpha = true;
+            $phpthumbFilters->Elipse($this->gdimg_output);
+            break;
+
+          case 'ric':
+            if (phpthumb_functions::gd_version() < 2) {
+              $this->DebugMessage('Skipping RoundedImageCorners() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              return false;
+            }
+            @list($radius_x, $radius_y) = explode('|', $parameter);
+            if (($radius_x < 1) || ($radius_y < 1)) {
+              $this->DebugMessage('Skipping RoundedImageCorners('.$radius_x.', '.$radius_y.') because x/y radius is less than 1', __FILE__, __LINE__);
+              break;
+            }
+            $this->is_alpha = true;
+            $phpthumbFilters->RoundedImageCorners($this->gdimg_output, $radius_x, $radius_y);
+            break;
+
+          case 'crop':
+            @list($left, $right, $top, $bottom) = explode('|', $parameter);
+            $phpthumbFilters->Crop($this->gdimg_output, $left, $right, $top, $bottom);
+            break;
+
+          case 'bord':
+            @list($border_width, $radius_x, $radius_y, $hexcolor_border) = explode('|', $parameter);
+            $this->is_alpha = true;
+            $phpthumbFilters->ImageBorder($this->gdimg_output, $border_width, $radius_x, $radius_y, $hexcolor_border);
+            break;
+
+          case 'over':
+            @list($filename, $underlay, $margin, $opacity) = explode('|', $parameter);
+            $underlay = (bool) ($underlay              ? $underlay : false);
+            $margin   =        ((strlen($margin)  > 0) ? $margin   : ($underlay ? 0.1 : 0.0));
+            $opacity  =        ((strlen($opacity) > 0) ? $opacity  : 100);
+            if (($margin > 0) && ($margin < 1)) {
+              $margin = min(0.499, $margin);
+            } elseif (($margin > -1) && ($margin < 0)) {
+              $margin = max(-0.499, $margin);
+            }
+
+            $filename = $this->ResolveFilenameToAbsolute($filename);
+            if (@is_readable($filename) && ($fp_watermark = @fopen($filename, 'rb'))) {
+              $WatermarkImageData = '';
+              do {
+                $buffer = fread($fp_watermark, 8192);
+                $WatermarkImageData .= $buffer;
+              } while (strlen($buffer) > 0);
+              fclose($fp_watermark);
+              if ($img_watermark = $this->ImageCreateFromStringReplacement($WatermarkImageData)) {
+                if ($margin < 1) {
+                  $resized_x = max(1, ImageSX($this->gdimg_output) - round(2 * (ImageSX($this->gdimg_output) * $margin)));
+                  $resized_y = max(1, ImageSY($this->gdimg_output) - round(2 * (ImageSY($this->gdimg_output) * $margin)));
+                } else {
+                  $resized_x = max(1, ImageSX($this->gdimg_output) - round(2 * $margin));
+                  $resized_y = max(1, ImageSY($this->gdimg_output) - round(2 * $margin));
+                }
+
+                if ($underlay) {
+
+                  if ($img_watermark_resized = phpthumb_functions::ImageCreateFunction(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output))) {
+                    ImageAlphaBlending($img_watermark_resized, false);
+                    ImageSaveAlpha($img_watermark_resized, true);
+                    $this->ImageResizeFunction($img_watermark_resized, $img_watermark, 0, 0, 0, 0, ImageSX($img_watermark_resized), ImageSY($img_watermark_resized), ImageSX($img_watermark), ImageSY($img_watermark));
+                    if ($img_source_resized = phpthumb_functions::ImageCreateFunction($resized_x, $resized_y)) {
+                      ImageAlphaBlending($img_source_resized, false);
+                      ImageSaveAlpha($img_source_resized, true);
+                      $this->ImageResizeFunction($img_source_resized, $this->gdimg_output, 0, 0, 0, 0, ImageSX($img_source_resized), ImageSY($img_source_resized), ImageSX($this->gdimg_output), ImageSY($this->gdimg_output));
+                      $phpthumbFilters->WatermarkOverlay($img_watermark_resized, $img_source_resized, 'C', $opacity, $margin);
+                      ImageCopy($this->gdimg_output, $img_watermark_resized, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output));
+                    } else {
+                      $this->DebugMessage('phpthumb_functions::ImageCreateFunction('.$resized_x.', '.$resized_y.')', __FILE__, __LINE__);
+                    }
+                    ImageDestroy($img_watermark_resized);
+                  } else {
+                    $this->DebugMessage('phpthumb_functions::ImageCreateFunction('.ImageSX($this->gdimg_output).', '.ImageSY($this->gdimg_output).')', __FILE__, __LINE__);
+                  }
+
+                } else { // overlay
+
+                  if ($img_watermark_resized = phpthumb_functions::ImageCreateFunction($resized_x, $resized_y)) {
+                    ImageAlphaBlending($img_watermark_resized, false);
+                    ImageSaveAlpha($img_watermark_resized, true);
+                    $this->ImageResizeFunction($img_watermark_resized, $img_watermark, 0, 0, 0, 0, ImageSX($img_watermark_resized), ImageSY($img_watermark_resized), ImageSX($img_watermark), ImageSY($img_watermark));
+                    $phpthumbFilters->WatermarkOverlay($this->gdimg_output, $img_watermark_resized, 'C', $opacity, $margin);
+                    ImageDestroy($img_watermark_resized);
+                  } else {
+                    $this->DebugMessage('phpthumb_functions::ImageCreateFunction('.$resized_x.', '.$resized_y.')', __FILE__, __LINE__);
+                  }
+
+                }
+                ImageDestroy($img_watermark);
+
+              } else {
+                $this->DebugMessage('ImageCreateFromStringReplacement() failed for "'.$filename.'"', __FILE__, __LINE__);
+              }
+            } else {
+              $this->DebugMessage('Cannot open overlay file "'.$filename.'"', __FILE__, __LINE__);
+            }
+            break;
+
+          case 'wmi':
+            @list($filename, $alignment, $opacity, $margin) = explode('|', $parameter);
+            $alignment = ($alignment       ? $alignment : 'BR');
+            $opacity   = (strlen($opacity) ? $opacity   : 50);
+            $margin    = (strlen($margin)  ? $margin    : 5);
+
+            $filename = $this->ResolveFilenameToAbsolute($filename);
+            if (@is_readable($filename)) {
+              //if ($img_watermark = $this->ImageCreateFromFilename($filename, $rawImageData)) {
+              if ($img_watermark = $this->ImageCreateFromFilename($filename)) {
+                // great
+                $phpthumbFilters->WatermarkOverlay($this->gdimg_output, $img_watermark, $alignment, $opacity, $margin);
+                ImageDestroy($img_watermark);
+              } else {
+                $this->DebugMessage('ImageCreateFromFilename() failed for "'.$filename.'"', __FILE__, __LINE__);
+              }
+            } else {
+              $this->DebugMessage('!is_readable('.$filename.')', __FILE__, __LINE__);
+            }
+            break;
+
+          case 'wmt':
+            @list($text, $size, $alignment, $hex_color, $ttffont, $opacity, $margin, $angle, $bg_color, $bg_opacity, $fillextend) = explode('|', $parameter);
+            $text       = ($text            ? $text       : '');
+            $size       = ($size            ? $size       : 3);
+            $alignment  = ($alignment       ? $alignment  : 'BR');
+            $hex_color  = ($hex_color       ? $hex_color  : '000000');
+            $ttffont    = ($ttffont         ? $ttffont    : '');
+            $opacity    = (strlen($opacity) ? $opacity    : 50);
+            $margin     = (strlen($margin)  ? $margin     : 5);
+            $angle      = (strlen($angle)   ? $angle      : 0);
+            $bg_color   = ($bg_color        ? $bg_color   : false);
+            $bg_opacity = ($bg_opacity      ? $bg_opacity : 0);
+            $fillextend = ($fillextend      ? $fillextend : '');
+
+            if (basename($ttffont) == $ttffont) {
+              $ttffont = realpath($this->config_ttf_directory.DIRECTORY_SEPARATOR.$ttffont);
+            } else {
+              $ttffont = $this->ResolveFilenameToAbsolute($ttffont);
+            }
+            $phpthumbFilters->WatermarkText($this->gdimg_output, $text, $size, $alignment, $hex_color, $ttffont, $opacity, $margin, $angle, $bg_color, $bg_opacity, $fillextend);
+            break;
+
+          case 'blur':
+            @list($radius) = explode('|', $parameter);
+            $radius = ($radius ? $radius : 1);
+            if (phpthumb_functions::gd_version() < 2) {
+              $this->DebugMessage('Skipping Blur() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              return false;
+            }
+            $phpthumbFilters->Blur($this->gdimg_output, $radius);
+            break;
+
+          case 'gblr':
+            $phpthumbFilters->BlurGaussian($this->gdimg_output);
+            break;
+
+          case 'sblr':
+            $phpthumbFilters->BlurSelective($this->gdimg_output);
+            break;
+
+          case 'mean':
+            $phpthumbFilters->MeanRemoval($this->gdimg_output);
+            break;
+
+          case 'smth':
+            $phpthumbFilters->Smooth($this->gdimg_output, $parameter);
+            break;
+
+          case 'usm':
+            @list($amount, $radius, $threshold) = explode('|', $parameter);
+            $amount    = ($amount            ? $amount    : 80);
+            $radius    = ($radius            ? $radius    : 0.5);
+            $threshold = (strlen($threshold) ? $threshold : 3);
+            if (phpthumb_functions::gd_version() >= 2.0) {
+              ob_start();
+              if (!@include_once(dirname(__FILE__).'/phpthumb.unsharp.php')) {
+                $include_error = ob_get_contents();
+                if ($include_error) {
+                  $this->DebugMessage('include_once("'.dirname(__FILE__).'/phpthumb.unsharp.php") generated message: "'.$include_error.'"', __FILE__, __LINE__);
+                }
+                $this->DebugMessage('Error including "'.dirname(__FILE__).'/phpthumb.unsharp.php" which is required for unsharp masking', __FILE__, __LINE__);
+                ob_end_clean();
+                return false;
+              }
+              ob_end_clean();
+              phpUnsharpMask::applyUnsharpMask($this->gdimg_output, $amount, $radius, $threshold);
+            } else {
+              $this->DebugMessage('Skipping unsharp mask because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+              return false;
+            }
+            break;
+        }
+      }
+    }
+    return true;
+  }
+
+
+  function MaxFileSize() {
+    if (phpthumb_functions::gd_version() < 2) {
+      $this->DebugMessage('Skipping MaxFileSize() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+      return false;
+    }
+    if ($this->maxb > 0) {
+      switch ($this->thumbnailFormat) {
+        case 'png':
+        case 'gif':
+          $imgRenderFunction = 'image'.$this->thumbnailFormat;
+
+          ob_start();
+          $imgRenderFunction($this->gdimg_output);
+          $imgdata = ob_get_contents();
+          ob_end_clean();
+
+          if (strlen($imgdata) > $this->maxb) {
+            for ($i = 8; $i >= 1; $i--) {
+              $tempIMG = ImageCreateTrueColor(ImageSX($this->gdimg_output), ImageSY($this->gdimg_output));
+              ImageCopy($tempIMG, $this->gdimg_output, 0, 0, 0, 0, ImageSX($this->gdimg_output), ImageSY($this->gdimg_output));
+              ImageTrueColorToPalette($tempIMG, true, pow(2, $i));
+              ob_start();
+              $imgRenderFunction($tempIMG);
+              $imgdata = ob_get_contents();
+              ob_end_clean();
+
+              if (strlen($imgdata) <= $this->maxb) {
+                ImageTrueColorToPalette($this->gdimg_output, true, pow(2, $i));
+                break;
+              }
+            }
+          }
+          if (strlen($imgdata) > $this->maxb) {
+            ImageTrueColorToPalette($this->gdimg_output, true, pow(2, $i));
+            return false;
+          }
+          break;
+
+        case 'jpeg':
+          ob_start();
+          ImageJPEG($this->gdimg_output);
+          $imgdata = ob_get_contents();
+          ob_end_clean();
+
+          $OriginalJPEGquality = $this->thumbnailQuality;
+          if (strlen($imgdata) > $this->maxb) {
+            for ($i = 3; $i < 20; $i++) {
+              $q = round(100 * (1 - log10($i / 2)));
+              ob_start();
+              ImageJPEG($this->gdimg_output, '', $q);
+              $imgdata = ob_get_contents();
+              ob_end_clean();
+
+              $this->thumbnailQuality = $q;
+              if (strlen($imgdata) <= $this->maxb) {
+                break;
+              }
+            }
+          }
+          if (strlen($imgdata) > $this->maxb) {
+            return false;
+          }
+          break;
+
+        default:
+          return false;
+          break;
+      }
+    }
+    return true;
+  }
+
+
+  function CalculateThumbnailDimensions() {
+//echo $this->source_width.'x'.$this->source_height.'<hr>';
+    $this->thumbnailCropX = ($this->sx ? (($this->sx >= 1) ? $this->sx : round($this->sx * $this->source_width))  : 0);
+//echo $this->thumbnailCropX.'<br>';
+    $this->thumbnailCropY = ($this->sy ? (($this->sy >= 1) ? $this->sy : round($this->sy * $this->source_height)) : 0);
+//echo $this->thumbnailCropY.'<br>';
+    $this->thumbnailCropW = ($this->sw ? (($this->sw >= 1) ? $this->sw : round($this->sw * $this->source_width))  : $this->source_width);
+//echo $this->thumbnailCropW.'<br>';
+    $this->thumbnailCropH = ($this->sh ? (($this->sh >= 1) ? $this->sh : round($this->sh * $this->source_height)) : $this->source_height);
+//echo $this->thumbnailCropH.'<hr>';
+
+    // limit source area to original image area
+    $this->thumbnailCropW = max(1, min($this->thumbnailCropW, $this->source_width  - $this->thumbnailCropX));
+    $this->thumbnailCropH = max(1, min($this->thumbnailCropH, $this->source_height - $this->thumbnailCropY));
+
+    $this->DebugMessage('CalculateThumbnailDimensions() [x,y,w,h] initially set to ['.$this->thumbnailCropX.','.$this->thumbnailCropY.','.$this->thumbnailCropW.','.$this->thumbnailCropH.']', __FILE__, __LINE__);
+
+
+    if ($this->zc && $this->w && $this->h) {
+      // Zoom Crop
+      // retain proportional resizing we did above, but crop off larger dimension so smaller
+      // dimension fully fits available space
+
+      $scaling_X = $this->source_width  / $this->w;
+      $scaling_Y = $this->source_height / $this->h;
+      if ($scaling_X > $scaling_Y) {
+        // some of the width will need to be cropped
+        $allowable_width = $this->source_width / $scaling_X * $scaling_Y;
+        $this->thumbnailCropW = round($allowable_width);
+        $this->thumbnailCropX = round(($this->source_width - $allowable_width) / 2);
+
+      } elseif ($scaling_Y > $scaling_X) {
+        // some of the height will need to be cropped
+        $allowable_height = $this->source_height / $scaling_Y * $scaling_X;
+        $this->thumbnailCropH = round($allowable_height);
+        $this->thumbnailCropY = round(($this->source_height - $allowable_height) / 2);
+
+      } else {
+        // image fits perfectly, no cropping needed
+      }
+      $this->thumbnail_width  = $this->w;
+      $this->thumbnail_height = $this->h;
+      $this->thumbnail_image_width  = $this->thumbnail_width;
+      $this->thumbnail_image_height = $this->thumbnail_height;
+
+    } elseif ($this->iar && $this->w && $this->h) {
+
+      // Ignore Aspect Ratio
+      // stretch image to fit exactly 'w' x 'h'
+      $this->thumbnail_width  = $this->w;
+      $this->thumbnail_height = $this->h;
+      $this->thumbnail_image_width  = $this->thumbnail_width;
+      $this->thumbnail_image_height = $this->thumbnail_height;
+
+    } else {
+
+      $original_aspect_ratio = $this->thumbnailCropW / $this->thumbnailCropH;
+//var_dump($original_aspect_ratio);
+//echo '<hr>';
+      if ($this->aoe) {
+        if ($this->w && $this->h) {
+          $maxwidth  = min($this->w, $this->h * $original_aspect_ratio);
+          $maxheight = min($this->h, $this->w / $original_aspect_ratio);
+        } elseif ($this->w) {
+          $maxwidth  = $this->w;
+          $maxheight = $this->w / $original_aspect_ratio;
+        } elseif ($this->h) {
+          $maxwidth  = $this->h * $original_aspect_ratio;
+          $maxheight = $this->h;
+        } else {
+          $maxwidth  = $this->thumbnailCropW;
+          $maxheight = $this->thumbnailCropH;
+        }
+      } else {
+        $maxwidth  = phpthumb_functions::nonempty_min($this->w, $this->thumbnailCropW, $this->config_output_maxwidth);
+        $maxheight = phpthumb_functions::nonempty_min($this->h, $this->thumbnailCropH, $this->config_output_maxheight);
+//echo $maxwidth.'x'.$maxheight.'<br>';
+        $maxwidth  = min($maxwidth, $maxheight * $original_aspect_ratio);
+        $maxheight = min($maxheight, $maxwidth / $original_aspect_ratio);
+//echo $maxwidth.'x'.$maxheight.'<hr>';
+      }
+
+      $this->thumbnail_image_width  = $maxwidth;
+      $this->thumbnail_image_height = $maxheight;
+      $this->thumbnail_width  = $maxwidth;
+      $this->thumbnail_height = $maxheight;
+
+      $this->FixedAspectRatio();
+    }
+
+    $this->thumbnail_width  = max(1, floor($this->thumbnail_width));
+    $this->thumbnail_height = max(1, floor($this->thumbnail_height));
+    return true;
+  }
+
+
+  function CreateGDoutput() {
+    $this->CalculateThumbnailDimensions();
+
+    // Create the GD image (either true-color or 256-color, depending on GD version)
+    $this->gdimg_output = phpthumb_functions::ImageCreateFunction($this->thumbnail_width, $this->thumbnail_height);
+
+    // Images that have transparency must have the background filled with the configured 'bg' color
+    // otherwise the transparent color will appear as black
+    ImageSaveAlpha($this->gdimg_output, true);
+    if ($this->is_alpha && phpthumb_functions::gd_version() >= 2) {
+
+      ImageAlphaBlending($this->gdimg_output, false);
+      $output_full_alpha = phpthumb_functions::ImageColorAllocateAlphaSafe($this->gdimg_output, 255, 255, 255, 127);
+      ImageFilledRectangle($this->gdimg_output, 0, 0, $this->thumbnail_width, $this->thumbnail_height, $output_full_alpha);
+
+    } else {
+
+      $current_transparent_color = ImageColorTransparent($this->gdimg_source);
+      if ($this->bg || (@$current_transparent_color >= 0)) {
+
+        $this->config_background_hexcolor = ($this->bg ? $this->bg : $this->config_background_hexcolor);
+        if (!phpthumb_functions::IsHexColor($this->config_background_hexcolor)) {
+          return $this->ErrorImage('Invalid hex color string "'.$this->config_background_hexcolor.'" for parameter "bg"');
+        }
+        $background_color = phpthumb_functions::ImageHexColorAllocate($this->gdimg_output, $this->config_background_hexcolor);
+        ImageFilledRectangle($this->gdimg_output, 0, 0, $this->thumbnail_width, $this->thumbnail_height, $background_color);
+
+      }
+
+    }
+    $this->DebugMessage('CreateGDoutput() returning canvas "'.$this->thumbnail_width.'x'.$this->thumbnail_height.'"', __FILE__, __LINE__);
+    return true;
+  }
+
+  function SetOrientationDependantWidthHeight() {
+    $this->DebugMessage('SetOrientationDependantWidthHeight() starting with "'.$this->source_width.'"x"'.$this->source_height.'"', __FILE__, __LINE__);
+    if ($this->source_height > $this->source_width) {
+      // portrait
+      $this->w = phpthumb_functions::OneOfThese($this->wp, $this->w, $this->ws, $this->wl);
+      $this->h = phpthumb_functions::OneOfThese($this->hp, $this->h, $this->hs, $this->hl);
+    } elseif ($this->source_height < $this->source_width) {
+      // landscape
+      $this->w = phpthumb_functions::OneOfThese($this->wl, $this->w, $this->ws, $this->wp);
+      $this->h = phpthumb_functions::OneOfThese($this->hl, $this->h, $this->hs, $this->hp);
+    } else {
+      // square
+      $this->w = phpthumb_functions::OneOfThese($this->ws, $this->w, $this->wl, $this->wp);
+      $this->h = phpthumb_functions::OneOfThese($this->hs, $this->h, $this->hl, $this->hp);
+    }
+    //$this->w = round($this->w ? $this->w : (($this->h && $this->source_height) ? $this->h * $this->source_width  / $this->source_height : $this->w));
+    //$this->h = round($this->h ? $this->h : (($this->w && $this->source_width)  ? $this->w * $this->source_height / $this->source_width  : $this->h));
+    $this->DebugMessage('SetOrientationDependantWidthHeight() setting w="'.intval($this->w).'", h="'.intval($this->h).'"', __FILE__, __LINE__);
+    return true;
+  }
+
+  function ExtractEXIFgetImageSize() {
+    $this->DebugMessage('starting ExtractEXIFgetImageSize()', __FILE__, __LINE__);
+
+    if (is_resource($this->gdimg_source)) {
+
+      $this->source_width  = ImageSX($this->gdimg_source);
+      $this->source_height = ImageSY($this->gdimg_source);
+
+      $this->SetOrientationDependantWidthHeight();
+
+    } elseif ($this->rawImageData && !$this->sourceFilename) {
+
+      $this->DebugMessage('bypassing EXIF and GetImageSize sections because $this->rawImageData is set and $this->sourceFilename is not set', __FILE__, __LINE__);
+
+    }
+
+    if (is_null($this->getimagesizeinfo)) {
+      $this->getimagesizeinfo = @GetImageSize($this->sourceFilename);
+    }
+
+    if (!empty($this->getimagesizeinfo)) {
+      // great
+      $this->getimagesizeinfo['filesize'] = @filesize($this->sourceFilename);
+    } elseif (!$this->rawImageData) {
+      $this->DebugMessage('GetImageSize("'.$this->sourceFilename.'") failed', __FILE__, __LINE__);
+    }
+
+    if ($this->config_prefer_imagemagick) {
+      if ($this->ImageMagickThumbnailToGD()) {
+        return true;
+      }
+      $this->DebugMessage('ImageMagickThumbnailToGD() failed', __FILE__, __LINE__);
+    }
+
+    $this->source_width  = $this->getimagesizeinfo[0];
+    $this->source_height = $this->getimagesizeinfo[1];
+
+    $this->SetOrientationDependantWidthHeight();
+
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '4.2.0', '>=') && function_exists('exif_read_data')) {
+      $this->exif_raw_data = @exif_read_data($this->sourceFilename, 0, true);
+    }
+    if (function_exists('exif_thumbnail') && ($this->getimagesizeinfo[2] == 2)) {
+      // Extract EXIF info from JPEGs
+
+      $this->exif_thumbnail_width  = '';
+      $this->exif_thumbnail_height = '';
+      $this->exif_thumbnail_type   = '';
+
+      // The parameters width, height and imagetype are available since PHP v4.3.0
+      if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=')) {
+
+        $this->exif_thumbnail_data = @exif_thumbnail($this->sourceFilename, $this->exif_thumbnail_width, $this->exif_thumbnail_height, $this->exif_thumbnail_type);
+
+      } else {
+
+        // older versions of exif_thumbnail output an error message but NOT return false on failure
+        ob_start();
+        $this->exif_thumbnail_data = exif_thumbnail($this->sourceFilename);
+        $exit_thumbnail_error = ob_get_contents();
+        ob_end_clean();
+        if (!$exit_thumbnail_error && $this->exif_thumbnail_data) {
+
+          if ($gdimg_exif_temp = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false)) {
+            $this->exif_thumbnail_width  = ImageSX($gdimg_exif_temp);
+            $this->exif_thumbnail_height = ImageSY($gdimg_exif_temp);
+            $this->exif_thumbnail_type   = 2; // (2 == JPEG) before PHP v4.3.0 only JPEG format EXIF thumbnails are returned
+            unset($gdimg_exif_temp);
+          } else {
+            return $this->ErrorImage('Failed - $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data) in '.__FILE__.' on line '.__LINE__);
+          }
+
+        }
+
+      }
+
+    } elseif (!function_exists('exif_thumbnail')) {
+
+      $this->DebugMessage('exif_thumbnail() does not exist, cannot extract EXIF thumbnail', __FILE__, __LINE__);
+      return false;
+
+    }
+
+    $this->DebugMessage('EXIF thumbnail extraction: (size='.strlen($this->exif_thumbnail_data).'; type="'.$this->exif_thumbnail_type.'"; '.intval($this->exif_thumbnail_width).'x'.intval($this->exif_thumbnail_height).')', __FILE__, __LINE__);
+
+    // see if EXIF thumbnail can be used directly with no processing
+    if ($this->config_use_exif_thumbnail_for_speed && $this->exif_thumbnail_data) {
+      while (true) {
+        if (!$this->xto) {
+          $source_ar = $this->source_width / $this->source_height;
+          $exif_ar = $this->exif_thumbnail_width / $this->exif_thumbnail_height;
+          if (number_format($source_ar, 2) != number_format($exif_ar, 2)) {
+            $this->DebugMessage('not using EXIF thumbnail because $source_ar != $exif_ar ('.$source_ar.' != '.$exif_ar.')', __FILE__, __LINE__);
+            break;
+          }
+          if ($this->w && ($this->w != $this->exif_thumbnail_width)) {
+            $this->DebugMessage('not using EXIF thumbnail because $this->w != $this->exif_thumbnail_width ('.$this->w.' != '.$this->exif_thumbnail_width.')', __FILE__, __LINE__);
+            break;
+          }
+          if ($this->h && ($this->h != $this->exif_thumbnail_height)) {
+            $this->DebugMessage('not using EXIF thumbnail because $this->h != $this->exif_thumbnail_height ('.$this->h.' != '.$this->exif_thumbnail_height.')', __FILE__, __LINE__);
+            break;
+          }
+          $CannotBeSetParameters = array('sx', 'sy', 'sh', 'sw', 'far', 'bg', 'bc', 'fltr', 'phpThumbDebug');
+          foreach ($CannotBeSetParameters as $dummy => $parameter) {
+            if ($this->$parameter) {
+              break 2;
+            }
+          }
+        }
+
+        $this->DebugMessage('setting $this->gdimg_source = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data)', __FILE__, __LINE__);
+        $this->gdimg_source = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data);
+        $this->source_width  = ImageSX($this->gdimg_source);
+        $this->source_height = ImageSY($this->gdimg_source);
+        return true;
+      }
+    }
+
+    if (($this->config_max_source_pixels > 0) && (($this->source_width * $this->source_height) > $this->config_max_source_pixels)) {
+
+      // Source image is larger than would fit in available PHP memory.
+      // If ImageMagick is installed, use it to generate the thumbnail.
+      // Else, if an EXIF thumbnail is available, use that as the source image.
+      // Otherwise, no choice but to fail with an error message
+      $this->DebugMessage('image is '.$this->source_width.'x'.$this->source_height.' and therefore contains more pixels ('.($this->source_width * $this->source_height).') than $this->config_max_source_pixels setting ('.$this->config_max_source_pixels.')', __FILE__, __LINE__);
+      if (!$this->config_prefer_imagemagick && $this->ImageMagickThumbnailToGD()) {
+        // excellent, we have a thumbnailed source image
+        return true;
+      }
+
+    }
+    return true;
+  }
+
+
+  function SetCacheFilename() {
+    if (!is_null($this->cache_filename)) {
+      $this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__);
+      return true;
+    }
+    $this->setOutputFormat();
+    $this->setCacheDirectory();
+    if (!$this->config_cache_directory) {
+      $this->DebugMessage('SetCacheFilename() failed because $this->config_cache_directory is empty', __FILE__, __LINE__);
+      return false;
+    }
+
+    if (!$this->sourceFilename && !$this->rawImageData && $this->src) {
+      $this->sourceFilename = $this->ResolveFilenameToAbsolute($this->src);
+    }
+
+    if ($this->config_cache_default_only_suffix && $this->sourceFilename) {
+      // simplified cache filenames:
+      // only use default parameters in phpThumb.config.php
+      // substitute source filename into * in $this->config_cache_default_only_suffix
+      // (eg: '*_thumb' becomes 'picture_thumb.jpg')
+      if (strpos($this->config_cache_default_only_suffix, '*') === false) {
+        $this->DebugMessage('aborting simplified caching filename because no * in "'.$this->config_cache_default_only_suffix.'"', __FILE__, __LINE__);
+      } else {
+        eregi('(.+)(\.[a-z0-9]+)?$', basename($this->sourceFilename), $matches);
+        $this->cache_filename = $this->config_cache_directory.DIRECTORY_SEPARATOR.rawurlencode(str_replace('*', @$matches[1], $this->config_cache_default_only_suffix)).'.'.strtolower($this->thumbnailFormat);
+        return true;
+      }
+    }
+
+    $this->cache_filename = '';
+    if ($this->new) {
+      $this->cache_filename .= '_new'.strtolower(md5($this->new));
+    } elseif ($this->md5s) {
+      // source image MD5 hash provided
+      $this->DebugMessage('SetCacheFilename() _raw set from $this->md5s = "'.$this->md5s.'"', __FILE__, __LINE__);
+      $this->cache_filename .= '_raw'.$this->md5s;
+    } elseif (!$this->src && $this->rawImageData) {
+      $this->DebugMessage('SetCacheFilename() _raw set from md5($this->rawImageData) = "'.md5($this->rawImageData).'"', __FILE__, __LINE__);
+      $this->cache_filename .= '_raw'.strtolower(md5($this->rawImageData));
+    } else {
+      $this->DebugMessage('SetCacheFilename() _src set from md5($this->sourceFilename) "'.$this->sourceFilename.'" = "'.md5($this->sourceFilename).'"', __FILE__, __LINE__);
+      $this->cache_filename .= '_src'.strtolower(md5($this->sourceFilename));
+    }
+    if (@$_SERVER['HTTP_REFERER'] && $this->config_nooffsitelink_enabled) {
+      $parsed_url1 = @parse_url(@$_SERVER['HTTP_REFERER']);
+      $parsed_url2 = @parse_url('http://'.@$_SERVER['HTTP_HOST']);
+      if (@$parsed_url1['host'] && @$parsed_url2['host'] && ($parsed_url1['host'] != $parsed_url2['host'])) {
+        // include "_offsite" only if nooffsitelink_enabled and if referrer doesn't match the domain of the current server
+        $this->cache_filename .= '_offsite';
+      }
+    }
+
+    $ParametersString = '';
+    if ($this->fltr && is_array($this->fltr)) {
+      $ParametersString .= '_fltr'.implode('_fltr', $this->fltr);
+    }
+    $FilenameParameters1 = array('ar', 'bg', 'bc', 'far', 'sx', 'sy', 'sw', 'sh', 'zc');
+    foreach ($FilenameParameters1 as $dummy => $key) {
+      if ($this->$key) {
+        $ParametersString .= '_'.$key.$this->$key;
+      }
+    }
+    $FilenameParameters2 = array('h', 'w', 'wl', 'wp', 'ws', 'hp', 'hs', 'xto', 'ra', 'iar', 'aoe', 'maxb');
+    foreach ($FilenameParameters2 as $dummy => $key) {
+      if ($this->$key) {
+        $ParametersString .= '_'.$key.intval($this->$key);
+      }
+    }
+    if ($this->thumbnailFormat == 'jpeg') {
+      // only JPEG output has variable quality option
+      $ParametersString .= '_q'.intval($this->thumbnailQuality);
+    }
+    $this->DebugMessage('SetCacheFilename() _par set from md5('.$ParametersString.')', __FILE__, __LINE__);
+    $this->cache_filename .= '_par'.strtolower(md5($ParametersString));
+
+    if ($this->md5s) {
+      // source image MD5 hash provided
+      // do not source image modification date --
+      // cached image will be used even if file was modified or removed
+    } elseif (!$this->config_cache_source_filemtime_ignore_remote && eregi('^(f|ht)tps?\://', $this->src)) {
+      $this->cache_filename .= '_dat'.intval(phpthumb_functions::filedate_remote($this->src));
+    } elseif (!$this->config_cache_source_filemtime_ignore_local && $this->src && !$this->rawImageData) {
+      $this->cache_filename .= '_dat'.intval(@filemtime($this->sourceFilename));
+    }
+
+    $this->cache_filename .= '.'.strtolower($this->thumbnailFormat);
+
+    $this->cache_filename = $this->config_cache_directory.DIRECTORY_SEPARATOR.$this->config_cache_prefix.rawurlencode($this->cache_filename);
+    return true;
+  }
+
+
+  function ImageCreateFromFilename($filename) {
+    // try to create GD image source directly via GD, if possible,
+    // rather than buffering to memory and creating with ImageCreateFromString
+    $ImageCreateWasAttempted = false;
+    $gd_image = false;
+
+    $this->DebugMessage('starting ImageCreateFromFilename('.$filename.')', __FILE__, __LINE__);
+
+    if ($filename && ($getimagesizeinfo = @GetImageSize($filename))) {
+      if ($this->config_max_source_pixels > 0) {
+        if (($getimagesizeinfo[0] * $getimagesizeinfo[1]) < $this->config_max_source_pixels) {
+          $ImageCreateFromFunction = array(
+            1  => 'ImageCreateFromGIF',
+            2  => 'ImageCreateFromJPEG',
+            3  => 'ImageCreateFromPNG',
+            15 => 'ImageCreateFromWBMP',
+          );
+          $this->DebugMessage('ImageCreateFromFilename found ($getimagesizeinfo[2]=='.@$getimagesizeinfo[2].')', __FILE__, __LINE__);
+          switch (@$getimagesizeinfo[2]) {
+            case 1:  // GIF
+            case 2:  // JPEG
+            case 3:  // PNG
+            case 15: // WBMP
+              $ImageCreateFromFunctionName = $ImageCreateFromFunction[$getimagesizeinfo[2]];
+              if (function_exists($ImageCreateFromFunctionName)) {
+                $this->DebugMessage('Calling '.$ImageCreateFromFunctionName.'('.$filename.')', __FILE__, __LINE__);
+                $ImageCreateWasAttempted = true;
+                $gd_image = @$ImageCreateFromFunctionName($filename);
+              } else {
+                $this->DebugMessage('NOT calling '.$ImageCreateFromFunctionName.'('.$filename.') because !function_exists('.$ImageCreateFromFunctionName.')', __FILE__, __LINE__);
+              }
+              break;
+
+            case 4:  // SWF
+            case 5:  // PSD
+            case 6:  // BMP
+            case 7:  // TIFF (LE)
+            case 8:  // TIFF (BE)
+            case 9:  // JPC
+            case 10: // JP2
+            case 11: // JPX
+            case 12: // JB2
+            case 13: // SWC
+            case 14: // IFF
+            case 16: // XBM
+              $this->DebugMessage('No built-in image creation function for image type "'.@$getimagesizeinfo[2].'" ($getimagesizeinfo[2])', __FILE__, __LINE__);
+              break;
+
+            default:
+              $this->DebugMessage('Unknown value for $getimagesizeinfo[2]: "'.@$getimagesizeinfo[2].'"', __FILE__, __LINE__);
+              break;
+          }
+        } else {
+          $this->DebugMessage('image is '.$getimagesizeinfo[0].'x'.$getimagesizeinfo[1].' and therefore contains more pixels ('.($getimagesizeinfo[0] * $getimagesizeinfo[1]).') than $this->config_max_source_pixels setting ('.$this->config_max_source_pixels.')', __FILE__, __LINE__);
+        }
+      }
+    } else {
+      $this->DebugMessage('empty $filename or GetImageSize('.$filename.') failed', __FILE__, __LINE__);
+    }
+
+    if (!$gd_image) {
+      // cannot create from filename, attempt to create source image with ImageCreateFromString, if possible
+      if ($ImageCreateWasAttempted) {
+        $this->DebugMessage(@$ImageCreateFromFunctionName.'() was attempted but FAILED', __FILE__, __LINE__);
+      }
+      $this->DebugMessage('Populating $rawimagedata', __FILE__, __LINE__);
+      $rawimagedata = '';
+      if ($fp = @fopen($filename, 'rb')) {
+        $filesize = filesize($filename);
+        $blocksize = 8192;
+        $blockreads = ceil($filesize / $blocksize);
+        for ($i = 0; $i < $blockreads; $i++) {
+          $rawimagedata .= fread($fp, $blocksize);
+        }
+        fclose($fp);
+      } else {
+        $this->DebugMessage('cannot fopen('.$filename.')', __FILE__, __LINE__);
+      }
+      if ($rawimagedata) {
+        $this->DebugMessage('attempting ImageCreateFromStringReplacement($rawimagedata ('.strlen($rawimagedata).' bytes), true)', __FILE__, __LINE__);
+        $gd_image = $this->ImageCreateFromStringReplacement($rawimagedata, true);
+      }
+    }
+    return $gd_image;
+  }
+
+  function SourceImageToGD() {
+    if (is_resource($this->gdimg_source)) {
+      $this->source_width  = ImageSX($this->gdimg_source);
+      $this->source_height = ImageSY($this->gdimg_source);
+      $this->DebugMessage('skipping SourceImageToGD() because $this->gdimg_source is already a resource ('.$this->source_width.'x'.$this->source_height.')', __FILE__, __LINE__);
+      return true;
+    }
+    $this->DebugMessage('starting SourceImageToGD()', __FILE__, __LINE__);
+
+    if (!$this->gdimg_source && $this->rawImageData) {
+
+      if ($this->md5s && ($this->md5s != md5($this->rawImageData))) {
+        return $this->ErrorImage('$this->md5s != md5($this->rawImageData)'."\n".'"'.$this->md5s.'" != '."\n".'"'.md5($this->rawImageData).'"');
+      }
+      $this->gdimg_source = $this->ImageCreateFromStringReplacement($this->rawImageData);
+      if (!$this->gdimg_source) {
+        return $this->ErrorImage('Unknown image type identified by "'.substr($this->rawImageData, 0, 4).'" ('.phpthumb_functions::HexCharDisplay(substr($this->rawImageData, 0, 4)).') in SourceImageToGD()['.__LINE__.']');
+      }
+
+    } elseif (!$this->gdimg_source && $this->sourceFilename) {
+
+      if ($this->md5s && ($this->md5s != phpthumb_functions::md5_file_safe($this->sourceFilename))) {
+        return $this->ErrorImage('$this->md5s != md5(sourceFilename)'."\n".'"'.$this->md5s.'" != '."\n".'"'.phpthumb_functions::md5_file_safe($this->sourceFilename).'"');
+      }
+      switch (@$this->getimagesizeinfo[2]) {
+        case 1:
+        case 3:
+          // GIF or PNG input file may have transparency
+          $this->is_alpha = true;
+          break;
+      }
+      $this->gdimg_source = $this->ImageCreateFromFilename($this->sourceFilename);
+
+    }
+
+    while (true) {
+      if ($this->gdimg_source) {
+        $this->DebugMessage('Not using EXIF thumbnail data because $this->gdimg_source is already set', __FILE__, __LINE__);
+        break;
+      }
+      if (!$this->exif_thumbnail_data) {
+        $this->DebugMessage('Not using EXIF thumbnail data because $this->exif_thumbnail_data is empty', __FILE__, __LINE__);
+        break;
+      }
+      if (ini_get('safe_mode')) {
+        if (($this->config_max_source_pixels > 0) && (($this->source_width * $this->source_height) > $this->config_max_source_pixels)) {
+          $this->DebugMessage('Using EXIF thumbnail data because source image too large and safe_mode enabled', __FILE__, __LINE__);
+          $this->aoe = true;
+        } else {
+          break;
+        }
+      } else {
+        if (!$this->config_use_exif_thumbnail_for_speed) {
+          $this->DebugMessage('Not using EXIF thumbnail data because $this->config_use_exif_thumbnail_for_speed is FALSE', __FILE__, __LINE__);
+          break;
+        }
+        if (($this->thumbnailCropX != 0) || ($this->thumbnailCropY != 0)) {
+          $this->DebugMessage('Not using EXIF thumbnail data because source cropping is enabled ('.$this->thumbnailCropX.','.$this->thumbnailCropY.')', __FILE__, __LINE__);
+          break;
+        }
+        if (($this->w > $this->exif_thumbnail_width) || ($this->h > $this->exif_thumbnail_height)) {
+          $this->DebugMessage('Not using EXIF thumbnail data because EXIF thumbnail is too small ('.$this->exif_thumbnail_width.'x'.$this->exif_thumbnail_height.' vs '.$this->w.'x'.$this->h.')', __FILE__, __LINE__);
+          break;
+        }
+        $source_ar = $this->source_width / $this->source_height;
+        $exif_ar   = $this->exif_thumbnail_width / $this->exif_thumbnail_height;
+        if (number_format($source_ar, 2) != number_format($exif_ar, 2)) {
+          $this->DebugMessage('not using EXIF thumbnail because $source_ar != $exif_ar ('.$source_ar.' != '.$exif_ar.')', __FILE__, __LINE__);
+          break;
+        }
+      }
+
+      // EXIF thumbnail exists, and is equal to or larger than destination thumbnail, and will be use as source image
+      $this->DebugMessage('Trying to use EXIF thumbnail as source image', __FILE__, __LINE__);
+
+      if ($gdimg_exif_temp = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false)) {
+
+        $this->DebugMessage('Successfully using EXIF thumbnail as source image', __FILE__, __LINE__);
+        $this->gdimg_source   = $gdimg_exif_temp;
+        $this->source_width   = $this->exif_thumbnail_width;
+        $this->source_height  = $this->exif_thumbnail_height;
+        $this->thumbnailCropW = $this->source_width;
+        $this->thumbnailCropH = $this->source_height;
+        return true;
+
+      } else {
+        $this->DebugMessage('$this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false) failed', __FILE__, __LINE__);
+      }
+
+      break;
+    }
+
+    if (!$this->gdimg_source) {
+      $this->DebugMessage('$this->gdimg_source is still empty', __FILE__, __LINE__);
+
+      if ($this->ImageMagickThumbnailToGD()) {
+
+        // excellent, we have a thumbnailed source image
+        $this->DebugMessage('ImageMagickThumbnailToGD() succeeded', __FILE__, __LINE__);
+
+      } else {
+
+        $this->DebugMessage('ImageMagickThumbnailToGD() failed', __FILE__, __LINE__);
+
+        $imageHeader = '';
+        $gd_info = gd_info();
+        $GDreadSupport = false;
+        switch (@$this->getimagesizeinfo[2]) {
+          case 1:
+            $imageHeader = 'Content-Type: image/gif';
+            $GDreadSupport = (bool) @$gd_info['GIF Read Support'];
+            break;
+          case 2:
+            $imageHeader = 'Content-Type: image/jpeg';
+            $GDreadSupport = (bool) @$gd_info['JPG Support'];
+            break;
+          case 3:
+            $imageHeader = 'Content-Type: image/png';
+            $GDreadSupport = (bool) @$gd_info['PNG Support'];
+            break;
+        }
+        if ($imageHeader) {
+          // cannot create image for whatever reason (maybe ImageCreateFromJPEG et al are not available?)
+          // and ImageMagick is not available either, no choice but to output original (not resized/modified) data and exit
+          if ($this->config_error_die_on_source_failure) {
+            $this->ErrorImage('All attempts to create GD image source failed ('.(ini_get('safe_mode') ? 'Safe Mode enabled, ImageMagick unavailable and source image probably too large for GD': ($GDreadSupport ? 'source image probably corrupt' : 'GD does not have read support for "'.$imageHeader.'"')).'), cannot generate thumbnail');
+          } else {
+            $this->DebugMessage('All attempts to create GD image source failed ('.(ini_get('safe_mode') ? 'Safe Mode enabled, ImageMagick unavailable and source image probably too large for GD': ($GDreadSupport ? 'source image probably corrupt' : 'GD does not have read support for "'.$imageHeader.'"')).'), cannot generate thumbnail');
+            //$this->DebugMessage('All attempts to create GD image source failed ('.($GDreadSupport ? 'source image probably corrupt' : 'GD does not have read support for "'.$imageHeader.'"').'), outputing raw image', __FILE__, __LINE__);
+            //if (!$this->phpThumbDebug) {
+            //  header($imageHeader);
+            //  echo $this->rawImageData;
+            //  exit;
+            //}
+            return false;
+          }
+        }
+
+        //switch (substr($this->rawImageData, 0, 2)) {
+        //  case 'BM':
+        switch (@$this->getimagesizeinfo[2]) {
+          case 6:
+            ob_start();
+            if (!@include_once(dirname(__FILE__).'/phpthumb.bmp.php')) {
+              ob_end_clean();
+              return $this->ErrorImage('include_once('.dirname(__FILE__).'/phpthumb.bmp.php) failed');
+            }
+            ob_end_clean();
+            if ($fp = @fopen($this->sourceFilename, 'rb')) {
+              $this->rawImageData = '';
+              while (!feof($fp)) {
+                $this->rawImageData .= fread($fp, 32768);
+              }
+              fclose($fp);
+            }
+            $phpthumb_bmp = new phpthumb_bmp();
+            if ($this->gdimg_source = $phpthumb_bmp->phpthumb_bmp2gd($this->rawImageData, (phpthumb_functions::gd_version() >= 2.0))) {
+              $this->DebugMessage('$phpthumb_bmp->phpthumb_bmp2gd() succeeded', __FILE__, __LINE__);
+              break;
+            }
+            return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on BMP source conversion' : 'phpthumb_bmp2gd() failed');
+            break;
+        //}
+        //switch (substr($this->rawImageData, 0, 4)) {
+        //  case 'II'."\x2A\x00":
+        //  case 'MM'."\x00\x2A":
+          case 7:
+          case 8:
+            return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on TIFF source conversion' : 'ImageMagick is unavailable and phpThumb() does not support TIFF source images without it');
+            break;
+
+          //case "\xD7\xCD\xC6\x9A":
+          //  return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on WMF source conversion' : 'ImageMagick is unavailable and phpThumb() does not support WMF source images without it');
+          //  break;
+        }
+
+        if (!$this->gdimg_source) {
+          $HeaderFourBytes = '';
+          if ($fp = @fopen($this->sourceFilename, 'rb')) {
+            $HeaderFourBytes = fread($fp, 4);
+            fclose($fp);
+          }
+          if ($HeaderFourBytes == "\xD7\xCD\xC6\x9A") {
+            return $this->ErrorImage($this->ImageMagickVersion() ? 'ImageMagick failed on WMF source conversion' : 'ImageMagick is unavailable and phpThumb() does not support WMF source images without it');
+          }
+          return $this->ErrorImage('Unknown image type identified by "'.substr($HeaderFourBytes, 0, 4).'" ('.phpthumb_functions::HexCharDisplay(substr($HeaderFourBytes, 0, 4)).') in SourceImageToGD()['.__LINE__.']');
+        }
+
+      }
+    }
+
+    if (!$this->gdimg_source) {
+      if ($gdimg_exif_temp = $this->ImageCreateFromStringReplacement($this->exif_thumbnail_data, false)) {
+        $this->DebugMessage('All other attempts failed, but successfully using EXIF thumbnail as source image', __FILE__, __LINE__);
+        $this->gdimg_source   = $gdimg_exif_temp;
+        // override allow-enlarging setting if EXIF thumbnail is the only source available
+        // otherwise thumbnails larger than the EXIF thumbnail will be created at EXIF size
+        $this->aoe = true;
+        return true;
+      }
+      return false;
+    }
+
+    $this->source_width  = ImageSX($this->gdimg_source);
+    $this->source_height = ImageSY($this->gdimg_source);
+    return true;
+  }
+
+
+  function phpThumbDebugVarDump($var) {
+    if (is_null($var)) {
+      return 'NULL';
+    } elseif (is_bool($var)) {
+      return ($var ? 'TRUE' : 'FALSE');
+    } elseif (is_string($var)) {
+      return 'string('.strlen($var).')'.str_repeat(' ', max(0, 3 - strlen(strlen($var)))).' "'.$var.'"';
+    } elseif (is_int($var)) {
+      return 'integer     '.$var;
+    } elseif (is_float($var)) {
+      return 'float       '.$var;
+    } elseif (is_array($var)) {
+      ob_start();
+      var_dump($var);
+      $vardumpoutput = ob_get_contents();
+      ob_end_clean();
+      return strtr($vardumpoutput, "\n\r\t", '   ');
+    }
+    return gettype($var);
+  }
+
+  function phpThumbDebug() {
+    if ($this->config_disable_debug) {
+      return $this->ErrorImage('phpThumbDebug disabled');
+    }
+
+    $FunctionsExistance  = array('exif_thumbnail', 'gd_info', 'image_type_to_mime_type', 'ImageCopyResampled', 'ImageCopyResized', 'ImageCreate', 'ImageCreateFromString', 'ImageCreateTrueColor', 'ImageIsTrueColor', 'ImageRotate', 'ImageTypes', 'version_compare', 'ImageCreateFromGIF', 'ImageCreateFromJPEG', 'ImageCreateFromPNG', 'ImageCreateFromWBMP', 'ImageCreateFromXBM', 'ImageCreateFromXPM', 'ImageCreateFromString', 'ImageCreateFromGD', 'ImageCreateFromGD2', 'ImageCreateFromGD2Part', 'ImageJPEG', 'ImageGIF', 'ImagePNG', 'ImageWBMP');
+    $ParameterNames      = array('src', 'new', 'w', 'h', 'f', 'q', 'sx', 'sy', 'sw', 'sh', 'far', 'bg', 'bc', 'file', 'goto', 'err', 'xto', 'ra', 'ar', 'aoe', 'iar', 'maxb');
+    $ConfigVariableNames = array('document_root', 'temp_directory', 'output_format', 'output_maxwidth', 'output_maxheight', 'error_message_image_default', 'error_bgcolor', 'error_textcolor', 'error_fontsize', 'error_die_on_error', 'error_silent_die_on_error', 'error_die_on_source_failure', 'nohotlink_enabled', 'nohotlink_valid_domains', 'nohotlink_erase_image', 'nohotlink_text_message', 'nooffsitelink_enabled', 'nooffsitelink_valid_domains', 'nooffsitelink_require_refer', 'nooffsitelink_erase_image', 'nooffsitelink_text_message', 'high_security_enabled', 'allow_src_above_docroot', 'allow_src_above_phpthumb', 'allow_parameter_file', 'allow_parameter_goto', 'max_source_pixels', 'use_exif_thumbnail_for_speed', 'border_hexcolor', 'background_hexcolor', 'ttf_directory', 'disable_pathinfo_parsing', 'disable_imagecopyresampled');
+    $OtherVariableNames  = array('phpThumbDebug', 'thumbnailQuality', 'thumbnailFormat', 'gdimg_output', 'gdimg_source', 'sourceFilename', 'source_width', 'source_height', 'thumbnailCropX', 'thumbnailCropY', 'thumbnailCropW', 'thumbnailCropH', 'exif_thumbnail_width', 'exif_thumbnail_height', 'exif_thumbnail_type', 'thumbnail_width', 'thumbnail_height', 'thumbnail_image_width', 'thumbnail_image_height');
+
+    $DebugOutput = array();
+    $DebugOutput[] = 'phpThumb() version          = '.$this->phpthumb_version;
+    $DebugOutput[] = 'phpversion()                = '. at phpversion();
+    $DebugOutput[] = 'PHP_OS                      = '.PHP_OS;
+    $DebugOutput[] = '__FILE__                    = '.__FILE__;
+    $DebugOutput[] = 'realpath(.)                 = '. at realpath('.');
+    $DebugOutput[] = '$_SERVER[PHP_SELF]          = '.@$_SERVER['PHP_SELF'];
+    $DebugOutput[] = '$_SERVER[HOST_NAME]         = '.@$_SERVER['HOST_NAME'];
+    $DebugOutput[] = '$_SERVER[HTTP_REFERER]      = '.@$_SERVER['HTTP_REFERER'];
+    $DebugOutput[] = '$_SERVER[QUERY_STRING]      = '.@$_SERVER['QUERY_STRING'];
+    $DebugOutput[] = '$_SERVER[PATH_INFO]         = '.@$_SERVER['PATH_INFO'];
+    $DebugOutput[] = '$_SERVER[DOCUMENT_ROOT]     = '.@$_SERVER['DOCUMENT_ROOT'];
+    $DebugOutput[] = 'getenv(DOCUMENT_ROOT)       = '. at getenv('DOCUMENT_ROOT');
+    $DebugOutput[] = '';
+
+    $DebugOutput[] = 'get_magic_quotes_gpc()      = '.$this->phpThumbDebugVarDump(@get_magic_quotes_gpc());
+    $DebugOutput[] = 'get_magic_quotes_runtime()  = '.$this->phpThumbDebugVarDump(@get_magic_quotes_runtime());
+    $DebugOutput[] = 'error_reporting()           = '.$this->phpThumbDebugVarDump(error_reporting());
+    $DebugOutput[] = 'ini_get(error_reporting)    = '.$this->phpThumbDebugVarDump(@ini_get('error_reporting'));
+    $DebugOutput[] = 'ini_get(display_errors)     = '.$this->phpThumbDebugVarDump(@ini_get('display_errors'));
+    $DebugOutput[] = 'ini_get(allow_url_fopen)    = '.$this->phpThumbDebugVarDump(@ini_get('allow_url_fopen'));
+    $DebugOutput[] = 'ini_get(disable_functions)  = '.$this->phpThumbDebugVarDump(@ini_get('disable_functions'));
+    $DebugOutput[] = 'ini_get(safe_mode)          = '.$this->phpThumbDebugVarDump(@ini_get('safe_mode'));
+    $DebugOutput[] = 'ini_get(open_basedir)       = '.$this->phpThumbDebugVarDump(@ini_get('open_basedir'));
+    $DebugOutput[] = 'ini_get(memory_limit)       = '.$this->phpThumbDebugVarDump(@ini_get('memory_limit'));
+    $DebugOutput[] = 'ini_get(max_execution_time) = '.$this->phpThumbDebugVarDump(@ini_get('max_execution_time'));
+    $DebugOutput[] = 'get_cfg_var(memory_limit)   = '.$this->phpThumbDebugVarDump(@get_cfg_var('memory_limit'));
+    $DebugOutput[] = 'memory_get_usage()          = '.(function_exists('memory_get_usage') ? $this->phpThumbDebugVarDump(@memory_get_usage()) : 'n/a');
+    $DebugOutput[] = '';
+
+    $DebugOutput[] = '$this->config_prefer_imagemagick            = '.$this->phpThumbDebugVarDump($this->config_prefer_imagemagick);
+    $DebugOutput[] = '$this->config_imagemagick_path              = '.$this->phpThumbDebugVarDump($this->config_imagemagick_path);
+    $DebugOutput[] = '$this->ImageMagickWhichConvert()            = '.$this->ImageMagickWhichConvert();
+    $IMpathUsed = ($this->config_imagemagick_path ? $this->config_imagemagick_path : $this->ImageMagickWhichConvert());
+    $DebugOutput[] = '[actual ImageMagick path used]              = '.$this->phpThumbDebugVarDump($IMpathUsed);
+    $DebugOutput[] = 'file_exists([actual ImageMagick path used]) = '.$this->phpThumbDebugVarDump(@file_exists($IMpathUsed));
+    $DebugOutput[] = 'ImageMagickVersion(false)                   = '.$this->ImageMagickVersion(false);
+    $DebugOutput[] = 'ImageMagickVersion(true)                    = '.$this->ImageMagickVersion(true);
+    $DebugOutput[] = '';
+
+    $DebugOutput[] = '$this->config_cache_directory               = '.$this->phpThumbDebugVarDump($this->config_cache_directory);
+    $DebugOutput[] = '$this->config_cache_disable_warning         = '.$this->phpThumbDebugVarDump($this->config_cache_disable_warning);
+    $DebugOutput[] = '$this->config_cache_maxage                  = '.$this->phpThumbDebugVarDump($this->config_cache_maxage);
+    $DebugOutput[] = '$this->config_cache_maxsize                 = '.$this->phpThumbDebugVarDump($this->config_cache_maxsize);
+    $DebugOutput[] = '$this->config_cache_maxfiles                = '.$this->phpThumbDebugVarDump($this->config_cache_maxfiles);
+    $DebugOutput[] = '$this->config_cache_force_passthru          = '.$this->phpThumbDebugVarDump($this->config_cache_force_passthru);
+    $DebugOutput[] = '$this->cache_filename                       = '.$this->phpThumbDebugVarDump($this->cache_filename);
+    $DebugOutput[] = 'is_readable($this->config_cache_directory)  = '.$this->phpThumbDebugVarDump(@is_readable($this->config_cache_directory));
+    $DebugOutput[] = 'is_writable($this->config_cache_directory)  = '.$this->phpThumbDebugVarDump(@is_writable($this->config_cache_directory));
+    $DebugOutput[] = 'is_readable($this->cache_filename)          = '.$this->phpThumbDebugVarDump(@is_readable($this->cache_filename));
+    $DebugOutput[] = 'is_writable($this->cache_filename)          = '.(@file_exists($this->cache_filename) ? $this->phpThumbDebugVarDump(@is_writable($this->cache_filename)) : 'n/a');
+    $DebugOutput[] = '';
+
+    foreach ($ConfigVariableNames as $dummy => $varname) {
+      $varname = 'config_'.$varname;
+      $value = $this->$varname;
+      $DebugOutput[] = '$this->'.str_pad($varname, 37, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value);
+    }
+    $DebugOutput[] = '';
+    foreach ($OtherVariableNames as $dummy => $varname) {
+      $value = $this->$varname;
+      $DebugOutput[] = '$this->'.str_pad($varname, 27, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value);
+    }
+    $DebugOutput[] = 'strlen($this->rawImageData)        = '.strlen(@$this->rawImageData);
+    $DebugOutput[] = 'strlen($this->exif_thumbnail_data) = '.strlen(@$this->exif_thumbnail_data);
+    $DebugOutput[] = '';
+
+    foreach ($ParameterNames as $dummy => $varname) {
+      $value = $this->$varname;
+      $DebugOutput[] = '$this->'.str_pad($varname, 4, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value);
+    }
+    $DebugOutput[] = '';
+
+    foreach ($FunctionsExistance as $dummy => $functionname) {
+      $DebugOutput[] = 'builtin_function_exists('.$functionname.')'.str_repeat(' ', 23 - strlen($functionname)).' = '.$this->phpThumbDebugVarDump(phpthumb_functions::builtin_function_exists($functionname));
+    }
+    $DebugOutput[] = '';
+
+    $gd_info = gd_info();
+    foreach ($gd_info as $key => $value) {
+      $DebugOutput[] = 'gd_info.'.str_pad($key, 34, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value);
+    }
+    $DebugOutput[] = '';
+
+    $exif_info = phpthumb_functions::exif_info();
+    foreach ($exif_info as $key => $value) {
+      $DebugOutput[] = 'exif_info.'.str_pad($key, 26, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value);
+    }
+    $DebugOutput[] = '';
+
+    if ($ApacheLookupURIarray = phpthumb_functions::ApacheLookupURIarray(dirname(@$_SERVER['PHP_SELF']))) {
+      foreach ($ApacheLookupURIarray as $key => $value) {
+        $DebugOutput[] = 'ApacheLookupURIarray.'.str_pad($key, 15, ' ', STR_PAD_RIGHT).' = '.$this->phpThumbDebugVarDump($value);
+      }
+    } else {
+        $DebugOutput[] = 'ApacheLookupURIarray() -- FAILED';
+    }
+    $DebugOutput[] = '';
+
+    if (isset($_GET) && is_array($_GET)) {
+      foreach ($_GET as $key => $value) {
+        $DebugOutput[] = '$_GET['.$key.']'.str_repeat(' ', 30 - strlen($key)).'= '.$this->phpThumbDebugVarDump($value);
+      }
+    }
+    if (isset($_POST) && is_array($_POST)) {
+      foreach ($_POST as $key => $value) {
+        $DebugOutput[] = '$_POST['.$key.']'.str_repeat(' ', 29 - strlen($key)).'= '.$this->phpThumbDebugVarDump($value);
+      }
+    }
+    $DebugOutput[] = '';
+
+    $DebugOutput[] = '$this->debugmessages:';
+    foreach ($this->debugmessages as $dummy => $errorstring) {
+      $DebugOutput[] = '  * '.$errorstring;
+    }
+    $DebugOutput[] = '';
+
+    $DebugOutput[] = '$this->debugtiming:';
+    foreach ($this->debugtiming as $timestamp => $timingstring) {
+      $DebugOutput[] = '  * '.$timestamp.' '.$timingstring;
+    }
+    $DebugOutput[] = '  * Total processing time: '.number_format(max(array_keys($this->debugtiming)) - min(array_keys($this->debugtiming)), 6);
+
+    return $this->ErrorImage(implode("\n", $DebugOutput), 700, 500, true);
+  }
+
+  function ErrorImage($text, $width=0, $height=0, $forcedisplay=false) {
+    $width  = ($width  ? $width  : $this->config_error_image_width);
+    $height = ($height ? $height : $this->config_error_image_height);
+
+    $text = 'phpThumb() v'.$this->phpthumb_version."\n\n".$text;
+    if ($this->config_disable_debug) {
+      $text = 'Error messages disabled';
+    }
+
+    $this->DebugMessage($text, __FILE__, __LINE__);
+    if ($this->phpThumbDebug && !$forcedisplay) {
+      return false;
+    }
+    if (!$this->config_error_die_on_error && !$forcedisplay) {
+      $this->fatalerror = $text;
+      return false;
+    }
+    if ($this->config_error_silent_die_on_error) {
+      exit;
+    }
+    if ($this->err || $this->config_error_message_image_default) {
+      // Show generic custom error image instead of error message
+      // for use on production sites where you don't want debug messages
+      if ($this->err == 'showerror') {
+        // fall through and actually show error message even if default error image is set
+      } else {
+        header('Location: '.($this->err ? $this->err : $this->config_error_message_image_default));
+        exit;
+      }
+    }
+    $this->setOutputFormat();
+    if (!$this->thumbnailFormat || (phpthumb_functions::gd_version() < 1)) {
+      $this->thumbnailFormat = 'text';
+    }
+    if (@$this->thumbnailFormat == 'text') {
+      // bypass all GD functions and output text error message
+      die('<pre>'.$text.'</pre>');
+    }
+
+    $FontWidth  = ImageFontWidth($this->config_error_fontsize);
+    $FontHeight = ImageFontHeight($this->config_error_fontsize);
+
+    $LinesOfText = explode("\n", @wordwrap($text, floor($width / $FontWidth), "\n", true));
+    $height = max($height, count($LinesOfText) * $FontHeight);
+
+    $headers_file = '';
+    $headers_line = '';
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=') && headers_sent($headers_file, $headers_line)) {
+
+      echo "\n".'**Headers already sent in file "'.$headers_file.'" on line "'.$headers_line.'", dumping error message as text:**<br><pre>'."\n\n".$text."\n".'</pre>';
+
+    } elseif (headers_sent()) {
+
+      echo "\n".'**Headers already sent, dumping error message as text:**<br><pre>'."\n\n".$text."\n".'</pre>';
+
+    } elseif ($gdimg_error = ImageCreate($width, $height)) {
+
+      $background_color = phpthumb_functions::ImageHexColorAllocate($gdimg_error, $this->config_error_bgcolor,   true);
+      $text_color       = phpthumb_functions::ImageHexColorAllocate($gdimg_error, $this->config_error_textcolor, true);
+      ImageFilledRectangle($gdimg_error, 0, 0, $width, $height, $background_color);
+      $lineYoffset = 0;
+      foreach ($LinesOfText as $dummy => $line) {
+        ImageString($gdimg_error, $this->config_error_fontsize, 2, $lineYoffset, $line, $text_color);
+        $lineYoffset += $FontHeight;
+      }
+      if (function_exists('ImageTypes')) {
+        $imagetypes = ImageTypes();
+        if ($imagetypes & IMG_PNG) {
+          header('Content-Type: image/png');
+          ImagePNG($gdimg_error);
+        } elseif ($imagetypes & IMG_GIF) {
+          header('Content-Type: image/gif');
+          ImageGIF($gdimg_error);
+        } elseif ($imagetypes & IMG_JPG) {
+          header('Content-Type: image/jpeg');
+          ImageJPEG($gdimg_error);
+        } elseif ($imagetypes & IMG_WBMP) {
+          header('Content-Type: image/wbmp');
+          ImageWBMP($gdimg_error);
+        }
+      }
+      ImageDestroy($gdimg_error);
+
+    }
+    if (!headers_sent()) {
+      echo "\n".'**Failed to send graphical error image, dumping error message as text:**<br>'."\n\n".$text;
+    }
+    exit;
+    return true;
+  }
+
+  function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors=false) {
+    // there are serious bugs in the non-bundled versions of GD which may cause
+    // PHP to segfault when calling ImageCreateFromString() - avoid if at all possible
+    // when not using a bundled version of GD2
+    if (phpthumb_functions::gd_is_bundled()) {
+      return @ImageCreateFromString($RawImageData);
+    }
+    if (ini_get('safe_mode')) {
+      $this->DebugMessage('ImageCreateFromStringReplacement() failed: cannot create temp file in SAFE_MODE', __FILE__, __LINE__);
+      return false;
+    }
+
+    switch (substr($RawImageData, 0, 3)) {
+      case 'GIF':
+        $ICFSreplacementFunctionName = 'ImageCreateFromGIF';
+        break;
+      case "\xFF\xD8\xFF":
+        $ICFSreplacementFunctionName = 'ImageCreateFromJPEG';
+        break;
+      case "\x89".'PN':
+        $ICFSreplacementFunctionName = 'ImageCreateFromPNG';
+        break;
+      default:
+        $this->DebugMessage('ImageCreateFromStringReplacement() failed: unknown fileformat signature "'.phpthumb_functions::HexCharDisplay(substr($RawImageData, 0, 3)).'"', __FILE__, __LINE__);
+        return false;
+        break;
+    }
+    if ($tempnam = $this->phpThumb_tempnam()) {
+      if ($fp_tempnam = @fopen($tempnam, 'wb')) {
+        fwrite($fp_tempnam, $RawImageData);
+        fclose($fp_tempnam);
+        if (($ICFSreplacementFunctionName == 'ImageCreateFromGIF') && !function_exists($ICFSreplacementFunctionName)) {
+
+          // Need to create from GIF file, but ImageCreateFromGIF does not exist
+          ob_start();
+          if (!@include_once(dirname(__FILE__).'/phpthumb.gif.php')) {
+            $ErrorMessage = 'Failed to include required file "'.dirname(__FILE__).'/phpthumb.gif.php" in '.__FILE__.' on line '.__LINE__;
+            $this->DebugMessage($ErrorMessage, __FILE__, __LINE__);
+          }
+          ob_end_clean();
+          // gif_loadFileToGDimageResource() cannot read from raw data, write to file first
+          if ($tempfilename = $this->phpThumb_tempnam()) {
+            if ($fp_tempfile = @fopen($tempfilename, 'wb')) {
+              fwrite($fp_tempfile, $RawImageData);
+              fclose($fp_tempfile);
+              $gdimg_source = gif_loadFileToGDimageResource($tempfilename);
+              $this->DebugMessage('gif_loadFileToGDimageResource('.$tempfilename.') completed', __FILE__, __LINE__);
+              unlink($tempfilename);
+              return $gdimg_source;
+              break;
+            } else {
+              $ErrorMessage = 'Failed to open tempfile in '.__FILE__.' on line '.__LINE__;
+              $this->DebugMessage($ErrorMessage, __FILE__, __LINE__);
+            }
+          } else {
+            $ErrorMessage = 'Failed to open generate tempfile name in '.__FILE__.' on line '.__LINE__;
+            $this->DebugMessage($ErrorMessage, __FILE__, __LINE__);
+          }
+
+        } elseif (function_exists($ICFSreplacementFunctionName) && ($gdimg_source = @$ICFSreplacementFunctionName($tempnam))) {
+
+          // great
+          $this->DebugMessage($ICFSreplacementFunctionName.'('.$tempnam.') succeeded', __FILE__, __LINE__);
+          unlink($tempnam);
+          return $gdimg_source;
+
+        } else { // GD functions not available
+
+          if (isset($_GET['phpThumbDebug'])) {
+            $this->phpThumbDebug();
+          } elseif (!headers_sent()) {
+            // base64-encoded error image in GIF format
+            $ERROR_NOGD = 'R0lGODlhIAAgALMAAAAAABQUFCQkJDY2NkZGRldXV2ZmZnJycoaGhpSUlKWlpbe3t8XFxdXV1eTk5P7+/iwAAAAAIAAgAAAE/vDJSau9WILtTAACUinDNijZtAHfCojS4W5H+qxD8xibIDE9h0OwWaRWDIljJSkUJYsN4bihMB8th3IToAKs1VtYM75cyV8sZ8vygtOE5yMKmGbO4jRdICQCjHdlZzwzNW4qZSQmKDaNjhUMBX4BBAlmMywFSRWEmAI6b5gAlhNxokGhooAIK5o/pi9vEw4Lfj4OLTAUpj6IabMtCwlSFw0DCKBoFqwAB04AjI54PyZ+yY3TD0ss2YcVmN/gvpcu4TOyFivWqYJlbAHPpOntvxNAACcmGHjZzAZqzSzcq5fNjxFmAFw9iFRunD1epU6tsIPmFCAJnWYE0FURk7wJDA0MTKpEzoWAAskiAAA7';
+            header('Content-Type: image/gif');
+            echo base64_decode($ERROR_NOGD);
+          } else {
+            echo '*** ERROR: No PHP-GD support available ***';
+          }
+          exit;
+
+        }
+      } else {
+        $ErrorMessage = 'Failed to fopen('.$tempnam.', "wb") in '.__FILE__.' on line '.__LINE__."\n".'You may need to set $PHPTHUMB_CONFIG[temp_directory] in phpThumb.config.php';
+        $this->DebugMessage($ErrorMessage, __FILE__, __LINE__);
+      }
+      @unlink($tempnam);
+    } else {
+      $ErrorMessage = 'Failed to generate phpThumb_tempnam() in '.__FILE__.' on line '.__LINE__."\n".'You may need to set $PHPTHUMB_CONFIG[temp_directory] in phpThumb.config.php';
+    }
+    if ($DieOnErrors && $ErrorMessage) {
+      return $this->ErrorImage($ErrorMessage);
+    }
+    return false;
+  }
+
+  function ImageResizeFunction(&$dst_im, &$src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) {
+    $this->DebugMessage('ImageResizeFunction($o, $s, '.$dstX.', '.$dstY.', '.$srcX.', '.$srcY.', '.$dstW.', '.$dstH.', '.$srcW.', '.$srcH.')', __FILE__, __LINE__);
+    if (phpthumb_functions::gd_version() >= 2.0) {
+      if ($this->config_disable_imagecopyresampled) {
+        return phpthumb_functions::ImageCopyResampleBicubic($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);
+      }
+      return ImageCopyResampled($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);
+    }
+    return ImageCopyResized($dst_im, $src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);
+  }
+
+  function phpThumb_tempnam() {
+    $tempnam = realpath(tempnam($this->config_temp_directory, 'pThumb'));
+    $this->DebugMessage('phpThumb_tempnam() returning "'.$tempnam.'"', __FILE__, __LINE__);
+    return $tempnam;
+  }
+
+  function DebugMessage($message, $file='', $line='') {
+    $this->debugmessages[] = $message.($file ? ' in file "'.(basename($file) ? basename($file) : $file).'"' : '').($line ? ' on line '.$line : '');
+    return true;
+  }
+
+  function DebugTimingMessage($message, $file='', $line='', $timestamp=0) {
+    if (!$timestamp) {
+      $timestamp = array_sum(explode(' ', microtime()));
+    }
+    $this->debugtiming[number_format($timestamp, 6, '.', '')] = ': '.$message.($file ? ' in file "'.(basename($file) ? basename($file) : $file).'"' : '').($line ? ' on line '.$line : '');
+    return true;
+  }
+
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.filters.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.filters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.filters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1266 @@
+<?php
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+// phpthumb.filters.php - image processing filter functions //
+//                                                         ///
+//////////////////////////////////////////////////////////////
+
+class phpthumb_filters {
+
+  var $phpThumbObject = null;
+
+  function phpthumb_filters() {
+    return true;
+  }
+
+  function ApplyMask(&$gdimg_mask, &$gdimg_image) {
+    if (phpthumb_functions::gd_version() < 2) {
+      $this->DebugMessage('Skipping ApplyMask() because gd_version is "'.phpthumb_functions::gd_version().'"', __FILE__, __LINE__);
+      return false;
+    }
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.2', '>=')) {
+
+      $this->DebugMessage('Using alpha ApplyMask() technique', __FILE__, __LINE__);
+      if ($gdimg_mask_resized = phpthumb_functions::ImageCreateFunction(ImageSX($gdimg_image), ImageSY($gdimg_image))) {
+
+        ImageCopyResampled($gdimg_mask_resized, $gdimg_mask, 0, 0, 0, 0, ImageSX($gdimg_image), ImageSY($gdimg_image), ImageSX($gdimg_mask), ImageSY($gdimg_mask));
+        if ($gdimg_mask_blendtemp = phpthumb_functions::ImageCreateFunction(ImageSX($gdimg_image), ImageSY($gdimg_image))) {
+
+          $color_background = ImageColorAllocate($gdimg_mask_blendtemp, 0, 0, 0);
+          ImageFilledRectangle($gdimg_mask_blendtemp, 0, 0, ImageSX($gdimg_mask_blendtemp), ImageSY($gdimg_mask_blendtemp), $color_background);
+          ImageAlphaBlending($gdimg_mask_blendtemp, false);
+          ImageSaveAlpha($gdimg_mask_blendtemp, true);
+          for ($x = 0; $x < ImageSX($gdimg_image); $x++) {
+            for ($y = 0; $y < ImageSY($gdimg_image); $y++) {
+              //$RealPixel = phpthumb_functions::GetPixelColor($gdimg_mask_blendtemp, $x, $y);
+              $RealPixel = phpthumb_functions::GetPixelColor($gdimg_image, $x, $y);
+              $MaskPixel = phpthumb_functions::GrayscalePixel(phpthumb_functions::GetPixelColor($gdimg_mask_resized, $x, $y));
+              $MaskAlpha = 127 - (floor($MaskPixel['red'] / 2) * (1 - ($RealPixel['alpha'] / 127)));
+              $newcolor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg_mask_blendtemp, $RealPixel['red'], $RealPixel['green'], $RealPixel['blue'], $MaskAlpha);
+              ImageSetPixel($gdimg_mask_blendtemp, $x, $y, $newcolor);
+            }
+          }
+          ImageAlphaBlending($gdimg_image, false);
+          ImageSaveAlpha($gdimg_image, true);
+          ImageCopy($gdimg_image, $gdimg_mask_blendtemp, 0, 0, 0, 0, ImageSX($gdimg_mask_blendtemp), ImageSY($gdimg_mask_blendtemp));
+          ImageDestroy($gdimg_mask_blendtemp);
+
+        } else {
+          $this->DebugMessage('ImageCreateFunction() failed', __FILE__, __LINE__);
+        }
+        ImageDestroy($gdimg_mask_resized);
+
+      } else {
+        $this->DebugMessage('ImageCreateFunction() failed', __FILE__, __LINE__);
+      }
+
+    } else {
+      // alpha merging requires PHP v4.3.2+
+      $this->DebugMessage('Skipping ApplyMask() technique because PHP is v"'.phpversion().'"', __FILE__, __LINE__);
+    }
+    return true;
+  }
+
+
+  function Bevel(&$gdimg, $width, $hexcolor1, $hexcolor2) {
+    $width     = ($width     ? $width     : 5);
+    $hexcolor1 = ($hexcolor1 ? $hexcolor1 : 'FFFFFF');
+    $hexcolor2 = ($hexcolor2 ? $hexcolor2 : '000000');
+
+    ImageAlphaBlending($gdimg, true);
+    for ($i = 0; $i < $width; $i++) {
+      $alpha = round(($i / $width) * 127);
+      $color1[$i] = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor1, false, $alpha);
+      $color2[$i] = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor2, false, $alpha);
+
+      ImageLine($gdimg,                   $i,                   $i,                   $i, ImageSY($gdimg) - $i, $color1[$i]); // left
+      ImageLine($gdimg,                   $i,                   $i, ImageSX($gdimg) - $i,                   $i, $color1[$i]); // top
+      ImageLine($gdimg, ImageSX($gdimg) - $i, ImageSY($gdimg) - $i, ImageSX($gdimg) - $i,                   $i, $color2[$i]); // right
+      ImageLine($gdimg, ImageSX($gdimg) - $i, ImageSY($gdimg) - $i,                   $i, ImageSY($gdimg) - $i, $color2[$i]); // bottom
+    }
+    return true;
+  }
+
+
+  function Blur(&$gdimg, $radius=0.5) {
+    // Taken from Torstein Hønsi's phpUnsharpMask (see phpthumb.unsharp.php)
+
+    $radius = round(max(0, min($radius, 50)) * 2);
+    if (!$radius) {
+      return false;
+    }
+
+    $w = ImageSX($gdimg);
+    $h = ImageSY($gdimg);
+    if ($imgBlur = ImageCreateTrueColor($w, $h)) {
+      // Gaussian blur matrix:
+      //  1 2 1
+      //  2 4 2
+      //  1 2 1
+
+      // Move copies of the image around one pixel at the time and merge them with weight
+      // according to the matrix. The same matrix is simply repeated for higher radii.
+      for ($i = 0; $i < $radius; $i++)  {
+        ImageCopy     ($imgBlur, $gdimg, 0, 0, 1, 1, $w - 1, $h - 1);            // up left
+        ImageCopyMerge($imgBlur, $gdimg, 1, 1, 0, 0, $w,     $h,     50.00000);  // down right
+        ImageCopyMerge($imgBlur, $gdimg, 0, 1, 1, 0, $w - 1, $h,     33.33333);  // down left
+        ImageCopyMerge($imgBlur, $gdimg, 1, 0, 0, 1, $w,     $h - 1, 25.00000);  // up right
+        ImageCopyMerge($imgBlur, $gdimg, 0, 0, 1, 0, $w - 1, $h,     33.33333);  // left
+        ImageCopyMerge($imgBlur, $gdimg, 1, 0, 0, 0, $w,     $h,     25.00000);  // right
+        ImageCopyMerge($imgBlur, $gdimg, 0, 0, 0, 1, $w,     $h - 1, 20.00000);  // up
+        ImageCopyMerge($imgBlur, $gdimg, 0, 1, 0, 0, $w,     $h,     16.666667); // down
+        ImageCopyMerge($imgBlur, $gdimg, 0, 0, 0, 0, $w,     $h,     50.000000); // center
+        ImageCopy     ($gdimg, $imgBlur, 0, 0, 0, 0, $w,     $h);
+      }
+      return true;
+    }
+    return false;
+  }
+
+
+  function BlurGaussian(&$gdimg) {
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_GAUSSIAN_BLUR)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_GAUSSIAN_BLUR)', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+    $this->DebugMessage('FAILED: phpthumb_filters::BlurGaussian($gdimg) [using phpthumb_filters::Blur() instead]', __FILE__, __LINE__);
+    return phpthumb_filters::Blur($gdimg, 0.5);
+  }
+
+
+  function BlurSelective(&$gdimg) {
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_SELECTIVE_BLUR)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_SELECTIVE_BLUR)', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+    // currently not implemented "the hard way"
+    $this->DebugMessage('FAILED: phpthumb_filters::BlurSelective($gdimg) [function not implemented]', __FILE__, __LINE__);
+    return false;
+  }
+
+
+  function Brightness(&$gdimg, $amount=0) {
+    if ($amount == 0) {
+      return true;
+    }
+    $amount = max(-255, min(255, $amount));
+
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_BRIGHTNESS, $amount)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_BRIGHTNESS, '.$amount.')', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+
+    $scaling = (255 - abs($amount)) / 255;
+    $baseamount = (($amount > 0) ? $amount : 0);
+    for ($x = 0; $x < ImageSX($gdimg); $x++) {
+      for ($y = 0; $y < ImageSY($gdimg); $y++) {
+        $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        foreach ($OriginalPixel as $key => $value) {
+          $NewPixel[$key] = round($baseamount + ($OriginalPixel[$key] * $scaling));
+        }
+        $newColor = ImageColorAllocate($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue']);
+        ImageSetPixel($gdimg, $x, $y, $newColor);
+      }
+    }
+    return true;
+  }
+
+
+  function Contrast(&$gdimg, $amount=0) {
+    if ($amount == 0) {
+      return true;
+    }
+    $amount = max(-255, min(255, $amount));
+
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_CONTRAST, $amount)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_CONTRAST, '.$amount.')', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+
+    if ($amount > 0) {
+      $scaling = 1 + ($amount / 255);
+    } else {
+      $scaling = (255 - abs($amount)) / 255;
+    }
+    for ($x = 0; $x < ImageSX($gdimg); $x++) {
+      for ($y = 0; $y < ImageSY($gdimg); $y++) {
+        $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        foreach ($OriginalPixel as $key => $value) {
+          $NewPixel[$key] = min(255, max(0, round($OriginalPixel[$key] * $scaling)));
+        }
+        $newColor = ImageColorAllocate($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue']);
+        ImageSetPixel($gdimg, $x, $y, $newColor);
+      }
+    }
+  }
+
+
+  function Colorize(&$gdimg, $amount, $targetColor) {
+    $amount      = (is_numeric($amount)                          ? $amount      : 25);
+    $targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'gray');
+
+    if ($amount == 0) {
+      return true;
+    }
+
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if ($targetColor == 'gray') {
+        $targetColor = '808080';
+      }
+      $r = substr($targetColor, 0, 2);
+      $g = substr($targetColor, 2, 2);
+      $b = substr($targetColor, 4, 2);
+      if (ImageFilter($gdimg, IMG_FILTER_COLORIZE, $r, $g, $b)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_COLORIZE)', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+
+    // overridden below for grayscale
+    if ($targetColor != 'gray') {
+      $TargetPixel['red']   = hexdec(substr($targetColor, 0, 2));
+      $TargetPixel['green'] = hexdec(substr($targetColor, 2, 2));
+      $TargetPixel['blue']  = hexdec(substr($targetColor, 4, 2));
+    }
+
+    for ($x = 0; $x < ImageSX($gdimg); $x++) {
+      for ($y = 0; $y < ImageSY($gdimg); $y++) {
+        $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        if ($targetColor == 'gray') {
+          $TargetPixel = phpthumb_functions::GrayscalePixel($OriginalPixel);
+        }
+        foreach ($TargetPixel as $key => $value) {
+          $NewPixel[$key] = round(max(0, min(255, ($OriginalPixel[$key] * ((100 - $amount) / 100)) + ($TargetPixel[$key] * ($amount / 100)))));
+        }
+        //$newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue'], $OriginalPixel['alpha']);
+        $newColor = ImageColorAllocate($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue']);
+        ImageSetPixel($gdimg, $x, $y, $newColor);
+      }
+    }
+    return true;
+  }
+
+
+  function Crop(&$gdimg, $left=0, $right=0, $top=0, $bottom=0) {
+    if (!$left && !$right && !$top && !$bottom) {
+      return true;
+    }
+    $oldW = ImageSX($gdimg);
+    $oldH = ImageSY($gdimg);
+    if (($left   > 0) && ($left   < 1)) { $left   = round($left   * $oldW); }
+    if (($right  > 0) && ($right  < 1)) { $right  = round($right  * $oldW); }
+    if (($top    > 0) && ($top    < 1)) { $top    = round($top    * $oldH); }
+    if (($bottom > 0) && ($bottom < 1)) { $bottom = round($bottom * $oldH); }
+    $right  = min($oldW - $left - 1, $right);
+    $bottom = min($oldH - $top  - 1, $bottom);
+    $newW = $oldW - $left - $right;
+    $newH = $oldH - $top  - $bottom;
+
+    if ($imgCropped = ImageCreateTrueColor($newW, $newH)) {
+      ImageCopy($imgCropped, $gdimg, 0, 0, $left, $top, $newW, $newH);
+      if ($gdimg = ImageCreateTrueColor($newW, $newH)) {
+        ImageCopy($gdimg, $imgCropped, 0, 0, 0, 0, $newW, $newH);
+        ImageDestroy($imgCropped);
+        return true;
+      }
+      ImageDestroy($imgCropped);
+    }
+    return false;
+  }
+
+
+  function Desaturate(&$gdimg, $amount, $color='') {
+    if ($amount == 0) {
+      return true;
+    }
+    return phpthumb_filters::Colorize($gdimg, $amount, (phpthumb_functions::IsHexColor($color) ? $color : 'gray'));
+  }
+
+
+  function DropShadow(&$gdimg, $distance, $width, $hexcolor, $angle, $fade) {
+    if (phpthumb_functions::gd_version() < 2) {
+      return false;
+    }
+    $distance = ($distance ? $distance : 10);
+    $width    = ($width    ? $width    : 10);
+    $hexcolor = ($hexcolor ? $hexcolor : '000000');
+    $angle    = ($angle    ? $angle    : 225);
+    $fade     = ($fade     ? $fade     : 1);
+
+    $width_shadow  = cos(deg2rad($angle)) * ($distance + $width);
+    $height_shadow = sin(deg2rad($angle)) * ($distance + $width);
+
+    $scaling = min(ImageSX($gdimg) / (ImageSX($gdimg) + abs($width_shadow)), ImageSY($gdimg) / (ImageSY($gdimg) + abs($height_shadow)));
+
+    for ($i = 0; $i < $width; $i++) {
+      $WidthAlpha[$i] = (abs(($width / 2) - $i) / $width) * $fade;
+      $Offset['x'] = cos(deg2rad($angle)) * ($distance + $i);
+      $Offset['y'] = sin(deg2rad($angle)) * ($distance + $i);
+    }
+
+    $tempImageWidth  = ImageSX($gdimg)  + abs($Offset['x']);
+    $tempImageHeight = ImageSY($gdimg) + abs($Offset['y']);
+
+    if ($gdimg_dropshadow_temp = phpthumb_functions::ImageCreateFunction($tempImageWidth, $tempImageHeight)) {
+
+      ImageAlphaBlending($gdimg_dropshadow_temp, false);
+      ImageSaveAlpha($gdimg_dropshadow_temp, true);
+      $transparent1 = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg_dropshadow_temp, 0, 0, 0, 127);
+      ImageFill($gdimg_dropshadow_temp, 0, 0, $transparent1);
+
+      for ($x = 0; $x < ImageSX($gdimg); $x++) {
+        for ($y = 0; $y < ImageSY($gdimg); $y++) {
+          $PixelMap[$x][$y] = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        }
+      }
+      for ($x = 0; $x < $tempImageWidth; $x++) {
+        for ($y = 0; $y < $tempImageHeight; $y++) {
+          //for ($i = 0; $i < $width; $i++) {
+          for ($i = 0; $i < 1; $i++) {
+            if (!isset($PixelMap[$x][$y]['alpha']) || ($PixelMap[$x][$y]['alpha'] > 0)) {
+              if (isset($PixelMap[$x + $Offset['x']][$y + $Offset['y']]['alpha']) && ($PixelMap[$x + $Offset['x']][$y + $Offset['y']]['alpha'] < 127)) {
+                $thisColor = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor, false, $PixelMap[$x + $Offset['x']][$y + $Offset['y']]['alpha']);
+                ImageSetPixel($gdimg_dropshadow_temp, $x, $y, $thisColor);
+              }
+            }
+          }
+        }
+      }
+
+      ImageAlphaBlending($gdimg_dropshadow_temp, true);
+      for ($x = 0; $x < ImageSX($gdimg); $x++) {
+        for ($y = 0; $y < ImageSY($gdimg); $y++) {
+          if ($PixelMap[$x][$y]['alpha'] < 127) {
+            $thisColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg_dropshadow_temp, $PixelMap[$x][$y]['red'], $PixelMap[$x][$y]['green'], $PixelMap[$x][$y]['blue'], $PixelMap[$x][$y]['alpha']);
+            ImageSetPixel($gdimg_dropshadow_temp, $x, $y, $thisColor);
+          }
+        }
+      }
+
+      ImageSaveAlpha($gdimg, true);
+      ImageAlphaBlending($gdimg, false);
+      //$this->is_alpha = true;
+      $transparent2 = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, 0, 0, 0, 127);
+      ImageFilledRectangle($gdimg, 0, 0, ImageSX($gdimg), ImageSY($gdimg), $transparent2);
+      ImageCopyResampled($gdimg, $gdimg_dropshadow_temp, 0, 0, 0, 0, ImageSX($gdimg), ImageSY($gdimg), ImageSX($gdimg_dropshadow_temp), ImageSY($gdimg_dropshadow_temp));
+
+      ImageDestroy($gdimg_dropshadow_temp);
+    }
+    return true;
+  }
+
+
+  function EdgeDetect(&$gdimg) {
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_EDGEDETECT)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_EDGEDETECT)', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+    // currently not implemented "the hard way"
+    $this->DebugMessage('FAILED: phpthumb_filters::EdgeDetect($gdimg) [function not implemented]', __FILE__, __LINE__);
+    return false;
+  }
+
+
+  function Elipse($gdimg) {
+    if (phpthumb_functions::gd_version() < 2) {
+      return false;
+    }
+    // generate mask at twice desired resolution and downsample afterwards for easy antialiasing
+    if ($gdimg_elipsemask_double = phpthumb_functions::ImageCreateFunction(ImageSX($gdimg) * 2, ImageSY($gdimg) * 2)) {
+      if ($gdimg_elipsemask = phpthumb_functions::ImageCreateFunction(ImageSX($gdimg), ImageSY($gdimg))) {
+
+        $color_transparent = ImageColorAllocate($gdimg_elipsemask_double, 255, 255, 255);
+        ImageFilledEllipse($gdimg_elipsemask_double, ImageSX($gdimg), ImageSY($gdimg), (ImageSX($gdimg) - 1) * 2, (ImageSY($gdimg) - 1) * 2, $color_transparent);
+        ImageCopyResampled($gdimg_elipsemask, $gdimg_elipsemask_double, 0, 0, 0, 0, ImageSX($gdimg), ImageSY($gdimg), ImageSX($gdimg) * 2, ImageSY($gdimg) * 2);
+
+        phpthumb_filters::ApplyMask($gdimg_elipsemask, $gdimg);
+        ImageDestroy($gdimg_elipsemask);
+        return true;
+
+      } else {
+        $this->DebugMessage('$gdimg_elipsemask = phpthumb_functions::ImageCreateFunction() failed', __FILE__, __LINE__);
+      }
+      ImageDestroy($gdimg_elipsemask_double);
+    } else {
+      $this->DebugMessage('$gdimg_elipsemask_double = phpthumb_functions::ImageCreateFunction() failed', __FILE__, __LINE__);
+    }
+    return false;
+  }
+
+
+  function Emboss(&$gdimg) {
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_EMBOSS)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_EMBOSS)', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+    // currently not implemented "the hard way"
+    $this->DebugMessage('FAILED: phpthumb_filters::Emboss($gdimg) [function not implemented]', __FILE__, __LINE__);
+    return false;
+  }
+
+
+  function Flip(&$gdimg, $x=false, $y=false) {
+    if (!$x && !$y) {
+      return false;
+    }
+    if ($tempImage = phpthumb_functions::ImageCreateFunction(ImageSX($gdimg), ImageSY($gdimg))) {
+      if ($x) {
+        ImageCopy($tempImage, $gdimg, 0, 0, 0, 0, ImageSX($gdimg), ImageSY($gdimg));
+        for ($x = 0; $x < ImageSX($gdimg); $x++) {
+          ImageCopy($gdimg, $tempImage, ImageSX($gdimg) - 1 - $x, 0, $x, 0, 1, ImageSY($gdimg));
+        }
+      }
+      if ($y) {
+        ImageCopy($tempImage, $gdimg, 0, 0, 0, 0, ImageSX($gdimg), ImageSY($gdimg));
+        for ($y = 0; $y < ImageSY($gdimg); $y++) {
+          ImageCopy($gdimg, $tempImage, 0, ImageSY($gdimg) - 1 - $y, 0, $y, ImageSX($gdimg), 1);
+        }
+      }
+      ImageDestroy($tempImage);
+    }
+    return true;
+  }
+
+
+  function Frame(&$gdimg, $frame_width, $edge_width, $hexcolor_frame, $hexcolor1, $hexcolor2) {
+    $frame_width    = ($frame_width    ? $frame_width    : 5);
+    $edge_width     = ($edge_width     ? $edge_width     : 1);
+    $hexcolor_frame = ($hexcolor_frame ? $hexcolor_frame : 'CCCCCC');
+    $hexcolor1      = ($hexcolor1      ? $hexcolor1      : 'FFFFFF');
+    $hexcolor2      = ($hexcolor2      ? $hexcolor2      : '000000');
+
+    $color_frame = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor_frame);
+    $color1      = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor1);
+    $color2      = phpthumb_functions::ImageHexColorAllocate($gdimg, $hexcolor2);
+    for ($i = 0; $i < $edge_width; $i++) {
+      // outer bevel
+      ImageLine($gdimg,                   $i,                   $i,                   $i, ImageSY($gdimg) - $i, $color1); // left
+      ImageLine($gdimg,                   $i,                   $i, ImageSX($gdimg) - $i,                   $i, $color1); // top
+      ImageLine($gdimg, ImageSX($gdimg) - $i, ImageSY($gdimg) - $i, ImageSX($gdimg) - $i,                   $i, $color2); // right
+      ImageLine($gdimg, ImageSX($gdimg) - $i, ImageSY($gdimg) - $i,                   $i, ImageSY($gdimg) - $i, $color2); // bottom
+    }
+    for ($i = 0; $i < $frame_width; $i++) {
+      // actual frame
+      ImageRectangle($gdimg, $edge_width + $i, $edge_width + $i, ImageSX($gdimg) - $edge_width - $i, ImageSY($gdimg) - $edge_width - $i, $color_frame);
+    }
+    for ($i = 0; $i < $edge_width; $i++) {
+      // inner bevel
+      ImageLine($gdimg,                   $frame_width + $edge_width + $i,                   $frame_width + $edge_width + $i,                   $frame_width + $edge_width + $i, ImageSY($gdimg) - $frame_width - $edge_width - $i, $color2); // left
+      ImageLine($gdimg,                   $frame_width + $edge_width + $i,                   $frame_width + $edge_width + $i, ImageSX($gdimg) - $frame_width - $edge_width - $i,                   $frame_width + $edge_width + $i, $color2); // top
+      ImageLine($gdimg, ImageSX($gdimg) - $frame_width - $edge_width - $i, ImageSY($gdimg) - $frame_width - $edge_width - $i, ImageSX($gdimg) - $frame_width - $edge_width - $i,                   $frame_width + $edge_width + $i, $color1); // right
+      ImageLine($gdimg, ImageSX($gdimg) - $frame_width - $edge_width - $i, ImageSY($gdimg) - $frame_width - $edge_width - $i,                   $frame_width + $edge_width + $i, ImageSY($gdimg) - $frame_width - $edge_width - $i, $color1); // bottom
+    }
+    return true;
+  }
+
+
+  function Gamma(&$gdimg, $amount) {
+    if (number_format($amount, 4) == '1.0000') {
+      return true;
+    }
+    return ImageGammaCorrect($gdimg, 1.0, $amount);
+  }
+
+
+  function Grayscale(&$gdimg) {
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_GRAYSCALE)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_GRAYSCALE)', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+    return phpthumb_filters::Colorize($gdimg, 100, 'gray');
+  }
+
+
+  function HistogramAnalysis(&$gdimg, $calculateGray=false) {
+    $ImageSX = ImageSX($gdimg);
+    $ImageSY = ImageSY($gdimg);
+    for ($x = 0; $x < $ImageSX; $x++) {
+      for ($y = 0; $y < $ImageSY; $y++) {
+        $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        @$Analysis['red'][$OriginalPixel['red']]++;
+        @$Analysis['green'][$OriginalPixel['green']]++;
+        @$Analysis['blue'][$OriginalPixel['blue']]++;
+        @$Analysis['alpha'][$OriginalPixel['alpha']]++;
+        if ($calculateGray) {
+          $GrayPixel = phpthumb_functions::GrayscalePixel($OriginalPixel);
+          @$Analysis['gray'][$GrayPixel['red']]++;
+        }
+      }
+    }
+    $keys = array('red', 'green', 'blue', 'alpha');
+    if ($calculateGray) {
+      $keys[] = 'gray';
+    }
+    foreach ($keys as $dummy => $key) {
+      ksort($Analysis[$key]);
+    }
+    return $Analysis;
+  }
+
+
+  function HistogramStretch(&$gdimg, $band='*', $min=-1, $max=-1) {
+    // equivalent of "Auto Contrast" in Adobe Photoshop
+
+    $Analysis = phpthumb_filters::HistogramAnalysis($gdimg, true);
+    $keys = array('r'=>'red', 'g'=>'green', 'b'=>'blue', 'a'=>'alpha', '*'=>'gray');
+    if (!isset($keys[$band])) {
+      return false;
+    }
+    $key = $keys[$band];
+
+    // If the absolute brightest and darkest pixels are used then one random
+    // pixel in the image could throw off the whole system. Instead, count up/down
+    // from the limit and allow 0.1% of brightest/darkest pixels to be clipped to min/max
+    $clip_threshold = ImageSX($gdimg) * ImageSX($gdimg) * 0.001;
+    if ($min >= 0) {
+      $range_min = min($min, 255);
+    } else {
+      $countsum = 0;
+      for ($i = 0; $i <= 255; $i++) {
+        $countsum += @$Analysis[$key][$i];
+        if ($countsum >= $clip_threshold) {
+          $range_min = $i - 1;
+          break;
+        }
+      }
+      $range_min = max($range_min, 0);
+    }
+    if ($max >= 0) {
+      $range_max = max($max, 255);
+    } else {
+      $countsum = 0;
+      $threshold = ImageSX($gdimg) * ImageSX($gdimg) * 0.001; // 0.1% of brightest and darkest pixels can be clipped
+      for ($i = 255; $i >= 0; $i--) {
+        $countsum += @$Analysis[$key][$i];
+        if ($countsum >= $clip_threshold) {
+          $range_max = $i + 1;
+          break;
+        }
+      }
+      $range_max = min($range_max, 255);
+    }
+    $range_scale = (($range_max == $range_min) ? 1 : (255 / ($range_max - $range_min)));
+    if (($range_min == 0) && ($range_max == 255)) {
+      // no adjustment neccesary - don't waste CPU time!
+      return true;
+    }
+
+    $ImageSX = ImageSX($gdimg);
+    $ImageSY = ImageSY($gdimg);
+    for ($x = 0; $x < $ImageSX; $x++) {
+      for ($y = 0; $y < $ImageSY; $y++) {
+        $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        if ($band == '*') {
+          $new['red']   = min(255, max(0, ($OriginalPixel['red']   - $range_min) * $range_scale));
+          $new['green'] = min(255, max(0, ($OriginalPixel['green'] - $range_min) * $range_scale));
+          $new['blue']  = min(255, max(0, ($OriginalPixel['blue']  - $range_min) * $range_scale));
+          $new['alpha'] = min(255, max(0, ($OriginalPixel['alpha'] - $range_min) * $range_scale));
+        } else {
+          $new = $OriginalPixel;
+          $new[$key] = min(255, max(0, ($OriginalPixel[$key] - $range_min) * $range_scale));
+        }
+        $newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, $new['red'], $new['green'], $new['blue'], $new['alpha']);
+        ImageSetPixel($gdimg, $x, $y, $newColor);
+      }
+    }
+
+    return true;
+  }
+
+
+  function HistogramOverlay(&$gdimg, $bands='*', $colors='', $width=0.25, $height=0.25, $alignment='BR', $opacity=50, $margin=5) {
+    $Analysis = phpthumb_filters::HistogramAnalysis($gdimg, true);
+
+    $histW = round(($width > 1) ? min($width, ImageSX($gdimg)) : ImageSX($gdimg) * $width);
+    $histH = round(($width > 1) ? min($width, ImageSX($gdimg)) : ImageSX($gdimg) * $width);
+    if ($gdHist = ImageCreateTrueColor($histW, $histH)) {
+      $color_back = phpthumb_functions::ImageColorAllocateAlphaSafe($gdHist, 0, 0, 0, 127);
+      ImageFilledRectangle($gdHist, 0, 0, $histW, $histH, $color_back);
+      ImageAlphaBlending($gdHist, false);
+      ImageSaveAlpha($gdHist, true);
+
+      if ($gdHistTemp = ImageCreateTrueColor(256, 100)) {
+        $color_back_temp = phpthumb_functions::ImageColorAllocateAlphaSafe($gdHistTemp, 255, 0, 255, 127);
+        ImageAlphaBlending($gdHistTemp, false);
+        ImageSaveAlpha($gdHistTemp, true);
+        ImageFilledRectangle($gdHistTemp, 0, 0, ImageSX($gdHistTemp), ImageSY($gdHistTemp), $color_back_temp);
+
+        $DefaultColors = array('r'=>'FF0000', 'g'=>'00FF00', 'b'=>'0000FF', 'a'=>'999999', '*'=>'FFFFFF');
+        $Colors = explode(';', $colors);
+        $BandsToGraph = array_unique(preg_split('//', $bands));
+        $keys = array('r'=>'red', 'g'=>'green', 'b'=>'blue', 'a'=>'alpha', '*'=>'gray');
+        foreach ($BandsToGraph as $key => $band) {
+          if (!isset($keys[$band])) {
+            continue;
+          }
+          $PeakValue = max($Analysis[$keys[$band]]);
+          $thisColor = phpthumb_functions::ImageHexColorAllocate($gdHistTemp, phpthumb_functions::IsHexColor(@$Colors[$key]) ? $Colors[$key] : $DefaultColors[$band]);
+          $tempHeight = ImageSY($gdHistTemp);
+          for ($x = 0; $x <= 255; $x++) {
+            ImageLine($gdHistTemp, $x, $tempHeight - 1, $x, $tempHeight - 1 - round(@$Analysis[$keys[$band]][$x] / $PeakValue * $tempHeight), $thisColor);
+          }
+          ImageLine($gdHistTemp, 0, $tempHeight - 1, 255, $tempHeight - 1, $thisColor);
+          ImageLine($gdHistTemp, 0, $tempHeight - 2, 255, $tempHeight - 2, $thisColor);
+        }
+        ImageCopyResampled($gdHist, $gdHistTemp, 0, 0, 0, 0, ImageSX($gdHist), ImageSY($gdHist), ImageSX($gdHistTemp), ImageSY($gdHistTemp));
+        ImageDestroy($gdHistTemp);
+      } else {
+        return false;
+      }
+
+      phpthumb_filters::WatermarkOverlay($gdimg, $gdHist, $alignment, $opacity, $margin);
+      ImageDestroy($gdHist);
+      return true;
+    }
+    return false;
+  }
+
+
+  function ImageBorder(&$gdimg, $border_width, $radius_x, $radius_y, $hexcolor_border) {
+    $border_width = ($border_width ? $border_width : 1);
+    $radius_x     = ($radius_x     ? $radius_x     : 0);
+    $radius_y     = ($radius_y     ? $radius_y     : 0);
+
+    $output_width  = ImageSX($gdimg);
+    $output_height = ImageSY($gdimg);
+
+    list($new_width, $new_height) = phpthumb_functions::ProportionalResize($output_width, $output_height, $output_width - max($border_width * 2, $radius_x), $output_height - max($border_width * 2, $radius_y));
+    $offset_x = ($radius_x ? $output_width  - $new_width  - $radius_x : 0);
+    $offset_y = ($radius_y ? $output_height - $new_height - $radius_y : 0);
+
+//header('Content-Type: image/png');
+//ImagePNG($gdimg);
+//exit;
+    if ($gd_border_canvas = phpthumb_functions::ImageCreateFunction($output_width, $output_height)) {
+
+      ImageSaveAlpha($gd_border_canvas, true);
+      ImageAlphaBlending($gd_border_canvas, false);
+      $color_background = phpthumb_functions::ImageColorAllocateAlphaSafe($gd_border_canvas, 255, 255, 255, 127);
+      ImageFilledRectangle($gd_border_canvas, 0, 0, $output_width, $output_height, $color_background);
+
+      $color_border = phpthumb_functions::ImageHexColorAllocate($gd_border_canvas, (phpthumb_functions::IsHexColor($hexcolor_border) ? $hexcolor_border : '000000'));
+
+      for ($i = 0; $i < $border_width; $i++) {
+        ImageLine($gd_border_canvas,             floor($offset_x / 2) + $radius_x,                      $i, $output_width - $radius_x - ceil($offset_x / 2),                         $i, $color_border); // top
+        ImageLine($gd_border_canvas,             floor($offset_x / 2) + $radius_x, $output_height - 1 - $i, $output_width - $radius_x - ceil($offset_x / 2),    $output_height - 1 - $i, $color_border); // bottom
+        ImageLine($gd_border_canvas,                    floor($offset_x / 2) + $i,               $radius_y,                      floor($offset_x / 2) +  $i, $output_height - $radius_y, $color_border); // left
+        ImageLine($gd_border_canvas, $output_width - 1 - $i - ceil($offset_x / 2),               $radius_y,    $output_width - 1 - $i - ceil($offset_x / 2), $output_height - $radius_y, $color_border); // right
+      }
+
+      if ($radius_x && $radius_y) {
+
+        // PHP bug: ImageArc() with thicknesses > 1 give bad/undesirable/unpredicatable results
+        // Solution: Draw multiple 1px arcs side-by-side.
+
+        // Problem: parallel arcs give strange/ugly antialiasing problems
+        // Solution: draw non-parallel arcs, from one side of the line thickness at the start angle
+        //   to the opposite edge of the line thickness at the terminating angle
+        for ($thickness_offset = 0; $thickness_offset < $border_width; $thickness_offset++) {
+          ImageArc($gd_border_canvas, floor($offset_x / 2) + 1 +                 $radius_x,              $thickness_offset - 1 + $radius_y, $radius_x * 2, $radius_y * 2, 180, 270, $color_border); // top-left
+          ImageArc($gd_border_canvas,                     $output_width - $radius_x - 1 - ceil($offset_x / 2),              $thickness_offset - 1 + $radius_y, $radius_x * 2, $radius_y * 2, 270, 360, $color_border); // top-right
+          ImageArc($gd_border_canvas,                     $output_width - $radius_x - 1 - ceil($offset_x / 2), $output_height - $thickness_offset - $radius_y, $radius_x * 2, $radius_y * 2,   0,  90, $color_border); // bottom-right
+          ImageArc($gd_border_canvas, floor($offset_x / 2) + 1 +                 $radius_x, $output_height - $thickness_offset - $radius_y, $radius_x * 2, $radius_y * 2,  90, 180, $color_border); // bottom-left
+        }
+        if ($border_width > 1) {
+          for ($thickness_offset = 0; $thickness_offset < $border_width; $thickness_offset++) {
+            ImageArc($gd_border_canvas, floor($offset_x / 2) + $thickness_offset + $radius_x,                                      $radius_y, $radius_x * 2, $radius_y * 2, 180, 270, $color_border); // top-left
+            ImageArc($gd_border_canvas, $output_width - $thickness_offset - $radius_x - 1 - ceil($offset_x / 2),                                      $radius_y, $radius_x * 2, $radius_y * 2, 270, 360, $color_border); // top-right
+            ImageArc($gd_border_canvas, $output_width - $thickness_offset - $radius_x - 1 - ceil($offset_x / 2),                     $output_height - $radius_y, $radius_x * 2, $radius_y * 2,   0,  90, $color_border); // bottom-right
+            ImageArc($gd_border_canvas, floor($offset_x / 2) + $thickness_offset + $radius_x,                     $output_height - $radius_y, $radius_x * 2, $radius_y * 2,  90, 180, $color_border); // bottom-left
+          }
+        }
+
+      }
+      $this->phpThumbObject->ImageResizeFunction($gd_border_canvas, $gdimg, floor(($output_width - $new_width) / 2), round(($output_height - $new_height) / 2), 0, 0, $new_width, $new_height, $output_width, $output_height);
+
+      ImageDestroy($gdimg);
+      $gdimg = phpthumb_functions::ImageCreateFunction($output_width, $output_height);
+      ImageSaveAlpha($gdimg, true);
+      ImageAlphaBlending($gdimg, false);
+      $gdimg_color_background = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, 255, 255, 255, 127);
+      ImageFilledRectangle($gdimg, 0, 0, $output_width, $output_height, $gdimg_color_background);
+
+      ImageCopy($gdimg, $gd_border_canvas, 0, 0, 0, 0, $output_width, $output_height);
+      //$gdimg = $gd_border_canvas;
+      ImageDestroy($gd_border_canvas);
+      return true;
+
+
+    } else {
+      $this->DebugMessage('FAILED: $gd_border_canvas = phpthumb_functions::ImageCreateFunction('.$output_width.', '.$output_height.')', __FILE__, __LINE__);
+    }
+    return false;
+  }
+
+
+  function MeanRemoval(&$gdimg) {
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_MEAN_REMOVAL)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_MEAN_REMOVAL)', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+    // currently not implemented "the hard way"
+    $this->DebugMessage('FAILED: phpthumb_filters::MeanRemoval($gdimg) [function not implemented]', __FILE__, __LINE__);
+    return false;
+  }
+
+
+  function Negative(&$gdimg) {
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_NEGATE)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_NEGATE)', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+    $ImageSX = ImageSX($gdimg);
+    $ImageSY = ImageSY($gdimg);
+    for ($x = 0; $x < $ImageSX; $x++) {
+      for ($y = 0; $y < $ImageSY; $y++) {
+        $currentPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        $newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, (~$currentPixel['red'] & 0xFF), (~$currentPixel['green'] & 0xFF), (~$currentPixel['blue'] & 0xFF), $currentPixel['alpha']);
+        ImageSetPixel($gdimg, $x, $y, $newColor);
+      }
+    }
+    return true;
+  }
+
+
+  function RoundedImageCorners(&$gdimg, $radius_x, $radius_y) {
+    // generate mask at twice desired resolution and downsample afterwards for easy antialiasing
+    // mask is generated as a white double-size elipse on a triple-size black background and copy-paste-resampled
+    // onto a correct-size mask image as 4 corners due to errors when the entire mask is resampled at once (gray edges)
+    if ($gdimg_cornermask_triple = phpthumb_functions::ImageCreateFunction($radius_x * 6, $radius_y * 6)) {
+      if ($gdimg_cornermask = phpthumb_functions::ImageCreateFunction(ImageSX($gdimg), ImageSY($gdimg))) {
+
+        $color_transparent = ImageColorAllocate($gdimg_cornermask_triple, 255, 255, 255);
+        ImageFilledEllipse($gdimg_cornermask_triple, $radius_x * 3, $radius_y * 3, $radius_x * 4, $radius_y * 4, $color_transparent);
+
+        ImageFilledRectangle($gdimg_cornermask, 0, 0, ImageSX($gdimg), ImageSY($gdimg), $color_transparent);
+
+        ImageCopyResampled($gdimg_cornermask, $gdimg_cornermask_triple,                           0,                           0,     $radius_x,     $radius_y, $radius_x, $radius_y, $radius_x * 2, $radius_y * 2);
+        ImageCopyResampled($gdimg_cornermask, $gdimg_cornermask_triple,                           0, ImageSY($gdimg) - $radius_y,     $radius_x, $radius_y * 3, $radius_x, $radius_y, $radius_x * 2, $radius_y * 2);
+        ImageCopyResampled($gdimg_cornermask, $gdimg_cornermask_triple, ImageSX($gdimg) - $radius_x, ImageSY($gdimg) - $radius_y, $radius_x * 3, $radius_y * 3, $radius_x, $radius_y, $radius_x * 2, $radius_y * 2);
+        ImageCopyResampled($gdimg_cornermask, $gdimg_cornermask_triple, ImageSX($gdimg) - $radius_x,                           0, $radius_x * 3,     $radius_y, $radius_x, $radius_y, $radius_x * 2, $radius_y * 2);
+
+        phpthumb_filters::ApplyMask($gdimg_cornermask, $gdimg);
+        ImageDestroy($gdimg_cornermask);
+        $this->DebugMessage('RoundedImageCorners('.$radius_x.', '.$radius_y.') succeeded', __FILE__, __LINE__);
+        return true;
+
+      } else {
+        $this->DebugMessage('FAILED: $gdimg_cornermask = phpthumb_functions::ImageCreateFunction('.ImageSX($gdimg).', '.ImageSY($gdimg).')', __FILE__, __LINE__);
+      }
+      ImageDestroy($gdimg_cornermask_triple);
+
+    } else {
+      $this->DebugMessage('FAILED: $gdimg_cornermask_triple = phpthumb_functions::ImageCreateFunction('.($radius_x * 6).', '.($radius_y * 6).')', __FILE__, __LINE__);
+    }
+    return false;
+  }
+
+
+  function Saturation(&$gdimg, $amount, $color='') {
+    if ($amount == 0) {
+      return true;
+    } elseif ($amount > 0) {
+      $amount = 0 - $amount;
+    } else {
+      $amount = abs($amount);
+    }
+    return phpthumb_filters::Desaturate($gdimg, $amount, $color);
+  }
+
+
+  function Sepia(&$gdimg, $amount, $targetColor) {
+    $amount      = (is_numeric($amount) ? max(0, min(100, $amount)) : 50);
+    $targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'A28065');
+
+    if ($amount == 0) {
+      return true;
+    }
+
+    $TargetPixel['red']   = hexdec(substr($targetColor, 0, 2));
+    $TargetPixel['green'] = hexdec(substr($targetColor, 2, 2));
+    $TargetPixel['blue']  = hexdec(substr($targetColor, 4, 2));
+
+    $ImageSX = ImageSX($gdimg);
+    $ImageSY = ImageSY($gdimg);
+    for ($x = 0; $x < $ImageSX; $x++) {
+      for ($y = 0; $y < $ImageSY; $y++) {
+        $OriginalPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        $GrayPixel = phpthumb_functions::GrayscalePixel($OriginalPixel);
+
+        // http://www.gimpguru.org/Tutorials/SepiaToning/
+        // "In the traditional sepia toning process, the tinting occurs most in
+        // the mid-tones: the lighter and darker areas appear to be closer to B&W."
+        $SepiaAmount = ((128 - abs($GrayPixel['red'] - 128)) / 128) * ($amount / 100);
+
+        foreach ($TargetPixel as $key => $value) {
+          $NewPixel[$key] = round(max(0, min(255, $GrayPixel[$key] * (1 - $SepiaAmount) + ($TargetPixel[$key] * $SepiaAmount))));
+        }
+        $newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, $NewPixel['red'], $NewPixel['green'], $NewPixel['blue'], $OriginalPixel['alpha']);
+        ImageSetPixel($gdimg, $x, $y, $newColor);
+      }
+    }
+    return true;
+  }
+
+
+  function Smooth(&$gdimg, $amount=6) {
+    $amount = min(25, max(0, $amount));
+    if ($amount == 0) {
+      return true;
+    }
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+      if (ImageFilter($gdimg, IMG_FILTER_SMOOTH, $amount)) {
+        return true;
+      }
+      $this->DebugMessage('FAILED: ImageFilter($gdimg, IMG_FILTER_SMOOTH, '.$amount.')', __FILE__, __LINE__);
+      // fall through and try it the hard way
+    }
+    // currently not implemented "the hard way"
+    $this->DebugMessage('FAILED: phpthumb_filters::Smooth($gdimg, '.$amount.') [function not implemented]', __FILE__, __LINE__);
+    return false;
+  }
+
+
+  function Threshold(&$gdimg, $cutoff) {
+    $cutoff = min(255, max(0, ($cutoff ? $cutoff : 128)));
+    for ($x = 0; $x < ImageSX($gdimg); $x++) {
+      for ($y = 0; $y < ImageSY($gdimg); $y++) {
+        $currentPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        $grayPixel = phpthumb_functions::GrayscalePixel($currentPixel);
+        if ($grayPixel['red'] < $cutoff) {
+          $newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, 0x00, 0x00, 0x00, $currentPixel['alpha']);
+        } else {
+          $newColor = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg, 0xFF, 0xFF, 0xFF, $currentPixel['alpha']);
+        }
+        ImageSetPixel($gdimg, $x, $y, $newColor);
+      }
+    }
+    return true;
+  }
+
+
+  function ImageTrueColorToPalette2(&$image, $dither, $ncolors) {
+    // http://www.php.net/manual/en/function.imagetruecolortopalette.php
+    // zmorris at zsculpt dot com (17-Aug-2004 06:58)
+    $width  = ImageSX($image);
+    $height = ImageSY($image);
+    $image_copy = ImageCreateTrueColor($width, $height);
+    //ImageCopyMerge($image_copy, $image, 0, 0, 0, 0, $width, $height, 100);
+    ImageCopy($image_copy, $image, 0, 0, 0, 0, $width, $height);
+    ImageTrueColorToPalette($image, $dither, $ncolors);
+    ImageColorMatch($image_copy, $image);
+    ImageDestroy($image_copy);
+    return true;
+  }
+
+  function ReduceColorDepth(&$gdimg, $colors=256, $dither=true) {
+    $colors = max(min($colors, 256), 2);
+    // ImageTrueColorToPalette usually makes ugly colors, the replacement is a bit better
+    //ImageTrueColorToPalette($gdimg, $dither, $colors);
+    phpthumb_filters::ImageTrueColorToPalette2($gdimg, $dither, $colors);
+    return true;
+  }
+
+
+  function WhiteBalance(&$gdimg, $targetColor='') {
+    if (phpthumb_functions::IsHexColor($targetColor)) {
+      $targetPixel = array(
+        'red'   => hexdec(substr($targetColor, 0, 2)),
+        'green' => hexdec(substr($targetColor, 2, 2)),
+        'blue'  => hexdec(substr($targetColor, 4, 2))
+      );
+    } else {
+      $Analysis = phpthumb_filters::HistogramAnalysis($gdimg, false);
+      $targetPixel = array(
+        'red'   => max(array_keys($Analysis['red'])),
+        'green' => max(array_keys($Analysis['green'])),
+        'blue'  => max(array_keys($Analysis['blue']))
+      );
+    }
+    $grayValue = phpthumb_functions::GrayscaleValue($targetPixel['red'], $targetPixel['green'], $targetPixel['blue']);
+    $scaleR = $grayValue / $targetPixel['red'];
+    $scaleG = $grayValue / $targetPixel['green'];
+    $scaleB = $grayValue / $targetPixel['blue'];
+
+    for ($x = 0; $x < ImageSX($gdimg); $x++) {
+      for ($y = 0; $y < ImageSY($gdimg); $y++) {
+        $currentPixel = phpthumb_functions::GetPixelColor($gdimg, $x, $y);
+        $newColor = phpthumb_functions::ImageColorAllocateAlphaSafe(
+          $gdimg,
+          max(0, min(255, round($currentPixel['red']   * $scaleR))),
+          max(0, min(255, round($currentPixel['green'] * $scaleG))),
+          max(0, min(255, round($currentPixel['blue']  * $scaleB))),
+          $currentPixel['alpha']
+        );
+        ImageSetPixel($gdimg, $x, $y, $newColor);
+      }
+    }
+    return true;
+  }
+
+
+  function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ttffont='', $opacity=100, $margin=5, $angle=0, $bg_color=false, $bg_opacity=0, $fillextend='') {
+    // text watermark requested
+    if (!$text) {
+      return false;
+    }
+    ImageAlphaBlending($gdimg, true);
+
+    $metaTextArray = array(
+      '^Fb' =>       $this->phpThumbObject->getimagesizeinfo['filesize'],
+      '^Fk' => round($this->phpThumbObject->getimagesizeinfo['filesize'] / 1024),
+      '^Fm' => round($this->phpThumbObject->getimagesizeinfo['filesize'] / 1048576),
+      '^X'  => $this->phpThumbObject->getimagesizeinfo[0],
+      '^Y'  => $this->phpThumbObject->getimagesizeinfo[1],
+      '^x'  => ImageSX($gdimg),
+      '^y'  => ImageSY($gdimg),
+      '^^'  => '^',
+    );
+    $text = strtr($text, $metaTextArray);
+
+    $text = str_replace("\r\n", "\n", $text);
+    $text = str_replace("\r",   "\n", $text);
+    $textlines = explode("\n", $text);
+
+    if (@is_readable($ttffont) && is_file($ttffont)) {
+
+      $opacity = 100 - intval(max(min($opacity, 100), 0));
+
+      $this->DebugMessage('Using TTF font "'.$ttffont.'"', __FILE__, __LINE__);
+
+      $TTFbox = ImageTTFbBox($size, $angle, $ttffont, $text);
+
+      $min_x = min($TTFbox[0], $TTFbox[2], $TTFbox[4], $TTFbox[6]);
+      $max_x = max($TTFbox[0], $TTFbox[2], $TTFbox[4], $TTFbox[6]);
+      //$text_width = round($max_x - $min_x + ($size * 0.5));
+      $text_width = round($max_x - $min_x);
+
+      $min_y = min($TTFbox[1], $TTFbox[3], $TTFbox[5], $TTFbox[7]);
+      $max_y = max($TTFbox[1], $TTFbox[3], $TTFbox[5], $TTFbox[7]);
+      //$text_height = round($max_y - $min_y + ($size * 0.5));
+      $text_height = round($max_y - $min_y);
+
+      $TTFboxChar = ImageTTFbBox($size, $angle, $ttffont, 'jH');
+      $char_min_y = min($TTFboxChar[1], $TTFboxChar[3], $TTFboxChar[5], $TTFboxChar[7]);
+      $char_max_y = max($TTFboxChar[1], $TTFboxChar[3], $TTFboxChar[5], $TTFboxChar[7]);
+      $char_height = round($char_max_y - $char_min_y);
+
+      switch ($alignment) {
+        case 'T':
+          $text_origin_x = round((ImageSX($gdimg) - $text_width) / 2);
+          $text_origin_y = $char_height + $margin;
+          break;
+
+        case 'B':
+          $text_origin_x = round((ImageSX($gdimg) - $text_width) / 2);
+          $text_origin_y = ImageSY($gdimg) + $TTFbox[1] - $margin;
+          break;
+
+        case 'L':
+          $text_origin_x = $margin;
+          $text_origin_y = round((ImageSY($gdimg) - $text_height) / 2) + $char_height;
+          break;
+
+        case 'R':
+          $text_origin_x = ImageSX($gdimg) - $text_width  + $TTFbox[0] - $min_x + round($size * 0.25) - $margin;
+          $text_origin_y = round((ImageSY($gdimg) - $text_height) / 2) + $char_height;
+          break;
+
+        case 'C':
+          $text_origin_x = round((ImageSX($gdimg) - $text_width) / 2);
+          $text_origin_y = round((ImageSY($gdimg) - $text_height) / 2) + $char_height;
+          break;
+
+        case 'TL':
+          $text_origin_x = $margin;
+          $text_origin_y = $char_height + $margin;
+          break;
+
+        case 'TR':
+          $text_origin_x = ImageSX($gdimg) - $text_width  + $TTFbox[0] - $min_x + round($size * 0.25) - $margin;
+          $text_origin_y = $char_height + $margin;
+          break;
+
+        case 'BL':
+          $text_origin_x = $margin;
+          $text_origin_y = ImageSY($gdimg) + $TTFbox[1] - $margin;
+          break;
+
+        case 'BR':
+        default:
+          $text_origin_x = ImageSX($gdimg) - $text_width  + $TTFbox[0] - $min_x + round($size * 0.25) - $margin;
+          $text_origin_y = ImageSY($gdimg) + $TTFbox[1] - $margin;
+          break;
+      }
+      $letter_color_text = phpthumb_functions::ImageHexColorAllocate($gdimg, $hex_color, false, $opacity * 1.27);
+
+      if ($alignment == '*') {
+
+        $text_origin_y = $char_height + $margin;
+        while (($text_origin_y - $text_height) < ImageSY($gdimg)) {
+          $text_origin_x = $margin;
+          while ($text_origin_x < ImageSX($gdimg)) {
+            ImageTTFtext($gdimg, $size, $angle, $text_origin_x, $text_origin_y, $letter_color_text, $ttffont, $text);
+            $text_origin_x += ($text_width + $margin);
+          }
+          $text_origin_y += ($text_height + $margin);
+        }
+
+      } else {
+
+        //ImageRectangle($gdimg, $text_origin_x + $min_x, $text_origin_y + $TTFbox[1], $text_origin_x + $min_x + $text_width, $text_origin_y + $TTFbox[1] - $text_height, $letter_color_text);
+        if (phpthumb_functions::IsHexColor($bg_color)) {
+          $text_background_alpha = round(127 * ((100 - min(max(0, $bg_opacity), 100)) / 100));
+          $text_color_background = phpthumb_functions::ImageHexColorAllocate($gdimg, $bg_color, false, $text_background_alpha);
+        } else {
+          $text_color_background = phpthumb_functions::ImageHexColorAllocate($gdimg, 'FFFFFF', false, 127);
+        }
+        $x1 = $text_origin_x + $min_x;
+        $y1 = $text_origin_y + $TTFbox[1];
+        $x2 = $text_origin_x + $min_x + $text_width;
+        $y2 = $text_origin_y + $TTFbox[1] - $text_height;
+        $x_TL = eregi('x', $fillextend) ?               0 : min($x1, $x2);
+        $y_TL = eregi('y', $fillextend) ?               0 : min($y1, $y2);
+        $x_BR = eregi('x', $fillextend) ? ImageSX($gdimg) : max($x1, $x2);
+        $y_BR = eregi('y', $fillextend) ? ImageSY($gdimg) : max($y1, $y2);
+        //while ($y_BR > ImageSY($gdimg)) {
+        //  $y_TL--;
+        //  $y_BR--;
+        //  $text_origin_y--;
+        //}
+        ImageFilledRectangle($gdimg, $x_TL, $y_TL, $x_BR, $y_BR, $text_color_background);
+        ImageTTFtext($gdimg, $size, $angle, $text_origin_x, $text_origin_y, $letter_color_text, $ttffont, $text);
+
+      }
+      return true;
+
+    } else {
+
+      $size = min(5, max(1, $size));
+      $this->DebugMessage('Using built-in font (size='.$size.') for text watermark'.($ttffont ? ' because $ttffont !is_readable('.$ttffont.')' : ''), __FILE__, __LINE__);
+
+      $text_width  = 0;
+      $text_height = 0;
+      foreach ($textlines as $dummy => $line) {
+        $text_width   = max($text_width, ImageFontWidth($size) * strlen($line));
+        $text_height += ImageFontHeight($size);
+      }
+      if ($img_watermark = phpthumb_functions::ImageCreateFunction($text_width, $text_height)) {
+        ImageAlphaBlending($img_watermark, false);
+        if (phpthumb_functions::IsHexColor($bg_color)) {
+          $text_background_alpha = round(127 * ((100 - min(max(0, $bg_opacity), 100)) / 100));
+          $text_color_background = phpthumb_functions::ImageHexColorAllocate($img_watermark, $bg_color, false, $text_background_alpha);
+        } else {
+          $text_color_background = phpthumb_functions::ImageHexColorAllocate($img_watermark, 'FFFFFF', false, 127);
+        }
+        ImageFilledRectangle($img_watermark, 0, 0, ImageSX($img_watermark), ImageSY($img_watermark), $text_color_background);
+
+        if ($angle && function_exists('ImageRotate')) {
+          // using $img_watermark_mask is pointless if ImageRotate function isn't available
+          if ($img_watermark_mask = phpthumb_functions::ImageCreateFunction($text_width, $text_height)) {
+            $mask_color_background = ImageColorAllocate($img_watermark_mask, 0, 0, 0);
+            ImageAlphaBlending($img_watermark_mask, false);
+            ImageFilledRectangle($img_watermark_mask, 0, 0, ImageSX($img_watermark_mask), ImageSY($img_watermark_mask), $mask_color_background);
+            $mask_color_watermark = ImageColorAllocate($img_watermark_mask, 255, 255, 255);
+          }
+        }
+
+        $text_color_watermark = phpthumb_functions::ImageHexColorAllocate($img_watermark, $hex_color);
+        foreach ($textlines as $key => $line) {
+          switch ($alignment) {
+            case 'C':
+            case 'T':
+            case 'B':
+              $x_offset = round(($text_width - (ImageFontWidth($size) * strlen($line))) / 2);
+              break;
+
+            case 'L':
+            case 'TL':
+            case 'BL':
+              $x_offset = 0;
+              break;
+
+            case 'R':
+            case 'TR':
+            case 'BR':
+            default:
+              $x_offset = $text_width - (ImageFontWidth($size) * strlen($line));
+              break;
+          }
+          ImageString($img_watermark, $size, $x_offset, $key * ImageFontHeight($size), $line, $text_color_watermark);
+          if ($angle && $img_watermark_mask) {
+            ImageString($img_watermark_mask, $size, $x_offset, $key * ImageFontHeight($size), $text, $mask_color_watermark);
+          }
+        }
+        if ($angle && $img_watermark_mask) {
+          $img_watermark      = ImageRotate($img_watermark,      $angle, $text_color_background);
+          $img_watermark_mask = ImageRotate($img_watermark_mask, $angle, $mask_color_background);
+          phpthumb_filters::ApplyMask($img_watermark_mask, $img_watermark);
+        }
+        phpthumb_filters::WatermarkOverlay($gdimg, $img_watermark, $alignment, $opacity, $margin);
+        ImageDestroy($img_watermark);
+        return true;
+      }
+
+    }
+    return false;
+  }
+
+
+  function WatermarkOverlay(&$gdimg_dest, &$img_watermark, $alignment='*', $opacity=50, $margin=5) {
+    if (is_resource($gdimg_dest) && is_resource($img_watermark)) {
+      $watermark_source_x        = 0;
+      $watermark_source_y        = 0;
+      $img_source_width          = ImageSX($gdimg_dest);
+      $img_source_height         = ImageSY($gdimg_dest);
+      $watermark_source_width    = ImageSX($img_watermark);
+      $watermark_source_height   = ImageSY($img_watermark);
+      $watermark_opacity_percent = max(0, min(100, $opacity));
+      if ($margin < 1) {
+        $watermark_margin_percent = 1 - $margin;
+      } else {
+        $watermark_margin_percent = (100 - max(0, min(100, $margin))) / 100;
+      }
+      $watermark_margin_x = round((1 - $watermark_margin_percent) * $img_source_width);
+      $watermark_margin_y = round((1 - $watermark_margin_percent) * $img_source_height);
+      switch ($alignment) {
+        case '*':
+          if ($gdimg_tiledwatermark = phpthumb_functions::ImageCreateFunction($img_source_width, $img_source_height)) {
+
+            ImageAlphaBlending($gdimg_tiledwatermark, false);
+            ImageSaveAlpha($gdimg_tiledwatermark, true);
+            $text_color_transparent = phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg_tiledwatermark, 255, 0, 255, 127);
+            ImageFill($gdimg_tiledwatermark, 0, 0, $text_color_transparent);
+
+            // set the tiled image transparent color to whatever the untiled image transparency index is
+//            ImageColorTransparent($gdimg_tiledwatermark, ImageColorTransparent($img_watermark));
+
+            // a "cleaner" way of doing it, but can't handle the margin feature :(
+//            ImageSetTile($gdimg_tiledwatermark, $img_watermark);
+//            ImageFill($gdimg_tiledwatermark, 0, 0, IMG_COLOR_TILED);
+//            break;
+
+//            ImageFill($gdimg_tiledwatermark, 0, 0, ImageColorTransparent($gdimg_tiledwatermark));
+            // tile the image as many times as can fit
+            for ($x = $watermark_margin_x; $x < ($img_source_width + $watermark_source_width); $x += round($watermark_source_width + ((1 - $watermark_margin_percent) * $img_source_width))) {
+              for ($y = $watermark_margin_y; $y < ($img_source_height + $watermark_source_height); $y += round($watermark_source_height + ((1 - $watermark_margin_percent) * $img_source_height))) {
+                ImageCopy(
+                  $gdimg_tiledwatermark,
+                  $img_watermark,
+                  $x,
+                  $y,
+                  0,
+                  0,
+                  min($watermark_source_width,  $img_source_width  - $x - ((1 - $watermark_margin_percent) * $img_source_width)),
+                  min($watermark_source_height, $img_source_height - $y - ((1 - $watermark_margin_percent) * $img_source_height))
+                );
+              }
+            }
+
+            $watermark_source_width  = ImageSX($gdimg_tiledwatermark);
+            $watermark_source_height = ImageSY($gdimg_tiledwatermark);
+            $watermark_destination_x = 0;
+            $watermark_destination_y = 0;
+
+            ImageDestroy($img_watermark);
+            $img_watermark = $gdimg_tiledwatermark;
+          }
+          break;
+
+        case 'T':
+          $watermark_destination_x = round((($img_source_width  / 2) - ($watermark_source_width / 2)) + $watermark_margin_x);
+          $watermark_destination_y = $watermark_margin_y;
+          break;
+
+        case 'B':
+          $watermark_destination_x = round((($img_source_width  / 2) - ($watermark_source_width / 2)) + $watermark_margin_x);
+          $watermark_destination_y = round(($img_source_height - $watermark_source_height) * $watermark_margin_percent);
+          break;
+
+        case 'L':
+          $watermark_destination_x = $watermark_margin_x;
+          $watermark_destination_y = round((($img_source_height / 2) - ($watermark_source_height / 2)) + $watermark_margin_y);
+          break;
+
+        case 'R':
+          $watermark_destination_x = round(($img_source_width - $watermark_source_width)  * $watermark_margin_percent);
+          $watermark_destination_y = round((($img_source_height / 2) - ($watermark_source_height / 2)) + $watermark_margin_y);
+          break;
+
+        case 'C':
+          $watermark_destination_x = round(($img_source_width  / 2) - ($watermark_source_width  / 2));
+          $watermark_destination_y = round(($img_source_height / 2) - ($watermark_source_height / 2));
+          break;
+
+        case 'TL':
+          $watermark_destination_x = $watermark_margin_x;
+          $watermark_destination_y = $watermark_margin_y;
+          break;
+
+        case 'TR':
+          $watermark_destination_x = round(($img_source_width - $watermark_source_width)  * $watermark_margin_percent);
+          $watermark_destination_y = $watermark_margin_y;
+          break;
+
+        case 'BL':
+          $watermark_destination_x = $watermark_margin_x;
+          $watermark_destination_y = round(($img_source_height - $watermark_source_height) * $watermark_margin_percent);
+          break;
+
+        case 'BR':
+        default:
+          $watermark_destination_x = round(($img_source_width  - $watermark_source_width)  * $watermark_margin_percent);
+          $watermark_destination_y = round(($img_source_height - $watermark_source_height) * $watermark_margin_percent);
+          break;
+      }
+      ImageAlphaBlending($gdimg_dest, false);
+      ImageSaveAlpha($gdimg_dest, true);
+      ImageSaveAlpha($img_watermark, true);
+      phpthumb_functions::ImageCopyRespectAlpha($gdimg_dest, $img_watermark, $watermark_destination_x, $watermark_destination_y, 0, 0, $watermark_source_width, $watermark_source_height, $watermark_opacity_percent);
+
+      return true;
+    }
+    return false;
+  }
+
+
+  function DebugMessage($message, $file='', $line='') {
+    if (is_object($this->phpThumbObject)) {
+      return $this->phpThumbObject->DebugMessage($message, $file, $line);
+    }
+    return false;
+  }
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.functions.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.functions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.functions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,836 @@
+<?php
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+// phpthumb.functions.php - general support functions       //
+//                                                         ///
+//////////////////////////////////////////////////////////////
+
+class phpthumb_functions {
+
+  function user_function_exists($functionname) {
+    if (function_exists('get_defined_functions')) {
+      static $get_defined_functions = array();
+      if (empty($get_defined_functions)) {
+        $get_defined_functions = get_defined_functions();
+      }
+      return in_array(strtolower($functionname), $get_defined_functions['user']);
+    }
+    return function_exists($functionname);
+  }
+
+
+  function builtin_function_exists($functionname) {
+    if (function_exists('get_defined_functions')) {
+      static $get_defined_functions = array();
+      if (empty($get_defined_functions)) {
+        $get_defined_functions = get_defined_functions();
+      }
+      return in_array(strtolower($functionname), $get_defined_functions['internal']);
+    }
+    return function_exists($functionname);
+  }
+
+
+  function version_compare_replacement_sub($version1, $version2, $operator='') {
+    // If you specify the third optional operator argument, you can test for a particular relationship.
+    // The possible operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively.
+    // Using this argument, the function will return 1 if the relationship is the one specified by the operator, 0 otherwise.
+
+    // If a part contains special version strings these are handled in the following order: dev < (alpha = a) < (beta = b) < RC < pl
+    static $versiontype_lookup = array();
+    if (empty($versiontype_lookup)) {
+      $versiontype_lookup['dev']   = 10001;
+      $versiontype_lookup['a']     = 10002;
+      $versiontype_lookup['alpha'] = 10002;
+      $versiontype_lookup['b']     = 10003;
+      $versiontype_lookup['beta']  = 10003;
+      $versiontype_lookup['RC']    = 10004;
+      $versiontype_lookup['pl']    = 10005;
+    }
+    if (isset($versiontype_lookup[$version1])) {
+      $version1 = $versiontype_lookup[$version1];
+    }
+    if (isset($versiontype_lookup[$version2])) {
+      $version2 = $versiontype_lookup[$version2];
+    }
+
+    switch ($operator) {
+      case '<':
+      case 'lt':
+        return intval($version1 < $version2);
+        break;
+      case '<=':
+      case 'le':
+        return intval($version1 <= $version2);
+        break;
+      case '>':
+      case 'gt':
+        return intval($version1 > $version2);
+        break;
+      case '>=':
+      case 'ge':
+        return intval($version1 >= $version2);
+        break;
+      case '==':
+      case '=':
+      case 'eq':
+        return intval($version1 == $version2);
+        break;
+      case '!=':
+      case '<>':
+      case 'ne':
+        return intval($version1 != $version2);
+        break;
+    }
+    if ($version1 == $version2) {
+      return 0;
+    } elseif ($version1 < $version2) {
+      return -1;
+    }
+    return 1;
+  }
+
+
+  function version_compare_replacement($version1, $version2, $operator='') {
+    if (function_exists('version_compare')) {
+      // built into PHP v4.1.0+
+      return version_compare($version1, $version2, $operator);
+    }
+
+    // The function first replaces _, - and + with a dot . in the version strings
+    $version1 = strtr($version1, '_-+', '...');
+    $version2 = strtr($version2, '_-+', '...');
+
+    // and also inserts dots . before and after any non number so that for example '4.3.2RC1' becomes '4.3.2.RC.1'.
+    // Then it splits the results like if you were using explode('.',$ver). Then it compares the parts starting from left to right.
+    $version1 = eregi_replace('([0-9]+)([A-Z]+)([0-9]+)', '\\1.\\2.\\3', $version1);
+    $version2 = eregi_replace('([0-9]+)([A-Z]+)([0-9]+)', '\\1.\\2.\\3', $version2);
+
+    $parts1 = explode('.', $version1);
+    $parts2 = explode('.', $version1);
+    $parts_count = max(count($parts1), count($parts2));
+    for ($i = 0; $i < $parts_count; $i++) {
+      $comparison = phpthumb_functions::version_compare_replacement_sub($version1, $version2, $operator);
+      if ($comparison != 0) {
+        return $comparison;
+      }
+    }
+    return 0;
+  }
+
+
+  function phpinfo_array() {
+    static $phpinfo_array = array();
+    if (empty($phpinfo_array)) {
+      ob_start();
+      phpinfo();
+      $phpinfo = ob_get_contents();
+      ob_end_clean();
+      $phpinfo_array = explode("\n", $phpinfo);
+    }
+    return $phpinfo_array;
+  }
+
+
+  function exif_info() {
+    static $exif_info = array();
+    if (empty($exif_info)) {
+      // based on code by johnschaefer at gmx dot de
+      // from PHP help on gd_info()
+      $exif_info = array(
+        'EXIF Support'           => '',
+        'EXIF Version'           => '',
+        'Supported EXIF Version' => '',
+        'Supported filetypes'    => ''
+      );
+      $phpinfo_array = phpthumb_functions::phpinfo_array();
+      foreach ($phpinfo_array as $dummy => $line) {
+        $line = trim(strip_tags($line));
+        foreach ($exif_info as $key => $value) {
+          if (strpos($line, $key) === 0) {
+            $newvalue = trim(str_replace($key, '', $line));
+            $exif_info[$key] = $newvalue;
+          }
+        }
+      }
+    }
+    return $exif_info;
+  }
+
+
+  function ImageTypeToMIMEtype($imagetype) {
+    if (function_exists('image_type_to_mime_type') && ($imagetype >= 1) && ($imagetype <= 16)) {
+      // PHP v4.3.0+
+      return image_type_to_mime_type($imagetype);
+    }
+    static $image_type_to_mime_type = array(
+      1  => 'image/gif',                     // IMAGETYPE_GIF
+      2  => 'image/jpeg',                    // IMAGETYPE_JPEG
+      3  => 'image/png',                     // IMAGETYPE_PNG
+      4  => 'application/x-shockwave-flash', // IMAGETYPE_SWF
+      5  => 'image/psd',                     // IMAGETYPE_PSD
+      6  => 'image/bmp',                     // IMAGETYPE_BMP
+      7  => 'image/tiff',                    // IMAGETYPE_TIFF_II (intel byte order)
+      8  => 'image/tiff',                    // IMAGETYPE_TIFF_MM (motorola byte order)
+      9  => 'application/octet-stream',      // IMAGETYPE_JPC
+      10 => 'image/jp2',                     // IMAGETYPE_JP2
+      11 => 'application/octet-stream',      // IMAGETYPE_JPX
+      12 => 'application/octet-stream',      // IMAGETYPE_JB2
+      13 => 'application/x-shockwave-flash', // IMAGETYPE_SWC
+      14 => 'image/iff',                     // IMAGETYPE_IFF
+      15 => 'image/vnd.wap.wbmp',            // IMAGETYPE_WBMP
+      16 => 'image/xbm',                     // IMAGETYPE_XBM
+
+      'gif'  => 'image/gif',                 // IMAGETYPE_GIF
+      'jpg'  => 'image/jpeg',                // IMAGETYPE_JPEG
+      'jpeg' => 'image/jpeg',                // IMAGETYPE_JPEG
+      'png'  => 'image/png',                 // IMAGETYPE_PNG
+      'bmp'  => 'image/bmp',                 // IMAGETYPE_BMP
+      'ico'  => 'image/x-icon',
+    );
+
+    return (isset($image_type_to_mime_type[$imagetype]) ? $image_type_to_mime_type[$imagetype] : false);
+  }
+
+
+  function HexCharDisplay($string) {
+    $len = strlen($string);
+    $output = '';
+    for ($i = 0; $i < $len; $i++) {
+      $output .= ' 0x'.str_pad(dechex(ord($string{$i})), 2, '0', STR_PAD_LEFT);
+    }
+    return $output;
+  }
+
+
+  function IsHexColor($HexColorString) {
+    return eregi('^[0-9A-F]{6}$', $HexColorString);
+  }
+
+
+  function ImageColorAllocateAlphaSafe(&$gdimg_hexcolorallocate, $R, $G, $B, $alpha=false) {
+    if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.2', '>=') && ($alpha !== false)) {
+      return ImageColorAllocateAlpha($gdimg_hexcolorallocate, $R, $G, $B, intval($alpha));
+    } else {
+      return ImageColorAllocate($gdimg_hexcolorallocate, $R, $G, $B);
+    }
+  }
+
+  function ImageHexColorAllocate(&$gdimg_hexcolorallocate, $HexColorString, $dieOnInvalid=false, $alpha=false) {
+    if (!is_resource($gdimg_hexcolorallocate)) {
+      die('$gdimg_hexcolorallocate is not a GD resource in ImageHexColorAllocate()');
+    }
+    if (phpthumb_functions::IsHexColor($HexColorString)) {
+      $R = hexdec(substr($HexColorString, 0, 2));
+      $G = hexdec(substr($HexColorString, 2, 2));
+      $B = hexdec(substr($HexColorString, 4, 2));
+      return phpthumb_functions::ImageColorAllocateAlphaSafe($gdimg_hexcolorallocate, $R, $G, $B, $alpha);
+    }
+    if ($dieOnInvalid) {
+      die('Invalid hex color string: "'.$HexColorString.'"');
+    }
+    return ImageColorAllocate($gdimg_hexcolorallocate, 0x00, 0x00, 0x00);
+  }
+
+
+  function HexColorXOR($hexcolor) {
+    return strtoupper(str_pad(dechex(~hexdec($hexcolor) & 0xFFFFFF), 6, '0', STR_PAD_LEFT));
+  }
+
+
+  function GetPixelColor(&$img, $x, $y) {
+    if (!is_resource($img)) {
+      return false;
+    }
+    return @ImageColorsForIndex($img, @ImageColorAt($img, $x, $y));
+  }
+
+
+  function GrayscaleValue($r, $g, $b) {
+    return round(($r * 0.30) + ($g * 0.59) + ($b * 0.11));
+  }
+
+
+  function GrayscalePixel($OriginalPixel) {
+    $gray = phpthumb_functions::GrayscaleValue($OriginalPixel['red'], $OriginalPixel['green'], $OriginalPixel['blue']);
+    return array('red'=>$gray, 'green'=>$gray, 'blue'=>$gray);
+  }
+
+
+  function GrayscalePixelRGB($rgb) {
+    $r = ($rgb >> 16) & 0xFF;
+    $g = ($rgb >>  8) & 0xFF;
+    $b =  $rgb        & 0xFF;
+    return ($r * 0.299) + ($g * 0.587) + ($b * 0.114);
+  }
+
+
+  function ImageCopyResampleBicubic($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {
+    // ron at korving dot demon dot nl
+    // http://www.php.net/imagecopyresampled
+
+    $scaleX = ($src_w - 1) / $dst_w;
+    $scaleY = ($src_h - 1) / $dst_h;
+
+    $scaleX2 = $scaleX / 2.0;
+    $scaleY2 = $scaleY / 2.0;
+
+    $isTrueColor = ImageIsTrueColor($src_img);
+
+    for ($y = $src_y; $y < $src_y + $dst_h; $y++) {
+      $sY   = $y * $scaleY;
+      $siY  = (int) $sY;
+      $siY2 = (int) $sY + $scaleY2;
+
+      for ($x = $src_x; $x < $src_x + $dst_w; $x++) {
+        $sX   = $x * $scaleX;
+        $siX  = (int) $sX;
+        $siX2 = (int) $sX + $scaleX2;
+
+        if ($isTrueColor) {
+
+          $c1 = ImageColorAt($src_img, $siX, $siY2);
+          $c2 = ImageColorAt($src_img, $siX, $siY);
+          $c3 = ImageColorAt($src_img, $siX2, $siY2);
+          $c4 = ImageColorAt($src_img, $siX2, $siY);
+
+          $r = (( $c1             +  $c2             +  $c3             +  $c4            ) >> 2) & 0xFF0000;
+          $g = ((($c1 & 0x00FF00) + ($c2 & 0x00FF00) + ($c3 & 0x00FF00) + ($c4 & 0x00FF00)) >> 2) & 0x00FF00;
+          $b = ((($c1 & 0x0000FF) + ($c2 & 0x0000FF) + ($c3 & 0x0000FF) + ($c4 & 0x0000FF)) >> 2);
+
+        } else {
+
+          $c1 = ImageColorsForIndex($src_img, ImageColorAt($src_img, $siX, $siY2));
+          $c2 = ImageColorsForIndex($src_img, ImageColorAt($src_img, $siX, $siY));
+          $c3 = ImageColorsForIndex($src_img, ImageColorAt($src_img, $siX2, $siY2));
+          $c4 = ImageColorsForIndex($src_img, ImageColorAt($src_img, $siX2, $siY));
+
+          $r = ($c1['red']   + $c2['red']   + $c3['red']   + $c4['red'] )  << 14;
+          $g = ($c1['green'] + $c2['green'] + $c3['green'] + $c4['green']) <<  6;
+          $b = ($c1['blue']  + $c2['blue']  + $c3['blue']  + $c4['blue'] ) >>  2;
+
+        }
+        ImageSetPixel($dst_img, $dst_x + $x - $src_x, $dst_y + $y - $src_y, $r+$g+$b);
+      }
+    }
+    return true;
+  }
+
+
+  function ImageCreateFunction($x_size, $y_size) {
+    $ImageCreateFunction = 'ImageCreate';
+    if (phpthumb_functions::gd_version() >= 2.0) {
+      $ImageCreateFunction = 'ImageCreateTrueColor';
+    }
+    if (!function_exists($ImageCreateFunction)) {
+      return phpthumb::ErrorImage($ImageCreateFunction.'() does not exist - no GD support?');
+    }
+    if (($x_size <= 0) || ($y_size <= 0)) {
+      return phpthumb::ErrorImage('Invalid image dimensions: '.$ImageCreateFunction.'('.$x_size.', '.$y_size.')');
+    }
+    return $ImageCreateFunction($x_size, $y_size);
+  }
+
+
+  function ImageCopyRespectAlpha(&$dst_im, &$src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct=100) {
+    for ($x = $src_x; $x < $src_w; $x++) {
+      for ($y = $src_y; $y < $src_h; $y++) {
+        $RealPixel    = phpthumb_functions::GetPixelColor($dst_im, $dst_x + $x, $dst_y + $y);
+        $OverlayPixel = phpthumb_functions::GetPixelColor($src_im, $x, $y);
+        $alphapct = $OverlayPixel['alpha'] / 127;
+        $opacipct = $pct / 100;
+        $overlaypct = (1 - $alphapct) * $opacipct;
+
+        $newcolor = phpthumb_functions::ImageColorAllocateAlphaSafe(
+          $dst_im,
+          round($RealPixel['red']   * (1 - $overlaypct)) + ($OverlayPixel['red']   * $overlaypct),
+          round($RealPixel['green'] * (1 - $overlaypct)) + ($OverlayPixel['green'] * $overlaypct),
+          round($RealPixel['blue']  * (1 - $overlaypct)) + ($OverlayPixel['blue']  * $overlaypct),
+          //$RealPixel['alpha']);
+          0);
+
+        ImageSetPixel($dst_im, $dst_x + $x, $dst_y + $y, $newcolor);
+      }
+    }
+    return true;
+  }
+
+
+  function ProportionalResize($old_width, $old_height, $new_width=false, $new_height=false) {
+    $old_aspect_ratio = $old_width / $old_height;
+    if (($new_width === false) && ($new_height === false)) {
+      return false;
+    } elseif ($new_width === false) {
+      $new_width = $new_height * $old_aspect_ratio;
+    } elseif ($new_height === false) {
+      $new_height = $new_width / $old_aspect_ratio;
+    }
+    $new_aspect_ratio = $new_width / $new_height;
+    if ($new_aspect_ratio == $old_aspect_ratio) {
+      // great, done
+    } elseif ($new_aspect_ratio < $old_aspect_ratio) {
+      // limited by width
+      $new_height = $new_width / $old_aspect_ratio;
+    } elseif ($new_aspect_ratio > $old_aspect_ratio) {
+      // limited by height
+      $new_width = $new_height * $old_aspect_ratio;
+    }
+    return array(round($new_width), round($new_height));
+  }
+
+
+  function FunctionIsDisabled($function) {
+    static $DisabledFunctions = null;
+    if (is_null($DisabledFunctions)) {
+      $disable_functions_local  = explode(',',     @ini_get('disable_functions'));
+      $disable_functions_global = explode(',', @get_cfg_var('disable_functions'));
+      foreach ($disable_functions_local as $key => $value) {
+        $DisabledFunctions[$value] = 'local';
+      }
+      foreach ($disable_functions_global as $key => $value) {
+        $DisabledFunctions[$value] = 'global';
+      }
+      if (@ini_get('safe_mode')) {
+        $DisabledFunctions['shell_exec'] = 'local';
+      }
+    }
+    return isset($DisabledFunctions[$function]);
+  }
+
+
+  function SafeExec($command) {
+    static $AllowedExecFunctions = array();
+    if (empty($AllowedExecFunctions)) {
+      $AllowedExecFunctions = array('shell_exec'=>true, 'passthru'=>true, 'system'=>true, 'exec'=>true);
+      foreach ($AllowedExecFunctions as $key => $value) {
+        //$AllowedExecFunctions[$key] = !phpthumb_functions::FunctionIsDisabled($key);
+      }
+    }
+    foreach ($AllowedExecFunctions as $execfunction => $is_allowed) {
+      if (!$is_allowed) {
+        continue;
+      }
+      switch ($execfunction) {
+        case 'passthru':
+          ob_start();
+          $execfunction($command);
+          $returnvalue = ob_get_contents();
+          ob_end_clean();
+          break;
+
+        case 'shell_exec':
+        case 'system':
+        case 'exec':
+        default:
+          ob_start();
+          $returnvalue = $execfunction($command);
+          ob_end_clean();
+          break;
+      }
+      return $returnvalue;
+    }
+    return false;
+  }
+
+
+  function ApacheLookupURIarray($filename) {
+    // apache_lookup_uri() only works when PHP is installed as an Apache module.
+    if (php_sapi_name() == 'apache') {
+      $keys = array('status', 'the_request', 'status_line', 'method', 'content_type', 'handler', 'uri', 'filename', 'path_info', 'args', 'boundary', 'no_cache', 'no_local_copy', 'allowed', 'send_bodyct', 'bytes_sent', 'byterange', 'clength', 'unparsed_uri', 'mtime', 'request_time');
+      if ($apacheLookupURIobject = @apache_lookup_uri($filename)) {
+        $apacheLookupURIarray = array();
+        foreach ($keys as $dummy => $key) {
+          $apacheLookupURIarray[$key] = @$apacheLookupURIobject->$key;
+        }
+        return $apacheLookupURIarray;
+      }
+    }
+    return false;
+  }
+
+
+  function gd_is_bundled() {
+    static $isbundled = null;
+    if (is_null($isbundled)) {
+      $gd_info = gd_info();
+      $isbundled = (strpos($gd_info['GD Version'], 'bundled') !== false);
+    }
+    return $isbundled;
+  }
+
+
+  function gd_version($fullstring=false) {
+    static $cache_gd_version = array();
+    if (empty($cache_gd_version)) {
+      $gd_info = gd_info();
+      if (eregi('bundled \((.+)\)$', $gd_info['GD Version'], $matches)) {
+        $cache_gd_version[1] = $gd_info['GD Version'];  // e.g. "bundled (2.0.15 compatible)"
+        $cache_gd_version[0] = (float) $matches[1];     // e.g. "2.0" (not "bundled (2.0.15 compatible)")
+      } else {
+        $cache_gd_version[1] = $gd_info['GD Version'];                       // e.g. "1.6.2 or higher"
+        $cache_gd_version[0] = (float) substr($gd_info['GD Version'], 0, 3); // e.g. "1.6" (not "1.6.2 or higher")
+      }
+    }
+    return $cache_gd_version[intval($fullstring)];
+  }
+
+
+  function filesize_remote($remotefile, $timeout=10) {
+    $size = false;
+    $url = parse_url($remotefile);
+    if ($fp = @fsockopen($url['host'], ($url['port'] ? $url['port'] : 80), $errno, $errstr, $timeout)) {
+      fwrite($fp, 'HEAD '.@$url['path'].@$url['query'].' HTTP/1.0'."\r\n".'Host: '.@$url['host']."\r\n\r\n");
+      if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=')) {
+        stream_set_timeout($fp, $timeout);
+      }
+      while (!feof($fp)) {
+        $headerline = fgets($fp, 4096);
+        if (eregi('^Content-Length: (.*)', $headerline, $matches)) {
+          $size = intval($matches[1]);
+          break;
+        }
+      }
+      fclose ($fp);
+    }
+    return $size;
+  }
+
+
+  function filedate_remote($remotefile, $timeout=10) {
+    $date = false;
+    $url = parse_url($remotefile);
+    if ($fp = @fsockopen($url['host'], ($url['port'] ? $url['port'] : 80), $errno, $errstr, $timeout)) {
+      fwrite($fp, 'HEAD '.@$url['path'].@$url['query'].' HTTP/1.0'."\r\n".'Host: '.@$url['host']."\r\n\r\n");
+      if (phpthumb_functions::version_compare_replacement(phpversion(), '4.3.0', '>=')) {
+        stream_set_timeout($fp, $timeout);
+      }
+      while (!feof($fp)) {
+        $headerline = fgets($fp, 4096);
+        if (eregi('^Last-Modified: (.*)', $headerline, $matches)) {
+          $date = strtotime($matches[1]) - date('Z');
+          break;
+        }
+      }
+      fclose ($fp);
+    }
+    return $date;
+  }
+
+
+  function md5_file_safe($filename) {
+    // md5_file() doesn't exist in PHP < 4.2.0
+    if (function_exists('md5_file')) {
+      return md5_file($filename);
+    }
+    if ($fp = @fopen($filename, 'rb')) {
+      $rawData = '';
+      do {
+        $buffer = fread($fp, 8192);
+        $rawData .= $buffer;
+      } while (strlen($buffer) > 0);
+      fclose($fp);
+      return md5($rawData);
+    }
+    return false;
+  }
+
+
+  function nonempty_min() {
+    $arg_list = func_get_args();
+    $acceptable = array();
+    foreach ($arg_list as $dummy => $arg) {
+      if ($arg) {
+        $acceptable[] = $arg;
+      }
+    }
+    return min($acceptable);
+  }
+
+
+  function LittleEndian2String($number, $minbytes=1) {
+    $intstring = '';
+    while ($number > 0) {
+      $intstring = $intstring.chr($number & 255);
+      $number >>= 8;
+    }
+    return str_pad($intstring, $minbytes, "\x00", STR_PAD_RIGHT);
+  }
+
+  function OneOfThese() {
+    // return the first useful (non-empty/non-zero/non-false) value from those passed
+    $arg_list = func_get_args();
+    foreach ($arg_list as $key => $value) {
+      if ($value) {
+        return $value;
+      }
+    }
+    return false;
+  }
+
+  function CaseInsensitiveInArray($needle, $haystack) {
+    $needle = strtolower($needle);
+    foreach ($haystack as $key => $value) {
+      if (is_array($value)) {
+        // skip?
+      } elseif ($needle == strtolower($value)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  function URLreadFsock($host, $file, &$errstr, $successonly=true, $port=80, $timeout=10) {
+    if (!function_exists('fsockopen') || phpthumb_functions::FunctionIsDisabled('fsockopen')) {
+      $errstr = 'fsockopen() unavailable';
+      return false;
+    }
+    if ($fp = @fsockopen($host, 80, $errno, $errstr, 15)) {
+      $out  = 'GET '.$file.' HTTP/1.0'."\r\n";
+      $out .= 'Host: '.$host."\r\n";
+      $out .= 'Connection: Close'."\r\n\r\n";
+      fwrite($fp, $out);
+
+      $isHeader = true;
+      $Data_header = '';
+      $Data_body   = '';
+      $header_newlocation = '';
+      while (!feof($fp)) {
+        $line = fgets($fp, 1024);
+        if ($isHeader) {
+          $Data_header .= $line;
+        } else {
+          $Data_body .= $line;
+        }
+        if (eregi('^HTTP/[\\.0-9]+ ([0-9]+) (.+)$', rtrim($line), $matches)) {
+          list($dummy, $errno, $errstr) = $matches;
+          $errno = intval($errno);
+        } elseif (eregi('^Location: (.*)$', rtrim($line), $matches)) {
+          $header_newlocation = $matches[1];
+        }
+        if ($isHeader && ($line == "\r\n")) {
+          $isHeader = false;
+          if ($successonly) {
+            if ($errno == 200) {
+              // great, continue
+            } else {
+              $errstr = $errno.' '.$errstr.($header_newlocation ? '; Location: '.$header_newlocation : '');
+              fclose($fp);
+              return false;
+            }
+          }
+        }
+      }
+      fclose($fp);
+      return $Data_body;
+    }
+    return null;
+  }
+
+  function SafeURLread($url, &$error) {
+    $error = '';
+
+    $parsed_url = @parse_url($url);
+    $rawData = phpthumb_functions::URLreadFsock(@$parsed_url['host'], @$parsed_url['path'], $errstr, true, (@$parsed_url['port'] ? @$parsed_url['port'] : 80));
+    $error .= 'Error: '.$errstr."\n".$url;
+    if ($rawData === false) {
+      return false;
+    } elseif ($rawData === null) {
+      // fall through
+    } else {
+      return $rawData;
+    }
+
+    $BrokenURLfopenPHPversions = array('4.4.2');
+    if (in_array(phpversion(), $BrokenURLfopenPHPversions)) {
+      $error .= 'fopen(URL) broken in PHP v'.phpversion().'; ';
+    } elseif (@ini_get('allow_url_fopen')) {
+      $rawData = '';
+      ob_start();
+      if ($fp = fopen($url, 'rb')) {
+        do {
+          $buffer = fread($fp, 8192);
+          $rawData .= $buffer;
+        } while (strlen($buffer) > 0);
+        fclose($fp);
+      } else {
+        $error .= trim(strip_tags(ob_get_contents()));
+      }
+      ob_end_clean();
+      if (!$error) {
+        return $rawData;
+      }
+      $error .= '; "allow_url_fopen" enabled but returned no data; ';
+    } else {
+      $error .= '"allow_url_fopen" disabled; ';
+    }
+
+    if (function_exists('curl_version') && !phpthumb_functions::FunctionIsDisabled('curl_exec')) {
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, $url);
+      curl_setopt($ch, CURLOPT_HEADER, false);
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+      curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
+      $rawData = curl_exec($ch);
+      curl_close($ch);
+      if (strlen($rawData) > 0) {
+        return $rawData;
+      }
+      $error .= 'CURL available but returned no data; ';
+    } else {
+      $error .= 'CURL unavailable; ';
+    }
+    return false;
+  }
+
+}
+
+
+if (!function_exists('gd_info')) {
+  // built into PHP v4.3.0+ (with bundled GD2 library)
+  function gd_info() {
+    static $gd_info = array();
+    if (empty($gd_info)) {
+      // based on code by johnschaefer at gmx dot de
+      // from PHP help on gd_info()
+      $gd_info = array(
+        'GD Version'         => '',
+        'FreeType Support'   => false,
+        'FreeType Linkage'   => '',
+        'T1Lib Support'      => false,
+        'GIF Read Support'   => false,
+        'GIF Create Support' => false,
+        'JPG Support'        => false,
+        'PNG Support'        => false,
+        'WBMP Support'       => false,
+        'XBM Support'        => false
+      );
+      $phpinfo_array = phpthumb_functions::phpinfo_array();
+      foreach ($phpinfo_array as $dummy => $line) {
+        $line = trim(strip_tags($line));
+        foreach ($gd_info as $key => $value) {
+          //if (strpos($line, $key) !== false) {
+          if (strpos($line, $key) === 0) {
+            $newvalue = trim(str_replace($key, '', $line));
+            $gd_info[$key] = $newvalue;
+          }
+        }
+      }
+      if (empty($gd_info['GD Version'])) {
+        // probable cause: "phpinfo() disabled for security reasons"
+        if (function_exists('ImageTypes')) {
+          $imagetypes = ImageTypes();
+          if ($imagetypes & IMG_PNG) {
+            $gd_info['PNG Support'] = true;
+          }
+          if ($imagetypes & IMG_GIF) {
+            $gd_info['GIF Create Support'] = true;
+          }
+          if ($imagetypes & IMG_JPG) {
+            $gd_info['JPG Support'] = true;
+          }
+          if ($imagetypes & IMG_WBMP) {
+            $gd_info['WBMP Support'] = true;
+          }
+        }
+        // to determine capability of GIF creation, try to use ImageCreateFromGIF on a 1px GIF
+        if (function_exists('ImageCreateFromGIF')) {
+          if ($tempfilename = phpthumb::phpThumb_tempnam()) {
+            if ($fp_tempfile = @fopen($tempfilename, 'wb')) {
+              fwrite($fp_tempfile, base64_decode('R0lGODlhAQABAIAAAH//AP///ywAAAAAAQABAAACAUQAOw==')); // very simple 1px GIF file base64-encoded as string
+              fclose($fp_tempfile);
+
+              // if we can convert the GIF file to a GD image then GIF create support must be enabled, otherwise it's not
+              $gd_info['GIF Read Support'] = (bool) @ImageCreateFromGIF($tempfilename);
+            }
+            unlink($tempfilename);
+          }
+        }
+        if (function_exists('ImageCreateTrueColor') && @ImageCreateTrueColor(1, 1)) {
+          $gd_info['GD Version'] = '2.0.1 or higher (assumed)';
+        } elseif (function_exists('ImageCreate') && @ImageCreate(1, 1)) {
+          $gd_info['GD Version'] = '1.6.0 or higher (assumed)';
+        }
+      }
+    }
+    return $gd_info;
+  }
+}
+
+
+if (!function_exists('is_executable')) {
+  // in PHP v3+, but v5.0+ for Windows
+  function is_executable($filename) {
+    // poor substitute, but better than nothing
+    return file_exists($filename);
+  }
+}
+
+
+if (!function_exists('preg_quote')) {
+  // included in PHP v3.0.9+, but may be unavailable if not compiled in
+  function preg_quote($string, $delimiter='\\') {
+    static $preg_quote_array = array();
+    if (empty($preg_quote_array)) {
+      $escapeables = '.\\+*?[^]$(){}=!<>|:';
+      for ($i = 0; $i < strlen($escapeables); $i++) {
+        $strtr_preg_quote[$escapeables{$i}] = $delimiter.$escapeables{$i};
+      }
+    }
+    return strtr($string, $strtr_preg_quote);
+  }
+}
+
+if (!function_exists('file_get_contents')) {
+  // included in PHP v4.3.0+
+  function file_get_contents($filename) {
+    if (eregi('^(f|ht)tp\://', $filename)) {
+      return SafeURLread($filename);
+    }
+    if ($fp = @fopen($filename, 'rb')) {
+      $rawData = '';
+      do {
+        $buffer = fread($fp, 8192);
+        $rawData .= $buffer;
+      } while (strlen($buffer) > 0);
+      fclose($fp);
+      return $rawData;
+    }
+    return false;
+  }
+}
+
+
+if (!function_exists('file_put_contents')) {
+  // included in PHP v5.0.0+
+  function file_put_contents($filename, $filedata) {
+    if ($fp = @fopen($filename, 'wb')) {
+      fwrite($fp, $filedata);
+      fclose($fp);
+      return true;
+    }
+    return false;
+  }
+}
+
+if (!function_exists('imagealphablending')) {
+  // built-in function requires PHP v4.0.6+ *and* GD v2.0.1+
+  function imagealphablending(&$img, $blendmode=true) {
+    // do nothing, this function is declared here just to
+    // prevent runtime errors if GD2 is not available
+    return true;
+  }
+}
+
+if (!function_exists('imagesavealpha')) {
+  // built-in function requires PHP v4.3.2+ *and* GD v2.0.1+
+  function imagesavealpha(&$img, $blendmode=true) {
+    // do nothing, this function is declared here just to
+    // prevent runtime errors if GD2 is not available
+    return true;
+  }
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.gif.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.gif.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.gif.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1168 @@
+<?php
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// GIF Util - (C) 2003 Yamasoft (S/C)
+// http://www.yamasoft.com
+// All Rights Reserved
+// This file can be freely copied, distributed, modified, updated by anyone under the only
+// condition to leave the original address (Yamasoft, http://www.yamasoft.com) and this header.
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// <gif>  = gif_loadFile(filename, [index])
+// <bool> = gif_getSize(<gif> or filename, &width, &height)
+// <bool> = gif_outputAsPng(<gif>, filename, [bgColor])
+// <bool> = gif_outputAsBmp(<gif>, filename, [bgcolor])
+// <bool> = gif_outputAsJpeg(<gif>, filename, [bgcolor]) - use cjpeg if available otherwise uses GD
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Original code by Fabien Ezber
+// Modified by James Heinrich <info at silisoftware.com> for use in phpThumb() - December 10, 2003
+// * Added function gif_loadFileToGDimageResource() - this returns a GD image resource
+// * Modified gif_outputAsJpeg() to check if it's running under Windows, or if cjpeg is not
+//   available, in which case it will attempt to output JPEG using GD functions
+// * added @ error-suppression to two lines where it checks: if ($this->m_img->m_bTrans)
+//   otherwise warnings are generated if error_reporting == E_ALL
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+function gif_loadFile($lpszFileName, $iIndex = 0)
+{
+  $gif = new CGIF();
+  if ($gif->loadFile($lpszFileName, $iIndex)) {
+    return $gif;
+  }
+  return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Added by James Heinrich <info at silisoftware.com> - December 10, 2003
+function gif_loadFileToGDimageResource($gifFilename, $bgColor = -1)
+{
+  if ($gif = gif_loadFile($gifFilename)) {
+
+    @set_time_limit(300);
+    // general strategy: convert raw data to PNG then convert PNG data to GD image resource
+    $PNGdata = $gif->getPng($bgColor);
+    if ($img = @ImageCreateFromString($PNGdata)) {
+
+      // excellent - PNG image data successfully converted to GD image
+      return $img;
+
+    } elseif ($img = $gif->getGD_PixelPlotterVersion()) {
+
+      // problem: ImageCreateFromString() didn't like the PNG image data.
+      //   This has been known to happen in PHP v4.0.6
+      // solution: take the raw image data and create a new GD image and plot
+      //   pixel-by-pixel on the GD image. This is extremely slow, but it does
+      //   work and a slow solution is better than no solution, right? :)
+      return $img;
+
+    }
+  }
+  return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+function gif_outputAsBmp($gif, $lpszFileName, $bgColor = -1)
+{
+  if (!isSet($gif) || (@get_class($gif) <> 'cgif') || !$gif->loaded() || ($lpszFileName == '')) {
+    return false;
+  }
+
+  $fd = $gif->getBmp($bgColor);
+  if (strlen($fd) <= 0) {
+    return false;
+  }
+
+  if (!($fh = @fopen($lpszFileName, 'wb'))) {
+    return false;
+  }
+  @fwrite($fh, $fd, strlen($fd));
+  @fflush($fh);
+  @fclose($fh);
+  return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+function gif_outputAsPng($gif, $lpszFileName, $bgColor = -1)
+{
+  if (!isSet($gif) || (@get_class($gif) <> 'cgif') || !$gif->loaded() || ($lpszFileName == '')) {
+    return false;
+  }
+
+  $fd = $gif->getPng($bgColor);
+  if (strlen($fd) <= 0) {
+    return false;
+  }
+
+  if (!($fh = @fopen($lpszFileName, 'wb'))) {
+    return false;
+  }
+  @fwrite($fh, $fd, strlen($fd));
+  @fflush($fh);
+  @fclose($fh);
+  return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+function gif_outputAsJpeg($gif, $lpszFileName, $bgColor = -1)
+{
+  // JPEG output that does not require cjpeg added by James Heinrich <info at silisoftware.com> - December 10, 2003
+  if ((strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') && (file_exists('/usr/local/bin/cjpeg') || `which cjpeg`)) {
+
+    if (gif_outputAsBmp($gif, $lpszFileName.'.bmp', $bgColor)) {
+      exec('cjpeg '.$lpszFileName.'.bmp >'.$lpszFileName.' 2>/dev/null');
+      @unLink($lpszFileName.'.bmp');
+
+      if (@file_exists($lpszFileName)) {
+        if (@fileSize($lpszFileName) > 0) {
+          return true;
+        }
+
+        @unLink($lpszFileName);
+      }
+    }
+
+  } else {
+
+    // either Windows, or cjpeg not found in path
+    if ($img = @ImageCreateFromString($gif->getPng($bgColor))) {
+      if (@ImageJPEG($img, $lpszFileName)) {
+        return true;
+      }
+    }
+
+  }
+
+  return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+function gif_getSize($gif, &$width, &$height)
+{
+  if (isSet($gif) && (@get_class($gif) == 'cgif') && $gif->loaded()) {
+    $width  = $gif->width();
+    $height = $gif->height();
+  } elseif (@file_exists($gif)) {
+    $myGIF = new CGIF();
+    if (!$myGIF->getSize($gif, $width, $height)) {
+      return false;
+    }
+  } else {
+    return false;
+  }
+
+  return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class CGIFLZW
+{
+  var $MAX_LZW_BITS;
+  var $Fresh, $CodeSize, $SetCodeSize, $MaxCode, $MaxCodeSize, $FirstCode, $OldCode;
+  var $ClearCode, $EndCode, $Next, $Vals, $Stack, $sp, $Buf, $CurBit, $LastBit, $Done, $LastByte;
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  // CONSTRUCTOR
+  function CGIFLZW()
+  {
+    $this->MAX_LZW_BITS = 12;
+    unSet($this->Next);
+    unSet($this->Vals);
+    unSet($this->Stack);
+    unSet($this->Buf);
+
+    $this->Next  = range(0, (1 << $this->MAX_LZW_BITS)       - 1);
+    $this->Vals  = range(0, (1 << $this->MAX_LZW_BITS)       - 1);
+    $this->Stack = range(0, (1 << ($this->MAX_LZW_BITS + 1)) - 1);
+    $this->Buf   = range(0, 279);
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function deCompress($data, &$datLen)
+  {
+    $stLen  = strlen($data);
+    $datLen = 0;
+    $ret    = '';
+
+    // INITIALIZATION
+    $this->LZWCommand($data, true);
+
+    while (($iIndex = $this->LZWCommand($data, false)) >= 0) {
+      $ret .= chr($iIndex);
+    }
+
+    $datLen = $stLen - strlen($data);
+
+    if ($iIndex != -2) {
+      return false;
+    }
+
+    return $ret;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function LZWCommand(&$data, $bInit)
+  {
+    if ($bInit) {
+      $this->SetCodeSize = ord($data{0});
+      $data = substr($data, 1);
+
+      $this->CodeSize    = $this->SetCodeSize + 1;
+      $this->ClearCode   = 1 << $this->SetCodeSize;
+      $this->EndCode     = $this->ClearCode + 1;
+      $this->MaxCode     = $this->ClearCode + 2;
+      $this->MaxCodeSize = $this->ClearCode << 1;
+
+      $this->GetCode($data, $bInit);
+
+      $this->Fresh = 1;
+      for ($i = 0; $i < $this->ClearCode; $i++) {
+        $this->Next[$i] = 0;
+        $this->Vals[$i] = $i;
+      }
+
+      for (; $i < (1 << $this->MAX_LZW_BITS); $i++) {
+        $this->Next[$i] = 0;
+        $this->Vals[$i] = 0;
+      }
+
+      $this->sp = 0;
+      return 1;
+    }
+
+    if ($this->Fresh) {
+      $this->Fresh = 0;
+      do {
+        $this->FirstCode = $this->GetCode($data, $bInit);
+        $this->OldCode   = $this->FirstCode;
+      }
+      while ($this->FirstCode == $this->ClearCode);
+
+      return $this->FirstCode;
+    }
+
+    if ($this->sp > 0) {
+      $this->sp--;
+      return $this->Stack[$this->sp];
+    }
+
+    while (($Code = $this->GetCode($data, $bInit)) >= 0) {
+      if ($Code == $this->ClearCode) {
+        for ($i = 0; $i < $this->ClearCode; $i++) {
+          $this->Next[$i] = 0;
+          $this->Vals[$i] = $i;
+        }
+
+        for (; $i < (1 << $this->MAX_LZW_BITS); $i++) {
+          $this->Next[$i] = 0;
+          $this->Vals[$i] = 0;
+        }
+
+        $this->CodeSize    = $this->SetCodeSize + 1;
+        $this->MaxCodeSize = $this->ClearCode << 1;
+        $this->MaxCode     = $this->ClearCode + 2;
+        $this->sp          = 0;
+        $this->FirstCode   = $this->GetCode($data, $bInit);
+        $this->OldCode     = $this->FirstCode;
+
+        return $this->FirstCode;
+      }
+
+      if ($Code == $this->EndCode) {
+        return -2;
+      }
+
+      $InCode = $Code;
+      if ($Code >= $this->MaxCode) {
+        $this->Stack[$this->sp] = $this->FirstCode;
+        $this->sp++;
+        $Code = $this->OldCode;
+      }
+
+      while ($Code >= $this->ClearCode) {
+        $this->Stack[$this->sp] = $this->Vals[$Code];
+        $this->sp++;
+
+        if ($Code == $this->Next[$Code]) // Circular table entry, big GIF Error!
+          return -1;
+
+        $Code = $this->Next[$Code];
+      }
+
+      $this->FirstCode = $this->Vals[$Code];
+      $this->Stack[$this->sp] = $this->FirstCode;
+      $this->sp++;
+
+      if (($Code = $this->MaxCode) < (1 << $this->MAX_LZW_BITS)) {
+        $this->Next[$Code] = $this->OldCode;
+        $this->Vals[$Code] = $this->FirstCode;
+        $this->MaxCode++;
+
+        if (($this->MaxCode >= $this->MaxCodeSize) && ($this->MaxCodeSize < (1 << $this->MAX_LZW_BITS))) {
+          $this->MaxCodeSize *= 2;
+          $this->CodeSize++;
+        }
+      }
+
+      $this->OldCode = $InCode;
+      if ($this->sp > 0) {
+        $this->sp--;
+        return $this->Stack[$this->sp];
+      }
+    }
+
+    return $Code;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function GetCode(&$data, $bInit)
+  {
+    if ($bInit) {
+      $this->CurBit   = 0;
+      $this->LastBit  = 0;
+      $this->Done     = 0;
+      $this->LastByte = 2;
+      return 1;
+    }
+
+    if (($this->CurBit + $this->CodeSize) >= $this->LastBit) {
+      if ($this->Done) {
+        if ($this->CurBit >= $this->LastBit) {
+          // Ran off the end of my bits
+          return 0;
+        }
+        return -1;
+      }
+
+      $this->Buf[0] = $this->Buf[$this->LastByte - 2];
+      $this->Buf[1] = $this->Buf[$this->LastByte - 1];
+
+      $Count = ord($data{0});
+      $data  = substr($data, 1);
+
+      if ($Count) {
+        for ($i = 0; $i < $Count; $i++) {
+          $this->Buf[2 + $i] = ord($data{$i});
+        }
+        $data = substr($data, $Count);
+      } else {
+        $this->Done = 1;
+      }
+
+      $this->LastByte = 2 + $Count;
+      $this->CurBit   = ($this->CurBit - $this->LastBit) + 16;
+      $this->LastBit  = (2 + $Count) << 3;
+    }
+
+    $iRet = 0;
+    for ($i = $this->CurBit, $j = 0; $j < $this->CodeSize; $i++, $j++) {
+      $iRet |= (($this->Buf[intval($i / 8)] & (1 << ($i % 8))) != 0) << $j;
+    }
+
+    $this->CurBit += $this->CodeSize;
+    return $iRet;
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class CGIFCOLORTABLE
+{
+  var $m_nColors;
+  var $m_arColors;
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  // CONSTRUCTOR
+  function CGIFCOLORTABLE()
+  {
+    unSet($this->m_nColors);
+    unSet($this->m_arColors);
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function load($lpData, $num)
+  {
+    $this->m_nColors  = 0;
+    $this->m_arColors = array();
+
+    for ($i = 0; $i < $num; $i++) {
+      $rgb = substr($lpData, $i * 3, 3);
+      if (strlen($rgb) < 3) {
+        return false;
+      }
+
+      $this->m_arColors[] = (ord($rgb{2}) << 16) + (ord($rgb{1}) << 8) + ord($rgb{0});
+      $this->m_nColors++;
+    }
+
+    return true;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function toString()
+  {
+    $ret = '';
+
+    for ($i = 0; $i < $this->m_nColors; $i++) {
+      $ret .=
+        chr(($this->m_arColors[$i] & 0x000000FF))       . // R
+        chr(($this->m_arColors[$i] & 0x0000FF00) >>  8) . // G
+        chr(($this->m_arColors[$i] & 0x00FF0000) >> 16);  // B
+    }
+
+    return $ret;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function toRGBQuad()
+  {
+    $ret = '';
+
+    for ($i = 0; $i < $this->m_nColors; $i++) {
+      $ret .=
+        chr(($this->m_arColors[$i] & 0x00FF0000) >> 16) . // B
+        chr(($this->m_arColors[$i] & 0x0000FF00) >>  8) . // G
+        chr(($this->m_arColors[$i] & 0x000000FF))       . // R
+        "\x00";
+    }
+
+    return $ret;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function colorIndex($rgb)
+  {
+    $rgb  = intval($rgb) & 0xFFFFFF;
+    $r1   = ($rgb & 0x0000FF);
+    $g1   = ($rgb & 0x00FF00) >>  8;
+    $b1   = ($rgb & 0xFF0000) >> 16;
+    $idx  = -1;
+
+    for ($i = 0; $i < $this->m_nColors; $i++) {
+      $r2 = ($this->m_arColors[$i] & 0x000000FF);
+      $g2 = ($this->m_arColors[$i] & 0x0000FF00) >>  8;
+      $b2 = ($this->m_arColors[$i] & 0x00FF0000) >> 16;
+      $d  = abs($r2 - $r1) + abs($g2 - $g1) + abs($b2 - $b1);
+
+      if (($idx == -1) || ($d < $dif)) {
+        $idx = $i;
+        $dif = $d;
+      }
+    }
+
+    return $idx;
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class CGIFFILEHEADER
+{
+  var $m_lpVer;
+  var $m_nWidth;
+  var $m_nHeight;
+  var $m_bGlobalClr;
+  var $m_nColorRes;
+  var $m_bSorted;
+  var $m_nTableSize;
+  var $m_nBgColor;
+  var $m_nPixelRatio;
+  var $m_colorTable;
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  // CONSTRUCTOR
+  function CGIFFILEHEADER()
+  {
+    unSet($this->m_lpVer);
+    unSet($this->m_nWidth);
+    unSet($this->m_nHeight);
+    unSet($this->m_bGlobalClr);
+    unSet($this->m_nColorRes);
+    unSet($this->m_bSorted);
+    unSet($this->m_nTableSize);
+    unSet($this->m_nBgColor);
+    unSet($this->m_nPixelRatio);
+    unSet($this->m_colorTable);
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function load($lpData, &$hdrLen)
+  {
+    $hdrLen = 0;
+
+    $this->m_lpVer = substr($lpData, 0, 6);
+    if (($this->m_lpVer <> 'GIF87a') && ($this->m_lpVer <> 'GIF89a')) {
+      return false;
+    }
+
+    $this->m_nWidth  = $this->w2i(substr($lpData, 6, 2));
+    $this->m_nHeight = $this->w2i(substr($lpData, 8, 2));
+    if (!$this->m_nWidth || !$this->m_nHeight) {
+      return false;
+    }
+
+    $b = ord(substr($lpData, 10, 1));
+    $this->m_bGlobalClr  = ($b & 0x80) ? true : false;
+    $this->m_nColorRes   = ($b & 0x70) >> 4;
+    $this->m_bSorted     = ($b & 0x08) ? true : false;
+    $this->m_nTableSize  = 2 << ($b & 0x07);
+    $this->m_nBgColor    = ord(substr($lpData, 11, 1));
+    $this->m_nPixelRatio = ord(substr($lpData, 12, 1));
+    $hdrLen = 13;
+
+    if ($this->m_bGlobalClr) {
+      $this->m_colorTable = new CGIFCOLORTABLE();
+      if (!$this->m_colorTable->load(substr($lpData, $hdrLen), $this->m_nTableSize)) {
+        return false;
+      }
+      $hdrLen += 3 * $this->m_nTableSize;
+    }
+
+    return true;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function w2i($str)
+  {
+    return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8);
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class CGIFIMAGEHEADER
+{
+  var $m_nLeft;
+  var $m_nTop;
+  var $m_nWidth;
+  var $m_nHeight;
+  var $m_bLocalClr;
+  var $m_bInterlace;
+  var $m_bSorted;
+  var $m_nTableSize;
+  var $m_colorTable;
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  // CONSTRUCTOR
+  function CGIFIMAGEHEADER()
+  {
+    unSet($this->m_nLeft);
+    unSet($this->m_nTop);
+    unSet($this->m_nWidth);
+    unSet($this->m_nHeight);
+    unSet($this->m_bLocalClr);
+    unSet($this->m_bInterlace);
+    unSet($this->m_bSorted);
+    unSet($this->m_nTableSize);
+    unSet($this->m_colorTable);
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function load($lpData, &$hdrLen)
+  {
+    $hdrLen = 0;
+
+    $this->m_nLeft   = $this->w2i(substr($lpData, 0, 2));
+    $this->m_nTop    = $this->w2i(substr($lpData, 2, 2));
+    $this->m_nWidth  = $this->w2i(substr($lpData, 4, 2));
+    $this->m_nHeight = $this->w2i(substr($lpData, 6, 2));
+
+    if (!$this->m_nWidth || !$this->m_nHeight) {
+      return false;
+    }
+
+    $b = ord($lpData{8});
+    $this->m_bLocalClr  = ($b & 0x80) ? true : false;
+    $this->m_bInterlace = ($b & 0x40) ? true : false;
+    $this->m_bSorted    = ($b & 0x20) ? true : false;
+    $this->m_nTableSize = 2 << ($b & 0x07);
+    $hdrLen = 9;
+
+    if ($this->m_bLocalClr) {
+      $this->m_colorTable = new CGIFCOLORTABLE();
+      if (!$this->m_colorTable->load(substr($lpData, $hdrLen), $this->m_nTableSize)) {
+        return false;
+      }
+      $hdrLen += 3 * $this->m_nTableSize;
+    }
+
+    return true;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function w2i($str)
+  {
+    return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8);
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class CGIFIMAGE
+{
+  var $m_disp;
+  var $m_bUser;
+  var $m_bTrans;
+  var $m_nDelay;
+  var $m_nTrans;
+  var $m_lpComm;
+  var $m_gih;
+  var $m_data;
+  var $m_lzw;
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function CGIFIMAGE()
+  {
+    unSet($this->m_disp);
+    unSet($this->m_bUser);
+    unSet($this->m_bTrans);
+    unSet($this->m_nDelay);
+    unSet($this->m_nTrans);
+    unSet($this->m_lpComm);
+    unSet($this->m_data);
+    $this->m_gih = new CGIFIMAGEHEADER();
+    $this->m_lzw = new CGIFLZW();
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function load($data, &$datLen)
+  {
+    $datLen = 0;
+
+    while (true) {
+      $b = ord($data{0});
+      $data = substr($data, 1);
+      $datLen++;
+
+      switch($b) {
+      case 0x21: // Extension
+        if (!$this->skipExt($data, $len = 0)) {
+          return false;
+        }
+        $datLen += $len;
+        break;
+
+      case 0x2C: // Image
+        // LOAD HEADER & COLOR TABLE
+        if (!$this->m_gih->load($data, $len = 0)) {
+          return false;
+        }
+        $data = substr($data, $len);
+        $datLen += $len;
+
+        // ALLOC BUFFER
+        if (!($this->m_data = $this->m_lzw->deCompress($data, $len = 0))) {
+          return false;
+        }
+        $data = substr($data, $len);
+        $datLen += $len;
+
+        if ($this->m_gih->m_bInterlace) {
+          $this->deInterlace();
+        }
+        return true;
+
+      case 0x3B: // EOF
+      default:
+        return false;
+      }
+    }
+    return false;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function skipExt(&$data, &$extLen)
+  {
+    $extLen = 0;
+
+    $b = ord($data{0});
+    $data = substr($data, 1);
+    $extLen++;
+
+    switch($b) {
+    case 0xF9: // Graphic Control
+      $b = ord($data{1});
+      $this->m_disp   = ($b & 0x1C) >> 2;
+      $this->m_bUser  = ($b & 0x02) ? true : false;
+      $this->m_bTrans = ($b & 0x01) ? true : false;
+      $this->m_nDelay = $this->w2i(substr($data, 2, 2));
+      $this->m_nTrans = ord($data{4});
+      break;
+
+    case 0xFE: // Comment
+      $this->m_lpComm = substr($data, 1, ord($data{0}));
+      break;
+
+    case 0x01: // Plain text
+      break;
+
+    case 0xFF: // Application
+      break;
+    }
+
+    // SKIP DEFAULT AS DEFS MAY CHANGE
+    $b = ord($data{0});
+    $data = substr($data, 1);
+    $extLen++;
+    while ($b > 0) {
+      $data = substr($data, $b);
+      $extLen += $b;
+      $b    = ord($data{0});
+      $data = substr($data, 1);
+      $extLen++;
+    }
+    return true;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function w2i($str)
+  {
+    return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8);
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function deInterlace()
+  {
+    $data = $this->m_data;
+
+    for ($i = 0; $i < 4; $i++) {
+      switch($i) {
+      case 0:
+        $s = 8;
+        $y = 0;
+        break;
+
+      case 1:
+        $s = 8;
+        $y = 4;
+        break;
+
+      case 2:
+        $s = 4;
+        $y = 2;
+        break;
+
+      case 3:
+        $s = 2;
+        $y = 1;
+        break;
+      }
+
+      for (; $y < $this->m_gih->m_nHeight; $y += $s) {
+        $lne = substr($this->m_data, 0, $this->m_gih->m_nWidth);
+        $this->m_data = substr($this->m_data, $this->m_gih->m_nWidth);
+
+        $data =
+          substr($data, 0, $y * $this->m_gih->m_nWidth) .
+          $lne .
+          substr($data, ($y + 1) * $this->m_gih->m_nWidth);
+      }
+    }
+
+    $this->m_data = $data;
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class CGIF
+{
+  var $m_gfh;
+  var $m_lpData;
+  var $m_img;
+  var $m_bLoaded;
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  // CONSTRUCTOR
+  function CGIF()
+  {
+    $this->m_gfh     = new CGIFFILEHEADER();
+    $this->m_img     = new CGIFIMAGE();
+    $this->m_lpData  = '';
+    $this->m_bLoaded = false;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function loadFile($lpszFileName, $iIndex)
+  {
+    if ($iIndex < 0) {
+      return false;
+    }
+
+    // READ FILE
+    if (!($fh = @fopen($lpszFileName, 'rb'))) {
+      return false;
+    }
+    $this->m_lpData = @fRead($fh, @fileSize($lpszFileName));
+    fclose($fh);
+
+    // GET FILE HEADER
+    if (!$this->m_gfh->load($this->m_lpData, $len = 0)) {
+      return false;
+    }
+    $this->m_lpData = substr($this->m_lpData, $len);
+
+    do {
+      if (!$this->m_img->load($this->m_lpData, $imgLen = 0)) {
+        return false;
+      }
+      $this->m_lpData = substr($this->m_lpData, $imgLen);
+    }
+    while ($iIndex-- > 0);
+
+    $this->m_bLoaded = true;
+    return true;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function getSize($lpszFileName, &$width, &$height)
+  {
+    if (!($fh = @fopen($lpszFileName, 'rb'))) {
+      return false;
+    }
+    $data = @fRead($fh, @fileSize($lpszFileName));
+    @fclose($fh);
+
+    $gfh = new CGIFFILEHEADER();
+    if (!$gfh->load($data, $len = 0)) {
+      return false;
+    }
+
+    $width  = $gfh->m_nWidth;
+    $height = $gfh->m_nHeight;
+    return true;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function getBmp($bgColor)
+  {
+    $out = '';
+
+    if (!$this->m_bLoaded) {
+      return false;
+    }
+
+    // PREPARE COLOR TABLE (RGBQUADs)
+    if ($this->m_img->m_gih->m_bLocalClr) {
+      $nColors = $this->m_img->m_gih->m_nTableSize;
+      $rgbq    = $this->m_img->m_gih->m_colorTable->toRGBQuad();
+      if ($bgColor != -1) {
+        $bgColor = $this->m_img->m_gih->m_colorTable->colorIndex($bgColor);
+      }
+    } elseif ($this->m_gfh->m_bGlobalClr) {
+      $nColors = $this->m_gfh->m_nTableSize;
+      $rgbq    = $this->m_gfh->m_colorTable->toRGBQuad();
+      if ($bgColor != -1) {
+        $bgColor = $this->m_gfh->m_colorTable->colorIndex($bgColor);
+      }
+    } else {
+      $nColors =  0;
+      $bgColor = -1;
+    }
+
+    // PREPARE BITMAP BITS
+    $data = $this->m_img->m_data;
+    $nPxl = ($this->m_gfh->m_nHeight - 1) * $this->m_gfh->m_nWidth;
+    $bmp  = '';
+    $nPad = ($this->m_gfh->m_nWidth % 4) ? 4 - ($this->m_gfh->m_nWidth % 4) : 0;
+    for ($y = 0; $y < $this->m_gfh->m_nHeight; $y++) {
+      for ($x = 0; $x < $this->m_gfh->m_nWidth; $x++, $nPxl++) {
+        if (
+          ($x >= $this->m_img->m_gih->m_nLeft) &&
+          ($y >= $this->m_img->m_gih->m_nTop) &&
+          ($x <  ($this->m_img->m_gih->m_nLeft + $this->m_img->m_gih->m_nWidth)) &&
+          ($y <  ($this->m_img->m_gih->m_nTop  + $this->m_img->m_gih->m_nHeight))) {
+          // PART OF IMAGE
+          if (@$this->m_img->m_bTrans && (ord($data{$nPxl}) == $this->m_img->m_nTrans)) {
+            // TRANSPARENT -> BACKGROUND
+            if ($bgColor == -1) {
+              $bmp .= chr($this->m_gfh->m_nBgColor);
+            } else {
+              $bmp .= chr($bgColor);
+            }
+          } else {
+            $bmp .= $data{$nPxl};
+          }
+        } else {
+          // BACKGROUND
+          if ($bgColor == -1) {
+            $bmp .= chr($this->m_gfh->m_nBgColor);
+          } else {
+            $bmp .= chr($bgColor);
+          }
+        }
+      }
+      $nPxl -= $this->m_gfh->m_nWidth << 1;
+
+      // ADD PADDING
+      for ($x = 0; $x < $nPad; $x++) {
+        $bmp .= "\x00";
+      }
+    }
+
+    // BITMAPFILEHEADER
+    $out .= 'BM';
+    $out .= $this->dword(14 + 40 + ($nColors << 2) + strlen($bmp));
+    $out .= "\x00\x00";
+    $out .= "\x00\x00";
+    $out .= $this->dword(14 + 40 + ($nColors << 2));
+
+    // BITMAPINFOHEADER
+    $out .= $this->dword(40);
+    $out .= $this->dword($this->m_gfh->m_nWidth);
+    $out .= $this->dword($this->m_gfh->m_nHeight);
+    $out .= "\x01\x00";
+    $out .= "\x08\x00";
+    $out .= "\x00\x00\x00\x00";
+    $out .= "\x00\x00\x00\x00";
+    $out .= "\x12\x0B\x00\x00";
+    $out .= "\x12\x0B\x00\x00";
+    $out .= $this->dword($nColors % 256);
+    $out .= "\x00\x00\x00\x00";
+
+    // COLOR TABLE
+    if ($nColors > 0) {
+      $out .= $rgbq;
+    }
+
+    // DATA
+    $out .= $bmp;
+
+    return $out;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function getPng($bgColor)
+  {
+    $out = '';
+
+    if (!$this->m_bLoaded) {
+      return false;
+    }
+
+    // PREPARE COLOR TABLE (RGBQUADs)
+    if ($this->m_img->m_gih->m_bLocalClr) {
+      $nColors = $this->m_img->m_gih->m_nTableSize;
+      $pal     = $this->m_img->m_gih->m_colorTable->toString();
+      if ($bgColor != -1) {
+        $bgColor = $this->m_img->m_gih->m_colorTable->colorIndex($bgColor);
+      }
+    } elseif ($this->m_gfh->m_bGlobalClr) {
+      $nColors = $this->m_gfh->m_nTableSize;
+      $pal     = $this->m_gfh->m_colorTable->toString();
+      if ($bgColor != -1) {
+        $bgColor = $this->m_gfh->m_colorTable->colorIndex($bgColor);
+      }
+    } else {
+      $nColors =  0;
+      $bgColor = -1;
+    }
+
+    // PREPARE BITMAP BITS
+    $data = $this->m_img->m_data;
+    $nPxl = 0;
+    $bmp  = '';
+    for ($y = 0; $y < $this->m_gfh->m_nHeight; $y++) {
+      $bmp .= "\x00";
+      for ($x = 0; $x < $this->m_gfh->m_nWidth; $x++, $nPxl++) {
+        if (
+          ($x >= $this->m_img->m_gih->m_nLeft) &&
+          ($y >= $this->m_img->m_gih->m_nTop) &&
+          ($x <  ($this->m_img->m_gih->m_nLeft + $this->m_img->m_gih->m_nWidth)) &&
+          ($y <  ($this->m_img->m_gih->m_nTop  + $this->m_img->m_gih->m_nHeight))) {
+          // PART OF IMAGE
+          $bmp .= $data{$nPxl};
+        } else {
+          // BACKGROUND
+          if ($bgColor == -1) {
+            $bmp .= chr($this->m_gfh->m_nBgColor);
+          } else {
+            $bmp .= chr($bgColor);
+          }
+        }
+      }
+    }
+    $bmp = gzcompress($bmp, 9);
+
+    ///////////////////////////////////////////////////////////////////////
+    // SIGNATURE
+    $out .= "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A";
+    ///////////////////////////////////////////////////////////////////////
+    // HEADER
+    $out .= "\x00\x00\x00\x0D";
+    $tmp  = 'IHDR';
+    $tmp .= $this->ndword($this->m_gfh->m_nWidth);
+    $tmp .= $this->ndword($this->m_gfh->m_nHeight);
+    $tmp .= "\x08\x03\x00\x00\x00";
+    $out .= $tmp;
+    $out .= $this->ndword(crc32($tmp));
+    ///////////////////////////////////////////////////////////////////////
+    // PALETTE
+    if ($nColors > 0) {
+      $out .= $this->ndword($nColors * 3);
+      $tmp  = 'PLTE';
+      $tmp .= $pal;
+      $out .= $tmp;
+      $out .= $this->ndword(crc32($tmp));
+    }
+    ///////////////////////////////////////////////////////////////////////
+    // TRANSPARENCY
+    if (@$this->m_img->m_bTrans && ($nColors > 0)) {
+      $out .= $this->ndword($nColors);
+      $tmp  = 'tRNS';
+      for ($i = 0; $i < $nColors; $i++) {
+        $tmp .= ($i == $this->m_img->m_nTrans) ? "\x00" : "\xFF";
+      }
+      $out .= $tmp;
+      $out .= $this->ndword(crc32($tmp));
+    }
+    ///////////////////////////////////////////////////////////////////////
+    // DATA BITS
+    $out .= $this->ndword(strlen($bmp));
+    $tmp  = 'IDAT';
+    $tmp .= $bmp;
+    $out .= $tmp;
+    $out .= $this->ndword(crc32($tmp));
+    ///////////////////////////////////////////////////////////////////////
+    // END OF FILE
+    $out .= "\x00\x00\x00\x00IEND\xAE\x42\x60\x82";
+
+    return $out;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  // Added by James Heinrich <info at silisoftware.com> - January 5, 2003
+
+  // Takes raw image data and plots it pixel-by-pixel on a new GD image and returns that
+  // It's extremely slow, but the only solution when ImageCreateFromString() fails
+  function getGD_PixelPlotterVersion()
+  {
+    if (!$this->m_bLoaded) {
+      return false;
+    }
+
+    // PREPARE COLOR TABLE (RGBQUADs)
+    if ($this->m_img->m_gih->m_bLocalClr) {
+      $pal = $this->m_img->m_gih->m_colorTable->toString();
+    } elseif ($this->m_gfh->m_bGlobalClr) {
+      $pal = $this->m_gfh->m_colorTable->toString();
+    } else {
+      die('No color table available in getGD_PixelPlotterVersion()');
+    }
+
+    $PlottingIMG = ImageCreate($this->m_gfh->m_nWidth, $this->m_gfh->m_nHeight);
+    $NumColorsInPal = floor(strlen($pal) / 3);
+    for ($i = 0; $i < $NumColorsInPal; $i++) {
+      $ThisImageColor[$i] = ImageColorAllocate(
+                  $PlottingIMG,
+                  ord($pal{(($i * 3) + 0)}),
+                  ord($pal{(($i * 3) + 1)}),
+                  ord($pal{(($i * 3) + 2)}));
+    }
+
+    // PREPARE BITMAP BITS
+    $data = $this->m_img->m_data;
+    $nPxl = ($this->m_gfh->m_nHeight - 1) * $this->m_gfh->m_nWidth;
+    for ($y = 0; $y < $this->m_gfh->m_nHeight; $y++) {
+      set_time_limit(30);
+      for ($x = 0; $x < $this->m_gfh->m_nWidth; $x++, $nPxl++) {
+        if (
+          ($x >= $this->m_img->m_gih->m_nLeft) &&
+          ($y >= $this->m_img->m_gih->m_nTop) &&
+          ($x <  ($this->m_img->m_gih->m_nLeft + $this->m_img->m_gih->m_nWidth)) &&
+          ($y <  ($this->m_img->m_gih->m_nTop  + $this->m_img->m_gih->m_nHeight))) {
+          // PART OF IMAGE
+          if (@$this->m_img->m_bTrans && (ord($data{$nPxl}) == $this->m_img->m_nTrans)) {
+            ImageSetPixel($PlottingIMG, $x, $this->m_gfh->m_nHeight - $y - 1, $ThisImageColor[$this->m_gfh->m_nBgColor]);
+          } else {
+            ImageSetPixel($PlottingIMG, $x, $this->m_gfh->m_nHeight - $y - 1, $ThisImageColor[ord($data{$nPxl})]);
+          }
+        } else {
+          // BACKGROUND
+          ImageSetPixel($PlottingIMG, $x, $this->m_gfh->m_nHeight - $y - 1, $ThisImageColor[$this->m_gfh->m_nBgColor]);
+        }
+      }
+      $nPxl -= $this->m_gfh->m_nWidth << 1;
+
+    }
+
+    return $PlottingIMG;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function dword($val)
+  {
+    $val = intval($val);
+    return chr($val & 0xFF).chr(($val & 0xFF00) >> 8).chr(($val & 0xFF0000) >> 16).chr(($val & 0xFF000000) >> 24);
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function ndword($val)
+  {
+    $val = intval($val);
+    return chr(($val & 0xFF000000) >> 24).chr(($val & 0xFF0000) >> 16).chr(($val & 0xFF00) >> 8).chr($val & 0xFF);
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function width()
+  {
+    return $this->m_gfh->m_nWidth;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function height()
+  {
+    return $this->m_gfh->m_nHeight;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function comment()
+  {
+    return $this->m_img->m_lpComm;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+
+  function loaded()
+  {
+    return $this->m_bLoaded;
+  }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.ico.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.ico.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.ico.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,119 @@
+<?php
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+// phpthumb.ico.php - .ICO output format functions          //
+//                                                         ///
+//////////////////////////////////////////////////////////////
+
+
+class phpthumb_ico {
+
+  function phpthumb_ico() {
+    return true;
+  }
+
+
+  function GD2ICOstring(&$gd_image_array) {
+    foreach ($gd_image_array as $key => $gd_image) {
+
+      $ImageWidths[$key]  = ImageSX($gd_image);
+      $ImageHeights[$key] = ImageSY($gd_image);
+        $bpp[$key]          = ImageIsTrueColor($gd_image) ? 32 : 24;
+        $totalcolors[$key]  = ImageColorsTotal($gd_image);
+
+      $icXOR[$key] = '';
+      for ($y = $ImageHeights[$key] - 1; $y >= 0; $y--) {
+        for ($x = 0; $x < $ImageWidths[$key]; $x++) {
+          $argb = phpthumb_functions::GetPixelColor($gd_image, $x, $y);
+          $a = round(255 * ((127 - $argb['alpha']) / 127));
+          $r = $argb['red'];
+          $g = $argb['green'];
+          $b = $argb['blue'];
+
+          if ($bpp[$key] == 32) {
+            $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a);
+          } elseif ($bpp[$key] == 24) {
+            $icXOR[$key] .= chr($b).chr($g).chr($r);
+          }
+
+          if ($a < 128) {
+            @$icANDmask[$key][$y] .= '1';
+          } else {
+            @$icANDmask[$key][$y] .= '0';
+          }
+        }
+        // mask bits are 32-bit aligned per scanline
+        while (strlen($icANDmask[$key][$y]) % 32) {
+          $icANDmask[$key][$y] .= '0';
+        }
+      }
+      $icAND[$key] = '';
+      foreach ($icANDmask[$key] as $y => $scanlinemaskbits) {
+        for ($i = 0; $i < strlen($scanlinemaskbits); $i += 8) {
+          $icAND[$key] .= chr(bindec(str_pad(substr($scanlinemaskbits, $i, 8), 8, '0', STR_PAD_LEFT)));
+        }
+      }
+
+    }
+
+      foreach ($gd_image_array as $key => $gd_image) {
+      $biSizeImage = $ImageWidths[$key] * $ImageHeights[$key] * ($bpp[$key] / 8);
+
+        // BITMAPINFOHEADER - 40 bytes
+      $BitmapInfoHeader[$key]  = '';
+      $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00";                              // DWORD  biSize;
+      $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4);      // LONG   biWidth;
+      // The biHeight member specifies the combined
+      // height of the XOR and AND masks.
+      $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG   biHeight;
+        $BitmapInfoHeader[$key] .= "\x01\x00";                                      // WORD   biPlanes;
+        $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00";                          // wBitCount;
+      $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                              // DWORD  biCompression;
+      $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4);            // DWORD  biSizeImage;
+        $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                              // LONG   biXPelsPerMeter;
+        $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                              // LONG   biYPelsPerMeter;
+        $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                              // DWORD  biClrUsed;
+        $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                              // DWORD  biClrImportant;
+    }
+
+
+    $icondata  = "\x00\x00";                                      // idReserved;   // Reserved (must be 0)
+    $icondata .= "\x01\x00";                                      // idType;       // Resource Type (1 for icons)
+    $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2);  // idCount;      // How many images?
+
+    $dwImageOffset = 6 + (count($gd_image_array) * 16);
+    foreach ($gd_image_array as $key => $gd_image) {
+        // ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
+
+        $icondata .= chr($ImageWidths[$key]);                     // bWidth;          // Width, in pixels, of the image
+        $icondata .= chr($ImageHeights[$key]);                    // bHeight;         // Height, in pixels, of the image
+        $icondata .= chr($totalcolors[$key]);                     // bColorCount;     // Number of colors in image (0 if >=8bpp)
+        $icondata .= "\x00";                                      // bReserved;       // Reserved ( must be 0)
+
+        $icondata .= "\x01\x00";                                  // wPlanes;         // Color Planes
+      $icondata .= chr($bpp[$key])."\x00";                      // wBitCount;       // Bits per pixel
+
+      $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]);
+      $icondata .= phpthumb_functions::LittleEndian2String($dwBytesInRes, 4);       // dwBytesInRes;    // How many bytes in this resource?
+
+        $icondata .= phpthumb_functions::LittleEndian2String($dwImageOffset, 4);      // dwImageOffset;   // Where in the file is this image?
+      $dwImageOffset += strlen($BitmapInfoHeader[$key]);
+      $dwImageOffset += strlen($icXOR[$key]);
+      $dwImageOffset += strlen($icAND[$key]);
+      }
+
+      foreach ($gd_image_array as $key => $gd_image) {
+      $icondata .= $BitmapInfoHeader[$key];
+      $icondata .= $icXOR[$key];
+      $icondata .= $icAND[$key];
+      }
+
+      return $icondata;
+  }
+
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.unsharp.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.unsharp.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/phpThumb/phpthumb.unsharp.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,162 @@
+<?php
+//////////////////////////////////////////////////////////////
+////                                                      ////
+////              p h p U n s h a r p M a s k             ////
+////                                                      ////
+////    Unsharp mask algorithm by Torstein Hønsi 2003.    ////
+////               thoensi_at_netcom_dot_no               ////
+////               Please leave this notice.              ////
+////                                                      ////
+//////////////////////////////////////////////////////////////
+/// From: http://vikjavev.no/hovudsida/umtestside.php       //
+//                                                          //
+//  Reformatted by James Heinrich <info at silisoftware.com>   //
+//  for use in phpThumb() on 3 February 2003.               //
+//                                                          //
+//  phpThumb() is found at http://phpthumb.sourceforge.net ///
+//////////////////////////////////////////////////////////////
+
+/*
+WARNING! Due to a known bug in PHP 4.3.2 this script is not working well in this version.
+The sharpened images get too dark. The bug is fixed in version 4.3.3.
+
+Unsharp masking is a traditional darkroom technique that has proven very suitable for
+digital imaging. The principle of unsharp masking is to create a blurred copy of the image
+and compare it to the underlying original. The difference in colour values
+between the two images is greatest for the pixels near sharp edges. When this
+difference is subtracted from the original image, the edges will be
+accentuated.
+
+The Amount parameter simply says how much of the effect you want. 100 is 'normal'.
+Radius is the radius of the blurring circle of the mask. 'Threshold' is the least
+difference in colour values that is allowed between the original and the mask. In practice
+this means that low-contrast areas of the picture are left unrendered whereas edges
+are treated normally. This is good for pictures of e.g. skin or blue skies.
+
+Any suggenstions for improvement of the algorithm, expecially regarding the speed
+and the roundoff errors in the Gaussian blur process, are welcome.
+*/
+
+class phpUnsharpMask {
+
+  function applyUnsharpMask(&$img, $amount, $radius, $threshold) {
+
+    // $img is an image that is already created within php using
+    // imgcreatetruecolor. No url! $img must be a truecolor image.
+
+    // Attempt to calibrate the parameters to Photoshop:
+    $amount = min($amount, 500);
+    $amount = $amount * 0.016;
+    if ($amount == 0) {
+      return true;
+    }
+
+    $radius = min($radius, 50);
+    $radius = $radius * 2;
+
+    $threshold = min($threshold, 255);
+
+    $radius = abs(round($radius));  // Only integers make sense.
+    if ($radius == 0) {
+      return true;
+    }
+
+    $w = ImageSX($img);
+    $h = ImageSY($img);
+    $imgCanvas  = ImageCreateTrueColor($w, $h);
+    $imgCanvas2 = ImageCreateTrueColor($w, $h);
+    ImageCopy($imgCanvas,  $img, 0, 0, 0, 0, $w, $h);
+    ImageCopy($imgCanvas2, $img, 0, 0, 0, 0, $w, $h);
+
+
+    $builtinFilterSucceeded = false;
+    if ($radius == 1) {
+      if (phpthumb_functions::version_compare_replacement(phpversion(), '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
+        if (ImageFilter($imgCanvas, IMG_FILTER_GAUSSIAN_BLUR) && ImageFilter($imgCanvas2, IMG_FILTER_GAUSSIAN_BLUR)) {
+          $builtinFilterSucceeded = true;
+        }
+      }
+    }
+
+    if (!$builtinFilterSucceeded) {
+      $imgBlur  = ImageCreateTrueColor($w, $h);
+      $imgBlur2 = ImageCreateTrueColor($w, $h);
+
+      ///////////////////////////
+      //
+      // Gaussian blur matrix:
+      //  1  2  1
+      //  2  4  2
+      //  1  2  1
+      //
+      ///////////////////////////
+
+      // Move copies of the image around one pixel at the time and merge them with weight
+      // according to the matrix. The same matrix is simply repeated for higher radii.
+      for ($i = 0; $i < $radius; $i++)  {
+        ImageCopy     ($imgBlur, $imgCanvas, 0, 0, 1, 1, $w - 1, $h - 1);            // up left
+        ImageCopyMerge($imgBlur, $imgCanvas, 1, 1, 0, 0, $w,     $h,     50);        // down right
+        ImageCopyMerge($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h,     33.33333);  // down left
+        ImageCopyMerge($imgBlur, $imgCanvas, 1, 0, 0, 1, $w,     $h - 1, 25);        // up right
+        ImageCopyMerge($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h,     33.33333);  // left
+        ImageCopyMerge($imgBlur, $imgCanvas, 1, 0, 0, 0, $w,     $h,     25);        // right
+        ImageCopyMerge($imgBlur, $imgCanvas, 0, 0, 0, 1, $w,     $h - 1, 20 );       // up
+        ImageCopyMerge($imgBlur, $imgCanvas, 0, 1, 0, 0, $w,     $h,     16.666667); // down
+        ImageCopyMerge($imgBlur, $imgCanvas, 0, 0, 0, 0, $w,     $h,     50);        // center
+        ImageCopy     ($imgCanvas, $imgBlur, 0, 0, 0, 0, $w,     $h);
+
+        // During the loop above the blurred copy darkens, possibly due to a roundoff
+        // error. Therefore the sharp picture has to go through the same loop to
+        // produce a similar image for comparison. This is not a good thing, as processing
+        // time increases heavily.
+        ImageCopy     ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h);
+        ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50);
+        ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333);
+        ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25);
+        ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333);
+        ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25);
+        ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 20 );
+        ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 16.666667);
+        ImageCopyMerge($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50);
+        ImageCopy     ($imgCanvas2, $imgBlur2, 0, 0, 0, 0, $w, $h);
+      }
+      ImageDestroy($imgBlur);
+      ImageDestroy($imgBlur2);
+    }
+
+    // Calculate the difference between the blurred pixels and the original
+    // and set the pixels
+    for ($x = 0; $x < $w; $x++) { // each row
+      for ($y = 0; $y < $h; $y++) { // each pixel
+
+        $rgbOrig = ImageColorAt($imgCanvas2, $x, $y);
+        $rOrig = (($rgbOrig >> 16) & 0xFF);
+        $gOrig = (($rgbOrig >>  8) & 0xFF);
+        $bOrig =  ($rgbOrig        & 0xFF);
+
+        $rgbBlur = ImageColorAt($imgCanvas, $x, $y);
+        $rBlur = (($rgbBlur >> 16) & 0xFF);
+        $gBlur = (($rgbBlur >>  8) & 0xFF);
+        $bBlur =  ($rgbBlur        & 0xFF);
+
+        // When the masked pixels differ less from the original
+        // than the threshold specifies, they are set to their original value.
+        $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig;
+        $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig;
+        $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig;
+
+        if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) {
+          $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew);
+          ImageSetPixel($img, $x, $y, $pixCol);
+        }
+      }
+    }
+    ImageDestroy($imgCanvas);
+    ImageDestroy($imgCanvas2);
+
+    return true;
+  }
+
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/popup.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/popup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/popup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser dialog - popup
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.0                   Date: 07/15/2006
+  // ================================================
+
+  if ( get_magic_quotes_gpc() ) {
+    $_GET['url'] = stripslashes($_GET['url']);
+  }
+  $src   = @$_REQUEST['url'];
+  $clTxt = (isset($_REQUEST['clTxt']) ? $_REQUEST['clTxt'] : $cfg['clTxt']);    
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<meta http-equiv="imagetoolbar" content="no" />
+<title>iBrowser Popup</title>
+<script language="JavaScript" type="text/JavaScript">
+  function getRefToDivMod( divID, oDoc ) {
+    if( !oDoc ) { oDoc = document; }
+    if( document.layers ) {
+      if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
+        for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
+          y = getRefToDivNest(divID,oDoc.layers[x].document); }
+        return y; } }
+    if( document.getElementById ) { return oDoc.getElementById(divID); }
+    if( document.all ) { return oDoc.all[divID]; }
+    return document[divID];
+  }
+
+  function resizeWinTo(idOfDiv) {
+    window.focus();
+    var oH = getRefToDivMod(idOfDiv);
+    if (!oH) {
+      return false;
+    }
+    var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
+    var oH = oH.clip ? oH.clip.height : oH.offsetHeight;
+    if(!oH) {
+      return false;
+    }
+    var x = window; x.resizeTo( oW + 200, oH + 200 );
+    var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
+    if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
+    else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
+    else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
+    if( window.opera && !document.childNodes ) { myW += 16; }
+    x.resizeTo( oW + ( ( oW + 200 ) - myW ), oH + ( (oH + 200 ) - myH ) );
+  }
+// ============================================================
+// = load/hide message, date: 02/08/2005                      =
+// ============================================================
+  function hideloadmessage() {
+    document.getElementById('dialogLoadMessage').style.display = 'none';
+  }
+</script>
+<style type="text/css">
+<!--
+body {
+  margin: 0px;
+  padding: 0px;
+  background-color: #efefef;
+}
+#dialogLoadMessage {
+  position:absolute; 
+  z-index:1000; 
+  display:block;
+  width:100%; 
+  height:100%;
+}
+#loadMessage {  
+  border:1px solid #cccccc; 
+  padding: 10px; 
+  width: 150px; 
+  color:#666666;
+  background-color:#efefef; 
+  font-family: verdana,arial,helvetica,sans-serif; 
+  font-size:12px; 
+  font-weight:bold
+}
+-->
+</style>
+</head>
+<body onload="resizeWinTo('iDiv'); hideloadmessage();">
+<?php 
+  include dirname(__FILE__) . '/loadmsg.php';
+?>
+<div id="iDiv" style="position:absolute; left:0px; top:0px;">
+  <img onclick="window.close();" src="<?php echo $src; ?>" border="0" alt="<?php echo $clTxt; ?>" title="<?php echo $clTxt; ?>" style="cursor: pointer;"/></div>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/random.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/random.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/random.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+//////////////////////////////////////////////////////////////
+///  phpThumb() by James Heinrich <info at silisoftware.com>   //
+//        available at http://phpthumb.sourceforge.net     ///
+//////////////////////////////////////////////////////////////
+///                                                         //
+// phpThumb.demo.random.php                                 //
+// James Heinrich <info at silisoftware.com>                   //
+//                                                          //
+// Display a random image from a specified directory.       //
+// Run with no parameters for usage instructions.           //
+//                                                          //
+//////////////////////////////////////////////////////////////
+
+function SelectRandomImage($dirname='.', $portrait=true, $landscape=true, $square=true) {
+  // return a random image filename from $dirname
+  // the last 3 parameters determine what aspect ratio of images
+  // may be returned
+  $possibleimages = array();
+  if ($dh = opendir($dirname)) {
+    while ($file = readdir($dh)) {
+      if (is_file($dirname.'/'.$file) && eregi('\.(jpg|jpeg|gif|png|tiff|bmp)$', $file)) {
+        if ($gis = @GetImageSize($dirname.'/'.$file)) {
+          if ($portrait && ($gis[0] < $gis[1])) {
+            // portrait
+            $possibleimages[] = $file;
+          } elseif ($landscape && ($gis[0] > $gis[1])) {
+            // landscape
+            $possibleimages[] = $file;
+          } elseif ($square) {
+            // square
+            $possibleimages[] = $file;
+          }
+        }
+      }
+    }
+    closedir($dh);
+  }
+  if (empty($possibleimages)) {
+    return false;
+  }
+  if (phpversion() < '4.2.0') {
+    mt_srand(time());
+  }
+  $randkey = mt_rand(0, count($possibleimages) - 1);
+  return realpath($dirname.'/'.$possibleimages[$randkey]);
+}
+
+if (@$_REQUEST['dir']) {
+  if (is_dir($_REQUEST['dir'])) {
+
+    if (!@$_REQUEST['o']) {
+      $_REQUEST['o'] = 'PLS';
+    }
+    $_REQUEST['o'] = strtoupper($_REQUEST['o']);
+    $portrait  = (strpos(@$_REQUEST['o'], 'P') !== false);
+    $landscape = (strpos(@$_REQUEST['o'], 'L') !== false);
+    $square    = (strpos(@$_REQUEST['o'], 'S') !== false);
+    $randomSRC = SelectRandomImage($_REQUEST['dir'], $portrait, $landscape, $square);
+    if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
+      $randomSRC = str_replace('\\', '/', eregi_replace('^'.realpath(@$_SERVER['DOCUMENT_ROOT']), '', realpath($randomSRC)));
+    } else {
+      $randomSRC = str_replace(realpath(@$_SERVER['DOCUMENT_ROOT']), '', realpath($randomSRC));
+    }
+
+    $otherParams = array();
+    foreach ($_GET as $key => $value) {
+      if (($key == 'dir') || ($key == 'o')) {
+        continue;
+      }
+      if (is_array($value)) {
+        foreach ($value as $vkey => $vvalue) {
+          $otherParams[] = urlencode($key).'['.urlencode($vkey).']='.urlencode($vvalue);
+        }
+      } else {
+        $otherParams[] = urlencode($key).'='.urlencode($value);
+      }
+    }
+    header('Location: ./phpThumb/phpThumb.php?src='.urlencode($randomSRC).'&'.implode('&', $otherParams));
+    exit;
+
+  } else {
+    die($_REQUEST['dir'].' is not a directory');
+  }
+
+} else {
+
+  echo '<html><body>Usage: <b>'.basename($_SERVER['PHP_SELF']).'?dir=<i>&lt;directory&gt;</i>&amp;<i>&lt;phpThumb parameters&gt;</i></b>&amp;o=<i>(P|L|S)</i><br><br>Examples:<ul>';
+  echo '<li>'.basename($_SERVER['PHP_SELF']).'?./images/&o=L <i>(landscape images only)</i></li>';
+  echo '<li>'.basename($_SERVER['PHP_SELF']).'?./images/&o=PS <i>(portrait or square images only)</i></li>';
+  echo '</ul></body></html>';
+
+}
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/rdirs.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/rdirs.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/rdirs.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser dialog - dir functions
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.0                   Date: 12/12/2005
+  // ================================================
+  
+  $files = array(); 
+  foreach ($cfg['ilibs_dir'] as $dir) {   
+    if ($cfg['ilibs_dir_show'] == true) {
+      $files[] = array('value' => absPath(str_replace($cfg['root_dir'],'',$dir)), 'text' => ucfirst(basename($dir)));       
+    }   
+    if(dirlist($files, str_replace('//','/',$cfg['root_dir'] . $dir))) { // get dirlist
+      $cfg['ilibs'] = $files;     
+    } else {
+      echo 'directory error';
+      return false;
+    } 
+  } 
+  function dirlist(&$files,$dir) {    
+    global $cfg;
+    if ($handle = opendir($dir)) {      
+      while ($file = readdir($handle)) {        
+        if ($file == '.' || $file == '..') {
+          continue;         
+        }       
+        $fullpath = str_replace('//','/',$dir . '/' . $file); 
+        if (is_dir($fullpath)) {            
+          $indent = str_repeat('&nbsp;', count(explode('/', trim(str_replace($cfg['root_dir'],'',$dir), '/')))*2);
+          $files[] = array('value' => absPath(str_replace( $cfg['root_dir'],'',$fullpath ) . '/'), 'text' => $indent . ucfirst(basename($fullpath))); 
+          dirlist($files,$fullpath);                                
+        }
+        }
+      closedir($handle);
+      asort($files);  
+        return true;    
+    }
+    return false;     
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/resizeDialog.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/resizeDialog.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/resizeDialog.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+// ================================================
+// PHP image browser - iBrowser 
+// ================================================
+// iBrowser - resize dialog to content
+// ================================================
+// Developed: net4visions.com
+// Copyright: net4visions.com
+// License: GPL - see license.txt
+// (c)2005 All rights reserved.
+// ================================================
+// Revision: 1.0                   Date: 06/14/2005
+// ================================================
+  function resizeDialogToContent() {    
+    if (iBrowser.isMSIE) {      
+      var dw = parseInt(window.dialogWidth);
+      if(dw) {        
+        difw = dw - this.document.body.clientWidth;
+        window.dialogWidth = this.document.body.scrollWidth + difw + 'px';  
+        var dh = parseInt(window.dialogHeight);       
+        difh = dh - this.document.body.clientHeight;
+        window.dialogHeight = this.document.body.scrollHeight + difh + 'px';        
+      }
+    } else if (iBrowser.isGecko) {      
+      window.sizeToContent();     
+      window.scrollTo(0,0);
+      window.moveTo(0,0);
+    }
+  }
+//-------------------------------------------------------------------------
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/rfiles.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/rfiles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/rfiles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,543 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser dialog - file functions
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.0                   Date: 08/02/2006
+  // ================================================
+  include_once('../../../../../configure.php');
+  //-------------------------------------------------------------------------
+  // include configuration settings
+  include dirname(__FILE__) . '/../config/config.inc.php';
+  include dirname(__FILE__) . '/../langs/lang.class.php'; 
+  $cfg['temp']      = DIR_FS_CATALOG . 'tmp';
+  //-------------------------------------------------------------------------
+    
+  // language settings  
+  $l = (isset($_REQUEST['lang']) ? new PLUG_Lang($_REQUEST['lang']) : new PLUG_Lang($cfg['lang']));
+  $l->setBlock('ibrowser');
+  //------------------------------------------------------------------------- 
+  // parameters
+  $param  = (isset($_REQUEST['param']) ? $_REQUEST['param'] : '');
+  if (isset($param)) {
+    $param  = explode('|', $param);
+  } 
+  // set action 
+  $action = (isset($_REQUEST['action']) ? $_REQUEST['action'] : '');      
+  // set image library    
+  $clib = (isset($_REQUEST['clib']) ? $_REQUEST['clib'] : (isset($_REQUEST['ilibs']) ? $_REQUEST['ilibs'] : $cfg['ilibs'][0]['value']));  
+  // set current file
+  $cfile = (isset($_REQUEST['cfile']) ? $_REQUEST['cfile'] : ''); 
+  // set new file
+  $nfile = (isset($_REQUEST['nfile']) ? $_REQUEST['nfile'] : '');
+  // set list view  
+  $list = (isset($_REQUEST['flist']) ? $_REQUEST['flist'] : $cfg['list']);  
+  //-------------------------------------------------------------------------
+  // file/directory actions     
+  if ($param[0] == 'delete') {      // ACTION: delete image
+    $action = $param[0];        
+    $cfile  = $param[1];        // current filename     
+    if(!deleteImg($clib, $cfile)) {
+      echo $l->m('er_001') . ': ' . $l->m('er_030');      
+    };  
+  } else if ($param[0] == 'rename') {   // ACTION: rename image     
+    $action = $param[0];  
+    $cfile  = $param[1];        // current filename
+    $nfile  = $param[2];        // new filename
+    if(!$nfile = renameImg($clib, $cfile, $nfile)) {
+      echo $l->m('er_001') . ': ' . $l->m('er_033');  
+    };
+  } else if ($param[0] == 'upload') {   // ACTION: upload image   
+    $action = $param[0];    
+    $chkT   = (isset($_REQUEST['chkThumbSize']) ? $_REQUEST['chkThumbSize'] : Array() );  // thumb-sizes in Array               
+    $selR   = (isset($_REQUEST['selRotate']) ? $_REQUEST['selRotate'] : '');  // auto rotate  
+    if (isset($_FILES['nfile']['name'][0])) {     
+      if (!$nfile = uploadImg($clib, $chkT, $selR)) { 
+        echo $l->m('er_001') . ': ' . $l->m('er_028');  
+      } 
+    };  
+  } else if ($param[0] == 'create') {   // ACTION: create directory     
+    $action = $param[0];  
+    $nfile  = $param[1];        // new filename
+    if(!createDir($clib, $nfile)) {
+      echo $l->m('er_001') . ': ' . $l->m('er_034');  
+    };
+  } else if ($param[0] == 'update') {   // ACTION: update image list and select current image     
+    $action = $param[0];        
+    $cfile  = $param[1];        // current filename
+  } else if ($param[0] == 'switch') {   // ACTION: switch image list view (list or thumbnails)      
+    $action = $param[0];        
+    $cfile  = $param[1];        // current filename 
+  }   
+?>
+<!-- do not delete this line - it's need for proper working of the resizeDialogToContent() function -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title><?php echo $l->m('im_002'); ?></title>
+<meta http-equiv="Pragma" content="no-cache">
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $l->getCharset(); ?>">
+<style type="text/css">
+<!--
+ at import url("../css/style.css");
+
+html, body {
+  margin: 0px;
+  padding: 0px;
+}
+
+-->
+</style>
+<?php if ($list == false) { // thumbnail view ?> 
+  <style type="text/css">
+  <!--
+    div#iselDiv li {
+      margin: 5px;
+      padding: 5px;
+      display: block;
+      border: 1px solid #cccccc;  
+      float: left;  
+    }
+  -->
+  </style>
+<?php } else { // list view ?>
+  <style type="text/css">
+  <!--
+    div#iselDiv li {
+      margin: 0px;
+      padding: 0px;
+      display: block;   
+      padding-left: 5px;
+      padding-right: 5px;     
+    }
+  -->
+  </style>
+<?php }; ?>
+<script language="JavaScript" type="text/JavaScript">
+<!--
+// ============================================================
+// = image list item V 1.0, date: 01/21/2005                  =
+// ============================================================ 
+  // list item hover
+  function li_over() {
+    if (this.className != 'cimgdown') {
+      this.className   = 'cimgover';
+    }
+  }
+  // list item out
+  function li_out() {
+    if (this.className != 'cimgdown') {
+      this.className   = 'cimgup';
+    }
+  }
+  // list item down
+  function li_down() {
+    if (this.className != 'cimgdown') {
+      this.className  = 'cimgdown';
+    }
+  }
+  // list item click
+  function li_click() {   
+    x = document.getElementById('iselDiv').getElementsByTagName('li');
+    for (var i = 0; i < x.length; i++) {
+      if (x[i].className == 'cimgdown') {
+        if (x[i] != this) {
+          x[i].className = 'cimgup';
+        }
+      }
+    }   
+    imageChangeClick(this);   
+  } 
+// ============================================================
+// = init filelist - set attributes V 1.0, date: 04/18/2005   =
+// ============================================================
+  function init() {   
+    var formObj = document.forms[0];
+    // init mouse events on image list <li>
+    var x = document.getElementById('iselDiv').getElementsByTagName('li');
+    for (var i = 0; i < x.length; i++) {
+      if (x[i].className == 'cimgup') {
+        x[i].onmouseover = li_over;
+        x[i].onmouseout  = li_out;
+        x[i].onmousedown = li_down;
+        x[i].onclick     = li_click;
+      }
+    }   
+    
+    // actions
+    var action = formObj.action.value;    
+    if (action == 'upload') {
+      var tfile = '<?php echo $nfile; ?>';      
+      getObject(tfile);
+      self.parent.hideloadmessage();        
+    } else if (action == 'rename') {
+      var tfile = '<?php echo $nfile; ?>';      
+      getObject(tfile);
+    } else if (action == 'update') {
+      var tfile = '<?php echo $cfile; ?>';      
+      getObject(tfile);
+    } else if (action == 'switch') {
+      var tfile = '<?php echo $cfile; ?>';      
+      getObject(tfile);         
+    } else if (action == 'delete') {      
+      imageChangeClick();
+    } else if (formObj.action.value == 'create') {  
+      // parent needs to be refreshed if directory got created  
+      parent.document.location.reload();  
+    }
+  }
+// ============================================================
+// = image change - set attributes V 1.0, date: 04/18/2005    =
+// ============================================================ 
+  function imageChangeClick(obj) {
+    var formObj = document.forms[0];
+    var action  = formObj.action.value; 
+    if (obj) {
+      parent.document.getElementById('cimg').attributes['cfile'].value   = obj.attributes['ifile'].value;
+      parent.document.getElementById('cimg').attributes['csize'].value   = obj.attributes['isize'].value;
+      parent.document.getElementById('cimg').attributes['cheight'].value = obj.attributes['iheight'].value;
+      parent.document.getElementById('cimg').attributes['cwidth'].value  = obj.attributes['iwidth'].value;
+      parent.document.getElementById('cimg').attributes['ctype'].value   = obj.attributes['itype'].value;
+      parent.document.getElementById('cimg').attributes['cmdate'].value  = obj.attributes['imdate'].value;
+      parent.document.getElementById('cimg').attributes['ccdate'].value  = obj.attributes['icdate'].value;    
+    }
+    self.parent.imageChange(action);
+    formObj.action.value = null; // resetting action status   
+  }
+// ============================================================
+// = get current file - set attrib V 1.0, date: 04/18/2005    =
+// ============================================================   
+  function getObject(tfile) { 
+    var x = document.getElementById('iselDiv').getElementsByTagName('li');
+    for (var i = 0; i < x.length; i++) {
+      if (x[i].attributes['ifile'].value == tfile) {          
+        x[i].className = 'cimgdown';
+        imageChangeClick(x[i]);
+      }
+    } 
+  }
+// ============================================================
+// = load/hide message, date: 02/08/2005                      =
+// ============================================================
+  function hideloadmessage() {
+    document.getElementById('dialogLoadMessage').style.display = 'none'
+  }
+-->
+</script>
+<title>Image list</title>
+<meta http-equiv="Pragma" content="no-cache">
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $l->getCharset(); ?>">
+</head>
+<body onload="init(); hideloadmessage();" dir="<?php echo $l->getDir(); ?>">
+<?php include 'loadmsg.php'; ?>
+<form id="rfiles" name="rfiles" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" target="_self">
+  <input type="hidden" name="lang" value="<?php echo $l->lang; ?>" />
+  <input type="hidden" id= "action" name="action" value="<?php echo $action; ?>" />    
+  <div id="iselDiv">
+    <ul>
+      <?php echo getItems($cfg['root_dir'] . $clib, $cfg['valid'], $list); ?>
+    </ul>
+  </div>
+</form>
+</body>
+</html>
+<?php
+  // get images
+  function getItems($path, $valid, $list) {     
+    global $cfg;
+    global $l;    
+      
+    $path = str_replace('//','/', $path); // remove double slash in path if any   
+    $retstr = '';                                  
+    if ($handle = @opendir($path)) {      
+      $files = array();
+      $valids = implode('|', $valid);     
+      while (($file = readdir($handle)) !== false) {                                                            
+        if (is_file($path . $file) && eregi('\.(' . $valids . ')$', $file, $matches)) {                                                                                   
+          $files[$path . $file] = $matches[0];
+        }
+      }
+      closedir($handle);                                               
+      ksort($files);              
+      $dfmt = "m-d-Y";
+      foreach ($files as $filename => $ext) {                   
+        $size     = @getimagesize($path . basename($filename));   
+        if( $size === false ) {
+           continue;
+        }
+        $fsize    = filesize($path . basename($filename));            
+        $modified = date($dfmt, filemtime($path . basename($filename)));
+        $created  = date($dfmt, filectime($path . basename($filename)));                
+        $ctype    = iType($size[2]);        
+        if ($list == true || $list == 1) {
+          $retstr .= '<li class="cimgup" ifile="' . basename($filename) . '" iwidth="' . htmlentities($size[0], ENT_QUOTES) . '" iheight="' . htmlentities($size[1], ENT_QUOTES) . '" itype="' . htmlentities($size[2] . '|' . $ctype, ENT_QUOTES) . '" imdate="' . htmlentities($modified, ENT_QUOTES) . '" icdate="' . htmlentities($created, ENT_QUOTES) . '" isize="' .filesize_h($fsize,2) . '">' . htmlentities(basename($filename), ENT_QUOTES,$l->getCharset()) . '</li>' . "\n";
+        } else {
+          $src     = 'phpThumb/phpThumb.php?src=' . absPath(str_replace($cfg['root_dir'],'', $path)) . basename($filename) . '&w=48&h=48&far=1&bg=ffffff&f=jpg';        
+          $retstr .= '<li class="cimgup" ifile="' . basename($filename) . '" iwidth="' . htmlentities($size[0], ENT_QUOTES) . '" iheight="' . htmlentities($size[1], ENT_QUOTES) . '" itype="' . htmlentities($size[2] . '|' . $ctype, ENT_QUOTES) . '" imdate="' . htmlentities($modified, ENT_QUOTES) . '" icdate="' . htmlentities($created, ENT_QUOTES) . '" isize="' .filesize_h($fsize,2) . '">' . '<img src="' . $src . '" width="48" height="48" alt="' . basename($filename) . '; ' . htmlentities($size[0], ENT_QUOTES) . ' x ' . htmlentities($size[1], ENT_QUOTES) . 'px;' . '" title="' . basename($filename) . '; ' . htmlentities($size[0], ENT_QUOTES) . ' x ' . htmlentities($size[1], ENT_QUOTES) . 'px;' . '"/>' . '</li>' . "\n";
+        }
+      }     
+      return $retstr;
+    }
+    echo $l->m('er_036');     
+    return false;   
+  }
+  // get image types
+  function iType($type) {   
+    switch ($type) {
+      case 1:
+        $str = 'GIF'; break;
+        case 2:
+          $str = 'JPG'; break;
+        case 3:
+          $str = 'PNG'; break;
+        case 4:
+          $str = 'SWF'; break;
+      case 5:
+          $str = 'PSD'; break;
+      case 6:
+          $str = 'BMP'; break;
+      case 7:
+          $str = 'TIFF'; break;
+      case 8:
+          $str = 'TIFF'; break;
+      case 15:
+          $str = 'WBMP'; break;
+      default:
+          $str = 'n/a'; break;
+    }
+    return $str;
+  }
+  
+  //-------------------------------------------------------------------------
+  // Return the human readable size of a file
+  // @param int $size a file size
+  // @param int $dec a number of decimal places
+  function filesize_h($size, $dec = 1) {
+    $sizes = array('b', 'kb', 'mb', 'gb');
+    $count = count($sizes);
+    $i = 0;
+    while ($size >= 1024 && ($i < $count - 1)) {
+      $size /= 1024;
+      $i++;
+    }
+    return round($size, $dec) . '|' . $sizes[$i];
+  }
+  
+  //-------------------------------------------------------------------------
+  // delete image
+  function deleteImg($clib, $cfile) {   
+      global $cfg;      
+      global $l;
+      
+      if (!$cfg['delete']) {
+      return false;
+    }   
+    $path = str_replace('//', '/', $cfg['root_dir'] . $clib);   // remove double slash in path    
+    return @unlink($path . $cfile);               // returns true or false        
+  }
+  
+  //-------------------------------------------------------------------------
+  // rename image 
+  function renameImg($clib, $cfile, $nfile) {   
+    global $cfg;      
+      global $l;
+        
+    if (!$cfg['rename']) {
+      return false;
+    }
+    
+    // check new file extension
+    $ext = strtolower(substr($nfile,strrpos($nfile, '.')+1));
+    if (!in_array($ext, $cfg['valid'])) {             // invalid image / file extension     
+      echo $l->m('er_029');     
+      return false;
+    }
+    
+    $path = str_replace('//', '/', $cfg['root_dir'] . $clib);   // remove double slash in path          
+    if (file_exists($path . $cfile)) {    
+      $nfile = fixFileName($nfile);               // remove invalid characters in file name
+          $nfile = chkFileName($path, $nfile);          // rename if file already exists
+      
+      @rename($path . $cfile, $path . $nfile);        
+          return $nfile;      
+    }
+    return false;
+  }
+  
+  //-------------------------------------------------------------------------
+  // create directory
+  function createDir($clib, $nfile) {   
+      global $cfg;      
+      global $l; 
+     
+      if (!$cfg['create']) {
+      return false;
+    }
+    
+    $nfile = fixFileName($nfile);
+    $tfile = $nfile;
+    $path = str_replace('//', '/', $cfg['root_dir'] . $clib);   // remove double slash in path    
+    
+    // renaming directory if it already exists
+    // keep looping and incrementing _i filenumber until a non-existing one is found    
+    $i = 1;
+    while (file_exists($path . $nfile)) {     
+      $nfile = $tfile . '_' . $i;       
+      $i++;
+    }   
+    
+    $perm = 0777;
+    $oumask = umask(0);
+    umask();
+    if(@mkdir($path . $nfile, $perm)) {
+      umask($oumask);
+      return true;
+    }
+    umask($oumask);
+    return false; 
+  } 
+  //-------------------------------------------------------------------------
+  // upload image
+  function uploadImg($clib, $chkT, $selR) {     
+    global $cfg;
+      global $l;
+      
+      if (!$cfg['upload']) {
+      return false;
+    }
+    
+    foreach ($_FILES['nfile']['size'] as $key => $size) {     
+      if ($size > 0) {      
+        // get file extension and check for validity        
+        $ext = pathinfo($_FILES['nfile']['name'][$key]);
+        $ext = strtolower($ext['extension']);       
+        if (!in_array($ext, $cfg['valid'])) {             // invalid image      
+          echo $l->m('er_029');     
+          return false;
+        }
+        
+        $path  = str_replace('//', '/', $cfg['root_dir'] . $clib);  // remove double slash in path  
+        $nfile = fixFileName($_FILES['nfile']['name'][$key]);     // remove invalid characters in filename          
+        
+        // move file to temp directory for processing
+        if (!move_uploaded_file($_FILES['nfile']['tmp_name'][$key], $cfg['temp'] . '/' . $nfile)) { // upload image to temp dir
+          echo $l->m('er_028');       
+          return false;
+        }
+        
+        $size = getimagesize($cfg['temp'] . '/' . $nfile);  
+        
+        // process (thumbnail) images     
+        $arr = $cfg['thumbs'];        
+        foreach($arr as $key => $thumb) {
+          if (in_array($key, $chkT)) {                    
+            // create new phpThumb() object
+            require_once(dirname(__FILE__) . '/phpThumb/phpthumb.class.php');
+            $phpThumb = new phpThumb();             // create object
+            // parameters
+            $phpThumb->config_cache_disable_warning = true;   // disable cache warning      
+            $phpThumb->config_output_format = $ext;       // output format  
+            $phpThumb->src = $cfg['temp'] . '/' . $nfile;   // destination
+            $phpThumb->q = 95;                  // compression level for jpeg
+            if ($selR != '') {                  // set auto rotate
+              $phpThumb->ar = $selR;
+            };                    
+            //-------------------------------------------------------------------------
+            if ($thumb['size'] > 0 && ($size[0] >= $thumb['size'] || $size[1] >= $thumb['size'])) { // size value is set -> RESIZING and source image is larger than preset sizes
+              // resize parameters
+              if ($size[0] < $size[1]) {                      // portrait
+                $phpThumb->h  = $thumb['size'];       // max. height
+              } else {
+                $phpThumb->w  = $thumb['size'];       // max. width
+              }
+              // crop parameters 
+              if($thumb['crop'] == true) {
+                $phpThumb->zc = 1;              // set zoom crop                
+                $phpThumb->w  = $thumb['size'];       // width
+                $phpThumb->h  = $thumb['size'];       // height
+              }
+              // create file suffix
+              if ($thumb['ext'] == '*') {           // image size is used
+                $dim = '_' . $thumb['size'];        // e.g. _1280
+              } else if ($thumb['ext'] == '') {       // no suffix is created
+                $dim = '';                  
+              } else {                    // suffix is set to $thumb['ext']
+                $dim = '_'. $thumb['ext'];
+              }
+            //-------------------------------------------------------------------------
+            } elseif ($thumb['size'] == 0 || $thumb['size'] == '*') {         // size value is set to '0' -> NO RESIZING
+              // crop parameters
+              if ($thumb['crop'] == true) {
+                $phpThumb->zc = 1;              // set zoom crop
+                if($size[0] < $size[1]) {           // portrait
+                  $phpThumb->w  = $size[0];       // getimagesize width value
+                  $phpThumb->h  = $size[0];       // getimagesize width value
+                } else {                  // landscape
+                  $phpThumb->w  = $size[1];       // getimagesize height value
+                  $phpThumb->h  = $size[1];       // getimagesize height value
+                }
+              }
+              // create file suffix             
+              if ($thumb['ext'] == '*') {           // image size is used
+                $dim = '_' . (($size[0] <= $size[1]) ? $size[1] : $size[0]);  // source height or width - e.g. _1280
+              } else if ($thumb['ext'] == '') {       // no suffix is created
+                $dim = '';
+              } else {                    // suffix is set to $thumb['ext']
+                $dim = '_'. $thumb['ext'];
+              }
+            //-------------------------------------------------------------------------
+            } else {                      // default setting - images smaller than predefined sizes
+              $dim = '';                    // no file suffix is used
+            }
+            //-------------------------------------------------------------------------
+            $nthumb = fixFileName(basename($nfile, '.' . $ext) . $dim . '.' . $ext);          
+            $nthumb = chkFileName($path, $nthumb);        // rename if file already exists                
+            
+            if ($phpThumb->GenerateThumbnail()) {
+              $phpThumb->RenderToFile($path . $nthumb);
+              @chmod($path . $nthumb, 0755) or die($l->m('er_028'));          
+            } else {                      // error        
+              echo $l->m('er_028');
+              return false;
+            }                   
+            unset($phpThumb);           
+          }         
+        }
+        @unlink($cfg['temp'] . '/' . $nfile);           // delete temporary file          
+      }
+    }   
+    return $nthumb;           
+  }
+  //-------------------------------------------------------------------------
+  // escape and clean up file name (only lowercase letters, numbers and underscores are allowed) 
+  function fixFileName($file) {
+    $file = ereg_replace("[^a-z0-9._]", "", str_replace(" ", "_", str_replace("%20", "_", strtolower($file))));
+    return $file;
+  }
+  //-------------------------------------------------------------------------
+  // check whether file already exists; rename file if filename already exists
+  // keep looping and incrementing _i filenumber until a non-existing filename is found
+  function chkFileName($path, $nfile) {
+    $tfile = $nfile;
+    $i = 1;
+    while (file_exists($path . $nfile)) {
+      $nfile = ereg_replace('(.*)(\.[a-zA-Z]+)$', '\1_' . sprintf('%02d',$i) . '\2', $tfile);       
+      $i++;
+    }
+    return $nfile;    
+  }
+  // ============================================================
+  // = abs path - add slashes V 1.0, date: 05/10/2005           =
+  // ============================================================
+  function absPath($path) {   
+    if(substr($path,-1)  != '/') $path .= '/';
+    if(substr($path,0,1) != '/') $path = '/' . $path;
+    return $path;
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/symbols.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/symbols.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/symbols.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,428 @@
+<?php
+  // ================================================
+  // PHP image browser - iBrowser 
+  // ================================================
+  // iBrowser dialog - special characters
+  // ================================================
+  // Developed: net4visions.com
+  // Copyright: net4visions.com
+  // License: GPL - see license.txt
+  // (c)2005 All rights reserved.
+  // ================================================
+  // Revision: 1.0                   Date: 06/04/2005
+  // ================================================
+
+  //-------------------------------------------------------------------------
+  // include configuration settings
+  include '../config/config.inc.php'; 
+  include '../langs/lang.class.php';  
+  // language settings  
+  $l = (@$_REQUEST['lang'] ? new PLUG_Lang(@$_REQUEST['lang']) : new PLUG_Lang($cfg['lang']));
+  $l->setBlock('symbols');
+?>
+<!-- do not delete this line - it's need for proper working of the resizeDialogToContent() function -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<head>
+<title><?php echo $l->m('title'); ?></title>
+<meta http-equiv="Pragma" content="no-cache">
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $l->getCharset()?>">
+<style type="text/css">
+<!--
+ at import url("../css/style.css");
+-->
+</style>
+<script language="javascript" type="text/javascript" src="../scripts/resizeDialog.js"></script>
+<script language="javascript" type="text/javascript">
+<!--
+  
+  var charmap = new Array();  
+  charmap = [
+    ['&nbsp;',    '&#160;',  true, 'no-break space'],
+    ['&amp;',     '&#38;',   true, 'ampersand'],
+    ['&quot;',    '&#34;',   true, 'quotation mark'],
+  // finance
+    ['$',       '&#36;',   true, 'dollar sign'],
+    ['&cent;',    '&#162;',  true, 'cent sign'],
+    ['&euro;',    '&#8364;', true, 'euro sign'],
+    ['&pound;',   '&#163;',  true, 'pound sign'],
+    ['&yen;',     '&#165;',  true, 'yen sign'],
+  // signs
+    ['&copy;',    '&#169;',  true, 'copyright sign'],
+    ['&reg;',     '&#174;',  true, 'registered sign'],
+    ['&trade;',   '&#8482;', true, 'trade mark sign'],
+    ['&permil;',  '&#8240;', true, 'per mille sign'],
+    ['&micro;',   '&#181;',  true, 'micro sign'],
+    ['&middot;',  '&#183;',  true, 'middle dot'],
+    ['&bull;',    '&#8226;', true, 'bullet'],
+    ['&hellip;',  '&#8230;', true, 'three dot leader'],
+    ['&prime;',   '&#8242;', true, 'minutes / feet'],
+    ['&Prime;',   '&#8243;', true, 'seconds / inches'],
+    ['&sect;',    '&#167;',  true, 'section sign'],
+    ['&para;',    '&#182;',  true, 'paragraph sign'],
+    ['&szlig;',   '&#223;',  true, 'sharp s / ess-zed'],
+  // quotations
+    ['&lsaquo;',  '&#8249;', true, 'single left-pointing angle quotation mark'],
+    ['&rsaquo;',  '&#8250;', true, 'single right-pointing angle quotation mark'],
+    ['&laquo;',   '&#171;',  true, 'left pointing guillemet'],
+    ['&raquo;',   '&#187;',  true, 'right pointing guillemet'],
+    ['&lsquo;',   '&#8216;', true, 'left single quotation mark'],
+    ['&rsquo;',   '&#8217;', true, 'right single quotation mark'],
+    ['&ldquo;',   '&#8220;', true, 'left double quotation mark'],
+    ['&rdquo;',   '&#8221;', true, 'right double quotation mark'],
+    ['&sbquo;',   '&#8218;', true, 'single low-9 quotation mark'],
+    ['&bdquo;',   '&#8222;', true, 'double low-9 quotation mark'],
+    ['&lt;',      '&#60;',   true, 'less-than sign'],
+    ['&gt;',      '&#62;',   true, 'greater-than sign'],
+    ['&le;',      '&#8804;', true, 'less-than or equal to'],
+    ['&ge;',      '&#8805;', true, 'greater-than or equal to'],
+    ['&ndash;',   '&#8211;', true, 'en dash'],
+    ['&mdash;',   '&#8212;', true, 'em dash'],
+    ['&macr;',    '&#175;',  true, 'macron'],
+    ['&oline;',   '&#8254;', true, 'overline'],
+    ['&curren;',  '&#164;',  true, 'currency sign'],
+    ['&brvbar;',  '&#166;',  true, 'broken bar'],
+    ['&uml;',     '&#168;',  true, 'diaeresis'],
+    ['&iexcl;',   '&#161;',  true, 'inverted exclamation mark'],
+    ['&iquest;',  '&#191;',  true, 'turned question mark'],
+    ['&circ;',    '&#710;',  true, 'circumflex accent'],
+    ['&tilde;',   '&#732;',  true, 'small tilde'],
+    ['&deg;',     '&#176;',  true, 'degree sign'],
+    ['&minus;',   '&#8722;', true, 'minus sign'],
+    ['&plusmn;',  '&#177;',  true, 'plus-minus sign'],
+    ['&divide;',  '&#247;',  true, 'division sign'],
+    ['&frasl;',   '&#8260;', true, 'fraction slash'],
+    ['&times;',   '&#215;',  true, 'multiplication sign'],
+    ['&sup1;',    '&#185;',  true, 'superscript one'],
+    ['&sup2;',    '&#178;',  true, 'superscript two'],
+    ['&sup3;',    '&#179;',  true, 'superscript three'],
+    ['&frac14;',  '&#188;',  true, 'fraction one quarter'],
+    ['&frac12;',  '&#189;',  true, 'fraction one half'],
+    ['&frac34;',  '&#190;',  true, 'fraction three quarters'],
+  // math / logical
+    ['&fnof;',    '&#402;',  true, 'function / florin'],
+    ['&int;',     '&#8747;', true, 'integral'],
+    ['&sum;',     '&#8721;', true, 'n-ary sumation'],
+    ['&infin;',   '&#8734;', true, 'infinity'],
+    ['&radic;',   '&#8730;', true, 'square root'],
+    ['&sim;',     '&#8764;', false,'similar to'],
+    ['&cong;',    '&#8773;', false,'approximately equal to'],
+    ['&asymp;',   '&#8776;', true, 'almost equal to'],
+    ['&ne;',      '&#8800;', true, 'not equal to'],
+    ['&equiv;',   '&#8801;', true, 'identical to'],
+    ['&isin;',    '&#8712;', false,'element of'],
+    ['&notin;',   '&#8713;', false,'not an element of'],
+    ['&ni;',      '&#8715;', false,'contains as member'],
+    ['&prod;',    '&#8719;', true, 'n-ary product'],
+    ['&and;',     '&#8743;', false,'logical and'],
+    ['&or;',      '&#8744;', false,'logical or'],
+    ['&not;',     '&#172;',  true, 'not sign'],
+    ['&cap;',     '&#8745;', true, 'intersection'],
+    ['&cup;',     '&#8746;', false,'union'],
+    ['&part;',    '&#8706;', true, 'partial differential'],
+    ['&forall;',  '&#8704;', false,'for all'],
+    ['&exist;',   '&#8707;', false,'there exists'],
+    ['&empty;',   '&#8709;', false,'diameter'],
+    ['&nabla;',   '&#8711;', false,'backward difference'],
+    ['&lowast;',  '&#8727;', false,'asterisk operator'],
+    ['&prop;',    '&#8733;', false,'proportional to'],
+    ['&ang;',     '&#8736;', false,'angle'],
+  // undefined
+    ['&acute;',   '&#180;',  true, 'acute accent'],
+    ['&cedil;',   '&#184;',  true, 'cedilla'],
+    ['&ordf;',    '&#170;',  true, 'feminine ordinal indicator'],
+    ['&ordm;',    '&#186;',  true, 'masculine ordinal indicator'],
+    ['&dagger;',  '&#8224;', true, 'dagger'],
+    ['&Dagger;',  '&#8225;', true, 'double dagger'],
+  // alphabetical special chars
+    ['&Agrave;',  '&#192;',  true, 'A - grave'],
+    ['&Aacute;',  '&#193;',  true, 'A - acute'],
+    ['&Acirc;',   '&#194;',  true, 'A - circumflex'],
+    ['&Atilde;',  '&#195;',  true, 'A - tilde'],
+    ['&Auml;',    '&#196;',  true, 'A - diaeresis'],
+    ['&Aring;',   '&#197;',  true, 'A - ring above'],
+    ['&AElig;',   '&#198;',  true, 'ligature AE'],
+    ['&Ccedil;',  '&#199;',  true, 'C - cedilla'],
+    ['&Egrave;',  '&#200;',  true, 'E - grave'],
+    ['&Eacute;',  '&#201;',  true, 'E - acute'],
+    ['&Ecirc;',   '&#202;',  true, 'E - circumflex'],
+    ['&Euml;',    '&#203;',  true, 'E - diaeresis'],
+    ['&Igrave;',  '&#204;',  true, 'I - grave'],
+    ['&Iacute;',  '&#205;',  true, 'I - acute'],
+    ['&Icirc;',   '&#206;',  true, 'I - circumflex'],
+    ['&Iuml;',    '&#207;',  true, 'I - diaeresis'],
+    ['&ETH;',     '&#208;',  true, 'ETH'],
+    ['&Ntilde;',  '&#209;',  true, 'N - tilde'],
+    ['&Ograve;',  '&#210;',  true, 'O - grave'],
+    ['&Oacute;',  '&#211;',  true, 'O - acute'],
+    ['&Ocirc;',   '&#212;',  true, 'O - circumflex'],
+    ['&Otilde;',  '&#213;',  true, 'O - tilde'],
+    ['&Ouml;',    '&#214;',  true, 'O - diaeresis'],
+    ['&Oslash;',  '&#216;',  true, 'O - slash'],
+    ['&OElig;',   '&#338;',  true, 'ligature OE'],
+    ['&Scaron;',  '&#352;',  true, 'S - caron'],
+    ['&Ugrave;',  '&#217;',  true, 'U - grave'],
+    ['&Uacute;',  '&#218;',  true, 'U - acute'],
+    ['&Ucirc;',   '&#219;',  true, 'U - circumflex'],
+    ['&Uuml;',    '&#220;',  true, 'U - diaeresis'],
+    ['&Yacute;',  '&#221;',  true, 'Y - acute'],
+    ['&Yuml;',    '&#376;',  true, 'Y - diaeresis'],
+    ['&THORN;',   '&#222;',  true, 'THORN'],
+    ['&agrave;',  '&#224;',  true, 'a - grave'],
+    ['&aacute;',  '&#225;',  true, 'a - acute'],
+    ['&acirc;',   '&#226;',  true, 'a - circumflex'],
+    ['&atilde;',  '&#227;',  true, 'a - tilde'],
+    ['&auml;',    '&#228;',  true, 'a - diaeresis'],
+    ['&aring;',   '&#229;',  true, 'a - ring above'],
+    ['&aelig;',   '&#230;',  true, 'ligature ae'],
+    ['&ccedil;',  '&#231;',  true, 'c - cedilla'],
+    ['&egrave;',  '&#232;',  true, 'e - grave'],
+    ['&eacute;',  '&#233;',  true, 'e - acute'],
+    ['&ecirc;',   '&#234;',  true, 'e - circumflex'],
+    ['&euml;',    '&#235;',  true, 'e - diaeresis'],
+    ['&igrave;',  '&#236;',  true, 'i - grave'],
+    ['&iacute;',  '&#237;',  true, 'i - acute'],
+    ['&icirc;',   '&#238;',  true, 'i - circumflex'],
+    ['&iuml;',    '&#239;',  true, 'i - diaeresis'],
+    ['&eth;',     '&#240;',  true, 'eth'],
+    ['&ntilde;',  '&#241;',  true, 'n - tilde'],
+    ['&ograve;',  '&#242;',  true, 'o - grave'],
+    ['&oacute;',  '&#243;',  true, 'o - acute'],
+    ['&ocirc;',   '&#244;',  true, 'o - circumflex'],
+    ['&otilde;',  '&#245;',  true, 'o - tilde'],
+    ['&ouml;',    '&#246;',  true, 'o - diaeresis'],
+    ['&oslash;',  '&#248;',  true, 'o slash'],
+    ['&oelig;',   '&#339;',  true, 'ligature oe'],
+    ['&scaron;',  '&#353;',  true, 's - caron'],
+    ['&ugrave;',  '&#249;',  true, 'u - grave'],
+    ['&uacute;',  '&#250;',  true, 'u - acute'],
+    ['&ucirc;',   '&#251;',  true, 'u - circumflex'],
+    ['&uuml;',    '&#252;',  true, 'u - diaeresis'],
+    ['&yacute;',  '&#253;',  true, 'y - acute'],
+    ['&thorn;',   '&#254;',  true, 'thorn'],
+    ['&yuml;',    '&#255;',  true, 'y - diaeresis'],
+    ['&Alpha;',   '&#913;',  true, 'Alpha'],
+    ['&Beta;',    '&#914;',  true, 'Beta'],
+    ['&Gamma;',   '&#915;',  true, 'Gamma'],
+    ['&Delta;',   '&#916;',  true, 'Delta'],
+    ['&Epsilon;', '&#917;',  true, 'Epsilon'],
+    ['&Zeta;',    '&#918;',  true, 'Zeta'],
+    ['&Eta;',     '&#919;',  true, 'Eta'],
+    ['&Theta;',   '&#920;',  true, 'Theta'],
+    ['&Iota;',    '&#921;',  true, 'Iota'],
+    ['&Kappa;',   '&#922;',  true, 'Kappa'],
+    ['&Lambda;',  '&#923;',  true, 'Lambda'],
+    ['&Mu;',      '&#924;',  true, 'Mu'],
+    ['&Nu;',      '&#925;',  true, 'Nu'],
+    ['&Xi;',      '&#926;',  true, 'Xi'],
+    ['&Omicron;', '&#927;',  true, 'Omicron'],
+    ['&Pi;',      '&#928;',  true, 'Pi'],
+    ['&Rho;',     '&#929;',  true, 'Rho'],
+    ['&Sigma;',   '&#931;',  true, 'Sigma'],
+    ['&Tau;',     '&#932;',  true, 'Tau'],
+    ['&Upsilon;', '&#933;',  true, 'Upsilon'],
+    ['&Phi;',     '&#934;',  true, 'Phi'],
+    ['&Chi;',     '&#935;',  true, 'Chi'],
+    ['&Psi;',     '&#936;',  true, 'Psi'],
+    ['&Omega;',   '&#937;',  true, 'Omega'],
+    ['&alpha;',   '&#945;',  true, 'alpha'],
+    ['&beta;',    '&#946;',  true, 'beta'],
+    ['&gamma;',   '&#947;',  true, 'gamma'],
+    ['&delta;',   '&#948;',  true, 'delta'],
+    ['&epsilon;', '&#949;',  true, 'epsilon'],
+    ['&zeta;',    '&#950;',  true, 'zeta'],
+    ['&eta;',     '&#951;',  true, 'eta'],
+    ['&theta;',   '&#952;',  true, 'theta'],
+    ['&iota;',    '&#953;',  true, 'iota'],
+    ['&kappa;',   '&#954;',  true, 'kappa'],
+    ['&lambda;',  '&#955;',  true, 'lambda'],
+    ['&mu;',      '&#956;',  true, 'mu'],
+    ['&nu;',      '&#957;',  true, 'nu'],
+    ['&xi;',      '&#958;',  true, 'xi'],
+    ['&omicron;', '&#959;',  true, 'omicron'],
+    ['&pi;',      '&#960;',  true, 'pi'],
+    ['&rho;',     '&#961;',  true, 'rho'],
+    ['&sigmaf;',  '&#962;',  true, 'final sigma'],
+    ['&sigma;',   '&#963;',  true, 'sigma'],
+    ['&tau;',     '&#964;',  true, 'tau'],
+    ['&upsilon;', '&#965;',  true, 'upsilon'],
+    ['&phi;',     '&#966;',  true, 'phi'],
+    ['&chi;',     '&#967;',  true, 'chi'],
+    ['&psi;',     '&#968;',  true, 'psi'],
+    ['&omega;',   '&#969;',  true, 'omega'],
+  // symbols
+    ['&alefsym;', '&#8501;', false,'alef symbol'],
+    ['&piv;',     '&#982;',  false,'pi symbol'],
+    ['&real;',    '&#8476;', false,'real part symbol'],
+    ['&thetasym;','&#977;',  false,'theta symbol'],
+    ['&upsih;',   '&#978;',  false,'upsilon - hook symbol'],
+    ['&weierp;',  '&#8472;', false,'Weierstrass p'],
+    ['&image;',   '&#8465;', false,'imaginary part'],
+  // arrows
+    ['&larr;',    '&#8592;', true, 'leftwards arrow'],
+    ['&uarr;',    '&#8593;', true, 'upwards arrow'],
+    ['&rarr;',    '&#8594;', true, 'rightwards arrow'],
+    ['&darr;',    '&#8595;', true, 'downwards arrow'],
+    ['&harr;',    '&#8596;', true, 'left right arrow'],
+    ['&crarr;',   '&#8629;', false,'carriage return'],
+    ['&lArr;',    '&#8656;', false,'leftwards double arrow'],
+    ['&uArr;',    '&#8657;', false,'upwards double arrow'],
+    ['&rArr;',    '&#8658;', false,'rightwards double arrow'],
+    ['&dArr;',    '&#8659;', false,'downwards double arrow'],
+    ['&hArr;',    '&#8660;', false,'left right double arrow'],
+    ['&there4;',  '&#8756;', false,'therefore'],
+    ['&sub;',     '&#8834;', false,'subset of'],
+    ['&sup;',     '&#8835;', false,'superset of'],
+    ['&nsub;',    '&#8836;', false,'not a subset of'],
+    ['&sube;',    '&#8838;', false,'subset of or equal to'],
+    ['&supe;',    '&#8839;', false,'superset of or equal to'],
+    ['&oplus;',   '&#8853;', false,'circled plus'],
+    ['&otimes;',  '&#8855;', false,'circled times'],
+    ['&perp;',    '&#8869;', false,'perpendicular'],
+    ['&sdot;',    '&#8901;', false,'dot operator'],
+    ['&lceil;',   '&#8968;', false,'left ceiling'],
+    ['&rceil;',   '&#8969;', false,'right ceiling'],
+    ['&lfloor;',  '&#8970;', false,'left floor'],
+    ['&rfloor;',  '&#8971;', false,'right floor'],
+    ['&lang;',    '&#9001;', false,'left-pointing angle bracket'],
+    ['&rang;',    '&#9002;', false,'right-pointing angle bracket'],
+    ['&loz;',     '&#9674;', true,'lozenge'],
+    ['&spades;',  '&#9824;', false,'black spade suit'],
+    ['&clubs;',   '&#9827;', true, 'black club suit'],
+    ['&hearts;',  '&#9829;', true, 'black heart suit'],
+    ['&diams;',   '&#9830;', true, 'black diamond suit'],
+    ['&ensp;',    '&#8194;', false,'en space'],
+    ['&emsp;',    '&#8195;', false,'em space'],
+    ['&thinsp;',  '&#8201;', false,'thin space'],
+    ['&zwnj;',    '&#8204;', false,'zero width non-joiner'],
+    ['&zwj;',     '&#8205;', false,'zero width joiner'],
+    ['&lrm;',     '&#8206;', false,'left-to-right mark'],
+    ['&rlm;',     '&#8207;', false,'right-to-left mark'],
+    ['&shy;',     '&#173;',  false,'soft hyphen']
+  ];
+// ============================================================
+// = create symbol table V 1.0, date: 03/31/2005              =
+// ============================================================
+    function renderCharMapHTML() {
+        var charsPerRow = 20, tdWidth=20, tdHeight=20;
+        var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
+        var cols=-1;
+        for (var i=0; i<charmap.length; i++) {
+            if (charmap[i][2] == true) {
+                cols++;
+                html += ''
+                    + '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"'
+                    + ' onmouseover="this.className=\'charmapOver\';'
+                    + 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');"'
+                    + ' onmouseout="this.className=\'charmap\';"'
+                    + ' onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\'); return false;"'
+                    + ' title="' + charmap[i][3] + '" nowrap="nowrap">'
+                    + charmap[i][1]
+                    + '</td>';
+                if ((cols+1) % charsPerRow == 0)
+                    html += '</tr><tr height="' + tdHeight + '">';
+            }
+         }
+        if (cols % charsPerRow > 0) {
+            var padd = charsPerRow - (cols % charsPerRow);
+            for (var i=0; i < padd-1; i++)
+                html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap">&nbsp;</td>';
+        }
+        html += '</tr></table>';
+        document.write(html);
+    }
+// ============================================================
+// = insert current symbol V 1.0, date: 03/31/2005            =
+// ============================================================
+    function insertChar(chr) {        
+    var args = window.dialogArguments;
+    var rArgs = {};
+    rArgs.elm = args.elm; // passing calling object/element back to parent
+    rArgs.chr = '\&#' + chr + ';'   
+    window.returnValue = rArgs;   
+    window.close();
+    if (iBrowser.isGecko) {       
+      <?php
+        if (!empty($_REQUEST['callback'])) {
+          echo "opener." . $_REQUEST['callback'] . "('" . "',this);\n";         
+        }
+      ?>
+    }   
+    } 
+// ============================================================
+// = preview current symbol V 1.0, date: 03/31/2005           =
+// ============================================================
+    function previewChar(codeA, codeB, codeN) {
+        var elmA = document.getElementById('codeA');
+        var elmB = document.getElementById('codeB');
+        var elmV = document.getElementById('codeV');
+        var elmN = document.getElementById('codeN');
+
+        if (codeA=='#160;') {
+            elmV.innerHTML = '__';
+        } else {
+            elmV.innerHTML = '&' + codeA;
+        }
+
+        elmB.innerHTML = '&amp;' + codeA;
+        elmA.innerHTML = '&amp;' + codeB;
+        elmN.innerHTML = codeN;
+    } 
+// ============================================================
+// = symbols init V 1.0, date: 03/31/2005                     =
+// ============================================================
+  function init() {   
+    var args = window.dialogArguments;    
+    iBrowser = args.iBrowser;
+    resizeDialogToContent();
+    window.focus();
+    }
+//-->
+</script>
+</head>
+<body onLoad="init()" dir="<?php echo $l->getDir() ;?>">
+<div id="dialog">
+  <div class="headerDiv">
+    <?php echo $l->m('title'); ?>
+  </div>
+  <div class="brdPad">
+    <table border="0" cellspacing="5" cellpadding="0">
+      <tr>
+        <td valign="middle" ><script language="javascript" type="text/javascript">
+            <!--
+                renderCharMapHTML();
+            //-->
+            </script></td>
+        <td width="60" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+            <tr>
+              <td class="charPrev" id="codeV">&nbsp;</td>
+            </tr>
+          </table></td>
+      </tr>
+      <tr>
+        <td><table width="100%" border="0" cellspacing="5" cellpadding="0">
+            <tr>
+              <td colspan="3"><strong>Name:</strong>
+                <span id="codeN">
+&nbsp;
+                </span></td>
+            </tr>
+            <tr>
+              <td width="33%"><strong>HTML Code:</strong>
+                <span id="codeA">
+&nbsp;
+                </span></td>
+              <td width="33%"><strong>Num Code:</strong>
+                <span id="codeB">
+&nbsp;
+                </span></td>
+              <td>&nbsp;</td>
+            </tr>
+          </table></td>
+        <td><img src="../images/spacer.gif" width="60" height="1" /></td>
+      </tr>
+    </table>
+  </div>
+</div>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/validateForm.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/validateForm.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/scripts/validateForm.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,145 @@
+///////////////////////////////////////////////////
+///    JavaScript Form Validation Functions      //
+//   by James Heinrich <info at silisoftware.com>   //
+//   available at http://www.silisoftware.com   ///
+///////////////////////////////////////////////////
+///                                              //
+//  v1.0.3 - 17 Mar 2005                         //
+//    ¤ Added IsValidHexColor() function         //
+//                                               //
+//  v1.0.2 - 07 Mar 2005                         //
+//    ¤ Added CharacterReplace() function        //
+//                                               //
+//  v1.0.1 - 12 Dec 2004                         //
+//    ¤ Added generic MatchesPattern() function  //
+//      and made IsValidEmail() and IsValidURL() //
+//      work through it                          //
+//                                               //
+//  v1.0.0 - 11 Dec 2004                         //
+//    ¤ Initial public release                   //
+//                                              ///
+///////////////////////////////////////////////////
+
+// ex: <input type="text" name="Name"  onKeyUp="RemoveInvalidChars(this, '[^A-Za-z0-9 \-]');">
+// ex: <input type="text" name="Email" onKeyUp="RemoveInvalidChars(this, '[^A-Za-z0-9 \@\.\-]'); ForceLowercase(this);">
+// ex: <input type="submit" value="Submit" onClick="if (!IsValidEmail(theform.email.value)) { alert("Please enter a valid E-mail address"); theform.email.focus(); return false; } else if (!IsValidURL(theform.url.value)) { alert("Please enter a valid URL"); theform.url.focus(); return false; }">
+
+// Note: onChange event will not fire in IE if onKeyUp event returns true, so add a return false, like this:
+// <input type="text" onKeyUp="RemoveInvalidChars(this, '[^A-Za-z0-9 \-]'); return false;" onChange="doSomethingElse();">
+
+function RemoveInvalidChars(theinput, pattern) {
+  reg = new RegExp(pattern, 'g');
+  newstring = theinput.value.replace(reg, '');
+  // only update the input if invalid chars have been replaced
+  // to avoid annoying behavior (e.g. moving cursor to end of text)
+  if (newstring != theinput.value) {
+    theinput.value = newstring;
+  }
+  return true;
+}
+
+function ForceUppercase(theinput) {
+  // ex: <input type="text" onKeyUp="RemoveInvalidChars(this, '[^A-Za-z0-9 \-]');">
+  newstring = theinput.value.toUpperCase();
+  // only update the input if invalid chars have been replaced
+  // to avoid annoying behavior (e.g. moving cursor to end of text)
+  if (newstring != theinput.value) {
+    theinput.value = newstring;
+  }
+  return true;
+}
+
+function ForceLowercase(theinput) {
+  newstring = theinput.value.toLowerCase();
+  // only update the input if invalid chars have been replaced
+  // to avoid annoying behavior (e.g. moving cursor to end of text)
+  if (newstring != theinput.value) {
+    theinput.value = newstring;
+  }
+  return true;
+}
+
+function CharacterReplace(theinput, from, to) {
+  newstring = theinput.value.replace(from, to);
+  if (newstring != theinput.value) {
+    theinput.value = newstring;
+  }
+  return true;
+}
+
+function FormatPhoneNumber(theinput) {
+  reg = new RegExp('[^0-9]', 'g');
+  numbersonly = theinput.value.replace(reg, '');
+
+  if (numbersonly.length > 7) {
+    newstring = '(' + numbersonly.substr(0, 3) + ')' + numbersonly.substr(3, 3) + '-' + numbersonly.substr(6, 4);
+  } else if (numbersonly.length > 3) {
+    newstring = numbersonly.substr(0, 3) + '-' + numbersonly.substr(3, 4);
+  } else {
+    newstring = numbersonly;
+  }
+  // only update the input if the text has changed
+  // to avoid annoying behavior (e.g. moving cursor to end of text)
+  if (newstring != theinput.value) {
+    theinput.value = newstring;
+  }
+  return true;
+}
+
+function MatchesPattern(theString, pattern) {
+  // Note: regular expressions passed to this function that have escaped
+  // characters also need the escape character escaped, otherwise JavaScript
+  // will make it disappear, for example:
+  // MatchesPattern(mystring, '\w\.\w');    // won't work
+  // MatchesPattern(mystring, '\\w\\.\\w'); // will work
+  reg = new RegExp(pattern, 'g');
+  return Boolean(reg.exec(theString));
+}
+
+function IsValidEmail(emailstring) {
+  // regex adapted from http://www.yxscripts.com/fg/form.html
+  return MatchesPattern(emailstring, '\\w[\\w\\-\\.]*\\@\\w[\\w\\-]+(\\.[\\w\\-]{2,})+');
+}
+
+function IsValidURL(urlstring) {
+  return MatchesPattern(urlstring, 'http:\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+');
+}
+
+function IsValidHexColor(urlstring) {
+  return MatchesPattern(urlstring, '^#[0-9a-zA-Z]{6}$');
+}
+
+function SetElementTextColor(theelement, thecolor) {
+  if (theelement.style) {
+    theelement.style.color = thecolor;
+  }
+  return true;
+}
+
+function HighlightThis(theelement) {
+  if (theelement.style) {
+    theelement.style.background = '#FFFF00';
+  }
+  return true;
+}
+
+function UnHighlightThis(theelement) {
+  if (theelement.style) {
+    theelement.style.background = '#FFFFFF';
+  }
+  return true;
+}
+
+function StringPad(string, length, character) {
+  while (string.length < length) {
+      string = character + string;
+  }
+  return string;
+}
+
+function RGB2hex(red, green, blue) {
+  r = StringPad(parseInt(red).toString(16),   2, '0');
+  g = StringPad(parseInt(green).toString(16), 2, '0');
+  b = StringPad(parseInt(blue).toString(16),  2, '0');
+  return r+g+b;
+} 
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/temp/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/temp/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/ibrowser/temp/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+header('Location: /');
+exit;
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('iespell','en,tr,cs,el,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl,da,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_IESpellPlugin={getInfo:function(){return{longname:'IESpell (MSIE Only)',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){if(cn=="iespell"&&(tinyMCE.isMSIE&&!tinyMCE.isOpera))return tinyMCE.getButtonHTML(cn,'lang_iespell_desc','{$pluginurl}/images/iespell.gif','mceIESpell');return"";},execCommand:function(editor_id,element,command,user_interface,value){if(command=="mceIESpell"){try{var ieSpell=new ActiveXObject("ieSpell.ieSpellExtension");ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);}catch(e){if(e.number==-2146827859){if(confirm(tinyMCE.getLang("lang_iespell_download","",true)))window.open('http://www.iespell.com/download.php','ieSpellDownload','');}else alert("Error Loading ieSpell: Exception "+e.number);}return true;}return false;}};tinyMCE.addPlugin("iespell",TinyMCE_IESpellPlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.20 $
+ * $Date: 2006/02/10 16:29:39 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('iespell', 'en,tr,cs,el,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl,da,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');
+
+var TinyMCE_IESpellPlugin = {
+  getInfo : function() {
+    return {
+      longname : 'IESpell (MSIE Only)',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  /**
+   * Returns the HTML contents of the iespell control.
+   */
+  getControlHTML : function(cn) {
+    // Is it the iespell control and is the brower MSIE.
+    if (cn == "iespell" && (tinyMCE.isMSIE && !tinyMCE.isOpera))
+      return tinyMCE.getButtonHTML(cn, 'lang_iespell_desc', '{$pluginurl}/images/iespell.gif', 'mceIESpell');
+
+    return "";
+  },
+
+  /**
+   * Executes the mceIESpell command.
+   */
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    // Handle ieSpellCommand
+    if (command == "mceIESpell") {
+      try {
+        var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension");
+        ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);
+      } catch (e) {
+        if (e.number == -2146827859) {
+          if (confirm(tinyMCE.getLang("lang_iespell_download", "", true)))
+            window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
+        } else
+          alert("Error Loading ieSpell: Exception " + e.number);
+      }
+
+      return true;
+    }
+
+    // Pass to next handler in chain
+    return false;
+  }
+};
+
+tinyMCE.addPlugin("iespell", TinyMCE_IESpellPlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/images/iespell.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/images/iespell.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,7 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+iespell_desc : 'Run spell checking',
+iespell_download : "ieSpell not detected. Click OK to go to download page."
+});
+

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/iespell/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('layer','en');var TinyMCE_LayerPlugin={getInfo:function(){return{longname:'Layer',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_layer.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isMSIE&&!tinyMCE.isOpera)inst.getDoc().execCommand('2D-Position');},handleEvent:function(e){var inst=tinyMCE.selectedInstance,self=TinyMCE_LayerPlugin;var w=inst.getWin(),le=inst._lastStyleElm,e;if(tinyMCE.isGecko){e=self._getParentLayer(inst.getFocusElement());if(e){if(!inst._lastStyleElm){e.style.overflow='auto';inst._lastStyleElm=e;}}else if(le){le=inst._lastStyleElm;le.style.width=le.scrollWidth+'px';le.style.height=le.scrollHeight+'px';le.style.overflow='';inst._lastStyleElm=null;}}return true;},handleVisualAid:function(el,deep,state,inst){var nl=inst.getDoc().getElementsByTagName("div"),i;for(i=0;i<nl.length;i++){if(new RegExp('absolute|relative|static','gi').test(nl[i].style.position)){if(state)tinyMCE.addCSSClass(nl[i],'mceVisualAid');else tinyMCE.removeCSSClass(nl[i],'mceVisualAid');}}},getControlHTML:function(cn){switch(cn){case"moveforward":return tinyMCE.getButtonHTML(cn,'lang_layer_forward_desc','{$pluginurl}/images/forward.gif','mceMoveForward',true);case"movebackward":return tinyMCE.getButtonHTML(cn,'lang_layer_backward_desc','{$pluginurl}/images/backward.gif','mceMoveBackward',true);case"absolute":return tinyMCE.getButtonHTML(cn,'lang_layer_absolute_desc','{$pluginurl}/images/absolute.gif','mceMakeAbsolute',true);case"insertlayer":return tinyMCE.getButtonHTML(cn,'lang_layer_insertlayer_desc','{$pluginurl}/images/insert_layer.gif','mceInsertLayer',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){var self=TinyMCE_LayerPlugin;switch(command){case"mceInsertLayer":self._insertLayer();return true;case"mceMoveForward":self._move(1);return true;case"mceMoveBackward":self._move(-1);return true;case"mceMakeAbsolute":self._toggleAbsolute();return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var inst=tinyMCE.getInstanceById(editor_id),self=TinyMCE_LayerPlugin;var le=self._getParentLayer(inst.getFocusElement());var p=tinyMCE.getParentElement(inst.getFocusElement(),'div,p,img');tinyMCE.switchClass(editor_id+'_absolute','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_moveforward','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_movebackward','mceButtonDisabled');if(p)tinyMCE.switchClass(editor_id+'_absolute','mceButtonNormal');if(le&&le.style.position.toLowerCase()=="absolute"){tinyMCE.switchClass(editor_id+'_absolute','mceButtonSelected');tinyMCE.switchClass(editor_id+'_moveforward','mceButtonNormal');tinyMCE.switchClass(editor_id+'_movebackward','mceButtonNormal');}},_move:function(d){var inst=tinyMCE.selectedInstance,self=TinyMCE_LayerPlugin,i,z=new Array();var le=self._getParentLayer(inst.getFocusElement()),ci=-1,fi=-1;var nl=tinyMCE.selectNodes(inst.getBody(),function(n){return n.nodeType==1&&new RegExp('absolute|relative|static','gi').test(n.style.position);});for(i=0;i<nl.length;i++){z[i]=nl[i].style.zIndex?parseInt(nl[i].style.zIndex):0;if(ci<0&&nl[i]==le)ci=i;}if(d<0){for(i=0;i<z.length;i++){if(z[i]<z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else{if(z[ci]>0)nl[ci].style.zIndex=z[ci]-1;}}else{for(i=0;i<z.length;i++){if(z[i]>z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else nl[ci].style.zIndex=z[ci]+1;}inst.repaint();},_getParentLayer:function(n){return tinyMCE.getParentNode(n,function(n){return n.nodeType==1&&new RegExp('absolute|relative|static','gi').test(n.style.position);});},_insertLayer:function(){var inst=tinyMCE.selectedInstance;var e=tinyMCE.getParentElement(inst.getFocusElement());var p=tinyMCE.getAbsPosition(e);var d=inst.getDoc();var ne=d.createElement('div');var h=inst.selection.getSelectedHTML();ne.style.position='absolute';ne.style.left=p.absLeft+'px';ne.style.top=(p.absTop>20?p.absTop:20)+'px';ne.style.width='100px';ne.style.height='100px';ne.className='mceVisualAid';if(!h)h=tinyMCE.getLang('lang_layer_content');ne.innerHTML=h;d.body.appendChild(ne);},_toggleAbsolute:function(){var inst=tinyMCE.selectedInstance,self=TinyMCE_LayerPlugin;var le=self._getParentLayer(inst.getFocusElement());if(le==null)le=tinyMCE.getParentElement(inst.getFocusElement(),'div,p,img');if(le){if(le.style.position.toLowerCase()=="absolute"){le.style.position="";le.style.left="";le.style.top="";}else{le.style.position="absolute";if(le.style.left=="")le.style.left=20+'px';if(le.style.top=="")le.style.top=20+'px';if(le.style.width=="")le.style.width=le.width?(le.width+'px'):'100px';if(le.style.height=="")le.style.height=le.height?(le.height+'px'):'100px';tinyMCE.handleVisualAid(inst.getBody(),true,inst.visualAid,inst);}inst.repaint();tinyMCE.triggerNodeChange();}}};tinyMCE.addPlugin("layer",TinyMCE_LayerPlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,252 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.2 $
+ * $Date: 2006/05/03 14:12:12 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('layer', 'en');
+
+var TinyMCE_LayerPlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Layer',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_layer.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  initInstance : function(inst) {
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+      inst.getDoc().execCommand('2D-Position');
+  },
+
+  handleEvent : function(e) {
+    var inst = tinyMCE.selectedInstance, self = TinyMCE_LayerPlugin;
+    var w = inst.getWin(), le = inst._lastStyleElm, e;
+
+    if (tinyMCE.isGecko) {
+      e = self._getParentLayer(inst.getFocusElement());
+
+      if (e) {
+        if (!inst._lastStyleElm) {
+          e.style.overflow = 'auto';
+          inst._lastStyleElm = e;
+        }
+      } else if (le) {
+        le = inst._lastStyleElm;
+        le.style.width = le.scrollWidth + 'px';
+        le.style.height = le.scrollHeight + 'px';
+        le.style.overflow = '';
+        inst._lastStyleElm = null;
+      }
+    }
+
+    return true;
+  },
+
+  handleVisualAid : function(el, deep, state, inst) {
+    var nl = inst.getDoc().getElementsByTagName("div"), i;
+
+    for (i=0; i<nl.length; i++) {
+      if (new RegExp('absolute|relative|static', 'gi').test(nl[i].style.position)) {
+        if (state)
+          tinyMCE.addCSSClass(nl[i], 'mceVisualAid');
+        else
+          tinyMCE.removeCSSClass(nl[i], 'mceVisualAid');          
+      }
+    }
+  },
+
+  getControlHTML : function(cn) {
+    switch (cn) {
+      case "moveforward":
+        return tinyMCE.getButtonHTML(cn, 'lang_layer_forward_desc', '{$pluginurl}/images/forward.gif', 'mceMoveForward', true);
+
+      case "movebackward":
+        return tinyMCE.getButtonHTML(cn, 'lang_layer_backward_desc', '{$pluginurl}/images/backward.gif', 'mceMoveBackward', true);
+
+      case "absolute":
+        return tinyMCE.getButtonHTML(cn, 'lang_layer_absolute_desc', '{$pluginurl}/images/absolute.gif', 'mceMakeAbsolute', true);
+
+      case "insertlayer":
+        return tinyMCE.getButtonHTML(cn, 'lang_layer_insertlayer_desc', '{$pluginurl}/images/insert_layer.gif', 'mceInsertLayer', true);
+    }
+
+    return "";
+  },
+
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    var self = TinyMCE_LayerPlugin;
+
+    // Handle commands
+    switch (command) {
+      case "mceInsertLayer":
+        self._insertLayer();
+        return true;
+
+      case "mceMoveForward":
+        self._move(1);
+        return true;
+
+      case "mceMoveBackward":
+        self._move(-1);
+        return true;
+
+      case "mceMakeAbsolute":
+        self._toggleAbsolute();
+        return true;
+    }
+
+    // Pass to next handler in chain
+    return false;
+  },
+
+  handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+    var inst = tinyMCE.getInstanceById(editor_id), self = TinyMCE_LayerPlugin;
+    var le = self._getParentLayer(inst.getFocusElement());
+    var p = tinyMCE.getParentElement(inst.getFocusElement(), 'div,p,img');
+
+    tinyMCE.switchClass(editor_id + '_absolute', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_moveforward', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_movebackward', 'mceButtonDisabled');
+
+    if (p)
+      tinyMCE.switchClass(editor_id + '_absolute', 'mceButtonNormal');
+
+    if (le && le.style.position.toLowerCase() == "absolute") {
+      tinyMCE.switchClass(editor_id + '_absolute', 'mceButtonSelected');
+      tinyMCE.switchClass(editor_id + '_moveforward', 'mceButtonNormal');
+      tinyMCE.switchClass(editor_id + '_movebackward', 'mceButtonNormal');
+    }
+  },
+
+  // Private plugin specific methods
+
+  _move : function(d) {
+    var inst = tinyMCE.selectedInstance, self = TinyMCE_LayerPlugin, i, z = new Array();
+    var le = self._getParentLayer(inst.getFocusElement()), ci = -1, fi = -1;
+    var nl = tinyMCE.selectNodes(inst.getBody(), function(n) {
+      return n.nodeType == 1 && new RegExp('absolute|relative|static', 'gi').test(n.style.position);
+    });
+
+    // Find z-indexes
+    for (i=0; i<nl.length; i++) {
+      z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
+
+      if (ci < 0 && nl[i] == le)
+        ci = i;
+    }
+
+    if (d < 0) {
+      // Move back
+
+      // Try find a lower one
+      for (i=0; i<z.length; i++) {
+        if (z[i] < z[ci]) {
+          fi = i;
+          break;
+        }
+      }
+
+      if (fi > -1) {
+        nl[ci].style.zIndex = z[fi];
+        nl[fi].style.zIndex = z[ci];
+      } else {
+        if (z[ci] > 0)
+          nl[ci].style.zIndex = z[ci] - 1;
+      }
+    } else {
+      // Move forward
+
+      // Try find a higher one
+      for (i=0; i<z.length; i++) {
+        if (z[i] > z[ci]) {
+          fi = i;
+          break;
+        }
+      }
+
+      if (fi > -1) {
+        nl[ci].style.zIndex = z[fi];
+        nl[fi].style.zIndex = z[ci];
+      } else
+        nl[ci].style.zIndex = z[ci] + 1;
+    }
+
+    inst.repaint();
+  },
+
+  _getParentLayer : function(n) {
+    return tinyMCE.getParentNode(n, function(n) {
+      return n.nodeType == 1 && new RegExp('absolute|relative|static', 'gi').test(n.style.position);
+    });
+  },
+
+  _insertLayer : function() {
+    var inst = tinyMCE.selectedInstance;
+    var e = tinyMCE.getParentElement(inst.getFocusElement());
+    var p = tinyMCE.getAbsPosition(e);
+    var d = inst.getDoc();
+    var ne = d.createElement('div');
+    var h = inst.selection.getSelectedHTML();
+
+    // Move div
+    ne.style.position = 'absolute';
+    ne.style.left = p.absLeft + 'px';
+    ne.style.top = (p.absTop > 20 ? p.absTop : 20) + 'px';
+    ne.style.width = '100px';
+    ne.style.height = '100px';
+    ne.className = 'mceVisualAid';
+
+    if (!h)
+      h = tinyMCE.getLang('lang_layer_content');
+
+    ne.innerHTML = h;
+
+    // Add it
+    d.body.appendChild(ne);
+  },
+
+  _toggleAbsolute : function() {
+    var inst = tinyMCE.selectedInstance, self = TinyMCE_LayerPlugin;
+    var le = self._getParentLayer(inst.getFocusElement());
+
+    if (le == null)
+      le = tinyMCE.getParentElement(inst.getFocusElement(), 'div,p,img');
+
+    if (le) {
+      if (le.style.position.toLowerCase() == "absolute") {
+        le.style.position = "";
+        le.style.left = "";
+        le.style.top = "";
+      } else {
+        le.style.position = "absolute";
+
+        if (le.style.left == "")
+          le.style.left = 20 + 'px';
+
+        if (le.style.top == "")
+          le.style.top = 20 + 'px';
+
+        if (le.style.width == "")
+          le.style.width = le.width ? (le.width + 'px') : '100px';
+
+        if (le.style.height == "")
+          le.style.height = le.height ? (le.height + 'px') : '100px';
+
+        tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+      }
+
+      inst.repaint();
+      tinyMCE.triggerNodeChange();
+    }
+  }
+};
+
+tinyMCE.addPlugin("layer", TinyMCE_LayerPlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/absolute.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/absolute.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/backward.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/backward.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/forward.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/forward.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/insert_layer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/images/insert_layer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,9 @@
+// UK lang variables
+
+tinyMCE.addToLang('layer',{
+insertlayer_desc : 'Insert new layer',
+forward_desc : 'Move forward',
+backward_desc : 'Move backward',
+absolute_desc : 'Toggle absolute positioning',
+content : 'New layer...'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/layer/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('lorem', 'en,hu');
+
+function TinyMCE_lorem_getControlHTML(control_name) {
+    switch (control_name) {
+        case "lorem":
+            return '<img id="{$editor_id}_lorem" src="{$pluginurl}/images/lorem.gif" title="{$lang_insert_lorem_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceLorem\');" />';
+    }
+    return "";
+}
+
+/**
+ * Executes the lorem command.
+ */
+function TinyMCE_lorem_execCommand(editor_id, element, command, user_interface, value) {
+    // Handle commands
+    switch (command) {
+        case "mceLorem":
+            var template = new Array();
+            template['file']   = '../../plugins/lorem/loremipsum.htm'; // Relative to theme
+            template['width']  = 300;
+            template['height'] = 200;            
+           
+            tinyMCE.openWindow(template, {editor_id : editor_id});              
+       return true;
+   }
+   // Pass to next handler in chain
+   return false;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/images/lorem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/images/lorem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,11 @@
+// en lang variables
+tinyMCELang['lang_insert_lorem_title']    = 'Loremipsum generator';
+tinyMCELang['lang_insert_lorem_desc']    = 'Loremipsum generator';
+tinyMCELang['lang_insert_lorem_text']    = 'From this text';
+tinyMCELang['lang_insert_lorem_count']    = 'Create this much';
+tinyMCELang['lang_insert_lorem_type']    = 'Let it be';
+tinyMCELang['lang_insert_lorem_unformatted']    = 'Unformatted sentences';
+tinyMCELang['lang_insert_lorem_para']    = 'Paragraphs &lt;p&gt;';
+tinyMCELang['lang_insert_lorem_ul']    = 'List &lt;ul&gt;';
+tinyMCELang['lang_insert_lorem_ol']    = 'Ordered list &lt;ol&gt;';
+tinyMCELang['lang_insert_lorem_go']    = 'Gimme lipsum!';
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs/hu.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs/hu.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/langs/hu.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,12 @@
+// hu lang variables
+// magyar feliratok
+tinyMCELang['lang_insert_lorem_title']    = 'Loremipsum generátor';
+tinyMCELang['lang_insert_lorem_desc']    = 'Loremipsum generátor';
+tinyMCELang['lang_insert_lorem_text']    = 'Ebbõl a szövegbõl';
+tinyMCELang['lang_insert_lorem_count']    = 'Ennyit';
+tinyMCELang['lang_insert_lorem_type']    = 'Legyen';
+tinyMCELang['lang_insert_lorem_unformatted']    = 'Formázatlan mondat';
+tinyMCELang['lang_insert_lorem_para']    = 'Bekezdés &lt;p&gt;';
+tinyMCELang['lang_insert_lorem_ul']    = 'Lista &lt;ul&gt;';
+tinyMCELang['lang_insert_lorem_ol']    = 'Számozott lista &lt;ol&gt;';
+tinyMCELang['lang_insert_lorem_go']    = 'Nyomasd a lipsumot!';
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/loremipsum.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/loremipsum.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/loremipsum.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
+<title>{$lang_insert_lorem_title}</title>
+<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+<script language="javascript" type="text/javascript" src="text.js"></script>
+<script language="javascript" type="text/javascript">
+<!--
+var arrSentences=new Array();
+     
+function init(){
+    var formObj = document.forms[0];
+    for (var i=0;i<arrText.length;i++){
+        arrSentences.push(arrText[i].split('|'));
+    }//split text to sentences. Sentences limited by '|'
+    
+    for (var i=0;i<arrSentences.length;i++){
+        var tmp=new Array();
+        tmp=(arrSentences[i][0]).split(' ');
+        tmp=tmp.slice(0,3);
+        var tmpText=tmp.join(' ');
+        formObj.lorem_select.options[i]=new Option(tmpText,i);
+    }
+    //fill listbox with values based on the first 3 words in the sentences, no extra check made for sentences shorter than 3 words, so cross our fingers!
+  window.focus();
+}
+function generate(){
+  var insertedText='';
+  if (window.opener){
+      var formObj = document.forms[0];
+      count=formObj.lorem_count.value;
+      selectedText=formObj.lorem_select.value;
+        switch (formObj.lorem_formatum.value){
+          case '0'://unformatted          
+            insertedText=gimmeSentences(count,selectedText);
+          break;
+          case '1'://para
+            for (var counter=0;counter<count;counter++){
+              countElem=getRandom(3,6);//so many sentences in paragraph
+              insertedText+='<p>'+gimmeSentences(countElem,selectedText)+'</p>';              
+            }
+          break;
+          case '2'://ul
+            insertedText+='<ul>';
+            for (var counter=0;counter<count;counter++){
+              countElem=getRandom(1,2);//so many sentences in listelement
+              insertedText+='<li>'+gimmeSentences(countElem,selectedText)+'</li>';              
+            }
+            insertedText+='</ul>';
+          break;
+          case '3'://ol
+            insertedText+='<ol>';
+            for (var counter=0;counter<count;counter++){
+              countElem=getRandom(1,2);//so many sentences in listelement
+              insertedText+='<li>'+gimmeSentences(countElem,selectedText)+'</li>';              
+            }
+            insertedText+='</ol>';
+          break;
+        }//switch
+        tinyMCE.execCommand('mceInsertContent',false,insertedText,'html');
+        window.top.close();
+  }//if window.opener
+}
+function getRandom(from,to){
+  return Math.round((Math.random()*(to-1))+from);
+}
+function gimmeSentences(howmany,selText){
+  var ret='';
+  var arrTmp=new Array();
+  for (var i=0;i<howmany;i++){
+    arrTmp.push(arrSentences[selText][0]);
+    arrSentences[selText].push(arrSentences[selText].shift());
+    //make first sentence array element last,
+    //in order to avoid paragraphs and list begin always with the same sentence   
+  }
+  ret=arrTmp.join(' ');
+  return ret;
+}
+//-->
+</script>
+  </head>
+<body onload="init()">
+<form name="theForm">
+<table cellpadding="2" cellspacing="3">
+<tr>
+<td align="right" nowrap valign="baseline">{$lang_insert_lorem_text}:</td>
+<td align="left" valign="baseline" nowrap>
+<select name="lorem_select" id="lorem_select"></select>
+</td>
+</tr>
+<tr>
+<td align="right" nowrap valign="baseline">{$lang_insert_lorem_count}:</td>
+<td align="left" valign="baseline" nowrap>
+<input name="lorem_count" type="text" id="lorem_count" value="2" size="3" maxlength="2">
+</td>
+</tr>
+<tr>
+<td align="right" valign="baseline" nowrap>{$lang_insert_lorem_type}: </td>
+<td align="left" valign="baseline" nowrap><select name="lorem_formatum" id="lorem_formatum">
+<option value="0">{$lang_insert_lorem_unformatted}</option>
+<option value="1" selected="selected">{$lang_insert_lorem_para}</option>
+<option value="2">{$lang_insert_lorem_ul}</option>
+<option value="3">{$lang_insert_lorem_ol}</option>
+</select>
+</td>
+</tr>
+<tr>
+<td></td>
+<td align="left" valign="baseline" nowrap>
+<input onclick="generate();" name="lorem_go" type="button" id="lorem_go" value="{$lang_insert_lorem_go}">
+</td>
+</tr>
+</table>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+Loremipsum plugin for TinyMCE
+
+-----------------------------
+
+About:
+  This plugin generates dummy filler text for your pages. Useful during testing the editor and/or CMS systems.
+  More info on what 'Lorem ipsum' is can be found here: http://www.lipsum.com/
+  This is a plugi contributed by Gusztáv Pálvölgyi (Hungary, Sopron).
+  
+Usage:
+  * Just place your text cursor anywhere in your tinyMCE editor and push plugin button.
+  * You can choose from four texts. Two texts give you pseudo latin output, 
+  one gives you sentences from Asimov's 'The robots of dawn' 
+  and one gives you some text in hungarian language from 'Rendezvous with Rama' by Arthur C. Clarke
+  
+Adding own text:
+  You get four texts with the plugin to choose from but you can easily add your own text too.
+  Texts are in the text.js file.
+  Each text is an array element, you have to separate sentences with the pipe (|) symbol.
+  
+Compatibility:
+  I developed this plugin on a linux machine and tested on Firefox 1.0, tiny_MCE 1.43. It worked fine.
+  
+Installation instructions:
+  * Copy the lorem directory to the plugins directory of TinyMCE (/jscripts/tiny_mce/plugins).
+  * Add plugin to TinyMCE plugin option list example: plugins : "lorem".
+
+Initialization example:
+  tinyMCE.init({
+    theme : "advanced",
+    mode : "textareas",
+    plugins : "lorem",
+    theme_advanced_buttons3_add : "lorem"
+  });
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/text.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/text.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/lorem/text.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+var arrText=new Array();
+arrText.push('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.|Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.|Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.|Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');
+arrText.push('Non eram nescius, Brute, cum, quae summis ingeniis exquisitaque doctrina philosophi Graeco sermone tractavissent, ea Latinis litteris mandaremus, fore ut hic noster labor in varias reprehensiones incurreret.|Nam quibusdam, et iis quidem non admodum indoctis, totum hoc displicet philosophari.|Quidam autem non tam id reprehendunt, si remissius agatur, sed tantum studium tamque multam operam ponendam in eo non arbitrantur.|Erunt etiam, et ii quidem eruditi Graecis litteris, contemnentes Latinas, qui se dicant in Graecis legendis operam malle consumere.|Postremo aliquos futuros suspicor, qui me ad alias litteras vocent, genus hoc scribendi, etsi sit elegans, personae tamen et dignitatis esse negent.|Contra quos omnis dicendum breviter existimo.|Quamquam philosophiae quidem vituperatoribus satis responsum est eo libro, quo a nobis philosophia defensa et collaudata est, cum esset accusata et vituperata ab Hortensio.|Qui liber cum et tibi probatus videretur et iis, quos ego posse iudicare arbitrarer, plura suscepi veritus ne movere hominum studia viderer, retinere non posse.|Qui autem, si maxime hoc placeat, moderatius tamen id volunt fieri, difficilem quandam temperantiam postulant in eo, quod semel admissum coerceri reprimique non potest, ut propemodum iustioribus utamur illis, qui omnino avocent a philosophia, quam his, qui rebus infinitis modum constituant in reque eo meliore, quo maior sit, \mediocritatem desiderent.|Sive enim ad sapientiam perveniri potest, non paranda nobis solum ea, sed fruenda etiam [sapientia] est; sive hoc difficile est, tamen nec modus est ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum id, quod quaeritur, sit pulcherrimum.|Etenim si delectamur, cum scribimus, quis est tam invidus, qui ab eo nos abducat? sin laboramus, quis est, qui alienae modum statuat industriae?|Nam ut Terentianus Chremes non inhumanus, qui novum vicinum non vult \'fodere aut arare aut aliquid ferre denique\' -- non enim illum ab industria, sed ab inliberali labore deterret --, sic isti curiosi, quos offendit noster minime nobis iniucundus labor.|Iis igitur est difficilius satis facere, qui se Latina scripta dicunt contemnere.|In quibus hoc primum est in quo admirer, cur in gravissimis rebus non delectet eos sermo patrius, cum idem fabellas Latinas ad verbum e Graecis expressas non inviti legant.|Quis enim tam inimicus paene nomini Romano est, qui Ennii Medeam aut Antiopam Pacuvii spernat aut reiciat, quod se isdem Euripidis fabulis delectari dicat, Latinas litteras oderit?|Synephebos ego, inquit, potius Caecilii aut Andriam Terentii quam utramque Menandri legam?|A quibus tantum dissentio, ut, cum Sophocles vel optime scripserit Electram, tamen male conversam Atilii mihi legendam putem, de quo Lucilius: \'ferreum scriptorem\', verum, opinor, scriptorem tamen, ut legendus sit.|Rudem enim esse omnino in nostris poetis aut inertissimae segnitiae est aut fastidii delicatissimi.|Mihi quidem nulli satis eruditi videntur, quibus nostra ignota sunt. an \'Utinam ne in nemore ...\' nihilo minus legimus quam hoc idem Graecum, quae autem de bene beateque vivendo a Platone disputata sunt, haec explicari non placebit Latine?|Quid?|Si nos non interpretum fungimur munere, sed tuemur ea, quae dicta sunt ab iis quos probamus, eisque nostrum iudicium et nostrum scribendi ordinem adiungimus, quid habent, cur Graeca anteponant iis, quae et splendide dicta sint neque sint conversa de Graecis?|Nam si dicent ab illis has res esse tractatas, ne ipsos quidem Graecos est cur tam multos legant, quam legendi sunt.|Quid enim est a Chrysippo praetermissum in Stoicis?|Legimus tamen Diogenem, Antipatrum, Mnesarchum, Panaetium, multos alios in primisque familiarem nostrum Posidonium. quid?|Theophrastus mediocriterne delectat, cum tractat locos ab Aristotele ante tractatos?|Quid?|Epicurei num desistunt de isdem, de quibus et ab Epicuro scriptum est et ab antiquis, ad arbitrium suum scribere?|Quodsi Graeci leguntur a Graecis isdem de rebus alia ratione compositis, quid est, cur nostri a nostris non legantur?');
+arrText.push('Gladia was in space again and once again Aurora could be made out as a globe.|D.G. was busy elsewhere and the entire ship had about it a vague but pervasive air of emergency, as though it were on a battle footing, as though it were being pursued or expected pursuit.|Gladia shook her head. She could think clearly; she felt well; but when her mind turned back to that time in the Institute, shortly after Amadiro had left her, a curiously pervasive unreality swept over her.|There was a gap in time.|One moment she had been sitting on the couch, feeling sleepy; the next there were four robots and a woman in the room who had not been there before.|She had fallen asleep, then, but there was no awareness, no memory, that she had done so.|There was a gap of nonexistence.|Thinking back, she had recognized the woman after the fact.|It was Vasilia Aliena--the daughter whom Gladia had replaced in the affections of Han Fastolfe. Gladia had never actually seen Vasilia, though she had viewed her on hyperwave several times.|Gladia always thought of her as a distant and inimical other self.|There was the vague similarity in appearance that others always commented on but that Gladia herself insisted she did not see--and there was the odd, antithetical connection with Fastolfe.');
+arrText.push('Három hónap múlva a Szítának átkeresztelt ûrszondát felbocsátották a Mars belsõ holdjáról, a Phoebusról.|A repülési idõ két hét; a mûszer teljes bekapcsolása csak a befogás elõtti öt percben kezdõdik.|A felvevõgépeket úgy állították be, hogy a tárgy minden oldalról lefényképezhetõ legyen.|Az elsõ képek, melyek tízezer km távolságról érkeztek, leállítottak minden emberi tevékenységet.|Ezer millió tévéképernyõn jelent meg egy parányi, jellegtelen henger, s növekedett másodpercrõl másodpercre.|Mire méretei megkétszerezõdtek, már senki sem gondolhatta, hogy a Ráma természeti tárgy.|Mértanilag olyan szabályos hengeralakot mutatott, hogy akár esztergapadon is készíthették volna: akkorán, melynek csúcsai egymástól ötven km távolságra vannak.|Eltekintve az egyik oldalon látható néhány apró kis szerkezettõl, két vége teljesen sík, húsz kilométer széles volt.|A távolból szinte nevetségesen hasonlított egy közönséges bojlerre.|A Ráma csak nõtt, nõtt, míg végül betöltötte a képernyõt.|Felszíne egyhangú szürkésbarna volt, színtelen, mint a Hold, s egy pontot kivéve tökéletesen sima.|A henger közepe táján azonban kilométernyi széles folt éktelenkedett, mintha egy hajdanában történt ütközéskor behorpadt volna.|Semmi jel nem mutatott arra, hogy ez a folt a legcsekélyebb veszélyt is jelentett volna a Rámára nézve; viszont ez okozta a fénygörbe aprócska változását, mely Stenton felfedezéséhez vezetett.|A többi kamera képei semmi újat nem mutattak.|Ámbár az a görbe, melyet a Ráma kicsiny gravitációs mezõjén a kamerák kijelöltek, életbevágóan fontos információt szolgáltatott - a henger tömegérõl.|Túlságosan könnyûnek bizonyult ahhoz, hogy tömör test lehessen.|Senki sem volt túlságosan meglepve, amikor kiderült, hogy a Ráma nem tömör henger.|Elérkezett végre a régen várt, régen rettegett találkozás.|Az emberiség elsõ, csillagokból érkezõ látogatóját fogadja.');
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/blank.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/blank.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/blank.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>blank_page</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <script language="javascript">
+    function init() {
+      document.body.contentEditable = true;
+      document.designMode = 'on';
+      parent.initIframe(document);
+      window.focus();
+    }
+  </script>
+  <link href="css/blank.css" rel="stylesheet" type="text/css" />
+  <base target="_self" />
+</head>
+<body onload="init();">
+
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css/blank.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css/blank.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css/blank.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+body {
+  background-color: #FFFFFF;
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 10px;
+  scrollbar-3dlight-color: #F0F0EE;
+  scrollbar-arrow-color: #676662;
+  scrollbar-base-color: #F0F0EE;
+  scrollbar-darkshadow-color: #DDDDDD;
+  scrollbar-face-color: #E0E0DD;
+  scrollbar-highlight-color: #F0F0EE;
+  scrollbar-shadow-color: #F0F0EE;
+  scrollbar-track-color: #F5F5F5;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css/pasteword.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css/pasteword.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/css/pasteword.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3 @@
+.sourceIframe {
+  border: 1px solid #808080;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('paste','en,tr,sv,cs,zh_cn,fr_ca,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,pl,nl,fr,pt_br');var TinyMCE_PastePlugin={getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_paste.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isMSIE&&tinyMCE.getParam("paste_auto_cleanup_on_paste",false))tinyMCE.addEvent(inst.getBody(),"paste",TinyMCE_PastePlugin._handlePasteEvent);},getControlHTML:function(cn){switch(cn){case"pastetext":return tinyMCE.getButtonHTML(cn,'lang_paste_text_desc','{$pluginurl}/images/pastetext.gif','mcePasteText',true);case"pasteword":return tinyMCE.getButtonHTML(cn,'lang_paste_word_desc','{$pluginurl}/images/pasteword.gif','mcePasteWord',true);case"selectall":return tinyMCE.getButtonHTML(cn,'lang_selectall_desc','{$pluginurl}/images/selectall.gif','mceSelectAll',true);}return'';},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mcePasteText":if(user_interface){if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&!tinyMCE.getParam('paste_use_dialog',false))TinyMCE_PastePlugin._insertText(clipboardData.getData("Text"),true);else{var template=new Array();template['file']='../../plugins/paste/pastetext.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",inline:"yes",mceDo:'insert'});}}else TinyMCE_PastePlugin._insertText(value['html'],value['linebreaks']);return true;case"mcePasteWord":if(user_interface){if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&!tinyMCE.getParam('paste_use_dialog',false)){var html=TinyMCE_PastePlugin._clipboardHTML();if(html&&html.length>0)TinyMCE_PastePlugin._insertWordContent(html);}else{var template=new Array();template['file']='../../plugins/paste/pasteword.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",inline:"yes",mceDo:'insert'});}}else TinyMCE_PastePlugin._insertWordContent(value);return true;case"mceSelectAll":tinyMCE.execInstanceCommand(editor_id,'selectall');return true;}return false;},_handlePasteEvent:function(e){switch(e.type){case"paste":var html=TinyMCE_PastePlugin._clipboardHTML();var r,inst=tinyMCE.selectedInstance;if(inst&&(r=inst.getRng())&&r.text.length>0)tinyMCE.execCommand('delete');if(html&&html.length>0)tinyMCE.execCommand('mcePasteWord',false,html);tinyMCE.cancelEvent(e);return false;}return true;},_insertText:function(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(tinyMCE.getParam("paste_create_paragraphs",true)){var rl=tinyMCE.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);content=tinyMCE.regexpReplace(content,"\r\n\r\n","</p><p>","gi");content=tinyMCE.regexpReplace(content,"\r\r","</p><p>","gi");content=tinyMCE.regexpReplace(content,"\n\n","</p><p>","gi");if((pos=content.indexOf('</p><p>'))!=-1){tinyMCE.execCommand("Delete");var node=tinyMCE.selectedInstance.getFocusElement();var breakElms=new Array();do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="</p>";before+=content.substring(0,pos);for(var i=0;i<breakElms.length;i++){before+="</"+breakElms[i].nodeName+">";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="<p>";content=before+content.substring(pos+7)+after;}}if(tinyMCE.getParam("paste_create_linebreaks",true)){content=tinyMCE.regexpReplace(content,"\r\n","<br />","gi");content=tinyMCE.regexpReplace(content,"\r","<br />","gi");content=tinyMCE.regexpReplace(content,"\n","<br />","gi");}}tinyMCE.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);var cb;if((cb=tinyMCE.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('before', content)");var rl=tinyMCE.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);if(tinyMCE.getParam("paste_convert_headers_to_strong",false)){content=content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>','gi'),'<p><b>$1</b></p>');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)<BR>","gi"),"<p>"+middot+"$1</p>");content=content.replace(new RegExp('<SPAN style="mso-list: Ignore">','gi'),"<span>"+bull);content=content.replace(/<o:p><\/o:p>/gi,"");content=content.replace(new RegExp('<br style="page-break-before: always;.*>','gi'),'-- page break --');content=content.replace(new RegExp('<(!--)([^>]*)(--)>','g'),"");if(tinyMCE.getParam("paste_remove_spans",true))content=content.replace(/<\/?span[^>]*>/gi,"");if(tinyMCE.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(tinyMCE.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+TinyMCE_PastePlugin._reEscape(""+document.location)+'','gi'),'href="'+tinyMCE.settings['document_base_url']);content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!tinyMCE.settings['force_p_newlines']){content=content.replace('','','gi');content=content.replace('</p>','<br /><br />','gi');}if(!tinyMCE.isMSIE&&!tinyMCE.settings['force_p_newlines']){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(tinyMCE.getParam("paste_convert_middot_lists",true)){var div=document.createElement("div");div.innerHTML=content;var className=tinyMCE.getParam("paste_unindented_list_class","unIndentedList");while(TinyMCE_PastePlugin._convertMiddots(div,"--list--"));while(TinyMCE_PastePlugin._convertMiddots(div,middot,className));while(TinyMCE_PastePlugin._convertMiddots(div,bull));content=div.innerHTML;}if(tinyMCE.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi,'<p>&nbsp;&nbsp;</p>');content=content.replace(/<h[1-6]>/gi,'<p><b>');content=content.replace(/<\/h[1-6]>/gi,'</b></p>');content=content.replace(/<b>&nbsp;<\/b>/gi,'<b>&nbsp;&nbsp;</b>');content=content.replace(/^(&nbsp;)*/gi,'');}content=content.replace(/--list--/gi,"");if((cb=tinyMCE.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('after', content)");tinyMCE.execCommand("mceInsertContent",false,content);window.setTimeout('tinyMCE.execCommand("mceCleanup");',1);}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i<s.length;i++){var c=s.charAt(i);if(l.indexOf(c)!=-1)o+='\\'+c;else o+=c;}return o;},_convertMiddots:function(div,search,class_name){var mdot=String.fromCharCode(183);var bull=String.fromCharCode(8226);var nodes=div.getElementsByTagName("p");var prevul;for(var i=0;i<nodes.length;i++){var p=nodes[i];if(p.innerHTML.indexOf(search)==0){var ul=document.createElement("ul");if(class_name)ul.className=class_name;var li=document.createElement("li");li.innerHTML=p.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');ul.appendChild(li);var np=p.nextSibling;while(np){if(np.nodeType==3&&new RegExp('^\\s$','m').test(np.nodeValue)){np=np.nextSibling;continue;}if(search==mdot){if(np.nodeType==1&&new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)){if(!prevul){prevul=ul;ul=document.createElement("ul");prevul.appendChild(ul);}np.innerHTML=np.innerHTML.replace(/^o/,'');}else{if(prevul){ul=prevul;prevul=null;}if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}}else{if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}var cp=np.nextSibling;var li=document.createElement("li");li.innerHTML=np.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');np.parentNode.removeChild(np);ul.appendChild(li);np=cp;}p.parentNode.replaceChild(ul,p);return true;}}return false;},_clipboardHTML:function(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}};tinyMCE.addPlugin("paste",TinyMCE_PastePlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,388 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.37 $
+ * $Date: 2006/03/27 10:07:08 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */ 
+tinyMCE.importPluginLanguagePack('paste', 'en,tr,sv,cs,zh_cn,fr_ca,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,pl,nl,fr,pt_br');
+
+var TinyMCE_PastePlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Paste text/word',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_paste.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  initInstance : function(inst) {
+    if (tinyMCE.isMSIE && tinyMCE.getParam("paste_auto_cleanup_on_paste", false))
+      tinyMCE.addEvent(inst.getBody(), "paste", TinyMCE_PastePlugin._handlePasteEvent);
+  },
+
+  getControlHTML : function(cn) { 
+    switch (cn) { 
+      case "pastetext":
+        return tinyMCE.getButtonHTML(cn, 'lang_paste_text_desc', '{$pluginurl}/images/pastetext.gif', 'mcePasteText', true);
+
+      case "pasteword":
+        return tinyMCE.getButtonHTML(cn, 'lang_paste_word_desc', '{$pluginurl}/images/pasteword.gif', 'mcePasteWord', true);
+
+      case "selectall":
+        return tinyMCE.getButtonHTML(cn, 'lang_selectall_desc', '{$pluginurl}/images/selectall.gif', 'mceSelectAll', true);
+    } 
+
+    return ''; 
+  },
+
+  execCommand : function(editor_id, element, command, user_interface, value) { 
+    switch (command) { 
+      case "mcePasteText": 
+        if (user_interface) {
+          if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false))
+            TinyMCE_PastePlugin._insertText(clipboardData.getData("Text"), true); 
+          else { 
+            var template = new Array(); 
+            template['file']  = '../../plugins/paste/pastetext.htm'; // Relative to theme 
+            template['width']  = 450; 
+            template['height'] = 400; 
+            var plain_text = ""; 
+            tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'}); 
+          }
+        } else
+          TinyMCE_PastePlugin._insertText(value['html'], value['linebreaks']);
+
+        return true;
+
+      case "mcePasteWord": 
+        if (user_interface) {
+          if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false)) {
+            var html = TinyMCE_PastePlugin._clipboardHTML();
+
+            if (html && html.length > 0)
+              TinyMCE_PastePlugin._insertWordContent(html);
+          } else { 
+            var template = new Array(); 
+            template['file']  = '../../plugins/paste/pasteword.htm'; // Relative to theme 
+            template['width']  = 450; 
+            template['height'] = 400; 
+            var plain_text = ""; 
+            tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'});
+          }
+        } else
+          TinyMCE_PastePlugin._insertWordContent(value);
+
+        return true;
+
+      case "mceSelectAll":
+        tinyMCE.execInstanceCommand(editor_id, 'selectall'); 
+        return true; 
+
+    } 
+
+    // Pass to next handler in chain 
+    return false; 
+  },
+
+  // Private plugin internal methods
+
+  _handlePasteEvent : function(e) {
+    switch (e.type) {
+      case "paste":
+        var html = TinyMCE_PastePlugin._clipboardHTML();
+        var r, inst = tinyMCE.selectedInstance;
+
+        // Removes italic, strong etc, the if was needed due to bug #1437114
+        if (inst && (r = inst.getRng()) && r.text.length > 0)
+          tinyMCE.execCommand('delete');
+
+        if (html && html.length > 0)
+          tinyMCE.execCommand('mcePasteWord', false, html);
+
+        tinyMCE.cancelEvent(e);
+        return false;
+    }
+
+    return true;
+  },
+
+  _insertText : function(content, bLinebreaks) { 
+    if (content && content.length > 0) {
+      if (bLinebreaks) { 
+        // Special paragraph treatment 
+        if (tinyMCE.getParam("paste_create_paragraphs", true)) {
+          var rl = tinyMCE.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
+          for (var i=0; i<rl.length; i+=2)
+            content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
+
+          content = tinyMCE.regexpReplace(content, "\r\n\r\n", "</p><p>", "gi"); 
+          content = tinyMCE.regexpReplace(content, "\r\r", "</p><p>", "gi"); 
+          content = tinyMCE.regexpReplace(content, "\n\n", "</p><p>", "gi"); 
+
+          // Has paragraphs 
+          if ((pos = content.indexOf('</p><p>')) != -1) { 
+            tinyMCE.execCommand("Delete"); 
+
+            var node = tinyMCE.selectedInstance.getFocusElement(); 
+
+            // Get list of elements to break 
+            var breakElms = new Array(); 
+
+            do { 
+              if (node.nodeType == 1) { 
+                // Don't break tables and break at body 
+                if (node.nodeName == "TD" || node.nodeName == "BODY") 
+                  break; 
+    
+                breakElms[breakElms.length] = node; 
+              } 
+            } while(node = node.parentNode); 
+
+            var before = "", after = "</p>"; 
+            before += content.substring(0, pos); 
+
+            for (var i=0; i<breakElms.length; i++) { 
+              before += "</" + breakElms[i].nodeName + ">"; 
+              after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">"; 
+            } 
+
+            before += "<p>"; 
+            content = before + content.substring(pos+7) + after; 
+          } 
+        } 
+
+        if (tinyMCE.getParam("paste_create_linebreaks", true)) {
+          content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi"); 
+          content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi"); 
+          content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi"); 
+        }
+      } 
+    
+      tinyMCE.execCommand("mceInsertRawHTML", false, content); 
+    }
+  },
+
+  _insertWordContent : function(content) { 
+    if (content && content.length > 0) {
+      // Cleanup Word content
+      var bull = String.fromCharCode(8226);
+      var middot = String.fromCharCode(183);
+      var cb;
+
+      if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "")
+        content = eval(cb + "('before', content)");
+
+      var rl = tinyMCE.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
+      for (var i=0; i<rl.length; i+=2)
+        content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
+
+      if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) {
+        content = content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>', 'gi'), '<p><b>$1</b></p>');
+      }
+
+      content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--");
+      content = content.replace(new RegExp(bull + "(.*?)<BR>", "gi"), "<p>" + middot + "$1</p>");
+      content = content.replace(new RegExp('<SPAN style="mso-list: Ignore">', 'gi'), "<span>" + bull); // Covert to bull list
+      content = content.replace(/<o:p><\/o:p>/gi, "");
+      content = content.replace(new RegExp('<br style="page-break-before: always;.*>', 'gi'), '-- page break --'); // Replace pagebreaks
+      content = content.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), "");  // Word comments
+
+      if (tinyMCE.getParam("paste_remove_spans", true))
+        content = content.replace(/<\/?span[^>]*>/gi, "");
+
+      if (tinyMCE.getParam("paste_remove_styles", true))
+        content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3");
+
+      content = content.replace(/<\/?font[^>]*>/gi, "");
+
+      // Strips class attributes.
+      switch (tinyMCE.getParam("paste_strip_class_attributes", "all")) {
+        case "all":
+          content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
+          break;
+
+        case "mso":
+          content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3");
+          break;
+      }
+
+      content = content.replace(new RegExp('href="?' + TinyMCE_PastePlugin._reEscape("" + document.location) + '', 'gi'), 'href="' + tinyMCE.settings['document_base_url']);
+      content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
+      content = content.replace(/<\\?\?xml[^>]*>/gi, "");
+      content = content.replace(/<\/?\w+:[^>]*>/gi, "");
+      content = content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi, ""); // Remove pagebreaks
+      content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks
+
+  //    content = content.replace(/\/?&nbsp;*/gi, ""); &nbsp;
+  //    content = content.replace(/<p>&nbsp;<\/p>/gi, '');
+
+      if (!tinyMCE.settings['force_p_newlines']) {
+        content = content.replace('', '' ,'gi');
+        content = content.replace('</p>', '<br /><br />' ,'gi');
+      }
+
+      if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) {
+        content = content.replace(/<\/?p[^>]*>/gi, "");
+      }
+
+      content = content.replace(/<\/?div[^>]*>/gi, "");
+
+      // Convert all middlot lists to UL lists
+      if (tinyMCE.getParam("paste_convert_middot_lists", true)) {
+        var div = document.createElement("div");
+        div.innerHTML = content;
+
+        // Convert all middot paragraphs to li elements
+        var className = tinyMCE.getParam("paste_unindented_list_class", "unIndentedList");
+
+        while (TinyMCE_PastePlugin._convertMiddots(div, "--list--")) ; // bull
+        while (TinyMCE_PastePlugin._convertMiddots(div, middot, className)) ; // Middot
+        while (TinyMCE_PastePlugin._convertMiddots(div, bull)) ; // bull
+
+        content = div.innerHTML;
+      }
+
+      // Replace all headers with strong and fix some other issues
+      if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) {
+        content = content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi, '<p>&nbsp;&nbsp;</p>');
+        content = content.replace(/<h[1-6]>/gi, '<p><b>');
+        content = content.replace(/<\/h[1-6]>/gi, '</b></p>');
+        content = content.replace(/<b>&nbsp;<\/b>/gi, '<b>&nbsp;&nbsp;</b>');
+        content = content.replace(/^(&nbsp;)*/gi, '');
+      }
+
+      content = content.replace(/--list--/gi, ""); // Remove --list--
+
+      if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "")
+        content = eval(cb + "('after', content)");
+
+      // Insert cleaned content
+      tinyMCE.execCommand("mceInsertContent", false, content);
+      window.setTimeout('tinyMCE.execCommand("mceCleanup");', 1); // Do normal cleanup detached from this thread
+    }
+  },
+
+  _reEscape : function(s) {
+    var l = "?.\\*[](){}+^$:";
+    var o = "";
+
+    for (var i=0; i<s.length; i++) {
+      var c = s.charAt(i);
+
+      if (l.indexOf(c) != -1)
+        o += '\\' + c;
+      else
+        o += c;
+    }
+
+    return o;
+  },
+
+  _convertMiddots : function(div, search, class_name) {
+    var mdot = String.fromCharCode(183);
+    var bull = String.fromCharCode(8226);
+
+    var nodes = div.getElementsByTagName("p");
+    var prevul;
+    for (var i=0; i<nodes.length; i++) {
+      var p = nodes[i];
+
+      // Is middot
+      if (p.innerHTML.indexOf(search) == 0) {
+        var ul = document.createElement("ul");
+
+        if (class_name)
+          ul.className = class_name;
+
+        // Add the first one
+        var li = document.createElement("li");
+        li.innerHTML = p.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
+        ul.appendChild(li);
+
+        // Add the rest
+        var np = p.nextSibling;
+        while (np) {
+              // If the node is whitespace, then
+              // ignore it and continue on.
+              if (np.nodeType == 3 && new RegExp('^\\s$', 'm').test(np.nodeValue)) {
+                      np = np.nextSibling;
+                      continue;
+              }
+
+          if (search == mdot) {
+                  if (np.nodeType == 1 && new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)) {
+                          // Second level of nesting
+                          if (!prevul) {
+                                  prevul = ul;
+                                  ul = document.createElement("ul");
+                                  prevul.appendChild(ul);
+                          }
+                          np.innerHTML = np.innerHTML.replace(/^o/, '');
+                  } else {
+                          // Pop the stack if we're going back up to the first level
+                          if (prevul) {
+                                  ul = prevul;
+                                  prevul = null;
+                          }
+                          // Not element or middot paragraph
+                          if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
+                                  break;
+                  }
+          } else {
+                  // Not element or middot paragraph
+                  if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
+                          break;
+                }
+
+          var cp = np.nextSibling;
+          var li = document.createElement("li");
+          li.innerHTML = np.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
+          np.parentNode.removeChild(np);
+          ul.appendChild(li);
+          np = cp;
+        }
+
+        p.parentNode.replaceChild(ul, p);
+
+        return true;
+      }
+    }
+
+    return false;
+  },
+
+  _clipboardHTML : function() {
+    var div = document.getElementById('_TinyMCE_clipboardHTML');
+
+    if (!div) {
+      var div = document.createElement('DIV');
+      div.id = '_TinyMCE_clipboardHTML';
+
+      with (div.style) {
+        visibility = 'hidden';
+        overflow = 'hidden';
+        position = 'absolute';
+        width = 1;
+        height = 1;
+      }
+
+      document.body.appendChild(div);
+    }
+
+    div.innerHTML = '';
+    var rng = document.body.createTextRange();
+    rng.moveToElementText(div);
+    rng.execCommand('Paste');
+    var html = div.innerHTML;
+    div.innerHTML = '';
+    return html;
+  }
+};
+
+tinyMCE.addPlugin("paste", TinyMCE_PastePlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/pastetext.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/pastetext.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/pasteword.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/pasteword.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/selectall.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/images/selectall.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts/pastetext.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts/pastetext.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts/pastetext.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+function saveContent() {
+  if (document.forms[0].htmlSource.value == '') {
+    tinyMCEPopup.close();
+    return false;
+  }
+
+  tinyMCEPopup.execCommand('mcePasteText', false, {
+    html : document.forms[0].htmlSource.value,
+    linebreaks : document.forms[0].linebreaks.checked
+  });
+
+  tinyMCEPopup.close();
+}
+
+function onLoadInit() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  resizeInputs();
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function resizeInputs() {
+  if (!tinyMCE.isMSIE) {
+    wHeight = self.innerHeight-80;
+    wWidth = self.innerWidth-17;
+  } else {
+    wHeight = document.body.clientHeight-80;
+    wWidth = document.body.clientWidth-17;
+  }
+
+  document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
+  document.forms[0].htmlSource.style.width  = Math.abs(wWidth) + 'px';
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts/pasteword.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts/pasteword.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/jscripts/pasteword.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+function saveContent() {
+  var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;
+
+  if (html == ''){
+    tinyMCEPopup.close();
+    return false;
+  }
+
+  tinyMCEPopup.execCommand('mcePasteWord', false, html);
+  tinyMCEPopup.close();
+}
+
+function onLoadInit() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  // Fix for endless reloading in FF
+  window.setTimeout('createIFrame();', 10);
+}
+
+function createIFrame() {
+  document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>';
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function initIframe(doc) {
+  var dir = tinyMCE.selectedInstance.settings['directionality'];
+  doc.body.dir = dir;
+  resizeInputs();
+}
+
+function resizeInputs() {
+  if (!tinyMCE.isMSIE) {
+    wHeight = self.innerHeight - 80;
+    wWidth = self.innerWidth - 18;
+  } else {
+    wHeight = document.body.clientHeight - 80;
+    wWidth = document.body.clientWidth - 18;
+  }
+
+  var elm = document.getElementById('frmData');
+  if (elm) {
+    elm.style.height = Math.abs(wHeight) + 'px';
+    elm.style.width  = Math.abs(wWidth) + 'px';
+  }
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,10 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+paste_text_desc : 'Paste as Plain Text',
+paste_text_title : 'Use CTRL+V on your keyboard to paste the text into the window.',
+paste_text_linebreaks : 'Keep linebreaks',
+paste_word_desc : 'Paste from Word',
+paste_word_title : 'Use CTRL+V on your keyboard to paste the text into the window.',
+selectall_desc : 'Select All'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/pastetext.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/pastetext.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/pastetext.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_paste_text_desc}</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/pastetext.js"></script>
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('onLoadInit();');" onresize="resizeInputs();" style="display: none">
+<form name="source" onsubmit="saveContent();">
+  <div style="float: left" class="title">{$lang_paste_text_desc}</div>
+
+  <div style="float: right">
+    <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{$lang_paste_text_linebreaks}</label>
+  </div>
+
+  <br style="clear: both" />
+
+  <div>{$lang_paste_text_title}</div>
+
+  <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft"></textarea>
+
+  <div class="mceActionPanel">
+    <div style="float: left">
+      <input type="button" name="insert" value="{$lang_insert}" onclick="saveContent();" id="insert" />
+    </div>
+
+    <div style="float: right">
+      <input type="button" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+    </div>
+  </div>
+</form>
+</body> 
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/pasteword.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/pasteword.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/pasteword.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <title>{$lang_paste_word_desc}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/pasteword.js"></script>
+  <link href="css/pasteword.css" rel="stylesheet" type="text/css" />
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('onLoadInit();');" onresize="resizeInputs();" style="display: none">
+  <form name="source" onsubmit="saveContent();" action="#">
+    <div class="title">{$lang_paste_word_desc}</div>
+
+    <div>{$lang_paste_word_title}</div>
+
+    <div id="iframecontainer"></div>
+
+    <div class="mceActionPanel">
+      <div style="float: left">
+        <input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="saveContent();" />
+      </div>
+
+      <div style="float: right">
+        <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+      </div>
+    </div>
+  </form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/paste/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('preview','en,tr,cs,de,el,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_PreviewPlugin={getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_preview.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"preview":return tinyMCE.getButtonHTML(cn,'lang_preview_desc','{$pluginurl}/images/preview.gif','mcePreview');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mcePreview":var previewPage=tinyMCE.getParam("plugin_preview_pageurl",null);var previewWidth=tinyMCE.getParam("plugin_preview_width","550");var previewHeight=tinyMCE.getParam("plugin_preview_height","600");if(previewPage){var template=new Array();template['file']=previewPage;template['width']=previewWidth;template['height']=previewHeight;tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"yes",inline:"yes",content:tinyMCE.getContent(),content_css:tinyMCE.getParam("content_css")});}else{var win=window.open("","mcePreview","menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width="+previewWidth+",height="+previewHeight);var html="";var c=tinyMCE.getContent();var pos=c.indexOf('<body'),pos2;if(pos!=-1){pos=c.indexOf('>',pos);pos2=c.lastIndexOf('</body>');c=c.substring(pos+1,pos2);}html+=tinyMCE.getParam('doctype');html+='<html xmlns="http://www.w3.org/1999/xhtml">';html+='<head>';html+='<title>'+tinyMCE.getLang('lang_preview_desc')+'</title>';html+='<base href="'+tinyMCE.settings['base_href']+'" />';html+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';html+='<link href="'+tinyMCE.getParam("content_css")+'" rel="stylesheet" type="text/css" />';html+='</head>';html+='<body dir="'+tinyMCE.getParam("directionality")+'">';html+=c;html+='</body>';html+='</html>';win.document.write(html);win.document.close();}return true;}return false;}};tinyMCE.addPlugin("preview",TinyMCE_PreviewPlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.23 $
+ * $Date: 2006/03/20 12:03:44 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('preview', 'en,tr,cs,de,el,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');
+
+var TinyMCE_PreviewPlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Preview',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_preview.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  /**
+   * Returns the HTML contents of the preview control.
+   */
+  getControlHTML : function(cn) {
+    switch (cn) {
+      case "preview":
+        return tinyMCE.getButtonHTML(cn, 'lang_preview_desc', '{$pluginurl}/images/preview.gif', 'mcePreview');
+    }
+
+    return "";
+  },
+
+  /**
+   * Executes the mcePreview command.
+   */
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    // Handle commands
+    switch (command) {
+      case "mcePreview":
+        var previewPage = tinyMCE.getParam("plugin_preview_pageurl", null);
+        var previewWidth = tinyMCE.getParam("plugin_preview_width", "550");
+        var previewHeight = tinyMCE.getParam("plugin_preview_height", "600");
+
+        // Use a custom preview page
+        if (previewPage) {
+          var template = new Array();
+
+          template['file'] = previewPage;
+          template['width'] = previewWidth;
+          template['height'] = previewHeight;
+
+          tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "yes", inline : "yes", content : tinyMCE.getContent(), content_css : tinyMCE.getParam("content_css")});
+        } else {
+          var win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + previewWidth + ",height="  + previewHeight);
+          var html = "";
+          var c = tinyMCE.getContent();
+          var pos = c.indexOf('<body'), pos2;
+
+          if (pos != -1) {
+            pos = c.indexOf('>', pos);
+            pos2 = c.lastIndexOf('</body>');
+            c = c.substring(pos + 1, pos2);
+          }
+
+          html += tinyMCE.getParam('doctype');
+          html += '<html xmlns="http://www.w3.org/1999/xhtml">';
+          html += '<head>';
+          html += '<title>' + tinyMCE.getLang('lang_preview_desc') + '</title>';
+          html += '<base href="' + tinyMCE.settings['base_href'] + '" />';
+          html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
+          html += '<link href="' + tinyMCE.getParam("content_css") + '" rel="stylesheet" type="text/css" />';
+          html += '</head>';
+          html += '<body dir="' + tinyMCE.getParam("directionality") + '">';
+          html += c;
+          html += '</body>';
+          html += '</html>';
+
+          win.document.write(html);
+          win.document.close();
+        }
+
+        return true;
+    }
+
+    return false;
+  }
+};
+
+tinyMCE.addPlugin("preview", TinyMCE_PreviewPlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/example.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/example.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/example.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script language="javascript" src="../../tiny_mce_popup.js"></script>
+<title>Example of a custom preview page</title>
+<link href="{$content_css}" rel="stylesheet" type="text/css" />
+</head>
+<body>
+
+Editor contents: <br />
+{$content}
+
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/images/preview.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/images/preview.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+preview_desc : 'Preview'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/preview.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/preview.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/preview.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+  chdir('../../../../../');
+  include_once('includes/configure.php');
+  include(DIR_FS_ADMIN.'includes/application_top.php'); // Needed for admin security
+  
+  // #We need current stylesheet to be loaded into editor for enhanced editing.
+  $template_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_TEMPLATE'");
+  $template = tep_db_fetch_array($template_query);
+  $CURR_TEMPLATE = $template['configuration_value'] . '/';
+?>
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+<script language="javascript" src="../../tiny_mce_popup.js"></script>
+<title>Preview page</title>
+<link href="<?php echo HTTP_SERVER.DIR_WS_TEMPLATES . $CURR_TEMPLATE;?>stylesheet.css" rel="stylesheet" type="text/css">
+<script language="javascript">
+    window.focus;
+    window.resizeTo(600,400);
+    tinyMCE.setWindowArg('mce_windowresize', false);
+    var form = window.opener.document.adminForm
+    var title = form.title.value;
+    
+    var alltext = tinyMCE.getContent();
+
+</script>
+</head>
+<body>
+<table align="center" width="90%" cellspacing="2" cellpadding="2" border="0">
+  <tr>
+    <td>
+<b>Editor contents:</b> <hr />
+{$content}
+<br /><hr />
+</td>
+  </tr>
+</table>
+<table align="center" width="90%" cellspacing="2" cellpadding="2" border="0">
+  <tr>
+    <td align="right"><a href="#" onClick="window.close()"><b>Close</b></a></td>
+    <td align="left"><a href="javascript:;" onClick="window.print(); return false"><b>Print</b></a></td>
+  </tr>
+</table>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/preview/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+This is the location you place TinyMCE plugins.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('searchreplace','en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_SearchReplacePlugin={getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){inst.addShortcut('ctrl','f','lang_searchreplace_search_desc','mceSearch',true);},getControlHTML:function(cn){switch(cn){case"search":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_search_desc','{$pluginurl}/images/search.gif','mceSearch',true);case"replace":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_replace_desc','{$pluginurl}/images/replace.gif','mceSearchReplace',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){var instance=tinyMCE.getInstanceById(editor_id);function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key];}function replaceSel(search_str,str,back){instance.execCommand('mceInsertContent',false,str);}if(!value)value=new Array();defValue("editor_id",editor_id);defValue("searchstring","");defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");switch(command){case"mceResetSearch":tinyMCE.lastSearchRng=null;return true;case"mceSearch":if(user_interface){var template=new Array();if(value['replacestring']!=null){template['file']='../../plugins/searchreplace/replace.htm';template['width']=320;template['height']=100+(tinyMCE.isNS7?20:0);template['width']+=tinyMCE.getLang('lang_searchreplace_replace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}else{template['file']='../../plugins/searchreplace/search.htm';template['width']=310;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_searchreplace_search_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}instance.execCommand('SelectAll');if(tinyMCE.isMSIE){var r=instance.selection.getRng();r.collapse(true);r.select();}else instance.selection.getSel().collapseToStart();tinyMCE.openWindow(template,value);}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;if(body.innerHTML==""){alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true;}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring'],value['backwards']);value['replacemode']="none";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}if(tinyMCE.isMSIE){var rng=tinyMCE.lastSearchRng?tinyMCE.lastSearchRng:doc.selection.createRange();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){alert('This operation is currently not supported by this browser.');return true;}if(value['replacemode']=="all"){while(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(false);replaceSel(value['string'],value['replacestring'],value['backwards']);}alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(value['backwards']);tinyMCE.lastSearchRng=rng;}else alert(tinyMCE.getLang('lang_searchreplace_notfound'));}else{if(value['replacemode']=="all"){while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))replaceSel(value['string'],value['replacestring'],value['backwards']);alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))alert(tinyMCE.getLang('lang_searchreplace_notfound'));}}return true;case"mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}return false;}};tinyMCE.addPlugin("searchreplace",TinyMCE_SearchReplacePlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,185 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.27 $
+ * $Date: 2006/02/13 15:09:28 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import theme specific language pack */
+tinyMCE.importPluginLanguagePack('searchreplace', 'en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');
+
+var TinyMCE_SearchReplacePlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Search/Replace',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  initInstance : function(inst) {
+    inst.addShortcut('ctrl', 'f', 'lang_searchreplace_search_desc', 'mceSearch', true);
+  },
+
+  getControlHTML : function(cn) {
+    switch (cn) {
+      case "search":
+        return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_search_desc', '{$pluginurl}/images/search.gif', 'mceSearch', true);
+      case "replace":
+        return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_replace_desc', '{$pluginurl}/images/replace.gif', 'mceSearchReplace', true);
+    }
+    return "";
+  },
+
+  /**
+   * Executes the search/replace commands.
+   */
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    var instance = tinyMCE.getInstanceById(editor_id);
+
+    function defValue(key, default_value) {
+      value[key] = typeof(value[key]) == "undefined" ? default_value : value[key];
+    }
+
+    function replaceSel(search_str, str, back) {
+      instance.execCommand('mceInsertContent', false, str);
+    }
+
+    if (!value)
+      value = new Array();
+
+    // Setup defualt values
+    defValue("editor_id", editor_id);
+    defValue("searchstring", "");
+    defValue("replacestring", null);
+    defValue("replacemode", "none");
+    defValue("casesensitive", false);
+    defValue("backwards", false);
+    defValue("wrap", false);
+    defValue("wholeword", false);
+    defValue("inline", "yes");
+
+    // Handle commands
+    switch (command) {
+      case "mceResetSearch":
+        tinyMCE.lastSearchRng = null;
+        return true;
+
+      case "mceSearch":
+        if (user_interface) {
+          // Open search dialog
+          var template = new Array();
+
+          if (value['replacestring'] != null) {
+            template['file'] = '../../plugins/searchreplace/replace.htm'; // Relative to theme
+            template['width'] = 320;
+            template['height'] = 100 + (tinyMCE.isNS7 ? 20 : 0);
+            template['width'] += tinyMCE.getLang('lang_searchreplace_replace_delta_width', 0);
+            template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0);
+          } else {
+            template['file'] = '../../plugins/searchreplace/search.htm'; // Relative to theme
+            template['width'] = 310;
+            template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0);
+            template['width'] += tinyMCE.getLang('lang_searchreplace_search_delta_width', 0);
+            template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0);
+          }
+
+          instance.execCommand('SelectAll');
+
+          if (tinyMCE.isMSIE) {
+            var r = instance.selection.getRng();
+            r.collapse(true);
+            r.select();
+          } else
+            instance.selection.getSel().collapseToStart();
+
+          tinyMCE.openWindow(template, value);
+        } else {
+          var win = tinyMCE.getInstanceById(editor_id).contentWindow;
+          var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document;
+          var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body;
+
+          // Whats the point
+          if (body.innerHTML == "") {
+            alert(tinyMCE.getLang('lang_searchreplace_notfound'));
+            return true;
+          }
+
+          // Handle replace current
+          if (value['replacemode'] == "current") {
+            replaceSel(value['string'], value['replacestring'], value['backwards']);
+
+            // Search next one
+            value['replacemode'] = "none";
+            tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
+
+            return true;
+          }
+
+          if (tinyMCE.isMSIE) {
+            var rng = tinyMCE.lastSearchRng ? tinyMCE.lastSearchRng : doc.selection.createRange();
+            var flags = 0;
+
+            if (value['wholeword'])
+              flags = flags | 2;
+
+            if (value['casesensitive'])
+              flags = flags | 4;
+
+            if (!rng.findText) {
+              alert('This operation is currently not supported by this browser.');
+              return true;
+            }
+
+            // Handle replace all mode
+            if (value['replacemode'] == "all") {
+              while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
+                rng.scrollIntoView();
+                rng.select();
+                rng.collapse(false);
+                replaceSel(value['string'], value['replacestring'], value['backwards']);
+              }
+
+              alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
+              return true;
+            }
+
+            if (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
+              rng.scrollIntoView();
+              rng.select();
+              rng.collapse(value['backwards']);
+              tinyMCE.lastSearchRng = rng;
+            } else
+              alert(tinyMCE.getLang('lang_searchreplace_notfound'));
+          } else {
+            if (value['replacemode'] == "all") {
+              while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
+                replaceSel(value['string'], value['replacestring'], value['backwards']);
+
+              alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
+              return true;
+            }
+
+            if (!win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
+              alert(tinyMCE.getLang('lang_searchreplace_notfound'));
+          }
+        }
+        return true;
+
+      case "mceSearchReplace":
+        value['replacestring'] = "";
+
+        tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
+        return true;
+    }
+
+    // Pass to next handler in chain
+    return false;
+  }
+};
+
+tinyMCE.addPlugin("searchreplace", TinyMCE_SearchReplacePlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/images/replace.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/images/replace.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/images/search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/images/search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts/replace.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts/replace.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts/replace.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  var formObj = document.forms[0];
+
+  formObj.searchstring.value = tinyMCE.getWindowArg("searchstring");
+  formObj.replacestring.value = tinyMCE.getWindowArg("replacestring");
+  formObj.casesensitivebox.checked = tinyMCE.getWindowArg("casesensitive");
+//  formObj.backwards[0].checked = tinyMCE.getWindowArg("backwards");
+//  formObj.backwards[1].checked = !tinyMCE.getWindowArg("backwards");
+//    formObj.wrapatend.checked = tinyMCE.getWindowArg("wrap");
+//    formObj.wholeword.checked = tinyMCE.getWindowArg("wholeword");
+
+  tinyMCEPopup.execCommand("mceResetSearch", false, {dummy : ""}, false);
+}
+
+function searchNext(replacemode) {
+  var formObj = document.forms[0];
+
+  // Whats the point?
+  if (formObj.searchstring.value == "" || formObj.searchstring.value == formObj.replacestring.value)
+    return;
+
+  // Do search
+  tinyMCEPopup.execCommand('mceSearch', false, { 
+    string : formObj.searchstring.value,
+    replacestring : formObj.replacestring.value,
+    replacemode : replacemode,
+    casesensitive : formObj.casesensitivebox.checked,
+    backwards : false
+//      wrap : formObj.wrapatend.checked,
+//      wholeword : formObj.wholeword.checked
+    }, false);
+
+  window.focus();
+}
+
+function cancelAction() {
+  tinyMCEPopup.close();
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts/search.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts/search.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/jscripts/search.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  var formObj = document.forms[0];
+
+  formObj.searchstring.value = tinyMCE.getWindowArg("searchstring");
+  formObj.casesensitivebox.checked = tinyMCE.getWindowArg("casesensitive");
+  formObj.backwards[0].checked = tinyMCE.getWindowArg("backwards");
+  formObj.backwards[1].checked = !tinyMCE.getWindowArg("backwards");
+//    formObj.wrapatend.checked = tinyMCE.getWindowArg("wrap");
+//    formObj.wholeword.checked = tinyMCE.getWindowArg("wholeword");
+
+  tinyMCEPopup.execCommand("mceResetSearch", false, {dummy : ""}, false);
+}
+
+function searchNext() {
+  var formObj = document.forms[0];
+
+  if (formObj.searchstring.value == "")
+    return;
+
+  // Do search
+  tinyMCEPopup.execCommand('mceSearch', false, { 
+    string : formObj.searchstring.value,
+    casesensitive : formObj.casesensitivebox.checked,
+    backwards : formObj.backwards[0].checked
+//      wrap : formObj.wrapatend.checked,
+//      wholeword : formObj.wholeword.checked
+    }, false);
+
+  window.focus();
+}
+
+function cancelAction() {
+  tinyMCEPopup.close();
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+searchreplace_search_desc : 'Find',
+searchreplace_searchnext_desc : 'Find again',
+searchreplace_replace_desc : 'Find/Replace',
+searchreplace_notfound : 'The search has been completed. The search string could not be found.',
+searchreplace_search_title : 'Find',
+searchreplace_replace_title : 'Find/Replace',
+searchreplace_allreplaced : 'All occurrences of the search string were replaced.',
+searchreplace_findwhat : 'Find what',
+searchreplace_replacewith : 'Replace with',
+searchreplace_direction : 'Direction',
+searchreplace_up : 'Up',
+searchreplace_down : 'Down',
+searchreplace_case : 'Match case',
+searchreplace_findnext : 'Find&nbsp;next',
+searchreplace_replace : 'Replace',
+searchreplace_replaceall : 'Replace&nbsp;all',
+searchreplace_cancel : 'Cancel'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/replace.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/replace.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/replace.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_searchreplace_replace_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/replace.js"></script>
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none; margin: 4px;">
+<form onsubmit="searchNext('none');return false;" action="#">
+  <table border="0" cellspacing="0" cellpadding="2">
+    <tr>
+    <td><label for="searchstring">{$lang_searchreplace_findwhat}</label></td>
+    <td><input type="text" id="searchstring" name="searchstring" style="width: 200px" /></td>
+    </tr>
+    <tr>
+    <td><label for="replacestring">{$lang_searchreplace_replacewith}</label></td>
+    <td><input type="text" id="replacestring" name="replacestring" style="width: 200px" /></td>
+    </tr>
+        <tr>
+          <td colspan="2"><!--<table border="0" cellspacing="0" cellpadding="0">
+            <tr>
+              <td><label>{$lang_searchreplace_direction}</label></td>
+              <td><input id="backwardsu" name="backwards" class="radio" type="radio" value="true" /></td>
+              <td><label for="backwardsu">{$lang_searchreplace_up}</label></td>
+              <td><input id="backwardsd" name="backwards" class="radio" type="radio" value="false" /></td>
+              <td><label for="backwardsd">{$lang_searchreplace_down}</label></td>
+            </tr>
+          </table>--></td>
+        </tr>
+        <tr>
+<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
+  <tr>
+    <td><input id="casesensitivebox" name="casesensitivebox" class="checkbox" type="checkbox" value="true" /></td>
+    <td><label for="casesensitivebox">{$lang_searchreplace_case}</label></td>
+  </tr>
+</table></td>
+</tr>
+      </table>
+  <table border="0" width="300" cellspacing="0" cellpadding="4">
+    <tr>
+      <td><input id="insertBtn" name="insertBtn" type="button" value="{$lang_searchreplace_findnext}" onclick="searchNext('none');" /></td>
+      <td><input name="replaceBtn" type="button" id="replaceBtn" value="{$lang_searchreplace_replace}" onclick="searchNext('current');" /></td>
+      <td><input name="replaceBtn" type="button" id="replaceAllBtn" value="{$lang_searchreplace_replaceall}" onclick="searchNext('all');" /></td>
+     <td align="right"><input name="cancelBtn" type="button" id="cancelBtn" value="{$lang_searchreplace_cancel}" onclick="cancelAction();" /></td>
+    </tr>
+  </table>
+</form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/search.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/search.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/searchreplace/search.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_searchreplace_search_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/search.js"></script>
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none; margin: 4px;">
+<form onsubmit="searchNext();return false;" action="#">
+  <table border="0" cellspacing="0" cellpadding="2">
+        <tr>
+          <td><label for="searchstring">{$lang_searchreplace_findwhat}</label>&nbsp;<input type="text" id="searchstring" name="searchstring" style="width: 200px" /></td>
+        </tr>
+        <tr>
+          <td><table border="0" cellspacing="0" cellpadding="0">
+            <tr>
+              <td><label>{$lang_searchreplace_direction}</label></td>
+              <td><input id="backwardsu" name="backwards" class="radio" type="radio" value="true" /></td>
+              <td><label for="backwardsu">{$lang_searchreplace_up}</label></td>
+              <td><input id="backwardsd" name="backwards" class="radio" type="radio" value="false" /></td>
+              <td><label for="backwardsd">{$lang_searchreplace_down}</label></td>
+            </tr>
+          </table></td>
+        </tr>
+        <tr>
+<td><table border="0" cellspacing="0" cellpadding="0">
+  <tr>
+    <td><input id="casesensitivebox" name="casesensitivebox" class="checkbox" type="checkbox" value="true" /></td>
+    <td><label for="casesensitivebox">{$lang_searchreplace_case}</label></td>
+  </tr>
+</table></td>
+</tr>
+      </table>
+  <table border="0" width="300" cellspacing="0" cellpadding="4">
+    <tr>
+      <td><input id="insert" name="insert" type="submit" value="{$lang_searchreplace_findnext}" /></td>
+      <td align="right"><input id="cancel" name="cancel" type="button" value="{$lang_searchreplace_cancel}" onclick="cancelAction();" /></td>
+    </tr>
+  </table>
+</form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/css/props.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/css/props.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/css/props.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+#text_font {
+  width: 250px;
+}
+
+#text_size {
+  width: 70px;
+}
+
+.mceAddSelectValue {
+  background-color: #DDDDDD;
+}
+
+select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {
+  width: 70px;
+}
+
+#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {
+  width: 70px;
+}
+
+#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {
+  width: 70px;
+}
+
+#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {
+  width: 70px;
+}
+
+.panel_wrapper div.current {
+  padding-top: 10px;
+  height: 230px;
+}
+
+.delim {
+  b2ackground-color: #DDDDDD;
+  border-left: 1px solid gray;
+}
+
+.tdelim {
+  border-bottom: 1px solid gray;  
+}
+
+#block_display {
+  width: 145px;
+}
+
+#list_type {
+  width: 115px;
+}
+
+.disabled {
+  background-color: #EEEEEE;
+}
+
+#apply {
+  font-weight: bold;
+  width: 78px;
+  height: 21px;
+  border: 0;
+  background-image: url('../images/apply_button_bg.gif');
+  cursor: pointer;
+}
+

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('style','en');var TinyMCE_StylePlugin={getInfo:function(){return{longname:'Style',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_style.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"styleprops":return tinyMCE.getButtonHTML(cn,'lang_style_styleinfo_desc','{$pluginurl}/images/style_info.gif','mceStyleProps',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){var e,inst;switch(command){case"mceStyleProps":TinyMCE_StylePlugin._styleProps();return true;case"mceSetElementStyle":inst=tinyMCE.getInstanceById(editor_id);e=inst.selection.getFocusElement();if(e){e.style.cssText=value;inst.repaint();}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){},_styleProps:function(){var e=tinyMCE.selectedInstance.selection.getFocusElement();if(!e)return;tinyMCE.openWindow({file:'../../plugins/style/props.htm',width:480+tinyMCE.getLang('lang_style_props_delta_width',0),height:320+tinyMCE.getLang('lang_style_props_delta_height',0)},{editor_id:tinyMCE.selectedInstance.editorId,inline:"yes",style_text:e.style.cssText});}};tinyMCE.addPlugin("style",TinyMCE_StylePlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.1 $
+ * $Date: 2006/05/03 10:46:42 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('style', 'en');
+
+var TinyMCE_StylePlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Style',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_style.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  getControlHTML : function(cn) {
+    switch (cn) {
+      case "styleprops":
+        return tinyMCE.getButtonHTML(cn, 'lang_style_styleinfo_desc', '{$pluginurl}/images/style_info.gif', 'mceStyleProps', true);
+    }
+
+    return "";
+  },
+
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    var e, inst;
+
+    // Handle commands
+    switch (command) {
+      case "mceStyleProps":
+        TinyMCE_StylePlugin._styleProps();
+        return true;
+
+      case "mceSetElementStyle":
+        inst = tinyMCE.getInstanceById(editor_id);
+        e = inst.selection.getFocusElement();
+
+        if (e) {
+          e.style.cssText = value;
+          inst.repaint();
+        }
+
+        return true;
+    }
+
+    // Pass to next handler in chain
+    return false;
+  },
+
+  handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+  },
+
+  // Private plugin specific methods
+
+  _styleProps : function() {
+    var e = tinyMCE.selectedInstance.selection.getFocusElement();
+
+    if (!e)
+      return;
+
+    tinyMCE.openWindow({
+      file : '../../plugins/style/props.htm',
+      width : 480 + tinyMCE.getLang('lang_style_props_delta_width', 0),
+      height : 320 + tinyMCE.getLang('lang_style_props_delta_height', 0)
+    }, {
+      editor_id : tinyMCE.selectedInstance.editorId,
+      inline : "yes",
+      style_text : e.style.cssText
+    });
+  }
+};
+
+tinyMCE.addPlugin("style", TinyMCE_StylePlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/images/apply_button_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/images/apply_button_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/images/style_info.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/images/style_info.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/jscripts/props.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/jscripts/props.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/jscripts/props.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,630 @@
+var defaultFonts = "" + 
+  "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + 
+  "Times New Roman, Times, serif=Times New Roman, Times, serif;" + 
+  "Courier New, Courier, mono=Courier New, Courier, mono;" + 
+  "Times New Roman, Times, serif=Times New Roman, Times, serif;" + 
+  "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + 
+  "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + 
+  "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
+
+var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
+var defaultMeasurement = "+pixels=px;points=pt;in;cm;mm;picas;ems;exs;%";
+var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%";
+var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%";
+var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
+var defaultTextStyle = "normal;italic;oblique";
+var defaultVariant = "normal;small-caps";
+var defaultLineHeight = "normal";
+var defaultAttachment = "fixed;scroll";
+var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";
+var defaultPosH = "left;center;right";
+var defaultPosV = "top;center;bottom";
+var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";
+var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";
+var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";
+var defaultBorderWidth = "thin;medium;thick";
+var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";
+
+function init() {
+  var ce = document.getElementById('container');
+
+  ce.style.cssText = tinyMCEPopup.getWindowArg('style_text');
+
+  tinyMCEPopup.resizeToInnerSize();
+
+  document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');
+  document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');
+  document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');
+  document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');
+  document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');
+  document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');
+
+  fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);
+  fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);
+  fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);
+  fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);
+  fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);
+  fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);
+  fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);
+  fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);
+
+  fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);
+  fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);
+
+  fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);
+
+  fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);
+  fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);
+
+  fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);
+  fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);
+  fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);
+  fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);
+  fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);
+  fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);
+  fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);
+  fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);
+  fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);
+
+  fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);
+  fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);
+  fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);
+
+  fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);
+  fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);
+  fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);
+  fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);
+
+  fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);
+  fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);
+  fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);
+  fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);
+
+  fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);
+
+  fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);
+  fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);
+
+  fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);
+  fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);
+
+  fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);
+
+  fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);
+
+  fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);
+  fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);
+
+  TinyMCE_EditableSelects.init();
+  setupFormData();
+  showDisabledControls();
+}
+
+function setupFormData() {
+  var ce = document.getElementById('container'), f = document.forms[0], s, b, i;
+
+  // Setup text fields
+
+  selectByValue(f, 'text_font', ce.style.fontFamily, true, true);
+  selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);
+  selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));
+  selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);
+  selectByValue(f, 'text_style', ce.style.fontStyle, true, true);
+  selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);
+  selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));
+  selectByValue(f, 'text_case', ce.style.textTransform, true, true);
+  selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);
+  f.text_color.value = ce.style.color;
+  updateColor('text_color_pick', 'text_color');
+  f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');
+  f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');
+  f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');
+  f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');
+
+  // Setup background fields
+
+  f.background_color.value = ce.style.backgroundColor;
+  updateColor('background_color_pick', 'background_color');
+  f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+  selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);
+  selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);
+  selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);
+  selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));
+  selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);
+  selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));
+
+  // Setup block fields
+
+  selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);
+  selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));
+  selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);
+  selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));
+  selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);
+  selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);
+  f.block_text_indent.value = getNum(ce.style.textIndent);
+  selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));
+  selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);
+  selectByValue(f, 'block_display', ce.style.display, true, true);
+
+  // Setup box fields
+
+  f.box_width.value = getNum(ce.style.width);
+  selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));
+
+  f.box_height.value = getNum(ce.style.height);
+  selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));
+
+  if (tinyMCE.isGecko)
+    selectByValue(f, 'box_float', ce.style.cssFloat, true, true);
+  else
+    selectByValue(f, 'box_float', ce.style.styleFloat, true, true);
+
+  selectByValue(f, 'box_clear', ce.style.clear, true, true);
+
+  setupBox(f, ce, 'box_padding', 'padding', '');
+  setupBox(f, ce, 'box_margin', 'margin', '');
+
+  // Setup border fields
+
+  setupBox(f, ce, 'border_style', 'border', 'Style');
+  setupBox(f, ce, 'border_width', 'border', 'Width');
+  setupBox(f, ce, 'border_color', 'border', 'Color');
+
+  updateColor('border_color_top_pick', 'border_color_top');
+  updateColor('border_color_right_pick', 'border_color_right');
+  updateColor('border_color_bottom_pick', 'border_color_bottom');
+  updateColor('border_color_left_pick', 'border_color_left');
+
+  // Setup list fields
+
+  selectByValue(f, 'list_type', ce.style.listStyleType, true, true);
+  selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);
+  f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+
+  // Setup box fields
+
+  selectByValue(f, 'positioning_type', ce.style.position, true, true);
+  selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);
+  selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);
+  f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";
+
+  f.positioning_width.value = getNum(ce.style.width);
+  selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));
+
+  f.positioning_height.value = getNum(ce.style.height);
+  selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
+
+  setupBox(f, ce, 'positioning_placement', '', '', new Array('top', 'right', 'bottom', 'left'));
+
+  s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
+  s = s.replace(/,/g, ' ');
+
+  if (!hasEqualValues(new Array(getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)))) {
+    f.positioning_clip_top.value = getNum(getVal(s, 0));
+    selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
+    f.positioning_clip_right.value = getNum(getVal(s, 1));
+    selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));
+    f.positioning_clip_bottom.value = getNum(getVal(s, 2));
+    selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));
+    f.positioning_clip_left.value = getNum(getVal(s, 3));
+    selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));
+  } else {
+    f.positioning_clip_top.value = getNum(getVal(s, 0));
+    selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
+    f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;
+  }
+
+//  setupBox(f, ce, '', 'border', 'Color');
+}
+
+function getMeasurement(s) {
+  return s.replace(/^([0-9]+)(.*)$/, "$2");
+}
+
+function getNum(s) {
+  if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s))
+    return s.replace(/[^0-9]/g, '');
+
+  return s;
+}
+
+function inStr(s, n) {
+  return new RegExp(n, 'gi').test(s);
+}
+
+function getVal(s, i) {
+  var a = tinyMCE.explode(' ', s);
+
+  if (a.length > 1)
+    return a[i];
+
+  return "";
+}
+
+function setValue(f, n, v) {
+  if (f.elements[n].type == "text")
+    f.elements[n].value = v;
+  else
+    selectByValue(f, n, v, true, true);
+}
+
+function setupBox(f, ce, fp, pr, sf, b) {
+  if (typeof(b) == "undefined")
+    b = new Array('Top', 'Right', 'Bottom', 'Left');
+
+  if (isSame(ce, pr, sf, b)) {
+    f.elements[fp + "_same"].checked = true;
+
+    setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
+    f.elements[fp + "_top"].disabled = false;
+
+    f.elements[fp + "_right"].value = "";
+    f.elements[fp + "_right"].disabled = true;
+    f.elements[fp + "_bottom"].value = "";
+    f.elements[fp + "_bottom"].disabled = true;
+    f.elements[fp + "_left"].value = "";
+    f.elements[fp + "_left"].disabled = true;
+
+    if (f.elements[fp + "_top_measurement"]) {
+      selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
+      f.elements[fp + "_left_measurement"].disabled = true;
+      f.elements[fp + "_bottom_measurement"].disabled = true;
+      f.elements[fp + "_right_measurement"].disabled = true;
+    }
+  } else {
+    f.elements[fp + "_same"].checked = false;
+
+    setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
+    f.elements[fp + "_top"].disabled = false;
+
+    setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));
+    f.elements[fp + "_right"].disabled = false;
+
+    setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));
+    f.elements[fp + "_bottom"].disabled = false;
+
+    setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));
+    f.elements[fp + "_left"].disabled = false;
+
+    if (f.elements[fp + "_top_measurement"]) {
+      selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
+      selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));
+      selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));
+      selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));
+      f.elements[fp + "_left_measurement"].disabled = false;
+      f.elements[fp + "_bottom_measurement"].disabled = false;
+      f.elements[fp + "_right_measurement"].disabled = false;
+    }
+  }
+}
+
+function isSame(e, pr, sf, b) {
+  var a = new Array(), i, x;
+
+  if (typeof(b) == "undefined")
+    b = new Array('Top', 'Right', 'Bottom', 'Left');
+
+  if (typeof(sf) == "undefined" || sf == null)
+    sf = "";
+
+  a[0] = e.style[pr + b[0] + sf];
+  a[1] = e.style[pr + b[1] + sf];
+  a[2] = e.style[pr + b[2] + sf];
+  a[3] = e.style[pr + b[3] + sf];
+
+  for (i=0; i<a.length; i++) {
+    if (a[i] == null)
+      return false;
+
+    for (x=0; x<a.length; x++) {
+      if (a[x] != a[i])
+        return false;
+    }
+  }
+
+  return true;
+};
+
+function hasEqualValues(a) {
+  var i, x;
+
+  for (i=0; i<a.length; i++) {
+    if (a[i] == null)
+      return false;
+
+    for (x=0; x<a.length; x++) {
+      if (a[x] != a[i])
+        return false;
+    }
+  }
+
+  return true;
+}
+
+function applyAction() {
+  var ce = document.getElementById('container');
+
+  generateCSS();
+
+  tinyMCEPopup.execCommand('mceSetElementStyle', false, tinyMCE.serializeStyle(tinyMCE.parseStyle(ce.style.cssText)));
+}
+
+function updateAction() {
+  applyAction();
+  tinyMCEPopup.close();
+}
+
+function generateCSS() {
+  var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;
+
+  ce.style.cssText = "";
+
+  // Build text styles
+  ce.style.fontFamily = f.text_font.value;
+  ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? f.text_size_measurement.value : "");
+  ce.style.fontStyle = f.text_style.value;
+  ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : "");
+  ce.style.textTransform = f.text_case.value;
+  ce.style.fontWeight = f.text_weight.value;
+  ce.style.fontVariant = f.text_variant.value;
+  ce.style.color = f.text_color.value;
+
+  s = "";
+  s += f.text_underline.checked ? " underline" : "";
+  s += f.text_overline.checked ? " overline" : "";
+  s += f.text_linethrough.checked ? " line-through" : "";
+  s += f.text_blink.checked ? " blink" : "";
+  s = s.length > 0 ? s.substring(1) : s;
+
+  if (f.text_none.checked)
+    s = "none";
+
+  ce.style.textDecoration = s;
+
+  // Build background styles
+
+  ce.style.backgroundColor = f.background_color.value;
+  ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";
+  ce.style.backgroundRepeat = f.background_repeat.value;
+  ce.style.backgroundAttachment = f.background_attachment.value;
+
+  if (f.background_hpos.value != "") {
+    s = "";
+    s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";
+    s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");
+    ce.style.backgroundPosition = s;
+  }
+
+  // Build block styles
+
+  ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");
+  ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");
+  ce.style.verticalAlign = f.block_vertical_alignment.value;
+  ce.style.textAlign = f.block_text_align.value;
+  ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");
+  ce.style.whiteSpace = f.block_whitespace.value;
+  ce.style.display = f.block_display.value;
+
+  // Build box styles
+
+  ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");
+  ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");
+  ce.style.styleFloat = f.box_float.value;
+
+  if (tinyMCE.isGecko)
+    ce.style.cssFloat = f.box_float.value;
+
+  ce.style.clear = f.box_clear.value;
+
+  if (!f.box_padding_same.checked) {
+    ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
+    ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");
+    ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");
+    ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");
+  } else
+    ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");   
+
+  if (!f.box_margin_same.checked) {
+    ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
+    ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");
+    ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");
+    ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");
+  } else
+    ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");   
+
+  // Build border styles
+
+  if (!f.border_style_same.checked) {
+    ce.style.borderTopStyle = f.border_style_top.value;
+    ce.style.borderRightStyle = f.border_style_right.value;
+    ce.style.borderBottomStyle = f.border_style_bottom.value;
+    ce.style.borderLeftStyle = f.border_style_left.value;
+  } else
+    ce.style.borderStyle = f.border_style_top.value;
+
+  if (!f.border_width_same.checked) {
+    ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
+    ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");
+    ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");
+    ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");
+  } else
+    ce.style.borderWidth = f.border_width_top.value;
+
+  if (!f.border_color_same.checked) {
+    ce.style.borderTopColor = f.border_color_top.value;
+    ce.style.borderRightColor = f.border_color_right.value;
+    ce.style.borderBottomColor = f.border_color_bottom.value;
+    ce.style.borderLeftColor = f.border_color_left.value;
+  } else
+    ce.style.borderColor = f.border_color_top.value;
+
+  // Build list styles
+
+  ce.style.listStyleType = f.list_type.value;
+  ce.style.listStylePosition = f.list_position.value;
+  ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";
+
+  // Build positioning styles
+
+  ce.style.position = f.positioning_type.value;
+  ce.style.visibility = f.positioning_visibility.value;
+
+  if (ce.style.width == "")
+    ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");
+
+  if (ce.style.height == "")
+    ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");
+
+  ce.style.zIndex = f.positioning_zindex.value;
+  ce.style.overflow = f.positioning_overflow.value;
+
+  if (!f.positioning_placement_same.checked) {
+    ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
+    ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");
+    ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");
+    ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");
+  } else {
+    s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
+    ce.style.top = s;
+    ce.style.right = s;
+    ce.style.bottom = s;
+    ce.style.left = s;
+  }
+
+  if (!f.positioning_clip_same.checked) {
+    s = "rect(";
+    s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";
+    s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";
+    s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";
+    s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");
+    s += ")";
+
+    if (s != "rect(auto auto auto auto)")
+      ce.style.clip = s;
+  } else {
+    s = "rect(";
+    t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";
+    s += t + " ";
+    s += t + " ";
+    s += t + " ";
+    s += t + ")";
+
+    if (s != "rect(auto auto auto auto)")
+      ce.style.clip = s;
+  }
+
+  ce.style.cssText = tinyMCE.serializeStyle(tinyMCE.parseStyle(ce.style.cssText));
+}
+
+function isNum(s) {
+  return new RegExp('[0-9]+', 'g').test(s);
+}
+
+function showDisabledControls() {
+  var f = document.forms, i, a;
+
+  for (i=0; i<f.length; i++) {
+    for (a=0; a<f[i].elements.length; a++) {
+      if (f[i].elements[a].disabled)
+        tinyMCE.addCSSClass(f[i].elements[a], "disabled");
+      else
+        tinyMCE.removeCSSClass(f[i].elements[a], "disabled");
+    }
+  }
+}
+
+function fillSelect(f, s, param, dval, sep, em) {
+  var i, ar, p, se;
+
+  f = document.forms[f];
+  sep = typeof(sep) == "undefined" ? ";" : sep;
+
+  if (em)
+    addSelectValue(f, s, "", "");
+
+  ar = tinyMCE.getParam(param, dval).split(sep);
+  for (i=0; i<ar.length; i++) {
+    se = false;
+
+    if (ar[i].charAt(0) == '+') {
+      ar[i] = ar[i].substring(1);
+      se = true;
+    }
+
+    p = ar[i].split('=');
+
+    if (p.length > 1) {
+      addSelectValue(f, s, p[0], p[1]);
+
+      if (se)
+        selectByValue(f, s, p[1]);
+    } else {
+      addSelectValue(f, s, p[0], p[0]);
+
+      if (se)
+        selectByValue(f, s, p[0]);
+    }
+  }
+}
+
+function toggleSame(ce, pre) {
+  var el = document.forms[0].elements, i;
+
+  if (ce.checked) {
+    el[pre + "_top"].disabled = false;
+    el[pre + "_right"].disabled = true;
+    el[pre + "_bottom"].disabled = true;
+    el[pre + "_left"].disabled = true;
+
+    if (el[pre + "_top_measurement"]) {
+      el[pre + "_top_measurement"].disabled = false;
+      el[pre + "_right_measurement"].disabled = true;
+      el[pre + "_bottom_measurement"].disabled = true;
+      el[pre + "_left_measurement"].disabled = true;
+    }
+  } else {
+    el[pre + "_top"].disabled = false;
+    el[pre + "_right"].disabled = false;
+    el[pre + "_bottom"].disabled = false;
+    el[pre + "_left"].disabled = false;
+
+    if (el[pre + "_top_measurement"]) {
+      el[pre + "_top_measurement"].disabled = false;
+      el[pre + "_right_measurement"].disabled = false;
+      el[pre + "_bottom_measurement"].disabled = false;
+      el[pre + "_left_measurement"].disabled = false;
+    }
+  }
+
+  showDisabledControls();
+}
+
+function synch(fr, to) {
+  var f = document.forms[0];
+
+  f.elements[to].value = f.elements[fr].value;
+
+  if (f.elements[fr + "_measurement"])
+    selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+// UK lang variables
+
+tinyMCE.addToLang('style',{
+title : 'Edit CSS Style',
+styleinfo_desc : 'Edit CSS Style',
+text_tab : 'Text',
+background_tab : 'Background',
+block_tab : 'Block',
+box_tab : 'Box',
+border_tab : 'Border',
+list_tab : 'List',
+positioning_tab : 'Positioning',
+text_props : 'Text',
+text_font : 'Font',
+text_size : 'Size',
+text_weight : 'Weight',
+text_style : 'Style',
+text_variant : 'Variant',
+text_lineheight : 'Line height',
+text_case : 'Case',
+text_color : 'Color',
+text_decoration : 'Decoration',
+background_color : 'Background color',
+background_image : 'Background image',
+background_repeat : 'Repeat',
+background_attachment : 'Attachment',
+background_hpos : 'Horizontal position',
+background_vpos : 'Vertical position',
+block_wordspacing : 'Word spacing',
+block_letterspacing : 'Letter spacing',
+block_vertical_alignment : 'Vertical alignment',
+block_text_align : 'Text align',
+block_text_indent : 'Text indent',
+block_whitespace : 'Whitespace',
+block_display : 'Display',
+box_width : 'Width',
+box_height : 'Height',
+box_float : 'Float',
+box_clear : 'Clear',
+padding : 'Padding',
+same : 'Same for all',
+top : 'Top',
+right : 'Right',
+bottom : 'Bottom',
+left : 'Left',
+margin : 'Margin',
+style : 'Style',
+width : 'Width',
+height : 'Height',
+color : 'Color',
+list_type : 'Type',
+bullet_image : 'Bullet image',
+position : 'Position',
+positioning_type : 'Type',
+visibility : 'Visibility',
+zindex : 'Z-index',
+overflow : 'Overflow',
+placement : 'Placement',
+clip : 'Clip'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/props.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/props.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/props.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,580 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_style_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/props.js"></script>
+  <link href="css/props.css" rel="stylesheet" type="text/css" />
+  <base target="_self" />
+</head>
+<body id="styleprops" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+  <form onsubmit="updateAction();return false;" action="#">
+    <div class="tabs">
+      <ul>
+        <li id="text_tab" class="current"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onmousedown="return false;">{$lang_style_text_tab}</a></span></li>
+        <li id="background_tab"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onmousedown="return false;">{$lang_style_background_tab}</a></span></li>
+        <li id="block_tab"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onmousedown="return false;">{$lang_style_block_tab}</a></span></li>
+        <li id="box_tab"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onmousedown="return false;">{$lang_style_box_tab}</a></span></li>
+        <li id="border_tab"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onmousedown="return false;">{$lang_style_border_tab}</a></span></li>
+        <li id="list_tab"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onmousedown="return false;">{$lang_style_list_tab}</a></span></li>
+        <li id="positioning_tab"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onmousedown="return false;">{$lang_style_positioning_tab}</a></span></li>
+      </ul>
+    </div>
+
+    <div class="panel_wrapper">
+      <div id="text_panel" class="panel current">
+        <table border="0" width="100%">
+          <tr>
+            <td><label for="text_font">{$lang_style_text_font}</label></td>
+            <td colspan="3">
+              <select id="text_font" name="text_font" class="mceEditableSelect" onchange="alert(this.options[this.selectedIndex].value);"></select>
+            </td>
+          </tr>
+          <tr>
+            <td><label for="text_size">{$lang_style_text_size}</label></td>
+            <td>
+              <table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
+                <td>&nbsp;<select id="text_size_measurement" name="text_size_measurement"></select>
+              </tr></table>
+            </td>
+            <td><label for="text_weight">{$lang_style_text_weight}</label></td>
+            <td>
+              <select id="text_weight" name="text_weight"></select>
+            </td>
+          </tr>
+          <tr>
+            <td><label for="text_style">{$lang_style_text_style}</label></td>
+            <td>
+              <select id="text_style" name="text_style" class="mceEditableSelect"></select>
+            </td>
+            <td><label for="text_variant">{$lang_style_text_variant}</label></td>
+            <td>
+              <select id="text_variant" name="text_variant"></select>
+            </td>
+          </tr>
+          <tr>
+            <td><label for="text_lineheight">{$lang_style_text_lineheight}</label></td>
+            <td>
+              <table border="0" cellspacing="0" cellpadding="0"><tr><td>
+              <select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
+              </td><td>&nbsp;<select id="text_lineheight_measurement" name="text_lineheight_measurement"></select>
+              </tr></table>
+            </td>
+            <td><label for="text_case">{$lang_style_text_case}</label></td>
+            <td>
+              <select id="text_case" name="text_case"></select>
+            </td>
+          </tr>
+          <tr>
+            <td><label for="text_color">{$lang_style_text_color}</label></td>
+            <td colspan="2">
+              <table border="0" cellpadding="0" cellspacing="0">
+                <tr>
+                  <td><input id="text_color" name="text_color" type="text" value="" size="9" onchange="updateColor('text_color_pick','text_color');" /></td>
+                  <td id="text_color_pickcontainer">&nbsp;</td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+          <tr>
+            <td>{$lang_style_text_decoration}</td>
+            <td colspan="2">
+              <table border="0" cellspacing="0" cellpadding="0">
+                <tr><td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td><td><label for="text_underline">underline</label></td></tr>
+                <tr><td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td><td><label for="text_overline">overline</label></td></tr>
+                <tr><td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td><td><label for="text_linethrough">line-through</label></td></tr>
+                <tr><td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td><td><label for="text_blink">blink</label></td></tr>
+                <tr><td><input id="text_none" name="text_none" class="checkbox" type="checkbox" /></td><td><label for="text_none">none</label></td></tr>
+              </table>
+            </td>
+          </tr>
+        </table>
+      </div>
+
+      <div id="background_panel" class="panel">
+        <table border="0">
+          <tr>
+            <td><label for="background_color">{$lang_style_background_color}</label></td>
+            <td>
+              <table border="0" cellpadding="0" cellspacing="0">
+                <tr>
+                  <td><input id="background_color" name="background_color" type="text" value="" size="9" onchange="updateColor('background_color_pick','background_color');" /></td>
+                  <td id="background_color_pickcontainer">&nbsp;</td>
+                </tr>
+              </table>
+            </td> 
+          </tr>
+
+          <tr>
+            <td><label for="background_image">{$lang_style_background_image}</label></td>
+            <td><input id="background_image" name="background_image" type="text" /></td>  
+          </tr>
+
+          <tr>
+            <td><label for="background_repeat">{$lang_style_background_repeat}</label></td>
+            <td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>  
+          </tr>
+
+          <tr>
+            <td><label for="background_attachment">{$lang_style_background_attachment}</label></td>
+            <td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>  
+          </tr>
+
+          <tr>
+            <td><label for="background_hpos">{$lang_style_background_hpos}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
+                <td>&nbsp;<select id="background_hpos_measurement" name="background_hpos_measurement"></select>
+              </tr></table>
+            </td>
+          </tr>
+
+          <tr>
+            <td><label for="background_vpos">{$lang_style_background_vpos}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
+                <td>&nbsp;<select id="background_vpos_measurement" name="background_vpos_measurement"></select>
+              </tr></table>
+            </td>
+          </tr>
+        </table>
+      </div>
+
+      <div id="block_panel" class="panel">
+        <table border="0">
+          <tr>
+            <td><label for="block_wordspacing">{$lang_style_block_wordspacing}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
+                <td>&nbsp;<select id="block_wordspacing_measurement" name="block_wordspacing_measurement"></select>
+              </tr></table>
+            </td>
+          </tr>
+
+          <tr>
+            <td><label for="block_letterspacing">{$lang_style_block_letterspacing}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
+                <td>&nbsp;<select id="block_letterspacing_measurement" name="block_letterspacing_measurement"></select>
+              </tr></table>
+            </td>
+          </tr>
+
+          <tr>
+            <td><label for="block_vertical_alignment">{$lang_style_block_vertical_alignment}</label></td>
+            <td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>  
+          </tr>
+
+          <tr>
+            <td><label for="block_text_align">{$lang_style_block_text_align}</label></td>
+            <td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>  
+          </tr>
+
+          <tr>
+            <td><label for="block_text_indent">{$lang_style_block_text_indent}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
+                <td>&nbsp;<select id="block_text_indent_measurement" name="block_text_indent_measurement"></select>
+              </tr></table>
+            </td>
+          </tr>
+
+          <tr>
+            <td><label for="block_whitespace">{$lang_style_block_whitespace}</label></td>
+            <td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>  
+          </tr>
+
+          <tr>
+            <td><label for="block_display">{$lang_style_block_display}</label></td>
+            <td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>  
+          </tr>
+        </table>
+      </div>
+
+      <div id="box_panel" class="panel">
+        <table border="0">
+          <tr>
+            <td><label for="box_width">{$lang_style_box_width}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onchange="synch('box_width','positioning_width');" /></td>
+                <td>&nbsp;<select id="box_width_measurement" name="box_width_measurement"></select>
+              </tr></table>
+            </td>
+            <td>&nbsp;&nbsp;&nbsp;<label for="box_float">{$lang_style_box_float}</label></td>
+            <td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>              
+          </tr>
+
+          <tr>
+            <td><label for="box_height">{$lang_style_box_height}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onchange="synch('box_height','positioning_height');" /></td>
+                <td>&nbsp;<select id="box_height_measurement" name="box_height_measurement"></select>
+              </tr></table>
+            </td>
+            <td>&nbsp;&nbsp;&nbsp;<label for="box_clear">{$lang_style_box_clear}</label></td>
+            <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>              
+          </tr>         
+        </table>
+        <div style="float: left; width: 49%">
+          <fieldset>
+            <legend>{$lang_style_padding}</legend>
+
+            <table border="0">
+              <tr>
+                <td>&nbsp;</td>
+                <td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onclick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{$lang_style_same}</label></td>
+              </tr>
+              <tr>
+                <td><label for="box_padding_top">{$lang_style_top}</label></td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
+                    <td>&nbsp;<select id="box_padding_top_measurement" name="box_padding_top_measurement"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td><label for="box_padding_right">{$lang_style_right}</label></td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td><label for="box_padding_bottom">{$lang_style_bottom}</label></td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td><label for="box_padding_left">{$lang_style_left}</label></td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+            </table>
+          </fieldset>
+        </div>
+        <div style="float: right; width: 49%">
+          <fieldset>
+            <legend>{$lang_style_margin}</legend>
+
+            <table border="0">
+              <tr>
+                <td>&nbsp;</td>
+                <td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onclick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{$lang_style_same}</label></td>
+              </tr>
+              <tr>
+                <td><label for="box_margin_top">{$lang_style_top}</label></td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
+                    <td>&nbsp;<select id="box_margin_top_measurement" name="box_margin_top_measurement"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td><label for="box_margin_right">{$lang_style_right}</label></td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td><label for="box_margin_bottom">{$lang_style_bottom}</label></td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td><label for="box_margin_left">{$lang_style_left}</label></td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+            </table>
+          </fieldset>
+        </div>
+        <br style="clear: both" />
+      </div>
+
+      <div id="border_panel" class="panel">
+        <table border="0" cellspacing="0" cellp2adding="0" width="100%">
+          <tr>
+            <td class="tdelim">&nbsp;</td>
+            <td class="tdelim delim">&nbsp;</td>
+            <td class="tdelim">{$lang_style_style}</td>
+            <td class="tdelim delim">&nbsp;</td>
+            <td class="tdelim">{$lang_style_width}</td>
+            <td class="tdelim delim">&nbsp;</td>
+            <td class="tdelim">{$lang_style_color}</td>
+          </tr>
+
+          <tr>
+            <td>&nbsp;</td>
+            <td class="delim">&nbsp;</td>
+            <td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onclick="toggleSame(this,'border_style');" /> <label for="border_style_same">{$lang_style_same}</label></td>
+            <td class="delim">&nbsp;</td>
+            <td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onclick="toggleSame(this,'border_width');" /> <label for="border_width_same">{$lang_style_same}</label></td>
+            <td class="delim">&nbsp;</td>
+            <td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onclick="toggleSame(this,'border_color');" /> <label for="border_color_same">{$lang_style_same}</label></td>
+          </tr>
+
+          <tr>
+            <td>{$lang_style_top}</td>
+            <td class="delim">&nbsp;</td>
+            <td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
+            <td class="delim">&nbsp;</td>
+            <td>
+              <table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
+                <td>&nbsp;<select id="border_width_top_measurement" name="border_width_top_measurement"></select>
+              </tr></table>
+            </td>
+            <td class="delim">&nbsp;</td>
+            <td><table border="0" cellpadding="0" cellspacing="0">
+                <tr>
+                  <td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onchange="updateColor('border_color_top_pick','border_color_top');" /></td>
+                  <td id="border_color_top_pickcontainer">&nbsp;</td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+
+          <tr>
+            <td>{$lang_style_right}</td>
+            <td class="delim">&nbsp;</td>
+            <td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
+            <td class="delim">&nbsp;</td>
+            <td>
+              <table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
+                <td>&nbsp;<select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled"></select>
+              </tr></table>
+            </td>
+            <td class="delim">&nbsp;</td>
+            <td><table border="0" cellpadding="0" cellspacing="0">
+                <tr>
+                  <td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onchange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
+                  <td id="border_color_right_pickcontainer">&nbsp;</td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+
+          <tr>
+            <td>{$lang_style_bottom}</td>
+            <td class="delim">&nbsp;</td>
+            <td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
+            <td class="delim">&nbsp;</td>
+            <td>
+              <table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
+                <td>&nbsp;<select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled"></select>
+              </tr></table>
+            </td>
+            <td class="delim">&nbsp;</td>
+            <td><table border="0" cellpadding="0" cellspacing="0">
+                <tr>
+                  <td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onchange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
+                  <td id="border_color_bottom_pickcontainer">&nbsp;</td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+
+          <tr>
+            <td>{$lang_style_left}</td>
+            <td class="delim">&nbsp;</td>
+            <td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
+            <td class="delim">&nbsp;</td>
+            <td>
+              <table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
+                <td>&nbsp;<select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled"></select>
+              </tr></table>
+            </td>
+            <td class="delim">&nbsp;</td>
+            <td><table border="0" cellpadding="0" cellspacing="0">
+                <tr>
+                  <td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onchange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
+                  <td id="border_color_left_pickcontainer">&nbsp;</td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+        </table>
+      </div>
+
+      <div id="list_panel" class="panel">
+        <table border="0">
+          <tr>
+            <td><label for="list_type">{$lang_style_list_type}</label></td>
+            <td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>  
+          </tr>
+
+          <tr>
+            <td><label for="list_bullet_image">{$lang_style_bullet_image}</label></td>
+            <td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>  
+          </tr>
+
+          <tr>
+            <td><label for="list_position">{$lang_style_position}</label></td>
+            <td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>  
+          </tr>
+        </table>
+      </div>
+
+      <div id="positioning_panel" class="panel">
+        <table border="0">
+          <tr>
+            <td><label for="positioning_type">{$lang_style_positioning_type}</label></td>
+            <td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
+            <td>&nbsp;&nbsp;&nbsp;<label for="positioning_visibility">{$lang_style_visibility}</label></td>
+            <td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>              
+          </tr>
+
+          <tr>
+            <td><label for="positioning_width">{$lang_style_width}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><input type="text" id="positioning_width" name="positioning_width" onchange="synch('positioning_width','box_width');" /></td>
+                <td>&nbsp;<select id="positioning_width_measurement" name="positioning_width_measurement"></select>
+              </tr></table>
+            </td>
+            <td>&nbsp;&nbsp;&nbsp;<label for="positioning_zindex">{$lang_style_zindex}</label></td>
+            <td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>              
+          </tr>
+
+          <tr>
+            <td><label for="positioning_height">{$lang_style_height}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                <td><input type="text" id="positioning_height" name="positioning_height" onchange="synch('positioning_height','box_height');" /></td>
+                <td>&nbsp;<select id="positioning_height_measurement" name="positioning_height_measurement"></select>
+              </tr></table>
+            </td>
+            <td>&nbsp;&nbsp;&nbsp;<label for="positioning_overflow">{$lang_style_overflow}</label></td>
+            <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>              
+          </tr>         
+        </table>
+
+        <div style="float: left; width: 49%">
+          <fieldset>
+            <legend>{$lang_style_placement}</legend>
+
+            <table border="0">
+              <tr>
+                <td>&nbsp;</td>
+                <td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onclick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{$lang_style_same}</label></td>
+              </tr>
+              <tr>
+                <td>{$lang_style_top}</td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
+                    <td>&nbsp;<select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td>{$lang_style_right}</td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td>{$lang_style_bottom}</td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td>{$lang_style_left}</td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+            </table>
+          </fieldset>
+        </div>
+        <div style="float: right; width: 49%">
+          <fieldset>
+            <legend>{$lang_style_clip}</legend>
+
+            <table border="0">
+              <tr>
+                <td>&nbsp;</td>
+                <td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onclick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{$lang_style_same}</label></td>
+              </tr>
+              <tr>
+                <td>{$lang_style_top}</td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
+                    <td>&nbsp;<select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td>{$lang_style_right}</td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled" ></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td>{$lang_style_bottom}</td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+              <tr>
+                <td>{$lang_style_left}</td>
+                <td><table border="0" cellspacing="0" cellpadding="0"><tr>
+                    <td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
+                    <td>&nbsp;<select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled"></select>
+                  </tr></table>
+                </td>
+              </tr>
+            </table>
+          </fieldset>
+        </div>
+        <br style="clear: both" />
+      </div>
+    </div>
+
+    <div class="mceActionPanel">
+      <div style="float: left">
+        <div style="float: left"><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
+        <div style="float: left">&nbsp;<input type="button" id="apply" name="apply" value="Apply" onclick="applyAction();" class="updateButton" /></div>
+        <br style="clear: both" />
+      </div>
+
+      <div style="float: right">
+        <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+      </div>
+    </div>
+  </form>
+
+  <div style="display: none">
+    <div id="container"></div>
+  </div>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/style/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/cell.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/cell.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/cell.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,182 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_table_cell_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/cell.js"></script>
+  <link href="css/cell.css" rel="stylesheet" type="text/css" />
+  <base target="_self" />
+</head>
+<body id="tablecell" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+  <form onsubmit="updateAction();return false;" action="#">
+    <div class="tabs">
+      <ul>
+        <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
+        <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
+      </ul>
+    </div>
+
+    <div class="panel_wrapper">
+      <div id="general_panel" class="panel current">
+        <fieldset>
+          <legend>{$lang_table_general_props}</legend>
+
+          <table border="0" cellpadding="4" cellspacing="0">
+            <tr>
+              <td><label for="align">{$lang_table_align}</label></td>
+              <td>
+                <select id="align" name="align">
+                  <option value="">{$lang_not_set}</option>
+                  <option value="center">{$lang_table_align_middle}</option>
+                  <option value="left">{$lang_table_align_left}</option>
+                  <option value="right">{$lang_table_align_right}</option>
+                </select>
+              </td>
+    
+              <td><label for="celltype">{$lang_table_cell_type}</label></td>
+              <td>
+                <select id="celltype" name="celltype">
+                  <option value="td">{$lang_table_td}</option>
+                  <option value="th">{$lang_table_th}</option>
+                </select>
+              </td>
+            </tr>
+
+            <tr>
+              <td><label for="valign">{$lang_table_valign}</label></td>
+              <td>
+                <select id="valign" name="valign">
+                  <option value="">{$lang_not_set}</option>
+                  <option value="top">{$lang_table_align_top}</option>
+                  <option value="middle">{$lang_table_align_middle}</option>
+                  <option value="bottom">{$lang_table_align_bottom}</option>
+                </select>
+              </td>
+
+              <td><label for="scope">{$lang_table_scope}</label></td>
+              <td>
+                <select id="scope" name="scope">
+                  <option value="">{$lang_not_set}</option>
+                  <option value="col">{$lang_table_col}</option>
+                  <option value="row">{$lang_table_row}</option>
+                  <option value="rowgroup">{$lang_table_rowgroup}</option>
+                  <option value="colgroup">{$lang_table_colgroup}</option>
+                </select>
+              </td>
+
+            </tr>
+
+            <tr>
+              <td><label for="width">{$lang_table_width}</label></td>
+              <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+
+              <td><label for="height">{$lang_table_height}</label></td>
+              <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+            </tr>
+
+            <tr id="styleSelectRow">
+              <td><label for="class">{$lang_class_name}</label></td>
+              <td colspan="3">
+                <select id="class" name="class">
+                  <option value="" selected="selected">{$lang_not_set}</option>
+                </select>
+              </td>
+            </tr>
+          </table>
+        </fieldset>
+      </div>
+
+      <div id="advanced_panel" class="panel">
+        <fieldset>
+          <legend>{$lang_table_advanced_props}</legend>
+
+          <table border="0" cellpadding="0" cellspacing="4">
+            <tr>
+              <td class="column1"><label for="id">{$lang_table_id}</label></td> 
+              <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
+            </tr>
+
+            <tr>
+              <td><label for="style">{$lang_table_style}</label></td>
+              <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
+              <td>
+                <select id="dir" name="dir" style="width: 200px"> 
+                    <option value="">{$lang_not_set}</option> 
+                    <option value="ltr">{$lang_table_ltr}</option> 
+                    <option value="rtl">{$lang_table_rtl}</option> 
+                </select>
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="lang">{$lang_table_langcode}</label></td> 
+              <td>
+                <input id="lang" name="lang" type="text" value="" style="width: 200px" />
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
+              <td>
+                <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
+                    <td id="backgroundimagebrowsercontainer">&nbsp;</td>
+                  </tr>
+                </table>
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td> 
+              <td>
+                <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
+                    <td id="bordercolor_pickcontainer">&nbsp;</td>
+                  </tr>
+                </table>
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
+              <td>
+                <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+                    <td id="bgcolor_pickcontainer">&nbsp;</td>
+                  </tr>
+                </table>
+              </td> 
+            </tr>
+          </table>
+        </fieldset>
+      </div>
+    </div>
+
+    <div class="mceActionPanel">
+      <div>
+        <select id="action" name="action">
+          <option value="cell">{$lang_table_cell_cell}</option>
+          <option value="row">{$lang_table_cell_row}</option>
+          <option value="all">{$lang_table_cell_all}</option>
+        </select>
+      </div>
+
+      <div style="float: left">
+        <div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
+      </div>
+
+      <div style="float: right">
+        <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+      </div>
+    </div>
+  </form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/cell.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/cell.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/cell.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+/* CSS file for cell dialog in the table plugin */
+
+.panel_wrapper div.current {
+  height: 200px;
+}
+
+.advfield {
+  width: 200px;
+}
+
+#action {
+  margin-bottom: 3px;
+}
+
+#class {
+  width: 150px;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/row.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/row.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/row.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+/* CSS file for row dialog in the table plugin */
+
+.panel_wrapper div.current {
+  height: 200px;
+}
+
+.advfield {
+  width: 200px;
+}
+
+#action {
+  margin-bottom: 3px;
+}
+
+#rowtype,#align,#valign,#class,#height {
+  width: 150px;
+}
+
+#height {
+  width: 50px;  
+}
+
+.col2 {
+  padding-left: 20px;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/table.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/table.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/css/table.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+/* CSS file for table dialog in the table plugin */
+
+.panel_wrapper div.current {
+  height: 220px;
+}
+
+.advfield {
+  width: 200px;
+}
+
+#class {
+  width: 150px;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/editor_plugin.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/editor_plugin.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/editor_plugin.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('table','en,tr,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_TablePlugin={getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_TablePlugin._mouseDownHandler);}inst.tableRowClipboard=null;},getControlHTML:function(control_name){var controls=new Array(['table','table.gif','lang_table_desc','mceInsertTable',true],['delete_col','table_delete_col.gif','lang_table_delete_col_desc','mceTableDeleteCol'],['delete_row','table_delete_row.gif','lang_table_delete_row_desc','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','lang_table_col_after_desc','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','lang_table_col_before_desc','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','lang_table_row_after_desc','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','lang_table_row_before_desc','mceTableInsertRowBefore'],['row_props','table_row_props.gif','lang_table_row_desc','mceTableRowProps',true],['cell_props','table_cell_props.gif','lang_table_cell_desc','mceTableCellProps',true],['split_cells','table_split_cells.gif','lang_table_split_cells_desc','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','lang_table_merge_cells_desc','mceTableMergeCells',true]);for(var i=0;i<controls.length;i++){var but=controls[i];var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\', '+(but.length>4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name)return tinyMCE.getButtonHTML(control_name,but[2],'{$pluginurl}/images/'+but[1],but[3],(but.length>4?but[4]:false));}if(control_name=="tablecontrols"){var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html;}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_TablePlugin._doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1";var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClass(editor_id+'_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_cell_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_split_cells','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonDisabled');if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClass(editor_id+'_cell_props','mceButtonSelected');tinyMCE.switchClass(editor_id+'_row_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonNormal');colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClass(editor_id+'_split_cells','mceButtonNormal');}if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClass(editor_id+'_row_props','mceButtonSelected');if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClass(editor_id+'_table','mceButtonSelected');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonNormal');}},_mouseDownHandler:function(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);},10);}},_doExecCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y};}}return null;}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null;}function getTableGrid(table){var grid=new Array();var rows=table.rows;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].cells.length;x++){var td=rows[y].cells[x];var sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(var y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=new Array();for(var x2=xstart;x2<xstart+sd['colspan'];x2++){grid[y2][x2]=td;}}}}return grid;}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table);var cpos=getCellPos(grid,td);if(new_tr.cells.length!=tr.childNodes.length){var cells=tr.childNodes;var lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true;}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true;}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node;}}return null;}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue;}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";if(tinyMCE.isMSIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=tinyMCE.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break;}}}if(newTD==null){newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableRowProps":if(trElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/row.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_rowprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_rowprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/cell.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_cellprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_cellprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"});}return true;case"mceInsertTable":if(user_interface){var template=new Array();template['file']='../../plugins/table/table.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_table_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:value});}return true;case"mceTableDelete":var table=tinyMCE.getParentElement(inst.getFocusElement(),"table");if(table){table.parentNode.removeChild(table);inst.repaint();}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1){tableElm.parentNode.removeChild(tableElm);return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;inst.selection.selectNode(getCell(grid,cpos.rowindex,0),true,true);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML="&nbsp;";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML="&nbsp;";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm.parentNode.removeChild(tableElm);return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;inst.selection.selectNode(getCell(grid,0,cpos.cellindex),true,true);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case"mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=new Array();for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td;}}if(rowCells.length>0)rows[rows.length]=rowCells;}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD")cells[cells.length]=tdElm;}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=new Array();for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td;}}}if(rowCells.length>0)rows[rows.length]=rowCells;}var curRow=new Array();var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y;}x2=x;y2=y;grid[y][x]._selected=true;}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true;}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true;}lastRowSpan=sd['rowspan'];}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true;}lastColSpan=sd['colspan'];}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=tinyMCE.regexpReplace(html,"[ \t\r\n]","");if(chk!="<br/>"&&chk!="<br>"&&chk!="&nbsp;"&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}break;}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint();}return true;}return false;}};tinyMCE.addPlugin("table",TinyMCE_TablePlugin);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/editor_plugin_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/editor_plugin_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/editor_plugin_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1054 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.38 $
+ * $Date: 2006/02/11 18:53:51 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('table', 'en,tr,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');
+
+var TinyMCE_TablePlugin = {
+  getInfo : function() {
+    return {
+      longname : 'Tables',
+      author : 'Moxiecode Systems',
+      authorurl : 'http://tinymce.moxiecode.com',
+      infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',
+      version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+    };
+  },
+
+  initInstance : function(inst) {
+    if (tinyMCE.isGecko) {
+      var doc = inst.getDoc();
+      tinyMCE.addEvent(doc, "mouseup", TinyMCE_TablePlugin._mouseDownHandler);
+    }
+
+    inst.tableRowClipboard = null;
+  },
+
+  /**
+   * Returns the HTML contents of the table control.
+   */
+  getControlHTML : function(control_name) {
+    var controls = new Array(
+      ['table', 'table.gif', 'lang_table_desc', 'mceInsertTable', true],
+      ['delete_col', 'table_delete_col.gif', 'lang_table_delete_col_desc', 'mceTableDeleteCol'],
+      ['delete_row', 'table_delete_row.gif', 'lang_table_delete_row_desc', 'mceTableDeleteRow'],
+      ['col_after', 'table_insert_col_after.gif', 'lang_table_col_after_desc', 'mceTableInsertColAfter'],
+      ['col_before', 'table_insert_col_before.gif', 'lang_table_col_before_desc', 'mceTableInsertColBefore'],
+      ['row_after', 'table_insert_row_after.gif', 'lang_table_row_after_desc', 'mceTableInsertRowAfter'],
+      ['row_before', 'table_insert_row_before.gif', 'lang_table_row_before_desc', 'mceTableInsertRowBefore'],
+      ['row_props', 'table_row_props.gif', 'lang_table_row_desc', 'mceTableRowProps', true],
+      ['cell_props', 'table_cell_props.gif', 'lang_table_cell_desc', 'mceTableCellProps', true],
+      ['split_cells', 'table_split_cells.gif', 'lang_table_split_cells_desc', 'mceTableSplitCells', true],
+      ['merge_cells', 'table_merge_cells.gif', 'lang_table_merge_cells_desc', 'mceTableMergeCells', true]);
+
+    // Render table control
+    for (var i=0; i<controls.length; i++) {
+      var but = controls[i];
+      var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + but[3] + '\', ' + (but.length > 4 ? but[4] : false) + (but.length > 5 ? ', \'' + but[5] + '\'' : '') + ');return false;';
+
+      if (but[0] == control_name)
+        return tinyMCE.getButtonHTML(control_name, but[2], '{$pluginurl}/images/'+ but[1], but[3], (but.length > 4 ? but[4] : false));
+    }
+
+    // Special tablecontrols
+    if (control_name == "tablecontrols") {
+      var html = "";
+
+      html += tinyMCE.getControlHTML("table");
+      html += tinyMCE.getControlHTML("separator");
+      html += tinyMCE.getControlHTML("row_props");
+      html += tinyMCE.getControlHTML("cell_props");
+      html += tinyMCE.getControlHTML("separator");
+      html += tinyMCE.getControlHTML("row_before");
+      html += tinyMCE.getControlHTML("row_after");
+      html += tinyMCE.getControlHTML("delete_row");
+      html += tinyMCE.getControlHTML("separator");
+      html += tinyMCE.getControlHTML("col_before");
+      html += tinyMCE.getControlHTML("col_after");
+      html += tinyMCE.getControlHTML("delete_col");
+      html += tinyMCE.getControlHTML("separator");
+      html += tinyMCE.getControlHTML("split_cells");
+      html += tinyMCE.getControlHTML("merge_cells");
+
+      return html;
+    }
+
+    return "";
+  },
+
+  /**
+   * Executes the table commands.
+   */
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    // Is table command
+    switch (command) {
+      case "mceInsertTable":
+      case "mceTableRowProps":
+      case "mceTableCellProps":
+      case "mceTableSplitCells":
+      case "mceTableMergeCells":
+      case "mceTableInsertRowBefore":
+      case "mceTableInsertRowAfter":
+      case "mceTableDeleteRow":
+      case "mceTableInsertColBefore":
+      case "mceTableInsertColAfter":
+      case "mceTableDeleteCol":
+      case "mceTableCutRow":
+      case "mceTableCopyRow":
+      case "mceTablePasteRowBefore":
+      case "mceTablePasteRowAfter":
+      case "mceTableDelete":
+        var inst = tinyMCE.getInstanceById(editor_id);
+
+        inst.execCommand('mceBeginUndoLevel');
+        TinyMCE_TablePlugin._doExecCommand(editor_id, element, command, user_interface, value);
+        inst.execCommand('mceEndUndoLevel');
+
+        return true;
+    }
+
+    // Pass to next handler in chain
+    return false;
+  },
+
+  handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+    var colspan = "1", rowspan = "1";
+
+    var inst = tinyMCE.getInstanceById(editor_id);
+
+    // Reset table controls
+    tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonDisabled');
+
+    // Within a td element
+    if (tdElm = tinyMCE.getParentElement(node, "td,th")) {
+      tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected');
+      tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal');
+      tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal');
+      tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal');
+      tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonNormal');
+      tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonNormal');
+      tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonNormal');
+
+      colspan = tinyMCE.getAttrib(tdElm, "colspan");
+      rowspan = tinyMCE.getAttrib(tdElm, "rowspan");
+
+      colspan = colspan == "" ? "1" : colspan;
+      rowspan = rowspan == "" ? "1" : rowspan;
+
+      if (colspan != "1" || rowspan != "1")
+        tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonNormal');
+    }
+
+    // Within a tr element
+    if (tinyMCE.getParentElement(node, "tr"))
+      tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonSelected');
+
+    // Within table
+    if (tinyMCE.getParentElement(node, "table")) {
+      tinyMCE.switchClass(editor_id + '_table', 'mceButtonSelected');
+      tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonNormal');
+    }
+  },
+
+  // Private plugin internal methods
+
+  _mouseDownHandler : function(e) {
+    var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
+    var focusElm = tinyMCE.selectedInstance.getFocusElement();
+
+    // If press on special Mozilla create TD/TR thingie
+    if (elm.nodeName == "BODY" && (focusElm.nodeName == "TD" || focusElm.nodeName == "TH" || (focusElm.parentNode && focusElm.parentNode.nodeName == "TD") ||(focusElm.parentNode && focusElm.parentNode.nodeName == "TH") )) {
+      window.setTimeout(function() {
+        var tableElm = tinyMCE.getParentElement(focusElm, "table");
+        tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
+      }, 10);
+    }
+  },
+
+  /**
+   * Executes the table commands.
+   */
+  _doExecCommand : function(editor_id, element, command, user_interface, value) {
+    var inst = tinyMCE.getInstanceById(editor_id);
+    var focusElm = inst.getFocusElement();
+    var trElm = tinyMCE.getParentElement(focusElm, "tr");
+    var tdElm = tinyMCE.getParentElement(focusElm, "td,th");
+    var tableElm = tinyMCE.getParentElement(focusElm, "table");
+    var doc = inst.contentWindow.document;
+    var tableBorder = tableElm ? tableElm.getAttribute("border") : "";
+
+    // Get first TD if no TD found
+    if (trElm && tdElm == null)
+      tdElm = trElm.cells[0];
+
+    // ------- Inner functions ---------
+    function inArray(ar, v) {
+      for (var i=0; i<ar.length; i++) {
+        // Is array
+        if (ar[i].length > 0 && inArray(ar[i], v))
+          return true;
+
+        // Found value
+        if (ar[i] == v)
+          return true;
+      }
+
+      return false;
+    }
+
+    function makeTD() {
+      var newTD = doc.createElement("td");
+      newTD.innerHTML = "&nbsp;";
+    }
+
+    function getColRowSpan(td) {
+      var colspan = tinyMCE.getAttrib(td, "colspan");
+      var rowspan = tinyMCE.getAttrib(td, "rowspan");
+
+      colspan = colspan == "" ? 1 : parseInt(colspan);
+      rowspan = rowspan == "" ? 1 : parseInt(rowspan);
+
+      return {colspan : colspan, rowspan : rowspan};
+    }
+
+    function getCellPos(grid, td) {
+      for (var y=0; y<grid.length; y++) {
+        for (var x=0; x<grid[y].length; x++) {
+          if (grid[y][x] == td)
+            return {cellindex : x, rowindex : y};
+        }
+      }
+
+      return null;
+    }
+
+    function getCell(grid, row, col) {
+      if (grid[row] && grid[row][col])
+        return grid[row][col];
+
+      return null;
+    }
+
+    function getTableGrid(table) {
+      var grid = new Array();
+      var rows = table.rows;
+
+      for (var y=0; y<rows.length; y++) {
+        for (var x=0; x<rows[y].cells.length; x++) {
+          var td = rows[y].cells[x];
+          var sd = getColRowSpan(td);
+
+          // All ready filled
+          for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ;
+
+          // Fill box
+          for (var y2=y; y2<y+sd['rowspan']; y2++) {
+            if (!grid[y2])
+              grid[y2] = new Array();
+
+            for (var x2=xstart; x2<xstart+sd['colspan']; x2++) {
+              grid[y2][x2] = td;
+            }
+          }
+        }
+      }
+
+      return grid;
+    }
+
+    function trimRow(table, tr, td, new_tr) {
+      var grid = getTableGrid(table);
+      var cpos = getCellPos(grid, td);
+
+      // Time to crop away some
+      if (new_tr.cells.length != tr.childNodes.length) {
+        var cells = tr.childNodes;
+        var lastElm = null;
+
+        for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) {
+          var remove = true;
+          var sd = getColRowSpan(td);
+
+          // Remove due to rowspan
+          if (inArray(cells, td)) {
+            new_tr.childNodes[x]._delete = true;
+          } else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan
+            for (var i=x; i<x+td.colSpan; i++)
+              new_tr.childNodes[i]._delete = true;
+          }
+
+          if ((lastElm == null || td != lastElm) && sd.rowspan > 1)
+            td.rowSpan = sd.rowspan + 1;
+
+          lastElm = td;
+        }
+
+        deleteMarked(tableElm);
+      }
+    }
+
+    function prevElm(node, name) {
+      while ((node = node.previousSibling) != null) {
+        if (node.nodeName == name)
+          return node;
+      }
+
+      return null;
+    }
+
+    function nextElm(node, names) {
+      var namesAr = names.split(',');
+
+      while ((node = node.nextSibling) != null) {
+        for (var i=0; i<namesAr.length; i++) {
+          if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() )
+            return node;
+        }
+      }
+
+      return null;
+    }
+
+    function deleteMarked(tbl) {
+      if (tbl.rows == 0)
+        return;
+
+      var tr = tbl.rows[0];
+      do {
+        var next = nextElm(tr, "TR");
+
+        // Delete row
+        if (tr._delete) {
+          tr.parentNode.removeChild(tr);
+          continue;
+        }
+
+        // Delete cells
+        var td = tr.cells[0];
+        if (td.cells > 1) {
+          do {
+            var nexttd = nextElm(td, "TD,TH");
+
+            if (td._delete)
+              td.parentNode.removeChild(td);
+          } while ((td = nexttd) != null);
+        }
+      } while ((tr = next) != null);
+    }
+
+    function addRows(td_elm, tr_elm, rowspan) {
+      // Add rows
+      td_elm.rowSpan = 1;
+      var trNext = nextElm(tr_elm, "TR");
+      for (var i=1; i<rowspan && trNext; i++) {
+        var newTD = doc.createElement("td");
+        newTD.innerHTML = "&nbsp;";
+
+        if (tinyMCE.isMSIE)
+          trNext.insertBefore(newTD, trNext.cells(td_elm.cellIndex));
+        else
+          trNext.insertBefore(newTD, trNext.cells[td_elm.cellIndex]);
+
+        trNext = nextElm(trNext, "TR");
+      }
+    }
+
+    function copyRow(doc, table, tr) {
+      var grid = getTableGrid(table);
+      var newTR = tr.cloneNode(false);
+      var cpos = getCellPos(grid, tr.cells[0]);
+      var lastCell = null;
+      var tableBorder = tinyMCE.getAttrib(table, "border");
+      var tdElm = null;
+
+      for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+        var newTD = null;
+
+        if (lastCell != tdElm) {
+          for (var i=0; i<tr.cells.length; i++) {
+            if (tdElm == tr.cells[i]) {
+              newTD = tdElm.cloneNode(true);
+              break;
+            }
+          }
+        }
+
+        if (newTD == null) {
+          newTD = doc.createElement("td");
+          newTD.innerHTML = "&nbsp;";
+        }
+
+        // Reset col/row span
+        newTD.colSpan = 1;
+        newTD.rowSpan = 1;
+
+        newTR.appendChild(newTD);
+
+        lastCell = tdElm;
+      }
+
+      return newTR;
+    }
+
+    // ---- Commands -----
+
+    // Handle commands
+    switch (command) {
+      case "mceTableRowProps":
+        if (trElm == null)
+          return true;
+
+        if (user_interface) {
+          // Setup template
+          var template = new Array();
+
+          template['file'] = '../../plugins/table/row.htm';
+          template['width'] = 380;
+          template['height'] = 295;
+
+          // Language specific width and height addons
+          template['width'] += tinyMCE.getLang('lang_table_rowprops_delta_width', 0);
+          template['height'] += tinyMCE.getLang('lang_table_rowprops_delta_height', 0);
+
+          // Open window
+          tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
+        }
+
+        return true;
+
+      case "mceTableCellProps":
+        if (tdElm == null)
+          return true;
+
+        if (user_interface) {
+          // Setup template
+          var template = new Array();
+
+          template['file'] = '../../plugins/table/cell.htm';
+          template['width'] = 380;
+          template['height'] = 295;
+
+          // Language specific width and height addons
+          template['width'] += tinyMCE.getLang('lang_table_cellprops_delta_width', 0);
+          template['height'] += tinyMCE.getLang('lang_table_cellprops_delta_height', 0);
+
+          // Open window
+          tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
+        }
+
+        return true;
+
+      case "mceInsertTable":
+        if (user_interface) {
+          // Setup template
+          var template = new Array();
+
+          template['file'] = '../../plugins/table/table.htm';
+          template['width'] = 380;
+          template['height'] = 295;
+
+          // Language specific width and height addons
+          template['width'] += tinyMCE.getLang('lang_table_table_delta_width', 0);
+          template['height'] += tinyMCE.getLang('lang_table_table_delta_height', 0);
+
+          // Open window
+          tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : value});
+        }
+
+        return true;
+
+      case "mceTableDelete":
+        var table = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+        if (table) {
+          table.parentNode.removeChild(table);
+          inst.repaint();
+        }
+        return true;
+
+      case "mceTableSplitCells":
+      case "mceTableMergeCells":
+      case "mceTableInsertRowBefore":
+      case "mceTableInsertRowAfter":
+      case "mceTableDeleteRow":
+      case "mceTableInsertColBefore":
+      case "mceTableInsertColAfter":
+      case "mceTableDeleteCol":
+      case "mceTableCutRow":
+      case "mceTableCopyRow":
+      case "mceTablePasteRowBefore":
+      case "mceTablePasteRowAfter":
+        // No table just return (invalid command)
+        if (!tableElm)
+          return true;
+
+        // Table has a tbody use that reference
+        // Changed logic by ApTest 2005.07.12 (www.aptest.com)
+        // Now lookk at the focused element and take its parentNode.  That will be a tbody or a table.
+        if (tableElm != trElm.parentNode)
+          tableElm = trElm.parentNode;
+
+        if (tableElm && trElm) {
+          switch (command) {
+            case "mceTableInsertRowBefore":
+              if (!trElm || !tdElm)
+                return true;
+
+              var grid = getTableGrid(tableElm);
+              var cpos = getCellPos(grid, tdElm);
+              var newTR = doc.createElement("tr");
+              var lastTDElm = null;
+
+              cpos.rowindex--;
+              if (cpos.rowindex < 0)
+                cpos.rowindex = 0;
+
+              // Create cells
+              for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+                if (tdElm != lastTDElm) {
+                  var sd = getColRowSpan(tdElm);
+
+                  if (sd['rowspan'] == 1) {
+                    var newTD = doc.createElement("td");
+
+                    newTD.innerHTML = "&nbsp;";
+                    newTD.colSpan = tdElm.colSpan;
+
+                    newTR.appendChild(newTD);
+                  } else
+                    tdElm.rowSpan = sd['rowspan'] + 1;
+
+                  lastTDElm = tdElm;
+                }
+              }
+
+              trElm.parentNode.insertBefore(newTR, trElm);
+            break;
+
+            case "mceTableCutRow":
+              if (!trElm || !tdElm)
+                return true;
+
+              inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
+              inst.execCommand("mceTableDeleteRow");
+              break;
+
+            case "mceTableCopyRow":
+              if (!trElm || !tdElm)
+                return true;
+
+              inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
+              break;
+
+            case "mceTablePasteRowBefore":
+              if (!trElm || !tdElm)
+                return true;
+
+              var newTR = inst.tableRowClipboard.cloneNode(true);
+
+              var prevTR = prevElm(trElm, "TR");
+              if (prevTR != null)
+                trimRow(tableElm, prevTR, prevTR.cells[0], newTR);
+
+              trElm.parentNode.insertBefore(newTR, trElm);
+              break;
+
+            case "mceTablePasteRowAfter":
+              if (!trElm || !tdElm)
+                return true;
+              
+              var nextTR = nextElm(trElm, "TR");
+              var newTR = inst.tableRowClipboard.cloneNode(true);
+
+              trimRow(tableElm, trElm, tdElm, newTR);
+
+              if (nextTR == null)
+                trElm.parentNode.appendChild(newTR);
+              else
+                nextTR.parentNode.insertBefore(newTR, nextTR);
+
+              break;
+
+            case "mceTableInsertRowAfter":
+              if (!trElm || !tdElm)
+                return true;
+
+              var grid = getTableGrid(tableElm);
+              var cpos = getCellPos(grid, tdElm);
+              var newTR = doc.createElement("tr");
+              var lastTDElm = null;
+
+              // Create cells
+              for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+                if (tdElm != lastTDElm) {
+                  var sd = getColRowSpan(tdElm);
+
+                  if (sd['rowspan'] == 1) {
+                    var newTD = doc.createElement("td");
+
+                    newTD.innerHTML = "&nbsp;";
+                    newTD.colSpan = tdElm.colSpan;
+
+                    newTR.appendChild(newTD);
+                  } else
+                    tdElm.rowSpan = sd['rowspan'] + 1;
+
+                  lastTDElm = tdElm;
+                }
+              }
+
+              if (newTR.hasChildNodes()) {
+                var nextTR = nextElm(trElm, "TR");
+                if (nextTR)
+                  nextTR.parentNode.insertBefore(newTR, nextTR);
+                else
+                  tableElm.appendChild(newTR);
+              }
+            break;
+
+            case "mceTableDeleteRow":
+              if (!trElm || !tdElm)
+                return true;
+    
+              var grid = getTableGrid(tableElm);
+              var cpos = getCellPos(grid, tdElm);
+
+              // Only one row, remove whole table
+              if (grid.length == 1) {
+                tableElm.parentNode.removeChild(tableElm);
+                return true;
+              }
+
+              // Move down row spanned cells
+              var cells = trElm.cells;
+              var nextTR = nextElm(trElm, "TR");
+              for (var x=0; x<cells.length; x++) {
+                if (cells[x].rowSpan > 1) {
+                  var newTD = cells[x].cloneNode(true);
+                  var sd = getColRowSpan(cells[x]);
+
+                  newTD.rowSpan = sd.rowspan - 1;
+
+                  var nextTD = nextTR.cells[x];
+
+                  if (nextTD == null)
+                    nextTR.appendChild(newTD);
+                  else
+                    nextTR.insertBefore(newTD, nextTD);
+                }
+              }
+
+              // Delete cells
+              var lastTDElm = null;
+              for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+                if (tdElm != lastTDElm) {
+                  var sd = getColRowSpan(tdElm);
+
+                  if (sd.rowspan > 1) {
+                    tdElm.rowSpan = sd.rowspan - 1;
+                  } else {
+                    trElm = tdElm.parentNode;
+
+                    if (trElm.parentNode)
+                      trElm._delete = true;
+                  }
+
+                  lastTDElm = tdElm;
+                }
+              }
+
+              deleteMarked(tableElm);
+
+              cpos.rowindex--;
+              if (cpos.rowindex < 0)
+                cpos.rowindex = 0;
+
+              inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), true, true);
+            break;
+
+            case "mceTableInsertColBefore":
+              if (!trElm || !tdElm)
+                return true;
+
+              var grid = getTableGrid(tableElm);
+              var cpos = getCellPos(grid, tdElm);
+              var lastTDElm = null;
+
+              for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+                if (tdElm != lastTDElm) {
+                  var sd = getColRowSpan(tdElm);
+
+                  if (sd['colspan'] == 1) {
+                    var newTD = doc.createElement(tdElm.nodeName);
+
+                    newTD.innerHTML = "&nbsp;";
+                    newTD.rowSpan = tdElm.rowSpan;
+
+                    tdElm.parentNode.insertBefore(newTD, tdElm);
+                  } else
+                    tdElm.colSpan++;
+
+                  lastTDElm = tdElm;
+                }
+              }
+            break;
+
+            case "mceTableInsertColAfter":
+              if (!trElm || !tdElm)
+                return true;
+
+              var grid = getTableGrid(tableElm);
+              var cpos = getCellPos(grid, tdElm);
+              var lastTDElm = null;
+
+              for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+                if (tdElm != lastTDElm) {
+                  var sd = getColRowSpan(tdElm);
+
+                  if (sd['colspan'] == 1) {
+                    var newTD = doc.createElement(tdElm.nodeName);
+
+                    newTD.innerHTML = "&nbsp;";
+                    newTD.rowSpan = tdElm.rowSpan;
+
+                    var nextTD = nextElm(tdElm, "TD,TH");
+                    if (nextTD == null)
+                      tdElm.parentNode.appendChild(newTD);
+                    else
+                      nextTD.parentNode.insertBefore(newTD, nextTD);
+                  } else
+                    tdElm.colSpan++;
+
+                  lastTDElm = tdElm;
+                }
+              }
+            break;
+
+            case "mceTableDeleteCol":
+              if (!trElm || !tdElm)
+                return true;
+
+              var grid = getTableGrid(tableElm);
+              var cpos = getCellPos(grid, tdElm);
+              var lastTDElm = null;
+
+              // Only one col, remove whole table
+              if (grid.length > 1 && grid[0].length <= 1) {
+                tableElm.parentNode.removeChild(tableElm);
+                return true;
+              }
+
+              // Delete cells
+              for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+                if (tdElm != lastTDElm) {
+                  var sd = getColRowSpan(tdElm);
+
+                  if (sd['colspan'] > 1)
+                    tdElm.colSpan = sd['colspan'] - 1;
+                  else {
+                    if (tdElm.parentNode)
+                      tdElm.parentNode.removeChild(tdElm);
+                  }
+
+                  lastTDElm = tdElm;
+                }
+              }
+
+              cpos.cellindex--;
+              if (cpos.cellindex < 0)
+                cpos.cellindex = 0;
+
+              inst.selection.selectNode(getCell(grid, 0, cpos.cellindex), true, true);
+            break;
+
+          case "mceTableSplitCells":
+            if (!trElm || !tdElm)
+              return true;
+
+            var spandata = getColRowSpan(tdElm);
+
+            var colspan = spandata["colspan"];
+            var rowspan = spandata["rowspan"];
+
+            // Needs splitting
+            if (colspan > 1 || rowspan > 1) {
+              // Generate cols
+              tdElm.colSpan = 1;
+              for (var i=1; i<colspan; i++) {
+                var newTD = doc.createElement("td");
+
+                newTD.innerHTML = "&nbsp;";
+
+                trElm.insertBefore(newTD, nextElm(tdElm, "TD,TH"));
+
+                if (rowspan > 1)
+                  addRows(newTD, trElm, rowspan);
+              }
+
+              addRows(tdElm, trElm, rowspan);
+            }
+
+            // Apply visual aids
+            tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+            break;
+
+          case "mceTableMergeCells":
+            var rows = new Array();
+            var sel = inst.getSel();
+            var grid = getTableGrid(tableElm);
+
+            if (tinyMCE.isMSIE || sel.rangeCount == 1) {
+              if (user_interface) {
+                // Setup template
+                var template = new Array();
+                var sp = getColRowSpan(tdElm);
+
+                template['file'] = '../../plugins/table/merge_cells.htm';
+                template['width'] = 250;
+                template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0);
+
+                // Language specific width and height addons
+                template['width'] += tinyMCE.getLang('lang_table_merge_cells_delta_width', 0);
+                template['height'] += tinyMCE.getLang('lang_table_merge_cells_delta_height', 0);
+
+                // Open window
+                tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : "update", numcols : sp.colspan, numrows : sp.rowspan});
+
+                return true;
+              } else {
+                var numRows = parseInt(value['numrows']);
+                var numCols = parseInt(value['numcols']);
+                var cpos = getCellPos(grid, tdElm);
+
+                if (("" + numRows) == "NaN")
+                  numRows = 1;
+
+                if (("" + numCols) == "NaN")
+                  numCols = 1;
+
+                // Get rows and cells
+                var tRows = tableElm.rows;
+                for (var y=cpos.rowindex; y<grid.length; y++) {
+                  var rowCells = new Array();
+
+                  for (var x=cpos.cellindex; x<grid[y].length; x++) {
+                    var td = getCell(grid, y, x);
+
+                    if (td && !inArray(rows, td) && !inArray(rowCells, td)) {
+                      var cp = getCellPos(grid, td);
+
+                      // Within range
+                      if (cp.cellindex < cpos.cellindex+numCols && cp.rowindex < cpos.rowindex+numRows)
+                        rowCells[rowCells.length] = td;
+                    }
+                  }
+
+                  if (rowCells.length > 0)
+                    rows[rows.length] = rowCells;
+                }
+
+                //return true;
+              }
+            } else {
+              var cells = new Array();
+              var sel = inst.getSel();
+              var lastTR = null;
+              var curRow = null;
+              var x1 = -1, y1 = -1, x2, y2;
+
+              // Only one cell selected, whats the point?
+              if (sel.rangeCount < 2)
+                return true;
+
+              // Get all selected cells
+              for (var i=0; i<sel.rangeCount; i++) {
+                var rng = sel.getRangeAt(i);
+                var tdElm = rng.startContainer.childNodes[rng.startOffset];
+
+                if (!tdElm)
+                  break;
+
+                if (tdElm.nodeName == "TD")
+                  cells[cells.length] = tdElm;
+              }
+
+              // Get rows and cells
+              var tRows = tableElm.rows;
+              for (var y=0; y<tRows.length; y++) {
+                var rowCells = new Array();
+
+                for (var x=0; x<tRows[y].cells.length; x++) {
+                  var td = tRows[y].cells[x];
+
+                  for (var i=0; i<cells.length; i++) {
+                    if (td == cells[i]) {
+                      rowCells[rowCells.length] = td;
+                    }
+                  }
+                }
+
+                if (rowCells.length > 0)
+                  rows[rows.length] = rowCells;
+              }
+
+              // Find selected cells in grid and box
+              var curRow = new Array();
+              var lastTR = null;
+              for (var y=0; y<grid.length; y++) {
+                for (var x=0; x<grid[y].length; x++) {
+                  grid[y][x]._selected = false;
+
+                  for (var i=0; i<cells.length; i++) {
+                    if (grid[y][x] == cells[i]) {
+                      // Get start pos
+                      if (x1 == -1) {
+                        x1 = x;
+                        y1 = y;
+                      }
+
+                      // Get end pos
+                      x2 = x;
+                      y2 = y;
+
+                      grid[y][x]._selected = true;
+                    }
+                  }
+                }
+              }
+
+              // Is there gaps, if so deny
+              for (var y=y1; y<=y2; y++) {
+                for (var x=x1; x<=x2; x++) {
+                  if (!grid[y][x]._selected) {
+                    alert("Invalid selection for merge.");
+                    return true;
+                  }
+                }
+              }
+            }
+
+            // Validate selection and get total rowspan and colspan
+            var rowSpan = 1, colSpan = 1;
+
+            // Validate horizontal and get total colspan
+            var lastRowSpan = -1;
+            for (var y=0; y<rows.length; y++) {
+              var rowColSpan = 0;
+
+              for (var x=0; x<rows[y].length; x++) {
+                var sd = getColRowSpan(rows[y][x]);
+
+                rowColSpan += sd['colspan'];
+
+                if (lastRowSpan != -1 && sd['rowspan'] != lastRowSpan) {
+                  alert("Invalid selection for merge.");
+                  return true;
+                }
+
+                lastRowSpan = sd['rowspan'];
+              }
+
+              if (rowColSpan > colSpan)
+                colSpan = rowColSpan;
+
+              lastRowSpan = -1;
+            }
+
+            // Validate vertical and get total rowspan
+            var lastColSpan = -1;
+            for (var x=0; x<rows[0].length; x++) {
+              var colRowSpan = 0;
+
+              for (var y=0; y<rows.length; y++) {
+                var sd = getColRowSpan(rows[y][x]);
+
+                colRowSpan += sd['rowspan'];
+
+                if (lastColSpan != -1 && sd['colspan'] != lastColSpan) {
+                  alert("Invalid selection for merge.");
+                  return true;
+                }
+
+                lastColSpan = sd['colspan'];
+              }
+
+              if (colRowSpan > rowSpan)
+                rowSpan = colRowSpan;
+
+              lastColSpan = -1;
+            }
+
+            // Setup td
+            tdElm = rows[0][0];
+            tdElm.rowSpan = rowSpan;
+            tdElm.colSpan = colSpan;
+
+            // Merge cells
+            for (var y=0; y<rows.length; y++) {
+              for (var x=0; x<rows[y].length; x++) {
+                var html = rows[y][x].innerHTML;
+                var chk = tinyMCE.regexpReplace(html, "[ \t\r\n]", "");
+
+                if (chk != "<br/>" && chk != "<br>" && chk != "&nbsp;" && (x+y > 0))
+                  tdElm.innerHTML += html;
+
+                // Not current cell
+                if (rows[y][x] != tdElm && !rows[y][x]._deleted) {
+                  var cpos = getCellPos(grid, rows[y][x]);
+                  var tr = rows[y][x].parentNode;
+
+                  tr.removeChild(rows[y][x]);
+                  rows[y][x]._deleted = true;
+
+                  // Empty TR, remove it
+                  if (!tr.hasChildNodes()) {
+                    tr.parentNode.removeChild(tr);
+
+                    var lastCell = null;
+                    for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) {
+                      if (cellElm != lastCell && cellElm.rowSpan > 1)
+                        cellElm.rowSpan--;
+
+                      lastCell = cellElm;
+                    }
+
+                    if (tdElm.rowSpan > 1)
+                      tdElm.rowSpan--;
+                  }
+                }
+              }
+            }
+
+            break;
+          }
+
+          tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+          tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
+          tinyMCE.triggerNodeChange();
+          inst.repaint();
+        }
+
+      return true;
+    }
+
+    // Pass to next handler in chain
+    return false;
+  }
+};
+
+tinyMCE.addPlugin("table", TinyMCE_TablePlugin);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/buttons.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/buttons.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_cell_props.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_cell_props.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_delete_col.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_delete_col.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_delete_row.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_delete_row.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_col_after.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_col_after.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_col_before.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_col_before.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_row_after.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_row_after.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_row_before.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_insert_row_before.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_merge_cells.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_merge_cells.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_row_props.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_row_props.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_split_cells.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/images/table_split_cells.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/cell.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/cell.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/cell.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,249 @@
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+  document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
+  document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
+
+  var inst = tinyMCE.selectedInstance;
+  var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(tinyMCE.getAttrib(tdElm, "style"));
+
+  // Get table cell data
+  var celltype = tdElm.nodeName.toLowerCase();
+  var align = tinyMCE.getAttrib(tdElm, 'align');
+  var valign = tinyMCE.getAttrib(tdElm, 'valign');
+  var width = trimSize(getStyle(tdElm, 'width', 'width'));
+  var height = trimSize(getStyle(tdElm, 'height', 'height'));
+  var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
+  var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
+  var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tdElm, 'class'), false);
+  var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
+  var id = tinyMCE.getAttrib(tdElm, 'id');
+  var lang = tinyMCE.getAttrib(tdElm, 'lang');
+  var dir = tinyMCE.getAttrib(tdElm, 'dir');
+  var scope = tinyMCE.getAttrib(tdElm, 'scope');
+
+  // Setup form
+  addClassesToList('class', 'table_cell_styles');
+  formObj.bordercolor.value = bordercolor;
+  formObj.bgcolor.value = bgcolor;
+  formObj.backgroundimage.value = backgroundimage;
+  formObj.width.value = width;
+  formObj.height.value = height;
+  formObj.id.value = id;
+  formObj.lang.value = lang;
+  formObj.style.value = tinyMCE.serializeStyle(st);
+  selectByValue(formObj, 'align', align);
+  selectByValue(formObj, 'valign', valign);
+  selectByValue(formObj, 'class', className);
+  selectByValue(formObj, 'celltype', celltype);
+  selectByValue(formObj, 'dir', dir);
+  selectByValue(formObj, 'scope', scope);
+
+  // Resize some elements
+  if (isVisible('backgroundimagebrowser'))
+    document.getElementById('backgroundimage').style.width = '180px';
+
+  updateColor('bordercolor_pick', 'bordercolor');
+  updateColor('bgcolor_pick', 'bgcolor');
+}
+
+function updateAction() {
+  tinyMCEPopup.restoreSelection();
+
+  var inst = tinyMCE.selectedInstance;
+  var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
+  var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
+  var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+  var formObj = document.forms[0];
+
+  inst.execCommand('mceBeginUndoLevel');
+
+  switch (getSelectValue(formObj, 'action')) {
+    case "cell":
+      var celltype = getSelectValue(formObj, 'celltype');
+      var scope = getSelectValue(formObj, 'scope');
+
+      if (tinyMCE.getParam("accessibility_warnings")) {
+        if (celltype == "th" && scope == "")
+          var answer = confirm(tinyMCE.getLang('lang_table_missing_scope', '', true));
+        else
+          var answer = true;
+
+        if (!answer)
+          return;
+      }
+
+      updateCell(tdElm);
+      break;
+
+    case "row":
+      var cell = trElm.firstChild;
+
+      if (cell.nodeName != "TD" && cell.nodeName != "TH")
+        cell = nextCell(cell);
+
+      do {
+        cell = updateCell(cell, true);
+      } while ((cell = nextCell(cell)) != null);
+
+      break;
+
+    case "all":
+      var rows = tableElm.getElementsByTagName("tr");
+
+      for (var i=0; i<rows.length; i++) {
+        var cell = rows[i].firstChild;
+
+        if (cell.nodeName != "TD" && cell.nodeName != "TH")
+          cell = nextCell(cell);
+
+        do {
+          cell = updateCell(cell, true);
+        } while ((cell = nextCell(cell)) != null);
+      }
+
+      break;
+  }
+
+  tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+  tinyMCE.triggerNodeChange();
+  inst.execCommand('mceEndUndoLevel');
+  tinyMCEPopup.close();
+}
+
+function nextCell(elm) {
+  while ((elm = elm.nextSibling) != null) {
+    if (elm.nodeName == "TD" || elm.nodeName == "TH")
+      return elm;
+  }
+
+  return null;
+}
+
+function updateCell(td, skip_id) {
+  var inst = tinyMCE.selectedInstance;
+  var formObj = document.forms[0];
+  var curCellType = td.nodeName.toLowerCase();
+  var celltype = getSelectValue(formObj, 'celltype');
+  var doc = inst.getDoc();
+
+  if (!skip_id)
+    td.setAttribute('id', formObj.id.value);
+
+  td.setAttribute('align', formObj.align.value);
+  td.setAttribute('vAlign', formObj.valign.value);
+  td.setAttribute('lang', formObj.lang.value);
+  td.setAttribute('dir', getSelectValue(formObj, 'dir'));
+  td.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
+  td.setAttribute('scope', formObj.scope.value);
+  tinyMCE.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
+
+  // Clear deprecated attributes
+  tinyMCE.setAttrib(td, 'width', '');
+  tinyMCE.setAttrib(td, 'height', '');
+  tinyMCE.setAttrib(td, 'bgColor', '');
+  tinyMCE.setAttrib(td, 'borderColor', '');
+  tinyMCE.setAttrib(td, 'background', '');
+
+  // Set styles
+  td.style.width = getCSSSize(formObj.width.value);
+  td.style.height = getCSSSize(formObj.height.value);
+  if (formObj.bordercolor.value != "") {
+    td.style.borderColor = formObj.bordercolor.value;
+    td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
+    td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
+  } else
+    td.style.borderColor = '';
+
+  td.style.backgroundColor = formObj.bgcolor.value;
+
+  if (formObj.backgroundimage.value != "")
+    td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
+  else
+    td.style.backgroundImage = '';
+
+  if (curCellType != celltype) {
+    // changing to a different node type
+    var newCell = doc.createElement(celltype);
+
+    for (var c=0; c<td.childNodes.length; c++)
+      newCell.appendChild(td.childNodes[c].cloneNode(1));
+
+    for (var a=0; a<td.attributes.length; a++) {
+      var attr = td.attributes[a];
+      newCell.setAttribute(attr.name, attr.value);
+    }
+
+    td.parentNode.replaceChild(newCell, td);
+    td = newCell;
+  }
+
+  return td;
+}
+
+function changedBackgroundImage() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedSize() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  var width = formObj.width.value;
+  if (width != "")
+    st['width'] = getCSSSize(width);
+  else
+    st['width'] = "";
+
+  var height = formObj.height.value;
+  if (height != "")
+    st['height'] = getCSSSize(height);
+  else
+    st['height'] = "";
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedColor() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  st['background-color'] = formObj.bgcolor.value;
+  st['border-color'] = formObj.bordercolor.value;
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedStyle() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  if (st['background-image'])
+    formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+  else
+    formObj.backgroundimage.value = '';
+
+  if (st['width'])
+    formObj.width.value = trimSize(st['width']);
+
+  if (st['height'])
+    formObj.height.value = trimSize(st['height']);
+
+  if (st['background-color']) {
+    formObj.bgcolor.value = st['background-color'];
+    updateColor('bgcolor_pick','bgcolor');
+  }
+
+  if (st['border-color']) {
+    formObj.bordercolor.value = st['border-color'];
+    updateColor('bordercolor_pick','bordercolor');
+  }
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/merge_cells.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/merge_cells.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/merge_cells.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  var formObj = document.forms[0];
+
+  formObj.numcols.value = tinyMCE.getWindowArg('numcols', 1);
+  formObj.numrows.value = tinyMCE.getWindowArg('numrows', 1);
+}
+
+function mergeCells() {
+  var args = new Array();
+  var formObj = document.forms[0];
+
+  args["numcols"] = formObj.numcols.value;
+  args["numrows"] = formObj.numrows.value;
+
+  tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
+  tinyMCEPopup.close();
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/row.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/row.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/row.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,200 @@
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+  document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+  var inst = tinyMCE.selectedInstance;
+  var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(tinyMCE.getAttrib(trElm, "style"));
+
+  // Get table row data
+  var rowtype = trElm.parentNode.nodeName.toLowerCase();
+  var align = tinyMCE.getAttrib(trElm, 'align');
+  var valign = tinyMCE.getAttrib(trElm, 'valign');
+  var height = trimSize(getStyle(trElm, 'height', 'height'));
+  var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(trElm, 'class'), false);
+  var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
+  var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
+  var id = tinyMCE.getAttrib(trElm, 'id');
+  var lang = tinyMCE.getAttrib(trElm, 'lang');
+  var dir = tinyMCE.getAttrib(trElm, 'dir');
+
+  // Setup form
+  addClassesToList('class', 'table_row_styles');
+  formObj.bgcolor.value = bgcolor;
+  formObj.backgroundimage.value = backgroundimage;
+  formObj.height.value = height;
+  formObj.id.value = id;
+  formObj.lang.value = lang;
+  formObj.style.value = tinyMCE.serializeStyle(st);
+  selectByValue(formObj, 'align', align);
+  selectByValue(formObj, 'valign', valign);
+  selectByValue(formObj, 'class', className);
+  selectByValue(formObj, 'rowtype', rowtype);
+  selectByValue(formObj, 'dir', dir);
+
+  // Resize some elements
+  if (isVisible('backgroundimagebrowser'))
+    document.getElementById('backgroundimage').style.width = '180px';
+
+  updateColor('bgcolor_pick', 'bgcolor');
+}
+
+function updateAction() {
+  tinyMCEPopup.restoreSelection();
+
+  var inst = tinyMCE.selectedInstance;
+  var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
+  var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+  var formObj = document.forms[0];
+  var action = getSelectValue(formObj, 'action');
+
+  inst.execCommand('mceBeginUndoLevel');
+
+  switch (action) {
+    case "row":
+      updateRow(trElm);
+      break;
+
+    case "all":
+      var rows = tableElm.getElementsByTagName("tr");
+
+      for (var i=0; i<rows.length; i++)
+        updateRow(rows[i], true);
+
+      break;
+
+    case "odd":
+    case "even":
+      var rows = tableElm.getElementsByTagName("tr");
+
+      for (var i=0; i<rows.length; i++) {
+        if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
+          updateRow(rows[i], true, true);
+      }
+
+      break;
+  }
+
+  tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+  tinyMCE.triggerNodeChange();
+  inst.execCommand('mceEndUndoLevel');
+  tinyMCEPopup.close();
+}
+
+function updateRow(tr_elm, skip_id, skip_parent) {
+  var inst = tinyMCE.selectedInstance;
+  var formObj = document.forms[0];
+  var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
+  var rowtype = getSelectValue(formObj, 'rowtype');
+  var doc = inst.getDoc();
+
+  // Update row element
+  if (!skip_id)
+    tr_elm.setAttribute('id', formObj.id.value);
+
+  tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
+  tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
+  tr_elm.setAttribute('lang', formObj.lang.value);
+  tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
+  tr_elm.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
+  tinyMCE.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
+
+  // Clear deprecated attributes
+  tr_elm.setAttribute('background', '');
+  tr_elm.setAttribute('bgColor', '');
+  tr_elm.setAttribute('height', '');
+
+  // Set styles
+  tr_elm.style.height = getCSSSize(formObj.height.value);
+  tr_elm.style.backgroundColor = formObj.bgcolor.value;
+
+  if (formObj.backgroundimage.value != "")
+    tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
+  else
+    tr_elm.style.backgroundImage = '';
+
+  // Setup new rowtype
+  if (curRowType != rowtype && !skip_parent) {
+    // first, clone the node we are working on
+    var newRow = tr_elm.cloneNode(1);
+
+    // next, find the parent of its new destination (creating it if necessary)
+    var theTable = tinyMCE.getParentElement(tr_elm, "table");
+    var dest = rowtype;
+    var newParent = null;
+    for (var i = 0; i < theTable.childNodes.length; i++) {
+      if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
+        newParent = theTable.childNodes[i];
+    }
+
+    if (newParent == null) {
+      newParent = doc.createElement(dest);
+
+      if (dest == "thead")
+        theTable.insertBefore(newParent, theTable.firstChild);
+      else
+        theTable.appendChild(newParent);
+    }
+
+    // append the row to the new parent
+    newParent.appendChild(newRow);
+
+    // remove the original
+    tr_elm.parentNode.removeChild(tr_elm);
+
+    // set tr_elm to the new node
+    tr_elm = newRow;
+  }
+}
+
+function changedBackgroundImage() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedStyle() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  if (st['background-image'])
+    formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+  else
+    formObj.backgroundimage.value = '';
+
+  if (st['height'])
+    formObj.height.value = trimSize(st['height']);
+
+  if (st['background-color']) {
+    formObj.bgcolor.value = st['background-color'];
+    updateColor('bgcolor_pick','bgcolor');
+  }
+}
+
+function changedSize() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  var height = formObj.height.value;
+  if (height != "")
+    st['height'] = getCSSSize(height);
+  else
+    st['height'] = "";
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedColor() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  st['background-color'] = formObj.bgcolor.value;
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/table.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/table.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/jscripts/table.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,344 @@
+var action, orgTableWidth, orgTableHeight;
+
+function insertTable() {
+  var formObj = document.forms[0];
+  var inst = tinyMCE.selectedInstance;
+  var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className;
+  var html = '';
+  var elm = tinyMCE.tableElm;
+  var cellLimit, rowLimit, colLimit;
+
+  tinyMCEPopup.restoreSelection();
+
+  // Get form data
+  cols = formObj.elements['cols'].value;
+  rows = formObj.elements['rows'].value;
+  border = formObj.elements['border'].value != "" ? formObj.elements['border'].value  : 0;
+  cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
+  cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
+  align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
+  width = formObj.elements['width'].value;
+  height = formObj.elements['height'].value;
+  bordercolor = formObj.elements['bordercolor'].value;
+  bgcolor = formObj.elements['bgcolor'].value;
+  className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
+  id = formObj.elements['id'].value;
+  summary = formObj.elements['summary'].value;
+  style = formObj.elements['style'].value;
+  dir = formObj.elements['dir'].value;
+  lang = formObj.elements['lang'].value;
+  background = formObj.elements['backgroundimage'].value;
+
+  cellLimit = tinyMCE.getParam('table_cell_limit', false);
+  rowLimit = tinyMCE.getParam('table_row_limit', false);
+  colLimit = tinyMCE.getParam('table_col_limit', false);
+
+  // Validate table size
+  if (colLimit && cols > colLimit) {
+    alert(tinyMCE.getLang('lang_table_col_limit', '', true, {cols : colLimit}));
+    return false;
+  } else if (rowLimit && rows > rowLimit) {
+    alert(tinyMCE.getLang('lang_table_row_limit', '', true, {rows : rowLimit}));
+    return false;
+  } else if (cellLimit && cols * rows > cellLimit) {
+    alert(tinyMCE.getLang('lang_table_cell_limit', '', true, {cells : cellLimit}));
+    return false;
+  }
+
+  // Update table
+  if (action == "update") {
+    inst.execCommand('mceBeginUndoLevel');
+
+    tinyMCE.setAttrib(elm, 'cellPadding', cellpadding, true);
+    tinyMCE.setAttrib(elm, 'cellSpacing', cellspacing, true);
+    tinyMCE.setAttrib(elm, 'border', border, true);
+    tinyMCE.setAttrib(elm, 'align', align);
+    tinyMCE.setAttrib(elm, 'class', className);
+    tinyMCE.setAttrib(elm, 'style', style);
+    tinyMCE.setAttrib(elm, 'id', id);
+    tinyMCE.setAttrib(elm, 'summary', summary);
+    tinyMCE.setAttrib(elm, 'dir', dir);
+    tinyMCE.setAttrib(elm, 'lang', lang);
+
+    // Not inline styles
+    if (!tinyMCE.getParam("inline_styles"))
+      tinyMCE.setAttrib(elm, 'width', width, true);
+
+    // Remove these since they are not valid XHTML
+    tinyMCE.setAttrib(elm, 'borderColor', '');
+    tinyMCE.setAttrib(elm, 'bgColor', '');
+    tinyMCE.setAttrib(elm, 'background', '');
+    tinyMCE.setAttrib(elm, 'height', '');
+
+    if (background != '')
+      elm.style.backgroundImage = "url('" + background + "')";
+    else
+      elm.style.backgroundImage = '';
+
+    if (tinyMCE.getParam("inline_styles"))
+      elm.style.borderWidth = border + "px";
+
+    if (tinyMCE.getParam("inline_styles")) {
+      if (width != '')
+        elm.style.width = getCSSSize(width);
+    }
+
+    if (bordercolor != "") {
+      elm.style.borderColor = bordercolor;
+      elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
+      elm.style.borderWidth = border == "" ? "1px" : border;
+    } else
+      elm.style.borderColor = '';
+
+    elm.style.backgroundColor = bgcolor;
+    elm.style.height = getCSSSize(height);
+
+    tinyMCE.handleVisualAid(tinyMCE.tableElm, false, inst.visualAid, inst);
+
+    // Fix for stange MSIE align bug
+    tinyMCE.tableElm.outerHTML = tinyMCE.tableElm.outerHTML;
+
+    tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+    tinyMCE.triggerNodeChange();
+    inst.execCommand('mceEndUndoLevel');
+
+    // Repaint if dimensions changed
+    if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
+      inst.repaint();
+
+    tinyMCEPopup.close();
+    return true;
+  }
+
+  // Create new table
+  html += '<table';
+
+  html += makeAttrib('id', id);
+  html += makeAttrib('border', border);
+  html += makeAttrib('cellpadding', cellpadding);
+  html += makeAttrib('cellspacing', cellspacing);
+  html += makeAttrib('width', width);
+  //html += makeAttrib('height', height);
+  //html += makeAttrib('bordercolor', bordercolor);
+  //html += makeAttrib('bgcolor', bgcolor);
+  html += makeAttrib('align', align);
+  html += makeAttrib('class', tinyMCE.getVisualAidClass(className, border == 0));
+  html += makeAttrib('style', style);
+  html += makeAttrib('summary', summary);
+  html += makeAttrib('dir', dir);
+  html += makeAttrib('lang', lang);
+
+  html += '>';
+
+  for (var y=0; y<rows; y++) {
+    html += "<tr>";
+
+    for (var x=0; x<cols; x++)
+      html += '<td>&nbsp;</td>';
+
+    html += "</tr>";
+  }
+
+  html += "</table>";
+
+  inst.execCommand('mceBeginUndoLevel');
+  inst.execCommand('mceInsertContent', false, html);
+  tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual']);
+  inst.execCommand('mceEndUndoLevel');
+
+  tinyMCEPopup.close();
+}
+
+function makeAttrib(attrib, value) {
+  var formObj = document.forms[0];
+  var valueElm = formObj.elements[attrib];
+
+  if (typeof(value) == "undefined" || value == null) {
+    value = "";
+
+    if (valueElm)
+      value = valueElm.value;
+  }
+
+  if (value == "")
+    return "";
+
+  // XML encode it
+  value = value.replace(/&/g, '&amp;');
+  value = value.replace(/\"/g, '&quot;');
+  value = value.replace(/</g, '&lt;');
+  value = value.replace(/>/g, '&gt;');
+
+  return ' ' + attrib + '="' + value + '"';
+}
+
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+  document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+  document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
+  document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+  var cols = 2, rows = 2, border = 0, cellpadding = "", cellspacing = "";
+  var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
+  var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "";
+  var inst = tinyMCE.selectedInstance;
+  var formObj = document.forms[0];
+  var elm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+
+  tinyMCE.tableElm = elm;
+  action = tinyMCE.getWindowArg('action');
+  if (action == null)
+    action = tinyMCE.tableElm ? "update" : "insert";
+
+  if (tinyMCE.tableElm && action != "insert") {
+    var rowsAr = tinyMCE.tableElm.rows;
+    var cols = 0;
+    for (var i=0; i<rowsAr.length; i++)
+      if (rowsAr[i].cells.length > cols)
+        cols = rowsAr[i].cells.length;
+
+    cols = cols;
+    rows = rowsAr.length;
+
+    st = tinyMCE.parseStyle(tinyMCE.getAttrib(tinyMCE.tableElm, "style"));
+    border = trimSize(getStyle(elm, 'border', 'borderWidth'));
+    cellpadding = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellpadding', "");
+    cellspacing = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellspacing', "");
+    width = trimSize(getStyle(elm, 'width', 'width'));
+    height = trimSize(getStyle(elm, 'height', 'height'));
+    bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
+    bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
+    align = tinyMCE.getAttrib(tinyMCE.tableElm, 'align', align);
+    className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tinyMCE.tableElm, 'class'), false);
+    id = tinyMCE.getAttrib(tinyMCE.tableElm, 'id');
+    summary = tinyMCE.getAttrib(tinyMCE.tableElm, 'summary');
+    style = tinyMCE.serializeStyle(st);
+    dir = tinyMCE.getAttrib(tinyMCE.tableElm, 'dir');
+    lang = tinyMCE.getAttrib(tinyMCE.tableElm, 'lang');
+    background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+
+    orgTableWidth = width;
+    orgTableHeight = height;
+
+    action = "update";
+  }
+
+  addClassesToList('class', "table_styles");
+
+  // Update form
+  selectByValue(formObj, 'align', align);
+  selectByValue(formObj, 'class', className);
+  formObj.cols.value = cols;
+  formObj.rows.value = rows;
+  formObj.border.value = border;
+  formObj.cellpadding.value = cellpadding;
+  formObj.cellspacing.value = cellspacing;
+  formObj.width.value = width;
+  formObj.height.value = height;
+  formObj.bordercolor.value = bordercolor;
+  formObj.bgcolor.value = bgcolor;
+  formObj.id.value = id;
+  formObj.summary.value = summary;
+  formObj.style.value = style;
+  formObj.dir.value = dir;
+  formObj.lang.value = lang;
+  formObj.backgroundimage.value = background;
+  formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); 
+
+  updateColor('bordercolor_pick', 'bordercolor');
+  updateColor('bgcolor_pick', 'bgcolor');
+
+  // Resize some elements
+  if (isVisible('backgroundimagebrowser'))
+    document.getElementById('backgroundimage').style.width = '180px';
+
+  // Disable some fields in update mode
+  if (action == "update") {
+    formObj.cols.disabled = true;
+    formObj.rows.disabled = true;
+  }
+}
+
+function changedSize() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  var width = formObj.width.value;
+  if (width != "")
+    st['width'] = tinyMCE.getParam("inline_styles") ? getCSSSize(width) : "";
+  else
+    st['width'] = "";
+
+  var height = formObj.height.value;
+  if (height != "")
+    st['height'] = getCSSSize(height);
+  else
+    st['height'] = "";
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedBackgroundImage() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedBorder() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  // Update border width if the element has a color
+  if (formObj.border.value != "" && formObj.bordercolor.value != "")
+    st['border-width'] = formObj.border.value + "px";
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedColor() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  st['background-color'] = formObj.bgcolor.value;
+
+  if (formObj.bordercolor.value != "") {
+    st['border-color'] = formObj.bordercolor.value;
+
+    // Add border-width if it's missing
+    if (!st['border-width'])
+      st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
+  }
+
+  formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedStyle() {
+  var formObj = document.forms[0];
+  var st = tinyMCE.parseStyle(formObj.style.value);
+
+  if (st['background-image'])
+    formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+  else
+    formObj.backgroundimage.value = '';
+
+  if (st['width'])
+    formObj.width.value = trimSize(st['width']);
+
+  if (st['height'])
+    formObj.height.value = trimSize(st['height']);
+
+  if (st['background-color']) {
+    formObj.bgcolor.value = st['background-color'];
+    updateColor('bgcolor_pick','bgcolor');
+  }
+
+  if (st['border-color']) {
+    formObj.bordercolor.value = st['border-color'];
+    updateColor('bordercolor_pick','bordercolor');
+  }
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+// UK lang variables
+
+tinyMCE.addToLang('table',{
+general_tab : 'General',
+advanced_tab : 'Advanced',
+general_props : 'General properties',
+advanced_props : 'Advanced properties',
+desc : 'Inserts a new table',
+row_before_desc : 'Insert row before',
+row_after_desc : 'Insert row after',
+delete_row_desc : 'Delete row',
+col_before_desc : 'Insert column before',
+col_after_desc : 'Insert column after',
+delete_col_desc : 'Remove column',
+rowtype : 'Row in table part',
+title : 'Insert/Modify table',
+width : 'Width',
+height : 'Height',
+cols : 'Columns',
+rows : 'Rows',
+cellspacing : 'Cellspacing',
+cellpadding : 'Cellpadding',
+border : 'Border',
+align : 'Alignment',
+align_default : 'Default',
+align_left : 'Left',
+align_right : 'Right',
+align_middle : 'Center',
+row_title : 'Table row properties',
+cell_title : 'Table cell properties',
+cell_type : 'Cell type',
+row_desc : 'Table row properties',
+cell_desc : 'Table cell properties',
+valign : 'Vertical alignment',
+align_top : 'Top',
+align_bottom : 'Bottom',
+props_desc : 'Table properties',
+bordercolor : 'Border color',
+bgcolor : 'Background color',
+merge_cells_title : 'Merge table cells',
+split_cells_desc : 'Split table cells',
+merge_cells_desc : 'Merge table cells',
+cut_row_desc : 'Cut table row',
+copy_row_desc : 'Copy table row',
+paste_row_before_desc : 'Paste table row before',
+paste_row_after_desc : 'Paste table row after',
+id : 'Id',
+style: 'Style',
+langdir : 'Language direction',
+langcode : 'Language code',
+mime : 'Target MIME type',
+ltr : 'Left to right',
+rtl : 'Right to left',
+bgimage : 'Background image',
+summary : 'Summary',
+td : "Data",
+th : "Header",
+cell_cell : 'Update current cell',
+cell_row : 'Update all cells in row',
+cell_all : 'Update all cells in table',
+row_row : 'Update current row',
+row_odd : 'Update odd rows in table',
+row_even : 'Update even rows in table',
+row_all : 'Update all rows in table',
+thead : 'Table Head',
+tbody : 'Table Body',
+tfoot : 'Table Foot',
+del : 'Delete table',
+scope : 'Scope',
+row : 'Row',
+col : 'Col',
+rowgroup : 'Row Group',
+colgroup : 'Col Group',
+col_limit : 'You\'ve exceeded the maximum number of columns of {$cols}.',
+row_limit : 'You\'ve exceeded the maximum number of rows of {$rows}.',
+cell_limit : 'You\'ve exceeded the maximum number of cells of {$cells}.',
+missing_scope: 'Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/merge_cells.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/merge_cells.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/merge_cells.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_table_merge_cells_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/merge_cells.js"></script>
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="margin: 8px" style="display: none">
+<form onsubmit="insertTable();return false;" action="#">
+  <fieldset>
+    <legend>{$lang_table_merge_cells_title}</legend>
+      <table border="0" cellpadding="0" cellspacing="3" width="100%">
+        <tr>
+        <td>{$lang_table_cols}:</td>
+        <td align="right"><input type="text" name="numcols" value="" style="width: 30px" /></td>
+        <td>
+        </tr>
+        <tr>
+        <td>{$lang_table_rows}:</td>
+        <td align="right"><input type="text" name="numrows" value="" style="width: 30px" /></td>
+        </tr>
+      </table>
+  </fieldset>
+
+  <div class="mceActionPanel">
+    <div style="float: left">
+      <input type="button" id="insert" name="insert" value="{$lang_update}" onclick="mergeCells();" />
+    </div>
+
+    <div style="float: right">
+      <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+    </div>
+  </div>
+</form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/readme.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Check the TinyMCE documentation for details on this plugin.

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/row.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/row.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/row.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,159 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_table_row_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/row.js"></script>
+  <link href="css/row.css" rel="stylesheet" type="text/css" />
+  <base target="_self" />
+</head>
+<body id="tablerow" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+  <form onsubmit="updateAction();return false;">
+    <div class="tabs">
+      <ul>
+        <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
+        <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
+      </ul>
+    </div>
+
+    <div class="panel_wrapper">
+      <div id="general_panel" class="panel current">
+        <fieldset>
+          <legend>{$lang_table_general_props}</legend>
+
+          <table border="0" cellpadding="4" cellspacing="0">
+            <tr>
+              <td><label for="rowtype">{$lang_table_rowtype}</label></td>
+              <td class="col2">
+                <select id="rowtype" name="rowtype">
+                  <option value="thead">{$lang_table_thead}</option>
+                  <option value="tbody">{$lang_table_tbody}</option>
+                  <option value="tfoot">{$lang_table_tfoot}</option>
+                </select>
+              </td>
+            </tr>
+
+            <tr>
+              <td><label for="align">{$lang_table_align}</label></td>
+              <td class="col2">
+                <select id="align" name="align">
+                  <option value="">{$lang_not_set}</option>
+                  <option value="center">{$lang_table_align_middle}</option>
+                  <option value="left">{$lang_table_align_left}</option>
+                  <option value="right">{$lang_table_align_right}</option>
+                </select>
+              </td>
+            </tr>
+
+            <tr>
+              <td><label for="valign">{$lang_table_valign}</label></td>
+              <td class="col2">
+                <select id="valign" name="valign">
+                  <option value="">{$lang_not_set}</option>
+                  <option value="top">{$lang_table_align_top}</option>
+                  <option value="middle">{$lang_table_align_middle}</option>
+                  <option value="bottom">{$lang_table_align_bottom}</option>
+                </select>
+              </td>
+            </tr>
+
+            <tr id="styleSelectRow">
+              <td><label for="class">{$lang_class_name}</label></td>
+              <td class="col2">
+                <select id="class" name="class">
+                  <option value="" selected="selected">{$lang_not_set}</option>
+                </select>
+              </td>
+            </tr>
+
+            <tr>
+              <td><label for="height">{$lang_table_height}</label></td>
+              <td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+            </tr>
+          </table>
+        </fieldset>
+      </div>
+
+      <div id="advanced_panel" class="panel">
+        <fieldset>
+          <legend>{$lang_table_advanced_props}</legend>
+
+          <table border="0" cellpadding="0" cellspacing="4">
+            <tr>
+              <td class="column1"><label for="id">{$lang_table_id}</label></td> 
+              <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
+            </tr>
+
+            <tr>
+              <td><label for="style">{$lang_table_style}</label></td>
+              <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
+              <td>
+                <select id="dir" name="dir" style="width: 200px"> 
+                    <option value="">{$lang_not_set}</option> 
+                    <option value="ltr">{$lang_table_ltr}</option> 
+                    <option value="rtl">{$lang_table_rtl}</option> 
+                </select>
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="lang">{$lang_table_langcode}</label></td> 
+              <td>
+                <input id="lang" name="lang" type="text" value="" style="width: 200px" />
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
+              <td>
+                <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
+                    <td id="backgroundimagebrowsercontainer">&nbsp;</td>
+                  </tr>
+                </table>
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
+              <td>
+                <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+                    <td id="bgcolor_pickcontainer">&nbsp;</td>
+                  </tr>
+                </table>
+              </td> 
+            </tr>
+          </table>
+        </fieldset>
+      </div>
+    </div>
+
+    <div class="mceActionPanel">
+      <div>
+        <select id="action" name="action">
+          <option value="row">{$lang_table_row_row}</option>
+          <option value="odd">{$lang_table_row_odd}</option>
+          <option value="even">{$lang_table_row_even}</option>
+          <option value="all">{$lang_table_row_all}</option>
+        </select>
+      </div>
+
+      <div style="float: left">
+        <div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
+      </div>
+
+      <div style="float: right">
+        <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+      </div>
+    </div>
+  </form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/table.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/table.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/plugins/table/table.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,155 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_table_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/table.js"></script>
+  <link href="css/table.css" rel="stylesheet" type="text/css" />
+  <base target="_self" />
+</head>
+<body id="table" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+  <form onsubmit="insertTable();return false;" action="#">
+    <div class="tabs">
+      <ul>
+        <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
+        <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
+      </ul>
+    </div>
+
+    <div class="panel_wrapper">
+      <div id="general_panel" class="panel current">
+        <fieldset>
+          <legend>{$lang_table_general_props}</legend>
+
+            <table border="0" cellpadding="4" cellspacing="0" width="100%">
+                <tr>
+                <td><label id="colslabel" for="cols">{$lang_table_cols}</label></td>
+                <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" /></td>
+                <td><label id="rowslabel" for="rows">{$lang_table_rows}</label></td>
+                <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" /></td>
+                </tr>
+                <tr>
+                <td><label id="cellpaddinglabel" for="cellpadding">{$lang_table_cellpadding}</label></td>
+                <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" /></td>
+                <td><label id="cellspacinglabel" for="cellspacing">{$lang_table_cellspacing}</label></td>
+                <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" /></td>
+                </tr>
+                <tr>
+                <td><label id="alignlabel" for="align">{$lang_table_align}</label></td>
+                <td><select id="align" name="align">
+                  <option value="">{$lang_not_set}</option>
+                  <option value="center">{$lang_table_align_middle}</option>
+                  <option value="left">{$lang_table_align_left}</option>
+                  <option value="right">{$lang_table_align_right}</option>
+                  </select></td>
+                <td><label id="borderlabel" for="border">{$lang_table_border}</label></td>
+                <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" /></td>
+                </tr>
+                <tr>
+                <td><label id="widthlabel" for="width">{$lang_table_width}</label></td>
+                <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+                <td><label id="heightlabel" for="height">{$lang_table_height}</label></td>
+                <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+                </tr>
+                <tr id="styleSelectRow">
+                <td><label id="classlabel" for="class">{$lang_class_name}</label></td>
+                <td colspan="3">
+                 <select id="class" name="class">
+                  <option value="" selected>{$lang_not_set}</option>
+                 </select></td>
+                </tr>
+              </table>
+        </fieldset>
+      </div>
+
+      <div id="advanced_panel" class="panel">
+        <fieldset>
+          <legend>{$lang_table_advanced_props}</legend>
+
+          <table border="0" cellpadding="0" cellspacing="4">
+            <tr>
+              <td class="column1"><label for="id">{$lang_table_id}</label></td> 
+              <td><input id="id" name="id" type="text" value="" class="advfield" /></td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="summary">{$lang_table_summary}</label></td> 
+              <td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> 
+            </tr>
+
+            <tr>
+              <td><label for="style">{$lang_table_style}</label></td>
+              <td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
+              <td>
+                <select id="dir" name="dir" class="advfield"> 
+                    <option value="">{$lang_not_set}</option> 
+                    <option value="ltr">{$lang_table_ltr}</option> 
+                    <option value="rtl">{$lang_table_rtl}</option> 
+                </select>
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label id="langlabel" for="lang">{$lang_table_langcode}</label></td> 
+              <td>
+                <input id="lang" name="lang" type="text" value="" class="advfield" />
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
+              <td>
+                <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
+                    <td id="backgroundimagebrowsercontainer">&nbsp;</td>
+                  </tr>
+                </table>
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td> 
+              <td>
+                <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
+                    <td id="bordercolor_pickcontainer">&nbsp;</td>
+                  </tr>
+                </table>
+              </td> 
+            </tr>
+
+            <tr>
+              <td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
+              <td>
+                <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+                    <td id="bgcolor_pickcontainer">&nbsp;</td>
+                  </tr>
+                </table>
+              </td> 
+            </tr>
+          </table>
+        </fieldset>
+      </div>
+    </div>
+
+    <div class="mceActionPanel">
+      <div style="float: left">
+        <input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertTable();" />
+      </div>
+
+      <div style="float: right">
+        <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+      </div>
+    </div>
+  </form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/about.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/about.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/about.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_about_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/about.js"></script>
+  <base target="_self" />
+</head>
+<body id="about" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+    <div class="tabs">
+      <ul>
+        <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_about}</a></span></li>
+        <li id="help_tab"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{$lang_help}</a></span></li>
+        <li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{$lang_plugins}</a></span></li>
+      </ul>
+    </div>
+
+    <div class="panel_wrapper">
+      <div id="general_panel" class="panel current">
+        <h3>{$lang_about_title}</h3>
+        <p>Version: {$tinymce_version} ({$tinymce_releasedate})</p>
+        <p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>
+        by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>
+        <p>Copyright &copy; 2003-2006, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>
+        <p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>
+
+        <div id="buttoncontainer"></div>
+      </div>
+
+      <div id="plugins_panel" class="panel">
+        <div id="pluginscontainer">
+          <h3>{$lang_loaded_plugins}</h3>
+
+          <div id="plugintablecontainer">
+          </div>
+
+          <p>&nbsp;</p>
+        </div>
+      </div>
+
+      <div id="help_panel" class="panel noscroll" style="overflow: visible;">
+        <div id="iframecontainer"></div>
+      </div>
+    </div>
+
+    <div class="mceActionPanel">
+      <div style="float: right">
+        <input type="button" id="cancel" name="cancel" value="{$lang_close}" onclick="tinyMCEPopup.close();" />
+      </div>
+    </div>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/anchor.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/anchor.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/anchor.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_insert_anchor_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/anchor.js"></script>
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<form onsubmit="insertAnchor();return false;" action="#">
+
+  <table border="0" cellpadding="4" cellspacing="0">
+    <tr>
+      <td colspan="2" class="title">{$lang_insert_anchor_title}</td>
+    </tr>
+    <tr>
+      <td nowrap="nowrap">{$lang_insert_anchor_name}:</td>
+      <td><input name="anchorName" type="text" id="anchorName" value="" style="width: 200px" /></td>
+    </tr>
+  </table>
+
+  <div class="mceActionPanel">
+    <div style="float: left">
+      <input type="button" id="insert" name="insert" value="{$lang_update}" onclick="insertAnchor();" />
+    </div>
+
+    <div style="float: right">
+      <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+    </div>
+  </div>
+
+</form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/charmap.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/charmap.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/charmap.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_theme_charmap_title}</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/charmap.js"></script>
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<table align="center" border="0" cellspacing="0" cellpadding="2">
+    <tr>
+        <td colspan="2" class="title">{$lang_theme_charmap_title}</td>
+    </tr>
+    <tr>
+        <td rowspan="2" align="left" valign="top">
+            <script language="javascript" type="text/javascript">renderCharMapHTML();</script>
+        </td>
+        <td width="100" align="center" valign="top">
+            <table border="0" cellpadding="0" cellspacing="0" width="100" style="height: 100px">
+                <tr>
+                    <td class="charmapOver" style="font-size: 40px; height:80px;" id="codeV">&nbsp;</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 10px; font-family: Arial, Helvetica, sans-serif; text-align:center;" id="codeN">&nbsp;</td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td valign="bottom" style="padding-bottom: 3px;">
+            <table width="100" align="center" border="0" cellpadding="2" cellspacing="0">
+                <tr>
+                    <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">HTML-Code</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center">&nbsp;</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 1px;">&nbsp;</td>
+                </tr>
+                <tr>
+                    <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">NUM-Code</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center">&nbsp;</td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+</table>
+
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/color_picker.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/color_picker.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/color_picker.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_theme_colorpicker_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/color_picker.js"></script>
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="margin: 3px; display: none">
+  <div align="center">
+     <script language="javascript" type="text/javascript">renderColorMap();</script>
+  </div>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_content.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_content.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_content.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+/* This file contains the CSS data for the editable area(iframe) of TinyMCE */
+/* You can extend this CSS by adding your own CSS file with the the content_css option */
+
+body, td, pre {
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 10px;
+}
+
+body {
+  background-color: #FFFFFF;
+}
+
+.mceVisualAid {
+  border: 1px dashed #BBBBBB !important;
+}
+
+div.mceVisualAid {
+  background-image:url('../images/spacer.gif');
+  visibility: visible !important;
+}
+
+.mceItemAnchor {
+  width: 12px;
+  line-height: 6px;
+  overflow: hidden;
+  padding-left: 12px;
+  background-image: url('../images/anchor_symbol.gif');
+  background-position: bottom;
+  background-repeat: no-repeat;
+}
+
+/* Important is needed in Gecko browsers inorder to style links */
+/*
+a {
+  color: green !important;
+}
+*/
+
+/* Style selection range colors in Gecko browsers */
+/*
+::-moz-selection {
+  background-color: red;
+  color: green;
+}
+*/
+
+/* MSIE specific */
+
+* html body {
+  scrollbar-3dlight-color: #F0F0EE;
+  scrollbar-arrow-color: #676662;
+  scrollbar-base-color: #F0F0EE;
+  scrollbar-darkshadow-color: #DDDDDD;
+  scrollbar-face-color: #E0E0DD;
+  scrollbar-highlight-color: #F0F0EE;
+  scrollbar-shadow-color: #F0F0EE;
+  scrollbar-track-color: #F5F5F5;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_popup.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_popup.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_popup.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,327 @@
+/* This file contains the CSS data for all popups in TinyMCE */
+
+body {
+  background-color: #F0F0EE;
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+  scrollbar-3dlight-color: #F0F0EE;
+  scrollbar-arrow-color: #676662;
+  scrollbar-base-color: #F0F0EE;
+  scrollbar-darkshadow-color: #DDDDDD;
+  scrollbar-face-color: #E0E0DD;
+  scrollbar-highlight-color: #F0F0EE;
+  scrollbar-shadow-color: #F0F0EE;
+  scrollbar-track-color: #F5F5F5;
+  margin: 8px;
+}
+
+td {
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 11px;
+}
+
+input {
+  background: #FFFFFF;
+  border: 1px solid #cccccc;
+}
+
+td, input, select, textarea {
+  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-size: 10px;
+}
+
+input, select, textarea {
+  border: 1px solid #808080;
+}
+
+.input_noborder {
+  border: 0;
+}
+
+#insert, .updateButton {
+   font-weight: bold;
+   width: 90px;
+   height: 21px;
+   border: 0;
+   background-image: url('../images/insert_button_bg.gif');
+   cursor: pointer;
+}
+
+#cancel {
+   font-weight: bold;
+   width: 90px;
+   height: 21px;
+   border: 0;
+   background-image: url('../images/cancel_button_bg.gif');
+   cursor: pointer;
+}
+
+/* Mozilla only style */
+html>body #insert, html>body #cancel {
+  padding-bottom: 2px;
+}
+
+.title {
+  font-size: 12px;
+  font-weight: bold;
+  color: #2B6FB6;
+}
+
+table.charmap {
+  border-style: solid;
+  border-width: 1px;
+  border-color: #AAAAAA;
+}
+
+td.charmap, td.charmapOver {
+  color: #000000;
+  border-color: #AAAAAA;
+  border-style: solid;
+  border-width: 1px;
+  text-align: center;
+  font-size: 12px;
+}
+
+td.charmapOver {
+  background-color: #CCCCCC;
+  cursor: default;
+}
+
+a.charmap {
+  color: #000000;
+  text-decoration: none
+}
+
+.wordWrapCode {
+  vertical-align: middle;
+  border: 1px none #000000;
+  background-color: transparent;
+}
+
+input.radio {
+  border: 1px none #000000;
+  background-color: transparent;
+  vertical-align: middle;
+}
+
+input.checkbox {
+  border: 1px none #000000;
+  background-color: transparent;
+  vertical-align: middle;
+}
+
+.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected {
+  margin-left: 1px;
+}
+
+.mceButtonNormal {
+  border-top: 1px solid;
+  border-left: 1px solid;
+  border-bottom: 1px solid;
+  border-right: 1px solid;
+  border-color: #F0F0EE;
+  cursor: default;
+}
+
+.mceButtonOver {
+  border: 1px solid #0A246A;
+  cursor: default;
+  background-color: #B6BDD2;
+}
+
+.mceButtonDown {
+  cursor: default;
+  border: 1px solid #0A246A;
+  background-color: #8592B5;
+}
+
+.mceButtonDisabled {
+  filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+  -moz-opacity:0.3;
+  opacity: 0.3;
+  border-top: 1px solid;
+  border-left: 1px solid;
+  border-bottom: 1px solid;
+  border-right: 1px solid;
+  border-color: #F0F0EE;
+  cursor: default;
+}
+
+.mceActionPanel {
+  margin-top: 5px;
+}
+
+/* Tabs classes */
+
+.tabs {
+  float: left;
+  width: 100%;
+  line-height: normal;
+  background-image: url("../images/xp/tabs_bg.gif");
+}
+
+.tabs ul {
+  margin: 0;
+  padding: 0 0 0;
+  list-style: none;
+}
+
+.tabs li {
+  float: left;
+  background: url("../images/xp/tab_bg.gif") no-repeat left top;
+  margin: 0;
+  margin-left: 0;
+  margin-right: 2px;
+  padding: 0 0 0 10px;
+  line-height: 18px;
+}
+
+.tabs li.current {
+  background: url("../images/xp/tab_sel_bg.gif") no-repeat left top;
+  margin-right: 2px;
+}
+
+.tabs span {
+  float: left;
+  display: block;
+  background: url("../images/xp/tab_end.gif") no-repeat right top;
+  padding: 0px 10px 0 0;
+}
+
+.tabs .current span {
+  background: url("../images/xp/tab_sel_end.gif") no-repeat right top;
+}
+
+.tabs a {
+  text-decoration: none;
+  font-family: Verdana, Arial;
+  font-size: 10px;
+}
+
+.tabs a:link, .tabs a:visited, .tabs a:hover {
+  color: black;
+}
+
+.tabs a:hover {
+}
+
+.tabs .current {
+}
+
+.tabs .current a, .tabs .current a:link, .tabs .current a:visited {
+}
+
+.panel_wrapper div.panel {
+  display: none;
+}
+
+.panel_wrapper div.current {
+  display: block;
+  width: 100%;
+  height: 300px;
+  overflow: visible; /* Should be auto but that breaks Safari */
+}
+
+.panel_wrapper {
+  border: 1px solid #919B9C;
+  border-top: 0px;
+  padding: 10px;
+  padding-top: 5px;
+  clear: both;
+  background-color: white;
+}
+
+fieldset {
+  border: 1px solid #919B9C;
+  font-family: Verdana, Arial;
+  font-size: 10px;
+  padding: 0;
+  margin: 0;
+  padding: 4px;
+}
+
+legend {
+  color: #2B6FB6;
+  font-weight: bold;
+}
+
+.properties {
+  width: 100%;
+}
+
+.properties .column1 {
+}
+
+.properties .column2 {
+  text-align: left;
+}
+
+a:link, a:visited {
+  color: black;
+}
+
+a:hover {
+  color: #2B6FB6;
+}
+
+#plugintable thead {
+  font-weight: bold;
+  background-color: #DDDDDD;
+}
+
+#plugintable, #about #plugintable td {
+  border: 1px solid #919B9C;
+}
+
+#plugintable {
+  width: 99%;
+  margin-top: 10px;
+}
+
+#pluginscontainer {
+  height: 290px;
+  overflow: auto;
+}
+
+/* MSIE Specific styles */
+
+* html .panel_wrapper {
+  width: 100%;
+}
+
+.column {
+  float: left;
+}
+
+h1, h2, h3, h4 {
+  color: #2B6FB6;
+  margin: 0;
+  padding: 0;
+  padding-top: 5px;
+}
+
+h3 {
+  font-size: 14px;
+}
+
+#link .panel_wrapper, #link div.current {
+  height: 125px;
+}
+
+#image .panel_wrapper, #image div.current {
+  height: 190px;
+}
+
+/* Disables the advanced tab in the table plugin. */
+/*
+#table #advanced_tab {
+  display: none;
+}
+*/
+
+/* Disables the border input field and label in the table plugin. */
+/*
+#table #border, #table #borderlabel {
+  display: none;
+}
+*/

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_ui.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_ui.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/css/editor_ui.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,353 @@
+/* This file contains the CSS data for the editor UI of TinyMCE instances */
+
+.mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover {
+  border: 0; margin: 0; padding: 0; background: transparent;
+}
+
+.mceSeparatorLine {
+  border: 0;
+  padding: 0;
+  margin-left: 4px;
+  margin-right: 2px;
+}
+
+.mceSelectList {
+  font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+  font-size: 7pt !important;
+  font-weight: normal;
+  margin-top: 3px;
+  padding: 0;
+  display: inline;
+  vertical-align: top;
+  background-color: #F0F0EE;
+}
+
+.mceLabel, .mceLabelDisabled {
+  font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+  font-size: 9pt;
+}
+
+.mceLabel {
+  color: #000000;
+}
+
+.mceLabelDisabled {
+  cursor: text;
+  color: #999999;
+}
+
+.mceEditor {
+  background: #F0F0EE;
+  border: 1px solid #cccccc;
+  padding: 0;
+  margin: 0;
+}
+
+.mceEditorArea {
+  font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+  background: #FFFFFF;
+  padding: 0;
+  margin: 0;
+}
+
+.mceToolbarTop, .mceToolbarBottom {
+  background: #F0F0EE;
+  line-height: 1px;
+  font-size: 1px;
+}
+
+.mceToolbarTop {
+  border-bottom: 1px solid #cccccc;
+  padding-bottom: 1px;
+}
+
+.mceToolbarBottom {
+  border-top: 1px solid #cccccc;
+}
+
+.mceStatusbarTop, .mceStatusbarBottom, .mceStatusbar {
+  height: 20px;
+}
+
+.mceStatusbarTop .mceStatusbarPathText, .mceStatusbarBottom .mceStatusbarPathText, .mceStatusbar .mceStatusbarPathText {
+  font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+  font-size: 9pt;
+  padding: 2px;
+  line-height: 16px;
+  overflow: visible;
+}
+
+.mceStatusbarTop {
+  border-bottom: 1px solid #cccccc;
+}
+
+.mceStatusbarBottom {
+  border-top: 1px solid #cccccc;
+}
+
+.mceStatusbar {
+  border-bottom: 1px solid #cccccc;
+}
+
+.mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover {
+  text-decoration: none;
+  font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+  font-size: 9pt;
+  color: #000000;
+}
+
+.mcePathItem:hover {
+  text-decoration: underline;
+}
+
+.mceStatusbarPathText {
+  float: left;
+}
+
+.mceStatusbarResize {
+  float: right;
+  background-image: url('../images/statusbar_resize.gif');
+  background-repeat: no-repeat;
+  width: 11px;
+  height: 20px;
+  cursor: se-resize;
+}
+
+.mceResizeBox {
+  width: 10px;
+  height: 10px;
+  display: none;
+  border: 1px dotted gray;
+  margin: 0;
+  padding: 0;
+}
+
+.mceEditorIframe {
+  border: 0;
+}
+
+/* Button CSS rules */
+
+a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {
+  width: 20px;
+  height: 20px;
+  cursor: default;
+  margin-top: 1px;
+  margin-left: 1px;
+}
+
+a.mceButtonDisabled img {
+  border: 0 !important;
+}
+
+a.mceButtonNormal img, a.mceButtonSelected img {
+  border: 1px solid #F0F0EE !important;
+}
+
+a.mceButtonSelected img {
+  border: 1px solid #6779AA !important;
+  background-color: #D4D5D8;
+}
+
+a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {
+  border: 1px solid #0A246A !important;
+  cursor: default;
+  background-color: #B6BDD2;
+}
+
+a.mceButtonDisabled img {
+  -moz-opacity:0.3;
+  opacity: 0.3;
+  border: 1px solid #F0F0EE !important;
+  cursor: default;
+}
+
+a.mceTiledButton img {
+  background-image: url('../images/buttons.gif');
+  background-repeat: no-repeat;
+}
+
+/* MSIE specific rules */
+
+* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {
+  border: 0 !important;
+  margin-top: 2px;
+  margin-bottom: 1px;
+}
+
+* html a.mceButtonDisabled img {
+  filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+  border: 0 !important;
+}
+
+* html a.mceButtonDisabled {
+  border: 1px solid #F0F0EE !important;
+}
+
+* html a.mceButtonNormal, * html a.mceButtonSelected {
+  border: 1px solid #F0F0EE !important;
+  cursor: default;
+}
+
+* html a.mceButtonSelected {
+  border: 1px solid #6779AA !important;
+  background-color: #D4D5D8;
+}
+
+* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {
+  border: 1px solid #0A246A !important;
+  cursor: default;
+  background-color: #B6BDD2;
+}
+
+* html .mceSelectList {
+  margin-top: 2px;
+}
+
+/* Menu button CSS rules */
+
+span.mceMenuButton img, span.mceMenuButtonSelected img {
+  border: 1px solid #F0F0EE;
+  margin-left: 1px;
+}
+
+span.mceMenuButtonSelected img {
+  border: 1px solid #6779AA;
+  background-color: #B6BDD2;
+}
+
+span.mceMenuButtonSelected img.mceMenuButton {
+  border: 1px solid #F0F0EE;
+  background-color: transparent;
+}
+
+span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton {
+  border-left: 0;
+  margin-left: 0;
+}
+
+span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img {
+  border: 1px solid #0A246A;
+  background-color: #B6BDD2;
+}
+
+span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton {
+  border-left: 0;
+}
+
+span.mceMenuButtonFocus img {
+  border: 1px solid gray;
+  border-right: 0;
+  margin-left: 1px;
+  background-color: #F5F4F2;
+}
+
+span.mceMenuButtonFocus img.mceMenuButton {
+  border: 1px solid gray;
+  border-left: 1px solid #F5F4F2;
+  margin-left: 0;
+}
+
+/* Menu button MSIE specific rules */
+
+* html span.mceMenuButton, * html span.mceMenuButtonFocus {
+  position: relative;
+  left: 0;
+  top: 0;
+}
+
+* html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img {
+  position: relative;
+  top: 1px;
+}
+
+* html span.mceMenuHover img {
+  border: 1px solid #0A246A;
+  background-color: #B6BDD2;
+}
+
+* html span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton {
+  border: 1px solid #0A246A;
+  background-color: #B6BDD2;
+  border-left: 0;
+}
+
+/* Menu */
+
+.mceMenu {
+  position: absolute;
+  left: 0;
+  top: 0;
+  display: none;
+  z-index: 100;
+  background-color: white;
+  border: 1px solid gray;
+  font-weight: normal;
+}
+
+.mceMenu a, .mceMenuTitle, .mceMenuDisabled {
+  display: block;
+  width: 100%;
+  text-decoration: none;
+  background-color: white;
+  font-family: Tahoma, Verdana, Arial, Helvetica;
+  font-size: 11px;
+  line-height: 20px;
+  color: black;
+}
+
+.mceMenu a:hover {
+  background-color: #B6BDD2;
+  color: black;
+  text-decoration: none !important;
+}
+
+.mceMenu span {
+  padding-left: 10px;
+  padding-right: 10px;
+  display: block;
+  line-height: 20px;
+}
+
+.mceMenuSeparator {
+  border-bottom: 1px solid gray;
+  background-color: gray;
+  height: 1px;
+}
+
+.mceMenuTitle span {
+  padding-left: 5px;
+}
+
+.mceMenuTitle {
+  background-color: #DDDDDD;
+  font-weight: bold;
+}
+
+.mceMenuDisabled {
+  color: gray;
+}
+
+span.mceMenuSelectedItem {
+  background-image: url('../images/menu_check.gif');
+  background-repeat: no-repeat;
+  background-position: 5px 8px;
+  padding-left: 20px;
+}
+
+span.mceMenuCheckItem {
+  padding-left: 20px;
+}
+
+span.mceMenuLine {
+  display: block;
+  position: absolute;
+  left: 0;
+  top: -1px;
+  background-color: #F5F4F2;
+  width: 30px;
+  height: 1px;
+  overflow: hidden;
+  padding-left: 0;
+  padding-right: 0;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/about.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/about.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/about.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>About TinyMCE</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">About TinyMCE</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+TinyMCE is a small WYSIWYG editor control for web browsers such as MSIE or Mozilla 
+that enables you to edit HTML contents in a more user friendly way. It has common 
+features that are found in most word processors and should not be difficult to 
+use.<br>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/common_buttons.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/common_buttons.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/common_buttons.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,162 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Common buttons</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Common buttons</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+Below is a short description about each button.
+<br>
+<br>
+<table border="1" cellpadding="3" cellspacing="0">
+  <tr>
+    <td><img src="../../images/bold.gif" width="20" height="20" alt="Bold text icon" /></td>
+    <td>Bold text style (Ctrl+B).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/italic.gif" width="20" height="20" alt="Italic text icon" /></td>
+    <td>Italic text style (Ctrl+I).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/underline.gif" width="20" height="20" alt="Underline text icon." /></td>
+    <td>Underline text style (Ctrl+U).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/strikethrough.gif" width="20" height="20" alt="Strikethrough text icon." /></td>
+    <td>Strikethrough text style.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/justifyleft.gif" width="20" height="20" alt="Align left icon." /></td>
+    <td>Align left.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/justifycenter.gif" width="20" height="20" alt="Align center icon." /></td>
+    <td>Align center.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/justifyright.gif" width="20" height="20" alt="Align right icon." /></td>
+    <td>Align right.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/justifyfull.gif" width="20" height="20" alt="Align full icon." /></td>
+    <td>Align full.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/bullist.gif" width="20" height="20" alt="Unordered list/bullet list icon." /></td>
+    <td>Unordered list/bullet list.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/numlist.gif" width="20" height="20" alt="Ordered list/numbered list icon." /></td>
+    <td>Ordered list/numbered list</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/outdent.gif" width="20" height="20" alt="Outdent/decrease indentation icon." /></td>
+    <td>Outdent/decrease indentation.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/indent.gif" width="20" height="20" alt="Indent/increase indentation icon." /></td>
+    <td>Indent/increase indentation.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/undo.gif" width="20" height="20" alt="Undo the last operation." /></td>
+    <td>Undo the last operation (Ctrl+Z).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/redo.gif" width="20" height="20" alt="Redo the last operation icon." /></td>
+    <td>Redo the last operation (Ctrl+Y).</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/link.gif" width="20" height="20" alt="Insert a new link icon." /></td>
+    <td>Insert a new link, read more about this function in the <a href="insert_link_button.htm">Insert 
+      link section</a>.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/unlink.gif" width="20" height="20" alt="Unlinks the current selection icon." /></td>
+    <td>Unlinks the current selection/removes all selected links.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/anchor.gif" width="20" height="20" alt="Insert a new anchor icon." /></td>
+    <td>Insert a new anchor, read more about this function in the <a href="insert_anchor_button.htm">Insert anchor section.</a></td>
+  </tr>
+  <tr>
+    <td><img src="../../images/image.gif" width="20" height="20" alt="Insert a new image icon." /></td>
+    <td>Insert a new image, read more about this function in the <a href="insert_image_button.htm">Insert 
+      image section</a>.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/cleanup.gif" width="20" height="20" alt="Cleanup code icon." /></td>
+    <td>Cleanup code/Removes unwanted formating. This function is useful when 
+      you copy contents from for example a office product.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/help.gif" width="20" height="20" alt="Show help icon." /></td>
+    <td>Shows this help window.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/code.gif" width="20" height="20" alt="Source code editor icon." /></td>
+    <td>Opens HTML source code editor. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table.gif" width="20" height="20" alt="Insert table icon." /></td>
+    <td>Inserts a new table at the current location. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_insert_row_before.gif" width="20" height="20" alt="Adds a row above icon." /></td>
+    <td>Adds a row above the current one. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_insert_row_after.gif" width="20" height="20" alt="Adds a row under icon." /></td>
+    <td>Adds a row under the current one. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_delete_row.gif" width="20" height="20" alt="Remove row icon." /></td>
+    <td>Removes the row. </td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_insert_col_before.gif" width="20" height="20" alt="Add column before icon." /></td>
+    <td>Adds a column before the current one.</td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_insert_col_after.gif" width="20" height="20" alt="Add column after icon." /></td>
+    <td>Adds a column after the current one.</td>
+  </tr>
+  <tr>
+    <td><img src="../../../../plugins/table/images/table_delete_col.gif" width="20" height="20" alt="Remove column icon." /></td>
+    <td>Removes the current column.</td>
+  </tr>
+  <tr>
+    <td><img src="../../images/hr.gif" width="20" height="20" alt="Insert horizontal ruler icon." /></td>
+    <td>Inserts a new horizontal ruler </td>
+  </tr>
+  <tr>
+    <td><img src="../../images/removeformat.gif" width="20" height="20" alt="Remove formatting icon." /></td>
+    <td>Removes formatting from the selection. </td>
+  </tr>
+  <tr>
+    <td><img src="../../images/sub.gif" width="20" height="20" alt="Subscript icon." /></td>
+    <td>Makes the selection to be subscript. </td>
+  </tr>
+  <tr>
+    <td><img src="../../images/sup.gif" width="20" height="20" alt="Superscript icon." /></td>
+    <td>Makes the selection to be superscripted. </td>
+  </tr>
+</table>
+<br>
+<hr noshade="noshade" />
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+</BODY>
+</HTML>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/create_accessible_content.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/create_accessible_content.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/create_accessible_content.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert table button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Create accessible content</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<p>TinyMCE can create HTML content that will be accessible to all users, including those with disabilities using assistive technologies, as well as those using text-based browsers, or those browsing the Web with images turned off. </p>
+
+<p><strong>Things you can do to make your content accessible:</strong></p>
+<ol>
+<li><strong>Include an Image Description:</strong> Blind users, or others who are unable to view images, will rely on the Image Description (or Alt text) to take the place of the image. If an image contains no meaning, such as a decoration or a spacer image, leave the Image Description empty. TinyMCE will then insert an empty Alt text attribute that will force assistive technologies to ignore the image. <br /><br /></li>
+
+<li> <strong>Add Scope to data table header cells:</strong> In the table cell editor dialog window, choose a Scope when creating Header cells so the column or row label in that cell becomes explicitely associated with its data cells. Table cell headers will then be announced with each data cell, making it easier for blind users using a screen reader to understand what the content of each cell represents. <br /><br /></li>
+
+<li><strong> Structure content with properly nested headings:</strong> In the format selection menu choose Heading 1 to Heading 6 to represent headings in your content,  rather than using other font formating options. Blind users using a screen reader can then extract the headings from the page to generate a summary of the content it contains, and use those headings to navigate quickly to subsections within the page.<br /><br /></li>
+
+<li><strong> Include alternate content:</strong> Create an alternate page for non-HTML content such as Flash, Java applets, or  embedded movies. This might be a static image, with a description of the image, and a description of the content that would have appeared in its place. An alternate HTML page could also be created, and a link to it included next to the non-HTML object. This will ensure that the content will be accessible to users of assistive technologies that can not view or play the content, and ensure the content will be available to those who do not have the appropriate plugin or helper application installed.<br /><br /></li>
+
+<li><strong> Check accessbility: </strong> When the AChecker plugin is installed with TinyMCE, click on the Check Accessibility button to generate a report of potential accessibility problems.<br /><br /></li>
+
+</ol>
+
+<p>See the <a href="http://checker.atrc.utoronto.ca" target="_new">AChecker Web Site</a> for further details about creating content that will be accessible to all users.<br />
+</p>
+
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+
+<br>
+</BODY>
+</HTML>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_anchor_window.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_anchor_window.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_image_window.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_image_window.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_link_window.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_link_window.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_table_window.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/images/insert_table_window.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/index.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/index.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/index.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Help Index</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+<BODY onload="window.focus();">
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Table of contents</span></td>
+    <td align="right">&nbsp;</td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+Click the links below to go to the different help sections. 
+<ul class="toc_ul">
+  <li class="toc_li"><a href="about.htm">About TinyMCE</a></li>
+  <li class="toc_li"><a href="common_buttons.htm">Common buttons</a></li>
+  <li class="toc_li"><a href="insert_image_button.htm">Insert image button</a></li>
+  <li class="toc_li"><a href="insert_link_button.htm">Insert link button</a></li>
+  <li class="toc_li"><a href="insert_anchor_button.htm">Insert anchor button</a></li>
+  <li class="toc_li"><a href="insert_table_button.htm">Insert table button</a></li>
+ <li class="toc_li"><a href="create_accessible_content.htm">Create accessible content</a></li>
+</ul>
+<hr noshade>
+</BODY>
+</HTML>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_anchor_button.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_anchor_button.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_anchor_button.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert anchor button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Insert anchor button</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+This button opens a new window with the insert/edit anchor function.<br>
+<br>
+<img src="images/insert_anchor_window.gif" width="330" height="139" alt="Anchor dialog/window" /><br>
+<br>
+There are one field in this window, this is where you enter the name of you anchor point. Remember the anchor name needs to be unique. <br>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_image_button.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_image_button.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_image_button.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert image button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Insert image button</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+The insert image button opens the window shown below.<br>
+<br>
+<img src="images/insert_image_window.gif" alt="Insert image dialog/window" /><br>
+<br>
+You simply enter a URL to the image you want to link to and enter a image description, 
+this is then displayed as an alternative text descripton of the image on the page.<br>
+<br>
+<strong>Field descriptions:</strong><br>
+<table border="1" cellspacing="0">
+  <tr>
+    <td width="150"><strong>Image URL </strong></td>
+    <td>URL/path to the image.</td>
+  </tr>
+  <tr>
+    <td width="150"><strong>Image description </strong></td>
+    <td>Alternative description of image contents.</td>
+  </tr>
+  <tr>
+    <td><strong>Dimentions</strong></td>
+    <td>Image width/height. </td>
+  </tr>
+  <tr>
+    <td><strong>Alignment</strong></td>
+    <td>Image alignment, useful when wrapping text around images.</td>
+  </tr>
+  <tr>
+    <td><strong>Border</strong></td>
+    <td>Border thickness. </td>
+  </tr>
+  <tr>
+    <td><strong>VSpace</strong></td>
+    <td>Vertical space, useful when wrapping text around images.</td>
+  </tr>
+  <tr>
+    <td><strong>HSpace</strong></td>
+    <td>Horizontal space, useful when wrapping text around images.</td>
+  </tr>
+</table>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_link_button.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_link_button.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_link_button.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert link button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Insert link button</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+This button opens a new window with the insert/edit link function.<br>
+<br>
+<img src="images/insert_link_window.gif" width="330" height="159" alt="Insert link dialog/window" /><br>
+<br>
+There are two fields in this window the first one &quot;Link URL&quot; is the 
+URL of the link. The target enables you to select how the link is to be opened.<br>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_table_button.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_table_button.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/insert_table_button.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<HEAD>
+<TITLE>Insert table button</TITLE>
+<link href="style.css" rel="stylesheet" type="text/css">
+</HEAD>
+
+<BODY>
+
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pageheader">
+  <tr> 
+    <td><span class="title">Insert table button</span></td>
+    <td align="right"><a href="index.htm"><acronym title="Table of contents">TOC</acronym></a></td>
+  </tr>
+</table>
+<hr noshade>
+<br>
+The insert table button opens the window shown below. This action enables you to create tables. <br>
+<br>
+<img src="images/insert_table_window.gif" width="340" height="229" alt="Image of table window" /><br>
+<br>
+<strong>Field descriptions:</strong><br>
+<table border="1" cellspacing="0">
+  <tr>
+    <td width="150"><strong>Columns</strong></td>
+    <td>Number of columns in the  table. </td>
+  </tr>
+  <tr>
+    <td width="150"><strong>Rows</strong></td>
+    <td>Number of rows in the new table.</td>
+  </tr>
+  <tr>
+    <td><strong>Cellpadding</strong></td>
+    <td>Cellpadding of the table . </td>
+  </tr>
+  <tr>
+    <td><strong>Cellspacing</strong></td>
+    <td>Cellspacing of the table .</td>
+  </tr>
+  <tr>
+    <td><strong>Alignment</strong></td>
+    <td>Table alignment . </td>
+  </tr>
+  <tr>
+    <td><strong>Border</strong></td>
+    <td>Border thinkness of table.</td>
+  </tr>
+  <tr>
+    <td><strong>Width</strong></td>
+    <td>Width in pixels of table .</td>
+  </tr>
+  <tr>
+    <td><strong>Height</strong></td>
+    <td>Height in pixels of table.</td>
+  </tr>
+  <tr>
+    <td><strong>Class</strong></td>
+    <td>Style or CSS class of table.</td>
+  </tr>
+</table>
+<br>
+<br>
+<hr noshade>
+<table width="100%" border="0" cellpadding="1" cellspacing="3" class="pagefooter">
+  <tr> 
+    <td>Go to: <a href="index.htm">Table of contents</a></td>
+    <td align="right"><a href="#">Top</a></td>
+  </tr>
+</table>
+<br>
+</BODY>
+</HTML>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/style.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/style.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/docs/en/style.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+body { background-color: #FFFFFF; }
+body, td, .content { font-family: Verdana, Arial, helvetica, sans-serif; font-size: 12px; }
+.title { font-family: Verdana, Arial, helvetica, sans-serif; font-size: 16px; font-weight: bold; }
+.subtitle { font-size: 12px; font-weight: bold; }
+
+.toc_ul, .toc_li { margin-left: 8px; line-height: 16px; }
+.step_ol, .step_li { margin-left: 11px; line-height: 16px; }
+img { border: #000000 solid 1px; }
+
+a:visited { color: #666666; text-decoration: underline; }
+a:active { color: #666666; text-decoration: underline; }
+a:hover { color: #666666; text-decoration: underline; }
+a { color: #666666; text-decoration: underline; }
+
+.pageheader { border: #E0E0E0 solid 1px; }
+.pagefooter { border: #E0E0E0 solid 1px; }
+.sample { background-color: #FFFFFF; border: #000000 solid 1px; }
+.samplecontent { font-size: 10px; }
+
+.code { background-color: #FFFFFF; border: #000000 solid 1px; }
+.codecontent { font-size: 10px; }
+.codecontent a:visited { color: #666666; text-decoration: none; font-weight: bold }
+.codecontent a:active { color: #666666; text-decoration: none; font-weight: bold  }
+.codecontent a:hover { color: #666666; text-decoration: none; font-weight: bold  }
+.codecontent a { color: #666666; text-decoration: none; font-weight: bold  }
+
+hr { height: 1px; }
+

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/editor_template.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/editor_template.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/editor_template.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_AdvancedTheme={_autoImportCSSClasses:true,_resizer:{},_buttons:[['bold','{$lang_bold_img}','lang_bold_desc','Bold'],['italic','{$lang_italic_img}','lang_italic_desc','Italic'],['underline','{$lang_underline_img}','lang_underline_desc','Underline'],['strikethrough','strikethrough.gif','lang_striketrough_desc','Strikethrough'],['justifyleft','justifyleft.gif','lang_justifyleft_desc','JustifyLeft'],['justifycenter','justifycenter.gif','lang_justifycenter_desc','JustifyCenter'],['justifyright','justifyright.gif','lang_justifyright_desc','JustifyRight'],['justifyfull','justifyfull.gif','lang_justifyfull_desc','JustifyFull'],['bullist','bullist.gif','lang_bullist_desc','InsertUnorderedList'],['numlist','numlist.gif','lang_numlist_desc','InsertOrderedList'],['outdent','outdent.gif','lang_outdent_desc','Outdent'],['indent','indent.gif','lang_indent_desc','Indent'],['cut','cut.gif','lang_cut_desc','Cut'],['copy','copy.gif','lang_copy_desc','Copy'],['paste','paste.gif','lang_paste_desc','Paste'],['undo','undo.gif','lang_undo_desc','Undo'],['redo','redo.gif','lang_redo_desc','Redo'],['link','link.gif','lang_link_desc','mceLink',true],['unlink','unlink.gif','lang_unlink_desc','unlink'],['image','image.gif','lang_image_desc','mceImage',true],['cleanup','cleanup.gif','lang_cleanup_desc','mceCleanup'],['help','help.gif','lang_help_desc','mceHelp'],['code','code.gif','lang_theme_code_desc','mceCodeEditor'],['hr','hr.gif','lang_theme_hr_desc','inserthorizontalrule'],['removeformat','removeformat.gif','lang_theme_removeformat_desc','removeformat'],['sub','sub.gif','lang_theme_sub_desc','subscript'],['sup','sup.gif','lang_theme_sup_desc','superscript'],['forecolor','forecolor.gif','lang_theme_forecolor_desc','mceForeColor',true],['backcolor','backcolor.gif','lang_theme_backcolor_desc','mceBackColor',true],['charmap','charmap.gif','lang_theme_charmap_desc','mceCharMap'],['visualaid','visualaid.gif','lang_theme_visualaid_desc','mceToggleVisualAid'],['anchor','anchor.gif','lang_theme_anchor_desc','mceInsertAnchor'],['newdocument','newdocument.gif','lang_newdocument_desc','mceNewDocument']],_buttonMap:'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells',getControlHTML:function(button_name){var i,x;for(i=0;i<TinyMCE_AdvancedTheme._buttons.length;i++){var but=TinyMCE_AdvancedTheme._buttons[i];if(but[0]==button_name)return tinyMCE.getButtonHTML(but[0],but[2],'{$themeurl}/images/'+but[1],but[3],(but.length>4?but[4]:false),(but.length>5?but[5]:null));}switch(button_name){case"formatselect":var html='<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}'],['div','{$lang_theme_div}'],['blockquote','{$lang_theme_blockquote}'],['code','{$lang_theme_code}'],['dt','{$lang_theme_dt}'],['dd','{$lang_theme_dd}'],['samp','{$lang_theme_samp}']];html+='<option value="">{$lang_theme_block}</option>';for(var i=0;i<formats.length;i++){for(var x=0;x<lookup.length;x++){if(formats[i]==lookup[x][0])html+='<option value="&lt;'+lookup[x][0]+'&gt;">'+lookup[x][1]+'</option>';}}html+='</select>';return html;case"styleselect":return'<select id="{$editor_id}_styleSelect" onmousedown="tinyMCE.themes.advanced._setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event,this,window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';case"fontselect":var fontHTML='<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';var iFonts='Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';var nFonts='Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';var fonts=tinyMCE.getParam("theme_advanced_fonts",nFonts).split(';');for(i=0;i<fonts.length;i++){if(fonts[i]!=''){var parts=fonts[i].split('=');fontHTML+='<option value="'+parts[1]+'">'+parts[0]+'</option>';}}fontHTML+='</select>';return fontHTML;case"fontsizeselect":return'<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+'<option value="0">{$lang_theme_font_size}</option>'+'<option value="1">1 (8 pt)</option>'+'<option value="2">2 (10 pt)</option>'+'<option value="3">3 (12 pt)</option>'+'<option value="4">4 (14 pt)</option>'+'<option value="5">5 (18 pt)</option>'+'<option value="6">6 (24 pt)</option>'+'<option value="7">7 (36 pt)</option>'+'</select>';case"|":case"separator":return'<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';case"spacer":return'<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" />';case"rowseparator":return'<br />';}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceLink":var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text;}else selectedText=inst.getSel().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return true;}var href="",target="",title="",onclick="",action="insert",style_class="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement!=null&&tinyMCE.getAttrib(tinyMCE.linkElement,'href')=="")tinyMCE.linkElement=null;if(tinyMCE.linkElement){href=tinyMCE.getAttrib(tinyMCE.linkElement,'href');target=tinyMCE.getAttrib(tinyMCE.linkElement,'target');title=tinyMCE.getAttrib(tinyMCE.linkElement,'title');onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');style_class=tinyMCE.getAttrib(tinyMCE.linkElement,'class');if(onclick=="")onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');onclick=tinyMCE.cleanupEventStr(onclick);href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");mceRealHref=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_href');if(mceRealHref!=""){href=mceRealHref;if(tinyMCE.getParam('convert_urls'))href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");}action="update";}var template=new Array();template['file']='link.htm';template['width']=310;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);if(inst.settings['insertlink_callback']){var returnVal=eval(inst.settings['insertlink_callback']+"(href, target, title, onclick, action, style_class);");if(returnVal&&returnVal['href'])TinyMCE_AdvancedTheme._insertLink(returnVal['href'],returnVal['target'],returnVal['title'],returnVal['onclick'],returnVal['style_class']);}else{tinyMCE.openWindow(template,{href:href,target:target,title:title,onclick:onclick,action:action,className:style_class,inline:"yes"});}return true;case"mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";var title="",onmouseover="",onmouseout="",action="insert";var img=tinyMCE.imgElement;var inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){img=tinyMCE.selectedElement;tinyMCE.imgElement=img;}if(img){if(tinyMCE.getAttrib(img,'name').indexOf('mce_')==0)return true;src=tinyMCE.getAttrib(img,'src');alt=tinyMCE.getAttrib(img,'alt');if(alt=="")alt=tinyMCE.getAttrib(img,'title');if(tinyMCE.isGecko){var w=img.style.width;if(w!=null&&w!="")img.setAttribute("width",w);var h=img.style.height;if(h!=null&&h!="")img.setAttribute("height",h);}border=tinyMCE.getAttrib(img,'border');hspace=tinyMCE.getAttrib(img,'hspace');vspace=tinyMCE.getAttrib(img,'vspace');width=tinyMCE.getAttrib(img,'width');height=tinyMCE.getAttrib(img,'height');align=tinyMCE.getAttrib(img,'align');onmouseover=tinyMCE.getAttrib(img,'onmouseover');onmouseout=tinyMCE.getAttrib(img,'onmouseout');title=tinyMCE.getAttrib(img,'title');if(tinyMCE.isMSIE){width=img.attributes['width'].specified?width:"";height=img.attributes['height'].specified?height:"";}src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");mceRealSrc=tinyMCE.getAttrib(img,'mce_src');if(mceRealSrc!=""){src=mceRealSrc;if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");}action="update";}var template=new Array();template['file']='image.htm?src={$src}';template['width']=355;template['height']=265+(tinyMCE.isMSIE?25:0);template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);if(inst.settings['insertimage_callback']){var returnVal=eval(inst.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");if(returnVal&&returnVal['src'])TinyMCE_AdvancedTheme._insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align'],returnVal['title'],returnVal['onmouseover'],returnVal['onmouseout']);}else tinyMCE.openWindow(template,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout,action:action,inline:"yes"});return true;case"mceForeColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=tinyMCE.getAttrib(elm,"color");if(inputColor=='')inputColor=elm.style.color;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"forecolor",input_color:inputColor});return true;case"mceBackColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=elm.style.backgroundColor;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;template['width']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"HiliteColor",input_color:inputColor});return true;case"mceColorPicker":if(user_interface){var template=new Array();var inputColor=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=220;template['height']=190;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:inputColor});}else{var savedVal=tinyMCE.lastColorPickerValue;var elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;if(elm.onchange!=null&&elm.onchange!='')eval('elm.onchange();');}return true;case"mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",720));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",580));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case"mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceNewDocument":if(confirm(tinyMCE.getLang('lang_newdocument')))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,' ');return true;}return false;},getEditorTemplate:function(settings,editorId){function removeFromArray(in_array,remove_array){var outArray=new Array();for(var i=0;i<in_array.length;i++){skip=false;for(var j=0;j<remove_array.length;j++){if(in_array[i]==remove_array[j]){skip=true;}}if(!skip){outArray[outArray.length]=in_array[i];}}return outArray;}function addToArray(in_array,add_array){for(var i=0;i<add_array.length;i++){in_array[in_array.length]=add_array[i];}return in_array;}var template=new Array();var deltaHeight=0;var resizing=tinyMCE.getParam("theme_advanced_resizing",false);var path=tinyMCE.getParam("theme_advanced_path",true);var statusbarHTML='<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: '+(path?"block":"none")+'">&#160;</div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: '+(resizing?"block":"none")+'" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='<option value="">{$lang_theme_style_select}</option>';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i<stylesAr.length;i++){var key,value;key=stylesAr[i].split('=')[0];value=stylesAr[i].split('=')[1];styleSelectHTML+='<option value="'+value+'">'+key+'</option>';}TinyMCE_AdvancedTheme._autoImportCSSClasses=false;}switch(layoutManager){case"SimpleLayout":var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var toolbarAlign=tinyMCE.getParam("theme_advanced_toolbar_align","center");var pathLocation=tinyMCE.getParam("theme_advanced_path_location","none");var statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};toolbarHTML+='<a href="#" accesskey="q" title="'+tinyMCE.getLang("lang_toolbar_focus")+'"';if(!tinyMCE.getParam("accessibility_focus"))toolbarHTML+=' onfocus="tinyMCE.getInstanceById(\''+editorId+'\').getWin().focus();"';toolbarHTML+='></a>';for(var i=1;i<100;i++){var def=defVals["theme_advanced_buttons"+i];var buttons=tinyMCE.getParam("theme_advanced_buttons"+i,def==null?'':def,true,',');if(buttons.length==0)break;buttons=removeFromArray(buttons,tinyMCE.getParam("theme_advanced_disable","",true,','));buttons=addToArray(buttons,tinyMCE.getParam("theme_advanced_buttons"+i+"_add","",true,','));buttons=addToArray(tinyMCE.getParam("theme_advanced_buttons"+i+"_add_before","",true,','),buttons);for(var b=0;b<buttons.length;b++)toolbarHTML+=tinyMCE.getControlHTML(buttons[b]);if(buttons.length>0){toolbarHTML+="<br />";deltaHeight-=23;}}toolbarHTML+='<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\''+editorId+'\').getWin().focus();"></a>';template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';if(toolbarLocation=="top"){template['html']+='<tr><td class="mceToolbarTop" align="'+toolbarAlign+'" height="1" nowrap="nowrap">'+toolbarHTML+'</td></tr>';}if(statusbarLocation=="top"){template['html']+='<tr><td class="mceStatusbarTop" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23;}template['html']+='<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';if(toolbarLocation=="bottom"){template['html']+='<tr><td class="mceToolbarBottom" align="'+toolbarAlign+'" height="1">'+toolbarHTML+'</td></tr>';}if(toolbarLocation=="external"){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.applyTemplate(toolbarHTML,{editor_id:editorId});elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='<table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table>';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null;}if(statusbarLocation=="bottom"){template['html']+='<tr><td class="mceStatusbarBottom" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23;}template['html']+='</tbody></table>';break;case"RowLayout":template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';var containers=tinyMCE.getParam("theme_advanced_containers","",true,",");var defaultContainerCSS=tinyMCE.getParam("theme_advanced_containers_default_class","container");var defaultContainerAlign=tinyMCE.getParam("theme_advanced_containers_default_align","center");for(var i=0;i<containers.length;i++){if(containers[i]=="mceEditor")template['html']+='<tr><td align="center" class="mceEditor_border"><span id="{$editor_id}"></span></td></tr>';else if(containers[i]=="mceElementpath"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom";}else if(i==0){pathClass="mceStatusbar";}else{deltaHeight-=2;}template['html']+='<tr><td class="'+pathClass+'" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=22;}else{var curContainer=tinyMCE.getParam("theme_advanced_container_"+containers[i],"",true,',');var curContainerHTML="";var curAlign=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align",defaultContainerAlign);var curCSS=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class",defaultContainerCSS);for(var j=0;j<curContainer.length;j++){curContainerHTML+=tinyMCE.getControlHTML(curContainer[j]);}if(curContainer.length>0){curContainerHTML+="<br />";deltaHeight-=23;}template['html']+='<tr><td class="'+curCSS+'" align="'+curAlign+'" height="1">'+curContainerHTML+'</td></tr>';}}template['html']+='</tbody></table>';break;case"CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);");}break;}if(resizing)template['html']+='<span id="{$editor_id}_resize_box" class="mceResizeBox"></span>';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=deltaHeight;return template;},initInstance:function(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_AdvancedTheme._resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true));}}inst.addShortcut('ctrl','k','lang_link_desc','mceLink');},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection,setup_content){function selectByValue(select_elm,value,first_index){first_index=typeof(first_index)=="undefined"?false:true;if(select_elm){for(var i=0;i<select_elm.options.length;i++){var ov=""+select_elm.options[i].value;if(first_index&&ov.toLowerCase().indexOf(value.toLowerCase())==0){select_elm.selectedIndex=i;return true;}if(ov==value){select_elm.selectedIndex=i;return true;}}}return false;};function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";};if(node==null)return;var pathElm=document.getElementById(editor_id+"_path");var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();if(pathElm){var parentNode=node;var path=new Array();while(parentNode!=null){if(parentNode.nodeName.toUpperCase()=="BODY"){break;}if(parentNode.nodeType==1&&tinyMCE.getAttrib(parentNode,"class").indexOf('mceItemHidden')==-1){path[path.length]=parentNode;}parentNode=parentNode.parentNode;}var html="";for(var i=path.length-1;i>=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName=="b"){nodeName="strong";}if(nodeName=="i"){nodeName="em";}if(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+st+" ";}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+face+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="size: "+size+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+color+" ";}if(getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" ";}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(getAttrib(path[i],'src')!=""){var src=tinyMCE.getAttrib(path[i],"mce_src");if(src=="")src=tinyMCE.getAttrib(path[i],"src");nodeData+="src: "+src+" ";}if(getAttrib(path[i],'href')!=""){var href=tinyMCE.getAttrib(path[i],"mce_href");if(href=="")href=tinyMCE.getAttrib(path[i],"href");nodeData+="href: "+href+" ";}if(nodeName=="img"&&tinyMCE.getAttrib(path[i],"class").indexOf('mceItemFlash')!=-1){nodeName="flash";nodeData="src: "+path[i].getAttribute('title');}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+anchor;nodeData="";}if(getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className;}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+='<a title="'+nodeData+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" target="_self" class="mcePathItem">'+nodeName+'</a>';if(i>0){html+=" &raquo; ";}}pathElm.innerHTML='<a href="#" accesskey="x"></a>'+tinyMCE.getLang('lang_theme_path')+": "+html+'&#160;';}tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClass(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClass(editor_id+'_link','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_unlink','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_outdent','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_image','mceButtonNormal');tinyMCE.switchClass(editor_id+'_hr','mceButtonNormal');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)tinyMCE.switchClass(editor_id+'_anchor','mceButtonSelected');var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClass(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal');tinyMCE.switchClass(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal');}tinyMCE.switchClass(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal');if(undo_levels!=-1){tinyMCE.switchClass(editor_id+'_undo','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_redo','mceButtonDisabled');}if(tinyMCE.getParentElement(node,"li,blockquote"))tinyMCE.switchClass(editor_id+'_outdent','mceButtonNormal');if(undo_index!=-1&&(undo_index<undo_levels-1&&undo_levels>0))tinyMCE.switchClass(editor_id+'_redo','mceButtonNormal');if(undo_index!=-1&&(undo_index>0&&undo_levels>0))tinyMCE.switchClass(editor_id+'_undo','mceButtonNormal');var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);classNode=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i<selectElm.options.length;i++){if(selectElm.options[i].value==classNode.className){index=i;breakOut=true;break;}}}}while(!breakOut&&classNode!=null&&(classNode=classNode.parentNode)!=null);selectElm.selectedIndex=index;}var selectElm=document.getElementById(editor_id+"_formatSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"p,div,h1,h2,h3,h4,h5,h6,pre,address");if(elm)selectByValue(selectElm,"<"+elm.nodeName.toLowerCase()+">");else selectByValue(selectElm,"");}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=inst.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="");}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(selectElm,family,family!=""))selectByValue(selectElm,"");}else selectByValue(selectElm,"");}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=inst.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size);}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i<sizes.length;i++){if((''+sizes[i])==size){size=i;break;}}}if(!selectByValue(selectElm,size))selectByValue(selectElm,"");}else selectByValue(selectElm,"0");}}alignNode=node;breakOut=false;do{if(!alignNode.getAttribute||!alignNode.getAttribute('align'))continue;switch(alignNode.getAttribute('align').toLowerCase()){case"left":tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonSelected');breakOut=true;break;case"right":tinyMCE.switchClass(editor_id+'_justifyright','mceButtonSelected');breakOut=true;break;case"middle":case"center":tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonSelected');breakOut=true;break;case"justify":tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonSelected');breakOut=true;break;}}while(!breakOut&&(alignNode=alignNode.parentNode)!=null);var div=tinyMCE.getParentElement(node,"div");if(div&&div.style.textAlign=="center")tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonSelected');if(!setup_content){var ar=new Array("Bold","_bold","Italic","_italic","Strikethrough","_strikethrough","superscript","_sup","subscript","_sub");for(var i=0;i<ar.length;i+=2){if(inst.queryCommandState(ar[i]))tinyMCE.switchClass(editor_id+ar[i+1],'mceButtonSelected');}if(inst.queryCommandState("Underline")&&(node.parentNode==null||node.parentNode.nodeName!="A"))tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected');}do{switch(node.nodeName){case"UL":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"OL":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break;case"HR":tinyMCE.switchClass(editor_id+'_hr','mceButtonSelected');break;case"IMG":if(getAttrib(node,'name').indexOf('mce_')!=0){tinyMCE.switchClass(editor_id+'_image','mceButtonSelected');}break;}}while((node=node.parentNode)!=null);},_setupCSSClasses:function(editor_id){var i,selectElm;if(!TinyMCE_AdvancedTheme._autoImportCSSClasses)return;selectElm=document.getElementById(editor_id+'_styleSelect');if(selectElm&&selectElm.getAttribute('cssImported')!='true'){var csses=tinyMCE.getCSSClasses(editor_id);if(csses&&selectElm){for(i=0;i<csses.length;i++)selectElm.options[selectElm.options.length]=new Option(csses[i],csses[i]);}if(csses!=null&&csses.length>0)selectElm.setAttribute('cssImported','true');}},_setCookie:function(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie;},_getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end));},_resizeTo:function(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0;}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2;}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;w=w<1?30:w;h=h<1?30:h;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;iw=iw<1?30:iw;ih=ih<1?30:ih;if(tinyMCE.isGecko){iw-=2;ih-=2;}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth<minIframeWidth){dx=minIframeWidth-inst.iframeElement.clientWidth;inst.iframeElement.style.width=(iw+dx)+"px";}}},_resizeEventHandler:function(e){var resizer=TinyMCE_AdvancedTheme._resizer;if(!resizer.resizing)return;e=typeof(e)=="undefined"?window.event:e;var dx=e.screenX-resizer.downX;var dy=e.screenY-resizer.downY;var resizeBox=resizer.resizeBox;var editorId=resizer.editorId;switch(e.type){case"mousemove":var w,h;w=resizer.width+dx;h=resizer.height+dy;w=w<1?1:w;h=h<1?1:h;if(resizer.horizontal)resizeBox.style.width=w+"px";resizeBox.style.height=h+"px";break;case"mouseup":TinyMCE_AdvancedTheme._setResizing(e,editorId,false);TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId),resizer.width+dx,resizer.height+dy,resizer.horizontal);if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var expires=new Date();expires.setTime(expires.getTime()+3600000*24*30);TinyMCE_AdvancedTheme._setCookie("TinyMCE_"+editorId+"_width",""+(resizer.horizontal?resizer.width+dx:""),expires);TinyMCE_AdvancedTheme._setCookie("TinyMCE_"+editorId+"_height",""+(resizer.height+dy),expires);}break;}},_setResizing:function(e,editor_id,state){e=typeof(e)=="undefined"?window.event:e;var resizer=TinyMCE_AdvancedTheme._resizer;var editorContainer=document.getElementById(editor_id+'_parent');var editorArea=document.getElementById(editor_id+'_parent').firstChild;var resizeBox=document.getElementById(editor_id+'_resize_box');var inst=tinyMCE.getInstanceById(editor_id);if(state){var width=editorArea.clientWidth;var height=editorArea.clientHeight;resizeBox.style.width=width+"px";resizeBox.style.height=height+"px";resizer.iframeWidth=inst.iframeElement.clientWidth;resizer.iframeHeight=inst.iframeElement.clientHeight;editorArea.style.display="none";resizeBox.style.display="block";if(!resizer.eventHandlers){if(tinyMCE.isMSIE)tinyMCE.addEvent(document,"mousemove",TinyMCE_AdvancedTheme._resizeEventHandler);else tinyMCE.addEvent(window,"mousemove",TinyMCE_AdvancedTheme._resizeEventHandler);tinyMCE.addEvent(document,"mouseup",TinyMCE_AdvancedTheme._resizeEventHandler);resizer.eventHandlers=true;}resizer.resizing=true;resizer.downX=e.screenX;resizer.downY=e.screenY;resizer.width=parseInt(resizeBox.style.width);resizer.height=parseInt(resizeBox.style.height);resizer.editorId=editor_id;resizer.resizeBox=resizeBox;resizer.horizontal=tinyMCE.getParam("theme_advanced_resize_horizontal",true);}else{resizer.resizing=false;resizeBox.style.display="none";editorArea.style.display=tinyMCE.isMSIE&&!tinyMCE.isOpera?"block":"table";tinyMCE.execCommand('mceResetDesignMode');}},_insertImage:function(src,alt,border,hspace,vspace,width,height,align,title,onmouseover,onmouseout){tinyMCE.execCommand('mceBeginUndoLevel');if(src=="")return;if(!tinyMCE.imgElement&&tinyMCE.isSafari){var html="";html+='<img src="'+src+'" alt="'+alt+'"';html+=' border="'+border+'" hspace="'+hspace+'"';html+=' vspace="'+vspace+'" width="'+width+'"';html+=' height="'+height+'" align="'+align+'" title="'+title+'" onmouseover="'+onmouseover+'" onmouseout="'+onmouseout+'" />';tinyMCE.execCommand("mceInsertContent",false,html);}else{if(!tinyMCE.imgElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari)tinyMCE.execCommand("mceInsertContent",false,'<img src="'+tinyMCE.uniqueURL+'" />');else tinyMCE.selectedInstance.contentDocument.execCommand("insertimage",false,tinyMCE.uniqueURL);tinyMCE.imgElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"img","src",tinyMCE.uniqueURL);}}if(tinyMCE.imgElement){var needsRepaint=false;var msrc=src;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, tinyMCE.imgElement);");if(tinyMCE.getParam('convert_urls'))msrc=src;if(onmouseover&&onmouseover!="")onmouseover="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseover, tinyMCE.imgElement);")+"';";if(onmouseout&&onmouseout!="")onmouseout="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseout, tinyMCE.imgElement);")+"';";if(typeof(title)=="undefined")title=alt;if(width!=tinyMCE.imgElement.getAttribute("width")||height!=tinyMCE.imgElement.getAttribute("height")||align!=tinyMCE.imgElement.getAttribute("align"))needsRepaint=true;tinyMCE.setAttrib(tinyMCE.imgElement,'src',src);tinyMCE.setAttrib(tinyMCE.imgElement,'mce_src',msrc);tinyMCE.setAttrib(tinyMCE.imgElement,'alt',alt);tinyMCE.setAttrib(tinyMCE.imgElement,'title',title);tinyMCE.setAttrib(tinyMCE.imgElement,'align',align);tinyMCE.setAttrib(tinyMCE.imgElement,'border',border,true);tinyMCE.setAttrib(tinyMCE.imgElement,'hspace',hspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'vspace',vspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'width',width,true);tinyMCE.setAttrib(tinyMCE.imgElement,'height',height,true);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseover',onmouseover);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseout',onmouseout);if(width&&width!="")tinyMCE.imgElement.style.pixelWidth=width;if(height&&height!="")tinyMCE.imgElement.style.pixelHeight=height;if(needsRepaint)tinyMCE.selectedInstance.repaint();}tinyMCE.execCommand('mceEndUndoLevel');},_insertLink:function(href,target,title,onclick,style_class){tinyMCE.execCommand('mceBeginUndoLevel');if(tinyMCE.selectedInstance&&tinyMCE.selectedElement&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){var doc=tinyMCE.selectedInstance.getDoc();var linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");var newLink=false;if(!linkElement){linkElement=doc.createElement("a");newLink=true;}var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(linkElement,'href',thref);tinyMCE.setAttrib(linkElement,'mce_href',mhref);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',title);tinyMCE.setAttrib(linkElement,'onclick',onclick);tinyMCE.setAttrib(linkElement,'class',style_class);if(newLink){linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));tinyMCE.selectedElement.parentNode.replaceChild(linkElement,tinyMCE.selectedElement);}return;}if(!tinyMCE.linkElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari){tinyMCE.execCommand("mceInsertContent",false,'<a href="'+tinyMCE.uniqueURL+'">'+tinyMCE.selectedInstance.selection.getSelectedHTML()+'</a>');}else tinyMCE.selectedInstance.contentDocument.execCommand("createlink",false,tinyMCE.uniqueURL);tinyMCE.linkElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);var elementArray=tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);for(var i=0;i<elementArray.length;i++){var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, elementArray[i]);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(elementArray[i],'href',thref);tinyMCE.setAttrib(elementArray[i],'mce_href',mhref);tinyMCE.setAttrib(elementArray[i],'target',target);tinyMCE.setAttrib(elementArray[i],'title',title);tinyMCE.setAttrib(elementArray[i],'onclick',onclick);tinyMCE.setAttrib(elementArray[i],'class',style_class);}tinyMCE.linkElement=elementArray[0];}if(tinyMCE.linkElement){var mhref=href;href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(tinyMCE.linkElement,'href',href);tinyMCE.setAttrib(tinyMCE.linkElement,'mce_href',mhref);tinyMCE.setAttrib(tinyMCE.linkElement,'target',target);tinyMCE.setAttrib(tinyMCE.linkElement,'title',title);tinyMCE.setAttrib(tinyMCE.linkElement,'onclick',onclick);tinyMCE.setAttrib(tinyMCE.linkElement,'class',style_class);}tinyMCE.execCommand('mceEndUndoLevel');}};tinyMCE.addTheme("advanced",TinyMCE_AdvancedTheme);tinyMCE.addButtonMap(TinyMCE_AdvancedTheme._buttonMap);
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/editor_template_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/editor_template_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/editor_template_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1411 @@
+/**
+ * $RCSfile: editor_template_src.js,v $
+ * $Revision: 1.96 $
+ * $Date: 2006/04/18 13:32:52 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import theme specific language pack */
+tinyMCE.importThemeLanguagePack('advanced');
+
+var TinyMCE_AdvancedTheme = {
+  // Private theme fields
+  _autoImportCSSClasses : true,
+  _resizer : {},
+  _buttons : [
+    // Control id, button img, button title, command, user_interface, value
+    ['bold', '{$lang_bold_img}', 'lang_bold_desc', 'Bold'],
+    ['italic', '{$lang_italic_img}', 'lang_italic_desc', 'Italic'],
+    ['underline', '{$lang_underline_img}', 'lang_underline_desc', 'Underline'],
+    ['strikethrough', 'strikethrough.gif', 'lang_striketrough_desc', 'Strikethrough'],
+    ['justifyleft', 'justifyleft.gif', 'lang_justifyleft_desc', 'JustifyLeft'],
+    ['justifycenter', 'justifycenter.gif', 'lang_justifycenter_desc', 'JustifyCenter'],
+    ['justifyright', 'justifyright.gif', 'lang_justifyright_desc', 'JustifyRight'],
+    ['justifyfull', 'justifyfull.gif', 'lang_justifyfull_desc', 'JustifyFull'],
+    ['bullist', 'bullist.gif', 'lang_bullist_desc', 'InsertUnorderedList'],
+    ['numlist', 'numlist.gif', 'lang_numlist_desc', 'InsertOrderedList'],
+    ['outdent', 'outdent.gif', 'lang_outdent_desc', 'Outdent'],
+    ['indent', 'indent.gif', 'lang_indent_desc', 'Indent'],
+    ['cut', 'cut.gif', 'lang_cut_desc', 'Cut'],
+    ['copy', 'copy.gif', 'lang_copy_desc', 'Copy'],
+    ['paste', 'paste.gif', 'lang_paste_desc', 'Paste'],
+    ['undo', 'undo.gif', 'lang_undo_desc', 'Undo'],
+    ['redo', 'redo.gif', 'lang_redo_desc', 'Redo'],
+    ['link', 'link.gif', 'lang_link_desc', 'mceLink', true],
+    ['unlink', 'unlink.gif', 'lang_unlink_desc', 'unlink'],
+    ['image', 'image.gif', 'lang_image_desc', 'mceImage', true],
+    ['cleanup', 'cleanup.gif', 'lang_cleanup_desc', 'mceCleanup'],
+    ['help', 'help.gif', 'lang_help_desc', 'mceHelp'],
+    ['code', 'code.gif', 'lang_theme_code_desc', 'mceCodeEditor'],
+    ['hr', 'hr.gif', 'lang_theme_hr_desc', 'inserthorizontalrule'],
+    ['removeformat', 'removeformat.gif', 'lang_theme_removeformat_desc', 'removeformat'],
+    ['sub', 'sub.gif', 'lang_theme_sub_desc', 'subscript'],
+    ['sup', 'sup.gif', 'lang_theme_sup_desc', 'superscript'],
+    ['forecolor', 'forecolor.gif', 'lang_theme_forecolor_desc', 'mceForeColor', true],
+    ['backcolor', 'backcolor.gif', 'lang_theme_backcolor_desc', 'mceBackColor', true],
+    ['charmap', 'charmap.gif', 'lang_theme_charmap_desc', 'mceCharMap'],
+    ['visualaid', 'visualaid.gif', 'lang_theme_visualaid_desc', 'mceToggleVisualAid'],
+    ['anchor', 'anchor.gif', 'lang_theme_anchor_desc', 'mceInsertAnchor'],
+    ['newdocument', 'newdocument.gif', 'lang_newdocument_desc', 'mceNewDocument']
+  ],
+
+  _buttonMap : 'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells',
+
+  /**
+   * Returns HTML code for the specificed control.
+   */
+  getControlHTML : function(button_name) {
+    var i, x;
+
+    // Lookup button in button list
+    for (i=0; i<TinyMCE_AdvancedTheme._buttons.length; i++) {
+      var but = TinyMCE_AdvancedTheme._buttons[i];
+
+      if (but[0] == button_name)
+        return tinyMCE.getButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null));
+    }
+
+    // Custom controlls other than buttons
+    switch (button_name) {
+      case "formatselect":
+        var html = '<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';
+        var formats = tinyMCE.getParam("theme_advanced_blockformats", "p,address,pre,h1,h2,h3,h4,h5,h6", true).split(',');
+        var lookup = [
+          ['p', '{$lang_theme_paragraph}'],
+          ['address', '{$lang_theme_address}'],
+          ['pre', '{$lang_theme_pre}'],
+          ['h1', '{$lang_theme_h1}'],
+          ['h2', '{$lang_theme_h2}'],
+          ['h3', '{$lang_theme_h3}'],
+          ['h4', '{$lang_theme_h4}'],
+          ['h5', '{$lang_theme_h5}'],
+          ['h6', '{$lang_theme_h6}'],
+          ['div', '{$lang_theme_div}'],
+          ['blockquote', '{$lang_theme_blockquote}'],
+          ['code', '{$lang_theme_code}'],
+          ['dt', '{$lang_theme_dt}'],
+          ['dd', '{$lang_theme_dd}'],
+          ['samp', '{$lang_theme_samp}']
+        ];
+
+        html += '<option value="">{$lang_theme_block}</option>';
+
+        // Build format select
+        for (var i=0; i<formats.length; i++) {
+          for (var x=0; x<lookup.length; x++) {
+            if (formats[i] == lookup[x][0])
+              html += '<option value="&lt;' + lookup[x][0] + '&gt;">' + lookup[x][1] + '</option>';
+          }
+        }
+
+        html += '</select>';
+
+        return html;
+
+      case "styleselect":
+        return '<select id="{$editor_id}_styleSelect" onmousedown="tinyMCE.themes.advanced._setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event,this,window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';
+
+      case "fontselect":
+        var fontHTML = '<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';
+        var iFonts = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
+        var nFonts = 'Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';
+        var fonts = tinyMCE.getParam("theme_advanced_fonts", nFonts).split(';');
+        for (i=0; i<fonts.length; i++) {
+          if (fonts[i] != '') {
+            var parts = fonts[i].split('=');
+            fontHTML += '<option value="' + parts[1] + '">' + parts[0] + '</option>';
+          }
+        }
+
+        fontHTML += '</select>';
+        return fontHTML;
+
+      case "fontsizeselect":
+        return '<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+
+            '<option value="0">{$lang_theme_font_size}</option>'+
+            '<option value="1">1 (8 pt)</option>'+
+            '<option value="2">2 (10 pt)</option>'+
+            '<option value="3">3 (12 pt)</option>'+
+            '<option value="4">4 (14 pt)</option>'+
+            '<option value="5">5 (18 pt)</option>'+
+            '<option value="6">6 (24 pt)</option>'+
+            '<option value="7">7 (36 pt)</option>'+
+            '</select>';
+
+      case "|":
+      case "separator":
+        return '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
+
+      case "spacer":
+        return '<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" />';
+
+      case "rowseparator":
+        return '<br />';
+    }
+
+    return "";
+  },
+
+  /**
+   * Theme specific execcommand handling.
+   */
+  execCommand : function(editor_id, element, command, user_interface, value) {
+    switch (command) {
+      case "mceLink":
+        var inst = tinyMCE.getInstanceById(editor_id);
+        var doc = inst.getDoc();
+        var selectedText = "";
+
+        if (tinyMCE.isMSIE) {
+          var rng = doc.selection.createRange();
+          selectedText = rng.text;
+        } else
+          selectedText = inst.getSel().toString();
+
+        if (!tinyMCE.linkElement) {
+          if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0))
+            return true;
+        }
+
+        var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
+
+        if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
+          tinyMCE.linkElement = tinyMCE.selectedElement;
+
+        // Is anchor not a link
+        if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
+          tinyMCE.linkElement = null;
+
+        if (tinyMCE.linkElement) {
+          href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');
+          target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');
+          title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');
+          onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
+          style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
+
+          // Try old onclick to if copy/pasted content
+          if (onclick == "")
+            onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
+
+          onclick = tinyMCE.cleanupEventStr(onclick);
+
+          href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
+
+          // Use mce_href if defined
+          mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
+          if (mceRealHref != "") {
+            href = mceRealHref;
+
+            if (tinyMCE.getParam('convert_urls'))
+              href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
+          }
+
+          action = "update";
+        }
+
+        var template = new Array();
+
+        template['file'] = 'link.htm';
+        template['width'] = 310;
+        template['height'] = 200;
+
+        // Language specific width and height addons
+        template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0);
+        template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0);
+
+        if (inst.settings['insertlink_callback']) {
+          var returnVal = eval(inst.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);");
+          if (returnVal && returnVal['href'])
+            TinyMCE_AdvancedTheme._insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']);
+        } else {
+          tinyMCE.openWindow(template, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes"});
+        }
+
+        return true;
+
+      case "mceImage":
+        var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "";
+        var title = "", onmouseover = "", onmouseout = "", action = "insert";
+        var img = tinyMCE.imgElement;
+        var inst = tinyMCE.getInstanceById(editor_id);
+
+        if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {
+          img = tinyMCE.selectedElement;
+          tinyMCE.imgElement = img;
+        }
+
+        if (img) {
+          // Is it a internal MCE visual aid image, then skip this one.
+          if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)
+            return true;
+
+          src = tinyMCE.getAttrib(img, 'src');
+          alt = tinyMCE.getAttrib(img, 'alt');
+
+          // Try polling out the title
+          if (alt == "")
+            alt = tinyMCE.getAttrib(img, 'title');
+
+          // Fix width/height attributes if the styles is specified
+          if (tinyMCE.isGecko) {
+            var w = img.style.width;
+            if (w != null && w != "")
+              img.setAttribute("width", w);
+
+            var h = img.style.height;
+            if (h != null && h != "")
+              img.setAttribute("height", h);
+          }
+
+          border = tinyMCE.getAttrib(img, 'border');
+          hspace = tinyMCE.getAttrib(img, 'hspace');
+          vspace = tinyMCE.getAttrib(img, 'vspace');
+          width = tinyMCE.getAttrib(img, 'width');
+          height = tinyMCE.getAttrib(img, 'height');
+          align = tinyMCE.getAttrib(img, 'align');
+          onmouseover = tinyMCE.getAttrib(img, 'onmouseover');
+          onmouseout = tinyMCE.getAttrib(img, 'onmouseout');
+          title = tinyMCE.getAttrib(img, 'title');
+
+          // Is realy specified?
+          if (tinyMCE.isMSIE) {
+            width = img.attributes['width'].specified ? width : "";
+            height = img.attributes['height'].specified ? height : "";
+          }
+
+          //onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));
+          //onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));
+
+          src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
+
+          // Use mce_src if defined
+          mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');
+          if (mceRealSrc != "") {
+            src = mceRealSrc;
+
+            if (tinyMCE.getParam('convert_urls'))
+              src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
+          }
+
+          //if (onmouseover != "")
+          //  onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);");
+
+          //if (onmouseout != "")
+          //  onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);");
+
+          action = "update";
+        }
+
+        var template = new Array();
+
+        template['file'] = 'image.htm?src={$src}';
+        template['width'] = 355;
+        template['height'] = 265 + (tinyMCE.isMSIE ? 25 : 0);
+
+        // Language specific width and height addons
+        template['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0);
+        template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0);
+
+        if (inst.settings['insertimage_callback']) {
+          var returnVal = eval(inst.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");
+          if (returnVal && returnVal['src'])
+            TinyMCE_AdvancedTheme._insertImage(returnVal['src'], returnVal['alt'], returnVal['border'], returnVal['hspace'], returnVal['vspace'], returnVal['width'], returnVal['height'], returnVal['align'], returnVal['title'], returnVal['onmouseover'], returnVal['onmouseout']);
+        } else
+          tinyMCE.openWindow(template, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"});
+
+        return true;
+
+      case "mceForeColor":
+        var template = new Array();
+        var elm = tinyMCE.selectedInstance.getFocusElement();
+        var inputColor = tinyMCE.getAttrib(elm, "color");
+
+        if (inputColor == '')
+          inputColor = elm.style.color;
+
+        if (!inputColor)
+          inputColor = "#000000";
+
+        template['file'] = 'color_picker.htm';
+        template['width'] = 220;
+        template['height'] = 190;
+
+        tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "forecolor", input_color : inputColor});
+      return true;
+
+      case "mceBackColor":
+        var template = new Array();
+        var elm = tinyMCE.selectedInstance.getFocusElement();
+        var inputColor = elm.style.backgroundColor;
+
+        if (!inputColor)
+          inputColor = "#000000";
+
+        template['file'] = 'color_picker.htm';
+        template['width'] = 220;
+        template['height'] = 190;
+
+        template['width'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width', 0);
+        template['height'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height', 0);
+
+        tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "HiliteColor", input_color : inputColor});
+        //mceBackColor
+      return true;
+
+      case "mceColorPicker":
+        if (user_interface) {
+          var template = new Array();
+          var inputColor = value['document'].getElementById(value['element_id']).value;
+
+          template['file'] = 'color_picker.htm';
+          template['width'] = 220;
+          template['height'] = 190;
+          template['close_previous'] = "no";
+
+          template['width'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width', 0);
+          template['height'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height', 0);
+
+          if (typeof(value['store_selection']) == "undefined")
+            value['store_selection'] = true;
+
+          tinyMCE.lastColorPickerValue = value;
+          tinyMCE.openWindow(template, {editor_id : editor_id, mce_store_selection : value['store_selection'], inline : "yes", command : "mceColorPicker", input_color : inputColor});
+        } else {
+          var savedVal = tinyMCE.lastColorPickerValue;
+          var elm = savedVal['document'].getElementById(savedVal['element_id']);
+          elm.value = value;
+
+          if (elm.onchange != null && elm.onchange != '')
+            eval('elm.onchange();');
+        }
+      return true;
+
+      case "mceCodeEditor":
+        var template = new Array();
+
+        template['file'] = 'source_editor.htm';
+        template['width'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_width", 720));
+        template['height'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_height", 580));
+
+        tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no", inline : "yes"});
+        return true;
+
+      case "mceCharMap":
+        var template = new Array();
+
+        template['file'] = 'charmap.htm';
+        template['width'] = 550 + (tinyMCE.isOpera ? 40 : 0);
+        template['height'] = 250;
+
+        template['width'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_width', 0);
+        template['height'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_height', 0);
+
+        tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+        return true;
+
+      case "mceInsertAnchor":
+        var template = new Array();
+
+        template['file'] = 'anchor.htm';
+        template['width'] = 320;
+        template['height'] = 90 + (tinyMCE.isNS7 ? 30 : 0);
+
+        template['width'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_width', 0);
+        template['height'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_height', 0);
+
+        tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+        return true;
+
+      case "mceNewDocument":
+        if (confirm(tinyMCE.getLang('lang_newdocument')))
+          tinyMCE.execInstanceCommand(editor_id, 'mceSetContent', false, ' ');
+
+        return true;
+    }
+
+    return false;
+  },
+
+  /**
+   * Editor instance template function.
+   */
+  getEditorTemplate : function(settings, editorId) {
+    function removeFromArray(in_array, remove_array) {
+      var outArray = new Array();
+      
+      for (var i=0; i<in_array.length; i++) {
+        skip = false;
+
+        for (var j=0; j<remove_array.length; j++) {
+          if (in_array[i] == remove_array[j]) {
+            skip = true;
+          }
+        }
+
+        if (!skip) {
+          outArray[outArray.length] = in_array[i];
+        }
+      }
+
+      return outArray;
+    }
+
+    function addToArray(in_array, add_array) {
+      for (var i=0; i<add_array.length; i++) {
+        in_array[in_array.length] = add_array[i];
+      }
+
+      return in_array;
+    }
+
+    var template = new Array();
+    var deltaHeight = 0;
+    var resizing = tinyMCE.getParam("theme_advanced_resizing", false);
+    var path = tinyMCE.getParam("theme_advanced_path", true);
+    var statusbarHTML = '<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: ' + (path ? "block" : "none") + '">&#160;</div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: ' + (resizing ? "block" : "none") + '" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';
+    var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout");
+
+    // Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY!
+    var styleSelectHTML = '<option value="">{$lang_theme_style_select}</option>';
+    if (settings['theme_advanced_styles']) {
+      var stylesAr = settings['theme_advanced_styles'].split(';');
+      
+      for (var i=0; i<stylesAr.length; i++) {
+        var key, value;
+
+        key = stylesAr[i].split('=')[0];
+        value = stylesAr[i].split('=')[1];
+
+        styleSelectHTML += '<option value="' + value + '">' + key + '</option>';
+      }
+
+      TinyMCE_AdvancedTheme._autoImportCSSClasses = false;
+    }
+
+    switch(layoutManager) {
+      case "SimpleLayout" : //the default TinyMCE Layout (for backwards compatibility)...
+        var toolbarHTML = "";
+        var toolbarLocation = tinyMCE.getParam("theme_advanced_toolbar_location", "bottom");
+        var toolbarAlign = tinyMCE.getParam("theme_advanced_toolbar_align", "center");
+        var pathLocation = tinyMCE.getParam("theme_advanced_path_location", "none"); // Compatiblity
+        var statusbarLocation = tinyMCE.getParam("theme_advanced_statusbar_location", pathLocation);
+        var defVals = {
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",
+          theme_advanced_buttons2 : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",
+          theme_advanced_buttons3 : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
+        };
+
+        // Add accessibility control
+        toolbarHTML += '<a href="#" accesskey="q" title="' + tinyMCE.getLang("lang_toolbar_focus") + '"';
+
+        if (!tinyMCE.getParam("accessibility_focus"))
+          toolbarHTML += ' onfocus="tinyMCE.getInstanceById(\'' + editorId + '\').getWin().focus();"';
+
+        toolbarHTML += '></a>';
+
+        // Render rows
+        for (var i=1; i<100; i++) {
+          var def = defVals["theme_advanced_buttons" + i];
+
+          var buttons = tinyMCE.getParam("theme_advanced_buttons" + i, def == null ? '' : def, true, ',');
+          if (buttons.length == 0)
+            break;
+
+          buttons = removeFromArray(buttons, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
+          buttons = addToArray(buttons, tinyMCE.getParam("theme_advanced_buttons" + i + "_add", "", true, ','));
+          buttons = addToArray(tinyMCE.getParam("theme_advanced_buttons" + i + "_add_before", "", true, ','), buttons);
+
+          for (var b=0; b<buttons.length; b++)
+            toolbarHTML += tinyMCE.getControlHTML(buttons[b]);
+
+          if (buttons.length > 0) {
+            toolbarHTML += "<br />";
+            deltaHeight -= 23;
+          }
+        }
+
+        // Add accessibility control
+        toolbarHTML += '<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\'' + editorId + '\').getWin().focus();"></a>';
+
+        // Setup template html
+        template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';
+
+        if (toolbarLocation == "top") {
+          template['html'] += '<tr><td class="mceToolbarTop" align="' + toolbarAlign + '" height="1" nowrap="nowrap">' + toolbarHTML + '</td></tr>';
+        }
+
+        if (statusbarLocation == "top") {
+          template['html'] += '<tr><td class="mceStatusbarTop" height="1">' + statusbarHTML + '</td></tr>';
+          deltaHeight -= 23;
+        }
+
+        template['html'] += '<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';
+
+        if (toolbarLocation == "bottom") {
+          template['html'] += '<tr><td class="mceToolbarBottom" align="' + toolbarAlign + '" height="1">' + toolbarHTML + '</td></tr>';
+        }
+
+        // External toolbar changes
+        if (toolbarLocation == "external") {
+          var bod = document.body;
+          var elm = document.createElement ("div");
+
+          toolbarHTML = tinyMCE.replaceVar(toolbarHTML, 'style_select_options', styleSelectHTML);
+          toolbarHTML = tinyMCE.applyTemplate(toolbarHTML, {editor_id : editorId});
+
+          elm.className = "mceToolbarExternal";
+          elm.id = editorId+"_toolbar";
+          elm.innerHTML = '<table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table>';
+          bod.appendChild (elm);
+          // bod.style.marginTop = elm.offsetHeight + "px";
+
+          deltaHeight = 0;
+          tinyMCE.getInstanceById(editorId).toolbarElement = elm;
+
+          //template['html'] = '<div id="mceExternalToolbar" align="center" class="mceToolbarExternal"><table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table></div>' + template["html"];
+        } else {
+          tinyMCE.getInstanceById(editorId).toolbarElement = null;
+        }
+
+        if (statusbarLocation == "bottom") {
+          template['html'] += '<tr><td class="mceStatusbarBottom" height="1">' + statusbarHTML + '</td></tr>';
+          deltaHeight -= 23;
+        }
+
+        template['html'] += '</tbody></table>';
+        //"SimpleLayout"
+      break;
+
+      case "RowLayout" : //Container Layout - containers defined in "theme_advanced_containers" are rendered from top to bottom.
+        template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';
+
+        var containers = tinyMCE.getParam("theme_advanced_containers", "", true, ",");
+        var defaultContainerCSS = tinyMCE.getParam("theme_advanced_containers_default_class", "container");
+        var defaultContainerAlign = tinyMCE.getParam("theme_advanced_containers_default_align", "center");
+
+        //Render Containers:
+        for (var i = 0; i < containers.length; i++)
+        {
+          if (containers[i] == "mceEditor") //Exceptions for mceEditor and ...
+            template['html'] += '<tr><td align="center" class="mceEditor_border"><span id="{$editor_id}"></span></td></tr>';
+          else if (containers[i] == "mceElementpath" || containers[i] == "mceStatusbar") // ... mceElementpath:
+          {
+            var pathClass = "mceStatusbar";
+
+            if (i == containers.length-1)
+            {
+              pathClass = "mceStatusbarBottom";
+            }
+            else if (i == 0)
+            {
+              pathClass = "mceStatusbar";
+            }
+            else
+            {
+              deltaHeight-=2;
+            }
+
+            template['html'] += '<tr><td class="' + pathClass + '" height="1">' + statusbarHTML + '</td></tr>';
+            deltaHeight -= 22;
+          } else { // Render normal Container
+            var curContainer = tinyMCE.getParam("theme_advanced_container_"+containers[i], "", true, ',');
+            var curContainerHTML = "";
+            var curAlign = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align", defaultContainerAlign);
+            var curCSS = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class", defaultContainerCSS);
+
+            for (var j=0; j<curContainer.length; j++) {
+              curContainerHTML += tinyMCE.getControlHTML(curContainer[j]);
+            }
+
+            if (curContainer.length > 0) {
+              curContainerHTML += "<br />";
+              deltaHeight -= 23;
+            }
+
+            template['html'] += '<tr><td class="' + curCSS + '" align="' + curAlign + '" height="1">' + curContainerHTML + '</td></tr>';
+          }
+        }
+
+        template['html'] += '</tbody></table>';
+        //RowLayout
+      break;
+
+      case "CustomLayout" : //User defined layout callback...
+        var customLayout = tinyMCE.getParam("theme_advanced_custom_layout","");
+
+        if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined") {
+          template = eval(customLayout + "(template);");
+        }
+      break;
+    }
+
+    if (resizing)
+      template['html'] += '<span id="{$editor_id}_resize_box" class="mceResizeBox"></span>';
+
+    template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML);
+    template['delta_width'] = 0;
+    template['delta_height'] = deltaHeight;
+
+    return template;
+  },
+
+  initInstance : function(inst) {
+    if (tinyMCE.getParam("theme_advanced_resizing", false)) {
+      if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
+        var w = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_width");
+        var h = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_height");
+
+        TinyMCE_AdvancedTheme._resizeTo(inst, w, h, tinyMCE.getParam("theme_advanced_resize_horizontal", true));
+      }
+    }
+
+    inst.addShortcut('ctrl', 'k', 'lang_link_desc', 'mceLink');
+  },
+
+  /**
+   * Node change handler.
+   */
+  handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) {
+    function selectByValue(select_elm, value, first_index) {
+      first_index = typeof(first_index) == "undefined" ? false : true;
+
+      if (select_elm) {
+        for (var i=0; i<select_elm.options.length; i++) {
+          var ov = "" + select_elm.options[i].value;
+
+          if (first_index && ov.toLowerCase().indexOf(value.toLowerCase()) == 0) {
+            select_elm.selectedIndex = i;
+            return true;
+          }
+
+          if (ov == value) {
+            select_elm.selectedIndex = i;
+            return true;
+          }
+        }
+      }
+
+      return false;
+    };
+
+    function getAttrib(elm, name) {
+      return elm.getAttribute(name) ? elm.getAttribute(name) : "";
+    };
+
+    // No node provided
+    if (node == null)
+      return;
+
+    // Update path
+    var pathElm = document.getElementById(editor_id + "_path");
+    var inst = tinyMCE.getInstanceById(editor_id);
+    var doc = inst.getDoc();
+
+    if (pathElm) {
+      // Get node path
+      var parentNode = node;
+      var path = new Array();
+      
+      while (parentNode != null) {
+        if (parentNode.nodeName.toUpperCase() == "BODY") {
+          break;
+        }
+
+        // Only append element nodes to path
+        if (parentNode.nodeType == 1 && tinyMCE.getAttrib(parentNode, "class").indexOf('mceItemHidden') == -1) {
+          path[path.length] = parentNode;
+        }
+
+        parentNode = parentNode.parentNode;
+      }
+
+      // Setup HTML
+      var html = "";
+      for (var i=path.length-1; i>=0; i--) {
+        var nodeName = path[i].nodeName.toLowerCase();
+        var nodeData = "";
+
+        if (nodeName == "b") {
+          nodeName = "strong";
+        }
+
+        if (nodeName == "i") {
+          nodeName = "em";
+        }
+
+        if (nodeName == "span") {
+          var cn = tinyMCE.getAttrib(path[i], "class");
+          if (cn != "" && cn.indexOf('mceItem') == -1)
+            nodeData += "class: " + cn + " ";
+
+          var st = tinyMCE.getAttrib(path[i], "style");
+          if (st != "") {
+            st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st));
+            nodeData += "style: " + st + " ";
+          }
+        }
+
+        if (nodeName == "font") {
+          if (tinyMCE.getParam("convert_fonts_to_spans"))
+            nodeName = "span";
+
+          var face = tinyMCE.getAttrib(path[i], "face");
+          if (face != "")
+            nodeData += "font: " + face + " ";
+
+          var size = tinyMCE.getAttrib(path[i], "size");
+          if (size != "")
+            nodeData += "size: " + size + " ";
+
+          var color = tinyMCE.getAttrib(path[i], "color");
+          if (color != "")
+            nodeData += "color: " + color + " ";
+        }
+
+        if (getAttrib(path[i], 'id') != "") {
+          nodeData += "id: " + path[i].getAttribute('id') + " ";
+        }
+
+        var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
+        if (className != "" && className.indexOf('mceItem') == -1)
+          nodeData += "class: " + className + " ";
+
+        if (getAttrib(path[i], 'src') != "") {
+          var src = tinyMCE.getAttrib(path[i], "mce_src");
+
+          if (src == "")
+             src = tinyMCE.getAttrib(path[i], "src");
+
+          nodeData += "src: " + src + " ";
+        }
+
+        if (getAttrib(path[i], 'href') != "") {
+          var href = tinyMCE.getAttrib(path[i], "mce_href");
+
+          if (href == "")
+             href = tinyMCE.getAttrib(path[i], "href");
+
+          nodeData += "href: " + href + " ";
+        }
+
+        if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) {
+          nodeName = "flash";
+          nodeData = "src: " + path[i].getAttribute('title');
+        }
+
+        if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") {
+          nodeName = "a";
+          nodeName += "#" + anchor;
+          nodeData = "";
+        }
+
+        if (getAttrib(path[i], 'name').indexOf("mce_") != 0) {
+          var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
+          if (className != "" && className.indexOf('mceItem') == -1) {
+            nodeName += "." + className;
+          }
+        }
+
+        var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');';
+        html += '<a title="' + nodeData + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" target="_self" class="mcePathItem">' + nodeName + '</a>';
+
+        if (i > 0) {
+          html += " &raquo; ";
+        }
+      }
+
+      pathElm.innerHTML = '<a href="#" accesskey="x"></a>' + tinyMCE.getLang('lang_theme_path') + ": " + html + '&#160;';
+    }
+
+    // Reset old states
+    tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled');
+    tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal');
+    tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal');
+
+    if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1)
+      tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected');
+
+    // Get link
+    var anchorLink = tinyMCE.getParentElement(node, "a", "href");
+
+    if (anchorLink || any_selection) {
+      tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
+      tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
+    }
+
+    // Handle visual aid
+    tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal');
+
+    if (undo_levels != -1) {
+      tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled');
+      tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled');
+    }
+
+    // Within li, blockquote
+    if (tinyMCE.getParentElement(node, "li,blockquote"))
+      tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal');
+
+    // Has redo levels
+    if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0))
+      tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal');
+
+    // Has undo levels
+    if (undo_index != -1 && (undo_index > 0 && undo_levels > 0))
+      tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal');
+
+    // Select class in select box
+    var selectElm = document.getElementById(editor_id + "_styleSelect");
+    
+    if (selectElm) {
+      TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);
+
+      classNode = node;
+      breakOut = false;
+      var index = 0;
+
+      do {
+        if (classNode && classNode.className) {
+          for (var i=0; i<selectElm.options.length; i++) {
+            if (selectElm.options[i].value == classNode.className) {
+              index = i;
+              breakOut = true;
+              break;
+            }
+          }
+        }
+      } while (!breakOut && classNode != null && (classNode = classNode.parentNode) != null);
+
+      selectElm.selectedIndex = index;
+    }
+
+    // Select formatblock
+    var selectElm = document.getElementById(editor_id + "_formatSelect");
+    if (selectElm) {
+      var elm = tinyMCE.getParentElement(node, "p,div,h1,h2,h3,h4,h5,h6,pre,address");
+
+      if (elm)
+        selectByValue(selectElm, "<" + elm.nodeName.toLowerCase() + ">");
+      else
+        selectByValue(selectElm, "");
+    }
+
+    // Select fontselect
+    var selectElm = document.getElementById(editor_id + "_fontNameSelect");
+    if (selectElm) {
+      if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) {
+        var face = inst.queryCommandValue('FontName');
+
+        face = face == null || face == "" ? "" : face;
+
+        selectByValue(selectElm, face, face != "");
+      } else {
+        var elm = tinyMCE.getParentElement(node, "font", "face");
+
+        if (elm) {
+          var family = tinyMCE.getAttrib(elm, "face");
+
+          if (family == '')
+            family = '' + elm.style.fontFamily;
+
+          if (!selectByValue(selectElm, family, family != ""))
+            selectByValue(selectElm, "");
+        } else
+          selectByValue(selectElm, "");
+      }
+    }
+
+    // Select fontsize
+    var selectElm = document.getElementById(editor_id + "_fontSizeSelect");
+    if (selectElm) {
+      if (!tinyMCE.isSafari && !tinyMCE.isOpera) {
+        var size = inst.queryCommandValue('FontSize');
+        selectByValue(selectElm, size == null || size == "" ? "0" : size);
+      } else {
+        var elm = tinyMCE.getParentElement(node, "font", "size");
+        if (elm) {
+          var size = tinyMCE.getAttrib(elm, "size");
+
+          if (size == '') {
+            var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px');
+
+            size = '' + elm.style.fontSize;
+
+            for (var i=0; i<sizes.length; i++) {
+              if (('' + sizes[i]) == size) {
+                size = i;
+                break;
+              }
+            }
+          }
+
+          if (!selectByValue(selectElm, size))
+            selectByValue(selectElm, "");
+        } else
+          selectByValue(selectElm, "0");
+      }
+    }
+
+    // Handle align attributes
+    alignNode = node;
+    breakOut = false;
+    do {
+      if (!alignNode.getAttribute || !alignNode.getAttribute('align'))
+        continue;
+
+      switch (alignNode.getAttribute('align').toLowerCase()) {
+        case "left":
+          tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonSelected');
+          breakOut = true;
+        break;
+
+        case "right":
+          tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonSelected');
+          breakOut = true;
+        break;
+
+        case "middle":
+        case "center":
+          tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected');
+          breakOut = true;
+        break;
+
+        case "justify":
+          tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonSelected');
+          breakOut = true;
+        break;
+      }
+    } while (!breakOut && (alignNode = alignNode.parentNode) != null);
+
+    // Div justification
+    var div = tinyMCE.getParentElement(node, "div");
+    if (div && div.style.textAlign == "center")
+      tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected');
+
+    // Do special text
+    if (!setup_content) {
+      // , "JustifyLeft", "_justifyleft", "JustifyCenter", "justifycenter", "JustifyRight", "justifyright", "JustifyFull", "justifyfull", "InsertUnorderedList", "bullist", "InsertOrderedList", "numlist", "InsertUnorderedList", "bullist", "Outdent", "outdent", "Indent", "indent", "subscript", "sub"
+      var ar = new Array("Bold", "_bold", "Italic", "_italic", "Strikethrough", "_strikethrough", "superscript", "_sup", "subscript", "_sub");
+      for (var i=0; i<ar.length; i+=2) {
+        if (inst.queryCommandState(ar[i]))
+          tinyMCE.switchClass(editor_id + ar[i+1], 'mceButtonSelected');
+      }
+
+      if (inst.queryCommandState("Underline") && (node.parentNode == null || node.parentNode.nodeName != "A"))
+        tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected');
+    }
+
+    // Handle elements
+    do {
+      switch (node.nodeName) {
+        case "UL":
+          tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected');
+        break;
+
+        case "OL":
+          tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected');
+        break;
+
+        case "HR":
+           tinyMCE.switchClass(editor_id + '_hr', 'mceButtonSelected');
+        break;
+
+        case "IMG":
+        if (getAttrib(node, 'name').indexOf('mce_') != 0) {
+          tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected');
+        }
+        break;
+      }
+    } while ((node = node.parentNode) != null);
+  },
+
+  // Private theme internal functions
+
+  // This function auto imports CSS classes into the class selection droplist
+  _setupCSSClasses : function(editor_id) {
+    var i, selectElm;
+
+    if (!TinyMCE_AdvancedTheme._autoImportCSSClasses)
+      return;
+
+    selectElm = document.getElementById(editor_id + '_styleSelect');
+
+    if (selectElm && selectElm.getAttribute('cssImported') != 'true') {
+      var csses = tinyMCE.getCSSClasses(editor_id);
+      if (csses && selectElm) {
+        for (i=0; i<csses.length; i++)
+          selectElm.options[selectElm.options.length] = new Option(csses[i], csses[i]);
+      }
+
+      // Only do this once
+      if (csses != null && csses.length > 0)
+        selectElm.setAttribute('cssImported', 'true');
+    }
+  },
+
+  _setCookie : function(name, value, expires, path, domain, secure) {
+    var curCookie = name + "=" + escape(value) +
+      ((expires) ? "; expires=" + expires.toGMTString() : "") +
+      ((path) ? "; path=" + escape(path) : "") +
+      ((domain) ? "; domain=" + domain : "") +
+      ((secure) ? "; secure" : "");
+
+    document.cookie = curCookie;
+  },
+
+  _getCookie : function(name) {
+    var dc = document.cookie;
+    var prefix = name + "=";
+    var begin = dc.indexOf("; " + prefix);
+
+    if (begin == -1) {
+      begin = dc.indexOf(prefix);
+
+      if (begin != 0)
+        return null;
+    } else
+      begin += 2;
+
+    var end = document.cookie.indexOf(";", begin);
+
+    if (end == -1)
+      end = dc.length;
+
+    return unescape(dc.substring(begin + prefix.length, end));
+  },
+
+  _resizeTo : function(inst, w, h, set_w) {
+    var editorContainer = document.getElementById(inst.editorId + '_parent');
+    var tableElm = editorContainer.firstChild;
+    var iframe = inst.iframeElement;
+
+    if (w == null || w == "null") {
+      set_w = false;
+      w = 0;
+    }
+
+    if (h == null || h == "null")
+      return;
+
+    w = parseInt(w);
+    h = parseInt(h);
+
+    if (tinyMCE.isGecko) {
+      w += 2;
+      h += 2;
+    }
+
+    var dx = w - tableElm.clientWidth;
+    var dy = h - tableElm.clientHeight;
+
+    w = w < 1 ? 30 : w;
+    h = h < 1 ? 30 : h;
+
+    if (set_w)
+      tableElm.style.width = w + "px";
+
+    tableElm.style.height = h + "px";
+
+    iw = iframe.clientWidth + dx;
+    ih = iframe.clientHeight + dy;
+
+    iw = iw < 1 ? 30 : iw;
+    ih = ih < 1 ? 30 : ih;
+
+    if (tinyMCE.isGecko) {
+      iw -= 2;
+      ih -= 2;
+    }
+
+    if (set_w)
+      iframe.style.width = iw + "px";
+
+    iframe.style.height = ih + "px";
+
+    // Is it to small, make it bigger again
+    if (set_w) {
+      var tableBodyElm = tableElm.firstChild;
+      var minIframeWidth = tableBodyElm.scrollWidth;
+      if (inst.iframeElement.clientWidth < minIframeWidth) {
+        dx = minIframeWidth - inst.iframeElement.clientWidth;
+
+        inst.iframeElement.style.width = (iw + dx) + "px";
+      }
+    }
+  },
+
+  /**
+   * Handles resizing events.
+   */
+  _resizeEventHandler : function(e) {
+    var resizer = TinyMCE_AdvancedTheme._resizer;
+
+    // Do nothing
+    if (!resizer.resizing)
+      return;
+
+    e = typeof(e) == "undefined" ? window.event : e;
+
+    var dx = e.screenX - resizer.downX;
+    var dy = e.screenY - resizer.downY;
+    var resizeBox = resizer.resizeBox;
+    var editorId = resizer.editorId;
+
+    switch (e.type) {
+      case "mousemove":
+        var w, h;
+
+        w = resizer.width + dx;
+        h = resizer.height + dy;
+
+        w = w < 1 ? 1 : w;
+        h = h < 1 ? 1 : h;
+
+        if (resizer.horizontal)
+          resizeBox.style.width = w + "px";
+
+        resizeBox.style.height = h + "px";
+        break;
+
+      case "mouseup":
+        TinyMCE_AdvancedTheme._setResizing(e, editorId, false);
+        TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId), resizer.width + dx, resizer.height + dy, resizer.horizontal);
+
+        // Expire in a month
+        if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
+          var expires = new Date();
+          expires.setTime(expires.getTime() + 3600000 * 24 * 30);
+
+          // Set the cookies
+          TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_width", "" + (resizer.horizontal ? resizer.width + dx : ""), expires);
+          TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_height", "" + (resizer.height + dy), expires);
+        }
+        break;
+    }
+  },
+
+  /**
+   * Starts/stops the editor resizing.
+   */
+  _setResizing : function(e, editor_id, state) {
+    e = typeof(e) == "undefined" ? window.event : e;
+
+    var resizer = TinyMCE_AdvancedTheme._resizer;
+    var editorContainer = document.getElementById(editor_id + '_parent');
+    var editorArea = document.getElementById(editor_id + '_parent').firstChild;
+    var resizeBox = document.getElementById(editor_id + '_resize_box');
+    var inst = tinyMCE.getInstanceById(editor_id);
+
+    if (state) {
+      // Place box over editor area
+      var width = editorArea.clientWidth;
+      var height = editorArea.clientHeight;
+
+      resizeBox.style.width = width + "px";
+      resizeBox.style.height = height + "px";
+
+      resizer.iframeWidth = inst.iframeElement.clientWidth;
+      resizer.iframeHeight = inst.iframeElement.clientHeight;
+
+      // Hide editor and show resize box
+      editorArea.style.display = "none";
+      resizeBox.style.display = "block";
+
+      // Add event handlers, only once
+      if (!resizer.eventHandlers) {
+        if (tinyMCE.isMSIE)
+          tinyMCE.addEvent(document, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
+        else
+          tinyMCE.addEvent(window, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
+
+        tinyMCE.addEvent(document, "mouseup", TinyMCE_AdvancedTheme._resizeEventHandler);
+
+        resizer.eventHandlers = true;
+      }
+
+      resizer.resizing = true;
+      resizer.downX = e.screenX;
+      resizer.downY = e.screenY;
+      resizer.width = parseInt(resizeBox.style.width);
+      resizer.height = parseInt(resizeBox.style.height);
+      resizer.editorId = editor_id;
+      resizer.resizeBox = resizeBox;
+      resizer.horizontal = tinyMCE.getParam("theme_advanced_resize_horizontal", true);
+    } else {
+      resizer.resizing = false;
+      resizeBox.style.display = "none";
+      editorArea.style.display = tinyMCE.isMSIE && !tinyMCE.isOpera ? "block" : "table";
+      tinyMCE.execCommand('mceResetDesignMode');
+    }
+  },
+
+  _insertImage : function(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout) {
+    tinyMCE.execCommand('mceBeginUndoLevel');
+
+    if (src == "")
+      return;
+
+    if (!tinyMCE.imgElement && tinyMCE.isSafari) {
+      var html = "";
+
+      html += '<img src="' + src + '" alt="' + alt + '"';
+      html += ' border="' + border + '" hspace="' + hspace + '"';
+      html += ' vspace="' + vspace + '" width="' + width + '"';
+      html += ' height="' + height + '" align="' + align + '" title="' + title + '" onmouseover="' + onmouseover + '" onmouseout="' + onmouseout + '" />';
+
+      tinyMCE.execCommand("mceInsertContent", false, html);
+    } else {
+      if (!tinyMCE.imgElement && tinyMCE.selectedInstance) {
+        if (tinyMCE.isSafari)
+          tinyMCE.execCommand("mceInsertContent", false, '<img src="' + tinyMCE.uniqueURL + '" />');
+        else
+          tinyMCE.selectedInstance.contentDocument.execCommand("insertimage", false, tinyMCE.uniqueURL);
+
+        tinyMCE.imgElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "img", "src", tinyMCE.uniqueURL);
+      }
+    }
+
+    if (tinyMCE.imgElement) {
+      var needsRepaint = false;
+      var msrc = src;
+
+      src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, tinyMCE.imgElement);");
+
+      if (tinyMCE.getParam('convert_urls'))
+        msrc = src;
+
+      if (onmouseover && onmouseover != "")
+        onmouseover = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, tinyMCE.imgElement);") + "';";
+
+      if (onmouseout && onmouseout != "")
+        onmouseout = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, tinyMCE.imgElement);") + "';";
+
+      // Use alt as title if it's undefined
+      if (typeof(title) == "undefined")
+        title = alt;
+
+      if (width != tinyMCE.imgElement.getAttribute("width") || height != tinyMCE.imgElement.getAttribute("height") || align != tinyMCE.imgElement.getAttribute("align"))
+        needsRepaint = true;
+
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'src', src);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'mce_src', msrc);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'alt', alt);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'title', title);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'align', align);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'border', border, true);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'hspace', hspace, true);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'vspace', vspace, true);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'width', width, true);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'height', height, true);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseover', onmouseover);
+      tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseout', onmouseout);
+
+      // Fix for bug #989846 - Image resize bug
+      if (width && width != "")
+        tinyMCE.imgElement.style.pixelWidth = width;
+
+      if (height && height != "")
+        tinyMCE.imgElement.style.pixelHeight = height;
+
+      if (needsRepaint)
+        tinyMCE.selectedInstance.repaint();
+    }
+
+    tinyMCE.execCommand('mceEndUndoLevel');
+  },
+
+  _insertLink : function(href, target, title, onclick, style_class) {
+    tinyMCE.execCommand('mceBeginUndoLevel');
+
+    if (tinyMCE.selectedInstance && tinyMCE.selectedElement && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {
+      var doc = tinyMCE.selectedInstance.getDoc();
+      var linkElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");
+      var newLink = false;
+
+      if (!linkElement) {
+        linkElement = doc.createElement("a");
+        newLink = true;
+      }
+
+      var mhref = href;
+      var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, linkElement);");
+      mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
+
+      tinyMCE.setAttrib(linkElement, 'href', thref);
+      tinyMCE.setAttrib(linkElement, 'mce_href', mhref);
+      tinyMCE.setAttrib(linkElement, 'target', target);
+      tinyMCE.setAttrib(linkElement, 'title', title);
+      tinyMCE.setAttrib(linkElement, 'onclick', onclick);
+      tinyMCE.setAttrib(linkElement, 'class', style_class);
+
+      if (newLink) {
+        linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));
+        tinyMCE.selectedElement.parentNode.replaceChild(linkElement, tinyMCE.selectedElement);
+      }
+
+      return;
+    }
+
+    if (!tinyMCE.linkElement && tinyMCE.selectedInstance) {
+      if (tinyMCE.isSafari) {
+        tinyMCE.execCommand("mceInsertContent", false, '<a href="' + tinyMCE.uniqueURL + '">' + tinyMCE.selectedInstance.selection.getSelectedHTML() + '</a>');
+      } else
+        tinyMCE.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL);
+
+      tinyMCE.linkElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
+
+      var elementArray = tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
+
+      for (var i=0; i<elementArray.length; i++) {
+        var mhref = href;
+        var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, elementArray[i]);");
+        mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
+
+        tinyMCE.setAttrib(elementArray[i], 'href', thref);
+        tinyMCE.setAttrib(elementArray[i], 'mce_href', mhref);
+        tinyMCE.setAttrib(elementArray[i], 'target', target);
+        tinyMCE.setAttrib(elementArray[i], 'title', title);
+        tinyMCE.setAttrib(elementArray[i], 'onclick', onclick);
+        tinyMCE.setAttrib(elementArray[i], 'class', style_class);
+      }
+
+      tinyMCE.linkElement = elementArray[0];
+    }
+
+    if (tinyMCE.linkElement) {
+      var mhref = href;
+      href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement);");
+      mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
+
+      tinyMCE.setAttrib(tinyMCE.linkElement, 'href', href);
+      tinyMCE.setAttrib(tinyMCE.linkElement, 'mce_href', mhref);
+      tinyMCE.setAttrib(tinyMCE.linkElement, 'target', target);
+      tinyMCE.setAttrib(tinyMCE.linkElement, 'title', title);
+      tinyMCE.setAttrib(tinyMCE.linkElement, 'onclick', onclick);
+      tinyMCE.setAttrib(tinyMCE.linkElement, 'class', style_class);
+    }
+
+    tinyMCE.execCommand('mceEndUndoLevel');
+  }
+};
+
+tinyMCE.addTheme("advanced", TinyMCE_AdvancedTheme);
+
+// Add default buttons maps for advanced theme and all internal plugins
+tinyMCE.addButtonMap(TinyMCE_AdvancedTheme._buttonMap);

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/image.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/image.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/image.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_insert_image_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/image.js"></script>
+  <base target="_self" />
+</head>
+<body id="image" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<form onsubmit="insertImage();return false;" action="#">
+  <div class="tabs">
+    <ul>
+      <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_image_title}</a></span></li>
+    </ul>
+  </div>
+
+  <div class="panel_wrapper">
+    <div id="general_panel" class="panel current">
+     <table border="0" cellpadding="4" cellspacing="0">
+          <tr>
+            <td nowrap="nowrap"><label for="src">{$lang_insert_image_src}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td><input id="src" name="src" type="text" value="" style="width: 200px" onchange="getImageData();"></td>
+                  <td id="srcbrowsercontainer">&nbsp;</td>
+                </tr>
+              </table></td>
+          </tr>
+      <!-- Image list -->
+      <script language="javascript">
+      if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
+        var html = "";
+
+        html += '<tr><td><label for="image_list">{$lang_image_list}</label></td>';
+        html += '<td><select id="image_list" name="image_list" style="width: 200px" onchange="this.form.src.value=this.options[this.selectedIndex].value;resetImageData();getImageData();">';
+        html += '<option value="">---</option>';
+
+        for (var i=0; i<tinyMCEImageList.length; i++)
+          html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
+
+        html += '</select></td></tr>';
+
+        document.write(html);
+      }
+      </script>
+      <!-- /Image list -->
+          <tr>
+            <td nowrap="nowrap"><label for="alt">{$lang_insert_image_alt}</label></td>
+            <td><input id="alt" name="alt" type="text" value="" style="width: 200px"></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="align">{$lang_insert_image_align}</label></td>
+            <td><select id="align" name="align">
+                <option value="">{$lang_insert_image_align_default}</option>
+                <option value="baseline">{$lang_insert_image_align_baseline}</option>
+                <option value="top">{$lang_insert_image_align_top}</option>
+                <option value="middle">{$lang_insert_image_align_middle}</option>
+                <option value="bottom">{$lang_insert_image_align_bottom}</option>
+                <option value="texttop">{$lang_insert_image_align_texttop}</option>
+                <option value="absmiddle">{$lang_insert_image_align_absmiddle}</option>
+                <option value="absbottom">{$lang_insert_image_align_absbottom}</option>
+                <option value="left">{$lang_insert_image_align_left}</option>
+                <option value="right">{$lang_insert_image_align_right}</option>
+              </select></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="width">{$lang_insert_image_dimensions}</label></td>
+            <td><input id="width" name="width" type="text" value="" size="3" maxlength="3">
+              x
+              <input id="height" name="height" type="text" value="" size="3" maxlength="3"></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="border">{$lang_insert_image_border}</label></td>
+            <td><input id="border" name="border" type="text" value="" size="3" maxlength="3"></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="vspace">{$lang_insert_image_vspace}</label></td>
+            <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3"></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="hspace">{$lang_insert_image_hspace}</label></td>
+            <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3"></td>
+          </tr>
+        </table>
+    </div>
+  </div>
+
+  <div class="mceActionPanel">
+    <div style="float: left">
+      <input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertImage();" />
+    </div>
+
+    <div style="float: right">
+      <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+    </div>
+  </div>
+</form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/anchor.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/anchor.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/anchor_symbol.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/anchor_symbol.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/backcolor.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/backcolor.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_de_se.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_de_se.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_es.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_es.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_fr.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_fr.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_ru.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_ru.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_tw.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bold_tw.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/browse.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/browse.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bullist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/bullist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/button_menu.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/button_menu.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/buttons.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/buttons.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/cancel_button_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/cancel_button_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/charmap.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/charmap.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/cleanup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/cleanup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/close.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/close.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/code.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/code.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/color.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/color.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/copy.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/copy.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/custom_1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/custom_1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/cut.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/cut.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/forecolor.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/forecolor.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/hr.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/hr.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/image.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/image.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/indent.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/indent.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/insert_button_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/insert_button_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_de_se.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_de_se.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_es.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_es.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_ru.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_ru.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_tw.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/italic_tw.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifycenter.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifycenter.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifyfull.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifyfull.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifyleft.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifyleft.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifyright.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/justifyright.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/menu_check.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/menu_check.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/newdocument.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/newdocument.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/numlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/numlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/opacity.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/opacity.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/outdent.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/outdent.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/paste.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/paste.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/redo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/redo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/removeformat.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/removeformat.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/separator.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/separator.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/spacer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/spacer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/statusbar_resize.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/statusbar_resize.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/strikethrough.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/strikethrough.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/sub.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/sub.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/sup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/sup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_es.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_es.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_fr.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_fr.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_ru.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_ru.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_tw.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/underline_tw.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/undo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/undo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/unlink.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/unlink.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/visualaid.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/visualaid.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_end.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_end.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tabs_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/images/xp/tabs_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/about.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/about.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/about.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+function init() {
+  var inst;
+
+  tinyMCEPopup.resizeToInnerSize();
+  inst = tinyMCE.selectedInstance;
+
+  // Give FF some time
+  window.setTimeout('insertHelpIFrame();', 10);
+
+  var tcont = document.getElementById('plugintablecontainer');
+  var plugins = tinyMCE.getParam('plugins', '', true, ',');
+  if (plugins.length == 0)
+    document.getElementById('plugins_tab').style.display = 'none';
+
+  var html = "";
+  html += '<table id="plugintable">';
+  html += '<thead>';
+  html += '<tr>';
+  html += '<td>' + tinyMCE.getLang('lang_plugin') + '</td>';
+  html += '<td>' + tinyMCE.getLang('lang_author') + '</td>';
+  html += '<td>' + tinyMCE.getLang('lang_version') + '</td>';
+  html += '</tr>';
+  html += '</thead>';
+  html += '<tbody>';
+
+  for (var i=0; i<inst.plugins.length; i++) {
+    var info = getPluginInfo(inst.plugins[i]);
+
+    html += '<tr>';
+
+    if (info.infourl != null && info.infourl != '')
+      html += '<td width="50%" title="' + plugins[i] + '"><a href="' + info.infourl + '" target="mceplugin">' + info.longname + '</a></td>';
+    else
+      html += '<td width="50%" title="' + plugins[i] + '">' + info.longname + '</td>';
+
+    if (info.authorurl != null && info.authorurl != '')
+      html += '<td width="35%"><a href="' + info.authorurl + '" target="mceplugin">' + info.author + '</a></td>';
+    else
+      html += '<td width="35%">' + info.author + '</td>';
+
+    html += '<td width="15%">' + info.version + '</td>';
+    html += '</tr>';
+  }
+
+  html += '</tbody>';
+  html += '</table>';
+
+  tcont.innerHTML = html;
+}
+
+function getPluginInfo(name) {
+  if (tinyMCE.plugins[name].getInfo)
+    return tinyMCE.plugins[name].getInfo();
+
+  return {
+    longname : name,
+    authorurl : '',
+    infourl : '',
+    author : '--',
+    version : '--'
+  };
+}
+
+function insertHelpIFrame() {
+  var html = '<iframe width="100%" height="300" src="' + tinyMCE.themeURL + "/docs/" + tinyMCE.settings['docs_language'] + "/index.htm" + '"></iframe>';
+
+  document.getElementById('iframecontainer').innerHTML = html;
+
+  html = '';
+  html += '<a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a> ';
+  html += '<a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a> ';
+  html += '<a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a> ';
+
+  document.getElementById('buttoncontainer').innerHTML = html;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/anchor.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/anchor.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/anchor.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+var action, element;
+
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+  var anchor = tinyMCE.getParentElement(inst.getFocusElement(), "a", "name");
+  var img = inst.getFocusElement();
+  action = 'insert';
+
+  if (anchor != null) {
+    element = anchor;
+    action = "update";
+  }
+
+  if (tinyMCE.getAttrib(img, "class") == "mceItemAnchor") {
+    element = img;
+    action = "update";
+  }
+
+  if (action == "update")
+    document.forms[0].anchorName.value = element.nodeName == "IMG" ? element.getAttribute("title") : element.getAttribute("name");
+
+  document.forms[0].insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true);
+}
+
+function insertAnchor() {
+  var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+  var name = document.forms[0].anchorName.value, e;
+
+  tinyMCEPopup.execCommand("mceBeginUndoLevel");
+
+  if (action == "update") {
+    if (element.nodeName == "IMG")
+      element.setAttribute("title", name);
+    else
+      element.setAttribute("name", name);
+  } else {
+    var rng = inst.getRng();
+
+    if (rng.collapse)
+      rng.collapse(false);
+
+    name = name.replace(/&/g, '&amp;');
+    name = name.replace(/\"/g, '&quot;');
+    name = name.replace(/</g, '&lt;');
+    name = name.replace(/>/g, '&gt;');
+
+    // Fix for bug #1447335
+    if (tinyMCE.isGecko)
+      html = '<a id="mceNewAnchor" name="' + name + '"></a>';
+    else
+      html = '<a name="' + name + '"></a>';
+
+    tinyMCEPopup.execCommand("mceInsertContent", false, html);
+
+    // Fix for bug #1447335 force cursor after the anchor element
+    if (tinyMCE.isGecko) {
+      e = inst.getDoc().getElementById('mceNewAnchor');
+
+      if (e) {
+        inst.selection.selectNode(e, true, false, false);
+        e.removeAttribute('id');
+      }
+    }
+
+    tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+  }
+
+  tinyMCEPopup.execCommand("mceEndUndoLevel");
+
+  tinyMCE.triggerNodeChange();
+  tinyMCEPopup.close();
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/charmap.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/charmap.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/charmap.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,326 @@
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+}
+
+var charmap = new Array();
+
+// for mor details please see w3c.org
+// now here is the complete list ;)
+
+charmap = [
+  ['&nbsp;',    '&#160;',  true, 'no-break space'],
+  ['&amp;',     '&#38;',   true, 'ampersand'],
+  ['&quot;',    '&#34;',   true, 'quotation mark'],
+// finance
+  ['&cent;',    '&#162;',  true, 'cent sign'],
+  ['&euro;',    '&#8364;', true, 'euro sign'],
+  ['&pound;',   '&#163;',  true, 'pound sign'],
+  ['&yen;',     '&#165;',  true, 'yen sign'],
+// signs
+  ['&copy;',    '&#169;',  true, 'copyright sign'],
+  ['&reg;',     '&#174;',  true, 'registered sign'],
+  ['&trade;',   '&#8482;', true, 'trade mark sign'],
+  ['&permil;',  '&#8240;', true, 'per mille sign'],
+  ['&micro;',   '&#181;',  true, 'micro sign'],
+  ['&middot;',  '&#183;',  true, 'middle dot'],
+  ['&bull;',    '&#8226;', true, 'bullet'],
+  ['&hellip;',  '&#8230;', true, 'three dot leader'],
+  ['&prime;',   '&#8242;', true, 'minutes / feet'],
+  ['&Prime;',   '&#8243;', true, 'seconds / inches'],
+  ['&sect;',    '&#167;',  true, 'section sign'],
+  ['&para;',    '&#182;',  true, 'paragraph sign'],
+  ['&szlig;',   '&#223;',  true, 'sharp s / ess-zed'],
+// quotations
+  ['&lsaquo;',  '&#8249;', true, 'single left-pointing angle quotation mark'],
+  ['&rsaquo;',  '&#8250;', true, 'single right-pointing angle quotation mark'],
+  ['&laquo;',   '&#171;',  true, 'left pointing guillemet'],
+  ['&raquo;',   '&#187;',  true, 'right pointing guillemet'],
+  ['&lsquo;',   '&#8216;', true, 'left single quotation mark'],
+  ['&rsquo;',   '&#8217;', true, 'right single quotation mark'],
+  ['&ldquo;',   '&#8220;', true, 'left double quotation mark'],
+  ['&rdquo;',   '&#8221;', true, 'right double quotation mark'],
+  ['&sbquo;',   '&#8218;', true, 'single low-9 quotation mark'],
+  ['&bdquo;',   '&#8222;', true, 'double low-9 quotation mark'],
+  ['&lt;',      '&#60;',   true, 'less-than sign'],
+  ['&gt;',      '&#62;',   true, 'greater-than sign'],
+  ['&le;',      '&#8804;', true, 'less-than or equal to'],
+  ['&ge;',      '&#8805;', true, 'greater-than or equal to'],
+  ['&ndash;',   '&#8211;', true, 'en dash'],
+  ['&mdash;',   '&#8212;', true, 'em dash'],
+  ['&macr;',    '&#175;',  true, 'macron'],
+  ['&oline;',   '&#8254;', true, 'overline'],
+  ['&curren;',  '&#164;',  true, 'currency sign'],
+  ['&brvbar;',  '&#166;',  true, 'broken bar'],
+  ['&uml;',     '&#168;',  true, 'diaeresis'],
+  ['&iexcl;',   '&#161;',  true, 'inverted exclamation mark'],
+  ['&iquest;',  '&#191;',  true, 'turned question mark'],
+  ['&circ;',    '&#710;',  true, 'circumflex accent'],
+  ['&tilde;',   '&#732;',  true, 'small tilde'],
+  ['&deg;',     '&#176;',  true, 'degree sign'],
+  ['&minus;',   '&#8722;', true, 'minus sign'],
+  ['&plusmn;',  '&#177;',  true, 'plus-minus sign'],
+  ['&divide;',  '&#247;',  true, 'division sign'],
+  ['&frasl;',   '&#8260;', true, 'fraction slash'],
+  ['&times;',   '&#215;',  true, 'multiplication sign'],
+  ['&sup1;',    '&#185;',  true, 'superscript one'],
+  ['&sup2;',    '&#178;',  true, 'superscript two'],
+  ['&sup3;',    '&#179;',  true, 'superscript three'],
+  ['&frac14;',  '&#188;',  true, 'fraction one quarter'],
+  ['&frac12;',  '&#189;',  true, 'fraction one half'],
+  ['&frac34;',  '&#190;',  true, 'fraction three quarters'],
+// math / logical
+  ['&fnof;',    '&#402;',  true, 'function / florin'],
+  ['&int;',     '&#8747;', true, 'integral'],
+  ['&sum;',     '&#8721;', true, 'n-ary sumation'],
+  ['&infin;',   '&#8734;', true, 'infinity'],
+  ['&radic;',   '&#8730;', true, 'square root'],
+  ['&sim;',     '&#8764;', false,'similar to'],
+  ['&cong;',    '&#8773;', false,'approximately equal to'],
+  ['&asymp;',   '&#8776;', true, 'almost equal to'],
+  ['&ne;',      '&#8800;', true, 'not equal to'],
+  ['&equiv;',   '&#8801;', true, 'identical to'],
+  ['&isin;',    '&#8712;', false,'element of'],
+  ['&notin;',   '&#8713;', false,'not an element of'],
+  ['&ni;',      '&#8715;', false,'contains as member'],
+  ['&prod;',    '&#8719;', true, 'n-ary product'],
+  ['&and;',     '&#8743;', false,'logical and'],
+  ['&or;',      '&#8744;', false,'logical or'],
+  ['&not;',     '&#172;',  true, 'not sign'],
+  ['&cap;',     '&#8745;', true, 'intersection'],
+  ['&cup;',     '&#8746;', false,'union'],
+  ['&part;',    '&#8706;', true, 'partial differential'],
+  ['&forall;',  '&#8704;', false,'for all'],
+  ['&exist;',   '&#8707;', false,'there exists'],
+  ['&empty;',   '&#8709;', false,'diameter'],
+  ['&nabla;',   '&#8711;', false,'backward difference'],
+  ['&lowast;',  '&#8727;', false,'asterisk operator'],
+  ['&prop;',    '&#8733;', false,'proportional to'],
+  ['&ang;',     '&#8736;', false,'angle'],
+// undefined
+  ['&acute;',   '&#180;',  true, 'acute accent'],
+  ['&cedil;',   '&#184;',  true, 'cedilla'],
+  ['&ordf;',    '&#170;',  true, 'feminine ordinal indicator'],
+  ['&ordm;',    '&#186;',  true, 'masculine ordinal indicator'],
+  ['&dagger;',  '&#8224;', true, 'dagger'],
+  ['&Dagger;',  '&#8225;', true, 'double dagger'],
+// alphabetical special chars
+  ['&Agrave;',  '&#192;',  true, 'A - grave'],
+  ['&Aacute;',  '&#193;',  true, 'A - acute'],
+  ['&Acirc;',   '&#194;',  true, 'A - circumflex'],
+  ['&Atilde;',  '&#195;',  true, 'A - tilde'],
+  ['&Auml;',    '&#196;',  true, 'A - diaeresis'],
+  ['&Aring;',   '&#197;',  true, 'A - ring above'],
+  ['&AElig;',   '&#198;',  true, 'ligature AE'],
+  ['&Ccedil;',  '&#199;',  true, 'C - cedilla'],
+  ['&Egrave;',  '&#200;',  true, 'E - grave'],
+  ['&Eacute;',  '&#201;',  true, 'E - acute'],
+  ['&Ecirc;',   '&#202;',  true, 'E - circumflex'],
+  ['&Euml;',    '&#203;',  true, 'E - diaeresis'],
+  ['&Igrave;',  '&#204;',  true, 'I - grave'],
+  ['&Iacute;',  '&#205;',  true, 'I - acute'],
+  ['&Icirc;',   '&#206;',  true, 'I - circumflex'],
+  ['&Iuml;',    '&#207;',  true, 'I - diaeresis'],
+  ['&ETH;',     '&#208;',  true, 'ETH'],
+  ['&Ntilde;',  '&#209;',  true, 'N - tilde'],
+  ['&Ograve;',  '&#210;',  true, 'O - grave'],
+  ['&Oacute;',  '&#211;',  true, 'O - acute'],
+  ['&Ocirc;',   '&#212;',  true, 'O - circumflex'],
+  ['&Otilde;',  '&#213;',  true, 'O - tilde'],
+  ['&Ouml;',    '&#214;',  true, 'O - diaeresis'],
+  ['&Oslash;',  '&#216;',  true, 'O - slash'],
+  ['&OElig;',   '&#338;',  true, 'ligature OE'],
+  ['&Scaron;',  '&#352;',  true, 'S - caron'],
+  ['&Ugrave;',  '&#217;',  true, 'U - grave'],
+  ['&Uacute;',  '&#218;',  true, 'U - acute'],
+  ['&Ucirc;',   '&#219;',  true, 'U - circumflex'],
+  ['&Uuml;',    '&#220;',  true, 'U - diaeresis'],
+  ['&Yacute;',  '&#221;',  true, 'Y - acute'],
+  ['&Yuml;',    '&#376;',  true, 'Y - diaeresis'],
+  ['&THORN;',   '&#222;',  true, 'THORN'],
+  ['&agrave;',  '&#224;',  true, 'a - grave'],
+  ['&aacute;',  '&#225;',  true, 'a - acute'],
+  ['&acirc;',   '&#226;',  true, 'a - circumflex'],
+  ['&atilde;',  '&#227;',  true, 'a - tilde'],
+  ['&auml;',    '&#228;',  true, 'a - diaeresis'],
+  ['&aring;',   '&#229;',  true, 'a - ring above'],
+  ['&aelig;',   '&#230;',  true, 'ligature ae'],
+  ['&ccedil;',  '&#231;',  true, 'c - cedilla'],
+  ['&egrave;',  '&#232;',  true, 'e - grave'],
+  ['&eacute;',  '&#233;',  true, 'e - acute'],
+  ['&ecirc;',   '&#234;',  true, 'e - circumflex'],
+  ['&euml;',    '&#235;',  true, 'e - diaeresis'],
+  ['&igrave;',  '&#236;',  true, 'i - grave'],
+  ['&iacute;',  '&#237;',  true, 'i - acute'],
+  ['&icirc;',   '&#238;',  true, 'i - circumflex'],
+  ['&iuml;',    '&#239;',  true, 'i - diaeresis'],
+  ['&eth;',     '&#240;',  true, 'eth'],
+  ['&ntilde;',  '&#241;',  true, 'n - tilde'],
+  ['&ograve;',  '&#242;',  true, 'o - grave'],
+  ['&oacute;',  '&#243;',  true, 'o - acute'],
+  ['&ocirc;',   '&#244;',  true, 'o - circumflex'],
+  ['&otilde;',  '&#245;',  true, 'o - tilde'],
+  ['&ouml;',    '&#246;',  true, 'o - diaeresis'],
+  ['&oslash;',  '&#248;',  true, 'o slash'],
+  ['&oelig;',   '&#339;',  true, 'ligature oe'],
+  ['&scaron;',  '&#353;',  true, 's - caron'],
+  ['&ugrave;',  '&#249;',  true, 'u - grave'],
+  ['&uacute;',  '&#250;',  true, 'u - acute'],
+  ['&ucirc;',   '&#251;',  true, 'u - circumflex'],
+  ['&uuml;',    '&#252;',  true, 'u - diaeresis'],
+  ['&yacute;',  '&#253;',  true, 'y - acute'],
+  ['&thorn;',   '&#254;',  true, 'thorn'],
+  ['&yuml;',    '&#255;',  true, 'y - diaeresis'],
+    ['&Alpha;',   '&#913;',  true, 'Alpha'],
+  ['&Beta;',    '&#914;',  true, 'Beta'],
+  ['&Gamma;',   '&#915;',  true, 'Gamma'],
+  ['&Delta;',   '&#916;',  true, 'Delta'],
+  ['&Epsilon;', '&#917;',  true, 'Epsilon'],
+  ['&Zeta;',    '&#918;',  true, 'Zeta'],
+  ['&Eta;',     '&#919;',  true, 'Eta'],
+  ['&Theta;',   '&#920;',  true, 'Theta'],
+  ['&Iota;',    '&#921;',  true, 'Iota'],
+  ['&Kappa;',   '&#922;',  true, 'Kappa'],
+  ['&Lambda;',  '&#923;',  true, 'Lambda'],
+  ['&Mu;',      '&#924;',  true, 'Mu'],
+  ['&Nu;',      '&#925;',  true, 'Nu'],
+  ['&Xi;',      '&#926;',  true, 'Xi'],
+  ['&Omicron;', '&#927;',  true, 'Omicron'],
+  ['&Pi;',      '&#928;',  true, 'Pi'],
+  ['&Rho;',     '&#929;',  true, 'Rho'],
+  ['&Sigma;',   '&#931;',  true, 'Sigma'],
+  ['&Tau;',     '&#932;',  true, 'Tau'],
+  ['&Upsilon;', '&#933;',  true, 'Upsilon'],
+  ['&Phi;',     '&#934;',  true, 'Phi'],
+  ['&Chi;',     '&#935;',  true, 'Chi'],
+  ['&Psi;',     '&#936;',  true, 'Psi'],
+  ['&Omega;',   '&#937;',  true, 'Omega'],
+  ['&alpha;',   '&#945;',  true, 'alpha'],
+  ['&beta;',    '&#946;',  true, 'beta'],
+  ['&gamma;',   '&#947;',  true, 'gamma'],
+  ['&delta;',   '&#948;',  true, 'delta'],
+  ['&epsilon;', '&#949;',  true, 'epsilon'],
+  ['&zeta;',    '&#950;',  true, 'zeta'],
+  ['&eta;',     '&#951;',  true, 'eta'],
+  ['&theta;',   '&#952;',  true, 'theta'],
+  ['&iota;',    '&#953;',  true, 'iota'],
+  ['&kappa;',   '&#954;',  true, 'kappa'],
+  ['&lambda;',  '&#955;',  true, 'lambda'],
+  ['&mu;',      '&#956;',  true, 'mu'],
+  ['&nu;',      '&#957;',  true, 'nu'],
+  ['&xi;',      '&#958;',  true, 'xi'],
+  ['&omicron;', '&#959;',  true, 'omicron'],
+  ['&pi;',      '&#960;',  true, 'pi'],
+  ['&rho;',     '&#961;',  true, 'rho'],
+  ['&sigmaf;',  '&#962;',  true, 'final sigma'],
+  ['&sigma;',   '&#963;',  true, 'sigma'],
+  ['&tau;',     '&#964;',  true, 'tau'],
+  ['&upsilon;', '&#965;',  true, 'upsilon'],
+  ['&phi;',     '&#966;',  true, 'phi'],
+  ['&chi;',     '&#967;',  true, 'chi'],
+  ['&psi;',     '&#968;',  true, 'psi'],
+  ['&omega;',   '&#969;',  true, 'omega'],
+// symbols
+  ['&alefsym;', '&#8501;', false,'alef symbol'],
+  ['&piv;',     '&#982;',  false,'pi symbol'],
+  ['&real;',    '&#8476;', false,'real part symbol'],
+  ['&thetasym;','&#977;',  false,'theta symbol'],
+  ['&upsih;',   '&#978;',  false,'upsilon - hook symbol'],
+  ['&weierp;',  '&#8472;', false,'Weierstrass p'],
+  ['&image;',   '&#8465;', false,'imaginary part'],
+// arrows
+  ['&larr;',    '&#8592;', true, 'leftwards arrow'],
+  ['&uarr;',    '&#8593;', true, 'upwards arrow'],
+  ['&rarr;',    '&#8594;', true, 'rightwards arrow'],
+  ['&darr;',    '&#8595;', true, 'downwards arrow'],
+  ['&harr;',    '&#8596;', true, 'left right arrow'],
+  ['&crarr;',   '&#8629;', false,'carriage return'],
+  ['&lArr;',    '&#8656;', false,'leftwards double arrow'],
+  ['&uArr;',    '&#8657;', false,'upwards double arrow'],
+  ['&rArr;',    '&#8658;', false,'rightwards double arrow'],
+  ['&dArr;',    '&#8659;', false,'downwards double arrow'],
+  ['&hArr;',    '&#8660;', false,'left right double arrow'],
+  ['&there4;',  '&#8756;', false,'therefore'],
+  ['&sub;',     '&#8834;', false,'subset of'],
+  ['&sup;',     '&#8835;', false,'superset of'],
+  ['&nsub;',    '&#8836;', false,'not a subset of'],
+  ['&sube;',    '&#8838;', false,'subset of or equal to'],
+  ['&supe;',    '&#8839;', false,'superset of or equal to'],
+  ['&oplus;',   '&#8853;', false,'circled plus'],
+  ['&otimes;',  '&#8855;', false,'circled times'],
+  ['&perp;',    '&#8869;', false,'perpendicular'],
+  ['&sdot;',    '&#8901;', false,'dot operator'],
+  ['&lceil;',   '&#8968;', false,'left ceiling'],
+  ['&rceil;',   '&#8969;', false,'right ceiling'],
+  ['&lfloor;',  '&#8970;', false,'left floor'],
+  ['&rfloor;',  '&#8971;', false,'right floor'],
+  ['&lang;',    '&#9001;', false,'left-pointing angle bracket'],
+  ['&rang;',    '&#9002;', false,'right-pointing angle bracket'],
+  ['&loz;',     '&#9674;', true,'lozenge'],
+  ['&spades;',  '&#9824;', false,'black spade suit'],
+  ['&clubs;',   '&#9827;', true, 'black club suit'],
+  ['&hearts;',  '&#9829;', true, 'black heart suit'],
+  ['&diams;',   '&#9830;', true, 'black diamond suit'],
+  ['&ensp;',    '&#8194;', false,'en space'],
+  ['&emsp;',    '&#8195;', false,'em space'],
+  ['&thinsp;',  '&#8201;', false,'thin space'],
+  ['&zwnj;',    '&#8204;', false,'zero width non-joiner'],
+  ['&zwj;',     '&#8205;', false,'zero width joiner'],
+  ['&lrm;',     '&#8206;', false,'left-to-right mark'],
+  ['&rlm;',     '&#8207;', false,'right-to-left mark'],
+  ['&shy;',     '&#173;',  false,'soft hyphen']
+];
+
+function renderCharMapHTML() {
+  var charsPerRow = 20, tdWidth=20, tdHeight=20;
+  var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
+  var cols=-1;
+  for (var i=0; i<charmap.length; i++) {
+    if (charmap[i][2]==true) {
+      cols++;
+      html += ''
+        + '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"'
+        + ' onmouseover="this.className=\'charmapOver\';'
+        + 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');"'
+        + ' onmouseout="this.className=\'charmap\';"'
+        + ' nowrap="nowrap" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');"><a style="text-decoration: none;" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
+        + charmap[i][1]
+        + '</a></td>';
+      if ((cols+1) % charsPerRow == 0)
+        html += '</tr><tr height="' + tdHeight + '">';
+    }
+   }
+  if (cols % charsPerRow > 0) {
+    var padd = charsPerRow - (cols % charsPerRow);
+    for (var i=0; i<padd-1; i++)
+      html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap">&nbsp;</td>';
+  }
+  html += '</tr></table>';
+  document.write(html);
+}
+
+function insertChar(chr) {
+  tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');
+
+  // Refocus in window
+  if (tinyMCEPopup.isWindow)
+    window.focus();
+
+  tinyMCEPopup.close();
+}
+
+function previewChar(codeA, codeB, codeN) {
+  var elmA = document.getElementById('codeA');
+  var elmB = document.getElementById('codeB');
+  var elmV = document.getElementById('codeV');
+  var elmN = document.getElementById('codeN');
+
+  if (codeA=='#160;') {
+    elmV.innerHTML = '__';
+  } else {
+    elmV.innerHTML = '&' + codeA;
+  }
+
+  elmB.innerHTML = '&amp;' + codeA;
+  elmA.innerHTML = '&amp;' + codeB;
+  elmN.innerHTML = codeN;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/color_picker.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/color_picker.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/color_picker.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+function init() {
+  if (tinyMCE.isMSIE)
+    tinyMCEPopup.resizeToInnerSize();
+}
+
+function selectColor() {
+  var color = document.getElementById("selectedColorBox").value;
+
+  tinyMCEPopup.execCommand(tinyMCE.getWindowArg('command'), false, color);
+  tinyMCEPopup.close();
+}
+
+function showColor(color) {
+  document.getElementById("selectedColor").style.backgroundColor = color;
+  document.getElementById("selectedColorBox").value = color;
+}
+
+var colors = new Array(
+  "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
+  "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
+  "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
+  "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
+  "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
+  "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
+  "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
+  "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
+  "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
+  "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
+  "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
+  "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
+  "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
+  "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
+  "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
+  "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
+  "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
+  "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
+  "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
+  "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
+  "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
+  "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
+  "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
+  "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
+  "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
+  "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
+  "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
+);
+
+function convertRGBToHex(col) {
+  var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+  var rgb = col.replace(re, "$1,$2,$3").split(',');
+  if (rgb.length == 3) {
+    r = parseInt(rgb[0]).toString(16);
+    g = parseInt(rgb[1]).toString(16);
+    b = parseInt(rgb[2]).toString(16);
+
+    r = r.length == 1 ? '0' + r : r;
+    g = g.length == 1 ? '0' + g : g;
+    b = b.length == 1 ? '0' + b : b;
+
+    return "#" + r + g + b;
+  }
+
+  return col;
+}
+
+function convertHexToRGB(col) {
+  if (col.indexOf('#') != -1) {
+    col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+    r = parseInt(col.substring(0, 2), 16);
+    g = parseInt(col.substring(2, 4), 16);
+    b = parseInt(col.substring(4, 6), 16);
+
+    return "rgb(" + r + "," + g + "," + b + ")";
+  }
+
+  return col;
+}
+
+function renderColorMap() {
+  var html = "";
+  var inputColor = convertRGBToHex(tinyMCE.getWindowArg('input_color'));
+
+  html += '<table border="0" cellspacing="1" cellpadding="0">'
+    + '<tr>';
+  for (var i=0; i<colors.length; i++) {
+    html += '<td bgcolor="' + colors[i] + '">'
+      + '<a href="javascript:selectColor();" onfocus="showColor(\'' + colors[i] +  '\');" onmouseover="showColor(\'' + colors[i] +  '\');">'
+      + '<img border="0" src="images/spacer.gif" width="10" height="10" title="' + colors[i] +  '" alt="' + colors[i] +  '" /></a></td>';
+    if ((i+1) % 18 == 0)
+      html += '</tr><tr>';
+  }
+  html += '<tr><td colspan="18">'
+    + '<table width="100%" border="0" cellspacing="0" cellpadding="0">'
+    + '<tr><td>'
+    + '<img id="selectedColor" style="background-color:' + tinyMCE.getWindowArg('input_color') + '" border="0" src="images/spacer.gif" width="80" height="16" />'
+    + '</td><td align="right">'
+    + '<input id="selectedColorBox" name="selectedColorBox" type="text" size="7" maxlength="7" style="width:65px" value="' + inputColor + '" />'
+    + '</td></tr>'
+    + '</table>'
+    + '<div style="float: left"><input type="button" id="insert" name="insert" value="{$lang_theme_colorpicker_apply}" style="margin-top:3px" onclick="selectColor();"></div>'
+    + '<div style="float: right"><input type="button" name="cancel" value="{$lang_cancel}" style="margin-top:3px" onclick="tinyMCEPopup.close();" id="cancel" /></div>'
+    + '</td></tr>'
+    + '</table>';
+
+  document.write(html);
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/image.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/image.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/image.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+var url = tinyMCE.getParam("external_image_list_url");
+if (url != null) {
+  // Fix relative
+  if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+    url = tinyMCE.documentBasePath + "/" + url;
+
+  document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+}
+
+function insertImage() {
+  var src = document.forms[0].src.value;
+  var alt = document.forms[0].alt.value;
+  var border = document.forms[0].border.value;
+  var vspace = document.forms[0].vspace.value;
+  var hspace = document.forms[0].hspace.value;
+  var width = document.forms[0].width.value;
+  var height = document.forms[0].height.value;
+  var align = document.forms[0].align.options[document.forms[0].align.selectedIndex].value;
+
+  tinyMCEPopup.restoreSelection();
+  tinyMCE.themes['advanced']._insertImage(src, alt, border, hspace, vspace, width, height, align);
+  tinyMCEPopup.close();
+}
+
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
+
+  var formObj = document.forms[0];
+
+  for (var i=0; i<document.forms[0].align.options.length; i++) {
+    if (document.forms[0].align.options[i].value == tinyMCE.getWindowArg('align'))
+      document.forms[0].align.options.selectedIndex = i;
+  }
+
+  formObj.src.value = tinyMCE.getWindowArg('src');
+  formObj.alt.value = tinyMCE.getWindowArg('alt');
+  formObj.border.value = tinyMCE.getWindowArg('border');
+  formObj.vspace.value = tinyMCE.getWindowArg('vspace');
+  formObj.hspace.value = tinyMCE.getWindowArg('hspace');
+  formObj.width.value = tinyMCE.getWindowArg('width');
+  formObj.height.value = tinyMCE.getWindowArg('height');
+  formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); 
+
+  // Handle file browser
+  if (isVisible('srcbrowser'))
+    document.getElementById('src').style.width = '180px';
+
+  // Auto select image in list
+  if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
+    for (var i=0; i<formObj.image_list.length; i++) {
+      if (formObj.image_list.options[i].value == tinyMCE.getWindowArg('src'))
+        formObj.image_list.options[i].selected = true;
+    }
+  }
+}
+
+var preloadImg = new Image();
+
+function resetImageData() {
+  var formObj = document.forms[0];
+  formObj.width.value = formObj.height.value = "";  
+}
+
+function updateImageData() {
+  var formObj = document.forms[0];
+
+  if (formObj.width.value == "")
+    formObj.width.value = preloadImg.width;
+
+  if (formObj.height.value == "")
+    formObj.height.value = preloadImg.height;
+}
+
+function getImageData() {
+  preloadImg = new Image();
+  tinyMCE.addEvent(preloadImg, "load", updateImageData);
+  tinyMCE.addEvent(preloadImg, "error", function () {var formObj = document.forms[0];formObj.width.value = formObj.height.value = "";});
+  preloadImg.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], document.forms[0].src.value);
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/link.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/link.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/link.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+var url = tinyMCE.getParam("external_link_list_url");
+if (url != null) {
+  // Fix relative
+  if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+    url = tinyMCE.documentBasePath + "/" + url;
+
+  document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+}
+
+function init() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','theme_advanced_link');
+
+  // Handle file browser
+  if (isVisible('hrefbrowser'))
+    document.getElementById('href').style.width = '180px';
+
+  var formObj = document.forms[0];
+
+  for (var i=0; i<document.forms[0].target.options.length; i++) {
+    var option = document.forms[0].target.options[i];
+
+    if (option.value == tinyMCE.getWindowArg('target'))
+      option.selected = true;
+  }
+
+  document.forms[0].href.value = tinyMCE.getWindowArg('href');
+  document.forms[0].linktitle.value = tinyMCE.getWindowArg('title');
+  document.forms[0].insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); 
+
+  addClassesToList('styleSelect', 'theme_advanced_link_styles');
+  selectByValue(formObj, 'styleSelect', tinyMCE.getWindowArg('className'), true);
+
+  // Hide css select row if no CSS classes
+  if (formObj.styleSelect && formObj.styleSelect.options.length <= 1) {
+    var sr = document.getElementById('styleSelectRow');
+    sr.style.display = 'none';
+    sr.parentNode.removeChild(sr);
+  }
+
+  // Auto select link in list
+  if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0) {
+    var formObj = document.forms[0];
+
+    for (var i=0; i<formObj.link_list.length; i++) {
+      if (formObj.link_list.options[i].value == tinyMCE.getWindowArg('href'))
+        formObj.link_list.options[i].selected = true;
+    }
+  }
+}
+
+function insertLink() {
+  var href = document.forms[0].href.value;
+  var target = document.forms[0].target.options[document.forms[0].target.selectedIndex].value;
+  var title = document.forms[0].linktitle.value;
+  var style_class = document.forms[0].styleSelect ? document.forms[0].styleSelect.value : "";
+  var dummy;
+
+  // Make anchors absolute
+  if (href.charAt(0) == '#')
+    href = tinyMCE.settings['document_base_url'] + href;
+
+  if (target == '_self')
+    target = '';
+
+  tinyMCEPopup.restoreSelection();
+  tinyMCE.themes['advanced']._insertLink(href, target, title, dummy, style_class);
+  tinyMCEPopup.close();
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/source_editor.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/source_editor.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/jscripts/source_editor.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+function saveContent() {
+  tinyMCE.setContent(document.getElementById('htmlSource').value);
+  tinyMCE.closeWindow(window);
+}
+
+// Fixes some charcode issues
+function fixContent(html) {
+/*  html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1');
+  html = html.replace(new RegExp('<\/(p|ol|ul|li|table|tr|td|blockquote|object)>', 'gi'),'</$1>\n');
+  html = tinyMCE.regexpReplace(html, '<br />','<br />\n','gi');
+  html = tinyMCE.regexpReplace(html, '\n\n','\n','gi');*/
+  return html;
+}
+
+function onLoadInit() {
+  tinyMCEPopup.resizeToInnerSize();
+
+  document.forms[0].htmlSource.value = fixContent(tinyMCE.getContent(tinyMCE.getWindowArg('editor_id')));
+  resizeInputs();
+
+  if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
+    setWrap('soft');
+    document.forms[0].wraped.checked = true;
+  }
+}
+
+function setWrap(val) {
+  var s = document.forms[0].htmlSource;
+
+  s.wrap = val;
+
+  if (tinyMCE.isGecko) {
+    var v = s.value;
+    var n = s.cloneNode(false);
+    n.setAttribute("wrap", val);
+    s.parentNode.replaceChild(n, s);
+    n.value = v;
+  }
+}
+
+function toggleWordWrap(elm) {
+  if (elm.checked)
+    setWrap('soft');
+  else
+    setWrap('off');
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function resizeInputs() {
+  if (!tinyMCE.isMSIE) {
+     wHeight = self.innerHeight-80;
+     wWidth = self.innerWidth-16;
+  } else {
+     wHeight = document.body.clientHeight - 80;
+     wWidth = document.body.clientWidth - 16;
+  }
+
+  document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
+  document.forms[0].htmlSource.style.width  = Math.abs(wWidth) + 'px';
+}
+
+function renderWordWrap() {
+  if (tinyMCE.isMSIE || tinyMCE.isGecko)
+    document.write('<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{$lang_theme_code_wordwrap}</label>');
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/langs/en.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/langs/en.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/langs/en.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+theme_style_select : '-- Styles --',
+theme_code_desc : 'Edit HTML Source',
+theme_code_title : 'HTML Source Editor',
+theme_code_wordwrap : 'Word wrap',
+theme_sub_desc : 'Subscript',
+theme_sup_desc : 'Superscript',
+theme_hr_desc : 'Insert horizontal ruler',
+theme_removeformat_desc : 'Remove formatting',
+theme_custom1_desc : 'Your custom description here',
+insert_image_border : 'Border',
+insert_image_dimensions : 'Dimensions',
+insert_image_vspace : 'Vertical space',
+insert_image_hspace : 'Horizontal space',
+insert_image_align : 'Alignment',
+insert_image_align_default : '-- Not set --',
+insert_image_align_baseline : 'Baseline',
+insert_image_align_top : 'Top',
+insert_image_align_middle : 'Middle',
+insert_image_align_bottom : 'Bottom',
+insert_image_align_texttop : 'TextTop',
+insert_image_align_absmiddle : 'Absolute Middle',
+insert_image_align_absbottom : 'Absolute Bottom',
+insert_image_align_left : 'Left',
+insert_image_align_right : 'Right',
+theme_font_size : '-- Font size --',
+theme_fontdefault : '-- Font family --',
+theme_block : '-- Format --',
+theme_paragraph : 'Paragraph',
+theme_div : 'Div',
+theme_address : 'Address',
+theme_pre : 'Preformatted',
+theme_h1 : 'Heading 1',
+theme_h2 : 'Heading 2',
+theme_h3 : 'Heading 3',
+theme_h4 : 'Heading 4',
+theme_h5 : 'Heading 5',
+theme_h6 : 'Heading 6',
+theme_blockquote : 'Blockquote',
+theme_code : 'Code',
+theme_samp : 'Code sample',
+theme_dt : 'Definition term ',
+theme_dd : 'Definition description',
+theme_colorpicker_title : 'Select a color',
+theme_colorpicker_apply : 'Apply',
+theme_forecolor_desc : 'Select text color',
+theme_backcolor_desc : 'Select background color',
+theme_charmap_title : 'Select custom character',
+theme_charmap_desc : 'Insert custom character',
+theme_visualaid_desc : 'Toggle guidelines/invisible elements',
+insert_anchor_title : 'Insert/edit anchor',
+insert_anchor_name : 'Anchor name',
+theme_anchor_desc : 'Insert/edit anchor',
+theme_insert_link_titlefield : 'Title',
+theme_clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
+theme_path : 'Path',
+cut_desc : 'Cut',
+copy_desc : 'Copy',
+paste_desc : 'Paste',
+link_list : 'Link list',
+image_list : 'Image list',
+browse : 'Browse',
+image_props_desc : 'Image properties',
+newdocument_desc : 'New document',
+class_name : 'Class',
+newdocument : 'Are you sure you want clear all contents?',
+about_title : 'About TinyMCE',
+about : 'About',
+license : 'License',
+plugins : 'Plugins',
+plugin : 'Plugin',
+author : 'Author',
+version : 'Version',
+loaded_plugins : 'Loaded plugins',
+help : 'Help',
+not_set : '-- Not set --',
+close : 'Close',
+toolbar_focus : 'Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X'
+});

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/link.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/link.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/link.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>{$lang_insert_link_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+  <script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/link.js"></script>
+  <base target="_self" />
+</head>
+<body id="link" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<form onsubmit="insertLink();return false;" action="#">
+  <div class="tabs">
+    <ul>
+      <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_link_title}</a></span></li>
+    </ul>
+  </div>
+
+  <div class="panel_wrapper">
+    <div id="general_panel" class="panel current">
+
+    <table border="0" cellpadding="4" cellspacing="0">
+          <tr>
+            <td nowrap="nowrap"><label for="href">{$lang_insert_link_url}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"> 
+          <tr> 
+          <td><input id="href" name="href" type="text" value="" style="width: 200px" /></td> 
+          <td id="hrefbrowsercontainer">&nbsp;</td>
+          </tr> 
+        </table></td>
+          </tr>
+      <!-- Link list -->
+      <script language="javascript">
+      if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0) {
+        var html = "";
+
+        html += '<tr><td><label for="link_list">{$lang_link_list}</label></td>';
+        html += '<td><select id="link_list" name="link_list" style="width: 200px" onchange="this.form.href.value=this.options[this.selectedIndex].value;">';
+        html += '<option value="">---</option>';
+
+        for (var i=0; i<tinyMCELinkList.length; i++)
+          html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
+
+        html += '</select></td></tr>';
+
+        document.write(html);
+      }
+      </script>
+      <!-- /Link list -->
+          <tr>
+            <td nowrap="nowrap"><label for="target">{$lang_insert_link_target}</label></td>
+            <td><select id="target" name="target" style="width: 200px">
+                <option value="_self">{$lang_insert_link_target_same}</option>
+                <option value="_blank">{$lang_insert_link_target_blank}</option>
+        <script language="javascript">
+          var html = "";
+          var targets = tinyMCE.getParam('theme_advanced_link_targets', '').split(';');
+
+          for (var i=0; i<targets.length; i++) {
+            var key, value;
+
+            if (targets[i] == "")
+              continue;
+
+            key = targets[i].split('=')[0];
+            value = targets[i].split('=')[1];
+
+            html += '<option value="' + value + '">' + key + '</option>';
+          }
+
+          document.write(html);
+        </script>
+            </select></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="linktitle">{$lang_theme_insert_link_titlefield}</label></td>
+            <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px"></td>
+          </tr>
+          <tr id="styleSelectRow">
+            <td><label for="styleSelect">{$lang_class_name}</label></td>
+            <td>
+       <select id="styleSelect" name="styleSelect">
+                <option value="" selected>{$lang_theme_style_select}</option>
+             </select></td>
+          </tr>
+        </table>
+    </div>
+  </div>
+
+  <div class="mceActionPanel">
+    <div style="float: left">
+      <input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertLink();" />
+    </div>
+
+    <div style="float: right">
+      <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+    </div>
+  </div>
+</form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/source_editor.htm
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/source_editor.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/themes/advanced/source_editor.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <title>{$lang_theme_code_title}</title>
+  <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+  <script language="javascript" type="text/javascript" src="jscripts/source_editor.js"></script>
+  <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('onLoadInit();');" onresize="resizeInputs();" style="display: none">
+  <form name="source" onsubmit="saveContent();" action="#">
+    <div style="float: left" class="title">{$lang_theme_code_title}</div>
+
+    <div style="float: right">
+      <script language="javascript" type="text/javascript">renderWordWrap();</script>
+    </div>
+
+    <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px" dir="ltr" wrap="off"></textarea>
+
+    <div class="mceActionPanel">
+      <div style="float: left">
+        <input type="button" name="insert" value="{$lang_update}" onclick="saveContent();" id="insert" />
+      </div>
+
+      <div style="float: right">
+        <input type="button" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+      </div>
+    </div>
+  </form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+function TinyMCE_Engine(){this.majorVersion="2";this.minorVersion="0.6.1";this.releaseDate="2006-05-04";this.instances=new Array();this.switchClassCache=new Array();this.windowArgs=new Array();this.loadedFiles=new Array();this.pendingFiles=new Array();this.loadingIndex=0;this.configs=new Array();this.currentConfig=0;this.eventHandlers=new Array();var ua=navigator.userAgent;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(ua.indexOf('MSIE 5')!=-1);this.isMSIE5_0=this.isMSIE&&(ua.indexOf('MSIE 5.0')!=-1);this.isGecko=ua.indexOf('Gecko')!=-1;this.isSafari=ua.indexOf('Safari')!=-1;this.isOpera=ua.indexOf('Opera')!=-1;this.isMac=ua.indexOf('Mac')!=-1;this.isNS7=ua.indexOf('Netscape/7')!=-1;this.isNS71=ua.indexOf('Netscape/7.1')!=-1;this.dialogCounter=0;this.plugins=new Array();this.themes=new Array();this.menus=new Array();this.loadedPlugins=new Array();this.buttonMap=new Array();this.isLoaded=false;if(this.isOpera){this.isMSIE=true;this.isGecko=false;this.isSafari=false;}this.idCounter=0;};TinyMCE_Engine.prototype={init:function(settings){var theme;this.settings=settings;if(typeof(document.execCommand)=='undefined')return;if(!tinyMCE.baseURL){var elements=document.getElementsByTagName('script');for(var i=0;i<elements.length;i++){if(elements[i].src&&(elements[i].src.indexOf("tiny_mce.js")!=-1||elements[i].src.indexOf("tiny_mce_dev.js")!=-1||elements[i].src.indexOf("tiny_mce_src.js")!=-1||elements[i].src.indexOf("tiny_mce_gzip")!=-1)){var src=elements[i].src;tinyMCE.srcMode=(src.indexOf('_src')!=-1||src.indexOf('_dev')!=-1)?'_src':'';tinyMCE.gzipMode=src.indexOf('_gzip')!=-1;src=src.substring(0,src.lastIndexOf('/'));if(settings.exec_mode=="src"||settings.exec_mode=="normal")tinyMCE.srcMode=settings.exec_mode=="src"?'_src':'';tinyMCE.baseURL=src;break;}}}this.documentBasePath=document.location.href;if(this.documentBasePath.indexOf('?')!=-1)this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.indexOf('?'));this.documentURL=this.documentBasePath;this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.lastIndexOf('/'));if(tinyMCE.baseURL.indexOf('://')==-1&&tinyMCE.baseURL.charAt(0)!='/'){tinyMCE.baseURL=this.documentBasePath+"/"+tinyMCE.baseURL;}this._def("mode","none");this._def("theme","advanced");this._def("plugins","",true);this._def("language","en");this._def("docs_language",this.settings['language']);this._def("elements","");this._def("textarea_trigger","mce_editable");this._def("editor_selector","");this._def("editor_deselector","mceNoEditor");this._def("valid_elements","+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang]");this._def("extended_valid_elements","");this._def("invalid_elements","");this._def("encoding","");this._def("urlconverter_callback",tinyMCE.getParam("urlconvertor_callback","TinyMCE_Engine.prototype.convertURL"));this._def("save_callback","");this._def("debug",false);this._def("force_br_newlines",false);this._def("force_p_newlines",true);this._def("add_form_submit_trigger",true);this._def("relative_urls",true);this._def("remove_script_host",true);this._def("focus_alert",true);this._def("document_base_url",this.documentURL);this._def("visual",true);this._def("visual_table_class","mceVisualAid");this._def("setupcontent_callback","");this._def("fix_content_duplication",true);this._def("custom_undo_redo",true);this._def("custom_undo_redo_levels",-1);this._def("custom_undo_redo_keyboard_shortcuts",true);this._def("custom_undo_redo_restore_selection",true);this._def("verify_html",true);this._def("apply_source_formatting",false);this._def("directionality","ltr");this._def("cleanup_on_startup",false);this._def("inline_styles",false);this._def("convert_newlines_to_brs",false);this._def("auto_reset_designmode",true);this._def("entities","39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",true);this._def("entity_encoding","named");this._def("cleanup_callback","");this._def("add_unload_trigger",true);this._def("ask",false);this._def("nowrap",false);this._def("auto_resize",false);this._def("auto_focus",false);this._def("cleanup",true);this._def("remove_linebreaks",true);this._def("button_tile_map",false);this._def("submit_patch",true);this._def("browsers","msie,safari,gecko,opera",true);this._def("dialog_type","window");this._def("accessibility_warnings",true);this._def("accessibility_focus",true);this._def("merge_styles_invalid_parents","");this._def("force_hex_style_colors",true);this._def("trim_span_elements",true);this._def("convert_fonts_to_spans",false);this._def("doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');this._def("font_size_classes",'');this._def("font_size_style_values",'xx-small,x-small,small,medium,large,x-large,xx-large',true);this._def("event_elements",'a,img',true);this._def("convert_urls",true);this._def("table_inline_editing",false);this._def("object_resizing",true);this._def("custom_shortcuts",true);this._def("convert_on_click",false);this._def("content_css",'');this._def("fix_list_elements",false);this._def("fix_table_elements",false);this._def("strict_loading_mode",document.contentType=='application/xhtml+xml');this._def("hidden_tab_class",'');this._def("display_tab_class",'');if(this.isMSIE&&!this.isOpera)this.settings.strict_loading_mode=false;if(this.isMSIE&&this.settings['browsers'].indexOf('msie')==-1)return;if(this.isGecko&&this.settings['browsers'].indexOf('gecko')==-1)return;if(this.isSafari&&this.settings['browsers'].indexOf('safari')==-1)return;if(this.isOpera&&this.settings['browsers'].indexOf('opera')==-1)return;var baseHREF=tinyMCE.settings['document_base_url'];var h=document.location.href;var p=h.indexOf('://');if(p>0&&document.location.protocol!="file:"){p=h.indexOf('/',p+3);h=h.substring(0,p);if(baseHREF.indexOf('://')==-1)baseHREF=h+baseHREF;tinyMCE.settings['document_base_url']=baseHREF;tinyMCE.settings['document_base_prefix']=h;}if(baseHREF.indexOf('?')!=-1)baseHREF=baseHREF.substring(0,baseHREF.indexOf('?'));this.settings['base_href']=baseHREF.substring(0,baseHREF.lastIndexOf('/'))+"/";theme=this.settings['theme'];this.blockRegExp=new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dt|dd|dir|fieldset|form|noscript|noframes|menu|isindex|samp)$","i");this.posKeyCodes=new Array(13,45,36,35,33,34,37,38,39,40);this.uniqueURL='javascript:TINYMCE_UNIQUEURL();';this.uniqueTag='<div id="mceTMPElement" style="display: none">TMP</div>';this.callbacks=new Array('onInit','getInfo','getEditorTemplate','setupContent','onChange','onPageLoad','handleNodeChange','initInstance','execCommand','getControlHTML','handleEvent','cleanup');this.settings['theme_href']=tinyMCE.baseURL+"/themes/"+theme;if(!tinyMCE.isMSIE)this.settings['force_br_newlines']=false;if(tinyMCE.getParam("popups_css",false)){var cssPath=tinyMCE.getParam("popups_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['popups_css']=this.documentBasePath+"/"+cssPath;else this.settings['popups_css']=cssPath;}else this.settings['popups_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_popup.css";if(tinyMCE.getParam("editor_css",false)){var cssPath=tinyMCE.getParam("editor_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['editor_css']=this.documentBasePath+"/"+cssPath;else this.settings['editor_css']=cssPath;}else this.settings['editor_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_ui.css";if(tinyMCE.settings['debug']){var msg="Debug: \n";msg+="baseURL: "+this.baseURL+"\n";msg+="documentBasePath: "+this.documentBasePath+"\n";msg+="content_css: "+this.settings['content_css']+"\n";msg+="popups_css: "+this.settings['popups_css']+"\n";msg+="editor_css: "+this.settings['editor_css']+"\n";alert(msg);}if(this.configs.length==0){if(this.isSafari&&this.getParam('safari_warning',false))alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false");if(typeof(TinyMCECompressed)=="undefined"){tinyMCE.addEvent(window,"DOMContentLoaded",TinyMCE_Engine.prototype.onLoad);if(tinyMCE.isMSIE&&!tinyMCE.isOpera){if(document.body)tinyMCE.addEvent(document.body,"readystatechange",TinyMCE_Engine.prototype.onLoad);else tinyMCE.addEvent(document,"readystatechange",TinyMCE_Engine.prototype.onLoad);}tinyMCE.addEvent(window,"load",TinyMCE_Engine.prototype.onLoad);tinyMCE._addUnloadEvents();}}this.loadScript(tinyMCE.baseURL+'/themes/'+this.settings['theme']+'/editor_template'+tinyMCE.srcMode+'.js');this.loadScript(tinyMCE.baseURL+'/langs/'+this.settings['language']+'.js');this.loadCSS(this.settings['editor_css']);var p=tinyMCE.getParam('plugins','',true,',');if(p.length>0){for(var i=0;i<p.length;i++){if(p[i].charAt(0)!='-')this.loadScript(tinyMCE.baseURL+'/plugins/'+p[i]+'/editor_plugin'+tinyMCE.srcMode+'.js');}}settings['cleanup_entities']=new Array();var entities=tinyMCE.getParam('entities','',true,',');for(var i=0;i<entities.length;i+=2)settings['cleanup_entities']['c'+entities[i]]=entities[i+1];settings['index']=this.configs.length;this.configs[this.configs.length]=settings;this.loadNextScript();},_addUnloadEvents:function(){if(tinyMCE.isMSIE){if(tinyMCE.settings['add_unload_trigger']){tinyMCE.addEvent(window,"unload",TinyMCE_Engine.prototype.unloadHandler);tinyMCE.addEvent(window.document,"beforeunload",TinyMCE_Engine.prototype.unloadHandler);}}else{if(tinyMCE.settings['add_unload_trigger'])tinyMCE.addEvent(window,"unload",function(){tinyMCE.triggerSave(true,true);});}},_def:function(key,def_val,t){var v=tinyMCE.getParam(key,def_val);v=t?v.replace(/\s+/g,""):v;this.settings[key]=v;},hasPlugin:function(n){return typeof(this.plugins[n])!="undefined"&&this.plugins[n]!=null;},addPlugin:function(n,p){var op=this.plugins[n];p.baseURL=op?op.baseURL:tinyMCE.baseURL+"/plugins/"+n;this.plugins[n]=p;this.loadNextScript();},setPluginBaseURL:function(n,u){var op=this.plugins[n];if(op)op.baseURL=u;else this.plugins[n]={baseURL:u};},loadPlugin:function(n,u){u=u.indexOf('.js')!=-1?u.substring(0,u.lastIndexOf('/')):u;u=u.charAt(u.length-1)=='/'?u.substring(0,u.length-1):u;this.plugins[n]={baseURL:u};this.loadScript(u+"/editor_plugin"+(tinyMCE.srcMode?'_src':'')+".js");},hasTheme:function(n){return typeof(this.themes[n])!="undefined"&&this.themes[n]!=null;},addTheme:function(n,t){this.themes[n]=t;this.loadNextScript();},addMenu:function(n,m){this.menus[n]=m;},hasMenu:function(n){return typeof(this.plugins[n])!="undefined"&&this.plugins[n]!=null;},loadScript:function(url){var i;for(i=0;i<this.loadedFiles.length;i++){if(this.loadedFiles[i]==url)return;}if(tinyMCE.settings.strict_loading_mode)this.pendingFiles[this.pendingFiles.length]=url;else document.write('<sc'+'ript language="javascript" type="text/javascript" src="'+url+'"></script>');this.loadedFiles[this.loadedFiles.length]=url;},loadNextScript:function(){var d=document,se;if(!tinyMCE.settings.strict_loading_mode)return;if(this.loadingIndex<this.pendingFiles.length){se=d.createElementNS('http://www.w3.org/1999/xhtml','script');se.setAttribute('language','javascript');se.setAttribute('type','text/javascript');se.setAttribute('src',this.pendingFiles[this.loadingIndex++]);d.getElementsByTagName("head")[0].appendChild(se);}else this.loadingIndex=-1;},loadCSS:function(url){var ar=url.replace(/\s+/,'').split(',');var lflen=0,csslen=0;var skip=false;var x=0,i=0,nl,le;for(x=0,csslen=ar.length;x<csslen;x++){ignore_css=false;if(ar[x]!=null&&ar[x]!='null'&&ar[x].length>0){for(i=0,lflen=this.loadedFiles.length;i<lflen;i++){if(this.loadedFiles[i]==ar[x]){skip=true;break;}}if(!skip){if(tinyMCE.settings.strict_loading_mode){nl=document.getElementsByTagName("head");le=document.createElement('link');le.setAttribute('href',ar[x]);le.setAttribute('rel','stylesheet');le.setAttribute('type','text/css');nl[0].appendChild(le);}else document.write('<link href="'+ar[x]+'" rel="stylesheet" type="text/css" />');this.loadedFiles[this.loadedFiles.length]=ar[x];}}}},importCSS:function(doc,css){var css_ary=css.replace(/\s+/,'').split(',');var csslen,elm,headArr,x,css_file;for(x=0,csslen=css_ary.length;x<csslen;x++){css_file=css_ary[x];if(css_file!=null&&css_file!='null'&&css_file.length>0){if(css_file.indexOf('://')==-1&&css_file.charAt(0)!='/')css_file=this.documentBasePath+"/"+css_file;if(typeof(doc.createStyleSheet)=="undefined"){elm=doc.createElement("link");elm.rel="stylesheet";elm.href=css_file;if((headArr=doc.getElementsByTagName("head"))!=null&&headArr.length>0)headArr[0].appendChild(elm);}else doc.createStyleSheet(css_file);}}},confirmAdd:function(e,settings){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var elementId=elm.name?elm.name:elm.id;tinyMCE.settings=settings;if(tinyMCE.settings['convert_on_click']||(!elm.getAttribute('mce_noask')&&confirm(tinyMCELang['lang_edit_confirm'])))tinyMCE.addMCEControl(elm,elementId);elm.setAttribute('mce_noask','true');},updateContent:function(form_element_name){var formElement=document.getElementById(form_element_name);for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();if(inst.formElement==formElement){var doc=inst.getDoc();tinyMCE._setHTML(doc,inst.formElement.value);if(!tinyMCE.isMSIE)doc.body.innerHTML=tinyMCE._cleanupHTML(inst,doc,this.settings,doc.body,inst.visualAid);}}},addMCEControl:function(replace_element,form_element_name,target_document){var id="mce_editor_"+tinyMCE.idCounter++;var inst=new TinyMCE_Control(tinyMCE.settings);inst.editorId=id;this.instances[id]=inst;inst._onAdd(replace_element,form_element_name,target_document);},removeMCEControl:function(editor_id){var inst=tinyMCE.getInstanceById(editor_id);if(inst){inst.switchSettings();editor_id=inst.editorId;var html=tinyMCE.getContent(editor_id);var tmpInstances=new Array();for(var instanceName in tinyMCE.instances){var instance=tinyMCE.instances[instanceName];if(!tinyMCE.isInstance(instance))continue;if(instanceName!=editor_id)tmpInstances[instanceName]=instance;}tinyMCE.instances=tmpInstances;tinyMCE.selectedElement=null;tinyMCE.selectedInstance=null;var replaceElement=document.getElementById(editor_id+"_parent");var oldTargetElement=inst.oldTargetElement;var targetName=oldTargetElement.nodeName.toLowerCase();if(targetName=="textarea"||targetName=="input"){replaceElement.parentNode.removeChild(replaceElement);oldTargetElement.style.display="inline";oldTargetElement.value=html;}else{oldTargetElement.innerHTML=html;oldTargetElement.style.display='block';replaceElement.parentNode.insertBefore(oldTargetElement,replaceElement);replaceElement.parentNode.removeChild(replaceElement);}}},triggerSave:function(skip_cleanup,skip_callback){var inst,n;if(typeof(skip_cleanup)=="undefined")skip_cleanup=false;if(typeof(skip_callback)=="undefined")skip_callback=false;for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.triggerSave(skip_cleanup,skip_callback);}},resetForm:function(form_index){var i,inst,n,formObj=document.forms[form_index];for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();for(i=0;i<formObj.elements.length;i++){if(inst.formTargetElementId==formObj.elements[i].name)inst.getBody().innerHTML=inst.startContent;}}},execInstanceCommand:function(editor_id,command,user_interface,value,focus){var inst=tinyMCE.getInstanceById(editor_id);if(inst){if(typeof(focus)=="undefined")focus=true;if(focus)inst.contentWindow.focus();inst.autoResetDesignMode();this.selectedElement=inst.getFocusElement();this.selectedInstance=inst;tinyMCE.execCommand(command,user_interface,value);if(tinyMCE.isMSIE&&window.event!=null)tinyMCE.cancelEvent(window.event);}},execCommand:function(command,user_interface,value){user_interface=user_interface?user_interface:false;value=value?value:null;if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();switch(command){case'mceHelp':tinyMCE.openWindow({file:'about.htm',width:480,height:380},{tinymce_version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion,tinymce_releasedate:tinyMCE.releaseDate,inline:"yes"});return;case'mceFocus':var inst=tinyMCE.getInstanceById(value);if(inst)inst.contentWindow.focus();return;case"mceAddControl":case"mceAddEditor":tinyMCE.addMCEControl(tinyMCE._getElementById(value),value);return;case"mceAddFrameControl":tinyMCE.addMCEControl(tinyMCE._getElementById(value['element'],value['document']),value['element'],value['document']);return;case"mceRemoveControl":case"mceRemoveEditor":tinyMCE.removeMCEControl(value);return;case"mceResetDesignMode":if(!tinyMCE.isMSIE){for(var n in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[n]))continue;try{tinyMCE.instances[n].getDoc().designMode="on";}catch(e){}}}return;}if(this.selectedInstance){this.selectedInstance.execCommand(command,user_interface,value);}else if(tinyMCE.settings['focus_alert'])alert(tinyMCELang['lang_focus_alert']);},_createIFrame:function(replace_element,doc,win){var iframe,id=replace_element.getAttribute("id");var aw,ah;if(typeof(doc)=="undefined")doc=document;if(typeof(win)=="undefined")win=window;iframe=doc.createElement("iframe");aw=""+tinyMCE.settings['area_width'];ah=""+tinyMCE.settings['area_height'];if(aw.indexOf('%')==-1){aw=parseInt(aw);aw=aw<0?300:aw;aw=aw+"px";}if(ah.indexOf('%')==-1){ah=parseInt(ah);ah=ah<0?240:ah;ah=ah+"px";}iframe.setAttribute("id",id);iframe.setAttribute("class","mceEditorIframe");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMargin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",aw);iframe.setAttribute("height",ah);iframe.setAttribute("allowtransparency","true");iframe.className='mceEditorIframe';if(tinyMCE.settings["auto_resize"])iframe.setAttribute("scrolling","no");if(tinyMCE.isMSIE&&!tinyMCE.isOpera)iframe.setAttribute("src",this.settings['default_document']);iframe.style.width=aw;iframe.style.height=ah;if(tinyMCE.settings.strict_loading_mode)iframe.style.marginBottom='-5px';if(tinyMCE.isMSIE&&!tinyMCE.isOpera)replace_element.outerHTML=iframe.outerHTML;else replace_element.parentNode.replaceChild(iframe,replace_element);if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return win.frames[id];else return iframe;},setupContent:function(editor_id){var inst=tinyMCE.instances[editor_id];var doc=inst.getDoc();var head=doc.getElementsByTagName('head').item(0);var content=inst.startContent;if(tinyMCE.settings.strict_loading_mode){content=content.replace(/&lt;/g,'<');content=content.replace(/&gt;/g,'>');content=content.replace(/&quot;/g,'"');content=content.replace(/&amp;/g,'&');}inst.switchSettings();if(!tinyMCE.isMSIE&&tinyMCE.getParam("setupcontent_reload",false)&&doc.title!="blank_page"){try{doc.location.href=tinyMCE.baseURL+"/blank.htm";}catch(ex){}window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",1000);return;}if(!head){window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",10);return;}tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/themes/"+inst.settings['theme']+"/css/editor_content.css");tinyMCE.importCSS(inst.getDoc(),inst.settings['content_css']);tinyMCE.dispatchCallback(inst,'init_instance_callback','initInstance',inst);if(tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')){inst.addShortcut('ctrl','z','lang_undo_desc','Undo');inst.addShortcut('ctrl','y','lang_redo_desc','Redo');}if(tinyMCE.isGecko){inst.addShortcut('ctrl','b','lang_bold_desc','Bold');inst.addShortcut('ctrl','i','lang_italic_desc','Italic');inst.addShortcut('ctrl','u','lang_underline_desc','Underline');}if(tinyMCE.getParam("convert_fonts_to_spans"))inst.getDoc().body.setAttribute('id','mceSpanFonts');if(tinyMCE.settings['nowrap'])doc.body.style.whiteSpace="nowrap";doc.body.dir=this.settings['directionality'];doc.editorId=editor_id;if(!tinyMCE.isMSIE)doc.documentElement.editorId=editor_id;inst.setBaseHREF(tinyMCE.settings['base_href']);if(tinyMCE.settings['convert_newlines_to_brs']){content=tinyMCE.regexpReplace(content,"\r\n","<br />","gi");content=tinyMCE.regexpReplace(content,"\r","<br />","gi");content=tinyMCE.regexpReplace(content,"\n","<br />","gi");}content=tinyMCE.storeAwayURLs(content);content=tinyMCE._customCleanup(inst,"insert_to_editor",content);if(tinyMCE.isMSIE){window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["'+editor_id+'"].getDoc(), "'+editor_id+'");}catch(e){}',500);if(tinyMCE.settings["force_br_newlines"])doc.styleSheets[0].addRule("p","margin: 0;");var body=inst.getBody();body.editorId=editor_id;}content=tinyMCE.cleanupHTMLCode(content);if(!tinyMCE.isMSIE){var contentElement=inst.getDoc().createElement("body");var doc=inst.getDoc();contentElement.innerHTML=content;if(tinyMCE.isGecko&&tinyMCE.settings['remove_lt_gt'])content=content.replace(new RegExp('&lt;&gt;','g'),"");if(tinyMCE.settings['cleanup_on_startup'])tinyMCE.setInnerHTML(inst.getBody(),tinyMCE._cleanupHTML(inst,doc,this.settings,contentElement));else{content=tinyMCE.regexpReplace(content,"<strong","<b","gi");content=tinyMCE.regexpReplace(content,"<em(/?)>","<i$1>","gi");content=tinyMCE.regexpReplace(content,"<em ","<i ","gi");content=tinyMCE.regexpReplace(content,"</strong>","</b>","gi");content=tinyMCE.regexpReplace(content,"</em>","</i>","gi");tinyMCE.setInnerHTML(inst.getBody(),content);}tinyMCE.convertAllRelativeURLs(inst.getBody());}else{if(tinyMCE.settings['cleanup_on_startup']){tinyMCE._setHTML(inst.getDoc(),content);eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}');}else tinyMCE._setHTML(inst.getDoc(),content);}var parentElm=inst.targetDoc.getElementById(inst.editorId+'_parent');inst.formElement=tinyMCE.isGecko?parentElm.previousSibling:parentElm.nextSibling;tinyMCE.handleVisualAid(inst.getBody(),true,tinyMCE.settings['visual'],inst);tinyMCE.dispatchCallback(inst,'setupcontent_callback','setupContent',editor_id,inst.getBody(),inst.getDoc());if(!tinyMCE.isMSIE)tinyMCE.addEventHandlers(inst);if(tinyMCE.isMSIE){tinyMCE.addEvent(inst.getBody(),"blur",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(inst.getBody(),"beforedeactivate",TinyMCE_Engine.prototype._eventPatch);if(!tinyMCE.isOpera){tinyMCE.addEvent(doc.body,"mousemove",TinyMCE_Engine.prototype.onMouseMove);tinyMCE.addEvent(doc.body,"beforepaste",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc.body,"drop",TinyMCE_Engine.prototype._eventPatch);}}tinyMCE.selectedInstance=inst;tinyMCE.selectedElement=inst.contentWindow.document.body;tinyMCE._customCleanup(inst,"insert_to_editor_dom",inst.getBody());tinyMCE._customCleanup(inst,"setup_content_dom",inst.getBody());tinyMCE._setEventsEnabled(inst.getBody(),false);tinyMCE.cleanupAnchors(inst.getDoc());if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(inst.getDoc());inst.startContent=tinyMCE.trim(inst.getBody().innerHTML);inst.undoRedo.add({content:inst.startContent});if(tinyMCE.isGecko){tinyMCE.selectNodes(inst.getBody(),function(n){if(n.nodeType==3||n.nodeType==8){n.nodeValue=n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"','gi'),"");n.nodeValue=n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"','gi'),"");}return false;});}tinyMCE._removeInternal(inst.getBody());tinyMCE.selectedInstance=inst;tinyMCE.triggerNodeChange(false,true);},storeAwayURLs:function(s){if(!s.match(/(mce_src|mce_href)/gi,s)){s=s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"','gi'),'src="$1" mce_src="$1"');s=s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"','gi'),'href="$1" mce_href="$1"');}return s;},_removeInternal:function(n){if(tinyMCE.isGecko){tinyMCE.selectNodes(n,function(n){if(n.nodeType==3||n.nodeType==8){n.nodeValue=n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"','gi'),"");n.nodeValue=n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"','gi'),"");}return false;});}},removeTinyMCEFormElements:function(form_obj){if(typeof(form_obj)=="undefined"||form_obj==null)return;if(form_obj.nodeName!="FORM"){if(form_obj.form)form_obj=form_obj.form;else form_obj=tinyMCE.getParentElement(form_obj,"form");}if(form_obj==null)return;for(var i=0;i<form_obj.elements.length;i++){var elementId=form_obj.elements[i].name?form_obj.elements[i].name:form_obj.elements[i].id;if(elementId.indexOf('mce_editor_')==0)form_obj.elements[i].disabled=true;}},handleEvent:function(e){var inst=tinyMCE.selectedInstance;if(typeof(tinyMCE)=="undefined")return true;if(tinyMCE.executeCallback(tinyMCE.selectedInstance,'handle_event_callback','handleEvent',e))return false;switch(e.type){case"beforedeactivate":case"blur":if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.execCommand('mceEndTyping');tinyMCE.hideMenus();return;case"drop":case"beforepaste":if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.setBaseHREF(null);if(tinyMCE.isMSIE&&!tinyMCE.isOpera){var ife=tinyMCE.selectedInstance.iframeElement;if(ife.style.height.indexOf('%')!=-1){ife._oldHeight=ife.style.height;ife.style.height=ife.clientHeight;}}window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings['base_href']);tinyMCE._resetIframeHeight();",1);return;case"submit":tinyMCE.removeTinyMCEFormElements(tinyMCE.isMSIE?window.event.srcElement:e.target);tinyMCE.triggerSave();tinyMCE.isNotDirty=true;return;case"reset":var formObj=tinyMCE.isMSIE?window.event.srcElement:e.target;for(var i=0;i<document.forms.length;i++){if(document.forms[i]==formObj)window.setTimeout('tinyMCE.resetForm('+i+');',10);}return;case"keypress":if(inst&&inst.handleShortcut(e))return false;if(e.target.editorId){tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];}else{if(e.target.ownerDocument.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.ownerDocument.editorId];}if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&e.keyCode==13&&!e.shiftKey){if(TinyMCE_ForceParagraphs._insertPara(tinyMCE.selectedInstance,e)){tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.cancelEvent(e);return false;}}if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance,e.type)){tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.cancelEvent(e);return false;}}if(tinyMCE.isMSIE&&tinyMCE.settings['force_br_newlines']&&e.keyCode==13){if(e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];if(tinyMCE.selectedInstance){var sel=tinyMCE.selectedInstance.getDoc().selection;var rng=sel.createRange();if(tinyMCE.getParentElement(rng.parentElement(),"li")!=null)return false;e.returnValue=false;e.cancelBubble=true;rng.pasteHTML("<br />");rng.collapse(false);rng.select();tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.triggerNodeChange(false);return false;}}if(e.keyCode==8||e.keyCode==46){tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(e.target,"a");tinyMCE.imgElement=tinyMCE.getParentElement(e.target,"img");tinyMCE.triggerNodeChange(false);}return false;break;case"keyup":case"keydown":tinyMCE.hideMenus();tinyMCE.hasMouseMoved=false;if(inst&&inst.handleShortcut(e))return false;if(e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];else return;if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();var inst=tinyMCE.selectedInstance;if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance,e.type)){tinyMCE.execCommand("mceAddUndoLevel");e.preventDefault();return false;}}tinyMCE.selectedElement=null;tinyMCE.selectedNode=null;var elm=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(elm,"a");tinyMCE.imgElement=tinyMCE.getParentElement(elm,"img");tinyMCE.selectedElement=elm;if(tinyMCE.isGecko&&e.type=="keyup"&&e.keyCode==9)tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(),true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);if(tinyMCE.isMSIE&&e.type=="keydown"&&e.keyCode==13)tinyMCE.enterKeyElement=tinyMCE.selectedInstance.getFocusElement();if(tinyMCE.isMSIE&&e.type=="keyup"&&e.keyCode==13){var elm=tinyMCE.enterKeyElement;if(elm){var re=new RegExp('^HR|IMG|BR$','g');var dre=new RegExp('^H[1-6]$','g');if(!elm.hasChildNodes()&&!re.test(elm.nodeName)){if(dre.test(elm.nodeName))elm.innerHTML="&nbsp;&nbsp;";else elm.innerHTML="&nbsp;";}}}var keys=tinyMCE.posKeyCodes;var posKey=false;for(var i=0;i<keys.length;i++){if(keys[i]==e.keyCode){posKey=true;break;}}if(tinyMCE.isMSIE&&tinyMCE.settings['custom_undo_redo']){var keys=new Array(8,46);for(var i=0;i<keys.length;i++){if(keys[i]==e.keyCode){if(e.type=="keyup")tinyMCE.triggerNodeChange(false);}}}if(e.keyCode==17)return true;if(!posKey&&e.type=="keyup")tinyMCE.execCommand("mceStartTyping");if(e.type=="keydown"&&(posKey||e.ctrlKey)&&inst)inst.undoBookmark=inst.selection.getBookmark();if(e.type=="keyup"&&(posKey||e.ctrlKey))tinyMCE.execCommand("mceEndTyping");if(posKey&&e.type=="keyup")tinyMCE.triggerNodeChange(false);if(tinyMCE.isMSIE&&e.ctrlKey)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);break;case"mousedown":case"mouseup":case"click":case"focus":tinyMCE.hideMenus();if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.switchSettings();tinyMCE.selectedInstance.isFocused=true;}var targetBody=tinyMCE.getParentElement(e.target,"body");for(var instanceName in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[instanceName]))continue;var inst=tinyMCE.instances[instanceName];inst.autoResetDesignMode();if(inst.getBody()==targetBody){tinyMCE.selectedInstance=inst;tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");tinyMCE.imgElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"img");break;}}if(!tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark)tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark=tinyMCE.selectedInstance.selection.getBookmark();if(tinyMCE.isSafari){tinyMCE.selectedInstance.lastSafariSelection=tinyMCE.selectedInstance.selection.getBookmark();tinyMCE.selectedInstance.lastSafariSelectedElement=tinyMCE.selectedElement;var lnk=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");if(lnk&&e.type=="mousedown"){lnk.setAttribute("mce_real_href",lnk.getAttribute("href"));lnk.setAttribute("href","javascript:void(0);");}if(lnk&&e.type=="click"){window.setTimeout(function(){lnk.setAttribute("href",lnk.getAttribute("mce_real_href"));lnk.removeAttribute("mce_real_href");},10);}}if(e.type!="focus")tinyMCE.selectedNode=null;tinyMCE.triggerNodeChange(false);tinyMCE.execCommand("mceEndTyping");if(e.type=="mouseup")tinyMCE.execCommand("mceAddUndoLevel");if(!tinyMCE.selectedInstance&&e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];return false;break;}},getButtonHTML:function(id,lang,img,cmd,ui,val){var h='',m,x;cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+cmd+'\'';if(typeof(ui)!="undefined"&&ui!=null)cmd+=','+ui;if(typeof(val)!="undefined"&&val!=null)cmd+=",'"+val+"'";cmd+=');';if(tinyMCE.getParam('button_tile_map')&&(!tinyMCE.isMSIE||tinyMCE.isOpera)&&(m=this.buttonMap[id])!=null&&(tinyMCE.getParam("language")=="en"||img.indexOf('$lang')==-1)){x=0-(m*20)==0?'0':0-(m*20);h+='<a id="{$editor_id}_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" class="mceTiledButton mceButtonNormal" target="_self">';h+='<img src="{$themeurl}/images/spacer.gif" style="background-position: '+x+'px 0" title="{$'+lang+'}" />';h+='</a>';}else{h+='<a id="{$editor_id}_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" class="mceButtonNormal" target="_self">';h+='<img src="'+img+'" title="{$'+lang+'}" />';h+='</a>';}return h;},addButtonMap:function(m){var i,a=m.replace(/\s+/,'').split(',');for(i=0;i<a.length;i++)this.buttonMap[a[i]]=i;},submitPatch:function(){tinyMCE.removeTinyMCEFormElements(this);tinyMCE.triggerSave();this.mceOldSubmit();tinyMCE.isNotDirty=true;},onLoad:function(){if(tinyMCE.settings.strict_loading_mode&&this.loadingIndex!=-1){window.setTimeout('tinyMCE.onLoad();',1);return;}if(tinyMCE.isMSIE&&!tinyMCE.isOpera&&window.event.type=="readystatechange"&&document.readyState!="complete")return true;if(tinyMCE.isLoaded)return true;tinyMCE.isLoaded=true;tinyMCE.dispatchCallback(null,'onpageload','onPageLoad');for(var c=0;c<tinyMCE.configs.length;c++){tinyMCE.settings=tinyMCE.configs[c];var selector=tinyMCE.getParam("editor_selector");var deselector=tinyMCE.getParam("editor_deselector");var elementRefAr=new Array();if(document.forms&&tinyMCE.settings['add_form_submit_trigger']&&!tinyMCE.submitTriggers){for(var i=0;i<document.forms.length;i++){var form=document.forms[i];tinyMCE.addEvent(form,"submit",TinyMCE_Engine.prototype.handleEvent);tinyMCE.addEvent(form,"reset",TinyMCE_Engine.prototype.handleEvent);tinyMCE.submitTriggers=true;if(tinyMCE.settings['submit_patch']){try{form.mceOldSubmit=form.submit;form.submit=TinyMCE_Engine.prototype.submitPatch;}catch(e){}}}}var mode=tinyMCE.settings['mode'];switch(mode){case"exact":var elements=tinyMCE.getParam('elements','',true,',');for(var i=0;i<elements.length;i++){var element=tinyMCE._getElementById(elements[i]);var trigger=element?element.getAttribute(tinyMCE.settings['textarea_trigger']):"";if(tinyMCE.getAttrib(element,"class").indexOf(deselector)!=-1)continue;if(trigger=="false")continue;if((tinyMCE.settings['ask']||tinyMCE.settings['convert_on_click'])&&element){elementRefAr[elementRefAr.length]=element;continue;}if(element)tinyMCE.addMCEControl(element,elements[i]);else if(tinyMCE.settings['debug'])alert("Error: Could not find element by id or name: "+elements[i]);}break;case"specific_textareas":case"textareas":var nodeList=document.getElementsByTagName("textarea");for(var i=0;i<nodeList.length;i++){var elm=nodeList.item(i);var trigger=elm.getAttribute(tinyMCE.settings['textarea_trigger']);if(selector!=''&&tinyMCE.getAttrib(elm,"class").indexOf(selector)==-1)continue;if(selector!='')trigger=selector!=""?"true":"";if(tinyMCE.getAttrib(elm,"class").indexOf(deselector)!=-1)continue;if((mode=="specific_textareas"&&trigger=="true")||(mode=="textareas"&&trigger!="false"))elementRefAr[elementRefAr.length]=elm;}break;}for(var i=0;i<elementRefAr.length;i++){var element=elementRefAr[i];var elementId=element.name?element.name:element.id;if(tinyMCE.settings['ask']||tinyMCE.settings['convert_on_click']){if(tinyMCE.isGecko){var settings=tinyMCE.settings;tinyMCE.addEvent(element,"focus",function(e){window.setTimeout(function(){TinyMCE_Engine.prototype.confirmAdd(e,settings);},10);});if(element.nodeName!="TEXTAREA"&&element.nodeName!="INPUT")tinyMCE.addEvent(element,"click",function(e){window.setTimeout(function(){TinyMCE_Engine.prototype.confirmAdd(e,settings);},10);});}else{var settings=tinyMCE.settings;tinyMCE.addEvent(element,"focus",function(){TinyMCE_Engine.prototype.confirmAdd(null,settings);});tinyMCE.addEvent(element,"click",function(){TinyMCE_Engine.prototype.confirmAdd(null,settings);});}}else tinyMCE.addMCEControl(element,elementId);}if(tinyMCE.settings['auto_focus']){window.setTimeout(function(){var inst=tinyMCE.getInstanceById(tinyMCE.settings['auto_focus']);inst.selection.selectNode(inst.getBody(),true,true);inst.contentWindow.focus();},10);}tinyMCE.dispatchCallback(null,'oninit','onInit');}},isInstance:function(o){return o!=null&&typeof(o)=="object"&&o.isTinyMCE_Control;},getParam:function(name,default_value,strip_whitespace,split_chr){var value=(typeof(this.settings[name])=="undefined")?default_value:this.settings[name];if(value=="true"||value=="false")return(value=="true");if(strip_whitespace)value=tinyMCE.regexpReplace(value,"[ \t\r\n]","");if(typeof(split_chr)!="undefined"&&split_chr!=null){value=value.split(split_chr);var outArray=new Array();for(var i=0;i<value.length;i++){if(value[i]&&value[i]!="")outArray[outArray.length]=value[i];}value=outArray;}return value;},getLang:function(name,default_value,parse_entities,va){var v=(typeof(tinyMCELang[name])=="undefined")?default_value:tinyMCELang[name],n;if(parse_entities)v=tinyMCE.entityDecode(v);if(va){for(n in va)v=this.replaceVar(v,n,va[n]);}return v;},entityDecode:function(s){var e=document.createElement("div");e.innerHTML=s;return e.innerHTML;},addToLang:function(prefix,ar){for(var key in ar){if(typeof(ar[key])=='function')continue;tinyMCELang[(key.indexOf('lang_')==-1?'lang_':'')+(prefix!=''?(prefix+"_"):'')+key]=ar[key];}this.loadNextScript();},triggerNodeChange:function(focus,setup_content){if(tinyMCE.selectedInstance){var inst=tinyMCE.selectedInstance;var editorId=inst.editorId;var elm=(typeof(setup_content)!="undefined"&&setup_content)?tinyMCE.selectedElement:inst.getFocusElement();var undoIndex=-1;var undoLevels=-1;var anySelection=false;var selectedText=inst.selection.getSelectedText();if(setup_content&&tinyMCE.isGecko&&inst.isHidden())elm=inst.getBody();inst.switchSettings();if(tinyMCE.settings["auto_resize"]){var doc=inst.getDoc();inst.iframeElement.style.width=doc.body.offsetWidth+"px";inst.iframeElement.style.height=doc.body.offsetHeight+"px";}if(tinyMCE.selectedElement)anySelection=(tinyMCE.selectedElement.nodeName.toLowerCase()=="img")||(selectedText&&selectedText.length>0);if(tinyMCE.settings['custom_undo_redo']){undoIndex=inst.undoRedo.undoIndex;undoLevels=inst.undoRedo.undoLevels.length;}tinyMCE.dispatchCallback(inst,'handle_node_change_callback','handleNodeChange',editorId,elm,undoIndex,undoLevels,inst.visualAid,anySelection,setup_content);}if(this.selectedInstance&&(typeof(focus)=="undefined"||focus))this.selectedInstance.contentWindow.focus();},_customCleanup:function(inst,type,content){var pl,po,i;var customCleanup=tinyMCE.settings['cleanup_callback'];if(customCleanup!=""&&eval("typeof("+customCleanup+")")!="undefined")content=eval(customCleanup+"(type, content, inst);");pl=inst.plugins;for(i=0;i<pl.length;i++){po=tinyMCE.plugins[pl[i]];if(po&&po.cleanup)content=po.cleanup(type,content,inst);}return content;},setContent:function(h){if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.execCommand('mceSetContent',false,h);tinyMCE.selectedInstance.repaint();}},importThemeLanguagePack:function(name){if(typeof(name)=="undefined")name=tinyMCE.settings['theme'];tinyMCE.loadScript(tinyMCE.baseURL+'/themes/'+name+'/langs/'+tinyMCE.settings['language']+'.js');},importPluginLanguagePack:function(name,valid_languages){var lang="en",b=tinyMCE.baseURL+'/plugins/'+name;valid_languages=valid_languages.split(',');for(var i=0;i<valid_languages.length;i++){if(tinyMCE.settings['language']==valid_languages[i])lang=tinyMCE.settings['language'];}if(this.plugins[name])b=this.plugins[name].baseURL;tinyMCE.loadScript(b+'/langs/'+lang+'.js');},applyTemplate:function(h,as){var i,s,ar=h.match(new RegExp('\\{\\$[a-z0-9_]+\\}','gi'));if(ar&&ar.length>0){for(i=ar.length-1;i>=0;i--){s=ar[i].substring(2,ar[i].length-1);if(s.indexOf('lang_')==0&&tinyMCELang[s])h=tinyMCE.replaceVar(h,s,tinyMCELang[s]);else if(as&&as[s])h=tinyMCE.replaceVar(h,s,as[s]);else if(tinyMCE.settings[s])h=tinyMCE.replaceVar(h,s,tinyMCE.settings[s]);}}h=tinyMCE.replaceVar(h,"themeurl",tinyMCE.themeURL);return h;},replaceVar:function(h,r,v){return h.replace(new RegExp('{\\\$'+r+'}','g'),v);},openWindow:function(template,args){var html,width,height,x,y,resizable,scrollbars,url;args['mce_template_file']=template['file'];args['mce_width']=template['width'];args['mce_height']=template['height'];tinyMCE.windowArgs=args;html=template['html'];if(!(width=parseInt(template['width'])))width=320;if(!(height=parseInt(template['height'])))height=200;if(tinyMCE.isMSIE)height+=40;else height+=20;x=parseInt(screen.width/2.0)-(width/2.0);y=parseInt(screen.height/2.0)-(height/2.0);resizable=(args&&args['resizable'])?args['resizable']:"no";scrollbars=(args&&args['scrollbars'])?args['scrollbars']:"no";if(template['file'].charAt(0)!='/'&&template['file'].indexOf('://')==-1)url=tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/"+template['file'];else url=template['file'];for(var name in args){if(typeof(args[name])=='function')continue;url=tinyMCE.replaceVar(url,name,escape(args[name]));}if(html){html=tinyMCE.replaceVar(html,"css",this.settings['popups_css']);html=tinyMCE.applyTemplate(html,args);var win=window.open("","mcePopup"+new Date().getTime(),"top="+y+",left="+x+",scrollbars="+scrollbars+",dialog=yes,minimizable="+resizable+",modal=yes,width="+width+",height="+height+",resizable="+resizable);if(win==null){alert(tinyMCELang['lang_popup_blocked']);return;}win.document.write(html);win.document.close();win.resizeTo(width,height);win.focus();}else{if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&resizable!='yes'&&tinyMCE.settings["dialog_type"]=="modal"){height+=10;var features="resizable:"+resizable+";scroll:"+scrollbars+";status:yes;center:yes;help:no;dialogWidth:"+width+"px;dialogHeight:"+height+"px;";window.showModalDialog(url,window,features);}else{var modal=(resizable=="yes")?"no":"yes";if(tinyMCE.isGecko&&tinyMCE.isMac)modal="no";if(template['close_previous']!="no")try{tinyMCE.lastWindow.close();}catch(ex){}var win=window.open(url,"mcePopup"+new Date().getTime(),"top="+y+",left="+x+",scrollbars="+scrollbars+",dialog="+modal+",minimizable="+resizable+",modal="+modal+",width="+width+",height="+height+",resizable="+resizable);if(win==null){alert(tinyMCELang['lang_popup_blocked']);return;}if(template['close_previous']!="no")tinyMCE.lastWindow=win;eval('try { win.resizeTo(width, height); } catch(e) { }');if(tinyMCE.isGecko){if(win.document.defaultView.statusbar.visible)win.resizeBy(0,tinyMCE.isMac?10:24);}win.focus();}}},closeWindow:function(win){win.close();},getVisualAidClass:function(class_name,state){var aidClass=tinyMCE.settings['visual_table_class'];if(typeof(state)=="undefined")state=tinyMCE.settings['visual'];var classNames=new Array();var ar=class_name.split(' ');for(var i=0;i<ar.length;i++){if(ar[i]==aidClass)ar[i]="";if(ar[i]!="")classNames[classNames.length]=ar[i];}if(state)classNames[classNames.length]=aidClass;var className="";for(var i=0;i<classNames.length;i++){if(i>0)className+=" ";className+=classNames[i];}return className;},handleVisualAid:function(el,deep,state,inst,skip_dispatch){if(!el)return;if(!skip_dispatch)tinyMCE.dispatchCallback(inst,'handle_visual_aid_callback','handleVisualAid',el,deep,state,inst);var tableElement=null;switch(el.nodeName){case"TABLE":var oldW=el.style.width;var oldH=el.style.height;var bo=tinyMCE.getAttrib(el,"border");bo=bo==""||bo=="0"?true:false;tinyMCE.setAttrib(el,"class",tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el,"class"),state&&bo));el.style.width=oldW;el.style.height=oldH;for(var y=0;y<el.rows.length;y++){for(var x=0;x<el.rows[y].cells.length;x++){var cn=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el.rows[y].cells[x],"class"),state&&bo);tinyMCE.setAttrib(el.rows[y].cells[x],"class",cn);}}break;case"A":var anchorName=tinyMCE.getAttrib(el,"name");if(anchorName!=''&&state){el.title=anchorName;el.className='mceItemAnchor';}else if(anchorName!=''&&!state)el.className='';break;}if(deep&&el.hasChildNodes()){for(var i=0;i<el.childNodes.length;i++)tinyMCE.handleVisualAid(el.childNodes[i],deep,state,inst,true);}},fixGeckoBaseHREFBug:function(m,e,h){var nl,i,a,n,xsrc,xhref,el;if(tinyMCE.isGecko){if(m==1){h=h.replace(/\ssrc=/gi," mce_tsrc=");h=h.replace(/\shref=/gi," mce_thref=");return h;}else{el=new Array('a','img','select','area','iframe','base','input','script','embed','object','link');for(a=0;a<el.length;a++){n=e.getElementsByTagName(el[a]);for(i=0;i<n.length;i++){xsrc=tinyMCE.getAttrib(n[i],"mce_tsrc");xhref=tinyMCE.getAttrib(n[i],"mce_thref");if(xsrc!=""){try{n[i].src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],xsrc);}catch(e){}n[i].removeAttribute("mce_tsrc");}if(xhref!=""){try{n[i].href=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],xhref);}catch(e){}n[i].removeAttribute("mce_thref");}}}el=tinyMCE.selectNodes(e,function(n){if(n.nodeType==3||n.nodeType==8){n.nodeValue=n.nodeValue.replace(/\smce_tsrc=/gi," src=");n.nodeValue=n.nodeValue.replace(/\smce_thref=/gi," href=");}return false;});}}return h;},_setHTML:function(doc,html_content){html_content=tinyMCE.cleanupHTMLCode(html_content);try{tinyMCE.setInnerHTML(doc.body,html_content);}catch(e){if(this.isMSIE)doc.body.createTextRange().pasteHTML(html_content);}if(tinyMCE.isMSIE&&tinyMCE.settings['fix_content_duplication']){var paras=doc.getElementsByTagName("P");for(var i=0;i<paras.length;i++){var node=paras[i];while((node=node.parentNode)!=null){if(node.nodeName=="P")node.outerHTML=node.innerHTML;}}var html=doc.body.innerHTML;tinyMCE.setInnerHTML(doc.body,html);}tinyMCE.cleanupAnchors(doc);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);},getEditorId:function(form_element){var inst=this.getInstanceById(form_element);if(!inst)return null;return inst.editorId;},getInstanceById:function(editor_id){var inst=this.instances[editor_id];if(!inst){for(var n in tinyMCE.instances){var instance=tinyMCE.instances[n];if(!tinyMCE.isInstance(instance))continue;if(instance.formTargetElementId==editor_id){inst=instance;break;}}}return inst;},queryInstanceCommandValue:function(editor_id,command){var inst=tinyMCE.getInstanceById(editor_id);if(inst)return inst.queryCommandValue(command);return false;},queryInstanceCommandState:function(editor_id,command){var inst=tinyMCE.getInstanceById(editor_id);if(inst)return inst.queryCommandState(command);return null;},setWindowArg:function(n,v){this.windowArgs[n]=v;},getWindowArg:function(n,d){return(typeof(this.windowArgs[n])=="undefined")?d:this.windowArgs[n];},getCSSClasses:function(editor_id,doc){var output=new Array();if(typeof(tinyMCE.cssClasses)!="undefined")return tinyMCE.cssClasses;if(typeof(editor_id)=="undefined"&&typeof(doc)=="undefined"){var instance;for(var instanceName in tinyMCE.instances){instance=tinyMCE.instances[instanceName];if(!tinyMCE.isInstance(instance))continue;break;}doc=instance.getDoc();}if(typeof(doc)=="undefined"){var instance=tinyMCE.getInstanceById(editor_id);doc=instance.getDoc();}if(doc){var styles=doc.styleSheets;if(styles&&styles.length>0){for(var x=0;x<styles.length;x++){var csses=null;eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets("+x+").rules : styles["+x+"].cssRules;} catch(e) {}");if(!csses)return new Array();for(var i=0;i<csses.length;i++){var selectorText=csses[i].selectorText;if(selectorText){var rules=selectorText.split(',');for(var c=0;c<rules.length;c++){var rule=rules[c];while(rule.indexOf(' ')==0)rule=rule.substring(1);if(rule.indexOf(' ')!=-1||rule.indexOf(':')!=-1||rule.indexOf('mceItem')!=-1)continue;if(rule.indexOf(tinyMCE.settings['visual_table_class'])!=-1||rule.indexOf('mceEditable')!=-1||rule.indexOf('mceNonEditable')!=-1)continue;if(rule.indexOf('.')!=-1){var cssClass=rule.substring(rule.indexOf('.')+1);var addClass=true;for(var p=0;p<output.length&&addClass;p++){if(output[p]==cssClass)addClass=false;}if(addClass)output[output.length]=cssClass;}}}}}}}if(output.length>0)tinyMCE.cssClasses=output;return output;},regexpReplace:function(in_str,reg_exp,replace_str,opts){if(in_str==null)return in_str;if(typeof(opts)=="undefined")opts='g';var re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str);},trim:function(s){return s.replace(/^\s*|\s*$/g,"");},cleanupEventStr:function(s){s=""+s;s=s.replace('function anonymous()\n{\n','');s=s.replace('\n}','');s=s.replace(/^return true;/gi,'');return s;},getControlHTML:function(c){var i,l,n,o,v;l=tinyMCE.plugins;for(n in l){o=l[n];if(o.getControlHTML&&(v=o.getControlHTML(c))!='')return tinyMCE.replaceVar(v,"pluginurl",o.baseURL);}o=tinyMCE.themes[tinyMCE.settings['theme']];if(o.getControlHTML&&(v=o.getControlHTML(c))!='')return v;return'';},evalFunc:function(f,idx,a){var s='(',i;for(i=idx;i<a.length;i++){s+='a['+i+']';if(i<a.length-1)s+=',';}s+=');';return eval("f"+s);},dispatchCallback:function(i,p,n){return this.callFunc(i,p,n,0,this.dispatchCallback.arguments);},executeCallback:function(i,p,n){return this.callFunc(i,p,n,1,this.executeCallback.arguments);},execCommandCallback:function(i,p,n){return this.callFunc(i,p,n,2,this.execCommandCallback.arguments);},callFunc:function(ins,p,n,m,a){var l,i,on,o,s,v;s=m==2;l=tinyMCE.getParam(p,'');if(l!=''&&(v=tinyMCE.evalFunc(typeof(l)=="function"?l:eval(l),3,a))==s&&m>0)return true;if(ins!=null){for(i=0,l=ins.plugins;i<l.length;i++){o=tinyMCE.plugins[l[i]];if(o[n]&&(v=tinyMCE.evalFunc(o[n],3,a))==s&&m>0)return true;}}l=tinyMCE.themes;for(on in l){o=l[on];if(o[n]&&(v=tinyMCE.evalFunc(o[n],3,a))==s&&m>0)return true;}return false;},xmlEncode:function(s){s=""+s;s=s.replace(/&/g,'&amp;');s=s.replace(new RegExp('"','g'),'&quot;');s=s.replace(/\'/g,'&#39;');s=s.replace(/</g,'&lt;');s=s.replace(/>/g,'&gt;');return s;},extend:function(p,np){var o={};o.parent=p;for(n in p)o[n]=p[n];for(n in np)o[n]=np[n];return o;},hideMenus:function(){var e=tinyMCE.lastSelectedMenuBtn;if(tinyMCE.lastMenu){tinyMCE.lastMenu.hide();tinyMCE.lastMenu=null;}if(e){tinyMCE.switchClass(e,tinyMCE.lastMenuBtnClass);tinyMCE.lastSelectedMenuBtn=null;}},explode:function(d,s){var ar=s.split(d),oar=new Array(),i;for(i=0;i<ar.length;i++){if(ar[i]!="")oar[oar.length]=ar[i];}return oar;}};var TinyMCE=TinyMCE_Engine;var tinyMCE=new TinyMCE_Engine();var tinyMCELang={};function TinyMCE_Control(settings){var t,i,to,fu,p,x,fn,fu,pn,s=settings;this.undoRedoLevel=true;this.isTinyMCE_Control=true;this.settings=s;this.settings['theme']=tinyMCE.getParam("theme","default");this.settings['width']=tinyMCE.getParam("width",-1);this.settings['height']=tinyMCE.getParam("height",-1);this.selection=new TinyMCE_Selection(this);this.undoRedo=new TinyMCE_UndoRedo(this);this.cleanup=new TinyMCE_Cleanup();this.shortcuts=new Array();this.hasMouseMoved=false;this.cleanup.init({valid_elements:s.valid_elements,extended_valid_elements:s.extended_valid_elements,entities:s.entities,entity_encoding:s.entity_encoding,debug:s.cleanup_debug,url_converter:'TinyMCE_Cleanup.prototype._urlConverter',indent:s.apply_source_formatting,invalid_elements:s.invalid_elements,verify_html:s.verify_html,fix_content_duplication:s.fix_content_duplication});t=this.settings['theme'];if(!tinyMCE.hasTheme(t)){fn=tinyMCE.callbacks;to={};for(i=0;i<fn.length;i++){if((fu=window['TinyMCE_'+t+"_"+fn[i]]))to[fn[i]]=fu;}tinyMCE.addTheme(t,to);}this.plugins=new Array();p=tinyMCE.getParam('plugins','',true,',');if(p.length>0){for(i=0;i<p.length;i++){pn=p[i];if(pn.charAt(0)=='-')pn=pn.substring(1);if(!tinyMCE.hasPlugin(pn)){fn=tinyMCE.callbacks;to={};for(x=0;x<fn.length;x++){if((fu=window['TinyMCE_'+pn+"_"+fn[x]]))to[fn[x]]=fu;}tinyMCE.addPlugin(pn,to);}this.plugins[this.plugins.length]=pn;}}};TinyMCE_Control.prototype={hasPlugin:function(n){var i;for(i=0;i<this.plugins.length;i++){if(this.plugins[i]==n)return true;}return false;},addPlugin:function(n,p){if(!this.hasPlugin(n)){tinyMCE.addPlugin(n,p);this.plugins[this.plugins.length]=n;}},repaint:function(){if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return;try{var s=this.selection;var b=s.getBookmark(true);this.getBody().style.display='none';this.getDoc().execCommand('selectall',false,null);this.getSel().collapseToStart();this.getBody().style.display='block';s.moveToBookmark(b);}catch(ex){}},switchSettings:function(){if(tinyMCE.configs.length>1&&tinyMCE.currentConfig!=this.settings['index']){tinyMCE.settings=this.settings;tinyMCE.currentConfig=this.settings['index'];}},getBody:function(){return this.getDoc().body;},getDoc:function(){return this.contentWindow.document;},getWin:function(){return this.contentWindow;},addShortcut:function(m,k,d,cmd,ui,va){var n=typeof(k)=="number",ie=tinyMCE.isMSIE,c,sc,i;var scl=this.shortcuts;if(!tinyMCE.getParam('custom_shortcuts'))return false;m=m.toLowerCase();k=ie&&!n?k.toUpperCase():k;c=n?null:k.charCodeAt(0);d=d&&d.indexOf('lang_')==0?tinyMCE.getLang(d):d;sc={alt:m.indexOf('alt')!=-1,ctrl:m.indexOf('ctrl')!=-1,shift:m.indexOf('shift')!=-1,charCode:c,keyCode:n?k:(ie?c:null),desc:d,cmd:cmd,ui:ui,val:va};for(i=0;i<scl.length;i++){if(sc.alt==scl[i].alt&&sc.ctrl==scl[i].ctrl&&sc.shift==scl[i].shift&&sc.charCode==scl[i].charCode&&sc.keyCode==scl[i].keyCode){return false;}}scl[scl.length]=sc;return true;},handleShortcut:function(e){var i,s=this.shortcuts,o;for(i=0;i<s.length;i++){o=s[i];if(o.alt==e.altKey&&o.ctrl==e.ctrlKey&&(o.keyCode==e.keyCode||o.charCode==e.charCode)){if(o.cmd&&(e.type=="keydown"||(e.type=="keypress"&&!tinyMCE.isOpera)))tinyMCE.execCommand(o.cmd,o.ui,o.val);tinyMCE.cancelEvent(e);return true;}}return false;},autoResetDesignMode:function(){if(!tinyMCE.isMSIE&&this.isHidden()&&tinyMCE.getParam('auto_reset_designmode'))eval('try { this.getDoc().designMode = "On"; } catch(e) {}');},isHidden:function(){if(tinyMCE.isMSIE)return false;var s=this.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},isDirty:function(){return this.startContent!=tinyMCE.trim(this.getBody().innerHTML)&&!tinyMCE.isNotDirty;},_mergeElements:function(scmd,pa,ch,override){if(scmd=="removeformat"){pa.className="";pa.style.cssText="";ch.className="";ch.style.cssText="";return;}var st=tinyMCE.parseStyle(tinyMCE.getAttrib(pa,"style"));var stc=tinyMCE.parseStyle(tinyMCE.getAttrib(ch,"style"));var className=tinyMCE.getAttrib(pa,"class");className+=" "+tinyMCE.getAttrib(ch,"class");if(override){for(var n in st){if(typeof(st[n])=='function')continue;stc[n]=st[n];}}else{for(var n in stc){if(typeof(stc[n])=='function')continue;st[n]=stc[n];}}tinyMCE.setAttrib(pa,"style",tinyMCE.serializeStyle(st));tinyMCE.setAttrib(pa,"class",tinyMCE.trim(className));ch.className="";ch.style.cssText="";ch.removeAttribute("class");ch.removeAttribute("style");},_setUseCSS:function(b){var d=this.getDoc();try{d.execCommand("useCSS",false,!b);}catch(ex){}try{d.execCommand("styleWithCSS",false,b);}catch(ex){}if(!tinyMCE.getParam("table_inline_editing"))try{d.execCommand('enableInlineTableEditing',false,"false");}catch(ex){}if(!tinyMCE.getParam("object_resizing"))try{d.execCommand('enableObjectResizing',false,"false");}catch(ex){}},execCommand:function(command,user_interface,value){var doc=this.getDoc();var win=this.getWin();var focusElm=this.getFocusElement();if(!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel','gi').test(command))this.undoBookmark=null;if(this.lastSafariSelection&&!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel','gi').test(command)){this.selection.moveToBookmark(this.lastSafariSelection);tinyMCE.selectedElement=this.lastSafariSelectedElement;}if(!tinyMCE.isMSIE&&!this.useCSS){this._setUseCSS(false);this.useCSS=true;}this.contentDocument=doc;if(tinyMCE.execCommandCallback(this,'execcommand_callback','execCommand',this.editorId,this.getBody(),command,user_interface,value))return;if(focusElm&&focusElm.nodeName=="IMG"){var align=focusElm.getAttribute('align');var img=command=="JustifyCenter"?focusElm.cloneNode(false):focusElm;switch(command){case"JustifyLeft":if(align=='left')img.removeAttribute('align');else img.setAttribute('align','left');var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case"JustifyCenter":img.removeAttribute('align');var div=tinyMCE.getParentElement(focusElm,"div");if(div&&div.style.textAlign=="center"){if(div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);}else{var div=this.getDoc().createElement("div");div.style.textAlign='center';div.appendChild(img);focusElm.parentNode.replaceChild(div,focusElm);}this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case"JustifyRight":if(align=='right')img.removeAttribute('align');else img.setAttribute('align','right');var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;}}if(tinyMCE.settings['force_br_newlines']){var alignValue="";if(doc.selection.type!="Control"){switch(command){case"JustifyLeft":alignValue="left";break;case"JustifyCenter":alignValue="center";break;case"JustifyFull":alignValue="justify";break;case"JustifyRight":alignValue="right";break;}if(alignValue!=""){var rng=doc.selection.createRange();if((divElm=tinyMCE.getParentElement(rng.parentElement(),"div"))!=null)divElm.setAttribute("align",alignValue);else if(rng.pasteHTML&&rng.htmlText.length>0)rng.pasteHTML('<div align="'+alignValue+'">'+rng.htmlText+"</div>");tinyMCE.triggerNodeChange();return;}}}switch(command){case"mceRepaint":this.repaint();return true;case"InsertUnorderedList":case"InsertOrderedList":var tag=(command=="InsertUnorderedList")?"ul":"ol";if(tinyMCE.isSafari)this.execCommand("mceInsertContent",false,"<"+tag+"><li>&nbsp;</li><"+tag+">");else this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"Strikethrough":if(tinyMCE.isSafari)this.execCommand("mceInsertContent",false,"<strike>"+this.selection.getSelectedHTML()+"</strike>");else this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"mceSelectNode":this.selection.selectNode(value);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=value;break;case"FormatBlock":if(value==null||value==""){var elm=tinyMCE.getParentElement(this.getFocusElement(),"p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");if(elm)this.execCommand("mceRemoveNode",false,elm);}else{if(tinyMCE.isGecko&&new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>','gi').test(value))value=value.replace(/[^a-z]/gi,'');if(tinyMCE.isMSIE&&new RegExp('blockquote|code|samp','gi').test(value)){var b=this.selection.getBookmark();this.getDoc().execCommand("FormatBlock",false,'<p>');tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()),value);this.selection.moveToBookmark(b);}else this.getDoc().execCommand("FormatBlock",false,value);}tinyMCE.triggerNodeChange();break;case"mceRemoveNode":if(!value)value=tinyMCE.getParentElement(this.getFocusElement());if(tinyMCE.isMSIE){value.outerHTML=value.innerHTML;}else{var rng=value.ownerDocument.createRange();rng.setStartBefore(value);rng.setEndAfter(value);rng.deleteContents();rng.insertNode(rng.createContextualFragment(value.innerHTML));}tinyMCE.triggerNodeChange();break;case"mceSelectNodeDepth":var parentNode=this.getFocusElement();for(var i=0;parentNode;i++){if(parentNode.nodeName.toLowerCase()=="body")break;if(parentNode.nodeName.toLowerCase()=="#text"){i--;parentNode=parentNode.parentNode;continue;}if(i==value){this.selection.selectNode(parentNode,false);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=parentNode;return;}parentNode=parentNode.parentNode;}break;case"SetStyleInfo":var rng=this.getRng();var sel=this.getSel();var scmd=value['command'];var sname=value['name'];var svalue=value['value']==null?'':value['value'];var wrapper=value['wrapper']?value['wrapper']:"span";var parentElm=null;var invalidRe=new RegExp("^BODY|HTML$","g");var invalidParentsRe=tinyMCE.settings['merge_styles_invalid_parents']!=''?new RegExp(tinyMCE.settings['merge_styles_invalid_parents'],"gi"):null;if(tinyMCE.isMSIE){if(rng.item)parentElm=rng.item(0);else{var pelm=rng.parentElement();var prng=doc.selection.createRange();prng.moveToElementText(pelm);if(rng.htmlText==prng.htmlText||rng.boundingWidth==0){if(invalidParentsRe==null||!invalidParentsRe.test(pelm.nodeName))parentElm=pelm;}}}else{var felm=this.getFocusElement();if(sel.isCollapsed||(new RegExp('td|tr|tbody|table','gi').test(felm.nodeName)&&sel.anchorNode==felm.parentNode))parentElm=felm;}if(parentElm&&!invalidRe.test(parentElm.nodeName)){if(scmd=="setstyle")tinyMCE.setStyleAttrib(parentElm,sname,svalue);if(scmd=="setattrib")tinyMCE.setAttrib(parentElm,sname,svalue);if(scmd=="removeformat"){parentElm.style.cssText='';tinyMCE.setAttrib(parentElm,'class','');}var ch=tinyMCE.getNodeTree(parentElm,new Array(),1);for(var z=0;z<ch.length;z++){if(ch[z]==parentElm)continue;if(scmd=="setstyle")tinyMCE.setStyleAttrib(ch[z],sname,'');if(scmd=="setattrib")tinyMCE.setAttrib(ch[z],sname,'');if(scmd=="removeformat"){ch[z].style.cssText='';tinyMCE.setAttrib(ch[z],'class','');}}}else{this._setUseCSS(false);doc.execCommand("FontName",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.getBody(),"font","face","#mce_temp_font#");for(var x=0;x<elementArray.length;x++){elm=elementArray[x];if(elm){var spanElm=doc.createElement(wrapper);if(scmd=="setstyle")tinyMCE.setStyleAttrib(spanElm,sname,svalue);if(scmd=="setattrib")tinyMCE.setAttrib(spanElm,sname,svalue);if(scmd=="removeformat"){spanElm.style.cssText='';tinyMCE.setAttrib(spanElm,'class','');}if(elm.hasChildNodes()){for(var i=0;i<elm.childNodes.length;i++)spanElm.appendChild(elm.childNodes[i].cloneNode(true));}spanElm.setAttribute("mce_new","true");elm.parentNode.replaceChild(spanElm,elm);var ch=tinyMCE.getNodeTree(spanElm,new Array(),1);for(var z=0;z<ch.length;z++){if(ch[z]==spanElm)continue;if(scmd=="setstyle")tinyMCE.setStyleAttrib(ch[z],sname,'');if(scmd=="setattrib")tinyMCE.setAttrib(ch[z],sname,'');if(scmd=="removeformat"){ch[z].style.cssText='';tinyMCE.setAttrib(ch[z],'class','');}}}}}var nodes=doc.getElementsByTagName(wrapper);for(var i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isNew=tinyMCE.getAttrib(elm,"mce_new")=="true";elm.removeAttribute("mce_new");if(elm.childNodes&&elm.childNodes.length==1&&elm.childNodes[0].nodeType==1){this._mergeElements(scmd,elm,elm.childNodes[0],isNew);continue;}if(elm.parentNode.childNodes.length==1&&!invalidRe.test(elm.nodeName)&&!invalidRe.test(elm.parentNode.nodeName)){if(invalidParentsRe==null||!invalidParentsRe.test(elm.parentNode.nodeName))this._mergeElements(scmd,elm.parentNode,elm,false);}}var nodes=doc.getElementsByTagName(wrapper);for(var i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isEmpty=true;var tmp=doc.createElement("body");tmp.appendChild(elm.cloneNode(false));tmp.innerHTML=tmp.innerHTML.replace(new RegExp('style=""|class=""','gi'),'');if(new RegExp('<span>','gi').test(tmp.innerHTML)){for(var x=0;x<elm.childNodes.length;x++){if(elm.parentNode!=null)elm.parentNode.insertBefore(elm.childNodes[x].cloneNode(true),elm);}elm.parentNode.removeChild(elm);}}if(scmd=="removeformat")tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE.triggerNodeChange();break;case"FontName":if(value==null){var s=this.getSel();if(tinyMCE.isGecko&&s.isCollapsed){var f=tinyMCE.getParentElement(this.getFocusElement(),"font");if(f!=null)this.selection.selectNode(f,false);}this.getDoc().execCommand("RemoveFormat",false,null);if(f!=null&&tinyMCE.isGecko){var r=this.getRng().cloneRange();r.collapse(true);s.removeAllRanges();s.addRange(r);}}else this.getDoc().execCommand('FontName',false,value);if(tinyMCE.isGecko)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);return;case"FontSize":this.getDoc().execCommand('FontSize',false,value);if(tinyMCE.isGecko)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);return;case"forecolor":this.getDoc().execCommand('forecolor',false,value);break;case"HiliteColor":if(tinyMCE.isGecko){this._setUseCSS(true);this.getDoc().execCommand('hilitecolor',false,value);this._setUseCSS(false);}else this.getDoc().execCommand('BackColor',false,value);break;case"Cut":case"Copy":case"Paste":var cmdFailed=false;eval('try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}');if(tinyMCE.isOpera&&cmdFailed)alert('Currently not supported by your browser, use keyboard shortcuts instead.');if(tinyMCE.isGecko&&cmdFailed){if(confirm(tinyMCE.entityDecode(tinyMCE.getLang('lang_clipboard_msg'))))window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');return;}else tinyMCE.triggerNodeChange();break;case"mceSetContent":if(!value)value="";value=tinyMCE.storeAwayURLs(value);value=tinyMCE._customCleanup(this,"insert_to_editor",value);tinyMCE._setHTML(doc,value);tinyMCE.setInnerHTML(doc.body,tinyMCE._cleanupHTML(this,doc,tinyMCE.settings,doc.body));tinyMCE.convertAllRelativeURLs(doc.body);tinyMCE._removeInternal(this.getBody());if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);tinyMCE.handleVisualAid(doc.body,true,this.visualAid,this);tinyMCE._setEventsEnabled(doc.body,false);return true;case"mceCleanup":var b=this.selection.getBookmark();tinyMCE._setHTML(this.contentDocument,this.getBody().innerHTML);tinyMCE.setInnerHTML(this.getBody(),tinyMCE._cleanupHTML(this,this.contentDocument,this.settings,this.getBody(),this.visualAid));tinyMCE.convertAllRelativeURLs(doc.body);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE._setEventsEnabled(this.getBody(),false);this.repaint();this.selection.moveToBookmark(b);tinyMCE.triggerNodeChange();break;case"mceReplaceContent":if(!value)value='';this.getWin().focus();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text;}else selectedText=this.getSel().toString();if(selectedText.length>0){value=tinyMCE.replaceVar(value,"selection",selectedText);tinyMCE.execCommand('mceInsertContent',false,value);}tinyMCE.triggerNodeChange();break;case"mceSetAttribute":if(typeof(value)=='object'){var targetElms=(typeof(value['targets'])=="undefined")?"p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address":value['targets'];var targetNode=tinyMCE.getParentElement(this.getFocusElement(),targetElms);if(targetNode){targetNode.setAttribute(value['name'],value['value']);tinyMCE.triggerNodeChange();}}break;case"mceSetCSSClass":this.execCommand("SetStyleInfo",false,{command:"setattrib",name:"class",value:value});break;case"mceInsertRawHTML":var key='tiny_mce_marker';this.execCommand('mceBeginUndoLevel');this.execCommand('mceInsertContent',false,key);var scrollX=this.getDoc().body.scrollLeft+this.getDoc().documentElement.scrollLeft;var scrollY=this.getDoc().body.scrollTop+this.getDoc().documentElement.scrollTop;var html=this.getBody().innerHTML;if((pos=html.indexOf(key))!=-1)tinyMCE.setInnerHTML(this.getBody(),html.substring(0,pos)+value+html.substring(pos+key.length));this.contentWindow.scrollTo(scrollX,scrollY);this.execCommand('mceEndUndoLevel');break;case"mceInsertContent":if(!value)value='';var insertHTMLFailed=false;this.getWin().focus();if(tinyMCE.isGecko||tinyMCE.isOpera){try{if(value.indexOf('<')==-1&&!value.match(/(&#38;|&#160;|&#60;|&#62;)/g)){var r=this.getRng();var n=this.getDoc().createTextNode(tinyMCE.entityDecode(value));var s=this.getSel();var r2=r.cloneRange();s.removeAllRanges();r.deleteContents();r.insertNode(n);r2.selectNode(n);r2.collapse(false);s.removeAllRanges();s.addRange(r2);}else{value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);this.getDoc().execCommand('inserthtml',false,value);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value);}}catch(ex){insertHTMLFailed=true;}if(!insertHTMLFailed){tinyMCE.triggerNodeChange();return;}}if(tinyMCE.isOpera&&insertHTMLFailed){this.getDoc().execCommand("insertimage",false,tinyMCE.uniqueURL);var ar=tinyMCE.getElementsByAttributeValue(this.getBody(),"img","src",tinyMCE.uniqueURL);ar[0].outerHTML=value;return;}if(!tinyMCE.isMSIE){var isHTML=value.indexOf('<')!=-1;var sel=this.getSel();var rng=this.getRng();if(isHTML){if(tinyMCE.isSafari){var tmpRng=this.getDoc().createRange();tmpRng.setStart(this.getBody(),0);tmpRng.setEnd(this.getBody(),0);value=tmpRng.createContextualFragment(value);}else value=rng.createContextualFragment(value);}else{var el=document.createElement("div");el.innerHTML=value;value=el.firstChild.nodeValue;value=doc.createTextNode(value);}if(tinyMCE.isSafari&&!isHTML){this.execCommand('InsertText',false,value.nodeValue);tinyMCE.triggerNodeChange();return true;}else if(tinyMCE.isSafari&&isHTML){rng.deleteContents();rng.insertNode(value);tinyMCE.triggerNodeChange();return true;}rng.deleteContents();if(rng.startContainer.nodeType==3){var node=rng.startContainer.splitText(rng.startOffset);node.parentNode.insertBefore(value,node);}else rng.insertNode(value);if(!isHTML){sel.selectAllChildren(doc.body);sel.removeAllRanges();var rng=doc.createRange();rng.selectNode(value);rng.collapse(false);sel.addRange(rng);}else rng.collapse(false);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value);}else{var rng=doc.selection.createRange();var c=value.indexOf('<!--')!=-1;if(c)value=tinyMCE.uniqueTag+value;if(rng.item)rng.item(0).outerHTML=value;else rng.pasteHTML(value);if(c){var e=this.getDoc().getElementById('mceTMPElement');e.parentNode.removeChild(e);}}tinyMCE.triggerNodeChange();break;case"mceStartTyping":if(tinyMCE.settings['custom_undo_redo']&&this.undoRedo.typingUndoIndex==-1){this.undoRedo.typingUndoIndex=this.undoRedo.undoIndex;this.execCommand('mceAddUndoLevel');}break;case"mceEndTyping":if(tinyMCE.settings['custom_undo_redo']&&this.undoRedo.typingUndoIndex!=-1){this.execCommand('mceAddUndoLevel');this.undoRedo.typingUndoIndex=-1;}break;case"mceBeginUndoLevel":this.undoRedoLevel=false;break;case"mceEndUndoLevel":this.undoRedoLevel=true;this.execCommand('mceAddUndoLevel');break;case"mceAddUndoLevel":if(tinyMCE.settings['custom_undo_redo']&&this.undoRedoLevel){if(this.undoRedo.add())tinyMCE.triggerNodeChange(false);}break;case"Undo":if(tinyMCE.settings['custom_undo_redo']){tinyMCE.execCommand("mceEndTyping");this.undoRedo.undo();tinyMCE.triggerNodeChange();}else this.getDoc().execCommand(command,user_interface,value);break;case"Redo":if(tinyMCE.settings['custom_undo_redo']){tinyMCE.execCommand("mceEndTyping");this.undoRedo.redo();tinyMCE.triggerNodeChange();}else this.getDoc().execCommand(command,user_interface,value);break;case"mceToggleVisualAid":this.visualAid=!this.visualAid;tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE.triggerNodeChange();break;case"Indent":this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();if(tinyMCE.isMSIE){var n=tinyMCE.getParentElement(this.getFocusElement(),"blockquote");do{if(n&&n.nodeName=="BLOCKQUOTE"){n.removeAttribute("dir");n.removeAttribute("style");}}while(n!=null&&(n=n.parentNode)!=null);}break;case"removeformat":var text=this.selection.getSelectedText();if(tinyMCE.isOpera){this.getDoc().execCommand("RemoveFormat",false,null);return;}if(tinyMCE.isMSIE){try{var rng=doc.selection.createRange();rng.execCommand("RemoveFormat",false,null);}catch(e){}this.execCommand("SetStyleInfo",false,{command:"removeformat"});}else{this.getDoc().execCommand(command,user_interface,value);this.execCommand("SetStyleInfo",false,{command:"removeformat"});}if(text.length==0)this.execCommand("mceSetCSSClass",false,"");tinyMCE.triggerNodeChange();break;default:this.getDoc().execCommand(command,user_interface,value);if(tinyMCE.isGecko)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);else tinyMCE.triggerNodeChange();}if(command!="mceAddUndoLevel"&&command!="Undo"&&command!="Redo"&&command!="mceStartTyping"&&command!="mceEndTyping")tinyMCE.execCommand("mceAddUndoLevel");},queryCommandValue:function(c){try{return this.getDoc().queryCommandValue(c);}catch(e){return null;}},queryCommandState:function(c){return this.getDoc().queryCommandState(c);},_onAdd:function(replace_element,form_element_name,target_document){var hc,th,to,editorTemplate;th=this.settings['theme'];to=tinyMCE.themes[th];var targetDoc=target_document?target_document:document;this.targetDoc=targetDoc;tinyMCE.themeURL=tinyMCE.baseURL+"/themes/"+this.settings['theme'];this.settings['themeurl']=tinyMCE.themeURL;if(!replace_element){alert("Error: Could not find the target element.");return false;}if(to.getEditorTemplate)editorTemplate=to.getEditorTemplate(this.settings,this.editorId);var deltaWidth=editorTemplate['delta_width']?editorTemplate['delta_width']:0;var deltaHeight=editorTemplate['delta_height']?editorTemplate['delta_height']:0;var html='<span id="'+this.editorId+'_parent" class="mceEditorContainer">'+editorTemplate['html'];html=tinyMCE.replaceVar(html,"editor_id",this.editorId);this.settings['default_document']=tinyMCE.baseURL+"/blank.htm";this.settings['old_width']=this.settings['width'];this.settings['old_height']=this.settings['height'];if(this.settings['width']==-1)this.settings['width']=replace_element.offsetWidth;if(this.settings['height']==-1)this.settings['height']=replace_element.offsetHeight;if(this.settings['width']==0)this.settings['width']=replace_element.style.width;if(this.settings['height']==0)this.settings['height']=replace_element.style.height;if(this.settings['width']==0)this.settings['width']=320;if(this.settings['height']==0)this.settings['height']=240;this.settings['area_width']=parseInt(this.settings['width']);this.settings['area_height']=parseInt(this.settings['height']);this.settings['area_width']+=deltaWidth;this.settings['area_height']+=deltaHeight;if((""+this.settings['width']).indexOf('%')!=-1)this.settings['area_width']="100%";if((""+this.settings['height']).indexOf('%')!=-1)this.settings['area_height']="100%";if((""+replace_element.style.width).indexOf('%')!=-1){this.settings['width']=replace_element.style.width;this.settings['area_width']="100%";}if((""+replace_element.style.height).indexOf('%')!=-1){this.settings['height']=replace_element.style.height;this.settings['area_height']="100%";}html=tinyMCE.applyTemplate(html);this.settings['width']=this.settings['old_width'];this.settings['height']=this.settings['old_height'];this.visualAid=this.settings['visual'];this.formTargetElementId=form_element_name;if(replace_element.nodeName=="TEXTAREA"||replace_element.nodeName=="INPUT")this.startContent=replace_element.value;else this.startContent=replace_element.innerHTML;if(replace_element.nodeName!="TEXTAREA"&&replace_element.nodeName!="INPUT"){this.oldTargetElement=replace_element;if(tinyMCE.settings['debug']){hc='<textarea wrap="off" id="'+form_element_name+'" name="'+form_element_name+'" cols="100" rows="15"></textarea>';}else{hc='<input type="hidden" id="'+form_element_name+'" name="'+form_element_name+'" />';this.oldTargetElement.style.display="none";}html+='</span>';if(tinyMCE.isGecko)html=hc+html;else html+=hc;if(tinyMCE.isGecko){var rng=replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);var fragment=rng.createContextualFragment(html);tinyMCE.insertAfter(fragment,replace_element);}else replace_element.insertAdjacentHTML("beforeBegin",html);}else{html+='</span>';this.oldTargetElement=replace_element;if(!tinyMCE.settings['debug'])this.oldTargetElement.style.display="none";if(tinyMCE.isGecko){var rng=replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);var fragment=rng.createContextualFragment(html);tinyMCE.insertAfter(fragment,replace_element);}else replace_element.insertAdjacentHTML("beforeBegin",html);}var dynamicIFrame=false;var tElm=targetDoc.getElementById(this.editorId);if(!tinyMCE.isMSIE){if(tElm&&(tElm.nodeName=="SPAN"||tElm.nodeName=="span")){tElm=tinyMCE._createIFrame(tElm,targetDoc);dynamicIFrame=true;}this.targetElement=tElm;this.iframeElement=tElm;this.contentDocument=tElm.contentDocument;this.contentWindow=tElm.contentWindow;}else{if(tElm&&tElm.nodeName=="SPAN")tElm=tinyMCE._createIFrame(tElm,targetDoc,targetDoc.parentWindow);else tElm=targetDoc.frames[this.editorId];this.targetElement=tElm;this.iframeElement=targetDoc.getElementById(this.editorId);if(tinyMCE.isOpera){this.contentDocument=this.iframeElement.contentDocument;this.contentWindow=this.iframeElement.contentWindow;dynamicIFrame=true;}else{this.contentDocument=tElm.window.document;this.contentWindow=tElm.window;}this.getDoc().designMode="on";}var doc=this.contentDocument;if(dynamicIFrame){var html=tinyMCE.getParam('doctype')+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+tinyMCE.settings['base_href']+'" /><title>blank_page</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body class="mceContentBody"></body></html>';try{if(!this.isHidden())this.getDoc().designMode="on";doc.open();doc.write(html);doc.close();}catch(e){this.getDoc().location.href=tinyMCE.baseURL+"/blank.htm";}}if(tinyMCE.isMSIE)window.setTimeout("tinyMCE.addEventHandlers(tinyMCE.instances[\""+this.editorId+"\"]);",1);tinyMCE.setupContent(this.editorId,true);return true;},setBaseHREF:function(u){var h,b,d,nl;d=this.getDoc();nl=d.getElementsByTagName("base");b=nl.length>0?nl[0]:null;if(!b){nl=d.getElementsByTagName("head");h=nl.length>0?nl[0]:null;b=d.createElement("base");b.setAttribute('href',u);h.appendChild(b);}else{if(u==""||u==null)b.parentNode.removeChild(b);else b.setAttribute('href',u);}},getFocusElement:function(){return this.selection.getFocusElement();},getSel:function(){return this.selection.getSel();},getRng:function(){return this.selection.getRng();},triggerSave:function(skip_cleanup,skip_callback){var e,nl=new Array(),i,s;this.switchSettings();s=tinyMCE.settings;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){e=this.iframeElement;do{if(e.style&&e.style.display=='none'){e.style.display='block';nl[nl.length]={elm:e,type:'style'};}if(e.style&&s.hidden_tab_class.length>0&&e.className.indexOf(s.hidden_tab_class)!=-1){e.className=s.display_tab_class;nl[nl.length]={elm:e,type:'class'};}}while((e=e.parentNode)!=null)}tinyMCE.settings['preformatted']=false;if(typeof(skip_cleanup)=="undefined")skip_cleanup=false;if(typeof(skip_callback)=="undefined")skip_callback=false;tinyMCE._setHTML(this.getDoc(),this.getBody().innerHTML);if(this.settings['cleanup']==false){tinyMCE.handleVisualAid(this.getBody(),true,false,this);tinyMCE._setEventsEnabled(this.getBody(),true);}tinyMCE._customCleanup(this,"submit_content_dom",this.contentWindow.document.body);var htm=skip_cleanup?this.getBody().innerHTML:tinyMCE._cleanupHTML(this,this.getDoc(),this.settings,this.getBody(),tinyMCE.visualAid,true,true);htm=tinyMCE._customCleanup(this,"submit_content",htm);if(!skip_callback&&tinyMCE.settings['save_callback']!="")var content=eval(tinyMCE.settings['save_callback']+"(this.formTargetElementId,htm,this.getBody());");if((typeof(content)!="undefined")&&content!=null)htm=content;htm=tinyMCE.regexpReplace(htm,"&#40;","(","gi");htm=tinyMCE.regexpReplace(htm,"&#41;",")","gi");htm=tinyMCE.regexpReplace(htm,"&#59;",";","gi");htm=tinyMCE.regexpReplace(htm,"&#34;","&quot;","gi");htm=tinyMCE.regexpReplace(htm,"&#94;","^","gi");if(this.formElement)this.formElement.value=htm;if(tinyMCE.isSafari&&this.formElement)this.formElement.innerText=htm;for(i=0;i<nl.length;i++){if(nl[i].type=='style')nl[i].elm.style.display='none';else nl[i].elm.className=s.hidden_tab_class;}}};TinyMCE_Engine.prototype.cleanupHTMLCode=function(s){s=s.replace(new RegExp('<p \\/>','gi'),'<p>&nbsp;</p>');s=s.replace(new RegExp('<p>\\s*<\\/p>','gi'),'<p>&nbsp;</p>');s=s.replace(new RegExp('<br>\\s*<\\/br>','gi'),'<br />');s=s.replace(new RegExp('<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\\\|>]*)\\/>','gi'),'<$1$2$3></$1$2>');s=s.replace(new RegExp('\\s+></','gi'),'></');s=s.replace(new RegExp('<(img|br|hr)([^>]*)><\\/(img|br|hr)>','gi'),'<$1$2 />');if(tinyMCE.isMSIE)s=s.replace(new RegExp('<p><hr \\/><\\/p>','gi'),"<hr>");if(tinyMCE.getParam('convert_urls'))s=s.replace(new RegExp('(href=\"{0,1})(\\s*#)','gi'),'$1'+tinyMCE.settings['document_base_url']+"#");return s;};TinyMCE_Engine.prototype.parseStyle=function(str){var ar=new Array();if(str==null)return ar;var st=str.split(';');tinyMCE.clearArray(ar);for(var i=0;i<st.length;i++){if(st[i]=='')continue;var re=new RegExp('^\\s*([^:]*):\\s*(.*)\\s*$');var pa=st[i].replace(re,'$1||$2').split('||');if(pa.length==2)ar[pa[0].toLowerCase()]=pa[1];}return ar;};TinyMCE_Engine.prototype.compressStyle=function(ar,pr,sf,res){var box=new Array();box[0]=ar[pr+'-top'+sf];box[1]=ar[pr+'-left'+sf];box[2]=ar[pr+'-right'+sf];box[3]=ar[pr+'-bottom'+sf];for(var i=0;i<box.length;i++){if(box[i]==null)return;for(var a=0;a<box.length;a++){if(box[a]!=box[i])return;}}ar[res]=box[0];ar[pr+'-top'+sf]=null;ar[pr+'-left'+sf]=null;ar[pr+'-right'+sf]=null;ar[pr+'-bottom'+sf]=null;};TinyMCE_Engine.prototype.serializeStyle=function(ar){var str="";tinyMCE.compressStyle(ar,"border","","border");tinyMCE.compressStyle(ar,"border","-width","border-width");tinyMCE.compressStyle(ar,"border","-color","border-color");tinyMCE.compressStyle(ar,"border","-style","border-style");tinyMCE.compressStyle(ar,"padding","","padding");tinyMCE.compressStyle(ar,"margin","","margin");for(var key in ar){var val=ar[key];if(typeof(val)=='function')continue;if(key.indexOf('mso-')==0)continue;if(val!=null&&val!=''){val=''+val;val=val.replace(new RegExp("url\\(\\'?([^\\']*)\\'?\\)",'gi'),"url('$1')");if(val.indexOf('url(')!=-1&&tinyMCE.getParam('convert_urls')){var m=new RegExp("url\\('(.*?)'\\)").exec(val);if(m.length>1)val="url('"+eval(tinyMCE.getParam('urlconverter_callback')+"(m[1], null, true);")+"')";}if(tinyMCE.getParam("force_hex_style_colors"))val=tinyMCE.convertRGBToHex(val,true);if(val!="url('')")str+=key.toLowerCase()+": "+val+"; ";}}if(new RegExp('; $').test(str))str=str.substring(0,str.length-2);return str;};TinyMCE_Engine.prototype.convertRGBToHex=function(s,k){if(s.toLowerCase().indexOf('rgb')!=-1){var re=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi");var rgb=s.replace(re,"$1,$2,$3,$4,$5").split(',');if(rgb.length==5){r=parseInt(rgb[1]).toString(16);g=parseInt(rgb[2]).toString(16);b=parseInt(rgb[3]).toString(16);r=r.length==1?'0'+r:r;g=g.length==1?'0'+g:g;b=b.length==1?'0'+b:b;s="#"+r+g+b;if(k)s=rgb[0]+s+rgb[4];}}return s;};TinyMCE_Engine.prototype.convertHexToRGB=function(s){if(s.indexOf('#')!=-1){s=s.replace(new RegExp('[^0-9A-F]','gi'),'');return"rgb("+parseInt(s.substring(0,2),16)+","+parseInt(s.substring(2,4),16)+","+parseInt(s.substring(4,6),16)+")";}return s;};TinyMCE_Engine.prototype.convertSpansToFonts=function(doc){var sizes=tinyMCE.getParam('font_size_style_values').replace(/\s+/,'').split(',');var h=doc.body.innerHTML;h=h.replace(/<span/gi,'<font');h=h.replace(/<\/span/gi,'</font');doc.body.innerHTML=h;var s=doc.getElementsByTagName("font");for(var i=0;i<s.length;i++){var size=tinyMCE.trim(s[i].style.fontSize).toLowerCase();var fSize=0;for(var x=0;x<sizes.length;x++){if(sizes[x]==size){fSize=x+1;break;}}if(fSize>0){tinyMCE.setAttrib(s[i],'size',fSize);s[i].style.fontSize='';}var fFace=s[i].style.fontFamily;if(fFace!=null&&fFace!=""){tinyMCE.setAttrib(s[i],'face',fFace);s[i].style.fontFamily='';}var fColor=s[i].style.color;if(fColor!=null&&fColor!=""){tinyMCE.setAttrib(s[i],'color',tinyMCE.convertRGBToHex(fColor));s[i].style.color='';}}};TinyMCE_Engine.prototype.convertFontsToSpans=function(doc){var sizes=tinyMCE.getParam('font_size_style_values').replace(/\s+/,'').split(',');var h=doc.body.innerHTML;h=h.replace(/<font/gi,'<span');h=h.replace(/<\/font/gi,'</span');doc.body.innerHTML=h;var fsClasses=tinyMCE.getParam('font_size_classes');if(fsClasses!='')fsClasses=fsClasses.replace(/\s+/,'').split(',');else fsClasses=null;var s=doc.getElementsByTagName("span");for(var i=0;i<s.length;i++){var fSize,fFace,fColor;fSize=tinyMCE.getAttrib(s[i],'size');fFace=tinyMCE.getAttrib(s[i],'face');fColor=tinyMCE.getAttrib(s[i],'color');if(fSize!=""){fSize=parseInt(fSize);if(fSize>0&&fSize<8){if(fsClasses!=null)tinyMCE.setAttrib(s[i],'class',fsClasses[fSize-1]);else s[i].style.fontSize=sizes[fSize-1];}s[i].removeAttribute('size');}if(fFace!=""){s[i].style.fontFamily=fFace;s[i].removeAttribute('face');}if(fColor!=""){s[i].style.color=fColor;s[i].removeAttribute('color');}}};TinyMCE_Engine.prototype.cleanupAnchors=function(doc){var i,cn,x,an=doc.getElementsByTagName("a");for(i=an.length-1;i>=0;i--){if(tinyMCE.getAttrib(an[i],"name")!=""&&tinyMCE.getAttrib(an[i],"href")==""){cn=an[i].childNodes;for(x=cn.length-1;x>=0;x--)tinyMCE.insertAfter(cn[x],an[i]);}}};TinyMCE_Engine.prototype.getContent=function(editor_id){var h;if(typeof(editor_id)!="undefined")tinyMCE.selectedInstance=tinyMCE.getInstanceById(editor_id);if(tinyMCE.selectedInstance){h=tinyMCE._cleanupHTML(this.selectedInstance,this.selectedInstance.getDoc(),tinyMCE.settings,this.selectedInstance.getBody(),false,true);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(this.selectedInstance.getDoc());return h;}return null;};TinyMCE_Engine.prototype._fixListElements=function(d){var nl,x,a=['ol','ul'],i,n,p,r=new RegExp('^(OL|UL)$'),np;for(x=0;x<a.length;x++){nl=d.getElementsByTagName(a[x]);for(i=0;i<nl.length;i++){n=nl[i];p=n.parentNode;if(r.test(p.nodeName)){np=tinyMCE.prevNode(n,'LI');if(!np){np=d.createElement('li');np.innerHTML='&nbsp;';np.appendChild(n);p.insertBefore(np,p.firstChild);}else np.appendChild(n);}}}};TinyMCE_Engine.prototype._fixTables=function(d){var nl,i,n,p,np,x,t;nl=d.getElementsByTagName('table');for(i=0;i<nl.length;i++){n=nl[i];if((p=tinyMCE.getParentElement(n,'p,div,h1,h2,h3,h4,h5,h6'))!=null){np=p.cloneNode(false);np.removeAttribute('id');t=n;while((n=n.nextSibling))np.appendChild(n);tinyMCE.insertAfter(np,p);tinyMCE.insertAfter(t,p);}}};TinyMCE_Engine.prototype._cleanupHTML=function(inst,doc,config,elm,visual,on_save,on_submit){var h,d,t1,t2,t3,t4,t5,c,s;if(!tinyMCE.getParam('cleanup'))return elm.innerHTML;on_save=typeof(on_save)=='undefined'?false:on_save;c=inst.cleanup;s=inst.settings;d=c.settings.debug;if(d)t1=new Date().getTime();if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertFontsToSpans(doc);if(tinyMCE.getParam("fix_list_elements"))tinyMCE._fixListElements(doc);if(tinyMCE.getParam("fix_table_elements"))tinyMCE._fixTables(doc);tinyMCE._customCleanup(inst,on_save?"get_from_editor_dom":"insert_to_editor_dom",doc.body);if(d)t2=new Date().getTime();c.settings.on_save=on_save;c.idCount=0;c.serializationId++;c.serializedNodes=new Array();c.sourceIndex=-1;if(s.cleanup_serializer=="xml")h=c.serializeNodeAsXML(elm);else h=c.serializeNodeAsHTML(elm);if(d)t3=new Date().getTime();h=h.replace(/<\/?(body|head|html)[^>]*>/gi,'');h=h.replace(new RegExp(' (rowspan="1"|colspan="1")','g'),'');h=h.replace(/<p><hr \/><\/p>/g,'<hr />');h=h.replace(/<p>(&nbsp;|&#160;)<\/p><hr \/><p>(&nbsp;|&#160;)<\/p>/g,'<hr />');h=h.replace(/<td>\s*<br \/>\s*<\/td>/g,'<td>&nbsp;</td>');h=h.replace(/<p>\s*<br \/>\s*<\/p>/g,'<p>&nbsp;</p>');h=h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*(&nbsp;|&#160;)\s*<\/p>/g,'<p>&nbsp;</p>');h=h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*<\/p>/g,'<p>&nbsp;</p>');h=h.replace(/<p>\s*<br \/>\s*&nbsp;\s*<\/p>/g,'<p>&nbsp;</p>');h=h.replace(new RegExp('<a>(.*?)<\\/a>','g'),'$1');h=h.replace(/<p([^>]*)>\s*<\/p>/g,'<p$1>&nbsp;</p>');if(/^\s*(<br \/>|<p>&nbsp;<\/p>|<p>&#160;<\/p>|<p><\/p>)\s*$/.test(h))h='';if(s.preformatted){h=h.replace(/^<pre>/,'');h=h.replace(/<\/pre>$/,'');h='<pre>'+h+'</pre>';}if(tinyMCE.isGecko){h=h.replace(/<o:p _moz-userdefined="" \/>/g,'');h=h.replace(/<td([^>]*)>\s*<br \/>\s*<\/td>/g,'<td$1>&nbsp;</td>');}if(s.force_br_newlines)h=h.replace(/<p>(&nbsp;|&#160;)<\/p>/g,'<br />');h=tinyMCE._customCleanup(inst,on_save?"get_from_editor":"insert_to_editor",h);if(on_save){h=h.replace(new RegExp(' ?(mceItem[a-zA-Z0-9]*|'+s.visual_table_class+')','g'),'');h=h.replace(new RegExp(' ?class=""','g'),'');}if(s.remove_linebreaks&&!c.settings.indent)h=h.replace(/\n|\r/g,' ');if(d)t4=new Date().getTime();if(on_save&&c.settings.indent)h=c.formatHTML(h);if(on_submit&&(s.encoding=="xml"||s.encoding=="html"))h=c.xmlEncode(h);if(d)t5=new Date().getTime();if(c.settings.debug)tinyMCE.debug("Cleanup in ms: Pre="+(t2-t1)+", Serialize: "+(t3-t2)+", Post: "+(t4-t3)+", Format: "+(t5-t4)+", Sum: "+(t5-t1)+".");return h;};function TinyMCE_Cleanup(){this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.rules=tinyMCE.clearArray(new Array());this.settings={indent_elements:'head,table,tbody,thead,tfoot,form,tr,ul,ol,blockquote,object',newline_before_elements:'h1,h2,h3,h4,h5,h6,pre,address,div,ul,ol,li,meta,option,area,title,link,base,script,td',newline_after_elements:'br,hr,p,pre,address,div,ul,ol,meta,option,area,link,base,script',newline_before_after_elements:'html,head,body,table,thead,tbody,tfoot,tr,form,ul,ol,blockquote,p,object,param,hr,div',indent_char:'\t',indent_levels:1,entity_encoding:'raw',valid_elements:'*[*]',entities:'',url_converter:'',invalid_elements:'',verify_html:false};this.vElements=tinyMCE.clearArray(new Array());this.vElementsRe='';this.closeElementsRe=/^(IMG|BR|HR|LINK|META|BASE|INPUT|BUTTON|AREA)$/;this.codeElementsRe=/^(SCRIPT|STYLE)$/;this.serializationId=0;this.mceAttribs={href:'mce_href',src:'mce_src',type:'mce_type'};}TinyMCE_Cleanup.prototype={init:function(s){var n,a,i,ir,or,st;for(n in s)this.settings[n]=s[n];s=this.settings;this.inRe=this._arrayToRe(s.indent_elements.split(','),'','^<(',')[^>]*');this.ouRe=this._arrayToRe(s.indent_elements.split(','),'','^<\\/(',')[^>]*');this.nlBeforeRe=this._arrayToRe(s.newline_before_elements.split(','),'gi','<(',')([^>]*)>');this.nlAfterRe=this._arrayToRe(s.newline_after_elements.split(','),'gi','<(',')([^>]*)>');this.nlBeforeAfterRe=this._arrayToRe(s.newline_before_after_elements.split(','),'gi','<(\\/?)(',')([^>]*)>');if(s.invalid_elements!='')this.iveRe=this._arrayToRe(s.invalid_elements.toUpperCase().split(','),'g','^(',')$');else this.iveRe=null;st='';for(i=0;i<s.indent_levels;i++)st+=s.indent_char;this.inStr=st;if(!s.verify_html){s.valid_elements='*[*]';s.extended_valid_elements='';}this.fillStr=s.entity_encoding=="named"?"&nbsp;":"&#160;";this.idCount=0;},addRuleStr:function(s){var r=this.parseRuleStr(s);var n;for(n in r){if(r[n])this.rules[n]=r[n];}this.vElements=tinyMCE.clearArray(new Array());for(n in this.rules){if(this.rules[n])this.vElements[this.vElements.length]=this.rules[n].tag;}this.vElementsRe=this._arrayToRe(this.vElements,'');},parseRuleStr:function(s){var ta,p,r,a,i,x,px,t,tn,y,av,or=tinyMCE.clearArray(new Array()),dv;if(s==null||s.length==0)return or;ta=s.split(',');for(x=0;x<ta.length;x++){s=ta[x];if(s.length==0)continue;p=this.split(/\[|\]/,s);if(p==null||p.length<1)t=s.toUpperCase();else t=p[0].toUpperCase();tn=this.split('/',t);for(y=0;y<tn.length;y++){r={};r.tag=tn[y];r.forceAttribs=null;r.defaultAttribs=null;r.validAttribValues=null;px=r.tag.charAt(0);r.forceOpen=px=='+';r.removeEmpty=px=='-';r.fill=px=='#';r.tag=r.tag.replace(/\+|-|#/g,'');r.oTagName=tn[0].replace(/\+|-|#/g,'').toLowerCase();r.isWild=new RegExp('\\*|\\?|\\+','g').test(r.tag);r.validRe=new RegExp(this._wildcardToRe('^'+r.tag+'$'));if(p.length>1){r.vAttribsRe='^(';a=this.split(/\|/,p[1]);for(i=0;i<a.length;i++){t=a[i];av=new RegExp('(=|:|<)(.*?)$').exec(t);t=t.replace(new RegExp('(=|:|<).*?$'),'');if(av&&av.length>0){if(av[0].charAt(0)==':'){if(!r.forceAttribs)r.forceAttribs=tinyMCE.clearArray(new Array());r.forceAttribs[t.toLowerCase()]=av[0].substring(1);}else if(av[0].charAt(0)=='='){if(!r.defaultAttribs)r.defaultAttribs=tinyMCE.clearArray(new Array());dv=av[0].substring(1);r.defaultAttribs[t.toLowerCase()]=dv==""?"mce_empty":dv;}else if(av[0].charAt(0)=='<'){if(!r.validAttribValues)r.validAttribValues=tinyMCE.clearArray(new Array());r.validAttribValues[t.toLowerCase()]=this._arrayToRe(this.split('?',av[0].substring(1)),'');}}r.vAttribsRe+=''+t.toLowerCase()+(i!=a.length-1?'|':'');a[i]=t.toLowerCase();}r.vAttribsRe+=')$';r.vAttribsRe=this._wildcardToRe(r.vAttribsRe);r.vAttribsReIsWild=new RegExp('\\*|\\?|\\+','g').test(r.vAttribsRe);r.vAttribsRe=new RegExp(r.vAttribsRe);r.vAttribs=a.reverse();}else{r.vAttribsRe='';r.vAttribs=tinyMCE.clearArray(new Array());r.vAttribsReIsWild=false;}or[r.tag]=r;}}return or;},serializeNodeAsXML:function(n){var s,b;if(!this.xmlDoc){if(this.isMSIE){try{this.xmlDoc=new ActiveXObject('MSXML2.DOMDocument');}catch(e){}if(!this.xmlDoc)try{this.xmlDoc=new ActiveXObject('Microsoft.XmlDom');}catch(e){}}else this.xmlDoc=document.implementation.createDocument('','',null);if(!this.xmlDoc)alert("Error XML Parser could not be found.");}if(this.xmlDoc.firstChild)this.xmlDoc.removeChild(this.xmlDoc.firstChild);b=this.xmlDoc.createElement("html");b=this.xmlDoc.appendChild(b);this._convertToXML(n,b);if(this.isMSIE)return this.xmlDoc.xml;else return new XMLSerializer().serializeToString(this.xmlDoc);},_convertToXML:function(n,xn){var xd,el,i,l,cn,at,no,hc=false;if(this._isDuplicate(n))return;xd=this.xmlDoc;switch(n.nodeType){case 1:hc=n.hasChildNodes();el=xd.createElement(n.nodeName.toLowerCase());at=n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified&&no.nodeValue)el.setAttribute(no.nodeName.toLowerCase(),no.nodeValue);}if(!hc&&!this.closeElementsRe.test(n.nodeName))el.appendChild(xd.createTextNode(""));xn=xn.appendChild(el);break;case 3:xn.appendChild(xd.createTextNode(n.nodeValue));return;case 8:xn.appendChild(xd.createComment(n.nodeValue));return;}if(hc){cn=n.childNodes;for(i=0,l=cn.length;i<l;i++)this._convertToXML(cn[i],xn);}},serializeNodeAsHTML:function(n){var en,no,h='',i,l,r,cn,va=false,f=false,at,hc;this._setupRules();if(this._isDuplicate(n))return'';switch(n.nodeType){case 1:hc=n.hasChildNodes();if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&n.nodeName.indexOf('/')!=-1)break;if(this.vElementsRe.test(n.nodeName)&&(!this.iveRe||!this.iveRe.test(n.nodeName))){va=true;r=this.rules[n.nodeName];if(!r){at=this.rules;for(no in at){if(at[no]&&at[no].validRe.test(n.nodeName)){r=at[no];break;}}}en=r.isWild?n.nodeName.toLowerCase():r.oTagName;f=r.fill;if(r.removeEmpty&&!hc)return"";h+='<'+en;if(r.vAttribsReIsWild){at=n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified&&r.vAttribsRe.test(no.nodeName))h+=this._serializeAttribute(n,r,no.nodeName);}}else{for(i=r.vAttribs.length-1;i>-1;i--)h+=this._serializeAttribute(n,r,r.vAttribs[i]);}if(!this.settings.on_save){at=this.mceAttribs;for(no in at){if(at[no])h+=this._serializeAttribute(n,r,at[no]);}}if(this.closeElementsRe.test(n.nodeName))return h+' />';h+='>';if(this.isMSIE&&this.codeElementsRe.test(n.nodeName))h+=n.innerHTML;}break;case 3:if(n.parentNode&&this.codeElementsRe.test(n.parentNode.nodeName))return this.isMSIE?'':n.nodeValue;return this.xmlEncode(n.nodeValue);case 8:return"<!--"+this._trimComment(n.nodeValue)+"-->";}if(hc){cn=n.childNodes;for(i=0,l=cn.length;i<l;i++)h+=this.serializeNodeAsHTML(cn[i]);}if(f&&!hc)h+=this.fillStr;if(va)h+='</'+en+'>';return h;},_serializeAttribute:function(n,r,an){var av='',t,os=this.settings.on_save;if(os&&(an.indexOf('mce_')==0||an.indexOf('_moz')==0))return'';if(os&&this.mceAttribs[an])av=this._getAttrib(n,this.mceAttribs[an]);if(av.length==0)av=this._getAttrib(n,an);if(av.length==0&&r.defaultAttribs&&(t=r.defaultAttribs[an])){av=t;if(av=="mce_empty")return" "+an+'=""';}if(r.forceAttribs&&(t=r.forceAttribs[an]))av=t;if(os&&av.length!=0&&this.settings.url_converter.length!=0&&/^(src|href|longdesc)$/.test(an))av=eval(this.settings.url_converter+'(this, n, av)');if(av.length!=0&&r.validAttribValues&&r.validAttribValues[an]&&!r.validAttribValues[an].test(av))return"";if(av.length!=0&&av=="{$uid}")av="uid_"+(this.idCount++);if(av.length!=0)return" "+an+"="+'"'+this.xmlEncode(av)+'"';return"";},formatHTML:function(h){var s=this.settings,p='',i=0,li=0,o='',l;h=h.replace(/\r/g,'');h='\n'+h;h=h.replace(new RegExp('\\n\\s+','gi'),'\n');h=h.replace(this.nlBeforeRe,'\n<$1$2>');h=h.replace(this.nlAfterRe,'<$1$2>\n');h=h.replace(this.nlBeforeAfterRe,'\n<$1$2$3>\n');h+='\n';while((i=h.indexOf('\n',i+1))!=-1){if((l=h.substring(li+1,i)).length!=0){if(this.ouRe.test(l)&&p.length>=s.indent_levels)p=p.substring(s.indent_levels);o+=p+l+'\n';if(this.inRe.test(l))p+=this.inStr;}li=i;}return o;},xmlEncode:function(s){var i,l,e,o='',c;this._setupEntities();switch(this.settings.entity_encoding){case"raw":return tinyMCE.xmlEncode(s);case"named":for(i=0,l=s.length;i<l;i++){c=s.charCodeAt(i);e=this.entities[c];if(e&&e!='')o+='&'+e+';';else o+=String.fromCharCode(c);}return o;case"numeric":for(i=0,l=s.length;i<l;i++){c=s.charCodeAt(i);if(c>127||c==60||c==62||c==38||c==39||c==34)o+='&#'+c+";";else o+=String.fromCharCode(c);}return o;}return s;},split:function(re,s){var c=s.split(re);var i,l,o=new Array();for(i=0,l=c.length;i<l;i++){if(c[i]!='')o[i]=c[i];}return o;},_trimComment:function(s){s=s.replace(new RegExp('\\smce_src=\"[^\"]*\"','gi'),"");s=s.replace(new RegExp('\\smce_href=\"[^\"]*\"','gi'),"");return s;},_getAttrib:function(e,n,d){if(typeof(d)=="undefined")d="";if(!e||e.nodeType!=1)return d;var v=e.getAttribute(n,0);if(n=="class"&&!v)v=e.className;if(this.isMSIE&&n=="http-equiv")v=e.httpEquiv;if(this.isMSIE&&e.nodeName=="FORM"&&n=="enctype"&&v=="application/x-www-form-urlencoded")v="";if(this.isMSIE&&e.nodeName=="INPUT"&&n=="size"&&v=="20")v="";if(this.isMSIE&&e.nodeName=="INPUT"&&n=="maxlength"&&v=="2147483647")v="";if(n=="style"&&!tinyMCE.isOpera)v=e.style.cssText;if(n=='style')v=tinyMCE.serializeStyle(tinyMCE.parseStyle(v));if(this.settings.on_save&&n.indexOf('on')!=-1&&this.settings.on_save&&v&&v!="")v=tinyMCE.cleanupEventStr(v);return(v&&v!="")?''+v:d;},_urlConverter:function(c,n,v){if(!c.settings.on_save)return tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,v);else if(tinyMCE.getParam('convert_urls'))return eval(tinyMCE.settings.urlconverter_callback+"(v, n, true);");return v;},_arrayToRe:function(a,op,be,af){var i,r;op=typeof(op)=="undefined"?"gi":op;be=typeof(be)=="undefined"?"^(":be;af=typeof(af)=="undefined"?")$":af;r=be;for(i=0;i<a.length;i++)r+=this._wildcardToRe(a[i])+(i!=a.length-1?"|":"");r+=af;return new RegExp(r,op);},_wildcardToRe:function(s){s=s.replace(/\?/g,'(\\S?)');s=s.replace(/\+/g,'(\\S+)');s=s.replace(/\*/g,'(\\S*)');return s;},_setupEntities:function(){var n,a,i,s=this.settings;if(!this.entitiesDone){if(s.entity_encoding=="named"){n=tinyMCE.clearArray(new Array());a=this.split(',',s.entities);for(i=0;i<a.length;i+=2)n[a[i]]=a[i+1];this.entities=n;}this.entitiesDone=true;}},_setupRules:function(){var s=this.settings;if(!this.rulesDone){this.addRuleStr(s.valid_elements);this.addRuleStr(s.extended_valid_elements);this.rulesDone=true;}},_isDuplicate:function(n){var i;if(!this.settings.fix_content_duplication)return false;if(tinyMCE.isMSIE&&!tinyMCE.isOpera&&n.nodeType==1){if(n.mce_serialized==this.serializationId)return true;n.setAttribute('mce_serialized',this.serializationId);}else{for(i=0;i<this.serializedNodes.length;i++){if(this.serializedNodes[i]==n)return true;}this.serializedNodes[this.serializedNodes.length]=n;}return false;}};TinyMCE_Engine.prototype.getElementByAttributeValue=function(n,e,a,v){return(n=this.getElementsByAttributeValue(n,e,a,v)).length==0?null:n[0];};TinyMCE_Engine.prototype.getElementsByAttributeValue=function(n,e,a,v){var i,nl=n.getElementsByTagName(e),o=new Array();for(i=0;i<nl.length;i++){if(tinyMCE.getAttrib(nl[i],a).indexOf(v)!=-1)o[o.length]=nl[i];}return o;};TinyMCE_Engine.prototype.isBlockElement=function(n){return n!=null&&n.nodeType==1&&this.blockRegExp.test(n.nodeName);};TinyMCE_Engine.prototype.getParentBlockElement=function(n){while(n){if(this.isBlockElement(n))return n;n=n.parentNode;}return null;};TinyMCE_Engine.prototype.insertAfter=function(n,r){if(r.nextSibling)r.parentNode.insertBefore(n,r.nextSibling);else r.parentNode.appendChild(n);};TinyMCE_Engine.prototype.setInnerHTML=function(e,h){var i,nl,n;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){h=h.replace(/\s\/>/g,'>');h=h.replace(/<p([^>]*)>\u00A0?<\/p>/gi,'<p$1 mce_keep="true">&nbsp;</p>');h=h.replace(/<p([^>]*)>\s*&nbsp;\s*<\/p>/gi,'<p$1 mce_keep="true">&nbsp;</p>');h=h.replace(/<p([^>]*)>\s+<\/p>/gi,'<p$1 mce_keep="true">&nbsp;</p>');e.innerHTML=tinyMCE.uniqueTag+h;e.firstChild.removeNode(true);nl=e.getElementsByTagName("p");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.nodeName=='P'&&!n.hasChildNodes()&&!n.mce_keep)n.parentNode.removeChild(n);}}else{h=this.fixGeckoBaseHREFBug(1,e,h);e.innerHTML=h;this.fixGeckoBaseHREFBug(2,e,h);}};TinyMCE_Engine.prototype.getOuterHTML=function(e){if(tinyMCE.isMSIE)return e.outerHTML;var d=e.ownerDocument.createElement("body");d.appendChild(e);return d.innerHTML;};TinyMCE_Engine.prototype.setOuterHTML=function(e,h){if(tinyMCE.isMSIE){e.outerHTML=h;return;}var d=e.ownerDocument.createElement("body");d.innerHTML=h;e.parentNode.replaceChild(d.firstChild,e);};TinyMCE_Engine.prototype._getElementById=function(id,d){var e,i,j,f;if(typeof(d)=="undefined")d=document;e=d.getElementById(id);if(!e){f=d.forms;for(i=0;i<f.length;i++){for(j=0;j<f[i].elements.length;j++){if(f[i].elements[j].name==id){e=f[i].elements[j];break;}}}}return e;};TinyMCE_Engine.prototype.getNodeTree=function(n,na,t,nn){var i;if(typeof(t)=="undefined"||n.nodeType==t&&(typeof(nn)=="undefined"||n.nodeName==nn))na[na.length]=n;if(n.hasChildNodes()){for(i=0;i<n.childNodes.length;i++)tinyMCE.getNodeTree(n.childNodes[i],na,t,nn);}return na;};TinyMCE_Engine.prototype.getParentElement=function(node,names,attrib_name,attrib_value){if(typeof(names)=="undefined"){if(node.nodeType==1)return node;while((node=node.parentNode)!=null&&node.nodeType!=1);return node;}if(node==null)return null;var namesAr=names.toUpperCase().split(',');do{for(var i=0;i<namesAr.length;i++){if(node.nodeName==namesAr[i]||names=="*"){if(typeof(attrib_name)=="undefined")return node;else if(node.getAttribute(attrib_name)){if(typeof(attrib_value)=="undefined"){if(node.getAttribute(attrib_name)!="")return node;}else if(node.getAttribute(attrib_name)==attrib_value)return node;}}}}while((node=node.parentNode)!=null);return null;};TinyMCE_Engine.prototype.getParentNode=function(n,f){while(n){if(f(n))return n;n=n.parentNode;}return null;};TinyMCE_Engine.prototype.getAttrib=function(elm,name,default_value){if(typeof(default_value)=="undefined")default_value="";if(!elm||elm.nodeType!=1)return default_value;var v=elm.getAttribute(name);if(name=="class"&&!v)v=elm.className;if(tinyMCE.isGecko&&name=="src"&&elm.src!=null&&elm.src!="")v=elm.src;if(tinyMCE.isGecko&&name=="href"&&elm.href!=null&&elm.href!="")v=elm.href;if(name=="http-equiv"&&tinyMCE.isMSIE)v=elm.httpEquiv;if(name=="style"&&!tinyMCE.isOpera)v=elm.style.cssText;return(v&&v!="")?v:default_value;};TinyMCE_Engine.prototype.setAttrib=function(element,name,value,fix_value){if(typeof(value)=="number"&&value!=null)value=""+value;if(fix_value){if(value==null)value="";var re=new RegExp('[^0-9%]','g');value=value.replace(re,'');}if(name=="style")element.style.cssText=value;if(name=="class")element.className=value;if(value!=null&&value!=""&&value!=-1)element.setAttribute(name,value);else element.removeAttribute(name);};TinyMCE_Engine.prototype.setStyleAttrib=function(elm,name,value){eval('elm.style.'+name+'=value;');if(tinyMCE.isMSIE&&value==null||value==''){var str=tinyMCE.serializeStyle(tinyMCE.parseStyle(elm.style.cssText));elm.style.cssText=str;elm.setAttribute("style",str);}};TinyMCE_Engine.prototype.switchClass=function(ei,c){var e;if(tinyMCE.switchClassCache[ei])e=tinyMCE.switchClassCache[ei];else e=tinyMCE.switchClassCache[ei]=document.getElementById(ei);if(e){if(tinyMCE.settings.button_tile_map&&e.className&&e.className.indexOf('mceTiledButton')==0)c='mceTiledButton '+c;e.className=c;}};TinyMCE_Engine.prototype.getAbsPosition=function(n){var p={absLeft:0,absTop:0};while(n){p.absLeft+=n.offsetLeft;p.absTop+=n.offsetTop;n=n.offsetParent;}return p;};TinyMCE_Engine.prototype.prevNode=function(e,n){var a=n.split(','),i;while((e=e.previousSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};TinyMCE_Engine.prototype.nextNode=function(e,n){var a=n.split(','),i;while((e=e.nextSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};TinyMCE_Engine.prototype.selectNodes=function(n,f,a){var i;if(!a)a=new Array();if(f(n))a[a.length]=n;if(n.hasChildNodes()){for(i=0;i<n.childNodes.length;i++)tinyMCE.selectNodes(n.childNodes[i],f,a);}return a;};TinyMCE_Engine.prototype.addCSSClass=function(e,c,b){var o=this.removeCSSClass(e,c);return e.className=b?c+(o!=''?(' '+o):''):(o!=''?(o+' '):'')+c;};TinyMCE_Engine.prototype.removeCSSClass=function(e,c){var a=this.explode(' ',e.className),i;for(i=0;i<a.length;i++){if(a[i]==c)a[i]='';}return e.className=a.join(' ');};TinyMCE_Engine.prototype.renameElement=function(e,n,d){var ne,i,ar;d=typeof(d)=="undefined"?tinyMCE.selectedInstance.getDoc():d;if(e){ne=d.createElement(n);ar=e.attributes;for(i=ar.length-1;i>-1;i--){if(ar[i].specified&&ar[i].nodeValue)ne.setAttribute(ar[i].nodeName.toLowerCase(),ar[i].nodeValue);}ar=e.childNodes;for(i=0;i<ar.length;i++)ne.appendChild(ar[i].cloneNode(true));e.parentNode.replaceChild(ne,e);}};TinyMCE_Engine.prototype.parseURL=function(url_str){var urlParts=new Array();if(url_str){var pos,lastPos;pos=url_str.indexOf('://');if(pos!=-1){urlParts['protocol']=url_str.substring(0,pos);lastPos=pos+3;}for(var i=lastPos;i<url_str.length;i++){var chr=url_str.charAt(i);if(chr==':')break;if(chr=='/')break;}pos=i;urlParts['host']=url_str.substring(lastPos,pos);urlParts['port']="";lastPos=pos;if(url_str.charAt(pos)==':'){pos=url_str.indexOf('/',lastPos);urlParts['port']=url_str.substring(lastPos+1,pos);}lastPos=pos;pos=url_str.indexOf('?',lastPos);if(pos==-1)pos=url_str.indexOf('#',lastPos);if(pos==-1)pos=url_str.length;urlParts['path']=url_str.substring(lastPos,pos);lastPos=pos;if(url_str.charAt(pos)=='?'){pos=url_str.indexOf('#');pos=(pos==-1)?url_str.length:pos;urlParts['query']=url_str.substring(lastPos+1,pos);}lastPos=pos;if(url_str.charAt(pos)=='#'){pos=url_str.length;urlParts['anchor']=url_str.substring(lastPos+1,pos);}}return urlParts;};TinyMCE_Engine.prototype.serializeURL=function(up){var o="";if(up['protocol'])o+=up['protocol']+"://";if(up['host'])o+=up['host'];if(up['port'])o+=":"+up['port'];if(up['path'])o+=up['path'];if(up['query'])o+="?"+up['query'];if(up['anchor'])o+="#"+up['anchor'];return o;};TinyMCE_Engine.prototype.convertAbsoluteURLToRelativeURL=function(base_url,url_to_relative){var baseURL=this.parseURL(base_url);var targetURL=this.parseURL(url_to_relative);var strTok1;var strTok2;var breakPoint=0;var outPath="";var forceSlash=false;if(targetURL.path=="")targetURL.path="/";else forceSlash=true;base_url=baseURL.path.substring(0,baseURL.path.lastIndexOf('/'));strTok1=base_url.split('/');strTok2=targetURL.path.split('/');if(strTok1.length>=strTok2.length){for(var i=0;i<strTok1.length;i++){if(i>=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(strTok1.length<strTok2.length){for(var i=0;i<strTok2.length;i++){if(i>=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(breakPoint==1)return targetURL.path;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outPath+="../";for(var i=breakPoint-1;i<strTok2.length;i++){if(i!=(breakPoint-1))outPath+="/"+strTok2[i];else outPath+=strTok2[i];}targetURL.protocol=null;targetURL.host=null;targetURL.port=null;targetURL.path=outPath==""&&forceSlash?"/":outPath;var fileName=baseURL.path;var pos;if((pos=fileName.lastIndexOf('/'))!=-1)fileName=fileName.substring(pos+1);if(fileName==targetURL.path&&targetURL.anchor!="")targetURL.path="";if(targetURL.path==""&&!targetURL.anchor)targetURL.path=fileName!=""?fileName:"/";return this.serializeURL(targetURL);};TinyMCE_Engine.prototype.convertRelativeToAbsoluteURL=function(base_url,relative_url){var baseURL=this.parseURL(base_url);var relURL=this.parseURL(relative_url);if(relative_url==""||relative_url.charAt(0)=='/'||relative_url.indexOf('://')!=-1||relative_url.indexOf('mailto:')!=-1||relative_url.indexOf('javascript:')!=-1)return relative_url;baseURLParts=baseURL['path'].split('/');relURLParts=relURL['path'].split('/');var newBaseURLParts=new Array();for(var i=baseURLParts.length-1;i>=0;i--){if(baseURLParts[i].length==0)continue;newBaseURLParts[newBaseURLParts.length]=baseURLParts[i];}baseURLParts=newBaseURLParts.reverse();var newRelURLParts=new Array();var numBack=0;for(var i=relURLParts.length-1;i>=0;i--){if(relURLParts[i].length==0||relURLParts[i]==".")continue;if(relURLParts[i]=='..'){numBack++;continue;}if(numBack>0){numBack--;continue;}newRelURLParts[newRelURLParts.length]=relURLParts[i];}relURLParts=newRelURLParts.reverse();var len=baseURLParts.length-numBack;var absPath=(len<=0?"":"/")+baseURLParts.slice(0,len).join('/')+"/"+relURLParts.join('/');var start="",end="";relURL.protocol=baseURL.protocol;relURL.host=baseURL.host;relURL.port=baseURL.port;if(relURL.path.charAt(relURL.path.length-1)=="/")absPath+="/";relURL.path=absPath;return this.serializeURL(relURL);};TinyMCE_Engine.prototype.convertURL=function(url,node,on_save){var prot=document.location.protocol;var host=document.location.hostname;var port=document.location.port;if(prot=="file:")return url;url=tinyMCE.regexpReplace(url,'(http|https):///','/');if(url.indexOf('mailto:')!=-1||url.indexOf('javascript:')!=-1||tinyMCE.regexpReplace(url,'[ \t\r\n\+]|%20','').charAt(0)=="#")return url;if(!tinyMCE.isMSIE&&!on_save&&url.indexOf("://")==-1&&url.charAt(0)!='/')return tinyMCE.settings['base_href']+url;if(on_save&&tinyMCE.getParam('relative_urls')){var curl=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(curl.charAt(0)=='/')curl=tinyMCE.settings['document_base_prefix']+curl;var urlParts=tinyMCE.parseURL(curl);var tmpUrlParts=tinyMCE.parseURL(tinyMCE.settings['document_base_url']);if(urlParts['host']==tmpUrlParts['host']&&(urlParts['port']==tmpUrlParts['port']))return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings['document_base_url'],curl);}if(!tinyMCE.getParam('relative_urls')){var urlParts=tinyMCE.parseURL(url);var baseUrlParts=tinyMCE.parseURL(tinyMCE.settings['base_href']);url=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(urlParts['anchor']&&urlParts['path']==baseUrlParts['path'])return"#"+urlParts['anchor'];}if(tinyMCE.getParam('remove_script_host')){var start="",portPart="";if(port!="")portPart=":"+port;start=prot+"//"+host+portPart+"/";if(url.indexOf(start)==0)url=url.substring(start.length-1);}return url;};TinyMCE_Engine.prototype.convertAllRelativeURLs=function(body){var elms=body.getElementsByTagName("img");for(var i=0;i<elms.length;i++){var src=tinyMCE.getAttrib(elms[i],'src');var msrc=tinyMCE.getAttrib(elms[i],'mce_src');if(msrc!="")src=msrc;if(src!=""){src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);elms[i].setAttribute("src",src);}}var elms=body.getElementsByTagName("a");for(var i=0;i<elms.length;i++){var href=tinyMCE.getAttrib(elms[i],'href');var mhref=tinyMCE.getAttrib(elms[i],'mce_href');if(mhref!="")href=mhref;if(href&&href!=""){href=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],href);elms[i].setAttribute("href",href);}}};TinyMCE_Engine.prototype.clearArray=function(a){for(var k in a)a[k]=null;return a;};TinyMCE_Engine.prototype._setEventsEnabled=function(node,state){var events=new Array('onfocus','onblur','onclick','ondblclick','onmousedown','onmouseup','onmouseover','onmousemove','onmouseout','onkeypress','onkeydown','onkeydown','onkeyup');var evs=tinyMCE.settings['event_elements'].split(',');for(var y=0;y<evs.length;y++){var elms=node.getElementsByTagName(evs[y]);for(var i=0;i<elms.length;i++){var event="";for(var x=0;x<events.length;x++){if((event=tinyMCE.getAttrib(elms[i],events[x]))!=''){event=tinyMCE.cleanupEventStr(""+event);if(!state)event="return true;"+event;else event=event.replace(/^return true;/gi,'');elms[i].removeAttribute(events[x]);elms[i].setAttribute(events[x],event);}}}}};TinyMCE_Engine.prototype._eventPatch=function(editor_id){var n,inst,win,e;if(typeof(tinyMCE)=="undefined")return true;try{if(tinyMCE.selectedInstance){win=tinyMCE.selectedInstance.getWin();if(win&&win.event){e=win.event;if(!e.target)e.target=e.srcElement;TinyMCE_Engine.prototype.handleEvent(e);return;}}for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;tinyMCE.selectedInstance=inst;win=inst.getWin();if(win&&win.event){e=win.event;if(!e.target)e.target=e.srcElement;TinyMCE_Engine.prototype.handleEvent(e);return;}}}catch(ex){}};TinyMCE_Engine.prototype.unloadHandler=function(){tinyMCE.triggerSave(true,true);};TinyMCE_Engine.prototype.addEventHandlers=function(inst){var doc=inst.getDoc();inst.switchSettings();if(tinyMCE.isMSIE){tinyMCE.addEvent(doc,"keypress",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"keyup",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"keydown",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"mouseup",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"mousedown",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"click",TinyMCE_Engine.prototype._eventPatch);}else{tinyMCE.addEvent(doc,"keypress",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"keydown",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"keyup",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"click",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"mouseup",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"mousedown",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"focus",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"blur",tinyMCE.handleEvent);eval('try { doc.designMode = "On"; } catch(e) {}');}};TinyMCE_Engine.prototype.onMouseMove=function(){var inst;if(!tinyMCE.hasMouseMoved){inst=tinyMCE.selectedInstance;if(inst.isFocused){inst.undoBookmark=inst.selection.getBookmark();tinyMCE.hasMouseMoved=true;}}};TinyMCE_Engine.prototype.cancelEvent=function(e){if(tinyMCE.isMSIE){e.returnValue=false;e.cancelBubble=true;}else e.preventDefault();};TinyMCE_Engine.prototype.addEvent=function(o,n,h){if(o.attachEvent)o.attachEvent("on"+n,h);else o.addEventListener(n,h,false);};TinyMCE_Engine.prototype.addSelectAccessibility=function(e,s,w){if(!s._isAccessible){s.onkeydown=tinyMCE.accessibleEventHandler;s.onblur=tinyMCE.accessibleEventHandler;s._isAccessible=true;s._win=w;}return false;};TinyMCE_Engine.prototype.accessibleEventHandler=function(e){var win=this._win;e=tinyMCE.isMSIE?win.event:e;var elm=tinyMCE.isMSIE?e.srcElement:e.target;if(e.type=="blur"){if(elm.oldonchange){elm.onchange=elm.oldonchange;elm.oldonchange=null;}return true;}if(elm.nodeName=="SELECT"&&!elm.oldonchange){elm.oldonchange=elm.onchange;elm.onchange=null;}if(e.keyCode==13||e.keyCode==32){elm.onchange=elm.oldonchange;elm.onchange();elm.oldonchange=null;tinyMCE.cancelEvent(e);return false;}return true;};TinyMCE_Engine.prototype._resetIframeHeight=function(){var ife;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){ife=tinyMCE.selectedInstance.iframeElement;if(ife._oldHeight){ife.style.height=ife._oldHeight;ife.height=ife._oldHeight;}}};function TinyMCE_Selection(inst){this.instance=inst;};TinyMCE_Selection.prototype={getSelectedHTML:function(){var inst=this.instance;var e,r=this.getRng(),h;if(tinyMCE.isSafari){return r.toString();}e=document.createElement("body");if(tinyMCE.isGecko)e.appendChild(r.cloneContents());else e.innerHTML=r.item?r.item(0).outerHTML:r.htmlText;h=tinyMCE._cleanupHTML(inst,inst.contentDocument,inst.settings,e,e,false,true,false);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(inst.getDoc());return h;},getSelectedText:function(){var inst=this.instance;var d,r,s,t;if(tinyMCE.isMSIE){d=inst.getDoc();if(d.selection.type=="Text"){r=d.selection.createRange();t=r.text;}else t='';}else{s=this.getSel();if(s&&s.toString)t=s.toString();else t='';}return t;},getBookmark:function(simple){var rng=this.getRng();var doc=this.instance.getDoc();var sp,le,s,e,nl,i,si,ei;var trng,sx,sy,xx=-999999999;if(tinyMCE.isOpera)return null;sx=doc.body.scrollLeft+doc.documentElement.scrollLeft;sy=doc.body.scrollTop+doc.documentElement.scrollTop;if(tinyMCE.isSafari||tinyMCE.isGecko)return{rng:rng,scrollX:sx,scrollY:sy};if(tinyMCE.isMSIE){if(simple)return{rng:rng};if(rng.item){e=rng.item(0);nl=doc.getElementsByTagName(e.nodeName);for(i=0;i<nl.length;i++){if(e==nl[i]){sp=i;break;}}return{tag:e.nodeName,index:sp,scrollX:sx,scrollY:sy};}else{trng=rng.duplicate();trng.collapse(true);sp=Math.abs(trng.move('character',xx));trng=rng.duplicate();trng.collapse(false);le=Math.abs(trng.move('character',xx))-sp;return{start:sp,length:le,scrollX:sx,scrollY:sy};}}if(tinyMCE.isGecko){s=tinyMCE.getParentElement(rng.startContainer);for(si=0;si<s.childNodes.length&&s.childNodes[si]!=rng.startContainer;si++);nl=doc.getElementsByTagName(s.nodeName);for(i=0;i<nl.length;i++){if(s==nl[i]){sp=i;break;}}e=tinyMCE.getParentElement(rng.endContainer);for(ei=0;ei<e.childNodes.length&&e.childNodes[ei]!=rng.endContainer;ei++);nl=doc.getElementsByTagName(e.nodeName);for(i=0;i<nl.length;i++){if(e==nl[i]){le=i;break;}}return{startTag:s.nodeName,start:sp,startIndex:si,endTag:e.nodeName,end:le,endIndex:ei,startOffset:rng.startOffset,endOffset:rng.endOffset,scrollX:sx,scrollY:sy};}return null;},moveToBookmark:function(bookmark){var rng,nl,i;var inst=this.instance;var doc=inst.getDoc();var win=inst.getWin();var sel=this.getSel();if(!bookmark)return false;if(tinyMCE.isSafari){sel.setBaseAndExtent(bookmark.startContainer,bookmark.startOffset,bookmark.endContainer,bookmark.endOffset);return true;}if(tinyMCE.isMSIE){if(bookmark.rng){bookmark.rng.select();return true;}win.focus();if(bookmark.tag){rng=inst.getBody().createControlRange();nl=doc.getElementsByTagName(bookmark.tag);if(nl.length>bookmark.index){try{rng.addElement(nl[bookmark.index]);}catch(ex){}}}else{rng=inst.getSel().createRange();rng.moveToElementText(inst.getBody());rng.collapse(true);rng.moveStart('character',bookmark.start);rng.moveEnd('character',bookmark.length);}rng.select();win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}if(tinyMCE.isGecko&&bookmark.rng){sel.removeAllRanges();sel.addRange(bookmark.rng);win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}if(tinyMCE.isGecko){rng=doc.createRange();nl=doc.getElementsByTagName(bookmark.startTag);if(nl.length>bookmark.start)rng.setStart(nl[bookmark.start].childNodes[bookmark.startIndex],bookmark.startOffset);nl=doc.getElementsByTagName(bookmark.endTag);if(nl.length>bookmark.end)rng.setEnd(nl[bookmark.end].childNodes[bookmark.endIndex],bookmark.endOffset);sel.removeAllRanges();sel.addRange(rng);win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}return false;},selectNode:function(node,collapse,select_text_node,to_start){var inst=this.instance,sel,rng,nodes;if(!node)return;if(typeof(collapse)=="undefined")collapse=true;if(typeof(select_text_node)=="undefined")select_text_node=false;if(typeof(to_start)=="undefined")to_start=true;if(tinyMCE.isMSIE){rng=inst.getBody().createTextRange();try{rng.moveToElementText(node);if(collapse)rng.collapse(to_start);rng.select();}catch(e){}}else{sel=this.getSel();if(!sel)return;if(tinyMCE.isSafari){sel.setBaseAndExtent(node,0,node,node.innerText.length);if(collapse){if(to_start)sel.collapseToStart();else sel.collapseToEnd();}this.scrollToNode(node);return;}rng=inst.getDoc().createRange();if(select_text_node){nodes=tinyMCE.getNodeTree(node,new Array(),3);if(nodes.length>0)rng.selectNodeContents(nodes[0]);else rng.selectNodeContents(node);}else rng.selectNode(node);if(collapse){if(!to_start&&node.nodeType==3){rng.setStart(node,node.nodeValue.length);rng.setEnd(node,node.nodeValue.length);}else rng.collapse(to_start);}sel.removeAllRanges();sel.addRange(rng);}this.scrollToNode(node);tinyMCE.selectedElement=null;if(node.nodeType==1)tinyMCE.selectedElement=node;},scrollToNode:function(node){var inst=this.instance;var pos,doc,scrollX,scrollY,height;pos=tinyMCE.getAbsPosition(node);doc=inst.getDoc();scrollX=doc.body.scrollLeft+doc.documentElement.scrollLeft;scrollY=doc.body.scrollTop+doc.documentElement.scrollTop;height=tinyMCE.isMSIE?document.getElementById(inst.editorId).style.pixelHeight:inst.targetElement.clientHeight;if(!tinyMCE.settings['auto_resize']&&!(pos.absTop>scrollY&&pos.absTop<(scrollY-25+height)))inst.contentWindow.scrollTo(pos.absLeft,pos.absTop-height+25);},getSel:function(){var inst=this.instance;if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return inst.getDoc().selection;return inst.contentWindow.getSelection();},getRng:function(){var inst=this.instance;var sel=this.getSel();if(sel==null)return null;if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return sel.createRange();if(tinyMCE.isSafari&&!sel.getRangeAt)return''+window.getSelection();return sel.getRangeAt(0);},getFocusElement:function(){var inst=this.instance;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){var doc=inst.getDoc();var rng=doc.selection.createRange();var elm=rng.item?rng.item(0):rng.parentElement();}else{if(inst.isHidden())return inst.getBody();var sel=this.getSel();var rng=this.getRng();if(!sel||!rng)return null;var elm=rng.commonAncestorContainer;if(!rng.collapsed){if(rng.startContainer==rng.endContainer){if(rng.startOffset-rng.endOffset<2){if(rng.startContainer.hasChildNodes())elm=rng.startContainer.childNodes[rng.startOffset];}}}elm=tinyMCE.getParentElement(elm);}return elm;}};function TinyMCE_UndoRedo(inst){this.instance=inst;this.undoLevels=new Array();this.undoIndex=0;this.typingUndoIndex=-1;this.undoRedo=true;};TinyMCE_UndoRedo.prototype={add:function(l){var b;if(l){this.undoLevels[this.undoLevels.length]=l;return true;}var inst=this.instance;if(this.typingUndoIndex!=-1){this.undoIndex=this.typingUndoIndex;}var newHTML=tinyMCE.trim(inst.getBody().innerHTML);if(this.undoLevels[this.undoIndex]&&newHTML!=this.undoLevels[this.undoIndex].content){tinyMCE.dispatchCallback(inst,'onchange_callback','onChange',inst);var customUndoLevels=tinyMCE.settings['custom_undo_redo_levels'];if(customUndoLevels!=-1&&this.undoLevels.length>customUndoLevels){for(var i=0;i<this.undoLevels.length-1;i++){this.undoLevels[i]=this.undoLevels[i+1];}this.undoLevels.length--;this.undoIndex--;}b=inst.undoBookmark;if(!b)b=inst.selection.getBookmark();this.undoIndex++;this.undoLevels[this.undoIndex]={content:newHTML,bookmark:b};this.undoLevels.length=this.undoIndex+1;return true;}return false;},undo:function(){var inst=this.instance;if(this.undoIndex>0){this.undoIndex--;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);}},redo:function(){var inst=this.instance;tinyMCE.execCommand("mceEndTyping");if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);}tinyMCE.triggerNodeChange();}};var TinyMCE_ForceParagraphs={_insertPara:function(inst,e){function isEmpty(para){function isEmptyHTML(html){return html.replace(new RegExp('[ \t\r\n]+','g'),'').toLowerCase()=="";}if(para.getElementsByTagName("img").length>0)return false;if(para.getElementsByTagName("table").length>0)return false;if(para.getElementsByTagName("hr").length>0)return false;var nodes=tinyMCE.getNodeTree(para,new Array(),3);for(var i=0;i<nodes.length;i++){if(!isEmptyHTML(nodes[i].nodeValue))return false;}return true;}var doc=inst.getDoc();var sel=inst.getSel();var win=inst.contentWindow;var rng=sel.getRangeAt(0);var body=doc.body;var rootElm=doc.documentElement;var blockName="P";var rngBefore=doc.createRange();rngBefore.setStart(sel.anchorNode,sel.anchorOffset);rngBefore.collapse(true);var rngAfter=doc.createRange();rngAfter.setStart(sel.focusNode,sel.focusOffset);rngAfter.collapse(true);var direct=rngBefore.compareBoundaryPoints(rngBefore.START_TO_END,rngAfter)<0;var startNode=direct?sel.anchorNode:sel.focusNode;var startOffset=direct?sel.anchorOffset:sel.focusOffset;var endNode=direct?sel.focusNode:sel.anchorNode;var endOffset=direct?sel.focusOffset:sel.anchorOffset;startNode=startNode.nodeName=="BODY"?startNode.firstChild:startNode;endNode=endNode.nodeName=="BODY"?endNode.firstChild:endNode;var startBlock=tinyMCE.getParentBlockElement(startNode);var endBlock=tinyMCE.getParentBlockElement(endNode);if(startBlock&&new RegExp('absolute|relative|static','gi').test(startBlock.style.position))startBlock=null;if(endBlock&&new RegExp('absolute|relative|static','gi').test(endBlock.style.position))endBlock=null;if(startBlock!=null){blockName=startBlock.nodeName;if(blockName=="TD"||blockName=="TABLE"||(blockName=="DIV"&&new RegExp('left|right','gi').test(startBlock.style.cssFloat)))blockName="P";}if(tinyMCE.getParentElement(startBlock,"OL,UL")!=null)return false;if((startBlock!=null&&startBlock.nodeName=="TABLE")||(endBlock!=null&&endBlock.nodeName=="TABLE"))startBlock=endBlock=null;var paraBefore=(startBlock!=null&&startBlock.nodeName==blockName)?startBlock.cloneNode(false):doc.createElement(blockName);var paraAfter=(endBlock!=null&&endBlock.nodeName==blockName)?endBlock.cloneNode(false):doc.createElement(blockName);if(/^(H[1-6])$/.test(blockName))paraAfter=doc.createElement("p");var startChop=startNode;var endChop=endNode;node=startChop;do{if(node==body||node.nodeType==9||tinyMCE.isBlockElement(node))break;startChop=node;}while((node=node.previousSibling?node.previousSibling:node.parentNode));node=endChop;do{if(node==body||node.nodeType==9||tinyMCE.isBlockElement(node))break;endChop=node;}while((node=node.nextSibling?node.nextSibling:node.parentNode));if(startChop.nodeName=="TD")startChop=startChop.firstChild;if(endChop.nodeName=="TD")endChop=endChop.lastChild;if(startBlock==null){rng.deleteContents();sel.removeAllRanges();if(startChop!=rootElm&&endChop!=rootElm){rngBefore=rng.cloneRange();if(startChop==body)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);paraBefore.appendChild(rngBefore.cloneContents());if(endChop.parentNode.nodeName==blockName)endChop=endChop.parentNode;rng.setEndAfter(endChop);if(endChop.nodeName!="#text"&&endChop.nodeName!="BODY")rngBefore.setEndAfter(endChop);var contents=rng.cloneContents();if(contents.firstChild&&(contents.firstChild.nodeName==blockName||contents.firstChild.nodeName=="BODY"))paraAfter.innerHTML=contents.firstChild.innerHTML;else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML="&nbsp;";if(isEmpty(paraAfter))paraAfter.innerHTML="&nbsp;";rng.deleteContents();rngAfter.deleteContents();rngBefore.deleteContents();paraAfter.normalize();rngBefore.insertNode(paraAfter);paraBefore.normalize();rngBefore.insertNode(paraBefore);}else{body.innerHTML="<"+blockName+">&nbsp;</"+blockName+"><"+blockName+">&nbsp;</"+blockName+">";paraAfter=body.childNodes[1];}inst.selection.selectNode(paraAfter,true,true);return true;}if(startChop.nodeName==blockName)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);rngBefore.setEnd(startNode,startOffset);paraBefore.appendChild(rngBefore.cloneContents());rngAfter.setEndAfter(endChop);rngAfter.setStart(endNode,endOffset);var contents=rngAfter.cloneContents();if(contents.firstChild&&contents.firstChild.nodeName==blockName){paraAfter.innerHTML=contents.firstChild.innerHTML;}else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML="&nbsp;";if(isEmpty(paraAfter))paraAfter.innerHTML="&nbsp;";var rng=doc.createRange();if(!startChop.previousSibling&&startChop.parentNode.nodeName.toUpperCase()==blockName){rng.setStartBefore(startChop.parentNode);}else{if(rngBefore.startContainer.nodeName.toUpperCase()==blockName&&rngBefore.startOffset==0)rng.setStartBefore(rngBefore.startContainer);else rng.setStart(rngBefore.startContainer,rngBefore.startOffset);}if(!endChop.nextSibling&&endChop.parentNode.nodeName.toUpperCase()==blockName)rng.setEndAfter(endChop.parentNode);else rng.setEnd(rngAfter.endContainer,rngAfter.endOffset);rng.deleteContents();rng.insertNode(paraAfter);rng.insertNode(paraBefore);paraAfter.normalize();paraBefore.normalize();inst.selection.selectNode(paraAfter,true,true);return true;},_handleBackSpace:function(inst){var r=inst.getRng(),sn=r.startContainer,nv,s=false;if(sn&&sn.nextSibling&&sn.nextSibling.nodeName=="BR"){nv=sn.nodeValue;if(nv!=null&&nv.length>=r.startOffset&&nv.charAt(r.startOffset-1)==' ')s=true;if(nv!=null&&r.startOffset==nv.length)sn.nextSibling.parentNode.removeChild(sn.nextSibling);}return s;}};function TinyMCE_Layer(id,bm){this.id=id;this.blockerElement=null;this.events=false;this.element=null;this.blockMode=typeof(bm)!='undefined'?bm:true;this.doc=document;};TinyMCE_Layer.prototype={moveRelativeTo:function(re,p){var rep=this.getAbsPosition(re);var w=parseInt(re.offsetWidth);var h=parseInt(re.offsetHeight);var e=this.getElement();var ew=parseInt(e.offsetWidth);var eh=parseInt(e.offsetHeight);var x,y;switch(p){case"tl":x=rep.absLeft;y=rep.absTop;break;case"tr":x=rep.absLeft+w;y=rep.absTop;break;case"bl":x=rep.absLeft;y=rep.absTop+h;break;case"br":x=rep.absLeft+w;y=rep.absTop+h;break;case"cc":x=rep.absLeft+(w/2)-(ew/2);y=rep.absTop+(h/2)-(eh/2);break;}this.moveTo(x,y);},moveBy:function(x,y){var e=this.getElement();this.moveTo(parseInt(e.style.left)+x,parseInt(e.style.top)+y);},moveTo:function(x,y){var e=this.getElement();e.style.left=x+"px";e.style.top=y+"px";this.updateBlocker();},resizeBy:function(w,h){var e=this.getElement();this.resizeTo(parseInt(e.style.width)+w,parseInt(e.style.height)+h);},resizeTo:function(w,h){var e=this.getElement();if(w!=null)e.style.width=w+"px";if(h!=null)e.style.height=h+"px";this.updateBlocker();},show:function(){this.getElement().style.display='block';this.updateBlocker();},hide:function(){this.getElement().style.display='none';this.updateBlocker();},isVisible:function(){return this.getElement().style.display=='block';},getElement:function(){if(!this.element)this.element=this.doc.getElementById(this.id);return this.element;},setBlockMode:function(s){this.blockMode=s;},updateBlocker:function(){var e,b,x,y,w,h;b=this.getBlocker();if(b){if(this.blockMode){e=this.getElement();x=this.parseInt(e.style.left);y=this.parseInt(e.style.top);w=this.parseInt(e.offsetWidth);h=this.parseInt(e.offsetHeight);b.style.left=x+'px';b.style.top=y+'px';b.style.width=w+'px';b.style.height=h+'px';b.style.display=e.style.display;}else b.style.display='none';}},getBlocker:function(){var d,b;if(!this.blockerElement&&this.blockMode){d=this.doc;b=d.createElement("iframe");b.style.cssText='display: none; position: absolute; left: 0; top: 0';b.src='javascript:false;';b.frameBorder='0';b.scrolling='no';d.body.appendChild(b);this.blockerElement=b;}return this.blockerElement;},getAbsPosition:function(n){var p={absLeft:0,absTop:0};while(n){p.absLeft+=n.offsetLeft;p.absTop+=n.offsetTop;n=n.offsetParent;}return p;},create:function(n,c,p){var d=this.doc,e=d.createElement(n);e.setAttribute('id',this.id);if(c)e.className=c;if(!p)p=d.body;p.appendChild(e);return this.element=e;},parseInt:function(s){if(s==null||s=='')return 0;return parseInt(s);}};function TinyMCE_Menu(){var id;if(typeof(tinyMCE.menuCounter)=="undefined")tinyMCE.menuCounter=0;id="mc_menu_"+tinyMCE.menuCounter++;TinyMCE_Layer.call(this,id,true);this.id=id;this.items=new Array();this.needsUpdate=true;};TinyMCE_Menu.prototype=tinyMCE.extend(TinyMCE_Layer.prototype,{init:function(s){var n;this.settings={separator_class:'mceMenuSeparator',title_class:'mceMenuTitle',disabled_class:'mceMenuDisabled',menu_class:'mceMenu',drop_menu:true};for(n in s)this.settings[n]=s[n];this.create('div',this.settings.menu_class);},clear:function(){this.items=new Array();},addTitle:function(t){this.add({type:'title',text:t});},addDisabled:function(t){this.add({type:'disabled',text:t});},addSeparator:function(){this.add({type:'separator'});},addItem:function(t,js){this.add({text:t,js:js});},add:function(mi){this.items[this.items.length]=mi;this.needsUpdate=true;},update:function(){var e=this.getElement(),h='',i,t,m=this.items,s=this.settings;if(this.settings.drop_menu)h+='<span class="mceMenuLine"></span>';h+='<table border="0" cellpadding="0" cellspacing="0">';for(i=0;i<m.length;i++){t=tinyMCE.xmlEncode(m[i].text);c=m[i].class_name?' class="'+m[i].class_name+'"':'';switch(m[i].type){case'separator':h+='<tr class="'+s.separator_class+'"><td>';break;case'title':h+='<tr class="'+s.title_class+'"><td><span'+c+'>'+t+'</span>';break;case'disabled':h+='<tr class="'+s.disabled_class+'"><td><span'+c+'>'+t+'</span>';break;default:h+='<tr><td><a href="javascript:void(0);" onmousedown="'+tinyMCE.xmlEncode(m[i].js)+';return false;"><span'+c+'>'+t+'</span></a>';}h+='</td></tr>';}h+='</table>';e.innerHTML=h;this.needsUpdate=false;this.updateBlocker();},show:function(){var nl,i;if(tinyMCE.lastMenu==this)return;if(this.needsUpdate)this.update();if(tinyMCE.lastMenu&&tinyMCE.lastMenu!=this)tinyMCE.lastMenu.hide();TinyMCE_Layer.prototype.show.call(this);if(!tinyMCE.isOpera){}tinyMCE.lastMenu=this;}});TinyMCE_Engine.prototype.debug=function(){var m="",e,a,i;e=document.getElementById("tinymce_debug");if(!e){var d=document.createElement("div");d.setAttribute("className","debugger");d.className="debugger";d.innerHTML='Debug output:<textarea id="tinymce_debug" style="width: 100%; height: 300px" wrap="nowrap" mce_editable="false"></textarea>';document.body.appendChild(d);e=document.getElementById("tinymce_debug");}a=this.debug.arguments;for(i=0;i<a.length;i++){m+=a[i];if(i<a.length-1)m+=', ';}e.value+=m+"\n";};
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce_popup.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce_popup.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce_popup.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,272 @@
+
+
+// Some global instances, this will be filled later
+var tinyMCE = null, tinyMCELang = null;
+
+
+function TinyMCE_Popup() {
+};
+
+
+TinyMCE_Popup.prototype.init = function() {
+  var win = window.opener ? window.opener : window.dialogArguments;
+  var inst;
+
+  if (!win) {
+    // Try parent
+    win = parent.parent;
+
+    // Try top
+    if (typeof(win.tinyMCE) == "undefined")
+      win = top;
+  }
+
+  window.opener = win;
+  this.windowOpener = win;
+  this.onLoadEval = "";
+
+  // Setup parent references
+  tinyMCE = win.tinyMCE;
+  tinyMCELang = win.tinyMCELang;
+
+  if (!tinyMCE) {
+    alert("tinyMCE object reference not found from popup.");
+    return;
+  }
+
+  inst = tinyMCE.selectedInstance;
+  this.isWindow = tinyMCE.getWindowArg('mce_inside_iframe', false) == false;
+  this.storeSelection = (tinyMCE.isMSIE && !tinyMCE.isOpera) && !this.isWindow && tinyMCE.getWindowArg('mce_store_selection', true);
+
+  if (this.isWindow)
+    window.focus();
+
+  // Store selection
+  if (this.storeSelection)
+    inst.selectionBookmark = inst.selection.getBookmark(true);
+
+  // Setup dir
+  if (tinyMCELang['lang_dir'])
+    document.dir = tinyMCELang['lang_dir'];
+
+  // Setup title
+  var re = new RegExp('{|\\\$|}', 'g');
+  var title = document.title.replace(re, "");
+  if (typeof tinyMCELang[title] != "undefined") {
+    var divElm = document.createElement("div");
+    divElm.innerHTML = tinyMCELang[title];
+    document.title = divElm.innerHTML;
+
+    if (tinyMCE.setWindowTitle != null)
+      tinyMCE.setWindowTitle(window, divElm.innerHTML);
+  }
+
+  // Output Popup CSS class
+  document.write('<link href="' + tinyMCE.getParam("popups_css") + '" rel="stylesheet" type="text/css">');
+
+  tinyMCE.addEvent(window, "load", this.onLoad);
+};
+
+
+TinyMCE_Popup.prototype.onLoad = function() {
+  var dir, i, elms, body = document.body;
+
+  if (tinyMCE.getWindowArg('mce_replacevariables', true))
+    body.innerHTML = tinyMCE.applyTemplate(body.innerHTML, tinyMCE.windowArgs);
+
+  dir = tinyMCE.selectedInstance.settings['directionality'];
+  if (dir == "rtl" && document.forms && document.forms.length > 0) {
+    elms = document.forms[0].elements;
+    for (i=0; i<elms.length; i++) {
+      if ((elms[i].type == "text" || elms[i].type == "textarea") && elms[i].getAttribute("dir") != "ltr")
+        elms[i].dir = dir;
+    }
+  }
+
+  if (body.style.display == 'none')
+    body.style.display = 'block';
+
+  // Execute real onload (Opera fix)
+  if (tinyMCEPopup.onLoadEval != "")
+    eval(tinyMCEPopup.onLoadEval);
+};
+
+
+TinyMCE_Popup.prototype.executeOnLoad = function(str) {
+  if (tinyMCE.isOpera)
+    this.onLoadEval = str;
+  else
+    eval(str);
+};
+
+
+TinyMCE_Popup.prototype.resizeToInnerSize = function() {
+  // Netscape 7.1 workaround
+  if (this.isWindow && tinyMCE.isNS71) {
+    window.resizeBy(0, 10);
+    return;
+  }
+
+  if (this.isWindow) {
+    var doc = document;
+    var body = doc.body;
+    var oldMargin, wrapper, iframe, nodes, dx, dy;
+
+    if (body.style.display == 'none')
+      body.style.display = 'block';
+
+    // Remove margin
+    oldMargin = body.style.margin;
+    body.style.margin = '0';
+
+    // Create wrapper
+    wrapper = doc.createElement("div");
+    wrapper.id = 'mcBodyWrapper';
+    wrapper.style.display = 'none';
+    wrapper.style.margin = '0';
+
+    // Wrap body elements
+    nodes = doc.body.childNodes;
+    for (var i=nodes.length-1; i>=0; i--) {
+      if (wrapper.hasChildNodes())
+        wrapper.insertBefore(nodes[i].cloneNode(true), wrapper.firstChild);
+      else
+        wrapper.appendChild(nodes[i].cloneNode(true));
+
+      nodes[i].parentNode.removeChild(nodes[i]);
+    }
+
+    // Add wrapper
+    doc.body.appendChild(wrapper);
+
+    // Create iframe
+    iframe = document.createElement("iframe");
+    iframe.id = "mcWinIframe";
+    iframe.src = document.location.href.toLowerCase().indexOf('https') == -1 ? "about:blank" : tinyMCE.settings['default_document'];
+    iframe.width = "100%";
+    iframe.height = "100%";
+    iframe.style.margin = '0';
+
+    // Add iframe
+    doc.body.appendChild(iframe);
+
+    // Measure iframe
+    iframe = document.getElementById('mcWinIframe');
+    dx = tinyMCE.getWindowArg('mce_width') - iframe.clientWidth;
+    dy = tinyMCE.getWindowArg('mce_height') - iframe.clientHeight;
+
+    // Resize window
+    // tinyMCE.debug(tinyMCE.getWindowArg('mce_width') + "," + tinyMCE.getWindowArg('mce_height') + " - " + dx + "," + dy);
+    window.resizeBy(dx, dy);
+
+    // Hide iframe and show wrapper
+    body.style.margin = oldMargin;
+    iframe.style.display = 'none';
+    wrapper.style.display = 'block';
+  }
+};
+
+
+TinyMCE_Popup.prototype.resizeToContent = function() {
+  var isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+  var isOpera = (navigator.userAgent.indexOf("Opera") != -1);
+
+  if (isOpera)
+    return;
+
+  if (isMSIE) {
+    try { window.resizeTo(10, 10); } catch (e) {}
+
+    var elm = document.body;
+    var width = elm.offsetWidth;
+    var height = elm.offsetHeight;
+    var dx = (elm.scrollWidth - width) + 4;
+    var dy = elm.scrollHeight - height;
+
+    try { window.resizeBy(dx, dy); } catch (e) {}
+  } else {
+    window.scrollBy(1000, 1000);
+    if (window.scrollX > 0 || window.scrollY > 0) {
+      window.resizeBy(window.innerWidth * 2, window.innerHeight * 2);
+      window.sizeToContent();
+      window.scrollTo(0, 0);
+      var x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0);
+      var y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0);
+      window.moveTo(x, y);
+    }
+  }
+};
+
+
+TinyMCE_Popup.prototype.getWindowArg = function(name, default_value) {
+  return tinyMCE.getWindowArg(name, default_value);
+};
+
+
+TinyMCE_Popup.prototype.restoreSelection = function() {
+  if (this.storeSelection) {
+    var inst = tinyMCE.selectedInstance;
+
+    inst.getWin().focus();
+
+    if (inst.selectionBookmark)
+      inst.selection.moveToBookmark(inst.selectionBookmark);
+  }
+};
+
+
+TinyMCE_Popup.prototype.execCommand = function(command, user_interface, value) {
+  var inst = tinyMCE.selectedInstance;
+
+  this.restoreSelection();
+  inst.execCommand(command, user_interface, value);
+
+  // Store selection
+  if (this.storeSelection)
+    inst.selectionBookmark = inst.selection.getBookmark(true);
+};
+
+
+TinyMCE_Popup.prototype.close = function() {
+  tinyMCE.closeWindow(window);
+};
+
+
+TinyMCE_Popup.prototype.pickColor = function(e, element_id) {
+  tinyMCE.selectedInstance.execCommand('mceColorPicker', true, {
+    element_id : element_id,
+    document : document,
+    window : window,
+    store_selection : false
+  });
+};
+
+
+TinyMCE_Popup.prototype.openBrowser = function(element_id, type, option) {
+  var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
+  var url = document.getElementById(element_id).value;
+
+  tinyMCE.setWindowArg("window", window);
+  tinyMCE.setWindowArg("document", document);
+
+  // Call to external callback
+  if (eval('typeof(tinyMCEPopup.windowOpener.' + cb + ')') == "undefined")
+    alert("Callback function: " + cb + " could not be found.");
+  else
+    eval("tinyMCEPopup.windowOpener." + cb + "(element_id, url, type, window);");
+};
+
+
+TinyMCE_Popup.prototype.importClass = function(c) {
+  window[c] = function() {};
+
+  for (var n in window.opener[c].prototype)
+    window[c].prototype[n] = window.opener[c].prototype[n];
+
+  window[c].constructor = window.opener[c].constructor;
+};
+
+// Setup global instance
+var tinyMCEPopup = new TinyMCE_Popup();
+
+tinyMCEPopup.init();

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce_src.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce_src.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/tiny_mce_src.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,6719 @@
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Engine.class.js */
+
+function TinyMCE_Engine() {
+  this.majorVersion = "2";
+  this.minorVersion = "0.6.1";
+  this.releaseDate = "2006-05-04";
+
+  this.instances = new Array();
+  this.switchClassCache = new Array();
+  this.windowArgs = new Array();
+  this.loadedFiles = new Array();
+  this.pendingFiles = new Array();
+  this.loadingIndex = 0;
+  this.configs = new Array();
+  this.currentConfig = 0;
+  this.eventHandlers = new Array();
+
+  // Browser check
+  var ua = navigator.userAgent;
+  this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+  this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1);
+  this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1);
+  this.isGecko = ua.indexOf('Gecko') != -1;
+  this.isSafari = ua.indexOf('Safari') != -1;
+  this.isOpera = ua.indexOf('Opera') != -1;
+  this.isMac = ua.indexOf('Mac') != -1;
+  this.isNS7 = ua.indexOf('Netscape/7') != -1;
+  this.isNS71 = ua.indexOf('Netscape/7.1') != -1;
+  this.dialogCounter = 0;
+  this.plugins = new Array();
+  this.themes = new Array();
+  this.menus = new Array();
+  this.loadedPlugins = new Array();
+  this.buttonMap = new Array();
+  this.isLoaded = false;
+
+  // Fake MSIE on Opera and if Opera fakes IE, Gecko or Safari cancel those
+  if (this.isOpera) {
+    this.isMSIE = true;
+    this.isGecko = false;
+    this.isSafari =  false;
+  }
+
+  // TinyMCE editor id instance counter
+  this.idCounter = 0;
+};
+
+TinyMCE_Engine.prototype = {
+  init : function(settings) {
+    var theme;
+
+    this.settings = settings;
+
+    // Check if valid browser has execcommand support
+    if (typeof(document.execCommand) == 'undefined')
+      return;
+
+    // Get script base path
+    if (!tinyMCE.baseURL) {
+      var elements = document.getElementsByTagName('script');
+
+      for (var i=0; i<elements.length; i++) {
+        if (elements[i].src && (elements[i].src.indexOf("tiny_mce.js") != -1 || elements[i].src.indexOf("tiny_mce_dev.js") != -1 || elements[i].src.indexOf("tiny_mce_src.js") != -1 || elements[i].src.indexOf("tiny_mce_gzip") != -1)) {
+          var src = elements[i].src;
+
+          tinyMCE.srcMode = (src.indexOf('_src') != -1 || src.indexOf('_dev') != -1) ? '_src' : '';
+          tinyMCE.gzipMode = src.indexOf('_gzip') != -1;
+          src = src.substring(0, src.lastIndexOf('/'));
+
+          if (settings.exec_mode == "src" || settings.exec_mode == "normal")
+            tinyMCE.srcMode = settings.exec_mode == "src" ? '_src' : '';
+
+          tinyMCE.baseURL = src;
+          break;
+        }
+      }
+    }
+
+    // Get document base path
+    this.documentBasePath = document.location.href;
+    if (this.documentBasePath.indexOf('?') != -1)
+      this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.indexOf('?'));
+    this.documentURL = this.documentBasePath;
+    this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.lastIndexOf('/'));
+
+    // If not HTTP absolute
+    if (tinyMCE.baseURL.indexOf('://') == -1 && tinyMCE.baseURL.charAt(0) != '/') {
+      // If site absolute
+      tinyMCE.baseURL = this.documentBasePath + "/" + tinyMCE.baseURL;
+    }
+
+    // Set default values on settings
+    this._def("mode", "none");
+    this._def("theme", "advanced");
+    this._def("plugins", "", true);
+    this._def("language", "en");
+    this._def("docs_language", this.settings['language']);
+    this._def("elements", "");
+    this._def("textarea_trigger", "mce_editable");
+    this._def("editor_selector", "");
+    this._def("editor_deselector", "mceNoEditor");
+    this._def("valid_elements", "+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang]");
+    this._def("extended_valid_elements", "");
+    this._def("invalid_elements", "");
+    this._def("encoding", "");
+    this._def("urlconverter_callback", tinyMCE.getParam("urlconvertor_callback", "TinyMCE_Engine.prototype.convertURL"));
+    this._def("save_callback", "");
+    this._def("debug", false);
+    this._def("force_br_newlines", false);
+    this._def("force_p_newlines", true);
+    this._def("add_form_submit_trigger", true);
+    this._def("relative_urls", true);
+    this._def("remove_script_host", true);
+    this._def("focus_alert", true);
+    this._def("document_base_url", this.documentURL);
+    this._def("visual", true);
+    this._def("visual_table_class", "mceVisualAid");
+    this._def("setupcontent_callback", "");
+    this._def("fix_content_duplication", true);
+    this._def("custom_undo_redo", true);
+    this._def("custom_undo_redo_levels", -1);
+    this._def("custom_undo_redo_keyboard_shortcuts", true);
+    this._def("custom_undo_redo_restore_selection", true);
+    this._def("verify_html", true);
+    this._def("apply_source_formatting", false);
+    this._def("directionality", "ltr");
+    this._def("cleanup_on_startup", false);
+    this._def("inline_styles", false);
+    this._def("convert_newlines_to_brs", false);
+    this._def("auto_reset_designmode", true);
+    this._def("entities", "39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro", true);
+    this._def("entity_encoding", "named");
+    this._def("cleanup_callback", "");
+    this._def("add_unload_trigger", true);
+    this._def("ask", false);
+    this._def("nowrap", false);
+    this._def("auto_resize", false);
+    this._def("auto_focus", false);
+    this._def("cleanup", true);
+    this._def("remove_linebreaks", true);
+    this._def("button_tile_map", false);
+    this._def("submit_patch", true);
+    this._def("browsers", "msie,safari,gecko,opera", true);
+    this._def("dialog_type", "window");
+    this._def("accessibility_warnings", true);
+    this._def("accessibility_focus", true);
+    this._def("merge_styles_invalid_parents", "");
+    this._def("force_hex_style_colors", true);
+    this._def("trim_span_elements", true);
+    this._def("convert_fonts_to_spans", false);
+    this._def("doctype", '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');
+    this._def("font_size_classes", '');
+    this._def("font_size_style_values", 'xx-small,x-small,small,medium,large,x-large,xx-large', true);
+    this._def("event_elements", 'a,img', true);
+    this._def("convert_urls", true);
+    this._def("table_inline_editing", false);
+    this._def("object_resizing", true);
+    this._def("custom_shortcuts", true);
+    this._def("convert_on_click", false);
+    this._def("content_css", '');
+    this._def("fix_list_elements", false);
+    this._def("fix_table_elements", false);
+    this._def("strict_loading_mode", document.contentType == 'application/xhtml+xml');
+    this._def("hidden_tab_class", '');
+    this._def("display_tab_class", '');
+
+    // Force strict loading mode to false on non Gecko browsers
+    if (this.isMSIE && !this.isOpera)
+      this.settings.strict_loading_mode = false;
+
+    // Browser check IE
+    if (this.isMSIE && this.settings['browsers'].indexOf('msie') == -1)
+      return;
+
+    // Browser check Gecko
+    if (this.isGecko && this.settings['browsers'].indexOf('gecko') == -1)
+      return;
+
+    // Browser check Safari
+    if (this.isSafari && this.settings['browsers'].indexOf('safari') == -1)
+      return;
+
+    // Browser check Opera
+    if (this.isOpera && this.settings['browsers'].indexOf('opera') == -1)
+      return;
+
+    // If not super absolute make it so
+    var baseHREF = tinyMCE.settings['document_base_url'];
+    var h = document.location.href;
+    var p = h.indexOf('://');
+    if (p > 0 && document.location.protocol != "file:") {
+      p = h.indexOf('/', p + 3);
+      h = h.substring(0, p);
+
+      if (baseHREF.indexOf('://') == -1)
+        baseHREF = h + baseHREF;
+
+      tinyMCE.settings['document_base_url'] = baseHREF;
+      tinyMCE.settings['document_base_prefix'] = h;
+    }
+
+    // Trim away query part
+    if (baseHREF.indexOf('?') != -1)
+      baseHREF = baseHREF.substring(0, baseHREF.indexOf('?'));
+
+    this.settings['base_href'] = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/";
+
+    theme = this.settings['theme'];
+    this.blockRegExp = new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dt|dd|dir|fieldset|form|noscript|noframes|menu|isindex|samp)$", "i");
+    this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40);
+    this.uniqueURL = 'javascript:TINYMCE_UNIQUEURL();'; // Make unique URL non real URL
+    this.uniqueTag = '<div id="mceTMPElement" style="display: none">TMP</div>';
+    this.callbacks = new Array('onInit', 'getInfo', 'getEditorTemplate', 'setupContent', 'onChange', 'onPageLoad', 'handleNodeChange', 'initInstance', 'execCommand', 'getControlHTML', 'handleEvent', 'cleanup');
+
+    // Theme url
+    this.settings['theme_href'] = tinyMCE.baseURL + "/themes/" + theme;
+
+    if (!tinyMCE.isMSIE)
+      this.settings['force_br_newlines'] = false;
+
+    if (tinyMCE.getParam("popups_css", false)) {
+      var cssPath = tinyMCE.getParam("popups_css", "");
+
+      // Is relative
+      if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
+        this.settings['popups_css'] = this.documentBasePath + "/" + cssPath;
+      else
+        this.settings['popups_css'] = cssPath;
+    } else
+      this.settings['popups_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_popup.css";
+
+    if (tinyMCE.getParam("editor_css", false)) {
+      var cssPath = tinyMCE.getParam("editor_css", "");
+
+      // Is relative
+      if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
+        this.settings['editor_css'] = this.documentBasePath + "/" + cssPath;
+      else
+        this.settings['editor_css'] = cssPath;
+    } else
+      this.settings['editor_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css";
+
+    if (tinyMCE.settings['debug']) {
+      var msg = "Debug: \n";
+
+      msg += "baseURL: " + this.baseURL + "\n";
+      msg += "documentBasePath: " + this.documentBasePath + "\n";
+      msg += "content_css: " + this.settings['content_css'] + "\n";
+      msg += "popups_css: " + this.settings['popups_css'] + "\n";
+      msg += "editor_css: " + this.settings['editor_css'] + "\n";
+
+      alert(msg);
+    }
+
+    // Only do this once
+    if (this.configs.length == 0) {
+      // Is Safari enabled
+      if (this.isSafari && this.getParam('safari_warning', false))
+        alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false");
+
+      if (typeof(TinyMCECompressed) == "undefined") {
+        tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCE_Engine.prototype.onLoad);
+
+        if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+          if (document.body)
+            tinyMCE.addEvent(document.body, "readystatechange", TinyMCE_Engine.prototype.onLoad);
+          else
+            tinyMCE.addEvent(document, "readystatechange", TinyMCE_Engine.prototype.onLoad);
+        }
+
+        tinyMCE.addEvent(window, "load", TinyMCE_Engine.prototype.onLoad);
+        tinyMCE._addUnloadEvents();
+      }
+    }
+
+    this.loadScript(tinyMCE.baseURL + '/themes/' + this.settings['theme'] + '/editor_template' + tinyMCE.srcMode + '.js');
+    this.loadScript(tinyMCE.baseURL + '/langs/' + this.settings['language'] +  '.js');
+    this.loadCSS(this.settings['editor_css']);
+
+    // Add plugins
+    var p = tinyMCE.getParam('plugins', '', true, ',');
+    if (p.length > 0) {
+      for (var i=0; i<p.length; i++) {
+        if (p[i].charAt(0) != '-')
+          this.loadScript(tinyMCE.baseURL + '/plugins/' + p[i] + '/editor_plugin' + tinyMCE.srcMode + '.js');
+      }
+    }
+
+    // Setup entities
+    settings['cleanup_entities'] = new Array();
+    var entities = tinyMCE.getParam('entities', '', true, ',');
+    for (var i=0; i<entities.length; i+=2)
+      settings['cleanup_entities']['c' + entities[i]] = entities[i+1];
+
+    // Save away this config
+    settings['index'] = this.configs.length;
+    this.configs[this.configs.length] = settings;
+
+    // Start loading first one in chain
+    this.loadNextScript();
+  },
+
+  _addUnloadEvents : function() {
+    if (tinyMCE.isMSIE) {
+      if (tinyMCE.settings['add_unload_trigger']) {
+        tinyMCE.addEvent(window, "unload", TinyMCE_Engine.prototype.unloadHandler);
+        tinyMCE.addEvent(window.document, "beforeunload", TinyMCE_Engine.prototype.unloadHandler);
+      }
+    } else {
+      if (tinyMCE.settings['add_unload_trigger'])
+        tinyMCE.addEvent(window, "unload", function () {tinyMCE.triggerSave(true, true);});
+    }
+  },
+
+  _def : function(key, def_val, t) {
+    var v = tinyMCE.getParam(key, def_val);
+
+    v = t ? v.replace(/\s+/g,"") : v;
+
+    this.settings[key] = v;
+  },
+
+  hasPlugin : function(n) {
+    return typeof(this.plugins[n]) != "undefined" && this.plugins[n] != null;
+  },
+
+  addPlugin : function(n, p) {
+    var op = this.plugins[n];
+
+    // Use the previous plugin object base URL used when loading external plugins
+    p.baseURL = op ? op.baseURL : tinyMCE.baseURL + "/plugins/" + n;
+    this.plugins[n] = p;
+
+    this.loadNextScript();
+  },
+
+  setPluginBaseURL : function(n, u) {
+    var op = this.plugins[n];
+
+    if (op)
+      op.baseURL = u;
+    else
+      this.plugins[n] = {baseURL : u};
+  },
+
+  loadPlugin : function(n, u) {
+    u = u.indexOf('.js') != -1 ? u.substring(0, u.lastIndexOf('/')) : u;
+    u = u.charAt(u.length-1) == '/' ? u.substring(0, u.length-1) : u;
+    this.plugins[n] = {baseURL : u};
+    this.loadScript(u + "/editor_plugin" + (tinyMCE.srcMode ? '_src' : '') + ".js");
+  },
+
+  hasTheme : function(n) {
+    return typeof(this.themes[n]) != "undefined" && this.themes[n] != null;
+  },
+
+  addTheme : function(n, t) {
+    this.themes[n] = t;
+
+    this.loadNextScript();
+  },
+
+  addMenu : function(n, m) {
+    this.menus[n] = m;
+  },
+
+  hasMenu : function(n) {
+    return typeof(this.plugins[n]) != "undefined" && this.plugins[n] != null;
+  },
+
+  loadScript : function(url) {
+    var i;
+
+    for (i=0; i<this.loadedFiles.length; i++) {
+      if (this.loadedFiles[i] == url)
+        return;
+    }
+
+    if (tinyMCE.settings.strict_loading_mode)
+      this.pendingFiles[this.pendingFiles.length] = url;
+    else
+      document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></script>');
+
+    this.loadedFiles[this.loadedFiles.length] = url;
+  },
+
+  loadNextScript : function() {
+    var d = document, se;
+
+    if (!tinyMCE.settings.strict_loading_mode)
+      return;
+
+    if (this.loadingIndex < this.pendingFiles.length) {
+      se = d.createElementNS('http://www.w3.org/1999/xhtml', 'script');
+      se.setAttribute('language', 'javascript');
+      se.setAttribute('type', 'text/javascript');
+      se.setAttribute('src', this.pendingFiles[this.loadingIndex++]);
+
+      d.getElementsByTagName("head")[0].appendChild(se);
+    } else
+      this.loadingIndex = -1; // Done with loading
+  },
+
+  loadCSS : function(url) {
+    var ar = url.replace(/\s+/, '').split(',');
+    var lflen = 0, csslen = 0;
+    var skip = false;
+    var x = 0, i = 0, nl, le;
+
+    for (x = 0,csslen = ar.length; x<csslen; x++) {
+      ignore_css = false;
+
+      if (ar[x] != null && ar[x] != 'null' && ar[x].length > 0) {
+        /* Make sure it doesn't exist. */
+        for (i=0, lflen=this.loadedFiles.length; i<lflen; i++) {
+          if (this.loadedFiles[i] == ar[x]) {
+            skip = true;
+            break;
+          }
+        }
+
+        if (!skip) {
+          if (tinyMCE.settings.strict_loading_mode) {
+            nl = document.getElementsByTagName("head");
+
+            le = document.createElement('link');
+            le.setAttribute('href', ar[x]);
+            le.setAttribute('rel', 'stylesheet');
+            le.setAttribute('type', 'text/css');
+
+            nl[0].appendChild(le);      
+          } else
+            document.write('<link href="' + ar[x] + '" rel="stylesheet" type="text/css" />');
+
+          this.loadedFiles[this.loadedFiles.length] = ar[x];
+        }
+      }
+    }
+  },
+
+  importCSS : function(doc, css) {
+    var css_ary = css.replace(/\s+/, '').split(',');
+    var csslen, elm, headArr, x, css_file;
+
+    for (x = 0, csslen = css_ary.length; x<csslen; x++) {
+      css_file = css_ary[x];
+
+      if (css_file != null && css_file != 'null' && css_file.length > 0) {
+        // Is relative, make absolute
+        if (css_file.indexOf('://') == -1 && css_file.charAt(0) != '/')
+          css_file = this.documentBasePath + "/" + css_file;
+
+        if (typeof(doc.createStyleSheet) == "undefined") {
+          elm = doc.createElement("link");
+
+          elm.rel = "stylesheet";
+          elm.href = css_file;
+
+          if ((headArr = doc.getElementsByTagName("head")) != null && headArr.length > 0)
+            headArr[0].appendChild(elm);
+        } else
+          doc.createStyleSheet(css_file);
+      }
+    }
+  },
+
+  confirmAdd : function(e, settings) {
+    var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
+    var elementId = elm.name ? elm.name : elm.id;
+
+    tinyMCE.settings = settings;
+
+    if (tinyMCE.settings['convert_on_click'] || (!elm.getAttribute('mce_noask') && confirm(tinyMCELang['lang_edit_confirm'])))
+      tinyMCE.addMCEControl(elm, elementId);
+
+    elm.setAttribute('mce_noask', 'true');
+  },
+
+  updateContent : function(form_element_name) {
+    // Find MCE instance linked to given form element and copy it's value
+    var formElement = document.getElementById(form_element_name);
+    for (var n in tinyMCE.instances) {
+      var inst = tinyMCE.instances[n];
+      if (!tinyMCE.isInstance(inst))
+        continue;
+
+      inst.switchSettings();
+
+      if (inst.formElement == formElement) {
+        var doc = inst.getDoc();
+    
+        tinyMCE._setHTML(doc, inst.formElement.value);
+
+        if (!tinyMCE.isMSIE)
+          doc.body.innerHTML = tinyMCE._cleanupHTML(inst, doc, this.settings, doc.body, inst.visualAid);
+      }
+    }
+  },
+
+  addMCEControl : function(replace_element, form_element_name, target_document) {
+    var id = "mce_editor_" + tinyMCE.idCounter++;
+    var inst = new TinyMCE_Control(tinyMCE.settings);
+
+    inst.editorId = id;
+    this.instances[id] = inst;
+
+    inst._onAdd(replace_element, form_element_name, target_document);
+  },
+
+  removeMCEControl : function(editor_id) {
+    var inst = tinyMCE.getInstanceById(editor_id);
+
+    if (inst) {
+      inst.switchSettings();
+
+      editor_id = inst.editorId;
+      var html = tinyMCE.getContent(editor_id);
+
+      // Remove editor instance from instances array
+      var tmpInstances = new Array();
+      for (var instanceName in tinyMCE.instances) {
+        var instance = tinyMCE.instances[instanceName];
+        if (!tinyMCE.isInstance(instance))
+          continue;
+
+        if (instanceName != editor_id)
+            tmpInstances[instanceName] = instance;
+      }
+      tinyMCE.instances = tmpInstances;
+
+      tinyMCE.selectedElement = null;
+      tinyMCE.selectedInstance = null;
+
+      // Remove element
+      var replaceElement = document.getElementById(editor_id + "_parent");
+      var oldTargetElement = inst.oldTargetElement;
+      var targetName = oldTargetElement.nodeName.toLowerCase();
+
+      if (targetName == "textarea" || targetName == "input") {
+        // Just show the old text area
+        replaceElement.parentNode.removeChild(replaceElement);
+        oldTargetElement.style.display = "inline";
+        oldTargetElement.value = html;
+      } else {
+        oldTargetElement.innerHTML = html;
+        oldTargetElement.style.display = 'block';
+
+        replaceElement.parentNode.insertBefore(oldTargetElement, replaceElement);
+        replaceElement.parentNode.removeChild(replaceElement);
+      }
+    }
+  },
+
+  triggerSave : function(skip_cleanup, skip_callback) {
+    var inst, n;
+
+    // Default to false
+    if (typeof(skip_cleanup) == "undefined")
+      skip_cleanup = false;
+
+    // Default to false
+    if (typeof(skip_callback) == "undefined")
+      skip_callback = false;
+
+    // Cleanup and set all form fields
+    for (n in tinyMCE.instances) {
+      inst = tinyMCE.instances[n];
+
+      if (!tinyMCE.isInstance(inst))
+        continue;
+
+      inst.triggerSave(skip_cleanup, skip_callback);
+    }
+  },
+
+  resetForm : function(form_index) {
+    var i, inst, n, formObj = document.forms[form_index];
+
+    for (n in tinyMCE.instances) {
+      inst = tinyMCE.instances[n];
+
+      if (!tinyMCE.isInstance(inst))
+        continue;
+
+      inst.switchSettings();
+
+      for (i=0; i<formObj.elements.length; i++) {
+        if (inst.formTargetElementId == formObj.elements[i].name)
+          inst.getBody().innerHTML = inst.startContent;
+      }
+    }
+  },
+
+  execInstanceCommand : function(editor_id, command, user_interface, value, focus) {
+    var inst = tinyMCE.getInstanceById(editor_id);
+    if (inst) {
+      if (typeof(focus) == "undefined")
+        focus = true;
+
+      if (focus)
+        inst.contentWindow.focus();
+
+      // Reset design mode if lost
+      inst.autoResetDesignMode();
+
+      this.selectedElement = inst.getFocusElement();
+      this.selectedInstance = inst;
+      tinyMCE.execCommand(command, user_interface, value);
+
+      // Cancel event so it doesn't call onbeforeonunlaod
+      if (tinyMCE.isMSIE && window.event != null)
+        tinyMCE.cancelEvent(window.event);
+    }
+  },
+
+  execCommand : function(command, user_interface, value) {
+    // Default input
+    user_interface = user_interface ? user_interface : false;
+    value = value ? value : null;
+
+    if (tinyMCE.selectedInstance)
+      tinyMCE.selectedInstance.switchSettings();
+
+    switch (command) {
+      case 'mceHelp':
+        tinyMCE.openWindow({
+          file : 'about.htm',
+          width : 480,
+          height : 380
+        }, {
+          tinymce_version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion,
+          tinymce_releasedate : tinyMCE.releaseDate,
+          inline : "yes"
+        });
+      return;
+
+      case 'mceFocus':
+        var inst = tinyMCE.getInstanceById(value);
+        if (inst)
+          inst.contentWindow.focus();
+      return;
+
+      case "mceAddControl":
+      case "mceAddEditor":
+        tinyMCE.addMCEControl(tinyMCE._getElementById(value), value);
+        return;
+
+      case "mceAddFrameControl":
+        tinyMCE.addMCEControl(tinyMCE._getElementById(value['element'], value['document']), value['element'], value['document']);
+        return;
+
+      case "mceRemoveControl":
+      case "mceRemoveEditor":
+        tinyMCE.removeMCEControl(value);
+        return;
+
+      case "mceResetDesignMode":
+        // Resets the designmode state of the editors in Gecko
+        if (!tinyMCE.isMSIE) {
+          for (var n in tinyMCE.instances) {
+            if (!tinyMCE.isInstance(tinyMCE.instances[n]))
+              continue;
+
+            try {
+              tinyMCE.instances[n].getDoc().designMode = "on";
+            } catch (e) {
+              // Ignore any errors
+            }
+          }
+        }
+
+        return;
+    }
+
+    if (this.selectedInstance) {
+      this.selectedInstance.execCommand(command, user_interface, value);
+    } else if (tinyMCE.settings['focus_alert'])
+      alert(tinyMCELang['lang_focus_alert']);
+  },
+
+  _createIFrame : function(replace_element, doc, win) {
+    var iframe, id = replace_element.getAttribute("id");
+    var aw, ah;
+
+    if (typeof(doc) == "undefined")
+      doc = document;
+
+    if (typeof(win) == "undefined")
+      win = window;
+
+    iframe = doc.createElement("iframe");
+
+    aw = "" + tinyMCE.settings['area_width'];
+    ah = "" + tinyMCE.settings['area_height'];
+
+    if (aw.indexOf('%') == -1) {
+      aw = parseInt(aw);
+      aw = aw < 0 ? 300 : aw;
+      aw = aw + "px";
+    }
+
+    if (ah.indexOf('%') == -1) {
+      ah = parseInt(ah);
+      ah = ah < 0 ? 240 : ah;
+      ah = ah + "px";
+    }
+
+    iframe.setAttribute("id", id);
+    iframe.setAttribute("class", "mceEditorIframe");
+    iframe.setAttribute("border", "0");
+    iframe.setAttribute("frameBorder", "0");
+    iframe.setAttribute("marginWidth", "0");
+    iframe.setAttribute("marginHeight", "0");
+    iframe.setAttribute("leftMargin", "0");
+    iframe.setAttribute("topMargin", "0");
+    iframe.setAttribute("width", aw);
+    iframe.setAttribute("height", ah);
+    iframe.setAttribute("allowtransparency", "true");
+    iframe.className = 'mceEditorIframe';
+
+    if (tinyMCE.settings["auto_resize"])
+      iframe.setAttribute("scrolling", "no");
+
+    // Must have a src element in MSIE HTTPs breaks aswell as absoute URLs
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+      iframe.setAttribute("src", this.settings['default_document']);
+
+    iframe.style.width = aw;
+    iframe.style.height = ah;
+
+    // Ugly hack for Gecko problem in strict mode
+    if (tinyMCE.settings.strict_loading_mode)
+      iframe.style.marginBottom = '-5px';
+
+    // MSIE 5.0 issue
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+      replace_element.outerHTML = iframe.outerHTML;
+    else
+      replace_element.parentNode.replaceChild(iframe, replace_element);
+
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+      return win.frames[id];
+    else
+      return iframe;
+  },
+
+  setupContent : function(editor_id) {
+    var inst = tinyMCE.instances[editor_id];
+    var doc = inst.getDoc();
+    var head = doc.getElementsByTagName('head').item(0);
+    var content = inst.startContent;
+
+    // HTML values get XML encoded in strict mode
+    if (tinyMCE.settings.strict_loading_mode) {
+      content = content.replace(/&lt;/g, '<');
+      content = content.replace(/&gt;/g, '>');
+      content = content.replace(/&quot;/g, '"');
+      content = content.replace(/&amp;/g, '&');
+    }
+
+    inst.switchSettings();
+
+    // Not loaded correctly hit it again, Mozilla bug #997860
+    if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") {
+      // This part will remove the designMode status
+      // Failes first time in Firefox 1.5b2 on Mac
+      try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {}
+      window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000);
+      return;
+    }
+
+    if (!head) {
+      window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10);
+      return;
+    }
+
+    // Import theme specific content CSS the user specific
+    tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css");
+    tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']);
+    tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst);
+
+    // Setup keyboard shortcuts
+    if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) {
+      inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo');
+      inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo');
+    }
+
+    // Add default shortcuts for gecko
+    if (tinyMCE.isGecko) {
+      inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold');
+      inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic');
+      inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline');
+    }
+
+    // Setup span styles
+    if (tinyMCE.getParam("convert_fonts_to_spans"))
+      inst.getDoc().body.setAttribute('id', 'mceSpanFonts');
+
+    if (tinyMCE.settings['nowrap'])
+      doc.body.style.whiteSpace = "nowrap";
+
+    doc.body.dir = this.settings['directionality'];
+    doc.editorId = editor_id;
+
+    // Add on document element in Mozilla
+    if (!tinyMCE.isMSIE)
+      doc.documentElement.editorId = editor_id;
+
+    inst.setBaseHREF(tinyMCE.settings['base_href']);
+
+    // Replace new line characters to BRs
+    if (tinyMCE.settings['convert_newlines_to_brs']) {
+      content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi");
+      content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi");
+      content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi");
+    }
+
+    // Open closed anchors
+  //  content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>');
+
+    // Call custom cleanup code
+    content = tinyMCE.storeAwayURLs(content);
+    content = tinyMCE._customCleanup(inst, "insert_to_editor", content);
+
+    if (tinyMCE.isMSIE) {
+      // Ugly!!!
+      window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500);
+
+      if (tinyMCE.settings["force_br_newlines"])
+        doc.styleSheets[0].addRule("p", "margin: 0;");
+
+      var body = inst.getBody();
+      body.editorId = editor_id;
+    }
+
+    content = tinyMCE.cleanupHTMLCode(content);
+
+    // Fix for bug #958637
+    if (!tinyMCE.isMSIE) {
+      var contentElement = inst.getDoc().createElement("body");
+      var doc = inst.getDoc();
+
+      contentElement.innerHTML = content;
+
+      // Remove weridness!
+      if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt'])
+        content = content.replace(new RegExp('&lt;&gt;', 'g'), "");
+
+      if (tinyMCE.settings['cleanup_on_startup'])
+        tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement));
+      else {
+        // Convert all strong/em to b/i
+        content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi");
+        content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi");
+        content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi");
+        content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi");
+        content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi");
+        tinyMCE.setInnerHTML(inst.getBody(), content);
+      }
+
+      tinyMCE.convertAllRelativeURLs(inst.getBody());
+    } else {
+      if (tinyMCE.settings['cleanup_on_startup']) {
+        tinyMCE._setHTML(inst.getDoc(), content);
+
+        // Produces permission denied error in MSIE 5.5
+        eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}');
+      } else
+        tinyMCE._setHTML(inst.getDoc(), content);
+    }
+
+    // Fix for bug #957681
+    //inst.getDoc().designMode = inst.getDoc().designMode;
+
+    // Setup element references
+    var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent');
+    inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling;
+
+    tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst);
+    tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc());
+
+    // Re-add design mode on mozilla
+    if (!tinyMCE.isMSIE)
+      tinyMCE.addEventHandlers(inst);
+
+    // Add blur handler
+    if (tinyMCE.isMSIE) {
+      tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch);
+      tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953
+
+      // Workaround for drag drop/copy paste base href bug
+      if (!tinyMCE.isOpera) {
+        tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove);
+        tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch);
+        tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch);
+      }
+    }
+
+    // Trigger node change, this call locks buttons for tables and so forth
+    tinyMCE.selectedInstance = inst;
+    tinyMCE.selectedElement = inst.contentWindow.document.body;
+
+    // Call custom DOM cleanup
+    tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody());
+    tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody());
+    tinyMCE._setEventsEnabled(inst.getBody(), false);
+    tinyMCE.cleanupAnchors(inst.getDoc());
+
+    if (tinyMCE.getParam("convert_fonts_to_spans"))
+      tinyMCE.convertSpansToFonts(inst.getDoc());
+
+    inst.startContent = tinyMCE.trim(inst.getBody().innerHTML);
+    inst.undoRedo.add({ content : inst.startContent });
+
+    // Cleanup any mess left from storyAwayURLs
+    if (tinyMCE.isGecko) {
+      // Remove mce_src from textnodes and comments
+      tinyMCE.selectNodes(inst.getBody(), function(n) {
+        if (n.nodeType == 3 || n.nodeType == 8) {
+          n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
+          n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
+        }
+
+        return false;
+      });
+    }
+
+    // Cleanup any mess left from storyAwayURLs
+    tinyMCE._removeInternal(inst.getBody());
+
+    tinyMCE.selectedInstance = inst;
+    tinyMCE.triggerNodeChange(false, true);
+  },
+
+  storeAwayURLs : function(s) {
+    // Remove all mce_src, mce_href and replace them with new ones
+  //  s = s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
+  //  s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
+
+    if (!s.match(/(mce_src|mce_href)/gi, s)) {
+      s = s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'src="$1" mce_src="$1"');
+      s = s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'href="$1" mce_href="$1"');
+    }
+
+    return s;
+  },
+
+  _removeInternal : function(n) {
+    if (tinyMCE.isGecko) {
+      // Remove mce_src from textnodes and comments
+      tinyMCE.selectNodes(n, function(n) {
+        if (n.nodeType == 3 || n.nodeType == 8) {
+          n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
+          n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
+        }
+
+        return false;
+      });
+    }
+  },
+
+  removeTinyMCEFormElements : function(form_obj) {
+    // Check if form is valid
+    if (typeof(form_obj) == "undefined" || form_obj == null)
+      return;
+
+    // If not a form, find the form
+    if (form_obj.nodeName != "FORM") {
+      if (form_obj.form)
+        form_obj = form_obj.form;
+      else
+        form_obj = tinyMCE.getParentElement(form_obj, "form");
+    }
+
+    // Still nothing
+    if (form_obj == null)
+      return;
+
+    // Disable all UI form elements that TinyMCE created
+    for (var i=0; i<form_obj.elements.length; i++) {
+      var elementId = form_obj.elements[i].name ? form_obj.elements[i].name : form_obj.elements[i].id;
+
+      if (elementId.indexOf('mce_editor_') == 0)
+        form_obj.elements[i].disabled = true;
+    }
+  },
+
+  handleEvent : function(e) {
+    var inst = tinyMCE.selectedInstance;
+
+    // Remove odd, error
+    if (typeof(tinyMCE) == "undefined")
+      return true;
+
+    //tinyMCE.debug(e.type + " " + e.target.nodeName + " " + (e.relatedTarget ? e.relatedTarget.nodeName : ""));
+
+    if (tinyMCE.executeCallback(tinyMCE.selectedInstance, 'handle_event_callback', 'handleEvent', e))
+      return false;
+
+    switch (e.type) {
+      case "beforedeactivate": // Was added due to bug #1439953
+      case "blur":
+        if (tinyMCE.selectedInstance)
+          tinyMCE.selectedInstance.execCommand('mceEndTyping');
+
+        tinyMCE.hideMenus();
+
+        return;
+
+      // Workaround for drag drop/copy paste base href bug
+      case "drop":
+      case "beforepaste":
+        if (tinyMCE.selectedInstance)
+          tinyMCE.selectedInstance.setBaseHREF(null);
+
+        // Fixes odd MSIE bug where drag/droping elements in a iframe with height 100% breaks
+        // This logic forces the width/height to be in pixels while the user is drag/dropping
+        if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+          var ife = tinyMCE.selectedInstance.iframeElement;
+
+          /*if (ife.style.width.indexOf('%') != -1) {
+            ife._oldWidth = ife.width.height;
+            ife.style.width = ife.clientWidth;
+          }*/
+
+          if (ife.style.height.indexOf('%') != -1) {
+            ife._oldHeight = ife.style.height;
+            ife.style.height = ife.clientHeight;
+          }
+        }
+
+        window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings['base_href']);tinyMCE._resetIframeHeight();", 1);
+        return;
+
+      case "submit":
+        tinyMCE.removeTinyMCEFormElements(tinyMCE.isMSIE ? window.event.srcElement : e.target);
+        tinyMCE.triggerSave();
+        tinyMCE.isNotDirty = true;
+        return;
+
+      case "reset":
+        var formObj = tinyMCE.isMSIE ? window.event.srcElement : e.target;
+
+        for (var i=0; i<document.forms.length; i++) {
+          if (document.forms[i] == formObj)
+            window.setTimeout('tinyMCE.resetForm(' + i + ');', 10);
+        }
+
+        return;
+
+      case "keypress":
+        if (inst && inst.handleShortcut(e))
+          return false;
+
+        if (e.target.editorId) {
+          tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
+        } else {
+          if (e.target.ownerDocument.editorId)
+            tinyMCE.selectedInstance = tinyMCE.instances[e.target.ownerDocument.editorId];
+        }
+
+        if (tinyMCE.selectedInstance)
+          tinyMCE.selectedInstance.switchSettings();
+
+        // Insert P element
+        if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && e.keyCode == 13 && !e.shiftKey) {
+          // Insert P element instead of BR
+          if (TinyMCE_ForceParagraphs._insertPara(tinyMCE.selectedInstance, e)) {
+            // Cancel event
+            tinyMCE.execCommand("mceAddUndoLevel");
+            tinyMCE.cancelEvent(e);
+            return false;
+          }
+        }
+
+        // Handle backspace
+        if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {
+          // Insert P element instead of BR
+          if (TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance, e.type)) {
+            // Cancel event
+            tinyMCE.execCommand("mceAddUndoLevel");
+            tinyMCE.cancelEvent(e);
+            return false;
+          }
+        }
+
+        // Return key pressed
+        if (tinyMCE.isMSIE && tinyMCE.settings['force_br_newlines'] && e.keyCode == 13) {
+          if (e.target.editorId)
+            tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
+
+          if (tinyMCE.selectedInstance) {
+            var sel = tinyMCE.selectedInstance.getDoc().selection;
+            var rng = sel.createRange();
+
+            if (tinyMCE.getParentElement(rng.parentElement(), "li") != null)
+              return false;
+
+            // Cancel event
+            e.returnValue = false;
+            e.cancelBubble = true;
+
+            // Insert BR element
+            rng.pasteHTML("<br />");
+            rng.collapse(false);
+            rng.select();
+
+            tinyMCE.execCommand("mceAddUndoLevel");
+            tinyMCE.triggerNodeChange(false);
+            return false;
+          }
+        }
+
+        // Backspace or delete
+        if (e.keyCode == 8 || e.keyCode == 46) {
+          tinyMCE.selectedElement = e.target;
+          tinyMCE.linkElement = tinyMCE.getParentElement(e.target, "a");
+          tinyMCE.imgElement = tinyMCE.getParentElement(e.target, "img");
+          tinyMCE.triggerNodeChange(false);
+        }
+
+        return false;
+      break;
+
+      case "keyup":
+      case "keydown":
+        tinyMCE.hideMenus();
+        tinyMCE.hasMouseMoved = false;
+
+        if (inst && inst.handleShortcut(e))
+          return false;
+
+        if (e.target.editorId)
+          tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
+        else
+          return;
+
+        if (tinyMCE.selectedInstance)
+          tinyMCE.selectedInstance.switchSettings();
+
+        var inst = tinyMCE.selectedInstance;
+
+        // Handle backspace
+        if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {
+          // Insert P element instead of BR
+          if (TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance, e.type)) {
+            // Cancel event
+            tinyMCE.execCommand("mceAddUndoLevel");
+            e.preventDefault();
+            return false;
+          }
+        }
+
+        tinyMCE.selectedElement = null;
+        tinyMCE.selectedNode = null;
+        var elm = tinyMCE.selectedInstance.getFocusElement();
+        tinyMCE.linkElement = tinyMCE.getParentElement(elm, "a");
+        tinyMCE.imgElement = tinyMCE.getParentElement(elm, "img");
+        tinyMCE.selectedElement = elm;
+
+        // Update visualaids on tabs
+        if (tinyMCE.isGecko && e.type == "keyup" && e.keyCode == 9)
+          tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(), true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
+
+        // Fix empty elements on return/enter, check where enter occured
+        if (tinyMCE.isMSIE && e.type == "keydown" && e.keyCode == 13)
+          tinyMCE.enterKeyElement = tinyMCE.selectedInstance.getFocusElement();
+
+        // Fix empty elements on return/enter
+        if (tinyMCE.isMSIE && e.type == "keyup" && e.keyCode == 13) {
+          var elm = tinyMCE.enterKeyElement;
+          if (elm) {
+            var re = new RegExp('^HR|IMG|BR$','g'); // Skip these
+            var dre = new RegExp('^H[1-6]$','g'); // Add double on these
+
+            if (!elm.hasChildNodes() && !re.test(elm.nodeName)) {
+              if (dre.test(elm.nodeName))
+                elm.innerHTML = "&nbsp;&nbsp;";
+              else
+                elm.innerHTML = "&nbsp;";
+            }
+          }
+        }
+
+        // Check if it's a position key
+        var keys = tinyMCE.posKeyCodes;
+        var posKey = false;
+        for (var i=0; i<keys.length; i++) {
+          if (keys[i] == e.keyCode) {
+            posKey = true;
+            break;
+          }
+        }
+
+        // MSIE custom key handling
+        if (tinyMCE.isMSIE && tinyMCE.settings['custom_undo_redo']) {
+          var keys = new Array(8,46); // Backspace,Delete
+          for (var i=0; i<keys.length; i++) {
+            if (keys[i] == e.keyCode) {
+              if (e.type == "keyup")
+                tinyMCE.triggerNodeChange(false);
+            }
+          }
+        }
+
+        // If Ctrl key
+        if (e.keyCode == 17)
+          return true;
+
+        // Handle Undo/Redo when typing content
+
+        // Start typing (non position key)
+        if (!posKey && e.type == "keyup")
+          tinyMCE.execCommand("mceStartTyping");
+
+        // Store undo bookmark
+        if (e.type == "keydown" && (posKey || e.ctrlKey) && inst)
+          inst.undoBookmark = inst.selection.getBookmark();
+
+        // End typing (position key) or some Ctrl event
+        if (e.type == "keyup" && (posKey || e.ctrlKey))
+          tinyMCE.execCommand("mceEndTyping");
+
+        if (posKey && e.type == "keyup")
+          tinyMCE.triggerNodeChange(false);
+
+        if (tinyMCE.isMSIE && e.ctrlKey)
+          window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+      break;
+
+      case "mousedown":
+      case "mouseup":
+      case "click":
+      case "focus":
+        tinyMCE.hideMenus();
+
+        if (tinyMCE.selectedInstance) {
+          tinyMCE.selectedInstance.switchSettings();
+          tinyMCE.selectedInstance.isFocused = true;
+        }
+
+        // Check instance event trigged on
+        var targetBody = tinyMCE.getParentElement(e.target, "body");
+        for (var instanceName in tinyMCE.instances) {
+          if (!tinyMCE.isInstance(tinyMCE.instances[instanceName]))
+            continue;
+
+          var inst = tinyMCE.instances[instanceName];
+
+          // Reset design mode if lost (on everything just in case)
+          inst.autoResetDesignMode();
+
+          if (inst.getBody() == targetBody) {
+            tinyMCE.selectedInstance = inst;
+            tinyMCE.selectedElement = e.target;
+            tinyMCE.linkElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");
+            tinyMCE.imgElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "img");
+            break;
+          }
+        }
+
+        // Add first bookmark location
+        if (!tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark)
+          tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark = tinyMCE.selectedInstance.selection.getBookmark();
+
+        if (tinyMCE.isSafari) {
+          tinyMCE.selectedInstance.lastSafariSelection = tinyMCE.selectedInstance.selection.getBookmark();
+          tinyMCE.selectedInstance.lastSafariSelectedElement = tinyMCE.selectedElement;
+
+          var lnk = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");
+
+          // Patch the darned link
+          if (lnk && e.type == "mousedown") {
+            lnk.setAttribute("mce_real_href", lnk.getAttribute("href"));
+            lnk.setAttribute("href", "javascript:void(0);");
+          }
+
+          // Patch back
+          if (lnk && e.type == "click") {
+            window.setTimeout(function() {
+              lnk.setAttribute("href", lnk.getAttribute("mce_real_href"));
+              lnk.removeAttribute("mce_real_href");
+            }, 10);
+          }
+        }
+
+        // Reset selected node
+        if (e.type != "focus")
+          tinyMCE.selectedNode = null;
+
+        tinyMCE.triggerNodeChange(false);
+        tinyMCE.execCommand("mceEndTyping");
+
+        if (e.type == "mouseup")
+          tinyMCE.execCommand("mceAddUndoLevel");
+
+        // Just in case
+        if (!tinyMCE.selectedInstance && e.target.editorId)
+          tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
+
+        return false;
+      break;
+    }
+  },
+
+  getButtonHTML : function(id, lang, img, cmd, ui, val) {
+    var h = '', m, x;
+
+    cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + cmd + '\'';
+
+    if (typeof(ui) != "undefined" && ui != null)
+      cmd += ',' + ui;
+
+    if (typeof(val) != "undefined" && val != null)
+      cmd += ",'" + val + "'";
+
+    cmd += ');';
+
+    // Use tilemaps when enabled and found and never in MSIE since it loads the tile each time from cache if cahce is disabled
+    if (tinyMCE.getParam('button_tile_map') && (!tinyMCE.isMSIE || tinyMCE.isOpera) && (m = this.buttonMap[id]) != null && (tinyMCE.getParam("language") == "en" || img.indexOf('$lang') == -1)) {
+      // Tiled button
+      x = 0 - (m * 20) == 0 ? '0' : 0 - (m * 20);
+      h += '<a id="{$editor_id}_' + id + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceTiledButton mceButtonNormal" target="_self">';
+      h += '<img src="{$themeurl}/images/spacer.gif" style="background-position: ' + x + 'px 0" title="{$' + lang + '}" />';
+      h += '</a>';
+    } else {
+      // Normal button
+      h += '<a id="{$editor_id}_' + id + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceButtonNormal" target="_self">';
+      h += '<img src="' + img + '" title="{$' + lang + '}" />';
+      h += '</a>';
+    }
+
+    return h;
+  },
+
+  addButtonMap : function(m) {
+    var i, a = m.replace(/\s+/, '').split(',');
+
+    for (i=0; i<a.length; i++)
+      this.buttonMap[a[i]] = i;
+  },
+
+  submitPatch : function() {
+    tinyMCE.removeTinyMCEFormElements(this);
+    tinyMCE.triggerSave();
+    this.mceOldSubmit();
+    tinyMCE.isNotDirty = true;
+  },
+
+  onLoad : function() {
+    // Wait for everything to be loaded first
+    if (tinyMCE.settings.strict_loading_mode && this.loadingIndex != -1) {
+      window.setTimeout('tinyMCE.onLoad();', 1);
+      return;
+    }
+
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera && window.event.type == "readystatechange" && document.readyState != "complete")
+      return true;
+
+    if (tinyMCE.isLoaded)
+      return true;
+
+    tinyMCE.isLoaded = true;
+
+    tinyMCE.dispatchCallback(null, 'onpageload', 'onPageLoad');
+
+    for (var c=0; c<tinyMCE.configs.length; c++) {
+      tinyMCE.settings = tinyMCE.configs[c];
+
+      var selector = tinyMCE.getParam("editor_selector");
+      var deselector = tinyMCE.getParam("editor_deselector");
+      var elementRefAr = new Array();
+
+      // Add submit triggers
+      if (document.forms && tinyMCE.settings['add_form_submit_trigger'] && !tinyMCE.submitTriggers) {
+        for (var i=0; i<document.forms.length; i++) {
+          var form = document.forms[i];
+
+          tinyMCE.addEvent(form, "submit", TinyMCE_Engine.prototype.handleEvent);
+          tinyMCE.addEvent(form, "reset", TinyMCE_Engine.prototype.handleEvent);
+          tinyMCE.submitTriggers = true; // Do it only once
+
+          // Patch the form.submit function
+          if (tinyMCE.settings['submit_patch']) {
+            try {
+              form.mceOldSubmit = form.submit;
+              form.submit = TinyMCE_Engine.prototype.submitPatch;
+            } catch (e) {
+              // Do nothing
+            }
+          }
+        }
+      }
+
+      // Add editor instances based on mode
+      var mode = tinyMCE.settings['mode'];
+      switch (mode) {
+        case "exact":
+          var elements = tinyMCE.getParam('elements', '', true, ',');
+
+          for (var i=0; i<elements.length; i++) {
+            var element = tinyMCE._getElementById(elements[i]);
+            var trigger = element ? element.getAttribute(tinyMCE.settings['textarea_trigger']) : "";
+
+            if (tinyMCE.getAttrib(element, "class").indexOf(deselector) != -1)
+              continue;
+
+            if (trigger == "false")
+              continue;
+
+            if ((tinyMCE.settings['ask'] || tinyMCE.settings['convert_on_click']) && element) {
+              elementRefAr[elementRefAr.length] = element;
+              continue;
+            }
+
+            if (element)
+              tinyMCE.addMCEControl(element, elements[i]);
+            else if (tinyMCE.settings['debug'])
+              alert("Error: Could not find element by id or name: " + elements[i]);
+          }
+        break;
+
+        case "specific_textareas":
+        case "textareas":
+          var nodeList = document.getElementsByTagName("textarea");
+
+          for (var i=0; i<nodeList.length; i++) {
+            var elm = nodeList.item(i);
+            var trigger = elm.getAttribute(tinyMCE.settings['textarea_trigger']);
+
+            if (selector != '' && tinyMCE.getAttrib(elm, "class").indexOf(selector) == -1)
+              continue;
+
+            if (selector != '')
+              trigger = selector != "" ? "true" : "";
+
+            if (tinyMCE.getAttrib(elm, "class").indexOf(deselector) != -1)
+              continue;
+
+            if ((mode == "specific_textareas" && trigger == "true") || (mode == "textareas" && trigger != "false"))
+              elementRefAr[elementRefAr.length] = elm;
+          }
+        break;
+      }
+
+      for (var i=0; i<elementRefAr.length; i++) {
+        var element = elementRefAr[i];
+        var elementId = element.name ? element.name : element.id;
+
+        if (tinyMCE.settings['ask'] || tinyMCE.settings['convert_on_click']) {
+          // Focus breaks in Mozilla
+          if (tinyMCE.isGecko) {
+            var settings = tinyMCE.settings;
+
+            tinyMCE.addEvent(element, "focus", function (e) {window.setTimeout(function() {TinyMCE_Engine.prototype.confirmAdd(e, settings);}, 10);});
+
+            if (element.nodeName != "TEXTAREA" && element.nodeName != "INPUT")
+              tinyMCE.addEvent(element, "click", function (e) {window.setTimeout(function() {TinyMCE_Engine.prototype.confirmAdd(e, settings);}, 10);});
+            // tinyMCE.addEvent(element, "mouseover", function (e) {window.setTimeout(function() {TinyMCE_Engine.prototype.confirmAdd(e, settings);}, 10);});
+          } else {
+            var settings = tinyMCE.settings;
+
+            tinyMCE.addEvent(element, "focus", function () { TinyMCE_Engine.prototype.confirmAdd(null, settings); });
+            tinyMCE.addEvent(element, "click", function () { TinyMCE_Engine.prototype.confirmAdd(null, settings); });
+            // tinyMCE.addEvent(element, "mouseenter", function () { TinyMCE_Engine.prototype.confirmAdd(null, settings); });
+          }
+        } else
+          tinyMCE.addMCEControl(element, elementId);
+      }
+
+      // Handle auto focus
+      if (tinyMCE.settings['auto_focus']) {
+        window.setTimeout(function () {
+          var inst = tinyMCE.getInstanceById(tinyMCE.settings['auto_focus']);
+          inst.selection.selectNode(inst.getBody(), true, true);
+          inst.contentWindow.focus();
+        }, 10);
+      }
+
+      tinyMCE.dispatchCallback(null, 'oninit', 'onInit');
+    }
+  },
+
+  isInstance : function(o) {
+    return o != null && typeof(o) == "object" && o.isTinyMCE_Control;
+  },
+
+  getParam : function(name, default_value, strip_whitespace, split_chr) {
+    var value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
+
+    // Fix bool values
+    if (value == "true" || value == "false")
+      return (value == "true");
+
+    if (strip_whitespace)
+      value = tinyMCE.regexpReplace(value, "[ \t\r\n]", "");
+
+    if (typeof(split_chr) != "undefined" && split_chr != null) {
+      value = value.split(split_chr);
+      var outArray = new Array();
+
+      for (var i=0; i<value.length; i++) {
+        if (value[i] && value[i] != "")
+          outArray[outArray.length] = value[i];
+      }
+
+      value = outArray;
+    }
+
+    return value;
+  },
+
+  getLang : function(name, default_value, parse_entities, va) {
+    var v = (typeof(tinyMCELang[name]) == "undefined") ? default_value : tinyMCELang[name], n;
+
+    if (parse_entities)
+      v = tinyMCE.entityDecode(v);
+
+    if (va) {
+      for (n in va)
+        v = this.replaceVar(v, n, va[n]);
+    }
+
+    return v;
+  },
+
+  entityDecode : function(s) {
+    var e = document.createElement("div");
+    e.innerHTML = s;
+    return e.innerHTML;
+  },
+
+  addToLang : function(prefix, ar) {
+    for (var key in ar) {
+      if (typeof(ar[key]) == 'function')
+        continue;
+
+      tinyMCELang[(key.indexOf('lang_') == -1 ? 'lang_' : '') + (prefix != '' ? (prefix + "_") : '') + key] = ar[key];
+    }
+
+    this.loadNextScript();
+
+  //  for (var key in ar)
+  //    tinyMCELang[(key.indexOf('lang_') == -1 ? 'lang_' : '') + (prefix != '' ? (prefix + "_") : '') + key] = "|" + ar[key] + "|";
+  },
+
+  triggerNodeChange : function(focus, setup_content) {
+    if (tinyMCE.selectedInstance) {
+      var inst = tinyMCE.selectedInstance;
+      var editorId = inst.editorId;
+      var elm = (typeof(setup_content) != "undefined" && setup_content) ? tinyMCE.selectedElement : inst.getFocusElement();
+      var undoIndex = -1;
+      var undoLevels = -1;
+      var anySelection = false;
+      var selectedText = inst.selection.getSelectedText();
+
+      if (setup_content && tinyMCE.isGecko && inst.isHidden())
+        elm = inst.getBody();
+
+      inst.switchSettings();
+
+      if (tinyMCE.settings["auto_resize"]) {
+        var doc = inst.getDoc();
+
+        inst.iframeElement.style.width = doc.body.offsetWidth + "px";
+        inst.iframeElement.style.height = doc.body.offsetHeight + "px";
+      }
+
+      if (tinyMCE.selectedElement)
+        anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);
+
+      if (tinyMCE.settings['custom_undo_redo']) {
+        undoIndex = inst.undoRedo.undoIndex;
+        undoLevels = inst.undoRedo.undoLevels.length;
+      }
+
+      tinyMCE.dispatchCallback(inst, 'handle_node_change_callback', 'handleNodeChange', editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection, setup_content);
+    }
+
+    if (this.selectedInstance && (typeof(focus) == "undefined" || focus))
+      this.selectedInstance.contentWindow.focus();
+  },
+
+  _customCleanup : function(inst, type, content) {
+    var pl, po, i;
+
+    // Call custom cleanup
+    var customCleanup = tinyMCE.settings['cleanup_callback'];
+    if (customCleanup != "" && eval("typeof(" + customCleanup + ")") != "undefined")
+      content = eval(customCleanup + "(type, content, inst);");
+
+    // Trigger plugin cleanups
+    pl = inst.plugins;
+    for (i=0; i<pl.length; i++) {
+      po = tinyMCE.plugins[pl[i]];
+
+      if (po && po.cleanup)
+        content = po.cleanup(type, content, inst);
+    }
+
+    return content;
+  },
+
+  setContent : function(h) {
+    if (tinyMCE.selectedInstance) {
+      tinyMCE.selectedInstance.execCommand('mceSetContent', false, h);
+      tinyMCE.selectedInstance.repaint();
+    }
+  },
+
+  importThemeLanguagePack : function(name) {
+    if (typeof(name) == "undefined")
+      name = tinyMCE.settings['theme'];
+
+    tinyMCE.loadScript(tinyMCE.baseURL + '/themes/' + name + '/langs/' + tinyMCE.settings['language'] + '.js');
+  },
+
+  importPluginLanguagePack : function(name, valid_languages) {
+    var lang = "en", b = tinyMCE.baseURL + '/plugins/' + name;
+
+    valid_languages = valid_languages.split(',');
+    for (var i=0; i<valid_languages.length; i++) {
+      if (tinyMCE.settings['language'] == valid_languages[i])
+        lang = tinyMCE.settings['language'];
+    }
+
+    if (this.plugins[name])
+      b = this.plugins[name].baseURL;
+
+    tinyMCE.loadScript(b + '/langs/' + lang +  '.js');
+  },
+
+  applyTemplate : function(h, as) {
+    var i, s, ar = h.match(new RegExp('\\{\\$[a-z0-9_]+\\}', 'gi'));
+
+    if (ar && ar.length > 0) {
+      for (i=ar.length-1; i>=0; i--) {
+        s = ar[i].substring(2, ar[i].length-1);
+
+        if (s.indexOf('lang_') == 0 && tinyMCELang[s])
+          h = tinyMCE.replaceVar(h, s, tinyMCELang[s]);
+        else if (as && as[s])
+          h = tinyMCE.replaceVar(h, s, as[s]);
+        else if (tinyMCE.settings[s])
+          h = tinyMCE.replaceVar(h, s, tinyMCE.settings[s]);
+      }
+    }
+
+    h = tinyMCE.replaceVar(h, "themeurl", tinyMCE.themeURL);
+
+    return h;
+  },
+
+  replaceVar : function(h, r, v) {
+    return h.replace(new RegExp('{\\\$' + r + '}', 'g'), v);
+  },
+
+  openWindow : function(template, args) {
+    var html, width, height, x, y, resizable, scrollbars, url;
+
+    args['mce_template_file'] = template['file'];
+    args['mce_width'] = template['width'];
+    args['mce_height'] = template['height'];
+    tinyMCE.windowArgs = args;
+
+    html = template['html'];
+    if (!(width = parseInt(template['width'])))
+      width = 320;
+
+    if (!(height = parseInt(template['height'])))
+      height = 200;
+
+    // Add to height in M$ due to SP2 WHY DON'T YOU GUYS IMPLEMENT innerWidth of windows!!
+    if (tinyMCE.isMSIE)
+      height += 40;
+    else
+      height += 20;
+
+    x = parseInt(screen.width / 2.0) - (width / 2.0);
+    y = parseInt(screen.height / 2.0) - (height / 2.0);
+
+    resizable = (args && args['resizable']) ? args['resizable'] : "no";
+    scrollbars = (args && args['scrollbars']) ? args['scrollbars'] : "no";
+
+    if (template['file'].charAt(0) != '/' && template['file'].indexOf('://') == -1)
+      url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template['file'];
+    else
+      url = template['file'];
+
+    // Replace all args as variables in URL
+    for (var name in args) {
+      if (typeof(args[name]) == 'function')
+        continue;
+
+      url = tinyMCE.replaceVar(url, name, escape(args[name]));
+    }
+
+    if (html) {
+      html = tinyMCE.replaceVar(html, "css", this.settings['popups_css']);
+      html = tinyMCE.applyTemplate(html, args);
+
+      var win = window.open("", "mcePopup" + new Date().getTime(), "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=yes,minimizable=" + resizable + ",modal=yes,width=" + width + ",height=" + height + ",resizable=" + resizable);
+      if (win == null) {
+        alert(tinyMCELang['lang_popup_blocked']);
+        return;
+      }
+
+      win.document.write(html);
+      win.document.close();
+      win.resizeTo(width, height);
+      win.focus();
+    } else {
+      if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && resizable != 'yes' && tinyMCE.settings["dialog_type"] == "modal") {
+        height += 10;
+
+        var features = "resizable:" + resizable 
+          + ";scroll:"
+          + scrollbars + ";status:yes;center:yes;help:no;dialogWidth:"
+          + width + "px;dialogHeight:" + height + "px;";
+
+        window.showModalDialog(url, window, features);
+      } else {
+        var modal = (resizable == "yes") ? "no" : "yes";
+
+        if (tinyMCE.isGecko && tinyMCE.isMac)
+          modal = "no";
+
+        if (template['close_previous'] != "no")
+          try {tinyMCE.lastWindow.close();} catch (ex) {}
+
+        var win = window.open(url, "mcePopup" + new Date().getTime(), "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=" + modal + ",minimizable=" + resizable + ",modal=" + modal + ",width=" + width + ",height=" + height + ",resizable=" + resizable);
+        if (win == null) {
+          alert(tinyMCELang['lang_popup_blocked']);
+          return;
+        }
+
+        if (template['close_previous'] != "no")
+          tinyMCE.lastWindow = win;
+
+        eval('try { win.resizeTo(width, height); } catch(e) { }');
+
+        // Make it bigger if statusbar is forced
+        if (tinyMCE.isGecko) {
+          if (win.document.defaultView.statusbar.visible)
+            win.resizeBy(0, tinyMCE.isMac ? 10 : 24);
+        }
+
+        win.focus();
+      }
+    }
+  },
+
+  closeWindow : function(win) {
+    win.close();
+  },
+
+  getVisualAidClass : function(class_name, state) {
+    var aidClass = tinyMCE.settings['visual_table_class'];
+
+    if (typeof(state) == "undefined")
+      state = tinyMCE.settings['visual'];
+
+    // Split
+    var classNames = new Array();
+    var ar = class_name.split(' ');
+    for (var i=0; i<ar.length; i++) {
+      if (ar[i] == aidClass)
+        ar[i] = "";
+
+      if (ar[i] != "")
+        classNames[classNames.length] = ar[i];
+    }
+
+    if (state)
+      classNames[classNames.length] = aidClass;
+
+    // Glue
+    var className = "";
+    for (var i=0; i<classNames.length; i++) {
+      if (i > 0)
+        className += " ";
+
+      className += classNames[i];
+    }
+
+    return className;
+  },
+
+  handleVisualAid : function(el, deep, state, inst, skip_dispatch) {
+    if (!el)
+      return;
+
+    if (!skip_dispatch)
+      tinyMCE.dispatchCallback(inst, 'handle_visual_aid_callback', 'handleVisualAid', el, deep, state, inst);
+
+    var tableElement = null;
+
+    switch (el.nodeName) {
+      case "TABLE":
+        var oldW = el.style.width;
+        var oldH = el.style.height;
+        var bo = tinyMCE.getAttrib(el, "border");
+
+        bo = bo == "" || bo == "0" ? true : false;
+
+        tinyMCE.setAttrib(el, "class", tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el, "class"), state && bo));
+
+        el.style.width = oldW;
+        el.style.height = oldH;
+
+        for (var y=0; y<el.rows.length; y++) {
+          for (var x=0; x<el.rows[y].cells.length; x++) {
+            var cn = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el.rows[y].cells[x], "class"), state && bo);
+            tinyMCE.setAttrib(el.rows[y].cells[x], "class", cn);
+          }
+        }
+
+        break;
+
+      case "A":
+        var anchorName = tinyMCE.getAttrib(el, "name");
+
+        if (anchorName != '' && state) {
+          el.title = anchorName;
+          el.className = 'mceItemAnchor';
+        } else if (anchorName != '' && !state)
+          el.className = '';
+
+        break;
+    }
+
+    if (deep && el.hasChildNodes()) {
+      for (var i=0; i<el.childNodes.length; i++)
+        tinyMCE.handleVisualAid(el.childNodes[i], deep, state, inst, true);
+    }
+  },
+
+  /*
+  applyClassesToFonts : function(doc, size) {
+    var f = doc.getElementsByTagName("font");
+    for (var i=0; i<f.length; i++) {
+      var s = tinyMCE.getAttrib(f[i], "size");
+
+      if (s != "")
+        tinyMCE.setAttrib(f[i], 'class', "mceItemFont" + s);
+    }
+
+    if (typeof(size) != "undefined") {
+      var css = "";
+
+      for (var x=0; x<doc.styleSheets.length; x++) {
+        for (var i=0; i<doc.styleSheets[x].rules.length; i++) {
+          if (doc.styleSheets[x].rules[i].selectorText == '#mceSpanFonts .mceItemFont' + size) {
+            css = doc.styleSheets[x].rules[i].style.cssText;
+            break;
+          }
+        }
+
+        if (css != "")
+          break;
+      }
+
+      if (doc.styleSheets[0].rules[0].selectorText == "FONT")
+        doc.styleSheets[0].removeRule(0);
+
+      doc.styleSheets[0].addRule("FONT", css, 0);
+    }
+  },
+  */
+
+  fixGeckoBaseHREFBug : function(m, e, h) {
+    var nl, i, a, n, xsrc, xhref, el;
+
+    if (tinyMCE.isGecko) {
+      if (m == 1) {
+        h = h.replace(/\ssrc=/gi, " mce_tsrc=");
+        h = h.replace(/\shref=/gi, " mce_thref=");
+
+        return h;
+      } else {
+        el = new Array('a','img','select','area','iframe','base','input','script','embed','object','link');
+
+        for (a=0; a<el.length; a++) {
+          n = e.getElementsByTagName(el[a]);
+
+          for (i=0; i<n.length; i++) {
+            xsrc = tinyMCE.getAttrib(n[i], "mce_tsrc");
+            xhref = tinyMCE.getAttrib(n[i], "mce_thref");
+
+            if (xsrc != "") {
+              try {
+                n[i].src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xsrc);
+              } catch (e) {
+                // Ignore, Firefox cast exception if local file wasn't found
+              }
+
+              n[i].removeAttribute("mce_tsrc");
+            }
+
+            if (xhref != "") {
+              try {
+                n[i].href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xhref);
+              } catch (e) {
+                // Ignore, Firefox cast exception if local file wasn't found
+              }
+
+              n[i].removeAttribute("mce_thref");
+            }
+          }
+        }
+
+        el = tinyMCE.selectNodes(e, function(n) {
+          if (n.nodeType == 3 || n.nodeType == 8) {
+            n.nodeValue = n.nodeValue.replace(/\smce_tsrc=/gi, " src=");
+            n.nodeValue = n.nodeValue.replace(/\smce_thref=/gi, " href=");
+          }
+
+          return false;
+        });
+      }
+    }
+
+    return h;
+  },
+
+  _setHTML : function(doc, html_content) {
+    // Force closed anchors open
+    //html_content = html_content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>');
+
+    html_content = tinyMCE.cleanupHTMLCode(html_content);
+
+    // Try innerHTML if it fails use pasteHTML in MSIE
+    try {
+      tinyMCE.setInnerHTML(doc.body, html_content);
+    } catch (e) {
+      if (this.isMSIE)
+        doc.body.createTextRange().pasteHTML(html_content);
+    }
+
+    // Content duplication bug fix
+    if (tinyMCE.isMSIE && tinyMCE.settings['fix_content_duplication']) {
+      // Remove P elements in P elements
+      var paras = doc.getElementsByTagName("P");
+      for (var i=0; i<paras.length; i++) {
+        var node = paras[i];
+        while ((node = node.parentNode) != null) {
+          if (node.nodeName == "P")
+            node.outerHTML = node.innerHTML;
+        }
+      }
+
+      // Content duplication bug fix (Seems to be word crap)
+      var html = doc.body.innerHTML;
+/*
+      if (html.indexOf('="mso') != -1) {
+        for (var i=0; i<doc.body.all.length; i++) {
+          var el = doc.body.all[i];
+          el.removeAttribute("className","",0);
+          el.removeAttribute("style","",0);
+        }
+
+        html = doc.body.innerHTML;
+        html = tinyMCE.regexpReplace(html, "<o:p><\/o:p>", "<br />");
+        html = tinyMCE.regexpReplace(html, "<o:p>&nbsp;<\/o:p>", "");
+        html = tinyMCE.regexpReplace(html, "<st1:.*?>", "");
+        html = tinyMCE.regexpReplace(html, "<p><\/p>", "");
+        html = tinyMCE.regexpReplace(html, "<p><\/p>\r\n<p><\/p>", "");
+        html = tinyMCE.regexpReplace(html, "<p>&nbsp;<\/p>", "<br />");
+        html = tinyMCE.regexpReplace(html, "<p>\s*(<p>\s*)?", "<p>");
+        html = tinyMCE.regexpReplace(html, "<\/p>\s*(<\/p>\s*)?", "</p>");
+      }*/
+
+      // Always set the htmlText output
+      tinyMCE.setInnerHTML(doc.body, html);
+    }
+
+    tinyMCE.cleanupAnchors(doc);
+
+    if (tinyMCE.getParam("convert_fonts_to_spans"))
+      tinyMCE.convertSpansToFonts(doc);
+  },
+
+  getEditorId : function(form_element) {
+    var inst = this.getInstanceById(form_element);
+    if (!inst)
+      return null;
+
+    return inst.editorId;
+  },
+
+  getInstanceById : function(editor_id) {
+    var inst = this.instances[editor_id];
+    if (!inst) {
+      for (var n in tinyMCE.instances) {
+        var instance = tinyMCE.instances[n];
+        if (!tinyMCE.isInstance(instance))
+          continue;
+
+        if (instance.formTargetElementId == editor_id) {
+          inst = instance;
+          break;
+        }
+      }
+    }
+
+    return inst;
+  },
+
+  queryInstanceCommandValue : function(editor_id, command) {
+    var inst = tinyMCE.getInstanceById(editor_id);
+    if (inst)
+      return inst.queryCommandValue(command);
+
+    return false;
+  },
+
+  queryInstanceCommandState : function(editor_id, command) {
+    var inst = tinyMCE.getInstanceById(editor_id);
+    if (inst)
+      return inst.queryCommandState(command);
+
+    return null;
+  },
+
+  setWindowArg : function(n, v) {
+    this.windowArgs[n] = v;
+  },
+
+  getWindowArg : function(n, d) {
+    return (typeof(this.windowArgs[n]) == "undefined") ? d : this.windowArgs[n];
+  },
+
+  getCSSClasses : function(editor_id, doc) {
+    var output = new Array();
+
+    // Is cached, use that
+    if (typeof(tinyMCE.cssClasses) != "undefined")
+      return tinyMCE.cssClasses;
+
+    if (typeof(editor_id) == "undefined" && typeof(doc) == "undefined") {
+      var instance;
+
+      for (var instanceName in tinyMCE.instances) {
+        instance = tinyMCE.instances[instanceName];
+        if (!tinyMCE.isInstance(instance))
+          continue;
+
+        break;
+      }
+
+      doc = instance.getDoc();
+    }
+
+    if (typeof(doc) == "undefined") {
+      var instance = tinyMCE.getInstanceById(editor_id);
+      doc = instance.getDoc();
+    }
+
+    if (doc) {
+      var styles = doc.styleSheets;
+
+      if (styles && styles.length > 0) {
+        for (var x=0; x<styles.length; x++) {
+          var csses = null;
+
+          // Just ignore any errors
+          eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets(" + x + ").rules : styles[" + x + "].cssRules;} catch(e) {}");
+          if (!csses)
+            return new Array();
+
+          for (var i=0; i<csses.length; i++) {
+            var selectorText = csses[i].selectorText;
+
+            // Can be multiple rules per selector
+            if (selectorText) {
+              var rules = selectorText.split(',');
+              for (var c=0; c<rules.length; c++) {
+                var rule = rules[c];
+
+                // Strip spaces between selectors
+                while (rule.indexOf(' ') == 0)
+                  rule = rule.substring(1);
+
+                // Invalid rule
+                if (rule.indexOf(' ') != -1 || rule.indexOf(':') != -1 || rule.indexOf('mceItem') != -1)
+                  continue;
+
+                if (rule.indexOf(tinyMCE.settings['visual_table_class']) != -1 || rule.indexOf('mceEditable') != -1 || rule.indexOf('mceNonEditable') != -1)
+                  continue;
+
+                // Is class rule
+                if (rule.indexOf('.') != -1) {
+                  var cssClass = rule.substring(rule.indexOf('.') + 1);
+                  var addClass = true;
+
+                  for (var p=0; p<output.length && addClass; p++) {
+                    if (output[p] == cssClass)
+                      addClass = false;
+                  }
+
+                  if (addClass)
+                    output[output.length] = cssClass;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+
+    // Cache em
+    if (output.length > 0)
+      tinyMCE.cssClasses = output;
+
+    return output;
+  },
+
+  regexpReplace : function(in_str, reg_exp, replace_str, opts) {
+    if (in_str == null)
+      return in_str;
+
+    if (typeof(opts) == "undefined")
+      opts = 'g';
+
+    var re = new RegExp(reg_exp, opts);
+    return in_str.replace(re, replace_str);
+  },
+
+  trim : function(s) {
+    return s.replace(/^\s*|\s*$/g, "");
+  },
+
+  cleanupEventStr : function(s) {
+    s = "" + s;
+    s = s.replace('function anonymous()\n{\n', '');
+    s = s.replace('\n}', '');
+    s = s.replace(/^return true;/gi, ''); // Remove event blocker
+
+    return s;
+  },
+
+  getControlHTML : function(c) {
+    var i, l, n, o, v;
+
+    l = tinyMCE.plugins;
+    for (n in l) {
+      o = l[n];
+
+      if (o.getControlHTML && (v = o.getControlHTML(c)) != '')
+        return tinyMCE.replaceVar(v, "pluginurl", o.baseURL);
+    }
+
+    o = tinyMCE.themes[tinyMCE.settings['theme']];
+    if (o.getControlHTML && (v = o.getControlHTML(c)) != '')
+      return v;
+
+    return '';
+  },
+
+  evalFunc : function(f, idx, a) {
+    var s = '(', i;
+
+    for (i=idx; i<a.length; i++) {
+      s += 'a[' + i + ']';
+
+      if (i < a.length-1)
+        s += ',';
+    }
+
+    s += ');';
+
+    return eval("f" + s);
+  },
+
+  dispatchCallback : function(i, p, n) {
+    return this.callFunc(i, p, n, 0, this.dispatchCallback.arguments);
+  },
+
+  executeCallback : function(i, p, n) {
+    return this.callFunc(i, p, n, 1, this.executeCallback.arguments);
+  },
+
+  execCommandCallback : function(i, p, n) {
+    return this.callFunc(i, p, n, 2, this.execCommandCallback.arguments);
+  },
+
+  callFunc : function(ins, p, n, m, a) {
+    var l, i, on, o, s, v;
+
+    s = m == 2;
+
+    l = tinyMCE.getParam(p, '');
+
+    if (l != '' && (v = tinyMCE.evalFunc(typeof(l) == "function" ? l : eval(l), 3, a)) == s && m > 0)
+      return true;
+
+    if (ins != null) {
+      for (i=0, l = ins.plugins; i<l.length; i++) {
+        o = tinyMCE.plugins[l[i]];
+
+        if (o[n] && (v = tinyMCE.evalFunc(o[n], 3, a)) == s && m > 0)
+          return true;
+      }
+    }
+
+    l = tinyMCE.themes;
+    for (on in l) {
+      o = l[on];
+
+      if (o[n] && (v = tinyMCE.evalFunc(o[n], 3, a)) == s && m > 0)
+        return true;
+    }
+
+    return false;
+  },
+
+  xmlEncode : function(s) {
+    s = "" + s;
+    s = s.replace(/&/g, '&amp;');
+    s = s.replace(new RegExp('"', 'g'), '&quot;');
+    s = s.replace(/\'/g, '&#39;'); // &apos; is not working in MSIE
+    s = s.replace(/</g, '&lt;');
+    s = s.replace(/>/g, '&gt;');
+
+    return s;
+  },
+
+  extend : function(p, np) {
+    var o = {};
+
+    o.parent = p;
+
+    for (n in p)
+      o[n] = p[n];
+
+    for (n in np)
+      o[n] = np[n];
+
+    return o;
+  },
+
+  hideMenus : function() {
+    var e = tinyMCE.lastSelectedMenuBtn;
+
+    if (tinyMCE.lastMenu) {
+      tinyMCE.lastMenu.hide();
+      tinyMCE.lastMenu = null;
+    }
+
+    if (e) {
+      tinyMCE.switchClass(e, tinyMCE.lastMenuBtnClass);
+      tinyMCE.lastSelectedMenuBtn = null;
+    }
+  },
+
+  explode : function(d, s) {
+    var ar = s.split(d), oar = new Array(), i;
+  
+    for (i = 0; i<ar.length; i++) {
+      if (ar[i] != "")
+        oar[oar.length] = ar[i];
+    }
+  
+    return oar;
+  }
+};
+
+// Global instances
+var TinyMCE = TinyMCE_Engine; // Compatiblity with gzip compressors
+var tinyMCE = new TinyMCE_Engine();
+var tinyMCELang = {};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Control.class.js */
+
+function TinyMCE_Control(settings) {
+  var t, i, to, fu, p, x, fn, fu, pn, s = settings;
+
+  this.undoRedoLevel = true;
+  this.isTinyMCE_Control = true;
+
+  // Default settings
+  this.settings = s;
+  this.settings['theme'] = tinyMCE.getParam("theme", "default");
+  this.settings['width'] = tinyMCE.getParam("width", -1);
+  this.settings['height'] = tinyMCE.getParam("height", -1);
+  this.selection = new TinyMCE_Selection(this);
+  this.undoRedo = new TinyMCE_UndoRedo(this);
+  this.cleanup = new TinyMCE_Cleanup();
+  this.shortcuts = new Array();
+  this.hasMouseMoved = false;
+
+  this.cleanup.init({
+    valid_elements : s.valid_elements,
+    extended_valid_elements : s.extended_valid_elements,
+    entities : s.entities,
+    entity_encoding : s.entity_encoding,
+    debug : s.cleanup_debug,
+    url_converter : 'TinyMCE_Cleanup.prototype._urlConverter',
+    indent : s.apply_source_formatting,
+    invalid_elements : s.invalid_elements,
+    verify_html : s.verify_html,
+    fix_content_duplication : s.fix_content_duplication
+  });
+
+  // Wrap old theme
+  t = this.settings['theme'];
+  if (!tinyMCE.hasTheme(t)) {
+    fn = tinyMCE.callbacks;
+    to = {};
+
+    for (i=0; i<fn.length; i++) {
+      if ((fu = window['TinyMCE_' + t + "_" + fn[i]]))
+        to[fn[i]] = fu;
+    }
+
+    tinyMCE.addTheme(t, to);
+  }
+
+  // Wrap old plugins
+  this.plugins = new Array();
+  p = tinyMCE.getParam('plugins', '', true, ',');
+  if (p.length > 0) {
+    for (i=0; i<p.length; i++) {
+      pn = p[i];
+
+      if (pn.charAt(0) == '-')
+        pn = pn.substring(1);
+
+      if (!tinyMCE.hasPlugin(pn)) {
+        fn = tinyMCE.callbacks;
+        to = {};
+
+        for (x=0; x<fn.length; x++) {
+          if ((fu = window['TinyMCE_' + pn + "_" + fn[x]]))
+            to[fn[x]] = fu;
+        }
+
+        tinyMCE.addPlugin(pn, to);
+      }
+
+      this.plugins[this.plugins.length] = pn; 
+    }
+  }
+};
+
+TinyMCE_Control.prototype = {
+  hasPlugin : function(n) {
+    var i;
+
+    for (i=0; i<this.plugins.length; i++) {
+      if (this.plugins[i] == n)
+        return true;
+    }
+
+    return false;
+  },
+
+  addPlugin : function(n, p) {
+    if (!this.hasPlugin(n)) {
+      tinyMCE.addPlugin(n, p);
+      this.plugins[this.plugins.length] = n;
+    }
+  },
+
+  repaint : function() {
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+      return;
+
+    try {
+      var s = this.selection;
+      var b = s.getBookmark(true);
+      this.getBody().style.display = 'none';
+      this.getDoc().execCommand('selectall', false, null);
+      this.getSel().collapseToStart();
+      this.getBody().style.display = 'block';
+      s.moveToBookmark(b);
+    } catch (ex) {
+      // Ignore
+    }
+  },
+
+  switchSettings : function() {
+    if (tinyMCE.configs.length > 1 && tinyMCE.currentConfig != this.settings['index']) {
+      tinyMCE.settings = this.settings;
+      tinyMCE.currentConfig = this.settings['index'];
+    }
+  },
+
+  getBody : function() {
+    return this.getDoc().body;
+  },
+
+  getDoc : function() {
+    return this.contentWindow.document;
+  },
+
+  getWin : function() {
+    return this.contentWindow;
+  },
+
+  addShortcut : function(m, k, d, cmd, ui, va) {
+    var n = typeof(k) == "number", ie = tinyMCE.isMSIE, c, sc, i;
+    var scl = this.shortcuts;
+
+    if (!tinyMCE.getParam('custom_shortcuts'))
+      return false;
+
+    m = m.toLowerCase();
+    k = ie && !n ? k.toUpperCase() : k;
+    c = n ? null : k.charCodeAt(0);
+    d = d && d.indexOf('lang_') == 0 ? tinyMCE.getLang(d) : d;
+
+    sc = {
+      alt : m.indexOf('alt') != -1,
+      ctrl : m.indexOf('ctrl') != -1,
+      shift : m.indexOf('shift') != -1,
+      charCode : c,
+      keyCode : n ? k : (ie ? c : null),
+      desc : d,
+      cmd : cmd,
+      ui : ui,
+      val : va
+    };
+
+    for (i=0; i<scl.length; i++) {
+      if (sc.alt == scl[i].alt && sc.ctrl == scl[i].ctrl && sc.shift == scl[i].shift
+        && sc.charCode == scl[i].charCode && sc.keyCode == scl[i].keyCode) {
+        return false;
+      }
+    }
+
+    scl[scl.length] = sc;
+
+    return true;
+  },
+
+  handleShortcut : function(e) {
+    var i, s = this.shortcuts, o;
+
+    for (i=0; i<s.length; i++) {
+      o = s[i];
+      if (o.alt == e.altKey && o.ctrl == e.ctrlKey && (o.keyCode == e.keyCode || o.charCode == e.charCode)) {
+        if (o.cmd && (e.type == "keydown" || (e.type == "keypress" && !tinyMCE.isOpera)))
+          tinyMCE.execCommand(o.cmd, o.ui, o.val);
+
+        tinyMCE.cancelEvent(e);
+        return true;
+      }
+    }
+
+    return false;
+  },
+
+  autoResetDesignMode : function() {
+    // Add fix for tab/style.display none/block problems in Gecko
+    if (!tinyMCE.isMSIE && this.isHidden() && tinyMCE.getParam('auto_reset_designmode'))
+      eval('try { this.getDoc().designMode = "On"; } catch(e) {}');
+  },
+
+  isHidden : function() {
+    if (tinyMCE.isMSIE)
+      return false;
+
+    var s = this.getSel();
+
+    // Weird, wheres that cursor selection?
+    return (!s || !s.rangeCount || s.rangeCount == 0);
+  },
+
+  isDirty : function() {
+    // Is content modified and not in a submit procedure
+    return this.startContent != tinyMCE.trim(this.getBody().innerHTML) && !tinyMCE.isNotDirty;
+  },
+
+  _mergeElements : function(scmd, pa, ch, override) {
+    if (scmd == "removeformat") {
+      pa.className = "";
+      pa.style.cssText = "";
+      ch.className = "";
+      ch.style.cssText = "";
+      return;
+    }
+
+    var st = tinyMCE.parseStyle(tinyMCE.getAttrib(pa, "style"));
+    var stc = tinyMCE.parseStyle(tinyMCE.getAttrib(ch, "style"));
+    var className = tinyMCE.getAttrib(pa, "class");
+
+    className += " " + tinyMCE.getAttrib(ch, "class");
+
+    if (override) {
+      for (var n in st) {
+        if (typeof(st[n]) == 'function')
+          continue;
+
+        stc[n] = st[n];
+      }
+    } else {
+      for (var n in stc) {
+        if (typeof(stc[n]) == 'function')
+          continue;
+
+        st[n] = stc[n];
+      }
+    }
+
+    tinyMCE.setAttrib(pa, "style", tinyMCE.serializeStyle(st));
+    tinyMCE.setAttrib(pa, "class", tinyMCE.trim(className));
+    ch.className = "";
+    ch.style.cssText = "";
+    ch.removeAttribute("class");
+    ch.removeAttribute("style");
+  },
+
+  _setUseCSS : function(b) {
+    var d = this.getDoc();
+
+    try {d.execCommand("useCSS", false, !b);} catch (ex) {}
+    try {d.execCommand("styleWithCSS", false, b);} catch (ex) {}
+
+    if (!tinyMCE.getParam("table_inline_editing"))
+      try {d.execCommand('enableInlineTableEditing', false, "false");} catch (ex) {}
+
+    if (!tinyMCE.getParam("object_resizing"))
+      try {d.execCommand('enableObjectResizing', false, "false");} catch (ex) {}
+  },
+
+  execCommand : function(command, user_interface, value) {
+    var doc = this.getDoc();
+    var win = this.getWin();
+    var focusElm = this.getFocusElement();
+
+    // Is non udno specific command
+    if (!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel', 'gi').test(command))
+      this.undoBookmark = null;
+
+    if (this.lastSafariSelection && !new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel', 'gi').test(command)) {
+      this.selection.moveToBookmark(this.lastSafariSelection);
+      tinyMCE.selectedElement = this.lastSafariSelectedElement;
+    }
+
+    // Mozilla issue
+    if (!tinyMCE.isMSIE && !this.useCSS) {
+      this._setUseCSS(false);
+      this.useCSS = true;
+    }
+
+    //debug("command: " + command + ", user_interface: " + user_interface + ", value: " + value);
+    this.contentDocument = doc; // <-- Strange, unless this is applied Mozilla 1.3 breaks
+
+    if (tinyMCE.execCommandCallback(this, 'execcommand_callback', 'execCommand', this.editorId, this.getBody(), command, user_interface, value))
+      return;
+
+    // Fix align on images
+    if (focusElm && focusElm.nodeName == "IMG") {
+      var align = focusElm.getAttribute('align');
+      var img = command == "JustifyCenter" ? focusElm.cloneNode(false) : focusElm;
+
+      switch (command) {
+        case "JustifyLeft":
+          if (align == 'left')
+            img.removeAttribute('align');
+          else
+            img.setAttribute('align', 'left');
+
+          // Remove the div
+          var div = focusElm.parentNode;
+          if (div && div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+            div.parentNode.replaceChild(img, div);
+
+          this.selection.selectNode(img);
+          this.repaint();
+          tinyMCE.triggerNodeChange();
+          return;
+
+        case "JustifyCenter":
+          img.removeAttribute('align');
+
+          // Is centered
+          var div = tinyMCE.getParentElement(focusElm, "div");
+          if (div && div.style.textAlign == "center") {
+            // Remove div
+            if (div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+              div.parentNode.replaceChild(img, div);
+          } else {
+            // Add div
+            var div = this.getDoc().createElement("div");
+            div.style.textAlign = 'center';
+            div.appendChild(img);
+            focusElm.parentNode.replaceChild(div, focusElm);
+          }
+
+          this.selection.selectNode(img);
+          this.repaint();
+          tinyMCE.triggerNodeChange();
+          return;
+
+        case "JustifyRight":
+          if (align == 'right')
+            img.removeAttribute('align');
+          else
+            img.setAttribute('align', 'right');
+
+          // Remove the div
+          var div = focusElm.parentNode;
+          if (div && div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+            div.parentNode.replaceChild(img, div);
+
+          this.selection.selectNode(img);
+          this.repaint();
+          tinyMCE.triggerNodeChange();
+          return;
+      }
+    }
+
+    if (tinyMCE.settings['force_br_newlines']) {
+      var alignValue = "";
+
+      if (doc.selection.type != "Control") {
+        switch (command) {
+            case "JustifyLeft":
+              alignValue = "left";
+              break;
+
+            case "JustifyCenter":
+              alignValue = "center";
+              break;
+
+            case "JustifyFull":
+              alignValue = "justify";
+              break;
+
+            case "JustifyRight":
+              alignValue = "right";
+              break;
+        }
+
+        if (alignValue != "") {
+          var rng = doc.selection.createRange();
+
+          if ((divElm = tinyMCE.getParentElement(rng.parentElement(), "div")) != null)
+            divElm.setAttribute("align", alignValue);
+          else if (rng.pasteHTML && rng.htmlText.length > 0)
+            rng.pasteHTML('<div align="' + alignValue + '">' + rng.htmlText + "</div>");
+
+          tinyMCE.triggerNodeChange();
+          return;
+        }
+      }
+    }
+
+    switch (command) {
+      case "mceRepaint":
+        this.repaint();
+        return true;
+
+      case "InsertUnorderedList":
+      case "InsertOrderedList":
+        var tag = (command == "InsertUnorderedList") ? "ul" : "ol";
+
+        if (tinyMCE.isSafari)
+          this.execCommand("mceInsertContent", false, "<" + tag + "><li>&nbsp;</li><" + tag + ">");
+        else
+          this.getDoc().execCommand(command, user_interface, value);
+
+        tinyMCE.triggerNodeChange();
+        break;
+
+      case "Strikethrough":
+        if (tinyMCE.isSafari)
+          this.execCommand("mceInsertContent", false, "<strike>" + this.selection.getSelectedHTML() + "</strike>");
+        else
+          this.getDoc().execCommand(command, user_interface, value);
+
+        tinyMCE.triggerNodeChange();
+        break;
+
+      case "mceSelectNode":
+        this.selection.selectNode(value);
+        tinyMCE.triggerNodeChange();
+        tinyMCE.selectedNode = value;
+        break;
+
+      case "FormatBlock":
+        if (value == null || value == "") {
+          var elm = tinyMCE.getParentElement(this.getFocusElement(), "p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");
+
+          if (elm)
+            this.execCommand("mceRemoveNode", false, elm);
+        } else {
+          if (tinyMCE.isGecko && new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>', 'gi').test(value))
+            value = value.replace(/[^a-z]/gi, '');
+
+          if (tinyMCE.isMSIE && new RegExp('blockquote|code|samp', 'gi').test(value)) {
+            var b = this.selection.getBookmark();
+            this.getDoc().execCommand("FormatBlock", false, '<p>');
+            tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()), value);
+            this.selection.moveToBookmark(b);
+          } else
+            this.getDoc().execCommand("FormatBlock", false, value);
+        }
+
+        tinyMCE.triggerNodeChange();
+
+        break;
+
+      case "mceRemoveNode":
+        if (!value)
+          value = tinyMCE.getParentElement(this.getFocusElement());
+
+        if (tinyMCE.isMSIE) {
+          value.outerHTML = value.innerHTML;
+        } else {
+          var rng = value.ownerDocument.createRange();
+          rng.setStartBefore(value);
+          rng.setEndAfter(value);
+          rng.deleteContents();
+          rng.insertNode(rng.createContextualFragment(value.innerHTML));
+        }
+
+        tinyMCE.triggerNodeChange();
+
+        break;
+
+      case "mceSelectNodeDepth":
+        var parentNode = this.getFocusElement();
+        for (var i=0; parentNode; i++) {
+          if (parentNode.nodeName.toLowerCase() == "body")
+            break;
+
+          if (parentNode.nodeName.toLowerCase() == "#text") {
+            i--;
+            parentNode = parentNode.parentNode;
+            continue;
+          }
+
+          if (i == value) {
+            this.selection.selectNode(parentNode, false);
+            tinyMCE.triggerNodeChange();
+            tinyMCE.selectedNode = parentNode;
+            return;
+          }
+
+          parentNode = parentNode.parentNode;
+        }
+
+        break;
+
+      case "SetStyleInfo":
+        var rng = this.getRng();
+        var sel = this.getSel();
+        var scmd = value['command'];
+        var sname = value['name'];
+        var svalue = value['value'] == null ? '' : value['value'];
+        //var svalue = value['value'] == null ? '' : value['value'];
+        var wrapper = value['wrapper'] ? value['wrapper'] : "span";
+        var parentElm = null;
+        var invalidRe = new RegExp("^BODY|HTML$", "g");
+        var invalidParentsRe = tinyMCE.settings['merge_styles_invalid_parents'] != '' ? new RegExp(tinyMCE.settings['merge_styles_invalid_parents'], "gi") : null;
+
+        // Whole element selected check
+        if (tinyMCE.isMSIE) {
+          // Control range
+          if (rng.item)
+            parentElm = rng.item(0);
+          else {
+            var pelm = rng.parentElement();
+            var prng = doc.selection.createRange();
+            prng.moveToElementText(pelm);
+
+            if (rng.htmlText == prng.htmlText || rng.boundingWidth == 0) {
+              if (invalidParentsRe == null || !invalidParentsRe.test(pelm.nodeName))
+                parentElm = pelm;
+            }
+          }
+        } else {
+          var felm = this.getFocusElement();
+          if (sel.isCollapsed || (new RegExp('td|tr|tbody|table', 'gi').test(felm.nodeName) && sel.anchorNode == felm.parentNode))
+            parentElm = felm;
+        }
+
+        // Whole element selected
+        if (parentElm && !invalidRe.test(parentElm.nodeName)) {
+          if (scmd == "setstyle")
+            tinyMCE.setStyleAttrib(parentElm, sname, svalue);
+
+          if (scmd == "setattrib")
+            tinyMCE.setAttrib(parentElm, sname, svalue);
+
+          if (scmd == "removeformat") {
+            parentElm.style.cssText = '';
+            tinyMCE.setAttrib(parentElm, 'class', '');
+          }
+
+          // Remove style/attribs from all children
+          var ch = tinyMCE.getNodeTree(parentElm, new Array(), 1);
+          for (var z=0; z<ch.length; z++) {
+            if (ch[z] == parentElm)
+              continue;
+
+            if (scmd == "setstyle")
+              tinyMCE.setStyleAttrib(ch[z], sname, '');
+
+            if (scmd == "setattrib")
+              tinyMCE.setAttrib(ch[z], sname, '');
+
+            if (scmd == "removeformat") {
+              ch[z].style.cssText = '';
+              tinyMCE.setAttrib(ch[z], 'class', '');
+            }
+          }
+        } else {
+          this._setUseCSS(false); // Bug in FF when running in fullscreen
+          doc.execCommand("FontName", false, "#mce_temp_font#");
+          var elementArray = tinyMCE.getElementsByAttributeValue(this.getBody(), "font", "face", "#mce_temp_font#");
+
+          // Change them all
+          for (var x=0; x<elementArray.length; x++) {
+            elm = elementArray[x];
+            if (elm) {
+              var spanElm = doc.createElement(wrapper);
+
+              if (scmd == "setstyle")
+                tinyMCE.setStyleAttrib(spanElm, sname, svalue);
+
+              if (scmd == "setattrib")
+                tinyMCE.setAttrib(spanElm, sname, svalue);
+
+              if (scmd == "removeformat") {
+                spanElm.style.cssText = '';
+                tinyMCE.setAttrib(spanElm, 'class', '');
+              }
+
+              if (elm.hasChildNodes()) {
+                for (var i=0; i<elm.childNodes.length; i++)
+                  spanElm.appendChild(elm.childNodes[i].cloneNode(true));
+              }
+
+              spanElm.setAttribute("mce_new", "true");
+              elm.parentNode.replaceChild(spanElm, elm);
+
+              // Remove style/attribs from all children
+              var ch = tinyMCE.getNodeTree(spanElm, new Array(), 1);
+              for (var z=0; z<ch.length; z++) {
+                if (ch[z] == spanElm)
+                  continue;
+
+                if (scmd == "setstyle")
+                  tinyMCE.setStyleAttrib(ch[z], sname, '');
+
+                if (scmd == "setattrib")
+                  tinyMCE.setAttrib(ch[z], sname, '');
+
+                if (scmd == "removeformat") {
+                  ch[z].style.cssText = '';
+                  tinyMCE.setAttrib(ch[z], 'class', '');
+                }
+              }
+            }
+          }
+        }
+
+        // Cleaup wrappers
+        var nodes = doc.getElementsByTagName(wrapper);
+        for (var i=nodes.length-1; i>=0; i--) {
+          var elm = nodes[i];
+          var isNew = tinyMCE.getAttrib(elm, "mce_new") == "true";
+
+          elm.removeAttribute("mce_new");
+
+          // Is only child a element
+          if (elm.childNodes && elm.childNodes.length == 1 && elm.childNodes[0].nodeType == 1) {
+            //tinyMCE.debug("merge1" + isNew);
+            this._mergeElements(scmd, elm, elm.childNodes[0], isNew);
+            continue;
+          }
+
+          // Is I the only child
+          if (elm.parentNode.childNodes.length == 1 && !invalidRe.test(elm.nodeName) && !invalidRe.test(elm.parentNode.nodeName)) {
+            //tinyMCE.debug("merge2" + isNew + "," + elm.nodeName + "," + elm.parentNode.nodeName);
+            if (invalidParentsRe == null || !invalidParentsRe.test(elm.parentNode.nodeName))
+              this._mergeElements(scmd, elm.parentNode, elm, false);
+          }
+        }
+
+        // Remove empty wrappers
+        var nodes = doc.getElementsByTagName(wrapper);
+        for (var i=nodes.length-1; i>=0; i--) {
+          var elm = nodes[i];
+          var isEmpty = true;
+
+          // Check if it has any attribs
+          var tmp = doc.createElement("body");
+          tmp.appendChild(elm.cloneNode(false));
+
+          // Is empty span, remove it
+          tmp.innerHTML = tmp.innerHTML.replace(new RegExp('style=""|class=""', 'gi'), '');
+          //tinyMCE.debug(tmp.innerHTML);
+          if (new RegExp('<span>', 'gi').test(tmp.innerHTML)) {
+            for (var x=0; x<elm.childNodes.length; x++) {
+              if (elm.parentNode != null)
+                elm.parentNode.insertBefore(elm.childNodes[x].cloneNode(true), elm);
+            }
+
+            elm.parentNode.removeChild(elm);
+          }
+        }
+
+        // Re add the visual aids
+        if (scmd == "removeformat")
+          tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+
+        tinyMCE.triggerNodeChange();
+
+        break;
+
+      case "FontName":
+        if (value == null) {
+          var s = this.getSel();
+
+          // Find font and select it
+          if (tinyMCE.isGecko && s.isCollapsed) {
+            var f = tinyMCE.getParentElement(this.getFocusElement(), "font");
+
+            if (f != null)
+              this.selection.selectNode(f, false);
+          }
+
+          // Remove format
+          this.getDoc().execCommand("RemoveFormat", false, null);
+
+          // Collapse range if font was found
+          if (f != null && tinyMCE.isGecko) {
+            var r = this.getRng().cloneRange();
+            r.collapse(true);
+            s.removeAllRanges();
+            s.addRange(r);
+          }
+        } else
+          this.getDoc().execCommand('FontName', false, value);
+
+        if (tinyMCE.isGecko)
+          window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+
+        return;
+
+      case "FontSize":
+        this.getDoc().execCommand('FontSize', false, value);
+
+        if (tinyMCE.isGecko)
+          window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+
+        return;
+
+      case "forecolor":
+        this.getDoc().execCommand('forecolor', false, value);
+        break;
+
+      case "HiliteColor":
+        if (tinyMCE.isGecko) {
+          this._setUseCSS(true);
+          this.getDoc().execCommand('hilitecolor', false, value);
+          this._setUseCSS(false);
+        } else
+          this.getDoc().execCommand('BackColor', false, value);
+        break;
+
+      case "Cut":
+      case "Copy":
+      case "Paste":
+        var cmdFailed = false;
+
+        // Try executing command
+        eval('try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}');
+
+        if (tinyMCE.isOpera && cmdFailed)
+          alert('Currently not supported by your browser, use keyboard shortcuts instead.');
+
+        // Alert error in gecko if command failed
+        if (tinyMCE.isGecko && cmdFailed) {
+          // Confirm more info
+          if (confirm(tinyMCE.entityDecode(tinyMCE.getLang('lang_clipboard_msg'))))
+            window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', 'mceExternal');
+
+          return;
+        } else
+          tinyMCE.triggerNodeChange();
+      break;
+
+      case "mceSetContent":
+        if (!value)
+          value = "";
+
+        // Call custom cleanup code
+        value = tinyMCE.storeAwayURLs(value);
+        value = tinyMCE._customCleanup(this, "insert_to_editor", value);
+        tinyMCE._setHTML(doc, value);
+        tinyMCE.setInnerHTML(doc.body, tinyMCE._cleanupHTML(this, doc, tinyMCE.settings, doc.body));
+        tinyMCE.convertAllRelativeURLs(doc.body);
+
+        // Cleanup any mess left from storyAwayURLs
+        tinyMCE._removeInternal(this.getBody());
+
+        // When editing always use fonts internaly
+        if (tinyMCE.getParam("convert_fonts_to_spans"))
+          tinyMCE.convertSpansToFonts(doc);
+
+        tinyMCE.handleVisualAid(doc.body, true, this.visualAid, this);
+        tinyMCE._setEventsEnabled(doc.body, false);
+        return true;
+
+      case "mceCleanup":
+        var b = this.selection.getBookmark();
+        tinyMCE._setHTML(this.contentDocument, this.getBody().innerHTML);
+        tinyMCE.setInnerHTML(this.getBody(), tinyMCE._cleanupHTML(this, this.contentDocument, this.settings, this.getBody(), this.visualAid));
+        tinyMCE.convertAllRelativeURLs(doc.body);
+
+        // When editing always use fonts internaly
+        if (tinyMCE.getParam("convert_fonts_to_spans"))
+          tinyMCE.convertSpansToFonts(doc);
+
+        tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+        tinyMCE._setEventsEnabled(this.getBody(), false);
+        this.repaint();
+        this.selection.moveToBookmark(b);
+        tinyMCE.triggerNodeChange();
+      break;
+
+      case "mceReplaceContent":
+        // Force empty string
+        if (!value)
+          value = '';
+
+        this.getWin().focus();
+
+        var selectedText = "";
+
+        if (tinyMCE.isMSIE) {
+          var rng = doc.selection.createRange();
+          selectedText = rng.text;
+        } else
+          selectedText = this.getSel().toString();
+
+        if (selectedText.length > 0) {
+          value = tinyMCE.replaceVar(value, "selection", selectedText);
+          tinyMCE.execCommand('mceInsertContent', false, value);
+        }
+
+        tinyMCE.triggerNodeChange();
+      break;
+
+      case "mceSetAttribute":
+        if (typeof(value) == 'object') {
+          var targetElms = (typeof(value['targets']) == "undefined") ? "p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address" : value['targets'];
+          var targetNode = tinyMCE.getParentElement(this.getFocusElement(), targetElms);
+
+          if (targetNode) {
+            targetNode.setAttribute(value['name'], value['value']);
+            tinyMCE.triggerNodeChange();
+          }
+        }
+      break;
+
+      case "mceSetCSSClass":
+        this.execCommand("SetStyleInfo", false, {command : "setattrib", name : "class", value : value});
+      break;
+
+      case "mceInsertRawHTML":
+        var key = 'tiny_mce_marker';
+
+        this.execCommand('mceBeginUndoLevel');
+
+        // Insert marker key
+        this.execCommand('mceInsertContent', false, key);
+
+        // Store away scroll pos
+        var scrollX = this.getDoc().body.scrollLeft + this.getDoc().documentElement.scrollLeft;
+        var scrollY = this.getDoc().body.scrollTop + this.getDoc().documentElement.scrollTop;
+
+        // Find marker and replace with RAW HTML
+        var html = this.getBody().innerHTML;
+        if ((pos = html.indexOf(key)) != -1)
+          tinyMCE.setInnerHTML(this.getBody(), html.substring(0, pos) + value + html.substring(pos + key.length));
+
+        // Restore scoll pos
+        this.contentWindow.scrollTo(scrollX, scrollY);
+
+        this.execCommand('mceEndUndoLevel');
+
+        break;
+
+      case "mceInsertContent":
+        // Force empty string
+        if (!value)
+          value = '';
+
+        var insertHTMLFailed = false;
+        this.getWin().focus();
+
+        if (tinyMCE.isGecko || tinyMCE.isOpera) {
+          try {
+            // Is plain text or HTML, &amp;, &nbsp; etc will be encoded wrong in FF
+            if (value.indexOf('<') == -1 && !value.match(/(&#38;|&#160;|&#60;|&#62;)/g)) {
+              var r = this.getRng();
+              var n = this.getDoc().createTextNode(tinyMCE.entityDecode(value));
+              var s = this.getSel();
+              var r2 = r.cloneRange();
+
+              // Insert text at cursor position
+              s.removeAllRanges();
+              r.deleteContents();
+              r.insertNode(n);
+
+              // Move the cursor to the end of text
+              r2.selectNode(n);
+              r2.collapse(false);
+              s.removeAllRanges();
+              s.addRange(r2);
+            } else {
+              value = tinyMCE.fixGeckoBaseHREFBug(1, this.getDoc(), value);
+              this.getDoc().execCommand('inserthtml', false, value);
+              tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value);
+            }
+          } catch (ex) {
+            insertHTMLFailed = true;
+          }
+
+          if (!insertHTMLFailed) {
+            tinyMCE.triggerNodeChange();
+            return;
+          }
+        }
+
+        // Ugly hack in Opera due to non working "inserthtml"
+        if (tinyMCE.isOpera && insertHTMLFailed) {
+          this.getDoc().execCommand("insertimage", false, tinyMCE.uniqueURL);
+          var ar = tinyMCE.getElementsByAttributeValue(this.getBody(), "img", "src", tinyMCE.uniqueURL);
+          ar[0].outerHTML = value;
+          return;
+        }
+
+        if (!tinyMCE.isMSIE) {
+          var isHTML = value.indexOf('<') != -1;
+          var sel = this.getSel();
+          var rng = this.getRng();
+
+          if (isHTML) {
+            if (tinyMCE.isSafari) {
+              var tmpRng = this.getDoc().createRange();
+
+              tmpRng.setStart(this.getBody(), 0);
+              tmpRng.setEnd(this.getBody(), 0);
+
+              value = tmpRng.createContextualFragment(value);
+            } else
+              value = rng.createContextualFragment(value);
+          } else {
+            // Setup text node
+            var el = document.createElement("div");
+            el.innerHTML = value;
+            value = el.firstChild.nodeValue;
+            value = doc.createTextNode(value);
+          }
+
+          // Insert plain text in Safari
+          if (tinyMCE.isSafari && !isHTML) {
+            this.execCommand('InsertText', false, value.nodeValue);
+            tinyMCE.triggerNodeChange();
+            return true;
+          } else if (tinyMCE.isSafari && isHTML) {
+            rng.deleteContents();
+            rng.insertNode(value);
+            tinyMCE.triggerNodeChange();
+            return true;
+          }
+
+          rng.deleteContents();
+
+          // If target node is text do special treatment, (Mozilla 1.3 fix)
+          if (rng.startContainer.nodeType == 3) {
+            var node = rng.startContainer.splitText(rng.startOffset);
+            node.parentNode.insertBefore(value, node); 
+          } else
+            rng.insertNode(value);
+
+          if (!isHTML) {
+            // Removes weird selection trails
+            sel.selectAllChildren(doc.body);
+            sel.removeAllRanges();
+
+            // Move cursor to end of content
+            var rng = doc.createRange();
+
+            rng.selectNode(value);
+            rng.collapse(false);
+
+            sel.addRange(rng);
+          } else
+            rng.collapse(false);
+
+          tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value);
+        } else {
+          var rng = doc.selection.createRange();
+          var c = value.indexOf('<!--') != -1;
+
+          // Fix comment bug, add tag before comments
+          if (c)
+            value = tinyMCE.uniqueTag + value;
+
+          if (rng.item)
+            rng.item(0).outerHTML = value;
+          else
+            rng.pasteHTML(value);
+
+          // Remove unique tag
+          if (c) {
+            var e = this.getDoc().getElementById('mceTMPElement');
+            e.parentNode.removeChild(e);
+          }
+        }
+
+        tinyMCE.triggerNodeChange();
+      break;
+
+      case "mceStartTyping":
+        if (tinyMCE.settings['custom_undo_redo'] && this.undoRedo.typingUndoIndex == -1) {
+          this.undoRedo.typingUndoIndex = this.undoRedo.undoIndex;
+          this.execCommand('mceAddUndoLevel');
+          //tinyMCE.debug("mceStartTyping");
+        }
+        break;
+
+      case "mceEndTyping":
+        if (tinyMCE.settings['custom_undo_redo'] && this.undoRedo.typingUndoIndex != -1) {
+          this.execCommand('mceAddUndoLevel');
+          this.undoRedo.typingUndoIndex = -1;
+          //tinyMCE.debug("mceEndTyping");
+        }
+        break;
+
+      case "mceBeginUndoLevel":
+        this.undoRedoLevel = false;
+        break;
+
+      case "mceEndUndoLevel":
+        this.undoRedoLevel = true;
+        this.execCommand('mceAddUndoLevel');
+        break;
+
+      case "mceAddUndoLevel":
+        if (tinyMCE.settings['custom_undo_redo'] && this.undoRedoLevel) {
+          if (this.undoRedo.add())
+            tinyMCE.triggerNodeChange(false);
+        }
+        break;
+
+      case "Undo":
+        if (tinyMCE.settings['custom_undo_redo']) {
+          tinyMCE.execCommand("mceEndTyping");
+          this.undoRedo.undo();
+          tinyMCE.triggerNodeChange();
+        } else
+          this.getDoc().execCommand(command, user_interface, value);
+        break;
+
+      case "Redo":
+        if (tinyMCE.settings['custom_undo_redo']) {
+          tinyMCE.execCommand("mceEndTyping");
+          this.undoRedo.redo();
+          tinyMCE.triggerNodeChange();
+        } else
+          this.getDoc().execCommand(command, user_interface, value);
+        break;
+
+      case "mceToggleVisualAid":
+        this.visualAid = !this.visualAid;
+        tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+        tinyMCE.triggerNodeChange();
+        break;
+
+      case "Indent":
+        this.getDoc().execCommand(command, user_interface, value);
+        tinyMCE.triggerNodeChange();
+        if (tinyMCE.isMSIE) {
+          var n = tinyMCE.getParentElement(this.getFocusElement(), "blockquote");
+          do {
+            if (n && n.nodeName == "BLOCKQUOTE") {
+              n.removeAttribute("dir");
+              n.removeAttribute("style");
+            }
+          } while (n != null && (n = n.parentNode) != null);
+        }
+        break;
+
+      case "removeformat":
+        var text = this.selection.getSelectedText();
+
+        if (tinyMCE.isOpera) {
+          this.getDoc().execCommand("RemoveFormat", false, null);
+          return;
+        }
+
+        if (tinyMCE.isMSIE) {
+          try {
+            var rng = doc.selection.createRange();
+            rng.execCommand("RemoveFormat", false, null);
+          } catch (e) {
+            // Do nothing
+          }
+
+          this.execCommand("SetStyleInfo", false, {command : "removeformat"});
+        } else {
+          this.getDoc().execCommand(command, user_interface, value);
+
+          this.execCommand("SetStyleInfo", false, {command : "removeformat"});
+        }
+
+        // Remove class
+        if (text.length == 0)
+          this.execCommand("mceSetCSSClass", false, "");
+
+        tinyMCE.triggerNodeChange();
+        break;
+
+      default:
+        this.getDoc().execCommand(command, user_interface, value);
+
+        if (tinyMCE.isGecko)
+          window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+        else
+          tinyMCE.triggerNodeChange();
+    }
+
+    // Add undo level after modification
+    if (command != "mceAddUndoLevel" && command != "Undo" && command != "Redo" && command != "mceStartTyping" && command != "mceEndTyping")
+      tinyMCE.execCommand("mceAddUndoLevel");
+  },
+
+  queryCommandValue : function(c) {
+    try {
+      return this.getDoc().queryCommandValue(c);
+    } catch (e) {
+      return null;
+    }
+  },
+
+  queryCommandState : function(c) {
+    return this.getDoc().queryCommandState(c);
+  },
+
+  _onAdd : function(replace_element, form_element_name, target_document) {
+    var hc, th, to, editorTemplate;
+
+    th = this.settings['theme'];
+    to = tinyMCE.themes[th];
+
+    var targetDoc = target_document ? target_document : document;
+
+    this.targetDoc = targetDoc;
+
+    tinyMCE.themeURL = tinyMCE.baseURL + "/themes/" + this.settings['theme'];
+    this.settings['themeurl'] = tinyMCE.themeURL;
+
+    if (!replace_element) {
+      alert("Error: Could not find the target element.");
+      return false;
+    }
+
+    if (to.getEditorTemplate)
+      editorTemplate = to.getEditorTemplate(this.settings, this.editorId);
+
+    var deltaWidth = editorTemplate['delta_width'] ? editorTemplate['delta_width'] : 0;
+    var deltaHeight = editorTemplate['delta_height'] ? editorTemplate['delta_height'] : 0;
+    var html = '<span id="' + this.editorId + '_parent" class="mceEditorContainer">' + editorTemplate['html'];
+
+    html = tinyMCE.replaceVar(html, "editor_id", this.editorId);
+    this.settings['default_document'] = tinyMCE.baseURL + "/blank.htm";
+
+    this.settings['old_width'] = this.settings['width'];
+    this.settings['old_height'] = this.settings['height'];
+
+    // Set default width, height
+    if (this.settings['width'] == -1)
+      this.settings['width'] = replace_element.offsetWidth;
+
+    if (this.settings['height'] == -1)
+      this.settings['height'] = replace_element.offsetHeight;
+
+    // Try the style width
+    if (this.settings['width'] == 0)
+      this.settings['width'] = replace_element.style.width;
+
+    // Try the style height
+    if (this.settings['height'] == 0)
+      this.settings['height'] = replace_element.style.height; 
+
+    // If no width/height then default to 320x240, better than nothing
+    if (this.settings['width'] == 0)
+      this.settings['width'] = 320;
+
+    if (this.settings['height'] == 0)
+      this.settings['height'] = 240;
+
+    this.settings['area_width'] = parseInt(this.settings['width']);
+    this.settings['area_height'] = parseInt(this.settings['height']);
+    this.settings['area_width'] += deltaWidth;
+    this.settings['area_height'] += deltaHeight;
+
+    // Special % handling
+    if (("" + this.settings['width']).indexOf('%') != -1)
+      this.settings['area_width'] = "100%";
+
+    if (("" + this.settings['height']).indexOf('%') != -1)
+      this.settings['area_height'] = "100%";
+
+    if (("" + replace_element.style.width).indexOf('%') != -1) {
+      this.settings['width'] = replace_element.style.width;
+      this.settings['area_width'] = "100%";
+    }
+
+    if (("" + replace_element.style.height).indexOf('%') != -1) {
+      this.settings['height'] = replace_element.style.height;
+      this.settings['area_height'] = "100%";
+    }
+
+    html = tinyMCE.applyTemplate(html);
+
+    this.settings['width'] = this.settings['old_width'];
+    this.settings['height'] = this.settings['old_height'];
+
+    this.visualAid = this.settings['visual'];
+    this.formTargetElementId = form_element_name;
+
+    // Get replace_element contents
+    if (replace_element.nodeName == "TEXTAREA" || replace_element.nodeName == "INPUT")
+      this.startContent = replace_element.value;
+    else
+      this.startContent = replace_element.innerHTML;
+
+    // If not text area or input
+    if (replace_element.nodeName != "TEXTAREA" && replace_element.nodeName != "INPUT") {
+      this.oldTargetElement = replace_element;
+
+      // Debug mode
+      if (tinyMCE.settings['debug']) {
+        hc = '<textarea wrap="off" id="' + form_element_name + '" name="' + form_element_name + '" cols="100" rows="15"></textarea>';
+      } else {
+        hc = '<input type="hidden" id="' + form_element_name + '" name="' + form_element_name + '" />';
+        this.oldTargetElement.style.display = "none";
+      }
+
+      html += '</span>';
+
+      if (tinyMCE.isGecko)
+        html = hc + html;
+      else
+        html += hc;
+
+      // Output HTML and set editable
+      if (tinyMCE.isGecko) {
+        var rng = replace_element.ownerDocument.createRange();
+        rng.setStartBefore(replace_element);
+
+        var fragment = rng.createContextualFragment(html);
+        tinyMCE.insertAfter(fragment, replace_element);
+      } else
+        replace_element.insertAdjacentHTML("beforeBegin", html);
+    } else {
+      html += '</span>';
+
+      // Just hide the textarea element
+      this.oldTargetElement = replace_element;
+
+      if (!tinyMCE.settings['debug'])
+        this.oldTargetElement.style.display = "none";
+
+      // Output HTML and set editable
+      if (tinyMCE.isGecko) {
+        var rng = replace_element.ownerDocument.createRange();
+        rng.setStartBefore(replace_element);
+
+        var fragment = rng.createContextualFragment(html);
+        tinyMCE.insertAfter(fragment, replace_element);
+      } else
+        replace_element.insertAdjacentHTML("beforeBegin", html);
+    }
+
+    // Setup iframe
+    var dynamicIFrame = false;
+    var tElm = targetDoc.getElementById(this.editorId);
+
+    if (!tinyMCE.isMSIE) {
+      // Node case is preserved in XML strict mode
+      if (tElm && (tElm.nodeName == "SPAN" || tElm.nodeName == "span")) {
+        tElm = tinyMCE._createIFrame(tElm, targetDoc);
+        dynamicIFrame = true;
+      }
+
+      this.targetElement = tElm;
+      this.iframeElement = tElm;
+      this.contentDocument = tElm.contentDocument;
+      this.contentWindow = tElm.contentWindow;
+
+      //this.getDoc().designMode = "on";
+    } else {
+      if (tElm && tElm.nodeName == "SPAN")
+        tElm = tinyMCE._createIFrame(tElm, targetDoc, targetDoc.parentWindow);
+      else
+        tElm = targetDoc.frames[this.editorId];
+
+      this.targetElement = tElm;
+      this.iframeElement = targetDoc.getElementById(this.editorId);
+
+      if (tinyMCE.isOpera) {
+        this.contentDocument = this.iframeElement.contentDocument;
+        this.contentWindow = this.iframeElement.contentWindow;
+        dynamicIFrame = true;
+      } else {
+        this.contentDocument = tElm.window.document;
+        this.contentWindow = tElm.window;
+      }
+
+      this.getDoc().designMode = "on";
+    }
+
+    // Setup base HTML
+    var doc = this.contentDocument;
+    if (dynamicIFrame) {
+      var html = tinyMCE.getParam('doctype') + '<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="' + tinyMCE.settings['base_href'] + '" /><title>blank_page</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body class="mceContentBody"></body></html>';
+
+      try {
+        if (!this.isHidden())
+          this.getDoc().designMode = "on";
+
+        doc.open();
+        doc.write(html);
+        doc.close();
+      } catch (e) {
+        // Failed Mozilla 1.3
+        this.getDoc().location.href = tinyMCE.baseURL + "/blank.htm";
+      }
+    }
+
+    // This timeout is needed in MSIE 5.5 for some odd reason
+    // it seems that the document.frames isn't initialized yet?
+    if (tinyMCE.isMSIE)
+      window.setTimeout("tinyMCE.addEventHandlers(tinyMCE.instances[\"" + this.editorId + "\"]);", 1);
+
+    tinyMCE.setupContent(this.editorId, true);
+
+    return true;
+  },
+
+  setBaseHREF : function(u) {
+    var h, b, d, nl;
+
+    d = this.getDoc();
+    nl = d.getElementsByTagName("base");
+    b = nl.length > 0 ? nl[0] : null;
+
+    if (!b) {
+      nl = d.getElementsByTagName("head");
+      h = nl.length > 0 ? nl[0] : null;
+
+      b = d.createElement("base");
+      b.setAttribute('href', u);
+      h.appendChild(b);
+    } else {
+      if (u == "" || u == null)
+        b.parentNode.removeChild(b);
+      else
+        b.setAttribute('href', u);
+    }
+  },
+
+  getFocusElement : function() {
+    return this.selection.getFocusElement();
+  },
+
+  getSel : function() {
+    return this.selection.getSel();
+  },
+
+  getRng : function() {
+    return this.selection.getRng();
+  },
+
+  triggerSave : function(skip_cleanup, skip_callback) {
+    var e, nl = new Array(), i, s;
+
+    this.switchSettings();
+    s = tinyMCE.settings;
+
+    // Force hidden tabs visible while serializing
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+      e = this.iframeElement;
+
+      do {
+        if (e.style && e.style.display == 'none') {
+          e.style.display = 'block';
+          nl[nl.length] = {elm : e, type : 'style'};
+        }
+
+        if (e.style && s.hidden_tab_class.length > 0 && e.className.indexOf(s.hidden_tab_class) != -1) {
+          e.className = s.display_tab_class;
+          nl[nl.length] = {elm : e, type : 'class'};
+        }
+      } while ((e = e.parentNode) != null)
+    }
+
+    tinyMCE.settings['preformatted'] = false;
+
+    // Default to false
+    if (typeof(skip_cleanup) == "undefined")
+      skip_cleanup = false;
+
+    // Default to false
+    if (typeof(skip_callback) == "undefined")
+      skip_callback = false;
+
+    tinyMCE._setHTML(this.getDoc(), this.getBody().innerHTML);
+
+    // Remove visual aids when cleanup is disabled
+    if (this.settings['cleanup'] == false) {
+      tinyMCE.handleVisualAid(this.getBody(), true, false, this);
+      tinyMCE._setEventsEnabled(this.getBody(), true);
+    }
+
+    tinyMCE._customCleanup(this, "submit_content_dom", this.contentWindow.document.body);
+    var htm = skip_cleanup ? this.getBody().innerHTML : tinyMCE._cleanupHTML(this, this.getDoc(), this.settings, this.getBody(), tinyMCE.visualAid, true, true);
+    htm = tinyMCE._customCleanup(this, "submit_content", htm);
+
+    if (!skip_callback && tinyMCE.settings['save_callback'] != "")
+      var content = eval(tinyMCE.settings['save_callback'] + "(this.formTargetElementId,htm,this.getBody());");
+
+    // Use callback content if available
+    if ((typeof(content) != "undefined") && content != null)
+      htm = content;
+
+    // Replace some weird entities (Bug: #1056343)
+    htm = tinyMCE.regexpReplace(htm, "&#40;", "(", "gi");
+    htm = tinyMCE.regexpReplace(htm, "&#41;", ")", "gi");
+    htm = tinyMCE.regexpReplace(htm, "&#59;", ";", "gi");
+    htm = tinyMCE.regexpReplace(htm, "&#34;", "&quot;", "gi");
+    htm = tinyMCE.regexpReplace(htm, "&#94;", "^", "gi");
+
+    if (this.formElement)
+      this.formElement.value = htm;
+
+    if (tinyMCE.isSafari && this.formElement)
+      this.formElement.innerText = htm;
+
+    // Hide them again (tabs in MSIE)
+    for (i=0; i<nl.length; i++) {
+      if (nl[i].type == 'style')
+        nl[i].elm.style.display = 'none';
+      else
+        nl[i].elm.className = s.hidden_tab_class;
+    }
+  }
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Cleanup.class.js */
+
+TinyMCE_Engine.prototype.cleanupHTMLCode = function(s) {
+  s = s.replace(new RegExp('<p \\/>', 'gi'), '<p>&nbsp;</p>');
+  s = s.replace(new RegExp('<p>\\s*<\\/p>', 'gi'), '<p>&nbsp;</p>');
+
+  // Fix close BR elements
+  s = s.replace(new RegExp('<br>\\s*<\\/br>', 'gi'), '<br />');
+
+  // Open closed tags like <b/> to <b></b>
+  s = s.replace(new RegExp('<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\\\|>]*)\\/>', 'gi'), '<$1$2$3></$1$2>');
+
+  // Remove trailing space <b > to <b>
+  s = s.replace(new RegExp('\\s+></', 'gi'), '></');
+
+  // Close tags <img></img> to <img/>
+  s = s.replace(new RegExp('<(img|br|hr)([^>]*)><\\/(img|br|hr)>', 'gi'), '<$1$2 />');
+
+  // Weird MSIE bug, <p><hr /></p> breaks runtime?
+  if (tinyMCE.isMSIE)
+    s = s.replace(new RegExp('<p><hr \\/><\\/p>', 'gi'), "<hr>");
+
+  // Convert relative anchors to absolute URLs ex: #something to file.htm#something
+  if (tinyMCE.getParam('convert_urls'))
+    s = s.replace(new RegExp('(href=\"{0,1})(\\s*#)', 'gi'), '$1' + tinyMCE.settings['document_base_url'] + "#");
+
+  return s;
+};
+
+TinyMCE_Engine.prototype.parseStyle = function(str) {
+  var ar = new Array();
+
+  if (str == null)
+    return ar;
+
+  var st = str.split(';');
+
+  tinyMCE.clearArray(ar);
+
+  for (var i=0; i<st.length; i++) {
+    if (st[i] == '')
+      continue;
+
+    var re = new RegExp('^\\s*([^:]*):\\s*(.*)\\s*$');
+    var pa = st[i].replace(re, '$1||$2').split('||');
+//tinyMCE.debug(str, pa[0] + "=" + pa[1], st[i].replace(re, '$1||$2'));
+    if (pa.length == 2)
+      ar[pa[0].toLowerCase()] = pa[1];
+  }
+
+  return ar;
+};
+
+TinyMCE_Engine.prototype.compressStyle = function(ar, pr, sf, res) {
+  var box = new Array();
+
+  box[0] = ar[pr + '-top' + sf];
+  box[1] = ar[pr + '-left' + sf];
+  box[2] = ar[pr + '-right' + sf];
+  box[3] = ar[pr + '-bottom' + sf];
+
+  for (var i=0; i<box.length; i++) {
+    if (box[i] == null)
+      return;
+
+    for (var a=0; a<box.length; a++) {
+      if (box[a] != box[i])
+        return;
+    }
+  }
+
+  // They are all the same
+  ar[res] = box[0];
+  ar[pr + '-top' + sf] = null;
+  ar[pr + '-left' + sf] = null;
+  ar[pr + '-right' + sf] = null;
+  ar[pr + '-bottom' + sf] = null;
+};
+
+TinyMCE_Engine.prototype.serializeStyle = function(ar) {
+  var str = "";
+
+  // Compress box
+  tinyMCE.compressStyle(ar, "border", "", "border");
+  tinyMCE.compressStyle(ar, "border", "-width", "border-width");
+  tinyMCE.compressStyle(ar, "border", "-color", "border-color");
+  tinyMCE.compressStyle(ar, "border", "-style", "border-style");
+  tinyMCE.compressStyle(ar, "padding", "", "padding");
+  tinyMCE.compressStyle(ar, "margin", "", "margin");
+
+  for (var key in ar) {
+    var val = ar[key];
+
+    if (typeof(val) == 'function')
+      continue;
+
+    if (key.indexOf('mso-') == 0)
+      continue;
+
+    if (val != null && val != '') {
+      val = '' + val; // Force string
+
+      // Fix style URL
+      val = val.replace(new RegExp("url\\(\\'?([^\\']*)\\'?\\)", 'gi'), "url('$1')");
+
+      // Convert URL
+      if (val.indexOf('url(') != -1 && tinyMCE.getParam('convert_urls')) {
+        var m = new RegExp("url\\('(.*?)'\\)").exec(val);
+
+        if (m.length > 1)
+          val = "url('" + eval(tinyMCE.getParam('urlconverter_callback') + "(m[1], null, true);") + "')";
+      }
+
+      // Force HEX colors
+      if (tinyMCE.getParam("force_hex_style_colors"))
+        val = tinyMCE.convertRGBToHex(val, true);
+
+      if (val != "url('')")
+        str += key.toLowerCase() + ": " + val + "; ";
+    }
+  }
+
+  if (new RegExp('; $').test(str))
+    str = str.substring(0, str.length - 2);
+
+  return str;
+};
+
+TinyMCE_Engine.prototype.convertRGBToHex = function(s, k) {
+  if (s.toLowerCase().indexOf('rgb') != -1) {
+    var re = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");
+    var rgb = s.replace(re, "$1,$2,$3,$4,$5").split(',');
+    if (rgb.length == 5) {
+      r = parseInt(rgb[1]).toString(16);
+      g = parseInt(rgb[2]).toString(16);
+      b = parseInt(rgb[3]).toString(16);
+
+      r = r.length == 1 ? '0' + r : r;
+      g = g.length == 1 ? '0' + g : g;
+      b = b.length == 1 ? '0' + b : b;
+
+      s = "#" + r + g + b;
+
+      if (k)
+        s = rgb[0] + s + rgb[4];
+    }
+  }
+
+  return s;
+};
+
+TinyMCE_Engine.prototype.convertHexToRGB = function(s) {
+  if (s.indexOf('#') != -1) {
+    s = s.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+    return "rgb(" + parseInt(s.substring(0, 2), 16) + "," + parseInt(s.substring(2, 4), 16) + "," + parseInt(s.substring(4, 6), 16) + ")";
+  }
+
+  return s;
+};
+
+TinyMCE_Engine.prototype.convertSpansToFonts = function(doc) {
+  var sizes = tinyMCE.getParam('font_size_style_values').replace(/\s+/, '').split(',');
+
+  var h = doc.body.innerHTML;
+  h = h.replace(/<span/gi, '<font');
+  h = h.replace(/<\/span/gi, '</font');
+  doc.body.innerHTML = h;
+
+  var s = doc.getElementsByTagName("font");
+  for (var i=0; i<s.length; i++) {
+    var size = tinyMCE.trim(s[i].style.fontSize).toLowerCase();
+    var fSize = 0;
+
+    for (var x=0; x<sizes.length; x++) {
+      if (sizes[x] == size) {
+        fSize = x + 1;
+        break;
+      }
+    }
+
+    if (fSize > 0) {
+      tinyMCE.setAttrib(s[i], 'size', fSize);
+      s[i].style.fontSize = '';
+    }
+
+    var fFace = s[i].style.fontFamily;
+    if (fFace != null && fFace != "") {
+      tinyMCE.setAttrib(s[i], 'face', fFace);
+      s[i].style.fontFamily = '';
+    }
+
+    var fColor = s[i].style.color;
+    if (fColor != null && fColor != "") {
+      tinyMCE.setAttrib(s[i], 'color', tinyMCE.convertRGBToHex(fColor));
+      s[i].style.color = '';
+    }
+  }
+};
+
+TinyMCE_Engine.prototype.convertFontsToSpans = function(doc) {
+  var sizes = tinyMCE.getParam('font_size_style_values').replace(/\s+/, '').split(',');
+
+  var h = doc.body.innerHTML;
+  h = h.replace(/<font/gi, '<span');
+  h = h.replace(/<\/font/gi, '</span');
+  doc.body.innerHTML = h;
+
+  var fsClasses = tinyMCE.getParam('font_size_classes');
+  if (fsClasses != '')
+    fsClasses = fsClasses.replace(/\s+/, '').split(',');
+  else
+    fsClasses = null;
+
+  var s = doc.getElementsByTagName("span");
+  for (var i=0; i<s.length; i++) {
+    var fSize, fFace, fColor;
+
+    fSize = tinyMCE.getAttrib(s[i], 'size');
+    fFace = tinyMCE.getAttrib(s[i], 'face');
+    fColor = tinyMCE.getAttrib(s[i], 'color');
+
+    if (fSize != "") {
+      fSize = parseInt(fSize);
+
+      if (fSize > 0 && fSize < 8) {
+        if (fsClasses != null)
+          tinyMCE.setAttrib(s[i], 'class', fsClasses[fSize-1]);
+        else
+          s[i].style.fontSize = sizes[fSize-1];
+      }
+
+      s[i].removeAttribute('size');
+    }
+
+    if (fFace != "") {
+      s[i].style.fontFamily = fFace;
+      s[i].removeAttribute('face');
+    }
+
+    if (fColor != "") {
+      s[i].style.color = fColor;
+      s[i].removeAttribute('color');
+    }
+  }
+};
+
+TinyMCE_Engine.prototype.cleanupAnchors = function(doc) {
+  var i, cn, x, an = doc.getElementsByTagName("a");
+
+  // Loops backwards due to bug #1467987
+  for (i=an.length-1; i>=0; i--) {
+    if (tinyMCE.getAttrib(an[i], "name") != "" && tinyMCE.getAttrib(an[i], "href") == "") {
+      cn = an[i].childNodes;
+
+      for (x=cn.length-1; x>=0; x--)
+        tinyMCE.insertAfter(cn[x], an[i]);
+    }
+  }
+};
+
+TinyMCE_Engine.prototype.getContent = function(editor_id) {
+  var h;
+
+  if (typeof(editor_id) != "undefined")
+    tinyMCE.selectedInstance = tinyMCE.getInstanceById(editor_id);
+
+  if (tinyMCE.selectedInstance) {
+    h = tinyMCE._cleanupHTML(this.selectedInstance, this.selectedInstance.getDoc(), tinyMCE.settings, this.selectedInstance.getBody(), false, true);
+
+    // When editing always use fonts internaly
+    if (tinyMCE.getParam("convert_fonts_to_spans"))
+      tinyMCE.convertSpansToFonts(this.selectedInstance.getDoc());
+
+    return h;
+  }
+
+  return null;
+};
+
+TinyMCE_Engine.prototype._fixListElements = function(d) {
+  var nl, x, a = ['ol', 'ul'], i, n, p, r = new RegExp('^(OL|UL)$'), np;
+
+  for (x=0; x<a.length; x++) {
+    nl = d.getElementsByTagName(a[x]);
+
+    for (i=0; i<nl.length; i++) {
+      n = nl[i];
+      p = n.parentNode;
+
+      if (r.test(p.nodeName)) {
+        np = tinyMCE.prevNode(n, 'LI');
+
+        if (!np) {
+          np = d.createElement('li');
+          np.innerHTML = '&nbsp;';
+          np.appendChild(n);
+          p.insertBefore(np, p.firstChild);
+        } else
+          np.appendChild(n);
+      }
+    }
+  }
+};
+
+TinyMCE_Engine.prototype._fixTables = function(d) {
+  var nl, i, n, p, np, x, t;
+
+  nl = d.getElementsByTagName('table');
+  for (i=0; i<nl.length; i++) {
+    n = nl[i];
+
+    if ((p = tinyMCE.getParentElement(n, 'p,div,h1,h2,h3,h4,h5,h6')) != null) {
+      np = p.cloneNode(false);
+      np.removeAttribute('id');
+
+      t = n;
+
+      while ((n = n.nextSibling))
+        np.appendChild(n);
+
+      tinyMCE.insertAfter(np, p);
+      tinyMCE.insertAfter(t, p);
+    }
+  }
+};
+
+TinyMCE_Engine.prototype._cleanupHTML = function(inst, doc, config, elm, visual, on_save, on_submit) {
+  var h, d, t1, t2, t3, t4, t5, c, s;
+
+  if (!tinyMCE.getParam('cleanup'))
+    return elm.innerHTML;
+
+  on_save = typeof(on_save) == 'undefined' ? false : on_save;
+
+  c = inst.cleanup;
+  s = inst.settings;
+  d = c.settings.debug;
+
+  if (d)
+    t1 = new Date().getTime();
+
+  if (tinyMCE.getParam("convert_fonts_to_spans"))
+    tinyMCE.convertFontsToSpans(doc);
+
+  if (tinyMCE.getParam("fix_list_elements"))
+    tinyMCE._fixListElements(doc);
+
+  if (tinyMCE.getParam("fix_table_elements"))
+    tinyMCE._fixTables(doc);
+
+  // Call custom cleanup code
+  tinyMCE._customCleanup(inst, on_save ? "get_from_editor_dom" : "insert_to_editor_dom", doc.body);
+
+  if (d)
+    t2 = new Date().getTime();
+
+  c.settings.on_save = on_save;
+  //for (var i=0; i<100; i++)
+
+  c.idCount = 0;
+  c.serializationId++;
+  c.serializedNodes = new Array();
+  c.sourceIndex = -1;
+
+  if (s.cleanup_serializer == "xml")
+    h = c.serializeNodeAsXML(elm);
+  else
+    h = c.serializeNodeAsHTML(elm);
+
+  if (d)
+    t3 = new Date().getTime();
+
+  // Post processing
+  h = h.replace(/<\/?(body|head|html)[^>]*>/gi, '');
+  h = h.replace(new RegExp(' (rowspan="1"|colspan="1")', 'g'), '');
+  h = h.replace(/<p><hr \/><\/p>/g, '<hr />');
+  h = h.replace(/<p>(&nbsp;|&#160;)<\/p><hr \/><p>(&nbsp;|&#160;)<\/p>/g, '<hr />');
+  h = h.replace(/<td>\s*<br \/>\s*<\/td>/g, '<td>&nbsp;</td>');
+  h = h.replace(/<p>\s*<br \/>\s*<\/p>/g, '<p>&nbsp;</p>');
+  h = h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*(&nbsp;|&#160;)\s*<\/p>/g, '<p>&nbsp;</p>');
+  h = h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*<\/p>/g, '<p>&nbsp;</p>');
+  h = h.replace(/<p>\s*<br \/>\s*&nbsp;\s*<\/p>/g, '<p>&nbsp;</p>');
+  h = h.replace(new RegExp('<a>(.*?)<\\/a>', 'g'), '$1');
+  h = h.replace(/<p([^>]*)>\s*<\/p>/g, '<p$1>&nbsp;</p>');
+
+  // Clean body
+  if (/^\s*(<br \/>|<p>&nbsp;<\/p>|<p>&#160;<\/p>|<p><\/p>)\s*$/.test(h))
+    h = '';
+
+  // If preformatted
+  if (s.preformatted) {
+    h = h.replace(/^<pre>/, '');
+    h = h.replace(/<\/pre>$/, '');
+    h = '<pre>' + h + '</pre>';
+  }
+
+  // Gecko specific processing
+  if (tinyMCE.isGecko) {
+    h = h.replace(/<o:p _moz-userdefined="" \/>/g, '');
+    h = h.replace(/<td([^>]*)>\s*<br \/>\s*<\/td>/g, '<td$1>&nbsp;</td>');
+  }
+
+  if (s.force_br_newlines)
+    h = h.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<br />');
+
+  // Call custom cleanup code
+  h = tinyMCE._customCleanup(inst, on_save ? "get_from_editor" : "insert_to_editor", h);
+
+  // Remove internal classes
+  if (on_save) {
+    h = h.replace(new RegExp(' ?(mceItem[a-zA-Z0-9]*|' + s.visual_table_class + ')', 'g'), '');
+    h = h.replace(new RegExp(' ?class=""', 'g'), '');
+  }
+
+  if (s.remove_linebreaks && !c.settings.indent)
+    h = h.replace(/\n|\r/g, ' ');
+
+  if (d)
+    t4 = new Date().getTime();
+
+  if (on_save && c.settings.indent)
+    h = c.formatHTML(h);
+
+  // If encoding (not recommended option)
+  if (on_submit && (s.encoding == "xml" || s.encoding == "html"))
+    h = c.xmlEncode(h);
+
+  if (d)
+    t5 = new Date().getTime();
+
+  if (c.settings.debug)
+    tinyMCE.debug("Cleanup in ms: Pre=" + (t2-t1) + ", Serialize: " + (t3-t2) + ", Post: " + (t4-t3) + ", Format: " + (t5-t4) + ", Sum: " + (t5-t1) + ".");
+
+  return h;
+};
+
+function TinyMCE_Cleanup() {
+  this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+  this.rules = tinyMCE.clearArray(new Array());
+
+  // Default config
+  this.settings = {
+    indent_elements : 'head,table,tbody,thead,tfoot,form,tr,ul,ol,blockquote,object',
+    newline_before_elements : 'h1,h2,h3,h4,h5,h6,pre,address,div,ul,ol,li,meta,option,area,title,link,base,script,td',
+    newline_after_elements : 'br,hr,p,pre,address,div,ul,ol,meta,option,area,link,base,script',
+    newline_before_after_elements : 'html,head,body,table,thead,tbody,tfoot,tr,form,ul,ol,blockquote,p,object,param,hr,div',
+    indent_char : '\t',
+    indent_levels : 1,
+    entity_encoding : 'raw',
+    valid_elements : '*[*]',
+    entities : '',
+    url_converter : '',
+    invalid_elements : '',
+    verify_html : false
+  };
+
+  this.vElements = tinyMCE.clearArray(new Array());
+  this.vElementsRe = '';
+  this.closeElementsRe = /^(IMG|BR|HR|LINK|META|BASE|INPUT|BUTTON|AREA)$/;
+  this.codeElementsRe = /^(SCRIPT|STYLE)$/;
+  this.serializationId = 0;
+  this.mceAttribs = {
+    href : 'mce_href',
+    src : 'mce_src',
+    type : 'mce_type'
+  };
+}
+
+TinyMCE_Cleanup.prototype = {
+  init : function(s) {
+    var n, a, i, ir, or, st;
+
+    for (n in s)
+      this.settings[n] = s[n];
+
+    // Setup code formating
+    s = this.settings;
+
+    // Setup regexps
+    this.inRe = this._arrayToRe(s.indent_elements.split(','), '', '^<(', ')[^>]*');
+    this.ouRe = this._arrayToRe(s.indent_elements.split(','), '', '^<\\/(', ')[^>]*');
+    this.nlBeforeRe = this._arrayToRe(s.newline_before_elements.split(','), 'gi', '<(',  ')([^>]*)>');
+    this.nlAfterRe = this._arrayToRe(s.newline_after_elements.split(','), 'gi', '<(',  ')([^>]*)>');
+    this.nlBeforeAfterRe = this._arrayToRe(s.newline_before_after_elements.split(','), 'gi', '<(\\/?)(', ')([^>]*)>');
+
+    if (s.invalid_elements != '')
+      this.iveRe = this._arrayToRe(s.invalid_elements.toUpperCase().split(','), 'g', '^(', ')$');
+    else
+      this.iveRe = null;
+
+    // Setup separator
+    st = '';
+    for (i=0; i<s.indent_levels; i++)
+      st += s.indent_char;
+
+    this.inStr = st;
+
+    // If verify_html if false force *[*]
+    if (!s.verify_html) {
+      s.valid_elements = '*[*]';
+      s.extended_valid_elements = '';
+    }
+
+    this.fillStr = s.entity_encoding == "named" ? "&nbsp;" : "&#160;";
+    this.idCount = 0;
+  },
+
+  addRuleStr : function(s) {
+    var r = this.parseRuleStr(s);
+    var n;
+
+    for (n in r) {
+      if (r[n])
+        this.rules[n] = r[n];
+    }
+
+    this.vElements = tinyMCE.clearArray(new Array());
+
+    for (n in this.rules) {
+      if (this.rules[n])
+        this.vElements[this.vElements.length] = this.rules[n].tag;
+    }
+
+    this.vElementsRe = this._arrayToRe(this.vElements, '');
+  },
+
+  parseRuleStr : function(s) {
+    var ta, p, r, a, i, x, px, t, tn, y, av, or = tinyMCE.clearArray(new Array()), dv;
+
+    if (s == null || s.length == 0)
+      return or;
+
+    ta = s.split(',');
+    for (x=0; x<ta.length; x++) {
+      s = ta[x];
+      if (s.length == 0)
+        continue;
+
+      // Split tag/attrs
+      p = this.split(/\[|\]/, s);
+      if (p == null || p.length < 1)
+        t = s.toUpperCase();
+      else
+        t = p[0].toUpperCase();
+
+      // Handle all tag names
+      tn = this.split('/', t);
+      for (y=0; y<tn.length; y++) {
+        r = {};
+
+        r.tag = tn[y];
+        r.forceAttribs = null;
+        r.defaultAttribs = null;
+        r.validAttribValues = null;
+
+        // Handle prefixes
+        px = r.tag.charAt(0);
+        r.forceOpen = px == '+';
+        r.removeEmpty = px == '-';
+        r.fill = px == '#';
+        r.tag = r.tag.replace(/\+|-|#/g, '');
+        r.oTagName = tn[0].replace(/\+|-|#/g, '').toLowerCase();
+        r.isWild = new RegExp('\\*|\\?|\\+', 'g').test(r.tag);
+        r.validRe = new RegExp(this._wildcardToRe('^' + r.tag + '$'));
+
+        // Setup valid attributes
+        if (p.length > 1) {
+          r.vAttribsRe = '^(';
+          a = this.split(/\|/, p[1]);
+
+          for (i=0; i<a.length; i++) {
+            t = a[i];
+
+            av = new RegExp('(=|:|<)(.*?)$').exec(t);
+            t = t.replace(new RegExp('(=|:|<).*?$'), '');
+            if (av && av.length > 0) {
+              if (av[0].charAt(0) == ':') {
+                if (!r.forceAttribs)
+                  r.forceAttribs = tinyMCE.clearArray(new Array());
+
+                r.forceAttribs[t.toLowerCase()] = av[0].substring(1);
+              } else if (av[0].charAt(0) == '=') {
+                if (!r.defaultAttribs)
+                  r.defaultAttribs = tinyMCE.clearArray(new Array());
+
+                dv = av[0].substring(1);
+
+                r.defaultAttribs[t.toLowerCase()] = dv == "" ? "mce_empty" : dv;
+              } else if (av[0].charAt(0) == '<') {
+                if (!r.validAttribValues)
+                  r.validAttribValues = tinyMCE.clearArray(new Array());
+
+                r.validAttribValues[t.toLowerCase()] = this._arrayToRe(this.split('?', av[0].substring(1)), '');
+              }
+            }
+
+            r.vAttribsRe += '' + t.toLowerCase() + (i != a.length - 1 ? '|' : '');
+
+            a[i] = t.toLowerCase();
+          }
+
+          r.vAttribsRe += ')$';
+          r.vAttribsRe = this._wildcardToRe(r.vAttribsRe);
+          r.vAttribsReIsWild = new RegExp('\\*|\\?|\\+', 'g').test(r.vAttribsRe);
+          r.vAttribsRe = new RegExp(r.vAttribsRe);
+          r.vAttribs = a.reverse();
+
+          //tinyMCE.debug(r.tag, r.oTagName, r.vAttribsRe, r.vAttribsReWC);
+        } else {
+          r.vAttribsRe = '';
+          r.vAttribs = tinyMCE.clearArray(new Array());
+          r.vAttribsReIsWild = false;
+        }
+
+        or[r.tag] = r;
+      }
+    }
+
+    return or;
+  },
+
+  serializeNodeAsXML : function(n) {
+    var s, b;
+
+    if (!this.xmlDoc) {
+      if (this.isMSIE) {
+        try {this.xmlDoc = new ActiveXObject('MSXML2.DOMDocument');} catch (e) {}
+
+        if (!this.xmlDoc)
+          try {this.xmlDoc = new ActiveXObject('Microsoft.XmlDom');} catch (e) {}
+      } else
+        this.xmlDoc = document.implementation.createDocument('', '', null);
+
+      if (!this.xmlDoc)
+        alert("Error XML Parser could not be found.");
+    }
+
+    if (this.xmlDoc.firstChild)
+      this.xmlDoc.removeChild(this.xmlDoc.firstChild);
+
+    b = this.xmlDoc.createElement("html");
+    b = this.xmlDoc.appendChild(b);
+
+    this._convertToXML(n, b);
+
+    if (this.isMSIE)
+      return this.xmlDoc.xml;
+    else
+      return new XMLSerializer().serializeToString(this.xmlDoc);
+  },
+
+  _convertToXML : function(n, xn) {
+    var xd, el, i, l, cn, at, no, hc = false;
+
+    if (this._isDuplicate(n))
+      return;
+
+    xd = this.xmlDoc;
+
+    switch (n.nodeType) {
+      case 1: // Element
+        hc = n.hasChildNodes();
+
+        el = xd.createElement(n.nodeName.toLowerCase());
+
+        at = n.attributes;
+        for (i=at.length-1; i>-1; i--) {
+          no = at[i];
+
+          if (no.specified && no.nodeValue)
+            el.setAttribute(no.nodeName.toLowerCase(), no.nodeValue);
+        }
+
+        if (!hc && !this.closeElementsRe.test(n.nodeName))
+          el.appendChild(xd.createTextNode(""));
+
+        xn = xn.appendChild(el);
+        break;
+
+      case 3: // Text
+        xn.appendChild(xd.createTextNode(n.nodeValue));
+        return;
+
+      case 8: // Comment
+        xn.appendChild(xd.createComment(n.nodeValue));
+        return;
+    }
+
+    if (hc) {
+      cn = n.childNodes;
+
+      for (i=0, l=cn.length; i<l; i++)
+        this._convertToXML(cn[i], xn);
+    }
+  },
+
+  serializeNodeAsHTML : function(n) {
+    var en, no, h = '', i, l, r, cn, va = false, f = false, at, hc;
+
+    this._setupRules(); // Will initialize cleanup rules
+
+    if (this._isDuplicate(n))
+      return '';
+
+    switch (n.nodeType) {
+      case 1: // Element
+        hc = n.hasChildNodes();
+
+        // MSIE sometimes produces <//tag>
+        if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && n.nodeName.indexOf('/') != -1)
+          break;
+
+        if (this.vElementsRe.test(n.nodeName) && (!this.iveRe || !this.iveRe.test(n.nodeName))) {
+          va = true;
+
+          r = this.rules[n.nodeName];
+          if (!r) {
+            at = this.rules;
+            for (no in at) {
+              if (at[no] && at[no].validRe.test(n.nodeName)) {
+                r = at[no];
+                break;
+              }
+            }
+          }
+
+          en = r.isWild ? n.nodeName.toLowerCase() : r.oTagName;
+          f = r.fill;
+
+          if (r.removeEmpty && !hc)
+            return "";
+
+          h += '<' + en;
+
+          if (r.vAttribsReIsWild) {
+            // Serialize wildcard attributes
+            at = n.attributes;
+            for (i=at.length-1; i>-1; i--) {
+              no = at[i];
+              if (no.specified && r.vAttribsRe.test(no.nodeName))
+                h += this._serializeAttribute(n, r, no.nodeName);
+            }
+          } else {
+            // Serialize specific attributes
+            for (i=r.vAttribs.length-1; i>-1; i--)
+              h += this._serializeAttribute(n, r, r.vAttribs[i]);
+          }
+
+          // Serialize mce_ atts
+          if (!this.settings.on_save) {
+            at = this.mceAttribs;
+
+            for (no in at) {
+              if (at[no])
+                h += this._serializeAttribute(n, r, at[no]);
+            }
+          }
+
+          // Close these
+          if (this.closeElementsRe.test(n.nodeName))
+            return h + ' />';
+
+          h += '>';
+
+          if (this.isMSIE && this.codeElementsRe.test(n.nodeName))
+            h += n.innerHTML;
+        }
+      break;
+
+      case 3: // Text
+        if (n.parentNode && this.codeElementsRe.test(n.parentNode.nodeName))
+          return this.isMSIE ? '' : n.nodeValue;
+
+        return this.xmlEncode(n.nodeValue);
+
+      case 8: // Comment
+        return "<!--" + this._trimComment(n.nodeValue) + "-->";
+    }
+
+    if (hc) {
+      cn = n.childNodes;
+
+      for (i=0, l=cn.length; i<l; i++)
+        h += this.serializeNodeAsHTML(cn[i]);
+    }
+
+    // Fill empty nodes
+    if (f && !hc)
+      h += this.fillStr;
+
+    // End element
+    if (va)
+      h += '</' + en + '>';
+
+    return h;
+  },
+
+  _serializeAttribute : function(n, r, an) {
+    var av = '', t, os = this.settings.on_save;
+
+    if (os && (an.indexOf('mce_') == 0 || an.indexOf('_moz') == 0))
+      return '';
+
+    if (os && this.mceAttribs[an])
+      av = this._getAttrib(n, this.mceAttribs[an]);
+
+    if (av.length == 0)
+      av = this._getAttrib(n, an);
+
+    if (av.length == 0 && r.defaultAttribs && (t = r.defaultAttribs[an])) {
+      av = t;
+
+      if (av == "mce_empty")
+        return " " + an + '=""';
+    }
+
+    if (r.forceAttribs && (t = r.forceAttribs[an]))
+      av = t;
+
+    if (os && av.length != 0 && this.settings.url_converter.length != 0 && /^(src|href|longdesc)$/.test(an))
+      av = eval(this.settings.url_converter + '(this, n, av)');
+
+    if (av.length != 0 && r.validAttribValues && r.validAttribValues[an] && !r.validAttribValues[an].test(av))
+      return "";
+
+    if (av.length != 0 && av == "{$uid}")
+      av = "uid_" + (this.idCount++);
+
+    if (av.length != 0)
+      return " " + an + "=" + '"' + this.xmlEncode(av) + '"';
+
+    return "";
+  },
+
+  formatHTML : function(h) {
+    var s = this.settings, p = '', i = 0, li = 0, o = '', l;
+
+    h = h.replace(/\r/g, ''); // Windows sux, isn't carriage return a thing of the past :)
+    h = '\n' + h;
+    h = h.replace(new RegExp('\\n\\s+', 'gi'), '\n'); // Remove previous formatting
+    h = h.replace(this.nlBeforeRe, '\n<$1$2>');
+    h = h.replace(this.nlAfterRe, '<$1$2>\n');
+    h = h.replace(this.nlBeforeAfterRe, '\n<$1$2$3>\n');
+    h += '\n';
+
+    //tinyMCE.debug(h);
+
+    while ((i = h.indexOf('\n', i + 1)) != -1) {
+      if ((l = h.substring(li + 1, i)).length != 0) {
+        if (this.ouRe.test(l) && p.length >= s.indent_levels)
+          p = p.substring(s.indent_levels);
+
+        o += p + l + '\n';
+  
+        if (this.inRe.test(l))
+          p += this.inStr;
+      }
+
+      li = i;
+    }
+
+    //tinyMCE.debug(h);
+
+    return o;
+  },
+
+  xmlEncode : function(s) {
+    var i, l, e, o = '', c;
+
+    this._setupEntities(); // Will intialize lookup table
+
+    switch (this.settings.entity_encoding) {
+      case "raw":
+        return tinyMCE.xmlEncode(s);
+
+      case "named":
+        for (i=0, l=s.length; i<l; i++) {
+          c = s.charCodeAt(i);
+          e = this.entities[c];
+
+          if (e && e != '')
+            o += '&' + e + ';';
+          else
+            o += String.fromCharCode(c);
+        }
+
+        return o;
+
+      case "numeric":
+        for (i=0, l=s.length; i<l; i++) {
+          c = s.charCodeAt(i);
+
+          if (c > 127 || c == 60 || c == 62 || c == 38 || c == 39 || c == 34)
+            o += '&#' + c + ";";
+          else
+            o += String.fromCharCode(c);
+        }
+
+        return o;
+    }
+
+    return s;
+  },
+
+  split : function(re, s) {
+    var c = s.split(re);
+    var i, l, o = new Array();
+
+    for (i=0, l=c.length; i<l; i++) {
+      if (c[i] != '')
+        o[i] = c[i];
+    }
+
+    return o;
+  },
+
+  _trimComment : function(s) {
+    // Remove mce_src, mce_href
+    s = s.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
+    s = s.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
+
+    return s;
+  },
+
+  _getAttrib : function(e, n, d) {
+    if (typeof(d) == "undefined")
+      d = "";
+
+    if (!e || e.nodeType != 1)
+      return d;
+
+    var v = e.getAttribute(n, 0);
+
+    if (n == "class" && !v)
+      v = e.className;
+
+    if (this.isMSIE && n == "http-equiv")
+      v = e.httpEquiv;
+
+    if (this.isMSIE && e.nodeName == "FORM" && n == "enctype" && v == "application/x-www-form-urlencoded")
+      v = "";
+
+    if (this.isMSIE && e.nodeName == "INPUT" && n == "size" && v == "20")
+      v = "";
+
+    if (this.isMSIE && e.nodeName == "INPUT" && n == "maxlength" && v == "2147483647")
+      v = "";
+
+    if (n == "style" && !tinyMCE.isOpera)
+      v = e.style.cssText;
+
+    if (n == 'style')
+      v = tinyMCE.serializeStyle(tinyMCE.parseStyle(v));
+
+    if (this.settings.on_save && n.indexOf('on') != -1 && this.settings.on_save && v && v != "")
+      v = tinyMCE.cleanupEventStr(v);
+
+    return (v && v != "") ? '' + v : d;
+  },
+
+  _urlConverter : function(c, n, v) {
+    if (!c.settings.on_save)
+      return tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, v);
+    else if (tinyMCE.getParam('convert_urls'))
+      return eval(tinyMCE.settings.urlconverter_callback + "(v, n, true);");
+
+    return v;
+  },
+
+  _arrayToRe : function(a, op, be, af) {
+    var i, r;
+
+    op = typeof(op) == "undefined" ? "gi" : op;
+    be = typeof(be) == "undefined" ? "^(" : be;
+    af = typeof(af) == "undefined" ? ")$" : af;
+
+    r = be;
+
+    for (i=0; i<a.length; i++)
+      r += this._wildcardToRe(a[i]) + (i != a.length-1 ? "|" : "");
+
+    r += af;
+
+    return new RegExp(r, op);
+  },
+
+  _wildcardToRe : function(s) {
+    s = s.replace(/\?/g, '(\\S?)');
+    s = s.replace(/\+/g, '(\\S+)');
+    s = s.replace(/\*/g, '(\\S*)');
+
+    return s;
+  },
+
+  _setupEntities : function() {
+    var n, a, i, s = this.settings;
+
+    // Setup entities
+    if (!this.entitiesDone) {
+      if (s.entity_encoding == "named") {
+        n = tinyMCE.clearArray(new Array());
+        a = this.split(',', s.entities);
+        for (i=0; i<a.length; i+=2)
+          n[a[i]] = a[i+1];
+
+        this.entities = n;
+      }
+
+      this.entitiesDone = true;
+    }
+  },
+
+  _setupRules : function() {
+    var s = this.settings;
+
+    // Setup default rule
+    if (!this.rulesDone) {
+      this.addRuleStr(s.valid_elements);
+      this.addRuleStr(s.extended_valid_elements);
+
+      this.rulesDone = true;
+    }
+  },
+
+  _isDuplicate : function(n) {
+    var i;
+
+    if (!this.settings.fix_content_duplication)
+      return false;
+
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera && n.nodeType == 1) {
+      // Mark elements
+      if (n.mce_serialized == this.serializationId)
+        return true;
+
+      n.setAttribute('mce_serialized', this.serializationId);
+    } else {
+      // Search lookup table for text nodes  and comments
+      for (i=0; i<this.serializedNodes.length; i++) {
+        if (this.serializedNodes[i] == n)
+          return true;
+      }
+
+      this.serializedNodes[this.serializedNodes.length] = n;
+    }
+
+    return false;
+  }
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_DOMUtils.class.js */
+
+TinyMCE_Engine.prototype.getElementByAttributeValue = function(n, e, a, v) {
+  return (n = this.getElementsByAttributeValue(n, e, a, v)).length == 0 ? null : n[0];
+};
+
+TinyMCE_Engine.prototype.getElementsByAttributeValue = function(n, e, a, v) {
+  var i, nl = n.getElementsByTagName(e), o = new Array();
+
+  for (i=0; i<nl.length; i++) {
+    if (tinyMCE.getAttrib(nl[i], a).indexOf(v) != -1)
+      o[o.length] = nl[i];
+  }
+
+  return o;
+};
+
+TinyMCE_Engine.prototype.isBlockElement = function(n) {
+  return n != null && n.nodeType == 1 && this.blockRegExp.test(n.nodeName);
+};
+
+TinyMCE_Engine.prototype.getParentBlockElement = function(n) {
+  while (n) {
+    if (this.isBlockElement(n))
+      return n;
+
+    n = n.parentNode;
+  }
+
+  return null;
+};
+
+TinyMCE_Engine.prototype.insertAfter = function(n, r){
+  if (r.nextSibling)
+    r.parentNode.insertBefore(n, r.nextSibling);
+  else
+    r.parentNode.appendChild(n);
+};
+
+TinyMCE_Engine.prototype.setInnerHTML = function(e, h) {
+  var i, nl, n;
+
+  if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+    // Since MSIE handles invalid HTML better that valid XHTML we
+    // need to make some things invalid. <hr /> gets converted to <hr>.
+    h = h.replace(/\s\/>/g, '>');
+
+    // Since MSIE auto generated emtpy P tags some times we must tell it to keep the real ones
+    h = h.replace(/<p([^>]*)>\u00A0?<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
+    h = h.replace(/<p([^>]*)>\s*&nbsp;\s*<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
+    h = h.replace(/<p([^>]*)>\s+<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
+
+    // Remove first comment
+    e.innerHTML = tinyMCE.uniqueTag + h;
+    e.firstChild.removeNode(true);
+
+    // Remove weird auto generated empty paragraphs unless it's supposed to be there
+    nl = e.getElementsByTagName("p");
+    for (i=nl.length-1; i>=0; i--) {
+      n = nl[i];
+
+      if (n.nodeName == 'P' && !n.hasChildNodes() && !n.mce_keep)
+        n.parentNode.removeChild(n);
+    }
+  } else {
+    h = this.fixGeckoBaseHREFBug(1, e, h);
+    e.innerHTML = h;
+    this.fixGeckoBaseHREFBug(2, e, h);
+  }
+};
+
+TinyMCE_Engine.prototype.getOuterHTML = function(e) {
+  if (tinyMCE.isMSIE)
+    return e.outerHTML;
+
+  var d = e.ownerDocument.createElement("body");
+  d.appendChild(e);
+  return d.innerHTML;
+};
+
+TinyMCE_Engine.prototype.setOuterHTML = function(e, h) {
+  if (tinyMCE.isMSIE) {
+    e.outerHTML = h;
+    return;
+  }
+
+  var d = e.ownerDocument.createElement("body");
+  d.innerHTML = h;
+  e.parentNode.replaceChild(d.firstChild, e);
+};
+
+TinyMCE_Engine.prototype._getElementById = function(id, d) {
+  var e, i, j, f;
+
+  if (typeof(d) == "undefined")
+    d = document;
+
+  e = d.getElementById(id);
+  if (!e) {
+    f = d.forms;
+
+    for (i=0; i<f.length; i++) {
+      for (j=0; j<f[i].elements.length; j++) {
+        if (f[i].elements[j].name == id) {
+          e = f[i].elements[j];
+          break;
+        }
+      }
+    }
+  }
+
+  return e;
+};
+
+TinyMCE_Engine.prototype.getNodeTree = function(n, na, t, nn) {
+  var i;
+
+  if (typeof(t) == "undefined" || n.nodeType == t && (typeof(nn) == "undefined" || n.nodeName == nn))
+    na[na.length] = n;
+
+  if (n.hasChildNodes()) {
+    for (i=0; i<n.childNodes.length; i++)
+      tinyMCE.getNodeTree(n.childNodes[i], na, t, nn);
+  }
+
+  return na;
+};
+
+TinyMCE_Engine.prototype.getParentElement = function(node, names, attrib_name, attrib_value) {
+  if (typeof(names) == "undefined") {
+    if (node.nodeType == 1)
+      return node;
+
+    // Find parent node that is a element
+    while ((node = node.parentNode) != null && node.nodeType != 1) ;
+
+    return node;
+  }
+
+  if (node == null)
+    return null;
+
+  var namesAr = names.toUpperCase().split(',');
+
+  do {
+    for (var i=0; i<namesAr.length; i++) {
+      if (node.nodeName == namesAr[i] || names == "*") {
+        if (typeof(attrib_name) == "undefined")
+          return node;
+        else if (node.getAttribute(attrib_name)) {
+          if (typeof(attrib_value) == "undefined") {
+            if (node.getAttribute(attrib_name) != "")
+              return node;
+          } else if (node.getAttribute(attrib_name) == attrib_value)
+            return node;
+        }
+      }
+    }
+  } while ((node = node.parentNode) != null);
+
+  return null;
+};
+
+TinyMCE_Engine.prototype.getParentNode = function(n, f) {
+  while (n) {
+    if (f(n))
+      return n;
+
+    n = n.parentNode;
+  }
+
+  return null;
+};
+
+TinyMCE_Engine.prototype.getAttrib = function(elm, name, default_value) {
+  if (typeof(default_value) == "undefined")
+    default_value = "";
+
+  // Not a element
+  if (!elm || elm.nodeType != 1)
+    return default_value;
+
+  var v = elm.getAttribute(name);
+
+  // Try className for class attrib
+  if (name == "class" && !v)
+    v = elm.className;
+
+  // Workaround for a issue with Firefox 1.5rc2+
+  if (tinyMCE.isGecko && name == "src" && elm.src != null && elm.src != "")
+    v = elm.src;
+
+  // Workaround for a issue with Firefox 1.5rc2+
+  if (tinyMCE.isGecko && name == "href" && elm.href != null && elm.href != "")
+    v = elm.href;
+
+  if (name == "http-equiv" && tinyMCE.isMSIE)
+    v = elm.httpEquiv;
+
+  if (name == "style" && !tinyMCE.isOpera)
+    v = elm.style.cssText;
+
+  return (v && v != "") ? v : default_value;
+};
+
+TinyMCE_Engine.prototype.setAttrib = function(element, name, value, fix_value) {
+  if (typeof(value) == "number" && value != null)
+    value = "" + value;
+
+  if (fix_value) {
+    if (value == null)
+      value = "";
+
+    var re = new RegExp('[^0-9%]', 'g');
+    value = value.replace(re, '');
+  }
+
+  if (name == "style")
+    element.style.cssText = value;
+
+  if (name == "class")
+    element.className = value;
+
+  if (value != null && value != "" && value != -1)
+    element.setAttribute(name, value);
+  else
+    element.removeAttribute(name);
+};
+
+TinyMCE_Engine.prototype.setStyleAttrib = function(elm, name, value) {
+  eval('elm.style.' + name + '=value;');
+
+  // Style attrib deleted
+  if (tinyMCE.isMSIE && value == null || value == '') {
+    var str = tinyMCE.serializeStyle(tinyMCE.parseStyle(elm.style.cssText));
+    elm.style.cssText = str;
+    elm.setAttribute("style", str);
+  }
+};
+
+TinyMCE_Engine.prototype.switchClass = function(ei, c) {
+  var e;
+
+  if (tinyMCE.switchClassCache[ei])
+    e = tinyMCE.switchClassCache[ei];
+  else
+    e = tinyMCE.switchClassCache[ei] = document.getElementById(ei);
+
+  if (e) {
+    // Keep tile mode
+    if (tinyMCE.settings.button_tile_map && e.className && e.className.indexOf('mceTiledButton') == 0)
+      c = 'mceTiledButton ' + c;
+
+    e.className = c;
+  }
+};
+
+TinyMCE_Engine.prototype.getAbsPosition = function(n) {
+  var p = {absLeft : 0, absTop : 0};
+
+  while (n) {
+    p.absLeft += n.offsetLeft;
+    p.absTop += n.offsetTop;
+    n = n.offsetParent;
+  }
+
+  return p;
+};
+
+TinyMCE_Engine.prototype.prevNode = function(e, n) {
+  var a = n.split(','), i;
+
+  while ((e = e.previousSibling) != null) {
+    for (i=0; i<a.length; i++) {
+      if (e.nodeName == a[i])
+        return e;
+    }
+  }
+
+  return null;
+};
+
+TinyMCE_Engine.prototype.nextNode = function(e, n) {
+  var a = n.split(','), i;
+
+  while ((e = e.nextSibling) != null) {
+    for (i=0; i<a.length; i++) {
+      if (e.nodeName == a[i])
+        return e;
+    }
+  }
+
+  return null;
+};
+
+TinyMCE_Engine.prototype.selectNodes = function(n, f, a) {
+  var i;
+
+  if (!a)
+    a = new Array();
+
+  if (f(n))
+    a[a.length] = n;
+
+  if (n.hasChildNodes()) {
+    for (i=0; i<n.childNodes.length; i++)
+      tinyMCE.selectNodes(n.childNodes[i], f, a);
+  }
+
+  return a;
+};
+
+TinyMCE_Engine.prototype.addCSSClass = function(e, c, b) {
+  var o = this.removeCSSClass(e, c);
+
+  return e.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
+};
+
+TinyMCE_Engine.prototype.removeCSSClass = function(e, c) {
+  var a = this.explode(' ', e.className), i;
+
+  for (i=0; i<a.length; i++) {
+    if (a[i] == c)
+      a[i] = '';
+  }
+
+  return e.className = a.join(' ');
+};
+
+TinyMCE_Engine.prototype.renameElement = function(e, n, d) {
+  var ne, i, ar;
+
+  d = typeof(d) == "undefined" ? tinyMCE.selectedInstance.getDoc() : d;
+
+  if (e) {
+    ne = d.createElement(n);
+
+    ar = e.attributes;
+    for (i=ar.length-1; i>-1; i--) {
+      if (ar[i].specified && ar[i].nodeValue)
+        ne.setAttribute(ar[i].nodeName.toLowerCase(), ar[i].nodeValue);
+    }
+
+    ar = e.childNodes;
+    for (i=0; i<ar.length; i++)
+      ne.appendChild(ar[i].cloneNode(true));
+
+    e.parentNode.replaceChild(ne, e);
+  }
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_URL.class.js */
+
+TinyMCE_Engine.prototype.parseURL = function(url_str) {
+  var urlParts = new Array();
+
+  if (url_str) {
+    var pos, lastPos;
+
+    // Parse protocol part
+    pos = url_str.indexOf('://');
+    if (pos != -1) {
+      urlParts['protocol'] = url_str.substring(0, pos);
+      lastPos = pos + 3;
+    }
+
+    // Find port or path start
+    for (var i=lastPos; i<url_str.length; i++) {
+      var chr = url_str.charAt(i);
+
+      if (chr == ':')
+        break;
+
+      if (chr == '/')
+        break;
+    }
+    pos = i;
+
+    // Get host
+    urlParts['host'] = url_str.substring(lastPos, pos);
+
+    // Get port
+    urlParts['port'] = "";
+    lastPos = pos;
+    if (url_str.charAt(pos) == ':') {
+      pos = url_str.indexOf('/', lastPos);
+      urlParts['port'] = url_str.substring(lastPos+1, pos);
+    }
+
+    // Get path
+    lastPos = pos;
+    pos = url_str.indexOf('?', lastPos);
+
+    if (pos == -1)
+      pos = url_str.indexOf('#', lastPos);
+
+    if (pos == -1)
+      pos = url_str.length;
+
+    urlParts['path'] = url_str.substring(lastPos, pos);
+
+    // Get query
+    lastPos = pos;
+    if (url_str.charAt(pos) == '?') {
+      pos = url_str.indexOf('#');
+      pos = (pos == -1) ? url_str.length : pos;
+      urlParts['query'] = url_str.substring(lastPos+1, pos);
+    }
+
+    // Get anchor
+    lastPos = pos;
+    if (url_str.charAt(pos) == '#') {
+      pos = url_str.length;
+      urlParts['anchor'] = url_str.substring(lastPos+1, pos);
+    }
+  }
+
+  return urlParts;
+};
+
+TinyMCE_Engine.prototype.serializeURL = function(up) {
+  var o = "";
+
+  if (up['protocol'])
+    o += up['protocol'] + "://";
+
+  if (up['host'])
+    o += up['host'];
+
+  if (up['port'])
+    o += ":" + up['port'];
+
+  if (up['path'])
+    o += up['path'];
+
+  if (up['query'])
+    o += "?" + up['query'];
+
+  if (up['anchor'])
+    o += "#" + up['anchor'];
+
+  return o;
+};
+
+TinyMCE_Engine.prototype.convertAbsoluteURLToRelativeURL = function(base_url, url_to_relative) {
+  var baseURL = this.parseURL(base_url);
+  var targetURL = this.parseURL(url_to_relative);
+  var strTok1;
+  var strTok2;
+  var breakPoint = 0;
+  var outPath = "";
+  var forceSlash = false;
+
+  if (targetURL.path == "")
+    targetURL.path = "/";
+  else
+    forceSlash = true;
+
+  // Crop away last path part
+  base_url = baseURL.path.substring(0, baseURL.path.lastIndexOf('/'));
+  strTok1 = base_url.split('/');
+  strTok2 = targetURL.path.split('/');
+
+  if (strTok1.length >= strTok2.length) {
+    for (var i=0; i<strTok1.length; i++) {
+      if (i >= strTok2.length || strTok1[i] != strTok2[i]) {
+        breakPoint = i + 1;
+        break;
+      }
+    }
+  }
+
+  if (strTok1.length < strTok2.length) {
+    for (var i=0; i<strTok2.length; i++) {
+      if (i >= strTok1.length || strTok1[i] != strTok2[i]) {
+        breakPoint = i + 1;
+        break;
+      }
+    }
+  }
+
+  if (breakPoint == 1)
+    return targetURL.path;
+
+  for (var i=0; i<(strTok1.length-(breakPoint-1)); i++)
+    outPath += "../";
+
+  for (var i=breakPoint-1; i<strTok2.length; i++) {
+    if (i != (breakPoint-1))
+      outPath += "/" + strTok2[i];
+    else
+      outPath += strTok2[i];
+  }
+
+  targetURL.protocol = null;
+  targetURL.host = null;
+  targetURL.port = null;
+  targetURL.path = outPath == "" && forceSlash ? "/" : outPath;
+
+  // Remove document prefix from local anchors
+  var fileName = baseURL.path;
+  var pos;
+
+  if ((pos = fileName.lastIndexOf('/')) != -1)
+    fileName = fileName.substring(pos + 1);
+
+  // Is local anchor
+  if (fileName == targetURL.path && targetURL.anchor != "")
+    targetURL.path = "";
+
+  // If empty and not local anchor force filename or slash
+  if (targetURL.path == "" && !targetURL.anchor)
+    targetURL.path = fileName != "" ? fileName : "/";
+
+  return this.serializeURL(targetURL);
+};
+
+TinyMCE_Engine.prototype.convertRelativeToAbsoluteURL = function(base_url, relative_url) {
+  var baseURL = this.parseURL(base_url);
+  var relURL = this.parseURL(relative_url);
+
+  if (relative_url == "" || relative_url.charAt(0) == '/' || relative_url.indexOf('://') != -1 || relative_url.indexOf('mailto:') != -1 || relative_url.indexOf('javascript:') != -1)
+    return relative_url;
+
+  // Split parts
+  baseURLParts = baseURL['path'].split('/');
+  relURLParts = relURL['path'].split('/');
+
+  // Remove empty chunks
+  var newBaseURLParts = new Array();
+  for (var i=baseURLParts.length-1; i>=0; i--) {
+    if (baseURLParts[i].length == 0)
+      continue;
+
+    newBaseURLParts[newBaseURLParts.length] = baseURLParts[i];
+  }
+  baseURLParts = newBaseURLParts.reverse();
+
+  // Merge relURLParts chunks
+  var newRelURLParts = new Array();
+  var numBack = 0;
+  for (var i=relURLParts.length-1; i>=0; i--) {
+    if (relURLParts[i].length == 0 || relURLParts[i] == ".")
+      continue;
+
+    if (relURLParts[i] == '..') {
+      numBack++;
+      continue;
+    }
+
+    if (numBack > 0) {
+      numBack--;
+      continue;
+    }
+
+    newRelURLParts[newRelURLParts.length] = relURLParts[i];
+  }
+
+  relURLParts = newRelURLParts.reverse();
+
+  // Remove end from absolute path
+  var len = baseURLParts.length-numBack;
+  var absPath = (len <= 0 ? "" : "/") + baseURLParts.slice(0, len).join('/') + "/" + relURLParts.join('/');
+  var start = "", end = "";
+
+  // Build output URL
+  relURL.protocol = baseURL.protocol;
+  relURL.host = baseURL.host;
+  relURL.port = baseURL.port;
+
+  // Re-add trailing slash if it's removed
+  if (relURL.path.charAt(relURL.path.length-1) == "/")
+    absPath += "/";
+
+  relURL.path = absPath;
+
+  return this.serializeURL(relURL);
+};
+
+TinyMCE_Engine.prototype.convertURL = function(url, node, on_save) {
+  var prot = document.location.protocol;
+  var host = document.location.hostname;
+  var port = document.location.port;
+
+  // Pass through file protocol
+  if (prot == "file:")
+    return url;
+
+  // Something is wrong, remove weirdness
+  url = tinyMCE.regexpReplace(url, '(http|https):///', '/');
+
+  // Mailto link or anchor (Pass through)
+  if (url.indexOf('mailto:') != -1 || url.indexOf('javascript:') != -1 || tinyMCE.regexpReplace(url,'[ \t\r\n\+]|%20','').charAt(0) == "#")
+    return url;
+
+  // Fix relative/Mozilla
+  if (!tinyMCE.isMSIE && !on_save && url.indexOf("://") == -1 && url.charAt(0) != '/')
+    return tinyMCE.settings['base_href'] + url;
+
+  // Handle relative URLs
+  if (on_save && tinyMCE.getParam('relative_urls')) {
+    var curl = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], url);
+    if (curl.charAt(0) == '/')
+      curl = tinyMCE.settings['document_base_prefix'] + curl;
+
+    var urlParts = tinyMCE.parseURL(curl);
+    var tmpUrlParts = tinyMCE.parseURL(tinyMCE.settings['document_base_url']);
+
+    // Force relative
+    if (urlParts['host'] == tmpUrlParts['host'] && (urlParts['port'] == tmpUrlParts['port']))
+      return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings['document_base_url'], curl);
+  }
+
+  // Handle absolute URLs
+  if (!tinyMCE.getParam('relative_urls')) {
+    var urlParts = tinyMCE.parseURL(url);
+    var baseUrlParts = tinyMCE.parseURL(tinyMCE.settings['base_href']);
+
+    // Force absolute URLs from relative URLs
+    url = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], url);
+
+    // If anchor and path is the same page
+    if (urlParts['anchor'] && urlParts['path'] == baseUrlParts['path'])
+      return "#" + urlParts['anchor'];
+  }
+
+  // Remove current domain
+  if (tinyMCE.getParam('remove_script_host')) {
+    var start = "", portPart = "";
+
+    if (port != "")
+      portPart = ":" + port;
+
+    start = prot + "//" + host + portPart + "/";
+
+    if (url.indexOf(start) == 0)
+      url = url.substring(start.length-1);
+  }
+
+  return url;
+};
+
+TinyMCE_Engine.prototype.convertAllRelativeURLs = function(body) {
+  // Convert all image URL:s to absolute URL
+  var elms = body.getElementsByTagName("img");
+  for (var i=0; i<elms.length; i++) {
+    var src = tinyMCE.getAttrib(elms[i], 'src');
+
+    var msrc = tinyMCE.getAttrib(elms[i], 'mce_src');
+    if (msrc != "")
+      src = msrc;
+
+    if (src != "") {
+      src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
+      elms[i].setAttribute("src", src);
+    }
+  }
+
+  // Convert all link URL:s to absolute URL
+  var elms = body.getElementsByTagName("a");
+  for (var i=0; i<elms.length; i++) {
+    var href = tinyMCE.getAttrib(elms[i], 'href');
+
+    var mhref = tinyMCE.getAttrib(elms[i], 'mce_href');
+    if (mhref != "")
+      href = mhref;
+
+    if (href && href != "") {
+      href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], href);
+      elms[i].setAttribute("href", href);
+    }
+  }
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Array.class.js */
+
+TinyMCE_Engine.prototype.clearArray = function(a) {
+  for (var k in a)
+    a[k] = null;
+
+  return a;
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Event.class.js */
+
+TinyMCE_Engine.prototype._setEventsEnabled = function(node, state) {
+  var events = new Array('onfocus','onblur','onclick','ondblclick',
+        'onmousedown','onmouseup','onmouseover','onmousemove',
+        'onmouseout','onkeypress','onkeydown','onkeydown','onkeyup');
+
+  var evs = tinyMCE.settings['event_elements'].split(',');
+  for (var y=0; y<evs.length; y++){
+    var elms = node.getElementsByTagName(evs[y]);
+    for (var i=0; i<elms.length; i++) {
+      var event = "";
+
+      for (var x=0; x<events.length; x++) {
+        if ((event = tinyMCE.getAttrib(elms[i], events[x])) != '') {
+          event = tinyMCE.cleanupEventStr("" + event);
+
+          if (!state)
+            event = "return true;" + event;
+          else
+            event = event.replace(/^return true;/gi, '');
+
+          elms[i].removeAttribute(events[x]);
+          elms[i].setAttribute(events[x], event);
+        }
+      }
+    }
+  }
+};
+
+TinyMCE_Engine.prototype._eventPatch = function(editor_id) {
+  var n, inst, win, e;
+
+  // Remove odd, error
+  if (typeof(tinyMCE) == "undefined")
+    return true;
+
+  try {
+    // Try selected instance first
+    if (tinyMCE.selectedInstance) {
+      win = tinyMCE.selectedInstance.getWin();
+
+      if (win && win.event) {
+        e = win.event;
+
+        if (!e.target)
+          e.target = e.srcElement;
+
+        TinyMCE_Engine.prototype.handleEvent(e);
+        return;
+      }
+    }
+
+    // Search for it
+    for (n in tinyMCE.instances) {
+      inst = tinyMCE.instances[n];
+
+      if (!tinyMCE.isInstance(inst))
+        continue;
+
+      tinyMCE.selectedInstance = inst;
+      win = inst.getWin();
+
+      if (win && win.event) {
+        e = win.event;
+
+        if (!e.target)
+          e.target = e.srcElement;
+
+        TinyMCE_Engine.prototype.handleEvent(e);
+        return;
+      }
+    }
+  } catch (ex) {
+    // Ignore error if iframe is pointing to external URL
+  }
+};
+
+TinyMCE_Engine.prototype.unloadHandler = function() {
+  tinyMCE.triggerSave(true, true);
+};
+
+TinyMCE_Engine.prototype.addEventHandlers = function(inst) {
+  var doc = inst.getDoc();
+
+  inst.switchSettings();
+
+  if (tinyMCE.isMSIE) {
+    tinyMCE.addEvent(doc, "keypress", TinyMCE_Engine.prototype._eventPatch);
+    tinyMCE.addEvent(doc, "keyup", TinyMCE_Engine.prototype._eventPatch);
+    tinyMCE.addEvent(doc, "keydown", TinyMCE_Engine.prototype._eventPatch);
+    tinyMCE.addEvent(doc, "mouseup", TinyMCE_Engine.prototype._eventPatch);
+    tinyMCE.addEvent(doc, "mousedown", TinyMCE_Engine.prototype._eventPatch);
+    tinyMCE.addEvent(doc, "click", TinyMCE_Engine.prototype._eventPatch);
+  } else {
+    tinyMCE.addEvent(doc, "keypress", tinyMCE.handleEvent);
+    tinyMCE.addEvent(doc, "keydown", tinyMCE.handleEvent);
+    tinyMCE.addEvent(doc, "keyup", tinyMCE.handleEvent);
+    tinyMCE.addEvent(doc, "click", tinyMCE.handleEvent);
+    tinyMCE.addEvent(doc, "mouseup", tinyMCE.handleEvent);
+    tinyMCE.addEvent(doc, "mousedown", tinyMCE.handleEvent);
+    tinyMCE.addEvent(doc, "focus", tinyMCE.handleEvent);
+    tinyMCE.addEvent(doc, "blur", tinyMCE.handleEvent);
+
+    eval('try { doc.designMode = "On"; } catch(e) {}'); // Force designmode
+  }
+};
+
+TinyMCE_Engine.prototype.onMouseMove = function() {
+  var inst;
+
+  if (!tinyMCE.hasMouseMoved) {
+    inst = tinyMCE.selectedInstance;
+
+    // Workaround for bug #1437457 (Odd MSIE bug)
+    if (inst.isFocused) {
+      inst.undoBookmark = inst.selection.getBookmark();
+      tinyMCE.hasMouseMoved = true;
+    }
+  }
+
+//  tinyMCE.cancelEvent(inst.getWin().event);
+//  return false;
+};
+
+TinyMCE_Engine.prototype.cancelEvent = function(e) {
+  if (tinyMCE.isMSIE) {
+    e.returnValue = false;
+    e.cancelBubble = true;
+  } else
+    e.preventDefault();
+};
+
+TinyMCE_Engine.prototype.addEvent = function(o, n, h) {
+  if (o.attachEvent)
+    o.attachEvent("on" + n, h);
+  else
+    o.addEventListener(n, h, false);
+};
+
+TinyMCE_Engine.prototype.addSelectAccessibility = function(e, s, w) {
+  // Add event handlers 
+  if (!s._isAccessible) {
+    s.onkeydown = tinyMCE.accessibleEventHandler;
+    s.onblur = tinyMCE.accessibleEventHandler;
+    s._isAccessible = true;
+    s._win = w;
+  }
+
+  return false;
+};
+
+TinyMCE_Engine.prototype.accessibleEventHandler = function(e) {
+  var win = this._win;
+  e = tinyMCE.isMSIE ? win.event : e;
+  var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
+
+  // Unpiggyback onchange on blur
+  if (e.type == "blur") {
+    if (elm.oldonchange) {
+      elm.onchange = elm.oldonchange;
+      elm.oldonchange = null;
+    }
+
+    return true;
+  }
+
+  // Piggyback onchange
+  if (elm.nodeName == "SELECT" && !elm.oldonchange) {
+    elm.oldonchange = elm.onchange;
+    elm.onchange = null;
+  }
+
+  // Execute onchange and remove piggyback
+  if (e.keyCode == 13 || e.keyCode == 32) {
+    elm.onchange = elm.oldonchange;
+    elm.onchange();
+    elm.oldonchange = null;
+
+    tinyMCE.cancelEvent(e);
+    return false;
+  }
+
+  return true;
+};
+
+TinyMCE_Engine.prototype._resetIframeHeight = function() {
+  var ife;
+
+  if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+    ife = tinyMCE.selectedInstance.iframeElement;
+
+/*    if (ife._oldWidth) {
+      ife.style.width = ife._oldWidth;
+      ife.width = ife._oldWidth;
+    }*/
+
+    if (ife._oldHeight) {
+      ife.style.height = ife._oldHeight;
+      ife.height = ife._oldHeight;
+    }
+  }
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Selection.class.js */
+
+function TinyMCE_Selection(inst) {
+  this.instance = inst;
+};
+
+TinyMCE_Selection.prototype = {
+  getSelectedHTML : function() {
+    var inst = this.instance;
+    var e, r = this.getRng(), h;
+
+    if (tinyMCE.isSafari) {
+      // Not realy perfect!!
+      return r.toString();
+    }
+
+    e = document.createElement("body");
+
+    if (tinyMCE.isGecko)
+      e.appendChild(r.cloneContents());
+    else 
+      e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;
+
+    h = tinyMCE._cleanupHTML(inst, inst.contentDocument, inst.settings, e, e, false, true, false);
+
+    // When editing always use fonts internaly
+    if (tinyMCE.getParam("convert_fonts_to_spans"))
+      tinyMCE.convertSpansToFonts(inst.getDoc());
+
+    return h;
+  },
+
+  getSelectedText : function() {
+    var inst = this.instance;
+    var d, r, s, t;
+
+    if (tinyMCE.isMSIE) {
+      d = inst.getDoc();
+
+      if (d.selection.type == "Text") {
+        r = d.selection.createRange();
+        t = r.text;
+      } else
+        t = '';
+    } else {
+      s = this.getSel();
+
+      if (s && s.toString)
+        t = s.toString();
+      else
+        t = '';
+    }
+
+    return t;
+  },
+
+  getBookmark : function(simple) {
+    var rng = this.getRng();
+    var doc = this.instance.getDoc();
+    var sp, le, s, e, nl, i, si, ei;
+    var trng, sx, sy, xx = -999999999;
+
+    // Skip Opera for now
+    if (tinyMCE.isOpera)
+      return null;
+
+    sx = doc.body.scrollLeft + doc.documentElement.scrollLeft;
+    sy = doc.body.scrollTop + doc.documentElement.scrollTop;
+
+    if (tinyMCE.isSafari || tinyMCE.isGecko)
+      return {rng : rng, scrollX : sx, scrollY : sy};
+
+    if (tinyMCE.isMSIE) {
+      if (simple)
+        return {rng : rng};
+
+      if (rng.item) {
+        e = rng.item(0);
+
+        nl = doc.getElementsByTagName(e.nodeName);
+        for (i=0; i<nl.length; i++) {
+          if (e == nl[i]) {
+            sp = i;
+            break;
+          }
+        }
+
+        return {
+          tag : e.nodeName,
+          index : sp,
+          scrollX : sx,
+          scrollY : sy
+        };
+      } else {
+        trng = rng.duplicate();
+        trng.collapse(true);
+        sp = Math.abs(trng.move('character', xx));
+
+        trng = rng.duplicate();
+        trng.collapse(false);
+        le = Math.abs(trng.move('character', xx)) - sp;
+
+        return {
+          start : sp,
+          length : le,
+          scrollX : sx,
+          scrollY : sy
+        };
+      }
+    }
+
+    if (tinyMCE.isGecko) {
+      s = tinyMCE.getParentElement(rng.startContainer);
+      for (si=0; si<s.childNodes.length && s.childNodes[si] != rng.startContainer; si++) ;
+
+      nl = doc.getElementsByTagName(s.nodeName);
+      for (i=0; i<nl.length; i++) {
+          if (s == nl[i]) {
+            sp = i;
+            break;
+          }
+      }
+
+      e = tinyMCE.getParentElement(rng.endContainer);
+      for (ei=0; ei<e.childNodes.length && e.childNodes[ei] != rng.endContainer; ei++) ;
+
+      nl = doc.getElementsByTagName(e.nodeName);
+      for (i=0; i<nl.length; i++) {
+          if (e == nl[i]) {
+            le = i;
+            break;
+          }
+      }
+
+      //tinyMCE.debug(s.nodeName, sp, rng.startOffset, '-' , e.nodeName, le, rng.endOffset);
+      //tinyMCE.debug(sx, sy);
+
+      return {
+        startTag : s.nodeName,
+        start : sp,
+        startIndex : si,
+        endTag : e.nodeName,
+        end : le,
+        endIndex : ei,
+        startOffset : rng.startOffset,
+        endOffset : rng.endOffset,
+        scrollX : sx,
+        scrollY : sy
+      };
+    }
+
+    return null;
+  },
+
+  moveToBookmark : function(bookmark) {
+    var rng, nl, i;
+    var inst = this.instance;
+    var doc = inst.getDoc();
+    var win = inst.getWin();
+    var sel = this.getSel();
+
+    if (!bookmark)
+      return false;
+
+    if (tinyMCE.isSafari) {
+      sel.setBaseAndExtent(bookmark.startContainer, bookmark.startOffset, bookmark.endContainer, bookmark.endOffset);
+      return true;
+    }
+
+    if (tinyMCE.isMSIE) {
+      if (bookmark.rng) {
+        bookmark.rng.select();
+        return true;
+      }
+
+      win.focus();
+
+      if (bookmark.tag) {
+        rng = inst.getBody().createControlRange();
+
+        nl = doc.getElementsByTagName(bookmark.tag);
+
+        if (nl.length > bookmark.index) {
+          try {
+            rng.addElement(nl[bookmark.index]);
+          } catch (ex) {
+            // Might be thrown if the node no longer exists
+          }
+        }
+      } else {
+        rng = inst.getSel().createRange();
+        rng.moveToElementText(inst.getBody());
+        rng.collapse(true);
+        rng.moveStart('character', bookmark.start);
+        rng.moveEnd('character', bookmark.length);
+      }
+
+      rng.select();
+
+      win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+      return true;
+    }
+
+    if (tinyMCE.isGecko && bookmark.rng) {
+      sel.removeAllRanges();
+      sel.addRange(bookmark.rng);
+      win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+      return true;
+    }
+
+    if (tinyMCE.isGecko) {
+  //    try {
+        rng = doc.createRange();
+
+        nl = doc.getElementsByTagName(bookmark.startTag);
+        if (nl.length > bookmark.start)
+          rng.setStart(nl[bookmark.start].childNodes[bookmark.startIndex], bookmark.startOffset);
+
+        nl = doc.getElementsByTagName(bookmark.endTag);
+        if (nl.length > bookmark.end)
+          rng.setEnd(nl[bookmark.end].childNodes[bookmark.endIndex], bookmark.endOffset);
+
+        sel.removeAllRanges();
+        sel.addRange(rng);
+  /*    } catch {
+        // Ignore
+      }*/
+
+      win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+      return true;
+    }
+
+    return false;
+  },
+
+  selectNode : function(node, collapse, select_text_node, to_start) {
+    var inst = this.instance, sel, rng, nodes;
+
+    if (!node)
+      return;
+
+    if (typeof(collapse) == "undefined")
+      collapse = true;
+
+    if (typeof(select_text_node) == "undefined")
+      select_text_node = false;
+
+    if (typeof(to_start) == "undefined")
+      to_start = true;
+
+    if (tinyMCE.isMSIE) {
+      rng = inst.getBody().createTextRange();
+
+      try {
+        rng.moveToElementText(node);
+
+        if (collapse)
+          rng.collapse(to_start);
+
+        rng.select();
+      } catch (e) {
+        // Throws illigal agrument in MSIE some times
+      }
+    } else {
+      sel = this.getSel();
+
+      if (!sel)
+        return;
+
+      if (tinyMCE.isSafari) {
+        sel.setBaseAndExtent(node, 0, node, node.innerText.length);
+
+        if (collapse) {
+          if (to_start)
+            sel.collapseToStart();
+          else
+            sel.collapseToEnd();
+        }
+
+        this.scrollToNode(node);
+
+        return;
+      }
+
+      rng = inst.getDoc().createRange();
+
+      if (select_text_node) {
+        // Find first textnode in tree
+        nodes = tinyMCE.getNodeTree(node, new Array(), 3);
+        if (nodes.length > 0)
+          rng.selectNodeContents(nodes[0]);
+        else
+          rng.selectNodeContents(node);
+      } else
+        rng.selectNode(node);
+
+      if (collapse) {
+        // Special treatment of textnode collapse
+        if (!to_start && node.nodeType == 3) {
+          rng.setStart(node, node.nodeValue.length);
+          rng.setEnd(node, node.nodeValue.length);
+        } else
+          rng.collapse(to_start);
+      }
+
+      sel.removeAllRanges();
+      sel.addRange(rng);
+    }
+
+    this.scrollToNode(node);
+
+    // Set selected element
+    tinyMCE.selectedElement = null;
+    if (node.nodeType == 1)
+      tinyMCE.selectedElement = node;
+  },
+
+  scrollToNode : function(node) {
+    var inst = this.instance;
+    var pos, doc, scrollX, scrollY, height;
+
+    // Scroll to node position
+    pos = tinyMCE.getAbsPosition(node);
+    doc = inst.getDoc();
+    scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft;
+    scrollY = doc.body.scrollTop + doc.documentElement.scrollTop;
+    height = tinyMCE.isMSIE ? document.getElementById(inst.editorId).style.pixelHeight : inst.targetElement.clientHeight;
+
+    // Only scroll if out of visible area
+    if (!tinyMCE.settings['auto_resize'] && !(pos.absTop > scrollY && pos.absTop < (scrollY - 25 + height)))
+      inst.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); 
+  },
+
+  getSel : function() {
+    var inst = this.instance;
+
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+      return inst.getDoc().selection;
+
+    return inst.contentWindow.getSelection();
+  },
+
+  getRng : function() {
+    var inst = this.instance;
+    var sel = this.getSel();
+
+    if (sel == null)
+      return null;
+
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+      return sel.createRange();
+
+    if (tinyMCE.isSafari && !sel.getRangeAt)
+      return '' + window.getSelection();
+
+    return sel.getRangeAt(0);
+  },
+
+  getFocusElement : function() {
+    var inst = this.instance;
+
+    if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+      var doc = inst.getDoc();
+      var rng = doc.selection.createRange();
+
+  //    if (rng.collapse)
+  //      rng.collapse(true);
+
+      var elm = rng.item ? rng.item(0) : rng.parentElement();
+    } else {
+      if (inst.isHidden())
+        return inst.getBody();
+
+      var sel = this.getSel();
+      var rng = this.getRng();
+
+      if (!sel || !rng)
+        return null;
+
+      var elm = rng.commonAncestorContainer;
+      //var elm = (sel && sel.anchorNode) ? sel.anchorNode : null;
+
+      // Handle selection a image or other control like element such as anchors
+      if (!rng.collapsed) {
+        // Is selection small
+        if (rng.startContainer == rng.endContainer) {
+          if (rng.startOffset - rng.endOffset < 2) {
+            if (rng.startContainer.hasChildNodes())
+              elm = rng.startContainer.childNodes[rng.startOffset];
+          }
+        }
+      }
+
+      // Get the element parent of the node
+      elm = tinyMCE.getParentElement(elm);
+
+      //if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
+      //  elm = tinyMCE.selectedElement;
+    }
+
+    return elm;
+  }
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_UndoRedo.class.js */
+
+function TinyMCE_UndoRedo(inst) {
+  this.instance = inst;
+  this.undoLevels = new Array();
+  this.undoIndex = 0;
+  this.typingUndoIndex = -1;
+  this.undoRedo = true;
+};
+
+TinyMCE_UndoRedo.prototype = {
+  add : function(l) {
+    var b;
+
+    if (l) {
+      this.undoLevels[this.undoLevels.length] = l;
+      return true;
+    }
+
+    var inst = this.instance;
+
+    if (this.typingUndoIndex != -1) {
+      this.undoIndex = this.typingUndoIndex;
+      // tinyMCE.debug("Override: " + this.undoIndex);
+    }
+
+    var newHTML = tinyMCE.trim(inst.getBody().innerHTML);
+    if (this.undoLevels[this.undoIndex] && newHTML != this.undoLevels[this.undoIndex].content) {
+      //tinyMCE.debug(newHTML, this.undoLevels[this.undoIndex]);
+
+      tinyMCE.dispatchCallback(inst, 'onchange_callback', 'onChange', inst);
+
+      // Time to compress
+      var customUndoLevels = tinyMCE.settings['custom_undo_redo_levels'];
+      if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) {
+        for (var i=0; i<this.undoLevels.length-1; i++) {
+          //tinyMCE.debug(this.undoLevels[i] + "=" + this.undoLevels[i+1]);
+          this.undoLevels[i] = this.undoLevels[i+1];
+        }
+
+        this.undoLevels.length--;
+        this.undoIndex--;
+      }
+
+      b = inst.undoBookmark;
+      if (!b)
+        b = inst.selection.getBookmark();
+
+      this.undoIndex++;
+      this.undoLevels[this.undoIndex] = {
+        content : newHTML,
+        bookmark : b
+      };
+
+      this.undoLevels.length = this.undoIndex + 1;
+
+      //tinyMCE.debug("level added" + this.undoIndex);
+      return true;
+
+      // tinyMCE.debug(this.undoIndex + "," + (this.undoLevels.length-1));
+    }
+
+    return false;
+  },
+
+  undo : function() {
+    var inst = this.instance;
+
+    // Do undo
+    if (this.undoIndex > 0) {
+      this.undoIndex--;
+      tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content);
+      inst.repaint();
+      if (inst.settings.custom_undo_redo_restore_selection)
+        inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);
+    }
+
+    // tinyMCE.debug("Undo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex);
+  },
+
+  redo : function() {
+    var inst = this.instance;
+
+    tinyMCE.execCommand("mceEndTyping");
+
+    if (this.undoIndex < (this.undoLevels.length-1)) {
+      this.undoIndex++;
+      tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content);
+      inst.repaint();
+//          if (this.undoIndex > 0)
+//            inst.selection.moveToBookmark(this.undoLevels[this.undoIndex-1].bookmark);
+      if (inst.settings.custom_undo_redo_restore_selection)
+        inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);
+      // tinyMCE.debug("Redo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex);
+    }
+
+    tinyMCE.triggerNodeChange();
+  }
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_ForceParagraphs.class.js */
+
+var TinyMCE_ForceParagraphs = {
+  _insertPara : function(inst, e) {
+    function isEmpty(para) {
+      function isEmptyHTML(html) {
+        return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == "";
+      }
+
+      // Check for images
+      if (para.getElementsByTagName("img").length > 0)
+        return false;
+
+      // Check for tables
+      if (para.getElementsByTagName("table").length > 0)
+        return false;
+
+      // Check for HRs
+      if (para.getElementsByTagName("hr").length > 0)
+        return false;
+
+      // Check all textnodes
+      var nodes = tinyMCE.getNodeTree(para, new Array(), 3);
+      for (var i=0; i<nodes.length; i++) {
+        if (!isEmptyHTML(nodes[i].nodeValue))
+          return false;
+      }
+
+      // No images, no tables, no hrs, no text content then it's empty
+      return true;
+    }
+
+    var doc = inst.getDoc();
+    var sel = inst.getSel();
+    var win = inst.contentWindow;
+    var rng = sel.getRangeAt(0);
+    var body = doc.body;
+    var rootElm = doc.documentElement;
+    var blockName = "P";
+
+  //  tinyMCE.debug(body.innerHTML);
+
+  //  debug(e.target, sel.anchorNode.nodeName, sel.focusNode.nodeName, rng.startContainer, rng.endContainer, rng.commonAncestorContainer, sel.anchorOffset, sel.focusOffset, rng.toString());
+
+    // Setup before range
+    var rngBefore = doc.createRange();
+    rngBefore.setStart(sel.anchorNode, sel.anchorOffset);
+    rngBefore.collapse(true);
+
+    // Setup after range
+    var rngAfter = doc.createRange();
+    rngAfter.setStart(sel.focusNode, sel.focusOffset);
+    rngAfter.collapse(true);
+
+    // Setup start/end points
+    var direct = rngBefore.compareBoundaryPoints(rngBefore.START_TO_END, rngAfter) < 0;
+    var startNode = direct ? sel.anchorNode : sel.focusNode;
+    var startOffset = direct ? sel.anchorOffset : sel.focusOffset;
+    var endNode = direct ? sel.focusNode : sel.anchorNode;
+    var endOffset = direct ? sel.focusOffset : sel.anchorOffset;
+
+    startNode = startNode.nodeName == "BODY" ? startNode.firstChild : startNode;
+    endNode = endNode.nodeName == "BODY" ? endNode.firstChild : endNode;
+
+    // tinyMCE.debug(startNode, endNode);
+
+    // Get block elements
+    var startBlock = tinyMCE.getParentBlockElement(startNode);
+    var endBlock = tinyMCE.getParentBlockElement(endNode);
+
+    // If absolute force paragraph generation within
+    if (startBlock && new RegExp('absolute|relative|static', 'gi').test(startBlock.style.position))
+      startBlock = null;
+
+    if (endBlock && new RegExp('absolute|relative|static', 'gi').test(endBlock.style.position))
+      endBlock = null;
+
+    // Use current block name
+    if (startBlock != null) {
+      blockName = startBlock.nodeName;
+
+      // Use P instead
+      if (blockName == "TD" || blockName == "TABLE" || (blockName == "DIV" && new RegExp('left|right', 'gi').test(startBlock.style.cssFloat)))
+        blockName = "P";
+    }
+
+    // Within a list use normal behaviour
+    if (tinyMCE.getParentElement(startBlock, "OL,UL") != null)
+      return false;
+
+    // Within a table create new paragraphs
+    if ((startBlock != null && startBlock.nodeName == "TABLE") || (endBlock != null && endBlock.nodeName == "TABLE"))
+      startBlock = endBlock = null;
+
+    // Setup new paragraphs
+    var paraBefore = (startBlock != null && startBlock.nodeName == blockName) ? startBlock.cloneNode(false) : doc.createElement(blockName);
+    var paraAfter = (endBlock != null && endBlock.nodeName == blockName) ? endBlock.cloneNode(false) : doc.createElement(blockName);
+
+    // Is header, then force paragraph under
+    if (/^(H[1-6])$/.test(blockName))
+      paraAfter = doc.createElement("p");
+
+    // Setup chop nodes
+    var startChop = startNode;
+    var endChop = endNode;
+
+    // Get startChop node
+    node = startChop;
+    do {
+      if (node == body || node.nodeType == 9 || tinyMCE.isBlockElement(node))
+        break;
+
+      startChop = node;
+    } while ((node = node.previousSibling ? node.previousSibling : node.parentNode));
+
+    // Get endChop node
+    node = endChop;
+    do {
+      if (node == body || node.nodeType == 9 || tinyMCE.isBlockElement(node))
+        break;
+
+      endChop = node;
+    } while ((node = node.nextSibling ? node.nextSibling : node.parentNode));
+
+    // Fix when only a image is within the TD
+    if (startChop.nodeName == "TD")
+      startChop = startChop.firstChild;
+
+    if (endChop.nodeName == "TD")
+      endChop = endChop.lastChild;
+
+    // If not in a block element
+    if (startBlock == null) {
+      // Delete selection
+      rng.deleteContents();
+      sel.removeAllRanges();
+
+      if (startChop != rootElm && endChop != rootElm) {
+        // Insert paragraph before
+        rngBefore = rng.cloneRange();
+
+        if (startChop == body)
+          rngBefore.setStart(startChop, 0);
+        else
+          rngBefore.setStartBefore(startChop);
+
+        paraBefore.appendChild(rngBefore.cloneContents());
+
+        // Insert paragraph after
+        if (endChop.parentNode.nodeName == blockName)
+          endChop = endChop.parentNode;
+
+        // If not after image
+        //if (rng.startContainer.nodeName != "BODY" && rng.endContainer.nodeName != "BODY")
+          rng.setEndAfter(endChop);
+
+        if (endChop.nodeName != "#text" && endChop.nodeName != "BODY")
+          rngBefore.setEndAfter(endChop);
+
+        var contents = rng.cloneContents();
+        if (contents.firstChild && (contents.firstChild.nodeName == blockName || contents.firstChild.nodeName == "BODY"))
+          paraAfter.innerHTML = contents.firstChild.innerHTML;
+        else
+          paraAfter.appendChild(contents);
+
+        // Check if it's a empty paragraph
+        if (isEmpty(paraBefore))
+          paraBefore.innerHTML = "&nbsp;";
+
+        // Check if it's a empty paragraph
+        if (isEmpty(paraAfter))
+          paraAfter.innerHTML = "&nbsp;";
+
+        // Delete old contents
+        rng.deleteContents();
+        rngAfter.deleteContents();
+        rngBefore.deleteContents();
+
+        // Insert new paragraphs
+        paraAfter.normalize();
+        rngBefore.insertNode(paraAfter);
+        paraBefore.normalize();
+        rngBefore.insertNode(paraBefore);
+
+        // tinyMCE.debug("1: ", paraBefore.innerHTML, paraAfter.innerHTML);
+      } else {
+        body.innerHTML = "<" + blockName + ">&nbsp;</" + blockName + "><" + blockName + ">&nbsp;</" + blockName + ">";
+        paraAfter = body.childNodes[1];
+      }
+
+      inst.selection.selectNode(paraAfter, true, true);
+
+      return true;
+    }
+
+    // Place first part within new paragraph
+    if (startChop.nodeName == blockName)
+      rngBefore.setStart(startChop, 0);
+    else
+      rngBefore.setStartBefore(startChop);
+
+    rngBefore.setEnd(startNode, startOffset);
+    paraBefore.appendChild(rngBefore.cloneContents());
+
+    // Place secound part within new paragraph
+    rngAfter.setEndAfter(endChop);
+    rngAfter.setStart(endNode, endOffset);
+    var contents = rngAfter.cloneContents();
+
+    if (contents.firstChild && contents.firstChild.nodeName == blockName) {
+  /*    var nodes = contents.firstChild.childNodes;
+      for (var i=0; i<nodes.length; i++) {
+        //tinyMCE.debug(nodes[i].nodeName);
+        if (nodes[i].nodeName != "BODY")
+          paraAfter.appendChild(nodes[i]);
+      }
+  */
+      paraAfter.innerHTML = contents.firstChild.innerHTML;
+    } else
+      paraAfter.appendChild(contents);
+
+    // Check if it's a empty paragraph
+    if (isEmpty(paraBefore))
+      paraBefore.innerHTML = "&nbsp;";
+
+    // Check if it's a empty paragraph
+    if (isEmpty(paraAfter))
+      paraAfter.innerHTML = "&nbsp;";
+
+    // Create a range around everything
+    var rng = doc.createRange();
+
+    if (!startChop.previousSibling && startChop.parentNode.nodeName.toUpperCase() == blockName) {
+      rng.setStartBefore(startChop.parentNode);
+    } else {
+      if (rngBefore.startContainer.nodeName.toUpperCase() == blockName && rngBefore.startOffset == 0)
+        rng.setStartBefore(rngBefore.startContainer);
+      else
+        rng.setStart(rngBefore.startContainer, rngBefore.startOffset);
+    }
+
+    if (!endChop.nextSibling && endChop.parentNode.nodeName.toUpperCase() == blockName)
+      rng.setEndAfter(endChop.parentNode);
+    else
+      rng.setEnd(rngAfter.endContainer, rngAfter.endOffset);
+
+    // Delete all contents and insert new paragraphs
+    rng.deleteContents();
+    rng.insertNode(paraAfter);
+    rng.insertNode(paraBefore);
+    //tinyMCE.debug("2", paraBefore.innerHTML, paraAfter.innerHTML);
+
+    // Normalize
+    paraAfter.normalize();
+    paraBefore.normalize();
+
+    inst.selection.selectNode(paraAfter, true, true);
+
+    return true;
+  },
+
+  _handleBackSpace : function(inst) {
+    var r = inst.getRng(), sn = r.startContainer, nv, s = false;
+
+    if (sn && sn.nextSibling && sn.nextSibling.nodeName == "BR") {
+      nv = sn.nodeValue;
+
+      // Handle if a backspace is pressed after a space character #bug 1466054
+      if (nv != null && nv.length >= r.startOffset && nv.charAt(r.startOffset - 1) == ' ')
+        s = true;
+
+      // Only remove BRs if we are at the end of line #bug 1464152
+      if (nv != null && r.startOffset == nv.length)
+        sn.nextSibling.parentNode.removeChild(sn.nextSibling);
+    }
+
+    return s;
+  }
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Layer.class.js */
+
+function TinyMCE_Layer(id, bm) {
+  this.id = id;
+  this.blockerElement = null;
+  this.events = false;
+  this.element = null;
+  this.blockMode = typeof(bm) != 'undefined' ? bm : true;
+  this.doc = document;
+};
+
+TinyMCE_Layer.prototype = {
+  moveRelativeTo : function(re, p) {
+    var rep = this.getAbsPosition(re);
+    var w = parseInt(re.offsetWidth);
+    var h = parseInt(re.offsetHeight);
+    var e = this.getElement();
+    var ew = parseInt(e.offsetWidth);
+    var eh = parseInt(e.offsetHeight);
+    var x, y;
+
+    switch (p) {
+      case "tl":
+        x = rep.absLeft;
+        y = rep.absTop;
+        break;
+
+      case "tr":
+        x = rep.absLeft + w;
+        y = rep.absTop;
+        break;
+
+      case "bl":
+        x = rep.absLeft;
+        y = rep.absTop + h;
+        break;
+
+      case "br":
+        x = rep.absLeft + w;
+        y = rep.absTop + h;
+        break;
+
+      case "cc":
+        x = rep.absLeft + (w / 2) - (ew / 2);
+        y = rep.absTop + (h / 2) - (eh / 2);
+        break;
+    }
+
+    this.moveTo(x, y);
+  },
+
+  moveBy : function(x, y) {
+    var e = this.getElement();
+    this.moveTo(parseInt(e.style.left) + x, parseInt(e.style.top) + y);
+  },
+
+  moveTo : function(x, y) {
+    var e = this.getElement();
+
+    e.style.left = x + "px";
+    e.style.top = y + "px";
+
+    this.updateBlocker();
+  },
+
+  resizeBy : function(w, h) {
+    var e = this.getElement();
+    this.resizeTo(parseInt(e.style.width) + w, parseInt(e.style.height) + h);
+  },
+
+  resizeTo : function(w, h) {
+    var e = this.getElement();
+
+    if (w != null)
+      e.style.width = w + "px";
+
+    if (h != null)
+      e.style.height = h + "px";
+
+    this.updateBlocker();
+  },
+
+  show : function() {
+    this.getElement().style.display = 'block';
+    this.updateBlocker();
+  },
+
+  hide : function() {
+    this.getElement().style.display = 'none';
+    this.updateBlocker();
+  },
+
+  isVisible : function() {
+    return this.getElement().style.display == 'block';
+  },
+
+  getElement : function() {
+    if (!this.element)
+      this.element = this.doc.getElementById(this.id);
+
+    return this.element;
+  },
+
+  setBlockMode : function(s) {
+    this.blockMode = s;
+  },
+
+  updateBlocker : function() {
+    var e, b, x, y, w, h;
+
+    b = this.getBlocker();
+    if (b) {
+      if (this.blockMode) {
+        e = this.getElement();
+        x = this.parseInt(e.style.left);
+        y = this.parseInt(e.style.top);
+        w = this.parseInt(e.offsetWidth);
+        h = this.parseInt(e.offsetHeight);
+
+        b.style.left = x + 'px';
+        b.style.top = y + 'px';
+        b.style.width = w + 'px';
+        b.style.height = h + 'px';
+        b.style.display = e.style.display;
+      } else
+        b.style.display = 'none';
+    }
+  },
+
+  getBlocker : function() {
+    var d, b;
+
+    if (!this.blockerElement && this.blockMode) {
+      d = this.doc;
+      b = d.createElement("iframe");
+
+      b.style.cssText = 'display: none; position: absolute; left: 0; top: 0';
+      b.src = 'javascript:false;';
+      b.frameBorder = '0';
+      b.scrolling = 'no';
+
+      d.body.appendChild(b);
+      this.blockerElement = b;
+    }
+
+    return this.blockerElement;
+  },
+
+  getAbsPosition : function(n) {
+    var p = {absLeft : 0, absTop : 0};
+
+    while (n) {
+      p.absLeft += n.offsetLeft;
+      p.absTop += n.offsetTop;
+      n = n.offsetParent;
+    }
+
+    return p;
+  },
+
+  create : function(n, c, p) {
+    var d = this.doc, e = d.createElement(n);
+
+    e.setAttribute('id', this.id);
+
+    if (c)
+      e.className = c;
+
+    if (!p)
+      p = d.body;
+
+    p.appendChild(e);
+
+    return this.element = e;
+  },
+
+  parseInt : function(s) {
+    if (s == null || s == '')
+      return 0;
+
+    return parseInt(s);
+  }
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Menu.class.js */
+
+function TinyMCE_Menu() {
+  var id;
+
+  if (typeof(tinyMCE.menuCounter) == "undefined")
+    tinyMCE.menuCounter = 0;
+
+  id = "mc_menu_" + tinyMCE.menuCounter++;
+
+  TinyMCE_Layer.call(this, id, true);
+
+  this.id = id;
+  this.items = new Array();
+  this.needsUpdate = true;
+};
+
+// Extends the TinyMCE_Layer class
+TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, {
+  init : function(s) {
+    var n;
+
+    // Default params
+    this.settings = {
+      separator_class : 'mceMenuSeparator',
+      title_class : 'mceMenuTitle',
+      disabled_class : 'mceMenuDisabled',
+      menu_class : 'mceMenu',
+      drop_menu : true
+    };
+
+    for (n in s)
+      this.settings[n] = s[n];
+
+    this.create('div', this.settings.menu_class);
+  },
+
+  clear : function() {
+    this.items = new Array();
+  },
+
+  addTitle : function(t) {
+    this.add({type : 'title', text : t});
+  },
+
+  addDisabled : function(t) {
+    this.add({type : 'disabled', text : t});
+  },
+
+  addSeparator : function() {
+    this.add({type : 'separator'});
+  },
+
+  addItem : function(t, js) {
+    this.add({text : t, js : js});
+  },
+
+  add : function(mi) {
+    this.items[this.items.length] = mi;
+    this.needsUpdate = true;
+  },
+
+  update : function() {
+    var e = this.getElement(), h = '', i, t, m = this.items, s = this.settings;
+
+    if (this.settings.drop_menu)
+      h += '<span class="mceMenuLine"></span>';
+
+    h += '<table border="0" cellpadding="0" cellspacing="0">';
+
+    for (i=0; i<m.length; i++) {
+      t = tinyMCE.xmlEncode(m[i].text);
+      c = m[i].class_name ? ' class="' + m[i].class_name + '"' : '';
+
+      switch (m[i].type) {
+        case 'separator':
+          h += '<tr class="' + s.separator_class + '"><td>';
+          break;
+
+        case 'title':
+          h += '<tr class="' + s.title_class + '"><td><span' + c +'>' + t + '</span>';
+          break;
+
+        case 'disabled':
+          h += '<tr class="' + s.disabled_class + '"><td><span' + c +'>' + t + '</span>';
+          break;
+
+        default:
+          h += '<tr><td><a href="javascript:void(0);" onmousedown="' + tinyMCE.xmlEncode(m[i].js) + ';return false;"><span' + c +'>' + t + '</span></a>';
+      }
+
+      h += '</td></tr>';
+    }
+
+    h += '</table>';
+
+    e.innerHTML = h;
+
+    this.needsUpdate = false;
+    this.updateBlocker();
+  },
+
+  show : function() {
+    var nl, i;
+
+    if (tinyMCE.lastMenu == this)
+      return;
+
+    if (this.needsUpdate)
+      this.update();
+
+    if (tinyMCE.lastMenu && tinyMCE.lastMenu != this)
+      tinyMCE.lastMenu.hide();
+
+    TinyMCE_Layer.prototype.show.call(this);
+
+    if (!tinyMCE.isOpera) {
+      // Accessibility stuff
+/*      nl = this.getElement().getElementsByTagName("a");
+      if (nl.length > 0)
+        nl[0].focus();*/
+    }
+
+    tinyMCE.lastMenu = this;
+  }
+});
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Debug.class.js */
+
+TinyMCE_Engine.prototype.debug = function() {
+  var m = "", e, a, i;
+
+  e = document.getElementById("tinymce_debug");
+  if (!e) {
+    var d = document.createElement("div");
+    d.setAttribute("className", "debugger");
+    d.className = "debugger";
+    d.innerHTML = 'Debug output:<textarea id="tinymce_debug" style="width: 100%; height: 300px" wrap="nowrap" mce_editable="false"></textarea>';
+
+    document.body.appendChild(d);
+    e = document.getElementById("tinymce_debug");
+  }
+
+  a = this.debug.arguments;
+  for (i=0; i<a.length; i++) {
+    m += a[i];
+    if (i<a.length-1)
+      m += ', ';
+  }
+
+  e.value += m + "\n";
+};

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/editable_selects.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/editable_selects.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/editable_selects.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+/**
+ * $RCSfile: editable_selects.js,v $
+ * $Revision: 1.1 $
+ * $Date: 2006/04/10 09:30:19 $
+ *
+ * Makes select boxes editable.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+var TinyMCE_EditableSelects = {
+  editSelectElm : null,
+
+  init : function() {
+    var nl = document.getElementsByTagName("select"), i, d = document, o;
+
+    for (i=0; i<nl.length; i++) {
+      if (nl[i].className.indexOf('mceEditableSelect') != -1) {
+        o = new Option('(value)', '__mce_add_custom__');
+
+        o.className = 'mceAddSelectValue';
+
+        nl[i].options[nl[i].options.length] = o;
+        nl[i].setAttribute('onchange', 'TinyMCE_EditableSelects.onChangeEditableSelect(this);');
+      }
+    }
+  },
+
+  onChangeEditableSelect : function(se) {
+    var d = document, ne;
+
+    if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
+      ne = d.createElement("input");
+      ne.id = se.id + "_custom";
+      ne.name = se.name + "_custom";
+      ne.type = "text";
+
+      ne.style.width = se.clientWidth;
+      se.parentNode.insertBefore(ne, se);
+      se.style.display = 'none';
+      ne.focus();
+      ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
+      TinyMCE_EditableSelects.editSelectElm = se;
+    }
+  },
+
+  onBlurEditableSelectInput : function() {
+    var se = TinyMCE_EditableSelects.editSelectElm;
+
+    if (se) {
+      if (se.previousSibling.value != '') {
+        addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
+        selectByValue(document.forms[0], se.id, se.previousSibling.value);
+      } else
+        selectByValue(document.forms[0], se.id, '');
+
+      se.style.display = 'inline';
+      se.parentNode.removeChild(se.previousSibling);
+      TinyMCE_EditableSelects.editSelectElm = null;
+    }
+  }
+};

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/form_utils.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/form_utils.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/form_utils.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,210 @@
+/**
+ * $RCSfile: form_utils.js,v $
+ * $Revision: 1.11 $
+ * $Date: 2006/04/07 15:53:12 $
+ *
+ * Various form utilitiy functions.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function getColorPickerHTML(id, target_form_element) {
+  var html = "";
+
+  html += '<a id="' + id + '_link" href="javascript:void(0);" onkeydown="pickColor(event,\'' + target_form_element +'\');" onmousedown="pickColor(event,\'' + target_form_element +'\');return false;">';
+  html += '<img id="' + id + '" src="../../themes/' + tinyMCE.getParam("theme") + '/images/color.gif"';
+  html += ' onmouseover="this.className=\'mceButtonOver\'"';
+  html += ' onmouseout="this.className=\'mceButtonNormal\'"';
+  html += ' onmousedown="this.className=\'mceButtonDown\'"';
+  html += ' width="20" height="16" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
+  html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
+
+  return html;
+}
+
+function pickColor(e, target_form_element) {
+  if ((e.keyCode == 32 || e.keyCode == 13) || e.type == "mousedown")
+    tinyMCEPopup.pickColor(e, target_form_element);
+}
+
+function updateColor(img_id, form_element_id) {
+  document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
+}
+
+function setBrowserDisabled(id, state) {
+  var img = document.getElementById(id);
+  var lnk = document.getElementById(id + "_link");
+
+  if (lnk) {
+    if (state) {
+      lnk.setAttribute("realhref", lnk.getAttribute("href"));
+      lnk.removeAttribute("href");
+      tinyMCE.switchClass(img, 'mceButtonDisabled', true);
+    } else {
+      lnk.setAttribute("href", lnk.getAttribute("realhref"));
+      tinyMCE.switchClass(img, 'mceButtonNormal', false);
+    }
+  }
+}
+
+function getBrowserHTML(id, target_form_element, type, prefix) {
+  var option = prefix + "_" + type + "_browser_callback";
+  var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
+  if (cb == null)
+    return "";
+
+  var html = "";
+
+  html += '<a id="' + id + '_link" href="javascript:openBrower(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;">';
+  html += '<img id="' + id + '" src="../../themes/' + tinyMCE.getParam("theme") + '/images/browse.gif"';
+  html += ' onmouseover="this.className=\'mceButtonOver\';"';
+  html += ' onmouseout="this.className=\'mceButtonNormal\';"';
+  html += ' onmousedown="this.className=\'mceButtonDown\';"';
+  html += ' width="20" height="18" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
+  html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
+
+  return html;
+}
+
+function openBrower(img_id, target_form_element, type, option) {
+  var img = document.getElementById(img_id);
+
+  if (img.className != "mceButtonDisabled")
+    tinyMCEPopup.openBrowser(target_form_element, type, option);
+}
+
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
+  if (!form_obj || !form_obj.elements[field_name])
+    return;
+
+  var sel = form_obj.elements[field_name];
+
+  var found = false;
+  for (var i=0; i<sel.options.length; i++) {
+    var option = sel.options[i];
+
+    if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
+      option.selected = true;
+      found = true;
+    } else
+      option.selected = false;
+  }
+
+  if (!found && add_custom && value != '') {
+    var option = new Option(value, value);
+    option.selected = true;
+    sel.options[sel.options.length] = option;
+    sel.selectedIndex = sel.options.length - 1;
+  }
+
+  return found;
+}
+
+function getSelectValue(form_obj, field_name) {
+  var elm = form_obj.elements[field_name];
+
+  if (elm == null || elm.options == null)
+    return "";
+
+  return elm.options[elm.selectedIndex].value;
+}
+
+function addSelectValue(form_obj, field_name, name, value) {
+  var s = form_obj.elements[field_name];
+  var o = new Option(name, value);
+  s.options[s.options.length] = o;
+}
+
+function addClassesToList(list_id, specific_option) {
+  // Setup class droplist
+  var styleSelectElm = document.getElementById(list_id);
+  var styles = tinyMCE.getParam('theme_advanced_styles', false);
+  styles = tinyMCE.getParam(specific_option, styles);
+
+  if (styles) {
+    var stylesAr = styles.split(';');
+
+    for (var i=0; i<stylesAr.length; i++) {
+      if (stylesAr != "") {
+        var key, value;
+
+        key = stylesAr[i].split('=')[0];
+        value = stylesAr[i].split('=')[1];
+
+        styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
+      }
+    }
+  } else {
+    // Use auto impored classes
+    var csses = tinyMCE.getCSSClasses(tinyMCE.getWindowArg('editor_id'));
+    for (var i=0; i<csses.length; i++)
+      styleSelectElm.options[styleSelectElm.length] = new Option(csses[i], csses[i]);
+  }
+}
+
+function isVisible(element_id) {
+  var elm = document.getElementById(element_id);
+
+  return elm && elm.style.display != "none";
+}
+
+function convertRGBToHex(col) {
+  var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+  var rgb = col.replace(re, "$1,$2,$3").split(',');
+  if (rgb.length == 3) {
+    r = parseInt(rgb[0]).toString(16);
+    g = parseInt(rgb[1]).toString(16);
+    b = parseInt(rgb[2]).toString(16);
+
+    r = r.length == 1 ? '0' + r : r;
+    g = g.length == 1 ? '0' + g : g;
+    b = b.length == 1 ? '0' + b : b;
+
+    return "#" + r + g + b;
+  }
+
+  return col;
+}
+
+function convertHexToRGB(col) {
+  if (col.indexOf('#') != -1) {
+    col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+    r = parseInt(col.substring(0, 2), 16);
+    g = parseInt(col.substring(2, 4), 16);
+    b = parseInt(col.substring(4, 6), 16);
+
+    return "rgb(" + r + "," + g + "," + b + ")";
+  }
+
+  return col;
+}
+
+function trimSize(size) {
+  return size.replace(new RegExp('[^0-9%]', 'gi'), '');
+}
+
+function getCSSSize(size) {
+  size = trimSize(size);
+
+  if (size == "")
+    return "";
+
+  return size.indexOf('%') != -1 ? size : size + "px";
+}
+
+function getStyle(elm, attrib, style) {
+  var val = tinyMCE.getAttrib(elm, attrib);
+
+  if (val != '')
+    return '' + val;
+
+  if (typeof(style) == 'undefined')
+    style = attrib;
+
+  val = eval('elm.style.' + style);
+
+  return val == null ? '' : '' + val;
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/mclayer.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/mclayer.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/mclayer.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,212 @@
+/**
+ * $RCSfile: mclayer.js,v $
+ * $Revision: 1.2 $
+ * $Date: 2006/02/06 20:11:09 $
+ *
+ * Moxiecode floating layer script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCLayer(id) {
+  this.id = id;
+  this.settings = new Array();
+  this.blockerElement = null;
+  this.isMSIE = navigator.appName == "Microsoft Internet Explorer";
+  this.events = false;
+  this.autoHideCallback = null;
+}
+
+MCLayer.prototype = {
+  moveRelativeTo : function(re, p, a) {
+    var rep = this.getAbsPosition(re);
+    var w = parseInt(re.offsetWidth);
+    var h = parseInt(re.offsetHeight);
+    var x, y;
+
+    switch (p) {
+      case "tl":
+        break;
+
+      case "tr":
+        x = rep.absLeft + w;
+        y = rep.absTop;
+        break;
+
+      case "bl":
+        break;
+
+      case "br":
+        break;
+    }
+
+    this.moveTo(x, y);
+  },
+
+  moveBy : function(dx, dy) {
+    var e = this.getElement();
+    var x = parseInt(e.style.left);
+    var y = parseInt(e.style.top);
+
+    e.style.left = (x + dx) + "px";
+    e.style.top = (y + dy) + "px";
+
+    this.updateBlocker();
+  },
+
+  moveTo : function(x, y) {
+    var e = this.getElement();
+
+    e.style.left = x + "px";
+    e.style.top = y + "px";
+
+    this.updateBlocker();
+  },
+
+  show : function() {
+    MCLayer.visibleLayer = this;
+
+    this.getElement().style.display = 'block';
+    this.updateBlocker();
+  },
+
+  hide : function() {
+    this.getElement().style.display = 'none';
+    this.updateBlocker();
+  },
+
+  setAutoHide : function(s, cb) {
+    this.autoHideCallback = cb;
+    this.registerEventHandlers();
+  },
+
+  getElement : function() {
+    return document.getElementById(this.id);
+  },
+
+  updateBlocker : function() {
+    if (!this.isMSIE)
+      return;
+
+    var e = this.getElement();
+    var b = this.getBlocker();
+    var x = this.parseInt(e.style.left);
+    var y = this.parseInt(e.style.top);
+    var w = this.parseInt(e.offsetWidth);
+    var h = this.parseInt(e.offsetHeight);
+
+    b.style.left = x + 'px';
+    b.style.top = y + 'px';
+    b.style.width = w + 'px';
+    b.style.height = h + 'px';
+    b.style.display = e.style.display;
+  },
+
+  getBlocker : function() {
+    if (!this.blockerElement) {
+      var d = document, b = d.createElement("iframe");
+
+      b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0';
+      b.src = 'javascript:false;';
+      b.frameBorder = '0';
+      b.scrolling = 'no';
+
+      d.body.appendChild(b);
+      this.blockerElement = b;
+    }
+
+    return this.blockerElement;
+  },
+
+  getAbsPosition : function(n) {
+    var p = {absLeft : 0, absTop : 0};
+
+    while (n) {
+      p.absLeft += n.offsetLeft;
+      p.absTop += n.offsetTop;
+      n = n.offsetParent;
+    }
+
+    return p;
+  },
+
+  registerEventHandlers : function() {
+    if (!this.events) {
+      var d = document;
+
+      this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown);
+
+      this.events = true;
+    }
+  },
+
+  addEvent : function(o, n, h) {
+    if (o.attachEvent)
+      o.attachEvent("on" + n, h);
+    else
+      o.addEventListener(n, h, false);
+  },
+
+  onMouseDown : function(e) {
+    e = typeof(e) == "undefined" ? window.event : e;
+    var b = document.body;
+    var l = MCLayer.visibleLayer;
+
+    if (l) {
+      var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX;
+      var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY;
+      var el = l.getElement();
+      var x = parseInt(el.style.left);
+      var y = parseInt(el.style.top);
+      var w = parseInt(el.offsetWidth);
+      var h = parseInt(el.offsetHeight);
+
+      if (!(mx > x && mx < x + w && my > y && my < y + h)) {
+        MCLayer.visibleLayer = null;
+
+        if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))
+          return true;
+
+        l.hide();
+      }
+    }
+  },
+
+  addCSSClass : function(e, c) {
+    this.removeCSSClass(e, c);
+    var a = this.explode(' ', e.className);
+    a[a.length] = c;
+    e.className = a.join(' ');
+  },
+
+  removeCSSClass : function(e, c) {
+    var a = this.explode(' ', e.className), i;
+
+    for (i=0; i<a.length; i++) {
+      if (a[i] == c)
+        a[i] = '';
+    }
+
+    e.className = a.join(' ');
+  },
+
+  explode : function(d, s) {
+    var ar = s.split(d);
+    var oar = new Array();
+
+    for (var i = 0; i<ar.length; i++) {
+      if (ar[i] != "")
+        oar[oar.length] = ar[i];
+    }
+
+    return oar;
+  },
+
+  parseInt : function(s) {
+    if (s == null || s == '')
+      return 0;
+
+    return parseInt(s);
+  }
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/mctabs.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/mctabs.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/mctabs.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,76 @@
+/**
+ * $RCSfile: mctabs.js,v $
+ * $Revision: 1.2 $
+ * $Date: 2006/02/06 20:11:09 $
+ *
+ * Moxiecode DHTML Tabs script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCTabs() {
+  this.settings = new Array();
+};
+
+MCTabs.prototype.init = function(settings) {
+  this.settings = settings;
+};
+
+MCTabs.prototype.getParam = function(name, default_value) {
+  var value = null;
+
+  value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
+
+  // Fix bool values
+  if (value == "true" || value == "false")
+    return (value == "true");
+
+  return value;
+};
+
+MCTabs.prototype.displayTab = function(tab_id, panel_id) {
+  var panelElm = document.getElementById(panel_id);
+  var panelContainerElm = panelElm ? panelElm.parentNode : null;
+  var tabElm = document.getElementById(tab_id);
+  var tabContainerElm = tabElm ? tabElm.parentNode : null;
+  var selectionClass = this.getParam('selection_class', 'current');
+
+  if (tabElm && tabContainerElm) {
+    var nodes = tabContainerElm.childNodes;
+
+    // Hide all other tabs
+    for (var i=0; i<nodes.length; i++) {
+      if (nodes[i].nodeName == "LI")
+        nodes[i].className = '';
+    }
+
+    // Show selected tab
+    tabElm.className = 'current';
+  }
+
+  if (panelElm && panelContainerElm) {
+    var nodes = panelContainerElm.childNodes;
+
+    // Hide all other panels
+    for (var i=0; i<nodes.length; i++) {
+      if (nodes[i].nodeName == "DIV")
+        nodes[i].className = 'panel';
+    }
+
+    // Show selected panel
+    panelElm.className = 'current';
+  }
+};
+
+MCTabs.prototype.getAnchor = function() {
+  var pos, url = document.location.href;
+
+  if ((pos = url.lastIndexOf('#')) != -1)
+    return url.substring(pos + 1);
+
+  return "";
+};
+
+// Global instance
+var mcTabs = new MCTabs();

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/validate.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/validate.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce/utils/validate.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+/**
+ * $RCSfile: validate.js,v $
+ * $Revision: 1.3 $
+ * $Date: 2006/02/06 20:11:09 $
+ *
+ * Various form validation methods.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function testRegExp(form_name, element_name, re) {
+  return new RegExp(re).test(document.forms[form_name].elements[element_name].value);
+}
+
+function validateString(form_name, element_name) {
+  return (document.forms[form_name].elements[element_name].value.length > 0);
+}
+
+function validateSelection(form_name, element_name) {
+  return (document.forms[form_name].elements[element_name].selectedIndex > 0);
+}
+
+function validateCheckBox(form_name, element_name) {
+  return document.forms[form_name].elements[element_name].checked;
+}
+
+function validateCleanString(form_name, element_name) {
+  return testRegExp(form_name, element_name, '^[A-Za-z0-9_]+$');
+}
+
+function validateEmail(form_name, element_name) {
+  return testRegExp(form_name, element_name, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
+}
+
+function validateAbsUrl(form_name, element_name) {
+  return testRegExp(form_name, element_name, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+$');
+}
+
+function validateNumber(form_name, element_name, allow_blank) {
+  return (!allow_blank && value == '') ? false : testRegExp(form_name, element_name, '^-?[0-9]*\\.?[0-9]*$');
+}
+
+function validateSize(form_name, element_name,) {
+  return testRegExp(form_name, element_name, '^[0-9]+(px|%)?$');
+}
+
+function validateID(form_name, element_name,) {
+  return testRegExp(form_name, element_name, '^[A-Za-z_]([A-Za-z0-9_])*$');
+}

Added: trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/tiny_mce.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,90 @@
+<?php
+function tep_load_html_editor() {
+if (( HTML_EDITOR_COMPRESS  == 'true' ) && (!extension_loaded('zlib')) )  {
+    if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') ){ 
+         define('HTML_EDITOR_LOADER','tiny_mce_gzip.php'); 
+    } else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) {
+         define('HTML_EDITOR_LOADER','tiny_mce.js'); 
+    } else {
+         define('HTML_EDITOR_LOADER','tiny_mce.js');
+         }
+    } else { 
+
+        define('HTML_EDITOR_LOADER','tiny_mce.js');
+        }
+    echo "\n" . '<script type="text/javascript" src="' . HTTP_SERVER . DIR_WS_ADMIN . DIR_WS_INCLUDES . 'javascript/tiny_mce/' . HTML_EDITOR_LOADER . '"></script>' . "\n";
+    echo '<script language="javascript" type="text/javascript" src=' . HTTP_SERVER . DIR_WS_ADMIN . DIR_WS_INCLUDES . 'javascript/tiny_mce/utils/form_utils.js"></script>' . "\n";
+}// end tep_insert_html_editor
+
+  function tep_insert_html_editor ( $textarea, $tool_bar_set = HTML_EDITOR_TOOLBAR_SET, $editor_height = HTML_EDITOR_HEIGHT ) { 
+// Current stylesheet to be loaded into editor for enhanced editing.
+if (HTML_EDITOR_LOAD_CSS == 'true') {
+$template_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_TEMPLATE'");
+$template = tep_db_fetch_array($template_query);
+$template_default_style_css = 'content_css : "' . HTTP_SERVER . DIR_WS_TEMPLATES . $template['configuration_value'] . '/stylesheet.css",';
+}
+// End CSS Code
+    switch ($tool_bar_set) {
+    case "simple":
+    echo '<script language="javascript" type="text/javascript">
+    tinyMCE.init({
+    theme : "advanced",
+    mode : "exact",
+    elements : "'.$textarea.'",
+    width : "'.HTML_EDITOR_WIDTH.'",
+    height : "'.$editor_height.'",
+    convert_urls : "false",
+    convert_newlines_to_brs : "'.HTML_EDITOR_CONVERT_NEW_LINE.'",
+    language : "'.DEFAULT_LANGUAGE.'",
+    lang_list : "en,de,fr,pt_br,nl,pl,se",
+    theme_advanced_toolbar_location : "'.HTML_EDITOR_TOOLBAR_LOCATION.'",
+    theme_advanced_toolbar_align : "'.HTML_EDITOR_TOOLBAR_ALIGN.'",
+    theme_advanced_path_location : "'.HTML_EDITOR_PATH_LOCATION.'",
+    plugin_preview_pageurl : "../../plugins/preview/preview.php",
+    plugins : "advimage,advlink,iespell,preview,searchreplace,contextmenu,paste,lorem",
+    theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,|,formatselect,fontselect,fontsizeselect",
+    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,outdent,indent,|,search,replace,separator,cleanup,removeformat,hr,sub,sup,forecolor,backcolor,charmap,visualaid,anchor,|,code,lorem",
+    theme_advanced_buttons3 : ""
+  });
+  </script>';
+  break;
+    case "advanced":
+  echo '<script language="javascript" type="text/javascript">
+  tinyMCE.init({
+    mode : "exact",
+    elements : "'.$textarea.'",
+    width : "'.HTML_EDITOR_WIDTH.'",
+    height : "'.$editor_height.'",
+    theme : "advanced",
+    convert_urls : "false",
+    convert_newlines_to_brs : "'.HTML_EDITOR_CONVERT_NEW_LINE.'",
+    language : "'.DEFAULT_LANGUAGE.'",
+    lang_list : "en,de,fr,pt_br,nl,pl,se",
+    plugins : "style,layer,table,advimage,advlink,iespell,preview,flash,searchreplace,contextmenu,paste,directionality,fullscreen,ibrowser,filemanager,lorem",
+    theme_advanced_buttons1_add_before : "newdocument,separator",
+    theme_advanced_buttons1_add : "fontselect,fontsizeselect",
+    theme_advanced_buttons2_add : "separator,preview,separator,forecolor,backcolor,separator,ltr,rtl",
+    theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
+    theme_advanced_buttons3_add_before : "tablecontrols,separator,insertlayer,moveforward,movebackward,absolute",
+    theme_advanced_buttons3_add : "iespell,flash,separator,fullscreen,|,styleprops",
+    theme_advanced_buttons4 : "ibrowser,|,filemanager,|,lorem",
+    theme_advanced_toolbar_location : "'.HTML_EDITOR_TOOLBAR_LOCATION.'",
+    theme_advanced_toolbar_align : "'.HTML_EDITOR_TOOLBAR_ALIGN.'",
+    theme_advanced_path_location : "'.HTML_EDITOR_PATH_LOCATION.'",
+    '.$template_default_style_css.'
+    plugin_preview_pageurl : "../../plugins/preview/preview.php",
+    paste_use_dialog : false,
+    theme_advanced_resizing : true,
+    theme_advanced_resize_horizontal : true,
+    paste_auto_cleanup_on_paste : true,
+    paste_convert_headers_to_strong : false,
+    paste_strip_class_attributes : "all",
+    paste_remove_spans : true,
+    paste_remove_styles : true,
+    debug : false 
+  });
+  </script>';
+    break;
+  }
+} 
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/javascript/webmakers_added_js.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/javascript/webmakers_added_js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/javascript/webmakers_added_js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+  /*
+  WebMakers.com Added: Java Scripts
+  */
+?>
+<?php /* BOF: WebMakers.com Added: PopUp Window */ ?>
+<SCRIPT LANGUAGE="JavaScript">
+<!-- Begin
+function NewWindow(mypage, myname, w, h, scroll) {
+var winl = (screen.width - w) / 2;
+var wint = (screen.height - h) / 2;
+winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
+win = window.open(mypage, myname, winprops)
+if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
+}
+//  End -->
+</script>
+<?php /* EOF: WebMakers.com Added: PopUp Window */ ?>
+<?php /* BOF: WebMakers.com Added: PopUp Window */ ?>
+<SCRIPT LANGUAGE="JavaScript">
+<!-- Begin
+function NewWindow2(mypage, myname, w, h, scroll) {
+var winl = (screen.width - w) / 2;
+var wint = (screen.height - h) / 2;
+winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
+win = window.open(mypage, myname, winprops)
+if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
+}
+//  End -->
+</script>
+<?php /* EOF: WebMakers.com Added: PopUp Window */ ?>

Added: trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_english.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_english.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_english.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+define('BOX_HEADING_GV_ADMIN', 'Vouchers/Coupons');
+define('BOX_GV_ADMIN_QUEUE', 'Gift Voucher Queue');
+define('BOX_GV_ADMIN_MAIL', 'Mail Gift Voucher');
+define('BOX_GV_ADMIN_SENT', 'Gift Vouchers sent');
+define('BOX_COUPON_ADMIN','Coupon Admin');
+
+define('IMAGE_RELEASE', 'Redeem Gift Voucher');
+
+define('_JANUARY', 'January');
+define('_FEBRUARY', 'February');
+define('_MARCH', 'March');
+define('_APRIL', 'April');
+define('_MAY', 'May');
+define('_JUNE', 'June');
+define('_JULY', 'July');
+define('_AUGUST', 'August');
+define('_SEPTEMBER', 'September');
+define('_OCTOBER', 'October');
+define('_NOVEMBER', 'November');
+define('_DECEMBER', 'December');
+
+define('TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> gift vouchers)');
+define('TEXT_DISPLAY_NUMBER_OF_COUPONS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> coupons)');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Products ID');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+define('TEXT_VALID_PRODUCTS_MODEL', 'Products Model');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Category ID');
+define('TEXT_VALID_CATEGORIES_NAME', 'Category Name');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_espanol.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_espanol.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_espanol.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+define('BOX_HEADING_GV_ADMIN', 'Cheques/cupones');
+define('BOX_GV_ADMIN_QUEUE', 'Cola de cheques regalo');
+define('BOX_GV_ADMIN_MAIL', 'Enviar cheques regalo por email');
+define('BOX_GV_ADMIN_SENT', 'Enviados los cheques regalo');
+define('BOX_COUPON_ADMIN','Administración de cupones');
+
+define('IMAGE_RELEASE', 'Amortizar cheque regalo');
+
+define('_JANUARY', 'Enero');
+define('_FEBRUARY', 'Febrero');
+define('_MARCH', 'Marzo');
+define('_APRIL', 'Abril');
+define('_MAY', 'Mayo');
+define('_JUNE', 'Junio');
+define('_JULY', 'Julio');
+define('_AUGUST', 'Agosto');
+define('_SEPTEMBER', 'Septiembre');
+define('_OCTOBER', 'Octubre');
+define('_NOVEMBER', 'Noviembre');
+define('_DECEMBER', 'Diciembre');
+
+define('TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> cheques regalo)');
+define('TEXT_DISPLAY_NUMBER_OF_COUPONS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> cupones)');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Lista de productos');
+define('TEXT_VALID_PRODUCTS_ID', 'ID de productos');
+define('TEXT_VALID_PRODUCTS_NAME', 'Nombre de productos');
+define('TEXT_VALID_PRODUCTS_MODEL', 'Modelo de productos');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Lista de categorías');
+define('TEXT_VALID_CATEGORIES_ID', 'ID de categorías');
+define('TEXT_VALID_CATEGORIES_NAME', 'Nombre de categorías');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_french.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_french.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_french.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+define('BOX_HEADING_GV_ADMIN', 'Bon d\'achat/Coupons');
+define('BOX_GV_ADMIN_QUEUE', 'Ch&egrave;que cadeau en queue');
+define('BOX_GV_ADMIN_MAIL', 'Envoyer par e-mail le ch&egrave;que cadeau');
+define('BOX_GV_ADMIN_SENT', 'Ch&egrave;que cadeau envoy&eacute;');
+define('BOX_COUPON_ADMIN','Administration des coupons');
+
+define('IMAGE_RELEASE', 'Rembourser un Ch&egrave;que cadeau');
+
+define('_JANUARY', 'Janvier');
+define('_FEBRUARY', 'F&eacute;vrier');
+define('_MARCH', 'Mars');
+define('_APRIL', 'Avril');
+define('_MAY', 'Mai');
+define('_JUNE', 'Juin');
+define('_JULY', 'Juillet');
+define('_AUGUST', 'Ao&ucirc;t');
+define('_SEPTEMBER', 'Septembre');
+define('_OCTOBER', 'Octobre');
+define('_NOVEMBER', 'Novembre');
+define('_DECEMBER', 'Decembre');
+
+define('TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS', 'Afficher <b>%d</b> &agrave; <b>%d</b> (sur<b>%d</b> ch&egrave;ques cadeau)');
+define('TEXT_DISPLAY_NUMBER_OF_COUPONS', 'Afficher <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> coupons)');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Liste des Produits');
+define('TEXT_VALID_PRODUCTS_ID', 'ID des Produits');
+define('TEXT_VALID_PRODUCTS_NAME', 'Nom des Produits');
+define('TEXT_VALID_PRODUCTS_MODEL', 'Mod&egrave;le des produits');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Liste des cat&eacute;gories');
+define('TEXT_VALID_CATEGORIES_ID', 'ID des cat&eacute;gories');
+define('TEXT_VALID_CATEGORIES_NAME', 'Nom des cat&eacute;gories');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_german.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_german.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/add_ccgvdc_german.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+define('BOX_HEADING_GV_ADMIN', 'Gutscheine');
+define('BOX_GV_ADMIN_QUEUE', 'Gutschein Warteschlange');
+define('BOX_GV_ADMIN_MAIL', 'Gutschein Email');
+define('BOX_GV_ADMIN_SENT', 'Gutscheine versandt');
+define('BOX_HEADING_COUPON_ADMIN','Rabattkupons');
+define('BOX_COUPON_ADMIN','Kupon Administrator');
+
+define('IMAGE_RELEASE', 'Gutschein einl&ouml;sen');
+
+define('_JANUARY', 'J&auml;nner');
+define('_FEBRUARY', 'Februar');
+define('_MARCH', 'M&auml;rz');
+define('_APRIL', 'April');
+define('_MAY', 'Mai');
+define('_JUNE', 'Juni');
+define('_JULY', 'Juli');
+define('_AUGUST', 'August');
+define('_SEPTEMBER', 'September');
+define('_OCTOBER', 'Oktober');
+define('_NOVEMBER', 'November');
+define('_DECEMBER', 'Dezember');
+
+define('TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Gutscheinen)');
+define('TEXT_DISPLAY_NUMBER_OF_COUPONS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Gutscheinen)');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Artikel Liste');
+define('TEXT_VALID_PRODUCTS_ID', 'Artikelnummer');
+define('TEXT_VALID_PRODUCTS_NAME', 'Artikelbezeichnung');
+define('TEXT_VALID_PRODUCTS_MODEL', 'Artikel-Modell');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Kategorien Liste');
+define('TEXT_VALID_CATEGORIES_ID', 'Kategorienummer');
+define('TEXT_VALID_CATEGORIES_NAME', 'Kategoriebezeichnung');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/affiliate_english.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/affiliate_english.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/affiliate_english.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: affiliate_english.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// reports box text in includes/boxes/affiliate.php
+define('BOX_HEADING_AFFILIATE', 'Affiliates');
+define('BOX_AFFILIATE_SUMMARY', 'Summary');
+define('BOX_AFFILIATE', 'Affiliates');
+define('BOX_AFFILIATE_PAYMENT', 'Payment');
+define('BOX_AFFILIATE_BANNERS', 'Banners');
+define('BOX_AFFILIATE_CONTACT', 'Contact');
+define('BOX_AFFILIATE_SALES', 'Sales');
+define('BOX_AFFILIATE_CLICKS', 'Clicks');
+define('BOX_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_NEWSLETTER_MANAGER', 'Affiliate Newsletter');
+
+define('BOX_TITLE_AFFILIATES', 'Affiliates');
+define('BOX_ENTRY_AFFILIATES', 'Affiliates:');
+define('BOX_ENTRY_CONVERSION', 'Conversion:');
+define('BOX_ENTRY_COMMISSION', 'Commission:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/affiliate_espanol.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/affiliate_espanol.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/affiliate_espanol.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: affiliate_espanol.php,v 1.1.1.1 2004/03/04 23:40:00 ccwjr Exp $
+  Translated by: jparis v1.0
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// reports box text in includes/boxes/affiliate.php
+define('BOX_HEADING_AFFILIATE', 'Asociados');
+define('BOX_AFFILIATE_SUMMARY', 'Resumen');
+define('BOX_AFFILIATE', 'Asociados');
+define('BOX_AFFILIATE_PAYMENT', 'Pagos');
+define('BOX_AFFILIATE_BANNERS', 'Banners');
+define('BOX_AFFILIATE_CONTACT', 'Contacte con nosotros');
+define('BOX_AFFILIATE_SALES', 'Ventas');
+define('BOX_AFFILIATE_CLICKS', 'Clicks');
+define('BOX_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_NEWSLETTER_MANAGER', 'Affiliate Newsletter');
+
+define('BOX_TITLE_AFFILIATES', 'Affiliates');
+define('BOX_ENTRY_AFFILIATES', 'Affiliates:');
+define('BOX_ENTRY_CONVERSION', 'Conversion:');
+define('BOX_ENTRY_COMMISSION', 'Commission:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/affiliate_french.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/affiliate_french.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/affiliate_french.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: affiliate_french.php,v 1.2 2003/09/24 13:57:08 wilt Exp $
+
+  OSC-Affiliate
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  French Creload Team for Creload 6.1  
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// reports box text in includes/boxes/affiliate.php
+define('BOX_HEADING_AFFILIATE', 'Affiliations');
+define('BOX_AFFILIATE_SUMMARY', 'Sommaire');
+define('BOX_AFFILIATE', 'Affiliations');
+define('BOX_AFFILIATE_PAYMENT', 'Paiement');
+define('BOX_AFFILIATE_BANNERS', 'Banni&egrave;res');
+define('BOX_AFFILIATE_CONTACT', 'Contact');
+define('BOX_AFFILIATE_SALES', 'Ventes');
+define('BOX_AFFILIATE_CLICKS', 'Cliques');
+define('BOX_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_NEWSLETTER_MANAGER', 'Affiliate Newsletter');
+
+define('BOX_TITLE_AFFILIATES', 'Affiliates');
+define('BOX_ENTRY_AFFILIATES', 'Affiliates:');
+define('BOX_ENTRY_CONVERSION', 'Conversion:');
+define('BOX_ENTRY_COMMISSION', 'Commission:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/affiliate_german.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/affiliate_german.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/affiliate_german.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: affiliate_german.php,v 1.3 2003/02/16 23:43:29 harley_vb Exp $
+
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// reports box text in includes/boxes/affiliate.php
+define('BOX_HEADING_AFFILIATE', 'Partnerprogramm');
+define('BOX_AFFILIATE_SUMMARY', 'Zusammenfassung');
+define('BOX_AFFILIATE', 'Partner');
+define('BOX_AFFILIATE_PAYMENT', 'Provisionszahlungen');
+define('BOX_AFFILIATE_BANNERS', 'Banner');
+define('BOX_AFFILIATE_CONTACT', 'Kontakt');
+define('BOX_AFFILIATE_SALES', 'Partner Verk&auml;ufe');
+define('BOX_AFFILIATE_CLICKS', 'Klicks');
+define('BOX_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_NEWSLETTER_MANAGER', 'Affiliate Newsletter');
+define('BOX_TITLE_AFFILIATES', 'Partner');
+define('BOX_ENTRY_AFFILIATES', 'Partner:');
+define('BOX_ENTRY_CONVERSION', 'Verk&auml;ufe/Klicks:');
+define('BOX_ENTRY_COMMISSION', 'Provision:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/abandoned_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/abandoned_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/abandoned_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,134 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Abandoned Orders');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('ADDING_TITLE', 'Adding a Product to Order');
+
+define('ADD_PRODUCT', 'Add a Product to Order');
+define('HEADING_ABANDONED', '<B>The shopping basket for this order was abandoned!!! Order ID:  </B>');
+define('TEXT_INFO_ABANDONDED', 'Abandoned');
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_TAX', 'Tax');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_UNIT_PRICE', 'Unit Price');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Total Price');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Customer Notified');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+
+define('ENTRY_CUSTOMER', 'Customer general');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Company');
+define('ENTRY_CUSTOMER_ADDRESS', 'Address');
+define('ENTRY_CUSTOMER_SUBURB', 'Suburb');
+define('ENTRY_CUSTOMER_CITY', 'City');
+define('ENTRY_CUSTOMER_STATE', 'State');
+define('ENTRY_CUSTOMER_POSTCODE', 'Postcode');
+define('ENTRY_CUSTOMER_COUNTRY', 'Country');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Sold To:');
+define('ENTRY_DELIVERY_TO', 'Delivery To:');
+define('ENTRY_SHIP_TO', 'Ship To:');
+define('ENTRY_SHIPPING_ADDRESS', 'Shipping Address:');
+define('ENTRY_BILLING_ADDRESS', 'Billing Address:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Type: ');
+define('ENTRY_CREDIT_CARD_OWNER', 'Owner: ');
+define('ENTRY_CREDIT_CARD_NUMBER', 'CC Number: ');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Expires: ');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Tax:');
+define('ENTRY_SHIPPING', 'Shipping:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'Date Last Updated:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notify Customer:');
+define('ENTRY_NOTIFY_COMMENTS', 'Append Comments:');
+define('ENTRY_PRINTABLE', 'Print Invoice');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Use a negative number -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Add New Product');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+define('TEXT_NO_ORDER_HISTORY', 'No Order History Available');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Order Update');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: Order does not exist.');
+define('SUCCESS_ORDER_UPDATED', 'Success: Order has been successfully updated.');
+define('WARNING_ORDER_NOT_UPDATED', 'Warning: Nothing to change. The order was not updated.');
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choose a product');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Choose an option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Product has no options, so skipping...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'pieces of this product');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Add');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+
+define('DISPLAY_BASKET', 'Display basket');
+define('DONT_ADD_NEW_PRODUCT', "Don't Add New Product");
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/admin_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/admin_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/admin_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: admin_account.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Admin Account');
+
+define('TABLE_HEADING_ACCOUNT', 'My Account');
+
+define('TEXT_INFO_FULLNAME', '<b>Name: </b>');
+define('TEXT_INFO_FIRSTNAME', '<b>Firstname: </b>');
+define('TEXT_INFO_LASTNAME', '<b>Lastname: </b>');
+define('TEXT_INFO_EMAIL', '<b>Email Address: </b>');
+define('TEXT_INFO_PASSWORD', '<b>Password: </b>');
+define('TEXT_INFO_PASSWORD_HIDDEN', '-Hidden-');
+define('TEXT_INFO_PASSWORD_CONFIRM', '<b>Confirm Password: </b>');
+define('TEXT_INFO_CREATED', '<b>Account Created: </b>');
+define('TEXT_INFO_LOGDATE', '<b>Last Access: </b>');
+define('TEXT_INFO_LOGNUM', '<b>Log Number: </b>');
+define('TEXT_INFO_GROUP', '<b>Group Level: </b>');
+define('TEXT_INFO_ERROR', '<font color="red">Email address has already been used! Please try again.</font>');
+define('TEXT_INFO_MODIFIED', 'Modified: ');
+
+define('TEXT_INFO_HEADING_DEFAULT', 'Edit Account ');
+define('TEXT_INFO_HEADING_CONFIRM_PASSWORD', 'Password Confirmation ');
+define('TEXT_INFO_INTRO_CONFIRM_PASSWORD', 'Password:');
+define('TEXT_INFO_INTRO_CONFIRM_PASSWORD_ERROR', '<font color="red"><b>ERROR:</b> wrong password!</font>');
+define('TEXT_INFO_INTRO_DEFAULT', 'Click <b>edit button</b> below to change your account.');
+define('TEXT_INFO_INTRO_DEFAULT_FIRST_TIME', '<br><b>WARNING:</b><br>Hello <b>%s</b>, you just come here for the first time. We recommend you to change your password!');
+define('TEXT_INFO_INTRO_DEFAULT_FIRST', '<br><b>WARNING:</b><br>Hello <b>%s</b>, we recommend you to change your email (<font color="red">admin at localhost</font>) and password!');
+define('TEXT_INFO_INTRO_EDIT_PROCESS', 'All fields are required. Click save to submit.');
+
+define('JS_ALERT_FIRSTNAME',        '- Required: Firstname \n');
+define('JS_ALERT_LASTNAME',         '- Required: Lastname \n');
+define('JS_ALERT_EMAIL',            '- Required: Email address \n');
+define('JS_ALERT_PASSWORD',         '- Required: Password \n');
+define('JS_ALERT_FIRSTNAME_LENGTH', '- Firstname length must be over ');
+define('JS_ALERT_LASTNAME_LENGTH',  '- Lastname length must be over ');
+define('JS_ALERT_PASSWORD_LENGTH',  '- Password length must be over ');
+define('JS_ALERT_EMAIL_FORMAT',     '- Email address format is invalid! \n');
+define('JS_ALERT_EMAIL_USED',       '- Email address has already been used! \n');
+define('JS_ALERT_PASSWORD_CONFIRM', '- Miss typing in Password Confirmation field! \n');
+
+define('ADMIN_EMAIL_SUBJECT', 'Personal Information Change');
+define('ADMIN_EMAIL_TEXT', 'Hello %s,' . "\n\n" . 'Your personal information, perhaps including your password, has been changed.  If this was done without your knowledge or consent please contact the administrator immediatly!' . "\n\n" . 'Website : %s' . "\n" . 'Username: %s' . "\n" . 'Password: %s' . "\n\n" . 'Thanks!' . "\n" . '%s' . "\n\n" . 'This is a system automated response, please do not reply, as it would be unread!');
+
+define('JS_ALERT_FIRSTNAME_1','- Firstname length must over ');
+define('JS_ALERT_LASTNAME_1','- Firstname length must over ');
+define('JS_ALERT_ERROR','The following error(s) occurred:');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/admin_files.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/admin_files.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/admin_files.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: admin_files.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Admin "Boxes" Menu');
+
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_BOXES', 'Boxes');
+define('TABLE_HEADING_FILENAME', 'Filenames');
+define('TABLE_HEADING_GROUPS', 'Groups');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('TEXT_COUNT_BOXES', 'Boxes: ');
+define('TEXT_COUNT_FILES', 'File(s): ');
+
+//categories access
+define('TEXT_INFO_HEADING_DEFAULT_BOXES', 'Boxes: ');
+
+define('TEXT_INFO_DEFAULT_BOXES_INTRO', 'Simply click the green button to install the menu or the red button to uninstall it.<br><br><b>WARNING:</b> If you uninstall the menu, all menu entries will also be removed.');
+define('TEXT_INFO_DEFAULT_BOXES_INSTALLED', ' installed');
+define('TEXT_INFO_DEFAULT_BOXES_NOT_INSTALLED', ' not installed');
+
+define('STATUS_BOX_INSTALLED', 'Installed');
+define('STATUS_BOX_NOT_INSTALLED', 'Not Installed');
+define('STATUS_BOX_REMOVE', 'Remove');
+define('STATUS_BOX_INSTALL', 'Install');
+
+//files access
+define('TEXT_INFO_HEADING_DEFAULT_FILE', 'File: ');
+define('TEXT_INFO_HEADING_DELETE_FILE', 'Remove Confirmation');
+define('TEXT_INFO_HEADING_NEW_FILE', 'Store Files');
+
+define('TEXT_INFO_DEFAULT_FILE_INTRO', 'Click <b>store files</b> button to create a new menu entry in the current box: ');
+define('TEXT_INFO_DELETE_FILE_INTRO', 'Remove <font color="red"><b>%s</b></font> from <b>%s</b> box? ');
+define('TEXT_INFO_NEW_FILE_INTRO', 'Check the <font color="red"><b>left menu</b></font> to make sure you store the right files.');
+
+define('TEXT_INFO_NEW_FILE_BOX', 'Current Box: ');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/admin_members.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/admin_members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/admin_members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<?php
+/*
+  $Id: admin_members.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['gID']) {
+  define('HEADING_TITLE', 'Admin Groups');
+} elseif ($HTTP_GET_VARS['gPath']) {
+  define('HEADING_TITLE', 'Define Groups');
+} else {
+  define('HEADING_TITLE', 'Admin Members');
+}
+
+define('TEXT_COUNT_GROUPS', 'Groups: ');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_EMAIL', 'Email Address');
+define('TABLE_HEADING_PASSWORD', 'Password');
+define('TABLE_HEADING_CONFIRM', 'Confirm Password');
+define('TABLE_HEADING_GROUPS', 'Groups Level');
+define('TABLE_HEADING_CREATED', 'Account Created');
+define('TABLE_HEADING_MODIFIED', 'Account Modified');
+define('TABLE_HEADING_LOGDATE', 'Last Access');
+define('TABLE_HEADING_LOGNUM', 'LogNum');
+define('TABLE_HEADING_LOG_NUM', 'Log Number');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TABLE_HEADING_GROUPS_NAME', 'Groups Name');
+define('TABLE_HEADING_GROUPS_DEFINE', 'Boxes and Files Selection');
+define('TABLE_HEADING_GROUPS_GROUP', 'Level');
+define('TABLE_HEADING_GROUPS_CATEGORIES', 'Categories Permission');
+
+
+define('TEXT_INFO_HEADING_DEFAULT', 'Admin Member ');
+define('TEXT_INFO_HEADING_DELETE', 'Delete Permission ');
+define('TEXT_INFO_HEADING_EDIT', 'Edit Category / ');
+define('TEXT_INFO_HEADING_NEW', 'New Admin Member ');
+
+define('TEXT_INFO_DEFAULT_INTRO', 'Member Group');
+define('TEXT_INFO_DELETE_INTRO', 'Remove <nobr><b>%s</b></nobr> from <nobr>Admin Members?</nobr>');
+define('TEXT_INFO_DELETE_INTRO_NOT', 'You can not delete <nobr>%s group!</nobr>');
+define('TEXT_INFO_EDIT_INTRO', 'Set permission level here: ');
+
+define('TEXT_INFO_FULLNAME', 'Name: ');
+define('TEXT_INFO_FIRSTNAME', 'Firstname: ');
+define('TEXT_INFO_LASTNAME', 'Lastname: ');
+define('TEXT_INFO_EMAIL', 'Email Address: ');
+define('TEXT_INFO_PASSWORD', 'Password: ');
+define('TEXT_INFO_CONFIRM', 'Confirm Password: ');
+define('TEXT_INFO_CREATED', 'Account Created: ');
+define('TEXT_INFO_MODIFIED', 'Account Modified: ');
+define('TEXT_INFO_LOGDATE', 'Last Access: ');
+define('TEXT_INFO_LOGNUM', 'Log Number: ');
+define('TEXT_INFO_GROUP', 'Group Level: ');
+define('TEXT_INFO_ERROR', '<font color="red">Email address has already been used! Please try again.</font>');
+
+define('JS_ALERT_FIRSTNAME', '- Required: Firstname \n');
+define('JS_ALERT_LASTNAME', '- Required: Lastname \n');
+define('JS_ALERT_EMAIL', '- Required: Email address \n');
+define('JS_ALERT_EMAIL_FORMAT', '- Email address format is invalid! \n');
+define('JS_ALERT_EMAIL_USED', '- Email address has already been used! \n');
+define('JS_ALERT_LEVEL', '- Required: Group Member \n');
+
+define('ADMIN_EMAIL_SUBJECT', 'New Admin Member');
+define('ADMIN_EMAIL_TEXT', 'Hi %s,' . "\n\n" . 'You can access the admin panel with the following password. Once you access the admin, please change your password!' . "\n\n" . 'Website : %s' . "\n" . 'Username: %s' . "\n" . 'Password: %s' . "\n\n" . 'Thanks!' . "\n" . '%s' . "\n\n" . 'This is a system automated response, please do not reply, as it would be unread!');
+define('ADMIN_EMAIL_EDIT_SUBJECT', 'Admin Member Profile Edit');
+define('ADMIN_EMAIL_EDIT_TEXT', 'Hi %s,' . "\n\n" . 'Your personal information has been updated by an administrator.' . "\n\n" . 'Website : %s' . "\n" . 'Username: %s' . "\n" . 'Password: %s' . "\n\n" . 'Thanks!' . "\n" . '%s' . "\n\n" . 'This is a system automated response, please do not reply, as it would be unread!');
+
+define('TEXT_INFO_HEADING_DEFAULT_GROUPS', 'Admin Group ');
+define('TEXT_INFO_HEADING_DELETE_GROUPS', 'Delete Group ');
+
+define('TEXT_INFO_DEFAULT_GROUPS_INTRO', '<b>NOTE:</b><li><b>edit:</b> edit group name.</li><li><b>delete:</b> delete group.</li><li><b>define:</b> define and change group access.</li>');
+define('TEXT_INFO_DELETE_GROUPS_INTRO', 'It will also delete members of this group. Are you sure want to delete <nobr><b>%s</b> group?</nobr>');
+define('TEXT_INFO_DELETE_GROUPS_INTRO_NOT', 'You can not delete this groups!');
+define('TEXT_INFO_GROUPS_INTRO', 'Give an unique group name. Click next to submit.');
+
+define('TEXT_INFO_HEADING_GROUPS', 'New Group');
+define('TEXT_INFO_GROUPS_NAME', ' <b>Group Name:</b><br>Give an unique group name. Then, click next to submit.<br>');
+define('TEXT_INFO_GROUPS_NAME_FALSE', '<font color="red"><b>ERROR:</b> The group name must have at least 5 characters!</font>');
+define('TEXT_INFO_GROUPS_NAME_USED', '<font color="red"><b>ERROR:</b> Group name has already been used!</font>');
+define('TEXT_INFO_GROUPS_LEVEL', 'Group Level: ');
+define('TEXT_INFO_GROUPS_BOXES', '<b>Boxes Permission:</b><br>Give access to selected boxes.');
+define('TEXT_INFO_GROUPS_BOXES_INCLUDE', 'Include files stored in: ');
+
+define('TEXT_INFO_EDIT_GROUP_INTRO', 'Edit Group Name: ');
+
+define('TEXT_INFO_HEADING_DEFINE', 'Define Group');
+if ($HTTP_GET_VARS['gPath'] == 1) {
+  define('TEXT_INFO_DEFINE_INTRO', '<b>%s :</b><br>You can not change file permission for this group.<br><br>');
+} else {
+  define('TEXT_INFO_DEFINE_INTRO', '<b>%s :</b><br>Change permission for this group by selecting or unselecting boxes and files provided. Click <b>save</b> to save the changes.<br><br>');
+}
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_affiliates.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_affiliates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_affiliates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: affiliate_affiliates.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliates');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_FIRSTNAME', 'First Name');
+define('TABLE_HEADING_LASTNAME', 'Last Name');
+define('TABLE_HEADING_USERHOMEPAGE', 'Homepage');
+define('TABLE_HEADING_COMMISSION','Commission');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_AFFILIATE_ID','Affiliate ID');
+
+define('TEXT_DATE_ACCOUNT_CREATED', 'Account Created:');
+define('TEXT_DATE_ACCOUNT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_DATE_LAST_LOGON', 'Last Logon:');
+define('TEXT_INFO_NUMBER_OF_LOGONS', 'Number of Logons:');
+define('TEXT_INFO_COMMISSION','Commission');
+define('TEXT_INFO_NUMBER_OF_SALES', 'Number of Sales:');
+define('TEXT_INFO_COUNTRY', 'Country:');
+define('TEXT_INFO_SALES_TOTAL', 'Total Sales:');
+define('TEXT_INFO_AFFILIATE_TOTAL', 'Commission:');
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this affiliate?');
+define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Delete Affiliate');
+define('TEXT_DISPLAY_NUMBER_OF_AFFILIATES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> affiliates)');
+
+define('ENTRY_AFFILIATE_PAYMENT_DETAILS', 'Payable to:');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK','Check Payee Name:');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL','PayPal Account Email:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME','Bank Name:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME','Account Name:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER','Account Number:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER','ABA/BSB number (branch number)');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE','SWIFT Code ');
+define('ENTRY_AFFILIATE_COMPANY','Company');
+define('ENTRY_AFFILIATE_COMPANY_TAXID','Tax-Id.:');
+define('ENTRY_AFFILIATE_HOMEPAGE','Homepage');
+define('ENTRY_AFFILIATE_COMMISSION',' Pay Per Sale Payment % Rate');
+
+define('CATEGORY_COMMISSION','Individual Commission');
+define('CATEGORY_PAYMENT_DETAILS','You get your money by:');
+
+define('TYPE_BELOW', 'Type below');
+define('PLEASE_SELECT', 'Select One');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_banner_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_banner_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_banner_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: affiliate_banner_statistics.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Banner Statistics');
+
+define('TABLE_HEADING_SOURCE', 'Source');
+define('TABLE_HEADING_VIEWS', 'Views');
+define('TABLE_HEADING_CLICKS', 'Clicks');
+
+define('TEXT_BANNERS_DATA', 'D<br>a<br>t<br>a');
+define('TEXT_BANNERS_DAILY_STATISTICS', '%s Daily Statistics For %s %s');
+define('TEXT_BANNERS_MONTHLY_STATISTICS', '%s Monthly Statistics For %s');
+define('TEXT_BANNERS_YEARLY_STATISTICS', '%s Yearly Statistics');
+
+define('STATISTICS_TYPE_DAILY', 'Daily');
+define('STATISTICS_TYPE_MONTHLY', 'Monthly');
+define('STATISTICS_TYPE_YEARLY', 'Yearly');
+
+define('TITLE_TYPE', 'Type:');
+define('TITLE_YEAR', 'Year:');
+define('TITLE_MONTH', 'Month:');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Error: Graphs directory does not exist. Please create a \'graphs\' directory inside \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Error: Graphs directory is not writeable.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.0 2002/09/29 SDK
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 -2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Banner Manager');
+
+define('TABLE_HEADING_BANNERS', 'Banners');
+define('TABLE_HEADING_GROUPS', 'Groups');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATISTICS', 'Statistics');
+define('TABLE_HEADING_PRODUCT_ID', 'Product ID');
+define('TEXT_VALID_CATEGORIES_LIST', 'Available Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Category #');
+define('TEXT_VALID_CATEGORIES_NAME', 'Categories Name');
+define('TABLE_HEADING_CATEGORY_ID', 'Cat ID');
+define('TEXT_BANNERS_LINKED_CATEGORY','Category ID');
+define('TEXT_BANNERS_LINKED_CATEGORY_NOTE','If you want to link the Banner to a specific CATEGORY enter its CATEGORY ID here. If you want to link to the default page enter "0"');
+define('TEXT_AFFILIATE_VALIDCATS', 'Click Here:');
+define('TEXT_AFFILIATE_CATEGORY_BANNER_VIEW', 'to view available CATEGORIES.');
+define('TEXT_AFFILIATE_CATEGORY_BANNER_HELP', 'Select the category number from the popup window and enter the number in the Category ID field.');
+
+define('TEXT_BANNERS_TITLE', 'Banner Title:');
+define('TEXT_BANNERS_GROUP', 'Banner Group:');
+define('TEXT_BANNERS_NEW_GROUP', ', or enter a new banner group below');
+define('TEXT_BANNERS_IMAGE', 'Image:');
+define('TEXT_BANNERS_IMAGE_LOCAL', ', or enter local file from your server below');
+define('TEXT_BANNERS_IMAGE_TARGET', 'Image Target (Save To):');
+define('TEXT_BANNERS_HTML_TEXT', 'HTML Text:');
+define('TEXT_AFFILIATE_BANNERS_NOTE', '<b>Banner Notes:</b><ul><li>Use an image or HTML text for the banner - not both.</li><li>HTML Text has priority over an image</li></ul>');
+
+define('TEXT_BANNERS_LINKED_PRODUCT','Product ID');
+define('TEXT_BANNERS_LINKED_PRODUCT_NOTE','If you want to link the Banner to a specific product enter its Products ID here. If you want to link to the default page enter "0"');
+
+define('TEXT_BANNERS_DATE_ADDED', 'Date Added:');
+define('TEXT_BANNERS_STATUS_CHANGE', 'Last Editied: %s');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available products.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the product number from the popup window and enter the number in the Product ID field.');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Available Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Product #');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this banner?');
+define('TEXT_INFO_DELETE_IMAGE', 'Delete banner image');
+
+define('SUCCESS_BANNER_INSERTED', 'Success: The banner has been inserted.');
+define('SUCCESS_BANNER_UPDATED', 'Success: The banner has been updated.');
+define('SUCCESS_BANNER_REMOVED', 'Success: The banner has been removed.');
+
+define('ERROR_BANNER_TITLE_REQUIRED', 'Error: Banner title required.');
+define('ERROR_BANNER_GROUP_REQUIRED', 'Error: Banner group required.');
+define('ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Target directory does not exist.');
+define('ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Target directory is not writeable.');
+define('ERROR_IMAGE_DOES_NOT_EXIST', 'Error: Image does not exist.');
+define('ERROR_IMAGE_IS_NOT_WRITEABLE', 'Error: Image can not be removed.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Clickthroughs');
+
+define('TABLE_HEADING_ONLINE', 'Clickthroughs');
+define('TABLE_HEADING_AFFILIATE_USERNAME', 'Affiliate');
+define('TABLE_HEADING_IPADDRESS', 'IP Address');
+define('TABLE_HEADING_ENTRY_TIME', 'Time');
+define('TABLE_HEADING_BROWSER', 'Browser');
+define('TABLE_HEADING_ENTRY_DATE', 'Date');
+define('TABLE_HEADING_CLICKED_PRODUCT','Clicked Product');
+define('TABLE_HEADING_REFERRAL_URL', 'Refering URL');
+
+define('TEXT_NO_CLICKS', 'No Clickthroughs have been recorded');
+define('TEXT_DISPLAY_NUMBER_OF_CLICKS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> clickthroughs)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Send Email To Affiliates');
+
+define('TEXT_AFFILIATE', 'Affiliate:');
+define('TEXT_SUBJECT', 'Subject:');
+define('TEXT_FROM', 'From:');
+define('TEXT_MESSAGE', 'Message:');
+define('TEXT_SELECT_AFFILIATE', 'Select Affiliate');
+define('TEXT_ALL_AFFILIATES', 'All Affiliates');
+define('TEXT_NEWSLETTER_AFFILIATES', 'To All Affiliate Newsletter Subscribers');
+
+define('NOTICE_EMAIL_SENT_TO', 'Notice: Email sent to: %s');
+define('ERROR_NO_AFFILIATE_SELECTED', 'Error: No Affiliate has been selected.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: affiliate_invoice.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Invoice');
+
+define ('TEXT_AFFILIATE','Affiliate');
+define ('TEXT_AFFILIATE_PAYMENT','Payment');
+define ('TEXT_AFFILIATE_BILLED','Billing Day');
+define('TABLE_HEADING_ORDER_ID', 'Order ID');
+define('TABLE_HEADING_ORDER_DATE', 'Date');
+define('TABLE_HEADING_ORDER_VALUE', 'Order Value');
+define('TABLE_HEADING_COMMISSION_RATE', 'Commission Rate');
+define('TABLE_HEADING_COMMISSION_VALUE', 'Commission Value');
+define('TABLE_HEADING_TOTAL', 'Total');
+
+define('TEXT_SUB_TOTAL', 'Sub-Total');
+define('TEXT_TAX', 'Tax');
+define('TEXT_TOTAL', 'Total');
+define('ENTRY_PERCENT', '%');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: affiliate_news.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate News / Announcements');
+define('TABLE_HEADING_AFFILIATE_NEWS', 'Affiliate News');
+
+define('TABLE_HEADING_AFFILIATE_NEWS_HEADLINE', 'Headline');
+define('TABLE_HEADING_AFFILIATE_NEWS_ACTION', 'Action');
+define('TABLE_HEADING_AFFILIATE_NEWS_STATUS', 'Status');
+
+define('TEXT_NEWS_ITEMS', 'News Items:');
+define('TEXT_INFO_HEADING_DELETE_ITEM', 'Delete Item');
+define('TEXT_DELETE_ITEM_INTRO', 'Are you sure you want to permanently delete this item?');
+
+define('TEXT_AFFILIATE_NEWS_HEADLINE', 'Headline');
+define('TEXT_AFFILIATE_NEWS_CONTENT', 'Content');
+
+define('IMAGE_NEW_NEWS_ITEM', 'New news item');
+
+// npe admin begin #add
+define('TEXT_AFFILIATE_NEWS_CONTENT_DELETE', 'Delete displayed news in this language!');
+define('EMPTY_CATEGORY', 'Empty news');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'There are no news articles which can be displayed to your affiliate partners.');
+// npe admin begin #add
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: affiliate_newsletters.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Newsletter Manager');
+
+define('TABLE_HEADING_NEWSLETTERS', 'Newsletters');
+define('TABLE_HEADING_SIZE', 'Size');
+define('TABLE_HEADING_MODULE', 'Module');
+define('TABLE_HEADING_SENT', 'Sent');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_NEWSLETTER_MODULE', 'Module:');
+define('TEXT_NEWSLETTER_TITLE', 'Newsletter Title:');
+define('TEXT_NEWSLETTER_CONTENT', 'Content:');
+
+define('TEXT_NEWSLETTER_DATE_ADDED', 'Date Added:');
+define('TEXT_NEWSLETTER_DATE_SENT', 'Date Sent:');
+
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this newsletter?');
+
+define('TEXT_PLEASE_WAIT', 'Please wait .. sending emails ..<br><br>Please do not interrupt this process!');
+define('TEXT_FINISHED_SENDING_EMAILS', 'Finished sending e-mails!');
+
+define('ERROR_NEWSLETTER_TITLE', 'Error: Newsletter title required');
+define('ERROR_NEWSLETTER_MODULE', 'Error: Newsletter module required');
+define('ERROR_REMOVE_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before deleting it.');
+define('ERROR_EDIT_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before editing it.');
+define('ERROR_SEND_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before sending it.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Payment');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_STATUS','Status:');
+
+define('TEXT_ALL_PAYMENTS','All Payments');
+define('TEXT_NO_PAYMENT_HISTORY', 'No Payment History Available');
+
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_AFILIATE_NAME', 'Affiliate');
+define('TABLE_HEADING_PAYMENT','Payment (incl.)');
+define('TABLE_HEADING_NET_PAYMENT','Payment (excl.)');
+define('TABLE_HEADING_DATE_BILLED','Date Billed');
+define('TABLE_HEADING_NEW_VALUE', 'New Value');
+define('TABLE_HEADING_OLD_VALUE', 'Old Value');
+define('TABLE_HEADING_AFFILIATE_NOTIFIED', 'Affiliate Notified');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+
+define('TEXT_DATE_PAYMENT_BILLED','Billed:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED','Last modified:');
+define('TEXT_AFFILIATE_PAYMENT','Affiliate earned payment');
+define('TEXT_AFFILIATE_BILLED','Paymentday');
+define('TEXT_AFFILIATE','Affiliate');
+
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Delete Payment');
+define('TEXT_INFO_DELETE_INTRO','Are you sure you want to delete this payment?');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> payments)');
+
+define('TEXT_AFFILIATE_PAYING_POSSIBILITIES','You can pay your Affiliate by:');
+define('TEXT_AFFILIATE_PAYMENT_CHECK','Check:');
+define('TEXT_AFFILIATE_PAYMENT_CHECK_PAYEE','Payable to:');
+define('TEXT_AFFILIATE_PAYMENT_PAYPAL','PayPal:');
+define('TEXT_AFFILIATE_PAYMENT_PAYPAL_EMAIL','PayPal Acount Email:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_TRANSFER','Banktransfer:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_NAME','Bank Name:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME','Account Name:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER','Account Number:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER','ABA/BSB number (branch number):');
+define('TEXT_AFFILIATE_PAYMENT_BANK_SWIFT_CODE','SWIFT Code:');
+
+define('IMAGE_AFFILIATE_BILLING','Start Billing Engine');
+
+define('ERROR_PAYMENT_DOES_NOT_EXIST','Payment does not exist');
+
+define('SUCCESS_BILLING','Your Affiliates have been sucessfully billed');
+define('SUCCESS_PAYMENT_UPDATED','Your Affiliates Payment Requests have been sucessfully generated');
+
+define('PAYMENT_STATUS','Payment Status');
+define('PAYMENT_NOTIFY_AFFILIATE', 'Notify Affiliate');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Payment Update');
+define('EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER', 'Payment Number:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
+define('EMAIL_TEXT_PAYMENT_BILLED', 'Date billed');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Your payment has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
+define('EMAIL_TEXT_NEW_PAYMENT', 'A new invoice arrived to your payments' . "\n");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: affiliate_sales.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Sales');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_ONLINE', 'Click-throughs');
+define('TABLE_HEADING_AFFILIATE', 'Affiliate');
+define('TABLE_HEADING_DATE', 'Date');
+define('TABLE_HEADING_PERCENTAGE','Commission Rate');
+define('TABLE_HEADING_SALES', 'Sales');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ORDER_ID', 'Order ID');
+define('TABLE_HEADING_VALUE', 'Value');
+define('TEXT_NO_SALES', 'No Sales have been recorded');
+
+define('TEXT_DELETED_ORDER_BY_ADMIN', 'Deleted (Admin)');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> sales)');
+define('TEXT_INFORMATION_SALES_TOTAL', 'Total Value of Affiliate Sales:');
+define('TEXT_INFORMATION_AFFILIATE_TOTAL', 'Total Value of Affiliate Commissions:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: affiliate_statistics.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Statistics');
+define('TEXT_SUMMARY_TITLE', 'Affiliate Statistics');
+define('TEXT_IMPRESSIONS', 'Total Banner Impressions: ');
+define('TEXT_VISITS', 'Total Affiliate Visits: ');
+define('TEXT_TRANSACTIONS', 'Total Affiliate Transactions: ');
+define('TEXT_AFFILIATE_NAME', 'Name of Affiliate: ');
+define('TEXT_AFFILIATE_JOINDATE', 'Date Affiliate Joined: ');
+define('TEXT_CONVERSION', 'Conversion: ');
+define('TEXT_AMOUNT', 'Total Affiliate Sales: ');
+define('TEXT_AVERAGE', 'Average Affiliate Payout/Sale: ');
+define('TEXT_COMMISSION_RATE', 'Commission Rate: ');
+define('TEXT_PAYPERSALE_RATE', 'Pay Per Sale Rate: ');
+define('TEXT_CLICKTHROUGH_RATE', 'Clickthrough Rate: ');
+define('TEXT_COMMISSION', 'Total Affiliate Commission : ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Click on [?] to see a description of each category.');
+define('HEADING_SUMMARY_HELP', 'Affiliate Help');
+define('TEXT_IMPRESSIONS_HELP', '<i>Impressions</i> displays the total number of times a banner or link has been displayed in the given time period.');
+define('TEXT_VISITS_HELP', '<i>Visits</i> represents the total number of click-throughs by visitors from your website.');
+define('TEXT_TRANSACTIONS_HELP', '<i>Transactions</i> represents the total number successful transactions accredited to you');
+define('TEXT_CONVERSION_HELP', '<i>Conversions</i> represents the percentage of visitors (click-throughs) completing a transaction.');
+define('TEXT_AMOUNT_HELP', '<i>Amount</i> represents the total sales value accredited to you.');
+define('TEXT_AVERAGE_HELP', '<i>Average</i> represents the average sales value accredited to you.');
+define('TEXT_COMMISSION_RATE_HELP', '<i>Commission Rate</i>  represents the rate you are paid for sales in a percentage format.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<i>Clickthrough Rate</i>  represents the rate you are paid for clickthroughs on a per click basis');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<i>Pay Per Sale Rate</i>  represents the rate you are paid for sales on a sale by sale basis.');
+define('TEXT_COMMISSION_HELP', '<i>Commission</i>  represents the total commission owed to you');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Summary');
+define('TEXT_SUMMARY_TITLE', 'Affiliate Summary');
+define('TEXT_IMPRESSIONS', 'Total Banner Impressions: ');
+define('TEXT_VISITS', 'Total Affiliate Visits: ');
+define('TEXT_TRANSACTIONS', 'Total Affiliate Transactions: ');
+define('TEXT_AFFILIATES', 'Number of Affiliates: ');
+define('TEXT_CONVERSION', 'Conversion: ');
+define('TEXT_AMOUNT', 'Total Affiliate Sales: ');
+define('TEXT_AVERAGE', 'Average Affiliate Sale: ');
+define('TEXT_COMMISSION_RATE', 'Default Commission Rate: ');
+define('TEXT_PAYPERSALE_RATE', 'Default Pay Per Sale Rate: ');
+define('TEXT_CLICKTHROUGH_RATE', 'Default Click-through Rate: ');
+define('TEXT_COMMISSION', 'Total Affiliate Commission : ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Click on [?] to see a description of each category.');
+define('HEADING_SUMMARY_HELP', 'Affiliate Help');
+define('TEXT_IMPRESSIONS_HELP', '<i>Total Banner Impressions</i> displays the total number of times a banner or link has been displayed in the given time period.');
+define('TEXT_VISITS_HELP', '<i>Total Affiliate Visits</i> represents the total number of click-throughs by visitors from your website.');
+define('TEXT_TRANSACTIONS_HELP', '<i>Total Affiliate Transactions</i> represents the total number successful transactions accredited to you');
+define('TEXT_CONVERSION_HELP', '<i>Conversion</i> represents the percentage of visitors (click-throughs) completing a transaction.');
+define('TEXT_AMOUNT_HELP', '<i>Total Affiliate Sales</i> represents the total sales value of delivered orders accredited to you.');
+define('TEXT_AVERAGE_HELP', '<i>Average Affiliate Sale</i> represents the average sales value accredited to you.');
+define('TEXT_COMMISSION_RATE_HELP', '<i>Default Commission Rate</i>  represents the rate you are paid for sales in a percentage format.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<i>Default Clickthrough Rate</i>  represents the rate you are paid for click-throughs on a per click basis');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<i>Default Pay Per Sale Rate</i>  represents the rate you are paid for sales on a sale by sale basis.');
+define('TEXT_COMMISSION_HELP', '<i>Total Affiliate Commission</i>  represents the total commission of delivered orders owed to you');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+
+define('IMAGE_BANNERS','Banners');
+define('IMAGE_CLICKTHROUGHS','Clickthrough Report');
+define('IMAGE_SALES','Sales Report');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/algo_fraud_screener.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/algo_fraud_screener.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/algo_fraud_screener.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<?php
+/*
+  $Id: orders.php,v 1.25 2003/06/20 00:28:44 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// AlgoZone - Algozone Fraud Screen Tool definitions
+
+define('ALGO_FS_DISTANCE', '<b>Distance(mi/km)</b> ');
+define('ALGO_FS_DISTANCE_M', '<b>Distance(m) </b>');
+define('ALGO_FS_DISTANCE_K', '<b>Distance(k) </b>');
+define('ALGO_FS_COUNTRY', '<b>Country Match  </b>');
+define('ALGO_FS_CODE', '<b>Country Code  </b>');
+define('ALGO_FS_FREE_EMAIL', '<b>Free Email  </b>');
+define('ALGO_FS_ANONYMOUS', '<b>Anonymous Proxy  </b>');
+define('ALGO_FS_SCORE', '<b>Score  </b>');
+define('ALGO_FS_FRAUD_LEVEL', '<b>Fraud Level  </b>');
+define('ALGO_FS_BIN_MATCH', '<b>Bin Match  </b>');
+define('ALGO_FS_BANK_COUNTRY', '<b>Bank Country  </b>');
+define('ALGO_FS_ERR', '<b>Error  </b>');
+define('ALGO_FS_PROXY_LEVEL', '<b>Proxy Level  </b>');
+define('ALGO_FS_SPAM', '<b>Spam Level  </b>');
+define('ALGO_FS_BANK_NAME', '<b>Bank Name  </b>');
+define('ALGO_FS_BANK_NAME_MATCH', '<b>Bank Name Match  </b>');
+define('ALGO_FS_BANK_PHONE', '<b>Bank Phone  </b>');
+define('ALGO_FS_BANK_PHONE_MATCH', '<b>Bank Phone Match  </b>');
+define('ALGO_FS_IP', '<b>IP Address  </b>');
+define('ALGO_FS_IP_ISP', '<b>ISP  </b>');
+define('ALGO_FS_IP_ISP_ORG', '<b>ISP Org  </b>');
+define('ALGO_FS_IP_CITY', '<b>City   </b>');
+define('ALGO_FS_IP_REGION', '<b>Region   </b>');
+define('ALGO_FS_IP_LATITUDE', '<b>Latitude   </b>');
+define('ALGO_FS_IP_LONGITUDE', '<b>Longitude   </b>');
+define('ALGO_FS_ALGOZONE', '<b>*NOTE:  You need to be subscribed to Premium Services at AlgoZone.com for the following fields </b>');
+define('ALGO_FS_HI_RISK', '<b>High Risk Country  </b>');
+define('ALGO_FS_CUST_PHONE', '<b>Phone Match  </b>');
+define('ALGO_FS_DETAILS', 'See <a href="http://www.algozone.com/" target="_blank"><u>AlgoZone.com</u></a> for explanation of fields');
+
+define('ALGO_FS_BREQUEST', 'Verify Bank Info'); 
+define('ALGO_HELP_PREM_OPT', '*** - values available with fraud screen paid service'); 
+
+define('FS_HELP_DISTANCE', 'Distance from IP address to Billing Location in miles/kilometers (large distance == higher risk)');
+define('FS_HELP_COUNTRY_MATCH', 'Whether country of IP address matches billing address country (mismatch == higher risk)');
+define('FS_HELP_COUNTRY_CODE', 'Country Code of the IP address');
+define('FS_HELP_EMAIL','Whether e-mail is from free e-mail provider (free e-mail == higher risk)');
+define('FS_HELP_ANONYMOUS_IP','Whether IP address is Anonymous Proxy (anonymous proxy == very high risk)');
+define('FS_HELP_BANK_COUNTRY','Country Code of the bank which issued the credit card based on BIN number');
+define('FS_HELP_BIN_MATCH','Whether country of issuing bank based on BIN number matches billing address country');
+define('FS_HELP_BANK_NAME_MATCH','Whether name of issuing bank matches inputed binName. A return value of Yes provides a positive indication that cardholder is in possession of credit card.');
+define('FS_HELP_BANK_NAME','Name of the bank which issued the credit card based on BIN number');
+define('FS_HELP_BANK_PHONE_MATCH','Whether customer service phone number matches inputed binPhone. A return value of Yes provides a positive indication that cardholder is in possession of credit card.');
+define('FS_HELP_BANK_PHONE','Customer service phone number listed on back of credit card');
+define('FS_HELP_PHONE_IN_BILLING_LOC','Whether the customer phone number is in the billing location. A return value of Yes provides a positive indication that the phone number listed belongs to the cardholder. Currently we only support US Phone numbers, in the future we may support other countries.');
+define('FS_HELP_PROXY_LEVEL','Likelihood of IP Address being an Open Proxy');
+define('FS_HELP_SPAM_LEVEL','Likelihood of IP Address being an Spam Source');
+define('FS_HELP_FRAUD_LEVEL','Overall Fraud Risk Factor based on outputs listed above');
+define('FS_HELP_REGION','Estimated Region of the IP address, ISO-3166-2/FIPS 10-4 code');
+define('FS_HELP_CITY','Estimated City of the IP address**');
+define('FS_HELP_LATITUDE','Estimated Latitude of the IP address');
+define('FS_HELP_LONGITUDE','Estimated Longitude of the IP address');
+define('FS_HELP_IP','IP address of the customer. For US addresses, click on the ip address to see a map estimating where the customer is located.');
+define('FS_HELP_ISP','ISP of the IP address');
+define('FS_HELP_ORG','Organization of the IP address');
+define('FS_HELP_IS_HI_RISK_COUNTRY','Whether IP address or billing address country is in Belarus, Colombia, Egypt, Indonesia, Lebanon, Macedonia, Malaysia, Nigeria, Pakistan, Ukraine, or Yugoslavia');
+define('FS_HELP_REMAINING_QUERIES','Number of queries remaining in your account, can be used to alert you when you may need to add more queries to your account');
+define('FS_HELP_DEFAULT','<i><b>To get field descriptions, place cursor on the field name<b></i>');
+
+
+define('NO_IP_ADDRESS_RECORDED','*** NO IP ADDRESS RECORDED FOR THIS ORDER');
+define('MAX_COMMENT_0','(Extremely Low risk)');
+define('MAX_COMMENT_1','(Very Low risk)');
+define('MAX_COMMENT_2','(Low risk)');
+define('MAX_COMMENT_3','(Low risk)');
+define('MAX_COMMENT_4','(Low-Medium risk)');
+define('MAX_COMMENT_5','(Medium risk)');
+define('MAX_COMMENT_6','(Medium-high risk)');
+define('MAX_COMMENT_7','<font color=red>(High risk)</font>');
+define('MAX_COMMENT_8','<font color=red>(Very High risk)</font>');
+define('MAX_COMMENT_9','<font color=red>(Extremely High risk)</font>');
+define('MAX_COMMENT_10','<font color=red>(HIGH PROBABILITY OF FRAUD)</font>');
+define('ERROR','Error');
+define('LAST_QUERIED_ON','Last Queried on :');
+define('REMAINING_QUERIES_1','You have');
+define('REMAINING_QUERIES_2','queries remaining');
+
+// End AlgoZone - Algozone Fraud Screen Tool definitions
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Article Reviews');
+
+define('TABLE_HEADING_ARTICLES', 'Articles');
+define('TABLE_HEADING_RATING', 'Rating');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('ENTRY_ARTICLE', 'Article:');
+define('ENTRY_FROM', 'From:');
+define('ENTRY_DATE', 'Date:');
+define('ENTRY_REVIEW', 'Review:');
+define('ENTRY_REVIEW_TEXT', '<small><font color="#ff0000"><b>NOTE:</b></font></small>&nbsp;HTML is not translated!&nbsp;');
+define('ENTRY_RATING', 'Rating:');
+
+define('TEXT_INFO_DELETE_REVIEW_INTRO', 'Are you sure you want to delete this review?');
+
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_REVIEW_AUTHOR', 'Reviewer:');
+define('TEXT_INFO_REVIEW_RATING', 'Rating:');
+define('TEXT_INFO_REVIEW_READ', 'Read:');
+define('TEXT_INFO_REVIEW_SIZE', 'Size:');
+define('TEXT_INFO_ARTICLES_AVERAGE_RATING', 'Average Rating:');
+
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_OF_5_STARS', '%s of 5 Stars!');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>Excellent</b></font></small>');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>Poor</b></font></small>');
+define('TEXT_INFO_HEADING_DELETE_REVIEW', 'Delete Review');
+/* <Mav was here!> */
+define('TEXT_APPROVED', 'Approved') ;
+define('TEXT_APPROVE', 'Approve') ;
+define('TEXT_DISAPPROVE', 'Disapprove') ;
+define('TEXT_YES', 'Yes') ;
+define('TEXT_NO', 'No') ;
+/* </Mav was here!> */
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/article_search.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/article_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/article_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: article_search.php
+  By AlDaffodil:  aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_1', 'Article Search');
+define('HEADING_TITLE_2', 'Articles meeting the search criteria');
+
+define('NAVBAR_TITLE_1', 'Article Search');
+define('NAVBAR_TITLE_2', 'Articles meeting the search criteria');
+define('TABLE_HEADING_ARTICLES', 'Article');
+
+define('TEXT_ARTICLE_NAME' , 'Article Title & Link');
+define('TEXT_ARTICLE_EXCERPT' , 'Article Excerpt');
+
+define('TEXT_NO_ARTICLES', 'There are no articles matching the search criteria.');
+
+define('ERROR_INPUT', 'Please enter a search term.');
+define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/articles.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Topics / Articles');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_TOPICS_ARTICLES', 'Topics / Articles');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('TEXT_ARTICLES_CURRENT', 'Current:');
+
+define('TEXT_NEW_ARTICLE', 'New Article in &quot;%s&quot;');
+define('TEXT_TOPICS', 'Topics:');
+define('TEXT_SUBTOPICS', 'Subtopics:');
+define('TEXT_ARTICLES', 'Articles:');
+define('TEXT_ARTICLES_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_ARTICLES_HEAD_TITLE_TAG', 'HTML Page Title:');
+define('TEXT_ARTICLES_HEAD_DESC_TAG', 'Meta Description:<br><small>(Article Abstract =<br>first %s charachters)</small>');
+define('TEXT_ARTICLES_HEAD_KEYWORDS_TAG', 'Meta Keywords:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DATE_AVAILABLE', 'Date Expected:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_NO_CHILD_TOPICS_OR_ARTICLES', 'Please insert a new topic or article in this level.');
+define('TEXT_ARTICLE_MORE_INFORMATION', 'For more information, please visit this articles <a href="http://%s" target="blank"><u>web page</u></a>.');
+define('TEXT_ARTICLE_DATE_ADDED', 'This article was added to our site on %s.');
+define('TEXT_ARTICLE_DATE_AVAILABLE', 'This article will is expected on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_TOPICS_ID', 'Topic ID:');
+define('TEXT_EDIT_TOPICS_NAME', 'Topic Name:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new topic you wish to copy this article to');
+define('TEXT_INFO_CURRENT_TOPICS', 'Current Topics:');
+
+define('TEXT_INFO_HEADING_NEW_TOPIC', 'New Topic');
+define('TEXT_INFO_HEADING_EDIT_TOPIC', 'Edit Topic');
+define('TEXT_INFO_HEADING_DELETE_TOPIC', 'Delete Topic');
+define('TEXT_INFO_HEADING_MOVE_TOPIC', 'Move Topic');
+define('TEXT_INFO_HEADING_DELETE_ARTICLE', 'Delete Article');
+define('TEXT_INFO_HEADING_MOVE_ARTICLE', 'Move Article');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_TOPIC_INTRO', 'Are you sure you want to delete this topic?');
+define('TEXT_DELETE_ARTICLE_INTRO', 'Are you sure you want to permanently delete this article?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s child-topics still linked to this topic!');
+define('TEXT_DELETE_WARNING_ARTICLES', '<b>WARNING:</b> There are %s articles still linked to this topic!');
+
+define('TEXT_MOVE_ARTICLES_INTRO', 'Please select which topic you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_TOPICS_INTRO', 'Please select which topic you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_TOPIC_INTRO', 'Please fill out the following information for the new topic');
+define('TEXT_TOPICS_NAME', 'Topic Name:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_EDIT_TOPICS_HEADING_TITLE', 'Topic Heading Title:');
+define('TEXT_EDIT_TOPICS_DESCRIPTION', 'Topic Description:');
+
+define('TEXT_ARTICLES_STATUS', 'Article Status:');
+define('TEXT_ARTICLES_DATE_AVAILABLE', 'Date Expected:');
+define('TEXT_ARTICLE_AVAILABLE', 'Published');
+define('TEXT_ARTICLE_NOT_AVAILABLE', 'Draft');
+define('TEXT_ARTICLES_AUTHOR', 'Author:');
+define('TEXT_ARTICLES_NAME', 'Article Name:');
+define('TEXT_ARTICLES_DESCRIPTION', 'Article Content:');
+define('TEXT_ARTICLES_URL', 'Article URL:');
+define('TEXT_ARTICLES_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+
+define('EMPTY_TOPIC', 'Empty Topic');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method:');
+define('TEXT_COPY_AS_LINK', 'Link article');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate article');
+
+define('ERROR_CANNOT_LINK_TO_SAME_TOPIC', 'Error: Can not link articles in the same topic.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_TOPIC_TO_PARENT', 'Error: Topic cannot be moved into child topic.');
+
+define('DATE_FORMAT', '(YYYY-MM-DD)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/articles_config.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/articles_config.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/articles_config.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: articles_config.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Articles Configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/articles_xsell.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/articles_xsell.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/articles_xsell.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: articles_xsell.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Cross-Sell Articles to Products');
+
+define('HEADING_ARTICLE_NAME', 'Article Name');
+define('HEADING_CROSS_ASSOCIATION', 'Associated Products');
+define('HEADING_CROSS_SELL_ACTIONS', 'Cross-Sell Actions');
+define('HEADING_PRODUCT_NAME', 'Product Name');
+define('HEADING_PRODUCT_ORDER', 'Order (1=Top)');
+
+define('TEXT_DATABASE_UPDATED', 'The database has been updated.');
+define('TEXT_NO_DELETE', 'could not delete');
+define('TEXT_NO_INSERT', 'could not insert into database');
+define('TEXT_NO_UPDATE', 'could not update database');
+
+define('TEXT_LINK_MAIN_PAGE', '<a href="%s">Click here</a> to go back to the main page.');
+define('TEXT_LINK_SORT_PRODUCTS', '<a href="%s">Click here</a> to sort the products associated with this article.<br><small>Note: this needs to be done every time a product is added or deleted.</small>');
+
+define("HEADING_ARTICLE_ID","ID");
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/attributes_sorter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/attributes_sorter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/attributes_sorter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  Definitions for Attributes Sorter
+*/
+
+// Turn things off
+define('I_AM_OFF',true);
+
+// WebMakers.com Added: Attributes - Definitions to move to attribute_sorter.php
+define('TABLE_HEADING_PRODUCT_ATTRIBUTE_ONE_TIME','One Time Charge');
+
+// WebMakers.com Added: Attribute Copy Option
+define('TEXT_COPY_ATTRIBUTES_ONLY','Only used for Duplicate Products ...');
+define('TEXT_COPY_ATTRIBUTES','Copy Product Attribuites to Duplicate?');
+define('TEXT_COPY_ATTRIBUTES_YES','Yes');
+define('TEXT_COPY_ATTRIBUTES_NO','No');
+
+// WebMakers.com Added: Attributes Copy from Existing Product to Existing Product
+define('PRODUCT_NAMES_HELPER','<FONT COLOR="FF0000"><a href="' . 'quick_products_popup.php' . '" onclick="NewWindow(this.href,\'name\',\'700\',\'500\',\'yes\');return false;">[ Product ID# Look-up ]</a>');
+define('ATTRIBUTES_NAMES_HELPER','<FONT COLOR="FF0000"><a href="' . 'quick_attributes_popup.php?look_it_up=' . $pID . '&my_languages_id=' . $languages_id . '" onclick="NewWindow2(this.href,\'name2\',\'700\',\'400\',\'yes\');return false;">[ Quick List Attributes for Product ID# ' . $pID . ' ]</a>');
+
+// WebMakers.com Added: Product Option Attributes Sort Order - products_attributes.php
+define('TABLE_HEADING_OPTION_SORT_ORDER','Sort Order');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/authors.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Authors');
+
+define('TABLE_HEADING_AUTHORS', 'Authors');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_HEADING_NEW_AUTHOR', 'New Author');
+define('TEXT_HEADING_EDIT_AUTHOR', 'Edit Author');
+define('TEXT_HEADING_DELETE_AUTHOR', 'Delete Author');
+
+define('TEXT_ARTICLE_BY', 'Article by ');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this authors <a href="http://%s" target="_blank">web page</a>.');
+
+define('TEXT_AUTHORS', 'Authors:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_ARTICLES', 'Articles:');
+
+define('TEXT_NEW_INTRO', 'Please fill out the following information for the new author');
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes.');
+
+define('TEXT_AUTHORS_NAME', 'Authors Name:');
+define('TEXT_AUTHORS_DESCRIPTION', 'Authors Description:');
+define('TEXT_AUTHORS_URL', 'Authors URL:');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this author?');
+define('TEXT_DELETE_ARTICLES', 'Delete articles from this author? (including article reviews and upcoming articles)');
+define('TEXT_DELETE_WARNING_ARTICLES', '<b>WARNING:</b> There are %s articles still linked to this author!');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/backup.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/backup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/backup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: backup.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Database Backup Manager');
+
+define('TABLE_HEADING_TITLE', 'Title');
+define('TABLE_HEADING_FILE_DATE', 'Date');
+define('TABLE_HEADING_FILE_SIZE', 'Size');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_NEW_BACKUP', 'New Backup');
+define('TEXT_INFO_HEADING_RESTORE_LOCAL', 'Restore Local');
+define('TEXT_INFO_NEW_BACKUP', 'Do not interrupt the backup process which might take a couple of minutes.');
+define('TEXT_INFO_UNPACK', '<br><br>(after unpacking the file from the archive)');
+define('TEXT_INFO_RESTORE', 'Do not interrupt the restoration process.<br><br>The larger the backup, the longer this process takes!<br><br>If possible, use the mysql client.<br><br>For example:<br><br><b>mysql -h' . DB_SERVER . ' -u' . DB_SERVER_USERNAME . ' -p ' . DB_DATABASE . ' < %s </b> %s');
+define('TEXT_INFO_RESTORE_LOCAL', 'Do not interrupt the restoration process.<br><br>The larger the backup, the longer this process takes!');
+define('TEXT_INFO_RESTORE_LOCAL_RAW_FILE', 'The file uploaded must be a raw sql (text) file.');
+define('TEXT_INFO_DATE', 'Date:');
+define('TEXT_INFO_SIZE', 'Size:');
+define('TEXT_INFO_COMPRESSION', 'Compression:');
+define('TEXT_INFO_USE_GZIP', 'Use GZIP');
+define('TEXT_INFO_USE_ZIP', 'Use ZIP');
+define('TEXT_INFO_USE_NO_COMPRESSION', 'No Compression (Pure SQL)');
+define('TEXT_INFO_DOWNLOAD_ONLY', 'Download only (do not store server side)');
+define('TEXT_INFO_BEST_THROUGH_HTTPS', 'Best through a HTTPS connection');
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this backup?');
+define('TEXT_NO_EXTENSION', 'None');
+define('TEXT_BACKUP_DIRECTORY', 'Backup Directory:');
+define('TEXT_LAST_RESTORATION', 'Last Restoration:');
+define('TEXT_FORGET', '(<u>forget</u>)');
+
+define('ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST', 'Error: Backup directory does not exist. Please set this in configure.php.');
+define('ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE', 'Error: Backup directory is not writeable.');
+define('ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE', 'Error: Download link not acceptable.');
+
+define('SUCCESS_LAST_RESTORE_CLEARED', 'Success: The last restoration date has been cleared.');
+define('SUCCESS_DATABASE_SAVED', 'Success: The database has been saved.');
+define('SUCCESS_DATABASE_RESTORED', 'Success: The database has been restored.');
+define('SUCCESS_BACKUP_DELETED', 'Success: The backup has been removed.');
+
+define('BYTES', ' bytes');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/backup_mysql.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/backup_mysql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/backup_mysql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// |zen-cart Open Source E-commerce                                       |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 2003 The zen-cart developers                           |
+// |                                                                      |
+// | http://www.zen-cart.com/index.php                                    |
+// |                                                                      |
+// | Portions Copyright (c) 2003 osCommerce                               |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the GPL license,       |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available through the world-wide-web at the following url:           |
+// | http://www.zen-cart.com/license/2_0.txt.                             |
+// | If you did not receive a copy of the zen-cart license and are unable |
+// | to obtain it through the world-wide-web, please send a note to       |
+// | license at zen-cart.com so we can mail you a copy immediately.          |
+// +----------------------------------------------------------------------+
+// $Id: backup_mysql.php,v 1.2.0.1 2004/08/03 00:00:00 DrByteZen Exp $
+//
+
+// define the locations of the mysql utilities.  Typical location is in '/usr/bin/' ... but not on Windows servers.
+// try 'c:/mysql/bin/mysql.exe' and 'c:/mysql/bin/mysqldump.exe' on Windows hosts ... change drive letter and path as needed
+define('LOCAL_EXE_MYSQL',     '/usr/local/bin/mysql');  // used for restores
+define('LOCAL_EXE_MYSQLDUMP', '/usr/local/bin/mysqldump');  // used for backups
+
+// the following are the language definitions
+define('HEADING_TITLE', 'Database Backup Manager - MySQL');
+define('WARNING_NOT_SECURE_FOR_DOWNLOADS','<span class="errorText">NOTE: You do not have SSL enabled. Any downloads you do from this page will not be encrypted. Doing backups and restores will be fine, but download/upload of files from/to the server presents a security risk.');
+define('TABLE_HEADING_TITLE', 'Title');
+define('TABLE_HEADING_FILE_DATE', 'Date');
+define('TABLE_HEADING_FILE_SIZE', 'Size');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_NEW_BACKUP', 'New Backup');
+define('TEXT_INFO_HEADING_RESTORE_LOCAL', 'Restore Local');
+define('TEXT_INFO_NEW_BACKUP', 'Do not interrupt the backup process which might take a couple of minutes.');
+define('TEXT_INFO_UNPACK', '<br><br>(after unpacking the file from the archive)');
+define('TEXT_INFO_RESTORE', 'Do not interrupt the restoration process.<br><br>The larger the backup, the longer this process takes!<br><br>If possible, use the mysql client.<br><br>For example:<br><br><b>mysql -h' . DB_SERVER . ' -u' . DB_SERVER_USERNAME . ' -p ' . DB_DATABASE . ' < %s </b> %s');
+define('TEXT_INFO_RESTORE_LOCAL', 'Do not interrupt the restoration process.<br><br>The larger the backup, the longer this process takes!');
+define('TEXT_INFO_RESTORE_LOCAL_RAW_FILE', 'The file uploaded must be a raw sql (text) file.');
+define('TEXT_INFO_DATE', 'Date:');
+define('TEXT_INFO_SIZE', 'Size:');
+define('TEXT_INFO_COMPRESSION', 'Compression:');
+define('TEXT_INFO_USE_GZIP', 'Use GZIP');
+define('TEXT_INFO_USE_ZIP', 'Use ZIP');
+define('TEXT_INFO_USE_NO_COMPRESSION', 'No Compression (Pure SQL)');
+define('TEXT_INFO_DOWNLOAD_ONLY', 'Download without storing on server');
+define('TEXT_INFO_BEST_THROUGH_HTTPS', '(Safer via a secured HTTPS connection)');
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this backup?');
+define('TEXT_NO_EXTENSION', 'None');
+define('TEXT_BACKUP_DIRECTORY', 'Backup Directory:');
+define('TEXT_LAST_RESTORATION', 'Last Restoration:');
+define('TEXT_FORGET', '(forget)');
+
+define('ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST', 'Error: Backup directory does not exist. Please set this in configure.php.');
+define('ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE', 'Error: Backup directory is not writeable.');
+define('ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE', 'Error: Download link not acceptable.');
+define('ERROR_CANT_BACKUP_IN_SAFE_MODE','ERROR: Cannot use backup script when safe_mode is enabled.');
+
+define('SUCCESS_LAST_RESTORE_CLEARED', 'Success: The last restoration date has been cleared.');
+define('SUCCESS_DATABASE_SAVED', 'Success: The database has been saved.');
+define('SUCCESS_DATABASE_RESTORED', 'Success: The database has been restored.');
+define('SUCCESS_BACKUP_DELETED', 'Success: The backup has been removed.');
+define('FAILURE_DATABASE_NOT_SAVED', 'Failure: The database has NOT been saved.');
+define('FAILURE_DATABASE_NOT_SAVED_UTIL_NOT_FOUND', 'ERROR: Could not locate the MYSQLDUMP backup utility. BACKUP FAILED.');
+define('FAILURE_DATABASE_NOT_RESTORED', 'Failure: The database may NOT have been restored properly. Please check it carefully.');
+define('FAILURE_DATABASE_NOT_RESTORED_FILE_NOT_FOUND', 'Failure: The database was NOT restored.  ERROR: FILE NOT FOUND: %s');
+define('FAILURE_DATABASE_NOT_RESTORED_UTIL_NOT_FOUND', 'ERROR: Could not locate the MYSQL restore utility. RESTORE FAILED.');
+
+
+define('BACKUP_MYSQl_ERROR_MSG_1', 'Checking Path: ');
+define('BACKUP_MYSQl_ERROR_MSG_2', 'COMMAND FILES FOUND/SELECTED:');
+define('BACKUP_MYSQl_ERROR_MSG_3', 'COMMAND: ');
+define('BACKUP_MYSQl_ERROR_MSG_4', "valueA: ");
+define('BACKUP_MYSQl_ERROR_MSG_5', "valueB: ");
+define('BACKUP_MYSQl_ERROR_MSG_6', 'Result code: ');
+define('BYTES', ' bytes');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/banner_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/banner_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/banner_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: banner_manager.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Banner Manager');
+
+define('TABLE_HEADING_BANNERS', 'Banners');
+define('TABLE_HEADING_GROUPS', 'Groups');
+define('TABLE_HEADING_STATISTICS', 'Displays / Clicks');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_BANNERS_TITLE', 'Banner Title:');
+define('TEXT_BANNERS_URL', 'Banner URL:');
+define('TEXT_BANNERS_GROUP', 'Banner Group:');
+define('TEXT_BANNERS_NEW_GROUP', ', or enter a new banner group below');
+define('TEXT_BANNERS_IMAGE', 'Image:');
+define('TEXT_BANNERS_IMAGE_LOCAL', ', or enter local file below');
+define('TEXT_BANNERS_IMAGE_TARGET', 'Image Target (Save To):');
+define('TEXT_BANNERS_HTML_TEXT', 'HTML Text:');
+define('TEXT_BANNERS_EXPIRES_ON', 'Expires On:');
+define('TEXT_BANNERS_OR_AT', ', or at');
+define('TEXT_BANNERS_IMPRESSIONS', 'impressions/views.');
+define('TEXT_BANNERS_SCHEDULED_AT', 'Scheduled At:');
+define('TEXT_BANNERS_BANNER_NOTE', '<b>Banner Notes:</b><ul><li>Use an image or HTML text for the banner - not both.</li><li>HTML Text has priority over an image</li></ul>');
+define('TEXT_BANNERS_INSERT_NOTE', '<b>Image Notes:</b><ul><li>Uploading directories must have proper user (write) permissions setup!</li><li>Do not fill out the \'Save To\' field if you are not uploading an image to the webserver (ie, you are using a local (serverside) image).</li><li>The \'Save To\' field must be an existing directory with an ending slash (eg, banners/).</li></ul>');
+define('TEXT_BANNERS_EXPIRCY_NOTE', '<b>Expiry Notes:</b><ul><li>Only one of the two fields should be submitted</li><li>If the banner is not to expire automatically, then leave these fields blank</li></ul>');
+define('TEXT_BANNERS_SCHEDULE_NOTE', '<b>Schedule Notes:</b><ul><li>If a schedule is set, the banner will be activated on that date.</li><li>All scheduled banners are marked as deactive until their date has arrived, to which they will then be marked active.</li></ul>');
+
+define('TEXT_BANNERS_DATE_ADDED', 'Date Added:');
+define('TEXT_BANNERS_SCHEDULED_AT_DATE', 'Scheduled At: <b>%s</b>');
+define('TEXT_BANNERS_EXPIRES_AT_DATE', 'Expires At: <b>%s</b>');
+define('TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS', 'Expires At: <b>%s</b> impressions');
+define('TEXT_BANNERS_STATUS_CHANGE', 'Status Change: %s');
+
+define('TEXT_BANNERS_DATA', 'D<br>A<br>T<br>A');
+define('TEXT_BANNERS_LAST_3_DAYS', 'Last 3 Days');
+define('TEXT_BANNERS_BANNER_VIEWS', 'Banner Views');
+define('TEXT_BANNERS_BANNER_CLICKS', 'Banner Clicks');
+
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this banner?');
+define('TEXT_INFO_DELETE_IMAGE', 'Delete banner image');
+
+define('SUCCESS_BANNER_INSERTED', 'Success: The banner has been inserted.');
+define('SUCCESS_BANNER_UPDATED', 'Success: The banner has been updated.');
+define('SUCCESS_BANNER_REMOVED', 'Success: The banner has been removed.');
+define('SUCCESS_BANNER_STATUS_UPDATED', 'Success: The status of the banner has been updated.');
+
+define('ERROR_BANNER_TITLE_REQUIRED', 'Error: Banner title required.');
+define('ERROR_BANNER_GROUP_REQUIRED', 'Error: Banner group required.');
+define('ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Target directory does not exist: %s');
+define('ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Target directory is not writeable: %s');
+define('ERROR_IMAGE_DOES_NOT_EXIST', 'Error: Image does not exist.');
+define('ERROR_IMAGE_IS_NOT_WRITEABLE', 'Error: Image can not be removed.');
+define('ERROR_UNKNOWN_STATUS_FLAG', 'Error: Unknown status flag.');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Error: Graphs directory does not exist. Please create a \'graphs\' directory inside \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Error: Graphs directory is not writeable.');
+
+define('DATE_FORMAT', '(dd/mm/yyyy)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/banner_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/banner_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/banner_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: banner_statistics.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Banner Statistics');
+
+define('TABLE_HEADING_SOURCE', 'Source');
+define('TABLE_HEADING_VIEWS', 'Views');
+define('TABLE_HEADING_CLICKS', 'Clicks');
+
+define('TEXT_BANNERS_DATA', 'D<br>a<br>t<br>a');
+define('TEXT_BANNERS_DAILY_STATISTICS', '%s Daily Statistics For %s %s');
+define('TEXT_BANNERS_MONTHLY_STATISTICS', '%s Monthly Statistics For %s');
+define('TEXT_BANNERS_YEARLY_STATISTICS', '%s Yearly Statistics');
+
+define('STATISTICS_TYPE_DAILY', 'Daily');
+define('STATISTICS_TYPE_MONTHLY', 'Monthly');
+define('STATISTICS_TYPE_YEARLY', 'Yearly');
+
+define('TITLE_TYPE', 'Type:');
+define('TITLE_YEAR', 'Year:');
+define('TITLE_MONTH', 'Month:');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Error: Graphs directory does not exist. Please create a \'graphs\' directory inside \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Error: Graphs directory is not writeable.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/c_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/c_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/c_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,147 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Editing Order');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('ADDING_TITLE', 'Adding a Product to Order');
+
+define('CATEGORY_ORDER_DETAILS', 'Customer Details');
+define('ENTRY_CURRENCY', 'Customer Currency');
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_TAX', 'Tax');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_UNIT_PRICE', 'Unit Price');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Total Price');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Customer Notified');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+
+define('ENTRY_CUSTOMER', 'Customer:');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Company');
+define('ENTRY_CUSTOMER_ADDRESS', 'Address');
+define('ENTRY_CUSTOMER_SUBURB', 'Suburb');
+define('ENTRY_CUSTOMER_CITY', 'City');
+define('ENTRY_CUSTOMER_STATE', 'State');
+define('ENTRY_CUSTOMER_POSTCODE', 'Postcode');
+define('ENTRY_CUSTOMER_COUNTRY', 'Country');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Sold To:');
+define('ENTRY_DELIVERY_TO', 'Delivery To:');
+define('ENTRY_SHIP_TO', 'Ship To:');
+define('ENTRY_SHIPPING_ADDRESS', 'Shipping Address:');
+define('ENTRY_BILLING_ADDRESS', 'Billing Address:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Credit Card Type:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Credit Card Expires:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Tax:');
+define('ENTRY_SHIPPING', 'Shipping:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'Date Last Updated:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notify Customer:');
+define('ENTRY_NOTIFY_COMMENTS', 'Append Comments:');
+define('ENTRY_PRINTABLE', 'Print Invoice');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Use a negative number -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Add New Product');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> CCV Code:  Not stored - due to processing regulations. Enable CCV email in module settings.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+define('TEXT_NO_ORDER_HISTORY', 'No Order History Available');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Order Update');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: Order does not exist.');
+define('SUCCESS_ORDER_UPDATED', 'Success: Order has been successfully updated.');
+define('WARNING_ORDER_NOT_UPDATED', 'Warning: Nothing to change. The order was not updated.');
+
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choose a product');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Choose an option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Product has no options, so skipping...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'pieces of this product');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Add');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+define('DONT_ADD_NEW_PRODUCT', 'Don\'t Add New Product');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/cache.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/cache.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/cache.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: cache.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Cache Control');
+
+define('TABLE_HEADING_CACHE', 'Cache Blocks');
+define('TABLE_HEADING_DATE_CREATED', 'Date Created');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'File does not exist');
+define('TEXT_CACHE_DIRECTORY', 'Cache Directory:');
+
+define('ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST', 'Error: Cache directory does not exist. Please set this Configuration->Cache.');
+define('ERROR_CACHE_DIRECTORY_NOT_WRITEABLE', 'Error: Cache directory is not writeable.');
+
+// labels for Tools>Cache Control
+define('TEXT_CACHE_CATEGORIES', 'Categories Box');
+define('TEXT_CACHE_CATEGORIES1', 'Categories Box 1');
+define('TEXT_CACHE_CATEGORIES2', 'Categories Box 2');
+define('TEXT_CACHE_CATEGORIES3', 'Categories Box 3');
+define('TEXT_CACHE_CATEGORIES4', 'Categories Box 4');
+define('TEXT_CACHE_CATEGORIES5', 'Categories Box 5');
+define('TEXT_CACHE_ALLPROD', 'All Produces');
+define('TEXT_CACHE_ALLMANUF', 'All Manufactures');
+define('TEXT_CACHE_ALLCATS', 'All Categories');
+define('TEXT_CACHE_MANUFACTURERS', 'Manufacturers Box');
+define('TEXT_CACHE_ALSO_PURCHASED', 'Also Purchased Module');
+define('TEXT_CACHE_COOLMENU', 'Cool Menu');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,189 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_MEDIUM','<b>Products Image:</b><small><br>Main Image used in <br><u>catalog & description</u> pages.<small>');
+define('TEXT_PRODUCTS_IMAGE_NOTE', '<b>Small Image:</b><br><small> Image on<br><u>products list</u> pages.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Image:</b><br><small> Large Image on<br><u>pop-up window</u> page.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Store Product/s Sharing this Image =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Remove</b> this Image from this Product?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>Delete</b> this Image from the Server (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Remove');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'Delete');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Small Images.</b> If a "SM" image is used<br>(Alone) NO Pop-up window link is created, the "SM"<br> will be placed directly under the products<br>description. If used in conjunction with an <br>"XL" image on the right, a Pop-up Window Link<br> is created and the "XL" image will be<br>shown in a Pop-up window.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Large Images.</b> Used for the Pop-up image<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Additional Images - These will appear below product description if used.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Image 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Image 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Image 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Image 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Image 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Image 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Image 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Image 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Image 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Image 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Image 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Image 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+define('HEADING_TITLE', 'Categories / Products');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Categories / Products');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DELETE_IMAGE', 'Delete Image');
+
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EXISTING_CATEGORIES_IMAGE','Existing Image');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Category heading title:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Category Description:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Category Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Category Description Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Category Key Word Meta Tag :');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method :');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Product Keywords :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Edit Product Attributes');
+
+// mod for sub products
+define('MAX_PRODUCT_SUB_ROWS', '5');
+define('TEXT_SUB_PRODUCT','Sub Product:');
+define('TEXT_SUB_PRODUCT_DELETE','Delete');
+define('TEXT_SUB_PRODUCT_NAME','Name');
+define('TEXT_SUB_PRODUCT_PRICE','Price');
+define('TEXT_SUB_PRODUCT_MODEL','Model');
+define('TEXT_SUB_PRODUCT_QTY','Qty');
+define('TEXT_SUB_PRODUCT_WEIGHT','Weight');
+define('TEXT_SUB_PRODUCT_IMAGE','Image');
+define('TEXT_SUB_PRODUCT_NOTE_1','* additional subproducts available upon insert');
+define('TEXT_SUB_PRODUCT_NOTE_2','* zero quantity disables the subproduct');
+
+// Eversun mod for sppc and qty price breaks
+define('TEXT_PRODUCTS_PRICE', 'Retail Price:');
+define('TEXT_PRODUCTS_GROUPS', 'Groups:');
+define('TEXT_PRODUCTS_BASE', 'Base');
+define('TEXT_PRODUCTS_ABOVE', 'Above');
+define('TEXT_PRODUCTS_QTY', 'Qty');
+define('TEXT_PRODUCTS_QTY_BLOCKS', 'Quantity Blocks:');
+define('TEXT_PRODUCTS_QTY_BLOCKS_INFO', '(can only order in blocks of X quantity)');
+define('TEXT_PRODUCTS_SPPP_NOTE', 'Note that if a field is filled, but the checkbox is unchecked no price will be inserted.<br />If a price is already inserted in the database, but the checkbox unchecked it will be removed from the database.');
+define('TEXT_PRODUCTS_QTY_DISCOUNT', '10');
+
+// Eversun mod end for sppc and qty price breaks
+
+
+
+define('TEXT_PRODUCT_IMAGES', 'Product Images');
+define('TEXT_EXTRA_FIELDS', 'Extra Fields');
+define('TEXT_EXTRA_IMAGES', 'Extra Images');
+define('TEXT_ACTIVE_ATTRIBUTES', 'Active Attributes');
+define('TEXT_COPY_ATTRIBUTES_TO_ANOTHER_PRODUCT', 'Copy Attributes to another product');
+define('TEXT_COPYING_ATTRIBUTES_FROM', 'Copying Attributes from');
+define('TEXT_COPYING_ATTRIBUTES_TO', 'Copying Attributes to');
+define('TEXT_DELETE_ALL_ATTRIBUTE', 'Delete ALL Attributes and Downloads before copying');
+define('TEXT_OTHERWISE', 'Otherwise ...');
+define('TEXT_DUPLICATE_ATTRIBUTES_SKIPPED', 'Duplicate Attributes should be skipped');
+define('TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN', 'Duplicate Attributes should be overwritten');
+define('TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS', 'Copy Attributes with Downloads');
+define('TEXT_SELECT_PRODUCT_FOR_DISPLAY', 'Select a product for display');
+define('TEXT_COPY_PRODUCT_ATTRIBUTES_TO_CATEGORY', 'Copy Product Attributes to Category ...');
+define('TEXT_COPY_PRODUCT_ATTRIBUTES_FROM_PRODUCT_ID', 'Copy Product Attributes from Product ID');
+define('TEXT_COPYING_TO_ALL_PRODUCTS_IN_CATEGORY_ID', 'Copying to all products in Category ID');
+define('TEXT_CATEGORY_NAME', 'Category Name: ');
+define('TEXT_SELECT_PRODUCT_TO_DISPLAY_ATTRIBUTES', 'Select a product to display attributes');
+define('DATE_FORMAT', '(YYYY-MM-DD)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/check_lang.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/check_lang.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/check_lang.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+
+  Released under the GNU General Public License
+*/
+
+define("ERROR_CANNOT_OPEN_LANGUAGE_DIR","FATAL ERROR: Cannot open language dir: ");
+define("CHECK_LANG_FILENAME","Filename");
+define("CHECK_LANG_MISSING_IN","Missing in");
+define("CHECK_LANG_NONE_FOUND","None found");
+define("CHECK_LANG_FOUND_IN","Found in");
+define("CHECK_LANG_DEFINITION_NAME","Definition name");
+define("CHECK_LANG_EQUAL_TO","Equal to");
+define("CHECK_LANG_REFERENCES","References");
+define("CHECK_LANG_ALL_EQUAL","All equal");
+define("CHECK_LANG_WHERE_USED","Where Used");
+define("CHECK_LANG_FOUND_FOR","Found for");
+define("CHECK_LANG_MISSING_FOR","Missing for");
+define("CHECK_LANG_ALL_BUT","All but");
+define("CHECK_LANG_FILE_NAME","File Name");
+define("CHECK_LANG_SELECT_OPTION","Select option");
+define("CHECK_LANG_TO_CHECK_FILE_CONSISTENCY","To check file consistency");
+define("CHECK_LANG_CLICK_HERE","Click Here");
+define("CHECK_LANG_TO_CHECK_DEFINITION_CONSISTENCY","To check definition consistency");
+define("CHECK_LANG_TO_CHECK_EQUAL_DEFINITIONS","To check equal definitions");
+define("CHECK_LANG_HOME","Home");
+define("CHECK_LANG_BACK","Back");
+define("CHECK_LANG_W_GODEFROY","W Godefroy");
+define("CHECK_LANG_EXECUTION_TIME","Execution Time: ");
+define("CHECK_LANG_TITLE","Check Language Integrity");
+define("CHECK_LANG_LIST_OF_FILES_USING","List of files using");
+define("CHECK_LANG_LIST_OF_FILES_PRESENT_FOR_ONE_LANGUAGE","List of files that are present for one language-definition but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_PRESENT_FOR_ONE_LANGUAGE","List of phrase definitions that are present for one language-file but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_DEFINITIONS_EQUAL","List of phrase definitions that are equal");
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/countries.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/countries.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/countries.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: countries.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Countries');
+
+define('TABLE_HEADING_COUNTRY_NAME', 'Country');
+define('TABLE_HEADING_COUNTRY_CODES', 'ISO Codes');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_COUNTRY_NAME', 'Name:');
+define('TEXT_INFO_COUNTRY_CODE_2', 'ISO Code (2):');
+define('TEXT_INFO_COUNTRY_CODE_3', 'ISO Code (3):');
+define('TEXT_INFO_ADDRESS_FORMAT', 'Address Format:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new country with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this country?');
+define('TEXT_INFO_HEADING_NEW_COUNTRY', 'New Country');
+define('TEXT_INFO_HEADING_EDIT_COUNTRY', 'Edit Country');
+define('TEXT_INFO_HEADING_DELETE_COUNTRY', 'Delete Country');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/coupon_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/coupon_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/coupon_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,121 @@
+<?php
+/*
+  $Id: coupon_admin.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TOP_BAR_TITLE', 'Statistics');
+define('HEADING_TITLE', 'Discount Coupons');
+define('HEADING_TITLE_STATUS', 'Status : ');
+define('TEXT_CUSTOMER', 'Customer:');
+define('TEXT_COUPON', 'Coupon Name');
+define('TEXT_COUPON_ALL', 'All Coupons');
+define('TEXT_COUPON_ACTIVE', 'Active Coupons');
+define('TEXT_COUPON_INACTIVE', 'Inactive Coupons');
+define('TEXT_SUBJECT', 'Subject:');
+define('TEXT_FROM', 'From:');
+define('TEXT_FREE_SHIPPING', 'Free Shipping');
+define('TEXT_MESSAGE', 'Message:');
+define('TEXT_SELECT_CUSTOMER', 'Select Customer');
+define('TEXT_ALL_CUSTOMERS', 'All Customers');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'To All Newsletter Subscribers');
+define('TEXT_CONFIRM_DELETE', 'Are you sure you want to delete this Coupon?');
+
+define('TEXT_TO_REDEEM1', 'You can also redeem this Discount coupon during checkout. Just enter the code in the box provided, and click on the redeem button. ');
+define('TEXT_IN_CASE', ' in case you have any problems. ');
+define('TEXT_VOUCHER_IS', 'The coupon code is ');
+define('TEXT_REMEMBER', 'Please do not lose the coupon code, make sure to keep the code safe so you can benefit from this special offer');
+define('TEXT_VISIT', 'when you visit <a style="color: #000000" href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . STORE_NAME . '</a>' ."\n" .'(' . HTTP_SERVER . DIR_WS_CATALOG . ')');
+define('TEXT_ENTER_CODE', ' and enter the code. ');
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">The Back Button has been DISABLED while HTML WYSIWG Editor is turned ON.</b></font><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML is currently Disabled!</b></font><br><br>If you want to send HTML email, Enable WYSIWYG Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>');
+
+define('TEXT_OR_VISIT', 'or visit ');
+define('TEXT_TO_REDEEM', ' To redeem this Discount coupon, please click on the link below. Please also write down the redemption code');
+define('TEXT_WHICH_IS', ' which is ');
+define('TEXT_IN_CASE', ' in case you have any problems.');
+
+
+define('TEXT_COUPON_REDEEMED', 'Redeemed Coupons');
+define('REDEEM_DATE_LAST', 'Date Last Redeemed');
+define('COUPON_STATUS', 'Status');
+define('COUPON_STATUS_HELP', 'Set to ' . IMAGE_ICON_STATUS_RED . ' to disable customers\' ability to use the coupon.');
+define('COUPON_BUTTON_EMAIL_VOUCHER', 'Email Voucher');
+define('COUPON_BUTTON_EDIT_VOUCHER', 'Edit Voucher');
+define('COUPON_BUTTON_DELETE_VOUCHER', 'Delete Voucher');
+define('COUPON_BUTTON_VOUCHER_REPORT', 'Voucher Report');
+
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_HEADING_COUPON_REPORT', 'Coupon Report');
+
+define('CUSTOMER_ID', 'Customer id');
+define('CUSTOMER_NAME', 'Customer Name');
+define('REDEEM_DATE', 'Date Redeemed');
+define('IP_ADDRESS', 'IP Address');
+
+define('TEXT_REDEMPTIONS', 'Redemptions');
+define('TEXT_REDEMPTIONS_TOTAL', 'In Total');
+define('TEXT_REDEMPTIONS_CUSTOMER', 'For this Customer');
+define('TEXT_NO_FREE_SHIPPING', 'No Free Shipping');
+
+define('NOTICE_EMAIL_SENT_TO', 'Notice: Email sent to: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Error: No customer has been selected.');
+define('ERROR_NO_COUPON_AMOUNT', 'Error: No coupon amount has been entered. Either enter an amount or select free shipping.');
+define('ERROR_COUPON_EXISTS', 'Error: A coupon with the same coupon code already exists.');
+
+define('COUPON_NAME', 'Coupon Name');
+//define('COUPON_VALUE', 'Coupon Value');
+define('COUPON_AMOUNT', 'Coupon Amount');
+define('COUPON_CODE', 'Coupon Code');
+define('COUPON_STARTDATE', 'Start Date');
+define('COUPON_FINISHDATE', 'End Date');
+define('COUPON_FREE_SHIP', 'Free Shipping');
+define('COUPON_DESC', 'Coupon Description');
+define('COUPON_MIN_ORDER', 'Coupon Minimum Order');
+define('COUPON_USES_COUPON', 'Uses per Coupon');
+define('COUPON_USES_USER', 'Uses per Customer');
+define('COUPON_PRODUCTS', 'Valid Product List');
+define('COUPON_CATEGORIES', 'Valid Categories List');
+define('VOUCHER_NUMBER_USED', 'Number Used');
+define('DATE_CREATED', 'Date Created');
+define('DATE_MODIFIED', 'Date Modified');
+define('TEXT_HEADING_NEW_COUPON', 'Create New Coupon');
+define('TEXT_NEW_INTRO', 'Please fill out the following information for the new coupon.<br>');
+
+
+define('COUPON_NAME_HELP', 'A short name for the coupon');
+define('COUPON_AMOUNT_HELP', 'The value of the discount for the coupon, either fixed or add a % on the end for a percentage discount.');
+define('COUPON_CODE_HELP', 'You can enter your own code here, or leave blank for an auto generated one.');
+define('COUPON_STARTDATE_HELP', 'The date the coupon will be valid from');
+define('COUPON_FINISHDATE_HELP', 'The date the coupon expires');
+define('COUPON_FREE_SHIP_HELP', 'The coupon gives free shipping on an order. Note: This overrides the coupon_amount figure but respects the minimum order value');
+define('COUPON_DESC_HELP', 'A description of the coupon for the customer');
+define('COUPON_MIN_ORDER_HELP', 'The minimum order value before the coupon is valid');
+define('COUPON_USES_COUPON_HELP', 'The maximum number of times the coupon can be used; leave blank if you want no limit.');
+define('COUPON_USES_USER_HELP', 'Number of times a user can use the coupon, leave blank for no limit.');
+define('COUPON_PRODUCTS_HELP', 'A comma separated list of product_ids that this coupon can be used with. Leave blank for no restrictions.');
+define('COUPON_CATEGORIES_HELP', 'A comma separated list of cpaths that this coupon can be used with, leave blank for no restrictions.');
+
+
+define('ALT_CONFIRM_DELETE_VOUCHER', 'Confirm Delete Voucher');
+define('ALT_CANCEL', 'Cancel');
+define('VIEW', 'View');
+define('ALT_EMAIL_VOUCHER', 'Email Voucher');
+define('ALT_EDIT_VOUCHER', 'Edit Voucher');
+define('ALT_DELETE_VOUCHER', 'Delete Voucher');
+define('ALT_VOUCHER_REPORT', 'Voucher Report');
+define('COUPON_BUTTON_EMAIL_VOUCHER', 'Email Voucher');
+define('COUPON_BUTTON_EDIT_VOUCHER', 'Edit Voucher');
+define('COUPON_BUTTON_DELETE_VOUCHER', 'Delete Voucher');
+define('COUPON_BUTTON_VOUCHER_REPORT', 'Voucher Report');
+define('COUPON_BUTTON_PREVIEW', 'Preview');
+define('COUPON_BUTTON_BACK', 'Back');
+define('COUPON_STATUS', 'Status');
+define('COUPON_STATUS_HELP', 'Set to ' . IMAGE_ICON_STATUS_RED . ' to disable customers\' ability to use the coupon.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/coupon_restrict.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/coupon_restrict.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/coupon_restrict.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: coupon_restrict.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TOP_BAR_TITLE', 'Statistics');
+define('HEADING_TITLE', 'Discount Coupons');
+define('HEADING_TITLE_STATUS', 'Status : ');
+define('TEXT_CUSTOMER', 'Customer:');
+define('TEXT_COUPON', 'Coupon Name');
+define('TEXT_COUPON_ALL', 'All Coupons');
+define('TEXT_COUPON_ACTIVE', 'Active Coupons');
+define('TEXT_COUPON_INACTIVE', 'Inactive Coupons');
+define('TEXT_SUBJECT', 'Subject:');
+define('TEXT_FROM', 'From:');
+define('TEXT_FREE_SHIPPING', 'Free Shipping');
+define('TEXT_MESSAGE', 'Message:');
+define('TEXT_SELECT_CUSTOMER', 'Select Customer');
+define('TEXT_ALL_CUSTOMERS', 'All Customers');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'To All Newsletter Subscribers');
+define('TEXT_CONFIRM_DELETE', 'Are you sure you want to delete this Coupon?');
+
+define('TEXT_TO_REDEEM', 'You can redeem this coupon during checkout. Just enter the code in the box provided, and click on the redeem button.');
+define('TEXT_IN_CASE', ' in case you have any problems. ');
+define('TEXT_VOUCHER_IS', 'The coupon code is ');
+define('TEXT_REMEMBER', 'Don\'t lose the coupon code, make sure to keep the code safe so you can benefit from this special offer.');
+define('TEXT_VISIT', 'when you visit ' . HTTP_SERVER . DIR_WS_CATALOG);
+define('TEXT_ENTER_CODE', ' and enter the code ');
+
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+
+define('NOTICE_EMAIL_SENT_TO', 'Notice: Email sent to: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Error: No customer has been selected.');
+define('COUPON_NAME', 'Coupon Name');
+//define('COUPON_VALUE', 'Coupon Value');
+define('COUPON_AMOUNT', 'Coupon Amount');
+define('COUPON_CODE', 'Coupon Code');
+define('COUPON_STARTDATE', 'Start Date');
+define('COUPON_FINISHDATE', 'End Date');
+define('COUPON_FREE_SHIP', 'Free Shipping');
+define('COUPON_DESC', 'Coupon Description');
+define('COUPON_MIN_ORDER', 'Coupon Minimum Order');
+define('COUPON_USES_COUPON', 'Uses per Coupon');
+define('COUPON_USES_USER', 'Uses per Customer');
+define('COUPON_PRODUCTS', 'Valid Product List');
+define('COUPON_CATEGORIES', 'Valid Categories List');
+define('VOUCHER_NUMBER_USED', 'Number Used');
+define('DATE_CREATED', 'Date Created');
+define('DATE_MODIFIED', 'Date Modified');
+define('TEXT_HEADING_NEW_COUPON', 'Create New Coupon');
+define('TEXT_NEW_INTRO', 'Please fill out the following information for the new coupon.<br>');
+
+
+define('COUPON_NAME_HELP', 'A short name for the coupon');
+define('COUPON_AMOUNT_HELP', 'The value of the discount for the coupon, either fixed or add a % on the end for a percentage discount.');
+define('COUPON_CODE_HELP', 'You can enter your own code here, or leave blank for an auto generated one.');
+define('COUPON_STARTDATE_HELP', 'The date the coupon will be valid from');
+define('COUPON_FINISHDATE_HELP', 'The date the coupon expires');
+define('COUPON_FREE_SHIP_HELP', 'The coupon gives free shiiping on an order. Note. This overides the coupon_amount figure but respects the minimum order value');
+define('COUPON_DESC_HELP', 'A description of the coupon for the customer');
+define('COUPON_MIN_ORDER_HELP', 'The minimum order value before the coupon is valid');
+define('COUPON_USES_COUPON_HELP', 'The maximum number of times the coupon can be used, leave blank if you want no limit.');
+define('COUPON_USES_USER_HELP', 'Number of times a user can use the coupon, leave blank for no limit.');
+define('COUPON_PRODUCTS_HELP', 'A comma separated list of product_ids that this coupon can be used with. Leave blank for no restrictions.');
+define('COUPON_CATEGORIES_HELP', 'A comma separated list of cpaths that this coupon can be used with, leave blank for no restrictions.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/create_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: create_account.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Create an Account');
+define('HEADING_TITLE', 'Add a New Customer');
+define('HEADING_NEW', 'Order Process');
+define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><b>NOTE:</b></font></small> If you already have an account with us, please login at the <a href="%s"><u>login page</u></a>.');
+define('TEXT_VISITOR_CART', '<font color="#FF0000"><b> We want to get your order to you as quickly as possible! We need the following information to process your order efficiently.</b></font>');
+define('TEXT_RETURN_CUSTOMER', '<font color="#FF0000">Already have a profile? Please login!</font>');
+define('NAVBAR_NEW_TITLE', 'Order Process');
+define('TEXT_PRIVACY', '<font color="#FF0000"><b>Haven\'t bought from us before? Ordering is easy. Start by filling in all required fields, and then clicking the \'continue\' button. </b>');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/create_account_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/create_account_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/create_account_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: create_account_process.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('NAVBAR_TITLE', 'Create an Account');
+define('HEADING_TITLE', 'Account Information');
+define('HEADING_NEW', 'Order Process');
+define('NAVBAR_NEW_TITLE', 'Order Process');
+
+define('EMAIL_SUBJECT', 'Welcome to ' . STORE_NAME);
+define('EMAIL_GREET_MR', 'Dear Mr. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_MS', 'Dear Ms. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_NONE', 'Dear ' . stripslashes($HTTP_POST_VARS['firstname']) . ',' . "\n\n");
+define('EMAIL_WELCOME', 'We welcome you to <b>' . STORE_NAME . '</b>.' . "\n\n");
+define('EMAIL_TEXT', 'You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n\n");
+define('EMAIL_CONTACT', 'For help with any of our online services, please email us: ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n\n");
+define('EMAIL_WARNING', '<b>Note:</b> This email address was given to us by one of our customers. If you did not signup for a free member account, please send an Email to us:' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n");
+define('EMAIL_PASS_1', 'Your password for this account is ');
+define('EMAIL_PASS_2', ', keep it in a safe place. (Please note: Your password is case sensitive.)');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Create an Account');
+define('NAVBAR_TITLE_2', 'Success');
+define('HEADING_TITLE', '<font color="#00CC33">Success:&nbsp;&nbsp;</font>Customer\'s Account Has Been Created!');
+define('BUTTON_TITLE1', 'You can now take a manual order:');
+define('BUTTON_TITLE2', 'Create another new customer account:');
+define('BUTTON_TITLE3', 'Exit to Admin home page:');
+
+define('IMAGE_BUTTON_CREATE_ORDER', 'create order');
+define('IMAGE_BUTTON_CREATE_CUSTOMER', 'new customer');
+define('IMAGE_BUTTON_ADMIN_HOME', 'admin home');
+
+define('TEXT_ACCOUNT_CREATED', '');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/create_order.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/create_order.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/create_order.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: create_order.php,v 1.3 2004/09/08 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2004 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+define('HEADING_STEP1', 'STEP 1 - Choose a customer & check their details');
+
+define('HEADING_STEP2', 'STEP 2 - Choose payment and Shipping Meathods for new order #');
+define('HEADING_INSTRUCT1', '!!! INSTRUCTIONS !!!');
+define('HEADING_INSTRUCT2', 'Note: If you edit the orders product quanities<br>
+              they will not update your stock levels with the<br>
+          changes.  So make sure you update them after this<br>
+          edit section.<br>');
+define('HEADING_STEP3', 'Step 3 ADD A NEW PRODUCT');
+define('HEADING_SHIPPING', 'Shipping Method:');
+
+define('TEXT_ADD_PROD_STEP1', 'STEP 1:');
+define('TEXT_ADD_STEP2', 'STEP 2:');
+define('TEXT_ADD_STEP3', 'STEP 3:');
+define('TEXT_ADD_STEP4', 'STEP 4:');
+
+define('HEADING_CREATE', 'Check Customer Details');
+
+define('TEXT_SELECT_CUST', 'Select a Customer:');
+define('TEXT_SELECT_CURRENCY', 'Select currency:');
+define('BUTTON_TEXT_SELECT_CUST', 'Select This Customer');
+define('TEXT_OR_BY', 'or Customer ID:');
+define('BUTTON_TEXT_CHOOSE_CUST', 'Select This Customer ID');
+define('BUTTON_SUBMIT', 'confirm');
+
+define('TEXT_ADD_PROD', 'Add Product ');
+define('TEXT_SELECT_PROD', 'Select this product');
+
+define('TEXT_ADD_CAT_CHOOSE', '--- CHOOSE A CATEGORY ---\n');
+define('TEXT_SELECT_CAT', 'Select this category');
+define('TEXT_ADD_PROD_CHOOSE', 'Add Product ');
+
+define('TEXT_SELECT_OPT', 'Select options');
+define('TEXT_SELECT_OPT_SKIP', 'No options for this product');
+
+define('TEXT_ADD_QUANTITY', ' Quantity');
+define('TEXT_ADD_NOW', 'Add Now!');
+define('TEXT_VIEW_CC', ' To View CC Fields');
+define('TEXT_VIEW_PO', ' or View PO Fields');
+
+define('TEXT_INFO_PO', 'PO Information:');
+define('TEXT_INFO_NAME', 'Account name:');
+define('TEXT_INFO_AC_NR', 'Account number:');
+define('TEXT_INFO_PO_NR', 'Purchase Order Nr:');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Please Select');
+define('TYPE_BELOW', 'Type Below');
+
+define('JS_ERROR', 'Errors have occured during the process of your form!\nPlease make the following corrections:\n\n');
+
+define('JS_GENDER', '* The \'Gender\' value must be chosen.\n');
+define('JS_FIRST_NAME', '* The \'First Name\' entry must have at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_LAST_NAME', '* The \'Last Name\' entry must have at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_DOB', '* The \'Date of Birth\' entry must be in the format: xx/xx/xxxx (month/day/year).\n');
+define('JS_EMAIL_ADDRESS', '* The \'E-Mail Address\' entry must have at least ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_ADDRESS', '* The \'Street Address\' entry must have at least ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_POST_CODE', '* The \'Post Code\' entry must have at least ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.\n');
+define('JS_CITY', '* The \'Suburb\' entry must have at least ' . ENTRY_CITY_MIN_LENGTH . ' characters.\n');
+define('JS_STATE', '* The \'State\' entry must be selected.\n');
+define('JS_STATE_SELECT', '-- Select Above --');
+define('JS_ZONE', '* The \'State\' entry must be selected from the list for this country.\n');
+define('JS_COUNTRY', '* The \'Country\' entry must be selected.\n');
+define('JS_TELEPHONE', '* The \'Telephone Number\' entry must have at least ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.\n');
+define('JS_PASSWORD', '* The \'Password\' and \'Confirmation\' entries must match and have at least ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.\n');
+
+define('CATEGORY_COMPANY', 'Company Details');
+define('CATEGORY_PERSONAL', 'Personal Details');
+define('CATEGORY_ADDRESS', 'Address');
+define('CATEGORY_CONTACT', 'Contact Information');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Password');
+define('CATEGORY_CORRECT', 'If this is the right customer, press the Confirm button below.');
+define('ENTRY_CUSTOMERS_ID', 'ID:');
+define('ENTRY_CUSTOMERS_ID_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COMPANY', 'Company Name:');
+define('ENTRY_NAME', 'Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Gender:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_GENDER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FIRST_NAME', 'First Name:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_FIRST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_LAST_NAME', 'Last Name:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_LAST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_LAST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_DATE_OF_BIRTH', 'Date of Birth:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<small><font color="#FF0000">(eg. 05/21/1970)</font></small>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '&nbsp;<small>(eg. 05/21/1970) <font color="#AABBDD">required</font></small>');
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">Your email address doesn\'t appear to be valid!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<small><font color="#FF0000">email address already exists!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_STREET_ADDRESS', 'Street Address:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_STREET_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Post Code:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_POSTCODE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_POST_CODE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_CITY_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_CITY_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_CITY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_CITY', 'City:');
+define('ENTRY_STATE', 'State/Province:');
+define('ENTRY_STATE_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_STATE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COUNTRY', 'Country:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_TELEPHONE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FAX_NUMBER', 'Fax Number:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Subscribed');
+define('ENTRY_NEWSLETTER_NO', 'Unsubscribed');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_PASSWORD_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_PASSWORD_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_PASSWORD_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+// manual order box text in includes/boxes/manual_order.php
+
+define('BOX_HEADING_MANUAL_ORDER', 'Manual Orders');
+define('BOX_MANUAL_ORDER_CREATE_ACCOUNT', 'Create Account');
+define('BOX_MANUAL_ORDER_CREATE_ORDER', 'Create Order');
+
+define('TITLE_1', 'Step-by-Step Manual Order Entry - Step 1');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/create_order_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/create_order_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/create_order_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: orders_status.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Create Order Admin');
+
+define('TEXT_CREATE_ORDERS_ADMIN_HELP', 'The two link below will take you to edit screens where you can edit the payment and shipping for the create orders contributions.');
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Create Order Admin');
+define('TEXT_LABEL_CREATE_ORDERS_ADMIN_PAYMENT', 'Edit Payment Methods');
+define('TEXT_LABEL_CREATE_ORDERS_ADMIN_SHIPPING', 'Edit Shipping Methods');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_ORDERS_STATUS_NAME', 'Orders Status:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new paymen meathod with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this payment?');
+define('TEXT_INFO_HEADING_NEW_PAYMENT', 'New Payment');
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Edit Payment');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Delete Payment');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'New Shipping');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Edit Shipping');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Delete Shipping');
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: The default order status can not be removed. Please set another order status as default, and try again.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This order status is currently used in orders.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This order status is currently used in the order status history.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/create_order_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/create_order_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/create_order_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: PAYMENT_MODULES.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Create Order Admin');
+
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Create Order Admin');
+define('TABLE_HEADING_CREATE_ORDERS_SORT', 'Sort Order');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> payment modules)');
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_PAYMENT_MODULES_NAME', 'Payment modules:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new paymen meathod with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this payment?');
+define('TEXT_INFO_HEADING_NEW_PAYMENT', 'New Payment');
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Edit Payment');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Delete Payment');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'New Shipping');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Edit Shipping');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Delete Shipping');
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: The default payment module can not be removed. Please set another payment module as default, and try again.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This payment module is currently used in orders.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This payment module is currently used in the payment module history.');
+define('TEXT_INFO_SORT_ORDER', 'Sort Order');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/create_order_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/create_order_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/create_order_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: create_order_process.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_CREATE', 'Check Customer Details');
+define('DEFAULT_PAYMENT_METHOD', "Payment on Local Pickup. We accept cash, Interac, Visa and Master Card.");
+define('TEXT_SUBTOTAL', "Subtotal :");
+define('TEXT_DISCOUNT', "Discount :");
+define('TEXT_DELIVERY', "Delivery :");
+define('TEXT_TAX', "Tax :");
+define('TEXT_TOTAL', "Total :");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/create_order_shipping.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/create_order_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/create_order_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: create_order_shipping.php,v 1.1 2004/08/19 23:38:51 teo Exp $
+  http://www.chainreactionworks.com
+
+  Copyright (c) 2005 chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Create Order Shipping');
+
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Create Order Shipping');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> shipping modules)');
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_SHIPPING_MODULES_NAME', 'Shipping modules:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new shipping method with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this shipping method?');
+define('TEXT_INFO_SORT_ORDER', 'Sort Order');
+
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Edit Payment');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Delete Payment');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'New Shipping');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Edit Shipping');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Delete Shipping');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This shipping module is currently used in orders.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This shipping module is currently used in the shipping module history.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/crypt.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/crypt.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/crypt.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes.');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning: key directory does not exist.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning: key directory is not writeable at : ');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/crypt_convert.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/crypt_convert.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/crypt_convert.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Convert from old key to new key.');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+
+define('TEXT_KEY_CURRENT', 'Current key is: ');
+define('TEXT_CONVRT_ALL', 'Convert all CC data to new key');
+define('TEXT_KEY_NEW', 'New key is: ');
+define('TEXT_KEY_STATUS_01', '<font color=red> <b> This file does not have a key </b></font>');
+define('TEXT_KEY_STATUS_02', '<font color=blue> <b> OK! This file has a key</b></font>');
+define('TEXT_KEY_STATUS_03', '<font color=red> <b> Please edit the key files(s) in the key manager </b></font>');
+
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/crypt_convert_1.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/crypt_convert_1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/crypt_convert_1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Convert CC data to new key');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+define('CC_ENCYPT_ERROR_01', '<font color=blue> <b> Sorry this is already encrypted </b></font>');
+
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/crypt_purge.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/crypt_purge.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/crypt_purge.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Remove cc data from cart');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b>  Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b> Unencrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Encryption Status');
+
+define('TEXT_KEY_CURRENT', 'Current key is: ');
+define('TEXT_CONVRT_ALL', 'Convert all CC data to new key');
+define('TEXT_KEY_NEW', 'New key is: ');
+define('TEXT_KEY_STATUS_01', '<font color=red> <b> This file does not have a key </b></font>');
+define('TEXT_KEY_STATUS_02', '<font color=blue> <b> OK! This file has a key</b></font>');
+define('TEXT_KEY_STATUS_03', '<font color=red> <b> Please edit the key files(s) in the key manager </b></font>');
+
+
+define('TEXT_PURGE_ALL', 'Purge all CC data from cart');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/crypt_update.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/crypt_update.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/crypt_update.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Decrypt/Encrypt: Orders with CC numbers');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+define('CC_ENCYPT_ERROR_01', '<font color=blue> <b> Sorry this is already encrypted </b></font>');
+define('CC_ENCYPT_ERROR_02', '<font color=blue> <b> Sorry this is already decrypted </b></font>');
+define('TEXT_ENCRPYT_ALL', 'Encrypt all cc numbers');
+define('TEXT_DECRYPT_ALL', 'Decrypt all cc numbers');
+
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/currencies.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: currencies.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Currencies');
+
+define('TABLE_HEADING_CURRENCY_NAME', 'Currency');
+define('TABLE_HEADING_CURRENCY_CODES', 'Code');
+define('TABLE_HEADING_CURRENCY_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_CURRENCY_TITLE', 'Title:');
+define('TEXT_INFO_CURRENCY_CODE', 'Code:');
+define('TEXT_INFO_CURRENCY_SYMBOL_LEFT', 'Symbol Left:');
+define('TEXT_INFO_CURRENCY_SYMBOL_RIGHT', 'Symbol Right:');
+define('TEXT_INFO_CURRENCY_DECIMAL_POINT', 'Decimal Point:');
+define('TEXT_INFO_CURRENCY_THOUSANDS_POINT', 'Thousands Point:');
+define('TEXT_INFO_CURRENCY_DECIMAL_PLACES', 'Decimal Places:');
+define('TEXT_INFO_CURRENCY_LAST_UPDATED', 'Last Updated:');
+define('TEXT_INFO_CURRENCY_VALUE', 'Value:');
+define('TEXT_INFO_CURRENCY_EXAMPLE', 'Example Output:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new currency with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this currency?');
+define('TEXT_INFO_HEADING_NEW_CURRENCY', 'New Currency');
+define('TEXT_INFO_HEADING_EDIT_CURRENCY', 'Edit Currency');
+define('TEXT_INFO_HEADING_DELETE_CURRENCY', 'Delete Currency');
+define('TEXT_INFO_SET_AS_DEFAULT', TEXT_SET_DEFAULT . ' (requires a manual update of currency values)');
+define('TEXT_INFO_CURRENCY_UPDATED', 'The exchange rate for %s (%s) was updated successfully via %s.');
+
+define('ERROR_REMOVE_DEFAULT_CURRENCY', 'Error: The default currency can not be removed. Please set another currency as default, and try again.');
+define('ERROR_CURRENCY_INVALID', 'Error: The exchange rate for %s (%s) was not updated via %s. Is it a valid currency code?');
+define('WARNING_PRIMARY_SERVER_FAILED', 'Warning: The primary exchange rate server (%s) failed for %s (%s) - trying the secondary exchange rate server.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Customers');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_FIRSTNAME', 'First Name');
+define('TABLE_HEADING_LASTNAME', 'Last Name');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_DATE_ACCOUNT_CREATED', 'Account Created:');
+define('TEXT_DATE_ACCOUNT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_DATE_LAST_LOGON', 'Last Logon:');
+define('TEXT_INFO_NUMBER_OF_LOGONS', 'Number of Logons:');
+define('TEXT_INFO_COUNTRY', 'Country:');
+define('TEXT_INFO_NUMBER_OF_REVIEWS', 'Number of Reviews:');
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this customer?');
+define('TEXT_DELETE_REVIEWS', 'Delete %s review(s)');
+define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Delete Customer');
+define('TYPE_BELOW', 'Type below');
+define('PLEASE_SELECT', 'Select One');
+
+// Eversun mod for sppc and qty price breaks
+define('TABLE_HEADING_CUSTOMERS_GROUPS', 'Customer&#160;Group');
+define('TABLE_HEADING_REQUEST_AUTHENTICATION', 'RA');
+define('ENTRY_CUSTOMERS_PAYMENT_SET', 'Set payment modules for the customer');
+define('ENTRY_CUSTOMERS_PAYMENT_DEFAULT', 'Use settings from Group or Configuration');
+define('ENTRY_CUSTOMERS_PAYMENT_SET_EXPLAIN', 'If you choose <b><i>Set payment modules for the customer</i></b> but do not check any of the boxes, default settings (Group settings or Configuration) will still be used.');
+define('ENTRY_CUSTOMERS_SHIPPING_SET', 'Set shipping modules for the customer');
+define('ENTRY_CUSTOMERS_SHIPPING_DEFAULT', 'Use settings from Group or Configuration');
+define('ENTRY_CUSTOMERS_SHIPPING_SET_EXPLAIN', 'If you choose <b><i>Set shipping modules for the customer</i></b> but do not check any of the boxes, default settings (Group settings or Configuration) will still be used.');
+define('ENTRY_CUSTOMERS_EMAIL_VALIDATED','Email Validated:');
+define('ENTRY_EMAILVALIDATE_YES', 'Validated (active)');
+define('ENTRY_EMAILVALIDATE_NO', 'Unvalidated (inactive)');
+define('TEXT_EMAIL_VALIDATE_FEATURE','Require E-mail confirmation on account creation is set off.');
+
+define('ALT_IC_UP',' --> A-B-C From Top ');
+define('ALT_IC_DOWN',' --> Z-X-Y From Top ');
+define('ALT_IC_UP_NUM',' --> 1-2-3 From Top ');
+define('ALT_IC_DOWN_NUM',' --> 3-2-1 From Top ');
+define('TABLE_HEADING_CUSTOMERS_NO','No.');
+// Eversun mod end for sppc and qty price breaks
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/customers_groups.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/customers_groups.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/customers_groups.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+   for Separate Pricing Per Customer v4 2005/03/03
+*/
+  
+define('HEADING_TITLE', 'Groups');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('ENTRY_GROUPS_NAME', 'Group&#160;Name:');
+define('ENTRY_GROUP_SHOW_TAX', 'Show&#160;prices&#160;with/without&#160;tax:');
+define('ENTRY_GROUP_SHOW_TAX_YES', 'Show prices with tax');
+define('ENTRY_GROUP_SHOW_TAX_NO', 'Show prices without tax');
+
+define('ENTRY_GROUP_TAX_EXEMPT', 'Tax Exempt:'); 
+define('ENTRY_GROUP_TAX_EXEMPT_YES', 'Yes'); 
+define('ENTRY_GROUP_TAX_EXEMPT_NO', 'No'); 
+
+define('ENTRY_GROUP_PAYMENT_SET', 'Set payment modules for the customer group');
+define('ENTRY_GROUP_PAYMENT_DEFAULT', 'Use settings from Configuration');
+define('ENTRY_PAYMENT_SET_EXPLAIN', 'If you choose <b><i>Set payment modules for the customer group</i></b> but do not check any of the boxes, default settings will still be used.');
+
+define('ENTRY_GROUP_SHIPPING_SET', 'Set shipping modules for the customer group');
+define('ENTRY_GROUP_SHIPPING_DEFAULT', 'Use settings from Configuration');
+define('ENTRY_SHIPPING_SET_EXPLAIN', 'If you choose <b><i>Set shipping modules for the customer group</i></b> but do not check any of the boxes, default settings will still be used.');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this group?');
+define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS_GROUPS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> Customers Groups)');
+define('TEXT_INFO_HEADING_DELETE_GROUP', 'Delete Group');
+
+define('ERROR_CUSTOMERS_GROUP_NAME', 'Please enter a Group Name');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/data.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/data.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/data.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Data Import/Export system');
+
+define('HEADING_TITLE_1', 'Add New Feed Setting');
+define('HEADING_TITLE_2', 'Edit Feed Setting');
+
+define('TABLE_HEADING_FEED_NAME', 'Name of Feed');
+define('TABLE_HEADING_FEED_DISC', 'Data Feed Discription');
+
+
+define('TEXT_FEED_HELP', 'Do each step in order it is list for each feed');
+
+define('TEXT_FEED_HELP_CONFIGURE', '1. Click on the run button to run processes');
+define('TEXT_FEED_HELP_SELECT', '2. Click on the ' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO). ' for more information');
+define('TEXT_FEED_HELP_PREFEED', '3. Configure, Build categories, Pre process, Submit feed');
+define('TEXT_FEED_HELP_RUN', '');
+define('TEXT_FEED_HELP_NOTES', 'Notes: Feeds with * are not installed');
+
+
+
+define('TEXT_FEED_FROOGLE', '<b> Froogle </b>');
+define('TEXT_FEED_YAHOO', '<b>Yahoo</b>');
+define('TEXT_FEED_BIZRATE', '<b>Bizrate</b>');
+define('TEXT_FEED', '<i>Feed:: </i>');
+define('TEXT_CONFIGURE', '<i>Configure: </i>');
+define('TEXT_SET_CATEGORIES', '<i>Set Categories: </i>');
+define('TEXT_FEED_SELECT', '<i>Select Feed: </i>');
+define('TEXT_FEED_PRE_FEED', '<i>Pre Feed Process: </i>');
+define('TEXT_FEED_RUN', '<i>Submit Feed: </i> ');
+
+define('TEXT_FEED_CONFIGURE_HELP1', 'Build or edit unique configuration');
+define('TEXT_SET_CATEGORIES_HELP1', 'You do not need to run this process every time');
+define('TEXT_FEED_PRE_FEED_HELP1', 'Build feed the file');
+define('TEXT_FEED_PRE_EDIT_HELP1', 'Check Feed in text editor');
+define('TEXT_FEED_RUN_HELP1', 'Send feed to froogle');
+
+
+define('TEXT_INFO_FEED_NAME', 'Feed Name: ');
+define('TEXT_INFO_FEED_TYPE', 'Feed Type: ');
+define('TEXT_INFO_FEED_SERVICE', 'Feed service: ');
+define('TEXT_INFO_FEED_STATUS', 'Status: ');
+
+
+define('TEXT_INFO_STATUS_CHANGE', 'Status Change:');
+
+define('TEXT_DISPLAY_NUMBER_OF_DATA', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> data setups)');
+define('IMAGE_NEW_SETTING', 'New feed setting');
+
+define('WELCOME_TO_DATA_EXPORT_IMPORT_SYSTEM', 'Welcome to the Data Export/Import system');
+define('MSG_1', ' Please use the menu box to the left to select your task.<br><br> For in depth help use one of the links below <br><br>');
+define('MSG_2', 'Introduction to Data Export/Import system');
+define('MSG_3', 'Easy Populate:');
+define('MSG_4', 'EP Advance Import');
+define('MSG_5', 'EP Advance Export');
+define('MSG_6', 'EP Basic Import');
+define('MSG_7', 'EP Basic Export');
+define('MSG_8', 'Editing the export file');
+define('MSG_9', 'Data Feeder:');
+define('MSG_10', 'Introduction to data feed');
+define('MSG_11', '7 Steps to your First Froogle Feed');
+define('MSG_12', 'Configure a Feed');
+define('MSG_13', 'Run a Feed');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/data_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/data_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/data_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,82 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Data Admin');
+
+define('HEADING_TITLE_1', 'Add New Feed Setting');
+define('HEADING_TITLE_2', 'Edit Feed Setting');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TABLE_HEADING_FEED_NAME', 'Name of Feed');
+define('TABLE_HEADING_FEED_DISC', 'Data Feed Discription');
+define('TABLE_HEADING_FEED_FILE_TYPE', 'Data Feed File Type');
+define('TABLE_HEADING_FEED_TYPE', 'Feed Type');
+define('TABLE_HEADING_FEED_TYPE_PRODUCT', 'Product Feed Type');
+define('TABLE_HEADING_FEED', '<b>Froogle FTP information</b>');
+define('TABLE_HEADING_FEED_ADVANCE', '<b>Froogle Advance Settings</b>');
+define('TABLE_HEADING_FEED_FEED_SERVICE', 'Feed Service');
+define('TABLE_HEADING_FEED_STATUS', 'Status');
+define('TABLE_HEADING_FEED_FILE', 'File name');
+define('TABLE_HEADING_FEED_IMAGE', 'Image URL');
+define('TABLE_HEADING_FEED_PRODUCT', 'Product URL');
+define('TABLE_HEADING_FEED_FTP_SERVER', 'Froogle FTP Server Name');
+define('TABLE_HEADING_FEED_FTP_USER', 'Froogle FTP User Name');
+define('TABLE_HEADING_FEED_FTP_PASSWORD', 'Froogle FTP Password');
+define('TABLE_HEADING_FEED_FTP_DIRECTORY', 'Froogle FTP Directory');
+define('TABLE_HEADING_FEED_CUR', 'Use store Currency');
+define('TABLE_HEADING_FEED_CUR_USE', 'Other currency');
+define('TABLE_HEADING_FEED_LANG', 'Use store language');
+define('TABLE_HEADING_FEED_LANG_USE', 'Other language');
+define('TABLE_HEADING_FEED_CUR_CON', 'Convert Currency');
+define('TABLE_HEADING_FEED_TAX', 'Tax Class ID');
+
+define('TEXT_TYPE_BASIC', 'Basic');
+define('TEXT_TYPE_ADVANCE', 'Advance');
+define('TEXT_DATA_FEED_NAME', 'Feed Name');
+define('TEXT_TYPE_NONE', 'None');
+define('TEXT_TYPE_PRODUCTS', 'Products');
+define('TEXT_TYPE_BUSINESS', 'Business');
+define('TEXT_FEED_FROOGLE', 'Froogle Feed');
+define('TEXT_FEED_YAHOO', 'Yahoo Feed');
+
+define('TEXT_DATA_ID_ACTIVE', 'Active');
+define('TEXT_DATA_ID_DEACTIVE', 'Inactive');
+define('TEXT_DATA_VISIBLE_DO', 'Check to activate');
+
+define('TEXT_DATA_CUR_USE_FALSE', 'False: Use store default current');
+define('TEXT_DATA_CUR_USE_TRUE', 'True: Use currency listed below');
+
+define('TEXT_DATA_CUR_CONVERT_FALSE', 'False: Do not convert to currency');
+define('TEXT_DATA_CUR_CONVERT_TRUE', 'True: Convert currency');
+define('TEXT_DATA_CUR_LANG_FALSE', 'False: Use store default language');
+define('TEXT_DATA_CUR_LANG_TRUE', 'True: Use language selected below');
+define('TEXT_LANG_EN', 'English');
+define('TEXT_LANG_FR', 'French');
+define('TEXT_LANG_DE', 'German');
+define('TEXT_LANG_IT', 'Italian');
+define('TEXT_LANG_ES', 'Spanish');
+define('TEXT_LANG_JA', 'Jananese');
+
+define('TEXT_INFO_FEED_NAME', 'Feed Name: ');
+define('TEXT_INFO_FEED_TYPE', 'Feed Type: ');
+define('TEXT_INFO_FEED_SERVICE', 'Feed service: ');
+define('TEXT_INFO_FEED_STATUS', 'Status: ');
+
+
+define('TEXT_INFO_STATUS_CHANGE', 'Status Change:');
+
+define('TEXT_INFO_HEADING_DELETE_DATA', 'Delete Data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this data setup?');
+
+define('TEXT_DISPLAY_NUMBER_OF_DATA', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> data setups)');
+define('IMAGE_NEW_SETTING', 'New feed setting');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/define_language.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/define_language.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/define_language.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: define_language.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Language');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'File does not exist.');
+
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/define_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/define_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/define_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: define_language.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Main Page');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'File does not exist.');
+
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/document.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/document.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/document.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Documentation and help');
+
+define('HEADING_TITLE_1', 'Add New Feed Setting');
+
+define('TABLE_HEADING_FEED_NAME', 'Name of Feed');
+
+define('BOX_DOC_LANGUAGE_EDIT', 'Language editor');
+define('BOX_DOC_DATA', 'Data input/output');
+define('BOX_DOC_ADMIN', 'Admin');
+define('BOX_DOC_CAT', 'Catalog');
+define('BOX_DOC_MISC', 'Miscellaneous');
+
+
+define('HEADING_TITLE_01', 'Help: Introduction ');
+define('HEADING_TITLE_02', 'Help: Admin ');
+define('HEADING_TITLE_03', 'Help: Catalog ');
+define('HEADING_TITLE_04', 'Help: Miscellaneous');
+
+define('MENU_ITEM_01', 'Introduction');
+define('MENU_ITEM_02', 'Help: Admin');
+define('MENU_ITEM_03', 'Help: Catalog');
+define('MENU_ITEM_04', 'Help: Miscellaneous');
+
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/easypopulate.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/easypopulate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/easypopulate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+/*
+  $Id: easypopulate.php,v 1.4 2004/09/21  zip1 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Easy Populate Configuration');
+define('EASY_VERSION_A', 'Easy Populate Advanced ');
+define('EASY_VERSION_B', 'Easy Populate Basic ');
+define('EASY_EXPORT', ' Export');
+define('EASY_IMPORT', ' Import');
+define('EASY_VER_A', ' 3.01');
+define('EASY_VER_B', ' 3.01');
+define('EASY_DEFAULT_LANGUAGE', '  -  Default Language ');
+define('EASY_UPLOAD_FILE', 'File uploaded. ');
+define('EASY_UPLOAD_TEMP', 'Temporary filename: ');
+define('EASY_UPLOAD_USER_FILE', 'User filename: ');
+define('EASY_SIZE', 'Size: ');
+define('EASY_FILENAME', 'Filename: ');
+define('EASY_SPLIT_DOWN', 'Splitting of file complete. The split(s) are located at: ');
+define('EASY_UPLOAD_EP_FILE', 'Upload EP File for Import');
+define('EASY_SPLIT_EP_FILE', 'Upload and Split a EP File');
+define('EASY_SPLIT_EP_LOCAL', 'Split a EP File on the server');
+
+define('TEXT_IMPORT_TEMP', 'Import Data from file in %s');
+define('TEXT_INSERT_INTO_DB', 'Insert into DB');
+define('TEXT_SELECT_ONE', 'Select a EP File for Import');
+define('TEXT_SELECT_TWO', 'Select a EP File for Splitting');
+
+define('TEXT_SPLIT_FILE', 'Select a EP File');
+define('TEXT_SPLIT', 'Split a EP File');
+
+define('EASY_LABEL_CREATE', 'Create an export file');
+define('EASY_LABEL_CREATE_SELECT', 'Select method to save export file');
+define('EASY_LABEL_CREATE_SAVE', 'Save to temp file on server');
+define('EASY_LABEL_SELECT_DOWN', 'Select field set to export');
+define('EASY_LABEL_SORT', 'Select field for sort order');
+define('EASY_LABEL_PRODUCT_RANGE', 'Limit by Products_ID(s)');
+define('EASY_LABEL_LIMIT_CAT', 'Limit By Category');
+define('EASY_LABEL_LIMIT_MAN', 'Limit By Manufacturer');
+
+define('EASY_LABEL_PRODUCT_AVAIL', 'Range Available: ');
+define('EASY_LABEL_PRODUCT_TO', ' to ');
+define('EASY_LABEL_PRODUCT_RECORDS', '    Total number of records: ');
+define('EASY_LABEL_PRODUCT_BEGIN', 'begin: ');
+define('EASY_LABEL_PRODUCT_END', 'end: ');
+define('EASY_LABEL_PRODUCT_START', 'Start File Creation ');
+
+define('EASY_FILE_LOCATE', 'Building your export file is completed. Your files is named: ');
+define('EASY_FILE_LOCATE2', 'Building your export file is completed and saved to your local computer. Your files is named: ');
+
+define('EASY_FILE_LOCATE_2', ' by clicking this Link and going to the file manager');
+define('EASY_FILE_RETURN', ' You can return to EP by clicking this link.');
+define('EASY_IMPORT_TEMP_DIR', 'Import from Temp Dir ');
+define('EASY_LABEL_DOWNLOAD', 'Download');
+define('EASY_LABEL_COMPLETE', 'Complete');
+define('EASY_LABEL_TAB', 'tab-delimited .txt file to edit');
+define('EASY_LABEL_MPQ', 'Model/Price/Qty');
+define('EASY_LABEL_EP_MC', 'Model/Category');
+
+define('EASY_LABEL_EP_ATTRIB', 'Attributes');
+define('EASY_LABEL_NONE', 'None');
+define('EASY_LABEL_CATEGORY', '1st Category Name');
+define('PULL_DOWN_MANUFACTURES', 'Manufacturers');
+define('EASY_LABEL_PRODUCT', 'Product ID Number');
+define('EASY_LABEL_MANUFACTURE', 'Manufacturer ID Number');
+define('EASY_LABEL_EP_MA', 'Model/Attributes');
+define('EASY_LABEL_EP_FR_TITLE', 'Create EP or Froogle Files in Temp Dir ');
+define('EASY_LABEL_EP_DOWN_TAB', 'Create <b>Complete</b> tab-delimited .txt file in temp dir');
+define('EASY_LABEL_EP_DOWN_MPQ', 'Create <b>Model/Price/Qty</b> tab-delimited .txt file in temp dir');
+define('EASY_LABEL_EP_DOWN_MC', 'Create <b>Model/Category</b> tab-delimited .txt file in temp dir');
+define('EASY_LABEL_EP_DOWN_MA', 'Create <b>Model/Attributes</b> tab-delimited .txt file in temp dir');
+define('EASY_LABEL_EP_LIMIT', 'Limit number of products to Export');
+define('EASY_LABEL_NEW_PRODUCT', "<font color='green'> !New Product!</font><br>");
+define('EASY_LABEL_UPDATED', "<font color='blue'> Updated</font><br>");
+define('EASY_LABEL_DELETE_STATUS_1', "<font color='red'> !!Deleting product ");
+define('EASY_LABEL_DELETE_STATUS_2', " from the database !!</font><br>");
+define('EASY_LABEL_LINE_COUNT_1', 'Added ');
+define('EASY_LABEL_LINE_COUNT_2', 'records and closing file... ');
+define('EASY_LABEL_FILE_COUNT_1A', 'Creating file EPA_Split ');
+define('EASY_LABEL_FILE_COUNT_1B', 'Creating file EPB_Split ');
+define('EASY_LABEL_FILE_COUNT_2', '.txt ...  ');
+define('EASY_LABEL_FILE_CLOSE_1', 'Added ');
+define('EASY_LABEL_FILE_CLOSE_2', ' records and closing file...');
+define('EASY_LABEL_FILE_INSERT_LOCAL', 'Inserting local file: ');
+define('TEXT_INFO_TIMER', 'Script timer:');
+define('TEXT_INFO_SECOND', 'seconds.');
+
+//errormessages
+define('EASY_ERROR_1', 'Error 01 - Strange but there is no default language to work... That may not happen, just in case... ');
+define('EASY_ERROR_2', '... Error 02 - Too many characters in the model number.<br>
+      25 is the maximum on a standard cre install.<br>
+      Your maximum product_model length is set to ');
+define('EASY_ERROR_2A', ' <br>You can either shorten your model numbers or increase the size of the field in the database.</font>');
+define('EASY_ERROR_2B',  "<font color='red'>");
+define('EASY_ERROR_3', '<p class=smallText> Error 03 - No products_id field in record or it is the last line in the file. This line was not imported. <br><br>');
+define('EASY_ERROR_4', '<font color=red>ERROR 04 - v_customer_group_id and v_customer_price must occur in pairs</font>');
+define('EASY_ERROR_5', '</b><font color=red>Error 05 - You are trying to use a file created with EP Advanced, please try with Easy Populate Advanced </font>');
+define('EASY_ERROR_5a', '<font color=red><b><u>  Click here to return to Easy Populate Basic </u></b></font>');
+define('EASY_ERROR_6', '</b><font color=red>Error 06 - You are trying to use a file created with EP Basic, please try with Easy Populate Basic </font>');
+define('EASY_ERROR_6a', '<font color=red><b><u>  Click here to return to Easy Populate Advanced </u></b></font>');
+define('EASY_ERROR_7', '<p class=smallText> Error 07 - No Module field in record or it is the last line in the file. This line was not imported. <br><br>');
+
+// Eversun mod for Easy Populate Products Options, Values and Attributes
+define('EASY_VERSION_C', 'Easy Populate Options');
+define('EASY_LABEL_OPTIONS_ID', 'Options ID');
+define('EASY_LABEL_OPTIONS_NAME', 'Options Name');
+define('EASY_VERSION_D', 'Easy Populate Values');
+define('EASY_LABEL_VALUES_ID', 'Values ID');
+define('EASY_LABEL_VALUES_NAME', 'Values Name');
+define('EASY_VERSION_E', 'Easy Populate Attributes');
+define('TEXT_SELECT_ONE_OPTIONS', 'Select a EP Option File for Import');
+define('TEXT_SELECT_ONE_VALUES', 'Select a EP Values File for Import');
+define('TEXT_SELECT_ONE_ATTRIBUTES', 'Select a EP Attributes File for Import');
+define('EASY_ERROR_8', '<b><font color=red>Error - You didn\'t select any file</font></b>');
+define('EASY_INFO_SUCCESS', '<b><font color=red>Import Success</font></b>');
+define('EASY_INFO_FILE_NOT_FOUND', '<b><font color=red>File not Found</font></b>');
+define('EASY_INFO_CHECK_ERROR1', '<b><font color=red>Field %s not in the table %s.</font></b>');
+// Eversun mod end for Easy Populate Products Options, Values and Attributes
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/edit_key.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/edit_key.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/edit_key.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define ('HEADING_TITLE', 'Manage Key Files');
+define ('HELP_URL', DIR_WS_ADMIN . 'et_help/index.html');
+
+define('BUTTON_TEXT_SAVE_CHANGES', 'Save Changes');
+define('BUTTON_TEXT_RESTORE_FILE', 'Restore File');
+define('BUTTON_TEXT_RETURN_MAIN_EDIT', 'Return to Configuration');
+define('TEXT_RETURN_MAIN', 'Return to main file list');
+
+define('ERROR_TEXT_FILE_LOCKED', "ERROR: File '%s' is not writable");
+define('ERROR_TEXT_FILE_LOCKED1', "ERROR: The Key file: %s is not writable, to Edit the key you must change it's permissions to 777");
+
+define('ERROR_TEXT_FILE_OK', "Ok to edit the key file: %s it is writable");
+
+
+define('TEXT_HIDE_NAVIGATION', 'Hide Navigation');
+define('TEXT_SHOW_NAVIGATION', 'Show Navigation');
+
+define('TEXT_HELP_HELP', 'Quick Help');
+define('TEXT_HELP_HELP1', '1. Click on edit button to edit.');
+define('TEXT_HELP_HELP2', '2. When finished editing, Click on save.');
+define('TEXT_HELP_HELP3', '3. Onced saved, click on restore to revert back to orginal file.');
+define('TEXT_HELP_HELP4', '4. Click on create button to create new key file.');
+define('TEXT_HELP_HELP5', '5. Click on return button to return to main Manage Key screen.');
+
+define('TEXT_CRYPT_MESSAGE_1', 'Primary key file');
+define('TEXT_CRYPT_MESSAGE_2', 'New key file');
+define('TEXT_CRYPT_MESSAGE_3', 'Unkown');
+
+define('TABLE_HEADING_FILE_TYPE', 'File type');
+define('TABLE_HEADING_FILE_NAME', 'File name');
+define('TABLE_HEADING_FILE_ACTION', 'Action');
+
+define('EDIT_ACTION', 'Edit :');
+define('SAVED_ACTION', 'Saved file :');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/edit_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/edit_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/edit_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Editing Order');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('ADDING_TITLE', 'Adding a Product to Order');
+
+define('ADD_PRODUCT', 'Add a Product to Order');
+define('HEADING_ABANDONED', '<B>This order was not completed and abandoned!!! Order ID:  </B>');
+
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_TAX', 'Tax');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_UNIT_PRICE', 'Unit Price');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Total Price');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Customer Notified');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+
+define('ENTRY_CUSTOMER', 'Customer:');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Company');
+define('ENTRY_CUSTOMER_ADDRESS', 'Address');
+define('ENTRY_CUSTOMER_SUBURB', 'Suburb');
+define('ENTRY_CUSTOMER_CITY', 'City');
+define('ENTRY_CUSTOMER_STATE', 'State');
+define('ENTRY_CUSTOMER_POSTCODE', 'Postcode');
+define('ENTRY_CUSTOMER_COUNTRY', 'Country');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Sold To:');
+define('ENTRY_DELIVERY_TO', 'Delivery To:');
+define('ENTRY_SHIP_TO', 'Ship To:');
+define('ENTRY_SHIPPING_ADDRESS', 'Shipping Address:');
+define('ENTRY_BILLING_ADDRESS', 'Billing Address:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Credit Card Type:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Credit Card Expires:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Tax:');
+define('ENTRY_SHIPPING', 'Shipping:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'Date Last Updated:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notify Customer:');
+define('ENTRY_NOTIFY_COMMENTS', 'Append Comments:');
+define('ENTRY_PRINTABLE', 'Print Invoice');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Use a negative number -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Add New Product');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> CCV Code:  Not stored - due to processing regulations. Enable CCV email in module settings.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+define('TEXT_NO_ORDER_HISTORY', 'No Order History Available');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Order Update');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: Order does not exist.');
+define('SUCCESS_ORDER_UPDATED', 'Success: Order has been successfully updated.');
+define('WARNING_ORDER_NOT_UPDATED', 'Warning: Nothing to change. The order was not updated.');
+define('SUCCESS_PRODUCT_ADDED', 'Success : This order has been updated and a new product has been added');
+
+
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choose a product');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Choose an option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Product has no options, so skipping...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'pieces of this product');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Add');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+
+define('DISPLAY_BASKET', 'Display basket');
+define('DONT_ADD_NEW_PRODUCT', 'Don\'t Add New Product');
+define('SELECT_THESE_OPTIONS', "Select these Options");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/edit_textdata.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/edit_textdata.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/edit_textdata.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define ('HEADING_TITLE', 'Edit Language Defines');
+
+define('BUTTON_TEXT_SAVE_CHANGES', 'Save Changes');
+define('BUTTON_TEXT_RESTORE_FILE', 'Restore File');
+define('BUTTON_TEXT_RETURN_MAIN_EDIT', 'Return to Main Edit');
+define('TEXT_RETURN_MAIN', 'Return to main file list');
+
+define('ERROR_TEXT_FILE_LOCKED', "ERROR: File '%s' is not writable");
+
+define('TEXT_HIDE_NAVIGATION', 'Hide Navigation');
+define('TEXT_SHOW_NAVIGATION', 'Show Navigation');
+
+define('TEXT_HELP_HELP', '<b>Quick Help, when in edit mode</b>');
+define('TEXT_HELP_HELP1', '1. Click on edit button to edit.');
+define('TEXT_HELP_HELP2', '2. When finished editing, Click on save.');
+define('TEXT_HELP_HELP3', '3. Onced saved, click on restore to revert back to orginal file.');
+define('TEXT_HELP_HELP4', '4. Click on insert to add a new define to a language file. (Insert not functional at this time)');
+define('TEXT_HELP_HELP5', '5. Click on return button to return to main Edit Language Define screen.');
+
+define('TEXT_DEFINE_LABEL', '<b>Define label</b>');
+define('TEXT_DEFINE_TEXT', '<b>Define display text</b>');
+define('TEXT_RESTORE_FILE', 'Saved file : ');
+define('TEXT_EDIT_FILE', 'Editing file: ');
+define('TEXT_SAVE_FILE', 'Restored file : ');
+
+define('TABLE_HEADING_FILE_TYPE', 'File type');
+define('TABLE_HEADING_FILE_NAME', 'File name');
+define('TABLE_HEADING_FILE_ACTION', 'Action');
+
+define('TEXT_MIXED_CONSTANT', 'This variable is mixed please use advanced edtor to edit this file %s(to bottom)%s');
+define('TEXT_ADV_EDITOR', 'Full Page Editor - For Advanced Users Only');
+
+
+define('TEXT_LANGUGES', 'languges');
+define('TEXT_MSG_1', 'No matching defines found');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/email_subjects.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/email_subjects.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/email_subjects.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: email_subjects.php, v1 07/11/2005
+
+  Copyright (c) 2005 PassionSeed
+  http://PassionSeed.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Email Subjects');
+
+define('TABLE_HEADING_EMAIL_SUBJECTS', 'Contact Us Email Subjects');
+define('TABLE_HEADING_EMAIL_SUBJECTS_CATEGORY', 'Subject Category');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_HEADING_NEW_EMAIL_SUBJECT', 'New Email Subject');
+define('TEXT_HEADING_EDIT_EMAIL_SUBJECT', 'Edit Email Subject');
+define('TEXT_HEADING_DELETE_EMAIL_SUBJECT', 'Delete Email Subject');
+
+define('TEXT_EMAIL_SUBJECTS', 'Email Subjects:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+
+define('TEXT_NEW_INTRO', 'Please fill out the following information for the new email subject');
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+
+define('TEXT_EMAIL_SUBJECTS_NAME', 'Email Subject Name:');
+define('TEXT_EMAIL_SUBJECTS_CATEGORY', 'Email Subject Category:');
+define('TEXT_EMAIL_SUBJECTS_CATEGORY_CHOICE', '1 = Admin; 2 = Customer');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this email subject?');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/events_calendar.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/events_calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/events_calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: events_calendar v1.00 2003/03/08 18:09:16 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+
+  define('NAVBAR_TITLE', 'Events Calendar');
+  define('HEADING_TITLE', 'Events Calendar');
+  define('TEXT_SELECT_EVENT', 'Select event');
+  
+  define('TEXT_EVENTS_FOR', 'Events for ');
+  define('TEXT_EVENT_DATE', 'Date :');
+  define('TEXT_EVENTS_START', 'Events starting on ');
+  define('TEXT_EVENT_START_DATE', 'From :');
+  define('TEXT_EVENT_END_DATE', 'Through :');
+  define('TEXT_EVENT_LINK', 'Link :');
+  define('TEXT_EVENT_OSC_LINK', 'OSC link :');
+  define('TEXT_EVENT_TITLE', 'Title :');
+  define('TEXT_EVENT_DESCRIPTION', 'Event :');
+  define('TEXT_EVENT_MORE', '... More >>');
+  define('TEXT_NO_EVENTS', 'No Events found.');
+  define('TEXT_OTHER_EVENTS', 'Other events for today :');
+
+  define('TEXT_DISPLAY_NUMBER_OF_EVENTS', 'Displaying event n° <b>%d</b><b>%_</b> of <b>%d</b> for ');
+  define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> events) ');
+  define('MAX_DISPLAY_PAGE_LINKS', 5);
+  define('MAX_DISPLAY_NUMBER_EVENTS', 5);
+  
+  define('BOX_CALENDAR_TITLE', ' View all events');
+  define('BOX_GO_BUTTON', 'go');
+  define('BOX_GO_BUTTON_TITLE', ' submit - month view ');
+  define('BOX_TODAY_BUTTON', ' T ');
+  define('BOX_TODAY_BUTTON_TITLE', ' view this month ');
+  define('BOX_YEAR_VIEW_BUTTON', ' Y ');
+  define('BOX_YEAR_VIEW_BUTTON_TITLE', ' year view ');
+  define('BOX_NEXT_LINK', 'next_month');
+  define('BOX_PREV_LINK', 'previous_month');
+  define('BOX_CLICK_LINK', 'Click for events');
+  
+  define('FIRST_DAY_OF_WEEK', 0);// First day of the week  1=Monday 0=Sunday;
+
+  define('NUMBER_OF_YEARS', 5);  //n° of years to be shown in drop-down
+  
+  define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
+  
+
+  
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/events_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/events_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/events_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Events Manager');
+define('DELETE_EVENTS_ERROR', 'Please select a date.');
+define('EVENTS_ERROR', 'Form error.\n\n');
+
+define('TABLE_HEADING_ID', 'Event ID');
+define('TABLE_HEADING_SIZE', 'Size');
+define('TABLE_HEADING_TITLE', 'Title');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+define('TABLE_HEADING_DATE_START', 'Sart Date');
+define('TABLE_HEADING_DATE_END', 'End Date');
+define('TABLE_HEADING_LINKS', 'Link / OSClink');
+define('TABLE_HEADING_OSC_LINK', 'OSC Link');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TEXT_NO_EVENTS', 'No events found.');
+
+define('TEXT_EVENT_TITLE', 'Title:');
+define('TEXT_EVENT_DESCRIPTION', 'Event:');
+
+define('TEXT_EVENT_ID', 'Event ID:');
+define('TEXT_EVENT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EVENT_START', 'Start Date:');
+define('TEXT_EVENT_END', 'End Date:');
+define('TEXT_CHOOSE_MANUFACTURER', 'Manufacturer:');
+define('TEXT_CHOOSE_CATEGORY', 'Category:');
+define('TEXT_CHOOSE_PRODUCT', 'Product:');
+define('TEXT_NO_PRODUCTS', 'No Products');
+define('TEXT_CHOOSE_UPCOMING', 'Upcoming products:');
+define('TEXT_NO_UPCOMING_PRODUCTS', 'No upcoming products:');
+
+define('TEXT_EVENT_OSC_LINK', 'OSC Link:');
+define('TEXT_EVENT_OSC_LINK_HELP', '( link to a specific Manufacturer / Category / Product or Upcoming product )');
+define('TEXT_CURRENT_OSC_LINK', 'Current OSC link: ');
+define('TEXT_START_DATE_NOTE', 'Upcoming products note: <b>Start Date</b> field will be set to "products_date_available".');
+define('TEXT_EVENT_LINK', 'Link:');
+define('TEXT_EVENT_LINK_HELP', 'Additional link, eg.: www.mysite.com/event_page.html (no http://)');
+define('TEXT_EVENT_IMAGE', 'Image:');
+define('TEXT_EVENT_NO_IMAGE', 'No Image:');
+
+define('TEXT_EVENT_PREVIEW', 'Preview:');
+
+define('TEXT_EVENT_DELETE_CONFIRM', 'Sure you want to delete event <a href="'. FILENAME_EVENTS_MANAGER .'?eID='. $eID .'&action=edit"><font color="red"><b>'. $eID .'</b></font></a> ?');
+define('TEXT_DELETE_EVENTS', 'Delete all events before:');
+define('TEXT_EVENTS_DELETE_CONFIRM', 'Sure you want to delete all events before <b>'. $before .'</b> ?');
+
+
+define('TEXT_INFO_DELETE_EVENT_INTRO', 'Are you sure you want to delete this event?');
+
+define('ERROR_EVENT_TITLE', 'Error: Event Title required');
+define('ERROR_EVENT_START_DATE', 'Error: Event Start Date required');
+
+
+define('ERROR_REQUIRED_FIELDS', ' * required');
+
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/faq.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+  define('FAQ_ACTION', 'Action');
+  define('FAQ_ACTIVATION_ID', 'Activate? FAQ ID=');
+  define('FAQ_ACTIVATED_ID', 'Activated FAQ ID=');
+  define('FAQ_ADD', 'New FAQ');
+  define('FAQ_ADD_QUEUE', 'FAQ to queue');
+  define('FAQ_ALERT', 'Empty FAQ system');
+  define('FAQ_ANSWER', 'Answer');
+  define('FAQ_CREATED', 'Created');
+  define('FAQ_DATE', 'Date');
+  define('FAQ_DEACTIVATION_ID', 'Deactivate? FAQ ID=');
+  define('FAQ_DEACTIVATED_ID', 'Deactivated FAQ ID=');
+  define('FAQ_DELETE_CONFITMATION_ID', 'Delete Confirmation FAQ ID=');
+  define('FAQ_DELETE_ID', 'Delete FAQ ID=');
+  define('FAQ_DELETED_ID', 'Deleted FAQ ID=');
+  define('FAQ_EDIT_ID', 'Edit FAQ ID=');
+  define('FAQ_ERROR_20', 'You have not defined a valid value for option <b>Queue</b>. You can only define a numeric value');
+  define('FAQ_ERROR_80', 'You did not fill all <b>necessary fields</b>');
+  define('FAQ_ID', 'ID');
+  define('FAQ_ID_ACTIVE', 'this FAQ is Active'); 
+  define('FAQ_ID_DEACTIVE', 'this FAQ is NOT active'); 
+  define('FAQ_LANGUAGE', 'Language');
+  define('FAQ_MANAGER', 'FAQ Manager');
+  define('FAQ_NUMBER', 'No.');
+  define('FAQ_QUESTION', 'Question');
+  define('FAQ_QUEUE', 'Queue');
+  define('FAQ_QUEUE_LIST', 'QueueList: ');
+  define('FAQ_SORT_BY', 'In FAQ Page this Sort by');
+  define('FAQ_STATUS', 'Status');
+  define('FAQ_SYSTEM', 'FAQ System');
+  define('FAQ_UPDATED_ID', 'Updated FAQ ID=');
+  define('FAQ_VIEW', 'FAQ View');
+  define('FAQ_VIEW_ALL', 'FAQ View All');
+  define('FAQ_VISIBLE', 'Visible');
+  define('FAQ_WARNING', 'Warning');
+
+  define('ENTRY_CATEGORY', 'Category:');
+  define('TEXT_NO_CATEGORY', 'No Category');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/faq_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/faq_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/faq_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: faq_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'FAQ Categories');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_FAQ_HEADING_NEW_FAQ_CATEGORY', 'New Category');
+define('TEXT_FAQ_HEADING_EDIT_FAQ_CATEGORY', 'Edit Category');
+define('TEXT_FAQ_HEADING_DELETE_FAQ_CATEGORY', 'Delete Category');
+
+define('TEXT_FAQ_CATEGORY_COUNT', 'FAQs:');
+define('TEXT_FAQ_CATEGORY_STATUS', 'Status:');
+define('TEXT_FAQ_CATEGORY_DESCRIPTION', 'Description:');
+define('TEXT_FAQ_CATEGORY_SORT_ORDER', 'Sort Order:');
+define('TEXT_DATE_FAQ_CATEGORY_CREATED', 'Created:');
+define('TEXT_DATE_FAQ_CATEGORY_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_NEW_FAQ_CATEGORIES_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_EDIT_FAQ_CATEGORIES_INTRO', 'Please make any necessary changes');
+define('TEXT_DELETE_FAQ_CATEGORIES_INTRO', 'Are you sure you want to delete this category?');
+
+define('TEXT_FAQ_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_FAQ_CATEGORIES_DESCRIPTION', 'Category Description:');
+define('TEXT_FAQ_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_FAQ_CATEGORIES_SORT_ORDER', 'Sort Order:');
+define('TEXT_FAQ_CATEGORIES_STATUS', 'Status:');
+define('TEXT_FAQ_CATEGORIES_STATUS_ENABLE', 'Enable');
+define('TEXT_FAQ_CATEGORIES_STATUS_DISABLE', 'Disable');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>WARNING:</b> There are %s FAQs still linked to this category!');
+
+define('TEXT_DISPLAY_NUMBER_OF_FAQ_CATEGORIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> categories)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/feature_not_present.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/feature_not_present.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/feature_not_present.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Feature Not Present');
+define('IMAGE_UPGRADE', 'Upgrade Now');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/featured.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Featured Products');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_FEATURED_PRODUCT', 'Product:');
+define('TEXT_FEATURED_EXPIRES_DATE', 'Expiry Date:');
+
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_EXPIRES_DATE', 'Expires At:');
+define('TEXT_INFO_STATUS_CHANGE', 'Status Change:');
+
+define('TEXT_INFO_HEADING_DELETE_FEATURED', 'Delete Featured Product');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this Featured Product?');
+
+define('TEXT_DISPLAY_NUMBER_OF_FEATURED', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> Featured Products)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/file_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/file_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/file_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: file_manager.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'File Manager');
+
+define('TABLE_HEADING_FILENAME', 'Name');
+define('TABLE_HEADING_SIZE', 'Size');
+define('TABLE_HEADING_PERMISSIONS', 'Permissions');
+define('TABLE_HEADING_USER', 'User');
+define('TABLE_HEADING_GROUP', 'Group');
+define('TABLE_HEADING_LAST_MODIFIED', 'Last Modified');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_UPLOAD', 'Upload');
+define('TEXT_FILE_NAME', 'Filename:');
+define('TEXT_FILE_SIZE', 'Size:');
+define('TEXT_FILE_CONTENTS', 'Contents:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_NEW_FOLDER', 'New Folder');
+define('TEXT_NEW_FOLDER_INTRO', 'Enter the name for the new folder:');
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this file?');
+define('TEXT_UPLOAD_INTRO', 'Please select the files to upload.');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Error: I can not remove this directory. Please set the right user permissions on: %s');
+define('ERROR_FILE_NOT_REMOVEABLE', 'Error: I can not remove this file. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/forbiden.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/forbiden.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/forbiden.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Access Denied');
+define('NAVBAR_TITLE', 'No Right Permission Access');
+define('TEXT_MAIN', '&nbsp;Please contact your <b>Webmaster</b> to request <br>&nbsp;more access or if you found any problem.<br>&nbsp;');
+define('TEXT_BACK', 'Back');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/froogle.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/froogle.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/froogle.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Froogle Data Feed');
+
+define('TEXT_INFO_COMPLETED', 'Building feed files completed: ');
+
+define('TEXT_INFO_FTP_ERROR1', 'FTP open connection failed to: ');
+define('TEXT_INFO_FTP_ERROR2', 'FTP connection has failed! ');
+define('TEXT_INFO_FTP_ERROR3', 'Attempted to connect to ');
+define('TEXT_INFO_FTP_ERROR4', 'for user ');
+define('TEXT_INFO_FTP_ERROR5', 'Connected to ');
+define('TEXT_INFO_FTP_ERROR6', 'Current directory is now: ');
+define('TEXT_INFO_FTP_ERROR7', 'Couldn\'t change directory on ');
+define('TEXT_INFO_FTP_ERROR8', ': FTP upload has failed! ');
+define('TEXT_INFO_FTP_ERROR9', "Uploaded %s to %s as %s");
+
+define('TEXT_INFO_FTP_SCRITP_TIMER', 'Script timer: <b>%f</b> seconds.');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/froogle_pre.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/froogle_pre.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/froogle_pre.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Froogle Data Feed');
+
+define('TEXT_INFO_COMPLETED', 'Building feed files completed:');
+define('TEXT_INFO_TIMER', 'Script timer:');
+define('TEXT_INFO_SECOND', 'seconds.');
+
+define('TEXT_INFO_DONE', 'Categores built return to data admin');
+
+
+define('TEXT_OUTPUT_1', "product_url \t name \t description \t price \t image_url \t category \t offer_id");
+define('TEXT_OUTPUT_2', "\t instock ");
+define('TEXT_OUTPUT_3', "\t shipping ");
+define('TEXT_OUTPUT_4', "\t brand ");
+define('TEXT_OUTPUT_5', "\t upc ");
+
+define('TEXT_OUTPUT_6', "\t manufacturer_id ");
+define('TEXT_OUTPUT_7', "\t product_type ");
+define('TEXT_OUTPUT_8', "\t currency ");
+define('TEXT_OUTPUT_9', "\t language ");
+
+define('TEXT_OUTPUT_10', "\t ship_to ");
+define('TEXT_OUTPUT_11', "\t ship_from ");
+
+define('TEXT_OUTPUT_12', "Not Supported");
+define('TEXT_OUTPUT_13', "book");
+define('TEXT_OUTPUT_14', "music");
+define('TEXT_OUTPUT_15', "video");
+define('TEXT_OUTPUT_16', "other");
+
+define('TEXT_OUTPUT_17', 'data feed: ');
+define('TEXT_OUTPUT_18', 'File completed: ');
+define('TEXT_OUTPUT_19', 'view output file');
+
+define('TEXT_OUTPUT_20',' Run category build        run feed build    ');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/geo_zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/geo_zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/geo_zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: geo_zones.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Tax Zones');
+
+define('TABLE_HEADING_COUNTRY', 'Country');
+define('TABLE_HEADING_COUNTRY_ZONE', 'Zone');
+define('TABLE_HEADING_TAX_ZONES', 'Tax Zones');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_NEW_ZONE', 'New Zone');
+define('TEXT_INFO_NEW_ZONE_INTRO', 'Please enter the new zone information');
+
+define('TEXT_INFO_HEADING_EDIT_ZONE', 'Edit Zone');
+define('TEXT_INFO_EDIT_ZONE_INTRO', 'Please make any necessary changes');
+
+define('TEXT_INFO_HEADING_DELETE_ZONE', 'Delete Zone');
+define('TEXT_INFO_DELETE_ZONE_INTRO', 'Are you sure you want to delete this zone?');
+
+define('TEXT_INFO_HEADING_NEW_SUB_ZONE', 'New Sub Zone');
+define('TEXT_INFO_NEW_SUB_ZONE_INTRO', 'Please enter the new sub zone information');
+
+define('TEXT_INFO_HEADING_EDIT_SUB_ZONE', 'Edit Sub Zone');
+define('TEXT_INFO_EDIT_SUB_ZONE_INTRO', 'Please make any necessary changes');
+
+define('TEXT_INFO_HEADING_DELETE_SUB_ZONE', 'Delete Sub Zone');
+define('TEXT_INFO_DELETE_SUB_ZONE_INTRO', 'Are you sure you want to delete this sub zone?');
+
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_ZONE_NAME', 'Zone Name:');
+define('TEXT_INFO_NUMBER_ZONES', 'Number of Zones:');
+define('TEXT_INFO_ZONE_DESCRIPTION', 'Description:');
+define('TEXT_INFO_COUNTRY', 'Country:');
+define('TEXT_INFO_COUNTRY_ZONE', 'Zone:');
+define('TYPE_BELOW', 'All Zones');
+define('PLEASE_SELECT', 'All Zones');
+define('TEXT_ALL_COUNTRIES', 'All Countries');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/gv_mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/gv_mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/gv_mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: gv_mail.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Send Gift Voucher To Customers');
+
+define('TEXT_CUSTOMER', 'Customer:');
+define('TEXT_SUBJECT', 'Subject:');
+define('TEXT_FROM', 'From:');
+define('TEXT_TO', 'Email To:');
+define('TEXT_AMOUNT', 'Amount');
+define('TEXT_MESSAGE', 'Message:');
+define('TEXT_SINGLE_EMAIL', '<span class="smallText">Use this for sending single emails, otherwise use dropdown above</span>');
+define('TEXT_SELECT_CUSTOMER', 'Select Customer');
+define('TEXT_ALL_CUSTOMERS', 'All Customers');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'To All Newsletter Subscribers');
+
+define('NOTICE_EMAIL_SENT_TO', 'Notice: Email sent to: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Error: No customer has been selected.');
+define('ERROR_NO_AMOUNT_SELECTED', 'Error: No amount has been selected.');
+
+define('TEXT_TO_REDEEM1', 'You can also redeem this Gift Voucher during checkout. Just enter the code in the box provided, and click on the redeem button. ');
+define('TEXT_GV_WORTH', 'The Gift Voucher is worth ');
+define('TEXT_TO_REDEEM', 'To redeem this Gift Voucher, please click on the link below. Please also write down the redemption code');
+define('TEXT_REMEMBER', 'Please do not lose the coupon code, make sure to keep the code safe so you can benefit from this special offer');
+define('TEXT_WHICH_IS', ' which is ');
+define('TEXT_IN_CASE', ' in case you have any problems.');
+define('TEXT_OR_VISIT', 'or visit ');
+define('TEXT_ENTER_CODE', ' and enter the code during the checkout process');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_HEADER', 'You recently purchased a Gift Voucher from our online store.' . "\n"
+                                          . 'For security reasons this was not made immediately available to you.' . "\n"
+                                          . 'However this amount has now been released. You can now visit our store' . "\n"
+                                          . 'and send the value via Email to someone.' . "\n\n");
+define ('TEXT_REDEEM_COUPON_MESSAGE_AMOUNT', "\n\n" . 'The value of the Gift Voucher was %s');
+define ('TEXT_REDEEM_COUPON_MESSAGE_BODY', "\n\n" . 'You can now visit our site, login and send the Gift Voucher amount to anyone you want.');
+define ('TEXT_REDEEM_COUPON_MESSAGE_FOOTER', "\n\n");
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">The Back Button has been DISABLED while HTML WYSIWG Editor is turned ON.</b></font><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML is currently Disabled!</b></font><br><br>If you want to send HTML email, Enable WYSIWYG Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/gv_queue.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/gv_queue.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/gv_queue.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: gv_queue.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gift Voucher Release Queue');
+
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDERS_ID', 'Order-No.');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Voucher Value');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_HEADER', 'You recently purchased a Gift Voucher from our online store.' . "\n"
+                                          . 'For security reasons this was not made immediately available to you.' . "\n"
+                                          . 'However this amount has now been released. You can now visit our store' . "\n"
+                                          . 'and send the value via Email to someone.' . "\n\n");
+
+define('TEXT_REDEEM_COUPON_MESSAGE_AMOUNT', 'The Gift Voucher(s) you purchased are worth %s' . "\n\n");
+
+define('TEXT_REDEEM_COUPON_MESSAGE_BODY', '');
+define('TEXT_REDEEM_COUPON_MESSAGE_FOOTER', '');
+define('TEXT_REDEEM_COUPON_SUBJECT', 'Gift Voucher Purchase');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/gv_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/gv_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/gv_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: gv_queue.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gift Voucher Report');
+define('HEADING_SUB_TITLE', 'This report list all GV issued and if they have been released');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDERS_ID', 'Order-No.');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Voucher Value');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_GV_REPORT_RELEASED', 'Released to customer: ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/gv_sent.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/gv_sent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/gv_sent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: gv_sent.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gift Vouchers Sent');
+
+define('TABLE_HEADING_SENDERS_NAME', 'Sender\'s Name');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Voucher Value');
+define('TABLE_HEADING_VOUCHER_CODE', 'Voucher Code');
+define('TABLE_HEADING_DATE_SENT', 'Date Sent');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_SENDERS_ID', 'Sender\'s ID:');
+define('TEXT_INFO_AMOUNT_SENT', 'Amount Sent:');
+define('TEXT_INFO_DATE_SENT', 'Date Sent:');
+define('TEXT_INFO_VOUCHER_CODE', 'Voucher Code:');
+define('TEXT_INFO_EMAIL_ADDRESS', 'Email Addr:');
+define('TEXT_INFO_DATE_REDEEMED', 'Date Redeemed:');
+define('TEXT_INFO_IP_ADDRESS', 'IP Address:');
+define('TEXT_INFO_CUSTOMERS_ID', 'Customer Id:');
+define('TEXT_INFO_NOT_REDEEMED', 'Not Redeemed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/header_tags_controller.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/header_tags_controller.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/header_tags_controller.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: header_tags.php,v 1.6 2005/04/10 14:07:36 hpdl Exp $
+  Created by Jack York from http://www.oscommerce-solution.com
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_CONTROLLER', 'Header Tags Controller');
+define('HEADING_TITLE_ENGLISH', 'Header Tags - English');
+define('HEADING_TITLE_FILL_TAGS', 'Header Tags - Fill Tags');
+define('TEXT_INFORMATION_ADD_PAGE', '<b>Add a New Page</b> - This option adds the code for a page into the files mentioned 
+above. Note that it does not add an actual page. To add a page, enter the name of the file, with or without the .php extension..');
+define('TEXT_INFORMATION_DELETE_PAGE', '<b>Delete a New Page</b> - This option will remove the code for a page from the
+above files.'); 
+define('TEXT_INFORMATION_CHECK_PAGES', '<b>Check Missing Pages</b> - This option allows you to check which files in your
+shop do not have entries in the above files. Note that not all pages should have entries. For example,
+any page that will use SSL like Login or Create Account. To view the pages, click Update and then select the drop down list.'); 
+
+define('TEXT_PAGE_TAGS', 'In order for Header Tags to display information on a page, an entry for that
+page must be made into the includes/header_tags.php and includes/languages/english/header_tags.php files
+(where english would be the language you are using). The options on this page will allow you to add, delete
+and check the code in those files.');
+define('TEXT_ENGLISH_TAGS', 'The main purpose of Header Tags is to give each of the pages in your shop a 
+unique title and meta tags for each page. The default settings will not do your shop any good and need to 
+be changed on this page. The individual sections are named after the page they belong to. So, to change the 
+title of your home page, edit the title in the index section.');
+define('TEXT_FILL_TAGS', 'This option allows you to fill in the meta tags added by
+Header Tags. Select the appropriate setting for both the categories and products tags
+and then click Update. If you select the Fill Only Empty Tags, then tags already
+filled in will not be overwritten. ');
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+
+
+define('ERROR_PAGE_NAME_IS_ALREADY_ENTERED', 'Page name is already entered -> ');
+define('ERROR_DELETE_FROM_ENGLISH_1', 'delete from English  ');
+define('ERROR_DELETE_FROM_ENGLISH_2', ' for  ');
+define('PAGE_NAME', 'Page Name');
+define('SWITCHES', 'Switches:');
+define('HTTA', 'HTTA:');
+define('HTDA', 'HTDA:');
+define('HTKA', 'HTKA:');
+define('HTCA', 'HTCA:');
+define('EXPLAIN', '(Explain)');
+define('TITLE_TITLE', 'Title');
+define('DESCRIPTIONS', 'Descriptions');
+define('KEYWORD', 'Keyword(s)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/header_tags_popup_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/header_tags_popup_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/header_tags_popup_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: header_tags_popup_help.php,v 1.0 2005/09/22 
+   
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+  
+  Released under the GNU General Public License
+*/
+?>
+<style type="text/css">
+.popupText {color: #000; font-size: 12px; } 
+</style>
+<table border="0" cellpadding="0" cellspacing="0" class="popupText">
+  <tr><td><hr class="solid"></td></tr>
+  <tr>
+   <td class="popupText"><p><b>What are HTTA, HTDA, HTKA and HTCA used for?</b><br><br>
+    Header Tags comes with a default set of tags. You can create your own
+    set of tags for each page (it comes with some set up, like for index
+    and product pages).
+
+<pre>
+HT = Header Tags  
+T  = Title 
+A  = All 
+D  = Decription
+K  = Keywords
+C  = Categories *
+</pre>  
+<b>* Note:</b> The HTCA option only works for the index page. It causes the
+category name to be displayed in the title.<br><br>
+
+If HTTA is set on (checked), then it says display the Header Tags Title All 
+(default title plus the one you set up).<br><br>
+
+So if you have the option checked, both titles will be displayed.
+Let's say your title is Mysite and the default title is Oscommerce.<br>
+<pre>
+With HTTA on, the title is
+ Mysite Oscommerce
+With HTTA off, the title is
+ Mysite
+</pre>
+</p>
+  </td>
+ </tr>
+ 
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision : $Revision$
+   
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)<br><br>
+
+&nbsp;&nbsp;<b>Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Some documentation that was previously provide now can be accesed via the admin.
+These help document cover a variety of subjects to you as the Store owner to manage your store.
+</P>
+<P>
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+</P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<tr>
+<td>
+<!-- Begin help index2.html-->
+<UL>
+<b>&nbsp;&nbsp;Admin help and how to document </b>
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Setup and configure </b>
+<LI><a href="<?php echo tep_href_link('../doc/CRE6.15-QUICK-INSTALL-GUIDE.pdf', '') . '"> Quick install (PDF) </a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/addlanguage.txt', '') . '">Adding Languages  (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/adminssl.txt', '') . '">SSL for Admin (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../admin/data.php', '') . '">Easy Populate 3.01 (html)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../admin/edit_textdata_help.php?&help_id=1', '') . '">Language Editor (html)</a>' ;?></LI>
+</UL>
+<UL>
+&nbsp;&nbsp;<b>Payment modules</b>
+<LI><a href="<?php echo tep_href_link('../admin/authnet_help.php', '') . '">Authorize.net setup (html)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/payment/paypal/Help_FAQs.inc.php', '') . '"> Paypal Faq\'s (html)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/payment/paypal/Help_Config.inc.php', '') . '">Paypal how to (html)</a>' ;?>
+<UL>
+ </td>
+   </tr>
+<!-- End help index2.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<tr>
+<td>
+<!-- Begin help index2.html-->
+<UL>
+<b>&nbsp;&nbsp;Catalog help and how to document </b>
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Testing the Cart </b>
+</UL>
+ </td>
+   </tr>
+<!-- End help index2.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<tr>
+<td>
+<!-- Begin help index4.html-->
+
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Miscellaneous Documents from the /doc directory </b>
+<LI><a href="<?php echo tep_href_link('../doc/CRE6.15-QUICK-INSTALL-GUIDE.pdf', '') . '">'. 'Quick Setup (pdf)' . '</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/addlanguage.txt', '') . '">Adding New Languages (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/adminssl.txt', '') . '">SSL for admin (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/changesloaded6151.txt', '') . '">Changes for CRE Loaded Patch 01 (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/buttons.txt', '') . '">List of buttons (txt)</a>' ;?></LI>
+</UL>
+<UL>
+<br>&nbsp;&nbsp;<b>Liscense</b>
+<LI><a href="<?php echo tep_href_link('../doc/license.txt', '') . '">GPL 2 English (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/doc/none.txt', '') . '">GPL 2 Espanol (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link('../doc/gnu_french.txt', '') . '">GPL 2 French (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link('../doc/gnu-german.html', '') . '">GPL 2 German (txt)</a>' ;?>
+ </td>
+   </tr>
+<tr>
+<td>
+</td>
+</tr>
+
+<!-- End help index4.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/index5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/none.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/none.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc/none.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Sorry this is not yet avalable
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision : $Revision$
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_cat.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_cat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_cat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision : $Revision$
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision: $Revision$
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_misc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_misc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/doc_misc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision $Revision$
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/edit_key_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/edit_key_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/edit_key_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: edit_key_help.php,v 1.1 
+  
+  Copyright &copy 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_01', 'Introduction');
+define('HEADING_TITLE_02', 'Configure Encrypt and Decrypt');
+define('HEADING_TITLE_03', 'Key management');
+define('HEADING_TITLE_04', 'Encrypt and Decrypt data');
+define('HEADING_TITLE_05', 'Changing your key');
+define('HEADING_TITLE_06', 'Test');
+define('HEADING_TITLE_07a', 'Encrypted data that is not encrypted');
+define('HEADING_TITLE_07b', 'Decrypting data that is encrypted');
+define('HEADING_TITLE_07c', 'Changing keys and updating encrypted data');
+
+
+define('TEXT_MAG_1', 'Index');
+define('TEXT_MAG_2', 'Pre install and installation of Encrypt and Decrypt');
+define('TEXT_MAG_3', 'Specific task:');
+define('TEXT_MAG_4', 'A. Encrypted data');
+define('TEXT_MAG_5', 'B. Decrypting data');
+define('TEXT_MAG_6', 'C. Changing keys and updating encrypted data');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/edit_textdata_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/edit_textdata_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/edit_textdata_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision $Revision$
+  
+*/
+
+
+define('HEADING_TITLE_01', 'Edit Languages: Introduction ');
+define('HEADING_TITLE_02', 'Edit Languages: Search ');
+define('HEADING_TITLE_03', 'Edit Languages: Edit ');
+define('HEADING_TITLE_04', 'Edit Languages: Save');
+define('HEADING_TITLE_05', 'Edit Languages: Restore');
+define('MENU_ITEM_01', 'Introduction:');
+define('MENU_ITEM_02', '1. Search for files or text');
+define('MENU_ITEM_03', '2. Edit text define');
+define('MENU_ITEM_04', '3. Saving your work ');
+define('MENU_ITEM_05', '4. Restore to last copy of define file');
+
+define('TEXT_MSG_1', 'Language Editor Help Index');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/data_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/data_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/data_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+?>
+<tr>
+ <td>
+<p align="center"><b><span style="font-size:16pt;">Data Feed Input/Output Introduction</span></b></p>
+<p>Data feed service is a collection of contributions to allow you to updated 
+your products and categories data remotely, and send that data to data listing 
+services. It used a number of contributions that have been modified to work 
+with small, medium, and large stores. </p>
+<p>Contributions:<br>Easy Populate Advance by Tom O'Neill<br>Easy Populate Basic<br>Froogle 
+data feed : Calvin K<br> &nbsp;&nbsp;&nbsp;Salemaker for froogle feed: by<br> 
+&nbsp;&nbsp;&nbsp;Admin for Froogle Data Feed : Tom O'Neill<br><br> Goals:<br>The 
+typical store owner never needs to edit a code or define file directly.The store 
+owner does not need a lot of support on how to use program.Combines the functions 
+of moving data in and out of store is in one are.Make it flexible enough for 
+small, medium and large store to use program effectively.Move program files closer 
+to OSC/CRE Loaded standards for look and feel, and coding.<br><br>Parts of 
+Data Feed Service:<br>&nbsp;Easy Populate: This is used to update data it allows 
+you to updated data remotely on your&nbsp;local computer and upload to the data 
+to your on line store. It allows you to&nbsp;&nbsp;build custom queries for 
+the data then download the information to your local computer&nbsp;&nbsp;for 
+editing, Then upload back to your &nbsp;on-line store.</p>
+<p>&nbsp;Data feed:<br>&nbsp;&nbsp;Data feed takes the data with in your catalog 
+and prepares it for submission to a feed &nbsp;service and send it to the feed 
+service either automatically or manually if you need on completion&nbsp;of building 
+the feed.<br>&nbsp;Features added and changes to basic programs.<br> &nbsp;&nbsp;&nbsp;Easy 
+populate 2.75 Advance to 2.78:<br>&nbsp;1. Removed the froogle feed from this 
+contribution. The froogle function is now &nbsp;handled by separate code files.<br>&nbsp;2. 
+Moved EP from catalog side box to Data export/import side box.<br>&nbsp;3. Moved 
+function file to admin/includes/function directory to follow OSC standards.<br>&nbsp;4. 
+Moved most simple function to function file, export now has all functions removed 
+. There is now only one function left in the EPA import file. <br>&nbsp;5. Revised 
+admin screens so it was more like the rest of the catalog.<br>&nbsp;6. Inserted 
+tep form function rather then html form function (In progress)<br>&nbsp;7. Added 
+pop up help for information on how to use EPA.<br>&nbsp;8. Easy Populate Basic 
+is for backward compatibility with older versions of EP<br>&nbsp;&nbsp;&nbsp;&nbsp;EP 
+advance will import all EPA files of previous version of EPA. <br>&nbsp;9. Export 
+screen and Import screen separated into two separate files<br>&nbsp;10. Side 
+box changed, so that sub titles are offset.<br>&nbsp;11. Added date time to 
+split so each group of splits will be unique and old splits will&nbsp;not be 
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>&nbsp;12. 
+Program message, error, and output were place in one of three variable so they 
+could be output&nbsp:with in the html output section of the files.<br> &nbsp;&nbsp;<br>&nbsp;Items 
+fixed or enhanced from EP 2.74 to 2.75 Advance:<br>&nbsp;1. To add products 
+the product id should be set to 0, there can be many 0's for product ID's.<br>&nbsp;2. 
+You no longer need to change the manufacturers table to change a manufacturers_id 
+first&nbsp;manf id to 1 or 0<br>&nbsp;3. No longer adds a empty product, caused 
+by not treating the last line as not product.<br>&nbsp;4. Added EP Basic, It 
+cannot install any EP Advanced files since they start with EPA a error<br>&nbsp;&nbsp;&nbsp;&nbsp;message 
+will be displayed. It can install any file that starts will EPB or older EP files<br>&nbsp;5. 
+EP Advanced set up so it can only read files that start with EPA , prevents 
+reading older files.<br>&nbsp;6. Delete has been added back into EP for products 
+only. &nbsp;This is implemented via a new column call v_action. You must type 
+the word &quot;delete&quot; in this column to delete a product.<br>&nbsp;7. 
+EP basic was not showing on some site this was to an error in the install of 
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>&nbsp;8. 
+You can add your own product ID, If your product ID's are based on a system 
+other than&nbsp;numbers generated by the shopping cart and auto incremented by 
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows 
+for compatibility with some external inventory management systems.<br>&nbsp;9. 
+moved configuration of EP to a separate file called epconfigure.php <br><br>&nbsp;Data 
+Feed:<br>&nbsp;1. Added language files<br>&nbsp;2. Multiple configurations for 
+multiple feed services now available through admin screen<br>&nbsp;3. Configuration 
+configured in admin rather then edit a file.<br>&nbsp;4. Feed submission now 
+A multiple step process.<br>&nbsp;5. Switched to tep functions for data base 
+queries.<br>&nbsp;6. Split file generation and FTP code into two separate files.<br>&nbsp;7. 
+Combined Froogle, Yahoo and Bizrite into one package (Not all installed and 
+adapted yet)<br>&nbsp;8. added fields for advance feed to products database<br>&nbsp;9. 
+added separate sql file for additional info for froogle feed<br>&nbsp;10. Builds 
+Category strings before building feed file.<br>&nbsp;11. Help popups added to 
+admin screens.<br>&nbsp;12. Added salemaker contribution pricing to price sent 
+to price in feed.<br>&nbsp;13. Uses tax zone from store. <br>&nbsp;14. Add the 
+fields froogle_type, upc, isbn, manufacturer_product_id to products table and 
+products edit screen.<br>&nbsp;15. add froogle specific fields for books, music, 
+video to a separate table.<br><br>&nbsp;For EP set up:<br>&nbsp;For Data feeds 
+set up:<br>Step 1 <br>&nbsp;To set up this modules data feed service, you must 
+first register with the feed services you wish to use.&nbsp;This is described 
+in the getting started document. It has links to the feed services &nbsp;and 
+what you need to set up the configuration of each service.<br>Step 2<br>Next 
+you need to install this contribution this is disturbed in the doc/install.txt 
+files<br>Step 3<br>The you will need to configure and run the data feeds this 
+is described in the running doc/configureandrun.txt document The file field_spec.txt 
+describes the limitation of what can be placed into each field<br><br>&nbsp;Known 
+bugs:<br>&nbsp;&nbsp;1. PHP 5 compatibility for import. the problem is either 
+how globals are treated or&nbsp;&nbsp;how arrays are used in this contribution<br></p>
+ </td>
+</tr> 
+<tr>
+  <td>
+ <b>Error and status messages</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will appear near the top of the for, Blue background 
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_msg.gif" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ <b>Import result</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now appear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ <b>Help while using the admin screens</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or input you could use. It will display a pop up window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
+

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/edit_key_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/edit_key_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/edit_key_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: edit_key_help.php,v 1.1 
+
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_01', 'Introduction');
+define('HEADING_TITLE_02', 'Configure Encrypt and Decrypt');
+define('HEADING_TITLE_03', 'Key management');
+define('HEADING_TITLE_04', 'Encrypt and Decrypt data');
+define('HEADING_TITLE_05', 'Changing your key');
+define('HEADING_TITLE_06', 'Test');
+define('HEADING_TITLE_07a', 'Encrypting data');
+define('HEADING_TITLE_07b', 'Decrypting data');
+define('HEADING_TITLE_07c', 'Changing keys and updating encrypted data');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page1.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page1.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page1.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+?>
+
+
+<table width="100%" border="0" cellpadding="5" cellspacing="3">
+  <tr valign="top">
+    <td><p><strong><font color="red">Warnings </font></strong></p>
+      <p><strong><img src="images/icons/warning_big.gif" alt="Warning" width="20" height="20" hspace="5"></strong> <font color="#FF0000">You must check the import and export laws of your country. Some prevent the use of encrypted data or software with hooks in place for encryption to be added. This module does not contain actual encryption code. It uses the mcrypt module, and provides management services. While it is not subject to export laws in the US, it may well be regulated by your jurisdiction. You are responsible for knowledge of and compliance with local laws.</font> </p>
+      <p><strong><img src="images/icons/warning_big.gif" alt="Warning" width="20" height="20" hspace="5"></strong> <font color="#FF0000">One must be careful when the encryption/decryption takes place. Network service disruptions and other factors can cause loss of data availability - ie leaving data encrypted with no key available. It is important to process your cards as frequently as you can, and to delete the data as soon as the transaction is cleared.</font></p>
+      <p><strong> Introduction:</strong> <br>
+      Requirements for the protection of personal and financial data are being increased day by day. This package was developed to assist you with this requirement during the daily operation of your CRE loaded store. There are 3 main components within this package, ssl for admin, encryption/decryption of data, and pgp signing for email with sensitive data. PGP is not yet implemented. Encryption is functional, but not fully developed in this 0.7 release Encrypt and Decrypt component has 4 main functions within it. Configuration, Manage Keys, Update/Convert, Test. </p>
+      <p> 1. Pre install and installation of Encrypt and Decrypt : &nbsp;&nbsp;&nbsp;<br>
+        <img src="images/pixel_trans.gif" width="30" height="10">        A. Setup and installation: See install_encrypt.txt<br>
+      <img src="images/pixel_trans.gif" width="30" height="10">&nbsp;B. Enabling SSL for Admin</p>
+      <p>        Although the encryption protects the data while it is stored in the database tables. It does not protect data when you view it in the admin screens. To help with this SSL for admin was written, this should be installed in the admin and the appropriate edit screens run in ssl mode. The files in this package are designed to work with or with out SSL for admin.</span>      </p>
+      </P></td>
+  </tr>
+  <tr>
+    <td class="pageHeading"><B>Help while using the admin screens</B> </td>
+  </tr>
+  <tr>
+    <td><img src="includes/languages/english/help/encrypt/images/item_help.gif" alt="Screen Shot" width="460" height="364" border="1" ><br>
+      You will notice help icons like this throughout the admin screens These icons trigger popup screens with individual help for each setting or input you see labeled with the icon<br></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><font class="pageHeading">A. Configuration:</font></p>
+      The configuration only has 3 items that need to be setup, along with the key file.<br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/configure1a.png" NAME="Graphic1" WIDTH="644" HEIGHT="143" hspace="5" vspace="5" BORDER=1>
+      <p><font class="content_heading">1. Enable CC encryption Default: false</font><BR>
+        You can turn on and off the encryption, Once you turn on encryption the back off you can use the convert data screen to decrypt the data. If you do this it is advisable to remove the sensitive data. The order viewing and edit screen will decrypt the data so it is viewable.</P>
+      <p><font class="content_heading">2.Path to key File Default key/</font><BR>
+        Currently this is a directory within the includes/ directory.</P>
+      <p><font class="content_heading">3. Key File Name: cc_key.php</font><BR>
+        This is the file name for the key file, It is suggested that you use a different name then the one listed here. By clicking on this configuration setting you have three task to do.</span></font> &nbsp;b. Edit the key file name<BR>
+      </P>
+      <p><IMG SRC="includes/languages/english/help/encrypt/images/configure3.png" NAME="Graphic3" WIDTH="219" HEIGHT="154" BORDER=1> </p>
+      <p>Note: Once you have set the name of the file you can switch to Manage Key files<BR>
+        </span></font>
+        </p>
+      </p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> On opening the Manage Key Files screen it will look like the above screen with no key files.<br>
+      Click on the CREATE files button and a empty key file will be set up using the name you selected in the text input box.<BR>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_start.png" alt="Screen Shot" NAME="Graphic11" WIDTH="723" HEIGHT="213" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> You will now have two empty key files. Starting off you will only need to enter a key phrase into the Primary key file. Next click on the EDIT button next to the Primary key file. This will open the key file edit screen.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_createt.png" alt="Screen Shot" NAME="Graphic5" WIDTH="725" HEIGHT="251" hspace="5" vspace="5" BORDER=1> </p>
+      </P>
+      <p><strong>C.</strong> To edit the &quotPrimary&quot Click on the EDIT button at the end of the row. A Key Edit screen will open.<br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_edit1.png" alt="Screen Shot" NAME="Graphic8" WIDTH=526 HEIGHT="152" hspace="5" vspace="5" BORDER=1><br>        
+      <strong> Note:</strong> The new key file is used to allow updating the data encryption when you want to change to a new encryption key.</p>
+      <p><strong>D.</strong> Type in your key phrase in the text box and click the SAVE button. This will save the phrase. 
+  The phase can be anything from random numbers and letters to a phrase you can remember.</p>
+      <p><strong>E. </strong>From this point on all cc information will be encrypted as it is entered into the orders by the customer.
+    The next step you may need to take might be to encrypt existng Credit card information.</p>
+    <p><strong>F.</strong> Next click on the Update cc data in the lefthand side box.</p></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> Each order paid by credit card using a module which stores the number will appear in this list. Click on the ones marked as unencrypted. Then click on the encrypt button. <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/e_c_order1.png" alt="Screen Shot" NAME="Graphic4" WIDTH="641" HEIGHT="141" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> You will now have encrypted this existing entry. Do this for each unencrypted CC number. Next to the encrypt button is a decrypt button that can be used to decrypt the information. Attempts to re-encrypt a number again will fail.<br>
+      <img src="includes/languages/english/help/encrypt/images/e_c_order.png" alt="Screen Shot" name="Graphic9" width="642" height=137 hspace="5" vspace="5" border=1></p>
+      <p><strong>C.</strong> Mass Encryption or Decryption can also be done. Simply click on the encrypt or decrypt buttons at the top of the form and all numbers will be processed. The program will detect those orders that have already been encrypted or decrypted and change only the data which requires processing.        <BR>
+      <IMG SRC="includes/languages/english/help/encrypt/images/d_c_main_all.png" alt="Screen Shot" NAME="graphics1" WIDTH=545 HEIGHT=61 hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>D.</strong> If you need to export your Credit card information to an external program that cannot use the mcrypt library you can decrypt all of the encrypted data before exporting the information. Once you have exported the data you should return to this screen to encrypt all data. <BR>
+      </p></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Author: $Author$
+  Revision : $Revision$
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> Keys should be changed from time to time as a security precaution. When you first set up your &quot;Primary key file&quot; an empty &quot;New key file&quot; was created. In fact, CRE Loaded comes with 2 key files already in place, just in case your host allows editing of existing files but restricts creation of files from within the web server. You will now need to add your new key to this file . In the row that is labeled &quot;New key file&quot; click on the edit button.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_createt.png" alt="Screen Shot" NAME="Graphic6" WIDTH="725" HEIGHT="251" hspace="5" vspace="5" BORDER=1> </p>
+      <p> <strong><font color="#FF0000"> WARNING:</font></strong><br>
+        <strong><font color="#FF0000"><img src="images/icons/warning_big.gif" width="20" height="20" hspace="5" vspace="5"></font></strong>Do not edit the main key file for your site once you have begun encrypting data. This may cause the loss of any existing data you have encrypted. You must follow the procedure for converting records as listed below: </p>
+      <p><strong>B.</strong> Click once on the edit button next to the new_(key file name) to access the Key File edit screen. When you click on the file name you will be sent to the key file contents editor. You may enter anything from a phrase to a random set of numbers and letters. The longer the phrase, the more secure your data will be. Inclusion of numbers and use of both upper and lower case characters will also make your phrase more difficult to guess.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_new_edit1.png" alt="Screen Shot" NAME="Graphic7" WIDTH=555 HEIGHT=112 hspace="5" vspace="5" BORDER=1></P>
+      <p> <strong>C.</strong> Once you have finished changing your key click on the save button. It will save the key and display it for your verification. If this is not what you wanted click on the restore button and the old contents will be brought back.</span></font> <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_new_saved.png" alt="Screen Shot" NAME="Graphic10" WIDTH=572 HEIGHT=122 hspace="5" vspace="5" BORDER=1></P>
+      <p><strong>D.</strong> Having placed the new key you should now go to the convert data screen to re-encrypt your data using this new key. If you do not use the Convert CC Data screen you may lose your existing CC data. This may be a permanent loss.</P>
+      <p><strong>E.</strong> Convert CC Data screen </P>
+      <p> <img src="includes/languages/english/help/encrypt/images/convert.png" alt="Scrren Shot" name="Graphic2" width="628" height="161" hspace="5" vspace="5" border=1></p>
+      <p><strong>1.</strong> If the new key file is empty, you will see the above screen, with warnings that there is no key and you need to add one.<br>
+        <img src="includes/languages/english/help/encrypt/images/convert_ok.png" width="337" height="23" hspace="5" vspace="5" border="1"></p>
+      <p><strong>2.</strong> The convert button will appear once you have added a new key phrase. As long as you see no red warning messages you are ready to proceed with conversion. If you do see a warning it is important that you resolve the problem before continuing.<br>
+        <img src="includes/languages/english/help/encrypt/images/convert_button.png" width="271" height="31" hspace="5" vspace="5" border="1"></p>
+      <p><strong>3.</strong> Click on the convert button. This will convert the existing cc data to the new key. The process converts the data by decrypting with the old key and encrypting with the new one. It continues by copying the &quot;Primary Key File&quot; to a back-up file and moving the &quot;New key file&quot; to the &quot;Primary Key File&quot;. That completes the process</span></font> </p>
+      </P>
+    </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page6.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page6.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page6.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: Tom O'Neill
+  Latest Contributor : $Author$
+  Revision : $Revision$
+
+*/
+
+?>
+
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> CRE CC Encryption Manager relies on services provided by the operating system to function. This is because various governments regulate the availability and usage of security technology including encryption. The test portion of CRE CC Encryption is intended to ensure that encryption algorithms and modes selected for use are available and functioning properly. It can also be used to identify other algorithms and modes that can be used by this program. We begin by displaying a table of available encryption methods and modes. <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/test1.png" NAME="graphics4" WIDTH="825" HEIGHT="140" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> The first part of the encryption service test is shown above, and lists the available methods and what modes are working on your web server. If you do not see a table similar to the one above then you do not have mcrypt installed or working correctly. <font face="Arial"><br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/test2.png" NAME="graphics4" WIDTH="274" HEIGHT="213" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>C.</strong> Then a partial list of the second part is shown above, it lists the length of the key that is allowed or required for a specific method. Currently this tool provides only some basic information. In future, it will be expanded to allow users to select an algorithm to fit their needs and even to allow switching algorithms as part of a carefully managed security system.      </p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7a.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7a.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7a.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>1.</strong> Encrypted data that is not encrypted:<BR>
+        The Update CC Data is used to convert non-encrypted data. You can encrypt one record at a time or all records that have not been encrypted.</p>
+      <p><strong>2.</strong> Go to Encryption/Decryption side box click on Update CC Data. A list of orders with credit card number will apear. There will be a green message if the data is encrypted and a red message if it is not. Only the cc number is checked. You can encrypt either a single record or all records in this list<br>
+        <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;a. Single record<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Click on the record not encrypted<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. In the right hand box you will see the encrypt button, Click on this and the record will be encrypted.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. You will be returned to the Order with cc numbers list. If ther are more records go to step 2 and repeat until there are not any more red messages.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4. You are now done if there are no more red messages<BR>
+        <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;b. All records <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Below the list of order with cc number you will see a button label Encrypt All. Click on this button.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. You are now done</p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7b.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7b.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7b.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><strong>A.</strong> Go to Encryption/Decryption side box click on Update CC Data . A list of orders with credit card number will apear. There will be a green message if the data is encrypted and a red message if it is not. Only the cc number is checked. You can decrypt either a single record or all records in this list<BR>
+        <BR>
+&nbsp;&nbsp;&nbsp;Single record<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;1. Click on the record not decrypted<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;2. In the right hand box you will see the decrypt button, Click on this and the record will be decrypted.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;3. You will be retuned to the Order with cc numbers list. If there are more records go to step 2 and repeat until ther are not more red messages.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;4. You are now done if there are no more red messages<BR>
+        <BR>
+&nbsp;&nbsp;All records <BR>
+&nbsp;&nbsp;&nbsp;1. Above the list of order with cc number you will see a button label decrypt . Click on this button.<br>
+&nbsp;&nbsp;&nbsp;2. You are now done</td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7c.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7c.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/encrypt_page7c.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><ul>
+      <li>  Go to the Encryption/Decryption side box and click on the Manage Keys selection.</li>
+      <li> Click on the file name in the row labeled &quot;New key file&quot; then click on edit.</li>
+      <li> Type in your new key.</li>
+      <li> Click on save.</li>
+      <li> In the Encryption/Decryption side box and click on Convert data. </li>
+      <li>If no red warning messages appear you may proceed.</li>
+      <li>Click on the convert button.</li>
+      <li> Finished</span></font>
+          </P>
+      </li>
+    </ul></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/cofigure_filename.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/cofigure_filename.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure1a.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure1a.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure3.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure_filename1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/configure_filename1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_button.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_button.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_nobutton.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_nobutton.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_not.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_not.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_ok.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/convert_ok.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/d_c_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/d_c_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/d_c_main_all.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/d_c_main_all.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/e_c_order.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/e_c_order.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/e_c_order1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/e_c_order1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/e_c_order_d_e.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/e_c_order_d_e.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/encrypt1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/encrypt1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/encrypt2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/encrypt2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/item_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/item_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_createt.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_createt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_edit.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_edit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_new_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_new_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_new_saved.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_new_saved.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_save.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_save.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_saved.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_saved.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/manage_key_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/order_edit.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/order_edit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/order_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/order_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/test1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/test1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/test2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/encrypt/images/test2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_basicexport.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_basicexport.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_basicexport.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export.png" border="0" ><br>
+
+ The Export Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is intended for backward compatibility with previous version of Easy Populate.
+This version has been reorganized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatible with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Select method to save export file</b>
+  </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_sel_loc.png" border="0" ><br><br>
+To export A file first select if you wish to download the file or save to your web server temp directory.
+
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Select field set to export</b>
+ </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_sel_feld.png" border="0" ><br><br>
+These are the same as in Easy populate 2.7X select from Complete, Model/Price/Qty, Model/Category, Attributes.
+When ready click the "Start File Creation button"
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_basicimport.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_basicimport.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_basicimport.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,69 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_import.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is entended for backward compatibility with previous version of Easy Populate.
+This version has been reorginized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatable with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPB format. This is
+the products_model is the first column in the upload file. The file should have EPB as the first
+three characters in its file name or none at all.
+
+Click on the browse button to browse your local computer for the file to upload and insert.
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. Also
+EP usually will only imports 400 to 500 lines of products, this version can do 2,000 plus.
+If a file it to large to upload because of PHP restrictions the FTP the file to the site and use
+"Import Data from file in temp/"
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Although it may not be needed, EP basic upload and split is available. Use the browse button
+to browse you local files and select the ile for uploading.  It will be spilt into files
+limited by the configure setting $maxrecs as set in the epconfigure.php file.
+Each file name will be dated with the date the split was created.
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_epbasic.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_epbasic.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_epbasic.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epbasic.jpg" border="0" ><br>
+
+ EP Basic
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Easy Populate Basic</b>
+ </td>
+</tr>
+<tr>
+ <td>
+
+<br><b>Upload EP File for Import</b> <br>
+This feature allows the upload of a delimited file for import into the database. You can now import files which include HTML in the text fields without having the file mangled by EP or Excel.  But EP Basic will not install files unless the file name begins with EPB or EP.  Files beginning with EPA are intended for use with EasyPopulate Advanced.
+
+<br><b>Upload and Split a EP File</b> <br>
+This feature has the same improvements applied to the Import routines, but allows you to upload a large file and split it into smaller pieces.  This feature is helpful in avoiding interrupted imports due to communications timeouts or exceeding the servers script time limits.
+
+
+<br><b>Import Data from file in temp/</b> <br>
+This is now a drop down list of all the files located in the /temp directory. 
+
+<br><b>Create an export files</b> <br>
+A series of drop down boxes are used to allow you to :
+
+<br><b>Select method to save export file </b> <br>
+There are two selections here:<br>
+       Save to temp file on server<br>
+       Select fields to download<br>
+
+
+<br><b>Select fields to download </b> <br>
+This is the list of which download types to use. You will also notice that there is no V_products_id in the list. This is for backward compatibility of older files.
+
+By default the file types are are:
+Complete     (Attributes have been removed since there is a separate download for those.)
+Model/Price/Qty
+Model/Category
+Froogle
+Attributes
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_error.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_error.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_error.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+
+
+
+
+
+what the basic froogle feed sends:
+product_url    name    description   price   image_url   category    offer_id
+
+http://192.168.1.35/loaded6151/product_info.php?products_id=28  $25 Gift Certificate  Buy a Gift Certificate for your friends or family 26.38 http://192.168.1.35/loaded6151/images/giftcert-25-sm.gif   Gift Certificate 28
+
+
+froogle product url not set up For SEO urls
+http://192.168.1.35/loaded6151/product_info.php?products_id=20
+
+1. FTP open connection failed to
+The is no server listed in the configure file to connect to
+
+2. FTP connection has failed!
+Failed to connect to the froogle server.
+  wrong user or password entered into the configuration
+
+3. Attempted to connect to
+ An attempt to connect to the server failed If you have list a server, Froogle ftp could be down
+ or you have the wrong server listed inthe configuration.
+ 
+ 
+4. Couldn\'t change directory on
+
+5. Uploaded froogle.txt to hedwig.google.com as /testuser/froogle.txt
+
+The upload worked, Now go to froogle and log into your account and double check the feed.
+
+ 
+ 
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_export.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_export.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_export.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_start.png" border="0" ><br>
+
+ The Export Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPA</b>
+ </td>
+</tr>
+<tr>
+ <td>
+The changes here are in the handling of HTML content in descriptions; image path URL's,
+and EP import filename requirements. You may now import files with html in the text
+fields and not have it mangled by EP or Excel.  URL's for images in subdirectories
+can be handled and correctly written to the database.   Beginning with 2.75, EP
+Advanced will not install files unless it begins with EPA,and EP Basic will not
+install files that begin with EPA.  This feature is to protect the database from
+errors related to a new column added to the Easy populate file format.  EP Advanced
+uses the product_id column, this allow for more features to be added. EPA is will also allow
+you to refine your export file so you can target a specific group of records to edit
+ </td>
+ </tr>
+  <tr>
+ <td>
+<br><H3><b>1. Select method to save export file </b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_sel_export.png" border="0" ><br>
+  </td>
+</tr>
+<tr>
+ <td>
+To export select where you want the export file placed.
+</td>
+</tr>
+<tr>
+ <td>
+<br><H3><b>2. Select field set to export</b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_field_group.png" border="0" ><br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+Next select which group of feilds to export
+</td>
+</tr>
+  </td>
+ </tr>
+
+<tr>
+ <td>
+<br><H3><b>3.Select field for sort order </b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_sortorder.png" border="0" ><br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+Next select the sort order you want the rows to apear in the export file.
+</td>
+</tr>
+<tr>
+ <td>
+<br><H3><b>4.Limit number of products to Export </b></H3><br>
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+If you deal with large export files and find it diffcult to find products to edit. You
+can use the Limits to make you export files small and target specific groups of records.
+Not all export files can be limited by all meathods. Meathods can also be combined.
+</td>
+</tr>
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>a. Limit By Category </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_cat.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ If you have TOP showing in the drop down box all categories are looked at.
+ If you have a category showing in the drop down box, the that category and all sub categories will be in the list
+ The categories drop down is generated from your categories in the database
+</td>
+</tr>
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>b. Limit By Manufacture </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_man.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ If you have "Manufactures showing in the drop down box all manufactures are looked at.
+ You can select any manufacture to target just there products
+ The drop down list of manufacures is read from your manufacters.
+ </td>
+</tr>
+
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>c. Limit By Product Range </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_prodid.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ You can use Product Id's to limit your export file.
+<br>&nbsp;&nbsp;&nbsp;  1. If no product_id's are enter all of the product are in the export file
+<br>&nbsp;&nbsp;&nbsp;  2. If the begin product_id and no end product_id is entered. Products from the first product id to the end are in the export file
+<br>&nbsp;&nbsp;&nbsp;  3. If no beginning product_id's and only and ending product_ID. From the first id to ending the products are in the export file
+<br>&nbsp;&nbsp;&nbsp;  4. If the begin product_id and ending product_id is enter then this range of products are in the export file
+ </td>
+</tr>
+
+
+<tr>
+<td>
+<br>&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_feed_intro.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_feed_intro.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_feed_intro.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,110 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<font face="Arial"><span style="font-size:10pt;">
+<tr>
+ <td>
+</span></font><p align="center"><b><span style="font-size:10pt;"><font face="Arial">Data Feed Input/Output Introduction</font></span></b></p>
+<p>
+<font face="Arial"><span style="font-size:10pt;">&nbsp;<b> 1. Introduction:</b> Data feed service is
+based on Calvin K's data feed contribution. The basic functions were retained
+but the rest of the internal code was changed to follow OSC Style of coding.
+Along with the coding change an&nbsp;admin interface was introduced to manage
+the feed configuration. With these coding changed and the addition of a admin
+the process was split into 4 steps. Not all of the steps are required for each
+feed you do.</span></font></p>
+<p>
+<font face="Arial"><span style="font-size:10pt;">&nbsp; <b>2. Goals:</b><br>The typical store owner never needs to edit a code or define file directly.The store
+owner does not need a lot of support on how to use program. Combines the functions
+of moving data in and out of store is in one area. Make it flexible enough for
+small, medium and large store to use program effectively. Move program files closer
+to OSC/CRE Loaded standards for look and feel, and coding.<br><br>
+&nbsp; <b>3. Parts of Data Feed Service:</b><br>
+Froogle data feed : Calvin K<br>
+&nbsp;Salemaker for froogle feed: by Marcel van Lieshout<br>
+&nbsp;Admin for Data Feed : Tom O'Neill<br><br>
+&nbsp;&nbsp;&nbsp; d. For Data feeds setup up:<br>
+Step 1 <br>
+&nbsp;To set up this modules data feed service, Review the 7 steps to your first feed. It outlines
+what steps you need to take to do a feed. It will take you through the configuration process to the uploading and checking of the feed.<br>
+&nbsp;Step 2<br>The you will need to configure and run the data feeds this
+is described in the running doc/configureandrun.txt document The file field_spec.txt
+describes the limitation of what can be placed into each field<br><br>
+</span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+</td>
+</tr>
+<tr>
+  <td>
+
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">&nbsp;3. Error and status messages</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will appear near the top of the form, Blue background
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_mesg.png" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Import result</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now appear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Help while using the admin screens</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or input you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+ <br><br><b> 5. Features added and changes to basic programs.</b><br>
+&nbsp;Data Feed:<br>
+&nbsp;1. Added language files<br>
+&nbsp;2. Multiple configurations for multiple feed services now available through admin screen<br>
+&nbsp;3. Configuration configured in admin rather then edit a file.<br>
+&nbsp;4. Feed submission now A multiple step process.<br>
+&nbsp;5. Switched to tep functions for data base queries.<br>
+&nbsp;6. Split file generation and FTP code into two separate files.<br>
+&nbsp;7. Combined Froogle, Yahoo and Bizrite into one package (Not all installed and adapted yet)<br>
+&nbsp;8. added fields for advance feed to products database<br>
+&nbsp;9. added separate sql file for additional info for froogle feed<br>
+&nbsp;10. Builds Category strings before building feed file.<br>
+&nbsp;11. Help popups added to admin screens.<br>
+&nbsp;12. Added salemaker contribution pricing to price sent to price in feed.<br>
+&nbsp;13. Uses tax zone from store. <br>
+&nbsp;14. Add the fields froogle_type, upc, isbn, manufacturer_product_id to products table and
+products edit screen. (not completed in this version)<br>
+&nbsp;15. add froogle specific fields for books, music, video to a separate table.(not completed in this version)<br>&nbsp;
+</td>
+</tr></span></font>
+<tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_frooglebacisgettingstarted.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_frooglebacisgettingstarted.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_frooglebacisgettingstarted.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Getting started with Froogle
+
+There are 7 main steps to send your first Froogle feed</b><br>
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+<br>
+&nbsp;Step 1: Sign in to the Froogle Merchant Center
+Create or use an existing Google Account to enter the Froogle Merchant Center.
+
+You must go to
+<a href="https://www.google.com/froogle/merchants/welcome">https://www.google.com/froogle/merchants/welcome</a>
+
+From here there is a link to &quot; create an account now. &quot;
+
+You need to follow these pages and signup for a new account if you do not have one.<br>
+<br>
+&nbsp;Step 2: Create an FTP account
+:<br>Set up your FTP account, which you'll use to upload your feeds to us.
+Do this in your froogle merchant account
+
+<br><br> &nbsp;Step 3: Specify your feed's settings in the catalog admin:<br>
+Log into your stores admin and go to the  Data Input Output Systems box in the left hand
+column. From here you will see the feeds main screen. You can either click on the run bottom
+next to configure or click on the data configure in the left hand column.  These setting are
+transferred to the froogle admin in the cart
+
+<br><br> &nbsp;Step 4: Set Categories in the catalog admin:
+<br>Once you have setup the configuration you will need to return to the &quot;Data Feeds&quot; screen. Here
+you will need to build your categories for the feed. Since this is a intense process  it is a separate step.
+You need to do this once and then again only if you change your categories.
+It was done this way for larger stores to reduce processing time.
+<br><br>
+&nbsp;Step 5: Pre Feed Process in the catalog admin:
+<br>This set will Build the actual file for submission to Froogle. If this process take more then
+60 Second then you have a medium to large store or there is a problem. Compared the feed
+you built in the step to the sample one called /doc/sample_text.txt in the contribution.
+
+<br><br> &nbsp;Step 6: Submitting the feed in the catalog admin:
+<br>There are two methods to submit the feed to Froogle. The first is via direct FTP, this is where the FTP information you
+entered into the configuration is used and the feed file is sent directly to Froogle. Or you down load the feed
+and FTP from your local computer to froogle.
+<br><br>
+&nbsp;Step 7: Check your feed for errors:<br>
+Sign in to your Froogle Merchant Center account to check for any formatting errors in your feed.
+Log back into your merchant account at Froogle<br><br>.
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_froogleconfigure.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_froogleconfigure.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_froogleconfigure.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,103 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Configuring Froogle feed</b> </td>
+  </tr><br><br>
+<tr>
+ <td>
+<br>1. <b>List of Configurations</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_new_config.png" border="0" ><br>
+ You will start off by going to the list of configuration. This list all the data feed configurations
+for your store. If you have not done any configuration then there will be none in this list. You must have
+at least one configuration setup.<br>
+ To start a new configuration click on the new button under the list of configurations.
+<br>
+ </td>
+</tr>
+<tr>
+ <td>
+<br>2. <b>Configuration:</b> <br>
+
+ For a new configuration fill in all text boxes and check boxes of the check boxes except active.
+ The click on insert. Once the information has been inserted in to the database<br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ </td>
+</tr>
+<tr>
+
+ <td>
+<br>&nbsp;3.  Settings and what they mean:
+<br>&nbsp;&nbsp; a. Name of Feed
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the name of the feed
+as it will appear in the drop down boxes when data feed<br>&nbsp;&nbsp; b. Product Feed Type
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: Basic&nbsp;or
+Advance Only basic is available.&nbsp;<br>&nbsp;&nbsp; c. Data Feed Discription
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A short description of the feed
+configuration<br>&nbsp;&nbsp; d. Data Feed File Type
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: none,
+products, business. For this you should choose product as the business feed
+is not yet in this package.&nbsp;&nbsp;<br>&nbsp;&nbsp; e. Feed Service
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: Froogle, Yahoo
+&nbsp;Choose Froogle, as Yahoo feed service has not been added.<br>&nbsp;&nbsp; f.
+Status  Set <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings:&nbsp;Active  Inactive
+For a new feed do not change this, until after your first insert.
+<br>&nbsp;&nbsp; g. File name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the file name you chose
+when you did your set up at Froogle.<br>&nbsp;&nbsp; h. Image URL
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you use a image url other then the
+default one for CRE Loaded then enter it here from the /images directory<br>&nbsp;&nbsp; i.
+Froogle FTP information
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Froogle FTP Server Name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP server usually https://</span></font>hedwig.google.com<font face="Arial"><span style="font-size:10pt;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.   Froogle FTP User Name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP User Name&nbsp;you chose at froogle<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.    Froogle FTP Password<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP password you chose at froogle<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.   Froogle FTP Directory<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP Directory&nbsp;you chose at froogle<br>&nbsp;&nbsp; g. Froogle Advance Settings
+<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;1. Use store Currency <br>       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;possible
+setting: False: Use store default current,  True: Use currency listed below
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you
+choose false then the store currency will be used. if you choose true the enter
+a single currency below&nbsp;&nbsp;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;2. Other currency<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If above was
+True list a currency here&nbsp;currency<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;3.
+Convert Currency<br>      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible
+settings:False: Do not convert to currency  True: Convert currency
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is used
+if you wish to convert between currencies when a customer enters your store.<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;4.
+Use store language<br>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible
+settings: False: Use store default language  True: Use language selected below
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you choose
+false then the store language&nbsp;will be used. if you choose true the enter
+a single language&nbsp;below<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;5. Other language<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If above was True
+list a list language code here<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.&nbsp;Tax Class ID<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font>Enter the tax class ID number from the store or set to zero (0) for no tax calculation<font face="Arial"><span style="font-size:10pt;"><br></td>
+</tr>
+
+ <tr>
+ <td>
+<br>Once you have finished with the configuration and either Inserted or saved
+it the click on froogle again in the side box. This will take you to the main
+run screen.<br></td>
+</tr>
+
+ <tr>
+ <td><br>&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_froogleconfigure1.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_froogleconfigure1.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_froogleconfigure1.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_import.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is entended for backward compatibility with previous version of Easy Populate.
+This version has been reorginized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatable with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPB format. This is
+the products_model is the first column in the upload file. The file should have EPB as the first
+three characters in its file name or none at all.
+
+Click on the browse button to browse your local computer for the file to upload and insert.
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. Also
+EP usually will only imports 400 to 500 lines of products, this version can do 2,000 plus.
+If a file it to large to upload because of PHP restrictions the FTP the file to the site and use
+"Import Data from file in temp/"
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Although it may not be needed, EP basic upload and split is available. Use the browse button
+to browse you local files and select the ile for uploading.  It will be spilt into files
+limited by the configure setting $maxrecs as set in the epconfigure.php file.
+Each file name will be dated with the date the split was created.
+ </td>
+</tr>
+<tr>
+ <td>
+<b>List of Configurations</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_start.png" border="0" ><br>
+ You will start off by ging to the list of configuration. this list all the data feed configurations
+for your store. If yo have not done any configuration then there will benone in this list. You must have
+at least one configuration setup.<br>
+ To start a new configuration click on the new button under the list of configurations.
+<br>
+ </td>
+</tr>
+<tr>
+
+<tr>
+ <td>
+<b>Configuration:</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ For a new configuration fill in all text boxes and check ll of the check boxes except active.
+ The click on insert. Once the information has been inserted in to the database<br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ </td>
+</tr>
+<tr>
+
+ <td>
+<br>&nbsp; Add New Feed Setting
+<br>&nbsp;&nbsp; Name of Feed
+<br>&nbsp;&nbsp; Product Feed Type
+<br>&nbsp;&nbsp; Data Feed Discription
+<br>&nbsp;&nbsp; Data Feed File Type
+<br>&nbsp;&nbsp; Feed Service
+<br>&nbsp;&nbsp; Status   Set Active  Inactive
+<br>&nbsp;&nbsp; File name
+<br>&nbsp;&nbsp; Image URL
+<br>&nbsp;&nbsp; Froogle FTP information
+<br>&nbsp;&nbsp;&nbsp;&nbsp; Froogle FTP Server Name
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP User Name
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP Password
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP Directory
+<br>&nbsp;&nbsp; Froogle Advance Settings
+<br>&nbsp;&nbsp; Use store Currency         False: Use store default current  True: Use currency listed below
+<br>&nbsp;&nbsp; Other currency
+<br>&nbsp;&nbsp; Convert Currency       False: Do not convert to currency  True: Convert currency
+<br>&nbsp;&nbsp; Use store languge        False: Use store default language  True: Use language selected below
+<br>&nbsp;&nbsp; Other languge
+<br>&nbsp;&nbsp;Tax Class ID
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_frooglerun.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_frooglerun.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_frooglerun.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Run Froogle feed</b> </td>
+  </tr><br><br>
+<tr>
+ <td>
+<br><b>1. Main run screen</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_start.png" border="0" ><br>
+If you have not built at least one configuratin do so now.
+</td>
+</tr>
+<tr>
+ <td>
+<b>2. Configuration:</b> <br>
+ </span></font>Configure: &nbsp;Build or edit unique configuration click
+on the run button to add or edit feed configuration(s). You must have at least
+one feed<br>configuration<br><br>
+ </td>
+</tr>
+<tr>
+ <td>
+<b>3. </span></font>Set Categories:<br> </b>&nbsp;This process can be intense
+for medium to large stores. You should only run this before the first feed and
+if you change any categories. You do not need to run this proccess every time<font face="Arial"><span style="font-size:10pt;"><br>
+ <br></td>
+</tr>
+<tr>
+ <td>
+<b></span></font> 4.&nbsp;Pre Feed Process:<br></b> &nbsp;You will run this
+every time you do a feed. This step build the actual feed file for you. It is
+a good Idea for your month feed to run this before submitting.<font face="Arial"><span style="font-size:10pt;"><br><br><b>&nbsp;</b></td>
+</tr>
+<tr>
+ <td>
+</span></font><b> &nbsp;5. &nbsp;Submit Feed:</b><br>&nbsp;
+If you wish to  have the feed sent directly to the FTP server at Froogle you will
+run this step. You must have the Froogle FTP information entered into the
+configuration<br><br><font face="Arial"><span style="font-size:10pt;"><br></td>
+</tr>
+
+ <tr>
+ <td><br>&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_import.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_import.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_import.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,87 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_start.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPA</b>
+ </td>
+</tr>
+<tr>
+ <td>
+The changes here are in the handling of HTML content in descriptions; image path URL's,
+and EP import filename requirements. You may now import files with html in the text
+fields and not have it mangled by EP or Excel.  URL's for images in subdirectories
+can be handled and correctly written to the database.   Beginning with 2.75, EP
+Advanced will not install files unless it begins with EPA,and EP Basic will not
+install files that begin with EPA.  This feature is to protect the database from
+errors related to a new column added to the Easy populate file format.  EP Advanced
+uses the product_id column, this allow for more features to be added.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPA format. This is
+the products_id is the first column in the upload file. The file should have EPA as the first
+three characters in its file name. If it does not then most likely you should use EP basic to import the file.
+<br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_uploaded_insert.png" border="0" ><br><br>
+
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. EPA will import
+more then 2,000 rows in one file, unlike older version that were limited to 300 to 400 maximum. If the file is larger then
+the limit set by PHP then you must upload the file via FTP then use the "Import Data from file in temp/' to import the data.
+If the file is still to large you can split it on the server by using "Split a EP File on the server". The list of files
+in the drop down is fileter so EPB file are not show. and file that are already spilt will not show.
+
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+This routine incorporates the same changes noted above for import files.  If for some reason
+you need to split you upload file into smaller parts then you can use this feature. Most site should
+not need to split files any more.
+ </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_uploaded_results.png" border="0" ><br><br>
+
+ The upload results now apear below the insert screen.<br><br>
+
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_delete.png" border="0" ><br><br>
+ Since you now can delete records the message will apear as above when a recored is deleted.<br>
+
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_intro.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_intro.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_intro.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,195 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<font face="Arial"><span style="font-size:10pt;"><tr>
+ <td>
+</span></font><p align="center"><b><span style="font-size:10pt;"><font face="Arial">Data Feed Input/Output Introduction</font></span></b></p>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;<b> 1. Introduction:</b> Data feed service is a collection of contributions to allow you to updated
+your products and categories data remotely, and send that data to data listing
+services. It uses a number of contributions that have been modified to work
+better with small, medium, and large stores. </span></font></p>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp; <b>2. Goals:</b><br>The typical store owner never needs to edit a code or define file directly.The store
+owner does not need a lot of support on how to use program.Combines the functions
+of moving data in and out of store is in one area. Make it flexable enough for
+small, medium and large store to use program effectivly. Move program files closer
+to OSC/Cre Loaded standerds for look and feel, and codeing.<br><br>
+&nbsp; <b>3. Parts of Data Feed Service:</b><br>
+Easy Populate Advance enhanced by Tom O'Neill<br>
+Easy Populate Basic enhanced by Tom O'Neill<br>
+Froogle data feed : Calvin K<br>
+&nbsp;Salemaker for froogle feed: by Marcel van Lieshout<br>
+&nbsp;Admin for Data Feed : Tom O'Neill<br><br>
+&nbsp;&nbsp;a. Easy Populate: This is used to update product and category data, it allows
+you to updated data remotely on your&nbsp;local computer and upload to the data
+to your on line store.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;1. Easy Populate Advance<br>
+&nbsp;&nbsp;&nbsp;&nbsp;Easy Populate Advance
+uses products_id instead of products_model to tie the rows in the Import/Export
+file to your database. This is significate since you now can delete items, asigning
+products to multiple categories, refine export files to select records you need
+to edit/update There also has been asignificant speed and record handling capibilities
+added to both Advance and Basic version. The numbers below are from recent test
+done, previously Easy populate could only handle 300 to 400 records max.
+
+<br>
+&nbsp;&nbsp;&nbsp; 2. Easy Populate Basic<br>
+ Easy Populate basuc is for back ward compatiblity with  EP 2.XX version of Easy populate.
+This is because EP used modle numbers to tie you file  back to the database. Where in the advance
+version it used product_id.<br>
+
+&nbsp;&nbsp;&nbsp;3. Increase in speed and record handling<br></span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;&nbsp;&nbsp;&nbsp;  a. Using only stock products<br>
+export EPB ~ 32 records 0.173231 seconds file size 26kb<br>
+import EPB ~32 records 1.844497 seconds file size 26kb<br>
+export EPA~ 32 records 0.790210 seconds file size 26kb<br>
+import EPA~ 32 records 1.759426 seconds file size 26kb<br>
+&nbsp;&nbsp;&nbsp;&nbsp;  b. Using 2033 products in a single file<br>
+import EPA 89.927511 second &nbsp;or 1 minute 30 sec file size 2.800 KB<br>
+import EPB 456.582260 second &nbsp;or 7 minutes and 36 sec file size 3,423 KB<br>
+&nbsp;&nbsp;&nbsp;&nbsp;  c. Deleting products:2033 products added<br>
+delete EPA 68.877599 seconds File size was 2,875 KB<br>
+EPB cannot delete records.&nbsp;<br><br>
+&nbsp;b. Data feed:<br>
+&nbsp;&nbsp;Data feed takes the data with in your catalog and prepares it for submission to a feed &nbsp;service and send it to the feed
+service either automaticly or manualy if you need on completion&nbsp;of building the feed.<br>&nbsp;<br>
+&nbsp;c. For EP set up:<br><br>
+&nbsp;&nbsp; The setup information for Easy Populate is stored in admin/epconfigure.php. This
+configuration is for both Easy Populate Basic and Easy Populate Advance. <br><br>
+&nbsp; d. For Data feeds setp up:<br>
+Step 1 <br>
+&nbsp;To set up this modules data feed service, Review the 7 steps to your first feed. It outlines
+what steps you need to take to do a feed. It will take you through the configuration process to the uploading and checking of the feed.<br>
+&nbsp;Step 2<br>The you will need to configure and run the data feeds this
+is described in the running doc/configureandrun.txt document The file feild_spec.txt
+describes the limitation of what can be placed into each felid<br><br>
+</span></font></p>
+ <font face="Arial"><span style="font-size:10pt;"> </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">
+ &nbsp;3. Error and staus messages</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will apear near the top of the for, Blue background
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_mesg.png" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Import result</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now apear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Help while using the admin screens</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or imput you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+<tr>
+ <td><br><br><b> 5. Features added and changes to basic programs.</b><br> &nbsp;&nbsp;<br>&nbsp;Easy
+populate 2.75 Advance to 3.01:<br>
+&nbsp;&nbsp;&nbsp;1. Removed the froogle feed from this
+contribution. The froogle function is now &nbsp;handled by seperate code files.<br>
+&nbsp;&nbsp;&nbsp;2. Moved EP from catalog side box to Data Input/Output System side box.<br>
+&nbsp;&nbsp;&nbsp;3. Moved function file to admin/includes/function directory to follow OSC standerds.<br>&nbsp;&nbsp;&nbsp;4.
+Moved most simple function to function file, export now has all functions removed
+. There is now only one function left in the EPA import file. <br>
+&nbsp;&nbsp;&nbsp;5. Redid admin screens so it was more like the rest of the OSC admin. .<br>
+&nbsp;&nbsp;&nbsp;6. Inserted tep form function rather then html form function. <br>&nbsp;&nbsp;&nbsp;7. Added
+popup help for informtion on how to use EPA.<br>
+&nbsp;&nbsp;&nbsp;8. Easy Populate Basic is for backward compatibility with older versions of EP<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EP advance will import all EPA files of previous version of EPA. <br>
+&nbsp;&nbsp;&nbsp;9. Export screen and Import screen seperated into two seperate files<br>
+&nbsp;&nbsp;&nbsp;10. Side box changed, so that sub titles are offset.<br>
+&nbsp;&nbsp;&nbsp;11. Added date time to split so each group of splits will be unique and old splits will &nbsp;not be
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>
+&nbsp;&nbsp;&nbsp;12. Program message, error, and output were place in one of three variable so they
+could be outputed&nbsp;with in the html output section of the files.<br> <br>Easy
+Populate Basic 2.75 Basic to 3.01:</span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;&nbsp;&nbsp;1. Easy Populate Basic is for backward compatibility with older versions of EP<br>
+&nbsp;&nbsp;&nbsp;2. Added date time to split so each group of splits will be unique and old splits will&nbsp;not be
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>
+&nbsp;&nbsp;&nbsp;3. Program message, error, and output were place in one of three variable so they
+could be outputed&nbsp;with in the html output section of the files.<br>
+&nbsp;&nbsp;&nbsp;4. Removed the froogle feed from this contribution. The froogle function is now &nbsp;handled by seperate code files.<br>&nbsp;&nbsp;&nbsp;5.
+Moved EP from catalog side box to Data export/import side box.<br>
+&nbsp;&nbsp;&nbsp;6. Moved function file to admin/includes/function directory to follow OSC standerds.<br>
+&nbsp;&nbsp;&nbsp;7. Moved most simple function to function file, export now has all functions removed .. <br>
+&nbsp;&nbsp;&nbsp;8. Redid admin screens so it was more like the rest of the catalog. and EPA<br>
+&nbsp;&nbsp;&nbsp;9. Inserted tep form function rather then html form function (Inprogress)<br>
+&nbsp;&nbsp;&nbsp;10. Added popup help for informtion on how to use EPB.<br><br>&nbsp;Items
+fixed or enhanced from Ep 2.74 to 2.75 Advance:<br>
+&nbsp;1. To add products the product id should be set to 0, there can be many 0's for product ID's.<br>
+&nbsp;2. You no longer need to change the manufacturers table to change a manufacturers_id
+first&nbsp;manf id to 1 or 0<br>
+&nbsp;3. No longer adds a empty product, caused by not treating the last line as not product.<br>
+&nbsp;4. Added EP Basic, It cannot install any EP Advanced files since they start with EPA a error<br>
+&nbsp;&nbsp;&nbsp;&nbsp;message
+will be displayed. It can install any file that strts wil EPB or older EP files<br>
+&nbsp;5. EP Advanced set up so it can only read files that start with EPA , prevents
+reading older files.<br>
+&nbsp;6. Delete has been added back into EP for products
+only. &nbsp;This is implemented via a new column call v_action. You must type
+the word &quot;delete&quot; in this column to delete a product.<br>
+&nbsp;7. EP basic was not showing on some site this was to an error in the install of
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>
+&nbsp;8. You can add your own product ID, If your product ID's are based on a system
+other than&nbsp;numbers generated by the shopping cart and autoincremented by
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows
+for compatibility with some external inventory management systems.<br>&nbsp;
+9. moved configuration of EP to a seperate file called epconfigure.php <br><br>
+&nbsp;Data Feed:<br>
+&nbsp;1. Added language files<br>
+&nbsp;2. Multiple configurations for multiple feed services now available through admin screen<br>
+&nbsp;3. Configuration configured in admin rather then edit a file.<br>
+&nbsp;4. Feed submission now A multiple step process.<br>
+&nbsp;5. Switched to tep functions for data base queries.<br>
+&nbsp;6. Split file generation and FTP code into two separate files.<br>
+&nbsp;7. Combined Froogle, Yahoo and Bizrite into one package (Not all installed and adapted yet)<br>
+&nbsp;8. added fields for advance feed to products database<br>
+&nbsp;9. added separate sql file for additional info for froogle feed<br>
+&nbsp;10. Builds Category strings before building feed file.<br>
+&nbsp;11. Help popups added to admin screens.<br>
+&nbsp;12. Added salemaker contribution pricing to price sent to price in feed.<br>
+&nbsp;13. Uses tax zone from store. <br>
+&nbsp;14. Add the feilds froogle_type, upc, isbn, manufacturer_product_id to products table and
+products edit screen.<br>&nbsp;
+15. add froogle specific feilds for books, music, video to a seperate table.<br>&nbsp;
+</td>
+</tr></span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+?>
+<tr>
+ <td>
+<p align="center"><b><span style="font-size:16pt;">Data Feed Input/Output Introduction</span></b></p>
+<p>Data feed service is a collection of contributions to allow you to updated 
+your products and categorys data remotely, and send that data to data listing 
+services. It used a number of contributions that have been modified to work 
+with small, medium, and large stores. </p>
+<p>Contributions:<br>Easy Populate Advance by Tom O'Neill<br>Easy Populate Basic<br>Froogle 
+data feed : Calvin K<br> &nbsp;&nbsp;&nbsp;Salemaker for froogle feed: by<br> 
+&nbsp;&nbsp;&nbsp;Admin for Froogle Data Feed : Tom O'Neill<br><br> Goals:<br>The 
+typical store owner never needs to edit a code or define file directly.The store 
+owner does not need a lot of support on how to use program.Combines the functions 
+of moving data in and out of store is in one are.Make it flexable enough for 
+small, medium and large store to use program effectivly.Move program files closer 
+to OSC/Cre Loaded standerds for look and feel, and codeing.<br><br>Parts of 
+Data Feed Service:<br>&nbsp;Easy Populate: This is used to update data it allows 
+you to updated data remotely on your&nbsp;local computer and upload to the data 
+to your on line store. It allows you to&nbsp;&nbsp;build custom queries for 
+the data then download the information to your local computer&nbsp;&nbsp;for 
+editing, Then upload back to your &nbsp;on-line store.</p>
+<p>&nbsp;Data feed:<br>&nbsp;&nbsp;Data feed takes the data with in your catalog 
+and prepares it for submission to a feed &nbsp;service and send it to the feed 
+service either automaticly or manualy if you need on completion&nbsp;of building 
+the feed.<br>&nbsp;Features added and changes to basic programs.<br> &nbsp;&nbsp;&nbsp;Easy 
+populate 2.75 Advance to 2.78:<br>&nbsp;1. Removed the froogle feed from this 
+contribution. The froogle function is now &nbsp;handled by seperate code files.<br>&nbsp;2. 
+Moved EP from catalog side box to Data export/import side box.<br>&nbsp;3. Moved 
+function file to admin/includes/function directory to follow OSC standerds.<br>&nbsp;4. 
+Moved most simple function to function file, export now has all functions removed 
+. There is now only one function left in the EPA import file. <br>&nbsp;5. Redid 
+admin screens so it was more like the rest of the catalog.<br>&nbsp;6. Inserted 
+tep form function rather then html form function (Inprogress)<br>&nbsp;7. Added 
+popup help for informtion on how to use EPA.<br>&nbsp;8. Easy Populate Basic 
+is for backward compatibility with older versions of EP<br>&nbsp;&nbsp;&nbsp;&nbsp;EP 
+advance will import all EPA files of previous version of EPA. <br>&nbsp;9. Export 
+screen and Import screen seperated into two seperate files<br>&nbsp;10. Side 
+box changed, so that sub titles are offset.<br>&nbsp;11. Added date time to 
+split so each group of splits will be unique and old splits will&nbsp;not be 
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>&nbsp;12. 
+Program message, error, and output were place in one of three variable so they 
+could be outputed&nbsp;with in the html output section of the files.<br> &nbsp;&nbsp;<br>&nbsp;Items 
+fixed or enhanced from Ep 2.74 to 2.75 Advance:<br>&nbsp;1. To add products 
+the product id should be set to 0, there can be many 0's for product ID's.<br>&nbsp;2. 
+You no longer need to change the manufacturers table to change a manufacturers_id 
+first&nbsp;manf id to 1 or 0<br>&nbsp;3. No longer adds a empty product, caused 
+by not treating the last line as not product.<br>&nbsp;4. Added EP Basic, It 
+cannot install any EP Advanced files since they start with EPA a error<br>&nbsp;&nbsp;&nbsp;&nbsp;message 
+will be displayed. It can install any file that strts wil EPB or older EP files<br>&nbsp;5. 
+EP Advanced set up so it can only read files that start with EPA , prevents 
+reading older files.<br>&nbsp;6. Delete has been added back into EP for products 
+only. &nbsp;This is implemented via a new column call v_action. You must type 
+the word &quot;delete&quot; in this column to delete a product.<br>&nbsp;7. 
+EP basic was not showing on some site this was to an error in the install of 
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>&nbsp;8. 
+You can add your own product ID, If your product ID's are based on a system 
+other than&nbsp;numbers generated by the shopping cart and autoincremented by 
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows 
+for compatibility with some external inventory management systems.<br>&nbsp;9. 
+moved configuration of EP to a seperate file called epconfigure.php <br><br>&nbsp;Data 
+Feed:<br>&nbsp;1. Added language files<br>&nbsp;2. Multiple configurations for 
+multiple feed services now available through admin screen<br>&nbsp;3. Configuration 
+configured in admin rather then edit a file.<br>&nbsp;4. Feed submission now 
+A multiple step process.<br>&nbsp;5. Switched to tep functions for data base 
+queries.<br>&nbsp;6. Split file generation and FTP code into two separate files.<br>&nbsp;7. 
+Combined Froogle, Yahoo and Bizrite into one package (Not all installed and 
+adapted yet)<br>&nbsp;8. added fields for advance feed to products database<br>&nbsp;9. 
+added separate sql file for additional info for froogle feed<br>&nbsp;10. Builds 
+Category strings before building feed file.<br>&nbsp;11. Help popups added to 
+admin screens.<br>&nbsp;12. Added salemaker contribution pricing to price sent 
+to price in feed.<br>&nbsp;13. Uses tax zone from store. <br>&nbsp;14. Add the 
+feilds froogle_type, upc, isbn, manufacturer_product_id to products table and 
+products edit screen.<br>&nbsp;15. add froogle specific feilds for books, music, 
+video to a seperate table.<br><br>&nbsp;For EP set up:<br>&nbsp;For Data feeds 
+setp up:<br>Step 1 <br>&nbsp;To set up this modules data feed service, you must 
+first register with the feed services you wish to use.&nbsp;This is described 
+in the getting started document. It has links to the feed services &nbsp;and 
+what you need to set up the configuration of each service.<br>Step 2<br>Next 
+you need to install this contribution this is disturbed in the doc/install.txt 
+files<br>Step 3<br>The you will need to configure and run the data feeds this 
+is described in the running doc/configureandrun.txt document The file feild_spec.txt 
+describes the limitation of what can be placed into each felid<br><br>&nbsp;Known 
+bugs:<br>&nbsp;&nbsp;1. PHP 5 compatability for import. the problem is either 
+how globals are treated or&nbsp;&nbsp;how arrays are used in this contribution<br></p>
+ </td>
+</tr> 
+<tr>
+  <td>
+ <b>Error and staus messages</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will apear near the top of the for, Blue background 
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_msg.gif" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ <b>Import result</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now apear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ <b>Help while using the admin screens</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or imput you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
+

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_spreadsheet.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_spreadsheet.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/data_spreadsheet.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td class="helpMain">
+
+
+<b><span style="font-size:14pt;">How to do specific task with the files in Easy Populate Advance:</span></b><br><br>
+Index:
+<br><b><a href="#1. Adding new products:">1. Adding new products:</a>
+<br><a href="#2. Adding linked products">2. Adding linked products</a></b>
+<br><b><a href="#3.Deleting products">3. Deleting products</a></b>
+<br><b><a name="4. Move a product to a new category:" href="#4. Move a product to a new category:">4. Move a product to a new category</a>
+<br><a href="#5. Reducing size of import file:">5. Reducing size of import file</a><br><a href="#6. Your first import file">6. Your first import file&nbsp;</a></b><a href="#6. Your first import file">
+</a><p>
+&nbsp;&nbsp;<b><a name="1. Adding new products:">1. Adding new products:</a>
+(</b>These procedures are for EPA only)<br> &nbsp;&nbsp;&nbsp;&nbsp;a. Because
+EPA uses the product_ID to link to your products in the database and EPB still
+uses model numbers many of the additional features for EPA cannot be added to
+EPB. &nbsp;EPB is used for backward compatibly to older versions of EP.<br>
+&nbsp;&nbsp;&nbsp; b. To add products the product_id should be 0, there can be many 0's for product ID's
+  as needed. The code will detect the 0 as a new product and auto increment the
+  products_id.
+  <br>
+
+&nbsp;&nbsp;&nbsp;  c. If the products_id number is left blank then the product is not added. You can also
+  insert you own product_ID. they do not have to be sequential. <br>
+
+&nbsp;&nbsp;&nbsp;  d. If you need to specify your own unique products_ID, and it does not exist in the data
+  base it will be added as a new product. Make sure you add the correct categories,
+  other wise you will need to use the move product to a new category procedure.
+<br>
+Example:
+<br>
+I have a previous inventory software that has already assigned product ID's they are
+<br>
+12001<br>
+15001<br>
+14<br>
+2000<br>
+<br>
+These can be used by simply putting the in the v-product_id column.
+<br><br> &nbsp;&nbsp;e. A Product_id must be a number, this is done so the admin
+products edit/add for will work.<br><br>
+&nbsp;&nbsp;<b><a name="2. Adding linked products">2. Adding linked products</a></b><a name="2. Adding linked products"> </a><br>(Yes Version 3.01 can handle linked products):
+A linked product is having one product record set, but having it show in multiple
+categories.
+<br>
+&nbsp;&nbsp;&nbsp;  a. For a product you want to link to another category
+Create a download using complete or model/category in the  Select fields to download
+you can limit the list by using the filter settings.
+<br>
+&nbsp;&nbsp;&nbsp;  b. Import into the spread sheet program.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 1. Copy the original product line to a new line<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 2. Change only category information where you want the product linked to.
+    Leaving the v_product_id unchanged.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 3. Save the file and re upload<br>
+<br>
+&nbsp;&nbsp;<b><a name="3.Deleting products">3.Deleting products</a></b> (This has been added back for products only):
+<br>&nbsp;&nbsp;&nbsp;  a. Single product not linked
+<br>
+&nbsp;&nbsp;&nbsp;  Download any of the files that has a products_id's. You will notice a column called v_action
+all the way to the left. In this column add delete for each product you which to delete.
+<br>
+&nbsp;&nbsp;&nbsp;  b. Deleting linked product:
+ Do a download that has all of the links for the product
+cut the paste the item you which do remove in front of the product links to remain.
+In the v_action column enter delete for the link you want to remove.
+<br>
+Note: the deleted item must be listed first. The product to remain must be list after the
+product link you are deleting.
+<br><br>
+&nbsp;<b>&nbsp;<a name="4. Move a product to a new category:">4. Move a product
+to a new category:</a></b><br> Moving a product between two categories
+  In the spread sheet program
+<br>&nbsp;&nbsp;&nbsp;   1. copy the line for the product to a new line
+<br>&nbsp;&nbsp;&nbsp;   2. on the original line type in delete in the v_action column
+<br>&nbsp;&nbsp;&nbsp;   3. on the new line change the categories
+<br>
+&nbsp;<br><b><a name="5. Reducing size of import file:">5. Reducing size of
+import file</a></b><br>Removing columns in the spread sheet.
+Due to how Ep was designed you do not need all of the column from the export file to be present
+in the import file.
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   1. Minimum columns:
+<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;a.   products_id, v_status, v_action, EOREOR
+ If you have product information: any or all by products_id can be removed
+<br>&nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;b. If you have meta tags or header tags installed make sure you leave the set together  If you have product information: any or all by products_id's can be removed
+<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;c. If you have category information: any or all of the unused category_ columns.<br>
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Caution: EP reads a product record set from you data base, then merges&nbsp;data
+from the import file. &nbsp;If the column you removed from the export file is
+not in this beginning query then that column will be removed from the data base.
+&nbsp;Example: previously if you removed one of the ultra images fields it would
+delete all data from that column in the products database. &nbsp;Not this bug
+has been fixed for ultra images, but it is something to keep in mind when constructing
+new export files.<br><br>
+<b><a name="6. Your first import file">6. Your first import file</a></b>
+<br>  &nbsp;&nbsp;a. When you first start to load a store with products it is usually easier to
+set up you category structure in the admin before you begin<br> &nbsp;&nbsp;b.
+Back up your data base!!!!. <br>
+
+&nbsp;&nbsp;c. Export a complete download so you have all of the headers in the export file.<br>
+&nbsp;&nbsp;d. Start your spread sheet program and click on the open file.
+<br> &nbsp;&nbsp;e. Navigate to the directory on your local computer where the export file resides. Make
+sure you change the file type, in the open file dialog to &quot;text CVS,txt&quot;. If you do not all of the information in the
+text file will be read into one cell of the spreadsheet program.
+
+<br> &nbsp;&nbsp;f. Single (')  and double quotes (&quot;) , MYSQL has problem when you try to insert reserved characters.
+I can cause error when trying to import then into your database. There are two ways to
+handle these
+  <br> &nbsp;&nbsp;&nbsp;&nbsp;1. Escape the character Example: There\'s Something About Mary
+  <br> &nbsp;&nbsp;&nbsp;&nbsp;2. Use decimal equivalent of the character Example: There&amp;#39s Something About Mary
+&nbsp;&nbsp;
+EPA and EPB can read both of these and correctly inserts the MYSQL compatible character
+so single and double quotes are displayed correctly in the catalog. Even if
+you choose not to use either of these methods EPA and EPB will read the single
+and double quotes and convert then as needed.<br>
+
+&nbsp;&nbsp;g. Product descriptions: You can draft these with an external HTML
+editing program or word processor, but you must be careful which one you use.<br>
+&nbsp;&nbsp;Most MS products used proprietary formats that may not be compatible
+with most web browsers in use today.<br> &nbsp;&nbsp;h. When you save the spread
+sheet file the first time use the save as function instead of the save function.
+change the name to something different, in the file type make sure it is &quot;text CVS,txt&quot;.
+This will preserve the original file in case you already had product in it. This
+is done so that you can recover form possible errors.&nbsp;<br> &nbsp;&nbsp;i.
+For new products use the product use the product_id of 0 if you wish the cart
+to set you product id's or entry and number op to 15 digits you want.<br> &nbsp;&nbsp;j.
+Do one final save making sure the file type is &quot;text CVS,txt&quot;., then
+go to your cart in import the file.<br><br></td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp;  <a href="data.php?selected_box=data"><img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_export_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_export_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_field_group.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_field_group.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_add.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_add.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_delete.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_delete.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_split.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_split.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_uploaded_insert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_uploaded_insert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_uploaded_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_import_uploaded_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_limit_cat.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_limit_cat.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_limit_man.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_limit_man.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_limit_prodid.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_limit_prodid.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_sel_export.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_sel_export.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_sortorder.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_sortorder.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epa_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export_mesg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export_mesg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export_sel_feld.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export_sel_feld.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export_sel_loc.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_export_sel_loc.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_import.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_import.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_import_mesg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_import_mesg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_import_select.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/epb_import_select.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_config.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_config.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_config1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_config1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_new_config.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_new_config.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/feed_froogle_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_catbuild.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_catbuild.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_catbuilddone.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_catbuilddone.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_feedbuilddone.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_feedbuilddone.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_feedsend_error1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/froogle_feedsend_error1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/import_results.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/import_results.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/item_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/ep/images/item_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_edit_file.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_edit_file.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_edit_restore.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_edit_restore.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_list.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_list.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_search_t_before.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_search_t_before.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_search_t_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_search_t_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_searcht.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_file_searcht.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_select_lng.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_select_lng.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_dir.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_dir.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_file.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_file.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_insert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_insert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_lngr.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_lngr.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_lngr_grem.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/images/lng_selt_lngr_grem.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)<br><br>
+
+&nbsp;&nbsp;<b>Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<!-- Begin help search index1.html-->
+
+&nbsp;&nbsp;<b>Edit Help Page Index:</b><br>
+<UL>
+<LI><A HREF="#HOW">How Search Works</A></LI>
+<LI><A HREF="#SEARCH_FILE">Searching for a file name</a></LI>
+<LI><A HREF="#SEARCH_DEFINE">Searching for text within a file.</A></LI>
+</UL>
+<H3><A NAME="HOW">How Search Works</H3></a><br>
+&nbsp;&nbsp; You can search one of two ways depending on wich edit screen you are on.
+you can search for file names of test within the Languages define file. Search
+will detect which screen you are on either the a directory/file screen, or a Language Define Edit Screen.
+It will switch the between file and define search logic automaticly for you. <br>
+
+<H3><A NAME="SEARCH_FILE">Where Are the define located</H3></a><br>
+
+&nbsp;&nbsp;1. includes\languages  ~   In this directory all of the base define files reside. a base define file is common to more then one group of output screen.
+<br>&nbsp;&nbsp;2. includes\languages\(Langauge Name) ~ this is where the bulk of the language defines reside
+<br>&nbsp;&nbsp;3. includes\languages\(Langauge Name)\images ~  Unique images the are language dependent. Except for buttons
+<br>&nbsp;&nbsp;4. includes\languages\(Langauge Name)\modules ~ Specific to file that are in the includes/modules directory
+<br>&nbsp;&nbsp;5. includes\languages\(Langauge Name)\modules\order_total ~ Specific to file that are in the includes/modules/order_total directory
+<br>&nbsp;&nbsp;6. includes\languages\(Langauge Name)\modules\payment ~ Specific to file that are in the includes/modules/payment directory
+<br>&nbsp;&nbsp;7. includes\languages\(Langauge Name)\modules\shipping~ Specific to file that are in the includes/modules/shipping directory
+<br>
+
+<br>&nbsp;&nbsp;8. Language file not adressed by language editor.
+<br>&nbsp;&nbsp;includes\modules\payment\paypal\languages\english\ipn.lng.php
+<br>&nbsp;&nbsp;includes\modules\payment\paypal\languages\english.php
+<br>&nbsp;&nbsp;All language file in admin
+<br>
+<H3><A NAME="SEARCH_FILE">Searching for a file name</H3></a><br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to Tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_edit_file.png" border="0" >
+
+<H3><A NAME="SEARCH_DEFINE">Searching for text within a file</H3></a><br>
+While you are in edit mode you can search for Define Display text but not the label.
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Enter the text in search box<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Click the search button<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. This will bring up a list of defines<br>
+
+Below is an example of before and after, this is more usfull for some of the larger define files.<br>
+
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_file_search_t_before.png" border="0" >
+<br>&nbsp;&nbsp; <b>Before  search </b><br>
+
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_file_search_t_results.png" border="0" >
+<br>&nbsp;&nbsp;<b> After  search </b><br>
+<!-- End help searh index1.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<!-- Begin help edit index.html-->
+&nbsp;&nbsp;<b>Search Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_edit_file.png" border="0" >
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Once you have navigated to the correct file to edit you then can edit the language defines.
+The intial edit screen is show above.</P>
+
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+
+<H3><A NAME="Edit">Editing Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Type in the new text<br>
+&nbsp;&nbsp; 2. Click on save next to the input box you just type in<br>
+&nbsp;&nbsp; 3. Double check your changes by viewing them in the cart.<br>
+&nbsp;&nbsp; 4. If they did not work or are incorrect, you can restore the previous text if change again in the editor<br>
+
+&nbsp; Note: you can only sabe changes for one input box at a time.<br>
+<H3><A NAME="RESTORE">Restoring Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Once you have saved the define your changes you can double check that it is correct. <br>
+&nbsp;&nbsp; 2. If it is not then you can click on the restore button to revert back to the previous langauge define.<br>
+
+
+<H3><A NAME="RESTORE">Restoring Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 2. Single qoute with variable : Advanced Search's <br>
+&nbsp;&nbsp; 3. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 4. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 5. Double qoutes: <br>
+
+
+
+<!-- End help edit index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<!-- Begin help index4.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Once you have finished editing a define, click on the save next to the define. This will
+save the edit you made. You will return to the define edit screen so you can check you changes if for some reason it is not
+correct you can click on the restore and this will revert the file back to what it was before the save.
+</P>
+<P>
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Saving a new define.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<!-- End help index4.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/et/index5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/authnet_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/authnet_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/authnet_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<?php
+/*
+  $Id: invoice.php,v 1.2 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"><html <?php echo HTML_PARAMS; ?>>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title>Authorize.net Consolidated CRE Help Screen</title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="admin/includes/general.js"></script>
+</head>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+
+
+     <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading">Authorize.net Consolidated CRE Edition</td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+       <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+         <td class="main">
+
+<div align="center"><h2>Configuration Help Screen</h2></div>
+</td>
+</tr>
+<tr>
+ <td align="center">
+<a href=" https://freecreditcardprocessing.com/applynow/online_application.asp?code=chainreaction"> <h2>Link to Apply for Authorize.net account</h2></a><br>
+(support the CRE project by using our authorize.net partner)
+</td>
+</tr>
+<tr>
+<td>
+<hr align="center" size="4" width="450">
+</td>
+</tr>
+<tr>
+<td>
+User your browser back button to return to the Authorize.net edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Authorize.net testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Authorize.net Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Authorize.net User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Authorize.net Consolidated uses the AIM method of
+connecting to Authorize.net.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Authorize.net gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don't know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Authorize.net Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Authorize.net Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>
+<hr align="center" size="4" width="450">
+  </tr>
+        </td></table>
+          </tr>
+         </td>
+
+   </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/paypal/Help_Config.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/paypal/Help_Config.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/paypal/Help_Config.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: Help_Config.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td>
+  <H3><b> Paypal Setup </h3> </b><br>
+   Please use your browsers back button to return.    
+    </td>
+  </tr>
+  <tr>
+    <td class="pptext">The following is a guide towards configuring your store's PayPal payment module settings:</td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">Enable PayPal Module</b><br>Since you have just done the installation, by default it will say yes.</li><br>
+      <li><b class="ppem380">E-Mail Address</b><br>Enter your Primary PayPal email address here, if you have more than one email address registered with PayPal then you must login your PayPal account to determine which one is your <b>Primary</b> email address.</li><br>
+      <li><b class="ppem380">Business ID</b><br>If you have configured a secondary email address to be your Business ID (email address) in your PayPal profile account, then enter this here, otherwise enter the one used above.</li><br>
+      <li><b class="ppem380">Transaction Currency</b><br>Choose which currencies you want to accept PayPal payments with.</li><br>
+      <li><b class="ppem380">Payment Zone</b><br>If a zone is selected, only enable this payment method for that zone.</li><br>
+      <li><b class="ppem380">Set <b>Pending Notification</b> Order Status</b><br>Set the Pending Notification status of orders made with this payment module to this value, '<b style="color:blue">Pending</b>' is suggested or alternatively the optional order status created in step 4 above.</li><br>
+      <li><b class="ppem380">Set <b>Order</b> Status</b><br>Set the status of orders made with this payment module to this value <b style="color:red">Do not set it to 'default' but specifically choose the status required</b>, '<b style="color:blue">Processing</b>' is suggested.</li><br>
+      <li><b class="ppem380">Set <b>On Hold Order</b> Status</b><br>This order status is used when the Cart Test has failed, eg. the expected payment amount did not match.</li><br>
+      <li><b class="ppem380">Set <b>Canceled Order</b> Status</b><br>Refunded, Reversed, Failed or Denied payments will be set to this order status.</li><br>
+      <li><b class="ppem380">Synchronize Invoice</b><br>Specify whether the osCommerce order number should be used as a <b>unique</b> PayPal invoice number, similiar to PayPal's Send Money feature, this will enable customers to resume an order via their osCommerce account history info page for that order for pending transactions which were not previously completed.</li><br>
+      <li><b class="ppem380">Sort order of display</b><br>Sort order of display. Lowest is displayed first.</li><br>
+      <li><b class="ppem380">Background Color</b><br>Select the background color of PayPal's payment pages, either black or white.</li><br>
+      <li><b class="ppem380">Processing logo</b><br>Specify the image file name to be used in the store's checkout process splash page, must be located in <code>catalog/images</code> directory.</li><br>
+      <li><b class="ppem380">Store logo</b><br>Specify the image file name for PayPal to display on their payment pages pages, must be located in <code>catalog/images</code> directory. If you do not have SSL then leave this field blank.</li><br>
+      <li><b class="ppem380">PayPal Page Style Name</b><br>Specify the name of the page style you have configured in your PayPal account profile.</li><br>
+      <li><b class="ppem380">Include a note with payment</b><br>When a customer arrives at the PayPal payment page you can choose whether or not to show them another note field which will have seperate contents from that of the one provided in your store's checkout process but will be included in PayPal's invoice and receipt.<br>To change the title appearing above this field on the PayPal payment page look in the corresponding catalog langauge file (<code>catalog/includes/langauges/english/modules/payment/paypal.php</code>).</li><br>
+      <li><b class="ppem380">Shopping Cart Method</b><br>Choose which type of PayPal Shopping Cart you want to use, Aggregate simply means the total amount is passed (with a list of the products shown in a single item field), whereas an Itemized Cart will list indivudally all the items the customer has selected in their PayPal invoice.</li><br>
+      <li><b class="ppem380">Enable PayPal Shipping Address</b><br>Allow the customer to choose their own PayPal shipping address. 
+      (See FAQ's for more info)</li><br>
+      <li><b class="ppem380">Digest Key</b><br>Specify a unique digest key, this will then be used similiar to a password while testing via the IPN Test Panel <b>and</b> also the store's PayPal transaction signature digest key.</li><br>
+      <li><b class="ppem380">Test Mode</b><br>This should be off for live environments.<br>You can simulate your own IPNs via the
+      <a href="<?php 
+      //echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>">
+      IPN Test Panel</a>.</li><br>
+      <li><b class="ppem380">Cart Test</b><br>This test verifies that the amount received via PayPal matches to what is expected 
+      (See FAQ's for more info).</li><br>
+      <li><b class="ppem380">Debug Email Notifications</b><br>Choose whether you want to receive debug emails.</li><br>
+      <li><b class="ppem380">Debug Email Notification Address</b><br>Enter a seperate email address where you wish to receive <b>debug</b> emails.</li><br>
+      <li><b class="ppem380">PayPal Domain</b><br>This must be set to <b>paypal.com</b> for live production environments, this setting is to facilate PayPal's sandbox and is not related to the IPN Test Panel or the above Test Mode option.</li><br>
+      <li><b class="ppem380">Return URL behavior</b><br>This determines what method PayPal should use when returning the customer back to the store, leave this set to 1 (GET).</li><br>
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd">
+    </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/paypal/Help_FAQs.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/paypal/Help_FAQs.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/help/payment/paypal/Help_FAQs.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,86 @@
+<?php
+/*
+  $Id: Help_FAQs.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td>
+   <H3><b> Paypal Faq\'s </h3> </b><br>
+   Please use your browsers back button to return.
+ </td>
+  </tr>
+  <tr>
+    <td class="pptext">The following are some frequently asked questions about this payment module:
+    </td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">My shipping costs are different once the customer arrives at the PayPal site.</b></legend><div>In your PayPal account profile in the shipping section, check the box that allows overriding the shipping costs.</li><br>
+      <li><b class="ppem380">Do I need to enable IPN in my PayPal account profile.</b><br>No.</li><br>
+      <li><b class="ppem380">What url should I specify for the IPN feature to be used.</b><br>You don't need to, it will automatically be specified.</li><br>
+      <li><b class="ppem380">Why doesn't the Auto-Return feature work.</b><br>You must enable it first in your PayPal account profile.</li><br>
+      <li><b class="ppem380">What url should I specify for the Auto-Return feature.</b><br>It doesn't matter, this contribution will automatically specify the correct script url location, which is now <code>catalog/checkout_success.php</code></li><br>
+      <li><b class="ppem380">Does this contribution support PayPal Credit Card payments.</b><br>Yes.</li><br>
+      <li><b class="ppem380">Why am I getting so many emails per transaction.</b><br>You get <b>one</b> from PayPal and <b>one</b> osCommerce order confirmation email, and another which is the <b>debug email</b>, either disable <b>debug</b> email notification or specify a sperate email address for <b>debug</b> emails.</li><br>
+      <li><b class="ppem380">Why am I not receiving any IPNs.</b><br>You must ensure that your <b>Primary Email Address</b> and <b>Business ID</b> are configured correctly.<br>Login to your PayPal Account and see what and how many email addresses you are using and which one is the Primary address.<br>Also check your debug emails as it will also specify the Primary Email Address of the intended receiver.</li><br>
+      <li><b class="ppem380">I'm having problems with Multi-Currencies.</b><br>This problem should now be resolved, previously the <b>Cart Test</b> was comparing the currency and amounts of the actual order to what PayPal received as opposed to actually comparing the currency and amounts prior to transfering the customer to PayPal.<br><br><b>However</b>, if you're using the Itemized Shopping Cart then discrepancies may arise due to PayPal's two decimal place calculations, in such an event the order will be placed on hold. Although this type of discrepancy may not affect all orders it does however exist and now adds a future requirement to enable you to finalize the transaction via your store's admin.</li><br>
+      <li><b class="ppem380">I'm having problems verifying the Cart Totals.</b><br>See above.</li><br>
+      <li><b class="ppem380">Why is there no PayPal shipping address details in the IPN info?</b><br>Set Enable PayPal Shipping Address to 'No' if you require a PayPal verified shipping address or set to 'Yes' if you do not.</li><br>
+      <li><b class="ppem380">How can I customize the Checkout redirect page.</b><br>The splash template page shown while transfering the customer to PayPal is:<br><code>catalog/includes/modules/payment/paypal/catalog/checkout_splash.inc.php</code></li><br>
+      <li><b class="ppem380">Where can I find more PayPal logo buttons.</b><br>Login to your PayPal account and click Merchant Tools or Auction Tools.</li><br>
+      <li><b class="ppem380">Where can I find PayPal documentation.</b><br><ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;"><li><a href="https://www.paypal.com/en_US/pdf/integration_guide.pdf">PayPal Integration Manual</a></li></ul></li><br>
+
+      <li><b class="ppem380">How do I use PayPal's Sandbox.</b>
+        <ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;">
+          <li>Register with <a href="https://developer.paypal.com/" target="PPDC">PayPal Developer Central</a></li>
+          <li>Then create <b>two virtual accounts</b> types:<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Personal Account</li><li>Premier or Business Account</li></ul></li>
+          <li>Confirm both accounts (each is just a single click option).</li>
+          <li>Transfer some virtual money into your personal account (Click the add funds link).</li>
+          <li>Emails to both accounts will appear in the section where you initially login into the PayPal Developer Central, no real emails are sent so the email addresses for your virtual accounts should be fictitious.</li>
+          <li>Now in your <a href="<?php 
+          //echo tep_href_link(FILENAME_MODULES,'set=payment&module=paypal&action=edit');
+          
+          ?>" target="_blank">osCommerce::Admin::Modules::Payment::PayPal</a> configuration section<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Enter the virtual business account email address into both the Primary Email Address and Business ID fields</li><li>Set the domain to www.sandbox.paypal.com</li></ul></li>
+          <li>Now checkout as a customer via the store, this account should have a real email address (so that you can receive the osC customer order confirmation email), and when you arrive at the PayPal Sandbox site (look for their logo) then login using the virtual personal account details and finalize the payment process.</li>
+        </ul>
+       <br><p class="ppsmallerrorbold">Note that you must first login via the PayPal Developer Central prior to testing the Sandbox/Checkout process.</p>
+      </li><br>
+
+      <li><b class="ppem380">What's the difference between the IPN Test Panel and using PayPal's Sandbox.</b><br>The <a href="<?php 
+      //echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>" target="itp">IPN Test Panel</a> is an independent osCommerce Contribution feature, for testing and development purposes, which allows you to simmulate your own IPNs without having to interact with PayPal.<br><br><p class="ppsmallerrorbold">All Test IPNs via the IPN Test Panel will be invalid according to PayPal since they're not authentic transactions.</p></li><br>
+      <li><b class="ppem380">Is the IPN Test Panel related to PayPal's Sandbox.</b><br>No, see above.</li><br>
+      <li><b class="ppem380">What's the purpose of the digest key.</b><br>Currently the digest key serves two purposes, it authenticates and allows you to use the <a href="<?php // echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>" target="itp">IPN Test Panel</a>, secondly, untill such time that PayPal provides a secure method of associating an IPN specifically to a particular order, it serves as a unique transaction signature identifier.</li><br>
+      <li><b class="ppem380">Should I change the digest key default value.</b><br>Yes, but remember what it is if uninstalling and reinstalling this contrib payment module in the admin since there might be existing pending orders which will require it in order to associate with to their corresponding IPN(s).</li><br>
+      <li><b class="ppem380">How are IPNs deleted.</b><br>Currently, an IPN appearing the admin section is deleted automatically when deleting it's corresponding order.</li><br>
+      <li><b class="ppem380">How can a customer resume their order.</b><br>Currently, if the customer abandons the checkout process at the PayPal site, e.g for some reason they did not actually pay at that time, then they can log into their osCommerce account and click the confirm order button when viewing the details of that particular order in their account_history_info.<br><br>This feature is only available when <b>synchronizing invoices</b> with PayPal.<br><br>This means that if you ever reset the osCommerce <code>orders</code> database table then you must also update it's auto-increment value to be greater than the last known <code>order_id</code>.</li><br>
+      <li><b class="ppem380">I'm getting errors after installing the contribution.</b><br>First, go through the installation edits and remove any blank spaces at the beginning of the line(s), some text editors will insert hidden characters which is a side effect of copying and pasting from HTML documentation.<br>Make sure that the alterations have been performed as well as running the paypal_ipn.sql script.</li><br>
+
+      <li><b class="ppem380">What type of PayPal account do I need.</b><br>You will need either a Premier or Merchant Business Account. <a href="https://www.paypal.com/refer/pal=PS2X9Q773CKG4" target="_blank">Click&nbsp;here&nbsp;to&nbsp;register&nbsp;for&nbsp;an&nbsp;account</a> if you do not already have one.</li><br>
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd"><form name="contents" action="<?php
+    //echo tep_href_link(FILENAME_PAYPAL,'','NONSSL'); 
+    ?>"><input type="hidden" name="action" value="help" /><input type="submit" value="Contents" class="ppbuttonsmall" />
+    </form></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_activate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_activate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_add_article.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_add_article.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_add_field.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_add_field.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_add_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_add_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_files.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_files.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_group.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_group.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_groups.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_groups.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_home.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_home.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_member.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_member.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_members.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_members.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_permission.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_permission.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_remove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_admin_remove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_billing.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_billing.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_backup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_backup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_blank.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_blank.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_browse.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_browse.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_cancel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_cancel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_cancel_edit_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_cancel_edit_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_check_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_check_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_check_links.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_check_links.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_confirm_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_confirm_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_convert.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_convert.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_copy.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_copy.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_copy_to.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_copy_to.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_create.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_create.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_create_customer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_create_customer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_create_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_create_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_decrypt.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_decrypt.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_details.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_details.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_attributes.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_attributes.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_footer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_footer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_header.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_header.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_infoboxes.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_infoboxes.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_key.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_key.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_lang_define.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_lang_define.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_mainpage.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_mainpage.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_status.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_status.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_values.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_edit_values.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_email.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_encrypt.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_encrypt.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_file_manager.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_file_manager.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_free_signup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_free_signup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_insert.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_insert.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_insert_into_db.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_insert_into_db.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_invoice.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_invoice.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_lock.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_lock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_module_install.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_module_install.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_module_remove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_module_remove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_move.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_move.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_article.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_article.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_author.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_author.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_banner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_banner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_category.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_category.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_country.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_country.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_currency.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_currency.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_event.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_event.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_faq.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_faq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_file.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_file.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_folder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_language.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_language.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_news_item.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_news_item.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_newsletter.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_newsletter.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_package.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_package.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_sale.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_sale.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_tax_class.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_tax_class.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_tax_rate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_tax_rate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_topic.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_topic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_zone.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_new_zone.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_next.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_next.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_orders.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_orders.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_packingslip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_packingslip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_preview.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_preview.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_preview_upload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_preview_upload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_print.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_print.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_print_page.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_print_page.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_process.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_process.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_quick_save.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_quick_save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_release.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_release.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_remove_fields.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_remove_fields.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_removeccinfo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_removeccinfo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_report.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_report.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_reset.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_reset.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_restore.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_restore.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_return.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_return.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_review_approve.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_review_approve.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_review_disapprove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_review_disapprove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_run.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_run.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save_edit_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save_edit_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save_finish.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save_finish.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save_reload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_save_reload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_select.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_select.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_send_mail.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_send_mail.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_split_file.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_split_file.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_spllit_files.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_spllit_files.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_start_file_creation.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_start_file_creation.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_template_admin.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_template_admin.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_unlock.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_unlock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_box_positions.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_box_positions.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_currencies.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_currencies.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_fields.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_fields.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_status.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_update_status.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_upload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_upload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_verify.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/button_verify.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/ic_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/ic_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/ic_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/ic_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/review_approve.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/review_approve.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/review_disapprove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/review_disapprove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/sync.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/english/images/buttons/sync.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/english/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+<?php
+
+define('TEXT_CRELOADED','CRE Loaded.com');
+define('TEXT_OSC','osCommerce.com');
+
+
+//common
+define('TEXT_MANAGE','Manage');
+define('TEXT_ADD','Add');
+define('TEXT_VIEW','View');
+define('TEXT_INSTALLED','Installed');
+define('TEXT_ENABLED','Enabled');
+
+// Store box
+define('BLOCK_TITLE_STORE_INFO','Store Info');
+$storename="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=1&cID=1&action=edit")."'>Store Name</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_NAME',$storename);
+$storestatus="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=16&cID=153")."'>Store Status</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_STATUS',$storestatus);
+$storeemail="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=1&cID=4")."'>Store Email</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_EMAIL',$storeemail); 
+$defaulttemplate="<a class='adminLink' href='".tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,"cID=7")."'>Default Template</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_TEMPLATE',$defaulttemplate); 
+$primarylang="<a class='adminLink' href='".tep_href_link(FILENAME_LANGUAGES)."'>Primary Language</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_LANGUAGE',$primarylang); 
+$primarycurr="<a class='adminLink' href='".tep_href_link(FILENAME_CURRENCIES)."'>Primary Currency</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_CURRENCY',$primarycurr);
+define('BLOCK_CONTENT_STORE_INFO_STORE_TAX_RATE','Tax Rate');
+define('BLOCK_CONTENT_STORE_INFO_STORE_TAX_ZONE','Tax Zone');
+define('BLOCK_CONTENT_STORE_INFO_STORE_BACKUPS','Database Backups'); 
+// Store tips
+define('BLOCK_HELP_STORE_INFO','<ul><li><strong>Store Info</strong><br>Store info which you have in database.<br> You can visit Configuration >> My Store to edit / modify the same.</li></ul>');
+define('BLOCK_HELP_STORE_STATUS','<ul><li><font color=#009900><strong>Active</strong></font><br>Store is open for business.</li><li><font color=#FF0000><strong>Maintanace</strong></font><br>Down for maintananace</li></ul>');
+define('BLOCK_HELP_STORE_BACKUP','Create Fresh Backup Now!');
+
+// Order Box
+define('BLOCK_TITLE_ORDERS','Orders');
+define('BLOCK_HELP_ORDERS','<ul><li><strong>Total Orders</strong><br> This is total count of Order records available in database, irrespective of status.</li><li><strong>Orders Pending</strong><br>Total count of orders, whose status is <font color=red>Pending</font></li><li><strong>Processing<br></strong>Total count of orders, whose status is <font color=red>Processing</font></li>  </ul>');
+
+// reports
+define('BLOCK_TITLE_REPORTS','Reports');    
+define('BLOCK_CONTENT_REPORTS_PRODUCTS_VIEWED','Products Viewed');
+define('BLOCK_CONTENT_REPORTS_PRODUCTS_PURCHASED','Products Purchased');
+define('BLOCK_CONTENT_REPORTS_CUSTOMER_ORDERS_TOTAL','Customer Orders-Total');
+define('BLOCK_CONTENT_REPORTS_MONTHLY_SALES_TAX','Monthly Sales/Tax');
+define('BLOCK_HELP_REPORTS','<ul><li><strong>Reports</strong><br> Click on the links below to view the reports.</li>  </ul>');
+
+// Products
+define('BLOCK_TITLE_PRODUCTS','Products');
+define('BLOCK_CONTENT_PRODUCTS_CATEGORIES','Total Number of Categories');
+define('BLOCK_CONTENT_PRODUCTS_TOTAL_PRODUCTS','Total Number of Products');
+define('BLOCK_CONTENT_PRODUCTS_ACTIVE','Active Products');
+define('BLOCK_CONTENT_PRODUCTS_NOSTOCK','Out of Stock');
+define('BLOCK_HELP_PRODUCTS','<ul><li><strong>Total Number of Products</strong><br>This is total count of products in database irrespective of categories and status.</li><li><strong>Active Products</strong><br>This is total count of live products which are online for sales. This record didcuscts products deactiveated by store admin and out of stocks.</li><li><strong>Out Of Stock<br></strong>This is total count of products, which are not in stock.</li></ul>');
+
+//reviews
+define('BLOCK_TITLE_REVIEWS','Reviews');
+define('BLOCK_CONTENT_REVIEWS_TOTAL_REVIEWS','Total Number of Reviews');
+define('BLOCK_CONTENT_REVIEWS_WAITING_APPROVAL','Waiting Approval');
+define('BLOCK_HELP_REVIEWS','<ul><li><strong>Total Number Reviews</strong><br>This is total count of product records available in database, irrespective of categories, products and status.</li><li><strong>Waiting Approval</strong><br>  Total count of review waiting for admin approval.</li></ul>');
+
+//Customers
+define('BLOCK_TITLE_CUSTOMERS','Customers');
+define('BLOCK_CONTENT_CUSTOMERS_TOTAL','Total Customers');
+define('BLOCK_CONTENT_CUSTOMERS_SUBSCRIBED','Subscribed');
+define('BLOCK_HELP_CUSTOMERS','<ul>  <li><strong>Total Customers</strong><br>This is total count of customers who signedup with store.</li><li><strong>Subscribed</strong><br>Total count of customers who subscribed for Newsletter and or Product Notifications.</li></ul>');
+
+// Affiliates
+define('BLOCK_TITLE_AFFILIATE','Affiliates');
+define('BLOCK_CONTENT_AFFILIATE_TOTAL','Total Affiliates');
+define('BLOCK_CONTENT_AFFILIATE_SALES','Affiliate Sales');
+define('BLOCK_CONTENT_AFFILIATE_COMMISSION','Total Affiliate Commission');
+define('BLOCK_HELP_AFFILIATE','<ul><li><strong>Affiliates</strong><br>Details of Affiliates. Use <strong>Manage</strong> link to manage affiliates.</li></ul>');
+
+//Links
+define('BLOCK_TITLE_LINKS','Links');
+define('BLOCK_CONTENT_LINKS_TOTAL','Total Links');
+define('BLOCK_CONTENT_LINKS_CATEGORIES','Link Categories');
+define('BLOCK_CONTENT_LINKS_WAITING','Waiting Approval');
+
+//Shipping Module
+define('BLOCK_TITLE_SHIPPING_MODULES','Shipping Modules');
+define('BLOCK_CONTENT_SHIPPING_MODULES_INSTALLED','Modules Installed');
+define('BLOCK_CONTENT_SHIPPING_MODULES_ENABLED','Modules Enabled');
+define('BLOCK_HELP_SHIPPING_MODULES','<ul><li><strong>Shipping Modules</strong><br>Number of Shipping modules Installed and you are currently using. Use <strong>Manage</strong> link to manage shipping modules.</li></ul>');
+
+// Payment Modules
+define('BLOCK_TITLE_PAYMENT_MODULES','Payment Modules');
+define('BLOCK_CONTENT_PAYMENT_MODULES_INSTALLED','Modules Installed');
+define('BLOCK_CONTENT_PAYMENT_MODULES_ENABLED','Modules Enabled');
+define('BLOCK_HELP_PAYMENT_MODULES','<ul><li><strong>Payment Modules</strong><br>Number of Payment modules Installed and you are currently using. Use <strong>Manage</strong> link to manage payment modules.</li></ul>');
+
+//Taxes
+define('BLOCK_TITLE_TAX_RATES','Tax Rates');
+define('BLOCK_HELP_TAXES','<ul><li><strong>Taxes</strong><br>Number of Zones Installed</li></ul>');
+
+// CRE Forge
+define('BLOCK_TITLE_CRE_FORGE',"CRE Forge");
+define('BLOCK_CONTENT_CRE_FORGE_BUG_TRACKER',"Bug Tracker");
+define('BLOCK_CONTENT_CRE_FORGE_FEATURE_REQUESTS',"Feature Requests");
+define('BLOCK_CONTENT_CRE_FORGE_SVN_REPOSITORY',"SVN Repository");
+define('BLOCK_CONTENT_CRE_FORGE_SUPPORT_REQUEST',"Support Request");
+define('BLOCK_CONTENT_CRE_FORGE_FILE_RELEASES',"File Releases");
+define('BLOCK_TITLE_CRE_NEWS',"CRE Loaded News");
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/index_new.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/index_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/index_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+define('TEXT_ADMIN_HOME','Admin Home');
+define('TEXT_VIEW_CATALOG','View Catalog');
+define('TEXT_FORUMS','CRE Forums');
+define('TEXT_PURCHASE_SUPPORT','Purchase CRE Support');
+define('TEXT_HOSTING','Certified CRE Hosting');
+define('TEXT_WELCOME','Welcome <strong>' . STORE_ADMIN_NAME . '</strong> to <strong>' . STORE_NAME . '</strong> Administration!');
+define('TEXT_ADMIN_LANG','Admin Language:');
+define('TEXT_CHANGE_PASWORD','Change Password');
+define('TEXT_LOGOUT','Logout');
+define('TEXT_CHECK_UPDATES','Check for Updates');
+define('TEXT_GET_PRO','Get Pro Version');
+
+//common
+define('TEXT_MANAGE','Manage');
+define('TEXT_ADD','Add');
+define('TEXT_VIEW','View');
+define('TEXT_INSTALLED','Installed');
+define('TEXT_ENABLED','Enabled');
+
+// Store box
+define('TEXT_STORE_INFO','Store Info');
+define('TEXT_STORE_NAME','Store Name');
+define('TEXT_STORE_STATUS','Store Status');
+define('TEXT_STORE_EMAIL','Store Email'); 
+define('TEXT_STORE_TEMPLATE','Default Template'); 
+define('TEXT_STORE_LANGUAGE','Primary Language'); 
+define('TEXT_STORE_CURRENCY','Primary Currency');
+define('TEXT_STORE_TAX_RATE','Tax Rate');
+define('TEXT_STORE_TAX_ZONE','Tax Zone');
+define('TEXT_STORE_BACKUPS','Database Backups'); 
+// Store tips
+define('TEXT_HELP_STORE_INFO','<ul><li><strong>Store Info</strong><br>Store info which you have in database.<br> You can visit Configuration >> My Store to edit / modify the same.</li></ul>');
+define('TEXT_HELP_STORE_STATUS','<ul><li><font color=#009900><strong>Active</strong></font><br>Store is open for business.</li><li><font color=#FF0000><strong>Maintanace</strong></font><br>Down for maintananace</li></ul>');
+define('TEXT_HELP_STORE_BACKUP','Create Fresh Backup Now!');
+
+// Order Box
+define('TEXT_ORDERS','Orders');
+define('TEXT_HELP_ORDERS','<ul><li><strong>Total Orders</strong><br> This is total count of Order records available in database, irrespective of status.</li><li><strong>Orders Pending</strong><br>Total count of orders, whose status is <font color=red>Pending</font></li><li><strong>Processing<br></strong>Total count of orders, whose status is <font color=red>Processing</font></li>  </ul>');
+define('TEXT_PENDING','Pending');
+define('TEXT_PROCESSING','Processing');
+define('TEXT_DELIVERED','Delivered');
+define('TEXT_PAYPAL_PROCESSING','Paypal Processing');
+define('TEXT_ALLOW_DOWNLOAD','Allow Download');
+define('TEXT_ON_HOLD','On Hold');
+define('TEXT_CANCELED','Canceled');
+define('TEXT_AWAITING_CC_PROCESSING','Awaiting CC Processing');
+
+
+// reports
+define('TEXT_REPORTS','Reports');
+define('TEXT_REPORTS_PRODUCTS_VIEWED','Products Viewed');
+define('TEXT_REPORTS_PURCHASED','Products Purchased');
+define('TEXT_ORDERS_ORDER_TOTAL','Customer Orders-Total');
+define('TEXT_ORDERS_SALES_TAX','Monthly Sales/Tax');
+define('TEXT_HELP_REPORTS','<ul><li><strong>Reports</strong><br> Click on the links below to view the reports.</li>  </ul>');
+
+// Products
+define('TEXT_PRODUCTS','Products');
+define('TEXT_PRODUCTS_CATEGORIES','Total Number of Categories');
+define('TEXT_PRODUCTS_TOTAL_PRODUCTS','Total Number of Products');
+define('TEXT_PRODUCTS_ACTIVE','Active Products');
+define('TEXT_PRODUCTS_NOSTOCK','Out of Stock');
+define('TEXT_HELP_PRODUCTS','<ul><li><strong>Total Number of Products</strong><br>This is total count of products in database irrespective of categories and status.</li><li><strong>Active Products</strong><br>This is total count of live products which are online for sales. This record didcuscts products deactiveated by store admin and out of stocks.</li><li><strong>Out Of Stock<br></strong>This is total count of products, which are not in stock.</li></ul>');
+
+//reviews
+define('TEXT_REVIEWS','Reviews');
+define('TEXT_REVIEWS_TOTAL','Total Number of Reviews');
+define('TEXT_REVIEWS_WAITING','Waiting Approval');
+define('TEXT_HELP_REVIEWS','<ul><li><strong>Total Number Reviews</strong><br>This is total count of product records available in database, irrespective of categories, products and status.</li><li><strong>Waiting Approval</strong><br>  Total count of review waiting for admin approval.</li></ul>');
+
+//Customers
+define('TEXT_CUSTOMERS','Customers');
+define('TEXT_CUSTOMERS_TOTAL','Total Customers');
+define('TEXT_CUSTOMERS_SUBSCRIBED','Subscribed');
+define('TEXT_HELP_CUSTOMERS','<ul>  <li><strong>Total Customers</strong><br>This is total count of customers who signedup with store.</li><li><strong>Subscribed</strong><br>Total count of customers who subscribed for Newsletter and or Product Notifications.</li></ul>');
+
+// Affiliates
+define('TEXT_AFFILIATE','Affiliates');
+define('TEXT_AFFILIATE_TOTAL','Total Affiliates');
+define('TEXT_AFFILIATE_SALES','Affiliate Sales');
+define('TEXT_AFFILIATE_COMMISSION','Total Affiliate Commission');
+define('TEXT_HELP_AFFILIATE','<ul><li><strong>Affiliates</strong><br>Details of Affiliates. Use <strong>Manage</strong> link to manage affiliates.</li></ul>');
+
+//Links
+define('TEXT_LINKS','Links');
+define('TEXT_LINKS_TOTAL','Total Links');
+define('TEXT_LINKS_CATEGORIES','Link Categories');
+define('TEXT_LINKS_WAITING','Waiting Approval');
+
+//Shipping Module
+define('TEXT_SHIPPING_MODULES','Shipping Modules');
+define('TEXT_HELP_SHIPPING_MODULES','<ul><li><strong>Shipping Modules</strong><br>Number of Shipping modules Installed and you are currently using. Use <strong>Manage</strong> link to manage shipping modules.</li></ul>');
+
+// Payment Modules
+define('TEXT_PAYMENT_MODULES','Payment Modules');
+define('TEXT_HELP_PAYMENT_MODULES','<ul><li><strong>Payment Modules</strong><br>Number of Payment modules Installed and you are currently using. Use <strong>Manage</strong> link to manage payment modules.</li></ul>');
+
+// CRE Forge
+define('BOX_HEADING_CRE_FORGE',"CRE Forge");
+define('BOX_CRE_FORGE_BUG_TRACKER',"Bug Tracker");
+define('BOX_CRE_FORGE_FEATURE_REQUESTS',"Feature Requests");
+define('BOX_CRE_FORGE_SVN_REPOSITORY',"SVN Repository");
+define('BOX_CRE_FORGE_SUPPORT_REQUEST',"Support Request");
+define('BOX_CRE_FORGE_FILE_RELEASES',"File Releases");
+define('BOX_HEADING_CRE_NEWS',"CRE Loaded News");
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/infobox_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/infobox_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/infobox_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Infobox Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Infobox Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADER_EXPLAIN', 'These settings effect all templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Infobox configuration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Infobox configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/infobox_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/infobox_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/infobox_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,85 @@
+<?php
+/*
+  $Id: infobox_configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  
+  Copyright &copy; 2003-2006
+  
+  Last Modified By : $Author$
+  Last Modified On : $LastChangeDate$
+  Latest Revision :  $Revision: 2661 $
+  
+*/
+
+
+define('HEADING_TITLE', 'Infobox Display, Create and Update');
+define('TABLE_HEADING_INFOBOX_FILE_NAME', 'Title');
+define('TABLE_HEADING_ACTIVE', 'Activate Box?');
+define('TABLE_HEADING_KEY', 'Box Heading Define');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_COLUMN', 'Set Column');
+define('TABLE_HEADING_SORT_ORDER', 'Position');
+define('TABLE_HEADING_TEMPLATE', 'Box Template');
+define('TABLE_HEADING_FONT_COLOR', 'Font Color');
+define('TABLE_HEADING_BOX_DIRECTORY', 'Location of boxes for this template: ');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Create a new Infobox');
+define('TEXT_INFO_INSERT_INTRO', 'An example for the<b> what\'s_new.php</b> Infobox is selected');
+define('TEXT_INFO_DELETE_INTRO', '<P STYLE="color: red; font-weight: bold;">Confirm OK to delete the Infobox');
+define('TEXT_INFO_HEADING_DELETE_INFOBOX', 'Delete Infobox?');
+define('TEXT_INFO_HEADING_UPDATE_INFOBOX', 'Update the Infobox');
+
+define('IMAGE_INFOBOX_STATUS_UP', 'UP');
+define('IMAGE_ICON_STATUS_UP_LIGHT', 'Move Up');
+define('IMAGE_INFOBOX_STATUS_down', 'Down');
+define('IMAGE_ICON_STATUS_DOWN_LIGHT', 'Move Down');
+
+define('IMAGE_INFOBOX_STATUS_GREEN', 'Left');
+define('IMAGE_INFOBOX_STATUS_GREEN_LIGHT', 'Set Left');
+define('IMAGE_INFOBOX_STATUS_RED', 'Right');
+define('IMAGE_INFOBOX_STATUS_RED_LIGHT', 'Set Right');
+
+
+define('BOX_HEADING_BOXES', 'Boxes Admin');
+
+define('TEXT_HEADING_SET_ACTIVE', 'Set this box Active? ');
+define('TEXT_HEADING_DEFINE_KEY', '  Define key ');
+define('TEXT_HEADING_WHAT_POS', 'Column Position? ');
+define('TEXT_HEADING_WHICH_TEMPLATE', 'Which box Template? ');
+define('TEXT_HEADING_HEADING', 'The infoBox heading ');
+define('TEXT_HEADING_WHICH_COL', 'Which column? ');
+define('TEXT_HEADING_FILENAME', 'Filename ');
+define('TEXT_HEADING_FONT_COLOR', 'Header Font Color ');
+
+define('TEXT_NOTE_REQUIRED', '* Denotes required field');
+
+define('JS_BOX_HEADING', '* The \'Define Key\' must be completed. Example: BOX_HEADING_WHATS_NEW');
+define('JS_INFO_BOX_HEADING', '* The \'Box Heading\' must be completed.');
+define('JS_BOX_LOCATION', '* You must select a column to display your Infobox');
+define('JS_INFO_BOX_FILENAME', '* You must select a Filename for your Infobox');
+define('JS_BOX_COLOR', '* Please select a color for the font color.');
+
+
+define('TEXT_INFO_MESSAGE_COUNT_1', '<br>There are currently <br>');
+define('TEXT_INFO_MESSAGE_COUNT_2', ' active boxes in the left column and <br>');
+define('TEXT_INFO_MESSAGE_COUNT_3', ' active boxes in the right column');
+//error messages
+define('infobox_error1', 'This template does not have any infoboxes to install. Please put the infoboxes that you want to install in this template\'s boxes directory');
+define('infobox_error2', 'WARNING: No boxes selected in your LEFT column');
+define('infobox_error3', 'WARNING: No boxes selected in your RIGHT column');
+
+define('INFOBOX_ACTIVE_BOXES', ' active boxes in the right column');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/information.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+
+  define('ACTION_INFORMATION', 'Action');
+  define('ACTIVATION_ID_INFORMATION', 'Activation of the information ID=');
+  define('ADD_INFORMATION', 'Add new information');
+  define('ADD_QUEUE_INFORMATION', 'Add information to queue');
+  define('ALERT_INFORMATION', 'Empty: You currently have no files!');
+  define('ANSWER_INFORMATION', 'Answer');
+  define('CONFIRM_INFORMATION', 'Confirm');
+  define('DEACTIVATION_ID_INFORMATION', 'Deactivation of the information ID=');
+  define('DELETE_INFORMATION', 'Delete');
+  define('DELETE_CONFITMATION_ID_INFORMATION', 'Delete Confirmation information ID=');
+  define('DELETE_ID_INFORMATION', 'Delete the information ID=');
+  define('DELETED_ID_INFORMATION', 'Deleted the information ID=');
+  define('DESCRIPTION_INFORMATION', 'Description');
+  define('EDIT_ID_INFORMATION', 'Edit the information ID=');
+  define('EDIT_INFORMATION', 'Edit');
+  define('ERROR_20_INFORMATION', 'You have not defined a valid value for option <b>Queue</b>. You can only define a numeric value');
+  define('ERROR_80_INFORMATION', 'You did not fill all <b>necessary fields</b>');
+  define('INFORMATION_ID_ACTIVE', 'This information is ACTIVE');
+  define('INFORMATION_ID_DEACTIVE', 'This information is NOT ACTIVE');
+  define('INFORMATION_ACTIVE', 'Active');
+  define('INFORMATION_DEACTIVE', 'Inactive');
+  define('ID_INFORMATION', 'ID');
+  define('TITLE_INFORMATION', 'Title');
+  define('QUEUE_INFORMATION', 'Queue');
+  define('QUEUE_INFORMATION_LIST', 'Queue List: ');
+  define('MANAGER_INFORMATION', 'Information Manager');
+  define('NO_INFORMATION', 'No');
+  define('PUBLIC_INFORMATION', 'Public');
+  define('PAGE_PREVIEW', 'Preview');
+  define('SORT_BY', 'Information Page - Sort by');
+  define('STATUS_INFORMATION', 'Status:');
+  define('SUCCEED_INFORMATION', ' Successful');
+  define('TITLE', 'Information System');
+  define('VIEW_INFORMATION', 'Information View');
+  define('VISIBLE_INFORMATION', 'Visible');
+  define('VISIBLE_INFORMATION_DO', '( To Do visible )');
+  define('UPDATE_ID_INFORMATION', 'Update of Information Page No : ');
+  define('WARNING_INFORMATION', 'Warning');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: invoice.php,v 1.3 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('TITLE_PRINT_ORDER', 'Print Order #: ');
+
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_TAX', 'Tax');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Price (ex)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Price (inc)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ex)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inc)');
+
+define('ENTRY_SOLD_TO', 'SOLD TO:');
+define('ENTRY_SHIP_TO', 'SHIP TO:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Tax:');
+define('ENTRY_SHIPPING', 'Shipping:');
+define('ENTRY_TOTAL', 'Total:');
+
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+define('TITLE_PRINT_INVOICE', 'Print Invoice');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/languages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: languages.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Languages');
+
+define('TABLE_HEADING_LANGUAGE_NAME', 'Language');
+define('TABLE_HEADING_LANGUAGE_CODE', 'Code');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_LANGUAGE_NAME', 'Name:');
+define('TEXT_INFO_LANGUAGE_CODE', 'Code:');
+define('TEXT_INFO_LANGUAGE_IMAGE', 'Image:');
+define('TEXT_INFO_LANGUAGE_DIRECTORY', 'Directory:');
+define('TEXT_INFO_LANGUAGE_SORT_ORDER', 'Sort Order:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new language with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this language?');
+define('TEXT_INFO_HEADING_NEW_LANGUAGE', 'New Language');
+define('TEXT_INFO_HEADING_EDIT_LANGUAGE', 'Edit Language');
+define('TEXT_INFO_HEADING_DELETE_LANGUAGE', 'Delete Language');
+
+define('ERROR_REMOVE_DEFAULT_LANGUAGE', 'Error: The default language can not be removed. Please set another language as default, and try again.');
+?>
+<?php 
+define("DEFAULT_LANGUAGE_IS","Default Language is");
+define("IMAGE_SYNC","Sync");
+define("INSERT_QUERIES","Insert Queries");
+define("UPDATE_QUERIES","Update Queries");
+define("TABLE_SYNCHRONIZATION","Table Synchronization");
+define("THERE_ARE_NO_MISSING_RECORD_FOR_ANY_LANGUAGES","There are no missing record for any languages");
+define("TABLE_NAMES","Table Names");
+define("MISSING_LANGUAGE","Missing language");
+define("MISSING_LANGUAGES_FOR_DISTINCT_ID","Missing Languages for Distinct id");
+define("TOTAL_NO_OF_RECORDS_IMPACTED","Total No of records Impacted");
+define("DISTINCT_ID","Distinct Id");
+define("MISSING_LANGUAGE","Missing Language");
+define("INSERT_RECORDS_ANALYSIS","Insert Records Analysis");
+define("UPDATE_RECORDS_ANALYSIS","Update Records Analysis");
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/link_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/link_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/link_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: link_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Link Categories');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_NEW_LINK_CATEGORY', 'New Link Category');
+define('TEXT_INFO_HEADING_EDIT_LINK_CATEGORY', 'Edit Link Category');
+define('TEXT_INFO_HEADING_DELETE_LINK_CATEGORY', 'Delete Link Category');
+
+define('TEXT_INFO_LINK_CATEGORY_COUNT', 'Links:');
+define('TEXT_INFO_LINK_CATEGORY_STATUS', 'Status:');
+define('TEXT_INFO_LINK_CATEGORY_DESCRIPTION', 'Description:');
+define('TEXT_INFO_LINK_CATEGORY_SORT_ORDER', 'Sort Order:');
+define('TEXT_DATE_LINK_CATEGORY_CREATED', 'Created:');
+define('TEXT_DATE_LINK_CATEGORY_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_NEW_LINK_CATEGORIES_INTRO', 'Please fill out the following information for the new link category');
+define('TEXT_EDIT_LINK_CATEGORIES_INTRO', 'Please make any necessary changes');
+define('TEXT_DELETE_LINK_CATEGORIES_INTRO', 'Are you sure you want to delete this link category?');
+
+define('TEXT_LINK_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_LINK_CATEGORIES_DESCRIPTION', 'Category Description:');
+define('TEXT_LINK_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_LINK_CATEGORIES_SORT_ORDER', 'Sort Order:');
+define('TEXT_LINK_CATEGORIES_STATUS', 'Status:');
+define('TEXT_LINK_CATEGORIES_STATUS_ENABLE', 'Enable');
+define('TEXT_LINK_CATEGORIES_STATUS_DISABLE', 'Disable');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>WARNING:</b> There are %s links still linked to this category!');
+
+define('TEXT_DISPLAY_NUMBER_OF_LINK_CATEGORIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> link categories)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/links.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+<?php
+/*
+  $Id: links.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Links');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_TITLE', 'Title');
+define('TABLE_HEADING_URL', 'URL');
+define('TABLE_HEADING_CLICKS', 'Clicks');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_DELETE_LINK', 'Delete Link');
+define('TEXT_INFO_HEADING_CHECK_LINK', 'Check Link');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this link?');
+
+define('TEXT_INFO_LINK_CHECK_RESULT', 'Link Check Result:');
+define('TEXT_INFO_LINK_CHECK_FOUND', 'Found');
+define('TEXT_INFO_LINK_CHECK_NOT_FOUND', 'Not Found');
+define('TEXT_INFO_LINK_CHECK_ERROR', 'Error Reading URL');
+
+
+define('TEXT_INFO_LINK_STATUS', 'Status:');
+define('TEXT_INFO_LINK_CATEGORY', 'Category:');
+define('TEXT_INFO_LINK_CONTACT_NAME', 'Contact Name:');
+define('TEXT_INFO_LINK_CONTACT_EMAIL', 'Contact Email:');
+define('TEXT_INFO_LINK_CLICK_COUNT', 'Clicks:');
+define('TEXT_INFO_LINK_DESCRIPTION', 'Description:');
+define('TEXT_DATE_LINK_CREATED', 'Link Submitted:');
+define('TEXT_DATE_LINK_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Link Status Update');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Dear %s,' . "\n\n" . 'The status of your link at ' . STORE_NAME . ' has been updated.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
+
+// VJ todo - move to common language file
+define('CATEGORY_WEBSITE', 'Website Details');
+define('CATEGORY_RECIPROCAL', 'Reciprocal Page Details');
+define('CATEGORY_OPTIONS', 'Options');
+
+define('ENTRY_LINKS_TITLE', 'Site Title:');
+define('ENTRY_LINKS_TITLE_ERROR', 'Link title must contain a minimum of ' . ENTRY_LINKS_TITLE_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_URL', 'URL:');
+define('ENTRY_LINKS_URL_ERROR', 'URL must contain a minimum of ' . ENTRY_LINKS_URL_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_CATEGORY', 'Category:');
+define('ENTRY_LINKS_DESCRIPTION', 'Description:');
+define('ENTRY_LINKS_DESCRIPTION_ERROR', 'Description must contain a minimum of ' . ENTRY_LINKS_DESCRIPTION_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_IMAGE', 'Image URL:');
+define('ENTRY_LINKS_CONTACT_NAME', 'Full Name:');
+define('ENTRY_LINKS_CONTACT_NAME_ERROR', 'Your Full Name must contain a minimum of ' . ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_RECIPROCAL_URL', 'Reciprocal Page:');
+define('ENTRY_LINKS_RECIPROCAL_URL_ERROR', 'Reciprocal page must contain a minimum of ' . ENTRY_LINKS_URL_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_STATUS', 'Status:');
+define('ENTRY_LINKS_NOTIFY_CONTACT', 'Notify Contact:');
+define('ENTRY_LINKS_RATING', 'Rating:');
+define('ENTRY_LINKS_RATING_ERROR', 'Rating should not be empty.');
+
+define('TEXT_DISPLAY_NUMBER_OF_LINKS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> links)');
+
+define('IMAGE_NEW_LINK', 'New Link');
+define('IMAGE_CHECK_LINK', 'Check Link');
+
+
+define('ALL', 'All');
+define('LINKS_MANAGER_CHECKED_LINKS', 'Links Manager - Checked Links');
+define('ASC', 'Asc');
+define('DESC', 'Desc');
+define('START_AT', 'Start at:');
+define('HOW_MANY', 'How many?');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/links_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/links_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/links_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: links_contact.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Send Email To Link Partners');
+
+define('TEXT_LINK_PARTNER', 'Link Partner:');
+define('TEXT_SUBJECT', 'Subject:');
+define('TEXT_FROM', 'From:');
+define('TEXT_MESSAGE', 'Message:');
+define('TEXT_SELECT_LINK_PARTNER', 'Select Link Partner');
+define('TEXT_ALL_LINK_PARTNERS', 'All Link Partners');
+
+define('NOTICE_EMAIL_SENT_TO', 'Notice: Email sent to: %s');
+define('ERROR_NO_LINK_PARTNER_SELECTED', 'Error: No link partner has been selected.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/login.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: login.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('NAVBAR_TITLE', 'Login');
+  define('HEADING_TITLE', 'Welcome, Please Sign In');
+
+define('HEADING_RETURNING_ADMIN', 'Login Panel:');
+define('HEADING_PASSWORD_FORGOTTEN', 'Password forgotten:');
+define('TEXT_RETURNING_ADMIN', 'Staff only!');
+define('ENTRY_EMAIL_ADDRESS', 'Email Address:');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_FIRSTNAME', 'First Name:');
+define('IMAGE_BUTTON_LOGIN', 'Submit');
+
+define('TEXT_PASSWORD_FORGOTTEN', 'Password forgotten?');
+
+define('TEXT_LOGIN_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> Wrong username or password!');
+define('TEXT_FORGOTTEN_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> First name or email do not match!');
+define('TEXT_FORGOTTEN_FAIL', '<font color="#ff0000"><b>You have tried more than 3 times. For security reasons, please contact the Webmaster to get a new password.</b></font>');
+define('TEXT_FORGOTTEN_SUCCESS', '<b>The new password has been sent to your Email address. Please check your Email and click Back to login again.</b>');
+
+define('ADMIN_EMAIL_SUBJECT', 'New Password');
+define('ADMIN_EMAIL_TEXT', 'Hi %s,' . "\n\n" . 'You can access the admin panel with the following password. Once you accessed the admin, please change your password immediately!' . "\n\n" . 'Website: %s' . "\n" . 'Username: %s' . "\n" . 'Password: %s' . "\n\n" . 'Thanks!' . "\n" . '%s' . "\n\n" . 'This is a system automated response, please do not reply, as your answer would be unread!');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/logoff.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Log Off');
+define('NAVBAR_TITLE', 'Log Off');
+define('TEXT_MAIN', 'You have been successfully logged-off from the <b>Admin</b> area. It is safe to leave the computer now. Click back to relogin');
+define('TEXT_RELOGIN', 're-Login');
+define('TEXT_FOOTER', 'E-Commerce Engine Copyright &copy; 2003 <a href="http://oscommerce.com" target="_blank">osCommerce</a> <br>
+      Supercharged by <a href="http://creloaded.com" target="_blank">CRE Loaded</a>');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: mail.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Send Email To Customers');
+
+define('TEXT_CUSTOMER', 'Customer:');
+define('TEXT_SUBJECT', 'Subject:');
+define('TEXT_FROM', 'From:');
+define('TEXT_MESSAGE', 'Message:');
+define('TEXT_SELECT_CUSTOMER', 'Select Customer');
+define('TEXT_ALL_CUSTOMERS', 'All Customers');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'To All Newsletter Subscribers');
+
+define('NOTICE_EMAIL_SENT_TO', 'Notice: Email sent to: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Error: No customer has been selected.');
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">The Back Button has been DISABLED while HTML WYSIWG Editor is turned ON.</b></font> WHY? - Because if you click the back button to edit your HTML email, the PHP (php.ini - "Magic Quotes = On") will automatically add "\\\\\\\" backslashes everywhere Double Quotes " appear (HTML uses them in Links, Images and More) and this distorts the HTML, the pictures will dissapear once you submit the email again. If you turn OFF WYSIWYG Editor in Admin, the HTML Ability of osCommerce is also turned OFF and the back button will re-appear. A fix for this HTML and PHP issue would be nice if someone knows a solution.<br><br><b>If you really need to Preview your emails before sending them, use the Preview Button located on the WYSIWYG Editor.<br><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML is currently Disabled!</b></font><br><br>If you want to send HTML email, Enable WYSIWYG Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// Contact US Email Subject DMG
+define('TEXT_EMAIL_SUBJECTS', '* select a subject *');
+define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME. ': ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Manufacturers');
+
+define('TABLE_HEADING_MANUFACTURERS', 'Manufacturers');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_HEADING_NEW_MANUFACTURER', 'New Manufacturer');
+define('TEXT_HEADING_EDIT_MANUFACTURER', 'Edit Manufacturer');
+define('TEXT_HEADING_DELETE_MANUFACTURER', 'Delete Manufacturer');
+
+define('TEXT_MANUFACTURERS', 'Manufacturers:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_NEW_INTRO', 'Please fill out the following information for the new manufacturer');
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+
+define('TEXT_MANUFACTURERS_NAME', 'Manufacturers Name:');
+define('TEXT_MANUFACTURERS_IMAGE', 'Manufacturers Image:');
+define('TEXT_MANUFACTURERS_URL', 'Manufacturers URL:');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this manufacturer?');
+define('TEXT_DELETE_IMAGE', 'Delete manufacturers image?');
+define('TEXT_DELETE_PRODUCTS', 'Delete products from this manufacturer? (including product reviews, products on special, upcoming products)');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this manufacturer!');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/members.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: members.php,v 1.2 2003/09/24 13:57:08 anon Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Member approval');
+
+define('TABLE_HEADING_LASTNAME', 'Lastname');
+define('TABLE_HEADING_FIRSTNAME', 'Firstname');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('HEADING_TITLE_SEARCH', 'Search');
+
+define('EMAIL_CONTACT', 'For help with any of our online services, please email us at: ' . STORE_OWNER_EMAIL_ADDRESS);
+
+define('EMAIL_TEXT_CONFIRM', 'Your application to become a wholesale customer of (your store) has been approved. You can now access pricing on the (your store) site.<br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to drop ship direct to your customer.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n");
+
+define('EMAIL_WARNING', '<b>Note:</b> This email address was used to request access to our wholesale website. If you did not signup to be a customer, please send an email to ' . STORE_OWNER_EMAIL_ADDRESS . "\n\n");
+
+define('EMAIL_TEXT_SUBJECT', 'Account Approved');
+
+define('EMAIL_SEPARATOR', '----------------------------------------------');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_newsletter.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+define('TEXT_COUNT_AFFILIATES', 'Affiliates receiving newsletter: %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+/*
+  $Id: newsletter.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_COUNT_CUSTOMERS', 'Customers receiving newsletter: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/product_notification.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/product_notification.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/modules/newsletters/product_notification.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: product_notification.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_COUNT_CUSTOMERS', 'Customers receiving newsletter: %s');
+define('TEXT_PRODUCTS', 'Products');
+define('TEXT_SELECTED_PRODUCTS', 'Selected Products');
+
+define('JS_PLEASE_SELECT_PRODUCTS', 'Please select some products.');
+
+define('BUTTON_GLOBAL', 'Global');
+define('BUTTON_SELECT', '>>>');
+define('BUTTON_UNSELECT', '<<<');
+define('BUTTON_SUBMIT', 'Submit');
+define('BUTTON_CANCEL', 'Cancel');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/modules.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/modules.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/modules.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  Id: modules.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  
+  Copyright &copy; 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modified on : $Date$
+  Latest Revision : $Revision: 365 $
+  
+  
+*/
+
+define('HEADING_TITLE_MODULES_PAYMENT', 'Payment Modules');
+define('HEADING_TITLE_MODULES_SHIPPING', 'Shipping Modules');
+define('HEADING_TITLE_MODULES_ORDER_TOTAL', 'Order Total Modules');
+define('HEADING_TITLE_MODULES_CHECKOUT_SUCCESS','Checkout Success Modules');
+
+define('TABLE_HEADING_MODULES', 'Modules');
+define('TABLE_HEADING_SORT_ORDER', 'Sort Order');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_MODULE_DIRECTORY', 'Module Directory:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Navigation Menu');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_CATEGORIES_LINKS', 'Categories / Links');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Products Image:</b><small><br>Main Image used in <br><u>catalog & description</u> pages.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Small Image:</b><br><small> Image on<br><u>products list</u> pages.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Image:</b><br><small> Large Image on<br><u>pop-up window</u> page.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Store Product/s Sharing this Image =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Remove</b> this Image from this Product?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>Delete</b> this Image from the Server (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Remove');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'Delete');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Small Images.</b> If a "SM" image is used<br>(Alone) NO Pop-up window link is created, the "SM"<br> will be placed directly under the products<br>description. If used in conjunction with an <br>"XL" image on the right, a Pop-up Window Link<br> is created and the "XL" image will be<br>shown in a Pop-up window.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Large Images.</b> Used for the Pop-up image<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Additional Images - These will appear below product description if used.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Image 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Image 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Image 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Image 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Image 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Image 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Image 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Image 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Image 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Image 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Image 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Image 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DELETE_IMAGE', 'Delete Image');
+
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Category heading title:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Category heading Description:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Category Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Category Description Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Category Key Word Meta Tag :');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method :');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Product Keywords :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Edit Product Attributes');
+
+// Added for Navigation Menu DMG
+
+define('TEXT_LINKS','Links');
+define('TEXT_HEADING_EDIT_CATEGORY','Edit Navigation Category');
+define('TEXT_HEADING_NEW_LINK','Create New Navigation Link');
+define('TEXT_LINK_NAME','Link Text : ');
+define('TEXT_LINK_PAGE','Link Target : ');
+define('TEXT_STATUS','Link Status : ');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: newsletters.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Newsletter Manager');
+
+define('TABLE_HEADING_NEWSLETTERS', 'Newsletters');
+define('TABLE_HEADING_SIZE', 'Size');
+define('TABLE_HEADING_MODULE', 'Module');
+define('TABLE_HEADING_SENT', 'Sent');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_SELECT_CUSTOMER', 'Select Customer');
+define('TEXT_ALL_CUSTOMERS', 'All Customers');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'To All Newsletter Subscribers');
+
+define('TEXT_NEWSLETTER_MODULE', 'Module:');
+define('TEXT_NEWSLETTER_TITLE', 'Newsletter Title:');
+define('TEXT_NEWSLETTER_CONTENT', 'Content:');
+
+define('TEXT_NEWSLETTER_DATE_ADDED', 'Date Added:');
+define('TEXT_NEWSLETTER_DATE_SENT', 'Date Sent:');
+
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this newsletter?');
+
+define('TEXT_PLEASE_WAIT', 'Please wait .. sending Emails ..<br><br>Please do not interrupt this process!');
+define('TEXT_FINISHED_SENDING_EMAILS', 'Finished sending Emails!');
+
+define('ERROR_NEWSLETTER_TITLE', 'Error: Newsletter title required');
+define('ERROR_NEWSLETTER_MODULE', 'Error: Newsletter module required');
+define('ERROR_REMOVE_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before deleting it.');
+define('ERROR_EDIT_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before editing it.');
+define('ERROR_SEND_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before sending it.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/orderlist.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/orderlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/orderlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: orderlist.php,v 1.25 2003/06/20 00:28:44 vj Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Orderlist');
+define('HEADING_TITLE_STATUS', 'Status:');
+
+define('TABLE_HEADING_ORDER_ID', 'Order ID');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS_NAME', 'Product Name');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_NOTES', 'Notes');
+define('TABLE_HEADING_CHK', 'Chk');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+
+define('TEXT_DOWNLOAD', 'Download');
+define('TEXT_PRINT', 'Print');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,125 @@
+<?php
+/*
+  $Id: orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('TABLE_HEADING_EDIT_ORDERS', 'To modify the order');
+
+define('HEADING_TITLE', 'Orders');
+define('HEADING_IS_TITLE', 'IS Order');
+define('HEADING_IS_RECEIPT', 'IS Receipt');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDERID', 'Order ID');
+define('TABLE_HEADING_IS_ORDERNUM', 'IS Order');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_TAX', 'Tax');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price'); 
+
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Price (ex)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Price (inc)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ex)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inc)');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Customer Notified');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+
+//begin PayPal_Shopping_Cart_IPN
+define('TABLE_HEADING_PAYMENT_STATUS', 'Payment Status');
+//end PayPal_Shopping_Cart_IPN
+define('ENTRY_SUBURB', 'Suburb :');
+define('ENTRY_CITY', 'City :');
+define('ENTRY_CUSTOMER', 'Customer:');
+define('ENTRY_STATE', 'State :');
+define('ENTRY_SOLD_TO', 'SOLD TO:');
+define('ENTRY_TELEPHONE', 'Enter Telephone :');
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_DELIVERY_TO', 'Delivery To:');
+define('ENTRY_SHIP_TO', 'SHIP TO:');
+define('ENTRY_SHIPPING_ADDRESS', 'Shipping Address:');
+define('ENTRY_BILLING_ADDRESS', 'Billing Address:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Credit Card Type:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Credit Card Expires:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV Code:');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Tax:');
+define('ENTRY_SHIPPING', 'Shipping:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'Date Last Updated:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notify Customer:');
+define('ENTRY_NOTIFY_COMMENTS', 'Append Comments:');
+define('ENTRY_PRINTABLE', 'Print Invoice');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+define('TEXT_INFO_ABANDONDED', 'Abandoned');
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> CCV Code:  Not stored - due to processing regulations. Enable CCV email in module settings.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+define('TEXT_NO_ORDER_HISTORY', 'No Order History Available');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Order Update');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error : This order does not exists');
+define('SUCCESS_ORDER_UPDATED', 'Success : This order has been updated');
+define('WARNING_ORDER_NOT_UPDATED', 'Attention : No change was made to this order.');
+// begin replacement section for Email Subject contribution
+define('EMAIL_TEXT_SUBJECT_1', ' ' . STORE_NAME. ' Order Updated');
+define('EMAIL_TEXT_SUBJECT_2', ':  ');
+
+
+define('ORDER', 'Order #');
+define('ORDER_DATE_TIME', 'Order Date & Time');
+
+// end replacement section for Email Subject contribution
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/orders_status.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/orders_status.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/orders_status.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: orders_status.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Orders Status');
+
+define('TABLE_HEADING_ORDERS_STATUS', 'Orders Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_ORDERS_STATUS_NAME', 'Orders Status:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new orders status with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order status?');
+define('TEXT_INFO_HEADING_NEW_ORDERS_STATUS', 'New Orders Status');
+define('TEXT_INFO_HEADING_EDIT_ORDERS_STATUS', 'Edit Orders Status');
+define('TEXT_INFO_HEADING_DELETE_ORDERS_STATUS', 'Delete Orders Status');
+
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: The default order status can not be removed. Please set another order status as default, and try again.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This order status is currently used in orders.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This order status is currently used in the order status history.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/packaging.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/packaging.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/packaging.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+	define('CONFIRM_DELETE', 'Are you sure you want to remove this package?');
+	define('DELETE_PACKAGE', 'Delete package');
+	define('CREATE_NEW_PACKAGE', 'Create new package');
+	define('HEADING_ACTION', 'Action');
+	define('HEADING_ID', 'Package ID');
+	define('HEADING_NAME', 'Name');
+	define('HEADING_NAME_TEXT', 'Enter a name, such as a carton part number to uniquely identify this packaging part');
+	define('HEADING_DESCRIPTION', 'Description');
+	define('HEADING_DESCRIPTION_TEXT', 'A description of the package (e.g. Medium box with velcro strip, 36" UPS Tube, Cardboard Widget Holder, etc.)');
+	define('HEADING_LENGTH', 'Length');
+	define('HEADING_LENGTH_TEXT', 'Enter the package length in the system\'s unit of measurement.');
+	define('HEADING_WIDTH', 'Width');
+	define('HEADING_WIDTH_TEXT', 'Enter the package width in the system\'s unit of measurement.');
+	define('HEADING_HEIGHT', 'Height');
+	define('HEADING_HEIGHT_TEXT', 'Enter the package height in the system\'s unit of measurement.');
+	define('HEADING_EMPTY_WEIGHT', 'Empty Weight');
+	define('HEADING_EMPTY_WEIGHT_TEXT', 'The empty weight of the package, including packing material, tape, metal bands, etc.');
+	define('HEADING_MAX_WEIGHT', 'Maximum Weight');
+	define('HEADING_MAX_WEIGHT_TEXT', 'This package\'s maximum weight capacity in your system\'s unit of weight. Leave blank to disable maximum weight restriction.');
+	define('HEADING_COST', 'Cost');
+	define('HEADING_COST_TEXT', 'The relative cost or preference to use this package. Lower numbered packages will be used before higher numbered packages (e.g. Given two containers of the same dimensions, use a cardboard container before one of metal.)');
+	define('HEADING_DELETE', 'delete');
+	define('HEADING_TITLE', 'Packaging');
+	define('HEADING_INFO', 'Package Details');
+	define('ICON_INFO', 'Info');
+	define('INFO_CHANGE_PASSWORD', 'Change password');
+	define('INFO_USERNAME', 'Username:');
+	define('MIN_LENGTH_NOT_MET', 'The package length must be set to a nonzero positive real number.');
+	define('MIN_WIDTH_NOT_MET', 'The package width must be set to a nonzero positive real number.');
+	define('MIN_HEIGHT_NOT_MET', 'The package height must be set to a nonzero positive real number.');
+	define('MIN_EMPTY_WEIGHT_NOT_MET', 'The empty package weight must be set to zero or a positive real number.');
+	define('MIN_MAX_WEIGHT_NOT_MET', 'The maximum package weight must be set to zero (disabled) or a positive real number.');
+
+	define('NEW_PACKAGE', 'Create new package');
+	define('NO_PACKAGES_DEFINED', "No packages have been defined.");
+	define('UPDATE_PACKAGE', 'Update package');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/packingslip.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/packingslip.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/packingslip.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: packingslip.php,v 1.3 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+
+define('ENTRY_SOLD_TO', 'SOLD TO:');
+define('ENTRY_SHIP_TO', 'SHIP TO:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/pages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: pages.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Pages');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_TITLE', 'Title');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_PAGES_HEADING_DELETE_PAGE', 'Delete Page');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this page?');
+
+define('TEXT_PAGES_CATEGORY', 'Category:');
+define('TEXT_DATE_PAGES_CREATED', 'Date Created:');
+define('TEXT_DATE_PAGES_LAST_MODIFIED', 'Date Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('ENTRY_TITLE', 'Title:');
+define('ENTRY_CATEGORY', 'Category:');
+define('ENTRY_BLURB', 'Blurb:');
+define('ENTRY_BODY', 'Body:');
+define('ENTRY_IMAGE', 'Image:');
+define('ENTRY_META_TITLE', 'Meta Title:');
+define('ENTRY_META_KEYWORDS', 'Meta Keywords:');
+define('ENTRY_META_DESCRIPTION', 'Meta Description:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_SORT_ORDER', 'Sort Order:');
+define('ENTRY_AUTHOR', 'Author:');
+
+define('TEXT_PAGES_ACTIVE', 'Active');
+define('TEXT_PAGES_INACTIVE', 'Inactive');
+
+define('TEXT_NO_CATEGORY', 'No Category');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> pages)');
+
+define('IMAGE_NEW_PAGE', 'New Page');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/pages_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/pages_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/pages_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: pages_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Page Categories');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_PAGES_HEADING_NEW_PAGES_CATEGORY', 'New Category');
+define('TEXT_PAGES_HEADING_EDIT_PAGES_CATEGORY', 'Edit Category');
+define('TEXT_PAGES_HEADING_DELETE_PAGES_CATEGORY', 'Delete Category');
+
+define('TEXT_PAGES_CATEGORY_COUNT', 'Pages:');
+define('TEXT_PAGES_CATEGORY_STATUS', 'Status:');
+define('TEXT_PAGES_CATEGORY_DESCRIPTION', 'Description:');
+define('TEXT_PAGES_CATEGORY_SORT_ORDER', 'Sort Order:');
+define('TEXT_DATE_PAGES_CATEGORY_CREATED', 'Created:');
+define('TEXT_DATE_PAGES_CATEGORY_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_NEW_PAGES_CATEGORIES_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_EDIT_PAGES_CATEGORIES_INTRO', 'Please make any necessary changes');
+define('TEXT_DELETE_PAGES_CATEGORIES_INTRO', 'Are you sure you want to delete this category?');
+
+define('TEXT_PAGES_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_PAGES_CATEGORIES_DESCRIPTION', 'Category Description:');
+define('TEXT_PAGES_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_PAGES_CATEGORIES_SORT_ORDER', 'Sort Order:');
+define('TEXT_PAGES_CATEGORIES_STATUS', 'Status:');
+define('TEXT_PAGES_CATEGORIES_STATUS_ENABLE', 'Enable');
+define('TEXT_PAGES_CATEGORIES_STATUS_DISABLE', 'Disable');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>WARNING:</b> There are %s pages still linked to this category!');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAGES_CATEGORIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> categories)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/popup_data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/popup_data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/popup_data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: popup_data_help.php,v 1.1 $
+  
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Data Input/output Help');
+define('TEXT_INFO_HEADING_NEW_DATA', 'Data Input/output Help');
+
+define('TEXT_INFO_FROOGLE_HEADING_SET_CATEGORIES', 'Categories Help');
+define('TEXT_INFO_FROOGLE_HEADING_CONFIGURE', 'Configure Help');
+define('TEXT_INFO_FROOGLE_HEADING_PRE_FEED', 'Pre Feed Help');
+define('TEXT_INFO_FROOGLE_HEADING_RUN', 'Run Feed Help');
+
+define('TEXT_FROOGLE_SET_CATEGORIES_HELP', 'Run this step the first time you do a Froogle feed. <br> After you have run this the first time do this step only if you have added or changed categories.  This step is very process intense and time consuming for large sites. It will build all of your catagory paths for you.');
+define('TEXT_FROOGLE_CONFIGURE_HELP', 'You can build multiple configuration for the froogle feed. You must have at least one froogle configuration');
+define('TEXT_FROOGLE_PRE_FEED_HELP', 'In this step you will assemble the data into a text file that will be submitted to Froogle. If the process takes more then 1 minute you have a large store or there is a problem.');
+define('TEXT_FROOGLE_RUN_HELP', 'This is the last step. It will submit the feed directly to froogle if you have entered the correct FTP information in the configuration. You must wait 30 minute between submissions');
+
+define('TEXT_INFO_FROOGLE_FEED_NAME', 'Name of Feed Help');
+define('TEXT_INFO_FROOGLE_FEED_DISC', 'Data Feed Discription Help');
+define('TEXT_INFO_FROOGLE_FEED_FILE_TYPE', 'Data Feed File Type Help');
+define('TEXT_INFO_FROOGLE_FEED_TYPE', 'Feed Type Help');
+define('TEXT_INFO_FROOGLE_FEED', '<b>Froogle FTP information</b>');
+define('TEXT_INFO_FROOGLE_FEED_FEED_SERVICE', 'Feed Service Help');
+define('TEXT_INFO_FROOGLE_FEED_STATUS', 'Status Help');
+define('TEXT_INFO_FROOGLE_FEED_FILE', 'File name Help');
+define('TEXT_INFO_FROOGLE_FEED_IMAGE', 'Image URL Help');
+define('TEXT_INFO_FROOGLE_FEED_PRODUCT', 'Product URL Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_SERVER', 'Froogle FTP Server Name Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_USER', 'Froogle FTP User Name Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_PASSWORD', 'Froogle FTP Password Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_DIRECTORY', 'Froogle FTP Directory Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR', 'Use store Currency Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR_USE', 'Other currency Help');
+define('TEXT_INFO_FROOGLE_FEED_LANG', 'Use store languge Help');
+define('TEXT_INFO_FROOGLE_FEED_LANG_USE', 'Other languge Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR_CON', 'Convert Currency Help');
+define('TEXT_INFO_FROOGLE_FEED_TAX', 'Tax Class ID Help');
+
+
+define('TEXT_FROOGLE_FEED_NAME_HELP', 'Enter a unique name for this frogle feed.  You will use this name later in the process to identify this feed configuration..');
+define('TEXT_FROOGLE_FEED_DISC_HELP', 'Enter a short discription to identify this feed configuration. You can also add a few notes here to help discribe this feed');
+define('TEXT_FROOGLE_FEED_FILE_TYPE_HELP', 'Select the type of feed from the drop down. Use product for your normal product listing, Businees is for changing business information. ');
+define('TEXT_FROOGLE_FEED_TYPE_HELP', 'Use basic for a basic feed and advance for advance feed. <br> Note: not all of the advance feed items have been installed.');
+define('TEXT_FROOGLE_FEED_HELP', '<b>Froogle FTP information</b>');
+define('TEXT_FROOGLE_FEED_FEED_SERVICE_HELP', 'Select which feed this configuration is for. Only Froogle feed is installed. ');
+define('TEXT_FROOGLE_FEED_STATUS_HELP', 'Active or Inactive. Inactive configurations will not be available in the data feed page');
+define('TEXT_FROOGLE_FEED_FILE_HELP', 'Type in the file name of the file you want to store your feed in. Its should be unique and not duplicate in other feeds');
+define('TEXT_FROOGLE_FEED_IMAGE_HELP', 'Type in the patch to your product images, it should start from the images directory. <br> Example: http://mysite.com/images/categories/t_4647.jpg would be  categories/ ');
+define('TEXT_FROOGLE_FEED_PRODUCT_HELP', 'This is not used');
+define('TEXT_FROOGLE_FEED_FTP_SERVER_HELP', 'Name of the feed server. For froogle feed leave blank and hedwig.google.com will be used');
+define('TEXT_FROOGLE_FEED_FTP_USER_HELP', 'Enter the FTP user name you entered when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_FTP_PASSWORD_HELP', 'Enter the FTP user password you entered when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_FTP_DIRECTORY_HELP', 'Enter the FTP directory that you were assigned when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_CUR_HELP', 'False: Use the store default currency. If you click on this radio button you will use the default store currency. ');
+define('TEXT_FROOGLE_FEED_CUR_USE_HELP', 'If you checked True in the above line enter the alternete currency code here. It must be a currency code that the service knows.');
+define('TEXT_FROOGLE_FEED_LANG_HELP', 'False: Use store default language indicates that you want to use the store default language.');
+define('TEXT_FROOGLE_FEED_LANG_USE_HELP', 'If you entered true into the above line, Use the drop down box to choose a different language code.');
+define('TEXT_FROOGLE_FEED_CUR_CON_HELP', 'Convert to store currency when the visiter visits your store. Use this is you have multiple currencies in your store.');
+define('TEXT_FROOGLE_FEED_TAX_HELP', 'Enter the tax class ID number from the store or set to zero (0) for no tax caculation');
+
+
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/popup_ep_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/popup_ep_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/popup_ep_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+/*
+  $Id: popup_ep_help.php,v 1.1 $
+  
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Easy Populate Help');
+define('TEXT_INFO_HEADING_NEW_DATA', 'Easy Populate Help');
+
+define('TEXT_HEAD_HELP_EP_FILE_UPLOAD', 'File Up Load Help');
+define('TEXT_HELP_EP_FILE_UPLOAD', 'This allow you to upload the edited EPA file so it can be inputed in to your database.
+                                    There is a limit to the size of file you can upload. Usually this limit is 2mb. This is because of 
+                                    how PHP is usually installed. If this is a problem then try to limit the files size by using the
+                                    Limit number of products to Download options to make your file smaller. 
+                                    If the number of records in the file is more then 300 use the Upload and Split.');
+
+define('TEXT_HEAD_HELP_EP_FILE_UPLOAD_SPLIT', 'File Up Load and Split Help');
+define('TEXT_HELP_EP_FILE_UPLOAD_SPLIT', 'This allow you to upload the edited EPA file and split itinto smaller parts so it can be inputed into your databse.
+                                 As with the regular upload there is a limit on the file size of 2mb. Once you have Uploaded and Split
+                                 the EPA file. Use the " Import Data from file in temp/ " to insert each file into the database. The number or records you set
+                                 in the epconfigure will limit the records in the spilt files. This is done so the program will not time out.');
+
+define('TEXT_HEAD_HELP_EP_FILE_SPLIT', ' Split a EP File on the server');
+define('TEXT_HELP_EP_FILE_SPLIT', 'This allow you to spilt the edited EPA file it into smaller parts, after it has been uploaded to the server, so it can be inputed into your databse.
+                                 Once you have "Split a EP File on the server"
+                                 the EPA file. Use the " Import Data from file in temp/ " to insert each file into the database. The number or records you set
+                                 in the admin/epconfigure.php will limit the records in the spilt files. The current limit is 1,000 records but EPA can handle well over 2,000 records, this should take 3 to 4 minutes to insert. This is done so the program will not time out.');
+
+
+define('TEXT_HEAD_HELP_EP_FILE_INSERT', 'File Insert a File Help');
+define('TEXT_HELP_EP_FILE_INSERT', 'Select a file in the drop down box. This is a list the files that have been uploaded or split in the directory
+                                    You can choosen to store your EPA file on line. The number of records in each split is set in 
+                                    the ep configuration');
+
+define('TEXT_HEAD_HELP_EP_FILE_EXPORT', 'Export a file to edit Help');
+define('TEXT_HELP_EP_FILE_EXPORT', 'In this section you can create a export file to be edited in a spread sheet program. If the export file or resulting
+                                    edited file is over 2mb in size you can use the export controls to limit the the size by limiting the data you export.');
+
+define('TEXT_HEAD_HELP_EP_SELECT_METHOD', 'Select meathod to use for download Help');
+define('TEXT_HELP_EP_SELECT_METHOD', 'Here you can select one of two meathods for downloading your export file. "Download" method
+                                      will create a file to be saved it directly to your local computer. "Save to temp file on server"
+                                      will save the file to the temp directory you set in the ep configure. Later you can use a FTP program to
+                                      download the file');
+
+define('TEXT_HEAD_HELP_EP_SELECT_DOWN', 'Select feild groups to export Help');
+define('TEXT_HELP_EP_SELECT_DOWN', 'In this drop down is listed the pre_defined groups of feild that can be downloaded. Please see the
+                                    documentation for which feilds are in which groups.');
+
+define('TEXT_HEAD_HELP_EP_SELECT_SORT', 'Select sort order for export Help');
+define('TEXT_HELP_EP_SELECT_SORT', 'You can select the order your export rows apears in. This is used to group the rows in your export
+                                    file so they can be found easily. ');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_ROWS', 'Limit rows in your Export file Help');
+define('TEXT_HELP_EP_LIMIT_ROWS', 'This group of settings can be used to limit the size of your export file. This is done
+                                    if your import file is to large or you need to target certain record to be edited.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_CATS', 'Limit rows in your Export file by Categories Help');
+define('TEXT_HELP_EP_LIMIT_CATS', 'This will limit the contents of the export file to a specifice Category. When set to "Top" all
+                                  manufactures will be in the export file. When set to a specific category all sub categories will be included.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_MAN', 'Limit rows in your Export file by Manufacture Help');
+define('TEXT_HELP_EP_LIMIT_MAN', 'This will limit the contents of the export file to a specifice manufacture. When set to "Manufactures" all
+                                  manufacture swill be in the export file.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_PRODUCT', 'Limit rows in your Export file by Product_id Help');
+define('TEXT_HELP_EP_LIMIT_PRODUCT', 'This will limit the contents of the export file to a range of product_id\'s. ');
+
+define('TEXT_HELP_EP_LIMIT_PRODUCT1', '   1. If no product_id\'s are enter all of the product are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT2', '   2. If the begin product_id and no end product_id is entered. Products from the first product id to the end are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT3', '   3. If no beginning product_id\'s aand only and ending product_ID. From the first id to ending the products are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT4', '   4. If the begin product_id and ending product_id is enter then this range of products are in the export file');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/popup_infobox_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/popup_infobox_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/popup_infobox_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: popup_infobox_help.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Infobox Help');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Infobox Help');
+define('TEXT_INFOBOX_HELP_FILENAME', 'For adding new info boxes: Use the drop down box to select the file.<br> For editing install side boxes: This must represent the name of the box file you have put in your <u>catalog/includes/boxes</u> folder.<br><br> It must be lowercase, but can have spaces instead of using the underscore (_)<br><br>For example:<br>Your new Infobox is named <b>new_box.php</b>, you would type in here "<b> new_box.php</b>".<br>');
+define('TEXT_INFOBOX_HELP_HEADING', 'This is, what will be displayed above the Infobox in your catalog. Make sure you have an entry for each language, do not leave any of the Header input boxes blank.<br><div align="center"><img border="0" src="images/help1.gif"><br></div>');
+define('TEXT_INFOBOX_HELP_DEFINE', 'An example of this would be: <b>BOX_HEADING_WHATS_NEW</b>.<br> This is then used with the main logic of your store as this: <b> define(\'BOX_HEADING_WHATS_NEW\', \'What\'s New?\');</b><br><br> If you open the file <u>catalog/includes/languages/english.php</u> you can see plenty of examples, the ones that contain BOX_HEADING are no longer needed, as they are now stored within the database and defined in the files <b>column_left.php</b> and <b>column_right.php</b>.<br>But there is no need to delete them!');
+define('TEXT_INFOBOX_HELP_COLUMN', 'Select either <b>left</b> or <b>right</b><br> for the Infobox to be displayed in the left or right column.<br><br>By default it set to <b>left</b>');
+define('TEXT_INFOBOX_HELP_POSITION', 'Enter any number you like in here. The higher the number, the lower down the selected column the Infobox will appear.<br><br> If you enter the same number for more than one Infobox, they are displayed alphabetically first.<br><br>If you do not enter any number, then the box will also be displayed alphabetical first.');
+define('TEXT_INFOBOX_HELP_ACTIVE', 'Either select <b>yes</b> or <b>no</b> to display the Infobox (yes) or not (no).<br><br>By default it is set to <b>yes</b>');
+define('TEXT_INFOBOX_HELP_TEMPLATE', 'This must represent the class name for the template box class used for this side box. The default class is called infobox and is entered here. If you have a special class in the box.tpl.php you place it here<br><br>For example:<br> If you have a special box to change the header back ground color and it is named blue_box. You would enter that into the input box.');
+define('TEXT_INFOBOX_HELP_COLOR', 'You can use the pop_up color chart to select the color  for the font used in info box headers, <br> Just click on the color and the color code will apear in the text box..');
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/product_extra_fields.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/product_extra_fields.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/product_extra_fields.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: product_extra_fields.php,v 2.0 2004/11/09 15:07:21 ChBu Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Product Extra Fields');
+define('SUBHEADING_TITLE', 'Add a new field');
+
+define('TABLE_HEADING_FIELDS', 'Field Name');
+define('TABLE_HEADING_ORDER', 'Sort Order');
+define('TABLE_HEADING_LANGUAGE', 'Language');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('IMAGE_ADD_FIELD', 'Add new field');
+define('IMAGE_UPDATE_FIELDS', 'Update fields');
+define('IMAGE_REMOVE_FIELDS', 'Remove selected fields');
+
+define ('TEXT_ALL_LANGUAGES', 'All');

Added: trunk/direct.openmoko.com/admin/includes/languages/english/product_list_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/product_list_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/product_list_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Product List Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Product List Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADER_EXPLAIN', 'These settings effect all templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Product List configuration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Product List configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/products_attributes.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/products_attributes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/products_attributes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: products_attributes.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_OPT', 'Product Options');
+define('HEADING_TITLE_VAL', 'Option Values');
+define('HEADING_TITLE_ATRIB', 'Products Attributes');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_PRODUCT', 'Product Name');
+define('TABLE_HEADING_OPT_NAME', 'Option Name');
+define('TABLE_HEADING_OPT_LANGUAGE', 'Language');
+define('TABLE_HEADING_OPT_TYPE', 'Option Type'); //CLR 031203 add option type column
+define('TABLE_HEADING_OPT_VALUE', 'Option Value');
+define('TABLE_HEADING_OPT_PRICE', 'Value Price');
+define('TABLE_HEADING_OPT_PRICE_PREFIX', 'Prefix (+/-)');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_DOWNLOAD', 'Downloadable products:');
+define('TABLE_HEADING_OPTION_COMMENTS', 'Comments');
+define('TABLE_HEADING_OPT_SIZE', 'Size');
+define('TABLE_TEXT_FILENAME', 'Filename:');
+define('TABLE_TEXT_MAX_DAYS', 'Expiry days:');
+define('TABLE_TEXT_MAX_COUNT', 'Maximum download count:');
+
+define('MAX_ROW_LISTS_OPTIONS', 10);
+
+define('TEXT_WARNING_OF_DELETE', 'This option has products and values linked to it - it is not safe to delete it.');
+define('TEXT_OK_TO_DELETE', 'This option has no products and values linked to it - it is safe to delete it.');
+define('TEXT_OPTION_ID', 'Option ID');
+define('TEXT_OPTION_NAME', 'Option Name');
+define('TEXT_OPTION_SORTORDER', 'Sort Order');
+
+define('TEXT_OPTION_SELECTION', 'Select a Option');
+
+define('JAVASCRIPT_TEXT_OPTION_TYPE_TEXT', 'Textual Option');
+
+
+define('SORT_ORDER', 'Sort Order');
+define('PRICE', 'Price');
+define('MISSING', '*** Missing');
+define('GOOD_FILE', 'Good File');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/products_expected.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/products_expected.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/products_expected.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: products_expected.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Products Expected');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_DATE_EXPECTED', 'Date Expected:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/products_multi.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/products_multi.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/products_multi.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+/*
+  $Id: products_multi.php, v 2.0
+
+  autor: sr, 2003-07-31 / sr at ibis-project.de
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Multiple Products Manager');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_CATEGORIES_CHOOSE', 'Choose');
+define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Categories / Products');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('DEL_DELETE', 'delete product');
+define('DEL_CHOOSE_DELETE_ART', 'How to delete?');
+define('DEL_THIS_CAT', 'only in this category');
+define('DEL_COMPLETE', 'delete the complete product');
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_ATTENTION_DANGER', '<br><br><span class="dataTableContentRedAlert">!!! Attention !!! please read !!!</span><br><br><span class="dataTableContentRed">This tool alters the tables "products_to_categories" (and in case of \'delete the complete product\' even "products" and "products_description" among others; cf. function \'tep_remove_product\') - so a backup of these tables before each use of the tool is highly recommended, because:<br><br>This tool deletes, moves or copies all via checkbox selected products without any interim step or warning, that means immediately after clicking on the go-button.</span><br><br><span class="dataTableContentRedAlert">Please take care:</span><ul><li>Pay very great attention when using <strong>\'delete the complete product\'</strong>. This function deletes all selected products immediately, without interim step or warning, and completely from all tables where these products belong to.</strong></li><li>While choosing <strong>\'delete product only in this category\'</strong>, no products are deleted completely, but only their links to the actually opened category - even when it\'s the only category-link of the product, and without warning, that means: be careful with this delete tool as well.</li><li>While <strong>copying</strong>, products are not duplicated, they are only linked to the new category chosen.</li><li>Products are only <strong>moved</strong> resp. <strong>copied</strong> to a new category in case they do not exist there allready.</li></ul>');
+define('TEXT_MOVE_TO', 'move to');
+define('TEXT_CHOOSE_ALL', 'choose all');
+define('TEXT_CHOOSE_ALL_REMOVE', 'remove chosen');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in<br>&nbsp;<br><b>%s</b>');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE', 'Products Price:');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method:');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/removezip.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/removezip.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/removezip.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('ZIP_REMOVE_CHECK', 'Are you sure you want to delete this record?');
+define('ZIP_DELETE_CONFIRM_MESSAGE', 'Record Has Been Deleted');
+define('ZIP_DELETE_ERROR_MESSAGE', 'Unable to Delete Record');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: reviews.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Reviews');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_RATING', 'Rating');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('ENTRY_PRODUCT', 'Product:');
+define('ENTRY_FROM', 'From:');
+define('ENTRY_DATE', 'Date:');
+define('ENTRY_REVIEW', 'Review:');
+define('ENTRY_REVIEW_TEXT', '<small><font color="#ff0000"><b>NOTE:</b></font></small>&nbsp;HTML is not translated!&nbsp;');
+define('ENTRY_RATING', 'Rating:');
+
+define('TEXT_INFO_DELETE_REVIEW_INTRO', 'Are you sure you want to delete this review?');
+
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_INFO_REVIEW_AUTHOR', 'Author:');
+define('TEXT_INFO_REVIEW_RATING', 'Rating:');
+define('TEXT_INFO_REVIEW_READ', 'Read:');
+define('TEXT_INFO_REVIEW_SIZE', 'Size:');
+define('TEXT_INFO_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+
+define('TEXT_OF_5_STARS', '%s of 5 Stars!');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>GOOD</b></font></small>');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>BAD</b></font></small>');
+define('TEXT_INFO_HEADING_DELETE_REVIEW', 'Delete Review');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/salemaker.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/salemaker.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/salemaker.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: salemaker.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'SaleMaker');
+
+define('TABLE_HEADING_SALE_NAME', 'Sale Name');
+define('TABLE_HEADING_SALE_DEDUCTION', 'Deduction');
+define('TABLE_HEADING_SALE_DATE_START', 'Startdate');
+define('TABLE_HEADING_SALE_DATE_END', 'Enddate');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_SALEMAKER_NAME', 'SaleName:');
+define('TEXT_SALEMAKER_DEDUCTION', 'Deduction:');
+define('TEXT_SALEMAKER_DEDUCTION_TYPE', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type:&nbsp;&nbsp;');
+define('TEXT_SALEMAKER_PRICERANGE_FROM', 'Products Price Range:');
+define('TEXT_SALEMAKER_PRICERANGE_TO', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
+define('TEXT_SALEMAKER_SPECIALS_CONDITION', 'If a product is a Special:');
+define('TEXT_SALEMAKER_DATE_START', 'Start Date:');
+define('TEXT_SALEMAKER_DATE_END', 'End Date:');
+define('TEXT_SALEMAKER_CATEGORIES', '<b>Or</b> check the categories to which this sale applies:');
+define('TEXT_SALEMAKER_POPUP', '<a href="javascript:session_win();"><span class="errorText"><b>Click here for Salemaker Usage Tips.</b></span></a>');
+define('TEXT_SALEMAKER_IMMEDIATELY', 'Immediately');
+define('TEXT_SALEMAKER_NEVER', 'Never');
+define('TEXT_SALEMAKER_ENTIRE_CATALOG', 'Check this box if you want the sale to be applied to <b>all products</b>:');
+define('TEXT_SALEMAKER_TOP', 'Entire Catalog');
+
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_DATE_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_DATE_STATUS_CHANGE', 'Last Status Change:');
+define('TEXT_INFO_SPECIALS_CONDITION', 'Specials Condition:');
+define('TEXT_INFO_DEDUCTION', 'Deduction:');
+define('TEXT_INFO_PRICERANGE_FROM', 'Price Range:');
+define('TEXT_INFO_PRICERANGE_TO', ' to ');
+define('TEXT_INFO_DATE_START', 'Starts:');
+define('TEXT_INFO_DATE_END', 'Expires:');
+
+define('SPECIALS_CONDITION_DROPDOWN_0', 'Ignore Specials Price');
+define('SPECIALS_CONDITION_DROPDOWN_1', 'Ignore SaleCondition');
+define('SPECIALS_CONDITION_DROPDOWN_2', 'Apply SaleDeduction to Specials Price');
+
+define('DEDUCTION_TYPE_DROPDOWN_0', 'Deduct amount');
+define('DEDUCTION_TYPE_DROPDOWN_1', 'Percent');
+define('DEDUCTION_TYPE_DROPDOWN_2', 'New Price');
+
+define('TEXT_INFO_HEADING_COPY_SALE', 'Copy Sale');
+define('TEXT_INFO_COPY_INTRO', 'Enter a name for the copy of<br>&nbsp;&nbsp;"%s"');
+
+define('TEXT_INFO_HEADING_DELETE_SALE', 'Delete Sale');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to permanently delete this sale?');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/salemaker_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/salemaker_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/salemaker_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: salemaker_info.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'SaleMaker');
+define('SUBHEADING_TITLE', 'SaleMaker Usage Tips:');
+define('INFO_TEXT', '<ul>
+                      <li>
+                        Always use a \'.\' as decimal point in deduction and price range.
+                      </li>
+                      <li>
+                        Enter amounts in the same currency as you would when creating/editing a product.
+                      </li>
+                      <li>
+                        In the Deduction fields, you can enter an amount or a percentage to deduct,
+                        or a replacement price. (eg. deduct $5.00 from all prices or deduct 10% from
+                        all prices or change all prices to $25.00)
+                      </li>
+                      <li>
+                        Entering a price range narrows down the product range that will be affected. (eg.
+                        products from $50.00 to $150.00)
+                      </li>
+                      <li>
+                        You must choose the action to take if a product is a special <i>and</i> is subject to this sale:
+            <ul>
+                          <li>
+                            Ignore Specials Price<br>
+                            The sale deduction will be applied to the regular price of the product.
+                            (eg. Regular price $10.00, Specials price is $9.50. Sale condition is 10%,
+                            The product\'s final price will show $9.00 on sale. The Specials price is ignored.)
+                          </li>
+                          <li>
+                            Ignore Sale condition<br>
+                            The sale deduction will not be applied to Specials. The Specials price will show just like
+                            when there is no sale defined. (eg. Regular price $10.00, Specials price is $9.50.
+                            Sale condition is 10%. The product\'s final price will show $9.50 on sale.
+                            The Sales condition is ignored.)
+                          </li>
+                          <li>
+                            Apply Sale condition to Specials Price<br>
+                            The sale deduction will be applied to the Specials price. A compounded price will show.
+                            (eg. Regular price $10.00, Specials price is $9.50, Sale condition is 10%. The product\'s
+                            final price will show $8.55. And additional 10% off the Specials price.)
+                          </li>
+                        </ul>
+                      </li>
+                      <li>
+                        Leaving the start date empty will start the sale immediately.
+                      </li>
+                      <li>
+                        Leave the end date empty if you do not want the sale to expire.
+                      </li>
+                      <li>
+                        Checking a category automatically includes the sub-categories.
+                      </li>
+                    </ul>');
+define('TEXT_CLOSE_WINDOW', '[ close window ]');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/server_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/server_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/server_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: server_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Server Information');
+
+define('TITLE_SERVER_HOST', 'Server Host:');
+define('TITLE_SERVER_OS', 'Server OS:');
+define('TITLE_SERVER_DATE', 'Server Date:');
+define('TITLE_SERVER_UP_TIME', 'Server Up Time:');
+define('TITLE_HTTP_SERVER', 'HTTP Server:');
+define('TITLE_PHP_VERSION', 'PHP Version:');
+define('TITLE_ZEND_VERSION', 'Zend:');
+define('TITLE_DATABASE_HOST', 'Database Host:');
+define('TITLE_DATABASE', 'Database:');
+define('TITLE_DATABASE_DATE', 'Datebase Date:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+define('HEADING_TITLE','ShipWire World Class Fullfillment Services');
+define('CONTENT_TEXT1','<div ALIGN="center"><table BORDER="0" CELLPADDING="0" STYLE="border-collapse: collapse" WIDTH="100%" ID="table1"><tr><td style="padding-right:20px"><FONT face="arial, helvetica, sans-serif"><table border="0" width="100%" id="table744" cellspacing="0" cellpadding="0"><tr><td width="630" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                    '<span class="main"><b>Receive, store, and ship merchandise right from CRE Loaded!</b></span><br><span class="smallText">100% integrated with your CRE Loaded application, our Shipwire module sends orders from CRE Loaded directly to your Shipwire fulfillment center. Take advantage of Shipwire’s volume discounts and have your orders automatically packaged and shipped, often for less than the cost of standard shipping.</span>' . 
+                                    '<p><span class="main"><b>What is Shipwire?</b></span><br><span class="smallText">Shipwire is a popular order fulfillment service that allows you to store merchandise in massive Chicago and Los Angeles warehouses. Then as each order comes into your online store, Shipwire will pack and ship it for you.</p>' . 
+                                    '<p><span class="smallText">You can add a Shipwire account with just a few clicks of the mouse - no programming involved. If you\'re just starting out, or looking for a better way to manage your shipping and handling, Shipwire offers an easy and quick way to outsource shipping with no startup, receiving, storage or packaging fees. You just pay $79.95 a month, plus a Shipwire handling fee on the merchandise that they ship. Handling fees range from $1 to $1.50 an item and depend on the type of handling your product needs. </span></p>' . 
+                                    '<p><span class="smallText">With Shipwire, your customers can receive merchandise anywhere in the world, serviced by the USPS, UPS or one of our freight partners. With facilities shipping more than 200,000 orders a month, they can customize your merchandise with assembly and kitting services at extremely affordable prices.</span></p>' .
+                                    '<p><span class="smallText">Shipwire makes it simple to automate order fulfillment on your site: Get approved in 24 hours. As soon as you enter your SKU information and send them your initial inventory, they can start shipping your orders.</span></p>' . 
+                                    '<p><span class="smallText">Shipwire makes extensive efforts to help you accurately monitor shipping and handling costs. Shipwire\'s reporting tools help you understand your inbound and outbound shipping, and automate time-consuming bookkeeping tasks.</span></p>');
+
+define('CONTENT_TEXT2','<span class="smallText"><p>Check out our <a TARGET="_blank" HREF="http://www.creloaded.com/Add-Ons/c22/p77/Shipwire_Pro_Checkout_Success_Module_-_Now_Handles_Mixed_Orders/product_info.html"><b>Shipwire Pro Checkout Success Module</b></a>, which allows you to manage mixed orders; send only those products you choose via Shipwire from a successful order.</span>' .
+                                     '<br>&nbsp;</p></td><td width="30" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">&nbsp;</td><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:13px;font-family:Arial; color:#000002">' . 
+                                     '<span class="lb08"><img src="images/pixel_trans.gif" width="20" height="30" /><table border="0" cellpadding="0" cellspacing="0" id="table745" width="190"><tr style="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '<td width="5" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="5" height="1" alt=""></td><td width="87%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="166" height="1" alt=""></td><td width="5" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="5" height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002" >' . 
+                                     '<img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr style="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">');
+
+define('CONTENT_TEXT3','<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '</tr><tr><td bgcolor="#CFCFCF" height="40" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif"><td height="40" bgcolor="#E7EFFF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="5" height="1" alt=""></td></FONT>' .
+                                     '<td class="body" height="40" bgcolor="#E7EFFF" colspan="8"><p style="margin-top: 4px; margin-bottom: 4px"><font face="Arial" color="#003399" style="font-size: 16pt">Basic</font></p><p style="margin-top: 4px; margin-bottom: 4px"><span style="font-weight: 700"> <font face="Arial" size="3" color="#666666">$79.95/mo</font></span></td><font face="arial, helvetica, sans-serif">' .
+                                     '<td bgcolor="#CFCFCF" height="40" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></FONT></tr><tr><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>  <td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr><td bgcolor="#CFCFCF" height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '<td height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="7" height="1" alt=""></td><td class="body" height="25" colspan="8"><br><font color="#666666">No setup fee,<br>$1 to $1.50 handling fee</font><font color="#003399"><br>&nbsp;</font><table cellpadding="0" cellspacing="0" border="0" id="table746">' .
+                                     '<tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table747"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table748"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt">');
+
+define('CONTENT_TEXT4','<img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Easy setup with your store</font></span></span></font></td>' .
+                                     '</tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table749"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table750"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '  <FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002">' .
+                                     '<span class="lb08"><font face="Arial" color="#666666">Online inventory manager</font></span></span></font></td></tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table751"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table752">' .
+                                     '<tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Sell up to 50 items</font></span></span></font></td></tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table753"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<table border="0" width="100%" cellspacing="0" cellpadding="0" id="table754"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td>');
+
+define('CONTENT_TEXT5','<td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Unlimited email support</font></span></span></font></td></tr></table></td></tr></table><p ALIGN="center"><span style="font-family: Verdana; font-size: 10px; color:#000002">' .
+                                     '<font face="Arial" size="2" color="#000000"><a TARGET="_blank" HREF="http://www.shipwire.com/exec/creloaded.php?ref=6133361"><input type="button" value="Free Sign Up" onclick="\'document.location.href=create_account.php\'" style="font-family:Arial; font-size:13px; "></a>&nbsp;&nbsp;&nbsp; </font></span><br><br>&nbsp;&nbsp;</p></td><td bgcolor="#CFCFCF" height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif"><td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif" size="2"><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"></FONT></FONT></tr></table></span></span></font></td></tr></table></font></td></tr></table></div>');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/shopbyprice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/shopbyprice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/shopbyprice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: tax_classes.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Shop By Price');
+
+define('TABLE_HEADING_OPTIONS', 'Shop By Options');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_OPTION_1', 'Shop By Price Options');
+define('TEXT_INFO_OPTION_2', 'Shop By Price Ranges');
+
+define('TEXT_EDIT_HEADING_OPTIONS', 'Options:');
+define('TEXT_EDIT_OPTIONS_INTRO', 'Set the number of ranges to be supported.  Optionally include an "and above" range.');
+define('TEXT_EDIT_ERROR_RANGES', 'The Ranges field must be numeric.');
+
+define('TEXT_EDIT_HEADING_RANGE', 'Ranges:');
+define('TEXT_EDIT_RANGE_INTRO', 'The range limits must be in acending order.');
+define('TEXT_EDIT_ERROR_RANGE', 'Range fields are not in acending order.');
+define('TEXT_EDIT_ERROR_NUMERIC', 'A range field is not numeric.');
+
+define('TEXT_INFO_RANGES', 'Selection Ranges:');
+define('TEXT_INFO_OPTIONS_DESCRIPTION', 'Set the ranges to 0 to turn off this feature.');
+define('TEXT_INFO_OVER', 'Automatic over range generation:');
+
+define('TEXT_INFO_ZERORANGE', 'This function is currently disabled.  Enable by setting the number of ranges greater than zero.');
+define('TEXT_INFO_NORANGE', 'No range intofotmation has been entered.');
+define('TEXT_INFO_UNDER', 'Under&nbsp;');
+define('TEXT_INFO_FROM', 'From&nbsp;');
+define('TEXT_INFO_TO', '&nbsp;to&nbsp;');
+define('TEXT_INFO_ABOVE', '&nbsp;and above');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/specials.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: specials.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Specials');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_PRODUCTS_PRICE', 'Products Price');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_SPECIALS_PRODUCT', 'Product:');
+define('TEXT_SPECIALS_SPECIAL_PRICE', 'Special Price:');
+define('TEXT_SPECIALS_EXPIRES_DATE', 'Expiry Date:');
+define('TEXT_SPECIALS_PRICE_TIP', '<b>Specials Notes:</b><ul><li>You can enter a percentage to deduct in the Specials Price field, for example: <b>20%</b></li><li>If you enter a new price, the decimal separator must be a \'.\' (decimal-point), example: <b>49.99</b></li><li>Leave the expiry date empty for no expiration</li></ul>');
+
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_NEW_PRICE', 'New Price:');
+define('TEXT_INFO_ORIGINAL_PRICE', 'Original Price:');
+define('TEXT_INFO_PERCENTAGE', 'Percentage:');
+define('TEXT_INFO_EXPIRES_DATE', 'Expires At:');
+define('TEXT_INFO_STATUS_CHANGE', 'Status Change:');
+
+define('TEXT_INFO_HEADING_DELETE_SPECIALS', 'Delete Special');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete the special products price?');
+define('TEXT_SPECIALS_GROUPS', 'Customer Group:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/specialsbycategory.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/specialsbycategory.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/specialsbycategory.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: specialsbycategory.php,v 1.0 2005/04/24 23:41:21 calimeross Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('HEADING_TITLE', 'Specials by Category');
+define('TEXT_SELECT_CAT', 'First Select Category');
+define('TEXT_SELECT_MAN', '<br>and/or Manufacturer');
+define('TEXT_ENTER_DISCOUNT','Enter Your Discount');
+define('TEXT_PCT_AND','% and');
+define('TEXT_BUTTON_SUBMIT', 'Submit');
+
+define('TEXT_INSTRUCT_1','Leaving discount blank will show all products in selected category.');
+define('TEXT_INSTRUCT_2','Entering 0 discount will remove all specials in selected category.');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_PRODUCTS_PRICE', 'Products Price');
+define('TABLE_HEADING_SPECIAL_PRICE', 'Special Price');
+define('TABLE_HEADING_PCT_OFF', '%Off');
+define('TABLE_HEADING_FULL_PRICE', 'Full Price');
+
+define('TEXT_BUTTON_UPDATE', 'Update');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_articles_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_articles_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_articles_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_articles_viewed.php,v 1.5 2005/03/01 15:51:03 info at bridegroompress.com Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Best Viewed Articles');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_ARTICLES', 'Articles');
+define('TABLE_HEADING_VIEWED', 'Viewed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_credits.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_credits.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_credits.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.9 2002/03/30 15:03:59 harley_vb Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Credit Stats');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_CUSTOMERS', 'Customer');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Credit');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Best Customer Orders-Total');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Total Purchased');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_customers_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_customers_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_customers_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: stats_customers_orders.php,v 1.2 24 mars 2004 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  originally developed by xaglo
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE', 'Customers Statistics');
+define('HEADING_MONTH', 'Display for the month:');
+define('HEADING_YEAR', 'Display for the year:');
+define('HEADING_NUMBER_ORDERS', 'Orders<br>minimum:');
+define('HEADING_TITLE_NO_STATUS', 'Hide orders status:');
+define('HEADING_TITLE_STATUS', 'Display only orders status:');
+define('TEXT_NO_ORDERS', 'None');
+define('TEXT_ALL_ORDERS', 'All');
+define('TEXT_ALL_MOIS', 'Every month');
+define('TEXT_ALL_ANNEE', 'Every year');
+define('NEW_CUSTOMERS', 'New customers:');
+define('NUMBER_ORDER', 'Number of orders:');
+define('CUSTOMERS_BOUGHT', 'Customers having bought:');
+define('NEW_CUSTOMERS_BOUGHT', 'New customers having bought:');
+define('TEXT_MINI_ORDERED', 'Customers having already made at least <b>%s</b> purchase(s)');
+define('TOTAL_TTC', 'Total sales including all taxes:');
+define('TOTAL_TAX', 'Total taxes:');
+define('TOTAL_SHIPPING', 'Total shipping:');
+define('TOTAL_HT', 'Total sales:');
+define('BASKET_TTC', 'Average Sale including all taxes:');
+define('BASKET_HT', 'Average Basket:');
+define('JAN', 'January');
+define('FEV', 'February');
+define('MAR', 'March');
+define('AVR', 'April');
+define('MAI', 'May');
+define('JUN', 'June');
+define('JUI', 'July');
+define('AOU', 'August');
+define('SEP', 'September');
+define('OCT', 'October');
+define('NOV', 'November');
+define('DEC', 'December');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_daily_products_sales_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_daily_products_sales_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_daily_products_sales_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  Written by Marc Sauton, September 2004
+  Daily Product Report Contribution for the OsCommerce Community
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Daily products sales report');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_ORDER_QUANTITY', 'Order Quantity');
+define('TABLE_HEADING_PRODUCT_NAME', 'Product Name');
+define('TABLE_HEADING_PRODUCT_MODEL', 'Product Model');
+define('TABLE_HEADING_UNITPRICE', 'Unit Price');
+define('TABLE_HEADING_PRODUCT_QUANTITY', 'Product Quantity');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Total Purchased');
+
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> customers)');
+define('TEXT_BUTTON_REPORT_SAVE','Save CSV');
+
+define('TABLE_DAILY_VALUE', 'Daily Value: ');
+define('DISPLAY_ANOTHER_REPORT_DATE', 'Display another report for this date: ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_monthly_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_monthly_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_monthly_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+<?php
+/*
+  $Id: stats_monthly_sales.php,v 2.2 $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Monthly Sales/Tax Summary');
+define('HEADING_TITLE_STATUS','Status');
+define('HEADING_TITLE_REPORTED','Reported');
+define('TEXT_DETAIL','Detail');
+define('TEXT_ALL_ORDERS', 'All orders');
+define('TEXT_NOTHING_FOUND', 'No income for this date/status selection');
+define('TEXT_BUTTON_REPORT_BACK','Back');
+define('TEXT_BUTTON_REPORT_INVERT','Invert');
+define('TEXT_BUTTON_REPORT_PRINT','Print');
+define('TEXT_BUTTON_REPORT_HELP','Help');
+define('TEXT_BUTTON_REPORT_SAVE','Save CSV');
+define('TEXT_BUTTON_REPORT_HELP','Help');
+define('TEXT_BUTTON_REPORT_BACK_DESC', 'Return to summary by months');
+define('TEXT_BUTTON_REPORT_INVERT_DESC', 'Invert rows top to bottom');
+define('TEXT_BUTTON_REPORT_PRINT_DESC', 'Show report in printer friendly window');
+define('TEXT_BUTTON_REPORT_HELP_DESC', 'About this report and how to use its features');
+define('TEXT_BUTTON_REPORT_GET_DETAIL', 'Click to report daily summary for this month');
+define('TEXT_REPORT_DATE_FORMAT', 'j M Y -   g:i a'); // date format string
+//  as specified in php manual here: http://www.php.net/manual/en/function.date.php
+
+define('TABLE_HEADING_YEAR','Year');
+define('TABLE_HEADING_MONTH', 'Month');
+define('TABLE_HEADING_DAY', 'Day');
+define('TABLE_HEADING_INCOME', 'Gross<br> Income');
+define('TABLE_HEADING_SALES', 'Product<br> Sales');
+define('TABLE_HEADING_NONTAXED', 'Nontaxed<br> Sales');
+define('TABLE_HEADING_TAXED', 'Taxed<br> Sales');
+define('TABLE_HEADING_TAX_COLL', 'Taxes<br> Collected');
+define('TABLE_HEADING_SHIPHNDL', 'Shipping<br> & Handling');
+define('TABLE_HEADING_SHIP_TAX', 'Tax on<br /> Shipping');
+define('TABLE_HEADING_LOWORDER', 'Low Order<br /> Fees');
+define('TABLE_HEADING_OTHER', 'Gift<br> Vouchers');  // could be any other extra class value
+define('TABLE_FOOTER_YTD','YTD');
+define('TABLE_FOOTER_YEAR','YEAR');
+define('TEXT_HELP', '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title>Monthly Sales/Tax Report</title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<BODY>
+<center>
+<table width="95%"><tr><td>
+<p class="main" align="center">
+<b>How to view and use the store income summary report</b>
+<p class="main" align="justify">
+<b>Reporting store activity by month</b>
+<p class="smallText" align="justify">
+When initially selected from the Reports menu, this report displays a financial summary of all orders in the store database, by month.  Each month of the store\'s history is summarized in a row, showing the store income and its components, and listing the amounts of taxes, shipping and handling charges, low order fees and gift vouchers. (If the store does not have low order fees or gift vouchers enabled, these columns are omitted from the report.)  Activity is reported as of the date of purchase.
+<p class="smallText" align="justify">
+The top row is the current month, and the rows under it summarize each month of the store\'s order history.  Beneath the rows of each calendar year is a footer line, summarizing that year\'s totals in each column of the report. 
+<p class="smallText" align="justify">
+To invert the order of the rows, click the "Invert" button.
+<p class="main" align="justify">
+<b>Reporting monthly summary by days</b>
+<p class="smallText" align="justify">
+The summary of daily activity within any month may be displayed by clicking on the month\'s name, at the left of the row.  To return from the daily summary to the monthly summary, click the "Back" button in the daily display.
+<p class="main" align="justify">
+<b>What the columns represent (headers explained)</b>
+<p class="smallText" align="justify">
+On the left, the month and year of the row are stated.  The other columns are, left to right:
+<ul><li class="smallText"><b>Gross Income</b> - the total of all orders  
+<li class="smallText"><b>Order Subtotal</b> - the total sales of products purchased in the month
+<br>Then, the product sales are broken into two categories:
+<li class="smallText"><b>Nontaxed sales</b> - the subtotal of sales which were not taxed, and 
+<li class="smallText"><b>Taxed sales</b> - the subtotal of sales which were taxed
+<li class="smallText"><b>Taxes collected</b> - the amount collected from customers for taxes
+<li class="smallText"><b>Shipping & handling</b> - the total shipping and handling charges collected  
+<li class="smallText"><b>Tax on shipping</b> - Tax on shipping and handling charges
+<li class="smallText"><b>Low order fees</b> and <b>Gift Vouchers</b> - if the store has low order fees enabled, and/or gift vouchers, the totals of these are shown in separate columns
+</ul>
+<p class="main" align="justify">
+<b>Selecting report summary by status</b>
+<p class="smallText" align="justify">
+To show the monthly or daily summary information for just one Order Status, select the status in the drop-down box at the upper right of the report screen.  Depending on the store\'s setup for these values, there may be a status for "Pending" or "Shipped" for instance.  Change this status and the report will be recalculated and displayed. 
+<p class="main" align="justify">
+<b>Showing detail of taxes</b>
+<p class="smallText" align="justify">
+The amount of tax in any row of the report is a link to a popup window, which shows the name of the tax classes charged and their individual amounts.
+<p class="main" align="justify">
+<b>Printing the report</b>
+<p class="smallText" align="justify">
+To view the report in a printer-friendly window, click on the "Print" button, then use your browser\'s print command in the File menu.  The store name and headers are added to show what orders were selected, and when the report was generated. 
+<p class="main" align="justify">
+<b>Saving report values to a file</b>
+<p class="smallText" align="justify">
+To save the values of the report to a local file, click on the Save CSV button at the bottom of the report.  The report values will be sent to your browser in a text file, and you will be prompted with a Save File dialog box to choose where to save the file.  The contents of the file are in Comma Separated Value (CSV) format, with a line for each row of the report beginning with the header line, and each value in the row is separated by commas. This file can be conveniently and accurately imported to common spreadsheet financial and statistical tools, such as Excel and QuattroPro. The file is provided to your browser with a suggested file name consisting of the report name, status selected, and date/time. <br><br>
+<p class="smallText">v 2.1.1
+</td></tr>
+</table>
+</BODY>
+</HTML>');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_not_valid_users.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_not_valid_users.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_not_valid_users.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id:$
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+
+ define('TABLE_HEADING_DELETE', 'Delete');
+ define('TABLE_HEADING_ID', 'Customer ID');
+ define('TABLE_HEADING_CUSTOMERS', 'Username');
+ define('TABLE_HEADING_EMAIL', 'Email');
+ define('TABLE_HEADING_LAST_LOGON', 'Last login');
+ define('HEADING_TITLE', 'Customers Not Validated');
+ define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+ define('SIU_BACK', 'Back');
+ define('SIU_DELETE', 'Delete!');
+ define('SIU_CUSTOMER_DELETED', 'Customer %s deleted!');
+ define('SURE_TO_DELETE', 'Are you sure you want to delete the user %s?');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_notifications.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: stats_products_viewed.php,v 1.1 2003/05/16 00:10:05 ft01189 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Products Notifications');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_COUNT', 'Notifications Count');
+define('TABLE_HEADING_NAME', 'Customers Name');
+define('TABLE_HEADING_EMAIL', 'Customers Email Address');
+define('TABLE_HEADING_DATE', 'Notification Set on');
+define('TEXT_DESCRIPTION', 'Allows you to see the number of customer notifications per product. Click on product name to see details. ');
+define('TEXT_DESCRIPTION_TO', 'Allows you to see the customers that wanted to be notified for ');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_purchased.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_purchased.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_purchased.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_products_purchased.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Best Products Purchased');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_PURCHASED', 'Purchased');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_products_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_products_viewed.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Best Viewed Products');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_VIEWED', 'Viewed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/stats_sales_report2.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/stats_sales_report2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/stats_sales_report2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.9 2002/03/30 15:03:59 harley_vb Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('REPORT_DATE_FORMAT', 'm. d. Y');
+
+define('HEADING_TITLE', 'Sales Report');
+
+define('REPORT_TYPE_YEARLY', 'Yearly');
+define('REPORT_TYPE_MONTHLY', 'Monthly');
+define('REPORT_TYPE_WEEKLY', 'Weekly');
+define('REPORT_TYPE_DAILY', 'Daily');
+define('REPORT_START_DATE', 'from date');
+define('REPORT_END_DATE', 'to date (inclusive)');
+define('REPORT_DETAIL', 'detail');
+define('REPORT_MAX', 'show top');
+define('REPORT_ALL', 'all');
+define('REPORT_SORT', 'sort');
+define('REPORT_EXP', 'export');
+define('REPORT_SEND', 'send');
+define('EXP_NORMAL', 'normal');
+define('EXP_HTML', 'HTML only');
+define('EXP_CSV', 'CSV');
+
+define('TABLE_HEADING_DATE', 'Date');
+define('TABLE_HEADING_ORDERS', '#Orders');
+define('TABLE_HEADING_ITEMS', '#Items');
+define('TABLE_HEADING_REVENUE', 'Revenue');
+define('TABLE_HEADING_SHIPPING', 'Shipping');
+
+define('DET_HEAD_ONLY', 'no details');
+define('DET_DETAIL', 'show details');
+define('DET_DETAIL_ONLY', 'details with amount');
+
+define('SORT_VAL0', 'standard');
+define('SORT_VAL1', 'description');
+define('SORT_VAL2', 'description desc');
+define('SORT_VAL3', '#Items');
+define('SORT_VAL4', '#Items desc');
+define('SORT_VAL5', 'Revenue');
+define('SORT_VAL6', 'Revenue desc');
+
+define('REPORT_STATUS_FILTER', 'Status');
+
+define('SR_SEPARATOR1', ';');
+define('SR_SEPARATOR2', ';');
+define('SR_NEWLINE', '\n\r');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/tax_classes.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/tax_classes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/tax_classes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: tax_classes.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Tax Classes');
+
+define('TABLE_HEADING_TAX_CLASSES', 'Tax Classes');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_CLASS_TITLE', 'Tax Class Title:');
+define('TEXT_INFO_CLASS_DESCRIPTION', 'Description:');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new tax class with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this tax class?');
+define('TEXT_INFO_HEADING_NEW_TAX_CLASS', 'New Tax Class');
+define('TEXT_INFO_HEADING_EDIT_TAX_CLASS', 'Edit Tax Class');
+define('TEXT_INFO_HEADING_DELETE_TAX_CLASS', 'Delete Tax Class');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/tax_rates.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/tax_rates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/tax_rates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: tax_rates.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Tax Rates');
+
+define('TABLE_HEADING_TAX_RATE_PRIORITY', 'Priority');
+define('TABLE_HEADING_TAX_CLASS_TITLE', 'Tax Class');
+define('TABLE_HEADING_COUNTRIES_NAME', 'Country');
+define('TABLE_HEADING_ZONE', 'Zone');
+define('TABLE_HEADING_TAX_RATE', 'Tax Rate');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_CLASS_TITLE', 'Tax Class Title:');
+define('TEXT_INFO_COUNTRY_NAME', 'Country:');
+define('TEXT_INFO_ZONE_NAME', 'Zone:');
+define('TEXT_INFO_TAX_RATE', 'Tax Rate (%):');
+define('TEXT_INFO_TAX_RATE_PRIORITY', 'Tax rates at the same priority are added, others are compounded.<br><br>Priority:');
+define('TEXT_INFO_RATE_DESCRIPTION', 'Description:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new tax class with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this tax rate?');
+define('TEXT_INFO_HEADING_NEW_TAX_RATE', 'New Tax Rate');
+define('TEXT_INFO_HEADING_EDIT_TAX_RATE', 'Edit Tax Rate');
+define('TEXT_INFO_HEADING_DELETE_TAX_RATE', 'Delete Tax Rate');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/template_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/template_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/template_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Template Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Template Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADER_EXPLAIN', 'These settings effect all templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Side box configuration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Layout configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/template_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/template_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/template_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,97 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Template Management');
+
+define('TABLE_HEADING_TEMPLATE', 'Template Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+define('TABLE_HEADING_NOT_INSTALLED', 'Not installed');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DELETE_IMAGE', 'Delete template image?');
+define('TEXT_REST_CUST_TEMP', 'Set Site default template to replace this template in customer data?');
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this template?');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADING_DELETE_TEMPLATE', 'Delete Template');
+define('TEXT_HEADING_EDIT_TEMPLATE', 'Edit Template');
+define('TEXT_HEADING_NEW_TEMPLATE', 'New Template');
+
+define('TEXT_INCLUDE_CART_IN_HEADER', 'Include Cart in Header?');
+define('TEXT_INCLUDE_COLUMN_LEFT', 'Include the left column?');
+define('TEXT_INCLUDE_COLUMN_RIGHT', 'Include the right column?');
+define('TEXT_INCLUDE_HEADER_LINK_BUTTONS', 'Include Header Link Buttons?');
+define('TEXT_INCLUDE_LANGUAGES_IN_HEADER', 'Include languages in Header?');
+define('TEXT_INCLUDE_MAIN_TABLE_BORDER', 'Include Main Table Border?');
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFOBOX_BORDER_WIDTH_LEFT', 'Infobox left border image width');
+define('TEXT_INFOBOX_BORDER_WIDTH_RIGHT', 'Infobox right border image width');
+
+define('TEXT_LEFT_COLUMN', '<b>Left column</b>');
+define('TEXT_RIGHT_COLUMN', '<b>Right column</b>');
+define('TEXT_TEMPLATE', 'Template:');
+
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_YES', 'Yes');
+define('TEXT_NO', 'No');
+define('TEXT_NEW_INTRO', 'Please fill out the following information for the new template');
+
+
+define('TEXT_TEMPLATE_SYSTEM', 'The template uses the  ');
+define('TEXT_TEMPLATE_SYSTEM_1', ' template system.');
+
+define('TEXT_TEMPLATE_NAME', 'Template Name:  ');
+define('TEXT_TEMPLATE_IMAGE', 'Template Image:  ');
+
+define('TEXT_TEMPLATE_CELLPADDING_MAIN', 'Main table cellpadding');
+define('TEXT_TEMPLATE_CELLPADDING_LEFT', 'Left column cellpadding');
+define('TEXT_TEMPLATE_CELLPADDING_RIGHT', 'Right column cellpadding');
+define('TEXT_TEMPLATE_CELLPADDING_SUB', 'Sub table cellpadding');
+
+define('TEXT_SITE_WIDTH', 'Site Width');
+
+define('TEXT_MOVE_RIGHT', 'Move to the right column');
+define('TEXT_MOVE_LEFT', 'Move to the left column');
+
+define('TEXT_SHOW_CUSTOMER_GREETING', 'Show customer greeting?');
+define('TEXT_SHOW_ORIGINAL_PAGE_HEADERS', 'Show Mainpage Headers?');
+
+define('TEXT_TABLE_CELL_PADDING', '<b>Table cellpadding</b>');
+define('TEXT_OTHER', '<b>Other</b>');
+define('TEXT_MAINPAGE_MODULES', '<b>Select Modules for Catalog index page</b>');
+
+define('TEXT_MAINPAGE_MODULES_LOCATION', '<b>The module folder used is: </b>');
+
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: Directory not writeable. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+
+define('TEXT_TABLE_CELL_LEFT_RIGHT', '<b>Side infobox cellpadding</b>');
+define('TEXT_TEMPLATE_LEFT_SIDE', 'Left side cellpadding');
+define('TEXT_TEMPLATE_RIGHT_SIDE', 'Right side cellpadding');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+define("TEMPLATE_NAME", "Template Name");
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+$user_ip = getenv('REMOTE_ADDR');;
+
+define('HEADING_TITLE', 'Resend Validation email');
+define('TEXT_EMAIL_CONFIRMATION','Are You Sure to Resend Validation email');
+define('ENTRY_EMAIL_ADDRESS', 'Emailadress: ');
+define('SUCCESS_REGISTRATION_CODE_SENT', 'New validation code Sent');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'This email address is not registered');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Your Validation Code is');
+define('EMAIL_PASSWORD_REMINDER_BODY', "\n\n".'We are resending your Validation Code.' . "\n\n" . 'Your Validation Code for \'' . STORE_NAME . '\' :' . "\n\n" . '%s' . "\n\n");
+define('EMAIL_PASSWORD_REMINDER_BODY2', 'Please follow this link to validate your account: %s' . "\n\n");
+define('TEXT_ACCOUNT_ALREADY_EXIST', 'This Account is already active!');
+define('IMAGE_BUTTON_BACK',"Go Back");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.5 2002/03/30 15:48:55 harley_vb Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Who\'s Online');
+
+define('TABLE_HEADING_ONLINE', 'Online');
+define('TABLE_HEADING_CUSTOMER_ID', 'ID');
+define('TABLE_HEADING_FULL_NAME', 'Full Name');
+define('TABLE_HEADING_IP_ADDRESS', 'IP Address');
+define('TABLE_HEADING_ENTRY_TIME', 'Entry Time');
+define('TABLE_HEADING_LAST_CLICK', 'Last Click');
+define('TABLE_HEADING_LAST_PAGE_URL', 'Last URL');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_SHOPPING_CART', 'Users Shopping Cart');
+define('TABLE_HEADING_WHOIS', 'Whois');
+define('TEXT_SET_REFRESH', 'Set Refresh Rate:');
+define('TEXT_SHOPPING_CART_SUBTOTAL', 'Subtotal');
+define('TEXT_NUMBER_OF_CUSTOMERS', 'Currently there are %s customers online');
+define('TABLE_HEADING_HTTP_REFERER', 'Referer URL');
+define('TEXT_HTTP_REFERER_URL', 'HTTP Referer URL');
+define('TEXT_HTTP_REFERER_FOUND', 'Found');
+define('TEXT_HTTP_REFERER_NOT_FOUND', 'Not Found');
+define('TEXT_STATUS_ACTIVE_CART', 'Active/Cart');
+define('TEXT_STATUS_ACTIVE_NOCART', 'Active/NoCart');
+define('TEXT_STATUS_INACTIVE_CART', 'Inactive/Cart');
+define('TEXT_STATUS_INACTIVE_NOCART', 'Inactive/NoCart');
+define('TEXT_STATUS_ACTIVE_BOT', 'Active/Bot');
+define('TEXT_STATUS_INACTIVE_BOT', 'Inactive/Bot');
+define('TABLE_HEADING_COUNTRY', 'Country');
+define('TABLE_HEADING_USER_SESSION', 'Session?');
+define('TEXT_OSCID', 'osCsid');
+define('TEXT_PROFILE_DISPLAY', 'Profile Display');
+define('TEXT_USER_AGENT', 'User Agent');
+define('TEXT_ERROR', 'Error!');
+define('TEXT_ADMIN', 'Admin');
+define('TEXT_DUPLICATE_IP', 'Duplicate IPs');
+define('TEXT_BOTS', 'Bots');
+define('TEXT_ME', 'Me!');
+define('TEXT_ALL', 'All');
+define('TEXT_REAL_CUSTOMERS', 'Real Customers');
+define('TEXT_YOUR_IP_ADDRESS', 'Your IP Address');
+define('TEXT_SET_REFRESH_RATE', 'Set Refresh Rate');
+define('TEXT_NONE_', 'None');
+
+define('TEXT_NAME', 'Name:');
+define('TEXT_CUSTOMER_ID', 'Customer ID:');
+define('TEXT_IP_ADDRESS', 'IP Address:');
+define('TEXT_REFERER', 'Referer:');
+define('TEXT_BOTS', 'Bots');
+define('TEXT_CUSTOMERS', 'Customers');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/english/xsell_products.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/xsell_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/xsell_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/* $Id$ 
+osCommerce, Open Source E-Commerce Solutions 
+http://www.oscommerce.com 
+Copyright (c) 2002 osCommerce 
+
+Released under the GNU General Public License 
+xsell.php
+Original Idea From Isaac Mualem im at imwebdesigning.com <mailto:im at imwebdesigning.com> 
+Complete Recoding From Stephen Walker admin at snjcomputers.com
+*/ 
+
+define('CROSS_SELL_SUCCESS', 'Cross Sell Items Successfully Update For Cross Sell Product #'.$_GET['add_related_product_ID']);
+define('SORT_CROSS_SELL_SUCCESS', 'Sort Order Successfully Update For Cross Sell Product #'.$_GET['add_related_product_ID']);
+define('HEADING_TITLE', 'Cross-Sell (X-Sell) Admin');
+define('TABLE_HEADING_PRODUCT_ID', 'Product Id');
+define('TABLE_HEADING_PRODUCT_MODEL', 'Product Model');
+define('TABLE_HEADING_PRODUCT_NAME', 'Product Name');
+define('TABLE_HEADING_CURRENT_SELLS', 'Current Cross-Sells');
+define('TABLE_HEADING_UPDATE_SELLS', 'Update Cross-Sells');
+define('TABLE_HEADING_PRODUCT_IMAGE', 'Product Image');
+define('TABLE_HEADING_PRODUCT_PRICE', 'Product Price');
+define('TABLE_HEADING_CROSS_SELL_THIS', 'Cross-Sell This?');
+define('TEXT_EDIT_SELLS', 'Edit');
+define('TEXT_SORT', 'Prioritize');
+define('TEXT_SETTING_SELLS', 'Setting Cross-Sells For');
+define('TEXT_PRODUCT_ID', 'Product Id');
+define('TEXT_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCT_SORT', 'Sort Order');
+define('TEXT_NO_IMAGE', 'No Image');
+define('TEXT_CROSS_SELL', 'Cross-Sell');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english/zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: zones.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Zones');
+
+define('TABLE_HEADING_COUNTRY_NAME', 'Country');
+define('TABLE_HEADING_ZONE_NAME', 'Zones');
+define('TABLE_HEADING_ZONE_CODE', 'Code');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_ZONES_NAME', 'Zones Name:');
+define('TEXT_INFO_ZONES_CODE', 'Zones Code:');
+define('TEXT_INFO_COUNTRY_NAME', 'Country:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new zone with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this zone?');
+define('TEXT_INFO_HEADING_NEW_ZONE', 'New Zone');
+define('TEXT_INFO_HEADING_EDIT_ZONE', 'Edit Zone');
+define('TEXT_INFO_HEADING_DELETE_ZONE', 'Delete Zone');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/english.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/english.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/english.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1442 @@
+<?php
+/*
+  $Id: english.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//Admin begin
+define('TEXT_ADMIN_HOME','Admin Home');
+define('TEXT_VIEW_CATALOG','View Catalog');
+define('TEXT_FORUMS','CRE Forums');
+define('TEXT_PURCHASE_SUPPORT','Purchase CRE Support');
+define('TEXT_HOSTING','Certified CRE Hosting');
+define('TEXT_ADMIN_LANG','Admin Language:');
+define('TEXT_CHANGE_PASWORD','Change Password');
+define('TEXT_LOGOUT','Logout');
+define('TEXT_CHECK_UPDATES','Check for Updates');
+define('TEXT_GET_PRO','Get Pro Version');
+define('TEXT_GET_B2B','Get B2B Version');
+
+// header text in includes/header.php
+define('HEADER_TITLE_ACCOUNT', 'My Account/Password');
+define('HEADER_TITLE_LOGOFF', 'Log Off');
+define('TEXT_SELECT_LANGUAGE', 'Please select Admin language for this session ');
+define('BOX_REPORTS_NOT_VALID_USER', 'Customers Not Validated');
+
+// Admin Account
+define('BOX_HEADING_MY_ACCOUNT', 'My Account');
+
+//MARKETING BOX
+define('BOX_HEADING_MARKETING', 'Marketing');
+define('BOX_MARKETING_EVENTS_MANAGER', 'Events Manager');
+define('BOX_MARKETING_SALEMAKER', 'SaleMaker');
+define('BOX_MARKETING_SPECIALS', 'Specials');
+define('BOX_MARKETING_SPECIALSBYCAT','Specials By Category');
+define('BOX_MARKETING_BANNER_MANAGER','Banner Manager');
+
+// configuration box text in includes/boxes/administrator.php
+define('BOX_HEADING_ADMINISTRATOR', 'Administrator');
+define('BOX_ADMINISTRATOR_MEMBERS', 'Admin Members');
+define('BOX_ADMINISTRATOR_GROUPS', 'Admin Groups');
+define('BOX_ADMINISTRATOR_MEMBER', 'Members');
+define('BOX_ADMINISTRATOR_BOXES', 'File Access');
+define('BOX_ADMINISTRATOR_ACCOUNT_UPDATE', 'Update Account');
+
+// images
+define('IMAGE_FILE_PERMISSION', 'File Permission');
+define('IMAGE_GROUPS', 'Groups List');
+define('IMAGE_INSERT_FILE', 'Insert File');
+define('IMAGE_MEMBERS', 'Members List');
+define('IMAGE_NEW_GROUP', 'New Group');
+define('IMAGE_NEW_MEMBER', 'New Member');
+define('IMAGE_NEXT', 'Next');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_DISPLAY_NUMBER_OF_FILENAMES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> filenames)');
+define('TEXT_DISPLAY_NUMBER_OF_MEMBERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> members)');
+//Admin end
+
+// look in your $PATH_LOCALE/locale directory for available locales
+// or type locale -a on the server.
+// Examples:
+// on RedHat try 'en_US'
+// on FreeBSD try 'en_US.ISO_8859-1'
+// on Windows try 'en', or 'English'
+
+// this  is used to switch between US and UK formates
+if (ENGLISH_LANGAUGE_SET == 'uk'){
+
+ @setlocale(LC_TIME, 'en_UK.ISO_8859-1'); // #Credits to Brian Sim (aka Simmy) http://forums.oscommerce.com/index.php?showtopic=129520&st=0&p=520992&##
+define('DATE_FORMAT_SHORT', '%d/%m/%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
+define('PHP_DATE_TIME_FORMAT', 'm/d/Y H:i:s'); // this is used for date()
+define('DATE_FORMAT', 'd/m/Y'); // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+////
+// Return date in raw format GB Format
+// $date should be in format mm/dd/yyyy
+// raw date is in format YYYYMMDD, or DDMMYYYY
+function tep_date_raw($date, $reverse = false) {
+  if ($reverse) {
+    return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
+  }
+}
+
+// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
+define('LANGUAGE_CURRENCY', 'GBP');
+
+define('DOB_FORMAT_STRING', 'dd/mm/yyyy');
+
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class="errorText">(eg. 21/05/1970)</span>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 21/05/1970)');
+
+
+define('ENTRY_SUBURB', 'Address Line 2:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+
+define('ENTRY_POST_CODE', 'Post Code:');
+define('ENTRY_POST_CODE_ERROR', 'Your Post Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');
+
+
+define('ENTRY_STATE', 'County/State:');
+define('ENTRY_STATE_ERROR', 'Your County/State must contain a minimum of ' . ENTRY_STATE_MIN_LENGTH . ' characters.');
+define('ENTRY_STATE_ERROR_SELECT', 'Please select a county/state from the County/State pull down menu.');
+
+
+} else {
+ at setlocale(LC_TIME, 'en_US.ISO_8859-1');
+define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
+define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
+define('PHP_DATE_TIME_FORMAT', 'm/d/Y H:i:s'); // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+
+//function tep_date_raw($date, $reverse = false) {
+
+function tep_date_raw($date, $reverse = false) {
+  if ($reverse) {
+    return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
+  }
+}
+
+// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
+define('LANGUAGE_CURRENCY', 'USD');
+
+// text for date of birth example
+define('DOB_FORMAT_STRING', 'mm/dd/yyyy');
+
+
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class="errorText">(eg. 05/21/1970)</span>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)');
+
+//US format
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+
+// US format
+define('ENTRY_POST_CODE', 'Zip Code:');
+define('ENTRY_POST_CODE_ERROR', 'Your Zip Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');
+
+define('ENTRY_STATE', 'State/Province:');
+define('ENTRY_STATE_ERROR', 'Your State must contain a minimum of ' . ENTRY_STATE_MIN_LENGTH . ' characters.');
+define('ENTRY_STATE_ERROR_SELECT', 'Please select a state from the States pull down menu.');
+
+}
+
+//#################################
+// Global entries for the <html> tag
+define('HTML_PARAMS','dir="LTR" lang="en"');
+
+// charset for web pages and emails
+define('CHARSET', 'iso-8859-1');
+
+// page title
+define('TITLE', STORE_NAME);
+
+// CCGV
+define('BOX_HEADING_GV_ADMIN', 'Vouchers/Coupons');
+define('BOX_GV_ADMIN_QUEUE', 'Gift Voucher Queue');
+define('BOX_GV_ADMIN_MAIL', 'Mail Gift Voucher');
+define('BOX_GV_ADMIN_SENT', 'Gift Vouchers sent');
+define('BOX_COUPON_ADMIN','Coupon Admin');
+define('BOX_GV_REPORT','Coupon Report');
+define('IMAGE_RELEASE', 'Redeem Gift Voucher');
+
+define('_JANUARY', 'January');
+define('_FEBRUARY', 'February');
+define('_MARCH', 'March');
+define('_APRIL', 'April');
+define('_MAY', 'May');
+define('_JUNE', 'June');
+define('_JULY', 'July');
+define('_AUGUST', 'August');
+define('_SEPTEMBER', 'September');
+define('_OCTOBER', 'October');
+define('_NOVEMBER', 'November');
+define('_DECEMBER', 'December');
+
+define('TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> gift vouchers)');
+define('TEXT_DISPLAY_NUMBER_OF_COUPONS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> coupons)');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Products ID');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+define('TEXT_VALID_PRODUCTS_MODEL', 'Products Model');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Category ID');
+define('TEXT_VALID_CATEGORIES_NAME', 'Category Name');
+
+// header text in includes/header.php
+define('HEADER_TITLE_TOP', 'Admin');
+define('HEADER_TITLE_SUPPORT_SITE', 'Support Site');
+define('HEADER_TITLE_ONLINE_CATALOG', 'Catalog');
+define('HEADER_TITLE_ADMINISTRATION', 'Admin');
+define('HEADER_TITLE_CHAINREACTION', 'Chainreactionweb');
+define('HEADER_TITLE_CRELOADED', 'CRE Loaded Project');
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('BOX_CATALOG_DEFINE_MAINPAGE', 'Define MainPage');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// text for gender
+define('MALE', 'Male');
+define('FEMALE', 'Female');
+
+// configuration box text in includes/boxes/configuration.php
+define('BOX_HEADING_CONFIGURATION', 'Configuration');
+define('BOX_CONFIGURATION_MYSTORE', 'My Store');
+define('BOX_CONFIGURATION_LOGGING', 'Logging');
+define('BOX_CONFIGURATION_CACHE', 'Cache');
+
+// added for super-friendly admin menu:
+define('BOX_CONFIGURATION_MIN_VALUES', 'Min Values');
+define('BOX_CONFIGURATION_MAX_VALUES', 'Max Values');
+define('BOX_CONFIGURATION_IMAGES', 'Image Configuration');
+define('BOX_CONFIGURATION_CUSTOMER_DETAILS', 'Customer Details');
+define('BOX_CONFIGURATION_SHIPPING', 'Default Shipping Settings');
+define('BOX_CONFIGURATION_PRODUCT_LISTING', 'Product Listing');
+define('BOX_CONFIGURATION_EMAIL', 'Email');
+define('BOX_CONFIGURATION_DOWNLOAD', 'Download Manager');
+define('BOX_CONFIGURATION_GZIP', 'GZip');
+define('BOX_CONFIGURATION_SESSIONS', 'Sessions');
+define('BOX_CONFIGURATION_STOCK', 'Stock Control');
+define('BOX_CONFIGURATION_WYSIWYG', 'WYSIWYG Editor 1.7');
+define('BOX_CONFIGURATION_AFFILIATE', 'Affiliate Program');
+define('BOX_CONFIGURATION_MAINT', 'Site Maintenance');
+define('BOX_CONFIGURATION_ACCOUNTS', 'Purchase Without Account');
+define('BOX_CONFIGURATION_CHECKOUT', 'Checkout Settings');
+define('BOX_CONFIGURATION_LINKS', 'Links Manager');
+
+// modules box text in includes/boxes/modules.php
+define('BOX_HEADING_MODULES', 'Modules');
+define('BOX_MODULES_PAYMENT', 'Payment');
+define('BOX_MODULES_SHIPPING', 'Shipping');
+define('BOX_MODULES_ORDER_TOTAL', 'Order Total');
+
+// categories box text in includes/boxes/catalog.php
+define('BOX_HEADING_CATALOG', 'Catalog');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS', 'Categories/Products');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES', 'Products Attributes');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_CATEGORY_OPTIONS', 'Products Categories Options');
+define('BOX_CATALOG_MANUFACTURERS', 'Manufacturers');
+define('BOX_CATALOG_REVIEWS', 'Reviews');
+define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Products Expected');
+define('BOX_CATALOG_EASYPOPULATE', 'Easy Populate');
+define('BOX_CATALOG_EASYPOPULATE_BASIC', 'Easy Populate Basic');
+define('BOX_CATALOG_SHOP_BY_PRICE', 'Shop by Price');
+// customers box text in includes/boxes/customers.php
+define('BOX_HEADING_CUSTOMERS', 'Customers/Orders');
+define('BOX_CUSTOMERS_CUSTOMERS', 'Customers');
+//added for Super-Friendly Admin Menu:
+define('BOX_CUSTOMERS_ORDERS', 'Orders');
+define('BOX_CUSTOMERS_EDIT_ORDERS', 'Edit Orders');
+//begin PayPal_Shopping_Cart_IPN
+define('BOX_CUSTOMERS_PAYPAL', 'PayPal IPN');
+define('BOX_ABANDONED_ORDERS', 'Abandoned Orders');
+define('BOX_CREATE_ACCOUNT', 'Create New Account');
+define('BOX_CREATE_ORDER', 'Create New Order');
+define('BOX_CREATE_ORDERS_ADMIN', 'Create Orders Admin');
+// taxes box text in includes/boxes/taxes.php
+define('BOX_HEADING_LOCATION_AND_TAXES', 'Locations/Taxes');
+define('BOX_TAXES_COUNTRIES', 'Countries');
+define('BOX_TAXES_ZONES', 'Zones');
+define('BOX_TAXES_GEO_ZONES', 'Tax Zones');
+define('BOX_TAXES_TAX_CLASSES', 'Tax Classes');
+define('BOX_TAXES_TAX_RATES', 'Tax Rates');
+
+// reports box text in includes/boxes/reports.php
+define('BOX_HEADING_REPORTS', 'Reports');
+define('BOX_REPORTS_PRODUCTS_VIEWED', 'Products Viewed');
+define('BOX_REPORTS_PRODUCTS_PURCHASED', 'Products Purchased');
+define('BOX_REPORTS_ORDERS_TOTAL', 'Customer Orders-Total');
+define('BOX_REPORTS_CUSTOMER_WISHLIST', 'Customer Wishlist');
+define('BOX_CUSTOMERS_MENU','Customer Menu');
+
+// tools text in includes/boxes/tools.php
+define('BOX_HEADING_TOOLS', 'Tools');
+define('BOX_TOOLS_BACKUP', 'Database Backup');
+define('BOX_TOOLS_BANNER_MANAGER', 'Banner Manager');
+define('BOX_TOOLS_CACHE', 'Cache Control');
+define('BOX_TOOLS_DEFINE_LANGUAGE', 'Language Editor');
+define('BOX_TOOLS_FILE_MANAGER', 'File Manager');
+define('BOX_TOOLS_MAIL', 'Send Email');
+define('BOX_TOOLS_NEWSLETTER_MANAGER', 'Newsletter Manager');
+define('BOX_TOOLS_SERVER_INFO', 'Server Info');
+define('BOX_TOOLS_WHOS_ONLINE', 'Who\'s Online');
+
+// BMC CC Mod Start
+define('BOX_TOOLS_BLACKLIST', 'Credit Card Blacklist');
+// BMC CC Mod End
+// localizaion box text in includes/boxes/localization.php
+define('BOX_HEADING_LOCALIZATION', 'Localization');
+define('BOX_LOCALIZATION_CURRENCIES', 'Currencies');
+define('BOX_LOCALIZATION_LANGUAGES', 'Languages');
+define('BOX_LOCALIZATION_ORDERS_STATUS', 'Orders Status');
+// header_tags_controller text in includes/boxes/header_tags_controller.php
+
+define('BOX_HEADING_HEADER_TAGS_CONTROLLER', 'Header Tags');
+define('BOX_HEADER_TAGS_ADD_A_PAGE', 'Page Control');
+define('BOX_HEADER_TAGS_ENGLISH', 'Text Control');
+define('BOX_HEADER_TAGS_FILL_TAGS', 'Fill Tags');
+
+// infobox box text in includes/boxes/info_boxes.php
+define('BOX_HEADING_DESIGN_CONTROLS', 'Design Controls');
+define('BOX_HEADING_DESIGN_TEMPLATE', 'Template');
+define('BOX_HEADING_TEMPLATE_CONFIGURATION', 'Template Configure');
+define('BOX_HEADING_TEMPLATE_MANAGEMENT', 'Template Admin');
+define('BOX_HEADING_TEMPLATE_MANAGEMENT1', 'New Manage Templates');
+define('BOX_HEADING_DESIGN_INFOBOX', 'Infobox');
+define('BOX_HEADING_BOXES', 'Infobox Admin');
+define('BOX_HEADING_BOXES_ADMIN', 'Infobox Configure');
+define('BOX_HEADING_DESIGN_BRANDING', 'Branding');
+define('BOX_HEADING_TEMPLATE_HEADER_TAGS','Header Tags');
+ 
+
+define('BOX_HEADING_DESIGN_LAYOUT', 'Layout');
+define('BOX_HEADING_DESIGN_PRODUCT_LISTING', 'Product Listing');
+define('BOX_HEADING_DESIGN_HOME_PAGE', 'Home Page');
+define('BOX_HEADING_DESIGN_INDEX_PAGE', 'Index Page');
+define('BOX_HEADING_DESIGN_PRODUCT_PAGE', 'Product Page');
+
+define('BOX_TEMPLATE_NAVMENU','Navigation Manager');
+
+
+// VJ Links Manager v1.00 begin
+// links manager box text in includes/boxes/links.php
+define('BOX_HEADING_LINKS', 'Links Manager');
+define('BOX_LINKS_LINKS', 'Links');
+define('BOX_LINKS_LINK_CATEGORIES', 'Link Categories');
+define('BOX_LINKS_LINKS_CONTACT', 'Links Contact');
+// VJ Links Manager v1.00 end
+
+// javascript messages
+define('JS_ERROR', 'Errors have occured during the process of your form!\nPlease make the following corrections:\n\n');
+
+define('JS_OPTIONS_VALUE_PRICE', '* The new product atribute needs a price value\n');
+define('JS_OPTIONS_VALUE_PRICE_PREFIX', '* The new product atribute needs a price prefix\n');
+
+define('JS_PRODUCTS_NAME', '* The new product needs a name\n');
+define('JS_PRODUCTS_DESCRIPTION', '* The new product needs a description\n');
+define('JS_PRODUCTS_PRICE', '* The new product needs a price value\n');
+define('JS_PRODUCTS_WEIGHT', '* The new product needs a weight value\n');
+define('JS_PRODUCTS_QUANTITY', '* The new product needs a quantity value\n');
+define('JS_PRODUCTS_MODEL', '* The new product needs a model value\n');
+define('JS_PRODUCTS_IMAGE', '* The new product needs an image value\n');
+
+define('JS_SPECIALS_PRODUCTS_PRICE', '* A new price for this product needs to be set\n');
+
+define('JS_GENDER', '* The \'Gender\' value must be chosen.\n');
+define('JS_FIRST_NAME', '* The \'First Name\' entry must have at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_LAST_NAME', '* The \'Last Name\' entry must have at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_DOB', '* The \'Date of Birth\' entry must be in the format: xx/xx/xxxx (month/date/year).\n');
+define('JS_EMAIL_ADDRESS', '* The \'E-Mail Address\' entry must have at least ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_ADDRESS', '* The \'Street Address\' entry must have at least ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_POST_CODE', '* The \'Post Code\' entry must have at least ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.\n');
+define('JS_CITY', '* The \'City\' entry must have at least ' . ENTRY_CITY_MIN_LENGTH . ' characters.\n');
+define('JS_STATE', '* The \'State\' entry is must be selected.\n');
+define('JS_STATE_SELECT', '-- Select Above --');
+define('JS_ZONE', '* The \'State\' entry must be selected from the list for this country.');
+define('JS_COUNTRY', '* The \'Country\' value must be chosen.\n');
+define('JS_TELEPHONE', '* The \'Telephone Number\' entry must have at least ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.\n');
+define('JS_PASSWORD', '* The \'Password\' amd \'Confirmation\' entries must match amd have at least ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.\n');
+
+define('JS_ORDER_DOES_NOT_EXIST', 'Order Number %s does not exist!');
+/* User Friendly Admin Menu */
+define('CATALOG_CATEGORIES', 'Categories');
+define('CATALOG_ATTRIBUTES', 'Product Attributes');
+define('CATALOG_REVIEWS', 'Product Reveiws');
+define('CATALOG_SPECIALS', 'Specials');
+define('CATALOG_EXPECTED', 'Products Expected');
+define('REPORTS_PRODUCTS_VIEWED', 'Veiwed Products');
+define('REPORTS_PRODUCTS_PURCHASED', 'Products Purchased');
+define('TOOLS_FILE_MANAGER', 'File Manager');
+define('TOOLS_CACHE', 'Cache Control');
+define('TOOLS_DEFINE_LANGUAGES', 'Define Languages');
+define('TOOLS_EMAIL', 'Email Customers');
+define('TOOLS_NEWSLETTER', 'Newsletters');
+define('TOOLS_SERVER_INFO', 'Server Info');
+define('TOOLS_WHOS_ONLINE', 'Who\'s Online');
+define('BOX_HEADING_GV', 'Coupon/Voucher');
+define('GV_COUPON_ADMIN', 'Discount Coupons');
+define('GV_EMAIL', 'Send Gift Voucher');
+define('GV_QUEUE', 'Gift Voucher Redeem');
+define('GV_SENT', 'Gift Voucher\'s Sent');
+define('BOX_GV_SENT', 'Gift Voucher\'s Sent');
+/* User Friedly Admin Menu */
+
+define('CATEGORY_PERSONAL', 'Your Personal Details');
+define('CATEGORY_ADDRESS', 'Your Address');
+define('CATEGORY_CONTACT', 'Your Contact Information');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Your Password');
+
+define('ENTRY_COMPANY', 'Company Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Gender:');
+define('ENTRY_GENDER_ERROR', 'Please select your Gender.');
+define('ENTRY_GENDER_TEXT', '*');
+define('ENTRY_FIRST_NAME', 'First Name:');
+define('ENTRY_FIRST_NAME_ERROR', 'Your First Name must contain a minimum of ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.');
+define('ENTRY_FIRST_NAME_TEXT', '*');
+define('ENTRY_LAST_NAME', 'Last Name:');
+define('ENTRY_LAST_NAME_ERROR', 'Your Last Name must contain a minimum of ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.');
+define('ENTRY_LAST_NAME_TEXT', '*');
+
+
+
+//define ENTRY_DATE_OF_BIRTH_TEXT and ENTRY_DATE_OF_BIRTH_ERROR
+// moved to UK/US section above
+define('ENTRY_DATE_OF_BIRTH', 'Date of Birth:');
+
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', 'Your E-Mail Address must contain a minimum of ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' characters.');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', 'Your E-Mail Address does not appear to be valid - please make any necessary corrections.');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', 'Your E-Mail Address already exists in our records - please log in with the e-mail address or create an account with a different address.');
+define('ENTRY_EMAIL_CHECK_ERROR', 'There has been an error with sending this email please! Contact the store owner.');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '*');
+define('ENTRY_STREET_ADDRESS', 'Street Address:');
+define('ENTRY_STREET_ADDRESS_ERROR', 'Your Street Address must contain a minimum of ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.');
+define('ENTRY_STREET_ADDRESS_TEXT', '*');
+
+
+// ENTRY_SUBURB, ENTRY_SUBURB_ERROR, ENTRY_SUBURB_TEXT move to us/uk
+//section above
+
+// ENTRY_POST_CODE, ENTRY_POST_CODE_ERROR
+//moved to us/uk section above
+define('ENTRY_POST_CODE_TEXT', '*');
+
+define('ENTRY_CITY', 'City:');
+define('ENTRY_CITY_ERROR', 'Your City must contain a minimum of ' . ENTRY_CITY_MIN_LENGTH . ' characters.');
+define('ENTRY_CITY_TEXT', '*');
+
+
+//define ENTRY_STATE, ENTRY_STATE_ERROR, ENTRY_STATE_ERROR_SELECT
+// see uk/us section above
+
+//GB format
+define('ENTRY_STATE_TEXT', '*');
+
+
+define('ENTRY_COUNTRY', 'Country:');
+define('ENTRY_COUNTRY_ERROR', 'You must select a country from the Countries pull down menu.');
+define('ENTRY_COUNTRY_TEXT', '*');
+define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', 'Your Telephone Number must contain a minimum of ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');
+define('ENTRY_FAX_NUMBER', 'Fax Number:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Subscribed');
+define('ENTRY_NEWSLETTER_NO', 'Unsubscribed');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_ERROR_NOT_MATCHING', 'The Password Confirmation must match your Password.');
+define('ENTRY_PASSWORD_TEXT', '*');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT', 'Current Password:');
+define('ENTRY_PASSWORD_CURRENT_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW', 'New Password:');
+define('ENTRY_PASSWORD_NEW_TEXT', '*');
+define('ENTRY_PASSWORD_NEW_ERROR', 'Your new Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING', 'The Password Confirmation must match your new Password.');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+define('FORM_REQUIRED_INFORMATION', '* Required information');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('CATEGORY_ORDER_DETAILS', 'Customer Details');
+define('ENTRY_CURRENCY', 'Customer Currency');
+
+// images
+define('IMAGE_ANI_SEND_EMAIL', 'Sending E-Mail');
+define('IMAGE_BACK', 'Back');
+define('IMAGE_BACKUP', 'Backup');
+define('IMAGE_CANCEL', 'Cancel');
+define('IMAGE_BUTTON_CONTINUE', 'Continue');
+define('IMAGE_CONFIRM', 'Confirm');
+define('IMAGE_COPY', 'Copy');
+define('IMAGE_COPY_TO', 'Copy To');
+define('IMAGE_DETAILS', 'Details');
+define('IMAGE_DELETE', 'Delete');
+define('IMAGE_EDIT', 'Edit');
+define('IMAGE_EDIT_STATUS', 'Edit Order Status');
+define('IMAGE_EDIT_ORDER', 'Edit Order');
+define('IMAGE_EDIT_LANG_DEFINE', 'Edit Language Defines');
+define('IMAGE_EMAIL', 'Email');
+define('IMAGE_FILE_MANAGER', 'File Manager');
+define('IMAGE_ICON_STATUS_GREEN', 'Active');
+define('IMAGE_ICON_STATUS_GREEN_LIGHT', 'Set Active');
+define('IMAGE_ICON_STATUS_RED', 'Inactive');
+define('IMAGE_ICON_STATUS_RED_LIGHT', 'Set Inactive');
+define('IMAGE_ICON_INFO', 'Info');
+define('IMAGE_INSERT', 'Insert');
+define('IMAGE_LOCK', 'Lock');
+define('IMAGE_MODULE_INSTALL', 'Install Module');
+define('IMAGE_MODULE_REMOVE', 'Remove Module');
+define('IMAGE_MOVE', 'Move');
+define('IMAGE_NEW_BANNER', 'New Banner');
+define('IMAGE_NEW_CATEGORY', 'New Category');
+define('IMAGE_NEW_COUNTRY', 'New Country');
+define('IMAGE_NEW_CURRENCY', 'New Currency');
+define('IMAGE_NEW_FILE', 'New File');
+define('IMAGE_NEW_FOLDER', 'New Folder');
+define('IMAGE_NEW_LANGUAGE', 'New Language');
+define('IMAGE_NEW_NEWSLETTER', 'New Newsletter');
+define('IMAGE_NEW_PRODUCT', 'New Product');
+define('IMAGE_NEW_SALE', 'New Sale');
+define('IMAGE_NEW_TAX_CLASS', 'New Tax Class');
+define('IMAGE_NEW_TAX_RATE', 'New Tax Rate');
+define('IMAGE_NEW_TAX_ZONE', 'New Tax Zone');
+define('IMAGE_NEW_ZONE', 'New Zone');
+define('IMAGE_ORDERS', 'Orders');
+define('IMAGE_ORDERS_INVOICE', 'Invoice');
+define('IMAGE_ORDERS_PACKINGSLIP', 'Packing Slip');
+define('IMAGE_PREVIEW', 'Preview');
+define('IMAGE_RESTORE', 'Restore');
+define('IMAGE_RESET', 'Reset');
+define('IMAGE_SAVE', 'Save');
+define('IMAGE_SEARCH', 'Search');
+define('IMAGE_SELECT', 'Select');
+define('IMAGE_SEND', 'Send');
+define('IMAGE_SEND_EMAIL', 'Send Email');
+define('IMAGE_UNLOCK', 'Unlock');
+define('IMAGE_UPDATE', 'Update');
+define('IMAGE_UPDATE_CURRENCIES', 'Update Exchange Rate');
+define('IMAGE_UPLOAD', 'Upload');
+
+define('ICON_CROSS', 'False');
+define('ICON_CURRENT_FOLDER', 'Current Folder');
+define('ICON_DELETE', 'Delete');
+//added for quick product edit DMG
+define('ICON_EDIT','Edit');
+define('ICON_ERROR', 'Error');
+define('ICON_FILE', 'File');
+define('ICON_FILE_DOWNLOAD', 'Download');
+define('ICON_FOLDER', 'Folder');
+define('ICON_LOCKED', 'Locked');
+define('ICON_PREVIOUS_LEVEL', 'Previous Level');
+define('ICON_PREVIEW', 'Preview');
+define('ICON_STATISTICS', 'Statistics');
+define('ICON_SUCCESS', 'Success');
+define('ICON_TICK', 'True');
+define('ICON_UNLOCKED', 'Unlocked');
+define('ICON_WARNING', 'Warning');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_RESULT_PAGE', 'Page %s of %d');
+define('TEXT_DISPLAY_NUMBER_OF_BANNERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> banners)');
+define('TEXT_DISPLAY_NUMBER_OF_COUNTRIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> countries)');
+define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> customers)');
+define('TEXT_DISPLAY_NUMBER_OF_CURRENCIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> currencies)');
+define('TEXT_DISPLAY_NUMBER_OF_LANGUAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> languages)');
+define('TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> manufacturers)');
+define('TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> newsletters)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> orders)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS_STATUS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> orders status)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> products)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_EXPECTED', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> products expected)');
+define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> product reviews)');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> sales)');
+define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> products on special)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax classes)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_ZONES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax zones)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tax rates)');
+define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> zones)');
+
+define('PREVNEXT_BUTTON_PREV', '&lt;&lt;');
+define('PREVNEXT_BUTTON_NEXT', '&gt;&gt;');
+
+define('TEXT_DEFAULT', 'Site default');
+define('TEXT_SET_DEFAULT', 'Set as sites default');
+define('TEXT_FIELD_REQUIRED', '&nbsp;<span class="fieldRequired">* Required</span>');
+
+define('ERROR_NO_DEFAULT_CURRENCY_DEFINED', 'Error: There is currently no default currency set. Please set one at: Administration Tool->Localization->Currencies');
+
+define('TEXT_NONE', '--none--');
+define('TEXT_TOP', 'Top');
+
+define('ERROR_DESTINATION_DOES_NOT_EXIST', 'Error: Destination does not exist.');
+define('ERROR_DESTINATION_NOT_WRITEABLE', 'Error: Destination not writeable.');
+define('ERROR_FILE_NOT_SAVED', 'Error: File upload not saved.');
+define('ERROR_FILETYPE_NOT_ALLOWED', 'Error: File upload type not allowed.');
+define('SUCCESS_FILE_SAVED_SUCCESSFULLY', 'Success: File upload saved successfully.');
+define('WARNING_NO_FILE_UPLOADED', 'Warning: No file uploaded.');
+define('WARNING_FILE_UPLOADS_DISABLED', 'Warning: File uploads are disabled in the php.ini configuration file.');
+define('TEXT_DISPLAY_NUMBER_OF_PAYPALIPN_TRANSACTIONS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> transactions)'); // PAYPALIPN
+define('ERROR_TEP_MAIL', '<font face="Verdana, Arial" size="2" color="#ff0000"><b><small>TEP ERROR:</small> Cannot send the email through the specified SMTP server. Please check your php.ini setting and correct the SMTP server if necessary.</b></font>');
+define('WARNING_INSTALL_DIRECTORY_EXISTS', 'Warning: Installation directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install. Please remove this directory for security reasons.');
+define('WARNING_UPGRADES_DIRECTORY_EXISTS', 'Warning: Upgrades directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/upgrades. Please remove this directory for security reasons.');
+define('WARNING_CONFIG_FILE_WRITEABLE', 'Warning: I am able to write to the configuration file: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
+define('WARNING_CONFIG_FILE_WRITEABLE_CATALOG', 'Warning: I am able to write to the configuration file: ' . DIR_FS_CATALOG . 'includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
+define('WARNING_SESSION_DIRECTORY_NON_EXISTENT', 'Warning: The sessions directory does not exist: ' . tep_session_save_path() . '. Sessions will not work until this directory is created.');
+define('WARNING_SESSION_DIRECTORY_NOT_WRITEABLE', 'Warning: I am not able to write to the sessions directory: ' . tep_session_save_path() . '. Sessions will not work until the right user permissions are set.');
+define('WARNING_SESSION_AUTO_START', 'Warning: session.auto_start is enabled - please disable this php feature in php.ini and restart the web server.');
+define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Warning: The downloadable products directory does not exist: ' . DIR_FS_CATALOG . 'download/' . '. Downloadable products will not work until this directory is valid.');
+define('WARNING_ENCRYPT_FILE_MISSING', 'Warning: The Encryption key file is missing.');
+define('WARNING_TMP_DIRECTORY_NON_EXISTENT', 'Warning: The /tmp is not writable: ' . DIR_FS_CATALOG . 'tmp/' . '. The page cacheing will not work until this directory is writable.');
+
+
+define('BOX_HEADING_PAYPALIPN_ADMIN', 'Paypal IPN'); // PAYPALIPN
+define('BOX_PAYPALIPN_ADMIN_TRANSACTIONS', 'Transactions'); // PAYPALIPN
+define('BOX_PAYPALIPN_ADMIN_TESTS', 'Send Test IPN'); // PAYPALIPN
+define('BOX_CATALOG_XSELL_PRODUCTS', 'Cross Sell Products'); // X-Sell
+
+define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 01 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 01 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_INVALID_MONTH', 'Error: 02 The expiry date Motnth entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_YEAR', 'Error: 03 The expiry date year entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Error: 04 The expiry date entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Error: 05 The credit card number entered is invalid. Please check the number for misstyped numbers and try again.');
+define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'Error: 06 The first four digits of the number entered are: %s If that number is correct, we do not accept that type of credit card.If it is wrong, please try again.');
+define('TEXT_CCVAL_ERROR_NOT_ACCEPTED', 'Error: 07 The credit card number you have entered appears to be a %s card. Unfortunately at this time we do not accept %s as payment.');
+define('TEXT_CCVAL_ERROR_BLACKLIST', 'Error: 08 We cannot accept your card as it is blacklisted, if you feel you have recieved this message in error please contact your card issuer.');
+define('TEXT_CCVAL_ERROR_SHORT', 'Error: 09 You have not entered the correct amount of digits. Please ensure you have entered all of the long number displayed on the front of your card');
+define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'Error: 10 The CCV/CVV/CID number entered is the incorrect length. Please try again.');
+REQUIRE(DIR_WS_LANGUAGES . 'add_ccgvdc_english.php');
+
+define('IMAGE_BUTTON_PRINT_ORDER', 'Order Printable');
+
+// BOF: Lango Added for print order MOD
+define('IMAGE_BUTTON_PRINT', 'Print');
+// EOF: Lango Added for print order MOD
+
+// BOF: Lango Added for Featured product MOD
+  define('BOX_CATALOG_FEATURED', 'Featured Products');
+// EOF: Lango Added for Featured product MOD
+
+// BOF: Lango Added for Sales Stats MOD
+define('BOX_REPORTS_MONTHLY_SALES', 'Monthly Sales/Tax');
+// EOF: Lango Added for Sales Stats MOD
+
+// BOF: Lango Added for template MOD
+// WebMakers.com Added: Attribute Sorter, Copier and Catalog additions
+require(DIR_WS_LANGUAGES . $language . '/' . 'attributes_sorter.php');
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  define('BOX_HEADING_INFORMATION', 'Content Manager');
+  define('BOX_INFORMATION_MANAGER', 'Info Manager');
+//DWD Modify End
+
+include('includes/languages/order_edit_english.php');
+
+ define('BOX_TITLE_CRELOADED', 'CRE Loaded Project');
+ define('LINK_CRE_FORUMS','CRE Loaded Forums');
+ define('LINK_CRW_SUPPORT','Technical Support');
+// General Release Edition
+ define('LINK_SF_CRELOADED','Source Forge Home');
+ define('LINK_SF_BUGTRACKER','Bug Tracker');
+ define('LINK_SF_SUPPORT','Support Request');
+ define('LINK_SF_TASK','Task Tracker');
+ define('LINK_SF_CVS','Browse CVS');
+ define('LINK_CRE_FILES','CRE Downloads');
+ define('LINK_SF_FEATURE','Feature Request');
+//included for Backup mySQL (courtesy Zen-Cart Team) DMG
+ define('BOX_TOOLS_MYSQL_BACKUP','Backup mySQL');
+//included for Orderlist 3.1 report DMG
+ define('BOX_REPORTS_ORDERLIST', 'Generate orderlist');
+
+// Included for Events Calendar 2.0 DMG
+define('IMAGE_NEW_EVENT', 'New Event');
+
+// VJ member approval added
+define('BOX_CUSTOMERS_APPROVAL', 'Waiting Approval');
+
+// DMG Sales Report 2
+  define('BOX_REPORTS_SALES_REPORT2', 'SalesReport2');
+  
+// DMG Zipcode Matching
+  define('BOX_REPORTS_ZIPCODE_MATCH','Customer Zip/State Mismatch');
+  
+//DMG FAQ System 2.1
+  define('BOX_HEADING_FAQ', 'FAQ System');
+  define('BOX_FAQ_MANAGER', 'FAQ Manager');
+  define('BOX_FAQ_CATEGORIES', 'FAQ Categories');
+  define('BOX_FAQ_VIEW', 'FAQ View');
+  define('BOX_FAQ_VIEW_ALL', 'FAQ View All');
+  
+  
+// DMG Article Manager
+define('BOX_HEADING_ARTICLES', 'Article Manager');
+define('BOX_TOPICS_ARTICLES', 'Topics/Articles');
+define('BOX_ARTICLES_CONFIG', 'Configuration');
+define('BOX_ARTICLES_AUTHORS', 'Authors');
+define('BOX_ARTICLES_REVIEWS', 'Article Reviews');
+define('BOX_ARTICLES_XSELL', 'Cross-Sell Articles');
+define('IMAGE_NEW_TOPIC', 'New Topic');
+define('IMAGE_NEW_ARTICLE', 'New Article');
+define('TEXT_DISPLAY_NUMBER_OF_AUTHORS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> authors)');
+define('IMAGE_NEW_AUTHOR', 'New Author');
+define('TEXT_WARNING_NO_AUTHORS', 'WARNING:  Empty Authors Table!&nbsp;&nbsp;You MUST add at least one Author before you will be able to add any Articles');
+
+// Article Statistics Report DMG
+  define('BOX_REPORTS_ARTICLES_VIEWED', 'Articles Viewed');
+  define('TEXT_DISPLAY_NUMBER_OF_ARTICLES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> products)');
+  
+// DMG :  Mulitple Products Manager
+
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_MULTI', 'Multiple Products Manager');
+
+
+// DMG : Specials by Category
+
+
+
+// START: Product Extra Fields DMG
+  define('BOX_CATALOG_PRODUCTS_EXTRA_FIELDS', 'Product Extra Fields');
+// END: Product Extra Fields DMG
+
+// Customers Order Reports DMG
+
+define('BOX_REPORTS_CUSTOMERS_ORDERS', 'Customer Statistics');
+
+// Daily Sales Products reports  DMG
+define('BOX_REPORTS_DAILY_PRODUCTS_ORDERS', 'Daily Products Report');
+
+// Contact US Email Subject DMG
+define('BOX_TOOLS_EMAIL_SUBJECTS', 'Email Subjects');
+define('TEXT_DISPLAY_NUMBER_OF_EMAIL_SUBJECTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> email subjects)');
+
+define('BOX_REPORTS_EXPLAIN','osC Explain Queries');
+ 
+//define('BOX_HEADING_CRYPT', 'Encryption and Decryption'); 
+define('BOX_HEADING_CRYPT', 'Encrypt & Decrypt');
+define('BOX_CRYPT_CONFIGURATION', 'Configuration'); 
+define('BOX_CRYPT_TEST', 'Test'); 
+define('BOX_CRYPT_CC_DATA', 'CC Data'); 
+define('BOX_CRYPT_CONVERT', '&nbsp; Convert CC Data');
+define('BOX_CRYPT_PURGE', 'Purge CC Data');
+define('BOX_CRYPT_UPDATE', 'Update CC Data');
+define('BOX_CRYPT_KEYS', 'Manage Keys');
+define('BOX_CRYPT_HELP', 'Help');
+
+define('IMAGE_CONVERT', 'Convert info to new key');
+define('IMAGE_ENCRYPT', 'Encrypt data');
+define('IMAGE_DECRYPT', 'Decrypt data');
+define('IMAGE_RETURN', 'Return to main');
+define('IMAGE_EDIT_KEY', 'Edit Key File');
+define('IMAGE_CREATE', 'Create key');
+define('IMAGE_HELP', 'Help');
+define('IMAGE_RUN', 'Run');
+  define('BOX_DATA_EASYPOPULATE_BASIC', 'Easy Populate Basic');
+  define('BOX_DATA_EASYPOPULATE', 'Easy Populate Advance');
+  define('BOX_DATA_EASYPOPULATE_EXPORT', 'EPA Export');
+  define('BOX_DATA_EASYPOPULATE_IMPORT', 'EPA Import');
+  define('BOX_DATA_EASYPOPULATE_BASIC_EXPORT', 'EPB Export');
+  define('BOX_DATA_EASYPOPULATE_BASIC_IMPORT', 'EPB Import');
+  define('BOX_DATA_EASYPOPULATE_OPTIONS_EXPORT', 'Options Export');
+  define('BOX_DATA_EASYPOPULATE_OPTIONS_IMPORT', 'Options Import');
+  define('BOX_HEADING_DATA', 'Data Manager');
+  define('BOX_DATA', 'Data Feeds');
+  define('BOX_DATA_ADMIN', 'Data Configure');
+  define('BOX_HEADING_FEEDERS', 'Feeder Systems');
+  define('BOX_DATA_HELP', 'Data Help');
+  define('BOX_FEEDERS_AMAZON', 'Amazon Marketplace');
+  define('BOX_FEEDERS_BIZRATE', 'Biz Rate');
+  define('BOX_FEEDERS_FROOGLE', 'Froogle');
+  define('BOX_FEEDERS_MYSIMON', 'MySimon');
+  define('BOX_FEEDERS_PRICE_GRABBER', 'Price Grabber');
+  define('BOX_FEEDERS_SHOPPING', 'Shopping.com');
+  define('BOX_FEEDERS_YAHOO', 'Yahoo');
+
+define('BOX_HEADING_DOC', 'Documentation');
+define('BOX_DOC_ADMIN', 'Admin');
+define('BOX_DOC_CAT', 'Catalog');
+define('BOX_DOC_MISC', 'Miscellaneous');
+
+
+
+// Eversun mod for sppc and qty price breaks
+define('ENTRY_CUSTOMERS_GROUP_NAME', 'Customer Group:');
+define('BOX_CUSTOMERS_GROUPS', 'Customers Groups');
+define('ENTRY_COMPANY_TAX_ID', 'Company\'s tax id number:');
+define('ENTRY_COMPANY_TAX_ID_ERROR', '');
+define('ENTRY_CUSTOMERS_GROUP_REQUEST_AUTHENTICATION', 'Switch off alert for authentication:');
+define('ENTRY_CUSTOMERS_GROUP_RA_NO', 'Alert off');
+define('ENTRY_CUSTOMERS_GROUP_RA_YES', 'Alert on');
+define('ENTRY_CUSTOMERS_GROUP_RA_ERROR', '');
+// Eversun mod end for sppc and qty price breaks
+// DMG Mod for Customer Notification Report
+define('BOX_REPORTS_PRODUCTS_NOTIFICATIONS', 'Prod Notifications');//Products Notifications V3
+
+define('FOOTER_TEXT_BODY', 'Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a> and <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Using Version ' . PROJECT_VERSION);
+
+// VJ infosystem begin
+define('BOX_HEADING_PAGE_MANAGER', 'Page Manager');
+define('BOX_PAGES', 'Pages');
+define('BOX_PAGES_CATEGORIES', 'Categories');
+// VJ infosystem end
+
+define('BOX_SHIPWIRE', 'ShipWire');
+define('BOX_MODULES_CHECKOUT_SUCCESS', 'Checkout Success');
+
+define('BOX_HEADING_TECH_SUPPORT','Tech Support');
+define('BOX_HEADING_INSTALL_EXPLAIN','Explain Quires');
+define('IMAGE_BUTTON_BACK','Back');
+define('IMAGE_BUTTON_CONFIRM','Confirm');
+
+if(file_exists('includes/languages/english_newsdesk.php')) {
+include('includes/languages/english_newsdesk.php');
+include('includes/languages/english_faqdesk.php');
+}
+
+//coupons redeemed report
+define('BOX_REPORTS_COUPONS_REDEEMED','Coupons Redeemed');
+
+define("PAYPAL_HELP_CONFIGURATION_GUIDE","Configuration Guide");
+define("PAYPAL_HELP_FREQUENTLY_ASKED_QUESTIONS","Frequently Asked Questions");
+define("PAYPAL_CONTENTS","Contents");
+define("PAYPAL_HELP_CONTENTS1","The following is a guide towards configuring your store's PayPal payment module settings:");
+
+define("PAYPAL_HELP_CONTENTS2",'<ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">Enable PayPal Module</b><br />Since you have just done the installation, by default it will say yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">E-Mail Address</b><br />Enter your Primary PayPal email address here, if you have more than one email address registered with PayPal then you must login your PayPal account to determine which one is your <b>Primary</b> email address.</li><br /><br class="h6" />
+      <li><b class="ppem380">Business ID</b><br />If you have configured a secondary email address to be your Business ID (email address) in your PayPal profile account, then enter this here, otherwise enter the one used above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Transaction Currency</b><br />Choose which currencies you want to accept PayPal payments with.</li><br /><br class="h6" />
+      <li><b class="ppem380">Payment Zone</b><br />If a zone is selected, only enable this payment method for that zone.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Pending Notification</b> Order Status</b><br />Set the Pending Notification status of orders made with this payment module to this value, \'<b style="color:blue">Pending</b>\' is suggested or alternatively the optional order status created in step 4 above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Order</b> Status</b><br />Set the status of orders made with this payment module to this value <b style="color:red">Do not set it to \'default\' but specifically choose the status required</b>, \'<b style="color:blue">Processing</b>\' is suggested.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>On Hold Order</b> Status</b><br />This order status is used when the Cart Test has failed, eg. the expected payment amount did not match.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Canceled Order</b> Status</b><br />Refunded, Reversed, Failed or Denied payments will be set to this order status.</li><br /><br class="h6" />
+      <li><b class="ppem380">Synchronize Invoice</b><br />Specify whether the osCommerce order number should be used as a <b>unique</b> PayPal invoice number, similiar to PayPal\'s Send Money feature, this will enable customers to resume an order via their osCommerce account history info page for that order for pending transactions which were not previously completed.</li><br /><br class="h6" />
+      <li><b class="ppem380">Sort order of display</b><br />Sort order of display. Lowest is displayed first.</li><br /><br class="h6" />
+      <li><b class="ppem380">Background Color</b><br />Select the background color of PayPal\'s payment pages, either black or white.</li><br /><br class="h6" />
+      <li><b class="ppem380">Processing logo</b><br />Specify the image file name to be used in the store\'s checkout process splash page, must be located in <code>catalog/images</code> directory.</li><br /><br class="h6" />
+      <li><b class="ppem380">Store logo</b><br />Specify the image file name for PayPal to display on their payment pages pages, must be located in <code>catalog/images</code> directory. If you do not have SSL then leave this field blank.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Page Style Name</b><br />Specify the name of the page style you have configured in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">Include a note with payment</b><br />When a customer arrives at the PayPal payment page you can choose whether or not to show them another note field which will have seperate contents from that of the one provided in your store\'s checkout process but will be included in PayPal\'s invoice and receipt.<br />To change the title appearing above this field on the PayPal payment page look in the corresponding catalog langauge file (<code>catalog/includes/langauges/english/modules/payment/paypal.php</code>).</li><br /><br class="h6" />
+      <li><b class="ppem380">Shopping Cart Method</b><br />Choose which type of PayPal Shopping Cart you want to use, Aggregate simply means the total amount is passed (with a list of the products shown in a single item field), whereas an Itemized Cart will list indivudally all the items the customer has selected in their PayPal invoice.</li><br /><br class="h6" />
+      <li><b class="ppem380">Enable PayPal Shipping Address</b><br />Allow the customer to choose their own PayPal shipping address. (See <a href="'.tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL') .'">FAQ\'s</a> for more info)</li><br /><br class="h6" />
+      <li><b class="ppem380">Digest Key</b><br />Specify a unique digest key, this will then be used similiar to a password while testing via the IPN Test Panel <b>and</b> also the store\'s PayPal transaction signature digest key.</li><br /><br class="h6" />
+      <li><b class="ppem380">Test Mode</b><br />This should be off for live environments.<br />You can simulate your own IPNs via the <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp') .'">IPN Test Panel</a>.</li><br /><br class="h6" />
+      <li><b class="ppem380">Cart Test</b><br />This test verifies that the amount received via PayPal matches to what is expected (See <a href="'. tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL').'">FAQ\'s</a> for more info).</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notifications</b><br />Choose whether you want to receive debug emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notification Address</b><br />Enter a seperate email address where you wish to receive <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Domain</b><br />This must be set to <b>paypal.com</b> for live production environments, this setting is to facilate PayPal\'s sandbox and is not related to the IPN Test Panel or the above Test Mode option.</li><br /><br class="h6" />
+      <li><b class="ppem380">Return URL behavior</b><br />This determines what method PayPal should use when returning the customer back to the store, leave this set to 1 (GET).</li><br /><br class="h6" />
+    </ul>');
+
+
+
+define("PAYPAL_FAQ_CONTENTS1","The following are some frequently asked questions about this payment module:");
+
+define("PAYPAL_FAQ_CONTENTS2",'<ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">My shipping costs are different once the customer arrives at the PayPal site.</b></legend><div>In your PayPal account profile in the shipping section, check the box that allows overriding the shipping costs.</li><br /><br class="h6" />
+      <li><b class="ppem380">Do I need to enable IPN in my PayPal account profile.</b><br />No.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the IPN feature to be used.</b><br />You don\'t need to, it will automatically be specified.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why doesn\'t the Auto-Return feature work.</b><br />You must enable it first in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the Auto-Return feature.</b><br />It doesn\'t matter, this contribution will automatically specify the correct script url location, which is now <code>catalog/checkout_success.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Does this contribution support PayPal Credit Card payments.</b><br />Yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I getting so many emails per transaction.</b><br />You get <b>one</b> from PayPal and <b>one</b> osCommerce order confirmation email, and another which is the <b>debug email</b>, either disable <b>debug</b> email notification or specify a sperate email address for <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I not receiving any IPNs.</b><br />You must ensure that your <b>Primary Email Address</b> and <b>Business ID</b> are configured correctly.<br />Login to your PayPal Account and see what and how many email addresses you are using and which one is the Primary address.<br />Also check your debug emails as it will also specify the Primary Email Address of the intended receiver.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m having problems with Multi-Currencies.</b><br />This problem should now be resolved, previously the <b>Cart Test</b> was comparing the currency and amounts of the actual order to what PayPal received as opposed to actually comparing the currency and amounts prior to transfering the customer to PayPal.<br /><br /><b>However</b>, if you\'re using the Itemized Shopping Cart then discrepancies may arise due to PayPal\'s two decimal place calculations, in such an event the order will be placed on hold. Although this type of discrepancy may not affect all orders it does however exist and now adds a future requirement to enable you to finalize the transaction via your store\'s admin.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m having problems verifying the Cart Totals.</b><br />See above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why is there no PayPal shipping address details in the IPN info?</b><br />Set Enable PayPal Shipping Address to \'No\' if you require a PayPal verified shipping address or set to \'Yes\' if you do not.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can I customize the Checkout redirect page.</b><br />The splash template page shown while transfering the customer to PayPal is:<br /><code>catalog/includes/modules/payment/paypal/catalog/checkout_splash.inc.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find more PayPal logo buttons.</b><br />Login to your PayPal account and click Merchant Tools or Auction Tools.</li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find PayPal documentation.</b><br /><ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;"><li><a href="https://www.paypal.com/en_US/pdf/integration_guide.pdf">PayPal Integration Manual</a></li></ul></li><br /><br class="h6" />
+
+      <li><b class="ppem380">How do I use PayPal\'s Sandbox.</b>
+        <ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;">
+          <li>Register with <a href="https://developer.paypal.com/" target="PPDC">PayPal Developer Central</a></li><br class="h6" />
+          <li>Then create <b>two virtual accounts</b> types:<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Personal Account</li><li>Premier or Business Account</li></ul></li><br class="h6" />
+          <li>Confirm both accounts (each is just a single click option).</li><br class="h6" />
+          <li>Transfer some virtual money into your personal account (Click the add funds link).</li><br class="h6" />
+          <li>Emails to both accounts will appear in the section where you initially login into the PayPal Developer Central, no real emails are sent so the email addresses for your virtual accounts should be fictitious.</li><br class="h6" />
+          <li>Now in your <a href="'. tep_href_link(FILENAME_MODULES,'set=payment&module=paypal&action=edit').'" target="_blank">osCommerce::Admin::Modules::Payment::PayPal</a> configuration section<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Enter the virtual business account email address into both the Primary Email Address and Business ID fields</li><li>Set the domain to www.sandbox.paypal.com</li></ul></li><br class="h6" />
+          <li>Now checkout as a customer via the store, this account should have a real email address (so that you can receive the osC customer order confirmation email), and when you arrive at the PayPal Sandbox site (look for their logo) then login using the virtual personal account details and finalize the payment process.</li>
+        </ul>
+       <br /><p class="ppsmallerrorbold">Note that you must first login via the PayPal Developer Central prior to testing the Sandbox/Checkout process.</p>
+      </li><br /><br class="h6" />
+
+      <li><b class="ppem380">What\'s the difference between the IPN Test Panel and using PayPal\'s Sandbox.</b><br />The <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp').'" target="itp">IPN Test Panel</a> is an independent osCommerce Contribution feature, for testing and development purposes, which allows you to simmulate your own IPNs without having to interact with PayPal.<br /><br /><p class="ppsmallerrorbold">All Test IPNs via the IPN Test Panel will be invalid according to PayPal since they\'re not authentic transactions.</p></li><br /><br class="h6" />
+      <li><b class="ppem380">Is the IPN Test Panel related to PayPal\'s Sandbox.</b><br />No, see above.</li><br /><br class="h6" />
+      <li><b class="ppem380">What\'s the purpose of the digest key.</b><br />Currently the digest key serves two purposes, it authenticates and allows you to use the <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp').'" target="itp">IPN Test Panel</a>, secondly, untill such time that PayPal provides a secure method of associating an IPN specifically to a particular order, it serves as a unique transaction signature identifier.</li><br /><br class="h6" />
+      <li><b class="ppem380">Should I change the digest key default value.</b><br />Yes, but remember what it is if uninstalling and reinstalling this contrib payment module in the admin since there might be existing pending orders which will require it in order to associate with to their corresponding IPN(s).</li><br /><br class="h6" />
+      <li><b class="ppem380">How are IPNs deleted.</b><br />Currently, an IPN appearing the admin section is deleted automatically when deleting it\'s corresponding order.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can a customer resume their order.</b><br />Currently, if the customer abandons the checkout process at the PayPal site, e.g for some reason they did not actually pay at that time, then they can log into their osCommerce account and click the confirm order button when viewing the details of that particular order in their account_history_info.<br /><br />This feature is only available when <b>synchronizing invoices</b> with PayPal.<br /><br />This means that if you ever reset the osCommerce <code>orders</code> database table then you must also update it\'s auto-increment value to be greater than the last known <code>order_id</code>.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m getting errors after installing the contribution.</b><br />First, go through the installation edits and remove any blank spaces at the beginning of the line(s), some text editors will insert hidden characters which is a side effect of copying and pasting from HTML documentation.<br />Make sure that the alterations have been performed as well as running the paypal_ipn.sql script.</li><br /><br class="h6" />
+
+      <li><b class="ppem380">What type of PayPal account do I need.</b><br />You will need either a Premier or Merchant Business Account. <a href="https://www.paypal.com/refer/pal=PS2X9Q773CKG4" target="_blank">Click&nbsp;here&nbsp;to&nbsp;register&nbsp;for&nbsp;an&nbsp;account</a> if you do not already have one.</li><br /><br class="h6" />
+    </ul>');
+
+
+
+define("PAYPAL_IPN_TEST_MODE1","Test Mode must be enabled!");
+define("PAYPAL_IPN_TEST_MODE_ADVANCED","Advanced");
+define("PAYPAL_IPN_TEST_MODE_HELP_WITH_THIS_PAGE","Help with this page");
+define("PAYPAL_IPN_TEST_MODE_PRIMARY_PAYPAL_EMAIL_ADDRESS","Primary PayPal Email Address");
+define("PAYPAL_IPN_TEST_MODE_BUSINESS_ID","Business ID");
+define("PAYPAL_IPN_TEST_MODE_DEBUG_EMAIL_ADDRESS","Debug Email Address");
+
+define("PAYPAL_IPN_TEST_MODE_FIRST_NAME","First Name");
+define("PAYPAL_IPN_TEST_MODE_LAST_NAME","Last Name");
+define("PAYPAL_IPN_TEST_MODE_BUSINESS_NAME","Business Name");
+define("PAYPAL_IPN_TEST_MODE_EMAIL_ADDRESS","Email Address");
+define("PAYPAL_IPN_TEST_MODE_PAYER_ID","Payer ID");
+define("PAYPAL_IPN_TEST_MODE_PAYER_STATUS","Payer Status");
+define("PAYPAL_IPN_TEST_MODE_VERIFIED","verified");
+define("PAYPAL_IPN_TEST_MODE_UNVERIFIED","unverified");
+define("PAYPAL_IPN_TEST_MODE_INVOICE","Invoice");
+
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_NAME","Address Name");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STREET","Address Street");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_CITY","Address City");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STATE","Address State");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_ZIP","Address Zip");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_COUNTRY","Address Country");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STATUS","Address Status");
+define("PAYPAL_IPN_TEST_MODE_CONFIRMED","confirmed");
+define("PAYPAL_IPN_TEST_MODE_UNCONFIRMED","unconfirmed");
+
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_TYPE","Payment Type");
+define("PAYPAL_IPN_TEST_MODE_INSTANT","instant");
+define("PAYPAL_IPN_TEST_MODE_ECHECK","echeck");
+define("PAYPAL_IPN_TEST_MODE_TRANSACTION_TYPE","Transaction Type");
+define("PAYPAL_IPN_TEST_MODE_SELECT","--select--");
+define("PAYPAL_IPN_TEST_MODE_CART","cart");
+define("PAYPAL_IPN_TEST_MODE_WEB_ACCEPT","web_accept");
+define("PAYPAL_IPN_TEST_MODE_SEND_MONEY","send_money");
+define("PAYPAL_IPN_TEST_MODE_CUSTOM","Custom");
+define("PAYPAL_IPN_TEST_MODE_TRANSACTION_ID","Transaction ID");
+define("PAYPAL_IPN_TEST_MODE_PARENT_TRANSACTION_ID","Parent Transaction ID");
+define("PAYPAL_IPN_TEST_MODE_NO_CART_ITEMS","No. Cart Items");
+define("PAYPAL_IPN_TEST_MODE_NOTIFY_VERSION","Notify Version");
+define("PAYPAL_IPN_TEST_MODE_NOTIFY_VERSION_VALUE","1.6");
+define("PAYPAL_IPN_TEST_MODE_MEMO","Memo");
+
+define("PAYPAL_IPN_TEST_MODE_MC_CURRENCY","MC Currency");
+define("PAYPAL_IPN_TEST_MODE_USD","USD");
+define("PAYPAL_IPN_TEST_MODE_GBP","GBP");
+define("PAYPAL_IPN_TEST_MODE_EUR","EUR");
+define("PAYPAL_IPN_TEST_MODE_CAD","CAD");
+define("PAYPAL_IPN_TEST_MODE_JPY","JPY");
+define("PAYPAL_IPN_TEST_MODE_MC_GROSS","MC Gross");
+define("PAYPAL_IPN_TEST_MODE_MC_FEE","MC Fee");
+
+define("PAYPAL_IPN_TEST_MODE_SETTLE_AMOUNT","Settle Amount");
+define("PAYPAL_IPN_TEST_MODE_SETTLE_CURRENCY","Settle Currency");
+define("PAYPAL_IPN_TEST_MODE_EXCHANGE_RATE","Exchange Rate");
+
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS","Payment Status");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_COMPLETED","Completed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_PENDING","Pending");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_FAILED","Failed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_DENIED","Denied");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_REFUNDED","Refunded");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_REVERSED","Reversed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_CANCELED_REVERSAL","Canceled_Reversal");
+
+define("PAYPAL_IPN_TEST_MODE_PENDING_REASON","Pending Reason");
+define("PAYPAL_IPN_TEST_MODE_MULTI_CURRENCY","multi_currency");
+define("PAYPAL_IPN_TEST_MODE_INTL","intl");
+define("PAYPAL_IPN_TEST_MODE_VERIFY","verify");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS","address");
+define("PAYPAL_IPN_TEST_MODE_UPGRADE","upgrade");
+define("PAYPAL_IPN_TEST_MODE_UNILATERAL","unilateral");
+define("PAYPAL_IPN_TEST_MODE_OTHER","other");
+
+define("PAYPAL_IPN_TEST_MODE_REASON_CODE","Reason Code");
+define("PAYPAL_IPN_TEST_MODE_CHARGEBACK","chargeback");
+define("PAYPAL_IPN_TEST_MODE_GUARANTEE","guarantee");
+define("PAYPAL_IPN_TEST_MODE_BUYER_COMPLAINT","buyer_complaint");
+define("PAYPAL_IPN_TEST_MODE_REFUND","refund");
+
+define("PAYPAL_IPN_TEST_MODE_TAX","Tax");
+define("PAYPAL_IPN_TEST_MODE_FOR_AUCTION","For Auction");
+define("PAYPAL_IPN_TEST_MODE_NO","No");
+define("PAYPAL_IPN_TEST_MODE_YES","Yes");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_BUYER_ID","Auction Buyer ID");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_CLOSING_DATE","Auction Closing Date");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_MULTI_ITEM","Auction Multi-Item");
+
+define("PAYPAL_IPN_TEST_MODE_ITEM_NAME","Item Name");
+define("PAYPAL_IPN_TEST_MODE_ITEM_NUMBER","Item Number");
+define("PAYPAL_IPN_TEST_MODE_QUANTITY","Quantity");
+
+
+define("PAYPAL_IPN_TEST_MODE_HELP1","The following is a quick guide towards simmulating your own IPNs:");
+
+
+define("PAYPAL_IPN_TEST_MODE_HELP2",' <br><ol>
+      <li>Begin to check out as a customer via the store, stop when you get to the PayPal site</li><br><br class="h6">
+      <li>Go into the store admin orders section and find the last order (just created)</li><br><br class="h6">
+      <li>Select a <b>Transaction Type</b>, usually cart or web_accept, but nothing for refunds, reversals, or canceled_reversals payments</li><br><br class="h6">
+      <li>Copy and paste the <b>Transaction Signature</b> into the <b>Custom</b> field and into the <b>Transaction ID</b> field</li><br><br class="h6">
+      <li>If the <b>Cart Test</b> is on, then make sure that the above <b>MC Gross</b> amount is the same as the order total and that the <b>MC&nbsp;Currency</b> field is set to the same currency as the order.</li><br><br class="h6">
+      <li>Submit the Test IPN</li><br><br class="h6">
+      <li>Now check the admin order status</li><br><br class="h6">
+    </ol>');
+
+define("PAYPAL_IPN_TEST_MODE_HELP3","When testing Pending payments etc, remember to use the same Transction ID");
+
+##################### 03/07/2006 Start  ####################
+
+define("NON_TTF_FONT_ERROR","Non-TTF font size must be 1,2,3,4 or 5");
+define("SETLEGEND_ERROR","Error: SetLegend argument must be an array");
+
+define("UNABLE_TO_OPEN_ERROR","Unable to open ");
+define("UNABLE_TO_OPEN_GIF_ERROR"," as a GIF");
+define("UNABLE_TO_OPEN_PNG_ERROR"," as a PNG");
+define("UNABLE_TO_OPEN_JPG_ERROR"," as a JPG");
+define("SELECT_IMAGE_ERROR","Please select wbmp,gif,jpg, or png for image type!");
+define("SELECT_IMAGE_TYPE_ERROR","Please select an image type!");
+define("NOT_ACCEPTABLE_PLOT_TYPE_ERROR"," not an acceptable plot type");
+define("UNKNOWN_CHART_TYPE_ERROR","ERROR: unknown chart type");
+define("LOG_PLOTS_DATA_GREATER_ERROR","Log plots need data greater than 0");
+define("ERROR_IN_DATA","Error in Data - max not gt min");
+define("FATAL_ERROR","Fatal error");
+define("THINBARLINES_DATA_TYPE_ERROR","Data Type for ThinBarLines must be data-data");
+define("BAR_PLOTS_DATA_TYPE_ERROR",'Bar plots must be text-data: use function SetDataType("text-data")');
+define("NO_IMAGE_DEFINED_DRAWGRAPH_ERROR","No Image Defined: DrawGraph");
+define("NO_ARRAY_OF_DATA_IN_ERROR","No array of data in ");
+
+
+
+##################### 03/07/2006 End  ####################
+
+
+##################### 04/07/2006 Start  ####################
+
+define("SESSION_FILE_OPEN_ERROR_1",'Could not open session file (');
+define("SESSION_FILE_OPEN_ERROR_2",').');
+define("SESSION_FILE_WRITE_ERROR_1",'Could not write session file (');
+define("SESSION_FILE_WRITE_ERROR_2",').');
+define("CACHING_METHOD_ERROR_1",'Caching method ');
+define("CACHING_METHOD_ERROR_2",' not implemented.');
+define("INITIALIZE_SESSION_MODULE_ERROR",'Failed to initialize session module.');
+define("SESSION_NOT_SAVED_ERROR",'Session could not be saved.');
+define("SESSION_NOT_CLOSED_ERROR",'Session could not be closed.');
+define("SESSION_NOT_STARTED_ERROR",'Session could not be started.');
+
+
+define("CANNOT_COPY_PRODUCT_ERROR_1",'<b>WARNING: Cannot copy from Product ID #');
+define("CANNOT_COPY_PRODUCT_ERROR_2",' to Product ID # ');
+define("CANNOT_COPY_PRODUCT_ERROR_3",' ... No copy was made</b>');
+define("NO_ATTRIBUTES_COPY_ERROR_1",'<b>WARNING: No Attributes to copy from Product ID #');
+define("NO_ATTRIBUTES_COPY_ERROR_2",' for: ');
+define("NO_ATTRIBUTES_COPY_ERROR_3",' ... No copy was made</b>');
+define("NO_PRODUCT_ERROR_1",'<b>WARNING: There is no Product ID #');
+define("NO_PRODUCT_ERROR_2",' ... No copy was made</b>');
+
+
+define("MCRYPT_ALGORITHMS_AND_MODES",'Mcrypt Algorithms and Modes');
+define("MCRYPT_ALGORITHM",'Algorithm');
+define("MCRYPT_Status",'Status');
+define("MCRYPT_OK",'OK');
+define("MCRYPT_NOT_OK",'NOT OK');
+define("MCRYPT_NOT_TESTED",'NOT TESTED');
+define("MCRYPT_MAXIMUM_KEY_SIZES_ALLOWED",'Maximum Key Sizes Allowed');
+define("MCRYPT_MAXIMUM_KEY_SIZE",'Maximum Key Size');
+define("MCRYPT_KEY_TEXT",'this is a very long key, even too long for the cipher');
+define("MCRYPT_PLAIN_TEXT",'very important data');
+
+define("DATABASE_TEP_DB_ERROR",'[TEP STOP]');
+
+define("CANNOT_CHANGE_THE_MODE_OF_FILE","Cannot change the mode of file");
+define("FAILED_TO_OPEN_FILE",'Failed to open file ');
+define("CANNOT_WRITE_TO_FILE",'Cannot write to file ');
+
+define("UNABLE_TO_DETERMINE_PAGE_LINK",'<b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function used:<br><br>');
+define("UNABLE_TO_DETERMINE_CONNECTION_METHOD_ON_PAGE_LINK",'<b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>');
+
+
+define("SUPPORT_DESK",'Support Desk');
+
+define("FRAUDSCREENCLIENT_AFS",'AFS');
+define("FRAUDSCREENCLIENT_QUERY_RESULT",'query result');
+define("FRAUDSCREENCLIENT_SERVER_UNAVAILABLE","Algozone Fraud Screen Server currently unavailable. Please try again later.");
+define("FRAUDSCREENCLIENT_AFS_INPUTS","AFS Inputs");
+define("FRAUDSCREENCLIENT_INPUT","input");
+define("FRAUDSCREENCLIENT_INVALID_INPUT","invalid input");
+define("FRAUDSCREENCLIENT_MISSPELLED_FIELD","- perhaps misspelled field?");
+define("FRAUDSCREENCLIENT_AFS_USING_CURL","AFS using curl");
+define("FRAUDSCREENCLIENT_AFS_CURL_PARAMS","AFS curl params");
+define("FRAUDSCREENCLIENT_AFS_CURL_NOT_SUPPORT","<br>error: this version of curl does not support HTTPS try build curl with SSL or specify");
+define("FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_1","Received error message");
+define("FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_2","from curl");
+define("FRAUDSCREENCLIENT_AFS_CURL_PROXY","<p>using curl thru proxy");
+define("FRAUDSCREENCLIENT_AFS_USING_FSOCKOPEN","<p><b>AFS using fsockopen</b>");
+define("FRAUDSCREENCLIENT_AFS_SOCKET_PARAM","AFS socket url param");
+define("FRAUDSCREENCLIENT_AFS_FSOCKOPEN_PROXY","<p><b>AFS using fsockopen proxy<b><br>");
+define("FRAUDSCREENCLIENT_AFS_PROXY_PORT","<br>error: you need to provide the proxy port number to use the proxy port provided");
+define("FRAUDSCREENCLIENT_AFS_INSTALL_CURL","<br>error: you need to install curl if you want secure HTTPS or specify the variable to be");
+define("FRAUDSCREENCLIENT_AFS_QUERY_RESULTS","<p><b>AFS query results: </b>");
+define("FRAUDSCREENCLIENT_AFS_OUTPUT","output");
+
+define("MAP_MSG","<p>Courtesy of the U.S. Census Bureau's TIGER Mapping Service");
+
+define("ATTRIBUTES_DISPLAY_MSG","**Discounts may vary based on selected options");
+
+define("FOOTER_TEXT_1",'E-Commerce Engine Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a> Portions Copyright &copy; 2003 - 2006 <a href="http://www.creloaded.com" target="_blank">CRE Loaded Project</a><br>osCommerce provides no warranty and is redistributable under the <a href="http://www.fsf.org/licenses/gpl.txt" target="_blank">GNU General Public License</a><br><a href="http://www.chainreactionworks.com" target="_blank">Chain Reaction Works, Inc</a> provides no warranty except as to associated support contracts<br>which are limited by and to the Service Level Agreement.</br>');
+define("FOOTER_TEXT_2",'Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.creloaded.com" target="_blank">CRE Loaded</a>');
+
+
+##################### 04/07/2006 End  ####################
+
+
+##################### 05/07/2006 End  ####################
+
+define("AUTHORIZE_NET_HELP_TITLE","Authorize.net Consolidated CRE Help Screen");
+define("AUTHORIZE_NET_HELP_MSG_1","Authorize.net Consolidated CRE Edition");
+define("AUTHORIZE_NET_HELP_MSG_2","Configuration Help Screen");
+define("AUTHORIZE_NET_HELP_MSG_3",'<a href="http://ecommexchange.com"><h2>Link to Apply for Authorize.net account</h2></a><br>(support the CRE project by using our Authorize.net partner)');
+define("AUTHORIZE_NET_HELP_MSG_4",'User your browser back button to return to the Authorize.net edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Authorize.net testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Authorize.net Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Authorize.net User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Authorize.net Consolidated uses the AIM method of
+connecting to Authorize.net.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Authorize.net gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don\'t know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Authorize.net Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Authorize.net Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>
+<li>Trouble Shooting Notes </li>
+<p>If you experience high levels of transaction failure, you may need to adjust your sessions configuration.  Consult your technical support team for more information</p> ');
+
+##################### 05/07/2006 End  ####################
+##################### 06/07/2006 Start  ####################
+
+define("FEATURE_NOT_PRESENT_TEXT",'<p class="style4">CRE Loaded Standard Version is the perfect application
+        to power your e-Commerce websites. However, if you need features that
+        only a Pro-level application can deliver, please take a look at all the
+        powerful options our Pro Version adds. If you are looking to deploy a
+        powerful Business to Business solution, our Pro B2B has added features
+        to enhance sales and productivity.</p>
+
+        <p class="style4">Feel free to contact us for more details or usage guidlines. </p>');
+
+define("HEADER_TAGS_ENGLISH_TXT_1","Default Title");
+define("HEADER_TAGS_ENGLISH_TXT_2","Default Descriptions");
+define("HEADER_TAGS_ENGLISH_TXT_3","Default Keyword(s)");
+define("HEADER_TAGS_ENGLISH_TXT_4","HTTA: ");
+define("HEADER_TAGS_ENGLISH_TXT_5","HTDA: ");
+define("HEADER_TAGS_ENGLISH_TXT_6","HTKA: ");
+define("HEADER_TAGS_ENGLISH_TXT_7","HTCA: ");
+define("HEADER_TAGS_ENGLISH_TXT_8","(Explain) ");
+define('HEADER_TAGS_ENGLISH_TXT_9', 'Title');
+define('HEADER_TAGS_ENGLISH_TXT_10', 'Descriptions');
+define('HEADER_TAGS_ENGLISH_TXT_11', 'Keyword(s)');
+
+
+define('HEADER_TAGS_FILL_TAGS_TXT_1', 'CATEGORIES');
+define('HEADER_TAGS_FILL_TAGS_TXT_2', 'PRODUCTS');
+define('HEADER_TAGS_FILL_TAGS_TXT_3', 'Skip all tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_4', 'Fill only empty tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_5', 'Fill all tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_6', 'Clear all tags');
+
+define("INSTALL_EXPLAIN_TXT_1","Install (and Uninstall) Database Settings script for osC-Explain - by Chemo");
+define("INSTALL_EXPLAIN_TXT_2",'<p><b>Install option selected...running queries</b></p>');
+define("INSTALL_EXPLAIN_TXT_3",'<p>STEP 1 => Add configuration group</p>');
+define("INSTALL_EXPLAIN_TXT_4",'<p>Added the configuration group ');
+define("INSTALL_EXPLAIN_TXT_5",'successfully...adding configuration values</p>');
+define("INSTALL_EXPLAIN_TXT_6",'<p>STEP 2 => Add configuration settings</p>');
+define("INSTALL_EXPLAIN_TXT_7","<blockquote>Success...</blockquote>");
+define("INSTALL_EXPLAIN_TXT_8","<p>Added the configuration settings successfully...adding the 'explain_queries' table</p>");
+define("INSTALL_EXPLAIN_TXT_9",'<p>STEP 3 => Creating explain_queries table</p>');
+define("INSTALL_EXPLAIN_TXT_10",'<blockquote>Successfully created the table.</blockquote>');
+define("INSTALL_EXPLAIN_TXT_11","<p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>");
+
+define("INSTALL_EXPLAIN_TXT_12","<p><b>Uninstall optin selected...running queries</b></p><p>STEP 1 => Delete the configuration group from configuration_group table</p>");
+
+define("INSTALL_EXPLAIN_TXT_13",'<blockquote>Deleted the configuration group successfully...removing configuration values</blockquote><p>STEP 2 => Delete configuraton values</p>');
+
+define("INSTALL_EXPLAIN_TXT_14",'<blockquote>Deleted the configuration values successfully...dropping the explain_queries table</blockquote><p>STEP 3 => Dropping explain_queries table</p>');
+
+
+define("INSTALL_EXPLAIN_TXT_15",'<blockquote>Table dropped successfully...analyzing tables</blockquote><p>STEP 4 => Analyzing configuration_group and configuration table</p>');
+
+define("INSTALL_EXPLAIN_TXT_16","<blockquote>Analyze configuration_group success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_17","<blockquote>Analyze configuration success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_18","<blockquote>Optimize configuration_group success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_19","<blockquote>Optimize configuration success...</blockquote><p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>");
+
+define("INSTALL_EXPLAIN_TXT_20",'<p>Welcome to the barebones osC-Explain installation script (<a href="http://forums.oscommerce.com/index.php?showuser=9196">by   Chemo</a>)!</p><p>This contribution is GPL and the target audience is fellow coders, optimizers,   and knowledgeable webmasters. I encourage each of you to look over the   code and add functionality so that the rest of us can benefit as well.</p><p>There are two options for this script:</p><p><strong>INSTALL</strong></p><blockquote>  <p>This option is self explanatory :) It will add a configuration group     with the title &quot;Explain Queries&quot; and set the sort order to 99 (making     it the last listed). The script will then add values to the configuration     table that is the options for this contribution. Currently, these are     available:</p>  <ul>    <li> Global on / off</li>    <li>Enable on for specific scripts (add one or list separated by comma).       This will be handy for contribution coders since they can enable only for       their development scripts and not waste room for storing other page queries.       In addition, it will speed up the admin report if there are 1,000 rows instead       of 500,000 :)</li>    <li>Enable page exclusion for specific scripts. This is handy to exclude       certain scripts (for instance, ones already optimized) but capture the rest.</li>  </ul>  <p>The last thing this install script does is add a new table called \'explain_queries\'.    This is needed to store the data. Do not change the name since the table     name is hardcoded all over the place. Why not add a new define to filenames.php?     If there is room to trim install steps and decrease the number of file changes     I\'ll take it any day of the week and twice on Sunday. You are (hopefully)     an experienced osC developer so if you want to do define table names the standard     way edit your own files.</p></blockquote><p align="center"><strong><a href="'.$_SERVER['PHP_SELF'].'?action=install">INSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p><p align="left"><strong>UNINSTALL</strong></p><blockquote>  <p align="left">Hopefully, this option is self-explanatory too :) This     will delete all the values associated with osC-Explain from the configuration_group     and configuration tables. Then it will analyze the tables to reset the     cardinality of the tables. Next, the script will drop the \'explain_queries\'     table.</p></blockquote><p align="center"><strong><a href="'.$_SERVER['PHP_SELF'].'?action=delete">UNINSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p><p align="left"><strong>NOTES</strong>: By default all values are set to false.   So, once you have the files uploaded and necessary changes have been made you\'ll   have to enable it through the admin control panel. </p><blockquote>  <p align="left">Configuration -> Explain Queries -> Enable explain queries     -> true</p></blockquote>');
+
+define("VALID_CATEGORIES_PRODUCTS_LIST","Valid Categories/Products List");
+define("VALID_CATEGORIES_LIST","Valid Categories List");
+define("VALID_PRODUCTS_LIST","Valid Products List");
+
+
+define("CRE_LOADED_OSCOMMERCE","CRE Loaded osCommerce");
+define("PASS_FORGOTTEN_FOOTER",'E-Commerce Engine Copyright &copy; 2003 <a href="http://oscommerce.com" target="_blank">osCommerce</a> <br>      Supercharged by <a href="http://creloaded.com" target="_blank">CRE Loaded</a>');
+
+##################### 06/07/2006 End  ####################
+
+
+##################### 07/07/2006 End  ####################
+
+define("QUICK_ATTRIBUTES_POPUP_TXT_0",'Current Attributes');
+define("QUICK_ATTRIBUTES_POPUP_TXT_1","Current ID#");
+define("QUICK_ATTRIBUTES_POPUP_TXT_2","Model:");
+define("QUICK_ATTRIBUTES_POPUP_TXT_3","NO CURRENT ATTRIBUTES ...");
+define("QUICK_ATTRIBUTES_POPUP_TXT_4",'CURRENT ATTRIBUTES:');
+define("QUICK_ATTRIBUTES_POPUP_TXT_5",'Close Window');
+
+define("QUICK_PRODUCTS_POPUP_TXT_0",'Quick Products Listing');
+define("QUICK_PRODUCTS_POPUP_TXT_1",'Quick Product Locator');
+define("QUICK_PRODUCTS_POPUP_TXT_2",'All categories:');
+define("QUICK_PRODUCTS_POPUP_TXT_3",'Click to:');
+define("QUICK_PRODUCTS_POPUP_TXT_4",'Show Attributes');
+
+
+define("QUICKCOM_HELP_TXT_1",'Quickcommerce Consolidated CRE Help Screen');
+define("QUICKCOM_HELP_TXT_2",'Quickcommerce Consolidated CRE Edition');
+define("QUICKCOM_HELP_TXT_3",'Configuration Help Screen');
+define("QUICKCOM_HELP_TXT_4",'<a href=" https://freecreditcardprocessing.com/applynow/online_application.asp?code=chainreaction"> <h2>Link to Apply for Quickcommerce account</h2></a><br>(support the CRE project by using our authorize.net partner)');
+define("QUICKCOM_HELP_TXT_5",'User your browser back button to return to the Quickcommerce edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Quickcommerce testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Quickcommerce Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Quickcommerce User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Quickcommerce Consolidated uses the AIM method of
+connecting to Quickcommerce.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Quickcommerce gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don\'t know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Quickcommerce Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Quickcommerce Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>');
+
+
+define("STATS_EXPLAIN_QUERIES_TXT_1","Explain Queries v1.0 - by Chemo");
+define("STATS_EXPLAIN_QUERIES_TXT_2",'Explain Queries Report v1.0 <a href="http://forums.oscommerce.com/index.php?showuser=9196">- by Chemo</a>');
+
+define("STATS_EXPLAIN_QUERIES_TXT_3",'Export Format');
+define("STATS_EXPLAIN_QUERIES_TXT_4",'CVS');
+define("STATS_EXPLAIN_QUERIES_TXT_5",'HTML');
+define("STATS_EXPLAIN_QUERIES_TXT_6",'Limit to');
+define("STATS_EXPLAIN_QUERIES_TXT_7",'rows starting with row#');
+define("STATS_EXPLAIN_QUERIES_TXT_8",'Back to Explain Queries');
+define("STATS_EXPLAIN_QUERIES_TXT_9",'results returned for:');
+define("STATS_EXPLAIN_QUERIES_TXT_10",'Query#');
+define("STATS_EXPLAIN_QUERIES_TXT_11",'Time (ms): ');
+define("STATS_EXPLAIN_QUERIES_TXT_12",'# Records:');
+define("STATS_EXPLAIN_QUERIES_TXT_13",'Script: ');
+define("STATS_EXPLAIN_QUERIES_TXT_14",'Request String:');
+define("STATS_EXPLAIN_QUERIES_TXT_15",'Table: ');
+define("STATS_EXPLAIN_QUERIES_TXT_16",'Type: ');
+define("STATS_EXPLAIN_QUERIES_TXT_17",'Possible / Used Key: ');
+define("STATS_EXPLAIN_QUERIES_TXT_18",'Key Len:');
+define("STATS_EXPLAIN_QUERIES_TXT_19",'Rows: ');
+define("STATS_EXPLAIN_QUERIES_TXT_20",'Ref: ');
+define("STATS_EXPLAIN_QUERIES_TXT_21",'Extra: ');
+define("STATS_EXPLAIN_QUERIES_TXT_22",'Comment: ');
+
+define("TEMPLATE_CONFIGURATION1_TXT_1","Link Button Name 1");
+define("TEMPLATE_CONFIGURATION1_TXT_2","Link Button Name 2");
+define("TEMPLATE_CONFIGURATION1_TXT_3","Link Button Name 3");
+define("TEMPLATE_CONFIGURATION1_TXT_4","Link Button Name 4");
+define("TEMPLATE_CONFIGURATION1_TXT_5","Link Button Name 5");
+define("TEMPLATE_CONFIGURATION1_TXT_6","Link Button Name 6");
+
+define("TEMPLATE_CONFIGURATION1_TXT_7","<br> There are ");
+define("TEMPLATE_CONFIGURATION1_TXT_8"," active infoboxes in your Right Column<br>");
+define("TEMPLATE_CONFIGURATION1_TXT_9","WARNING: You have the RIGHT Column Active BUT <br>No boxes selected in your RIGHT column");
+define("TEMPLATE_CONFIGURATION1_TXT_10","Left column cellpadding");
+define("TEMPLATE_CONFIGURATION1_TXT_11","Show Page descriptions");
+define("TEMPLATE_CONFIGURATION1_TXT_12","Right Column cell padding");
+define("TEMPLATE_CONFIGURATION1_TXT_13","Include Main Table Border");
+define("TEMPLATE_CONFIGURATION1_TXT_14","Show Customer Greeting?");
+define("TEMPLATE_CONFIGURATION1_TXT_15","<br>edit text for Customer Logged On<br>");
+define("TEMPLATE_CONFIGURATION1_TXT_16",'<br>edit text for Customer Re-Logged On<br>');
+define("TEMPLATE_CONFIGURATION1_TXT_17",'<br>edit text for Guest greeting<br>');
+define("TEMPLATE_CONFIGURATION1_TXT_18",'Include Which Modules On Catalog index Page?');
+
+
+define("TREEVIEW_TXT_1","Catalog Tree");
+define("TREEVIEW_TXT_2","open all");
+define("TREEVIEW_TXT_3","close all");
+
+##################### 07/07/2006 End  ####################
+
+
+
+
+define("ADMIN_JS_FILE_BROWSER","File Browser");
+define("ADMIN_JS_INSERT_FILE","Insert File");
+
+define("ADMIN_JS_IBROWSER_MSG_1",'<strong>net<span class="hilight">4</span>visions.com</strong> - the image browser plugin for WYSIWYG editors like FCKeditor, SPAW, tinyMCE, Xinha, and HTMLarea!</p>
+              <p> <strong> <span class="hilight">i</span>Browser</strong> does upload images and supply file management functions. Images can be resized on the fly. If you need even more advanced features, have a look at <strong> <span class="hilight">i</span>Manager</strong>, another <strong>net<span class="hilight">4</span>visions.com</strong> plugin - it adds truecolor image editing functions like: resize, flip, crop, add text, gamma correct, merge into other image, and many others.</p>
+              <p><strong> <span class="hilight">i</span>Browser</strong> is written and distributed under the GNU General Public License which means that its source code is freely-distributed and available to the general public.</p>
+              <p>&nbsp;</p>');
+
+define("ADMIN_JS_IBROWSER_MSG_2",'Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exercitation ullamcorper suscipit. Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.');
+
+define("ADMIN_JS_PREVIEW_PAGE","Preview page");
+define("ADMIN_JS_EDITOR_CONTENTS","Editor contents:");
+define("ADMIN_JS_CLOSE","Close");
+define("ADMIN_JS_PRINT","Print");
+
+##################### 08/07/2006 End  ####################
+
+
+define("DOCUMENT_INDEX","Document Index");
+
+define("CUSTOMER_ZIP_CODE_VALIDATOR","Customer Zip Code Validator");
+define("SEND_EMAIL_TO_ALL","Send Email to All");
+define("MISMATCHED_STATE_AND_ZIPCODE","Mismatched State and Zipcode");
+define("ADDRESS_BOOK_ID","Address Book ID");
+define("CUSTOMER_ID","Customer ID");
+define("CUSTOMER","Customer");
+define("REMOVE","Remove");
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/abandoned_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/abandoned_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/abandoned_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,133 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Abandoned Orders');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('ADDING_TITLE', 'Adding a Product to Order');
+
+define('ADD_PRODUCT', 'Add a Product to Order');
+define('HEADING_ABANDONED', '<B>The shopping basket for this order was abandoned!!! Order ID:  </B>');
+define('TEXT_INFO_ABANDONDED', 'Abandoned');
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_TAX', 'Tax');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_UNIT_PRICE', 'Unit Price');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Total Price');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Customer Notified');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+
+define('ENTRY_CUSTOMER', 'Customer general');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Company');
+define('ENTRY_CUSTOMER_ADDRESS', 'Address');
+define('ENTRY_CUSTOMER_SUBURB', 'Suburb');
+define('ENTRY_CUSTOMER_CITY', 'City');
+define('ENTRY_CUSTOMER_STATE', 'State');
+define('ENTRY_CUSTOMER_POSTCODE', 'Postcode');
+define('ENTRY_CUSTOMER_COUNTRY', 'Country');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Sold To:');
+define('ENTRY_DELIVERY_TO', 'Delivery To:');
+define('ENTRY_SHIP_TO', 'Ship To:');
+define('ENTRY_SHIPPING_ADDRESS', 'Shipping Address:');
+define('ENTRY_BILLING_ADDRESS', 'Billing Address:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Type: ');
+define('ENTRY_CREDIT_CARD_OWNER', 'Owner: ');
+define('ENTRY_CREDIT_CARD_NUMBER', 'CC Number: ');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Expires: ');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Tax:');
+define('ENTRY_SHIPPING', 'Shipping:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'Date Last Updated:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notify Customer:');
+define('ENTRY_NOTIFY_COMMENTS', 'Append Comments:');
+define('ENTRY_PRINTABLE', 'Print Invoice');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Use a negative number -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Add New Product');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+define('TEXT_NO_ORDER_HISTORY', 'No Order History Available');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Order Update');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: Order does not exist.');
+define('SUCCESS_ORDER_UPDATED', 'Success: Order has been successfully updated.');
+define('WARNING_ORDER_NOT_UPDATED', 'Warning: Nothing to change. The order was not updated.');
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choose a product');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Choose an option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Product has no options, so skipping...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'pieces of this product');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Add');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+define('DISPLAY_BASKET', 'Cesta de la exhibición');
+define('DONT_ADD_NEW_PRODUCT', 'No agregue El Producto Nuevo');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: admin_account.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Cuenta de administración');
+
+define('TABLE_HEADING_ACCOUNT', 'Mi cuenta');
+
+define('TEXT_INFO_FULLNAME', '<b>Nombre completo: </b>');
+define('TEXT_INFO_FIRSTNAME', '<b>Nombre: </b>');
+define('TEXT_INFO_LASTNAME', '<b>Apellidos: </b>');
+define('TEXT_INFO_EMAIL', '<b>Dirección de email: </b>');
+define('TEXT_INFO_PASSWORD', '<b>Contraseña: </b>');
+define('TEXT_INFO_PASSWORD_HIDDEN', '-Oculto-');
+define('TEXT_INFO_PASSWORD_CONFIRM', '<b>Confirmar contraseña: </b>');
+define('TEXT_INFO_CREATED', '<b>Cuenta creada: </b>');
+define('TEXT_INFO_LOGDATE', '<b>Último acceso: </b>');
+define('TEXT_INFO_LOGNUM', '<b>Número de log: </b>');
+define('TEXT_INFO_GROUP', '<b>Nivel de grupo: </b>');
+define('TEXT_INFO_ERROR', '<font color="red">¡Esta dirección de email ya existe aquí! Inténtelo de nuevo.</font>');
+define('TEXT_INFO_MODIFIED', 'Modificado: ');
+
+define('TEXT_INFO_HEADING_DEFAULT', 'Editar cuenta ');
+define('TEXT_INFO_HEADING_CONFIRM_PASSWORD', 'Confirmación de contraseña ');
+define('TEXT_INFO_INTRO_CONFIRM_PASSWORD', 'Contraseña:');
+define('TEXT_INFO_INTRO_CONFIRM_PASSWORD_ERROR', '<font color="red"><b>ERROR:</b> ¡contraseña incorrecta!</font>');
+define('TEXT_INFO_INTRO_DEFAULT', 'Pulse el <b>botón de edición</b> debajo para hacer cambios en su cuenta.');
+define('TEXT_INFO_INTRO_DEFAULT_FIRST_TIME', '<br><b>ATENCIÓN:</b><br>Hola <b>%s</b>, esta es la primera vez que accede aquí. ¡Le recomendamos cambiar su contraseña!');
+define('TEXT_INFO_INTRO_DEFAULT_FIRST', '<br><b>ATENCIÓN:</b><br>Hola <b>%s</b>, le recomendamos que cambie su email (<font color="red">admin at localhost</font>) y contraseña');
+define('TEXT_INFO_INTRO_EDIT_PROCESS', 'Todos los campos son necesarios. Pulse en guardar para enviar.');
+
+define('JS_ALERT_FIRSTNAME',        '- Necesario: Nombre \n');
+define('JS_ALERT_LASTNAME',         '- Necesario: Apellidos \n');
+define('JS_ALERT_EMAIL',            '- Necesario: Dirección de email \n');
+define('JS_ALERT_PASSWORD',         '- Necesario: Contraseña \n');
+define('JS_ALERT_FIRSTNAME_LENGTH', '- La longitud del nombre debe ser mayor de ');
+define('JS_ALERT_LASTNAME_LENGTH',  '- La longitud de los apellidos debe ser mayor de ');
+define('JS_ALERT_PASSWORD_LENGTH',  '- La longitud de la contraseña debe ser mayor de ');
+define('JS_ALERT_EMAIL_FORMAT',     '- ¡El formato de la dirección de email no es valido! \n');
+define('JS_ALERT_EMAIL_USED',       '- ¡La dirección de email ya se esta utilizando! \n');
+define('JS_ALERT_PASSWORD_CONFIRM', '- ¡Se ha confundido en el campo de comprobación de contraseña! \n');
+
+define('ADMIN_EMAIL_SUBJECT', 'Cambio de la información personal');
+define('ADMIN_EMAIL_TEXT', 'Hola %s,' . "\n\n" . 'Su información personal, pudiendo incluír su contraseña, ha sido cambiada.  ¡Si esto se ha hecho sin su conocimiento o consentimiento por favor contacte con el administrador inmediatamente!' . "\n\n" . 'Página : %s' . "\n" . 'Nombre: %s' . "\n" . 'Contraseña: %s' . "\n\n" . '¡Gracias!' . "\n" . '%s' . "\n\n" . '¡Esa es una respuesta automatizada, por favor no la responda!');
+
+define('JS_ALERT_FIRSTNAME_1','- Firstname length must over ');
+define('JS_ALERT_LASTNAME_1','- Firstname length must over ');
+define('JS_ALERT_ERROR','The following error(s) occurred:');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_files.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_files.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_files.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: admin_files.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Menú de administración de paneles');
+
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_BOXES', 'Paneles');
+define('TABLE_HEADING_FILENAME', 'Nombres de archivo');
+define('TABLE_HEADING_GROUPS', 'Grupos');
+define('TABLE_HEADING_STATUS', 'Estado');
+
+define('TEXT_COUNT_BOXES', 'Paneles: ');
+define('TEXT_COUNT_FILES', 'Archivo(s): ');
+
+//categories access
+define('TEXT_INFO_HEADING_DEFAULT_BOXES', 'Paneles: ');
+
+define('TEXT_INFO_DEFAULT_BOXES_INTRO', 'Simplemente pulse en el botón verde para instalar el panel o el rojo para desinstalarlo.<br><br><b>ATENCIÓN:</b> ¡Si desinstala el panel, se eliminarán todos los archivos relacionados!');
+define('TEXT_INFO_DEFAULT_BOXES_INSTALLED', ' instalado');
+define('TEXT_INFO_DEFAULT_BOXES_NOT_INSTALLED', ' no instalado');
+
+define('STATUS_BOX_INSTALLED', 'Instalado');
+define('STATUS_BOX_NOT_INSTALLED', 'No instalado');
+define('STATUS_BOX_REMOVE', 'Eliminar');
+define('STATUS_BOX_INSTALL', 'Instalar');
+
+//files access
+define('TEXT_INFO_HEADING_DEFAULT_FILE', 'Archivo: ');
+define('TEXT_INFO_HEADING_DELETE_FILE', 'Confirmación de eliminación');
+define('TEXT_INFO_HEADING_NEW_FILE', 'Almacenar archivos');
+
+define('TEXT_INFO_DEFAULT_FILE_INTRO', 'Pulse el botón <b>Almacenar archivos</b> para insertar un nuevo archivo en el panel actual: ');
+define('TEXT_INFO_DELETE_FILE_INTRO', '¿Eliminar <font color="red"><b>%s</b></font> del panel <b>%s</b>? ');
+define('TEXT_INFO_NEW_FILE_INTRO', 'Comprobar el <font color="red"><b>menú izquierdo</b></font> para asegurarse de que almacena los archivos adecuados.');
+
+define('TEXT_INFO_NEW_FILE_BOX', 'Panel actual: ');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_members.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/admin_members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<?php
+/*
+  $Id: admin_members.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['gID']) {
+  define('HEADING_TITLE', 'Administrar grupos');
+} elseif ($HTTP_GET_VARS['gPath']) {
+  define('HEADING_TITLE', 'Definir grupos');
+} else {
+  define('HEADING_TITLE', 'Administrar miembros');
+}
+
+define('TEXT_COUNT_GROUPS', 'Grupos: ');
+
+define('TABLE_HEADING_NAME', 'Nombre');
+define('TABLE_HEADING_EMAIL', 'Dirección de email');
+define('TABLE_HEADING_PASSWORD', 'Contraseña');
+define('TABLE_HEADING_CONFIRM', 'Confirmar contraseña');
+define('TABLE_HEADING_GROUPS', 'Nivel de grupos');
+define('TABLE_HEADING_CREATED', 'Cuenta creada');
+define('TABLE_HEADING_MODIFIED', 'Cuenta modificada');
+define('TABLE_HEADING_LOGDATE', 'Último acceso');
+define('TABLE_HEADING_LOGNUM', 'LogNum');
+define('TABLE_HEADING_LOG_NUM', 'Número de log');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TABLE_HEADING_GROUPS_NAME', 'Nombre de grupos');
+define('TABLE_HEADING_GROUPS_DEFINE', 'Selección de paneles y archivos');
+define('TABLE_HEADING_GROUPS_GROUP', 'Nivel');
+define('TABLE_HEADING_GROUPS_CATEGORIES', 'Permisos de las categorías');
+
+
+define('TEXT_INFO_HEADING_DEFAULT', 'Miembro administrador ');
+define('TEXT_INFO_HEADING_DELETE', 'Permiso para borrar ');
+define('TEXT_INFO_HEADING_EDIT', 'Editar categoría / ');
+define('TEXT_INFO_HEADING_NEW', 'Nuevo miembro administrador ');
+
+define('TEXT_INFO_DEFAULT_INTRO', 'Grupo de miembros');
+define('TEXT_INFO_DELETE_INTRO', '¿Eliminar a <nobr><b>%s</b></nobr> de <nobr>los miembros administradores?</nobr>');
+define('TEXT_INFO_DELETE_INTRO_NOT', '¡No puede elimiar el <nobr>grupo %s!</nobr>');
+define('TEXT_INFO_EDIT_INTRO', 'Fijar el nivel de permisos aquí: ');
+
+define('TEXT_INFO_FULLNAME', 'Nombre completo: ');
+define('TEXT_INFO_FIRSTNAME', 'Nombre: ');
+define('TEXT_INFO_LASTNAME', 'Apellidos: ');
+define('TEXT_INFO_EMAIL', 'Dirección de email: ');
+define('TEXT_INFO_PASSWORD', 'Contraseña: ');
+define('TEXT_INFO_CONFIRM', 'Confirmar contraseña: ');
+define('TEXT_INFO_CREATED', 'Cuenta creada: ');
+define('TEXT_INFO_MODIFIED', 'Cuenta modificada: ');
+define('TEXT_INFO_LOGDATE', 'Último acceso: ');
+define('TEXT_INFO_LOGNUM', 'Número de log: ');
+define('TEXT_INFO_GROUP', 'Nivel de grupo: ');
+define('TEXT_INFO_ERROR', '<font color="red">¡La dirección de email ya esta siendo utilizada! Por favor inténtelo de nuevo.</font>');
+
+define('JS_ALERT_FIRSTNAME', '- Necesario: Nombre \n');
+define('JS_ALERT_LASTNAME', '- Necesario: Apellidos \n');
+define('JS_ALERT_EMAIL', '- Necesario: Dirección de email \n');
+define('JS_ALERT_EMAIL_FORMAT', '- ¡El formato de la dirección de email no es válido! \n');
+define('JS_ALERT_EMAIL_USED', '- ¡La dirección de email ya esta en uso! \n');
+define('JS_ALERT_LEVEL', '- Necesario: Miembro de grupo \n');
+
+define('ADMIN_EMAIL_SUBJECT', 'Nuevo miembro de administración');
+define('ADMIN_EMAIL_TEXT', 'Hola %s,' . "\n\n" . 'Puedes acceder al panel de administración con la siguiente contraseña. Una vez que accedas al panel, ¡por favor cambia la contraseña!' . "\n\n" . 'Sitio : %s' . "\n" . 'Usuario: %s' . "\n" . 'Contraseña: %s' . "\n\n" . 'Gracias!' . "\n" . '%s' . "\n\n" . '¡Esta es una respuesta automatizada, por favor no responda ya que no valdría de nada!'); 
+define('ADMIN_EMAIL_EDIT_SUBJECT', 'Editar perfil de miembro de administración');
+define('ADMIN_EMAIL_EDIT_TEXT', 'Hola %s,' . "\n\n" . 'Tu información personal ha sido actualizada por un administrador.' . "\n\n" . 'Sitio : %s' . "\n" . 'Usuario: %s' . "\n" . 'Contraseña: %s' . "\n\n" . 'Gracias!' . "\n" . '%s' . "\n\n" . '¡Esta es una respuesta automatizada, por favor no responda ya que no valdría de nada!'); 
+
+define('TEXT_INFO_HEADING_DEFAULT_GROUPS', 'Administrar grupos ');
+define('TEXT_INFO_HEADING_DELETE_GROUPS', 'Eliminar grupos ');
+
+define('TEXT_INFO_DEFAULT_GROUPS_INTRO', '<b>NOTA:</b><li><b>Editar:</b> editar el nombre del grupo.</li><li><b>Eliminar:</b> eliminar el grupo.</li><li><b>Definir:</b> definir el nivel de aceso del grupo.</li>');
+define('TEXT_INFO_DELETE_GROUPS_INTRO', 'También se borrarán los miembros del grupo. ¿Esta seguro de querer eliminar el <nobr><b>grupo %s</b> ?</nobr>');
+define('TEXT_INFO_DELETE_GROUPS_INTRO_NOT', '¡No puede eliminar estos grupos!');
+define('TEXT_INFO_GROUPS_INTRO', 'De un nombre único para el grupo. Pulse siguiente para enviar.');
+
+define('TEXT_INFO_HEADING_GROUPS', 'Nuevo grupo');
+define('TEXT_INFO_GROUPS_NAME', ' <b>Nombre del grupo:</b><br>De un nombre único para el grupo. Entonces pulse siguiente para enviar.<br>');
+define('TEXT_INFO_GROUPS_NAME_FALSE', '<font color="red"><b>ERROR:</b> ¡El nombre del grupo debe tener al menos 5 caracteres!</font>');
+define('TEXT_INFO_GROUPS_NAME_USED', '<font color="red"><b>ERROR:</b> ¡El nombre ya esta en uso!</font>');
+define('TEXT_INFO_GROUPS_LEVEL', 'Nivel del grupo: ');
+define('TEXT_INFO_GROUPS_BOXES', '<b>Permisos de paneles:</b><br>Dar acceso a los paneles seleccionados.');
+define('TEXT_INFO_GROUPS_BOXES_INCLUDE', 'Los archivos include estan almacenados en: ');
+
+define('TEXT_INFO_EDIT_GROUP_INTRO', 'Editar el nombre del grupo: ');
+
+define('TEXT_INFO_HEADING_DEFINE', 'Definir grupo');
+if ($HTTP_GET_VARS['gPath'] == 1) {
+  define('TEXT_INFO_DEFINE_INTRO', '<b>%s :</b><br>No puede cambiar los permisos de archivos de este grupo.<br><br>');
+} else {
+  define('TEXT_INFO_DEFINE_INTRO', '<b>%s :</b><br>Cambiar los permisos de este grupo seleccionando o deseleccionando los paneles y archivos que aparecen. Pulse <b>Guardar</b> para guardar los cambios.<br><br>');
+}
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_affiliates.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_affiliates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_affiliates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: affiliate_affiliates.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Asociados');
+define('HEADING_TITLE_SEARCH', 'Buscar:');
+
+define('TABLE_HEADING_FIRSTNAME', 'Nombre');
+define('TABLE_HEADING_LASTNAME', 'Apellidos');
+define('TABLE_HEADING_USERHOMEPAGE', 'Homepage');
+define('TABLE_HEADING_COMMISSION','Comisión');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Cuenta creada');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_AFFILIATE_ID','ID de asociado');
+
+define('TEXT_DATE_ACCOUNT_CREATED', 'Cuenta creada:');
+define('TEXT_DATE_ACCOUNT_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_INFO_DATE_LAST_LOGON', 'Última visita:');
+define('TEXT_INFO_NUMBER_OF_LOGONS', 'Número de visitas:');
+define('TEXT_INFO_COMMISSION','Comisión');
+define('TEXT_INFO_NUMBER_OF_SALES', 'Número de ventas:');
+define('TEXT_INFO_COUNTRY', 'País:');
+define('TEXT_INFO_SALES_TOTAL', 'Total de ventas:');
+define('TEXT_INFO_AFFILIATE_TOTAL', 'Comisión:');
+define('TEXT_DELETE_INTRO', '¿Seguro que desea eliminar este asociado?');
+define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Eliminar Asociado');
+define('TEXT_DISPLAY_NUMBER_OF_AFFILIATES', 'Mostrando del <b>%d</b> al <b>%d</b> (de <b>%d</b> asociados)');
+
+define('ENTRY_AFFILIATE_PAYMENT_DETAILS', 'Pagable a:');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK','Nombre del pagador:');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL','Cuenta email de PayPal:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME','Nombre del banco:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME','Nombre de la cuenta:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER','Número de la cuenta:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER','Número ABA/BSB (branch number)');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE','Código SWIFT ');
+define('ENTRY_AFFILIATE_COMPANY','Empresa');
+define('ENTRY_AFFILIATE_COMPANY_TAXID','N.I.F.:');
+define('ENTRY_AFFILIATE_HOMEPAGE','Homepage');
+define('ENTRY_AFFILIATE_COMMISSION',' Porcentaje de pago por ventas');
+
+define('CATEGORY_COMMISSION','Comisión individual');
+define('CATEGORY_PAYMENT_DETAILS','Su dinero le llegará por:');
+
+define('TYPE_BELOW', 'Escriba debajo');
+define('PLEASE_SELECT', 'Seleccione');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_banner_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_banner_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_banner_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: affiliate_banner_statistics.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Banner Statistics');
+
+define('TABLE_HEADING_SOURCE', 'Source');
+define('TABLE_HEADING_VIEWS', 'Views');
+define('TABLE_HEADING_CLICKS', 'Clicks');
+
+define('TEXT_BANNERS_DATA', 'D<br>a<br>t<br>a');
+define('TEXT_BANNERS_DAILY_STATISTICS', '%s Daily Statistics For %s %s');
+define('TEXT_BANNERS_MONTHLY_STATISTICS', '%s Monthly Statistics For %s');
+define('TEXT_BANNERS_YEARLY_STATISTICS', '%s Yearly Statistics');
+
+define('STATISTICS_TYPE_DAILY', 'Daily');
+define('STATISTICS_TYPE_MONTHLY', 'Monthly');
+define('STATISTICS_TYPE_YEARLY', 'Yearly');
+
+define('TITLE_TYPE', 'Type:');
+define('TITLE_YEAR', 'Year:');
+define('TITLE_MONTH', 'Month:');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Error: Graphs directory does not exist. Please create a \'graphs\' directory inside \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Error: Graphs directory is not writeable.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.0 2002/09/29 SDK
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 -2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gestor de banners de asociados ');
+
+define('TABLE_HEADING_BANNERS', 'Banners');
+define('TABLE_HEADING_GROUPS', 'Grupos');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_STATISTICS', 'Estadísticas');
+define('TABLE_HEADING_PRODUCT_ID', 'ID de producto');
+define('TEXT_VALID_CATEGORIES_LIST', 'Available Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Category #');
+define('TEXT_VALID_CATEGORIES_NAME', 'Categories Name');
+define('TABLE_HEADING_CATEGORY_ID', 'Cat ID');
+define('TEXT_BANNERS_LINKED_CATEGORY','Category ID');
+define('TEXT_BANNERS_LINKED_CATEGORY_NOTE','If you want to link the Banner to a specific CATEGORY enter its CATEGORY ID here. If you want to link to the default page enter "0"');
+define('TEXT_AFFILIATE_VALIDCATS', 'Click Here:');
+define('TEXT_AFFILIATE_CATEGORY_BANNER_VIEW', 'to view available CATEGORIES.');
+define('TEXT_AFFILIATE_CATEGORY_BANNER_HELP', 'Select the category number from the popup window and enter the number in the Category ID field.');
+
+define('TEXT_BANNERS_TITLE', 'Título del banner:');
+define('TEXT_BANNERS_GROUP', 'Grupo del banner:');
+define('TEXT_BANNERS_NEW_GROUP', ', o introduzca un grupo nuevo para el banner abajo');
+define('TEXT_BANNERS_IMAGE', 'Imagen:');
+define('TEXT_BANNERS_IMAGE_LOCAL', ', o introduzca un archivo local de su servidor abajo');
+define('TEXT_BANNERS_IMAGE_TARGET', 'Destino de la imagen (Grabar en):');
+define('TEXT_BANNERS_HTML_TEXT', 'Texto HTML:');
+define('TEXT_AFFILIATE_BANNERS_NOTE', '<b>Notas sobre el Banner:</b><ul><li>Use una imagen o texto HTML para el banner - no ambos.</li><li>El texto HTML tiene prioridad sobre una imagen</li></ul>');
+
+define('TEXT_BANNERS_LINKED_PRODUCT','ID de producto');
+define('TEXT_BANNERS_LINKED_PRODUCT_NOTE','Si quiere enlazar el banner a un producto específico, introduzca su ID aquí. Si quiere enlazar a la página por defecto introduzca "0" (cero)');
+
+define('TEXT_BANNERS_DATE_ADDED', 'Añadido el:');
+define('TEXT_BANNERS_STATUS_CHANGE', 'Último cambio: %s');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available products.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the product number from the popup window and enter the number in the Product ID field.');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Available Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Product #');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que quiere eliminar este banner?');
+define('TEXT_INFO_DELETE_IMAGE', 'Eliminar imagen de banner');
+
+define('SUCCESS_BANNER_INSERTED', 'OK: Se ha insertado el banner.');
+define('SUCCESS_BANNER_UPDATED', 'OK: Se ha actualizado el banner.');
+define('SUCCESS_BANNER_REMOVED', 'OK: Se ha eliminado el banner.');
+
+define('ERROR_BANNER_TITLE_REQUIRED', 'Error: Es necesario un título para el banner.');
+define('ERROR_BANNER_GROUP_REQUIRED', 'Error: Es necesario un grupo para el banner.');
+define('ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: El directorio de destino no existe.');
+define('ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: No hay permiso de escritura sobre el directorio de destino.');
+define('ERROR_IMAGE_DOES_NOT_EXIST', 'Error: La imagen no existe.');
+define('ERROR_IMAGE_IS_NOT_WRITEABLE', 'Error: No se puede eliminar la imagen.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Clicks de asociados');
+
+define('TABLE_HEADING_ONLINE', 'Clicks');
+define('TABLE_HEADING_AFFILIATE_USERNAME', 'Asociado');
+define('TABLE_HEADING_IPADDRESS', 'Dirección IP');
+define('TABLE_HEADING_ENTRY_TIME', 'Hora');
+define('TABLE_HEADING_BROWSER', 'Navegador');
+define('TABLE_HEADING_ENTRY_DATE', 'Fecha');
+define('TABLE_HEADING_CLICKED_PRODUCT','Producto pulsado');
+define('TABLE_HEADING_REFERRAL_URL', 'URL de referencia');
+
+define('TEXT_NO_CLICKS', 'No se ha grabado ningún click');
+define('TEXT_DISPLAY_NUMBER_OF_CLICKS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> clicks)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Enviar email a asociados');
+
+define('TEXT_AFFILIATE', 'Asociado:');
+define('TEXT_SUBJECT', 'Asunto:');
+define('TEXT_FROM', 'Desde:');
+define('TEXT_MESSAGE', 'Mensaje:');
+define('TEXT_SELECT_AFFILIATE', 'Seleccionar asociado');
+define('TEXT_ALL_AFFILIATES', 'Todos los asociados');
+define('TEXT_NEWSLETTER_AFFILIATES', 'A todos los asociados suscritos al boletín de noticias');
+
+define('NOTICE_EMAIL_SENT_TO', 'Aviso: Email enviado a: %s');
+define('ERROR_NO_AFFILIATE_SELECTED', 'Error: No ha seleccionado ningún asociado.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: affiliate_invoice.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Facturar a asociados');
+
+define ('TEXT_AFFILIATE','Asociado');
+define ('TEXT_AFFILIATE_PAYMENT','Pago');
+define ('TEXT_AFFILIATE_BILLED','Fecha de facturación');
+define('TABLE_HEADING_ORDER_ID', 'ID de pedido');
+define('TABLE_HEADING_ORDER_DATE', 'Fecha de pedido');
+define('TABLE_HEADING_ORDER_VALUE', 'Valor del pedido');
+define('TABLE_HEADING_COMMISSION_RATE', 'Tipo de comisión');
+define('TABLE_HEADING_COMMISSION_VALUE', 'Valor de comisión');
+define('TABLE_HEADING_TOTAL', 'Total');
+
+define('TEXT_SUB_TOTAL', 'Sub-Total');
+define('TEXT_TAX', 'Impuesto');
+define('TEXT_TOTAL', 'Total');
+define('ENTRY_PERCENT', '%');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: affiliate_news.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate News / Announcements');
+define('TABLE_HEADING_AFFILIATE_NEWS', 'Affiliate News');
+
+define('TABLE_HEADING_AFFILIATE_NEWS_HEADLINE', 'Headline');
+define('TABLE_HEADING_AFFILIATE_NEWS_ACTION', 'Action');
+define('TABLE_HEADING_AFFILIATE_NEWS_STATUS', 'Status');
+
+define('TEXT_NEWS_ITEMS', 'News Items:');
+define('TEXT_INFO_HEADING_DELETE_ITEM', 'Delete Item');
+define('TEXT_DELETE_ITEM_INTRO', 'Are you sure you want to permanently delete this item?');
+
+define('TEXT_AFFILIATE_NEWS_HEADLINE', 'Headline');
+define('TEXT_AFFILIATE_NEWS_CONTENT', 'Content');
+
+define('IMAGE_NEW_NEWS_ITEM', 'New news item');
+
+// npe admin begin #add
+define('TEXT_AFFILIATE_NEWS_CONTENT_DELETE', 'Delete displayed news in this language!');
+define('EMPTY_CATEGORY', 'Empty news');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'There are no news articles which can be displayed to your affiliate partners.');
+// npe admin begin #add
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: affiliate_newsletters.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Newsletter Manager');
+
+define('TABLE_HEADING_NEWSLETTERS', 'Newsletters');
+define('TABLE_HEADING_SIZE', 'Size');
+define('TABLE_HEADING_MODULE', 'Module');
+define('TABLE_HEADING_SENT', 'Sent');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_NEWSLETTER_MODULE', 'Module:');
+define('TEXT_NEWSLETTER_TITLE', 'Newsletter Title:');
+define('TEXT_NEWSLETTER_CONTENT', 'Content:');
+
+define('TEXT_NEWSLETTER_DATE_ADDED', 'Date Added:');
+define('TEXT_NEWSLETTER_DATE_SENT', 'Date Sent:');
+
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this newsletter?');
+
+define('TEXT_PLEASE_WAIT', 'Please wait .. sending emails ..<br><br>Please do not interrupt this process!');
+define('TEXT_FINISHED_SENDING_EMAILS', 'Finished sending e-mails!');
+
+define('ERROR_NEWSLETTER_TITLE', 'Error: Newsletter title required');
+define('ERROR_NEWSLETTER_MODULE', 'Error: Newsletter module required');
+define('ERROR_REMOVE_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before deleting it.');
+define('ERROR_EDIT_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before editing it.');
+define('ERROR_SEND_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before sending it.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Pagos a asociados');
+define('HEADING_TITLE_SEARCH', 'Buscar:');
+define('HEADING_TITLE_STATUS','Estado:');
+
+define('TEXT_ALL_PAYMENTS','Todos los pagos');
+define('TEXT_NO_PAYMENT_HISTORY', 'No hay histórico de pagos');
+
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_AFILIATE_NAME', 'Asociado');
+define('TABLE_HEADING_PAYMENT','Pago (incl.)');
+define('TABLE_HEADING_NET_PAYMENT','Pago (excl.)');
+define('TABLE_HEADING_DATE_BILLED','Fecha de facturación');
+define('TABLE_HEADING_NEW_VALUE', 'Nuevo valor');
+define('TABLE_HEADING_OLD_VALUE', 'Valor anterior');
+define('TABLE_HEADING_AFFILIATE_NOTIFIED', 'Asociado notificado');
+define('TABLE_HEADING_DATE_ADDED', 'Fecha añadido');
+
+define('TEXT_DATE_PAYMENT_BILLED','Facturado:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED','Ultima modificación:');
+define('TEXT_AFFILIATE_PAYMENT','Pago ganado por el asociado');
+define('TEXT_AFFILIATE_BILLED','Día de pago');
+define('TEXT_AFFILIATE','Asociado');
+
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Eliminar pago');
+define('TEXT_INFO_DELETE_INTRO','¿Está seguro de que quiere eliminar este pago?');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENTS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> pagos)');
+
+define('TEXT_AFFILIATE_PAYING_POSSIBILITIES','Puede pagar a su asociado por:');
+define('TEXT_AFFILIATE_PAYMENT_CHECK','Cheque:');
+define('TEXT_AFFILIATE_PAYMENT_CHECK_PAYEE','Pagable a:');
+define('TEXT_AFFILIATE_PAYMENT_PAYPAL','PayPal:');
+define('TEXT_AFFILIATE_PAYMENT_PAYPAL_EMAIL','Email en cuenta PayPal:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_TRANSFER','Transferencia:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_NAME','Nombre del banco:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME','Nombre de la cuenta:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER','Número de la cuenta:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER','Número ABA/BSB (branch number):');
+define('TEXT_AFFILIATE_PAYMENT_BANK_SWIFT_CODE','Código SWIFT:');
+
+define('IMAGE_AFFILIATE_BILLING','Iniciar el motor de facturación');
+
+define('ERROR_PAYMENT_DOES_NOT_EXIST','El pago no existe');
+
+define('SUCCESS_BILLING','Sus peticiones del pago de los afiliados sucessfully se han generado');
+define('SUCCESS_PAYMENT_UPDATED','El estado del pago se ha actualizado correctamente');
+
+define('PAYMENT_STATUS','Estado de pagos');
+define('PAYMENT_NOTIFY_AFFILIATE', 'Notificar al asociado');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Actualización de pago');
+define('EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER', 'Número de pago:');
+define('EMAIL_TEXT_INVOICE_URL', 'Factura detallada:');
+define('EMAIL_TEXT_PAYMENT_BILLED', 'Fecha de facturación');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Su pago se ha actualizado de acuerdo al siguiente estado.' . "\n\n" . 'Nuevo estado: %s' . "\n\n" . 'Por favor responda a este email si tiene alguna pregunta.' . "\n");
+define('EMAIL_TEXT_NEW_PAYMENT', 'Le ha llegado una nueva factura a sus pagos' . "\n");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: affiliate_sales.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Ventas de asociados');
+define('HEADING_TITLE_SEARCH', 'ID de pedido:');
+define('HEADING_TITLE_STATUS', 'Estado:');
+define('TABLE_HEADING_ONLINE', 'Clicks');
+define('TABLE_HEADING_AFFILIATE', 'Asociado');
+define('TABLE_HEADING_DATE', 'Fecha');
+define('TABLE_HEADING_PERCENTAGE','Tipo de comisión');
+define('TABLE_HEADING_SALES', 'Ventas');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ORDER_ID', 'ID_Pedido');
+define('TABLE_HEADING_VALUE', 'Valor');
+define('TEXT_NO_SALES', 'No se ha grabado ninguna venta');
+
+define('TEXT_DELETED_ORDER_BY_ADMIN', 'Eliminado (Admin)');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> ventas)');
+define('TEXT_INFORMATION_SALES_TOTAL', 'Valor total de las ventas del asociado:');
+define('TEXT_INFORMATION_AFFILIATE_TOTAL', 'Valor total de las comisiones del asociado:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: affiliate_statistics.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Estadísticas de asociado');
+define('TEXT_SUMMARY_TITLE', 'Estadísticas de asociado');
+define('TEXT_IMPRESSIONS', 'Total de impresiones del banner: ');
+define('TEXT_VISITS', 'Total de visitas del asociado: ');
+define('TEXT_TRANSACTIONS', 'Total de transacciones del asociado: ');
+define('TEXT_AFFILIATE_NAME', 'Nombre del asociado: ');
+define('TEXT_AFFILIATE_JOINDATE', 'Fecha de alta del asociado: ');
+define('TEXT_CONVERSION', 'Conversión: ');
+define('TEXT_AMOUNT', 'Total de ventas del asociado: ');
+define('TEXT_AVERAGE', 'Media de pagos/ventas del asociado: ');
+define('TEXT_COMMISSION_RATE', 'Tipo de comisión: ');
+define('TEXT_PAYPERSALE_RATE', 'Porcentaje de pago por venta: ');
+define('TEXT_CLICKTHROUGH_RATE', 'Porcentaje de clicks: ');
+define('TEXT_COMMISSION', 'Total de comisiones del asociado : ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Pulse en [?] para ver una descripción de cada categoría.');
+define('HEADING_SUMMARY_HELP', 'Ayuda para afiliados');
+define('TEXT_IMPRESSIONS_HELP', '<i>Impresiones</i> muestra el número de veces que el banner o enlace se ha mostado durante un periodo de tiempo dado.');
+define('TEXT_VISITS_HELP', '<i>Visitas</i> representa el número total de clicks de visitantes llegados desde su sitio web.');
+define('TEXT_TRANSACTIONS_HELP', '<i>Transacciones</i> representa el número total de transacciones completas que se le acreditan.');
+define('TEXT_CONVERSION_HELP', '<i>Conversions</i> representa el número total de visitantes (clicks) que han completado una transacción.');
+define('TEXT_AMOUNT_HELP', '<i>Cantidad</i> representa el valor total de las ventas que se le acreditan.');
+define('TEXT_AVERAGE_HELP', '<i>Media</i> representa el valor medio de las ventas que se le acreditan.');
+define('TEXT_COMMISSION_RATE_HELP', '<i>Tipo de comisión</i>  representa la comisión que se le paga por las ventas como un porcentaje.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<i>Tipo de clicks</i>  representa la comisión que se le paga por cada click');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<i>Tipo de pago por ventas</i> representa la comisión que se le paga de venta en venta.');
+define('TEXT_COMMISSION_HELP', '<i>Comisión</i> representa las comisiones totales que se le deben');
+define('TEXT_CLOSE_WINDOW', 'Cerrar ventana [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Resumen de asociados');
+define('TEXT_SUMMARY_TITLE', 'Resumen de asociados');
+define('TEXT_IMPRESSIONS', 'Impresiones totales de banner: ');
+define('TEXT_VISITS', 'Total de visitas de asociados: ');
+define('TEXT_TRANSACTIONS', 'Total de transacciones de asociados: ');
+define('TEXT_AFFILIATES', 'Número de asociados: ');
+define('TEXT_CONVERSION', 'Conversiones: ');
+define('TEXT_AMOUNT', 'Total de ventas de asociados: ');
+define('TEXT_AVERAGE', 'Media de pagos/ventas de asociados: ');
+define('TEXT_COMMISSION_RATE', 'Tipo de comisión: ');
+define('TEXT_PAYPERSALE_RATE', 'Tipo de pago por venta: ');
+define('TEXT_CLICKTHROUGH_RATE', 'Tipo de clicks: ');
+define('TEXT_COMMISSION', 'Total de comisiones de asociados : ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Pulse en [?] para ver una descripción de cada categoría.');
+define('HEADING_SUMMARY_HELP', 'Ayuda de afiliados');
+define('TEXT_IMPRESSIONS_HELP', '<i>Impresiones</i> muestra el número de veces que el banner o enlace se ha mostado durante un periodo de tiempo dado.');
+define('TEXT_VISITS_HELP', '<i>Visitas</i> representa el número total de clicks de visitantes llegados desde su sitio web.');
+define('TEXT_TRANSACTIONS_HELP', '<i>Transacciones</i> representa el número total de transacciones completas que se le acreditan.');
+define('TEXT_CONVERSION_HELP', '<i>Conversiones</i> representa el número total de visitantes (clicks) que han completado una transacción.');
+define('TEXT_AMOUNT_HELP', '<i>Cantidad</i> representa el valor total de las ventas que se le acreditan.');
+define('TEXT_AVERAGE_HELP', '<i>Media</i> representa el valor medio de las ventas que se le acreditan.');
+define('TEXT_COMMISSION_RATE_HELP', '<i>Tipo de comisión</i>  representa la comisión que se le paga por las ventas como un porcentaje.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<i>Tipo de clicks</i>  representa la comisión que se le paga por cada click');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<i>Tipo de pago por ventas</i>  representa la comisión que se le paga de venta en venta.');
+define('TEXT_COMMISSION_HELP', '<i>Commision</i>  representa las comisiones totales que se le deben');
+define('TEXT_CLOSE_WINDOW', 'Cerrar ventana [x]');
+
+define('IMAGE_BANNERS','Banners');
+define('IMAGE_CLICKTHROUGHS','Informe de clicks');
+define('IMAGE_SALES','Informe de ventas');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/algo_fraud_screener.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/algo_fraud_screener.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/algo_fraud_screener.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<?php
+/*
+  $Id: orders.php,v 1.25 2003/06/20 00:28:44 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// AlgoZone - Algozone Fraud Screen Tool definitions
+
+define('ALGO_FS_DISTANCE', '<b>Distance(mi/km)</b> ');
+define('ALGO_FS_DISTANCE_M', '<b>Distance(m) </b>');
+define('ALGO_FS_DISTANCE_K', '<b>Distance(k) </b>');
+define('ALGO_FS_COUNTRY', '<b>Country Match  </b>');
+define('ALGO_FS_CODE', '<b>Country Code  </b>');
+define('ALGO_FS_FREE_EMAIL', '<b>Free Email  </b>');
+define('ALGO_FS_ANONYMOUS', '<b>Anonymous Proxy  </b>');
+define('ALGO_FS_SCORE', '<b>Score  </b>');
+define('ALGO_FS_FRAUD_LEVEL', '<b>Fraud Level  </b>');
+define('ALGO_FS_BIN_MATCH', '<b>Bin Match  </b>');
+define('ALGO_FS_BANK_COUNTRY', '<b>Bank Country  </b>');
+define('ALGO_FS_ERR', '<b>Error  </b>');
+define('ALGO_FS_PROXY_LEVEL', '<b>Proxy Level  </b>');
+define('ALGO_FS_SPAM', '<b>Spam Level  </b>');
+define('ALGO_FS_BANK_NAME', '<b>Bank Name  </b>');
+define('ALGO_FS_BANK_NAME_MATCH', '<b>Bank Name Match  </b>');
+define('ALGO_FS_BANK_PHONE', '<b>Bank Phone  </b>');
+define('ALGO_FS_BANK_PHONE_MATCH', '<b>Bank Phone Match  </b>');
+define('ALGO_FS_IP', '<b>IP Address  </b>');
+define('ALGO_FS_IP_ISP', '<b>ISP  </b>');
+define('ALGO_FS_IP_ISP_ORG', '<b>ISP Org  </b>');
+define('ALGO_FS_IP_CITY', '<b>City   </b>');
+define('ALGO_FS_IP_REGION', '<b>Region   </b>');
+define('ALGO_FS_IP_LATITUDE', '<b>Latitude   </b>');
+define('ALGO_FS_IP_LONGITUDE', '<b>Longitude   </b>');
+define('ALGO_FS_ALGOZONE', '<b>*NOTE:  You need to be subscribed to Premium Services at AlgoZone.com for the following fields </b>');
+define('ALGO_FS_HI_RISK', '<b>High Risk Country  </b>');
+define('ALGO_FS_CUST_PHONE', '<b>Phone Match  </b>');
+define('ALGO_FS_DETAILS', 'See <a href="http://www.algozone.com/" target="_blank"><u>AlgoZone.com</u></a> for explanation of fields');
+
+define('ALGO_FS_BREQUEST', 'Verify Bank Info'); 
+define('ALGO_HELP_PREM_OPT', '*** - values available with fraud screen paid service'); 
+
+define('FS_HELP_DISTANCE', 'Distance from IP address to Billing Location in miles/kilometers (large distance == higher risk)');
+define('FS_HELP_COUNTRY_MATCH', 'Whether country of IP address matches billing address country (mismatch == higher risk)');
+define('FS_HELP_COUNTRY_CODE', 'Country Code of the IP address');
+define('FS_HELP_EMAIL','Whether e-mail is from free e-mail provider (free e-mail == higher risk)');
+define('FS_HELP_ANONYMOUS_IP','Whether IP address is Anonymous Proxy (anonymous proxy == very high risk)');
+define('FS_HELP_BANK_COUNTRY','Country Code of the bank which issued the credit card based on BIN number');
+define('FS_HELP_BIN_MATCH','Whether country of issuing bank based on BIN number matches billing address country');
+define('FS_HELP_BANK_NAME_MATCH','Whether name of issuing bank matches inputed binName. A return value of Yes provides a positive indication that cardholder is in possession of credit card.');
+define('FS_HELP_BANK_NAME','Name of the bank which issued the credit card based on BIN number');
+define('FS_HELP_BANK_PHONE_MATCH','Whether customer service phone number matches inputed binPhone. A return value of Yes provides a positive indication that cardholder is in possession of credit card.');
+define('FS_HELP_BANK_PHONE','Customer service phone number listed on back of credit card');
+define('FS_HELP_PHONE_IN_BILLING_LOC','Whether the customer phone number is in the billing location. A return value of Yes provides a positive indication that the phone number listed belongs to the cardholder. Currently we only support US Phone numbers, in the future we may support other countries.');
+define('FS_HELP_PROXY_LEVEL','Likelihood of IP Address being an Open Proxy');
+define('FS_HELP_SPAM_LEVEL','Likelihood of IP Address being an Spam Source');
+define('FS_HELP_FRAUD_LEVEL','Overall Fraud Risk Factor based on outputs listed above');
+define('FS_HELP_REGION','Estimated Region of the IP address, ISO-3166-2/FIPS 10-4 code');
+define('FS_HELP_CITY','Estimated City of the IP address**');
+define('FS_HELP_LATITUDE','Estimated Latitude of the IP address');
+define('FS_HELP_LONGITUDE','Estimated Longitude of the IP address');
+define('FS_HELP_IP','IP address of the customer. For US addresses, click on the ip address to see a map estimating where the customer is located.');
+define('FS_HELP_ISP','ISP of the IP address');
+define('FS_HELP_ORG','Organization of the IP address');
+define('FS_HELP_IS_HI_RISK_COUNTRY','Whether IP address or billing address country is in Belarus, Colombia, Egypt, Indonesia, Lebanon, Macedonia, Malaysia, Nigeria, Pakistan, Ukraine, or Yugoslavia');
+define('FS_HELP_REMAINING_QUERIES','Number of queries remaining in your account, can be used to alert you when you may need to add more queries to your account');
+define('FS_HELP_DEFAULT','<i><b>To get field descriptions, place cursor on the field name<b></i>');
+
+
+define('NO_IP_ADDRESS_RECORDED','*** NO IP ADDRESS RECORDED FOR THIS ORDER');
+define('MAX_COMMENT_0','(Extremely Low risk)');
+define('MAX_COMMENT_1','(Very Low risk)');
+define('MAX_COMMENT_2','(Low risk)');
+define('MAX_COMMENT_3','(Low risk)');
+define('MAX_COMMENT_4','(Low-Medium risk)');
+define('MAX_COMMENT_5','(Medium risk)');
+define('MAX_COMMENT_6','(Medium-high risk)');
+define('MAX_COMMENT_7','<font color=red>(High risk)</font>');
+define('MAX_COMMENT_8','<font color=red>(Very High risk)</font>');
+define('MAX_COMMENT_9','<font color=red>(Extremely High risk)</font>');
+define('MAX_COMMENT_10','<font color=red>(HIGH PROBABILITY OF FRAUD)</font>');
+define('ERROR','Error');
+define('LAST_QUERIED_ON','Last Queried on :');
+define('REMAINING_QUERIES_1','You have');
+define('REMAINING_QUERIES_2','queries remaining');
+
+// End AlgoZone - Algozone Fraud Screen Tool definitions
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Comentarios de noticias');
+
+define('TABLE_HEADING_ARTICLES', 'Noticias');
+define('TABLE_HEADING_RATING', 'Puntuaci&oacute;n');
+define('TABLE_HEADING_DATE_ADDED', 'Fecha añadida');
+define('TABLE_HEADING_ACTION', 'Acci&oacute;n');
+
+define('ENTRY_ARTICLE', 'Noticia:');
+define('ENTRY_FROM', 'De:');
+define('ENTRY_DATE', 'Fecha:');
+define('ENTRY_REVIEW', 'Comentario:');
+define('ENTRY_REVIEW_TEXT', '<small><font color="#ff0000"><b>NOTA:</b></font></small>&nbsp;el HTML no es traducido!&nbsp;');
+define('ENTRY_RATING', 'Puntuaci&oacute;n:');
+
+define('TEXT_INFO_DELETE_REVIEW_INTRO', 'Estas seguro de que quieres borrar &eacute;ste comentario?');
+
+define('TEXT_INFO_DATE_ADDED', 'Fecha añadida:');
+define('TEXT_INFO_LAST_MODIFIED', '&Uacute;ltima modificaci&oacute;n:');
+define('TEXT_INFO_REVIEW_AUTHOR', 'Autor del comentario:');
+define('TEXT_INFO_REVIEW_RATING', 'Puntuaci&oacute;n:');
+define('TEXT_INFO_REVIEW_READ', 'Leer:');
+define('TEXT_INFO_REVIEW_SIZE', 'Tamaño:');
+define('TEXT_INFO_ARTICLES_AVERAGE_RATING', 'Puntuaci&oacute;n media:');
+
+define('TEXT_IMAGE_NONEXISTENT', 'LA IMAGEN NO EXISTE');
+
+define('TEXT_OF_5_STARS', '%s de 5 estrellas!');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>Excelente</b></font></small>');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>Pobre</b></font></small>');
+define('TEXT_INFO_HEADING_DELETE_REVIEW', 'Borrar comentario');
+/* <Mav was here!> */
+define('TEXT_APPROVED', 'Aprobado') ;
+define('TEXT_APPROVE', 'Aprobar') ;
+define('TEXT_DISAPPROVE', 'Desaprobar') ;
+define('TEXT_YES', 'S&iacute;') ;
+define('TEXT_NO', 'No') ;
+/* </Mav was here!> */
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/article_search.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/article_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/article_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: article_search.php
+  By AlDaffodil:  aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_1', 'Article Search');
+define('HEADING_TITLE_2', 'Articles meeting the search criteria');
+
+define('NAVBAR_TITLE_1', 'Article Search');
+define('NAVBAR_TITLE_2', 'Articles meeting the search criteria');
+define('TABLE_HEADING_ARTICLES', 'Article');
+
+define('TEXT_ARTICLE_NAME' , 'Article Title & Link');
+define('TEXT_ARTICLE_EXCERPT' , 'Article Excerpt');
+
+define('TEXT_NO_ARTICLES', 'There are no articles matching the search criteria.');
+
+define('ERROR_INPUT', 'Please enter a search term.');
+define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/articles.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Secciones / Noticias');
+define('HEADING_TITLE_SEARCH', 'Buscar:');
+define('HEADING_TITLE_GOTO', 'Ir a:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_TOPICS_ARTICLES', 'Secciones / Noticias');
+define('TABLE_HEADING_ACTION', 'Acci&oacute;n');
+define('TABLE_HEADING_STATUS', 'Estado');
+
+define('TEXT_ARTICLES_CURRENT', 'Seleccionado:');
+
+define('TEXT_NEW_ARTICLE', 'Nueva noticia en &quot;%s&quot;');
+define('TEXT_TOPICS', 'Secciones:');
+define('TEXT_SUBTOPICS', 'Subsecciones:');
+define('TEXT_ARTICLES', 'Noticias:');
+define('TEXT_ARTICLES_AVERAGE_RATING', 'Puntuaci&oacute;n media:');
+define('TEXT_ARTICLES_HEAD_TITLE_TAG', 'T&iacute;tulo de la p&aacute;gina HTML:');
+define('TEXT_ARTICLES_HEAD_DESC_TAG', 'Meta Descripci&oacute;n:<br><small>(Article Abstract =<br>first %s charachters)</small>');
+define('TEXT_ARTICLES_HEAD_KEYWORDS_TAG', 'Meta palabras clave:');
+define('TEXT_DATE_ADDED', 'Fecha publicaci&oacute;n:');
+define('TEXT_DATE_AVAILABLE', 'Fecha de publicaci&oacute;n:');
+define('TEXT_LAST_MODIFIED', '&Uacute;ltima modificaci&oacute;n:');
+define('TEXT_NO_CHILD_TOPICS_OR_ARTICLES', 'Por favor introduce una nueva secci&oacute;n o noticia en este nivel.');
+define('TEXT_ARTICLE_MORE_INFORMATION', 'Para m&aacute;s informaci&oacute;n, haz click <a href="http://%s" target="blank"><u>aqu&iacute;</u></a>.');
+define('TEXT_ARTICLE_DATE_ADDED', 'Esta noticia fu&eacute; añadida en esta web el %s.');
+define('TEXT_ARTICLE_DATE_AVAILABLE', 'Esta noticia ser&aacute; publicada el %s.');
+
+define('TEXT_EDIT_INTRO', 'Por favor, haz los cambios necesarios');
+define('TEXT_EDIT_TOPICS_ID', 'ID de secci&oacute;n:');
+define('TEXT_EDIT_TOPICS_NAME', 'Nombre de secci&oacute;n:');
+define('TEXT_EDIT_SORT_ORDER', 'Orden:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Por favor escoge una nueva secci&oacute;n para copiar esta noticia');
+define('TEXT_INFO_CURRENT_TOPICS', 'Secciones disponibles:');
+
+define('TEXT_INFO_HEADING_NEW_TOPIC', 'Nueva secci&oacute;n');
+define('TEXT_INFO_HEADING_EDIT_TOPIC', 'Editar secci&oacute;n');
+define('TEXT_INFO_HEADING_DELETE_TOPIC', 'Borrar secci&oacute;n');
+define('TEXT_INFO_HEADING_MOVE_TOPIC', 'Mover secci&oacute;n');
+define('TEXT_INFO_HEADING_DELETE_ARTICLE', 'Borrar noticia');
+define('TEXT_INFO_HEADING_MOVE_ARTICLE', 'Mover noticia');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copiar a');
+
+define('TEXT_DELETE_TOPIC_INTRO', '¿Estas seguro de que quieres borrar esta secci&oacute;n?');
+define('TEXT_DELETE_ARTICLE_INTRO', '¿Estas seguro de que quieres borrar de forma permanente esta noticia?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> ¡Hay %s subsecciones vinculadas a esta secci&oacute;n!');
+define('TEXT_DELETE_WARNING_ARTICLES', '<b>WARNING:</b> ¡Hay %s noticias vinculadas a esta secci&oacute;n!');
+
+define('TEXT_MOVE_ARTICLES_INTRO', 'Por favor selecciona una secci&oacute;n de destino para <b>%s</b>');
+define('TEXT_MOVE_TOPICS_INTRO', 'Por favor selecciona una secci&oacute;n de destino para <b>%s</b>');
+define('TEXT_MOVE', 'Mover <b>%s</b> a:');
+
+define('TEXT_NEW_TOPIC_INTRO', 'Por favor rellena la siguiente informaci&oacute;n para la nueva secci&oacute;n');
+define('TEXT_TOPICS_NAME', 'Nombre de secci&oacute;n:');
+define('TEXT_SORT_ORDER', 'Orden:');
+
+define('TEXT_EDIT_TOPICS_HEADING_TITLE', 'T&iacute;tulo de cabecera de la secci&oacute;n:');
+define('TEXT_EDIT_TOPICS_DESCRIPTION', 'Descripci&oacute;n de la secci&oacute;n:');
+
+define('TEXT_ARTICLES_STATUS', 'Estado de la noticia:');
+define('TEXT_ARTICLES_DATE_AVAILABLE', 'Fecha de publicaci&oacute;n:');
+define('TEXT_ARTICLE_AVAILABLE', 'Publicado');
+define('TEXT_ARTICLE_NOT_AVAILABLE', 'Esbozo');
+define('TEXT_ARTICLES_AUTHOR', 'Autor:');
+define('TEXT_ARTICLES_NAME', 'Nombre de la noticia:');
+define('TEXT_ARTICLES_DESCRIPTION', 'Contenido de la noticia:');
+define('TEXT_ARTICLES_URL', 'URL de la noticia:');
+define('TEXT_ARTICLES_URL_WITHOUT_HTTP', '<small>(sin http://)</small>');
+
+define('EMPTY_TOPIC', 'Secci&oacute;n vac&iacute;a');
+
+define('TEXT_HOW_TO_COPY', 'M&eacute;todo de copia:');
+define('TEXT_COPY_AS_LINK', 'Vincular noticia');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicar noticia');
+
+define('ERROR_CANNOT_LINK_TO_SAME_TOPIC', 'Error: No es posible vincular noticias en la misma secci&oacute;n.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: El directorio de imagenes no tiene permisos de escritura: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: El directorio de im&aacute;genes no existe: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_TOPIC_TO_PARENT', 'Error: Una secci&oacute;n no puede moverse a una subsecci&oacute;n.');
+
+define('DATE_FORMAT', '(YYYY-MM-DD)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/articles_config.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/articles_config.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/articles_config.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: articles_config.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Configuraci&oacute;n de noticias');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'T&iacute;tulo');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Valor');
+define('TABLE_HEADING_ACTION', 'Acci&oacute;n');
+
+define('TEXT_INFO_EDIT_INTRO', 'Por favor haz los cambios necesarios');
+define('TEXT_INFO_DATE_ADDED', 'Fecha de publicaci&oacute;n:');
+define('TEXT_INFO_LAST_MODIFIED', '&Uacute;ltima modificaci&oacute;n:');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/articles_xsell.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/articles_xsell.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/articles_xsell.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: articles_xsell.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Venta de productos a trav&eacute;s de las noticias');
+
+define('HEADING_ARTICLE_NAME', 'Nombre de la noticia');
+define('HEADING_CROSS_ASSOCIATION', 'Productos asociados');
+define('HEADING_CROSS_SELL_ACTIONS', 'Acciones de venta');
+define('HEADING_PRODUCT_NAME', 'Nombre de producto');
+define('HEADING_PRODUCT_ORDER', 'Orden (1=Arriba)');
+
+define('TEXT_DATABASE_UPDATED', 'La base de datos ha sido actualizada.');
+define('TEXT_NO_DELETE', 'no se puede borrar');
+define('TEXT_NO_INSERT', 'no se puede introducir en la base de datos');
+define('TEXT_NO_UPDATE', 'no se puede actualizar la base de datos');
+
+define('TEXT_LINK_MAIN_PAGE', '<a href="%s">Haz click aqu&iacute;</a> para volver a la p&aacute;gina principal.');
+define('TEXT_LINK_SORT_PRODUCTS', '<a href="%s">Haz click aqu&iacute;</a> para ordenar los productos asociados con esta noticia.<br><small>Nota: esto es necesario siempre que un producto es añadido o borrado.</small>');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/attributes_sorter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/attributes_sorter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/attributes_sorter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  Translated by: jparis v1.0
+  Definitions for Attributes Sorter
+*/
+
+// Turn things off
+define('I_AM_OFF',true);
+
+// WebMakers.com Added: Attributes - Definitions to move to attribute_sorter.php
+define('TABLE_HEADING_PRODUCT_ATTRIBUTE_ONE_TIME','Cobrar sólo una vez');
+
+// WebMakers.com Added: Attribute Copy Option
+define('TEXT_COPY_ATTRIBUTES_ONLY','Sólo se usa para duplicar productos ...');
+define('TEXT_COPY_ATTRIBUTES','¿Copiar los atributos del producto al duplicado?');
+define('TEXT_COPY_ATTRIBUTES_YES','Sí');
+define('TEXT_COPY_ATTRIBUTES_NO','No');
+
+// WebMakers.com Added: Attributes Copy from Existing Product to Existing Product
+define('PRODUCT_NAMES_HELPER','<FONT COLOR="FF0000"><a href="' . 'quick_products_popup.php' . '" onclick="NewWindow(this.href,\'name\',\'700\',\'500\',\'yes\');return false;">[ Búsqueda por ID de producto ]</a>');
+define('ATTRIBUTES_NAMES_HELPER','<FONT COLOR="FF0000"><a href="' . 'quick_attributes_popup.php?look_it_up=' . $pID . '&my_languages_id=' . $languages_id . '" onclick="NewWindow2(this.href,\'name2\',\'700\',\'400\',\'yes\');return false;">[ Lisa rápida de atributos para el número de ID ' . $pID . ' ]</a>');
+
+// WebMakers.com Added: Product Option Attributes Sort Order - products_attributes.php
+define('TABLE_HEADING_OPTION_SORT_ORDER','Ordenados por');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/authors.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Autores');
+
+define('TABLE_HEADING_AUTHORS', 'Autores');
+define('TABLE_HEADING_ACTION', 'Acci&oacute;n');
+
+define('TEXT_HEADING_NEW_AUTHOR', 'Nuevo autor');
+define('TEXT_HEADING_EDIT_AUTHOR', 'Editar autor');
+define('TEXT_HEADING_DELETE_AUTHOR', 'Borrar autor');
+
+define('TEXT_ARTICLE_BY', 'Noticia por ');
+define('TEXT_MORE_INFORMATION', 'Para obtener m&aacute;s informaci&oacute;n, por favor visita estos autores <a href="http://%s" target="_blank">aqu&iacute;</a>.');
+
+define('TEXT_AUTHORS', 'Autores:');
+define('TEXT_DATE_ADDED', 'Fecha de publicaci&oacute;n:');
+define('TEXT_LAST_MODIFIED', '&Uacute;ltima modificaci&oacute;n:');
+define('TEXT_ARTICLES', 'Noticias:');
+
+define('TEXT_NEW_INTRO', 'Por favor rellena la siguienet informaci&oacute;n para el nuevo autor');
+define('TEXT_EDIT_INTRO', 'Por favor haz los cambios necesarios.');
+
+define('TEXT_AUTHORS_NAME', 'Nombre de los autores:');
+define('TEXT_AUTHORS_DESCRIPTION', 'Descripci&oacute;n de los autores:');
+define('TEXT_AUTHORS_URL', 'URL de los autores:');
+
+define('TEXT_DELETE_INTRO', '¿Est&aacute;s seguro que quieres borrar a este autor?');
+define('TEXT_DELETE_ARTICLES', '¿Desea borrar las noticias de este autor? (Incluyendo los comentarios y las noticias pendientes de publicaci&oacute;n)');
+define('TEXT_DELETE_WARNING_ARTICLES', '<b>WARNING:</b> ¡Hay %s noticias vinculadas a este autor!');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: No es posible escribir en este directorio. Por favor corrige los permisos de acceso de: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: El directorio no existe: %s');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/backup.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/backup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/backup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: backup.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Copia de seguridad de la base de datos');
+
+define('TABLE_HEADING_TITLE', 'Título');
+define('TABLE_HEADING_FILE_DATE', 'Fecha');
+define('TABLE_HEADING_FILE_SIZE', 'Tamaño');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_HEADING_NEW_BACKUP', 'Nueva copia de seguridad');
+define('TEXT_INFO_HEADING_RESTORE_LOCAL', 'Restaurar localmente');
+define('TEXT_INFO_NEW_BACKUP', 'No interrumpa el proceso de copia, que puede durar unos minutos.');
+define('TEXT_INFO_UNPACK', '<br><br>(despues de descomprimir el archivo)');
+define('TEXT_INFO_RESTORE', 'No interrumpa el proceso de restauración.<br><br>¡Cuanto más grande sea la copia de seguridad, más tardará este proceso!<br><br>Si es posible, use el cliente de mysql.<br><br>Por ejemplo:<br><br><b>mysql -h' . DB_SERVER . ' -u' . DB_SERVER_USERNAME . ' -p ' . DB_DATABASE . ' < %s </b> %s');
+define('TEXT_INFO_RESTORE_LOCAL', 'No interrumpa el proceso de restauración.<br><br>¡Cuanto más grande sea la copia de seguridad, más tardará este proceso!');
+define('TEXT_INFO_RESTORE_LOCAL_RAW_FILE', 'El archivo subido debe ser de texto.');
+define('TEXT_INFO_DATE', 'Fecha:');
+define('TEXT_INFO_SIZE', 'Tamaño:');
+define('TEXT_INFO_COMPRESSION', 'Compresión:');
+define('TEXT_INFO_USE_GZIP', 'Usar GZIP');
+define('TEXT_INFO_USE_ZIP', 'Usar ZIP');
+define('TEXT_INFO_USE_NO_COMPRESSION', 'Sin compresión (directamente SQL)');
+define('TEXT_INFO_DOWNLOAD_ONLY', 'Descargar sólo (no guardar en el servidor)');
+define('TEXT_INFO_BEST_THROUGH_HTTPS', 'Preferiblemente con una conexión segura HTTPS');
+define('TEXT_DELETE_INTRO', '¿Seguro que quiere eliminar esta copia de seguridad?');
+define('TEXT_NO_EXTENSION', 'Ninguna');
+define('TEXT_BACKUP_DIRECTORY', 'Directorio para copias de seguridad:');
+define('TEXT_LAST_RESTORATION', 'Última restauración:');
+define('TEXT_FORGET', '(<u>descartar</u>)');
+
+define('ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio de copias de seguridad. Por favor indíquelo en configure.php');
+define('ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE', 'Error: No hay permiso de escritura en el directorio de copias de seguridad.');
+define('ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE', 'Error: No se aceptan enlaces.');
+
+define('SUCCESS_LAST_RESTORE_CLEARED', 'OK: La fecha de última restauración ha sido borrada.');
+define('SUCCESS_DATABASE_SAVED', 'OK: Se ha guardado la base de datos.');
+define('SUCCESS_DATABASE_RESTORED', 'OK: Se ha restaurado la base de datos.');
+define('SUCCESS_BACKUP_DELETED', 'OK: Se ha eliminado la copia de seguridad.');
+
+define('BYTES', ' bytes');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/backup_mysql.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/backup_mysql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/backup_mysql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// |zen-cart Open Source E-commerce                                       |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 2003 The zen-cart developers                           |
+// |                                                                      |
+// | http://www.zen-cart.com/index.php                                    |
+// |                                                                      |
+// | Portions Copyright (c) 2003 osCommerce                               |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the GPL license,       |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available through the world-wide-web at the following url:           |
+// | http://www.zen-cart.com/license/2_0.txt.                             |
+// | If you did not receive a copy of the zen-cart license and are unable |
+// | to obtain it through the world-wide-web, please send a note to       |
+// | license at zen-cart.com so we can mail you a copy immediately.          |
+// +----------------------------------------------------------------------+
+// $Id: backup_mysql.php,v 1.2.0.1 2004/08/03 00:00:00 DrByteZen Exp $
+// Translated by: jparis v1.0
+
+// define the locations of the mysql utilities.  Typical location is in '/usr/bin/' ... but not on Windows servers.
+// try 'c:/mysql/bin/mysql.exe' and 'c:/mysql/bin/mysqldump.exe' on Windows hosts ... change drive letter and path as needed
+define('LOCAL_EXE_MYSQL',     'e:/apache/xampp/mysql');  // para restauraciones
+define('LOCAL_EXE_MYSQLDUMP', 'e:/apache/wampp/mysqldump');  // para copias de seguridad
+
+// the following are the language definitions
+define('HEADING_TITLE', 'Gestor de copias de seguridad de la base de datos - MySQL');
+define('WARNING_NOT_SECURE_FOR_DOWNLOADS','<span class="errorText">NOTA: El SSL no esta activado. Cualquier descarga que haga desde esta página no estará encriptada. Las copias de seguridad y la restauración funcionarán, pero descargar o subir archvos desde/hacia el servidor representa un riesgo en la seguridad.');
+define('TABLE_HEADING_TITLE', 'Título');
+define('TABLE_HEADING_FILE_DATE', 'Fecha');
+define('TABLE_HEADING_FILE_SIZE', 'Tamaño');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_HEADING_NEW_BACKUP', 'Nueva copia de seguridad');
+define('TEXT_INFO_HEADING_RESTORE_LOCAL', 'Restaurar localmente');
+define('TEXT_INFO_NEW_BACKUP', 'No interrumpa el proceso de copia de seguridad, puede llevar algunos minutos.');
+define('TEXT_INFO_UNPACK', '<br><br>(después de descomprimir el archivo)');
+define('TEXT_INFO_RESTORE', 'No interrumpa el proceso de restauración.<br><br>¡Cuanto más grande la copia de seguridad, más largo es el proceso!<br><br>Si es posible, utilice el cliente de mysql.<br><br>Por ejemplo:<br><br><b>mysql -h' . DB_SERVER . ' -u' . DB_SERVER_USERNAME . ' -p ' . DB_DATABASE . ' < %s </b> %s');
+define('TEXT_INFO_RESTORE_LOCAL', 'No interrumpa el proceso de restauración.<br><br>¡Cuanto más grande la copia de seguridad, más largo es el proceso!');
+define('TEXT_INFO_RESTORE_LOCAL_RAW_FILE', 'El archivo subido debe ser de texto.');
+define('TEXT_INFO_DATE', 'Fecha:');
+define('TEXT_INFO_SIZE', 'Tamaño:');
+define('TEXT_INFO_COMPRESSION', 'Compresión:');
+define('TEXT_INFO_USE_GZIP', 'Usar GZIP');
+define('TEXT_INFO_USE_ZIP', 'Usar ZIP');
+define('TEXT_INFO_USE_NO_COMPRESSION', 'Sin compresión (SQL puro)');
+define('TEXT_INFO_DOWNLOAD_ONLY', 'Descargar sin almacenar en el servidor');
+define('TEXT_INFO_BEST_THROUGH_HTTPS', '(Sera más seguro vía conexión HTTPS)');
+define('TEXT_DELETE_INTRO', '¿Está seguro de que quiere eliminar esta copia de seguridad?');
+define('TEXT_NO_EXTENSION', 'Ninguna');
+define('TEXT_BACKUP_DIRECTORY', 'Directorio de copias de seguridad:');
+define('TEXT_LAST_RESTORATION', 'Última restauración:');
+define('TEXT_FORGET', '(descartar)');
+
+define('ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST', 'Error: El directorio de copias de seguridad no existe. Por favor indíquelo en configure.php.');
+define('ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE', 'Error: No hay permisos de escritura en el directorio de backup.');
+define('ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE', 'Error: No se admiten enlaces.');
+define('ERROR_CANT_BACKUP_IN_SAFE_MODE','ERROR: No se puede usar el script de copia de seguridad cuando esta activado safe_mode (modo seguro).');
+
+define('SUCCESS_LAST_RESTORE_CLEARED', 'OK: Se ha borrado la última fecha de restauración.');
+define('SUCCESS_DATABASE_SAVED', 'OK: Se ha guardado la base de datos.');
+define('SUCCESS_DATABASE_RESTORED', 'OK: Se ha restaurado la base de datos.');
+define('SUCCESS_BACKUP_DELETED', 'OK: Se ha eliminado la copia de seguridad.');
+define('FAILURE_DATABASE_NOT_SAVED', 'Fallo: La base de datos NO se ha guardado.');
+define('FAILURE_DATABASE_NOT_SAVED_UTIL_NOT_FOUND', 'ERROR: No se encuentra la utilidad de copia de seguridad MYSQLDUMP. FALLO EN LA COPIA DE SEGURIDAD.');
+define('FAILURE_DATABASE_NOT_RESTORED', 'Fallo: Es posible que la base de datos NO se restaurase adecuadamente. Por favor compruébelo.');
+define('FAILURE_DATABASE_NOT_RESTORED_FILE_NOT_FOUND', 'Fallo: La base de datos NO se ha restaurado.  ERROR: NO SE ENCUENTRA EL ARCHIVO: %s');
+define('FAILURE_DATABASE_NOT_RESTORED_UTIL_NOT_FOUND', 'ERROR: No se encontró la utilidad de restauración de MYSQL. LA RESTAURACIÓN HA FALLADO.');
+
+
+define('BACKUP_MYSQl_ERROR_MSG_1', 'Checking Path: ');
+define('BACKUP_MYSQl_ERROR_MSG_2', 'COMMAND FILES FOUND/SELECTED:');
+define('BACKUP_MYSQl_ERROR_MSG_3', 'COMMAND: ');
+define('BACKUP_MYSQl_ERROR_MSG_4', "valueA: ");
+define('BACKUP_MYSQl_ERROR_MSG_5', "valueB: ");
+define('BACKUP_MYSQl_ERROR_MSG_6', 'Result code: ');
+define('BYTES', ' bytes');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/banner_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/banner_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/banner_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: banner_manager.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gestor de Banners');
+
+define('TABLE_HEADING_BANNERS', 'Banners');
+define('TABLE_HEADING_GROUPS', 'Grupos');
+define('TABLE_HEADING_STATISTICS', 'Mostrados / Clicks');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_BANNERS_TITLE', 'Título:');
+define('TEXT_BANNERS_URL', 'URL del banner:');
+define('TEXT_BANNERS_GROUP', 'Grupo del banner:');
+define('TEXT_BANNERS_NEW_GROUP', ', o introduzca un grupo nuevo');
+define('TEXT_BANNERS_IMAGE', 'Imagen:');
+define('TEXT_BANNERS_IMAGE_LOCAL', ', o introduzca un archivo local');
+define('TEXT_BANNERS_IMAGE_TARGET', 'Destino de la imagen (Grabar en):');
+define('TEXT_BANNERS_HTML_TEXT', 'Texto HTML:');
+define('TEXT_BANNERS_EXPIRES_ON', 'Caduca el:');
+define('TEXT_BANNERS_OR_AT', ', o tras');
+define('TEXT_BANNERS_IMPRESSIONS', 'impresiones/vistas.');
+define('TEXT_BANNERS_SCHEDULED_AT', 'Programado para:');
+define('TEXT_BANNERS_BANNER_NOTE', '<b>Notas sobre el banner:</b><ul><li>Use una imagen o texto HTML para el banner - no ambos.</li><li>El texto HTML tiene prioridad sobre una imagen</li></ul>');
+define('TEXT_BANNERS_INSERT_NOTE', '<b>Notas sobre la imagen:</b><ul><li>¡El directorio donde suba la imagen debe de tener configurados los permisos de escritura necesarios!</li><li>No rellene el campo \'Grabar en\' si no va a subir una imagen al servidor (por ejemplo, cuando use una imagen ya existente en el servidor).</li><li>El campo \'Grabar en\' debe de ser un directorio que exista y terminado en una barra (por ejemplo: banners/).</li></ul>');
+define('TEXT_BANNERS_EXPIRCY_NOTE', '<b>Notas sobre la caducidad:</b><ul><li>Sólo se debe de rellenar uno de los dos campos</li><li>Si el banner no debe de caducar no rellene ninguno de los campos</li></ul>');
+define('TEXT_BANNERS_SCHEDULE_NOTE', '<b>Notas sobre la programación:</b><ul><li>Si se configura una fecha de programación el banner se activará en esa fecha.</li><li>Todos los banners programados se marcan como inactivos hasta que llegue su fecha, cuando se marcan activos.</li></ul>');
+
+define('TEXT_BANNERS_DATE_ADDED', 'Añadido el:');
+define('TEXT_BANNERS_SCHEDULED_AT_DATE', 'Programado para: <b>%s</b>');
+define('TEXT_BANNERS_EXPIRES_AT_DATE', 'Caduca el: <b>%s</b>');
+define('TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS', 'Caduca tras: <b>%s</b> vistas');
+define('TEXT_BANNERS_STATUS_CHANGE', 'Cambio estado: %s');
+
+define('TEXT_BANNERS_DATA', 'D<br>A<br>T<br>O<br>S');
+define('TEXT_BANNERS_LAST_3_DAYS', 'Últimos 3 días');
+define('TEXT_BANNERS_BANNER_VIEWS', 'Vistas');
+define('TEXT_BANNERS_BANNER_CLICKS', 'Clicks');
+
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que quiere eliminar este banner?');
+define('TEXT_INFO_DELETE_IMAGE', 'Borrar imagen');
+
+define('SUCCESS_BANNER_INSERTED', 'OK: Se ha añadido el banner.');
+define('SUCCESS_BANNER_UPDATED', 'OK: Se ha actualizado el banner.');
+define('SUCCESS_BANNER_REMOVED', 'OK: Se ha eliminado el banner.');
+define('SUCCESS_BANNER_STATUS_UPDATED', 'OK: El estado del banner se ha actualizado.');
+
+define('ERROR_BANNER_TITLE_REQUIRED', 'Error: Es necesario el título del banner.');
+define('ERROR_BANNER_GROUP_REQUIRED', 'Error: Es necesario el grupo del banner.');
+define('ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio destino: %s');
+define('ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: No se puede escribir en el directorio destino: %s');
+define('ERROR_IMAGE_DOES_NOT_EXIST', 'Error: No existe imagen.');
+define('ERROR_IMAGE_IS_NOT_WRITEABLE', 'Error: No se puede eliminar la imagen.');
+define('ERROR_UNKNOWN_STATUS_FLAG', 'Error: Bandera de estado desconocida.');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio de gráficos. Por favor cree un directorio llamado \'graphs\' dentro de \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Error: No se puede escribir en el directorio de gráficos.');
+
+define('DATE_FORMAT', '(dd/mm/yyyy)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/banner_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/banner_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/banner_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: banner_statistics.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Estadísticas de Banners');
+
+define('TABLE_HEADING_SOURCE', 'Fecha');
+define('TABLE_HEADING_VIEWS', 'Vistas');
+define('TABLE_HEADING_CLICKS', 'Clicks');
+
+define('TEXT_BANNERS_DATA', 'D<br>a<br>t<br>o<br>s');
+define('TEXT_BANNERS_DAILY_STATISTICS', '%s Estadísticas diarias de %s %s');
+define('TEXT_BANNERS_MONTHLY_STATISTICS', '%s Estadísticas mensuales de %s');
+define('TEXT_BANNERS_YEARLY_STATISTICS', '%s Estadísticas anuales');
+
+define('STATISTICS_TYPE_DAILY', 'Diarias');
+define('STATISTICS_TYPE_MONTHLY', 'Mensuales');
+define('STATISTICS_TYPE_YEARLY', 'Anuales');
+
+define('TITLE_TYPE', 'Tipo:');
+define('TITLE_YEAR', 'Año:');
+define('TITLE_MONTH', 'Mes:');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio de gráficos. Por favor cree un directorio llamado \'graphs\' dentro de \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Error: No se puede escribir en el directorio de gráficos.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/c_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/c_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/c_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,147 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Editar pedido');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'ID de pedido:');
+define('HEADING_TITLE_STATUS', 'Estado:');
+define('ADDING_TITLE', 'Añadir un producto al pedido');
+
+define('CATEGORY_ORDER_DETAILS', 'Customer Details');
+define('ENTRY_CURRENCY', 'Customer Currency');
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Comentarios');
+define('TABLE_HEADING_CUSTOMERS', 'Clientes');
+define('TABLE_HEADING_ORDER_TOTAL', 'Total del pedido');
+define('TABLE_HEADING_DATE_PURCHASED', 'Fecha de compra');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_QUANTITY', 'Cant.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modelo');
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_TAX', 'Impuesto');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_UNIT_PRICE', 'Precio unitario');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Precio total');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Cliente notificado');
+define('TABLE_HEADING_DATE_ADDED', 'Fecha añadido');
+
+define('ENTRY_CUSTOMER', 'Cliente:');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Company');
+define('ENTRY_CUSTOMER_ADDRESS', 'Address');
+define('ENTRY_CUSTOMER_SUBURB', 'Suburb');
+define('ENTRY_CUSTOMER_CITY', 'City');
+define('ENTRY_CUSTOMER_STATE', 'State');
+define('ENTRY_CUSTOMER_POSTCODE', 'Postcode');
+define('ENTRY_CUSTOMER_COUNTRY', 'Country');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Vendido a:');
+define('ENTRY_DELIVERY_TO', 'Facturado a:');
+define('ENTRY_SHIP_TO', 'Enviado a:');
+define('ENTRY_SHIPPING_ADDRESS', 'Dirección de envio:');
+define('ENTRY_BILLING_ADDRESS', 'Dirección de facturación:');
+define('ENTRY_PAYMENT_METHOD', 'Método de pago:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Tipo de tarjeta de crédito:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Propietario de la tarjeta:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Número de la tarjeta de crédito:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Fecha de caducidad de la tarjeta:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Impuesto:');
+define('ENTRY_SHIPPING', 'Portes:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Fecha de compra:');
+define('ENTRY_STATUS', 'Estado:');
+define('ENTRY_DATE_LAST_UPDATED', 'Fecha de la última actualización:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notificar al cliente:');
+define('ENTRY_NOTIFY_COMMENTS', 'Añadir comentarios:');
+define('ENTRY_PRINTABLE', 'Imprimir factura');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Utilizar un número negativo -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Eliminar pedido');
+define('TEXT_INFO_DELETE_INTRO', '¿Está seguro de eliminar este pedido?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Recargar los productos en el stock');
+define('TEXT_DATE_ORDER_CREATED', 'Fecha de creación:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Última modificacion:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Add New Product');
+define('TEXT_INFO_PAYMENT_METHOD', 'Método de pago:');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> This CCV is not store or has been removed from the store.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'Todos los pedidos');
+define('TEXT_NO_ORDER_HISTORY', 'No hay histórico de pedidos');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Actualización de pedido');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Número de pedido:');
+define('EMAIL_TEXT_INVOICE_URL', 'Factura detallada:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Fecha de pedido:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Su pedido ha sido actualizado con el siguiente estado.' . "\n\n" . 'Nuevo estado: %s' . "\n\n" . 'Por favor responda a este email si tiene alguna duda o pregunta.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'Los comentarios para su pedido son' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: El pedido no existe.');
+define('SUCCESS_ORDER_UPDATED', 'OK: El pedido ha sido actualizado.');
+define('WARNING_ORDER_NOT_UPDATED', 'Atención: No hay ningún cambio. El pedido no ha sido actualizado.');
+
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choose a product');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Choose an option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Product has no options, so skipping...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'pieces of this product');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Add');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+define('DONT_ADD_NEW_PRODUCT', 'No agregue el producto nuevo');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/cache.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/cache.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/cache.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: cache.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Control de Caché');
+
+define('TABLE_HEADING_CACHE', 'Bloques de cache');
+define('TABLE_HEADING_DATE_CREATED', 'Fecha de creación');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'El archivo no existe');
+define('TEXT_CACHE_DIRECTORY', 'Directorio para el caché: ');
+
+define('ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio para el caché. Especifique un directorio válido en Configuración->Caché.');
+define('ERROR_CACHE_DIRECTORY_NOT_WRITEABLE', 'Error: No hay permiso de escritura en el directorio para el caché.');
+
+// labels for Tools>Cache Control
+define('TEXT_CACHE_CATEGORIES', 'Panel de categorías');
+define('TEXT_CACHE_CATEGORIES1', 'Panel de categorías 1');
+define('TEXT_CACHE_CATEGORIES2', 'Panel de categorías 2');
+define('TEXT_CACHE_CATEGORIES3', 'Panel de categorías 3');
+define('TEXT_CACHE_CATEGORIES4', 'Panel de categorías 4');
+define('TEXT_CACHE_CATEGORIES5', 'Panel de categorías 5');
+define('TEXT_CACHE_ALLPROD', 'Todos los productos');
+define('TEXT_CACHE_ALLMANUF', 'Todos los fabricantes');
+define('TEXT_CACHE_ALLCATS', 'Todas las categorías');
+define('TEXT_CACHE_MANUFACTURERS', 'Panel de fabricantes');
+define('TEXT_CACHE_ALSO_PURCHASED', 'Módulo de "También compraron"');
+define('TEXT_CACHE_COOLMENU', 'Menú especial');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,189 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Imagen del producto:</b><small><br> Imagen principal, usada en el <br><u>catálogo y páginas de descripción</u>.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Imagen pequeña:</b><br><small> Imagen para las páginas de la <br><u>lista de productos</u>.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Imagen ampliada:</b><br><small> Imagen grande, para aparecer en su propia <br><u>ventana</u> al ampliar.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Productos del almacen que comparten esta imagen =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '¿<b>Quitar</b> esta imagen de este producto?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '¿<b>Eliminar</b> esta imagen de este servidor (¡Permanente!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Quitar');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'Eliminar');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Imágenes pequeñas.</b> Si se usa una imagen "SM" <br>(Sola) NO se creará un enlace para ampliación, la imagen "SM"<br> se colocará directamente bajo la <br>descripción del producto. Si se utiliza en conjunto con una imagen <br>"XL" a la derecha, se creará un enlace<br> y la imagen "XL" se mostrará como <br>ampliación en su propia ventana.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Imágenes grandes.</b> Usadas para las ampliaciones<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Imágenes adicionales - Aparecerán bajo la descripción del producto si se usan.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'Imagen SM 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'Imagen XL 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'Imagen SM 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'Imagen XL 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'Imagen SM 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'Imagen XL 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'Imagen SM 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'Imagen XL 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'Imagen SM 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'Imagen XL 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'Imagen SM 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'Imagen XL 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+define('HEADING_TITLE', 'Categorías / Productos');
+define('HEADING_TITLE_SEARCH', 'Buscar:');
+define('HEADING_TITLE_GOTO', 'Ir a:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Categorías / Productos');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_STATUS', 'Estado');
+
+define('TEXT_NEW_PRODUCT', 'Nuevo producto en &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categorías:');
+define('TEXT_SUBCATEGORIES', 'Subcategorías:');
+define('TEXT_PRODUCTS', 'Productos:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Precio:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Clase de impuesto:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Valoración media:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Cantidad:');
+define('TEXT_DATE_ADDED', 'Añadido el:');
+define('TEXT_DELETE_IMAGE', 'Eliminar imagen');
+
+define('TEXT_DATE_AVAILABLE', 'Fecha disponibilidad:');
+define('TEXT_LAST_MODIFIED', 'Modificado el:');
+define('TEXT_IMAGE_NONEXISTENT', 'NO EXISTE IMAGEN');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Por favor, inserte una nueva categoría o producto en este nivel.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'Si quiere más información, visite la <a href="http://%s" target="blank"><u>página</u></a> de este producto.');
+define('TEXT_PRODUCT_DATE_ADDED', 'Este producto fue añadido el %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'Este producto estará disponible el %s.');
+
+define('TEXT_EDIT_INTRO', 'Por favor, haga los cambios necesarios');
+define('TEXT_EDIT_CATEGORIES_ID', 'ID de categoría:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Nombre de categoría:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Imagen de categoría:');
+define('TEXT_EXISTING_CATEGORIES_IMAGE','Existing Image');
+define('TEXT_EDIT_SORT_ORDER', 'Orden:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Encabezado para la categoría:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Descripción para el encabezado:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Meta Tag para el encabezado:');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Meta Tag para la descripción:');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'KeyWord para Meta Tag de la categoría:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Elija la categoría donde quiere copiar este producto');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Categorías:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'Nueva categoría');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Editar categoría');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Eliminar categoría');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Mover categoría');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Eliminar producto');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Mover producto');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copiar a');
+
+define('TEXT_DELETE_CATEGORY_INTRO', '¿Seguro que desea eliminar esta categoría?');
+define('TEXT_DELETE_PRODUCT_INTRO', '¿Está usted seguro de que desea suprimir permanentemente este producto?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>ATENCIÓN:</b> ¡Hay %s subcategorías que pertenecen a esta categoría!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>ATENCIÓN:</b> ¡Hay %s productos en esta categoría!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Elija la categoría hacia donde quiera mover <b>%s</b>');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Elija la categoría hacia donde quiera mover <b>%s</b>');
+define('TEXT_MOVE', 'Mover <b>%s</b> a:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Por favor, rellene los siguientes datos para la nueva categoría');
+define('TEXT_CATEGORIES_NAME', 'Nombre de la categoría:');
+define('TEXT_CATEGORIES_IMAGE', 'Imagen de la categoría:');
+define('TEXT_SORT_ORDER', 'Orden:');
+
+define('TEXT_PRODUCTS_STATUS', 'Estado de los productos:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Fecha disponibilidad:');
+define('TEXT_PRODUCT_AVAILABLE', 'Disponible');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Agotado');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Fabricante del producto:');
+define('TEXT_PRODUCTS_NAME', 'Nombre del producto:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Descripción del producto:');
+define('TEXT_PRODUCTS_QUANTITY', 'Cantidad:');
+define('TEXT_PRODUCTS_MODEL', 'Modelo:');
+define('TEXT_PRODUCTS_IMAGE', 'Imagen:');
+define('TEXT_PRODUCTS_URL', 'URL del producto:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(sin http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Precio del producto (neto):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Precio del producto (PVP):');
+define('TEXT_PRODUCTS_WEIGHT', 'Peso:');
+define('TEXT_NONE', '--ninguno--');
+
+define('EMPTY_CATEGORY', 'Categoría vacía');
+
+define('TEXT_HOW_TO_COPY', 'Método de copia:');
+define('TEXT_COPY_AS_LINK', 'Enlazar el producto');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicar el producto');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: No se pueden enlazar productos en la misma categoría.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: No se puede escribir en el directorio de imágenes del catálogo: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe el directorio de imágenes del catálogo: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: La categoría no se puede mover a una subcategoría.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Información de Meta Tag</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Título de la página del producto :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Descripción del encabezado de página :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Palabras clave del producto :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Editar los atributos del producto');
+
+// mod for sub products
+define('MAX_PRODUCT_SUB_ROWS', '5');
+define('TEXT_SUB_PRODUCT','Sub Product:');
+define('TEXT_SUB_PRODUCT_DELETE','Delete');
+define('TEXT_SUB_PRODUCT_NAME','Name');
+define('TEXT_SUB_PRODUCT_PRICE','Price');
+define('TEXT_SUB_PRODUCT_MODEL','Model');
+define('TEXT_SUB_PRODUCT_QTY','Qty');
+define('TEXT_SUB_PRODUCT_WEIGHT','Weight');
+define('TEXT_SUB_PRODUCT_IMAGE','Image');
+define('TEXT_SUB_PRODUCT_NOTE_1','* additional subproducts available upon insert');
+define('TEXT_SUB_PRODUCT_NOTE_2','* zero quantity disables the subproduct');
+
+// Eversun mod for sppc and qty price breaks
+define('TEXT_PRODUCTS_PRICE', 'Retail Price:');
+define('TEXT_PRODUCTS_GROUPS', 'Groups:');
+define('TEXT_PRODUCTS_BASE', 'Base');
+define('TEXT_PRODUCTS_ABOVE', 'Above');
+define('TEXT_PRODUCTS_QTY', 'Qty');
+define('TEXT_PRODUCTS_QTY_BLOCKS', 'Quantity Blocks:');
+define('TEXT_PRODUCTS_QTY_BLOCKS_INFO', '(can only order in blocks of X quantity)');
+define('TEXT_PRODUCTS_SPPP_NOTE', 'Note that if a field is filled, but the checkbox is unchecked no price will be inserted.<br />If a price is already inserted in the database, but the checkbox unchecked it will be removed from the database.');
+define('TEXT_PRODUCTS_QTY_DISCOUNT', '10');
+
+// Eversun mod end for sppc and qty price breaks
+
+
+
+define('TEXT_PRODUCT_IMAGES', 'Product Images');
+define('TEXT_EXTRA_FIELDS', 'Extra Fields');
+define('TEXT_EXTRA_IMAGES', 'Extra Images');
+define('TEXT_ACTIVE_ATTRIBUTES', 'Active Attributes');
+define('TEXT_COPY_ATTRIBUTES_TO_ANOTHER_PRODUCT', 'Copy Attributes to another product');
+define('TEXT_COPYING_ATTRIBUTES_FROM', 'Copying Attributes from');
+define('TEXT_COPYING_ATTRIBUTES_TO', 'Copying Attributes to');
+define('TEXT_DELETE_ALL_ATTRIBUTE', 'Delete ALL Attributes and Downloads before copying');
+define('TEXT_OTHERWISE', 'Otherwise ...');
+define('TEXT_DUPLICATE_ATTRIBUTES_SKIPPED', 'Duplicate Attributes should be skipped');
+define('TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN', 'Duplicate Attributes should be overwritten');
+define('TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS', 'Copy Attributes with Downloads');
+define('TEXT_SELECT_PRODUCT_FOR_DISPLAY', 'Select a product for display');
+define('TEXT_COPY_PRODUCT_ATTRIBUTES_TO_CATEGORY', 'Copy Product Attributes to Category ...');
+define('TEXT_COPY_PRODUCT_ATTRIBUTES_FROM_PRODUCT_ID', 'Copy Product Attributes from Product ID');
+define('TEXT_COPYING_TO_ALL_PRODUCTS_IN_CATEGORY_ID', 'Copying to all products in Category ID');
+define('TEXT_CATEGORY_NAME', 'Category Name: ');
+define('TEXT_SELECT_PRODUCT_TO_DISPLAY_ATTRIBUTES', 'Select a product to display attributes');
+define('DATE_FORMAT', '(YYYY-MM-DD)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/check_lang.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/check_lang.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/check_lang.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+
+  Released under the GNU General Public License
+*/
+
+define("ERROR_CANNOT_OPEN_LANGUAGE_DIR","FATAL ERROR: Cannot open language dir: ");
+define("CHECK_LANG_FILENAME","Filename");
+define("CHECK_LANG_MISSING_IN","Missing in");
+define("CHECK_LANG_NONE_FOUND","None found");
+define("CHECK_LANG_FOUND_IN","Found in");
+define("CHECK_LANG_DEFINITION_NAME","Definition name");
+define("CHECK_LANG_EQUAL_TO","Equal to");
+define("CHECK_LANG_REFERENCES","References");
+define("CHECK_LANG_ALL_EQUAL","All equal");
+define("CHECK_LANG_WHERE_USED","Where Used");
+define("CHECK_LANG_FOUND_FOR","Found for");
+define("CHECK_LANG_MISSING_FOR","Missing for");
+define("CHECK_LANG_ALL_BUT","All but");
+define("CHECK_LANG_FILE_NAME","File Name");
+define("CHECK_LANG_SELECT_OPTION","Select option");
+define("CHECK_LANG_TO_CHECK_FILE_CONSISTENCY","To check file consistency");
+define("CHECK_LANG_CLICK_HERE","Click Here");
+define("CHECK_LANG_TO_CHECK_DEFINITION_CONSISTENCY","To check definition consistency");
+define("CHECK_LANG_TO_CHECK_EQUAL_DEFINITIONS","To check equal definitions");
+define("CHECK_LANG_HOME","Home");
+define("CHECK_LANG_BACK","Back");
+define("CHECK_LANG_W_GODEFROY","W Godefroy");
+define("CHECK_LANG_EXECUTION_TIME","Execution Time: ");
+define("CHECK_LANG_TITLE","Check Language Integrity");
+define("CHECK_LANG_LIST_OF_FILES_USING","List of files using");
+define("CHECK_LANG_LIST_OF_FILES_PRESENT_FOR_ONE_LANGUAGE","List of files that are present for one language-definition but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_PRESENT_FOR_ONE_LANGUAGE","List of phrase definitions that are present for one language-file but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_DEFINITIONS_EQUAL","List of phrase definitions that are equal");
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Título');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Valor');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_EDIT_INTRO', 'Por favor, haga los cambios necesarios');
+define('TEXT_INFO_DATE_ADDED', 'Fecha de alta:');
+define('TEXT_INFO_LAST_MODIFIED', 'Última modificación:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/countries.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/countries.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/countries.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: countries.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Países');
+
+define('TABLE_HEADING_COUNTRY_NAME', 'País');
+define('TABLE_HEADING_COUNTRY_CODES', 'Códigos ISO');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_EDIT_INTRO', 'Por favor, haga los cambios necesarios');
+define('TEXT_INFO_COUNTRY_NAME', 'Nombre:');
+define('TEXT_INFO_COUNTRY_CODE_2', 'Código ISO (2):');
+define('TEXT_INFO_COUNTRY_CODE_3', 'Código ISO (3):');
+define('TEXT_INFO_ADDRESS_FORMAT', 'Formato de dirección:');
+define('TEXT_INFO_INSERT_INTRO', 'Por favor, introduzca el nuevo país con sus datos');
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que desea eliminar este país?');
+define('TEXT_INFO_HEADING_NEW_COUNTRY', 'Nuevo país');
+define('TEXT_INFO_HEADING_EDIT_COUNTRY', 'Editar país');
+define('TEXT_INFO_HEADING_DELETE_COUNTRY', 'Eliminar país');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/coupon_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/coupon_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/coupon_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,121 @@
+<?php
+/*
+  $Id: coupon_admin.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TOP_BAR_TITLE', 'Estadísticas');
+define('HEADING_TITLE', 'Cupones de descuento');
+define('HEADING_TITLE_STATUS', 'Estado : ');
+define('TEXT_CUSTOMER', 'Cliente:');
+define('TEXT_COUPON', 'Nombre del cupón');
+define('TEXT_COUPON_ALL', 'Todos los cupones');
+define('TEXT_COUPON_ACTIVE', 'Cupones activos');
+define('TEXT_COUPON_INACTIVE', 'Cupones inactivos');
+define('TEXT_SUBJECT', 'Tema:');
+define('TEXT_FROM', 'De:');
+define('TEXT_FREE_SHIPPING', 'Portes gratis');
+define('TEXT_MESSAGE', 'Mensaje:');
+define('TEXT_SELECT_CUSTOMER', 'Seleccionar cliente');
+define('TEXT_ALL_CUSTOMERS', 'Todos los clientes');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'A todos los suscriptores de las noticias');
+define('TEXT_CONFIRM_DELETE', '¿Está seguro de que quiere eliminar este cupón?');
+
+define('TEXT_TO_REDEEM1', 'Puede amortizar este cupón al finalizar el pedido. Simplemente introduzca el código en el lugar previsto, y pulse en el botón de amortizar.');
+define('TEXT_IN_CASE', ' en caso de tener algún problema. ');
+define('TEXT_VOUCHER_IS', 'El código del cupón es ');
+define('TEXT_REMEMBER', 'No pierda el código del cupón, guárdelo en lugar seguro para poder aprovecharse de esta oferta especial.');
+define('TEXT_VISIT', 'cuando visite <a style="color: #000000" href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . STORE_NAME . '</a>' ."\n" .'(' . HTTP_SERVER . DIR_WS_CATALOG . ')');
+define('TEXT_ENTER_CODE', ' e introduzca el código ');
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">The Back Button has been DISABLED while HTML WYSIWG Editor is turned ON.</b></font> WHY? - Because if you click the back button to edit your HTML email, the PHP (php.ini - "Magic Quotes = On") will automatically add "\\\\\\\" backslashes everywhere Double Quotes " appear (HTML uses them in Links, Images and More) and this distorts the HTML, the pictures will dissapear once you submit the email again. If you turn OFF WYSIWYG Editor in Admin, the HTML Ability of osCommerce is also turned OFF and the back button will re-appear. A fix for this HTML and PHP issue would be nice if someone knows a solution.<br><br><b>If you really need to Preview your emails before sending them, use the Preview Button located on the WYSIWYG Editor.<br><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML is currently Disabled!</b></font><br><br>If you want to send HTML email, Enable WYSIWYG Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>');
+
+define('TEXT_OR_VISIT', 'or visit ');
+define('TEXT_TO_REDEEM', ' To redeem this Discount coupon, please click on the link below. Please also write down the redemption code');
+define('TEXT_WHICH_IS', ' which is ');
+define('TEXT_IN_CASE', ' in case you have any problems.');
+
+
+define('TEXT_COUPON_REDEEMED', 'Redeemed Coupons');
+define('REDEEM_DATE_LAST', 'Date Last Redeemed');
+define('COUPON_STATUS', 'Status');
+define('COUPON_STATUS_HELP', 'Set to ' . IMAGE_ICON_STATUS_RED . ' to disable customers\' ability to use the coupon.');
+define('COUPON_BUTTON_EMAIL_VOUCHER', 'Email Voucher');
+define('COUPON_BUTTON_EDIT_VOUCHER', 'Edit Voucher');
+define('COUPON_BUTTON_DELETE_VOUCHER', 'Delete Voucher');
+define('COUPON_BUTTON_VOUCHER_REPORT', 'Voucher Report');
+
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_HEADING_COUPON_REPORT', 'Coupon Report');
+
+define('CUSTOMER_ID', 'ID del cliente');
+define('CUSTOMER_NAME', 'Nombre del cliente');
+define('REDEEM_DATE', 'Fecha de amortización');
+define('IP_ADDRESS', 'Dirección IP');
+
+define('TEXT_REDEMPTIONS', 'Amortizaciones');
+define('TEXT_REDEMPTIONS_TOTAL', 'En total');
+define('TEXT_REDEMPTIONS_CUSTOMER', 'Para este cliente');
+define('TEXT_NO_FREE_SHIPPING', 'Portes debidos');
+
+define('NOTICE_EMAIL_SENT_TO', 'Nota: Email enviado a: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Error: No se ha seleccionado a ningún cliente.');
+define('ERROR_NO_COUPON_AMOUNT', 'Error: No coupon amount has been entered. Either enter an amount or select free shipping.');
+define('ERROR_COUPON_EXISTS', 'Error: A coupon with the same coupon code already exists.');
+
+define('COUPON_NAME', 'Nombre del cupón');
+//define('COUPON_VALUE', 'Valor del cupón');
+define('COUPON_AMOUNT', 'Cantidad del cupón');
+define('COUPON_CODE', 'Código del cupón');
+define('COUPON_STARTDATE', 'Fecha de inicio');
+define('COUPON_FINISHDATE', 'Fecha de final');
+define('COUPON_FREE_SHIP', 'Portes gratis');
+define('COUPON_DESC', 'Descripción del cupón');
+define('COUPON_MIN_ORDER', 'Pedido mímino');
+define('COUPON_USES_COUPON', 'Usos por cupón');
+define('COUPON_USES_USER', 'Usos por cliente');
+define('COUPON_PRODUCTS', 'Lista de productos válidos');
+define('COUPON_CATEGORIES', 'Lista de categorías válidas');
+define('VOUCHER_NUMBER_USED', 'Veces que se ha usado');
+define('DATE_CREATED', 'Fecha de creación');
+define('DATE_MODIFIED', 'Fecha de modificación');
+define('TEXT_HEADING_NEW_COUPON', 'Crear un nuevo cupón');
+define('TEXT_NEW_INTRO', 'Por favor, rellene la siguiente información para el nuevo cupón.<br>');
+
+
+define('COUPON_NAME_HELP', 'Un apodo para el cupón');
+define('COUPON_AMOUNT_HELP', 'El valor del descuento con este cupón, puede ser fijo o un porcentaje del total del pedido.');
+define('COUPON_CODE_HELP', 'Puede incluir su propio código aquí, o dejarlo en blanco para que se autogenere uno.');
+define('COUPON_STARTDATE_HELP', 'Fecha a partir de la que el cupón es válido');
+define('COUPON_FINISHDATE_HELP', 'Fecha en la que caducará el cupón');
+define('COUPON_FREE_SHIP_HELP', 'El cupón da portes gratuítos en un pedido. Nota. Esto sobrepasa el valor de coupon_amount pero respeta el valor del pedido mínimo');
+define('COUPON_DESC_HELP', 'Una descripción del cupón para el cliente');
+define('COUPON_MIN_ORDER_HELP', 'Valor mínimo de pedido antes de que se active el cupón');
+define('COUPON_USES_COUPON_HELP', 'Máximo número de veces que se puede utilizar el cupón, déjese en blanco si no se quiere límite.');
+define('COUPON_USES_USER_HELP', 'Número de veces que un mismo usuario puede utilizar el cupón, déjese en blanco si no se quiere límite.');
+define('COUPON_PRODUCTS_HELP', 'Una lista de los product_ids, separados por comas, con los que se puede utilizar este cupón. Déjese en blanco si no se quieren restricciones.');
+define('COUPON_CATEGORIES_HELP', 'Una lista de los cpaths, separados por comas, con los que se puede utilizar este cupón. Déjese en blanco si no se quieren restricciones.');
+
+
+define('ALT_CONFIRM_DELETE_VOUCHER', 'Confirm Delete Voucher');
+define('ALT_CANCEL', 'Cancel');
+define('VIEW', 'View');
+define('ALT_EMAIL_VOUCHER', 'Email Voucher');
+define('ALT_EDIT_VOUCHER', 'Edit Voucher');
+define('ALT_DELETE_VOUCHER', 'Delete Voucher');
+define('ALT_VOUCHER_REPORT', 'Voucher Report');
+define('COUPON_BUTTON_EMAIL_VOUCHER', 'Email Voucher');
+define('COUPON_BUTTON_EDIT_VOUCHER', 'Edit Voucher');
+define('COUPON_BUTTON_DELETE_VOUCHER', 'Delete Voucher');
+define('COUPON_BUTTON_VOUCHER_REPORT', 'Voucher Report');
+define('COUPON_BUTTON_PREVIEW', 'Preview');
+define('COUPON_BUTTON_BACK', 'Back');
+define('COUPON_STATUS', 'Status');
+define('COUPON_STATUS_HELP', 'Set to ' . IMAGE_ICON_STATUS_RED . ' to disable customers\' ability to use the coupon.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/coupon_restrict.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/coupon_restrict.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/coupon_restrict.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: coupon_restrict.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TOP_BAR_TITLE', 'Estadísticas');
+define('HEADING_TITLE', 'Cupones de descuento');
+define('HEADING_TITLE_STATUS', 'Estado : ');
+define('TEXT_CUSTOMER', 'Cliente:');
+define('TEXT_COUPON', 'Nombre del cupón');
+define('TEXT_COUPON_ALL', 'Todos los cupones');
+define('TEXT_COUPON_ACTIVE', 'Cupones activos');
+define('TEXT_COUPON_INACTIVE', 'Cupones inactivos');
+define('TEXT_SUBJECT', 'Tema:');
+define('TEXT_FROM', 'De:');
+define('TEXT_FREE_SHIPPING', 'Portes gratis');
+define('TEXT_MESSAGE', 'Mensaje:');
+define('TEXT_SELECT_CUSTOMER', 'Seleccionar cliente');
+define('TEXT_ALL_CUSTOMERS', 'Todos los clientes');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'A todos los suscriptores de las noticias');
+define('TEXT_CONFIRM_DELETE', '¿Está seguro de que quiere eliminar este cupón?');
+
+define('TEXT_TO_REDEEM', 'Puede amortizar este cupón al finalizar el pedido. Simplemente introduzca el código en el lugar previsto, y pulse en el botón de amortizar.');
+define('TEXT_IN_CASE', ' en caso de tener algún problema. ');
+define('TEXT_VOUCHER_IS', 'El código del cupón es ');
+define('TEXT_REMEMBER', 'No pierda el código del cupón, guárdelo en lugar seguro para poder aprovecharse de esta oferta especial.');
+define('TEXT_VISIT', 'cuando visite ' . HTTP_SERVER . DIR_WS_CATALOG);
+define('TEXT_ENTER_CODE', ' e introduzca el código ');
+
+define('TABLE_HEADING_ACTION', 'Acción');
+
+
+
+define('NOTICE_EMAIL_SENT_TO', 'Nota: Email enviado a: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Error: No se ha seleccionado a ningún cliente.');
+define('COUPON_NAME', 'Nombre del cupón');
+//define('COUPON_VALUE', 'Valor del cupón');
+define('COUPON_AMOUNT', 'Cantidad del cupón');
+define('COUPON_CODE', 'Código del cupón');
+define('COUPON_STARTDATE', 'Fecha de inicio');
+define('COUPON_FINISHDATE', 'Fecha de final');
+define('COUPON_FREE_SHIP', 'Portes gratis');
+define('COUPON_DESC', 'Descripción del cupón');
+define('COUPON_MIN_ORDER', 'Pedido mímino');
+define('COUPON_USES_COUPON', 'Usos por cupón');
+define('COUPON_USES_USER', 'Usos por cliente');
+define('COUPON_PRODUCTS', 'Lista de productos válidos');
+define('COUPON_CATEGORIES', 'Lista de categorías válidas');
+define('VOUCHER_NUMBER_USED', 'Veces que se ha usado');
+define('DATE_CREATED', 'Fecha de creación');
+define('DATE_MODIFIED', 'Fecha de modificación');
+define('TEXT_HEADING_NEW_COUPON', 'Crear un nuevo cupón');
+define('TEXT_NEW_INTRO', 'Por favor, rellene la siguiente información para el nuevo cupón.<br>');
+
+
+define('COUPON_NAME_HELP', 'Un nombre para el cupón');
+define('COUPON_AMOUNT_HELP', 'El valor del descuento con este cupón, puede ser fijo o un porcentaje del total del pedido.');
+define('COUPON_CODE_HELP', 'Puede incluir su propio código aquí, o dejarlo en blanco para que se autogenere uno.');
+define('COUPON_STARTDATE_HELP', 'Fecha a partir de la que el cupón es válido');
+define('COUPON_FINISHDATE_HELP', 'Fecha en la que caducará el cupón');
+define('COUPON_FREE_SHIP_HELP', 'El cupón da portes gratuítos en un pedido. Nota. Esto sobrepasa el valor de coupon_amount pero respeta el valor del pedido mínimo');
+define('COUPON_DESC_HELP', 'Una descripción del cupón para el cliente');
+define('COUPON_MIN_ORDER_HELP', 'Valor mínimo de pedido antes de que se active el cupón');
+define('COUPON_USES_COUPON_HELP', 'Máximo número de veces que se puede utilizar el cupón, déjese en blanco si no se quiere límite.');
+define('COUPON_USES_USER_HELP', 'Número de veces que un mismo usuario puede utilizar el cupón, déjese en blanco si no se quiere límite.');
+define('COUPON_PRODUCTS_HELP', 'Una lista de los product_ids, separados por comas, con los que se puede utilizar este cupón. Déjese en blanco si no se quieren restricciones.');
+define('COUPON_CATEGORIES_HELP', 'Una lista de los cpaths, separados por comas, con los que se puede utilizar este cupón. Déjese en blanco si no se quieren restricciones.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: create_account.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by; jparis v1.0
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Crear una cuenta');
+define('HEADING_TITLE', 'Añadir un nuevo cliente');
+define('HEADING_NEW', 'Proceso de pedidos');
+define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><b>NOTA:</b></font></small> Si ya tiene una cuenta con nosotros, por favor inténtelo en la <a href="%s"><u>página de registro</u></a>.');
+define('TEXT_VISITOR_CART', '<font color="#FF0000"><b> ¡Queremos que tenga el pedido es sus manos lo más rápido posible! Necesitamos la siguiente información para procesar su pedido de forma eficiente.</b></font>');
+define('TEXT_RETURN_CUSTOMER', '<font color="#FF0000">¿Ya tiene una cuenta? ¡Por favor regístrese!</font>');
+define('NAVBAR_NEW_TITLE', 'Proceso de pedidos');
+define('TEXT_PRIVACY', '<font color="#FF0000"><b>¿Nunca ha comprado con nosotros? Es fácil. Empieze rellenando todos los campos necesarios, y entonces pulse en el botón de \'continuar\'. </b>');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: create_account_process.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('NAVBAR_TITLE', 'Crear una cuenta');
+define('HEADING_TITLE', 'Información de la cuenta');
+define('HEADING_NEW', 'Proceso de pedidos');
+define('NAVBAR_NEW_TITLE', 'Proceso de pedidos');
+
+define('EMAIL_SUBJECT', 'Bienvenidos a ' . STORE_NAME);
+define('EMAIL_GREET_MR', 'Estimado Sr. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_MS', 'Estimada Sra. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_NONE', 'Estimado ' . stripslashes($HTTP_POST_VARS['firstname']) . ',' . "\n\n");
+define('EMAIL_WELCOME', 'Sea bienvenido a <b>' . STORE_NAME . '</b>.' . "\n\n");
+define('EMAIL_TEXT', 'Ahora puede utilizar <b>varios servicios</b> que hemos preparado para usted. Estos servicios incluyen:' . "\n\n" . '<li><b>Carrito permanente</b> - Cualquier producto que añada a su carrito online permanecerá en él hasta que lo elimine, o haga su pedido.' . "\n" . '<li><b>Libreta de direcciones</b> - ¡Ahora podemos enviarle sus productos a una dirección distinta de la suya! Esto es perfecto para enviar regalos de cumpleaños directamente a la persona indicada.' . "\n" . '<li><b>Histórico de pedidos</b> - Vea un registro histórico de las compras que ha realizaco con nosotros.' . "\n" . '<li><b>Comentarios de productos</b> - Intercambie sus opiniones con los demás clientes.' . "\n\n");
+define('EMAIL_CONTACT', 'Para ayuda con cualquiera de nuestros servicios online, por favor envíele un mensaje al administrador: ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n\n");
+define('EMAIL_WARNING', '<b>Nota:</b> Esta dirección de correo ha llegado a nuestras manos a través de otro cliente. Si no inició un proceso para abrir una cuenta con nosotros, por favor envíe un email a ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n");
+define('EMAIL_PASS_1', 'Su contraseña para esta cuenta es ');
+define('EMAIL_PASS_2', ', guárdela en lugar seguro. (Nota importante: La contraseña es sensible a mayúsculas y minúsculas.)');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Crear una cuenta');
+define('NAVBAR_TITLE_2', 'Éxito');
+define('HEADING_TITLE', '<font color="#00CC33">Éxito:&nbsp;&nbsp;</font>¡Se ha creado una nueva cuenta de cliente!');
+define('BUTTON_TITLE1', 'Usted puede ahora tomar una orden manual:');
+define('BUTTON_TITLE2', 'Cree otra nueva cuenta de cliente:');
+define('BUTTON_TITLE3', 'alga al Home Page de Admin:');
+
+define('IMAGE_BUTTON_CREATE_ORDER', 'cree la orden');
+define('IMAGE_BUTTON_CREATE_CUSTOMER', 'nuevo cliente');
+define('IMAGE_BUTTON_ADMIN_HOME', 'admin casero');
+
+define('TEXT_ACCOUNT_CREATED', '');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: create_order.php,v 1.3 2004/09/08 00:36:41 ccwjr Exp $
+  Trasnlated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+  
+*/
+define('HEADING_STEP1', 'PASO 1 - Escoger un cliente y comprobar sus datos');
+
+define('HEADING_STEP2', 'STEP 2 - Choose payment and Shipping Meathods for new order #');
+define('HEADING_INSTRUCT1', '!!! INSTRUCTIONS !!!');
+define('HEADING_INSTRUCT2', 'Note: If you edit the orders product quanities<br>
+              they will not update your stock levels with the<br>
+          changes.  So make sure you update them after this<br>
+          edit section.<br>');
+define('HEADING_STEP3', 'Step 3 ADD A NEW PRODUCT');
+define('HEADING_SHIPPING', 'Shipping Method:');
+
+define('TEXT_ADD_PROD_STEP1', 'STEP 1:');
+define('TEXT_ADD_STEP2', 'STEP 2:');
+define('TEXT_ADD_STEP3', 'STEP 3:');
+define('TEXT_ADD_STEP4', 'STEP 4:');
+
+define('HEADING_CREATE', 'Comprobar datos de clientes');
+
+define('TEXT_SELECT_CUST', 'Seleccionar un cliente:');
+define('TEXT_SELECT_CURRENCY', 'Select currency:');
+define('BUTTON_TEXT_SELECT_CUST', 'Seleccionar este cliente');
+define('TEXT_OR_BY', 'o ID de cliente:');
+define('BUTTON_TEXT_CHOOSE_CUST', 'Seleccionar este ID de cliente');
+define('BUTTON_SUBMIT', 'confirm');
+
+define('TEXT_ADD_PROD', 'Add Product ');
+define('TEXT_SELECT_PROD', 'Select this product');
+
+define('TEXT_ADD_CAT_CHOOSE', '--- CHOOSE A CATEGORY ---\n');
+define('TEXT_SELECT_CAT', 'Select this category');
+define('TEXT_ADD_PROD_CHOOSE', 'Add Product ');
+
+define('TEXT_SELECT_OPT', 'Select options');
+define('TEXT_SELECT_OPT_SKIP', 'No options for this product');
+
+define('TEXT_ADD_QUANTITY', ' Quantity');
+define('TEXT_ADD_NOW', 'Add Now!');
+define('TEXT_VIEW_CC', ' To View CC Fields');
+define('TEXT_VIEW_PO', ' or View PO Fields');
+
+define('TEXT_INFO_PO', 'PO Information:');
+define('TEXT_INFO_NAME', 'Account name:');
+define('TEXT_INFO_AC_NR', 'Account number:');
+define('TEXT_INFO_PO_NR', 'Purchase Order Nr:');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Please Select');
+define('TYPE_BELOW', 'Type Below');
+
+define('JS_ERROR', 'Errors have occured during the process of your form!\nPlease make the following corrections:\n\n');
+
+define('JS_GENDER', '* The \'Gender\' value must be chosen.\n');
+define('JS_FIRST_NAME', '* The \'First Name\' entry must have at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_LAST_NAME', '* The \'Last Name\' entry must have at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_DOB', '* The \'Date of Birth\' entry must be in the format: xx/xx/xxxx (month/day/year).\n');
+define('JS_EMAIL_ADDRESS', '* The \'E-Mail Address\' entry must have at least ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_ADDRESS', '* The \'Street Address\' entry must have at least ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_POST_CODE', '* The \'Post Code\' entry must have at least ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.\n');
+define('JS_CITY', '* The \'Suburb\' entry must have at least ' . ENTRY_CITY_MIN_LENGTH . ' characters.\n');
+define('JS_STATE', '* The \'State\' entry must be selected.\n');
+define('JS_STATE_SELECT', '-- Select Above --');
+define('JS_ZONE', '* The \'State\' entry must be selected from the list for this country.\n');
+define('JS_COUNTRY', '* The \'Country\' entry must be selected.\n');
+define('JS_TELEPHONE', '* The \'Telephone Number\' entry must have at least ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.\n');
+define('JS_PASSWORD', '* The \'Password\' and \'Confirmation\' entries must match and have at least ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.\n');
+
+define('CATEGORY_COMPANY', 'Company Details');
+define('CATEGORY_PERSONAL', 'Personal Details');
+define('CATEGORY_ADDRESS', 'Address');
+define('CATEGORY_CONTACT', 'Contact Information');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Password');
+define('CATEGORY_CORRECT', 'If this is the right customer, press the Confirm button below.');
+define('ENTRY_CUSTOMERS_ID', 'ID:');
+define('ENTRY_CUSTOMERS_ID_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COMPANY', 'Company Name:');
+define('ENTRY_NAME', 'Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Gender:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_GENDER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FIRST_NAME', 'First Name:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_FIRST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_LAST_NAME', 'Last Name:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_LAST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_LAST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_DATE_OF_BIRTH', 'Date of Birth:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<small><font color="#FF0000">(eg. 05/21/1970)</font></small>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '&nbsp;<small>(eg. 05/21/1970) <font color="#AABBDD">required</font></small>');
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">Your email address doesn\'t appear to be valid!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<small><font color="#FF0000">email address already exists!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_STREET_ADDRESS', 'Street Address:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_STREET_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Post Code:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_POSTCODE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_POST_CODE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_CITY_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_CITY_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_CITY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_CITY', 'City:');
+define('ENTRY_STATE', 'State/Province:');
+define('ENTRY_STATE_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_STATE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COUNTRY', 'Country:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_TELEPHONE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FAX_NUMBER', 'Fax Number:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Subscribed');
+define('ENTRY_NEWSLETTER_NO', 'Unsubscribed');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_PASSWORD_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_PASSWORD_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_PASSWORD_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+// manual order box text in includes/boxes/manual_order.php
+
+define('BOX_HEADING_MANUAL_ORDER', 'Manual Orders');
+define('BOX_MANUAL_ORDER_CREATE_ACCOUNT', 'Create Account');
+define('BOX_MANUAL_ORDER_CREATE_ORDER', 'Create Order');
+
+define('TITLE_1', 'Step-by-Step Manual Order Entry - Step 1');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: create_order_admin.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Administración de creación de pedidos');
+
+define('TEXT_CREATE_ORDERS_ADMIN_HELP', 'The two link below will take you to edit screens where you can edit the payment and shipping for the create orders contributions.');
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Administración de creación de pedidos');
+define('TEXT_LABEL_CREATE_ORDERS_ADMIN_PAYMENT', 'Edit Payment Methods');
+define('TEXT_LABEL_CREATE_ORDERS_ADMIN_SHIPPING', 'Edit Shipping Methods');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_ORDERS_STATUS_NAME', 'Orders Status:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new paymen meathod with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this payment?');
+define('TEXT_INFO_HEADING_NEW_PAYMENT', 'New Payment');
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Edit Payment');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Delete Payment');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'New Shipping');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Edit Shipping');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Delete Shipping');
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: The default order status can not be removed. Please set another order status as default, and try again.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This order status is currently used in orders.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This order status is currently used in the order status history.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: PAYMENT_MODULES.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Create Order Admin');
+
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Create Order Admin');
+define('TABLE_HEADING_CREATE_ORDERS_SORT', 'Sort Order');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> payment modules)');
+define('TEXT_INFO_EDIT_INTRO', 'Por favor, haga los cambios necesarios');
+define('TEXT_INFO_PAYMENT_MODULES_NAME', 'Payment modules:');
+define('TEXT_INFO_INSERT_INTRO', 'Por favor, introduzca el nuevo método de pago y sus datos relacionados');
+define('TEXT_INFO_DELETE_INTRO', '¿Está seguro de que quiere borrar este pago?');
+define('TEXT_INFO_HEADING_NEW_PAYMENT', 'Nuevo pago');
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Editar pago');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Eliminar pago');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'Nuevo envío');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Editar envío');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Eliminar envío');
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: El estado de pedido por defecto no se puede eliminar. Ponga otro estado de pedido por defecto, e inténtelo de nuevo.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: Este estado de pedido está en uso.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: Este estado de pedido está en uso, aunque sólo en el histórico.');
+define('TEXT_INFO_SORT_ORDER', 'Sort Order');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: create_order_process.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_CREATE', 'Comprobar los datos del cliente');
+define('DEFAULT_PAYMENT_METHOD', "Payment on Local Pickup. We accept cash, Interac, Visa and Master Card.");
+define('TEXT_SUBTOTAL', "Subtotal :");
+define('TEXT_DISCOUNT', "Discount :");
+define('TEXT_DELIVERY', "Delivery :");
+define('TEXT_TAX', "Tax :");
+define('TEXT_TOTAL', "Total :");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_shipping.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/create_order_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: create_order_shipping.php,v 1.1 2004/08/19 23:38:51 teo Exp $
+  http://www.chainreactionworks.com
+
+  Copyright (c) 2005 chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Create Order Shipping');
+
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Create Order Shipping');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> shipping modules)');
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_SHIPPING_MODULES_NAME', 'Shipping modules:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new shipping method with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this shipping method?');
+define('TEXT_INFO_SORT_ORDER', 'Sort Order');
+
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Edit Payment');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Delete Payment');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'New Shipping');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Edit Shipping');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Delete Shipping');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This shipping module is currently used in orders.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This shipping module is currently used in the shipping module history.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes.');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning: key directory does not exist.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning: key directory is not writeable at : ');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_convert.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_convert.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_convert.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Convert from old key to new key.');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+
+define('TEXT_KEY_CURRENT', 'Current key is: ');
+define('TEXT_CONVRT_ALL', 'Convert all CC data to new key');
+define('TEXT_KEY_NEW', 'New key is: ');
+define('TEXT_KEY_STATUS_01', '<font color=red> <b> This file does not have a key </b></font>');
+define('TEXT_KEY_STATUS_02', '<font color=blue> <b> OK! This file has a key</b></font>');
+define('TEXT_KEY_STATUS_03', '<font color=red> <b> Please edit the key files(s) in the key manager </b></font>');
+
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_convert_1.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_convert_1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_convert_1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Convert CC data to new key');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+define('CC_ENCYPT_ERROR_01', '<font color=blue> <b> Sorry this is already encrypted </b></font>');
+
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_purge.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_purge.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_purge.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Remove cc data from cart');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b>  Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b> Unencrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Encryption Status');
+
+define('TEXT_KEY_CURRENT', 'Current key is: ');
+define('TEXT_CONVRT_ALL', 'Convert all CC data to new key');
+define('TEXT_KEY_NEW', 'New key is: ');
+define('TEXT_KEY_STATUS_01', '<font color=red> <b> This file does not have a key </b></font>');
+define('TEXT_KEY_STATUS_02', '<font color=blue> <b> OK! This file has a key</b></font>');
+define('TEXT_KEY_STATUS_03', '<font color=red> <b> Please edit the key files(s) in the key manager </b></font>');
+
+
+define('TEXT_PURGE_ALL', 'Purge all CC data from cart');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_update.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_update.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/crypt_update.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Decrypt/Encrypt: Orders with CC numbers');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+define('CC_ENCYPT_ERROR_01', '<font color=blue> <b> Sorry this is already encrypted </b></font>');
+define('CC_ENCYPT_ERROR_02', '<font color=blue> <b> Sorry this is already decrypted </b></font>');
+define('TEXT_ENCRPYT_ALL', 'Encrypt all cc numbers');
+define('TEXT_DECRYPT_ALL', 'Decrypt all cc numbers');
+
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/currencies.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: currencies.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Monedas');
+
+define('TABLE_HEADING_CURRENCY_NAME', 'Moneda');
+define('TABLE_HEADING_CURRENCY_CODES', 'Código');
+define('TABLE_HEADING_CURRENCY_VALUE', 'Valor');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_EDIT_INTRO', 'Haga los cambios necesarios');
+define('TEXT_INFO_CURRENCY_TITLE', 'Título:');
+define('TEXT_INFO_CURRENCY_CODE', 'Código:');
+define('TEXT_INFO_CURRENCY_SYMBOL_LEFT', 'Símbolo a la izquierda:');
+define('TEXT_INFO_CURRENCY_SYMBOL_RIGHT', 'Símbolo a la derecha:');
+define('TEXT_INFO_CURRENCY_DECIMAL_POINT', 'Punto decimal:');
+define('TEXT_INFO_CURRENCY_THOUSANDS_POINT', 'Separador de miles:');
+define('TEXT_INFO_CURRENCY_DECIMAL_PLACES', 'Lugares decimales:');
+define('TEXT_INFO_CURRENCY_LAST_UPDATED', 'Actualizado el:');
+define('TEXT_INFO_CURRENCY_VALUE', 'Valor:');
+define('TEXT_INFO_CURRENCY_EXAMPLE', 'Ejemplo:');
+define('TEXT_INFO_INSERT_INTRO', 'Introduzca los datos de la nueva moneda');
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que quiere eliminar esta moneda?');
+define('TEXT_INFO_HEADING_NEW_CURRENCY', 'Nueva moneda');
+define('TEXT_INFO_HEADING_EDIT_CURRENCY', 'Editar moneda');
+define('TEXT_INFO_HEADING_DELETE_CURRENCY', 'Eliminar moneda');
+define('TEXT_INFO_SET_AS_DEFAULT', TEXT_SET_DEFAULT . ' (requiere una actualización manual de los cambios de moneda)');
+define('TEXT_INFO_CURRENCY_UPDATED', 'El valor de %s (%s) se ha actualizado vía %s.');
+
+define('ERROR_REMOVE_DEFAULT_CURRENCY', 'Error: La moneda predeterminada no se puede eliminar. Seleccione otra moneda como predeterminada y vuelva a intentarlo.');
+define('ERROR_CURRENCY_INVALID', 'Error: El valor de %s (%s) no ha sido actualizado vía %s. Compruebe la validez del código.');
+define('WARNING_PRIMARY_SERVER_FAILED', 'Advertencia: El servidor primario (%s) ha fallado actualizando %s (%s) - probando con el servidor secundario.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Clientes');
+define('HEADING_TITLE_SEARCH', 'Buscar:');
+
+define('TABLE_HEADING_FIRSTNAME', 'Nombre');
+define('TABLE_HEADING_LASTNAME', 'Apellido');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Cuenta creada');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_DATE_ACCOUNT_CREATED', 'Cuenta creada:');
+define('TEXT_DATE_ACCOUNT_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_INFO_DATE_LAST_LOGON', 'Última visita:');
+define('TEXT_INFO_NUMBER_OF_LOGONS', 'Número de visitas:');
+define('TEXT_INFO_COUNTRY', 'País:');
+define('TEXT_INFO_NUMBER_OF_REVIEWS', 'Número de comentarios:');
+define('TEXT_DELETE_INTRO', '¿Seguro que desea eliminar este cliente?');
+define('TEXT_DELETE_REVIEWS', 'Eliminar %s comentario(s)');
+define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Eliminar cliente');
+define('TYPE_BELOW', 'Escriba debajo');
+define('PLEASE_SELECT', 'Seleccione');
+
+// Eversun mod for sppc and qty price breaks
+define('TABLE_HEADING_CUSTOMERS_GROUPS', 'Customer&#160;Group');
+define('TABLE_HEADING_REQUEST_AUTHENTICATION', 'RA');
+define('ENTRY_CUSTOMERS_PAYMENT_SET', 'Set payment modules for the customer');
+define('ENTRY_CUSTOMERS_PAYMENT_DEFAULT', 'Use settings from Group or Configuration');
+define('ENTRY_CUSTOMERS_PAYMENT_SET_EXPLAIN', 'If you choose <b><i>Set payment modules for the customer</i></b> but do not check any of the boxes, default settings (Group settings or Configuration) will still be used.');
+define('ENTRY_CUSTOMERS_SHIPPING_SET', 'Set shipping modules for the customer');
+define('ENTRY_CUSTOMERS_SHIPPING_DEFAULT', 'Use settings from Group or Configuration');
+define('ENTRY_CUSTOMERS_SHIPPING_SET_EXPLAIN', 'If you choose <b><i>Set shipping modules for the customer</i></b> but do not check any of the boxes, default settings (Group settings or Configuration) will still be used.');
+define('ENTRY_CUSTOMERS_EMAIL_VALIDATED','Email Validated:');
+define('ENTRY_EMAILVALIDATE_YES', 'Validated (active)');
+define('ENTRY_EMAILVALIDATE_NO', 'Unvalidated (inactive)');
+define('TEXT_EMAIL_VALIDATE_FEATURE','Require E-mail confirmation on account creation is set off.');
+
+define('ALT_IC_UP',' --> A-B-C From Top ');
+define('ALT_IC_DOWN',' --> Z-X-Y From Top ');
+define('ALT_IC_UP_NUM',' --> 1-2-3 From Top ');
+define('ALT_IC_DOWN_NUM',' --> 3-2-1 From Top ');
+define('TABLE_HEADING_CUSTOMERS_NO','No.');
+// Eversun mod end for sppc and qty price breaks
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/customers_groups.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/customers_groups.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/customers_groups.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+   for Separate Pricing Per Customer v4 2005/03/03
+*/
+  
+define('HEADING_TITLE', 'Groups');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('ENTRY_GROUPS_NAME', 'Group&#160;Name:');
+define('ENTRY_GROUP_SHOW_TAX', 'Show&#160;prices&#160;with/without&#160;tax:');
+define('ENTRY_GROUP_SHOW_TAX_YES', 'Show prices with tax');
+define('ENTRY_GROUP_SHOW_TAX_NO', 'Show prices without tax');
+
+define('ENTRY_GROUP_TAX_EXEMPT', 'Tax Exempt:'); 
+define('ENTRY_GROUP_TAX_EXEMPT_YES', 'Yes'); 
+define('ENTRY_GROUP_TAX_EXEMPT_NO', 'No'); 
+
+define('ENTRY_GROUP_PAYMENT_SET', 'Set payment modules for the customer group');
+define('ENTRY_GROUP_PAYMENT_DEFAULT', 'Use settings from Configuration');
+define('ENTRY_PAYMENT_SET_EXPLAIN', 'If you choose <b><i>Set payment modules for the customer group</i></b> but do not check any of the boxes, default settings will still be used.');
+
+define('ENTRY_GROUP_SHIPPING_SET', 'Set shipping modules for the customer group');
+define('ENTRY_GROUP_SHIPPING_DEFAULT', 'Use settings from Configuration');
+define('ENTRY_SHIPPING_SET_EXPLAIN', 'If you choose <b><i>Set shipping modules for the customer group</i></b> but do not check any of the boxes, default settings will still be used.');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this group?');
+define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS_GROUPS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> Customers Groups)');
+define('TEXT_INFO_HEADING_DELETE_GROUP', 'Delete Group');
+
+define('ERROR_CUSTOMERS_GROUP_NAME', 'Please enter a Group Name');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/data.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/data.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/data.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Data Import/Export system');
+
+define('HEADING_TITLE_1', 'Add New Feed Setting');
+define('HEADING_TITLE_2', 'Edit Feed Setting');
+
+define('TABLE_HEADING_FEED_NAME', 'Name of Feed');
+define('TABLE_HEADING_FEED_DISC', 'Data Feed Discription');
+
+
+define('TEXT_FEED_HELP', 'Do each step in order it is list for each feed');
+
+define('TEXT_FEED_HELP_CONFIGURE', '1. Click on the run button to run processes');
+define('TEXT_FEED_HELP_SELECT', '2. Click on the ' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO). ' for more information');
+define('TEXT_FEED_HELP_PREFEED', '3. Configure, Build categories, Pre process, Submit feed');
+define('TEXT_FEED_HELP_RUN', '');
+define('TEXT_FEED_HELP_NOTES', 'Notes: Feeds with * are not installed');
+
+
+
+define('TEXT_FEED_FROOGLE', '<b> Froogle </b>');
+define('TEXT_FEED_YAHOO', '<b>Yahoo</b>');
+define('TEXT_FEED_BIZRATE', '<b>Bizrate</b>');
+define('TEXT_FEED', '<i>Feed:: </i>');
+define('TEXT_CONFIGURE', '<i>Configure: </i>');
+define('TEXT_SET_CATEGORIES', '<i>Set Categories: </i>');
+define('TEXT_FEED_SELECT', '<i>Select Feed: </i>');
+define('TEXT_FEED_PRE_FEED', '<i>Pre Feed Process: </i>');
+define('TEXT_FEED_RUN', '<i>Submit Feed: </i> ');
+
+define('TEXT_FEED_CONFIGURE_HELP1', 'Build or edit unique configuration');
+define('TEXT_SET_CATEGORIES_HELP1', 'You do not need to run this process every time');
+define('TEXT_FEED_PRE_FEED_HELP1', 'Build feed the file');
+define('TEXT_FEED_PRE_EDIT_HELP1', 'Check Feed in text editor');
+define('TEXT_FEED_RUN_HELP1', 'Send feed to froogle');
+
+
+define('TEXT_INFO_FEED_NAME', 'Feed Name: ');
+define('TEXT_INFO_FEED_TYPE', 'Feed Type: ');
+define('TEXT_INFO_FEED_SERVICE', 'Feed service: ');
+define('TEXT_INFO_FEED_STATUS', 'Status: ');
+
+
+define('TEXT_INFO_STATUS_CHANGE', 'Status Change:');
+
+define('TEXT_DISPLAY_NUMBER_OF_DATA', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> data setups)');
+define('IMAGE_NEW_SETTING', 'New feed setting');
+
+define('WELCOME_TO_DATA_EXPORT_IMPORT_SYSTEM', 'Welcome to the Data Export/Import system');
+define('MSG_1', ' Please use the menu box to the left to select your task.<br><br> For in depth help use one of the links below <br><br>');
+define('MSG_2', 'Introduction to Data Export/Import system');
+define('MSG_3', 'Easy Populate:');
+define('MSG_4', 'EP Advance Import');
+define('MSG_5', 'EP Advance Export');
+define('MSG_6', 'EP Basic Import');
+define('MSG_7', 'EP Basic Export');
+define('MSG_8', 'Editing the export file');
+define('MSG_9', 'Data Feeder:');
+define('MSG_10', 'Introduction to data feed');
+define('MSG_11', '7 Steps to your First Froogle Feed');
+define('MSG_12', 'Configure a Feed');
+define('MSG_13', 'Run a Feed');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/data_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/data_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/data_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,82 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Data Admin');
+
+define('HEADING_TITLE_1', 'Add New Feed Setting');
+define('HEADING_TITLE_2', 'Edit Feed Setting');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TABLE_HEADING_FEED_NAME', 'Name of Feed');
+define('TABLE_HEADING_FEED_DISC', 'Data Feed Discription');
+define('TABLE_HEADING_FEED_FILE_TYPE', 'Data Feed File Type');
+define('TABLE_HEADING_FEED_TYPE', 'Feed Type');
+define('TABLE_HEADING_FEED_TYPE_PRODUCT', 'Product Feed Type');
+define('TABLE_HEADING_FEED', '<b>Froogle FTP information</b>');
+define('TABLE_HEADING_FEED_ADVANCE', '<b>Froogle Advance Settings</b>');
+define('TABLE_HEADING_FEED_FEED_SERVICE', 'Feed Service');
+define('TABLE_HEADING_FEED_STATUS', 'Status');
+define('TABLE_HEADING_FEED_FILE', 'File name');
+define('TABLE_HEADING_FEED_IMAGE', 'Image URL');
+define('TABLE_HEADING_FEED_PRODUCT', 'Product URL');
+define('TABLE_HEADING_FEED_FTP_SERVER', 'Froogle FTP Server Name');
+define('TABLE_HEADING_FEED_FTP_USER', 'Froogle FTP User Name');
+define('TABLE_HEADING_FEED_FTP_PASSWORD', 'Froogle FTP Password');
+define('TABLE_HEADING_FEED_FTP_DIRECTORY', 'Froogle FTP Directory');
+define('TABLE_HEADING_FEED_CUR', 'Use store Currency');
+define('TABLE_HEADING_FEED_CUR_USE', 'Other currency');
+define('TABLE_HEADING_FEED_LANG', 'Use store language');
+define('TABLE_HEADING_FEED_LANG_USE', 'Other language');
+define('TABLE_HEADING_FEED_CUR_CON', 'Convert Currency');
+define('TABLE_HEADING_FEED_TAX', 'Tax Class ID');
+
+define('TEXT_TYPE_BASIC', 'Basic');
+define('TEXT_TYPE_ADVANCE', 'Advance');
+define('TEXT_DATA_FEED_NAME', 'Feed Name');
+define('TEXT_TYPE_NONE', 'None');
+define('TEXT_TYPE_PRODUCTS', 'Products');
+define('TEXT_TYPE_BUSINESS', 'Business');
+define('TEXT_FEED_FROOGLE', 'Froogle Feed');
+define('TEXT_FEED_YAHOO', 'Yahoo Feed');
+
+define('TEXT_DATA_ID_ACTIVE', 'Active');
+define('TEXT_DATA_ID_DEACTIVE', 'Inactive');
+define('TEXT_DATA_VISIBLE_DO', 'Check to activate');
+
+define('TEXT_DATA_CUR_USE_FALSE', 'False: Use store default current');
+define('TEXT_DATA_CUR_USE_TRUE', 'True: Use currency listed below');
+
+define('TEXT_DATA_CUR_CONVERT_FALSE', 'False: Do not convert to currency');
+define('TEXT_DATA_CUR_CONVERT_TRUE', 'True: Convert currency');
+define('TEXT_DATA_CUR_LANG_FALSE', 'False: Use store default language');
+define('TEXT_DATA_CUR_LANG_TRUE', 'True: Use language selected below');
+define('TEXT_LANG_EN', 'English');
+define('TEXT_LANG_FR', 'French');
+define('TEXT_LANG_DE', 'German');
+define('TEXT_LANG_IT', 'Italian');
+define('TEXT_LANG_ES', 'Spanish');
+define('TEXT_LANG_JA', 'Jananese');
+
+define('TEXT_INFO_FEED_NAME', 'Feed Name: ');
+define('TEXT_INFO_FEED_TYPE', 'Feed Type: ');
+define('TEXT_INFO_FEED_SERVICE', 'Feed service: ');
+define('TEXT_INFO_FEED_STATUS', 'Status: ');
+
+
+define('TEXT_INFO_STATUS_CHANGE', 'Status Change:');
+
+define('TEXT_INFO_HEADING_DELETE_DATA', 'Delete Data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this data setup?');
+
+define('TEXT_DISPLAY_NUMBER_OF_DATA', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> data setups)');
+define('IMAGE_NEW_SETTING', 'New feed setting');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/define_language.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/define_language.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/define_language.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: define_language.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Trasnlated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Editor de idiomas');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'No existe archivo.');
+
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: No es posible escribir sobre este archivo. Asigne correctamente permisos a: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/define_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/define_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/define_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: define_language.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Main Page');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'File does not exist.');
+
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/document.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/document.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/document.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Documentation and help');
+
+define('HEADING_TITLE_1', 'Add New Feed Setting');
+
+define('TABLE_HEADING_FEED_NAME', 'Name of Feed');
+
+define('BOX_DOC_LANGUAGE_EDIT', 'Language editor');
+define('BOX_DOC_DATA', 'Data input/output');
+define('BOX_DOC_ADMIN', 'Admin');
+define('BOX_DOC_CAT', 'Catalog');
+define('BOX_DOC_MISC', 'Miscellaneous');
+
+
+define('HEADING_TITLE_01', 'Help: Introduction ');
+define('HEADING_TITLE_02', 'Help: Admin ');
+define('HEADING_TITLE_03', 'Help: Catalog ');
+define('HEADING_TITLE_04', 'Help: Miscellaneous');
+
+define('MENU_ITEM_01', 'Introduction');
+define('MENU_ITEM_02', 'Help: Admin');
+define('MENU_ITEM_03', 'Help: Catalog');
+define('MENU_ITEM_04', 'Help: Miscellaneous');
+
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/easypopulate.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/easypopulate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/easypopulate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+/*
+  $Id: easypopulate.php,v 1.4 2004/09/21  zip1 Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Configuración de Easy Populate');
+define('EASY_VERSION_A', 'Easy Populate Avanzado ');
+define('EASY_VERSION_B', 'Easy Populate Básico ');
+define('EASY_EXPORT', ' Export');
+define('EASY_IMPORT', ' Import');
+define('EASY_VER_A', ' 3.01');
+define('EASY_VER_B', ' 3.01');
+define('EASY_DEFAULT_LANGUAGE', '  -  Idioma por defecto ');
+define('EASY_UPLOAD_FILE', 'Se ha subido el archivo. ');
+define('EASY_UPLOAD_TEMP', 'Nombre para archivo temporal: ');
+define('EASY_UPLOAD_USER_FILE', 'Nombre del archivo del usuario: ');
+define('EASY_SIZE', 'Tamaño: ');
+define('EASY_FILENAME', 'Nombre de archivo: ');
+define('EASY_SPLIT_DOWN', 'Puede descargar sus archivos divididos en Tools/Files bajo /temp/');
+define('EASY_UPLOAD_EP_FILE', 'Subir un archivo EP para importar');
+define('EASY_SPLIT_EP_FILE', 'Subir y dividir un archivo EP');
+define('EASY_SPLIT_EP_LOCAL', 'Split a EP File on the server');
+
+define('TEXT_IMPORT_TEMP', 'Importar los datos del archivo en %s');
+define('TEXT_INSERT_INTO_DB', 'Insertar en la base de datos');
+define('TEXT_SELECT_ONE', 'Seleccionar un archivo EP para importar');
+define('TEXT_SELECT_TWO', 'Select a EP File for Splitting');
+
+define('TEXT_SPLIT_FILE', 'Seleccionar un archivo EP');
+define('TEXT_SPLIT', 'Split a EP File');
+
+define('EASY_LABEL_CREATE', 'Crear un archivo de exportación');
+define('EASY_LABEL_CREATE_SELECT', 'Seleccionar el método para guardar el archivo de exportación');
+define('EASY_LABEL_CREATE_SAVE', 'Guardar como archivo temporal en el servidor');
+define('EASY_LABEL_SELECT_DOWN', 'Seleccionar los campos para descarga');
+define('EASY_LABEL_SORT', 'Seleccionar el campo para ordenar');
+define('EASY_LABEL_PRODUCT_RANGE', 'Limitar por ID de productos');
+define('EASY_LABEL_LIMIT_CAT', 'Limitar por categoría');
+define('EASY_LABEL_LIMIT_MAN', 'Limitar por fabricante');
+
+define('EASY_LABEL_PRODUCT_AVAIL', 'Rango disponible: ');
+define('EASY_LABEL_PRODUCT_TO', ' a ');
+define('EASY_LABEL_PRODUCT_RECORDS', '    Número total de registros: ');
+define('EASY_LABEL_PRODUCT_BEGIN', 'comienza: ');
+define('EASY_LABEL_PRODUCT_END', 'termina: ');
+define('EASY_LABEL_PRODUCT_START', 'Comenzar la creación del archivo ');
+
+define('EASY_FILE_LOCATE', 'Puede encontrar su archivo en Tools/Files bajo ');
+define('EASY_FILE_LOCATE2', ' pulsando este enlace y llendo al gestor de archivos');
+
+define('EASY_FILE_LOCATE_2', ' by clicking this Link and going to the file manager');
+define('EASY_FILE_RETURN', ' Puede volver a EP pulsando este enlace.');
+define('EASY_IMPORT_TEMP_DIR', 'Importar desde la carpeta Temp ');
+define('EASY_LABEL_DOWNLOAD', 'Descarga');
+define('EASY_LABEL_COMPLETE', 'Completa');
+define('EASY_LABEL_TAB', 'archivo .txt delimitado por tabuladores para editar');
+define('EASY_LABEL_MPQ', 'Modelo/Precio/Cant.');
+define('EASY_LABEL_EP_MC', 'Modelo/Categoría');
+
+define('EASY_LABEL_EP_ATTRIB', 'Atributos');
+define('EASY_LABEL_NONE', 'Ninguno');
+define('EASY_LABEL_CATEGORY', 'Primer nombre de categoría');
+define('PULL_DOWN_MANUFACTURES', 'Fabricantes');
+define('EASY_LABEL_PRODUCT', 'Número de ID de producto');
+define('EASY_LABEL_MANUFACTURE', 'Número de Id de fabricante');
+define('EASY_LABEL_EP_MA', 'Modelo/Atributos');
+define('EASY_LABEL_EP_FR_TITLE', 'Crear archivos EP o Froogle en la carpeta Temp ');
+define('EASY_LABEL_EP_DOWN_TAB', 'Crear un archivo .txt delimitado por comas <b>Completo</b> en la carpeta Temp');
+define('EASY_LABEL_EP_DOWN_MPQ', 'Crear un archivo .txt delimitado por comas con <b>Modelo/Precio/Cant.</b> en la carpeta Temp');
+define('EASY_LABEL_EP_DOWN_MC', 'Crear un archivo .txt delimitado por comas con <b>Modelo/Categoría</b> en la carpeta Temp');
+define('EASY_LABEL_EP_DOWN_MA', 'Crear un archivo .txt delimitado por comas <b>Modelo/Atributos</b> en la carpeta Temp');
+define('EASY_LABEL_EP_LIMIT', 'Limit number of products to Export');
+define('EASY_LABEL_NEW_PRODUCT',  "<font color='green'>¡Producto nuevo!</font><br>");
+define('EASY_LABEL_UPDATED', "<font color='black'> Actualizado</font><br>");
+define('EASY_LABEL_DELETE_STATUS_1', "<font color='red'> ¡¡Eliminando el producto ");
+define('EASY_LABEL_DELETE_STATUS_2', " de la base de datos!!</font><br>");
+define('EASY_LABEL_LINE_COUNT_1', 'Añadidos ');
+define('EASY_LABEL_LINE_COUNT_2', 'registros y cerrando el archivo... ');
+define('EASY_LABEL_FILE_COUNT_1A', 'Creando archivo EPA_Split ');
+define('EASY_LABEL_FILE_COUNT_1B', 'Creando archivo EPB_Split ');
+define('EASY_LABEL_FILE_COUNT_2', '.txt ...  ');
+define('EASY_LABEL_FILE_CLOSE_1', 'Añadidos ');
+define('EASY_LABEL_FILE_CLOSE_2', ' registros y cerando el archivo...');
+define('EASY_LABEL_FILE_INSERT_LOCAL', 'Inserting local file: ');
+define('TEXT_INFO_TIMER', 'Script timer:');
+define('TEXT_INFO_SECOND', 'seconds.');
+
+//errormessages
+define('EASY_ERROR_1', 'Es extraño, pero no hay ningún idioma por defecto para trabajar... Esto no debería ocurrir, sólo por si acaso... ');
+define('EASY_ERROR_2', '... ¡ERROR! - Demasiados caracteres en el número del modelo.<br>
+      25 es el máximo en una instalación estándar de CRE.<br>
+      Su longitud máxima de modelo de producto asignada es de ');
+define('EASY_ERROR_2A', ' <br>Puede hacer sus códigos de modelo más pequeños o incrementar el tamaño del campo en la base de datos.</font>');
+define('EASY_ERROR_2B',  "<font color='red'>");
+define('EASY_ERROR_3', '<p class=smallText>No hay campo de products_id en el registro. Esta línea no se ha importado <br><br>');
+define('EASY_ERROR_4', '<font color=red>ERROR - v_customer_group_id y v_customer_price deben de ir en pareja</font>');
+define('EASY_ERROR_5', '</b><font color=red>ERROR - Está intentando utilizar un archivo creado con EP Advanced, por favor inténtelo con Easy Populate Advanced </font>');
+define('EASY_ERROR_5a', '<font color=red><b><u>  Pulse aquí para volver a Easy Populate Basic </u></b></font>');
+define('EASY_ERROR_6', '</b><font color=red>ERROR - Está intentando usar un archivo creado con EP Basic, por favor inténtelo con Easy Populate Basic </font>');
+define('EASY_ERROR_6a', '<font color=red><b><u>  Pulse aquí para volver a Easy Populate Advanced </u></b></font>');
+define('EASY_ERROR_7', '<p class=smallText> Error 07 - No Module field in record or it is the last line in the file. This line was not imported. <br><br>');
+
+// Eversun mod for Easy Populate Products Options, Values and Attributes
+define('EASY_VERSION_C', 'Easy Populate Options');
+define('EASY_LABEL_OPTIONS_ID', 'Options ID');
+define('EASY_LABEL_OPTIONS_NAME', 'Options Name');
+define('EASY_VERSION_D', 'Easy Populate Values');
+define('EASY_LABEL_VALUES_ID', 'Values ID');
+define('EASY_LABEL_VALUES_NAME', 'Values Name');
+define('EASY_VERSION_E', 'Easy Populate Attributes');
+define('TEXT_SELECT_ONE_OPTIONS', 'Select a EP Option File for Import');
+define('TEXT_SELECT_ONE_VALUES', 'Select a EP Values File for Import');
+define('TEXT_SELECT_ONE_ATTRIBUTES', 'Select a EP Attributes File for Import');
+define('EASY_ERROR_8', '<b><font color=red>Error - You didn\'t select any file</font></b>');
+define('EASY_INFO_SUCCESS', '<b><font color=red>Import Success</font></b>');
+define('EASY_INFO_FILE_NOT_FOUND', '<b><font color=red>File not Found</font></b>');
+define('EASY_INFO_CHECK_ERROR1', '<b><font color=red>Field %s not in the table %s.</font></b>');
+// Eversun mod end for Easy Populate Products Options, Values and Attributes
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_key.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_key.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_key.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define ('HEADING_TITLE', 'Manage Key Files');
+define ('HELP_URL', DIR_WS_ADMIN . 'et_help/index.html');
+
+define('BUTTON_TEXT_SAVE_CHANGES', 'Save Changes');
+define('BUTTON_TEXT_RESTORE_FILE', 'Restore File');
+define('BUTTON_TEXT_RETURN_MAIN_EDIT', 'Return to Configuration');
+define('TEXT_RETURN_MAIN', 'Return to main file list');
+
+define('ERROR_TEXT_FILE_LOCKED', "ERROR: File '%s' is not writable");
+define('ERROR_TEXT_FILE_LOCKED1', "ERROR: The Key file: %s is not writable, to Edit the key you must change it's permissions to 777");
+
+define('ERROR_TEXT_FILE_OK', "Ok to edit the key file: %s it is writable");
+
+
+define('TEXT_HIDE_NAVIGATION', 'Hide Navigation');
+define('TEXT_SHOW_NAVIGATION', 'Show Navigation');
+
+define('TEXT_HELP_HELP', 'Quick Help');
+define('TEXT_HELP_HELP1', '1. Click on edit button to edit.');
+define('TEXT_HELP_HELP2', '2. When finished editing, Click on save.');
+define('TEXT_HELP_HELP3', '3. Onced saved, click on restore to revert back to orginal file.');
+define('TEXT_HELP_HELP4', '4. Click on create button to create new key file.');
+define('TEXT_HELP_HELP5', '5. Click on return button to return to main Manage Key screen.');
+
+define('TEXT_CRYPT_MESSAGE_1', 'Primary key file');
+define('TEXT_CRYPT_MESSAGE_2', 'New key file');
+define('TEXT_CRYPT_MESSAGE_3', 'Unkown');
+
+define('TABLE_HEADING_FILE_TYPE', 'File type');
+define('TABLE_HEADING_FILE_NAME', 'File name');
+define('TABLE_HEADING_FILE_ACTION', 'Action');
+
+define('EDIT_ACTION', 'Edit :');
+define('SAVED_ACTION', 'Saved file :');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,151 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Edición de pedidos');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'ID de pedido:');
+define('HEADING_TITLE_STATUS', 'Estado:');
+define('ADDING_TITLE', 'Añadir un producto al pedido');
+
+define('ADD_PRODUCT', 'Add a Product to Order');
+define('HEADING_ABANDONED', '<B>This order was not completed and abandoned!!! Order ID:  </B>');
+
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Comentarios');
+define('TABLE_HEADING_CUSTOMERS', 'Clientes');
+define('TABLE_HEADING_ORDER_TOTAL', 'Total del pedido');
+define('TABLE_HEADING_DATE_PURCHASED', 'Fecha de compra');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_QUANTITY', 'Cant.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modelo');
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_TAX', 'Impuesto');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_UNIT_PRICE', 'Precio unitario');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Precio total');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'El cliente está informado');
+define('TABLE_HEADING_DATE_ADDED', 'Fecha en que se añadió');
+
+define('ENTRY_CUSTOMER', 'Customer general');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Company');
+define('ENTRY_CUSTOMER_ADDRESS', 'Address');
+define('ENTRY_CUSTOMER_SUBURB', 'Suburb');
+define('ENTRY_CUSTOMER_CITY', 'City');
+define('ENTRY_CUSTOMER_STATE', 'State');
+define('ENTRY_CUSTOMER_POSTCODE', 'Postcode');
+define('ENTRY_CUSTOMER_COUNTRY', 'Country');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Vendido a:');
+define('ENTRY_DELIVERY_TO', 'Entregar a:');
+define('ENTRY_SHIP_TO', 'Enviar a:');
+define('ENTRY_SHIPPING_ADDRESS', 'Dirección de envío:');
+define('ENTRY_BILLING_ADDRESS', 'Dirección de facturación:');
+define('ENTRY_PAYMENT_METHOD', 'Método de pago:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Tipo de tarjeta de crédito:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Nombre en la tarjeta de crédito:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Número de la tarjeta de crédito:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Fecha de caducidad de la tarjeta:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Impuesto:');
+define('ENTRY_SHIPPING', 'Portes:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Fecha de compra:');
+define('ENTRY_STATUS', 'Estado:');
+define('ENTRY_DATE_LAST_UPDATED', 'Fecha de la última actualización:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notificar al cliente:');
+define('ENTRY_NOTIFY_COMMENTS', 'Añadir comentarios:');
+define('ENTRY_PRINTABLE', 'Imprimir factura');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Utilize un número negativo -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Eliminar pedido');
+define('TEXT_INFO_DELETE_INTRO', '¿Está seguro de que quiere eliminar este pedido?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Devolver los productos al inventario');
+define('TEXT_DATE_ORDER_CREATED', 'Fecha de creación:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Add New Product');
+define('TEXT_INFO_PAYMENT_METHOD', 'Método de pago:');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> This CCV is not store or has been removed from the store.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'Todos los pedidos');
+define('TEXT_NO_ORDER_HISTORY', 'No hay histórico de pedidos disponible');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Actualización de pedido');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Número de pedido:');
+define('EMAIL_TEXT_INVOICE_URL', 'Factura detallada:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Fecha de pedido:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Su pedido ha sido actualizado al siguiente estado.' . "\n\n" . 'Nuevo estado: %s' . "\n\n" . 'Por favor responda a este email si tiene alguna duda.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'Los comentarios de su pedido son' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: El pedido no existe.');
+define('SUCCESS_ORDER_UPDATED', 'OK: El pedido ha sido actualizado correctamente.');
+define('WARNING_ORDER_NOT_UPDATED', 'Atención: Ningún cambio. El pedido no se ha actualizado.');
+define('SUCCESS_PRODUCT_ADDED', 'Success : This order has been updated and a new product has been added');
+
+
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choose a product');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Choose an option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Product has no options, so skipping...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'pieces of this product');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Add');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+define('DISPLAY_BASKET', 'Cesta De la Exhibición');
+define('DONT_ADD_NEW_PRODUCT', 'No agregue los productos nuevos');
+define('SELECT_THESE_OPTIONS', "Seleccione Estas Opciones");?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_textdata.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_textdata.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/edit_textdata.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define ('HEADING_TITLE', 'Edit Language Defines');
+
+define('BUTTON_TEXT_SAVE_CHANGES', 'Save Changes');
+define('BUTTON_TEXT_RESTORE_FILE', 'Restore File');
+define('BUTTON_TEXT_RETURN_MAIN_EDIT', 'Return to Main Edit');
+define('TEXT_RETURN_MAIN', 'Return to main file list');
+
+define('ERROR_TEXT_FILE_LOCKED', "ERROR: File '%s' is not writable");
+
+define('TEXT_HIDE_NAVIGATION', 'Hide Navigation');
+define('TEXT_SHOW_NAVIGATION', 'Show Navigation');
+
+define('TEXT_HELP_HELP', '<b>Quick Help, when in edit mode</b>');
+define('TEXT_HELP_HELP1', '1. Click on edit button to edit.');
+define('TEXT_HELP_HELP2', '2. When finished editing, Click on save.');
+define('TEXT_HELP_HELP3', '3. Onced saved, click on restore to revert back to orginal file.');
+define('TEXT_HELP_HELP4', '4. Click on insert to add a new define to a language file. (Insert not functional at this time)');
+define('TEXT_HELP_HELP5', '5. Click on return button to return to main Edit Language Define screen.');
+
+define('TEXT_DEFINE_LABEL', '<b>Define label</b>');
+define('TEXT_DEFINE_TEXT', '<b>Define display text</b>');
+define('TEXT_RESTORE_FILE', 'Saved file : ');
+define('TEXT_EDIT_FILE', 'Editing file: ');
+define('TEXT_SAVE_FILE', 'Restored file : ');
+
+define('TABLE_HEADING_FILE_TYPE', 'File type');
+define('TABLE_HEADING_FILE_NAME', 'File name');
+define('TABLE_HEADING_FILE_ACTION', 'Action');
+
+define('TEXT_MIXED_CONSTANT', 'This variable is mixed please use advanced edtor to edit this file %s(to bottom)%s');
+define('TEXT_ADV_EDITOR', 'Full Page Editor - For Advanced Users Only');
+
+
+define('TEXT_LANGUGES', 'languges');
+define('TEXT_MSG_1', 'No matching defines found');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/email_subjects.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/email_subjects.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/email_subjects.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: email_subjects.php, v1 07/11/2005
+
+  Copyright (c) 2005 PassionSeed
+  http://PassionSeed.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Email Subjects');
+
+define('TABLE_HEADING_EMAIL_SUBJECTS', 'Contact Us Email Subjects');
+define('TABLE_HEADING_EMAIL_SUBJECTS_CATEGORY', 'Subject Category');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_HEADING_NEW_EMAIL_SUBJECT', 'New Email Subject');
+define('TEXT_HEADING_EDIT_EMAIL_SUBJECT', 'Edit Email Subject');
+define('TEXT_HEADING_DELETE_EMAIL_SUBJECT', 'Delete Email Subject');
+
+define('TEXT_EMAIL_SUBJECTS', 'Email Subjects:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+
+define('TEXT_NEW_INTRO', 'Please fill out the following information for the new email subject');
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+
+define('TEXT_EMAIL_SUBJECTS_NAME', 'Email Subject Name:');
+define('TEXT_EMAIL_SUBJECTS_CATEGORY', 'Email Subject Category:');
+define('TEXT_EMAIL_SUBJECTS_CATEGORY_CHOICE', '1 = Admin; 2 = Customer');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this email subject?');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/events_calendar.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/events_calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/events_calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: events_calendar v1.00 2003/03/08 18:09:16 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+
+  define('NAVBAR_TITLE', 'Events Calendar');
+  define('HEADING_TITLE', 'Events Calendar');
+  define('TEXT_SELECT_EVENT', 'Select event');
+  
+  define('TEXT_EVENTS_FOR', 'Events for ');
+  define('TEXT_EVENT_DATE', 'Date :');
+  define('TEXT_EVENTS_START', 'Events starting on ');
+  define('TEXT_EVENT_START_DATE', 'From :');
+  define('TEXT_EVENT_END_DATE', 'Through :');
+  define('TEXT_EVENT_LINK', 'Link :');
+  define('TEXT_EVENT_OSC_LINK', 'OSC link :');
+  define('TEXT_EVENT_TITLE', 'Title :');
+  define('TEXT_EVENT_DESCRIPTION', 'Event :');
+  define('TEXT_EVENT_MORE', '... More >>');
+  define('TEXT_NO_EVENTS', 'No Events found.');
+  define('TEXT_OTHER_EVENTS', 'Other events for today :');
+
+  define('TEXT_DISPLAY_NUMBER_OF_EVENTS', 'Displaying event n° <b>%d</b><b>%_</b> of <b>%d</b> for ');
+  define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> events) ');
+  define('MAX_DISPLAY_PAGE_LINKS', 5);
+  define('MAX_DISPLAY_NUMBER_EVENTS', 5);
+  
+  define('BOX_CALENDAR_TITLE', ' View all events');
+  define('BOX_GO_BUTTON', 'go');
+  define('BOX_GO_BUTTON_TITLE', ' submit - month view ');
+  define('BOX_TODAY_BUTTON', ' T ');
+  define('BOX_TODAY_BUTTON_TITLE', ' view this month ');
+  define('BOX_YEAR_VIEW_BUTTON', ' Y ');
+  define('BOX_YEAR_VIEW_BUTTON_TITLE', ' year view ');
+  define('BOX_NEXT_LINK', 'next_month');
+  define('BOX_PREV_LINK', 'previous_month');
+  define('BOX_CLICK_LINK', 'Click for events');
+  
+  define('FIRST_DAY_OF_WEEK', 0);// First day of the week  1=Monday 0=Sunday;
+
+  define('NUMBER_OF_YEARS', 5);  //n° of years to be shown in drop-down
+  
+  define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
+  
+
+  
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/events_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/events_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/events_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+  $Id: events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Events Manager');
+define('DELETE_EVENTS_ERROR', 'Please select a date.');
+define('EVENTS_ERROR', 'Form error.\n\n');
+
+define('TABLE_HEADING_ID', 'Event ID');
+define('TABLE_HEADING_SIZE', 'Size');
+define('TABLE_HEADING_TITLE', 'Title');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+define('TABLE_HEADING_DATE_START', 'Sart Date');
+define('TABLE_HEADING_DATE_END', 'End Date');
+define('TABLE_HEADING_LINKS', 'Link / OSClink');
+define('TABLE_HEADING_OSC_LINK', 'OSC Link');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TEXT_NO_EVENTS', 'No events found.');
+
+define('TEXT_EVENT_TITLE', 'Title:');
+define('TEXT_EVENT_DESCRIPTION', 'Event:');
+
+define('TEXT_EVENT_ID', 'Event ID:');
+define('TEXT_EVENT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EVENT_START', 'Start Date:');
+define('TEXT_EVENT_END', 'End Date:');
+define('TEXT_CHOOSE_MANUFACTURER', 'Manufacturer:');
+define('TEXT_CHOOSE_CATEGORY', 'Category:');
+define('TEXT_CHOOSE_PRODUCT', 'Product:');
+define('TEXT_NO_PRODUCTS', 'No Products');
+define('TEXT_CHOOSE_UPCOMING', 'Upcoming products:');
+define('TEXT_NO_UPCOMING_PRODUCTS', 'No upcoming products:');
+
+define('TEXT_EVENT_OSC_LINK', 'OSC Link:');
+define('TEXT_EVENT_OSC_LINK_HELP', '( link to a specific Manufacturer / Category / Product or Upcoming product )');
+define('TEXT_CURRENT_OSC_LINK', 'Current OSC link: ');
+define('TEXT_START_DATE_NOTE', 'Upcoming products note: <b>Start Date</b> field will be set to "products_date_available".');
+define('TEXT_EVENT_LINK', 'Link:');
+define('TEXT_EVENT_LINK_HELP', 'Additional link, eg.: www.mysite.com/event_page.html (no http://)');
+define('TEXT_EVENT_IMAGE', 'Image:');
+define('TEXT_EVENT_NO_IMAGE', 'No Image:');
+
+define('TEXT_EVENT_PREVIEW', 'Preview:');
+
+define('TEXT_EVENT_DELETE_CONFIRM', 'Sure you want to delete event <a href="'. FILENAME_EVENTS_MANAGER .'?eID='. $eID .'&action=edit"><font color="red"><b>'. $eID .'</b></font></a> ?');
+define('TEXT_DELETE_EVENTS', 'Delete all events before:');
+define('TEXT_EVENTS_DELETE_CONFIRM', 'Sure you want to delete all events before <b>'. $before .'</b> ?');
+
+
+define('TEXT_INFO_DELETE_EVENT_INTRO', 'Are you sure you want to delete this event?');
+
+define('ERROR_EVENT_TITLE', 'Error: Event Title required');
+define('ERROR_EVENT_START_DATE', 'Error: Event Start Date required');
+
+define('ERROR_REQUIRED_FIELDS', ' * required');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/faq.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+  define('FAQ_ACTION', 'Action');
+  define('FAQ_ACTIVATION_ID', 'Activate? FAQ ID=');
+  define('FAQ_ACTIVATED_ID', 'Activated FAQ ID=');
+  define('FAQ_ADD', 'New FAQ');
+  define('FAQ_ADD_QUEUE', 'FAQ to queue');
+  define('FAQ_ALERT', 'Empty FAQ system');
+  define('FAQ_ANSWER', 'Answer');
+  define('FAQ_CREATED', 'Created');
+  define('FAQ_DATE', 'Date');
+  define('FAQ_DEACTIVATION_ID', 'Deactivate? FAQ ID=');
+  define('FAQ_DEACTIVATED_ID', 'Deactivated FAQ ID=');
+  define('FAQ_DELETE_CONFITMATION_ID', 'Delete Confirmation FAQ ID=');
+  define('FAQ_DELETE_ID', 'Delete FAQ ID=');
+  define('FAQ_DELETED_ID', 'Deleted FAQ ID=');
+  define('FAQ_EDIT_ID', 'Edit FAQ ID=');
+  define('FAQ_ERROR_20', 'You have not defined a valid value for option <b>Queue</b>. You can only define a numeric value');
+  define('FAQ_ERROR_80', 'You did not fill all <b>necessary fields</b>');
+  define('FAQ_ID', 'ID');
+  define('FAQ_ID_ACTIVE', 'this FAQ is Active'); 
+  define('FAQ_ID_DEACTIVE', 'this FAQ is NOT active'); 
+  define('FAQ_LANGUAGE', 'Language');
+  define('FAQ_MANAGER', 'FAQ Manager');
+  define('FAQ_NUMBER', 'No.');
+  define('FAQ_QUESTION', 'Question');
+  define('FAQ_QUEUE', 'Queue');
+  define('FAQ_QUEUE_LIST', 'QueueList: ');
+  define('FAQ_SORT_BY', 'In FAQ Page this Sort by');
+  define('FAQ_STATUS', 'Status');
+  define('FAQ_SYSTEM', 'FAQ System');
+  define('FAQ_UPDATED_ID', 'Updated FAQ ID=');
+  define('FAQ_VIEW', 'FAQ View');
+  define('FAQ_VIEW_ALL', 'FAQ View All');
+  define('FAQ_VISIBLE', 'Visible');
+  define('FAQ_WARNING', 'Warning');
+
+  define('ENTRY_CATEGORY', 'Category:');
+  define('TEXT_NO_CATEGORY', 'No Category');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/faq_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/faq_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/faq_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: faq_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'FAQ Categories');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_FAQ_HEADING_NEW_FAQ_CATEGORY', 'New Category');
+define('TEXT_FAQ_HEADING_EDIT_FAQ_CATEGORY', 'Edit Category');
+define('TEXT_FAQ_HEADING_DELETE_FAQ_CATEGORY', 'Delete Category');
+
+define('TEXT_FAQ_CATEGORY_COUNT', 'FAQs:');
+define('TEXT_FAQ_CATEGORY_STATUS', 'Status:');
+define('TEXT_FAQ_CATEGORY_DESCRIPTION', 'Description:');
+define('TEXT_FAQ_CATEGORY_SORT_ORDER', 'Sort Order:');
+define('TEXT_DATE_FAQ_CATEGORY_CREATED', 'Created:');
+define('TEXT_DATE_FAQ_CATEGORY_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_NEW_FAQ_CATEGORIES_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_EDIT_FAQ_CATEGORIES_INTRO', 'Please make any necessary changes');
+define('TEXT_DELETE_FAQ_CATEGORIES_INTRO', 'Are you sure you want to delete this category?');
+
+define('TEXT_FAQ_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_FAQ_CATEGORIES_DESCRIPTION', 'Category Description:');
+define('TEXT_FAQ_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_FAQ_CATEGORIES_SORT_ORDER', 'Sort Order:');
+define('TEXT_FAQ_CATEGORIES_STATUS', 'Status:');
+define('TEXT_FAQ_CATEGORIES_STATUS_ENABLE', 'Enable');
+define('TEXT_FAQ_CATEGORIES_STATUS_DISABLE', 'Disable');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>WARNING:</b> There are %s FAQs still linked to this category!');
+
+define('TEXT_DISPLAY_NUMBER_OF_FAQ_CATEGORIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> categories)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/feature_not_present.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/feature_not_present.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/feature_not_present.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Feature Not Present');
+define('IMAGE_UPGRADE', 'Upgrade Now');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/featured.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Featured Products');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_FEATURED_PRODUCT', 'Product:');
+define('TEXT_FEATURED_EXPIRES_DATE', 'Expiry Date:');
+
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_EXPIRES_DATE', 'Expires At:');
+define('TEXT_INFO_STATUS_CHANGE', 'Status Change:');
+
+define('TEXT_INFO_HEADING_DELETE_FEATURED', 'Delete Featured Product');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this Featured Product?');
+
+define('TEXT_DISPLAY_NUMBER_OF_FEATURED', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> Featured Products)');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/file_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/file_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/file_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: file_manager.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'File Manager');
+
+define('TABLE_HEADING_FILENAME', 'Name');
+define('TABLE_HEADING_SIZE', 'Size');
+define('TABLE_HEADING_PERMISSIONS', 'Permissions');
+define('TABLE_HEADING_USER', 'User');
+define('TABLE_HEADING_GROUP', 'Group');
+define('TABLE_HEADING_LAST_MODIFIED', 'Last Modified');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_UPLOAD', 'Upload');
+define('TEXT_FILE_NAME', 'Filename:');
+define('TEXT_FILE_SIZE', 'Size:');
+define('TEXT_FILE_CONTENTS', 'Contents:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_NEW_FOLDER', 'New Folder');
+define('TEXT_NEW_FOLDER_INTRO', 'Enter the name for the new folder:');
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this file?');
+define('TEXT_UPLOAD_INTRO', 'Please select the files to upload.');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Error: I can not remove this directory. Please set the right user permissions on: %s');
+define('ERROR_FILE_NOT_REMOVEABLE', 'Error: I can not remove this file. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/forbiden.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/forbiden.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/forbiden.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Access Denied');
+define('NAVBAR_TITLE', 'No Right Permission Access');
+define('TEXT_MAIN', '&nbsp;Please contact your <b>Webmaster</b> to request <br>&nbsp;more access or if you found any problem.<br>&nbsp;');
+define('TEXT_BACK', 'Back');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/froogle.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/froogle.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/froogle.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Froogle Data Feed');
+
+define('TEXT_INFO_COMPLETED', 'Building feed files completed: ');
+
+define('TEXT_INFO_FTP_ERROR1', 'FTP open connection failed to: ');
+define('TEXT_INFO_FTP_ERROR2', 'FTP connection has failed! ');
+define('TEXT_INFO_FTP_ERROR3', 'Attempted to connect to ');
+define('TEXT_INFO_FTP_ERROR4', 'for user ');
+define('TEXT_INFO_FTP_ERROR5', 'Connected to ');
+define('TEXT_INFO_FTP_ERROR6', 'Current directory is now: ');
+define('TEXT_INFO_FTP_ERROR7', 'Couldn\'t change directory on ');
+define('TEXT_INFO_FTP_ERROR8', ': FTP upload has failed! ');
+define('TEXT_INFO_FTP_ERROR9', "Uploaded " . $ftpsourcefile . " to " . $ftpservername . " as " . $ftpdestinationfile);
+
+define('TEXT_INFO_FTP_SCRITP_TIMER', 'Script timer: <b>%f</b> seconds.');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/froogle_pre.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/froogle_pre.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/froogle_pre.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Froogle Data Feed');
+
+define('TEXT_INFO_COMPLETED', 'Building feed files completed:');
+define('TEXT_INFO_TIMER', 'Script timer:');
+define('TEXT_INFO_SECOND', 'seconds.');
+
+define('TEXT_INFO_DONE', 'Categores built return to data admin');
+
+
+define('TEXT_OUTPUT_1', "product_url \t name \t description \t price \t image_url \t category \t offer_id");
+define('TEXT_OUTPUT_2', "\t instock ");
+define('TEXT_OUTPUT_3', "\t shipping ");
+define('TEXT_OUTPUT_4', "\t brand ");
+define('TEXT_OUTPUT_5', "\t upc ");
+
+define('TEXT_OUTPUT_6', "\t manufacturer_id ");
+define('TEXT_OUTPUT_7', "\t product_type ");
+define('TEXT_OUTPUT_8', "\t currency ");
+define('TEXT_OUTPUT_9', "\t language ");
+
+define('TEXT_OUTPUT_10', "\t ship_to ");
+define('TEXT_OUTPUT_11', "\t ship_from ");
+
+define('TEXT_OUTPUT_12', "Not Supported");
+define('TEXT_OUTPUT_13', "book");
+define('TEXT_OUTPUT_14', "music");
+define('TEXT_OUTPUT_15', "video");
+define('TEXT_OUTPUT_16', "other");
+
+define('TEXT_OUTPUT_17', 'data feed: ');
+define('TEXT_OUTPUT_18', 'File completed: ');
+define('TEXT_OUTPUT_19', 'view output file');
+
+define('TEXT_OUTPUT_20',' Run category build        run feed build    ');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/geo_zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/geo_zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/geo_zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: geo_zones.php,v 1.1.1.1 2004/03/04 23:40:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Zonas Fiscales');
+
+define('TABLE_HEADING_COUNTRY', 'Pa&iacute;s');
+define('TABLE_HEADING_COUNTRY_ZONE', 'Zona');
+define('TABLE_HEADING_TAX_ZONES', 'Zona Fiscal');
+define('TABLE_HEADING_ACTION', 'Acci&oacute;n');
+
+define('TEXT_INFO_HEADING_NEW_ZONE', 'Nueva Zona');
+define('TEXT_INFO_NEW_ZONE_INTRO', 'Introduzca los datos de la nueva zona');
+
+define('TEXT_INFO_HEADING_EDIT_ZONE', 'Editar Zona');
+define('TEXT_INFO_EDIT_ZONE_INTRO', 'Haga los cambios necesarios');
+
+define('TEXT_INFO_HEADING_DELETE_ZONE', 'Eliminar Zona');
+define('TEXT_INFO_DELETE_ZONE_INTRO', 'Seguro que quiere eliminar esta zona?');
+
+define('TEXT_INFO_HEADING_NEW_SUB_ZONE', 'Nueva Subzona');
+define('TEXT_INFO_NEW_SUB_ZONE_INTRO', 'Introduzca los datos de la subzona');
+
+define('TEXT_INFO_HEADING_EDIT_SUB_ZONE', 'Editar Subzona');
+define('TEXT_INFO_EDIT_SUB_ZONE_INTRO', 'Haga los cambios necesarios');
+
+define('TEXT_INFO_HEADING_DELETE_SUB_ZONE', 'Eliminar Subzona');
+define('TEXT_INFO_DELETE_SUB_ZONE_INTRO', 'Seguro que quiere eliminar esta subzona?');
+
+define('TEXT_INFO_DATE_ADDED', 'A&ntilde;adido el:');
+define('TEXT_INFO_LAST_MODIFIED', 'Modificado:');
+define('TEXT_INFO_ZONE_NAME', 'Nombre de la Zona:');
+define('TEXT_INFO_NUMBER_ZONES', 'N&uacute;mero de Zonas:');
+define('TEXT_INFO_ZONE_DESCRIPTION', 'Descripci&oacute;n:');
+define('TEXT_INFO_COUNTRY', 'Pa&iacute;s:');
+define('TEXT_INFO_COUNTRY_ZONE', 'Zona:');
+define('TYPE_BELOW', 'Todas las zonas');
+define('PLEASE_SELECT', 'Todas las zonas');
+define('TEXT_ALL_COUNTRIES', 'Todos los paises');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: gv_mail.php,v 1.1.1.1 2004/03/04 23:40:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Send Gift Voucher To Customers');
+
+define('TEXT_CUSTOMER', 'Customer:');
+define('TEXT_SUBJECT', 'Subject:');
+define('TEXT_FROM', 'From:');
+define('TEXT_TO', 'Email To:');
+define('TEXT_AMOUNT', 'Amount');
+define('TEXT_MESSAGE', 'Message:');
+define('TEXT_SINGLE_EMAIL', '<span class="smallText">Use this for sending single emails, otherwise use dropdown above</span>');
+define('TEXT_SELECT_CUSTOMER', 'Select Customer');
+define('TEXT_ALL_CUSTOMERS', 'All Customers');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'To All Newsletter Subscribers');
+
+define('NOTICE_EMAIL_SENT_TO', 'Notice: Email sent to: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Error: No customer has been selected.');
+define('ERROR_NO_AMOUNT_SELECTED', 'Error: No amount has been selected.');
+
+define('TEXT_TO_REDEEM1', 'You can also redeem this Gift Voucher during checkout. Just enter the code in the box provided, and click on the redeem button. ');
+define('TEXT_GV_WORTH', 'The Gift Voucher is worth ');
+define('TEXT_TO_REDEEM', 'To redeem this Gift Voucher, please click on the link below. Please also write down the redemption code');
+define('TEXT_REMEMBER', 'Please do not lose the coupon code, make sure to keep the code safe so you can benefit from this special offer');
+define('TEXT_WHICH_IS', ' which is ');
+define('TEXT_IN_CASE', ' in case you have any problems.');
+define('TEXT_OR_VISIT', 'or visit ');
+define('TEXT_ENTER_CODE', ' and enter the code during the checkout process');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_HEADER', 'You recently purchased a Gift Voucher from our online store.' . "\n"
+                                          . 'For security reasons this was not made immediately available to you.' . "\n"
+                                          . 'However this amount has now been released. You can now visit our store' . "\n"
+                                          . 'and send the value via Email to someone.' . "\n\n");
+define ('TEXT_REDEEM_COUPON_MESSAGE_AMOUNT', "\n\n" . 'The value of the Gift Voucher was %s');
+define ('TEXT_REDEEM_COUPON_MESSAGE_BODY', "\n\n" . 'You can now visit our site, login and send the Gift Voucher amount to anyone you want.');
+define ('TEXT_REDEEM_COUPON_MESSAGE_FOOTER', "\n\n");
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">The Back Button has been DISABLED while HTML WYSIWG Editor is turned ON.</b></font><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML is currently Disabled!</b></font><br><br>If you want to send HTML email, Enable WYSIWYG Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_queue.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_queue.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_queue.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: gv_queue.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Cola de salida de cheques regalo');
+
+define('TABLE_HEADING_CUSTOMERS', 'Clientes');
+define('TABLE_HEADING_ORDERS_ID', 'Núm. de pedido');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Valor del cheque');
+define('TABLE_HEADING_DATE_PURCHASED', 'Fecha de compra');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_HEADER', 'Recientemente ha comprado un cheque regalo en nuestra tienda.' . "\n"
+                                          . 'Por razones de seguridad no ha estado disponible de forma inmediata.' . "\n"
+                                          . 'De todas formas la cantidad ya está liberada. Puede visitar nuestra tienda' . "\n"
+                                          . 'y enviar el valor vía email a quien quiera.' . "\n\n");
+
+define('TEXT_REDEEM_COUPON_MESSAGE_AMOUNT', 'El/Los cheque(s) regalo que ha comprado tienen un valor de %s' . "\n\n");
+
+define('TEXT_REDEEM_COUPON_MESSAGE_BODY', '');
+define('TEXT_REDEEM_COUPON_MESSAGE_FOOTER', '');
+define('TEXT_REDEEM_COUPON_SUBJECT', 'Compra de cheques regalo');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: gv_queue.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gift Voucher Report');
+define('HEADING_SUB_TITLE', 'This report list all GV issued and if they have been released');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDERS_ID', 'Order-No.');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Voucher Value');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_GV_REPORT_RELEASED', 'Released to customer: ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_sent.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_sent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/gv_sent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: gv_sent.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Cheques regalo enviados');
+
+define('TABLE_HEADING_SENDERS_NAME', 'Nombre del remitente');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Valor del cheque');
+define('TABLE_HEADING_VOUCHER_CODE', 'Código del cheque');
+define('TABLE_HEADING_DATE_SENT', 'Fecha de envío');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_SENDERS_ID', 'ID del remitente:');
+define('TEXT_INFO_AMOUNT_SENT', 'Cantidad enviada:');
+define('TEXT_INFO_DATE_SENT', 'Fecha de envío:');
+define('TEXT_INFO_VOUCHER_CODE', 'Código del cheque:');
+define('TEXT_INFO_EMAIL_ADDRESS', 'Dirección de email:');
+define('TEXT_INFO_DATE_REDEEMED', 'Fecha de amortización:');
+define('TEXT_INFO_IP_ADDRESS', 'Dirección IP:');
+define('TEXT_INFO_CUSTOMERS_ID', 'ID de cliente:');
+define('TEXT_INFO_NOT_REDEEMED', 'Sin amortizar');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/header_tags_controller.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/header_tags_controller.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/header_tags_controller.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: header_tags.php,v 1.6 2005/04/10 14:07:36 hpdl Exp $
+  Created by Jack York from http://www.oscommerce-solution.com
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_CONTROLLER', 'Header Tags Controller');
+define('HEADING_TITLE_ENGLISH', 'Header Tags - English');
+define('HEADING_TITLE_FILL_TAGS', 'Header Tags - Fill Tags');
+define('TEXT_INFORMATION_ADD_PAGE', '<b>Add a New Page</b> - This option adds the code for a page into the files mentioned 
+above. Note that it does not add an actual page. To add a page, enter the name of the file, with or without the .php extension..');
+define('TEXT_INFORMATION_DELETE_PAGE', '<b>Delete a New Page</b> - This option will remove the code for a page from the
+above files.'); 
+define('TEXT_INFORMATION_CHECK_PAGES', '<b>Check Missing Pages</b> - This option allows you to check which files in your
+shop do not have entries in the above files. Note that not all pages should have entries. For example,
+any page that will use SSL like Login or Create Account. To view the pages, click Update and then select the drop down list.'); 
+
+define('TEXT_PAGE_TAGS', 'In order for Header Tags to display information on a page, an entry for that
+page must be made into the includes/header_tags.php and includes/languages/english/header_tags.php files
+(where english would be the language you are using). The options on this page will allow you to add, delete
+and check the code in those files.');
+define('TEXT_ENGLISH_TAGS', 'The main purpose of Header Tags is to give each of the pages in your shop a 
+unique title and meta tags for each page. The default settings will not do your shop any good and need to 
+be changed on this page. The individual sections are named after the page they belong to. So, to change the 
+title of your home page, edit the title in the index section.');
+define('TEXT_FILL_TAGS', 'This option allows you to fill in the meta tags added by
+Header Tags. Select the appropriate setting for both the categories and products tags
+and then click Update. If you select the Fill Only Empty Tags, then tags already
+filled in will not be overwritten. ');
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+
+
+define('ERROR_PAGE_NAME_IS_ALREADY_ENTERED', 'Page name is already entered -> ');
+define('ERROR_DELETE_FROM_ENGLISH_1', 'delete from English  ');
+define('ERROR_DELETE_FROM_ENGLISH_2', ' for  ');
+define('PAGE_NAME', 'Page Name');
+define('SWITCHES', 'Switches:');
+define('HTTA', 'HTTA:');
+define('HTDA', 'HTDA:');
+define('HTKA', 'HTKA:');
+define('HTCA', 'HTCA:');
+define('EXPLAIN', '(Explain)');
+define('TITLE_TITLE', 'Title');
+define('DESCRIPTIONS', 'Descriptions');
+define('KEYWORD', 'Keyword(s)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/header_tags_popup_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/header_tags_popup_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/header_tags_popup_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: header_tags_popup_help.php,v 1.0 2005/09/22 
+   
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+  
+  Released under the GNU General Public License
+*/
+?>
+<style type="text/css">
+.popupText {color: #000; font-size: 12px; } 
+</style>
+<table border="0" cellpadding="0" cellspacing="0" class="popupText">
+  <tr><td><hr class="solid"></td></tr>
+  <tr>
+   <td class="popupText"><p><b>What are HTTA, HTDA, HTKA and HTCA used for?</b><br><br>
+    Header Tags comes with a default set of tags. You can create your own
+    set of tags for each page (it comes with some set up, like for index
+    and product pages).
+
+<pre>
+HT = Header Tags  
+T  = Title 
+A  = All 
+D  = Decription
+K  = Keywords
+C  = Categories *
+</pre>  
+<b>* Note:</b> The HTCA option only works for the index page. It causes the
+category name to be displayed in the title.<br><br>
+
+If HTTA is set on (checked), then it says display the Header Tags Title All 
+(default title plus the one you set up).<br><br>
+
+So if you have the option checked, both titles will be displayed.
+Let's say your title is Mysite and the default title is Oscommerce.<br>
+<pre>
+With HTTA on, the title is
+ Mysite Oscommerce
+With HTTA off, the title is
+ Mysite
+</pre>
+</p>
+  </td>
+ </tr>
+ 
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision : $Revision$
+   
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)<br><br>
+
+&nbsp;&nbsp;<b>Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Some documentation that was previously provide now can be accesed via the admin.
+These help document cover a variety of subjects to you as the Store owner to manage your store.
+</P>
+<P>
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+</P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<tr>
+<td>
+<!-- Begin help index2.html-->
+<UL>
+<b>&nbsp;&nbsp;Admin help and how to document </b>
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Setup and configure </b>
+<LI><a href="<?php echo tep_href_link('../doc/CRE6.15-QUICK-INSTALL-GUIDE.pdf', '') . '"> Quick install (PDF) </a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/addlanguage.txt', '') . '">Adding Languages  (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/adminssl.txt', '') . '">SSL for Admin (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../admin/data.php', '') . '">Easy Populate 3.01 (html)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../admin/edit_textdata_help.php?&help_id=1', '') . '">Language Editor (html)</a>' ;?></LI>
+</UL>
+<UL>
+&nbsp;&nbsp;<b>Payment modules</b>
+<LI><a href="<?php echo tep_href_link('../admin/authnet_help.php', '') . '">Authorize.net setup (html)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/payment/paypal/Help_FAQs.inc.php', '') . '"> Paypal Faq\'s (html)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/payment/paypal/Help_Config.inc.php', '') . '">Paypal how to (html)</a>' ;?>
+<UL>
+ </td>
+   </tr>
+<!-- End help index2.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<tr>
+<td>
+<!-- Begin help index2.html-->
+<UL>
+<b>&nbsp;&nbsp;Catalog help and how to document </b>
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Testing the Cart </b>
+</UL>
+ </td>
+   </tr>
+<!-- End help index2.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<tr>
+<td>
+<!-- Begin help index4.html-->
+
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Miscellaneous Documents from the /doc directory </b>
+<LI><a href="<?php echo tep_href_link('../doc/CRE6.15-QUICK-INSTALL-GUIDE.pdf', '') . '">'. 'Quick Setup (pdf)' . '</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/addlanguage.txt', '') . '">Adding New Languages (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/adminssl.txt', '') . '">SSL for admin (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/changesloaded6151.txt', '') . '">Changes for CRE Loaded Patch 01 (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/buttons.txt', '') . '">List of buttons (txt)</a>' ;?></LI>
+</UL>
+<UL>
+<br>&nbsp;&nbsp;<b>Liscense</b>
+<LI><a href="<?php echo tep_href_link('../doc/license.txt', '') . '">GPL 2 English (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/doc/none.txt', '') . '">GPL 2 Espanol (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link('../doc/gnu_french.txt', '') . '">GPL 2 French (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link('../doc/gnu-german.html', '') . '">GPL 2 German (txt)</a>' ;?>
+ </td>
+   </tr>
+<tr>
+<td>
+</td>
+</tr>
+
+<!-- End help index4.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/index5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/none.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/none.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc/none.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Sorry this is not yet avalable
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision : $Revision$
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_cat.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_cat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_cat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision : $Revision$
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision: $Revision$
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_misc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_misc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/doc_misc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision $Revision$
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/edit_key_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/edit_key_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/edit_key_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: edit_key_help.php,v 1.1 
+  
+  Copyright &copy 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_01', 'Introduction');
+define('HEADING_TITLE_02', 'Configure Encrypt and Decrypt');
+define('HEADING_TITLE_03', 'Key management');
+define('HEADING_TITLE_04', 'Encrypt and Decrypt data');
+define('HEADING_TITLE_05', 'Changing your key');
+define('HEADING_TITLE_06', 'Test');
+define('HEADING_TITLE_07a', 'Encrypted data that is not encrypted');
+define('HEADING_TITLE_07b', 'Decrypting data that is encrypted');
+define('HEADING_TITLE_07c', 'Changing keys and updating encrypted data');
+
+
+define('TEXT_MAG_1', 'Index');
+define('TEXT_MAG_2', 'Pre install and installation of Encrypt and Decrypt');
+define('TEXT_MAG_3', 'Specific task:');
+define('TEXT_MAG_4', 'A. Encrypted data');
+define('TEXT_MAG_5', 'B. Decrypting data');
+define('TEXT_MAG_6', 'C. Changing keys and updating encrypted data');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/edit_textdata_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/edit_textdata_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/edit_textdata_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: $Author$
+  Revision $Revision$
+  
+*/
+
+
+define('HEADING_TITLE_01', 'Edit Languages: Introduction ');
+define('HEADING_TITLE_02', 'Edit Languages: Search ');
+define('HEADING_TITLE_03', 'Edit Languages: Edit ');
+define('HEADING_TITLE_04', 'Edit Languages: Save');
+define('HEADING_TITLE_05', 'Edit Languages: Restore');
+define('MENU_ITEM_01', 'Introduction:');
+define('MENU_ITEM_02', '1. Search for files or text');
+define('MENU_ITEM_03', '2. Edit text define');
+define('MENU_ITEM_04', '3. Saving your work ');
+define('MENU_ITEM_05', '4. Restore to last copy of define file');
+
+define('TEXT_MSG_1', 'Language Editor Help Index');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/data_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/data_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/data_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+?>
+<tr>
+ <td>
+<p align="center"><b><span style="font-size:16pt;">Data Feed Input/Output Introduction</span></b></p>
+<p>Data feed service is a collection of contributions to allow you to updated 
+your products and categories data remotely, and send that data to data listing 
+services. It used a number of contributions that have been modified to work 
+with small, medium, and large stores. </p>
+<p>Contributions:<br>Easy Populate Advance by Tom O'Neill<br>Easy Populate Basic<br>Froogle 
+data feed : Calvin K<br> &nbsp;&nbsp;&nbsp;Salemaker for froogle feed: by<br> 
+&nbsp;&nbsp;&nbsp;Admin for Froogle Data Feed : Tom O'Neill<br><br> Goals:<br>The 
+typical store owner never needs to edit a code or define file directly.The store 
+owner does not need a lot of support on how to use program.Combines the functions 
+of moving data in and out of store is in one are.Make it flexible enough for 
+small, medium and large store to use program effectively.Move program files closer 
+to OSC/CRE Loaded standards for look and feel, and coding.<br><br>Parts of 
+Data Feed Service:<br>&nbsp;Easy Populate: This is used to update data it allows 
+you to updated data remotely on your&nbsp;local computer and upload to the data 
+to your on line store. It allows you to&nbsp;&nbsp;build custom queries for 
+the data then download the information to your local computer&nbsp;&nbsp;for 
+editing, Then upload back to your &nbsp;on-line store.</p>
+<p>&nbsp;Data feed:<br>&nbsp;&nbsp;Data feed takes the data with in your catalog 
+and prepares it for submission to a feed &nbsp;service and send it to the feed 
+service either automatically or manually if you need on completion&nbsp;of building 
+the feed.<br>&nbsp;Features added and changes to basic programs.<br> &nbsp;&nbsp;&nbsp;Easy 
+populate 2.75 Advance to 2.78:<br>&nbsp;1. Removed the froogle feed from this 
+contribution. The froogle function is now &nbsp;handled by separate code files.<br>&nbsp;2. 
+Moved EP from catalog side box to Data export/import side box.<br>&nbsp;3. Moved 
+function file to admin/includes/function directory to follow OSC standards.<br>&nbsp;4. 
+Moved most simple function to function file, export now has all functions removed 
+. There is now only one function left in the EPA import file. <br>&nbsp;5. Revised 
+admin screens so it was more like the rest of the catalog.<br>&nbsp;6. Inserted 
+tep form function rather then html form function (In progress)<br>&nbsp;7. Added 
+pop up help for information on how to use EPA.<br>&nbsp;8. Easy Populate Basic 
+is for backward compatibility with older versions of EP<br>&nbsp;&nbsp;&nbsp;&nbsp;EP 
+advance will import all EPA files of previous version of EPA. <br>&nbsp;9. Export 
+screen and Import screen separated into two separate files<br>&nbsp;10. Side 
+box changed, so that sub titles are offset.<br>&nbsp;11. Added date time to 
+split so each group of splits will be unique and old splits will&nbsp;not be 
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>&nbsp;12. 
+Program message, error, and output were place in one of three variable so they 
+could be output&nbsp:with in the html output section of the files.<br> &nbsp;&nbsp;<br>&nbsp;Items 
+fixed or enhanced from EP 2.74 to 2.75 Advance:<br>&nbsp;1. To add products 
+the product id should be set to 0, there can be many 0's for product ID's.<br>&nbsp;2. 
+You no longer need to change the manufacturers table to change a manufacturers_id 
+first&nbsp;manf id to 1 or 0<br>&nbsp;3. No longer adds a empty product, caused 
+by not treating the last line as not product.<br>&nbsp;4. Added EP Basic, It 
+cannot install any EP Advanced files since they start with EPA a error<br>&nbsp;&nbsp;&nbsp;&nbsp;message 
+will be displayed. It can install any file that starts will EPB or older EP files<br>&nbsp;5. 
+EP Advanced set up so it can only read files that start with EPA , prevents 
+reading older files.<br>&nbsp;6. Delete has been added back into EP for products 
+only. &nbsp;This is implemented via a new column call v_action. You must type 
+the word &quot;delete&quot; in this column to delete a product.<br>&nbsp;7. 
+EP basic was not showing on some site this was to an error in the install of 
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>&nbsp;8. 
+You can add your own product ID, If your product ID's are based on a system 
+other than&nbsp;numbers generated by the shopping cart and auto incremented by 
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows 
+for compatibility with some external inventory management systems.<br>&nbsp;9. 
+moved configuration of EP to a separate file called epconfigure.php <br><br>&nbsp;Data 
+Feed:<br>&nbsp;1. Added language files<br>&nbsp;2. Multiple configurations for 
+multiple feed services now available through admin screen<br>&nbsp;3. Configuration 
+configured in admin rather then edit a file.<br>&nbsp;4. Feed submission now 
+A multiple step process.<br>&nbsp;5. Switched to tep functions for data base 
+queries.<br>&nbsp;6. Split file generation and FTP code into two separate files.<br>&nbsp;7. 
+Combined Froogle, Yahoo and Bizrite into one package (Not all installed and 
+adapted yet)<br>&nbsp;8. added fields for advance feed to products database<br>&nbsp;9. 
+added separate sql file for additional info for froogle feed<br>&nbsp;10. Builds 
+Category strings before building feed file.<br>&nbsp;11. Help popups added to 
+admin screens.<br>&nbsp;12. Added salemaker contribution pricing to price sent 
+to price in feed.<br>&nbsp;13. Uses tax zone from store. <br>&nbsp;14. Add the 
+fields froogle_type, upc, isbn, manufacturer_product_id to products table and 
+products edit screen.<br>&nbsp;15. add froogle specific fields for books, music, 
+video to a separate table.<br><br>&nbsp;For EP set up:<br>&nbsp;For Data feeds 
+set up:<br>Step 1 <br>&nbsp;To set up this modules data feed service, you must 
+first register with the feed services you wish to use.&nbsp;This is described 
+in the getting started document. It has links to the feed services &nbsp;and 
+what you need to set up the configuration of each service.<br>Step 2<br>Next 
+you need to install this contribution this is disturbed in the doc/install.txt 
+files<br>Step 3<br>The you will need to configure and run the data feeds this 
+is described in the running doc/configureandrun.txt document The file field_spec.txt 
+describes the limitation of what can be placed into each field<br><br>&nbsp;Known 
+bugs:<br>&nbsp;&nbsp;1. PHP 5 compatibility for import. the problem is either 
+how globals are treated or&nbsp;&nbsp;how arrays are used in this contribution<br></p>
+ </td>
+</tr> 
+<tr>
+  <td>
+ <b>Error and status messages</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will appear near the top of the for, Blue background 
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_msg.gif" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ <b>Import result</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now appear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ <b>Help while using the admin screens</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or input you could use. It will display a pop up window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
+

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/edit_key_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/edit_key_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/edit_key_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: edit_key_help.php,v 1.1 
+
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_01', 'Introduction');
+define('HEADING_TITLE_02', 'Configure Encrypt and Decrypt');
+define('HEADING_TITLE_03', 'Key management');
+define('HEADING_TITLE_04', 'Encrypt and Decrypt data');
+define('HEADING_TITLE_05', 'Changing your key');
+define('HEADING_TITLE_06', 'Test');
+define('HEADING_TITLE_07a', 'Encrypting data');
+define('HEADING_TITLE_07b', 'Decrypting data');
+define('HEADING_TITLE_07c', 'Changing keys and updating encrypted data');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page1.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page1.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page1.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+?>
+
+
+<table width="100%" border="0" cellpadding="5" cellspacing="3">
+  <tr valign="top">
+    <td><p><strong><font color="red">Warnings </font></strong></p>
+      <p><strong><img src="images/icons/warning_big.gif" alt="Warning" width="20" height="20" hspace="5"></strong> <font color="#FF0000">You must check the import and export laws of your country. Some prevent the use of encrypted data or software with hooks in place for encryption to be added. This module does not contain actual encryption code. It uses the mcrypt module, and provides management services. While it is not subject to export laws in the US, it may well be regulated by your jurisdiction. You are responsible for knowledge of and compliance with local laws.</font> </p>
+      <p><strong><img src="images/icons/warning_big.gif" alt="Warning" width="20" height="20" hspace="5"></strong> <font color="#FF0000">One must be careful when the encryption/decryption takes place. Network service disruptions and other factors can cause loss of data availability - ie leaving data encrypted with no key available. It is important to process your cards as frequently as you can, and to delete the data as soon as the transaction is cleared.</font></p>
+      <p><strong> Introduction:</strong> <br>
+      Requirements for the protection of personal and financial data are being increased day by day. This package was developed to assist you with this requirement during the daily operation of your CRE loaded store. There are 3 main components within this package, ssl for admin, encryption/decryption of data, and pgp signing for email with sensitive data. PGP is not yet implemented. Encryption is functional, but not fully developed in this 0.7 release Encrypt and Decrypt component has 4 main functions within it. Configuration, Manage Keys, Update/Convert, Test. </p>
+      <p> 1. Pre install and installation of Encrypt and Decrypt : &nbsp;&nbsp;&nbsp;<br>
+        <img src="images/pixel_trans.gif" width="30" height="10">        A. Setup and installation: See install_encrypt.txt<br>
+      <img src="images/pixel_trans.gif" width="30" height="10">&nbsp;B. Enabling SSL for Admin</p>
+      <p>        Although the encryption protects the data while it is stored in the database tables. It does not protect data when you view it in the admin screens. To help with this SSL for admin was written, this should be installed in the admin and the appropriate edit screens run in ssl mode. The files in this package are designed to work with or with out SSL for admin.</span>      </p>
+      </P></td>
+  </tr>
+  <tr>
+    <td class="pageHeading"><B>Help while using the admin screens</B> </td>
+  </tr>
+  <tr>
+    <td><img src="includes/languages/english/help/encrypt/images/item_help.gif" alt="Screen Shot" width="460" height="364" border="1" ><br>
+      You will notice help icons like this throughout the admin screens These icons trigger popup screens with individual help for each setting or input you see labeled with the icon<br></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><font class="pageHeading">A. Configuration:</font></p>
+      The configuration only has 3 items that need to be setup, along with the key file.<br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/configure1a.png" NAME="Graphic1" WIDTH="644" HEIGHT="143" hspace="5" vspace="5" BORDER=1>
+      <p><font class="content_heading">1. Enable CC encryption Default: false</font><BR>
+        You can turn on and off the encryption, Once you turn on encryption the back off you can use the convert data screen to decrypt the data. If you do this it is advisable to remove the sensitive data. The order viewing and edit screen will decrypt the data so it is viewable.</P>
+      <p><font class="content_heading">2.Path to key File Default key/</font><BR>
+        Currently this is a directory within the includes/ directory.</P>
+      <p><font class="content_heading">3. Key File Name: cc_key.php</font><BR>
+        This is the file name for the key file, It is suggested that you use a different name then the one listed here. By clicking on this configuration setting you have three task to do.</span></font> &nbsp;b. Edit the key file name<BR>
+      </P>
+      <p><IMG SRC="includes/languages/english/help/encrypt/images/configure3.png" NAME="Graphic3" WIDTH="219" HEIGHT="154" BORDER=1> </p>
+      <p>Note: Once you have set the name of the file you can switch to Manage Key files<BR>
+        </span></font>
+        </p>
+      </p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> On opening the Manage Key Files screen it will look like the above screen with no key files.<br>
+      Click on the CREATE files button and a empty key file will be set up using the name you selected in the text input box.<BR>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_start.png" alt="Screen Shot" NAME="Graphic11" WIDTH="723" HEIGHT="213" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> You will now have two empty key files. Starting off you will only need to enter a key phrase into the Primary key file. Next click on the EDIT button next to the Primary key file. This will open the key file edit screen.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_createt.png" alt="Screen Shot" NAME="Graphic5" WIDTH="725" HEIGHT="251" hspace="5" vspace="5" BORDER=1> </p>
+      </P>
+      <p><strong>C.</strong> To edit the &quotPrimary&quot Click on the EDIT button at the end of the row. A Key Edit screen will open.<br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_edit1.png" alt="Screen Shot" NAME="Graphic8" WIDTH=526 HEIGHT="152" hspace="5" vspace="5" BORDER=1><br>        
+      <strong> Note:</strong> The new key file is used to allow updating the data encryption when you want to change to a new encryption key.</p>
+      <p><strong>D.</strong> Type in your key phrase in the text box and click the SAVE button. This will save the phrase. 
+  The phase can be anything from random numbers and letters to a phrase you can remember.</p>
+      <p><strong>E. </strong>From this point on all cc information will be encrypted as it is entered into the orders by the customer.
+    The next step you may need to take might be to encrypt existng Credit card information.</p>
+    <p><strong>F.</strong> Next click on the Update cc data in the lefthand side box.</p></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> Each order paid by credit card using a module which stores the number will appear in this list. Click on the ones marked as unencrypted. Then click on the encrypt button. <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/e_c_order1.png" alt="Screen Shot" NAME="Graphic4" WIDTH="641" HEIGHT="141" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> You will now have encrypted this existing entry. Do this for each unencrypted CC number. Next to the encrypt button is a decrypt button that can be used to decrypt the information. Attempts to re-encrypt a number again will fail.<br>
+      <img src="includes/languages/english/help/encrypt/images/e_c_order.png" alt="Screen Shot" name="Graphic9" width="642" height=137 hspace="5" vspace="5" border=1></p>
+      <p><strong>C.</strong> Mass Encryption or Decryption can also be done. Simply click on the encrypt or decrypt buttons at the top of the form and all numbers will be processed. The program will detect those orders that have already been encrypted or decrypted and change only the data which requires processing.        <BR>
+      <IMG SRC="includes/languages/english/help/encrypt/images/d_c_main_all.png" alt="Screen Shot" NAME="graphics1" WIDTH=545 HEIGHT=61 hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>D.</strong> If you need to export your Credit card information to an external program that cannot use the mcrypt library you can decrypt all of the encrypted data before exporting the information. Once you have exported the data you should return to this screen to encrypt all data. <BR>
+      </p></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Author: $Author$
+  Revision : $Revision$
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> Keys should be changed from time to time as a security precaution. When you first set up your &quot;Primary key file&quot; an empty &quot;New key file&quot; was created. In fact, CRE Loaded comes with 2 key files already in place, just in case your host allows editing of existing files but restricts creation of files from within the web server. You will now need to add your new key to this file . In the row that is labeled &quot;New key file&quot; click on the edit button.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_createt.png" alt="Screen Shot" NAME="Graphic6" WIDTH="725" HEIGHT="251" hspace="5" vspace="5" BORDER=1> </p>
+      <p> <strong><font color="#FF0000"> WARNING:</font></strong><br>
+        <strong><font color="#FF0000"><img src="images/icons/warning_big.gif" width="20" height="20" hspace="5" vspace="5"></font></strong>Do not edit the main key file for your site once you have begun encrypting data. This may cause the loss of any existing data you have encrypted. You must follow the procedure for converting records as listed below: </p>
+      <p><strong>B.</strong> Click once on the edit button next to the new_(key file name) to access the Key File edit screen. When you click on the file name you will be sent to the key file contents editor. You may enter anything from a phrase to a random set of numbers and letters. The longer the phrase, the more secure your data will be. Inclusion of numbers and use of both upper and lower case characters will also make your phrase more difficult to guess.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_new_edit1.png" alt="Screen Shot" NAME="Graphic7" WIDTH=555 HEIGHT=112 hspace="5" vspace="5" BORDER=1></P>
+      <p> <strong>C.</strong> Once you have finished changing your key click on the save button. It will save the key and display it for your verification. If this is not what you wanted click on the restore button and the old contents will be brought back.</span></font> <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_new_saved.png" alt="Screen Shot" NAME="Graphic10" WIDTH=572 HEIGHT=122 hspace="5" vspace="5" BORDER=1></P>
+      <p><strong>D.</strong> Having placed the new key you should now go to the convert data screen to re-encrypt your data using this new key. If you do not use the Convert CC Data screen you may lose your existing CC data. This may be a permanent loss.</P>
+      <p><strong>E.</strong> Convert CC Data screen </P>
+      <p> <img src="includes/languages/english/help/encrypt/images/convert.png" alt="Scrren Shot" name="Graphic2" width="628" height="161" hspace="5" vspace="5" border=1></p>
+      <p><strong>1.</strong> If the new key file is empty, you will see the above screen, with warnings that there is no key and you need to add one.<br>
+        <img src="includes/languages/english/help/encrypt/images/convert_ok.png" width="337" height="23" hspace="5" vspace="5" border="1"></p>
+      <p><strong>2.</strong> The convert button will appear once you have added a new key phrase. As long as you see no red warning messages you are ready to proceed with conversion. If you do see a warning it is important that you resolve the problem before continuing.<br>
+        <img src="includes/languages/english/help/encrypt/images/convert_button.png" width="271" height="31" hspace="5" vspace="5" border="1"></p>
+      <p><strong>3.</strong> Click on the convert button. This will convert the existing cc data to the new key. The process converts the data by decrypting with the old key and encrypting with the new one. It continues by copying the &quot;Primary Key File&quot; to a back-up file and moving the &quot;New key file&quot; to the &quot;Primary Key File&quot;. That completes the process</span></font> </p>
+      </P>
+    </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page6.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page6.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page6.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: Tom O'Neill
+  Latest Contributor : $Author$
+  Revision : $Revision$
+
+*/
+
+?>
+
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> CRE CC Encryption Manager relies on services provided by the operating system to function. This is because various governments regulate the availability and usage of security technology including encryption. The test portion of CRE CC Encryption is intended to ensure that encryption algorithms and modes selected for use are available and functioning properly. It can also be used to identify other algorithms and modes that can be used by this program. We begin by displaying a table of available encryption methods and modes. <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/test1.png" NAME="graphics4" WIDTH="825" HEIGHT="140" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> The first part of the encryption service test is shown above, and lists the available methods and what modes are working on your web server. If you do not see a table similar to the one above then you do not have mcrypt installed or working correctly. <font face="Arial"><br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/test2.png" NAME="graphics4" WIDTH="274" HEIGHT="213" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>C.</strong> Then a partial list of the second part is shown above, it lists the length of the key that is allowed or required for a specific method. Currently this tool provides only some basic information. In future, it will be expanded to allow users to select an algorithm to fit their needs and even to allow switching algorithms as part of a carefully managed security system.      </p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7a.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7a.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7a.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>1.</strong> Encrypted data that is not encrypted:<BR>
+        The Update CC Data is used to convert non-encrypted data. You can encrypt one record at a time or all records that have not been encrypted.</p>
+      <p><strong>2.</strong> Go to Encryption/Decryption side box click on Update CC Data. A list of orders with credit card number will apear. There will be a green message if the data is encrypted and a red message if it is not. Only the cc number is checked. You can encrypt either a single record or all records in this list<br>
+        <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;a. Single record<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Click on the record not encrypted<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. In the right hand box you will see the encrypt button, Click on this and the record will be encrypted.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. You will be returned to the Order with cc numbers list. If ther are more records go to step 2 and repeat until there are not any more red messages.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4. You are now done if there are no more red messages<BR>
+        <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;b. All records <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Below the list of order with cc number you will see a button label Encrypt All. Click on this button.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. You are now done</p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7b.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7b.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7b.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><strong>A.</strong> Go to Encryption/Decryption side box click on Update CC Data . A list of orders with credit card number will apear. There will be a green message if the data is encrypted and a red message if it is not. Only the cc number is checked. You can decrypt either a single record or all records in this list<BR>
+        <BR>
+&nbsp;&nbsp;&nbsp;Single record<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;1. Click on the record not decrypted<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;2. In the right hand box you will see the decrypt button, Click on this and the record will be decrypted.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;3. You will be retuned to the Order with cc numbers list. If there are more records go to step 2 and repeat until ther are not more red messages.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;4. You are now done if there are no more red messages<BR>
+        <BR>
+&nbsp;&nbsp;All records <BR>
+&nbsp;&nbsp;&nbsp;1. Above the list of order with cc number you will see a button label decrypt . Click on this button.<br>
+&nbsp;&nbsp;&nbsp;2. You are now done</td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7c.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7c.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/encrypt_page7c.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><ul>
+      <li>  Go to the Encryption/Decryption side box and click on the Manage Keys selection.</li>
+      <li> Click on the file name in the row labeled &quot;New key file&quot; then click on edit.</li>
+      <li> Type in your new key.</li>
+      <li> Click on save.</li>
+      <li> In the Encryption/Decryption side box and click on Convert data. </li>
+      <li>If no red warning messages appear you may proceed.</li>
+      <li>Click on the convert button.</li>
+      <li> Finished</span></font>
+          </P>
+      </li>
+    </ul></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/cofigure_filename.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/cofigure_filename.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure1a.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure1a.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure3.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure_filename1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/configure_filename1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_button.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_button.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_nobutton.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_nobutton.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_not.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_not.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_ok.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/convert_ok.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/d_c_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/d_c_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/d_c_main_all.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/d_c_main_all.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/e_c_order.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/e_c_order.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/e_c_order1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/e_c_order1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/e_c_order_d_e.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/e_c_order_d_e.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/encrypt1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/encrypt1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/encrypt2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/encrypt2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/item_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/item_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_createt.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_createt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_edit.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_edit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_new_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_new_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_new_saved.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_new_saved.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_save.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_save.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_saved.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_saved.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/manage_key_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/order_edit.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/order_edit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/order_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/order_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/test1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/test1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/test2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/encrypt/images/test2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_basicexport.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_basicexport.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_basicexport.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export.png" border="0" ><br>
+
+ The Export Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is entended for backward compatibility with previous version of Easy Populate.
+This version has been reorginized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatable with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Select method to save export file</b>
+  </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_sel_loc.png" border="0" ><br><br>
+To export A file first select if you wish to download the file or save to your web server temp directory.
+
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Select field set to export</b>
+ </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_sel_feld.png" border="0" ><br><br>
+These are the same as in Easy populate 2.7X select from Complete, Model/Price/Qty, Model/Category, Attributes.
+When ready click the "Sart File Creation button"
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_basicimport.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_basicimport.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_basicimport.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,69 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_import.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is entended for backward compatibility with previous version of Easy Populate.
+This version has been reorginized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatable with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPB format. This is
+the products_model is the first column in the upload file. The file should have EPB as the first
+three characters in its file name or none at all.
+
+Click on the browse button to browse your local computer for the file to upload and insert.
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. Also
+EP usually will only imports 400 to 500 lines of products, this version can do 2,000 plus.
+If a file it to large to upload because of PHP restrictions the FTP the file to the site and use
+"Import Data from file in temp/"
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Although it may not be needed, EP basic upload and split is available. Use the browse button
+to browse you local files and select the ile for uploading.  It will be spilt into files
+limited by the configure setting $maxrecs as set in the epconfigure.php file.
+Each file name will be dated with the date the split was created.
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_epbasic.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_epbasic.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_epbasic.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epbasic.jpg" border="0" ><br>
+
+ EP Basic
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Easy Populate Basic</b>
+ </td>
+</tr>
+<tr>
+ <td>
+
+<br><b>Upload EP File for Import</b> <br>
+This feature allows the upload of a delimited file for import into the database. You can now import files which include HTML in the text fields without having the file mangled by EP or Excel.  But EP Basic will not install files unless the file name begins with EPB or EP.  Files beginning with EPA are intended for use with EasyPopulate Advanced.
+
+<br><b>Upload and Split a EP File</b> <br>
+This feature has the same improvements applied to the Import routines, but allows you to upload a large file and split it into smaller pieces.  This feature is helpful in avoiding interrupted imports due to communications timeouts or exceeding the servers script time limits.
+
+
+<br><b>Import Data from file in temp/</b> <br>
+This is now a drop down list of all the files located in the /temp directory. 
+
+<br><b>Create an export files</b> <br>
+A series of drop down boxes are used to allow you to :
+
+<br><b>Select method to save export file </b> <br>
+There are two selections here:<br>
+       Save to temp file on server<br>
+       Select fields to download<br>
+
+
+<br><b>Select fields to download </b> <br>
+This is the list of which download types to use. You will also notice that there is no V_products_id in the list. This is for backward compatibility of older files.
+
+By default the file types are are:
+Complete     (Attributes have been removed since there is a separate download for those.)
+Model/Price/Qty
+Model/Category
+Froogle
+Attributes
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_error.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_error.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_error.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+
+
+
+
+
+what the basic froogle feed sends:
+product_url    name    description   price   image_url   category    offer_id
+
+http://192.168.1.35/loaded6151/product_info.php?products_id=28  $25 Gift Certificate  Buy a Gift Certificate for your friends or family 26.38 http://192.168.1.35/loaded6151/images/giftcert-25-sm.gif   Gift Certificate 28
+
+
+froogle product url not set up For SEO urls
+http://192.168.1.35/loaded6151/product_info.php?products_id=20
+
+1. FTP open connection failed to
+The is no server listed in the configure file to connect to
+
+2. FTP connection has failed!
+Failed to connect to the froogle server.
+  wrong user or password entered into the configuration
+
+3. Attempted to connect to
+ An attempt to connect to the server failed If you have list a server, Froogle ftp could be down
+ or you have the wrong server listed inthe configuration.
+ 
+ 
+4. Couldn\'t change directory on
+
+5. Uploaded froogle.txt to hedwig.google.com as /testuser/froogle.txt
+
+The upload worked, Now go to froogle and log into your account and double check the feed.
+
+ 
+ 
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_export.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_export.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_export.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_start.png" border="0" ><br>
+
+ The Export Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPA</b>
+ </td>
+</tr>
+<tr>
+ <td>
+The changes here are in the handling of HTML content in descriptions; image path URL's,
+and EP import filename requirements. You may now import files with html in the text
+fields and not have it mangled by EP or Excel.  URL's for images in subdirectories
+can be handled and correctly written to the database.   Beginning with 2.75, EP
+Advanced will not install files unless it begins with EPA,and EP Basic will not
+install files that begin with EPA.  This feature is to protect the database from
+errors related to a new column added to the Easy populate file format.  EP Advanced
+uses the product_id column, this allow for more features to be added. EPA is will also allow
+you to refine your export file so you can target a specific group of records to edit
+ </td>
+ </tr>
+  <tr>
+ <td>
+<br><H3><b>1. Select method to save export file </b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_sel_export.png" border="0" ><br>
+  </td>
+</tr>
+<tr>
+ <td>
+To export select where you want the export file placed.
+</td>
+</tr>
+<tr>
+ <td>
+<br><H3><b>2. Select field set to export</b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_field_group.png" border="0" ><br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+Next select which group of feilds to export
+</td>
+</tr>
+  </td>
+ </tr>
+
+<tr>
+ <td>
+<br><H3><b>3.Select field for sort order </b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_sortorder.png" border="0" ><br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+Next select the sort order you want the rows to apear in the export file.
+</td>
+</tr>
+<tr>
+ <td>
+<br><H3><b>4.Limit number of products to Export </b></H3><br>
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+If you deal with large export files and find it diffcult to find products to edit. You
+can use the Limits to make you export files small and target specific groups of records.
+Not all export files can be limited by all meathods. Meathods can also be combined.
+</td>
+</tr>
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>a. Limit By Category </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_cat.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ If you have TOP showing in the drop down box all categories are looked at.
+ If you have a category showing in the drop down box, the that category and all sub categories will be in the list
+ The categories drop down is generated from your categories in the database
+</td>
+</tr>
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>b. Limit By Manufacture </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_man.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ If you have "Manufactures showing in the drop down box all manufactures are looked at.
+ You can select any manufacture to target just there products
+ The drop down list of manufacures is read from your manufacters.
+ </td>
+</tr>
+
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>c. Limit By Product Range </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_prodid.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ You can use Product Id's to limit your export file.
+<br>&nbsp;&nbsp;&nbsp;  1. If no product_id's are enter all of the product are in the export file
+<br>&nbsp;&nbsp;&nbsp;  2. If the begin product_id and no end product_id is entered. Products from the first product id to the end are in the export file
+<br>&nbsp;&nbsp;&nbsp;  3. If no beginning product_id's and only and ending product_ID. From the first id to ending the products are in the export file
+<br>&nbsp;&nbsp;&nbsp;  4. If the begin product_id and ending product_id is enter then this range of products are in the export file
+ </td>
+</tr>
+
+
+<tr>
+<td>
+<br>&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_feed_intro.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_feed_intro.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_feed_intro.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,110 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<font face="Arial"><span style="font-size:10pt;">
+<tr>
+ <td>
+</span></font><p align="center"><b><span style="font-size:10pt;"><font face="Arial">Data Feed Input/Output Introduction</font></span></b></p>
+<p>
+<font face="Arial"><span style="font-size:10pt;">&nbsp;<b> 1. Introduction:</b> Data feed service is
+based on Calvin K's data feed contribution. The basic functions were retained
+but the rest of the internal code was changed to follow OSC Style of coding.
+Along with the coding change an&nbsp;admin interface was introduced to manage
+the feed configuration. With these coding changed and the addition of a admin
+the process was split into 4 steps. Not all of the steps are required for each
+feed you do.</span></font></p>
+<p>
+<font face="Arial"><span style="font-size:10pt;">&nbsp; <b>2. Goals:</b><br>The typical store owner never needs to edit a code or define file directly.The store
+owner does not need a lot of support on how to use program. Combines the functions
+of moving data in and out of store is in one area. Make it flexible enough for
+small, medium and large store to use program effectively. Move program files closer
+to OSC/CRE Loaded standards for look and feel, and coding.<br><br>
+&nbsp; <b>3. Parts of Data Feed Service:</b><br>
+Froogle data feed : Calvin K<br>
+&nbsp;Salemaker for froogle feed: by Marcel van Lieshout<br>
+&nbsp;Admin for Data Feed : Tom O'Neill<br><br>
+&nbsp;&nbsp;&nbsp; d. For Data feeds setup up:<br>
+Step 1 <br>
+&nbsp;To set up this modules data feed service, Review the 7 steps to your first feed. It outlines
+what steps you need to take to do a feed. It will take you through the configuration process to the uploading and checking of the feed.<br>
+&nbsp;Step 2<br>The you will need to configure and run the data feeds this
+is described in the running doc/configureandrun.txt document The file field_spec.txt
+describes the limitation of what can be placed into each field<br><br>
+</span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+</td>
+</tr>
+<tr>
+  <td>
+
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">&nbsp;3. Error and status messages</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will appear near the top of the form, Blue background
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_mesg.png" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Import result</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now appear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Help while using the admin screens</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or input you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+ <br><br><b> 5. Features added and changes to basic programs.</b><br>
+&nbsp;Data Feed:<br>
+&nbsp;1. Added language files<br>
+&nbsp;2. Multiple configurations for multiple feed services now available through admin screen<br>
+&nbsp;3. Configuration configured in admin rather then edit a file.<br>
+&nbsp;4. Feed submission now A multiple step process.<br>
+&nbsp;5. Switched to tep functions for data base queries.<br>
+&nbsp;6. Split file generation and FTP code into two separate files.<br>
+&nbsp;7. Combined Froogle, Yahoo and Bizrite into one package (Not all installed and adapted yet)<br>
+&nbsp;8. added fields for advance feed to products database<br>
+&nbsp;9. added separate sql file for additional info for froogle feed<br>
+&nbsp;10. Builds Category strings before building feed file.<br>
+&nbsp;11. Help popups added to admin screens.<br>
+&nbsp;12. Added salemaker contribution pricing to price sent to price in feed.<br>
+&nbsp;13. Uses tax zone from store. <br>
+&nbsp;14. Add the fields froogle_type, upc, isbn, manufacturer_product_id to products table and
+products edit screen. (not completed in this version)<br>
+&nbsp;15. add froogle specific fields for books, music, video to a separate table.(not completed in this version)<br>&nbsp;
+</td>
+</tr></span></font>
+<tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_frooglebacisgettingstarted.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_frooglebacisgettingstarted.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_frooglebacisgettingstarted.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Getting started with Froogle
+
+There are 7 main steps to send your first Froogle feed</b><br>
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+<br>
+&nbsp;Step 1: Sign in to the Froogle Merchant Center
+Create or use an existing Google Account to enter the Froogle Merchant Center.
+
+You must go to
+<a href="https://www.google.com/froogle/merchants/welcome">https://www.google.com/froogle/merchants/welcome</a>
+
+From here there is a link to &quot; create an account now. &quot;
+
+You need to follow these pages and signup for a new account if you do not have one.<br>
+<br>
+&nbsp;Step 2: Create an FTP account
+:<br>Set up your FTP account, which you'll use to upload your feeds to us.
+Do this in your froogle merchant account
+
+<br><br> &nbsp;Step 3: Specify your feed's settings in the catalog admin:<br>
+Log into your stores admin and go to the  Data Input Output Systems box in the left hand
+column. From here you will see the feeds main screen. You can either click on the run bottom
+next to configure or click on the data configure in the left hand column.  These setting are
+transferred to the froogle admin in the cart
+
+<br><br> &nbsp;Step 4: Set Categories in the catalog admin:
+<br>Once you have setup the configuration you will need to return to the &quot;Data Feeds&quot; screen. Here
+you will need to build your categories for the feed. Since this is a intense process  it is a separate step.
+You need to do this once and then again only if you change your categories.
+It was done this way for larger stores to reduce processing time.
+<br><br>
+&nbsp;Step 5: Pre Feed Process in the catalog admin:
+<br>This set will Build the actual file for submission to Froogle. If this process take more then
+60 Second then you have a medium to large store or there is a problem. Compared the feed
+you built in the step to the sample one called /doc/sample_text.txt in the contribution.
+
+<br><br> &nbsp;Step 6: Submitting the feed in the catalog admin:
+<br>There are two methods to submit the feed to Froogle. The first is via direct FTP, this is where the FTP information you
+entered into the configuration is used and the feed file is sent directly to Froogle. Or you down load the feed
+and FTP from your local computer to froogle.
+<br><br>
+&nbsp;Step 7: Check your feed for errors:<br>
+Sign in to your Froogle Merchant Center account to check for any formatting errors in your feed.
+Log back into your merchant account at Froogle<br><br>.
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_froogleconfigure.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_froogleconfigure.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_froogleconfigure.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,103 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Configuring Froogle feed</b> </td>
+  </tr><br><br>
+<tr>
+ <td>
+<br>1. <b>List of Configurations</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_new_config.png" border="0" ><br>
+ You will start off by going to the list of configuration. This list all the data feed configurations
+for your store. If you have not done any configuration then there will be none in this list. You must have
+at least one configuration setup.<br>
+ To start a new configuration click on the new button under the list of configurations.
+<br>
+ </td>
+</tr>
+<tr>
+ <td>
+<br>2. <b>Configuration:</b> <br>
+
+ For a new configuration fill in all text boxes and check boxes of the check boxes except active.
+ The click on insert. Once the information has been inserted in to the database<br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ </td>
+</tr>
+<tr>
+
+ <td>
+<br>&nbsp;3.  Settings and what they mean:
+<br>&nbsp;&nbsp; a. Name of Feed
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the name of the feed
+as it will appear in the drop down boxes when data feed<br>&nbsp;&nbsp; b. Product Feed Type
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: Basic&nbsp;or
+Advance Only basic is available.&nbsp;<br>&nbsp;&nbsp; c. Data Feed Discription
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A short description of the feed
+configuration<br>&nbsp;&nbsp; d. Data Feed File Type
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: none,
+products, business. For this you should choose product as the business feed
+is not yet in this package.&nbsp;&nbsp;<br>&nbsp;&nbsp; e. Feed Service
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: Froogle, Yahoo
+&nbsp;Choose Froogle, as Yahoo feed service has not been added.<br>&nbsp;&nbsp; f.
+Status  Set <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings:&nbsp;Active  Inactive
+For a new feed do not change this, until after your first insert.
+<br>&nbsp;&nbsp; g. File name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the file name you chose
+when you did your set up at Froogle.<br>&nbsp;&nbsp; h. Image URL
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you use a image url other then the
+default one for CRE Loaded then enter it here from the /images directory<br>&nbsp;&nbsp; i.
+Froogle FTP information
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Froogle FTP Server Name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP server usually https://</span></font>hedwig.google.com<font face="Arial"><span style="font-size:10pt;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.   Froogle FTP User Name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP User Name&nbsp;you chose at froogle<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.    Froogle FTP Password<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP password you chose at froogle<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.   Froogle FTP Directory<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP Directory&nbsp;you chose at froogle<br>&nbsp;&nbsp; g. Froogle Advance Settings
+<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;1. Use store Currency <br>       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;possible
+setting: False: Use store default current,  True: Use currency listed below
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you
+choose false then the store currency will be used. if you choose true the enter
+a single currency below&nbsp;&nbsp;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;2. Other currency<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If above was
+True list a currency here&nbsp;currency<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;3.
+Convert Currency<br>      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible
+settings:False: Do not convert to currency  True: Convert currency
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is used
+if you wish to convert between currencies when a customer enters your store.<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;4.
+Use store language<br>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible
+settings: False: Use store default language  True: Use language selected below
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you choose
+false then the store language&nbsp;will be used. if you choose true the enter
+a single language&nbsp;below<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;5. Other language<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If above was True
+list a list language code here<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.&nbsp;Tax Class ID<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font>Enter the tax class ID number from the store or set to zero (0) for no tax calculation<font face="Arial"><span style="font-size:10pt;"><br></td>
+</tr>
+
+ <tr>
+ <td>
+<br>Once you have finished with the configuration and either Inserted or saved
+it the click on froogle again in the side box. This will take you to the main
+run screen.<br></td>
+</tr>
+
+ <tr>
+ <td><br>&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_froogleconfigure1.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_froogleconfigure1.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_froogleconfigure1.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_import.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is entended for backward compatibility with previous version of Easy Populate.
+This version has been reorginized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatable with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPB format. This is
+the products_model is the first column in the upload file. The file should have EPB as the first
+three characters in its file name or none at all.
+
+Click on the browse button to browse your local computer for the file to upload and insert.
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. Also
+EP usually will only imports 400 to 500 lines of products, this version can do 2,000 plus.
+If a file it to large to upload because of PHP restrictions the FTP the file to the site and use
+"Import Data from file in temp/"
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Although it may not be needed, EP basic upload and split is available. Use the browse button
+to browse you local files and select the ile for uploading.  It will be spilt into files
+limited by the configure setting $maxrecs as set in the epconfigure.php file.
+Each file name will be dated with the date the split was created.
+ </td>
+</tr>
+<tr>
+ <td>
+<b>List of Configurations</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_start.png" border="0" ><br>
+ You will start off by ging to the list of configuration. this list all the data feed configurations
+for your store. If yo have not done any configuration then there will benone in this list. You must have
+at least one configuration setup.<br>
+ To start a new configuration click on the new button under the list of configurations.
+<br>
+ </td>
+</tr>
+<tr>
+
+<tr>
+ <td>
+<b>Configuration:</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ For a new configuration fill in all text boxes and check ll of the check boxes except active.
+ The click on insert. Once the information has been inserted in to the database<br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ </td>
+</tr>
+<tr>
+
+ <td>
+<br>&nbsp; Add New Feed Setting
+<br>&nbsp;&nbsp; Name of Feed
+<br>&nbsp;&nbsp; Product Feed Type
+<br>&nbsp;&nbsp; Data Feed Discription
+<br>&nbsp;&nbsp; Data Feed File Type
+<br>&nbsp;&nbsp; Feed Service
+<br>&nbsp;&nbsp; Status   Set Active  Inactive
+<br>&nbsp;&nbsp; File name
+<br>&nbsp;&nbsp; Image URL
+<br>&nbsp;&nbsp; Froogle FTP information
+<br>&nbsp;&nbsp;&nbsp;&nbsp; Froogle FTP Server Name
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP User Name
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP Password
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP Directory
+<br>&nbsp;&nbsp; Froogle Advance Settings
+<br>&nbsp;&nbsp; Use store Currency         False: Use store default current  True: Use currency listed below
+<br>&nbsp;&nbsp; Other currency
+<br>&nbsp;&nbsp; Convert Currency       False: Do not convert to currency  True: Convert currency
+<br>&nbsp;&nbsp; Use store languge        False: Use store default language  True: Use language selected below
+<br>&nbsp;&nbsp; Other languge
+<br>&nbsp;&nbsp;Tax Class ID
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_frooglerun.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_frooglerun.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_frooglerun.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Run Froogle feed</b> </td>
+  </tr><br><br>
+<tr>
+ <td>
+<br><b>1. Main run screen</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_start.png" border="0" ><br>
+If you have not built at least one configuratin do so now.
+</td>
+</tr>
+<tr>
+ <td>
+<b>2. Configuration:</b> <br>
+ </span></font>Configure: &nbsp;Build or edit unique configuration click
+on the run button to add or edit feed configuration(s). You must have at least
+one feed<br>configuration<br><br>
+ </td>
+</tr>
+<tr>
+ <td>
+<b>3. </span></font>Set Categories:<br> </b>&nbsp;This process can be intense
+for medium to large stores. You should only run this before the first feed and
+if you change any categories. You do not need to run this proccess every time<font face="Arial"><span style="font-size:10pt;"><br>
+ <br></td>
+</tr>
+<tr>
+ <td>
+<b></span></font> 4.&nbsp;Pre Feed Process:<br></b> &nbsp;You will run this
+every time you do a feed. This step build the actual feed file for you. It is
+a good Idea for your month feed to run this before submitting.<font face="Arial"><span style="font-size:10pt;"><br><br><b>&nbsp;</b></td>
+</tr>
+<tr>
+ <td>
+</span></font><b> &nbsp;5. &nbsp;Submit Feed:</b><br>&nbsp;
+If you wish to  have the feed sent directly to the FTP server at Froogle you will
+run this step. You must have the Froogle FTP information entered into the
+configuration<br><br><font face="Arial"><span style="font-size:10pt;"><br></td>
+</tr>
+
+ <tr>
+ <td><br>&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_import.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_import.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_import.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,84 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_start.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPA</b>
+ </td>
+</tr>
+<tr>
+ <td>
+The changes here are in the handling of HTML content in descriptions; image path URL's,
+and EP import filename requirements. You may now import files with html in the text
+fields and not have it mangled by EP or Excel.  URL's for images in subdirectories
+can be handled and correctly written to the database.   Beginning with 2.75, EP
+Advanced will not install files unless it begins with EPA,and EP Basic will not
+install files that begin with EPA.  This feature is to protect the database from
+errors related to a new column added to the Easy populate file format.  EP Advanced
+uses the product_id column, this allow for more features to be added.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPA format. This is
+the products_id is the first column in the upload file. The file should have EPA as the first
+three characters in its file name. If it does not then most likely you should use EP basic to import the file.
+<br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_uploaded_insert.png" border="0" ><br><br>
+
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. EPA will import
+more then 2,000 rows in one file, unlike older version that were limited to 300 to 400 maximum. If the IFle is large then
+the limit set by PHP then you must upload the file via FTP then use the "Import Data from file in temp/' to import the data.
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+This routine incorporates the same changes noted above for import files.  If for some reason
+you need to split you upload file into smaller parts then you can use this feature. Most site should
+not need to split files any more.
+ </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_uploaded_results.png" border="0" ><br><br>
+
+ The upload results now apear below the insert screen.<br><br>
+
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_delete.png" border="0" ><br><br>
+ Since you now can delete records the message will apear as above when a recored is deleted.<br>
+
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_intro.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_intro.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_intro.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,195 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<font face="Arial"><span style="font-size:10pt;"><tr>
+ <td>
+</span></font><p align="center"><b><span style="font-size:10pt;"><font face="Arial">Data Feed Input/Output Introduction</font></span></b></p>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;<b> 1. Introduction:</b> Data feed service is a collection of contributions to allow you to updated
+your products and categories data remotely, and send that data to data listing
+services. It uses a number of contributions that have been modified to work
+better with small, medium, and large stores. </span></font></p>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp; <b>2. Goals:</b><br>The typical store owner never needs to edit a code or define file directly.The store
+owner does not need a lot of support on how to use program.Combines the functions
+of moving data in and out of store is in one area. Make it flexable enough for
+small, medium and large store to use program effectivly. Move program files closer
+to OSC/Cre Loaded standerds for look and feel, and codeing.<br><br>
+&nbsp; <b>3. Parts of Data Feed Service:</b><br>
+Easy Populate Advance enhanced by Tom O'Neill<br>
+Easy Populate Basic enhanced by Tom O'Neill<br>
+Froogle data feed : Calvin K<br>
+&nbsp;Salemaker for froogle feed: by Marcel van Lieshout<br>
+&nbsp;Admin for Data Feed : Tom O'Neill<br><br>
+&nbsp;&nbsp;a. Easy Populate: This is used to update product and category data, it allows
+you to updated data remotely on your&nbsp;local computer and upload to the data
+to your on line store.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;1. Easy Populate Advance<br>
+&nbsp;&nbsp;&nbsp;&nbsp;Easy Populate Advance
+uses products_id instead of products_model to tie the rows in the Import/Export
+file to your database. This is significate since you now can delete items, asigning
+products to multiple categories, refine export files to select records you need
+to edit/update There also has been asignificant speed and record handling capibilities
+added to both Advance and Basic version. The numbers below are from recent test
+done, previously Easy populate could only handle 300 to 400 records max.
+
+<br>
+&nbsp;&nbsp;&nbsp; 2. Easy Populate Basic<br>
+ Easy Populate basuc is for back ward compatiblity with  EP 2.XX version of Easy populate.
+This is because EP used modle numbers to tie you file  back to the database. Where in the advance
+version it used product_id.<br>
+
+&nbsp;&nbsp;&nbsp;3. Increase in speed and record handling<br></span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;&nbsp;&nbsp;&nbsp;  a. Using only stock products<br>
+export EPB ~ 32 records 0.173231 seconds file size 26kb<br>
+import EPB ~32 records 1.844497 seconds file size 26kb<br>
+export EPA~ 32 records 0.790210 seconds file size 26kb<br>
+import EPA~ 32 records 1.759426 seconds file size 26kb<br>
+&nbsp;&nbsp;&nbsp;&nbsp;  b. Using 2033 products in a single file<br>
+import EPA 89.927511 second &nbsp;or 1 minute 30 sec file size 2.800 KB<br>
+import EPB 456.582260 second &nbsp;or 7 minutes and 36 sec file size 3,423 KB<br>
+&nbsp;&nbsp;&nbsp;&nbsp;  c. Deleting products:2033 products added<br>
+delete EPA 68.877599 seconds File size was 2,875 KB<br>
+EPB cannot delete records.&nbsp;<br><br>
+&nbsp;b. Data feed:<br>
+&nbsp;&nbsp;Data feed takes the data with in your catalog and prepares it for submission to a feed &nbsp;service and send it to the feed
+service either automaticly or manualy if you need on completion&nbsp;of building the feed.<br>&nbsp;<br>
+&nbsp;c. For EP set up:<br><br>
+&nbsp;&nbsp; The setup information for Easy Populate is stored in admin/epconfigure.php. This
+configuration is for both Easy Populate Basic and Easy Populate Advance. <br><br>
+&nbsp; d. For Data feeds setp up:<br>
+Step 1 <br>
+&nbsp;To set up this modules data feed service, Review the 7 steps to your first feed. It outlines
+what steps you need to take to do a feed. It will take you through the configuration process to the uploading and checking of the feed.<br>
+&nbsp;Step 2<br>The you will need to configure and run the data feeds this
+is described in the running doc/configureandrun.txt document The file feild_spec.txt
+describes the limitation of what can be placed into each felid<br><br>
+</span></font></p>
+ <font face="Arial"><span style="font-size:10pt;"> </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">
+ &nbsp;3. Error and staus messages</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will apear near the top of the for, Blue background
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_mesg.png" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Import result</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now apear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Help while using the admin screens</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or imput you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+<tr>
+ <td><br><br><b> 5. Features added and changes to basic programs.</b><br> &nbsp;&nbsp;<br>&nbsp;Easy
+populate 2.75 Advance to 3.01:<br>
+&nbsp;&nbsp;&nbsp;1. Removed the froogle feed from this
+contribution. The froogle function is now &nbsp;handled by seperate code files.<br>
+&nbsp;&nbsp;&nbsp;2. Moved EP from catalog side box to Data Input/Output System side box.<br>
+&nbsp;&nbsp;&nbsp;3. Moved function file to admin/includes/function directory to follow OSC standerds.<br>&nbsp;&nbsp;&nbsp;4.
+Moved most simple function to function file, export now has all functions removed
+. There is now only one function left in the EPA import file. <br>
+&nbsp;&nbsp;&nbsp;5. Redid admin screens so it was more like the rest of the OSC admin. .<br>
+&nbsp;&nbsp;&nbsp;6. Inserted tep form function rather then html form function. <br>&nbsp;&nbsp;&nbsp;7. Added
+popup help for informtion on how to use EPA.<br>
+&nbsp;&nbsp;&nbsp;8. Easy Populate Basic is for backward compatibility with older versions of EP<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EP advance will import all EPA files of previous version of EPA. <br>
+&nbsp;&nbsp;&nbsp;9. Export screen and Import screen seperated into two seperate files<br>
+&nbsp;&nbsp;&nbsp;10. Side box changed, so that sub titles are offset.<br>
+&nbsp;&nbsp;&nbsp;11. Added date time to split so each group of splits will be unique and old splits will &nbsp;not be
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>
+&nbsp;&nbsp;&nbsp;12. Program message, error, and output were place in one of three variable so they
+could be outputed&nbsp;with in the html output section of the files.<br> <br>Easy
+Populate Basic 2.75 Basic to 3.01:</span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;&nbsp;&nbsp;1. Easy Populate Basic is for backward compatibility with older versions of EP<br>
+&nbsp;&nbsp;&nbsp;2. Added date time to split so each group of splits will be unique and old splits will&nbsp;not be
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>
+&nbsp;&nbsp;&nbsp;3. Program message, error, and output were place in one of three variable so they
+could be outputed&nbsp;with in the html output section of the files.<br>
+&nbsp;&nbsp;&nbsp;4. Removed the froogle feed from this contribution. The froogle function is now &nbsp;handled by seperate code files.<br>&nbsp;&nbsp;&nbsp;5.
+Moved EP from catalog side box to Data export/import side box.<br>
+&nbsp;&nbsp;&nbsp;6. Moved function file to admin/includes/function directory to follow OSC standerds.<br>
+&nbsp;&nbsp;&nbsp;7. Moved most simple function to function file, export now has all functions removed .. <br>
+&nbsp;&nbsp;&nbsp;8. Redid admin screens so it was more like the rest of the catalog. and EPA<br>
+&nbsp;&nbsp;&nbsp;9. Inserted tep form function rather then html form function (Inprogress)<br>
+&nbsp;&nbsp;&nbsp;10. Added popup help for informtion on how to use EPB.<br><br>&nbsp;Items
+fixed or enhanced from Ep 2.74 to 2.75 Advance:<br>
+&nbsp;1. To add products the product id should be set to 0, there can be many 0's for product ID's.<br>
+&nbsp;2. You no longer need to change the manufacturers table to change a manufacturers_id
+first&nbsp;manf id to 1 or 0<br>
+&nbsp;3. No longer adds a empty product, caused by not treating the last line as not product.<br>
+&nbsp;4. Added EP Basic, It cannot install any EP Advanced files since they start with EPA a error<br>
+&nbsp;&nbsp;&nbsp;&nbsp;message
+will be displayed. It can install any file that strts wil EPB or older EP files<br>
+&nbsp;5. EP Advanced set up so it can only read files that start with EPA , prevents
+reading older files.<br>
+&nbsp;6. Delete has been added back into EP for products
+only. &nbsp;This is implemented via a new column call v_action. You must type
+the word &quot;delete&quot; in this column to delete a product.<br>
+&nbsp;7. EP basic was not showing on some site this was to an error in the install of
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>
+&nbsp;8. You can add your own product ID, If your product ID's are based on a system
+other than&nbsp;numbers generated by the shopping cart and autoincremented by
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows
+for compatibility with some external inventory management systems.<br>&nbsp;
+9. moved configuration of EP to a seperate file called epconfigure.php <br><br>
+&nbsp;Data Feed:<br>
+&nbsp;1. Added language files<br>
+&nbsp;2. Multiple configurations for multiple feed services now available through admin screen<br>
+&nbsp;3. Configuration configured in admin rather then edit a file.<br>
+&nbsp;4. Feed submission now A multiple step process.<br>
+&nbsp;5. Switched to tep functions for data base queries.<br>
+&nbsp;6. Split file generation and FTP code into two separate files.<br>
+&nbsp;7. Combined Froogle, Yahoo and Bizrite into one package (Not all installed and adapted yet)<br>
+&nbsp;8. added fields for advance feed to products database<br>
+&nbsp;9. added separate sql file for additional info for froogle feed<br>
+&nbsp;10. Builds Category strings before building feed file.<br>
+&nbsp;11. Help popups added to admin screens.<br>
+&nbsp;12. Added salemaker contribution pricing to price sent to price in feed.<br>
+&nbsp;13. Uses tax zone from store. <br>
+&nbsp;14. Add the feilds froogle_type, upc, isbn, manufacturer_product_id to products table and
+products edit screen.<br>&nbsp;
+15. add froogle specific feilds for books, music, video to a seperate table.<br>&nbsp;
+</td>
+</tr></span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+?>
+<tr>
+ <td>
+<p align="center"><b><span style="font-size:16pt;">Data Feed Input/Output Introduction</span></b></p>
+<p>Data feed service is a collection of contributions to allow you to updated 
+your products and categorys data remotely, and send that data to data listing 
+services. It used a number of contributions that have been modified to work 
+with small, medium, and large stores. </p>
+<p>Contributions:<br>Easy Populate Advance by Tom O'Neill<br>Easy Populate Basic<br>Froogle 
+data feed : Calvin K<br> &nbsp;&nbsp;&nbsp;Salemaker for froogle feed: by<br> 
+&nbsp;&nbsp;&nbsp;Admin for Froogle Data Feed : Tom O'Neill<br><br> Goals:<br>The 
+typical store owner never needs to edit a code or define file directly.The store 
+owner does not need a lot of support on how to use program.Combines the functions 
+of moving data in and out of store is in one are.Make it flexable enough for 
+small, medium and large store to use program effectivly.Move program files closer 
+to OSC/Cre Loaded standerds for look and feel, and codeing.<br><br>Parts of 
+Data Feed Service:<br>&nbsp;Easy Populate: This is used to update data it allows 
+you to updated data remotely on your&nbsp;local computer and upload to the data 
+to your on line store. It allows you to&nbsp;&nbsp;build custom queries for 
+the data then download the information to your local computer&nbsp;&nbsp;for 
+editing, Then upload back to your &nbsp;on-line store.</p>
+<p>&nbsp;Data feed:<br>&nbsp;&nbsp;Data feed takes the data with in your catalog 
+and prepares it for submission to a feed &nbsp;service and send it to the feed 
+service either automaticly or manualy if you need on completion&nbsp;of building 
+the feed.<br>&nbsp;Features added and changes to basic programs.<br> &nbsp;&nbsp;&nbsp;Easy 
+populate 2.75 Advance to 2.78:<br>&nbsp;1. Removed the froogle feed from this 
+contribution. The froogle function is now &nbsp;handled by seperate code files.<br>&nbsp;2. 
+Moved EP from catalog side box to Data export/import side box.<br>&nbsp;3. Moved 
+function file to admin/includes/function directory to follow OSC standerds.<br>&nbsp;4. 
+Moved most simple function to function file, export now has all functions removed 
+. There is now only one function left in the EPA import file. <br>&nbsp;5. Redid 
+admin screens so it was more like the rest of the catalog.<br>&nbsp;6. Inserted 
+tep form function rather then html form function (Inprogress)<br>&nbsp;7. Added 
+popup help for informtion on how to use EPA.<br>&nbsp;8. Easy Populate Basic 
+is for backward compatibility with older versions of EP<br>&nbsp;&nbsp;&nbsp;&nbsp;EP 
+advance will import all EPA files of previous version of EPA. <br>&nbsp;9. Export 
+screen and Import screen seperated into two seperate files<br>&nbsp;10. Side 
+box changed, so that sub titles are offset.<br>&nbsp;11. Added date time to 
+split so each group of splits will be unique and old splits will&nbsp;not be 
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>&nbsp;12. 
+Program message, error, and output were place in one of three variable so they 
+could be outputed&nbsp;with in the html output section of the files.<br> &nbsp;&nbsp;<br>&nbsp;Items 
+fixed or enhanced from Ep 2.74 to 2.75 Advance:<br>&nbsp;1. To add products 
+the product id should be set to 0, there can be many 0's for product ID's.<br>&nbsp;2. 
+You no longer need to change the manufacturers table to change a manufacturers_id 
+first&nbsp;manf id to 1 or 0<br>&nbsp;3. No longer adds a empty product, caused 
+by not treating the last line as not product.<br>&nbsp;4. Added EP Basic, It 
+cannot install any EP Advanced files since they start with EPA a error<br>&nbsp;&nbsp;&nbsp;&nbsp;message 
+will be displayed. It can install any file that strts wil EPB or older EP files<br>&nbsp;5. 
+EP Advanced set up so it can only read files that start with EPA , prevents 
+reading older files.<br>&nbsp;6. Delete has been added back into EP for products 
+only. &nbsp;This is implemented via a new column call v_action. You must type 
+the word &quot;delete&quot; in this column to delete a product.<br>&nbsp;7. 
+EP basic was not showing on some site this was to an error in the install of 
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>&nbsp;8. 
+You can add your own product ID, If your product ID's are based on a system 
+other than&nbsp;numbers generated by the shopping cart and autoincremented by 
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows 
+for compatibility with some external inventory management systems.<br>&nbsp;9. 
+moved configuration of EP to a seperate file called epconfigure.php <br><br>&nbsp;Data 
+Feed:<br>&nbsp;1. Added language files<br>&nbsp;2. Multiple configurations for 
+multiple feed services now available through admin screen<br>&nbsp;3. Configuration 
+configured in admin rather then edit a file.<br>&nbsp;4. Feed submission now 
+A multiple step process.<br>&nbsp;5. Switched to tep functions for data base 
+queries.<br>&nbsp;6. Split file generation and FTP code into two separate files.<br>&nbsp;7. 
+Combined Froogle, Yahoo and Bizrite into one package (Not all installed and 
+adapted yet)<br>&nbsp;8. added fields for advance feed to products database<br>&nbsp;9. 
+added separate sql file for additional info for froogle feed<br>&nbsp;10. Builds 
+Category strings before building feed file.<br>&nbsp;11. Help popups added to 
+admin screens.<br>&nbsp;12. Added salemaker contribution pricing to price sent 
+to price in feed.<br>&nbsp;13. Uses tax zone from store. <br>&nbsp;14. Add the 
+feilds froogle_type, upc, isbn, manufacturer_product_id to products table and 
+products edit screen.<br>&nbsp;15. add froogle specific feilds for books, music, 
+video to a seperate table.<br><br>&nbsp;For EP set up:<br>&nbsp;For Data feeds 
+setp up:<br>Step 1 <br>&nbsp;To set up this modules data feed service, you must 
+first register with the feed services you wish to use.&nbsp;This is described 
+in the getting started document. It has links to the feed services &nbsp;and 
+what you need to set up the configuration of each service.<br>Step 2<br>Next 
+you need to install this contribution this is disturbed in the doc/install.txt 
+files<br>Step 3<br>The you will need to configure and run the data feeds this 
+is described in the running doc/configureandrun.txt document The file feild_spec.txt 
+describes the limitation of what can be placed into each felid<br><br>&nbsp;Known 
+bugs:<br>&nbsp;&nbsp;1. PHP 5 compatability for import. the problem is either 
+how globals are treated or&nbsp;&nbsp;how arrays are used in this contribution<br></p>
+ </td>
+</tr> 
+<tr>
+  <td>
+ <b>Error and staus messages</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will apear near the top of the for, Blue background 
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_msg.gif" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ <b>Import result</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now apear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ <b>Help while using the admin screens</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or imput you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
+

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_spreadsheet.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_spreadsheet.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/data_spreadsheet.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,91 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+?>
+<tr>
+ <td>
+
+
+<b>How to do specific task with the files in Easy Populate Advance:</b><br><br>
+<br>
+&nbsp;&nbsp;1. Adding new products:<br>
+&nbsp;&nbsp;&nbsp;  a. To add products the product id should be 0, there can be many 0's for product ID's 
+  as needed. The code will detect the 0 as a new product and auto increment the 
+  products_id.
+  <br>
+
+&nbsp;&nbsp;&nbsp;  b. If the products_id number is left blank then the product is not added. You can also 
+  insert you own product ID. they do not have to be sequncial. <br>
+
+&nbsp;&nbsp;&nbsp;  c. If you need to specify your own unique products_ID, and it does not exist in the data
+  base it will be added as a new product. Make sure you add the correct categories, 
+  other wise you will need to use the move product to a new category procedure.
+<br>
+Example:
+<br>
+I have a previous inventory software that has already assigned product ID's they are
+<br>
+12001
+15001
+14
+2000
+<br>
+These can be used by simply putting the in the v-product_id column.
+<br><br>
+&nbsp;&nbsp;2. Adding linked products (Yes Version 3.01 can handle linked products):
+A linked product is having one product record set, but having it show in multiple 
+categories.
+<br>
+&nbsp;&nbsp;&nbsp;  a. For a product you want to link to another category 
+Create a download using complete or model/category in the  Select fields to download
+you can limit the list by using the filter settings.
+<br>
+&nbsp;&nbsp;&nbsp;  b. Import into the spead sheet program.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 1. Copy the original product line to a new line<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 2. Change only category information where you want the product linked to.
+    Leaving the v_product_id unchanged.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 3. Save the file and re upload<br>
+<br><br>
+&nbsp;&nbsp;3.Deleting products (This has been added back for products only):
+<br>&nbsp;&nbsp;&nbsp;  a. Single product not linked
+<br>
+&nbsp;&nbsp;&nbsp;  Download any of the files that has a products_id's. You will notice a column called v_action
+all the way to the left. In this column add delete for each product you which to delete.
+<br>
+&nbsp;&nbsp;&nbsp;  b. Deleting linked product:
+ Do a download that has all of the links for the product 
+cut the paste th item you which do remove in front of the product links to remain.
+In the v_action column enter delete for the link you want to remove.
+<br>
+Note: the deleted item must be listed first. The product to remain must be list after the
+product link you are deleting.
+<br><br>
+&nbsp;&nbsp;4. Moving a product between two categories
+  In the spread sheet program
+<br>&nbsp;&nbsp;&nbsp;   1. copy the line for the product to a new line
+<br>&nbsp;&nbsp;&nbsp;   2. on the original line type in delete in the v_action column
+<br>&nbsp;&nbsp;&nbsp;   3. on the new line change the categories
+<br>
+&nbsp;&nbsp;4. Removing columns in the spread sheet.
+Due to how Ep was designed you do not need all of the column from the export file to be present
+in the import file.
+<br>&nbsp;&nbsp;&nbsp;   1. Minmum columns:
+<br>&nbsp;&nbsp;&nbsp   products_id, v_status, v_action, EOREOR
+ If you have prodcut information: any or all by products_id can be removed
+<br>&nbsp;&nbsp;&nbsp   If you have mete tags or header tags installed make sure you leave the set together  If you have prodcut information: any or all by products_id can be removed
+<br>&nbsp;&nbsp;&nbsp If you have category information: any or all of the unused category_ columns. 
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_export_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_export_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_field_group.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_field_group.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_add.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_add.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_delete.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_delete.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_split.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_split.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_uploaded_insert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_uploaded_insert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_uploaded_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_import_uploaded_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_limit_cat.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_limit_cat.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_limit_man.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_limit_man.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_limit_prodid.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_limit_prodid.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_sel_export.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_sel_export.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_sortorder.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_sortorder.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epa_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export_mesg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export_mesg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export_sel_feld.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export_sel_feld.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export_sel_loc.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_export_sel_loc.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_import.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_import.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_import_mesg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_import_mesg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_import_select.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/epb_import_select.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_config.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_config.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_config1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_config1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_new_config.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_new_config.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/feed_froogle_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_catbuild.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_catbuild.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_catbuilddone.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_catbuilddone.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_feedbuilddone.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_feedbuilddone.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_feedsend_error1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/froogle_feedsend_error1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/import_results.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/import_results.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/item_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/ep/images/item_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_edit_file.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_edit_file.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_edit_restore.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_edit_restore.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_list.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_list.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_search_t_before.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_search_t_before.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_search_t_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_search_t_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_searcht.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_file_searcht.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_select_lng.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_select_lng.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_dir.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_dir.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_file.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_file.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_insert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_insert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_lngr.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_lngr.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_lngr_grem.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/images/lng_selt_lngr_grem.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)<br><br>
+
+&nbsp;&nbsp;<b>Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<!-- Begin help search index1.html-->
+
+&nbsp;&nbsp;<b>Edit Help Page Index:</b><br>
+<UL>
+<LI><A HREF="#HOW">How Search Works</A></LI>
+<LI><A HREF="#SEARCH_FILE">Searching for a file name</a></LI>
+<LI><A HREF="#SEARCH_DEFINE">Searching for text within a file.</A></LI>
+</UL>
+<H3><A NAME="HOW">How Search Works</H3></a><br>
+&nbsp;&nbsp; You can search one of two ways depending on wich edit screen you are on.
+you can search for file names of test within the Languages define file. Search
+will detect which screen you are on either the a directory/file screen, or a Language Define Edit Screen.
+It will switch the between file and define search logic automaticly for you. <br>
+
+<H3><A NAME="SEARCH_FILE">Where Are the define located</H3></a><br>
+
+&nbsp;&nbsp;1. includes\languages  ~   In this directory all of the base define files reside. a base define file is common to more then one group of output screen.
+<br>&nbsp;&nbsp;2. includes\languages\(Langauge Name) ~ this is where the bulk of the language defines reside
+<br>&nbsp;&nbsp;3. includes\languages\(Langauge Name)\images ~  Unique images the are language dependent. Except for buttons
+<br>&nbsp;&nbsp;4. includes\languages\(Langauge Name)\modules ~ Specific to file that are in the includes/modules directory
+<br>&nbsp;&nbsp;5. includes\languages\(Langauge Name)\modules\order_total ~ Specific to file that are in the includes/modules/order_total directory
+<br>&nbsp;&nbsp;6. includes\languages\(Langauge Name)\modules\payment ~ Specific to file that are in the includes/modules/payment directory
+<br>&nbsp;&nbsp;7. includes\languages\(Langauge Name)\modules\shipping~ Specific to file that are in the includes/modules/shipping directory
+<br>
+
+<br>&nbsp;&nbsp;8. Language file not adressed by language editor.
+<br>&nbsp;&nbsp;includes\modules\payment\paypal\languages\english\ipn.lng.php
+<br>&nbsp;&nbsp;includes\modules\payment\paypal\languages\english.php
+<br>&nbsp;&nbsp;All language file in admin
+<br>
+<H3><A NAME="SEARCH_FILE">Searching for a file name</H3></a><br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to Tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_edit_file.png" border="0" >
+
+<H3><A NAME="SEARCH_DEFINE">Searching for text within a file</H3></a><br>
+While you are in edit mode you can search for Define Display text but not the label.
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Enter the text in search box<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Click the search button<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. This will bring up a list of defines<br>
+
+Below is an example of before and after, this is more usfull for some of the larger define files.<br>
+
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_file_search_t_before.png" border="0" >
+<br>&nbsp;&nbsp; <b>Before  search </b><br>
+
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_file_search_t_results.png" border="0" >
+<br>&nbsp;&nbsp;<b> After  search </b><br>
+<!-- End help searh index1.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<!-- Begin help edit index.html-->
+&nbsp;&nbsp;<b>Search Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_edit_file.png" border="0" >
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Once you have navigated to the correct file to edit you then can edit the language defines.
+The intial edit screen is show above.</P>
+
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+
+<H3><A NAME="Edit">Editing Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Type in the new text<br>
+&nbsp;&nbsp; 2. Click on save next to the input box you just type in<br>
+&nbsp;&nbsp; 3. Double check your changes by viewing them in the cart.<br>
+&nbsp;&nbsp; 4. If they did not work or are incorrect, you can restore the previous text if change again in the editor<br>
+
+&nbsp; Note: you can only sabe changes for one input box at a time.<br>
+<H3><A NAME="RESTORE">Restoring Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Once you have saved the define your changes you can double check that it is correct. <br>
+&nbsp;&nbsp; 2. If it is not then you can click on the restore button to revert back to the previous langauge define.<br>
+
+
+<H3><A NAME="RESTORE">Restoring Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 2. Single qoute with variable : Advanced Search's <br>
+&nbsp;&nbsp; 3. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 4. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 5. Double qoutes: <br>
+
+
+
+<!-- End help edit index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<!-- Begin help index4.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Once you have finished editing a define, click on the save next to the define. This will
+save the edit you made. You will return to the define edit screen so you can check you changes if for some reason it is not
+correct you can click on the restore and this will revert the file back to what it was before the save.
+</P>
+<P>
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Saving a new define.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<!-- End help index4.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/et/index5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/authnet_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/authnet_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/authnet_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<?php
+/*
+  $Id: invoice.php,v 1.2 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"><html <?php echo HTML_PARAMS; ?>>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title>Authorize.net Consolidated CRE Help Screen</title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="admin/includes/general.js"></script>
+</head>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+
+
+     <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading">Authorize.net Consolidated CRE Edition</td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+       <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+         <td class="main">
+
+<div align="center"><h2>Configuration Help Screen</h2></div>
+</td>
+</tr>
+<tr>
+ <td align="center">
+<a href=" https://freecreditcardprocessing.com/applynow/online_application.asp?code=chainreaction"> <h2>Link to Apply for Authorize.net account</h2></a><br>
+(support the CRE project by using our authorize.net partner)
+</td>
+</tr>
+<tr>
+<td>
+<hr align="center" size="4" width="450">
+</td>
+</tr>
+<tr>
+<td>
+User your browser back button to return to the Authorize.net edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Authorize.net testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Authorize.net Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Authorize.net User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Authorize.net Consolidated uses the AIM method of
+connecting to Authorize.net.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Authorize.net gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don't know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Authorize.net Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Authorize.net Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>
+<hr align="center" size="4" width="450">
+  </tr>
+        </td></table>
+          </tr>
+         </td>
+
+   </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal/Help_Config.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal/Help_Config.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal/Help_Config.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: Help_Config.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td>
+  <H3><b> Paypal Setup </h3> </b><br>
+   Please use your browsers back button to return.    
+    </td>
+  </tr>
+  <tr>
+    <td class="pptext">The following is a guide towards configuring your store's PayPal payment module settings:</td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">Enable PayPal Module</b><br>Since you have just done the installation, by default it will say yes.</li><br>
+      <li><b class="ppem380">E-Mail Address</b><br>Enter your Primary PayPal email address here, if you have more than one email address registered with PayPal then you must login your PayPal account to determine which one is your <b>Primary</b> email address.</li><br>
+      <li><b class="ppem380">Business ID</b><br>If you have configured a secondary email address to be your Business ID (email address) in your PayPal profile account, then enter this here, otherwise enter the one used above.</li><br>
+      <li><b class="ppem380">Transaction Currency</b><br>Choose which currencies you want to accept PayPal payments with.</li><br>
+      <li><b class="ppem380">Payment Zone</b><br>If a zone is selected, only enable this payment method for that zone.</li><br>
+      <li><b class="ppem380">Set <b>Pending Notification</b> Order Status</b><br>Set the Pending Notification status of orders made with this payment module to this value, '<b style="color:blue">Pending</b>' is suggested or alternatively the optional order status created in step 4 above.</li><br>
+      <li><b class="ppem380">Set <b>Order</b> Status</b><br>Set the status of orders made with this payment module to this value <b style="color:red">Do not set it to 'default' but specifically choose the status required</b>, '<b style="color:blue">Processing</b>' is suggested.</li><br>
+      <li><b class="ppem380">Set <b>On Hold Order</b> Status</b><br>This order status is used when the Cart Test has failed, eg. the expected payment amount did not match.</li><br>
+      <li><b class="ppem380">Set <b>Canceled Order</b> Status</b><br>Refunded, Reversed, Failed or Denied payments will be set to this order status.</li><br>
+      <li><b class="ppem380">Synchronize Invoice</b><br>Specify whether the osCommerce order number should be used as a <b>unique</b> PayPal invoice number, similiar to PayPal's Send Money feature, this will enable customers to resume an order via their osCommerce account history info page for that order for pending transactions which were not previously completed.</li><br>
+      <li><b class="ppem380">Sort order of display</b><br>Sort order of display. Lowest is displayed first.</li><br>
+      <li><b class="ppem380">Background Color</b><br>Select the background color of PayPal's payment pages, either black or white.</li><br>
+      <li><b class="ppem380">Processing logo</b><br>Specify the image file name to be used in the store's checkout process splash page, must be located in <code>catalog/images</code> directory.</li><br>
+      <li><b class="ppem380">Store logo</b><br>Specify the image file name for PayPal to display on their payment pages pages, must be located in <code>catalog/images</code> directory. If you do not have SSL then leave this field blank.</li><br>
+      <li><b class="ppem380">PayPal Page Style Name</b><br>Specify the name of the page style you have configured in your PayPal account profile.</li><br>
+      <li><b class="ppem380">Include a note with payment</b><br>When a customer arrives at the PayPal payment page you can choose whether or not to show them another note field which will have seperate contents from that of the one provided in your store's checkout process but will be included in PayPal's invoice and receipt.<br>To change the title appearing above this field on the PayPal payment page look in the corresponding catalog langauge file (<code>catalog/includes/langauges/english/modules/payment/paypal.php</code>).</li><br>
+      <li><b class="ppem380">Shopping Cart Method</b><br>Choose which type of PayPal Shopping Cart you want to use, Aggregate simply means the total amount is passed (with a list of the products shown in a single item field), whereas an Itemized Cart will list indivudally all the items the customer has selected in their PayPal invoice.</li><br>
+      <li><b class="ppem380">Enable PayPal Shipping Address</b><br>Allow the customer to choose their own PayPal shipping address. 
+      (See FAQ's for more info)</li><br>
+      <li><b class="ppem380">Digest Key</b><br>Specify a unique digest key, this will then be used similiar to a password while testing via the IPN Test Panel <b>and</b> also the store's PayPal transaction signature digest key.</li><br>
+      <li><b class="ppem380">Test Mode</b><br>This should be off for live environments.<br>You can simulate your own IPNs via the
+      <a href="<?php 
+      //echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>">
+      IPN Test Panel</a>.</li><br>
+      <li><b class="ppem380">Cart Test</b><br>This test verifies that the amount received via PayPal matches to what is expected 
+      (See FAQ's for more info).</li><br>
+      <li><b class="ppem380">Debug Email Notifications</b><br>Choose whether you want to receive debug emails.</li><br>
+      <li><b class="ppem380">Debug Email Notification Address</b><br>Enter a seperate email address where you wish to receive <b>debug</b> emails.</li><br>
+      <li><b class="ppem380">PayPal Domain</b><br>This must be set to <b>paypal.com</b> for live production environments, this setting is to facilate PayPal's sandbox and is not related to the IPN Test Panel or the above Test Mode option.</li><br>
+      <li><b class="ppem380">Return URL behavior</b><br>This determines what method PayPal should use when returning the customer back to the store, leave this set to 1 (GET).</li><br>
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd">
+    </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal/Help_FAQs.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal/Help_FAQs.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/help/payment/paypal/Help_FAQs.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,86 @@
+<?php
+/*
+  $Id: Help_FAQs.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td>
+   <H3><b> Paypal Faq\'s </h3> </b><br>
+   Please use your browsers back button to return.
+ </td>
+  </tr>
+  <tr>
+    <td class="pptext">The following are some frequently asked questions about this payment module:
+    </td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">My shipping costs are different once the customer arrives at the PayPal site.</b></legend><div>In your PayPal account profile in the shipping section, check the box that allows overriding the shipping costs.</li><br>
+      <li><b class="ppem380">Do I need to enable IPN in my PayPal account profile.</b><br>No.</li><br>
+      <li><b class="ppem380">What url should I specify for the IPN feature to be used.</b><br>You don't need to, it will automatically be specified.</li><br>
+      <li><b class="ppem380">Why doesn't the Auto-Return feature work.</b><br>You must enable it first in your PayPal account profile.</li><br>
+      <li><b class="ppem380">What url should I specify for the Auto-Return feature.</b><br>It doesn't matter, this contribution will automatically specify the correct script url location, which is now <code>catalog/checkout_success.php</code></li><br>
+      <li><b class="ppem380">Does this contribution support PayPal Credit Card payments.</b><br>Yes.</li><br>
+      <li><b class="ppem380">Why am I getting so many emails per transaction.</b><br>You get <b>one</b> from PayPal and <b>one</b> osCommerce order confirmation email, and another which is the <b>debug email</b>, either disable <b>debug</b> email notification or specify a sperate email address for <b>debug</b> emails.</li><br>
+      <li><b class="ppem380">Why am I not receiving any IPNs.</b><br>You must ensure that your <b>Primary Email Address</b> and <b>Business ID</b> are configured correctly.<br>Login to your PayPal Account and see what and how many email addresses you are using and which one is the Primary address.<br>Also check your debug emails as it will also specify the Primary Email Address of the intended receiver.</li><br>
+      <li><b class="ppem380">I'm having problems with Multi-Currencies.</b><br>This problem should now be resolved, previously the <b>Cart Test</b> was comparing the currency and amounts of the actual order to what PayPal received as opposed to actually comparing the currency and amounts prior to transfering the customer to PayPal.<br><br><b>However</b>, if you're using the Itemized Shopping Cart then discrepancies may arise due to PayPal's two decimal place calculations, in such an event the order will be placed on hold. Although this type of discrepancy may not affect all orders it does however exist and now adds a future requirement to enable you to finalize the transaction via your store's admin.</li><br>
+      <li><b class="ppem380">I'm having problems verifying the Cart Totals.</b><br>See above.</li><br>
+      <li><b class="ppem380">Why is there no PayPal shipping address details in the IPN info?</b><br>Set Enable PayPal Shipping Address to 'No' if you require a PayPal verified shipping address or set to 'Yes' if you do not.</li><br>
+      <li><b class="ppem380">How can I customize the Checkout redirect page.</b><br>The splash template page shown while transfering the customer to PayPal is:<br><code>catalog/includes/modules/payment/paypal/catalog/checkout_splash.inc.php</code></li><br>
+      <li><b class="ppem380">Where can I find more PayPal logo buttons.</b><br>Login to your PayPal account and click Merchant Tools or Auction Tools.</li><br>
+      <li><b class="ppem380">Where can I find PayPal documentation.</b><br><ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;"><li><a href="https://www.paypal.com/en_US/pdf/integration_guide.pdf">PayPal Integration Manual</a></li></ul></li><br>
+
+      <li><b class="ppem380">How do I use PayPal's Sandbox.</b>
+        <ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;">
+          <li>Register with <a href="https://developer.paypal.com/" target="PPDC">PayPal Developer Central</a></li>
+          <li>Then create <b>two virtual accounts</b> types:<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Personal Account</li><li>Premier or Business Account</li></ul></li>
+          <li>Confirm both accounts (each is just a single click option).</li>
+          <li>Transfer some virtual money into your personal account (Click the add funds link).</li>
+          <li>Emails to both accounts will appear in the section where you initially login into the PayPal Developer Central, no real emails are sent so the email addresses for your virtual accounts should be fictitious.</li>
+          <li>Now in your <a href="<?php 
+          //echo tep_href_link(FILENAME_MODULES,'set=payment&module=paypal&action=edit');
+          
+          ?>" target="_blank">osCommerce::Admin::Modules::Payment::PayPal</a> configuration section<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Enter the virtual business account email address into both the Primary Email Address and Business ID fields</li><li>Set the domain to www.sandbox.paypal.com</li></ul></li>
+          <li>Now checkout as a customer via the store, this account should have a real email address (so that you can receive the osC customer order confirmation email), and when you arrive at the PayPal Sandbox site (look for their logo) then login using the virtual personal account details and finalize the payment process.</li>
+        </ul>
+       <br><p class="ppsmallerrorbold">Note that you must first login via the PayPal Developer Central prior to testing the Sandbox/Checkout process.</p>
+      </li><br>
+
+      <li><b class="ppem380">What's the difference between the IPN Test Panel and using PayPal's Sandbox.</b><br>The <a href="<?php 
+      //echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>" target="itp">IPN Test Panel</a> is an independent osCommerce Contribution feature, for testing and development purposes, which allows you to simmulate your own IPNs without having to interact with PayPal.<br><br><p class="ppsmallerrorbold">All Test IPNs via the IPN Test Panel will be invalid according to PayPal since they're not authentic transactions.</p></li><br>
+      <li><b class="ppem380">Is the IPN Test Panel related to PayPal's Sandbox.</b><br>No, see above.</li><br>
+      <li><b class="ppem380">What's the purpose of the digest key.</b><br>Currently the digest key serves two purposes, it authenticates and allows you to use the <a href="<?php // echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>" target="itp">IPN Test Panel</a>, secondly, untill such time that PayPal provides a secure method of associating an IPN specifically to a particular order, it serves as a unique transaction signature identifier.</li><br>
+      <li><b class="ppem380">Should I change the digest key default value.</b><br>Yes, but remember what it is if uninstalling and reinstalling this contrib payment module in the admin since there might be existing pending orders which will require it in order to associate with to their corresponding IPN(s).</li><br>
+      <li><b class="ppem380">How are IPNs deleted.</b><br>Currently, an IPN appearing the admin section is deleted automatically when deleting it's corresponding order.</li><br>
+      <li><b class="ppem380">How can a customer resume their order.</b><br>Currently, if the customer abandons the checkout process at the PayPal site, e.g for some reason they did not actually pay at that time, then they can log into their osCommerce account and click the confirm order button when viewing the details of that particular order in their account_history_info.<br><br>This feature is only available when <b>synchronizing invoices</b> with PayPal.<br><br>This means that if you ever reset the osCommerce <code>orders</code> database table then you must also update it's auto-increment value to be greater than the last known <code>order_id</code>.</li><br>
+      <li><b class="ppem380">I'm getting errors after installing the contribution.</b><br>First, go through the installation edits and remove any blank spaces at the beginning of the line(s), some text editors will insert hidden characters which is a side effect of copying and pasting from HTML documentation.<br>Make sure that the alterations have been performed as well as running the paypal_ipn.sql script.</li><br>
+
+      <li><b class="ppem380">What type of PayPal account do I need.</b><br>You will need either a Premier or Merchant Business Account. <a href="https://www.paypal.com/refer/pal=PS2X9Q773CKG4" target="_blank">Click&nbsp;here&nbsp;to&nbsp;register&nbsp;for&nbsp;an&nbsp;account</a> if you do not already have one.</li><br>
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd"><form name="contents" action="<?php
+    //echo tep_href_link(FILENAME_PAYPAL,'','NONSSL'); 
+    ?>"><input type="hidden" name="action" value="help" /><input type="submit" value="Contents" class="ppbuttonsmall" />
+    </form></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_activate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_activate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_add_article.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_add_article.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_add_field.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_add_field.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_add_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_add_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_files.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_files.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_group.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_group.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_groups.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_groups.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_home.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_home.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_member.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_member.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_members.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_members.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_permission.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_permission.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_remove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_admin_remove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_billing.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_billing.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_backup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_backup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_blank.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_blank.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_browse.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_browse.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_cancel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_cancel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_cancel_edit_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_cancel_edit_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_check_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_check_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_check_links.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_check_links.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_confirm_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_confirm_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_convert.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_convert.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_copy.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_copy.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_copy_to.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_copy_to.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_create.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_create.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_create_customer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_create_customer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_create_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_create_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_decrypt.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_decrypt.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_details.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_details.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_attributes.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_attributes.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_footer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_footer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_header.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_header.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_infoboxes.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_infoboxes.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_key.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_key.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_lang_define.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_lang_define.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_mainpage.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_mainpage.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_status.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_status.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_values.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_edit_values.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_email.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_encrypt.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_encrypt.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_file_manager.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_file_manager.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_free_signup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_free_signup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_insert.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_insert.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_insert_into_db.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_insert_into_db.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_invoice.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_invoice.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_lock.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_lock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_module_install.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_module_install.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_module_remove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_module_remove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_move.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_move.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_article.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_article.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_author.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_author.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_banner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_banner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_category.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_category.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_country.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_country.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_currency.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_currency.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_event.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_event.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_faq.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_faq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_file.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_file.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_folder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_language.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_language.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_news_item.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_news_item.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_newsletter.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_newsletter.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_sale.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_sale.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_tax_class.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_tax_class.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_tax_rate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_tax_rate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_topic.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_topic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_zone.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_new_zone.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_next.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_next.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_orders.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_orders.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_packingslip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_packingslip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_preview.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_preview.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_preview_upload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_preview_upload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_print.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_print.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_print_page.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_print_page.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_process.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_process.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_quick_save.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_quick_save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_release.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_release.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_remove_fields.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_remove_fields.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_removeccinfo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_removeccinfo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_report.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_report.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_reset.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_reset.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_restore.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_restore.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_return.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_return.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_review_approve.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_review_approve.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_review_disapprove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_review_disapprove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_run.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_run.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save_edit_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save_edit_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save_finish.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save_finish.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save_reload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_save_reload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_select.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_select.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_send_mail.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_send_mail.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_split_file.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_split_file.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_spllit_files.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_spllit_files.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_start_file_creation.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_start_file_creation.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_template_admin.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_template_admin.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_unlock.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_unlock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_box_positions.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_box_positions.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_currencies.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_currencies.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_fields.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_fields.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_status.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_update_status.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_upload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_upload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_verify.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/button_verify.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/ic_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/ic_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/ic_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/ic_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/review_approve.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/review_approve.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/review_disapprove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/review_disapprove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/sync.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/espanol/images/buttons/sync.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+<?php
+
+define('TEXT_CRELOADED','CRE Loaded.com');
+define('TEXT_OSC','osCommerce.com');
+
+
+//common
+define('TEXT_MANAGE','Manage');
+define('TEXT_ADD','Add');
+define('TEXT_VIEW','View');
+define('TEXT_INSTALLED','Installed');
+define('TEXT_ENABLED','Enabled');
+
+// Store box
+define('BLOCK_TITLE_STORE_INFO','Store Info');
+$storename="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=1&cID=1&action=edit")."'>Store Name</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_NAME',$storename);
+$storestatus="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=16&cID=153")."'>Store Status</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_STATUS',$storestatus);
+$storeemail="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=1&cID=4")."'>Store Email</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_EMAIL',$storeemail); 
+$defaulttemplate="<a class='adminLink' href='".tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,"cID=7")."'>Default Template</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_TEMPLATE',$defaulttemplate); 
+$primarylang="<a class='adminLink' href='".tep_href_link(FILENAME_LANGUAGES)."'>Primary Language</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_LANGUAGE',$primarylang); 
+$primarycurr="<a class='adminLink' href='".tep_href_link(FILENAME_CURRENCIES)."'>Primary Currency</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_CURRENCY',$primarycurr);
+define('BLOCK_CONTENT_STORE_INFO_STORE_TAX_RATE','Tax Rate');
+define('BLOCK_CONTENT_STORE_INFO_STORE_TAX_ZONE','Tax Zone');
+define('BLOCK_CONTENT_STORE_INFO_STORE_BACKUPS','Database Backups'); 
+// Store tips
+define('BLOCK_HELP_STORE_INFO','<ul><li><strong>Store Info</strong><br>Store info which you have in database.<br> You can visit Configuration >> My Store to edit / modify the same.</li></ul>');
+define('BLOCK_HELP_STORE_STATUS','<ul><li><font color=#009900><strong>Active</strong></font><br>Store is open for business.</li><li><font color=#FF0000><strong>Maintanace</strong></font><br>Down for maintananace</li></ul>');
+define('BLOCK_HELP_STORE_BACKUP','Create Fresh Backup Now!');
+
+// Order Box
+define('BLOCK_TITLE_ORDERS', 'Pedidos');
+define('BLOCK_HELP_ORDERS','<ul><li><strong>Total Orders</strong><br> This is total count of Order records available in database, irrespective of status.</li><li><strong>Orders Pending</strong><br>Total count of orders, whose status is <font color=red>Pending</font></li><li><strong>Processing<br></strong>Total count of orders, whose status is <font color=red>Processing</font></li>  </ul>');
+
+// reports
+define('BLOCK_TITLE_REPORTS','Reports');    
+define('BLOCK_CONTENT_REPORTS_PRODUCTS_VIEWED','Products Viewed');
+define('BLOCK_CONTENT_REPORTS_PRODUCTS_PURCHASED','Products Purchased');
+define('BLOCK_CONTENT_REPORTS_CUSTOMER_ORDERS_TOTAL','Customer Orders-Total');
+define('BLOCK_CONTENT_REPORTS_MONTHLY_SALES_TAX','Monthly Sales/Tax');
+define('BLOCK_HELP_REPORTS','<ul><li><strong>Reports</strong><br> Click on the links below to view the reports.</li>  </ul>');
+
+// Products
+define('BLOCK_TITLE_PRODUCTS','Products');
+define('BLOCK_CONTENT_PRODUCTS_CATEGORIES','Total Number of Categories');
+define('BLOCK_CONTENT_PRODUCTS_TOTAL_PRODUCTS','Total Number of Products');
+define('BLOCK_CONTENT_PRODUCTS_ACTIVE','Active Products');
+define('BLOCK_CONTENT_PRODUCTS_NOSTOCK','Out of Stock');
+define('BLOCK_HELP_PRODUCTS','<ul><li><strong>Total Number of Products</strong><br>This is total count of products in database irrespective of categories and status.</li><li><strong>Active Products</strong><br>This is total count of live products which are online for sales. This record didcuscts products deactiveated by store admin and out of stocks.</li><li><strong>Out Of Stock<br></strong>This is total count of products, which are not in stock.</li></ul>');
+
+//reviews
+define('BLOCK_TITLE_REVIEWS','Reviews');
+define('BLOCK_CONTENT_REVIEWS_TOTAL_REVIEWS','Total Number of Reviews');
+define('BLOCK_CONTENT_REVIEWS_WAITING_APPROVAL','Waiting Approval');
+define('BLOCK_HELP_REVIEWS','<ul><li><strong>Total Number Reviews</strong><br>This is total count of product records available in database, irrespective of categories, products and status.</li><li><strong>Waiting Approval</strong><br>  Total count of review waiting for admin approval.</li></ul>');
+
+//Customers
+define('BLOCK_TITLE_CUSTOMERS','Customers');
+define('BLOCK_CONTENT_CUSTOMERS_TOTAL','Total Customers');
+define('BLOCK_CONTENT_CUSTOMERS_SUBSCRIBED','Subscribed');
+define('BLOCK_HELP_CUSTOMERS','<ul>  <li><strong>Total Customers</strong><br>This is total count of customers who signedup with store.</li><li><strong>Subscribed</strong><br>Total count of customers who subscribed for Newsletter and or Product Notifications.</li></ul>');
+
+// Affiliates
+define('BLOCK_TITLE_AFFILIATE','Affiliates');
+define('BLOCK_CONTENT_AFFILIATE_TOTAL','Total Affiliates');
+define('BLOCK_CONTENT_AFFILIATE_SALES','Affiliate Sales');
+define('BLOCK_CONTENT_AFFILIATE_COMMISSION','Total Affiliate Commission');
+define('BLOCK_HELP_AFFILIATE','<ul><li><strong>Affiliates</strong><br>Details of Affiliates. Use <strong>Manage</strong> link to manage affiliates.</li></ul>');
+
+//Links
+define('BLOCK_TITLE_LINKS','Links');
+define('BLOCK_CONTENT_LINKS_TOTAL','Total Links');
+define('BLOCK_CONTENT_LINKS_CATEGORIES','Link Categories');
+define('BLOCK_CONTENT_LINKS_WAITING','Waiting Approval');
+
+//Shipping Module
+define('BLOCK_TITLE_SHIPPING_MODULES','Shipping Modules');
+define('BLOCK_CONTENT_SHIPPING_MODULES_INSTALLED','Modules Installed');
+define('BLOCK_CONTENT_SHIPPING_MODULES_ENABLED','Modules Enabled');
+define('BLOCK_HELP_SHIPPING_MODULES','<ul><li><strong>Shipping Modules</strong><br>Number of Shipping modules Installed and you are currently using. Use <strong>Manage</strong> link to manage shipping modules.</li></ul>');
+
+// Payment Modules
+define('BLOCK_TITLE_PAYMENT_MODULES','Payment Modules');
+define('BLOCK_CONTENT_PAYMENT_MODULES_INSTALLED','Modules Installed');
+define('BLOCK_CONTENT_PAYMENT_MODULES_ENABLED','Modules Enabled');
+define('BLOCK_HELP_PAYMENT_MODULES','<ul><li><strong>Payment Modules</strong><br>Number of Payment modules Installed and you are currently using. Use <strong>Manage</strong> link to manage payment modules.</li></ul>');
+
+//Taxes
+define('BLOCK_TITLE_TAX_RATES','Tax Rates');
+define('BLOCK_HELP_TAXES','<ul><li><strong>Taxes</strong><br>Number of Zones Installed</li></ul>');
+
+// CRE Forge
+define('BLOCK_TITLE_CRE_FORGE',"CRE Forge");
+define('BLOCK_CONTENT_CRE_FORGE_BUG_TRACKER',"Bug Tracker");
+define('BLOCK_CONTENT_CRE_FORGE_FEATURE_REQUESTS',"Feature Requests");
+define('BLOCK_CONTENT_CRE_FORGE_SVN_REPOSITORY',"SVN Repository");
+define('BLOCK_CONTENT_CRE_FORGE_SUPPORT_REQUEST',"Support Request");
+define('BLOCK_CONTENT_CRE_FORGE_FILE_RELEASES',"File Releases");
+define('BLOCK_TITLE_CRE_NEWS',"CRE Loaded News");
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/index_new.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/index_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/index_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+define('TEXT_ADMIN_HOME','Admin Home');
+define('TEXT_VIEW_CATALOG','View Catalog');
+define('TEXT_FORUMS','CRE Forums');
+define('TEXT_PURCHASE_SUPPORT','Purchase CRE Support');
+define('TEXT_HOSTING','Certified CRE Hosting');
+define('TEXT_WELCOME','Welcome <strong>' . STORE_ADMIN_NAME . '</strong> to <strong>' . STORE_NAME . '</strong> Administration!');
+define('TEXT_ADMIN_LANG','Admin Language:');
+define('TEXT_CHANGE_PASWORD','Change Password');
+define('TEXT_LOGOUT','Logout');
+define('TEXT_CHECK_UPDATES','Check for Updates');
+define('TEXT_GET_PRO','Get Pro Version');
+
+//common
+define('TEXT_MANAGE','Manage');
+define('TEXT_ADD','Add');
+define('TEXT_VIEW','View');
+define('TEXT_INSTALLED','Installed');
+define('TEXT_ENABLED','Enabled');
+
+// Store box
+define('TEXT_STORE_INFO','Store Info');
+define('TEXT_STORE_NAME','Store Name');
+define('TEXT_STORE_STATUS','Store Status');
+define('TEXT_STORE_EMAIL','Store Email'); 
+define('TEXT_STORE_TEMPLATE','Default Template'); 
+define('TEXT_STORE_LANGUAGE','Primary Language'); 
+define('TEXT_STORE_CURRENCY','Primary Currency');
+define('TEXT_STORE_TAX_RATE','Tax Rate');
+define('TEXT_STORE_TAX_ZONE','Tax Zone');
+define('TEXT_STORE_BACKUPS','Database Backups'); 
+// Store tips
+define('TEXT_HELP_STORE_INFO','<ul><li><strong>Store Info</strong><br>Store info which you have in database.<br> You can visit Configuration >> My Store to edit / modify the same.</li></ul>');
+define('TEXT_HELP_STORE_STATUS','<ul><li><font color=#009900><strong>Active</strong></font><br>Store is open for business.</li><li><font color=#FF0000><strong>Maintanace</strong></font><br>Down for maintananace</li></ul>');
+define('TEXT_HELP_STORE_BACKUP','Create Fresh Backup Now!');
+
+// Order Box
+define('TEXT_ORDERS','Orders');
+define('TEXT_HELP_ORDERS','<ul><li><strong>Total Orders</strong><br> This is total count of Order records available in database, irrespective of status.</li><li><strong>Orders Pending</strong><br>Total count of orders, whose status is <font color=red>Pending</font></li><li><strong>Processing<br></strong>Total count of orders, whose status is <font color=red>Processing</font></li>  </ul>');
+define('TEXT_PENDING','Pending');
+define('TEXT_PROCESSING','Processing');
+define('TEXT_DELIVERED','Delivered');
+define('TEXT_PAYPAL_PROCESSING','Paypal Processing');
+define('TEXT_ALLOW_DOWNLOAD','Allow Download');
+define('TEXT_ON_HOLD','On Hold');
+define('TEXT_CANCELED','Canceled');
+define('TEXT_AWAITING_CC_PROCESSING','Awaiting CC Processing');
+
+
+// reports
+define('TEXT_REPORTS','Reports');
+define('TEXT_REPORTS_PRODUCTS_VIEWED','Products Viewed');
+define('TEXT_REPORTS_PURCHASED','Products Purchased');
+define('TEXT_ORDERS_ORDER_TOTAL','Customer Orders-Total');
+define('TEXT_ORDERS_SALES_TAX','Monthly Sales/Tax');
+define('TEXT_HELP_REPORTS','<ul><li><strong>Reports</strong><br> Click on the links below to view the reports.</li>  </ul>');
+
+// Products
+define('TEXT_PRODUCTS','Products');
+define('TEXT_PRODUCTS_CATEGORIES','Total Number of Categories');
+define('TEXT_PRODUCTS_TOTAL_PRODUCTS','Total Number of Products');
+define('TEXT_PRODUCTS_ACTIVE','Active Products');
+define('TEXT_PRODUCTS_NOSTOCK','Out of Stock');
+define('TEXT_HELP_PRODUCTS','<ul><li><strong>Total Number of Products</strong><br>This is total count of products in database irrespective of categories and status.</li><li><strong>Active Products</strong><br>This is total count of live products which are online for sales. This record didcuscts products deactiveated by store admin and out of stocks.</li><li><strong>Out Of Stock<br></strong>This is total count of products, which are not in stock.</li></ul>');
+
+//reviews
+define('TEXT_REVIEWS','Reviews');
+define('TEXT_REVIEWS_TOTAL','Total Number of Reviews');
+define('TEXT_REVIEWS_WAITING','Waiting Approval');
+define('TEXT_HELP_REVIEWS','<ul><li><strong>Total Number Reviews</strong><br>This is total count of product records available in database, irrespective of categories, products and status.</li><li><strong>Waiting Approval</strong><br>  Total count of review waiting for admin approval.</li></ul>');
+
+//Customers
+define('TEXT_CUSTOMERS','Customers');
+define('TEXT_CUSTOMERS_TOTAL','Total Customers');
+define('TEXT_CUSTOMERS_SUBSCRIBED','Subscribed');
+define('TEXT_HELP_CUSTOMERS','<ul>  <li><strong>Total Customers</strong><br>This is total count of customers who signedup with store.</li><li><strong>Subscribed</strong><br>Total count of customers who subscribed for Newsletter and or Product Notifications.</li></ul>');
+
+// Affiliates
+define('TEXT_AFFILIATE','Affiliates');
+define('TEXT_AFFILIATE_TOTAL','Total Affiliates');
+define('TEXT_AFFILIATE_SALES','Affiliate Sales');
+define('TEXT_AFFILIATE_COMMISSION','Total Affiliate Commission');
+define('TEXT_HELP_AFFILIATE','<ul><li><strong>Affiliates</strong><br>Details of Affiliates. Use <strong>Manage</strong> link to manage affiliates.</li></ul>');
+
+//Links
+define('TEXT_LINKS','Links');
+define('TEXT_LINKS_TOTAL','Total Links');
+define('TEXT_LINKS_CATEGORIES','Link Categories');
+define('TEXT_LINKS_WAITING','Waiting Approval');
+
+//Shipping Module
+define('TEXT_SHIPPING_MODULES','Shipping Modules');
+define('TEXT_HELP_SHIPPING_MODULES','<ul><li><strong>Shipping Modules</strong><br>Number of Shipping modules Installed and you are currently using. Use <strong>Manage</strong> link to manage shipping modules.</li></ul>');
+
+// Payment Modules
+define('TEXT_PAYMENT_MODULES','Payment Modules');
+define('TEXT_HELP_PAYMENT_MODULES','<ul><li><strong>Payment Modules</strong><br>Number of Payment modules Installed and you are currently using. Use <strong>Manage</strong> link to manage payment modules.</li></ul>');
+
+// CRE Forge
+define('BOX_HEADING_CRE_FORGE',"CRE Forge");
+define('BOX_CRE_FORGE_BUG_TRACKER',"Bug Tracker");
+define('BOX_CRE_FORGE_FEATURE_REQUESTS',"Feature Requests");
+define('BOX_CRE_FORGE_SVN_REPOSITORY',"SVN Repository");
+define('BOX_CRE_FORGE_SUPPORT_REQUEST',"Support Request");
+define('BOX_CRE_FORGE_FILE_RELEASES',"File Releases");
+define('BOX_HEADING_CRE_NEWS',"CRE Loaded News");
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/infobox_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/infobox_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/infobox_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Infobox Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Infobox Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADER_EXPLAIN', 'These settings effect all templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Infobox configuration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Infobox configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/infobox_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/infobox_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/infobox_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/*
+  $Id: infobox_configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE', 'Creación, actualización y visualización de paneles informativos');
+define('TABLE_HEADING_INFOBOX_FILE_NAME', 'Título');
+define('TABLE_HEADING_ACTIVE', '¿Activar el panel?');
+define('TABLE_HEADING_KEY', 'Definir el encabezado del panel');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_COLUMN', 'Ajustar columnas');
+define('TABLE_HEADING_SORT_ORDER', 'Posición');
+define('TABLE_HEADING_TEMPLATE', 'Plantilla para el panel');
+define('TABLE_HEADING_FONT_COLOR', 'Color del texto');
+define('TABLE_HEADING_BOX_DIRECTORY', 'Location of boxes for this template: ');
+define('TEXT_INFO_EDIT_INTRO', 'Por favor, haga los cambios necesarios');
+define('TEXT_INFO_DATE_ADDED', 'Fecha añadido:');
+define('TEXT_INFO_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Crear un nuevo panel');
+define('TEXT_INFO_INSERT_INTRO', 'Se ha seleccionado el panel<b> what\'s_new.php</b>');
+define('TEXT_INFO_DELETE_INTRO', '<P STYLE="color: red; font-weight: bold;">Confirme si quiere eliminar el panel');
+define('TEXT_INFO_HEADING_DELETE_INFOBOX', '¿Eliminar el panel?');
+define('TEXT_INFO_HEADING_UPDATE_INFOBOX', 'Actualizar el panel');
+define('IMAGE_INFOBOX_STATUS_UP', 'Arriba');
+define('IMAGE_ICON_STATUS_UP_LIGHT', 'Mover ariba');
+define('IMAGE_INFOBOX_STATUS_down', 'Abajo');
+define('IMAGE_ICON_STATUS_DOWN_LIGHT', 'Mover abajo');
+define('IMAGE_INFOBOX_STATUS_GREEN', 'Izquierda');
+define('IMAGE_INFOBOX_STATUS_GREEN_LIGHT', 'Ajustar izquierda');
+define('IMAGE_INFOBOX_STATUS_RED', 'Derecha');
+define('IMAGE_INFOBOX_STATUS_RED_LIGHT', 'Ajustar derecha');
+define('BOX_HEADING_BOXES', 'Administración de paneles');
+define('TEXT_HEADING_SET_ACTIVE', '¿Activar este panel? ');
+define('TEXT_HEADING_DEFINE_KEY', '  Clave de definición ');
+define('TEXT_HEADING_WHAT_POS', '¿Qué posición? ');
+define('TEXT_HEADING_WHICH_TEMPLATE', '¿Qué plantilla? ');
+define('TEXT_HEADING_HEADING', 'El encabezado del panel ');
+define('TEXT_HEADING_WHICH_COL', '¿Qué columna? ');
+define('TEXT_HEADING_FILENAME', 'Archivo ');
+define('TEXT_HEADING_FONT_COLOR', 'Color del texto del encabezado ');
+define('TEXT_NOTE_REQUIRED', '* Campo obligatorio');
+define('JS_BOX_HEADING', '* La \'Clave de definición\' es necesaria. Por ejemplo: BOX_HEADING_WHATS_NEW');
+define('JS_INFO_BOX_HEADING', '* El \'Encabezado de panel\' es necesario.');
+define('JS_BOX_LOCATION', '* Debe designar una columna para mostrar el panel');
+define('JS_INFO_BOX_FILENAME', '* Debe seleccionar un nombre de archivo para su panel');
+define('JS_BOX_COLOR', '* Seleccionar por favor un color para el color de la fuente.');
+define('TEXT_INFO_MESSAGE_COUNT_1', '<br>Actualmente hay <br>');
+define('TEXT_INFO_MESSAGE_COUNT_2', ' paneles activos en la columna izquierda y <br>');
+define('TEXT_INFO_MESSAGE_COUNT_3', ' paneles activos en la columna derecha');
+//error messages
+define('infobox_error1', 'Esta plantilla no contiene ningún panel para instalar. Por favor sitúe los paneles que quiera instalar en la carpeta de paneles de esta plantilla');
+define('infobox_error2', 'ATENCIÓN: No hay ningún panel seleccionado en la columna IZQUIERDA');
+define('infobox_error3', 'ATENCIÓN: No hay ningún panel seleccionado en la columna DERECHA');
+
+define('INFOBOX_ACTIVE_BOXES', ' active boxes in the right column');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/information.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+          Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+
+  define('ACTION_INFORMATION', 'Acción');
+  define('ACTIVATION_ID_INFORMATION', 'Activación del ID de la información=');
+  define('ADD_INFORMATION', 'Añadir información nueva');
+  define('ADD_QUEUE_INFORMATION', 'Añadir información a la cola');
+  define('ALERT_INFORMATION', 'Vacío: ¡Actualmente no tiene ningún archivo!');
+  define('ANSWER_INFORMATION', 'Respuesta');
+  define('CONFIRM_INFORMATION', 'Confirmar');
+  define('DEACTIVATION_ID_INFORMATION', 'Desactivación del Id de la información=');
+  define('DELETE_INFORMATION', 'Eliminar');
+  define('DELETE_CONFITMATION_ID_INFORMATION', 'Confirmación de borrado de ID de información=');
+  define('DELETE_ID_INFORMATION', 'Eliminar el ID de información=');
+  define('DELETED_ID_INFORMATION', 'Eliminado el ID=');
+  define('DESCRIPTION_INFORMATION', 'Descripción');
+  define('EDIT_ID_INFORMATION', 'Editar el ID de información=');
+  define('EDIT_INFORMATION', 'Editar');
+  define('ERROR_20_INFORMATION', 'No ha definido un valor válido para la opción <b>Cola</b>. Sólo es válido un valor numérico');
+  define('ERROR_80_INFORMATION', 'No ha completado todos los <b>campos necesarios</b>');
+  define('INFORMATION_ID_ACTIVE', 'Esta información está ACTIVA');
+  define('INFORMATION_ID_DEACTIVE', 'Esta información está INACTIVA');
+  define('INFORMATION_ACTIVE', 'Activa');
+  define('INFORMATION_DEACTIVE', 'Inactiva');
+  define('ID_INFORMATION', 'ID');
+  define('TITLE_INFORMATION', 'Título');
+  define('QUEUE_INFORMATION', 'Cola');
+  define('QUEUE_INFORMATION_LIST', 'Listado de la cola: ');
+  define('MANAGER_INFORMATION', 'Gestor de información');
+  define('NO_INFORMATION', 'No');
+  define('PUBLIC_INFORMATION', 'Pública');
+  define('PAGE_PREVIEW', 'Previo');
+  define('SORT_BY', 'Página de información - Ordenada por');
+  define('STATUS_INFORMATION', 'Estado:');
+  define('SUCCEED_INFORMATION', ' OK');
+  define('TITLE', 'Sistema de información');
+  define('VIEW_INFORMATION', 'Ver la información');
+  define('VISIBLE_INFORMATION', 'Visible');
+  define('VISIBLE_INFORMATION_DO', '( Para hacerla visible )');
+  define('UPDATE_ID_INFORMATION', 'Actualizar la página de información número : ');
+  define('WARNING_INFORMATION', 'Atención');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: invoice.php,v 1.3 2004/03/13 15:09:11 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('TITLE_PRINT_ORDER', 'Imprimir el pedido #: ');
+
+define('TABLE_HEADING_COMMENTS', 'Comentarios');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modelo');
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_TAX', 'Impuesto');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Precio (ex)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Precio (inc)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ex)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inc)');
+
+define('ENTRY_SOLD_TO', 'VENDIDO A:');
+define('ENTRY_SHIP_TO', 'ENVIADO A:');
+define('ENTRY_PAYMENT_METHOD', 'Forma de pago:');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Impuesto:');
+define('ENTRY_SHIPPING', 'Portes:');
+define('ENTRY_TOTAL', 'Total:');
+
+define('ENTRY_DATE_PURCHASED', 'Fecha de compra:');
+define('TITLE_PRINT_INVOICE', 'Print Invoice');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/languages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:40:12 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Idiomas');
+
+define('TABLE_HEADING_LANGUAGE_NAME', 'Idioma');
+define('TABLE_HEADING_LANGUAGE_CODE', 'Código');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_EDIT_INTRO', 'Haga los cambios necesarios');
+define('TEXT_INFO_LANGUAGE_NAME', 'Nombre:');
+define('TEXT_INFO_LANGUAGE_CODE', 'Código:');
+define('TEXT_INFO_LANGUAGE_IMAGE', 'Imagen:');
+define('TEXT_INFO_LANGUAGE_DIRECTORY', 'Carpeta:');
+define('TEXT_INFO_LANGUAGE_SORT_ORDER', 'Orden:');
+define('TEXT_INFO_INSERT_INTRO', 'Introduzca los datos para el nuevo idioma');
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que quiere eliminar este idioma?');
+define('TEXT_INFO_HEADING_NEW_LANGUAGE', 'Idioma nuevo');
+define('TEXT_INFO_HEADING_EDIT_LANGUAGE', 'Editar idioma');
+define('TEXT_INFO_HEADING_DELETE_LANGUAGE', 'Eliminar idioma');
+
+define('ERROR_REMOVE_DEFAULT_LANGUAGE', 'Error: El idioma seleccionado por defecto no se puede eliminar. Seleccione otro idioma predeterminado y pruebe de nuevo.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/link_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/link_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/link_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: link_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Categorías de enlaces');
+define('HEADING_TITLE_SEARCH', 'Buscar:');
+
+define('TABLE_HEADING_NAME', 'Nombre');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_HEADING_NEW_LINK_CATEGORY', 'Nueva categoría de enlaces');
+define('TEXT_INFO_HEADING_EDIT_LINK_CATEGORY', 'Editar categoría de enlaces');
+define('TEXT_INFO_HEADING_DELETE_LINK_CATEGORY', 'Eliminar categoría de enlaces');
+
+define('TEXT_INFO_LINK_CATEGORY_COUNT', 'Enlaces:');
+define('TEXT_INFO_LINK_CATEGORY_STATUS', 'Estado:');
+define('TEXT_INFO_LINK_CATEGORY_DESCRIPTION', 'Descripción:');
+define('TEXT_INFO_LINK_CATEGORY_SORT_ORDER', 'Orden:');
+define('TEXT_DATE_LINK_CATEGORY_CREATED', 'Creado el:');
+define('TEXT_DATE_LINK_CATEGORY_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_IMAGE_NONEXISTENT', 'LA IMAGEN NO EXISTE');
+
+define('TEXT_NEW_LINK_CATEGORIES_INTRO', 'Por favor, rellene la siguiente información para la nueva categoría de enlaces');
+define('TEXT_EDIT_LINK_CATEGORIES_INTRO', 'Por favor haga los cambios necesarios');
+define('TEXT_DELETE_LINK_CATEGORIES_INTRO', '¿Esta seguro de que quiere eliminar esta categoría de enlaces?');
+
+define('TEXT_LINK_CATEGORIES_NAME', 'Nombre de la categoría:');
+define('TEXT_LINK_CATEGORIES_DESCRIPTION', 'Descripción de la categoría:');
+define('TEXT_LINK_CATEGORIES_IMAGE', 'Imagen de la categoría:');
+define('TEXT_LINK_CATEGORIES_SORT_ORDER', 'Orden:');
+define('TEXT_LINK_CATEGORIES_STATUS', 'Estado:');
+define('TEXT_LINK_CATEGORIES_STATUS_ENABLE', 'Activar');
+define('TEXT_LINK_CATEGORIES_STATUS_DISABLE', 'Desactivar');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>ATENCIÓN:</b> ¡Hay %s enlaces relacionados con esta categoría!');
+
+define('TEXT_DISPLAY_NUMBER_OF_LINK_CATEGORIES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> categorías de enlaces)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/links.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,79 @@
+<?php
+/*
+  $Id: links.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Enlaces');
+define('HEADING_TITLE_SEARCH', 'Buscar:');
+
+define('TABLE_HEADING_TITLE', 'Título');
+define('TABLE_HEADING_URL', 'URL');
+define('TABLE_HEADING_CLICKS', 'Clicks');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_HEADING_DELETE_LINK', 'Eliminar enlace');
+define('TEXT_INFO_HEADING_CHECK_LINK', 'Comprobar enlace');
+
+define('TEXT_DELETE_INTRO', '¿Está seguro de que quiere eliminar este enlace?');
+
+define('TEXT_INFO_LINK_CHECK_RESULT', 'Resultado de la comprobación del enlace:');
+define('TEXT_INFO_LINK_CHECK_FOUND', 'Encontrado');
+define('TEXT_INFO_LINK_CHECK_NOT_FOUND', 'No encontrado');
+define('TEXT_INFO_LINK_CHECK_ERROR', 'Error leyendo la URL');
+
+
+define('TEXT_INFO_LINK_STATUS', 'Estado:');
+define('TEXT_INFO_LINK_CATEGORY', 'Categoría:');
+define('TEXT_INFO_LINK_CONTACT_NAME', 'Nombre del contacto:');
+define('TEXT_INFO_LINK_CONTACT_EMAIL', 'Email del contacto:');
+define('TEXT_INFO_LINK_CLICK_COUNT', 'Clicks:');
+define('TEXT_INFO_LINK_DESCRIPTION', 'Descripción:');
+define('TEXT_DATE_LINK_CREATED', 'Fecha de creación:');
+define('TEXT_DATE_LINK_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_IMAGE_NONEXISTENT', 'LA IMAGEN NO EXISTE');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Actualización del estado del enlace');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Estimado %s,' . "\n\n" . 'Se ha actualizado el estado de su enlace a ' . STORE_NAME . '.' . "\n\n" . 'Nuevo estado: %s' . "\n\n" . 'Por favor responda a este email si tiene alguna duda.' . "\n");
+
+// VJ todo - move to common language file
+define('CATEGORY_WEBSITE', 'Detalles del sitio Web');
+define('CATEGORY_RECIPROCAL', 'Detalles de la página recíproca');
+define('CATEGORY_OPTIONS', 'Opciones');
+
+define('ENTRY_LINKS_TITLE', 'Título del sitio:');
+define('ENTRY_LINKS_TITLE_ERROR', 'El título del enlace debe tener al menos ' . ENTRY_LINKS_TITLE_MIN_LENGTH . ' caracteres.');
+define('ENTRY_LINKS_URL', 'URL:');
+define('ENTRY_LINKS_URL_ERROR', 'La URL debe tener al menos ' . ENTRY_LINKS_URL_MIN_LENGTH . ' caracteres.');
+define('ENTRY_LINKS_CATEGORY', 'Categoría:');
+define('ENTRY_LINKS_DESCRIPTION', 'Descripción:');
+define('ENTRY_LINKS_DESCRIPTION_ERROR', 'La descripción debe tener al menos ' . ENTRY_LINKS_DESCRIPTION_MIN_LENGTH . ' caracteres.');
+define('ENTRY_LINKS_IMAGE', 'URL de la imagen:');
+define('ENTRY_LINKS_CONTACT_NAME', 'Nombre completo:');
+define('ENTRY_LINKS_CONTACT_NAME_ERROR', 'Su nombre completo debe tener al menos  ' . ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH . ' caracteres.');
+define('ENTRY_LINKS_RECIPROCAL_URL', 'Página recíproca:');
+define('ENTRY_LINKS_RECIPROCAL_URL_ERROR', 'La página recíproca debe tener al menos ' . ENTRY_LINKS_URL_MIN_LENGTH . ' caracteres.');
+define('ENTRY_LINKS_STATUS', 'Estado:');
+define('ENTRY_LINKS_NOTIFY_CONTACT', 'Contacto de notificación:');
+define('ENTRY_LINKS_RATING', 'Clasificación:');
+define('ENTRY_LINKS_RATING_ERROR', 'La clasificación no debe estar vacía.');
+
+define('TEXT_DISPLAY_NUMBER_OF_LINKS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> enlaces)');
+
+define('IMAGE_NEW_LINK', 'Nuevo enlace');
+define('IMAGE_CHECK_LINK', 'Comprobar enlace');
+define('ALL', 'All');
+define('LINKS_MANAGER_CHECKED_LINKS', 'Links Manager - Checked Links');
+define('ASC', 'Asc');
+define('DESC', 'Desc');
+define('START_AT', 'Start at:');
+define('HOW_MANY', 'How many?');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/links_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/links_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/links_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: links_contact.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Enviar email a los asociados de enlaces');
+
+define('TEXT_LINK_PARTNER', 'Asociado:');
+define('TEXT_SUBJECT', 'Tema:');
+define('TEXT_FROM', 'De:');
+define('TEXT_MESSAGE', 'Mensaje:');
+define('TEXT_SELECT_LINK_PARTNER', 'Seleccionar asociado');
+define('TEXT_ALL_LINK_PARTNERS', 'Todos los asociados');
+
+define('NOTICE_EMAIL_SENT_TO', 'Nota: Email enviado a: %s');
+define('ERROR_NO_LINK_PARTNER_SELECTED', 'Error: No se ha seleccionado a ningún asociado.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/login.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: login.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Login');
+define('HEADING_TITLE', 'Bienvenido, por favor regístrese');
+
+define('HEADING_RETURNING_ADMIN', 'Panel de registro:');
+define('HEADING_PASSWORD_FORGOTTEN', 'Contraseña olvidada:');
+define('TEXT_RETURNING_ADMIN', '¡Sólo para personal!');
+define('ENTRY_EMAIL_ADDRESS', 'Dirección de e-mail:');
+define('ENTRY_PASSWORD', 'Contraseña:');
+define('ENTRY_FIRSTNAME', 'Nombre:');
+define('IMAGE_BUTTON_LOGIN', 'Enviar');
+
+define('TEXT_PASSWORD_FORGOTTEN', '¿Ha olvidado la contraseña?');
+
+define('TEXT_LOGIN_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> ¡Nombre de usuario y/o contraseña incorrectos!');
+define('TEXT_FORGOTTEN_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> ¡Nombre y contraseña no coinciden!');
+define('TEXT_FORGOTTEN_FAIL', 'Lo ha intentado 3 veces. Por razones de seguridad, por favor contace con el administrador para conseguir una contraseña nueva.<br>&nbsp;<br>&nbsp;');
+define('TEXT_FORGOTTEN_SUCCESS', 'La contraseña nueva ha sido enviada a su dirección de email. Por favor compruebe su email y pulse atrás para volver a intentarlo.<br>&nbsp;<br>&nbsp;');
+
+define('ADMIN_EMAIL_SUBJECT', 'Contraseña nueva'); 
+define('ADMIN_EMAIL_TEXT', 'Hola %s,' . "\n\n" . 'Puedes acceder al panel de administración con la siguiente contraseña. Una vez acceda al panel de administración, ¡por favor, cambie su contraseña!' . "\n\n" . 'Sitio : %s' . "\n" . 'Usuario: %s' . "\n" . 'Contraseña: %s' . "\n\n" . 'Gracias!' . "\n" . '%s' . "\n\n" . 'Esta es una respuesta automática, ¡por favor no intente responder!'); 
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/logoff.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Desconectarse');
+define('NAVBAR_TITLE', 'Desconectarse');
+define('TEXT_MAIN', 'Ha salido del área de <b>Administración</b>. Es seguro salir de la página web. Pulse Atrás para reconectar');
+define('TEXT_RELOGIN', 'Re-conectar');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: mail.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Enviar email a clientes');
+
+define('TEXT_CUSTOMER', 'Cliente:');
+define('TEXT_SUBJECT', 'Asunto:');
+define('TEXT_FROM', 'De:');
+define('TEXT_MESSAGE', 'Mensaje:');
+define('TEXT_SELECT_CUSTOMER', 'Seleccionar cliente');
+define('TEXT_ALL_CUSTOMERS', 'Todos los clientes');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'A todos los suscriptores del boletín de noticias');
+
+define('NOTICE_EMAIL_SENT_TO', 'Nota: Email enviado a: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Error: No ha seleccionado ningún cliente.');
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">El botón de ATRAS está DESACTIVADO mientras el editor HTML WYSIWYG está ACTIVADO.</b></font> ¿POR QUÉ? - Porque si pulsa el botón ATRAS para editar su email HTML, el PHP (php.ini - "Magic Quotes = On") añadirá automáticamente "\\\\\\\" en todos los lugares donde aparezcan comillas dobles " (El HTML las utiliza para enlaces, imágenes y más) y esto distorsionará el código HTML, las imágenes desaparecerán una vez que envíe el email de nuevo. Si DESCONECTA el editor WYSIWYG en Admin, la compatibilidad HTML de osCommerce también se DESCONECTA y el botón de ATRAS volverá a aparecer. Sería bueno si alguien encuentra una solución para este problema del HTML y PHP.<br><br><b>Si realmente necesita previsualizar sus emails antes de enviarlos, utilice el botón de PREVIEW del editor WYSIWYG.<br><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">¡El HTML está DESCONECTADO!</b></font><br><br>Si quiere enviar un email HTML, active el editor WYSIWYG para email en: Admin-->Configuración-->Editor WYSIWYG-->Opciones<br>');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// Contact US Email Subject DMG
+define('TEXT_EMAIL_SUBJECTS', '* select a subject *');
+define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME. ': ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Fabricantes');
+
+define('TABLE_HEADING_MANUFACTURERS', 'Fabricantes');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_HEADING_NEW_MANUFACTURER', 'Nuevo fabricante');
+define('TEXT_HEADING_EDIT_MANUFACTURER', 'Editar fabricante');
+define('TEXT_HEADING_DELETE_MANUFACTURER', 'Eliminar fabricante');
+
+define('TEXT_MANUFACTURERS', 'Fabricantes:');
+define('TEXT_DATE_ADDED', 'Añadido el:');
+define('TEXT_LAST_MODIFIED', 'Ultima modificación:');
+define('TEXT_PRODUCTS', 'Productos:');
+define('TEXT_IMAGE_NONEXISTENT', 'NO EXISTE LA IMAGEN');
+
+define('TEXT_NEW_INTRO', 'Introduzca los datos del nuevo fabricante');
+define('TEXT_EDIT_INTRO', 'Haga los cambios necesarios');
+
+define('TEXT_MANUFACTURERS_NAME', 'Nombre del fabricante:');
+define('TEXT_MANUFACTURERS_IMAGE', 'Imagen del fabricante:');
+define('TEXT_MANUFACTURERS_URL', 'URL del fabricante:');
+
+define('TEXT_DELETE_INTRO', '¿Seguro que desea eliminar este fabricante?');
+define('TEXT_DELETE_IMAGE', '¿Eliminar imagen del fabricante?');
+define('TEXT_DELETE_PRODUCTS', '¿Quiere borrar también todos los productos de este fabricante? (Incluyendo comentarios, ofertas y los productos próximamente disponibles)');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>ATENCIÓN:</b> ¡Todavía hay productos que pertenecen a este fabricante!');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: No es posible escribir en esta carpeta. Por favor asigne permisos de escritura en: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: No existe la carpeta: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/members.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: members.php,v 1.2 2003/09/24 13:57:08 anon Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Member approval');
+
+define('TABLE_HEADING_LASTNAME', 'Lastname');
+define('TABLE_HEADING_FIRSTNAME', 'Firstname');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('HEADING_TITLE_SEARCH', 'Search');
+
+define('EMAIL_CONTACT', 'For help with any of our online services, please email us at: ' . STORE_OWNER_EMAIL_ADDRESS);
+
+define('EMAIL_TEXT_CONFIRM', 'Your application to become a wholesale customer of (your store) has been approved. You can now access pricing on the (your store) site.<br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to drop ship direct to your customer.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n");
+
+define('EMAIL_WARNING', '<b>Note:</b> This email address was used to request access to our wholesale website. If you did not signup to be a customer, please send an email to ' . STORE_OWNER_EMAIL_ADDRESS . "\n\n");
+
+define('EMAIL_TEXT_SUBJECT', 'Account Approved');
+
+define('EMAIL_SEPARATOR', '----------------------------------------------');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_newsletter.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+define('TEXT_COUNT_AFFILIATES', 'Affiliates receiving newsletter: %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+/*
+  $Id: newsletter.php,v 1.1.1.1 2004/03/04 23:40:15 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_COUNT_CUSTOMERS', 'Clientes que reciben el boletín: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/product_notification.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/product_notification.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/modules/newsletters/product_notification.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: product_notification.php,v 1.1.1.1 2004/03/04 23:40:15 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_COUNT_CUSTOMERS', 'Clientes que reciben el boletín: %s');
+define('TEXT_PRODUCTS', 'Productos');
+define('TEXT_SELECTED_PRODUCTS', 'Productos seleccionados');
+
+define('JS_PLEASE_SELECT_PRODUCTS', 'Seleccione algunos productos.');
+
+define('BUTTON_GLOBAL', 'Global');
+define('BUTTON_SELECT', '>>>');
+define('BUTTON_UNSELECT', '<<<');
+define('BUTTON_SUBMIT', 'Enviar');
+define('BUTTON_CANCEL', 'Cancelar');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/modules.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/modules.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/modules.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: modules.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis V1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_MODULES_PAYMENT', 'Módulos de pago');
+define('HEADING_TITLE_MODULES_SHIPPING', 'Módulos de envío');
+define('HEADING_TITLE_MODULES_ORDER_TOTAL', 'Módulos de totalización');
+define('HEADING_TITLE_MODULES_CHECKOUT_SUCCESS','Checkout Success Modules');
+
+define('TABLE_HEADING_MODULES', 'Módulos');
+define('TABLE_HEADING_SORT_ORDER', 'Orden');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_MODULE_DIRECTORY', 'Carpeta de módulos:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Navigation Menu');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_CATEGORIES_LINKS', 'Categories / Links');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Products Image:</b><small><br>Main Image used in <br><u>catalog & description</u> pages.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Small Image:</b><br><small> Image on<br><u>products list</u> pages.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Image:</b><br><small> Large Image on<br><u>pop-up window</u> page.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Store Product/s Sharing this Image =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Remove</b> this Image from this Product?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>Delete</b> this Image from the Server (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Remove');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'Delete');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Small Images.</b> If a "SM" image is used<br>(Alone) NO Pop-up window link is created, the "SM"<br> will be placed directly under the products<br>description. If used in conjunction with an <br>"XL" image on the right, a Pop-up Window Link<br> is created and the "XL" image will be<br>shown in a Pop-up window.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Large Images.</b> Used for the Pop-up image<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Additional Images - These will appear below product description if used.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Image 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Image 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Image 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Image 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Image 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Image 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Image 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Image 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Image 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Image 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Image 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Image 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DELETE_IMAGE', 'Delete Image');
+
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Category heading title:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Category heading Description:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Category Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Category Description Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Category Key Word Meta Tag :');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method :');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Product Keywords :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Edit Product Attributes');
+
+// Added for Navigation Menu DMG
+
+define('TEXT_LINKS','Links');
+define('TEXT_HEADING_EDIT_CATEGORY','Edit Navigation Category');
+define('TEXT_HEADING_NEW_LINK','Create New Navigation Link');
+define('TEXT_LINK_NAME','Link Text : ');
+define('TEXT_LINK_PAGE','Link Target : ');
+define('TEXT_STATUS','Link Status : ');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: newsletters.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gestor de boletines de noticias');
+
+define('TABLE_HEADING_NEWSLETTERS', 'Boletines de noticias');
+define('TABLE_HEADING_SIZE', 'Tamaño');
+define('TABLE_HEADING_MODULE', 'Módulo');
+define('TABLE_HEADING_SENT', 'Enviado');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_SELECT_CUSTOMER', 'Select Customer');
+define('TEXT_ALL_CUSTOMERS', 'All Customers');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'To All Newsletter Subscribers');
+
+define('TEXT_NEWSLETTER_MODULE', 'Módulo:');
+define('TEXT_NEWSLETTER_TITLE', 'Título del boletín:');
+define('TEXT_NEWSLETTER_CONTENT', 'Contenido:');
+
+define('TEXT_NEWSLETTER_DATE_ADDED', 'Añadido el:');
+define('TEXT_NEWSLETTER_DATE_SENT', 'Fecha de envío:');
+
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que quiere eliminar este boletín?');
+
+define('TEXT_PLEASE_WAIT', 'Por favor espere .. enviando emails ..<br><br>¡No interrumpa este proceso!');
+define('TEXT_FINISHED_SENDING_EMAILS', '¡Finalizado el envío de emails!');
+
+define('ERROR_NEWSLETTER_TITLE', 'Error: Se requiere un título para el boletín');
+define('ERROR_NEWSLETTER_MODULE', 'Error: Se requiere un módulo para el boletín');
+define('ERROR_REMOVE_UNLOCKED_NEWSLETTER', 'Error: Bloquee el boletín antes de eliminarlo.');
+define('ERROR_EDIT_UNLOCKED_NEWSLETTER', 'Error: Bloquee el boletín antes de editarlo.');
+define('ERROR_SEND_UNLOCKED_NEWSLETTER', 'Error: Bloquee el boletín antes de enviarlo.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/orderlist.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/orderlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/orderlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: orderlist.php,v 1.25 2003/06/20 00:28:44 vj Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Orderlist');
+define('HEADING_TITLE_STATUS', 'Status:');
+
+define('TABLE_HEADING_ORDER_ID', 'Order ID');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS_NAME', 'Product Name');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_NOTES', 'Notes');
+define('TABLE_HEADING_CHK', 'Chk');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+
+define('TEXT_DOWNLOAD', 'Download');
+define('TEXT_PRINT', 'Print');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,124 @@
+<?php
+/*
+  $Id: orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Trasnlated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('TABLE_HEADING_EDIT_ORDERS', 'To modify the order');
+
+define('HEADING_TITLE', 'Pedidos');
+define('HEADING_IS_TITLE', 'IS Order');
+define('HEADING_IS_RECEIPT', 'IS Receipt');
+define('HEADING_TITLE_SEARCH', 'ID de pedido:');
+define('HEADING_TITLE_STATUS', 'Estado:');
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('TABLE_HEADING_COMMENTS', 'Comentarios');
+define('TABLE_HEADING_CUSTOMERS', 'Clientes');
+define('TABLE_HEADING_ORDERID', 'Order ID');
+define('TABLE_HEADING_IS_ORDERNUM', 'IS Order');
+define('TABLE_HEADING_ORDER_TOTAL', 'Total del pedido');
+define('TABLE_HEADING_DATE_PURCHASED', 'Fecha de compra');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_QUANTITY', 'Cantidad');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modelo');
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_TAX', 'Impuestos');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price'); 
+
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Precio (ex)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Precio (inc)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ex)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inc)');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Cliente notificado');
+define('TABLE_HEADING_DATE_ADDED', 'Añadido el');
+
+//begin PayPal_Shopping_Cart_IPN
+define('TABLE_HEADING_PAYMENT_STATUS', 'Estado del pago');
+//end PayPal_Shopping_Cart_IPN
+define('ENTRY_SUBURB', 'Suburb :');
+define('ENTRY_CITY', 'City :');
+define('ENTRY_CUSTOMER', 'Cliente:');
+define('ENTRY_STATE', 'State :');
+define('ENTRY_SOLD_TO', 'VENDIDO A:');
+define('ENTRY_TELEPHONE', 'Entery Telephone :');
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_DELIVERY_TO', 'Entregar a:');
+define('ENTRY_SHIP_TO', 'Enviar a:');
+define('ENTRY_SHIPPING_ADDRESS', 'Dirección de envío:');
+define('ENTRY_BILLING_ADDRESS', 'Dirección de facturación:');
+define('ENTRY_PAYMENT_METHOD', 'Forma de pago:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Tipo de tarjeta de crédito:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Titular de la tarjeta crédito:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Número de la tarjeta crédito:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Caducidad de la tarjeta crédito:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV Code:');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Subtotal:');
+define('ENTRY_TAX', 'Impuestos:');
+define('ENTRY_SHIPPING', 'Gastos de envío:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Fecha de compra:');
+define('ENTRY_STATUS', 'Estado:');
+define('ENTRY_DATE_LAST_UPDATED', 'Última modificación:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notificar cliente:');
+define('ENTRY_NOTIFY_COMMENTS', 'Añadir comentarios:');
+define('ENTRY_PRINTABLE', 'Imprimir factura');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Eliminar pedido');
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que quiere eliminar este pedido?');
+define('TEXT_INFO_DELETE_DATA', 'Nombre del cliente  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Número de pedido  ');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Devolver productos al almacen');
+define('TEXT_DATE_ORDER_CREATED', 'Añadido el:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Forma de pago:');
+define('TEXT_INFO_ABANDONDED', 'Abandoned');
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> This CCV is not store or has been removed from the store.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'Todos los pedidos');
+define('TEXT_NO_ORDER_HISTORY', 'No hay archivo histórico');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Actualización del pedido');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Número de pedido:');
+define('EMAIL_TEXT_INVOICE_URL', 'Factura detallada:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Fecha del pedido:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Su pedido ha sido actualizado al siguiente estado.' . "\n\n" . 'Nuevo estado: %s' . "\n\n" . 'Por favor responda a este email si tiene alguna pregunta que hacer.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'Los comentarios sobre su pedido son' . "\n\n%s\n\n");
+
+// begin replacement section for Email Subject contribution
+define('EMAIL_TEXT_SUBJECT_1', ' ' . STORE_NAME. ' Order Updated');
+define('EMAIL_TEXT_SUBJECT_2', ':  ');
+
+
+define('ORDER', 'Order #');
+define('ORDER_DATE_TIME', 'Order Date & Time');
+
+// end replacement section for Email Subject contribution
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: No existe pedido.');
+define('SUCCESS_ORDER_UPDATED', 'OK: Pedido actualizado correctamente.');
+define('WARNING_ORDER_NOT_UPDATED', 'Atención: No se ha actualizado el pedido, no había nada que actualizar.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/orders_status.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/orders_status.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/orders_status.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: orders_status.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Estados de pedidos');
+
+define('TABLE_HEADING_ORDERS_STATUS', 'Estados de pedidos');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_EDIT_INTRO', 'Haga los cambios necesarios');
+define('TEXT_INFO_ORDERS_STATUS_NAME', 'Estado de pedido:');
+define('TEXT_INFO_INSERT_INTRO', 'Por favor introduzca el nuevo estado de pedido y los datos relacionados');
+define('TEXT_INFO_DELETE_INTRO', '¿Está seguro de que desea eliminar permanentemente este estado de pedido?');
+define('TEXT_INFO_HEADING_NEW_ORDERS_STATUS', 'Nuevo estado de pedido');
+define('TEXT_INFO_HEADING_EDIT_ORDERS_STATUS', 'Editar estado de pedido');
+define('TEXT_INFO_HEADING_DELETE_ORDERS_STATUS', 'Eliminar estado de pedido');
+
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: El estado de pedido por defecto no se puede eliminar. Establezca otro estado de pedido predeterminado y pruebe de nuevo.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: Este estado de pedido esta siendo usado actualmente.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: Este estado de pedido se esta usando en algún histórico de algún pedido.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/packingslip.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/packingslip.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/packingslip.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: packingslip.php,v 1.3 2004/03/13 15:09:11 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_COMMENTS', 'Comentarios');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modelo');
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+
+define('ENTRY_SOLD_TO', 'VENDIDO A:');
+define('ENTRY_SHIP_TO', 'ENVIAR A:');
+define('ENTRY_PAYMENT_METHOD', 'Forma de pago:');
+
+define('ENTRY_DATE_PURCHASED', 'Fecha de compra:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/pages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: pages.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Pages');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_TITLE', 'Title');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_PAGES_HEADING_DELETE_PAGE', 'Delete Page');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this page?');
+
+define('TEXT_PAGES_CATEGORY', 'Category:');
+define('TEXT_DATE_PAGES_CREATED', 'Date Created:');
+define('TEXT_DATE_PAGES_LAST_MODIFIED', 'Date Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('ENTRY_TITLE', 'Title:');
+define('ENTRY_CATEGORY', 'Category:');
+define('ENTRY_BLURB', 'Blurb:');
+define('ENTRY_BODY', 'Body:');
+define('ENTRY_IMAGE', 'Image:');
+define('ENTRY_META_TITLE', 'Meta Title:');
+define('ENTRY_META_KEYWORDS', 'Meta Keywords:');
+define('ENTRY_META_DESCRIPTION', 'Meta Description:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_SORT_ORDER', 'Sort Order:');
+define('ENTRY_AUTHOR', 'Author:');
+
+define('TEXT_PAGES_ACTIVE', 'Active');
+define('TEXT_PAGES_INACTIVE', 'Inactive');
+
+define('TEXT_NO_CATEGORY', 'No Category');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> pages)');
+
+define('IMAGE_NEW_PAGE', 'New Page');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/pages_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/pages_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/pages_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: pages_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Page Categories');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_PAGES_HEADING_NEW_PAGES_CATEGORY', 'New Category');
+define('TEXT_PAGES_HEADING_EDIT_PAGES_CATEGORY', 'Edit Category');
+define('TEXT_PAGES_HEADING_DELETE_PAGES_CATEGORY', 'Delete Category');
+
+define('TEXT_PAGES_CATEGORY_COUNT', 'Pages:');
+define('TEXT_PAGES_CATEGORY_STATUS', 'Status:');
+define('TEXT_PAGES_CATEGORY_DESCRIPTION', 'Description:');
+define('TEXT_PAGES_CATEGORY_SORT_ORDER', 'Sort Order:');
+define('TEXT_DATE_PAGES_CATEGORY_CREATED', 'Created:');
+define('TEXT_DATE_PAGES_CATEGORY_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_NEW_PAGES_CATEGORIES_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_EDIT_PAGES_CATEGORIES_INTRO', 'Please make any necessary changes');
+define('TEXT_DELETE_PAGES_CATEGORIES_INTRO', 'Are you sure you want to delete this category?');
+
+define('TEXT_PAGES_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_PAGES_CATEGORIES_DESCRIPTION', 'Category Description:');
+define('TEXT_PAGES_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_PAGES_CATEGORIES_SORT_ORDER', 'Sort Order:');
+define('TEXT_PAGES_CATEGORIES_STATUS', 'Status:');
+define('TEXT_PAGES_CATEGORIES_STATUS_ENABLE', 'Enable');
+define('TEXT_PAGES_CATEGORIES_STATUS_DISABLE', 'Disable');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>WARNING:</b> There are %s pages still linked to this category!');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAGES_CATEGORIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> categories)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: popup_data_help.php,v 1.1 $
+  
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Data Input/output Help');
+define('TEXT_INFO_HEADING_NEW_DATA', 'Data Input/output Help');
+
+define('TEXT_INFO_FROOGLE_HEADING_SET_CATEGORIES', 'Categories Help');
+define('TEXT_INFO_FROOGLE_HEADING_CONFIGURE', 'Configure Help');
+define('TEXT_INFO_FROOGLE_HEADING_PRE_FEED', 'Pre Feed Help');
+define('TEXT_INFO_FROOGLE_HEADING_RUN', 'Run Feed Help');
+
+define('TEXT_FROOGLE_SET_CATEGORIES_HELP', 'Run this step the first time you do a Froogle feed. <br> After you have run this the first time do this step only if you have added or changed categories.  This step is very process intense and time consuming for large sites. It will build all of your catagory paths for you.');
+define('TEXT_FROOGLE_CONFIGURE_HELP', 'You can build multiple configuration for the froogle feed. You must have at least one froogle configuration');
+define('TEXT_FROOGLE_PRE_FEED_HELP', 'In this step you will assemble the data into a text file that will be submitted to Froogle. If the process takes more then 1 minute you have a large store or there is a problem.');
+define('TEXT_FROOGLE_RUN_HELP', 'This is the last step. It will submit the feed directly to froogle if you have entered the correct FTP information in the configuration. You must wait 30 minute between submissions');
+
+define('TEXT_INFO_FROOGLE_FEED_NAME', 'Name of Feed Help');
+define('TEXT_INFO_FROOGLE_FEED_DISC', 'Data Feed Discription Help');
+define('TEXT_INFO_FROOGLE_FEED_FILE_TYPE', 'Data Feed File Type Help');
+define('TEXT_INFO_FROOGLE_FEED_TYPE', 'Feed Type Help');
+define('TEXT_INFO_FROOGLE_FEED', '<b>Froogle FTP information</b>');
+define('TEXT_INFO_FROOGLE_FEED_FEED_SERVICE', 'Feed Service Help');
+define('TEXT_INFO_FROOGLE_FEED_STATUS', 'Status Help');
+define('TEXT_INFO_FROOGLE_FEED_FILE', 'File name Help');
+define('TEXT_INFO_FROOGLE_FEED_IMAGE', 'Image URL Help');
+define('TEXT_INFO_FROOGLE_FEED_PRODUCT', 'Product URL Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_SERVER', 'Froogle FTP Server Name Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_USER', 'Froogle FTP User Name Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_PASSWORD', 'Froogle FTP Password Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_DIRECTORY', 'Froogle FTP Directory Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR', 'Use store Currency Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR_USE', 'Other currency Help');
+define('TEXT_INFO_FROOGLE_FEED_LANG', 'Use store languge Help');
+define('TEXT_INFO_FROOGLE_FEED_LANG_USE', 'Other languge Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR_CON', 'Convert Currency Help');
+define('TEXT_INFO_FROOGLE_FEED_TAX', 'Tax Class ID Help');
+
+
+define('TEXT_FROOGLE_FEED_NAME_HELP', 'Enter a unique name for this frogle feed.  You will use this name later in the process to identify this feed configuration..');
+define('TEXT_FROOGLE_FEED_DISC_HELP', 'Enter a short discription to identify this feed configuration. You can also add a few notes here to help discribe this feed');
+define('TEXT_FROOGLE_FEED_FILE_TYPE_HELP', 'Select the type of feed from the drop down. Use product for your normal product listing, Businees is for changing business information. ');
+define('TEXT_FROOGLE_FEED_TYPE_HELP', 'Use basic for a basic feed and advance for advance feed. <br> Note: not all of the advance feed items have been installed.');
+define('TEXT_FROOGLE_FEED_HELP', '<b>Froogle FTP information</b>');
+define('TEXT_FROOGLE_FEED_FEED_SERVICE_HELP', 'Select which feed this configuration is for. Only Froogle feed is installed. ');
+define('TEXT_FROOGLE_FEED_STATUS_HELP', 'Active or Inactive. Inactive configurations will not be available in the data feed page');
+define('TEXT_FROOGLE_FEED_FILE_HELP', 'Type in the file name of the file you want to store your feed in. Its should be unique and not duplicate in other feeds');
+define('TEXT_FROOGLE_FEED_IMAGE_HELP', 'Type in the patch to your product images, it should start from the images directory. <br> Example: http://mysite.com/images/categories/t_4647.jpg would be  categories/ ');
+define('TEXT_FROOGLE_FEED_PRODUCT_HELP', 'This is not used');
+define('TEXT_FROOGLE_FEED_FTP_SERVER_HELP', 'Name of the feed server. For froogle feed leave blank and hedwig.google.com will be used');
+define('TEXT_FROOGLE_FEED_FTP_USER_HELP', 'Enter the FTP user name you entered when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_FTP_PASSWORD_HELP', 'Enter the FTP user password you entered when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_FTP_DIRECTORY_HELP', 'Enter the FTP directory that you were assigned when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_CUR_HELP', 'False: Use the store default currency. If you click on this radio button you will use the default store currency. ');
+define('TEXT_FROOGLE_FEED_CUR_USE_HELP', 'If you checked True in the above line enter the alternete currency code here. It must be a currency code that the service knows.');
+define('TEXT_FROOGLE_FEED_LANG_HELP', 'False: Use store default language indicates that you want to use the store default language.');
+define('TEXT_FROOGLE_FEED_LANG_USE_HELP', 'If you entered true into the above line, Use the drop down box to choose a different language code.');
+define('TEXT_FROOGLE_FEED_CUR_CON_HELP', 'Convert to store currency when the visiter visits your store. Use this is you have multiple currencies in your store.');
+define('TEXT_FROOGLE_FEED_TAX_HELP', 'Enter the tax class ID number from the store or set to zero (0) for no tax caculation');
+
+
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_ep_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_ep_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_ep_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+/*
+  $Id: popup_ep_help.php,v 1.1 $
+  
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Easy Populate Help');
+define('TEXT_INFO_HEADING_NEW_DATA', 'Easy Populate Help');
+
+define('TEXT_HEAD_HELP_EP_FILE_UPLOAD', 'File Up Load Help');
+define('TEXT_HELP_EP_FILE_UPLOAD', 'This allow you to upload the edited EPA file so it can be inputed in to your database.
+                                    There is a limit to the size of file you can upload. Usually this limit is 2mb. This is because of 
+                                    how PHP is usually installed. If this is a problem then try to limit the files size by using the
+                                    Limit number of products to Download options to make your file smaller. 
+                                    If the number of records in the file is more then 300 use the Upload and Split.');
+
+define('TEXT_HEAD_HELP_EP_FILE_UPLOAD_SPLIT', 'File Up Load and Split Help');
+define('TEXT_HELP_EP_FILE_UPLOAD_SPLIT', 'This allow you to upload the edited EPA file and split itinto smaller parts so it can be inputed into your databse.
+                                 As with the regular upload there is a limit on the file size of 2mb. Once you have Uploaded and Split
+                                 the EPA file. Use the " Import Data from file in temp/ " to insert each file into the database. The number or records you set
+                                 in the epconfigure will limit the records in the spilt files. This is done so the program will not time out.');
+
+define('TEXT_HEAD_HELP_EP_FILE_SPLIT', ' Split a EP File on the server');
+define('TEXT_HELP_EP_FILE_SPLIT', 'This allow you to spilt the edited EPA file it into smaller parts, after it has been uploaded to the server, so it can be inputed into your databse.
+                                 Once you have "Split a EP File on the server"
+                                 the EPA file. Use the " Import Data from file in temp/ " to insert each file into the database. The number or records you set
+                                 in the admin/epconfigure.php will limit the records in the spilt files. The current limit is 1,000 records but EPA can handle well over 2,000 records, this should take 3 to 4 minutes to insert. This is done so the program will not time out.');
+
+
+define('TEXT_HEAD_HELP_EP_FILE_INSERT', 'File Insert a File Help');
+define('TEXT_HELP_EP_FILE_INSERT', 'Select a file in the drop down box. This is a list the files that have been uploaded or split in the directory
+                                    You can choosen to store your EPA file on line. The number of records in each split is set in 
+                                    the ep configuration');
+
+define('TEXT_HEAD_HELP_EP_FILE_EXPORT', 'Export a file to edit Help');
+define('TEXT_HELP_EP_FILE_EXPORT', 'In this section you can create a export file to be edited in a spread sheet program. If the export file or resulting
+                                    edited file is over 2mb in size you can use the export controls to limit the the size by limiting the data you export.');
+
+define('TEXT_HEAD_HELP_EP_SELECT_METHOD', 'Select meathod to use for download Help');
+define('TEXT_HELP_EP_SELECT_METHOD', 'Here you can select one of two meathods for downloading your export file. "Download" method
+                                      will create a file to be saved it directly to your local computer. "Save to temp file on server"
+                                      will save the file to the temp directory you set in the ep configure. Later you can use a FTP program to
+                                      download the file');
+
+define('TEXT_HEAD_HELP_EP_SELECT_DOWN', 'Select feild groups to export Help');
+define('TEXT_HELP_EP_SELECT_DOWN', 'In this drop down is listed the pre_defined groups of feild that can be downloaded. Please see the
+                                    documentation for which feilds are in which groups.');
+
+define('TEXT_HEAD_HELP_EP_SELECT_SORT', 'Select sort order for export Help');
+define('TEXT_HELP_EP_SELECT_SORT', 'You can select the order your export rows apears in. This is used to group the rows in your export
+                                    file so they can be found easily. ');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_ROWS', 'Limit rows in your Export file Help');
+define('TEXT_HELP_EP_LIMIT_ROWS', 'This group of settings can be used to limit the size of your export file. This is done
+                                    if your import file is to large or you need to target certain record to be edited.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_CATS', 'Limit rows in your Export file by Categories Help');
+define('TEXT_HELP_EP_LIMIT_CATS', 'This will limit the contents of the export file to a specifice Category. When set to "Top" all
+                                  manufactures will be in the export file. When set to a specific category all sub categories will be included.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_MAN', 'Limit rows in your Export file by Manufacture Help');
+define('TEXT_HELP_EP_LIMIT_MAN', 'This will limit the contents of the export file to a specifice manufacture. When set to "Manufactures" all
+                                  manufacture swill be in the export file.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_PRODUCT', 'Limit rows in your Export file by Product_id Help');
+define('TEXT_HELP_EP_LIMIT_PRODUCT', 'This will limit the contents of the export file to a range of product_id\'s. ');
+
+define('TEXT_HELP_EP_LIMIT_PRODUCT1', '   1. If no product_id\'s are enter all of the product are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT2', '   2. If the begin product_id and no end product_id is entered. Products from the first product id to the end are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT3', '   3. If no beginning product_id\'s aand only and ending product_ID. From the first id to ending the products are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT4', '   4. If the begin product_id and ending product_id is enter then this range of products are in the export file');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_infobox_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_infobox_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/popup_infobox_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: popup_infobox_help.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Ayuda Infobox');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Ayuda Infobox');
+define('TEXT_INFOBOX_HELP_FILENAME', 'Representa el nombre del archivo de panel que ha colocado en su carpeta de <u>catalog/includes/boxes</u>.<br><br> Debe ser en minúsculas, puede tener espacios en vez de usar subrayados (_)<br><br>Por ejemplo:<br>Si su nueva Infobox se llama <b>nuevo_panel.php</b>, escribiría aquí "<b> nuevo panel</b>".<br><br>Otro ejemplo sería el del panel <b>whats_new</b>.<br> Obviamente el archivo se llama <b>whats_new.php </b>, pero podría escribir aquí <b>what\'s new</b>');
+define('TEXT_INFOBOX_HELP_HEADING', 'Esto es lo que se va a ver sobre el panel en su catálogo.<br><div align="center"><img border="0" src="images/help1.gif"><br></div>');
+define('TEXT_INFOBOX_HELP_DEFINE', 'Un ejemplo para esto podría ser: <b>BOX_HEADING_WHATS_NEW</b>.<br> Esto sería utilizado en el flujo principal de la tienda como: <b> define(\'BOX_HEADING_WHATS_NEW\', \'What\'s New?\');</b><br><br> Si abre el archivo <u>catalog/includes/languages/english.php</u> podrá ver cantidad de ejemplos, los que contienen BOX_HEADING ya no son necesarios, ya que ahora están almacenados en la base de datos y definidos en los archivos <b>column_left.php</b> y <b>column_right.php</b>.<br>¡Aunque no hay necesidad de borralos!');
+define('TEXT_INFOBOX_HELP_COLUMN', 'Seleccione <b>izquierda</b> o <b>derecha</b><br> para que el panel se muestre en la columna izquierda o la derecha.<br><br>Por defecto se muestra en la <b>izquierda</b>');
+define('TEXT_INFOBOX_HELP_POSITION', 'Se espera que introduzca un número. Cuanto más alto sea el número, más abajo aparecerá el panel en la columna seleccionada.<br><br> Si introduce el mismo número para más de un panel, se mostrarán en orden alfabético.<br><br>Si no aporta ningún número, entonces se mostrará el panel en orden alfabético.');
+define('TEXT_INFOBOX_HELP_ACTIVE', 'Seleccione <b>sí</b> o <b>no</b> para mostrar (si) o no mostrar (no) el panel.<br><br>El valor por defecto es <b>sí</b>');
+define('TEXT_INFOBOX_HELP_TEMPLATE', 'Debe representar el nombre de archivo del panel, donde están ubicadas las funciones para sus paneles. Si tiene un archivo especial para su función, debe estar en <u>catalog/templates/(nombre de la plantilla)/boxes.tpl.php</u> <br><br> Debe estar en minúsculas.<br><br>Por ejemplo:<br>Su nuevo archivo de función de plantilla de panel es estándar, ponga <b>infobox</b> y utilizará las funciones estándar. Si utiliza funciones especiales para su panel, ponga <b>box.tpl.php</b> aquí y ponga el archivo en <u>catalog/templates/(nombre de la plantilla)/boxes.tpl.php</u>.');
+define('TEXT_INFOBOX_HELP_COLOR', 'Puede utilizar la carta de colores para seleccionar el color para el tipo de letra utilizado en las cabeceras de los paneles, <br> Simplemente pulse sobre el color y el código de color correpondiente aparecerá en el texto..');
+define('TEXT_CLOSE_WINDOW', '<u>Cerrar ventana</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/product_extra_fields.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/product_extra_fields.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/product_extra_fields.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: product_extra_fields.php,v 2.0 2004/11/09 15:07:21 ChBu Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Product Extra Fields');
+define('SUBHEADING_TITLE', 'Add a new field');
+
+define('TABLE_HEADING_FIELDS', 'Field Name');
+define('TABLE_HEADING_ORDER', 'Sort Order');
+define('TABLE_HEADING_LANGUAGE', 'Language');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('IMAGE_ADD_FIELD', 'Add new field');
+define('IMAGE_UPDATE_FIELDS', 'Update fields');
+define('IMAGE_REMOVE_FIELDS', 'Remove selected fields');
+
+define ('TEXT_ALL_LANGUAGES', 'All');

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/product_list_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/product_list_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/product_list_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Product List Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Product List Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADER_EXPLAIN', 'These settings effect all templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Product List configuration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Product List configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/products_attributes.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/products_attributes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/products_attributes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: products_attributes.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_OPT', 'Opciones del producto');
+define('HEADING_TITLE_VAL', 'Valores para opciones');
+define('HEADING_TITLE_ATRIB', 'Atributos');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_PRODUCT', 'Nombre del producto');
+define('TABLE_HEADING_OPT_NAME', 'Nombre de la opción');
+define('TABLE_HEADING_OPT_LANGUAGE', 'Language');
+define('TABLE_HEADING_OPT_TYPE', 'Option Type'); //CLR 031203 add option type column
+define('TABLE_HEADING_OPT_VALUE', 'Valor de la opción');
+define('TABLE_HEADING_OPT_PRICE', 'Precio');
+define('TABLE_HEADING_OPT_PRICE_PREFIX', 'Prefijo (+/-)');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_DOWNLOAD', 'Productos descargables:');
+define('TABLE_HEADING_OPTION_COMMENTS', 'Comments');
+define('TABLE_HEADING_OPT_SIZE', 'Size');
+define('TABLE_TEXT_FILENAME', 'Nombre del fichero:');
+define('TABLE_TEXT_MAX_DAYS', 'Días hasta caducar:');
+define('TABLE_TEXT_MAX_COUNT', 'Número máximo de descargas:');
+
+define('MAX_ROW_LISTS_OPTIONS', 10);
+
+define('TEXT_WARNING_OF_DELETE', 'Esta opción tiene productos y valores enlazados a ella - no es seguro eliminarla.');
+define('TEXT_OK_TO_DELETE', 'Esta opción no esta en uso - es seguro eliminarla.');
+define('TEXT_OPTION_ID', 'ID de opción');
+define('TEXT_OPTION_NAME', 'Nombre de opción');
+define('TEXT_OPTION_SORTORDER', 'Orden');
+
+define('TEXT_OPTION_SELECTION', 'Select a Option');
+
+define('JAVASCRIPT_TEXT_OPTION_TYPE_TEXT', 'Textual Option');
+
+define('SORT_ORDER', 'Sort Order');
+define('PRICE', 'Price');
+define('MISSING', '*** Missing');
+define('GOOD_FILE', 'Good File');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/products_expected.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/products_expected.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/products_expected.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: products_expected.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Próximamente');
+
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_DATE_EXPECTED', 'Fecha de lanzamiento');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_DATE_EXPECTED', 'Fecha de lanzamiento:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/products_multi.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/products_multi.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/products_multi.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+/*
+  $Id: products_multi.php, v 2.0
+
+  autor: sr, 2003-07-31 / sr at ibis-project.de
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Multiple Products Manager');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_CATEGORIES_CHOOSE', 'Choose');
+define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Categories / Products');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('DEL_DELETE', 'delete product');
+define('DEL_CHOOSE_DELETE_ART', 'How to delete?');
+define('DEL_THIS_CAT', 'only in this category');
+define('DEL_COMPLETE', 'delete the complete product');
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_ATTENTION_DANGER', '<br><br><span class="dataTableContentRedAlert">!!! Attention !!! please read !!!</span><br><br><span class="dataTableContentRed">This tool alters the tables "products_to_categories" (and in case of \'delete the complete product\' even "products" and "products_description" among others; cf. function \'tep_remove_product\') - so a backup of these tables before each use of the tool is highly recommended, because:<br><br>This tool deletes, moves or copies all via checkbox selected products without any interim step or warning, that means immediately after clicking on the go-button.</span><br><br><span class="dataTableContentRedAlert">Please take care:</span><ul><li>Pay very great attention when using <strong>\'delete the complete product\'</strong>. This function deletes all selected products immediately, without interim step or warning, and completely from all tables where these products belong to.</strong></li><li>While choosing <strong>\'delete product only in this category\'</strong>, no products are deleted completely, but only their links to the actually opened category - even when it\'s the only category-link of the product, and without warning, that means: be careful with this delete tool as well.</li><li>While <strong>copying</strong>, products are not duplicated, they are only linked to the new category chosen.</li><li>Products are only <strong>moved</strong> resp. <strong>copied</strong> to a new category in case they do not exist there allready.</li></ul>');
+define('TEXT_MOVE_TO', 'move to');
+define('TEXT_CHOOSE_ALL', 'choose all');
+define('TEXT_CHOOSE_ALL_REMOVE', 'remove chosen');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in<br>&nbsp;<br><b>%s</b>');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE', 'Products Price:');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method:');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/removezip.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/removezip.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/removezip.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('ZIP_REMOVE_CHECK', 'Are you sure you want to delete this record?');
+define('ZIP_DELETE_CONFIRM_MESSAGE', 'Record Has Been Deleted');
+define('ZIP_DELETE_ERROR_MESSAGE', 'Unable to Delete Record');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: reviews.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Comentarios');
+
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_RATING', 'Valoración');
+define('TABLE_HEADING_DATE_ADDED', 'Fecha de alta');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('ENTRY_PRODUCT', 'Producto:');
+define('ENTRY_FROM', 'De:');
+define('ENTRY_DATE', 'Fecha:');
+define('ENTRY_REVIEW', 'Comentario:');
+define('ENTRY_REVIEW_TEXT', '<small><font color="#ff0000"><b>NOTA:</b></font></small>&nbsp;¡No se traduce el código HTML!&nbsp;');
+define('ENTRY_RATING', 'Valoración:');
+
+define('TEXT_INFO_DELETE_REVIEW_INTRO', '¿Seguro que desea eliminar este comentario?');
+
+define('TEXT_INFO_DATE_ADDED', 'Fecha de alta:');
+define('TEXT_INFO_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_INFO_IMAGE_NONEXISTENT', 'NO EXISTE LA IMAGEN');
+define('TEXT_INFO_REVIEW_AUTHOR', 'Autor:');
+define('TEXT_INFO_REVIEW_RATING', 'Valoración:');
+define('TEXT_INFO_REVIEW_READ', 'Leído:');
+define('TEXT_INFO_REVIEW_SIZE', 'Tamaño:');
+define('TEXT_INFO_PRODUCTS_AVERAGE_RATING', 'Valoración media:');
+
+define('TEXT_OF_5_STARS', '¡%s de 5 estrellas!');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>BUENO</b></font></small>');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>MALO</b></font></small>');
+define('TEXT_INFO_HEADING_DELETE_REVIEW', 'Eliminar comentario');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/salemaker.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/salemaker.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/salemaker.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: salemaker.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Generador de rebajas');
+
+define('TABLE_HEADING_SALE_NAME', 'Nombre del saldo');
+define('TABLE_HEADING_SALE_DEDUCTION', 'Deducción');
+define('TABLE_HEADING_SALE_DATE_START', 'Fecha de inicio');
+define('TABLE_HEADING_SALE_DATE_END', 'Fecha de remate');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_SALEMAKER_NAME', 'Nombre del saldo:');
+define('TEXT_SALEMAKER_DEDUCTION', 'Deducción:');
+define('TEXT_SALEMAKER_DEDUCTION_TYPE', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tipo:&nbsp;&nbsp;');
+define('TEXT_SALEMAKER_PRICERANGE_FROM', 'Rango de precio del producto:');
+define('TEXT_SALEMAKER_PRICERANGE_TO', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
+define('TEXT_SALEMAKER_SPECIALS_CONDITION', 'Si un producto está en oferta:');
+define('TEXT_SALEMAKER_DATE_START', 'Fecha de inicio:');
+define('TEXT_SALEMAKER_DATE_END', 'Fecha de remate:');
+define('TEXT_SALEMAKER_CATEGORIES', '<b>O</b> compruebe las categorías a las que se aplica esta rebaja:');
+define('TEXT_SALEMAKER_POPUP', '<a href="javascript:session_win();"><span class="errorText"><b>Pulse aquí para consejos sobre cómo usar el generador de rebajas.</b></span></a>');
+define('TEXT_SALEMAKER_IMMEDIATELY', 'Inmediatamente');
+define('TEXT_SALEMAKER_NEVER', 'Nunca');
+define('TEXT_SALEMAKER_ENTIRE_CATALOG', 'Marque esta casilla si quiere que la rebaja se aplique a <b>todos los productos</b>:');
+define('TEXT_SALEMAKER_TOP', 'Catálogo entero');
+
+define('TEXT_INFO_DATE_ADDED', 'Fecha añadida:');
+define('TEXT_INFO_DATE_MODIFIED', 'Última modificación:');
+define('TEXT_INFO_DATE_STATUS_CHANGE', 'Último cambio de estado:');
+define('TEXT_INFO_SPECIALS_CONDITION', 'Condición de oferta:');
+define('TEXT_INFO_DEDUCTION', 'Deducción:');
+define('TEXT_INFO_PRICERANGE_FROM', 'Rango de precio:');
+define('TEXT_INFO_PRICERANGE_TO', ' a ');
+define('TEXT_INFO_DATE_START', 'Comienza:');
+define('TEXT_INFO_DATE_END', 'Termina:');
+
+define('SPECIALS_CONDITION_DROPDOWN_0', 'Ignorar el precio de oferta');
+define('SPECIALS_CONDITION_DROPDOWN_1', 'Ignorar la condición de rebaja');
+define('SPECIALS_CONDITION_DROPDOWN_2', 'Aplicar la deducción de la rebaja a los productos en oferta');
+
+define('DEDUCTION_TYPE_DROPDOWN_0', 'Deducir cantidad');
+define('DEDUCTION_TYPE_DROPDOWN_1', 'Porcentaje');
+define('DEDUCTION_TYPE_DROPDOWN_2', 'Nuevo precio');
+
+define('TEXT_INFO_HEADING_COPY_SALE', 'Copiar rebaja');
+define('TEXT_INFO_COPY_INTRO', 'Introduzca un nombre para la copia de<br>&nbsp;&nbsp;"%s"');
+
+define('TEXT_INFO_HEADING_DELETE_SALE', 'Eliminar rebaja');
+define('TEXT_INFO_DELETE_INTRO', '¿Está seguro de que quiere eliminar de forma permanente esta rebaja?');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/salemaker_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/salemaker_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/salemaker_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: salemaker_info.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Generador de rebajas');
+define('SUBHEADING_TITLE', 'Consejos para el uso del generador de rebajas:');
+define('INFO_TEXT', '<ul>
+                      <li>
+                        Use siempre un \'.\' como punto decimal en las deducciones y en el rango de precios.
+                      </li>
+                      <li>
+                        Introduzca las cantidades en la misma moneda con que lo haría al crear o editar un producto.
+                      </li>
+                      <li>
+                        En los campos de deducción, puede introducir la cantidad o el porcentaje a deducir,
+                        o un precio nuevo para reemplazar el existente. (p.e. deducir 5.00€ de todos los precios, deduccir un 10% de
+                        todos los precios o cambiar todos los precios a 25.00€)
+                      </li>
+                      <li>
+                        Introduciendo un rango de precios se estrecha el rango de productos que resultarán afectados. (p.e.
+                        productos desde 50.00€ a 150.00€)
+                      </li>
+                      <li>
+                        Debe escoger la acción a tomar si el producto está en oferta <i>y</i> es objeto de esta rebaja:
+            <ul>
+                          <li>
+                            Ignorar el precio de oferta<br>
+              La deducción por rebaja será aplicada al precio original del producto.
+                            (p.e. Precio original 10.00€, Precio en oferta 9.50€, condición de rebaja de 10%.
+              El precio final del producto mostrará 9.00€ en rebaja. El precio de oferta se ignora.)
+                          </li>
+                          <li>
+                            Ignorar condición de rebaja<br>
+                            La condición de rebaja no se aplicará a los productos en oferta. El precio de los productos en oferta se mostrará
+                            como cuando no hay ninguna rebaja. (p.e. Precio original 10.00€, precio de oferta 9.50€,
+                            condición de rebaja de 10%. El precio final del producto mostrará 9.50€ en rebaja.
+                            Se ignora la condición de rebaja.)
+                          </li>
+                          <li>
+                            Aplicar la condición de rebaja al precio en oferta<br>
+                            La deducción por rebaja se aplicará al precio de los productos en oferta. Se mostrará el precio combinado.
+                            (p.e. Precio original 10.00€, precio en oferta 9.50€, condición de rebaja de 10%. El precio final del 
+                            del producto mostrará 8.55€. Un 10% más de descuento sobre el precio de oferta.)
+                          </li>
+                        </ul>
+                      </li>
+                      <li>
+                        Dejar la fecha de inicio vacía hará que la oferta empiece inmediatamente.
+                      </li>
+                      <li>
+                        Dejar la fecha de remate vacía hará que la oferta dure indefinidamente.
+                      </li>
+                      <li>
+                        Marcar una categoría automáticamente incluye las sub-categorías.
+                      </li>
+                    </ul>');
+define('TEXT_CLOSE_WINDOW', '[ Cerrar ventana ]');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/server_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/server_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/server_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: server_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Información del servidor');
+
+define('TITLE_SERVER_HOST', 'Nombre del servidor:');
+define('TITLE_SERVER_OS', 'Sistema Operativo del servidor:');
+define('TITLE_SERVER_DATE', 'Fecha en el servidor:');
+define('TITLE_SERVER_UP_TIME', 'Funcionando desde:');
+define('TITLE_HTTP_SERVER', 'Servidor HTTP:');
+define('TITLE_PHP_VERSION', 'Versión del PHP:');
+define('TITLE_ZEND_VERSION', 'Zend:');
+define('TITLE_DATABASE_HOST', 'Servidor de base de datos:');
+define('TITLE_DATABASE', 'Base de datos:');
+define('TITLE_DATABASE_DATE', 'Fecha de la base de datos:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+define('HEADING_TITLE','ShipWire World Class Fullfillment Services');
+define('CONTENT_TEXT1','<div ALIGN="center"><table BORDER="0" CELLPADDING="0" STYLE="border-collapse: collapse" WIDTH="100%" ID="table1"><tr><td style="padding-right:20px"><FONT face="arial, helvetica, sans-serif"><table border="0" width="100%" id="table744" cellspacing="0" cellpadding="0"><tr><td width="630" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                    '<span class="main"><b>Receive, store, and ship merchandise right from CRE Loaded!</b></span><br><span class="smallText">100% integrated with your CRE Loaded application, our Shipwire module sends orders from CRE Loaded directly to your Shipwire fulfillment center. Take advantage of Shipwire’s volume discounts and have your orders automatically packaged and shipped, often for less than the cost of standard shipping.</span>' . 
+                                    '<p><span class="main"><b>What is Shipwire?</b></span><br><span class="smallText">Shipwire is a popular order fulfillment service that allows you to store merchandise in massive Chicago and Los Angeles warehouses. Then as each order comes into your online store, Shipwire will pack and ship it for you.</p>' . 
+                                    '<p><span class="smallText">You can add a Shipwire account with just a few clicks of the mouse - no programming involved. If you\'re just starting out, or looking for a better way to manage your shipping and handling, Shipwire offers an easy and quick way to outsource shipping with no startup, receiving, storage or packaging fees. You just pay $79.95 a month, plus a Shipwire handling fee on the merchandise that they ship. Handling fees range from $1 to $1.50 an item and depend on the type of handling your product needs. </span></p>' . 
+                                    '<p><span class="smallText">With Shipwire, your customers can receive merchandise anywhere in the world, serviced by the USPS, UPS or one of our freight partners. With facilities shipping more than 200,000 orders a month, they can customize your merchandise with assembly and kitting services at extremely affordable prices.</span></p>' .
+                                    '<p><span class="smallText">Shipwire makes it simple to automate order fulfillment on your site: Get approved in 24 hours. As soon as you enter your SKU information and send them your initial inventory, they can start shipping your orders.</span></p>' . 
+                                    '<p><span class="smallText">Shipwire makes extensive efforts to help you accurately monitor shipping and handling costs. Shipwire\'s reporting tools help you understand your inbound and outbound shipping, and automate time-consuming bookkeeping tasks.</span></p>');
+
+define('CONTENT_TEXT2','<span class="smallText"><p>Check out our <a TARGET="_blank" HREF="http://www.creloaded.com/Add-Ons/c22/p77/Shipwire_Pro_Checkout_Success_Module_-_Now_Handles_Mixed_Orders/product_info.html"><b>Shipwire Pro Checkout Success Module</b></a>, which allows you to manage mixed orders; send only those products you choose via Shipwire from a successful order.</span>' .
+                                     '<br>&nbsp;</p></td><td width="30" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">&nbsp;</td><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:13px;font-family:Arial; color:#000002">' . 
+                                     '<span class="lb08"><img src="images/pixel_trans.gif" width="20" height="30" /><table border="0" cellpadding="0" cellspacing="0" id="table745" width="190"><tr style="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '<td width="5" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="5" height="1" alt=""></td><td width="87%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="166" height="1" alt=""></td><td width="5" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="5" height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002" >' . 
+                                     '<img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr style="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">');
+
+define('CONTENT_TEXT3','<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '</tr><tr><td bgcolor="#CFCFCF" height="40" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif"><td height="40" bgcolor="#E7EFFF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="5" height="1" alt=""></td></FONT>' .
+                                     '<td class="body" height="40" bgcolor="#E7EFFF" colspan="8"><p style="margin-top: 4px; margin-bottom: 4px"><font face="Arial" color="#003399" style="font-size: 16pt">Basic</font></p><p style="margin-top: 4px; margin-bottom: 4px"><span style="font-weight: 700"> <font face="Arial" size="3" color="#666666">$79.95/mo</font></span></td><font face="arial, helvetica, sans-serif">' .
+                                     '<td bgcolor="#CFCFCF" height="40" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></FONT></tr><tr><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>  <td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr><td bgcolor="#CFCFCF" height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '<td height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="7" height="1" alt=""></td><td class="body" height="25" colspan="8"><br><font color="#666666">No setup fee,<br>$1 to $1.50 handling fee</font><font color="#003399"><br>&nbsp;</font><table cellpadding="0" cellspacing="0" border="0" id="table746">' .
+                                     '<tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table747"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table748"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt">');
+
+define('CONTENT_TEXT4','<img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Easy setup with your store</font></span></span></font></td>' .
+                                     '</tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table749"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table750"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '  <FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002">' .
+                                     '<span class="lb08"><font face="Arial" color="#666666">Online inventory manager</font></span></span></font></td></tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table751"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table752">' .
+                                     '<tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Sell up to 50 items</font></span></span></font></td></tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table753"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<table border="0" width="100%" cellspacing="0" cellpadding="0" id="table754"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td>');
+
+define('CONTENT_TEXT5','<td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Unlimited email support</font></span></span></font></td></tr></table></td></tr></table><p ALIGN="center"><span style="font-family: Verdana; font-size: 10px; color:#000002">' .
+                                     '<font face="Arial" size="2" color="#000000"><a TARGET="_blank" HREF="http://www.shipwire.com/exec/creloaded.php?ref=6133361"><input type="button" value="Free Sign Up" onclick="\'document.location.href=create_account.php\'" style="font-family:Arial; font-size:13px; "></a>&nbsp;&nbsp;&nbsp; </font></span><br><br>&nbsp;&nbsp;</p></td><td bgcolor="#CFCFCF" height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif"><td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif" size="2"><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"></FONT></FONT></tr></table></span></span></font></td></tr></table></font></td></tr></table></div>');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/shopbyprice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/shopbyprice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/shopbyprice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: tax_classes.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Comprar por precio');
+
+define('TABLE_HEADING_OPTIONS', 'Opciones para comprar por precio');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_OPTION_1', 'Opciones para comprar por precio');
+define('TEXT_INFO_OPTION_2', 'Rangos para comprar por precio');
+
+define('TEXT_EDIT_HEADING_OPTIONS', 'Opciones:');
+define('TEXT_EDIT_OPTIONS_INTRO', 'Fijar el número de rangos que se soportarán.  Puede incluír opcionalmente un rango "y superior".');
+define('TEXT_EDIT_ERROR_RANGES', 'El campo de rangos debe ser numérico.');
+
+define('TEXT_EDIT_HEADING_RANGE', 'Rangos:');
+define('TEXT_EDIT_RANGE_INTRO', 'Los límites de los rangos deben ser en orden ascendente.');
+define('TEXT_EDIT_ERROR_RANGE', 'Los campos de los rangos no están en orden ascendente.');
+define('TEXT_EDIT_ERROR_NUMERIC', 'Un campo de rangos no es numérico.');
+
+define('TEXT_INFO_RANGES', 'Rangos de selección:');
+define('TEXT_INFO_OPTIONS_DESCRIPTION', 'Ajustar los rangos a 0 para desconectar esta posibilidad.');
+define('TEXT_INFO_OVER', 'Generación automática sobre rangos:');
+
+define('TEXT_INFO_ZERORANGE', 'Esta función está desconectada.  Actívela fijando el número de rangos a un valor por encima de cero.');
+define('TEXT_INFO_NORANGE', 'No se ha introducido ninguna información de rango.');
+define('TEXT_INFO_UNDER', 'Por debajo de&nbsp;');
+define('TEXT_INFO_FROM', 'Desde&nbsp;');
+define('TEXT_INFO_TO', '&nbsp;hasta&nbsp;');
+define('TEXT_INFO_ABOVE', '&nbsp;y superior');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/specials.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: specials.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Ofertas');
+
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_PRODUCTS_PRICE', 'Precio');
+define('TABLE_HEADING_STATUS', 'Estado');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_SPECIALS_PRODUCT', 'Producto:');
+define('TEXT_SPECIALS_SPECIAL_PRICE', 'Precio de oferta:');
+define('TEXT_SPECIALS_EXPIRES_DATE', 'Fecha de caducidad:');
+define('TEXT_SPECIALS_PRICE_TIP', '<b>Notas para ofertas:</b><ul><li>Puede introducir un porcentaje de reducción del precio del producto, por ejemplo: <b>20%</b></li><li>Si por el contrario, introduce un precio de oferta debe de usar el punto como separador decimal \'.\' (punto decimal), por ejemplo: <b>49.99</b></li><li>Deje la fecha de caducidad vacía si no quiere caducidad</li></ul>');
+
+define('TEXT_INFO_DATE_ADDED', 'Fecha de alta:');
+define('TEXT_INFO_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_INFO_NEW_PRICE', 'Nuevo precio:');
+define('TEXT_INFO_ORIGINAL_PRICE', 'Precio original:');
+define('TEXT_INFO_PERCENTAGE', 'Porcentaje:');
+define('TEXT_INFO_EXPIRES_DATE', 'Fecha de caducidad:');
+define('TEXT_INFO_STATUS_CHANGE', 'Cambio de estado:');
+
+define('TEXT_INFO_HEADING_DELETE_SPECIALS', 'Eliminar oferta');
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que desea eliminar este precio de oferta?');
+// Eversun mod for sppc and qty price breaks
+define('TEXT_SPECIALS_GROUPS', 'Customer Group:');
+// Eversun mod end for sppc and qty price breaks
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/specialsbycategory.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/specialsbycategory.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/specialsbycategory.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: specialsbycategory.php,v 1.0 2005/04/24 23:41:21 calimeross Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('HEADING_TITLE', 'Specials by Category');
+define('TEXT_SELECT_CAT', 'First Select Category');
+define('TEXT_SELECT_MAN', '<br>and/or Manufacturer');
+define('TEXT_ENTER_DISCOUNT','Enter Your Discount');
+define('TEXT_PCT_AND','% and');
+define('TEXT_BUTTON_SUBMIT', 'Submit');
+
+define('TEXT_INSTRUCT_1','Leaving discount blank will show all products in selected category.');
+define('TEXT_INSTRUCT_2','Entering 0 discount will remove all specials in selected category.');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_PRODUCTS_PRICE', 'Products Price');
+define('TABLE_HEADING_SPECIAL_PRICE', 'Special Price');
+define('TABLE_HEADING_PCT_OFF', '%Off');
+define('TABLE_HEADING_FULL_PRICE', 'Full Price');
+
+define('TEXT_BUTTON_UPDATE', 'Update');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_articles_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_articles_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_articles_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_articles_viewed.php,v 1.5 2005/03/01 15:51:03 info at bridegroompress.com Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Best Viewed Articles');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_ARTICLES', 'Articles');
+define('TABLE_HEADING_VIEWED', 'Viewed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_credits.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_credits.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_credits.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.9 2002/03/30 15:03:59 harley_vb Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Credit Stats');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_CUSTOMERS', 'Customer');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Credit');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Total de pedidos por cliente');
+
+define('TABLE_HEADING_NUMBER', 'Número');
+define('TABLE_HEADING_CUSTOMERS', 'Clientes');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Total comprado');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_customers_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_customers_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_customers_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: stats_customers_orders.php,v 1.2 24 mars 2004 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  originally developed by xaglo
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE', 'Estad&iacute;sticas clientes');
+define('HEADING_MONTH', 'Fijar para el mes:');
+define('HEADING_YEAR', 'Fijar por el a&ntilde;o:');
+define('HEADING_NUMBER_ORDERS', 'M&iacute;nimo de<br> compras:');
+define('HEADING_TITLE_NO_STATUS', 'Enmascarar los encargos:');
+define('HEADING_TITLE_STATUS', 'Fijar s&oacute;lo los encargos:');
+define('TEXT_NO_ORDERS', 'Ninguno');
+define('TEXT_ALL_ORDERS', 'Ellas todas');
+define('TEXT_ALL_MOIS', 'Todos los meses ');
+define('TEXT_ALL_ANNEE', 'Todos los a&ntilde;os');
+define('NEW_CUSTOMERS', 'Nuevos clientes:');
+define('NUMBER_ORDER', 'Cantidad de encargos:');
+define('CUSTOMERS_BOUGHT', 'Clientes que han comprado:');
+define('NEW_CUSTOMERS_BOUGHT', 'Nuevos clientes que han comprado:');
+define('TEXT_MINI_ORDERED', 'Clientes que ya han hecho por lo menos <b> %s </b> compra:');
+define('TOTAL_TTC', 'Total ventas IVA incluido:');
+define('TOTAL_TAX', 'Total IVA:');
+define('TOTAL_SHIPPING', 'Fresco total de env&iacute;o:');
+define('TOTAL_HT', 'Total venta IVA Excluido:');
+define('BASKET_TTC', 'Venta media  IVA incluido:');
+define('BASKET_HT', 'Cesta media, art&iacute;culos IVA Excluido::');
+define('JAN', 'Enero');
+define('FEV', 'Febrero');
+define('MAR', 'Marzo');
+define('AVR', 'Abril');
+define('MAI', 'Mayo');
+define('JUN', 'Junio');
+define('JUI', 'Julio');
+define('AOU', 'Agosto');
+define('SEP', 'Septiembre');
+define('OCT', 'Octubre');
+define('NOV', 'Noviembre');
+define('DEC', 'Diciembre');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_daily_products_sales_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_daily_products_sales_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_daily_products_sales_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  Written by Marc Sauton, September 2004
+  Daily Product Report Contribution for the OsCommerce Community
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Daily products sales report');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_ORDER_QUANTITY', 'Order Quantity');
+define('TABLE_HEADING_PRODUCT_NAME', 'Product Name');
+define('TABLE_HEADING_PRODUCT_MODEL', 'Product Model');
+define('TABLE_HEADING_UNITPRICE', 'Unit Price');
+define('TABLE_HEADING_PRODUCT_QUANTITY', 'Product Quantity');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Total Purchased');
+
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> customers)');
+define('TEXT_BUTTON_REPORT_SAVE','Save CSV');
+
+define('TABLE_DAILY_VALUE', 'Daily Value: ');
+define('DISPLAY_ANOTHER_REPORT_DATE', 'Display another report for this date: ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_monthly_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_monthly_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_monthly_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,105 @@
+<?php
+/*
+  $Id: stats_monthly_sales.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Ventas mensuales/Resumen de impuestos');
+define('HEADING_TITLE_STATUS','Estado');
+define('HEADING_TITLE_REPORTED','Informado');
+define('TEXT_DETAIL','Detalle');
+define('TEXT_ALL_ORDERS', 'Todos los pedidos');
+define('TEXT_NOTHING_FOUND', 'No se ha encontrado nada en esta fecha/selección');
+define('TEXT_BUTTON_REPORT_BACK','Atrás');
+define('TEXT_BUTTON_REPORT_INVERT','Invertir');
+define('TEXT_BUTTON_REPORT_PRINT','Imprimir');
+define('TEXT_BUTTON_REPORT_HELP','Ayuda');
+define('TEXT_BUTTON_REPORT_SAVE','Guardar CSV');
+define('TEXT_BUTTON_REPORT_BACK_DESC', 'Volver a resumen por meses');
+define('TEXT_BUTTON_REPORT_INVERT_DESC', 'Invertir las filas de arriba a abajo');
+define('TEXT_BUTTON_REPORT_PRINT_DESC', 'Mostrar el informe en formato imprimible');
+define('TEXT_BUTTON_REPORT_HELP_DESC', 'Sobre este informe y cómo utilizar sus posibilidades');
+define('TEXT_BUTTON_REPORT_GET_DETAIL', 'Pulsar para ver un informe diario de este mes');
+define('TEXT_REPORT_DATE_FORMAT', 'j M Y -   g:i a'); // date format string
+//  as specified in php manual here: http://www.php.net/manual/en/function.date.php
+
+define('TABLE_HEADING_YEAR','Año');
+define('TABLE_HEADING_MONTH', 'Mes');
+define('TABLE_HEADING_DAY', 'Días');
+define('TABLE_HEADING_INCOME', 'Ingresos<br> brutos');
+define('TABLE_HEADING_SALES', 'Ventas de<br> productos');
+define('TABLE_HEADING_NONTAXED', 'Ventas<br> exentas');
+define('TABLE_HEADING_TAXED', 'Ventas<br> sujetas a impuestos');
+define('TABLE_HEADING_TAX_COLL', 'Impuestos<br> pagados');
+define('TABLE_HEADING_SHIPHNDL', 'Portes<br> & Manipulación');
+define('TABLE_HEADING_SHIP_TAX', 'Tax on<br /> Shipping');
+define('TABLE_HEADING_LOWORDER', 'Pagos <br> menores');
+define('TABLE_HEADING_OTHER', 'Cheques<br> regalo');  // could be any other extra class value
+define('TABLE_FOOTER_YTD','YTD');
+define('TABLE_FOOTER_YEAR','AÑO');
+define('TEXT_HELP', '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title>Ventas mensuales/Resumen de impuestos</title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<BODY>
+<center>
+<table width="95%"><tr><td>
+<p class="main" align="center">
+<b>Como ver y utilizar el informe de ingresos de la tienda</b>
+<p class="main" align="justify">
+<b>Informes mensuales de la tienda</b>
+<p class="smallText" align="justify">
+Cuando se selecciona desde el menú de informes, este informe muestra un resumen financiero de todos los pedidos en la base de datos de la tienda, por meses.  Cada mes en el histórico de la tienda se totaliza en un fila, mostrando los beneficios y sus componentes, y listando las cantidades de impuestos, cargos por portes y manipulación, pequeños pagos y cheques regalo. (Si la tienda no tiene activados los cheques regalo o los pequeños gastos, se omiten estas columnas.) Se informa de las actividades a fecha de compra.
+<p class="smallText" align="justify">
+La fila superior es el mes en curso, y las filas siguientes totalizan el histórico de pedidos de cada mes.  Bajo las filas de cada año del calendario hay una línea al pie, resumiendo los totales de ese año en cada columna del informe.
+<p class="smallText" align="justify">
+Para invertir el orden de las filas, pulse el botón "Invertir".
+<p class="main" align="justify">
+<b>Informe de resumen mensual por días</b>
+<p class="smallText" align="justify">
+El resumen de la actividad diaria dentro de cada mes se puede ver pulsando en el nombre del mes, a la izquierda de la fila.  Para volver al resumen diario desde el resumen mensual, pulse el botón de "Atrás" en la pantalla de diario.
+<p class="main" align="justify">
+<b>Qué representan las columnas (explicación de las cabeceras)</b>
+<p class="smallText" align="justify">
+A la izquierda, se muestran el mes y el año de cada fila.  Las otras columnas son, de izquierda a derecha:
+<ul><li class="smallText"><b>Ingresos brutos</b> - total de todos los pedidos
+<li class="smallText"><b>Subtotal de pedidos</b> - Ventas totales de productos comprados en el mes
+<br>Entonces, las ventas de productos están partidas en dos categorías:
+<li class="smallText"><b>Ventas exentas de impuestos</b> - el subtotal de las ventas exentas de impuestos, y
+<li class="smallText"><b>Ventas con impuestos</b> - el subtotal de las ventas con impuestos
+<li class="smallText"><b>Impuestos cobrados</b> - cantidad ingresada de los clientes por impuestos
+<li class="smallText"><b>Portes & Manipulación</b> - el total cobrado en concepto de portes y manipulación
+<li class="smallText"><b>Pequeños gastos</b> y <b>Cheques regalo</b> - si la tienda tiene activados los pequeños gastos, y/o los cheques regalos, se muestran los totales en columnas separadas
+<li class="smallText"><b>Low order fees</b> and <b>Gift Vouchers</b> - if the store has low order fees enabled, and/or gift vouchers, the totals of these are shown in separate columns
+</ul>
+<p class="main" align="justify">
+<b>Seleccionar informe resumen por estado</b>
+<p class="smallText" align="justify">
+Para mostrar el resumen de información diaria o mensual para sólo un estado de pedidos, seleccionar el estado en el selector arriba a la derecha de la ventana de informes.  Dependiendo de los ajustes en la tienda para estos valores, puede haber estados para "Pendiente" o "Enviado" por ejemplo.  Si el estado cambia el informe será recalculado y mostrado.
+<p class="main" align="justify">
+<b>Mostrar los impuestos en detalle</b>
+<p class="smallText" align="justify">
+La cantidad del impuesto en cualquier fila del informe es un enlace a una ventana nueva, que mostrará el nombre de los tipos de impuesto cargados y sus cantidades individuales.
+<p class="main" align="justify">
+<b>Imprimir el informe</b>
+<p class="smallText" align="justify">
+Para ver el informe en formato imprimible, pulse en el botón de "Imprimir", utilice entonces el comando imprimir de su navegador en el menú de Archivo.  Se añaden encabezados y el nombre de la tienda para mostrar qué pedidos están seleccionados, y cuando se generó el informe.
+<p class="main" align="justify">
+<b>Guardar los valores del informe en un archivo</b>
+<p class="smallText" align="justify">
+Para guardar los valores del informe en un archivo local, pulse el botón de "Guardar CSV" en la parte baja del informe.  Los valores del informe se enviarán al navegador en un archivo de texto, y se le preguntará dónde quiere guardarlo.  Los contenidos del archivo están en formato de valores separados por comas (CSV), con una línea por cada fila del informe comenzando con el encabezado, y cada valor en la fila está separado por comas. Este archivo se puede importar de forma conveniente en aplicaciones de hoja de cálculo o estadística, como Excel y QuattroPro. El archivo se sirve al navegador con un nombre de archivo que proviene del nombre del informe, estado seleccionado, y la fecha y hora. <br><br>
+<p class="smallText">v 2.1.1
+</td></tr>
+</table>
+</BODY>
+</HTML>');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_not_valid_users.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_not_valid_users.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_not_valid_users.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id:$
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+
+ define('TABLE_HEADING_DELETE', 'Delete');
+ define('TABLE_HEADING_ID', 'Customer ID');
+ define('TABLE_HEADING_CUSTOMERS', 'Username');
+ define('TABLE_HEADING_EMAIL', 'Email');
+ define('TABLE_HEADING_LAST_LOGON', 'Last login');
+ define('HEADING_TITLE', 'Customers Not Validated');
+ define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+ define('SIU_BACK', 'Back');
+ define('SIU_DELETE', 'Delete!');
+ define('SIU_CUSTOMER_DELETED', 'Customer %s deleted!');
+ define('SURE_TO_DELETE', 'Are you sure you want to delete the user %s?');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_notifications.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: stats_products_viewed.php,v 1.1 2003/05/16 00:10:05 ft01189 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Products Notifications');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_COUNT', 'Notifications Count');
+define('TABLE_HEADING_NAME', 'Customers Name');
+define('TABLE_HEADING_EMAIL', 'Customers Email Address');
+define('TABLE_HEADING_DATE', 'Notification Set on');
+define('TEXT_DESCRIPTION', 'Allows you to see the number of customer notifications per product. Click on product name to see details. ');
+define('TEXT_DESCRIPTION_TO', 'Allows you to see the customers that wanted to be notified for ');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_purchased.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_purchased.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_purchased.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_products_purchased.php,v 1.1.1.1 2004/03/04 23:40:13 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Productos más comprados');
+
+define('TABLE_HEADING_NUMBER', 'Número');
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_PURCHASED', 'Comprados');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_products_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_products_viewed.php,v 1.1.1.1 2004/03/04 23:40:13 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Productos más vistos');
+
+define('TABLE_HEADING_NUMBER', 'Número');
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_VIEWED', 'Visto');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_sales_report2.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_sales_report2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/stats_sales_report2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.9 2002/03/30 15:03:59 harley_vb Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('REPORT_DATE_FORMAT', 'm. d. Y');
+
+define('HEADING_TITLE', 'Sales Report');
+
+define('REPORT_TYPE_YEARLY', 'Yearly');
+define('REPORT_TYPE_MONTHLY', 'Monthly');
+define('REPORT_TYPE_WEEKLY', 'Weekly');
+define('REPORT_TYPE_DAILY', 'Daily');
+define('REPORT_START_DATE', 'from date');
+define('REPORT_END_DATE', 'to date (inclusive)');
+define('REPORT_DETAIL', 'detail');
+define('REPORT_MAX', 'show top');
+define('REPORT_ALL', 'all');
+define('REPORT_SORT', 'sort');
+define('REPORT_EXP', 'export');
+define('REPORT_SEND', 'send');
+define('EXP_NORMAL', 'normal');
+define('EXP_HTML', 'HTML only');
+define('EXP_CSV', 'CSV');
+
+define('TABLE_HEADING_DATE', 'Date');
+define('TABLE_HEADING_ORDERS', '#Orders');
+define('TABLE_HEADING_ITEMS', '#Items');
+define('TABLE_HEADING_REVENUE', 'Revenue');
+define('TABLE_HEADING_SHIPPING', 'Shipping');
+
+define('DET_HEAD_ONLY', 'no details');
+define('DET_DETAIL', 'show details');
+define('DET_DETAIL_ONLY', 'details with amount');
+
+define('SORT_VAL0', 'standard');
+define('SORT_VAL1', 'description');
+define('SORT_VAL2', 'description desc');
+define('SORT_VAL3', '#Items');
+define('SORT_VAL4', '#Items desc');
+define('SORT_VAL5', 'Revenue');
+define('SORT_VAL6', 'Revenue desc');
+
+define('REPORT_STATUS_FILTER', 'Status');
+
+define('SR_SEPARATOR1', ';');
+define('SR_SEPARATOR2', ';');
+define('SR_NEWLINE', '\n\r');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/tax_classes.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/tax_classes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/tax_classes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: tax_classes.php,v 1.1.1.1 2004/03/04 23:40:13 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Tipos de impuestos');
+
+define('TABLE_HEADING_TAX_CLASSES', 'Tipos de impuestos');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_EDIT_INTRO', 'Haga los cambios necesarios');
+define('TEXT_INFO_CLASS_TITLE', 'Nombre del impuesto:');
+define('TEXT_INFO_CLASS_DESCRIPTION', 'Descripción:');
+define('TEXT_INFO_DATE_ADDED', 'Creado:');
+define('TEXT_INFO_LAST_MODIFIED', 'Modificado:');
+define('TEXT_INFO_INSERT_INTRO', 'Introduzca los datos del nuevo tipo de impuesto');
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que desea eliminar este tipo de impuesto?');
+define('TEXT_INFO_HEADING_NEW_TAX_CLASS', 'Nuevo tipo de impuesto');
+define('TEXT_INFO_HEADING_EDIT_TAX_CLASS', 'Editar tipo de impuesto');
+define('TEXT_INFO_HEADING_DELETE_TAX_CLASS', 'Eliminar tipo de impuesto');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/tax_rates.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/tax_rates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/tax_rates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: tax_rates.php,v 1.1.1.1 2004/03/04 23:40:13 ccwjr Exp $
+  Trasnlated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Porcentajes de impuestos');
+
+define('TABLE_HEADING_TAX_RATE_PRIORITY', 'Prioridad');
+define('TABLE_HEADING_TAX_CLASS_TITLE', 'Tipo de impuesto');
+define('TABLE_HEADING_COUNTRIES_NAME', 'País');
+define('TABLE_HEADING_ZONE', 'Zona');
+define('TABLE_HEADING_TAX_RATE', 'Porcentaje');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_EDIT_INTRO', 'Haga los cambios necesarios');
+define('TEXT_INFO_DATE_ADDED', 'Fecha de alta:');
+define('TEXT_INFO_LAST_MODIFIED', 'Última modificación:');
+define('TEXT_INFO_CLASS_TITLE', 'Nombre del porcentaje:');
+define('TEXT_INFO_COUNTRY_NAME', 'País:');
+define('TEXT_INFO_ZONE_NAME', 'Zona:');
+define('TEXT_INFO_TAX_RATE', 'Porcentaje (%):');
+define('TEXT_INFO_TAX_RATE_PRIORITY', 'Impuestos con la misma prioridad se suman, los demás se aplican sucesivamente.<br><br>Prioridad:');
+define('TEXT_INFO_RATE_DESCRIPTION', 'Descripción:');
+define('TEXT_INFO_INSERT_INTRO', 'Introduzca un nombre y los datos del nuevo porcentaje');
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que desea eliminar este porcentaje?');
+define('TEXT_INFO_HEADING_NEW_TAX_RATE', 'Nuevo porcentaje');
+define('TEXT_INFO_HEADING_EDIT_TAX_RATE', 'Editar porcentaje');
+define('TEXT_INFO_HEADING_DELETE_TAX_RATE', 'Eliminar porcentaje');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/template_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/template_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/template_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Template Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Template Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADER_EXPLAIN', 'These settings effect all templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Side box configuration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Layout configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/template_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/template_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/template_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  Translated by: jparis v1.0
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gestión de plantillas');
+
+define('TABLE_HEADING_TEMPLATE', 'Nombre de la plantilla');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_ACTIVE', '¿Activa?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', '¿Mostrar la columna derecha?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', '¿Mostrar la columna izquierda?');
+define('TABLE_HEADING_NOT_INSTALLED', 'Not installed');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Se permiten descipciones de las categorías');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Ancho de la columna izquierda (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Ancho de la columna derecha (pixel)');
+
+define('TEXT_DATE_ADDED', 'Fecha de creación:');
+define('TEXT_DELETE_IMAGE', '¿Eliminar la imagen de la plantilla?');
+define('TEXT_REST_CUST_TEMP', 'Set Site default template to replace this template in customer data?');
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this template?');
+
+define('TEXT_EDIT_INTRO', 'Por favor, haga los cambios necesarios');
+
+define('TEXT_HEADER', '<b>Encabezado</b>');
+define('TEXT_HEADING_DELETE_TEMPLATE', 'Eliminar plantilla');
+define('TEXT_HEADING_EDIT_TEMPLATE', 'Editar plantilla');
+define('TEXT_HEADING_NEW_TEMPLATE', 'Plantilla nueva');
+
+define('TEXT_INCLUDE_CART_IN_HEADER', '¿Incluir el carrito en el encabezado?');
+define('TEXT_INCLUDE_COLUMN_LEFT', '¿Incluir la columna izquierda?');
+define('TEXT_INCLUDE_COLUMN_RIGHT', '¿Incluir la columna derecha?');
+define('TEXT_INCLUDE_HEADER_LINK_BUTTONS', '¿Incluir botones de enlace en el encabezado?');
+define('TEXT_INCLUDE_LANGUAGES_IN_HEADER', '¿Incluir idiomas en el encabezado?');
+define('TEXT_INCLUDE_MAIN_TABLE_BORDER', '¿Incluir el borde de la tabla principal?');
+define('TEXT_INFO_EDIT_INTRO', 'Por favor, haga los cambios necesarios');
+define('TEXT_INFOBOX_BORDER_WIDTH_LEFT', 'Ancho de la imagen del panel de información izquierdo');
+define('TEXT_INFOBOX_BORDER_WIDTH_RIGHT', 'Ancho de la imagen del panel de información derecho');
+
+define('TEXT_LEFT_COLUMN', '<b>Columna izquierda</b>');
+define('TEXT_RIGHT_COLUMN', '<b>Columna derecha</b>');
+define('TEXT_TEMPLATE', 'Plantilla:');
+
+define('TEXT_LAST_MODIFIED', 'Última modificación:');
+
+define('TEXT_IMAGE_NONEXISTENT', 'LA IMAGEN NO EXISTE');
+define('TEXT_YES', 'Sí');
+define('TEXT_NO', 'No');
+define('TEXT_NEW_INTRO', 'Por favor, rellene la siguiente información para la nueva plantilla');
+
+
+define('TEXT_TEMPLATE_SYSTEM', 'The template uses the  ');
+define('TEXT_TEMPLATE_SYSTEM_1', ' template system.');
+
+define('TEXT_TEMPLATE_NAME', 'Nombre de la plantilla:  ');
+define('TEXT_TEMPLATE_IMAGE', 'Imagen de la plantilla:  ');
+
+define('TEXT_TEMPLATE_CELLPADDING_MAIN', 'Celdas de la tabla principal');
+define('TEXT_TEMPLATE_CELLPADDING_LEFT', 'Celdas de la columna izquierda');
+define('TEXT_TEMPLATE_CELLPADDING_RIGHT', 'Celdas de la columna derecha');
+define('TEXT_TEMPLATE_CELLPADDING_SUB', 'Celdas de la sub-tabla');
+
+define('TEXT_SITE_WIDTH', 'Ancho del sitio');
+
+define('TEXT_MOVE_RIGHT', 'Mover a la columna derecha');
+define('TEXT_MOVE_LEFT', 'Mover a la columna izquierda');
+
+define('TEXT_SHOW_CUSTOMER_GREETING', '¿Mostrar felicitación a los clientes?');
+define('TEXT_SHOW_ORIGINAL_PAGE_HEADERS', '¿Mostrar los encabezados de la página principal?');
+
+define('TEXT_TABLE_CELL_PADDING', '<b>Celdas de la tabla</b>');
+define('TEXT_OTHER', '<b>Otro</b>');
+define('TEXT_MAINPAGE_MODULES', '<b>Seleccionar los módulos para la página principal</b>');
+
+define('TEXT_MAINPAGE_MODULES_LOCATION', '<b>The module folder used is: </b>');
+
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: No se puede escribir en esta carpeta. Por favor ajuste los permisos adecuados en: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: La carpeta no existe: %s');
+
+define('TEXT_TABLE_CELL_LEFT_RIGHT', '<b>Celdas de los paneles laterales</b>');
+define('TEXT_TEMPLATE_LEFT_SIDE', 'Celdas del lado izquierdo');
+define('TEXT_TEMPLATE_RIGHT_SIDE', 'Celdas del lado derecho');
+
+define('ERROR1', '¡Error! 01  El nombre de la plantilla no es el mismo que el del archivo .sql o el archivo sql no existe');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+$user_ip = getenv('REMOTE_ADDR');;
+
+define('HEADING_TITLE', 'Resend Validation email');
+define('TEXT_EMAIL_CONFIRMATION','Are You Sure to Resend Validation email');
+define('ENTRY_EMAIL_ADDRESS', 'Emailadress: ');
+define('SUCCESS_REGISTRATION_CODE_SENT', 'New validation code Sent');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'This email address is not registered');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Your Validation Code is');
+define('EMAIL_PASSWORD_REMINDER_BODY', "\n\n".'We are resending your Validation Code.' . "\n\n" . 'Your Validation Code for \'' . STORE_NAME . '\' :' . "\n\n" . '%s' . "\n\n");
+define('EMAIL_PASSWORD_REMINDER_BODY2', 'Please follow this link to validate your account: %s' . "\n\n");
+define('TEXT_ACCOUNT_ALREADY_EXIST', 'This Account is already active!');
+define('IMAGE_BUTTON_BACK',"Go Back");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.1.1.1 2004/03/04 23:40:13 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Usuarios conectados');
+
+define('TABLE_HEADING_ONLINE', 'Conectados');
+define('TABLE_HEADING_CUSTOMER_ID', 'ID');
+define('TABLE_HEADING_FULL_NAME', 'Nombre completo');
+define('TABLE_HEADING_IP_ADDRESS', 'Dirección IP');
+define('TABLE_HEADING_ENTRY_TIME', 'Hora entrada');
+define('TABLE_HEADING_LAST_CLICK', 'Último click');
+define('TABLE_HEADING_LAST_PAGE_URL', 'Última URL');
+define('TABLE_HEADING_ACTION', 'Acción');
+define('TABLE_HEADING_SHOPPING_CART', 'Carrito del usuario');
+define('TABLE_HEADING_WHOIS', 'Whois');
+define('TEXT_SET_REFRESH', 'Velocidad de refresco:');
+define('TEXT_SHOPPING_CART_SUBTOTAL', 'Subtotal');
+define('TEXT_NUMBER_OF_CUSTOMERS', 'Hay actualmente %s clientes en línea');
+define('TABLE_HEADING_HTTP_REFERER', 'URL que lo envió');
+define('TEXT_HTTP_REFERER_URL', 'URL HTTP que lo envió');
+define('TEXT_HTTP_REFERER_FOUND', 'Encontrado');
+define('TEXT_HTTP_REFERER_NOT_FOUND', 'No encontrado');
+define('TEXT_STATUS_ACTIVE_CART', 'Active/Cart');
+define('TEXT_STATUS_ACTIVE_NOCART', 'Active/NoCart');
+define('TEXT_STATUS_INACTIVE_CART', 'Inactive/Cart');
+define('TEXT_STATUS_INACTIVE_NOCART', 'Inactive/NoCart');
+define('TEXT_STATUS_ACTIVE_BOT', 'Active/Bot');
+define('TEXT_STATUS_INACTIVE_BOT', 'Inactive/Bot');
+define('TABLE_HEADING_COUNTRY', 'Country');
+define('TABLE_HEADING_USER_SESSION', 'Session?');
+define('TEXT_OSCID', 'osCsid');
+define('TEXT_PROFILE_DISPLAY', 'Profile Display');
+define('TEXT_USER_AGENT', 'User Agent');
+define('TEXT_ERROR', 'Error!');
+define('TEXT_ADMIN', 'Admin');
+define('TEXT_DUPLICATE_IP', 'Duplicate IPs');
+define('TEXT_BOTS', 'Bots');
+define('TEXT_ME', 'Me!');
+define('TEXT_ALL', 'All');
+define('TEXT_REAL_CUSTOMERS', 'Real Customers');
+define('TEXT_YOUR_IP_ADDRESS', 'Your IP Address');
+define('TEXT_SET_REFRESH_RATE', 'Set Refresh Rate');
+define('TEXT_NONE_', 'None');
+
+define('TEXT_NAME', 'Name:');
+define('TEXT_CUSTOMER_ID', 'Customer ID:');
+define('TEXT_IP_ADDRESS', 'IP Address:');
+define('TEXT_REFERER', 'Referer:');
+define('TEXT_BOTS', 'Bots');
+define('TEXT_CUSTOMERS', 'Customers');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/xsell_products.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/xsell_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/xsell_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/* $Id$
+osCommerce, Open Source E-Commerce Solutions
+http://www.oscommerce.com
+Copyright (c) 2002 osCommerce
+
+Released under the GNU General Public License
+xsell.php
+Original Idea From Isaac Mualem im at imwebdesigning.com <mailto:im at imwebdesigning.com>
+Complete Recoding From Stephen Walker admin at snjcomputers.com
+*/
+
+define('CROSS_SELL_SUCCESS', 'Con éxito Actualización Para El Producto #'.$_GET['add_related_product_ID']);
+define('SORT_CROSS_SELL_SUCCESS', 'Con éxito Actualización Para El Producto  #'.$_GET['add_related_product_ID']);
+define('HEADING_TITLE', 'Venta Cruzada (X-Venda) Admin');
+define('TABLE_HEADING_PRODUCT_ID', 'Identificación Del Producto');
+define('TABLE_HEADING_PRODUCT_MODEL', 'Modelo Del Producto');
+define('TABLE_HEADING_PRODUCT_NAME', 'Nombre Del Producto');
+define('TABLE_HEADING_CURRENT_SELLS', 'Ventas Actuales X-Venda');
+define('TABLE_HEADING_UPDATE_SELLS', 'La Actualización  X-Venda');
+define('TABLE_HEADING_PRODUCT_IMAGE', 'Imagen De Producto');
+define('TABLE_HEADING_PRODUCT_PRICE', 'Precio Del Producto');
+define('TABLE_HEADING_CROSS_SELL_THIS', 'Venta Cruzada Esto?');
+define('TEXT_EDIT_SELLS', 'Corrija');
+define('TEXT_SORT', 'Dé la prioridad');
+define('TEXT_SETTING_SELLS', 'Ajuste X-Venda');
+define('TEXT_PRODUCT_ID', 'Identificación Del Producto');
+define('TEXT_MODEL', 'Modelo');
+define('TABLE_HEADING_PRODUCT_SORT', 'Orden De la Clase');
+define('TEXT_NO_IMAGE', 'Ninguna Imagen');
+define('TEXT_CROSS_SELL', 'Venta Cruzada');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol/zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: zones.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Zonas');
+
+define('TABLE_HEADING_COUNTRY_NAME', 'País');
+define('TABLE_HEADING_ZONE_NAME', 'Zonas');
+define('TABLE_HEADING_ZONE_CODE', 'Código');
+define('TABLE_HEADING_ACTION', 'Acción');
+
+define('TEXT_INFO_EDIT_INTRO', 'Haga los cambios necesarios');
+define('TEXT_INFO_ZONES_NAME', 'Nombre de la zona:');
+define('TEXT_INFO_ZONES_CODE', 'Código de la zona:');
+define('TEXT_INFO_COUNTRY_NAME', 'País:');
+define('TEXT_INFO_INSERT_INTRO', 'Introduzca los datos de la nueva zona');
+define('TEXT_INFO_DELETE_INTRO', '¿Seguro que desea eliminar esta zona?');
+define('TEXT_INFO_HEADING_NEW_ZONE', 'Nueva zona');
+define('TEXT_INFO_HEADING_EDIT_ZONE', 'Editar zona');
+define('TEXT_INFO_HEADING_DELETE_ZONE', 'Eliminar zona');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/espanol.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/espanol.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/espanol.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1360 @@
+<?php
+/*
+  $Id: espanol.php,v 1.1.1.1 2004/03/04 23:40:01 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//Admin begin
+define('TEXT_ADMIN_HOME','Admin Home');
+define('TEXT_VIEW_CATALOG','View Catalog');
+define('TEXT_FORUMS','CRE Forums');
+define('TEXT_PURCHASE_SUPPORT','Purchase CRE Support');
+define('TEXT_HOSTING','Certified CRE Hosting');
+define('TEXT_ADMIN_LANG','Admin Language:');
+define('TEXT_CHANGE_PASWORD','Change Password');
+define('TEXT_LOGOUT','Logout');
+define('TEXT_CHECK_UPDATES','Check for Updates');
+define('TEXT_GET_PRO','Get Pro Version');
+define('TEXT_GET_B2B','Get B2B Version');
+
+// header text in includes/header.php
+define('HEADER_TITLE_ACCOUNT', 'Mi cuenta/contraseña');
+define('HEADER_TITLE_LOGOFF', 'Salir');
+define('TEXT_SELECT_LANGUAGE', 'Please select Admin language for this session ');
+define('BOX_REPORTS_NOT_VALID_USER', 'Customers Not Validated');
+
+// Admin Account
+define('BOX_HEADING_MY_ACCOUNT', 'Mi cuenta');
+
+//MARKETING BOX
+define('BOX_HEADING_MARKETING', 'Marketing');
+define('BOX_MARKETING_EVENTS_MANAGER', 'Events Manager');
+define('BOX_MARKETING_SALEMAKER', 'SaleMaker');
+define('BOX_MARKETING_SPECIALS', 'Specials');
+define('BOX_MARKETING_SPECIALSBYCAT','Specials By Category');
+define('BOX_MARKETING_BANNER_MANAGER','Banner Manager');
+
+// configuration box text in includes/boxes/administrator.php
+define('BOX_HEADING_ADMINISTRATOR', 'Administrador');
+define('BOX_ADMINISTRATOR_MEMBERS', 'Grupos de miembros');
+define('BOX_ADMINISTRATOR_GROUPS', 'Admin Groups');
+define('BOX_ADMINISTRATOR_MEMBER', 'Miembros');
+define('BOX_ADMINISTRATOR_BOXES', 'Acceso a archivos');
+define('BOX_ADMINISTRATOR_ACCOUNT_UPDATE', 'Actualizar cuenta');
+
+// images
+define('IMAGE_FILE_PERMISSION', 'Permisos de archivos');
+define('IMAGE_GROUPS', 'Lista de grupos');
+define('IMAGE_INSERT_FILE', 'Insertar archivo');
+define('IMAGE_MEMBERS', 'Lista de miembros');
+define('IMAGE_NEW_GROUP', 'Nuevo grupo');
+define('IMAGE_NEW_MEMBER', 'Nuevo miembro');
+define('IMAGE_NEXT', 'Siguiente');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_DISPLAY_NUMBER_OF_FILENAMES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> archivos)');
+define('TEXT_DISPLAY_NUMBER_OF_MEMBERS', 'Mostrando <b>%d</b> a <b>%d</b> (de <b>%d</b> miembros)');
+//Admin end
+
+// look in your $PATH_LOCALE/locale directory for available locales..
+// on RedHat6.0 I used 'en_US'
+// on FreeBSD 4.0 I use 'en_US.ISO_8859-1'
+// on Windows try 'sp', or 'Spanish' 
+setlocale(LC_TIME, 'Spanish');
+define('DATE_FORMAT_SHORT', '%d/%m/%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
+define('PHP_DATE_TIME_FORMAT', 'd/m/Y H:i:s'); // this is used for date()
+define('DATE_FORMAT', 'd/m/Y'); // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+
+////
+// Return date in raw format
+// $date should be in format mm/dd/yyyy
+// raw date is in format YYYYMMDD, or DDMMYYYY
+function tep_date_raw($date, $reverse = true) {
+  if ($reverse) {
+    return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
+  }
+}
+
+// Global entries for the <html> tag
+define('HTML_PARAMS','dir="ltr" lang="es"');
+
+// charset for web pages and emails
+define('CHARSET', 'iso-8859-1');
+
+// page title
+define('TITLE', STORE_NAME);
+
+// CCGV
+define('BOX_HEADING_GV_ADMIN', 'Vouchers/Coupons');
+define('BOX_GV_ADMIN_QUEUE', 'Gift Voucher Queue');
+define('BOX_GV_ADMIN_MAIL', 'Mail Gift Voucher');
+define('BOX_GV_ADMIN_SENT', 'Gift Vouchers sent');
+define('BOX_COUPON_ADMIN','Coupon Admin');
+define('BOX_GV_REPORT','Coupon Report');
+define('IMAGE_RELEASE', 'Redeem Gift Voucher');
+
+define('_JANUARY', 'January');
+define('_FEBRUARY', 'February');
+define('_MARCH', 'March');
+define('_APRIL', 'April');
+define('_MAY', 'May');
+define('_JUNE', 'June');
+define('_JULY', 'July');
+define('_AUGUST', 'August');
+define('_SEPTEMBER', 'September');
+define('_OCTOBER', 'October');
+define('_NOVEMBER', 'November');
+define('_DECEMBER', 'December');
+
+define('TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> gift vouchers)');
+define('TEXT_DISPLAY_NUMBER_OF_COUPONS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> coupons)');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Products ID');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+define('TEXT_VALID_PRODUCTS_MODEL', 'Products Model');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Category ID');
+define('TEXT_VALID_CATEGORIES_NAME', 'Category Name');
+
+// ############### end added #########################
+// header text in includes/header.php
+define('HEADER_TITLE_TOP', 'Administración');
+define('HEADER_TITLE_SUPPORT_SITE', 'Soporte');
+define('HEADER_TITLE_ONLINE_CATALOG', 'Catálogo');
+define('HEADER_TITLE_ADMINISTRATION', 'Administración');
+define('HEADER_TITLE_CHAINREACTION', 'Chainreactionweb');
+define('HEADER_TITLE_CRELOADED', 'CRE Loaded Project');
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('BOX_CATALOG_DEFINE_MAINPAGE', 'Definir página principal');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// text for gender
+define('MALE', 'Hombre');
+define('FEMALE', 'Mujer');
+
+// text for date of birth example
+define('DOB_FORMAT_STRING', 'dd/mm/yyyy');
+
+// configuration box text in includes/boxes/configuration.php
+define('BOX_HEADING_CONFIGURATION', 'Configuración');
+define('BOX_CONFIGURATION_MYSTORE', 'Mi tienda');
+define('BOX_CONFIGURATION_LOGGING', 'Registro');
+define('BOX_CONFIGURATION_CACHE', 'Caché');
+
+// added for super-friendly admin menu:
+define('BOX_CONFIGURATION_MIN_VALUES', 'Valores mínimos');
+define('BOX_CONFIGURATION_MAX_VALUES', 'Valores máximos');
+define('BOX_CONFIGURATION_IMAGES', 'Configuración de imágenes');
+define('BOX_CONFIGURATION_CUSTOMER_DETAILS', 'Datos de clientes');
+define('BOX_CONFIGURATION_SHIPPING', 'Ajustes de envío por defecto');
+define('BOX_CONFIGURATION_PRODUCT_LISTING', 'Listado de productos');
+define('BOX_CONFIGURATION_EMAIL', 'Email');
+define('BOX_CONFIGURATION_DOWNLOAD', 'Gestor de descargas');
+define('BOX_CONFIGURATION_GZIP', 'GZip');
+define('BOX_CONFIGURATION_SESSIONS', 'Sesiones');
+define('BOX_CONFIGURATION_STOCK', 'Control de stock');
+define('BOX_CONFIGURATION_WYSIWYG', 'Editor WYSIWYG 1.7');
+define('BOX_CONFIGURATION_AFFILIATE', 'Programa de asociados');
+define('BOX_CONFIGURATION_MAINT', 'Mantenimiento del sitio');
+define('BOX_CONFIGURATION_ACCOUNTS', 'Comprar sin cuenta');
+define('BOX_CONFIGURATION_CHECKOUT', 'Checkout Settings');
+define('BOX_CONFIGURATION_LINKS', 'Gestor de enlaces');
+
+// modules box text in includes/boxes/modules.php
+define('BOX_HEADING_MODULES', 'Módulos');
+define('BOX_MODULES_PAYMENT', 'Pago');
+define('BOX_MODULES_SHIPPING', 'Portes');
+define('BOX_MODULES_ORDER_TOTAL', 'Total de pedido');
+
+// categories box text in includes/boxes/catalog.php
+define('BOX_HEADING_CATALOG', 'Catálogo');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS', 'Categorías/Productos');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES', 'Atributos de productos');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_CATEGORY_OPTIONS', 'Products Categories Options');
+define('BOX_CATALOG_MANUFACTURERS', 'Fabricantes');
+define('BOX_CATALOG_REVIEWS', 'Comentarios');
+define('BOX_CATALOG_SPECIALS', 'Ofertas');
+define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Próximamente');
+define('BOX_CATALOG_EASYPOPULATE', 'Easy Populate');
+define('BOX_CATALOG_EASYPOPULATE_BASIC', 'Easy Populate Basic');
+
+define('BOX_CATALOG_SALEMAKER', 'SaleMaker');
+
+define('BOX_CATALOG_SHOP_BY_PRICE', 'Comprar por precio');
+// customers box text in includes/boxes/customers.php
+define('BOX_HEADING_CUSTOMERS', 'Clientes/Pedidos');
+define('BOX_CUSTOMERS_CUSTOMERS', 'Clientes');
+//added for Super-Friendly Admin Menu:
+define('BOX_CUSTOMERS_ORDERS', 'Pedidos');
+define('BOX_CUSTOMERS_EDIT_ORDERS', 'Editar pedidos');
+//begin PayPal_Shopping_Cart_IPN
+define('BOX_CUSTOMERS_PAYPAL', 'PayPal IPN');
+define('BOX_ABANDONED_ORDERS', 'Abandoned Orders');
+define('BOX_CREATE_ACCOUNT', 'Crear una cuenta nueva');
+define('BOX_CREATE_ORDER', 'Crear un pedido nuevo');
+define('BOX_CREATE_ORDERS_ADMIN', 'Crear un pedido nuevo de admin');
+// taxes box text in includes/boxes/taxes.php
+define('BOX_HEADING_LOCATION_AND_TAXES', 'Lugares/Tasas');
+define('BOX_TAXES_COUNTRIES', 'Países');
+define('BOX_TAXES_ZONES', 'Zonas');
+define('BOX_TAXES_GEO_ZONES', 'Zonas de impuestos');
+define('BOX_TAXES_TAX_CLASSES', 'Clases de impuestos');
+define('BOX_TAXES_TAX_RATES', 'Tasas de impuestos');
+
+// reports box text in includes/boxes/reports.php
+define('BOX_HEADING_REPORTS', 'Informes');
+define('BOX_REPORTS_PRODUCTS_VIEWED', 'Productos vistos');
+define('BOX_REPORTS_PRODUCTS_PURCHASED', 'Productos comprados');
+define('BOX_REPORTS_ORDERS_TOTAL', 'Total de pedidos de clientes');
+define('BOX_REPORTS_CUSTOMER_WISHLIST', 'Customer Wishlist');
+define('BOX_CUSTOMERS_MENU','Customer Menu');
+
+// tools text in includes/boxes/tools.php
+define('BOX_HEADING_TOOLS', 'Herramientas');
+define('BOX_TOOLS_BACKUP', 'Copia de seguridad de la base de datos');
+define('BOX_TOOLS_BANNER_MANAGER', 'Gestor de banners');
+define('BOX_TOOLS_CACHE', 'Control de caché');
+define('BOX_TOOLS_DEFINE_LANGUAGE', 'Definir idiomas');
+define('BOX_TOOLS_FILE_MANAGER', 'Gestor de archivos');
+define('BOX_TOOLS_MAIL', 'Enviar email');
+define('BOX_TOOLS_NEWSLETTER_MANAGER', 'Gestor de noticias');
+define('BOX_TOOLS_SERVER_INFO', 'Información del servidor');
+define('BOX_TOOLS_WHOS_ONLINE', '¿Quién está conectado?');
+
+// BMC CC Mod Start
+define('BOX_TOOLS_BLACKLIST', 'Credit Card Blacklist');
+// BMC CC Mod End
+// localizaion box text in includes/boxes/localization.php
+define('BOX_HEADING_LOCALIZATION', 'Idiomas y monedas');
+define('BOX_LOCALIZATION_CURRENCIES', 'Monedas');
+define('BOX_LOCALIZATION_LANGUAGES', 'Idiomas');
+define('BOX_LOCALIZATION_ORDERS_STATUS', 'Estado de pedidos');
+
+define('BOX_HEADING_HEADER_TAGS_CONTROLLER', 'Header Tags');
+define('BOX_HEADER_TAGS_ADD_A_PAGE', 'Page Control');
+define('BOX_HEADER_TAGS_ENGLISH', 'Text Control');
+define('BOX_HEADER_TAGS_FILL_TAGS', 'Fill Tags');
+
+// infobox box text in includes/boxes/info_boxes.php
+define('BOX_HEADING_DESIGN_CONTROLS', 'Controles de diseño');
+define('BOX_HEADING_BOXES', 'Administración de las columnas');
+define('BOX_HEADING_DESIGN_TEMPLATE', 'Template');
+define('BOX_HEADING_TEMPLATE_CONFIGURATION', 'Administración de plantillas');
+define('BOX_HEADING_TEMPLATE_MANAGEMENT', 'Template Admin');
+define('BOX_HEADING_TEMPLATE_MANAGEMENT1', 'New Manage Templates');
+define('BOX_HEADING_DESIGN_INFOBOX', 'Infobox');
+define('BOX_HEADING_BOXES', 'Infobox Admin');
+define('BOX_HEADING_BOXES_ADMIN', 'Infobox Configure');
+define('BOX_HEADING_DESIGN_BRANDING', 'Branding');
+define('BOX_HEADING_TEMPLATE_HEADER_TAGS','Header Tags');
+ 
+
+define('BOX_HEADING_DESIGN_LAYOUT', 'Layout');
+define('BOX_HEADING_DESIGN_PRODUCT_LISTING', 'Product Listing');
+define('BOX_HEADING_DESIGN_HOME_PAGE', 'Home Page');
+define('BOX_HEADING_DESIGN_INDEX_PAGE', 'Index Page');
+define('BOX_HEADING_DESIGN_PRODUCT_PAGE', 'Product Page');
+
+define('BOX_TEMPLATE_NAVMENU','Navigation Manager');
+
+// VJ Links Manager v1.00 begin
+// links manager box text in includes/boxes/links.php
+define('BOX_HEADING_LINKS', 'Gestor de enlaces');
+define('BOX_LINKS_LINKS', 'Enlaces');
+define('BOX_LINKS_LINK_CATEGORIES', 'Categorías de enlaces');
+define('BOX_LINKS_LINKS_CONTACT', 'Contactos de enlaces');
+// VJ Links Manager v1.00 end
+
+// javascript messages
+define('JS_ERROR', '¡Hubo errores mientras de procesaba su ficha!\nPor favor haga las siguientes correciones:\n\n');
+
+define('JS_OPTIONS_VALUE_PRICE', '* El nuevo atributo de producto necesita un precio\n');
+define('JS_OPTIONS_VALUE_PRICE_PREFIX', '* El nuevo atributo de producto necesita un prefijo de precio\n');
+
+define('JS_PRODUCTS_NAME', '* El nuevo producto necesita un nombre\n');
+define('JS_PRODUCTS_DESCRIPTION', '* El nuevo producto necesita una descripción\n');
+define('JS_PRODUCTS_PRICE', '* El nuevo producto necesita un valor en el precio\n');
+define('JS_PRODUCTS_WEIGHT', '* El nuevo producto necesita un valor en el peso\n');
+define('JS_PRODUCTS_QUANTITY', '* El nuevo producto necesita un valor en la cantidad\n');
+define('JS_PRODUCTS_MODEL', '* El nuevo producto necesita un valor en el modelo\n');
+define('JS_PRODUCTS_IMAGE', '* El nuevo producto necesita un valor en la imagen\n');
+
+define('JS_SPECIALS_PRODUCTS_PRICE', '* Es necesario un precio nuevo para este producto\n');
+
+define('JS_GENDER', '* El valor de \'Género\' es necesario.\n');
+define('JS_FIRST_NAME', '* El campo \'Nombre\' debe tener al menos ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' caracteres.\n');
+define('JS_LAST_NAME', '* El campo \'Apellidos\' debe tener al menos ' . ENTRY_LAST_NAME_MIN_LENGTH . ' caracteres.\n');
+define('JS_DOB', '* El campo \'Fecha de nacimiento\' debe tener el siguiente formato: xx/xx/xxxx (día/mes/año).\n');
+define('JS_EMAIL_ADDRESS', '* El campo \'Dirección de email\' debe tener al menos ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' caracteres.\n');
+define('JS_ADDRESS', '* El campo \'Dirección\' debe tener al menos ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' caracteres.\n');
+define('JS_POST_CODE', '* El campo \'Código postal\' debe tener al menos ' . ENTRY_POSTCODE_MIN_LENGTH . ' caracteres.\n');
+define('JS_CITY', '* El campo \'Ciudad\' debe tener al menos ' . ENTRY_CITY_MIN_LENGTH . ' caracteres.\n');
+define('JS_STATE', '* El campo \'Provincia\' es necesario.\n');
+define('JS_STATE_SELECT', '-- Seleccionar arriba --');
+define('JS_ZONE', '* El campo \'Provincia\' hay que escogerlo de la lista para ese país.');
+define('JS_COUNTRY', '* El campo \'País\' es necesario.\n');
+define('JS_TELEPHONE', '* El campo \'Número de teléfono\' debe tener al menos ' . ENTRY_TELEPHONE_MIN_LENGTH . ' caracteres.\n');
+define('JS_PASSWORD', '* Los campos \'Contraseña\' y \'Confirmación\' deben coincidir y tener al menos ' . ENTRY_PASSWORD_MIN_LENGTH . ' caracteres.\n');
+
+define('JS_ORDER_DOES_NOT_EXIST', '¡El número de pedido %s no existe!');
+/* User Friendly Admin Menu */
+define('CATALOG_CATEGORIES', 'Categorías');
+define('CATALOG_ATTRIBUTES', 'Atributos de productos');
+define('CATALOG_REVIEWS', 'Comentarios de productos');
+define('CATALOG_SPECIALS', 'Ofertas');
+define('CATALOG_EXPECTED', 'Próximamente');
+define('REPORTS_PRODUCTS_VIEWED', 'Productos vistos');
+define('REPORTS_PRODUCTS_PURCHASED', 'Productos comprados');
+define('TOOLS_FILE_MANAGER', 'Gestor de archivos');
+define('TOOLS_CACHE', 'Control de caché');
+define('TOOLS_DEFINE_LANGUAGES', 'Definir idiomas');
+define('TOOLS_EMAIL', 'Enviar email a clientes');
+define('TOOLS_NEWSLETTER', 'Boletines de noticias');
+define('TOOLS_SERVER_INFO', 'Información del servidor');
+define('TOOLS_WHOS_ONLINE', '¿Quién está conectado?');
+define('BOX_HEADING_GV', 'Cupones/cheques');
+define('GV_COUPON_ADMIN', 'Cupones de descuento');
+define('GV_EMAIL', 'Enviar un cheque regalo por email');
+define('GV_QUEUE', 'Canjear cheque regalo');
+define('GV_SENT', 'Cheque regalo enviado');
+define('BOX_GV_SENT', 'Gift Voucher\'s Sent');
+/* User Friedly Admin Menu */
+
+define('CATEGORY_PERSONAL', 'Personal');
+define('CATEGORY_ADDRESS', 'Dirección');
+define('CATEGORY_CONTACT', 'Contacto');
+define('CATEGORY_COMPANY', 'Empresa');
+define('CATEGORY_OPTIONS', 'Opciones');
+define('CATEGORY_PASSWORD', 'Your Password');
+
+define('ENTRY_COMPANY', 'Company Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Género:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<span class="errorText">necesario</span>');
+define('ENTRY_GENDER_TEXT', '*');
+define('ENTRY_FIRST_NAME', 'Nombre:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<span class="errorText">mínimo de ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' caracteres</span>');
+define('ENTRY_FIRST_NAME_TEXT', '*');
+define('ENTRY_LAST_NAME', 'Apellidos:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<span class="errorText">mínimo ' . ENTRY_LAST_NAME_MIN_LENGTH . ' caracteres</span>');
+define('ENTRY_LAST_NAME_TEXT', '*');
+
+define('ENTRY_DATE_OF_BIRTH', 'Fecha de nacimiento:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class="errorText">(ej. 21/05/1970)</span>');
+define('ENTRY_EMAIL_ADDRESS', 'Dirección de e-mail:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<span class="errorText">mínimo ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' caracteres</span>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<span class="errorText">¡La dirección de correo no parece válida!</span>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<span class="errorText">¡Esta dirección de correo ya existe en nuestra base de datos!</span>');
+define('ENTRY_COMPANY', 'Nombre de la empresa:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_STREET_ADDRESS', 'Dirección:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<span class="errorText">mínimo ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' caracteres</span>');
+define('ENTRY_SUBURB', 'Suburbio:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_POST_CODE_TEXT', '*');
+define('ENTRY_POST_CODE', 'Código postal:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<span class="errorText">mínimo ' . ENTRY_POSTCODE_MIN_LENGTH . ' caracteres</span>');
+define('ENTRY_CITY', 'Ciudad:');
+define('ENTRY_CITY_ERROR', '&nbsp;<span class="errorText">mínimo ' . ENTRY_CITY_MIN_LENGTH . ' caracteres</span>');
+define('ENTRY_STATE', 'Provincia:');
+define('ENTRY_STATE_ERROR', '&nbsp;<span class="errorText">necesaria</span>');
+define('ENTRY_COUNTRY', 'País:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '*');
+define('ENTRY_TELEPHONE_NUMBER', 'Número de teléfono:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<span class="errorText">mínimo ' . ENTRY_TELEPHONE_MIN_LENGTH . ' caracteres</span>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');
+define('ENTRY_FAX_NUMBER', 'Número de fax:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Boletín de noticias:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Subscrito');
+define('ENTRY_NEWSLETTER_NO', 'No subscrito');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_ERROR_NOT_MATCHING', 'The Password Confirmation must match your Password.');
+define('ENTRY_PASSWORD_TEXT', '*');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT', 'Current Password:');
+define('ENTRY_PASSWORD_CURRENT_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW', 'New Password:');
+define('ENTRY_PASSWORD_NEW_TEXT', '*');
+define('ENTRY_PASSWORD_NEW_ERROR', 'Your new Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING', 'The Password Confirmation must match your new Password.');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+define('FORM_REQUIRED_INFORMATION', '* Required information');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('CATEGORY_ORDER_DETAILS', 'Customer Details');
+define('ENTRY_CURRENCY', 'Customer Currency');
+
+// images
+define('IMAGE_ANI_SEND_EMAIL', 'Enviando e-mail');
+define('IMAGE_BACK', 'Atrás');
+define('IMAGE_BACKUP', 'Copia de seguridad');
+define('IMAGE_CANCEL', 'Cancelar');
+define('IMAGE_BUTTON_CONTINUE', 'Continue');
+define('IMAGE_CONFIRM', 'Confirmar');
+define('IMAGE_COPY', 'Copiar');
+define('IMAGE_COPY_TO', 'Copiar a');
+define('IMAGE_DETAILS', 'Detalles');
+define('IMAGE_DELETE', 'Eliminar');
+define('IMAGE_EDIT', 'Editar');
+define('IMAGE_EDIT_STATUS', 'Edit Order Status');
+define('IMAGE_EDIT_ORDER', 'Edit Order');
+define('IMAGE_EDIT_LANG_DEFINE', 'Edit Language Defines');
+define('IMAGE_EMAIL', 'Email');
+define('IMAGE_FILE_MANAGER', 'Gestor de archivos');
+define('IMAGE_ICON_STATUS_GREEN', 'Activo');
+define('IMAGE_ICON_STATUS_GREEN_LIGHT', 'Activar');
+define('IMAGE_ICON_STATUS_RED', 'Inactivo');
+define('IMAGE_ICON_STATUS_RED_LIGHT', 'Desactivar');
+define('IMAGE_ICON_INFO', 'Info');
+define('IMAGE_INSERT', 'Insertar');
+define('IMAGE_LOCK', 'Bloquear');
+define('IMAGE_MODULE_INSTALL', 'Instalar módulo');
+define('IMAGE_MODULE_REMOVE', 'Quitar módulo');
+define('IMAGE_MOVE', 'Mover');
+define('IMAGE_NEW_BANNER', 'Nuevo banner');
+define('IMAGE_NEW_CATEGORY', 'Nueva categoría');
+define('IMAGE_NEW_COUNTRY', 'Nuevo país');
+define('IMAGE_NEW_CURRENCY', 'Nueva moneda');
+define('IMAGE_NEW_FILE', 'Nuevo archivo');
+define('IMAGE_NEW_FOLDER', 'Nueva carpeta');
+define('IMAGE_NEW_LANGUAGE', 'Nuevo idioma');
+define('IMAGE_NEW_NEWSLETTER', 'Nuevo boletín de noticias');
+define('IMAGE_NEW_PRODUCT', 'Nuevo producto');
+define('IMAGE_NEW_SALE', 'Nueva venta');
+define('IMAGE_NEW_TAX_CLASS', 'Nueva clase de impuesto');
+define('IMAGE_NEW_TAX_RATE', 'Nueva tasa de impuesto');
+define('IMAGE_NEW_TAX_ZONE', 'Nueva zona de impuesto');
+define('IMAGE_NEW_ZONE', 'Nueva zona');
+define('IMAGE_ORDERS', 'Pedidos');
+define('IMAGE_ORDERS_INVOICE', 'Factura');
+define('IMAGE_ORDERS_PACKINGSLIP', 'Packing slip');
+define('IMAGE_PREVIEW', 'Previo');
+define('IMAGE_RESTORE', 'Restaurar');
+define('IMAGE_RESET', 'Reset');
+define('IMAGE_SAVE', 'Guardar');
+define('IMAGE_SEARCH', 'Buscar');
+define('IMAGE_SELECT', 'Seleccionar');
+define('IMAGE_SEND', 'Enviar');
+define('IMAGE_SEND_EMAIL', 'Enviar email');
+define('IMAGE_UNLOCK', 'Desbloquear');
+define('IMAGE_UPDATE', 'Actualizar');
+define('IMAGE_UPDATE_CURRENCIES', 'Actualizar el tipo de cambio');
+define('IMAGE_UPLOAD', 'Upload');
+
+define('ICON_CROSS', 'Falso');
+define('ICON_CURRENT_FOLDER', 'Carpeta actual');
+define('ICON_DELETE', 'Eliminar');
+//added for quick product edit DMG
+define('ICON_EDIT','Editar');
+define('ICON_ERROR', 'Error');
+define('ICON_FILE', 'Archivo');
+define('ICON_FILE_DOWNLOAD', 'Descargar');
+define('ICON_FOLDER', 'Carpeta');
+define('ICON_LOCKED', 'Bloqueado');
+define('ICON_PREVIOUS_LEVEL', 'Nivel anterior');
+define('ICON_PREVIEW', 'Previo');
+define('ICON_STATISTICS', 'Estadísticas');
+define('ICON_SUCCESS', 'OK');
+define('ICON_TICK', 'Verdadero');
+define('ICON_UNLOCKED', 'Desbloqueado');
+define('ICON_WARNING', 'Atención');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_RESULT_PAGE', 'Página %s de %d');
+define('TEXT_DISPLAY_NUMBER_OF_BANNERS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> banners)');
+define('TEXT_DISPLAY_NUMBER_OF_COUNTRIES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> paises)');
+define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> clientes)');
+define('TEXT_DISPLAY_NUMBER_OF_CURRENCIES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> monedas)');
+define('TEXT_DISPLAY_NUMBER_OF_LANGUAGES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> idiomas)');
+define('TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> fabricantes)');
+define('TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> boletines de noticias)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> pedidos)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS_STATUS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> estados de pedidos)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> productos)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_EXPECTED', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> próximos productos)');
+define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> comentarios de productos)');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> ventas)');
+define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> productos en oferta)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> clases de impuestos)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_ZONES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> zonas de impuestos)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> tasas de impuestos)');
+define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> zonas)');
+
+define('PREVNEXT_BUTTON_PREV', '&lt;&lt;');
+define('PREVNEXT_BUTTON_NEXT', '&gt;&gt;');
+
+define('TEXT_DEFAULT', 'por defecto');
+define('TEXT_SET_DEFAULT', 'Poner por defecto');
+define('TEXT_FIELD_REQUIRED', '&nbsp;<span class="fieldRequired">* necesario</span>');
+
+define('ERROR_NO_DEFAULT_CURRENCY_DEFINED', 'Error: No hay ningún tipo de moneda definido en este momento. Por favor fije una en: Herramientas de administración->Monedas/Idiomas->Monedas');
+
+define('TEXT_NONE', '--ninguno--');
+define('TEXT_TOP', 'Arriba');
+
+define('ERROR_DESTINATION_DOES_NOT_EXIST', 'Error: El destino no existe.');
+define('ERROR_DESTINATION_NOT_WRITEABLE', 'Error: El destino no tiene permisos de escritura.');
+define('ERROR_FILE_NOT_SAVED', 'Error: El upload no se ha guardado.');
+define('ERROR_FILETYPE_NOT_ALLOWED', 'Error: No se permite el tipo de archivo para upload.');
+define('SUCCESS_FILE_SAVED_SUCCESSFULLY', 'OK: El upload se ha guardado correctamente.');
+define('WARNING_NO_FILE_UPLOADED', 'Atención: No se ha hecho uplod de ningún archivo.');
+define('WARNING_FILE_UPLOADS_DISABLED', 'Atención: Los uploads estan deshabilitados en el fichero de configuración php.ini.');
+define('TEXT_DISPLAY_NUMBER_OF_PAYPALIPN_TRANSACTIONS', 'Mostrando desde <b>%d</b> a <b>%d</b> (de <b>%d</b> transacciones)'); // PAYPALIPN
+define('ERROR_TEP_MAIL', '<font face="Verdana, Arial" size="2" color="#ff0000"><b><small>TEP ERROR:</small> Cannot send the email through the specified SMTP server. Please check your php.ini setting and correct the SMTP server if necessary.</b></font>');
+define('WARNING_INSTALL_DIRECTORY_EXISTS', 'Warning: Installation directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install. Please remove this directory for security reasons.');
+define('WARNING_UPGRADES_DIRECTORY_EXISTS', 'Warning: Upgrades directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/upgrades. Please remove this directory for security reasons.');
+define('WARNING_CONFIG_FILE_WRITEABLE', 'Warning: I am able to write to the configuration file: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
+define('WARNING_CONFIG_FILE_WRITEABLE_CATALOG', 'Warning: I am able to write to the configuration file: ' . DIR_FS_CATALOG . 'includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
+define('WARNING_SESSION_DIRECTORY_NON_EXISTENT', 'Warning: The sessions directory does not exist: ' . tep_session_save_path() . '. Sessions will not work until this directory is created.');
+define('WARNING_SESSION_DIRECTORY_NOT_WRITEABLE', 'Warning: I am not able to write to the sessions directory: ' . tep_session_save_path() . '. Sessions will not work until the right user permissions are set.');
+define('WARNING_SESSION_AUTO_START', 'Warning: session.auto_start is enabled - please disable this php feature in php.ini and restart the web server.');
+define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Warning: The downloadable products directory does not exist: ' . DIR_FS_CATALOG . 'download/' . '. Downloadable products will not work until this directory is valid.');
+define('WARNING_ENCRYPT_FILE_MISSING', 'Warning: The Encryption key file is missing.');
+define('WARNING_TMP_DIRECTORY_NON_EXISTENT', 'Warning: The /tmp is not writable: ' . DIR_FS_CATALOG . 'tmp/' . '. The page cacheing will not work until this directory is writable.');
+
+define('BOX_HEADING_PAYPALIPN_ADMIN', 'Paypal IPN'); // PAYPALIPN
+define('BOX_PAYPALIPN_ADMIN_TRANSACTIONS', 'Transacciones'); // PAYPALIPN
+define('BOX_PAYPALIPN_ADMIN_TESTS', 'Enviar IPN de pruebas'); // PAYPALIPN
+define('BOX_CATALOG_XSELL_PRODUCTS', 'Productos Cross Sell'); // X-Sell
+
+define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 01 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_INVALID_MONTH', 'Error: 02 The expiry date Motnth entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_YEAR', 'Error: 03 The expiry date year entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Error: 04 The expiry date entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Error: 05 The credit card number entered is invalid. Please check the number for misstyped numbers and try again.');
+define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'Error: 06 The first four digits of the number entered are: %s If that number is correct, we do not accept that type of credit card.If it is wrong, please try again.');
+define('TEXT_CCVAL_ERROR_NOT_ACCEPTED', 'Error: 07 The credit card number you have entered appears to be a %s card. Unfortunately at this time we do not accept %s as payment.');
+define('TEXT_CCVAL_ERROR_BLACKLIST', 'Error: 08 We cannot accept your card as it is blacklisted, if you feel you have recieved this message in error please contact your card issuer.');
+define('TEXT_CCVAL_ERROR_SHORT', 'Error: 09 You have not entered the correct amount of digits. Please ensure you have entered all of the long number displayed on the front of your card');
+define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'Error: 10 The CCV/CVV/CID number entered is the incorrect length. Please try again.');
+REQUIRE(DIR_WS_LANGUAGES . 'add_ccgvdc_espanol.php');
+
+define('IMAGE_BUTTON_PRINT_ORDER', 'Pedido imprimible');
+
+// BOF: Lango Added for print order MOD
+define('IMAGE_BUTTON_PRINT', 'Imprimir');
+// EOF: Lango Added for print order MOD
+
+// BOF: Lango Added for Featured product MOD
+  define('BOX_CATALOG_FEATURED', 'Productos en promoción');
+// EOF: Lango Added for Featured product MOD
+
+// BOF: Lango Added for Sales Stats MOD
+define('BOX_REPORTS_MONTHLY_SALES', 'Ventas/impuestos mensuales');
+// EOF: Lango Added for Sales Stats MOD
+
+// BOF: Lango Added for template MOD
+// WebMakers.com Added: Attribute Sorter, Copier and Catalog additions
+require(DIR_WS_LANGUAGES . $language . '/' . 'attributes_sorter.php');
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  define('BOX_HEADING_INFORMATION', 'Sistema de información');
+  define('BOX_INFORMATION_MANAGER', 'Gestor de información');
+//DWD Modify End
+
+include('includes/languages/order_edit_english.php');
+
+ define('BOX_TITLE_CRELOADED', 'Proyecto CRE Loaded');
+ define('LINK_CRE_FORUMS','Foros de CRE Loaded');
+ define('LINK_CRW_SUPPORT','Soporte técnico');
+// General Release Edition
+ define('LINK_SF_CRELOADED','Source Forge Home');
+ define('LINK_SF_BUGTRACKER','Bug Tracker');
+ define('LINK_SF_SUPPORT','Petición de soporte');
+ define('LINK_SF_TASK','Seguimiento de tareas');
+ define('LINK_SF_CVS','Hojear CVS');
+ define('LINK_CRE_FILES','Descargas CRE');
+ define('LINK_SF_FEATURE','Solicitud de características');
+//included for Backup mySQL (courtesy Zen-Cart Team) DMG
+ define('BOX_TOOLS_MYSQL_BACKUP','Copia de seguridad de mySQL');
+//included for Orderlist 3.1 report DMG
+ define('BOX_REPORTS_ORDERLIST', 'Generate orderlist');
+
+// Included for Events Calendar 2.0 DMG
+define('BOX_TOOLS_EVENTS_MANAGER', 'Events Manager');
+define('IMAGE_NEW_EVENT', 'New Event');
+
+// VJ member approval added
+define('BOX_CUSTOMERS_APPROVAL', 'Waiting Approval');
+
+// DMG Sales Report 2
+  define('BOX_REPORTS_SALES_REPORT2', 'SalesReport2');
+  
+// DMG Zipcode Matching
+  define('BOX_REPORTS_ZIPCODE_MATCH','Customer Zip/State Mismatch');
+  
+//DMG FAQ System 2.1
+  define('BOX_HEADING_FAQ', 'FAQ System');
+  define('BOX_FAQ_MANAGER', 'FAQ Manager');
+  define('BOX_FAQ_CATEGORIES', 'FAQ Categories');
+  define('BOX_FAQ_VIEW', 'FAQ View');
+  define('BOX_FAQ_VIEW_ALL', 'FAQ View All');
+  
+  
+// Article Manager
+define('BOX_HEADING_ARTICLES', 'Noticias Encargado');
+define('BOX_TOPICS_ARTICLES', 'Secciones/Noticias');
+define('BOX_ARTICLES_CONFIG', 'Configuraci&oacute;n');
+define('BOX_ARTICLES_AUTHORS', 'Autores');
+define('BOX_ARTICLES_REVIEWS', 'Noticias Comentarios');
+define('BOX_ARTICLES_XSELL', 'Venta a trav&eacute;s de noticias');
+define('IMAGE_NEW_TOPIC', 'Nueva secci&oacute;n');
+define('IMAGE_NEW_ARTICLE', 'Nueva noticia');
+define('TEXT_DISPLAY_NUMBER_OF_AUTHORS', 'Mostrando de <b>%d</b> a <b>%d</b> (de <b>%d</b> autores)');
+define('IMAGE_NEW_AUTHOR', 'Nuevo Autor');
+define('TEXT_WARNING_NO_AUTHORS', 'ADVERTENCIA: Los autores vacíos Table!&nbsp;&nbsp;You DEBEN agregar por lo menos a un autor antes de que usted pueda agregar cualquier artículo');
+
+// Article Statistics Report DMG
+  define('BOX_REPORTS_ARTICLES_VIEWED', 'Articles Viewed');
+  define('TEXT_DISPLAY_NUMBER_OF_ARTICLES', 'Mostrando de <b>%d</b> to <b>%d</b> (of <b>%d</b> productos)');
+  
+// DMG :  Mulitple Products Manager
+
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_MULTI', 'Multiple Products Manager');
+
+
+// DMG : Specials by Category
+
+define('BOX_CATALOG_SPECIALSBYCAT','Specials By Category');
+
+// START: Product Extra Fields DMG
+  define('BOX_CATALOG_PRODUCTS_EXTRA_FIELDS', 'Product Extra Fields');
+// END: Product Extra Fields DMG
+
+// Customers Order Reports DMG
+
+define('BOX_REPORTS_CUSTOMERS_ORDERS', 'Customer Statistics');
+
+// Daily Sales Products reports  DMG
+define('BOX_REPORTS_DAILY_PRODUCTS_ORDERS', 'Daily Products Report');
+
+// Contact US Email Subject DMG
+define('BOX_TOOLS_EMAIL_SUBJECTS', 'Email Subjects');
+define('TEXT_DISPLAY_NUMBER_OF_EMAIL_SUBJECTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> email subjects)');
+
+define('BOX_REPORTS_EXPLAIN','osC Explain Queries');
+ 
+//define('BOX_HEADING_CRYPT', 'Encryption and Decryption'); 
+define('BOX_HEADING_CRYPT', 'Encrypt & Decrypt');
+define('BOX_CRYPT_CONFIGURATION', 'Configuration'); 
+define('BOX_CRYPT_TEST', 'Test'); 
+define('BOX_CRYPT_CC_DATA', 'CC Data'); 
+define('BOX_CRYPT_CONVERT', '&nbsp; Convert CC Data');
+define('BOX_CRYPT_PURGE', 'Purge CC Data');
+define('BOX_CRYPT_UPDATE', 'Update CC Data');
+define('BOX_CRYPT_KEYS', 'Manage Keys');
+define('BOX_CRYPT_HELP', 'Help');
+
+define('IMAGE_CONVERT', 'Convert info to new key');
+define('IMAGE_ENCRYPT', 'Encrypt data');
+define('IMAGE_DECRYPT', 'Decrypt data');
+define('IMAGE_RETURN', 'Return to main');
+define('IMAGE_EDIT_KEY', 'Edit Key File');
+define('IMAGE_CREATE', 'Create key');
+define('IMAGE_HELP', 'Help');
+define('IMAGE_RUN', 'Run');
+  define('BOX_DATA_EASYPOPULATE_BASIC', 'Easy Populate Basic');
+  define('BOX_DATA_EASYPOPULATE', 'Easy Populate Advance');
+  define('BOX_DATA_EASYPOPULATE_EXPORT', 'EPA Export');
+  define('BOX_DATA_EASYPOPULATE_IMPORT', 'EPA Import');
+  define('BOX_DATA_EASYPOPULATE_BASIC_EXPORT', 'EPB Export');
+  define('BOX_DATA_EASYPOPULATE_BASIC_IMPORT', 'EPB Import');
+  define('BOX_DATA_EASYPOPULATE_OPTIONS_EXPORT', 'Options Export');
+  define('BOX_DATA_EASYPOPULATE_OPTIONS_IMPORT', 'Options Import');
+  define('BOX_HEADING_DATA', 'Data Manager');
+  define('BOX_DATA', 'Data Feeds');
+  define('BOX_DATA_ADMIN', 'Data Configure');
+  define('BOX_HEADING_FEEDERS', 'Feeder Systems');
+  define('BOX_DATA_HELP', 'Data Help');
+  define('BOX_FEEDERS_AMAZON', 'Amazon Marketplace');
+  define('BOX_FEEDERS_BIZRATE', 'Biz Rate');
+  define('BOX_FEEDERS_FROOGLE', 'Froogle');
+  define('BOX_FEEDERS_MYSIMON', 'MySimon');
+  define('BOX_FEEDERS_PRICE_GRABBER', 'Price Grabber');
+  define('BOX_FEEDERS_SHOPPING', 'Shopping.com');
+  define('BOX_FEEDERS_YAHOO', 'Yahoo');
+
+define('BOX_HEADING_DOC', 'Documentation');
+define('BOX_DOC_ADMIN', 'Admin');
+define('BOX_DOC_CAT', 'Catalog');
+define('BOX_DOC_MISC', 'Miscellaneous');
+
+
+
+// Eversun mod for sppc and qty price breaks
+define('ENTRY_CUSTOMERS_GROUP_NAME', 'Customer Group:');
+define('BOX_CUSTOMERS_GROUPS', 'Customers Groups');
+define('ENTRY_COMPANY_TAX_ID', 'Company\'s tax id number:');
+define('ENTRY_COMPANY_TAX_ID_ERROR', '');
+define('ENTRY_CUSTOMERS_GROUP_REQUEST_AUTHENTICATION', 'Switch off alert for authentication:');
+define('ENTRY_CUSTOMERS_GROUP_RA_NO', 'Alert off');
+define('ENTRY_CUSTOMERS_GROUP_RA_YES', 'Alert on');
+define('ENTRY_CUSTOMERS_GROUP_RA_ERROR', '');
+// Eversun mod end for sppc and qty price breaks
+// DMG Mod for Customer Notification Report
+define('BOX_REPORTS_PRODUCTS_NOTIFICATIONS', 'Prod Notifications');//Products Notifications V3
+
+define('FOOTER_TEXT_BODY', 'Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a> and <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Using Version ' . PROJECT_VERSION);
+
+// VJ infosystem begin
+define('BOX_HEADING_PAGE_MANAGER', 'Page Manager');
+define('BOX_PAGES', 'Pages');
+define('BOX_PAGES_CATEGORIES', 'Categories');
+// VJ infosystem end
+
+define('BOX_SHIPWIRE', 'ShipWire');
+define('BOX_MODULES_CHECKOUT_SUCCESS', 'Checkout Success');
+
+define('BOX_HEADING_TECH_SUPPORT','Tech Support');
+define('BOX_HEADING_INSTALL_EXPLAIN','Explain Quires');
+define('IMAGE_BUTTON_BACK','Back');
+define('IMAGE_BUTTON_CONFIRM','Confirm');
+
+if(file_exists('includes/languages/english_newsdesk.php')) {
+include('includes/languages/english_newsdesk.php');
+include('includes/languages/english_faqdesk.php');
+}
+
+//coupons redeemed report
+define('BOX_REPORTS_COUPONS_REDEEMED','Coupons Redeemed');
+
+define("PAYPAL_HELP_CONFIGURATION_GUIDE","Configuration Guide");
+define("PAYPAL_HELP_FREQUENTLY_ASKED_QUESTIONS","Frequently Asked Questions");
+define("PAYPAL_CONTENTS","Contents");
+define("PAYPAL_HELP_CONTENTS1","The following is a guide towards configuring your store's PayPal payment module settings:");
+
+define("PAYPAL_HELP_CONTENTS2",'<ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">Enable PayPal Module</b><br />Since you have just done the installation, by default it will say yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">E-Mail Address</b><br />Enter your Primary PayPal email address here, if you have more than one email address registered with PayPal then you must login your PayPal account to determine which one is your <b>Primary</b> email address.</li><br /><br class="h6" />
+      <li><b class="ppem380">Business ID</b><br />If you have configured a secondary email address to be your Business ID (email address) in your PayPal profile account, then enter this here, otherwise enter the one used above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Transaction Currency</b><br />Choose which currencies you want to accept PayPal payments with.</li><br /><br class="h6" />
+      <li><b class="ppem380">Payment Zone</b><br />If a zone is selected, only enable this payment method for that zone.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Pending Notification</b> Order Status</b><br />Set the Pending Notification status of orders made with this payment module to this value, \'<b style="color:blue">Pending</b>\' is suggested or alternatively the optional order status created in step 4 above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Order</b> Status</b><br />Set the status of orders made with this payment module to this value <b style="color:red">Do not set it to \'default\' but specifically choose the status required</b>, \'<b style="color:blue">Processing</b>\' is suggested.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>On Hold Order</b> Status</b><br />This order status is used when the Cart Test has failed, eg. the expected payment amount did not match.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Canceled Order</b> Status</b><br />Refunded, Reversed, Failed or Denied payments will be set to this order status.</li><br /><br class="h6" />
+      <li><b class="ppem380">Synchronize Invoice</b><br />Specify whether the osCommerce order number should be used as a <b>unique</b> PayPal invoice number, similiar to PayPal\'s Send Money feature, this will enable customers to resume an order via their osCommerce account history info page for that order for pending transactions which were not previously completed.</li><br /><br class="h6" />
+      <li><b class="ppem380">Sort order of display</b><br />Sort order of display. Lowest is displayed first.</li><br /><br class="h6" />
+      <li><b class="ppem380">Background Color</b><br />Select the background color of PayPal\'s payment pages, either black or white.</li><br /><br class="h6" />
+      <li><b class="ppem380">Processing logo</b><br />Specify the image file name to be used in the store\'s checkout process splash page, must be located in <code>catalog/images</code> directory.</li><br /><br class="h6" />
+      <li><b class="ppem380">Store logo</b><br />Specify the image file name for PayPal to display on their payment pages pages, must be located in <code>catalog/images</code> directory. If you do not have SSL then leave this field blank.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Page Style Name</b><br />Specify the name of the page style you have configured in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">Include a note with payment</b><br />When a customer arrives at the PayPal payment page you can choose whether or not to show them another note field which will have seperate contents from that of the one provided in your store\'s checkout process but will be included in PayPal\'s invoice and receipt.<br />To change the title appearing above this field on the PayPal payment page look in the corresponding catalog langauge file (<code>catalog/includes/langauges/english/modules/payment/paypal.php</code>).</li><br /><br class="h6" />
+      <li><b class="ppem380">Shopping Cart Method</b><br />Choose which type of PayPal Shopping Cart you want to use, Aggregate simply means the total amount is passed (with a list of the products shown in a single item field), whereas an Itemized Cart will list indivudally all the items the customer has selected in their PayPal invoice.</li><br /><br class="h6" />
+      <li><b class="ppem380">Enable PayPal Shipping Address</b><br />Allow the customer to choose their own PayPal shipping address. (See <a href="'.tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL') .'">FAQ\'s</a> for more info)</li><br /><br class="h6" />
+      <li><b class="ppem380">Digest Key</b><br />Specify a unique digest key, this will then be used similiar to a password while testing via the IPN Test Panel <b>and</b> also the store\'s PayPal transaction signature digest key.</li><br /><br class="h6" />
+      <li><b class="ppem380">Test Mode</b><br />This should be off for live environments.<br />You can simulate your own IPNs via the <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp') .'">IPN Test Panel</a>.</li><br /><br class="h6" />
+      <li><b class="ppem380">Cart Test</b><br />This test verifies that the amount received via PayPal matches to what is expected (See <a href="'. tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL').'">FAQ\'s</a> for more info).</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notifications</b><br />Choose whether you want to receive debug emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notification Address</b><br />Enter a seperate email address where you wish to receive <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Domain</b><br />This must be set to <b>paypal.com</b> for live production environments, this setting is to facilate PayPal\'s sandbox and is not related to the IPN Test Panel or the above Test Mode option.</li><br /><br class="h6" />
+      <li><b class="ppem380">Return URL behavior</b><br />This determines what method PayPal should use when returning the customer back to the store, leave this set to 1 (GET).</li><br /><br class="h6" />
+    </ul>');
+
+
+
+define("PAYPAL_FAQ_CONTENTS1","The following are some frequently asked questions about this payment module:");
+
+define("PAYPAL_FAQ_CONTENTS2",'<ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">My shipping costs are different once the customer arrives at the PayPal site.</b></legend><div>In your PayPal account profile in the shipping section, check the box that allows overriding the shipping costs.</li><br /><br class="h6" />
+      <li><b class="ppem380">Do I need to enable IPN in my PayPal account profile.</b><br />No.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the IPN feature to be used.</b><br />You don\'t need to, it will automatically be specified.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why doesn\'t the Auto-Return feature work.</b><br />You must enable it first in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the Auto-Return feature.</b><br />It doesn\'t matter, this contribution will automatically specify the correct script url location, which is now <code>catalog/checkout_success.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Does this contribution support PayPal Credit Card payments.</b><br />Yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I getting so many emails per transaction.</b><br />You get <b>one</b> from PayPal and <b>one</b> osCommerce order confirmation email, and another which is the <b>debug email</b>, either disable <b>debug</b> email notification or specify a sperate email address for <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I not receiving any IPNs.</b><br />You must ensure that your <b>Primary Email Address</b> and <b>Business ID</b> are configured correctly.<br />Login to your PayPal Account and see what and how many email addresses you are using and which one is the Primary address.<br />Also check your debug emails as it will also specify the Primary Email Address of the intended receiver.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m having problems with Multi-Currencies.</b><br />This problem should now be resolved, previously the <b>Cart Test</b> was comparing the currency and amounts of the actual order to what PayPal received as opposed to actually comparing the currency and amounts prior to transfering the customer to PayPal.<br /><br /><b>However</b>, if you\'re using the Itemized Shopping Cart then discrepancies may arise due to PayPal\'s two decimal place calculations, in such an event the order will be placed on hold. Although this type of discrepancy may not affect all orders it does however exist and now adds a future requirement to enable you to finalize the transaction via your store\'s admin.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m having problems verifying the Cart Totals.</b><br />See above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why is there no PayPal shipping address details in the IPN info?</b><br />Set Enable PayPal Shipping Address to \'No\' if you require a PayPal verified shipping address or set to \'Yes\' if you do not.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can I customize the Checkout redirect page.</b><br />The splash template page shown while transfering the customer to PayPal is:<br /><code>catalog/includes/modules/payment/paypal/catalog/checkout_splash.inc.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find more PayPal logo buttons.</b><br />Login to your PayPal account and click Merchant Tools or Auction Tools.</li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find PayPal documentation.</b><br /><ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;"><li><a href="https://www.paypal.com/en_US/pdf/integration_guide.pdf">PayPal Integration Manual</a></li></ul></li><br /><br class="h6" />
+
+      <li><b class="ppem380">How do I use PayPal\'s Sandbox.</b>
+        <ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;">
+          <li>Register with <a href="https://developer.paypal.com/" target="PPDC">PayPal Developer Central</a></li><br class="h6" />
+          <li>Then create <b>two virtual accounts</b> types:<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Personal Account</li><li>Premier or Business Account</li></ul></li><br class="h6" />
+          <li>Confirm both accounts (each is just a single click option).</li><br class="h6" />
+          <li>Transfer some virtual money into your personal account (Click the add funds link).</li><br class="h6" />
+          <li>Emails to both accounts will appear in the section where you initially login into the PayPal Developer Central, no real emails are sent so the email addresses for your virtual accounts should be fictitious.</li><br class="h6" />
+          <li>Now in your <a href="'. tep_href_link(FILENAME_MODULES,'set=payment&module=paypal&action=edit').'" target="_blank">osCommerce::Admin::Modules::Payment::PayPal</a> configuration section<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Enter the virtual business account email address into both the Primary Email Address and Business ID fields</li><li>Set the domain to www.sandbox.paypal.com</li></ul></li><br class="h6" />
+          <li>Now checkout as a customer via the store, this account should have a real email address (so that you can receive the osC customer order confirmation email), and when you arrive at the PayPal Sandbox site (look for their logo) then login using the virtual personal account details and finalize the payment process.</li>
+        </ul>
+       <br /><p class="ppsmallerrorbold">Note that you must first login via the PayPal Developer Central prior to testing the Sandbox/Checkout process.</p>
+      </li><br /><br class="h6" />
+
+      <li><b class="ppem380">What\'s the difference between the IPN Test Panel and using PayPal\'s Sandbox.</b><br />The <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp').'" target="itp">IPN Test Panel</a> is an independent osCommerce Contribution feature, for testing and development purposes, which allows you to simmulate your own IPNs without having to interact with PayPal.<br /><br /><p class="ppsmallerrorbold">All Test IPNs via the IPN Test Panel will be invalid according to PayPal since they\'re not authentic transactions.</p></li><br /><br class="h6" />
+      <li><b class="ppem380">Is the IPN Test Panel related to PayPal\'s Sandbox.</b><br />No, see above.</li><br /><br class="h6" />
+      <li><b class="ppem380">What\'s the purpose of the digest key.</b><br />Currently the digest key serves two purposes, it authenticates and allows you to use the <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp').'" target="itp">IPN Test Panel</a>, secondly, untill such time that PayPal provides a secure method of associating an IPN specifically to a particular order, it serves as a unique transaction signature identifier.</li><br /><br class="h6" />
+      <li><b class="ppem380">Should I change the digest key default value.</b><br />Yes, but remember what it is if uninstalling and reinstalling this contrib payment module in the admin since there might be existing pending orders which will require it in order to associate with to their corresponding IPN(s).</li><br /><br class="h6" />
+      <li><b class="ppem380">How are IPNs deleted.</b><br />Currently, an IPN appearing the admin section is deleted automatically when deleting it\'s corresponding order.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can a customer resume their order.</b><br />Currently, if the customer abandons the checkout process at the PayPal site, e.g for some reason they did not actually pay at that time, then they can log into their osCommerce account and click the confirm order button when viewing the details of that particular order in their account_history_info.<br /><br />This feature is only available when <b>synchronizing invoices</b> with PayPal.<br /><br />This means that if you ever reset the osCommerce <code>orders</code> database table then you must also update it\'s auto-increment value to be greater than the last known <code>order_id</code>.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m getting errors after installing the contribution.</b><br />First, go through the installation edits and remove any blank spaces at the beginning of the line(s), some text editors will insert hidden characters which is a side effect of copying and pasting from HTML documentation.<br />Make sure that the alterations have been performed as well as running the paypal_ipn.sql script.</li><br /><br class="h6" />
+
+      <li><b class="ppem380">What type of PayPal account do I need.</b><br />You will need either a Premier or Merchant Business Account. <a href="https://www.paypal.com/refer/pal=PS2X9Q773CKG4" target="_blank">Click&nbsp;here&nbsp;to&nbsp;register&nbsp;for&nbsp;an&nbsp;account</a> if you do not already have one.</li><br /><br class="h6" />
+    </ul>');
+
+
+
+define("PAYPAL_IPN_TEST_MODE1","Test Mode must be enabled!");
+define("PAYPAL_IPN_TEST_MODE_ADVANCED","Advanced");
+define("PAYPAL_IPN_TEST_MODE_HELP_WITH_THIS_PAGE","Help with this page");
+define("PAYPAL_IPN_TEST_MODE_PRIMARY_PAYPAL_EMAIL_ADDRESS","Primary PayPal Email Address");
+define("PAYPAL_IPN_TEST_MODE_BUSINESS_ID","Business ID");
+define("PAYPAL_IPN_TEST_MODE_DEBUG_EMAIL_ADDRESS","Debug Email Address");
+
+define("PAYPAL_IPN_TEST_MODE_FIRST_NAME","First Name");
+define("PAYPAL_IPN_TEST_MODE_LAST_NAME","Last Name");
+define("PAYPAL_IPN_TEST_MODE_BUSINESS_NAME","Business Name");
+define("PAYPAL_IPN_TEST_MODE_EMAIL_ADDRESS","Email Address");
+define("PAYPAL_IPN_TEST_MODE_PAYER_ID","Payer ID");
+define("PAYPAL_IPN_TEST_MODE_PAYER_STATUS","Payer Status");
+define("PAYPAL_IPN_TEST_MODE_VERIFIED","verified");
+define("PAYPAL_IPN_TEST_MODE_UNVERIFIED","unverified");
+define("PAYPAL_IPN_TEST_MODE_INVOICE","Invoice");
+
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_NAME","Address Name");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STREET","Address Street");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_CITY","Address City");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STATE","Address State");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_ZIP","Address Zip");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_COUNTRY","Address Country");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STATUS","Address Status");
+define("PAYPAL_IPN_TEST_MODE_CONFIRMED","confirmed");
+define("PAYPAL_IPN_TEST_MODE_UNCONFIRMED","unconfirmed");
+
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_TYPE","Payment Type");
+define("PAYPAL_IPN_TEST_MODE_INSTANT","instant");
+define("PAYPAL_IPN_TEST_MODE_ECHECK","echeck");
+define("PAYPAL_IPN_TEST_MODE_TRANSACTION_TYPE","Transaction Type");
+define("PAYPAL_IPN_TEST_MODE_SELECT","--select--");
+define("PAYPAL_IPN_TEST_MODE_CART","cart");
+define("PAYPAL_IPN_TEST_MODE_WEB_ACCEPT","web_accept");
+define("PAYPAL_IPN_TEST_MODE_SEND_MONEY","send_money");
+define("PAYPAL_IPN_TEST_MODE_CUSTOM","Custom");
+define("PAYPAL_IPN_TEST_MODE_TRANSACTION_ID","Transaction ID");
+define("PAYPAL_IPN_TEST_MODE_PARENT_TRANSACTION_ID","Parent Transaction ID");
+define("PAYPAL_IPN_TEST_MODE_NO_CART_ITEMS","No. Cart Items");
+define("PAYPAL_IPN_TEST_MODE_NOTIFY_VERSION","Notify Version");
+define("PAYPAL_IPN_TEST_MODE_NOTIFY_VERSION_VALUE","1.6");
+define("PAYPAL_IPN_TEST_MODE_MEMO","Memo");
+
+define("PAYPAL_IPN_TEST_MODE_MC_CURRENCY","MC Currency");
+define("PAYPAL_IPN_TEST_MODE_USD","USD");
+define("PAYPAL_IPN_TEST_MODE_GBP","GBP");
+define("PAYPAL_IPN_TEST_MODE_EUR","EUR");
+define("PAYPAL_IPN_TEST_MODE_CAD","CAD");
+define("PAYPAL_IPN_TEST_MODE_JPY","JPY");
+define("PAYPAL_IPN_TEST_MODE_MC_GROSS","MC Gross");
+define("PAYPAL_IPN_TEST_MODE_MC_FEE","MC Fee");
+
+define("PAYPAL_IPN_TEST_MODE_SETTLE_AMOUNT","Settle Amount");
+define("PAYPAL_IPN_TEST_MODE_SETTLE_CURRENCY","Settle Currency");
+define("PAYPAL_IPN_TEST_MODE_EXCHANGE_RATE","Exchange Rate");
+
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS","Payment Status");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_COMPLETED","Completed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_PENDING","Pending");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_FAILED","Failed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_DENIED","Denied");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_REFUNDED","Refunded");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_REVERSED","Reversed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_CANCELED_REVERSAL","Canceled_Reversal");
+
+define("PAYPAL_IPN_TEST_MODE_PENDING_REASON","Pending Reason");
+define("PAYPAL_IPN_TEST_MODE_MULTI_CURRENCY","multi_currency");
+define("PAYPAL_IPN_TEST_MODE_INTL","intl");
+define("PAYPAL_IPN_TEST_MODE_VERIFY","verify");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS","address");
+define("PAYPAL_IPN_TEST_MODE_UPGRADE","upgrade");
+define("PAYPAL_IPN_TEST_MODE_UNILATERAL","unilateral");
+define("PAYPAL_IPN_TEST_MODE_OTHER","other");
+
+define("PAYPAL_IPN_TEST_MODE_REASON_CODE","Reason Code");
+define("PAYPAL_IPN_TEST_MODE_CHARGEBACK","chargeback");
+define("PAYPAL_IPN_TEST_MODE_GUARANTEE","guarantee");
+define("PAYPAL_IPN_TEST_MODE_BUYER_COMPLAINT","buyer_complaint");
+define("PAYPAL_IPN_TEST_MODE_REFUND","refund");
+
+define("PAYPAL_IPN_TEST_MODE_TAX","Tax");
+define("PAYPAL_IPN_TEST_MODE_FOR_AUCTION","For Auction");
+define("PAYPAL_IPN_TEST_MODE_NO","No");
+define("PAYPAL_IPN_TEST_MODE_YES","Yes");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_BUYER_ID","Auction Buyer ID");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_CLOSING_DATE","Auction Closing Date");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_MULTI_ITEM","Auction Multi-Item");
+
+define("PAYPAL_IPN_TEST_MODE_ITEM_NAME","Item Name");
+define("PAYPAL_IPN_TEST_MODE_ITEM_NUMBER","Item Number");
+define("PAYPAL_IPN_TEST_MODE_QUANTITY","Quantity");
+
+
+define("PAYPAL_IPN_TEST_MODE_HELP1","The following is a quick guide towards simmulating your own IPNs:");
+
+
+define("PAYPAL_IPN_TEST_MODE_HELP2",' <br><ol>
+      <li>Begin to check out as a customer via the store, stop when you get to the PayPal site</li><br><br class="h6">
+      <li>Go into the store admin orders section and find the last order (just created)</li><br><br class="h6">
+      <li>Select a <b>Transaction Type</b>, usually cart or web_accept, but nothing for refunds, reversals, or canceled_reversals payments</li><br><br class="h6">
+      <li>Copy and paste the <b>Transaction Signature</b> into the <b>Custom</b> field and into the <b>Transaction ID</b> field</li><br><br class="h6">
+      <li>If the <b>Cart Test</b> is on, then make sure that the above <b>MC Gross</b> amount is the same as the order total and that the <b>MC&nbsp;Currency</b> field is set to the same currency as the order.</li><br><br class="h6">
+      <li>Submit the Test IPN</li><br><br class="h6">
+      <li>Now check the admin order status</li><br><br class="h6">
+    </ol>');
+
+define("PAYPAL_IPN_TEST_MODE_HELP3","When testing Pending payments etc, remember to use the same Transction ID");
+
+##################### 03/07/2006 Start  ####################
+
+define("NON_TTF_FONT_ERROR","Non-TTF font size must be 1,2,3,4 or 5");
+define("SETLEGEND_ERROR","Error: SetLegend argument must be an array");
+
+define("UNABLE_TO_OPEN_ERROR","Unable to open ");
+define("UNABLE_TO_OPEN_GIF_ERROR"," as a GIF");
+define("UNABLE_TO_OPEN_PNG_ERROR"," as a PNG");
+define("UNABLE_TO_OPEN_JPG_ERROR"," as a JPG");
+define("SELECT_IMAGE_ERROR","Please select wbmp,gif,jpg, or png for image type!");
+define("SELECT_IMAGE_TYPE_ERROR","Please select an image type!");
+define("NOT_ACCEPTABLE_PLOT_TYPE_ERROR"," not an acceptable plot type");
+define("UNKNOWN_CHART_TYPE_ERROR","ERROR: unknown chart type");
+define("LOG_PLOTS_DATA_GREATER_ERROR","Log plots need data greater than 0");
+define("ERROR_IN_DATA","Error in Data - max not gt min");
+define("FATAL_ERROR","Fatal error");
+define("THINBARLINES_DATA_TYPE_ERROR","Data Type for ThinBarLines must be data-data");
+define("BAR_PLOTS_DATA_TYPE_ERROR",'Bar plots must be text-data: use function SetDataType("text-data")');
+define("NO_IMAGE_DEFINED_DRAWGRAPH_ERROR","No Image Defined: DrawGraph");
+define("NO_ARRAY_OF_DATA_IN_ERROR","No array of data in ");
+
+
+
+##################### 03/07/2006 End  ####################
+
+
+##################### 04/07/2006 Start  ####################
+
+define("SESSION_FILE_OPEN_ERROR_1",'Could not open session file (');
+define("SESSION_FILE_OPEN_ERROR_2",').');
+define("SESSION_FILE_WRITE_ERROR_1",'Could not write session file (');
+define("SESSION_FILE_WRITE_ERROR_2",').');
+define("CACHING_METHOD_ERROR_1",'Caching method ');
+define("CACHING_METHOD_ERROR_2",' not implemented.');
+define("INITIALIZE_SESSION_MODULE_ERROR",'Failed to initialize session module.');
+define("SESSION_NOT_SAVED_ERROR",'Session could not be saved.');
+define("SESSION_NOT_CLOSED_ERROR",'Session could not be closed.');
+define("SESSION_NOT_STARTED_ERROR",'Session could not be started.');
+
+
+define("CANNOT_COPY_PRODUCT_ERROR_1",'<b>WARNING: Cannot copy from Product ID #');
+define("CANNOT_COPY_PRODUCT_ERROR_2",' to Product ID # ');
+define("CANNOT_COPY_PRODUCT_ERROR_3",' ... No copy was made</b>');
+define("NO_ATTRIBUTES_COPY_ERROR_1",'<b>WARNING: No Attributes to copy from Product ID #');
+define("NO_ATTRIBUTES_COPY_ERROR_2",' for: ');
+define("NO_ATTRIBUTES_COPY_ERROR_3",' ... No copy was made</b>');
+define("NO_PRODUCT_ERROR_1",'<b>WARNING: There is no Product ID #');
+define("NO_PRODUCT_ERROR_2",' ... No copy was made</b>');
+
+
+define("MCRYPT_ALGORITHMS_AND_MODES",'Mcrypt Algorithms and Modes');
+define("MCRYPT_ALGORITHM",'Algorithm');
+define("MCRYPT_Status",'Status');
+define("MCRYPT_OK",'OK');
+define("MCRYPT_NOT_OK",'NOT OK');
+define("MCRYPT_NOT_TESTED",'NOT TESTED');
+define("MCRYPT_MAXIMUM_KEY_SIZES_ALLOWED",'Maximum Key Sizes Allowed');
+define("MCRYPT_MAXIMUM_KEY_SIZE",'Maximum Key Size');
+define("MCRYPT_KEY_TEXT",'this is a very long key, even too long for the cipher');
+define("MCRYPT_PLAIN_TEXT",'very important data');
+
+define("DATABASE_TEP_DB_ERROR",'[TEP STOP]');
+
+define("CANNOT_CHANGE_THE_MODE_OF_FILE","Cannot change the mode of file");
+define("FAILED_TO_OPEN_FILE",'Failed to open file ');
+define("CANNOT_WRITE_TO_FILE",'Cannot write to file ');
+
+define("UNABLE_TO_DETERMINE_PAGE_LINK",'<b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function used:<br><br>');
+define("UNABLE_TO_DETERMINE_CONNECTION_METHOD_ON_PAGE_LINK",'<b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>');
+
+
+define("SUPPORT_DESK",'Support Desk');
+
+define("FRAUDSCREENCLIENT_AFS",'AFS');
+define("FRAUDSCREENCLIENT_QUERY_RESULT",'query result');
+define("FRAUDSCREENCLIENT_SERVER_UNAVAILABLE","Algozone Fraud Screen Server currently unavailable. Please try again later.");
+define("FRAUDSCREENCLIENT_AFS_INPUTS","AFS Inputs");
+define("FRAUDSCREENCLIENT_INPUT","input");
+define("FRAUDSCREENCLIENT_INVALID_INPUT","invalid input");
+define("FRAUDSCREENCLIENT_MISSPELLED_FIELD","- perhaps misspelled field?");
+define("FRAUDSCREENCLIENT_AFS_USING_CURL","AFS using curl");
+define("FRAUDSCREENCLIENT_AFS_CURL_PARAMS","AFS curl params");
+define("FRAUDSCREENCLIENT_AFS_CURL_NOT_SUPPORT","<br>error: this version of curl does not support HTTPS try build curl with SSL or specify");
+define("FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_1","Received error message");
+define("FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_2","from curl");
+define("FRAUDSCREENCLIENT_AFS_CURL_PROXY","<p>using curl thru proxy");
+define("FRAUDSCREENCLIENT_AFS_USING_FSOCKOPEN","<p><b>AFS using fsockopen</b>");
+define("FRAUDSCREENCLIENT_AFS_SOCKET_PARAM","AFS socket url param");
+define("FRAUDSCREENCLIENT_AFS_FSOCKOPEN_PROXY","<p><b>AFS using fsockopen proxy<b><br>");
+define("FRAUDSCREENCLIENT_AFS_PROXY_PORT","<br>error: you need to provide the proxy port number to use the proxy port provided");
+define("FRAUDSCREENCLIENT_AFS_INSTALL_CURL","<br>error: you need to install curl if you want secure HTTPS or specify the variable to be");
+define("FRAUDSCREENCLIENT_AFS_QUERY_RESULTS","<p><b>AFS query results: </b>");
+define("FRAUDSCREENCLIENT_AFS_OUTPUT","output");
+
+define("MAP_MSG","<p>Courtesy of the U.S. Census Bureau's TIGER Mapping Service");
+
+define("ATTRIBUTES_DISPLAY_MSG","**Discounts may vary based on selected options");
+
+define("FOOTER_TEXT_1",'E-Commerce Engine Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a> Portions Copyright &copy; 2003 - 2006 <a href="http://www.creloaded.com" target="_blank">CRE Loaded Project</a><br>osCommerce provides no warranty and is redistributable under the <a href="http://www.fsf.org/licenses/gpl.txt" target="_blank">GNU General Public License</a><br><a href="http://www.chainreactionworks.com" target="_blank">Chain Reaction Works, Inc</a> provides no warranty except as to associated support contracts<br>which are limited by and to the Service Level Agreement.</br>');
+define("FOOTER_TEXT_2",'Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.creloaded.com" target="_blank">CRE Loaded</a>');
+
+
+##################### 04/07/2006 End  ####################
+
+
+##################### 05/07/2006 End  ####################
+
+define("AUTHORIZE_NET_HELP_TITLE","Authorize.net Consolidated CRE Help Screen");
+define("AUTHORIZE_NET_HELP_MSG_1","Authorize.net Consolidated CRE Edition");
+define("AUTHORIZE_NET_HELP_MSG_2","Configuration Help Screen");
+define("AUTHORIZE_NET_HELP_MSG_3",'<a href="http://ecommexchange.com"><h2>Link to Apply for Authorize.net account</h2></a><br>(support the CRE project by using our Authorize.net partner)');
+define("AUTHORIZE_NET_HELP_MSG_4",'User your browser back button to return to the Authorize.net edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Authorize.net testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Authorize.net Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Authorize.net User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Authorize.net Consolidated uses the AIM method of
+connecting to Authorize.net.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Authorize.net gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don\'t know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Authorize.net Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Authorize.net Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>
+<li>Trouble Shooting Notes </li>
+<p>If you experience high levels of transaction failure, you may need to adjust your sessions configuration.  Consult your technical support team for more information</p> ');
+
+##################### 05/07/2006 End  ####################
+##################### 06/07/2006 Start  ####################
+
+define("FEATURE_NOT_PRESENT_TEXT",'<p class="style4">CRE Loaded Standard Version is the perfect application
+        to power your e-Commerce websites. However, if you need features that
+        only a Pro-level application can deliver, please take a look at all the
+        powerful options our Pro Version adds. If you are looking to deploy a
+        powerful Business to Business solution, our Pro B2B has added features
+        to enhance sales and productivity.</p>
+
+        <p class="style4">Feel free to contact us for more details or usage guidlines. </p>');
+
+define("HEADER_TAGS_ENGLISH_TXT_1","Default Title");
+define("HEADER_TAGS_ENGLISH_TXT_2","Default Descriptions");
+define("HEADER_TAGS_ENGLISH_TXT_3","Default Keyword(s)");
+define("HEADER_TAGS_ENGLISH_TXT_4","HTTA: ");
+define("HEADER_TAGS_ENGLISH_TXT_5","HTDA: ");
+define("HEADER_TAGS_ENGLISH_TXT_6","HTKA: ");
+define("HEADER_TAGS_ENGLISH_TXT_7","HTCA: ");
+define("HEADER_TAGS_ENGLISH_TXT_8","(Explain) ");
+define('HEADER_TAGS_ENGLISH_TXT_9', 'Title');
+define('HEADER_TAGS_ENGLISH_TXT_10', 'Descriptions');
+define('HEADER_TAGS_ENGLISH_TXT_11', 'Keyword(s)');
+
+
+define('HEADER_TAGS_FILL_TAGS_TXT_1', 'CATEGORIES');
+define('HEADER_TAGS_FILL_TAGS_TXT_2', 'PRODUCTS');
+define('HEADER_TAGS_FILL_TAGS_TXT_3', 'Skip all tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_4', 'Fill only empty tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_5', 'Fill all tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_6', 'Clear all tags');
+
+define("INSTALL_EXPLAIN_TXT_1","Install (and Uninstall) Database Settings script for osC-Explain - by Chemo");
+define("INSTALL_EXPLAIN_TXT_2",'<p><b>Install option selected...running queries</b></p>');
+define("INSTALL_EXPLAIN_TXT_3",'<p>STEP 1 => Add configuration group</p>');
+define("INSTALL_EXPLAIN_TXT_4",'<p>Added the configuration group ');
+define("INSTALL_EXPLAIN_TXT_5",'successfully...adding configuration values</p>');
+define("INSTALL_EXPLAIN_TXT_6",'<p>STEP 2 => Add configuration settings</p>');
+define("INSTALL_EXPLAIN_TXT_7","<blockquote>Success...</blockquote>");
+define("INSTALL_EXPLAIN_TXT_8","<p>Added the configuration settings successfully...adding the 'explain_queries' table</p>");
+define("INSTALL_EXPLAIN_TXT_9",'<p>STEP 3 => Creating explain_queries table</p>');
+define("INSTALL_EXPLAIN_TXT_10",'<blockquote>Successfully created the table.</blockquote>');
+define("INSTALL_EXPLAIN_TXT_11","<p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>");
+
+define("INSTALL_EXPLAIN_TXT_12","<p><b>Uninstall optin selected...running queries</b></p><p>STEP 1 => Delete the configuration group from configuration_group table</p>");
+
+define("INSTALL_EXPLAIN_TXT_13",'<blockquote>Deleted the configuration group successfully...removing configuration values</blockquote><p>STEP 2 => Delete configuraton values</p>');
+
+define("INSTALL_EXPLAIN_TXT_14",'<blockquote>Deleted the configuration values successfully...dropping the explain_queries table</blockquote><p>STEP 3 => Dropping explain_queries table</p>');
+
+
+define("INSTALL_EXPLAIN_TXT_15",'<blockquote>Table dropped successfully...analyzing tables</blockquote><p>STEP 4 => Analyzing configuration_group and configuration table</p>');
+
+define("INSTALL_EXPLAIN_TXT_16","<blockquote>Analyze configuration_group success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_17","<blockquote>Analyze configuration success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_18","<blockquote>Optimize configuration_group success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_19","<blockquote>Optimize configuration success...</blockquote><p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>");
+
+define("INSTALL_EXPLAIN_TXT_20",'<p>Welcome to the barebones osC-Explain installation script (<a href="http://forums.oscommerce.com/index.php?showuser=9196">by   Chemo</a>)!</p><p>This contribution is GPL and the target audience is fellow coders, optimizers,   and knowledgeable webmasters. I encourage each of you to look over the   code and add functionality so that the rest of us can benefit as well.</p><p>There are two options for this script:</p><p><strong>INSTALL</strong></p><blockquote>  <p>This option is self explanatory :) It will add a configuration group     with the title &quot;Explain Queries&quot; and set the sort order to 99 (making     it the last listed). The script will then add values to the configuration     table that is the options for this contribution. Currently, these are     available:</p>  <ul>    <li> Global on / off</li>    <li>Enable on for specific scripts (add one or list separated by comma).       This will be handy for contribution coders since they can enable only for       their development scripts and not waste room for storing other page queries.       In addition, it will speed up the admin report if there are 1,000 rows instead       of 500,000 :)</li>    <li>Enable page exclusion for specific scripts. This is handy to exclude       certain scripts (for instance, ones already optimized) but capture the rest.</li>  </ul>  <p>The last thing this install script does is add a new table called \'explain_queries\'.    This is needed to store the data. Do not change the name since the table     name is hardcoded all over the place. Why not add a new define to filenames.php?     If there is room to trim install steps and decrease the number of file changes     I\'ll take it any day of the week and twice on Sunday. You are (hopefully)     an experienced osC developer so if you want to do define table names the standard     way edit your own files.</p></blockquote><p align="center"><strong><a href="'.$_SERVER['PHP_SELF'].'?action=install">INSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p><p align="left"><strong>UNINSTALL</strong></p><blockquote>  <p align="left">Hopefully, this option is self-explanatory too :) This     will delete all the values associated with osC-Explain from the configuration_group     and configuration tables. Then it will analyze the tables to reset the     cardinality of the tables. Next, the script will drop the \'explain_queries\'     table.</p></blockquote><p align="center"><strong><a href="'.$_SERVER['PHP_SELF'].'?action=delete">UNINSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p><p align="left"><strong>NOTES</strong>: By default all values are set to false.   So, once you have the files uploaded and necessary changes have been made you\'ll   have to enable it through the admin control panel. </p><blockquote>  <p align="left">Configuration -> Explain Queries -> Enable explain queries     -> true</p></blockquote>');
+
+define("VALID_CATEGORIES_PRODUCTS_LIST","Valid Categories/Products List");
+define("VALID_CATEGORIES_LIST","Valid Categories List");
+define("VALID_PRODUCTS_LIST","Valid Products List");
+
+
+define("CRE_LOADED_OSCOMMERCE","CRE Loaded osCommerce");
+define("PASS_FORGOTTEN_FOOTER",'E-Commerce Engine Copyright &copy; 2003 <a href="http://oscommerce.com" target="_blank">osCommerce</a> <br>      Supercharged by <a href="http://creloaded.com" target="_blank">CRE Loaded</a>');
+
+##################### 06/07/2006 End  ####################
+
+
+##################### 07/07/2006 End  ####################
+
+define("QUICK_ATTRIBUTES_POPUP_TXT_0",'Current Attributes');
+define("QUICK_ATTRIBUTES_POPUP_TXT_1","Current ID#");
+define("QUICK_ATTRIBUTES_POPUP_TXT_2","Model:");
+define("QUICK_ATTRIBUTES_POPUP_TXT_3","NO CURRENT ATTRIBUTES ...");
+define("QUICK_ATTRIBUTES_POPUP_TXT_4",'CURRENT ATTRIBUTES:');
+define("QUICK_ATTRIBUTES_POPUP_TXT_5",'Close Window');
+
+define("QUICK_PRODUCTS_POPUP_TXT_0",'Quick Products Listing');
+define("QUICK_PRODUCTS_POPUP_TXT_1",'Quick Product Locator');
+define("QUICK_PRODUCTS_POPUP_TXT_2",'All categories:');
+define("QUICK_PRODUCTS_POPUP_TXT_3",'Click to:');
+define("QUICK_PRODUCTS_POPUP_TXT_4",'Show Attributes');
+
+
+define("QUICKCOM_HELP_TXT_1",'Quickcommerce Consolidated CRE Help Screen');
+define("QUICKCOM_HELP_TXT_2",'Quickcommerce Consolidated CRE Edition');
+define("QUICKCOM_HELP_TXT_3",'Configuration Help Screen');
+define("QUICKCOM_HELP_TXT_4",'<a href=" https://freecreditcardprocessing.com/applynow/online_application.asp?code=chainreaction"> <h2>Link to Apply for Quickcommerce account</h2></a><br>(support the CRE project by using our authorize.net partner)');
+define("QUICKCOM_HELP_TXT_5",'User your browser back button to return to the Quickcommerce edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Quickcommerce testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Quickcommerce Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Quickcommerce User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Quickcommerce Consolidated uses the AIM method of
+connecting to Quickcommerce.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Quickcommerce gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don\'t know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Quickcommerce Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Quickcommerce Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>');
+
+
+define("STATS_EXPLAIN_QUERIES_TXT_1","Explain Queries v1.0 - by Chemo");
+define("STATS_EXPLAIN_QUERIES_TXT_2",'Explain Queries Report v1.0 <a href="http://forums.oscommerce.com/index.php?showuser=9196">- by Chemo</a>');
+
+define("STATS_EXPLAIN_QUERIES_TXT_3",'Export Format');
+define("STATS_EXPLAIN_QUERIES_TXT_4",'CVS');
+define("STATS_EXPLAIN_QUERIES_TXT_5",'HTML');
+define("STATS_EXPLAIN_QUERIES_TXT_6",'Limit to');
+define("STATS_EXPLAIN_QUERIES_TXT_7",'rows starting with row#');
+define("STATS_EXPLAIN_QUERIES_TXT_8",'Back to Explain Queries');
+define("STATS_EXPLAIN_QUERIES_TXT_9",'results returned for:');
+define("STATS_EXPLAIN_QUERIES_TXT_10",'Query#');
+define("STATS_EXPLAIN_QUERIES_TXT_11",'Time (ms): ');
+define("STATS_EXPLAIN_QUERIES_TXT_12",'# Records:');
+define("STATS_EXPLAIN_QUERIES_TXT_13",'Script: ');
+define("STATS_EXPLAIN_QUERIES_TXT_14",'Request String:');
+define("STATS_EXPLAIN_QUERIES_TXT_15",'Table: ');
+define("STATS_EXPLAIN_QUERIES_TXT_16",'Type: ');
+define("STATS_EXPLAIN_QUERIES_TXT_17",'Possible / Used Key: ');
+define("STATS_EXPLAIN_QUERIES_TXT_18",'Key Len:');
+define("STATS_EXPLAIN_QUERIES_TXT_19",'Rows: ');
+define("STATS_EXPLAIN_QUERIES_TXT_20",'Ref: ');
+define("STATS_EXPLAIN_QUERIES_TXT_21",'Extra: ');
+define("STATS_EXPLAIN_QUERIES_TXT_22",'Comment: ');
+
+define("TEMPLATE_CONFIGURATION1_TXT_1","Link Button Name 1");
+define("TEMPLATE_CONFIGURATION1_TXT_2","Link Button Name 2");
+define("TEMPLATE_CONFIGURATION1_TXT_3","Link Button Name 3");
+define("TEMPLATE_CONFIGURATION1_TXT_4","Link Button Name 4");
+define("TEMPLATE_CONFIGURATION1_TXT_5","Link Button Name 5");
+define("TEMPLATE_CONFIGURATION1_TXT_6","Link Button Name 6");
+
+define("TEMPLATE_CONFIGURATION1_TXT_7","<br> There are ");
+define("TEMPLATE_CONFIGURATION1_TXT_8"," active infoboxes in your Right Column<br>");
+define("TEMPLATE_CONFIGURATION1_TXT_9","WARNING: You have the RIGHT Column Active BUT <br>No boxes selected in your RIGHT column");
+define("TEMPLATE_CONFIGURATION1_TXT_10","Left column cellpadding");
+define("TEMPLATE_CONFIGURATION1_TXT_11","Show Page descriptions");
+define("TEMPLATE_CONFIGURATION1_TXT_12","Right Column cell padding");
+define("TEMPLATE_CONFIGURATION1_TXT_13","Include Main Table Border");
+define("TEMPLATE_CONFIGURATION1_TXT_14","Show Customer Greeting?");
+define("TEMPLATE_CONFIGURATION1_TXT_15","<br>edit text for Customer Logged On<br>");
+define("TEMPLATE_CONFIGURATION1_TXT_16",'<br>edit text for Customer Re-Logged On<br>');
+define("TEMPLATE_CONFIGURATION1_TXT_17",'<br>edit text for Guest greeting<br>');
+define("TEMPLATE_CONFIGURATION1_TXT_18",'Include Which Modules On Catalog index Page?');
+
+
+define("TREEVIEW_TXT_1","Catalog Tree");
+define("TREEVIEW_TXT_2","open all");
+define("TREEVIEW_TXT_3","close all");
+
+##################### 07/07/2006 End  ####################
+
+
+
+
+define("ADMIN_JS_FILE_BROWSER","File Browser");
+define("ADMIN_JS_INSERT_FILE","Insert File");
+
+define("ADMIN_JS_IBROWSER_MSG_1",'<strong>net<span class="hilight">4</span>visions.com</strong> - the image browser plugin for WYSIWYG editors like FCKeditor, SPAW, tinyMCE, Xinha, and HTMLarea!</p>
+              <p> <strong> <span class="hilight">i</span>Browser</strong> does upload images and supply file management functions. Images can be resized on the fly. If you need even more advanced features, have a look at <strong> <span class="hilight">i</span>Manager</strong>, another <strong>net<span class="hilight">4</span>visions.com</strong> plugin - it adds truecolor image editing functions like: resize, flip, crop, add text, gamma correct, merge into other image, and many others.</p>
+              <p><strong> <span class="hilight">i</span>Browser</strong> is written and distributed under the GNU General Public License which means that its source code is freely-distributed and available to the general public.</p>
+              <p>&nbsp;</p>');
+
+define("ADMIN_JS_IBROWSER_MSG_2",'Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exercitation ullamcorper suscipit. Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.');
+
+define("ADMIN_JS_PREVIEW_PAGE","Preview page");
+define("ADMIN_JS_EDITOR_CONTENTS","Editor contents:");
+define("ADMIN_JS_CLOSE","Close");
+define("ADMIN_JS_PRINT","Print");
+
+##################### 08/07/2006 End  ####################
+
+
+define("DOCUMENT_INDEX","Document Index");
+
+define("CUSTOMER_ZIP_CODE_VALIDATOR","Customer Zip Code Validator");
+define("SEND_EMAIL_TO_ALL","Send Email to All");
+define("MISMATCHED_STATE_AND_ZIPCODE","Mismatched State and Zipcode");
+define("ADDRESS_BOOK_ID","Address Book ID");
+define("CUSTOMER_ID","Customer ID");
+define("CUSTOMER","Customer");
+define("REMOVE","Remove");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/abandoned_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/abandoned_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/abandoned_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,133 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Abandoned Orders');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('ADDING_TITLE', 'Adding a Product to Order');
+
+define('ADD_PRODUCT', 'Add a Product to Order');
+define('HEADING_ABANDONED', '<B>The shopping basket for this order was abandoned!!! Order ID:  </B>');
+define('TEXT_INFO_ABANDONDED', 'Abandoned');
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_TAX', 'Tax');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_UNIT_PRICE', 'Unit Price');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Total Price');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Customer Notified');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+
+define('ENTRY_CUSTOMER', 'Customer general');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Company');
+define('ENTRY_CUSTOMER_ADDRESS', 'Address');
+define('ENTRY_CUSTOMER_SUBURB', 'Suburb');
+define('ENTRY_CUSTOMER_CITY', 'City');
+define('ENTRY_CUSTOMER_STATE', 'State');
+define('ENTRY_CUSTOMER_POSTCODE', 'Postcode');
+define('ENTRY_CUSTOMER_COUNTRY', 'Country');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Sold To:');
+define('ENTRY_DELIVERY_TO', 'Delivery To:');
+define('ENTRY_SHIP_TO', 'Ship To:');
+define('ENTRY_SHIPPING_ADDRESS', 'Shipping Address:');
+define('ENTRY_BILLING_ADDRESS', 'Billing Address:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Type: ');
+define('ENTRY_CREDIT_CARD_OWNER', 'Owner: ');
+define('ENTRY_CREDIT_CARD_NUMBER', 'CC Number: ');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Expires: ');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Tax:');
+define('ENTRY_SHIPPING', 'Shipping:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'Date Last Updated:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notify Customer:');
+define('ENTRY_NOTIFY_COMMENTS', 'Append Comments:');
+define('ENTRY_PRINTABLE', 'Print Invoice');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Use a negative number -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Add New Product');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+define('TEXT_NO_ORDER_HISTORY', 'No Order History Available');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Order Update');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: Order does not exist.');
+define('SUCCESS_ORDER_UPDATED', 'Success: Order has been successfully updated.');
+define('WARNING_ORDER_NOT_UPDATED', 'Warning: Nothing to change. The order was not updated.');
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choose a product');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Choose an option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Product has no options, so skipping...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'pieces of this product');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Add');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+define('DISPLAY_BASKET', 'Panier d\'affichage');
+define('DONT_ADD_NEW_PRODUCT', 'N\'ajoutez pas Le Nouveau Produit');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/add_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/add_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/add_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,103 @@
+<?php
+/*
+  $Id: send_html_mail, v 5.0 2003/06/29 22:50:52 Gyakutsuki Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+ 
+define('STORE_LOGO', 'pixel_trans.gif');      //Image de votre logo. Cette image doit se situer dans votre repertoire catalog/images, si vous ne voulez pas de logo laisser le gif transparent.
+define('EMAILCOM', '' . STORE_OWNER_EMAIL_ADDRESS . '');       //votre email de liaison
+
+// Couleur du fonds et liens
+define ('BODY','<BODY vLink="#006400" aLink="#006400" link="#006400" bgColor="#0066cc">');
+
+// Introduction
+define('EMAIL_TEXT_DEAR', '<STRONG> <FONT face=Arial>C </FONT> </STRONG> <FONT face=Arial><STRONG>her(e) client(e)</STRONG> </FONT>');        //texte devant le nom de la personne
+define('EMAIL_TEXT_ORDER_NUMBER', 'Commande N° :');  //def en francais
+define('EMAIL_TEXT_DATE','date(d/m/Y)');
+define('EMAIL_TEXT_DATE_SHIPPING', 'Date de traitement :'); //def en francais
+define('EMAIL_TEXT_INTRO_CUSTOMERS_SERVICE','Le service Client.<br>');
+
+// Image
+define('EMAIL_IMAGE_TITRE_ENVOI', '<IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . 'mail/titre_envoi.gif">'); 
+define('EMAIL_IMAGE_VARLOGO', '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '"><IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . STORE_LOGO .' " border=0></a> ');   
+define('EMAIL_IMAGE_FOURMI','<IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . 'mail/fourmi_ar.jpg"  border=0> ');
+define('EMAIL_IMAGE_COMMANDE', '<IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . 'mail/detail_cde.gif"  border=0>'); 
+define('EMAIL_IMAGE_SVC','<A href="'. HTTP_SERVER . DIR_WS_CATALOG .'contact_us.php"><IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . 'mail/svc_1.gif"  border=0> ');
+define('EMAIL_IMAGE_ST','<IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . 'mail/mail_st.gif" border=0>');
+
+// Detail commande
+define('EMAIL_TEXT_TITLE','Etat de votre commande sur ' . HTTP_SERVER .'');
+define('EMAIL_TEXT_FOLLOW_ORDER', '<br><font color="#999999"><b>SUIVIE DE VOTRE COMMANDE...<br><br></b></font>');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date de votre commande : ');  //def en francais
+define('EMAIL_TEXT_INVOICE_URL', '<br>Voir votre commande : ');  //def en francais
+define('EMAIL_TEXT_STATUT','<b>Etat du Statut de la commande</b>');
+
+// Tableau Contact / Mail / telephone
+define('EMAIL_TEXT_CONTACT_SERVICE_CLIENT','Pour Contacter notre service clients au sujet d\'une commande');
+define('EMAIL_TEXT_CONTACT_SERVICE_CLIENT_SHEET1','Par t&eacute;l&eacute;phone au :');
+define('EMAIL_TEXT_CONTACT_SERVICE_CLIENT_SHEET_CONTENT1', '<div align="center"> <FONT face=Arial color=darkgreen size=2><B>0 800 800 800</B></FONT><br><br><FONT  color=#cc0000 size=1 face=Arial>Service payant :1€ 35 l\'appel puis 0,34€ la min </FONT>&nbsp; <br><B><FONT  face=Arial color=#003399 size=1>Du Lundi au Vendredi : 8h30-21h <b> Le Samedi : 9h-17h30</FONT></div>');
+define('EMAIL_TEXT_CONTACT_SERVICE_CLIENT_SHEET2','Par Mail :');
+define('EMAIL_TEXT_CONTACT_SERVICE_CLIENT_SHEET_CONTENT2','<div align="center"> <FONT face=Arial  color="#cc0000" size=2><B> '. STORE_OWNER_EMAIL_ADDRESS .'</B></FONT><br><br><FONT face=Arial color=#003399 size=1> R&eacute;ponses aux mails </div><br>Du Lundi au Vendredi : 9h-22h <br> Du Samedi au Dimanche : 9h-17h</FONT></div>');
+define('EMAIL_TEXT_CONTACT_SERVICE_CLIENT_SHEET3','<STRONG>Par Courrier </STRONG> <SUP> <FONT color=white>(1) </FONT> </SUP> <STRONG>');
+define('EMAIL_TEXT_CONTACT_SERVICE_CLIENT_SHEET_CONTENT3','<div align="center"><FONT face=Arial color=darkgreen size=2><B>Service-Clients</B></FONT><br><br><FONT face=Arial color=darkgreen size=1>'. STORE_NAME_ADDRESS.'</font></DIV> ');
+
+// Contact
+define('EMAIL_TEXT_CONTACT','Consultez et questionnez gratuitement votre service clients en ligne !!');
+define('EMAIL_TEXT_CONTACT_CONTENT','Accessible depuis la home page de <A href="'. HTTP_SERVER . DIR_WS_CATALOG .'">'. STORE_NAME .'</a>, ou via la rubrique <A href="'. HTTP_SERVER . DIR_WS_CATALOG .'/contact_us.php">Contact</a>, vous pouvez nous poser une question sur le suivi de votre commande, une question sur le SAV, tout savoir sur les garanties, la livraison.... ');
+define('EMAIL_TEXT_NOTE','(1) Afin d\'optimiser le traitement de votre r&eacute;ponse, il suffit simplement d\'ajouter le service auquel vous vous adressez : Suivi des commandes - R&egrave;glements - Remboursement-SAV/retours');
+define('EMAIL_TEXT_END','Le service Client');
+
+define('EMAIL_TEXT_NOHTML','Si vous ne voyez pas cet e mail, veuillez consulter votre compte sur  <A href="'. HTTP_SERVER . DIR_WS_CATALOG .'">'. STORE_NAME .'</a> afin de connaitre l\'Etat du traitemende votre commande');
+
+
+// Statut = 1 la commande n\'est pas encore trait&eacute;e
+define('EMAIL_IMAGE_ARGO','<IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . 'mail/ar_go.gif">');
+define('EMAIL_TEXT_INTRO_CUSTOMERS','<b>Nous avons le plaisir de vous annoncer que nous avons commencer à traiter votre commande.</b><p> Vous trouverez ci-dessous tous les &eacute;l&eacute;ments concernant le d&eacute;tail de la gestion de votre commande</p>Merci de votre confiance, à tr&egrave;s bientôt sur <a href="' . HTTP_SERVER . '">' .STORE_OWNER . '</a>.<br><br>Cordialement,'); //def en francais
+define('EMAIL_IMAGE_POSTE', '<A href="'. HTTP_SERVER . DIR_WS_CATALOG .'account.php"><IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . '/mail/ar_laposte.jpg"  border=0>'); 
+define('EMAIL_TEXT_POST','<b>Pour suivre l\'&eacute;volution de votre commande, cliquez ici :</B>');
+define('EMAIL_TEXT_DELAY','<B>Sur les d&eacute;lais de livraison :</B>');
+define('EMAIL_TEXT_DELAY_CONTENT','Nous venons de remettre votre colis aux services de distribution de la Poste. Le d&eacute;lai moyen d\'acheminement peut varier en fonction de votre localisation de 2 à 5 jours ouvr&eacute;s . Si dans un d&eacute;lai de 7 jours ouvr&eacute;s à partir de notre date d\'exp&eacute;dition, vous ne recevez ni colis, ni avis de passage, nous vous recommandons de v&eacute;rifier aupr&egrave;s du bureau de Poste le plus proche de chez vous, si le colis n\'est pas en instance. Contactez votre service clients.');
+define('EMAIL_TEXT_WARNING','<font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color="#cc0000" size=2><B>Attention !</B></FONT> <font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color="#ffffff" size=2><B> Si votre colis arrive en tr&egrave;s mauvais &eacute;tat : </B></font>');
+define('EMAIL_TEXT_WARNING_CONTENT','Vous devez imp&eacute;rativement l\'ouvrir et le contrôler en pr&eacute;sence du livreur. Si les produits sont endommag&eacute;s, nous vous conseillons de refuser le colis en indiquant sur le bordereau de livraison la mention "colis refus&eacute; car endommag&eacute;". Si le colis pr&eacute;sente des traces &eacute;videntes d\'ouverture et qu\'il manque un ou plusieurs articles, vous devez &eacute;galement le refuser et faire un constat de spoliation aupr&egrave;s de la Poste, que vous nous renverrez afin que nous proc&eacute;dions au remboursement ou à l\'&eacute;change.');
+define('EMAIL_TEXT_COMPOSE','Votre commande est compos&eacute;e de plusieurs articles : ');
+define('EMAIL_TEXT_COMPOSE_CONTENT','Pour plus de commodit&eacute; et de s&eacute;curit&eacute;, nous pouvons scinder en plusieurs parties votre commande . Vous pouvez ainsi recevoir votre commande :<BR> - en colissimo (jusqu\'à 30 kg), <BR> - en Chronopost (si l\'un des produits est d\'une valeur sup&eacute;rieure ou &eacute;gale à 762.25 € et de moins de 30 kg)<BR> - Par transporteur si le produit fait plus de 30 kg');
+
+
+// Statut = 2 la commande est en cours de traitement
+define('EMAIL_IMAGE_ARGO1','<IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . 'mail/ar_go1.gif">');
+define('EMAIL_TEXT_INTRO_CUSTOMERS1','<b>Nous avons le plaisir de vous annoncer que nous traitons votre commande.</b><p> Vous trouverez ci-dessous tous les &eacute;l&eacute;ments concernant le d&eacute;tail de la gestion de votre commande</p>Merci de votre confiance, à tr&egrave;s bientôt sur <a href="' . HTTP_SERVER . '">' .STORE_OWNER . '</a>.<br><br>Cordialement,'); //def en francais
+define('EMAIL_IMAGE_POSTE1', '<A href="'. HTTP_SERVER . DIR_WS_CATALOG .'account.php"><IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . '/mail/ar_laposte1.jpg"  border=0>'); 
+define('EMAIL_TEXT_POST1','<b>Pour suivre l\'&eacute;volution de l\'&eacute;tat de votre  commande, cliquez ici :</B>');
+define('EMAIL_TEXT_DELAY1','<B>Sur les d&eacute;lais de livraison :</B>');
+define('EMAIL_TEXT_DELAY_CONTENT1','Nous venons de remettre votre colis aux services de distribution de la Poste. Le d&eacute;lai moyen d\'acheminement peut varier en fonction de votre localisation de 2 à 5 jours ouvr&eacute;s . Si dans un d&eacute;lai de 7 jours ouvr&eacute;s à partir de notre date d\'exp&eacute;dition, vous ne recevez ni colis, ni avis de passage, nous vous recommandons de v&eacute;rifier aupr&egrave;s du bureau de Poste le plus proche de chez vous, si le colis n\'est pas en instance. Contactez votre service clients.');
+define('EMAIL_TEXT_WARNING1','<font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color="#cc0000" size=2><B>Attention !</B></FONT> <font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color="#ffffff" size=2><B> Si votre colis arrive en tr&egrave;s mauvais &eacute;tat : </B></font>');
+define('EMAIL_TEXT_WARNING_CONTENT1','Vous devez imp&eacute;rativement l\'ouvrir et le contrôler en pr&eacute;sence du livreur. Si les produits sont endommag&eacute;s, nous vous conseillons de refuser le colis en indiquant sur le bordereau de livraison la mention "colis refus&eacute; car endommag&eacute;". Si le colis pr&eacute;sente des traces &eacute;videntes d\'ouverture et qu\'il manque un ou plusieurs articles, vous devez &eacute;galement le refuser et faire un constat de spoliation aupr&egrave;s de la Poste, que vous nous renverrez afin que nous proc&eacute;dions au remboursement ou à l\'&eacute;change.');
+define('EMAIL_TEXT_COMPOSE1','Votre commande est compos&eacute;e de plusieurs articles : ');
+define('EMAIL_TEXT_COMPOSE_CONTENT1','Pour plus de commodit&eacute; et de s&eacute;curit&eacute;, nous pouvons scinder en plusieurs parties votre commande . Vous pouvez ainsi recevoir votre commande :<BR> - en colissimo (jusqu\'à 30 kg), <BR> - en Chronopost (si l\'un des produits est d\'une valeur sup&eacute;rieure ou &eacute;gale à 762.25 € et de moins de 30 kg)<BR> - Par transporteur si le produit fait plus de 30 kg');
+
+
+// Statut = 3 la commande est envoy&eacute;e.
+define('EMAIL_IMAGE_ARGO2','<IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . 'mail/ar_go2.gif">');
+define('EMAIL_TEXT_INTRO_CUSTOMERS2','<b>Nous avons le plaisir de vous annoncer le d&eacute;part de votre commande de nos entrepôts.</b><p> Vous trouverez ci-dessous tous les &eacute;l&eacute;ments concernant le d&eacute;tail de la gestion de votre commande.</p>Merci de votre confiance, à tr&egrave;s bientôt sur <a href="' . HTTP_SERVER . '">' .STORE_OWNER . '</a>.<br><br>Cordialement,'); //def en francais
+define('EMAIL_IMAGE_POSTE2', '<IMG src="'. HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . '/mail/ar_laposte2.gif"  border=0>'); 
+define('EMAIL_TEXT_POST2','<b>Pour suivre l\'&eacute;tat de votre colis en temps r&eacute;el, cliquez ici :</B><A href="http://www.coliposte.net/particulier/suivi_particulier.jsp?colispart='.$colispost.'">');
+define('EMAIL_TEXT_DELAY2','<B>Sur les d&eacute;lais de livraison :</B>');
+define('EMAIL_TEXT_DELAY_CONTENT2','Nous venons de remettre votre colis aux services de distribution de la Poste. Le d&eacute;lai moyen d\'acheminement peut varier en fonction de votre localisation de 2 à 5 jours ouvr&eacute;s . Si dans un d&eacute;lai de 7 jours ouvr&eacute;s à partir de notre date d\'exp&eacute;dition, vous ne recevez ni colis, ni avis de passage, nous vous recommandons de v&eacute;rifier aupr&egrave;s du bureau de Poste le plus proche de chez vous, si le colis n\'est pas en instance. Contactez votre service clients.');
+define('EMAIL_TEXT_WARNING2','<font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color="#cc0000" size=2><B>Attention !</B></FONT> <font face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular color="#ffffff" size=2><B> Si votre colis arrive en tr&egrave;s mauvais &eacute;tat : </B></font>');
+define('EMAIL_TEXT_WARNING_CONTENT2','Vous devez imp&eacute;rativement l\'ouvrir et le contrôler en pr&eacute;sence du livreur. Si les produits sont endommag&eacute;s, nous vous conseillons de refuser le colis en indiquant sur le bordereau de livraison la mention "colis refus&eacute; car endommag&eacute;". Si le colis pr&eacute;sente des traces &eacute;videntes d\'ouverture et qu\'il manque un ou plusieurs articles, vous devez &eacute;galement le refuser et faire un constat de spoliation aupr&egrave;s de la Poste, que vous nous renverrez afin que nous proc&eacute;dions au remboursement ou à l\'&eacute;change.');
+define('EMAIL_TEXT_COMPOSE2','Votre commande est compos&eacute;e de plusieurs articles : ');
+define('EMAIL_TEXT_COMPOSE_CONTENT2','Pour plus de commodit&eacute; et de s&eacute;curit&eacute;, nous pouvons scinder en plusieurs parties votre commande . Vous pouvez ainsi recevoir votre commande :<BR> - en colissimo (jusqu\'à 30 kg), <BR> - en Chronopost (si l\'un des produits est d\'une valeur sup&eacute;rieure ou &eacute;gale à 762.25 € et de moins de 30 kg)<BR> - Par transporteur si le produit fait plus de 30 kg');
+define('EMAIL_TEXT_NOTE1','Conservez cette confirmation d\'envoi jusqu\'à&nbsp; r&eacute;ception de votre colis !');
+
+//gestion des variables
+define('VARSTYLE', '<link rel="stylesheet" type="text/css" href="' . HTTP_SERVER . DIR_WS_CATALOG .'mail_html_admin.css">');   //lien vers votre nouveau css de email
+define('VARHTTP', '<base href="' . HTTP_SERVER . DIR_WS_CATALOG . '">');
+   
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/admin_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/admin_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/admin_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: admin_account.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+  Creload French Team for Creload 6.1
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Compte Administrateur');
+
+define('TABLE_HEADING_ACCOUNT', 'Mon compte');
+
+define('TEXT_INFO_FULLNAME', '<b>Nom : </b>');
+define('TEXT_INFO_FIRSTNAME', '<b>Pr&eacute;nom : </b>');
+define('TEXT_INFO_LASTNAME', '<b>Nom : </b>');
+define('TEXT_INFO_EMAIL', '<b>Adresse &eacute;lectronique : </b>');
+define('TEXT_INFO_PASSWORD', '<b>Mot de passe: </b>');
+define('TEXT_INFO_PASSWORD_HIDDEN', '-Masqu&eacute;-');
+define('TEXT_INFO_PASSWORD_CONFIRM', '<b>Confirmer le mot de passe : </b>');
+define('TEXT_INFO_CREATED', '<b>Comptes cr&eacute;&eacute;s: </b>');
+define('TEXT_INFO_LOGDATE', '<b>Dernier acc&egrave;s: </b>');
+define('TEXT_INFO_LOGNUM', '<b>Num&eacute;ro de log : </b>');
+define('TEXT_INFO_GROUP', '<b>Niveau du groupe: </b>');
+define('TEXT_INFO_ERROR', '<font color="red">Cette adresse &eacute;lectronique est d&eacute;j&agrave; utilis&eacute;e! Veuillez r&eacute;essayer.</font>');
+define('TEXT_INFO_MODIFIED', 'Modifi&eacute; : ');
+
+define('TEXT_INFO_HEADING_DEFAULT', 'Editer le compte ');
+define('TEXT_INFO_HEADING_CONFIRM_PASSWORD', 'Confirmation Mot de Passe ');
+define('TEXT_INFO_INTRO_CONFIRM_PASSWORD', 'Mot de Passe :');
+define('TEXT_INFO_INTRO_CONFIRM_PASSWORD_ERROR', '<font color="red"><b>ERROR:</b> Mot de Passe erron&eacute;!</font>');
+define('TEXT_INFO_INTRO_DEFAULT', 'Cliquer <b>bouton &eacute;dition</b> ci-dessous pour faire des changements sur votre compte.');
+define('TEXT_INFO_INTRO_DEFAULT_FIRST_TIME', '<br><b>ATTENTION :</b><br>Bonjour <b>%s</b>, C\'est votre premi&egrave;re visite ici. Nous vous conseillons de changer votre mot de passe!');
+define('TEXT_INFO_INTRO_DEFAULT_FIRST', '<br><b>ATTENTION :</b><br>Bonjour <b>%s</b>, Nous vous recommandons de changer votre adresse &eacute;lectronique (<font color="red">admin at localhost</font>) et votre mot de passe!');
+define('TEXT_INFO_INTRO_EDIT_PROCESS', 'Tous les champs sont obligatoires. Cliquer sur sauver pour soumettre le formulaire.');
+
+define('JS_ALERT_FIRSTNAME', '- Obligatoire : Pr&eacute;nom \n'); 
+define('JS_ALERT_LASTNAME', '- Obligatoire : Nom \n'); 
+define('JS_ALERT_EMAIL', '- Obligatoire : Adresse &eacute;lectronique \n'); 
+define('JS_ALERT_PASSWORD',         '- Obligatoire: Mot de Passe \n');
+define('JS_ALERT_FIRSTNAME_LENGTH', '- La longueur du Pr&eacute;nom doit être sup&eacute;rieur à  ');
+define('JS_ALERT_LASTNAME_LENGTH',  '- La longueur du Nom doit être sup&eacute;rieur à ');
+define('JS_ALERT_PASSWORD_LENGTH',  '- La longueur du Mot de Passe doit être sup&eacute;rieur à ');
+define('JS_ALERT_EMAIL_FORMAT', '- Le format de votre adresse &eacute;lectronique est invalide ! \n'); 
+define('JS_ALERT_EMAIL_USED', '- Cette adresse &eacute;lectronique est d&eacute;jà utilis&eacute;e ! \n'); 
+define('JS_ALERT_PASSWORD_CONFIRM', '- Miss typing in Password Confirmation field! \n');
+
+define('ADMIN_EMAIL_SUBJECT', 'Changement des informations personnelles');
+define('ADMIN_EMAIL_TEXT', 'Hi %s,' . "\n\n" . 'Vos informations personnelles, pouvant inclure votre mot de passe, ont &eacute;t&eacute; chang&eacute;es.  Si ces changements ont &eacute;t&eacute; effectu&eacute;s &agrave; votre insu ou sans votre approbation, veuillez contacter l\'administrateur imm&eacute;diatement !' . "\n\n" . 'Site Internet : %s' . "\n" . 'Username : %s' . "\n" . 'Mot de passe : %s' . "\n\n" . 'Merci !' . "\n" . '%s' . "\n\n" . 'Ceci est une r&eacute;ponse automatique, Veuillez ne pas r&eacute;pondre &agrave; ce courrier &eacute;lectronique!'); 
+
+define('JS_ALERT_FIRSTNAME_1','- Firstname length must over ');
+define('JS_ALERT_LASTNAME_1','- Firstname length must over ');
+define('JS_ALERT_ERROR','The following error(s) occurred:');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/admin_files.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/admin_files.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/admin_files.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: admin_files.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+  Creload French Team for Creload 6.1
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Menu administration des boxes');
+
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_BOXES', 'Boxes');
+define('TABLE_HEADING_FILENAME', 'Nom de fichier');
+define('TABLE_HEADING_GROUPS', 'Groupes');
+define('TABLE_HEADING_STATUS', 'Statut');
+
+define('TEXT_COUNT_BOXES', 'Boxes: ');
+define('TEXT_COUNT_FILES', 'Fichier(s): ');
+
+//categories access
+define('TEXT_INFO_HEADING_DEFAULT_BOXES', 'Boxes: ');
+
+define('TEXT_INFO_DEFAULT_BOXES_INTRO', 'Cliquer simplement sur le bouton vert pour installer la boxe et sur le bouton rouge pour la supprimer !<br><br><b>ATTENTION :</b> Si vous supprimez la boxe, Tous les fichiers inclus dedans seront &eacute;galement supprim&eacute;s !');
+define('TEXT_INFO_DEFAULT_BOXES_INSTALLED', ' Install&eacute;');
+define('TEXT_INFO_DEFAULT_BOXES_NOT_INSTALLED', ' Pas install&eacute;');
+
+define('STATUS_BOX_INSTALLED', 'Install&eacute;');
+define('STATUS_BOX_NOT_INSTALLED', 'Pas install&eacute;');
+define('STATUS_BOX_REMOVE', 'Supprimer');
+define('STATUS_BOX_INSTALL', 'Installer');
+
+//files access
+define('TEXT_INFO_HEADING_DEFAULT_FILE', 'Fichier : ');
+define('TEXT_INFO_HEADING_DELETE_FILE', 'Confirmation de suppression');
+define('TEXT_INFO_HEADING_NEW_FILE', 'Fichier stock&eacute;');
+
+define('TEXT_INFO_DEFAULT_FILE_INTRO', 'Cliquer sur le bouton <b>fichier stock&eacute;</b> pour ins&eacute;rer un fichier &agrave; la boxe en cours d\'utilisation : ');
+define('TEXT_INFO_DELETE_FILE_INTRO', 'Supprimer <font color="red"><b>%s</b></font> de la boxe <b>%s</b> ? ');
+define('TEXT_INFO_NEW_FILE_INTRO', 'Verifier le <font color="red"><b>menu de gauche</b></font>pour &ecirc;tre s&ucirc;r d\'avoir stock&eacute; le bon fichier.');
+
+define('TEXT_INFO_NEW_FILE_BOX', 'Boxe en cours : ');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/admin_members.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/admin_members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/admin_members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<?php
+/*
+  $Id: admin_members.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+  Creload French Team for Creload 6.1
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['gID']) {
+  define('HEADING_TITLE', 'Groupes administration');
+} elseif ($HTTP_GET_VARS['gPath']) {
+  define('HEADING_TITLE', 'D&eacute;finir groupes');
+} else {
+  define('HEADING_TITLE', 'Membres administration');
+}
+
+define('TEXT_COUNT_GROUPS', 'Groupes : ');
+
+define('TABLE_HEADING_NAME', 'Nom');
+define('TABLE_HEADING_EMAIL', 'Adresse &eacute;lectronique');
+define('TABLE_HEADING_PASSWORD', 'Mot de passe');
+define('TABLE_HEADING_CONFIRM', 'Confirmer le mot de passe');
+define('TABLE_HEADING_GROUPS', 'Niveau des groupes');
+define('TABLE_HEADING_CREATED', 'Comptes cr&eacute;&eacute;s');
+define('TABLE_HEADING_MODIFIED', 'Compte cr&eacute;&eacute;s');
+define('TABLE_HEADING_LOGDATE', 'Dernier acc&egrave;s');
+define('TABLE_HEADING_LOGNUM', 'LogNum');
+define('TABLE_HEADING_LOG_NUM', 'Log N&deg;');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TABLE_HEADING_GROUPS_NAME', 'Nom Groupes');
+define('TABLE_HEADING_GROUPS_DEFINE', 'S&eacute;lection des boxes et des fichiers');
+define('TABLE_HEADING_GROUPS_GROUP', 'Niveau');
+define('TABLE_HEADING_GROUPS_CATEGORIES', 'Permission des cat&eacute;gories');
+
+
+define('TEXT_INFO_HEADING_DEFAULT', 'Membre administration ');
+define('TEXT_INFO_HEADING_DELETE', 'Effacer les permissions ');
+define('TEXT_INFO_HEADING_EDIT', 'Editer les cat&eacute;gories / ');
+define('TEXT_INFO_HEADING_NEW', 'Nouveau membre administration ');
+
+define('TEXT_INFO_DEFAULT_INTRO', 'Groupe de membres');
+define('TEXT_INFO_DELETE_INTRO', 'Supprimer <nobr><b>%s</b></nobr> des <nobr>membres administration ?</nobr>');
+define('TEXT_INFO_DELETE_INTRO_NOT', 'Vous ne pouvez pas effacer le groupe <nobr>%s !</nobr>');
+define('TEXT_INFO_EDIT_INTRO', 'D&eacute;finir le niveau de permission ici : ');
+
+define('TEXT_INFO_FULLNAME', 'Nom : ');
+define('TEXT_INFO_FIRSTNAME', 'Pr&eacute;nom : ');
+define('TEXT_INFO_LASTNAME', 'Nom : ');
+define('TEXT_INFO_EMAIL', 'Adresse &eacute;lectronique : ');
+define('TEXT_INFO_PASSWORD', 'Mot de passe : ');
+define('TEXT_INFO_CONFIRM', 'Confirmer le mot de passe : ');
+define('TEXT_INFO_CREATED', 'Compte cr&eacute;&eacute; : ');
+define('TEXT_INFO_MODIFIED', 'Compte modifi&eacute; : ');
+define('TEXT_INFO_LOGDATE', 'Dernier acc&egrave;s : ');
+define('TEXT_INFO_LOGNUM', 'N&deg; de log: ');
+define('TEXT_INFO_GROUP', 'Niveau du groupe : ');
+define('TEXT_INFO_ERROR', '<font color="red">Cette adresse &eacute;lectronique est d&eacute;j&agrave; utilis&eacute;e ! Veuillez r&eacute;essayer.</font>');
+
+define('JS_ALERT_FIRSTNAME', '- Obligatoire : Pr&eacute;nom \n'); 
+define('JS_ALERT_LASTNAME', '- Obligatoire : Nom \n'); 
+define('JS_ALERT_EMAIL', '- Obligatoire : Adresse &eacute;lectronique \n'); 
+define('JS_ALERT_EMAIL_FORMAT', '- Le format de votre adresse &eacute;lectronique est invalide ! \n'); 
+define('JS_ALERT_EMAIL_USED', '- Cette adresse &eacute;lectronique est d&eacute;jà utilis&eacute;e ! \n');
+define('JS_ALERT_LEVEL', '- Obligatoire : Membre du groupe \n');
+
+define('ADMIN_EMAIL_SUBJECT', 'Nouveau membre administration');
+define('ADMIN_EMAIL_TEXT', 'Hi %s,' . "\n\n" . 'Vous pouvez acc&eacute;der &agrave; la console d\'administration avec le mot de passe suivant. Une fois connecter à la partie admin, veuillez changer votre mot de passe!' . "\n\n" . 'Site Internet : %s' . "\n" . 'Nom d\'utilisateur : %s' . "\n" . 'Mot de passe : %s' . "\n\n" . 'Merci !' . "\n" . '%s' . "\n\n" . 'Ceci est un courrier automatique, Veuillez ne pas y r&eacute;pondre !'); 
+define('ADMIN_EMAIL_EDIT_SUBJECT', 'Editer le profil du membre de l\'administration');
+define('ADMIN_EMAIL_EDIT_TEXT', 'Hi %s,' . "\n\n" . 'Vos informations personnelles ont &eacute;t&eacute; mises &agrave; jour par un administrateur.' . "\n\n" . 'Site Internet : %s' . "\n" . 'Nom d\'utilisateur : %s' . "\n" . 'Mot de passe : %s' . "\n\n" . 'Merci !' . "\n" . '%s' . "\n\n" . 'Ceci est un courrier automatique, Veuillez ne pas y r&eacute;pondre!'); 
+
+define('TEXT_INFO_HEADING_DEFAULT_GROUPS', 'Groupe administration ');
+define('TEXT_INFO_HEADING_DELETE_GROUPS', 'Effacer le groupe ');
+
+define('TEXT_INFO_DEFAULT_GROUPS_INTRO', '<b>NOTE :</b><li><b>Editer :</b> Edite le nom du groupe.</li><li><b>Effacer :</b> Efface le groupe.</li><li><b>D&eacute;finir :</b> D&eacute;finit les acc&egrave;s du groupe.</li>');
+define('TEXT_INFO_DELETE_GROUPS_INTRO', 'Cela va &eacute;galement effacer tous les membres du groupe. Etes vous s&ucirc;r de vouloir effacer le groupe <nobr><b>%s</b> ?</nobr>');
+define('TEXT_INFO_DELETE_GROUPS_INTRO_NOT', 'Vous ne pouvez pas effacer ce groupe!');
+define('TEXT_INFO_GROUPS_INTRO', 'Donner un nom de groupe unique. Cliquer sur suivant pour soumettre.');
+
+define('TEXT_INFO_HEADING_GROUPS', 'Nouveau groupe');
+define('TEXT_INFO_GROUPS_NAME', ' <b>Nom du groupe :</b><br>Donner un nom de groupe unique. Ensuite, cliquer sur suivant pour soumettre.<br>');
+define('TEXT_INFO_GROUPS_NAME_FALSE', '<font color="red"><b>ERREUR :</b> Le nom du groupe doit comporter au moins 5 caract&egrave;res!</font>');
+define('TEXT_INFO_GROUPS_NAME_USED', '<font color="red"><b>ERREUR:</b> Le nom du group existe d&eacute;j&agrave; !</font>');
+define('TEXT_INFO_GROUPS_LEVEL', 'Niveau du groupe: ');
+define('TEXT_INFO_GROUPS_BOXES', '<b>Permissions des boxes :</b><br>Donne l\'acc&egrave;s aux boxes s&eacute;lectionn&eacute;es.');
+define('TEXT_INFO_GROUPS_BOXES_INCLUDE', 'Inclure les fichiers contenus à l\'int&eacute;rieur : ');
+
+define('TEXT_INFO_EDIT_GROUP_INTRO', 'Editer le nom du groupe: ');
+
+define('TEXT_INFO_HEADING_DEFINE', 'D&eacute;finir le groupe');
+if ($HTTP_GET_VARS['gPath'] == 1) {
+  define('TEXT_INFO_DEFINE_INTRO', '<b>%s :</b><br>Vous ne pouvez pas changer les permissions des fichiers pour ce groupe.<br><br>');
+} else {
+  define('TEXT_INFO_DEFINE_INTRO', '<b>%s :</b><br>Changer les permissions de ce groupe en s&eacute;lectionnant et d&eacute;s&eacute;lectionnant les boxes et les fichiers fournis. Cliquer sur <b>Sauver</b> pour enregistrer les modifications.<br><br>');
+}
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_affiliates.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_affiliates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_affiliates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: affiliate_affiliates.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+  Creload French Team for Creload 6.1
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affili&eacute;s');
+define('HEADING_TITLE_SEARCH', 'Recherche:');
+
+define('TABLE_HEADING_FIRSTNAME', '¨Pr&eacute;nom');
+define('TABLE_HEADING_LASTNAME', 'Nom');
+define('TABLE_HEADING_USERHOMEPAGE', 'Homepage');
+define('TABLE_HEADING_COMMISSION','Commission');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Compte cr&eacute;&eacute;');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_AFFILIATE_ID','ID Affili&eacute;');
+
+define('TEXT_DATE_ACCOUNT_CREATED', 'Compte Cr&eacute;&eacute;:');
+define('TEXT_DATE_ACCOUNT_LAST_MODIFIED', 'Derni&egrave;re modification:');
+define('TEXT_INFO_DATE_LAST_LOGON', 'Derni&egrave;re connexion:');
+define('TEXT_INFO_NUMBER_OF_LOGONS', 'Nombre de connexions:');
+define('TEXT_INFO_COMMISSION','Commission');
+define('TEXT_INFO_NUMBER_OF_SALES', 'Nombre de Ventes:');
+define('TEXT_INFO_COUNTRY', 'Pays:');
+define('TEXT_INFO_SALES_TOTAL', 'Total des ventes:');
+define('TEXT_INFO_AFFILIATE_TOTAL', 'Commission:');
+define('TEXT_DELETE_INTRO', 'Etes vous sûr vous voulez supprimer cet affili&eacute;?');
+define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Supprimer Affili&eacute;');
+define('TEXT_DISPLAY_NUMBER_OF_AFFILIATES', 'Affichage <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> affili&eacute;s)');
+
+define('ENTRY_AFFILIATE_PAYMENT_DETAILS', 'Payable &agrave;:');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK','Nom du destinataire du ch&egrave;que:');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL','Email du compte Paypal:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME','Nom de la Banque:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME','Nom du compte:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER','Num&eacute;ro de compte:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER','nombre ABA/BSB');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE','Code SWIFT ');
+define('ENTRY_AFFILIATE_COMPANY','Soci&eacute;t&eacute;');
+define('ENTRY_AFFILIATE_COMPANY_TAXID','Tax-Id.:');
+define('ENTRY_AFFILIATE_HOMEPAGE','Homepage');
+define('ENTRY_AFFILIATE_COMMISSION',' Paiement par vente et taux');
+
+define('CATEGORY_COMMISSION','Commission Individuelle');
+define('CATEGORY_PAYMENT_DETAILS','Vous obtiendrez votre argent par:');
+
+define('TYPE_BELOW', 'Type suivant');
+define('PLEASE_SELECT', 'S&eacute;lectionnez en un');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_banner_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_banner_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_banner_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: affiliate_banner_statistics.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Banner Statistics');
+
+define('TABLE_HEADING_SOURCE', 'Source');
+define('TABLE_HEADING_VIEWS', 'Views');
+define('TABLE_HEADING_CLICKS', 'Clicks');
+
+define('TEXT_BANNERS_DATA', 'D<br>a<br>t<br>a');
+define('TEXT_BANNERS_DAILY_STATISTICS', '%s Daily Statistics For %s %s');
+define('TEXT_BANNERS_MONTHLY_STATISTICS', '%s Monthly Statistics For %s');
+define('TEXT_BANNERS_YEARLY_STATISTICS', '%s Yearly Statistics');
+
+define('STATISTICS_TYPE_DAILY', 'Daily');
+define('STATISTICS_TYPE_MONTHLY', 'Monthly');
+define('STATISTICS_TYPE_YEARLY', 'Yearly');
+
+define('TITLE_TYPE', 'Type:');
+define('TITLE_YEAR', 'Year:');
+define('TITLE_MONTH', 'Month:');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Error: Graphs directory does not exist. Please create a \'graphs\' directory inside \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Error: Graphs directory is not writeable.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.0 2002/09/29 SDK
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 -2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Manager de Banni&egrave;res Affili&eacute;s');
+
+define('TABLE_HEADING_BANNERS', 'Banni&egrave;res');
+define('TABLE_HEADING_GROUPS', 'Groupes');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATISTICS', 'Statistiques');
+define('TABLE_HEADING_PRODUCT_ID', 'Produits ID');
+define('TEXT_VALID_CATEGORIES_LIST', 'Available Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Category #');
+define('TEXT_VALID_CATEGORIES_NAME', 'Categories Name');
+define('TABLE_HEADING_CATEGORY_ID', 'Cat ID');
+define('TEXT_BANNERS_LINKED_CATEGORY','Category ID');
+define('TEXT_BANNERS_LINKED_CATEGORY_NOTE','If you want to link the Banner to a specific CATEGORY enter its CATEGORY ID here. If you want to link to the default page enter "0"');
+define('TEXT_AFFILIATE_VALIDCATS', 'Click Here:');
+define('TEXT_AFFILIATE_CATEGORY_BANNER_VIEW', 'to view available CATEGORIES.');
+define('TEXT_AFFILIATE_CATEGORY_BANNER_HELP', 'Select the category number from the popup window and enter the number in the Category ID field.');
+
+define('TEXT_BANNERS_TITLE', 'Titre de la banni&egrave;re:');
+define('TEXT_BANNERS_GROUP', 'Groupe de la banni&egrave;re:');
+define('TEXT_BANNERS_NEW_GROUP', ', ou &eacute;crivez un nouveau groupe de banni&egrave;re ci-dessous');
+define('TEXT_BANNERS_IMAGE', 'Image:');
+define('TEXT_BANNERS_IMAGE_LOCAL', ', ou entrez dans le dossier local ci-dessous');
+define('TEXT_BANNERS_IMAGE_TARGET', 'Cible de l\'image (Enregistrer sous):');
+define('TEXT_BANNERS_HTML_TEXT', 'Texte HTML:');
+define('TEXT_AFFILIATE_BANNERS_NOTE', '<b>Commentaire de la banni&egrave;re:</b><ul><li>Employez une image ou le texte de HTML pour la banni&egrave;re -pas tous les deux.</li><li>Le texte de HTML a la priorit&eacute; sur l\'image</li></ul>');
+
+define('TEXT_BANNERS_LINKED_PRODUCT','ID du produit');
+define('TEXT_BANNERS_LINKED_PRODUCT_NOTE','Si vous voulez lier la banni&egrave;re &agrave; un produit sp&eacute;cifique &eacute;crivez ici l\'ID du produit. Si vous voulez lier &agrave; la page par d&eacute;faut entrez "0"');
+
+define('TEXT_BANNERS_DATE_ADDED', 'Date d\'ajout:');
+define('TEXT_BANNERS_STATUS_CHANGE', 'Derni&egrave;re modification: %s');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available products.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the product number from the popup window and enter the number in the Product ID field.');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Available Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Product #');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this banner?');
+define('TEXT_INFO_DELETE_IMAGE', 'Supprimer la banni&egrave;re');
+
+define('SUCCESS_BANNER_INSERTED', 'Succ&egrave;s:  La banni&egrave;re a &eacute;t&eacute; ins&eacute;r&eacute;e.');
+define('SUCCESS_BANNER_UPDATED', 'Succ&egrave;s:  La banni&egrave;re a &eacute;t&eacute; mise &agrave; jour.');
+define('SUCCESS_BANNER_REMOVED', 'Succ&egrave;s:  La banni&egrave;re a &eacute;t&eacute; enlev&eacute;e.');
+
+define('ERROR_BANNER_TITLE_REQUIRED', 'Erreur:  Le titre de la banni&egrave;re est exig&eacute;.');
+define('ERROR_BANNER_GROUP_REQUIRED', 'Erreur:  Groupe de banni&egrave;re requis.');
+define('ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Erreur:  Le r&eacute;pertoire cibl&eacute; n\'existe pas.');
+define('ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Erreur: le r&eacute;pertoire cibl&eacute; n\'a pas les droits en &eacute;criture.');
+define('ERROR_IMAGE_DOES_NOT_EXIST', 'Erreur: L\'image n\'existe pas.');
+define('ERROR_IMAGE_IS_NOT_WRITEABLE', 'Erreur:  L\'image ne peut pas être supprim&eacute;e.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Clique(s) G&eacute;n&eacute;r&eacute;(s)');
+
+define('TABLE_HEADING_ONLINE', 'Clique(s) G&eacute;n&eacute;r&eacute;(s)');
+define('TABLE_HEADING_AFFILIATE_USERNAME', 'Partenaire');
+define('TABLE_HEADING_IPADDRESS', 'Adresse IP');
+define('TABLE_HEADING_ENTRY_TIME', 'Heure');
+define('TABLE_HEADING_BROWSER', 'Navigateur');
+define('TABLE_HEADING_ENTRY_DATE', 'Date');
+define('TABLE_HEADING_CLICKED_PRODUCT','Produit Vu');
+define('TABLE_HEADING_REFERRAL_URL', 'URL de R&eacute;f&eacute;rence');
+
+define('TEXT_NO_CLICKS', 'Aucun Clique n\'a &eacute;t&eacute; enr&eacute;gistr&eacute;');
+define('TEXT_DISPLAY_NUMBER_OF_CLICKS', 'Voir du <b>%d</b> au <b>%d</b> (sur <b>%d</b> clique(s) g&eacute;n&eacute;r&eacute;(s))');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Envoyer un email aux affili&eacute;s');
+
+define('TEXT_AFFILIATE', 'Affili&eacute;:');
+define('TEXT_SUBJECT', 'Sujet:');
+define('TEXT_FROM', 'De:');
+define('TEXT_MESSAGE', 'Message:');
+define('TEXT_SELECT_AFFILIATE', 'Choisir un affili&eacute;');
+define('TEXT_ALL_AFFILIATES', 'Tous les affili&eacute;s');
+define('TEXT_NEWSLETTER_AFFILIATES', 'Tous les affili&eacute;s qui ont souscrit &agrave; la newsletter');
+
+define('NOTICE_EMAIL_SENT_TO', 'Notification:  Email envoy&eacute; &agrave;: %s');
+define('ERROR_NO_AFFILIATE_SELECTED', 'Erreur: Aucun affili&eacute; n\'a &eacute;t&eacute; s&eacute;lectionn&eacute;.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: affiliate_invoice.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Facture Affili&eacute;');
+
+define ('TEXT_AFFILIATE','Affili&eacute;');
+define ('TEXT_AFFILIATE_PAYMENT','Paiement');
+define ('TEXT_AFFILIATE_BILLED','Date de facturation');
+define('TABLE_HEADING_ORDER_ID', 'ID Commande');
+define('TABLE_HEADING_ORDER_DATE', 'Date');
+define('TABLE_HEADING_ORDER_VALUE', 'Valeur de la commande');
+define('TABLE_HEADING_COMMISSION_RATE', 'Taux de la Commission');
+define('TABLE_HEADING_COMMISSION_VALUE', 'Montant de la Commission');
+define('TABLE_HEADING_TOTAL', 'Total');
+
+define('TEXT_SUB_TOTAL', 'Sous-Total');
+define('TEXT_TAX', 'Taxe');
+define('TEXT_TOTAL', 'Total');
+define('ENTRY_PERCENT', '%');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: affiliate_news.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate News / Announcements');
+define('TABLE_HEADING_AFFILIATE_NEWS', 'Affiliate News');
+
+define('TABLE_HEADING_AFFILIATE_NEWS_HEADLINE', 'Headline');
+define('TABLE_HEADING_AFFILIATE_NEWS_ACTION', 'Action');
+define('TABLE_HEADING_AFFILIATE_NEWS_STATUS', 'Status');
+
+define('TEXT_NEWS_ITEMS', 'News Items:');
+define('TEXT_INFO_HEADING_DELETE_ITEM', 'Delete Item');
+define('TEXT_DELETE_ITEM_INTRO', 'Are you sure you want to permanently delete this item?');
+
+define('TEXT_AFFILIATE_NEWS_HEADLINE', 'Headline');
+define('TEXT_AFFILIATE_NEWS_CONTENT', 'Content');
+
+define('IMAGE_NEW_NEWS_ITEM', 'New news item');
+
+// npe admin begin #add
+define('TEXT_AFFILIATE_NEWS_CONTENT_DELETE', 'Delete displayed news in this language!');
+define('EMPTY_CATEGORY', 'Empty news');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'There are no news articles which can be displayed to your affiliate partners.');
+// npe admin begin #add
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: affiliate_newsletters.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Newsletter Manager');
+
+define('TABLE_HEADING_NEWSLETTERS', 'Newsletters');
+define('TABLE_HEADING_SIZE', 'Size');
+define('TABLE_HEADING_MODULE', 'Module');
+define('TABLE_HEADING_SENT', 'Sent');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_NEWSLETTER_MODULE', 'Module:');
+define('TEXT_NEWSLETTER_TITLE', 'Newsletter Title:');
+define('TEXT_NEWSLETTER_CONTENT', 'Content:');
+
+define('TEXT_NEWSLETTER_DATE_ADDED', 'Date Added:');
+define('TEXT_NEWSLETTER_DATE_SENT', 'Date Sent:');
+
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this newsletter?');
+
+define('TEXT_PLEASE_WAIT', 'Please wait .. sending emails ..<br><br>Please do not interrupt this process!');
+define('TEXT_FINISHED_SENDING_EMAILS', 'Finished sending e-mails!');
+
+define('ERROR_NEWSLETTER_TITLE', 'Error: Newsletter title required');
+define('ERROR_NEWSLETTER_MODULE', 'Error: Newsletter module required');
+define('ERROR_REMOVE_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before deleting it.');
+define('ERROR_EDIT_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before editing it.');
+define('ERROR_SEND_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before sending it.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Paiement Partenaires');
+define('HEADING_TITLE_SEARCH', 'Rechercher:');
+define('HEADING_TITLE_STATUS','Status:');
+
+define('TEXT_ALL_PAYMENTS','Tous les Paiements');
+define('TEXT_NO_PAYMENT_HISTORY', 'Pas d\'historique des paiements');
+
+
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_AFILIATE_NAME', 'Partenaires');
+define('TABLE_HEADING_PAYMENT','Paiement (incl.)');
+define('TABLE_HEADING_NET_PAYMENT','Paiement (excl.)');
+define('TABLE_HEADING_DATE_BILLED','Date de paiement');
+define('TABLE_HEADING_NEW_VALUE', 'Nouveau montant');
+define('TABLE_HEADING_OLD_VALUE', 'Ancien montant');
+define('TABLE_HEADING_AFFILIATE_NOTIFIED', 'Avertir Partenaire');
+define('TABLE_HEADING_DATE_ADDED', 'Date d\'ajout');
+
+define('TEXT_DATE_PAYMENT_BILLED','Factur&eacute; :');
+define('TEXT_DATE_ORDER_LAST_MODIFIED','Derni&egrave;re modification :');
+define('TEXT_AFFILIATE_PAYMENT','Montant des gains Partenaire');
+define('TEXT_AFFILIATE_BILLED','Paiement le');
+define('TEXT_AFFILIATE','Partenaire');
+
+define('TEXT_INFO_HEADING_DELETE_PAYMENT','Supprimer le Paiement');
+define('TEXT_INFO_DELETE_INTRO','Etes-vous sur de vouloir supprimer ce r&eacute;glement ?');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENTS', 'Voir du <b>%d</b> au <b>%d</b> (sur <b>%d</b> paiements)');
+
+define('TEXT_AFFILIATE_PAYING_POSSIBILITIES','Vous pouvez payer votre Partenaire par :');
+define('TEXT_AFFILIATE_PAYMENT_CHECK','Ch&egrave;que :');
+define('TEXT_AFFILIATE_PAYMENT_CHECK_PAYEE','Payable &agrave; :');
+define('TEXT_AFFILIATE_PAYMENT_PAYPAL','PayPal :');
+define('TEXT_AFFILIATE_PAYMENT_PAYPAL_EMAIL','Email du compte PayPal :');
+define('TEXT_AFFILIATE_PAYMENT_BANK_TRANSFER','Virement :');
+define('TEXT_AFFILIATE_PAYMENT_BANK_NAME','Nom de la banque :');
+define('TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME','Nom du compte :');
+define('TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER','Num&eacute;ro de compte :');
+define('TEXT_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER','Code Banque :');
+define('TEXT_AFFILIATE_PAYMENT_BANK_SWIFT_CODE','Code SWIFT :');
+
+define('IMAGE_AFFILIATE_BILLING','D&eacute;marrer le Paiement');
+
+define('ERROR_PAYMENT_DOES_NOT_EXIST','Le Paiement n\'existe pas');
+
+define('SUCCESS_BILLING','Vos demandes de paiement de filiales ont été sucessfully produites');
+define('SUCCESS_PAYMENT_UPDATED','Mise &agrave; jour du status du paiement effectu&eacute; avec succ&egrave;s');
+
+define('PAYMENT_STATUS','Status des Paiement');
+define('PAYMENT_NOTIFY_AFFILIATE', 'Avertir le Partenaire');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Mise à jour du paiement');
+define('EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER', 'Paiement Num&eacute;ro :');
+define('EMAIL_TEXT_INVOICE_URL', 'Facture D&eacute;taill&eacute;e:');
+define('EMAIL_TEXT_PAYMENT_BILLED', 'Date facture');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Votre paiement a &eacute;t&eacute; mis à jour vers le statut suivant.' . "\n\n" . 'Nouveau statut : %s' . "\n\n" . 'Si vous avez des questions r&eacute;pondez à cet Email (R&eacute;pondre).' . "\n");
+define('EMAIL_TEXT_NEW_PAYMENT', 'Une nouvelle facture est arriv&eacute;e à &eacute;ch&eacute;ance' . "\n");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: affiliate_sales.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Ventes Affili&eacute;');
+define('HEADING_TITLE_SEARCH', 'ID Commande:');
+define('HEADING_TITLE_STATUS', 'Statut:');
+define('TABLE_HEADING_ONLINE', 'Clics en povenance');
+define('TABLE_HEADING_AFFILIATE', 'Affili&eacute;');
+define('TABLE_HEADING_DATE', 'Date');
+define('TABLE_HEADING_PERCENTAGE','Taux Commission');
+define('TABLE_HEADING_SALES', 'Ventes');
+define('TABLE_HEADING_STATUS', 'Statut');
+define('TABLE_HEADING_ORDER_ID', 'ID Commande');
+define('TABLE_HEADING_VALUE', 'Valeur');
+define('TEXT_NO_SALES', 'Aucune vente n\'a &eacute;t&eacute; enregistr&eacute;e');
+
+define('TEXT_DELETED_ORDER_BY_ADMIN', 'Supprim&eacute; (Admin)');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Affichage <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> ventes)');
+
+define('TEXT_INFORMATION_SALES_TOTAL', 'Total des Ventes Affili&eacute;:');
+define('TEXT_INFORMATION_AFFILIATE_TOTAL', 'Total des Commissions Affili&eacute;:');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: affiliate_statistics.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Statistiques Partenaires');
+define('TEXT_SUMMARY_TITLE', 'Statistiques Partenaires');
+define('TEXT_IMPRESSIONS', 'Total des Banni&egrave;res vues : ');
+define('TEXT_VISITS', 'Total des visites Partenaire : ');
+define('TEXT_TRANSACTIONS', 'Total des transactions Partenaire : ');
+define('TEXT_AFFILIATE_NAME', 'Nom du Partenaire: ');
+define('TEXT_AFFILIATE_JOINDATE', 'Partenaire depuis : ');
+define('TEXT_CONVERSION', 'Conversion: ');
+define('TEXT_AMOUNT', 'Total ventes Partenaire: ');
+define('TEXT_AVERAGE', 'Moyenne D&eacute;bours&eacute;/Vente Partenaire : ');
+define('TEXT_COMMISSION_RATE', 'Taux de Commission : ');
+define('TEXT_PAYPERSALE_RATE', 'Taux de paiement par vente : ');
+define('TEXT_CLICKTHROUGH_RATE', 'Taux de cliques g&eacute;n&eacute;r&eacute;s : ');
+define('TEXT_COMMISSION', 'Total des Commissions du Partenaire : ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Cliquez sur [?] pour avoir une description de chaque cat&eacute;gories.');
+define('HEADING_SUMMARY_HELP', 'Aide Partenaire');
+define('TEXT_IMPRESSIONS_HELP', '<i>Banni&egrave;res</i> Affiche le nombre total de bannieres affich&eacute;es pendant la p&eacute;riode.');
+define('TEXT_VISITS_HELP', '<i>Visites</i> Affiche le nombre total de cliques g&eacute;n&eacute;r&eacute;s par les visiteurs depuis votre Site.');
+define('TEXT_TRANSACTIONS_HELP', '<i>Transactions</i> Affiche le nombre total de transactions cr&eacute;dit&eacute; sur votre compte');
+define('TEXT_CONVERSION_HELP', '<i>Conversions</i> Affiche le nombre total de visiteurs qui ont achet&eacute;s depuis votre site.');
+define('TEXT_AMOUNT_HELP', '<i>Montant</i> Affiche le nombre total de vos ventes.');
+define('TEXT_AVERAGE_HELP', '<i>Moyenne</i> Affiche le nombre moyen de vos ventes.');
+define('TEXT_COMMISSION_RATE_HELP', '<i>Taux de Commission</i>  Affiche en  pourcentage le taux de commission.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<i>Taux Clique g&eacute;n&eacute;r&eacute;</i>  Affiche le taux du paiement par clique g&eacute;n&eacute;r&eacute;');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<i>Taux par vente</i>  Affiche le taux du paiement par vente.');
+define('TEXT_COMMISSION_HELP', '<i>Commission</i>  Affiche la commission totale qui vous est due');
+define('TEXT_CLOSE_WINDOW', 'Fermer la fenetre [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Le Programme de Partenariat');
+
+define('TEXT_SUMMARY_TITLE', 'Partenariat - R&eacute;capitulatif');
+define('TEXT_IMPRESSIONS', 'Impressions : ');
+define('TEXT_VISITS', 'Visites : ');
+define('TEXT_TRANSACTIONS', 'Transactions : ');
+define('TEXT_AFFILIATES', 'Nombre d\'affili&eacute;s: ');
+define('TEXT_CONVERSION', 'Conversion : ');
+define('TEXT_AMOUNT', 'Total : ');
+define('TEXT_AVERAGE', 'Moyenne : ');
+define('TEXT_COMMISSION_RATE', 'Taux de commission : ');
+define('TEXT_PAYPERSALE_RATE', 'Taux de r&eacute;mun&eacute;ration par vente : ');
+define('TEXT_CLICKTHROUGH_RATE', 'Taux par connexion : ');
+define('TEXT_COMMISSION', 'Commission : ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Cliquez ici [?] pour voir une description de chaque cat&eacute;gorie.');
+define('HEADING_SUMMARY_HELP', 'Aide Partenaire');
+define('TEXT_IMPRESSIONS_HELP', '<b>Impressions :</b> Affichez le nombre total de fois une banni&egrave;re ou un lien a &eacute;t&eacute; affich&eacute; pendant la p&eacute;riode attribu&eacute;e.');
+define('TEXT_VISITS_HELP', '<b>Visites :</b> repr&eacute;sente le total de connexion des visiteurs par votre site.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Transactions :</b> repr&eacute;sente le total des transactions abouties et cr&eacute;dit&eacute;es &agrave; votre compte.');
+define('TEXT_CONVERSION_HELP', '<b>Conversions:</b> repr&eacute;sente le pourcentage de connexion visiteurs conclue par une transaction.');
+define('TEXT_AMOUNT_HELP', '<b>Total :</b> repr&eacute;sente le total du chiffre d\'affaires des commandes pass&eacute;es et cr&eacute;dit&eacute;es sur votre compte.');
+define('TEXT_AVERAGE_HELP', '<b>Moyenne :</b> repr&eacute;sente la moyenne du prix des ventes cr&eacute;dit&eacute;es à votre compte.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Commission Rate:</b> repr&eacute;sente le taux de votre r&eacute;mun&eacute;ration par vente en pourcentage.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<b>Taux par connexions :</b> repr&eacute;sente le taux de votre r&eacute;mun&eacute;ration compar&eacute; &agrave; un taux par connexion basique.');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<b>Taux de r&eacute;mun&eacute;ration par vente :</b> repr&eacute;sente le taux de votre r&eacute;mun&eacute;ration compar&eacute; &agrave; un taux par vente basique.');
+define('TEXT_COMMISSION_HELP', '<b>Commission :</b> rep&eacute;sente le total des commissions qui vous sont dues.');
+define('TEXT_CLOSE_WINDOW', 'Fermer la fen&ecirc;tre [x]');
+
+
+define('IMAGE_BANNERS','Banni&egrave;res');
+define('IMAGE_CLICKTHROUGHS','Rapport des connexions');
+define('IMAGE_SALES','Rapport des ventes');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/algo_fraud_screener.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/algo_fraud_screener.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/algo_fraud_screener.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<?php
+/*
+  $Id: orders.php,v 1.25 2003/06/20 00:28:44 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// AlgoZone - Algozone Fraud Screen Tool definitions
+
+define('ALGO_FS_DISTANCE', '<b>Distance(mi/km)</b> ');
+define('ALGO_FS_DISTANCE_M', '<b>Distance(m) </b>');
+define('ALGO_FS_DISTANCE_K', '<b>Distance(k) </b>');
+define('ALGO_FS_COUNTRY', '<b>Country Match  </b>');
+define('ALGO_FS_CODE', '<b>Country Code  </b>');
+define('ALGO_FS_FREE_EMAIL', '<b>Free Email  </b>');
+define('ALGO_FS_ANONYMOUS', '<b>Anonymous Proxy  </b>');
+define('ALGO_FS_SCORE', '<b>Score  </b>');
+define('ALGO_FS_FRAUD_LEVEL', '<b>Fraud Level  </b>');
+define('ALGO_FS_BIN_MATCH', '<b>Bin Match  </b>');
+define('ALGO_FS_BANK_COUNTRY', '<b>Bank Country  </b>');
+define('ALGO_FS_ERR', '<b>Error  </b>');
+define('ALGO_FS_PROXY_LEVEL', '<b>Proxy Level  </b>');
+define('ALGO_FS_SPAM', '<b>Spam Level  </b>');
+define('ALGO_FS_BANK_NAME', '<b>Bank Name  </b>');
+define('ALGO_FS_BANK_NAME_MATCH', '<b>Bank Name Match  </b>');
+define('ALGO_FS_BANK_PHONE', '<b>Bank Phone  </b>');
+define('ALGO_FS_BANK_PHONE_MATCH', '<b>Bank Phone Match  </b>');
+define('ALGO_FS_IP', '<b>IP Address  </b>');
+define('ALGO_FS_IP_ISP', '<b>ISP  </b>');
+define('ALGO_FS_IP_ISP_ORG', '<b>ISP Org  </b>');
+define('ALGO_FS_IP_CITY', '<b>City   </b>');
+define('ALGO_FS_IP_REGION', '<b>Region   </b>');
+define('ALGO_FS_IP_LATITUDE', '<b>Latitude   </b>');
+define('ALGO_FS_IP_LONGITUDE', '<b>Longitude   </b>');
+define('ALGO_FS_ALGOZONE', '<b>*NOTE:  You need to be subscribed to Premium Services at AlgoZone.com for the following fields </b>');
+define('ALGO_FS_HI_RISK', '<b>High Risk Country  </b>');
+define('ALGO_FS_CUST_PHONE', '<b>Phone Match  </b>');
+define('ALGO_FS_DETAILS', 'See <a href="http://www.algozone.com/" target="_blank"><u>AlgoZone.com</u></a> for explanation of fields');
+
+define('ALGO_FS_BREQUEST', 'Verify Bank Info'); 
+define('ALGO_HELP_PREM_OPT', '*** - values available with fraud screen paid service'); 
+
+define('FS_HELP_DISTANCE', 'Distance from IP address to Billing Location in miles/kilometers (large distance == higher risk)');
+define('FS_HELP_COUNTRY_MATCH', 'Whether country of IP address matches billing address country (mismatch == higher risk)');
+define('FS_HELP_COUNTRY_CODE', 'Country Code of the IP address');
+define('FS_HELP_EMAIL','Whether e-mail is from free e-mail provider (free e-mail == higher risk)');
+define('FS_HELP_ANONYMOUS_IP','Whether IP address is Anonymous Proxy (anonymous proxy == very high risk)');
+define('FS_HELP_BANK_COUNTRY','Country Code of the bank which issued the credit card based on BIN number');
+define('FS_HELP_BIN_MATCH','Whether country of issuing bank based on BIN number matches billing address country');
+define('FS_HELP_BANK_NAME_MATCH','Whether name of issuing bank matches inputed binName. A return value of Yes provides a positive indication that cardholder is in possession of credit card.');
+define('FS_HELP_BANK_NAME','Name of the bank which issued the credit card based on BIN number');
+define('FS_HELP_BANK_PHONE_MATCH','Whether customer service phone number matches inputed binPhone. A return value of Yes provides a positive indication that cardholder is in possession of credit card.');
+define('FS_HELP_BANK_PHONE','Customer service phone number listed on back of credit card');
+define('FS_HELP_PHONE_IN_BILLING_LOC','Whether the customer phone number is in the billing location. A return value of Yes provides a positive indication that the phone number listed belongs to the cardholder. Currently we only support US Phone numbers, in the future we may support other countries.');
+define('FS_HELP_PROXY_LEVEL','Likelihood of IP Address being an Open Proxy');
+define('FS_HELP_SPAM_LEVEL','Likelihood of IP Address being an Spam Source');
+define('FS_HELP_FRAUD_LEVEL','Overall Fraud Risk Factor based on outputs listed above');
+define('FS_HELP_REGION','Estimated Region of the IP address, ISO-3166-2/FIPS 10-4 code');
+define('FS_HELP_CITY','Estimated City of the IP address**');
+define('FS_HELP_LATITUDE','Estimated Latitude of the IP address');
+define('FS_HELP_LONGITUDE','Estimated Longitude of the IP address');
+define('FS_HELP_IP','IP address of the customer. For US addresses, click on the ip address to see a map estimating where the customer is located.');
+define('FS_HELP_ISP','ISP of the IP address');
+define('FS_HELP_ORG','Organization of the IP address');
+define('FS_HELP_IS_HI_RISK_COUNTRY','Whether IP address or billing address country is in Belarus, Colombia, Egypt, Indonesia, Lebanon, Macedonia, Malaysia, Nigeria, Pakistan, Ukraine, or Yugoslavia');
+define('FS_HELP_REMAINING_QUERIES','Number of queries remaining in your account, can be used to alert you when you may need to add more queries to your account');
+define('FS_HELP_DEFAULT','<i><b>To get field descriptions, place cursor on the field name<b></i>');
+
+
+define('NO_IP_ADDRESS_RECORDED','*** NO IP ADDRESS RECORDED FOR THIS ORDER');
+define('MAX_COMMENT_0','(Extremely Low risk)');
+define('MAX_COMMENT_1','(Very Low risk)');
+define('MAX_COMMENT_2','(Low risk)');
+define('MAX_COMMENT_3','(Low risk)');
+define('MAX_COMMENT_4','(Low-Medium risk)');
+define('MAX_COMMENT_5','(Medium risk)');
+define('MAX_COMMENT_6','(Medium-high risk)');
+define('MAX_COMMENT_7','<font color=red>(High risk)</font>');
+define('MAX_COMMENT_8','<font color=red>(Very High risk)</font>');
+define('MAX_COMMENT_9','<font color=red>(Extremely High risk)</font>');
+define('MAX_COMMENT_10','<font color=red>(HIGH PROBABILITY OF FRAUD)</font>');
+define('ERROR','Error');
+define('LAST_QUERIED_ON','Last Queried on :');
+define('REMAINING_QUERIES_1','You have');
+define('REMAINING_QUERIES_2','queries remaining');
+
+// End AlgoZone - Algozone Fraud Screen Tool definitions
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Article Reviews');
+
+define('TABLE_HEADING_ARTICLES', 'Articles');
+define('TABLE_HEADING_RATING', 'Rating');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('ENTRY_ARTICLE', 'Article:');
+define('ENTRY_FROM', 'From:');
+define('ENTRY_DATE', 'Date:');
+define('ENTRY_REVIEW', 'Review:');
+define('ENTRY_REVIEW_TEXT', '<small><font color="#ff0000"><b>NOTE:</b></font></small>&nbsp;HTML is not translated!&nbsp;');
+define('ENTRY_RATING', 'Rating:');
+
+define('TEXT_INFO_DELETE_REVIEW_INTRO', 'Are you sure you want to delete this review?');
+
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_REVIEW_AUTHOR', 'Reviewer:');
+define('TEXT_INFO_REVIEW_RATING', 'Rating:');
+define('TEXT_INFO_REVIEW_READ', 'Read:');
+define('TEXT_INFO_REVIEW_SIZE', 'Size:');
+define('TEXT_INFO_ARTICLES_AVERAGE_RATING', 'Average Rating:');
+
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_OF_5_STARS', '%s of 5 Stars!');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>Excellent</b></font></small>');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>Poor</b></font></small>');
+define('TEXT_INFO_HEADING_DELETE_REVIEW', 'Delete Review');
+/* <Mav was here!> */
+define('TEXT_APPROVED', 'Approved') ;
+define('TEXT_APPROVE', 'Approve') ;
+define('TEXT_DISAPPROVE', 'Disapprove') ;
+define('TEXT_YES', 'Yes') ;
+define('TEXT_NO', 'No') ;
+/* </Mav was here!> */
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/article_search.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/article_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/article_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: article_search.php
+  By AlDaffodil:  aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_1', 'Article Search');
+define('HEADING_TITLE_2', 'Articles meeting the search criteria');
+
+define('NAVBAR_TITLE_1', 'Article Search');
+define('NAVBAR_TITLE_2', 'Articles meeting the search criteria');
+define('TABLE_HEADING_ARTICLES', 'Article');
+
+define('TEXT_ARTICLE_NAME' , 'Article Title & Link');
+define('TEXT_ARTICLE_EXCERPT' , 'Article Excerpt');
+
+define('TEXT_NO_ARTICLES', 'There are no articles matching the search criteria.');
+
+define('ERROR_INPUT', 'Please enter a search term.');
+define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/articles.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Topics / Articles');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_TOPICS_ARTICLES', 'Topics / Articles');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('TEXT_ARTICLES_CURRENT', 'Current:');
+
+define('TEXT_NEW_ARTICLE', 'New Article in &quot;%s&quot;');
+define('TEXT_TOPICS', 'Topics:');
+define('TEXT_SUBTOPICS', 'Subtopics:');
+define('TEXT_ARTICLES', 'Articles:');
+define('TEXT_ARTICLES_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_ARTICLES_HEAD_TITLE_TAG', 'HTML Page Title:');
+define('TEXT_ARTICLES_HEAD_DESC_TAG', 'Meta Description:<br><small>(Article Abstract =<br>first %s charachters)</small>');
+define('TEXT_ARTICLES_HEAD_KEYWORDS_TAG', 'Meta Keywords:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DATE_AVAILABLE', 'Date Expected:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_NO_CHILD_TOPICS_OR_ARTICLES', 'Please insert a new topic or article in this level.');
+define('TEXT_ARTICLE_MORE_INFORMATION', 'For more information, please visit this articles <a href="http://%s" target="blank"><u>web page</u></a>.');
+define('TEXT_ARTICLE_DATE_ADDED', 'This article was added to our site on %s.');
+define('TEXT_ARTICLE_DATE_AVAILABLE', 'This article will is expected on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_TOPICS_ID', 'Topic ID:');
+define('TEXT_EDIT_TOPICS_NAME', 'Topic Name:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new topic you wish to copy this article to');
+define('TEXT_INFO_CURRENT_TOPICS', 'Current Topics:');
+
+define('TEXT_INFO_HEADING_NEW_TOPIC', 'New Topic');
+define('TEXT_INFO_HEADING_EDIT_TOPIC', 'Edit Topic');
+define('TEXT_INFO_HEADING_DELETE_TOPIC', 'Delete Topic');
+define('TEXT_INFO_HEADING_MOVE_TOPIC', 'Move Topic');
+define('TEXT_INFO_HEADING_DELETE_ARTICLE', 'Delete Article');
+define('TEXT_INFO_HEADING_MOVE_ARTICLE', 'Move Article');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_TOPIC_INTRO', 'Are you sure you want to delete this topic?');
+define('TEXT_DELETE_ARTICLE_INTRO', 'Are you sure you want to permanently delete this article?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s child-topics still linked to this topic!');
+define('TEXT_DELETE_WARNING_ARTICLES', '<b>WARNING:</b> There are %s articles still linked to this topic!');
+
+define('TEXT_MOVE_ARTICLES_INTRO', 'Please select which topic you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_TOPICS_INTRO', 'Please select which topic you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_TOPIC_INTRO', 'Please fill out the following information for the new topic');
+define('TEXT_TOPICS_NAME', 'Topic Name:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_EDIT_TOPICS_HEADING_TITLE', 'Topic Heading Title:');
+define('TEXT_EDIT_TOPICS_DESCRIPTION', 'Topic Description:');
+
+define('TEXT_ARTICLES_STATUS', 'Article Status:');
+define('TEXT_ARTICLES_DATE_AVAILABLE', 'Date Expected:');
+define('TEXT_ARTICLE_AVAILABLE', 'Published');
+define('TEXT_ARTICLE_NOT_AVAILABLE', 'Draft');
+define('TEXT_ARTICLES_AUTHOR', 'Author:');
+define('TEXT_ARTICLES_NAME', 'Article Name:');
+define('TEXT_ARTICLES_DESCRIPTION', 'Article Content:');
+define('TEXT_ARTICLES_URL', 'Article URL:');
+define('TEXT_ARTICLES_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+
+define('EMPTY_TOPIC', 'Empty Topic');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method:');
+define('TEXT_COPY_AS_LINK', 'Link article');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate article');
+
+define('ERROR_CANNOT_LINK_TO_SAME_TOPIC', 'Error: Can not link articles in the same topic.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_TOPIC_TO_PARENT', 'Error: Topic cannot be moved into child topic.');
+
+define('DATE_FORMAT', '(YYYY-MM-DD)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/articles_config.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/articles_config.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/articles_config.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: articles_config.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Articles Configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/articles_xsell.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/articles_xsell.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/articles_xsell.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: articles_xsell.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Cross-Sell Articles to Products');
+
+define('HEADING_ARTICLE_NAME', 'Article Name');
+define('HEADING_CROSS_ASSOCIATION', 'Associated Products');
+define('HEADING_CROSS_SELL_ACTIONS', 'Cross-Sell Actions');
+define('HEADING_PRODUCT_NAME', 'Product Name');
+define('HEADING_PRODUCT_ORDER', 'Order (1=Top)');
+
+define('TEXT_DATABASE_UPDATED', 'The database has been updated.');
+define('TEXT_NO_DELETE', 'could not delete');
+define('TEXT_NO_INSERT', 'could not insert into database');
+define('TEXT_NO_UPDATE', 'could not update database');
+
+define('TEXT_LINK_MAIN_PAGE', '<a href="%s">Click here</a> to go back to the main page.');
+define('TEXT_LINK_SORT_PRODUCTS', '<a href="%s">Click here</a> to sort the products associated with this article.<br><small>Note: this needs to be done every time a product is added or deleted.</small>');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/attributes_sorter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/attributes_sorter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/attributes_sorter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  Definitions for Attributes Sorter
+*/
+
+// Turn things off
+define('I_AM_OFF',true);
+
+// WebMakers.com Added: Attributes - Definitions to move to attribute_sorter.php
+define('TABLE_HEADING_PRODUCT_ATTRIBUTE_ONE_TIME','One Time Charge');
+
+// WebMakers.com Added: Attribute Copy Option
+define('TEXT_COPY_ATTRIBUTES_ONLY','Seulement utilis&eacute; pour les produits dupliqu&eacute;s ...');
+define('TEXT_COPY_ATTRIBUTES','Copier les attributs du produits pour duplication?');
+define('TEXT_COPY_ATTRIBUTES_YES','Oui');
+define('TEXT_COPY_ATTRIBUTES_NO','Non');
+
+// WebMakers.com Added: Attributes Copy from Existing Product to Existing Product
+define('PRODUCT_NAMES_HELPER','<FONT COLOR="FF0000">[ <a href="' . 'quick_products_popup.php' . '" onclick="NewWindow(this.href,\'name\',\'700\',\'500\',\'yes\');return false;">Recherchez l\'ID d\'un Produit</a> ]');
+define('ATTRIBUTES_NAMES_HELPER','<FONT COLOR="FF0000"><a href="' . 'quick_attributes_popup.php?look_it_up=' . $pID . '&my_languages_id=' . $languages_id . '" onclick="NewWindow2(this.href,\'name2\',\'700\',\'400\',\'yes\');return false;">[ Liste rapide des attributs pour le Produit ID# ' . $pID . ' ]</a>');
+
+// WebMakers.com Added: Product Option Attributes Sort Order - products_attributes.php
+define('TABLE_HEADING_OPTION_SORT_ORDER','Ordre de tri');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/authors.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Authors');
+
+define('TABLE_HEADING_AUTHORS', 'Authors');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_HEADING_NEW_AUTHOR', 'New Author');
+define('TEXT_HEADING_EDIT_AUTHOR', 'Edit Author');
+define('TEXT_HEADING_DELETE_AUTHOR', 'Delete Author');
+
+define('TEXT_ARTICLE_BY', 'Article by ');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this authors <a href="http://%s" target="_blank">web page</a>.');
+
+define('TEXT_AUTHORS', 'Authors:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_ARTICLES', 'Articles:');
+
+define('TEXT_NEW_INTRO', 'Please fill out the following information for the new author');
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes.');
+
+define('TEXT_AUTHORS_NAME', 'Authors Name:');
+define('TEXT_AUTHORS_DESCRIPTION', 'Authors Description:');
+define('TEXT_AUTHORS_URL', 'Authors URL:');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this author?');
+define('TEXT_DELETE_ARTICLES', 'Delete articles from this author? (including article reviews and upcoming articles)');
+define('TEXT_DELETE_WARNING_ARTICLES', '<b>WARNING:</b> There are %s articles still linked to this author!');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/backup.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/backup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/backup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: backup.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gestionnaire de sauvegarde de la base de donn&eacute;es');
+
+define('TABLE_HEADING_TITLE', 'Titre');
+define('TABLE_HEADING_FILE_DATE', 'Date');
+define('TABLE_HEADING_FILE_SIZE', 'Taille');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_NEW_BACKUP', 'Nouvelle sauvegarde');
+define('TEXT_INFO_HEADING_RESTORE_LOCAL', 'Restaurer localement');
+define('TEXT_INFO_NEW_BACKUP', 'N\'interrompez pas le processus de sauvegarde. Celui-ci peut durer quelques minutes');
+define('TEXT_INFO_UNPACK', '<br><br>(apr&egrave;s extraction des fichiers de l\'archive)');
+define('TEXT_INFO_RESTORE', 'Ne pas interrompre le processus de restauration.<br><br>Plus le fichier est grand, plus cela prendra du temps!<br><br>Si possible, utilisez un client Mysql.<br><br>Par exemple :<br><br><b>mysql -h' . DB_SERVER . ' -u' . DB_SERVER_USERNAME . ' -p ' . DB_DATABASE . ' < %s </b> %s');
+define('TEXT_INFO_RESTORE_LOCAL', 'Ne pas interrompre le processus de restauration.<br><br>Plus le fichier est grand, plus cela prendra du temps!');
+define('TEXT_INFO_RESTORE_LOCAL_RAW_FILE', 'Le fichier transf&eacute;rl&eacute; doit &ecirc;tre au format SQL brut (texte).');
+define('TEXT_INFO_DATE', 'Date :');
+define('TEXT_INFO_SIZE', 'Taille :');
+define('TEXT_INFO_COMPRESSION', 'Compression :');
+define('TEXT_INFO_USE_GZIP', 'Utiliser GZIP');
+define('TEXT_INFO_USE_ZIP', 'Utiliser ZIP');
+define('TEXT_INFO_USE_NO_COMPRESSION', 'Pas de compression (Pur SQL)');
+define('TEXT_INFO_DOWNLOAD_ONLY', 'T&eacute;l&eacute;charger seulement (ne pas le stocker côt&eacute; serveur)');
+define('TEXT_INFO_BEST_THROUGH_HTTPS', 'Le meilleur dans le cas d\'une connexion HTTPS');
+define('TEXT_DELETE_INTRO', 'Etes vous sur de vouloir supprimer cette sauvegarde ?');
+define('TEXT_NO_EXTENSION', 'Aucune');
+define('TEXT_BACKUP_DIRECTORY', 'R&eacute;pertoire de sauvegarde :');
+define('TEXT_LAST_RESTORATION', 'Derni&egrave;re restauration :');
+define('TEXT_FORGET', '(<u>oubli&eacute;</u>)');
+
+define('ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST', 'Erreur : Le r&eacute;pertoire de sauvegarde n\'existe pas. Merci de le pr&eacute;ciser dans le fichier configure.php.');
+define('ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE', 'Erreur : Impossible d\'&eacute;crire dans le r&eacute;pertoire de sauvegarde.');
+define('ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE', 'Erreur : Lien de t&eacute;l&eacute;chargement non disponible.');
+
+define('SUCCESS_LAST_RESTORE_CLEARED', 'Succ&egrave;s : La date de derniere restauration est modifi&eacute;e.');
+define('SUCCESS_DATABASE_SAVED', 'Succ&egrave;s : La base de donn&eacute;es a &eacute;t&eacute; sauv&eacute;e.');
+define('SUCCESS_DATABASE_RESTORED', 'Succ&egrave;s : La base de donn&eacute;es a &eacute;t&eacute; restaur&eacute;.');
+define('SUCCESS_BACKUP_DELETED', 'Success : La base de donn&eacute;es a &eacute;t&eacute; supprim&eacute;.');
+define('BYTES', ' bytes');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/backup_mysql.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/backup_mysql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/backup_mysql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// |zen-cart Open Source E-commerce                                       |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 2003 The zen-cart developers                           |
+// |                                                                      |
+// | http://www.zen-cart.com/index.php                                    |
+// |                                                                      |
+// | Portions Copyright (c) 2003 osCommerce                               |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the GPL license,       |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available through the world-wide-web at the following url:           |
+// | http://www.zen-cart.com/license/2_0.txt.                             |
+// | If you did not receive a copy of the zen-cart license and are unable |
+// | to obtain it through the world-wide-web, please send a note to       |
+// | license at zen-cart.com so we can mail you a copy immediately.          |
+// +----------------------------------------------------------------------+
+// $Id: backup_mysql.php,v 1.2.0.1 2004/08/03 00:00:00 DrByteZen Exp $
+//
+
+// define the locations of the mysql utilities.  Typical location is in '/usr/bin/' ... but not on Windows servers.
+// try 'c:/mysql/bin/mysql.exe' and 'c:/mysql/bin/mysqldump.exe' on Windows hosts ... change drive letter and path as needed
+define('LOCAL_EXE_MYSQL',     '/usr/local/bin/mysql');  // used for restores
+define('LOCAL_EXE_MYSQLDUMP', '/usr/local/bin/mysqldump');  // used for backups
+
+// the following are the language definitions
+define('HEADING_TITLE', 'Sauvegarde BDD - MySQL');
+define('WARNING_NOT_SECURE_FOR_DOWNLOADS','<span class="errorText">NOTE: LLe SSL n\'est pas activ&eacute;. Tout les t&eacute;l&eacute;chargements de cette page ne seront pas encrypt&eacute;s. Faire des sauvegardes et des restaurations sera bon, mais t&eacute;l&eacute;charger/envoyer des dossiers de/vers le serveur pr&eacute;sente un risque de s&eacute;curit&eacute;.');
+
+define('TABLE_HEADING_TITLE', 'titre');
+define('TABLE_HEADING_FILE_DATE', 'date');
+define('TABLE_HEADING_FILE_SIZE', 'taille');
+define('TABLE_HEADING_ACTION', 'action');
+
+define('TEXT_INFO_HEADING_NEW_BACKUP', 'nouvelle sauvegarde');
+define('TEXT_INFO_HEADING_RESTORE_LOCAL', 'restaurer localement');
+define('TEXT_INFO_NEW_BACKUP', 'n\'interrompez pas la sauvegarde : elle peut durer quelques minutes...');
+define('TEXT_INFO_UNPACK', '<br><br>(apr&egrave;s extraction des fichiers de l\'archive)');
+define('TEXT_INFO_RESTORE', 'n\'interrompez pas la restauration et utilisez un client Mysql : <br><br><b>mysql -h' . DB_SERVER . ' -u' . DB_SERVER_USERNAME . ' -p ' . DB_DATABASE . ' < %s </b> %s');
+define('TEXT_INFO_RESTORE_LOCAL', 'n\'interrompez pas le processus de restauration... <br>');
+define('TEXT_INFO_RESTORE_LOCAL_RAW_FILE', 'le fichier transf&eacute;rl&eacute; doit &ecirc;tre au format SQL brut (texte).');
+define('TEXT_INFO_DATE', 'date :');
+define('TEXT_INFO_SIZE', 'taille :');
+define('TEXT_INFO_COMPRESSION', 'compression :');
+define('TEXT_INFO_USE_GZIP', 'utiliser GZIP');
+define('TEXT_INFO_USE_ZIP', 'utiliser ZIP');
+define('TEXT_INFO_USE_NO_COMPRESSION', 'pas de compression (pur SQL)');
+define('TEXT_INFO_DOWNLOAD_ONLY', 't&eacute;l&eacute;charger sans stocker c&ocirc;t&eacute; serveur');
+define('TEXT_INFO_BEST_THROUGH_HTTPS', 'meilleure solution dans le cas d\'une connexion HTTPS');
+define('TEXT_DELETE_INTRO', 'voulez-vous supprimer cette sauvegarde ?');
+define('TEXT_NO_EXTENSION', 'aucune');
+define('TEXT_BACKUP_DIRECTORY', 'r&eacute;pertoire de sauvegarde :');
+define('TEXT_LAST_RESTORATION', 'derni&egrave;re restauration :');
+define('TEXT_FORGET', '(<u>oubli&eacute;</u>)');
+
+define('ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST', 'erreur : r&eacute;pertoire de savegarde inexistant.');
+define('ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE', 'erreur : CHMOD de r&eacute;pertoire.');
+define('ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE', 'erreur : pas de lien.');
+define('ERROR_CANT_BACKUP_IN_SAFE_MODE','ERROR: Cannot use backup script when safe_mode is enabled.');
+
+define('SUCCESS_LAST_RESTORE_CLEARED', 'succ&egrave;s : la date de derni&egrave;re restauration a &eacute;t&eacute; modifi&eacute;e.');
+define('SUCCESS_DATABASE_SAVED', 'succ&egrave;s : la base de donn&eacute;es a &eacute;t&eacute; sauvegard&eacute;e.');
+define('SUCCESS_DATABASE_RESTORED', 'succ&egrave;s : la base de donn&eacute;es a &eacute;t&eacute; restaur&eacute;e.');
+define('SUCCESS_BACKUP_DELETED', 'succ&egrave;s : la base de donn&eacute;es a &eacute;t&eacute; supprim&eacute;e.');
+define('FAILURE_DATABASE_NOT_SAVED', 'Echec: La base de donn&eacute;es n\'a pas &eacute;t&eacute; sauvegard&eacute;e.');
+define('FAILURE_DATABASE_NOT_SAVED_UTIL_NOT_FOUND', 'ERREUR: Impossible de trouver l\'utilitaire MYSQLDUMP. SAUVEGARDE ANNULEE.');
+define('FAILURE_DATABASE_NOT_RESTORED', 'Echec: La base de donn&eacute;es n\'a pas &eacute;t&eacute; restaurer correctement. Veuillez faire une v&eacute;rification.');
+define('FAILURE_DATABASE_NOT_RESTORED_FILE_NOT_FOUND', 'Echec: La base de donn&eacute;es n\'est pas restaur&eacute;e.  ERREUR: FICHIER NON TROUVE: %s');
+define('FAILURE_DATABASE_NOT_RESTORED_UTIL_NOT_FOUND', 'ERREUR: Impossible de trouver l\'utilitaire de restauration MYSQL. RESTAURATION ECHOUEE.');
+
+define('BACKUP_MYSQl_ERROR_MSG_1', 'Checking Path: ');
+define('BACKUP_MYSQl_ERROR_MSG_2', 'COMMAND FILES FOUND/SELECTED:');
+define('BACKUP_MYSQl_ERROR_MSG_3', 'COMMAND: ');
+define('BACKUP_MYSQl_ERROR_MSG_4', "valueA: ");
+define('BACKUP_MYSQl_ERROR_MSG_5', "valueB: ");
+define('BACKUP_MYSQl_ERROR_MSG_6', 'Result code: ');
+define('BYTES', ' bytes');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/banner_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/banner_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/banner_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: banner_manager.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gestion Banni&egrave;re');
+
+define('TABLE_HEADING_BANNERS', 'Banni&egrave;res');
+define('TABLE_HEADING_GROUPS', 'Groupes');
+define('TABLE_HEADING_STATISTICS', 'Affichages / Clics');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_BANNERS_TITLE', 'Titre Banni&egrave;re:');
+define('TEXT_BANNERS_URL', 'URL Banni&egrave;re:');
+define('TEXT_BANNERS_GROUP', 'Groupe Banni&egrave;re:');
+define('TEXT_BANNERS_NEW_GROUP', ', ou entrer un nouveau groupe ci-dessous');
+define('TEXT_BANNERS_IMAGE', 'Image:');
+define('TEXT_BANNERS_IMAGE_LOCAL', ', ou entrer un nom de fichier image ci-dessous');
+define('TEXT_BANNERS_IMAGE_TARGET', 'Image Cible (Sauver vers):');
+define('TEXT_BANNERS_HTML_TEXT', 'Textes HTML:');
+define('TEXT_BANNERS_EXPIRES_ON', 'Expires On:');
+define('TEXT_BANNERS_OR_AT', ', or at');
+define('TEXT_BANNERS_IMPRESSIONS', 'impressions/views.');
+define('TEXT_BANNERS_SCHEDULED_AT', 'Scheduled At:');
+define('TEXT_BANNERS_BANNER_NOTE', '<b>Banner Notes:</b><ul><li>Use an image or HTML text for the banner - not both.</li><li>HTML Text has priority over an image</li></ul>');
+define('TEXT_BANNERS_INSERT_NOTE', '<b>Image Notes:</b><ul><li>Uploading directories must have proper user (write) permissions setup!</li><li>Do not fill out the \'Save To\' field if you are not uploading an image to the webserver (ie, you are using a local (serverside) image).</li><li>The \'Save To\' field must be an existing directory with an ending slash (eg, banners/).</li></ul>');
+define('TEXT_BANNERS_EXPIRCY_NOTE', '<b>Expiry Notes:</b><ul><li>Only one of the two fields should be submitted</li><li>If the banner is not to expire automatically, then leave these fields blank</li></ul>');
+define('TEXT_BANNERS_SCHEDULE_NOTE', '<b>Schedule Notes:</b><ul><li>If a schedule is set, the banner will be activated on that date.</li><li>All scheduled banners are marked as deactive until their date has arrived, to which they will then be marked active.</li></ul>');
+
+define('TEXT_BANNERS_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_BANNERS_SCHEDULED_AT_DATE', 'Planifi&eacute; &agrave; : <b>%s</b>');
+define('TEXT_BANNERS_EXPIRES_AT_DATE', 'Expire le : <b>%s</b>');
+define('TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS', 'Expire au bout de : <b>%s</b> affichages');
+define('TEXT_BANNERS_STATUS_CHANGE', 'Changement de l\'&eacute;tat : %s');
+
+define('TEXT_BANNERS_DATA', 'D<br>A<br>T<br>A');
+define('TEXT_BANNERS_LAST_3_DAYS', 'Les derniers 3 jours');
+define('TEXT_BANNERS_BANNER_VIEWS', 'Nombre d\'impressions');
+define('TEXT_BANNERS_BANNER_CLICKS', 'Nombre de clics');
+
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir d&eacute;truire cette banni&egrave;re ?');
+define('TEXT_INFO_DELETE_IMAGE', 'Effacer l\'image de la banni&egrave;re');
+
+define('SUCCESS_BANNER_INSERTED', 'Succ&egrave;s : La banni&egrave;re a &eacute;t&eacute; ins&eacute;r&eacute;e.');
+define('SUCCESS_BANNER_UPDATED', 'Succ&egrave;s : La banni&egrave;re a &eacute;t&eacute; mise à jour.');
+define('SUCCESS_BANNER_REMOVED', 'Succ&egrave;s : La banni&egrave;re a &eacute;t&eacute; retir&eacute;e.');
+define('SUCCESS_BANNER_STATUS_UPDATED', 'Succ&egrave;s : Le status de la banni&egrave;re a &eacute;t&eacute; mis à jour.');
+
+define('ERROR_BANNER_TITLE_REQUIRED', 'Erreur : Un titre est requis pour la banni&egrave;re.');
+define('ERROR_BANNER_GROUP_REQUIRED', 'Erreur : Un groupe est requis pour la banni&egrave;re.');
+define('ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Erreur : Le r&eacute;pertoire de destination n\'existe pas : %s');
+define('ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Erreur : L\'ecriture sur la cible a &eacute;chou&eacute; : %s');
+define('ERROR_IMAGE_DOES_NOT_EXIST', 'Erreur : L\'image n\'existe pas.');
+define('ERROR_IMAGE_IS_NOT_WRITEABLE', 'Erreur : L\'image ne peut &ecirc;tre retir&eacute;e.');
+define('ERROR_UNKNOWN_STATUS_FLAG', 'Erreur : Statut inconnu.');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Erreur : Le r&eacute;pertoire Graphs n\'existe pas. Veuillez cr&eacute;er un r&eacute;pertoire \'graphs\' dans \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Erreur : Impossible d\'&eacute;crire dans le r&eacute;pertoire Graphs.');
+define('DATE_FORMAT', '(dd/mm/yyyy)');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/banner_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/banner_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/banner_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: banner_statistics.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Statistiques des banni&egrave;res');
+
+define('TABLE_HEADING_SOURCE', 'Source');
+define('TABLE_HEADING_VIEWS', 'Vues');
+define('TABLE_HEADING_CLICKS', 'Clics');
+
+define('TEXT_BANNERS_DATA', 'D<br>a<br>t<br>a');
+define('TEXT_BANNERS_DAILY_STATISTICS', '%s Statistiques journali&egrave;res pour %s %s');
+define('TEXT_BANNERS_MONTHLY_STATISTICS', '%s Statistiques mensuelles pour %s');
+define('TEXT_BANNERS_YEARLY_STATISTICS', '%s Statistiques annuelles');
+
+define('STATISTICS_TYPE_DAILY', 'Journali&egrave;res');
+define('STATISTICS_TYPE_MONTHLY', 'Mensuelles');
+define('STATISTICS_TYPE_YEARLY', 'Annuelles');
+
+define('TITLE_TYPE', 'Type :');
+define('TITLE_YEAR', 'Ann&eacute;e :');
+define('TITLE_MONTH', 'Mois :');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Erreur : Le r&eacute;pertoire des graphiques n\'existe pas. Cr&eacute;er un r&eacute;pertoire  \'graphs\' dans \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Erreur : Le r&eacute;pertoire des graphiques n\'est pas autoris&eacute; en &eacute;criture.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/c_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/c_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/c_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,147 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Editing Order');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('ADDING_TITLE', 'Adding a Product to Order');
+
+define('CATEGORY_ORDER_DETAILS', 'Customer Details');
+define('ENTRY_CURRENCY', 'Customer Currency');
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_TAX', 'Tax');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_UNIT_PRICE', 'Unit Price');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Total Price');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Customer Notified');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+
+define('ENTRY_CUSTOMER', 'Customer:');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Company');
+define('ENTRY_CUSTOMER_ADDRESS', 'Address');
+define('ENTRY_CUSTOMER_SUBURB', 'Suburb');
+define('ENTRY_CUSTOMER_CITY', 'City');
+define('ENTRY_CUSTOMER_STATE', 'State');
+define('ENTRY_CUSTOMER_POSTCODE', 'Postcode');
+define('ENTRY_CUSTOMER_COUNTRY', 'Country');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Sold To:');
+define('ENTRY_DELIVERY_TO', 'Delivery To:');
+define('ENTRY_SHIP_TO', 'Ship To:');
+define('ENTRY_SHIPPING_ADDRESS', 'Shipping Address:');
+define('ENTRY_BILLING_ADDRESS', 'Billing Address:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Credit Card Type:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Credit Card Expires:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sub-Total:');
+define('ENTRY_TAX', 'Tax:');
+define('ENTRY_SHIPPING', 'Shipping:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'Date Last Updated:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Notify Customer:');
+define('ENTRY_NOTIFY_COMMENTS', 'Append Comments:');
+define('ENTRY_PRINTABLE', 'Print Invoice');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Use a negative number -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Add New Product');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> CCV Code:  Not stored - due to processing regulations. Enable CCV email in module settings.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+define('TEXT_NO_ORDER_HISTORY', 'No Order History Available');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Order Update');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "\n\n" . 'New status: %s' . "\n\n" . 'Please reply to this email if you have any questions.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'The comments for your order are' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Error: Order does not exist.');
+define('SUCCESS_ORDER_UPDATED', 'Success: Order has been successfully updated.');
+define('WARNING_ORDER_NOT_UPDATED', 'Warning: Nothing to change. The order was not updated.');
+
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choose a product');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Choose an option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Product has no options, so skipping...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'pieces of this product');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Add');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+define('DONT_ADD_NEW_PRODUCT', 'N\'ajoutez pas le nouveau produit');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/cache.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/cache.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/cache.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: cache.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Contr&ocirc;le du cache');
+
+define('TABLE_HEADING_CACHE', 'Cache des blocs');
+define('TABLE_HEADING_DATE_CREATED', 'Date de cr&eacute;ation');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'Le fichier n\'existe pas');
+define('TEXT_CACHE_DIRECTORY', 'R&eacute;pertoire du cache :');
+
+define('ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST', 'Erreur : Le r&eacute;pertoire de cache n\'existe pas. Merci de le pr&eacute;iser dans Configuration -> Cache.');
+define('ERROR_CACHE_DIRECTORY_NOT_WRITEABLE', 'Erreur : Le r&eacute;pertoire de cache n\'est pas autoris&eacute; en &eacute;criture.');
+// labels for Tools>Cache Control
+define('TEXT_CACHE_CATEGORIES', 'Categories Box');
+define('TEXT_CACHE_CATEGORIES1', 'Categories Box 1');
+define('TEXT_CACHE_CATEGORIES2', 'Categories Box 2');
+define('TEXT_CACHE_CATEGORIES3', 'Categories Box 3');
+define('TEXT_CACHE_CATEGORIES4', 'Categories Box 4');
+define('TEXT_CACHE_CATEGORIES5', 'Categories Box 5');
+define('TEXT_CACHE_ALLPROD', 'All Produces');
+define('TEXT_CACHE_ALLMANUF', 'All Manufactures');
+define('TEXT_CACHE_ALLCATS', 'All Categories');
+define('TEXT_CACHE_MANUFACTURERS', 'Manufacturers Box');
+define('TEXT_CACHE_ALSO_PURCHASED', 'Also Purchased Module');
+define('TEXT_CACHE_COOLMENU', 'Cool Menu');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,187 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','Images du produit:<small><br>Image principale utilis&eacute;e dans la page <br><u>catalogue & description</u>.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', 'Grande Image:<br><small>REMPLACE les petites images dans la page <br><u>description produits</u>.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', 'Pop-up Image:<br><small>REMPLACE les petites images dans la page <br><u>pop-up</u>.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Produit partageant cette image =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Enlever</b> cette image du produit?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>D&eacute;truire</b> cette image du serveur (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Enlever');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'D&eacute;truire');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Petites Images,</b> si une image "SM" st utilis&eacute;e<br>(Seule) Aucun lien Pop-up n est cr&eacute;&eacute;, l image "SM"<br> sera plac&eacute;e directement sous la description du produit<br>. Si utilis&eacute;e en compl&eacute;ment de l image<br>"XL" à droite, un lien Pop-up est cr&eacute;&eacute;<br> et l image "XL" apparaitra<br>dans un Pop-up.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Larges Images,</b> Utilis&eacute;e pour les images Pop-up<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Plus d images additionnelles - celles-ci apparaîtront au-dessous de la description de produit si utilis&eacute;.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Image 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Image 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Image 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Image 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Image 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Image 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Image 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Image 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Image 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Image 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Image 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Image 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+define('HEADING_TITLE', 'Cat&eacute;gories / Produits');
+define('HEADING_TITLE_SEARCH', 'Rechercher :');
+define('HEADING_TITLE_GOTO', 'Aller &agrave; :');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Cat&eacute;gories / Produits');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Statut');
+
+define('TEXT_NEW_PRODUCT', 'Nouveau Produit dans &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Cat&eacute;gories :');
+define('TEXT_SUBCATEGORIES', 'Sous-cat&eacute;gories :');
+define('TEXT_PRODUCTS', 'Produits :');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Prix :');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Classe Fiscale :');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Ratio moyen :');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantit&eacute; :');
+define('TEXT_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_DELETE_IMAGE', 'D&eacute;truire image');
+
+define('TEXT_DATE_AVAILABLE', 'Date disponibilit&eacute; :');
+define('TEXT_LAST_MODIFIED', 'Derni&egrave;re modification :');
+define('TEXT_IMAGE_NONEXISTENT', 'L\'IMAGE N\'EXISTE PAS');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Merci de cr&eacute;er une nouvelle cat&eacute;gorie ou un produit dans ce niveau.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'Pour plus d\'information, merci de visiter cette <a href="http://%s" target="blank"><u>page web</u></a> de produits.');
+define('TEXT_PRODUCT_DATE_ADDED', 'Ce produit a &eacute;t&eacute; ajout&eacute; &agrave; notre catalogue le %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'Ce produit sera en stock le %s.');
+
+define('TEXT_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_EDIT_CATEGORIES_ID', 'ID de la cat&eacute;gorie :');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Nom de la cat&eacute;gorie :');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Image de la cat&eacute;gorie :');
+define('TEXT_EXISTING_CATEGORIES_IMAGE','Existing Image');
+define('TEXT_EDIT_SORT_ORDER', 'Ordre de tri :');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Titre de la Cat&eacute;gorie:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Description de la Cat&eacute;gorie:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Meta Tag Titre de la Cat&eacute;gorie:');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Meta Tag Description de la Cat&eacute;gorie:');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Meta Tag Mot Cl&eacute; de la Cat&eacute;gorie:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Veuillez choisir une nouvelle cat&eacute;gorie dans laquelle vous voulez copier ce produit');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Cat&eacute;gories courantes :');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'Nouvelle cat&eacute;gorie');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Editer cat&eacute;gorie');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Supprimer cat&eacute;gorie');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'D&eacute;placer cat&eacute;gorie');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Supprimer produit');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'D&eacute;placer produit');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copier vers');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Etes vous sur de vouloir supprimer cette cat&eacute;gorie ?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Etes vous sur de vouloir supprimer d&eacute;finitivement ce produit ?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>ATTENTION :</b> Il y a %s (sous-)cat&eacute;gories li&eacute;es &aacute; cette cat&eacute;gorie !');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>ATTENTION :</b> Il y a %s produits li&eacute;es &aacute; cette cat&eacute;gorie !');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Merci de s&eacute;lectionner la cat&eacute;gorie ou vous voudriez que <b>%s</b> soit plac&eacute;');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Merci de s&eacute;lectionner la cat&eacute;gorie ou vous voudriez que <b>%s</b> soit plac&eacute;');
+define('TEXT_MOVE', 'D&eacute;placer <b>%s</b> vers :');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Merci de compl&eacute;ter les informations suivantes pour la nouvelle cat&eacute;gorie');
+define('TEXT_CATEGORIES_NAME', 'Nom de la cat&eacute;gorie :');
+define('TEXT_CATEGORIES_IMAGE', 'Image de la cat&eacute;gorie :');
+define('TEXT_SORT_ORDER', 'Ordre de tri :');
+
+define('TEXT_PRODUCTS_STATUS', 'Statut des produits :');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date de disponibilit&eacute; :');
+define('TEXT_PRODUCT_AVAILABLE', 'En stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Hors stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Fabricant du produit :');
+define('TEXT_PRODUCTS_NAME', 'Nom du produit :');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Description du produit :');
+define('TEXT_PRODUCTS_QUANTITY', 'Quantit&eacute; de produit en stock :');
+define('TEXT_PRODUCTS_MODEL', 'Mod&egrave;le du produit :');
+define('TEXT_PRODUCTS_IMAGE', 'Image du produit :');
+define('TEXT_PRODUCTS_URL', 'URL du produit :');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(sans http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Prix du produit (HT) :');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Prix du produit (TTC) :');
+define('TEXT_PRODUCTS_WEIGHT', 'Poids du produit :');
+define('TEXT_NONE', '--aucun--');
+
+define('EMPTY_CATEGORY', 'Cat&eacute;gorie vide');
+
+define('TEXT_HOW_TO_COPY', 'M&eacute;thode de copie :');
+define('TEXT_COPY_AS_LINK', 'Lien produit');
+define('TEXT_COPY_AS_DUPLICATE', 'Dupliquer produit');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Erreur : Impossible de lier des produits dans la m&ecirc;me cat&eacutegorie.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Erreur : Impossible d\'&eacute;crire dans le r&eacute;pertoire images : ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Erreur : Le r&eacute;pertoire d\'images n\'existe pas : ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Erreur : La cat&eacute;gorie ne peut pas &ecirc;tre d&eacute;plac&eacute;e dans la sous-cat&eacute;gorie.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Titre de la page Produit:');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Description du Page Header:');
+define('TEXT_PRODUCTS_KEYWORDS', 'Mots cl&eacute;s Produits:');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Edit Product Attributes');
+
+// mod for sub products
+define('MAX_PRODUCT_SUB_ROWS', '5');
+define('TEXT_SUB_PRODUCT','Sub Product:');
+define('TEXT_SUB_PRODUCT_DELETE','Delete');
+define('TEXT_SUB_PRODUCT_NAME','Name');
+define('TEXT_SUB_PRODUCT_PRICE','Price');
+define('TEXT_SUB_PRODUCT_MODEL','Model');
+define('TEXT_SUB_PRODUCT_QTY','Qty');
+define('TEXT_SUB_PRODUCT_WEIGHT','Weight');
+define('TEXT_SUB_PRODUCT_IMAGE','Image');
+define('TEXT_SUB_PRODUCT_NOTE_1','* additional subproducts available upon insert');
+define('TEXT_SUB_PRODUCT_NOTE_2','* zero quantity disables the subproduct');
+
+// Eversun mod for sppc and qty price breaks
+define('TEXT_PRODUCTS_PRICE', 'Retail Price:');
+define('TEXT_PRODUCTS_GROUPS', 'Groups:');
+define('TEXT_PRODUCTS_BASE', 'Base');
+define('TEXT_PRODUCTS_ABOVE', 'Above');
+define('TEXT_PRODUCTS_QTY', 'Qty');
+define('TEXT_PRODUCTS_QTY_BLOCKS', 'Quantity Blocks:');
+define('TEXT_PRODUCTS_QTY_BLOCKS_INFO', '(can only order in blocks of X quantity)');
+define('TEXT_PRODUCTS_SPPP_NOTE', 'Note that if a field is filled, but the checkbox is unchecked no price will be inserted.<br />If a price is already inserted in the database, but the checkbox unchecked it will be removed from the database.');
+define('TEXT_PRODUCTS_QTY_DISCOUNT', '10');
+// Eversun mod end for sppc and qty price breaks
+
+
+define('TEXT_PRODUCT_IMAGES', 'Product Images');
+define('TEXT_EXTRA_FIELDS', 'Extra Fields');
+define('TEXT_EXTRA_IMAGES', 'Extra Images');
+define('TEXT_ACTIVE_ATTRIBUTES', 'Active Attributes');
+define('TEXT_COPY_ATTRIBUTES_TO_ANOTHER_PRODUCT', 'Copy Attributes to another product');
+define('TEXT_COPYING_ATTRIBUTES_FROM', 'Copying Attributes from');
+define('TEXT_COPYING_ATTRIBUTES_TO', 'Copying Attributes to');
+define('TEXT_DELETE_ALL_ATTRIBUTE', 'Delete ALL Attributes and Downloads before copying');
+define('TEXT_OTHERWISE', 'Otherwise ...');
+define('TEXT_DUPLICATE_ATTRIBUTES_SKIPPED', 'Duplicate Attributes should be skipped');
+define('TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN', 'Duplicate Attributes should be overwritten');
+define('TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS', 'Copy Attributes with Downloads');
+define('TEXT_SELECT_PRODUCT_FOR_DISPLAY', 'Select a product for display');
+define('TEXT_COPY_PRODUCT_ATTRIBUTES_TO_CATEGORY', 'Copy Product Attributes to Category ...');
+define('TEXT_COPY_PRODUCT_ATTRIBUTES_FROM_PRODUCT_ID', 'Copy Product Attributes from Product ID');
+define('TEXT_COPYING_TO_ALL_PRODUCTS_IN_CATEGORY_ID', 'Copying to all products in Category ID');
+define('TEXT_CATEGORY_NAME', 'Category Name: ');
+define('TEXT_SELECT_PRODUCT_TO_DISPLAY_ATTRIBUTES', 'Select a product to display attributes');
+define('DATE_FORMAT', '(YYYY-MM-DD)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/check_lang.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/check_lang.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/check_lang.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+
+  Released under the GNU General Public License
+*/
+
+define("ERROR_CANNOT_OPEN_LANGUAGE_DIR","FATAL ERROR: Cannot open language dir: ");
+define("CHECK_LANG_FILENAME","Filename");
+define("CHECK_LANG_MISSING_IN","Missing in");
+define("CHECK_LANG_NONE_FOUND","None found");
+define("CHECK_LANG_FOUND_IN","Found in");
+define("CHECK_LANG_DEFINITION_NAME","Definition name");
+define("CHECK_LANG_EQUAL_TO","Equal to");
+define("CHECK_LANG_REFERENCES","References");
+define("CHECK_LANG_ALL_EQUAL","All equal");
+define("CHECK_LANG_WHERE_USED","Where Used");
+define("CHECK_LANG_FOUND_FOR","Found for");
+define("CHECK_LANG_MISSING_FOR","Missing for");
+define("CHECK_LANG_ALL_BUT","All but");
+define("CHECK_LANG_FILE_NAME","File Name");
+define("CHECK_LANG_SELECT_OPTION","Select option");
+define("CHECK_LANG_TO_CHECK_FILE_CONSISTENCY","To check file consistency");
+define("CHECK_LANG_CLICK_HERE","Click Here");
+define("CHECK_LANG_TO_CHECK_DEFINITION_CONSISTENCY","To check definition consistency");
+define("CHECK_LANG_TO_CHECK_EQUAL_DEFINITIONS","To check equal definitions");
+define("CHECK_LANG_HOME","Home");
+define("CHECK_LANG_BACK","Back");
+define("CHECK_LANG_W_GODEFROY","W Godefroy");
+define("CHECK_LANG_EXECUTION_TIME","Execution Time: ");
+define("CHECK_LANG_TITLE","Check Language Integrity");
+define("CHECK_LANG_LIST_OF_FILES_USING","List of files using");
+define("CHECK_LANG_LIST_OF_FILES_PRESENT_FOR_ONE_LANGUAGE","List of files that are present for one language-definition but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_PRESENT_FOR_ONE_LANGUAGE","List of phrase definitions that are present for one language-file but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_DEFINITIONS_EQUAL","List of phrase definitions that are equal");
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Titre');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Valeur');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_INFO_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_INFO_LAST_MODIFIED', 'Derni&egrave;re modification :');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/countries.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/countries.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/countries.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: countries.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Pays');
+
+define('TABLE_HEADING_COUNTRY_NAME', 'Pays');
+define('TABLE_HEADING_COUNTRY_CODES', 'Codes ISO');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_INFO_COUNTRY_NAME', 'Nom :');
+define('TEXT_INFO_COUNTRY_CODE_2', 'Code ISO (2) :');
+define('TEXT_INFO_COUNTRY_CODE_3', 'Code ISO (3) :');
+define('TEXT_INFO_ADDRESS_FORMAT', 'Format de l\'adresse :');
+define('TEXT_INFO_INSERT_INTRO', 'Merci d\'entrer le nouveau pays avec ses donn&eacute;es li&eacute;es');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir supprimer ce pays ?');
+define('TEXT_INFO_HEADING_NEW_COUNTRY', 'Nouveau pays');
+define('TEXT_INFO_HEADING_EDIT_COUNTRY', 'Editer pays');
+define('TEXT_INFO_HEADING_DELETE_COUNTRY', 'Supprimer pays');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/coupon_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/coupon_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/coupon_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,121 @@
+<?php
+/*
+  $Id: coupon_admin.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TOP_BAR_TITLE', 'Statistiques'); 
+define('HEADING_TITLE', 'Coupons de r&eacute;duction'); 
+define('HEADING_TITLE_STATUS', 'Statut : '); 
+define('TEXT_CUSTOMER', 'Client :'); 
+define('TEXT_COUPON', 'Nom du coupon'); 
+define('TEXT_COUPON_ALL', 'Tous les coupons'); 
+define('TEXT_COUPON_ACTIVE', 'Coupons actifs'); 
+define('TEXT_COUPON_INACTIVE', 'Coupons inactifs'); 
+define('TEXT_SUBJECT', 'Sujet :'); 
+define('TEXT_FROM', 'De :'); 
+define('TEXT_FREE_SHIPPING', 'Livraison gratuite'); 
+define('TEXT_MESSAGE', 'Message :'); 
+define('TEXT_SELECT_CUSTOMER', 'S&eacute;lection du client'); 
+define('TEXT_ALL_CUSTOMERS', 'Tous les clients'); 
+define('TEXT_NEWSLETTER_CUSTOMERS', 'A tous ceux qui ont soucrit la newsletter'); 
+define('TEXT_CONFIRM_DELETE', 'Etes vous sur de vouloir d&eacute;sactiver ce coupon ?<br><br>Les coupons ne sont pas supprim&eacute;s mais juste marqu&eacute;s comme inactifs.'); 
+
+define('TEXT_TO_REDEEM1', 'Vous pouvez changer les coupons pendant la proc&eacute;dure de paiement. Entrez simplement le code dans la case appropri&eacute;e, et cliquez sur &eacute;change.'); 
+define('TEXT_IN_CASE', ' en cas de probl&egrave;me. '); 
+define('TEXT_VOUCHER_IS', 'Le code du coupon est '); 
+define('TEXT_REMEMBER', 'Ne perdez pas le code du coupon, assurez vous de le garder pour pouvoir profiter de cette offre sp&eacute;ciale.'); 
+define('TEXT_VISIT', 'quand vous visitez <a style="color: #000000" href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . STORE_NAME . '</a>' ."\n" .'(' . HTTP_SERVER . DIR_WS_CATALOG . ')');
+define('TEXT_ENTER_CODE', ' et entrez le code '); 
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">The Back Button has been DISABLED while HTML WYSIWG Editor is turned ON.</b></font> WHY? - Because if you click the back button to edit your HTML email, the PHP (php.ini - "Magic Quotes = On") will automatically add "\\\\\\\" backslashes everywhere Double Quotes " appear (HTML uses them in Links, Images and More) and this distorts the HTML, the pictures will dissapear once you submit the email again. If you turn OFF WYSIWYG Editor in Admin, the HTML Ability of osCommerce is also turned OFF and the back button will re-appear. A fix for this HTML and PHP issue would be nice if someone knows a solution.<br><br><b>If you really need to Preview your emails before sending them, use the Preview Button located on the WYSIWYG Editor.<br><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML is currently Disabled!</b></font><br><br>If you want to send HTML email, Enable WYSIWYG Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>');
+
+define('TEXT_OR_VISIT', 'or visit ');
+define('TEXT_TO_REDEEM', ' To redeem this Discount coupon, please click on the link below. Please also write down the redemption code');
+define('TEXT_WHICH_IS', ' which is ');
+define('TEXT_IN_CASE', ' in case you have any problems.');
+
+
+define('TEXT_COUPON_REDEEMED', 'Redeemed Coupons');
+define('REDEEM_DATE_LAST', 'Date Last Redeemed');
+define('COUPON_STATUS', 'Status');
+define('COUPON_STATUS_HELP', 'Set to ' . IMAGE_ICON_STATUS_RED . ' to disable customers\' ability to use the coupon.');
+define('COUPON_BUTTON_EMAIL_VOUCHER', 'Email Voucher');
+define('COUPON_BUTTON_EDIT_VOUCHER', 'Edit Voucher');
+define('COUPON_BUTTON_DELETE_VOUCHER', 'Delete Voucher');
+define('COUPON_BUTTON_VOUCHER_REPORT', 'Voucher Report');
+
+define('TABLE_HEADING_ACTION', 'Action'); 
+
+define('TEXT_HEADING_COUPON_REPORT', 'Coupon Report');
+
+define('CUSTOMER_ID', 'ID Client'); 
+define('CUSTOMER_NAME', 'Nom Client'); 
+define('REDEEM_DATE', 'Date de Rachat'); 
+define('IP_ADDRESS', 'Adresse IP'); 
+
+define('TEXT_REDEMPTIONS', 'Rachat'); 
+define('TEXT_REDEMPTIONS_TOTAL', 'Au Total'); 
+define('TEXT_REDEMPTIONS_CUSTOMER', 'Pour ce client'); 
+define('TEXT_NO_FREE_SHIPPING', 'Pas de livraison gratuite'); 
+
+define('NOTICE_EMAIL_SENT_TO', 'Note : Email envoy&eacute; &agrave; : %s'); 
+define('ERROR_NO_CUSTOMER_SELECTED', 'Erreur : Aucun client n\'a &eacute;t&eacute; s&eacute;lectionn&eacute;.'); 
+define('ERROR_NO_COUPON_AMOUNT', 'Error: No coupon amount has been entered. Either enter an amount or select free shipping.');
+define('ERROR_COUPON_EXISTS', 'Error: A coupon with the same coupon code already exists.');
+
+define('COUPON_NAME', 'Nom du coupon'); 
+//define('COUPON_VALUE', 'Coupon Value'); 
+define('COUPON_AMOUNT', 'Montant du coupon'); 
+define('COUPON_CODE', 'Code du coupon'); 
+define('COUPON_STARTDATE', 'Date d\'effet'); 
+define('COUPON_FINISHDATE', 'Date de fin d\'effet'); 
+define('COUPON_FREE_SHIP', 'Livraison gratuite'); 
+define('COUPON_DESC', 'Description du coupon'); 
+define('COUPON_MIN_ORDER', 'Montant minimum d\'achat du coupon'); 
+define('COUPON_USES_COUPON', 'Utilisations par coupon'); 
+define('COUPON_USES_USER', 'Utilisations par client'); 
+define('COUPON_PRODUCTS', 'Liste des produits valides'); 
+define('COUPON_CATEGORIES', 'Liste des cat&eacute;gories valides'); 
+define('VOUCHER_NUMBER_USED', 'Nombre utilis&eacute;'); 
+define('DATE_CREATED', 'Date de cr&eacute;ation'); 
+define('DATE_MODIFIED', 'Date de modification'); 
+define('TEXT_HEADING_NEW_COUPON', 'Cr&eacute;er un nouveau coupon'); 
+define('TEXT_NEW_INTRO', 'Merci de renseigner les diff&eacute;rentes informations du coupon.<br>'); 
+
+
+define('COUPON_NAME_HELP', 'Un nom court pour le coupon'); 
+define('COUPON_AMOUNT_HELP', 'Le montant de la r&eacute;duction du coupon, soit fixe soit ajouter un  % &agrave; la fin pour un pourcentage de r&eacute;duction.'); 
+define('COUPON_CODE_HELP', 'Vous pouvez rentrer votre propre code ici, ou laisser vide pour qu\'il soit automatiquement g&eacute;n&eacute;r&eacute;.'); 
+define('COUPON_STARTDATE_HELP', 'La date du coupon &agrave; partir de laquelle il sera valide'); 
+define('COUPON_FINISHDATE_HELP', 'La date d\'expiration'); 
+define('COUPON_FREE_SHIP_HELP', 'Le coupon donne la livraison gratuite sur une commande. Attention, cela annule le montant du coupon mais respecte le minimum de commande'); 
+define('COUPON_DESC_HELP', 'Une description du coupon pour le client'); 
+define('COUPON_MIN_ORDER_HELP', 'Le montant minimum de commande &agrave; partir duquel le coupon deviens valide'); 
+define('COUPON_USES_COUPON_HELP', 'Le nombre maximum de fois que le coupon peut &ecirc;tre utilis&eacute;, laisser vide si on ne veut pas de limite.'); 
+define('COUPON_USES_USER_HELP', 'Nombre de fois que le client peut utilis&eacute; ce coupon, laisser vide si on ne veut pas de limite.'); 
+define('COUPON_PRODUCTS_HELP', 'Liste des identifiants de produits (s&eacute;par&eacute; par une virgule) qui peuvent &ecirc;tre associ&eacute;s au coupon. Laisser vide si on ne veut pas de limite.'); 
+define('COUPON_CATEGORIES_HELP', 'Liste des \'cpaths\' qui peuvent &ecirc;tre associ&eacute;s au coupon, laisser vide si on ne veut pas de limite.'); 
+
+
+define('ALT_CONFIRM_DELETE_VOUCHER', 'Confirm Delete Voucher');
+define('ALT_CANCEL', 'Cancel');
+define('VIEW', 'View');
+define('ALT_EMAIL_VOUCHER', 'Email Voucher');
+define('ALT_EDIT_VOUCHER', 'Edit Voucher');
+define('ALT_DELETE_VOUCHER', 'Delete Voucher');
+define('ALT_VOUCHER_REPORT', 'Voucher Report');
+define('COUPON_BUTTON_EMAIL_VOUCHER', 'Email Voucher');
+define('COUPON_BUTTON_EDIT_VOUCHER', 'Edit Voucher');
+define('COUPON_BUTTON_DELETE_VOUCHER', 'Delete Voucher');
+define('COUPON_BUTTON_VOUCHER_REPORT', 'Voucher Report');
+define('COUPON_BUTTON_PREVIEW', 'Preview');
+define('COUPON_BUTTON_BACK', 'Back');
+define('COUPON_STATUS', 'Status');
+define('COUPON_STATUS_HELP', 'Set to ' . IMAGE_ICON_STATUS_RED . ' to disable customers\' ability to use the coupon.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/coupon_restrict.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/coupon_restrict.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/coupon_restrict.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: coupon_restrict.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TOP_BAR_TITLE', 'Statistiques');
+define('HEADING_TITLE', 'Coupons de r&eacute;duction');
+define('HEADING_TITLE_STATUS', 'Statut : ');
+define('TEXT_CUSTOMER', 'Client :');
+define('TEXT_COUPON', 'Nom du coupon');
+define('TEXT_COUPON_ALL', 'Tous les coupons');
+define('TEXT_COUPON_ACTIVE', 'Coupons actifs');
+define('TEXT_COUPON_INACTIVE', 'Coupons inactifs');
+define('TEXT_SUBJECT', 'Sujet :');
+define('TEXT_FROM', 'De :');
+define('TEXT_FREE_SHIPPING', 'Livraison gratuite');
+define('TEXT_MESSAGE', 'Message :');
+define('TEXT_SELECT_CUSTOMER', 'S&eacute;lection du client');
+define('TEXT_ALL_CUSTOMERS', 'Tous les clients');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'A tous ceux qui ont soucrit la newsletter');
+define('TEXT_CONFIRM_DELETE', 'Etes vous sur de vouloir d&eacute;sactiver ce coupon ?<br><br>Les coupons ne sont pas supprim&eacute;s mais juste marqu&eacute;s comme inactifs.');
+
+define('TEXT_TO_REDEEM', 'Vous pouvez changer les coupons pendant la proc&eacute;dure de paiement. Entrez simplement le code dans la case appropri&eacute;e, et cliquez sur &eacute;change.');
+define('TEXT_IN_CASE', ' en cas de probl&eacute;me. ');
+define('TEXT_VOUCHER_IS', 'Le code du coupon est ');
+define('TEXT_REMEMBER', 'Ne perdez pas le code du coupon, assurez vous de le garder pour pouvoir profiter de cette offre sp&eacute;ciale.');
+define('TEXT_VISIT', 'quand vous visitez ' . HTTP_SERVER . DIR_WS_CATALOG);
+define('TEXT_ENTER_CODE', ' et entrez le code ');
+
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+
+define('NOTICE_EMAIL_SENT_TO', 'Note : Email envoy&eacute; a : %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Erreur : aucun client n\'a &eacute;t&eacute; s&eacute;lectionn&eacute;.');
+define('COUPON_NAME', 'Nom du coupon');
+//define('COUPON_VALUE', 'Coupon Value');
+define('COUPON_AMOUNT', 'Montant du coupon');
+define('COUPON_CODE', 'Code du coupon');
+define('COUPON_STARTDATE', 'Date d\'effet');
+define('COUPON_FINISHDATE', 'Date de fin d\'effet');
+define('COUPON_FREE_SHIP', 'Livraison gratuite');
+define('COUPON_DESC', 'Description du coupon');
+define('COUPON_MIN_ORDER', 'Montant minimum d\'achat du coupon');
+define('COUPON_USES_COUPON', 'Utilisations par coupon');
+define('COUPON_USES_USER', 'Utilisations par client');
+define('COUPON_PRODUCTS', 'Liste des produits valides');
+define('COUPON_CATEGORIES', 'Liste des cat&eacute;gories valides');
+define('VOUCHER_NUMBER_USED', 'Numbre utilis&eacute;');
+define('DATE_CREATED', 'Date de cr&eacute;ation');
+define('DATE_MODIFIED', 'Date de modification');
+define('TEXT_HEADING_NEW_COUPON', 'Creer un nouveau coupon');
+define('TEXT_NEW_INTRO', 'Merci de renseigner les diff&eacute;rentes informations du coupon.<br>');
+
+
+define('COUPON_NAME_HELP', 'Un nom court pour le coupon');
+define('COUPON_AMOUNT_HELP', 'Le montant de la r&eacute;duction du coupon, soit fixe soit ajouter un  % a la fin pour un pourcentage de r&eacute;duction.');
+define('COUPON_CODE_HELP', 'Vous pouvez rentrer votre propre code ici, ou laisser vide pour qu\'il soit automatiquement g&eacute;n&eacute;r&eacute;.');
+define('COUPON_STARTDATE_HELP', 'La date du coupon a partir de laquelle il sera valide');
+define('COUPON_FINISHDATE_HELP', 'La date d\'expiration');
+define('COUPON_FREE_SHIP_HELP', 'Le coupon donne la livraison gratuite sur une commande. Attention, cela annule le montant du coupon mais respecte le minimum de commande');
+define('COUPON_DESC_HELP', 'Une description du coupon pour le client');
+define('COUPON_MIN_ORDER_HELP', 'Le montant minimum de commande a partir duquel le coupon deviens valide');
+define('COUPON_USES_COUPON_HELP', 'Le nombre maximum de fois que le coupon peut etre utilis&eacute;, laisser vide si on ne veut pas de limite.');
+define('COUPON_USES_USER_HELP', 'Nombre de fois que le client peut utilis&eacute; ce coupon, laisser vide si on ne veut pas de limite.');
+define('COUPON_PRODUCTS_HELP', 'Liste des identifiants de produits (s&eacute;par&eacute; par une virgule) qui peuvent etre associ&eacute;s au coupon. Laisser vide si on ne veut pas de limite.');
+define('COUPON_CATEGORIES_HELP', 'Liste des \'cpaths\' qui peuvent etre associ&eacute;s au coupon, laisser vide si on ne veut pas de limite.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/create_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: create_account.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Cr&eacute;er un compte');
+define('HEADING_TITLE', 'Ajouter un nouveau client');
+define('HEADING_NEW', 'Commande soumise');
+define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><b>REMARQUE:</b></font></small> Si vous avez d&eacute;j&agrave; un compte chez nous, veuillez vous connecter &agrave; la page d\'<a href="%s"><u>ouverture de session</u></a>.');
+define('TEXT_VISITOR_CART', '<font color="#FF0000"><b> Nous voulons vous donner votre commande le plus vite possible! Nous avons besoin des informations suivantes pour proc&eacute;der &agrave; votre commande efficacement.</b></font>');
+define('TEXT_RETURN_CUSTOMER', '<font color="#FF0000">D&eacute;j&agrave; un compte? Identifiez-vous, SVP!</font>');
+define('NAVBAR_NEW_TITLE', 'Commande soumise');
+define('TEXT_PRIVACY', '<font color="#FF0000"><b>Jamais achet&eacute; chez nous avant ? Commander est facile. Commencer par remplir ce formulaire, et cliquez sur le bouton \'continue\'. </b>');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/create_account_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/create_account_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/create_account_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: create_account_process.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('NAVBAR_TITLE', 'Cr&eacute;er un compte');
+define('HEADING_TITLE', 'Information du compte');
+define('HEADING_NEW', 'Commande soumise');
+define('NAVBAR_NEW_TITLE', 'Commande soumise');
+
+define('EMAIL_SUBJECT', 'Bienvenue sur ' . STORE_NAME);
+define('EMAIL_GREET_MR', 'Cher Mr. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_MS', 'Chere Mme. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_NONE', 'Cher ' . stripslashes($HTTP_POST_VARS['firstname']) . ',' . "\n\n");
+define('EMAIL_WELCOME', 'Nous vous accueillons sur <b>' . STORE_NAME . '</b>.' . "\n\n");
+define('EMAIL_TEXT', 'Vous pouvez maintenant participer aux <b>divers services<b> que nous devons vous offrir. Certains de ces services incluent :' . "\n\n" . '<li><b>Panier permanent</b> - N\'importe quels produits ajout&eacute;s &agrave; votre panier en ligne restent l&agrave; jusqu\'&agrave; ce que vous les supprimiez, ou les consultiez.' . "\n" . '<li><b>Carnet d\'adresses </b> - Nous pouvons maintenant livrer vos produits &agrave; une adresse diff&eacute;rente de la v&ocirc;tre ! C\'est parfait pour envoyer des cadeaux d\'anniversaire adresses &agrave; l\'intention d\'autres personnes.' . "\n" . '<li><b>Historique de commandes</b> - Voir vos historiques d\'achats que vous avez effectu&eacute;s chez nous.' . "\n" . '<li><b>Critiques de produits</b> - Partagez vos avis sur des produits avec nos autres clients.' . "\n\n");
+define('EMAIL_CONTACT', 'Pour obtenir de l\'aide sur n\'importe quel de nos services en ligne, envoyez s\'il vous pla&icirc;t un courrier &eacute;lectronique au propri&eacute;taire du magasin : ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n\n");
+define('EMAIL_WARNING', '<b>REMARQUE :</b> Si cette adresse &eacute;lectronique vous a &eacute;t&eacute; donn&eacute; par un de nos clients. Si vous n\'&ecirc;tes pas un membre, envoyez s\'il vous pla&icirc;t un courrier &eacute;lectronique à ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n");
+define('EMAIL_PASS_1', 'Votre Mot de Passe pour ce compte est le suivant Your password for this account is ');
+define('EMAIL_PASS_2', ', garder le dans un endroit sûr. (Remarque: Attention aux minuscules/majuscules pour le Mot de passe.)');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Cr&eacute;er un comtpe');
+define('NAVBAR_TITLE_2', 'Succ&egrave;s');
+define('HEADING_TITLE', '<font color="#00CC33">Succ&egrave;s:&nbsp;&nbsp;</font>Votre compte a &eacute;t&eacute; cr&eacute;&eacute;!');
+define('BUTTON_TITLE1', 'Vous pouvez maintenant prendre un ordre manuel:');
+define('BUTTON_TITLE2', 'Créez un autre nouveau compte de client:');
+define('BUTTON_TITLE3', 'Sortez au Home Page d'administrateur:');
+
+define('IMAGE_BUTTON_CREATE_ORDER', 'créez l'ordre');
+define('IMAGE_BUTTON_CREATE_CUSTOMER', 'nouveau client');
+define('IMAGE_BUTTON_ADMIN_HOME', 'admininstrator à la maison);
+
+define('TEXT_ACCOUNT_CREATED', '');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/create_order.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/create_order.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/create_order.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,152 @@
+<?php
+/*
+  $Id: create_order.php,v 1.3 2004/09/08 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2004 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+define('HEADING_STEP1', 'Etape 1 - Choisir un client et contr&ocirc;ler ses d&eacute;tails'); 
+
+define('HEADING_STEP2', 'STEP 2 - Choose payment and Shipping Meathods for new order #');
+define('HEADING_INSTRUCT1', '!!! INSTRUCTIONS !!!');
+define('HEADING_INSTRUCT2', 'Note: If you edit the orders product quanities<br>
+              they will not update your stock levels with the<br>
+          changes.  So make sure you update them after this<br>
+          edit section.<br>');
+define('HEADING_STEP3', 'Step 3 ADD A NEW PRODUCT');
+define('HEADING_SHIPPING', 'Shipping Method:');
+
+define('TEXT_ADD_PROD_STEP1', 'STEP 1:');
+define('TEXT_ADD_STEP2', 'STEP 2:');
+define('TEXT_ADD_STEP3', 'STEP 3:');
+define('TEXT_ADD_STEP4', 'STEP 4:');
+
+define('HEADING_CREATE', 'Contr&ocirc;ler les d&eacute;tails du client'); 
+
+define('TEXT_SELECT_CUST', 'S&eacute;lectionner un client:'); 
+define('TEXT_SELECT_CURRENCY', 'Select currency:');
+define('BUTTON_TEXT_SELECT_CUST', 'S&eacute;lectionner ce client'); 
+define('TEXT_OR_BY', 'ou cet ID client:'); 
+define('BUTTON_TEXT_CHOOSE_CUST', 'S&eacute;lectionner cet ID client');
+define('BUTTON_SUBMIT', 'confirm');
+
+define('TEXT_ADD_PROD', 'Add Product ');
+define('TEXT_SELECT_PROD', 'Select this product');
+
+define('TEXT_ADD_CAT_CHOOSE', '--- CHOOSE A CATEGORY ---\n');
+define('TEXT_SELECT_CAT', 'Select this category');
+define('TEXT_ADD_PROD_CHOOSE', 'Add Product ');
+
+define('TEXT_SELECT_OPT', 'Select options');
+define('TEXT_SELECT_OPT_SKIP', 'No options for this product');
+
+define('TEXT_ADD_QUANTITY', ' Quantity');
+define('TEXT_ADD_NOW', 'Add Now!');
+define('TEXT_VIEW_CC', ' To View CC Fields');
+define('TEXT_VIEW_PO', ' or View PO Fields');
+
+define('TEXT_INFO_PO', 'PO Information:');
+define('TEXT_INFO_NAME', 'Account name:');
+define('TEXT_INFO_AC_NR', 'Account number:');
+define('TEXT_INFO_PO_NR', 'Purchase Order Nr:');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Please Select');
+define('TYPE_BELOW', 'Type Below');
+
+define('JS_ERROR', 'Errors have occured during the process of your form!\nPlease make the following corrections:\n\n');
+
+define('JS_GENDER', '* The \'Gender\' value must be chosen.\n');
+define('JS_FIRST_NAME', '* The \'First Name\' entry must have at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_LAST_NAME', '* The \'Last Name\' entry must have at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_DOB', '* The \'Date of Birth\' entry must be in the format: xx/xx/xxxx (month/day/year).\n');
+define('JS_EMAIL_ADDRESS', '* The \'E-Mail Address\' entry must have at least ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_ADDRESS', '* The \'Street Address\' entry must have at least ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_POST_CODE', '* The \'Post Code\' entry must have at least ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.\n');
+define('JS_CITY', '* The \'Suburb\' entry must have at least ' . ENTRY_CITY_MIN_LENGTH . ' characters.\n');
+define('JS_STATE', '* The \'State\' entry must be selected.\n');
+define('JS_STATE_SELECT', '-- Select Above --');
+define('JS_ZONE', '* The \'State\' entry must be selected from the list for this country.\n');
+define('JS_COUNTRY', '* The \'Country\' entry must be selected.\n');
+define('JS_TELEPHONE', '* The \'Telephone Number\' entry must have at least ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.\n');
+define('JS_PASSWORD', '* The \'Password\' and \'Confirmation\' entries must match and have at least ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.\n');
+
+define('CATEGORY_COMPANY', 'Company Details');
+define('CATEGORY_PERSONAL', 'Personal Details');
+define('CATEGORY_ADDRESS', 'Address');
+define('CATEGORY_CONTACT', 'Contact Information');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Password');
+define('CATEGORY_CORRECT', 'If this is the right customer, press the Confirm button below.');
+define('ENTRY_CUSTOMERS_ID', 'ID:');
+define('ENTRY_CUSTOMERS_ID_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COMPANY', 'Company Name:');
+define('ENTRY_NAME', 'Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Gender:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_GENDER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FIRST_NAME', 'First Name:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_FIRST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_LAST_NAME', 'Last Name:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_LAST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_LAST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_DATE_OF_BIRTH', 'Date of Birth:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<small><font color="#FF0000">(eg. 05/21/1970)</font></small>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '&nbsp;<small>(eg. 05/21/1970) <font color="#AABBDD">required</font></small>');
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">Your email address doesn\'t appear to be valid!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<small><font color="#FF0000">email address already exists!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_STREET_ADDRESS', 'Street Address:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_STREET_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Post Code:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_POSTCODE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_POST_CODE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_CITY_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_CITY_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_CITY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_CITY', 'City:');
+define('ENTRY_STATE', 'State/Province:');
+define('ENTRY_STATE_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_STATE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COUNTRY', 'Country:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_TELEPHONE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FAX_NUMBER', 'Fax Number:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Subscribed');
+define('ENTRY_NEWSLETTER_NO', 'Unsubscribed');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_PASSWORD_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_PASSWORD_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_PASSWORD_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+// manual order box text in includes/boxes/manual_order.php
+
+define('BOX_HEADING_MANUAL_ORDER', 'Manual Orders');
+define('BOX_MANUAL_ORDER_CREATE_ACCOUNT', 'Create Account');
+define('BOX_MANUAL_ORDER_CREATE_ORDER', 'Create Order');
+
+define('TITLE_1', 'Step-by-Step Manual Order Entry - Step 1');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/create_order_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/create_order_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/create_order_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: PAYMENT_MODULES.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Create Order Admin');
+
+define('TEXT_CREATE_ORDERS_ADMIN_HELP', 'The two link below will take you to edit screens where you can edit the payment and shipping for the create orders contributions.');
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Create Order Admin');
+define('TEXT_LABEL_CREATE_ORDERS_ADMIN_PAYMENT', 'Edit Payment Methods');
+define('TEXT_LABEL_CREATE_ORDERS_ADMIN_SHIPPING', 'Edit Shipping Methods');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_ORDERS_STATUS_NAME', 'Orders Status:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new paymen meathod with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this payment?');
+define('TEXT_INFO_HEADING_NEW_PAYMENT', 'New Payment');
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Edit Payment');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Delete Payment');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'New Shipping');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Edit Shipping');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Delete Shipping');
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: The default order status can not be removed. Please set another order status as default, and try again.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This order status is currently used in orders.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This order status is currently used in the order status history.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/create_order_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/create_order_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/create_order_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: PAYMENT_MODULES.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Create Order Admin');
+
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Create Order Admin');
+define('TABLE_HEADING_CREATE_ORDERS_SORT', 'Sort Order');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> payment modules)');
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_PAYMENT_MODULES_NAME', 'Payment modules:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new paymen meathod with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this payment?');
+define('TEXT_INFO_HEADING_NEW_PAYMENT', 'New Payment');
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Edit Payment');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Delete Payment');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'New Shipping');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Edit Shipping');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Delete Shipping');
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Error: The default payment module can not be removed. Please set another payment module as default, and try again.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This payment module is currently used in orders.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This payment module is currently used in the payment module history.');
+define('TEXT_INFO_SORT_ORDER', 'Sort Order');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/create_order_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/create_order_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/create_order_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: create_order_process.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_CREATE', 'V&eacute;rifier les d&eacute;tails client');
+define('DEFAULT_PAYMENT_METHOD', "Payment on Local Pickup. We accept cash, Interac, Visa and Master Card.");
+define('TEXT_SUBTOTAL', "Subtotal :");
+define('TEXT_DISCOUNT', "Discount :");
+define('TEXT_DELIVERY', "Delivery :");
+define('TEXT_TAX', "Tax :");
+define('TEXT_TOTAL', "Total :");
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/create_order_shipping.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/create_order_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/create_order_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: create_order_shipping.php,v 1.1 2004/08/19 23:38:51 teo Exp $
+  http://www.chainreactionworks.com
+
+  Copyright (c) 2005 chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Create Order Shipping');
+
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Create Order Shipping');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> shipping modules)');
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_SHIPPING_MODULES_NAME', 'Shipping modules:');
+define('TEXT_INFO_INSERT_INTRO', 'Please enter the new shipping method with its related data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this shipping method?');
+define('TEXT_INFO_SORT_ORDER', 'Sort Order');
+
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Edit Payment');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Delete Payment');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'New Shipping');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Edit Shipping');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Delete Shipping');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Error: This shipping module is currently used in orders.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Error: This shipping module is currently used in the shipping module history.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/crypt.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/crypt.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/crypt.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes.');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning: key directory does not exist.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning: key directory is not writeable at : ');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/crypt_convert.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/crypt_convert.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/crypt_convert.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Convert from old key to new key.');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+
+define('TEXT_KEY_CURRENT', 'Current key is: ');
+define('TEXT_CONVRT_ALL', 'Convert all CC data to new key');
+define('TEXT_KEY_NEW', 'New key is: ');
+define('TEXT_KEY_STATUS_01', '<font color=red> <b> This file does not have a key </b></font>');
+define('TEXT_KEY_STATUS_02', '<font color=blue> <b> OK! This file has a key</b></font>');
+define('TEXT_KEY_STATUS_03', '<font color=red> <b> Please edit the key files(s) in the key manager </b></font>');
+
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/crypt_convert_1.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/crypt_convert_1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/crypt_convert_1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Convert CC data to new key');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+define('CC_ENCYPT_ERROR_01', '<font color=blue> <b> Sorry this is already encrypted </b></font>');
+
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/crypt_purge.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/crypt_purge.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/crypt_purge.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Remove cc data from cart');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b>  Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b> Unencrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Encryption Status');
+
+define('TEXT_KEY_CURRENT', 'Current key is: ');
+define('TEXT_CONVRT_ALL', 'Convert all CC data to new key');
+define('TEXT_KEY_NEW', 'New key is: ');
+define('TEXT_KEY_STATUS_01', '<font color=red> <b> This file does not have a key </b></font>');
+define('TEXT_KEY_STATUS_02', '<font color=blue> <b> OK! This file has a key</b></font>');
+define('TEXT_KEY_STATUS_03', '<font color=red> <b> Please edit the key files(s) in the key manager </b></font>');
+
+
+define('TEXT_PURGE_ALL', 'Purge all CC data from cart');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/crypt_update.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/crypt_update.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/crypt_update.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Decrypt/Encrypt: Orders with CC numbers');
+define('HEADING_TITLE_SEARCH', 'Order ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_COMMENTS', 'Comments');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDER_TOTAL', 'Order Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+define('CC_ENCYPT_ERROR_01', '<font color=blue> <b> Sorry this is already encrypted </b></font>');
+define('CC_ENCYPT_ERROR_02', '<font color=blue> <b> Sorry this is already decrypted </b></font>');
+define('TEXT_ENCRPYT_ALL', 'Encrypt all cc numbers');
+define('TEXT_DECRYPT_ALL', 'Decrypt all cc numbers');
+
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/currencies.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: currencies.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Devises');
+
+define('TABLE_HEADING_CURRENCY_NAME', 'Devise');
+define('TABLE_HEADING_CURRENCY_CODES', 'Code');
+define('TABLE_HEADING_CURRENCY_VALUE', 'Valeur');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_INFO_CURRENCY_TITLE', 'Titre :');
+define('TEXT_INFO_CURRENCY_CODE', 'Code:');
+define('TEXT_INFO_CURRENCY_SYMBOL_LEFT', 'Symbole gauche :');
+define('TEXT_INFO_CURRENCY_SYMBOL_RIGHT', 'Symbole droit :');
+define('TEXT_INFO_CURRENCY_DECIMAL_POINT', 'Point d&eacute;cimal :');
+define('TEXT_INFO_CURRENCY_THOUSANDS_POINT', 'S&eacute;parateur de milliers :');
+define('TEXT_INFO_CURRENCY_DECIMAL_PLACES', 'Nombre de d&eacute;cimales :');
+define('TEXT_INFO_CURRENCY_LAST_UPDATED', 'Derni&egrave;re mise &agrave; jour :');
+define('TEXT_INFO_CURRENCY_VALUE', 'Valeur :');
+define('TEXT_INFO_CURRENCY_EXAMPLE', 'Exemple de sortie :');
+define('TEXT_INFO_INSERT_INTRO', 'Merci de rentrer la nouvelle devise avec ces don&eacute;es li&eacute;es');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir supprimer cette devise ?');
+define('TEXT_INFO_HEADING_NEW_CURRENCY', 'Nouvelle devise');
+define('TEXT_INFO_HEADING_EDIT_CURRENCY', 'Editer devise');
+define('TEXT_INFO_HEADING_DELETE_CURRENCY', 'Supprimer devise');
+define('TEXT_INFO_SET_AS_DEFAULT', TEXT_SET_DEFAULT . ' (Requiert une mise &agrave; jour manuelle de la valeur de la devise)');
+define('TEXT_INFO_CURRENCY_UPDATED', 'Le taux de change pour %s (%s) a &eacute;t&eacute; mis &agrave; jour avec succ&egrave;s par l\'interm&eacute;diaire de %s.');
+
+define('ERROR_REMOVE_DEFAULT_CURRENCY', 'Erreur : La devise par d&eacute;faut ne peut être supprim&eacute;e. Merci de choisir une autre devise par d&eacute;faut et de r&eacute;essayer.');
+define('ERROR_CURRENCY_INVALID', 'Erreur : Le taux de change pour %s (%s) n\'a pas &eacute;t&eacute; mis &agrave; jour par l\'interm&eacute;diaire de %s. S\'agit t\'il d\'un code devise valide ?');
+define('WARNING_PRIMARY_SERVER_FAILED', 'Attention : Le serveur de taux de change primaire (%s) a echou&eacute; %s (%s) - essayer avec le serveur de taux de change secondaire.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Clients');
+define('HEADING_TITLE_SEARCH', 'Rechercher :');
+
+define('TABLE_HEADING_FIRSTNAME', 'Pr&eacute;nom');
+define('TABLE_HEADING_LASTNAME', 'Nom');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Compte cr&eacute;&eacute;');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_DATE_ACCOUNT_CREATED', 'Compte cr&eacute;&eacute :');
+define('TEXT_DATE_ACCOUNT_LAST_MODIFIED', 'Derni&egrave;re modification :');
+define('TEXT_INFO_DATE_LAST_LOGON', 'Derni&egrave;re connexion :');
+define('TEXT_INFO_NUMBER_OF_LOGONS', 'Nombre de connexions :');
+define('TEXT_INFO_COUNTRY', 'Pays :');
+define('TEXT_INFO_NUMBER_OF_REVIEWS', 'Nombre de critiques :');
+define('TEXT_DELETE_INTRO', 'Etes vous sur de vouloir supprimer ce client ?');
+define('TEXT_DELETE_REVIEWS', 'Supprimer %s critique(s)');
+define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Supprimer client');
+define('TYPE_BELOW', 'Type ci-dessous');
+define('PLEASE_SELECT', 'Choississez en un');
+
+// Eversun mod for sppc and qty price breaks
+define('TABLE_HEADING_CUSTOMERS_GROUPS', 'Customer&#160;Group');
+define('TABLE_HEADING_REQUEST_AUTHENTICATION', 'RA');
+define('ENTRY_CUSTOMERS_PAYMENT_SET', 'Set payment modules for the customer');
+define('ENTRY_CUSTOMERS_PAYMENT_DEFAULT', 'Use settings from Group or Configuration');
+define('ENTRY_CUSTOMERS_PAYMENT_SET_EXPLAIN', 'If you choose <b><i>Set payment modules for the customer</i></b> but do not check any of the boxes, default settings (Group settings or Configuration) will still be used.');
+define('ENTRY_CUSTOMERS_SHIPPING_SET', 'Set shipping modules for the customer');
+define('ENTRY_CUSTOMERS_SHIPPING_DEFAULT', 'Use settings from Group or Configuration');
+define('ENTRY_CUSTOMERS_SHIPPING_SET_EXPLAIN', 'If you choose <b><i>Set shipping modules for the customer</i></b> but do not check any of the boxes, default settings (Group settings or Configuration) will still be used.');
+define('ENTRY_CUSTOMERS_EMAIL_VALIDATED','Email Validated:');
+define('ENTRY_EMAILVALIDATE_YES', 'Validated (active)');
+define('ENTRY_EMAILVALIDATE_NO', 'Unvalidated (inactive)');
+define('TEXT_EMAIL_VALIDATE_FEATURE','Require E-mail confirmation on account creation is set off.');
+
+define('ALT_IC_UP',' --> A-B-C From Top ');
+define('ALT_IC_DOWN',' --> Z-X-Y From Top ');
+define('ALT_IC_UP_NUM',' --> 1-2-3 From Top ');
+define('ALT_IC_DOWN_NUM',' --> 3-2-1 From Top ');
+define('TABLE_HEADING_CUSTOMERS_NO','No.');
+// Eversun mod end for sppc and qty price breaks
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/customers_groups.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/customers_groups.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/customers_groups.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+   for Separate Pricing Per Customer v4 2005/03/03
+*/
+  
+define('HEADING_TITLE', 'Groups');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('ENTRY_GROUPS_NAME', 'Group&#160;Name:');
+define('ENTRY_GROUP_SHOW_TAX', 'Show&#160;prices&#160;with/without&#160;tax:');
+define('ENTRY_GROUP_SHOW_TAX_YES', 'Show prices with tax');
+define('ENTRY_GROUP_SHOW_TAX_NO', 'Show prices without tax');
+
+define('ENTRY_GROUP_TAX_EXEMPT', 'Tax Exempt:'); 
+define('ENTRY_GROUP_TAX_EXEMPT_YES', 'Yes'); 
+define('ENTRY_GROUP_TAX_EXEMPT_NO', 'No'); 
+
+define('ENTRY_GROUP_PAYMENT_SET', 'Set payment modules for the customer group');
+define('ENTRY_GROUP_PAYMENT_DEFAULT', 'Use settings from Configuration');
+define('ENTRY_PAYMENT_SET_EXPLAIN', 'If you choose <b><i>Set payment modules for the customer group</i></b> but do not check any of the boxes, default settings will still be used.');
+
+define('ENTRY_GROUP_SHIPPING_SET', 'Set shipping modules for the customer group');
+define('ENTRY_GROUP_SHIPPING_DEFAULT', 'Use settings from Configuration');
+define('ENTRY_SHIPPING_SET_EXPLAIN', 'If you choose <b><i>Set shipping modules for the customer group</i></b> but do not check any of the boxes, default settings will still be used.');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this group?');
+define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS_GROUPS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> Customers Groups)');
+define('TEXT_INFO_HEADING_DELETE_GROUP', 'Delete Group');
+
+define('ERROR_CUSTOMERS_GROUP_NAME', 'Please enter a Group Name');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/data.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/data.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/data.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Data Import/Export system');
+
+define('HEADING_TITLE_1', 'Add New Feed Setting');
+define('HEADING_TITLE_2', 'Edit Feed Setting');
+
+define('TABLE_HEADING_FEED_NAME', 'Name of Feed');
+define('TABLE_HEADING_FEED_DISC', 'Data Feed Discription');
+
+
+define('TEXT_FEED_HELP', 'Do each step in order it is list for each feed');
+
+define('TEXT_FEED_HELP_CONFIGURE', '1. Click on the run button to run processes');
+define('TEXT_FEED_HELP_SELECT', '2. Click on the ' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO). ' for more information');
+define('TEXT_FEED_HELP_PREFEED', '3. Configure, Build categories, Pre process, Submit feed');
+define('TEXT_FEED_HELP_RUN', '');
+define('TEXT_FEED_HELP_NOTES', 'Notes: Feeds with * are not installed');
+
+
+
+define('TEXT_FEED_FROOGLE', '<b> Froogle </b>');
+define('TEXT_FEED_YAHOO', '<b>Yahoo</b>');
+define('TEXT_FEED_BIZRATE', '<b>Bizrate</b>');
+define('TEXT_FEED', '<i>Feed:: </i>');
+define('TEXT_CONFIGURE', '<i>Configure: </i>');
+define('TEXT_SET_CATEGORIES', '<i>Set Categories: </i>');
+define('TEXT_FEED_SELECT', '<i>Select Feed: </i>');
+define('TEXT_FEED_PRE_FEED', '<i>Pre Feed Process: </i>');
+define('TEXT_FEED_RUN', '<i>Submit Feed: </i> ');
+
+define('TEXT_FEED_CONFIGURE_HELP1', 'Build or edit unique configuration');
+define('TEXT_SET_CATEGORIES_HELP1', 'You do not need to run this process every time');
+define('TEXT_FEED_PRE_FEED_HELP1', 'Build feed the file');
+define('TEXT_FEED_PRE_EDIT_HELP1', 'Check Feed in text editor');
+define('TEXT_FEED_RUN_HELP1', 'Send feed to froogle');
+
+
+define('TEXT_INFO_FEED_NAME', 'Feed Name: ');
+define('TEXT_INFO_FEED_TYPE', 'Feed Type: ');
+define('TEXT_INFO_FEED_SERVICE', 'Feed service: ');
+define('TEXT_INFO_FEED_STATUS', 'Status: ');
+
+
+define('TEXT_INFO_STATUS_CHANGE', 'Status Change:');
+
+define('TEXT_DISPLAY_NUMBER_OF_DATA', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> data setups)');
+define('IMAGE_NEW_SETTING', 'New feed setting');
+
+define('WELCOME_TO_DATA_EXPORT_IMPORT_SYSTEM', 'Welcome to the Data Export/Import system');
+define('MSG_1', ' Please use the menu box to the left to select your task.<br><br> For in depth help use one of the links below <br><br>');
+define('MSG_2', 'Introduction to Data Export/Import system');
+define('MSG_3', 'Easy Populate:');
+define('MSG_4', 'EP Advance Import');
+define('MSG_5', 'EP Advance Export');
+define('MSG_6', 'EP Basic Import');
+define('MSG_7', 'EP Basic Export');
+define('MSG_8', 'Editing the export file');
+define('MSG_9', 'Data Feeder:');
+define('MSG_10', 'Introduction to data feed');
+define('MSG_11', '7 Steps to your First Froogle Feed');
+define('MSG_12', 'Configure a Feed');
+define('MSG_13', 'Run a Feed');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/data_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/data_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/data_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,82 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Data Admin');
+
+define('HEADING_TITLE_1', 'Add New Feed Setting');
+define('HEADING_TITLE_2', 'Edit Feed Setting');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TABLE_HEADING_FEED_NAME', 'Name of Feed');
+define('TABLE_HEADING_FEED_DISC', 'Data Feed Discription');
+define('TABLE_HEADING_FEED_FILE_TYPE', 'Data Feed File Type');
+define('TABLE_HEADING_FEED_TYPE', 'Feed Type');
+define('TABLE_HEADING_FEED_TYPE_PRODUCT', 'Product Feed Type');
+define('TABLE_HEADING_FEED', '<b>Froogle FTP information</b>');
+define('TABLE_HEADING_FEED_ADVANCE', '<b>Froogle Advance Settings</b>');
+define('TABLE_HEADING_FEED_FEED_SERVICE', 'Feed Service');
+define('TABLE_HEADING_FEED_STATUS', 'Status');
+define('TABLE_HEADING_FEED_FILE', 'File name');
+define('TABLE_HEADING_FEED_IMAGE', 'Image URL');
+define('TABLE_HEADING_FEED_PRODUCT', 'Product URL');
+define('TABLE_HEADING_FEED_FTP_SERVER', 'Froogle FTP Server Name');
+define('TABLE_HEADING_FEED_FTP_USER', 'Froogle FTP User Name');
+define('TABLE_HEADING_FEED_FTP_PASSWORD', 'Froogle FTP Password');
+define('TABLE_HEADING_FEED_FTP_DIRECTORY', 'Froogle FTP Directory');
+define('TABLE_HEADING_FEED_CUR', 'Use store Currency');
+define('TABLE_HEADING_FEED_CUR_USE', 'Other currency');
+define('TABLE_HEADING_FEED_LANG', 'Use store language');
+define('TABLE_HEADING_FEED_LANG_USE', 'Other language');
+define('TABLE_HEADING_FEED_CUR_CON', 'Convert Currency');
+define('TABLE_HEADING_FEED_TAX', 'Tax Class ID');
+
+define('TEXT_TYPE_BASIC', 'Basic');
+define('TEXT_TYPE_ADVANCE', 'Advance');
+define('TEXT_DATA_FEED_NAME', 'Feed Name');
+define('TEXT_TYPE_NONE', 'None');
+define('TEXT_TYPE_PRODUCTS', 'Products');
+define('TEXT_TYPE_BUSINESS', 'Business');
+define('TEXT_FEED_FROOGLE', 'Froogle Feed');
+define('TEXT_FEED_YAHOO', 'Yahoo Feed');
+
+define('TEXT_DATA_ID_ACTIVE', 'Active');
+define('TEXT_DATA_ID_DEACTIVE', 'Inactive');
+define('TEXT_DATA_VISIBLE_DO', 'Check to activate');
+
+define('TEXT_DATA_CUR_USE_FALSE', 'False: Use store default current');
+define('TEXT_DATA_CUR_USE_TRUE', 'True: Use currency listed below');
+
+define('TEXT_DATA_CUR_CONVERT_FALSE', 'False: Do not convert to currency');
+define('TEXT_DATA_CUR_CONVERT_TRUE', 'True: Convert currency');
+define('TEXT_DATA_CUR_LANG_FALSE', 'False: Use store default language');
+define('TEXT_DATA_CUR_LANG_TRUE', 'True: Use language selected below');
+define('TEXT_LANG_EN', 'English');
+define('TEXT_LANG_FR', 'French');
+define('TEXT_LANG_DE', 'German');
+define('TEXT_LANG_IT', 'Italian');
+define('TEXT_LANG_ES', 'Spanish');
+define('TEXT_LANG_JA', 'Jananese');
+
+define('TEXT_INFO_FEED_NAME', 'Feed Name: ');
+define('TEXT_INFO_FEED_TYPE', 'Feed Type: ');
+define('TEXT_INFO_FEED_SERVICE', 'Feed service: ');
+define('TEXT_INFO_FEED_STATUS', 'Status: ');
+
+
+define('TEXT_INFO_STATUS_CHANGE', 'Status Change:');
+
+define('TEXT_INFO_HEADING_DELETE_DATA', 'Delete Data');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this data setup?');
+
+define('TEXT_DISPLAY_NUMBER_OF_DATA', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> data setups)');
+define('IMAGE_NEW_SETTING', 'New feed setting');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/define_language.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/define_language.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/define_language.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: define_language.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'D&eacute;finissez une langue');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'Le fichier n\'existe pas.');
+
+define('ERROR_FILE_NOT_WRITEABLE', 'Erreur : Impossible d\'&eacute;crire dans le fichier. Merci de v&eacute;rifier les droits d\'acc&egrave;s sur : %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/define_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/define_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/define_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: define_language.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Main Page');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'File does not exist.');
+
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/document.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/document.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/document.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Documentation and help');
+
+define('HEADING_TITLE_1', 'Add New Feed Setting');
+
+define('TABLE_HEADING_FEED_NAME', 'Name of Feed');
+
+define('BOX_DOC_LANGUAGE_EDIT', 'Language editor');
+define('BOX_DOC_DATA', 'Data input/output');
+define('BOX_DOC_ADMIN', 'Admin');
+define('BOX_DOC_CAT', 'Catalog');
+define('BOX_DOC_MISC', 'Miscellaneous');
+
+
+define('HEADING_TITLE_01', 'Help: Introduction ');
+define('HEADING_TITLE_02', 'Help: Admin ');
+define('HEADING_TITLE_03', 'Help: Catalog ');
+define('HEADING_TITLE_04', 'Help: Miscellaneous');
+
+define('MENU_ITEM_01', 'Introduction');
+define('MENU_ITEM_02', 'Help: Admin');
+define('MENU_ITEM_03', 'Help: Catalog');
+define('MENU_ITEM_04', 'Help: Miscellaneous');
+
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/easypopulate.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/easypopulate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/easypopulate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: easypopulate.php,v 1.4 2004/09/21  zip1 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Configuration Easy Populate');
+define('EASY_VERSION_A', 'Easy Populate Advanced ');
+define('EASY_VERSION_B', 'Easy Populate Basic ');
+define('EASY_EXPORT', ' Export');
+define('EASY_IMPORT', ' Import');
+define('EASY_VER_A', ' 3.01');
+define('EASY_VER_B', ' 3.01');
+define('EASY_DEFAULT_LANGUAGE',' - Langue par d&eacute;faut: ');
+define('EASY_UPLOAD_FILE', 'Fichier uploader. ');
+define('EASY_UPLOAD_TEMP', 'Nom Temmporaire: ');
+define('EASY_UPLOAD_USER_FILE', 'Fichier Utilisateur: ');
+define('EASY_SIZE', 'Taille: ');
+define('EASY_FILENAME', 'Nom Fichier: ');
+define('EASY_SPLIT_DOWN', 'Vous pouvez t&eacute;l&eacute;charger vos dossiers partag&eacute;s dans les Outils/Fichiers dans /catalog/temp/');
+define('EASY_UPLOAD_EP_FILE', 'Envoyer fichier EP pour l\'import');
+define('EASY_SPLIT_EP_FILE', 'Upload and Split a EP File');
+define('EASY_SPLIT_EP_LOCAL', 'Split a EP File on the server');
+
+define('TEXT_IMPORT_TEMP', 'Importer les donn&eacute;es du fichier vers %s');
+define('TEXT_INSERT_INTO_DB', 'Inserer dans DB');
+define('TEXT_SELECT_ONE', 'Choisir un fichier EP pour l\'import');
+define('TEXT_SELECT_TWO', 'Select a EP File for Splitting');
+
+define('TEXT_SPLIT_FILE', 'Choisir un fichier EP');
+define('TEXT_SPLIT', 'Split a EP File');
+
+define('EASY_LABEL_CREATE', 'Cr&eacute;er un fichier d\'exportation');
+define('EASY_LABEL_CREATE_SELECT', 'Choisir une m&eacute;thode de sauvegarde pour l\'exportation du fichier');
+define('EASY_LABEL_CREATE_SAVE', 'Sauvegarder un fichier temporaire sur le serveur');
+define('EASY_LABEL_SELECT_DOWN', 'Choisir la m&eacute;thode de t&eacute;l&eacute;chargement');
+define('EASY_LABEL_SORT', 'Choisir la m&eacute;thode pour le classement');
+define('EASY_LABEL_PRODUCT_RANGE', 'Limite par ID Produit');
+define('EASY_LABEL_LIMIT_CAT', 'Limite par cat&eacute;gorie');
+define('EASY_LABEL_LIMIT_MAN', 'Limite par constructeur');
+
+define('EASY_LABEL_PRODUCT_AVAIL', 'Champs disponibles: ');
+define('EASY_LABEL_PRODUCT_TO', ' à ');
+define('EASY_LABEL_PRODUCT_RECORDS', '    Nombre total d\'enregistrements: ');
+define('EASY_LABEL_PRODUCT_BEGIN', 'd&eacute;but: ');
+define('EASY_LABEL_PRODUCT_END', 'fin: ');
+define('EASY_LABEL_PRODUCT_START', 'D&eacute;marrer creation fichier ');
+
+define('EASY_FILE_LOCATE', 'Vous pouvez obtenir votre fichier dans le Outils/Fichiers');
+define('EASY_FILE_LOCATE2', ' en cliquant sur ce lien et en allant au gestionnaire');
+
+define('EASY_FILE_LOCATE_2', ' by clicking this Link and going to the file manager');
+define('EASY_FILE_RETURN', ' Vous pouvez retorner à EP en cliquant ce lien.');
+define('EASY_IMPORT_TEMP_DIR', 'Importer du r&eacute;pertoire Temp ');
+define('EASY_LABEL_DOWNLOAD', 'T&eacute;l&eacute;chargement');
+define('EASY_LABEL_COMPLETE', 'Complet');
+define('EASY_LABEL_TAB', 'tab-delimited .txt file to edit');
+define('EASY_LABEL_MPQ', 'Mod&egrave;le/Prix/Qt&eacute;');
+define('EASY_LABEL_EP_MC', 'Mod&egrave;le/Cat&eacute;gorie');
+
+define('EASY_LABEL_EP_ATTRIB', 'Attributs');
+define('EASY_LABEL_NONE', 'Non');
+define('EASY_LABEL_CATEGORY', 'Nom 1&egrave;re cat&eacute;gorie');
+define('PULL_DOWN_MANUFACTURES', 'Manufacturers');
+define('EASY_LABEL_PRODUCT', 'Num&eacute;ro ID produit');
+define('EASY_LABEL_MANUFACTURE', 'Num&eacute;ro ID constructeur');
+define('EASY_LABEL_EP_MA', 'Mod&egrave;le/Attributs');
+define('EASY_LABEL_EP_FR_TITLE', 'Cr&eacute;er un fichier EP ou Froogle dans r&eacute;pertoire Temp ');
+define('EASY_LABEL_EP_DOWN_TAB', 'Cr&eacute;ation <b>Compl&egrave;te</b> du fichier tab-delimited .txt dans r&eacute;pertoire temp');
+define('EASY_LABEL_EP_DOWN_MPQ', 'Cr&eacute;er fichier <b>Mod&egrave;l/Prix/Qty</b> tab-delimited .txt dans r&eacute;pertoire temp');
+define('EASY_LABEL_EP_DOWN_MC', 'Cr&eacute;er fichier <b>Mod&egrave;le/Cat&eacute;gorie</b> tab-delimited .txt dans r&eacute;pertoire temp');
+define('EASY_LABEL_EP_DOWN_MA', 'Cr&eacute;er fichier <b>Mod&egrave;le/Attributs</b> tab-delimited .txt dans r&eacute;pertoire temp');
+define('EASY_LABEL_EP_LIMIT', 'Limit number of products to Export');
+define('EASY_LABEL_NEW_PRODUCT', "<font color='green'> !Nouveau produit! </font><br>");
+define('EASY_LABEL_UPDATED', "<font color='blue'> Mis à jour</font><br>");
+define('EASY_LABEL_DELETE_STATUS_1', "<font color='red'> Effacer Produit ");
+define('EASY_LABEL_DELETE_STATUS_2', " de la BDD</font><br>");
+define('EASY_LABEL_LINE_COUNT_1', 'ajout&eacute; ');
+define('EASY_LABEL_LINE_COUNT_2', 'enregistrement et fermeture fichier... ');
+define('EASY_LABEL_FILE_COUNT_1A', 'Creating file EPA_Split ');
+define('EASY_LABEL_FILE_COUNT_1B', 'Creating file EPB_Split ');
+define('EASY_LABEL_FILE_COUNT_2', '.txt ...  ');
+define('EASY_LABEL_FILE_CLOSE_1', 'Ajout&eacute; ');
+define('EASY_LABEL_FILE_CLOSE_2', ' enregistrement et fermeture fichier...');
+define('EASY_LABEL_FILE_INSERT_LOCAL', 'Inserting local file: ');
+define('TEXT_INFO_TIMER', 'Script timer:');
+define('TEXT_INFO_SECOND', 'seconds.');
+
+//errormessages
+define('EASY_ERROR_1', 'Étrange mais il n\'y a aucune langue par d&eacute;faut ... Cela pourrait ne pas se produire, juste au cas où... ');
+define('EASY_ERROR_2', '... ERREUR! - Trop de caract&egrave;res dans le num&eacute;ro mod&egrave;le.<br>
+      12 est le maximun dans l\'installation d\'oscommerce.<br>
+      Votre longueur maximum de product_model est ');
+define('EASY_ERROR_2A', ' <br>Vous pouvez raccourcir vos num&eacute;ros de type ou augmenter la taille du champ dans la base de donn&eacute;es.</font>');
+define('EASY_ERROR_2B',  "<font color='red'>");
+define('EASY_ERROR_3', '<p class=smallText>Aucun champ de products_id. Cette ligne n\'a pas &eacute;t&eacute; import&eacute;e <br><br>');
+define('EASY_ERROR_4', '<font color=red>ERREUR - le v_customer_group_id et le v_customer_price fonctionnent par paire</font>');
+define('EASY_ERROR_5', '</b><font color=red>Error 05 - You are trying to use a file created with EP Advanced, please try with Easy Populate Advanced </font>');
+define('EASY_ERROR_5a', '<font color=red><b><u>  Click here to return to Easy Populate Basic </u></b></font>');
+define('EASY_ERROR_6', '</b><font color=red>Error 06 - You are trying to use a file created with EP Basic, please try with Easy Populate Basic </font>');
+define('EASY_ERROR_6a', '<font color=red><b><u>  Click here to return to Easy Populate Advanced </u></b></font>');
+define('EASY_ERROR_7', '<p class=smallText> Error 07 - No Module field in record or it is the last line in the file. This line was not imported. <br><br>');
+
+// Eversun mod for Easy Populate Products Options, Values and Attributes
+define('EASY_VERSION_C', 'Easy Populate Options');
+define('EASY_LABEL_OPTIONS_ID', 'Options ID');
+define('EASY_LABEL_OPTIONS_NAME', 'Options Name');
+define('EASY_VERSION_D', 'Easy Populate Values');
+define('EASY_LABEL_VALUES_ID', 'Values ID');
+define('EASY_LABEL_VALUES_NAME', 'Values Name');
+define('EASY_VERSION_E', 'Easy Populate Attributes');
+define('TEXT_SELECT_ONE_OPTIONS', 'Select a EP Option File for Import');
+define('TEXT_SELECT_ONE_VALUES', 'Select a EP Values File for Import');
+define('TEXT_SELECT_ONE_ATTRIBUTES', 'Select a EP Attributes File for Import');
+define('EASY_ERROR_8', '<b><font color=red>Error - You didn\'t select any file</font></b>');
+define('EASY_INFO_SUCCESS', '<b><font color=red>Import Success</font></b>');
+define('EASY_INFO_FILE_NOT_FOUND', '<b><font color=red>File not Found</font></b>');
+define('EASY_INFO_CHECK_ERROR1', '<b><font color=red>Field %s not in the table %s.</font></b>');
+// Eversun mod end for Easy Populate Products Options, Values and Attributes
+
+
+
+/*******************************/
+define('ERROR_CANT_PROCESSED_ON_LINE', "Can\'t processed on line ");
+define('ERROR_DOESNT_HAVE_THIS_OPTIONS_ID', "doesn\'t have this options_id: ");
+define('ERROR_DOESNT_HAVE_THIS_PRODUCTS_ID_1', "doesn\'t have this products_id: ");
+define('ERROR_DOESNT_HAVE_THIS_PRODUCTS_ID_2', " or model: ");
+define('ERROR_DOESNT_HAVE_THIS_VALUES_ID_1', "doesn\'t have values_id: ");
+define('ERROR_DOESNT_HAVE_THIS_VALUES_ID_2', " for  options_id: ");
+
+define('MSG_READ_RECORDS', "Read records: ");
+define('MSG_RECORDS_WILL_BE_UPDATED', " records will be updated");
+define('MSG_RECORDS_WILL_BE_INSERTED', " records will be inserted");
+define('MSG_RECORDS_WILL_BE_DELETED', " records will be deleted");
+define('MSG_ERROR_RECORDS_WONT_BE_PROCESSED', " records won\'t be processed, because of below reasons:");
+
+define('ERROR_OPTIONS_TYPE_CHANGE_ERROR_1', " options type change error, you can\'t change option type from");
+define('ERROR_OPTIONS_TYPE_CHANGE_ERROR_2', 'to');
+
+/*******************************/
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/edit_key.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/edit_key.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/edit_key.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define ('HEADING_TITLE', 'Manage Key Files');
+define ('HELP_URL', DIR_WS_ADMIN . 'et_help/index.html');
+
+define('BUTTON_TEXT_SAVE_CHANGES', 'Save Changes');
+define('BUTTON_TEXT_RESTORE_FILE', 'Restore File');
+define('BUTTON_TEXT_RETURN_MAIN_EDIT', 'Return to Configuration');
+define('TEXT_RETURN_MAIN', 'Return to main file list');
+
+define('ERROR_TEXT_FILE_LOCKED', "ERROR: File '%s' is not writable");
+define('ERROR_TEXT_FILE_LOCKED1', "ERROR: The Key file: %s is not writable, to Edit the key you must change it's permissions to 777");
+
+define('ERROR_TEXT_FILE_OK', "Ok to edit the key file: %s it is writable");
+
+
+define('TEXT_HIDE_NAVIGATION', 'Hide Navigation');
+define('TEXT_SHOW_NAVIGATION', 'Show Navigation');
+
+define('TEXT_HELP_HELP', 'Quick Help');
+define('TEXT_HELP_HELP1', '1. Click on edit button to edit.');
+define('TEXT_HELP_HELP2', '2. When finished editing, Click on save.');
+define('TEXT_HELP_HELP3', '3. Onced saved, click on restore to revert back to orginal file.');
+define('TEXT_HELP_HELP4', '4. Click on create button to create new key file.');
+define('TEXT_HELP_HELP5', '5. Click on return button to return to main Manage Key screen.');
+
+define('TEXT_CRYPT_MESSAGE_1', 'Primary key file');
+define('TEXT_CRYPT_MESSAGE_2', 'New key file');
+define('TEXT_CRYPT_MESSAGE_3', 'Unkown');
+
+define('TABLE_HEADING_FILE_TYPE', 'File type');
+define('TABLE_HEADING_FILE_NAME', 'File name');
+define('TABLE_HEADING_FILE_ACTION', 'Action');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/edit_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/edit_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/edit_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,152 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.25 2003/08/07 00:28:44 jwh Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Edition Commande');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'ID Commande:');
+define('HEADING_TITLE_STATUS', 'Statut:');
+define('ADDING_TITLE', 'Ajout d\'un produit à la commande');
+
+define('ADD_PRODUCT', 'Add a Product to Order');
+define('HEADING_ABANDONED', '<B>This order was not completed and abandoned!!! Order ID:  </B>');
+
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Commentaires');
+define('TABLE_HEADING_CUSTOMERS', 'Clients');
+define('TABLE_HEADING_ORDER_TOTAL', 'Total Commande');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date d\'achat');
+define('TABLE_HEADING_STATUS', 'Statut');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_QUANTITY', 'Qt&eacute;.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Mod&egrave;le');
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_TAX', 'Taxe');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_UNIT_PRICE', 'Prix unitaire');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Prix total');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Client notifi&eacute;');
+define('TABLE_HEADING_DATE_ADDED', 'Date d\'ajout');
+
+define('ENTRY_CUSTOMER', 'Client:');
+define('ENTRY_CUSTOMER_NAME', 'Nom');
+define('ENTRY_CUSTOMER_COMPANY', 'Soci&eacute;t&eacute;');
+define('ENTRY_CUSTOMER_ADDRESS', 'Adresse');
+define('ENTRY_CUSTOMER_SUBURB', 'Compl&eacute;ment adresse');
+define('ENTRY_CUSTOMER_CITY', 'Ville');
+define('ENTRY_CUSTOMER_STATE', 'Etat');
+define('ENTRY_CUSTOMER_POSTCODE', 'Code Postal');
+define('ENTRY_CUSTOMER_COUNTRY', 'Pays');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'VENDU A:');
+define('ENTRY_DELIVERY_TO', 'Livraison &agrave;:');
+define('ENTRY_SHIP_TO', 'LIVRE A:');
+define('ENTRY_SHIPPING_ADDRESS', 'Adresse de livraison:');
+define('ENTRY_BILLING_ADDRESS', 'Adresse de facturation:');
+define('ENTRY_PAYMENT_METHOD', 'M&eacute;thode de paiement:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Type de carte de cr&eacute;dit:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Propri&eacute;taire de la carte de cr&eacute;dit:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Num&eacute;ro de la carte de cr&eacute;dit:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Date d\'expiration de la carte de cr&eacute;dit:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Sous-Total:');
+define('ENTRY_TAX', 'Taxe:');
+define('ENTRY_SHIPPING', 'Exp&eacute;dition:');
+define('ENTRY_TOTAL', 'Total:');
+define('ENTRY_DATE_PURCHASED', 'Date d\'achat:');
+define('ENTRY_STATUS', 'Statut:');
+define('ENTRY_DATE_LAST_UPDATED', 'Derni&egrave;re date de mise &agrave; jour:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Informer client:');
+define('ENTRY_NOTIFY_COMMENTS', 'Ajouter un commentaire:');
+define('ENTRY_PRINTABLE', 'Imprimer la facture');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Use a negative number -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Supprimer la commande');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir supprimer cette commande?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restaurer la valeur de stock');
+define('TEXT_DATE_ORDER_CREATED', 'Date de cr&eacute;ation:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Derni&egrave;re modification:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Ajouter Produit(s).');
+define('TEXT_INFO_PAYMENT_METHOD', 'M&eacute;thode de paiement:');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> This CCV is not store or has been removed from the store.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'Toutes les commandes');
+define('TEXT_NO_ORDER_HISTORY', 'Aucun historique de commande disponible');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Mise à jour de la commande');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Num&eacute;ro de commande : ');
+define('EMAIL_TEXT_INVOICE_URL', 'Facture d&eacute;taill&eacute;e : ');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date de commande : ');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Le statut de votre commande a &eacute;t&eacute; mis à jour comme suit.' . "\n\n" . 'Nouveau statut : %s' . "\n\n" . 'Merci de r&eacute;pondre à ce courrier &eacute;lectronique si vous avez des questions.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'Les commentaires de votre commande sont : ' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Erreur: La commande n\'existe pas.');
+define('SUCCESS_ORDER_UPDATED', 'Succ&egrave;s: Commande mis &agrave; jour avec succ&egrave;s.');
+define('WARNING_ORDER_NOT_UPDATED', 'Attention: Aucune modification n\'a &eacute;t&eacute; effectu&eacute;. La commande n\'a pas &eacute;t&eacute; mis &agrave; jour.');
+define('SUCCESS_PRODUCT_ADDED', 'Success : This order has been updated and a new product has been added');
+
+
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choisir produit');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Chosir options');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Pad d\'options: Passer...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'Qt&eacute;.');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Ajouter maintenant');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+define('DISPLAY_BASKET', 'Choisissez Ces Options');
+define('DONT_ADD_NEW_PRODUCT', 'N\'ajoutez pas Le Nouveau Produit');
+define('SELECT_THESE_OPTIONS', "Choisissez Ces Options");
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/edit_textdata.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/edit_textdata.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/edit_textdata.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define ('HEADING_TITLE', 'Edit Language Defines');
+
+define('BUTTON_TEXT_SAVE_CHANGES', 'Save Changes');
+define('BUTTON_TEXT_RESTORE_FILE', 'Restore File');
+define('BUTTON_TEXT_RETURN_MAIN_EDIT', 'Return to Main Edit');
+define('TEXT_RETURN_MAIN', 'Return to main file list');
+
+define('ERROR_TEXT_FILE_LOCKED', "ERROR: File '%s' is not writable");
+
+define('TEXT_HIDE_NAVIGATION', 'Hide Navigation');
+define('TEXT_SHOW_NAVIGATION', 'Show Navigation');
+
+define('TEXT_HELP_HELP', '<b>Quick Help, when in edit mode</b>');
+define('TEXT_HELP_HELP1', '1. Click on edit button to edit.');
+define('TEXT_HELP_HELP2', '2. When finished editing, Click on save.');
+define('TEXT_HELP_HELP3', '3. Onced saved, click on restore to revert back to orginal file.');
+define('TEXT_HELP_HELP4', '4. Click on insert to add a new define to a language file. (Insert not functional at this time)');
+define('TEXT_HELP_HELP5', '5. Click on return button to return to main Edit Language Define screen.');
+
+define('TEXT_DEFINE_LABEL', '<b>Define label</b>');
+define('TEXT_DEFINE_TEXT', '<b>Define display text</b>');
+define('TEXT_RESTORE_FILE', 'Saved file : ');
+define('TEXT_EDIT_FILE', 'Editing file: ');
+define('TEXT_SAVE_FILE', 'Restored file : ');
+
+define('TABLE_HEADING_FILE_TYPE', 'File type');
+define('TABLE_HEADING_FILE_NAME', 'File name');
+define('TABLE_HEADING_FILE_ACTION', 'Action');
+
+define('TEXT_MIXED_CONSTANT', 'This variable is mixed please use advanced edtor to edit this file %s(to bottom)%s');
+define('TEXT_ADV_EDITOR', 'Full Page Editor - For Advanced Users Only');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/email_subjects.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/email_subjects.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/email_subjects.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: email_subjects.php, v1 07/11/2005
+
+  Copyright (c) 2005 PassionSeed
+  http://PassionSeed.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Email Subjects');
+
+define('TABLE_HEADING_EMAIL_SUBJECTS', 'Contact Us Email Subjects');
+define('TABLE_HEADING_EMAIL_SUBJECTS_CATEGORY', 'Subject Category');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_HEADING_NEW_EMAIL_SUBJECT', 'New Email Subject');
+define('TEXT_HEADING_EDIT_EMAIL_SUBJECT', 'Edit Email Subject');
+define('TEXT_HEADING_DELETE_EMAIL_SUBJECT', 'Delete Email Subject');
+
+define('TEXT_EMAIL_SUBJECTS', 'Email Subjects:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+
+define('TEXT_NEW_INTRO', 'Please fill out the following information for the new email subject');
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+
+define('TEXT_EMAIL_SUBJECTS_NAME', 'Email Subject Name:');
+define('TEXT_EMAIL_SUBJECTS_CATEGORY', 'Email Subject Category:');
+define('TEXT_EMAIL_SUBJECTS_CATEGORY_CHOICE', '1 = Admin; 2 = Customer');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this email subject?');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/events_calendar.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/events_calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/events_calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: events_calendar v1.00 2003/03/08 18:09:16 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+
+  define('NAVBAR_TITLE', 'Events Calendar');
+  define('HEADING_TITLE', 'Events Calendar');
+  define('TEXT_SELECT_EVENT', 'Select event');
+  
+  define('TEXT_EVENTS_FOR', 'Events for ');
+  define('TEXT_EVENT_DATE', 'Date :');
+  define('TEXT_EVENTS_START', 'Events starting on ');
+  define('TEXT_EVENT_START_DATE', 'From :');
+  define('TEXT_EVENT_END_DATE', 'Through :');
+  define('TEXT_EVENT_LINK', 'Link :');
+  define('TEXT_EVENT_OSC_LINK', 'OSC link :');
+  define('TEXT_EVENT_TITLE', 'Title :');
+  define('TEXT_EVENT_DESCRIPTION', 'Event :');
+  define('TEXT_EVENT_MORE', '... More >>');
+  define('TEXT_NO_EVENTS', 'No Events found.');
+  define('TEXT_OTHER_EVENTS', 'Other events for today :');
+
+  define('TEXT_DISPLAY_NUMBER_OF_EVENTS', 'Displaying event n° <b>%d</b><b>%_</b> of <b>%d</b> for ');
+  define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> events) ');
+  define('MAX_DISPLAY_PAGE_LINKS', 5);
+  define('MAX_DISPLAY_NUMBER_EVENTS', 5);
+  
+  define('BOX_CALENDAR_TITLE', ' View all events');
+  define('BOX_GO_BUTTON', 'go');
+  define('BOX_GO_BUTTON_TITLE', ' submit - month view ');
+  define('BOX_TODAY_BUTTON', ' T ');
+  define('BOX_TODAY_BUTTON_TITLE', ' view this month ');
+  define('BOX_YEAR_VIEW_BUTTON', ' Y ');
+  define('BOX_YEAR_VIEW_BUTTON_TITLE', ' year view ');
+  define('BOX_NEXT_LINK', 'next_month');
+  define('BOX_PREV_LINK', 'previous_month');
+  define('BOX_CLICK_LINK', 'Click for events');
+  
+  define('FIRST_DAY_OF_WEEK', 0);// First day of the week  1=Monday 0=Sunday;
+
+  define('NUMBER_OF_YEARS', 5);  //n° of years to be shown in drop-down
+  
+  define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
+  
+
+  
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/events_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/events_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/events_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/*
+  $Id: events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Events Manager');
+define('DELETE_EVENTS_ERROR', 'Please select a date.');
+define('EVENTS_ERROR', 'Form error.\n\n');
+
+define('TABLE_HEADING_ID', 'Event ID');
+define('TABLE_HEADING_SIZE', 'Size');
+define('TABLE_HEADING_TITLE', 'Title');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+define('TABLE_HEADING_DATE_START', 'Sart Date');
+define('TABLE_HEADING_DATE_END', 'End Date');
+define('TABLE_HEADING_LINKS', 'Link / OSClink');
+define('TABLE_HEADING_OSC_LINK', 'OSC Link');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TEXT_NO_EVENTS', 'No events found.');
+
+define('TEXT_EVENT_TITLE', 'Title:');
+define('TEXT_EVENT_DESCRIPTION', 'Event:');
+
+define('TEXT_EVENT_ID', 'Event ID:');
+define('TEXT_EVENT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EVENT_START', 'Start Date:');
+define('TEXT_EVENT_END', 'End Date:');
+define('TEXT_CHOOSE_MANUFACTURER', 'Manufacturer:');
+define('TEXT_CHOOSE_CATEGORY', 'Category:');
+define('TEXT_CHOOSE_PRODUCT', 'Product:');
+define('TEXT_NO_PRODUCTS', 'No Products');
+define('TEXT_CHOOSE_UPCOMING', 'Upcoming products:');
+define('TEXT_NO_UPCOMING_PRODUCTS', 'No upcoming products:');
+
+define('TEXT_EVENT_OSC_LINK', 'OSC Link:');
+define('TEXT_EVENT_OSC_LINK_HELP', '( link to a specific Manufacturer / Category / Product or Upcoming product )');
+define('TEXT_CURRENT_OSC_LINK', 'Current OSC link: ');
+define('TEXT_START_DATE_NOTE', 'Upcoming products note: <b>Start Date</b> field will be set to "products_date_available".');
+define('TEXT_EVENT_LINK', 'Link:');
+define('TEXT_EVENT_LINK_HELP', 'Additional link, eg.: www.mysite.com/event_page.html (no http://)');
+define('TEXT_EVENT_IMAGE', 'Image:');
+define('TEXT_EVENT_NO_IMAGE', 'No Image:');
+
+define('TEXT_EVENT_PREVIEW', 'Preview:');
+
+define('TEXT_EVENT_DELETE_CONFIRM', 'Sure you want to delete event <a href="'. FILENAME_EVENTS_MANAGER .'?eID='. $eID .'&action=edit"><font color="red"><b>'. $eID .'</b></font></a> ?');
+define('TEXT_DELETE_EVENTS', 'Delete all events before:');
+define('TEXT_EVENTS_DELETE_CONFIRM', 'Sure you want to delete all events before <b>'. $before .'</b> ?');
+
+
+define('TEXT_INFO_DELETE_EVENT_INTRO', 'Are you sure you want to delete this event?');
+
+define('ERROR_EVENT_TITLE', 'Error: Event Title required');
+define('ERROR_EVENT_START_DATE', 'Error: Event Start Date required');
+
+
+define('ERROR_REQUIRED_FIELDS', ' * required');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/faq.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+  define('FAQ_ACTION', 'Action');
+  define('FAQ_ACTIVATION_ID', 'Activate? FAQ ID=');
+  define('FAQ_ACTIVATED_ID', 'Activated FAQ ID=');
+  define('FAQ_ADD', 'New FAQ');
+  define('FAQ_ADD_QUEUE', 'FAQ to queue');
+  define('FAQ_ALERT', 'Empty FAQ system');
+  define('FAQ_ANSWER', 'Answer');
+  define('FAQ_CREATED', 'Created');
+  define('FAQ_DATE', 'Date');
+  define('FAQ_DEACTIVATION_ID', 'Deactivate? FAQ ID=');
+  define('FAQ_DEACTIVATED_ID', 'Deactivated FAQ ID=');
+  define('FAQ_DELETE_CONFITMATION_ID', 'Delete Confirmation FAQ ID=');
+  define('FAQ_DELETE_ID', 'Delete FAQ ID=');
+  define('FAQ_DELETED_ID', 'Deleted FAQ ID=');
+  define('FAQ_EDIT_ID', 'Edit FAQ ID=');
+  define('FAQ_ERROR_20', 'You have not defined a valid value for option <b>Queue</b>. You can only define a numeric value');
+  define('FAQ_ERROR_80', 'You did not fill all <b>necessary fields</b>');
+  define('FAQ_ID', 'ID');
+  define('FAQ_ID_ACTIVE', 'this FAQ is Active'); 
+  define('FAQ_ID_DEACTIVE', 'this FAQ is NOT active'); 
+  define('FAQ_LANGUAGE', 'Language');
+  define('FAQ_MANAGER', 'FAQ Manager');
+  define('FAQ_NUMBER', 'No.');
+  define('FAQ_QUESTION', 'Question');
+  define('FAQ_QUEUE', 'Queue');
+  define('FAQ_QUEUE_LIST', 'QueueList: ');
+  define('FAQ_SORT_BY', 'In FAQ Page this Sort by');
+  define('FAQ_STATUS', 'Status');
+  define('FAQ_SYSTEM', 'FAQ System');
+  define('FAQ_UPDATED_ID', 'Updated FAQ ID=');
+  define('FAQ_VIEW', 'FAQ View');
+  define('FAQ_VIEW_ALL', 'FAQ View All');
+  define('FAQ_VISIBLE', 'Visible');
+  define('FAQ_WARNING', 'Warning');
+
+  define('ENTRY_CATEGORY', 'Category:');
+  define('TEXT_NO_CATEGORY', 'No Category');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/faq_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/faq_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/faq_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: faq_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'FAQ Categories');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_FAQ_HEADING_NEW_FAQ_CATEGORY', 'New Category');
+define('TEXT_FAQ_HEADING_EDIT_FAQ_CATEGORY', 'Edit Category');
+define('TEXT_FAQ_HEADING_DELETE_FAQ_CATEGORY', 'Delete Category');
+
+define('TEXT_FAQ_CATEGORY_COUNT', 'FAQs:');
+define('TEXT_FAQ_CATEGORY_STATUS', 'Status:');
+define('TEXT_FAQ_CATEGORY_DESCRIPTION', 'Description:');
+define('TEXT_FAQ_CATEGORY_SORT_ORDER', 'Sort Order:');
+define('TEXT_DATE_FAQ_CATEGORY_CREATED', 'Created:');
+define('TEXT_DATE_FAQ_CATEGORY_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_NEW_FAQ_CATEGORIES_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_EDIT_FAQ_CATEGORIES_INTRO', 'Please make any necessary changes');
+define('TEXT_DELETE_FAQ_CATEGORIES_INTRO', 'Are you sure you want to delete this category?');
+
+define('TEXT_FAQ_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_FAQ_CATEGORIES_DESCRIPTION', 'Category Description:');
+define('TEXT_FAQ_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_FAQ_CATEGORIES_SORT_ORDER', 'Sort Order:');
+define('TEXT_FAQ_CATEGORIES_STATUS', 'Status:');
+define('TEXT_FAQ_CATEGORIES_STATUS_ENABLE', 'Enable');
+define('TEXT_FAQ_CATEGORIES_STATUS_DISABLE', 'Disable');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>WARNING:</b> There are %s FAQs still linked to this category!');
+
+define('TEXT_DISPLAY_NUMBER_OF_FAQ_CATEGORIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> categories)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/feature_not_present.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/feature_not_present.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/feature_not_present.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Feature Not Present');
+define('IMAGE_UPGRADE', 'Upgrade Now');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/featured.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Produits phares');
+
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_STATUS', 'Etat');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_FEATURED_PRODUCT', 'Produit:');
+define('TEXT_FEATURED_EXPIRES_DATE', 'Date expiration:');
+
+define('TEXT_INFO_DATE_ADDED', 'Date d\'ajout:');
+define('TEXT_INFO_LAST_MODIFIED', 'Modifi&eacute;e le:');
+define('TEXT_INFO_EXPIRES_DATE', 'Expire le:');
+define('TEXT_INFO_STATUS_CHANGE', 'Changement &eacute;tat:');
+
+define('TEXT_INFO_HEADING_DELETE_FEATURED', 'Suppression de Produits Phares');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sûr de vouloir supprimer ce produit phare?');
+
+define('TEXT_DISPLAY_NUMBER_OF_FEATURED', 'Affichage <b>%d</b> à <b>%d</b> (sur <b>%d</b> produits phares)');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/file_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/file_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/file_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: file_manager.php,v 1.2 2003/09/24 13:57:08 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gestionnaire de fichiers');
+
+define('TABLE_HEADING_FILENAME', 'Nom');
+define('TABLE_HEADING_SIZE', 'Taille');
+define('TABLE_HEADING_PERMISSIONS', 'Permissions');
+define('TABLE_HEADING_USER', 'Utilisateur');
+define('TABLE_HEADING_GROUP', 'Groupe');
+define('TABLE_HEADING_LAST_MODIFIED', 'Derni&egrave;re modification');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_UPLOAD', 'Transf&eacute;rer');
+define('TEXT_FILE_NAME', 'Nom de fichier :');
+define('TEXT_FILE_SIZE', 'Taille :');
+define('TEXT_FILE_CONTENTS', 'Contenus :');
+define('TEXT_LAST_MODIFIED', 'Derni&egrave;re modification :');
+define('TEXT_NEW_FOLDER', 'Nouveau dossier');
+define('TEXT_NEW_FOLDER_INTRO', 'Entrez le nom du nouveau dossier :');
+define('TEXT_DELETE_INTRO', 'Etes vous sur de vouloir supprimer ce fichier ?');
+define('TEXT_UPLOAD_INTRO', 'Merci de s&eacute;lectionner les fichiers &agrave; transf&eacute;rer.');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Impossible d\'&eacute;crire dans ce r&eacute;pertoire. Merci de v&eacute;rifier les droits d\'acc&egrave;s sur: %s');define('ERROR_FILE_NOT_WRITEABLE', 'Erreur : Impossible d\'&eacute;crire dans ce fichier. Merci de v&eacute;rifier les droits d\'acc&egrave;s sur : %s');
+define('ERROR_FILE_NOT_WRITEABLE', 'Impossible d\'&eacute;crire dans ce fichier. Merci de v&eacute;rifier les droits d\'acc&egrave;s sur: %s');
+define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Erreur : Impossible de supprimer ce r&eacute;pertoire. Merci de v&eacute;rifier les droits d\'acc&egrave;s sur : %s');
+define('ERROR_FILE_NOT_REMOVEABLE', 'Erreur : Impossible de supprimer ce fichier. Merci de v&eacute;rifier les droits d\'acc&egrave;s sur : %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Erreur : Le r&eacute;pertoire n\'existe pas : %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/forbiden.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/forbiden.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/forbiden.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'L\'acc&egrave;s a &eacute;chou&eacute;');
+define('NAVBAR_TITLE', 'Aucun acc&egrave;s n\'est valide !');
+define('TEXT_MAIN', '&nbsp;Veuillez entrer en contact avec <b>l\'administrateur du site</b> en cas de probl&egrave;me d\'acc&egrave;s<br>');
+define('TEXT_BACK', 'Retour');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/froogle.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/froogle.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/froogle.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Froogle Data Feed');
+
+define('TEXT_INFO_COMPLETED', 'Building feed files completed: ');
+
+define('TEXT_INFO_FTP_ERROR1', 'FTP open connection failed to: ');
+define('TEXT_INFO_FTP_ERROR2', 'FTP connection has failed! ');
+define('TEXT_INFO_FTP_ERROR3', 'Attempted to connect to ');
+define('TEXT_INFO_FTP_ERROR4', 'for user ');
+define('TEXT_INFO_FTP_ERROR5', 'Connected to ');
+define('TEXT_INFO_FTP_ERROR6', 'Current directory is now: ');
+define('TEXT_INFO_FTP_ERROR7', 'Couldn\'t change directory on ');
+define('TEXT_INFO_FTP_ERROR8', ': FTP upload has failed! ');
+define('TEXT_INFO_FTP_ERROR9', "Uploaded " . $ftpsourcefile . " to " . $ftpservername . " as " . $ftpdestinationfile);
+
+define('TEXT_INFO_FTP_SCRITP_TIMER', 'Script timer: <b>%f</b> seconds.');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/froogle_pre.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/froogle_pre.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/froogle_pre.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Froogle Data Feed');
+
+define('TEXT_INFO_COMPLETED', 'Building feed files completed:');
+define('TEXT_INFO_TIMER', 'Script timer:');
+define('TEXT_INFO_SECOND', 'seconds.');
+
+define('TEXT_INFO_DONE', 'Categores built return to data admin');
+
+
+define('TEXT_OUTPUT_1', "product_url \t name \t description \t price \t image_url \t category \t offer_id");
+define('TEXT_OUTPUT_2', "\t instock ");
+define('TEXT_OUTPUT_3', "\t shipping ");
+define('TEXT_OUTPUT_4', "\t brand ");
+define('TEXT_OUTPUT_5', "\t upc ");
+
+define('TEXT_OUTPUT_6', "\t manufacturer_id ");
+define('TEXT_OUTPUT_7', "\t product_type ");
+define('TEXT_OUTPUT_8', "\t currency ");
+define('TEXT_OUTPUT_9', "\t language ");
+
+define('TEXT_OUTPUT_10', "\t ship_to ");
+define('TEXT_OUTPUT_11', "\t ship_from ");
+
+define('TEXT_OUTPUT_12', "Not Supported");
+define('TEXT_OUTPUT_13', "book");
+define('TEXT_OUTPUT_14', "music");
+define('TEXT_OUTPUT_15', "video");
+define('TEXT_OUTPUT_16', "other");
+
+define('TEXT_OUTPUT_17', 'data feed: ');
+define('TEXT_OUTPUT_18', 'File completed: ');
+define('TEXT_OUTPUT_19', 'view output file');
+
+define('TEXT_OUTPUT_20',' Run category build        run feed build    ');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/geo_zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/geo_zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/geo_zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: geo_zones.php,v 1.2 2003/09/24 13:57:08 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Zones fiscales');
+
+define('TABLE_HEADING_COUNTRY', 'Pays');
+define('TABLE_HEADING_COUNTRY_ZONE', 'Zone');
+define('TABLE_HEADING_TAX_ZONES', 'Zones fiscales');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_NEW_ZONE', 'Nouvelle zone');
+define('TEXT_INFO_NEW_ZONE_INTRO', 'Merci de compl&eacute;ter les informations sur la zone');
+
+define('TEXT_INFO_HEADING_EDIT_ZONE', 'Editer zone');
+define('TEXT_INFO_EDIT_ZONE_INTRO', 'Merci d\'effectuer les changements n&eacute;cessaires');
+
+define('TEXT_INFO_HEADING_DELETE_ZONE', 'Supprimer zone');
+define('TEXT_INFO_DELETE_ZONE_INTRO', 'Etes vous sur de vouloir supprimer cette zone ?');
+
+define('TEXT_INFO_HEADING_NEW_SUB_ZONE', 'Nouvelle sous-zone');
+define('TEXT_INFO_NEW_SUB_ZONE_INTRO', 'Merci de compl&eacute;ter les informations sur la sous-zone');
+
+define('TEXT_INFO_HEADING_EDIT_SUB_ZONE', 'Editer sous-zone');
+define('TEXT_INFO_EDIT_SUB_ZONE_INTRO', 'Merci d\'effectuer les changements n&eacute;cessaires');
+
+define('TEXT_INFO_HEADING_DELETE_SUB_ZONE', 'Supprimer sous-zone');
+define('TEXT_INFO_DELETE_SUB_ZONE_INTRO', 'Etes vous sur de vouloir supprimer cette sous-zone ?');
+
+define('TEXT_INFO_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_INFO_LAST_MODIFIED', 'Derni&egrave;re modification :');
+define('TEXT_INFO_ZONE_NAME', 'Nom de la zone :');
+define('TEXT_INFO_NUMBER_ZONES', 'Nombre de zones :');
+define('TEXT_INFO_ZONE_DESCRIPTION', 'Description :');
+define('TEXT_INFO_COUNTRY', 'Pays :');
+define('TEXT_INFO_COUNTRY_ZONE', 'Zone :');
+define('TYPE_BELOW', 'Toutes les zones');
+define('PLEASE_SELECT', 'Toutes les zones');
+define('TEXT_ALL_COUNTRIES', 'Tous les pays');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/gv_mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/gv_mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/gv_mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: gv_mail.php,v 1.2 2003/09/24 13:57:08 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Envoi de ch&egrave;ques cadeaux aux clients');
+
+define('TEXT_CUSTOMER', 'Client :');
+define('TEXT_SUBJECT', 'Sujet :');
+define('TEXT_FROM', 'De :');
+define('TEXT_TO', 'Email unique :');
+define('TEXT_AMOUNT', 'Montant');
+define('TEXT_MESSAGE', 'Message :');
+define('TEXT_SINGLE_EMAIL', '<span class="smallText">Uutiliser ceci pour envoi de mails simples, sinon utiliser le dropdown ci-dessus</span>');
+define('TEXT_SELECT_CUSTOMER', 'S&eacute;lection du client');
+define('TEXT_ALL_CUSTOMERS', 'Tous les clients');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'A tous ceux qui ont souscrit &agrave; la newsletter');
+
+define('NOTICE_EMAIL_SENT_TO', 'Note : Email envoy&eacute; &agrave; : %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Erreur : Aucun client n\'a &eacute;t&eacute; s&eacute;lectionn&eacute;.');
+define('ERROR_NO_AMOUNT_SELECTED', 'Erreur : Aucun montant n\'a &eacute;t&eacute; s&eacute;lectionn&eacute;.');
+
+define('TEXT_TO_REDEEM1', 'Pour &eacute;changer ce ch&egrave;que cadeau, merci de cliquer sur le lien ci dessous. Merci de renseigner aussi le code de remboursement ');
+define('TEXT_GV_WORTH', 'Ch&egrave;que cadeau d\'une valeur de : ');
+define('TEXT_TO_REDEEM', 'To redeem this Gift Voucher, please click on the link below. Please also write down the redemption code');
+define('TEXT_REMEMBER', 'Please do not lose the coupon code, make sure to keep the code safe so you can benefit from this special offer');
+define('TEXT_WHICH_IS', 'qui est ');
+define('TEXT_IN_CASE', ' en cas de probl&egrave;me.');
+define('TEXT_OR_VISIT', 'ou visitez ');
+define('TEXT_ENTER_CODE', ' et entrez le code ');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_HEADER', 'You recently purchased a Gift Voucher from our online store.' . "\n"
+                                          . 'For security reasons this was not made immediately available to you.' . "\n"
+                                          . 'However this amount has now been released. You can now visit our store' . "\n"
+                                          . 'and send the value via Email to someone.' . "\n\n");
+define ('TEXT_REDEEM_COUPON_MESSAGE_AMOUNT', "\n\n" . 'La valeur du coupon est %s');
+define ('TEXT_REDEEM_COUPON_MESSAGE_BODY', "\n\n" . 'Vous pouvez visiter notre site, vous connecter et envoyer votre coupon &agrave; la personne de votre choix.');
+define ('TEXT_REDEEM_COUPON_MESSAGE_FOOTER', "\n\n");
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF 
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">Le bouton Retour a &eacute;t&eacute; d&eacute;sactiv&eacute; lorsque l\'option HTML WYSIWG Editor est active.</b></font> Pourquoi? - Parce que si vous cliquez sur le bouton retour pour &eacute;diter votre email HTML, le serveur PHP (php.ini - "Magic Quotes = On") va automatiquement rajouter "\\\\\\\" backslashes partout où les Doubles Quotes " apparaissent (HTML les utilise pour les liens, Images et autres) et cela am&egrave;nera des distorsions dans le HTML, les images vont disparaitre jusqu\'a ce que vous envoyiez votre email. Si vous d&eacute;sactivez WYSIWYG Editor dans l\'Admin, le bouton Retour r&eacute;apparaitra. <br><b>Si vous avez vraiment beson de pr&eacute;visualiser les emails avant leur envoi, utiliser le bouton Preview situ&eacute; dans l\'&eacute;diteur WYSIWYG.<br><HR>'); 
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML est actuellement d&eacute;sactiv&eacute; !</b></font><br><br>Si vous voulez envoyer des emails au format HTML, Activez WYSIWYG Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>'); 
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/gv_queue.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/gv_queue.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/gv_queue.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: gv_queue.php,v 1.2 2003/09/24 13:57:08 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Actions ch&egrave;ques cadeaux');
+
+define('TABLE_HEADING_CUSTOMERS', 'Clients');
+define('TABLE_HEADING_ORDERS_ID', 'No-Commande');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Valeur');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date d\'achat');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_HEADER', 'Vous avez r&eacute;cemment achet&eacute; un coupon sur notre site.' . "\n"
+                                          . ' Pour des raisons de s&eacute;curit&eacute;, le montant total des coupons n\'a pas &eacute;t&eacute; cr&eacute;dit&eacute; tout de suite.' . "\n"
+                                          . ' Le propri&eacute;taire de la boutique vient de lib&eacute;rer ce montant.' . "\n"
+                                          . ' Vous pouvez visiter notre site, vous connecter et envoyer votre coupon &agrave; la personne de votre choix.');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_AMOUNT', "\n\n" . 'La valeur du coupon est %s');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_BODY', '');
+define('TEXT_REDEEM_COUPON_MESSAGE_FOOTER', '');
+define('TEXT_REDEEM_COUPON_SUBJECT', 'Achat de coupon');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/gv_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/gv_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/gv_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: gv_queue.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gift Voucher Report');
+define('HEADING_SUB_TITLE', 'This report list all GV issued and if they have been released');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDERS_ID', 'Order-No.');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Voucher Value');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_GV_REPORT_RELEASED', 'Released to customer: ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/gv_sent.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/gv_sent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/gv_sent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: gv_sent.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Envois de ch&egrave;ques cadeaux');
+
+define('TABLE_HEADING_SENDERS_NAME', 'Nom &egrave;metteurs');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Valeur');
+define('TABLE_HEADING_VOUCHER_CODE', 'Code');
+define('TABLE_HEADING_DATE_SENT', 'Date d\'envoi');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_SENDERS_ID', 'ID Emetteurs:');
+define('TEXT_INFO_AMOUNT_SENT', 'Montant &eacute;mis:');
+define('TEXT_INFO_DATE_SENT', 'Date d\'envoi:');
+define('TEXT_INFO_VOUCHER_CODE', 'Code:');
+define('TEXT_INFO_EMAIL_ADDRESS', 'Email:');
+define('TEXT_INFO_DATE_REDEEMED', 'Date Rachat:');
+define('TEXT_INFO_IP_ADDRESS', 'Adresse IP:');
+define('TEXT_INFO_CUSTOMERS_ID', 'Id Client:');
+define('TEXT_INFO_NOT_REDEEMED', 'Non Rachat');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/header_tags_controller.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/header_tags_controller.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/header_tags_controller.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: header_tags.php,v 1.6 2005/04/10 14:07:36 hpdl Exp $
+  Created by Jack York from http://www.oscommerce-solution.com
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_CONTROLLER', 'Header Tags Controller');
+define('HEADING_TITLE_ENGLISH', 'Header Tags - English');
+define('HEADING_TITLE_FILL_TAGS', 'Header Tags - Fill Tags');
+define('TEXT_INFORMATION_ADD_PAGE', '<b>Add a New Page</b> - This option adds the code for a page into the files mentioned 
+above. Note that it does not add an actual page. To add a page, enter the name of the file, with or without the .php extension..');
+define('TEXT_INFORMATION_DELETE_PAGE', '<b>Delete a New Page</b> - This option will remove the code for a page from the
+above files.'); 
+define('TEXT_INFORMATION_CHECK_PAGES', '<b>Check Missing Pages</b> - This option allows you to check which files in your
+shop do not have entries in the above files. Note that not all pages should have entries. For example,
+any page that will use SSL like Login or Create Account. To view the pages, click Update and then select the drop down list.'); 
+
+define('TEXT_PAGE_TAGS', 'In order for Header Tags to display information on a page, an entry for that
+page must be made into the includes/header_tags.php and includes/languages/english/header_tags.php files
+(where english would be the language you are using). The options on this page will allow you to add, delete
+and check the code in those files.');
+define('TEXT_ENGLISH_TAGS', 'The main purpose of Header Tags is to give each of the pages in your shop a 
+unique title and meta tags for each page. The default settings will not do your shop any good and need to 
+be changed on this page. The individual sections are named after the page they belong to. So, to change the 
+title of your home page, edit the title in the index section.');
+define('TEXT_FILL_TAGS', 'This option allows you to fill in the meta tags added by
+Header Tags. Select the appropriate setting for both the categories and products tags
+and then click Update. If you select the Fill Only Empty Tags, then tags already
+filled in will not be overwritten. ');
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+
+
+define('ERROR_PAGE_NAME_IS_ALREADY_ENTERED', 'Page name is already entered -> ');
+define('ERROR_DELETE_FROM_ENGLISH_1', 'delete from English  ');
+define('ERROR_DELETE_FROM_ENGLISH_2', ' for  ');
+define('PAGE_NAME', 'Page Name');
+define('SWITCHES', 'Switches:');
+define('HTTA', 'HTTA:');
+define('HTDA', 'HTDA:');
+define('HTKA', 'HTKA:');
+define('HTCA', 'HTCA:');
+define('EXPLAIN', '(Explain)');
+define('TITLE_TITLE', 'Title');
+define('DESCRIPTIONS', 'Descriptions');
+define('KEYWORD', 'Keyword(s)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/header_tags_popup_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/header_tags_popup_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/header_tags_popup_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: header_tags_popup_help.php,v 1.0 2005/09/22 
+   
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+  
+  Released under the GNU General Public License
+*/
+?>
+<style type="text/css">
+.popupText {color: #000; font-size: 12px; } 
+</style>
+<table border="0" cellpadding="0" cellspacing="0" class="popupText">
+  <tr><td><hr class="solid"></td></tr>
+  <tr>
+   <td class="popupText"><p><b>What are HTTA, HTDA, HTKA and HTCA used for?</b><br><br>
+    Header Tags comes with a default set of tags. You can create your own
+    set of tags for each page (it comes with some set up, like for index
+    and product pages).
+
+<pre>
+HT = Header Tags  
+T  = Title 
+A  = All 
+D  = Decription
+K  = Keywords
+C  = Categories *
+</pre>  
+<b>* Note:</b> The HTCA option only works for the index page. It causes the
+category name to be displayed in the title.<br><br>
+
+If HTTA is set on (checked), then it says display the Header Tags Title All 
+(default title plus the one you set up).<br><br>
+
+So if you have the option checked, both titles will be displayed.
+Let's say your title is Mysite and the default title is Oscommerce.<br>
+<pre>
+With HTTA on, the title is
+ Mysite Oscommerce
+With HTTA off, the title is
+ Mysite
+</pre>
+</p>
+  </td>
+ </tr>
+ 
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)<br><br>
+
+&nbsp;&nbsp;<b>Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Some documentation that was previously provide now can be accesed via the admin.
+These help document cover a variety of subjects to you as the Store owner to manage your store.
+</P>
+<P>
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+</P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<tr>
+<td>
+<!-- Begin help index2.html-->
+<UL>
+<b>&nbsp;&nbsp;Admin help and how to document </b>
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Setup and configure </b>
+<LI><a href="<?php echo tep_href_link('../doc/CRE6.15-QUICK-INSTALL-GUIDE.pdf', '') . '"> Quick install (PDF) </a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/addlanguage.txt', '') . '">Adding Languages  (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/adminssl.txt', '') . '">SSL for Admin (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../admin/data.php', '') . '">Easy Populate 3.01 (html)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../admin/edit_textdata_help.php?&help_id=1', '') . '">Language Editor (html)</a>' ;?></LI>
+</UL>
+<UL>
+&nbsp;&nbsp;<b>Payment modules</b>
+<LI><a href="<?php echo tep_href_link('../admin/authnet_help.php', '') . '">Authorize.net setup (html)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/payment/paypal/Help_FAQs.inc.php', '') . '"> Paypal Faq\'s (html)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/payment/paypal/Help_Config.inc.php', '') . '">Paypal how to (html)</a>' ;?>
+<UL>
+ </td>
+   </tr>
+<!-- End help index2.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<tr>
+<td>
+<!-- Begin help index2.html-->
+<UL>
+<b>&nbsp;&nbsp;Catalog help and how to document </b>
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Testing the Cart </b>
+</UL>
+ </td>
+   </tr>
+<!-- End help index2.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<tr>
+<td>
+<!-- Begin help index4.html-->
+
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Miscellaneous Documents from the /doc directory </b>
+<LI><a href="<?php echo tep_href_link('../doc/CRE6.15-QUICK-INSTALL-GUIDE.pdf', '') . '">'. 'Quick Setup (pdf)' . '</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/addlanguage.txt', '') . '">Adding New Languages (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/adminssl.txt', '') . '">SSL for admin (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/changesloaded6151.txt', '') . '">Changes for CRE Loaded Patch 01 (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/buttons.txt', '') . '">List of buttons (txt)</a>' ;?></LI>
+</UL>
+<UL>
+<br>&nbsp;&nbsp;<b>Liscense</b>
+<LI><a href="<?php echo tep_href_link('../doc/license.txt', '') . '">GPL 2 English (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/doc/none.txt', '') . '">GPL 2 Espanol (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link('../doc/gnu_french.txt', '') . '">GPL 2 French (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link('../doc/gnu-german.html', '') . '">GPL 2 German (txt)</a>' ;?>
+ </td>
+   </tr>
+<tr>
+<td>
+</td>
+</tr>
+
+<!-- End help index4.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/index5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/none.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/none.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc/none.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Sorry this is not yet avalable
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_cat.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_cat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_cat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_misc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_misc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/doc_misc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Data Export/Import system');
+define('HEADING_TITLE2', 'EP Advance Import');
+define('HEADING_TITLE3', 'EP Advance Export');
+define('HEADING_TITLE4', 'EP Basic Import');
+define('HEADING_TITLE5', 'EP Basic Export');
+define('HEADING_TITLE6', 'Editing the export file');
+define('HEADING_TITLE9', 'Introduction to data feed');
+define('HEADING_TITLE10', '7 Steps to your First Froogle Feed');
+define('HEADING_TITLE11', 'Configure A Feed');
+define('HEADING_TITLE12', 'Run A Feed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/edit_key_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/edit_key_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/edit_key_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: edit_key_help.php,v 1.1 
+
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_01', 'Introduction');
+define('HEADING_TITLE_02', 'Configure Encrypt and Decrypt');
+define('HEADING_TITLE_03', 'Key management');
+define('HEADING_TITLE_04', 'Encrypt and Decrypt data');
+define('HEADING_TITLE_05', 'Changing your key');
+define('HEADING_TITLE_06', 'Test');
+define('HEADING_TITLE_07a', 'Encrypted data that is not encrypted');
+define('HEADING_TITLE_07b', 'Decrypting data that is encrypted');
+define('HEADING_TITLE_07c', 'Changing keys and updating encrypted data');
+
+
+define('TEXT_MAG_1', 'Index');
+define('TEXT_MAG_2', 'Pre install and installation of Encrypt and Decrypt');
+define('TEXT_MAG_3', 'Specific task:');
+define('TEXT_MAG_4', 'A. Encrypted data');
+define('TEXT_MAG_5', 'B. Decrypting data');
+define('TEXT_MAG_6', 'C. Changing keys and updating encrypted data');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/edit_textdata_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/edit_textdata_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/edit_textdata_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE_01', 'Edit Languages: Introduction ');
+define('HEADING_TITLE_02', 'Edit Languages: Search ');
+define('HEADING_TITLE_03', 'Edit Languages: Edit ');
+define('HEADING_TITLE_04', 'Edit Languages: Save');
+define('HEADING_TITLE_05', 'Edit Languages: Restore');
+define('MENU_ITEM_01', 'Introduction:');
+define('MENU_ITEM_02', '1. Search for files or text');
+define('MENU_ITEM_03', '2. Edit text define');
+define('MENU_ITEM_04', '3. Saving your work ');
+define('MENU_ITEM_05', '4. Restore to last copy of define file');
+
+define('TEXT_MSG_1', 'Language Editor Help Index');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/data_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/data_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/data_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+?>
+<tr>
+ <td>
+<p align="center"><b><span style="font-size:16pt;">Data Feed Input/Output Introduction</span></b></p>
+<p>Data feed service is a collection of contributions to allow you to updated 
+your products and categories data remotely, and send that data to data listing 
+services. It used a number of contributions that have been modified to work 
+with small, medium, and large stores. </p>
+<p>Contributions:<br>Easy Populate Advance by Tom O'Neill<br>Easy Populate Basic<br>Froogle 
+data feed : Calvin K<br> &nbsp;&nbsp;&nbsp;Salemaker for froogle feed: by<br> 
+&nbsp;&nbsp;&nbsp;Admin for Froogle Data Feed : Tom O'Neill<br><br> Goals:<br>The 
+typical store owner never needs to edit a code or define file directly.The store 
+owner does not need a lot of support on how to use program.Combines the functions 
+of moving data in and out of store is in one are.Make it flexible enough for 
+small, medium and large store to use program effectively.Move program files closer 
+to OSC/CRE Loaded standards for look and feel, and coding.<br><br>Parts of 
+Data Feed Service:<br>&nbsp;Easy Populate: This is used to update data it allows 
+you to updated data remotely on your&nbsp;local computer and upload to the data 
+to your on line store. It allows you to&nbsp;&nbsp;build custom queries for 
+the data then download the information to your local computer&nbsp;&nbsp;for 
+editing, Then upload back to your &nbsp;on-line store.</p>
+<p>&nbsp;Data feed:<br>&nbsp;&nbsp;Data feed takes the data with in your catalog 
+and prepares it for submission to a feed &nbsp;service and send it to the feed 
+service either automatically or manually if you need on completion&nbsp;of building 
+the feed.<br>&nbsp;Features added and changes to basic programs.<br> &nbsp;&nbsp;&nbsp;Easy 
+populate 2.75 Advance to 2.78:<br>&nbsp;1. Removed the froogle feed from this 
+contribution. The froogle function is now &nbsp;handled by separate code files.<br>&nbsp;2. 
+Moved EP from catalog side box to Data export/import side box.<br>&nbsp;3. Moved 
+function file to admin/includes/function directory to follow OSC standards.<br>&nbsp;4. 
+Moved most simple function to function file, export now has all functions removed 
+. There is now only one function left in the EPA import file. <br>&nbsp;5. Revised 
+admin screens so it was more like the rest of the catalog.<br>&nbsp;6. Inserted 
+tep form function rather then html form function (In progress)<br>&nbsp;7. Added 
+pop up help for information on how to use EPA.<br>&nbsp;8. Easy Populate Basic 
+is for backward compatibility with older versions of EP<br>&nbsp;&nbsp;&nbsp;&nbsp;EP 
+advance will import all EPA files of previous version of EPA. <br>&nbsp;9. Export 
+screen and Import screen separated into two separate files<br>&nbsp;10. Side 
+box changed, so that sub titles are offset.<br>&nbsp;11. Added date time to 
+split so each group of splits will be unique and old splits will&nbsp;not be 
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>&nbsp;12. 
+Program message, error, and output were place in one of three variable so they 
+could be output&nbsp:with in the html output section of the files.<br> &nbsp;&nbsp;<br>&nbsp;Items 
+fixed or enhanced from EP 2.74 to 2.75 Advance:<br>&nbsp;1. To add products 
+the product id should be set to 0, there can be many 0's for product ID's.<br>&nbsp;2. 
+You no longer need to change the manufacturers table to change a manufacturers_id 
+first&nbsp;manf id to 1 or 0<br>&nbsp;3. No longer adds a empty product, caused 
+by not treating the last line as not product.<br>&nbsp;4. Added EP Basic, It 
+cannot install any EP Advanced files since they start with EPA a error<br>&nbsp;&nbsp;&nbsp;&nbsp;message 
+will be displayed. It can install any file that starts will EPB or older EP files<br>&nbsp;5. 
+EP Advanced set up so it can only read files that start with EPA , prevents 
+reading older files.<br>&nbsp;6. Delete has been added back into EP for products 
+only. &nbsp;This is implemented via a new column call v_action. You must type 
+the word &quot;delete&quot; in this column to delete a product.<br>&nbsp;7. 
+EP basic was not showing on some site this was to an error in the install of 
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>&nbsp;8. 
+You can add your own product ID, If your product ID's are based on a system 
+other than&nbsp;numbers generated by the shopping cart and auto incremented by 
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows 
+for compatibility with some external inventory management systems.<br>&nbsp;9. 
+moved configuration of EP to a separate file called epconfigure.php <br><br>&nbsp;Data 
+Feed:<br>&nbsp;1. Added language files<br>&nbsp;2. Multiple configurations for 
+multiple feed services now available through admin screen<br>&nbsp;3. Configuration 
+configured in admin rather then edit a file.<br>&nbsp;4. Feed submission now 
+A multiple step process.<br>&nbsp;5. Switched to tep functions for data base 
+queries.<br>&nbsp;6. Split file generation and FTP code into two separate files.<br>&nbsp;7. 
+Combined Froogle, Yahoo and Bizrite into one package (Not all installed and 
+adapted yet)<br>&nbsp;8. added fields for advance feed to products database<br>&nbsp;9. 
+added separate sql file for additional info for froogle feed<br>&nbsp;10. Builds 
+Category strings before building feed file.<br>&nbsp;11. Help popups added to 
+admin screens.<br>&nbsp;12. Added salemaker contribution pricing to price sent 
+to price in feed.<br>&nbsp;13. Uses tax zone from store. <br>&nbsp;14. Add the 
+fields froogle_type, upc, isbn, manufacturer_product_id to products table and 
+products edit screen.<br>&nbsp;15. add froogle specific fields for books, music, 
+video to a separate table.<br><br>&nbsp;For EP set up:<br>&nbsp;For Data feeds 
+set up:<br>Step 1 <br>&nbsp;To set up this modules data feed service, you must 
+first register with the feed services you wish to use.&nbsp;This is described 
+in the getting started document. It has links to the feed services &nbsp;and 
+what you need to set up the configuration of each service.<br>Step 2<br>Next 
+you need to install this contribution this is disturbed in the doc/install.txt 
+files<br>Step 3<br>The you will need to configure and run the data feeds this 
+is described in the running doc/configureandrun.txt document The file field_spec.txt 
+describes the limitation of what can be placed into each field<br><br>&nbsp;Known 
+bugs:<br>&nbsp;&nbsp;1. PHP 5 compatibility for import. the problem is either 
+how globals are treated or&nbsp;&nbsp;how arrays are used in this contribution<br></p>
+ </td>
+</tr> 
+<tr>
+  <td>
+ <b>Error and status messages</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will appear near the top of the for, Blue background 
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_msg.gif" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ <b>Import result</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now appear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ <b>Help while using the admin screens</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or input you could use. It will display a pop up window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
+

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/edit_key_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/edit_key_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/edit_key_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: edit_key_help.php,v 1.1 
+
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_01', 'Introduction');
+define('HEADING_TITLE_02', 'Configure Encrypt and Decrypt');
+define('HEADING_TITLE_03', 'Key management');
+define('HEADING_TITLE_04', 'Encrypt and Decrypt data');
+define('HEADING_TITLE_05', 'Changing your key');
+define('HEADING_TITLE_06', 'Test');
+define('HEADING_TITLE_07a', 'Encrypting data');
+define('HEADING_TITLE_07b', 'Decrypting data');
+define('HEADING_TITLE_07c', 'Changing keys and updating encrypted data');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page1.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page1.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page1.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+?>
+
+
+<table width="100%" border="0" cellpadding="5" cellspacing="3">
+  <tr valign="top">
+    <td><p><strong><font color="red">Warnings </font></strong></p>
+      <p><strong><img src="images/icons/warning_big.gif" alt="Warning" width="20" height="20" hspace="5"></strong> <font color="#FF0000">You must check the import and export laws of your country. Some prevent the use of encrypted data or software with hooks in place for encryption to be added. This module does not contain actual encryption code. It uses the mcrypt module, and provides management services. While it is not subject to export laws in the US, it may well be regulated by your jurisdiction. You are responsible for knowledge of and compliance with local laws.</font> </p>
+      <p><strong><img src="images/icons/warning_big.gif" alt="Warning" width="20" height="20" hspace="5"></strong> <font color="#FF0000">One must be careful when the encryption/decryption takes place. Network service disruptions and other factors can cause loss of data availability - ie leaving data encrypted with no key available. It is important to process your cards as frequently as you can, and to delete the data as soon as the transaction is cleared.</font></p>
+      <p><strong> Introduction:</strong> <br>
+      Requirements for the protection of personal and financial data are being increased day by day. This package was developed to assist you with this requirement during the daily operation of your CRE loaded store. There are 3 main components within this package, ssl for admin, encryption/decryption of data, and pgp signing for email with sensitive data. PGP is not yet implemented. Encryption is functional, but not fully developed in this 0.7 release Encrypt and Decrypt component has 4 main functions within it. Configuration, Manage Keys, Update/Convert, Test. </p>
+      <p> 1. Pre install and installation of Encrypt and Decrypt : &nbsp;&nbsp;&nbsp;<br>
+        <img src="images/pixel_trans.gif" width="30" height="10">        A. Setup and installation: See install_encrypt.txt<br>
+      <img src="images/pixel_trans.gif" width="30" height="10">&nbsp;B. Enabling SSL for Admin</p>
+      <p>        Although the encryption protects the data while it is stored in the database tables. It does not protect data when you view it in the admin screens. To help with this SSL for admin was written, this should be installed in the admin and the appropriate edit screens run in ssl mode. The files in this package are designed to work with or with out SSL for admin.</span>      </p>
+      </P></td>
+  </tr>
+  <tr>
+    <td class="pageHeading"><B>Help while using the admin screens</B> </td>
+  </tr>
+  <tr>
+    <td><img src="includes/languages/english/help/encrypt/images/item_help.gif" alt="Screen Shot" width="460" height="364" border="1" ><br>
+      You will notice help icons like this throughout the admin screens These icons trigger popup screens with individual help for each setting or input you see labeled with the icon<br></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><font class="pageHeading">A. Configuration:</font></p>
+      The configuration only has 3 items that need to be setup, along with the key file.<br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/configure1a.png" NAME="Graphic1" WIDTH="644" HEIGHT="143" hspace="5" vspace="5" BORDER=1>
+      <p><font class="content_heading">1. Enable CC encryption Default: false</font><BR>
+        You can turn on and off the encryption, Once you turn on encryption the back off you can use the convert data screen to decrypt the data. If you do this it is advisable to remove the sensitive data. The order viewing and edit screen will decrypt the data so it is viewable.</P>
+      <p><font class="content_heading">2.Path to key File Default key/</font><BR>
+        Currently this is a directory within the includes/ directory.</P>
+      <p><font class="content_heading">3. Key File Name: cc_key.php</font><BR>
+        This is the file name for the key file, It is suggested that you use a different name then the one listed here. By clicking on this configuration setting you have three task to do.</span></font> &nbsp;b. Edit the key file name<BR>
+      </P>
+      <p><IMG SRC="includes/languages/english/help/encrypt/images/configure3.png" NAME="Graphic3" WIDTH="219" HEIGHT="154" BORDER=1> </p>
+      <p>Note: Once you have set the name of the file you can switch to Manage Key files<BR>
+        </span></font>
+        </p>
+      </p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> On opening the Manage Key Files screen it will look like the above screen with no key files.<br>
+      Click on the CREATE files button and a empty key file will be set up using the name you selected in the text input box.<BR>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_start.png" alt="Screen Shot" NAME="Graphic11" WIDTH="723" HEIGHT="213" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> You will now have two empty key files. Starting off you will only need to enter a key phrase into the Primary key file. Next click on the EDIT button next to the Primary key file. This will open the key file edit screen.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_createt.png" alt="Screen Shot" NAME="Graphic5" WIDTH="725" HEIGHT="251" hspace="5" vspace="5" BORDER=1> </p>
+      </P>
+      <p><strong>C.</strong> To edit the &quotPrimary&quot Click on the EDIT button at the end of the row. A Key Edit screen will open.<br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_edit1.png" alt="Screen Shot" NAME="Graphic8" WIDTH=526 HEIGHT="152" hspace="5" vspace="5" BORDER=1><br>        
+      <strong> Note:</strong> The new key file is used to allow updating the data encryption when you want to change to a new encryption key.</p>
+      <p><strong>D.</strong> Type in your key phrase in the text box and click the SAVE button. This will save the phrase. 
+  The phase can be anything from random numbers and letters to a phrase you can remember.</p>
+      <p><strong>E. </strong>From this point on all cc information will be encrypted as it is entered into the orders by the customer.
+    The next step you may need to take might be to encrypt existng Credit card information.</p>
+    <p><strong>F.</strong> Next click on the Update cc data in the lefthand side box.</p></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> Each order paid by credit card using a module which stores the number will appear in this list. Click on the ones marked as unencrypted. Then click on the encrypt button. <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/e_c_order1.png" alt="Screen Shot" NAME="Graphic4" WIDTH="641" HEIGHT="141" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> You will now have encrypted this existing entry. Do this for each unencrypted CC number. Next to the encrypt button is a decrypt button that can be used to decrypt the information. Attempts to re-encrypt a number again will fail.<br>
+      <img src="includes/languages/english/help/encrypt/images/e_c_order.png" alt="Screen Shot" name="Graphic9" width="642" height=137 hspace="5" vspace="5" border=1></p>
+      <p><strong>C.</strong> Mass Encryption or Decryption can also be done. Simply click on the encrypt or decrypt buttons at the top of the form and all numbers will be processed. The program will detect those orders that have already been encrypted or decrypted and change only the data which requires processing.        <BR>
+      <IMG SRC="includes/languages/english/help/encrypt/images/d_c_main_all.png" alt="Screen Shot" NAME="graphics1" WIDTH=545 HEIGHT=61 hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>D.</strong> If you need to export your Credit card information to an external program that cannot use the mcrypt library you can decrypt all of the encrypted data before exporting the information. Once you have exported the data you should return to this screen to encrypt all data. <BR>
+      </p></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Author: $Author$
+  Revision : $Revision$
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> Keys should be changed from time to time as a security precaution. When you first set up your &quot;Primary key file&quot; an empty &quot;New key file&quot; was created. In fact, CRE Loaded comes with 2 key files already in place, just in case your host allows editing of existing files but restricts creation of files from within the web server. You will now need to add your new key to this file . In the row that is labeled &quot;New key file&quot; click on the edit button.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_createt.png" alt="Screen Shot" NAME="Graphic6" WIDTH="725" HEIGHT="251" hspace="5" vspace="5" BORDER=1> </p>
+      <p> <strong><font color="#FF0000"> WARNING:</font></strong><br>
+        <strong><font color="#FF0000"><img src="images/icons/warning_big.gif" width="20" height="20" hspace="5" vspace="5"></font></strong>Do not edit the main key file for your site once you have begun encrypting data. This may cause the loss of any existing data you have encrypted. You must follow the procedure for converting records as listed below: </p>
+      <p><strong>B.</strong> Click once on the edit button next to the new_(key file name) to access the Key File edit screen. When you click on the file name you will be sent to the key file contents editor. You may enter anything from a phrase to a random set of numbers and letters. The longer the phrase, the more secure your data will be. Inclusion of numbers and use of both upper and lower case characters will also make your phrase more difficult to guess.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_new_edit1.png" alt="Screen Shot" NAME="Graphic7" WIDTH=555 HEIGHT=112 hspace="5" vspace="5" BORDER=1></P>
+      <p> <strong>C.</strong> Once you have finished changing your key click on the save button. It will save the key and display it for your verification. If this is not what you wanted click on the restore button and the old contents will be brought back.</span></font> <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_new_saved.png" alt="Screen Shot" NAME="Graphic10" WIDTH=572 HEIGHT=122 hspace="5" vspace="5" BORDER=1></P>
+      <p><strong>D.</strong> Having placed the new key you should now go to the convert data screen to re-encrypt your data using this new key. If you do not use the Convert CC Data screen you may lose your existing CC data. This may be a permanent loss.</P>
+      <p><strong>E.</strong> Convert CC Data screen </P>
+      <p> <img src="includes/languages/english/help/encrypt/images/convert.png" alt="Scrren Shot" name="Graphic2" width="628" height="161" hspace="5" vspace="5" border=1></p>
+      <p><strong>1.</strong> If the new key file is empty, you will see the above screen, with warnings that there is no key and you need to add one.<br>
+        <img src="includes/languages/english/help/encrypt/images/convert_ok.png" width="337" height="23" hspace="5" vspace="5" border="1"></p>
+      <p><strong>2.</strong> The convert button will appear once you have added a new key phrase. As long as you see no red warning messages you are ready to proceed with conversion. If you do see a warning it is important that you resolve the problem before continuing.<br>
+        <img src="includes/languages/english/help/encrypt/images/convert_button.png" width="271" height="31" hspace="5" vspace="5" border="1"></p>
+      <p><strong>3.</strong> Click on the convert button. This will convert the existing cc data to the new key. The process converts the data by decrypting with the old key and encrypting with the new one. It continues by copying the &quot;Primary Key File&quot; to a back-up file and moving the &quot;New key file&quot; to the &quot;Primary Key File&quot;. That completes the process</span></font> </p>
+      </P>
+    </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page6.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page6.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page6.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: Tom O'Neill
+  Latest Contributor : $Author$
+  Revision : $Revision$
+
+*/
+
+?>
+
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> CRE CC Encryption Manager relies on services provided by the operating system to function. This is because various governments regulate the availability and usage of security technology including encryption. The test portion of CRE CC Encryption is intended to ensure that encryption algorithms and modes selected for use are available and functioning properly. It can also be used to identify other algorithms and modes that can be used by this program. We begin by displaying a table of available encryption methods and modes. <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/test1.png" NAME="graphics4" WIDTH="825" HEIGHT="140" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> The first part of the encryption service test is shown above, and lists the available methods and what modes are working on your web server. If you do not see a table similar to the one above then you do not have mcrypt installed or working correctly. <font face="Arial"><br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/test2.png" NAME="graphics4" WIDTH="274" HEIGHT="213" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>C.</strong> Then a partial list of the second part is shown above, it lists the length of the key that is allowed or required for a specific method. Currently this tool provides only some basic information. In future, it will be expanded to allow users to select an algorithm to fit their needs and even to allow switching algorithms as part of a carefully managed security system.      </p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7a.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7a.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7a.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>1.</strong> Encrypted data that is not encrypted:<BR>
+        The Update CC Data is used to convert non-encrypted data. You can encrypt one record at a time or all records that have not been encrypted.</p>
+      <p><strong>2.</strong> Go to Encryption/Decryption side box click on Update CC Data. A list of orders with credit card number will apear. There will be a green message if the data is encrypted and a red message if it is not. Only the cc number is checked. You can encrypt either a single record or all records in this list<br>
+        <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;a. Single record<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Click on the record not encrypted<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. In the right hand box you will see the encrypt button, Click on this and the record will be encrypted.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. You will be returned to the Order with cc numbers list. If ther are more records go to step 2 and repeat until there are not any more red messages.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4. You are now done if there are no more red messages<BR>
+        <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;b. All records <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Below the list of order with cc number you will see a button label Encrypt All. Click on this button.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. You are now done</p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7b.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7b.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7b.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><strong>A.</strong> Go to Encryption/Decryption side box click on Update CC Data . A list of orders with credit card number will apear. There will be a green message if the data is encrypted and a red message if it is not. Only the cc number is checked. You can decrypt either a single record or all records in this list<BR>
+        <BR>
+&nbsp;&nbsp;&nbsp;Single record<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;1. Click on the record not decrypted<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;2. In the right hand box you will see the decrypt button, Click on this and the record will be decrypted.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;3. You will be retuned to the Order with cc numbers list. If there are more records go to step 2 and repeat until ther are not more red messages.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;4. You are now done if there are no more red messages<BR>
+        <BR>
+&nbsp;&nbsp;All records <BR>
+&nbsp;&nbsp;&nbsp;1. Above the list of order with cc number you will see a button label decrypt . Click on this button.<br>
+&nbsp;&nbsp;&nbsp;2. You are now done</td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7c.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7c.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/encrypt_page7c.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><ul>
+      <li>  Go to the Encryption/Decryption side box and click on the Manage Keys selection.</li>
+      <li> Click on the file name in the row labeled &quot;New key file&quot; then click on edit.</li>
+      <li> Type in your new key.</li>
+      <li> Click on save.</li>
+      <li> In the Encryption/Decryption side box and click on Convert data. </li>
+      <li>If no red warning messages appear you may proceed.</li>
+      <li>Click on the convert button.</li>
+      <li> Finished</span></font>
+          </P>
+      </li>
+    </ul></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/cofigure_filename.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/cofigure_filename.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure1a.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure1a.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure3.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure_filename1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/configure_filename1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_button.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_button.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_nobutton.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_nobutton.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_not.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_not.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_ok.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/convert_ok.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/d_c_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/d_c_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/d_c_main_all.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/d_c_main_all.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/e_c_order.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/e_c_order.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/e_c_order1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/e_c_order1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/e_c_order_d_e.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/e_c_order_d_e.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/encrypt1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/encrypt1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/encrypt2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/encrypt2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/item_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/item_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_createt.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_createt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_edit.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_edit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_new_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_new_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_new_saved.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_new_saved.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_save.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_save.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_saved.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_saved.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/manage_key_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/order_edit.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/order_edit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/order_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/order_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/test1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/test1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/test2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/encrypt/images/test2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_basicexport.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_basicexport.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_basicexport.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export.png" border="0" ><br>
+
+ The Export Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is intended for backward compatibility with previous version of Easy Populate.
+This version has been reorganized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatible with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Select method to save export file</b>
+  </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_sel_loc.png" border="0" ><br><br>
+To export A file first select if you wish to download the file or save to your web server temp directory.
+
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Select field set to export</b>
+ </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_sel_feld.png" border="0" ><br><br>
+These are the same as in Easy populate 2.7X select from Complete, Model/Price/Qty, Model/Category, Attributes.
+When ready click the "Start File Creation button"
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_basicimport.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_basicimport.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_basicimport.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,69 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_import.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is entended for backward compatibility with previous version of Easy Populate.
+This version has been reorginized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatable with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPB format. This is
+the products_model is the first column in the upload file. The file should have EPB as the first
+three characters in its file name or none at all.
+
+Click on the browse button to browse your local computer for the file to upload and insert.
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. Also
+EP usually will only imports 400 to 500 lines of products, this version can do 2,000 plus.
+If a file it to large to upload because of PHP restrictions the FTP the file to the site and use
+"Import Data from file in temp/"
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Although it may not be needed, EP basic upload and split is available. Use the browse button
+to browse you local files and select the ile for uploading.  It will be spilt into files
+limited by the configure setting $maxrecs as set in the epconfigure.php file.
+Each file name will be dated with the date the split was created.
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_epbasic.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_epbasic.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_epbasic.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epbasic.jpg" border="0" ><br>
+
+ EP Basic
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Easy Populate Basic</b>
+ </td>
+</tr>
+<tr>
+ <td>
+
+<br><b>Upload EP File for Import</b> <br>
+This feature allows the upload of a delimited file for import into the database. You can now import files which include HTML in the text fields without having the file mangled by EP or Excel.  But EP Basic will not install files unless the file name begins with EPB or EP.  Files beginning with EPA are intended for use with EasyPopulate Advanced.
+
+<br><b>Upload and Split a EP File</b> <br>
+This feature has the same improvements applied to the Import routines, but allows you to upload a large file and split it into smaller pieces.  This feature is helpful in avoiding interrupted imports due to communications timeouts or exceeding the servers script time limits.
+
+
+<br><b>Import Data from file in temp/</b> <br>
+This is now a drop down list of all the files located in the /temp directory. 
+
+<br><b>Create an export files</b> <br>
+A series of drop down boxes are used to allow you to :
+
+<br><b>Select method to save export file </b> <br>
+There are two selections here:<br>
+       Save to temp file on server<br>
+       Select fields to download<br>
+
+
+<br><b>Select fields to download </b> <br>
+This is the list of which download types to use. You will also notice that there is no V_products_id in the list. This is for backward compatibility of older files.
+
+By default the file types are are:
+Complete     (Attributes have been removed since there is a separate download for those.)
+Model/Price/Qty
+Model/Category
+Froogle
+Attributes
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_error.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_error.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_error.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+
+
+
+
+
+what the basic froogle feed sends:
+product_url    name    description   price   image_url   category    offer_id
+
+http://192.168.1.35/loaded6151/product_info.php?products_id=28  $25 Gift Certificate  Buy a Gift Certificate for your friends or family 26.38 http://192.168.1.35/loaded6151/images/giftcert-25-sm.gif   Gift Certificate 28
+
+
+froogle product url not set up For SEO urls
+http://192.168.1.35/loaded6151/product_info.php?products_id=20
+
+1. FTP open connection failed to
+The is no server listed in the configure file to connect to
+
+2. FTP connection has failed!
+Failed to connect to the froogle server.
+  wrong user or password entered into the configuration
+
+3. Attempted to connect to
+ An attempt to connect to the server failed If you have list a server, Froogle ftp could be down
+ or you have the wrong server listed inthe configuration.
+ 
+ 
+4. Couldn\'t change directory on
+
+5. Uploaded froogle.txt to hedwig.google.com as /testuser/froogle.txt
+
+The upload worked, Now go to froogle and log into your account and double check the feed.
+
+ 
+ 
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_export.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_export.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_export.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_start.png" border="0" ><br>
+
+ The Export Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPA</b>
+ </td>
+</tr>
+<tr>
+ <td>
+The changes here are in the handling of HTML content in descriptions; image path URL's,
+and EP import filename requirements. You may now import files with html in the text
+fields and not have it mangled by EP or Excel.  URL's for images in subdirectories
+can be handled and correctly written to the database.   Beginning with 2.75, EP
+Advanced will not install files unless it begins with EPA,and EP Basic will not
+install files that begin with EPA.  This feature is to protect the database from
+errors related to a new column added to the Easy populate file format.  EP Advanced
+uses the product_id column, this allow for more features to be added. EPA is will also allow
+you to refine your export file so you can target a specific group of records to edit
+ </td>
+ </tr>
+  <tr>
+ <td>
+<br><H3><b>1. Select method to save export file </b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_sel_export.png" border="0" ><br>
+  </td>
+</tr>
+<tr>
+ <td>
+To export select where you want the export file placed.
+</td>
+</tr>
+<tr>
+ <td>
+<br><H3><b>2. Select field set to export</b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_field_group.png" border="0" ><br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+Next select which group of feilds to export
+</td>
+</tr>
+  </td>
+ </tr>
+
+<tr>
+ <td>
+<br><H3><b>3.Select field for sort order </b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_sortorder.png" border="0" ><br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+Next select the sort order you want the rows to apear in the export file.
+</td>
+</tr>
+<tr>
+ <td>
+<br><H3><b>4.Limit number of products to Export </b></H3><br>
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+If you deal with large export files and find it diffcult to find products to edit. You
+can use the Limits to make you export files small and target specific groups of records.
+Not all export files can be limited by all meathods. Meathods can also be combined.
+</td>
+</tr>
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>a. Limit By Category </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_cat.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ If you have TOP showing in the drop down box all categories are looked at.
+ If you have a category showing in the drop down box, the that category and all sub categories will be in the list
+ The categories drop down is generated from your categories in the database
+</td>
+</tr>
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>b. Limit By Manufacture </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_man.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ If you have "Manufactures showing in the drop down box all manufactures are looked at.
+ You can select any manufacture to target just there products
+ The drop down list of manufacures is read from your manufacters.
+ </td>
+</tr>
+
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>c. Limit By Product Range </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_prodid.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ You can use Product Id's to limit your export file.
+<br>&nbsp;&nbsp;&nbsp;  1. If no product_id's are enter all of the product are in the export file
+<br>&nbsp;&nbsp;&nbsp;  2. If the begin product_id and no end product_id is entered. Products from the first product id to the end are in the export file
+<br>&nbsp;&nbsp;&nbsp;  3. If no beginning product_id's and only and ending product_ID. From the first id to ending the products are in the export file
+<br>&nbsp;&nbsp;&nbsp;  4. If the begin product_id and ending product_id is enter then this range of products are in the export file
+ </td>
+</tr>
+
+
+<tr>
+<td>
+<br>&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_feed_intro.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_feed_intro.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_feed_intro.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,110 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<font face="Arial"><span style="font-size:10pt;">
+<tr>
+ <td>
+</span></font><p align="center"><b><span style="font-size:10pt;"><font face="Arial">Data Feed Input/Output Introduction</font></span></b></p>
+<p>
+<font face="Arial"><span style="font-size:10pt;">&nbsp;<b> 1. Introduction:</b> Data feed service is
+based on Calvin K's data feed contribution. The basic functions were retained
+but the rest of the internal code was changed to follow OSC Style of coding.
+Along with the coding change an&nbsp;admin interface was introduced to manage
+the feed configuration. With these coding changed and the addition of a admin
+the process was split into 4 steps. Not all of the steps are required for each
+feed you do.</span></font></p>
+<p>
+<font face="Arial"><span style="font-size:10pt;">&nbsp; <b>2. Goals:</b><br>The typical store owner never needs to edit a code or define file directly.The store
+owner does not need a lot of support on how to use program. Combines the functions
+of moving data in and out of store is in one area. Make it flexible enough for
+small, medium and large store to use program effectively. Move program files closer
+to OSC/CRE Loaded standards for look and feel, and coding.<br><br>
+&nbsp; <b>3. Parts of Data Feed Service:</b><br>
+Froogle data feed : Calvin K<br>
+&nbsp;Salemaker for froogle feed: by Marcel van Lieshout<br>
+&nbsp;Admin for Data Feed : Tom O'Neill<br><br>
+&nbsp;&nbsp;&nbsp; d. For Data feeds setup up:<br>
+Step 1 <br>
+&nbsp;To set up this modules data feed service, Review the 7 steps to your first feed. It outlines
+what steps you need to take to do a feed. It will take you through the configuration process to the uploading and checking of the feed.<br>
+&nbsp;Step 2<br>The you will need to configure and run the data feeds this
+is described in the running doc/configureandrun.txt document The file field_spec.txt
+describes the limitation of what can be placed into each field<br><br>
+</span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+</td>
+</tr>
+<tr>
+  <td>
+
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">&nbsp;3. Error and status messages</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will appear near the top of the form, Blue background
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_mesg.png" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Import result</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now appear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Help while using the admin screens</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or input you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+ <br><br><b> 5. Features added and changes to basic programs.</b><br>
+&nbsp;Data Feed:<br>
+&nbsp;1. Added language files<br>
+&nbsp;2. Multiple configurations for multiple feed services now available through admin screen<br>
+&nbsp;3. Configuration configured in admin rather then edit a file.<br>
+&nbsp;4. Feed submission now A multiple step process.<br>
+&nbsp;5. Switched to tep functions for data base queries.<br>
+&nbsp;6. Split file generation and FTP code into two separate files.<br>
+&nbsp;7. Combined Froogle, Yahoo and Bizrite into one package (Not all installed and adapted yet)<br>
+&nbsp;8. added fields for advance feed to products database<br>
+&nbsp;9. added separate sql file for additional info for froogle feed<br>
+&nbsp;10. Builds Category strings before building feed file.<br>
+&nbsp;11. Help popups added to admin screens.<br>
+&nbsp;12. Added salemaker contribution pricing to price sent to price in feed.<br>
+&nbsp;13. Uses tax zone from store. <br>
+&nbsp;14. Add the fields froogle_type, upc, isbn, manufacturer_product_id to products table and
+products edit screen. (not completed in this version)<br>
+&nbsp;15. add froogle specific fields for books, music, video to a separate table.(not completed in this version)<br>&nbsp;
+</td>
+</tr></span></font>
+<tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_frooglebacisgettingstarted.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_frooglebacisgettingstarted.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_frooglebacisgettingstarted.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Getting started with Froogle
+
+There are 7 main steps to send your first Froogle feed</b><br>
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+<br>
+&nbsp;Step 1: Sign in to the Froogle Merchant Center
+Create or use an existing Google Account to enter the Froogle Merchant Center.
+
+You must go to
+<a href="https://www.google.com/froogle/merchants/welcome">https://www.google.com/froogle/merchants/welcome</a>
+
+From here there is a link to &quot; create an account now. &quot;
+
+You need to follow these pages and signup for a new account if you do not have one.<br>
+<br>
+&nbsp;Step 2: Create an FTP account
+:<br>Set up your FTP account, which you'll use to upload your feeds to us.
+Do this in your froogle merchant account
+
+<br><br> &nbsp;Step 3: Specify your feed's settings in the catalog admin:<br>
+Log into your stores admin and go to the  Data Input Output Systems box in the left hand
+column. From here you will see the feeds main screen. You can either click on the run bottom
+next to configure or click on the data configure in the left hand column.  These setting are
+transferred to the froogle admin in the cart
+
+<br><br> &nbsp;Step 4: Set Categories in the catalog admin:
+<br>Once you have setup the configuration you will need to return to the &quot;Data Feeds&quot; screen. Here
+you will need to build your categories for the feed. Since this is a intense process  it is a separate step.
+You need to do this once and then again only if you change your categories.
+It was done this way for larger stores to reduce processing time.
+<br><br>
+&nbsp;Step 5: Pre Feed Process in the catalog admin:
+<br>This set will Build the actual file for submission to Froogle. If this process take more then
+60 Second then you have a medium to large store or there is a problem. Compared the feed
+you built in the step to the sample one called /doc/sample_text.txt in the contribution.
+
+<br><br> &nbsp;Step 6: Submitting the feed in the catalog admin:
+<br>There are two methods to submit the feed to Froogle. The first is via direct FTP, this is where the FTP information you
+entered into the configuration is used and the feed file is sent directly to Froogle. Or you down load the feed
+and FTP from your local computer to froogle.
+<br><br>
+&nbsp;Step 7: Check your feed for errors:<br>
+Sign in to your Froogle Merchant Center account to check for any formatting errors in your feed.
+Log back into your merchant account at Froogle<br><br>.
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_froogleconfigure.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_froogleconfigure.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_froogleconfigure.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,103 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Configuring Froogle feed</b> </td>
+  </tr><br><br>
+<tr>
+ <td>
+<br>1. <b>List of Configurations</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_new_config.png" border="0" ><br>
+ You will start off by going to the list of configuration. This list all the data feed configurations
+for your store. If you have not done any configuration then there will be none in this list. You must have
+at least one configuration setup.<br>
+ To start a new configuration click on the new button under the list of configurations.
+<br>
+ </td>
+</tr>
+<tr>
+ <td>
+<br>2. <b>Configuration:</b> <br>
+
+ For a new configuration fill in all text boxes and check boxes of the check boxes except active.
+ The click on insert. Once the information has been inserted in to the database<br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ </td>
+</tr>
+<tr>
+
+ <td>
+<br>&nbsp;3.  Settings and what they mean:
+<br>&nbsp;&nbsp; a. Name of Feed
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the name of the feed
+as it will appear in the drop down boxes when data feed<br>&nbsp;&nbsp; b. Product Feed Type
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: Basic&nbsp;or
+Advance Only basic is available.&nbsp;<br>&nbsp;&nbsp; c. Data Feed Discription
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A short description of the feed
+configuration<br>&nbsp;&nbsp; d. Data Feed File Type
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: none,
+products, business. For this you should choose product as the business feed
+is not yet in this package.&nbsp;&nbsp;<br>&nbsp;&nbsp; e. Feed Service
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: Froogle, Yahoo
+&nbsp;Choose Froogle, as Yahoo feed service has not been added.<br>&nbsp;&nbsp; f.
+Status  Set <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings:&nbsp;Active  Inactive
+For a new feed do not change this, until after your first insert.
+<br>&nbsp;&nbsp; g. File name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the file name you chose
+when you did your set up at Froogle.<br>&nbsp;&nbsp; h. Image URL
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you use a image url other then the
+default one for CRE Loaded then enter it here from the /images directory<br>&nbsp;&nbsp; i.
+Froogle FTP information
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Froogle FTP Server Name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP server usually https://</span></font>hedwig.google.com<font face="Arial"><span style="font-size:10pt;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.   Froogle FTP User Name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP User Name&nbsp;you chose at froogle<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.    Froogle FTP Password<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP password you chose at froogle<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.   Froogle FTP Directory<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP Directory&nbsp;you chose at froogle<br>&nbsp;&nbsp; g. Froogle Advance Settings
+<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;1. Use store Currency <br>       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;possible
+setting: False: Use store default current,  True: Use currency listed below
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you
+choose false then the store currency will be used. if you choose true the enter
+a single currency below&nbsp;&nbsp;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;2. Other currency<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If above was
+True list a currency here&nbsp;currency<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;3.
+Convert Currency<br>      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible
+settings:False: Do not convert to currency  True: Convert currency
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is used
+if you wish to convert between currencies when a customer enters your store.<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;4.
+Use store language<br>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible
+settings: False: Use store default language  True: Use language selected below
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you choose
+false then the store language&nbsp;will be used. if you choose true the enter
+a single language&nbsp;below<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;5. Other language<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If above was True
+list a list language code here<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.&nbsp;Tax Class ID<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font>Enter the tax class ID number from the store or set to zero (0) for no tax calculation<font face="Arial"><span style="font-size:10pt;"><br></td>
+</tr>
+
+ <tr>
+ <td>
+<br>Once you have finished with the configuration and either Inserted or saved
+it the click on froogle again in the side box. This will take you to the main
+run screen.<br></td>
+</tr>
+
+ <tr>
+ <td><br>&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_froogleconfigure1.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_froogleconfigure1.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_froogleconfigure1.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_import.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is entended for backward compatibility with previous version of Easy Populate.
+This version has been reorginized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatable with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPB format. This is
+the products_model is the first column in the upload file. The file should have EPB as the first
+three characters in its file name or none at all.
+
+Click on the browse button to browse your local computer for the file to upload and insert.
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. Also
+EP usually will only imports 400 to 500 lines of products, this version can do 2,000 plus.
+If a file it to large to upload because of PHP restrictions the FTP the file to the site and use
+"Import Data from file in temp/"
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Although it may not be needed, EP basic upload and split is available. Use the browse button
+to browse you local files and select the ile for uploading.  It will be spilt into files
+limited by the configure setting $maxrecs as set in the epconfigure.php file.
+Each file name will be dated with the date the split was created.
+ </td>
+</tr>
+<tr>
+ <td>
+<b>List of Configurations</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_start.png" border="0" ><br>
+ You will start off by ging to the list of configuration. this list all the data feed configurations
+for your store. If yo have not done any configuration then there will benone in this list. You must have
+at least one configuration setup.<br>
+ To start a new configuration click on the new button under the list of configurations.
+<br>
+ </td>
+</tr>
+<tr>
+
+<tr>
+ <td>
+<b>Configuration:</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ For a new configuration fill in all text boxes and check ll of the check boxes except active.
+ The click on insert. Once the information has been inserted in to the database<br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ </td>
+</tr>
+<tr>
+
+ <td>
+<br>&nbsp; Add New Feed Setting
+<br>&nbsp;&nbsp; Name of Feed
+<br>&nbsp;&nbsp; Product Feed Type
+<br>&nbsp;&nbsp; Data Feed Discription
+<br>&nbsp;&nbsp; Data Feed File Type
+<br>&nbsp;&nbsp; Feed Service
+<br>&nbsp;&nbsp; Status   Set Active  Inactive
+<br>&nbsp;&nbsp; File name
+<br>&nbsp;&nbsp; Image URL
+<br>&nbsp;&nbsp; Froogle FTP information
+<br>&nbsp;&nbsp;&nbsp;&nbsp; Froogle FTP Server Name
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP User Name
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP Password
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP Directory
+<br>&nbsp;&nbsp; Froogle Advance Settings
+<br>&nbsp;&nbsp; Use store Currency         False: Use store default current  True: Use currency listed below
+<br>&nbsp;&nbsp; Other currency
+<br>&nbsp;&nbsp; Convert Currency       False: Do not convert to currency  True: Convert currency
+<br>&nbsp;&nbsp; Use store languge        False: Use store default language  True: Use language selected below
+<br>&nbsp;&nbsp; Other languge
+<br>&nbsp;&nbsp;Tax Class ID
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_frooglerun.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_frooglerun.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_frooglerun.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Run Froogle feed</b> </td>
+  </tr><br><br>
+<tr>
+ <td>
+<br><b>1. Main run screen</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_start.png" border="0" ><br>
+If you have not built at least one configuratin do so now.
+</td>
+</tr>
+<tr>
+ <td>
+<b>2. Configuration:</b> <br>
+ </span></font>Configure: &nbsp;Build or edit unique configuration click
+on the run button to add or edit feed configuration(s). You must have at least
+one feed<br>configuration<br><br>
+ </td>
+</tr>
+<tr>
+ <td>
+<b>3. </span></font>Set Categories:<br> </b>&nbsp;This process can be intense
+for medium to large stores. You should only run this before the first feed and
+if you change any categories. You do not need to run this proccess every time<font face="Arial"><span style="font-size:10pt;"><br>
+ <br></td>
+</tr>
+<tr>
+ <td>
+<b></span></font> 4.&nbsp;Pre Feed Process:<br></b> &nbsp;You will run this
+every time you do a feed. This step build the actual feed file for you. It is
+a good Idea for your month feed to run this before submitting.<font face="Arial"><span style="font-size:10pt;"><br><br><b>&nbsp;</b></td>
+</tr>
+<tr>
+ <td>
+</span></font><b> &nbsp;5. &nbsp;Submit Feed:</b><br>&nbsp;
+If you wish to  have the feed sent directly to the FTP server at Froogle you will
+run this step. You must have the Froogle FTP information entered into the
+configuration<br><br><font face="Arial"><span style="font-size:10pt;"><br></td>
+</tr>
+
+ <tr>
+ <td><br>&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_import.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_import.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_import.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,87 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_start.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPA</b>
+ </td>
+</tr>
+<tr>
+ <td>
+The changes here are in the handling of HTML content in descriptions; image path URL's,
+and EP import filename requirements. You may now import files with html in the text
+fields and not have it mangled by EP or Excel.  URL's for images in subdirectories
+can be handled and correctly written to the database.   Beginning with 2.75, EP
+Advanced will not install files unless it begins with EPA,and EP Basic will not
+install files that begin with EPA.  This feature is to protect the database from
+errors related to a new column added to the Easy populate file format.  EP Advanced
+uses the product_id column, this allow for more features to be added.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPA format. This is
+the products_id is the first column in the upload file. The file should have EPA as the first
+three characters in its file name. If it does not then most likely you should use EP basic to import the file.
+<br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_uploaded_insert.png" border="0" ><br><br>
+
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. EPA will import
+more then 2,000 rows in one file, unlike older version that were limited to 300 to 400 maximum. If the file is larger then
+the limit set by PHP then you must upload the file via FTP then use the "Import Data from file in temp/' to import the data.
+If the file is still to large you can split it on the server by using "Split a EP File on the server". The list of files
+in the drop down is fileter so EPB file are not show. and file that are already spilt will not show.
+
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+This routine incorporates the same changes noted above for import files.  If for some reason
+you need to split you upload file into smaller parts then you can use this feature. Most site should
+not need to split files any more.
+ </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_uploaded_results.png" border="0" ><br><br>
+
+ The upload results now apear below the insert screen.<br><br>
+
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_delete.png" border="0" ><br><br>
+ Since you now can delete records the message will apear as above when a recored is deleted.<br>
+
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_intro.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_intro.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_intro.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,195 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<font face="Arial"><span style="font-size:10pt;"><tr>
+ <td>
+</span></font><p align="center"><b><span style="font-size:10pt;"><font face="Arial">Data Feed Input/Output Introduction</font></span></b></p>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;<b> 1. Introduction:</b> Data feed service is a collection of contributions to allow you to updated
+your products and categories data remotely, and send that data to data listing
+services. It uses a number of contributions that have been modified to work
+better with small, medium, and large stores. </span></font></p>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp; <b>2. Goals:</b><br>The typical store owner never needs to edit a code or define file directly.The store
+owner does not need a lot of support on how to use program.Combines the functions
+of moving data in and out of store is in one area. Make it flexable enough for
+small, medium and large store to use program effectivly. Move program files closer
+to OSC/Cre Loaded standerds for look and feel, and codeing.<br><br>
+&nbsp; <b>3. Parts of Data Feed Service:</b><br>
+Easy Populate Advance enhanced by Tom O'Neill<br>
+Easy Populate Basic enhanced by Tom O'Neill<br>
+Froogle data feed : Calvin K<br>
+&nbsp;Salemaker for froogle feed: by Marcel van Lieshout<br>
+&nbsp;Admin for Data Feed : Tom O'Neill<br><br>
+&nbsp;&nbsp;a. Easy Populate: This is used to update product and category data, it allows
+you to updated data remotely on your&nbsp;local computer and upload to the data
+to your on line store.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;1. Easy Populate Advance<br>
+&nbsp;&nbsp;&nbsp;&nbsp;Easy Populate Advance
+uses products_id instead of products_model to tie the rows in the Import/Export
+file to your database. This is significate since you now can delete items, asigning
+products to multiple categories, refine export files to select records you need
+to edit/update There also has been asignificant speed and record handling capibilities
+added to both Advance and Basic version. The numbers below are from recent test
+done, previously Easy populate could only handle 300 to 400 records max.
+
+<br>
+&nbsp;&nbsp;&nbsp; 2. Easy Populate Basic<br>
+ Easy Populate basuc is for back ward compatiblity with  EP 2.XX version of Easy populate.
+This is because EP used modle numbers to tie you file  back to the database. Where in the advance
+version it used product_id.<br>
+
+&nbsp;&nbsp;&nbsp;3. Increase in speed and record handling<br></span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;&nbsp;&nbsp;&nbsp;  a. Using only stock products<br>
+export EPB ~ 32 records 0.173231 seconds file size 26kb<br>
+import EPB ~32 records 1.844497 seconds file size 26kb<br>
+export EPA~ 32 records 0.790210 seconds file size 26kb<br>
+import EPA~ 32 records 1.759426 seconds file size 26kb<br>
+&nbsp;&nbsp;&nbsp;&nbsp;  b. Using 2033 products in a single file<br>
+import EPA 89.927511 second &nbsp;or 1 minute 30 sec file size 2.800 KB<br>
+import EPB 456.582260 second &nbsp;or 7 minutes and 36 sec file size 3,423 KB<br>
+&nbsp;&nbsp;&nbsp;&nbsp;  c. Deleting products:2033 products added<br>
+delete EPA 68.877599 seconds File size was 2,875 KB<br>
+EPB cannot delete records.&nbsp;<br><br>
+&nbsp;b. Data feed:<br>
+&nbsp;&nbsp;Data feed takes the data with in your catalog and prepares it for submission to a feed &nbsp;service and send it to the feed
+service either automaticly or manualy if you need on completion&nbsp;of building the feed.<br>&nbsp;<br>
+&nbsp;c. For EP set up:<br><br>
+&nbsp;&nbsp; The setup information for Easy Populate is stored in admin/epconfigure.php. This
+configuration is for both Easy Populate Basic and Easy Populate Advance. <br><br>
+&nbsp; d. For Data feeds setp up:<br>
+Step 1 <br>
+&nbsp;To set up this modules data feed service, Review the 7 steps to your first feed. It outlines
+what steps you need to take to do a feed. It will take you through the configuration process to the uploading and checking of the feed.<br>
+&nbsp;Step 2<br>The you will need to configure and run the data feeds this
+is described in the running doc/configureandrun.txt document The file feild_spec.txt
+describes the limitation of what can be placed into each felid<br><br>
+</span></font></p>
+ <font face="Arial"><span style="font-size:10pt;"> </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">
+ &nbsp;3. Error and staus messages</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will apear near the top of the for, Blue background
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_mesg.png" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Import result</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now apear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Help while using the admin screens</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or imput you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+<tr>
+ <td><br><br><b> 5. Features added and changes to basic programs.</b><br> &nbsp;&nbsp;<br>&nbsp;Easy
+populate 2.75 Advance to 3.01:<br>
+&nbsp;&nbsp;&nbsp;1. Removed the froogle feed from this
+contribution. The froogle function is now &nbsp;handled by seperate code files.<br>
+&nbsp;&nbsp;&nbsp;2. Moved EP from catalog side box to Data Input/Output System side box.<br>
+&nbsp;&nbsp;&nbsp;3. Moved function file to admin/includes/function directory to follow OSC standerds.<br>&nbsp;&nbsp;&nbsp;4.
+Moved most simple function to function file, export now has all functions removed
+. There is now only one function left in the EPA import file. <br>
+&nbsp;&nbsp;&nbsp;5. Redid admin screens so it was more like the rest of the OSC admin. .<br>
+&nbsp;&nbsp;&nbsp;6. Inserted tep form function rather then html form function. <br>&nbsp;&nbsp;&nbsp;7. Added
+popup help for informtion on how to use EPA.<br>
+&nbsp;&nbsp;&nbsp;8. Easy Populate Basic is for backward compatibility with older versions of EP<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EP advance will import all EPA files of previous version of EPA. <br>
+&nbsp;&nbsp;&nbsp;9. Export screen and Import screen seperated into two seperate files<br>
+&nbsp;&nbsp;&nbsp;10. Side box changed, so that sub titles are offset.<br>
+&nbsp;&nbsp;&nbsp;11. Added date time to split so each group of splits will be unique and old splits will &nbsp;not be
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>
+&nbsp;&nbsp;&nbsp;12. Program message, error, and output were place in one of three variable so they
+could be outputed&nbsp;with in the html output section of the files.<br> <br>Easy
+Populate Basic 2.75 Basic to 3.01:</span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;&nbsp;&nbsp;1. Easy Populate Basic is for backward compatibility with older versions of EP<br>
+&nbsp;&nbsp;&nbsp;2. Added date time to split so each group of splits will be unique and old splits will&nbsp;not be
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>
+&nbsp;&nbsp;&nbsp;3. Program message, error, and output were place in one of three variable so they
+could be outputed&nbsp;with in the html output section of the files.<br>
+&nbsp;&nbsp;&nbsp;4. Removed the froogle feed from this contribution. The froogle function is now &nbsp;handled by seperate code files.<br>&nbsp;&nbsp;&nbsp;5.
+Moved EP from catalog side box to Data export/import side box.<br>
+&nbsp;&nbsp;&nbsp;6. Moved function file to admin/includes/function directory to follow OSC standerds.<br>
+&nbsp;&nbsp;&nbsp;7. Moved most simple function to function file, export now has all functions removed .. <br>
+&nbsp;&nbsp;&nbsp;8. Redid admin screens so it was more like the rest of the catalog. and EPA<br>
+&nbsp;&nbsp;&nbsp;9. Inserted tep form function rather then html form function (Inprogress)<br>
+&nbsp;&nbsp;&nbsp;10. Added popup help for informtion on how to use EPB.<br><br>&nbsp;Items
+fixed or enhanced from Ep 2.74 to 2.75 Advance:<br>
+&nbsp;1. To add products the product id should be set to 0, there can be many 0's for product ID's.<br>
+&nbsp;2. You no longer need to change the manufacturers table to change a manufacturers_id
+first&nbsp;manf id to 1 or 0<br>
+&nbsp;3. No longer adds a empty product, caused by not treating the last line as not product.<br>
+&nbsp;4. Added EP Basic, It cannot install any EP Advanced files since they start with EPA a error<br>
+&nbsp;&nbsp;&nbsp;&nbsp;message
+will be displayed. It can install any file that strts wil EPB or older EP files<br>
+&nbsp;5. EP Advanced set up so it can only read files that start with EPA , prevents
+reading older files.<br>
+&nbsp;6. Delete has been added back into EP for products
+only. &nbsp;This is implemented via a new column call v_action. You must type
+the word &quot;delete&quot; in this column to delete a product.<br>
+&nbsp;7. EP basic was not showing on some site this was to an error in the install of
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>
+&nbsp;8. You can add your own product ID, If your product ID's are based on a system
+other than&nbsp;numbers generated by the shopping cart and autoincremented by
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows
+for compatibility with some external inventory management systems.<br>&nbsp;
+9. moved configuration of EP to a seperate file called epconfigure.php <br><br>
+&nbsp;Data Feed:<br>
+&nbsp;1. Added language files<br>
+&nbsp;2. Multiple configurations for multiple feed services now available through admin screen<br>
+&nbsp;3. Configuration configured in admin rather then edit a file.<br>
+&nbsp;4. Feed submission now A multiple step process.<br>
+&nbsp;5. Switched to tep functions for data base queries.<br>
+&nbsp;6. Split file generation and FTP code into two separate files.<br>
+&nbsp;7. Combined Froogle, Yahoo and Bizrite into one package (Not all installed and adapted yet)<br>
+&nbsp;8. added fields for advance feed to products database<br>
+&nbsp;9. added separate sql file for additional info for froogle feed<br>
+&nbsp;10. Builds Category strings before building feed file.<br>
+&nbsp;11. Help popups added to admin screens.<br>
+&nbsp;12. Added salemaker contribution pricing to price sent to price in feed.<br>
+&nbsp;13. Uses tax zone from store. <br>
+&nbsp;14. Add the feilds froogle_type, upc, isbn, manufacturer_product_id to products table and
+products edit screen.<br>&nbsp;
+15. add froogle specific feilds for books, music, video to a seperate table.<br>&nbsp;
+</td>
+</tr></span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+?>
+<tr>
+ <td>
+<p align="center"><b><span style="font-size:16pt;">Data Feed Input/Output Introduction</span></b></p>
+<p>Data feed service is a collection of contributions to allow you to updated 
+your products and categorys data remotely, and send that data to data listing 
+services. It used a number of contributions that have been modified to work 
+with small, medium, and large stores. </p>
+<p>Contributions:<br>Easy Populate Advance by Tom O'Neill<br>Easy Populate Basic<br>Froogle 
+data feed : Calvin K<br> &nbsp;&nbsp;&nbsp;Salemaker for froogle feed: by<br> 
+&nbsp;&nbsp;&nbsp;Admin for Froogle Data Feed : Tom O'Neill<br><br> Goals:<br>The 
+typical store owner never needs to edit a code or define file directly.The store 
+owner does not need a lot of support on how to use program.Combines the functions 
+of moving data in and out of store is in one are.Make it flexable enough for 
+small, medium and large store to use program effectivly.Move program files closer 
+to OSC/Cre Loaded standerds for look and feel, and codeing.<br><br>Parts of 
+Data Feed Service:<br>&nbsp;Easy Populate: This is used to update data it allows 
+you to updated data remotely on your&nbsp;local computer and upload to the data 
+to your on line store. It allows you to&nbsp;&nbsp;build custom queries for 
+the data then download the information to your local computer&nbsp;&nbsp;for 
+editing, Then upload back to your &nbsp;on-line store.</p>
+<p>&nbsp;Data feed:<br>&nbsp;&nbsp;Data feed takes the data with in your catalog 
+and prepares it for submission to a feed &nbsp;service and send it to the feed 
+service either automaticly or manualy if you need on completion&nbsp;of building 
+the feed.<br>&nbsp;Features added and changes to basic programs.<br> &nbsp;&nbsp;&nbsp;Easy 
+populate 2.75 Advance to 2.78:<br>&nbsp;1. Removed the froogle feed from this 
+contribution. The froogle function is now &nbsp;handled by seperate code files.<br>&nbsp;2. 
+Moved EP from catalog side box to Data export/import side box.<br>&nbsp;3. Moved 
+function file to admin/includes/function directory to follow OSC standerds.<br>&nbsp;4. 
+Moved most simple function to function file, export now has all functions removed 
+. There is now only one function left in the EPA import file. <br>&nbsp;5. Redid 
+admin screens so it was more like the rest of the catalog.<br>&nbsp;6. Inserted 
+tep form function rather then html form function (Inprogress)<br>&nbsp;7. Added 
+popup help for informtion on how to use EPA.<br>&nbsp;8. Easy Populate Basic 
+is for backward compatibility with older versions of EP<br>&nbsp;&nbsp;&nbsp;&nbsp;EP 
+advance will import all EPA files of previous version of EPA. <br>&nbsp;9. Export 
+screen and Import screen seperated into two seperate files<br>&nbsp;10. Side 
+box changed, so that sub titles are offset.<br>&nbsp;11. Added date time to 
+split so each group of splits will be unique and old splits will&nbsp;not be 
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>&nbsp;12. 
+Program message, error, and output were place in one of three variable so they 
+could be outputed&nbsp;with in the html output section of the files.<br> &nbsp;&nbsp;<br>&nbsp;Items 
+fixed or enhanced from Ep 2.74 to 2.75 Advance:<br>&nbsp;1. To add products 
+the product id should be set to 0, there can be many 0's for product ID's.<br>&nbsp;2. 
+You no longer need to change the manufacturers table to change a manufacturers_id 
+first&nbsp;manf id to 1 or 0<br>&nbsp;3. No longer adds a empty product, caused 
+by not treating the last line as not product.<br>&nbsp;4. Added EP Basic, It 
+cannot install any EP Advanced files since they start with EPA a error<br>&nbsp;&nbsp;&nbsp;&nbsp;message 
+will be displayed. It can install any file that strts wil EPB or older EP files<br>&nbsp;5. 
+EP Advanced set up so it can only read files that start with EPA , prevents 
+reading older files.<br>&nbsp;6. Delete has been added back into EP for products 
+only. &nbsp;This is implemented via a new column call v_action. You must type 
+the word &quot;delete&quot; in this column to delete a product.<br>&nbsp;7. 
+EP basic was not showing on some site this was to an error in the install of 
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>&nbsp;8. 
+You can add your own product ID, If your product ID's are based on a system 
+other than&nbsp;numbers generated by the shopping cart and autoincremented by 
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows 
+for compatibility with some external inventory management systems.<br>&nbsp;9. 
+moved configuration of EP to a seperate file called epconfigure.php <br><br>&nbsp;Data 
+Feed:<br>&nbsp;1. Added language files<br>&nbsp;2. Multiple configurations for 
+multiple feed services now available through admin screen<br>&nbsp;3. Configuration 
+configured in admin rather then edit a file.<br>&nbsp;4. Feed submission now 
+A multiple step process.<br>&nbsp;5. Switched to tep functions for data base 
+queries.<br>&nbsp;6. Split file generation and FTP code into two separate files.<br>&nbsp;7. 
+Combined Froogle, Yahoo and Bizrite into one package (Not all installed and 
+adapted yet)<br>&nbsp;8. added fields for advance feed to products database<br>&nbsp;9. 
+added separate sql file for additional info for froogle feed<br>&nbsp;10. Builds 
+Category strings before building feed file.<br>&nbsp;11. Help popups added to 
+admin screens.<br>&nbsp;12. Added salemaker contribution pricing to price sent 
+to price in feed.<br>&nbsp;13. Uses tax zone from store. <br>&nbsp;14. Add the 
+feilds froogle_type, upc, isbn, manufacturer_product_id to products table and 
+products edit screen.<br>&nbsp;15. add froogle specific feilds for books, music, 
+video to a seperate table.<br><br>&nbsp;For EP set up:<br>&nbsp;For Data feeds 
+setp up:<br>Step 1 <br>&nbsp;To set up this modules data feed service, you must 
+first register with the feed services you wish to use.&nbsp;This is described 
+in the getting started document. It has links to the feed services &nbsp;and 
+what you need to set up the configuration of each service.<br>Step 2<br>Next 
+you need to install this contribution this is disturbed in the doc/install.txt 
+files<br>Step 3<br>The you will need to configure and run the data feeds this 
+is described in the running doc/configureandrun.txt document The file feild_spec.txt 
+describes the limitation of what can be placed into each felid<br><br>&nbsp;Known 
+bugs:<br>&nbsp;&nbsp;1. PHP 5 compatability for import. the problem is either 
+how globals are treated or&nbsp;&nbsp;how arrays are used in this contribution<br></p>
+ </td>
+</tr> 
+<tr>
+  <td>
+ <b>Error and staus messages</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will apear near the top of the for, Blue background 
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_msg.gif" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ <b>Import result</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now apear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ <b>Help while using the admin screens</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or imput you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
+

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_spreadsheet.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_spreadsheet.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/data_spreadsheet.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td class="helpMain">
+
+
+<b><span style="font-size:14pt;">How to do specific task with the files in Easy Populate Advance:</span></b><br><br>
+Index:
+<br><b><a href="#1. Adding new products:">1. Adding new products:</a>
+<br><a href="#2. Adding linked products">2. Adding linked products</a></b>
+<br><b><a href="#3.Deleting products">3. Deleting products</a></b>
+<br><b><a name="4. Move a product to a new category:" href="#4. Move a product to a new category:">4. Move a product to a new category</a>
+<br><a href="#5. Reducing size of import file:">5. Reducing size of import file</a><br><a href="#6. Your first import file">6. Your first import file&nbsp;</a></b><a href="#6. Your first import file">
+</a><p>
+&nbsp;&nbsp;<b><a name="1. Adding new products:">1. Adding new products:</a>
+(</b>These procedures are for EPA only)<br> &nbsp;&nbsp;&nbsp;&nbsp;a. Because
+EPA uses the product_ID to link to your products in the database and EPB still
+uses model numbers many of the additional features for EPA cannot be added to
+EPB. &nbsp;EPB is used for backward compatibly to older versions of EP.<br>
+&nbsp;&nbsp;&nbsp; b. To add products the product_id should be 0, there can be many 0's for product ID's
+  as needed. The code will detect the 0 as a new product and auto increment the
+  products_id.
+  <br>
+
+&nbsp;&nbsp;&nbsp;  c. If the products_id number is left blank then the product is not added. You can also
+  insert you own product_ID. they do not have to be sequential. <br>
+
+&nbsp;&nbsp;&nbsp;  d. If you need to specify your own unique products_ID, and it does not exist in the data
+  base it will be added as a new product. Make sure you add the correct categories,
+  other wise you will need to use the move product to a new category procedure.
+<br>
+Example:
+<br>
+I have a previous inventory software that has already assigned product ID's they are
+<br>
+12001<br>
+15001<br>
+14<br>
+2000<br>
+<br>
+These can be used by simply putting the in the v-product_id column.
+<br><br> &nbsp;&nbsp;e. A Product_id must be a number, this is done so the admin
+products edit/add for will work.<br><br>
+&nbsp;&nbsp;<b><a name="2. Adding linked products">2. Adding linked products</a></b><a name="2. Adding linked products"> </a><br>(Yes Version 3.01 can handle linked products):
+A linked product is having one product record set, but having it show in multiple
+categories.
+<br>
+&nbsp;&nbsp;&nbsp;  a. For a product you want to link to another category
+Create a download using complete or model/category in the  Select fields to download
+you can limit the list by using the filter settings.
+<br>
+&nbsp;&nbsp;&nbsp;  b. Import into the spread sheet program.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 1. Copy the original product line to a new line<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 2. Change only category information where you want the product linked to.
+    Leaving the v_product_id unchanged.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 3. Save the file and re upload<br>
+<br>
+&nbsp;&nbsp;<b><a name="3.Deleting products">3.Deleting products</a></b> (This has been added back for products only):
+<br>&nbsp;&nbsp;&nbsp;  a. Single product not linked
+<br>
+&nbsp;&nbsp;&nbsp;  Download any of the files that has a products_id's. You will notice a column called v_action
+all the way to the left. In this column add delete for each product you which to delete.
+<br>
+&nbsp;&nbsp;&nbsp;  b. Deleting linked product:
+ Do a download that has all of the links for the product
+cut the paste the item you which do remove in front of the product links to remain.
+In the v_action column enter delete for the link you want to remove.
+<br>
+Note: the deleted item must be listed first. The product to remain must be list after the
+product link you are deleting.
+<br><br>
+&nbsp;<b>&nbsp;<a name="4. Move a product to a new category:">4. Move a product
+to a new category:</a></b><br> Moving a product between two categories
+  In the spread sheet program
+<br>&nbsp;&nbsp;&nbsp;   1. copy the line for the product to a new line
+<br>&nbsp;&nbsp;&nbsp;   2. on the original line type in delete in the v_action column
+<br>&nbsp;&nbsp;&nbsp;   3. on the new line change the categories
+<br>
+&nbsp;<br><b><a name="5. Reducing size of import file:">5. Reducing size of
+import file</a></b><br>Removing columns in the spread sheet.
+Due to how Ep was designed you do not need all of the column from the export file to be present
+in the import file.
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   1. Minimum columns:
+<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;a.   products_id, v_status, v_action, EOREOR
+ If you have product information: any or all by products_id can be removed
+<br>&nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;b. If you have meta tags or header tags installed make sure you leave the set together  If you have product information: any or all by products_id's can be removed
+<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;c. If you have category information: any or all of the unused category_ columns.<br>
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Caution: EP reads a product record set from you data base, then merges&nbsp;data
+from the import file. &nbsp;If the column you removed from the export file is
+not in this beginning query then that column will be removed from the data base.
+&nbsp;Example: previously if you removed one of the ultra images fields it would
+delete all data from that column in the products database. &nbsp;Not this bug
+has been fixed for ultra images, but it is something to keep in mind when constructing
+new export files.<br><br>
+<b><a name="6. Your first import file">6. Your first import file</a></b>
+<br>  &nbsp;&nbsp;a. When you first start to load a store with products it is usually easier to
+set up you category structure in the admin before you begin<br> &nbsp;&nbsp;b.
+Back up your data base!!!!. <br>
+
+&nbsp;&nbsp;c. Export a complete download so you have all of the headers in the export file.<br>
+&nbsp;&nbsp;d. Start your spread sheet program and click on the open file.
+<br> &nbsp;&nbsp;e. Navigate to the directory on your local computer where the export file resides. Make
+sure you change the file type, in the open file dialog to &quot;text CVS,txt&quot;. If you do not all of the information in the
+text file will be read into one cell of the spreadsheet program.
+
+<br> &nbsp;&nbsp;f. Single (')  and double quotes (&quot;) , MYSQL has problem when you try to insert reserved characters.
+I can cause error when trying to import then into your database. There are two ways to
+handle these
+  <br> &nbsp;&nbsp;&nbsp;&nbsp;1. Escape the character Example: There\'s Something About Mary
+  <br> &nbsp;&nbsp;&nbsp;&nbsp;2. Use decimal equivalent of the character Example: There&amp;#39s Something About Mary
+&nbsp;&nbsp;
+EPA and EPB can read both of these and correctly inserts the MYSQL compatible character
+so single and double quotes are displayed correctly in the catalog. Even if
+you choose not to use either of these methods EPA and EPB will read the single
+and double quotes and convert then as needed.<br>
+
+&nbsp;&nbsp;g. Product descriptions: You can draft these with an external HTML
+editing program or word processor, but you must be careful which one you use.<br>
+&nbsp;&nbsp;Most MS products used proprietary formats that may not be compatible
+with most web browsers in use today.<br> &nbsp;&nbsp;h. When you save the spread
+sheet file the first time use the save as function instead of the save function.
+change the name to something different, in the file type make sure it is &quot;text CVS,txt&quot;.
+This will preserve the original file in case you already had product in it. This
+is done so that you can recover form possible errors.&nbsp;<br> &nbsp;&nbsp;i.
+For new products use the product use the product_id of 0 if you wish the cart
+to set you product id's or entry and number op to 15 digits you want.<br> &nbsp;&nbsp;j.
+Do one final save making sure the file type is &quot;text CVS,txt&quot;., then
+go to your cart in import the file.<br><br></td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp;  <a href="data.php?selected_box=data"><img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_export_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_export_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_field_group.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_field_group.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_add.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_add.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_delete.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_delete.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_split.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_split.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_uploaded_insert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_uploaded_insert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_uploaded_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_import_uploaded_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_limit_cat.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_limit_cat.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_limit_man.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_limit_man.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_limit_prodid.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_limit_prodid.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_sel_export.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_sel_export.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_sortorder.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_sortorder.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epa_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export_mesg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export_mesg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export_sel_feld.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export_sel_feld.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export_sel_loc.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_export_sel_loc.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_import.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_import.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_import_mesg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_import_mesg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_import_select.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/epb_import_select.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_config.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_config.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_config1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_config1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_new_config.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_new_config.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/feed_froogle_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_catbuild.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_catbuild.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_catbuilddone.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_catbuilddone.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_feedbuilddone.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_feedbuilddone.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_feedsend_error1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/froogle_feedsend_error1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/import_results.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/import_results.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/item_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/ep/images/item_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_edit_file.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_edit_file.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_edit_restore.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_edit_restore.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_list.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_list.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_search_t_before.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_search_t_before.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_search_t_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_search_t_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_searcht.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_file_searcht.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_select_lng.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_select_lng.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_dir.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_dir.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_file.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_file.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_insert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_insert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_lngr.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_lngr.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_lngr_grem.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/images/lng_selt_lngr_grem.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)<br><br>
+
+&nbsp;&nbsp;<b>Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<!-- Begin help search index1.html-->
+
+&nbsp;&nbsp;<b>Edit Help Page Index:</b><br>
+<UL>
+<LI><A HREF="#HOW">How Search Works</A></LI>
+<LI><A HREF="#SEARCH_FILE">Searching for a file name</a></LI>
+<LI><A HREF="#SEARCH_DEFINE">Searching for text within a file.</A></LI>
+</UL>
+<H3><A NAME="HOW">How Search Works</H3></a><br>
+&nbsp;&nbsp; You can search one of two ways depending on wich edit screen you are on.
+you can search for file names of test within the Languages define file. Search
+will detect which screen you are on either the a directory/file screen, or a Language Define Edit Screen.
+It will switch the between file and define search logic automaticly for you. <br>
+
+<H3><A NAME="SEARCH_FILE">Where Are the define located</H3></a><br>
+
+&nbsp;&nbsp;1. includes\languages  ~   In this directory all of the base define files reside. a base define file is common to more then one group of output screen.
+<br>&nbsp;&nbsp;2. includes\languages\(Langauge Name) ~ this is where the bulk of the language defines reside
+<br>&nbsp;&nbsp;3. includes\languages\(Langauge Name)\images ~  Unique images the are language dependent. Except for buttons
+<br>&nbsp;&nbsp;4. includes\languages\(Langauge Name)\modules ~ Specific to file that are in the includes/modules directory
+<br>&nbsp;&nbsp;5. includes\languages\(Langauge Name)\modules\order_total ~ Specific to file that are in the includes/modules/order_total directory
+<br>&nbsp;&nbsp;6. includes\languages\(Langauge Name)\modules\payment ~ Specific to file that are in the includes/modules/payment directory
+<br>&nbsp;&nbsp;7. includes\languages\(Langauge Name)\modules\shipping~ Specific to file that are in the includes/modules/shipping directory
+<br>
+
+<br>&nbsp;&nbsp;8. Language file not adressed by language editor.
+<br>&nbsp;&nbsp;includes\modules\payment\paypal\languages\english\ipn.lng.php
+<br>&nbsp;&nbsp;includes\modules\payment\paypal\languages\english.php
+<br>&nbsp;&nbsp;All language file in admin
+<br>
+<H3><A NAME="SEARCH_FILE">Searching for a file name</H3></a><br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to Tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_edit_file.png" border="0" >
+
+<H3><A NAME="SEARCH_DEFINE">Searching for text within a file</H3></a><br>
+While you are in edit mode you can search for Define Display text but not the label.
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Enter the text in search box<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Click the search button<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. This will bring up a list of defines<br>
+
+Below is an example of before and after, this is more usfull for some of the larger define files.<br>
+
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_file_search_t_before.png" border="0" >
+<br>&nbsp;&nbsp; <b>Before  search </b><br>
+
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_file_search_t_results.png" border="0" >
+<br>&nbsp;&nbsp;<b> After  search </b><br>
+<!-- End help searh index1.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<!-- Begin help edit index.html-->
+&nbsp;&nbsp;<b>Search Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_edit_file.png" border="0" >
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Once you have navigated to the correct file to edit you then can edit the language defines.
+The intial edit screen is show above.</P>
+
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+
+<H3><A NAME="Edit">Editing Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Type in the new text<br>
+&nbsp;&nbsp; 2. Click on save next to the input box you just type in<br>
+&nbsp;&nbsp; 3. Double check your changes by viewing them in the cart.<br>
+&nbsp;&nbsp; 4. If they did not work or are incorrect, you can restore the previous text if change again in the editor<br>
+
+&nbsp; Note: you can only sabe changes for one input box at a time.<br>
+<H3><A NAME="RESTORE">Restoring Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Once you have saved the define your changes you can double check that it is correct. <br>
+&nbsp;&nbsp; 2. If it is not then you can click on the restore button to revert back to the previous langauge define.<br>
+
+
+<H3><A NAME="RESTORE">Restoring Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 2. Single qoute with variable : Advanced Search's <br>
+&nbsp;&nbsp; 3. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 4. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 5. Double qoutes: <br>
+
+
+
+<!-- End help edit index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<!-- Begin help index4.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Once you have finished editing a define, click on the save next to the define. This will
+save the edit you made. You will return to the define edit screen so you can check you changes if for some reason it is not
+correct you can click on the restore and this will revert the file back to what it was before the save.
+</P>
+<P>
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Saving a new define.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<!-- End help index4.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/et/index5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/authnet_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/authnet_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/authnet_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<?php
+/*
+  $Id: invoice.php,v 1.2 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"><html <?php echo HTML_PARAMS; ?>>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title>Authorize.net Consolidated CRE Help Screen</title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="admin/includes/general.js"></script>
+</head>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+
+
+     <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading">Authorize.net Consolidated CRE Edition</td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+       <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+         <td class="main">
+
+<div align="center"><h2>Configuration Help Screen</h2></div>
+</td>
+</tr>
+<tr>
+ <td align="center">
+<a href=" https://freecreditcardprocessing.com/applynow/online_application.asp?code=chainreaction"> <h2>Link to Apply for Authorize.net account</h2></a><br>
+(support the CRE project by using our authorize.net partner)
+</td>
+</tr>
+<tr>
+<td>
+<hr align="center" size="4" width="450">
+</td>
+</tr>
+<tr>
+<td>
+User your browser back button to return to the Authorize.net edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Authorize.net testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Authorize.net Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Authorize.net User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Authorize.net Consolidated uses the AIM method of
+connecting to Authorize.net.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Authorize.net gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don't know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Authorize.net Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Authorize.net Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>
+<hr align="center" size="4" width="450">
+  </tr>
+        </td></table>
+          </tr>
+         </td>
+
+   </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/paypal/Help_Config.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/paypal/Help_Config.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/paypal/Help_Config.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: Help_Config.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td>
+  <H3><b> Paypal Setup </h3> </b><br>
+   Please use your browsers back button to return.    
+    </td>
+  </tr>
+  <tr>
+    <td class="pptext">The following is a guide towards configuring your store's PayPal payment module settings:</td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">Enable PayPal Module</b><br>Since you have just done the installation, by default it will say yes.</li><br>
+      <li><b class="ppem380">E-Mail Address</b><br>Enter your Primary PayPal email address here, if you have more than one email address registered with PayPal then you must login your PayPal account to determine which one is your <b>Primary</b> email address.</li><br>
+      <li><b class="ppem380">Business ID</b><br>If you have configured a secondary email address to be your Business ID (email address) in your PayPal profile account, then enter this here, otherwise enter the one used above.</li><br>
+      <li><b class="ppem380">Transaction Currency</b><br>Choose which currencies you want to accept PayPal payments with.</li><br>
+      <li><b class="ppem380">Payment Zone</b><br>If a zone is selected, only enable this payment method for that zone.</li><br>
+      <li><b class="ppem380">Set <b>Pending Notification</b> Order Status</b><br>Set the Pending Notification status of orders made with this payment module to this value, '<b style="color:blue">Pending</b>' is suggested or alternatively the optional order status created in step 4 above.</li><br>
+      <li><b class="ppem380">Set <b>Order</b> Status</b><br>Set the status of orders made with this payment module to this value <b style="color:red">Do not set it to 'default' but specifically choose the status required</b>, '<b style="color:blue">Processing</b>' is suggested.</li><br>
+      <li><b class="ppem380">Set <b>On Hold Order</b> Status</b><br>This order status is used when the Cart Test has failed, eg. the expected payment amount did not match.</li><br>
+      <li><b class="ppem380">Set <b>Canceled Order</b> Status</b><br>Refunded, Reversed, Failed or Denied payments will be set to this order status.</li><br>
+      <li><b class="ppem380">Synchronize Invoice</b><br>Specify whether the osCommerce order number should be used as a <b>unique</b> PayPal invoice number, similiar to PayPal's Send Money feature, this will enable customers to resume an order via their osCommerce account history info page for that order for pending transactions which were not previously completed.</li><br>
+      <li><b class="ppem380">Sort order of display</b><br>Sort order of display. Lowest is displayed first.</li><br>
+      <li><b class="ppem380">Background Color</b><br>Select the background color of PayPal's payment pages, either black or white.</li><br>
+      <li><b class="ppem380">Processing logo</b><br>Specify the image file name to be used in the store's checkout process splash page, must be located in <code>catalog/images</code> directory.</li><br>
+      <li><b class="ppem380">Store logo</b><br>Specify the image file name for PayPal to display on their payment pages pages, must be located in <code>catalog/images</code> directory. If you do not have SSL then leave this field blank.</li><br>
+      <li><b class="ppem380">PayPal Page Style Name</b><br>Specify the name of the page style you have configured in your PayPal account profile.</li><br>
+      <li><b class="ppem380">Include a note with payment</b><br>When a customer arrives at the PayPal payment page you can choose whether or not to show them another note field which will have seperate contents from that of the one provided in your store's checkout process but will be included in PayPal's invoice and receipt.<br>To change the title appearing above this field on the PayPal payment page look in the corresponding catalog langauge file (<code>catalog/includes/langauges/english/modules/payment/paypal.php</code>).</li><br>
+      <li><b class="ppem380">Shopping Cart Method</b><br>Choose which type of PayPal Shopping Cart you want to use, Aggregate simply means the total amount is passed (with a list of the products shown in a single item field), whereas an Itemized Cart will list indivudally all the items the customer has selected in their PayPal invoice.</li><br>
+      <li><b class="ppem380">Enable PayPal Shipping Address</b><br>Allow the customer to choose their own PayPal shipping address. 
+      (See FAQ's for more info)</li><br>
+      <li><b class="ppem380">Digest Key</b><br>Specify a unique digest key, this will then be used similiar to a password while testing via the IPN Test Panel <b>and</b> also the store's PayPal transaction signature digest key.</li><br>
+      <li><b class="ppem380">Test Mode</b><br>This should be off for live environments.<br>You can simulate your own IPNs via the
+      <a href="<?php 
+      //echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>">
+      IPN Test Panel</a>.</li><br>
+      <li><b class="ppem380">Cart Test</b><br>This test verifies that the amount received via PayPal matches to what is expected 
+      (See FAQ's for more info).</li><br>
+      <li><b class="ppem380">Debug Email Notifications</b><br>Choose whether you want to receive debug emails.</li><br>
+      <li><b class="ppem380">Debug Email Notification Address</b><br>Enter a seperate email address where you wish to receive <b>debug</b> emails.</li><br>
+      <li><b class="ppem380">PayPal Domain</b><br>This must be set to <b>paypal.com</b> for live production environments, this setting is to facilate PayPal's sandbox and is not related to the IPN Test Panel or the above Test Mode option.</li><br>
+      <li><b class="ppem380">Return URL behavior</b><br>This determines what method PayPal should use when returning the customer back to the store, leave this set to 1 (GET).</li><br>
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd">
+    </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/paypal/Help_FAQs.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/paypal/Help_FAQs.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/help/payment/paypal/Help_FAQs.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,86 @@
+<?php
+/*
+  $Id: Help_FAQs.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td>
+   <H3><b> Paypal Faq\'s </h3> </b><br>
+   Please use your browsers back button to return.
+ </td>
+  </tr>
+  <tr>
+    <td class="pptext">The following are some frequently asked questions about this payment module:
+    </td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">My shipping costs are different once the customer arrives at the PayPal site.</b></legend><div>In your PayPal account profile in the shipping section, check the box that allows overriding the shipping costs.</li><br>
+      <li><b class="ppem380">Do I need to enable IPN in my PayPal account profile.</b><br>No.</li><br>
+      <li><b class="ppem380">What url should I specify for the IPN feature to be used.</b><br>You don't need to, it will automatically be specified.</li><br>
+      <li><b class="ppem380">Why doesn't the Auto-Return feature work.</b><br>You must enable it first in your PayPal account profile.</li><br>
+      <li><b class="ppem380">What url should I specify for the Auto-Return feature.</b><br>It doesn't matter, this contribution will automatically specify the correct script url location, which is now <code>catalog/checkout_success.php</code></li><br>
+      <li><b class="ppem380">Does this contribution support PayPal Credit Card payments.</b><br>Yes.</li><br>
+      <li><b class="ppem380">Why am I getting so many emails per transaction.</b><br>You get <b>one</b> from PayPal and <b>one</b> osCommerce order confirmation email, and another which is the <b>debug email</b>, either disable <b>debug</b> email notification or specify a sperate email address for <b>debug</b> emails.</li><br>
+      <li><b class="ppem380">Why am I not receiving any IPNs.</b><br>You must ensure that your <b>Primary Email Address</b> and <b>Business ID</b> are configured correctly.<br>Login to your PayPal Account and see what and how many email addresses you are using and which one is the Primary address.<br>Also check your debug emails as it will also specify the Primary Email Address of the intended receiver.</li><br>
+      <li><b class="ppem380">I'm having problems with Multi-Currencies.</b><br>This problem should now be resolved, previously the <b>Cart Test</b> was comparing the currency and amounts of the actual order to what PayPal received as opposed to actually comparing the currency and amounts prior to transfering the customer to PayPal.<br><br><b>However</b>, if you're using the Itemized Shopping Cart then discrepancies may arise due to PayPal's two decimal place calculations, in such an event the order will be placed on hold. Although this type of discrepancy may not affect all orders it does however exist and now adds a future requirement to enable you to finalize the transaction via your store's admin.</li><br>
+      <li><b class="ppem380">I'm having problems verifying the Cart Totals.</b><br>See above.</li><br>
+      <li><b class="ppem380">Why is there no PayPal shipping address details in the IPN info?</b><br>Set Enable PayPal Shipping Address to 'No' if you require a PayPal verified shipping address or set to 'Yes' if you do not.</li><br>
+      <li><b class="ppem380">How can I customize the Checkout redirect page.</b><br>The splash template page shown while transfering the customer to PayPal is:<br><code>catalog/includes/modules/payment/paypal/catalog/checkout_splash.inc.php</code></li><br>
+      <li><b class="ppem380">Where can I find more PayPal logo buttons.</b><br>Login to your PayPal account and click Merchant Tools or Auction Tools.</li><br>
+      <li><b class="ppem380">Where can I find PayPal documentation.</b><br><ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;"><li><a href="https://www.paypal.com/en_US/pdf/integration_guide.pdf">PayPal Integration Manual</a></li></ul></li><br>
+
+      <li><b class="ppem380">How do I use PayPal's Sandbox.</b>
+        <ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;">
+          <li>Register with <a href="https://developer.paypal.com/" target="PPDC">PayPal Developer Central</a></li>
+          <li>Then create <b>two virtual accounts</b> types:<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Personal Account</li><li>Premier or Business Account</li></ul></li>
+          <li>Confirm both accounts (each is just a single click option).</li>
+          <li>Transfer some virtual money into your personal account (Click the add funds link).</li>
+          <li>Emails to both accounts will appear in the section where you initially login into the PayPal Developer Central, no real emails are sent so the email addresses for your virtual accounts should be fictitious.</li>
+          <li>Now in your <a href="<?php 
+          //echo tep_href_link(FILENAME_MODULES,'set=payment&module=paypal&action=edit');
+          
+          ?>" target="_blank">osCommerce::Admin::Modules::Payment::PayPal</a> configuration section<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Enter the virtual business account email address into both the Primary Email Address and Business ID fields</li><li>Set the domain to www.sandbox.paypal.com</li></ul></li>
+          <li>Now checkout as a customer via the store, this account should have a real email address (so that you can receive the osC customer order confirmation email), and when you arrive at the PayPal Sandbox site (look for their logo) then login using the virtual personal account details and finalize the payment process.</li>
+        </ul>
+       <br><p class="ppsmallerrorbold">Note that you must first login via the PayPal Developer Central prior to testing the Sandbox/Checkout process.</p>
+      </li><br>
+
+      <li><b class="ppem380">What's the difference between the IPN Test Panel and using PayPal's Sandbox.</b><br>The <a href="<?php 
+      //echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>" target="itp">IPN Test Panel</a> is an independent osCommerce Contribution feature, for testing and development purposes, which allows you to simmulate your own IPNs without having to interact with PayPal.<br><br><p class="ppsmallerrorbold">All Test IPNs via the IPN Test Panel will be invalid according to PayPal since they're not authentic transactions.</p></li><br>
+      <li><b class="ppem380">Is the IPN Test Panel related to PayPal's Sandbox.</b><br>No, see above.</li><br>
+      <li><b class="ppem380">What's the purpose of the digest key.</b><br>Currently the digest key serves two purposes, it authenticates and allows you to use the <a href="<?php // echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>" target="itp">IPN Test Panel</a>, secondly, untill such time that PayPal provides a secure method of associating an IPN specifically to a particular order, it serves as a unique transaction signature identifier.</li><br>
+      <li><b class="ppem380">Should I change the digest key default value.</b><br>Yes, but remember what it is if uninstalling and reinstalling this contrib payment module in the admin since there might be existing pending orders which will require it in order to associate with to their corresponding IPN(s).</li><br>
+      <li><b class="ppem380">How are IPNs deleted.</b><br>Currently, an IPN appearing the admin section is deleted automatically when deleting it's corresponding order.</li><br>
+      <li><b class="ppem380">How can a customer resume their order.</b><br>Currently, if the customer abandons the checkout process at the PayPal site, e.g for some reason they did not actually pay at that time, then they can log into their osCommerce account and click the confirm order button when viewing the details of that particular order in their account_history_info.<br><br>This feature is only available when <b>synchronizing invoices</b> with PayPal.<br><br>This means that if you ever reset the osCommerce <code>orders</code> database table then you must also update it's auto-increment value to be greater than the last known <code>order_id</code>.</li><br>
+      <li><b class="ppem380">I'm getting errors after installing the contribution.</b><br>First, go through the installation edits and remove any blank spaces at the beginning of the line(s), some text editors will insert hidden characters which is a side effect of copying and pasting from HTML documentation.<br>Make sure that the alterations have been performed as well as running the paypal_ipn.sql script.</li><br>
+
+      <li><b class="ppem380">What type of PayPal account do I need.</b><br>You will need either a Premier or Merchant Business Account. <a href="https://www.paypal.com/refer/pal=PS2X9Q773CKG4" target="_blank">Click&nbsp;here&nbsp;to&nbsp;register&nbsp;for&nbsp;an&nbsp;account</a> if you do not already have one.</li><br>
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd"><form name="contents" action="<?php
+    //echo tep_href_link(FILENAME_PAYPAL,'','NONSSL'); 
+    ?>"><input type="hidden" name="action" value="help" /><input type="submit" value="Contents" class="ppbuttonsmall" />
+    </form></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_activate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_activate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_add_article.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_add_article.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_add_field.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_add_field.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_add_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_add_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_files.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_files.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_group.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_group.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_groups.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_groups.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_home.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_home.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_member.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_member.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_members.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_members.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_permission.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_permission.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_remove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_admin_remove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_billing.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_billing.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_backup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_backup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_base.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_base.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_blank.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_blank.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_browse.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_browse.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_cancel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_cancel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_cancel_edit_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_cancel_edit_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_check_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_check_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_check_links.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_check_links.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_confirm_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_confirm_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_convert.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_convert.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_copy.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_copy.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_copy_to.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_copy_to.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_create.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_create.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_create_customer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_create_customer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_create_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_create_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_decrypt.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_decrypt.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_define.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_define.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_details.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_details.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_attributes.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_attributes.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_footer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_footer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_header.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_header.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_infoboxes.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_infoboxes.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_key.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_key.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_lang_define.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_lang_define.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_mainpage.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_mainpage.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_status.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_status.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_values.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_edit_values.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_email.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_encrypt.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_encrypt.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_file_manager.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_file_manager.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_free_signup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_free_signup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_insert.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_insert.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_insert_into_db.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_insert_into_db.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_invoice.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_invoice.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_lock.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_lock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_module_install.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_module_install.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_module_remove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_module_remove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_move.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_move.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_article.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_article.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_author.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_author.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_banner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_banner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_category.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_category.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_country.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_country.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_currency.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_currency.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_event.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_event.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_faq.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_faq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_file.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_file.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_folder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_language.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_language.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_news_item.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_news_item.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_newsletter.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_newsletter.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_sale.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_sale.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_tax_class.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_tax_class.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_tax_rate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_tax_rate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_topic.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_topic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_zone.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_new_zone.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_next.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_next.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_orders.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_orders.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_packingslip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_packingslip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_preview.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_preview.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_preview_upload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_preview_upload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_print.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_print.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_print_page.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_print_page.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_process.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_process.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_quick_save.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_quick_save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_release.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_release.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_remove_fields.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_remove_fields.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_removeccinfo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_removeccinfo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_report.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_report.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_reset.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_reset.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_restore.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_restore.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_return.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_return.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_review_approve.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_review_approve.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_review_disapprove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_review_disapprove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_run.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_run.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save_edit_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save_edit_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save_finish.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save_finish.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save_reload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_save_reload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_select.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_select.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_send_mail.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_send_mail.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_split_file.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_split_file.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_spllit_files.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_spllit_files.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_start_file_creation.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_start_file_creation.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_template_admin.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_template_admin.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_template_admin.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_template_admin.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_unlock.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_unlock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_box_positions.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_box_positions.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_currencies.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_currencies.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_fields.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_fields.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_status.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_update_status.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_upload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_upload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_verify.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/button_verify.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/ic_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/ic_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/ic_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/ic_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/review_approve.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/review_approve.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/review_disapprove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/review_disapprove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/sync.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/buttons/sync.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/images/icon.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/french/images/icon.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/french/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+<?php
+
+define('TEXT_CRELOADED','CRE Loaded.com');
+define('TEXT_OSC','osCommerce.com');
+
+
+//common
+define('TEXT_MANAGE','Manage');
+define('TEXT_ADD','Add');
+define('TEXT_VIEW','View');
+define('TEXT_INSTALLED','Installed');
+define('TEXT_ENABLED','Enabled');
+
+// Store box
+define('BLOCK_TITLE_STORE_INFO','Store Info');
+$storename="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=1&cID=1&action=edit")."'>Store Name</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_NAME',$storename);
+$storestatus="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=16&cID=153")."'>Store Status</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_STATUS',$storestatus);
+$storeemail="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=1&cID=4")."'>Store Email</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_EMAIL',$storeemail); 
+$defaulttemplate="<a class='adminLink' href='".tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,"cID=7")."'>Default Template</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_TEMPLATE',$defaulttemplate); 
+$primarylang="<a class='adminLink' href='".tep_href_link(FILENAME_LANGUAGES)."'>Primary Language</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_LANGUAGE',$primarylang); 
+$primarycurr="<a class='adminLink' href='".tep_href_link(FILENAME_CURRENCIES)."'>Primary Currency</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_CURRENCY',$primarycurr);
+define('BLOCK_CONTENT_STORE_INFO_STORE_TAX_RATE','Tax Rate');
+define('BLOCK_CONTENT_STORE_INFO_STORE_TAX_ZONE','Tax Zone');
+define('BLOCK_CONTENT_STORE_INFO_STORE_BACKUPS','Database Backups'); 
+// Store tips
+define('BLOCK_HELP_STORE_INFO','<ul><li><strong>Store Info</strong><br>Store info which you have in database.<br> You can visit Configuration >> My Store to edit / modify the same.</li></ul>');
+define('BLOCK_HELP_STORE_STATUS','<ul><li><font color=#009900><strong>Active</strong></font><br>Store is open for business.</li><li><font color=#FF0000><strong>Maintanace</strong></font><br>Down for maintananace</li></ul>');
+define('BLOCK_HELP_STORE_BACKUP','Create Fresh Backup Now!');
+
+// Order Box
+define('BLOCK_TITLE_ORDERS','Orders');
+define('BLOCK_HELP_ORDERS','<ul><li><strong>Total Orders</strong><br> This is total count of Order records available in database, irrespective of status.</li><li><strong>Orders Pending</strong><br>Total count of orders, whose status is <font color=red>Pending</font></li><li><strong>Processing<br></strong>Total count of orders, whose status is <font color=red>Processing</font></li>  </ul>');
+
+// reports
+define('BLOCK_TITLE_REPORTS','Reports');    
+define('BLOCK_CONTENT_REPORTS_PRODUCTS_VIEWED','Products Viewed');
+define('BLOCK_CONTENT_REPORTS_PRODUCTS_PURCHASED','Products Purchased');
+define('BLOCK_CONTENT_REPORTS_CUSTOMER_ORDERS_TOTAL','Customer Orders-Total');
+define('BLOCK_CONTENT_REPORTS_MONTHLY_SALES_TAX','Monthly Sales/Tax');
+define('BLOCK_HELP_REPORTS','<ul><li><strong>Reports</strong><br> Click on the links below to view the reports.</li>  </ul>');
+
+// Products
+define('BLOCK_TITLE_PRODUCTS','Products');
+define('BLOCK_CONTENT_PRODUCTS_CATEGORIES','Total Number of Categories');
+define('BLOCK_CONTENT_PRODUCTS_TOTAL_PRODUCTS','Total Number of Products');
+define('BLOCK_CONTENT_PRODUCTS_ACTIVE','Active Products');
+define('BLOCK_CONTENT_PRODUCTS_NOSTOCK','Out of Stock');
+define('BLOCK_HELP_PRODUCTS','<ul><li><strong>Total Number of Products</strong><br>This is total count of products in database irrespective of categories and status.</li><li><strong>Active Products</strong><br>This is total count of live products which are online for sales. This record didcuscts products deactiveated by store admin and out of stocks.</li><li><strong>Out Of Stock<br></strong>This is total count of products, which are not in stock.</li></ul>');
+
+//reviews
+define('BLOCK_TITLE_REVIEWS','Reviews');
+define('BLOCK_CONTENT_REVIEWS_TOTAL_REVIEWS','Total Number of Reviews');
+define('BLOCK_CONTENT_REVIEWS_WAITING_APPROVAL','Waiting Approval');
+define('BLOCK_HELP_REVIEWS','<ul><li><strong>Total Number Reviews</strong><br>This is total count of product records available in database, irrespective of categories, products and status.</li><li><strong>Waiting Approval</strong><br>  Total count of review waiting for admin approval.</li></ul>');
+
+//Customers
+define('BLOCK_TITLE_CUSTOMERS','Customers');
+define('BLOCK_CONTENT_CUSTOMERS_TOTAL','Total Customers');
+define('BLOCK_CONTENT_CUSTOMERS_SUBSCRIBED','Subscribed');
+define('BLOCK_HELP_CUSTOMERS','<ul>  <li><strong>Total Customers</strong><br>This is total count of customers who signedup with store.</li><li><strong>Subscribed</strong><br>Total count of customers who subscribed for Newsletter and or Product Notifications.</li></ul>');
+
+// Affiliates
+define('BLOCK_TITLE_AFFILIATE','Affiliates');
+define('BLOCK_CONTENT_AFFILIATE_TOTAL','Total Affiliates');
+define('BLOCK_CONTENT_AFFILIATE_SALES','Affiliate Sales');
+define('BLOCK_CONTENT_AFFILIATE_COMMISSION','Total Affiliate Commission');
+define('BLOCK_HELP_AFFILIATE','<ul><li><strong>Affiliates</strong><br>Details of Affiliates. Use <strong>Manage</strong> link to manage affiliates.</li></ul>');
+
+//Links
+define('BLOCK_TITLE_LINKS','Links');
+define('BLOCK_CONTENT_LINKS_TOTAL','Total Links');
+define('BLOCK_CONTENT_LINKS_CATEGORIES','Link Categories');
+define('BLOCK_CONTENT_LINKS_WAITING','Waiting Approval');
+
+//Shipping Module
+define('BLOCK_TITLE_SHIPPING_MODULES','Shipping Modules');
+define('BLOCK_CONTENT_SHIPPING_MODULES_INSTALLED','Modules Installed');
+define('BLOCK_CONTENT_SHIPPING_MODULES_ENABLED','Modules Enabled');
+define('BLOCK_HELP_SHIPPING_MODULES','<ul><li><strong>Shipping Modules</strong><br>Number of Shipping modules Installed and you are currently using. Use <strong>Manage</strong> link to manage shipping modules.</li></ul>');
+
+// Payment Modules
+define('BLOCK_TITLE_PAYMENT_MODULES','Payment Modules');
+define('BLOCK_CONTENT_PAYMENT_MODULES_INSTALLED','Modules Installed');
+define('BLOCK_CONTENT_PAYMENT_MODULES_ENABLED','Modules Enabled');
+define('BLOCK_HELP_PAYMENT_MODULES','<ul><li><strong>Payment Modules</strong><br>Number of Payment modules Installed and you are currently using. Use <strong>Manage</strong> link to manage payment modules.</li></ul>');
+
+//Taxes
+define('BLOCK_TITLE_TAX_RATES','Tax Rates');
+define('BLOCK_HELP_TAXES','<ul><li><strong>Taxes</strong><br>Number of Zones Installed</li></ul>');
+
+// CRE Forge
+define('BLOCK_TITLE_CRE_FORGE',"CRE Forge");
+define('BLOCK_CONTENT_CRE_FORGE_BUG_TRACKER',"Bug Tracker");
+define('BLOCK_CONTENT_CRE_FORGE_FEATURE_REQUESTS',"Feature Requests");
+define('BLOCK_CONTENT_CRE_FORGE_SVN_REPOSITORY',"SVN Repository");
+define('BLOCK_CONTENT_CRE_FORGE_SUPPORT_REQUEST',"Support Request");
+define('BLOCK_CONTENT_CRE_FORGE_FILE_RELEASES',"File Releases");
+define('BLOCK_TITLE_CRE_NEWS',"CRE Loaded News");
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/index_new.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/index_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/index_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+define('TEXT_ADMIN_HOME','Admin Home');
+define('TEXT_VIEW_CATALOG','View Catalog');
+define('TEXT_FORUMS','CRE Forums');
+define('TEXT_PURCHASE_SUPPORT','Purchase CRE Support');
+define('TEXT_HOSTING','Certified CRE Hosting');
+define('TEXT_WELCOME','Welcome <strong>' . STORE_ADMIN_NAME . '</strong> to <strong>' . STORE_NAME . '</strong> Administration!');
+define('TEXT_ADMIN_LANG','Admin Language:');
+define('TEXT_CHANGE_PASWORD','Change Password');
+define('TEXT_LOGOUT','Logout');
+define('TEXT_CHECK_UPDATES','Check for Updates');
+define('TEXT_GET_PRO','Get Pro Version');
+
+//common
+define('TEXT_MANAGE','Manage');
+define('TEXT_ADD','Add');
+define('TEXT_VIEW','View');
+define('TEXT_INSTALLED','Installed');
+define('TEXT_ENABLED','Enabled');
+
+// Store box
+define('TEXT_STORE_INFO','Store Info');
+define('TEXT_STORE_NAME','Store Name');
+define('TEXT_STORE_STATUS','Store Status');
+define('TEXT_STORE_EMAIL','Store Email'); 
+define('TEXT_STORE_TEMPLATE','Default Template'); 
+define('TEXT_STORE_LANGUAGE','Primary Language'); 
+define('TEXT_STORE_CURRENCY','Primary Currency');
+define('TEXT_STORE_TAX_RATE','Tax Rate');
+define('TEXT_STORE_TAX_ZONE','Tax Zone');
+define('TEXT_STORE_BACKUPS','Database Backups'); 
+// Store tips
+define('TEXT_HELP_STORE_INFO','<ul><li><strong>Store Info</strong><br>Store info which you have in database.<br> You can visit Configuration >> My Store to edit / modify the same.</li></ul>');
+define('TEXT_HELP_STORE_STATUS','<ul><li><font color=#009900><strong>Active</strong></font><br>Store is open for business.</li><li><font color=#FF0000><strong>Maintanace</strong></font><br>Down for maintananace</li></ul>');
+define('TEXT_HELP_STORE_BACKUP','Create Fresh Backup Now!');
+
+// Order Box
+define('TEXT_ORDERS','Orders');
+define('TEXT_HELP_ORDERS','<ul><li><strong>Total Orders</strong><br> This is total count of Order records available in database, irrespective of status.</li><li><strong>Orders Pending</strong><br>Total count of orders, whose status is <font color=red>Pending</font></li><li><strong>Processing<br></strong>Total count of orders, whose status is <font color=red>Processing</font></li>  </ul>');
+define('TEXT_PENDING','Pending');
+define('TEXT_PROCESSING','Processing');
+define('TEXT_DELIVERED','Delivered');
+define('TEXT_PAYPAL_PROCESSING','Paypal Processing');
+define('TEXT_ALLOW_DOWNLOAD','Allow Download');
+define('TEXT_ON_HOLD','On Hold');
+define('TEXT_CANCELED','Canceled');
+define('TEXT_AWAITING_CC_PROCESSING','Awaiting CC Processing');
+
+
+// reports
+define('TEXT_REPORTS','Reports');
+define('TEXT_REPORTS_PRODUCTS_VIEWED','Products Viewed');
+define('TEXT_REPORTS_PURCHASED','Products Purchased');
+define('TEXT_ORDERS_ORDER_TOTAL','Customer Orders-Total');
+define('TEXT_ORDERS_SALES_TAX','Monthly Sales/Tax');
+define('TEXT_HELP_REPORTS','<ul><li><strong>Reports</strong><br> Click on the links below to view the reports.</li>  </ul>');
+
+// Products
+define('TEXT_PRODUCTS','Products');
+define('TEXT_PRODUCTS_CATEGORIES','Total Number of Categories');
+define('TEXT_PRODUCTS_TOTAL_PRODUCTS','Total Number of Products');
+define('TEXT_PRODUCTS_ACTIVE','Active Products');
+define('TEXT_PRODUCTS_NOSTOCK','Out of Stock');
+define('TEXT_HELP_PRODUCTS','<ul><li><strong>Total Number of Products</strong><br>This is total count of products in database irrespective of categories and status.</li><li><strong>Active Products</strong><br>This is total count of live products which are online for sales. This record didcuscts products deactiveated by store admin and out of stocks.</li><li><strong>Out Of Stock<br></strong>This is total count of products, which are not in stock.</li></ul>');
+
+//reviews
+define('TEXT_REVIEWS','Reviews');
+define('TEXT_REVIEWS_TOTAL','Total Number of Reviews');
+define('TEXT_REVIEWS_WAITING','Waiting Approval');
+define('TEXT_HELP_REVIEWS','<ul><li><strong>Total Number Reviews</strong><br>This is total count of product records available in database, irrespective of categories, products and status.</li><li><strong>Waiting Approval</strong><br>  Total count of review waiting for admin approval.</li></ul>');
+
+//Customers
+define('TEXT_CUSTOMERS','Customers');
+define('TEXT_CUSTOMERS_TOTAL','Total Customers');
+define('TEXT_CUSTOMERS_SUBSCRIBED','Subscribed');
+define('TEXT_HELP_CUSTOMERS','<ul>  <li><strong>Total Customers</strong><br>This is total count of customers who signedup with store.</li><li><strong>Subscribed</strong><br>Total count of customers who subscribed for Newsletter and or Product Notifications.</li></ul>');
+
+// Affiliates
+define('TEXT_AFFILIATE','Affiliates');
+define('TEXT_AFFILIATE_TOTAL','Total Affiliates');
+define('TEXT_AFFILIATE_SALES','Affiliate Sales');
+define('TEXT_AFFILIATE_COMMISSION','Total Affiliate Commission');
+define('TEXT_HELP_AFFILIATE','<ul><li><strong>Affiliates</strong><br>Details of Affiliates. Use <strong>Manage</strong> link to manage affiliates.</li></ul>');
+
+//Links
+define('TEXT_LINKS','Links');
+define('TEXT_LINKS_TOTAL','Total Links');
+define('TEXT_LINKS_CATEGORIES','Link Categories');
+define('TEXT_LINKS_WAITING','Waiting Approval');
+
+//Shipping Module
+define('TEXT_SHIPPING_MODULES','Shipping Modules');
+define('TEXT_HELP_SHIPPING_MODULES','<ul><li><strong>Shipping Modules</strong><br>Number of Shipping modules Installed and you are currently using. Use <strong>Manage</strong> link to manage shipping modules.</li></ul>');
+
+// Payment Modules
+define('TEXT_PAYMENT_MODULES','Payment Modules');
+define('TEXT_HELP_PAYMENT_MODULES','<ul><li><strong>Payment Modules</strong><br>Number of Payment modules Installed and you are currently using. Use <strong>Manage</strong> link to manage payment modules.</li></ul>');
+
+// CRE Forge
+define('BOX_HEADING_CRE_FORGE',"CRE Forge");
+define('BOX_CRE_FORGE_BUG_TRACKER',"Bug Tracker");
+define('BOX_CRE_FORGE_FEATURE_REQUESTS',"Feature Requests");
+define('BOX_CRE_FORGE_SVN_REPOSITORY',"SVN Repository");
+define('BOX_CRE_FORGE_SUPPORT_REQUEST',"Support Request");
+define('BOX_CRE_FORGE_FILE_RELEASES',"File Releases");
+define('BOX_HEADING_CRE_NEWS',"CRE Loaded News");
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/infobox_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/infobox_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/infobox_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Infobox Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Infobox Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADER_EXPLAIN', 'These settings effect all templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Infobox configuration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Infobox configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/infobox_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/infobox_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/infobox_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: infobox_configuration.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Afficher, Mettre à jour et cr&eacute;er des Infobox');
+define('TABLE_HEADING_INFOBOX_FILE_NAME', 'Titre');
+define('TABLE_HEADING_ACTIVE', 'Activer Box?');
+define('TABLE_HEADING_KEY', 'D&eacute;finir Box Heading');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_COLUMN', 'Colonne');
+define('TABLE_HEADING_SORT_ORDER', 'Position');
+define('TABLE_HEADING_TEMPLATE', 'Box Template');
+define('TABLE_HEADING_FONT_COLOR', 'Couleur Police');
+define('TABLE_HEADING_BOX_DIRECTORY', 'Location of boxes for this template: ');
+
+define('TEXT_INFO_EDIT_INTRO', 'Faites les changements n&eacute;cessaires');
+define('TEXT_INFO_DATE_ADDED', 'Date d\'ajout:');
+define('TEXT_INFO_LAST_MODIFIED', 'Derni&egrave;re Modification:');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Ajouter une nouvelle Infobox');
+define('TEXT_INFO_INSERT_INTRO', 'Un exemple pour la box<b> what\'s_new.php</b> infobox est s&eacute;lect&eacute;e');
+define('TEXT_INFO_DELETE_INTRO', '<P STYLE="color: red; font-weight: bold;">Confirmer OK pour d&eacute;truire l\'Infobox');
+define('TEXT_INFO_HEADING_DELETE_INFOBOX', 'Supprimer Infobox?');
+define('TEXT_INFO_HEADING_UPDATE_INFOBOX', 'Mettre à jour Infobox ');
+
+define('IMAGE_INFOBOX_STATUS_UP', 'UP');
+define('IMAGE_ICON_STATUS_UP_LIGHT', 'Move Up');
+define('IMAGE_INFOBOX_STATUS_down', 'Down');
+define('IMAGE_ICON_STATUS_DOWN_LIGHT', 'Move Down');
+
+define('IMAGE_INFOBOX_STATUS_GREEN', 'Gauche');
+define('IMAGE_INFOBOX_STATUS_GREEN_LIGHT', 'Positionner gauche');
+define('IMAGE_INFOBOX_STATUS_RED', 'Droite');
+define('IMAGE_INFOBOX_STATUS_RED_LIGHT', 'Positionner droite');
+
+
+define('BOX_HEADING_BOXES', 'Admin Boxes');
+
+define('TEXT_HEADING_SET_ACTIVE', 'Set this box Active? ');
+define('TEXT_HEADING_DEFINE_KEY', '  Define key ');
+define('TEXT_HEADING_WHAT_POS', 'Column Position? ');
+define('TEXT_HEADING_WHICH_TEMPLATE', 'Which box Template? ');
+define('TEXT_HEADING_HEADING', 'The infoBox heading ');
+define('TEXT_HEADING_WHICH_COL', 'Which column? ');
+define('TEXT_HEADING_FILENAME', 'Filename ');
+define('TEXT_HEADING_FONT_COLOR', 'Header Font Color ');
+
+define('TEXT_NOTE_REQUIRED', '* Denotes required field');
+
+define('JS_BOX_HEADING', '* La \'Define Key\' doit être saisie.    Exemple BOX_HEADING_WHATS_NEW');
+define('JS_INFO_BOX_HEADING', '* Le \'Box heading\' doit être saisie.');
+define('JS_BOX_LOCATION', '* Vous devez choisir une colonne pour l\'affichage de l\'infobox');
+define('JS_INFO_BOX_FILENAME', '* Vous devez choisir un nom de fichier pour cette infobox');
+define('JS_BOX_COLOR', '* Please select a color for the font color.');
+
+
+define('TEXT_INFO_MESSAGE_COUNT_1', '<br>There are currently <br>');
+define('TEXT_INFO_MESSAGE_COUNT_2', ' active boxes in the left column and <br>');
+define('TEXT_INFO_MESSAGE_COUNT_3', ' active boxes in the right column');
+//error messages
+define('infobox_error1', 'This template does not have any infoboxes to install. Please put the infoboxes that you want to install in this template\'s boxes directory');
+define('infobox_error2', 'WARNING: No boxes selected in your LEFT column');
+define('infobox_error3', 'WARNING: No boxes selected in your RIGHT column');
+
+define('INFOBOX_ACTIVE_BOXES', ' active boxes in the right column');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/information.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+
+  define('ACTION_INFORMATION', 'Action');
+  define('ACTIVATION_ID_INFORMATION', 'Activation de l\'information ID=');
+  define('ADD_INFORMATION', 'Ajouter nouvelle information');
+  define('ADD_QUEUE_INFORMATION', ' Ajouter nouvelle information en queue');
+  define('ALERT_INFORMATION', 'Syst&egrave;me d\'information vide');
+  define('ANSWER_INFORMATION', 'R&eacute;pondre');
+  define('CONFIRM_INFORMATION', 'Confirmer');
+  define('DEACTIVATION_ID_INFORMATION', 'D&eacute;sactiver l\'information ID=');
+  define('DELETE_INFORMATION', 'Effacer');
+  define('DELETE_CONFITMATION_ID_INFORMATION', 'Confirmer la suppression de l\'information ID=');
+  define('DELETE_ID_INFORMATION', 'Supprimer l\'information ID=');
+  define('DELETED_ID_INFORMATION', 'Suppression de l\'information ID=');
+  define('DESCRIPTION_INFORMATION', 'Description');
+  define('EDIT_ID_INFORMATION', 'Editer l\'information ID=');
+  define('EDIT_INFORMATION', 'Modifier');
+  define('ERROR_20_INFORMATION', 'Vous n\'avez pas d&eacute;fini une valeur valide pour l\'option <b>Queue</b>. Vous pouvez seulement d&eacute;finir une valeur num&eacute;rique.');
+  define('ERROR_80_INFORMATION', 'Vous n\'avez pas rempli tous les <b>champs obligatoires</b>');
+  define('INFORMATION_ID_ACTIVE', 'cette information est Active'); 
+  define('INFORMATION_ID_DEACTIVE', 'cette information n\'est pas active'); 
+  define('INFORMATION_ACTIVE', 'Active');
+  define('INFORMATION_DEACTIVE', 'Inactive');
+  define('ID_INFORMATION', 'ID');
+  define('TITLE_INFORMATION', 'Titre');
+  define('QUEUE_INFORMATION', 'Attente');
+  define('QUEUE_INFORMATION_LIST', 'Liste Attente: ');
+  define('MANAGER_INFORMATION', 'Information Manager');
+  define('NO_INFORMATION', 'Non');
+  define('PUBLIC_INFORMATION', 'Public');
+  define('PAGE_PREVIEW', 'Aperçu');
+  define('SORT_BY', 'Dans la page Information le tri est par');
+  define('STATUS_INFORMATION', 'Statut:');
+  define('SUCCEED_INFORMATION', ' Succ&egrave;s');
+  define('TITLE', 'Syst&egrave;me d\'Information');
+  define('VIEW_INFORMATION', 'Voir Information');
+  define('VISIBLE_INFORMATION', 'Visible');
+  define('VISIBLE_INFORMATION_DO', '( Rendre visible )');
+  define('UPDATE_ID_INFORMATION', 'Mise &agrave; jour de l\'information ID=');
+  define('WARNING_INFORMATION', 'Attention');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: invoice.php,v 1.3 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('TITLE_PRINT_ORDER', 'Facture N&deg; ');
+
+define('TABLE_HEADING_COMMENTS', 'Commentaires');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Mod&egrave;le');
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_TAX', 'Taxe');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Prix (ht)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Prix (ttc)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ht)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (ttc)');
+
+define('ENTRY_SOLD_TO', 'VENDU A :');
+define('ENTRY_SHIP_TO', 'LIVRE A :');
+define('ENTRY_PAYMENT_METHOD', 'M&eacute;thode de paiement :');
+define('ENTRY_SUB_TOTAL', 'Sous-Total :');
+define('ENTRY_TAX', 'Taxe :');
+define('ENTRY_SHIPPING', 'Exp&eacute;dition :');
+define('ENTRY_TOTAL', 'Total :');
+define('ENTRY_DATE_PURCHASED', 'Date de la commande :');
+define('TITLE_PRINT_INVOICE', 'FACTURE');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/languages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: languages.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Langues');
+
+define('TABLE_HEADING_LANGUAGE_NAME', 'Langue');
+define('TABLE_HEADING_LANGUAGE_CODE', 'Code');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_INFO_LANGUAGE_NAME', 'Nom :');
+define('TEXT_INFO_LANGUAGE_CODE', 'Code :');
+define('TEXT_INFO_LANGUAGE_IMAGE', 'Image :');
+define('TEXT_INFO_LANGUAGE_DIRECTORY', 'R&eacute;pertoire :');
+define('TEXT_INFO_LANGUAGE_SORT_ORDER', 'Ordre de tri :');
+define('TEXT_INFO_INSERT_INTRO', 'Merci d\'entrer la nouvelle langue avec ses donn&eacute;es li&eacute;es');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir supprimer cette langue ?');
+define('TEXT_INFO_HEADING_NEW_LANGUAGE', 'Nouvelle langue');
+define('TEXT_INFO_HEADING_EDIT_LANGUAGE', 'Editer langue');
+define('TEXT_INFO_HEADING_DELETE_LANGUAGE', 'Supprimer langue');
+
+define('ERROR_REMOVE_DEFAULT_LANGUAGE', 'Erreur : La langue par d&eacute;faut ne peut &ecirc;tre supprim&eacute;e. Merci de choisir une nouvelle langue par d&eacute;faut et r&eacute;essayer.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/link_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/link_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/link_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: link_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Lien Cat&eacute;gories');
+define('HEADING_TITLE_SEARCH', 'Recherche:');
+
+define('TABLE_HEADING_NAME', 'Nom');
+define('TABLE_HEADING_STATUS', 'Statut');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_NEW_LINK_CATEGORY', 'Nouveau Lien Cat&eacute;gorie');
+define('TEXT_INFO_HEADING_EDIT_LINK_CATEGORY', 'Mettre à jour Lien Cat&eacute;gorie');
+define('TEXT_INFO_HEADING_DELETE_LINK_CATEGORY', 'Supprimer Lien Cat&eacute;gorie');
+
+define('TEXT_INFO_LINK_CATEGORY_COUNT', 'Liens:');
+define('TEXT_INFO_LINK_CATEGORY_STATUS', 'Statut:');
+define('TEXT_INFO_LINK_CATEGORY_DESCRIPTION', 'Description:');
+define('TEXT_INFO_LINK_CATEGORY_SORT_ORDER', 'Ordre de tri:');
+define('TEXT_DATE_LINK_CATEGORY_CREATED', 'Date de cr&eacute;ation:');
+define('TEXT_DATE_LINK_CATEGORY_LAST_MODIFIED', 'Derni&egrave;re modification:');
+define('TEXT_IMAGE_NONEXISTENT', 'L\'IMAGE N\'EXISTE PAS');
+
+define('TEXT_NEW_LINK_CATEGORIES_INTRO', 'Merci de compl&eacute;ter les informations suivantes pour le nouveau lien cat&eacute;gorie');
+define('TEXT_EDIT_LINK_CATEGORIES_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_DELETE_LINK_CATEGORIES_INTRO', 'Etes vous sur de vouloir supprimer ce lien cat&eacute;gorie ?');
+
+define('TEXT_LINK_CATEGORIES_NAME', 'Nom de la Cat&eacute;gorie:');
+define('TEXT_LINK_CATEGORIES_DESCRIPTION', 'Description de la Cat&eacute;gorie:');
+define('TEXT_LINK_CATEGORIES_IMAGE', 'Image de la Cat&eacute;gorie:');
+define('TEXT_LINK_CATEGORIES_SORT_ORDER', 'Ordre de tri:');
+define('TEXT_LINK_CATEGORIES_STATUS', 'Statut:');
+define('TEXT_LINK_CATEGORIES_STATUS_ENABLE', 'Actif');
+define('TEXT_LINK_CATEGORIES_STATUS_DISABLE', 'Inactif');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>ATTENTION:</b> Il y a %s liens qui pointent encore sur cette cat&eacute;gorie!');
+
+define('TEXT_DISPLAY_NUMBER_OF_LINK_CATEGORIES', 'Affichage <b>%d</b> à <b>%d</b> (sur <b>%d</b> liens cat&eacute;gories)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/links.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: links.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Liens');
+define('HEADING_TITLE_SEARCH', 'Recherche:');
+
+define('TABLE_HEADING_TITLE', 'Titre');
+define('TABLE_HEADING_URL', 'URL');
+define('TABLE_HEADING_CLICKS', 'Clics');
+define('TABLE_HEADING_STATUS', 'Statut');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_HEADING_DELETE_LINK', 'Supprimer Lien');
+define('TEXT_INFO_HEADING_CHECK_LINK', 'Valider Lien');
+
+define('TEXT_DELETE_INTRO', 'Etes vous sur de vouloir supprimer ce lien ?');
+
+define('TEXT_INFO_LINK_CHECK_RESULT', 'R&eacute;sultat de la validation lien:');
+define('TEXT_INFO_LINK_CHECK_FOUND', 'Trouv&eacute;');
+define('TEXT_INFO_LINK_CHECK_NOT_FOUND', 'Non trouv&eacute;');
+define('TEXT_INFO_LINK_CHECK_ERROR', 'Erreur à la lecture URL');
+
+
+define('TEXT_INFO_LINK_STATUS', 'Statut:');
+define('TEXT_INFO_LINK_CATEGORY', 'Cat&eacute;gorie:');
+define('TEXT_INFO_LINK_CONTACT_NAME', 'Nom du Contact:');
+define('TEXT_INFO_LINK_CONTACT_EMAIL', 'Email du Contact:');
+define('TEXT_INFO_LINK_CLICK_COUNT', 'Cliques:');
+define('TEXT_INFO_LINK_DESCRIPTION', 'Description:');
+define('TEXT_DATE_LINK_CREATED', 'Lien cr&eacute;&eacute;:');
+define('TEXT_DATE_LINK_LAST_MODIFIED', 'Derni&egrave;re modification:');
+define('TEXT_IMAGE_NONEXISTENT', 'L\'IMAGE N\'EXISTE PAS');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Mise à jour de l\'&eacute;tat du lien');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Cher %s,' . "\n\n" . 'l\'&eacute;tat de votre lien chez ' . STORE_NAME . ' a &eacute;t&eacute; mis à jour.' . "\n\n" . 'Nouveau statut : %s' . "\n\n" . 'SVP, r&eacute;pondez à ce message si vous avez des questions.' . "\n");
+
+// VJ todo - move to common language file
+define('CATEGORY_WEBSITE', 'D&eacute;tails du site WEB');
+define('CATEGORY_RECIPROCAL', 'D&eacute;tails de la page r&eacute;ciproque');
+define('CATEGORY_OPTIONS', 'Options');
+
+define('ENTRY_LINKS_TITLE', 'Titre du lien:');
+define('ENTRY_LINKS_TITLE_ERROR', 'Le titre du lien doit contenir un minimum de ' . ENTRY_LINKS_TITLE_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_URL', 'URL du lien:');
+define('ENTRY_LINKS_URL_ERROR', 'URL du lien doit contenir un minimum de ' . ENTRY_LINKS_URL_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_CATEGORY', 'Cat&eacute;gorie:');
+define('ENTRY_LINKS_DESCRIPTION', 'Description:');
+define('ENTRY_LINKS_DESCRIPTION_ERROR', 'La Description doit contenir un minimum de ' . ENTRY_LINKS_DESCRIPTION_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_IMAGE', 'Image URL:');
+define('ENTRY_LINKS_CONTACT_NAME', 'Nom complet:');
+define('ENTRY_LINKS_CONTACT_NAME_ERROR', 'Votre nom complet doit contenir un minimum de ' . ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_RECIPROCAL_URL', 'URL de la page r&eacute;ciproque:');
+define('ENTRY_LINKS_RECIPROCAL_URL_ERROR', 'URL de la page r&eacute;ciproque doit contenir un minimum de ' . ENTRY_LINKS_URL_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_STATUS', 'Statut:');
+define('ENTRY_LINKS_NOTIFY_CONTACT', 'Notification du Contact:');
+define('ENTRY_LINKS_RATING', 'Classement:');
+define('ENTRY_LINKS_RATING_ERROR', 'Le classement ne peut pas &ecirc;tre vide.');
+
+define('TEXT_DISPLAY_NUMBER_OF_LINKS', 'Affichage <b>%d</b> à <b>%d</b> (sur <b>%d</b> liens)');
+
+define('IMAGE_NEW_LINK', 'Nouveau Lien');
+define('IMAGE_CHECK_LINK', 'Valider Lien');
+
+define('ALL', 'All');
+define('LINKS_MANAGER_CHECKED_LINKS', 'Links Manager - Checked Links');
+define('ASC', 'Asc');
+define('DESC', 'Desc');
+define('START_AT', 'Start at:');
+define('HOW_MANY', 'How many?');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/links_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/links_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/links_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: links_contact.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Envoi Email aux partenaires des liens');
+
+define('TEXT_LINK_PARTNER', 'Partenaire de liens:');
+define('TEXT_SUBJECT', 'Sujet:');
+define('TEXT_FROM', 'De :');
+define('TEXT_MESSAGE', 'Message:');
+define('TEXT_SELECT_LINK_PARTNER', 'S&eacute;lectionner le Partenaire de liens');
+define('TEXT_ALL_LINK_PARTNERS', 'Tous les Partenaires de liens');
+
+define('NOTICE_EMAIL_SENT_TO', 'Avertissement: Email envoy&eacute; à: %s');
+define('ERROR_NO_LINK_PARTNER_SELECTED', 'Erreur: Aucun Partenaire de liens n\'a &eacute;t&eacute; s&eacute;lectionn&eacute;.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/login.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: login.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Connexion');
+define('HEADING_TITLE', 'Bienvenue, signez vous SVP !');
+
+define('HEADING_RETURNING_ADMIN', 'Panneau de connexion :');
+define('HEADING_PASSWORD_FORGOTTEN', 'Mot de passe oubli&eacute; :');
+define('TEXT_RETURNING_ADMIN', 'Personnel seulement !');
+define('ENTRY_EMAIL_ADDRESS', 'Adresse Email :');
+define('ENTRY_PASSWORD', 'Mot de passe :');
+define('ENTRY_FIRSTNAME', 'Pr&eacute;nom :');
+define('IMAGE_BUTTON_LOGIN', 'Confirmer');
+
+define('TEXT_PASSWORD_FORGOTTEN', 'Mot de passe oubli&eacute; ?');
+
+define('TEXT_LOGIN_ERROR', '<font color="#ff0000"><b>ERREUR :</b></font> Mauvais email ou mot de passe !');
+define('TEXT_FORGOTTEN_ERROR', '<font color="#ff0000"><b>ERREUR :</b></font> Probl&egrave;me de pr&eacute;nom ou de mot de passe !');
+define('TEXT_FORGOTTEN_FAIL', 'Vous avez que 3 essais pour des raisons de s&eacute;curit&eacute;, contactez SVP votre administrateur pour obtenir un nouveau mot de passe.<br>&nbsp;<br>&nbsp;');
+define('TEXT_FORGOTTEN_SUCCESS', 'Le nouveau mot de passe va &ecirc;tre envoy&eacute; &agrave; votre adresse email. Veuillez v&eacute;rifier votre email et essayer de vous reconnecter.<br>&nbsp;<br>&nbsp;');
+
+define('ADMIN_EMAIL_SUBJECT', 'Nouveau mot de passe'); 
+define('ADMIN_EMAIL_TEXT', 'Bonjour %s,' . "\n\n" . 'Vous pouvez acc&eacute;der au panneau d\'administration avec le mot de passe suivant. Une fois que vous acc&eacute;dez à l\'administration, changez svp votre mot de passe ! ' . "\n\n" . 'Site Web : %s' . "\n" . 'Nom d\'utilisateur : %s' . "\n" . 'Mot de passe: %s' . "\n\n" . 'Merci !' . "\n" . '%s' . "\n\n" . 'Ceci est un message automatis&eacute;, veuillez ne pas repondre !'); 
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/logoff.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Fermeture de session :');
+define('NAVBAR_TITLE', 'Fermeture de session');
+define('TEXT_MAIN', '<br>Votre session sur <b>l’administration est ferm&eacute;e</b>. Merci de votre visite et à bientôt !<br><br>');
+define('TEXT_RELOGIN', 'R&eacute;ouverture de session');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: mail.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Envoyer un courrier &eacute;lectronique aux clients');
+
+define('TEXT_CUSTOMER', 'Client :');
+define('TEXT_SUBJECT', 'Sujet :');
+define('TEXT_FROM', 'De :');
+define('TEXT_MESSAGE', 'Message :');
+define('TEXT_SELECT_CUSTOMER', 'Choisissez un client');
+define('TEXT_ALL_CUSTOMERS', 'Tous les clients');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'Tous les abonn&eacute;s au bulletin d\'informations');
+
+define('NOTICE_EMAIL_SENT_TO', 'Notification : Courrier &eacute;lectronique envoy&eacute; &agrave; : %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Erreur : Aucun client n\'a &eacute;t&eacute; s&eacute;lectionn&eacute;.');
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">Le bouton Retour a &eacute;t&eacute; d&eacute;sactiv&eacute; pendant que HTML WYSIWG Editor est actif,</b></font> Pourquoi? - Parce que si vous cliquez sur le bouton retour pour &eacute;diter votre message HTML, le PHP (php.ini - "Magic Quotes = On") va rajouter automatiquement "\\\\\\\" backslashes partout Double Quotes " apparaissent (HTML les utilise pour les liens, images etc) et cela d&eacute;r&eacute;gle le HTML et les images vont disparaitre lorsque vous &eacute;mettrez votre message, Si vous d&eacute;sactivez WYSIWYG Editor dans Admin la capacit&eacute; HTML d\'osCommerce est aussi d&eacute;sactiv&eacute; et le bouton retour r&eacute; apparait. <br><br><b>Si vous avez vraiment besoin de visualiser vos messages avant envoi, utilisez le bouton Preview dans WYSIWYG Editor.<br><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML est actuellement d&eacute;sactiv&eacute;!</b></font><br><br>Si vous souhaitez envoyer un message au format HTML, Activez WYSIWYG Editor pour Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// Contact US Email Subject DMG
+define('TEXT_EMAIL_SUBJECTS', '* select a subject *');
+define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME. ': ');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Fabricants');
+
+define('TABLE_HEADING_MANUFACTURERS', 'Fabricants');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_HEADING_NEW_MANUFACTURER', 'Nouveau fabricant');
+define('TEXT_HEADING_EDIT_MANUFACTURER', 'Editer fabricant');
+define('TEXT_HEADING_DELETE_MANUFACTURER', 'Supprimer fabricant');
+
+define('TEXT_MANUFACTURERS', 'Fabricants :');
+define('TEXT_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_LAST_MODIFIED', 'Derni&egrave;re modification :');
+define('TEXT_PRODUCTS', 'Produits :');
+define('TEXT_IMAGE_NONEXISTENT', 'L\'IMAGE N\'EXISTE PAS');
+
+define('TEXT_NEW_INTRO', 'Merci de compl&eacute;ter les informations sur le nouveau fabricant');
+define('TEXT_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+
+define('TEXT_MANUFACTURERS_NAME', 'Nom du fabricant :');
+define('TEXT_MANUFACTURERS_IMAGE', 'Image du fabricant :');
+define('TEXT_MANUFACTURERS_URL', 'URL du fabricant :');
+
+define('TEXT_DELETE_INTRO', 'Etes vous sur de vouloir supprimer ce fabricant ?');
+define('TEXT_DELETE_IMAGE', 'Supprimer l\'image du fabricant ?');
+define('TEXT_DELETE_PRODUCTS', 'Supprimer tous les produits de ce fabricant ? (en incluant les critiques, produits en promotion, produits &agrave; venir)');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>ATTENTION :</b> Il reste %s produit(s) li&eacute;es &agrave; ce fabricant !');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Erreur : Impossible d\'&eacute;crire dans le r&eacute;pertoire. Merci de modifier les droits d\'acc&egrave;s sur : %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Erreur : Le r&eacute;pertoire n\'existe pas : %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/members.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: members.php,v 1.2 2003/09/24 13:57:08 anon Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Member approval');
+
+define('TABLE_HEADING_LASTNAME', 'Lastname');
+define('TABLE_HEADING_FIRSTNAME', 'Firstname');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('HEADING_TITLE_SEARCH', 'Search');
+
+define('EMAIL_CONTACT', 'For help with any of our online services, please email us at: ' . STORE_OWNER_EMAIL_ADDRESS);
+
+define('EMAIL_TEXT_CONFIRM', 'Your application to become a wholesale customer of (your store) has been approved. You can now access pricing on the (your store) site.<br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to drop ship direct to your customer.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n");
+
+define('EMAIL_WARNING', '<b>Note:</b> This email address was used to request access to our wholesale website. If you did not signup to be a customer, please send an email to ' . STORE_OWNER_EMAIL_ADDRESS . "\n\n");
+
+define('EMAIL_TEXT_SUBJECT', 'Account Approved');
+
+define('EMAIL_SEPARATOR', '----------------------------------------------');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_newsletter.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+define('TEXT_COUNT_AFFILIATES', 'Affiliates receiving newsletter: %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+/*
+  $Id: newsletter.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_COUNT_CUSTOMERS', 'Clients abonn&eacute;s &agrave; la lettre d\'information %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/product_notification.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/product_notification.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/modules/newsletters/product_notification.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: product_notification.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_COUNT_CUSTOMERS', 'Clients abonn&eacute;s &agrave; la lettre d\'information %s');
+define('TEXT_PRODUCTS', 'Produits');
+define('TEXT_SELECTED_PRODUCTS', 'Produits s&eacute;lectionn&eacute;s');
+
+define('JS_PLEASE_SELECT_PRODUCTS', 'Veuillez s&eacute;lectionner des produits');
+
+define('BUTTON_GLOBAL', 'Global');
+define('BUTTON_SELECT', '>>>');
+define('BUTTON_UNSELECT', '<<<');
+define('BUTTON_SUBMIT', 'Envoyer');
+define('BUTTON_CANCEL', 'Effacer');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/modules.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/modules.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/modules.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: modules.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_MODULES_PAYMENT', 'Modules de paiement');
+define('HEADING_TITLE_MODULES_SHIPPING', 'Modules d\'exp&eacute;dition');
+define('HEADING_TITLE_MODULES_ORDER_TOTAL', 'Modules Total Commande');
+define('HEADING_TITLE_MODULES_CHECKOUT_SUCCESS','Checkout Success Modules');
+
+define('TABLE_HEADING_MODULES', 'Modules');
+define('TABLE_HEADING_SORT_ORDER', 'Ordre de tri');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_MODULE_DIRECTORY', 'R&eacute;pertoire contenant les modules :');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Navigation Menu');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_CATEGORIES_LINKS', 'Categories / Links');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Products Image:</b><small><br>Main Image used in <br><u>catalog & description</u> pages.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Small Image:</b><br><small> Image on<br><u>products list</u> pages.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Image:</b><br><small> Large Image on<br><u>pop-up window</u> page.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Store Product/s Sharing this Image =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Remove</b> this Image from this Product?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>Delete</b> this Image from the Server (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Remove');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'Delete');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Small Images.</b> If a "SM" image is used<br>(Alone) NO Pop-up window link is created, the "SM"<br> will be placed directly under the products<br>description. If used in conjunction with an <br>"XL" image on the right, a Pop-up Window Link<br> is created and the "XL" image will be<br>shown in a Pop-up window.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Large Images.</b> Used for the Pop-up image<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Additional Images - These will appear below product description if used.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Image 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Image 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Image 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Image 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Image 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Image 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Image 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Image 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Image 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Image 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Image 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Image 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DELETE_IMAGE', 'Delete Image');
+
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Category heading title:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Category heading Description:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Category Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Category Description Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Category Key Word Meta Tag :');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method :');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Product Keywords :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Edit Product Attributes');
+
+// Added for Navigation Menu DMG
+
+define('TEXT_LINKS','Links');
+define('TEXT_HEADING_EDIT_CATEGORY','Edit Navigation Category');
+define('TEXT_HEADING_NEW_LINK','Create New Navigation Link');
+define('TEXT_LINK_NAME','Link Text : ');
+define('TEXT_LINK_PAGE','Link Target : ');
+define('TEXT_STATUS','Link Status : ');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: newsletters.php,v 1.2 2003/09/24 13:57:08 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gestionnaire de bulletin d\'informations');
+
+define('TABLE_HEADING_NEWSLETTERS', 'Bulletin d\'informations');
+define('TABLE_HEADING_SIZE', 'Taille');
+define('TABLE_HEADING_MODULE', 'Module');
+define('TABLE_HEADING_SENT', 'Envoyer');
+define('TABLE_HEADING_STATUS', 'Statut');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_NEWSLETTER_MODULE', 'Module :');
+define('TEXT_NEWSLETTER_TITLE', 'Titre du bulletin d\'informations :');
+define('TEXT_NEWSLETTER_CONTENT', 'Contenu :');
+
+define('TEXT_NEWSLETTER_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_NEWSLETTER_DATE_SENT', 'Date d\'envoi :');
+
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir supprimer ce bulletin d\'informations ?');
+
+define('TEXT_PLEASE_WAIT', 'Merci de patienter .. envois en cours ..<br><br>Merci de ne pas interrompre ce traitement !');
+define('TEXT_FINISHED_SENDING_EMAILS', 'Fini.. courrier &eacute;lectronique envoy&eacute;s !');
+
+define('ERROR_NEWSLETTER_TITLE', 'Erreur : Titre du bulletin d\'informations requis');
+define('ERROR_NEWSLETTER_MODULE', 'Erreur : Module bulletin d\'informations requis');
+define('ERROR_REMOVE_UNLOCKED_NEWSLETTER', 'Erreur : Merci de fermer le bulletin d\'informations avant de le supprimer.');
+define('ERROR_EDIT_UNLOCKED_NEWSLETTER', 'Erreur : Merci de fermer le bulletin d\'informations avant de l\'&eacute;diter.');
+define('ERROR_SEND_UNLOCKED_NEWSLETTER', 'Erreur : Merci de fermer le bulletin d\'informations avant de l\'envoyer.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/orderlist.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/orderlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/orderlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: orderlist.php,v 1.25 2003/06/20 00:28:44 vj Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Orderlist');
+define('HEADING_TITLE_STATUS', 'Status:');
+
+define('TABLE_HEADING_ORDER_ID', 'Order ID');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS_NAME', 'Product Name');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_NOTES', 'Notes');
+define('TABLE_HEADING_CHK', 'Chk');
+
+define('TEXT_ALL_ORDERS', 'All Orders');
+
+define('TEXT_DOWNLOAD', 'Download');
+define('TEXT_PRINT', 'Print');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,124 @@
+<?php
+/*
+  $Id: orders.php,v 1.22 2002/11/23 13:58:03 thomasamoulton Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('TABLE_HEADING_EDIT_ORDERS', 'To modify the order');
+
+define('HEADING_TITLE', 'Commandes');
+define('HEADING_IS_TITLE', 'IS Order');
+define('HEADING_IS_RECEIPT', 'IS Receipt');
+define('HEADING_TITLE_SEARCH', 'No de commande :');
+define('HEADING_TITLE_STATUS', 'Statut :');
+
+define('ENTRY_UPDATE_TO_CC', '(Update to <b>Credit Card</b> to view CC fields.)');
+define('TABLE_HEADING_COMMENTS', 'Commentaires');
+define('TABLE_HEADING_CUSTOMERS', 'Clients');
+define('TABLE_HEADING_ORDERID', 'Order ID');
+define('TABLE_HEADING_IS_ORDERNUM', 'IS Order');
+define('TABLE_HEADING_ORDER_TOTAL', 'Montant Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date d\'achat');
+define('TABLE_HEADING_STATUS', 'Statut');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_QUANTITY', 'Qt&eacute;.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Mod&egrave;le');
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_TAX', 'Taxe');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price'); 
+
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Prix (ht)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Prix (ttc)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ht)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (ttc)');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Client Notifi&eacute;;');
+define('TABLE_HEADING_DATE_ADDED', 'Date d\'ajout');
+
+//begin PayPal_Shopping_Cart_IPN
+define('TABLE_HEADING_PAYMENT_STATUS', 'Payment Status');
+//end PayPal_Shopping_Cart_IPN
+define('ENTRY_SUBURB', 'Compl&eacute;ment Adresse :');
+define('ENTRY_CITY', 'Ville :');
+define('ENTRY_CUSTOMER', 'Client :');
+define('ENTRY_STATE', 'D&eacutepartement :');
+define('ENTRY_SOLD_TO', 'VENDU A :');
+define('ENTRY_TELEPHONE', 'T&eacute;l&eacute;phone :');
+define('ENTRY_EMAIL_ADDRESS', 'Adresse E-Mail :');
+define('ENTRY_DELIVERY_TO', 'Livr&eacute; à; :');
+define('ENTRY_SHIP_TO', 'Envoy&eacute; à; :');
+define('ENTRY_SHIPPING_ADDRESS', 'Adresse de livraison :');
+define('ENTRY_BILLING_ADDRESS', 'Adresse de facturation :');
+define('ENTRY_PAYMENT_METHOD', 'Mode de paiement :');
+define('ENTRY_CREDIT_CARD_TYPE', 'Carte de Cr&eacute;dit :');
+define('ENTRY_CREDIT_CARD_OWNER', 'Propri&eacute;taire de la carte de cr&eacute;dit :');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Num&eacute;ro :');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Date d\'expiration :');
+define('ENTRY_CREDIT_CARD_CCV' , 'N° au dos de la CB:'); // cvv contribution
+define('ENTRY_CREDIT_CARD_START','Date de d&eacute;part CB');
+ define('ENTRY_CREDIT_CARD_ISSUE','Num&eacute;ro ISSUE CB');
+define('ENTRY_SUB_TOTAL', 'Sous-Total :');
+define('ENTRY_TAX', 'Taxe :');
+define('ENTRY_SHIPPING', 'Livraison :');
+define('ENTRY_TOTAL', 'Total :');
+define('ENTRY_DATE_PURCHASED', 'Date d\'achat :');
+define('ENTRY_STATUS', 'Statut :');
+define('ENTRY_DATE_LAST_UPDATED', 'Derni&egrave;re mise à jour :');
+define('ENTRY_NOTIFY_CUSTOMER', 'Client notifi&eacute; :');
+define('ENTRY_NOTIFY_COMMENTS', 'Commentaires ajout&eacute;s :');
+define('ENTRY_PRINTABLE', 'Imprimer Facture');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Effacer commande');
+define('TEXT_INFO_DELETE_INTRO', 'Voulez vous vraiment effacer cette commande ?');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Remettre les produits en stock');
+define('TEXT_DATE_ORDER_CREATED', 'Date Cr&eacute;ation:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Derni&egrave;re Modification :');
+define('TEXT_INFO_PAYMENT_METHOD', 'Mode de paiement :');
+define('TEXT_INFO_ABANDONDED', 'Abandoned');
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> CCV Code:  Not stored - due to processing regulations. Enable CCV email in module settings.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'Toutes les commandes');
+define('TEXT_NO_ORDER_HISTORY', 'Pas d\'autre historique disponible');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Mise à jour de la commande');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Num&eacute;ro de la commande :');
+define('EMAIL_TEXT_INVOICE_URL', 'Facture d&eacute;taill&eacute;e :');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date commande :');
+define('EMAIL_TEXT_STATUS_UPDATE',  'L\'&eacute;tat de votre commande a &eacute;t&eacute; mis à jour. ' . "<br><li>" . 'Nouvel &eacute;tat :<b> %s </b>' . "</li><br><br>" . 'Merci de r&eacute;pondre à cet email pour toute question.   ' . "<br><br>");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'Le commentaire pour votre commande est : ' . "<br><br>%s<br>");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Erreur : La commande n\'existe pas.');
+define('SUCCESS_ORDER_UPDATED', 'Succ&egrave;s : Votre commande a &eacute;t&eacute; mise à jour.');
+define('WARNING_ORDER_NOT_UPDATED', 'Attention : Aucun changement. La commande n\'a pas &eacute;t&eacute; mise à jour.');
+// begin replacement section for Email Subject contribution
+define('EMAIL_TEXT_SUBJECT_1', ' ' . STORE_NAME. ' Order Updated');
+define('EMAIL_TEXT_SUBJECT_2', ':  ');
+
+define('ORDER', 'Order #');
+define('ORDER_DATE_TIME', 'Order Date & Time');
+
+// end replacement section for Email Subject contribution
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/orders_status.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/orders_status.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/orders_status.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: orders_status.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Statut des commandes');
+
+define('TABLE_HEADING_ORDERS_STATUS', 'Statut des commandes');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_INFO_ORDERS_STATUS_NAME', 'Statut des commandes :');
+define('TEXT_INFO_INSERT_INTRO', 'Merci de compl&eacute;ter cette nouvelle commande avec les donn&eacute;es li&eacute;es');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir supprimer ce statut de commande ?');
+define('TEXT_INFO_HEADING_NEW_ORDERS_STATUS', 'Nouveau statut de commande');
+define('TEXT_INFO_HEADING_EDIT_ORDERS_STATUS', 'Editer statut de commande');
+define('TEXT_INFO_HEADING_DELETE_ORDERS_STATUS', 'Supprimer statut de commande');
+
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Erreur : Le statut par d&eacute;faut ne peut pas &ecirc;tre supprim&eacute;. Merci de choisir un autre statut par d&eacute;faut et de r&eacute;essayer');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Erreur : Ce statut de commande est actuellement utilis&eacute;.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Erreur : Ce statut de commande est d&eacute;j&agrave; utilis&eacute; dans l\'historique de commande.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/packingslip.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/packingslip.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/packingslip.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: packingslip.php,v 1.3 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_COMMENTS', 'Commentaires');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Mod&egrave;le');
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+
+define('ENTRY_SOLD_TO', 'VENDU A :');
+define('ENTRY_SHIP_TO', 'LIVRE A :');
+define('ENTRY_PAYMENT_METHOD', 'M&eacute;thode de paiement :');
+define('ENTRY_DATE_PURCHASED', 'Date de la commande :');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/pages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: pages.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Pages');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_TITLE', 'Title');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_PAGES_HEADING_DELETE_PAGE', 'Delete Page');
+
+define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this page?');
+
+define('TEXT_PAGES_CATEGORY', 'Category:');
+define('TEXT_DATE_PAGES_CREATED', 'Date Created:');
+define('TEXT_DATE_PAGES_LAST_MODIFIED', 'Date Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('ENTRY_TITLE', 'Title:');
+define('ENTRY_CATEGORY', 'Category:');
+define('ENTRY_BLURB', 'Blurb:');
+define('ENTRY_BODY', 'Body:');
+define('ENTRY_IMAGE', 'Image:');
+define('ENTRY_META_TITLE', 'Meta Title:');
+define('ENTRY_META_KEYWORDS', 'Meta Keywords:');
+define('ENTRY_META_DESCRIPTION', 'Meta Description:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_SORT_ORDER', 'Sort Order:');
+define('ENTRY_AUTHOR', 'Author:');
+
+define('TEXT_PAGES_ACTIVE', 'Active');
+define('TEXT_PAGES_INACTIVE', 'Inactive');
+
+define('TEXT_NO_CATEGORY', 'No Category');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> pages)');
+
+define('IMAGE_NEW_PAGE', 'New Page');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/pages_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/pages_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/pages_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: pages_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Define Page Categories');
+define('HEADING_TITLE_SEARCH', 'Search:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_PAGES_HEADING_NEW_PAGES_CATEGORY', 'New Category');
+define('TEXT_PAGES_HEADING_EDIT_PAGES_CATEGORY', 'Edit Category');
+define('TEXT_PAGES_HEADING_DELETE_PAGES_CATEGORY', 'Delete Category');
+
+define('TEXT_PAGES_CATEGORY_COUNT', 'Pages:');
+define('TEXT_PAGES_CATEGORY_STATUS', 'Status:');
+define('TEXT_PAGES_CATEGORY_DESCRIPTION', 'Description:');
+define('TEXT_PAGES_CATEGORY_SORT_ORDER', 'Sort Order:');
+define('TEXT_DATE_PAGES_CATEGORY_CREATED', 'Created:');
+define('TEXT_DATE_PAGES_CATEGORY_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_NEW_PAGES_CATEGORIES_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_EDIT_PAGES_CATEGORIES_INTRO', 'Please make any necessary changes');
+define('TEXT_DELETE_PAGES_CATEGORIES_INTRO', 'Are you sure you want to delete this category?');
+
+define('TEXT_PAGES_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_PAGES_CATEGORIES_DESCRIPTION', 'Category Description:');
+define('TEXT_PAGES_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_PAGES_CATEGORIES_SORT_ORDER', 'Sort Order:');
+define('TEXT_PAGES_CATEGORIES_STATUS', 'Status:');
+define('TEXT_PAGES_CATEGORIES_STATUS_ENABLE', 'Enable');
+define('TEXT_PAGES_CATEGORIES_STATUS_DISABLE', 'Disable');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>WARNING:</b> There are %s pages still linked to this category!');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAGES_CATEGORIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> categories)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/popup_data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/popup_data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/popup_data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: popup_data_help.php,v 1.1 $
+  
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Data Input/output Help');
+define('TEXT_INFO_HEADING_NEW_DATA', 'Data Input/output Help');
+
+define('TEXT_INFO_FROOGLE_HEADING_SET_CATEGORIES', 'Categories Help');
+define('TEXT_INFO_FROOGLE_HEADING_CONFIGURE', 'Configure Help');
+define('TEXT_INFO_FROOGLE_HEADING_PRE_FEED', 'Pre Feed Help');
+define('TEXT_INFO_FROOGLE_HEADING_RUN', 'Run Feed Help');
+
+define('TEXT_FROOGLE_SET_CATEGORIES_HELP', 'Run this step the first time you do a Froogle feed. <br> After you have run this the first time do this step only if you have added or changed categories.  This step is very process intense and time consuming for large sites. It will build all of your catagory paths for you.');
+define('TEXT_FROOGLE_CONFIGURE_HELP', 'You can build multiple configuration for the froogle feed. You must have at least one froogle configuration');
+define('TEXT_FROOGLE_PRE_FEED_HELP', 'In this step you will assemble the data into a text file that will be submitted to Froogle. If the process takes more then 1 minute you have a large store or there is a problem.');
+define('TEXT_FROOGLE_RUN_HELP', 'This is the last step. It will submit the feed directly to froogle if you have entered the correct FTP information in the configuration. You must wait 30 minute between submissions');
+
+define('TEXT_INFO_FROOGLE_FEED_NAME', 'Name of Feed Help');
+define('TEXT_INFO_FROOGLE_FEED_DISC', 'Data Feed Discription Help');
+define('TEXT_INFO_FROOGLE_FEED_FILE_TYPE', 'Data Feed File Type Help');
+define('TEXT_INFO_FROOGLE_FEED_TYPE', 'Feed Type Help');
+define('TEXT_INFO_FROOGLE_FEED', '<b>Froogle FTP information</b>');
+define('TEXT_INFO_FROOGLE_FEED_FEED_SERVICE', 'Feed Service Help');
+define('TEXT_INFO_FROOGLE_FEED_STATUS', 'Status Help');
+define('TEXT_INFO_FROOGLE_FEED_FILE', 'File name Help');
+define('TEXT_INFO_FROOGLE_FEED_IMAGE', 'Image URL Help');
+define('TEXT_INFO_FROOGLE_FEED_PRODUCT', 'Product URL Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_SERVER', 'Froogle FTP Server Name Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_USER', 'Froogle FTP User Name Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_PASSWORD', 'Froogle FTP Password Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_DIRECTORY', 'Froogle FTP Directory Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR', 'Use store Currency Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR_USE', 'Other currency Help');
+define('TEXT_INFO_FROOGLE_FEED_LANG', 'Use store languge Help');
+define('TEXT_INFO_FROOGLE_FEED_LANG_USE', 'Other languge Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR_CON', 'Convert Currency Help');
+define('TEXT_INFO_FROOGLE_FEED_TAX', 'Tax Class ID Help');
+
+
+define('TEXT_FROOGLE_FEED_NAME_HELP', 'Enter a unique name for this frogle feed.  You will use this name later in the process to identify this feed configuration..');
+define('TEXT_FROOGLE_FEED_DISC_HELP', 'Enter a short discription to identify this feed configuration. You can also add a few notes here to help discribe this feed');
+define('TEXT_FROOGLE_FEED_FILE_TYPE_HELP', 'Select the type of feed from the drop down. Use product for your normal product listing, Businees is for changing business information. ');
+define('TEXT_FROOGLE_FEED_TYPE_HELP', 'Use basic for a basic feed and advance for advance feed. <br> Note: not all of the advance feed items have been installed.');
+define('TEXT_FROOGLE_FEED_HELP', '<b>Froogle FTP information</b>');
+define('TEXT_FROOGLE_FEED_FEED_SERVICE_HELP', 'Select which feed this configuration is for. Only Froogle feed is installed. ');
+define('TEXT_FROOGLE_FEED_STATUS_HELP', 'Active or Inactive. Inactive configurations will not be available in the data feed page');
+define('TEXT_FROOGLE_FEED_FILE_HELP', 'Type in the file name of the file you want to store your feed in. Its should be unique and not duplicate in other feeds');
+define('TEXT_FROOGLE_FEED_IMAGE_HELP', 'Type in the patch to your product images, it should start from the images directory. <br> Example: http://mysite.com/images/categories/t_4647.jpg would be  categories/ ');
+define('TEXT_FROOGLE_FEED_PRODUCT_HELP', 'This is not used');
+define('TEXT_FROOGLE_FEED_FTP_SERVER_HELP', 'Name of the feed server. For froogle feed leave blank and hedwig.google.com will be used');
+define('TEXT_FROOGLE_FEED_FTP_USER_HELP', 'Enter the FTP user name you entered when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_FTP_PASSWORD_HELP', 'Enter the FTP user password you entered when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_FTP_DIRECTORY_HELP', 'Enter the FTP directory that you were assigned when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_CUR_HELP', 'False: Use the store default currency. If you click on this radio button you will use the default store currency. ');
+define('TEXT_FROOGLE_FEED_CUR_USE_HELP', 'If you checked True in the above line enter the alternete currency code here. It must be a currency code that the service knows.');
+define('TEXT_FROOGLE_FEED_LANG_HELP', 'False: Use store default language indicates that you want to use the store default language.');
+define('TEXT_FROOGLE_FEED_LANG_USE_HELP', 'If you entered true into the above line, Use the drop down box to choose a different language code.');
+define('TEXT_FROOGLE_FEED_CUR_CON_HELP', 'Convert to store currency when the visiter visits your store. Use this is you have multiple currencies in your store.');
+define('TEXT_FROOGLE_FEED_TAX_HELP', 'Enter the tax class ID number from the store or set to zero (0) for no tax caculation');
+
+
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/popup_ep_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/popup_ep_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/popup_ep_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+/*
+  $Id: popup_ep_help.php,v 1.1 $
+  
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Easy Populate Help');
+define('TEXT_INFO_HEADING_NEW_DATA', 'Easy Populate Help');
+
+define('TEXT_HEAD_HELP_EP_FILE_UPLOAD', 'File Up Load Help');
+define('TEXT_HELP_EP_FILE_UPLOAD', 'This allow you to upload the edited EPA file so it can be inputed in to your database.
+                                    There is a limit to the size of file you can upload. Usually this limit is 2mb. This is because of 
+                                    how PHP is usually installed. If this is a problem then try to limit the files size by using the
+                                    Limit number of products to Download options to make your file smaller. 
+                                    If the number of records in the file is more then 300 use the Upload and Split.');
+
+define('TEXT_HEAD_HELP_EP_FILE_UPLOAD_SPLIT', 'File Up Load and Split Help');
+define('TEXT_HELP_EP_FILE_UPLOAD_SPLIT', 'This allow you to upload the edited EPA file and split itinto smaller parts so it can be inputed into your databse.
+                                 As with the regular upload there is a limit on the file size of 2mb. Once you have Uploaded and Split
+                                 the EPA file. Use the " Import Data from file in temp/ " to insert each file into the database. The number or records you set
+                                 in the epconfigure will limit the records in the spilt files. This is done so the program will not time out.');
+
+define('TEXT_HEAD_HELP_EP_FILE_SPLIT', ' Split a EP File on the server');
+define('TEXT_HELP_EP_FILE_SPLIT', 'This allow you to spilt the edited EPA file it into smaller parts, after it has been uploaded to the server, so it can be inputed into your databse.
+                                 Once you have "Split a EP File on the server"
+                                 the EPA file. Use the " Import Data from file in temp/ " to insert each file into the database. The number or records you set
+                                 in the admin/epconfigure.php will limit the records in the spilt files. The current limit is 1,000 records but EPA can handle well over 2,000 records, this should take 3 to 4 minutes to insert. This is done so the program will not time out.');
+
+
+define('TEXT_HEAD_HELP_EP_FILE_INSERT', 'File Insert a File Help');
+define('TEXT_HELP_EP_FILE_INSERT', 'Select a file in the drop down box. This is a list the files that have been uploaded or split in the directory
+                                    You can choosen to store your EPA file on line. The number of records in each split is set in 
+                                    the ep configuration');
+
+define('TEXT_HEAD_HELP_EP_FILE_EXPORT', 'Export a file to edit Help');
+define('TEXT_HELP_EP_FILE_EXPORT', 'In this section you can create a export file to be edited in a spread sheet program. If the export file or resulting
+                                    edited file is over 2mb in size you can use the export controls to limit the the size by limiting the data you export.');
+
+define('TEXT_HEAD_HELP_EP_SELECT_METHOD', 'Select meathod to use for download Help');
+define('TEXT_HELP_EP_SELECT_METHOD', 'Here you can select one of two meathods for downloading your export file. "Download" method
+                                      will create a file to be saved it directly to your local computer. "Save to temp file on server"
+                                      will save the file to the temp directory you set in the ep configure. Later you can use a FTP program to
+                                      download the file');
+
+define('TEXT_HEAD_HELP_EP_SELECT_DOWN', 'Select feild groups to export Help');
+define('TEXT_HELP_EP_SELECT_DOWN', 'In this drop down is listed the pre_defined groups of feild that can be downloaded. Please see the
+                                    documentation for which feilds are in which groups.');
+
+define('TEXT_HEAD_HELP_EP_SELECT_SORT', 'Select sort order for export Help');
+define('TEXT_HELP_EP_SELECT_SORT', 'You can select the order your export rows apears in. This is used to group the rows in your export
+                                    file so they can be found easily. ');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_ROWS', 'Limit rows in your Export file Help');
+define('TEXT_HELP_EP_LIMIT_ROWS', 'This group of settings can be used to limit the size of your export file. This is done
+                                    if your import file is to large or you need to target certain record to be edited.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_CATS', 'Limit rows in your Export file by Categories Help');
+define('TEXT_HELP_EP_LIMIT_CATS', 'This will limit the contents of the export file to a specifice Category. When set to "Top" all
+                                  manufactures will be in the export file. When set to a specific category all sub categories will be included.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_MAN', 'Limit rows in your Export file by Manufacture Help');
+define('TEXT_HELP_EP_LIMIT_MAN', 'This will limit the contents of the export file to a specifice manufacture. When set to "Manufactures" all
+                                  manufacture swill be in the export file.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_PRODUCT', 'Limit rows in your Export file by Product_id Help');
+define('TEXT_HELP_EP_LIMIT_PRODUCT', 'This will limit the contents of the export file to a range of product_id\'s. ');
+
+define('TEXT_HELP_EP_LIMIT_PRODUCT1', '   1. If no product_id\'s are enter all of the product are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT2', '   2. If the begin product_id and no end product_id is entered. Products from the first product id to the end are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT3', '   3. If no beginning product_id\'s aand only and ending product_ID. From the first id to ending the products are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT4', '   4. If the begin product_id and ending product_id is enter then this range of products are in the export file');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/popup_infobox_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/popup_infobox_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/popup_infobox_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: popup_infobox_help.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Aide Infobox');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Aide Infobox');
+define('TEXT_INFOBOX_HELP_FILENAME', 'Cela repr&eacute;sente le nom du fichier box que vous avez mis dans votre r&eacute;pertoire </u>catalog/includes/boxes</u>.<br><br> En minuscule, avec espace remplacant les underscores (_) possible.<br><br>Par exemple:<br>Votre nouvelle Infobox s\'appelle <b>new_box.php</b>, vous devez saisir ici "<b> new box</b>"<br>');
+define('TEXT_INFOBOX_HELP_HEADING', 'C\'est tout simplement ce qui sera montr&eacute; au-dessus de l\'Infobox dans votre catalogue.<br><div align="center"><img border="0" src="images/help1.gif"><br></div>');
+define('TEXT_INFOBOX_HELP_DEFINE', 'Un exemple de cela serait : <b>BOX_HEADING_WHATS_NEW</b>.<br> Qui est alors employ&eacute; avec la logique principale de votre magasin comme cela : si vous ouvrez le fichier <u>catalog/includes/languages/french.php</u> Vous pouvez voir de nombreux exemples, ceux qui contiennent BOX_HEADING ne sont plus n&eacute;cessaires comme ils sont maintenant stock&eacute;s dans la base de donn&eacute;es et d&eacute;finis dans les fichiers <b> column_left.php </b> et <b> column_right.php </b.> <br>, mais il n\'y a aucun besoin de les supprimer!! ');
+define('TEXT_INFOBOX_HELP_COLUMN', 'Entrer soit <b>left</b> soit <b>right</b><br> Si vous voulez afficher l\'infobox dans la colonne de gauche -- saisissez <b>left</b> ou si vous la voulez dans la colonne de droite -- saisissez <b>right</b><br><br><br> Il faut choisir seulement l\'un d\'entre eux.<br><br>');
+define('TEXT_INFOBOX_HELP_POSITION', 'Saisissez ici un nombre que vous voulez. Plus grand sera le nombre, plus basse sera affich&eacute;e l\'infobox.<br><br> Si vous saisissez le m&ecirc;me nombre pour plusieurs infobox, elles apparaitront dans l\'ordre alphab&eacute;tique');
+define('TEXT_INFOBOX_HELP_ACTIVE', 'S&eacute;lectionner l\'un ou l\'autre <b>yes</b> ou <b>no</b>. <b>yes</b> affichera l\'Infobox et <b>no</b> ne l\'affichera pas.');
+define('TEXT_INFOBOX_HELP_TEMPLATE', 'Cela doit repr&eacute;senter le nom de fichier de la box o&ugrave; les fonctions pour vos box sont plac&eacute;es. Si vous avez un fichier sp&eacute;cial pour votre fonction il doit &ecirc;tre dans catalog/templates/(template name)/boxes.tpl.php 
+Cela doit &ecirc;tre en minuscule.
+
+Par exemple :
+Votre nouveau fichier de fonction Infobox template est un infobox standard o&ugrave; vous avez mis une fonction standard . Si vous employez une fonction sp&eacute;ciale pour vous, les box de renseignements mettent box.tpl.php ici et placent les fichiers dans catalog/templates/(nom_du_template)/boxes.tpl.php.');
+define('TEXT_INFOBOX_HELP_COLOR', 'You can use the pop_up color chart to select the color  for the font used in info box headers, <br> Just click on the color and the color code will apear in the text box..');
+define('TEXT_CLOSE_WINDOW', '<u>Fermez la fen&ecirc;tre</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/product_extra_fields.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/product_extra_fields.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/product_extra_fields.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: product_extra_fields.php,v 2.0 2004/11/09 15:07:21 ChBu Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Product Extra Fields');
+define('SUBHEADING_TITLE', 'Add a new field');
+
+define('TABLE_HEADING_FIELDS', 'Field Name');
+define('TABLE_HEADING_ORDER', 'Sort Order');
+define('TABLE_HEADING_LANGUAGE', 'Language');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('IMAGE_ADD_FIELD', 'Add new field');
+define('IMAGE_UPDATE_FIELDS', 'Update fields');
+define('IMAGE_REMOVE_FIELDS', 'Remove selected fields');
+
+define ('TEXT_ALL_LANGUAGES', 'All');

Added: trunk/direct.openmoko.com/admin/includes/languages/french/product_list_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/product_list_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/product_list_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Product List Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Product List Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADER_EXPLAIN', 'These settings effect all templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Product List configuration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Product List configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/products_attributes.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/products_attributes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/products_attributes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: products_attributes.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_OPT', 'Options produits');
+define('HEADING_TITLE_VAL', 'Valeur des options');
+define('HEADING_TITLE_ATRIB', 'Attributs des produits');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_PRODUCT', 'Nom du produit');
+define('TABLE_HEADING_OPT_NAME', 'Nom de l\'option');
+define('TABLE_HEADING_OPT_LANGUAGE', 'Language');
+define('TABLE_HEADING_OPT_TYPE', 'Option Type'); //CLR 031203 add option type column
+define('TABLE_HEADING_OPT_VALUE', 'Valeur de l\'option');
+define('TABLE_HEADING_OPT_PRICE', 'Prix de l\'option');
+define('TABLE_HEADING_OPT_PRICE_PREFIX', 'Pr&eacute;fixe');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_DOWNLOAD', 'Produits t&eacute;l&eacute;chargeable :');
+define('TABLE_HEADING_OPTION_COMMENTS', 'Comments');
+define('TABLE_HEADING_OPT_SIZE', 'Size');
+define('TABLE_TEXT_FILENAME', 'Nom du fichier :');
+define('TABLE_TEXT_MAX_DAYS', 'Jours d\'expiration :');
+define('TABLE_TEXT_MAX_COUNT', 'Compte de t&eacute;l&eacute;chargement maximal :');
+
+define('MAX_ROW_LISTS_OPTIONS', 10);
+
+define('TEXT_WARNING_OF_DELETE', 'Certains produits utilisent cette option - il n\'est pas recommand&eacute; de la supprimer.');
+define('TEXT_OK_TO_DELETE', 'Cette option n\'est utilis&eacute;e par aucun produit - Il est possible de la supprimer.');
+define('TEXT_OPTION_ID', 'ID option');
+define('TEXT_OPTION_NAME', 'Nom de l\'option');
+define('TEXT_OPTION_SORTORDER', 'Ordre de tri');
+
+define('TEXT_OPTION_SELECTION', 'Select a Option');
+
+define('JAVASCRIPT_TEXT_OPTION_TYPE_TEXT', 'Textual Option');
+
+define('SORT_ORDER', 'Sort Order');
+define('PRICE', 'Price');
+define('MISSING', '*** Missing');
+define('GOOD_FILE', 'Good File');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/products_expected.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/products_expected.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/products_expected.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: products_expected.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Produits en attente');
+
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_DATE_EXPECTED', 'Date pr&eacute;vue d\'arriv&eacute;e');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_DATE_EXPECTED', 'Date pr&eacute;vue d\'arriv&eacute;e:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/products_multi.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/products_multi.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/products_multi.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+/*
+  $Id: products_multi.php, v 2.0
+
+  autor: sr, 2003-07-31 / sr at ibis-project.de
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Multiple Products Manager');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_CATEGORIES_CHOOSE', 'Choose');
+define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Categories / Products');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('DEL_DELETE', 'delete product');
+define('DEL_CHOOSE_DELETE_ART', 'How to delete?');
+define('DEL_THIS_CAT', 'only in this category');
+define('DEL_COMPLETE', 'delete the complete product');
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_ATTENTION_DANGER', '<br><br><span class="dataTableContentRedAlert">!!! Attention !!! please read !!!</span><br><br><span class="dataTableContentRed">This tool alters the tables "products_to_categories" (and in case of \'delete the complete product\' even "products" and "products_description" among others; cf. function \'tep_remove_product\') - so a backup of these tables before each use of the tool is highly recommended, because:<br><br>This tool deletes, moves or copies all via checkbox selected products without any interim step or warning, that means immediately after clicking on the go-button.</span><br><br><span class="dataTableContentRedAlert">Please take care:</span><ul><li>Pay very great attention when using <strong>\'delete the complete product\'</strong>. This function deletes all selected products immediately, without interim step or warning, and completely from all tables where these products belong to.</strong></li><li>While choosing <strong>\'delete product only in this category\'</strong>, no products are deleted completely, but only their links to the actually opened category - even when it\'s the only category-link of the product, and without warning, that means: be careful with this delete tool as well.</li><li>While <strong>copying</strong>, products are not duplicated, they are only linked to the new category chosen.</li><li>Products are only <strong>moved</strong> resp. <strong>copied</strong> to a new category in case they do not exist there allready.</li></ul>');
+define('TEXT_MOVE_TO', 'move to');
+define('TEXT_CHOOSE_ALL', 'choose all');
+define('TEXT_CHOOSE_ALL_REMOVE', 'remove chosen');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in<br>&nbsp;<br><b>%s</b>');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE', 'Products Price:');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method:');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/removezip.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/removezip.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/removezip.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('ZIP_REMOVE_CHECK', 'Are you sure you want to delete this record?');
+define('ZIP_DELETE_CONFIRM_MESSAGE', 'Record Has Been Deleted');
+define('ZIP_DELETE_ERROR_MESSAGE', 'Unable to Delete Record');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: reviews.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Critiques');
+
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_RATING', 'Classement');
+define('TABLE_HEADING_DATE_ADDED', 'Date d\'ajout');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('ENTRY_PRODUCT', 'Produit :');
+define('ENTRY_FROM', 'De :');
+define('ENTRY_DATE', 'Date :');
+define('ENTRY_REVIEW', 'Critique :');
+define('ENTRY_REVIEW_TEXT', '<small><font color="#ff0000"><b>REMARQUE :</b></font></small>&nbsp;Le HTML n\'est pas traduit !&nbsp;');
+define('ENTRY_RATING', 'Classement :');
+
+define('TEXT_INFO_DELETE_REVIEW_INTRO', 'Etes vous sur de vouloir supprimer cette critique ?');
+
+define('TEXT_INFO_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_INFO_LAST_MODIFIED', 'Derni&egrave;re modification :');
+define('TEXT_INFO_IMAGE_NONEXISTENT', 'L\'IMAGE N\'EXISTE PAS');
+define('TEXT_INFO_REVIEW_AUTHOR', 'Auteur :');
+define('TEXT_INFO_REVIEW_RATING', 'Classement :');
+define('TEXT_INFO_REVIEW_READ', 'Lu :');
+define('TEXT_INFO_REVIEW_SIZE', 'Taille :');
+define('TEXT_INFO_PRODUCTS_AVERAGE_RATING', 'Classement moyen :');
+
+define('TEXT_OF_5_STARS', '%s sur 5 &eacute;toiles !');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>BON</b></font></small>');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>MAUVAIS</b></font></small>');
+define('TEXT_INFO_HEADING_DELETE_REVIEW', 'Supprimer critique');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/salemaker.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/salemaker.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/salemaker.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: salemaker.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Vendeur');
+
+define('TABLE_HEADING_SALE_NAME', 'Nom');
+define('TABLE_HEADING_SALE_DEDUCTION', 'Reduction');
+define('TABLE_HEADING_SALE_DATE_START', 'Date de debut');
+define('TABLE_HEADING_SALE_DATE_END', 'Date de fin');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_SALEMAKER_NAME', 'Nom du vendeur :');
+define('TEXT_SALEMAKER_DEDUCTION', 'R&eacute;duction :');
+define('TEXT_SALEMAKER_DEDUCTION_TYPE', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type:&nbsp;&nbsp;');
+define('TEXT_SALEMAKER_PRICERANGE_FROM', 'Gamme de prix du produit :');
+define('TEXT_SALEMAKER_PRICERANGE_TO', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
+define('TEXT_SALEMAKER_SPECIALS_CONDITION', 'Si ce produit est sp&eacute;cial :');
+define('TEXT_SALEMAKER_DATE_START', 'Date de d&eacute;but :');
+define('TEXT_SALEMAKER_DATE_END', 'Date de fin :');
+define('TEXT_SALEMAKER_CATEGORIES', '<b>Ou</b> v&eacute;rifiez les cat&eacute;gories auxquelles cette vente s\'applique :');
+define('TEXT_SALEMAKER_POPUP', '<a href="javascript:session_win();"><span class="errorText"><b>Cliquez ici pour les voir les conseil d\'usage du vendeur.</b></span></a>');
+define('TEXT_SALEMAKER_IMMEDIATELY', 'Immediatement');
+define('TEXT_SALEMAKER_NEVER', 'jamais');
+define('TEXT_SALEMAKER_ENTIRE_CATALOG', 'Cocher cette case si vous voulez que la vente soit appliqu&eacute;e &agrave; <b>tous les produits</b>:');
+define('TEXT_SALEMAKER_TOP', 'Catalogue en entier');
+
+define('TEXT_INFO_DATE_ADDED', 'Date d\'ajout:');
+define('TEXT_INFO_DATE_MODIFIED', 'Derni&egrave;re modification:');
+define('TEXT_INFO_DATE_STATUS_CHANGE', 'Dernier changement de statut:');
+define('TEXT_INFO_SPECIALS_CONDITION', 'Conditions sp&eacute;ciales:');
+define('TEXT_INFO_DEDUCTION', 'R&eacute;duction:');
+define('TEXT_INFO_PRICERANGE_FROM', 'Rabait:');
+define('TEXT_INFO_PRICERANGE_TO', ' &agrave; ');
+define('TEXT_INFO_DATE_START', 'D&eacute;but&eacute; :');
+define('TEXT_INFO_DATE_END', 'se termine:');
+
+define('SPECIALS_CONDITION_DROPDOWN_0', 'Ignorer les prix sp&eacute;ciaux');
+define('SPECIALS_CONDITION_DROPDOWN_1', 'Ignorer les conditions de vente');
+define('SPECIALS_CONDITION_DROPDOWN_2', 'Appliquez la r&eacute;duction de vente au prix sp&eacute;cial');
+
+define('DEDUCTION_TYPE_DROPDOWN_0', 'D&eacute;duire le montant');
+define('DEDUCTION_TYPE_DROPDOWN_1', 'Pourcent');
+define('DEDUCTION_TYPE_DROPDOWN_2', 'Nouveau Prix');
+
+define('TEXT_INFO_HEADING_COPY_SALE', 'Copiez la vente');
+define('TEXT_INFO_COPY_INTRO', 'Entrer un nom pour la copie de la vente<br>&nbsp;&nbsp;"%s"');
+
+define('TEXT_INFO_HEADING_DELETE_SALE', 'Supprimer la vente');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur vous voulez supprimer de mani&egrave;re permanente cette vente?');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/salemaker_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/salemaker_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/salemaker_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: salemaker_info.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Vendeur');
+define('SUBHEADING_TITLE', 'Conseil de vente du vendeur:');
+define('INFO_TEXT', '<ul>
+                      <li>
+                        Utiliser toujours un \'.\' point pour les prix d&eacute;cimaux et les promotions.
+                      </li>
+                      <li>
+                        Ecrivez les montants dans la m&ecirc;me monnaie que quand vous cr&eacute;ez ou &eacute;ditez un produit.
+                      </li>
+                      <li>
+                        Dans les champs de r&eacute;duction vous pouvez entrer un montant ou un pourcentage,
+                       ou remplacez le prix. (ex. d&eacute;duire 5.00 &euro; de tous les prix, d&eacute;duire  10% de tous les prix ou changer tous les prix &agrave; 25.00 &euro;)
+                      </li>
+                      <li>
+                        L\'entr&eacute;e &agrave; une gamme de prix r&eacute;duit la gamme de produit qui sera affect&eacute;e. (Ex. Produits de 50.00 &euro; à 150.00 &euro;)
+                      </li>
+                      <li>
+                        VOus devez choisir l\'action &agrave; prendre si un produit est sp&eacute;cial. <i>et</i> est sujet &agrave; cette vente:
+            <ul>
+                          <li>
+                            Ignorer les prix sp&eacute;ciaux<br>
+              La d&eacute;duction de vente sera appliqu&eacute;e au prix normal du produit.
+ (Ex. Prix normal 10.00 &euro;, le prix r&eacute;duit est de 9.50 &euro;, la Condition de Vente est 10 %.
+               Le prix final du produit sera de  9.00 &euro; &agrave; la  vente. Le prix r&eacute;duit est ignor&eacute;.)
+                          </li>
+                          <li>
+                            Ignorer la condition de vente<br>
+                            La d&eacute;duction sur la vente ne sera pas appliqu&eacute;e aux Promotions. Le prix de Promotion sera affich&eacute;
+ Quand il n\'y a aucune vente d&eacute;finie. (Ex. Prix normal 10.00 &euro;, le prix r&eacute;duit est de 9.50 &euro;, la Condition de Vente est 10 %.
+               Le prix final du produit sera de  9.00 &euro; &agrave; la  vente. Le prix r&eacute;duit est ignor&eacute;.)
+                          </li>
+                          <li>
+                            Appliquer la condition de vente aux produits en promotion<br>
+                            La d&eacute;duction sera appliqu&eacute;e aux produits en promotion. Un prix compos&eacute; sera affich&eacute;.
+                            (ex: Prix normal 10.00, Le prix promotionnel sera de $9.50, La condition de Vente est de 10 %. Le prix final du produit sera de 8.55 &euro;. En compl&eacute;ment de 10 % du prix de Promotion
+                          </li>
+                        </ul>
+                      </li>
+                      <li>
+                        Laisser la date de d&eacute;but vide entrainera la vente imm&eacute;diate du produit.
+                      </li>
+                      <li>
+                        Laissez la date de fin vide si vous ne voulez pas que la vente expire.</li>
+                      <li>
+                        La s&eacute;lection d\'une cat&eacute;gorie inclut automatiquement les sous-cat&eacute;gories.
+                      </li>
+                    </ul>');
+define('TEXT_CLOSE_WINDOW', '[ Fermer la fen&ecirc;tre ]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/server_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/server_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/server_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: server_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Informations serveur');
+
+define('TITLE_SERVER_HOST', 'H&ocirc;te :');
+define('TITLE_SERVER_OS', 'Syst&egrave;me d\'exploitation :');
+define('TITLE_SERVER_DATE', 'Date du serveur :');
+define('TITLE_SERVER_UP_TIME', 'Temps de fonctionnement :');
+define('TITLE_HTTP_SERVER', 'Serveur HTTP :');
+define('TITLE_PHP_VERSION', 'Version PHP :');
+define('TITLE_ZEND_VERSION', 'Zend :');
+define('TITLE_DATABASE_HOST', 'H&ocirc;te de la base de donn&eacute;es :');
+define('TITLE_DATABASE', 'Base de donn&eacute;es :');
+define('TITLE_DATABASE_DATE', 'Date de la base de donn&eacute;es :');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+define('HEADING_TITLE','ShipWire World Class Fullfillment Services');
+define('CONTENT_TEXT1','<div ALIGN="center"><table BORDER="0" CELLPADDING="0" STYLE="border-collapse: collapse" WIDTH="100%" ID="table1"><tr><td style="padding-right:20px"><FONT face="arial, helvetica, sans-serif"><table border="0" width="100%" id="table744" cellspacing="0" cellpadding="0"><tr><td width="630" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                    '<span class="main"><b>Receive, store, and ship merchandise right from CRE Loaded!</b></span><br><span class="smallText">100% integrated with your CRE Loaded application, our Shipwire module sends orders from CRE Loaded directly to your Shipwire fulfillment center. Take advantage of Shipwire’s volume discounts and have your orders automatically packaged and shipped, often for less than the cost of standard shipping.</span>' . 
+                                    '<p><span class="main"><b>What is Shipwire?</b></span><br><span class="smallText">Shipwire is a popular order fulfillment service that allows you to store merchandise in massive Chicago and Los Angeles warehouses. Then as each order comes into your online store, Shipwire will pack and ship it for you.</p>' . 
+                                    '<p><span class="smallText">You can add a Shipwire account with just a few clicks of the mouse - no programming involved. If you\'re just starting out, or looking for a better way to manage your shipping and handling, Shipwire offers an easy and quick way to outsource shipping with no startup, receiving, storage or packaging fees. You just pay $79.95 a month, plus a Shipwire handling fee on the merchandise that they ship. Handling fees range from $1 to $1.50 an item and depend on the type of handling your product needs. </span></p>' . 
+                                    '<p><span class="smallText">With Shipwire, your customers can receive merchandise anywhere in the world, serviced by the USPS, UPS or one of our freight partners. With facilities shipping more than 200,000 orders a month, they can customize your merchandise with assembly and kitting services at extremely affordable prices.</span></p>' .
+                                    '<p><span class="smallText">Shipwire makes it simple to automate order fulfillment on your site: Get approved in 24 hours. As soon as you enter your SKU information and send them your initial inventory, they can start shipping your orders.</span></p>' . 
+                                    '<p><span class="smallText">Shipwire makes extensive efforts to help you accurately monitor shipping and handling costs. Shipwire\'s reporting tools help you understand your inbound and outbound shipping, and automate time-consuming bookkeeping tasks.</span></p>');
+
+define('CONTENT_TEXT2','<span class="smallText"><p>Check out our <a TARGET="_blank" HREF="http://www.creloaded.com/Add-Ons/c22/p77/Shipwire_Pro_Checkout_Success_Module_-_Now_Handles_Mixed_Orders/product_info.html"><b>Shipwire Pro Checkout Success Module</b></a>, which allows you to manage mixed orders; send only those products you choose via Shipwire from a successful order.</span>' .
+                                     '<br>&nbsp;</p></td><td width="30" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">&nbsp;</td><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:13px;font-family:Arial; color:#000002">' . 
+                                     '<span class="lb08"><img src="images/pixel_trans.gif" width="20" height="30" /><table border="0" cellpadding="0" cellspacing="0" id="table745" width="190"><tr style="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '<td width="5" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="5" height="1" alt=""></td><td width="87%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="166" height="1" alt=""></td><td width="5" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="5" height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002" >' . 
+                                     '<img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr style="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">');
+
+define('CONTENT_TEXT3','<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '</tr><tr><td bgcolor="#CFCFCF" height="40" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif"><td height="40" bgcolor="#E7EFFF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="5" height="1" alt=""></td></FONT>' .
+                                     '<td class="body" height="40" bgcolor="#E7EFFF" colspan="8"><p style="margin-top: 4px; margin-bottom: 4px"><font face="Arial" color="#003399" style="font-size: 16pt">Basic</font></p><p style="margin-top: 4px; margin-bottom: 4px"><span style="font-weight: 700"> <font face="Arial" size="3" color="#666666">$79.95/mo</font></span></td><font face="arial, helvetica, sans-serif">' .
+                                     '<td bgcolor="#CFCFCF" height="40" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></FONT></tr><tr><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>  <td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr><td bgcolor="#CFCFCF" height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '<td height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="7" height="1" alt=""></td><td class="body" height="25" colspan="8"><br><font color="#666666">No setup fee,<br>$1 to $1.50 handling fee</font><font color="#003399"><br>&nbsp;</font><table cellpadding="0" cellspacing="0" border="0" id="table746">' .
+                                     '<tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table747"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table748"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt">');
+
+define('CONTENT_TEXT4','<img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Easy setup with your store</font></span></span></font></td>' .
+                                     '</tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table749"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table750"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '  <FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002">' .
+                                     '<span class="lb08"><font face="Arial" color="#666666">Online inventory manager</font></span></span></font></td></tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table751"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table752">' .
+                                     '<tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Sell up to 50 items</font></span></span></font></td></tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table753"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<table border="0" width="100%" cellspacing="0" cellpadding="0" id="table754"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td>');
+
+define('CONTENT_TEXT5','<td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Unlimited email support</font></span></span></font></td></tr></table></td></tr></table><p ALIGN="center"><span style="font-family: Verdana; font-size: 10px; color:#000002">' .
+                                     '<font face="Arial" size="2" color="#000000"><a TARGET="_blank" HREF="http://www.shipwire.com/exec/creloaded.php?ref=6133361"><input type="button" value="Free Sign Up" onclick="\'document.location.href=create_account.php\'" style="font-family:Arial; font-size:13px; "></a>&nbsp;&nbsp;&nbsp; </font></span><br><br>&nbsp;&nbsp;</p></td><td bgcolor="#CFCFCF" height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif"><td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif" size="2"><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"></FONT></FONT></tr></table></span></span></font></td></tr></table></font></td></tr></table></div>');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/shopbyprice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/shopbyprice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/shopbyprice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: tax_classes.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Achat par prix');
+
+define('TABLE_HEADING_OPTIONS', 'Achat par Options');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_OPTION_1', 'Propri&eacute;t&eacute;s');
+define('TEXT_INFO_OPTION_2', 'Achat par tranches de prix');
+
+define('TEXT_EDIT_HEADING_OPTIONS', 'Options:');
+define('TEXT_EDIT_OPTIONS_INTRO', 'Nombre de tranches support&eacute;es.  En option vous pouvez inclure un " avant et apr&egrave;s le nombre.');
+define('TEXT_EDIT_ERROR_RANGES', 'Le nombre de tranches doit être num&eacute;rique.');
+
+define('TEXT_EDIT_HEADING_RANGE', 'Tranches:');
+define('TEXT_EDIT_RANGE_INTRO', 'La limite de tranches doit être dans l\'ordre ascendant.');
+define('TEXT_EDIT_ERROR_RANGE', 'Le champ tranches doit être dans l\'ordre ascendant.');
+define('TEXT_EDIT_ERROR_NUMERIC', 'Le champ tranches n\'est pas num&eacute;rique.');
+
+define('TEXT_INFO_RANGES', 'Nombres de tranches:');
+define('TEXT_INFO_OPTIONS_DESCRIPTION', 'Mettre le nombres de tranches à 0 pour d&eacute;activer le module.');
+define('TEXT_INFO_OVER', 'G&eacute;n&eacute;ration automatique des tranches:');
+
+define('TEXT_INFO_ZERORANGE', 'Cette fonction est actuellement d&eacute;activ&eacute;e.  Pour l\'activer, entrer un num&eacute;ro sup&eacute;rieur à z&eacute;ro dans les propri&eacute;t&eacute;s.');
+define('TEXT_INFO_NORANGE', 'Aucunes informations de tranche n\'a &eacute;t&eacute; saisie.');
+define('TEXT_INFO_UNDER', 'Sous&nbsp;');
+define('TEXT_INFO_FROM', 'De&nbsp;');
+define('TEXT_INFO_TO', '&nbsp;à&nbsp;');
+define('TEXT_INFO_ABOVE', '&nbsp;et plus');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/specials.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: specials.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Promotions');
+
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_PRODUCTS_PRICE', 'Prix du Produits');
+define('TABLE_HEADING_STATUS', 'Statut');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_SPECIALS_PRODUCT', 'Produit :');
+define('TEXT_SPECIALS_SPECIAL_PRICE', 'Prix promotionnel :');
+define('TEXT_SPECIALS_EXPIRES_DATE', 'Date d\'expiration :');
+define('TEXT_SPECIALS_PRICE_TIP', '<b>Remarque sur les promotions :</b><ul><li>Vous pouvez entrer un pourcentage dans le champs prix remis&eacute;, par exemple : <b>20%</b></li><li>Si vous entrez un prix, le s&eacute;parateur d&eacute;cimal doit &ecirc;tre un \'.\' (point d&eacute;cimal), exemple: <b>49.99</b></li><li>Laissez la date d\'&eacute;ch&eacute;ance vide pour aucune expiration</li></ul>');
+
+define('TEXT_INFO_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_INFO_LAST_MODIFIED', 'Derni&egrave;re modification :');
+define('TEXT_INFO_NEW_PRICE', 'Nouveau Prix :');
+define('TEXT_INFO_ORIGINAL_PRICE', 'Prix original :');
+define('TEXT_INFO_PERCENTAGE', 'Pourcentage :');
+define('TEXT_INFO_EXPIRES_DATE', 'Expire le :');
+define('TEXT_INFO_STATUS_CHANGE', 'Changement de statut :');
+
+define('TEXT_INFO_HEADING_DELETE_SPECIALS', 'Supprimer la promotion');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir supprimer cette promotion ?');
+// Eversun mod for sppc and qty price breaks
+define('TEXT_SPECIALS_GROUPS', 'Customer Group:');
+// Eversun mod end for sppc and qty price breaks
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/specialsbycategory.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/specialsbycategory.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/specialsbycategory.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: specialsbycategory.php,v 1.0 2005/04/24 23:41:21 calimeross Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('HEADING_TITLE', 'Specials by Category');
+define('TEXT_SELECT_CAT', 'First Select Category');
+define('TEXT_SELECT_MAN', '<br>and/or Manufacturer');
+define('TEXT_ENTER_DISCOUNT','Enter Your Discount');
+define('TEXT_PCT_AND','% and');
+define('TEXT_BUTTON_SUBMIT', 'Submit');
+
+define('TEXT_INSTRUCT_1','Leaving discount blank will show all products in selected category.');
+define('TEXT_INSTRUCT_2','Entering 0 discount will remove all specials in selected category.');
+
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_PRODUCTS_PRICE', 'Products Price');
+define('TABLE_HEADING_SPECIAL_PRICE', 'Special Price');
+define('TABLE_HEADING_PCT_OFF', '%Off');
+define('TABLE_HEADING_FULL_PRICE', 'Full Price');
+
+define('TEXT_BUTTON_UPDATE', 'Update');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_articles_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_articles_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_articles_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_articles_viewed.php,v 1.5 2005/03/01 15:51:03 info at bridegroompress.com Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Best Viewed Articles');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_ARTICLES', 'Articles');
+define('TABLE_HEADING_VIEWED', 'Viewed');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_credits.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_credits.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_credits.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.9 2002/03/30 15:03:59 harley_vb Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Credit Stats');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_CUSTOMERS', 'Customer');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Credit');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Le meilleur client');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_CUSTOMERS', 'Clients');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Total achet&eacute;');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_customers_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_customers_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_customers_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: stats_customers_orders.php,v 1.2 24 mars 2004 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  originally developed by xaglo
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE', 'Statistiques clients');
+define('HEADING_MONTH', 'Afficher pour le mois:');
+define('HEADING_YEAR', 'Afficher pour l\'ann&eacute;e:');
+define('HEADING_NUMBER_ORDERS', 'Nombre d\'achats<br>minimum:');
+define('HEADING_TITLE_NO_STATUS', 'Masquer les commandes:');
+define('HEADING_TITLE_STATUS', 'N\'afficher que les commandes:');
+define('TEXT_NO_ORDERS', 'Aucune');
+define('TEXT_ALL_ORDERS', 'Toutes');
+define('TEXT_ALL_MOIS', 'Tous les mois');
+define('TEXT_ALL_ANNEE', 'Toutes les ann&eacute;es');
+define('NEW_CUSTOMERS', 'Nouveaux clients:');
+define('NUMBER_ORDER', 'Nombre de commandes:');
+define('CUSTOMERS_BOUGHT', 'Clients ayant achet&eacute;:');
+define('NEW_CUSTOMERS_BOUGHT', 'Nouveaux clients ayant achet&eacute;:');
+define('TEXT_MINI_ORDERED', 'Clients ayant d&eacute;j&agrave; fait au moins <b>%s</b> achat(s):');
+define('TOTAL_TTC', 'Total ventes TTC:');
+define('TOTAL_TAX', 'Total taxes:');
+define('TOTAL_SHIPPING', 'Total frais d\'envoi:');
+define('TOTAL_HT', 'Total ventes HT:');
+define('BASKET_TTC', 'Vente moyenne TTC:');
+define('BASKET_HT', 'Panier moyen, articles HT:');
+define('JAN', 'Janvier');
+define('FEV', 'F&eacute;vrier');
+define('MAR', 'Mars');
+define('AVR', 'Avril');
+define('MAI', 'Mai');
+define('JUN', 'Juin');
+define('JUI', 'Juillet');
+define('AOU', 'Août');
+define('SEP', 'Septembre');
+define('OCT', 'Octobre');
+define('NOV', 'Novembre');
+define('DEC', 'D&eacute;cembre');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_daily_products_sales_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_daily_products_sales_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_daily_products_sales_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  Written by Marc Sauton, September 2004
+  Daily Product Report Contribution for the OsCommerce Community
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Daily products sales report');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_ORDER_QUANTITY', 'Order Quantity');
+define('TABLE_HEADING_PRODUCT_NAME', 'Product Name');
+define('TABLE_HEADING_PRODUCT_MODEL', 'Product Model');
+define('TABLE_HEADING_UNITPRICE', 'Unit Price');
+define('TABLE_HEADING_PRODUCT_QUANTITY', 'Product Quantity');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Total Purchased');
+
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> customers)');
+define('TEXT_BUTTON_REPORT_SAVE','Save CSV');
+
+define('TABLE_DAILY_VALUE', 'Daily value: $ ');
+define('DISPLAY_ANOTHER_REPORT_DATE', 'Display another report for this date: ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_monthly_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_monthly_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_monthly_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,105 @@
+<?php
+/*
+  $Id: stats_monthly_sales.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Rapport mensuel des commandes et taxes');
+define('HEADING_TITLE_STATUS','Statut : ');
+define('HEADING_TITLE_REPORTED','Report&eacute;es');
+define('TEXT_DETAIL','Detail');
+define('TEXT_ALL_ORDERS', 'Toutes les commandes');
+define('TEXT_NOTHING_FOUND', 'Aucune entr&eacute;e trouv&eacute;e dans la s&eacute;lection date/statut');
+define('TEXT_BUTTON_REPORT_BACK','Back');
+define('TEXT_BUTTON_REPORT_INVERT','Invert');
+define('TEXT_BUTTON_REPORT_PRINT','Imprimer');
+define('TEXT_BUTTON_REPORT_HELP','Aide');
+define('TEXT_BUTTON_REPORT_SAVE','Save CSV');
+define('TEXT_BUTTON_REPORT_BACK_DESC', 'Return to summary by months');
+define('TEXT_BUTTON_REPORT_INVERT_DESC', 'Invert rows top to bottom');
+define('TEXT_BUTTON_REPORT_PRINT_DESC', 'Voir rapport dans une fenetre imprimable');
+define('TEXT_BUTTON_REPORT_HELP_DESC', 'A propos de ce rapport et comment utiliser ses fonctionnalit&eacute;s');
+define('TEXT_BUTTON_REPORT_GET_DETAIL', 'Click to report daily summary for this month');
+define('TEXT_REPORT_DATE_FORMAT', 'j M Y -   g:i a'); // date format string
+//  as specified in php manual here: http://www.php.net/manual/en/function.date.php
+
+define('TABLE_HEADING_YEAR','Ann&eacute;e');
+define('TABLE_HEADING_MONTH', 'Mois');
+define('TABLE_HEADING_DAY', 'Jours');
+define('TABLE_HEADING_INCOME', 'Profit brut');
+define('TABLE_HEADING_SALES', 'Ventes des produits');
+define('TABLE_HEADING_NONTAXED', 'Ventes exemptes');
+define('TABLE_HEADING_TAXED', 'Ventes avec taxes');
+define('TABLE_HEADING_TAX_COLL', 'Taxes rapport&eacute;es');
+define('TABLE_HEADING_SHIPHNDL', 'Livraisons et manutentions');
+define('TABLE_HEADING_SHIP_TAX', 'Tax on<br /> Shipping');
+define('TABLE_HEADING_LOWORDER', 'Charges des commandes basses');
+define('TABLE_HEADING_OTHER', 'Ch&eacute;ques<br> Cadeaux');  // could be any other extra class value
+define('TABLE_FOOTER_YTD','YTD');
+define('TABLE_FOOTER_YEAR','ANNEE');
+define('TEXT_HELP', '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title>Monthly Sales/Tax Report</title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<BODY>
+<center>
+<table width="95%"><tr><td>
+<p class="main" align="center">
+<b>How to view and use the store income summary report</b>
+<p class="main" align="justify">
+<b>Reporting store activity by month</b>
+<p class="smallText" align="justify">
+When initially selected from the Reports menu, this report displays a financial summary of all orders in the store database, by month.  Each month of the store\'s history is summarized in a row, showing the store income and its components, and listing the amounts of taxes, shipping and handling charges, low order fees and gift vouchers. (If the store does not have low order fees or gift vouchers enabled, these columns are omitted from the report.)  Activity is reported as of the date of purchase.
+<p class="smallText" align="justify">
+The top row is the current month, and the rows under it summarize each month of the store\'s order history.  Beneath the rows of each calendar year is a footer line, summarizing that year\'s totals in each column of the report. 
+<p class="smallText" align="justify">
+To invert the order of the rows, click the "Invert" button.
+<p class="main" align="justify">
+<b>Reporting monthly summary by days</b>
+<p class="smallText" align="justify">
+The summary of daily activity within any month may be displayed by clicking on the month\'s name, at the left of the row.  To return from the daily summary to the monthly summary, click the "Back" button in the daily display.
+<p class="main" align="justify">
+<b>What the columns represent (headers explained)</b>
+<p class="smallText" align="justify">
+On the left, the month and year of the row are stated.  The other columns are, left to right:
+<ul><li class="smallText"><b>Gross Income</b> - the total of all orders  
+<li class="smallText"><b>Order Subtotal</b> - the total sales of products purchased in the month
+<br>Then, the product sales are broken into two categories:
+<li class="smallText"><b>Nontaxed sales</b> - the subtotal of sales which were not taxed, and 
+<li class="smallText"><b>Taxed sales</b> - the subtotal of sales which were taxed
+<li class="smallText"><b>Taxes collected</b> - the amount collected from customers for taxes
+<li class="smallText"><b>Shipping & handling</b> - the total shipping and handling charges collected  
+<li class="smallText"><b>Tax on shipping</b> - Tax on shipping and handling charges
+<li class="smallText"><b>Low order fees</b> and <b>Gift Vouchers</b> - if the store has low order fees enabled, and/or gift vouchers, the totals of these are shown in separate columns
+</ul>
+<p class="main" align="justify">
+<b>Selecting report summary by status</b>
+<p class="smallText" align="justify">
+To show the monthly or daily summary information for just one Order Status, select the status in the drop-down box at the upper right of the report screen.  Depending on the store\'s setup for these values, there may be a status for "Pending" or "Shipped" for instance.  Change this status and the report will be recalculated and displayed. 
+<p class="main" align="justify">
+<b>Showing detail of taxes</b>
+<p class="smallText" align="justify">
+The amount of tax in any row of the report is a link to a popup window, which shows the name of the tax classes charged and their individual amounts.
+<p class="main" align="justify">
+<b>Printing the report</b>
+<p class="smallText" align="justify">
+To view the report in a printer-friendly window, click on the "Print" button, then use your browser\'s print command in the File menu.  The store name and headers are added to show what orders were selected, and when the report was generated. 
+<p class="main" align="justify">
+<b>Saving report values to a file</b>
+<p class="smallText" align="justify">
+To save the values of the report to a local file, click on the Save CSV button at the bottom of the report.  The report values will be sent to your browser in a text file, and you will be prompted with a Save File dialog box to choose where to save the file.  The contents of the file are in Comma Separated Value (CSV) format, with a line for each row of the report beginning with the header line, and each value in the row is separated by commas. This file can be conveniently and accurately imported to common spreadsheet financial and statistical tools, such as Excel and QuattroPro. The file is provided to your browser with a suggested file name consisting of the report name, status selected, and date/time. <br><br>
+<p class="smallText">v 2.1.1
+</td></tr>
+</table>
+</BODY>
+</HTML>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_not_valid_users.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_not_valid_users.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_not_valid_users.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id:$
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+
+ define('TABLE_HEADING_DELETE', 'Delete');
+ define('TABLE_HEADING_ID', 'Customer ID');
+ define('TABLE_HEADING_CUSTOMERS', 'Username');
+ define('TABLE_HEADING_EMAIL', 'Email');
+ define('TABLE_HEADING_LAST_LOGON', 'Last login');
+ define('HEADING_TITLE', 'Customers Not Validated');
+ define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+ define('SIU_BACK', 'Back');
+ define('SIU_DELETE', 'Delete!');
+ define('SIU_CUSTOMER_DELETED', 'Customer %s deleted!');
+ define('SURE_TO_DELETE', 'Are you sure you want to delete the user %s?');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_notifications.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: stats_products_viewed.php,v 1.1 2003/05/16 00:10:05 ft01189 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Products Notifications');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_COUNT', 'Notifications Count');
+define('TABLE_HEADING_NAME', 'Customer Name');
+define('TABLE_HEADING_EMAIL', 'Customer Email Address');
+define('TABLE_HEADING_DATE', 'Notification Set on');
+define('TEXT_DESCRIPTION', 'Allows you to see the number of customer notifications per product. Click on product name to see details. ');
+define('TEXT_DESCRIPTION_TO', 'Allows you to see the customers that wanted to be notified for ');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_purchased.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_purchased.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_purchased.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_products_purchased.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Les produits les plus achet&eacute;s');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_PURCHASED', 'Achet&eacute;');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_products_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_products_viewed.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Les produits les plus consult&eacute;s');
+
+define('TABLE_HEADING_NUMBER', 'No.');
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_VIEWED', 'Vu');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/stats_sales_report2.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/stats_sales_report2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/stats_sales_report2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.9 2002/03/30 15:03:59 harley_vb Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('REPORT_DATE_FORMAT', 'M. J. A');
+
+define('HEADING_TITLE', 'Rapport des ventes');
+
+define('REPORT_TYPE_YEARLY', 'Annuel');
+define('REPORT_TYPE_MONTHLY', 'Mensuel');
+define('REPORT_TYPE_WEEKLY', 'Hebdomadaire');
+define('REPORT_TYPE_DAILY', 'Journalier');
+define('REPORT_START_DATE', 'De la date');
+define('REPORT_END_DATE', 'à la date (incluse)');
+define('REPORT_DETAIL', 'détail');
+define('REPORT_MAX', 'Montrer en premier');
+define('REPORT_ALL', 'Tout');
+define('REPORT_SORT', 'Trier');
+define('REPORT_EXP', 'Exporter');
+define('REPORT_SEND', 'Envoyer');
+define('EXP_NORMAL', 'Normal');
+define('EXP_HTML', 'Seulement HTML');
+define('EXP_CSV', 'CSV');
+
+define('TABLE_HEADING_DATE', 'Date');
+define('TABLE_HEADING_ORDERS', '#Commandes');
+define('TABLE_HEADING_ITEMS', '#Articles');
+define('TABLE_HEADING_REVENUE', 'Revenu');
+define('TABLE_HEADING_SHIPPING', 'Envoi');
+
+define('DET_HEAD_ONLY', 'Pas de détail');
+define('DET_DETAIL', 'Montrer les détails');
+define('DET_DETAIL_ONLY', 'Détails avec montant');
+
+define('SORT_VAL0', 'standard');
+define('SORT_VAL1', 'description');
+define('SORT_VAL2', 'description desc');
+define('SORT_VAL3', '#Artciles');
+define('SORT_VAL4', '#Articles desc');
+define('SORT_VAL5', 'Revenu');
+define('SORT_VAL6', 'Revenu desc');
+
+define('REPORT_STATUS_FILTER', 'Statut');
+
+define('SR_SEPARATOR1', ';');
+define('SR_SEPARATOR2', ';');
+define('SR_NEWLINE', '\n\r');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/tax_classes.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/tax_classes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/tax_classes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: tax_classes.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Classes fiscales');
+
+define('TABLE_HEADING_TAX_CLASSES', 'Classes fiscales');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_INFO_CLASS_TITLE', 'Titre de la classe fiscale :');
+define('TEXT_INFO_CLASS_DESCRIPTION', 'Description :');
+define('TEXT_INFO_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_INFO_LAST_MODIFIED', 'Derni&egrave;re modification :');
+define('TEXT_INFO_INSERT_INTRO', 'Merci d\'entrer la nouvelle classe fiscale avec ses donn&eacute;es li&eacute;es');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir supprimer cette classe fiscale ?');
+define('TEXT_INFO_HEADING_NEW_TAX_CLASS', 'Nouvelle classe fiscale');
+define('TEXT_INFO_HEADING_EDIT_TAX_CLASS', 'Editer classe fiscale');
+define('TEXT_INFO_HEADING_DELETE_TAX_CLASS', 'Supprimer classe fiscale');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/tax_rates.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/tax_rates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/tax_rates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: tax_rates.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Taux fiscaux');
+
+define('TABLE_HEADING_TAX_RATE_PRIORITY', 'Priorit&eacute;');
+define('TABLE_HEADING_TAX_CLASS_TITLE', 'Classe fiscale');
+define('TABLE_HEADING_COUNTRIES_NAME', 'Pays');
+define('TABLE_HEADING_ZONE', 'Zone');
+define('TABLE_HEADING_TAX_RATE', 'Taux fiscaux');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_INFO_DATE_ADDED', 'Date d\'ajout :');
+define('TEXT_INFO_LAST_MODIFIED', 'Derni&egrave;re modification :');
+define('TEXT_INFO_CLASS_TITLE', 'Titre du taux fiscal :');
+define('TEXT_INFO_COUNTRY_NAME', 'Pays :');
+define('TEXT_INFO_ZONE_NAME', 'Zone :');
+define('TEXT_INFO_TAX_RATE', 'Taux fiscal (%) :');
+define('TEXT_INFO_TAX_RATE_PRIORITY', 'Des taux fiscaux ayant la m&ecirc;me priorit&eacute; sont ajout&eacute;s, d\'autres sont combin&eacute;s.<br><br>Priorit&eacute; :');
+define('TEXT_INFO_RATE_DESCRIPTION', 'Description :');
+define('TEXT_INFO_INSERT_INTRO', 'Merci d\'entrer le nouveau taux fiscal avec ses donn&eacute;es li&eacute;es');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous s&ucirc;r de vouloir supprimer ce taux fiscal ?');
+define('TEXT_INFO_HEADING_NEW_TAX_RATE', 'Nouveau taux fiscal');
+define('TEXT_INFO_HEADING_EDIT_TAX_RATE', 'Editer le taux fiscal');
+define('TEXT_INFO_HEADING_DELETE_TAX_RATE', 'Supprimer le taux fiscal');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/template_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/template_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/template_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Template Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Template Name');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Active?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Display Right Column?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Display Left Column?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Allow category descriptions');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Left column width (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Right column width (pixel)');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_HEADER', '<b>Header</b>');
+define('TEXT_HEADER_EXPLAIN', 'These settings effect all templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Side box configuration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Layout configuration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Title');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Value');
+define('TABLE_HEADING_ACTION', 'Action');
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/template_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/template_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/template_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gestion Des Templates ');
+
+define('TABLE_HEADING_TEMPLATE', 'Nom des Templates');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_ACTIVE', 'Actif ?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Affichage Colonne de droite ?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Affichage Colonne de gauche ?');
+define('TABLE_HEADING_NOT_INSTALLED', 'Not installed');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Permettez les descriptions de cat&eacute;gorie');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Placez la largeur de colonne gauche');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Placez la largeur de colonne droite');
+
+define('TEXT_DATE_ADDED', 'Date d\'ajout:');
+define('TEXT_DELETE_IMAGE', 'Supprimer l\'image du template ?');
+define('TEXT_REST_CUST_TEMP', 'Set Site default template to replace this template in customer data?');
+define('TEXT_DELETE_INTRO', 'Etes vous sûr vous voulez supprimer ce template ?');
+
+define('TEXT_EDIT_INTRO', 'Veuillez faire tous les changements n&eacute;cessaires');
+
+define('TEXT_HEADER', '<b>En-tête</b>');
+define('TEXT_HEADING_DELETE_TEMPLATE', 'Supprimer le Template');
+define('TEXT_HEADING_EDIT_TEMPLATE', 'Modifier le Template');
+define('TEXT_HEADING_NEW_TEMPLATE', 'Ajouter un Template');
+
+define('TEXT_INCLUDE_CART_IN_HEADER', 'Incluez le caddie dans l\'en-t&ecirc;te');
+define('TEXT_INCLUDE_COLUMN_LEFT', 'Incluez la colonne gauche ?');
+define('TEXT_INCLUDE_COLUMN_RIGHT', 'Incluez la colonne droite ?');
+define('TEXT_INCLUDE_HEADER_LINK_BUTTONS', 'Incluez Les Boutons de Lien D\'En-tête');
+define('TEXT_INCLUDE_LANGUAGES_IN_HEADER', 'Incluez les langues dans l\'en-t&ecirc;te');
+define('TEXT_INCLUDE_MAIN_TABLE_BORDER', 'Incluez la bordure principale du tableau');
+define('TEXT_INFO_EDIT_INTRO', 'Veuillez faire tous les changements n&eacute;cessaires');
+define('TEXT_INFOBOX_BORDER_WIDTH_LEFT', 'Largeur gauche de l\'image de la bordure d\'Infobox');
+define('TEXT_INFOBOX_BORDER_WIDTH_RIGHT', 'Largeur droite de l\'image de la bordure d\'Infobox');
+
+define('TEXT_LEFT_COLUMN', '<b>Colonne de gauche</b>');
+define('TEXT_RIGHT_COLUMN', '<b>Colonne de droite</b>');
+define('TEXT_TEMPLATE', 'Template :');
+
+define('TEXT_LAST_MODIFIED', 'Derni&egrave;re modification :');
+
+define('TEXT_IMAGE_NONEXISTENT', 'L\'image n\'existe pas');
+define('TEXT_YES', 'oui');
+define('TEXT_NO', 'non');
+define('TEXT_NEW_INTRO', 'Veuillez compl&eacute;ter l\'information suivante pour le nouveau template');
+
+
+define('TEXT_TEMPLATE_SYSTEM', 'The template uses the  ');
+define('TEXT_TEMPLATE_SYSTEM_1', ' template system.');
+
+define('TEXT_TEMPLATE_NAME', 'Nom du Template :  ');
+define('TEXT_TEMPLATE_IMAGE', 'Image du Template :  ');
+
+define('TEXT_TEMPLATE_CELLPADDING_MAIN', 'Espacement du tableau principal');
+define('TEXT_TEMPLATE_CELLPADDING_LEFT', 'Espacement de la colonne de gauche');
+define('TEXT_TEMPLATE_CELLPADDING_RIGHT', 'Espacement de la colonne de droite');
+define('TEXT_TEMPLATE_CELLPADDING_SUB', 'Espacement du tableau secondaire');
+
+define('TEXT_SITE_WIDTH', 'Largeur du site');
+
+define('TEXT_MOVE_RIGHT', 'D&eacute;placer vers la colonne de droite');
+define('TEXT_MOVE_LEFT', 'D&eacute;placer vers la colonne de gauche');
+
+define('TEXT_SHOW_CUSTOMER_GREETING', 'Montrer la satisfaction du client?');
+define('TEXT_SHOW_ORIGINAL_PAGE_HEADERS', 'Montrez les En-têtes de la page principale?');
+
+define('TEXT_TABLE_CELL_PADDING', '<b>Espacement du tableau</b>');
+define('TEXT_OTHER', '<b>Autre</b>');
+define('TEXT_MAINPAGE_MODULES', '<b>S&eacute;lectionner les modules pour la page principale</b>');
+
+define('TEXT_MAINPAGE_MODULES_LOCATION', '<b>The module folder used is: </b>');
+
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: Directory not writeable. Please set the right user permissions on: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Erreur: Le r&eacute;pertoire n\'existe pas: %s');
+
+define('TEXT_TABLE_CELL_LEFT_RIGHT', '<b>Side infobox cellpadding</b>');
+define('TEXT_TEMPLATE_LEFT_SIDE', 'Left side cellpadding');
+define('TEXT_TEMPLATE_RIGHT_SIDE', 'Right side cellpadding');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+$user_ip = getenv('REMOTE_ADDR');;
+
+define('HEADING_TITLE', 'Resend Validation email');
+define('TEXT_EMAIL_CONFIRMATION','Are You Sure to Resend Validation email');
+define('ENTRY_EMAIL_ADDRESS', 'Emailadress: ');
+define('SUCCESS_REGISTRATION_CODE_SENT', 'New validation code Sent');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'This email address is not registered');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Your Validation Code is');
+define('EMAIL_PASSWORD_REMINDER_BODY', "\n\n".'We are resending your Validation Code.' . "\n\n" . 'Your Validation Code for \'' . STORE_NAME . '\' :' . "\n\n" . '%s' . "\n\n");
+define('EMAIL_PASSWORD_REMINDER_BODY2', 'Please follow this link to validate your account: %s' . "\n\n");
+define('TEXT_ACCOUNT_ALREADY_EXIST', 'This Account is already active!');
+define('IMAGE_BUTTON_BACK',"Go Back");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Qui est en ligne');
+
+define('TABLE_HEADING_ONLINE', 'En ligne');
+define('TABLE_HEADING_CUSTOMER_ID', 'ID');
+define('TABLE_HEADING_FULL_NAME', 'Nom & Pr&eacute;nom');
+define('TABLE_HEADING_IP_ADDRESS', 'Adresse IP');
+define('TABLE_HEADING_ENTRY_TIME', 'Heure d\'arriv&eacute;');
+define('TABLE_HEADING_LAST_CLICK', 'Dernier Clic');
+define('TABLE_HEADING_LAST_PAGE_URL', 'Derni&egrave;re URL');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_SHOPPING_CART', 'Panier utilisateur');
+define('TABLE_HEADING_WHOIS', 'Whois');
+define('TEXT_SET_REFRESH', 'Set Refresh Rate:');
+define('TEXT_SHOPPING_CART_SUBTOTAL', 'Sous-total');
+define('TEXT_NUMBER_OF_CUSTOMERS', 'Actuellement il y a %s clients en ligne');
+define('TABLE_HEADING_HTTP_REFERER', 'URL R&eacute;f&eacute;rence');
+define('TEXT_HTTP_REFERER_URL', 'R&eacute;f&eacute;rence URL HTTP');
+define('TEXT_HTTP_REFERER_FOUND', 'Trouv&eacute;e');
+define('TEXT_HTTP_REFERER_NOT_FOUND', 'Non trouv&eacute;e');
+define('TEXT_STATUS_ACTIVE_CART', 'Active/Cart');
+define('TEXT_STATUS_ACTIVE_NOCART', 'Active/NoCart');
+define('TEXT_STATUS_INACTIVE_CART', 'Inactive/Cart');
+define('TEXT_STATUS_INACTIVE_NOCART', 'Inactive/NoCart');
+define('TEXT_STATUS_ACTIVE_BOT', 'Active/Bot');
+define('TEXT_STATUS_INACTIVE_BOT', 'Inactive/Bot');
+define('TABLE_HEADING_COUNTRY', 'Country');
+define('TABLE_HEADING_USER_SESSION', 'Session?');
+define('TEXT_OSCID', 'osCsid');
+define('TEXT_PROFILE_DISPLAY', 'Profile Display');
+define('TEXT_USER_AGENT', 'User Agent');
+define('TEXT_ERROR', 'Error!');
+define('TEXT_ADMIN', 'Admin');
+define('TEXT_DUPLICATE_IP', 'Duplicate IPs');
+define('TEXT_BOTS', 'Bots');
+define('TEXT_ME', 'Me!');
+define('TEXT_ALL', 'All');
+define('TEXT_REAL_CUSTOMERS', 'Real Customers');
+define('TEXT_YOUR_IP_ADDRESS', 'Your IP Address');
+define('TEXT_SET_REFRESH_RATE', 'Set Refresh Rate');
+define('TEXT_NONE_', 'None');
+
+define('TEXT_NAME', 'Name:');
+define('TEXT_CUSTOMER_ID', 'Customer ID:');
+define('TEXT_IP_ADDRESS', 'IP Address:');
+define('TEXT_REFERER', 'Referer:');
+define('TEXT_BOTS', 'Bots');
+define('TEXT_CUSTOMERS', 'Customers');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french/xsell_products.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/xsell_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/xsell_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/* $Id$
+osCommerce, Open Source E-Commerce Solutions
+http://www.oscommerce.com
+Copyright (c) 2002 osCommerce
+
+Released under the GNU General Public License
+xsell.php
+Original Idea From Isaac Mualem im at imwebdesigning.com <mailto:im at imwebdesigning.com>
+Complete Recoding From Stephen Walker admin at snjcomputers.com
+Translate into French Nguyen Hoang Linh linhnh at transat-informatique.fr
+*/
+
+define('CROSS_SELL_SUCCESS', 'Les articles de Vente-X mettent à jour avec succès pour le produit de Vente-X  #'.$_GET['add_related_product_ID']);
+define('SORT_CROSS_SELL_SUCCESS', 'L\'ordre de sorte mettent à jour avec succès pour le produit de Vente-X #'.$_GET['add_related_product_ID']);
+define('HEADING_TITLE', 'Vente croisée (Vente-X) Admin');
+define('TABLE_HEADING_PRODUCT_ID', 'Identité');
+define('TABLE_HEADING_PRODUCT_MODEL', 'Modèle');
+define('TABLE_HEADING_PRODUCT_NAME', 'Nom');
+define('TABLE_HEADING_CURRENT_SELLS', 'Vente-X actuel');
+define('TABLE_HEADING_UPDATE_SELLS', 'Mis à jour Vente-X');
+define('TABLE_HEADING_PRODUCT_IMAGE', 'Image');
+define('TABLE_HEADING_PRODUCT_PRICE', 'Prix');
+define('TABLE_HEADING_CROSS_SELL_THIS', 'Vente-X ce produit?');
+define('TEXT_EDIT_SELLS', 'Modifier');
+define('TEXT_SORT', 'Priorité');
+define('TEXT_SETTING_SELLS', 'Modifier Vente-X ');
+define('TEXT_PRODUCT_ID', 'Identité ');
+define('TEXT_MODEL', 'Modèle ');
+define('TABLE_HEADING_PRODUCT_SORT', 'Ordre');
+define('TEXT_NO_IMAGE', 'Aucune image');
+define('TEXT_CROSS_SELL', 'Vente-X');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/french/zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: zones.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Zones');
+
+define('TABLE_HEADING_COUNTRY_NAME', 'Pays');
+define('TABLE_HEADING_ZONE_NAME', 'Zones');
+define('TABLE_HEADING_ZONE_CODE', 'Code');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_INFO_EDIT_INTRO', 'Merci de faire les changements n&eacute;cessaires');
+define('TEXT_INFO_ZONES_NAME', 'Nom de la zone :');
+define('TEXT_INFO_ZONES_CODE', 'Code de la zone :');
+define('TEXT_INFO_COUNTRY_NAME', 'Pays :');
+define('TEXT_INFO_INSERT_INTRO', 'Merci d\'entrer la nouvelle zone avec ses donn&eacute;es li&eacute;es');
+define('TEXT_INFO_DELETE_INTRO', 'Etes vous sur de vouloir supprimer cette zone ?');
+define('TEXT_INFO_HEADING_NEW_ZONE', 'Nouvelle zone');
+define('TEXT_INFO_HEADING_EDIT_ZONE', 'Editer zone');
+define('TEXT_INFO_HEADING_DELETE_ZONE', 'Supprimer zone');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/french.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/french.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/french.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1370 @@
+<?php
+/*
+  $Id: french.php,v 1.3 2003/09/28 23:37:26 anotherlango Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+  French Creload Team for Creload 6.1  
+
+  Released under the GNU General Public License
+*/
+
+//Admin begin
+define('TEXT_ADMIN_HOME','Admin Home');
+define('TEXT_VIEW_CATALOG','View Catalog');
+define('TEXT_FORUMS','CRE Forums');
+define('TEXT_PURCHASE_SUPPORT','Purchase CRE Support');
+define('TEXT_HOSTING','Certified CRE Hosting');
+define('TEXT_ADMIN_LANG','Admin Language:');
+define('TEXT_CHANGE_PASWORD','Change Password');
+define('TEXT_LOGOUT','Logout');
+define('TEXT_CHECK_UPDATES','Check for Updates');
+define('TEXT_GET_PRO','Get Pro Version');
+define('TEXT_GET_B2B','Get B2B Version');
+
+// header text in includes/header.php
+define('HEADER_TITLE_ACCOUNT', 'Mon Compte');
+define('HEADER_TITLE_LOGOFF', 'Se D&eacute;connecter');
+define('TEXT_SELECT_LANGUAGE', 'Please select Admin language for this session ');
+define('BOX_REPORTS_NOT_VALID_USER', 'Customers Not Validated');
+
+// Admin Account
+define('BOX_HEADING_MY_ACCOUNT', 'Mon Compte');
+
+//MARKETING BOX
+define('BOX_HEADING_MARKETING', 'Marketing');
+define('BOX_MARKETING_EVENTS_MANAGER', 'Events Manager');
+define('BOX_MARKETING_SALEMAKER', 'SaleMaker');
+define('BOX_MARKETING_SPECIALS', 'Specials');
+define('BOX_MARKETING_SPECIALSBYCAT','Specials By Category');
+define('BOX_MARKETING_BANNER_MANAGER','Banner Manager');
+
+// configuration box text in includes/boxes/administrator.php
+define('BOX_HEADING_ADMINISTRATOR', 'Administrateur');
+define('BOX_ADMINISTRATOR_MEMBERS', 'Membre du groupe');
+define('BOX_ADMINISTRATOR_GROUPS', 'Admin Groups');
+define('BOX_ADMINISTRATOR_MEMBER', 'Membres');
+define('BOX_ADMINISTRATOR_BOXES', 'Acc&egrave;s fichier');
+define('BOX_ADMINISTRATOR_ACCOUNT_UPDATE', 'Mettre &agrave; jour mon compte');
+
+// images
+define('IMAGE_FILE_PERMISSION', 'Permission sur les fichiers');
+define('IMAGE_GROUPS', 'Liste des Groupes');
+define('IMAGE_INSERT_FILE', 'Ins&eacute;rer un fichier');
+define('IMAGE_MEMBERS', 'Liste des Membres');
+define('IMAGE_NEW_GROUP', 'Nouveau Groupe');
+define('IMAGE_NEW_MEMBER', 'Nouveau Membre');
+define('IMAGE_NEXT', 'Suivant');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_DISPLAY_NUMBER_OF_FILENAMES', 'Afficher <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> noms de fichiers)'); 
+define('TEXT_DISPLAY_NUMBER_OF_MEMBERS', 'Afficher <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> membres)');
+//Admin end
+
+// look in your $PATH_LOCALE/locale directory for available locales..
+// on RedHat6.0 I used 'en_US'
+// on FreeBSD 4.0 I use 'en_US.ISO_8859-1'
+// this may not work under win32 environments..
+setlocale(LC_TIME, 'fr_FR.ISO_8859-1');
+//setlocale(LC_TIME, 'fr');
+define('DATE_FORMAT_SHORT', '%d/%m/%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
+define('DATE_FORMAT', 'd/m/Y'); // this is used for date()
+define('PHP_DATE_TIME_FORMAT', 'd/m/Y H:i:s'); // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+
+
+//// 
+// Return date in raw format 
+// $date should be in format mm/dd/yyyy 
+// raw date is in format YYYYMMDD, or DDMMYYYY 
+function tep_date_raw($date, $reverse = false) { 
+  if ($reverse) { 
+    return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4); 
+  } else { 
+    return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
+  } 
+}
+
+// Global entries for the <html> tag
+define('HTML_PARAMS','dir="ltr" lang="fr"');
+
+// charset for web pages and emails
+define('CHARSET', 'iso-8859-1');
+
+// page title
+define('TITLE', STORE_NAME);
+
+// CCGV
+define('BOX_HEADING_GV_ADMIN', 'Ch&egrave;ques/Coupons');
+define('BOX_GV_ADMIN_QUEUE', '&#8226; Ch&egrave;ques cadeaux en attente');
+define('BOX_GV_ADMIN_MAIL', '&#8226; Ch&egrave;ques cadeaux par email');
+define('BOX_GV_ADMIN_SENT', '&#8226; Ch&egrave;ques cadeaux envoy�s');
+define('BOX_COUPON_ADMIN','&#8226; Gestion des coupons');
+define('BOX_GV_REPORT','Coupon Report');
+define('IMAGE_RELEASE', 'Valider ce ch&egrave;que cadeau');
+
+define('_JANUARY', 'Janvier');
+define('_FEBRUARY', 'F&eacute;vrier');
+define('_MARCH', 'Mars');
+define('_APRIL', 'Avril');
+define('_MAY', 'Mai');
+define('_JUNE', 'Juin');
+define('_JULY', 'Juillet');
+define('_AUGUST', 'Ao&ucirc;t');
+define('_SEPTEMBER', 'Septembre');
+define('_OCTOBER', 'Octobre');
+define('_NOVEMBER', 'Novembre');
+define('_DECEMBER', 'D&eacute;cembre');
+
+define('TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> ch&egrave;que cadeau)');
+define('TEXT_DISPLAY_NUMBER_OF_COUPONS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> coupon)');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Liste des produits');
+define('TEXT_VALID_PRODUCTS_ID', 'Identification du produit');
+define('TEXT_VALID_PRODUCTS_NAME', 'Nom des produits');
+define('TEXT_VALID_PRODUCTS_MODEL', 'Mod&egrave;le des produits');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Liste des cat&eacute;gories');
+define('TEXT_VALID_CATEGORIES_ID', 'Identification cat&eacute;gorie');
+define('TEXT_VALID_CATEGORIES_NAME', 'Nom des cat&eacute;gories');
+
+
+// header text in includes/header.php
+define('HEADER_TITLE_TOP', 'Administration');
+define('HEADER_TITLE_SUPPORT_SITE', 'Support Site');
+define('HEADER_TITLE_ONLINE_CATALOG', 'Catalogue en ligne');
+define('HEADER_TITLE_ADMINISTRATION', 'Administration');
+define('HEADER_TITLE_CHAINREACTION', 'Chainreactionweb');
+define('HEADER_TITLE_CRELOADED', 'CRE Loaded Project');
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('BOX_CATALOG_DEFINE_MAINPAGE', 'D&eacute;finir la 1&egrave;re page');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// text for gender
+define('MALE', 'Mr');
+define('FEMALE', 'Mme');
+
+// text for date of birth example
+define('DOB_FORMAT_STRING', 'jj/mm/aaaa');
+
+// configuration box text in includes/boxes/configuration.php
+define('BOX_HEADING_CONFIGURATION', 'Configuration');
+define('BOX_CONFIGURATION_MYSTORE', 'Mon magasin');
+define('BOX_CONFIGURATION_LOGGING', 'Enregistrement');
+define('BOX_CONFIGURATION_CACHE', 'Cache');
+
+// added for super-friendly admin menu:
+define('BOX_CONFIGURATION_MIN_VALUES', 'Valeurs Minimales');
+define('BOX_CONFIGURATION_MAX_VALUES', 'Valeurs Maximales');
+define('BOX_CONFIGURATION_IMAGES', 'Images');
+define('BOX_CONFIGURATION_CUSTOMER_DETAILS', 'D&eacute;tails Clients');
+define('BOX_CONFIGURATION_SHIPPING', 'Exp&eacute;dition');
+define('BOX_CONFIGURATION_PRODUCT_LISTING', 'Liste des Produits');
+define('BOX_CONFIGURATION_EMAIL', 'Email');
+define('BOX_CONFIGURATION_DOWNLOAD', 'T&eacute;l&eacute;chargement');
+define('BOX_CONFIGURATION_GZIP', 'Compression GZip');
+define('BOX_CONFIGURATION_SESSIONS', 'Sessions');
+define('BOX_CONFIGURATION_STOCK', 'Stock');
+define('BOX_CONFIGURATION_WYSIWYG', 'WYSIWYG Editor 1.7');
+define('BOX_CONFIGURATION_AFFILIATE', 'Programme Affili&eacute;s');
+define('BOX_CONFIGURATION_MAINT', 'Maintenance Site');
+define('BOX_CONFIGURATION_ACCOUNTS', 'Achat sans accompte');
+define('BOX_CONFIGURATION_CHECKOUT', 'Checkout Settings');
+define('BOX_CONFIGURATION_LINKS', 'Liens');
+
+// modules box text in includes/boxes/modules.php
+define('BOX_HEADING_MODULES', 'Modules');
+define('BOX_MODULES_PAYMENT', 'Paiement');
+define('BOX_MODULES_SHIPPING', 'Exp&eacute;dition');
+define('BOX_MODULES_ORDER_TOTAL', 'Total commande');
+
+// categories box text in includes/boxes/catalog.php
+define('BOX_HEADING_CATALOG', 'Catalogue');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS', 'Cat&eacute;gories/Produits');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES', 'Attributs produits');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_CATEGORY_OPTIONS', 'Products Categories Options');
+define('BOX_CATALOG_MANUFACTURERS', 'Fabricants');
+define('BOX_CATALOG_REVIEWS', 'Critiques');
+define('BOX_CATALOG_SPECIALS', 'Promotions');
+define('BOX_CATALOG_PRODUCTS_EXPECTED', 'Produits en attente');
+define('BOX_CATALOG_EASYPOPULATE', 'EasyPopulate');
+define('BOX_CATALOG_EASYPOPULATE_BASIC', 'EasyPopulate Basique');
+define('BOX_CATALOG_SALEMAKER', 'SaleMaker');
+define('BOX_CATALOG_SHOP_BY_PRICE', 'Achat par prix');
+// customers box text in includes/boxes/customers.php
+define('BOX_HEADING_CUSTOMERS', 'Clients');
+define('BOX_CUSTOMERS_CUSTOMERS', 'Clients');
+//added for Super-Friendly Admin Menu:
+define('BOX_CUSTOMERS_ORDERS', 'Commandes');
+define('BOX_CUSTOMERS_EDIT_ORDERS', 'Editer les Commandes');
+//begin PayPal_Shopping_Cart_IPN
+define('BOX_CUSTOMERS_PAYPAL', 'PayPal IPN');
+define('BOX_ABANDONED_ORDERS', 'Abandoned Orders');
+define('BOX_CREATE_ACCOUNT', 'Cr&eacute;ation de compte');
+define('BOX_CREATE_ORDER', 'Cr&eacute;ation de commnande');
+define('BOX_CREATE_ORDERS_ADMIN', 'Create Orders Admin');
+// taxes box text in includes/boxes/taxes.php
+define('BOX_HEADING_LOCATION_AND_TAXES', 'Lieux / Taxes');
+define('BOX_TAXES_COUNTRIES', 'Pays');
+define('BOX_TAXES_ZONES', 'Zones');
+define('BOX_TAXES_GEO_ZONES', 'Zones fiscales');
+define('BOX_TAXES_TAX_CLASSES', 'Classes fiscales');
+define('BOX_TAXES_TAX_RATES', 'Taux fiscaux');
+
+// reports box text in includes/boxes/reports.php
+define('BOX_HEADING_REPORTS', 'Rapports');
+define('BOX_REPORTS_PRODUCTS_VIEWED', 'Produits vus');
+define('BOX_REPORTS_PRODUCTS_PURCHASED', 'Produits achet&eacute;s');
+define('BOX_REPORTS_ORDERS_TOTAL', 'Total de commande client');
+define('BOX_REPORTS_CUSTOMER_WISHLIST', 'Customer Wishlist');
+define('BOX_CUSTOMERS_MENU','Customer Menu');
+
+// tools text in includes/boxes/tools.php
+define('BOX_HEADING_TOOLS', 'Outils');
+define('BOX_TOOLS_BACKUP', 'Sauvegarde de base de donn&eacute;es');
+define('BOX_TOOLS_BANNER_MANAGER', 'Gestionnaire de banni&egrave;re');
+define('BOX_TOOLS_CACHE', 'Contr&ocirc;le du cache');
+define('BOX_TOOLS_DEFINE_LANGUAGE', 'D&eacute;finissez langues');
+define('BOX_TOOLS_FILE_MANAGER', 'Gestionnaire de fichiers');
+define('BOX_TOOLS_MAIL', 'Envoyez un courrier &eacute;lectronique');
+define('BOX_TOOLS_NEWSLETTER_MANAGER', 'Gestionnaire de bulletin d\'information');
+define('BOX_TOOLS_SERVER_INFO', 'Renseignements sur serveur');
+define('BOX_TOOLS_WHOS_ONLINE', 'Qui est en ligne');
+
+// BMC CC Mod Start
+define('BOX_TOOLS_BLACKLIST', 'Credit Card Blacklist');
+// BMC CC Mod End
+// localizaion box text in includes/boxes/localization.php
+define('BOX_HEADING_LOCALIZATION', 'Localisation');
+define('BOX_LOCALIZATION_CURRENCIES', 'Devises');
+define('BOX_LOCALIZATION_LANGUAGES', 'Langues');
+define('BOX_LOCALIZATION_ORDERS_STATUS', 'Statut des commandes');
+// header_tags_controller text in includes/boxes/header_tags_controller.php
+
+define('BOX_HEADING_HEADER_TAGS_CONTROLLER', 'Header Tags');
+define('BOX_HEADER_TAGS_ADD_A_PAGE', 'Page Control');
+define('BOX_HEADER_TAGS_ENGLISH', 'Text Control');
+define('BOX_HEADER_TAGS_FILL_TAGS', 'Fill Tags');
+
+// infobox box text in includes/boxes/info_boxes.php
+define('BOX_HEADING_DESIGN_CONTROLS', 'Contr&ocirc;le du Design');
+define('BOX_HEADING_DESIGN_TEMPLATE', 'Template');
+define('BOX_HEADING_TEMPLATE_CONFIGURATION', 'Administration des Templates');
+define('BOX_HEADING_TEMPLATE_MANAGEMENT', 'Template Admin');
+define('BOX_HEADING_TEMPLATE_MANAGEMENT1', 'New Manage Templates');
+define('BOX_HEADING_DESIGN_INFOBOX', 'Infobox');
+define('BOX_HEADING_BOXES', 'Infobox Admin');
+define('BOX_HEADING_BOXES_ADMIN', 'Infobox Configure');
+define('BOX_HEADING_DESIGN_BRANDING', 'Branding');
+define('BOX_HEADING_TEMPLATE_HEADER_TAGS','Header Tags');
+ 
+
+define('BOX_HEADING_DESIGN_LAYOUT', 'Layout');
+define('BOX_HEADING_DESIGN_PRODUCT_LISTING', 'Product Listing');
+define('BOX_HEADING_DESIGN_HOME_PAGE', 'Home Page');
+define('BOX_HEADING_DESIGN_INDEX_PAGE', 'Index Page');
+define('BOX_HEADING_DESIGN_PRODUCT_PAGE', 'Product Page');
+
+define('BOX_TEMPLATE_NAVMENU','Navigation Manager');
+
+
+// VJ Links Manager v1.00 begin
+// links manager box text in includes/boxes/links.php
+define('BOX_HEADING_LINKS', 'Liens Manager');
+define('BOX_LINKS_LINKS', 'Liens');
+define('BOX_LINKS_LINK_CATEGORIES', 'Liens Categories');
+define('BOX_LINKS_LINKS_CONTACT', 'Liens Contact');
+// VJ Links Manager v1.00 end
+
+// javascript messages
+define('JS_ERROR', 'Des erreurs sont survenues durant le traitement de votre formulaire!\nMerci de faire les corrections suivantes:\n\n');
+
+define('JS_OPTIONS_VALUE_PRICE', '* Le nouveau attribut produit n�cessite un prix\n');
+define('JS_OPTIONS_VALUE_PRICE_PREFIX', '* Le nouveau attribut produit n�cessite un pr&eacute;fixe de prix\n');
+
+define('JS_PRODUCTS_NAME', '*  Le nouveau produit n�cessite un nom\n');
+define('JS_PRODUCTS_DESCRIPTION', '* Le nouveau n�cessite une description\n');
+define('JS_PRODUCTS_PRICE', '* Le nouveau produit n�cessite un prix\n');
+define('JS_PRODUCTS_WEIGHT', '* Le nouveau produit n�cessite un poids\n');
+define('JS_PRODUCTS_QUANTITY', '* Le nouveau produit n�cessite une quantit�\n');
+define('JS_PRODUCTS_MODEL', '* Le nouveau produit n�cessite un mod�le\n');
+define('JS_PRODUCTS_IMAGE', '* Le nouveau produit n�cessite une image\n');
+
+define('JS_SPECIALS_PRODUCTS_PRICE', '* Un nouveau prix pour ce produit doit �tre fix�\n');
+
+define('JS_GENDER', '* La valeur de \'Genre\' doit �tre choisie.\n');
+define('JS_FIRST_NAME', '* L\'entr�e \'Pr�nom\' doit avoir au moins ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' caract�res.\n');
+define('JS_LAST_NAME', '* L\'entr&eacute;e \'Nom\' doit avoir au moins ' . ENTRY_LAST_NAME_MIN_LENGTH . ' caract�res.\n');
+define('JS_DOB', '* L\'entr�e \'Date de naissance\' doit avoir la forme: xx/xx/xxxx (mois/date/ann�e).\n');
+define('JS_EMAIL_ADDRESS', '* L\'entr�e \'Adresse �lectronique\' doit avoir au moins ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' caract�res.\n');
+define('JS_ADDRESS', '* L\'entr�e \'Adresse\' doit avoir au moins ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' caract�res.\n');
+define('JS_POST_CODE', '* L\'entr�e \'Code postal\' doit avoir au moins ' . ENTRY_POSTCODE_MIN_LENGTH . ' caract�res.\n');
+define('JS_CITY', '* L\'entr�e \'Ville\' doit avoir au moins ' . ENTRY_CITY_MIN_LENGTH . ' caract�res.\n');
+define('JS_STATE', '* L\'entr�e \'Etat\' doit avoir �t� choisie.\n');
+define('JS_STATE_SELECT', '-- Choisissez ci-dessus --');
+define('JS_ZONE', '* L\'entr�e \'Etat\' doit �tre choisie parmi la liste pour ce pays.');
+define('JS_COUNTRY', '* La valeur \'Pays\' doit �tre choisie.\n');
+define('JS_TELEPHONE', '* L\'entr&eacute;e \'Num�ro de t�l�phone\' doit avoir au moins ' . ENTRY_TELEPHONE_MIN_LENGTH . ' caract�res.\n');
+define('JS_PASSWORD', '* Les entr�es \'Mot de passe\' et \'Confirmation\' doivent avoir au moins ' . ENTRY_PASSWORD_MIN_LENGTH . ' caract�res.\n');
+
+define('JS_ORDER_DOES_NOT_EXIST', 'Le num�ro de commande %s n\'existe pas!');
+/* User Friendly Admin Menu */
+define('CATALOG_CATEGORIES', 'Cat&eacute;gories');
+define('CATALOG_ATTRIBUTES', 'Attributs Produits');
+define('CATALOG_REVIEWS', 'Critiques');
+define('CATALOG_SPECIALS', 'Promotions');
+define('CATALOG_EXPECTED', 'Produits en Attente');
+define('REPORTS_PRODUCTS_VIEWED', 'Produits Visit&eacute;s');
+define('REPORTS_PRODUCTS_PURCHASED', 'Produits Achet&eacute;s');
+define('TOOLS_FILE_MANAGER', 'Gestionnaire de Fichiers');
+define('TOOLS_CACHE', 'Controle du cache');
+define('TOOLS_DEFINE_LANGUAGES', 'D&eacute;finir une Langue');
+define('TOOLS_EMAIL', 'Envoyer un Email aux clients');
+define('TOOLS_NEWSLETTER', 'Newsletters');
+define('TOOLS_SERVER_INFO', 'Infos Serveur');
+define('TOOLS_WHOS_ONLINE', 'Qui est en ligne');
+define('BOX_HEADING_GV', 'Bons d\'achat/r&eacute;duction');
+define('GV_COUPON_ADMIN', '&#x2022; Bon de R&eacute;duction');
+define('GV_EMAIL', '&#x2022; Envoi de Bons d\'achat');
+define('GV_QUEUE', '&#x2022; Bons d\'achat utilis&eacute;s');
+define('GV_SENT', '&#x2022; Bons d\'achat envoy&eacute;s');
+define('BOX_GV_SENT', 'Gift Voucher\'s Sent');
+/* User Friedly Admin Menu */
+
+
+define('CATEGORY_PERSONAL', 'Donn&eacute;es personnelles');
+define('CATEGORY_ADDRESS', 'Adresse');
+define('CATEGORY_CONTACT', 'Contact');
+define('CATEGORY_COMPANY', 'Soci&eacute;t&eacute;');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Mot de passe');
+
+define('ENTRY_COMPANY', 'Company Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Genre:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<span class="errorText">requis</span>');
+define('ENTRY_GENDER_TEXT', '*');
+define('ENTRY_FIRST_NAME', 'Pr&eacute;nom:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<span class="errorText">min. ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' caract.</span>');
+define('ENTRY_FIRST_NAME_TEXT', '*');
+define('ENTRY_LAST_NAME', 'Nom:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<span class="errorText">min. ' . ENTRY_LAST_NAME_MIN_LENGTH . ' caract.</span>');
+define('ENTRY_LAST_NAME_TEXT', '*');
+
+
+
+define('ENTRY_DATE_OF_BIRTH', 'Date de naissance:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class="errorText">(ex. 03/02/1961)</span>');
+define('ENTRY_EMAIL_ADDRESS', 'Adresse &eacute;lectronique:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<span class="errorText">min. ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' caract.</span>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<span class="errorText">L\'adresse &eacute;lectronique ne semble pas &ecirc;tre valide!</span>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<span class="errorText">Cette adresse &eacute;lectronique existe d&eacute;j&agrave;!</span>');
+define('ENTRY_COMPANY', 'Nom de la soci&eacute;t&eacute;:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_STREET_ADDRESS', 'Adresse:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<span class="errorText">min. ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' caract.</span>');
+define('ENTRY_SUBURB', 'Compl&eacute;ment adresse:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_POST_CODE_TEXT', '*');
+define('ENTRY_POST_CODE', 'Code postal:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<span class="errorText">min. ' . ENTRY_POSTCODE_MIN_LENGTH . ' caract.</span>');
+define('ENTRY_CITY', 'Ville:');
+define('ENTRY_CITY_ERROR', '&nbsp;<span class="errorText">min. ' . ENTRY_CITY_MIN_LENGTH . ' caract.</span>');
+define('ENTRY_STATE', 'Etat:');
+define('ENTRY_STATE_ERROR', '&nbsp;<span class="errorText">required</span>');
+define('ENTRY_COUNTRY', 'Pays:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '*');
+define('ENTRY_TELEPHONE_NUMBER', 'Num&eacute;ro de t&eacute;l&eacute;phone:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<span class="errorText">min. ' . ENTRY_TELEPHONE_MIN_LENGTH . ' caract.</span>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');
+define('ENTRY_FAX_NUMBER', 'Num&eacute;ro de fax:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Bulletin d\'informations:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Abonn&eacute;');
+define('ENTRY_NEWSLETTER_NO', 'D&eacute;sabonn&eacute;');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_ERROR_NOT_MATCHING', 'The Password Confirmation must match your Password.');
+define('ENTRY_PASSWORD_TEXT', '*');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT', 'Current Password:');
+define('ENTRY_PASSWORD_CURRENT_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW', 'New Password:');
+define('ENTRY_PASSWORD_NEW_TEXT', '*');
+define('ENTRY_PASSWORD_NEW_ERROR', 'Your new Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING', 'The Password Confirmation must match your new Password.');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+define('FORM_REQUIRED_INFORMATION', '* Required information');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('CATEGORY_ORDER_DETAILS', 'Customer Details');
+define('ENTRY_CURRENCY', 'Customer Currency');
+
+// images
+define('IMAGE_ANI_SEND_EMAIL', 'Envoyer un courrier &eacute;lectronique');
+define('IMAGE_BACK', 'Retour');
+define('IMAGE_BACKUP', 'Sauvegarde');
+define('IMAGE_CANCEL', 'Annuler');
+define('IMAGE_BUTTON_CONTINUE', 'Continue');
+define('IMAGE_CONFIRM', 'Confirmer');
+define('IMAGE_COPY', 'Copier');
+define('IMAGE_COPY_TO', 'Copier vers');
+define('IMAGE_DETAILS', 'D&eacute;tails');
+define('IMAGE_DELETE', 'Supprimer');
+define('IMAGE_EDIT', 'Editer');
+define('IMAGE_EDIT_STATUS', 'Edit Order Status');
+define('IMAGE_EDIT_ORDER', 'Edit Order');
+define('IMAGE_EDIT_LANG_DEFINE', 'Edit Language Defines');
+define('IMAGE_EMAIL', 'Courrier &eacute;lectronique');
+define('IMAGE_FILE_MANAGER', 'Gestionnaire de fichiers');
+define('IMAGE_ICON_STATUS_GREEN', 'Actif');
+define('IMAGE_ICON_STATUS_GREEN_LIGHT', 'Activer');
+define('IMAGE_ICON_STATUS_RED', 'Inactif');
+define('IMAGE_ICON_STATUS_RED_LIGHT', 'D&eacute;sactiver');
+define('IMAGE_ICON_INFO', 'Info');
+define('IMAGE_INSERT', 'Ins&eacute;rer');
+define('IMAGE_LOCK', 'V&eacute;rouiller');
+define('IMAGE_MODULE_INSTALL', 'Installez le module');
+define('IMAGE_MODULE_REMOVE', 'Supprimer le module');
+define('IMAGE_MOVE', 'D&eacute;placer');
+define('IMAGE_NEW_BANNER', 'Nouvelle banni&egrave;re');
+define('IMAGE_NEW_CATEGORY', 'Nouvelle cat&eacute;gorie');
+define('IMAGE_NEW_COUNTRY', 'Nouveau pays');
+define('IMAGE_NEW_CURRENCY', 'Nouvelle devises');
+define('IMAGE_NEW_FILE', 'Nouveau fichier');
+define('IMAGE_NEW_FOLDER', 'Nouveau dossier');
+define('IMAGE_NEW_LANGUAGE', 'Nouvelle Langue');
+define('IMAGE_NEW_NEWSLETTER', 'Nouveau bulletin d\'informations');
+define('IMAGE_NEW_PRODUCT', 'Nouveau Produit');
+define('IMAGE_NEW_SALE', 'Nouvelle vente');
+define('IMAGE_NEW_TAX_CLASS', 'Nouvelle classe fiscale');
+define('IMAGE_NEW_TAX_RATE', 'Nouveau taux fiscal');
+define('IMAGE_NEW_TAX_ZONE', 'Nouvelle zone fiscale');
+define('IMAGE_NEW_ZONE', 'Nouvelle zone');
+define('IMAGE_ORDERS', 'Commandes');
+define('IMAGE_ORDERS_INVOICE', 'Facture');
+define('IMAGE_ORDERS_PACKINGSLIP', 'Emballage');
+define('IMAGE_PREVIEW', 'Pr&eacute;visualiser');
+define('IMAGE_RESTORE', 'Restaurer');
+define('IMAGE_RESET', 'R&eacute;initialiser');
+define('IMAGE_SAVE', 'Sauvegarder');
+define('IMAGE_SEARCH', 'rechercher');
+define('IMAGE_SELECT', 'Choisir');
+define('IMAGE_SEND', 'Envoyer');
+define('IMAGE_SEND_EMAIL', 'Envoyer un courrier &eacute;lectronique');
+define('IMAGE_UNLOCK', 'D&eacute;verrouiller');
+define('IMAGE_UPDATE', 'Mettre &agrave; jour');
+define('IMAGE_UPDATE_CURRENCIES', 'Mettre &agrave; jour le taux de change');
+define('IMAGE_UPLOAD', 'Transf&eacute;rer');
+
+define('ICON_CROSS', 'Faux');
+define('ICON_CURRENT_FOLDER', 'Dossier courant');
+define('ICON_DELETE', 'Supprimer');
+//added for quick product edit DMG
+define('ICON_EDIT','Editer');
+define('ICON_ERROR', 'Erreur');
+define('ICON_FILE', 'Fichier');
+define('ICON_FILE_DOWNLOAD', 'T&eacute;l&eacute;charger');
+define('ICON_FOLDER', 'Dossier');
+define('ICON_LOCKED', 'Verrouill&eacute;');
+define('ICON_PREVIOUS_LEVEL', 'Niveau pr&eacute;c&eacute;dent');
+define('ICON_PREVIEW', 'Pr&eacute;visualiser');
+define('ICON_STATISTICS', 'Statistiques');
+define('ICON_SUCCESS', 'Succ&egrave;s');
+define('ICON_TICK', 'Vrai');
+define('ICON_UNLOCKED', 'D&eacute;verrouill&eacute;');
+define('ICON_WARNING', 'Attention');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_RESULT_PAGE', 'Page %s sur %d');
+define('TEXT_DISPLAY_NUMBER_OF_BANNERS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> banni&egrave;res)');
+define('TEXT_DISPLAY_NUMBER_OF_COUNTRIES', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> pays)');
+define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> clients)');
+define('TEXT_DISPLAY_NUMBER_OF_CURRENCIES', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> devises)');
+define('TEXT_DISPLAY_NUMBER_OF_LANGUAGES', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> langues)');
+define('TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> fabricants)');
+define('TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> bulletin d\'informations)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> commandes)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS_STATUS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> statut commandes)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> produits)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_EXPECTED', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> produits en attente)');
+define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> critiques produit)');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> ventes)');
+define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> produits en promotion)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> classes fiscales)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_ZONES', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> zones fiscales)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> taux fiscal)');
+define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> zones)');
+
+define('PREVNEXT_BUTTON_PREV', '&lt;&lt;');
+define('PREVNEXT_BUTTON_NEXT', '&gt;&gt;');
+
+define('TEXT_DEFAULT', 'd&eacute;faut');
+define('TEXT_SET_DEFAULT', 'mettre par d&eacute;faut');
+define('TEXT_FIELD_REQUIRED', '&nbsp;<span class="fieldRequired">* Requis</span>');
+
+define('ERROR_NO_DEFAULT_CURRENCY_DEFINED', 'Erreur: Il n\'y a actuellement aucune devise par d&eacute;faut. Veuillez en choisir une: Outils administration->Localisation->Devises');
+
+
+define('TEXT_NONE', '--aucun--');
+define('TEXT_TOP', 'Haut');
+
+define('ERROR_DESTINATION_DOES_NOT_EXIST', 'Erreur: le chemin cible n\'existe pas.');
+define('ERROR_DESTINATION_NOT_WRITEABLE', 'Erreur: Impossible d\'&eacute;crire dans le r&eacute;pertoire cible.');
+define('ERROR_FILE_NOT_SAVED', 'Erreur: fichier transf&eacute;rer non sauvegard&eacute;.');
+define('ERROR_FILETYPE_NOT_ALLOWED', 'Erreur: type de fichier transf&eacute;r&eacute; non-permis.');
+define('SUCCESS_FILE_SAVED_SUCCESSFULLY', 'Succ&egrave;s: Le fichier transf&eacute;r&eacute; a &eacute;t&eacute; sauvegard&eacute; avec succ&egrave;s.');
+define('WARNING_NO_FILE_UPLOADED', 'Attention: fichier non transf&eacute;r&eacute;.');
+define('WARNING_FILE_UPLOADS_DISABLED', 'Attention: transfert de fichier est d&eacute;sactiv&ea dans le fichier de configuration php.ini.');
+define('TEXT_DISPLAY_NUMBER_OF_PAYPALIPN_TRANSACTIONS', 'Afficher <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> transactions)'); // PAYPALIPN
+define('ERROR_TEP_MAIL', '<font face="Verdana, Arial" size="2" color="#ff0000"><b><small>TEP ERROR:</small> Cannot send the email through the specified SMTP server. Please check your php.ini setting and correct the SMTP server if necessary.</b></font>');
+define('WARNING_INSTALL_DIRECTORY_EXISTS', 'Warning: Installation directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install. Please remove this directory for security reasons.');
+define('WARNING_UPGRADES_DIRECTORY_EXISTS', 'Warning: Upgrades directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/upgrades. Please remove this directory for security reasons.');
+define('WARNING_CONFIG_FILE_WRITEABLE', 'Warning: I am able to write to the configuration file: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
+define('WARNING_CONFIG_FILE_WRITEABLE_CATALOG', 'Warning: I am able to write to the configuration file: ' . DIR_FS_CATALOG . 'includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
+define('WARNING_SESSION_DIRECTORY_NON_EXISTENT', 'Warning: The sessions directory does not exist: ' . tep_session_save_path() . '. Sessions will not work until this directory is created.');
+define('WARNING_SESSION_DIRECTORY_NOT_WRITEABLE', 'Warning: I am not able to write to the sessions directory: ' . tep_session_save_path() . '. Sessions will not work until the right user permissions are set.');
+define('WARNING_SESSION_AUTO_START', 'Warning: session.auto_start is enabled - please disable this php feature in php.ini and restart the web server.');
+define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Warning: The downloadable products directory does not exist: ' . DIR_FS_CATALOG . 'download/' . '. Downloadable products will not work until this directory is valid.');
+define('WARNING_ENCRYPT_FILE_MISSING', 'Warning: The Encryption key file is missing.');
+define('WARNING_TMP_DIRECTORY_NON_EXISTENT', 'Warning: The /tmp is not writable: ' . DIR_FS_CATALOG . 'tmp/' . '. The page cacheing will not work until this directory is writable.');
+
+
+define('BOX_HEADING_PAYPALIPN_ADMIN', 'Paypal IPN'); // PAYPALIPN
+define('BOX_PAYPALIPN_ADMIN_TRANSACTIONS', 'Transactions'); // PAYPALIPN
+define('BOX_PAYPALIPN_ADMIN_TESTS', 'Envoyer un Test IPN'); // PAYPALIPN
+define('BOX_CATALOG_XSELL_PRODUCTS', 'Produits en vente crois&eacute;e');
+
+define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 01 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_INVALID_MONTH', 'Error: 02 The expiry date Motnth entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_YEAR', 'Error: 03 The expiry date year entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Error: 04 The expiry date entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Error: 05 The credit card number entered is invalid. Please check the number for misstyped numbers and try again.');
+define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'Error: 06 The first four digits of the number entered are: %s If that number is correct, we do not accept that type of credit card.If it is wrong, please try again.');
+define('TEXT_CCVAL_ERROR_NOT_ACCEPTED', 'Error: 07 The credit card number you have entered appears to be a %s card. Unfortunately at this time we do not accept %s as payment.');
+define('TEXT_CCVAL_ERROR_BLACKLIST', 'Error: 08 We cannot accept your card as it is blacklisted, if you feel you have recieved this message in error please contact your card issuer.');
+define('TEXT_CCVAL_ERROR_SHORT', 'Error: 09 You have not entered the correct amount of digits. Please ensure you have entered all of the long number displayed on the front of your card');
+define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'Error: 10 The CCV/CVV/CID number entered is the incorrect length. Please try again.');
+REQUIRE(DIR_WS_LANGUAGES . 'add_ccgvdc_english.php');
+
+define('IMAGE_BUTTON_PRINT_ORDER', 'Imprimer la commande');
+
+ // X-Sell
+REQUIRE(DIR_WS_LANGUAGES . 'add_ccgvdc_french.php');
+// BOF: Lango Added for print order MOD
+define('IMAGE_BUTTON_PRINT', 'Imprimer');
+// EOF: Lango Added for print order MOD
+
+// BOF: Lango Added for Featured product MOD
+  define('BOX_CATALOG_FEATURED', 'Produits Pr&eacute;sent&eacute;s');
+// EOF: Lango Added for Featured product MOD
+
+// BOF: Lango Added for Sales Stats MOD
+define('BOX_REPORTS_MONTHLY_SALES', 'Ventes/Taxes Mensuelles');
+// EOF: Lango Added for Sales Stats MOD
+
+// BOF: Lango Added for template MOD
+// WebMakers.com Added: Attribute Sorter, Copier and Catalog additions
+require(DIR_WS_LANGUAGES . $language . '/' . 'attributes_sorter.php');
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  define('BOX_HEADING_INFORMATION', 'Info syst&egrave;me');
+  define('BOX_INFORMATION_MANAGER', 'Info manager');
+//DWD Modify End
+
+include('includes/languages/order_edit_french.php');
+
+ define('BOX_TITLE_CRELOADED', 'CRE Loaded Project');
+ define('LINK_CRE_FORUMS','CRE Loaded Forums');
+ define('LINK_CRW_SUPPORT','Support Technique');
+// General Release Edition
+ define('LINK_SF_CRELOADED','Source Forge Home');
+ define('LINK_SF_BUGTRACKER','Bug Tracker');
+ define('LINK_SF_SUPPORT','Support Request');
+ define('LINK_SF_TASK','Task Tracker');
+ define('LINK_SF_CVS','Browse CVS');
+ define('LINK_CRE_FILES','CRE T&eacute;l&eacute;chargement');
+ define('LINK_SF_FEATURE','Feature Request');
+//included for Backup mySQL (courtesy Zen-Cart Team) DMG
+ define('BOX_TOOLS_MYSQL_BACKUP','Sauvegarde mySQL');
+//included for Orderlist 3.1 report DMG
+ define('BOX_REPORTS_ORDERLIST', 'Generate orderlist');
+
+// Included for Events Calendar 2.0 DMG
+define('BOX_TOOLS_EVENTS_MANAGER', 'Events Manager');
+define('IMAGE_NEW_EVENT', 'New Event');
+
+// VJ member approval added
+define('BOX_CUSTOMERS_APPROVAL', 'Waiting Approval');
+
+// DMG Sales Report 2
+  define('BOX_REPORTS_SALES_REPORT2', 'SalesReport2');
+  
+// DMG Zipcode Matching
+  define('BOX_REPORTS_ZIPCODE_MATCH','Customer Zip/State Mismatch');
+  
+//DMG FAQ System 2.1
+  define('BOX_HEADING_FAQ', 'FAQ System');
+  define('BOX_FAQ_MANAGER', 'FAQ Manager');
+  define('BOX_FAQ_CATEGORIES', 'FAQ Categories');
+  define('BOX_FAQ_VIEW', 'FAQ View');
+  define('BOX_FAQ_VIEW_ALL', 'FAQ View All');
+  
+  
+// DMG Article Manager
+define('BOX_HEADING_ARTICLES', 'Directeur D\'Article');
+define('BOX_TOPICS_ARTICLES', 'Mati�res/Articles');
+define('BOX_ARTICLES_CONFIG', 'Configuration');
+define('BOX_ARTICLES_AUTHORS', 'Auteurs');
+define('BOX_ARTICLES_REVIEWS', 'Article Revues');
+define('BOX_ARTICLES_XSELL', 'Vente En travers Articles');
+define('IMAGE_NEW_TOPIC', 'Nouvelle Mati�re');
+define('IMAGE_NEW_ARTICLE', 'Nouvelle Article');
+define('TEXT_DISPLAY_NUMBER_OF_AUTHORS', 'Montrer <b>%d</b> to <b>%d</b> (of <b>%d</b> auteurs)');
+define('IMAGE_NEW_AUTHOR', 'Nouvel Auteur');
+define('TEXT_WARNING_NO_AUTHORS', 'AVERTISSEMENT : Les auteurs vides Table!&nbsp;&nbsp;You DOIVENT ajouter au moins un auteur avant que vous puissiez ajouter tous les articles');
+
+// Article Statistics Report DMG
+  define('BOX_REPORTS_ARTICLES_VIEWED', 'Les Articles Ont regard�');
+  define('TEXT_DISPLAY_NUMBER_OF_ARTICLES', 'Montrer <b>%d</b> to <b>%d</b> (of <b>%d</b> produits)');
+  
+// DMG :  Mulitple Products Manager
+
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_MULTI', 'Multiple Products Manager');
+
+
+// DMG : Specials by Category
+
+define('BOX_CATALOG_SPECIALSBYCAT','Specials By Category');
+
+// START: Product Extra Fields DMG
+  define('BOX_CATALOG_PRODUCTS_EXTRA_FIELDS', 'Product Extra Fields');
+// END: Product Extra Fields DMG
+
+// Customers Order Reports DMG
+
+define('BOX_REPORTS_CUSTOMERS_ORDERS', 'Customer Statistics');
+
+// Daily Sales Products reports  DMG
+define('BOX_REPORTS_DAILY_PRODUCTS_ORDERS', 'Daily Products Report');
+
+// Contact US Email Subject DMG
+define('BOX_TOOLS_EMAIL_SUBJECTS', 'Email Subjects');
+define('TEXT_DISPLAY_NUMBER_OF_EMAIL_SUBJECTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> email subjects)');
+
+define('BOX_REPORTS_EXPLAIN','osC Explain Queries');
+ 
+//define('BOX_HEADING_CRYPT', 'Encryption and Decryption'); 
+define('BOX_HEADING_CRYPT', 'Encrypt & Decrypt');
+define('BOX_CRYPT_CONFIGURATION', 'Configuration'); 
+define('BOX_CRYPT_TEST', 'Test'); 
+define('BOX_CRYPT_CC_DATA', 'CC Data'); 
+define('BOX_CRYPT_CONVERT', '&nbsp; Convert CC Data');
+define('BOX_CRYPT_PURGE', 'Purge CC Data');
+define('BOX_CRYPT_UPDATE', 'Update CC Data');
+define('BOX_CRYPT_KEYS', 'Manage Keys');
+define('BOX_CRYPT_HELP', 'Help');
+
+define('IMAGE_CONVERT', 'Convert info to new key');
+define('IMAGE_ENCRYPT', 'Encrypt data');
+define('IMAGE_DECRYPT', 'Decrypt data');
+define('IMAGE_RETURN', 'Return to main');
+define('IMAGE_EDIT_KEY', 'Edit Key File');
+define('IMAGE_CREATE', 'Create key');
+define('IMAGE_HELP', 'Help');
+define('IMAGE_RUN', 'Run');
+  define('BOX_DATA_EASYPOPULATE_BASIC', 'Easy Populate Basic');
+  define('BOX_DATA_EASYPOPULATE', 'Easy Populate Advance');
+  define('BOX_DATA_EASYPOPULATE_EXPORT', 'EPA Export');
+  define('BOX_DATA_EASYPOPULATE_IMPORT', 'EPA Import');
+  define('BOX_DATA_EASYPOPULATE_BASIC_EXPORT', 'EPB Export');
+  define('BOX_DATA_EASYPOPULATE_BASIC_IMPORT', 'EPB Import');
+  define('BOX_DATA_EASYPOPULATE_OPTIONS_EXPORT', 'Options Export');
+  define('BOX_DATA_EASYPOPULATE_OPTIONS_IMPORT', 'Options Import');
+  define('BOX_HEADING_DATA', 'Data Manager');
+  define('BOX_DATA', 'Data Feeds');
+  define('BOX_DATA_ADMIN', 'Data Configure');
+  define('BOX_HEADING_FEEDERS', 'Feeder Systems');
+  define('BOX_DATA_HELP', 'Data Help');
+  define('BOX_FEEDERS_AMAZON', 'Amazon Marketplace');
+  define('BOX_FEEDERS_BIZRATE', 'Biz Rate');
+  define('BOX_FEEDERS_FROOGLE', 'Froogle');
+  define('BOX_FEEDERS_MYSIMON', 'MySimon');
+  define('BOX_FEEDERS_PRICE_GRABBER', 'Price Grabber');
+  define('BOX_FEEDERS_SHOPPING', 'Shopping.com');
+  define('BOX_FEEDERS_YAHOO', 'Yahoo');
+
+define('BOX_HEADING_DOC', 'Documentation');
+define('BOX_DOC_ADMIN', 'Admin');
+define('BOX_DOC_CAT', 'Catalog');
+define('BOX_DOC_MISC', 'Miscellaneous');
+
+
+
+// Eversun mod for sppc and qty price breaks
+define('ENTRY_CUSTOMERS_GROUP_NAME', 'Customer Group:');
+define('BOX_CUSTOMERS_GROUPS', 'Customers Groups');
+define('ENTRY_COMPANY_TAX_ID', 'Company\'s tax id number:');
+define('ENTRY_COMPANY_TAX_ID_ERROR', '');
+define('ENTRY_CUSTOMERS_GROUP_REQUEST_AUTHENTICATION', 'Switch off alert for authentication:');
+define('ENTRY_CUSTOMERS_GROUP_RA_NO', 'Alert off');
+define('ENTRY_CUSTOMERS_GROUP_RA_YES', 'Alert on');
+define('ENTRY_CUSTOMERS_GROUP_RA_ERROR', '');
+// Eversun mod end for sppc and qty price breaks
+// DMG Mod for Customer Notification Report
+define('BOX_REPORTS_PRODUCTS_NOTIFICATIONS', 'Prod Notifications');//Products Notifications V3
+
+define('FOOTER_TEXT_BODY', 'Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a> and <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Using Version ' . PROJECT_VERSION);
+
+// VJ infosystem begin
+define('BOX_HEADING_PAGE_MANAGER', 'Page Manager');
+define('BOX_PAGES', 'Pages');
+define('BOX_PAGES_CATEGORIES', 'Categories');
+// VJ infosystem end
+
+define('BOX_SHIPWIRE', 'ShipWire');
+define('BOX_MODULES_CHECKOUT_SUCCESS', 'Checkout Success');
+
+define('BOX_HEADING_TECH_SUPPORT','Tech Support');
+define('BOX_HEADING_INSTALL_EXPLAIN','Explain Quires');
+define('IMAGE_BUTTON_BACK','Back');
+define('IMAGE_BUTTON_CONFIRM','Confirm');
+
+if(file_exists('includes/languages/french_newsdesk.php')) {
+include('includes/languages/french_newsdesk.php');
+include('includes/languages/french_faqdesk.php');
+}
+
+//coupons redeemed report
+define('BOX_REPORTS_COUPONS_REDEEMED','Coupons Redeemed');
+
+define("PAYPAL_HELP_CONFIGURATION_GUIDE","Configuration Guide");
+define("PAYPAL_HELP_FREQUENTLY_ASKED_QUESTIONS","Frequently Asked Questions");
+define("PAYPAL_CONTENTS","Contents");
+define("PAYPAL_HELP_CONTENTS1","The following is a guide towards configuring your store's PayPal payment module settings:");
+
+define("PAYPAL_HELP_CONTENTS2",'<ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">Enable PayPal Module</b><br />Since you have just done the installation, by default it will say yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">E-Mail Address</b><br />Enter your Primary PayPal email address here, if you have more than one email address registered with PayPal then you must login your PayPal account to determine which one is your <b>Primary</b> email address.</li><br /><br class="h6" />
+      <li><b class="ppem380">Business ID</b><br />If you have configured a secondary email address to be your Business ID (email address) in your PayPal profile account, then enter this here, otherwise enter the one used above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Transaction Currency</b><br />Choose which currencies you want to accept PayPal payments with.</li><br /><br class="h6" />
+      <li><b class="ppem380">Payment Zone</b><br />If a zone is selected, only enable this payment method for that zone.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Pending Notification</b> Order Status</b><br />Set the Pending Notification status of orders made with this payment module to this value, \'<b style="color:blue">Pending</b>\' is suggested or alternatively the optional order status created in step 4 above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Order</b> Status</b><br />Set the status of orders made with this payment module to this value <b style="color:red">Do not set it to \'default\' but specifically choose the status required</b>, \'<b style="color:blue">Processing</b>\' is suggested.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>On Hold Order</b> Status</b><br />This order status is used when the Cart Test has failed, eg. the expected payment amount did not match.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Canceled Order</b> Status</b><br />Refunded, Reversed, Failed or Denied payments will be set to this order status.</li><br /><br class="h6" />
+      <li><b class="ppem380">Synchronize Invoice</b><br />Specify whether the osCommerce order number should be used as a <b>unique</b> PayPal invoice number, similiar to PayPal\'s Send Money feature, this will enable customers to resume an order via their osCommerce account history info page for that order for pending transactions which were not previously completed.</li><br /><br class="h6" />
+      <li><b class="ppem380">Sort order of display</b><br />Sort order of display. Lowest is displayed first.</li><br /><br class="h6" />
+      <li><b class="ppem380">Background Color</b><br />Select the background color of PayPal\'s payment pages, either black or white.</li><br /><br class="h6" />
+      <li><b class="ppem380">Processing logo</b><br />Specify the image file name to be used in the store\'s checkout process splash page, must be located in <code>catalog/images</code> directory.</li><br /><br class="h6" />
+      <li><b class="ppem380">Store logo</b><br />Specify the image file name for PayPal to display on their payment pages pages, must be located in <code>catalog/images</code> directory. If you do not have SSL then leave this field blank.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Page Style Name</b><br />Specify the name of the page style you have configured in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">Include a note with payment</b><br />When a customer arrives at the PayPal payment page you can choose whether or not to show them another note field which will have seperate contents from that of the one provided in your store\'s checkout process but will be included in PayPal\'s invoice and receipt.<br />To change the title appearing above this field on the PayPal payment page look in the corresponding catalog langauge file (<code>catalog/includes/langauges/english/modules/payment/paypal.php</code>).</li><br /><br class="h6" />
+      <li><b class="ppem380">Shopping Cart Method</b><br />Choose which type of PayPal Shopping Cart you want to use, Aggregate simply means the total amount is passed (with a list of the products shown in a single item field), whereas an Itemized Cart will list indivudally all the items the customer has selected in their PayPal invoice.</li><br /><br class="h6" />
+      <li><b class="ppem380">Enable PayPal Shipping Address</b><br />Allow the customer to choose their own PayPal shipping address. (See <a href="'.tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL') .'">FAQ\'s</a> for more info)</li><br /><br class="h6" />
+      <li><b class="ppem380">Digest Key</b><br />Specify a unique digest key, this will then be used similiar to a password while testing via the IPN Test Panel <b>and</b> also the store\'s PayPal transaction signature digest key.</li><br /><br class="h6" />
+      <li><b class="ppem380">Test Mode</b><br />This should be off for live environments.<br />You can simulate your own IPNs via the <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp') .'">IPN Test Panel</a>.</li><br /><br class="h6" />
+      <li><b class="ppem380">Cart Test</b><br />This test verifies that the amount received via PayPal matches to what is expected (See <a href="'. tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL').'">FAQ\'s</a> for more info).</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notifications</b><br />Choose whether you want to receive debug emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notification Address</b><br />Enter a seperate email address where you wish to receive <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Domain</b><br />This must be set to <b>paypal.com</b> for live production environments, this setting is to facilate PayPal\'s sandbox and is not related to the IPN Test Panel or the above Test Mode option.</li><br /><br class="h6" />
+      <li><b class="ppem380">Return URL behavior</b><br />This determines what method PayPal should use when returning the customer back to the store, leave this set to 1 (GET).</li><br /><br class="h6" />
+    </ul>');
+
+
+
+define("PAYPAL_FAQ_CONTENTS1","The following are some frequently asked questions about this payment module:");
+
+define("PAYPAL_FAQ_CONTENTS2",'<ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">My shipping costs are different once the customer arrives at the PayPal site.</b></legend><div>In your PayPal account profile in the shipping section, check the box that allows overriding the shipping costs.</li><br /><br class="h6" />
+      <li><b class="ppem380">Do I need to enable IPN in my PayPal account profile.</b><br />No.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the IPN feature to be used.</b><br />You don\'t need to, it will automatically be specified.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why doesn\'t the Auto-Return feature work.</b><br />You must enable it first in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the Auto-Return feature.</b><br />It doesn\'t matter, this contribution will automatically specify the correct script url location, which is now <code>catalog/checkout_success.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Does this contribution support PayPal Credit Card payments.</b><br />Yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I getting so many emails per transaction.</b><br />You get <b>one</b> from PayPal and <b>one</b> osCommerce order confirmation email, and another which is the <b>debug email</b>, either disable <b>debug</b> email notification or specify a sperate email address for <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I not receiving any IPNs.</b><br />You must ensure that your <b>Primary Email Address</b> and <b>Business ID</b> are configured correctly.<br />Login to your PayPal Account and see what and how many email addresses you are using and which one is the Primary address.<br />Also check your debug emails as it will also specify the Primary Email Address of the intended receiver.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m having problems with Multi-Currencies.</b><br />This problem should now be resolved, previously the <b>Cart Test</b> was comparing the currency and amounts of the actual order to what PayPal received as opposed to actually comparing the currency and amounts prior to transfering the customer to PayPal.<br /><br /><b>However</b>, if you\'re using the Itemized Shopping Cart then discrepancies may arise due to PayPal\'s two decimal place calculations, in such an event the order will be placed on hold. Although this type of discrepancy may not affect all orders it does however exist and now adds a future requirement to enable you to finalize the transaction via your store\'s admin.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m having problems verifying the Cart Totals.</b><br />See above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why is there no PayPal shipping address details in the IPN info?</b><br />Set Enable PayPal Shipping Address to \'No\' if you require a PayPal verified shipping address or set to \'Yes\' if you do not.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can I customize the Checkout redirect page.</b><br />The splash template page shown while transfering the customer to PayPal is:<br /><code>catalog/includes/modules/payment/paypal/catalog/checkout_splash.inc.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find more PayPal logo buttons.</b><br />Login to your PayPal account and click Merchant Tools or Auction Tools.</li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find PayPal documentation.</b><br /><ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;"><li><a href="https://www.paypal.com/en_US/pdf/integration_guide.pdf">PayPal Integration Manual</a></li></ul></li><br /><br class="h6" />
+
+      <li><b class="ppem380">How do I use PayPal\'s Sandbox.</b>
+        <ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;">
+          <li>Register with <a href="https://developer.paypal.com/" target="PPDC">PayPal Developer Central</a></li><br class="h6" />
+          <li>Then create <b>two virtual accounts</b> types:<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Personal Account</li><li>Premier or Business Account</li></ul></li><br class="h6" />
+          <li>Confirm both accounts (each is just a single click option).</li><br class="h6" />
+          <li>Transfer some virtual money into your personal account (Click the add funds link).</li><br class="h6" />
+          <li>Emails to both accounts will appear in the section where you initially login into the PayPal Developer Central, no real emails are sent so the email addresses for your virtual accounts should be fictitious.</li><br class="h6" />
+          <li>Now in your <a href="'. tep_href_link(FILENAME_MODULES,'set=payment&module=paypal&action=edit').'" target="_blank">osCommerce::Admin::Modules::Payment::PayPal</a> configuration section<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Enter the virtual business account email address into both the Primary Email Address and Business ID fields</li><li>Set the domain to www.sandbox.paypal.com</li></ul></li><br class="h6" />
+          <li>Now checkout as a customer via the store, this account should have a real email address (so that you can receive the osC customer order confirmation email), and when you arrive at the PayPal Sandbox site (look for their logo) then login using the virtual personal account details and finalize the payment process.</li>
+        </ul>
+       <br /><p class="ppsmallerrorbold">Note that you must first login via the PayPal Developer Central prior to testing the Sandbox/Checkout process.</p>
+      </li><br /><br class="h6" />
+
+      <li><b class="ppem380">What\'s the difference between the IPN Test Panel and using PayPal\'s Sandbox.</b><br />The <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp').'" target="itp">IPN Test Panel</a> is an independent osCommerce Contribution feature, for testing and development purposes, which allows you to simmulate your own IPNs without having to interact with PayPal.<br /><br /><p class="ppsmallerrorbold">All Test IPNs via the IPN Test Panel will be invalid according to PayPal since they\'re not authentic transactions.</p></li><br /><br class="h6" />
+      <li><b class="ppem380">Is the IPN Test Panel related to PayPal\'s Sandbox.</b><br />No, see above.</li><br /><br class="h6" />
+      <li><b class="ppem380">What\'s the purpose of the digest key.</b><br />Currently the digest key serves two purposes, it authenticates and allows you to use the <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp').'" target="itp">IPN Test Panel</a>, secondly, untill such time that PayPal provides a secure method of associating an IPN specifically to a particular order, it serves as a unique transaction signature identifier.</li><br /><br class="h6" />
+      <li><b class="ppem380">Should I change the digest key default value.</b><br />Yes, but remember what it is if uninstalling and reinstalling this contrib payment module in the admin since there might be existing pending orders which will require it in order to associate with to their corresponding IPN(s).</li><br /><br class="h6" />
+      <li><b class="ppem380">How are IPNs deleted.</b><br />Currently, an IPN appearing the admin section is deleted automatically when deleting it\'s corresponding order.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can a customer resume their order.</b><br />Currently, if the customer abandons the checkout process at the PayPal site, e.g for some reason they did not actually pay at that time, then they can log into their osCommerce account and click the confirm order button when viewing the details of that particular order in their account_history_info.<br /><br />This feature is only available when <b>synchronizing invoices</b> with PayPal.<br /><br />This means that if you ever reset the osCommerce <code>orders</code> database table then you must also update it\'s auto-increment value to be greater than the last known <code>order_id</code>.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m getting errors after installing the contribution.</b><br />First, go through the installation edits and remove any blank spaces at the beginning of the line(s), some text editors will insert hidden characters which is a side effect of copying and pasting from HTML documentation.<br />Make sure that the alterations have been performed as well as running the paypal_ipn.sql script.</li><br /><br class="h6" />
+
+      <li><b class="ppem380">What type of PayPal account do I need.</b><br />You will need either a Premier or Merchant Business Account. <a href="https://www.paypal.com/refer/pal=PS2X9Q773CKG4" target="_blank">Click&nbsp;here&nbsp;to&nbsp;register&nbsp;for&nbsp;an&nbsp;account</a> if you do not already have one.</li><br /><br class="h6" />
+    </ul>');
+
+
+
+define("PAYPAL_IPN_TEST_MODE1","Test Mode must be enabled!");
+define("PAYPAL_IPN_TEST_MODE_ADVANCED","Advanced");
+define("PAYPAL_IPN_TEST_MODE_HELP_WITH_THIS_PAGE","Help with this page");
+define("PAYPAL_IPN_TEST_MODE_PRIMARY_PAYPAL_EMAIL_ADDRESS","Primary PayPal Email Address");
+define("PAYPAL_IPN_TEST_MODE_BUSINESS_ID","Business ID");
+define("PAYPAL_IPN_TEST_MODE_DEBUG_EMAIL_ADDRESS","Debug Email Address");
+
+define("PAYPAL_IPN_TEST_MODE_FIRST_NAME","First Name");
+define("PAYPAL_IPN_TEST_MODE_LAST_NAME","Last Name");
+define("PAYPAL_IPN_TEST_MODE_BUSINESS_NAME","Business Name");
+define("PAYPAL_IPN_TEST_MODE_EMAIL_ADDRESS","Email Address");
+define("PAYPAL_IPN_TEST_MODE_PAYER_ID","Payer ID");
+define("PAYPAL_IPN_TEST_MODE_PAYER_STATUS","Payer Status");
+define("PAYPAL_IPN_TEST_MODE_VERIFIED","verified");
+define("PAYPAL_IPN_TEST_MODE_UNVERIFIED","unverified");
+define("PAYPAL_IPN_TEST_MODE_INVOICE","Invoice");
+
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_NAME","Address Name");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STREET","Address Street");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_CITY","Address City");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STATE","Address State");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_ZIP","Address Zip");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_COUNTRY","Address Country");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STATUS","Address Status");
+define("PAYPAL_IPN_TEST_MODE_CONFIRMED","confirmed");
+define("PAYPAL_IPN_TEST_MODE_UNCONFIRMED","unconfirmed");
+
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_TYPE","Payment Type");
+define("PAYPAL_IPN_TEST_MODE_INSTANT","instant");
+define("PAYPAL_IPN_TEST_MODE_ECHECK","echeck");
+define("PAYPAL_IPN_TEST_MODE_TRANSACTION_TYPE","Transaction Type");
+define("PAYPAL_IPN_TEST_MODE_SELECT","--select--");
+define("PAYPAL_IPN_TEST_MODE_CART","cart");
+define("PAYPAL_IPN_TEST_MODE_WEB_ACCEPT","web_accept");
+define("PAYPAL_IPN_TEST_MODE_SEND_MONEY","send_money");
+define("PAYPAL_IPN_TEST_MODE_CUSTOM","Custom");
+define("PAYPAL_IPN_TEST_MODE_TRANSACTION_ID","Transaction ID");
+define("PAYPAL_IPN_TEST_MODE_PARENT_TRANSACTION_ID","Parent Transaction ID");
+define("PAYPAL_IPN_TEST_MODE_NO_CART_ITEMS","No. Cart Items");
+define("PAYPAL_IPN_TEST_MODE_NOTIFY_VERSION","Notify Version");
+define("PAYPAL_IPN_TEST_MODE_NOTIFY_VERSION_VALUE","1.6");
+define("PAYPAL_IPN_TEST_MODE_MEMO","Memo");
+
+define("PAYPAL_IPN_TEST_MODE_MC_CURRENCY","MC Currency");
+define("PAYPAL_IPN_TEST_MODE_USD","USD");
+define("PAYPAL_IPN_TEST_MODE_GBP","GBP");
+define("PAYPAL_IPN_TEST_MODE_EUR","EUR");
+define("PAYPAL_IPN_TEST_MODE_CAD","CAD");
+define("PAYPAL_IPN_TEST_MODE_JPY","JPY");
+define("PAYPAL_IPN_TEST_MODE_MC_GROSS","MC Gross");
+define("PAYPAL_IPN_TEST_MODE_MC_FEE","MC Fee");
+
+define("PAYPAL_IPN_TEST_MODE_SETTLE_AMOUNT","Settle Amount");
+define("PAYPAL_IPN_TEST_MODE_SETTLE_CURRENCY","Settle Currency");
+define("PAYPAL_IPN_TEST_MODE_EXCHANGE_RATE","Exchange Rate");
+
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS","Payment Status");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_COMPLETED","Completed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_PENDING","Pending");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_FAILED","Failed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_DENIED","Denied");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_REFUNDED","Refunded");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_REVERSED","Reversed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_CANCELED_REVERSAL","Canceled_Reversal");
+
+define("PAYPAL_IPN_TEST_MODE_PENDING_REASON","Pending Reason");
+define("PAYPAL_IPN_TEST_MODE_MULTI_CURRENCY","multi_currency");
+define("PAYPAL_IPN_TEST_MODE_INTL","intl");
+define("PAYPAL_IPN_TEST_MODE_VERIFY","verify");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS","address");
+define("PAYPAL_IPN_TEST_MODE_UPGRADE","upgrade");
+define("PAYPAL_IPN_TEST_MODE_UNILATERAL","unilateral");
+define("PAYPAL_IPN_TEST_MODE_OTHER","other");
+
+define("PAYPAL_IPN_TEST_MODE_REASON_CODE","Reason Code");
+define("PAYPAL_IPN_TEST_MODE_CHARGEBACK","chargeback");
+define("PAYPAL_IPN_TEST_MODE_GUARANTEE","guarantee");
+define("PAYPAL_IPN_TEST_MODE_BUYER_COMPLAINT","buyer_complaint");
+define("PAYPAL_IPN_TEST_MODE_REFUND","refund");
+
+define("PAYPAL_IPN_TEST_MODE_TAX","Tax");
+define("PAYPAL_IPN_TEST_MODE_FOR_AUCTION","For Auction");
+define("PAYPAL_IPN_TEST_MODE_NO","No");
+define("PAYPAL_IPN_TEST_MODE_YES","Yes");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_BUYER_ID","Auction Buyer ID");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_CLOSING_DATE","Auction Closing Date");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_MULTI_ITEM","Auction Multi-Item");
+
+define("PAYPAL_IPN_TEST_MODE_ITEM_NAME","Item Name");
+define("PAYPAL_IPN_TEST_MODE_ITEM_NUMBER","Item Number");
+define("PAYPAL_IPN_TEST_MODE_QUANTITY","Quantity");
+
+
+define("PAYPAL_IPN_TEST_MODE_HELP1","The following is a quick guide towards simmulating your own IPNs:");
+
+
+define("PAYPAL_IPN_TEST_MODE_HELP2",' <br><ol>
+      <li>Begin to check out as a customer via the store, stop when you get to the PayPal site</li><br><br class="h6">
+      <li>Go into the store admin orders section and find the last order (just created)</li><br><br class="h6">
+      <li>Select a <b>Transaction Type</b>, usually cart or web_accept, but nothing for refunds, reversals, or canceled_reversals payments</li><br><br class="h6">
+      <li>Copy and paste the <b>Transaction Signature</b> into the <b>Custom</b> field and into the <b>Transaction ID</b> field</li><br><br class="h6">
+      <li>If the <b>Cart Test</b> is on, then make sure that the above <b>MC Gross</b> amount is the same as the order total and that the <b>MC&nbsp;Currency</b> field is set to the same currency as the order.</li><br><br class="h6">
+      <li>Submit the Test IPN</li><br><br class="h6">
+      <li>Now check the admin order status</li><br><br class="h6">
+    </ol>');
+
+define("PAYPAL_IPN_TEST_MODE_HELP3","When testing Pending payments etc, remember to use the same Transction ID");
+
+##################### 03/07/2006 Start  ####################
+
+define("NON_TTF_FONT_ERROR","Non-TTF font size must be 1,2,3,4 or 5");
+define("SETLEGEND_ERROR","Error: SetLegend argument must be an array");
+
+define("UNABLE_TO_OPEN_ERROR","Unable to open ");
+define("UNABLE_TO_OPEN_GIF_ERROR"," as a GIF");
+define("UNABLE_TO_OPEN_PNG_ERROR"," as a PNG");
+define("UNABLE_TO_OPEN_JPG_ERROR"," as a JPG");
+define("SELECT_IMAGE_ERROR","Please select wbmp,gif,jpg, or png for image type!");
+define("SELECT_IMAGE_TYPE_ERROR","Please select an image type!");
+define("NOT_ACCEPTABLE_PLOT_TYPE_ERROR"," not an acceptable plot type");
+define("UNKNOWN_CHART_TYPE_ERROR","ERROR: unknown chart type");
+define("LOG_PLOTS_DATA_GREATER_ERROR","Log plots need data greater than 0");
+define("ERROR_IN_DATA","Error in Data - max not gt min");
+define("FATAL_ERROR","Fatal error");
+define("THINBARLINES_DATA_TYPE_ERROR","Data Type for ThinBarLines must be data-data");
+define("BAR_PLOTS_DATA_TYPE_ERROR",'Bar plots must be text-data: use function SetDataType("text-data")');
+define("NO_IMAGE_DEFINED_DRAWGRAPH_ERROR","No Image Defined: DrawGraph");
+define("NO_ARRAY_OF_DATA_IN_ERROR","No array of data in ");
+
+
+
+##################### 03/07/2006 End  ####################
+
+
+##################### 04/07/2006 Start  ####################
+
+define("SESSION_FILE_OPEN_ERROR_1",'Could not open session file (');
+define("SESSION_FILE_OPEN_ERROR_2",').');
+define("SESSION_FILE_WRITE_ERROR_1",'Could not write session file (');
+define("SESSION_FILE_WRITE_ERROR_2",').');
+define("CACHING_METHOD_ERROR_1",'Caching method ');
+define("CACHING_METHOD_ERROR_2",' not implemented.');
+define("INITIALIZE_SESSION_MODULE_ERROR",'Failed to initialize session module.');
+define("SESSION_NOT_SAVED_ERROR",'Session could not be saved.');
+define("SESSION_NOT_CLOSED_ERROR",'Session could not be closed.');
+define("SESSION_NOT_STARTED_ERROR",'Session could not be started.');
+
+
+define("CANNOT_COPY_PRODUCT_ERROR_1",'<b>WARNING: Cannot copy from Product ID #');
+define("CANNOT_COPY_PRODUCT_ERROR_2",' to Product ID # ');
+define("CANNOT_COPY_PRODUCT_ERROR_3",' ... No copy was made</b>');
+define("NO_ATTRIBUTES_COPY_ERROR_1",'<b>WARNING: No Attributes to copy from Product ID #');
+define("NO_ATTRIBUTES_COPY_ERROR_2",' for: ');
+define("NO_ATTRIBUTES_COPY_ERROR_3",' ... No copy was made</b>');
+define("NO_PRODUCT_ERROR_1",'<b>WARNING: There is no Product ID #');
+define("NO_PRODUCT_ERROR_2",' ... No copy was made</b>');
+
+
+define("MCRYPT_ALGORITHMS_AND_MODES",'Mcrypt Algorithms and Modes');
+define("MCRYPT_ALGORITHM",'Algorithm');
+define("MCRYPT_Status",'Status');
+define("MCRYPT_OK",'OK');
+define("MCRYPT_NOT_OK",'NOT OK');
+define("MCRYPT_NOT_TESTED",'NOT TESTED');
+define("MCRYPT_MAXIMUM_KEY_SIZES_ALLOWED",'Maximum Key Sizes Allowed');
+define("MCRYPT_MAXIMUM_KEY_SIZE",'Maximum Key Size');
+define("MCRYPT_KEY_TEXT",'this is a very long key, even too long for the cipher');
+define("MCRYPT_PLAIN_TEXT",'very important data');
+
+define("DATABASE_TEP_DB_ERROR",'[TEP STOP]');
+
+define("CANNOT_CHANGE_THE_MODE_OF_FILE","Cannot change the mode of file");
+define("FAILED_TO_OPEN_FILE",'Failed to open file ');
+define("CANNOT_WRITE_TO_FILE",'Cannot write to file ');
+
+define("UNABLE_TO_DETERMINE_PAGE_LINK",'<b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function used:<br><br>');
+define("UNABLE_TO_DETERMINE_CONNECTION_METHOD_ON_PAGE_LINK",'<b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>');
+
+
+define("SUPPORT_DESK",'Support Desk');
+
+define("FRAUDSCREENCLIENT_AFS",'AFS');
+define("FRAUDSCREENCLIENT_QUERY_RESULT",'query result');
+define("FRAUDSCREENCLIENT_SERVER_UNAVAILABLE","Algozone Fraud Screen Server currently unavailable. Please try again later.");
+define("FRAUDSCREENCLIENT_AFS_INPUTS","AFS Inputs");
+define("FRAUDSCREENCLIENT_INPUT","input");
+define("FRAUDSCREENCLIENT_INVALID_INPUT","invalid input");
+define("FRAUDSCREENCLIENT_MISSPELLED_FIELD","- perhaps misspelled field?");
+define("FRAUDSCREENCLIENT_AFS_USING_CURL","AFS using curl");
+define("FRAUDSCREENCLIENT_AFS_CURL_PARAMS","AFS curl params");
+define("FRAUDSCREENCLIENT_AFS_CURL_NOT_SUPPORT","<br>error: this version of curl does not support HTTPS try build curl with SSL or specify");
+define("FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_1","Received error message");
+define("FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_2","from curl");
+define("FRAUDSCREENCLIENT_AFS_CURL_PROXY","<p>using curl thru proxy");
+define("FRAUDSCREENCLIENT_AFS_USING_FSOCKOPEN","<p><b>AFS using fsockopen</b>");
+define("FRAUDSCREENCLIENT_AFS_SOCKET_PARAM","AFS socket url param");
+define("FRAUDSCREENCLIENT_AFS_FSOCKOPEN_PROXY","<p><b>AFS using fsockopen proxy<b><br>");
+define("FRAUDSCREENCLIENT_AFS_PROXY_PORT","<br>error: you need to provide the proxy port number to use the proxy port provided");
+define("FRAUDSCREENCLIENT_AFS_INSTALL_CURL","<br>error: you need to install curl if you want secure HTTPS or specify the variable to be");
+define("FRAUDSCREENCLIENT_AFS_QUERY_RESULTS","<p><b>AFS query results: </b>");
+define("FRAUDSCREENCLIENT_AFS_OUTPUT","output");
+
+define("MAP_MSG","<p>Courtesy of the U.S. Census Bureau's TIGER Mapping Service");
+
+define("ATTRIBUTES_DISPLAY_MSG","**Discounts may vary based on selected options");
+
+define("FOOTER_TEXT_1",'E-Commerce Engine Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a> Portions Copyright &copy; 2003 - 2006 <a href="http://www.creloaded.com" target="_blank">CRE Loaded Project</a><br>osCommerce provides no warranty and is redistributable under the <a href="http://www.fsf.org/licenses/gpl.txt" target="_blank">GNU General Public License</a><br><a href="http://www.chainreactionworks.com" target="_blank">Chain Reaction Works, Inc</a> provides no warranty except as to associated support contracts<br>which are limited by and to the Service Level Agreement.</br>');
+define("FOOTER_TEXT_2",'Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.creloaded.com" target="_blank">CRE Loaded</a>');
+
+
+##################### 04/07/2006 End  ####################
+
+
+##################### 05/07/2006 End  ####################
+
+define("AUTHORIZE_NET_HELP_TITLE","Authorize.net Consolidated CRE Help Screen");
+define("AUTHORIZE_NET_HELP_MSG_1","Authorize.net Consolidated CRE Edition");
+define("AUTHORIZE_NET_HELP_MSG_2","Configuration Help Screen");
+define("AUTHORIZE_NET_HELP_MSG_3",'<a href="http://ecommexchange.com"><h2>Link to Apply for Authorize.net account</h2></a><br>(support the CRE project by using our Authorize.net partner)');
+define("AUTHORIZE_NET_HELP_MSG_4",'User your browser back button to return to the Authorize.net edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Authorize.net testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Authorize.net Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Authorize.net User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Authorize.net Consolidated uses the AIM method of
+connecting to Authorize.net.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Authorize.net gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don\'t know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Authorize.net Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Authorize.net Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>
+<li>Trouble Shooting Notes </li>
+<p>If you experience high levels of transaction failure, you may need to adjust your sessions configuration.  Consult your technical support team for more information</p> ');
+
+##################### 05/07/2006 End  ####################
+##################### 06/07/2006 Start  ####################
+
+define("FEATURE_NOT_PRESENT_TEXT",'<p class="style4">CRE Loaded Standard Version is the perfect application
+        to power your e-Commerce websites. However, if you need features that
+        only a Pro-level application can deliver, please take a look at all the
+        powerful options our Pro Version adds. If you are looking to deploy a
+        powerful Business to Business solution, our Pro B2B has added features
+        to enhance sales and productivity.</p>
+
+        <p class="style4">Feel free to contact us for more details or usage guidlines. </p>');
+
+define("HEADER_TAGS_ENGLISH_TXT_1","Default Title");
+define("HEADER_TAGS_ENGLISH_TXT_2","Default Descriptions");
+define("HEADER_TAGS_ENGLISH_TXT_3","Default Keyword(s)");
+define("HEADER_TAGS_ENGLISH_TXT_4","HTTA: ");
+define("HEADER_TAGS_ENGLISH_TXT_5","HTDA: ");
+define("HEADER_TAGS_ENGLISH_TXT_6","HTKA: ");
+define("HEADER_TAGS_ENGLISH_TXT_7","HTCA: ");
+define("HEADER_TAGS_ENGLISH_TXT_8","(Explain) ");
+define('HEADER_TAGS_ENGLISH_TXT_9', 'Title');
+define('HEADER_TAGS_ENGLISH_TXT_10', 'Descriptions');
+define('HEADER_TAGS_ENGLISH_TXT_11', 'Keyword(s)');
+
+
+define('HEADER_TAGS_FILL_TAGS_TXT_1', 'CATEGORIES');
+define('HEADER_TAGS_FILL_TAGS_TXT_2', 'PRODUCTS');
+define('HEADER_TAGS_FILL_TAGS_TXT_3', 'Skip all tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_4', 'Fill only empty tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_5', 'Fill all tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_6', 'Clear all tags');
+
+define("INSTALL_EXPLAIN_TXT_1","Install (and Uninstall) Database Settings script for osC-Explain - by Chemo");
+define("INSTALL_EXPLAIN_TXT_2",'<p><b>Install option selected...running queries</b></p>');
+define("INSTALL_EXPLAIN_TXT_3",'<p>STEP 1 => Add configuration group</p>');
+define("INSTALL_EXPLAIN_TXT_4",'<p>Added the configuration group ');
+define("INSTALL_EXPLAIN_TXT_5",'successfully...adding configuration values</p>');
+define("INSTALL_EXPLAIN_TXT_6",'<p>STEP 2 => Add configuration settings</p>');
+define("INSTALL_EXPLAIN_TXT_7","<blockquote>Success...</blockquote>");
+define("INSTALL_EXPLAIN_TXT_8","<p>Added the configuration settings successfully...adding the 'explain_queries' table</p>");
+define("INSTALL_EXPLAIN_TXT_9",'<p>STEP 3 => Creating explain_queries table</p>');
+define("INSTALL_EXPLAIN_TXT_10",'<blockquote>Successfully created the table.</blockquote>');
+define("INSTALL_EXPLAIN_TXT_11","<p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>");
+
+define("INSTALL_EXPLAIN_TXT_12","<p><b>Uninstall optin selected...running queries</b></p><p>STEP 1 => Delete the configuration group from configuration_group table</p>");
+
+define("INSTALL_EXPLAIN_TXT_13",'<blockquote>Deleted the configuration group successfully...removing configuration values</blockquote><p>STEP 2 => Delete configuraton values</p>');
+
+define("INSTALL_EXPLAIN_TXT_14",'<blockquote>Deleted the configuration values successfully...dropping the explain_queries table</blockquote><p>STEP 3 => Dropping explain_queries table</p>');
+
+
+define("INSTALL_EXPLAIN_TXT_15",'<blockquote>Table dropped successfully...analyzing tables</blockquote><p>STEP 4 => Analyzing configuration_group and configuration table</p>');
+
+define("INSTALL_EXPLAIN_TXT_16","<blockquote>Analyze configuration_group success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_17","<blockquote>Analyze configuration success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_18","<blockquote>Optimize configuration_group success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_19","<blockquote>Optimize configuration success...</blockquote><p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>");
+
+define("INSTALL_EXPLAIN_TXT_20",'<p>Welcome to the barebones osC-Explain installation script (<a href="http://forums.oscommerce.com/index.php?showuser=9196">by   Chemo</a>)!</p><p>This contribution is GPL and the target audience is fellow coders, optimizers,   and knowledgeable webmasters. I encourage each of you to look over the   code and add functionality so that the rest of us can benefit as well.</p><p>There are two options for this script:</p><p><strong>INSTALL</strong></p><blockquote>  <p>This option is self explanatory :) It will add a configuration group     with the title &quot;Explain Queries&quot; and set the sort order to 99 (making     it the last listed). The script will then add values to the configuration     table that is the options for this contribution. Currently, these are     available:</p>  <ul>    <li> Global on / off</li>    <li>Enable on for specific scripts (add one or list separated by comma).       This will be handy for contribution coders since they can enable only for       their development scripts and not waste room for storing other page queries.       In addition, it will speed up the admin report if there are 1,000 rows instead       of 500,000 :)</li>    <li>Enable page exclusion for specific scripts. This is handy to exclude       certain scripts (for instance, ones already optimized) but capture the rest.</li>  </ul>  <p>The last thing this install script does is add a new table called \'explain_queries\'.    This is needed to store the data. Do not change the name since the table     name is hardcoded all over the place. Why not add a new define to filenames.php?     If there is room to trim install steps and decrease the number of file changes     I\'ll take it any day of the week and twice on Sunday. You are (hopefully)     an experienced osC developer so if you want to do define table names the standard     way edit your own files.</p></blockquote><p align="center"><strong><a href="'.$_SERVER['PHP_SELF'].'?action=install">INSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p><p align="left"><strong>UNINSTALL</strong></p><blockquote>  <p align="left">Hopefully, this option is self-explanatory too :) This     will delete all the values associated with osC-Explain from the configuration_group     and configuration tables. Then it will analyze the tables to reset the     cardinality of the tables. Next, the script will drop the \'explain_queries\'     table.</p></blockquote><p align="center"><strong><a href="'.$_SERVER['PHP_SELF'].'?action=delete">UNINSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p><p align="left"><strong>NOTES</strong>: By default all values are set to false.   So, once you have the files uploaded and necessary changes have been made you\'ll   have to enable it through the admin control panel. </p><blockquote>  <p align="left">Configuration -> Explain Queries -> Enable explain queries     -> true</p></blockquote>');
+
+define("VALID_CATEGORIES_PRODUCTS_LIST","Valid Categories/Products List");
+define("VALID_CATEGORIES_LIST","Valid Categories List");
+define("VALID_PRODUCTS_LIST","Valid Products List");
+
+
+define("CRE_LOADED_OSCOMMERCE","CRE Loaded osCommerce");
+define("PASS_FORGOTTEN_FOOTER",'E-Commerce Engine Copyright &copy; 2003 <a href="http://oscommerce.com" target="_blank">osCommerce</a> <br>      Supercharged by <a href="http://creloaded.com" target="_blank">CRE Loaded</a>');
+
+##################### 06/07/2006 End  ####################
+
+
+##################### 07/07/2006 End  ####################
+
+define("QUICK_ATTRIBUTES_POPUP_TXT_0",'Current Attributes');
+define("QUICK_ATTRIBUTES_POPUP_TXT_1","Current ID#");
+define("QUICK_ATTRIBUTES_POPUP_TXT_2","Model:");
+define("QUICK_ATTRIBUTES_POPUP_TXT_3","NO CURRENT ATTRIBUTES ...");
+define("QUICK_ATTRIBUTES_POPUP_TXT_4",'CURRENT ATTRIBUTES:');
+define("QUICK_ATTRIBUTES_POPUP_TXT_5",'Close Window');
+
+define("QUICK_PRODUCTS_POPUP_TXT_0",'Quick Products Listing');
+define("QUICK_PRODUCTS_POPUP_TXT_1",'Quick Product Locator');
+define("QUICK_PRODUCTS_POPUP_TXT_2",'All categories:');
+define("QUICK_PRODUCTS_POPUP_TXT_3",'Click to:');
+define("QUICK_PRODUCTS_POPUP_TXT_4",'Show Attributes');
+
+
+define("QUICKCOM_HELP_TXT_1",'Quickcommerce Consolidated CRE Help Screen');
+define("QUICKCOM_HELP_TXT_2",'Quickcommerce Consolidated CRE Edition');
+define("QUICKCOM_HELP_TXT_3",'Configuration Help Screen');
+define("QUICKCOM_HELP_TXT_4",'<a href=" https://freecreditcardprocessing.com/applynow/online_application.asp?code=chainreaction"> <h2>Link to Apply for Quickcommerce account</h2></a><br>(support the CRE project by using our authorize.net partner)');
+define("QUICKCOM_HELP_TXT_5",'User your browser back button to return to the Quickcommerce edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Quickcommerce testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Quickcommerce Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Quickcommerce User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Quickcommerce Consolidated uses the AIM method of
+connecting to Quickcommerce.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Quickcommerce gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don\'t know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Quickcommerce Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Quickcommerce Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>');
+
+
+define("STATS_EXPLAIN_QUERIES_TXT_1","Explain Queries v1.0 - by Chemo");
+define("STATS_EXPLAIN_QUERIES_TXT_2",'Explain Queries Report v1.0 <a href="http://forums.oscommerce.com/index.php?showuser=9196">- by Chemo</a>');
+
+define("STATS_EXPLAIN_QUERIES_TXT_3",'Export Format');
+define("STATS_EXPLAIN_QUERIES_TXT_4",'CVS');
+define("STATS_EXPLAIN_QUERIES_TXT_5",'HTML');
+define("STATS_EXPLAIN_QUERIES_TXT_6",'Limit to');
+define("STATS_EXPLAIN_QUERIES_TXT_7",'rows starting with row#');
+define("STATS_EXPLAIN_QUERIES_TXT_8",'Back to Explain Queries');
+define("STATS_EXPLAIN_QUERIES_TXT_9",'results returned for:');
+define("STATS_EXPLAIN_QUERIES_TXT_10",'Query#');
+define("STATS_EXPLAIN_QUERIES_TXT_11",'Time (ms): ');
+define("STATS_EXPLAIN_QUERIES_TXT_12",'# Records:');
+define("STATS_EXPLAIN_QUERIES_TXT_13",'Script: ');
+define("STATS_EXPLAIN_QUERIES_TXT_14",'Request String:');
+define("STATS_EXPLAIN_QUERIES_TXT_15",'Table: ');
+define("STATS_EXPLAIN_QUERIES_TXT_16",'Type: ');
+define("STATS_EXPLAIN_QUERIES_TXT_17",'Possible / Used Key: ');
+define("STATS_EXPLAIN_QUERIES_TXT_18",'Key Len:');
+define("STATS_EXPLAIN_QUERIES_TXT_19",'Rows: ');
+define("STATS_EXPLAIN_QUERIES_TXT_20",'Ref: ');
+define("STATS_EXPLAIN_QUERIES_TXT_21",'Extra: ');
+define("STATS_EXPLAIN_QUERIES_TXT_22",'Comment: ');
+
+define("TEMPLATE_CONFIGURATION1_TXT_1","Link Button Name 1");
+define("TEMPLATE_CONFIGURATION1_TXT_2","Link Button Name 2");
+define("TEMPLATE_CONFIGURATION1_TXT_3","Link Button Name 3");
+define("TEMPLATE_CONFIGURATION1_TXT_4","Link Button Name 4");
+define("TEMPLATE_CONFIGURATION1_TXT_5","Link Button Name 5");
+define("TEMPLATE_CONFIGURATION1_TXT_6","Link Button Name 6");
+
+define("TEMPLATE_CONFIGURATION1_TXT_7","<br> There are ");
+define("TEMPLATE_CONFIGURATION1_TXT_8"," active infoboxes in your Right Column<br>");
+define("TEMPLATE_CONFIGURATION1_TXT_9","WARNING: You have the RIGHT Column Active BUT <br>No boxes selected in your RIGHT column");
+define("TEMPLATE_CONFIGURATION1_TXT_10","Left column cellpadding");
+define("TEMPLATE_CONFIGURATION1_TXT_11","Show Page descriptions");
+define("TEMPLATE_CONFIGURATION1_TXT_12","Right Column cell padding");
+define("TEMPLATE_CONFIGURATION1_TXT_13","Include Main Table Border");
+define("TEMPLATE_CONFIGURATION1_TXT_14","Show Customer Greeting?");
+define("TEMPLATE_CONFIGURATION1_TXT_15","<br>edit text for Customer Logged On<br>");
+define("TEMPLATE_CONFIGURATION1_TXT_16",'<br>edit text for Customer Re-Logged On<br>');
+define("TEMPLATE_CONFIGURATION1_TXT_17",'<br>edit text for Guest greeting<br>');
+define("TEMPLATE_CONFIGURATION1_TXT_18",'Include Which Modules On Catalog index Page?');
+
+
+define("TREEVIEW_TXT_1","Catalog Tree");
+define("TREEVIEW_TXT_2","open all");
+define("TREEVIEW_TXT_3","close all");
+
+##################### 07/07/2006 End  ####################
+
+
+
+
+define("ADMIN_JS_FILE_BROWSER","File Browser");
+define("ADMIN_JS_INSERT_FILE","Insert File");
+
+define("ADMIN_JS_IBROWSER_MSG_1",'<strong>net<span class="hilight">4</span>visions.com</strong> - the image browser plugin for WYSIWYG editors like FCKeditor, SPAW, tinyMCE, Xinha, and HTMLarea!</p>
+              <p> <strong> <span class="hilight">i</span>Browser</strong> does upload images and supply file management functions. Images can be resized on the fly. If you need even more advanced features, have a look at <strong> <span class="hilight">i</span>Manager</strong>, another <strong>net<span class="hilight">4</span>visions.com</strong> plugin - it adds truecolor image editing functions like: resize, flip, crop, add text, gamma correct, merge into other image, and many others.</p>
+              <p><strong> <span class="hilight">i</span>Browser</strong> is written and distributed under the GNU General Public License which means that its source code is freely-distributed and available to the general public.</p>
+              <p>&nbsp;</p>');
+
+define("ADMIN_JS_IBROWSER_MSG_2",'Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exercitation ullamcorper suscipit. Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.');
+
+define("ADMIN_JS_PREVIEW_PAGE","Preview page");
+define("ADMIN_JS_EDITOR_CONTENTS","Editor contents:");
+define("ADMIN_JS_CLOSE","Close");
+define("ADMIN_JS_PRINT","Print");
+
+##################### 08/07/2006 End  ####################
+
+
+define("DOCUMENT_INDEX","Document Index");
+
+define("CUSTOMER_ZIP_CODE_VALIDATOR","Customer Zip Code Validator");
+define("SEND_EMAIL_TO_ALL","Send Email to All");
+define("MISMATCHED_STATE_AND_ZIPCODE","Mismatched State and Zipcode");
+define("ADDRESS_BOOK_ID","Address Book ID");
+define("CUSTOMER_ID","Customer ID");
+define("CUSTOMER","Customer");
+define("REMOVE","Remove");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/abandoned_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/abandoned_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/abandoned_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,134 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Verlassene / nicht abgeschlossene Bestellungen');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'von');
+define('HEADING_SUBTITLE', 'Redigieren Sie bitte alle Teile, wie gew&uuml;nscht und klicken Sie "Aktuallisieren" Button unten an.');
+define('HEADING_TITLE_SEARCH', 'Bestell ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('ADDING_TITLE', 'Produkt zu dieser Bestellung hinzuf&uuml;gen');
+
+define('ADD_PRODUCT', 'Produkt zu Bestellung hinzuf&uuml;gen');
+define('HEADING_ABANDONED', '<B>Der Warenkorb f&uuml;r diesen Vorgang wurde abgebrochen!!! Bestell ID:  </B>');
+define('TEXT_INFO_ABANDONDED', 'Abgebrochen / Verlassen');
+
+define('ENTRY_UPDATE_TO_CC', '(Aktuallisiren zu <b>Kreditkarte</b> um Kreditkartenfelder zu lesen.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hinweis: </font>Um ein Produkt zu l&ouml;schen wird die St&uuml;ckzahl auf "0" gesetzt.');
+define('HINT_TOTALS', '<font color="#FF0000">Hinweis: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Klicken Sie auf "Update" um alle &Auml;nderungen zu &uuml;bernehmen.');
+define('TABLE_HEADING_COMMENTS', 'Kommentare');
+define('TABLE_HEADING_CUSTOMERS', 'Kunden');
+define('TABLE_HEADING_ORDER_TOTAL', 'Bestellungen gesamt');
+define('TABLE_HEADING_DATE_PURCHASED', 'Gekauft am');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_QUANTITY', 'Stk.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modell');
+define('TABLE_HEADING_PRODUCTS', 'Produkte');
+define('TABLE_HEADING_TAX', 'MwSt.');
+define('TABLE_HEADING_TOTAL', 'Gesamt');
+define('TABLE_HEADING_UNIT_PRICE', 'Verpackungs Einheit Preis');
+define('TABLE_HEADING_BASE_PRICE', 'Basis Preis');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Preis (inkl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Gesamt Preis');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Gesamt (inkl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Gesamt Preis Komponente');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Menge');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Kunde benachrichtigt');
+define('TABLE_HEADING_DATE_ADDED', 'hinzugef&uuml;gt am');
+
+define('ENTRY_CUSTOMER', 'Kunde Allgemein');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Firma');
+define('ENTRY_CUSTOMER_ADDRESS', 'Adresse');
+define('ENTRY_CUSTOMER_SUBURB', 'Stadtteil');
+define('ENTRY_CUSTOMER_CITY', 'Stadt');
+define('ENTRY_CUSTOMER_STATE', 'Bundesland');
+define('ENTRY_CUSTOMER_POSTCODE', 'PLZ');
+define('ENTRY_CUSTOMER_COUNTRY', 'Land');
+define('ENTRY_CUSTOMER_PHONE', 'Telefon');
+define('ENTRY_CUSTOMER_EMAIL', 'EMail');
+define('ENTRY_SOLD_TO', 'Bezahlt an:');
+define('ENTRY_DELIVERY_TO', 'Versenden an:');
+define('ENTRY_SHIP_TO', 'Versandt an:');
+define('ENTRY_SHIPPING_ADDRESS', 'Versand Adresse:');
+define('ENTRY_BILLING_ADDRESS', 'Zahlungs Adresse:');
+define('ENTRY_PAYMENT_METHOD', 'Bezahl Methode:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Type: ');
+define('ENTRY_CREDIT_CARD_OWNER', 'Eigent&uuml;mer: ');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Kreditkarten Nummer: ');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Verf&auml;llt am: ');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC Nummer: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Datum: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Fehler Nummer: ');
+define('ENTRY_SUB_TOTAL', 'Zwischensumme:');
+define('ENTRY_TAX', 'MwSt.:');
+define('ENTRY_SHIPPING', 'Versand:');
+define('ENTRY_TOTAL', 'Gesamt:');
+define('ENTRY_DATE_PURCHASED', 'Gekauft am:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'Letzte aktuallisierung:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Kunde benachtichtigt:');
+define('ENTRY_NOTIFY_COMMENTS', 'F&uuml;gen Sie Anmerkungen an:');
+define('ENTRY_PRINTABLE', 'Rechnung drucken');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Nutzen Sie bitte Negativ Werte -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Nachlass/Geschenkgutschein: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Bestellung l&ouml;schen');
+define('TEXT_INFO_DELETE_INTRO', 'Wollen Sie diese Bestellung wirklich l&ouml;schen?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Ware dem Lager gutschreiben');
+define('TEXT_DATE_ORDER_CREATED', 'Erstellt am:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Neues Produkt hinzuf&uuml;gen');
+define('TEXT_INFO_PAYMENT_METHOD', 'Bezahl Methode:');
+
+define('TEXT_ALL_ORDERS', 'Alle Bestellungen');
+define('TEXT_NO_ORDER_HISTORY', 'Kein Bericht verf&uuml;gbar');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Bestellung aktuallisiert');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Bestell Nummer:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailierte Rechnung:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Bestelldatum:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Ihre Bestellung wurde auf den folgenden Status gesetzt.' . "\n\n" . 'Neuer Status: %s' . "\n\n" . 'Sollten sich daraus Fragen ergeben, kontaktieren Sie uns bitte per EMail.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'Folgende Kommentare wurde an Ihre Bestellung angef&uuml;gt' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Fehler: Bestellung existiert nicht.');
+define('SUCCESS_ORDER_UPDATED', 'Erfolgreich: Bestellung wurde erfolgreich aktuallisiert.');
+define('WARNING_ORDER_NOT_UPDATED', 'Warnung: Es sind keine &Auml;nderungen durchzuf&uuml;hren. Die Bestellung wurde somit nicht ver&auml;ndert.');
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'W&auml;hlen Sie ein Produkt');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'W&auml;hlen Sie eine Option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Zu diesem Produkt sind keine Optionen verf&uuml;gbar...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'St&uuml;ckzahl des Produktes');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'hinzuf&uuml;gen');
+define('ADDPRODUCT_TEXT_STEP', 'Schritt');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Katalog w&auml;hlen. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Produkt w&auml;hlen. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Option w&auml;hlen. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Kunden Daten');
+define('MENUE_TITLE_PAYMENT', '2. Bezahl Methode');
+define('MENUE_TITLE_ORDER', '3. Bestellte Produkte');
+define('MENUE_TITLE_TOTAL', '4. Einzelpreis, Versand und Gesamt');
+define('MENUE_TITLE_STATUS', '5. Status und Benachrichtigung');
+define('MENUE_TITLE_UPDATE', '6. Update Daten');
+
+
+define('DISPLAY_BASKET', Anzeige Korb');
+define('DONT_ADD_NEW_PRODUCT', 'Addieren Sie Nicht Neues Produkt');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/admin_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/admin_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/admin_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: admin_account.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Admin Konto');
+
+define('TABLE_HEADING_ACCOUNT', 'Mein Konto');
+
+define('TEXT_INFO_FULLNAME', '<b>Name: </b>');
+define('TEXT_INFO_FIRSTNAME', '<b>Vorname: </b>');
+define('TEXT_INFO_LASTNAME', '<b>Nachname: </b>');
+define('TEXT_INFO_EMAIL', '<b>Email Adresse: </b>');
+define('TEXT_INFO_PASSWORD', '<b>Passwort: </b>');
+define('TEXT_INFO_PASSWORD_HIDDEN', '-Versteckt-');
+define('TEXT_INFO_PASSWORD_CONFIRM', '<b>Passwort best&auml;tigen: </b>');
+define('TEXT_INFO_CREATED', '<b>Konto erstellt am: </b>');
+define('TEXT_INFO_LOGDATE', '<b>Letzter Zugriff am: </b>');
+define('TEXT_INFO_LOGNUM', '<b>Log Nummer: </b>');
+define('TEXT_INFO_GROUP', '<b>Gruppen Ebene: </b>');
+define('TEXT_INFO_ERROR', '<font color="red">Email Adresse wurde bereits benutzt! Bitte versuchen Sie es noch einmal.</font>');
+define('TEXT_INFO_MODIFIED', 'Ge&auml;ndert am: ');
+
+define('TEXT_INFO_HEADING_DEFAULT', 'Konto editieren ');
+define('TEXT_INFO_HEADING_CONFIRM_PASSWORD', 'Passwort Best&auml;tigung ');
+define('TEXT_INFO_INTRO_CONFIRM_PASSWORD', 'Passwort:');
+define('TEXT_INFO_INTRO_CONFIRM_PASSWORD_ERROR', '<font color="red"><b>FEHLER:</b> Falsches Passwort!</font>');
+define('TEXT_INFO_INTRO_DEFAULT', 'Klicken Sie den <b>&Auml;ndern Button</b> unten, um Ihr Konto zu editieren.');
+define('TEXT_INFO_INTRO_DEFAULT_FIRST_TIME', '<br><b>WARNUNG:</b><br>Hallo <b>%s</b>, Sie sind zum ersten mal hier. Wir empfehlen Ihnen, Ihr Passwort zu &auml;ndern!');
+define('TEXT_INFO_INTRO_DEFAULT_FIRST', '<br><b>WARNUNG:</b><br>Hallo <b>%s</b>, wir empfehlen Ihnen, Ihre Email Adresse (<font color="red">admin at localhost</font>) und passwort zu &auml;ndern!');
+define('TEXT_INFO_INTRO_EDIT_PROCESS', 'Alle Felder sind erforderlich. Klicken Sie Speichern zur Eingabe.');
+
+define('JS_ALERT_FIRSTNAME',        '- Notwendig: Vorname \n');
+define('JS_ALERT_LASTNAME',         '- Notwendig: Nachname \n');
+define('JS_ALERT_EMAIL',            '- Notwendig: Email Adresse \n');
+define('JS_ALERT_PASSWORD',         '- Notwendig: Passwort \n');
+define('JS_ALERT_FIRSTNAME_LENGTH', '- Vorname muss l&auml;nger sein als ');
+define('JS_ALERT_LASTNAME_LENGTH',  '- Nachname muss l&auml;nger sein als ');
+define('JS_ALERT_PASSWORD_LENGTH',  '- Passwort muss l&auml;nger sein als ');
+define('JS_ALERT_EMAIL_FORMAT',     '- Email Adressen-Format ist ung&uuml;ltig! \n');
+define('JS_ALERT_EMAIL_USED',       '- Email Adresse wurde bereits benutzt! \n');
+define('JS_ALERT_PASSWORD_CONFIRM', '- Tippfehler im Passwort-Best&auml;tigungs-Feld! \n');
+
+define('ADMIN_EMAIL_SUBJECT', 'Pers&ouml;nliche Daten &Auml;ndern');
+define('ADMIN_EMAIL_TEXT', 'Hallo %s,' . "\n\n" . 'Ihre pers&ouml;nlichen Daten und m&ouml;glicherweise Ihr Passwort, wurden geändert.  Wenn dies ohne Ihr Wissen oder Ihre Zustimmung erfolgte, kontaktieren Sie uns bitte umgehend!' . "\n\n" . 'Webseite : %s' . "\n" . 'Username: %s' . "\n" . 'Passwort: %s' . "\n\n" . 'Danke!' . "\n" . '%s' . "\n\n" . 'Dies ist eine vom System automatisch generierte Antwort. Eine Antwort Ihrerseits bliebe ungelesen!');
+
+define('JS_ALERT_FIRSTNAME_1','- Firstname length must over ');
+define('JS_ALERT_LASTNAME_1','- Firstname length must over ');
+define('JS_ALERT_ERROR','The following error(s) occurred:');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/admin_files.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/admin_files.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/admin_files.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: admin_files.php,v 1.1 2004/03/05 01:39:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Admin "Boxen" Men&uuml;');
+
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_BOXES', 'Boxen');
+define('TABLE_HEADING_FILENAME', 'Dateinamen');
+define('TABLE_HEADING_GROUPS', 'Gruppen');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('TEXT_COUNT_BOXES', 'Boxen: ');
+define('TEXT_COUNT_FILES', 'Datei(en): ');
+
+//categories access
+define('TEXT_INFO_HEADING_DEFAULT_BOXES', 'Boxen: ');
+
+define('TEXT_INFO_DEFAULT_BOXES_INTRO', 'Einfach den gr&uuml;nen Button klicken, um die Box zu installieren oder den roten button,um die Box zu deinstallieren.<br><br><b>WARNUNG:</b> Wenn Sie eine Box deinstallieren, werden alle darin gespeicherten Dateien auch entfernt!');
+define('TEXT_INFO_DEFAULT_BOXES_INSTALLED', ' installiert');
+define('TEXT_INFO_DEFAULT_BOXES_NOT_INSTALLED', ' nicht installiert');
+
+define('STATUS_BOX_INSTALLED', 'Installiert');
+define('STATUS_BOX_NOT_INSTALLED', 'Nicht Installiert');
+define('STATUS_BOX_REMOVE', 'Entfernen');
+define('STATUS_BOX_INSTALL', 'Installieren');
+
+//files access
+define('TEXT_INFO_HEADING_DEFAULT_FILE', 'Datei: ');
+define('TEXT_INFO_HEADING_DELETE_FILE', 'Best&auml;tigung entfernen');
+define('TEXT_INFO_HEADING_NEW_FILE', 'Dateien Speichern');
+
+define('TEXT_INFO_DEFAULT_FILE_INTRO', 'Klicke den <b>Dateien Speichern</b> Button, um die neuen Dateien zur aktuellen Box hinzu zu f&uuml;gen: ');
+define('TEXT_INFO_DELETE_FILE_INTRO', 'Entferne <font color="red"><b>%s</b></font> von <b>%s</b> Box? ');
+define('TEXT_INFO_NEW_FILE_INTRO', '&Uuml;berpr&uuml;fen Sie das <font color="red"><b>linke Men&uuml;</b></font> um sicherzustellen, dass Sie in die richtigen Dateien speichern.');
+
+define('TEXT_INFO_NEW_FILE_BOX', 'Aktuelle Box: ');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/admin_members.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/admin_members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/admin_members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<?php
+/*
+  $Id: admin_members.php,v 1.1 2004/03/05 01:39:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['gID']) {
+  define('HEADING_TITLE', 'Admin Gruppen');
+} elseif ($HTTP_GET_VARS['gPath']) {
+  define('HEADING_TITLE', 'Gruppen definieren');
+} else {
+  define('HEADING_TITLE', 'Admin Mitglieder');
+}
+
+define('TEXT_COUNT_GROUPS', 'Gruppen: ');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_EMAIL', 'Email Adresse');
+define('TABLE_HEADING_PASSWORD', 'Passwort');
+define('TABLE_HEADING_CONFIRM', 'Passwort best&auml;tigen');
+define('TABLE_HEADING_GROUPS', 'Gruppen Ebene');
+define('TABLE_HEADING_CREATED', 'Konto erstellt');
+define('TABLE_HEADING_MODIFIED', 'Konto ge&auml;ndert');
+define('TABLE_HEADING_LOGDATE', 'Letzter Zugriff');
+define('TABLE_HEADING_LOGNUM', 'LogNum');
+define('TABLE_HEADING_LOG_NUM', 'Log Nummer');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TABLE_HEADING_GROUPS_NAME', 'Gruppen Name');
+define('TABLE_HEADING_GROUPS_DEFINE', 'Boxen und Datei Auswahl');
+define('TABLE_HEADING_GROUPS_GROUP', 'Ebene');
+define('TABLE_HEADING_GROUPS_CATEGORIES', 'Kategorien Zugriffsrecht');
+
+
+define('TEXT_INFO_HEADING_DEFAULT', 'Admin Mitglied ');
+define('TEXT_INFO_HEADING_DELETE', 'Zugriffrecht l&ouml;schen ');
+define('TEXT_INFO_HEADING_EDIT', 'Kategorie &auml;ndern / ');
+define('TEXT_INFO_HEADING_NEW', 'Neues Admin Mitglied ');
+
+define('TEXT_INFO_DEFAULT_INTRO', 'Mitgliedsgruppe');
+define('TEXT_INFO_DELETE_INTRO', 'Entferne <nobr><b>%s</b></nobr> von <nobr>Admin Mitglieder?</nobr>');
+define('TEXT_INFO_DELETE_INTRO_NOT', 'Sie k&ouml;nnen keine <nobr>%s Gruppe l&ouml;schen!</nobr>');
+define('TEXT_INFO_EDIT_INTRO', 'Zugriffsrechte hier &auml;ndern: ');
+
+define('TEXT_INFO_FULLNAME', 'Name: ');
+define('TEXT_INFO_FIRSTNAME', 'Vorname: ');
+define('TEXT_INFO_LASTNAME', 'Nachname: ');
+define('TEXT_INFO_EMAIL', 'Email Adresse: ');
+define('TEXT_INFO_PASSWORD', 'Passwort: ');
+define('TEXT_INFO_CONFIRM', 'Passwort best&auml;tigen: ');
+define('TEXT_INFO_CREATED', 'Konto erstellt: ');
+define('TEXT_INFO_MODIFIED', 'Konto ge&auml;ndert: ');
+define('TEXT_INFO_LOGDATE', 'Letzter Zugriff: ');
+define('TEXT_INFO_LOGNUM', 'Log Nummer: ');
+define('TEXT_INFO_GROUP', 'Gruppenebene: ');
+define('TEXT_INFO_ERROR', '<font color="red">Email Adresse wurde bereits benutzt! Bitte versuchen Sie es nochmal.</font>');
+
+define('JS_ALERT_FIRSTNAME', '- Notwendig: Vorname \n');
+define('JS_ALERT_LASTNAME', '- Notwendig: Nachname \n');
+define('JS_ALERT_EMAIL', '- Notwendig: Email Adresse \n');
+define('JS_ALERT_EMAIL_FORMAT', '- Email Adressenformat ist ung&uuml;ltig! \n');
+define('JS_ALERT_EMAIL_USED', '- Email Adresse wurde bereits benutzt! \n');
+define('JS_ALERT_LEVEL', '- Notwendig: Gruppenmitglied \n');
+
+define('ADMIN_EMAIL_SUBJECT', 'Neues Adminmitglied');
+define('ADMIN_EMAIL_TEXT', 'Hi %s,' . "\n\n" . 'Mit dem folgenden Passwort erhalten Sie Zugang zum Admin Panel . Sobald Sie das Admin Panel betreten haben, &auml;ndern Sie bitte Ihr Passwort!' . "\n\n" . 'Webseite : %s' . "\n" . 'Benutzername: %s' . "\n" . 'Passwort: %s' . "\n\n" . 'Danke!' . "\n" . '%s' . "\n\n" . 'Dies ist eine vom System automatisch generierte Antwort. Eine Antwort Ihrerseits bliebe ungelesen!');
+define('ADMIN_EMAIL_EDIT_SUBJECT', 'Admin Mitglieds-Profil &auml;ndern');
+define('ADMIN_EMAIL_EDIT_TEXT', 'Hi %s,' . "\n\n" . 'Ihre pers&ouml;nlichen Daten wurden durch einen Admin ge&auml;ndert.' . "\n\n" . 'Webseite : %s' . "\n" . 'Username: %s' . "\n" . 'Passwort: %s' . "\n\n" . 'Danke!' . "\n" . '%s' . "\n\n" . 'Dies ist eine vom System automatisch generierte Antwort. Eine Antwort Ihrerseits bliebe ungelesen!');
+
+define('TEXT_INFO_HEADING_DEFAULT_GROUPS', 'Admin Gruppe ');
+define('TEXT_INFO_HEADING_DELETE_GROUPS', 'Gruppe l&ouml;schen ');
+
+define('TEXT_INFO_DEFAULT_GROUPS_INTRO', '<b>ACHTUNG:</b><li><b>&Auml;ndern::</b> Name der Gruppe &auml;ndern.</li><li><b>L&ouml;schen:</b> Gruppe l&ouml;schen.</li><li><b>Definieren:</b> Gruppenzugang definieren.</li>');
+define('TEXT_INFO_DELETE_GROUPS_INTRO', 'Es werden auch die Mitglieder dieser Gruppe gel&ouml;scht. Wollen Sie sicher diese Gruppe l&ouml;schen: <nobr><b>%s</b> group?</nobr>');
+define('TEXT_INFO_DELETE_GROUPS_INTRO_NOT', 'Sie k&ouml;nnen diese Gruppen nicht l&ouml;schen!');
+define('TEXT_INFO_GROUPS_INTRO', 'Vergeben Sie einen einmaligen Gruppennamen. Klicken Sie Weiter zur Eingabe');
+
+define('TEXT_INFO_HEADING_GROUPS', 'Neue Gruppe');
+define('TEXT_INFO_GROUPS_NAME', ' <b>Gruppenname:</b><br>Vergeben Sie einen einmaligen Gruppennamen. Klicken Sie Weiter zur Eingabe.<br>');
+define('TEXT_INFO_GROUPS_NAME_FALSE', '<font color="red"><b>FEHLER:</b> Der Gruppenname muss aus mindestens 5 Zeichen bestehen!</font>');
+define('TEXT_INFO_GROUPS_NAME_USED', '<font color="red"><b>FEHLER:</b> Gruppenname wurde bereits benutzt!</font>');
+define('TEXT_INFO_GROUPS_LEVEL', 'Gruppen Ebene: ');
+define('TEXT_INFO_GROUPS_BOXES', '<b>Boxen Zugriffsrecht:</b><br>Vergeben Sie die Zugriffe für die gew&auml;hlten Boxen.');
+define('TEXT_INFO_GROUPS_BOXES_INCLUDE', 'Dateien miteinbeziehen, die hier gespeichert sind: ');
+
+define('TEXT_INFO_EDIT_GROUP_INTRO', 'Gruppen-Name &auml;ndern: ');
+
+define('TEXT_INFO_HEADING_DEFINE', 'Gruppe definieren');
+if ($HTTP_GET_VARS['gPath'] == 1) {
+  define('TEXT_INFO_DEFINE_INTRO', '<b>%s :</b><br>Sie k&ouml;nnen nicht die Dateizugriffs-Rechte für diese Gruppe &auml;ndern.<br><br>');
+} else {
+  define('TEXT_INFO_DEFINE_INTRO', '<b>%s :</b><br>&Auml;ndern Sie die Rechte für diese Gruppen durch das Setzen von H&auml;kchen bei den Boxen und Dateien. Klicken Sie <b>Speichern</b> um die &Auml;nderungen zu sichern.<br><br>');
+}
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_affiliates.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_affiliates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_affiliates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: affiliate_affiliates.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Teilnehmer am Partnerprogramm');
+define('HEADING_TITLE_SEARCH', 'Suche:');
+
+define('TABLE_HEADING_FIRSTNAME', 'Vorname');
+define('TABLE_HEADING_LASTNAME', 'Nachname');
+define('TABLE_HEADING_USERHOMEPAGE', 'Homepage');
+define('TABLE_HEADING_COMMISSION','Kommission');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Konto erstellt am');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_AFFILIATE_ID','Partner ID');
+
+define('TEXT_DATE_ACCOUNT_CREATED', 'Zugang erstellt am:');
+define('TEXT_DATE_ACCOUNT_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_INFO_DATE_LAST_LOGON', 'letzte Anmeldung:');
+define('TEXT_INFO_NUMBER_OF_LOGONS', 'Anzahl der Anmeldungen:');
+define('TEXT_INFO_COMMISSION','Provision');
+define('TEXT_INFO_NUMBER_OF_SALES', 'Anzahl der Verk&auml;ufe:');
+define('TEXT_INFO_COUNTRY', 'Land:');
+define('TEXT_INFO_SALES_TOTAL', 'Summe aller Verk&auml;ufe:');
+define('TEXT_INFO_AFFILIATE_TOTAL', 'Provision:');
+define('TEXT_DELETE_INTRO', 'Wollen Sie diesen Partner wirklich l&ouml;schen?');
+define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Partner l&ouml;schen');
+define('TEXT_DISPLAY_NUMBER_OF_AFFILIATES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Partnern)');
+
+define('ENTRY_AFFILIATE_PAYMENT_DETAILS', 'zahlbar an:');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK','Scheck f&uuml;r:');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL','PayPal Konto Email:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME','Name der Bank:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME','Kontoinhaber:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER','Kontonummer:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER','Bankleitzahl:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE','SWIFT Code:');
+define('ENTRY_AFFILIATE_COMPANY','Firma');
+define('ENTRY_AFFILIATE_COMPANY_TAXID','UID-Nr.:');
+define('ENTRY_AFFILIATE_HOMEPAGE','Homepage');
+define('ENTRY_AFFILIATE_COMMISSION','Provision pro Verkauf in %');
+
+define('CATEGORY_COMMISSION','Individuelle Provision');
+define('CATEGORY_PAYMENT_DETAILS','Auszahlung erfolgt &uuml;ber:');
+
+define('TYPE_BELOW', 'Bitte unten eingeben');
+define('PLEASE_SELECT', 'Ausw&auml;hlen');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_banner_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_banner_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_banner_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: affiliate_banner_statistics.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Banner Bericht/Statistik');
+
+define('TABLE_HEADING_SOURCE', 'Quelle');
+define('TABLE_HEADING_VIEWS', 'Angezeigt');
+define('TABLE_HEADING_CLICKS', 'Klicks');
+
+define('TEXT_BANNERS_DATA', 'D<br>a<br>t<br>a');
+define('TEXT_BANNERS_DAILY_STATISTICS', '%s T&auml;glicher Bericht von %s %s');
+define('TEXT_BANNERS_MONTHLY_STATISTICS', '%s Monatlicher Bericht von %s');
+define('TEXT_BANNERS_YEARLY_STATISTICS', '%s Y&auml;hrlicher Bericht');
+
+define('STATISTICS_TYPE_DAILY', 'T&auml;glich');
+define('STATISTICS_TYPE_MONTHLY', 'Monatlich');
+define('STATISTICS_TYPE_YEARLY', 'Y&auml;hrlich');
+
+define('TITLE_TYPE', 'Typ:');
+define('TITLE_YEAR', 'Jahr:');
+define('TITLE_MONTH', 'Monat:');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'FEHLER: Das Graphs Verzeichnis existiert nicht. Bitte erstellen Sie das Verzeichnis \'graphs\' im Verzeichnis \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'FEHLER: Das Graphs Verzeichnis ist Schreibgesch&uuml;tzt.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.0 2002/09/29 SDK
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 -2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Partnerprogramm Bannerverwaltung');
+
+define('TABLE_HEADING_BANNERS', 'Banner');
+define('TABLE_HEADING_GROUPS', 'Gruppe');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_STATISTICS', 'Anzeigen / Klicks');
+define('TABLE_HEADING_PRODUCT_ID', 'Produkt ID');
+define('TEXT_VALID_CATEGORIES_LIST', 'Verf&uuml;gbare Kategorien');
+define('TEXT_VALID_CATEGORIES_ID', 'Kategorie #');
+define('TEXT_VALID_CATEGORIES_NAME', 'Categories Name');
+define('TABLE_HEADING_CATEGORY_ID', 'Cat ID');
+define('TEXT_BANNERS_LINKED_CATEGORY','Kategorie ID');
+define('TEXT_BANNERS_LINKED_CATEGORY_NOTE','Wenn Sie den Banner mit einem Kategorie verlinken wollen, geben Sie hier die Kategorie ID ein. Wenn Sie mit der Startseite verlinken wollen geben Sie "0" ein.');
+define('TEXT_AFFILIATE_VALIDCATS', 'Click Here:');
+define('TEXT_AFFILIATE_CATEGORY_BANNER_VIEW', 'to view available CATEGORIES.');
+define('TEXT_AFFILIATE_CATEGORY_BANNER_HELP', 'Select the category number from the popup window and enter the number in the Category ID field.');
+
+define('TEXT_BANNERS_TITLE', 'Titel des Banners:');
+define('TEXT_BANNERS_GROUP', 'Banner-Gruppe:');
+define('TEXT_BANNERS_NEW_GROUP', ', oder geben Sie unten eine neue Banner-Gruppe ein');
+define('TEXT_BANNERS_IMAGE', 'Bild (Datei):');
+define('TEXT_BANNERS_IMAGE_LOCAL', ', oder geben Sie unten die lokale Datei auf Ihrem Server an');
+define('TEXT_BANNERS_IMAGE_TARGET', 'Bildziel (Speichern nach):');
+define('TEXT_BANNERS_HTML_TEXT', 'HTML Text:');
+define('TEXT_AFFILIATE_BANNERS_NOTE', '<b>Banner Bemerkung:</b><ul><li>Sie k&ouml;nnen Bild- oder HTML-Text-Banner verwenden, beides gleichzeitig ist nicht m&ouml;glich.</li><li>Wenn Sie beide Bannerarten gleichzeitig verwenden, wird nur der HTML-Text Banner angezeigt.</li></ul>');
+
+define('TEXT_BANNERS_LINKED_PRODUCT','Produkt ID');
+define('TEXT_BANNERS_LINKED_PRODUCT_NOTE','Wenn Sie das Banner mit einem Produkt verlinken wollen, geben Sie hier die Produkt ID ein. Wenn Sie mit der Startseite verlinken wollen geben Sie "0" ein.');
+
+define('TEXT_BANNERS_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_BANNERS_STATUS_CHANGE', 'Status ge&auml;ndert: %s');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Hier Klicken:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'zu ansicht der verf&uuml;gbaren Artikel.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'W&auml;hle Sie eine Artikelnr. aus dem Popup Fenster und geben Sie diese in das Artikel ID Feld ein.');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Available Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Produkt #');
+define('TEXT_VALID_PRODUCTS_NAME', 'Produkt Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Fenster schliessem</u> [x]');
+
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie dieses Banner l&ouml;schen wollen?');
+define('TEXT_INFO_DELETE_IMAGE', 'Bannerbild l&ouml;schen');
+
+define('SUCCESS_BANNER_INSERTED', 'Erfolg: Der Banner wurde eingef&uuml;gt.');
+define('SUCCESS_BANNER_UPDATED', 'Erfolg: Der Banner wurde aktualisiert.');
+define('SUCCESS_BANNER_REMOVED', 'Erfolg: Der Banner wurde gel&ouml;scht.');
+
+define('ERROR_BANNER_TITLE_REQUIRED', 'Fehler: Ein Bannertitel wird ben&ouml;tigt.');
+define('ERROR_BANNER_GROUP_REQUIRED', 'Fehler: Eine Bannergruppe wird ben&ouml;tigt.');
+define('ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Zielverzeichnis existiert nicht %s.');
+define('ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Fehler: Zielverzeichnis ist nicht beschreibbar: %s');
+define('ERROR_IMAGE_DOES_NOT_EXIST', 'Fehler: Bild existiert nicht.');
+define('ERROR_IMAGE_IS_NOT_WRITEABLE', 'Fehler: Bild kann nicht gel&ouml;scht werden.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.2 2003/02/12 19:03:52 harley_vb Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Partnerprogramm Klickstatistik');
+
+define('TABLE_HEADING_ONLINE', 'Klickstatistik');
+define('TABLE_HEADING_AFFILIATE_USERNAME', 'Partner');
+define('TABLE_HEADING_IPADDRESS', 'IP Adresse');
+define('TABLE_HEADING_ENTRY_TIME', 'Zeit');
+define('TABLE_HEADING_BROWSER', 'Browser');
+define('TABLE_HEADING_ENTRY_DATE', 'Datum');
+define('TABLE_HEADING_CLICKED_PRODUCT','geklicktes Produkt');
+define('TABLE_HEADING_REFERRAL_URL', 'Referenz URL');
+
+define('TEXT_NO_CLICKS', 'Es wurde bislang keine Klickstatistik aufgezeichnet');
+define('TEXT_DISPLAY_NUMBER_OF_CLICKS', 'Angezeigt werden <b>%d</b> von <b>%d</b> (insgesamt <b>%d</b> Klicks)');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.3 2003/02/16 23:44:24 harley_vb Exp $
+
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'eMail an Partnerprogramm Teilnehmer versenden');
+
+define('TEXT_AFFILIATE', 'Partner:');
+define('TEXT_SUBJECT', 'Betreff:');
+define('TEXT_FROM', 'Absender:');
+define('TEXT_MESSAGE', 'Nachricht:');
+define('TEXT_SELECT_AFFILIATE', 'Partner ausw&auml;hlen');
+define('TEXT_ALL_AFFILIATES', 'Alle Partner');
+define('TEXT_NEWSLETTER_AFFILIATES', 'An alle Affiliate Newsletter-Abonnenten');
+
+define('NOTICE_EMAIL_SENT_TO', 'Hinweis: eMail wurde versendet an: %s');
+define('ERROR_NO_AFFILIATE_SELECTED', 'Fehler: Es wurde kein Partner ausgew&auml;hlt.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: affiliate_invoice.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Affiliate Invoice');
+
+define ('TEXT_AFFILIATE','Affiliate');
+define ('TEXT_AFFILIATE_PAYMENT','Payment');
+define ('TEXT_AFFILIATE_BILLED','Billing Day');
+define('TABLE_HEADING_ORDER_ID', 'Order ID');
+define('TABLE_HEADING_ORDER_DATE', 'Date');
+define('TABLE_HEADING_ORDER_VALUE', 'Order Value');
+define('TABLE_HEADING_COMMISSION_RATE', 'Commission Rate');
+define('TABLE_HEADING_COMMISSION_VALUE', 'Commission Value');
+define('TABLE_HEADING_TOTAL', 'Total');
+
+define('TEXT_SUB_TOTAL', 'Sub-Total');
+define('TEXT_TAX', 'Tax');
+define('TEXT_TOTAL', 'Total');
+define('ENTRY_PERCENT', '%');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: affiliate_news.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Partnerprogramm News');
+define('TABLE_HEADING_AFFILIATE_NEWS', 'Partnerprogramm News');
+
+define('TABLE_HEADING_AFFILIATE_NEWS_HEADLINE', '&Uuml;berschrift');
+define('TABLE_HEADING_AFFILIATE_NEWS_ACTION', 'Aktion');
+define('TABLE_HEADING_AFFILIATE_NEWS_STATUS', 'Status');
+
+define('TEXT_NEWS_ITEMS', 'Anzahl Nachrichten:');
+define('TEXT_INFO_HEADING_DELETE_ITEM', 'Eintrag l&ouml;schen');
+define('TEXT_DELETE_ITEM_INTRO', 'Sind Sie sich sicher, dass Sie diesen Eintrag l&ouml;schen m&ouml;chten?');
+
+define('TEXT_AFFILIATE_NEWS_HEADLINE', '&Uuml;berschrift');
+define('TEXT_AFFILIATE_NEWS_CONTENT', 'Text');
+
+define('IMAGE_NEW_NEWS_ITEM', 'Neuen Eintrag anlegen');
+
+// npe admin begin #add
+define('TEXT_AFFILIATE_NEWS_CONTENT_DELETE', 'Angezeigte Eintr&auml;ge in dieser Sprache l&ouml;schen!');
+define('EMPTY_CATEGORY', 'News leeren');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Es sind keine Eintr&auml;ge vorhanden');
+// npe admin begin #add
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: affiliate_newsletters.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Partnerprogramm Newsletter Verwaltung');
+
+define('TABLE_HEADING_NEWSLETTERS', 'Newsletter');
+define('TABLE_HEADING_SIZE', 'Gr&ouml;sse');
+define('TABLE_HEADING_MODULE', 'Module');
+define('TABLE_HEADING_SENT', 'Gesendet');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_NEWSLETTER_MODULE', 'Module:');
+define('TEXT_NEWSLETTER_TITLE', 'Newsletter Titel:');
+define('TEXT_NEWSLETTER_CONTENT', 'Text:');
+
+define('TEXT_NEWSLETTER_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_NEWSLETTER_DATE_SENT', 'Gesendet am:');
+
+define('TEXT_INFO_DELETE_INTRO', 'Wollen Sie diesen Newsletter wirklich l&ouml;schen?');
+
+define('TEXT_PLEASE_WAIT', 'Bitte warten .. Emails werden versendet ..<br><br>Diesen Prozess auf keinen Fall stoppen!');
+define('TEXT_FINISHED_SENDING_EMAILS', 'Email Versand erfolgreich!');
+
+define('ERROR_NEWSLETTER_TITLE', 'FEHLER: Newsletter Titel wird ben&ouml;tigt');
+define('ERROR_NEWSLETTER_MODULE', 'FEHLER: Newsletter module erforderlich');
+define('ERROR_REMOVE_UNLOCKED_NEWSLETTER', 'FEHLER: Bitte den Newsletter vor dem l&ouml;schen lesen.');
+define('ERROR_EDIT_UNLOCKED_NEWSLETTER', 'FEHLER: Bitte den Newsletter vor dem editieren lesen.');
+define('ERROR_SEND_UNLOCKED_NEWSLETTER', 'Error: Bitte den Newsletter vor dem senden lesen.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+  
+  Contribution based on:
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Partnerprogramm Provisionszahlungen');
+define('HEADING_TITLE_SEARCH', 'Suchen:');
+define('HEADING_TITLE_STATUS','Status:');
+
+define('TEXT_ALL_PAYMENTS','Alle Provisionszahlungen');
+define('TEXT_NO_PAYMENT_HISTORY', 'Keine Provisionszahlungs-Historie verf&uuml;gbar');
+
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_AFILIATE_NAME', 'Partner');
+define('TABLE_HEADING_PAYMENT','Provision (inkl.)');
+define('TABLE_HEADING_NET_PAYMENT','Provision (exkl.)');
+define('TABLE_HEADING_DATE_BILLED','Datum abgerechnet');
+define('TABLE_HEADING_NEW_VALUE', 'neuer Status');
+define('TABLE_HEADING_OLD_VALUE', 'alter Status');
+define('TABLE_HEADING_AFFILIATE_NOTIFIED', 'Partner benachrichtigt');
+define('TABLE_HEADING_DATE_ADDED', 'hinzugef&uuml;gt am:');
+
+define('TEXT_DATE_PAYMENT_BILLED', 'Verrechnet:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_AFFILIATE_PAYMENT', 'Provision');
+define('TEXT_AFFILIATE_BILLED', 'Abrechnungsdatum');
+define('TEXT_AFFILIATE', 'Partner');
+
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Abrechnung l&ouml;schen');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, das Sie diese Provisionszahlung l&ouml;schen m&ouml;chten?');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENTS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Provisionszahlungen)');
+
+define('TEXT_AFFILIATE_PAYING_POSSIBILITIES', 'Auszahlungsm&ouml;glichkeiten:');
+define('TEXT_AFFILIATE_PAYMENT_CHECK', 'per Scheck:');
+define('TEXT_AFFILIATE_PAYMENT_CHECK_PAYEE', 'Empf&auml;nger des Schecks:');
+define('TEXT_AFFILIATE_PAYMENT_PAYPAL', 'per PayPal:');
+define('TEXT_AFFILIATE_PAYMENT_PAYPAL_EMAIL', 'PayPal Konto Email:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_TRANSFER', 'per Bank&uuml;berweisung:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_NAME', 'Kreditinstitut:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME', 'Kontoinhaber:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER', 'Konto-Nr.:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER', 'Bankleitzahl:');
+define('TEXT_AFFILIATE_PAYMENT_BANK_SWIFT_CODE', 'SWIFT Code:');
+
+define('IMAGE_AFFILIATE_BILLING', 'Abrechnung starten');
+
+define('ERROR_PAYMENT_DOES_NOT_EXIST', 'Fehler: Die Provisionsabrechnung existiert nicht!');
+
+define('SUCCESS_BILLING', 'Hinweis: Ihre Teilnehmer-Zahlung Anträge sind sucessfully erzeugt worden!');
+define('SUCCESS_PAYMENT_UPDATED', 'Hinweis: Der Status dieser Provisionsabrechnung wurde erfolgreich aktualisiert.');
+
+define('PAYMENT_STATUS', 'Abrechnungsstatus');
+define('PAYMENT_NOTIFY_AFFILIATE', 'Partner benachrichtigen');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Statusänderung Ihrer Provisionsabrechnung');
+define('EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER', 'Provisionsabrechnung-Nr.:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailierte Provisionsabrechnung:');
+define('EMAIL_TEXT_PAYMENT_BILLED', 'Abrechnungsdatum');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Der Status Ihrer Provisionsabrechnung wurde geändert.' . "\n\n" . 'Neuer Status: %s' . "\n\n" . 'Bei Fragen zu Ihrer Provisionsabrechnung antworten Sie bitte auf diese Email.' . "\n\n" . 'Mit freundlichen Grüssen' . "\n");
+define('EMAIL_TEXT_NEW_PAYMENT', 'Eine neue Abrechnung über Ihre Provisionen wurde erstellt.' . "\n");
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: affiliate_sales.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Verk&auml;ufe &uuml;ber das Partnerprogramm');
+define('HEADING_TITLE_SEARCH', 'Bestell-Nr.:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_ONLINE', 'Klicks');
+define('TABLE_HEADING_AFFILIATE', 'Partner');
+define('TABLE_HEADING_DATE', 'Datum');
+define('TABLE_HEADING_SALES', 'Provisionsbetrag');
+define('TABLE_HEADING_PERCENTAGE','Provision');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ORDER_ID', 'Bestell-Nr.');
+define('TABLE_HEADING_VALUE', 'Bestellwert');
+define('TEXT_NO_SALES', 'Es wurden keine Verk&auml;ufe aufgezeichnet');
+
+define('TEXT_DELETED_ORDER_BY_ADMIN', 'Gel&ouml;scht (Admin)');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Verk&auml;ufen)');
+define('TEXT_INFORMATION_SALES_TOTAL', 'Summe der Partner Verk&auml;ufe:');
+define('TEXT_INFORMATION_AFFILIATE_TOTAL', 'Summe der Partner Provisionen:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: affiliate_statistics.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Statistik zu einem Partner');
+define('TEXT_SUMMARY_TITLE', 'Partnerstatistik');
+define('TEXT_IMPRESSIONS', 'Banner Impressionen: ');
+define('TEXT_VISITS', 'Besuche &uuml;ber diese Partnerseite: ');
+define('TEXT_TRANSACTIONS', 'Verk&auml;ufe des Partners: ');
+define('TEXT_AFFILIATE_NAME', 'Name des Partners: ');
+define('TEXT_AFFILIATE_JOINDATE', 'Registrierdatum: ');
+define('TEXT_CONVERSION', 'Verk&auml;ufe/Klicks: ');
+define('TEXT_AMOUNT', 'Summe Bestellwert: ');
+define('TEXT_AVERAGE', 'Durchschnitt: ');
+define('TEXT_COMMISSION_RATE', 'Provison: ');
+define('TEXT_PAYPERSALE_RATE', 'Provision pro Verkauf: ');
+define('TEXT_CLICKTHROUGH_RATE', 'Pay per Klick: ');
+define('TEXT_COMMISSION', 'Provisionsbetrag: ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Klicken Sie auf [?] um eine Beschreibung zu jeder Kategorie zu lesen.');
+define('HEADING_SUMMARY_HELP', 'Partnerprogramm Hilfe');
+define('TEXT_IMPRESSIONS_HELP', '<b>Banner Impressionen</b> zeigt an, wie oft ein Banner im vorgegebenen Zeitraum angezeigt wurde.');
+define('TEXT_VISITS_HELP', '<b>Besucher</b> zeigt an, wie viele Klicks von Besuchern, welche &uuml;ber Ihre Webseite gekommen sind, vorgenommen wurden.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Partner Verk&auml;ufe</b> zeigt an, wieviele Verk&auml;ufe &uuml;ber die Partnerseiten get&auml;tigt wurden.');
+define('TEXT_CONVERSION_HELP', '<b>Verk&auml;ufe/Klicks</b> zeigt in einem Prozentsatz an, wieviele der von Ihrer Webseite kommenden Besucher bei uns einen Kauf get&auml;tigt haben.');
+define('TEXT_AMOUNT_HELP', '<b>Summe Bestellwert</b> zeigt die Bestellsumme aller ausgelieferten Verk&auml;ufe an.');
+define('TEXT_AVERAGE_HELP', '<b>Durchschnitt</b> repr&auml;sentiert den durchschnittlichen Verkaufswert, welcher &uuml;ber Ihr Konto erwirtschaftet wurde.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Provison</b> steht f&uuml;r die prozentuale Provision, mit der wir, &uuml;ber Sie get&auml;tigte Verk&auml;ufe, abrechnen.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<b>Pay per Klick</b> steht f&uuml;r die Provision die Sie bei einer "Pay per Klick" Provisionsbasis erhalten.');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<b>Pay per Sale</b> steht f&uuml;r die Provision die Sie bei einer "Pay per Sale" Provisionsbasis erhalten.');
+define('TEXT_COMMISSION_HELP', '<b>Provisionsbetrag</b> zeigt Ihre Provisionseink&uuml;nfte &uuml;ber alle ausgelieferten Verk&auml;ufe an.');
+define('TEXT_CLOSE_WINDOW', 'Fenster schliessen [x]');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Partnerprogramm &Uuml;bersicht');
+define('TEXT_SUMMARY_TITLE', 'Zusammenfassung und &Uuml;bersicht zum Partnerprogramm');
+define('TEXT_IMPRESSIONS', 'Banner Impressionen: ');
+define('TEXT_VISITS', 'Besuche &uuml;ber Partnerseiten: ');
+define('TEXT_TRANSACTIONS', 'Partner Verk&auml;ufe: ');
+define('TEXT_AFFILIATES', 'Gesamtzahl der Partner: ');
+define('TEXT_CONVERSION', 'Verk&auml;ufe/Klicks: ');
+define('TEXT_AMOUNT', 'Summe Bestellwert: ');
+define('TEXT_AVERAGE', 'Durchschnitt: ');
+define('TEXT_COMMISSION_RATE', 'Provison: ');
+define('TEXT_PAYPERSALE_RATE', 'Provision pro Verkauf: ');
+define('TEXT_CLICKTHROUGH_RATE', 'Pay per Klick: ');
+define('TEXT_COMMISSION', 'Provisionsbetrag: ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Klicken Sie auf [?] um eine Beschreibung zu jeder Kategorie zu lesen.');
+define('HEADING_SUMMARY_HELP', 'Hilfe');
+define('TEXT_IMPRESSIONS_HELP', '<b>Banner Impressionen</b> zeigt an, wie oft ein Banner im vorgegebenen Zeitraum angezeigt wurde.');
+define('TEXT_VISITS_HELP', '<b>Besucher</b> zeigt an, wie viele Klicks von Besuchern, welche &uuml;ber Ihre Webseite gekommen sind, vorgenommen wurden.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Partner Verk&auml;ufe</b> zeigt an, wieviele Verk&auml;ufe &uuml;ber die Partnerseiten get&auml;tigt wurden.');
+define('TEXT_CONVERSION_HELP', '<b>Verk&auml;ufe/Klicks</b> zeigt in einem Prozentsatz an, wieviele der von Ihrer Webseite kommenden Besucher bei uns einen Kauf get&auml;tigt haben.');
+define('TEXT_AMOUNT_HELP', '<b>Summe Bestellwert</b> zeigt die Bestellsumme aller ausgelieferten Verk&auml;ufe an.');
+define('TEXT_AVERAGE_HELP', '<b>Durchschnitt</b> repr&auml;sentiert den durchschnittlichen Verkaufswert, welcher &uuml;ber Ihr Konto erwirtschaftet wurde.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Provison</b> steht f&uuml;r die prozentuale Provision, mit der wir, &uuml;ber Sie get&auml;tigte Verk&auml;ufe, abrechnen.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<b>Pay per Klick</b> steht f&uuml;r die Provision die Sie bei einer "Pay per Klick" Provisionsbasis erhalten.');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<b>Pay per Sale</b> steht f&uuml;r die Provision die Sie bei einer "Pay per Sale" Provisionsbasis erhalten.');
+define('TEXT_COMMISSION_HELP', '<b>Provisionsbetrag</b> zeigt Ihre Provisionseink&uuml;nfte &uuml;ber alle ausgelieferten Verk&auml;ufe an.');
+define('TEXT_CLOSE_WINDOW', 'Fenster schliessen [x]');
+
+define('IMAGE_BANNERS','Partner Banner');
+define('IMAGE_CLICKTHROUGHS','Bericht &uuml;ber Klicks');
+define('IMAGE_SALES','Bericht &uuml;ber Verk&auml;ufe');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/algo_fraud_screener.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/algo_fraud_screener.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/algo_fraud_screener.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<?php
+/*
+  $Id: algo_fraud_screener.php,v 1.25 2003/06/20 00:28:44 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// AlgoZone - Algozone Fraud Screen Tool definitions
+
+define('ALGO_FS_DISTANCE', '<b>Entfernung(m/km)</b> ');
+define('ALGO_FS_DISTANCE_M', '<b>Entfernung(m) </b>');
+define('ALGO_FS_DISTANCE_K', '<b>Entfernung(k) </b>');
+define('ALGO_FS_COUNTRY', '<b>Passendes Land  </b>');
+define('ALGO_FS_CODE', '<b>PLZ  </b>');
+define('ALGO_FS_FREE_EMAIL', '<b>Free Email  </b>');
+define('ALGO_FS_ANONYMOUS', '<b>Anonymer Proxy  </b>');
+define('ALGO_FS_SCORE', '<b>Stand  </b>');
+define('ALGO_FS_FRAUD_LEVEL', '<b>Betrugs-Niveau  </b>');
+define('ALGO_FS_BIN_MATCH', '<b>Sortierfach-Gleiches  </b>');
+define('ALGO_FS_BANK_COUNTRY', '<b>Bank-Land  </b>');
+define('ALGO_FS_ERR', '<b>Fehler  </b>');
+define('ALGO_FS_PROXY_LEVEL', '<b>Proxy Level  </b>');
+define('ALGO_FS_SPAM', '<b>Spam Level  </b>');
+define('ALGO_FS_BANK_NAME', '<b>Bank Name  </b>');
+define('ALGO_FS_BANK_NAME_MATCH', '<b>Bank Name stimmt &uuml;berein  </b>');
+define('ALGO_FS_BANK_PHONE', '<b>Bank Telefon  </b>');
+define('ALGO_FS_BANK_PHONE_MATCH', '<b>Bank Telefon &Uuml;bereinstimmung  </b>');
+define('ALGO_FS_IP', '<b>IP Adresse  </b>');
+define('ALGO_FS_IP_ISP', '<b>Provider  </b>');
+define('ALGO_FS_IP_ISP_ORG', '<b>Provider Org  </b>');
+define('ALGO_FS_IP_CITY', '<b>Stadt   </b>');
+define('ALGO_FS_IP_REGION', '<b>Bundesland   </b>');
+define('ALGO_FS_IP_LATITUDE', '<b>Breite   </b>');
+define('ALGO_FS_IP_LONGITUDE', '<b>L&auml;nge   </b>');
+define('ALGO_FS_ALGOZONE', '<b>*ACHTUNG:  Sie m&uuml;ssen beim Premium Service von Algonzone.com regisitriert sein f&uuml;r folgende Bereiche </b>');
+define('ALGO_FS_HI_RISK', '<b>Risikoreiches Land  </b>');
+define('ALGO_FS_CUST_PHONE', '<b>Telefon-Gleiches  </b>');
+define('ALGO_FS_DETAILS', 'Sehen Sie <a href="http://www.algozone.com/" target="_blank"><u>AlgoZone.com</u></a> für Erkl&auml;rung der Felder');
+
+define('ALGO_FS_BREQUEST', 'Überpr&uuml;fen Sie die Bank-Info'); 
+define('ALGO_HELP_PREM_OPT', '*** - Verf&uuml;gbare Werte f&uuml;r diesen Bereich des Betrugsschutzes'); 
+
+define('FS_HELP_DISTANCE', 'Distanz zwischen der IP Adresse und Bezahl Adresse in Meilen/Kilometer (Je gr&ouml;sser die Distanz == h&ouml;heres Risiko)');
+define('FS_HELP_COUNTRY_MATCH', 'Ob Land von IP address Gebührenzählung Adresse Land zusammenbringt (Fehlanpassung == höhere Gefahr)');
+define('FS_HELP_COUNTRY_CODE', 'Landeskennzahl der IP Adresse');
+define('FS_HELP_EMAIL','Sollte eine Email von einem kostenlosen Provider stammen (free e-mail == hohes Risiko)');
+define('FS_HELP_ANONYMOUS_IP','Stammt die IP Adresse von einem Anonymen Proxy? (Anonymer proxy == Sehr hohes Risiko)');
+define('FS_HELP_BANK_COUNTRY','Landeskennzahl der Bank, die die Kreditkarte herausgab, gründete auf SORTIERFACH-Zahl');
+define('FS_HELP_BIN_MATCH','&Uuml;berpr&uuml;fen ob der L&auml;nder Name der Bank mit der IBAn Nummer &uuml;bereinstimmt mit dem angegebenen L&auml;ndernamen');
+define('FS_HELP_BANK_NAME_MATCH','Pr&uuml;fen ob der Name mit dem angegebenen Namen der Bank übereinstimmt. Bei einem R&uuml;ckgabewert von ja stimmt alles mit dem Besitzer &uuml;berein.');
+define('FS_HELP_BANK_NAME','Pr&uuml;fen ob der Kartenbesitzer &uuml;bereinstimmt');
+define('FS_HELP_BANK_PHONE_MATCH','Whether customer service phone number matches inputed binPhone. A return value of Yes provides a positive indication that cardholder is in possession of credit card.');
+define('FS_HELP_BANK_PHONE','Customer service phone number listed on back of credit card');
+define('FS_HELP_PHONE_IN_BILLING_LOC','Whether the customer phone number is in the billing location. A return value of Yes provides a positive indication that the phone number listed belongs to the cardholder. Currently we only support US Phone numbers, in the future we may support other countries.');
+define('FS_HELP_PROXY_LEVEL','Likelihood of IP Address being an Open Proxy');
+define('FS_HELP_SPAM_LEVEL','Likelihood of IP Address being an Spam Source');
+define('FS_HELP_FRAUD_LEVEL','Overall Fraud Risk Factor based on outputs listed above');
+define('FS_HELP_REGION','Estimated Region of the IP address, ISO-3166-2/FIPS 10-4 code');
+define('FS_HELP_CITY','Estimated City of the IP address**');
+define('FS_HELP_LATITUDE','Estimated Latitude of the IP address');
+define('FS_HELP_LONGITUDE','Estimated Longitude of the IP address');
+define('FS_HELP_IP','IP address of the customer. For US addresses, click on the ip address to see a map estimating where the customer is located.');
+define('FS_HELP_ISP','ISP of the IP address');
+define('FS_HELP_ORG','Organization of the IP address');
+define('FS_HELP_IS_HI_RISK_COUNTRY','Whether IP address or billing address country is in Belarus, Colombia, Egypt, Indonesia, Lebanon, Macedonia, Malaysia, Nigeria, Pakistan, Ukraine, or Yugoslavia');
+define('FS_HELP_REMAINING_QUERIES','Number of queries remaining in your account, can be used to alert you when you may need to add more queries to your account');
+define('FS_HELP_DEFAULT','<i><b>To get field descriptions, place cursor on the field name<b></i>');
+
+
+define('NO_IP_ADDRESS_RECORDED','*** NO IP ADDRESS RECORDED FOR THIS ORDER');
+define('MAX_COMMENT_0','(Extremely Low risk)');
+define('MAX_COMMENT_1','(Very Low risk)');
+define('MAX_COMMENT_2','(Low risk)');
+define('MAX_COMMENT_3','(Low risk)');
+define('MAX_COMMENT_4','(Low-Medium risk)');
+define('MAX_COMMENT_5','(Medium risk)');
+define('MAX_COMMENT_6','(Medium-high risk)');
+define('MAX_COMMENT_7','<font color=red>(High risk)</font>');
+define('MAX_COMMENT_8','<font color=red>(Very High risk)</font>');
+define('MAX_COMMENT_9','<font color=red>(Extremely High risk)</font>');
+define('MAX_COMMENT_10','<font color=red>(HIGH PROBABILITY OF FRAUD)</font>');
+define('ERROR','Error');
+define('LAST_QUERIED_ON','Last Queried on :');
+define('REMAINING_QUERIES_1','You have');
+define('REMAINING_QUERIES_2','queries remaining');
+
+// End AlgoZone - Algozone Fraud Screen Tool definitions
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Meinungen zu ');
+
+define('TABLE_HEADING_ARTICLES', 'Articles');
+define('TABLE_HEADING_RATING', 'Rating');
+define('TABLE_HEADING_DATE_ADDED', 'Date Added');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('ENTRY_ARTICLE', 'Article:');
+define('ENTRY_FROM', 'From:');
+define('ENTRY_DATE', 'Date:');
+define('ENTRY_REVIEW', 'Review:');
+define('ENTRY_REVIEW_TEXT', '<small><font color="#ff0000"><b>NOTE:</b></font></small>&nbsp;HTML is not translated!&nbsp;');
+define('ENTRY_RATING', 'Rating:');
+
+define('TEXT_INFO_DELETE_REVIEW_INTRO', 'Are you sure you want to delete this review?');
+
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_REVIEW_AUTHOR', 'Reviewer:');
+define('TEXT_INFO_REVIEW_RATING', 'Rating:');
+define('TEXT_INFO_REVIEW_READ', 'Read:');
+define('TEXT_INFO_REVIEW_SIZE', 'Size:');
+define('TEXT_INFO_ARTICLES_AVERAGE_RATING', 'Average Rating:');
+
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+
+define('TEXT_OF_5_STARS', '%s von 5 Sternen!');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>Excellent</b></font></small>');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>Poor</b></font></small>');
+define('TEXT_INFO_HEADING_DELETE_REVIEW', 'Delete Review');
+/* <Mav was here!> */
+define('TEXT_APPROVED', 'Approved') ;
+define('TEXT_APPROVE', 'Approve') ;
+define('TEXT_DISAPPROVE', 'Disapprove') ;
+define('TEXT_YES', 'Yes') ;
+define('TEXT_NO', 'No') ;
+/* </Mav was here!> */
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/article_search.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/article_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/article_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: article_search.php
+  By AlDaffodil:  aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_1', 'Produkt Suche');
+define('HEADING_TITLE_2', 'Produkte zu den Suchkriterien');
+
+define('NAVBAR_TITLE_1', 'Produkt Suche');
+define('NAVBAR_TITLE_2', 'Produkte zu den Suchkriterien');
+define('TABLE_HEADING_ARTICLES', 'Artikel');
+
+define('TEXT_ARTICLE_NAME' , 'Produkt Titel & Link');
+define('TEXT_ARTICLE_EXCERPT' , 'Produkt Auszug'); //DE
+
+define('TEXT_NO_ARTICLES', 'Es gibt keine zu den Schl&uuml;sselbegriffen passendes Produkt.');
+
+define('ERROR_INPUT', 'Bitte Schl&uuml;sselbegriffe eingeben.');
+define('ERROR_INVALID_KEYWORDS', 'Ung&uuml;ltige Schl&uuml;sselbegriffe.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/articles.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Topics / Articles');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_TOPICS_ARTICLES', '&Uuml;berschrift / Produkt');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('TEXT_ARTICLES_CURRENT', 'Gegenw&auml;rtig:');
+
+define('TEXT_NEW_ARTICLE', 'Neue Produkte in &quot;%s&quot;');
+define('TEXT_TOPICS', '&Uuml;berschriften:');
+define('TEXT_SUBTOPICS', 'Unterpunkte:');
+define('TEXT_ARTICLES', 'Produkte:');
+define('TEXT_ARTICLES_AVERAGE_RATING', 'Durchschnittliche Bewertung:');
+define('TEXT_ARTICLES_HEAD_TITLE_TAG', 'HTML Seiten Titel:');
+define('TEXT_ARTICLES_HEAD_DESC_TAG', 'Meta Beschreibung:<br><small>(Produkte-Auszug =<br>ersten %s Zeichen)</small>');
+define('TEXT_ARTICLES_HEAD_KEYWORDS_TAG', 'Meta Keywords:');
+define('TEXT_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_DATE_AVAILABLE', 'Datum erwartet:');
+define('TEXT_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('TEXT_NO_CHILD_TOPICS_OR_ARTICLES', 'Setzen Sie bitte ein neues Thema oder einen Produkt in diesem Bereich ein.');
+define('TEXT_ARTICLE_MORE_INFORMATION', 'F&uuml;r mehr Information besuchen Sie bitte diesen <a href="http://%s" target="blank"><u>Produkt</u></a>.');
+define('TEXT_ARTICLE_DATE_ADDED', 'Dieses Produkt wurde erstellt am %s.');
+define('TEXT_ARTICLE_DATE_AVAILABLE', 'Dieses Produkt erscheint am %s.');
+
+define('TEXT_EDIT_INTRO', 'F&uuml;hren Sie bitte alle notwendigen &Auml;nderungen durch');
+define('TEXT_EDIT_TOPICS_ID', '&Uuml;berschrift ID:');
+define('TEXT_EDIT_TOPICS_NAME', '&Uuml;berschrift Name:');
+define('TEXT_EDIT_SORT_ORDER', 'Sortierung:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'W&auml;hlen Sie bitte ein neues Thema, in das Sie dieses Produkt kopieren m&ouml;chten');
+define('TEXT_INFO_CURRENT_TOPICS', 'Gegenw&auml;rtige Themen:');
+
+define('TEXT_INFO_HEADING_NEW_TOPIC', 'Neuer Eintrag');
+define('TEXT_INFO_HEADING_EDIT_TOPIC', 'Eintrag bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_TOPIC', 'Eintrag l&ouml;schen');
+define('TEXT_INFO_HEADING_MOVE_TOPIC', 'Eintrag kopieren');
+define('TEXT_INFO_HEADING_DELETE_ARTICLE', 'Eintrag l&ouml;schen');
+define('TEXT_INFO_HEADING_MOVE_ARTICLE', 'Eintrag kopieren');
+define('TEXT_INFO_HEADING_COPY_TO', 'Kopieren nach');
+
+define('TEXT_DELETE_TOPIC_INTRO', 'Wollen Sie diesen Eintrag l&ouml;schen?');
+define('TEXT_DELETE_ARTICLE_INTRO', 'Wollen Sie diesen Eintarg unwiederruflich l&ouml;schen?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNUNG:</b> Es sind %s Eintr&auml;ge zu diesem Bereich verlinkt!');
+define('TEXT_DELETE_WARNING_ARTICLES', '<b>WARNUNG:</b> Es sind %s Eintr&auml;ge zu diesem Bereich verlinkt!');
+
+define('TEXT_MOVE_ARTICLES_INTRO', 'Bitte w&auml;hlen Sie das Produkt <b>%s</b> den Sie verschieben m&ouml;chten');
+define('TEXT_MOVE_TOPICS_INTRO', 'Bitte Produkt w&auml;hlen  <b>%s</b> den Sie verschieben m&ouml;chten');
+define('TEXT_MOVE', 'Verschieben <b>%s</b> nach:');
+
+define('TEXT_NEW_TOPIC_INTRO', 'Folgende Informationen m&uuml;ssen ausgef&uuml;llt werden, um einen neues Produkt zu erstellen');
+define('TEXT_TOPICS_NAME', 'Produkt Name:');
+define('TEXT_SORT_ORDER', 'Sortierung:');
+
+define('TEXT_EDIT_TOPICS_HEADING_TITLE', 'Produkt Titel:');
+define('TEXT_EDIT_TOPICS_DESCRIPTION', 'Produkt Beschreibung:');
+
+define('TEXT_ARTICLES_STATUS', 'Produkt Status:');
+define('TEXT_ARTICLES_DATE_AVAILABLE', 'Ver&ouml;ffentlichung am:');
+define('TEXT_ARTICLE_AVAILABLE', 'Ver&ouml;ffentlicht');
+define('TEXT_ARTICLE_NOT_AVAILABLE', 'Entwurf');
+define('TEXT_ARTICLES_AUTHOR', 'Autor:');
+define('TEXT_ARTICLES_NAME', 'Produkt Name:');
+define('TEXT_ARTICLES_DESCRIPTION', 'Produkt Text:');
+define('TEXT_ARTICLES_URL', 'Produkt URL:');
+define('TEXT_ARTICLES_URL_WITHOUT_HTTP', '<small>(ohne http://)</small>');
+
+define('EMPTY_TOPIC', 'Leeres Produkt');
+
+define('TEXT_HOW_TO_COPY', 'Kopier Methode:');
+define('TEXT_COPY_AS_LINK', 'Link Produkt');
+define('TEXT_COPY_AS_DUPLICATE', 'Doppeltes Produkt');
+
+define('ERROR_CANNOT_LINK_TO_SAME_TOPIC', 'FEHLER: Kann kein Produkt im gleichen Thema verbinden.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'FEHLER: Katalog /Images Verzeichnis ist schreibgesch&uuml;tzt: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'FEHLER: Katalog Image Verzeichnis existiert nicht: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_TOPIC_TO_PARENT', 'FEHLER: Thema kann nicht in Produkt verschoben werden.');
+
+define('DATE_FORMAT', '(YYYY-MM-DD)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/articles_config.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/articles_config.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/articles_config.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: articles_config.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Artikel Konfiguration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Titel');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Wert');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'F&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/articles_xsell.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/articles_xsell.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/articles_xsell.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: articles_xsell.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Verkn&uuml;pfte Artikel zu Produkten');
+
+define('HEADING_ARTICLE_NAME', 'Produkt Name');
+define('HEADING_CROSS_ASSOCIATION', 'Verkn&uuml;pfte Produkte');
+define('HEADING_CROSS_SELL_ACTIONS', 'Verkn&uuml;pfungs Aktion');
+define('HEADING_PRODUCT_NAME', 'Produkt Name');
+define('HEADING_PRODUCT_ORDER', 'Bestellung (1=Oben)');
+
+define('TEXT_DATABASE_UPDATED', 'Die Datenbank wurde aktualisiert.');
+define('TEXT_NO_DELETE', 'konnte nicht gel&ouml;scht werden');
+define('TEXT_NO_INSERT', 'konnte nicht in die Datenbank geschrieben werden');
+define('TEXT_NO_UPDATE', 'konnte die Datenbank nicht aktualisieren');
+
+define('TEXT_LINK_MAIN_PAGE', '<a href="%s">Klicken Sie hier</a> um zur Startseite zur&uuml;ck zu kehren.');
+define('TEXT_LINK_SORT_PRODUCTS', '<a href="%s">Klicken Sie hier</a> um die Produkte die mit den dazugeh&ouml;rigen Artikel zu sortieren.<br><small>Hinweis: Das ist notwendig, wenn ein Produkt hinzugef&uuml;gt oder gel&ouml;scht wurde.</small>');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/attributes_sorter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/attributes_sorter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/attributes_sorter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  Definitions for Attributes Sorter
+*/
+
+// Turn things off
+define('I_AM_OFF',true);
+
+// WebMakers.com Added: Attributes - Definitions to move to attribute_sorter.php
+define('TABLE_HEADING_PRODUCT_ATTRIBUTE_ONE_TIME','Einmal-Aufwand');
+
+// WebMakers.com Added: Attribute Copy Option
+define('TEXT_COPY_ATTRIBUTES_ONLY','Wird nur f&uuml;r duplizierte Artikel benutzt ...');
+define('TEXT_COPY_ATTRIBUTES','Artikelattribute zu Duplikat kopieren?');
+define('TEXT_COPY_ATTRIBUTES_YES','Ja');
+define('TEXT_COPY_ATTRIBUTES_NO','Nein');
+
+// WebMakers.com Added: Attributes Copy from Existing Product to Existing Product
+define('PRODUCT_NAMES_HELPER','<FONT COLOR="FF0000"><a href="' . 'quick_products_popup.php' . '" onclick="NewWindow(this.href,\'name\',\'700\',\'500\',\'yes\');return false;">[ Artikelnummer # Suche ]</a>');
+define('ATTRIBUTES_NAMES_HELPER','<FONT COLOR="FF0000"><a href="' . 'quick_attributes_popup.php?look_it_up=' . $pID . '&my_languages_id=' . $languages_id . '" onclick="NewWindow2(this.href,\'name2\',\'700\',\'400\',\'yes\');return false;">[ Schnellaufz&auml;hlung der Attribute zu Artikelnummer # ' . $pID . ' ]</a>');
+
+// WebMakers.com Added: Product Option Attributes Sort Order - products_attributes.php
+define('TABLE_HEADING_OPTION_SORT_ORDER','Bestellung sortieren');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/authors.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Autoren');
+
+define('TABLE_HEADING_AUTHORS', 'Autor');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_HEADING_NEW_AUTHOR', 'Neuer Autor');
+define('TEXT_HEADING_EDIT_AUTHOR', 'Autor bearbeiten');
+define('TEXT_HEADING_DELETE_AUTHOR', 'Autor l&ouml;schen');
+
+define('TEXT_ARTICLE_BY', 'Artikel von ');
+define('TEXT_MORE_INFORMATION', 'Zu mehr Information besuchen Sie bitte die<a href="http://%s" target="_blank">Web Seite des Autors</a>.');
+
+define('TEXT_AUTHORS', 'Autoren:');
+define('TEXT_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('TEXT_ARTICLES', 'Artikel:');
+
+define('TEXT_NEW_INTRO', 'F&uuml;llen Sie bitte die folgenden Informationen für den neuen Autor aus');
+define('TEXT_EDIT_INTRO', 'Nehmen Sie bitte alle notwendigen &Auml;nderungen vor.');
+
+define('TEXT_AUTHORS_NAME', 'Autor Name:');
+define('TEXT_AUTHORS_DESCRIPTION', 'Autor Beschreibung:');
+define('TEXT_AUTHORS_URL', 'Autor URL:');
+
+define('TEXT_DELETE_INTRO', 'Wollen Sie diesen Autor wirklich l&ouml;schen?');
+define('TEXT_DELETE_ARTICLES', 'Artikel des Autors l&ouml;schen? (beinhaltet s&auml;mtliche Eintr&auml;ge des Autors)');
+define('TEXT_DELETE_WARNING_ARTICLES', '<b>WARNUNG:</b> Es sind %s mit diesem Autor verkn&uuml;pft!');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Fehler: Auf dieses Verzeichnis kann nicht zugegriffen werden. Bitte berichtigen Sie die Berechtigung in diesem Verzeichnis: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Folgendes Verzeichnis existiert nicht: %s');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/backup.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/backup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/backup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: backup.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Datenbanksicherung'); 
+
+define('TABLE_HEADING_TITLE', 'Titel');
+define('TABLE_HEADING_FILE_DATE', 'Datum');
+define('TABLE_HEADING_FILE_SIZE', 'Gr&ouml;sse');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_HEADING_NEW_BACKUP', 'Neue Sicherung');
+define('TEXT_INFO_HEADING_RESTORE_LOCAL', 'Lokal wiederherstellen');
+define('TEXT_INFO_NEW_BACKUP', 'Bitte den Sicherungsprozess AUF KEINEN FALL unterbrechen. Dieser kann einige Minuten in Anspruch nehmen.');
+define('TEXT_INFO_UNPACK', '<br><br>(nach dem die Dateien aus dem Archiv extrahiert wurden)');
+define('TEXT_INFO_RESTORE', 'Den Wiederherstellungsprozess AUF KEINEN FALL unterbrechen.<br><br>Je gr&ouml;sser die Sicherungsdatei - desto l&auml;nger dauert die Wiederherstellung!<br><br>Bitte wenn m&ouml;glich den mysql client benutzen.<br><br>Beispiel:<br><br><b>mysql -h' . DB_SERVER . ' -u' . DB_SERVER_USERNAME . ' -p ' . DB_DATABASE . ' < %s </b> %s');
+define('TEXT_INFO_RESTORE_LOCAL', 'Den Wiederherstellungsprozess AUF KEINEN FALL unterbrechen.<br><br>Je gr&ouml;sser die Sicherungsdatei - desto l&auml;nger dauert die Wiederherstellung!');
+define('TEXT_INFO_RESTORE_LOCAL_RAW_FILE', 'Die Datei, welche hochgeladen wird muss eine sog. raw sql Datei sein (nur Text).');
+define('TEXT_INFO_DATE', 'Datum:');
+define('TEXT_INFO_SIZE', 'Gr&ouml;sse:');
+define('TEXT_INFO_COMPRESSION', 'Komprimieren:');
+define('TEXT_INFO_USE_GZIP', 'Mit GZIP');
+define('TEXT_INFO_USE_ZIP', 'Mit ZIP');
+define('TEXT_INFO_USE_NO_COMPRESSION', 'Keine Komprimierung (Raw SQL)');
+define('TEXT_INFO_DOWNLOAD_ONLY', 'Nur herunterladen (nicht auf dem Server speichern)');
+define('TEXT_INFO_BEST_THROUGH_HTTPS', 'Sichere HTTPS Verbindung verwenden!');
+define('TEXT_DELETE_INTRO', 'Sind Sie sicher, dass Sie diese Sicherung l&ouml;schen m&ouml;chten?');
+define('TEXT_NO_EXTENSION', 'Keine');
+define('TEXT_BACKUP_DIRECTORY', 'Sicherungsverzeichnis:');
+define('TEXT_LAST_RESTORATION', 'Letzte Wiederherstellung:');
+define('TEXT_FORGET', '(<u> vergessen</u>)');
+
+define('ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Sicherungsverzeichnis ist nicht vorhanden.');
+define('ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Sicherungsverzeichnis ist schreibgesch&uuml;tzt.');
+define('ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE', 'Fehler: Download Link nicht akzeptabel.');
+
+define('SUCCESS_LAST_RESTORE_CLEARED', 'Erfolg: Das letzte Wiederherstellungdatum wurde gel&ouml;scht.');
+define('SUCCESS_DATABASE_SAVED', 'Erfolg: Die Datenbank wurde gesichert.');
+define('SUCCESS_DATABASE_RESTORED', 'Erfolg: Die Datenbank wurde wiederhergestellt.');
+define('SUCCESS_BACKUP_DELETED', 'Erfolg: Die Sicherungsdatei wurde gel&ouml;scht.');
+
+define('BYTES', ' bytes');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/backup_mysql.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/backup_mysql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/backup_mysql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// |zen-cart Open Source E-commerce                                       |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 2003 The zen-cart developers                           |
+// |                                                                      |
+// | http://www.zen-cart.com/index.php                                    |
+// |                                                                      |
+// | Portions Copyright (c) 2003 osCommerce                               |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the GPL license,       |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available through the world-wide-web at the following url:           |
+// | http://www.zen-cart.com/license/2_0.txt.                             |
+// | If you did not receive a copy of the zen-cart license and are unable |
+// | to obtain it through the world-wide-web, please send a note to       |
+// | license at zen-cart.com so we can mail you a copy immediately.          |
+// +----------------------------------------------------------------------+
+// $Id: backup_mysql.php,v 1.2.0.1 2004/08/03 00:00:00 DrByteZen Exp $
+//
+
+// define the locations of the mysql utilities.  Typical location is in '/usr/bin/' ... but not on Windows servers.
+// try 'c:/mysql/bin/mysql.exe' and 'c:/mysql/bin/mysqldump.exe' on Windows hosts ... change drive letter and path as needed
+define('LOCAL_EXE_MYSQL',     '/usr/local/bin/mysql');  // used for restores
+define('LOCAL_EXE_MYSQLDUMP', '/usr/local/bin/mysqldump');  // used for backups
+
+// the following are the language definitions
+define('HEADING_TITLE', 'Datenbank Sicherungs Manager - MySQL');
+define('WARNING_NOT_SECURE_FOR_DOWNLOADS','<span class="errorText">ANMERKUNG: SSL ist nicht aktiviert. Alle Downloads werden nicht durch die SSL Verschl&uuml;sselung gesch&uuml;tzt.');
+define('TABLE_HEADING_TITLE', 'Bezeichnung');
+define('TABLE_HEADING_FILE_DATE', 'Datum');
+define('TABLE_HEADING_FILE_SIZE', 'Gr&ouml;sse');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_HEADING_NEW_BACKUP', 'Neues Backup');
+define('TEXT_INFO_HEADING_RESTORE_LOCAL', 'R&uuml;cksichern auf Server');
+define('TEXT_INFO_NEW_BACKUP', 'Unterbrechen Sie diesen Vorgang auf keinen Fall. Sie riskieren einen korrupten Datensatz der nicht mehr verwendet werden kann. Beachten Sie ausserdem das jede Sicherung Plattenplatz auf Ihrem Server ben&ouml;tigt.');
+define('TEXT_INFO_UNPACK', '<br><br>(nach dem entpacken der Daten vom Archiv)');
+define('TEXT_INFO_RESTORE', 'Den Vorgang auf keinen Fall unterbrechen.<br><br>Um so gr&ouml;sser der Shop desto l&auml;nger ben&ouml;tigt die Sicherung!!<br><br>Sollte es m&ouml;glich sein einen MYSQL Client zu verwenden, so tun Sie dies.<br><br>Beispiel Script:<br><br><b>mysql -h' . DB_SERVER . ' -u' . DB_SERVER_USERNAME . ' -p ' . DB_DATABASE . ' < %s </b> %s');
+define('TEXT_INFO_RESTORE_LOCAL', 'Den Vorgang auf keinen Fall unterbrechen!<br><br>Je gr&ouml;sser der Shop desto l&auml;nger ben&ouml;tigt das Backup');
+define('TEXT_INFO_RESTORE_LOCAL_RAW_FILE', 'Die SQL Datei muß im raw sql (text) Format vorliegen.');
+define('TEXT_INFO_DATE', 'Datum:');
+define('TEXT_INFO_SIZE', 'Gr&oumlsse:');
+define('TEXT_INFO_COMPRESSION', 'Komprimierung:');
+define('TEXT_INFO_USE_GZIP', 'GZIP verwenden');
+define('TEXT_INFO_USE_ZIP', 'ZIP verwenden');
+define('TEXT_INFO_USE_NO_COMPRESSION', 'Keine Komprimierung (Reines SQL)');
+define('TEXT_INFO_DOWNLOAD_ONLY', 'Sicherung herunterladen und nicht auf dem Server speichern.');
+define('TEXT_INFO_BEST_THROUGH_HTTPS', '(Sicherer über einen gesicherten HTTPS Anschluss)');
+define('TEXT_DELETE_INTRO', 'Sind Sie sich sicher dass Sie diese Sicherung unwiederruflich l&ouml;schen m&ouml;chten?');
+define('TEXT_NO_EXTENSION', 'Keine');
+define('TEXT_BACKUP_DIRECTORY', 'Backup Verzeichnis:');
+define('TEXT_LAST_RESTORATION', 'Letzte R&uuml;cksicherung:');
+define('TEXT_FORGET', '(vergessen)');
+
+define('ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Sicherungsverzeichnis existiert nicht.');
+define('ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE', 'Fehler: Sie haben keinen Schreibzugriff.');
+define('ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE', 'Fehler: Ein Download der Datei ist derzeit nicht m&ouml;glich.');
+define('ERROR_CANT_BACKUP_IN_SAFE_MODE','Fehler: Das Backup Script kann im SAFE-MODE nicht gestartet werden.');
+
+define('SUCCESS_LAST_RESTORE_CLEARED', 'Erfolgreich: Die Datei wurde erfolgreich entfernt.');
+define('SUCCESS_DATABASE_SAVED', 'Erfolgreich: Die Datenbank wurde gesichert.');
+define('SUCCESS_DATABASE_RESTORED', 'Erfolgreich: Die Datenbank wurde erfolgreich r&uuml;ckgesichert.');
+define('SUCCESS_BACKUP_DELETED', 'Erfolgreich: Die Sicherungsdatei wurde erfolgreich gel&ouml;scht.');
+define('FAILURE_DATABASE_NOT_SAVED', 'Fehler: Die Datenbank wurde NICHT erfolgreich gesichert.');
+define('FAILURE_DATABASE_NOT_SAVED_UTIL_NOT_FOUND', 'Fehler: Die Sicherungsdatei wurde nicht gefunden. BACKUP FEHLGESCHLAGEN.');
+define('FAILURE_DATABASE_NOT_RESTORED', 'Fehler: Die Datenbank konnte nicht gesichert werden. Bitte &uuml;berpr&uuml;fen Sie Ihre Einstellungen.');
+define('FAILURE_DATABASE_NOT_RESTORED_FILE_NOT_FOUND', 'Fehler: Die Datenbank konnte nicht zur&uuml;ck gesichert werden.  Fehler: Datei nicht gefunden: %s');
+define('FAILURE_DATABASE_NOT_RESTORED_UTIL_NOT_FOUND', 'Fehler: Das R&uuml;cksicherungsmodul konnte nicht geladen werden. R&Uuml;cksicherung fehlgeschlagen.');
+
+
+define('BACKUP_MYSQl_ERROR_MSG_1', 'Checking Path: ');
+define('BACKUP_MYSQl_ERROR_MSG_2', 'COMMAND FILES FOUND/SELECTED:');
+define('BACKUP_MYSQl_ERROR_MSG_3', 'COMMAND: ');
+define('BACKUP_MYSQl_ERROR_MSG_4', "valueA: ");
+define('BACKUP_MYSQl_ERROR_MSG_5', "valueB: ");
+define('BACKUP_MYSQl_ERROR_MSG_6', 'Result code: ');
+define('BYTES', ' bytes');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/banner_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/banner_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/banner_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: banner_manager.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Banner Manager');
+
+define('TABLE_HEADING_BANNERS', 'Bannerwerbung');
+define('TABLE_HEADING_GROUPS', 'Gruppen');
+define('TABLE_HEADING_STATISTICS', 'Anzeigen / Klicks');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_BANNERS_TITLE', 'Titel des Banners:'); 
+define('TEXT_BANNERS_URL', 'Banner-URL:'); 
+define('TEXT_BANNERS_GROUP', 'Bannergruppe:');
+define('TEXT_BANNERS_NEW_GROUP', ', oder tragen Sie unten eine neue Bannergruppe ein');
+define('TEXT_BANNERS_IMAGE', 'Bild (Datei):'); 
+define('TEXT_BANNERS_IMAGE_LOCAL', ', oder tragen Sie unten die lokale Datei auf Ihrem Server an'); 
+define('TEXT_BANNERS_IMAGE_TARGET', 'Ziel der Bilddatei (speichern unter):'); 
+define('TEXT_BANNERS_HTML_TEXT', 'HTML Text:');
+define('TEXT_BANNERS_EXPIRES_ON', 'G&uuml;ltig bis:');
+define('TEXT_BANNERS_OR_AT', ', oder nach');
+define('TEXT_BANNERS_IMPRESSIONS', 'Einblendungen');
+define('TEXT_BANNERS_SCHEDULED_AT', 'G&uuml;ltig ab:');
+define('TEXT_BANNERS_BANNER_NOTE','<b>Banner Hinweis:</b><ul><li>Benutzen Sie entweder ein Bild oder einen HTML Text ,aber nicht beides.</li><li>HTML Text hat eine h&ouml;here Priorit&auml;t als ein Bild</li></ul>');
+define('TEXT_BANNERS_INSERT_NOTE','<b>Bemerkung:</b><ul><li>Sie m&uuml;ssen Schreibrechte auf das Uploadverzeichnis haben!</li><li>Wenn Sie kein Bild auf den Server laden wollen, lassen Sie das Eingabefeld "speichern unter" leer (z.B. wenn Sie ein lokales Bild (serverseitig) verwenden.</li><li>Im Eingabefeld "speichern unter" muss ein bereits existierendes Verzeichnis und ein abschlie&szlig;ender "slash" eingetragen werden (z.B.: banners/).</li></ul>');
+define('TEXT_BANNERS_EXPIRCY_NOTE','<b>"G&uuml;ltig bis" Hinweis:</b><ul><li>Nur eines der beiden Felder sollten ver&ouml;ffentlicht werden</li><li>Wenn der Banner zeitlich nicht automatisch enden soll, lassen Sie diese Felder leer</li></ul>');
+define('TEXT_BANNERS_SCHEDULE_NOTE','<b>Zeitplan Hinweis:</b><ul><li>Wenn ein Zeitplan erstellt wurde, wird der Banner mit diesem Datum aktiviert.</li><li>Alle geplanten Banner sind bis zum erstellten Zeitplan als inaktiv markiert. Danach werden sie automatisch aktiviert</li></ul>');
+
+define('TEXT_BANNERS_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_BANNERS_SCHEDULED_AT_DATE', 'G&uuml;ltig ab: <b>%s</b>');
+define('TEXT_BANNERS_EXPIRES_AT_DATE', 'G&uuml;ltig bis zum: <b>%s</b>');
+define('TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS', 'G&uuml;ltig bis: <b>%s</b> Impressionen/Anzeigen');
+define('TEXT_BANNERS_STATUS_CHANGE', 'Status ge&auml;ndert: %s');
+
+define('TEXT_BANNERS_DATA', 'D<br>A<br>T<br>E<br>N');
+define('TEXT_BANNERS_LAST_3_DAYS', 'letzten 3 Tage');
+define('TEXT_BANNERS_BANNER_VIEWS', 'Banneranzeigen');
+define('TEXT_BANNERS_BANNER_CLICKS', 'Bannerklicks');
+
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie diesen Banner l&ouml;schen m&ouml;chten?');
+define('TEXT_INFO_DELETE_IMAGE', 'Bannerbild l&ouml;schen');
+
+define('SUCCESS_BANNER_INSERTED', 'Erfolg: Der Banner wurde eingef&uuml;gt.');
+define('SUCCESS_BANNER_UPDATED', 'Erfolg: Der Banner wurde aktualisiert.');
+define('SUCCESS_BANNER_REMOVED', 'Erfolg: Der Banner wurde gel&ouml;scht.');
+define('SUCCESS_BANNER_STATUS_UPDATED', 'Erfolgt: Der Bannerstatus wurde aktualisiert.');
+
+define('ERROR_BANNER_TITLE_REQUIRED', 'Fehler: Ein Bannertitel wird ben&ouml;tigt.');
+define('ERROR_BANNER_GROUP_REQUIRED', 'Fehler: Eine Bannergruppe wird ben&ouml;tigt.');
+define('ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Zielverzeichnis %s existiert nicht.');
+define('ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Zielverzeichnis %s ist nicht beschreibbar.');
+define('ERROR_IMAGE_DOES_NOT_EXIST', 'Fehler: Bild existiert nicht.');
+define('ERROR_IMAGE_IS_NOT_WRITEABLE', 'Fehler: Bild kann nicht gel&ouml;scht werden.');
+define('ERROR_UNKNOWN_STATUS_FLAG', 'Fehler: Unbekanntes Status Flag.');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis \'graphs\' ist nicht vorhanden! Bitte erstellen Sie ein Verzeichnis \'graphs\' im Verzeichnis \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis \'graphs\' ist schreibgesch&uuml;tzt!');
+
+define('DATE_FORMAT', '(dd/mm/yyyy)');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/banner_statistics.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/banner_statistics.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/banner_statistics.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: banner_statistics.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Bannerstatistik');
+
+define('TABLE_HEADING_SOURCE', 'Quelle');
+define('TABLE_HEADING_VIEWS', 'Einblendungen');
+define('TABLE_HEADING_CLICKS', 'Klicks');
+
+define('TEXT_BANNERS_DATA', 'D<br>a<br>t<br>e<br>n');
+define('TEXT_BANNERS_DAILY_STATISTICS', '%s Tagesstatistik für %s %s');
+define('TEXT_BANNERS_MONTHLY_STATISTICS', '%s Monatsstatistik für %s');
+define('TEXT_BANNERS_YEARLY_STATISTICS', '%s Jahresstatistik');
+
+define('STATISTICS_TYPE_DAILY', 't&auml;glich');
+define('STATISTICS_TYPE_MONTHLY', 'monatlich');
+define('STATISTICS_TYPE_YEARLY', 'j&auml;hrlich');
+
+define('TITLE_TYPE', 'Typ:');
+define('TITLE_YEAR', 'Jahr:');
+define('TITLE_MONTH', 'Monat:');
+
+define('ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis \'graphs\' ist nicht vorhanden! Bitte erstellen Sie ein Verzeichnis \'graphs\' im Verzeichnis \'images\'.');
+define('ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis \'graphs\' ist schreibgesch&uuml;tzt!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/c_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/c_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/c_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,147 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Bestellung Generieren');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'Bestell ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('ADDING_TITLE', 'Produkt hinzuf&uuml;gen');
+
+define('CATEGORY_ORDER_DETAILS', 'Customer Details');
+define('ENTRY_CURRENCY', 'Customer Currency');
+
+define('ENTRY_UPDATE_TO_CC', '(Aktualisieren der <b>Kreditkarte</b> zum anzeigen des CC Feldes.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hint: </font>To delete a product set its quantity to "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hint: </font>Feel free to give discounts by adding negative amounts to the list.<br>Fields with "0" values are deleted when updating the order (exception: shipping).');
+define('HINT_PRESS_UPDATE', 'Please click on "Update" to save all changes made above.');
+define('TABLE_HEADING_COMMENTS', 'Kommentare');
+define('TABLE_HEADING_CUSTOMERS', 'Kunden');
+define('TABLE_HEADING_ORDER_TOTAL', 'Bestellung Summe');
+define('TABLE_HEADING_DATE_PURCHASED', 'Bestelldatum');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_QUANTITY', 'Stk.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modell');
+define('TABLE_HEADING_PRODUCTS', 'Produkte');
+define('TABLE_HEADING_TAX', 'MwSt.');
+define('TABLE_HEADING_TOTAL', 'Gesamt');
+define('TABLE_HEADING_UNIT_PRICE', 'Preis pro Einheit');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Price (incl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Summe Gesamt');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (incl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Total Price Component');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Amount');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Kunde benachrichtigt');
+define('TABLE_HEADING_DATE_ADDED', 'hinzugef&uuml;gt am:');
+
+define('ENTRY_CUSTOMER', 'Kunde:');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Company');
+define('ENTRY_CUSTOMER_ADDRESS', 'Address');
+define('ENTRY_CUSTOMER_SUBURB', 'Suburb');
+define('ENTRY_CUSTOMER_CITY', 'City');
+define('ENTRY_CUSTOMER_STATE', 'State');
+define('ENTRY_CUSTOMER_POSTCODE', 'Postcode');
+define('ENTRY_CUSTOMER_COUNTRY', 'Country');
+define('ENTRY_CUSTOMER_PHONE', 'Phone');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Verkauft an:');
+define('ENTRY_DELIVERY_TO', 'Zugestellt an:');
+define('ENTRY_SHIP_TO', 'Versand an:');
+define('ENTRY_SHIPPING_ADDRESS', 'Versand Adresse:');
+define('ENTRY_BILLING_ADDRESS', 'Rechnungs Addresse:');
+define('ENTRY_PAYMENT_METHOD', 'Bezahlverfahren:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Kreditkarten Type:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Kreditkartenbesitzer:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Kreditkartennummer:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Kreditkarte g&uuml;ltig bis:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Zwischensumme:');
+define('ENTRY_TAX', 'MwSt.:');
+define('ENTRY_SHIPPING', 'Versand:');
+define('ENTRY_TOTAL', 'Gesamt:');
+define('ENTRY_DATE_PURCHASED', 'Kaufdatum:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'Letzte Aktuallisierung:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Kunde benachrichtigen:');
+define('ENTRY_NOTIFY_COMMENTS', 'Eingetragene Kommentare:');
+define('ENTRY_PRINTABLE', 'Rechnung drucken');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Nutzen Sie hier Ziffern in negierter Form -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Discount/Gift Voucher: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Bestellung l&ouml;schen');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sich sicher das Sie die Bestellung l&ouml;schen wollen?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Anzahl dem Lager gutschreiben');
+define('TEXT_DATE_ORDER_CREATED', 'Erstellt am:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Add New Product');
+define('TEXT_INFO_PAYMENT_METHOD', 'Bezahlmetode:');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> This CC expire date is stored Encrypted </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC expire date is not stored Encrypted </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> This CC CCV is stored Encrypted </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC CCV is not stored Encrypted If blank ignore this message</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> CCV Code:  Not stored - due to processing regulations. Enable CCV email in module settings.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'Ihre IP-Adresse');
+define('ENTRY_IPISP', 'Ihr Provider');
+
+define('TEXT_ALL_ORDERS', 'Alle Bestellungen');
+define('TEXT_NO_ORDER_HISTORY', 'Keine Bestell&uuml;bersicht vorhanden');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Bestellung aktuallisiert');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Bestellnummer:');
+define('EMAIL_TEXT_INVOICE_URL', 'Aufgeschl&uuml;sselte Rechnung:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Bestelldatum:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Ihre Bestellung wurde auf folgenden Status gesetzt.' . "\n\n" . 'Neuer Status: %s' . "\n\n" . 'Sollten Sie Fragen zu diesem Vorgang haben, so senden Sie uns eine Email.' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'Folgender Kommentar wurde hinzugef&uuml;gt' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Fehler: Bestellung existiert nicht.');
+define('SUCCESS_ORDER_UPDATED', 'ERFOLGREICH: Bestellung wurde aktualisiert.');
+define('WARNING_ORDER_NOT_UPDATED', 'FEHLER: Nichts zu &auml;ndern. Es wurde keine &Auml;nderung durchgef&uuml;hrt.');
+
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Choose a product');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Choose an option');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Product has no options, so skipping...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'pieces of this product');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'Add');
+define('ADDPRODUCT_TEXT_STEP', 'Step');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Choose a catalogue. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Choose a product. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Choose an option. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Customer Data');
+define('MENUE_TITLE_PAYMENT', '2. Payment Method');
+define('MENUE_TITLE_ORDER', '3. Ordered Products');
+define('MENUE_TITLE_TOTAL', '4. Discount, Shipping and Total');
+define('MENUE_TITLE_STATUS', '5. Status and Notification');
+define('MENUE_TITLE_UPDATE', '6. Update Data');
+
+define('DONT_ADD_NEW_PRODUCT', 'Addieren Sie nicht neues Produkt');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/cache.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/cache.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/cache.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: cache.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Cache Steuerung');
+
+define('TABLE_HEADING_CACHE', 'Bl&ouml;cke cachen');
+define('TABLE_HEADING_DATE_CREATED', 'erstellt am');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'Datei ist nicht vorhanden');
+define('TEXT_CACHE_DIRECTORY', 'Cache Verzeichnis:');
+
+define('ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Cache Verzeichnis ist nicht vorhanden. Einstellungen bitte unter Konfiguration / Cache vornehmen');
+define('ERROR_CACHE_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Cache Verzeichnis ist schreibgesch&uuml;tzt.');
+// labels for Tools>Cache Control
+define('TEXT_CACHE_CATEGORIES', 'Kategorie Box');
+define('TEXT_CACHE_CATEGORIES1', 'Kategorie Box 1');
+define('TEXT_CACHE_CATEGORIES2', 'Kategorie Box 2');
+define('TEXT_CACHE_CATEGORIES3', 'Kategorie Box 3');
+define('TEXT_CACHE_CATEGORIES4', 'Kategorie Box 4');
+define('TEXT_CACHE_CATEGORIES5', 'Kategorie Box 5');
+define('TEXT_CACHE_ALLPROD', 'Alle Artikel');
+define('TEXT_CACHE_ALLMANUF', 'Alle Hersteller');
+define('TEXT_CACHE_ALLCATS', 'Alle Kategorien');
+define('TEXT_CACHE_MANUFACTURERS', 'Hersteller Box');
+define('TEXT_CACHE_ALSO_PURCHASED', 'Ebenfalls erworben Modul');
+define('TEXT_CACHE_COOLMENU', 'Cool Menu');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,189 @@
+<?php
+/*
+  $Id: categories.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Gr&ouml;sseres Bild:</b><br><small> ERSETZT Kleines Bild in der <br><u>Produktbeschreibungs</u>-Seite.</small>');
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Produkt Bild:</b><small><br> Hauptbild benutzt in den <br><u>Katalog und Beschreibung</u> Seiten.<small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Bild:</b><br><small>ERSETZT Kleines Bild in der <br><u>Pop-up Fenster</u> Seite.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Speichere Produkt, die dieses Bild gemeinsam nutzen =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Entferne</b> dieses Bild von diesem Produkt?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>L&ouml;sche</b> dieses Bild vom Server (Dauerhaft!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Entfernen');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'L&ouml;schen');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Kleine Bilder</b> (<b>SM</b>all). Wenn ein "SM" Bild benutzt wird,<br>(Allein) wird KEIN Pop-up Fenster Link erzeugt, das "SM" Bild<br> wird direkt unter der <br>Produktbeschreibung<br> platziert. <br>Wenn gemeinsam mit einem <br>"XL" Bild rechts verwendet, wird ein Pop-Up Fenster-Link<br>erzeugt, und das "XL" Bild wird in <br>einem Pop-up Fenster gezeigt.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Grosse Bilder</b> (<b>XL</b>arge). Werden für das Pop-up Fenster-Bild benutzt<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Zus&auml;tzliche Bilder - Diese erscheinen unter dem Produkt, falls verwendet.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Bild 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Bild 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Bild 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Bild 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Bild 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Bild 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Bild 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Bild 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Bild 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Bild 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Bild 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Bild 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+define('HEADING_TITLE', 'Kategorien / Produkt');
+define('HEADING_TITLE_SEARCH', 'Suche: ');
+define('HEADING_TITLE_GOTO', 'Gehe zu:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Kategorien / Produkt');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('TEXT_NEW_PRODUCT', 'Neuer Produkt in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Kategorien:');
+define('TEXT_SUBCATEGORIES', 'Unterkategorien:');
+define('TEXT_PRODUCTS', 'Produkt:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Preis:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Steuerklasse:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'durchschnittl. Bewertung:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Anzahl:');
+define('TEXT_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_DELETE_IMAGE', 'Bild l&ouml;schen');
+
+define('TEXT_DATE_AVAILABLE', 'Erscheinungsdatum:');
+define('TEXT_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_IMAGE_NONEXISTENT', 'BILD EXISTIERT NICHT');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Bitte f&uuml;gen Sie eine neue Kategorie oder ein Produkt in dieser Ebene ein.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'F&uuml;r weitere Informationen, besuchen Sie bitte die <a href="http://%s" target="blank"><u>Homepage</u></a> des Herstellers.');
+define('TEXT_PRODUCT_DATE_ADDED', 'Dieses Produkt haben wir am %s in unserem Katalog aufgenommen.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'Dieses Produkt ist erh&auml;ltlich ab %s.');
+
+define('TEXT_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch.');
+define('TEXT_EDIT_CATEGORIES_ID', 'Kategorie ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Kategorie Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Kategorie Bild:');
+define('TEXT_EXISTING_CATEGORIES_IMAGE','Existing Image');
+define('TEXT_EDIT_SORT_ORDER', 'Sortierreihenfolge:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Kategorien-&Uuml;berschrifts-Titel:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Kategorien-&Uuml;berschrifts-Beschreibung:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Kategorie Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Kategorie Discription Meta Tag:');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Kategorie Key Word Meta Tag:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Bitte w&auml;hlen Sie eine neue Kategorie aus, in die Sie das Produkt kopieren m&ouml;chten:');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'aktuelle Kategorien:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'Neue Kategorie');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Kategorie bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Kategorie l&ouml;schen');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Kategorie verschieben');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Produkt l&ouml;schen');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Produkt verschieben');
+define('TEXT_INFO_HEADING_COPY_TO', 'Kopieren nach');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Sind Sie sicher, dass Sie diese Kategorie l&ouml;schen m&ouml;chten?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Sind Sie sicher, dass Sie dieses Produkt l&ouml;schen m&ouml;chten?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNUNG:</b> Es existieren noch %s (Unter-)Kategorien, die mit dieser Kategorie verbunden sind!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> Es existieren noch %s Produkte, die mit dieser Kategorie verbunden sind!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Bitte w&auml;hlen Sie die &uuml;bergordnete Kategorie, in die Sie <b>%s</b> verschieben m&ouml;chten');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Bitte w&auml;hlen Sie die &uuml;bergordnete Kategorie, in die Sie <b>%s</b> verschieben m&ouml;chten');
+define('TEXT_MOVE', 'Verschiebe <b>%s</b> nach:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Bitte geben Sie die neue Kategorie mit allen relevanten Daten ein.');
+define('TEXT_CATEGORIES_NAME', 'Kategorie Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Kategorie Bild:');
+define('TEXT_SORT_ORDER', 'Sortierreihenfolge:');
+
+define('TEXT_PRODUCTS_STATUS', 'Produktstatus:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Erscheinungsdatum:');
+define('TEXT_PRODUCT_AVAILABLE', 'auf Lager');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'nicht vorr&auml;tig');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Produkt-Hersteller:');
+define('TEXT_PRODUCTS_NAME', 'Produktname:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Produktbeschreibung:');
+define('TEXT_PRODUCTS_QUANTITY', 'Lagerbestand:');
+define('TEXT_PRODUCTS_MODEL', 'Produktnummer:');
+define('TEXT_PRODUCTS_IMAGE', 'Produktbild:');
+define('TEXT_PRODUCTS_URL', 'Herstellerlink:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(ohne f&uuml;hrendes http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Nettopreis:');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Bruttopreis:');
+define('TEXT_PRODUCTS_WEIGHT', 'Gewicht:');
+define('TEXT_NONE', '--keines--');
+
+define('EMPTY_CATEGORY', 'Leere Kategorie');
+
+define('TEXT_HOW_TO_COPY', 'Kopiermethode:');
+define('TEXT_COPY_AS_LINK', 'Produkt verlinken');
+define('TEXT_COPY_AS_DUPLICATE', 'Produkt duplizieren');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Fehler: Artikel k&ouml;nnen nicht in der gleichen Kategorie verlinkt werden.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis \'images\' im Katalogverzeichnis ist schreibgesch&uuml;tzt: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis \'images\' im Katalogverzeichnis ist nicht vorhanden: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Fehler: Kategorie kann nicht in eine Sub-Kategurie verschoben werden');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Produktseiten Titel:');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Produkt Header Beschreibung:');
+define('TEXT_PRODUCTS_KEYWORDS', 'Produkt Keywords:');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Produktattribute editieren');
+
+// mod for sub products
+define('MAX_PRODUCT_SUB_ROWS', '5');
+define('TEXT_SUB_PRODUCT','Sub Produkt:');
+define('TEXT_SUB_PRODUCT_DELETE','L&ouml;schen');
+define('TEXT_SUB_PRODUCT_NAME','Name');
+define('TEXT_SUB_PRODUCT_PRICE','Preis');
+define('TEXT_SUB_PRODUCT_MODEL','Modell');
+define('TEXT_SUB_PRODUCT_QTY','Menge');
+define('TEXT_SUB_PRODUCT_WEIGHT','Gewicht');
+define('TEXT_SUB_PRODUCT_IMAGE','Bild');
+define('TEXT_SUB_PRODUCT_NOTE_1','* zus&auml;tzliche Unterprodukte verf&uuml;gbar unterhalb einf&uuml;gen');
+define('TEXT_SUB_PRODUCT_NOTE_2','* St&uuml;ckzahl 0 deaktiviert das Unterprodukt');
+
+// Eversun mod for sppc and qty price breaks
+define('TEXT_PRODUCTS_PRICE', 'Laden Preis:');
+define('TEXT_PRODUCTS_GROUPS', 'Gruppe:');
+define('TEXT_PRODUCTS_BASE', 'Grundpreis');
+define('TEXT_PRODUCTS_ABOVE', '&uuml;ber');
+define('TEXT_PRODUCTS_QTY', 'Stk.');
+define('TEXT_PRODUCTS_QTY_BLOCKS', 'Stk. pro Verpackungseinheit:');
+define('TEXT_PRODUCTS_QTY_BLOCKS_INFO', '(Kann nur in Verpackungseinheiten bestellt werden mit X Stk Inhalt)');
+define('TEXT_PRODUCTS_SPPP_NOTE', 'Beachten Sie: Ist ein Feld ausgef&uuml;llt, aber nicht ausgew&auml;hlt, wird der Preis nicht ver&auml;ndert .<br />Ist der Preis berreits in der Datenbank vorhanden, aber nicht ausgew&auml;hlt wird dieser aus der Datenbank entfernt.');
+define('TEXT_PRODUCTS_QTY_DISCOUNT', '10');
+
+// Eversun mod end for sppc and qty price breaks
+
+
+
+define('TEXT_PRODUCT_IMAGES', 'Product Images');
+define('TEXT_EXTRA_FIELDS', 'Extra Fields');
+define('TEXT_EXTRA_IMAGES', 'Extra Images');
+define('TEXT_ACTIVE_ATTRIBUTES', 'Active Attributes');
+define('TEXT_COPY_ATTRIBUTES_TO_ANOTHER_PRODUCT', 'Copy Attributes to another product');
+define('TEXT_COPYING_ATTRIBUTES_FROM', 'Copying Attributes from');
+define('TEXT_COPYING_ATTRIBUTES_TO', 'Copying Attributes to');
+define('TEXT_DELETE_ALL_ATTRIBUTE', 'Delete ALL Attributes and Downloads before copying');
+define('TEXT_OTHERWISE', 'Otherwise ...');
+define('TEXT_DUPLICATE_ATTRIBUTES_SKIPPED', 'Duplicate Attributes should be skipped');
+define('TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN', 'Duplicate Attributes should be overwritten');
+define('TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS', 'Copy Attributes with Downloads');
+define('TEXT_SELECT_PRODUCT_FOR_DISPLAY', 'Select a product for display');
+define('TEXT_COPY_PRODUCT_ATTRIBUTES_TO_CATEGORY', 'Copy Product Attributes to Category ...');
+define('TEXT_COPY_PRODUCT_ATTRIBUTES_FROM_PRODUCT_ID', 'Copy Product Attributes from Product ID');
+define('TEXT_COPYING_TO_ALL_PRODUCTS_IN_CATEGORY_ID', 'Copying to all products in Category ID');
+define('TEXT_CATEGORY_NAME', 'Category Name: ');
+define('TEXT_SELECT_PRODUCT_TO_DISPLAY_ATTRIBUTES', 'Select a product to display attributes');
+define('DATE_FORMAT', '(YYYY-MM-DD)');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/check_lang.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/check_lang.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/check_lang.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+
+  Released under the GNU General Public License
+*/
+
+define("ERROR_CANNOT_OPEN_LANGUAGE_DIR","FATAL ERROR: Cannot open language dir: ");
+define("CHECK_LANG_FILENAME","Filename");
+define("CHECK_LANG_MISSING_IN","Missing in");
+define("CHECK_LANG_NONE_FOUND","None found");
+define("CHECK_LANG_FOUND_IN","Found in");
+define("CHECK_LANG_DEFINITION_NAME","Definition name");
+define("CHECK_LANG_EQUAL_TO","Equal to");
+define("CHECK_LANG_REFERENCES","References");
+define("CHECK_LANG_ALL_EQUAL","All equal");
+define("CHECK_LANG_WHERE_USED","Where Used");
+define("CHECK_LANG_FOUND_FOR","Found for");
+define("CHECK_LANG_MISSING_FOR","Missing for");
+define("CHECK_LANG_ALL_BUT","All but");
+define("CHECK_LANG_FILE_NAME","File Name");
+define("CHECK_LANG_SELECT_OPTION","Select option");
+define("CHECK_LANG_TO_CHECK_FILE_CONSISTENCY","To check file consistency");
+define("CHECK_LANG_CLICK_HERE","Click Here");
+define("CHECK_LANG_TO_CHECK_DEFINITION_CONSISTENCY","To check definition consistency");
+define("CHECK_LANG_TO_CHECK_EQUAL_DEFINITIONS","To check equal definitions");
+define("CHECK_LANG_HOME","Home");
+define("CHECK_LANG_BACK","Back");
+define("CHECK_LANG_W_GODEFROY","W Godefroy");
+define("CHECK_LANG_EXECUTION_TIME","Execution Time: ");
+define("CHECK_LANG_TITLE","Check Language Integrity");
+define("CHECK_LANG_LIST_OF_FILES_USING","List of files using");
+define("CHECK_LANG_LIST_OF_FILES_PRESENT_FOR_ONE_LANGUAGE","List of files that are present for one language-definition but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_PRESENT_FOR_ONE_LANGUAGE","List of phrase definitions that are present for one language-file but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_DEFINITIONS_EQUAL","List of phrase definitions that are equal");
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Name');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Wert');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'letzte &Auml;nderung:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/countries.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/countries.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/countries.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: countries.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'L&auml;nder');
+
+define('TABLE_HEADING_COUNTRY_NAME', 'Land');
+define('TABLE_HEADING_COUNTRY_CODES', 'ISO Codes');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_COUNTRY_NAME', 'Name:');
+define('TEXT_INFO_COUNTRY_CODE_2', 'ISO Code (2):');
+define('TEXT_INFO_COUNTRY_CODE_3', 'ISO Code (3):');
+define('TEXT_INFO_ADDRESS_FORMAT', 'Adressformat:');
+define('TEXT_INFO_INSERT_INTRO', 'Bitte geben Sie das neue Land mit allen relevanten Daten ein');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie das Land l&ouml;schen m&ouml;chten?');
+define('TEXT_INFO_HEADING_NEW_COUNTRY', 'neues Land');
+define('TEXT_INFO_HEADING_EDIT_COUNTRY', 'Land bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_COUNTRY', 'Land l&ouml;schen');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/coupon_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/coupon_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/coupon_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,121 @@
+<?php
+/*
+  $Id: coupon_admin.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TOP_BAR_TITLE', 'Statistik');
+define('HEADING_TITLE', 'Rabatt Kupon');
+define('HEADING_TITLE_STATUS', 'Status : ');
+define('TEXT_CUSTOMER', 'Kunde:');
+define('TEXT_COUPON', 'Kupon Name');
+define('TEXT_COUPON_ALL', 'Alle Kupons');
+define('TEXT_COUPON_ACTIVE', 'Aktive Kupons');
+define('TEXT_COUPON_INACTIVE', 'Inaktive Kupons');
+define('TEXT_SUBJECT', 'Betreff:');
+define('TEXT_FROM', 'Von:');
+define('TEXT_FREE_SHIPPING', 'Versandkostenfrei');
+define('TEXT_MESSAGE', 'Nachricht:');
+define('TEXT_SELECT_CUSTOMER', 'Kunde w&auml;hlen');
+define('TEXT_ALL_CUSTOMERS', 'Alle Kunden');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'An alle Newsletter-Abonnenten');
+define('TEXT_CONFIRM_DELETE', 'Sind Sie sicher, dass Sie diesen Kupon l&ouml;schen wollen?');
+
+define('TEXT_TO_REDEEM', 'Sie k&ouml;nnen diesen Kupon bei der Kasse einl&ouml;sen. Geben Sie nur den Code aus der Box ein, und klicken Sie den Einl&ouml;sen Button.');
+define('TEXT_IN_CASE', ' wenn Probleme auftauchen. ');
+define('TEXT_VOUCHER_IS', 'Der Kupon Code ist ');
+define('TEXT_REMEMBER', 'Verlieren Sie den Code nicht. Bewahren Sie ihn an einem sicheren Ort auf, damit Sie von diesem speziellen Angebot profitieren k&ouml;nnen.');
+define('TEXT_VISIT', 'wenn Sie besuchen  <a style="color: #000000" href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . STORE_NAME . '</a>' ."\n" .'(' . HTTP_SERVER . DIR_WS_CATALOG . ')');
+define('TEXT_ENTER_CODE', ' und geben Sie den Code ein ');
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">The Back Button has been DISABLED while HTML WYSIWG Editor is turned ON.</b></font> WHY? - Because if you click the back button to edit your HTML email, the PHP (php.ini - "Magic Quotes = On") will automatically add "\\\\\\\" backslashes everywhere Double Quotes " appear (HTML uses them in Links, Images and More) and this distorts the HTML, the pictures will dissapear once you submit the email again. If you turn OFF WYSIWYG Editor in Admin, the HTML Ability of osCommerce is also turned OFF and the back button will re-appear. A fix for this HTML and PHP issue would be nice if someone knows a solution.<br><br><b>If you really need to Preview your emails before sending them, use the Preview Button located on the WYSIWYG Editor.<br><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML is currently Disabled!</b></font><br><br>If you want to send HTML email, Enable WYSIWYG Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>');
+
+define('TEXT_OR_VISIT', 'or visit ');
+define('TEXT_TO_REDEEM', ' To redeem this Discount coupon, please click on the link below. Please also write down the redemption code');
+define('TEXT_WHICH_IS', ' which is ');
+define('TEXT_IN_CASE', ' in case you have any problems.');
+
+
+define('TEXT_COUPON_REDEEMED', 'Redeemed Coupons');
+define('REDEEM_DATE_LAST', 'Date Last Redeemed');
+define('COUPON_STATUS', 'Status');
+define('COUPON_STATUS_HELP', 'Set to ' . IMAGE_ICON_STATUS_RED . ' to disable customers\' ability to use the coupon.');
+define('COUPON_BUTTON_EMAIL_VOUCHER', 'Email Voucher');
+define('COUPON_BUTTON_EDIT_VOUCHER', 'Edit Voucher');
+define('COUPON_BUTTON_DELETE_VOUCHER', 'Delete Voucher');
+define('COUPON_BUTTON_VOUCHER_REPORT', 'Voucher Report');
+
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_HEADING_COUPON_REPORT', 'Coupon Report');
+
+define('CUSTOMER_ID', 'Kundennummer');
+define('CUSTOMER_NAME', 'Name des Kunden');
+define('REDEEM_DATE', 'eingel&ouml;st am');
+define('IP_ADDRESS', 'IP Adresse');
+
+define('TEXT_REDEMPTIONS', 'Einl&ouml;sung');
+define('TEXT_REDEMPTIONS_TOTAL', 'In Summe');
+define('TEXT_REDEMPTIONS_CUSTOMER', 'F&uuml;r diesen Kunden');
+define('TEXT_NO_FREE_SHIPPING', 'Keine versandkostenfreie Lieferung');
+
+define('NOTICE_EMAIL_SENT_TO', 'Achtung: Email an uns gesandt: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Fehler: Es wurde kein Kunde ausgew&auml;hlt!');
+define('ERROR_NO_COUPON_AMOUNT', 'Error: No coupon amount has been entered. Either enter an amount or select free shipping.');
+define('ERROR_COUPON_EXISTS', 'Error: A coupon with the same coupon code already exists.');
+
+define('COUPON_NAME', 'Kupon Name');
+//define('COUPON_VALUE', 'Kupon Wert');
+define('COUPON_AMOUNT', 'Kupon Betrag');
+define('COUPON_CODE', 'Kupon Code');
+define('COUPON_STARTDATE', 'G&uuml;ltig ab');
+define('COUPON_FINISHDATE', 'G&uuml;ltig bis');
+define('COUPON_FREE_SHIP', 'Versandkostenfrei');
+define('COUPON_DESC', 'Kupon Beschreibung');
+define('COUPON_MIN_ORDER', 'Kupon Minimum Bestellung');
+define('COUPON_USES_COUPON', 'Anwendungen pro Kupon');
+define('COUPON_USES_USER', 'Anwendungen pro Kunde');
+define('COUPON_PRODUCTS', 'G&uuml;ltige Produkt Aufz&auml;hlung');
+define('COUPON_CATEGORIES', 'G&uuml;ltige Kategorien Aufz&auml;hlung');
+define('VOUCHER_NUMBER_USED', 'Verwendete Anzahl');
+define('DATE_CREATED', 'Erstellt am');
+define('DATE_MODIFIED', 'Ge&auml;ndert am');
+define('TEXT_HEADING_NEW_COUPON', 'Neuen Kupon Erstellen');
+define('TEXT_NEW_INTRO', 'Bitte geben Sie die folgenden Information f&uuml;r den neuen Kupon an.<br>');
+
+
+define('COUPON_NAME_HELP', 'Ein kurzer Name f&uuml;r den Kupon');
+define('COUPON_AMOUNT_HELP', 'Der Wert des Rabatts für den Kupon, entweder absolut oder in % für einen Rabatt vom Gesamtbestellwert.');
+define('COUPON_CODE_HELP', 'Sie k&ouml;nnen Ihren eigenen Code eingeben, oder das Feld leer lassen, f&uuml;r einen automatisch generierten Code.');
+define('COUPON_STARTDATE_HELP', 'Das Datum, ab dem der Kupon g&uuml;ltig ist');
+define('COUPON_FINISHDATE_HELP', 'Das Datum an dem der Kupon abl&auml;uft');
+define('COUPON_FREE_SHIP_HELP', 'Der Kupon macht eine Bestellung versandkostenfrei. Achtung: Dies lässt die coupon_amount Einstellung unbeachtet, aber respektiert den Minimum-Bestellwert');
+define('COUPON_DESC_HELP', 'Eine Beschreibung des Kupons f&uuml;r den Kunden');
+define('COUPON_MIN_ORDER_HELP', 'Der Minimumbestellwert, bevor dieser Kupon g&uuml;ltig ist');
+define('COUPON_USES_COUPON_HELP', 'Die maximale Anzahl, die dieser Kupon benutzt werden kann; leer lassen für kein Limit.');
+define('COUPON_USES_USER_HELP', 'Anzahl, wie oft dieser Kupon benutzt werden kann; leer lassen für kein Limit.');
+define('COUPON_PRODUCTS_HELP', 'Eine Komma-getrennte Liste von product_ids, mit denen dieser Kupon benutzt werden kann; leer lassen für kein Einschr&auml;nkung.');
+define('COUPON_CATEGORIES_HELP', 'Eine Komma-getrennte Liste von cpaths, mit denen dieser Kupon benutzt werden kann; leer lassen für kein Einschr&auml;nkung.');
+
+
+define('ALT_CONFIRM_DELETE_VOUCHER', 'Confirm Delete Voucher');
+define('ALT_CANCEL', 'Cancel');
+define('VIEW', 'View');
+define('ALT_EMAIL_VOUCHER', 'Email Voucher');
+define('ALT_EDIT_VOUCHER', 'Edit Voucher');
+define('ALT_DELETE_VOUCHER', 'Delete Voucher');
+define('ALT_VOUCHER_REPORT', 'Voucher Report');
+define('COUPON_BUTTON_EMAIL_VOUCHER', 'Email Voucher');
+define('COUPON_BUTTON_EDIT_VOUCHER', 'Edit Voucher');
+define('COUPON_BUTTON_DELETE_VOUCHER', 'Delete Voucher');
+define('COUPON_BUTTON_VOUCHER_REPORT', 'Voucher Report');
+define('COUPON_BUTTON_PREVIEW', 'Preview');
+define('COUPON_BUTTON_BACK', 'Back');
+define('COUPON_STATUS', 'Status');
+define('COUPON_STATUS_HELP', 'Set to ' . IMAGE_ICON_STATUS_RED . ' to disable customers\' ability to use the coupon.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/coupon_restrict.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/coupon_restrict.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/coupon_restrict.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: coupon_restrict.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TOP_BAR_TITLE', 'Statistik');
+define('HEADING_TITLE', 'Rabatt Kupon');
+define('HEADING_TITLE_STATUS', 'Status : ');
+define('TEXT_CUSTOMER', 'Kunde:');
+define('TEXT_COUPON', 'Kupon Name');
+define('TEXT_COUPON_ALL', 'Alle Kupons');
+define('TEXT_COUPON_ACTIVE', 'Aktive Kupons');
+define('TEXT_COUPON_INACTIVE', 'Inaktive Kupons');
+define('TEXT_SUBJECT', 'Betreff:');
+define('TEXT_FROM', 'Von:');
+define('TEXT_FREE_SHIPPING', 'Versandkostenfrei');
+define('TEXT_MESSAGE', 'Nachricht:');
+define('TEXT_SELECT_CUSTOMER', 'Kunde w&auml;hlen');
+define('TEXT_ALL_CUSTOMERS', 'Alle Kunden');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'An alle Newsletter-Abonnenten');
+define('TEXT_CONFIRM_DELETE', 'Sind Sie sicher, dass Sie diesen Kupon l&ouml;schen wollen?');
+
+define('TEXT_TO_REDEEM', 'Sie k&ouml;nnen diesen Kupon bei der Kasse einl&ouml;sen. Geben Sie nur den Code aus der Box ein, und klicken Sie den Einl&ouml;sen Button.');
+define('TEXT_IN_CASE', ' wenn Probleme auftauchen. ');
+define('TEXT_VOUCHER_IS', 'Der Kupon Code ist ');
+define('TEXT_REMEMBER', 'Verlieren Sie den Code nicht. Bewahren Sie ihn an einem sicheren Ort auf, damit Sie von diesem speziellen Angebot profitieren k&ouml;nnen.');
+define('TEXT_VISIT', 'wenn Sie besuchen ' . HTTP_SERVER . DIR_WS_CATALOG);
+define('TEXT_ENTER_CODE', ' und geben Sie den Code ein ');
+
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+
+
+define('NOTICE_EMAIL_SENT_TO', 'Achtung: Email an uns gesandt: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Fehler: Es wurde kein Kunde ausgew&auml;hlt!');
+define('COUPON_NAME', 'Kupon Name');
+//define('COUPON_VALUE', 'Kupon Wert');
+define('COUPON_AMOUNT', 'Kupon Betrag');
+define('COUPON_CODE', 'Kupon Code');
+define('COUPON_STARTDATE', 'G&uuml;ltig ab');
+define('COUPON_FINISHDATE', 'G&uuml;ltig bis');
+define('COUPON_FREE_SHIP', 'Versandkostenfrei');
+define('COUPON_DESC', 'Kupon Beschreibung');
+define('COUPON_MIN_ORDER', 'Kupon Minimum Bestellung');
+define('COUPON_USES_COUPON', 'Anwendungen pro Kupon');
+define('COUPON_USES_USER', 'Anwendungen pro Kunde');
+define('COUPON_PRODUCTS', 'G&uuml;ltige Produkt Aufz&auml;hlung');
+define('COUPON_CATEGORIES', 'G&uuml;ltige Kategorien Aufz&auml;hlung');
+define('VOUCHER_NUMBER_USED', 'Verwendete Anzahl');
+define('DATE_CREATED', 'Erstellt am');
+define('DATE_MODIFIED', 'Ge&auml;ndert am');
+define('TEXT_HEADING_NEW_COUPON', 'Neuen Kupon Erstellen');
+define('TEXT_NEW_INTRO', 'Bitte geben Sie die folgenden Information f&uuml;r den neuen Kupon an.<br>');
+
+
+define('COUPON_NAME_HELP', 'Ein kurzer Name f&uuml;r den Kupon');
+define('COUPON_AMOUNT_HELP', 'Der Wert des Rabatts für den Kupon, entweder absolut oder in % für einen Rabatt vom Gesamtbestellwert.');
+define('COUPON_CODE_HELP', 'Sie k&ouml;nnen Ihren eigenen Code eingeben, oder das Feld leer lassen, f&uuml;r einen automatisch generierten Code.');
+define('COUPON_STARTDATE_HELP', 'Das Datum, ab dem der Kupon g&uuml;ltig ist');
+define('COUPON_FINISHDATE_HELP', 'Das Datum an dem der Kupon abl&auml;uft');
+define('COUPON_FREE_SHIP_HELP', 'Der Kupon macht eine Bestellung versandkostenfrei. Achtung: Dies lässt die coupon_amount Einstellung unbeachtet, aber respektiert den Minimum-Bestellwert');
+define('COUPON_DESC_HELP', 'Eine Beschreibung des Kupons f&uuml;r den Kunden');
+define('COUPON_MIN_ORDER_HELP', 'Der Minimumbestellwert, bevor dieser Kupon g&uuml;ltig ist');
+define('COUPON_USES_COUPON_HELP', 'Die maximale Anzahl, die dieser Kupon benutzt werden kann; leer lassen für kein Limit.');
+define('COUPON_USES_USER_HELP', 'Anzahl, wie oft dieser Kupon benutzt werden kann; leer lassen für kein Limit.');
+define('COUPON_PRODUCTS_HELP', 'Eine Komma-getrennte Liste von product_ids, mit denen dieser Kupon benutzt werden kann; leer lassen für kein Einschr&auml;nkung.');
+define('COUPON_CATEGORIES_HELP', 'Eine Komma-getrennte Liste von cpaths, mit denen dieser Kupon benutzt werden kann; leer lassen für kein Einschr&auml;nkung.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/create_account.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: create_account.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Konto er&ouml;ffnen');
+define('HEADING_TITLE', 'Neukunden anlegen');
+define('HEADING_NEW', 'Bestellablauf');
+define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><b>HINWEIS:</b></font></small> Wenn Sie bereits ein Konto bei uns haben, melden Sie sich bitte bei der <a href="%s"><u>Anmeldeseite</u></a> an.');
+define('TEXT_VISITOR_CART', '<font color="#FF0000"><b> um Ihre Bestellung so rasch als m&ouml;glich bearbeiten zu k&ouml;nnen, ben&ouml;tigen wir noch folgende Informationen.</b></font>');
+define('TEXT_RETURN_CUSTOMER', '<font color="#FF0000">Sie haben bereits ein Profil? Bitte meledn Sie sich an!</font>');
+define('NAVBAR_NEW_TITLE', 'Bestellablauf');
+define('TEXT_PRIVACY', '<font color="#FF0000"><b>Sie haben bei uns noch nicht gekauft? Das Bestellen ist einfach. Bitte f&uuml;llen Sie alle notwendigen Felder aus, und klicken Sie dann den \'Weiter\' Button. </b>');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/create_account_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/create_account_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/create_account_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: create_account_process.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('NAVBAR_TITLE', 'Konto er&ouml;ffnen');
+define('HEADING_TITLE', 'Konto Information');
+define('HEADING_NEW', 'Bestellablauf');
+define('NAVBAR_NEW_TITLE', 'Bestellablauf');
+
+define('EMAIL_SUBJECT', 'Willkommen bei ' . STORE_NAME);
+define('EMAIL_GREET_MR', 'Sehr geehrter Herr. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_MS', 'Sehr geehrte Frau. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_NONE', 'Sehr geehrte/r ' . stripslashes($HTTP_POST_VARS['firstname']) . ',' . "\n\n");
+define('EMAIL_WELCOME', 'Wir heissen Sie herzlich willkommen bei <b>' . STORE_NAME . '</b>.' . "\n\n");
+define('EMAIL_TEXT', 'Sie k&ouml;nnen nun die <b>diversen Services</b>, die wir Ihnen anbieten, in Anspruch nehmen. Diese Services beinhalten:' . "\n\n" . '<li><b>Kundenwarenkorb</b> - Alle Produkte die Sie in Ihren Warenkorb legen, bleiben dort, bis Sie diese aus dem Warenkorb entfernen, oder bei uns bestellen.' . "\n" . '<li><b>Adressbuch</b> - Wir k&ouml;nnen Ihre Bestellung an eine andere Adresse, als Ihre eigene liefern! Dies ist besinders geeignet um Geburtstagsgeschenke direkt an das Geburtstagskind zu versenden.' . "\n" . '<li><b>Bestellhistorie</b> - Sehen Sie sich online an, welche Käufe Sie bei uns getätigt haben.' . "\n" . '<li><b>Produktbewertungen</b> - Teilen Sie Ihre Meinung über unsere Produkte auch anderen Kunden mit.' . "\n\n");
+define('EMAIL_CONTACT', 'Für Hilfe zu unseren Online-Services, senden Sie bitte eine Email an uns: ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n\n");
+define('EMAIL_WARNING', '<b>Hinweis:</b> Diese Emailadresse wurde uns von einem unserer Kunden genannt. Wenn Sie sich nicht für ein kostenloses Kundenkonto angemeldet haben, senden Sie bitte eine Email an uns: ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n");
+define('EMAIL_PASS_1', 'Das Passwort für Ihr Kundenkonto lautet ');
+define('EMAIL_PASS_2', ', bewaren Sie es an einem sicheren Ort. (Achten Sie bitte auf groß und Kleinschreibung.)');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Konto Erstellen');
+define('NAVBAR_TITLE_2', 'Erfolg');
+define('HEADING_TITLE', '<font color="#00CC33">Erfolg:&nbsp;&nbsp;</font>Kundenkonto wurde erstellt!');
+define('BUTTON_TITLE1', 'Sie können einen manuellen Auftrag jetzt nehmen:');
+define('BUTTON_TITLE2', 'Verursachen Sie ein anderes neues Kundenkonto:');
+define('BUTTON_TITLE3', 'Nehmen Sie zum Admin Home Page heraus:');
+
+define('IMAGE_BUTTON_CREATE_ORDER', 'verursachen Sie Auftrag');
+define('IMAGE_BUTTON_CREATE_CUSTOMER', 'neues customer');
+define('IMAGE_BUTTON_ADMIN_HOME', 'admin Haupt');
+
+define('TEXT_ACCOUNT_CREATED', '');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/create_order.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/create_order.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/create_order.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: create_order.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2004 osCommerce
+
+  Released under the GNU General Public License
+  
+*/
+define('HEADING_STEP1', 'Schritt 1 - Kunden ausw&auml;hlen & Details pr&uuml;fen');
+
+define('HEADING_STEP2', 'STEP 2 - Choose payment and Shipping Meathods for new order #');
+define('HEADING_INSTRUCT1', '!!! INSTRUCTIONS !!!');
+define('HEADING_INSTRUCT2', 'Note: If you edit the orders product quanities<br>
+              they will not update your stock levels with the<br>
+          changes.  So make sure you update them after this<br>
+          edit section.<br>');
+define('HEADING_STEP3', 'Step 3 ADD A NEW PRODUCT');
+define('HEADING_SHIPPING', 'Shipping Method:');
+
+define('TEXT_ADD_PROD_STEP1', 'STEP 1:');
+define('TEXT_ADD_STEP2', 'STEP 2:');
+define('TEXT_ADD_STEP3', 'STEP 3:');
+define('TEXT_ADD_STEP4', 'STEP 4:');
+
+define('HEADING_CREATE', 'Kunden Details pr&uuml;fen');
+
+define('TEXT_SELECT_CUST', 'Kunden ausw&auml;hlen:');
+define('TEXT_SELECT_CURRENCY', 'Select currency:');
+define('BUTTON_TEXT_SELECT_CUST', 'Kunden selektieren');
+define('TEXT_OR_BY', 'oder Kunden ID:');
+define('BUTTON_TEXT_CHOOSE_CUST', 'Kunden ID selektieren');
+define('BUTTON_SUBMIT', 'confirm');
+
+define('TEXT_ADD_PROD', 'Add Product ');
+define('TEXT_SELECT_PROD', 'Select this product');
+
+define('TEXT_ADD_CAT_CHOOSE', '--- CHOOSE A CATEGORY ---\n');
+define('TEXT_SELECT_CAT', 'Select this category');
+define('TEXT_ADD_PROD_CHOOSE', 'Add Product ');
+
+define('TEXT_SELECT_OPT', 'Select options');
+define('TEXT_SELECT_OPT_SKIP', 'No options for this product');
+
+define('TEXT_ADD_QUANTITY', ' Quantity');
+define('TEXT_ADD_NOW', 'Add Now!');
+define('TEXT_VIEW_CC', ' To View CC Fields');
+define('TEXT_VIEW_PO', ' or View PO Fields');
+
+define('TEXT_INFO_PO', 'PO Information:');
+define('TEXT_INFO_NAME', 'Account name:');
+define('TEXT_INFO_AC_NR', 'Account number:');
+define('TEXT_INFO_PO_NR', 'Purchase Order Nr:');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Please Select');
+define('TYPE_BELOW', 'Type Below');
+
+define('JS_ERROR', 'Errors have occured during the process of your form!\nPlease make the following corrections:\n\n');
+
+define('JS_GENDER', '* The \'Gender\' value must be chosen.\n');
+define('JS_FIRST_NAME', '* The \'First Name\' entry must have at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_LAST_NAME', '* The \'Last Name\' entry must have at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_DOB', '* The \'Date of Birth\' entry must be in the format: xx/xx/xxxx (month/day/year).\n');
+define('JS_EMAIL_ADDRESS', '* The \'E-Mail Address\' entry must have at least ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_ADDRESS', '* The \'Street Address\' entry must have at least ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_POST_CODE', '* The \'Post Code\' entry must have at least ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.\n');
+define('JS_CITY', '* The \'Suburb\' entry must have at least ' . ENTRY_CITY_MIN_LENGTH . ' characters.\n');
+define('JS_STATE', '* The \'State\' entry must be selected.\n');
+define('JS_STATE_SELECT', '-- Select Above --');
+define('JS_ZONE', '* The \'State\' entry must be selected from the list for this country.\n');
+define('JS_COUNTRY', '* The \'Country\' entry must be selected.\n');
+define('JS_TELEPHONE', '* The \'Telephone Number\' entry must have at least ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.\n');
+define('JS_PASSWORD', '* The \'Password\' and \'Confirmation\' entries must match and have at least ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.\n');
+
+define('CATEGORY_COMPANY', 'Company Details');
+define('CATEGORY_PERSONAL', 'Personal Details');
+define('CATEGORY_ADDRESS', 'Address');
+define('CATEGORY_CONTACT', 'Contact Information');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Password');
+define('CATEGORY_CORRECT', 'If this is the right customer, press the Confirm button below.');
+define('ENTRY_CUSTOMERS_ID', 'ID:');
+define('ENTRY_CUSTOMERS_ID_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COMPANY', 'Company Name:');
+define('ENTRY_NAME', 'Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Gender:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_GENDER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FIRST_NAME', 'First Name:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_FIRST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_LAST_NAME', 'Last Name:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_LAST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_LAST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_DATE_OF_BIRTH', 'Date of Birth:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<small><font color="#FF0000">(eg. 05/21/1970)</font></small>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '&nbsp;<small>(eg. 05/21/1970) <font color="#AABBDD">required</font></small>');
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">Your email address doesn\'t appear to be valid!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<small><font color="#FF0000">email address already exists!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_STREET_ADDRESS', 'Street Address:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_STREET_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Post Code:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_POSTCODE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_POST_CODE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_CITY_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_CITY_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_CITY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_CITY', 'City:');
+define('ENTRY_STATE', 'State/Province:');
+define('ENTRY_STATE_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_STATE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COUNTRY', 'Country:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_TELEPHONE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FAX_NUMBER', 'Fax Number:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Subscribed');
+define('ENTRY_NEWSLETTER_NO', 'Unsubscribed');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_PASSWORD_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_PASSWORD_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_PASSWORD_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+// manual order box text in includes/boxes/manual_order.php
+
+define('BOX_HEADING_MANUAL_ORDER', 'Manual Orders');
+define('BOX_MANUAL_ORDER_CREATE_ACCOUNT', 'Create Account');
+define('BOX_MANUAL_ORDER_CREATE_ORDER', 'Create Order');
+
+define('TITLE_1', 'Step-by-Step Manual Order Entry - Step 1');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/create_order_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/create_order_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/create_order_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: create_order_admin.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Bestellung anlegen');
+
+define('TEXT_CREATE_ORDERS_ADMIN_HELP', 'Mit den beiden Links k&ouml;nnen Sie die Versand- und Zahlart editieren.');
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Bestellung anlegen');
+define('TEXT_LABEL_CREATE_ORDERS_ADMIN_PAYMENT', 'Zahlart editieren');
+define('TEXT_LABEL_CREATE_ORDERS_ADMIN_SHIPPING', 'Versandart editieren');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie die notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_ORDERS_STATUS_NAME', 'Status der Bestellung:');
+define('TEXT_INFO_INSERT_INTRO', 'Bitte geben Sie eine Versandart mit allen Angaben ein');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher das Sie die Bezahlart l&ouml;schen wollen?');
+define('TEXT_INFO_HEADING_NEW_PAYMENT', 'Neue Zahlart');
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Zahlart editieren');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Zahlart l&ouml;schen');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'Neue Versandart');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Versandart editieren');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Versandart l&ouml;schen');
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'Fehler: Der standard Bestellstatus kann nicht gel&ouml;scht werden. Please set another order status as default, and try again.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Fehler: Dieser Bestellstatus wird von dieser Bestellung bereits benutzt.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Fehler: Dieser Bestellstatus ist bereits in der Bestellhistorie verwendet worden.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/create_order_payment.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/create_order_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/create_order_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: create_order_payment.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Bestellung manuell anlegen');
+
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Bestellung anlegen Admin');
+define('TABLE_HEADING_CREATE_ORDERS_SORT', 'Reihenfolge');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> Bezahl Modulen)');
+define('TEXT_INFO_EDIT_INTRO', 'Nehmen Sie bitte alle notwendigen &Auml;nderungen vor');
+define('TEXT_INFO_PAYMENT_MODULES_NAME', 'Bezahl Module:');
+define('TEXT_INFO_INSERT_INTRO', 'Tragen Sie die gew&uuml;nschte Bezahl Methode mit den gegebenen Daten ein');
+define('TEXT_INFO_DELETE_INTRO', 'Wollen SWie dieses Modul l&ouml;schen?');
+define('TEXT_INFO_HEADING_NEW_PAYMENT', 'Neue Bezahlung');
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Bezahlung bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Zahlung l&ouml;schen');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'Neuer Versand');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Versand bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Versand l&ouml;schen');
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS', 'FEHLER: Das Standard Bezahl Modul kann nicht gel&ouml;scht werden. Aktivieren Sie ein anderes Modul als Standard und versuchen Sie es erneut.');
+define('ERROR_STATUS_USED_IN_ORDERS', 'FEHLER: Dieses Modul wird derzeit in einer Bestellung verwendet.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'FEHLER: Dieses Modul wird derzeit in einem abgescvhlossenen Bestellvorgang verwendet.');
+define('TEXT_INFO_SORT_ORDER', 'Sortierreihenfolge');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/create_order_process.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/create_order_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/create_order_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: create_order_process.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_CREATE', 'Kundendetails &uuml;berpr&uuml;fen');
+define('DEFAULT_PAYMENT_METHOD', "Zahlarten f&uuml;r direkt Verkauf. Wir akzeptiern Barzahlung, Interac, Visa und Master Card.");
+define('TEXT_SUBTOTAL', "Zwischensumme :");
+define('TEXT_DISCOUNT', "Rabatt :");
+define('TEXT_DELIVERY', "Versand :");
+define('TEXT_TAX', "Steuern :");
+define('TEXT_TOTAL', "Summe :");
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/create_order_shipping.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/create_order_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/create_order_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: create_order_shipping.php,v 1.1 2004/08/19 23:38:51 teo Exp $
+  http://www.chainreactionworks.com
+
+  Copyright (c) 2005 chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Erstelle Bestellung Versand');
+
+define('TABLE_HEADING_CREATE_ORDERS_ADMIN', 'Erstelle Bestellung Versand');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENT_MODULES', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> Versand Modulen)');
+define('TEXT_INFO_EDIT_INTRO', 'Nehmen Sie bitte alle notwendigen &Auml;nderungen vor');
+define('TEXT_INFO_SHIPPING_MODULES_NAME', 'Versand Modul:');
+define('TEXT_INFO_INSERT_INTRO', 'Bitte installieren Sie das gew&uuml;nschte Versand Modul und tragen Sie die dementsprechenden Werte ein');
+define('TEXT_INFO_DELETE_INTRO', 'Wollen Sie dieses Versand Modul wirklich l&ouml;schen?');
+define('TEXT_INFO_SORT_ORDER', 'Sortierreihenfolge');
+
+define('TEXT_INFO_HEADING_EDIT_PAYMENT', 'Zahlung bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_PAYMENT', 'Zahlung l&ouml;schen');
+define('TEXT_INFO_HEADING_NEW_SHIPPING', 'Neuer Versand');
+define('TEXT_INFO_HEADING_EDIT_SHIPPING', 'Versand bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_SHIPPING', 'Versand l&ouml;schen');
+define('ERROR_STATUS_USED_IN_ORDERS', 'Fehler: Dieses Versand Modul wird derzeit in einer Bestellung benutzt.');
+define('ERROR_STATUS_USED_IN_HISTORY', 'Fehler: Dieses Versand Modul wird derzeit in einer abgeschlossenen Bestellung verwendet.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/crypt.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/crypt.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/crypt.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: crypt.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Titel');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Wert');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Nehmen Sie bitte alle notwendigen &Auml;nderungen vor');
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'WARNUNG!!!!  KEY Verzeichnis existiert nicht.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'WARNUNG!!!!  KEY Verzeichnis ist Schreibgesch&uuml;tzt.');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/crypt_convert.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/crypt_convert.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/crypt_convert.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Titel');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Wert');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+
+define('HEADING_TITLE_OID', 'Order ID:');
+define('HEADING_TITLE', 'Bestellungen mit Kredikarten Nummer');
+define('HEADING_TITLE_SEARCH', 'Bestell ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_CUSTOMERS', 'Kunden');
+define('TABLE_HEADING_ORDER_TOTAL', 'Summe Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Datum der &uuml;bertragung');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> This CC number is stored Encrypted </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>Warning !!!! This CC number is not stored Encrypted </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Is cc number encrypted');
+
+define('TEXT_KEY_CURRENT', 'Current key is: ');
+define('TEXT_CONVRT_ALL', 'Convert all CC data to new key');
+define('TEXT_KEY_NEW', 'New key is: ');
+define('TEXT_KEY_STATUS_01', '<font color=red> <b> This file does not have a key </b></font>');
+define('TEXT_KEY_STATUS_02', '<font color=blue> <b> OK! This file has a key</b></font>');
+define('TEXT_KEY_STATUS_03', '<font color=red> <b> Please edit the key files(s) in the key manager </b></font>');
+
+define('TEXT_INFO_DELETE_DATA', 'Kunden Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Bestellnummer  ');
+
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warnung!!!!  KEY Verzeichnis existiert nicht.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warnung!!!!  KEY Verzeichnis ist Schreibgesch&uuml;tzt');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/crypt_convert_1.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/crypt_convert_1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/crypt_convert_1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: crypt_convert.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Konvertiere Kreditkarten Daten in einen neuen KEYC');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> Diese Kreditkartennummer wurde verschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>WARNUNG !!!! Diese Kredikartennummer wurde nicht verschl&uuml;sselt gespeichert </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Kredikartennummer wurde verschl&uuml;sselt');
+define('CC_ENCYPT_ERROR_01', '<font color=blue> <b> Diese Nummer wurde bereits verschl&uuml;sselt </b></font>');
+
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Nehmen Sie bitte alle notwendigen &Auml;nderungen vor');
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warnung!!!!  KEY Verzeichnis existiert nicht.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warnung!!!!  KEY Verzeichnis ist Schreibgesch&uuml;tzt');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/crypt_purge.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/crypt_purge.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/crypt_purge.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: crypt_purge.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Titel');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Wert');
+
+define('HEADING_TITLE_OID', 'Bestell ID:');
+define('HEADING_TITLE', 'Kreditkarten Informationen aus Warenkorb entfernen');
+define('HEADING_TITLE_SEARCH', 'Bestell ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_CUSTOMERS', 'Kunden');
+define('TABLE_HEADING_ORDER_TOTAL', 'Bestellung Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Bezahlt am');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b>  Verschl&uuml;sselt </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b> Unverschl&uuml;sselt </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Verschl&uuml;sselungs Status');
+
+define('TEXT_KEY_CURRENT', 'Derzeitiger key lautet: ');
+define('TEXT_CONVRT_ALL', 'Konvertiere alle Kreditkarten Daten zu einem neuen Key');
+define('TEXT_KEY_NEW', 'Der neue Key ist: ');
+define('TEXT_KEY_STATUS_01', '<font color=red> <b> Diese Datei hat keinen Key </b></font>');
+define('TEXT_KEY_STATUS_02', '<font color=blue> <b> OK! Diese Datei hat einen Key</b></font>');
+define('TEXT_KEY_STATUS_03', '<font color=red> <b> Bitte editieren Sie die Keys in der Key Verwaltung </b></font>');
+
+
+define('TEXT_PURGE_ALL', 'Purge all CC data from cart');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Order Number  ');
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Delete Order');
+define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this order?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Restock product quantity');
+define('TEXT_DATE_ORDER_CREATED', 'Date Created:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'Warning!!!!  key directory does not exsists.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'Warning!!!!  key directory is not writeable so you can uploaded new key files');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/crypt_update.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/crypt_update.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/crypt_update.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: crypt_update.php,v 1.1 2005/08/16 00:36:41 zip1 Exp $
+
+    Copyright (c) 2005 
+    
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Titel');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Wert');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+
+define('HEADING_TITLE_OID', 'Bestell ID:');
+define('HEADING_TITLE', 'Entschl&uuml;sseln/Verschl&uuml;sseln: Bestellungen mit Kreditkarten benutzung');
+define('HEADING_TITLE_SEARCH', 'Bestell ID:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('TABLE_HEADING_COMMENTS', 'Kommentare');
+define('TABLE_HEADING_CUSTOMERS', 'Kunden');
+define('TABLE_HEADING_ORDER_TOTAL', 'Bestellung Total');
+define('TABLE_HEADING_DATE_PURCHASED', 'Bezahlt am');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TEXT_CARD_ENCRPYT', '<font color=green> <b> Diese Kredikartendaten wurde verschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>WARNUNG !!!! Diese Kreditkartendaten wurde nicht verschl&uuml;sselt gespeichert </b></font>');
+define('TABLE_HEADING_IS_ENCRYPTED', 'Kreditkartennummer verschl&uuml;sselt');
+define('CC_ENCYPT_ERROR_01', '<font color=blue> <b> Sorry, wurde bereits verschl&uuml;sselt </b></font>');
+define('CC_ENCYPT_ERROR_02', '<font color=blue> <b> Sorry, wurde bereits entschl&uuml;sselt </b></font>');
+define('TEXT_ENCRPYT_ALL', 'Verschl&uuml;ssle alle Kreditkartennummern');
+define('TEXT_DECRYPT_ALL', 'Entschl&uuml;ssle alle Kreditkartennummern');
+
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Bestellung l&ouml;schen');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher das Sie diese Bestellung l&ouml;schen m&ouml;chten?');
+define('TEXT_INFO_DELETE_DATA', 'Kunden Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Bestellnummer  ');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Anzahl dem Lager gutschreiben');
+define('TEXT_DATE_ORDER_CREATED', 'erstellt am:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Bezahl Metode:');
+
+define('TEXT_INFO_EDIT_INTRO', 'Nehmen Sie bitte alle notwendigen Änderungen vor');
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('ERROR_KEY_DIRECTORY_DOES_NOT_EXIST', 'WARNUNG!!!!  key Verzeichnis existiert nicht.');
+define('ERROR_KEY_DIRECTORY_NOT_WRITEABLE', 'WARNUNG!!!!  key Verzeichnis ist schreibgesch&uuml;tzt');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/currencies.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: currencies.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'W&auml;hrungen');
+
+define('TABLE_HEADING_CURRENCY_NAME', 'W&auml;hrung');
+define('TABLE_HEADING_CURRENCY_CODES', 'K&uuml;rzel');
+define('TABLE_HEADING_CURRENCY_VALUE', 'Wert');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_CURRENCY_TITLE', 'Name:');
+define('TEXT_INFO_CURRENCY_CODE', 'K&uuml;rzel:');
+define('TEXT_INFO_CURRENCY_SYMBOL_LEFT', 'W&auml;hrungssymbol Links:');
+define('TEXT_INFO_CURRENCY_SYMBOL_RIGHT', 'W&auml;hrungssymbol Rechts:');
+define('TEXT_INFO_CURRENCY_DECIMAL_POINT', 'Dezimalstellen Trennzeichen:');
+define('TEXT_INFO_CURRENCY_THOUSANDS_POINT', '1000er Trennzeichen:');
+define('TEXT_INFO_CURRENCY_DECIMAL_PLACES', 'Dezimalstellen:');
+define('TEXT_INFO_CURRENCY_LAST_UPDATED', 'Letzte Aktualisierung:');
+define('TEXT_INFO_CURRENCY_VALUE', 'Wert:');
+define('TEXT_INFO_CURRENCY_EXAMPLE', 'Beispiel:');
+define('TEXT_INFO_INSERT_INTRO', 'Bitte tragen Sie die neue W&auml;hrung mit allen relevanten Daten ein');
+define('TEXT_INFO_DELETE_INTRO', 'Wollen Sie diese W&auml;hrung wirklich l&ouml;schen?');
+define('TEXT_INFO_HEADING_NEW_CURRENCY', 'neue W&auml;hrung');
+define('TEXT_INFO_HEADING_EDIT_CURRENCY', 'W&auml;hrung bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_CURRENCY', 'W&auml;hrung l&ouml;schen');
+define('TEXT_INFO_SET_AS_DEFAULT', TEXT_SET_DEFAULT . ' (Ein manuelles Update der W&auml;hrungskurse ist notwendig)');
+define('TEXT_INFO_CURRENCY_UPDATED', 'Der Umrechnungskurs f&uuml;r %s (%s) wurde mit %s aktualisiert.');
+
+define('ERROR_REMOVE_DEFAULT_CURRENCY','Fehler: Die Standardw&auml;hrung kann nicht gel&ouml;scht werden. Legen Sie eine andere W&auml;hrung als Standard fest und versuchen Sie es noch einmal.');
+define('ERROR_CURRENCY_INVALID','Fehler: Der Umrechnungskurss f&uuml;r %s (%s) konnte mit %s nicht aktualisiert werden. Haben Sie den richtigen W&auml;hrungs-Code eingeben?');
+define('WARNING_PRIMARY_SERVER_FAILED','Warnung: Der prim&auml;re Aktualisierungs-Server (%s) konnte nach %s (%s) Versuchen nicht erreicht werden - Es wird versucht, die Aktualisierung &uuml;ber den sekund&auml;ren Server durchzuf&uuml;hren.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Kunden');
+define('HEADING_TITLE_SEARCH', 'Suche:');
+
+define('TABLE_HEADING_FIRSTNAME', 'Vorname');
+define('TABLE_HEADING_LASTNAME', 'Nachname');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Konto erstellt am');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_DATE_ACCOUNT_CREATED', 'Konto erstellt am:');
+define('TEXT_DATE_ACCOUNT_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_INFO_DATE_LAST_LOGON', 'letzte Anmeldung:');
+define('TEXT_INFO_NUMBER_OF_LOGONS', 'Anzahl der Anmeldungen:');
+define('TEXT_INFO_COUNTRY', 'Land:');
+define('TEXT_INFO_NUMBER_OF_REVIEWS', 'Anzahl der Produktbewertungen:');
+define('TEXT_DELETE_INTRO', 'Wollen Sie diesen Kunden wirklich l&ouml;schen?');
+define('TEXT_DELETE_REVIEWS', '%s Bewertung(en) l&ouml;schen');
+define('TEXT_INFO_HEADING_DELETE_CUSTOMER', 'Kunden l&ouml;schen');
+define('TYPE_BELOW', 'Bitte unten eingeben');
+define('PLEASE_SELECT', 'Ausw&auml;hlen');
+
+// Eversun mod for sppc and qty price breaks
+define('TABLE_HEADING_CUSTOMERS_GROUPS', 'Kunden&#160;Gruppen');
+define('TABLE_HEADING_REQUEST_AUTHENTICATION', 'RA');
+define('ENTRY_CUSTOMERS_PAYMENT_SET', 'Zahlart f&uuml; diesen Kunden definieren');
+define('ENTRY_CUSTOMERS_PAYMENT_DEFAULT', 'Die Einstellungen der Gruppe verwenden');
+define('ENTRY_CUSTOMERS_PAYMENT_SET_EXPLAIN', 'If you choose <b><i>Set payment modules for the customer</i></b> but do not check any of the boxes, default settings (Group settings or Configuration) will still be used.'); //DE
+define('ENTRY_CUSTOMERS_SHIPPING_SET', 'Versandart f&uuml;r diesen Kunden definieren');
+define('ENTRY_CUSTOMERS_SHIPPING_DEFAULT', 'Die Einstellungen der Gruppe verwenden');
+define('ENTRY_CUSTOMERS_SHIPPING_SET_EXPLAIN', 'If you choose <b><i>Set shipping modules for the customer</i></b> but do not check any of the boxes, default settings (Group settings or Configuration) will still be used.'); //DE
+define('ENTRY_CUSTOMERS_EMAIL_VALIDATED', 'Email Validierung');
+define('ENTRY_EMAILVALIDATE_YES', 'Ja');
+define('ENTRY_EMAILVALIDATE_NO', 'Nein');
+define('TEXT_EMAIL_VALIDATE_FEATURE','Require E-mail confirmation on account creation is set off.');
+
+define('ALT_IC_UP',' --> A-B-C From Top ');
+define('ALT_IC_DOWN',' --> Z-X-Y From Top ');
+define('ALT_IC_UP_NUM',' --> 1-2-3 From Top ');
+define('ALT_IC_DOWN_NUM',' --> 3-2-1 From Top ');
+define('TABLE_HEADING_CUSTOMERS_NO','No.');
+// Eversun mod end for sppc and qty price breaks
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/customers_groups.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/customers_groups.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/customers_groups.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+   for Separate Pricing Per Customer v4 2005/03/03
+   customers_groups.php
+*/
+  
+define('HEADING_TITLE', 'Gruppen');
+define('HEADING_TITLE_SEARCH', 'Suchen:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('ENTRY_GROUPS_NAME', 'Gruppenname:');
+define('ENTRY_GROUP_SHOW_TAX', 'Zeige&#160;Preis&#160;mit/ohne&#160;MwSt.:');
+define('ENTRY_GROUP_SHOW_TAX_YES', 'Preis inkl. MwSt.');
+define('ENTRY_GROUP_SHOW_TAX_NO', 'Preis ohne MwSt.');
+
+define('ENTRY_GROUP_TAX_EXEMPT', 'Steuerfrei:'); 
+define('ENTRY_GROUP_TAX_EXEMPT_YES', 'Ja'); 
+define('ENTRY_GROUP_TAX_EXEMPT_NO', 'Nein'); 
+
+define('ENTRY_GROUP_PAYMENT_SET', 'Bezahl Module für diese Gruppe setzen');
+define('ENTRY_GROUP_PAYMENT_DEFAULT', 'Einstellung der Konfiguration verwenden');
+define('ENTRY_PAYMENT_SET_EXPLAIN', 'If you choose <b><i>Set payment modules for the customer group</i></b> but do not check any of the boxes, default settings will still be used.');
+
+define('ENTRY_GROUP_SHIPPING_SET', 'Versand Module für diese Kunden Gruppe');
+define('ENTRY_GROUP_SHIPPING_DEFAULT', 'Einstellung der Konfiguration verwenden');
+define('ENTRY_SHIPPING_SET_EXPLAIN', 'If you choose <b><i>Set shipping modules for the customer group</i></b> but do not check any of the boxes, default settings will still be used.');
+
+define('TEXT_DELETE_INTRO', 'Wollen Sie diese Gruppe wirklich l&ouml;schen?');
+define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS_GROUPS', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> Kundengruppen)');
+define('TEXT_INFO_HEADING_DELETE_GROUP', 'Gruppe l&ouml;schen');
+
+define('ERROR_CUSTOMERS_GROUP_NAME', 'Bitte geben Sie einen Gruppennamen an');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/data.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/data.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/data.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+  data.php
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Daten Import/Export Verwaltung');
+
+define('HEADING_TITLE_1', 'Neue Feed Einstellungen erzeugen');
+define('HEADING_TITLE_2', 'Feed Einstellungen &auml;ndern');
+
+define('TABLE_HEADING_FEED_NAME', 'Name der Feed Einstellungen');
+define('TABLE_HEADING_FEED_DISC', 'Feed Beschreibung');
+
+
+define('TEXT_FEED_HELP', 'Bitte beachten Sie die Reihenfolge der einzelnen Schritte');
+
+define('TEXT_FEED_HELP_CONFIGURE', '1. Klicken Sie auf das Start Button um den Vorgang zu starten');
+define('TEXT_FEED_HELP_SELECT', '2. Klicken Sie auf das ' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO). ' f&uuml;r mehr Informationen');
+define('TEXT_FEED_HELP_PREFEED', '3. Konfiguration, Kategorien erzeugen, wiederholen, Feed &uuml;bertragen');
+define('TEXT_FEED_HELP_RUN', '');
+define('TEXT_FEED_HELP_NOTES', 'ACHTUNG: Feeds die mit einem * gekennzeichnet sind wurden nicht installiert');
+
+
+
+define('TEXT_FEED_FROOGLE', '<b> Froogle </b>');
+define('TEXT_FEED_YAHOO', '<b>Yahoo</b>');
+define('TEXT_FEED_BIZRATE', '<b>Bizrate</b>');
+define('TEXT_FEED', '<i>Feed:: </i>');
+define('TEXT_CONFIGURE', '<i>Konfigurieren: </i>');
+define('TEXT_SET_CATEGORIES', '<i>Kategorien setzen: </i>');
+define('TEXT_FEED_SELECT', '<i>Feed w&auml;hlen: </i>');
+define('TEXT_FEED_PRE_FEED', '<i>Feed neu generieren: </i>');
+define('TEXT_FEED_RUN', '<i>Feed &uuml;bermitteln: </i> ');
+
+define('TEXT_FEED_CONFIGURE_HELP1', 'Erzeuge oder ediere die allgemeine Konfiguration');
+define('TEXT_SET_CATEGORIES_HELP1', 'Sie m&uuml;ssen diesen Vorgang nicht jedesmal starten');
+define('TEXT_FEED_PRE_FEED_HELP1', 'Erzeuge Feed-Datei');
+define('TEXT_FEED_PRE_EDIT_HELP1', '&Uuml;berpr&uuml;fen Sie die Datei in einem Text Editor');
+define('TEXT_FEED_RUN_HELP1', 'Feed an Froogle senden');
+
+
+define('TEXT_INFO_FEED_NAME', 'Feed Name: ');
+define('TEXT_INFO_FEED_TYPE', 'Feed Typ: ');
+define('TEXT_INFO_FEED_SERVICE', 'Feed service: ');
+define('TEXT_INFO_FEED_STATUS', 'Status: ');
+
+
+define('TEXT_INFO_STATUS_CHANGE', 'Status &Auml;ndern:');
+
+define('TEXT_DISPLAY_NUMBER_OF_DATA', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> Datei Einstellungen)');
+define('IMAGE_NEW_SETTING', 'Neue Feed Einstellungen');
+
+define('WELCOME_TO_DATA_EXPORT_IMPORT_SYSTEM', 'Welcome to the Data Export/Import system');
+define('MSG_1', ' Please use the menu box to the left to select your task.<br><br> For in depth help use one of the links below <br><br>');
+define('MSG_2', 'Introduction to Data Export/Import system');
+define('MSG_3', 'Easy Populate:');
+define('MSG_4', 'EP Advance Import');
+define('MSG_5', 'EP Advance Export');
+define('MSG_6', 'EP Basic Import');
+define('MSG_7', 'EP Basic Export');
+define('MSG_8', 'Editing the export file');
+define('MSG_9', 'Data Feeder:');
+define('MSG_10', 'Introduction to data feed');
+define('MSG_11', '7 Steps to your First Froogle Feed');
+define('MSG_12', 'Configure a Feed');
+define('MSG_13', 'Run a Feed');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/data_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/data_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/data_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,82 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Data Verwaltung');
+
+define('HEADING_TITLE_1', 'Neue Feed Einstellungen hinzuf&uuml;gen');
+define('HEADING_TITLE_2', 'Feed Einstellungen &auml;ndern');
+
+define('TABLE_HEADING_PRODUCTS', 'Produkte');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TABLE_HEADING_FEED_NAME', 'Name des Feed');
+define('TABLE_HEADING_FEED_DISC', 'Data Feed Beschreibung');
+define('TABLE_HEADING_FEED_FILE_TYPE', 'Data Feed Datei Typ');
+define('TABLE_HEADING_FEED_TYPE', 'Feed Typ');
+define('TABLE_HEADING_FEED_TYPE_PRODUCT', 'Produkt Feed Typ');
+define('TABLE_HEADING_FEED', '<b>Froogle FTP Information</b>');
+define('TABLE_HEADING_FEED_ADVANCE', '<b>Froogle Erweiterte Einstellungen</b>');
+define('TABLE_HEADING_FEED_FEED_SERVICE', 'Feed Service');
+define('TABLE_HEADING_FEED_STATUS', 'Status');
+define('TABLE_HEADING_FEED_FILE', 'Dateiname');
+define('TABLE_HEADING_FEED_IMAGE', 'Bild URL');
+define('TABLE_HEADING_FEED_PRODUCT', 'Produkt URL');
+define('TABLE_HEADING_FEED_FTP_SERVER', 'Froogle FTP Server Name');
+define('TABLE_HEADING_FEED_FTP_USER', 'Froogle FTP Benutzer Name');
+define('TABLE_HEADING_FEED_FTP_PASSWORD', 'Froogle FTP Passwort');
+define('TABLE_HEADING_FEED_FTP_DIRECTORY', 'Froogle FTP Verzeichnis');
+define('TABLE_HEADING_FEED_CUR', 'Shop W&auml;hrung verwenden');
+define('TABLE_HEADING_FEED_CUR_USE', 'Andere W&auml;hrung');
+define('TABLE_HEADING_FEED_LANG', 'Shop Sprache verwenden');
+define('TABLE_HEADING_FEED_LANG_USE', 'Andere Sprache');
+define('TABLE_HEADING_FEED_CUR_CON', 'Konvertiere W&auml;hrung');
+define('TABLE_HEADING_FEED_TAX', 'MwSt. Klasse');
+
+define('TEXT_TYPE_BASIC', 'Basis');
+define('TEXT_TYPE_ADVANCE', 'Erweitert');
+define('TEXT_DATA_FEED_NAME', 'Feed Name');
+define('TEXT_TYPE_NONE', 'Keiner');
+define('TEXT_TYPE_PRODUCTS', 'Produkte');
+define('TEXT_TYPE_BUSINESS', 'Business');
+define('TEXT_FEED_FROOGLE', 'Froogle Feed');
+define('TEXT_FEED_YAHOO', 'Yahoo Feed');
+
+define('TEXT_DATA_ID_ACTIVE', 'Aktiv');
+define('TEXT_DATA_ID_DEACTIVE', 'Inaktiv');
+define('TEXT_DATA_VISIBLE_DO', 'Zum aktivieren &uuml;berpr&uuml;fen');
+
+define('TEXT_DATA_CUR_USE_FALSE', 'Falsch: Standard W&auml;hrung verwenden');
+define('TEXT_DATA_CUR_USE_TRUE', 'Wahr: W&auml;hrung wie unten aufgelistet verwenden');
+
+define('TEXT_DATA_CUR_CONVERT_FALSE', 'Falsch: Nicht zur W&auml;hrung konvertieren');
+define('TEXT_DATA_CUR_CONVERT_TRUE', 'Wahr: W&auml;hrung konvertieren');
+define('TEXT_DATA_CUR_LANG_FALSE', 'Falsch: Standard Sprache des Shops verwenden');
+define('TEXT_DATA_CUR_LANG_TRUE', 'Wahr: Sprache wie unten aufgelistet verwenden');
+define('TEXT_LANG_EN', 'Englisch');
+define('TEXT_LANG_FR', 'Französisch');
+define('TEXT_LANG_DE', 'Deutsch');
+define('TEXT_LANG_IT', 'Italien');
+define('TEXT_LANG_ES', 'Spanisch');
+define('TEXT_LANG_JA', 'Japanisch');
+
+define('TEXT_INFO_FEED_NAME', 'Feed Name: ');
+define('TEXT_INFO_FEED_TYPE', 'Feed Typ: ');
+define('TEXT_INFO_FEED_SERVICE', 'Feed service: ');
+define('TEXT_INFO_FEED_STATUS', 'Status: ');
+
+
+define('TEXT_INFO_STATUS_CHANGE', 'Status &auml;ndern:');
+
+define('TEXT_INFO_HEADING_DELETE_DATA', '&Louml;sche Data');
+define('TEXT_INFO_DELETE_INTRO', 'Möchten Sie diese Einstellung wirklich l&ouml;schen?');
+
+define('TEXT_DISPLAY_NUMBER_OF_DATA', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> data Einstellungen)');
+define('IMAGE_NEW_SETTING', 'Neue Feed Einstellungen');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/define_language.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/define_language.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/define_language.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: define_language.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Sprache Definieren');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'Datei nicht vorhanden.');
+
+define('ERROR_FILE_NOT_WRITEABLE', 'Fehler: Die Datei ist schreibgesch&uuml;tzt. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/define_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/define_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/define_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: define_language.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Hauptseite definieren');
+
+define('TEXT_FILE_DOES_NOT_EXIST', 'Datei existiert nicht.');
+
+define('ERROR_FILE_NOT_WRITEABLE', 'Fehler: die Datei ist schreibgesch&uuml;tzt, bitte &auml;nder Sie die Zugriffsrechte der Datei: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/document.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/document.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/document.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Dokumentation und Hilfe');
+
+define('HEADING_TITLE_1', 'Einstellungen der neuen Eintr&auml;ge');
+
+define('TABLE_HEADING_FEED_NAME', 'Name des Eintrags');
+
+define('BOX_DOC_LANGUAGE_EDIT', 'Sprache Editor');
+define('BOX_DOC_DATA', 'Daten im- und export');
+define('BOX_DOC_ADMIN', 'Admin');
+define('BOX_DOC_CAT', 'Katalog');
+define('BOX_DOC_MISC', 'Sonstiges');
+
+
+define('HEADING_TITLE_01', 'Hilfe: Anleitung ');
+define('HEADING_TITLE_02', 'Hilfe: Admin ');
+define('HEADING_TITLE_03', 'Hilfe: Katalog ');
+define('HEADING_TITLE_04', 'Hilfe: Sonstiges');
+
+define('MENU_ITEM_01', 'Anleitung');
+define('MENU_ITEM_02', 'Hilfe: Admin');
+define('MENU_ITEM_03', 'Hilfe: Katalog');
+define('MENU_ITEM_04', 'Hilfe: Sonstiges');
+
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/easypopulate.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/easypopulate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/easypopulate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+/*
+  $Id: easypopulate.php,v 1.4 2004/09/21  zip1 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Easy Populate Konfiguration');
+define('EASY_VERSION_A', 'Easy Populate Erweitert ');
+define('EASY_VERSION_B', 'Easy Populate Basic ');
+define('EASY_EXPORT', ' Export');
+define('EASY_IMPORT', ' Import');
+define('EASY_VER_A', ' 3.01');
+define('EASY_VER_B', ' 3.01');
+define('EASY_DEFAULT_LANGUAGE', '  -  Standard Sprache ');
+define('EASY_UPLOAD_FILE', 'Datei hochgeladen. ');
+define('EASY_UPLOAD_TEMP', 'Tempor&auml;rer Dateiname: ');
+define('EASY_UPLOAD_USER_FILE', 'Spezifischer Dateiname: ');
+define('EASY_SIZE', 'Gr&ouml;sse: ');
+define('EASY_FILENAME', 'Dateiname: ');
+define('EASY_SPLIT_DOWN', 'Datei erfolgreich in mehrere Dateien aufgeteilt. Die Teildateien liegen hier: ');
+define('EASY_UPLOAD_EP_FILE', 'EP Datei f&uuml;r Import hochladen');
+define('EASY_SPLIT_EP_FILE', 'EP Datei hochladen und aufteilen');
+define('EASY_SPLIT_EP_LOCAL', 'EP Datei auf dem Server aufteilen');
+
+define('TEXT_IMPORT_TEMP', 'Importiere Datei von %s');
+define('TEXT_INSERT_INTO_DB', 'In DB einf&uuml;gen');
+define('TEXT_SELECT_ONE', 'EP Datei f&uuml;r Import ausw&auml;hlen');
+define('TEXT_SELECT_TWO', 'EP Datei f&uuml;r Aufteilung ausw&auml;hlen');
+
+define('TEXT_SPLIT_FILE', 'EP Datei ausw&auml;hlen');
+define('TEXT_SPLIT', 'EP Datei aufteilen');
+
+define('EASY_LABEL_CREATE', 'Export Datei erzeugen');
+define('EASY_LABEL_CREATE_SELECT', 'Methode w&auml;hlen um die Datei zu speichern');
+define('EASY_LABEL_CREATE_SAVE', 'Im Temp Verzeichnis des Servers ablegen');
+define('EASY_LABEL_SELECT_DOWN', 'Felder w&auml;hlen die zu exportieren sind');
+define('EASY_LABEL_SORT', 'Sortierreihenfolge w&auml;hlen');
+define('EASY_LABEL_PRODUCT_RANGE', 'Nach Produkt ID sortieren');
+define('EASY_LABEL_LIMIT_CAT', 'Einschr&auml;nken nach Kategorie');
+define('EASY_LABEL_LIMIT_MAN', 'Einschr&auml;nken nach Hersteller');
+
+define('EASY_LABEL_PRODUCT_AVAIL', 'Verf&uuml;gbarer Bereich: ');
+define('EASY_LABEL_PRODUCT_TO', ' bis ');
+define('EASY_LABEL_PRODUCT_RECORDS', '    Anzahl an Eintr&auml;gen: ');
+define('EASY_LABEL_PRODUCT_BEGIN', 'Start: ');
+define('EASY_LABEL_PRODUCT_END', 'Ende: ');
+define('EASY_LABEL_PRODUCT_START', 'Mit erzeugen der Datei beginnen ');
+
+define('EASY_FILE_LOCATE', 'Das erzeugen Ihrer Exportdatei wird durchgef&uuml;hrt. Ihre Datei hat folgenden Namen: ');
+define('EASY_FILE_LOCATE2', 'Die Exportdatei wird zu Ihrem lokalen Computer gesendet und gespeichert. Ihre Datei hat folgenden Namen: ');
+
+define('EASY_FILE_LOCATE_2', ' wenn Sie diesen Link klicken wechseln Sie zum Dateimanager');
+define('EASY_FILE_RETURN', ' Sie k&ouml;nnen zu EP wechseln wenn sie diesen Link klicken.');
+define('EASY_IMPORT_TEMP_DIR', 'Importieren aus Temp Verzeichnis ');
+define('EASY_LABEL_DOWNLOAD', 'Download');
+define('EASY_LABEL_COMPLETE', 'Komplett');
+define('EASY_LABEL_TAB', 'tab-getrenntes .txt Datei zum bearbeiten');
+define('EASY_LABEL_MPQ', 'Modell/Preis/Stk');
+define('EASY_LABEL_EP_MC', 'Modell/Kategorie');
+
+define('EASY_LABEL_EP_ATTRIB', 'Attribute');
+define('EASY_LABEL_NONE', 'Keine');
+define('EASY_LABEL_CATEGORY', 'erster Kategorie Name');
+define('PULL_DOWN_MANUFACTURES', 'Hersteller');
+define('EASY_LABEL_PRODUCT', 'Produkt Nummer');
+define('EASY_LABEL_MANUFACTURE', 'Hersteller Nummer');
+define('EASY_LABEL_EP_MA', 'Modell/Attribute');
+define('EASY_LABEL_EP_FR_TITLE', 'Erzeuge EP oder Froogle Datei im Temp Verzeichnis ');
+define('EASY_LABEL_EP_DOWN_TAB', 'Erzeuge <b>Komplette</b> tab-getrenntes .txt Datei im Temp Verzeichnis');
+define('EASY_LABEL_EP_DOWN_MPQ', 'Erzeuge <b>Modell/Preis/Stk</b> tab-getrennte .txt Datei im Temp Verzeichnis');
+define('EASY_LABEL_EP_DOWN_MC', 'Erzeuge <b>Modell/Kategorie</b> tab-getrennte .txt Datei im Temp Verzeichnis');
+define('EASY_LABEL_EP_DOWN_MA', 'Erzeuge <b>Modell/Attribute</b> tab-getrennte .txt Datei im Temp Verzeichnis');
+define('EASY_LABEL_EP_LIMIT', 'Beschr&auml;nken Sie die Anzahl der Produkte die exportiert werden sollen');
+define('EASY_LABEL_NEW_PRODUCT', "<font color='green'> !Neues Produkt!</font><br>");
+define('EASY_LABEL_UPDATED', "<font color='blue'> Aktuallisiert</font><br>");
+define('EASY_LABEL_DELETE_STATUS_1', "<font color='red'> !!Produkt gel&ouml;scht ");
+define('EASY_LABEL_DELETE_STATUS_2', " von der Datenbank !!</font><br>");
+define('EASY_LABEL_LINE_COUNT_1', 'hinzugef&uuml;gt ');
+define('EASY_LABEL_LINE_COUNT_2', 'Aufzeichnungen und schließende Datei... ');
+define('EASY_LABEL_FILE_COUNT_1A', 'Erzeuge EPA_Aufgeteilte Datei ');
+define('EASY_LABEL_FILE_COUNT_1B', 'Erzeuge EPA_Aufgeteilte Datei ');
+define('EASY_LABEL_FILE_COUNT_2', '.txt ...  ');
+define('EASY_LABEL_FILE_CLOSE_1', 'hinzugef&uuml;gt ');
+define('EASY_LABEL_FILE_CLOSE_2', ' Aufzeichnungen und schließende Datei...');
+define('EASY_LABEL_FILE_INSERT_LOCAL', 'Lokale Datei importieren: ');
+define('TEXT_INFO_TIMER', 'Script timer:');
+define('TEXT_INFO_SECOND', 'sekunden.');
+
+//errormessages
+define('EASY_ERROR_1', 'Fehler 01 - Merkw&uuml;rdig aber es gibt keine Standard Sprache, zum arbeiten… Das kann m&ouml;glicherweise nicht abgearbeitet werden, gerade deswegen…');
+define('EASY_ERROR_2', '... Fehler 02 - Zu viele Buchstaben in Modellnummer.<br>
+      25 ist das Maximum in diesem Shop.<br>
+      Ihre maximale Zeichenl&auml;nge von Produkt_Modell ist auf folgenden Wert gesetzt ');
+define('EASY_ERROR_2A', ' <br>Sie m&uuml;ssen entweder die Modell Nummer k&uuml;rzen oder die Datenbank dementsprechend &auml;ndern</font>');
+define('EASY_ERROR_2B',  "<font color='red'>");
+define('EASY_ERROR_3', '<p class=smallText> Fehler 03 - Keine Produkt Nummer vorhanden oder an der falschen Position. Diese Zeile wurde nicht importiert.<br><br>');
+define('EASY_ERROR_4', '<font color=red>Fehler 04 - Kundengruppen Nummer und Kundenpreis m&uuml;ssen zusammen passen</font>');
+define('EASY_ERROR_5', '</b><font color=red>Fehler 05 - Sie versuchen eine Mit EP Erweitert erstellte Datei zu verwenden bitte versuchen Sie es auch mit EP Erweitert die Datei zu nutzen </font>');
+define('EASY_ERROR_5a', '<font color=red><b><u>  Klicken Sie hier um zu EP Basic zu wechseln </u></b></font>');
+define('EASY_ERROR_6', '</b><font color=red>Fehler 06 - Sie versuchen eine Mit EP Basic erstellte Datei zu verwenden bitte versuchen Sie es auch mit EP Basic die Datei zu nutzen </font>');
+define('EASY_ERROR_6a', '<font color=red><b><u>  Klicken Sie hier um zu EP Erweitert zu wechseln </u></b></font>');
+define('EASY_ERROR_7', '<p class=smallText> Fehler 07 - Keine Modul Nummer vorhanden oder an der falschen Position. Diese Zeile wurde nicht importiert. <br><br>');
+
+// Eversun mod for Easy Populate Products Options, Values and Attributes
+define('EASY_VERSION_C', 'Easy Populate Optionen');
+define('EASY_LABEL_OPTIONS_ID', 'Option ID');
+define('EASY_LABEL_OPTIONS_NAME', 'Option Name');
+define('EASY_VERSION_D', 'Easy Populate Werte');
+define('EASY_LABEL_VALUES_ID', 'Wert ID');
+define('EASY_LABEL_VALUES_NAME', 'Wert Name');
+define('EASY_VERSION_E', 'Easy Populate Attribute');
+define('TEXT_SELECT_ONE_OPTIONS', 'W&aumlHlen Sie eine EP Options Datei f&uuml;r Import');
+define('TEXT_SELECT_ONE_VALUES', 'W&aumlHlen Sie eine EP Werte Datei f&uuml;r Import');
+define('TEXT_SELECT_ONE_ATTRIBUTES', 'W&aumlHlen Sie eine EP Attribute Datei f&uuml;r Import');
+define('EASY_ERROR_8', '<b><font color=red>Error - Sie haben keine Datei gew&auml;hlt</font></b>');
+define('EASY_INFO_SUCCESS', '<b><font color=red>Import Erfolgreich</font></b>');
+define('EASY_INFO_FILE_NOT_FOUND', '<b><font color=red>Datei nicht gefunden</font></b>');
+define('EASY_INFO_CHECK_ERROR1', '<b><font color=red>Feld %s Ist nicht in der Tabelle %s vorhanden.</font></b>');
+// Eversun mod end for Easy Populate Products Options, Values and Attributes
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/edit_key.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/edit_key.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/edit_key.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define ('HEADING_TITLE', 'Keydateien verwalten');
+define ('HELP_URL', DIR_WS_ADMIN . 'et_help/index.html');
+
+define('BUTTON_TEXT_SAVE_CHANGES', '&Auml;nderungen speichern');
+define('BUTTON_TEXT_RESTORE_FILE', 'R&uuml;sichern der Datei');
+define('BUTTON_TEXT_RETURN_MAIN_EDIT', 'Zur Konfiguration zur&uuml;ckkehren');
+define('TEXT_RETURN_MAIN', 'Zur&uuml;ck zur Dateiliste');
+
+define('ERROR_TEXT_FILE_LOCKED', "Fehler: Datei '%s' ist schreibgesch&uuml;tzt");
+define('ERROR_TEXT_FILE_LOCKED1', "ERROR: The Key file: %s is not writable, to Edit the key you must change it's permissions to 777");
+
+define('ERROR_TEXT_FILE_OK', "Ok to edit the key file: %s it is writable");
+
+
+define('TEXT_HIDE_NAVIGATION', 'Navigation unterdr&uuml;cken');
+define('TEXT_SHOW_NAVIGATION', 'Navigation anzeigen');
+
+define('TEXT_HELP_HELP', 'Hilfe');
+define('TEXT_HELP_HELP1', '1. Auf den editier Knopf zum editieren dr&uuml;cken .');
+define('TEXT_HELP_HELP2', '2. Nach dem Editieren Speichern dr&uuml;cken.');
+define('TEXT_HELP_HELP3', '3. Wenn Sie gespeichert haben, aus R&uuml;cksichern klicken, um die Orginaldatei wieder herzustellen.');
+define('TEXT_HELP_HELP4', '4. Auf erstellen klicken um eine neue Keydatei zu erstellen.');
+define('TEXT_HELP_HELP5', '5. Auf zur&uuml;k klicken um zum Hauptmenu zur&uuml;ckzukehren.');
+
+define('TEXT_CRYPT_MESSAGE_1', 'Prim&auml;re Keydatei');
+define('TEXT_CRYPT_MESSAGE_2', 'Neue Keydatei');
+define('TEXT_CRYPT_MESSAGE_3', 'Unbekannt');
+
+define('TABLE_HEADING_FILE_TYPE', 'Datei Typ');
+define('TABLE_HEADING_FILE_NAME', 'Datei Name');
+define('TABLE_HEADING_FILE_ACTION', 'Aktion');
+
+define('EDIT_ACTION', 'Edit :');
+define('SAVED_ACTION', 'Saved file :');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/edit_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/edit_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/edit_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+<?php
+/*
+  $Id: edit_orders.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Bestellung &auml;ndern');
+define('HEADING_TITLE_NUMBER', 'Nr.');
+define('HEADING_TITLE_DATE', 'of');
+define('HEADING_SUBTITLE', 'Please edit all parts as desired and click on the "Update" button below.');
+define('HEADING_TITLE_SEARCH', 'Bestellnummer:');
+define('HEADING_TITLE_STATUS', 'Status:');
+define('ADDING_TITLE', 'Produkt zu Bestellung hinzuf&uuml;gen');
+
+define('ADD_PRODUCT', 'Add a Product to Order');
+define('HEADING_ABANDONED', '<B>Dieser Auftrag wurde weder abgeschlossen noch aufgegeben!!! Bestell ID:  </B>');
+
+
+define('ENTRY_UPDATE_TO_CC', '(Aktuallisier zu <b>Kreditkarte</b> um die Kreditkarten Felder zu sehen.)');
+define('HINT_DELETE_POSITION', '<font color="#FF0000">Hinweis: </font>Um die Position zu l&ouml;schen setzen Sie die St&uuml;ckzahl auf "0".');
+define('HINT_TOTALS', '<font color="#FF0000">Hinweis: </font>Um einen Nachlass zu geben setzen sie einen negatieven Betrag.<br>Felcder mit "0" werden gel&ouml;scht wenn die Bestellung aktuallisiert wird.r (Ausnahme: Versand).');
+define('HINT_PRESS_UPDATE', 'Klicken Sie auf "Update" um alle &Auml;nderungen zu speichern.');
+define('TABLE_HEADING_COMMENTS', 'Kommentar');
+define('TABLE_HEADING_CUSTOMERS', 'Kunde');
+define('TABLE_HEADING_ORDER_TOTAL', 'Gesamtwert');
+define('TABLE_HEADING_DATE_PURCHASED', 'Bestelldatum:');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_QUANTITY', 'Anzahl');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Produkt-Nr.');
+define('TABLE_HEADING_PRODUCTS', 'Produkt');
+define('TABLE_HEADING_TAX', 'MwSt.');
+define('TABLE_HEADING_TOTAL', 'Gesamtsumme');
+define('TABLE_HEADING_UNIT_PRICE', 'St&uuml;ckpreis');
+define('TABLE_HEADING_BASE_PRICE', 'Grundpreis');
+define('TABLE_HEADING_UNIT_PRICE_TAXED', 'Preis (inkl.)');
+define('TABLE_HEADING_TOTAL_PRICE', 'Gesamtpreis');
+define('TABLE_HEADING_TOTAL_PRICE_TAXED', 'Total (inkl.)');
+define('TABLE_HEADING_TOTAL_MODULE', 'Gesamt Preis Komponente');
+define('TABLE_HEADING_TOTAL_AMOUNT', 'Menge');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Kunde benachrichtigt');
+define('TABLE_HEADING_DATE_ADDED', 'hinzugef&uuml;gt am:');
+
+define('ENTRY_CUSTOMER', 'Kunde:');
+define('ENTRY_CUSTOMER_NAME', 'Name');
+define('ENTRY_CUSTOMER_COMPANY', 'Firma');
+define('ENTRY_CUSTOMER_ADDRESS', 'Adresse');
+define('ENTRY_CUSTOMER_SUBURB', 'Stadtteil');
+define('ENTRY_CUSTOMER_CITY', 'Stadt');
+define('ENTRY_CUSTOMER_STATE', 'Bundesland');
+define('ENTRY_CUSTOMER_POSTCODE', 'PLZ');
+define('ENTRY_CUSTOMER_COUNTRY', 'Land');
+define('ENTRY_CUSTOMER_PHONE', 'Telefon');
+define('ENTRY_CUSTOMER_EMAIL', 'E-Mail');
+define('ENTRY_SOLD_TO', 'Verkauft an:');
+define('ENTRY_DELIVERY_TO', 'Lieferanschrift:');
+define('ENTRY_SHIP_TO', 'Lieferanschrift:');
+define('ENTRY_SHIPPING_ADDRESS', 'Versandadresse:');
+define('ENTRY_BILLING_ADDRESS', 'Rechnungsadresse:');
+define('ENTRY_PAYMENT_METHOD', 'Zahlungsweise:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Kreditkartentyp:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Kreditkarteninhaber:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Kerditkartennnummer:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Kreditkarte l&auml;uft ab am:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV/CVC/CSC code: ');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Datum: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Nummer: ');
+define('ENTRY_SUB_TOTAL', 'Zwischensumme:');
+define('ENTRY_TAX', 'MwSt.:');
+define('ENTRY_SHIPPING', 'Versandkosten:');
+define('ENTRY_TOTAL', 'Gesamtsumme:');
+define('ENTRY_DATE_PURCHASED', 'Bestelldatum:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'letzte Aktualisierung am:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Kunde benachrichtigen:');
+define('ENTRY_NOTIFY_COMMENTS', 'Kommentare mitsenden:');
+define('ENTRY_PRINTABLE', 'Rechnung drucken');
+define('ENTRY_CUSTOMER_DISCOUNT', 'Verwenden Sie einen negativen Wert -1.00 ');
+define('ENTRY_CUSTOMER_GV', 'Nachlass/Geschenkgutschein: ');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Bestellung l&ouml;schen');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, das Sie diese Bestellung l&ouml;schen m&ouml;chten?');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Produktanzahl dem Lager gutschreiben');
+define('TEXT_DATE_ORDER_CREATED', 'erstellt am:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_DATE_ORDER_ADDNEW', 'Neues Produkt hinzuf&uuml;gen');
+define('TEXT_INFO_PAYMENT_METHOD', 'Zahlungsweise:');
+
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> Die Kreditkartennummer wurde verschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>WARNUNG !!!! Diese Kreditkartennummer wurde nicht verschl&uuml;sselt gespeichert</b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> Das Kreditkarten Verfallsdatum wurde verschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>WARNUNG !!!! Das Kreditkarten Verfallsdatum wurde unverschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> Der Kreditkartenvorgang wurde verschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>WARNUNG !!!! Der Vorgang wurde verschl&uuml;sselt gespeichert. Sollten dioe Felder leer sein ignorieren Sie diese Meldung</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> This CC expire date has been removed from the store.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> CCV Code:  Not stored - due to processing regulations. Enable CCV email in module settings.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> This CC number is not store or has been removed from the store.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Address:');
+define('ENTRY_IPISP', 'ISP:');
+
+define('TEXT_ALL_ORDERS', 'Alle Bestellungen');
+define('TEXT_NO_ORDER_HISTORY', 'Keine Bestellhistorie verf&uuml;gbar');
+
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Statusänderung Ihrer Bestellung');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Bestell-Nr.:');
+define('EMAIL_TEXT_INVOICE_URL', 'Ihre Bestellung k&ouml;nnen Sie unter folgender Adresse einsehen:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Bestelldatum:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Der Status Ihrer Bestellung wurde geändert.' . "\n\n" . 'Neuer Status: %s' . "\n\n" . 'Bei Fragen zu Ihrer Bestellung antworten Sie bitte auf diese Email.' . "\n\n" . 'Mit freundlichen Grüssen' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'Anmerkungen und Kommentare zu Ihrer Bestellung:' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Fehler: Die Bestellung existiert nicht!.');
+define('SUCCESS_ORDER_UPDATED', 'Hinweis: Die Bestellung wurde erfolgreich aktualisiert.');
+define('WARNING_ORDER_NOT_UPDATED', 'Hinweis: Es wurde nichts ge&auml;ndert. Daher wurde diese Bestellung nicht aktualisiert.');
+define('SUCCESS_PRODUCT_ADDED', 'Success : This order has been updated and a new product has been added');
+define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_PRODUCT', 'Produkt w&auml;hlen');
+define('ADDPRODUCT_TEXT_PRODUCT_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_SELECT_OPTIONS', 'Option w&auml;hlen');
+define('ADDPRODUCT_TEXT_OPTIONS_CONFIRM', 'OK');
+define('ADDPRODUCT_TEXT_OPTIONS_NOTEXIST', 'Produkt hat keine Optionen, wird abgebrochen...');
+define('ADDPRODUCT_TEXT_CONFIRM_QUANTITY', 'Anzahl des Produkts');
+define('ADDPRODUCT_TEXT_CONFIRM_ADDNOW', 'hinzuf&uuml;gen');
+define('ADDPRODUCT_TEXT_STEP', 'Schritt');
+define('ADDPRODUCT_TEXT_STEP1', ' &laquo; Katalog w&auml;hlen. ');
+define('ADDPRODUCT_TEXT_STEP2', ' &laquo; Produkt w&auml;hlen. ');
+define('ADDPRODUCT_TEXT_STEP3', ' &laquo; Option w&auml;hlen. ');
+
+define('MENUE_TITLE_CUSTOMER', '1. Kundendaten');
+define('MENUE_TITLE_PAYMENT', '2. Bezahl Optionen');
+define('MENUE_TITLE_ORDER', '3. Bestellte Produkte');
+define('MENUE_TITLE_TOTAL', '4. Nachlass, Versand und Gesamt');
+define('MENUE_TITLE_STATUS', '5. Status und Benachrichtigungen');
+define('MENUE_TITLE_UPDATE', '6. Daten aktuallisieren');
+
+define('DISPLAY_BASKET', 'Anzeige Korb');
+define('DONT_ADD_NEW_PRODUCT', 'Addieren Sie Nicht Neues Produkt');
+define('SELECT_THESE_OPTIONS', "Wählen Sie Diese Wahlen Vor");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/edit_textdata.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/edit_textdata.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/edit_textdata.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: edit_textdata.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define ('HEADING_TITLE', 'Sprachanzeigen bearbeiten');
+
+define('BUTTON_TEXT_SAVE_CHANGES', '&Auml;nderungen Sichern');
+define('BUTTON_TEXT_RESTORE_FILE', 'Datei wiederherstellen');
+define('BUTTON_TEXT_RETURN_MAIN_EDIT', 'Hauptbearbeitungsfenster');
+define('TEXT_RETURN_MAIN', 'Return to main file list');
+
+define('ERROR_TEXT_FILE_LOCKED', "Fehler: Die Datei '%s' ist schreibgesch&uuml;tzt.");
+
+define('TEXT_HIDE_NAVIGATION', 'Navigation ausblenden');
+define('TEXT_SHOW_NAVIGATION', 'Navigation anzeigen');
+
+define('TEXT_HELP_HELP', '<b>Hilfe</b>');
+define('TEXT_HELP_HELP1', '1. Klicken sie auf bearbeiten um den Eintrag zu &auml;ndern.');
+define('TEXT_HELP_HELP2', '2. Wenn das Editieren abgeschlossen ist bitte speichern.');
+define('TEXT_HELP_HELP3', '3. Tempor&auml;r gespeichert, klicken sie auf zur&uuml;ck um den Vorgang abzubrechen.');
+define('TEXT_HELP_HELP4', '4. Klicken Sie auf einf&uuml;gen um eine neue Definition einzubinden.');
+define('TEXT_HELP_HELP5', '5. Klicken Sie auf zur&uuml;ck um auf den Start Bildschrim der Sprachdefinitionen zu gelangen.');
+
+define('TEXT_DEFINE_LABEL', '<b>Definiere Label</b>');
+define('TEXT_DEFINE_TEXT', '<b>Definiere Anzeigetext</b>');
+define('TEXT_RESTORE_FILE', 'Speichern Datei : ');
+define('TEXT_EDIT_FILE', 'Editiere Datei: ');
+define('TEXT_SAVE_FILE', 'R&uuml;cksichern Datei : ');
+
+define('TABLE_HEADING_FILE_TYPE', 'Datei Typ');
+define('TABLE_HEADING_FILE_NAME', 'Datei Name');
+define('TABLE_HEADING_FILE_ACTION', 'Aktion');
+
+define('TEXT_MIXED_CONSTANT', 'Diese Variable ist mehrfach vorhanden. Bitte verwenden Sie den erweiterten Editor um die Datei zu bearbeiten %s(nach unten)%s');
+define('TEXT_ADV_EDITOR', 'Seiten Editor - Nur f&uuml;r Poweruser');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/email_subjects.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/email_subjects.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/email_subjects.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: email_subjects.php, v1 07/11/2005
+
+  Copyright (c) 2005 PassionSeed
+  http://PassionSeed.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'EMail Betreffzeilen');
+
+define('TABLE_HEADING_EMAIL_SUBJECTS', 'Kontaktieren Sie uns EMail Betreffzeilen');
+define('TABLE_HEADING_EMAIL_SUBJECTS_CATEGORY', 'Betreff Kategorie');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_HEADING_NEW_EMAIL_SUBJECT', 'Neue Betreffzeile');
+define('TEXT_HEADING_EDIT_EMAIL_SUBJECT', 'Betreffzeile bearbeiten');
+define('TEXT_HEADING_DELETE_EMAIL_SUBJECT', 'Betreffzeile l&ouml;schen');
+
+define('TEXT_EMAIL_SUBJECTS', 'EMail Betreffzeile:');
+define('TEXT_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+
+define('TEXT_NEW_INTRO', 'Bitte f&uuml;llen Sie die nachfolgenden Felder vollst&auml;ndig aus umd die neue Betreffzeile einzupflegen');
+define('TEXT_EDIT_INTRO', 'Nehmen Sie bitte alle notwendigen &Auml;nderungen vor');
+
+define('TEXT_EMAIL_SUBJECTS_NAME', 'Betreffzeilen Name:');
+define('TEXT_EMAIL_SUBJECTS_CATEGORY', 'Betreffzeilen Beschreibung:');
+define('TEXT_EMAIL_SUBJECTS_CATEGORY_CHOICE', '1 = Admin; 2 = Kunden');
+
+define('TEXT_DELETE_INTRO', 'Sind Sie sich sicher das Sie diesen Eintrag l&ouml;schen m&ouml;chten?');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'FEHLER: Verzeichnis ist Schreibgesch&uuml;zt. Bitte &auml;ndern Sie die Berechtigung in diesem Verzeichnis: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'FEHLER: Verzeichnis existiert nicht: %s');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/events_calendar.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/events_calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/events_calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: events_calendar v1.00 2003/03/08 18:09:16 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+
+  define('NAVBAR_TITLE', 'Event Kalender');
+  define('HEADING_TITLE', 'Event Kalender');
+  define('TEXT_SELECT_EVENT', 'Event ausw&auml;hlen');
+  
+  define('TEXT_EVENTS_FOR', 'Event von ');
+  define('TEXT_EVENT_DATE', 'Datum :');
+  define('TEXT_EVENTS_START', 'Event startet am ');
+  define('TEXT_EVENT_START_DATE', 'Von :');
+  define('TEXT_EVENT_END_DATE', 'Bis :');
+  define('TEXT_EVENT_LINK', 'Link :');
+  define('TEXT_EVENT_OSC_LINK', 'OSC link :');
+  define('TEXT_EVENT_TITLE', 'Titl :');
+  define('TEXT_EVENT_DESCRIPTION', 'Event :');
+  define('TEXT_EVENT_MORE', '... Weiter >>');
+  define('TEXT_NO_EVENTS', 'Kein Event gefunden.');
+  define('TEXT_OTHER_EVENTS', 'Weiter am heutigen Tage :');
+
+  define('TEXT_DISPLAY_NUMBER_OF_EVENTS', 'Anzeige Event n° <b>%d</b><b>%_</b> von <b>%d</b> für ');
+  define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> Events) ');
+  define('MAX_DISPLAY_PAGE_LINKS', 5);
+  define('MAX_DISPLAY_NUMBER_EVENTS', 5);
+  
+  define('BOX_CALENDAR_TITLE', ' Alle anzeigen');
+  define('BOX_GO_BUTTON', 'Start');
+  define('BOX_GO_BUTTON_TITLE', ' Start Monats&uuml;berblick ');
+  define('BOX_TODAY_BUTTON', ' T ');
+  define('BOX_TODAY_BUTTON_TITLE', ' Diesen Monat anzeigen ');
+  define('BOX_YEAR_VIEW_BUTTON', ' Y ');
+  define('BOX_YEAR_VIEW_BUTTON_TITLE', ' Jahres &Uuml;berblick ');
+  define('BOX_NEXT_LINK', 'N&auml;chster Monat');
+  define('BOX_PREV_LINK', 'Vorheriger Monat');
+  define('BOX_CLICK_LINK', 'Start');
+  
+  define('FIRST_DAY_OF_WEEK', 0);// First day of the week  1=Monday 0=Sunday;
+
+  define('NUMBER_OF_YEARS', 5);  //n° of years to be shown in drop-down
+  
+  define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
+  
+
+  
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/events_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/events_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/events_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,64 @@
+<?php
+/*
+  $Id: events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Event Verwaltung');
+define('DELETE_EVENTS_ERROR', 'Bitte Datum selektieren.');
+define('EVENTS_ERROR', 'Fehler.\n\n');
+
+define('TABLE_HEADING_ID', 'Event ID');
+define('TABLE_HEADING_SIZE', 'Gr&ouml;&szlig;e');
+define('TABLE_HEADING_TITLE', 'Titl');
+define('TABLE_HEADING_DATE_ADDED', 'Datum hinzugef&uuml;gt');
+define('TABLE_HEADING_DATE_START', 'Start Datum');
+define('TABLE_HEADING_DATE_END', 'Ende Datum');
+define('TABLE_HEADING_LINKS', 'Link / OSClink');
+define('TABLE_HEADING_OSC_LINK', 'OSC Link');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TEXT_NO_EVENTS', 'Keine Events gefunden.');
+
+define('TEXT_EVENT_TITLE', 'Titel:');
+define('TEXT_EVENT_DESCRIPTION', 'Event:');
+
+define('TEXT_EVENT_ID', 'Event ID:');
+define('TEXT_EVENT_DATE_ADDED', 'Datum hinzugef&uuml;gt:');
+
+define('TEXT_EVENT_START', 'Start Datum:');
+define('TEXT_EVENT_END', 'Ende Datum:');
+define('TEXT_CHOOSE_MANUFACTURER', 'Hersteller:');
+define('TEXT_CHOOSE_CATEGORY', 'Kategorie:');
+define('TEXT_CHOOSE_PRODUCT', 'Produkt:');
+define('TEXT_NO_PRODUCTS', 'Kein Produkte');
+define('TEXT_CHOOSE_UPCOMING', 'Neuerscheinungen:');
+define('TEXT_NO_UPCOMING_PRODUCTS', 'Keine Neuerscheinungen:');
+
+define('TEXT_EVENT_OSC_LINK', 'OSC Link:');
+define('TEXT_EVENT_OSC_LINK_HELP', '( Link zu einem Hersteller / Kategorie / Produkt oder Neuerscheinung )');
+define('TEXT_CURRENT_OSC_LINK', 'Momentaner OSC link: ');
+define('TEXT_START_DATE_NOTE', 'Hinweis Neuerscheinungen: <b>Start Datum</b> dieser Wert muss unter "products_date_available" gesetzt werden.');
+define('TEXT_EVENT_LINK', 'Link:');
+define('TEXT_EVENT_LINK_HELP', 'Zus&auml;tzlicher Link, wie: www.mysite.com/event_page.html (kein http://)');
+define('TEXT_EVENT_IMAGE', 'Abbildung:');
+define('TEXT_EVENT_NO_IMAGE', 'Keine Abbildung:');
+
+define('TEXT_EVENT_PREVIEW', 'Vorschau:');
+
+define('TEXT_EVENT_DELETE_CONFIRM', 'Sind sie sicher das Sie das Event l&ouml;schen wollen <a href="'. FILENAME_EVENTS_MANAGER .'?eID='. $eID .'&action=edit"><font color="red"><b>'. $eID .'</b></font></a> ?');
+define('TEXT_DELETE_EVENTS', 'Alle vorherigen Events l&ouml;schen:');
+define('TEXT_EVENTS_DELETE_CONFIRM', 'Sind Sie siche das Sie alle vorherigen Events l&ouml;schen wollen<b>'. $before .'</b> ?');
+
+
+define('TEXT_INFO_DELETE_EVENT_INTRO', 'Sind Sie sich sicher das Sie l&ouml;schen wollen?');
+
+define('ERROR_EVENT_TITLE', 'Fehler: Event Titel ist notwendig');
+define('ERROR_EVENT_START_DATE', 'Fehler: Event Start Datum ist notwendig');
+
+
+define('ERROR_REQUIRED_FIELDS', ' * required');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/faq.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+  define('FAQ_ACTION', 'Aktion');
+  define('FAQ_ACTIVATION_ID', 'Aktivieren? FAQ ID=');
+  define('FAQ_ACTIVATED_ID', 'Aktiviert FAQ ID=');
+  define('FAQ_ADD', 'Neue FAQ');
+  define('FAQ_ADD_QUEUE', 'FAQ Reihenfolge');
+  define('FAQ_ALERT', 'Es stehen keine FAQs zur Verfügung');
+  define('FAQ_ANSWER', 'Antwort');
+  define('FAQ_CREATED', 'Erstellt');
+  define('FAQ_DATE', 'Datum');
+  define('FAQ_DEACTIVATION_ID', 'Deaktivieren? FAQ ID=');
+  define('FAQ_DEACTIVATED_ID', 'Deaktiviert FAQ ID=');
+  define('FAQ_DELETE_CONFITMATION_ID', 'L&ouml;schen durchf&uuml;hren? FAQ ID=');
+  define('FAQ_DELETE_ID', 'L&ouml;schen FAQ ID=');
+  define('FAQ_DELETED_ID', 'Gel&ouml;scht FAQ ID=');
+  define('FAQ_EDIT_ID', 'Bearbeiten FAQ ID=');
+  define('FAQ_ERROR_20', 'Sie haben keinen g&uuml;ltigen Wert im Feld <b>Reihenfolge</b> eingegeben (nur Zahlen erlaubt).');
+  define('FAQ_ERROR_80', 'Sie haben nicht alle <b>notwendigen Felder</b> ausgef&uuml;llt');
+  define('FAQ_ID', 'ID');
+  define('FAQ_ID_ACTIVE', 'diese FAQ ist aktiv'); 
+  define('FAQ_ID_DEACTIVE', 'diese FAQ ist NICHT aktiv'); 
+  define('FAQ_LANGUAGE', 'Sprache');
+  define('FAQ_MANAGER', 'FAQ Manager');
+  define('FAQ_NUMBER', 'Nr.');
+  define('FAQ_QUESTION', 'Frage');
+  define('FAQ_QUEUE', 'Reihenfolge');
+  define('FAQ_QUEUE_LIST', 'Reihenfolge der FAQs: ');
+  define('FAQ_SORT_BY', 'Reihenfolge auf der FAQ Seite');
+  define('FAQ_STATUS', 'Status');
+  define('FAQ_SYSTEM', 'FAQ System');
+  define('FAQ_UPDATED_ID', 'Aktualisiert FAQ ID=');
+  define('FAQ_VIEW', 'FAQ anzeigen');
+  define('FAQ_VIEW_ALL', 'FAQ alle anzeigen');
+  define('FAQ_VISIBLE', 'Anzeigen');
+  define('FAQ_WARNING', 'Warnung');
+
+  define('ENTRY_CATEGORY', 'Category:');
+  define('TEXT_NO_CATEGORY', 'No Category');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/faq_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/faq_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/faq_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: faq_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'FAQ Kategorien');
+define('HEADING_TITLE_SEARCH', 'Suchen:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_FAQ_HEADING_NEW_FAQ_CATEGORY', 'Neue Kategorie');
+define('TEXT_FAQ_HEADING_EDIT_FAQ_CATEGORY', 'Kategorie edtieren');
+define('TEXT_FAQ_HEADING_DELETE_FAQ_CATEGORY', 'Kategorie l&ouml;schen');
+
+define('TEXT_FAQ_CATEGORY_COUNT', 'FAQs:');
+define('TEXT_FAQ_CATEGORY_STATUS', 'Status:');
+define('TEXT_FAQ_CATEGORY_DESCRIPTION', 'Beschreibung:');
+define('TEXT_FAQ_CATEGORY_SORT_ORDER', 'Sortierreihenfolge:');
+define('TEXT_DATE_FAQ_CATEGORY_CREATED', 'Erstellt am:');
+define('TEXT_DATE_FAQ_CATEGORY_LAST_MODIFIED', 'Letzte &Auml;derung:');
+define('TEXT_IMAGE_NONEXISTENT', 'Grafik existiert nicht');
+
+define('TEXT_NEW_FAQ_CATEGORIES_INTRO', 'Bitte geben Sie die notwendigen Informationen f&uuml;r die neue Kategorie ein. ');
+define('TEXT_EDIT_FAQ_CATEGORIES_INTRO', 'Bitte f&uuml;ren Sie die notwendigen &Auml;nderungen durch');
+define('TEXT_DELETE_FAQ_CATEGORIES_INTRO', 'Sind Sie sicher, dass Sie diese Kategorie l&ouml;schen wollen?');
+
+define('TEXT_FAQ_CATEGORIES_NAME', 'Kategorie Bezeichnung:');
+define('TEXT_FAQ_CATEGORIES_DESCRIPTION', 'Kategorie Beschreibung:');
+define('TEXT_FAQ_CATEGORIES_IMAGE', 'Kategorie Grafik:');
+define('TEXT_FAQ_CATEGORIES_SORT_ORDER', 'Sortierreihenfolge:');
+define('TEXT_FAQ_CATEGORIES_STATUS', 'Status:');
+define('TEXT_FAQ_CATEGORIES_STATUS_ENABLE', 'Aktivieren');
+define('TEXT_FAQ_CATEGORIES_STATUS_DISABLE', 'Deaktivieren');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>Achtung:</b> Es sind bereits %s FAQs mit dieser Kategorie verlinkt!');
+
+define('TEXT_DISPLAY_NUMBER_OF_FAQ_CATEGORIES', 'Anzeige <b>%d</b> bis <b>%d</b> (von <b>%d</b> Kategorien)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/feature_not_present.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/feature_not_present.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/feature_not_present.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Feature Not Present');
+define('IMAGE_UPGRADE', 'Upgrade Now');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/featured.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Restposten');
+
+define('TABLE_HEADING_PRODUCTS', 'Produkt');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_FEATURED_PRODUCT', 'Produkt:');
+define('TEXT_FEATURED_EXPIRES_DATE', 'Enddatum:');
+
+define('TEXT_INFO_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'Zuletzt ge&auml;ndert:');
+define('TEXT_INFO_EXPIRES_DATE', 'Endet am:');
+define('TEXT_INFO_STATUS_CHANGE', 'Letzte Status &Auml;nderung:');
+
+define('TEXT_INFO_HEADING_DELETE_FEATURED', 'Restposten l&ouml;schen');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie diesen Restposten l&ouml;schen wollen?');
+
+define('TEXT_DISPLAY_NUMBER_OF_FEATURED', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Restposten)');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/file_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/file_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/file_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: file_manager.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Datei-Manager');
+
+define('TABLE_HEADING_FILENAME', 'Name');
+define('TABLE_HEADING_SIZE', 'Gr&ouml;&szlig;e');
+define('TABLE_HEADING_PERMISSIONS', 'Zugriffsrechte');
+define('TABLE_HEADING_USER', 'Benutzer');
+define('TABLE_HEADING_GROUP', 'Gruppe');
+define('TABLE_HEADING_LAST_MODIFIED', 'letzte &Auml;nderung');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_HEADING_UPLOAD', 'Upload');
+define('TEXT_FILE_NAME', 'Dateiname:');
+define('TEXT_FILE_SIZE', 'Gr&ouml;&szlig;e:');
+define('TEXT_FILE_CONTENTS', 'Inhalt:');
+define('TEXT_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_NEW_FOLDER', 'Neues Verzeichnis');
+define('TEXT_NEW_FOLDER_INTRO', 'Geben Sie den Namen f&uuml;r das neue Verzeichnis ein:');
+define('TEXT_DELETE_INTRO', 'Sind Sie sicher, dass Sie diese Datei l&ouml;schen m&ouml;chten?');
+define('TEXT_UPLOAD_INTRO', 'Bitte die Dateien ausw&auml;hlen, welche hochgeladen werden sollen.');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis ist schreibgesch&uuml;tzt. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
+define('ERROR_FILE_NOT_WRITEABLE', 'Fehler: Die Datei ist schreibgesch&uuml;tzt. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
+define('ERROR_DIRECTORY_NOT_REMOVEABLE', 'Fehler: Das Verzeichnis kann nicht gel&ouml;scht werden. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
+define('ERROR_FILE_NOT_REMOVEABLE', 'Fehler: Die Datei kann nicht gel&ouml;scht werden. Bitte korrigieren Sie die Zugriffsrechte f&uuml;r: %s !');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis %s existiert nicht!');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/forbiden.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/forbiden.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/forbiden.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Zugang verboten');
+define('NAVBAR_TITLE', 'Keine geeigneten Zugangsrechte');
+define('TEXT_MAIN', '&nbsp;Bitte kontaktieren Sie den <b>Webmaster</b> um mehr Zugang <br>&nbsp;zu beantragen oder wenn Sie auf ein Problem gestossen sind.<br>&nbsp;');
+define('TEXT_BACK', 'Zur&uuml;ck');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/froogle.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/froogle.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/froogle.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+  froogle.php
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Froogle Datei Feed');
+
+define('TEXT_INFO_COMPLETED', 'erstelle vollst&auml;ndiges Froogle Datei: ');
+
+define('TEXT_INFO_FTP_ERROR1', 'FTP Verbindung fehlgeschlagen: ');
+define('TEXT_INFO_FTP_ERROR2', 'FTP Verbindung fehlgeschlagen! ');
+define('TEXT_INFO_FTP_ERROR3', 'FTP Verbindung wurde versucht aufzubauen ');
+define('TEXT_INFO_FTP_ERROR4', 'mit Benutzer ');
+define('TEXT_INFO_FTP_ERROR5', 'Verbunden mit ');
+define('TEXT_INFO_FTP_ERROR6', 'Aktuelles Verzeichnis ist: ');
+define('TEXT_INFO_FTP_ERROR7', 'Verzeichnis konnte nicht gewechselt werden ');
+define('TEXT_INFO_FTP_ERROR8', ': FTP &uuml;bertragung fehhlgeschlagen! ');
+define('TEXT_INFO_FTP_ERROR9', "Hochgeladen " . $ftpsourcefile . " zu " . $ftpservername . " als " . $ftpdestinationfile);
+
+define('TEXT_INFO_FTP_SCRITP_TIMER', 'Script Zeit: <b>%f</b> Sekunden.');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/froogle_pre.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/froogle_pre.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/froogle_pre.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+  froogle_pre.php
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Froogle Datei Feed');
+
+define('TEXT_INFO_COMPLETED', 'Feed Datei komplett erzeugen:');
+define('TEXT_INFO_TIMER', 'Script Zeit:');
+define('TEXT_INFO_SECOND', 'Skenunden.');
+
+define('TEXT_INFO_DONE', 'Kategorien zur&uuml;ck in Admin geschrieben');
+
+
+define('TEXT_OUTPUT_1', "product_url \t name \t description \t price \t image_url \t category \t offer_id");
+define('TEXT_OUTPUT_2', "\t instock ");
+define('TEXT_OUTPUT_3', "\t shipping ");
+define('TEXT_OUTPUT_4', "\t brand ");
+define('TEXT_OUTPUT_5', "\t upc ");
+
+define('TEXT_OUTPUT_6', "\t manufacturer_id ");
+define('TEXT_OUTPUT_7', "\t product_type ");
+define('TEXT_OUTPUT_8', "\t currency ");
+define('TEXT_OUTPUT_9', "\t language ");
+
+define('TEXT_OUTPUT_10', "\t ship_to ");
+define('TEXT_OUTPUT_11', "\t ship_from ");
+
+define('TEXT_OUTPUT_12', "Not Supported");
+define('TEXT_OUTPUT_13', "book");
+define('TEXT_OUTPUT_14', "music");
+define('TEXT_OUTPUT_15', "video");
+define('TEXT_OUTPUT_16', "other");
+
+define('TEXT_OUTPUT_17', 'data feed: ');
+define('TEXT_OUTPUT_18', 'File completed: ');
+define('TEXT_OUTPUT_19', 'view output file');
+
+define('TEXT_OUTPUT_20',' Run category build        run feed build    ');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/geo_zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/geo_zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/geo_zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: geo_zones.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Steuerzonen');
+
+define('TABLE_HEADING_COUNTRY', 'Land');
+define('TABLE_HEADING_COUNTRY_ZONE', 'Bundesland');
+define('TABLE_HEADING_TAX_ZONES', 'Steuerzonen');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_HEADING_NEW_ZONE', 'Neue Steuerzone');
+define('TEXT_INFO_NEW_ZONE_INTRO', 'Bitte geben Sie die neue Steuerzone mit allen relevanten Daten ein');
+
+define('TEXT_INFO_HEADING_EDIT_ZONE', 'Steuerzone bearbeiten');
+define('TEXT_INFO_EDIT_ZONE_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch.');
+
+define('TEXT_INFO_HEADING_DELETE_ZONE', 'Steuerzone l&ouml;schen');
+define('TEXT_INFO_DELETE_ZONE_INTRO', 'Sind Sie sicher, dass Sie diese Steuerzone l&ouml;schen wollen?');
+
+define('TEXT_INFO_HEADING_NEW_SUB_ZONE', 'Neue Steuerklasse');
+define('TEXT_INFO_NEW_SUB_ZONE_INTRO','Geben Sie bitte die notwendigen Informationen f&uuml;r die neue Steuerklassen ein');
+
+define('TEXT_INFO_HEADING_EDIT_SUB_ZONE', 'Steuerklasse bearbeiten');
+define('TEXT_INFO_EDIT_SUB_ZONE_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch.');
+
+define('TEXT_INFO_HEADING_DELETE_SUB_ZONE', 'Steuerklasse l&ouml;schen');
+define('TEXT_INFO_DELETE_SUB_ZONE_INTRO','Wollen Sie diese Steuerklasse wirklich l&ouml;schen?');
+
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_INFO_ZONE_NAME', 'Name der Steuerzone:');
+define('TEXT_INFO_NUMBER_ZONES', 'Anzahl der Steuerzonen:');
+define('TEXT_INFO_ZONE_DESCRIPTION', 'Beschreibung:');
+define('TEXT_INFO_COUNTRY', 'Land:');
+define('TEXT_INFO_COUNTRY_ZONE', 'Steuerzone:');
+define('TYPE_BELOW', 'Alle Steuerzone');
+define('PLEASE_SELECT', 'Alle Steuerzone');
+define('TEXT_ALL_COUNTRIES', 'Alle L&auml;nder');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/gv_mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/gv_mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/gv_mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: gv_mail.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Geschenk-Gutschein an Kunden versenden');
+
+define('TEXT_CUSTOMER', 'Kunde:');
+define('TEXT_SUBJECT', 'Betreff:');
+define('TEXT_FROM', 'Absender:');
+define('TEXT_TO', 'Email an:');
+define('TEXT_AMOUNT', 'Betrag:');
+define('TEXT_MESSAGE', 'Nachricht:');
+define('TEXT_SINGLE_EMAIL', '<span class="smallText">Use this for sending single emails, otherwise use dropdown above</span>');
+define('TEXT_SELECT_CUSTOMER', 'Kunden ausw&auml;hlen');
+define('TEXT_ALL_CUSTOMERS', 'Alle Kunden');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'An alle Newsletter-Abonnenten');
+
+define('NOTICE_EMAIL_SENT_TO', 'Hinweis: Email wurde versendet an: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Fehler: Es wurde kein Kunde ausgew&auml;hlt.');
+define('ERROR_NO_AMOUNT_SELECTED', 'Fehler: Sie haben keinen Betrag f&uuml;r den Gutschein eingegeben.');
+
+define('TEXT_TO_REDEEM1', 'You can also redeem this Gift Voucher during checkout. Just enter the code in the box provided, and click on the redeem button. ');
+define('TEXT_GV_WORTH', 'Geschenk-Gutscheinwert ');
+define('TEXT_TO_REDEEM', 'Um den Gutschein einzul&ouml;sen, klicken Sie auf den unten stehenden Link. Bitte notieren Sie sich den Gutschein-Code.');
+define('TEXT_REMEMBER', 'Please do not lose the coupon code, make sure to keep the code safe so you can benefit from this special offer');
+define('TEXT_WHICH_IS', 'welcher lautet');
+define('TEXT_IN_CASE', ' falls Sie Probleme haben.');
+define('TEXT_OR_VISIT', 'oder besuchen Sie ');
+define('TEXT_ENTER_CODE', ' und geben den Gutschein-Code ein ');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_HEADER', 'Sie haben k&uuml;rzlich einen Geschenk-Gutschein von unserem Online-Shop erworben.' . "\n"
+                                          . 'Aus Sicherheitsgr&uuml;nden wurde Ihnen dieser nicht unmittelbar danach zur Verf&uuml;gung gestellt.' . "\n"
+                                          . 'Nun wurde der Gutscheinbetrag freigegeben. Sie k&ouml;nnen nun unseren Online-Shop besuchen' . "\n"
+                                          . 'und diesen Gutschein per Email an jemanden versenden.' . "\n\n");
+define ('TEXT_REDEEM_COUPON_MESSAGE_AMOUNT', "\n\n" . 'Der Wert des Geschenk-Gutscheins ist %s');
+define ('TEXT_REDEEM_COUPON_MESSAGE_BODY', "\n\n" . 'Sie k&ouml;nnen nun unsere Seite besuchen, sich anmelden und danach den Gutschein per Email an jemanden versenden.');
+define ('TEXT_REDEEM_COUPON_MESSAGE_FOOTER', "\n\n");
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">The Back Button has been DISABLED while HTML WYSIWG Editor is turned ON.</b></font><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML is currently Disabled!</b></font><br><br>If you want to send HTML email, Enable WYSIWYG Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Options<br>');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/gv_queue.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/gv_queue.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/gv_queue.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: gv_queue.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Geschenk-Gutschein Freigabe-Warteschlange');
+
+define('TABLE_HEADING_CUSTOMERS', 'Kunden');
+define('TABLE_HEADING_ORDERS_ID', 'Bestell-Nr.');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Gutscheinwert');
+define('TABLE_HEADING_DATE_PURCHASED', 'Bestelldatum');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_REDEEM_COUPON_MESSAGE_HEADER', 'Sie haben k&uuml;rzlich einen Geschenk-Gutschein von unserem Online-Shop erworben.' . "\n"
+                                          . 'Aus Sicherheitsgr&uuml;nden wurde Ihnen dieser nicht unmittelbar danach zur Verf&uuml;gung gestellt.' . "\n"
+                                          . 'Nun wurde der Gutscheinbetrag freigegeben. Sie k&ouml;nnen nun unseren Online-Shop besuchen' . "\n"
+                                          . 'und diesen Gutschein per Email an jemanden versenden.' . "\n\n");
+
+define('TEXT_REDEEM_COUPON_MESSAGE_AMOUNT', 'Ihr erworbener Geschenk-Gutschein ist %s wert' . "\n\n");
+
+define('TEXT_REDEEM_COUPON_MESSAGE_BODY', '');
+define('TEXT_REDEEM_COUPON_MESSAGE_FOOTER', '');
+define('TEXT_REDEEM_COUPON_SUBJECT', 'Geschenk-Gutschein Einkauf');?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/gv_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/gv_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/gv_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: gv_queue.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Gift Voucher Report');
+define('HEADING_SUB_TITLE', 'This report lists all GV issued and if they have been released');
+define('TABLE_HEADING_CUSTOMERS', 'Customers');
+define('TABLE_HEADING_ORDERS_ID', 'Order-No.');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Voucher Value');
+define('TABLE_HEADING_DATE_PURCHASED', 'Date Purchased');
+define('TABLE_HEADING_ACTION', 'Action');
+
+define('TEXT_GV_REPORT_RELEASED', 'Released to customer: ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/gv_sent.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/gv_sent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/gv_sent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: gv_sent.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Geschenk-Gutscheine versandt');
+
+define('TABLE_HEADING_SENDERS_NAME', 'Name des Absender');
+define('TABLE_HEADING_VOUCHER_VALUE', 'Gutscheinwert');
+define('TABLE_HEADING_VOUCHER_CODE', 'Gutschein Nummer');
+define('TABLE_HEADING_DATE_SENT', 'Versanddatum');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_SENDERS_ID', 'Kunden Nr.:');
+define('TEXT_INFO_AMOUNT_SENT', 'Betrag gesendet:');
+define('TEXT_INFO_DATE_SENT', 'gesendet am:');
+define('TEXT_INFO_VOUCHER_CODE', 'Gutschein Nummer:');
+define('TEXT_INFO_EMAIL_ADDRESS', 'Email Adresse:');
+define('TEXT_INFO_DATE_REDEEMED', 'Einl&ouml;sedatum:');
+define('TEXT_INFO_IP_ADDRESS', 'IP Adresse:');
+define('TEXT_INFO_CUSTOMERS_ID', 'Kundennummer:');
+define('TEXT_INFO_NOT_REDEEMED', 'Nicht eingel&ouml;st');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/header_tags_controller.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/header_tags_controller.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/header_tags_controller.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: header_tags_controller.php,v 1.6 2005/04/10 14:07:36 hpdl Exp $
+  Created by Jack York from http://www.oscommerce-solution.com
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_CONTROLLER', 'Header Tags Verwaltung');
+define('HEADING_TITLE_ENGLISH', 'Header Tags - Deutsch');
+define('HEADING_TITLE_FILL_TAGS', 'Header Tags - Tags f&uuml;llen');
+define('TEXT_INFORMATION_ADD_PAGE', '<b>Eine neue Seite einf&uuml;gen</b> - Diese Wahl f&uuml;gt den Code für eine Seite in die erwähnten Dateien hinzu. Beachten Sie, dass sie nicht eine tats&auml;chliche Seite hinzuf&uuml;gt. Um eine Seite hinzuzuf&uuml;gen, tragen Sie den Namen der Datei mit oder ohne die .php Endung ein.');
+define('TEXT_INFORMATION_DELETE_PAGE', '<b>Eine neue Seite l&ouml;schen</b> - Diese funktion l&ouml;scht die angegebene Datei.'); 
+define('TEXT_INFORMATION_CHECK_PAGES', '<b>Fehlende Seiten &uuml;berpr&uuml;fen</b> - Diese Wahl erlaubt Ihnen, zu &uuml;berpr&uuml;fen, welche Dateien in Ihrem Shop keinen Eintrag besitzen. Beachten Sie, dass nicht alle Seiten Eintragungen haben d&uuml;rfen. Z.B.,
+Seiten die SSL verwenden wie z.B. Login. Um die Seiten anzusehen, klicken Sie unten auf das Drop Down Fenster.'); 
+
+define('TEXT_PAGE_TAGS', 'Damit Header Tags in einer Seite angezeigt werden k&ouml;nnen, m&uuml;ssen Sie die jeweilige Seite ausw&auml;hlen. Die Eintr&auml;ge m&uuml;ssen in includes/header_tags.php gebildet werden und liegen im Pfad includes/Languages/German/header_tags.php (wo Deutsch die Sprache ist, wird diese verwendet). Hier haben Sie die M&ouml;glichkeit die Daten anzusehen zu &auml;ndern und zu aktuallisieren.');
+define('TEXT_ENGLISH_TAGS', 'The main purpose of Header Tags is to give each of the pages in your shop a 
+unique title and meta tags for each page. The default settings will not do your shop any good and need to 
+be changed on this page. The individual sections are named after the page they belong to. So, to change the 
+title of your home page, edit the title in the index section.');
+define('TEXT_FILL_TAGS', 'This option allows you to fill in the meta tags added by
+Header Tags. Select the appropriate setting for both the categories and products tags
+and then click Update. If you select the Fill Only Empty Tags, then tags already
+filled in will not be overwritten. ');
+define('ERROR_FILE_NOT_WRITEABLE', 'Error: I can not write to this file. Please set the right user permissions on: %s');
+
+
+define('ERROR_PAGE_NAME_IS_ALREADY_ENTERED', 'Page name is already entered -> ');
+define('ERROR_DELETE_FROM_ENGLISH_1', 'delete from English  ');
+define('ERROR_DELETE_FROM_ENGLISH_2', ' for  ');
+define('PAGE_NAME', 'Page Name');
+define('SWITCHES', 'Switches:');
+define('HTTA', 'HTTA:');
+define('HTDA', 'HTDA:');
+define('HTKA', 'HTKA:');
+define('HTCA', 'HTCA:');
+define('EXPLAIN', '(Explain)');
+define('TITLE_TITLE', 'Title');
+define('DESCRIPTIONS', 'Descriptions');
+define('KEYWORD', 'Keyword(s)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/header_tags_popup_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/header_tags_popup_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/header_tags_popup_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: header_tags_popup_help.php,v 1.0 2005/09/22 
+   
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+  
+  Released under the GNU General Public License
+*/
+?>
+<style type="text/css">
+.popupText {color: #000; font-size: 12px; } 
+</style>
+<table border="0" cellpadding="0" cellspacing="0" class="popupText">
+  <tr><td><hr class="solid"></td></tr>
+  <tr>
+   <td class="popupText"><p><b>F&uuml;r was wird HTTA, HTDA, HTKA und HTCA verwendet?</b><br><br>
+    Header Tags wird mit standard Einstellungen verwendet. Sie k&ouml;nnen Ihre eigenen f&uuml;r jede Seite verwenden 
+    (Es kann f&uuml;r die Startseite sowie f&uuml;r Produkt Seiten gesezt werden.).
+
+<pre>
+HT = Header Tags  
+T  = Titel 
+A  = Alle 
+D  = Beschreibung
+K  = Keywords
+C  = Kategorien *
+</pre>  
+<b>* ACHTUNG:</b> Die HTCA Option arbeitet nur auf der Startseite (index.php). <br><br>
+
+wenn HTTA aktiviert ist (h&auml;kchen), dann werden alle Titel gesetzt
+(der Titel aus der Datei plus dieser Eintrag).<br><br>
+
+Wird diese Box aktiviert so werden beide Titel angezeigt.
+Das heisst wenn Ihr Titel "meineseite" heisst und der Standard Titel oscommerce lautet.<br>
+<pre>
+Mit der Option HTTA ein, lautet der Titel
+ meineseite oscommerce
+Mit der Option HTTA aus, lautet der Titel
+ meineseite
+</pre>
+</p>
+  </td>
+ </tr>
+ 
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Datei Export/Import Verwaltung');
+define('HEADING_TITLE2', 'EP Erweitert Import');
+define('HEADING_TITLE3', 'EP Erweitert Export');
+define('HEADING_TITLE4', 'EP Basis Import');
+define('HEADING_TITLE5', 'EP Basis Export');
+define('HEADING_TITLE6', 'Exportierte Datei bearbeiten');
+define('HEADING_TITLE9', 'Einleitung zur Datei Verwealtung');
+define('HEADING_TITLE10', '7 Schritte zur ersten Froogle Datei');
+define('HEADING_TITLE11', 'Einen Feed Zusammenstellen');
+define('HEADING_TITLE12', 'Feed starten');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)<br><br>
+Updated by: Portalmaster & Hacknix<br><br>
+
+&nbsp;&nbsp;<b>Seiten Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">Was ist das?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">Was zu tun ist wenn Sie ein Problem haben</A></LI>
+<LI><A HREF="#CHANGES">&Auml;nderungen seit letzter Version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">Was ist das?</a></H3>
+<P>
+Verschiedene Dokumentations-Dateien k&ouml;nnen nun über den Admin Bereich eingesehen werden
+Hier finden Sie viele Informationen die Ihnen helfen, Ihr Problem selbst zu l&ouml;sen
+</P>
+<P>
+</P><br>
+<H3><A NAME="TASK">Spezifische Aufgaben Hilfe</H3></a><br>
+
+<H3><A NAME="PROBLEM">Was ist zu tun, wenn Sie ein Problem haben</H3></a><br>
+<P>
+</P>
+
+<H3><A NAME="CHANGES">Neue und ge&auml;nderte Funktionen</H3></a><br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<tr>
+<td>
+<!-- Begin help index2.html-->
+<UL>
+<b>&nbsp;&nbsp;Admin Hilfe und wie man dokumentiert </b>
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Setup und Installation/Konfiguration </b>
+<LI><a href="<?php echo tep_href_link('../doc/CRE6.15-QUICK-INSTALL-GUIDE.pdf', '') . '"> Schnell Installation (PDF) </a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/addlanguage.txt', '') . '">Sprache hinzuf&uuml;gen  (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/adminssl.txt', '') . '">SSL f&uuml; Admin (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../admin/data.php', '') . '">Easy Populate 3.01 (html)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../admin/edit_textdata_help.php?&help_id=1', '') . '">Sprach-Editor (html)</a>' ;?></LI>
+</UL>
+<UL>
+&nbsp;&nbsp;<b>Bezahl Module</b>
+<LI><a href="<?php echo tep_href_link('../admin/authnet_help.php', '') . '">Authorize.net Konfiguration (html)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/payment/paypal/Help_FAQs.inc.php', '') . '"> Paypal Faq\'s (html)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/payment/paypal/Help_Config.inc.php', '') . '">Paypal how to (html)</a>' ;?>
+<UL>
+ </td>
+   </tr>
+<!-- End help index2.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<tr>
+<td>
+<!-- Begin help index2.html-->
+<UL>
+<b>&nbsp;&nbsp;Katalog Hilfe und wie Dokumentiert wird </b>
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Warenkorb testen </b>
+</UL>
+ </td>
+   </tr>
+<!-- End help index2.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<tr>
+<td>
+<!-- Begin help index4.html-->
+
+</td>
+</tr>
+<tr>
+    <td>
+<UL>
+<b>&nbsp;&nbsp;Verschiedene Dokumentationen im  /doc Verzeichnis </b>
+<LI><a href="<?php echo tep_href_link('../doc/CRE6.15-QUICK-INSTALL-GUIDE.pdf', '') . '">'. 'Schnell Installation (pdf)' . '</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/addlanguage.txt', '') . '">Neue Sprache hinzuf&uuml;gen (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/adminssl.txt', '') . '">SSL f&uuml;r admin (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/changesloaded6151.txt', '') . '">&Auml;nderungen mit Patch 01 (txt)</a>' ;?></LI>
+<LI><a href="<?php echo tep_href_link('../doc/buttons.txt', '') . '">Liste der Buttons (txt)</a>' ;?></LI>
+</UL>
+<UL>
+<br>&nbsp;&nbsp;<b>Lizenz</b>
+<LI><a href="<?php echo tep_href_link('../doc/license.txt', '') . '">GPL 2 Englisch (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/help/doc/none.txt', '') . '">GPL 2 Spanien (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link('../doc/gnu_french.txt', '') . '">GPL 2 Frankreich (txt)</a>' ;?>
+<LI><a href="<?php echo tep_href_link('../doc/gnu-german.html', '') . '">GPL 2 Deutschland (txt)</a>' ;?>
+ </td>
+   </tr>
+<tr>
+<td>
+</td>
+</tr>
+
+<!-- End help index4.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/index5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)<br>
+Updated by: Portalmaster & Hacknix<br>
+
+<UL>
+<LI><A HREF="#Was">Was ist das?</A></LI>
+<LI><A HREF="#TASK">Spezifische Hilfe nach Task sortiert</a></LI>
+<LI><A HREF="#PROBLEM">Was ist zu tun wenn Sie ein Problem haben</A></LI>
+<LI><A HREF="#&Auml;nderungen">&Auml;nderungen seit der letzten Version</A></LI>
+</UL>
+
+<H3><A NAME="Was">Was ist das?</a></H3>
+<P>
+Dieses Script erlaubt es Ihnen jede Datei schnellstm&ouml;glich zu editieren.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/none.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/none.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc/none.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+Entschuldigen Sie , aber dieser Bereich ist noch in Bearbeitung.
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Datei Export/Import Verwaltung');
+define('HEADING_TITLE2', 'EP Erweitert Import');
+define('HEADING_TITLE3', 'EP Erweitert Export');
+define('HEADING_TITLE4', 'EP Basis Import');
+define('HEADING_TITLE5', 'EP Basis Export');
+define('HEADING_TITLE6', 'Exportierte Datei bearbeiten');
+define('HEADING_TITLE9', 'Einleitung zur Datei Verwealtung');
+define('HEADING_TITLE10', '7 Schritte zur ersten Froogle Datei');
+define('HEADING_TITLE11', 'Einen Feed Zusammenstellen');
+define('HEADING_TITLE12', 'Feed starten');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_cat.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_cat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_cat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Datei Export/Import Verwaltung');
+define('HEADING_TITLE2', 'EP Erweitert Import');
+define('HEADING_TITLE3', 'EP Erweitert Export');
+define('HEADING_TITLE4', 'EP Basis Import');
+define('HEADING_TITLE5', 'EP Basis Export');
+define('HEADING_TITLE6', 'Exportierte Datei bearbeiten');
+define('HEADING_TITLE9', 'Einleitung zur Datei Verwealtung');
+define('HEADING_TITLE10', '7 Schritte zur ersten Froogle Datei');
+define('HEADING_TITLE11', 'Einen Feed Zusammenstellen');
+define('HEADING_TITLE12', 'Feed starten');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Datei Export/Import Verwaltung');
+define('HEADING_TITLE2', 'EP Erweitert Import');
+define('HEADING_TITLE3', 'EP Erweitert Export');
+define('HEADING_TITLE4', 'EP Basis Import');
+define('HEADING_TITLE5', 'EP Basis Export');
+define('HEADING_TITLE6', 'Exportierte Datei bearbeiten');
+define('HEADING_TITLE9', 'Einleitung zur Datei Verwealtung');
+define('HEADING_TITLE10', '7 Schritte zur ersten Froogle Datei');
+define('HEADING_TITLE11', 'Einen Feed Zusammenstellen');
+define('HEADING_TITLE12', 'Feed starten');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_misc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_misc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/doc_misc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE1', 'Datei Export/Import Verwaltung');
+define('HEADING_TITLE2', 'EP Erweitert Import');
+define('HEADING_TITLE3', 'EP Erweitert Export');
+define('HEADING_TITLE4', 'EP Basis Import');
+define('HEADING_TITLE5', 'EP Basis Export');
+define('HEADING_TITLE6', 'Exportierte Datei bearbeiten');
+define('HEADING_TITLE9', 'Einleitung zur Datei Verwealtung');
+define('HEADING_TITLE10', '7 Schritte zur ersten Froogle Datei');
+define('HEADING_TITLE11', 'Einen Feed Zusammenstellen');
+define('HEADING_TITLE12', 'Feed starten');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/edit_key_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/edit_key_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/edit_key_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: edit_key_help.php,v 1.1 
+  
+  Copyright &copy 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_01', 'Introduction');
+define('HEADING_TITLE_02', 'Configure Encrypt and Decrypt');
+define('HEADING_TITLE_03', 'Key management');
+define('HEADING_TITLE_04', 'Encrypt and Decrypt data');
+define('HEADING_TITLE_05', 'Changing your key');
+define('HEADING_TITLE_06', 'Test');
+define('HEADING_TITLE_07a', 'Encrypted data that is not encrypted');
+define('HEADING_TITLE_07b', 'Decrypting data that is encrypted');
+define('HEADING_TITLE_07c', 'Changing keys and updating encrypted data');
+
+
+define('TEXT_MAG_1', 'Index');
+define('TEXT_MAG_2', 'Pre install and installation of Encrypt and Decrypt');
+define('TEXT_MAG_3', 'Specific task:');
+define('TEXT_MAG_4', 'A. Encrypted data');
+define('TEXT_MAG_5', 'B. Decrypting data');
+define('TEXT_MAG_6', 'C. Changing keys and updating encrypted data');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/edit_textdata_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/edit_textdata_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/edit_textdata_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+
+define('HEADING_TITLE_01', 'Sprache bearbeiten: Einleitung ');
+define('HEADING_TITLE_02', 'Sprache bearbeiten: Suchen ');
+define('HEADING_TITLE_03', 'Sprache bearbeiten :bearbeiten ');
+define('HEADING_TITLE_04', 'Sprache bearbeiten: speichern');
+define('HEADING_TITLE_05', 'Sprache bearbeiten: Wiederherstellen');
+define('MENU_ITEM_01', 'Einleitung:');
+define('MENU_ITEM_02', '1. Suchen Sie nach Dateien oder nach Text');
+define('MENU_ITEM_03', '2. Editieren Sie die Definition');
+define('MENU_ITEM_04', '3. &Auml;nderungen speichern ');
+define('MENU_ITEM_05', '4. Vorigen Stand wiederherstellen');
+
+define('TEXT_MSG_1', 'Language Editor Help Index');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/data_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/data_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/data_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+?>
+<tr>
+ <td>
+<p align="center"><b><span style="font-size:16pt;">Data Feed Input/Output Introduction</span></b></p>
+<p>Data feed service is a collection of contributions to allow you to updated 
+your products and categories data remotely, and send that data to data listing 
+services. It used a number of contributions that have been modified to work 
+with small, medium, and large stores. </p>
+<p>Contributions:<br>Easy Populate Advance by Tom O'Neill<br>Easy Populate Basic<br>Froogle 
+data feed : Calvin K<br> &nbsp;&nbsp;&nbsp;Salemaker for froogle feed: by<br> 
+&nbsp;&nbsp;&nbsp;Admin for Froogle Data Feed : Tom O'Neill<br><br> Goals:<br>The 
+typical store owner never needs to edit a code or define file directly.The store 
+owner does not need a lot of support on how to use program.Combines the functions 
+of moving data in and out of store is in one are.Make it flexible enough for 
+small, medium and large store to use program effectively.Move program files closer 
+to OSC/CRE Loaded standards for look and feel, and coding.<br><br>Parts of 
+Data Feed Service:<br>&nbsp;Easy Populate: This is used to update data it allows 
+you to updated data remotely on your&nbsp;local computer and upload to the data 
+to your on line store. It allows you to&nbsp;&nbsp;build custom queries for 
+the data then download the information to your local computer&nbsp;&nbsp;for 
+editing, Then upload back to your &nbsp;on-line store.</p>
+<p>&nbsp;Data feed:<br>&nbsp;&nbsp;Data feed takes the data with in your catalog 
+and prepares it for submission to a feed &nbsp;service and send it to the feed 
+service either automatically or manually if you need on completion&nbsp;of building 
+the feed.<br>&nbsp;Features added and changes to basic programs.<br> &nbsp;&nbsp;&nbsp;Easy 
+populate 2.75 Advance to 2.78:<br>&nbsp;1. Removed the froogle feed from this 
+contribution. The froogle function is now &nbsp;handled by separate code files.<br>&nbsp;2. 
+Moved EP from catalog side box to Data export/import side box.<br>&nbsp;3. Moved 
+function file to admin/includes/function directory to follow OSC standards.<br>&nbsp;4. 
+Moved most simple function to function file, export now has all functions removed 
+. There is now only one function left in the EPA import file. <br>&nbsp;5. Revised 
+admin screens so it was more like the rest of the catalog.<br>&nbsp;6. Inserted 
+tep form function rather then html form function (In progress)<br>&nbsp;7. Added 
+pop up help for information on how to use EPA.<br>&nbsp;8. Easy Populate Basic 
+is for backward compatibility with older versions of EP<br>&nbsp;&nbsp;&nbsp;&nbsp;EP 
+advance will import all EPA files of previous version of EPA. <br>&nbsp;9. Export 
+screen and Import screen separated into two separate files<br>&nbsp;10. Side 
+box changed, so that sub titles are offset.<br>&nbsp;11. Added date time to 
+split so each group of splits will be unique and old splits will&nbsp;not be 
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>&nbsp;12. 
+Program message, error, and output were place in one of three variable so they 
+could be output&nbsp:with in the html output section of the files.<br> &nbsp;&nbsp;<br>&nbsp;Items 
+fixed or enhanced from EP 2.74 to 2.75 Advance:<br>&nbsp;1. To add products 
+the product id should be set to 0, there can be many 0's for product ID's.<br>&nbsp;2. 
+You no longer need to change the manufacturers table to change a manufacturers_id 
+first&nbsp;manf id to 1 or 0<br>&nbsp;3. No longer adds a empty product, caused 
+by not treating the last line as not product.<br>&nbsp;4. Added EP Basic, It 
+cannot install any EP Advanced files since they start with EPA a error<br>&nbsp;&nbsp;&nbsp;&nbsp;message 
+will be displayed. It can install any file that starts will EPB or older EP files<br>&nbsp;5. 
+EP Advanced set up so it can only read files that start with EPA , prevents 
+reading older files.<br>&nbsp;6. Delete has been added back into EP for products 
+only. &nbsp;This is implemented via a new column call v_action. You must type 
+the word &quot;delete&quot; in this column to delete a product.<br>&nbsp;7. 
+EP basic was not showing on some site this was to an error in the install of 
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>&nbsp;8. 
+You can add your own product ID, If your product ID's are based on a system 
+other than&nbsp;numbers generated by the shopping cart and auto incremented by 
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows 
+for compatibility with some external inventory management systems.<br>&nbsp;9. 
+moved configuration of EP to a separate file called epconfigure.php <br><br>&nbsp;Data 
+Feed:<br>&nbsp;1. Added language files<br>&nbsp;2. Multiple configurations for 
+multiple feed services now available through admin screen<br>&nbsp;3. Configuration 
+configured in admin rather then edit a file.<br>&nbsp;4. Feed submission now 
+A multiple step process.<br>&nbsp;5. Switched to tep functions for data base 
+queries.<br>&nbsp;6. Split file generation and FTP code into two separate files.<br>&nbsp;7. 
+Combined Froogle, Yahoo and Bizrite into one package (Not all installed and 
+adapted yet)<br>&nbsp;8. added fields for advance feed to products database<br>&nbsp;9. 
+added separate sql file for additional info for froogle feed<br>&nbsp;10. Builds 
+Category strings before building feed file.<br>&nbsp;11. Help popups added to 
+admin screens.<br>&nbsp;12. Added salemaker contribution pricing to price sent 
+to price in feed.<br>&nbsp;13. Uses tax zone from store. <br>&nbsp;14. Add the 
+fields froogle_type, upc, isbn, manufacturer_product_id to products table and 
+products edit screen.<br>&nbsp;15. add froogle specific fields for books, music, 
+video to a separate table.<br><br>&nbsp;For EP set up:<br>&nbsp;For Data feeds 
+set up:<br>Step 1 <br>&nbsp;To set up this modules data feed service, you must 
+first register with the feed services you wish to use.&nbsp;This is described 
+in the getting started document. It has links to the feed services &nbsp;and 
+what you need to set up the configuration of each service.<br>Step 2<br>Next 
+you need to install this contribution this is disturbed in the doc/install.txt 
+files<br>Step 3<br>The you will need to configure and run the data feeds this 
+is described in the running doc/configureandrun.txt document The file field_spec.txt 
+describes the limitation of what can be placed into each field<br><br>&nbsp;Known 
+bugs:<br>&nbsp;&nbsp;1. PHP 5 compatibility for import. the problem is either 
+how globals are treated or&nbsp;&nbsp;how arrays are used in this contribution<br></p>
+ </td>
+</tr> 
+<tr>
+  <td>
+ <b>Error and status messages</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will appear near the top of the for, Blue background 
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_msg.gif" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ <b>Import result</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now appear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ <b>Help while using the admin screens</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or input you could use. It will display a pop up window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
+

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/edit_key_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/edit_key_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/edit_key_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: edit_key_help.php,v 1.1 
+
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE_01', 'Introduction');
+define('HEADING_TITLE_02', 'Configure Encrypt and Decrypt');
+define('HEADING_TITLE_03', 'Key management');
+define('HEADING_TITLE_04', 'Encrypt and Decrypt data');
+define('HEADING_TITLE_05', 'Changing your key');
+define('HEADING_TITLE_06', 'Test');
+define('HEADING_TITLE_07a', 'Encrypting data');
+define('HEADING_TITLE_07b', 'Decrypting data');
+define('HEADING_TITLE_07c', 'Changing keys and updating encrypted data');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page1.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page1.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page1.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+?>
+
+
+<table width="100%" border="0" cellpadding="5" cellspacing="3">
+  <tr valign="top">
+    <td><p><strong><font color="red">Warnings </font></strong></p>
+      <p><strong><img src="images/icons/warning_big.gif" alt="Warning" width="20" height="20" hspace="5"></strong> <font color="#FF0000">You must check the import and export laws of your country. Some prevent the use of encrypted data or software with hooks in place for encryption to be added. This module does not contain actual encryption code. It uses the mcrypt module, and provides management services. While it is not subject to export laws in the US, it may well be regulated by your jurisdiction. You are responsible for knowledge of and compliance with local laws.</font> </p>
+      <p><strong><img src="images/icons/warning_big.gif" alt="Warning" width="20" height="20" hspace="5"></strong> <font color="#FF0000">One must be careful when the encryption/decryption takes place. Network service disruptions and other factors can cause loss of data availability - ie leaving data encrypted with no key available. It is important to process your cards as frequently as you can, and to delete the data as soon as the transaction is cleared.</font></p>
+      <p><strong> Introduction:</strong> <br>
+      Requirements for the protection of personal and financial data are being increased day by day. This package was developed to assist you with this requirement during the daily operation of your CRE loaded store. There are 3 main components within this package, ssl for admin, encryption/decryption of data, and pgp signing for email with sensitive data. PGP is not yet implemented. Encryption is functional, but not fully developed in this 0.7 release Encrypt and Decrypt component has 4 main functions within it. Configuration, Manage Keys, Update/Convert, Test. </p>
+      <p> 1. Pre install and installation of Encrypt and Decrypt : &nbsp;&nbsp;&nbsp;<br>
+        <img src="images/pixel_trans.gif" width="30" height="10">        A. Setup and installation: See install_encrypt.txt<br>
+      <img src="images/pixel_trans.gif" width="30" height="10">&nbsp;B. Enabling SSL for Admin</p>
+      <p>        Although the encryption protects the data while it is stored in the database tables. It does not protect data when you view it in the admin screens. To help with this SSL for admin was written, this should be installed in the admin and the appropriate edit screens run in ssl mode. The files in this package are designed to work with or with out SSL for admin.</span>      </p>
+      </P></td>
+  </tr>
+  <tr>
+    <td class="pageHeading"><B>Help while using the admin screens</B> </td>
+  </tr>
+  <tr>
+    <td><img src="includes/languages/english/help/encrypt/images/item_help.gif" alt="Screen Shot" width="460" height="364" border="1" ><br>
+      You will notice help icons like this throughout the admin screens These icons trigger popup screens with individual help for each setting or input you see labeled with the icon<br></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><font class="pageHeading">A. Configuration:</font></p>
+      The configuration only has 3 items that need to be setup, along with the key file.<br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/configure1a.png" NAME="Graphic1" WIDTH="644" HEIGHT="143" hspace="5" vspace="5" BORDER=1>
+      <p><font class="content_heading">1. Enable CC encryption Default: false</font><BR>
+        You can turn on and off the encryption, Once you turn on encryption the back off you can use the convert data screen to decrypt the data. If you do this it is advisable to remove the sensitive data. The order viewing and edit screen will decrypt the data so it is viewable.</P>
+      <p><font class="content_heading">2.Path to key File Default key/</font><BR>
+        Currently this is a directory within the includes/ directory.</P>
+      <p><font class="content_heading">3. Key File Name: cc_key.php</font><BR>
+        This is the file name for the key file, It is suggested that you use a different name then the one listed here. By clicking on this configuration setting you have three task to do.</span></font> &nbsp;b. Edit the key file name<BR>
+      </P>
+      <p><IMG SRC="includes/languages/english/help/encrypt/images/configure3.png" NAME="Graphic3" WIDTH="219" HEIGHT="154" BORDER=1> </p>
+      <p>Note: Once you have set the name of the file you can switch to Manage Key files<BR>
+        </span></font>
+        </p>
+      </p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> On opening the Manage Key Files screen it will look like the above screen with no key files.<br>
+      Click on the CREATE files button and a empty key file will be set up using the name you selected in the text input box.<BR>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_start.png" alt="Screen Shot" NAME="Graphic11" WIDTH="723" HEIGHT="213" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> You will now have two empty key files. Starting off you will only need to enter a key phrase into the Primary key file. Next click on the EDIT button next to the Primary key file. This will open the key file edit screen.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_createt.png" alt="Screen Shot" NAME="Graphic5" WIDTH="725" HEIGHT="251" hspace="5" vspace="5" BORDER=1> </p>
+      </P>
+      <p><strong>C.</strong> To edit the &quotPrimary&quot Click on the EDIT button at the end of the row. A Key Edit screen will open.<br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_edit1.png" alt="Screen Shot" NAME="Graphic8" WIDTH=526 HEIGHT="152" hspace="5" vspace="5" BORDER=1><br>        
+      <strong> Note:</strong> The new key file is used to allow updating the data encryption when you want to change to a new encryption key.</p>
+      <p><strong>D.</strong> Type in your key phrase in the text box and click the SAVE button. This will save the phrase. 
+  The phase can be anything from random numbers and letters to a phrase you can remember.</p>
+      <p><strong>E. </strong>From this point on all cc information will be encrypted as it is entered into the orders by the customer.
+    The next step you may need to take might be to encrypt existng Credit card information.</p>
+    <p><strong>F.</strong> Next click on the Update cc data in the lefthand side box.</p></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> Each order paid by credit card using a module which stores the number will appear in this list. Click on the ones marked as unencrypted. Then click on the encrypt button. <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/e_c_order1.png" alt="Screen Shot" NAME="Graphic4" WIDTH="641" HEIGHT="141" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> You will now have encrypted this existing entry. Do this for each unencrypted CC number. Next to the encrypt button is a decrypt button that can be used to decrypt the information. Attempts to re-encrypt a number again will fail.<br>
+      <img src="includes/languages/english/help/encrypt/images/e_c_order.png" alt="Screen Shot" name="Graphic9" width="642" height=137 hspace="5" vspace="5" border=1></p>
+      <p><strong>C.</strong> Mass Encryption or Decryption can also be done. Simply click on the encrypt or decrypt buttons at the top of the form and all numbers will be processed. The program will detect those orders that have already been encrypted or decrypted and change only the data which requires processing.        <BR>
+      <IMG SRC="includes/languages/english/help/encrypt/images/d_c_main_all.png" alt="Screen Shot" NAME="graphics1" WIDTH=545 HEIGHT=61 hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>D.</strong> If you need to export your Credit card information to an external program that cannot use the mcrypt library you can decrypt all of the encrypted data before exporting the information. Once you have exported the data you should return to this screen to encrypt all data. <BR>
+      </p></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Author: $Author$
+  Revision : $Revision$
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> Keys should be changed from time to time as a security precaution. When you first set up your &quot;Primary key file&quot; an empty &quot;New key file&quot; was created. In fact, CRE Loaded comes with 2 key files already in place, just in case your host allows editing of existing files but restricts creation of files from within the web server. You will now need to add your new key to this file . In the row that is labeled &quot;New key file&quot; click on the edit button.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_createt.png" alt="Screen Shot" NAME="Graphic6" WIDTH="725" HEIGHT="251" hspace="5" vspace="5" BORDER=1> </p>
+      <p> <strong><font color="#FF0000"> WARNING:</font></strong><br>
+        <strong><font color="#FF0000"><img src="images/icons/warning_big.gif" width="20" height="20" hspace="5" vspace="5"></font></strong>Do not edit the main key file for your site once you have begun encrypting data. This may cause the loss of any existing data you have encrypted. You must follow the procedure for converting records as listed below: </p>
+      <p><strong>B.</strong> Click once on the edit button next to the new_(key file name) to access the Key File edit screen. When you click on the file name you will be sent to the key file contents editor. You may enter anything from a phrase to a random set of numbers and letters. The longer the phrase, the more secure your data will be. Inclusion of numbers and use of both upper and lower case characters will also make your phrase more difficult to guess.<br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_new_edit1.png" alt="Screen Shot" NAME="Graphic7" WIDTH=555 HEIGHT=112 hspace="5" vspace="5" BORDER=1></P>
+      <p> <strong>C.</strong> Once you have finished changing your key click on the save button. It will save the key and display it for your verification. If this is not what you wanted click on the restore button and the old contents will be brought back.</span></font> <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/manage_key_new_saved.png" alt="Screen Shot" NAME="Graphic10" WIDTH=572 HEIGHT=122 hspace="5" vspace="5" BORDER=1></P>
+      <p><strong>D.</strong> Having placed the new key you should now go to the convert data screen to re-encrypt your data using this new key. If you do not use the Convert CC Data screen you may lose your existing CC data. This may be a permanent loss.</P>
+      <p><strong>E.</strong> Convert CC Data screen </P>
+      <p> <img src="includes/languages/english/help/encrypt/images/convert.png" alt="Scrren Shot" name="Graphic2" width="628" height="161" hspace="5" vspace="5" border=1></p>
+      <p><strong>1.</strong> If the new key file is empty, you will see the above screen, with warnings that there is no key and you need to add one.<br>
+        <img src="includes/languages/english/help/encrypt/images/convert_ok.png" width="337" height="23" hspace="5" vspace="5" border="1"></p>
+      <p><strong>2.</strong> The convert button will appear once you have added a new key phrase. As long as you see no red warning messages you are ready to proceed with conversion. If you do see a warning it is important that you resolve the problem before continuing.<br>
+        <img src="includes/languages/english/help/encrypt/images/convert_button.png" width="271" height="31" hspace="5" vspace="5" border="1"></p>
+      <p><strong>3.</strong> Click on the convert button. This will convert the existing cc data to the new key. The process converts the data by decrypting with the old key and encrypting with the new one. It continues by copying the &quot;Primary Key File&quot; to a back-up file and moving the &quot;New key file&quot; to the &quot;Primary Key File&quot;. That completes the process</span></font> </p>
+      </P>
+    </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page6.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page6.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page6.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author: Tom O'Neill
+  Latest Contributor : $Author$
+  Revision : $Revision$
+
+*/
+
+?>
+
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>A.</strong> CRE CC Encryption Manager relies on services provided by the operating system to function. This is because various governments regulate the availability and usage of security technology including encryption. The test portion of CRE CC Encryption is intended to ensure that encryption algorithms and modes selected for use are available and functioning properly. It can also be used to identify other algorithms and modes that can be used by this program. We begin by displaying a table of available encryption methods and modes. <br>
+        <IMG SRC="includes/languages/english/help/encrypt/images/test1.png" NAME="graphics4" WIDTH="825" HEIGHT="140" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>B.</strong> The first part of the encryption service test is shown above, and lists the available methods and what modes are working on your web server. If you do not see a table similar to the one above then you do not have mcrypt installed or working correctly. <font face="Arial"><br>
+      <IMG SRC="includes/languages/english/help/encrypt/images/test2.png" NAME="graphics4" WIDTH="274" HEIGHT="213" hspace="5" vspace="5" BORDER=1> </p>
+      <p><strong>C.</strong> Then a partial list of the second part is shown above, it lists the length of the key that is allowed or required for a specific method. Currently this tool provides only some basic information. In future, it will be expanded to allow users to select an algorithm to fit their needs and even to allow switching algorithms as part of a carefully managed security system.      </p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7a.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7a.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7a.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><p><strong>1.</strong> Encrypted data that is not encrypted:<BR>
+        The Update CC Data is used to convert non-encrypted data. You can encrypt one record at a time or all records that have not been encrypted.</p>
+      <p><strong>2.</strong> Go to Encryption/Decryption side box click on Update CC Data. A list of orders with credit card number will apear. There will be a green message if the data is encrypted and a red message if it is not. Only the cc number is checked. You can encrypt either a single record or all records in this list<br>
+        <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;a. Single record<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Click on the record not encrypted<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. In the right hand box you will see the encrypt button, Click on this and the record will be encrypted.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. You will be returned to the Order with cc numbers list. If ther are more records go to step 2 and repeat until there are not any more red messages.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4. You are now done if there are no more red messages<BR>
+        <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;b. All records <BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Below the list of order with cc number you will see a button label Encrypt All. Click on this button.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. You are now done</p>
+      </P></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7b.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7b.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7b.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><strong>A.</strong> Go to Encryption/Decryption side box click on Update CC Data . A list of orders with credit card number will apear. There will be a green message if the data is encrypted and a red message if it is not. Only the cc number is checked. You can decrypt either a single record or all records in this list<BR>
+        <BR>
+&nbsp;&nbsp;&nbsp;Single record<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;1. Click on the record not decrypted<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;2. In the right hand box you will see the decrypt button, Click on this and the record will be decrypted.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;3. You will be retuned to the Order with cc numbers list. If there are more records go to step 2 and repeat until ther are not more red messages.<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;4. You are now done if there are no more red messages<BR>
+        <BR>
+&nbsp;&nbsp;All records <BR>
+&nbsp;&nbsp;&nbsp;1. Above the list of order with cc number you will see a button label decrypt . Click on this button.<br>
+&nbsp;&nbsp;&nbsp;2. You are now done</td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7c.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7c.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/encrypt_page7c.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+
+<table width="100%" cellspacing="3" cellpadding="5" border="0">
+  <tr valign="top">
+    <td><ul>
+      <li>  Go to the Encryption/Decryption side box and click on the Manage Keys selection.</li>
+      <li> Click on the file name in the row labeled &quot;New key file&quot; then click on edit.</li>
+      <li> Type in your new key.</li>
+      <li> Click on save.</li>
+      <li> In the Encryption/Decryption side box and click on Convert data. </li>
+      <li>If no red warning messages appear you may proceed.</li>
+      <li>Click on the convert button.</li>
+      <li> Finished</span></font>
+          </P>
+      </li>
+    </ul></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/cofigure_filename.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/cofigure_filename.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure1a.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure1a.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure3.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure_filename1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/configure_filename1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_button.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_button.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_nobutton.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_nobutton.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_not.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_not.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_ok.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/convert_ok.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/d_c_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/d_c_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/d_c_main_all.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/d_c_main_all.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/e_c_order.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/e_c_order.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/e_c_order1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/e_c_order1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/e_c_order_d_e.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/e_c_order_d_e.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/encrypt1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/encrypt1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/encrypt2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/encrypt2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/item_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/item_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_createt.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_createt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_edit.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_edit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_new_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_new_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_new_saved.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_new_saved.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_save.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_save.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_saved.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_saved.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/manage_key_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/order_edit.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/order_edit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/order_edit1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/order_edit1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/test1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/test1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/test2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/encrypt/images/test2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_basicexport.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_basicexport.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_basicexport.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export.png" border="0" ><br>
+
+ The Export Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is intended for backward compatibility with previous version of Easy Populate.
+This version has been reorganized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatible with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Select method to save export file</b>
+  </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_sel_loc.png" border="0" ><br><br>
+To export A file first select if you wish to download the file or save to your web server temp directory.
+
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Select field set to export</b>
+ </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_sel_feld.png" border="0" ><br><br>
+These are the same as in Easy populate 2.7X select from Complete, Model/Price/Qty, Model/Category, Attributes.
+When ready click the "Start File Creation button"
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_basicimport.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_basicimport.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_basicimport.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,69 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_import.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is entended for backward compatibility with previous version of Easy Populate.
+This version has been reorginized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatable with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPB format. This is
+the products_model is the first column in the upload file. The file should have EPB as the first
+three characters in its file name or none at all.
+
+Click on the browse button to browse your local computer for the file to upload and insert.
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. Also
+EP usually will only imports 400 to 500 lines of products, this version can do 2,000 plus.
+If a file it to large to upload because of PHP restrictions the FTP the file to the site and use
+"Import Data from file in temp/"
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Although it may not be needed, EP basic upload and split is available. Use the browse button
+to browse you local files and select the ile for uploading.  It will be spilt into files
+limited by the configure setting $maxrecs as set in the epconfigure.php file.
+Each file name will be dated with the date the split was created.
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_epbasic.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_epbasic.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_epbasic.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epbasic.jpg" border="0" ><br>
+
+ EP Basic
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Easy Populate Basic</b>
+ </td>
+</tr>
+<tr>
+ <td>
+
+<br><b>Upload EP File for Import</b> <br>
+This feature allows the upload of a delimited file for import into the database. You can now import files which include HTML in the text fields without having the file mangled by EP or Excel.  But EP Basic will not install files unless the file name begins with EPB or EP.  Files beginning with EPA are intended for use with EasyPopulate Advanced.
+
+<br><b>Upload and Split a EP File</b> <br>
+This feature has the same improvements applied to the Import routines, but allows you to upload a large file and split it into smaller pieces.  This feature is helpful in avoiding interrupted imports due to communications timeouts or exceeding the servers script time limits.
+
+
+<br><b>Import Data from file in temp/</b> <br>
+This is now a drop down list of all the files located in the /temp directory. 
+
+<br><b>Create an export files</b> <br>
+A series of drop down boxes are used to allow you to :
+
+<br><b>Select method to save export file </b> <br>
+There are two selections here:<br>
+       Save to temp file on server<br>
+       Select fields to download<br>
+
+
+<br><b>Select fields to download </b> <br>
+This is the list of which download types to use. You will also notice that there is no V_products_id in the list. This is for backward compatibility of older files.
+
+By default the file types are are:
+Complete     (Attributes have been removed since there is a separate download for those.)
+Model/Price/Qty
+Model/Category
+Froogle
+Attributes
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_error.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_error.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_error.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+
+
+
+
+
+what the basic froogle feed sends:
+product_url    name    description   price   image_url   category    offer_id
+
+http://192.168.1.35/loaded6151/product_info.php?products_id=28  $25 Gift Certificate  Buy a Gift Certificate for your friends or family 26.38 http://192.168.1.35/loaded6151/images/giftcert-25-sm.gif   Gift Certificate 28
+
+
+froogle product url not set up For SEO urls
+http://192.168.1.35/loaded6151/product_info.php?products_id=20
+
+1. FTP open connection failed to
+The is no server listed in the configure file to connect to
+
+2. FTP connection has failed!
+Failed to connect to the froogle server.
+  wrong user or password entered into the configuration
+
+3. Attempted to connect to
+ An attempt to connect to the server failed If you have list a server, Froogle ftp could be down
+ or you have the wrong server listed inthe configuration.
+ 
+ 
+4. Couldn\'t change directory on
+
+5. Uploaded froogle.txt to hedwig.google.com as /testuser/froogle.txt
+
+The upload worked, Now go to froogle and log into your account and double check the feed.
+
+ 
+ 
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_export.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_export.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_export.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_start.png" border="0" ><br>
+
+ The Export Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPA</b>
+ </td>
+</tr>
+<tr>
+ <td>
+The changes here are in the handling of HTML content in descriptions; image path URL's,
+and EP import filename requirements. You may now import files with html in the text
+fields and not have it mangled by EP or Excel.  URL's for images in subdirectories
+can be handled and correctly written to the database.   Beginning with 2.75, EP
+Advanced will not install files unless it begins with EPA,and EP Basic will not
+install files that begin with EPA.  This feature is to protect the database from
+errors related to a new column added to the Easy populate file format.  EP Advanced
+uses the product_id column, this allow for more features to be added. EPA is will also allow
+you to refine your export file so you can target a specific group of records to edit
+ </td>
+ </tr>
+  <tr>
+ <td>
+<br><H3><b>1. Select method to save export file </b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_sel_export.png" border="0" ><br>
+  </td>
+</tr>
+<tr>
+ <td>
+To export select where you want the export file placed.
+</td>
+</tr>
+<tr>
+ <td>
+<br><H3><b>2. Select field set to export</b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_field_group.png" border="0" ><br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+Next select which group of feilds to export
+</td>
+</tr>
+  </td>
+ </tr>
+
+<tr>
+ <td>
+<br><H3><b>3.Select field for sort order </b></H3><br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_sortorder.png" border="0" ><br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+Next select the sort order you want the rows to apear in the export file.
+</td>
+</tr>
+<tr>
+ <td>
+<br><H3><b>4.Limit number of products to Export </b></H3><br>
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+If you deal with large export files and find it diffcult to find products to edit. You
+can use the Limits to make you export files small and target specific groups of records.
+Not all export files can be limited by all meathods. Meathods can also be combined.
+</td>
+</tr>
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>a. Limit By Category </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_cat.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ If you have TOP showing in the drop down box all categories are looked at.
+ If you have a category showing in the drop down box, the that category and all sub categories will be in the list
+ The categories drop down is generated from your categories in the database
+</td>
+</tr>
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>b. Limit By Manufacture </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_man.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ If you have "Manufactures showing in the drop down box all manufactures are looked at.
+ You can select any manufacture to target just there products
+ The drop down list of manufacures is read from your manufacters.
+ </td>
+</tr>
+
+<tr>
+ <td>
+&nbsp;&nbsp;&nbsp;<H4><b>c. Limit By Product Range </b></H4><br>
+&nbsp;&nbsp;&nbsp;<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_limit_prodid.png" border="0" >
+<br>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ You can use Product Id's to limit your export file.
+<br>&nbsp;&nbsp;&nbsp;  1. If no product_id's are enter all of the product are in the export file
+<br>&nbsp;&nbsp;&nbsp;  2. If the begin product_id and no end product_id is entered. Products from the first product id to the end are in the export file
+<br>&nbsp;&nbsp;&nbsp;  3. If no beginning product_id's and only and ending product_ID. From the first id to ending the products are in the export file
+<br>&nbsp;&nbsp;&nbsp;  4. If the begin product_id and ending product_id is enter then this range of products are in the export file
+ </td>
+</tr>
+
+
+<tr>
+<td>
+<br>&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_feed_intro.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_feed_intro.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_feed_intro.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,110 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<font face="Arial"><span style="font-size:10pt;">
+<tr>
+ <td>
+</span></font><p align="center"><b><span style="font-size:10pt;"><font face="Arial">Data Feed Input/Output Introduction</font></span></b></p>
+<p>
+<font face="Arial"><span style="font-size:10pt;">&nbsp;<b> 1. Introduction:</b> Data feed service is
+based on Calvin K's data feed contribution. The basic functions were retained
+but the rest of the internal code was changed to follow OSC Style of coding.
+Along with the coding change an&nbsp;admin interface was introduced to manage
+the feed configuration. With these coding changed and the addition of a admin
+the process was split into 4 steps. Not all of the steps are required for each
+feed you do.</span></font></p>
+<p>
+<font face="Arial"><span style="font-size:10pt;">&nbsp; <b>2. Goals:</b><br>The typical store owner never needs to edit a code or define file directly.The store
+owner does not need a lot of support on how to use program. Combines the functions
+of moving data in and out of store is in one area. Make it flexible enough for
+small, medium and large store to use program effectively. Move program files closer
+to OSC/CRE Loaded standards for look and feel, and coding.<br><br>
+&nbsp; <b>3. Parts of Data Feed Service:</b><br>
+Froogle data feed : Calvin K<br>
+&nbsp;Salemaker for froogle feed: by Marcel van Lieshout<br>
+&nbsp;Admin for Data Feed : Tom O'Neill<br><br>
+&nbsp;&nbsp;&nbsp; d. For Data feeds setup up:<br>
+Step 1 <br>
+&nbsp;To set up this modules data feed service, Review the 7 steps to your first feed. It outlines
+what steps you need to take to do a feed. It will take you through the configuration process to the uploading and checking of the feed.<br>
+&nbsp;Step 2<br>The you will need to configure and run the data feeds this
+is described in the running doc/configureandrun.txt document The file field_spec.txt
+describes the limitation of what can be placed into each field<br><br>
+</span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+</td>
+</tr>
+<tr>
+  <td>
+
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">&nbsp;3. Error and status messages</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will appear near the top of the form, Blue background
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_mesg.png" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Import result</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now appear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Help while using the admin screens</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or input you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+ <br><br><b> 5. Features added and changes to basic programs.</b><br>
+&nbsp;Data Feed:<br>
+&nbsp;1. Added language files<br>
+&nbsp;2. Multiple configurations for multiple feed services now available through admin screen<br>
+&nbsp;3. Configuration configured in admin rather then edit a file.<br>
+&nbsp;4. Feed submission now A multiple step process.<br>
+&nbsp;5. Switched to tep functions for data base queries.<br>
+&nbsp;6. Split file generation and FTP code into two separate files.<br>
+&nbsp;7. Combined Froogle, Yahoo and Bizrite into one package (Not all installed and adapted yet)<br>
+&nbsp;8. added fields for advance feed to products database<br>
+&nbsp;9. added separate sql file for additional info for froogle feed<br>
+&nbsp;10. Builds Category strings before building feed file.<br>
+&nbsp;11. Help popups added to admin screens.<br>
+&nbsp;12. Added salemaker contribution pricing to price sent to price in feed.<br>
+&nbsp;13. Uses tax zone from store. <br>
+&nbsp;14. Add the fields froogle_type, upc, isbn, manufacturer_product_id to products table and
+products edit screen. (not completed in this version)<br>
+&nbsp;15. add froogle specific fields for books, music, video to a separate table.(not completed in this version)<br>&nbsp;
+</td>
+</tr></span></font>
+<tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_frooglebacisgettingstarted.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_frooglebacisgettingstarted.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_frooglebacisgettingstarted.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Getting started with Froogle
+
+There are 7 main steps to send your first Froogle feed</b><br>
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+<br>
+&nbsp;Step 1: Sign in to the Froogle Merchant Center
+Create or use an existing Google Account to enter the Froogle Merchant Center.
+
+You must go to
+<a href="https://www.google.com/froogle/merchants/welcome">https://www.google.com/froogle/merchants/welcome</a>
+
+From here there is a link to &quot; create an account now. &quot;
+
+You need to follow these pages and signup for a new account if you do not have one.<br>
+<br>
+&nbsp;Step 2: Create an FTP account
+:<br>Set up your FTP account, which you'll use to upload your feeds to us.
+Do this in your froogle merchant account
+
+<br><br> &nbsp;Step 3: Specify your feed's settings in the catalog admin:<br>
+Log into your stores admin and go to the  Data Input Output Systems box in the left hand
+column. From here you will see the feeds main screen. You can either click on the run bottom
+next to configure or click on the data configure in the left hand column.  These setting are
+transferred to the froogle admin in the cart
+
+<br><br> &nbsp;Step 4: Set Categories in the catalog admin:
+<br>Once you have setup the configuration you will need to return to the &quot;Data Feeds&quot; screen. Here
+you will need to build your categories for the feed. Since this is a intense process  it is a separate step.
+You need to do this once and then again only if you change your categories.
+It was done this way for larger stores to reduce processing time.
+<br><br>
+&nbsp;Step 5: Pre Feed Process in the catalog admin:
+<br>This set will Build the actual file for submission to Froogle. If this process take more then
+60 Second then you have a medium to large store or there is a problem. Compared the feed
+you built in the step to the sample one called /doc/sample_text.txt in the contribution.
+
+<br><br> &nbsp;Step 6: Submitting the feed in the catalog admin:
+<br>There are two methods to submit the feed to Froogle. The first is via direct FTP, this is where the FTP information you
+entered into the configuration is used and the feed file is sent directly to Froogle. Or you down load the feed
+and FTP from your local computer to froogle.
+<br><br>
+&nbsp;Step 7: Check your feed for errors:<br>
+Sign in to your Froogle Merchant Center account to check for any formatting errors in your feed.
+Log back into your merchant account at Froogle<br><br>.
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_froogleconfigure.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_froogleconfigure.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_froogleconfigure.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,103 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Configuring Froogle feed</b> </td>
+  </tr><br><br>
+<tr>
+ <td>
+<br>1. <b>List of Configurations</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_new_config.png" border="0" ><br>
+ You will start off by going to the list of configuration. This list all the data feed configurations
+for your store. If you have not done any configuration then there will be none in this list. You must have
+at least one configuration setup.<br>
+ To start a new configuration click on the new button under the list of configurations.
+<br>
+ </td>
+</tr>
+<tr>
+ <td>
+<br>2. <b>Configuration:</b> <br>
+
+ For a new configuration fill in all text boxes and check boxes of the check boxes except active.
+ The click on insert. Once the information has been inserted in to the database<br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ </td>
+</tr>
+<tr>
+
+ <td>
+<br>&nbsp;3.  Settings and what they mean:
+<br>&nbsp;&nbsp; a. Name of Feed
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the name of the feed
+as it will appear in the drop down boxes when data feed<br>&nbsp;&nbsp; b. Product Feed Type
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: Basic&nbsp;or
+Advance Only basic is available.&nbsp;<br>&nbsp;&nbsp; c. Data Feed Discription
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A short description of the feed
+configuration<br>&nbsp;&nbsp; d. Data Feed File Type
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: none,
+products, business. For this you should choose product as the business feed
+is not yet in this package.&nbsp;&nbsp;<br>&nbsp;&nbsp; e. Feed Service
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings: Froogle, Yahoo
+&nbsp;Choose Froogle, as Yahoo feed service has not been added.<br>&nbsp;&nbsp; f.
+Status  Set <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible settings:&nbsp;Active  Inactive
+For a new feed do not change this, until after your first insert.
+<br>&nbsp;&nbsp; g. File name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the file name you chose
+when you did your set up at Froogle.<br>&nbsp;&nbsp; h. Image URL
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you use a image url other then the
+default one for CRE Loaded then enter it here from the /images directory<br>&nbsp;&nbsp; i.
+Froogle FTP information
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Froogle FTP Server Name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP server usually https://</span></font>hedwig.google.com<font face="Arial"><span style="font-size:10pt;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.   Froogle FTP User Name
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP User Name&nbsp;you chose at froogle<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.    Froogle FTP Password<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP password you chose at froogle<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.   Froogle FTP Directory<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter the Froogle
+FTP Directory&nbsp;you chose at froogle<br>&nbsp;&nbsp; g. Froogle Advance Settings
+<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;1. Use store Currency <br>       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;possible
+setting: False: Use store default current,  True: Use currency listed below
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you
+choose false then the store currency will be used. if you choose true the enter
+a single currency below&nbsp;&nbsp;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;2. Other currency<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If above was
+True list a currency here&nbsp;currency<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;3.
+Convert Currency<br>      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible
+settings:False: Do not convert to currency  True: Convert currency
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is used
+if you wish to convert between currencies when a customer enters your store.<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;4.
+Use store language<br>        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Possible
+settings: False: Use store default language  True: Use language selected below
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you choose
+false then the store language&nbsp;will be used. if you choose true the enter
+a single language&nbsp;below<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;5. Other language<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If above was True
+list a list language code here<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.&nbsp;Tax Class ID<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font>Enter the tax class ID number from the store or set to zero (0) for no tax calculation<font face="Arial"><span style="font-size:10pt;"><br></td>
+</tr>
+
+ <tr>
+ <td>
+<br>Once you have finished with the configuration and either Inserted or saved
+it the click on froogle again in the side box. This will take you to the main
+run screen.<br></td>
+</tr>
+
+ <tr>
+ <td><br>&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_froogleconfigure1.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_froogleconfigure1.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_froogleconfigure1.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_import.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPB</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Easy Populate Basic is entended for backward compatibility with previous version of Easy Populate.
+This version has been reorginized and optimized so that more records can be inputed from one file.
+Froogle feed has been removed from this version and replaced by Data Feed. This version
+Is compatable with both Php 4 and 5.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPB format. This is
+the products_model is the first column in the upload file. The file should have EPB as the first
+three characters in its file name or none at all.
+
+Click on the browse button to browse your local computer for the file to upload and insert.
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. Also
+EP usually will only imports 400 to 500 lines of products, this version can do 2,000 plus.
+If a file it to large to upload because of PHP restrictions the FTP the file to the site and use
+"Import Data from file in temp/"
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+Although it may not be needed, EP basic upload and split is available. Use the browse button
+to browse you local files and select the ile for uploading.  It will be spilt into files
+limited by the configure setting $maxrecs as set in the epconfigure.php file.
+Each file name will be dated with the date the split was created.
+ </td>
+</tr>
+<tr>
+ <td>
+<b>List of Configurations</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_start.png" border="0" ><br>
+ You will start off by ging to the list of configuration. this list all the data feed configurations
+for your store. If yo have not done any configuration then there will benone in this list. You must have
+at least one configuration setup.<br>
+ To start a new configuration click on the new button under the list of configurations.
+<br>
+ </td>
+</tr>
+<tr>
+
+<tr>
+ <td>
+<b>Configuration:</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ For a new configuration fill in all text boxes and check ll of the check boxes except active.
+ The click on insert. Once the information has been inserted in to the database<br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_config.png" border="0" ><br>
+ </td>
+</tr>
+<tr>
+
+ <td>
+<br>&nbsp; Add New Feed Setting
+<br>&nbsp;&nbsp; Name of Feed
+<br>&nbsp;&nbsp; Product Feed Type
+<br>&nbsp;&nbsp; Data Feed Discription
+<br>&nbsp;&nbsp; Data Feed File Type
+<br>&nbsp;&nbsp; Feed Service
+<br>&nbsp;&nbsp; Status   Set Active  Inactive
+<br>&nbsp;&nbsp; File name
+<br>&nbsp;&nbsp; Image URL
+<br>&nbsp;&nbsp; Froogle FTP information
+<br>&nbsp;&nbsp;&nbsp;&nbsp; Froogle FTP Server Name
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP User Name
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP Password
+<br>&nbsp;&nbsp;&nbsp;&nbsp;    Froogle FTP Directory
+<br>&nbsp;&nbsp; Froogle Advance Settings
+<br>&nbsp;&nbsp; Use store Currency         False: Use store default current  True: Use currency listed below
+<br>&nbsp;&nbsp; Other currency
+<br>&nbsp;&nbsp; Convert Currency       False: Do not convert to currency  True: Convert currency
+<br>&nbsp;&nbsp; Use store languge        False: Use store default language  True: Use language selected below
+<br>&nbsp;&nbsp; Other languge
+<br>&nbsp;&nbsp;Tax Class ID
+ </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_frooglerun.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_frooglerun.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_frooglerun.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<p><font face="Arial"><span style="font-size:10pt;"><tr>
+ <td align = "left">
+
+<b>Run Froogle feed</b> </td>
+  </tr><br><br>
+<tr>
+ <td>
+<br><b>1. Main run screen</b> <br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/feed_froogle_start.png" border="0" ><br>
+If you have not built at least one configuratin do so now.
+</td>
+</tr>
+<tr>
+ <td>
+<b>2. Configuration:</b> <br>
+ </span></font>Configure: &nbsp;Build or edit unique configuration click
+on the run button to add or edit feed configuration(s). You must have at least
+one feed<br>configuration<br><br>
+ </td>
+</tr>
+<tr>
+ <td>
+<b>3. </span></font>Set Categories:<br> </b>&nbsp;This process can be intense
+for medium to large stores. You should only run this before the first feed and
+if you change any categories. You do not need to run this proccess every time<font face="Arial"><span style="font-size:10pt;"><br>
+ <br></td>
+</tr>
+<tr>
+ <td>
+<b></span></font> 4.&nbsp;Pre Feed Process:<br></b> &nbsp;You will run this
+every time you do a feed. This step build the actual feed file for you. It is
+a good Idea for your month feed to run this before submitting.<font face="Arial"><span style="font-size:10pt;"><br><br><b>&nbsp;</b></td>
+</tr>
+<tr>
+ <td>
+</span></font><b> &nbsp;5. &nbsp;Submit Feed:</b><br>&nbsp;
+If you wish to  have the feed sent directly to the FTP server at Froogle you will
+run this step. You must have the Froogle FTP information entered into the
+configuration<br><br><font face="Arial"><span style="font-size:10pt;"><br></td>
+</tr>
+
+ <tr>
+ <td><br>&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+</span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_import.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_import.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_import.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,87 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td align = "left">
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_start.png" border="0" ><br>
+
+ The Import Screen
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Basic change with EPA</b>
+ </td>
+</tr>
+<tr>
+ <td>
+The changes here are in the handling of HTML content in descriptions; image path URL's,
+and EP import filename requirements. You may now import files with html in the text
+fields and not have it mangled by EP or Excel.  URL's for images in subdirectories
+can be handled and correctly written to the database.   Beginning with 2.75, EP
+Advanced will not install files unless it begins with EPA,and EP Basic will not
+install files that begin with EPA.  This feature is to protect the database from
+errors related to a new column added to the Easy populate file format.  EP Advanced
+uses the product_id column, this allow for more features to be added.
+ </td>
+ </tr>
+  <tr>
+ <td>
+<b>Upload EP File for Import</b>
+  </td>
+</tr>
+<tr>
+ <td>
+To import a file into your catalog it must be first generated or in EPA format. This is
+the products_id is the first column in the upload file. The file should have EPA as the first
+three characters in its file name. If it does not then most likely you should use EP basic to import the file.
+<br>
+<img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_uploaded_insert.png" border="0" ><br><br>
+
+Upload will move the file from you local computer to the web server and import the data in the files to your
+databases. There is usually a limit within php which prevents files larger then 2mb from being uploaded. EPA will import
+more then 2,000 rows in one file, unlike older version that were limited to 300 to 400 maximum. If the file is larger then
+the limit set by PHP then you must upload the file via FTP then use the "Import Data from file in temp/' to import the data.
+If the file is still to large you can split it on the server by using "Split a EP File on the server". The list of files
+in the drop down is fileter so EPB file are not show. and file that are already spilt will not show.
+
+ </td>
+</tr>
+<tr>
+ <td>
+<b>Upload and Split a EP File</b>
+ </td>
+</tr>
+<tr>
+ <td>
+This routine incorporates the same changes noted above for import files.  If for some reason
+you need to split you upload file into smaller parts then you can use this feature. Most site should
+not need to split files any more.
+ </td>
+</tr>
+<tr>
+ <td>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_uploaded_results.png" border="0" ><br><br>
+
+ The upload results now apear below the insert screen.<br><br>
+
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_import_delete.png" border="0" ><br><br>
+ Since you now can delete records the message will apear as above when a recored is deleted.<br>
+
+
+ </td>
+  </tr>
+ <tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_intro.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_intro.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_intro.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,195 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+
+*/
+
+?>
+<font face="Arial"><span style="font-size:10pt;"><tr>
+ <td>
+</span></font><p align="center"><b><span style="font-size:10pt;"><font face="Arial">Data Feed Input/Output Introduction</font></span></b></p>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;<b> 1. Introduction:</b> Data feed service is a collection of contributions to allow you to updated
+your products and categories data remotely, and send that data to data listing
+services. It uses a number of contributions that have been modified to work
+better with small, medium, and large stores. </span></font></p>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp; <b>2. Goals:</b><br>The typical store owner never needs to edit a code or define file directly.The store
+owner does not need a lot of support on how to use program.Combines the functions
+of moving data in and out of store is in one area. Make it flexable enough for
+small, medium and large store to use program effectivly. Move program files closer
+to OSC/Cre Loaded standerds for look and feel, and codeing.<br><br>
+&nbsp; <b>3. Parts of Data Feed Service:</b><br>
+Easy Populate Advance enhanced by Tom O'Neill<br>
+Easy Populate Basic enhanced by Tom O'Neill<br>
+Froogle data feed : Calvin K<br>
+&nbsp;Salemaker for froogle feed: by Marcel van Lieshout<br>
+&nbsp;Admin for Data Feed : Tom O'Neill<br><br>
+&nbsp;&nbsp;a. Easy Populate: This is used to update product and category data, it allows
+you to updated data remotely on your&nbsp;local computer and upload to the data
+to your on line store.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;1. Easy Populate Advance<br>
+&nbsp;&nbsp;&nbsp;&nbsp;Easy Populate Advance
+uses products_id instead of products_model to tie the rows in the Import/Export
+file to your database. This is significate since you now can delete items, asigning
+products to multiple categories, refine export files to select records you need
+to edit/update There also has been asignificant speed and record handling capibilities
+added to both Advance and Basic version. The numbers below are from recent test
+done, previously Easy populate could only handle 300 to 400 records max.
+
+<br>
+&nbsp;&nbsp;&nbsp; 2. Easy Populate Basic<br>
+ Easy Populate basuc is for back ward compatiblity with  EP 2.XX version of Easy populate.
+This is because EP used modle numbers to tie you file  back to the database. Where in the advance
+version it used product_id.<br>
+
+&nbsp;&nbsp;&nbsp;3. Increase in speed and record handling<br></span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;&nbsp;&nbsp;&nbsp;  a. Using only stock products<br>
+export EPB ~ 32 records 0.173231 seconds file size 26kb<br>
+import EPB ~32 records 1.844497 seconds file size 26kb<br>
+export EPA~ 32 records 0.790210 seconds file size 26kb<br>
+import EPA~ 32 records 1.759426 seconds file size 26kb<br>
+&nbsp;&nbsp;&nbsp;&nbsp;  b. Using 2033 products in a single file<br>
+import EPA 89.927511 second &nbsp;or 1 minute 30 sec file size 2.800 KB<br>
+import EPB 456.582260 second &nbsp;or 7 minutes and 36 sec file size 3,423 KB<br>
+&nbsp;&nbsp;&nbsp;&nbsp;  c. Deleting products:2033 products added<br>
+delete EPA 68.877599 seconds File size was 2,875 KB<br>
+EPB cannot delete records.&nbsp;<br><br>
+&nbsp;b. Data feed:<br>
+&nbsp;&nbsp;Data feed takes the data with in your catalog and prepares it for submission to a feed &nbsp;service and send it to the feed
+service either automaticly or manualy if you need on completion&nbsp;of building the feed.<br>&nbsp;<br>
+&nbsp;c. For EP set up:<br><br>
+&nbsp;&nbsp; The setup information for Easy Populate is stored in admin/epconfigure.php. This
+configuration is for both Easy Populate Basic and Easy Populate Advance. <br><br>
+&nbsp; d. For Data feeds setp up:<br>
+Step 1 <br>
+&nbsp;To set up this modules data feed service, Review the 7 steps to your first feed. It outlines
+what steps you need to take to do a feed. It will take you through the configuration process to the uploading and checking of the feed.<br>
+&nbsp;Step 2<br>The you will need to configure and run the data feeds this
+is described in the running doc/configureandrun.txt document The file feild_spec.txt
+describes the limitation of what can be placed into each felid<br><br>
+</span></font></p>
+ <font face="Arial"><span style="font-size:10pt;"> </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">
+ &nbsp;3. Error and staus messages</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will apear near the top of the for, Blue background
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epb_export_mesg.png" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Import result</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now apear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ </span></font><b><font face="Arial"><span style="font-size:10pt;">Help while using the admin screens</span></font></b><font face="Arial"><span style="font-size:10pt;">
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or imput you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp;  </span></font><a href="data.php?selected_box=data"><font face="Arial"><span style="font-size:10pt;"><img src="includes/languages/english/images/buttons/button_return.gif"></span></font></a><font face="Arial"><span style="font-size:10pt;">
+  </td>
+</tr>
+<tr>
+ <td><br><br><b> 5. Features added and changes to basic programs.</b><br> &nbsp;&nbsp;<br>&nbsp;Easy
+populate 2.75 Advance to 3.01:<br>
+&nbsp;&nbsp;&nbsp;1. Removed the froogle feed from this
+contribution. The froogle function is now &nbsp;handled by seperate code files.<br>
+&nbsp;&nbsp;&nbsp;2. Moved EP from catalog side box to Data Input/Output System side box.<br>
+&nbsp;&nbsp;&nbsp;3. Moved function file to admin/includes/function directory to follow OSC standerds.<br>&nbsp;&nbsp;&nbsp;4.
+Moved most simple function to function file, export now has all functions removed
+. There is now only one function left in the EPA import file. <br>
+&nbsp;&nbsp;&nbsp;5. Redid admin screens so it was more like the rest of the OSC admin. .<br>
+&nbsp;&nbsp;&nbsp;6. Inserted tep form function rather then html form function. <br>&nbsp;&nbsp;&nbsp;7. Added
+popup help for informtion on how to use EPA.<br>
+&nbsp;&nbsp;&nbsp;8. Easy Populate Basic is for backward compatibility with older versions of EP<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EP advance will import all EPA files of previous version of EPA. <br>
+&nbsp;&nbsp;&nbsp;9. Export screen and Import screen seperated into two seperate files<br>
+&nbsp;&nbsp;&nbsp;10. Side box changed, so that sub titles are offset.<br>
+&nbsp;&nbsp;&nbsp;11. Added date time to split so each group of splits will be unique and old splits will &nbsp;not be
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>
+&nbsp;&nbsp;&nbsp;12. Program message, error, and output were place in one of three variable so they
+could be outputed&nbsp;with in the html output section of the files.<br> <br>Easy
+Populate Basic 2.75 Basic to 3.01:</span></font>
+<p><font face="Arial"><span style="font-size:10pt;">
+&nbsp;&nbsp;&nbsp;1. Easy Populate Basic is for backward compatibility with older versions of EP<br>
+&nbsp;&nbsp;&nbsp;2. Added date time to split so each group of splits will be unique and old splits will&nbsp;not be
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>
+&nbsp;&nbsp;&nbsp;3. Program message, error, and output were place in one of three variable so they
+could be outputed&nbsp;with in the html output section of the files.<br>
+&nbsp;&nbsp;&nbsp;4. Removed the froogle feed from this contribution. The froogle function is now &nbsp;handled by seperate code files.<br>&nbsp;&nbsp;&nbsp;5.
+Moved EP from catalog side box to Data export/import side box.<br>
+&nbsp;&nbsp;&nbsp;6. Moved function file to admin/includes/function directory to follow OSC standerds.<br>
+&nbsp;&nbsp;&nbsp;7. Moved most simple function to function file, export now has all functions removed .. <br>
+&nbsp;&nbsp;&nbsp;8. Redid admin screens so it was more like the rest of the catalog. and EPA<br>
+&nbsp;&nbsp;&nbsp;9. Inserted tep form function rather then html form function (Inprogress)<br>
+&nbsp;&nbsp;&nbsp;10. Added popup help for informtion on how to use EPB.<br><br>&nbsp;Items
+fixed or enhanced from Ep 2.74 to 2.75 Advance:<br>
+&nbsp;1. To add products the product id should be set to 0, there can be many 0's for product ID's.<br>
+&nbsp;2. You no longer need to change the manufacturers table to change a manufacturers_id
+first&nbsp;manf id to 1 or 0<br>
+&nbsp;3. No longer adds a empty product, caused by not treating the last line as not product.<br>
+&nbsp;4. Added EP Basic, It cannot install any EP Advanced files since they start with EPA a error<br>
+&nbsp;&nbsp;&nbsp;&nbsp;message
+will be displayed. It can install any file that strts wil EPB or older EP files<br>
+&nbsp;5. EP Advanced set up so it can only read files that start with EPA , prevents
+reading older files.<br>
+&nbsp;6. Delete has been added back into EP for products
+only. &nbsp;This is implemented via a new column call v_action. You must type
+the word &quot;delete&quot; in this column to delete a product.<br>
+&nbsp;7. EP basic was not showing on some site this was to an error in the install of
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>
+&nbsp;8. You can add your own product ID, If your product ID's are based on a system
+other than&nbsp;numbers generated by the shopping cart and autoincremented by
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows
+for compatibility with some external inventory management systems.<br>&nbsp;
+9. moved configuration of EP to a seperate file called epconfigure.php <br><br>
+&nbsp;Data Feed:<br>
+&nbsp;1. Added language files<br>
+&nbsp;2. Multiple configurations for multiple feed services now available through admin screen<br>
+&nbsp;3. Configuration configured in admin rather then edit a file.<br>
+&nbsp;4. Feed submission now A multiple step process.<br>
+&nbsp;5. Switched to tep functions for data base queries.<br>
+&nbsp;6. Split file generation and FTP code into two separate files.<br>
+&nbsp;7. Combined Froogle, Yahoo and Bizrite into one package (Not all installed and adapted yet)<br>
+&nbsp;8. added fields for advance feed to products database<br>
+&nbsp;9. added separate sql file for additional info for froogle feed<br>
+&nbsp;10. Builds Category strings before building feed file.<br>
+&nbsp;11. Help popups added to admin screens.<br>
+&nbsp;12. Added salemaker contribution pricing to price sent to price in feed.<br>
+&nbsp;13. Uses tax zone from store. <br>
+&nbsp;14. Add the feilds froogle_type, upc, isbn, manufacturer_product_id to products table and
+products edit screen.<br>&nbsp;
+15. add froogle specific feilds for books, music, video to a seperate table.<br>&nbsp;
+</td>
+</tr></span></font></p>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_intro.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_intro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_intro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Auhtor:
+  Updates by:
+  
+*/
+
+?>
+<tr>
+ <td>
+<p align="center"><b><span style="font-size:16pt;">Data Feed Input/Output Introduction</span></b></p>
+<p>Data feed service is a collection of contributions to allow you to updated 
+your products and categorys data remotely, and send that data to data listing 
+services. It used a number of contributions that have been modified to work 
+with small, medium, and large stores. </p>
+<p>Contributions:<br>Easy Populate Advance by Tom O'Neill<br>Easy Populate Basic<br>Froogle 
+data feed : Calvin K<br> &nbsp;&nbsp;&nbsp;Salemaker for froogle feed: by<br> 
+&nbsp;&nbsp;&nbsp;Admin for Froogle Data Feed : Tom O'Neill<br><br> Goals:<br>The 
+typical store owner never needs to edit a code or define file directly.The store 
+owner does not need a lot of support on how to use program.Combines the functions 
+of moving data in and out of store is in one are.Make it flexable enough for 
+small, medium and large store to use program effectivly.Move program files closer 
+to OSC/Cre Loaded standerds for look and feel, and codeing.<br><br>Parts of 
+Data Feed Service:<br>&nbsp;Easy Populate: This is used to update data it allows 
+you to updated data remotely on your&nbsp;local computer and upload to the data 
+to your on line store. It allows you to&nbsp;&nbsp;build custom queries for 
+the data then download the information to your local computer&nbsp;&nbsp;for 
+editing, Then upload back to your &nbsp;on-line store.</p>
+<p>&nbsp;Data feed:<br>&nbsp;&nbsp;Data feed takes the data with in your catalog 
+and prepares it for submission to a feed &nbsp;service and send it to the feed 
+service either automaticly or manualy if you need on completion&nbsp;of building 
+the feed.<br>&nbsp;Features added and changes to basic programs.<br> &nbsp;&nbsp;&nbsp;Easy 
+populate 2.75 Advance to 2.78:<br>&nbsp;1. Removed the froogle feed from this 
+contribution. The froogle function is now &nbsp;handled by seperate code files.<br>&nbsp;2. 
+Moved EP from catalog side box to Data export/import side box.<br>&nbsp;3. Moved 
+function file to admin/includes/function directory to follow OSC standerds.<br>&nbsp;4. 
+Moved most simple function to function file, export now has all functions removed 
+. There is now only one function left in the EPA import file. <br>&nbsp;5. Redid 
+admin screens so it was more like the rest of the catalog.<br>&nbsp;6. Inserted 
+tep form function rather then html form function (Inprogress)<br>&nbsp;7. Added 
+popup help for informtion on how to use EPA.<br>&nbsp;8. Easy Populate Basic 
+is for backward compatibility with older versions of EP<br>&nbsp;&nbsp;&nbsp;&nbsp;EP 
+advance will import all EPA files of previous version of EPA. <br>&nbsp;9. Export 
+screen and Import screen seperated into two seperate files<br>&nbsp;10. Side 
+box changed, so that sub titles are offset.<br>&nbsp;11. Added date time to 
+split so each group of splits will be unique and old splits will&nbsp;not be 
+lost or over written. &nbsp;&nbsp;example EPA_Split1_2005Sep09-1010.txt.<br>&nbsp;12. 
+Program message, error, and output were place in one of three variable so they 
+could be outputed&nbsp;with in the html output section of the files.<br> &nbsp;&nbsp;<br>&nbsp;Items 
+fixed or enhanced from Ep 2.74 to 2.75 Advance:<br>&nbsp;1. To add products 
+the product id should be set to 0, there can be many 0's for product ID's.<br>&nbsp;2. 
+You no longer need to change the manufacturers table to change a manufacturers_id 
+first&nbsp;manf id to 1 or 0<br>&nbsp;3. No longer adds a empty product, caused 
+by not treating the last line as not product.<br>&nbsp;4. Added EP Basic, It 
+cannot install any EP Advanced files since they start with EPA a error<br>&nbsp;&nbsp;&nbsp;&nbsp;message 
+will be displayed. It can install any file that strts wil EPB or older EP files<br>&nbsp;5. 
+EP Advanced set up so it can only read files that start with EPA , prevents 
+reading older files.<br>&nbsp;6. Delete has been added back into EP for products 
+only. &nbsp;This is implemented via a new column call v_action. You must type 
+the word &quot;delete&quot; in this column to delete a product.<br>&nbsp;7. 
+EP basic was not showing on some site this was to an error in the install of 
+the&nbsp;admin_files a new set of admin_files was added to the install.<br>&nbsp;8. 
+You can add your own product ID, If your product ID's are based on a system 
+other than&nbsp;numbers generated by the shopping cart and autoincremented by 
+one. You still cannot&nbsp;&nbsp;use alpha character in product ID. This allows 
+for compatibility with some external inventory management systems.<br>&nbsp;9. 
+moved configuration of EP to a seperate file called epconfigure.php <br><br>&nbsp;Data 
+Feed:<br>&nbsp;1. Added language files<br>&nbsp;2. Multiple configurations for 
+multiple feed services now available through admin screen<br>&nbsp;3. Configuration 
+configured in admin rather then edit a file.<br>&nbsp;4. Feed submission now 
+A multiple step process.<br>&nbsp;5. Switched to tep functions for data base 
+queries.<br>&nbsp;6. Split file generation and FTP code into two separate files.<br>&nbsp;7. 
+Combined Froogle, Yahoo and Bizrite into one package (Not all installed and 
+adapted yet)<br>&nbsp;8. added fields for advance feed to products database<br>&nbsp;9. 
+added separate sql file for additional info for froogle feed<br>&nbsp;10. Builds 
+Category strings before building feed file.<br>&nbsp;11. Help popups added to 
+admin screens.<br>&nbsp;12. Added salemaker contribution pricing to price sent 
+to price in feed.<br>&nbsp;13. Uses tax zone from store. <br>&nbsp;14. Add the 
+feilds froogle_type, upc, isbn, manufacturer_product_id to products table and 
+products edit screen.<br>&nbsp;15. add froogle specific feilds for books, music, 
+video to a seperate table.<br><br>&nbsp;For EP set up:<br>&nbsp;For Data feeds 
+setp up:<br>Step 1 <br>&nbsp;To set up this modules data feed service, you must 
+first register with the feed services you wish to use.&nbsp;This is described 
+in the getting started document. It has links to the feed services &nbsp;and 
+what you need to set up the configuration of each service.<br>Step 2<br>Next 
+you need to install this contribution this is disturbed in the doc/install.txt 
+files<br>Step 3<br>The you will need to configure and run the data feeds this 
+is described in the running doc/configureandrun.txt document The file feild_spec.txt 
+describes the limitation of what can be placed into each felid<br><br>&nbsp;Known 
+bugs:<br>&nbsp;&nbsp;1. PHP 5 compatability for import. the problem is either 
+how globals are treated or&nbsp;&nbsp;how arrays are used in this contribution<br></p>
+ </td>
+</tr> 
+<tr>
+  <td>
+ <b>Error and staus messages</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+  All messages except the result of an import will apear near the top of the for, Blue background 
+  is for normal messages, red back ground for errors. <br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/epa_msg.gif" border="0" >
+  </td>
+</tr>
+<tr>
+  <td>
+ <b>Import result</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ The Import result will now apear below the admin screen<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/import_results.gif" border="0" >
+  </td>
+</tr>
+
+<tr>
+  <td>
+ <b>Help while using the admin screens</b>
+  </td>
+ </tr>
+ <tr>
+ <td>
+ You will notice a <img src="images/icon_info.gif" border="0" > through out the admin screens This
+ is individual help for each setting or imput you could use. It will display a popup window with
+ help.<br>
+  <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/ep/images/item_help.gif" border="0" >
+  </td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp; <a href="data.php?selected_box=data"> <img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
+

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_spreadsheet.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_spreadsheet.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/data_spreadsheet.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+  Original Author:
+  Updates by:
+
+*/
+
+?>
+<tr>
+ <td class="helpMain">
+
+
+<b><span style="font-size:14pt;">How to do specific task with the files in Easy Populate Advance:</span></b><br><br>
+Index:
+<br><b><a href="#1. Adding new products:">1. Adding new products:</a>
+<br><a href="#2. Adding linked products">2. Adding linked products</a></b>
+<br><b><a href="#3.Deleting products">3. Deleting products</a></b>
+<br><b><a name="4. Move a product to a new category:" href="#4. Move a product to a new category:">4. Move a product to a new category</a>
+<br><a href="#5. Reducing size of import file:">5. Reducing size of import file</a><br><a href="#6. Your first import file">6. Your first import file&nbsp;</a></b><a href="#6. Your first import file">
+</a><p>
+&nbsp;&nbsp;<b><a name="1. Adding new products:">1. Adding new products:</a>
+(</b>These procedures are for EPA only)<br> &nbsp;&nbsp;&nbsp;&nbsp;a. Because
+EPA uses the product_ID to link to your products in the database and EPB still
+uses model numbers many of the additional features for EPA cannot be added to
+EPB. &nbsp;EPB is used for backward compatibly to older versions of EP.<br>
+&nbsp;&nbsp;&nbsp; b. To add products the product_id should be 0, there can be many 0's for product ID's
+  as needed. The code will detect the 0 as a new product and auto increment the
+  products_id.
+  <br>
+
+&nbsp;&nbsp;&nbsp;  c. If the products_id number is left blank then the product is not added. You can also
+  insert you own product_ID. they do not have to be sequential. <br>
+
+&nbsp;&nbsp;&nbsp;  d. If you need to specify your own unique products_ID, and it does not exist in the data
+  base it will be added as a new product. Make sure you add the correct categories,
+  other wise you will need to use the move product to a new category procedure.
+<br>
+Example:
+<br>
+I have a previous inventory software that has already assigned product ID's they are
+<br>
+12001<br>
+15001<br>
+14<br>
+2000<br>
+<br>
+These can be used by simply putting the in the v-product_id column.
+<br><br> &nbsp;&nbsp;e. A Product_id must be a number, this is done so the admin
+products edit/add for will work.<br><br>
+&nbsp;&nbsp;<b><a name="2. Adding linked products">2. Adding linked products</a></b><a name="2. Adding linked products"> </a><br>(Yes Version 3.01 can handle linked products):
+A linked product is having one product record set, but having it show in multiple
+categories.
+<br>
+&nbsp;&nbsp;&nbsp;  a. For a product you want to link to another category
+Create a download using complete or model/category in the  Select fields to download
+you can limit the list by using the filter settings.
+<br>
+&nbsp;&nbsp;&nbsp;  b. Import into the spread sheet program.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 1. Copy the original product line to a new line<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 2. Change only category information where you want the product linked to.
+    Leaving the v_product_id unchanged.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; 3. Save the file and re upload<br>
+<br>
+&nbsp;&nbsp;<b><a name="3.Deleting products">3.Deleting products</a></b> (This has been added back for products only):
+<br>&nbsp;&nbsp;&nbsp;  a. Single product not linked
+<br>
+&nbsp;&nbsp;&nbsp;  Download any of the files that has a products_id's. You will notice a column called v_action
+all the way to the left. In this column add delete for each product you which to delete.
+<br>
+&nbsp;&nbsp;&nbsp;  b. Deleting linked product:
+ Do a download that has all of the links for the product
+cut the paste the item you which do remove in front of the product links to remain.
+In the v_action column enter delete for the link you want to remove.
+<br>
+Note: the deleted item must be listed first. The product to remain must be list after the
+product link you are deleting.
+<br><br>
+&nbsp;<b>&nbsp;<a name="4. Move a product to a new category:">4. Move a product
+to a new category:</a></b><br> Moving a product between two categories
+  In the spread sheet program
+<br>&nbsp;&nbsp;&nbsp;   1. copy the line for the product to a new line
+<br>&nbsp;&nbsp;&nbsp;   2. on the original line type in delete in the v_action column
+<br>&nbsp;&nbsp;&nbsp;   3. on the new line change the categories
+<br>
+&nbsp;<br><b><a name="5. Reducing size of import file:">5. Reducing size of
+import file</a></b><br>Removing columns in the spread sheet.
+Due to how Ep was designed you do not need all of the column from the export file to be present
+in the import file.
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   1. Minimum columns:
+<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;a.   products_id, v_status, v_action, EOREOR
+ If you have product information: any or all by products_id can be removed
+<br>&nbsp;&nbsp;&nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;b. If you have meta tags or header tags installed make sure you leave the set together  If you have product information: any or all by products_id's can be removed
+<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;c. If you have category information: any or all of the unused category_ columns.<br>
+<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Caution: EP reads a product record set from you data base, then merges&nbsp;data
+from the import file. &nbsp;If the column you removed from the export file is
+not in this beginning query then that column will be removed from the data base.
+&nbsp;Example: previously if you removed one of the ultra images fields it would
+delete all data from that column in the products database. &nbsp;Not this bug
+has been fixed for ultra images, but it is something to keep in mind when constructing
+new export files.<br><br>
+<b><a name="6. Your first import file">6. Your first import file</a></b>
+<br>  &nbsp;&nbsp;a. When you first start to load a store with products it is usually easier to
+set up you category structure in the admin before you begin<br> &nbsp;&nbsp;b.
+Back up your data base!!!!. <br>
+
+&nbsp;&nbsp;c. Export a complete download so you have all of the headers in the export file.<br>
+&nbsp;&nbsp;d. Start your spread sheet program and click on the open file.
+<br> &nbsp;&nbsp;e. Navigate to the directory on your local computer where the export file resides. Make
+sure you change the file type, in the open file dialog to &quot;text CVS,txt&quot;. If you do not all of the information in the
+text file will be read into one cell of the spreadsheet program.
+
+<br> &nbsp;&nbsp;f. Single (')  and double quotes (&quot;) , MYSQL has problem when you try to insert reserved characters.
+I can cause error when trying to import then into your database. There are two ways to
+handle these
+  <br> &nbsp;&nbsp;&nbsp;&nbsp;1. Escape the character Example: There\'s Something About Mary
+  <br> &nbsp;&nbsp;&nbsp;&nbsp;2. Use decimal equivalent of the character Example: There&amp;#39s Something About Mary
+&nbsp;&nbsp;
+EPA and EPB can read both of these and correctly inserts the MYSQL compatible character
+so single and double quotes are displayed correctly in the catalog. Even if
+you choose not to use either of these methods EPA and EPB will read the single
+and double quotes and convert then as needed.<br>
+
+&nbsp;&nbsp;g. Product descriptions: You can draft these with an external HTML
+editing program or word processor, but you must be careful which one you use.<br>
+&nbsp;&nbsp;Most MS products used proprietary formats that may not be compatible
+with most web browsers in use today.<br> &nbsp;&nbsp;h. When you save the spread
+sheet file the first time use the save as function instead of the save function.
+change the name to something different, in the file type make sure it is &quot;text CVS,txt&quot;.
+This will preserve the original file in case you already had product in it. This
+is done so that you can recover form possible errors.&nbsp;<br> &nbsp;&nbsp;i.
+For new products use the product use the product_id of 0 if you wish the cart
+to set you product id's or entry and number op to 15 digits you want.<br> &nbsp;&nbsp;j.
+Do one final save making sure the file type is &quot;text CVS,txt&quot;., then
+go to your cart in import the file.<br><br></td>
+</tr>
+<tr>
+ <td>
+&nbsp; &nbsp;  <a href="data.php?selected_box=data"><img src="includes/languages/english/images/buttons/button_return.gif"></a>
+  </td>
+</tr>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_export_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_export_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_field_group.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_field_group.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_add.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_add.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_delete.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_delete.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_split.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_split.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_uploaded_insert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_uploaded_insert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_uploaded_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_import_uploaded_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_limit_cat.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_limit_cat.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_limit_man.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_limit_man.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_limit_prodid.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_limit_prodid.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_sel_export.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_sel_export.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_sortorder.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_sortorder.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epa_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export_mesg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export_mesg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export_sel_feld.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export_sel_feld.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export_sel_loc.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_export_sel_loc.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_import.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_import.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_import_mesg.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_import_mesg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_import_select.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/epb_import_select.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_config.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_config.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_config1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_config1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_new_config.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_new_config.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_start.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/feed_froogle_start.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_catbuild.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_catbuild.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_catbuilddone.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_catbuilddone.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_feedbuilddone.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_feedbuilddone.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_feedsend_error1.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/froogle_feedsend_error1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/item_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/ep/images/item_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_edit_file.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_edit_file.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_edit_restore.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_edit_restore.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_list.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_list.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_search_t_before.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_search_t_before.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_search_t_results.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_search_t_results.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_searcht.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_file_searcht.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_main.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_main.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_select_lng.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_select_lng.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_dir.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_dir.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_file.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_file.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_insert.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_insert.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_lngr.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_lngr.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_lngr_grem.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/images/lng_selt_lngr_grem.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)<br><br>
+
+&nbsp;&nbsp;<b>Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index2.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index2.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index2.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<!-- Begin help search index1.html-->
+
+&nbsp;&nbsp;<b>Edit Help Page Index:</b><br>
+<UL>
+<LI><A HREF="#HOW">How Search Works</A></LI>
+<LI><A HREF="#SEARCH_FILE">Searching for a file name</a></LI>
+<LI><A HREF="#SEARCH_DEFINE">Searching for text within a file.</A></LI>
+</UL>
+<H3><A NAME="HOW">How Search Works</H3></a><br>
+&nbsp;&nbsp; You can search one of two ways depending on wich edit screen you are on.
+you can search for file names of test within the Languages define file. Search
+will detect which screen you are on either the a directory/file screen, or a Language Define Edit Screen.
+It will switch the between file and define search logic automaticly for you. <br>
+
+<H3><A NAME="SEARCH_FILE">Where Are the define located</H3></a><br>
+
+&nbsp;&nbsp;1. includes\languages  ~   In this directory all of the base define files reside. a base define file is common to more then one group of output screen.
+<br>&nbsp;&nbsp;2. includes\languages\(Langauge Name) ~ this is where the bulk of the language defines reside
+<br>&nbsp;&nbsp;3. includes\languages\(Langauge Name)\images ~  Unique images the are language dependent. Except for buttons
+<br>&nbsp;&nbsp;4. includes\languages\(Langauge Name)\modules ~ Specific to file that are in the includes/modules directory
+<br>&nbsp;&nbsp;5. includes\languages\(Langauge Name)\modules\order_total ~ Specific to file that are in the includes/modules/order_total directory
+<br>&nbsp;&nbsp;6. includes\languages\(Langauge Name)\modules\payment ~ Specific to file that are in the includes/modules/payment directory
+<br>&nbsp;&nbsp;7. includes\languages\(Langauge Name)\modules\shipping~ Specific to file that are in the includes/modules/shipping directory
+<br>
+
+<br>&nbsp;&nbsp;8. Language file not adressed by language editor.
+<br>&nbsp;&nbsp;includes\modules\payment\paypal\languages\english\ipn.lng.php
+<br>&nbsp;&nbsp;includes\modules\payment\paypal\languages\english.php
+<br>&nbsp;&nbsp;All language file in admin
+<br>
+<H3><A NAME="SEARCH_FILE">Searching for a file name</H3></a><br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to Tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_edit_file.png" border="0" >
+
+<H3><A NAME="SEARCH_DEFINE">Searching for text within a file</H3></a><br>
+While you are in edit mode you can search for Define Display text but not the label.
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Enter the text in search box<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Click the search button<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. This will bring up a list of defines<br>
+
+Below is an example of before and after, this is more usfull for some of the larger define files.<br>
+
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_file_search_t_before.png" border="0" >
+<br>&nbsp;&nbsp; <b>Before  search </b><br>
+
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_file_search_t_results.png" border="0" >
+<br>&nbsp;&nbsp;<b> After  search </b><br>
+<!-- End help searh index1.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index3.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index3.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index3.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<!-- Begin help edit index.html-->
+&nbsp;&nbsp;<b>Search Page Index:</b><br>
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+ <img src="<?php echo DIR_WS_LANGUAGES . $language ;?>/help/et/images/lng_edit_file.png" border="0" >
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Once you have navigated to the correct file to edit you then can edit the language defines.
+The intial edit screen is show above.</P>
+
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+
+<H3><A NAME="Edit">Editing Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Type in the new text<br>
+&nbsp;&nbsp; 2. Click on save next to the input box you just type in<br>
+&nbsp;&nbsp; 3. Double check your changes by viewing them in the cart.<br>
+&nbsp;&nbsp; 4. If they did not work or are incorrect, you can restore the previous text if change again in the editor<br>
+
+&nbsp; Note: you can only sabe changes for one input box at a time.<br>
+<H3><A NAME="RESTORE">Restoring Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Once you have saved the define your changes you can double check that it is correct. <br>
+&nbsp;&nbsp; 2. If it is not then you can click on the restore button to revert back to the previous langauge define.<br>
+
+
+<H3><A NAME="RESTORE">Restoring Language Defines</H3></a><br>
+&nbsp;&nbsp; 1. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 2. Single qoute with variable : Advanced Search's <br>
+&nbsp;&nbsp; 3. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 4. Single qoute : Advanced Search's <br>
+&nbsp;&nbsp; 5. Double qoutes: <br>
+
+
+
+<!-- End help edit index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index4.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index4.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index4.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<!-- Begin help index4.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+Once you have finished editing a define, click on the save next to the define. This will
+save the edit you made. You will return to the define edit screen so you can check you changes if for some reason it is not
+correct you can click on the restore and this will revert the file back to what it was before the save.
+</P>
+<P>
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Saving a new define.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<!-- End help index4.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index5.html
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index5.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/et/index5.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<!-- Begin help index.html-->
+By: Julian Brown, julian at jlbprof.com<br>
+Updated by: Tom O'Neill (AKA zip1)
+
+<UL>
+<LI><A HREF="#WHAT">What is this?</A></LI>
+<LI><A HREF="#TASK">Specific Task Help</a></LI>
+<LI><A HREF="#PROBLEM">What to do if you have a problem</A></LI>
+<LI><A HREF="#CHANGES">Changes from last version</A></LI>
+</UL>
+
+<H3><A NAME="WHAT">What is this?</a></H3>
+<P>
+This script allows you to quickly edit almost all displayed text on your Cre Loaded language files.
+It is intended to replace define_languages.php, as the current define_languages.php has several problem.
+</P>
+<P>
+Text is store in two places, the database and language defines files. Language Define Editor is
+entended to edit the language define file within the /languages directory or a sub directory. All language defines
+files should reside in the /languages directory. If they do not then the contributon does not
+meet OSC or Cre Loaded standerds
+</P><br>
+<H3><A NAME="TASK">Specific Task Help</H3></a><br>
+&nbsp;&nbsp; 1. Identifying the text to edit.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Note the file name in the browser url box.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Next note the text you want to change.<br><br>
+&nbsp;&nbsp; 2. Finding the correct file: <br>
+&nbsp;&nbsp;&nbsp;&nbsp;   a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;   c. Click on the file name of the file.<br><br>
+&nbsp;&nbsp; 3. Searching for files:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    a. Go to tools > Define Languages.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    b. Select the directory the define file resides in.<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    c. In the search box type in all or part of the file name without the .php<br>
+&nbsp;&nbsp;&nbsp;&nbsp;    d. This will bring up a list of files that contain all or part of
+the text you type in the search box. click on the file name you wish to edit.<br><br>
+
+You can also go directly to a particular file and modify the text in that file.<br>
+
+
+<H3><A NAME="PROBLEM">What to do if you have a problem</H3></a><br>
+<P>
+Language define files have variables in them. If for some reason one of these get changed you can always revert back
+to the file before editng by clicking on restore. A restore button will apear after you save your edits.
+click on the &quot;Restore File&quot; button at the top of the page.  The file will then take on
+the contents it had prior to the last change.
+
+You should always check your changes between each save.
+</P>
+<P>
+This works both in MS1 and MS2.
+<br></P>
+
+<H3><A NAME="CHANGES">Added and changed features</H3></a><br>
+1. Reorganized file internals,<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a. moved functions to function file<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b. converted some function calls to actions<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c. added tep form funtions instead of html forms<br>
+2. Added images buttons instead of HTML submits<br>
+3. Removed lines around each text define to contribution looks like it fits Cre Loaded Better<br>
+4. Add ability to edit defines on other sub directories beside /languges, /language/(langauge)&nbsp;<br>
+5. Reorganized help screen, and place the help screen with in th context of the admin inerface.<br>
+6. Rewrote language select drop down.<br>
+7. Rewrote the search function so it searches filename or defines depending on which screen
+you are on.<br>
+8. Added insert define so you could add defines to a file. (still in progress)<br>
+<!-- End help index.html-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/authnet_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/authnet_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/authnet_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<?php
+/*
+  $Id: invoice.php,v 1.2 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"><html <?php echo HTML_PARAMS; ?>>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title>Authorize.net Consolidated CRE Help Screen</title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="admin/includes/general.js"></script>
+</head>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+
+
+     <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading">Authorize.net Consolidated CRE Edition</td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+       <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+         <td class="main">
+
+<div align="center"><h2>Configuration Help Screen</h2></div>
+</td>
+</tr>
+<tr>
+ <td align="center">
+<a href=" https://freecreditcardprocessing.com/applynow/online_application.asp?code=chainreaction"> <h2>Link to Apply for Authorize.net account</h2></a><br>
+(support the CRE project by using our authorize.net partner)
+</td>
+</tr>
+<tr>
+<td>
+<hr align="center" size="4" width="450">
+</td>
+</tr>
+<tr>
+<td>
+User your browser back button to return to the Authorize.net edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Authorize.net testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Authorize.net Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Authorize.net User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Authorize.net Consolidated uses the AIM method of
+connecting to Authorize.net.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Authorize.net gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don't know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Authorize.net Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Authorize.net Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>
+<hr align="center" size="4" width="450">
+  </tr>
+        </td></table>
+          </tr>
+         </td>
+
+   </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/paypal/Help_Config.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/paypal/Help_Config.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/paypal/Help_Config.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: Help_Config.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td>
+  <H3><b> Paypal Setup </h3> </b><br>
+   Please use your browsers back button to return.    
+    </td>
+  </tr>
+  <tr>
+    <td class="pptext">The following is a guide towards configuring your store's PayPal payment module settings:</td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">Enable PayPal Module</b><br>Since you have just done the installation, by default it will say yes.</li><br>
+      <li><b class="ppem380">E-Mail Address</b><br>Enter your Primary PayPal email address here, if you have more than one email address registered with PayPal then you must login your PayPal account to determine which one is your <b>Primary</b> email address.</li><br>
+      <li><b class="ppem380">Business ID</b><br>If you have configured a secondary email address to be your Business ID (email address) in your PayPal profile account, then enter this here, otherwise enter the one used above.</li><br>
+      <li><b class="ppem380">Transaction Currency</b><br>Choose which currencies you want to accept PayPal payments with.</li><br>
+      <li><b class="ppem380">Payment Zone</b><br>If a zone is selected, only enable this payment method for that zone.</li><br>
+      <li><b class="ppem380">Set <b>Pending Notification</b> Order Status</b><br>Set the Pending Notification status of orders made with this payment module to this value, '<b style="color:blue">Pending</b>' is suggested or alternatively the optional order status created in step 4 above.</li><br>
+      <li><b class="ppem380">Set <b>Order</b> Status</b><br>Set the status of orders made with this payment module to this value <b style="color:red">Do not set it to 'default' but specifically choose the status required</b>, '<b style="color:blue">Processing</b>' is suggested.</li><br>
+      <li><b class="ppem380">Set <b>On Hold Order</b> Status</b><br>This order status is used when the Cart Test has failed, eg. the expected payment amount did not match.</li><br>
+      <li><b class="ppem380">Set <b>Canceled Order</b> Status</b><br>Refunded, Reversed, Failed or Denied payments will be set to this order status.</li><br>
+      <li><b class="ppem380">Synchronize Invoice</b><br>Specify whether the osCommerce order number should be used as a <b>unique</b> PayPal invoice number, similiar to PayPal's Send Money feature, this will enable customers to resume an order via their osCommerce account history info page for that order for pending transactions which were not previously completed.</li><br>
+      <li><b class="ppem380">Sort order of display</b><br>Sort order of display. Lowest is displayed first.</li><br>
+      <li><b class="ppem380">Background Color</b><br>Select the background color of PayPal's payment pages, either black or white.</li><br>
+      <li><b class="ppem380">Processing logo</b><br>Specify the image file name to be used in the store's checkout process splash page, must be located in <code>catalog/images</code> directory.</li><br>
+      <li><b class="ppem380">Store logo</b><br>Specify the image file name for PayPal to display on their payment pages pages, must be located in <code>catalog/images</code> directory. If you do not have SSL then leave this field blank.</li><br>
+      <li><b class="ppem380">PayPal Page Style Name</b><br>Specify the name of the page style you have configured in your PayPal account profile.</li><br>
+      <li><b class="ppem380">Include a note with payment</b><br>When a customer arrives at the PayPal payment page you can choose whether or not to show them another note field which will have seperate contents from that of the one provided in your store's checkout process but will be included in PayPal's invoice and receipt.<br>To change the title appearing above this field on the PayPal payment page look in the corresponding catalog langauge file (<code>catalog/includes/langauges/english/modules/payment/paypal.php</code>).</li><br>
+      <li><b class="ppem380">Shopping Cart Method</b><br>Choose which type of PayPal Shopping Cart you want to use, Aggregate simply means the total amount is passed (with a list of the products shown in a single item field), whereas an Itemized Cart will list indivudally all the items the customer has selected in their PayPal invoice.</li><br>
+      <li><b class="ppem380">Enable PayPal Shipping Address</b><br>Allow the customer to choose their own PayPal shipping address. 
+      (See FAQ's for more info)</li><br>
+      <li><b class="ppem380">Digest Key</b><br>Specify a unique digest key, this will then be used similiar to a password while testing via the IPN Test Panel <b>and</b> also the store's PayPal transaction signature digest key.</li><br>
+      <li><b class="ppem380">Test Mode</b><br>This should be off for live environments.<br>You can simulate your own IPNs via the
+      <a href="<?php 
+      //echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>">
+      IPN Test Panel</a>.</li><br>
+      <li><b class="ppem380">Cart Test</b><br>This test verifies that the amount received via PayPal matches to what is expected 
+      (See FAQ's for more info).</li><br>
+      <li><b class="ppem380">Debug Email Notifications</b><br>Choose whether you want to receive debug emails.</li><br>
+      <li><b class="ppem380">Debug Email Notification Address</b><br>Enter a seperate email address where you wish to receive <b>debug</b> emails.</li><br>
+      <li><b class="ppem380">PayPal Domain</b><br>This must be set to <b>paypal.com</b> for live production environments, this setting is to facilate PayPal's sandbox and is not related to the IPN Test Panel or the above Test Mode option.</li><br>
+      <li><b class="ppem380">Return URL behavior</b><br>This determines what method PayPal should use when returning the customer back to the store, leave this set to 1 (GET).</li><br>
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd">
+    </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/paypal/Help_FAQs.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/paypal/Help_FAQs.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/help/payment/paypal/Help_FAQs.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,86 @@
+<?php
+/*
+  $Id: Help_FAQs.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td>
+   <H3><b> Paypal Faq\'s </h3> </b><br>
+   Please use your browsers back button to return.
+ </td>
+  </tr>
+  <tr>
+    <td class="pptext">The following are some frequently asked questions about this payment module:
+    </td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">My shipping costs are different once the customer arrives at the PayPal site.</b></legend><div>In your PayPal account profile in the shipping section, check the box that allows overriding the shipping costs.</li><br>
+      <li><b class="ppem380">Do I need to enable IPN in my PayPal account profile.</b><br>No.</li><br>
+      <li><b class="ppem380">What url should I specify for the IPN feature to be used.</b><br>You don't need to, it will automatically be specified.</li><br>
+      <li><b class="ppem380">Why doesn't the Auto-Return feature work.</b><br>You must enable it first in your PayPal account profile.</li><br>
+      <li><b class="ppem380">What url should I specify for the Auto-Return feature.</b><br>It doesn't matter, this contribution will automatically specify the correct script url location, which is now <code>catalog/checkout_success.php</code></li><br>
+      <li><b class="ppem380">Does this contribution support PayPal Credit Card payments.</b><br>Yes.</li><br>
+      <li><b class="ppem380">Why am I getting so many emails per transaction.</b><br>You get <b>one</b> from PayPal and <b>one</b> osCommerce order confirmation email, and another which is the <b>debug email</b>, either disable <b>debug</b> email notification or specify a sperate email address for <b>debug</b> emails.</li><br>
+      <li><b class="ppem380">Why am I not receiving any IPNs.</b><br>You must ensure that your <b>Primary Email Address</b> and <b>Business ID</b> are configured correctly.<br>Login to your PayPal Account and see what and how many email addresses you are using and which one is the Primary address.<br>Also check your debug emails as it will also specify the Primary Email Address of the intended receiver.</li><br>
+      <li><b class="ppem380">I'm having problems with Multi-Currencies.</b><br>This problem should now be resolved, previously the <b>Cart Test</b> was comparing the currency and amounts of the actual order to what PayPal received as opposed to actually comparing the currency and amounts prior to transfering the customer to PayPal.<br><br><b>However</b>, if you're using the Itemized Shopping Cart then discrepancies may arise due to PayPal's two decimal place calculations, in such an event the order will be placed on hold. Although this type of discrepancy may not affect all orders it does however exist and now adds a future requirement to enable you to finalize the transaction via your store's admin.</li><br>
+      <li><b class="ppem380">I'm having problems verifying the Cart Totals.</b><br>See above.</li><br>
+      <li><b class="ppem380">Why is there no PayPal shipping address details in the IPN info?</b><br>Set Enable PayPal Shipping Address to 'No' if you require a PayPal verified shipping address or set to 'Yes' if you do not.</li><br>
+      <li><b class="ppem380">How can I customize the Checkout redirect page.</b><br>The splash template page shown while transfering the customer to PayPal is:<br><code>catalog/includes/modules/payment/paypal/catalog/checkout_splash.inc.php</code></li><br>
+      <li><b class="ppem380">Where can I find more PayPal logo buttons.</b><br>Login to your PayPal account and click Merchant Tools or Auction Tools.</li><br>
+      <li><b class="ppem380">Where can I find PayPal documentation.</b><br><ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;"><li><a href="https://www.paypal.com/en_US/pdf/integration_guide.pdf">PayPal Integration Manual</a></li></ul></li><br>
+
+      <li><b class="ppem380">How do I use PayPal's Sandbox.</b>
+        <ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;">
+          <li>Register with <a href="https://developer.paypal.com/" target="PPDC">PayPal Developer Central</a></li>
+          <li>Then create <b>two virtual accounts</b> types:<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Personal Account</li><li>Premier or Business Account</li></ul></li>
+          <li>Confirm both accounts (each is just a single click option).</li>
+          <li>Transfer some virtual money into your personal account (Click the add funds link).</li>
+          <li>Emails to both accounts will appear in the section where you initially login into the PayPal Developer Central, no real emails are sent so the email addresses for your virtual accounts should be fictitious.</li>
+          <li>Now in your <a href="<?php 
+          //echo tep_href_link(FILENAME_MODULES,'set=payment&module=paypal&action=edit');
+          
+          ?>" target="_blank">osCommerce::Admin::Modules::Payment::PayPal</a> configuration section<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Enter the virtual business account email address into both the Primary Email Address and Business ID fields</li><li>Set the domain to www.sandbox.paypal.com</li></ul></li>
+          <li>Now checkout as a customer via the store, this account should have a real email address (so that you can receive the osC customer order confirmation email), and when you arrive at the PayPal Sandbox site (look for their logo) then login using the virtual personal account details and finalize the payment process.</li>
+        </ul>
+       <br><p class="ppsmallerrorbold">Note that you must first login via the PayPal Developer Central prior to testing the Sandbox/Checkout process.</p>
+      </li><br>
+
+      <li><b class="ppem380">What's the difference between the IPN Test Panel and using PayPal's Sandbox.</b><br>The <a href="<?php 
+      //echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>" target="itp">IPN Test Panel</a> is an independent osCommerce Contribution feature, for testing and development purposes, which allows you to simmulate your own IPNs without having to interact with PayPal.<br><br><p class="ppsmallerrorbold">All Test IPNs via the IPN Test Panel will be invalid according to PayPal since they're not authentic transactions.</p></li><br>
+      <li><b class="ppem380">Is the IPN Test Panel related to PayPal's Sandbox.</b><br>No, see above.</li><br>
+      <li><b class="ppem380">What's the purpose of the digest key.</b><br>Currently the digest key serves two purposes, it authenticates and allows you to use the <a href="<?php // echo tep_href_link(FILENAME_PAYPAL,'action=itp');
+      ?>" target="itp">IPN Test Panel</a>, secondly, untill such time that PayPal provides a secure method of associating an IPN specifically to a particular order, it serves as a unique transaction signature identifier.</li><br>
+      <li><b class="ppem380">Should I change the digest key default value.</b><br>Yes, but remember what it is if uninstalling and reinstalling this contrib payment module in the admin since there might be existing pending orders which will require it in order to associate with to their corresponding IPN(s).</li><br>
+      <li><b class="ppem380">How are IPNs deleted.</b><br>Currently, an IPN appearing the admin section is deleted automatically when deleting it's corresponding order.</li><br>
+      <li><b class="ppem380">How can a customer resume their order.</b><br>Currently, if the customer abandons the checkout process at the PayPal site, e.g for some reason they did not actually pay at that time, then they can log into their osCommerce account and click the confirm order button when viewing the details of that particular order in their account_history_info.<br><br>This feature is only available when <b>synchronizing invoices</b> with PayPal.<br><br>This means that if you ever reset the osCommerce <code>orders</code> database table then you must also update it's auto-increment value to be greater than the last known <code>order_id</code>.</li><br>
+      <li><b class="ppem380">I'm getting errors after installing the contribution.</b><br>First, go through the installation edits and remove any blank spaces at the beginning of the line(s), some text editors will insert hidden characters which is a side effect of copying and pasting from HTML documentation.<br>Make sure that the alterations have been performed as well as running the paypal_ipn.sql script.</li><br>
+
+      <li><b class="ppem380">What type of PayPal account do I need.</b><br>You will need either a Premier or Merchant Business Account. <a href="https://www.paypal.com/refer/pal=PS2X9Q773CKG4" target="_blank">Click&nbsp;here&nbsp;to&nbsp;register&nbsp;for&nbsp;an&nbsp;account</a> if you do not already have one.</li><br>
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd"><form name="contents" action="<?php
+    //echo tep_href_link(FILENAME_PAYPAL,'','NONSSL'); 
+    ?>"><input type="hidden" name="action" value="help" /><input type="submit" value="Contents" class="ppbuttonsmall" />
+    </form></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_activate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_activate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_add_article.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_add_article.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_add_field.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_add_field.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_add_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_add_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_files.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_files.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_group.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_group.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_groups.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_groups.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_home.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_home.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_member.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_member.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_members.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_members.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_permission.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_permission.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_remove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_admin_remove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_billing.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_billing.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_backup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_backup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_blank.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_blank.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_browse.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_browse.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_cancel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_cancel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_cancel_edit_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_cancel_edit_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_check_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_check_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_check_links.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_check_links.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_confirm_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_confirm_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_convert.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_convert.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_copy.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_copy.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_copy_to.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_copy_to.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_create.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_create.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_create_customer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_create_customer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_create_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_create_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_decrypt.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_decrypt.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_details.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_details.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_attributes.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_attributes.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_footer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_footer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_header.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_header.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_infoboxes.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_infoboxes.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_key.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_key.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_lang_define.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_lang_define.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_mainpage.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_mainpage.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_status.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_status.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_values.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_edit_values.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_email.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_email.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_encrypt.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_encrypt.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_file_manager.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_file_manager.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_free_signup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_free_signup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_insert.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_insert.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_insert_into_db.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_insert_into_db.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_invoice.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_invoice.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_lock.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_lock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_module_install.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_module_install.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_module_remove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_module_remove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_move.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_move.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_article.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_article.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_author.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_author.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_banner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_banner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_category.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_category.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_country.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_country.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_currency.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_currency.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_event.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_event.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_faq.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_faq.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_file.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_file.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_folder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_folder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_language.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_language.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_news_item.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_news_item.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_newsletter.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_newsletter.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_sale.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_sale.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_tax_class.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_tax_class.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_tax_rate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_tax_rate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_topic.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_topic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_zone.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_new_zone.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_next.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_next.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_orders.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_orders.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_packingslip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_packingslip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_preview.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_preview.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_preview_upload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_preview_upload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_print.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_print.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_print_page.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_print_page.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_process.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_process.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_quick_save.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_quick_save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_release.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_release.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_remove_fields.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_remove_fields.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_removeccinfo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_removeccinfo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_report.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_report.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_reset.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_reset.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_restore.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_restore.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_return.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_return.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_review_approve.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_review_approve.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_review_disapprove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_review_disapprove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_run.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_run.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save_edit_product.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save_edit_product.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save_finish.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save_finish.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save_reload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_save_reload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_select.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_select.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_send_mail.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_send_mail.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_split_file.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_split_file.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_spllit_files.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_spllit_files.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_start_file_creation.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_start_file_creation.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_template_admin.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_template_admin.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_unlock.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_unlock.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_box_positions.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_box_positions.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_currencies.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_currencies.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_fields.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_fields.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_status.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_update_status.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_upload.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_upload.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_verify.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/button_verify.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/ic_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/ic_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/ic_up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/ic_up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/review_approve.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/review_approve.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/review_disapprove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/review_disapprove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/sync.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/languages/german/images/buttons/sync.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/languages/german/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+<?php
+
+define('TEXT_CRELOADED','CRE Loaded.com');
+define('TEXT_OSC','osCommerce.com');
+
+
+//common
+define('TEXT_MANAGE','Verwalten');
+define('TEXT_ADD','Hinzuf&uuml;gen');
+define('TEXT_VIEW','Anzeigen');
+define('TEXT_INSTALLED','Installiert');
+define('TEXT_ENABLED','Aktiviert');
+
+// Store box
+define('BLOCK_TITLE_STORE_INFO','Store Info');
+$storename="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=1&cID=1&action=edit")."'>Store Name</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_NAME',$storename);
+$storestatus="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=16&cID=153")."'>Store Status</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_STATUS',$storestatus);
+$storeemail="<a class='adminLink' href='".tep_href_link(FILENAME_CONFIGURATION,"gID=1&cID=4")."'>Store Email</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_EMAIL',$storeemail); 
+$defaulttemplate="<a class='adminLink' href='".tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,"cID=7")."'>Default Template</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_TEMPLATE',$defaulttemplate); 
+$primarylang="<a class='adminLink' href='".tep_href_link(FILENAME_LANGUAGES)."'>Prim&auml;re Sprache</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_LANGUAGE',$primarylang); 
+$primarycurr="<a class='adminLink' href='".tep_href_link(FILENAME_CURRENCIES)."'>Prim&auml;re W&auml;hrung</a>";
+define('BLOCK_CONTENT_STORE_INFO_STORE_CURRENCY',$primarycurr);
+define('BLOCK_CONTENT_STORE_INFO_STORE_TAX_RATE','Steuer-Satz');
+define('BLOCK_CONTENT_STORE_INFO_STORE_TAX_ZONE','Steuer-Zone');
+define('BLOCK_CONTENT_STORE_INFO_STORE_BACKUPS','Datenbank sichern'); 
+// Store tips
+define('BLOCK_HELP_STORE_INFO','<ul><li><strong>Shop Info</strong><br>Shopinformationen aus der Datenbank.<br> Sie k&ouml;nnen sich die Konfiguration anschauen >> Die Shopeinstellungen editieren oder modifizieren.</li></ul>');
+define('BLOCK_HELP_STORE_STATUS','<ul><li><font color=#009900><strong>Aktiv</strong></font><br>der Shop ist aktiv f&uuml;r die Kunden.</li><li><font color=#FF0000><strong>Wartungsarbeiten</strong></font><br>Wartungsarbeiten, der Shop steh den Kunden nicht zur Verf&uuml;gung</li></ul>');
+define('BLOCK_HELP_STORE_BACKUP','Bitte machen Sie eine Datensicherung der Datenbank!');
+
+// Order Box
+define('BLOCK_TITLE_ORDERS','Orders');
+define('BLOCK_HELP_ORDERS','<ul><li><strong>Total Orders</strong><br> This is total count of Order records available in database, irrespective of status.</li><li><strong>Orders Pending</strong><br>Total count of orders, whose status is <font color=red>Pending</font></li><li><strong>Processing<br></strong>Total count of orders, whose status is <font color=red>Processing</font></li>  </ul>');
+
+// reports
+define('BLOCK_TITLE_REPORTS','Reports');    
+define('BLOCK_CONTENT_REPORTS_PRODUCTS_VIEWED','Products Viewed');
+define('BLOCK_CONTENT_REPORTS_PRODUCTS_PURCHASED','Products Purchased');
+define('BLOCK_CONTENT_REPORTS_CUSTOMER_ORDERS_TOTAL','Customer Orders-Total');
+define('BLOCK_CONTENT_REPORTS_MONTHLY_SALES_TAX','Monthly Sales/Tax');
+define('BLOCK_HELP_REPORTS','<ul><li><strong>Reports</strong><br> Click on the links below to view the reports.</li>  </ul>');
+
+// Products
+define('BLOCK_TITLE_PRODUCTS','Products');
+define('BLOCK_CONTENT_PRODUCTS_CATEGORIES','Total Number of Categories');
+define('BLOCK_CONTENT_PRODUCTS_TOTAL_PRODUCTS','Total Number of Products');
+define('BLOCK_CONTENT_PRODUCTS_ACTIVE','Active Products');
+define('BLOCK_CONTENT_PRODUCTS_NOSTOCK','Out of Stock');
+define('BLOCK_HELP_PRODUCTS','<ul><li><strong>Total Number of Products</strong><br>This is total count of products in database irrespective of categories and status.</li><li><strong>Active Products</strong><br>This is total count of live products which are online for sales. This record didcuscts products deactiveated by store admin and out of stocks.</li><li><strong>Out Of Stock<br></strong>This is total count of products, which are not in stock.</li></ul>');
+
+//reviews
+define('BLOCK_TITLE_REVIEWS','Reviews');
+define('BLOCK_CONTENT_REVIEWS_TOTAL_REVIEWS','Total Number of Reviews');
+define('BLOCK_CONTENT_REVIEWS_WAITING_APPROVAL','Waiting Approval');
+define('BLOCK_HELP_REVIEWS','<ul><li><strong>Total Number Reviews</strong><br>This is total count of product records available in database, irrespective of categories, products and status.</li><li><strong>Waiting Approval</strong><br>  Total count of review waiting for admin approval.</li></ul>');
+
+//Customers
+define('BLOCK_TITLE_CUSTOMERS','Customers');
+define('BLOCK_CONTENT_CUSTOMERS_TOTAL','Total Customers');
+define('BLOCK_CONTENT_CUSTOMERS_SUBSCRIBED','Subscribed');
+define('BLOCK_HELP_CUSTOMERS','<ul>  <li><strong>Total Customers</strong><br>This is total count of customers who signedup with store.</li><li><strong>Subscribed</strong><br>Total count of customers who subscribed for Newsletter and or Product Notifications.</li></ul>');
+
+// Affiliates
+define('BLOCK_TITLE_AFFILIATE','Affiliates');
+define('BLOCK_CONTENT_AFFILIATE_TOTAL','Total Affiliates');
+define('BLOCK_CONTENT_AFFILIATE_SALES','Affiliate Sales');
+define('BLOCK_CONTENT_AFFILIATE_COMMISSION','Total Affiliate Commission');
+define('BLOCK_HELP_AFFILIATE','<ul><li><strong>Affiliates</strong><br>Details of Affiliates. Use <strong>Manage</strong> link to manage affiliates.</li></ul>');
+
+//Links
+define('BLOCK_TITLE_LINKS','Links');
+define('BLOCK_CONTENT_LINKS_TOTAL','Total Links');
+define('BLOCK_CONTENT_LINKS_CATEGORIES','Link Categories');
+define('BLOCK_CONTENT_LINKS_WAITING','Waiting Approval');
+
+//Shipping Module
+define('BLOCK_TITLE_SHIPPING_MODULES','Shipping Modules');
+define('BLOCK_CONTENT_SHIPPING_MODULES_INSTALLED','Modules Installed');
+define('BLOCK_CONTENT_SHIPPING_MODULES_ENABLED','Modules Enabled');
+define('BLOCK_HELP_SHIPPING_MODULES','<ul><li><strong>Shipping Modules</strong><br>Number of Shipping modules Installed and you are currently using. Use <strong>Manage</strong> link to manage shipping modules.</li></ul>');
+
+// Payment Modules
+define('BLOCK_TITLE_PAYMENT_MODULES','Payment Modules');
+define('BLOCK_CONTENT_PAYMENT_MODULES_INSTALLED','Modules Installed');
+define('BLOCK_CONTENT_PAYMENT_MODULES_ENABLED','Modules Enabled');
+define('BLOCK_HELP_PAYMENT_MODULES','<ul><li><strong>Payment Modules</strong><br>Number of Payment modules Installed and you are currently using. Use <strong>Manage</strong> link to manage payment modules.</li></ul>');
+
+//Taxes
+define('BLOCK_TITLE_TAX_RATES','Tax Rates');
+define('BLOCK_HELP_TAXES','<ul><li><strong>Taxes</strong><br>Number of Zones Installed</li></ul>');
+
+// CRE Forge
+define('BLOCK_TITLE_CRE_FORGE',"CRE Forge");
+define('BLOCK_CONTENT_CRE_FORGE_BUG_TRACKER',"Bug Tracker");
+define('BLOCK_CONTENT_CRE_FORGE_FEATURE_REQUESTS',"Feature Requests");
+define('BLOCK_CONTENT_CRE_FORGE_SVN_REPOSITORY',"SVN Repository");
+define('BLOCK_CONTENT_CRE_FORGE_SUPPORT_REQUEST',"Support Request");
+define('BLOCK_CONTENT_CRE_FORGE_FILE_RELEASES',"File Releases");
+define('BLOCK_TITLE_CRE_NEWS',"CRE Loaded News");
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/index_new.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/index_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/index_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+define('TEXT_ADMIN_HOME','Admin Home');
+define('TEXT_VIEW_CATALOG','Katalog anzeigen');
+define('TEXT_FORUMS','CRE Forum');
+define('TEXT_PURCHASE_SUPPORT','CRE Support kaufen');
+define('TEXT_HOSTING','Zertifiziertes CRE Hosting');
+define('TEXT_WELCOME','Willkommen <strong>' . STORE_ADMIN_NAME . '</strong> bei <strong>' . STORE_NAME . '</strong> Administration!');
+define('TEXT_ADMIN_LANG','Admin Sprache:');
+define('TEXT_CHANGE_PASWORD','Passwort &auml;ndern');
+define('TEXT_LOGOUT','Abmelden');
+define('TEXT_CHECK_UPDATES','Auf aktuelle Version pr&uuml;fen');
+define('TEXT_GET_PRO','Pro Version kaufen');
+
+//common
+define('TEXT_MANAGE','Verwalten');
+define('TEXT_ADD','hinzuf&uuml;gen');
+define('TEXT_VIEW','anzeigen');
+define('TEXT_INSTALLED','Installiert');
+define('TEXT_ENABLED','Eingeschaltet');
+
+// Store box
+define('TEXT_STORE_INFO','Shop Informationen');
+define('TEXT_STORE_NAME','Shop Name');
+define('TEXT_STORE_STATUS','Shop Status');
+define('TEXT_STORE_EMAIL','Shop Email'); 
+define('TEXT_STORE_TEMPLATE','Standard Template'); 
+define('TEXT_STORE_LANGUAGE','Prim&auml;re Sprache'); 
+define('TEXT_STORE_CURRENCY','Prim&auml;re W&auml;hrung');
+define('TEXT_STORE_TAX_RATE','MwSt. Satz');
+define('TEXT_STORE_TAX_ZONE','MwSt. Zone');
+define('TEXT_STORE_BACKUPS','Datenbank Sicherungen'); 
+// Store tips
+define('TEXT_HELP_STORE_INFO','<ul><li><strong>Store Info</strong><br>Store info which you have in database.<br> You can visit Configuration >> My Store to edit / modify the same.</li></ul>');
+define('TEXT_HELP_STORE_STATUS','<ul><li><font color=#009900><strong>Active</strong></font><br>Store is open for business.</li><li><font color=#FF0000><strong>Maintanace</strong></font><br>Down for maintananace</li></ul>');
+define('TEXT_HELP_STORE_BACKUP','Create Fresh Backup Now!');
+
+// Order Box
+define('TEXT_ORDERS','Orders');
+define('TEXT_HELP_ORDERS','<ul><li><strong>Total Orders</strong><br> This is total count of Order records available in database, irrespective of status.</li><li><strong>Orders Pending</strong><br>Total count of orders, whose status is <font color=red>Pending</font></li><li><strong>Processing<br></strong>Total count of orders, whose status is <font color=red>Processing</font></li>  </ul>');
+define('TEXT_PENDING','Pending');
+define('TEXT_PROCESSING','Processing');
+define('TEXT_DELIVERED','Delivered');
+define('TEXT_PAYPAL_PROCESSING','Paypal Processing');
+define('TEXT_ALLOW_DOWNLOAD','Allow Download');
+define('TEXT_ON_HOLD','On Hold');
+define('TEXT_CANCELED','Canceled');
+define('TEXT_AWAITING_CC_PROCESSING','Awaiting CC Processing');
+
+
+// reports
+define('TEXT_REPORTS','Reports');
+define('TEXT_REPORTS_PRODUCTS_VIEWED','Products Viewed');
+define('TEXT_REPORTS_PURCHASED','Products Purchased');
+define('TEXT_ORDERS_ORDER_TOTAL','Customer Orders-Total');
+define('TEXT_ORDERS_SALES_TAX','Monthly Sales/Tax');
+define('TEXT_HELP_REPORTS','<ul><li><strong>Reports</strong><br> Click on the links below to view the reports.</li>  </ul>');
+
+// Products
+define('TEXT_PRODUCTS','Products');
+define('TEXT_PRODUCTS_CATEGORIES','Total Number of Categories');
+define('TEXT_PRODUCTS_TOTAL_PRODUCTS','Total Number of Products');
+define('TEXT_PRODUCTS_ACTIVE','Active Products');
+define('TEXT_PRODUCTS_NOSTOCK','Out of Stock');
+define('TEXT_HELP_PRODUCTS','<ul><li><strong>Total Number of Products</strong><br>This is total count of products in database irrespective of categories and status.</li><li><strong>Active Products</strong><br>This is total count of live products which are online for sales. This record didcuscts products deactiveated by store admin and out of stocks.</li><li><strong>Out Of Stock<br></strong>This is total count of products, which are not in stock.</li></ul>');
+
+//reviews
+define('TEXT_REVIEWS','Reviews');
+define('TEXT_REVIEWS_TOTAL','Total Number of Reviews');
+define('TEXT_REVIEWS_WAITING','Waiting Approval');
+define('TEXT_HELP_REVIEWS','<ul><li><strong>Total Number Reviews</strong><br>This is total count of product records available in database, irrespective of categories, products and status.</li><li><strong>Waiting Approval</strong><br>  Total count of review waiting for admin approval.</li></ul>');
+
+//Customers
+define('TEXT_CUSTOMERS','Customers');
+define('TEXT_CUSTOMERS_TOTAL','Total Customers');
+define('TEXT_CUSTOMERS_SUBSCRIBED','Subscribed');
+define('TEXT_HELP_CUSTOMERS','<ul>  <li><strong>Total Customers</strong><br>This is total count of customers who signedup with store.</li><li><strong>Subscribed</strong><br>Total count of customers who subscribed for Newsletter and or Product Notifications.</li></ul>');
+
+// Affiliates
+define('TEXT_AFFILIATE','Affiliates');
+define('TEXT_AFFILIATE_TOTAL','Total Affiliates');
+define('TEXT_AFFILIATE_SALES','Affiliate Sales');
+define('TEXT_AFFILIATE_COMMISSION','Total Affiliate Commission');
+define('TEXT_HELP_AFFILIATE','<ul><li><strong>Affiliates</strong><br>Details of Affiliates. Use <strong>Manage</strong> link to manage affiliates.</li></ul>');
+
+//Links
+define('TEXT_LINKS','Links');
+define('TEXT_LINKS_TOTAL','Total Links');
+define('TEXT_LINKS_CATEGORIES','Link Categories');
+define('TEXT_LINKS_WAITING','Waiting Approval');
+
+//Shipping Module
+define('TEXT_SHIPPING_MODULES','Shipping Modules');
+define('TEXT_HELP_SHIPPING_MODULES','<ul><li><strong>Shipping Modules</strong><br>Number of Shipping modules Installed and you are currently using. Use <strong>Manage</strong> link to manage shipping modules.</li></ul>');
+
+// Payment Modules
+define('TEXT_PAYMENT_MODULES','Payment Modules');
+define('TEXT_HELP_PAYMENT_MODULES','<ul><li><strong>Payment Modules</strong><br>Number of Payment modules Installed and you are currently using. Use <strong>Manage</strong> link to manage payment modules.</li></ul>');
+
+// CRE Forge
+define('BOX_HEADING_CRE_FORGE',"CRE Forge");
+define('BOX_CRE_FORGE_BUG_TRACKER',"Bug Tracker");
+define('BOX_CRE_FORGE_FEATURE_REQUESTS',"Feature Requests");
+define('BOX_CRE_FORGE_SVN_REPOSITORY',"SVN Repository");
+define('BOX_CRE_FORGE_SUPPORT_REQUEST',"Support Request");
+define('BOX_CRE_FORGE_FILE_RELEASES',"File Releases");
+define('BOX_HEADING_CRE_NEWS',"CRE Loaded News");
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/infobox_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/infobox_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/infobox_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Infobox Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Infobox Name');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_ACTIVE', 'Aktiv?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Rechte Spalte anzeigen?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Linke Spalte anzeigen?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Kategorie Beschreibungen erlauben');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Linke Spalte breite (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Rechte Spalte breite (pixel)');
+
+define('TEXT_DATE_ADDED', 'hinzugef&uuml;gt am:');
+
+define('TEXT_EDIT_INTRO', 'Nehmen Sie bitte alle notwendigen &Auml;nderungen vor');
+define('TEXT_HEADER', '<b>Kopf</b>');
+define('TEXT_HEADER_EXPLAIN', 'Diese &Auml;nderung wirkt sich auf alle Templates aus');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Infobox Konfiguration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Infobox Konfiguration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Titel');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Wert');
+
+
+define('TEXT_INFO_EDIT_INTRO', 'Diese &Auml;nderung wirkt sich auf alle Templates aus');
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+
+define('ERROR1', 'FEHLER! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'FEHLER! 03  You can not install the default template, sorry');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/infobox_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/infobox_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/infobox_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: infobox_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE', 'Infobox Anzeigen, Erstellen und Update');
+define('TABLE_HEADING_INFOBOX_FILE_NAME', 'Titel');
+define('TABLE_HEADING_ACTIVE', 'Box aktivieren?');
+define('TABLE_HEADING_KEY', 'Box &Uuml;berschrift definieren');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_COLUMN', 'Spalte w&auml;hlen');
+define('TABLE_HEADING_SORT_ORDER', 'Position');
+define('TABLE_HEADING_TEMPLATE', 'Box Template');
+define('TABLE_HEADING_FONT_COLOR', 'Farbe der<br>&Uuml;berschrift');
+define('TABLE_HEADING_BOX_DIRECTORY', 'Verzeichnis der Infoboxen, f&uuml;r dieses Template: ');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie notwendige &Auml;nderungen durch');
+define('TEXT_INFO_DATE_ADDED', 'Hinzugef&uuml;gt:');
+define('TEXT_INFO_LAST_MODIFIED', 'Zuletzt ge&auml;ndert:');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Neue Infobox erstellen');
+define('TEXT_INFO_INSERT_INTRO', 'Ein Beispiel für die<b> what\'s_new.php</b> Infobox ist ausgew&auml;hlt');
+define('TEXT_INFO_DELETE_INTRO', '<P STYLE="color: red; font-weight: bold;">Best&auml;tigen Sie mit OK / entfernen um die Infobox zu l&ouml;schen');
+define('TEXT_INFO_HEADING_DELETE_INFOBOX', 'Infobox l&ouml;schen?');
+define('TEXT_INFO_HEADING_UPDATE_INFOBOX', 'Infobox aktualisieren');
+
+define('IMAGE_INFOBOX_STATUS_UP', 'Hoch');
+define('IMAGE_ICON_STATUS_UP_LIGHT', 'Verschieben hoch');
+define('IMAGE_INFOBOX_STATUS_down', 'Runter');
+define('IMAGE_ICON_STATUS_DOWN_LIGHT', 'Verschieben runter');
+
+define('IMAGE_INFOBOX_STATUS_GREEN', 'Links');
+define('IMAGE_INFOBOX_STATUS_GREEN_LIGHT', 'Links setzen');
+define('IMAGE_INFOBOX_STATUS_RED', 'Rechts');
+define('IMAGE_INFOBOX_STATUS_RED_LIGHT', 'Rechts setzen');
+define('BOX_HEADING_BOXES', 'Boxen Admin');
+define('TEXT_HEADING_SET_ACTIVE', 'Set this box Active? ');
+define('TEXT_HEADING_DEFINE_KEY', '  Define key ');
+define('TEXT_HEADING_WHAT_POS', 'Position? ');
+define('TEXT_HEADING_WHICH_TEMPLATE', 'Welches Box Template? ');
+define('TEXT_HEADING_HEADING', 'BOX Beschreibung');
+define('TEXT_HEADING_WHICH_COL', 'Welche Spalte? ');
+define('TEXT_HEADING_FILENAME', 'Dateiname ');
+define('TEXT_HEADING_FONT_COLOR', 'Titel Farbe ');
+
+define('TEXT_NOTE_REQUIRED', '* bedeutet ein ben&ouml;tigte Feld');
+
+define('JS_BOX_HEADING', '* Der \'Define Key\' Eintrag muss abgeschlossen werden. Beispiel: BOX_HEADING_WHATS_NEW\n');
+define('JS_INFO_BOX_HEADING', '* Der \'Box Titel\' Eintrag muss abgeschlossen werden.\n');
+define('JS_BOX_LOCATION', '* Sie m&uuml;ssen eine Spalte ausw&auml;hlen, um Ihre Infobox anzuzeigen\n');
+define('JS_INFO_BOX_FILENAME', '* Sie m&uuml;ssen einen Dateinamen f&uuml;r Ihre Infobox festlegen\n');
+define('JS_BOX_COLOR', '* Please select a color for the font color.');
+
+
+define('TEXT_INFO_MESSAGE_COUNT_1', '<br>Derzeit sind <br>');
+define('TEXT_INFO_MESSAGE_COUNT_2', ' aktive Boxen in der linken Spalte und <br>');
+define('TEXT_INFO_MESSAGE_COUNT_3', ' aktive Boxen in der rechten Spalte');
+//error messages
+define('infobox_error1', 'Zu diesem Template gibt es keine infoBoxen die installiert werden m&uuml;ssen. Bitte kopieren Sie die infoBoxes die Sie installieren wollen in das Verzeichnis /template boxes');
+define('infobox_error2', 'Achtung: keine Boxen f&uuml;r die linke Spalte aktiviert');
+define('infobox_error3', 'Achtung: keine Boxen f&uuml;r die rechte Spalte aktiviert');
+
+define('INFOBOX_ACTIVE_BOXES', ' active boxes in the right column');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/information.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+
+  define('ACTION_INFORMATION', 'Aktion');
+  define('ACTIVATION_ID_INFORMATION', 'Aktivieren der Informations-ID=');
+  define('ADD_INFORMATION', 'Neue Information hinzuf&uuml;gen');
+  define('ADD_QUEUE_INFORMATION', 'Information zu Warteschlange hinzuf&uuml;gen');
+  define('ALERT_INFORMATION', 'Informationssystem leeren');
+  define('ANSWER_INFORMATION', 'Antworten');
+  define('CONFIRM_INFORMATION', 'Best&auml;tigen');
+  define('DEACTIVATION_ID_INFORMATION', 'De-Aktivieren der Informations-ID=');
+  define('DELETE_INFORMATION', 'Delete');
+  define('DELETE_CONFITMATION_ID_INFORMATION', 'L&oumL;schbest&auml;tigung Informations-ID=');
+  define('DELETE_ID_INFORMATION', 'Informations-ID l&ouml;schen=');
+  define('DELETED_ID_INFORMATION', 'Informations-ID gel&ouml;scht=');
+  define('DESCRIPTION_INFORMATION', 'Beschreibung');
+  define('EDIT_ID_INFORMATION', 'Information-ID editieren=');
+  define('EDIT_INFORMATION', 'Edit');
+  define('ERROR_20_INFORMATION', 'Kein g&uuml;ltiger Wert für die Option <b>Warteschlange</b>. Sie k&ouml;nnen nur einen numerischen Wert definieren');
+  define('ERROR_80_INFORMATION', 'Sie haben nicht alle <b>notwendigen Felder</b> ausgef&uuml;llt');
+  define('INFORMATION_ID_ACTIVE', 'Diese Information ist AKTIV');
+  define('INFORMATION_ID_DEACTIVE', 'Diese Information ist NICHT AKTIV');
+  define('INFORMATION_ACTIVE', 'Aktiv');
+  define('INFORMATION_DEACTIVE', 'Deaktiviert');  
+  define('ID_INFORMATION', 'ID');
+  define('TITLE_INFORMATION', 'Titel');
+  define('QUEUE_INFORMATION', 'Warteschlange');
+  define('QUEUE_INFORMATION_LIST', 'WarteschlangenListe: ');
+  define('MANAGER_INFORMATION', 'Informations-Manager');
+  define('NO_INFORMATION', 'Nein');
+  define('PUBLIC_INFORMATION', '&Ouml;ffentlich');
+  define('PAGE_PREVIEW', 'Preview');
+  define('SORT_BY', 'Informationsseite - Sortieren nach');
+  define('STATUS_INFORMATION', 'Status:');
+  define('SUCCED_INFORMATION', ' Erfolg');
+  define('TITLE', 'Informations-System');
+  define('VIEW_INFORMATION', 'Information Anzeige');
+  define('VISIBLE_INFORMATION', 'Sichtbar');
+  define('VISIBLE_INFORMATION_DO', '( To Do sichtbar )');
+  define('UPDATE_ID_INFORMATION', 'Informations-ID aktualisiert=');
+  define('WARNING_INFORMATION', 'Warnung');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: invoice.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('TITLE_PRINT_ORDER', 'Druckbare Bestellung #: ');
+
+define('TABLE_HEADING_COMMENTS', 'Kommentar');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Produkt-Nr.');
+define('TABLE_HEADING_PRODUCTS', 'Produkt');
+define('TABLE_HEADING_TAX', 'MwSt.');
+define('TABLE_HEADING_TOTAL', 'Summe');
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Preis (exkl.)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Preis (inkl.)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Summe (exkl.)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Summe (inkl.)');
+
+define('ENTRY_SOLD_TO', 'Rechnungsanschrift:');
+define('ENTRY_SHIP_TO', 'Lieferanschrift:');
+define('ENTRY_PAYMENT_METHOD', 'Zahlungsweise:');
+define('ENTRY_SUB_TOTAL', 'Zwischensumme:');
+define('ENTRY_TAX', 'MwSt.:');
+define('ENTRY_SHIPPING', 'Versandkosten:');
+define('ENTRY_TOTAL', 'Gesamtsumme:');
+define('ENTRY_DATE_PURCHASED', 'Gekauft am:');
+define('TITLE_PRINT_INVOICE', 'Print Invoice');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/languages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: languages.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Sprachen');
+
+define('TABLE_HEADING_LANGUAGE_NAME', 'Sprache');
+define('TABLE_HEADING_LANGUAGE_CODE', 'Kodierung');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_LANGUAGE_NAME', 'Name:');
+define('TEXT_INFO_LANGUAGE_CODE', 'Kodierung:');
+define('TEXT_INFO_LANGUAGE_IMAGE', 'Symbol:');
+define('TEXT_INFO_LANGUAGE_DIRECTORY', 'Verzeichnis:');
+define('TEXT_INFO_LANGUAGE_SORT_ORDER', 'Sortierreihenfolge:');
+define('TEXT_INFO_INSERT_INTRO', 'Bitte geben Sie die neue Sprache mit allen relevanten Daten ein');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie die Sprache l&ouml;schen m&ouml;chten?');
+define('TEXT_INFO_HEADING_NEW_LANGUAGE', 'Neue Sprache');
+define('TEXT_INFO_HEADING_EDIT_LANGUAGE', 'Sprache bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_LANGUAGE', 'Sprache l&ouml;schen');
+
+define('ERROR_REMOVE_DEFAULT_LANGUAGE', 'Fehler: Die Standardsprache darf nicht gel&ouml;scht werden. Bitte definieren Sie eine neue Standardsprache und wiederholen Sie den Vorgang.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/link_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/link_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/link_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: link_categories.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Link Kategorien');
+define('HEADING_TITLE_SEARCH', 'Suche:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_HEADING_NEW_LINK_CATEGORY', 'Neue Link Kategorie');
+define('TEXT_INFO_HEADING_EDIT_LINK_CATEGORY', 'Link Kategorie editieren');
+define('TEXT_INFO_HEADING_DELETE_LINK_CATEGORY', 'Link Kategorie l&ouml;schen');
+
+define('TEXT_INFO_LINK_CATEGORY_COUNT', 'Links:');
+define('TEXT_INFO_LINK_CATEGORY_STATUS', 'Status:');
+define('TEXT_INFO_LINK_CATEGORY_DESCRIPTION', 'Beschreibung:');
+define('TEXT_INFO_LINK_CATEGORY_SORT_ORDER', 'Sortiert nach:');
+define('TEXT_DATE_LINK_CATEGORY_CREATED', 'Erstellt:');
+define('TEXT_DATE_LINK_CATEGORY_LAST_MODIFIED', 'Zuletzt ge&auml;ndert:');
+define('TEXT_IMAGE_NONEXISTENT', 'BILD IST NICHT VORHANDEN');
+
+define('TEXT_NEW_LINK_CATEGORIES_INTRO', 'Bitte geben Sie die folgenden Informationen f&uuml;r die neue Link Kategorie ein');
+define('TEXT_EDIT_LINK_CATEGORIES_INTRO', 'Bitte f&uuml;hren Sie notwendige &Auml;nderungen durch');
+define('TEXT_DELETE_LINK_CATEGORIES_INTRO', 'Sind Sie sicher, dass Sie diese Link Kategorie l&ouml;schen wollen?');
+
+define('TEXT_LINK_CATEGORIES_NAME', 'Kategorie Name:');
+define('TEXT_LINK_CATEGORIES_DESCRIPTION', 'Kategorie Beschreibung:');
+define('TEXT_LINK_CATEGORIES_IMAGE', 'Kategorie Bild:');
+define('TEXT_LINK_CATEGORIES_SORT_ORDER', 'Sortiert nach:');
+define('TEXT_LINK_CATEGORIES_STATUS', 'Status:');
+define('TEXT_LINK_CATEGORIES_STATUS_ENABLE', 'Einschalten');
+define('TEXT_LINK_CATEGORIES_STATUS_DISABLE', 'Ausschalten');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>WARNUNG:</b> Es sind immer noch %s Links zu dieser Kategorie verlinkt!');
+
+define('TEXT_DISPLAY_NUMBER_OF_LINK_CATEGORIES', 'Zeige <b>%d</b> von <b>%d</b> (von insgesamt <b>%d</b> Link Kategorien)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/links.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+<?php
+/*
+  $Id: links.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Links');
+define('HEADING_TITLE_SEARCH', 'Suche:');
+
+define('TABLE_HEADING_TITLE', 'Titel');
+define('TABLE_HEADING_URL', 'URL');
+define('TABLE_HEADING_CLICKS', 'Klicks');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_HEADING_DELETE_LINK', 'Link l&ouml;schen');
+define('TEXT_INFO_HEADING_CHECK_LINK', 'Link pr&uuml;fen');
+
+define('TEXT_DELETE_INTRO', 'Sind Sie sicher, dass Sie diesen Link l&ouml;schen wollen?');
+
+define('TEXT_INFO_LINK_CHECK_RESULT', 'Link pr&uuml;fen Ergebnis:');
+define('TEXT_INFO_LINK_CHECK_FOUND', 'Gefunden');
+define('TEXT_INFO_LINK_CHECK_NOT_FOUND', 'Nicht Gefunden');
+define('TEXT_INFO_LINK_CHECK_ERROR', 'Fehlerhafte URL');
+
+
+define('TEXT_INFO_LINK_STATUS', 'Status:');
+define('TEXT_INFO_LINK_CATEGORY', 'Kategorie:');
+define('TEXT_INFO_LINK_CONTACT_NAME', 'Kontakt Name:');
+define('TEXT_INFO_LINK_CONTACT_EMAIL', 'Kontakt Email:');
+define('TEXT_INFO_LINK_CLICK_COUNT', 'Klicks:');
+define('TEXT_INFO_LINK_DESCRIPTION', 'Beschreibung:');
+define('TEXT_DATE_LINK_CREATED', 'Link Eingegeben:');
+define('TEXT_DATE_LINK_LAST_MODIFIED', 'Zuletzt Ge&auml;ndert:');
+define('TEXT_IMAGE_NONEXISTENT', 'BILD IST NICHT VORHANDEN');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Link Status aktualisieren');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Hallo %s,' . "\n\n" . 'Der Status Ihres Links bei ' . STORE_NAME . ' wurde aktualisiert.' . "\n\n" . 'Neuer Status: %s' . "\n\n" . 'Bei Fragen antworten Sie bitte auf diese Email.' . "\n");
+
+// VJ todo - move to common language file
+define('CATEGORY_WEBSITE', 'Details zur Webseite');
+define('CATEGORY_RECIPROCAL', 'Gegenlink Seitendetails');
+define('CATEGORY_OPTIONS', 'Optionen');
+
+define('ENTRY_LINKS_TITLE', 'Seitentitel:');
+define('ENTRY_LINKS_TITLE_ERROR', 'Link Titel muss eine Mindestl&auml;nge von ' . ENTRY_LINKS_TITLE_MIN_LENGTH . ' Zeichen haben.');
+define('ENTRY_LINKS_URL', 'URL:');
+define('ENTRY_LINKS_URL_ERROR', 'URL mu&szlig; eine Mindestl&auml;nge von ' . ENTRY_LINKS_URL_MIN_LENGTH . ' Zeichen haben.');
+define('ENTRY_LINKS_CATEGORY', 'Kategorie:');
+define('ENTRY_LINKS_DESCRIPTION', 'Beschreibung:');
+define('ENTRY_LINKS_DESCRIPTION_ERROR', 'Beschreibung mu&szlig; eine Mindestl&auml;nge von ' . ENTRY_LINKS_DESCRIPTION_MIN_LENGTH . ' Zeichen haben.');
+define('ENTRY_LINKS_IMAGE', 'Bild URL:');
+define('ENTRY_LINKS_CONTACT_NAME', 'Name:');
+define('ENTRY_LINKS_CONTACT_NAME_ERROR', 'Ihr Name mu&szlig; eine Mindestl&auml;nge von ' . ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH . ' Zeichen haben.');
+define('ENTRY_LINKS_RECIPROCAL_URL', 'Gegenlink Seite:');
+define('ENTRY_LINKS_RECIPROCAL_URL_ERROR', 'Die Gegenlink Seite muss eine Mindestl&auml;nge von ' . ENTRY_LINKS_URL_MIN_LENGTH . ' Zeichen haben.');
+define('ENTRY_LINKS_STATUS', 'Status:');
+define('ENTRY_LINKS_NOTIFY_CONTACT', 'Benachrichtigungs-Kontakt:');
+define('ENTRY_LINKS_RATING', 'Bewertung:');
+define('ENTRY_LINKS_RATING_ERROR', 'Die Bewertung sollte nicht leer sein.');
+
+define('TEXT_DISPLAY_NUMBER_OF_LINKS', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Links an)');
+
+define('IMAGE_NEW_LINK', 'Neuer Link');
+define('IMAGE_CHECK_LINK', 'Link pr&uuml;fen');
+
+
+define('ALL', 'All');
+define('LINKS_MANAGER_CHECKED_LINKS', 'Links Manager - Checked Links');
+define('ASC', 'Asc');
+define('DESC', 'Desc');
+define('START_AT', 'Start at:');
+define('HOW_MANY', 'How many?');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/links_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/links_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/links_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: links_contact.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Email an Link Partner senden');
+
+define('TEXT_LINK_PARTNER', 'Link Partner:');
+define('TEXT_SUBJECT', 'Betreff:');
+define('TEXT_FROM', 'Von:');
+define('TEXT_MESSAGE', 'Nachricht:');
+define('TEXT_SELECT_LINK_PARTNER', 'Link Partner ausw&auml;hlen');
+define('TEXT_ALL_LINK_PARTNERS', 'Alle Link Partner');
+
+define('NOTICE_EMAIL_SENT_TO', 'Hinweis: Email gesendet an: %s');
+define('ERROR_NO_LINK_PARTNER_SELECTED', 'Fehler: Es wurde kein Link Partner ausgew&auml;hlt.');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/login.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: login.php,v 1.1 2004/03/05 01:39:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Anmeldung');
+define('HEADING_TITLE', 'Willkommen, bitte melden Sie sich an');
+
+define('HEADING_RETURNING_ADMIN', 'Anmeldepanel:');
+define('HEADING_PASSWORD_FORGOTTEN', 'Passwort vergessen:');
+define('TEXT_RETURNING_ADMIN', 'Nur f&uuml;r Mitarbeiter!');
+define('ENTRY_EMAIL_ADDRESS', 'Email Adresse:');
+define('ENTRY_PASSWORD', 'Passwort:');
+define('ENTRY_FIRSTNAME', 'Vorname:');
+define('IMAGE_BUTTON_LOGIN', 'Eingeben');
+
+define('TEXT_PASSWORD_FORGOTTEN', 'Passwort vergessen?');
+
+define('TEXT_LOGIN_ERROR', '<font color="#ff0000"><b>FEHLER:</b></font> Falscher Username oder Passwort!');
+define('TEXT_FORGOTTEN_ERROR', '<font color="#ff0000"><b>FEHLER:</b></font> Vorname und Passwort stimmen nicht &uuml;berein!');
+define('TEXT_FORGOTTEN_FAIL', 'Sie haben es mehr als 3 mal versucht. Aus Sicherheitsgr&uuml;nden kontaktieren Sie bitte den Webmaster, um ein neues Passwort zu bekommen.<br>&nbsp;<br>&nbsp;');
+define('TEXT_FORGOTTEN_SUCCESS', 'Das neue Passwort wurde Ihnen an Ihre Emailadresse zugesandt. Bitte &uuml;berpr&uuml;fen Sie Ihre Emails und klicken Sie Zur&uuml;ck, um sich erneut anzumelden<br>&nbsp;<br>&nbsp;');
+
+define('ADMIN_EMAIL_SUBJECT', 'Neues Passwort');
+define('ADMIN_EMAIL_TEXT', 'Hi %s,' . "\n\n" . 'Sie k&ouml;nnen das Admin-Panel mit folgendem Passwort betreten. Wenn Sie sich angemeldet haben, &auml;ndern Sie bitte umgehend Ihr Passwort!' . "\n\n" . 'Webseite : %s' . "\n" . 'Username: %s' . "\n" . 'Passwort: %s' . "\n\n" . 'Danke!' . "\n" . '%s' . "\n\n" . 'Dies ist eine vom System automatisch generierte Antwort. Eine Antwort Ihrerseits bliebe ungelesen!');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/logoff.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Abmelden');
+define('NAVBAR_TITLE', 'Abmelden');
+define('TEXT_MAIN', 'Sie wurden erfolgreich aus dem <b>Admin</b> Bereich abgemeldet. Es ist nun ungef&auml;hrlich, den Computer zu verlassen. Klicken Sie Zurück, um sich erneut anzumelden');
+define('TEXT_RELOGIN', 'Erneut anmelden');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: mail.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Email an Kunden versenden');
+
+define('TEXT_CUSTOMER', 'Kunde:');
+define('TEXT_SUBJECT', 'Betreff:');
+define('TEXT_FROM', 'Absender:');
+define('TEXT_MESSAGE', 'Nachricht:');
+define('TEXT_SELECT_CUSTOMER', 'Kunden ausw&auml;hlen');
+define('TEXT_ALL_CUSTOMERS', 'Alle Kunden');
+define('TEXT_NEWSLETTER_CUSTOMERS', 'An alle Newsletter-Abonnenten');
+
+define('NOTICE_EMAIL_SENT_TO', 'Hinweis: Email wurde versendet an: %s');
+define('ERROR_NO_CUSTOMER_SELECTED', 'Fehler: Es wurde kein Kunde ausgew&auml;hlt.');
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('TEXT_EMAIL_BUTTON_TEXT', '<p><HR><b><font color="red">Durch die Aktivierung des HTML WYSIWYG Editors wurde der zurück Button deaktiviert.</b></font><br><br><b>Wenn Sie wirklich Ihre Emails vor dem Absenden noch einmal ansehen wollen, benutzen Sie bitte den "Vorschau" Button im WYSIWYG Editor.<br><HR>');
+define('TEXT_EMAIL_BUTTON_HTML', '<p><HR><b><font color="red">HTML ist im Moment Abgeschaltet!</b></font><br><br>Wenn Sie eine HTML-Email versenden wollen, schalten Sie den WYSIWYG-Editor for Email in: Admin-->Configuration-->WYSIWYG Editor-->Optionen ein.<br>');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// Contact US Email Subject DMG
+define('TEXT_EMAIL_SUBJECTS', '* Thema selektieren *');
+define('EMAIL_SUBJECT', 'Mitteilung von ' . STORE_NAME. ': ');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Hersteller');
+
+define('TABLE_HEADING_MANUFACTURERS', 'Hersteller');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_HEADING_NEW_MANUFACTURER', 'Neuer Hersteller');
+define('TEXT_HEADING_EDIT_MANUFACTURER', 'Hersteller bearbeiten');
+define('TEXT_HEADING_DELETE_MANUFACTURER', 'Hersteller l&ouml;schen');
+
+define('TEXT_MANUFACTURERS', 'Hersteller:');
+define('TEXT_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_LAST_MODIFIED', 'letzte &Auml;nderung am:');
+define('TEXT_PRODUCTS', 'Produkte:');
+define('TEXT_IMAGE_NONEXISTENT', 'BILD NICHT VORHANDEN');
+
+define('TEXT_NEW_INTRO', 'Bitte geben Sie den neuen Hersteller mit allen relevanten Daten ein.');
+define('TEXT_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+
+define('TEXT_MANUFACTURERS_NAME', 'Herstellername:');
+define('TEXT_MANUFACTURERS_IMAGE', 'Herstellerbild:');
+define('TEXT_MANUFACTURERS_URL', 'Hersteller URL:');
+
+define('TEXT_DELETE_INTRO', 'Sind Sie sicher, dass Sie diesen Hersteller l&ouml;schen m&ouml;chten?');
+define('TEXT_DELETE_IMAGE', 'Hersteller Image l&ouml;schen?');
+define('TEXT_DELETE_PRODUCTS', 'Alle Produkte von diesem Hersteller l&ouml;schen? (inkl. Bewertungen, Angebote und Neuerscheinungen)');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNUNG:</b> Es existieren noch %s Produkt, welche mit diesem Hersteller verbunden sind!');
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis %s ist schreibgesch&uuml;tzt. Bitte korrigieren Sie die Zugriffsrechte zu diesem Verzeichnis!');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis %s existiert nicht!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/members.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: members.php,v 1.2 2003/09/24 13:57:08 anon Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Member approval');
+
+define('TABLE_HEADING_LASTNAME', 'Nachname');
+define('TABLE_HEADING_FIRSTNAME', 'Vorname');
+define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('HEADING_TITLE_SEARCH', 'Suchen');
+
+define('EMAIL_CONTACT', 'For help with any of our online services, please email us at: ' . STORE_OWNER_EMAIL_ADDRESS);
+
+define('EMAIL_TEXT_CONFIRM', 'Your application to become a wholesale customer of (your store) has been approved. You can now access pricing on the (your store) site.<br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to drop ship direct to your customer.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n");
+
+define('EMAIL_WARNING', '<b>Note:</b> This email address was used to request access to our wholesale website. If you did not signup to be a customer, please send an email to ' . STORE_OWNER_EMAIL_ADDRESS . "\n\n");
+
+define('EMAIL_TEXT_SUBJECT', 'Account Approved');
+
+define('EMAIL_SEPARATOR', '----------------------------------------------');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_newsletter.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+define('TEXT_COUNT_AFFILIATES', 'Partner die den Newsletter erhalten haben: %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+/*
+  $Id: newsletter.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_COUNT_CUSTOMERS', 'Anzahl der Kunden, welche das Rundschreiben erhalten: %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/product_notification.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/product_notification.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/modules/newsletters/product_notification.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: product_notification.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_COUNT_CUSTOMERS', 'Anzahl der Kunden, welche das Rundschreiben erhalten: %s');
+define('TEXT_PRODUCTS', 'Produkt');
+define('TEXT_SELECTED_PRODUCTS', 'ausgew&auml;hlte Produkte');
+
+define('JS_PLEASE_SELECT_PRODUCTS', 'Bitte wählen Sie zumindest einen Produkt aus!');
+
+define('BUTTON_GLOBAL', 'Global');
+define('BUTTON_SELECT', '>>>');
+define('BUTTON_UNSELECT', '<<<');
+define('BUTTON_SUBMIT', 'Weiter');
+define('BUTTON_CANCEL', 'Abbrechen');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/modules.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/modules.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/modules.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: modules.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_MODULES_PAYMENT', 'Zahlungsweisen');
+define('HEADING_TITLE_MODULES_SHIPPING', 'Versandarten');
+define('HEADING_TITLE_MODULES_ORDER_TOTAL', 'Bestellsumme-Gesamt');
+define('HEADING_TITLE_MODULES_CHECKOUT_SUCCESS','Checkout Success Modules');
+
+define('TABLE_HEADING_MODULES', 'Module');
+define('TABLE_HEADING_SORT_ORDER', 'Sortierreihenfolge');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_MODULE_DIRECTORY', 'Modul Verzeichnis:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Navigations Menu');
+define('HEADING_TITLE_SEARCH', 'Suchen:');
+define('HEADING_TITLE_GOTO', 'Gehe nach:');
+
+define('TABLE_HEADING_CATEGORIES_LINKS', 'Kategorien / Links');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_STATUS', 'Status');
+
+
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Produkt Grafik:</b><small><br>Hauptgrafik wird im<br><u>Katalog und der Beschreibung</u> dargestellt.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Small Grafik:</b><br><small> Image on<br><u>products list</u> pages.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Grafik:</b><br><small> Large Image on<br><u>pop-up window</u> page.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Shop Produkte teilen sich diese Grafik =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Entferne</b> diese Grafik vom Produkt?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>L&ouml;sche</b> diese Grafik auf dem Server (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Entfernen');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'L&ouml;schen');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Kleine Grafiken.</b> Wenn nur eine "SM" Grafik benutzt wird<br>(Alone) wird kein Pop-up Fenster generiert, die "SM" Grafik<br> wird unmittelbar unter der Produktbeschreibung<br>angezeigt. Wenn die Grafik in Verbindung mit einer <br>"XL" Grafik verwendet wird, steht ein Pop-up Link<br> zur Verf&uuml;gung<br> und die "XL" Grafik wird<br>in einem Pop-up Fenster angezeigt.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Grosse Grafiken.</b> Diese Graik wird als Pop-up ben&ouml;tigt<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Zus&auml;tzliche Grafiken - werden unterhalb der Produktbeschreibung angezeigt.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Produkt 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Produkt 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Produkt 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Produkt 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Produkt 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Produkt 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Produkt 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Produkt 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Produkt 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Produkt 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Produkt 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Produkt 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+
+
+define('TEXT_NEW_PRODUCT', 'Neues Produkt in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Kategorie:');
+define('TEXT_SUBCATEGORIES', 'Unterkategorie:');
+define('TEXT_PRODUCTS', 'Produkt:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Preis:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Steuerklasse:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Durchschnittliche Wertung:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Menge:');
+define('TEXT_DATE_ADDED', 'Datum hinzugef&uuml;gt:');
+define('TEXT_DELETE_IMAGE', 'L&ouml;sche Grafik');
+
+define('TEXT_DATE_AVAILABLE', 'Datum verf&uuml;gbar:');
+define('TEXT_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('TEXT_IMAGE_NONEXISTENT', 'GRAFIK EXISTIERT NICHT');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Bitt f&uuml;gen Sie eine neue Kategorie oder ein neues Produkt in dieser Ebene ein.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'F&uuml;r weiter Informationen schauen Sie sich das Produkt dort an <a href="http://%s" target="blank"><u>Webseite</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'Diese Produkt wurde hinzugef&uuml;gt am %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'Dieses Produkt wird wieder ab dem <b>%s</b> verf&uuml;gbar sein.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Kategorie ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Kategorie Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Kategorie Grafik:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Category heading title:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Category heading Description:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Category Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Category Description Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Category Key Word Meta Tag :');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Aktuelle Kategorie:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'Kategorie neu');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Kategorie editieren');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Kategorie l&ouml;schen');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Kategorie verschieben');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Produkt l&ouml;schen');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Produkt verschieben');
+define('TEXT_INFO_HEADING_COPY_TO', 'Kopieren nach');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Sind Sie sicher das die Kategorie gel&ouml;scht werden soll?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Sind Sie sicher das dieses Produkt permanent gel&ouml;scht werden soll?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNUNG:</b> Es sind bereits %s Unterkategorien mit dieser Kategorie verlinkt!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNUNG:</b> Es sind bereits %s Produkte mit dieser Kategorie verlinkt!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Kategorie Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Kategorie Grafik:');
+define('TEXT_SORT_ORDER', 'Sortierreihenfolge:');
+
+define('TEXT_PRODUCTS_STATUS', 'Produkt Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Datum verf&uuml;gbar:');
+define('TEXT_PRODUCT_AVAILABLE', 'Im Lager');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Ausverkauft');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Produkt Hersteller:');
+define('TEXT_PRODUCTS_NAME', 'Produkt Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Produkt Beschreibung:');
+define('TEXT_PRODUCTS_QUANTITY', 'Produkt Menge:');
+define('TEXT_PRODUCTS_MODEL', 'Produkt Modell:');
+define('TEXT_PRODUCTS_IMAGE', 'Produkt Grafik:');
+define('TEXT_PRODUCTS_URL', 'Produkt URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(ohne http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Produkt Preis (exl. MwSt):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (inkl. MwSt):');
+define('TEXT_PRODUCTS_WEIGHT', 'Produkt Gewicht:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Leere Kategorie');
+
+define('TEXT_HOW_TO_COPY', 'Kopier Methode :');
+define('TEXT_COPY_AS_LINK', 'Produkt verlinken');
+define('TEXT_COPY_AS_DUPLICATE', 'Doppeltes Produkt');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Fehler: Produkte k&ouml;nnen nicht in der gleichen Kategorie verlinkt werden.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Grafikverzeichnis ist schreibgesch&uuml;tzt: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Grfikverzeichnis existiert nicht: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Fehler: Category cannot be moved into child category.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Produkt Seitentitel :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Produkt Schl&uuml;sselbegriffe :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'editiere Produkt Attribute');
+
+// Added for Navigation Menu DMG
+
+define('TEXT_LINKS','Links');
+define('TEXT_HEADING_EDIT_CATEGORY','Navigationskategorie erstellen');
+define('TEXT_HEADING_NEW_LINK','Neuen Navigationslink erstellen');
+define('TEXT_LINK_NAME','Link Text : ');
+define('TEXT_LINK_PAGE','Link Ziel : ');
+define('TEXT_STATUS','Link Status : ');
+
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: newsletters.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Newsletter Verwaltung');
+
+define('TABLE_HEADING_NEWSLETTERS', 'Newsletter');
+define('TABLE_HEADING_SIZE', 'Gr&ouml;&szlig;e');
+define('TABLE_HEADING_MODULE', 'Module');
+define('TABLE_HEADING_SENT', 'Gesendet');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_NEWSLETTER_MODULE', 'Module:');
+define('TEXT_NEWSLETTER_TITLE', 'Titel des Newsletters:');
+define('TEXT_NEWSLETTER_CONTENT', 'Inhalt:');
+
+define('TEXT_NEWSLETTER_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_NEWSLETTER_DATE_SENT', 'Gesendet am:');
+
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie diesen Newsletter l&ouml;schen m&ouml;chten?');
+
+define('TEXT_PLEASE_WAIT', 'Bitte warten Sie .. Emails werden gesendet ..<br><br>Bitte unterbrechen Sie diesen Prozess nicht!');
+define('TEXT_FINISHED_SENDING_EMAILS','Email Versand abgeschlossen!');
+
+define('ERROR_NEWSLETTER_TITLE','Fehler: Geben Sie bitte den Titel des Newsletter ein');
+define('ERROR_NEWSLETTER_MODULE','Fehler: Das Newsletter Modul wird dazu ben&ouml;tigt.');
+define('ERROR_REMOVE_UNLOCKED_NEWSLETTER','Fehler: Bitte sperren Sie den Newsletter, bevor Sie ihn l&ouml;schen.');
+define('ERROR_EDIT_UNLOCKED_NEWSLETTER','Fehler: Bitte sperren Sie den Newsletter, bevor Sie ihn bearbeiten.');
+define('ERROR_SEND_UNLOCKED_NEWSLETTER','Fehler: Bitte sperren Sie den Newsletter, bevor Sie ihn senden.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/orderlist.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/orderlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/orderlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: orderlist.php,v 1.25 2003/06/20 00:28:44 vj Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Bestellliste');
+define('HEADING_TITLE_STATUS', 'Bestellliste');
+
+define('TABLE_HEADING_ORDER_ID', 'Bestellnr.');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modell');
+define('TABLE_HEADING_PRODUCTS_NAME', 'Name');
+define('TABLE_HEADING_PRICE', 'Preis');
+define('TABLE_HEADING_QUANTITY', 'Menge');
+define('TABLE_HEADING_NOTES', 'Kommentar');
+define('TABLE_HEADING_CHK', 'chk');
+
+define('TEXT_ALL_ORDERS', 'Date:');
+
+define('TEXT_DOWNLOAD', 'Download');
+define('TEXT_PRINT', 'Drucken');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,125 @@
+<?php
+/*
+  $Id: orders.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('TABLE_HEADING_EDIT_ORDERS', 'To modify the order');
+
+define('HEADING_TITLE', 'Bestellungen');
+define('HEADING_IS_TITLE', 'IS Bestellung');
+define('HEADING_IS_RECEIPT', 'IS Quittung');
+define('HEADING_TITLE_SEARCH', 'Bestell-Nr.:');
+define('HEADING_TITLE_STATUS', 'Status:');
+
+define('ENTRY_UPDATE_TO_CC', '(Aktualisieren um zur <b>Kreditkarte</b> die CC Felder anzeigen zu lassen.)');
+define('TABLE_HEADING_COMMENTS', 'Kommentar');
+define('TABLE_HEADING_CUSTOMERS', 'Kunde');
+define('TABLE_HEADING_ORDERID', 'Bestell ID');
+define('TABLE_HEADING_IS_ORDERNUM', 'IS Bestellung');
+define('TABLE_HEADING_ORDER_TOTAL', 'Gesamtwert');
+define('TABLE_HEADING_DATE_PURCHASED', 'Bestelldatum');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_QUANTITY', 'Anzahl');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Produkt-Nr.');
+define('TABLE_HEADING_PRODUCTS', 'Produkt');
+define('TABLE_HEADING_TAX', 'MwSt.');
+define('TABLE_HEADING_TOTAL', 'Gesamtsumme');
+define('TABLE_HEADING_BASE_PRICE', 'Base Price'); 
+
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Preis (exkl.)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Preis (inkl.)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (exkl.)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inkl.)');
+
+define('TABLE_HEADING_CUSTOMER_NOTIFIED', 'Kunde benachrichtigt');
+define('TABLE_HEADING_DATE_ADDED', 'hinzugef&uuml;gt am:');
+
+//begin PayPal_Shopping_Cart_IPN
+define('TABLE_HEADING_PAYMENT_STATUS', 'Bezahl Status');
+//end PayPal_Shopping_Cart_IPN
+define('ENTRY_SUBURB', 'Suburb :');
+define('ENTRY_CITY', 'City :');
+define('ENTRY_CUSTOMER', 'Kunde:');
+define('ENTRY_STATE', 'State :');
+define('ENTRY_SOLD_TO', 'Verkauft an:');
+define('ENTRY_TELEPHONE', 'Enter Telephone :');
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_DELIVERY_TO', 'Lieferanschrift:');
+define('ENTRY_SHIP_TO', 'Lieferanschrift:');
+define('ENTRY_SHIPPING_ADDRESS', 'Versandadresse:');
+define('ENTRY_BILLING_ADDRESS', 'Rechnungsadresse:');
+define('ENTRY_PAYMENT_METHOD', 'Zahlungsweise:');
+define('ENTRY_CREDIT_CARD_TYPE', 'Kreditkartentyp:');
+define('ENTRY_CREDIT_CARD_OWNER', 'Kreditkarteninhaber:');
+define('ENTRY_CREDIT_CARD_NUMBER', 'Kerditkartennnummer:');
+define('ENTRY_CREDIT_CARD_EXPIRES', 'Kreditkarte l&auml;uft ab am:');
+define('ENTRY_CREDIT_CARD_CCV', 'CCV Code:');
+define('ENTRY_CREDIT_CARD_START_DATE', 'Start Date: ');
+define('ENTRY_CREDIT_CARD_ISSUE', 'Issue Number: ');
+define('ENTRY_SUB_TOTAL', 'Zwischensumme:');
+define('ENTRY_TAX', 'MwSt.:');
+define('ENTRY_SHIPPING', 'Versandkosten:');
+define('ENTRY_TOTAL', 'Gesamtsumme:');
+define('ENTRY_DATE_PURCHASED', 'Bestelldatum:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_DATE_LAST_UPDATED', 'letzte Aktualisierung am:');
+define('ENTRY_NOTIFY_CUSTOMER', 'Kunde benachrichtigen:');
+define('ENTRY_NOTIFY_COMMENTS', 'Kommentare mitsenden:');
+define('ENTRY_PRINTABLE', 'Rechnung drucken');
+
+define('TEXT_INFO_HEADING_DELETE_ORDER', 'Bestellung l&ouml;schen');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, das Sie diese Bestellung l&ouml;schen m&ouml;chten?');
+define('TEXT_INFO_DELETE_DATA', 'Customers Name  ');
+define('TEXT_INFO_DELETE_DATA_OID', 'Bestell Nr.  ');
+define('TEXT_INFO_RESTOCK_PRODUCT_QUANTITY', 'Produktmenge aktualisieren');
+define('TEXT_DATE_ORDER_CREATED', 'erstellt am:');
+define('TEXT_DATE_ORDER_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_INFO_PAYMENT_METHOD', 'Zahlungsweise:');
+define('TEXT_INFO_ABANDONDED', 'Abandoned');
+define('TEXT_CARD_ENCRPYT', '<font color=green> </b> Die Kreditkartennummer wurde verschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_CARD_NOT_ENCRPYT', '<font color=red> <b>WARNUNG !!!! Die Kreditkartennummer wurde unverschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_EXPIRES_ENCRPYT', '<font color=green> </b> Das Ablaufdatum wurde verschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_EXPIRES_NOT_ENCRPYT', '<font color=red> <b>WARNUNG !!!! Das Ablaufdatum wurde unverschl&uuml;sselt gespeichert </b></font>');
+define('TEXT_CCV_ENCRPYT', '<font color=green> </b> Die Kreditkarten CSV Nummer wurde verschl&uuml;sselt gepeichert </b></font>');
+define('TEXT_CCV_NOT_ENCRPYT', '<font color=red> <b>WARNUNG !!!! Die Kreditkarten CSV Nummer wurde unverschl&uuml;sselt gepeichert. Wenn das Feld leer ist bitte ignorieren</b></font>');
+
+define('TEXT_EXPIRES_REMOVED', '<font color=green> </b> Das Ablaufdatum der Kreditkarte wurde nicht im Shop gespeichert oder entfernt.</b></font>');
+define('TEXT_CCV_REMOVED', '<font color=green> </b> Die Kreditkarten CCV Nummer wurde nicht im Shop gespeichert oder entfernt.</b></font>');
+define('TEXT_CARD__REMOVED', '<font color=green> </b> Die Kreditkartennummer wurde nicht im Shop gespeichert oder entfernt.</b></font>');
+
+
+define('ENTRY_IPADDRESS', 'IP Adresse:');
+define('ENTRY_IPISP', 'Provider:');
+
+define('TEXT_ALL_ORDERS', 'Alle Bestellungen');
+define('TEXT_NO_ORDER_HISTORY', 'Keine Bestellhistorie verf&uuml;gbar');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('EMAIL_TEXT_SUBJECT', 'Status&auml;nderung Ihrer Bestellung');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Bestell-Nr.:');
+define('EMAIL_TEXT_INVOICE_URL', 'Ihre Bestellung k&ouml;nnen Sie unter folgender Adresse einsehen:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Bestelldatum:');
+define('EMAIL_TEXT_STATUS_UPDATE', 'Der Status Ihrer Bestellung wurde ge&auml;ndert.' . "\n\n" . 'Neuer Status: %s' . "\n\n" . 'Bei Fragen zu Ihrer Bestellung antworten Sie bitte auf diese Email.' . "\n\n" . 'Mit freundlichen Gr&uuml;ssen' . "\n");
+define('EMAIL_TEXT_COMMENTS_UPDATE', 'Anmerkungen und Kommentare zu Ihrer Bestellung:' . "\n\n%s\n\n");
+
+define('ERROR_ORDER_DOES_NOT_EXIST', 'Fehler: Die Bestellung existiert nicht!.');
+define('SUCCESS_ORDER_UPDATED', 'Hinweis: Die Bestellung wurde erfolgreich aktualisiert.');
+define('WARNING_ORDER_NOT_UPDATED', 'Hinweis: Es wurde nichts ge&auml;ndert. Daher wurde diese Bestellung nicht aktualisiert.');
+// begin replacement section for Email Subject contribution
+define('EMAIL_TEXT_SUBJECT_1', ' ' . STORE_NAME. ' Order Updated');
+define('EMAIL_TEXT_SUBJECT_2', ':  ');
+
+
+define('ORDER', 'Order #');
+define('ORDER_DATE_TIME', 'Order Date & Time');
+
+// end replacement section for Email Subject contribution
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/orders_status.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/orders_status.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/orders_status.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: orders_status.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Bestellstatus');
+
+define('TABLE_HEADING_ORDERS_STATUS', 'Bestellstatus');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_ORDERS_STATUS_NAME', 'Bestellstatus:');
+define('TEXT_INFO_INSERT_INTRO', 'Bitte geben Sie den neuen Bestellstatus mit allen relevanten Daten ein');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie diesen Bestellstatus l&ouml;schen m&ouml;chten?');
+define('TEXT_INFO_HEADING_NEW_ORDERS_STATUS', 'Neuer Bestellstatus');
+define('TEXT_INFO_HEADING_EDIT_ORDERS_STATUS', 'Bestellstatus bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_ORDERS_STATUS', 'Bestellstatus l&ouml;schen');
+
+define('ERROR_REMOVE_DEFAULT_ORDER_STATUS','Fehler: Der Standardbestellstatus kann nicht gel&ouml;scht werden. Legen Sie bitte einen anderen Bestellstatus als Standard fest und versuchen Sie es noch einmal.');
+define('ERROR_STATUS_USED_IN_ORDERS','Fehler: Dieser Bestellstatus wird derzeit in aktuellen Bestellungen verwendet.');
+define('ERROR_STATUS_USED_IN_HISTORY','Fehler: Dieser Bestellstatus wird derzeit in der aktuellen Bestellhistorie verwendet.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/packingslip.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/packingslip.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/packingslip.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: packingslip.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_HEADING_COMMENTS', 'Kommentar');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Produkt-Nr.');
+define('TABLE_HEADING_PRODUCTS', 'Produkte');
+
+define('ENTRY_SOLD_TO', 'Rechnungsanschrift:');
+define('ENTRY_SHIP_TO', 'Lieferanschrift:');
+define('ENTRY_PAYMENT_METHOD', 'Zahlungsweise:');
+
+define('ENTRY_DATE_PURCHASED', 'Gekauft am:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/pages.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: pages.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Seiten definieren');
+define('HEADING_TITLE_SEARCH', 'Suchen:');
+
+define('TABLE_HEADING_TITLE', 'Titel');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_PAGES_HEADING_DELETE_PAGE', 'Seite l&ouml;schen');
+
+define('TEXT_DELETE_INTRO', 'Sind Sie sicher, dass Sie die Seite l&ouml;schen wollen?');
+
+define('TEXT_PAGES_CATEGORY', 'Kategorie:');
+define('TEXT_DATE_PAGES_CREATED', 'Datum erstellt:');
+define('TEXT_DATE_PAGES_LAST_MODIFIED', 'Datum letzte &Auml;nderung:');
+define('TEXT_IMAGE_NONEXISTENT', 'Keine Grafik vorhanden');
+
+define('ENTRY_TITLE', 'Titel:');
+define('ENTRY_CATEGORY', 'Kategorie:');
+define('ENTRY_BLURB', 'Kurztext:');
+define('ENTRY_BODY', 'Langtext:');
+define('ENTRY_IMAGE', 'Grafik:');
+define('ENTRY_META_TITLE', 'Meta Titel:');
+define('ENTRY_META_KEYWORDS', 'Meta Schl&uuml;sselbegriffe:');
+define('ENTRY_META_DESCRIPTION', 'Meta Beschreibung:');
+define('ENTRY_STATUS', 'Status:');
+define('ENTRY_SORT_ORDER', 'Sort Order:');
+define('ENTRY_AUTHOR', 'Autor:');
+
+define('TEXT_PAGES_ACTIVE', 'Aktiv');
+define('TEXT_PAGES_INACTIVE', 'Inaktiv');
+
+define('TEXT_NO_CATEGORY', 'Keine Kategorie');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> Seiten)');
+
+define('IMAGE_NEW_PAGE', 'Neue Seite');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/pages_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/pages_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/pages_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: pages_categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Kategorieseite definieren');
+define('HEADING_TITLE_SEARCH', 'Suchen:');
+
+define('TABLE_HEADING_NAME', 'Name');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_PAGES_HEADING_NEW_PAGES_CATEGORY', 'Neue Kategorie');
+define('TEXT_PAGES_HEADING_EDIT_PAGES_CATEGORY', 'Editiere Kategorie');
+define('TEXT_PAGES_HEADING_DELETE_PAGES_CATEGORY', 'L&ouml;sche Kategorie');
+
+define('TEXT_PAGES_CATEGORY_COUNT', 'Seite:');
+define('TEXT_PAGES_CATEGORY_STATUS', 'Status:');
+define('TEXT_PAGES_CATEGORY_DESCRIPTION', 'Beschreibung:');
+define('TEXT_PAGES_CATEGORY_SORT_ORDER', 'Sortierreihenfolge:');
+define('TEXT_DATE_PAGES_CATEGORY_CREATED', 'erstellt am:');
+define('TEXT_DATE_PAGES_CATEGORY_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+define('TEXT_IMAGE_NONEXISTENT', 'Grafik existiert nicht');
+
+define('TEXT_NEW_PAGES_CATEGORIES_INTRO', 'Bitte geben sie folgende Informationen f&uuml;r die neue Kategorie ein');
+define('TEXT_EDIT_PAGES_CATEGORIES_INTRO', 'Bitte f&uuml;hren sie die notwendigen &Auml;nderungen durch');
+define('TEXT_DELETE_PAGES_CATEGORIES_INTRO', 'Sind Sie sicher, dass Sie diese Kategorie l&ouml;schen wollen?');
+
+define('TEXT_PAGES_CATEGORIES_NAME', 'Kategorie Name:');
+define('TEXT_PAGES_CATEGORIES_DESCRIPTION', 'Kategorie Beschreibung:');
+define('TEXT_PAGES_CATEGORIES_IMAGE', 'Kategorie Grafik:');
+define('TEXT_PAGES_CATEGORIES_SORT_ORDER', 'Sortierreihenfolge:');
+define('TEXT_PAGES_CATEGORIES_STATUS', 'Status:');
+define('TEXT_PAGES_CATEGORIES_STATUS_ENABLE', 'Aktivieren');
+define('TEXT_PAGES_CATEGORIES_STATUS_DISABLE', 'Deaktivieren');
+
+define('TEXT_DELETE_WARNING_LINKS', '<b>WARNUNG:</b> Es sind bereits %s Seiten mit dieser Kategorie verlinkt!');
+
+define('TEXT_DISPLAY_NUMBER_OF_PAGES_CATEGORIES', 'Anzeige <b>%d</b> bis <b>%d</b> (von <b>%d</b> Kategorien)');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/popup_data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/popup_data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/popup_data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: popup_data_help.php,v 1.1 $
+  
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Data Input/output Help');
+define('TEXT_INFO_HEADING_NEW_DATA', 'Data Input/output Help');
+
+define('TEXT_INFO_FROOGLE_HEADING_SET_CATEGORIES', 'Categories Help');
+define('TEXT_INFO_FROOGLE_HEADING_CONFIGURE', 'Configure Help');
+define('TEXT_INFO_FROOGLE_HEADING_PRE_FEED', 'Pre Feed Help');
+define('TEXT_INFO_FROOGLE_HEADING_RUN', 'Run Feed Help');
+
+define('TEXT_FROOGLE_SET_CATEGORIES_HELP', 'Run this step the first time you do a Froogle feed. <br> After you have run this the first time do this step only if you have added or changed categories.  This step is very process intense and time consuming for large sites. It will build all of your catagory paths for you.');
+define('TEXT_FROOGLE_CONFIGURE_HELP', 'You can build multiple configuration for the froogle feed. You must have at least one froogle configuration');
+define('TEXT_FROOGLE_PRE_FEED_HELP', 'In this step you will assemble the data into a text file that will be submitted to Froogle. If the process takes more then 1 minute you have a large store or there is a problem.');
+define('TEXT_FROOGLE_RUN_HELP', 'This is the last step. It will submit the feed directly to froogle if you have entered the correct FTP information in the configuration. You must wait 30 minute between submissions');
+
+define('TEXT_INFO_FROOGLE_FEED_NAME', 'Name of Feed Help');
+define('TEXT_INFO_FROOGLE_FEED_DISC', 'Data Feed Discription Help');
+define('TEXT_INFO_FROOGLE_FEED_FILE_TYPE', 'Data Feed File Type Help');
+define('TEXT_INFO_FROOGLE_FEED_TYPE', 'Feed Type Help');
+define('TEXT_INFO_FROOGLE_FEED', '<b>Froogle FTP information</b>');
+define('TEXT_INFO_FROOGLE_FEED_FEED_SERVICE', 'Feed Service Help');
+define('TEXT_INFO_FROOGLE_FEED_STATUS', 'Status Help');
+define('TEXT_INFO_FROOGLE_FEED_FILE', 'File name Help');
+define('TEXT_INFO_FROOGLE_FEED_IMAGE', 'Image URL Help');
+define('TEXT_INFO_FROOGLE_FEED_PRODUCT', 'Product URL Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_SERVER', 'Froogle FTP Server Name Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_USER', 'Froogle FTP User Name Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_PASSWORD', 'Froogle FTP Password Help');
+define('TEXT_INFO_FROOGLE_FEED_FTP_DIRECTORY', 'Froogle FTP Directory Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR', 'Use store Currency Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR_USE', 'Other currency Help');
+define('TEXT_INFO_FROOGLE_FEED_LANG', 'Use store languge Help');
+define('TEXT_INFO_FROOGLE_FEED_LANG_USE', 'Other languge Help');
+define('TEXT_INFO_FROOGLE_FEED_CUR_CON', 'Convert Currency Help');
+define('TEXT_INFO_FROOGLE_FEED_TAX', 'Tax Class ID Help');
+
+
+define('TEXT_FROOGLE_FEED_NAME_HELP', 'Enter a unique name for this frogle feed.  You will use this name later in the process to identify this feed configuration..');
+define('TEXT_FROOGLE_FEED_DISC_HELP', 'Enter a short discription to identify this feed configuration. You can also add a few notes here to help discribe this feed');
+define('TEXT_FROOGLE_FEED_FILE_TYPE_HELP', 'Select the type of feed from the drop down. Use product for your normal product listing, Businees is for changing business information. ');
+define('TEXT_FROOGLE_FEED_TYPE_HELP', 'Use basic for a basic feed and advance for advance feed. <br> Note: not all of the advance feed items have been installed.');
+define('TEXT_FROOGLE_FEED_HELP', '<b>Froogle FTP information</b>');
+define('TEXT_FROOGLE_FEED_FEED_SERVICE_HELP', 'Select which feed this configuration is for. Only Froogle feed is installed. ');
+define('TEXT_FROOGLE_FEED_STATUS_HELP', 'Active or Inactive. Inactive configurations will not be available in the data feed page');
+define('TEXT_FROOGLE_FEED_FILE_HELP', 'Type in the file name of the file you want to store your feed in. Its should be unique and not duplicate in other feeds');
+define('TEXT_FROOGLE_FEED_IMAGE_HELP', 'Type in the patch to your product images, it should start from the images directory. <br> Example: http://mysite.com/images/categories/t_4647.jpg would be  categories/ ');
+define('TEXT_FROOGLE_FEED_PRODUCT_HELP', 'This is not used');
+define('TEXT_FROOGLE_FEED_FTP_SERVER_HELP', 'Name of the feed server. For froogle feed leave blank and hedwig.google.com will be used');
+define('TEXT_FROOGLE_FEED_FTP_USER_HELP', 'Enter the FTP user name you entered when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_FTP_PASSWORD_HELP', 'Enter the FTP user password you entered when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_FTP_DIRECTORY_HELP', 'Enter the FTP directory that you were assigned when you signed up for the service.');
+define('TEXT_FROOGLE_FEED_CUR_HELP', 'False: Use the store default currency. If you click on this radio button you will use the default store currency. ');
+define('TEXT_FROOGLE_FEED_CUR_USE_HELP', 'If you checked True in the above line enter the alternete currency code here. It must be a currency code that the service knows.');
+define('TEXT_FROOGLE_FEED_LANG_HELP', 'False: Use store default language indicates that you want to use the store default language.');
+define('TEXT_FROOGLE_FEED_LANG_USE_HELP', 'If you entered true into the above line, Use the drop down box to choose a different language code.');
+define('TEXT_FROOGLE_FEED_CUR_CON_HELP', 'Convert to store currency when the visiter visits your store. Use this is you have multiple currencies in your store.');
+define('TEXT_FROOGLE_FEED_TAX_HELP', 'Enter the tax class ID number from the store or set to zero (0) for no tax caculation');
+
+
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/popup_ep_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/popup_ep_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/popup_ep_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+  $Id: popup_ep_help.php,v 1.1 $
+  
+  Copyright (c) 2005 Chainreactionworks.com
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Easy Populate Hilfe');
+define('TEXT_INFO_HEADING_NEW_DATA', 'Easy Populate Hilfe');
+
+define('TEXT_HEAD_HELP_EP_FILE_UPLOAD', 'Datei Upload Hilfe');
+define('TEXT_HELP_EP_FILE_UPLOAD', 'Dieses Erlaub erm&ouml;glicht es Ihnen, die angepasste EPA Datei hochzuladen und in die Datenbank einzuspielen. Es gibt eine Begrenzung zur Gr&ouml;ße der Datei, die Sie hochladen k&ouml;nnen. Normalerweise liegt diese Begrenzung bei 2 MB. Dieses Begrenzung ist in den PHP Einstellungen hinterlegt. Sollte sich daraus ein Problem ergeben, bleiben Ihnen die Nachfolgenden M&ouml;glichkeiten. Begrenzen Sie die Anzahl der zu Exportierenden Produkte. Eine weitere Alternative w&auml;re Ihren Hoster um eine vergr&ouml;sserung des Limits zu bitten.
+');
+
+define('TEXT_HEAD_HELP_EP_FILE_UPLOAD_SPLIT', 'Datei Upload und Splitt Hilfe');
+define('TEXT_HELP_EP_FILE_UPLOAD_SPLIT', 'Dieses erlauben Ihnen, die geänderte EPA Datei aufzuteilen und diese in kleineren Stücken auf den Webserver zu laden und diese in die Datenbank einzupflegen. Somit wird eine eventuelle Größenbeschränkung Ihres Webservers übergangen.');
+
+define('TEXT_HEAD_HELP_EP_FILE_SPLIT', 'EP Datei auf dem Server teilen');
+define('TEXT_HELP_EP_FILE_SPLIT', 'This allow you to spilt the edited EPA file it into smaller parts, after it has been uploaded to the server, so it can be inputed into your databse.
+                                 Once you have "Split a EP File on the server"
+                                 the EPA file. Use the " Import Data from file in temp/ " to insert each file into the database. The number or records you set
+                                 in the admin/epconfigure.php will limit the records in the spilt files. The current limit is 1,000 records but EPA can handle well over 2,000 records, this should take 3 to 4 minutes to insert. This is done so the program will not time out.');
+
+
+define('TEXT_HEAD_HELP_EP_FILE_INSERT', 'File Insert a File Help');
+define('TEXT_HELP_EP_FILE_INSERT', 'Select a file in the drop down box. This is a list the files that have been uploaded or split in the directory
+                                    You can choosen to store your EPA file on line. The number of records in each split is set in 
+                                    the ep configuration');
+
+define('TEXT_HEAD_HELP_EP_FILE_EXPORT', 'Export a file to edit Help');
+define('TEXT_HELP_EP_FILE_EXPORT', 'In this section you can create a export file to be edited in a spread sheet program. If the export file or resulting
+                                    edited file is over 2mb in size you can use the export controls to limit the the size by limiting the data you export.');
+
+define('TEXT_HEAD_HELP_EP_SELECT_METHOD', 'Select meathod to use for download Help');
+define('TEXT_HELP_EP_SELECT_METHOD', 'Here you can select one of two meathods for downloading your export file. "Download" method
+                                      will create a file to be saved it directly to your local computer. "Save to temp file on server"
+                                      will save the file to the temp directory you set in the ep configure. Later you can use a FTP program to
+                                      download the file');
+
+define('TEXT_HEAD_HELP_EP_SELECT_DOWN', 'Select feild groups to export Help');
+define('TEXT_HELP_EP_SELECT_DOWN', 'In this drop down is listed the pre_defined groups of feild that can be downloaded. Please see the
+                                    documentation for which feilds are in which groups.');
+
+define('TEXT_HEAD_HELP_EP_SELECT_SORT', 'Select sort order for export Help');
+define('TEXT_HELP_EP_SELECT_SORT', 'You can select the order your export rows apears in. This is used to group the rows in your export
+                                    file so they can be found easily. ');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_ROWS', 'Limit rows in your Export file Help');
+define('TEXT_HELP_EP_LIMIT_ROWS', 'This group of settings can be used to limit the size of your export file. This is done
+                                    if your import file is to large or you need to target certain record to be edited.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_CATS', 'Limit rows in your Export file by Categories Help');
+define('TEXT_HELP_EP_LIMIT_CATS', 'This will limit the contents of the export file to a specifice Category. When set to "Top" all
+                                  manufactures will be in the export file. When set to a specific category all sub categories will be included.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_MAN', 'Limit rows in your Export file by Manufacture Help');
+define('TEXT_HELP_EP_LIMIT_MAN', 'This will limit the contents of the export file to a specifice manufacture. When set to "Manufactures" all
+                                  manufacture swill be in the export file.');
+
+define('TEXT_HEAD_HELP_EP_LIMIT_PRODUCT', 'Limit rows in your Export file by Product_id Help');
+define('TEXT_HELP_EP_LIMIT_PRODUCT', 'This will limit the contents of the export file to a range of product_id\'s. ');
+
+define('TEXT_HELP_EP_LIMIT_PRODUCT1', '   1. If no product_id\'s are enter all of the product are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT2', '   2. If the begin product_id and no end product_id is entered. Products from the first product id to the end are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT3', '   3. If no beginning product_id\'s aand only and ending product_ID. From the first id to ending the products are in the export file');
+define('TEXT_HELP_EP_LIMIT_PRODUCT4', '   4. If the begin product_id and ending product_id is enter then this range of products are in the export file');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/popup_infobox_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/popup_infobox_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/popup_infobox_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: popup_infobox_help.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Infobox Hilfe');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Infobox Hilfe');
+define('TEXT_INFOBOX_HELP_FILENAME', 'Dies muss den Namen der Box-Datei repr&auml;sentieren, welche Sie in Ihr <u>catalog/includes/boxes</u> Verzeichnis gelegt haben.<br><br> Es muss aus kleinbuchstaben bestehen, kann aber auch Leerzeichen anstelle von Unterstrichen (_) enthalten.<br><br>Zum Beispiel:<br>Wenn Ihre neue Infobox hat den Namen <b>new_box.php</b> hat, dann w&uuml;rden Sie hier eingeben "<b> new box</b>" eingeben.<br><br>Ein anderes Beispiel w&uuml;r die <b>whats_new</b> Box sein.<br> Wahrscheinlich lautet die Datei <b>whats_new.php </b>; Sie k&ouml;nnten hier <b>what\'s new</b> eingeben');
+define('TEXT_INFOBOX_HELP_HEADING', 'Dies ist, was im Katalog genau &uuml;ber der Box angezeigt wird.<br><div align="center"><img border="0" src="images/help1.gif"><br></div>');
+define('TEXT_INFOBOX_HELP_DEFINE', 'Ein Beispiel w&uuml;rde sein: <b>BOX_HEADING_WHATS_NEW</b>.<br> Dies wird dann mit der Haupt-Logik des Shops so wie hier verwendet: <b> define(\'BOX_HEADING_WHATS_NEW\', \'What\'s New?\');</b><br><br> Wenn Sie die Datei <u>catalog/includes/languages/german.php</u> &ouml;ffnen, k&ouml;nnen Sie viele Beispiele davon sehen. Diejenigen welche BOX_HEADING enthalten, werden hier nicht mehr gebraucht, da sie in der Datenbank gespeichert sind, und in den Dateien <b>column_left.php</b> und <b>column_right.php</b> definiert werden.<br>Es ist aber auch nicht notwendig diese zu l&ouml;schen!');
+define('TEXT_INFOBOX_HELP_COLUMN', 'W&auml;hlen Sie <b>Links</b> oder <b>Rechts</b><br> um die Infobox in derlinken oder rechten Spalt anzuzeigen.<br><br>Standardeinstellung ist <b>Links</b>');
+define('TEXT_INFOBOX_HELP_POSITION', 'Geben Sie eine Ziffer Ihrer Wahl hier ein. Je h&ouml;her die Nummer, desto weiter unten wird die Infobox in der ausgew&auml;hlten Spalte sein.<br><br> Wenn Sie gleiche Ziffern für verschiedene Infoboxen in derselben Spalte vergeben, werden diese alphabetisch sortiert angezeigt.<br><br>Wenn Sie keine Ziffer eingeben erfolgt die Sortierung ebenfalls alphabetisch.');
+define('TEXT_INFOBOX_HELP_ACTIVE', 'W&auml;hlen Sie <b>Ja</b> oder <b>Nein</b> um die Infobox anzuzeigen (Ja) oder nicht anzuzeigen (Nein).<br><br>BStandardeinstellung ist  <b>Ja</b>');
+define('TEXT_INFOBOX_HELP_TEMPLATE', 'Dies muss den Namen der Box-Datei repr&auml;sentieren, wo die Funktionen für Ihre Boxen vorzufinden sind. Wenn Sie eine Spezielle Datei für Ihre Funktion haben, sollte Sie in <u>catalog/templates/(NAME DES TEMPLATES)/boxes.tpl.php</u> sein <br><br> Der Dateiname muss aus Kleinbuchstaben bestehen.<br><br>Zum Beispiel:<br>Ihre neue Infobox Template Funktionsdatei ist Standard, geben Sie <b>infobox</b> an, und das wird die Standardfunktionen nutzen. Wenn Sie spezielle Funktionen für Ihre Infobox verwenden, geben Sie hier <b>box.tpl.php</b> an, und legen die Datei in <u>catalog/templates/(NAME DES TEMPLATES)/boxes.tpl.php</u>. ab');
+define('TEXT_INFOBOX_HELP_COLOR', 'Sie k&ouml;nnen das pop_up Farbendiagramm benutzen, um die Farbe f&uuml;r die Box&uuml;berschrift vorzuw&auml;hlen. Der Farbcode wird Ihnen dann als Hexadezemalwert angezeigt.');
+define('TEXT_CLOSE_WINDOW', '<u>Fenster schliessen</u> [x]');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/product_extra_fields.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/product_extra_fields.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/product_extra_fields.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: product_extra_fields.php,v 2.0 2004/11/09 15:07:21 ChBu Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Produkte zus&auml;szliche Felder');
+define('SUBHEADING_TITLE', 'Neues Feld hinzuf&uuml;gen');
+
+define('TABLE_HEADING_FIELDS', 'Feld Name');
+define('TABLE_HEADING_ORDER', 'Sortierreihenfolge');
+define('TABLE_HEADING_LANGUAGE', 'Sprache');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('IMAGE_ADD_FIELD', 'Neues Feld hinzuf&uuml;gen');
+define('IMAGE_UPDATE_FIELDS', 'Felder aktualisieren');
+define('IMAGE_REMOVE_FIELDS', 'Selektierte Felder l&ouml;schen');
+
+define ('TEXT_ALL_LANGUAGES', 'Alle');

Added: trunk/direct.openmoko.com/admin/includes/languages/german/product_list_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/product_list_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/product_list_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Produktlisten Verwaltung');
+
+define('TABLE_HEADING_TEMPLATE', 'Produktliste Name');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_ACTIVE', 'Aktive?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Rechte Spalte anzeigen?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Linke Spalte anzeigen?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Kategoriebeschreibung zulassen');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Linke Spaltenbreite (Pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Rechte Spaltenbreite (Pixel)');
+
+define('TEXT_DATE_ADDED', 'Datum hinzugef&uuml;gt:');
+
+define('TEXT_EDIT_INTRO', 'Bitte machen Sie die notwendigen &Auml;nderungen');
+define('TEXT_HEADER', '<b>&Uuml;berschrift</b>');
+define('TEXT_HEADER_EXPLAIN', 'Diese Einstellungen gelten f&uuml;r alle Templates');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Produktlisten Konfiguration');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Produktlisten Konfiguration');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Titel');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Wert');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte machen Sie die notwendigen &Auml;nderungen');
+define('TEXT_INFO_DATE_ADDED', 'Datum hinzugef&uuml;gt:');
+define('TEXT_INFO_LAST_MODIFIED', 'Letzte &Auml;nderung:');
+
+define('ERROR1', 'Error! 01  der Templatename ist nicht identisch mit Namen der .sql Datei, oder diese existiert nicht.');
+define('ERROR3', 'Error! 03  Sie k&ouml;nnen das standard Template nicht installieren');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/products_attributes.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/products_attributes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/products_attributes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: products_attributes.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_OPT', 'Produktmerkmale');
+define('HEADING_TITLE_VAL', 'Optionswert');
+define('HEADING_TITLE_ATRIB', 'Produktmerkmale');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_PRODUCT', 'Produktname');
+define('TABLE_HEADING_OPT_NAME', 'Optionsname');
+define('TABLE_HEADING_OPT_LANGUAGE', 'Sprache');
+define('TABLE_HEADING_OPT_TYPE', 'Optionstyp'); //CLR 031203 add option type column
+define('TABLE_HEADING_OPT_VALUE', 'Optionswert');
+define('TABLE_HEADING_OPT_PRICE', 'Preis');
+define('TABLE_HEADING_OPT_PRICE_PREFIX', 'Vorzeichen (+/-)');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_DOWNLOAD', 'Downloadbare Produkt:');
+define('TABLE_HEADING_OPTION_COMMENTS', 'Kommentare');
+define('TABLE_HEADING_OPT_SIZE', 'Gr&ouml;&szlig;e');
+define('TABLE_TEXT_FILENAME', 'Dateiname:');
+define('TABLE_TEXT_MAX_DAYS', 'Zeitspanne:');
+define('TABLE_TEXT_MAX_COUNT', 'Maximale Anzahl zum Herunterladen:');
+
+define('MAX_ROW_LISTS_OPTIONS', 10);
+
+define('TEXT_WARNING_OF_DELETE', 'Mit dieser Option sind Produkt, sowie Optionsmerkmale verbunden - L&ouml;schen wird nicht empfohlen.');
+define('TEXT_OK_TO_DELETE', 'Mit dieser Option sind keine Produkt, sowie Optionsmerkmale verbunden - Sie kann gel&ouml;scht werden.');
+define('TEXT_OPTION_ID', 'Options ID');
+define('TEXT_OPTION_NAME', 'Optionsname');
+define('TEXT_OPTION_SORTORDER', 'Sortierreihenfolge');
+
+define('TEXT_OPTION_SELECTION', 'Option w&auml;hlen');
+
+define('JAVASCRIPT_TEXT_OPTION_TYPE_TEXT', 'Textual Option');
+
+define('SORT_ORDER', 'Sort Order');
+define('PRICE', 'Price');
+define('MISSING', '*** Missing');
+define('GOOD_FILE', 'Good File');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/products_expected.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/products_expected.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/products_expected.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: products_expected.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'erwartete Produkte');
+
+define('TABLE_HEADING_PRODUCTS', 'Produkte');
+define('TABLE_HEADING_DATE_EXPECTED', 'verf&uuml;gbar ab:');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_DATE_EXPECTED', 'verf&uuml;gbar ab:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/products_multi.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/products_multi.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/products_multi.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+/*
+  $Id: products_multi.php, v 2.0
+
+  autor: sr, 2003-07-31 / sr at ibis-project.de
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Produktegruppen bearbeiten');
+define('HEADING_TITLE_SEARCH', 'Suche: ');
+define('HEADING_TITLE_GOTO', 'Gehe zu:');
+
+define('TABLE_HEADING_ID', 'ID');
+define('TABLE_HEADING_CATEGORIES_CHOOSE', 'W&auml;hle');
+define('TABLE_HEADING_CATEGORIES_PRODUCTS', 'Kategorien / Produkte');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modell');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('DEL_DELETE', 'Produkt l&ouml;schen');
+define('DEL_CHOOSE_DELETE_ART', 'Wie soll gel&ouml;scht werden?');
+define('DEL_THIS_CAT', 'nur in dieser Kategorie');
+define('DEL_COMPLETE', 'Produkt vollst&auml;ndig l&ouml;schen');
+
+define('TEXT_NEW_PRODUCT', 'Neues Produkt in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Kategorien:');
+define('TEXT_ATTENTION_DANGER', '<br><br><span class="dataTableContentRedAlert">!!! Achtung !!! Unbedingt lesen !!!</span><br><br><span class="dataTableContentRed">Das Tool ändert die Tabellen "products_to_categories" (und im Falle von \'Produkt vollständig l&ouml;schen\' auch "products" und "products_description" und einige weitere; siehe function \'tep_remove_product\') - also unbedingt vor jeder Benutzung Sicherheitskopien dieser Tabellen anfertigen, denn:<br><br>Das Tool l&ouml;scht, verschiebt bzw. kopiert alle per Checkbox ausgewählten Produkte ohne Zwischenschritt oder Warnung, also sofort, sobald man auf den Button "go!" geclickt hat.</span><br><br><span class="dataTableContentRedAlert">Dies muss beachtet werden:</span><ul><li>Ganz große Vorsicht bei der Verwendung von <strong>\'Produkt vollständig l&ouml;schen\'</strong>. Diese Funktion l&ouml;scht alle ausgewählten Produkte sofort, ohne Zwischenschritt oder Warnung, und zwar vollständig und aus sämtlichen Tabellen, in denen diese Produkte vorkommen.</li><li>Bei Auswahl von <strong>\'Produkt l&ouml;schen nur in dieser Kategorie\'</strong> werden keine Produkte komplett gel&ouml;scht, sondern nur ihre Verlinkungen in der aktuellen Kategorie - selbst wenn das die einzige Verlinkung ist, und zwar ohne Warnung, also auch Vorsicht mit dieser L&ouml;schfunktion.</li><li>Es werden beim <strong>Kopieren</strong> keine Duplikate von Produkten angelegt, sondern nur Verlinkungen zur ausgewählten Kategorie hizugefügt.</li><li>Das Produkt wird übrigens nur dann in eine neue Kategorie <strong>verschoben</strong> bzw. <strong>kopiert</strong>, wenn es dort nicht bereits vorhanden ist.</li></ul>');
+define('TEXT_MOVE_TO', 'Verschieben nach');
+define('TEXT_CHOOSE_ALL', 'alle ausw&auml;hlen');
+define('TEXT_CHOOSE_ALL_REMOVE', 'Auswahl entfernen');
+define('TEXT_SUBCATEGORIES', 'Unterkategorien:');
+define('TEXT_PRODUCTS', 'Produkt:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Preis:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Steuerklasse:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'durchschnittl. Bewertung:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Anzahl:');
+define('TEXT_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_DATE_AVAILABLE', 'Erscheinungsdatum:');
+define('TEXT_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_IMAGE_NONEXISTENT', 'BILD EXISTIERT NICHT');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Bitte f&uuml;gen Sie eine neue Kategorie oder ein Produkt in <br>&nbsp;<br><b>%s</b> ein.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'F&uuml;r weitere Informationen, besuchen Sie bitte die <a href="http://%s" target="blank"><u>Homepage</u></a> des Herstellers.');
+define('TEXT_PRODUCT_DATE_ADDED', 'Dieses Produkt haben wir am %s in unseren Katalog aufgenommen.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'Dieses Produkt ist erh&auml;ltlich ab %s.');
+
+define('TEXT_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch.');
+define('TEXT_EDIT_CATEGORIES_ID', 'Kategorie ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Kategorie Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Kategorie Bild:');
+define('TEXT_EDIT_SORT_ORDER', 'Sortierreihenfolge:');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Bitte w&auml;hlen Sie eine neue Kategorie aus, in die Sie das Produkt kopieren m&ouml;chten:');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'aktuelle Kategorien:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'Neue Kategorie');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Kategorie bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Kategorie l&ouml;schen');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Kategorie verschieben');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Produkt l&ouml;schen');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Produkt verschieben');
+define('TEXT_INFO_HEADING_COPY_TO', 'Kopieren nach');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Sind Sie sicher, dass Sie diese Kategorie l&ouml;schen m&ouml;chten?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Sind Sie sicher, dass Sie dieses Produkt l&ouml;schen m&ouml;chten?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNUNG:</b> Es existieren noch %s (Unter-)Kategorien, die mit dieser Kategorie verbunden sind!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> Es existieren noch %s Produkte, die mit dieser Kategorie verbunden sind!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Bitte w&auml;hlen Sie die &uuml;bergordnete Kategorie, in die Sie <b>%s</b> verschieben m&ouml;chten');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Bitte w&auml;hlen Sie die &uuml;bergordnete Kategorie, in die Sie <b>%s</b> verschieben m&ouml;chten');
+define('TEXT_MOVE', 'Verschiebe <b>%s</b> nach:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Bitte geben Sie die neue Kategorie mit allen relevanten Daten ein.');
+define('TEXT_CATEGORIES_NAME', 'Kategorie Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Kategorie Bild:');
+define('TEXT_SORT_ORDER', 'Sortierreihenfolge:');
+
+define('TEXT_PRODUCTS_STATUS', 'Produktstatus:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Erscheinungsdatum:');
+define('TEXT_PRODUCT_AVAILABLE', 'auf Lager');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'nicht vorr&auml;tig');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Produkt-Hersteller:');
+define('TEXT_PRODUCTS_NAME', 'Produktname:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Produktbeschreibung:');
+define('TEXT_PRODUCTS_QUANTITY', 'Produktanzahl:');
+define('TEXT_PRODUCTS_MODEL', 'Produkt-Nr.:');
+define('TEXT_PRODUCTS_IMAGE', 'Produktbild:');
+define('TEXT_PRODUCTS_URL', 'Herstellerlink:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(ohne f&uuml;hrendes http://)</small>');
+define('TEXT_PRODUCTS_PRICE', 'Produktpreis:');
+define('TEXT_PRODUCTS_WEIGHT', 'Produktgewicht:');
+define('TEXT_NONE', '--keine--');
+
+define('EMPTY_CATEGORY', 'Leere Kategorie');
+
+define('TEXT_HOW_TO_COPY', 'Kopiermethode:');
+define('TEXT_COPY_AS_LINK', 'Produkt verlinken');
+define('TEXT_COPY_AS_DUPLICATE', 'Produkt duplizieren');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Fehler: Produkte k&ouml;nnen nicht in der gleichen Kategorie verlinkt werden.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Fehler: Das Verzeichnis \'images\' im Katalogverzeichnis ist schreibgesch&uuml;tzt: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Das Verzeichnis \'images\' im Katalogverzeichnis ist nicht vorhanden: ' . DIR_FS_CATALOG_IMAGES);
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/removezip.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/removezip.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/removezip.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('ZIP_REMOVE_CHECK', 'Sind Sie sicher, dass diese Eintrag gel&ouml;scht werden soll?');
+define('ZIP_DELETE_CONFIRM_MESSAGE', 'Eintrag wurde gel&ouml;scht');
+define('ZIP_DELETE_ERROR_MESSAGE', 'Eintrag kann nicht gel&ouml;scht werden');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: reviews.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Produktbewertungen');
+
+define('TABLE_HEADING_PRODUCTS', 'Produkt');
+define('TABLE_HEADING_RATING', 'Bewertung');
+define('TABLE_HEADING_DATE_ADDED', 'hinzugef&uuml;gt am');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('ENTRY_PRODUCT', 'Produkt:');
+define('ENTRY_FROM', 'Absender:');
+define('ENTRY_DATE', 'Datum:');
+define('ENTRY_REVIEW','Bewertungen:');
+define('ENTRY_REVIEW_TEXT','<small><font color="#ff0000"><b>WICHTIG:</b></font></small> HTML wird nicht &uuml;bersetzt! ');
+define('ENTRY_RATING', 'Bewertung:');
+
+define('TEXT_INFO_DELETE_REVIEW_INTRO','Wollen Sie diesen Bericht wirklich l&ouml;schen?');
+
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_INFO_IMAGE_NONEXISTENT', 'BILD EXISTIERT NICHT');
+define('TEXT_INFO_REVIEW_AUTHOR', 'Author:');
+define('TEXT_INFO_REVIEW_RATING', 'Bewertung:');
+define('TEXT_INFO_REVIEW_READ', 'gelesen :');
+define('TEXT_INFO_REVIEW_SIZE', 'Gr&ouml;&szlig;e:');
+define('TEXT_INFO_PRODUCTS_AVERAGE_RATING', 'durchschnittl. Bewertung:');
+
+define('TEXT_OF_5_STARS', '%s von 5 Sternen!');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>GUT</b></font></small>');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>SCHLECHT</b></font></small>');
+define('TEXT_INFO_HEADING_DELETE_REVIEW', 'Bewertung l&ouml;schen');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/salemaker.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/salemaker.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/salemaker.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: salemaker.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'SaleMaker');
+
+define('TABLE_HEADING_SALE_NAME', 'Abverkaufsbezeichnung');
+define('TABLE_HEADING_SALE_DEDUCTION', 'Reduzierung');
+define('TABLE_HEADING_SALE_DATE_START', 'Startdatum');
+define('TABLE_HEADING_SALE_DATE_END', 'Enddatum');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_SALEMAKER_NAME', 'Abverkaufsbezeichnung:');
+define('TEXT_SALEMAKER_DEDUCTION', 'Reduzierung:');
+define('TEXT_SALEMAKER_DEDUCTION_TYPE', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Typ:&nbsp;&nbsp;');
+define('TEXT_SALEMAKER_PRICERANGE_FROM', 'Produkt Preisspanne:');
+define('TEXT_SALEMAKER_PRICERANGE_TO', '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bis&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
+define('TEXT_SALEMAKER_SPECIALS_CONDITION', 'Wenn ein Produkt ein Angebot ist:');
+define('TEXT_SALEMAKER_DATE_START', 'Startdatum:');
+define('TEXT_SALEMAKER_DATE_END', 'Enddatum:');
+define('TEXT_SALEMAKER_CATEGORIES','<b>oder</b> &uuml;berpr&uuml;fen Sie die Kategorien f&uuml;r die dieser Abverkauf gelten soll:');
+define('TEXT_SALEMAKER_POPUP','<a href="javascript:session_win();"><span class="errorText"><b>F&uuml;r Tipps bitte hier klicken.</b></span></a>');
+define('TEXT_SALEMAKER_IMMEDIATELY','Sofort');
+define('TEXT_SALEMAKER_NEVER', 'Nie');
+define('TEXT_SALEMAKER_ENTIRE_CATALOG', 'W&auml;hlen Sie diese Box wenn der Abverkauf f&uuml;r <b>Alle Produkte</b> gelten soll:');
+define('TEXT_SALEMAKER_TOP', 'Gesamter Katalog');
+
+define('TEXT_INFO_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_INFO_DATE_MODIFIED', 'Zuletzt ge&auml;ndert:');
+define('TEXT_INFO_DATE_STATUS_CHANGE', 'Letzte Status &Auml;nderung:');
+define('TEXT_INFO_SPECIALS_CONDITION','Sonderkonditionen:');
+define('TEXT_INFO_DEDUCTION','Reduzierung:');
+define('TEXT_INFO_PRICERANGE_FROM', 'Preisspanne:');
+define('TEXT_INFO_PRICERANGE_TO', ' bis ');
+define('TEXT_INFO_DATE_START', 'Startet:');
+define('TEXT_INFO_DATE_END', 'Endet am:');
+
+define('SPECIALS_CONDITION_DROPDOWN_0','Sonderpreise ignorieren - Auf Produktpreis anwenden und Sonderpreis ersetzen');
+define('SPECIALS_CONDITION_DROPDOWN_1','Abverkaufsoptionen ignorieren - Keinen Abverkaufspreis anwenden wenn ein Sonderpreis existiert');
+define('SPECIALS_CONDITION_DROPDOWN_2','Abverkaufspreis zu Sonderpreis hinzuf&uuml;gen - sonst auf den Preis anwenden');
+
+define('DEDUCTION_TYPE_DROPDOWN_0','Betrag der Reduzierung:');
+define('DEDUCTION_TYPE_DROPDOWN_1', 'Prozent');
+define('DEDUCTION_TYPE_DROPDOWN_2', 'Neuer Preis');
+
+define('TEXT_INFO_HEADING_COPY_SALE', 'Abverkauf kopieren');
+define('TEXT_INFO_COPY_INTRO', 'Eingabe eines neue Names f&uuml;r die Kopie von<br>&nbsp;&nbsp;"%s"');
+
+define('TEXT_INFO_HEADING_DELETE_SALE', 'Abverkauf l&ouml;schen');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie diesen Abverkauf dauerhaft l&ouml;schen wollen?');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/salemaker_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/salemaker_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/salemaker_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: salemaker_info.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE','Abverkaufsmanager');
+define('SUBHEADING_TITLE','Verwendungstipps f&uuml;r den Abverkaufsmanager:');
+define('INFO_TEXT', '<ul>
+                      <li>
+                        Verwenden Sie immer einen \'.\' als Dezimalpunkt bei Nachlass und Preisspanne.
+                      </li>
+                      <li>
+                        Geben Sie Werte in gleicher W&auml;hrung an, so als w&uuml;rden Sie einen Produkt neu einstellen/editieren.
+                      </li>
+                      <li>
+                        In den Nachlassfeldern k&ouml;nnen Sie entweder einen absoluten Wert oder einen Prozentsatz eingeben, welcher abgezogen werden soll,
+                        oder einen neuen Preis, der den alten Preis ersetzt. (zB. lasse &euro;5.00 von allen Preisen nach oder lasse 10% von
+                        allen Preisen nach oder &auml;ndere alle Preise auf &euro;25.00)
+                      </li>
+                      <li>
+                        Eine Preisspanne einzugeben w&uuml;rde die betroffene Produktauswahl schm&auml;lern. (zB.
+                        Produkt von &euro;50.00 bis &euro;150.00)
+                      </li>
+                      <li>
+                        Sie m&uuml;ssen eine Aktion ausw&auml;hlen f&uuml;r den Fall, dass ein Produkt ein Angebot ist <i>und</i> es in den Abverkauf soll:
+            <ul>
+                          <li>
+                            Angebots-Preis ignorieren<br>
+                            Der Abverkaufsnachlass  wird am regul&auml;ren Preis des Produkts angewandt.
+                            (zB. regul&auml;rer Preis &euro;10.00, Angebotspreis &euro;9.50. Abverkaufs-Kondition ist 10%.
+                            Der Endpreis des Produkts wird als &euro;9.00 im Abverkauf angezeigt. Der Angebots-Preis wird ignoriert.)
+                          </li>
+                          <li>
+                            Abverkaufs-Kondition ignorieren<br>
+                            Die Abverkaufs-Konditionwird nicht am Angebot angewandt. Der Angebots-Preis wird genauso angezeigt,
+                            als ob gar kein Abverkauf definiert ist. (zB. regul&auml;rer Preis &euro;10.00, Angebots-Preis &euro;9.50.
+                            Abverkaufs-Kondition ist 10%. Der Endpreis des Produkts wird als &euro;9.00 im Abverkauf angezeigt.
+                            Die Abverkaufs-Kondition wird ignoriert)
+                          </li>
+                          <li>
+                            Abverkaufsnachlass an Angebots-Preis anwenden<br>
+                            Der Abverkaufsnachlass wird am Angebotspreis angewandt. Ein gemischter Preis wird angezeigt.
+                            (zB. regul&auml;rer Preis &euro;10.00, Angebots-Preis &euro;9.50. Abverkaufs-Kondition ist 10%.
+                            Der Endpreis des Produkts wird als &euro;8.55 angezeigt - das sind zus&auml;tzliche 10% vom Angebots-Preis.)
+                          </li>
+                        </ul>
+                      </li>
+                      <li>
+                        Wenn Sie kein Startdatum angeben, wird der Abverkauf sofort gestartet
+                      </li>
+                      <li>
+                        Geben Sie kein Enddatum an, wenn Sie nicht wollen, daß der Abverkauf ausl&auml;uft.
+                      </li>
+                      <li>
+                        Eine Kategorie auszuwählen schliesst automatisch auch die Subkategorien mit ein.
+                      </li>
+                    </ul>');
+define('TEXT_CLOSE_WINDOW', '[ Fenster schliessen ]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/server_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/server_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/server_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: server_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Server Information');
+
+define('TITLE_SERVER_HOST', 'Server Host:');
+define('TITLE_SERVER_OS','Server Betriebssystem:');
+define('TITLE_SERVER_DATE', 'Server Datum:');
+define('TITLE_SERVER_UP_TIME', 'Server Up Time:');
+define('TITLE_HTTP_SERVER', 'HTTP Server:');
+define('TITLE_PHP_VERSION', 'PHP Version:');
+define('TITLE_ZEND_VERSION', 'Zend:');
+define('TITLE_DATABASE_HOST', 'Datenbank Host:');
+define('TITLE_DATABASE', 'Datenbank:');
+define('TITLE_DATABASE_DATE', 'Datenbank Datum:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+define('HEADING_TITLE','ShipWire World Class Fullfillment Services');
+define('CONTENT_TEXT1','<div ALIGN="center"><table BORDER="0" CELLPADDING="0" STYLE="border-collapse: collapse" WIDTH="100%" ID="table1"><tr><td style="padding-right:20px"><FONT face="arial, helvetica, sans-serif"><table border="0" width="100%" id="table744" cellspacing="0" cellpadding="0"><tr><td width="630" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                    '<span class="main"><b>Receive, store, and ship merchandise right from CRE Loaded!</b></span><br><span class="smallText">100% integrated with your CRE Loaded application, our Shipwire module sends orders from CRE Loaded directly to your Shipwire fulfillment center. Take advantage of Shipwire’s volume discounts and have your orders automatically packaged and shipped, often for less than the cost of standard shipping.</span>' . 
+                                    '<p><span class="main"><b>What is Shipwire?</b></span><br><span class="smallText">Shipwire is a popular order fulfillment service that allows you to store merchandise in massive Chicago and Los Angeles warehouses. Then as each order comes into your online store, Shipwire will pack and ship it for you.</p>' . 
+                                    '<p><span class="smallText">You can add a Shipwire account with just a few clicks of the mouse - no programming involved. If you\'re just starting out, or looking for a better way to manage your shipping and handling, Shipwire offers an easy and quick way to outsource shipping with no startup, receiving, storage or packaging fees. You just pay $79.95 a month, plus a Shipwire handling fee on the merchandise that they ship. Handling fees range from $1 to $1.50 an item and depend on the type of handling your product needs. </span></p>' . 
+                                    '<p><span class="smallText">With Shipwire, your customers can receive merchandise anywhere in the world, serviced by the USPS, UPS or one of our freight partners. With facilities shipping more than 200,000 orders a month, they can customize your merchandise with assembly and kitting services at extremely affordable prices.</span></p>' .
+                                    '<p><span class="smallText">Shipwire makes it simple to automate order fulfillment on your site: Get approved in 24 hours. As soon as you enter your SKU information and send them your initial inventory, they can start shipping your orders.</span></p>' . 
+                                    '<p><span class="smallText">Shipwire makes extensive efforts to help you accurately monitor shipping and handling costs. Shipwire\'s reporting tools help you understand your inbound and outbound shipping, and automate time-consuming bookkeeping tasks.</span></p>');
+
+define('CONTENT_TEXT2','<span class="smallText"><p>Check out our <a TARGET="_blank" HREF="http://www.creloaded.com/Add-Ons/c22/p77/Shipwire_Pro_Checkout_Success_Module_-_Now_Handles_Mixed_Orders/product_info.html"><b>Shipwire Pro Checkout Success Module</b></a>, which allows you to manage mixed orders; send only those products you choose via Shipwire from a successful order.</span>' .
+                                     '<br>&nbsp;</p></td><td width="30" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">&nbsp;</td><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:13px;font-family:Arial; color:#000002">' . 
+                                     '<span class="lb08"><img src="images/pixel_trans.gif" width="20" height="30" /><table border="0" cellpadding="0" cellspacing="0" id="table745" width="190"><tr style="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '<td width="5" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="5" height="1" alt=""></td><td width="87%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="166" height="1" alt=""></td><td width="5" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="5" height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td width="90" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002" >' . 
+                                     '<img src="images/pixel_trans.gif"  height="1" alt=""></td><td width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr style="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">');
+
+define('CONTENT_TEXT3','<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '</tr><tr><td bgcolor="#CFCFCF" height="40" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif"><td height="40" bgcolor="#E7EFFF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="5" height="1" alt=""></td></FONT>' .
+                                     '<td class="body" height="40" bgcolor="#E7EFFF" colspan="8"><p style="margin-top: 4px; margin-bottom: 4px"><font face="Arial" color="#003399" style="font-size: 16pt">Basic</font></p><p style="margin-top: 4px; margin-bottom: 4px"><span style="font-weight: 700"> <font face="Arial" size="3" color="#666666">$79.95/mo</font></span></td><font face="arial, helvetica, sans-serif">' .
+                                     '<td bgcolor="#CFCFCF" height="40" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></FONT></tr><tr><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>  <td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr><td bgcolor="#CFCFCF" height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td>' .
+                                     '<td height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="7" height="1" alt=""></td><td class="body" height="25" colspan="8"><br><font color="#666666">No setup fee,<br>$1 to $1.50 handling fee</font><font color="#003399"><br>&nbsp;</font><table cellpadding="0" cellspacing="0" border="0" id="table746">' .
+                                     '<tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table747"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table748"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt">');
+
+define('CONTENT_TEXT4','<img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Easy setup with your store</font></span></span></font></td>' .
+                                     '</tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table749"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table750"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '  <FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002">' .
+                                     '<span class="lb08"><font face="Arial" color="#666666">Online inventory manager</font></span></span></font></td></tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table751"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table752">' .
+                                     '<tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td><td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Sell up to 50 items</font></span></span></font></td></tr></table></td></tr><tr><td class="faqLinks"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table753"><tr><td valign="top" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<table border="0" width="100%" cellspacing="0" cellpadding="0" id="table754"><tr><td height="18" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" style="font-size: 9pt"><img src="http://www.shipwire.com/exec/images/blackbullet.gif" width="4" height="4" hspace="8" align="middle"></FONT></td></tr></table></td>');
+
+define('CONTENT_TEXT5','<td width="100%" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><FONT face="arial, helvetica, sans-serif" size="2"><span style="font-size:9pt;font-family:Arial; color:#000002"><span class="lb08"><font face="Arial" color="#666666">Unlimited email support</font></span></span></font></td></tr></table></td></tr></table><p ALIGN="center"><span style="font-family: Verdana; font-size: 10px; color:#000002">' .
+                                     '<font face="Arial" size="2" color="#000000"><a TARGET="_blank" HREF="http://www.shipwire.com/exec/creloaded.php?ref=6133361"><input type="button" value="Free Sign Up" onclick="\'document.location.href=create_account.php\'" style="font-family:Arial; font-size:13px; "></a>&nbsp;&nbsp;&nbsp; </font></span><br><br>&nbsp;&nbsp;</p></td><td bgcolor="#CFCFCF" height="25" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td></tr><tr><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"><img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif"><td colspan="9" bgcolor="#CFCFCF" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002">' .
+                                     '<img src="images/pixel_trans.gif" width="1" height="1" alt=""></td><font face="arial, helvetica, sans-serif" size="2"><td bgcolor="#CFCFCF" width="1" STYLE="font-family: Verdana, Arial, Helvetica; font-size; color: #000002"></FONT></FONT></tr></table></span></span></font></td></tr></table></font></td></tr></table></div>');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/shopbyprice.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/shopbyprice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/shopbyprice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: tax_classes.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Shop nach Preis sortiert');
+
+define('TABLE_HEADING_OPTIONS', 'Sortier Optionen');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_OPTION_1', 'Sortier-Optionen');
+define('TEXT_INFO_OPTION_2', 'Sortier-Bereich z.B. von 1 Eur bis 100 Eur');
+
+define('TEXT_EDIT_HEADING_OPTIONS', 'Optionen:');
+define('TEXT_EDIT_OPTIONS_INTRO', 'Setzen Sie die Anzahl der Bereiche. Schliesst die Optionen optional, "und über" Bereich ein.');
+define('TEXT_EDIT_ERROR_RANGES', 'Die Eingabe muss numerisch sein.');
+
+define('TEXT_EDIT_HEADING_RANGE', 'Bereiche:');
+define('TEXT_EDIT_RANGE_INTRO', 'Die Bereichsgrenzen d&uuml;rfen nicht &uuml;bereinstimmen z.B. 1-100 100-200 ist nicht g&uuml;ltig.');
+define('TEXT_EDIT_ERROR_RANGE', 'Die Bereiche d&uuml;rfen nicht &uuml;berlappen.');
+define('TEXT_EDIT_ERROR_NUMERIC', 'Einer der Bereiche enth/auml;lt keinen numerischen Wert.');
+
+define('TEXT_INFO_RANGES', 'Bereich ausw&auml;len:');
+define('TEXT_INFO_OPTIONS_DESCRIPTION', 'Der Wert 0 deaktiviert die Funktion.');
+define('TEXT_INFO_OVER', 'Den Bereich "darüber" aktivieren:');
+
+define('TEXT_INFO_ZERORANGE', 'Diese Funktion ist vor&uuml;bergehend deaktiviert worden. Aktivieren m&ouml;glich durch das Setzen der Anzahl von Bereichen.');
+define('TEXT_INFO_NORANGE', 'Es wurden keine Bereiche festgelegt.');
+define('TEXT_INFO_UNDER', 'Unter&nbsp;');
+define('TEXT_INFO_FROM', 'Vonnbsp;');
+define('TEXT_INFO_TO', '&nbsp;bis&nbsp;');
+define('TEXT_INFO_ABOVE', '&nbsp;dar&uuml;ber');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/specials.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: specials.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Sonderangebote');
+
+define('TABLE_HEADING_PRODUCTS', 'Produkt');
+define('TABLE_HEADING_PRODUCTS_PRICE', 'Produktpreis');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_SPECIALS_PRODUCT', 'Produkt:');
+define('TEXT_SPECIALS_SPECIAL_PRICE', 'Sonderpreis:');
+define('TEXT_SPECIALS_EXPIRES_DATE', 'G&uuml;ltig bis:<br><small>(dd.mm.yyyy)</small>');
+define('TEXT_SPECIALS_PRICE_TIP', '<b>Bemerkung:</b><ul><li>Sie k&ouml;nnen im Feld Angebotspreis auch prozentuale Werte angeben, z.B.: <b>20%</b></li><li>Wenn Sie einen neuen Preis eingeben, m&uuml;ssen die Nachkommastellen mit einem \'.\' getrennt werden, z.B.: <b>49.99</b></li><li>Lassen Sie das Feld <b>\'Gültig bis\'</b> leer, wenn der Angebotspreis zeitlich unbegrenzt gelten soll.</li></ul>');
+
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_INFO_NEW_PRICE', 'neuer Preis:');
+define('TEXT_INFO_ORIGINAL_PRICE', 'alter Preis:');
+define('TEXT_INFO_PERCENTAGE', 'Prozent:');
+define('TEXT_INFO_EXPIRES_DATE', 'G&uuml;ltig bis:');
+define('TEXT_INFO_STATUS_CHANGE', 'Status ge&auml;ndert:');
+
+define('TEXT_INFO_HEADING_DELETE_SPECIALS', 'Sonderangebot l&ouml;schen');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie das Sonderangebot l&ouml;schen wollen?');
+define('TEXT_SPECIALS_GROUPS', 'Kunden Gruppen:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/specialsbycategory.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/specialsbycategory.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/specialsbycategory.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: specialsbycategory.php,v 1.0 2005/04/24 23:41:21 calimeross Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('HEADING_TITLE', 'Sonderangebote nach Kategorie');
+define('TEXT_SELECT_CAT', 'Kategorie ausw&auml;hlen');
+define('TEXT_SELECT_MAN', '<br>und/oder Hersteller');
+define('TEXT_ENTER_DISCOUNT','Geben Sie den Rabat ein');
+define('TEXT_PCT_AND','% und');
+define('TEXT_BUTTON_SUBMIT', 'anbieten');
+
+define('TEXT_INSTRUCT_1','Lassen Sie den Bereich leer um alle Artikel in der gew&auml;hlten Kategorie anzuzeigen');
+define('TEXT_INSTRUCT_2','Geben Sie 0 ein um alles in der gew&auml;hlten Kategorie zur&uuml;ck zu setzen');
+
+define('TABLE_HEADING_PRODUCTS', 'Produkte');
+define('TABLE_HEADING_PRODUCTS_PRICE', 'Produkt Preis');
+define('TABLE_HEADING_SPECIAL_PRICE', 'Sonderangebots Preis');
+define('TABLE_HEADING_PCT_OFF', '%von');
+define('TABLE_HEADING_FULL_PRICE', 'Voller Preis');
+
+define('TEXT_BUTTON_UPDATE', 'Aktualisieren');
+
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_articles_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_articles_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_articles_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_articles_viewed.php,v 1.5 2005/03/01 15:51:03 info at bridegroompress.com Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Am meisten besuchte Produkte');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_ARTICLES', 'Produkt');
+define('TABLE_HEADING_VIEWED', 'Besucht');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_credits.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_credits.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_credits.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.9 2002/03/30 15:03:59 harley_vb Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Credit Stats');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_CUSTOMERS', 'Customer');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Credit');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Kunden mit den h&ouml;chsten Ums&auml;tzen');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_CUSTOMERS', 'Kunden');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Gesamtsumme');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_customers_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_customers_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_customers_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: stats_customers_orders.php,v 1.2 24 mars 2004
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  originally developed by xaglo
+  Released under the GNU General Public License
+*/
+define('HEADING_TITLE', 'Kunden Statistik');
+define('HEADING_MONTH', 'Monat:');
+define('HEADING_YEAR', 'Jahr:');
+define('HEADING_NUMBER_ORDERS', 'Produkt<br>Anzahl:');
+define('HEADING_TITLE_NO_STATUS', 'Abgebrochene Bestellung:');
+define('HEADING_TITLE_STATUS', 'Bestellungs Status:');
+define('TEXT_NO_ORDERS', 'Keine');
+define('TEXT_ALL_ORDERS', 'Alle');
+define('TEXT_ALL_MOIS', 'Jeden Monat');
+define('TEXT_ALL_ANNEE', 'Jedes Jahr');
+define('NEW_CUSTOMERS', 'Neuer Kunde:');
+define('NUMBER_ORDER', 'Bestellungen:');
+define('CUSTOMERS_BOUGHT', 'Kunden, die gekauft haben :');
+define('NEW_CUSTOMERS_BOUGHT', 'Neue Kunden, die gekauft haben:');
+define('TEXT_MINI_ORDERED', 'Kunden mit mindest <b>%s</b> k&auml;ufen(s)');
+define('TOTAL_TTC', 'Gesamt verk&auml;ufe einschlie&szlig;lich aller Steuern:');
+define('TOTAL_TAX', 'Gesamte Steuer:');
+define('TOTAL_SHIPPING', 'Gesamte Versandkosten:');
+define('TOTAL_HT', 'Gesamt Summe:');
+define('BASKET_TTC', 'Durchschnittlicher Verkauf einschlie&szlig;lich aller Steuern :');
+define('BASKET_HT', 'Durchschnittlicher Preis:');
+define('JAN', 'Januar');
+define('FEV', 'Februar');
+define('MAR', 'M&auml;rz');
+define('AVR', 'April');
+define('MAI', 'Mai');
+define('JUN', 'Juni');
+define('JUI', 'Juli');
+define('AOU', 'August');
+define('SEP', 'September');
+define('OCT', 'Oktober');
+define('NOV', 'November');
+define('DEC', 'Dezember');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_daily_products_sales_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_daily_products_sales_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_daily_products_sales_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  Written by Marc Sauton, September 2004
+  Daily Product Report Contribution for the OsCommerce Community
+  Released under the GNU General Public License
+  stats_daily_products_sales_report.php
+*/
+
+define('HEADING_TITLE', 'T&auml;gliche Verkaufs Statistik');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_ORDER_QUANTITY', 'Bestellungs Anzahl');
+define('TABLE_HEADING_PRODUCT_NAME', 'Produkt Name');
+define('TABLE_HEADING_PRODUCT_MODEL', 'Produkt Modell');
+define('TABLE_HEADING_UNITPRICE', 'Preis Verpackungseinheit');
+define('TABLE_HEADING_PRODUCT_QUANTITY', 'Produkt St&uuml;ckzahl');
+define('TABLE_HEADING_TOTAL_PURCHASED', 'Summe Gesamt');
+
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> Kunden)');
+define('TEXT_BUTTON_REPORT_SAVE','Save CSV');
+
+define('TABLE_DAILY_VALUE', 'T&auml;gliche Summe: € ');
+define('DISPLAY_ANOTHER_REPORT_DATE', 'Andere Statistik dieses Tages anzeigen: ');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_monthly_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_monthly_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_monthly_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,105 @@
+<?php
+/*
+  $Id: stats_monthly_sales.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Monatlicher Verkaufs- und MwSt.-Report');
+define('HEADING_TITLE_STATUS','Status');
+define('HEADING_TITLE_REPORTED','Berichtet');
+define('TEXT_DETAIL','Detail');
+define('TEXT_ALL_ORDERS', 'Alle Bestellungen');
+define('TEXT_NOTHING_FOUND', 'Kein Eingang zu dieser Datum/Status-Auswahl gefunden');
+define('TEXT_BUTTON_REPORT_BACK','Zur&uuml;ck');
+define('TEXT_BUTTON_REPORT_INVERT','umkehren');
+define('TEXT_BUTTON_REPORT_PRINT','Drucken');
+define('TEXT_BUTTON_REPORT_HELP','Hilfe');
+define('TEXT_BUTTON_REPORT_SAVE','Save CSV');
+define('TEXT_BUTTON_REPORT_BACK_DESC', 'Return to summary by months');
+define('TEXT_BUTTON_REPORT_INVERT_DESC', 'Invertieren der Liste');
+define('TEXT_BUTTON_REPORT_PRINT_DESC', 'Report zum ausdrucken');
+define('TEXT_BUTTON_REPORT_HELP_DESC', 'Hilfe zu diesem Report');
+define('TEXT_BUTTON_REPORT_GET_DETAIL', 'T&auml;glicher Report f&uuml;r diesen Monat');
+define('TEXT_REPORT_DATE_FORMAT', 'j M Y -   g:i a'); // date format string
+//  as specified in php manual here: http://www.php.net/manual/en/function.date.php
+
+define('TABLE_HEADING_YEAR','Jahr');
+define('TABLE_HEADING_MONTH', 'Monat');
+define('TABLE_HEADING_DAY', 'Tage');
+define('TABLE_HEADING_INCOME', 'Brutto<br> Einnahmen');
+define('TABLE_HEADING_SALES', 'Produkt<br> Umsatz');
+define('TABLE_HEADING_NONTAXED', 'steuerfreier<br> Umsatz');
+define('TABLE_HEADING_TAXED', 'zu versteuernder<br> Umsatz');
+define('TABLE_HEADING_TAX_COLL', 'MwSt.<br> bezahlt');
+define('TABLE_HEADING_SHIPHNDL', 'Lieferkosten<br> & Handling');
+define('TABLE_HEADING_SHIP_TAX', 'Tax on<br /> Shipping');
+define('TABLE_HEADING_LOWORDER', 'Mindestmengen-<br> Zuschl&auml;ge');
+define('TABLE_HEADING_OTHER', 'Geschenk<br> Gutscheine');  // could be any other extra class value
+define('TABLE_FOOTER_YTD','JGD');
+define('TABLE_FOOTER_YEAR','JAHR');
+define('TEXT_HELP', '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title>Monthly Sales/Tax Report</title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<BODY>
+<center>
+<table width="95%"><tr><td>
+<p class="main" align="center">
+<b>Wie man den zusammenfassenden Bericht ansieht und verwendet</b>
+<p class="main" align="justify">
+<b>Report Shop Aktivit&auml;ten nach Monaten</b>
+<p class="smallText" align="justify">
+Wenn dieser Report ausgew&auml;hlt wird, zeigt dieser Report eine finanzielle &uuml;bersicht aller Auftr&auml;ge in der Datenbank, nach Monaten sortiert.  Jeder, in der Datenbank gespeicherte, Monat im Verlauf des Shops wird in einer Reihe zusammengefasst angezeigt. Angezeigt werden die Positionen der Bestellungen sowie die Menge, Steuern, Versand, Bearbeitungsgeb&uuml;hren sowie Geb&uuml;hren und Gutschriften (Sollte eine Spalte in der Datenbank nicht vorhanden sein, z.B. Gutschein so wird dieser in diesem Bericht ausgelassen).
+<p class="smallText" align="justify">
+Die obere Zeile ist der gegenw&auml;rtige Monat, und die Reihen unter ihr fassen jeden Monat der Datenbank und der jeweiligen Auftr&auml;ge zusammen.  Unter den Reihen jedes Kalenderjahres ist eine Seitenende-Linie und fasst dieses Jahr nach Gesamtmengen in jeder Spalte des Reports zusammen.
+<p class="smallText" align="justify">
+Um die Reihenfolge der Aufträge umzukehren, klicken Sie die „umkehren“ Taste an.
+<p class="main" align="justify">
+<b>Report Monatlich nach Summen pro Tag</b>
+<p class="smallText" align="justify">
+Die Zusammenfassung der t&auml;glichen T&auml;tigkeit innerhalb irgendeines Monats kann angezeigt werden, indem man auf dem Monats Name, links von der Reihe klickt.  Um von der t&auml;glichen Zusammenfassung zur Monatszusammenfassung zur&uuml;ckzugehen, klicken Sie die „zur&uuml;ck“ Taste in der t&auml;glichen Anzeige an.
+<p class="main" align="justify">
+<b>Was die Spalten darstellen (die &Uuml;berschriften erkl&auml;ren)</b>
+<p class="smallText" align="justify">
+Auf der linken Seite werden der Monat und das Jahr der Reihe angegeben.  Die anderen Spalten sind, von links nach rechts verlaufend:
+<ul><li class="smallText"><b>Bruttoeinkommen</b> - Bruttoeinkommen die Gesamtmenge aller Auftr&auml;ge
+<li class="smallText"><b>Auftrag Teilsumme</b> - die Gesamtverk&auml;ufe der Produkte gekauft im Monat
+<br>Die Verk&auml;fe wurde in zwei Kategorien aufgeteilt:
+<li class="smallText"><b>Unversteuerte Verk&auml;fe</b> - die Teilsumme der Verkäufe, die nicht besteuert wurden und
+<li class="smallText"><b>Versteuerte Verk&auml;fe</b> - die Teilsumme der Verk&auml;ufe, die besteuert wurden
+<li class="smallText"><b>Steuern gesammelt</b> - Summe an Steuern der Kunden
+<li class="smallText"><b>Versand & Bearbeitung</b> - Summe aus Versand und Bearbeitung
+<li class="smallText"><b>Geringf&uuml;gige Geb&uuml;hren</b> und <b>Gutscheine</b> - Soweit in  der Datenbank vorhanden geringf&uuml;gige Geb&uuml;hren und/oder Gutscheine, werden die Gesamtmengen von diesen in den unterschiedlichen Spalten gezeigt
+<li class="smallText"><b>Low order fees</b> and <b>Gift Vouchers</b> - if the store has low order fees enabled, and/or gift vouchers, the totals of these are shown in separate columns
+</ul>
+<p class="main" align="justify">
+<b>Vorwählen der Reportzusammenfassung durch Status</b>
+<p class="smallText" align="justify">
+Um die Monatsstatistik oder die t&auml;glichen zusammenfassenden Informationen für einen Auftrag Status zu zeigen, wählen Sie den Status im Drop-Down-Kasten am oberen Rand des Reportbereichs aus.  Abh&auml;ngig von der Datenbank. Je nach dem welcher dieser Werte in dieser gespeichert ist, kann es einen Status f&uuml;r „wartend“ geben oder „Versandt“.  &Auml;ndern Sie diesen Status und der Report wird nachgerechnet und angezeigt.
+<p class="main" align="justify">
+<b>Zeigen der Steuer Details</b>
+<p class="smallText" align="justify">
+Die Summe aller Steuer in jeder m&ouml;glicher Reihe des Reports ist eine Verbindung zu einem popup Fenster, das darstellt, dass der Name der Steuer aufteilt und nach ihrer Einzelperson und Mengen klassifiziert.
+<p class="main" align="justify">
+<b>Report drucken</b>
+<p class="smallText" align="justify">
+Um den Report in einem Drucker-freundlichen Fenster anzusehen, klicken Sie auf den „Druck“ Button, dann verwenden Sie Ihren Datenbanksuchroutine- Druckbefehl im Datei Menü.  Der Speichername und -&uuml;berschriften werden hinzugef&uuml;gt, welche Auftr&auml;ge vorgew&auml;hlt w&uuml;rden, und als der Report erzeugt wurde.
+<p class="main" align="justify">
+<b>Bericht Werte in eine Datei speichern</b>
+<p class="smallText" align="justify">
+Um die Werte des Reports in eine lokalen Datei zu speichern, klicken Sie auf die Sicherungs-CSV Taste an der Unterseite des Reports.  Die Reportwerte werden zu Ihrer Datenbanksuchroutine in einer Textdatei geschrieben, und Sie werden mit einem Sicherungdatei Dialogfeld aufgefordert, zu wählen, wo die Datei gespeichert werden soll.  Der Inhalt der Datei ist im Komma getrennten Format der Werte (CSV), mit einer Zeile für jede Reihe des Reports, der mit der überschriftlinie anfängt, und jeder Wert in der Reihe wird durch Kommas getrennt. Diese Datei kann in vielseitiger Form verwendet werden. Die Datei wird zu Ihrer Datenbanksuchroutine mit einem vorgeschlagenen Dateinamen versehen, der dem vorgewähltem aus Reportnamen besteht, -status und -datum/-zeit. <br><br>
+<p class="smallText">v 2.1.1
+</td></tr>
+</table>
+</BODY>
+</HTML>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_not_valid_users.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_not_valid_users.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_not_valid_users.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id:$
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+
+ define('TABLE_HEADING_DELETE', 'L&ouml;schen');
+ define('TABLE_HEADING_ID', 'Kunden-ID');
+ define('TABLE_HEADING_CUSTOMERS', 'Kundenname');
+ define('TABLE_HEADING_EMAIL', 'Email');
+ define('TABLE_HEADING_LAST_LOGON', 'Zuletzt angemeldet');
+ define('HEADING_TITLE', 'Customers Not Validated');
+ define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
+ define('SIU_BACK', 'Zur&uuml;ck');
+ define('SIU_DELETE', 'L&ouml;schen!');
+ define('SIU_CUSTOMER_DELETED', 'Kunde %s wurde gel&ouml;scht!');
+ define('SURE_TO_DELETE', 'Soll der Kunde %s wirklich gel&ouml;scht werden?');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_notifications.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: stats_products_viewed.php,v 1.1 2003/05/16 00:10:05 ft01189 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Produkt Benachrichtigungen');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_PRODUCTS', 'Produkte');
+define('TABLE_HEADING_COUNT', 'Anzahl Mitteilungen');
+define('TABLE_HEADING_NAME', 'Kunden Name');
+define('TABLE_HEADING_EMAIL', 'Kunden Email Anschrift');
+define('TABLE_HEADING_DATE', 'Benachrichtigung aktivieren');
+define('TEXT_DESCRIPTION', 'Erlaubt Ihnen einen &Uuml;berblick &uuml;ber die Anzahl Kunden die je Produkt benachrichtigt werden wollen. Klicken Sie aud den Produkt Namen um weitere Details zu sehen. ');
+define('TEXT_DESCRIPTION_TO', 'Erlaubt Ihnen einen &Uuml;berblick welche Kunden Benachrichtigt werden wollen. ');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_purchased.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_purchased.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_purchased.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_products_purchased.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Meistverkaufte Produkte');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_PRODUCTS', 'Produkte');
+define('TABLE_HEADING_PURCHASED', 'verkaufte Anzahl');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_products_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: stats_products_viewed.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Meistbesuchte Produkte');
+
+define('TABLE_HEADING_NUMBER', 'Nr.');
+define('TABLE_HEADING_PRODUCTS', 'Produkte');
+define('TABLE_HEADING_VIEWED', 'Besucher');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/stats_sales_report2.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/stats_sales_report2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/stats_sales_report2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.9 2002/03/30 15:03:59 harley_vb Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('REPORT_DATE_FORMAT', 'm. d. Y');
+
+define('HEADING_TITLE', 'Verkaufs Report');
+
+define('REPORT_TYPE_YEARLY', 'J&auml;hrlich');
+define('REPORT_TYPE_MONTHLY', 'Monatlich');
+define('REPORT_TYPE_WEEKLY', 'W&ouml;chentlich');
+define('REPORT_TYPE_DAILY', 'T&auml;glich');
+define('REPORT_START_DATE', 'von Datum');
+define('REPORT_END_DATE', 'bis Datum (inklusive)');
+define('REPORT_DETAIL', 'Detail');
+define('REPORT_MAX', 'Top x zeigen');
+define('REPORT_ALL', 'Alle');
+define('REPORT_SORT', 'Sortierung');
+define('REPORT_EXP', 'Export');
+define('REPORT_SEND', 'Senden');
+define('EXP_NORMAL', 'Normal');
+define('EXP_HTML', 'HTML only');
+define('EXP_CSV', 'CSV');
+
+define('TABLE_HEADING_DATE', 'Datum');
+define('TABLE_HEADING_ORDERS', '#Bestellungen');
+define('TABLE_HEADING_ITEMS', '#Produkt');
+define('TABLE_HEADING_REVENUE', 'Umsatz');
+define('TABLE_HEADING_SHIPPING', 'Versand');
+
+define('DET_HEAD_ONLY', 'Keine Details');
+define('DET_DETAIL', 'Details anzeigen');
+define('DET_DETAIL_ONLY', 'Details mit Betrag');
+
+define('SORT_VAL0', 'Standard');
+define('SORT_VAL1', 'Beschreibung');
+define('SORT_VAL2', 'Beschreibung ab');
+define('SORT_VAL3', '#Produkt auf');
+define('SORT_VAL4', '#Produkt');
+define('SORT_VAL5', 'Umsatz auf');
+define('SORT_VAL6', 'Umsatz');
+
+define('REPORT_STATUS_FILTER', 'Status');
+
+define('SR_SEPARATOR1', ';');
+define('SR_SEPARATOR2', ';');
+define('SR_NEWLINE', '<br>');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/tax_classes.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/tax_classes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/tax_classes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: tax_classes.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Steuerklassen');
+
+define('TABLE_HEADING_TAX_CLASSES', 'Steuerklassen');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_CLASS_TITLE', 'Name der Steuerklasse:');
+define('TEXT_INFO_CLASS_DESCRIPTION', 'Beschreibung:');
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_INFO_INSERT_INTRO', 'Bitte geben Sie die neue Steuerklasse mit allen relevanten Daten ein');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie diese Steuerklasse l&ouml;schen m&ouml;chten?');
+define('TEXT_INFO_HEADING_NEW_TAX_CLASS', 'neue Steuerklasse');
+define('TEXT_INFO_HEADING_EDIT_TAX_CLASS', 'Steuerklasse bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_TAX_CLASS', 'Steuerklasse l&ouml;schen');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/tax_rates.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/tax_rates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/tax_rates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: tax_rates.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Steuers&auml;tze');
+
+define('TABLE_HEADING_TAX_RATE_PRIORITY', 'Priorit&auml;t');
+define('TABLE_HEADING_TAX_CLASS_TITLE', 'Steuerklasse');
+define('TABLE_HEADING_COUNTRIES_NAME', 'Land');
+define('TABLE_HEADING_ZONE', 'Steuerzone');
+define('TABLE_HEADING_TAX_RATE', 'Steuersatz');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_DATE_ADDED', 'hinzugef&uuml;gt am:');
+define('TEXT_INFO_LAST_MODIFIED', 'letzte &Auml;nderung:');
+define('TEXT_INFO_CLASS_TITLE', 'Name der Steuerklasse:');
+define('TEXT_INFO_COUNTRY_NAME', 'Land:');
+define('TEXT_INFO_ZONE_NAME', 'Steuerzone:');
+define('TEXT_INFO_TAX_RATE', 'Steuersatz (%):');
+define('TEXT_INFO_TAX_RATE_PRIORITY', 'Steuers&auml;tze mit der gleichen Proorit&auml;t hinzugef&uuml;gt andere zusammengesetzt.<br><br>Priorit&auml;t:');
+define('TEXT_INFO_RATE_DESCRIPTION', 'Beschreibung:');
+define('TEXT_INFO_INSERT_INTRO', 'Bitte geben Sie den neuen Steuersatz mit allen relevanten Daten ein');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie diesen Steuersatz l&ouml;schen m&ouml;chten?');
+define('TEXT_INFO_HEADING_NEW_TAX_RATE', 'Neuer Steuersatz');
+define('TEXT_INFO_HEADING_EDIT_TAX_RATE', 'Steuersatz bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_TAX_RATE', 'Steuersatz l&ouml;schen');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/template_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/template_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/template_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: template_admin.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Template Admin');
+
+define('TABLE_HEADING_TEMPLATE', 'Template Name');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_ACTIVE', 'Aktiv?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Rechte Spalte anzeigen?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Linke Spalte anzeigen?');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Kategorie Beschreibung erlauben');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Linke Spaltenbreite (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Linke Spaltenbreite (pixel)');
+
+define('TEXT_DATE_ADDED', 'hinzugef&uuml;gt am:');
+
+define('TEXT_EDIT_INTRO', 'Nehmen Sie bitte alle notwendigen &Auml;nderungen vor');
+define('TEXT_HEADER', '<b>Kopfzeile</b>');
+define('TEXT_HEADER_EXPLAIN', 'Diese Einstellungen wirken sich auf alle Templates aus');
+define('TABLE_HEADING_CONFIGURATION_INFO', 'Seitliche Boxen Konfigurieren');
+define('TABLE_HEADING_CONFIGURATION_LAYOUT', 'Layout Konfigurieren');
+
+define('TABLE_HEADING_CONFIGURATION_TITLE', 'Titel');
+define('TABLE_HEADING_CONFIGURATION_VALUE', 'Wert');
+
+define('TEXT_INFO_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_INFO_DATE_ADDED', 'Date Added:');
+define('TEXT_INFO_LAST_MODIFIED', 'Last Modified:');
+
+define('ERROR1', 'Error! 01  The template name is not the same as the .sql file or the sql file is not present');
+define('ERROR3', 'Error! 03  You can not install the default template, sorry');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/template_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/template_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/template_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+
+  Copyright (c) 2004 CRE Works
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Template Verwaltung');
+
+define('TABLE_HEADING_TEMPLATE', 'Template Name');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_ACTIVE', 'Aktiv?');
+define('TABLE_HEADING_DISPLAY_COLUMN_RIGHT', 'Rechte Spalte Anzeigen?');
+define('TABLE_HEADING_DISPLAY_COLUMN_LEFT', 'Linke Spalte Anzeigen?');
+define('TABLE_HEADING_NOT_INSTALLED', 'Nicht installiert');
+
+define('TEXT_ALLOW_CATEGORY_DESCRIPTIONS', 'Kategorie-Beschreibungen erlauben');
+
+define('TEXT_COLUMN_LEFT_WIDTH', 'Linke Spaltenbreite (pixel)');
+define('TEXT_COLUMN_RIGHT_WIDTH', 'Rechte Spaltenbreite (pixel)');
+
+define('TEXT_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_DELETE_IMAGE', 'Template Vorschau Bild l&ouml;schen?');
+define('TEXT_REST_CUST_TEMP', 'Set Site default template to replace this template in customer data?');
+define('TEXT_DELETE_INTRO', 'Sind Sie sicher, dass Sie dieses Template l&ouml;schen wollen?');
+
+define('TEXT_EDIT_INTRO', 'Bitte f&uuml;hren Sie notwendige &Auml;nderungen durch');
+
+define('TEXT_HEADER', '<b>&Uuml;berschrift</b>');
+define('TEXT_HEADING_DELETE_TEMPLATE', 'Template l&ouml;schen');
+define('TEXT_HEADING_EDIT_TEMPLATE', 'Template editieren');
+define('TEXT_HEADING_NEW_TEMPLATE', 'Neues Template');
+
+define('TEXT_INCLUDE_CART_IN_HEADER', 'Warenkorb im Header anzeigen?');
+define('TEXT_INCLUDE_COLUMN_LEFT', 'Linke Spalte anzeigen?');
+define('TEXT_INCLUDE_COLUMN_RIGHT', 'Rechte Spalte anzeigen?');
+define('TEXT_INCLUDE_HEADER_LINK_BUTTONS', 'Header Link Buttons anzeigen?');
+define('TEXT_INCLUDE_LANGUAGES_IN_HEADER', 'Sprachen im Header anzeigen?');
+define('TEXT_INCLUDE_MAIN_TABLE_BORDER', 'Haupt-Table Border anzeigen?');
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie notwendige &Auml;nderungen durch');
+define('TEXT_INFOBOX_BORDER_WIDTH_LEFT', 'Infobox Linker Rand Bildbreite');
+define('TEXT_INFOBOX_BORDER_WIDTH_RIGHT', 'Infobox Rechter Rand Bildbreite');
+
+define('TEXT_LEFT_COLUMN', '<b>Linke Spalte</b>');
+define('TEXT_RIGHT_COLUMN', '<b>Rechte Spalte</b>');
+define('TEXT_TEMPLATE', 'Template:');
+
+define('TEXT_LAST_MODIFIED', 'Zuletzt ge&auml;ndert:');
+
+define('TEXT_IMAGE_NONEXISTENT', 'BILD NICHT VORHANDEN');
+define('TEXT_YES', 'Ja');
+define('TEXT_NO', 'Nein');
+define('TEXT_NEW_INTRO', 'Bitte geben Sie die folgenden Informationen zum neuen Template an');
+
+
+define('TEXT_TEMPLATE_SYSTEM', 'The template uses the  ');
+define('TEXT_TEMPLATE_SYSTEM_1', ' template system.');
+
+define('TEXT_TEMPLATE_NAME', 'Template Name:  ');
+define('TEXT_TEMPLATE_IMAGE', 'Template Abbildung:  ');
+
+define('TEXT_TEMPLATE_CELLPADDING_MAIN', 'Haupt Tabelle Zeilenabstand');
+define('TEXT_TEMPLATE_CELLPADDING_LEFT', 'Linke Spalte Zeilenabstand');
+define('TEXT_TEMPLATE_CELLPADDING_RIGHT', 'Rechte Spalte Zeilenabstand');
+define('TEXT_TEMPLATE_CELLPADDING_SUB', 'Sub Tabelle Zeilenabstand');
+
+define('TEXT_SITE_WIDTH', 'Seitenbreite');
+
+define('TEXT_MOVE_RIGHT', 'Zur Rechten Spalte f&uuml;gen');
+define('TEXT_MOVE_LEFT', 'Zur Linken Spalte f&uuml;gen');
+
+define('TEXT_SHOW_CUSTOMER_GREETING', 'Kundenbegr&uuml;ssung anzeigen?');
+define('TEXT_SHOW_ORIGINAL_PAGE_HEADERS', 'Hauptseiten-Header anzeigen?');
+
+define('TEXT_TABLE_CELL_PADDING', '<b>Table cellpadding</b>');
+define('TEXT_OTHER', '<b>Andere</b>');
+define('TEXT_MAINPAGE_MODULES', '<b>Module für die Hauptseite ausw&auml;hlen</b>');
+
+define('TEXT_MAINPAGE_MODULES_LOCATION', '<b>The module folder used is: </b>');
+
+
+define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Fehler: Verzeichnis nicht schreibbar. Bitte vergeben Sie die richtigen Userrechte in: %s');
+define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Fehler: Verzeichnis nicht vorhanden: %s');
+
+define('TEXT_TABLE_CELL_LEFT_RIGHT', 'Seitliche Infobox Zeilenabstand');
+define('TEXT_TEMPLATE_LEFT_SIDE', 'Linke Spalte Zeilenabstand');
+define('TEXT_TEMPLATE_RIGHT_SIDE', 'Rechte Seite Zeilenabstand');
+
+define('ERROR1', 'Error! 01  Der Template Name ist nicht identisch mit dem Namen des .sql File oder das SQL File ist nicht vorhanden');
+define('ERROR3', 'Error! 03  Sie k&ouml;nnen das standard Template nicht installieren!');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: customers.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+$user_ip = getenv('REMOTE_ADDR');;
+
+define('HEADING_TITLE', 'Erneut Best&auml;tigungsemail versenden');
+define('TEXT_EMAIL_CONFIRMATION','Sind Sie sicher, dass die Bestätigungsemail versendet werden soll');
+define('ENTRY_EMAIL_ADDRESS', 'Emailadresse: ');
+define('SUCCESS_REGISTRATION_CODE_SENT', 'Neue Best&auml;tigungsemail verschickt');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'Diese Email-Anschrift ist nicht registriert');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Ihr Best&auml;tigungskode lautet');
+define('EMAIL_PASSWORD_REMINDER_BODY', "\n\n".'Erneutes versenden Ihres Bestätigungskode.' . "\n\n" . 'Ihr Bestätigungskode für \'' . STORE_NAME . '\' :' . "\n\n" . '%s' . "\n\n");
+define('EMAIL_PASSWORD_REMINDER_BODY2', 'Folgen Sie dem Link um Ihre Konto zu best&auml;tigen;: %s' . "\n\n");
+define('TEXT_ACCOUNT_ALREADY_EXIST', 'This Account is already active!');
+define('IMAGE_BUTTON_BACK',"Go Back");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Wer ist Online ?');
+
+define('TABLE_HEADING_ONLINE', 'Online');
+define('TABLE_HEADING_CUSTOMER_ID', 'ID');
+define('TABLE_HEADING_FULL_NAME', 'Name');
+define('TABLE_HEADING_IP_ADDRESS', 'IP Adresse');
+define('TABLE_HEADING_ENTRY_TIME', 'Startzeit');
+define('TABLE_HEADING_LAST_CLICK', 'Letzter Klick');
+define('TABLE_HEADING_LAST_PAGE_URL', 'Letzte URL');
+define('TABLE_HEADING_ACTION', 'Aktion');
+define('TABLE_HEADING_SHOPPING_CART', 'Warenkorb');
+define('TABLE_HEADING_WHOIS', 'Whois');
+define('TEXT_SET_REFRESH', 'Set Refresh Rate:');
+define('TEXT_SHOPPING_CART_SUBTOTAL', 'Zwischensumme');
+define('TEXT_NUMBER_OF_CUSTOMERS', 'Zur Zeit sind %s Benutzer online');
+define('TABLE_HEADING_HTTP_REFERER', 'Link von');
+define('TEXT_HTTP_REFERER_URL', 'Link von: HTTP');
+define('TEXT_HTTP_REFERER_FOUND', 'Gefunden');
+define('TEXT_HTTP_REFERER_NOT_FOUND', 'Nicht gefunden');
+define('TEXT_STATUS_ACTIVE_CART', 'Aktiv mit Warenkorb');
+define('TEXT_STATUS_ACTIVE_NOCART', 'Aktiv ohne Warenkorb');
+define('TEXT_STATUS_INACTIVE_CART', 'Inaktiv mit Warenkorb');
+define('TEXT_STATUS_INACTIVE_NOCART', 'Inaktiv ohne Warenkorb');
+define('TEXT_STATUS_ACTIVE_BOT', 'Bot aktiv');
+define('TEXT_STATUS_INACTIVE_BOT', 'Bot inaktiv');
+define('TABLE_HEADING_COUNTRY', 'Cntry');
+define('TABLE_HEADING_USER_SESSION', 'Session?');
+define('TEXT_OSCID', 'osCsid');
+define('TEXT_PROFILE_DISPLAY', 'Profil Anzeige');
+define('TEXT_USER_AGENT', 'Browser');
+define('TEXT_ERROR', 'Fehler!');
+define('TEXT_ADMIN', 'Admin');
+define('TEXT_DUPLICATE_IP', 'Doppelte IPs');
+define('TEXT_BOTS', 'Bots');
+define('TEXT_ME', 'Ich!');
+define('TEXT_ALL', 'Alle');
+define('TEXT_REAL_CUSTOMERS', 'Kunden');
+define('TEXT_YOUR_IP_ADDRESS', 'Ihre IP Adresse');
+define('TEXT_SET_REFRESH_RATE', 'Aktualisierungsrate einstellen');
+define('TEXT_NONE_', '<keine>');
+
+define('TEXT_NAME', 'Name:');
+define('TEXT_CUSTOMER_ID', 'Customer ID:');
+define('TEXT_IP_ADDRESS', 'IP Address:');
+define('TEXT_REFERER', 'Referer:');
+define('TEXT_BOTS', 'Bots');
+define('TEXT_CUSTOMERS', 'Customers');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german/xsell_products.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/xsell_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/xsell_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/* $Id$ 
+osCommerce, Open Source E-Commerce Solutions 
+http://www.oscommerce.com 
+Copyright (c) 2002 osCommerce 
+
+Released under the GNU General Public License 
+xsell.php
+Original Idea From Isaac Mualem im at imwebdesigning.com <mailto:im at imwebdesigning.com> 
+Complete Recoding From Stephen Walker admin at snjcomputers.com
+*/ 
+
+define('CROSS_SELL_SUCCESS', 'Querverweisprodukte wurden erfolgreich aktualisiert #'.$_GET['add_related_product_ID']);
+define('SORT_CROSS_SELL_SUCCESS', 'Sortierreihenfolge wurde aktualisiert f&uuml;r Querverweisprodukte #'.$_GET['add_related_product_ID']);
+define('HEADING_TITLE', 'Querverweis (X-Sell) Verwaltung');
+define('TABLE_HEADING_PRODUCT_ID', 'Produkt Id');
+define('TABLE_HEADING_PRODUCT_MODEL', 'Produkt Modell');
+define('TABLE_HEADING_PRODUCT_NAME', 'Produkt Name');
+define('TABLE_HEADING_CURRENT_SELLS', 'Aktuelle Querverweise');
+define('TABLE_HEADING_UPDATE_SELLS', 'Aktualisieren Querverweis');
+define('TABLE_HEADING_PRODUCT_IMAGE', 'Produkt Grafik');
+define('TABLE_HEADING_PRODUCT_PRICE', 'Produkt Preis');
+define('TABLE_HEADING_CROSS_SELL_THIS', 'Querverweis hier?');
+define('TEXT_EDIT_SELLS', 'Editieren');
+define('TEXT_SORT', 'Priorisieren');
+define('TEXT_SETTING_SELLS', 'Querverweis konfigurieren');
+define('TEXT_PRODUCT_ID', 'Produkt Id');
+define('TEXT_MODEL', 'Modell');
+define('TABLE_HEADING_PRODUCT_SORT', 'Sortierreihenfolge');
+define('TEXT_NO_IMAGE', 'Keine Grafik');
+define('TEXT_CROSS_SELL', 'Querverweis');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/german/zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: zones.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Bundesl&auml;nder');
+
+define('TABLE_HEADING_COUNTRY_NAME', 'Land');
+define('TABLE_HEADING_ZONE_NAME', 'Bundesland');
+define('TABLE_HEADING_ZONE_CODE','K&uuml;rzel');
+define('TABLE_HEADING_ACTION', 'Aktion');
+
+define('TEXT_INFO_EDIT_INTRO', 'Bitte f&uuml;hren Sie alle notwendigen &Auml;nderungen durch');
+define('TEXT_INFO_ZONES_NAME', 'Name des Bundeslandes:');
+define('TEXT_INFO_ZONES_CODE', 'Code des Bundeslandes:');
+define('TEXT_INFO_COUNTRY_NAME', 'Land:');
+define('TEXT_INFO_INSERT_INTRO', 'Bitte geben Sie das neue Bundesland mit allen relevanten Daten ein');
+define('TEXT_INFO_DELETE_INTRO', 'Sind Sie sicher, dass Sie dieses Bundesland l&ouml;schen wollen?');
+define('TEXT_INFO_HEADING_NEW_ZONE', 'Neues Bundesland');
+define('TEXT_INFO_HEADING_EDIT_ZONE', 'Bundesland bearbeiten');
+define('TEXT_INFO_HEADING_DELETE_ZONE', 'Bundesland l&ouml;schen');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/languages/german.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/german.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/german.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1359 @@
+<?php
+/*
+  $Id: german.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//Admin begin
+define('TEXT_ADMIN_HOME','Admin Home');
+define('TEXT_VIEW_CATALOG','Katalog anzeigen');
+define('TEXT_FORUMS','CRE Forums');
+define('TEXT_PURCHASE_SUPPORT','Purchase CRE Support');
+define('TEXT_HOSTING','Certified CRE Hosting');
+define('TEXT_ADMIN_LANG','Admin Sprache:');
+define('TEXT_CHANGE_PASWORD','Passwort &auml;ndern');
+define('TEXT_LOGOUT','Abmelden');
+define('TEXT_CHECK_UPDATES','auf Aktuelle Version pr&uuml;fen');
+define('TEXT_GET_PRO','Pro Version kaufen');
+define('TEXT_GET_B2B','Get B2B Version');
+
+// header text in includes/header.php
+define('HEADER_TITLE_ACCOUNT', 'Mein Konto');
+define('HEADER_TITLE_LOGOFF', 'Beenden');
+define('TEXT_SELECT_LANGUAGE', 'Bitte w&auml;hlen Sie die Sprache f&uuml;r diese Administrations Sitzung ');
+define('BOX_REPORTS_NOT_VALID_USER', 'Kunde nicht validiert');
+
+// Admin Account
+define('BOX_HEADING_MY_ACCOUNT', 'Mein Konto');
+
+//MARKETING BOX
+define('BOX_HEADING_MARKETING', 'Marketing');
+define('BOX_MARKETING_EVENTS_MANAGER', 'Events/Kalender Verwalten');
+define('BOX_MARKETING_SALEMAKER', 'SaleMaker');
+define('BOX_MARKETING_SPECIALS', 'Sonderangebote');
+define('BOX_MARKETING_SPECIALSBYCAT','Sonderangebot in Kategorie');
+define('BOX_MARKETING_BANNER_MANAGER','Banner Verwalten');
+
+// configuration box text in includes/boxes/administrator.php
+define('BOX_HEADING_ADMINISTRATOR', 'Administrator');
+define('BOX_ADMINISTRATOR_MEMBERS', 'Mitglieder Gruppen');
+define('BOX_ADMINISTRATOR_GROUPS', 'Admin Groups');
+define('BOX_ADMINISTRATOR_MEMBER', 'Mitglieder');
+define('BOX_ADMINISTRATOR_BOXES', 'Zugang zu Dateien');
+define('BOX_ADMINISTRATOR_ACCOUNT_UPDATE', 'Konto updaten');
+
+// images
+define('IMAGE_FILE_PERMISSION', 'Dateien Zugangsrechte');
+define('IMAGE_GROUPS', 'Gruppenliste');
+define('IMAGE_INSERT_FILE', 'Datei einf&uuml;gen');
+define('IMAGE_MEMBERS', 'Mitgliederliste');
+define('IMAGE_NEW_GROUP', 'Neue Gruppe');
+define('IMAGE_NEW_MEMBER', 'Neues Mitglied');
+define('IMAGE_NEXT', 'Weiter');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_DISPLAY_NUMBER_OF_FILENAMES', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Dateinamen)');
+define('TEXT_DISPLAY_NUMBER_OF_MEMBERS', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Mitgliedern)');
+//Admin end
+
+// look in your $PATH_LOCALE/locale directory for available locales..
+// on RedHat6.0 I used 'de_DE'
+// on FreeBSD 4.0 I use 'de_DE.ISO_8859-1'
+// this may not work under win32 environments..
+setlocale(LC_TIME, 'de_DE.ISO_8859-1');
+define('DATE_FORMAT_SHORT', '%d.%m.%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A, %d. %B %Y'); // this is used for strftime()
+define('DATE_FORMAT', 'd.m.Y');  // this is used for strftime()
+define('PHP_DATE_TIME_FORMAT', 'd.m.Y H:i:s'); // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+
+////
+// Return date in raw format
+// $date should be in format mm/dd/yyyy
+// raw date is in format YYYYMMDD, or DDMMYYYY
+function tep_date_raw($date, $reverse = false) {
+  if ($reverse) {
+    return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
+  }
+}
+
+// Global entries for the <html> tag
+define('HTML_PARAMS','dir="ltr" lang="de"');
+
+// charset for web pages and emails
+define('CHARSET', 'iso-8859-1');
+
+// page title
+define('TITLE', STORE_NAME);
+
+// CCGV
+define('BOX_HEADING_GV_ADMIN', 'Gutschein/Rabatt');
+define('BOX_GV_ADMIN_QUEUE', 'Ausgestellte Gutscheine');
+define('BOX_GV_ADMIN_MAIL', 'EMail Gutscheine');
+define('BOX_GV_ADMIN_SENT', 'Versandte Gutscheine');
+define('BOX_COUPON_ADMIN','Rabatt Admin');
+define('BOX_GV_REPORT','Rabatt Bericht');
+define('IMAGE_RELEASE', 'Zufalls Gutschein');
+
+define('_JANUARY', 'Januar');
+define('_FEBRUARY', 'Februar');
+define('_MARCH', 'M&auml;rz');
+define('_APRIL', 'April');
+define('_MAY', 'Mai');
+define('_JUNE', 'Juni');
+define('_JULY', 'Juli');
+define('_AUGUST', 'August');
+define('_SEPTEMBER', 'September');
+define('_OCTOBER', 'Oktober');
+define('_NOVEMBER', 'November');
+define('_DECEMBER', 'Dezember');
+
+define('TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> Gutscheinen)');
+define('TEXT_DISPLAY_NUMBER_OF_COUPONS', 'Anzeigen <b>%d</b> bis <b>%d</b> (von <b>%d</b> Rabattgutscheinen)');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Produktliste');
+define('TEXT_VALID_PRODUCTS_ID', 'Produkt ID');
+define('TEXT_VALID_PRODUCTS_NAME', 'Produkt Name');
+define('TEXT_VALID_PRODUCTS_MODEL', 'Produkt Modell');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Kategorie Liste');
+define('TEXT_VALID_CATEGORIES_ID', 'Kategorie ID');
+define('TEXT_VALID_CATEGORIES_NAME', 'Kategorie Name');
+
+// ############### end added #########################
+// header text in includes/header.php
+define('HEADER_TITLE_TOP', 'Administration');
+define('HEADER_TITLE_SUPPORT_SITE', 'Supportseite');
+define('HEADER_TITLE_ONLINE_CATALOG', 'Online Katalog');
+define('HEADER_TITLE_ADMINISTRATION', 'Administration');
+define('HEADER_TITLE_CHAINREACTION', 'Chainreactionweb');
+define('HEADER_TITLE_CRELOADED', 'CRE Loaded Project');
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+define('BOX_CATALOG_DEFINE_MAINPAGE', 'Startseite definieren');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// text for gender
+define('MALE', 'Herr');
+define('FEMALE', 'Frau');
+
+// text for date of birth example
+define('DOB_FORMAT_STRING', 'tt.mm.jjjj');
+
+// configuration box text in includes/boxes/configuration.php
+define('BOX_HEADING_CONFIGURATION', 'Konfiguration');
+define('BOX_CONFIGURATION_MYSTORE', 'Mein Shop');
+define('BOX_CONFIGURATION_LOGGING', 'Logging');
+define('BOX_CONFIGURATION_CACHE', 'Cache');
+
+// added for super-friendly admin menu:
+define('BOX_CONFIGURATION_MIN_VALUES', 'Min Werte');
+define('BOX_CONFIGURATION_MAX_VALUES', 'Max Werte');
+define('BOX_CONFIGURATION_IMAGES', 'Bilder Konfiguration');
+define('BOX_CONFIGURATION_CUSTOMER_DETAILS', 'Kunden Details');
+define('BOX_CONFIGURATION_SHIPPING', 'Default Versand Einstellungen');
+define('BOX_CONFIGURATION_PRODUCT_LISTING', 'Produkt Auflistung');
+define('BOX_CONFIGURATION_EMAIL', 'Email');
+define('BOX_CONFIGURATION_DOWNLOAD', 'Download Verwaltung');
+define('BOX_CONFIGURATION_GZIP', 'GZip');
+define('BOX_CONFIGURATION_SESSIONS', 'Sessions');
+define('BOX_CONFIGURATION_STOCK', 'Lagerverwaltung');
+define('BOX_CONFIGURATION_WYSIWYG', 'WYSIWYG Editor 1.7');
+define('BOX_CONFIGURATION_AFFILIATE', 'Partnerprogram');
+define('BOX_CONFIGURATION_MAINT', 'Wartungsmodus');
+define('BOX_CONFIGURATION_ACCOUNTS', 'Einkaufen ohne Kundenkonto');
+define('BOX_CONFIGURATION_CHECKOUT', 'Einstellungen Bestellvorgang');
+define('BOX_CONFIGURATION_LINKS', 'Links Verwaltung');
+
+// modules box text in includes/boxes/modules.php
+define('BOX_HEADING_MODULES', 'Module');
+define('BOX_MODULES_PAYMENT', 'Zahlungsweise');
+define('BOX_MODULES_SHIPPING', 'Versandart');
+define('BOX_MODULES_ORDER_TOTAL', 'Zusammenfassung');
+
+// categories box text in includes/boxes/catalog.php
+define('BOX_HEADING_CATALOG', 'Katalog');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS', 'Kategorien / Artikel');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES', 'Produktmerkmale');
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_CATEGORY_OPTIONS', 'Products Categories Options');
+define('BOX_CATALOG_MANUFACTURERS', 'Hersteller');
+define('BOX_CATALOG_REVIEWS', 'Produktbewertungen');
+define('BOX_CATALOG_SPECIALS', 'Sonderangebote');
+define('BOX_CATALOG_PRODUCTS_EXPECTED', 'erwartete Artikel');
+define('BOX_CATALOG_EASYPOPULATE', 'EasyPopulate');
+define('BOX_CATALOG_EASYPOPULATE_BASIC', 'Easy Populate Basic');
+
+define('BOX_CATALOG_SALEMAKER', 'SaleMaker');
+
+define('BOX_CATALOG_SHOP_BY_PRICE', 'Nach Preis einkaufen');
+// customers box text in includes/boxes/customers.php
+define('BOX_HEADING_CUSTOMERS', 'Kunden');
+define('BOX_CUSTOMERS_CUSTOMERS', 'Kunden');
+//added for Super-Friendly Admin Menu:
+define('BOX_CUSTOMERS_ORDERS', 'Bestellungen');
+define('BOX_CUSTOMERS_EDIT_ORDERS', 'Bestellungen Editieren');
+//begin PayPal_Shopping_Cart_IPN
+//end PayPal_Shopping_Cart_IPN
+
+define('BOX_CREATE_ACCOUNT', 'Neues Konto erstellen');
+define('BOX_CREATE_ORDER', 'Neue Bestellung erstellen');
+define('BOX_CREATE_ORDERS_ADMIN', 'Bestellung erstellen Admin');
+// taxes box text in includes/boxes/taxes.php
+define('BOX_HEADING_LOCATION_AND_TAXES', 'L&auml;nder / Steuern');
+define('BOX_TAXES_COUNTRIES', 'L&auml;nder');
+define('BOX_TAXES_ZONES', 'Bundesl&auml;nder');
+define('BOX_TAXES_GEO_ZONES', 'Steuerzonen');
+define('BOX_TAXES_TAX_CLASSES', 'Steuerklassen');
+define('BOX_TAXES_TAX_RATES', 'Steuers&auml;tze');
+
+// reports box text in includes/boxes/reports.php
+define('BOX_HEADING_REPORTS', 'Berichte');
+define('BOX_REPORTS_PRODUCTS_VIEWED', 'besuchte Artikel');
+define('BOX_REPORTS_PRODUCTS_PURCHASED', 'gekaufte Artikel');
+define('BOX_REPORTS_ORDERS_TOTAL', 'Kunden-Bestellstatistik');
+define('BOX_REPORTS_CUSTOMER_WISHLIST', 'Kunden Wunschliste');
+define('BOX_CUSTOMERS_MENU','Customer Menu');
+
+// tools text in includes/boxes/tools.php
+define('BOX_HEADING_TOOLS', 'Hilfsprogramme');
+define('BOX_TOOLS_BACKUP', 'Datenbanksicherung');
+define('BOX_TOOLS_BANNER_MANAGER', 'Banner Manager');
+define('BOX_TOOLS_CACHE', 'Cache Steuerung');
+define('BOX_TOOLS_DEFINE_LANGUAGE', 'Sprachen definieren');
+define('BOX_TOOLS_FILE_MANAGER', 'Datei-Manager');
+define('BOX_TOOLS_MAIL', 'Email versenden');
+define('BOX_TOOLS_NEWSLETTER_MANAGER', 'Rundschreiben Manager');
+define('BOX_TOOLS_SERVER_INFO', 'Server Info');
+define('BOX_TOOLS_WHOS_ONLINE', 'Wer ist Online');
+
+// BMC CC Mod Start
+define('BOX_TOOLS_BLACKLIST', 'Credit Card Blacklist');
+// BMC CC Mod End
+// localizaion box text in includes/boxes/localization.php
+define('BOX_HEADING_LOCALIZATION', 'Sprachen/W&auml;hrungen');
+define('BOX_LOCALIZATION_CURRENCIES', 'W&auml;hrungen');
+define('BOX_LOCALIZATION_LANGUAGES', 'Sprachen');
+define('BOX_LOCALIZATION_ORDERS_STATUS', 'Bestellstatus');
+
+define('BOX_HEADING_HEADER_TAGS_CONTROLLER', 'Header Tags');
+define('BOX_HEADER_TAGS_ADD_A_PAGE', 'Page Control');
+define('BOX_HEADER_TAGS_ENGLISH', 'Text Control');
+define('BOX_HEADER_TAGS_FILL_TAGS', 'Fill Tags');
+
+// infobox box text in includes/boxes/info_boxes.php
+define('BOX_HEADING_DESIGN_CONTROLS', 'Design Verwaltung');
+define('BOX_HEADING_BOXES', 'Administration Of boxes');
+define('BOX_HEADING_DESIGN_TEMPLATE', 'Template');
+define('BOX_HEADING_TEMPLATE_CONFIGURATION', 'Template Konfiguration');
+define('BOX_HEADING_TEMPLATE_MANAGEMENT', 'Template Manager');
+define('BOX_HEADING_TEMPLATE_MANAGEMENT1', 'Neues Template verwalten');
+define('BOX_HEADING_DESIGN_INFOBOX', 'Infobox');
+define('BOX_HEADING_BOXES', 'Infobox Verwaltung');
+define('BOX_HEADING_BOXES_ADMIN', 'Infobox Konfiguration');
+define('BOX_HEADING_DESIGN_BRANDING', 'Branding');
+define('BOX_HEADING_TEMPLATE_HEADER_TAGS','Header Tags');
+
+
+define('BOX_HEADING_DESIGN_LAYOUT', 'Layout');
+define('BOX_HEADING_DESIGN_PRODUCT_LISTING', 'Produkt anzeige');
+define('BOX_HEADING_DESIGN_HOME_PAGE', 'Home Seite');
+define('BOX_HEADING_DESIGN_INDEX_PAGE', 'Index Seite');
+define('BOX_HEADING_DESIGN_PRODUCT_PAGE', 'Produkt Seite');
+
+define('BOX_TEMPLATE_NAVMENU','Navigation Verwaltung');
+
+// VJ Links Manager v1.00 begin
+// links manager box text in includes/boxes/links.php
+define('BOX_HEADING_LINKS', 'Links Verwaltung');
+define('BOX_LINKS_LINKS', 'Links');
+define('BOX_LINKS_LINK_CATEGORIES', 'Link Kategorien');
+define('BOX_LINKS_LINKS_CONTACT', 'Links Kontakt');
+// VJ Links Manager v1.00 end
+
+// javascript messages
+define('JS_ERROR', 'Während der Eingabe sind Fehler aufgetreten!\nBitte korrigieren Sie folgendes:\n\n');
+
+define('JS_OPTIONS_VALUE_PRICE', '* Sie müssen diesem Wert einen Preis zuordnen\n');
+define('JS_OPTIONS_VALUE_PRICE_PREFIX', '* Sie müssen ein Vorzeichen für den Preis angeben (+/-)\n');
+
+define('JS_PRODUCTS_NAME', '* Der neue Artikel muss einen Namen haben\n');
+define('JS_PRODUCTS_DESCRIPTION', '* Der neue Artikel muss eine Beschreibung haben\n');
+define('JS_PRODUCTS_PRICE', '* Der neue Artikel muss einen Preis haben\n');
+define('JS_PRODUCTS_WEIGHT', '* Der neue Artikel muss eine Gewichtsangabe haben\n');
+define('JS_PRODUCTS_QUANTITY', '* Sie müssen dem neuen Artikel eine verfügbare Anzahl zuordnen\n');
+define('JS_PRODUCTS_MODEL', '* Sie müssen dem neuen Artikel eine Artikel-Nr. zuordnen\n');
+define('JS_PRODUCTS_IMAGE', '* Sie müssen dem Artikel ein Bild zuordnen\n');
+
+define('JS_SPECIALS_PRODUCTS_PRICE', '* Es muss ein neuer Preis für diesen Artikel festgelegt werden\n');
+
+define('JS_GENDER', '* Die \'Anrede\' muss ausgewählt werden.\n');
+define('JS_FIRST_NAME', '* Der \'Vorname\' muss mindestens aus ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_LAST_NAME', '* Der \'Nachname\' muss mindestens aus ' . ENTRY_LAST_NAME_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_DOB', '* Das \'Geburtsdatum\' muss folgendes Format haben: xx.xx.xxxx (Tag/Jahr/Monat).\n');
+define('JS_EMAIL_ADDRESS', '* Die \'Email-Adresse\' muss mindestens aus ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_ADDRESS', '* Die \'Strasse\' muss mindestens aus ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_POST_CODE', '* Die \'Postleitzahl\' muss mindestens aus ' . ENTRY_POSTCODE_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_CITY', '* Die \'Stadt\' muss mindestens aus ' . ENTRY_CITY_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_STATE', '* Das \'Bundesland\' muss ausgewählt werden.\n');
+define('JS_STATE_SELECT', '-- Wählen Sie oberhalb --');
+define('JS_ZONE', '* Das \'Bundesland\' muss aus der Liste für dieses Land ausgewählt werden.');
+define('JS_COUNTRY', '* Das \'Land\' muss ausgewählt werden.\n');
+define('JS_TELEPHONE', '* Die \'Telefonnummer\' muss aus mindestens ' . ENTRY_TELEPHONE_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_PASSWORD', '* Das \'Passwort\' sowie die \'Passwortbestätigung\' müssen übereinstimmen und aus mindestens ' . ENTRY_PASSWORD_MIN_LENGTH . ' Zeichen bestehen.\n');
+
+define('JS_ORDER_DOES_NOT_EXIST', 'Auftragsnummer %s existiert nicht!');
+/* User Friendly Admin Menu */
+define('CATALOG_CATEGORIES', 'Kategorien');
+define('CATALOG_ATTRIBUTES', 'Produkt Attribute');
+define('CATALOG_REVIEWS', 'Produkt Berichte');
+define('CATALOG_SPECIALS', 'Sonderangebote');
+define('CATALOG_EXPECTED', 'Produkt erwartet');
+define('REPORTS_PRODUCTS_VIEWED', 'Betrachtete Produkte');
+define('REPORTS_PRODUCTS_PURCHASED', 'gekaufte Produkte');
+define('TOOLS_FILE_MANAGER', 'Datei-Explorer');
+define('TOOLS_CACHE', 'Cache Verwaltung');
+define('TOOLS_DEFINE_LANGUAGES', 'Definiere Sprachen');
+define('TOOLS_EMAIL', 'Email Kunden');
+define('TOOLS_NEWSLETTER', 'Newsletters');
+define('TOOLS_SERVER_INFO', 'Server Info');
+define('TOOLS_WHOS_ONLINE', 'Wer ist Online');
+define('BOX_HEADING_GV', 'Gutschein/Rabatt');
+define('GV_COUPON_ADMIN', 'Discount Gutscheine');
+define('GV_EMAIL', 'Gutschein versenden');
+define('GV_QUEUE', 'Gift Voucher Redeem');
+define('GV_SENT', 'Gift Voucher\'s Sent');
+define('BOX_GV_SENT', 'Gift Voucher\'s Sent');
+/* User Friedly Admin Menu */
+
+define('CATEGORY_PERSONAL', 'Pers&ouml;nliche Daten');
+define('CATEGORY_ADDRESS', 'Adresse');
+define('CATEGORY_CONTACT', 'Kontakt');
+define('CATEGORY_COMPANY', 'Firma');
+define('CATEGORY_OPTIONS', 'Optionen');
+define('CATEGORY_PASSWORD', 'Ihr Passwort');
+
+define('ENTRY_COMPANY', 'Firmen Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Gender:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<span class="errorText">notwendige Eingabe</span>');
+define('ENTRY_GENDER_TEXT', '*');
+define('ENTRY_FIRST_NAME', 'Vorname:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_FIRST_NAME_TEXT', '*');
+define('ENTRY_LAST_NAME', 'Nachname:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_LAST_NAME_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_LAST_NAME_TEXT', '*');
+define('ENTRY_DATE_OF_BIRTH', 'Geburtsdatum:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class="errorText">(z.B. 21.05.1970)</span>');
+define('ENTRY_EMAIL_ADDRESS', 'Email Adresse:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<span class="errorText">ung&uuml;ltige Email-Adresse!</span>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<span class="errorText">Diese Email-Adresse existiert schon!</span>');
+define('ENTRY_COMPANY', 'Firmenname:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_STREET_ADDRESS', 'Strasse:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_SUBURB', 'weitere Anschrift:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_POST_CODE', 'Postleitzahl:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_POSTCODE_MIN_LENGTH . ' Zahlen</span>');
+define('ENTRY_CITY', 'Stadt:');
+define('ENTRY_CITY_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_CITY_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_STATE', 'Bundesland:');
+define('ENTRY_STATE_ERROR', '&nbsp;<span class="errorText">notwendige Eingabe</font></small>');
+define('ENTRY_COUNTRY', 'Land:');
+define('ENTRY_COUNTRY_ERROR', 'You must select a country from the Countries pull down menu.');
+define('ENTRY_COUNTRY_TEXT', '*');
+define('ENTRY_TELEPHONE_NUMBER', 'Telefonnummer:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_TELEPHONE_MIN_LENGTH . ' Zahlen</span>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');
+define('ENTRY_FAX_NUMBER', 'Telefaxnummer:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Rundschreiben:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'abonniert');
+define('ENTRY_NEWSLETTER_NO', 'nicht abonniert');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_ERROR_NOT_MATCHING', 'The Password Confirmation must match your Password.');
+define('ENTRY_PASSWORD_TEXT', '*');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT', 'Current Password:');
+define('ENTRY_PASSWORD_CURRENT_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW', 'New Password:');
+define('ENTRY_PASSWORD_NEW_TEXT', '*');
+define('ENTRY_PASSWORD_NEW_ERROR', 'Your new Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING', 'The Password Confirmation must match your new Password.');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+define('FORM_REQUIRED_INFORMATION', '* Ben&ouml;tigte Information');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('CATEGORY_ORDER_DETAILS', 'Kunden Details');
+define('ENTRY_CURRENCY', 'Kunden W&auml;hrung');
+
+// images
+define('IMAGE_ANI_SEND_EMAIL', 'Email versenden');
+define('IMAGE_BACK', 'Zur&uuml;ck');
+define('IMAGE_BACKUP', 'Datensicherung');
+define('IMAGE_CANCEL', 'Abbruch');
+define('IMAGE_BUTTON_CONTINUE', 'Weiter');
+define('IMAGE_CONFIRM', 'Best&auml;tigen');
+define('IMAGE_COPY', 'Kopieren');
+define('IMAGE_COPY_TO', 'Kopieren nach');
+define('IMAGE_DETAILS', 'Details');
+define('IMAGE_DELETE', 'L&ouml;schen');
+define('IMAGE_EDIT', 'Bearbeiten');
+define('IMAGE_EDIT_STATUS', 'Bestellstatus &auml;ndern');
+define('IMAGE_EDIT_ORDER', 'Bestellung bearbeiten');
+define('IMAGE_EDIT_LANG_DEFINE', 'Edit Language Defines');
+define('IMAGE_EMAIL', 'Email versenden');
+define('IMAGE_FILE_MANAGER', 'Datei-Manager');
+define('IMAGE_ICON_STATUS_GREEN', 'aktiv');
+define('IMAGE_ICON_STATUS_GREEN_LIGHT', 'aktivieren');
+define('IMAGE_ICON_STATUS_RED', 'inaktiv');
+define('IMAGE_ICON_STATUS_RED_LIGHT', 'deaktivieren');
+define('IMAGE_ICON_INFO', 'Information');
+define('IMAGE_INSERT', 'Einf&uuml;gen');
+define('IMAGE_LOCK', 'Sperren');
+define('IMAGE_MODULE_INSTALL', 'Modul Installieren');
+define('IMAGE_MODULE_REMOVE', 'Modul Entfernen');
+define('IMAGE_MOVE', 'Verschieben');
+define('IMAGE_NEW_BANNER', 'Neuen Banner aufnehmen');
+define('IMAGE_NEW_CATEGORY', 'Neue Kategorie erstellen');
+define('IMAGE_NEW_COUNTRY', 'Neues Land aufnehmen');
+define('IMAGE_NEW_CURRENCY', 'Neue W&auml;hrung einf&uuml;gen');
+define('IMAGE_NEW_FILE', 'Neue Datei');
+define('IMAGE_NEW_FOLDER', 'Neues Verzeichnis');
+define('IMAGE_NEW_LANGUAGE', 'Neue Sprache anlegen');
+define('IMAGE_NEW_NEWSLETTER', 'Neues Rundschreiben');
+define('IMAGE_NEW_PRODUCT', 'Neuen Artikel aufnehmen');
+define('IMAGE_NEW_SALE', 'New Sale');
+define('IMAGE_NEW_TAX_CLASS', 'Neue Steuerklasse erstellen');
+define('IMAGE_NEW_TAX_RATE', 'Neuen Steuersatz anlegen');
+define('IMAGE_NEW_TAX_ZONE', 'Neue Steuerzone erstellen');
+define('IMAGE_NEW_ZONE', 'Neues Bundesland einf&uuml;gen');
+define('IMAGE_ORDERS', 'Bestellungen');
+define('IMAGE_ORDERS_INVOICE', 'Rechnung');
+define('IMAGE_ORDERS_PACKINGSLIP', 'Lieferschein');
+define('IMAGE_PREVIEW', 'Vorschau');
+define('IMAGE_RESET', 'Zur&uuml;cksetzen');
+define('IMAGE_RESTORE', 'Zur&uuml;cksichern');
+define('IMAGE_SAVE', 'Speichern');
+define('IMAGE_SEARCH', 'Suchen');
+define('IMAGE_SELECT', 'Ausw&auml;hlen');
+define('IMAGE_SEND', 'Versenden');
+define('IMAGE_SEND_EMAIL', 'Email versenden');
+define('IMAGE_UNLOCK', 'Entsperren');
+define('IMAGE_UPDATE', 'Aktualisieren');
+define('IMAGE_UPDATE_CURRENCIES', 'Wechselkurse aktualisieren');
+define('IMAGE_UPLOAD', 'Hochladen');
+
+define('ICON_CROSS', 'Falsch');
+define('ICON_CURRENT_FOLDER', 'aktueller Ordner');
+define('ICON_DELETE', 'L&ouml;schen');
+//added for quick product edit DMG
+define('ICON_EDIT','Editieren');
+define('ICON_ERROR', 'Fehler');
+define('ICON_FILE', 'Datei');
+define('ICON_FILE_DOWNLOAD', 'Herunterladen');
+define('ICON_FOLDER', 'Ordner');
+define('ICON_LOCKED', 'Gesperrt');
+define('ICON_PREVIOUS_LEVEL', 'Vorherige Ebene');
+define('ICON_PREVIEW', 'Vorschau');
+define('ICON_STATISTICS', 'Statistik');
+define('ICON_SUCCESS', 'Erfolg');
+define('ICON_TICK', 'Wahr');
+define('ICON_UNLOCKED', 'Entsperrt');
+define('ICON_WARNING', 'Warnung');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_RESULT_PAGE', 'Seite %s von %d');
+define('TEXT_DISPLAY_NUMBER_OF_BANNERS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bannern)');
+define('TEXT_DISPLAY_NUMBER_OF_COUNTRIES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> L&auml;ndern)');
+define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Kunden)');
+define('TEXT_DISPLAY_NUMBER_OF_CURRENCIES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> W&auml;hrungen)');
+define('TEXT_DISPLAY_NUMBER_OF_LANGUAGES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Sprachen)');
+define('TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Herstellern)');
+define('TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Rundschreiben)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bestellungen)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS_STATUS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bestellstatus)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Artikeln)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_EXPECTED', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> erwarteten Artikeln)');
+define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bewertungen)');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> sales)');
+define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Sonderangeboten)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Steuerklassen)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_ZONES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Steuerzonen)');
+define('TEXT_DISPLAY_NUMBER_OF_TAX_RATES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Steuers&auml;tzen)');
+define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bundesl&auml;ndern)');
+
+define('PREVNEXT_BUTTON_PREV', '&lt;&lt;');
+define('PREVNEXT_BUTTON_NEXT', '&gt;&gt;');
+
+define('TEXT_DEFAULT', 'Standard');
+define('TEXT_SET_DEFAULT', 'als Standard definieren');
+define('TEXT_FIELD_REQUIRED', '&nbsp;<span class="fieldRequired">* erforderlich</span>');
+
+define('ERROR_NO_DEFAULT_CURRENCY_DEFINED', 'Fehler: Es wurde keine Standardw&auml;hrung definiert. Bitte definieren Sie unter Adminstration -> Sprachen/W&auml;hrungen -> W&auml;hrungen eine Standardw&auml;hrung.');
+
+define('TEXT_NONE', '--keine--');
+define('TEXT_TOP', 'Top');
+
+define('ERROR_DESTINATION_DOES_NOT_EXIST', 'Fehler: Ziel existiert nicht.');
+define('ERROR_DESTINATION_NOT_WRITEABLE', 'Fehler: Ziel hat keine Schreibrechte.');
+define('ERROR_FILE_NOT_SAVED', 'Fehler: Dateiupload nicht gespeichert.');
+define('ERROR_FILETYPE_NOT_ALLOWED', 'Fehler: Dateiupload Typ nicht erlaubt.');
+define('SUCCESS_FILE_SAVED_SUCCESSFULLY', 'Erfolg: Dateiupload erfolgreich gespeichert.');
+define('WARNING_NO_FILE_UPLOADED', 'Warnung: Keine Datei hochgeladen.');
+define('WARNING_FILE_UPLOADS_DISABLED', 'Warnung: Dateiuploads sind in der php.ini Konfigurationsdatei abgeschaltet.');
+define('TEXT_DISPLAY_NUMBER_OF_PAYPALIPN_TRANSACTIONS', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Transaktionen)'); // PAYPALIPN
+define('ERROR_TEP_MAIL', '<font face="Verdana, Arial" size="2" color="#ff0000"><b><small>TEP ERROR:</small> Cannot send the email through the specified SMTP server. Please check your php.ini setting and correct the SMTP server if necessary.</b></font>');
+define('WARNING_INSTALL_DIRECTORY_EXISTS', 'Warning: Installation directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install. Please remove this directory for security reasons.');
+define('WARNING_UPGRADES_DIRECTORY_EXISTS', 'Warning: Upgrades directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/upgrades. Please remove this directory for security reasons.');
+define('WARNING_CONFIG_FILE_WRITEABLE', 'Warning: I am able to write to the configuration file: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
+define('WARNING_CONFIG_FILE_WRITEABLE_CATALOG', 'Warning: I am able to write to the configuration file: ' . DIR_FS_CATALOG . 'includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
+define('WARNING_SESSION_DIRECTORY_NON_EXISTENT', 'Warning: The sessions directory does not exist: ' . tep_session_save_path() . '. Sessions will not work until this directory is created.');
+define('WARNING_SESSION_DIRECTORY_NOT_WRITEABLE', 'Warning: I am not able to write to the sessions directory: ' . tep_session_save_path() . '. Sessions will not work until the right user permissions are set.');
+define('WARNING_SESSION_AUTO_START', 'Warning: session.auto_start is enabled - please disable this php feature in php.ini and restart the web server.');
+define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Warning: The downloadable products directory does not exist: ' . DIR_FS_CATALOG . 'download/' . '. Downloadable products will not work until this directory is valid.');
+define('WARNING_ENCRYPT_FILE_MISSING', 'Warning: The Encryption key file is missing.');
+define('WARNING_TMP_DIRECTORY_NON_EXISTENT', 'Warning: The /tmp is not writable: ' . DIR_FS_CATALOG . 'tmp/' . '. The page cacheing will not work until this directory is writable.');
+
+
+define('BOX_HEADING_PAYPALIPN_ADMIN', 'Paypal IPN'); // PAYPALIPN
+define('BOX_PAYPALIPN_ADMIN_TRANSACTIONS', 'Transactions'); // PAYPALIPN
+define('BOX_PAYPALIPN_ADMIN_TESTS', 'Send Test IPN'); // PAYPALIPN
+define('BOX_CATALOG_XSELL_PRODUCTS', 'Cross Sell Products'); // X-Sell
+
+define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 01 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_INVALID_MONTH', 'Error: 02 The expiry date Motnth entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_YEAR', 'Error: 03 The expiry date year entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Error: 04 The expiry date entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Error: 05 The credit card number entered is invalid. Please check the number for misstyped numbers and try again.');
+define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'Error: 06 The first four digits of the number entered are: %s If that number is correct, we do not accept that type of credit card.If it is wrong, please try again.');
+define('TEXT_CCVAL_ERROR_NOT_ACCEPTED', 'Error: 07 The credit card number you have entered appears to be a %s card. Unfortunately at this time we do not accept %s as payment.');
+define('TEXT_CCVAL_ERROR_BLACKLIST', 'Error: 08 We cannot accept your card as it is blacklisted, if you feel you have recieved this message in error please contact your card issuer.');
+define('TEXT_CCVAL_ERROR_SHORT', 'Error: 09 You have not entered the correct amount of digits. Please ensure you have entered all of the long number displayed on the front of your card');
+define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'Error: 10 The CCV/CVV/CID number entered is the incorrect length. Please try again.');
+REQUIRE(DIR_WS_LANGUAGES . 'add_ccgvdc_german.php');
+
+define('IMAGE_BUTTON_PRINT_ORDER', 'Druckf&auml;hige Bestellung');
+
+// BOF: Lango Added for print order MOD
+define('IMAGE_BUTTON_PRINT', 'Drucken');
+// EOF: Lango Added for print order MOD
+
+// BOF: Lango Added for Featured product MOD
+  define('BOX_CATALOG_FEATURED', 'Erwartete Produkte');
+// EOF: Lango Added for Featured product MOD
+
+// BOF: Lango Added for Sales Stats MOD
+define('BOX_REPORTS_MONTHLY_SALES', 'Monatlicher Verkauf/Steuer');
+// EOF: Lango Added for Sales Stats MOD
+
+// BOF: Lango Added for template MOD
+// WebMakers.com Added: Attribute Sorter, Copier and Catalog additions
+require(DIR_WS_LANGUAGES . $language . '/' . 'attributes_sorter.php');
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  define('BOX_HEADING_INFORMATION', 'Info System');
+  define('BOX_INFORMATION_MANAGER', 'Info Verwaltung');
+//DWD Modify End
+
+include('includes/languages/order_edit_german.php');
+
+ define('BOX_TITLE_CRELOADED', 'CRE Loaded Project');
+ define('LINK_CRE_FORUMS','CRE Loaded Forums');
+ define('LINK_CRW_SUPPORT','Technical Support');
+// General Release Edition
+ define('LINK_SF_CRELOADED','Source Forge Home');
+ define('LINK_SF_BUGTRACKER','Bug Tracker');
+ define('LINK_SF_SUPPORT','Support Request');
+ define('LINK_SF_TASK','Task Tracker');
+ define('LINK_SF_CVS','Browse CVS');
+ define('LINK_CRE_FILES','CRE Downloads');
+ define('LINK_SF_FEATURE','Feature Request');
+//included for Backup mySQL (courtesy Zen-Cart Team) DMG
+ define('BOX_TOOLS_MYSQL_BACKUP','Backup mySQL');
+//included for Orderlist 3.1 report DMG
+ define('BOX_REPORTS_ORDERLIST', 'Generate orderlist');
+
+// Included for Events Calendar 2.0 DMG
+define('BOX_TOOLS_EVENTS_MANAGER', 'Events Manager');
+define('IMAGE_NEW_EVENT', 'Neues Event');
+
+// VJ member approval added
+define('BOX_CUSTOMERS_APPROVAL', 'Waiting Approval');
+
+// DMG Sales Report 2
+  define('BOX_REPORTS_SALES_REPORT2', 'SalesReport2');
+  
+// DMG Zipcode Matching
+  define('BOX_REPORTS_ZIPCODE_MATCH','Customer Zip/State Mismatch');
+  
+//DMG FAQ System 2.1
+  define('BOX_HEADING_FAQ', 'FAQ System');
+  define('BOX_FAQ_MANAGER', 'FAQ Manager');
+  define('BOX_FAQ_CATEGORIES', 'FAQ Categories');
+  define('BOX_FAQ_VIEW', 'FAQ View');
+  define('BOX_FAQ_VIEW_ALL', 'FAQ View All');
+  
+  
+// DMG Article Manager
+define('BOX_HEADING_ARTICLES', 'Artikel Verwalten');
+define('BOX_TOPICS_ARTICLES', 'Topics/Articles');
+define('BOX_ARTICLES_CONFIG', 'Configuration');
+define('BOX_ARTICLES_AUTHORS', 'Authors');
+define('BOX_ARTICLES_REVIEWS', 'Reviews');
+define('BOX_ARTICLES_XSELL', 'Cross-Sell Articles');
+define('IMAGE_NEW_TOPIC', 'New Topic');
+define('IMAGE_NEW_ARTICLE', 'New Article');
+define('TEXT_DISPLAY_NUMBER_OF_AUTHORS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> authors)');
+define('IMAGE_NEW_AUTHOR', 'Neuer Autor');
+define('TEXT_WARNING_NO_AUTHORS', 'WARNING: Leere Autoren Table!&nbsp;&nbsp;You MÜSSEN mindestens einen Autor addieren, bevor Sie in der LageSIND, alle mögliche Artikel zu addieren');
+
+// Article Statistics Report DMG
+  define('BOX_REPORTS_ARTICLES_VIEWED', 'Articles Viewed');
+  define('TEXT_DISPLAY_NUMBER_OF_ARTICLES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> products)');
+  
+// DMG :  Mulitple Products Manager
+
+define('BOX_CATALOG_CATEGORIES_PRODUCTS_MULTI', 'Multiple Products Manager');
+
+
+// DMG : Specials by Category
+
+
+
+// START: Product Extra Fields DMG
+  define('BOX_CATALOG_PRODUCTS_EXTRA_FIELDS', 'Product Extra Fields');
+// END: Product Extra Fields DMG
+
+// Customers Order Reports DMG
+
+define('BOX_REPORTS_CUSTOMERS_ORDERS', 'Kunden Statistik');
+
+// Daily Sales Products reports  DMG
+define('BOX_REPORTS_DAILY_PRODUCTS_ORDERS', 'T&auml;glicher Produkt Bericht');
+
+// Contact US Email Subject DMG
+define('BOX_TOOLS_EMAIL_SUBJECTS', 'Email Subjects');
+define('TEXT_DISPLAY_NUMBER_OF_EMAIL_SUBJECTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> email subjects)');
+
+define('BOX_REPORTS_EXPLAIN','osC Explain Queries');
+ 
+//define('BOX_HEADING_CRYPT', 'Encryption and Decryption'); 
+define('BOX_HEADING_CRYPT', 'Encrypt & Decrypt');
+define('BOX_CRYPT_CONFIGURATION', 'Configuration'); 
+define('BOX_CRYPT_TEST', 'Test'); 
+define('BOX_CRYPT_CC_DATA', 'CC Data'); 
+define('BOX_CRYPT_CONVERT', 'Convert CC Data');
+define('BOX_CRYPT_PURGE', 'Purge CC Data');
+define('BOX_CRYPT_UPDATE', 'Update CC Data');
+define('BOX_CRYPT_KEYS', 'Manage Keys');
+define('BOX_CRYPT_HELP', 'Help');
+
+define('IMAGE_CONVERT', 'Convert info to new key');
+define('IMAGE_ENCRYPT', 'Encrypt data');
+define('IMAGE_DECRYPT', 'Decrypt data');
+define('IMAGE_RETURN', 'Return to main');
+define('IMAGE_EDIT_KEY', 'Edit Key File');
+define('IMAGE_CREATE', 'Create key');
+define('IMAGE_HELP', 'Help');
+define('IMAGE_RUN', 'Run');
+  define('BOX_DATA_EASYPOPULATE_BASIC', 'Easy Populate Basic');
+  define('BOX_DATA_EASYPOPULATE', 'Easy Populate Advance');
+  define('BOX_DATA_EASYPOPULATE_EXPORT', 'EPA Export');
+  define('BOX_DATA_EASYPOPULATE_IMPORT', 'EPA Import');
+  define('BOX_DATA_EASYPOPULATE_BASIC_EXPORT', 'EPB Export');
+  define('BOX_DATA_EASYPOPULATE_BASIC_IMPORT', 'EPB Import');
+  define('BOX_DATA_EASYPOPULATE_OPTIONS_EXPORT', 'Options Export');
+  define('BOX_DATA_EASYPOPULATE_OPTIONS_IMPORT', 'Options Import');
+  define('BOX_HEADING_DATA', 'Im- und Export Funktionen');
+  define('BOX_DATA', 'Data Feeds');
+  define('BOX_DATA_ADMIN', 'Data Configure');
+  define('BOX_HEADING_FEEDERS', 'Feeder Systems');
+  define('BOX_DATA_HELP', 'Data Help');
+  define('BOX_FEEDERS_AMAZON', 'Amazon Marketplace');
+  define('BOX_FEEDERS_BIZRATE', 'Biz Rate');
+  define('BOX_FEEDERS_FROOGLE', 'Froogle');
+  define('BOX_FEEDERS_MYSIMON', 'MySimon');
+  define('BOX_FEEDERS_PRICE_GRABBER', 'Price Grabber');
+  define('BOX_FEEDERS_SHOPPING', 'Shopping.com');
+  define('BOX_FEEDERS_YAHOO', 'Yahoo');
+
+define('BOX_HEADING_DOC', 'Documentation');
+define('BOX_DOC_ADMIN', 'Admin');
+define('BOX_DOC_CAT', 'Catalog');
+define('BOX_DOC_MISC', 'Miscellaneous');
+
+
+
+// Eversun mod for sppc and qty price breaks
+define('ENTRY_CUSTOMERS_GROUP_NAME', 'Kunden Gruppe:');
+define('BOX_CUSTOMERS_GROUPS', 'Kunden Gruppe');
+define('ENTRY_COMPANY_TAX_ID', 'Umsatz-Steuer-Ident-Nummer (UStId-Nr.):');
+define('ENTRY_COMPANY_TAX_ID_ERROR', '');
+define('ENTRY_CUSTOMERS_GROUP_REQUEST_AUTHENTICATION', 'Switch off alert for authentication:');
+define('ENTRY_CUSTOMERS_GROUP_RA_NO', 'Alert off');
+define('ENTRY_CUSTOMERS_GROUP_RA_YES', 'Alert on');
+define('ENTRY_CUSTOMERS_GROUP_RA_ERROR', '');
+// Eversun mod end for sppc and qty price breaks
+// DMG Mod for Customer Notification Report
+define('BOX_REPORTS_PRODUCTS_NOTIFICATIONS', 'Prod Notifications');//Products Notifications V3
+
+define('FOOTER_TEXT_BODY', 'Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a> and <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Using Version ' . PROJECT_VERSION);
+
+// VJ infosystem begin
+define('BOX_HEADING_PAGE_MANAGER', 'Page Manager');
+define('BOX_PAGES', 'Pages');
+define('BOX_PAGES_CATEGORIES', 'Categories');
+// VJ infosystem end
+
+define('BOX_SHIPWIRE', 'Amerika ShipWire');
+define('BOX_MODULES_CHECKOUT_SUCCESS', 'Checkout Success');
+
+define('BOX_HEADING_TECH_SUPPORT','Tech Support');
+define('BOX_HEADING_INSTALL_EXPLAIN','Explain Quires');
+define('IMAGE_BUTTON_BACK','Back');
+define('IMAGE_BUTTON_CONFIRM','Confirm');
+
+if(file_exists('includes/languages/german_newsdesk.php')) {
+include('includes/languages/german_newsdesk.php');
+include('includes/languages/german_faqdesk.php');
+}
+
+//coupons redeemed report
+define('BOX_REPORTS_COUPONS_REDEEMED','Coupons Redeemed');
+
+define("PAYPAL_HELP_CONFIGURATION_GUIDE","Configuration Guide");
+define("PAYPAL_HELP_FREQUENTLY_ASKED_QUESTIONS","Frequently Asked Questions");
+define("PAYPAL_CONTENTS","Contents");
+define("PAYPAL_HELP_CONTENTS1","The following is a guide towards configuring your store's PayPal payment module settings:");
+
+define("PAYPAL_HELP_CONTENTS2",'<ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">Enable PayPal Module</b><br />Since you have just done the installation, by default it will say yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">E-Mail Address</b><br />Enter your Primary PayPal email address here, if you have more than one email address registered with PayPal then you must login your PayPal account to determine which one is your <b>Primary</b> email address.</li><br /><br class="h6" />
+      <li><b class="ppem380">Business ID</b><br />If you have configured a secondary email address to be your Business ID (email address) in your PayPal profile account, then enter this here, otherwise enter the one used above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Transaction Currency</b><br />Choose which currencies you want to accept PayPal payments with.</li><br /><br class="h6" />
+      <li><b class="ppem380">Payment Zone</b><br />If a zone is selected, only enable this payment method for that zone.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Pending Notification</b> Order Status</b><br />Set the Pending Notification status of orders made with this payment module to this value, \'<b style="color:blue">Pending</b>\' is suggested or alternatively the optional order status created in step 4 above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Order</b> Status</b><br />Set the status of orders made with this payment module to this value <b style="color:red">Do not set it to \'default\' but specifically choose the status required</b>, \'<b style="color:blue">Processing</b>\' is suggested.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>On Hold Order</b> Status</b><br />This order status is used when the Cart Test has failed, eg. the expected payment amount did not match.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Canceled Order</b> Status</b><br />Refunded, Reversed, Failed or Denied payments will be set to this order status.</li><br /><br class="h6" />
+      <li><b class="ppem380">Synchronize Invoice</b><br />Specify whether the osCommerce order number should be used as a <b>unique</b> PayPal invoice number, similiar to PayPal\'s Send Money feature, this will enable customers to resume an order via their osCommerce account history info page for that order for pending transactions which were not previously completed.</li><br /><br class="h6" />
+      <li><b class="ppem380">Sort order of display</b><br />Sort order of display. Lowest is displayed first.</li><br /><br class="h6" />
+      <li><b class="ppem380">Background Color</b><br />Select the background color of PayPal\'s payment pages, either black or white.</li><br /><br class="h6" />
+      <li><b class="ppem380">Processing logo</b><br />Specify the image file name to be used in the store\'s checkout process splash page, must be located in <code>catalog/images</code> directory.</li><br /><br class="h6" />
+      <li><b class="ppem380">Store logo</b><br />Specify the image file name for PayPal to display on their payment pages pages, must be located in <code>catalog/images</code> directory. If you do not have SSL then leave this field blank.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Page Style Name</b><br />Specify the name of the page style you have configured in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">Include a note with payment</b><br />When a customer arrives at the PayPal payment page you can choose whether or not to show them another note field which will have seperate contents from that of the one provided in your store\'s checkout process but will be included in PayPal\'s invoice and receipt.<br />To change the title appearing above this field on the PayPal payment page look in the corresponding catalog langauge file (<code>catalog/includes/langauges/english/modules/payment/paypal.php</code>).</li><br /><br class="h6" />
+      <li><b class="ppem380">Shopping Cart Method</b><br />Choose which type of PayPal Shopping Cart you want to use, Aggregate simply means the total amount is passed (with a list of the products shown in a single item field), whereas an Itemized Cart will list indivudally all the items the customer has selected in their PayPal invoice.</li><br /><br class="h6" />
+      <li><b class="ppem380">Enable PayPal Shipping Address</b><br />Allow the customer to choose their own PayPal shipping address. (See <a href="'.tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL') .'">FAQ\'s</a> for more info)</li><br /><br class="h6" />
+      <li><b class="ppem380">Digest Key</b><br />Specify a unique digest key, this will then be used similiar to a password while testing via the IPN Test Panel <b>and</b> also the store\'s PayPal transaction signature digest key.</li><br /><br class="h6" />
+      <li><b class="ppem380">Test Mode</b><br />This should be off for live environments.<br />You can simulate your own IPNs via the <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp') .'">IPN Test Panel</a>.</li><br /><br class="h6" />
+      <li><b class="ppem380">Cart Test</b><br />This test verifies that the amount received via PayPal matches to what is expected (See <a href="'. tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL').'">FAQ\'s</a> for more info).</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notifications</b><br />Choose whether you want to receive debug emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notification Address</b><br />Enter a seperate email address where you wish to receive <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Domain</b><br />This must be set to <b>paypal.com</b> for live production environments, this setting is to facilate PayPal\'s sandbox and is not related to the IPN Test Panel or the above Test Mode option.</li><br /><br class="h6" />
+      <li><b class="ppem380">Return URL behavior</b><br />This determines what method PayPal should use when returning the customer back to the store, leave this set to 1 (GET).</li><br /><br class="h6" />
+    </ul>');
+
+
+
+define("PAYPAL_FAQ_CONTENTS1","The following are some frequently asked questions about this payment module:");
+
+define("PAYPAL_FAQ_CONTENTS2",'<ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">My shipping costs are different once the customer arrives at the PayPal site.</b></legend><div>In your PayPal account profile in the shipping section, check the box that allows overriding the shipping costs.</li><br /><br class="h6" />
+      <li><b class="ppem380">Do I need to enable IPN in my PayPal account profile.</b><br />No.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the IPN feature to be used.</b><br />You don\'t need to, it will automatically be specified.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why doesn\'t the Auto-Return feature work.</b><br />You must enable it first in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the Auto-Return feature.</b><br />It doesn\'t matter, this contribution will automatically specify the correct script url location, which is now <code>catalog/checkout_success.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Does this contribution support PayPal Credit Card payments.</b><br />Yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I getting so many emails per transaction.</b><br />You get <b>one</b> from PayPal and <b>one</b> osCommerce order confirmation email, and another which is the <b>debug email</b>, either disable <b>debug</b> email notification or specify a sperate email address for <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I not receiving any IPNs.</b><br />You must ensure that your <b>Primary Email Address</b> and <b>Business ID</b> are configured correctly.<br />Login to your PayPal Account and see what and how many email addresses you are using and which one is the Primary address.<br />Also check your debug emails as it will also specify the Primary Email Address of the intended receiver.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m having problems with Multi-Currencies.</b><br />This problem should now be resolved, previously the <b>Cart Test</b> was comparing the currency and amounts of the actual order to what PayPal received as opposed to actually comparing the currency and amounts prior to transfering the customer to PayPal.<br /><br /><b>However</b>, if you\'re using the Itemized Shopping Cart then discrepancies may arise due to PayPal\'s two decimal place calculations, in such an event the order will be placed on hold. Although this type of discrepancy may not affect all orders it does however exist and now adds a future requirement to enable you to finalize the transaction via your store\'s admin.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m having problems verifying the Cart Totals.</b><br />See above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why is there no PayPal shipping address details in the IPN info?</b><br />Set Enable PayPal Shipping Address to \'No\' if you require a PayPal verified shipping address or set to \'Yes\' if you do not.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can I customize the Checkout redirect page.</b><br />The splash template page shown while transfering the customer to PayPal is:<br /><code>catalog/includes/modules/payment/paypal/catalog/checkout_splash.inc.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find more PayPal logo buttons.</b><br />Login to your PayPal account and click Merchant Tools or Auction Tools.</li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find PayPal documentation.</b><br /><ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;"><li><a href="https://www.paypal.com/en_US/pdf/integration_guide.pdf">PayPal Integration Manual</a></li></ul></li><br /><br class="h6" />
+
+      <li><b class="ppem380">How do I use PayPal\'s Sandbox.</b>
+        <ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;">
+          <li>Register with <a href="https://developer.paypal.com/" target="PPDC">PayPal Developer Central</a></li><br class="h6" />
+          <li>Then create <b>two virtual accounts</b> types:<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Personal Account</li><li>Premier or Business Account</li></ul></li><br class="h6" />
+          <li>Confirm both accounts (each is just a single click option).</li><br class="h6" />
+          <li>Transfer some virtual money into your personal account (Click the add funds link).</li><br class="h6" />
+          <li>Emails to both accounts will appear in the section where you initially login into the PayPal Developer Central, no real emails are sent so the email addresses for your virtual accounts should be fictitious.</li><br class="h6" />
+          <li>Now in your <a href="'. tep_href_link(FILENAME_MODULES,'set=payment&module=paypal&action=edit').'" target="_blank">osCommerce::Admin::Modules::Payment::PayPal</a> configuration section<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Enter the virtual business account email address into both the Primary Email Address and Business ID fields</li><li>Set the domain to www.sandbox.paypal.com</li></ul></li><br class="h6" />
+          <li>Now checkout as a customer via the store, this account should have a real email address (so that you can receive the osC customer order confirmation email), and when you arrive at the PayPal Sandbox site (look for their logo) then login using the virtual personal account details and finalize the payment process.</li>
+        </ul>
+       <br /><p class="ppsmallerrorbold">Note that you must first login via the PayPal Developer Central prior to testing the Sandbox/Checkout process.</p>
+      </li><br /><br class="h6" />
+
+      <li><b class="ppem380">What\'s the difference between the IPN Test Panel and using PayPal\'s Sandbox.</b><br />The <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp').'" target="itp">IPN Test Panel</a> is an independent osCommerce Contribution feature, for testing and development purposes, which allows you to simmulate your own IPNs without having to interact with PayPal.<br /><br /><p class="ppsmallerrorbold">All Test IPNs via the IPN Test Panel will be invalid according to PayPal since they\'re not authentic transactions.</p></li><br /><br class="h6" />
+      <li><b class="ppem380">Is the IPN Test Panel related to PayPal\'s Sandbox.</b><br />No, see above.</li><br /><br class="h6" />
+      <li><b class="ppem380">What\'s the purpose of the digest key.</b><br />Currently the digest key serves two purposes, it authenticates and allows you to use the <a href="'. tep_href_link(FILENAME_PAYPAL,'action=itp').'" target="itp">IPN Test Panel</a>, secondly, untill such time that PayPal provides a secure method of associating an IPN specifically to a particular order, it serves as a unique transaction signature identifier.</li><br /><br class="h6" />
+      <li><b class="ppem380">Should I change the digest key default value.</b><br />Yes, but remember what it is if uninstalling and reinstalling this contrib payment module in the admin since there might be existing pending orders which will require it in order to associate with to their corresponding IPN(s).</li><br /><br class="h6" />
+      <li><b class="ppem380">How are IPNs deleted.</b><br />Currently, an IPN appearing the admin section is deleted automatically when deleting it\'s corresponding order.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can a customer resume their order.</b><br />Currently, if the customer abandons the checkout process at the PayPal site, e.g for some reason they did not actually pay at that time, then they can log into their osCommerce account and click the confirm order button when viewing the details of that particular order in their account_history_info.<br /><br />This feature is only available when <b>synchronizing invoices</b> with PayPal.<br /><br />This means that if you ever reset the osCommerce <code>orders</code> database table then you must also update it\'s auto-increment value to be greater than the last known <code>order_id</code>.</li><br /><br class="h6" />
+      <li><b class="ppem380">I\'m getting errors after installing the contribution.</b><br />First, go through the installation edits and remove any blank spaces at the beginning of the line(s), some text editors will insert hidden characters which is a side effect of copying and pasting from HTML documentation.<br />Make sure that the alterations have been performed as well as running the paypal_ipn.sql script.</li><br /><br class="h6" />
+
+      <li><b class="ppem380">What type of PayPal account do I need.</b><br />You will need either a Premier or Merchant Business Account. <a href="https://www.paypal.com/refer/pal=PS2X9Q773CKG4" target="_blank">Click&nbsp;here&nbsp;to&nbsp;register&nbsp;for&nbsp;an&nbsp;account</a> if you do not already have one.</li><br /><br class="h6" />
+    </ul>');
+
+
+
+define("PAYPAL_IPN_TEST_MODE1","Test Mode must be enabled!");
+define("PAYPAL_IPN_TEST_MODE_ADVANCED","Advanced");
+define("PAYPAL_IPN_TEST_MODE_HELP_WITH_THIS_PAGE","Help with this page");
+define("PAYPAL_IPN_TEST_MODE_PRIMARY_PAYPAL_EMAIL_ADDRESS","Primary PayPal Email Address");
+define("PAYPAL_IPN_TEST_MODE_BUSINESS_ID","Business ID");
+define("PAYPAL_IPN_TEST_MODE_DEBUG_EMAIL_ADDRESS","Debug Email Address");
+
+define("PAYPAL_IPN_TEST_MODE_FIRST_NAME","First Name");
+define("PAYPAL_IPN_TEST_MODE_LAST_NAME","Last Name");
+define("PAYPAL_IPN_TEST_MODE_BUSINESS_NAME","Business Name");
+define("PAYPAL_IPN_TEST_MODE_EMAIL_ADDRESS","Email Address");
+define("PAYPAL_IPN_TEST_MODE_PAYER_ID","Payer ID");
+define("PAYPAL_IPN_TEST_MODE_PAYER_STATUS","Payer Status");
+define("PAYPAL_IPN_TEST_MODE_VERIFIED","verified");
+define("PAYPAL_IPN_TEST_MODE_UNVERIFIED","unverified");
+define("PAYPAL_IPN_TEST_MODE_INVOICE","Invoice");
+
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_NAME","Address Name");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STREET","Address Street");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_CITY","Address City");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STATE","Address State");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_ZIP","Address Zip");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_COUNTRY","Address Country");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS_STATUS","Address Status");
+define("PAYPAL_IPN_TEST_MODE_CONFIRMED","confirmed");
+define("PAYPAL_IPN_TEST_MODE_UNCONFIRMED","unconfirmed");
+
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_TYPE","Payment Type");
+define("PAYPAL_IPN_TEST_MODE_INSTANT","instant");
+define("PAYPAL_IPN_TEST_MODE_ECHECK","echeck");
+define("PAYPAL_IPN_TEST_MODE_TRANSACTION_TYPE","Transaction Type");
+define("PAYPAL_IPN_TEST_MODE_SELECT","--select--");
+define("PAYPAL_IPN_TEST_MODE_CART","cart");
+define("PAYPAL_IPN_TEST_MODE_WEB_ACCEPT","web_accept");
+define("PAYPAL_IPN_TEST_MODE_SEND_MONEY","send_money");
+define("PAYPAL_IPN_TEST_MODE_CUSTOM","Custom");
+define("PAYPAL_IPN_TEST_MODE_TRANSACTION_ID","Transaction ID");
+define("PAYPAL_IPN_TEST_MODE_PARENT_TRANSACTION_ID","Parent Transaction ID");
+define("PAYPAL_IPN_TEST_MODE_NO_CART_ITEMS","No. Cart Items");
+define("PAYPAL_IPN_TEST_MODE_NOTIFY_VERSION","Notify Version");
+define("PAYPAL_IPN_TEST_MODE_NOTIFY_VERSION_VALUE","1.6");
+define("PAYPAL_IPN_TEST_MODE_MEMO","Memo");
+
+define("PAYPAL_IPN_TEST_MODE_MC_CURRENCY","MC Currency");
+define("PAYPAL_IPN_TEST_MODE_USD","USD");
+define("PAYPAL_IPN_TEST_MODE_GBP","GBP");
+define("PAYPAL_IPN_TEST_MODE_EUR","EUR");
+define("PAYPAL_IPN_TEST_MODE_CAD","CAD");
+define("PAYPAL_IPN_TEST_MODE_JPY","JPY");
+define("PAYPAL_IPN_TEST_MODE_MC_GROSS","MC Gross");
+define("PAYPAL_IPN_TEST_MODE_MC_FEE","MC Fee");
+
+define("PAYPAL_IPN_TEST_MODE_SETTLE_AMOUNT","Settle Amount");
+define("PAYPAL_IPN_TEST_MODE_SETTLE_CURRENCY","Settle Currency");
+define("PAYPAL_IPN_TEST_MODE_EXCHANGE_RATE","Exchange Rate");
+
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS","Payment Status");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_COMPLETED","Completed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_PENDING","Pending");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_FAILED","Failed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_DENIED","Denied");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_REFUNDED","Refunded");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_REVERSED","Reversed");
+define("PAYPAL_IPN_TEST_MODE_PAYMENT_STATUS_CANCELED_REVERSAL","Canceled_Reversal");
+
+define("PAYPAL_IPN_TEST_MODE_PENDING_REASON","Pending Reason");
+define("PAYPAL_IPN_TEST_MODE_MULTI_CURRENCY","multi_currency");
+define("PAYPAL_IPN_TEST_MODE_INTL","intl");
+define("PAYPAL_IPN_TEST_MODE_VERIFY","verify");
+define("PAYPAL_IPN_TEST_MODE_ADDRESS","address");
+define("PAYPAL_IPN_TEST_MODE_UPGRADE","upgrade");
+define("PAYPAL_IPN_TEST_MODE_UNILATERAL","unilateral");
+define("PAYPAL_IPN_TEST_MODE_OTHER","other");
+
+define("PAYPAL_IPN_TEST_MODE_REASON_CODE","Reason Code");
+define("PAYPAL_IPN_TEST_MODE_CHARGEBACK","chargeback");
+define("PAYPAL_IPN_TEST_MODE_GUARANTEE","guarantee");
+define("PAYPAL_IPN_TEST_MODE_BUYER_COMPLAINT","buyer_complaint");
+define("PAYPAL_IPN_TEST_MODE_REFUND","refund");
+
+define("PAYPAL_IPN_TEST_MODE_TAX","Tax");
+define("PAYPAL_IPN_TEST_MODE_FOR_AUCTION","For Auction");
+define("PAYPAL_IPN_TEST_MODE_NO","No");
+define("PAYPAL_IPN_TEST_MODE_YES","Yes");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_BUYER_ID","Auction Buyer ID");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_CLOSING_DATE","Auction Closing Date");
+define("PAYPAL_IPN_TEST_MODE_AUCTION_MULTI_ITEM","Auction Multi-Item");
+
+define("PAYPAL_IPN_TEST_MODE_ITEM_NAME","Item Name");
+define("PAYPAL_IPN_TEST_MODE_ITEM_NUMBER","Item Number");
+define("PAYPAL_IPN_TEST_MODE_QUANTITY","Quantity");
+
+
+define("PAYPAL_IPN_TEST_MODE_HELP1","The following is a quick guide towards simmulating your own IPNs:");
+
+
+define("PAYPAL_IPN_TEST_MODE_HELP2",' <br><ol>
+      <li>Begin to check out as a customer via the store, stop when you get to the PayPal site</li><br><br class="h6">
+      <li>Go into the store admin orders section and find the last order (just created)</li><br><br class="h6">
+      <li>Select a <b>Transaction Type</b>, usually cart or web_accept, but nothing for refunds, reversals, or canceled_reversals payments</li><br><br class="h6">
+      <li>Copy and paste the <b>Transaction Signature</b> into the <b>Custom</b> field and into the <b>Transaction ID</b> field</li><br><br class="h6">
+      <li>If the <b>Cart Test</b> is on, then make sure that the above <b>MC Gross</b> amount is the same as the order total and that the <b>MC&nbsp;Currency</b> field is set to the same currency as the order.</li><br><br class="h6">
+      <li>Submit the Test IPN</li><br><br class="h6">
+      <li>Now check the admin order status</li><br><br class="h6">
+    </ol>');
+
+define("PAYPAL_IPN_TEST_MODE_HELP3","When testing Pending payments etc, remember to use the same Transction ID");
+
+##################### 03/07/2006 Start  ####################
+
+define("NON_TTF_FONT_ERROR","Non-TTF font size must be 1,2,3,4 or 5");
+define("SETLEGEND_ERROR","Error: SetLegend argument must be an array");
+
+define("UNABLE_TO_OPEN_ERROR","Unable to open ");
+define("UNABLE_TO_OPEN_GIF_ERROR"," as a GIF");
+define("UNABLE_TO_OPEN_PNG_ERROR"," as a PNG");
+define("UNABLE_TO_OPEN_JPG_ERROR"," as a JPG");
+define("SELECT_IMAGE_ERROR","Please select wbmp,gif,jpg, or png for image type!");
+define("SELECT_IMAGE_TYPE_ERROR","Please select an image type!");
+define("NOT_ACCEPTABLE_PLOT_TYPE_ERROR"," not an acceptable plot type");
+define("UNKNOWN_CHART_TYPE_ERROR","ERROR: unknown chart type");
+define("LOG_PLOTS_DATA_GREATER_ERROR","Log plots need data greater than 0");
+define("ERROR_IN_DATA","Error in Data - max not gt min");
+define("FATAL_ERROR","Fatal error");
+define("THINBARLINES_DATA_TYPE_ERROR","Data Type for ThinBarLines must be data-data");
+define("BAR_PLOTS_DATA_TYPE_ERROR",'Bar plots must be text-data: use function SetDataType("text-data")');
+define("NO_IMAGE_DEFINED_DRAWGRAPH_ERROR","No Image Defined: DrawGraph");
+define("NO_ARRAY_OF_DATA_IN_ERROR","No array of data in ");
+
+
+
+##################### 03/07/2006 End  ####################
+
+
+##################### 04/07/2006 Start  ####################
+
+define("SESSION_FILE_OPEN_ERROR_1",'Could not open session file (');
+define("SESSION_FILE_OPEN_ERROR_2",').');
+define("SESSION_FILE_WRITE_ERROR_1",'Could not write session file (');
+define("SESSION_FILE_WRITE_ERROR_2",').');
+define("CACHING_METHOD_ERROR_1",'Caching method ');
+define("CACHING_METHOD_ERROR_2",' not implemented.');
+define("INITIALIZE_SESSION_MODULE_ERROR",'Failed to initialize session module.');
+define("SESSION_NOT_SAVED_ERROR",'Session could not be saved.');
+define("SESSION_NOT_CLOSED_ERROR",'Session could not be closed.');
+define("SESSION_NOT_STARTED_ERROR",'Session could not be started.');
+
+
+define("CANNOT_COPY_PRODUCT_ERROR_1",'<b>WARNING: Cannot copy from Product ID #');
+define("CANNOT_COPY_PRODUCT_ERROR_2",' to Product ID # ');
+define("CANNOT_COPY_PRODUCT_ERROR_3",' ... No copy was made</b>');
+define("NO_ATTRIBUTES_COPY_ERROR_1",'<b>WARNING: No Attributes to copy from Product ID #');
+define("NO_ATTRIBUTES_COPY_ERROR_2",' for: ');
+define("NO_ATTRIBUTES_COPY_ERROR_3",' ... No copy was made</b>');
+define("NO_PRODUCT_ERROR_1",'<b>WARNING: There is no Product ID #');
+define("NO_PRODUCT_ERROR_2",' ... No copy was made</b>');
+
+
+define("MCRYPT_ALGORITHMS_AND_MODES",'Mcrypt Algorithms and Modes');
+define("MCRYPT_ALGORITHM",'Algorithm');
+define("MCRYPT_Status",'Status');
+define("MCRYPT_OK",'OK');
+define("MCRYPT_NOT_OK",'NOT OK');
+define("MCRYPT_NOT_TESTED",'NOT TESTED');
+define("MCRYPT_MAXIMUM_KEY_SIZES_ALLOWED",'Maximum Key Sizes Allowed');
+define("MCRYPT_MAXIMUM_KEY_SIZE",'Maximum Key Size');
+define("MCRYPT_KEY_TEXT",'this is a very long key, even too long for the cipher');
+define("MCRYPT_PLAIN_TEXT",'very important data');
+
+define("DATABASE_TEP_DB_ERROR",'[TEP STOP]');
+
+define("CANNOT_CHANGE_THE_MODE_OF_FILE","Cannot change the mode of file");
+define("FAILED_TO_OPEN_FILE",'Failed to open file ');
+define("CANNOT_WRITE_TO_FILE",'Cannot write to file ');
+
+define("UNABLE_TO_DETERMINE_PAGE_LINK",'<b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function used:<br><br>');
+define("UNABLE_TO_DETERMINE_CONNECTION_METHOD_ON_PAGE_LINK",'<b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>');
+
+
+define("SUPPORT_DESK",'Support Desk');
+
+define("FRAUDSCREENCLIENT_AFS",'AFS');
+define("FRAUDSCREENCLIENT_QUERY_RESULT",'query result');
+define("FRAUDSCREENCLIENT_SERVER_UNAVAILABLE","Algozone Fraud Screen Server currently unavailable. Please try again later.");
+define("FRAUDSCREENCLIENT_AFS_INPUTS","AFS Inputs");
+define("FRAUDSCREENCLIENT_INPUT","input");
+define("FRAUDSCREENCLIENT_INVALID_INPUT","invalid input");
+define("FRAUDSCREENCLIENT_MISSPELLED_FIELD","- perhaps misspelled field?");
+define("FRAUDSCREENCLIENT_AFS_USING_CURL","AFS using curl");
+define("FRAUDSCREENCLIENT_AFS_CURL_PARAMS","AFS curl params");
+define("FRAUDSCREENCLIENT_AFS_CURL_NOT_SUPPORT","<br>error: this version of curl does not support HTTPS try build curl with SSL or specify");
+define("FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_1","Received error message");
+define("FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_2","from curl");
+define("FRAUDSCREENCLIENT_AFS_CURL_PROXY","<p>using curl thru proxy");
+define("FRAUDSCREENCLIENT_AFS_USING_FSOCKOPEN","<p><b>AFS using fsockopen</b>");
+define("FRAUDSCREENCLIENT_AFS_SOCKET_PARAM","AFS socket url param");
+define("FRAUDSCREENCLIENT_AFS_FSOCKOPEN_PROXY","<p><b>AFS using fsockopen proxy<b><br>");
+define("FRAUDSCREENCLIENT_AFS_PROXY_PORT","<br>error: you need to provide the proxy port number to use the proxy port provided");
+define("FRAUDSCREENCLIENT_AFS_INSTALL_CURL","<br>error: you need to install curl if you want secure HTTPS or specify the variable to be");
+define("FRAUDSCREENCLIENT_AFS_QUERY_RESULTS","<p><b>AFS query results: </b>");
+define("FRAUDSCREENCLIENT_AFS_OUTPUT","output");
+
+define("MAP_MSG","<p>Courtesy of the U.S. Census Bureau's TIGER Mapping Service");
+
+define("ATTRIBUTES_DISPLAY_MSG","**Discounts may vary based on selected options");
+
+define("FOOTER_TEXT_1",'E-Commerce Engine Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a> Portions Copyright &copy; 2003 - 2006 <a href="http://www.creloaded.com" target="_blank">CRE Loaded Project</a><br>osCommerce provides no warranty and is redistributable under the <a href="http://www.fsf.org/licenses/gpl.txt" target="_blank">GNU General Public License</a><br><a href="http://www.chainreactionworks.com" target="_blank">Chain Reaction Works, Inc</a> provides no warranty except as to associated support contracts<br>which are limited by and to the Service Level Agreement.</br>');
+define("FOOTER_TEXT_2",'Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.creloaded.com" target="_blank">CRE Loaded</a>');
+
+
+##################### 04/07/2006 End  ####################
+
+
+##################### 05/07/2006 End  ####################
+
+define("AUTHORIZE_NET_HELP_TITLE","Authorize.net Consolidated CRE Help Screen");
+define("AUTHORIZE_NET_HELP_MSG_1","Authorize.net Consolidated CRE Edition");
+define("AUTHORIZE_NET_HELP_MSG_2","Configuration Help Screen");
+define("AUTHORIZE_NET_HELP_MSG_3",'<a href="http://ecommexchange.com"><h2>Link to Apply for Authorize.net account</h2></a><br>(support the CRE project by using our Authorize.net partner)');
+define("AUTHORIZE_NET_HELP_MSG_4",'User your browser back button to return to the Authorize.net edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Authorize.net testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Authorize.net Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Authorize.net User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Authorize.net Consolidated uses the AIM method of
+connecting to Authorize.net.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Authorize.net gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don\'t know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Authorize.net Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Authorize.net Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>
+<li>Trouble Shooting Notes </li>
+<p>If you experience high levels of transaction failure, you may need to adjust your sessions configuration.  Consult your technical support team for more information</p> ');
+
+##################### 05/07/2006 End  ####################
+##################### 06/07/2006 Start  ####################
+
+define("FEATURE_NOT_PRESENT_TEXT",'<p class="style4">CRE Loaded Standard Version is the perfect application
+        to power your e-Commerce websites. However, if you need features that
+        only a Pro-level application can deliver, please take a look at all the
+        powerful options our Pro Version adds. If you are looking to deploy a
+        powerful Business to Business solution, our Pro B2B has added features
+        to enhance sales and productivity.</p>
+
+        <p class="style4">Feel free to contact us for more details or usage guidlines. </p>');
+
+define("HEADER_TAGS_ENGLISH_TXT_1","Default Title");
+define("HEADER_TAGS_ENGLISH_TXT_2","Default Descriptions");
+define("HEADER_TAGS_ENGLISH_TXT_3","Default Keyword(s)");
+define("HEADER_TAGS_ENGLISH_TXT_4","HTTA: ");
+define("HEADER_TAGS_ENGLISH_TXT_5","HTDA: ");
+define("HEADER_TAGS_ENGLISH_TXT_6","HTKA: ");
+define("HEADER_TAGS_ENGLISH_TXT_7","HTCA: ");
+define("HEADER_TAGS_ENGLISH_TXT_8","(Explain) ");
+define('HEADER_TAGS_ENGLISH_TXT_9', 'Title');
+define('HEADER_TAGS_ENGLISH_TXT_10', 'Descriptions');
+define('HEADER_TAGS_ENGLISH_TXT_11', 'Keyword(s)');
+
+
+define('HEADER_TAGS_FILL_TAGS_TXT_1', 'CATEGORIES');
+define('HEADER_TAGS_FILL_TAGS_TXT_2', 'PRODUCTS');
+define('HEADER_TAGS_FILL_TAGS_TXT_3', 'Skip all tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_4', 'Fill only empty tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_5', 'Fill all tags');
+define('HEADER_TAGS_FILL_TAGS_TXT_6', 'Clear all tags');
+
+define("INSTALL_EXPLAIN_TXT_1","Install (and Uninstall) Database Settings script for osC-Explain - by Chemo");
+define("INSTALL_EXPLAIN_TXT_2",'<p><b>Install option selected...running queries</b></p>');
+define("INSTALL_EXPLAIN_TXT_3",'<p>STEP 1 => Add configuration group</p>');
+define("INSTALL_EXPLAIN_TXT_4",'<p>Added the configuration group ');
+define("INSTALL_EXPLAIN_TXT_5",'successfully...adding configuration values</p>');
+define("INSTALL_EXPLAIN_TXT_6",'<p>STEP 2 => Add configuration settings</p>');
+define("INSTALL_EXPLAIN_TXT_7","<blockquote>Success...</blockquote>");
+define("INSTALL_EXPLAIN_TXT_8","<p>Added the configuration settings successfully...adding the 'explain_queries' table</p>");
+define("INSTALL_EXPLAIN_TXT_9",'<p>STEP 3 => Creating explain_queries table</p>');
+define("INSTALL_EXPLAIN_TXT_10",'<blockquote>Successfully created the table.</blockquote>');
+define("INSTALL_EXPLAIN_TXT_11","<p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>");
+
+define("INSTALL_EXPLAIN_TXT_12","<p><b>Uninstall optin selected...running queries</b></p><p>STEP 1 => Delete the configuration group from configuration_group table</p>");
+
+define("INSTALL_EXPLAIN_TXT_13",'<blockquote>Deleted the configuration group successfully...removing configuration values</blockquote><p>STEP 2 => Delete configuraton values</p>');
+
+define("INSTALL_EXPLAIN_TXT_14",'<blockquote>Deleted the configuration values successfully...dropping the explain_queries table</blockquote><p>STEP 3 => Dropping explain_queries table</p>');
+
+
+define("INSTALL_EXPLAIN_TXT_15",'<blockquote>Table dropped successfully...analyzing tables</blockquote><p>STEP 4 => Analyzing configuration_group and configuration table</p>');
+
+define("INSTALL_EXPLAIN_TXT_16","<blockquote>Analyze configuration_group success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_17","<blockquote>Analyze configuration success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_18","<blockquote>Optimize configuration_group success...</blockquote>");
+
+define("INSTALL_EXPLAIN_TXT_19","<blockquote>Optimize configuration success...</blockquote><p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>");
+
+define("INSTALL_EXPLAIN_TXT_20",'<p>Welcome to the barebones osC-Explain installation script (<a href="http://forums.oscommerce.com/index.php?showuser=9196">by   Chemo</a>)!</p><p>This contribution is GPL and the target audience is fellow coders, optimizers,   and knowledgeable webmasters. I encourage each of you to look over the   code and add functionality so that the rest of us can benefit as well.</p><p>There are two options for this script:</p><p><strong>INSTALL</strong></p><blockquote>  <p>This option is self explanatory :) It will add a configuration group     with the title &quot;Explain Queries&quot; and set the sort order to 99 (making     it the last listed). The script will then add values to the configuration     table that is the options for this contribution. Currently, these are     available:</p>  <ul>    <li> Global on / off</li>    <li>Enable on for specific scripts (add one or list separated by comma).       This will be handy for contribution coders since they can enable only for       their development scripts and not waste room for storing other page queries.       In addition, it will speed up the admin report if there are 1,000 rows instead       of 500,000 :)</li>    <li>Enable page exclusion for specific scripts. This is handy to exclude       certain scripts (for instance, ones already optimized) but capture the rest.</li>  </ul>  <p>The last thing this install script does is add a new table called \'explain_queries\'.    This is needed to store the data. Do not change the name since the table     name is hardcoded all over the place. Why not add a new define to filenames.php?     If there is room to trim install steps and decrease the number of file changes     I\'ll take it any day of the week and twice on Sunday. You are (hopefully)     an experienced osC developer so if you want to do define table names the standard     way edit your own files.</p></blockquote><p align="center"><strong><a href="'.$_SERVER['PHP_SELF'].'?action=install">INSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p><p align="left"><strong>UNINSTALL</strong></p><blockquote>  <p align="left">Hopefully, this option is self-explanatory too :) This     will delete all the values associated with osC-Explain from the configuration_group     and configuration tables. Then it will analyze the tables to reset the     cardinality of the tables. Next, the script will drop the \'explain_queries\'     table.</p></blockquote><p align="center"><strong><a href="'.$_SERVER['PHP_SELF'].'?action=delete">UNINSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p><p align="left"><strong>NOTES</strong>: By default all values are set to false.   So, once you have the files uploaded and necessary changes have been made you\'ll   have to enable it through the admin control panel. </p><blockquote>  <p align="left">Configuration -> Explain Queries -> Enable explain queries     -> true</p></blockquote>');
+
+define("VALID_CATEGORIES_PRODUCTS_LIST","Valid Categories/Products List");
+define("VALID_CATEGORIES_LIST","Valid Categories List");
+define("VALID_PRODUCTS_LIST","Valid Products List");
+
+
+define("CRE_LOADED_OSCOMMERCE","CRE Loaded osCommerce");
+define("PASS_FORGOTTEN_FOOTER",'E-Commerce Engine Copyright &copy; 2003 <a href="http://oscommerce.com" target="_blank">osCommerce</a> <br>      Supercharged by <a href="http://creloaded.com" target="_blank">CRE Loaded</a>');
+
+##################### 06/07/2006 End  ####################
+
+
+##################### 07/07/2006 End  ####################
+
+define("QUICK_ATTRIBUTES_POPUP_TXT_0",'Current Attributes');
+define("QUICK_ATTRIBUTES_POPUP_TXT_1","Current ID#");
+define("QUICK_ATTRIBUTES_POPUP_TXT_2","Model:");
+define("QUICK_ATTRIBUTES_POPUP_TXT_3","NO CURRENT ATTRIBUTES ...");
+define("QUICK_ATTRIBUTES_POPUP_TXT_4",'CURRENT ATTRIBUTES:');
+define("QUICK_ATTRIBUTES_POPUP_TXT_5",'Close Window');
+
+define("QUICK_PRODUCTS_POPUP_TXT_0",'Quick Products Listing');
+define("QUICK_PRODUCTS_POPUP_TXT_1",'Quick Product Locator');
+define("QUICK_PRODUCTS_POPUP_TXT_2",'All categories:');
+define("QUICK_PRODUCTS_POPUP_TXT_3",'Click to:');
+define("QUICK_PRODUCTS_POPUP_TXT_4",'Show Attributes');
+
+
+define("QUICKCOM_HELP_TXT_1",'Quickcommerce Consolidated CRE Help Screen');
+define("QUICKCOM_HELP_TXT_2",'Quickcommerce Consolidated CRE Edition');
+define("QUICKCOM_HELP_TXT_3",'Configuration Help Screen');
+define("QUICKCOM_HELP_TXT_4",'<a href=" https://freecreditcardprocessing.com/applynow/online_application.asp?code=chainreaction"> <h2>Link to Apply for Quickcommerce account</h2></a><br>(support the CRE project by using our authorize.net partner)');
+define("QUICKCOM_HELP_TXT_5",'User your browser back button to return to the Quickcommerce edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Quickcommerce testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Quickcommerce Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Quickcommerce User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Quickcommerce Consolidated uses the AIM method of
+connecting to Quickcommerce.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Quickcommerce gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don\'t know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Quickcommerce Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Quickcommerce Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p>');
+
+
+define("STATS_EXPLAIN_QUERIES_TXT_1","Explain Queries v1.0 - by Chemo");
+define("STATS_EXPLAIN_QUERIES_TXT_2",'Explain Queries Report v1.0 <a href="http://forums.oscommerce.com/index.php?showuser=9196">- by Chemo</a>');
+
+define("STATS_EXPLAIN_QUERIES_TXT_3",'Export Format');
+define("STATS_EXPLAIN_QUERIES_TXT_4",'CVS');
+define("STATS_EXPLAIN_QUERIES_TXT_5",'HTML');
+define("STATS_EXPLAIN_QUERIES_TXT_6",'Limit to');
+define("STATS_EXPLAIN_QUERIES_TXT_7",'rows starting with row#');
+define("STATS_EXPLAIN_QUERIES_TXT_8",'Back to Explain Queries');
+define("STATS_EXPLAIN_QUERIES_TXT_9",'results returned for:');
+define("STATS_EXPLAIN_QUERIES_TXT_10",'Query#');
+define("STATS_EXPLAIN_QUERIES_TXT_11",'Time (ms): ');
+define("STATS_EXPLAIN_QUERIES_TXT_12",'# Records:');
+define("STATS_EXPLAIN_QUERIES_TXT_13",'Script: ');
+define("STATS_EXPLAIN_QUERIES_TXT_14",'Request String:');
+define("STATS_EXPLAIN_QUERIES_TXT_15",'Table: ');
+define("STATS_EXPLAIN_QUERIES_TXT_16",'Type: ');
+define("STATS_EXPLAIN_QUERIES_TXT_17",'Possible / Used Key: ');
+define("STATS_EXPLAIN_QUERIES_TXT_18",'Key Len:');
+define("STATS_EXPLAIN_QUERIES_TXT_19",'Rows: ');
+define("STATS_EXPLAIN_QUERIES_TXT_20",'Ref: ');
+define("STATS_EXPLAIN_QUERIES_TXT_21",'Extra: ');
+define("STATS_EXPLAIN_QUERIES_TXT_22",'Comment: ');
+
+define("TEMPLATE_CONFIGURATION1_TXT_1","Link Button Name 1");
+define("TEMPLATE_CONFIGURATION1_TXT_2","Link Button Name 2");
+define("TEMPLATE_CONFIGURATION1_TXT_3","Link Button Name 3");
+define("TEMPLATE_CONFIGURATION1_TXT_4","Link Button Name 4");
+define("TEMPLATE_CONFIGURATION1_TXT_5","Link Button Name 5");
+define("TEMPLATE_CONFIGURATION1_TXT_6","Link Button Name 6");
+
+define("TEMPLATE_CONFIGURATION1_TXT_7","<br> There are ");
+define("TEMPLATE_CONFIGURATION1_TXT_8"," active infoboxes in your Right Column<br>");
+define("TEMPLATE_CONFIGURATION1_TXT_9","WARNING: You have the RIGHT Column Active BUT <br>No boxes selected in your RIGHT column");
+define("TEMPLATE_CONFIGURATION1_TXT_10","Left column cellpadding");
+define("TEMPLATE_CONFIGURATION1_TXT_11","Show Page descriptions");
+define("TEMPLATE_CONFIGURATION1_TXT_12","Right Column cell padding");
+define("TEMPLATE_CONFIGURATION1_TXT_13","Include Main Table Border");
+define("TEMPLATE_CONFIGURATION1_TXT_14","Show Customer Greeting?");
+define("TEMPLATE_CONFIGURATION1_TXT_15","<br>edit text for Customer Logged On<br>");
+define("TEMPLATE_CONFIGURATION1_TXT_16",'<br>edit text for Customer Re-Logged On<br>');
+define("TEMPLATE_CONFIGURATION1_TXT_17",'<br>edit text for Guest greeting<br>');
+define("TEMPLATE_CONFIGURATION1_TXT_18",'Include Which Modules On Catalog index Page?');
+
+
+define("TREEVIEW_TXT_1","Catalog Tree");
+define("TREEVIEW_TXT_2","open all");
+define("TREEVIEW_TXT_3","close all");
+
+##################### 07/07/2006 End  ####################
+
+
+
+
+define("ADMIN_JS_FILE_BROWSER","File Browser");
+define("ADMIN_JS_INSERT_FILE","Insert File");
+
+define("ADMIN_JS_IBROWSER_MSG_1",'<strong>net<span class="hilight">4</span>visions.com</strong> - the image browser plugin for WYSIWYG editors like FCKeditor, SPAW, tinyMCE, Xinha, and HTMLarea!</p>
+              <p> <strong> <span class="hilight">i</span>Browser</strong> does upload images and supply file management functions. Images can be resized on the fly. If you need even more advanced features, have a look at <strong> <span class="hilight">i</span>Manager</strong>, another <strong>net<span class="hilight">4</span>visions.com</strong> plugin - it adds truecolor image editing functions like: resize, flip, crop, add text, gamma correct, merge into other image, and many others.</p>
+              <p><strong> <span class="hilight">i</span>Browser</strong> is written and distributed under the GNU General Public License which means that its source code is freely-distributed and available to the general public.</p>
+              <p>&nbsp;</p>');
+
+define("ADMIN_JS_IBROWSER_MSG_2",'Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exercitation ullamcorper suscipit. Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.');
+
+define("ADMIN_JS_PREVIEW_PAGE","Preview page");
+define("ADMIN_JS_EDITOR_CONTENTS","Editor contents:");
+define("ADMIN_JS_CLOSE","Close");
+define("ADMIN_JS_PRINT","Print");
+
+##################### 08/07/2006 End  ####################
+
+
+define("DOCUMENT_INDEX","Document Index");
+
+define("CUSTOMER_ZIP_CODE_VALIDATOR","Customer Zip Code Validator");
+define("SEND_EMAIL_TO_ALL","Send Email to All");
+define("MISMATCHED_STATE_AND_ZIPCODE","Mismatched State and Zipcode");
+define("ADDRESS_BOOK_ID","Address Book ID");
+define("CUSTOMER_ID","Customer ID");
+define("CUSTOMER","Customer");
+define("REMOVE","Remove");
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/order_edit_english.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/order_edit_english.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/order_edit_english.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,141 @@
+<?php
+/*
+  $Id: order_edit_english.php,v 1.3 2004/09/08 00:36:41 ccwjr Exp $
+
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('HEADING_STEP2', 'STEP 2 - Choose payment and Shipping Meathods for new order #');
+define('HEADING_INSTRUCT1', '');
+define('HEADING_INSTRUCT2', '');
+define('HEADING_STEP3', 'Step 3 ADD A NEW PRODUCT');
+define('HEADING_SHIPPING', 'Shipping Method:');
+
+define('TEXT_ADD_PROD_STEP1', 'STEP 1:');
+define('TEXT_ADD_STEP2', 'STEP 2:');
+define('TEXT_ADD_STEP3', 'STEP 3:');
+define('TEXT_ADD_STEP4', 'STEP 4:');
+
+define('TEXT_ADD_PROD', 'Add Product ');
+define('TEXT_SELECT_PROD', 'Select this product');
+
+define('TEXT_ADD_CAT_CHOOSE', '--- CHOOSE A CATEGORY ---\n');
+define('TEXT_SELECT_CAT', 'Select this category');
+define('TEXT_ADD_PROD_CHOOSE', 'Add Product ');
+
+define('TEXT_SELECT_OPT', 'Select options');
+define('TEXT_SELECT_OPT_SKIP', 'No options for this product');
+
+define('TEXT_ADD_QUANTITY', ' Quantity');
+define('TEXT_ADD_NOW', 'Add Now!');
+define('TEXT_VIEW_CC', ' To View CC Fields');
+define('TEXT_VIEW_PO', ' or View PO Fields');
+
+define('TEXT_INFO_PO', 'PO Information:');
+define('TEXT_INFO_NAME', 'Account name:');
+define('TEXT_INFO_AC_NR', 'Account number:');
+define('TEXT_INFO_PO_NR', 'Purchase Order Nr:');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Please Select');
+define('TYPE_BELOW', 'Type Below');
+
+define('JS_ERROR', 'Errors have occured during the process of your form!\nPlease make the following corrections:\n\n');
+
+define('JS_GENDER', '* The \'Gender\' value must be chosen.\n');
+define('JS_FIRST_NAME', '* The \'First Name\' entry must have at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_LAST_NAME', '* The \'Last Name\' entry must have at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('JS_DOB', '* The \'Date of Birth\' entry must be in the format: xx/xx/xxxx (month/day/year).\n');
+define('JS_EMAIL_ADDRESS', '* The \'E-Mail Address\' entry must have at least ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_ADDRESS', '* The \'Street Address\' entry must have at least ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.\n');
+define('JS_POST_CODE', '* The \'Post Code\' entry must have at least ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.\n');
+define('JS_CITY', '* The \'Suburb\' entry must have at least ' . ENTRY_CITY_MIN_LENGTH . ' characters.\n');
+define('JS_STATE', '* The \'State\' entry must be selected.\n');
+define('JS_STATE_SELECT', '-- Select Above --');
+define('JS_ZONE', '* The \'State\' entry must be selected from the list for this country.\n');
+define('JS_COUNTRY', '* The \'Country\' entry must be selected.\n');
+define('JS_TELEPHONE', '* The \'Telephone Number\' entry must have at least ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.\n');
+define('JS_PASSWORD', '* The \'Password\' and \'Confirmation\' entries must match and have at least ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.\n');
+
+define('CATEGORY_COMPANY', 'Company Details');
+define('CATEGORY_PERSONAL', 'Personal Details');
+define('CATEGORY_ADDRESS', 'Address');
+define('CATEGORY_CONTACT', 'Contact Information');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Password');
+define('CATEGORY_CORRECT', 'If this is the right customer, press the Confirm button below.');
+define('ENTRY_CUSTOMERS_ID', 'ID:');
+define('ENTRY_CUSTOMERS_ID_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COMPANY', 'Company Name:');
+define('ENTRY_NAME', 'Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Gender:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_GENDER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FIRST_NAME', 'First Name:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_FIRST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_LAST_NAME', 'Last Name:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_LAST_NAME_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_LAST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_DATE_OF_BIRTH', 'Date of Birth:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<small><font color="#FF0000">(eg. 05/21/1970)</font></small>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '&nbsp;<small>(eg. 05/21/1970) <font color="#AABBDD">required</font></small>');
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">Your email address doesn\'t appear to be valid!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<small><font color="#FF0000">email address already exists!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_STREET_ADDRESS', 'Street Address:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_STREET_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Post Code:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_POSTCODE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_POST_CODE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_CITY_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_CITY_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_CITY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_CITY', 'City:');
+define('ENTRY_STATE', 'State/Province:');
+define('ENTRY_STATE_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_STATE_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_COUNTRY', 'Country:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_TELEPHONE_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_FAX_NUMBER', 'Fax Number:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Subscribed');
+define('ENTRY_NEWSLETTER_NO', 'Unsubscribed');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('ENTRY_PASSWORD_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_PASSWORD_MIN_LENGTH . ' chars</font></small>');
+define('ENTRY_PASSWORD_TEXT', '&nbsp;<small><font color="#AABBDD">required</font></small>');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+// manual order box text in includes/boxes/manual_order.php
+
+define('BOX_HEADING_MANUAL_ORDER', 'Manual Orders');
+define('BOX_MANUAL_ORDER_CREATE_ACCOUNT', 'Create Account');
+define('BOX_MANUAL_ORDER_CREATE_ORDER', 'Create Order');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/order_edit_espanol.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/order_edit_espanol.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/order_edit_espanol.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+  $Id: order_edit_espanol.php,v 1.3 2004/09/08 00:36:41 ccwjr Exp $
+  Translated by: jparis v1.0
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('HEADING_STEP2', 'Paso 2 - Escoja la forma de pago y de envío para el nuevo pedido #');
+define('HEADING_INSTRUCT1', '¡¡¡ INSTRUCCIONES !!!');
+define('HEADING_INSTRUCT2', 'Nota: Si edita las cantidades de productos del<br>
+              pedido no se actualizará el stock con esos cambios.<br>
+          Así que debe asegurarse de realizar esos cambios de<br>
+          forma manual en la sección de edición.<br>');
+define('HEADING_STEP3', 'Paso 3 - AÑADIR UN PRODUCTO NUEVO');
+define('HEADING_SHIPPING', 'Foma de envío:');
+
+define('TEXT_ADD_PROD_STEP1', 'PASO 1:');
+define('TEXT_ADD_STEP2', 'PASO 2:');
+define('TEXT_ADD_STEP3', 'PASO 3:');
+define('TEXT_ADD_STEP4', 'PASO 4:');
+
+define('TEXT_ADD_PROD', 'Añadir producto ');
+define('TEXT_SELECT_PROD', 'Seleccionar este producto');
+
+define('TEXT_ADD_CAT_CHOOSE', '--- ESCOJA UNA CATEGORÍA ---\n');
+define('TEXT_SELECT_CAT', 'Seleccionar esta categoría');
+define('TEXT_ADD_PROD_CHOOSE', 'Añadir producto ');
+
+define('TEXT_SELECT_OPT', 'Seleccionar opciones');
+define('TEXT_SELECT_OPT_SKIP', 'No hay opciones para este producto');
+
+define('TEXT_ADD_QUANTITY', ' Cantidad');
+define('TEXT_ADD_NOW', '¡Añadir ahora!');
+define('TEXT_VIEW_CC', ' Para ver los campos CC');
+define('TEXT_VIEW_PO', ' Para ver los campos PO');
+
+define('TEXT_INFO_PO', 'Información PO:');
+define('TEXT_INFO_NAME', 'Nombre de la cuenta:');
+define('TEXT_INFO_AC_NR', 'Número de cuenta:');
+define('TEXT_INFO_PO_NR', 'Número de pedido de compra:');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Por favor seleccione');
+define('TYPE_BELOW', 'Escriba debajo');
+
+define('JS_ERROR', '¡Hubo errores procesando su ficha!\nPor favor haga las siguientes correciones:\n\n');
+
+define('JS_GENDER', '* El campo \'Género\' es necesario.\n');
+define('JS_FIRST_NAME', '* El campo \'Nombre\' debe tener al menos ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' caracteres.\n');
+define('JS_LAST_NAME', '* El campo \'Apellidos\' debe tener al menos ' . ENTRY_LAST_NAME_MIN_LENGTH . ' caracteres.\n');
+define('JS_DOB', '* El campo \'Fecha de nacimiento\' debe tener el formato: xx/xx/xxxx (dia/mes/año).\n');
+define('JS_EMAIL_ADDRESS', '* El campo \'Dirección de e-mail\' debe tener al menos ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' caracteres.\n');
+define('JS_ADDRESS', '* El campo \'Dirección postal\' debe tener al menos ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' caracteres.\n');
+define('JS_POST_CODE', '* El campo \'Código postal\' debe tener al menos ' . ENTRY_POSTCODE_MIN_LENGTH . ' caracteres.\n');
+define('JS_CITY', '* El campo \'Suburbio\' debe tener al menos ' . ENTRY_CITY_MIN_LENGTH . ' caracteres.\n');
+define('JS_STATE', '* El campo \'Provincia\' es necesario.\n');
+define('JS_STATE_SELECT', '-- Seleccionar arriba --');
+define('JS_ZONE', '* El campo \'Provincia\' debe ser escogido del listado para este país.\n');
+define('JS_COUNTRY', '* El campo \'País\' es necesario.\n');
+define('JS_TELEPHONE', '* El campo \'Número de teléfono\' debe tener al menos ' . ENTRY_TELEPHONE_MIN_LENGTH . ' caracteres.\n');
+define('JS_PASSWORD', '* Los campos \'Contraseña\' y \'Confirmación\' deben coincidir y tener al menos ' . ENTRY_PASSWORD_MIN_LENGTH . ' caracteres.\n');
+
+define('CATEGORY_COMPANY', 'Datos de la empresa');
+define('CATEGORY_PERSONAL', 'Datos personales');
+define('CATEGORY_ADDRESS', 'Dirección');
+define('CATEGORY_CONTACT', 'Información de contacto');
+define('CATEGORY_OPTIONS', 'Opciones');
+define('CATEGORY_PASSWORD', 'Contraseña');
+define('CATEGORY_CORRECT', 'Si este es el cliente correcto, pulse el botón de confirmar abajo.');
+define('ENTRY_CUSTOMERS_ID', 'ID:');
+define('ENTRY_CUSTOMERS_ID_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_COMPANY', 'Nombre de la empresa:');
+define('ENTRY_NAME', 'Nombre:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Género:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_GENDER_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_FIRST_NAME', 'Nombre:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">mínimo de ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' caracteres</font></small>');
+define('ENTRY_FIRST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">necesario/font></small>');
+define('ENTRY_LAST_NAME', 'Apellidos:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">mínimo de ' . ENTRY_LAST_NAME_MIN_LENGTH . ' caracteres</font></small>');
+define('ENTRY_LAST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_DATE_OF_BIRTH', 'Fecha de nacimiento:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<small><font color="#FF0000">(ej. 21/05/1970)</font></small>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '&nbsp;<small>(ej. 21/05/1970) <font color="#AABBDD">necesario</font></small>');
+define('ENTRY_EMAIL_ADDRESS', 'Dirección de e-mail:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">mínimo de ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' caracteres</font></small>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">¡Su dirección de correo no parece válida!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<small><font color="#FF0000">¡La dirección de correo ya existe!</font></small>');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_STREET_ADDRESS', 'Dirección postal:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">mínimo de ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' caracteres</font></small>');
+define('ENTRY_STREET_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_SUBURB', 'Suburbio:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Código postal:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<small><font color="#FF0000">mínimo de ' . ENTRY_POSTCODE_MIN_LENGTH . ' caracteres</font></small>');
+define('ENTRY_POST_CODE_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_SUBURB', 'Suburbio:');
+define('ENTRY_CITY_ERROR', '&nbsp;<small><font color="#FF0000">mínimo de ' . ENTRY_CITY_MIN_LENGTH . ' caracteres</font></small>');
+define('ENTRY_CITY_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_CITY', 'Ciudad:');
+define('ENTRY_STATE', 'Provincia/Estado:');
+define('ENTRY_STATE_ERROR', '&nbsp;<small><font color="#FF0000">necesario</font></small>');
+define('ENTRY_STATE_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_COUNTRY', 'País:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_TELEPHONE_NUMBER', 'Número de teléfono:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">mínimo de ' . ENTRY_TELEPHONE_MIN_LENGTH . ' caracteres</font></small>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_FAX_NUMBER', 'Número de fax:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Boletín de noticias:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Suscrito');
+define('ENTRY_NEWSLETTER_NO', 'No suscrito');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Contraseña:');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Confirmación de la contraseña:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('ENTRY_PASSWORD_ERROR', '&nbsp;<small><font color="#FF0000">mínimo de ' . ENTRY_PASSWORD_MIN_LENGTH . ' caracteres</font></small>');
+define('ENTRY_PASSWORD_TEXT', '&nbsp;<small><font color="#AABBDD">necesario</font></small>');
+define('PASSWORD_HIDDEN', '--OCULTO--');
+
+// manual order box text in includes/boxes/manual_order.php
+
+define('BOX_HEADING_MANUAL_ORDER', 'Pedidos manuales');
+define('BOX_MANUAL_ORDER_CREATE_ACCOUNT', 'Crear cuenta');
+define('BOX_MANUAL_ORDER_CREATE_ORDER', 'Crear pedido');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/order_edit_french.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/order_edit_french.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/order_edit_french.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,143 @@
+<?php
+/*
+  $Id: order_edit_french.php,v 1.3 2004/09/08 00:36:41 ccwjr Exp $
+
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2004 osCommerce
+  Creload French team for Creload 6.1
+  Released under the GNU General Public License
+*/
+
+
+define('HEADING_STEP2', 'ETAPE 2 - Choisissez votre paiement et votre moyen de livraison pour la commande N°');
+define('HEADING_INSTRUCT1', '!!! INSTRUCTIONS !!!');
+define('HEADING_INSTRUCT2', 'Note: Si vous changez les quantit&eacute;s d\'articles command&eacute;s<br>
+              elles ne seront pas prises en compte dans le stock <br>
+          Faites en sorte de faire les changements aprés cette section<br>
+          <br>');
+define('HEADING_STEP3', '3 Ajouter un nouvel article');
+define('HEADING_SHIPPING', 'Moyen de Livraison :');
+
+define('TEXT_ADD_PROD_STEP1', '1:');
+define('TEXT_ADD_STEP2', '2:');
+define('TEXT_ADD_STEP3', '3:');
+define('TEXT_ADD_STEP4', '4:');
+
+define('TEXT_ADD_PROD', 'Ajouter un Article ');
+define('TEXT_SELECT_PROD', 'S&eacute;lectionner cet Article');
+
+define('TEXT_ADD_CAT_CHOOSE', '--- CHOISIR UNE CATEGORIE ---\n');
+define('TEXT_SELECT_CAT', 'S&eacute;lectionner cette cat&eacute;gorie');
+define('TEXT_ADD_PROD_CHOOSE', 'Ajouter un Article ');
+
+define('TEXT_SELECT_OPT', 'S&eacute;lectionner les options');
+define('TEXT_SELECT_OPT_SKIP', 'Pas d\'options pour ce produit');
+
+define('TEXT_ADD_QUANTITY', ' Quantité');
+define('TEXT_ADD_NOW', 'Ajouter Maintenant!');
+define('TEXT_VIEW_CC', ' Pour voir les champs CC');
+define('TEXT_VIEW_PO', ' ou les champs PO');
+
+define('TEXT_INFO_PO', 'Information PO:');
+define('TEXT_INFO_NAME', 'Nom :');
+define('TEXT_INFO_AC_NR', 'Num&eacute;ro de compte:');
+define('TEXT_INFO_PO_NR', 'Commande N°:');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Choisissez');
+define('TYPE_BELOW', 'Tapez ci-dessous');
+
+define('JS_ERROR', 'Des erreurs sont survenues durant le traitement de votre formulaire.\n\nVeuillez effectuer les corrections suivantes:\n\n');
+
+define('JS_GENDER', '* La valeur du genre doit être selectionnée.\n'); 
+define('JS_FIRST_NAME', '* Le nom doit avoit au moins ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' lettres.\n'); 
+define('JS_LAST_NAME', '* Le prénom doit avoir au moins ' . ENTRY_LAST_NAME_MIN_LENGTH . ' lettres.\n'); 
+define('JS_DOB', '* Votre date de naissance doit avoir ce format: JJ/MM/AAAA (ex. 03/02/1961)\n'); 
+define('JS_EMAIL_ADDRESS', '* Votre adresse email doit contenir un minimum de ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' caractères.\n'); 
+define('JS_ADDRESS', '* Votre adresse doit contenir un minimum de ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' caractères.\n'); 
+define('JS_POST_CODE', '* Le code postal doit avoir au moins ' . ENTRY_POSTCODE_MIN_LENGTH . ' numéros.\n'); 
+define('JS_CITY', '* Le champ Ville doit avoir au moins ' . ENTRY_CITY_MIN_LENGTH . ' lettres.\n'); 
+define('JS_STATE', '* Le pays doit être sélectionné.\n'); 
+define('JS_STATE_SELECT', '-- Choisissez --'); 
+define('JS_ZONE', '* Veuillez choisir un pays à partir de la liste déroulante.\n'); 
+define('JS_COUNTRY', '* Veuillez choisir un pays à partir de la liste déroulante.\n'); 
+define('JS_TELEPHONE', '* Votre numéro de téléphone doit contenir un minimum de ' . ENTRY_TELEPHONE_MIN_LENGTH . ' caractères.\n'); 
+define('JS_PASSWORD', '* Votre mot de passe doit contenir un minimum de ' . ENTRY_PASSWORD_MIN_LENGTH . ' caractères.\n');
+
+define('CATEGORY_COMPANY', 'D&eacute;tails soci&eacute;t&eacute;');
+define('CATEGORY_PERSONAL', 'Vos d&eacute;tails personnels');
+define('CATEGORY_ADDRESS', 'Votre adresse');
+define('CATEGORY_CONTACT', 'Vos coordonn&eacute;es');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Votre mot de passe ');
+define('CATEGORY_CORRECT', 'Si vous &ecirc;tes la bonne personne, Confirmez en cliquant ci-dessous.');
+define('ENTRY_CUSTOMERS_ID', 'ID:');
+define('ENTRY_CUSTOMERS_ID_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_COMPANY', 'Nom de la soci&eacute;t&eacute;:');
+define('ENTRY_NAME', 'Nom:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Civilit&eacute;es :');
+define('ENTRY_GENDER_ERROR', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_GENDER_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_FIRST_NAME', 'Pr&eacute;nom:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' carac.</font></small>');
+define('ENTRY_FIRST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_LAST_NAME', 'Nom:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_LAST_NAME_MIN_LENGTH . ' carac.</font></small>');
+define('ENTRY_LAST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_DATE_OF_BIRTH', 'Date de naissance:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<small><font color="#FF0000">(ex. 03/02/1961)</font></small>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '&nbsp;<small>(ex. 03/02/1961) <font color="#AABBDD">requis</font></small>');
+define('ENTRY_EMAIL_ADDRESS', 'Adresse email:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' carac.</font></small>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">Votre adresse email ne semble pas être valide - veuillez effectuer toutes les corrections n&eacute;cessaires.</font></small>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<small><font color="#FF0000">Votre adresse email est d&eacute;jà enregistr&eacute;e sur notre site - Veuillez ouvrir une session avec cette adresse email ou cr&eacute;ez un compte avec une adresse diff&eacute;rente.</font></small>');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_STREET_ADDRESS', 'Street Address:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' carac.</font></small>');
+define('ENTRY_STREET_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_SUBURB', 'Compl&eacute;ment d\'adresse:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Code postal:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_POSTCODE_MIN_LENGTH . ' carac.</font></small>');
+define('ENTRY_POST_CODE_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_CITY', 'Ville:');
+define('ENTRY_CITY_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_CITY_MIN_LENGTH . ' carac.</font></small>');
+define('ENTRY_CITY_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_STATE', 'Etat/Province:');
+define('ENTRY_STATE_ERROR', '&nbsp;<small><font color="#FF0000">requis</font></small>');
+define('ENTRY_STATE_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_COUNTRY', 'Pays:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_TELEPHONE_NUMBER', 'Num&eacute;ro de t&eacute;l&eacute;phone:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_TELEPHONE_MIN_LENGTH . ' carac.</font></small>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_FAX_NUMBER', 'Num&eacute;ro de Fax:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'S\'abonner');
+define('ENTRY_NEWSLETTER_NO', 'Se d&eacute;sabonner');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Mot de Passe:');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Confirmez votre mot de Passe:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('ENTRY_PASSWORD_ERROR', '&nbsp;<small><font color="#FF0000">min ' . ENTRY_PASSWORD_MIN_LENGTH . ' carac.</font></small>');
+define('ENTRY_PASSWORD_TEXT', '&nbsp;<small><font color="#AABBDD">requis</font></small>');
+define('PASSWORD_HIDDEN', '--INVISIBLE--');
+
+// manual order box text in includes/boxes/manual_order.php
+
+define('BOX_HEADING_MANUAL_ORDER', 'Commande Manuelle');
+define('BOX_MANUAL_ORDER_CREATE_ACCOUNT', 'Cr&eacute;er un compte');
+define('BOX_MANUAL_ORDER_CREATE_ORDER', 'Cr&eacute;er une commande');
+?>

Added: trunk/direct.openmoko.com/admin/includes/languages/order_edit_german.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/languages/order_edit_german.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/languages/order_edit_german.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+<?php
+/*
+  $Id: order_edit_german.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Bitte w&auml;hlen Sie');
+define('TYPE_BELOW', 'Bitte unten eingeben:');
+
+define('JS_ERROR', 'Während der Eingabe sind Fehler aufgetreten!\nBitte korrigieren Sie folgendes:\n\n');
+
+define('JS_GENDER', '* Die \'Anrede\' muss ausgewählt werden.\n');
+define('JS_FIRST_NAME', '* Der \'Vorname\' muss mindestens aus ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_LAST_NAME', '* Der \'Nachname\' muss mindestens aus ' . ENTRY_LAST_NAME_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_DOB', '* Das \'Geburtsdatum\' muss folgendes Format haben: xx.xx.xxxx (Tag/Jahr/Monat).\n');
+define('JS_EMAIL_ADDRESS', '* Die \'Email-Adresse\' muss mindestens aus ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_ADDRESS', '* Die \'Strasse\' muss mindestens aus ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_POST_CODE', '* Die \'Postleitzahl\' muss mindestens aus ' . ENTRY_POSTCODE_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_CITY', '* Die \'Stadt\' muss mindestens aus ' . ENTRY_CITY_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_STATE', '* Das \'Bundesland\' muss ausgew&auml;hlt werden.\n');
+define('JS_STATE_SELECT', '-- W&auml;hlen Sie oberhalb --');
+define('JS_ZONE', '* Das \'Bundesland\' muss aus der Liste für dieses Land ausgew&auml;hlt werden.');
+define('JS_COUNTRY', '* Das \'Land\' muss ausgew&auml;hlt werden.\n');
+define('JS_TELEPHONE', '* Die \'Telefonnummer\' muss aus mindestens ' . ENTRY_TELEPHONE_MIN_LENGTH . ' Zeichen bestehen.\n');
+define('JS_PASSWORD', '* Das \'Passwort\' sowie die \'Passwortbest&auml;tigung\' m&uuml;ssen &uuml;bereinstimmen und aus mindestens ' . ENTRY_PASSWORD_MIN_LENGTH . ' Zeichen bestehen.\n');
+
+define('CATEGORY_COMPANY', 'Firma');
+define('CATEGORY_PERSONAL', 'Pers&ouml;nliche Daten');
+define('CATEGORY_ADDRESS', 'Adresse');
+define('CATEGORY_CONTACT', 'Kontakt');
+define('CATEGORY_OPTIONS', 'Optionen');
+define('CATEGORY_PASSWORD', 'Passwort');
+define('CATEGORY_CORRECT', 'Wenn dies der richtige Kunde ist, drücken Sie den &quot;Best&auml;tigen&quot; Button unten..');
+
+define('ENTRY_CUSTOMERS_ID', 'Kundennummer:');
+define('ENTRY_CUSTOMERS_ID_TEXT', '&nbsp;<small><font color="#AABBDD">erforderlich</font></small>');
+define('ENTRY_COMPANY', 'Firmennameame:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Anrede:');
+define('ENTRY_GENDER_ERROR', '&nbsp;<span class="errorText">notwendige Eingabe</span>');
+define('ENTRY_GENDER_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_FIRST_NAME', 'Vorname:');
+define('ENTRY_FIRST_NAME_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_FIRST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_LAST_NAME', 'Nachname:');
+define('ENTRY_LAST_NAME_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_LAST_NAME_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_LAST_NAME_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_DATE_OF_BIRTH', 'Geburtsdatum:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class="errorText">(z.B. 21.05.1970)</span>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '&nbsp;<small>(z.B. 21.05.1970) <font color="#AABBDD">notwendig</font></small>');
+define('ENTRY_EMAIL_ADDRESS', 'Email Adresse:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', '&nbsp;<span class="errorText">ung&uuml;ltige Email-Adresse!</span>');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', '&nbsp;<span class="errorText">Diese Email-Adresse existiert schon!</span>');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_STREET_ADDRESS', 'Strasse:');
+define('ENTRY_STREET_ADDRESS_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_STREET_ADDRESS_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_SUBURB', 'weitere Anschrift:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Postleitzahl:');
+define('ENTRY_POST_CODE_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_POSTCODE_MIN_LENGTH . ' Zahlen</span>');
+define('ENTRY_POST_CODE_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_CITY', 'Stadt:');
+define('ENTRY_CITY_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_CITY_MIN_LENGTH . ' Buchstaben</span>');
+define('ENTRY_CITY_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_STATE', 'Bundesland:');
+define('ENTRY_STATE_ERROR', '&nbsp;<span class="errorText">notwendige Eingabe</font></small>');
+define('ENTRY_STATE_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_COUNTRY', 'Land:');
+define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_TELEPHONE_NUMBER', 'Telefonnummer:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', '&nbsp;<span class="errorText">mindestens ' . ENTRY_TELEPHONE_MIN_LENGTH . ' Zahlen</span>');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_FAX_NUMBER', 'Telefaxnummer:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'abonniert');
+define('ENTRY_NEWSLETTER_NO', 'nicht abonniert');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Passwort:');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Passwort Best&auml;tigung:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('ENTRY_PASSWORD_ERROR', '&nbsp;<small><font color="#FF0000">mindestens ' . ENTRY_PASSWORD_MIN_LENGTH . ' Buchstaben</font></small>');
+define('ENTRY_PASSWORD_TEXT', '&nbsp;<small><font color="#AABBDD">notwendige Eingabe</font></small>');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+// manual order box text in includes/boxes/manual_order.php
+
+define('BOX_HEADING_MANUAL_ORDER', 'Manuelle Bestellungen');
+define('BOX_MANUAL_ORDER_CREATE_ACCOUNT', 'Konto er&ouml;ffnen');
+define('BOX_MANUAL_ORDER_CREATE_ORDER', 'Bestellung er&ouml;ffnen');
+?>

Added: trunk/direct.openmoko.com/admin/includes/local/README
===================================================================
--- trunk/direct.openmoko.com/admin/includes/local/README	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/local/README	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,6 @@
+This directory contains local configuration information.
+
+It also must contain a file named configure.php that can be used to override
+the defaults set in application_top.php
+
+Remember to execute PHP commands the file needs to start with <?php and end with ?>

Added: trunk/direct.openmoko.com/admin/includes/menu.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/menu.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/menu.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,84 @@
+div.menuBar,
+div.menuBar a.menuButton,
+div.menu,
+div.menu a.menuItem {
+  font-family: "MS Sans Serif", Arial, sans-serif;
+  font-size: 8pt;
+  font-style: normal;
+  font-weight: normal;
+  color: #000000;
+}
+
+div.menuBar {
+  background-color: #e0e0e0;
+  border: 2px outset #e0e0e0;
+  padding: 4px 2px 4px 2px;
+  text-align: center;
+  font-weight: bold;
+}
+
+div.menuBar a.menuButton {
+  background-color: transparent;
+  border: 1px solid #e0e0e0;
+  color: #000000;
+  cursor: default;
+  left: 0px;
+  margin: 1px;
+  padding: 2px 6px 2px 6px;
+  position: relative;
+  text-decoration: none;
+  top: 0px;
+  z-index: 100;
+}
+
+div.menuBar a.menuButton:hover {
+  background-color: transparent;
+  border: 1px outset #e0e0e0;
+  color: #000000;
+}
+
+div.menuBar a.menuButtonActive,
+div.menuBar a.menuButtonActive:hover {
+  background-color: #5050f0;
+  border: 1px inset #e0e0e0;
+  color: #ffffff;
+  left: 1px;
+  top: 1px;
+}
+
+div.menu {
+  background-color: #e0e0e0;
+  border: 2px outset #e0e0e0;
+  left: 0px;
+  padding: 0px 1px 1px 0px;
+  position: absolute;
+  top: 0px;
+  visibility: hidden;
+  z-index: 101;
+}
+
+div.menu a.menuItem {
+  color: #000000;
+  cursor: default;
+  display: block;
+  padding: 3px 1em;
+  text-decoration: none;
+  white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+  background-color: #5050f0;
+  color: #ffffff;
+}
+
+div.menu a.menuItem span.menuItemText {}
+
+div.menu a.menuItem span.menuItemArrow {
+  margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+  border: 1px inset #e0e0e0;
+  margin: 4px 2px;
+}
+

Added: trunk/direct.openmoko.com/admin/includes/menu.js
===================================================================
--- trunk/direct.openmoko.com/admin/includes/menu.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/menu.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,584 @@
+//<![CDATA[
+
+//*****************************************************************************
+// Do not remove this notice.
+//
+// Copyright 2000 by Mike Hall.
+// See http://www.brainjar.com for terms of use.
+//*****************************************************************************
+
+//----------------------------------------------------------------------------
+// Code to determine the browser and version.
+//----------------------------------------------------------------------------
+
+function Browser() {
+
+  var ua, s, i;
+
+  this.isIE    = false;  // Internet Explorer
+  this.isOP    = false;  // Opera
+  this.isNS    = false;  // Netscape
+  this.version = null;
+
+  ua = navigator.userAgent;
+
+  s = "Opera";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isOP = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  s = "Netscape6/";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  // Treat any other "Gecko" browser as Netscape 6.1.
+
+  s = "Gecko";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = 6.1;
+    return;
+  }
+
+  s = "MSIE";
+  if ((i = ua.indexOf(s))) {
+    this.isIE = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+}
+
+var browser = new Browser();
+
+//----------------------------------------------------------------------------
+// Code for handling the menu bar and active button.
+//----------------------------------------------------------------------------
+
+var activeButton = null;
+
+/* [MODIFIED] This code commented out, not needed for activate/deactivate
+   on mouseover.
+
+// Capture mouse clicks on the page so any active button can be
+// deactivated.
+
+if (browser.isIE)
+  document.onmousedown = pageMousedown;
+else
+  document.addEventListener("mousedown", pageMousedown, true);
+
+function pageMousedown(event) {
+
+  var el;
+
+  // If there is no active button, exit.
+
+  if (activeButton == null)
+    return;
+
+  // Find the element that was clicked on.
+
+  if (browser.isIE)
+    el = window.event.srcElement;
+  else
+    el = (event.target.tagName ? event.target : event.target.parentNode);
+
+  // If the active button was clicked on, exit.
+
+  if (el == activeButton)
+    return;
+
+  // If the element is not part of a menu, reset and clear the active
+  // button.
+
+  if (getContainerWith(el, "DIV", "menu") == null) {
+    resetButton(activeButton);
+    activeButton = null;
+  }
+}
+
+[END MODIFIED] */
+
+function buttonClick(event, menuId) {
+
+  var button;
+
+  // Get the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // Blur focus from the link to remove that annoying outline.
+
+  button.blur();
+
+  // Associate the named menu to this button if not already done.
+  // Additionally, initialize menu display.
+
+  if (button.menu == null) {
+    button.menu = document.getElementById(menuId);
+    if (button.menu.isInitialized == null)
+      menuInit(button.menu);
+  }
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the button, if not already done.
+
+  if (button.onmouseout == null)
+    button.onmouseout = buttonOrMenuMouseout;
+
+  // Exit if this button is the currently active one.
+
+  if (button == activeButton)
+    return false;
+
+  // [END MODIFIED]
+
+  // Reset the currently active button, if any.
+
+  if (activeButton != null)
+    resetButton(activeButton);
+
+  // Activate this button, unless it was the currently active one.
+
+  if (button != activeButton) {
+    depressButton(button);
+    activeButton = button;
+  }
+  else
+    activeButton = null;
+
+  return false;
+}
+
+function buttonMouseover(event, menuId) {
+
+  var button;
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Activates this button's menu if no other is currently active.
+
+  if (activeButton == null) {
+    buttonClick(event, menuId);
+    return;
+  }
+
+  // [END MODIFIED]
+
+  // Find the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // If any other button menu is active, make this one active instead.
+
+  if (activeButton != null && activeButton != button)
+    buttonClick(event, menuId);
+}
+
+function depressButton(button) {
+
+  var x, y;
+
+  // Update the button's style class to make it look like it's
+  // depressed.
+
+  button.className += " menuButtonActive";
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the button, if not already done.
+
+  if (button.onmouseout == null)
+    button.onmouseout = buttonOrMenuMouseout;
+  if (button.menu.onmouseout == null)
+    button.menu.onmouseout = buttonOrMenuMouseout;
+
+  // [END MODIFIED]
+
+  // Position the associated drop down menu under the button and
+  // show it.
+
+  x = getPageOffsetLeft(button);
+  y = getPageOffsetTop(button) + button.offsetHeight;
+
+  // For IE, adjust position.
+
+  if (browser.isIE) {
+    x += button.offsetParent.clientLeft;
+    y += button.offsetParent.clientTop;
+  }
+
+  button.menu.style.left = x + "px";
+  button.menu.style.top  = y + "px";
+  button.menu.style.visibility = "visible";
+
+  // For IE; size, position and show the menu's IFRAME as well.
+
+  if (button.menu.iframeEl != null)
+  {
+    button.menu.iframeEl.style.left = button.menu.style.left;
+    button.menu.iframeEl.style.top  = button.menu.style.top;
+    button.menu.iframeEl.style.width  = button.menu.offsetWidth + "px";
+    button.menu.iframeEl.style.height = button.menu.offsetHeight + "px";
+    button.menu.iframeEl.style.display = "";
+  }
+}
+
+function resetButton(button) {
+
+  // Restore the button's style class.
+
+  removeClassName(button, "menuButtonActive");
+
+  // Hide the button's menu, first closing any sub menus.
+
+  if (button.menu != null) {
+    closeSubMenu(button.menu);
+    button.menu.style.visibility = "hidden";
+
+    // For IE, hide menu's IFRAME as well.
+
+    if (button.menu.iframeEl != null)
+      button.menu.iframeEl.style.display = "none";
+  }
+}
+
+//----------------------------------------------------------------------------
+// Code to handle the menus and sub menus.
+//----------------------------------------------------------------------------
+
+function menuMouseover(event) {
+
+  var menu;
+
+  // Find the target menu element.
+
+  if (browser.isIE)
+    menu = getContainerWith(window.event.srcElement, "DIV", "menu");
+  else
+    menu = event.currentTarget;
+
+  // Close any active sub menu.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+}
+
+function menuItemMouseover(event, menuId) {
+
+  var item, menu, x, y;
+
+  // Find the target item element and its parent menu element.
+
+  if (browser.isIE)
+    item = getContainerWith(window.event.srcElement, "A", "menuItem");
+  else
+    item = event.currentTarget;
+  menu = getContainerWith(item, "DIV", "menu");
+
+  // Close any active sub menu and mark this one as active.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+  menu.activeItem = item;
+
+  // Highlight the item element.
+
+  item.className += " menuItemHighlight";
+
+  // Initialize the sub menu, if not already done.
+
+  if (item.subMenu == null) {
+    item.subMenu = document.getElementById(menuId);
+    if (item.subMenu.isInitialized == null)
+      menuInit(item.subMenu);
+  }
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the sub menu, if not already done.
+
+  if (item.subMenu.onmouseout == null)
+    item.subMenu.onmouseout = buttonOrMenuMouseout;
+
+  // [END MODIFIED]
+
+  // Get position for submenu based on the menu item.
+
+  x = getPageOffsetLeft(item) + item.offsetWidth;
+  y = getPageOffsetTop(item);
+
+  // Adjust position to fit in view.
+
+  var maxX, maxY;
+
+  if (browser.isIE) {
+    maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) +
+      (document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth);
+    maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) +
+      (document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight);
+  }
+  if (browser.isOP) {
+    maxX = document.documentElement.scrollLeft + window.innerWidth;
+    maxY = document.documentElement.scrollTop  + window.innerHeight;
+  }
+  if (browser.isNS) {
+    maxX = window.scrollX + window.innerWidth;
+    maxY = window.scrollY + window.innerHeight;
+  }
+  maxX -= item.subMenu.offsetWidth;
+  maxY -= item.subMenu.offsetHeight;
+
+  if (x > maxX)
+    x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
+      + (menu.offsetWidth - item.offsetWidth));
+  y = Math.max(0, Math.min(y, maxY));
+
+  // Position and show the sub menu.
+
+  item.subMenu.style.left       = x + "px";
+  item.subMenu.style.top        = y + "px";
+  item.subMenu.style.visibility = "visible";
+
+  // For IE; size, position and display the menu's IFRAME as well.
+
+  if (item.subMenu.iframeEl != null)
+  {
+    item.subMenu.iframeEl.style.left    = item.subMenu.style.left;
+    item.subMenu.iframeEl.style.top     = item.subMenu.style.top;
+    item.subMenu.iframeEl.style.width   = item.subMenu.offsetWidth + "px";
+    item.subMenu.iframeEl.style.height  = item.subMenu.offsetHeight + "px";
+    item.subMenu.iframeEl.style.display = "";
+  }
+
+  // Stop the event from bubbling.
+
+  if (browser.isIE)
+    window.event.cancelBubble = true;
+  else
+    event.stopPropagation();
+}
+
+function closeSubMenu(menu) {
+
+  if (menu == null || menu.activeItem == null)
+    return;
+
+  // Recursively close any sub menus.
+
+  if (menu.activeItem.subMenu != null) {
+    closeSubMenu(menu.activeItem.subMenu);
+    menu.activeItem.subMenu.style.visibility = "hidden";
+
+    // For IE, hide the sub menu's IFRAME as well.
+
+    if (menu.activeItem.subMenu.iframeEl != null)
+      menu.activeItem.subMenu.iframeEl.style.display = "none";
+
+    menu.activeItem.subMenu = null;
+  }
+
+  // Deactivate the active menu item.
+
+  removeClassName(menu.activeItem, "menuItemHighlight");
+  menu.activeItem = null;
+}
+
+// [MODIFIED] Added for activate/deactivate on mouseover. Handler for mouseout
+// event on buttons and menus.
+
+function buttonOrMenuMouseout(event) {
+
+  var el;
+
+  // If there is no active button, exit.
+
+  if (activeButton == null)
+    return;
+
+  // Find the element the mouse is moving to.
+
+  if (browser.isIE)
+    el = window.event.toElement;
+  else if (event.relatedTarget != null)
+      el = (event.relatedTarget.tagName ? event.relatedTarget : event.relatedTarget.parentNode);
+
+  // If the element is not part of a menu, reset the active button.
+
+  if (getContainerWith(el, "DIV", "menu") == null) {
+    resetButton(activeButton);
+    activeButton = null;
+  }
+}
+
+// [END MODIFIED]
+
+//----------------------------------------------------------------------------
+// Code to initialize menus.
+//----------------------------------------------------------------------------
+
+function menuInit(menu) {
+
+  var itemList, spanList;
+  var textEl, arrowEl;
+  var itemWidth;
+  var w, dw;
+  var i, j;
+
+  // For IE, replace arrow characters.
+
+  if (browser.isIE) {
+    menu.style.lineHeight = "2.5ex";
+    spanList = menu.getElementsByTagName("SPAN");
+    for (i = 0; i < spanList.length; i++)
+      if (hasClassName(spanList[i], "menuItemArrow")) {
+        spanList[i].style.fontFamily = "Webdings";
+        spanList[i].firstChild.nodeValue = "4";
+      }
+  }
+
+  // Find the width of a menu item.
+
+  itemList = menu.getElementsByTagName("A");
+  if (itemList.length > 0)
+    itemWidth = itemList[0].offsetWidth;
+  else
+    return;
+
+  // For items with arrows, add padding to item text to make the
+  // arrows flush right.
+
+  for (i = 0; i < itemList.length; i++) {
+    spanList = itemList[i].getElementsByTagName("SPAN");
+    textEl  = null;
+    arrowEl = null;
+    for (j = 0; j < spanList.length; j++) {
+      if (hasClassName(spanList[j], "menuItemText"))
+        textEl = spanList[j];
+      if (hasClassName(spanList[j], "menuItemArrow"))
+        arrowEl = spanList[j];
+    }
+    if (textEl != null && arrowEl != null) {
+      textEl.style.paddingRight = (itemWidth 
+        - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
+      // For Opera, remove the negative right margin to fix a display bug.
+      if (browser.isOP)
+        arrowEl.style.marginRight = "0px";
+    }
+  }
+
+  // Fix IE hover problem by setting an explicit width on first item of
+  // the menu.
+
+  if (browser.isIE) {
+    w = itemList[0].offsetWidth;
+    itemList[0].style.width = w + "px";
+    dw = itemList[0].offsetWidth - w;
+    w -= dw;
+    itemList[0].style.width = w + "px";
+  }
+
+  // Fix the IE display problem (SELECT elements and other windowed controls
+  // overlaying the menu) by adding an IFRAME under the menu.
+
+  if (browser.isIE) {
+    menu.iframeEl = menu.parentNode.insertBefore(document.createElement("IFRAME"), menu);
+    menu.iframeEl.style.display = "none";
+    menu.iframeEl.style.position = "absolute";
+  }
+
+  // Mark menu as initialized.
+
+  menu.isInitialized = true;
+}
+
+//----------------------------------------------------------------------------
+// General utility functions.
+//----------------------------------------------------------------------------
+
+function getContainerWith(node, tagName, className) {
+
+  // Starting with the given node, find the nearest containing element
+  // with the specified tag name and style class.
+
+  while (node != null) {
+    if (node.tagName != null && node.tagName == tagName &&
+        hasClassName(node, className))
+      return node;
+    node = node.parentNode;
+  }
+
+  return node;
+}
+
+function hasClassName(el, name) {
+
+  var i, list;
+
+  // Return true if the given element currently has the given class
+  // name.
+
+  list = el.className.split(" ");
+  for (i = 0; i < list.length; i++)
+    if (list[i] == name)
+      return true;
+
+  return false;
+}
+
+function removeClassName(el, name) {
+
+  var i, curList, newList;
+
+  if (el.className == null)
+    return;
+
+  // Remove the given class name from the element's className property.
+
+  newList = new Array();
+  curList = el.className.split(" ");
+  for (i = 0; i < curList.length; i++)
+    if (curList[i] != name)
+      newList.push(curList[i]);
+  el.className = newList.join(" ");
+}
+
+function getPageOffsetLeft(el) {
+
+  var x;
+
+  // Return the x coordinate of an element relative to the page.
+
+  x = el.offsetLeft;
+  if (el.offsetParent != null)
+    x += getPageOffsetLeft(el.offsetParent);
+
+  return x;
+}
+
+function getPageOffsetTop(el) {
+
+  var y;
+
+  // Return the x coordinate of an element relative to the page.
+
+  y = el.offsetTop;
+  if (el.offsetParent != null)
+    y += getPageOffsetTop(el.offsetParent);
+
+  return y;
+}
+
+//]]>

Added: trunk/direct.openmoko.com/admin/includes/modules/account_details.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/modules/account_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/modules/account_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,496 @@
+<?php
+/*
+  $Id: account_details.php,v 1.1.1.1 2004/03/04 23:40:22 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  THIS IS BETA - Use at your own risk!
+  Step-By-Step Manual Order Entry Verion 0.5
+  Customer Entry through Admin
+*/
+
+  $newsletter_array = array(array('id' => '1',
+                                  'text' => ENTRY_NEWSLETTER_YES),
+                            array('id' => '0',
+                                  'text' => ENTRY_NEWSLETTER_NO));
+
+function sbs_get_zone_name($country_id, $zone_id) {
+    $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . $country_id . "' and zone_id = '" . $zone_id . "'");
+    if (tep_db_num_rows($zone_query)) {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_name'];
+    } else {
+      return $default_zone;
+    }
+  }
+
+ // Returns an array with countries
+// TABLES: countries
+  function sbs_get_countries($countries_id = '', $with_iso_codes = false) {
+    $countries_array = array();
+    if ($countries_id) {
+      if ($with_iso_codes) {
+        $countries = tep_db_query("select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "' order by countries_name");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name'],
+                                 'countries_iso_code_2' => $countries_values['countries_iso_code_2'],
+                                 'countries_iso_code_3' => $countries_values['countries_iso_code_3']);
+      } else {
+        $countries = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "'");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name']);
+      }
+    } else {
+      $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name");
+      while ($countries_values = tep_db_fetch_array($countries)) {
+        $countries_array[] = array('countries_id' => $countries_values['countries_id'],
+                                   'countries_name' => $countries_values['countries_name']);
+      }
+    }
+
+    return $countries_array;
+  }
+  ////
+function sbs_get_country_list($name, $selected = '', $parameters = '') {
+   $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
+   $countries = sbs_get_countries();
+   $size = sizeof($countries);
+   for ($i=0; $i<$size; $i++) {
+     $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
+   }
+
+   return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
+}
+
+
+////
+// Alias function to tep_get_countries, which also returns the countries iso codes
+// /* function tep_get_countries_with_iso_codes($countries_id) {
+//    return tep_get_countries($countries_id, true);
+//  }*/
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    $male = ($account['customers_gender'] == 'm') ? true : false;
+    $female = ($account['customers_gender'] == 'f') ? true : false;
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_GENDER; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo ($account['customers_gender'] == 'm') ? MALE : FEMALE;
+    } elseif ($error) {
+      if ($entry_gender_error) {
+        echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_ERROR;
+      } else {
+        echo ($gender == 'm') ? MALE : FEMALE;
+        echo tep_draw_hidden_field('gender');
+      }
+    } else {
+      echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_firstname'];
+  } elseif ($error) {
+    if ($entry_firstname_error) {
+      echo tep_draw_input_field('firstname') . '&nbsp;' . ENTRY_FIRST_NAME_ERROR;
+    } else {
+      echo $firstname . tep_draw_hidden_field('firstname');
+    }
+  } else {
+    echo tep_draw_input_field('firstname', $account['customers_firstname']) . '&nbsp;' . ENTRY_FIRST_NAME_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_lastname'];
+  } elseif ($error) {
+    if ($entry_lastname_error) {
+      echo tep_draw_input_field('lastname') . '&nbsp;' . ENTRY_LAST_NAME_ERROR;
+    } else {
+      echo $lastname . tep_draw_hidden_field('lastname');
+    }
+  } else {
+    echo tep_draw_input_field('lastname', $account['customers_lastname']) . '&nbsp;' . ENTRY_LAST_NAME_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_DOB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo tep_date_short($account['customers_dob']);
+    } elseif ($error) {
+      if ($entry_date_of_birth_error) {
+        echo tep_draw_input_field('dob') . '&nbsp;' . ENTRY_DATE_OF_BIRTH_ERROR;
+      } else {
+        echo $dob . tep_draw_hidden_field('dob');
+      }
+    } else {
+      echo tep_draw_input_field('dob', tep_date_short($account['customers_dob'])) . '&nbsp;' . ENTRY_DATE_OF_BIRTH_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_email_address'];
+  } elseif ($error) {
+    if ($entry_email_address_error) {
+      echo tep_draw_input_field('email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR;
+    } elseif ($entry_email_address_check_error) {
+      echo tep_draw_input_field('email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
+    } elseif ($entry_email_address_exists) {
+      echo tep_draw_input_field('email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
+    } else {
+      echo $email_address . tep_draw_hidden_field('email_address');
+    }
+  } else {
+    echo tep_draw_input_field('email_address', $account['customers_email_address']) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_TEXT;
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_COMPANY; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_COMPANY; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo $account['entry_company'];
+    } elseif ($error) {
+      if ($entry_company_error) {
+        echo tep_draw_input_field('company') . '&nbsp;' . ENTRY_COMPANY_ERROR;
+      } else {
+        echo $company . tep_draw_hidden_field('company');
+      }
+    } else {
+      echo tep_draw_input_field('company', $account['entry_company']) . '&nbsp;' . ENTRY_COMPANY_TEXT;
+    }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  }
+?>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_ADDRESS; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['entry_street_address'];
+  } elseif ($error) {
+    if ($entry_street_address_error) {
+      echo tep_draw_input_field('street_address') . '&nbsp;' . ENTRY_STREET_ADDRESS_ERROR;
+    } else {
+      echo $street_address . tep_draw_hidden_field('street_address');
+    }
+  } else {
+    echo tep_draw_input_field('street_address', $account['entry_street_address']) . '&nbsp;' . ENTRY_STREET_ADDRESS_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_SUBURB; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo $account['entry_suburb'];
+    } elseif ($error) {
+      if ($entry_suburb_error) {
+        echo tep_draw_input_field('suburb') . '&nbsp;' . ENTRY_SUBURB_ERROR;
+      } else {
+        echo $suburb . tep_draw_hidden_field('suburb');
+      }
+    } else {
+      echo tep_draw_input_field('suburb', $account['entry_suburb']) . '&nbsp;' . ENTRY_SUBURB_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['entry_postcode'];
+  } elseif ($error) {
+    if ($entry_post_code_error) {
+      echo tep_draw_input_field('postcode') . '&nbsp;' . ENTRY_POST_CODE_ERROR;
+    } else {
+      echo $postcode . tep_draw_hidden_field('postcode');
+    }
+  } else {
+    echo tep_draw_input_field('postcode', $account['entry_postcode']) . '&nbsp;' . ENTRY_POST_CODE_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_CITY; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['entry_city'];
+  } elseif ($error) {
+    if ($entry_city_error) {
+      echo tep_draw_input_field('city') . '&nbsp;' . ENTRY_CITY_ERROR;
+    } else {
+      echo $city . tep_draw_hidden_field('city');
+    }
+  } else {
+    echo tep_draw_input_field('city', $account['entry_city']) . '&nbsp;' . ENTRY_CITY_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STATE; ?></td>
+            <td class="main">&nbsp;
+<?php
+    $state = sbs_get_zone_name($country, $zone_id);
+    if ($is_read_only) {
+      echo sbs_get_zone_name($account['entry_country_id'], $account['entry_zone_id']);
+    } elseif ($error) {
+      if ($entry_state_error) {
+        if ($entry_state_has_zones) {
+          $zones_array = array();
+          $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' order by zone_name");
+          while ($zones_values = tep_db_fetch_array($zones_query)) {
+            $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+          }
+          echo tep_draw_pull_down_menu('state', $zones_array) . '&nbsp;' . ENTRY_STATE_ERROR;
+        } else {
+          echo tep_draw_input_field('state') . '&nbsp;' . ENTRY_STATE_ERROR;
+        }
+      } else {
+        if ($error) {
+            echo tep_draw_input_field('state') . tep_draw_hidden_field('zone_id') . tep_draw_hidden_field('state');
+          //echo $state . tep_draw_hidden_field('zone_id') . tep_draw_hidden_field('state');
+        }
+      }
+    } else {
+      echo tep_draw_input_field('state', sbs_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state'])) . '&nbsp;' . ENTRY_STATE_TEXT;
+    }
+?>
+</td>
+             </tr>
+<?php
+     }
+?>
+             <tr>
+               <td class="main">&nbsp;<?php echo ENTRY_COUNTRY; ?></td>
+               <td class="main">&nbsp;
+<?php
+  $account['entry_country_id'] = STORE_COUNTRY;
+   if ($is_read_only) {    
+    echo tep_get_country_name($account['entry_country_id']); 
+  }elseif ($error) {
+    if ($entry_country_error) {
+      echo sbs_get_country_list('country') . '&nbsp;' . ENTRY_COUNTRY_ERROR;
+    } else {
+    //    echo tep_draw_input_field('country') . tep_draw_hidden_field('state');
+      echo sbs_get_country_list('country');
+    }
+  } else {
+     echo sbs_get_country_list('country', $account['entry_country_id']) . '&nbsp;' . ENTRY_COUNTRY_TEXT;
+  }
+?>
+</td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_CONTACT; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_telephone'];
+  } elseif ($error) {
+    if ($entry_telephone_error) {
+      echo tep_draw_input_field('telephone') . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_ERROR;
+    } else {
+      echo $telephone . tep_draw_hidden_field('telephone');
+    }
+  } else {
+    echo tep_draw_input_field('telephone', $account['customers_telephone']) . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FAX_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_fax'];
+  } elseif ($error) {
+    if ($entry_fax_error) {
+      echo tep_draw_input_field('fax');
+    } else {
+      echo $fax . tep_draw_hidden_field('fax');
+    }
+  } else {
+    echo tep_draw_input_field('fax', $account['customers_fax']);
+  }
+?>
+</td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_OPTIONS; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_NEWSLETTER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    if ($account['customers_newsletter'] == '1') {
+      echo ENTRY_NEWSLETTER_YES;
+    } else {
+      echo ENTRY_NEWSLETTER_NO;
+    }
+  } elseif ($processed) {
+    if ($newsletter == '1') {
+      echo ENTRY_NEWSLETTER_YES;
+    } else {
+      echo ENTRY_NEWSLETTER_NO;
+    }
+    echo tep_draw_hidden_field('newsletter');
+  } else {
+    echo tep_draw_pull_down_menu('newsletter', $newsletter_array, $account['customers_newsletter']) . '&nbsp;' . ENTRY_NEWSLETTER_TEXT;
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php 
+/*
+  if (!$is_read_only) {
+?>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_PASSWORD; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_PASSWORD; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($error) {
+      if ($entry_password_error) {
+        echo tep_draw_password_field('password') . '&nbsp;' . ENTRY_PASSWORD_ERROR;
+      } else {
+        echo PASSWORD_HIDDEN . tep_draw_hidden_field('password') . tep_draw_hidden_field('confirmation');
+      }
+    } else {
+      echo tep_draw_password_field('password') . '&nbsp;' . ENTRY_PASSWORD_TEXT;
+    }
+?></td>
+         </tr>
+<?php
+    if ( (!$error) || ($entry_password_error) ) {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+            <td class="main">&nbsp;
+<?php
+      echo tep_draw_password_field('confirmation') . '&nbsp;' . ENTRY_PASSWORD_CONFIRMATION_TEXT;
+?></td>
+          </tr>
+<?php
+    }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+*/ ?>
+
+<?php
+ // }
+?>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/FraudScreenClient.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/FraudScreenClient.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/FraudScreenClient.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,366 @@
+<?php
+
+/* FraudScreenClient.php
+ *
+ * Copyright (C) 2004-2005 AlgoZone, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+$API_VERSION = 'PHP/1.2';
+class FraudScreenClient{
+  var $server;
+  var $numservers;
+  var $url;
+  var $params;
+  var $allowed_fields;
+  var $num_allowed_fields;
+  var $outputstr;
+  var $isSecure;
+  var $timeout;
+  var $debug;
+  
+  var $proxy_host; // if using code that has to pass thru proxy
+  var $proxy_port;
+    
+  function FraudScreenClient() {
+  
+    $this->isSecure = 1;    // use HTTPS by default
+    $this->num_allowed_fields = 8;
+
+    //set the allowed_fields hash
+    $this->allowed_fields["ip"] = 1;
+    $this->allowed_fields["email_domain"] = 1;
+    $this->allowed_fields["city"] = 1;
+    $this->allowed_fields["region"] = 1;
+    $this->allowed_fields["postal_code"] = 1;
+    $this->allowed_fields["country"] = 1;
+    $this->allowed_fields["bin"] = 1;
+    $this->allowed_fields["bank_name"] = 1;
+    $this->allowed_fields["bank_phone"] = 1;
+    $this->allowed_fields["customer_phone"] = 1;
+    $this->allowed_fields["requestor_license_key"] = 1;
+    $this->allowed_fields["request_type"] = 1;
+
+    //set the url of the web service
+    $this->server = array("fraudscreen1.algozone.com","fraudscreen2.algozone.com","fraudscreen.algozone.com");
+    $this->numservers = sizeof($this->server);
+    $this->url = "index.php";
+
+  }
+
+  // this function sets the allowed fields
+  function set_allowed_fields($i) {
+    $this->allowed_fields = $i;
+    $this->num_allowed_fields = count($i);
+  }
+
+  //this function queries the servers
+  function query() {
+    //query every server in the list
+    $server_list = $this->server;
+    print "<br>";
+    for ($i = 0; $i < $this->numservers; $i++ ) {
+      $result = $this->queryServer($this->server[$i]);
+      if ($this->debug == 1) {
+        //print "<p><b>AFS <i>" . $this->server[$i] . "</i> query result: </b>" . $result . "<br>";
+        print "<p><b>".FRAUDSCREENCLIENT_AFS." <i>" . $this->server[$i] . "</i> ".FRAUDSCREENCLIENT_QUERY_RESULT.": </b>" . $result . "<br>";
+      }
+      if ($this->outputstr['afs_version'] != "" && ($result ==1 || $this->outputstr['err_message'] != "")) {
+        return $result;
+      }
+    }
+    
+   // $this->outputstr['err_message'] = "Algozone Fraud Screen Server currently unavailable. Please try again later.";
+
+    //$this->outputstr['err_message'] = "Algozone Fraud Screen Server currently unavailable. Please try again later.";
+    $this->outputstr['err_message'] = FRAUDSCREENCLIENT_SERVER_UNAVAILABLE;
+    return 0;
+  }
+
+  //this function takes a input hash and stores it in the hash named queries
+  function input($vars) {
+    $numinputkeys = count($vars);  // get the number of keys in the input hash
+    $inputkeys = array_keys($vars);   // get a array of keys in the input hash
+    if($numinputkeys >0){
+        if ($this->debug == 1) {
+          //print "<br><b>AFS Inputs:</b>";
+          print "<br><b>".FRAUDSCREENCLIENT_AFS_INPUTS.":</b>";
+      }
+    }
+    for ($i = 0; $i < $numinputkeys; $i++) {
+      $key = $inputkeys[$i];
+      if ($this->allowed_fields[$key] == 1) {
+        //if key is a allowed field then store it in 
+        //the hash named queries
+        if ($this->debug == 1) {
+          //print "<br>input $key = " . $vars[$key] . "";
+          print "<br>".FRAUDSCREENCLIENT_INPUT." $key = " . $vars[$key] . "";
+      }
+        $this->params[$key] = urlencode($vars[$key]);
+      } else {
+        //print "<br>invalid input $key - perhaps misspelled field?";
+        print "<br>".FRAUDSCREENCLIENT_INVALID_INPUT.$key .FRAUDSCREENCLIENT_MISSPELLED_FIELD;
+      return 0;
+      }
+    }
+    $this->params["clientAPI"] = $GLOBALS['API_VERSION'];
+  }
+
+  //this function returns the output from the server
+  function output() {
+    return $this->outputstr; 
+  }
+
+  //this function query a single server
+  function queryServer($server) {
+
+    //check if we using the Secure HTTPS proctol
+    if ($this->isSecure == 1) {
+      $scheme = "https://";  //Secure HTTPS proctol
+    } else {
+      $scheme = "http://";   //Regular HTTP proctol
+    }
+
+    //build a query string from the hash called queries
+    $numquerieskeys = count($this->params);//get the number of keys in the hash called queries
+    $querieskeys = array_keys($this->params);//get a array of keys in the hash called queries
+    if ($this->debug == 1) {
+//      print "<p>number of query keys " + $numquerieskeys + "<p>";
+    }
+    for ($i = 0; $i < $numquerieskeys; $i++) {
+      //for each element in the hash called queries 
+      //append the key and value of the element to the query string
+      $key = $querieskeys[$i];
+      $value = $this->params[$key];
+
+      $query_string = $query_string . $key . "=" . $value;
+      if ($i < $numquerieskeys - 1) {
+        $query_string = $query_string . "&";
+      }
+    }
+    
+    $content = "";
+
+    //check if the curl module exists
+    if (extension_loaded('curl') && $this->proxy_port != '') {
+      //use curl
+      if ($this->debug == 1) {
+        //print "<p><b>AFS using curl</b>";
+        print "<p><b>".FRAUDSCREENCLIENT_AFS_USING_CURL."</b>";
+      }
+
+      //open curl
+      $ch = curl_init();
+
+      $url = $scheme . $server . "/" . $this->url;
+
+      if ($this->debug == 1) {
+       // print "<p><b>AFS curl params: ".$url."?".$query_string."</b>";
+        print "<p><b>".FRAUDSCREENCLIENT_AFS_CURL_PARAMS.": ".$url."?".$query_string."</b>";
+      }
+
+      //set curl options
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_URL, $url);
+      curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
+
+      //this option lets you store the result in a string 
+      curl_setopt($ch, CURLOPT_POST,          1);
+      curl_setopt($ch, CURLOPT_POSTFIELDS,    $query_string);
+
+      //get the content
+      $content = curl_exec($ch);
+
+      // For some reason curl_errno returns an error even when function works
+      // Until we figure this out, will ignore curl errors - (not good i know)
+      $e = curl_errno($ch);//get error or sucess
+
+      if (($e == 1) && ($this->isSecure == 1)) {
+        // HTTPS does not work print error message
+          //print "<br>error: this version of curl does not support HTTPS try build curl with SSL or specify \$ccfs->isSecure = 0\n";
+          print FRAUDSCREENCLIENT_AFS_CURL_NOT_SUPPORT." \$ccfs->isSecure = 0\n";
+      }
+      if ($e > 0) {
+        //we get a error msg print it
+        if ($this->debug == 1) {
+          //print "<p>Received error message $e from curl: " . curl_error($ch) . "\n";
+          print "<p>".FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_1." $e ".FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_2.": " . curl_error($ch) . "\n";
+       }
+      return 0;
+      }
+      //close curl
+      curl_close($ch);
+     
+    } else if (extension_loaded('curl')) {
+      //use curl
+      if ($this->debug == 1) {
+        //print "<p>using curl thru proxy";
+        print FRAUDSCREENCLIENT_AFS_CURL_PROXY;
+      }
+
+      //open curl
+      $ch = curl_init();
+
+      $url = $scheme . $server . "/" . $this->url;
+
+      if ($this->debug == 1) {
+        //print "<p><b>AFS curl params: </b>".$url."?".$query_string;
+        print "<p><b>".FRAUDSCREENCLIENT_AFS_CURL_PARAMS.": </b>".$url."?".$query_string;
+      }
+
+      //set curl options
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_URL, $url);
+      curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
+
+     curl_setopt($ch,CURLOPT_PROXY,$this->proxy_host); 
+     curl_setopt($ch,CURLOPT_PROXY_PORT,$this->proxy_port); 
+
+      //this option lets you store the result in a string 
+      curl_setopt($ch, CURLOPT_POST,          1);
+      curl_setopt($ch, CURLOPT_POSTFIELDS,    $query_string);
+
+      //get the content
+      $content = curl_exec($ch);
+
+      // For some reason curl_errno returns an error even when function works
+      // Until we figure this out, will ignore curl errors - (not good i know)
+      $e = curl_errno($ch);//get error or sucess
+
+      if (($e == 1) && ($this->isSecure == 1)) {
+        // HTTPS does not work print error message
+         // print "<br>error: this version of curl does not support HTTPS try build curl with SSL or specify \$ccfs->isSecure = 0\n";
+          print FRAUDSCREENCLIENT_AFS_CURL_NOT_SUPPORT." \$ccfs->isSecure = 0\n";
+      }
+      if ($e > 0) {
+        if ($this->debug == 1) {
+          //print "<p>Received error message $e from curl: " . curl_error($ch) . "\n";
+          print "<p>".FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_1." $e ".FRAUDSCREENCLIENT_AFS_RECEIVED_ERROR_MESSAGE_2.": " . curl_error($ch) . "\n";
+      }
+      return 0;
+      }
+      //close curl
+      curl_close($ch);
+     
+    } else {
+      //curl does not exist
+      //use the fsockopen function, 
+      //the fgets function and the fclose function
+
+      if ($this->debug == 1) {
+       // print "<p><b>AFS using fsockopen</b>";
+        print FRAUDSCREENCLIENT_AFS_USING_FSOCKOPEN;
+      }
+
+      $url = $scheme . $server . "/" . $this->url . "?" . $query_string;
+      if ($this->debug == 1) {
+       // print "<p><table width=100><tr><td><b>AFS socket url param: </b>" . $url . " " . "</td></tr></table>";
+        print "<p><table width=100><tr><td><b>".FRAUDSCREENCLIENT_AFS_SOCKET_PARAM.": </b>" . $url . " " . "</td></tr></table>";
+      }
+
+      //now check if we are using regular HTTP
+      if ($this->isSecure == 0) {
+      
+       //we using regular HTTP
+
+        //parse the url to get
+        //host, path and query
+        $url3 = parse_url($url);
+        $host = $url3["host"];
+        $path = $url3["path"] . "?" . $url3["query"];
+      $port = 80;
+
+      if(!empty($this->proxy_host) && !empty($this->proxy_port))
+      {
+        $this->_isproxy = true;
+        
+        $host = $this->proxy_host;
+        $port = $this->proxy_port;
+
+          if ($this->debug == 1) {
+           //print "<p><b>AFS using fsockopen proxy<b><br>";
+           print FRAUDSCREENCLIENT_AFS_FSOCKOPEN_PROXY;
+          }
+      }
+      else if(!empty($this->proxy_host))
+      {
+           //print "<br>error: you need to provide the proxy port number to use the proxy port provided";
+           print FRAUDSCREENCLIENT_AFS_PROXY_PORT;
+      }
+
+        //open the connection
+        $fp = @ fsockopen ($host, $port, $errno, $errstr, $this->timeout);
+        if ($fp) {
+          //send the request
+          fputs ($fp, "GET $path HTTP/1.0\nHost: " . $host . "\n\n");
+          while (!feof($fp)) {
+            $buf .= fgets($fp, 128);
+          }
+          $lines = split("\n", $buf);
+          
+        // get the content
+          $content = $lines[count($lines)-1];
+        
+          //close the connection
+          fclose($fp);
+        } else {
+          return 0;
+      }
+      } else {
+        //secure HTTPS requires CURL
+       // print "<br>error: you need to install curl if you want secure HTTPS or specify the variable to be $ccfs->isSecure = 0";
+        print FRAUDSCREENCLIENT_AFS_INSTALL_CURL." $ccfs->isSecure = 0";
+        return 0;
+      }
+    }
+    
+    // get the keys and values from
+    // the string content and store them
+    // the hash named outputstr
+
+    // split content into pairs containing both 
+    // the key and the value
+    $keyvaluepairs = explode(";",$content);
+
+    //get the number of key and value pairs
+    $numkeyvaluepairs = count($keyvaluepairs);
+
+    //for each pair store key and value into the
+    //hash named outputstr
+    if ($this->debug == 1) {
+     // print "<p><b>AFS query results: </b>";
+      print FRAUDSCREENCLIENT_AFS_QUERY_RESULTS;
+    }
+    for ($i = 0; $i < $numkeyvaluepairs; $i++) {
+      //split the pair into a key and a value
+      list($key,$value) = explode("=",$keyvaluepairs[$i]);
+      if ($this->debug == 1) {
+        //print "<br> output " . $key . " = " . $value . "\n";
+        print "<br> ".FRAUDSCREENCLIENT_AFS_OUTPUT." " . $key . " = " . $value . "\n";
+      }
+      //store the key and the value into the
+      //hash named outputstr
+      $this->outputstr[$key] = $value;
+    }
+    //check if outputstr has the score if outputstr does not have 
+    //the score return 0
+    if ($this->outputstr['err_message'] != "") {
+      return 0;
+    }
+    return 1;
+  }
+}
+?>

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/algo_fraud_screener.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/algo_fraud_screener.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/algo_fraud_screener.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,544 @@
+<?php
+/*
+  $Id: algo_fraud_screener.php,v 1.0 2005/01/09 08:58:51 hpdl Exp $
+  For osCommerce, Open Source E-Commerce Solutions
+  
+  http://www.algozone.com
+  Copyright (c) 2005 AlgoZone, Inc.
+  Released under the GNU General Public License 
+*/
+
+
+ // this function sets the allowed fields
+  function image_guage($r) {
+    $f  = floatval($r);
+    $r  = intval($r);
+    $g  = 10 - $r;
+    $rg = $f - $r;
+    
+    $j=0;
+    while($j<$r){
+      $c .= tep_image(DIR_WS_MODULES . 'afs_v1.0/images/r5g0.gif', "");
+      $j++;
+    }
+    
+    if     ($rg >= 0.0  && $rg <= 0.25){ $c .= tep_image(DIR_WS_MODULES . 'afs_v1.0/images/r1g4.gif', ""); }
+    else if($rg >  0.25 && $rg <= 0.5 ){ $c .= tep_image(DIR_WS_MODULES . 'afs_v1.0/images/r2g3.gif', ""); }  
+    else if($rg >  0.5  && $rg <= 0.75){ $c .= tep_image(DIR_WS_MODULES . 'afs_v1.0/images/r3g2.gif', ""); }  
+    else if($rg >  0.75 && $rg <= 1.00){ $c .= tep_image(DIR_WS_MODULES . 'afs_v1.0/images/r4g1.gif', "");  }  
+    
+    $j=0;
+    while($j<$g){
+      $c .= tep_image(DIR_WS_MODULES . 'afs_v1.0/images/r0g5.gif', "");
+      $j++;
+    }
+    return $c;
+  }
+
+// Make modifications here:
+
+  if (!defined('FS_ENABLE') || FS_ENABLE == 'false' ) {
+    return;
+  }
+  else{
+
+    include(DIR_WS_LANGUAGES . $language . '/algo_fraud_screener.php');
+    $remaining_queries = FS_REQREM;
+
+// *************************************DO NOT MODIFY BELOW THIS LINE (Unless you know what you are doing **********************************     
+
+$check_country_query = tep_db_query("select countries_iso_code_2 from " . TABLE_COUNTRIES . " where countries_name = '" . $order->billing['country'] . "'");
+$check_country = tep_db_fetch_array($check_country_query);
+
+$check_state_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_name = '" . $order->billing['state'] . "'");
+$check_state = tep_db_fetch_array($check_state_query);
+
+$check_fraud_screen_query = tep_db_query("select ip_address, fraud_level, bank_name, bank_phone, err_message from algozone_fraud_queries where order_id = '" . (int)$oID . "'");
+$fraud_screen_query = tep_db_fetch_array($check_fraud_screen_query);
+
+// run fraud screen on order if it has not been done before
+$az_run_fquery = $HTTP_GET_VARS['az_run_fquery'];
+// run fraud screen on order if it has not been done before for BIN information
+$az_run_bquery = $HTTP_GET_VARS['az_run_bquery'];
+
+if($fraud_screen_query['ip_address'] != '' && ($az_run_fquery == 'true' || $az_run_bquery == 'true' || ( $fraud_screen_query['fraud_level'] == '' && $fraud_screen_query['err_message'] == '')))
+{
+
+// Pull bank information 
+if ($az_run_bquery == 'true')
+{
+  $fraud_screen_query['bank_name'] = tep_db_prepare_input($HTTP_POST_VARS['bank_name']);
+  $fraud_screen_query['bank_phone'] = tep_db_prepare_input($HTTP_POST_VARS['bank_phone']);
+}
+
+require(DIR_WS_MODULES . 'afs_v1.0/FraudScreenClient.php');
+$afsc = new FraudScreenClient;
+
+//Modify a few variables to match what AlgoZone Fraud Screen is expecting.
+$string = $order->info['cc_number'];
+$cc = substr($string, 0, 6); 
+
+$str = $order->customer['email_address'];
+list ($addy, $domain) = split ('[@]', $str);
+
+$phstr = preg_replace( '/[^0123456789]/', '', $order->customer['telephone']);
+$phone = substr($phstr, 0, 6);
+
+//next we set inputs and store them in a hash
+$h["ip"]                    = $fraud_screen_query['ip_address'];     // set the client ip address
+$h["requestor_license_key"] = FS_LICENSE;                            // set the client ip address
+$h["email_domain"]          = $domain;                      // set the Email domain 
+$h["city"]                  = $order->billing['city'];              // set the billing city
+$h["region"]                = $check_state['zone_code'];           // set the billing state
+$h["postal_code"]           = $order->billing['postcode'];          // set the billing zip code
+$h["country"]               = $check_country['countries_iso_code_2'];// set the billing country
+$h["bin"]                   = $cc;                         // set bank identification number
+$h["bank_name"]             = $fraud_screen_query['bank_name'];           // set bank name on cc 
+$h["bank_phone"]            = $fraud_screen_query['bank_phone'];          // set bank phone as seen on  back of cc
+$h["customer_phone"]        = $phone;                         //set customer phone number
+$h["request_type"]          = "basic";                            //set customer phone number
+
+// If you have cURL and an SSL connection available, leave the next line uncommented
+// Otherwise comment it our by adding "//" in front of it.
+$afsc->isSecure = (FS_SECURE=="true")?1:0;
+
+//set the time out to be five seconds
+$afsc->timeout = 5;
+
+//uncomment to turn on debugging
+$afsc->debug = (FS_DEBUG=="true")?1:0;
+
+$afsc->input($h);
+
+$afsc->query();
+
+$h = $afsc->output();
+
+  // do not update current info, if error occurs
+  if($h['err_message'] == ''){
+    $sql_data_array = array( 'fraud_level'        => $h['fraud_level'],
+                         'err_message'             => $h['err_message'],
+                         'last_date_queried'       => 'now()',
+                  
+                         'distance_m'              => $h['distance_m'],
+                         'distance_k'              => $h['distance_k'],
+                         'is_country_match'        => $h['is_country_match'],
+                         'is_high_risk_country'    => $h['is_high_risk_country'],
+                         'country_code'            => $h['country_code'],
+                         'is_free_email'            => $h['is_free_email'],
+                         'is_anonymous_proxy'      => $h['is_anonymous_proxy'],
+                         'is_customer_phone_inloc' => $h['is_customer_phone_inloc'],
+                  
+                         'bin_country_code'        => $h['bin_country_code'],
+                         'is_bin_match'            => $h['is_bin_match'],
+                         'is_bank_name_match'      => $h['is_bank_name_match'],
+                         'bank_name'               => $fraud_screen_query['bank_name'],
+                         'is_bank_phone_match'     => $h['is_bank_phone_match'],
+                         'bank_phone'              => $fraud_screen_query['bank_phone'],
+                  
+                         'proxy_level'             => $h['proxy_level'],
+                         'spam_level'              => $h['spam_level'],
+                  
+                         'ip_city'                 => $h['ip_city'],
+                         'ip_region'               => $h['ip_region'],
+                         'ip_latitude'             => $h['ip_latitude'],
+                         'ip_longitude'            => $h['ip_longitude'],
+                         'ip_isp'                  => $h['ip_isp'],
+                         'ip_org'                  => $h['ip_org']);
+  }                 
+  else{
+    $sql_data_array = array('err_message'             => $h['err_message'],
+                             'last_date_queried'       => 'now()');
+  }
+  tep_db_perform("algozone_fraud_queries", $sql_data_array, 'update', 'order_id='.$oID);
+
+  if($h['remaining_queries']<>''){
+    $config_array = array( 'configuration_value' => $h['remaining_queries']);
+    tep_db_perform("configuration", $config_array, 'update', "configuration_key='FS_REQREM'");
+    
+    $remaining_queries = $h['remaining_queries'];
+  }
+} 
+// end run fraud screen on order if it has not been done before
+
+$check_fraud_screen_query = tep_db_query("select * from algozone_fraud_queries where order_id = '" . (int)$oID . "'");
+$fraud_screen_query = tep_db_fetch_array($check_fraud_screen_query);
+
+$max_comment = "";
+if($fraud_screen_query['ip_address'] == ""){
+  //$fraud_screen_query['err_message'] = '*** NO IP ADDRESS RECORDED FOR THIS ORDER';
+  $fraud_screen_query['err_message'] = NO_IP_ADDRESS_RECORDED;
+}
+
+if(is_numeric($fraud_screen_query['fraud_level'])){
+  $max_score = round($fraud_screen_query['fraud_level']);
+  switch ($max_score) {
+    /*
+    case 0:  $max_comment = '(Extremely Low risk)'; break;
+    case 1:  $max_comment = '(Very Low risk)'; break;
+    case 2:  $max_comment = '(Low risk)'; break;
+    case 3:  $max_comment = '(Low risk)'; break;
+    case 4:  $max_comment = '(Low-Medium risk)'; break;
+    case 5:  $max_comment = '(Medium risk)'; break;
+    case 6:  $max_comment = '(Medium-high risk)'; break;
+    case 7:  $max_comment = '<font color=red>(High risk)</font>'; break;
+    case 8:  $max_comment = '<font color=red>(Very High risk)</font>'; break;
+    case 9:  $max_comment = '<font color=red>(Extremely High risk)</font>'; break;
+    case 10: $max_comment = '<font color=red>(HIGH PROBABILITY OF FRAUD)</font>'; break;
+    */
+    case 0:  $max_comment = MAX_COMMENT_0; break;
+    case 1:  $max_comment = MAX_COMMENT_1; break;
+    case 2:  $max_comment = MAX_COMMENT_2; break;
+    case 3:  $max_comment = MAX_COMMENT_3; break;
+    case 4:  $max_comment = MAX_COMMENT_4; break;
+    case 5:  $max_comment = MAX_COMMENT_5; break;
+    case 6:  $max_comment = MAX_COMMENT_6; break;
+    case 7:  $max_comment = MAX_COMMENT_7; break;
+    case 8:  $max_comment = MAX_COMMENT_8; break;
+    case 9:  $max_comment = MAX_COMMENT_9; break;
+    case 10: $max_comment = MAX_COMMENT_10; break;
+
+
+  }
+}
+?>
+<br>
+<table width="800" cellpadding="0" cellspacing="0" border="0" style="border-left:1px solid blue;border-right:1px solid orange">
+<tr>
+  <td>
+    <table width="100%" cellpadding="0" cellspacing="0" >
+    <tr>
+      <td style="background-repeat:repeat-x;background-image:url('<?php echo DIR_WS_MODULES . '/afs_v1.0/images/az_box_header_r.gif'; ?>');">&nbsp;
+      </td>
+      <td width=51 style="background-repeat:no-repeat;background-image:url('<?php echo DIR_WS_MODULES . '/afs_v1.0/images/az_box_header_right.gif'; ?>');" >
+      &nbsp;</td>
+    </tr>
+    </table>
+  </td>
+</tr>
+<tr>
+  <td>
+    <table width="100%" cellpadding="0" cellspacing="0" >
+    <tr>
+      <td width=80% style="border-bottom:1px solid #000000;padding-left:5px">
+      <?php 
+        if($fraud_screen_query['err_message'] != ''){
+          echo '<b><font color=red size="3">'.ERROR.' :&nbsp;&nbsp;&nbsp;' . $fraud_screen_query['err_message'] . '</font></b>'; 
+        }
+        else{
+          echo '<b><font size="3">' . ALGO_FS_FRAUD_LEVEL . '&nbsp;&nbsp;' . $fraud_screen_query['fraud_level'].' ' . image_guage($fraud_screen_query['fraud_level']) . '&nbsp;&nbsp;' . $max_comment . '</font></b>'; 
+        }
+      ?>
+      &nbsp;&nbsp;
+      <?php 
+      if($fraud_screen_query['country_code']=='US'){              
+        echo '<a target=new href="' . tep_href_link(DIR_WS_MODULES . 'afs_v1.0/map.php', 'ip_longitude=' . $fraud_screen_query['ip_longitude'] . '&ip_latitude=' . $fraud_screen_query['ip_latitude']) . '">' . '<img src="'.DIR_WS_MODULES.'/afs_v1.0/images/icon-maps.gif" height=18 width=18 style="padding-top:0px;border:0px" alt="map ip address">' . '</a>';
+      }
+      else{
+        echo '<img src="'.DIR_WS_MODULES.'/afs_v1.0/images/icon-maps.gif" height=18 width=18 style="padding-top:0px;border:0px;display:none;" alt="map ip address">';
+      }
+      ?>
+      <!-- icon Courtesy of www.mapquest.com -->
+      </td>
+      <td style="border-bottom:1px solid #000000;padding-bottom:5px;padding-right:5px;" align=right>
+      <?php echo tep_draw_form('requery', FILENAME_ORDERS, tep_get_all_get_params(array('az_run_bquery','az_run_fquery')) . 'az_run_fquery=true'); ?>
+      &nbsp;<input type="submit" value="Query again" style="background-color:#ffffff;border:1px solid #000000;" onmouseover="this.style.cursor='hand';window.status='';">
+      </form>
+      </td>
+    </tr>
+    </table>
+  </td>
+</tr>
+<tr>
+  <td>
+    <table width="100%" border=0 cellspadding="0">
+      <tr class="dataTableRow">
+        <td width=33% valign=top>
+
+        <table width="100%" border=0 cellspadding="0">
+          <tr class="dataTableRow">
+            <td width="35%" class="dataTableContent">
+            <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_CODE; ?>:<?php echo FS_HELP_COUNTRY_CODE; ?>'; return true;" return true;">
+            <?php echo ALGO_FS_CODE; ?>
+            </a>
+            </td>
+            <td width="1" class="dataTableContent"><b>:</b></td>
+            <td class="dataTableContent" align=left><?php echo $fraud_screen_query['country_code']; ?></td>
+          </tr>
+          <tr class="dataTableRow">
+            <td width="35%" class="dataTableContent">
+            <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_COUNTRY; ?>:<?php echo FS_HELP_COUNTRY_MATCH; ?>'; return true;" return true;">
+            <?php echo ALGO_FS_COUNTRY; ?>
+            </a>
+            </td>
+            <td width="1" class="dataTableContent"><b>:</b></td>
+            <td class="dataTableContent"><?php echo $fraud_screen_query['is_country_match']; ?></td>
+          </tr>
+          <tr class="dataTableRow">
+            <td width="35%" class="dataTableContent">
+            <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_IP_CITY; ?>:<?php echo FS_HELP_CITY; ?>'; return true;" return true;">
+            <?php echo ALGO_FS_IP_CITY; ?>
+            </a>
+            </td>
+            <td width="1" class="dataTableContent"><b>:</b></td>
+            <td class="dataTableContent"><?php echo $fraud_screen_query['ip_city']; ?></td>
+          </tr>
+          <tr class="dataTableRow">
+            <td width="35%" class="dataTableContent">
+            <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_IP_REGION; ?>:<?php echo FS_HELP_REGION; ?>'; return true;" return true;">
+            <?php echo ALGO_FS_IP_REGION; ?>
+            </a>
+            </td>
+            <td width="1" class="dataTableContent"><b>:</b></td>
+            <td class="dataTableContent"><?php echo $fraud_screen_query['ip_region']; ?></td>
+          </tr>
+          <tr class="dataTableRow">
+            <td width="35%" class="dataTableContent">
+            <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_HI_RISK; ?>:<?php echo FS_HELP_IS_HI_RISK_COUNTRY; ?>'; return true;" return true;">
+            <?php echo ALGO_FS_HI_RISK; ?>
+            </a>
+            </td>
+            <td width="1" class="dataTableContent"><b>:</b></td>
+            <td class="dataTableContent"><?php echo $fraud_screen_query['is_high_risk_country']; ?></td>
+          </tr>
+          <tr class="dataTableRow">
+            <td width="35%" class="dataTableContent">
+            <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_DISTANCE; ?>:<?php echo FS_HELP_DISTANCE; ?>'; return true;" return true;">
+            <?php echo ALGO_FS_DISTANCE; ?>
+            </a>
+            </td>
+            <td width="1" class="dataTableContent"><b>:</b></td>
+            <td class="dataTableContent"><?php echo $fraud_screen_query['distance_m'].'/'.$fraud_screen_query['distance_k']; ?></td>
+          </tr>
+          <tr class="dataTableRow">
+            <td width="35%" class="dataTableContent">
+            <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_FREE_EMAIL; ?>:<?php echo FS_HELP_EMAIL; ?>'; return true;" return true;">
+            <?php echo ALGO_FS_FREE_EMAIL; ?>
+            </a>
+            </td>
+            <td width="1" class="dataTableContent"><b>:</b></td>
+            <td class="dataTableContent"><?php echo $fraud_screen_query['is_free_email']; ?></td>
+          </tr>
+          <tr class="dataTableRow">
+            <td width="35%" class="dataTableContent">
+            <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_CUST_PHONE; ?>:<?php echo FS_HELP_PHONE_IN_BILLING_LOC; ?>'; return true;" return true;">
+            <?php echo ALGO_FS_CUST_PHONE; ?>
+            </a>
+            </td>
+            <td width="1" class="dataTableContent"><b>:</b></td>
+            <td class="dataTableContent" align=left><?php echo $fraud_screen_query['is_customer_phone_inloc']; ?></td>
+          </tr>
+        </table>
+
+        </td>
+        <td width=33% valign=top>
+          <table width="100%" border=0>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_IP; ?>:<?php echo FS_HELP_IP; ?>'; return true;">
+              <?php echo ALGO_FS_IP; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent">
+              <?php 
+              if($fraud_screen_query['country_code']=='US'){              
+                  echo '<a target=new href="' . tep_href_link(DIR_WS_MODULES . 'afs_v1.0/map.php', 'ip_longitude=' . $fraud_screen_query['ip_longitude'] . '&ip_latitude=' . $fraud_screen_query['ip_latitude']) . '">' . $fraud_screen_query['ip_address'] . '</a>';
+                }
+                else{
+                echo $fraud_screen_query['ip_address']; 
+              }
+              ?>
+              </td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_IP_ISP; ?>:<?php echo FS_HELP_ISP; ?>'; return true;">
+              <?php echo ALGO_FS_IP_ISP; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['ip_isp']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_IP_ISP_ORG; ?>:<?php echo FS_HELP_ORG; ?>'; return true;">
+              <?php echo ALGO_FS_IP_ISP_ORG; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['ip_org']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_ANONYMOUS; ?>:<?php echo FS_HELP_ANONYMOUS_IP; ?>'; return true;">
+              <?php echo ALGO_FS_ANONYMOUS; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['is_anonymous_proxy']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_PROXY_LEVEL; ?>:<?php echo FS_HELP_PROXY_LEVEL; ?>'; return true;">
+              <?php echo ALGO_FS_PROXY_LEVEL; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['proxy_level']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_SPAM; ?>:<?php echo FS_HELP_SPAM_LEVEL; ?>'; return true;">
+              <?php echo ALGO_FS_SPAM; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['spam_level']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_IP_LATITUDE; ?>:<?php echo FS_HELP_LATITUDE; ?>'; return true;" return true;">
+              <?php echo ALGO_FS_IP_LATITUDE; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['ip_latitude']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_IP_LONGITUDE; ?>:<?php echo FS_HELP_LONGITUDE; ?>'; return true;" return true;">
+              <?php echo ALGO_FS_IP_LONGITUDE; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent" align=left><?php echo $fraud_screen_query['ip_longitude']; ?></td>
+            </tr>
+          </table>
+
+        </td>
+        <td width=33% valign=top>
+          <?php echo tep_draw_form('bank_query', FILENAME_ORDERS, tep_get_all_get_params(array('az_run_fquery','az_run_bquery')) . 'az_run_bquery=true'); ?>
+          <table width="100%" border=0 cellspadding="0">
+            <tr class="dataTableRow">      
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_BIN_MATCH; ?>:<?php echo FS_HELP_BIN_MATCH; ?>'; return true;">
+              <?php echo ALGO_FS_BIN_MATCH; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['is_bin_match']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_BANK_NAME_MATCH; ?>:<?php echo FS_HELP_BANK_NAME_MATCH; ?>'; return true;">
+              <?php echo ALGO_FS_BANK_NAME_MATCH; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['is_bank_name_match']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_BANK_PHONE_MATCH; ?>:<?php echo FS_HELP_BANK_PHONE_MATCH; ?>'; return true;">
+              <?php echo ALGO_FS_BANK_PHONE_MATCH; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['is_bank_phone_match']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_BANK_COUNTRY; ?>:<?php echo FS_HELP_BANK_COUNTRY; ?>'; return true;">
+              <?php echo ALGO_FS_BANK_COUNTRY; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo $fraud_screen_query['bin_country_code']; ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td colspan="3" align="right" class="dataTableContent"><hr></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_BANK_NAME; ?>:<?php echo FS_HELP_BANK_NAME; ?>';  return true;">
+              <?php echo ALGO_FS_BANK_NAME; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo tep_draw_input_field('bank_name', $fraud_screen_query['bank_name'], 'size="12"'); ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td width="35%" class="dataTableContent">
+              <a href="#" class="bodylink" onmouseover="helptext.innerHTML='<?php echo ALGO_FS_BANK_PHONE; ?>:<?php echo FS_HELP_BANK_PHONE; ?>'; return true;">
+              <?php echo ALGO_FS_BANK_PHONE; ?>
+              </a>
+              </td>
+              <td width="1" class="dataTableContent"><b>:</b></td>
+              <td class="dataTableContent"><?php echo tep_draw_input_field('bank_phone', $fraud_screen_query['bank_phone'], 'size="12"'); ?></td>
+            </tr>
+            <tr class="dataTableRow">
+              <td colspan="3" align="center" class="dataTableContent">
+              <input type=submit value="<?php echo ALGO_FS_BREQUEST; ?>" style="background-color:#ffffff;border=1px solid #000000;" onmouseover="this.style.cursor='hand';">
+              </td>
+            </tr>
+          </table>
+          </form>
+        </td>
+
+      </tr>
+    </table>
+  </td>
+</tr>
+<tr>
+  <td>
+    <table width="100%" cellspacing=0 border=0>
+    <tr class="dataTableRow">
+      <td class="dataTableContent" style="border-top:1px solid #000000;padding-left:5px;">
+      <?php 
+        echo '<i><b>'.LAST_QUERIED_ON.'</b>&nbsp;&nbsp;&nbsp;' . $fraud_screen_query['last_date_queried'] . '</i>'; 
+        echo '</br>'; 
+        if($remaining_queries > 10){
+        echo sprintf('<i>'.REMAINING_QUERIES_1.' <b>%d</b> '.REMAINING_QUERIES_2.'</i>', $remaining_queries); 
+        }
+        else{
+        echo sprintf('<i>'.REMAINING_QUERIES_1.' <font color=red><b>%d</b></font> '.REMAINING_QUERIES_2.'</i>', $remaining_queries); 
+        }
+      ?>
+        <div id="helptext" style='padding-top:5px;width:100%;height:30px;color:green;'>
+          <font color=black><?php echo FS_HELP_DEFAULT; ?></font>
+        </div>
+        <div id="helptext2" style='width:100%;height:30px;color:green;'>
+          <?php
+            $show_prem_msg = 0;
+            foreach ($fraud_screen_query as $f){
+              if($f == '***'){ 
+                $show_prem_msg = 1;
+                break;  
+              }
+            }
+            if($show_prem_msg == 1){
+              echo ALGO_HELP_PREM_OPT . "<br>";
+            }
+          ?>
+        </div>
+      </td>
+    </tr>
+    </table>
+  </td>
+</tr>
+<tr>
+  <td>
+    <table width="100%" cellspacing=0 cellpadding=0 border=0>
+    <tr>
+      <td width=209 height=20 valign=bottom><a href="http://www.algozone.com" target=new><?php echo tep_image(DIR_WS_MODULES . 'afs_v1.0/images/az_box_footer_left.gif',"", 209, 20);?></a></td>
+      <td style="background-repeat:repeat-x;background-image:url('<?php echo DIR_WS_MODULES . '/afs_v1.0/images/az_box_footer_r.gif'; ?>');height:19px;">&nbsp;
+      </td>        
+    </tr>
+    </table>
+  </td>
+</tr>
+</table>
+
+<?php 
+}

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_footer_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_footer_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_footer_r.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_footer_r.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_header_r.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_header_r.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_header_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/az_box_header_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/icon-maps.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/icon-maps.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r0g5.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r0g5.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r1g4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r1g4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r2g3.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r2g3.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r3g2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r3g2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r4g1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r4g1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r5g0.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/images/r5g0.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/map.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/map.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/modules/afs_v1.0/map.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3 @@
+
+<img src="http://tiger.census.gov/cgi-bin/mapgen?lon=<?php echo $HTTP_GET_VARS['ip_longitude'];?>&lat=<?php echo $HTTP_GET_VARS['ip_latitude']; ?>&wid=.45&ht=.3&iht=300&iwd=450&mark=<?php echo $HTTP_GET_VARS['ip_longitude'];?>,<?php echo $HTTP_GET_VARS['ip_latitude'];?>,redball"> 
+<!-- <p>Courtesy of the U.S. Census Bureau's TIGER Mapping Service --><?php echo MAP_MSG?>

Added: trunk/direct.openmoko.com/admin/includes/modules/create_order_details.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/modules/create_order_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/modules/create_order_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,301 @@
+<?php
+/*
+  $Id: create_order_details.php,v 1.1.1.1 2004/03/04 23:40:22 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+function sbs_get_zone_name($country_id, $zone_id) {
+    $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . $country_id . "' and zone_id = '" . $zone_id . "'");
+    if (tep_db_num_rows($zone_query)) {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_name'];
+    } else {
+      return $default_zone;
+    }
+  }
+
+ // Returns an array with countries
+// TABLES: countries
+  function sbs_get_countries($countries_id = '', $with_iso_codes = false) {
+    $countries_array = array();
+    if ($countries_id) {
+      if ($with_iso_codes) {
+        $countries = tep_db_query("select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "' order by countries_name");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name'],
+                                 'countries_iso_code_2' => $countries_values['countries_iso_code_2'],
+                                 'countries_iso_code_3' => $countries_values['countries_iso_code_3']);
+      } else {
+        $countries = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "'");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name']);
+      }
+    } else {
+      $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name");
+      while ($countries_values = tep_db_fetch_array($countries)) {
+        $countries_array[] = array('countries_id' => $countries_values['countries_id'],
+                                   'countries_name' => $countries_values['countries_name']);
+      }
+    }
+
+    return $countries_array;
+  }
+  ////
+function sbs_get_country_list($name, $selected = '', $parameters = '') {
+   $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
+   $countries = sbs_get_countries();
+   $size = sizeof($countries);
+   for ($i=0; $i<$size; $i++) {
+     $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
+   }
+
+   return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
+}
+
+
+////
+// Alias function to tep_get_countries, which also returns the countries iso codes
+ /* function tep_get_countries_with_iso_codes($countries_id) {
+    return tep_get_countries($countries_id, true);
+  }*/
+?>
+
+<?php
+    tep_draw_hidden_field($account['customers_id']);
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="formAreaTitle"><?php echo CATEGORY_CORRECT; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+                    <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_CUSTOMERS_ID; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_id'];
+
+  } else {
+    echo tep_draw_input_field('customers_id', $account['customers_id']) . '&nbsp;' . ENTRY_CUSTOMERS_ID_TEXT;
+  }
+?></td>
+          </tr>
+      <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_firstname'];
+
+  } else {
+    echo tep_draw_input_field('firstname', $account['customers_firstname']) . '&nbsp;' . ENTRY_FIRST_NAME_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_lastname'];
+  } else {
+    echo tep_draw_input_field('lastname', $account['customers_lastname']) . '&nbsp;' . ENTRY_LAST_NAME_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  //}
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_email_address'];
+  } else {
+    echo tep_draw_input_field('email_address', $account['customers_email_address']) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_TEXT;
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_COMPANY; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_COMPANY; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo $address['entry_company'];
+    } else {
+      echo tep_draw_input_field('company', $address['entry_company']) . '&nbsp;' . ENTRY_COMPANY_TEXT;
+    }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  }
+?>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_ADDRESS; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $address['entry_street_address'];
+  } else {
+    echo tep_draw_input_field('street_address', $address['entry_street_address']) . '&nbsp;' . ENTRY_STREET_ADDRESS_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_SUBURB; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo $address['entry_suburb'];
+    } else {
+      echo tep_draw_input_field('suburb', $address['entry_suburb']) . '&nbsp;' . ENTRY_SUBURB_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $address['entry_postcode'];
+  } else {
+    echo tep_draw_input_field('postcode', $address['entry_postcode']) . '&nbsp;' . ENTRY_POST_CODE_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_CITY; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $address['entry_city'];
+  } else {
+    echo tep_draw_input_field('city', $address['entry_city']) . '&nbsp;' . ENTRY_CITY_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STATE; ?></td>
+            <td class="main">&nbsp;
+<?php
+    $state = sbs_get_zone_name($country, $zone_id, $state);
+    if ($is_read_only) {
+      echo sbs_get_zone_name($address['entry_country_id'], $account['entry_zone_id'], $account['entry_state']);
+    } else {
+      echo tep_draw_input_field('state', sbs_get_zone_name($address['entry_country_id'], $address['entry_zone_id'], $address['entry_state'])) . '&nbsp;' . ENTRY_STATE_TEXT;
+    }
+?></td>
+             </tr>
+<?php
+     }
+?>
+             <tr>
+               <td class="main">&nbsp;
+<?php
+ echo ENTRY_COUNTRY;
+ ?></td>
+               <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+           echo tep_get_country_name($address['entry_country_id']);
+  } else {
+  echo tep_draw_input_field('country', tep_get_country_name($address['entry_country_id'])) . '&nbsp;' . ENTRY_COUNTRY_TEXT;
+
+     }
+?>
+
+<?php
+
+   tep_draw_hidden_field('step', '3')
+?>
+
+</td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_CONTACT; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_telephone'];
+  } else {
+    echo tep_draw_input_field('telephone', $account['customers_telephone']) . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_TEXT;
+  }
+?>
+<?php
+/*</td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FAX_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_fax'];
+  } else {
+    echo tep_draw_input_field('fax', $account['customers_fax']) . '&nbsp;' . ENTRY_FAX_NUMBER_TEXT;
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+ */ ?>
+<?php
+  //}
+?>
+</table>

Added: trunk/direct.openmoko.com/admin/includes/modules/newsletters/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/modules/newsletters/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/modules/newsletters/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: affiliate_newsletter.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class affiliate_newsletter {
+    var $show_choose_audience, $title, $content;
+
+    function affiliate_newsletter($title, $content) {
+      $this->show_choose_audience = false;
+      $this->title = $title;
+      $this->content = $content;
+    }
+
+    function choose_audience() {
+      return false;
+    }
+
+    function confirm() {
+      global $HTTP_GET_VARS;
+
+      $mail_query = tep_db_query("select count(*) as count from " . TABLE_AFFILIATE . " where affiliate_newsletter = '1'");
+      $mail = tep_db_fetch_array($mail_query);
+
+      $confirm_string = '<table border="0" cellspacing="0" cellpadding="2">' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td class="main"><font color="#ff0000"><b>' . sprintf(TEXT_COUNT_AFFILIATES, $mail['count']) . '</b></font></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td class="main"><b>' . $this->title . '</b></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td class="main"><tt>' . nl2br($this->content) . '</tt></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td align="right"><a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm_send') . '">' . tep_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '</table>';
+
+      return $confirm_string;
+    }
+
+    function send($affiliate_newsletter_id) {
+      $mail_query = tep_db_query("select affiliate_firstname, affiliate_lastname, affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_newsletter = '1'");
+
+      $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
+      $mimemessage->add_text($this->content);
+      $mimemessage->build_message();
+      while ($mail = tep_db_fetch_array($mail_query)) {
+        $mimemessage->send($mail['affiliate_firstname'] . ' ' . $mail['affiliate_lastname'], $mail['affiliate_email_address'], '', EMAIL_FROM, $this->title);
+      }
+
+      $affiliate_newsletter_id = tep_db_prepare_input($affiliate_newsletter_id);
+      tep_db_query("update " . TABLE_AFFILIATE_NEWSLETTERS . " set date_sent = now(), status = '1' where affiliate_newsletters_id = '" . tep_db_input($affiliate_newsletter_id) . "'");
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/includes/modules/newsletters/newsletter.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/modules/newsletters/newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/modules/newsletters/newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+<?php
+/*
+  $Id: newsletter.php,v 1.1.1.1 2004/03/04 23:40:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class newsletter {
+    var $show_choose_audience, $title, $content;
+
+    function newsletter($title, $content) {
+      $this->show_choose_audience = false;
+      $this->title = $title;
+      $this->content = $content;
+    }
+
+    function choose_audience() {
+      return false;
+    }
+
+    function confirm() {
+      global $HTTP_GET_VARS;
+
+      $mail_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
+      $mail = tep_db_fetch_array($mail_query);
+
+      $confirm_string = '<table border="0" cellspacing="0" cellpadding="2">' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td class="main"><font color="#ff0000"><b>' . sprintf(TEXT_COUNT_CUSTOMERS, $mail['count']) . '</b></font></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td class="main"><b>' . $this->title . '</b></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td class="main"><tt>' . nl2br($this->content) . '</tt></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td align="right"><a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm_send') . '">' . tep_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '</table>';
+
+      return $confirm_string;
+    }
+
+    function send($newsletter_id) {
+      $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
+
+      $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF (Send TEXT Newsletter v1.7 when WYSIWYG Disabled)
+      if (HTML_WYSIWYG_DISABLE_NEWSLETTER == 'Disable') {
+      $mimemessage->add_text($this->content);
+      } else {
+      $mimemessage->add_html($this->content);
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF (Send HTML Newsletter v1.7 when WYSIWYG Enabled)
+      }
+
+      $mimemessage->build_message();
+      while ($mail = tep_db_fetch_array($mail_query)) {
+        $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);
+      }
+
+      $newsletter_id = tep_db_prepare_input($newsletter_id);
+      tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/modules/newsletters/product_notification.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/modules/newsletters/product_notification.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/modules/newsletters/product_notification.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,224 @@
+<?php
+/*
+  $Id: product_notification.php,v 1.1.1.1 2004/03/04 23:40:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class product_notification {
+    var $show_choose_audience, $title, $content;
+
+    function product_notification($title, $content) {
+      $this->show_choose_audience = true;
+      $this->title = $title;
+      $this->content = $content;
+    }
+
+    function choose_audience() {
+      global $HTTP_GET_VARS, $languages_id;
+
+      $products_array = array();
+      $products_query = tep_db_query("select pd.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.language_id = '" . $languages_id . "' and pd.products_id = p.products_id and p.products_status = '1' order by pd.products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+        $products_array[] = array('id' => $products['products_id'],
+                                  'text' => $products['products_name']);
+      }
+
+$choose_audience_string = '<script language="javascript"><!--
+function mover(move) {
+  if (move == \'remove\') {
+    for (x=0; x<(document.notifications.products.length); x++) {
+      if (document.notifications.products.options[x].selected) {
+        with(document.notifications.elements[\'chosen[]\']) {
+          options[options.length] = new Option(document.notifications.products.options[x].text,document.notifications.products.options[x].value);
+        }
+        document.notifications.products.options[x] = null;
+        x = -1;
+      }
+    }
+  }
+  if (move == \'add\') {
+    for (x=0; x<(document.notifications.elements[\'chosen[]\'].length); x++) {
+      if (document.notifications.elements[\'chosen[]\'].options[x].selected) {
+        with(document.notifications.products) {
+          options[options.length] = new Option(document.notifications.elements[\'chosen[]\'].options[x].text,document.notifications.elements[\'chosen[]\'].options[x].value);
+        }
+        document.notifications.elements[\'chosen[]\'].options[x] = null;
+        x = -1;
+      }
+    }
+  }
+  return true;
+}
+
+function selectAll(FormName, SelectBox) {
+  temp = "document." + FormName + ".elements[\'" + SelectBox + "\']";
+  Source = eval(temp);
+
+  for (x=0; x<(Source.length); x++) {
+    Source.options[x].selected = "true";
+  }
+
+  if (x<1) {
+    alert(\'' . JS_PLEASE_SELECT_PRODUCTS . '\');
+    return false;
+  } else {
+    return true;
+  }
+}
+//--></script>';
+
+      $global_button = '<script language="javascript"><!--' . "\n" .
+                       'document.write(\'<input type="button" value="' . BUTTON_GLOBAL . '" style="width: 8em;" onclick="document.location=\\\'' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm&global=true') . '\\\'">\');' . "\n" .
+                       '//--></script><noscript><a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm&global=true') . '">[ ' . BUTTON_GLOBAL . ' ]</a></noscript>';
+
+      $cancel_button = '<script language="javascript"><!--' . "\n" .
+                       'document.write(\'<input type="button" value="' . BUTTON_CANCEL . '" style="width: 8em;" onclick="document.location=\\\'' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '\\\'">\');' . "\n" .
+                       '//--></script><noscript><a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">[ ' . BUTTON_CANCEL . ' ]</a></noscript>';
+
+      $choose_audience_string .= '<form name="notifications" action="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm') . '" method="post" onSubmit="return selectAll(\'notifications\', \'chosen[]\')"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" .
+                                 '  <tr>' . "\n" .
+                                 '    <td align="center" class="main"><b>' . TEXT_PRODUCTS . '</b><br>' . tep_draw_pull_down_menu('products', $products_array, '', 'size="20" style="width: 20em;" multiple') . '</td>' . "\n" .
+                                 '    <td align="center" class="main">&nbsp;<br>' . $global_button . '<br><br><br><input type="button" value="' . BUTTON_SELECT . '" style="width: 8em;" onClick="mover(\'remove\');"><br><br><input type="button" value="' . BUTTON_UNSELECT . '" style="width: 8em;" onClick="mover(\'add\');"><br><br><br><input type="submit" value="' . BUTTON_SUBMIT . '" style="width: 8em;"><br><br>' . $cancel_button . '</td>' . "\n" .
+                                 '    <td align="center" class="main"><b>' . TEXT_SELECTED_PRODUCTS . '</b><br>' . tep_draw_pull_down_menu('chosen[]', array(), '', 'size="20" style="width: 20em;" multiple') . '</td>' . "\n" .
+                                 '  </tr>' . "\n" .
+                                 '</table></form>';
+
+      return $choose_audience_string;
+    }
+
+    function confirm() {
+      global $HTTP_GET_VARS, $HTTP_POST_VARS;
+
+      $audience = array();
+
+      if (isset($HTTP_GET_VARS['global']) && ($HTTP_GET_VARS['global'] == 'true')) {
+        $products_query = tep_db_query("select distinct customers_id from " . TABLE_PRODUCTS_NOTIFICATIONS);
+        while ($products = tep_db_fetch_array($products_query)) {
+          $audience[$products['customers_id']] = '1';
+        }
+
+        $customers_query = tep_db_query("select customers_info_id from " . TABLE_CUSTOMERS_INFO . " where global_product_notifications = '1'");
+        while ($customers = tep_db_fetch_array($customers_query)) {
+          $audience[$customers['customers_info_id']] = '1';
+        }
+      } else {
+        $chosen = $HTTP_POST_VARS['chosen'];
+
+        $ids = implode(',', $chosen);
+
+        $products_query = tep_db_query("select distinct customers_id from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id in (" . $ids . ")");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $audience[$products['customers_id']] = '1';
+        }
+
+        $customers_query = tep_db_query("select customers_info_id from " . TABLE_CUSTOMERS_INFO . " where global_product_notifications = '1'");
+        while ($customers = tep_db_fetch_array($customers_query)) {
+          $audience[$customers['customers_info_id']] = '1';
+        }
+      }
+
+      $confirm_string = '<table border="0" cellspacing="0" cellpadding="2">' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td class="main"><font color="#ff0000"><b>' . sprintf(TEXT_COUNT_CUSTOMERS, sizeof($audience)) . '</b></font></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td class="main"><b>' . $this->title . '</b></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td class="main"><tt>' . nl2br($this->content) . '</tt></td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . "\n" .
+                        '    <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
+                        '  </tr>' . "\n" .
+                        '  <tr>' . tep_draw_form('confirm', FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm_send') . "\n" .
+                        '    <td align="right">';
+      if (sizeof($audience) > 0) {
+        if (isset($HTTP_GET_VARS['global']) && ($HTTP_GET_VARS['global'] == 'true')) {
+          $confirm_string .= tep_draw_hidden_field('global', 'true');
+        } else {
+          for ($i = 0, $n = sizeof($chosen); $i < $n; $i++) {
+            $confirm_string .= tep_draw_hidden_field('chosen[]', $chosen[$i]);
+          }
+        }
+        $confirm_string .= tep_image_submit('button_send.gif', IMAGE_SEND) . ' ';
+      }
+      $confirm_string .= '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=send') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a></td>' . "\n" .
+                         '  </tr>' . "\n" .
+                         '</table>';
+
+      return $confirm_string;
+    }
+
+    function send($newsletter_id) {
+      global $HTTP_POST_VARS;
+
+      $audience = array();
+
+      if (isset($HTTP_POST_VARS['global']) && ($HTTP_POST_VARS['global'] == 'true')) {
+        $products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'],
+                                                       'lastname' => $products['customers_lastname'],
+                                                       'email_address' => $products['customers_email_address']);
+        }
+
+        $customers_query = tep_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'");
+        while ($customers = tep_db_fetch_array($customers_query)) {
+          $audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'],
+                                                        'lastname' => $customers['customers_lastname'],
+                                                        'email_address' => $customers['customers_email_address']);
+        }
+      } else {
+        $chosen = $HTTP_POST_VARS['chosen'];
+
+        $ids = implode(',', $chosen);
+
+        $products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id and pn.products_id in (" . $ids . ")");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'],
+                                                       'lastname' => $products['customers_lastname'],
+                                                       'email_address' => $products['customers_email_address']);
+        }
+
+        $customers_query = tep_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'");
+        while ($customers = tep_db_fetch_array($customers_query)) {
+          $audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'],
+                                                        'lastname' => $customers['customers_lastname'],
+                                                        'email_address' => $customers['customers_email_address']);
+        }
+      }
+
+      $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF (Send TEXT Product Notifications v1.7 when WYSIWYG Disabled)
+      if (HTML_WYSIWYG_DISABLE_NEWSLETTER == 'Disable') {
+      $mimemessage->add_text($this->content);
+      } else {
+      $mimemessage->add_html($this->content);
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF (Send TEXT Product Notifications v1.7 when WYSIWYG Enabled)
+      }
+
+      $mimemessage->build_message();
+
+      reset($audience);
+      while (list($key, $value) = each ($audience)) {
+        $mimemessage->send($value['firstname'] . ' ' . $value['lastname'], $value['email_address'], '', EMAIL_FROM, $this->title);
+      }
+
+      $newsletter_id = tep_db_prepare_input($newsletter_id);
+      tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/admin/includes/printer.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/printer.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/printer.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,8 @@
+body { background-color: #ffffff; color: #000000; margin: 0px; }
+.pageHeading { font-family: Verdana, Arial, sans-serif; font-size: 18px; color: #000000; font-weight: bold; }
+.dataTableHeadingRow { background-color: #ffffff; }
+.dataTableHeadingContent { font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #000000; font-weight: bold; }
+.dataTableRow { background-color: #ffffff; }
+.dataTableContent { font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #000000; }
+.smallText { font-family: Verdana, Arial, sans-serif; font-size: 11px; }
+.main { font-family: Verdana, Arial, sans-serif; font-size: 11px; }

Added: trunk/direct.openmoko.com/admin/includes/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/admin/includes/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,629 @@
+/* Generated by CaScadeS, a stylesheet editor for Mozilla Composer */
+
+  a.content:link { font-family: Arial,Verdana,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.content:visited { font-family: Arial,Verdana,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.content:active { font-family: Arial,Verdana,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.content:hover { font-family: Arial,Verdana,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    font-weight: normal;
+    text-decoration: underline;
+    }
+
+  a:link { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a:visited { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a:active { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a:hover { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    font-weight: normal;
+    text-decoration: underline;
+    }
+
+  a.headerLink:link { font-family: Verdana,Arial,sans-serif;
+    font-size: 8px;
+    color: rgb(143, 2, 14);
+    font-weight: bold;
+    text-decoration: none;
+    }
+
+  a.headerLink:visited { font-family: Verdana,Arial,sans-serif;
+    font-size: 8px;
+    color: rgb(143, 2, 14);
+    font-weight: bold;
+    text-decoration: none;
+    }
+
+  a.headerLink:active { font-family: Verdana,Arial,sans-serif;
+    font-size: 8px;
+    color: rgb(143, 2, 14);
+    font-weight: bold;
+    text-decoration: none;
+    }
+
+  a.headerLink:hover { font-family: Verdana,Arial,sans-serif;
+    font-size: 8px;
+    color: rgb(143, 2, 14);
+    font-weight: bold;
+    text-decoration: underline;
+    }
+
+  a.menuBoxHeadingLink:link { font-size: 10px;
+    color: rgb(97, 96, 96);
+    font-weight: bold;
+    text-decoration: none;
+    }
+
+  a.menuBoxHeadingLink:visited { font-size: 10px;
+    color: rgb(97, 96, 96);
+    font-weight: bold;
+    text-decoration: none;
+    }
+
+  a.menuBoxHeadingLink:active { font-size: 10px;
+    color: rgb(97, 96, 96);
+    font-weight: bold;
+    text-decoration: none;
+    }
+
+  a.menuBoxHeadingLink:hover { font-size: 10px;
+    color: rgb(97, 96, 96);
+    font-weight: bold;
+    text-decoration: none;
+    }
+
+  a.menuBoxContentLink:link { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(97, 96, 96);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.menuBoxContentLink:visited { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(97, 96, 96);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.menuBoxContentLink:active { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(97, 96, 96);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.menuBoxContentLink:hover { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(97, 96, 96);
+    font-weight: normal;
+    text-decoration: underline;
+    }
+
+  .menuBoxHeadLink { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 255, 255);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.menuBoxHeadLink:link { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 255, 255);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.menuBoxHeadLink:visited { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 255, 255);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.menuBoxHeadLink:active { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 255, 255);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.menuBoxHeadtLink:hover { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 255, 255);
+    font-weight: normal;
+    text-decoration: underline;
+    }
+
+  a.splitPageLink:link { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 255);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.splitPageLink:visited { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 255);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.splitPageLink:active { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 255);
+    font-weight: normal;
+    text-decoration: none;
+    }
+
+  a.splitPageLink:hover { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 255);
+    font-weight: normal;
+    text-decoration: underline;
+    background-color: rgb(255, 255, 51);
+    }
+
+  .menuBoxHeading { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(97, 96, 96);
+    background-color: rgb(255, 255, 255);
+    }
+
+  .menuBoxContent { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(97, 96, 96);
+    }
+
+  body { margin: 0px;
+    background-color: rgb(255, 255, 255);
+    color: rgb(0, 0, 0);
+    }
+
+  .headerBar { background-color: rgb(179, 186, 197);
+    }
+
+  .headerBarContent { padding: 2px;
+    font-family: Verdana,Arial,sans-serif;
+    font-size: 8px;
+    color: rgb(0, 0, 128);
+    font-weight: bold;
+    }
+
+  .columnLeft { border: 1px solid rgb(153, 153, 153);
+    padding: 2px;
+    background-color: rgb(240, 241, 241);
+    }
+
+  .pageHeading { font-family: Verdana,Arial,sans-serif;
+    font-size: 18px;
+    color: rgb(114, 114, 114);
+    font-weight: bold;
+    }
+
+  .content { font-family: Arial,Verdana,sans-serif;
+    font-size: 14px;
+    color: rgb(0, 0, 0);
+    }
+
+  .content_heading { font-family: Arial,Verdana,sans-serif;
+    font-size: 14px;
+    color: rgb(0, 0, 0);
+    font-weight: bold;
+    }
+
+  .dataTableHeadingRow { background-color: rgb(201, 201, 201);
+    }
+
+  .dataTableHeadingContent { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 255, 255);
+    font-weight: bold;
+    }
+
+  .dataTableRow { background-color: rgb(240, 241, 241);
+    }
+
+  .dataTableRowSelected { background-color: rgb(222, 228, 232);
+    }
+
+  .dataTableRowOver { background-color: rgb(255, 255, 255);
+    cursor: pointer;
+    }
+
+  .dataTableContent { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    }
+
+  .dataTableContentRed { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(204, 0, 0);
+    }
+
+  .dataTableContentRedAlert { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 0, 0);
+    font-weight: bold;
+    }
+
+  .infoBoxHeading { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 255, 255);
+    background-color: rgb(179, 186, 197);
+    }
+
+  .infoBoxContent { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    background-color: rgb(222, 228, 232);
+    }
+
+  .messageBox { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    text-align: left;
+    font-weight: bold;
+    }
+
+  .messageStackError { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    background-color: rgb(255, 77, 82);
+    text-align: left;
+//    font-weight: bold;
+    color: rgb(255, 255, 255);
+    }
+    
+  .messageStackWarning { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    background-color: rgb(255, 255, 0);
+    text-align: left;
+//    font-weight: bold;
+    color: rgb(0, 0, 0);
+    }
+
+  .messageStackSuccess { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    background-color: rgb(0 , 204 , 102);
+    text-align: left;
+    color: rgb(0, 0, 0);
+    }
+TR.headerError {
+  background: #ff0000;
+}
+
+TD.headerError {
+  font-family: Tahoma, Verdana, Arial, sans-serif;
+  font-size: 12px;
+  background: #ff0000;
+  color: #ffffff;
+  font-weight : bold;
+  text-align : center;
+}
+TR.headerInfo {
+  background: #00ff00;
+}
+
+TD.headerInfo {
+  font-family: Tahoma, Verdana, Arial, sans-serif;
+  font-size: 12px;
+  background: #00ff00;
+  color: #ffffff;
+  font-weight: bold;
+  text-align: center;
+}
+  checkbox, input, radio, select, textarea, file { font-family: Verdana,Arial,sans-serif;
+    font-size: 11px;
+    }
+
+  form { display: inline;
+    }
+
+  .formArea { border: 1px solid rgb(123, 158, 189);
+    background-color: rgb(241, 249, 254);
+    }
+
+  .formAreaTitle { font-family: Tahoma,Verdana,Arial,sans-serif;
+    font-size: 12px;
+    font-weight: bold;
+    }
+
+  .attributes-odd { background-color: rgb(244, 247, 253);
+    }
+
+  .attributes-even { background-color: rgb(255, 255, 255);
+    }
+
+  .specialPrice { color: rgb(255, 0, 0);
+    }
+
+  .oldPrice { text-decoration: line-through;
+    }
+
+  .fieldRequired { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 0, 0);
+    }
+
+  .smallText { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    }
+
+  .main { font-family: Verdana,Arial,sans-serif;
+    font-size: 12px;
+    }
+
+  .errorText { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(255, 0, 0);
+    }
+
+  .attributeBoxContent { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    background-color: rgb(128, 128, 128);
+    }
+
+  .TR.attributeBoxContent { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    background-color: rgb(128, 128, 128);
+    }
+
+  .TD.attributeBoxContent { font-family: Verdana,Arial,sans-serif;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    background-color: rgb(192, 192, 192);
+    }
+
+  .infoboxAdminHeading { font-family: Verdana,Arial,sans-serif;
+    font-size: 14px;
+    font-weight: bold;
+    color: rgb(0, 0, 0);
+    }
+
+  .infoboxAdmin { font-family: Verdana,Arial,sans-serif;
+    font-size: 12px;
+    color: rgb(0, 0, 0);
+    }
+
+  .infobox-listing-odd { background: rgb(248, 248, 249) none repeat scroll 0%;
+    -moz-background-clip: initial;
+    -moz-background-origin: initial;
+    -moz-background-inline-policy: initial;
+    }
+
+  .infobox-listing-even { background: rgb(240, 241, 241) none repeat scroll 0%;
+    -moz-background-clip: initial;
+    -moz-background-origin: initial;
+    -moz-background-inline-policy: initial;
+    }
+
+  .epa_error { background: rgb(227, 18, 48) none repeat scroll 0%;
+    font-family: Verdana,Arial,sans-serif;
+    font-size: 12px;
+    -moz-background-clip: initial;
+    -moz-background-origin: initial;
+    -moz-background-inline-policy: initial;
+    color: rgb(255, 255, 255);
+    }
+
+  .epa_output { background: rgb(248, 248, 249) none repeat scroll 0%;
+    -moz-background-clip: initial;
+    -moz-background-origin: initial;
+    -moz-background-inline-policy: initial;
+    }
+
+  .epa_msg { background: rgb(153, 204, 255) none repeat scroll 0%;
+    -moz-background-clip: initial;
+    -moz-background-origin: initial;
+    -moz-background-inline-policy: initial;
+    }
+
+  .editOrder { font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular;
+    font-size: 10px;
+    color: rgb(0, 0, 0);
+    background-color: rgb(192, 192, 192);
+    }
+
+  .helpMain { font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular;
+    font-size: 12px;
+    color: rgb(0, 0, 0);
+    }
+
+  .dtree { font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;
+    font-size: 11px;
+    color: rgb(102, 102, 102);
+    white-space: nowrap;
+    }
+
+  .dtree img { border: 0px none ;
+    vertical-align: middle;
+    }
+
+  .dtree a { color: rgb(51, 51, 51);
+    text-decoration: none;
+    }
+
+  .dtree a.node, .dtree a.nodeSel { padding: 1px 2px;
+    white-space: nowrap;
+    }
+
+  .dtree a.node:hover, .dtree a.nodeSel:hover { color: rgb(51, 51, 51);
+    text-decoration: underline;
+    }
+
+  .dtree a.nodeSel { background-color: rgb(192, 210, 236);
+    }
+
+  .dtree .clip { overflow: hidden;
+    }
+
+  div.menuBar, div.menuBar a.menuButton, div.menu, div.menu a.menuItem { font-family: "MS Sans Serif",Arial,sans-serif;
+    font-size: 8pt;
+    font-style: normal;
+    font-weight: normal;
+    color: rgb(0, 0, 0);
+    }
+
+  div.menuBar { border: 2px outset rgb(224, 224, 224);
+    padding: 4px 2px;
+    background-color: rgb(224, 224, 224);
+    text-align: center;
+    font-weight: bold;
+    }
+
+  div.menuBar a.menuButton { border: 1px solid rgb(224, 224, 224);
+    margin: 1px;
+    padding: 2px 6px;
+    background-color: transparent;
+    color: rgb(0, 0, 0);
+    cursor: default;
+    left: 0px;
+    position: relative;
+    text-decoration: none;
+    top: 0px;
+    z-index: 100;
+    }
+
+  div.menuBar a.menuButton:hover { border: 1px outset rgb(224, 224, 224);
+    background-color: transparent;
+    color: rgb(0, 0, 0);
+    }
+
+  div.menuBar a.menuButtonActive, div.menuBar a.menuButtonActive:hover { border: 1px inset rgb(224, 224, 224);
+    background-color: rgb(80, 80, 240);
+    color: rgb(255, 255, 255);
+    left: 1px;
+    top: 1px;
+    }
+
+  div.menu { border: 2px outset rgb(224, 224, 224);
+    padding: 0px 1px 1px 0px;
+    background-color: rgb(224, 224, 224);
+    left: 0px;
+    position: absolute;
+    top: 0px;
+    visibility: hidden;
+    z-index: 101;
+    }
+
+  div.menu a.menuItem { padding: 3px 1em;
+    color: rgb(0, 0, 0);
+    cursor: default;
+    display: block;
+    text-decoration: none;
+    white-space: nowrap;
+    }
+
+  div.menu a.menuItem:hover, div.menu a.menuItemHighlight { background-color: rgb(80, 80, 240);
+    color: rgb(255, 255, 255);
+    }
+
+  div.menu a.menuItem span.menuItemText {  }
+
+  div.menu a.menuItem span.menuItemArrow { margin-right: -0.75em;
+    }
+
+  div.menu div.menuItemSep { border: 1px inset rgb(224, 224, 224);
+    margin: 4px 2px;
+    }
+
+  fieldset { border: 1px solid rgb(204, 204, 204);
+    padding: 5px;
+    margin-bottom: 10px;
+    text-align: left;
+    }
+
+  fieldset p { margin: 10px 0px;
+    }
+
+  legend { border: 1px solid rgb(204, 204, 204);
+    padding: 2px;
+    color: rgb(0, 0, 0);
+    font-size: 1.1em;
+    font-weight: bold;
+    background-color: rgb(247, 247, 247);
+    text-align: center;
+    }
+
+  body, td, th { font-family: Verdana,Arial,Helvetica,sans-serif;
+    font-size: 11px;
+    color: rgb(0, 0, 0);
+    line-height: 1.5em;
+    }
+
+  style1 { font-family: Verdana,Arial,Helvetica,sans-serif;
+    font-size: 11px;
+    font-weight: bold;
+    color: rgb(255, 255, 255);
+    }
+
+  style2 { font-family: Verdana,Arial,Helvetica,sans-serif;
+    font-size: 11px;
+    font-weight: bold;
+    color: rgb(0, 0, 0);
+    font-style: normal;
+    }
+
+  style3 { font-family: Verdana,Arial,Helvetica,sans-serif;
+    font-size: 11px;
+    font-weight: bold;
+    color: rgb(0, 0, 0);
+    }
+
+  style4 { font-family: Verdana,Arial,Helvetica,sans-serif;
+    font-size: 11px;
+    font-weight: bold;
+    color: rgb(255, 255, 255);
+    }
+
+  style5 { font-family: Verdana,Arial,Helvetica,sans-serif;
+    font-size: 11px;
+    font-weight: bold;
+    color: rgb(0, 0, 0);
+    }
+
+  style6 { font-family: Verdana,Arial,Helvetica,sans-serif ! important;
+    color: rgb(255, 0, 0) ! important;
+    font-weight: bold ! important;
+    font-size: 11px ! important;
+    font-style: normal;
+    text-transform: none;
+    }
+

Added: trunk/direct.openmoko.com/admin/includes/tld.txt
===================================================================
--- trunk/direct.openmoko.com/admin/includes/tld.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/tld.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+# $Id: tld.txt,v 1.1.1.1 2004/03/04 23:39:43 ccwjr Exp $
+#
+# osCommerce, Open Source E-Commerce Solutions
+# http://www.oscommerce.com
+#
+# Copyright (c) 2003 osCommerce
+#
+# Released under the GNU General Public License
+#
+
+# Original 7 TLDs
+com     # all are eligible to register
+edu     # degree-granting educational institutions of higher education
+gov     # United States Government
+int     # organizations established by international treaties
+mil     # United States Military
+net     # all are eligible to register
+org     # noncommercial community, all are eligible to register
+
+# Recent additions
+aero    # members of the air-transport industry
+biz     # businesses
+coop    # cooperative associations
+info    # all are eligible to register
+museum  # museums
+name    # individuals
+pro     # credentialed professionals

Added: trunk/direct.openmoko.com/admin/includes/version.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/version.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/version.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  Chain Reaction Works, Inc
+  Copyright &copy; 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3573 $
+
+  Released under the GNU General Public License
+*/
+// define the project version
+  define('PROJECT_VERSION', 'CRE Loaded v 6.2');
+  define('PROJECT_PATCH', '08');
+  define('INSTALLED_VERSION_MAJOR', '6');
+  define('INSTALLED_VERSION_MINOR', '2');
+  define('INSTALLED_VERSION_TYPE', 'Standard');
+  define('INSTALLED_PATCH', '08');
+ 
+?>

Added: trunk/direct.openmoko.com/admin/includes/warnings.php
===================================================================
--- trunk/direct.openmoko.com/admin/includes/warnings.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/includes/warnings.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,125 @@
+<?php
+//check for encryption key
+    /*  Removed because the configuration keys are already loaded
+    $encrypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+    $encrypt = tep_db_fetch_array($encrypt_query);
+    $encrypt_path = $encrypt['configuration_value'];
+    $crypt_query1 = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_FILE'");
+    $encrypt1 = tep_db_fetch_array($crypt_query1);
+    $encrypt_file = $encrypt1['configuration_value'];
+    */
+  if ( defined('PAYMENT_CC_CRYPT_PATH') ) $encrypt_path = PAYMENT_CC_CRYPT_PATH;
+  if ( defined('PAYMENT_CC_CRYPT_FILE') ) $encrypt_file = PAYMENT_CC_CRYPT_FILE;
+
+  if (!(is_file(DIR_FS_CATALOG . DIR_WS_INCLUDES . $encrypt_path . $encrypt_file) ) ){
+      $messageStack->add('header', WARNING_ENCRYPT_FILE_MISSING, 'warning');
+    }
+
+// check if the 'install' directory exists, and warn of its existence
+  if (WARN_INSTALL_EXISTENCE == 'true') {
+    if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/../install')) {
+      $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
+    }
+  }
+
+// Eversun mod for upgrade database from 6.15 to 6.2
+// check if the 'upgrades' directory exists, and warn of its existence
+  if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/../upgrades')) {
+    $messageStack->add('header', WARNING_UPGRADES_DIRECTORY_EXISTS, 'warning');
+  }
+// Eversun mod end for upgrade database from 6.15 to 6.2
+
+// check if the admin configure.php file is writeable
+  if (WARN_CONFIG_WRITEABLE == 'true') {
+    if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
+      $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
+    }
+  }
+  
+// check if the catalog configure.php file is writeable
+  if (WARN_CONFIG_WRITEABLE == 'true') {
+    if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/../includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/../includes/configure.php')) ) {
+      $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE_CATALOG, 'warning');
+    }
+  }
+// check if the session folder is writeable
+  if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
+    if (STORE_SESSIONS == '') {
+      if (!is_dir(tep_session_save_path())) {
+        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
+      } elseif (!is_writeable(tep_session_save_path())) {
+        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
+      }
+    }
+  }
+
+
+// give the visitors a message that the website will be down at ... time
+  if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'false') ) {
+       $messageStack->add('header', TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE, 'warning');
+  }
+
+
+// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public
+  if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) ) {
+       $messageStack->add('header', TEXT_ADMIN_DOWN_FOR_MAINTENANCE, 'warning');
+  }
+
+// check session.auto_start is disabled
+  if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
+    if (ini_get('session.auto_start') == '1') {
+      $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
+    }
+  }
+  //download directory not writable
+
+  if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
+    if (!is_dir(DIR_FS_CATALOG . 'download/')) {
+      $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
+    }
+  }
+  
+//check for temp
+    if (!is_writeable(DIR_FS_CATALOG . 'tmp/')) {
+      $messageStack->add('header', WARNING_TMP_DIRECTORY_NON_EXISTENT, 'warning');
+    }
+  
+  
+// check if a default currency is set
+  if (!defined('DEFAULT_CURRENCY')) {
+    $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
+  }
+
+// check if a default language is set
+  if (!defined('DEFAULT_LANGUAGE')) {
+    $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
+  }
+//file up loads
+  if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {
+    $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
+  }
+
+  if ($messageStack->size('header') > 0) {
+    echo $messageStack->output('header');
+  }
+  
+  if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr class="headerError">
+    <td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>
+  </tr>
+</table>
+<?php
+  }
+
+  if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr class="headerInfo">
+    <td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>
+  </tr>
+</table>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/admin/index.php
===================================================================
--- trunk/direct.openmoko.com/admin/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,434 @@
+<?php
+require('includes/application_top.php');
+
+//get path of directory containing this script
+
+//Code to Check Backup Count
+//$handle = opendir(DIR_FS_BACKUP."/ravi");
+if ($handle = @opendir(DIR_FS_BACKUP)) 
+{
+  $count = 0;
+  //loop through the directory
+  $year="1900"; //please dont change this value
+  $dayofyear="0"; //please dont change this value
+  $lastbackupdate="";
+  while (($filename = readdir($handle)) !== false)
+  {
+    //evaluate each entry, removing the . & .. entries
+  if (($filename != ".") && ($filename != ".."))
+  {
+    $fileyear=date("Y", filemtime(DIR_FS_BACKUP.$filename));  
+    if($fileyear > $year)
+    {
+      $filedayofyear=date("z", filemtime(DIR_FS_BACKUP.$filename));   
+      $year=$fileyear;
+      $dayofyear=$filedayofyear;
+      $lastbackupdate=date("m/d/Y", filemtime(DIR_FS_BACKUP.$filename));
+    }
+    elseif($fileyear==$year)
+    {
+      $filedayofyear=date("z", filemtime(DIR_FS_BACKUP.$filename));   
+      if($filedayofyear > $dayofyear)
+      {     
+        $lastbackupdate=date("m/d/Y", filemtime(DIR_FS_BACKUP.$filename));      
+        $dayofyear=$filedayofyear;
+      } 
+    } 
+  $count++;
+  }
+  }
+}//dir check if
+else
+{$count=0;$lastbackupdate="";}
+define('BACKUP_COUNT',$count);
+define('LAST_BACKUP_DATE',$lastbackupdate);
+
+// Langauge code
+/*  $languages = tep_get_languages();
+  $languages_array = array();
+  $languages_selected = DEFAULT_LANGUAGE;
+  for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+    $languages_array[] = array('id' => $languages[$i]['code'],
+                               'text' => $languages[$i]['name']);
+    if ($languages[$i]['directory'] == $language) {
+      $languages_selected = $languages[$i]['code'];
+    }
+  }*/
+// Langauge code EOF  
+// Get admin name 
+  $my_account_query = tep_db_query ("select a.admin_id, a.admin_firstname, a.admin_lastname, a.admin_email_address, a.admin_created, a.admin_modified, a.admin_logdate, a.admin_lognum, g.admin_groups_name from " . TABLE_ADMIN . " a, " . TABLE_ADMIN_GROUPS . " g where a.admin_id= " . $login_id . " and g.admin_groups_id= " . $login_groups_id . "");
+  $myAccount = tep_db_fetch_array($my_account_query);
+  define('STORE_ADMIN_NAME',$myAccount['admin_firstname'] . ' ' . $myAccount['admin_lastname']);
+  define('TEXT_WELCOME','Welcome <strong>' . STORE_ADMIN_NAME . '</strong> to <strong>' . STORE_NAME . '</strong> Administration!');
+
+  define('MODE_FOR_MAINTENANCE_1',"Active");
+define('MODE_FOR_MAINTENANCE_2',"Maintanace");
+
+// Admin Name EOF
+// Store Status code 
+if (DOWN_FOR_MAINTENANCE == 'false'){
+  //$store_status = '<font color="#009900">Active</font>';
+  $store_status = '<font color="#009900">'.MODE_FOR_MAINTENANCE_1.'</font>';
+  } else {
+  //$store_status = '<font color="#FF0000">Maintanace</font>';
+  $store_status = '<font color="#FF0000">'.MODE_FOR_MAINTENANCE_2.'</font>';
+  }
+// Store Status Code EOF
+
+//Affiliate Count Code
+$affiliate_query = tep_db_query("select count(affiliate_id) as affiliatecnt from " . TABLE_AFFILIATE_AFFILIATE);
+$affiliatecount = tep_db_fetch_array($affiliate_query);
+define('AFFILIATE_COUNT',$affiliatecount['affiliatecnt']);
+
+$affiliate_query = tep_db_query("SELECT round(sum( affiliate_value),2)  AS affiliate, round(sum( ( affiliate_value * affiliate_percent ) / 100),2)  AS commission FROM  ".TABLE_AFFILIATE_SALES); 
+$affiliatecount = tep_db_fetch_array($affiliate_query);
+$affiliatesales=$affiliatecount['affiliate'];
+if($affiliatesales==""){$affiliatesales=0;}
+$affiliatecomm=$affiliatecount['commission'];
+if($affiliatecomm==""){$affiliatecomm=0;}
+define('AFFILIATE_SALES_AMOUNT',$affiliatesales);
+define('AFFILIATE_COMMISSION_AMOUNT',$affiliatecomm);
+
+//Category Count Code
+$category_query = tep_db_query("select count(categories_id) as catcnt from " . TABLE_CATEGORIES);
+$categorycount = tep_db_fetch_array($category_query);
+define('CATEGORY_COUNT',$categorycount['catcnt']);
+
+//Product Count Code
+$product_query = tep_db_query("select count(products_id) as productcnt from " . TABLE_PRODUCTS);
+$productcount = tep_db_fetch_array($product_query);
+define('PRODUCT_COUNT',$productcount['productcnt']);
+
+//Product Out of Stock Count Code
+$product_query = tep_db_query("select count(products_id) as productcnt from " . TABLE_PRODUCTS." where products_quantity=0");
+$productcount = tep_db_fetch_array($product_query);
+define('PRODUCT_OUT_OF_STOCK_COUNT',$productcount['productcnt']);
+
+
+//ActiveProduct Count Code
+$product_query = tep_db_query("select count(products_id) as productcnt from " . TABLE_PRODUCTS." where products_status=1");
+$productcount = tep_db_fetch_array($product_query);
+define('ACTIVE_PRODUCT_COUNT',$productcount['productcnt']);
+
+//Review Count Code
+$review_query = tep_db_query("select count(reviews_id) as reviewcnt from " . TABLE_REVIEWS);
+$reviewcount = tep_db_fetch_array($review_query);
+define('REVIEW_COUNT',$reviewcount['reviewcnt']);
+
+//Customer Count Code
+$customer_query = tep_db_query("select count(customers_id) as customercnt from " . TABLE_CUSTOMERS);
+$customercount = tep_db_fetch_array($customer_query);
+define('CUSTOMER_COUNT',$customercount['customercnt']);
+
+//Customer Subscribed Count Code
+$customer_query = tep_db_query("select count(customers_id) as customercnt from " . TABLE_CUSTOMERS." where customers_newsletter=1");
+$customercount = tep_db_fetch_array($customer_query);
+define('CUSTOMER_SUBSCRIBED_COUNT',$customercount['customercnt']);
+
+//LINK_CATEGORIE Count Code
+$link_categories_query = tep_db_query("select count(link_categories_id) as link_categoriescnt from " . TABLE_LINK_CATEGORIES);
+$link_categoriescount = tep_db_fetch_array($link_categories_query);
+define('LINK_CATEGORIES_COUNT',$link_categoriescount['link_categoriescnt']);
+
+//LINKS Count Code
+$link_query = tep_db_query("select count(links_id) as linkcnt from " . TABLE_LINKS);
+$linkcount = tep_db_fetch_array($link_query);
+define('LINKS_COUNT',$linkcount['linkcnt']);
+
+//LINKS Count Code
+$linkapproved_query = tep_db_query("select count(links_id) as linkapprovedcnt from " . TABLE_LINKS." where links_status=1");
+$linkapprovedcount = tep_db_fetch_array($linkapproved_query);
+define('LINKS_APPROVAL_COUNT',$linkapprovedcount['linkapprovedcnt']);
+ 
+//Language Count Code
+$langcount_query = tep_db_query("select count(languages_id ) as langcnt from " . TABLE_LANGUAGES);
+$langcount = tep_db_fetch_array($langcount_query);
+define('LANGUAGE_COUNT',$langcount['langcnt']);
+
+//Currencies Count Code
+$currcount_query = tep_db_query("select count(currencies_id) as currcnt from " . TABLE_CURRENCIES);
+$currcount = tep_db_fetch_array($currcount_query);
+define('CURRENCIES_COUNT',$currcount['currcnt']);
+
+//Tax Zone Code
+$zones="";
+$zone_query = tep_db_query("SELECT distinct geo_zone_name, tax_rate,b.geo_zone_id
+FROM ".TABLE_ZONES_TO_GEO_ZONES." a, ".TABLE_GEO_ZONES." b, ".TABLE_TAX_RATES." c
+where a.geo_zone_id = b.geo_zone_id
+and a.geo_zone_id = tax_zone_id");
+$tax_contents="";
+while ($zone_list = tep_db_fetch_array($zone_query)) {
+$tax_contents.="<li>".$zone_list['geo_zone_name'].' ('.$zone_list['tax_rate'].'%)'."</li><br>";
+  //Getting Further Zone Names
+  $subzone_query=tep_db_query("SELECT countries_name, zone_name
+  from ".TABLE_ZONES_TO_GEO_ZONES." a, ".TABLE_COUNTRIES." d, ".TABLE_ZONES." e
+  WHERE d.countries_id = a.zone_country_id AND e.zone_id = a.zone_id AND geo_zone_id = ".$zone_list['geo_zone_id']."
+  ORDER BY countries_name, zone_name");
+  while ($subzone_list = tep_db_fetch_array($subzone_query)) 
+  { 
+    $tax_contents.="&nbsp;-".$subzone_list['countries_name'].':'.$subzone_list['zone_name']."<br>";
+  }
+}
+
+//TEmplate Check code
+  $template_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_TEMPLATE'");
+  $template = tep_db_fetch_array($template_query);
+  $store_template = $template['configuration_value'] ;
+// Template Check Code EOF
+// Order Query
+$orders_contents = '';
+  $orders_status_query = tep_db_query("select orders_status_name, orders_status_id from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "'");
+    while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+    $orders_pending_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '" . $orders_status['orders_status_id'] . "'");
+    $orders_pending = tep_db_fetch_array($orders_pending_query);
+    if (tep_admin_check_boxes(FILENAME_ORDERS, 'sub_boxes') == true) {
+      $orders_contents .= '<li><a class="adminLink" href="' . tep_href_link(FILENAME_ORDERS, 'selected_box=customers&status=' . $orders_status['orders_status_id']) . '">' . $orders_status['orders_status_name'] . '</a> : ' . $orders_pending['count'] . "\n" . '<br>' ;
+    } else {
+      $orders_contents .= '' . $orders_status['orders_status_name'] . ': ' . $orders_pending['count'] . '<br>';
+    }
+  }
+// Order Query EOF
+// RSS Read Functions
+include('includes/functions/rss2html.php');
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<!-- Code related to index.php only -->
+<link type="text/css" rel="StyleSheet" href="includes/index.css" />
+<link type="text/css" rel="StyleSheet" href="includes/helptip.css" />
+<script type="text/javascript" src="includes/javascript/helptip.js"></script>
+<!-- code related to index.php EOF -->
+</head>
+<body>
+
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<table width="100%"  border="0" align="center" cellpadding="2" cellspacing="2">
+  <tr>
+    <td valign="top" width="150"><table border="0" width="150" cellspacing="1" cellpadding="1" class="columnLeft" align="center">
+        <!-- left_navigation //-->
+        <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+        <!-- left_navigation_eof //-->
+      </table></td>
+    <td valign="top"><table width="100%"  border="0" cellpadding="3" cellspacing="3" summary="Admin Links Welcome Table">
+        <tr>
+          <td colspan="2" class="admin_text"><?php echo TEXT_WELCOME;?></td>
+        </tr>
+    <!-- Removing This Part as this has been shifted to Header
+        <tr>
+          <td class="admin_text"><span class="main"><a href="<?php echo tep_href_link(FILENAME_ADMIN_ACCOUNT);?>" class="admin_text"><?php echo TEXT_CHANGE_PASWORD;?></a> | <a href="<?php echo tep_href_link(FILENAME_LOGOFF);?> " class="admin_text"><?php echo TEXT_LOGOUT;?></a></span></td>
+          <td align="right" class="main"><span class="admin_text"><?php echo TEXT_ADMIN_LANG . tep_draw_form('languages', 'index.php', '', 'get');
+      echo tep_draw_pull_down_menu('language', $languages_array, $languages_selected, 'onChange="this.form.submit();"'); ?>
+      </form></span> </td>
+        </tr>
+    -->   
+      </table>
+      <table width="100%"  border="0" cellspacing="0" cellpadding="0" style="border:1px solid #CCCCCC; " summary="Title Table">
+        <tr>
+          <td align="center" >
+       <?php echo tep_draw_separator('pixel_trans.gif', '100%', '7'); ?>
+      <?php echo PROJECT_VERSION .'[' . PROJECT_PATCH .']';
+      $upgradeURL="http://store.creloaded.com/index.php?cPath=27&product_version=".urlencode(PROJECT_VERSION)."&product_patchlevel=".'[' . urlencode(PROJECT_PATCH) .']';
+      ?>
+      <input type="submit" name="Submit" value="<?php echo TEXT_CHECK_UPDATES;?>" onclick="javascript:window.open('<?php echo $upgradeURL?>','k')">
+      &nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="     <?php echo TEXT_GET_PRO;?>     " onclick="javascript:window.open('<?php echo $upgradeURL?>','k')">
+            <?php echo tep_draw_separator('pixel_trans.gif', '100%', '7'); ?></td>
+        </tr>
+      </table>
+      <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+   
+      <!--BLOCK CODE START-->
+    
+     <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="Table holding Store Information">
+         <tr valign="top">
+          <td width="50%"><fieldset>
+            <legend> <?php echo BLOCK_TITLE_STORE_INFO;?> (<a href="<?php echo tep_href_link(FILENAME_CONFIGURATION,'gID=1','NONSSL');?>"><?php echo TEXT_MANAGE;?></a>) <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_STORE_INFO;?>', this, event, '250px'); return false">[?]</a></legend>
+            <ul>
+              <li><?php echo BLOCK_CONTENT_STORE_INFO_STORE_NAME . ' : ' . STORE_NAME;?> </li>
+              <li><?php echo BLOCK_CONTENT_STORE_INFO_STORE_STATUS;?> : <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_STORE_STATUS;?>', this, event, '250px'); return false"><strong><?php echo $store_status;?></strong></a> </li>
+              <li><?php echo BLOCK_CONTENT_STORE_INFO_STORE_EMAIL . ' : ' . STORE_OWNER_EMAIL_ADDRESS;?> </li>
+              <li><?php echo BLOCK_CONTENT_STORE_INFO_STORE_TEMPLATE . ' : ' . $store_template;?></li>
+              <li><?php echo BLOCK_CONTENT_STORE_INFO_STORE_LANGUAGE . ' : ' . DEFAULT_LANGUAGE.' ('.LANGUAGE_COUNT;?>  Installed) </li>
+              <li><?php echo BLOCK_CONTENT_STORE_INFO_STORE_CURRENCY . ' : ' . DEFAULT_CURRENCY.' ('.CURRENCIES_COUNT;?>  Installed) </li>              
+              <li><?php echo BLOCK_CONTENT_STORE_INFO_STORE_BACKUPS.' : '.BACKUP_COUNT;?>  (Latest <?php echo LAST_BACKUP_DATE?>) <a href="<?php echo tep_href_link(FILENAME_BACKUP);?>" onMouseover="showhint('<?php echo BLOCK_HELP_STORE_BACKUP;?>', this, event, '180px'); return false"><font color="#FF0000">[!]</font></a></li>
+            </ul>
+            </fieldset>
+      </td>
+      <td width="3"><?php echo tep_draw_separator('pixel_trans.gif', '3', '3'); ?></td>
+      <td width="50%"><fieldset>
+            <legend><?php echo BLOCK_TITLE_ORDERS;?> (<a href="#"><?php echo TEXT_ADD;?></a>) <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_ORDERS;?>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+        <?php echo substr($orders_contents, 0, -4); ?>
+            </ul>
+      </fieldset></td>
+        </tr>
+    
+    <tr valign="top">
+    <td colspan=2>
+    <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+    </td>
+    </tr>
+    
+      <tr valign="top">
+          <td width="50%"><fieldset>
+            <legend><?php echo BLOCK_TITLE_REPORTS;?> <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_REPORTS;?>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+              <li><a class="adminLink" href="<?php echo tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED,'selected_box=reports','NONSSL');?>"><?php echo BLOCK_CONTENT_REPORTS_PRODUCTS_VIEWED;?></a></li>
+              <li><a class="adminLink" href="<?php echo tep_href_link(FILENAME_STATS_PRODUCTS_PURCHASED,'selected_box=reports','NONSSL');?>"><?php echo BLOCK_CONTENT_REPORTS_PRODUCTS_PURCHASED;?></a></li>
+              <li><a class="adminLink" href="<?php echo tep_href_link(FILENAME_STATS_CUSTOMERS,'selected_box=reports','NONSSL');?>"><?php echo BLOCK_CONTENT_REPORTS_CUSTOMER_ORDERS_TOTAL;?></a></li>
+              <li><a class="adminLink" href="<?php echo tep_href_link(FILENAME_STATS_MONTHLY_SALES,'selected_box=reports','NONSSL');?>"><?php echo BLOCK_CONTENT_REPORTS_MONTHLY_SALES_TAX;?></a></li>
+            </ul>
+            </fieldset></td>
+          <td width="3"><?php echo tep_draw_separator('pixel_trans.gif', '3', '3'); ?></td>
+          <td width="50%"><fieldset>
+            <legend> <?php echo BLOCK_TITLE_PRODUCTS;?> (<a href="<?php echo tep_href_link(FILENAME_CATEGORIES,'selected_box=catalog','NONSSL');?>"><?php echo TEXT_MANAGE;?></a><a href="#"></a>) <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_PRODUCTS;?>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+              <li><?php echo BLOCK_CONTENT_PRODUCTS_CATEGORIES.' : '.CATEGORY_COUNT;?></li>
+              <li><?php echo BLOCK_CONTENT_PRODUCTS_TOTAL_PRODUCTS.' : '.PRODUCT_COUNT;?></li>
+              <li><?php echo BLOCK_CONTENT_PRODUCTS_ACTIVE.' : '.ACTIVE_PRODUCT_COUNT;?></li>
+              <li><?php echo BLOCK_CONTENT_PRODUCTS_NOSTOCK.' : '.PRODUCT_OUT_OF_STOCK_COUNT;?></li>
+            </ul>
+            </fieldset></td>
+        </tr>
+    
+    <tr valign="top">
+    <td colspan=2>
+    <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+    </td>
+    </tr>
+    
+    
+    <tr valign="top">
+          <td width="50%"><fieldset>
+            <legend><?php echo BLOCK_TITLE_REVIEWS;?> (<a href="<?php echo tep_href_link(FILENAME_REVIEWS,'selected_box=catalog','NONSSL');?>"><?php echo TEXT_MANAGE;?></a>) <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_REVIEWS;?>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+              <li><?php echo BLOCK_CONTENT_REVIEWS_TOTAL_REVIEWS.' : '.REVIEW_COUNT;?></li>
+              <!-- <li><?php echo BLOCK_CONTENT_REVIEWS_WAITING_APPROVAL;?>: 2 </li> -->
+            </ul>
+            </fieldset></td>
+          <td width="3"><?php echo tep_draw_separator('pixel_trans.gif', '3', '3'); ?></td>
+          <td width="50%"><fieldset>
+            <legend><?php echo BLOCK_TITLE_CUSTOMERS;?> (<a href="<?php echo tep_href_link(FILENAME_CREATE_ACCOUNT,'selected_box=customers','NONSSL');?>"><?php echo TEXT_ADD;?></a> / <a href="<?php echo tep_href_link(FILENAME_CUSTOMERS,'selected_box=customers','NONSSL');?>"><?php echo TEXT_VIEW;?></a>) <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_CUSTOMERS;?>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+              <li><?php echo BLOCK_CONTENT_CUSTOMERS_TOTAL.' : '.CUSTOMER_COUNT;?></li>
+              <li><?php echo BLOCK_CONTENT_CUSTOMERS_SUBSCRIBED.' : '.CUSTOMER_SUBSCRIBED_COUNT;?></li>
+            </ul>
+            </fieldset></td>
+        </tr>
+
+    <tr valign="top">
+    <td colspan=2>
+    <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+    </td>
+    </tr>
+    
+    
+      <tr valign="top">
+          <td width="50%"><fieldset>
+            <legend><?php echo BLOCK_TITLE_AFFILIATE;?> (<a href="<?php echo tep_href_link(FILENAME_AFFILIATE,'selected_box=affiliate','NONSSL');?>"><?php echo TEXT_MANAGE;?></a>) <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_AFFILIATE;?>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+              <li><?php echo BLOCK_CONTENT_AFFILIATE_TOTAL.' : '.AFFILIATE_COUNT;?></li>
+              <li><?php echo BLOCK_CONTENT_AFFILIATE_SALES.' : $'.AFFILIATE_SALES_AMOUNT;?></li>
+              <li><?php echo BLOCK_CONTENT_AFFILIATE_COMMISSION.' : $'.AFFILIATE_COMMISSION_AMOUNT;?></li>
+            </ul>
+            </fieldset></td>
+          <td width="3"><?php echo tep_draw_separator('pixel_trans.gif', '3', '3'); ?></td>
+          <td width="50%"><fieldset>
+            <legend><?php echo BLOCK_TITLE_LINKS;?> (<a href="<?php echo tep_href_link(FILENAME_LINKS,'selected_box=links','NONSSL');?>"><?php echo TEXT_MANAGE;?></a><a href="#"></a>) <a class="helpLink" href="?" onMouseover="showhint('<ul><li><strong>Links</strong><br>Total number of Links and categories in database. Use \'Manage\' link to manage links and link categories.</li></ul>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+              <li><?php echo BLOCK_CONTENT_LINKS_TOTAL.' : '.LINKS_COUNT;?></li>  
+              <li><?php echo BLOCK_CONTENT_LINKS_CATEGORIES.' : '.LINK_CATEGORIES_COUNT;?></li>
+              <li><?php echo BLOCK_CONTENT_LINKS_WAITING.' : '.LINKS_APPROVAL_COUNT;?></li>
+            </ul>
+            </fieldset></td>
+        </tr>
+    
+    <tr valign="top">
+    <td colspan=2>
+    <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+    </td>
+    </tr>
+    
+    
+       <tr valign="top">
+          <td width="50%"><fieldset>
+            <legend><?php echo BLOCK_TITLE_TAX_RATES;?> (<a href="<?php echo tep_href_link(FILENAME_TAX_RATES,'selected_box=catalog','NONSSL');?>"><?php echo TEXT_MANAGE;?></a>)<a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_TAXES;?>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+      <?php echo $tax_contents;?>
+            </ul>
+            </fieldset>
+      </td>
+          <td width="3"><?php echo tep_draw_separator('pixel_trans.gif', '3', '3'); ?></td>
+          <td width="50%">&nbsp;</td>
+        </tr>
+    
+     <!--
+        <tr valign="top">
+          <td width="50%"><fieldset>
+            <legend><?php echo BLOCK_TITLE_SHIPPING_MODULES;?> (<a href="<?php echo tep_href_link(FILENAME_MODULES,'set=shipping','NONSSL');?>"><?php echo TEXT_MANAGE;?></a><a href="#"></a>) <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_SHIPPING_MODULES;?>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+              <li><?php echo BLOCK_CONTENT_SHIPPING_MODULES_INSTALLED;?> : 3 </li>
+              <li><?php echo BLOCK_CONTENT_SHIPPING_MODULES_ENABLED;?>: 2 </li>
+            </ul>
+            </fieldset></td>
+          <td width="3"><?php echo tep_draw_separator('pixel_trans.gif', '3', '3'); ?></td>
+          <td width="50%"><fieldset>
+            <legend><?php echo BLOCK_TITLE_PAYMENT_MODULES;?> (<a href="<?php echo tep_href_link(FILENAME_MODULES,'set=payment','NONSSL');?>"><?php echo TEXT_MANAGE;?></a>) <a class="helpLink" href="?" onMouseover="showhint('<?php echo BLOCK_HELP_PAYMENT_MODULES;?>', this, event, '250px'); return false">[?]</strong></a></legend>
+            <ul>
+              <li><?php echo BLOCK_CONTENT_PAYMENT_MODULES_INSTALLED;?> : 1 </li>
+              <li><?php echo BLOCK_CONTENT_PAYMENT_MODULES_ENABLED;?>: 1 </li>
+            </ul>
+            </fieldset></td>
+        </tr>   
+    -->
+    
+      </table>
+    
+    <!--BLOCK CODE ENDS -->
+   
+     
+      <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+      <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="Footer Banner Table">
+        <tr>
+          <td align="center">
+          
+<!-- former position of bottom banner code -->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+      
+      </td>
+        </tr>
+      </table></td>
+    <td width="150" valign="top">
+<table width="100%"  border="0" cellspacing="0" cellpadding="0">
+  <tr>
+    <td valign="top"><fieldset>
+      <legend><?php echo  BLOCK_TITLE_CRE_FORGE?> </legend>
+      <a class="adminLink" href="http://creforge.com/tracker/?atid=126&group_id=12&" target="_blank"><?php echo  BLOCK_CONTENT_CRE_FORGE_BUG_TRACKER;?></a> <br>
+    <a class="adminLink" href="http://creforge.com/tracker/?atid=129&group_id=12&" target="_blank"><?php echo  BLOCK_CONTENT_CRE_FORGE_FEATURE_REQUESTS;?></a> <br>
+    <a class="adminLink" href="http://creforge.com/scm/?group_id=12" target="_blank"><?php echo  BLOCK_CONTENT_CRE_FORGE_SVN_REPOSITORY?></a> <br>
+<!--    <a class="adminLink" href="http://creforge.com/tracker/?atid=127&group_id=12&" target="_blank"><?php echo  BLOCK_CONTENT_CRE_FORGE_SUPPORT_REQUEST?></a> <br> -->
+      <a class="adminLink" href="http://creforge.com/frs/?group_id=12" target="_blank"><?php echo  BLOCK_CONTENT_CRE_FORGE_FILE_RELEASES?></a>
+      </fieldset>
+    <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+      <fieldset>
+      <legend><?php echo  BLOCK_TITLE_CRE_NEWS?></legend>
+      <iframe src="rsslink.php" FRAMEBORDER=0 WIDTH=140 HEIGHT=400 class="adminLink"> 
+      </iframe>
+      </fieldset></td>
+  </tr>
+</table></td>
+  </tr>
+</table>
+
+<!-- former position of disclaimer  -->
+
+</body>
+</html>
+

Added: trunk/direct.openmoko.com/admin/infobox_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/infobox_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/infobox_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,206 @@
+<?php
+/*
+  $Id: template_admin.php,v 1.1.1.1 2004/03/04 23:39:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//300
+
+  require('includes/application_top.php');
+  $gID = '350';
+  // #CP - local dir to the template directory where you are uploading the company logo
+  $template_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_TEMPLATE'");
+  $template = tep_db_fetch_array($template_query);
+  $CURR_TEMPLATE = $template['configuration_value'] . '/';
+
+  $upload_fs_dir = DIR_FS_TEMPLATES.$CURR_TEMPLATE.DIR_WS_IMAGES;
+  $upload_ws_dir = DIR_WS_TEMPLATES.$CURR_TEMPLATE.DIR_WS_IMAGES;
+  // #CP
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'save':
+        $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);
+        $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+        break;
+
+
+// #CP - supporting functions to upload company logo to template images directory
+    }
+// #CP
+  }
+
+
+  $cfg_group_query = tep_db_query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '350'");
+  $cfg_group = tep_db_fetch_array($cfg_group_query);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="12">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo TEXT_HEADER_EXPLAIN ; ?></td>
+            <td" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>            
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+           <td colspan="3" class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_LAYOUT; ?></td>
+          </tr>
+<?php // layout box configuration 
+;?>
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '" . (int)$gID . "' order by sort_order");
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+    if (tep_not_null($configuration['use_function'])) {
+      $use_function = $configuration['use_function'];
+      if (ereg('->', $use_function)) {
+        $class_method = explode('->', $use_function);
+        if (!is_object(${$class_method[0]})) {
+          include(DIR_WS_CLASSES . $class_method[0] . '.php');
+          ${$class_method[0]} = new $class_method[0]();
+        }
+        $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
+      } else {
+        $cfgValue = tep_call_function($use_function, $configuration['configuration_value']);
+      }
+    } else {
+      $cfgValue = $configuration['configuration_value'];
+    }
+
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cfg_extra_query = tep_db_query("select configuration_key, configuration_description, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . (int)$configuration['configuration_id'] . "'");
+      $cfg_extra = tep_db_fetch_array($cfg_extra_query);
+
+      $cInfo_array = array_merge($configuration, $cfg_extra);
+      $cInfo = new objectInfo($cInfo_array);
+    }
+
+    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
+      if($cInfo->set_function == 'file_upload'){
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=upload') . '\'">' . "\n";
+      } else {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
+      }
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $configuration['configuration_title']; ?></td>
+                <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>                  </table></td>
+
+            
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'edit':
+      $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function) {
+        eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value) . '");');
+      } else {
+        $value_field = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
+      }
+
+      $contents = array('form' => tep_draw_form('configuration', FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function == 'file_upload') {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=upload') . '">' . tep_image_button('button_upload.gif', IMAGE_EDIT) . '</a>'.'<p>');
+        $contents[] = array('align' => 'center', 'text' => tep_image($upload_ws_dir . $cInfo->configuration_value, IMAGE_EDIT));
+      } else {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+      }
+        $contents[] = array('text' => '<br>' . $cInfo->configuration_description);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
+        if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
+      }
+
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/infobox_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/infobox_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/infobox_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,899 @@
+<?php
+/*
+  $Id: infobox_configuration.php,v 1.1.1.1 2004/03/04 23:38:38 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+
+////
+// Alias function for Store configuration values in the Administration Tool
+  function tep_cfg_select_option_infobox($select_array, $key_value, $key = '') {
+    $string = '';
+
+    for ($i=0, $n=sizeof($select_array); $i<$n; $i++) {
+      $name = ((tep_not_null($key)) ? 'infobox_' .$key  : 'infobox_display');
+      $string .= '<input type="radio" name="' . $name . '" value="' . $select_array[$i] . '"';
+      if ($key_value == $select_array[$i]) $string .= ' CHECKED';
+      $string .= '> ' . $select_array[$i];
+    }
+    return $string;
+  }
+
+  function tep_get_templates() {
+    $templates_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " order by template_id");
+    while ($template = tep_db_fetch_array($templates_query)) {
+      $template_array[] = array('id' => $template['template_id'],
+                                 'name' => $template['template_name']);
+    }
+
+    return $template_array;
+  }
+  
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+
+    switch ($action) {
+
+    case 'add_language_files': //create language heading entries.
+// pull infobox info
+     $infobox_query = tep_db_query("select box_heading, infobox_id from " . TABLE_INFOBOX_CONFIGURATION);
+    // $infobox = tep_db_fetch_array($infobox_query);
+ while ($infobox = tep_db_fetch_array($infobox_query)) {
+          $languages = tep_get_languages();
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $language_id = $languages[$i]['id'];
+          $box_heading = tep_db_prepare_input($infobox['box_heading']);
+          $infobox_id = $infobox['infobox_id'];
+          $box_heading = str_replace("'", "\\'", $box_heading);
+
+          //$box_heading = strtr ( $box_heading, "\'", '\'' )
+      
+           tep_db_query("insert into " . TABLE_INFOBOX_HEADING . " (infobox_id, languages_id, box_heading) values ('" . $infobox_id . "', '" . $language_id . "', '" . $box_heading . "') ");
+       }
+      } 
+       tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+
+        break;
+
+     case 'position_update': //set the status of a template active buttons.
+        if ( ($HTTP_GET_VARS['flag'] == 'up') || ($HTTP_GET_VARS['flag'] == 'down') ) {
+          if ($HTTP_GET_VARS['gID']) {
+            tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set  location = '" . $HTTP_GET_VARS['loc'] .  "', last_modified = now() where location = '" . $HTTP_GET_VARS['loc1'] . "' and display_in_column = '" . $HTTP_GET_VARS['col'] . "'");
+
+            tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set  location = '" . $HTTP_GET_VARS['loc1'] .  "', last_modified = now() where infobox_id = '" . (int)$iID . "' and display_in_column = '" . $HTTP_GET_VARS['col'] . "'");
+        }
+        }
+tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $iID));
+        break;
+
+
+case 'fixweight':
+    global  $infobox_id, $cID;
+    $rightpos = 'right';
+    $leftpos = 'left';
+
+    $result_query = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where display_in_column = '" . $leftpos . "' and template_id = '" . (int)$gID . "' order by location");
+
+    $sorted_position = 0;
+      while ($result = tep_db_fetch_array($result_query)) {
+  $sorted_position++;
+  tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set location = '" . $sorted_position . "' where infobox_id = '" . (int)$result['infobox_id'] . "' and template_id = '" . (int)$gID . "'");
+    }
+
+    $result_query = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where display_in_column = '" . $rightpos . "' and template_id = '" . (int)$gID . "' order by location");
+
+    $sorted_position = 0;
+      while ($result = tep_db_fetch_array($result_query)) {
+  $sorted_position++;
+  tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set location = '" . $sorted_position . "' where infobox_id = '" . (int)$result['infobox_id'] . "' and template_id = '" . (int)$gID . "'");
+    }
+
+tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+        break;
+
+
+      case 'setflag': //set the status of a news item.
+        if ( ($HTTP_GET_VARS['flag'] == 'no') || ($HTTP_GET_VARS['flag'] == 'yes') ) {
+          if ($HTTP_GET_VARS['cID']) {
+            tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set infobox_display = '" . $HTTP_GET_VARS['flag'] . "' where infobox_id = '" . (int)$cID . "'");
+          }
+        }
+
+tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+        break;
+
+      case 'setflagcolumn': //set the status of a news item.
+        if ( ($HTTP_GET_VARS['flag'] == 'left') || ($HTTP_GET_VARS['flag'] == 'right') ) {
+          if ($HTTP_GET_VARS['cID']) {
+            tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set display_in_column = '" . $HTTP_GET_VARS['flag'] . "' where infobox_id = '" . (int)$cID . "' and template_id = '" . $HTTP_GET_VARS['gID'] . "'");
+          }
+        }
+
+tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+        break;
+
+      case 'save':
+
+      $error = false;
+    if ($infobox_file_name == "") {
+    $error = true;
+    $messageStack->add('infobox_error_save', JS_INFO_BOX_FILENAME);
+  }
+  if ($box_heading == "") {
+    $error = true;
+    $messageStack->add('infobox_error_save', JS_INFO_BOX_HEADING);
+  }
+  if ($infobox_define == "" || $infobox_define == "BOX_HEADING_????") {
+    $error = true;
+    $messageStack->add('infobox_error_save', JS_BOX_HEADING);
+  }
+  if ($hexval == "") {
+     $error = true;
+     $messageStack->add('infobox_error_save', JS_BOX_COLOR);
+  }
+ 
+ if ($error == 'true') {
+//do nothing and display error 
+ }else{
+      $configuration_active = tep_db_prepare_input($HTTP_POST_VARS['infobox_active']);
+
+
+      $infobox_file_name = tep_db_prepare_input($HTTP_POST_VARS['infobox_file_name']);
+      $infobox_define = tep_db_prepare_input($HTTP_POST_VARS['infobox_define']);
+      $display_in_column = tep_db_prepare_input($HTTP_POST_VARS['infobox_column']);
+      $location = tep_db_prepare_input($HTTP_POST_VARS['location']);
+   //   $box_heading = tep_db_prepare_input($HTTP_POST_VARS['box_heading']);
+      $box_template = tep_db_prepare_input($HTTP_POST_VARS['box_template']);
+      $box_heading_font_color = tep_db_prepare_input($HTTP_POST_VARS['hexval']);
+      $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set infobox_file_name = '" . tep_db_input($infobox_file_name) . "',
+               infobox_define = '" . tep_db_input($infobox_define) . "',
+               location = '" . tep_db_input($location) . "',
+               display_in_column = '" . tep_db_input($display_in_column) . "',
+               infobox_display = '" . tep_db_input($configuration_active) . "',
+               box_template = '" . tep_db_input($box_template) . "',
+               box_heading_font_color = '" . tep_db_input($box_heading_font_color) . "',
+               last_modified = now() where infobox_id = '" . (int)$cID . "' and template_id = '" . $HTTP_GET_VARS['gID'] . "'");
+
+          $languages = tep_get_languages();
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $language_id = $languages[$i]['id'];
+          $box_heading = $HTTP_POST_VARS['box_heading'][$language_id];
+
+  tep_db_query("update " . TABLE_INFOBOX_HEADING . " set box_heading = '" . tep_db_input($box_heading) . "',
+                  languages_id = '" . tep_db_input($language_id) . "'
+              where infobox_id = '" . (int)$cID . "'and languages_id = '" . (int)$language_id . "'");
+      }
+        tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+       }
+       break;
+
+ case 'insert':
+  $error = false;
+    if ($infobox_file_name == "") {
+    $error = true;
+    $messageStack->add('infobox_error_insert', JS_INFO_BOX_FILENAME);
+  }
+  if ($box_heading == "") {
+    $error = true;
+    $messageStack->add('infobox_error_insert', JS_INFO_BOX_HEADING);
+  }
+  if ($infobox_define == "" || $infobox_define == "BOX_HEADING_????") {
+    $error = true;
+    $messageStack->add('infobox_error_insert', JS_BOX_HEADING);
+  }
+  if ($hexval == "") {
+     $error = true;
+     $messageStack->add('infobox_error_insert', JS_BOX_COLOR);
+  }
+ 
+ 
+ if ($error == 'true') {
+   // tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&action=edit'));
+ }else{
+      $infobox_file_name = tep_db_prepare_input($HTTP_POST_VARS['infobox_file_name']);
+      $infobox_define = tep_db_prepare_input($HTTP_POST_VARS['infobox_define']);
+      $configuration_active = tep_db_prepare_input($HTTP_POST_VARS['infobox_active']);
+      $display_in_column = tep_db_prepare_input($HTTP_POST_VARS['infobox_column']);
+      $location = tep_db_prepare_input($HTTP_POST_VARS['location']);
+      $box_template = tep_db_prepare_input($HTTP_POST_VARS['box_template']);
+      $box_heading_font_color = tep_db_prepare_input($HTTP_POST_VARS['hexval']);
+      $template_id = tep_db_prepare_input($HTTP_GET_VARS['gID']);
+
+      tep_db_query("insert into " . TABLE_INFOBOX_CONFIGURATION . " (template_id, infobox_file_name, infobox_display, infobox_define, display_in_column, location, box_heading, box_template, box_heading_font_color) values ('" . tep_db_input($template_id) . "', '" . tep_db_input($infobox_file_name) . "', '" . tep_db_input($configuration_active) . "', '" . tep_db_input($infobox_define) . "', '" . tep_db_input($display_in_column) . "', '" . tep_db_input($location) . "', '" . tep_db_input($box_heading) . "', '" . tep_db_input($box_template) . "', '" . tep_db_input($box_heading_font_color) . "')");
+    
+   $infobox_id1 = tep_db_insert_id() ; 
+   
+   $languages = tep_get_languages();
+         for ($i=0, $n=sizeof($languages); $i<$n; $i++) {   
+          $language_id = $languages[$i]['id'];
+          $box_heading = $HTTP_POST_VARS['box_heading'][$language_id];
+        tep_db_query("insert into " . TABLE_INFOBOX_HEADING . " (infobox_id, languages_id, box_heading) values ('" . $infobox_id1 . "', '" . $language_id . "', '" . tep_db_input($box_heading) . "')");
+       }
+       
+       tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID']));
+      }
+      break;
+
+    case 'deleteconfirm':
+      $cIDa = tep_db_prepare_input($HTTP_GET_VARS['cID']);;
+
+      tep_db_query("delete from " . TABLE_INFOBOX_CONFIGURATION . " where infobox_id = '" . tep_db_input($cIDa) . "'");
+      tep_db_query("delete from " . TABLE_INFOBOX_HEADING . " where infobox_id = '" . tep_db_input($cIDa) . "'");
+
+        tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID']));
+      break;
+    }
+  }
+
+  $gID = (isset($HTTP_GET_VARS['gID'])) ? $HTTP_GET_VARS['gID'] : 1;
+
+  $template = tep_get_templates();
+  $template_array = array();
+  $template_selected = '';
+
+  for ($i = 0, $n = sizeof($template); $i < $n; $i++) {
+    $template_array[] = array('id' => $template[$i]['id'],
+                               'text' => $template[$i]['name']);
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=450,height=300%,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+<script language="javascript"><!--
+var i=0;
+
+function resize() {
+  if (navigator.appName == 'Netscape') i = 40;
+  window.resizeTo(document.images[0].width + 30, document.images[0].height + 60 - i);
+}
+
+
+<!-- Begin
+function showColor(val) {
+document.infobox_configuration.hexval.value = val;
+}
+// End -->
+
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+
+
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('gID', FILENAME_INFOBOX_CONFIGURATION, '', 'get'); 
+            if (isset($HTTP_GET_VARS[tep_session_name()])) {
+              echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+            }
+          ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="center"><?php echo tep_draw_pull_down_menu('gID', $template_array,  $template_selected,
+  'onChange="this.form.submit();"'); ?></td></form>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($messageStack->size('infobox_error_save') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('infobox_error_save'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>      
+   <?php
+  if ($messageStack->size('infobox_error_insert') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('infobox_error_insert'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>        
+      <tr>
+        <td><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+            
+  <?php 
+  
+ //turn off
+if ($action == '') { 
+  ?>
+             <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_INFOBOX_FILE_NAME; ?></td>
+                <td width="70" class="dataTableHeadingContent"><?php echo TABLE_HEADING_FONT_COLOR; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ACTIVE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_COLUMN; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_TEMPLATE; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_KEY; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SORT_ORDER; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+
+<?php
+$count_left_active = 0;
+$count_right_active = 0;
+$totInf_boxes = 1;
+
+  $configuration_query = tep_db_query("select *  from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['gID'] . "' order by display_in_column, location");
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+  $languages = tep_get_languages();
+  $configuration_query1 = tep_db_query("select box_heading  from " . TABLE_INFOBOX_HEADING . " where infobox_id = '" . $configuration['infobox_id'] . "' and languages_id = '" . $languages_id . "'");
+  while($configuration1 = tep_db_fetch_array($configuration_query1)) {
+  $box_heading = $configuration1['box_heading'];
+  }
+// echo 'heading :' . $configuration['infobox_id'] . $box_heading . $languages_id;
+
+$totInf_boxes++;
+      $cfgloc = $configuration['location'];
+      $cfgValue = $configuration['infobox_display'];
+      $cfgcol = $configuration['display_in_column'];
+      $cfgtemp = $configuration['box_template'];
+      $cfgkey = $configuration['infobox_define'];
+      $cfgfont = $configuration['box_heading_font_color'];
+
+  $location1 = $cfgloc - 1;
+  $location3 = $cfgloc + 1;
+
+      $res = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['gID'] . "' and location = ' $location1 '  AND display_in_column ='$cfgcol'");
+$con1 =  tep_db_fetch_array($res);
+
+      $res2 = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['gID'] . "' and location = ' $location3 '  AND display_in_column ='$cfgcol'");
+$con2 =  tep_db_fetch_array($res2);
+
+
+
+if (($cfgcol == 'left') && ($cfgValue != 'no')) {
+$count_left_active++;
+} else if (($cfgcol == 'right') && ($cfgValue != 'no'))
+{$count_right_active++;
+}
+  $infobox_list .= $configuration['infobox_file_name']. ",";
+
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['infobox_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cfg_extra_query = tep_db_query("select * from " . TABLE_INFOBOX_CONFIGURATION . " where infobox_id = '" . (int)$configuration['infobox_id'] . "'");
+      $cfg_extra = tep_db_fetch_array($cfg_extra_query);
+
+      $cInfo_array = array_merge($configuration, $cfg_extra);
+      $cInfo = new objectInfo($cInfo_array);
+    }
+
+    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['infobox_id'] == $cInfo->infobox_id) ) {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->infobox_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' .   tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['infobox_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $box_heading; ?></td>
+                <td width="70"bgcolor="<?php echo $configuration['box_heading_font_color']; ?>">&nbsp;</td>
+                <td class="dataTableContent" align="center">
+<?php
+      if ($configuration['infobox_display'] == 'yes') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'action=setflag&flag=no&gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['infobox_id'] ) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'action=setflag&flag=yes&gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['infobox_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+
+
+                <td class="dataTableContent" align="center"><?php
+      if ($configuration['display_in_column'] == 'left') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_infobox_green.gif', IMAGE_INFOBOX_STATUS_GREEN, 14, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'action=setflagcolumn&flag=right&gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['infobox_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_infobox_red_light.gif', IMAGE_INFOBOX_STATUS_RED_LIGHT, 14, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'action=setflagcolumn&flag=left&gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['infobox_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_infobox_green_light.gif', IMAGE_INFOBOX_STATUS_GREEN_LIGHT, 14, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_infobox_red.gif', IMAGE_INFOBOX_STATUS_RED, 14, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="left"><?php echo htmlspecialchars($cfgtemp); ?></td>
+                <td class="dataTableContent" align="left"><?php echo htmlspecialchars($cfgkey); ?></td>
+
+
+<td height="30" align="center" valign="middle">
+<?php
+      if ($con1) {
+    echo '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'action=position_update&loc1=' .$location1.'&loc=' .$cfgloc.'&flag=up&col=' . $cfgcol . '&iID=' .$configuration['infobox_id'] . '&gID=' . $HTTP_GET_VARS['gID']) . '">' . tep_image(DIR_WS_IMAGES . 'up.gif', IMAGE_ICON_STATUS_UP_LIGHT, 11, 14) . '</a>&nbsp;&nbsp;';
+      }
+      if ($con2) {
+    echo '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'action=position_update&loc1=' .$location3.'&loc=' .$cfgloc.'&flag=down&col=' . $cfgcol . '&iID=' .$configuration['infobox_id'] . '&gID=' . $HTTP_GET_VARS['gID']) . '">' . tep_image(DIR_WS_IMAGES . 'down.gif', IMAGE_ICON_STATUS_DOWN_LIGHT, 11, 14) . '</a>';
+      }
+?>
+</td>
+
+                <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($configuration['infobox_id'] == $cInfo->infobox_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['infobox_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+  
+}
+//end list  
+?>
+
+            </table></td>
+<?php
+
+  $heading = array();
+  $contents = array();
+  
+//if ($messageStack->size('infobox_error') > 0)
+
+  if (($action == 'edit') || ($messageStack->size('infobox_error_insert') < 0)){
+//    case 'edit':
+
+$count_left_active = 0;
+$count_right_active = 0;
+$totInf_boxes = 1;
+
+  $configuration_query = tep_db_query("select *  from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['gID'] . "' order by display_in_column, location");
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+  $languages = tep_get_languages();
+  $configuration_query1 = tep_db_query("select box_heading  from " . TABLE_INFOBOX_HEADING . " where infobox_id = '" . $configuration['infobox_id'] . "' and languages_id = '" . $languages_id . "'");
+  while($configuration1 = tep_db_fetch_array($configuration_query1)) {
+  $box_heading = $configuration1['box_heading'];
+  }
+// echo 'heading :' . $configuration['infobox_id'] . $box_heading . $languages_id;
+
+$totInf_boxes++;
+      $cfgloc = $configuration['location'];
+      $cfgValue = $configuration['infobox_display'];
+      $cfgcol = $configuration['display_in_column'];
+      $cfgtemp = $configuration['box_template'];
+      $cfgkey = $configuration['infobox_define'];
+      $cfgfont = $configuration['box_heading_font_color'];
+
+  $location1 = $cfgloc - 1;
+  $location3 = $cfgloc + 1;
+
+      $res = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['gID'] . "' and location = ' $location1 '  AND display_in_column ='$cfgcol'");
+$con1 =  tep_db_fetch_array($res);
+
+      $res2 = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['gID'] . "' and location = ' $location3 '  AND display_in_column ='$cfgcol'");
+$con2 =  tep_db_fetch_array($res2);
+
+
+
+if (($cfgcol == 'left') && ($cfgValue != 'no')) {
+$count_left_active++;
+} else if (($cfgcol == 'right') && ($cfgValue != 'no'))
+{$count_right_active++;
+}
+  $infobox_list1 .= $configuration['infobox_file_name']. ",";
+
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['infobox_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cfg_extra_query = tep_db_query("select * from " . TABLE_INFOBOX_CONFIGURATION . " where infobox_id = '" . (int)$configuration['infobox_id'] . "'");
+      $cfg_extra = tep_db_fetch_array($cfg_extra_query);
+
+      $cInfo_array = array_merge($configuration, $cfg_extra);
+      $cInfo = new objectInfo($cInfo_array);
+    }
+    
+    }
+     echo tep_draw_form('infobox_configuration', FILENAME_INFOBOX_CONFIGURATION, tep_get_all_get_params(array('action')) . 'action=save', 'post', 'onSubmit="return check_form_info();"') . tep_draw_hidden_field('cID', $cInfo->infobox_id);
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2" bgcolor="#B3BAC5">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_INFO_HEADING_UPDATE_INFOBOX . ' -- <font color="' . $cInfo->box_heading_font_color . '">' . $cInfo->box_heading;?></font></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                  </tr>
+                </table>
+                </td>
+              </tr>
+              <tr>
+                <td colspan="4" class="infoBoxContent" width="100%" align="center">
+                <font color="red"><?php echo TEXT_NOTE_REQUIRED ;?></font> </td>
+              </tr>
+              <tr>
+                <td class="infoBoxContent" width="30%" align="center">
+<?php
+
+      echo '<br><b>' . TEXT_HEADING_FILENAME . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=filename') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_draw_input_field('infobox_file_name',$cInfo->infobox_file_name,'size="20"','true');
+?>
+                </td>
+                <td class="infoBoxContent" width="30%" align="center">
+<?php
+  echo '<br><b>' . TEXT_HEADING_HEADING . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=heading') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>' ;
+  $languages = tep_get_languages();
+         for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+  echo '<br> ' . tep_draw_input_field('box_heading[' . $languages[$i]['id'] . ']', tep_get_box_heading($cInfo->infobox_id, $languages[$i]['id']),'size="25"','true') . ' ' . $languages[$i]['name'];
+}
+?>
+                </td>
+                <td class="infoBoxContent" width="20%" align="center">
+<?php
+      echo '<br><b>' . TEXT_HEADING_WHICH_TEMPLATE . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=template') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_draw_input_field('box_template',$cInfo->box_template,'size="25"','true');
+?>
+                </td>
+                <td class="infoBoxContent" width="20%" align="center">
+<?php
+      echo '<br><b>' . TEXT_HEADING_WHICH_COL . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=column') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_cfg_select_option_infobox(array('left', 'right'),$cInfo->display_in_column,'column') . '</b><br>';
+?>
+</td>
+                    </tr>
+              <tr>
+                <td class="infoBoxContent" width="30%" align="center">
+<?php
+      echo '<br><b>' . TEXT_HEADING_WHAT_POS . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=position') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_draw_input_field('location',$cInfo->location,'size=3');
+?>
+ </td>
+                <td colspan="2" class="infoBoxContent" width="40%" align="center">
+<?php
+
+     echo '<br><b>' . TEXT_HEADING_DEFINE_KEY .  '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=define') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_draw_input_field('infobox_define',$cInfo->infobox_define,'size="35"','true');
+?>
+
+ </td>
+                <td class="infoBoxContent" width="30%" align="center">
+<?php
+
+      echo '<br><b>' . TEXT_HEADING_SET_ACTIVE . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=active') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_cfg_select_option_infobox(array('yes', 'no'),$cInfo->infobox_display,'active') . '</b><br><br>';
+
+?>
+</td>
+                    </tr>
+ <tr>
+                <td colspan="4" class="infoBoxContent" width="100%" align="center">
+<?php echo '<br><b>' . TEXT_HEADING_FONT_COLOR . '</b> <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=color') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> <br>';
+  include('select_color.htm');?>
+
+<?php
+
+      echo  tep_draw_input_field('hexval',$cInfo->box_heading_font_color,'size="10"','false');
+?>
+
+</td>
+                    </tr>
+              <tr>
+                <td colspan="4" class="infoBoxContent" width="100%" align="center">
+<?php
+      echo '<br><br><br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->infobox_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+?>
+</form>
+</td>
+                    </tr>
+
+<?php
+
+//      break;
+} else if( ($action == 'new') || ($messageStack->size('infobox_error_save') > 0) ){
+//case 'new':
+$count_left_active = 0;
+$count_right_active = 0;
+$totInf_boxes = 1;
+
+  $configuration_query = tep_db_query("select *  from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['gID'] . "' order by display_in_column, location");
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+  $languages = tep_get_languages();
+  $configuration_query1 = tep_db_query("select box_heading  from " . TABLE_INFOBOX_HEADING . " where infobox_id = '" . $configuration['infobox_id'] . "' and languages_id = '" . $languages_id . "'");
+  while($configuration1 = tep_db_fetch_array($configuration_query1)) {
+  $box_heading = $configuration1['box_heading'];
+  }
+// echo 'heading :' . $configuration['infobox_id'] . $box_heading . $languages_id;
+
+$totInf_boxes++;
+      $cfgloc = $configuration['location'];
+      $cfgValue = $configuration['infobox_display'];
+      $cfgcol = $configuration['display_in_column'];
+      $cfgtemp = $configuration['box_template'];
+      $cfgkey = $configuration['infobox_define'];
+      $cfgfont = $configuration['box_heading_font_color'];
+
+  $location1 = $cfgloc - 1;
+  $location3 = $cfgloc + 1;
+
+      $res = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['gID'] . "' and location = ' $location1 '  AND display_in_column ='$cfgcol'");
+$con1 =  tep_db_fetch_array($res);
+
+      $res2 = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['gID'] . "' and location = ' $location3 '  AND display_in_column ='$cfgcol'");
+$con2 =  tep_db_fetch_array($res2);
+
+
+
+if (($cfgcol == 'left') && ($cfgValue != 'no')) {
+$count_left_active++;
+} else if (($cfgcol == 'right') && ($cfgValue != 'no'))
+{$count_right_active++;
+}
+  $infobox_list1 .= $configuration['infobox_file_name']. ",";
+
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['infobox_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cfg_extra_query = tep_db_query("select * from " . TABLE_INFOBOX_CONFIGURATION . " where infobox_id = '" . (int)$configuration['infobox_id'] . "'");
+      $cfg_extra = tep_db_fetch_array($cfg_extra_query);
+
+      $cInfo_array = array_merge($configuration, $cfg_extra);
+      $cInfo = new objectInfo($cInfo_array);
+    }
+    
+    }
+
+      echo tep_draw_form('infobox_configuration', FILENAME_INFOBOX_CONFIGURATION, tep_get_all_get_params(array('action')) . 'action=insert', 'post', 'onSubmit="return check_form_info();"') . tep_draw_hidden_field('cID', $cInfo->infobox_id);
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2" bgcolor="#B3BAC5">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_INFO_HEADING_NEW_INFOBOX;?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+              <tr>
+                <td colspan="4" class="infoBoxContent" width="100%" align="center">
+<font color="red"><?php echo TEXT_NOTE_REQUIRED;?></font>
+</td>
+                    </tr>
+              <tr>
+                <td class="infoBoxContent" width="30%" align="center">
+<?php
+  $gID = $HTTP_GET_VARS['gID'];
+  
+  $templates_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " where template_id = " . $gID);
+    $template = tep_db_fetch_array($templates_query);
+
+ if ( file_exists(DIR_FS_TEMPLATES . $template['template_name'] . '/template.php')) {
+include(DIR_FS_TEMPLATES . $template['template_name'] . '/template.php');
+ } else {
+// selct the directory to look for boxes the selceted template, catalog template, or default template.
+if ( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle'])) {
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_TEMPLATES . TEMPLATE_NAME . '/boxes');
+}else if ( file_exists(DIR_FS_TEMPLATES . $template['template_name'] . '/boxes/' . $column['cfgtitle'])){
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_TEMPLATES . $template['template_name'] . '/boxes');
+ } else {
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_CATALOG . 'includes/boxes');
+ } 
+}
+
+    if ($handle1 = opendir(DIR_FS_TEMPLATE_BOXES)) {
+     /* This is the correct way to loop over the directory. */
+        while (false !== ($file1 = readdir($handle1))) {
+        if(is_file(DIR_FS_TEMPLATE_BOXES. '/' . $file1) && stristr($infobox_list1.".,..", $file1) == FALSE){
+        $dirs1[] = $file;
+          $dirs_array1[] = array('id' => $file1,
+                                 'text' => $file1);
+
+         }
+        }
+        closedir($handle1);
+     }
+
+      echo '<br><b>' . TEXT_HEADING_FILENAME . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=filename') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> <br>' . tep_draw_pull_down_menu('infobox_file_name',$dirs_array1,'', "style='width:150;'", 'true');
+?>
+ </td>
+                <td class="infoBoxContent" width="30%" align="center">
+<?php
+
+
+  echo '<br><b>' . TEXT_HEADING_HEADING . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=heading') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>' ;
+  $languages = tep_get_languages();
+         for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+  echo '<br> ' . tep_draw_input_field('box_heading[' . $languages[$i]['id'] . ']','Example','size="30"','true');
+        echo ' ' .   $languages[$i]['name'];
+        }
+?>
+ </td>
+                <td class="infoBoxContent" width="20%" align="center">
+<?php
+      echo '<br><b>' . TEXT_HEADING_WHICH_TEMPLATE . '</b> <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=template') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_draw_input_field('box_template','infobox','size="25"','true');
+?>
+ </td>
+                <td class="infoBoxContent" width="20%" align="center">
+<?php
+      echo '<br><b>' . TEXT_HEADING_WHICH_COL . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=column') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_cfg_select_option_infobox(array('left', 'right'),'left','column') . '</b><br>';
+?>
+</td>
+                    </tr>
+              <tr>
+                <td class="infoBoxContent" width="30%" align="center">
+<?php
+      echo '<br><b>' . TEXT_HEADING_WHAT_POS . '</b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=position') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_draw_input_field('location',$totInf_boxes,'size=3');
+?>
+ </td>
+                <td colspan="2" class="infoBoxContent" width="40%" align="center">
+<?php
+
+      echo '<br><b>' . TEXT_HEADING_DEFINE_KEY . '</b> <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=define') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_draw_input_field('infobox_define','BOX_HEADING_EXAMPLE','size="35"','true');
+?>
+ </td>
+                <td class="infoBoxContent" width="30%" align="center">
+<?php
+
+      echo '<br><b>' . TEXT_HEADING_SET_ACTIVE . '</b> <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=active') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a><br> ' . tep_cfg_select_option_infobox(array('yes', 'no'),'yes','active') . '</b><br>';
+?>
+</td>
+                    </tr>
+    <tr>
+                <td colspan="4" class="infoBoxContent" width="100%" align="center">
+<?php echo '<br><b>' . TEXT_HEADING_FONT_COLOR . '</b> <a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_INFOBOX_HELP,'action=color') . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a> <br>';
+
+ include('select_color.htm');?>
+
+<?php
+
+
+      echo  tep_draw_input_field('hexval',$cInfo->box_heading_font_color,'size="10"','true');
+?>
+
+</td>
+                    </tr>
+              <tr>
+                <td colspan="4" class="infoBoxContent" width="100%" align="center">
+<?php
+      echo '<br>' . tep_image_submit('button_module_install.gif', IMAGE_INSERT) . '&nbsp;<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+?>
+</form>
+</td>
+                    </tr>
+
+<?php
+
+//      break;
+} elseif ($action == 'delete') {
+// case 'delete':
+?>
+<tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2" bgcolor="#B3BAC5">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_INFO_HEADING_DELETE_INFOBOX . ' -- ' . $cInfo->box_heading;?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+
+      $contents = array('form' => tep_draw_form('configuration', FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $HTTP_GET_VARS['cID'] . '&action=deleteconfirm'));
+      $contents[] = array('align' => 'center', 'text' => TEXT_INFO_DELETE_INTRO);
+
+
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_module_remove.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $HTTP_GET_VARS['cID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+ //     break;
+}else{
+//default:
+//check to see if infobox_heading table is empty, if not show create button
+ $configuration_query2 = tep_db_query("select box_heading  from " . TABLE_INFOBOX_HEADING);
+if (tep_db_num_rows($configuration_query2) <= 0){
+          $create_button= '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'action=add_language_files&gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $HTTP_GET_VARS['cID']) . '">' . tep_image_button('button_create.gif', IMAGE_CREATE_LANGUAGE) . '</a>' ;
+ } else {
+  $create_button = '';
+}
+ $gID = $HTTP_GET_VARS['gID'];
+
+  $templates_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " where template_id = " . $gID);
+  $template = tep_db_fetch_array($templates_query);
+ 
+ if ( file_exists(DIR_FS_TEMPLATES . $template['template_name'] . '/template.php')) {
+include(DIR_FS_TEMPLATES . $template['template_name'] . '/template.php');
+ } else {
+// selct the directory to look for boxes the selceted template, catalog template, or default template.
+if ( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle'])) {
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_TEMPLATES . TEMPLATE_NAME . '/boxes');
+}else if ( file_exists(DIR_FS_TEMPLATES . $template['template_name'] . '/boxes/' . $column['cfgtitle'])){
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_TEMPLATES . $template['template_name'] . '/boxes');
+ } else {
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_CATALOG . 'includes/boxes');
+ } 
+}
+
+
+
+      if (is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->infobox_file_name . '</b>');
+        
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->infobox_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>' .
+                     '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->infobox_id . '&action=delete') . '">' . tep_image_button('button_module_remove.gif', IMAGE_DELETE) . '</a>' .
+                     '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'action=fixweight&gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->infobox_id) . '">' . tep_image_button('button_update_box_positions.gif', IMAGE_UPDATE) . '</a>' .
+                     $create_button );
+
+ //search for boxes in box directory
+         
+
+  if (file_exists(DIR_FS_TEMPLATE_BOXES) && ($handle = opendir(DIR_FS_TEMPLATE_BOXES))) {
+   /* This is the correct way to loop over the directory. */
+      while (false !== ($file = readdir($handle))) {
+      if(is_file(DIR_FS_TEMPLATE_BOXES . '/' . $file) && stristr($infobox_list.".,..", $file) == FALSE){
+          $avail_boxes ++;
+        }
+      }
+      closedir($handle);
+      if (($action != 'new') && ($action != 'edit') && ($action != 'delete') && ($avail_boxes > 0)){
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_INFOBOX_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&action=new') . '">' . tep_image_button('button_module_install.gif', IMAGE_NEW_INFOBOX) . '</a>');
+    }
+      else if($avail_boxes == 0){
+        $contents[] = array('align' => 'center', 'text' => infobox_error1 );
+
+      }
+  }
+  else{
+        $contents[] = array('align' => 'center', 'text' => infobox_error1);
+
+  }
+        $contents[] = array('align' => 'center', 'text' => TABLE_HEADING_BOX_DIRECTORY . DIR_FS_TEMPLATE_BOXES);
+        $contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
+        if (tep_not_null($cInfo->last_modified)) $contents[] = array('align' => 'center','text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
+
+    If ($cInfo->include_column_left == 'yes' && $count_left_active == 0) {
+      $contents[] = array('align' => 'center','text' => '<font color="red" size="4"><?php echo infobox_error2  ; ?></font>');
+    }
+    If ($cInfo->include_column_right == 'yes' && $count_right_active == 0) {
+      $contents[] = array('align' => 'center','text' => '<font color="red" size="4"><?php echo infobox_error3  ; ?></font>');
+    }
+        $contents[] = array('align' => 'center','text' => TEXT_INFO_MESSAGE_COUNT_1 . $count_left_active . TEXT_INFO_MESSAGE_COUNT_2. $count_right_active . INFOBOX_ACTIVE_BOXES);
+      }
+//      break;
+  }
+
+
+
+  if ( (tep_not_null($contents)) ) {
+    echo '            </tr><tr><td width="100%" valign="top" align="center">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading,$contents);
+
+    echo '            </td></tr> ' . "\n";
+
+  }
+
+?>
+
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+                 </table>
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/information_form.php
===================================================================
--- trunk/direct.openmoko.com/admin/information_form.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/information_form.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+<?php 
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+?>
+<?php 
+// Load Editor
+include('includes/javascript/editor.php');
+echo tep_load_html_editor();
+echo tep_insert_html_editor('description');
+?>
+<tr class=pageHeading><td><?php echo $title ?></td></tr>
+<tr class="dataTableRow"><td><font color=red>
+<?php 
+echo QUEUE_INFORMATION_LIST;
+$data=browse_information();
+$no=1;
+if (sizeof($data) > 0) {
+  while (list($key, $val)=each($data)) {
+    echo "$val[v_order], ";
+    $no++;
+    }
+}
+?>
+</font>
+</td></tr>
+  <tr><td>
+<table border="0" cellpadding=0 cellspacing=2" width="80%">
+<tr><td><b><?php echo QUEUE_INFORMATION;?></b> </td>
+<td>
+<?php if ($edit[v_order]) {$no=$edit[v_order];}; echo tep_draw_input_field('v_order', "$no", 'size=3 maxlength=4'); ?>
+<?php
+echo tep_draw_separator('pixel_trans.gif', '10', '10') . '<b>' . VISIBLE_INFORMATION . '</b>' . tep_draw_separator('pixel_trans.gif', '10', '10');
+if ($edit[visible]==1) {
+echo tep_image(DIR_WS_ICONS . 'icon_status_green.gif', INFORMATION_ID_ACTIVE);
+}else{
+echo tep_image(DIR_WS_ICONS . 'icon_status_red.gif', INFORMATION_ID_DEACTIVE);
+}
+?>
+<?php if ($edit[visible]) {$checked= "checked";}; echo tep_draw_separator('pixel_trans.gif', '10', '10') . tep_draw_checkbox_field('visible', '1', "$checked") . VISIBLE_INFORMATION_DO; ?>
+</td>
+</tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<tr><td><b><?php echo TITLE_INFORMATION;?></b><br></td>
+  <td>
+
+
+<?php echo tep_draw_input_field('info_title', "$edit[info_title]", 'maxlength=255'); ?></td>
+</tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<tr><td><b><?php echo DESCRIPTION_INFORMATION;?></b><br>
+</td>
+<td>
+
+
+<?php echo tep_draw_textarea_field('description', '', '60', '30', "$edit[description]",' style="width: 100%" mce_editable="true"'); ?></td>
+
+</tr>
+<tr><td></td>
+<td align=right>
+<?php
+echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
+echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+ ?>
+</td>
+</tr>
+</table>
+</form>
+  </td></tr>

Added: trunk/direct.openmoko.com/admin/information_list.php
===================================================================
--- trunk/direct.openmoko.com/admin/information_list.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/information_list.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php 
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+?>
+<tr class=pageHeading><td><?php echo $title ?></td></tr>
+<tr><td>
+<table border="0" width=100%  cellpadding=2 cellspacing=1 bgcolor="#ffffff">
+<tr class="dataTableHeadingRow">
+  <td align=center class="dataTableHeadingContent"><?php echo NO_INFORMATION;?></td>
+  <td align=center class="dataTableHeadingContent">
+<?php  echo tep_image(DIR_WS_ICONS . 'sort.gif', SORT_BY); ?>
+</td>
+  <td align=center class="dataTableHeadingContent"><?php echo TITLE_INFORMATION;?></td>
+  <td align=center class="dataTableHeadingContent"><?php echo ID_INFORMATION;?></td>
+  <td align=center class="dataTableHeadingContent"><?php echo PUBLIC_INFORMATION;?></td>
+  <td align=center class="dataTableHeadingContent" colspan=2><?php echo ACTION_INFORMATION;?></td>
+
+</tr>
+<?php 
+ $no=1;
+ if (sizeof($data) > 0) {
+  while (list($key, $val)=each($data)) {
+  $no % 2 ? $bgcolor="#DEE4E8" : $bgcolor="#F0F1F1";
+?>
+   <tr bgcolor="<?php echo $bgcolor?>">
+
+    <td align="right" class="dataTableContent"><?php echo $no;?></td>
+    <td align="center" class="dataTableContent"><?php echo $val[v_order];?></td>
+    <td class="dataTableContent"><?php echo $val[info_title];?></td>
+    <td align="center" class="dataTableContent"><?php echo $val[information_id];?></td>
+    <td nowrap  class="dataTableContent">
+<?php
+if ($val[visible]==1) {
+echo tep_image(DIR_WS_ICONS . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;
+<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, "adgrafics_information=Visible&information_id=$val[information_id]&visible=$val[visible]") . '">
+' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', DEACTIVATION_ID_INFORMATION . " $val[information_id]", 10, 10) . '</a>';
+}else {
+echo tep_image(DIR_WS_ICONS . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10) . '&nbsp;&nbsp;
+<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, "adgrafics_information=Visible&information_id=$val[information_id]&visible=$val[visible]") . '">
+' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', ACTIVATION_ID_INFORMATION . " $val[information_id]", 10, 10) . '</a>';
+};
+?>
+</td>
+    <td align=center class="dataTableContent">
+<?php echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, "adgrafics_information=Edit&information_id=$val[information_id]", 'NONSSL') . '">' . tep_image(DIR_WS_ICONS . 'edit.gif', EDIT_ID_INFORMATION . " $val[information_id]") . '</a>'; ?>
+</td>
+    <td align=center class="dataTableContent">
+<?php echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, "adgrafics_information=Delete&information_id=$val[information_id]", 'NONSSL') . '">' . tep_image(DIR_WS_ICONS . 'delete.gif', DELETE_ID_INFORMATION . " $val[information_id]") . '</a>'; ?>
+</td>
+   </tr>
+<?php $no++;
+  }} else {?>
+   <tr bgcolor="#DEE4E8">
+    <td colspan=7><?php echo ALERT_INFORMATION;?></td>
+   </tr>
+<?php }?>
+</table>
+</td></tr>
+<tr><td align=right>
+<?php echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, 'adgrafics_information=Added', 'NONSSL') . '">' . tep_image_button('button_new.gif', ADD_INFORMATION) . '</a>'; ?>
+<?php echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?>
+</td></tr>

Added: trunk/direct.openmoko.com/admin/information_manager.php
===================================================================
--- trunk/direct.openmoko.com/admin/information_manager.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/information_manager.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,199 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+
+
+require('includes/application_top.php');
+require(DIR_WS_LANGUAGES . $language . '/' . 'information.php');
+
+function browse_information () {
+global $languages_id;
+  $query="SELECT * FROM " . TABLE_INFORMATION . " WHERE languages_id=$languages_id ORDER BY v_order";
+  $daftar = mysql_db_query(DB_DATABASE, $query) or die("Information ERROR: ".mysql_error());$c=0;
+  while ($buffer = mysql_fetch_array($daftar)) {$result[$c]=$buffer;$c++;}
+return $result;
+}
+
+function read_data ($information_id) {
+  $result=mysql_fetch_array(mysql_db_query(DB_DATABASE, "SELECT * FROM " . TABLE_INFORMATION . " WHERE information_id=$information_id"));
+return $result;
+}
+
+$warning=tep_image(DIR_WS_ICONS . 'warning.gif', WARNING_INFORMATION);
+
+function error_message($error) {
+  global $warning;
+  switch ($error) {
+    case "20":return "<tr class=messageStackError><td>$warning ." . ERROR_20_INFORMATION . "</td></tr>";break;
+    case "80":return "<tr class=messageStackError><td>$warning " . ERROR_80_INFORMATION . "</td></tr>";break;
+    default:return $error;
+  }
+}
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/javascript/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top">
+<table border=0 width="100%">
+<tr><td align=right><?php echo $language; ?></td></tr>
+<?php 
+switch($adgrafics_information) {
+
+case "Added":
+    $data=browse_information();
+    $no=1;
+     if (sizeof($data) > 0) {while (list($key, $val)=each($data)) {$no++; } } ;
+    $title="" . ADD_QUEUE_INFORMATION . " #$no";
+    echo tep_draw_form('',FILENAME_INFORMATION_MANAGER, 'adgrafics_information=AddSure');
+    include('information_form.php');
+  break;
+
+case "AddSure":
+  function add_information ($data) {
+  global $languages_id;
+  $query ="INSERT INTO " . TABLE_INFORMATION . " VALUES(null, '$data[visible]', '$data[v_order]', '$data[info_title]', '$data[description]','$languages_id')";
+  mysql_db_query(DB_DATABASE, $query) or die ("Information ERROR: ".mysql_error());
+  }
+    if ($v_order && $info_title && $description) {
+    if ((INT)$v_order) {
+    add_information($HTTP_POST_VARS);
+    $data=browse_information();
+    $title="" . tep_image(DIR_WS_ICONS . 'confirm_red.gif', CONFIRM_INFORMATION) .SUCCEED_INFORMATION . ADD_QUEUE_INFORMATION . " $v_order ";
+    include('information_list.php');
+    } else {$error="20";}
+    } else {$error="80";}
+
+  break;
+
+case "Edit":
+    if ($information_id) {
+    $edit=read_data($information_id);
+
+    $data=browse_information();
+    $button=array("Update");
+    $title="" . EDIT_ID_INFORMATION . " $information_id";
+    //echo form("$PHP_SELF?adgrafics_information=Update", $hidden);
+    echo tep_draw_form('',FILENAME_INFORMATION_MANAGER, 'adgrafics_information=Update');
+    echo tep_draw_hidden_field('information_id', "$information_id");
+    include('information_form.php');
+    } else {$error="80";}
+  break;
+
+case "Update":
+  function update_information ($data) {
+  mysql_db_query(DB_DATABASE, "UPDATE " . TABLE_INFORMATION . " SET info_title='$data[info_title]', description='$data[description]', visible='$data[visible]', v_order=$data[v_order] WHERE information_id=$data[information_id]") or die ("update_information: ".mysql_error());
+  }
+    if ($information_id && $description && $v_order) {
+    if ((INT)$v_order) {
+    update_information($HTTP_POST_VARS);
+    $data=browse_information();
+    $title="$confirm " . UPDATE_ID_INFORMATION . " $information_id " . SUCCEED_INFORMATION . "";
+    include('information_list.php');
+    } else {$error="20"; }
+    } else {$error="80";}
+  break;
+
+      case 'Visible':
+  function tep_set_information_visible($information_id, $visible) {
+  if ($visible == '1') {
+  return tep_db_query("update " . TABLE_INFORMATION . " set visible = '0' where information_id = '" . $information_id . "'");
+  } else{
+  return tep_db_query("update " . TABLE_INFORMATION . " set visible = '1' where information_id = '" . $information_id . "'");
+  }
+  }
+    tep_set_information_visible($information_id, $visible);
+    $data=browse_information();
+    if ($visible == '1') {  $vivod=DEACTIVATION_ID_INFORMATION;
+    }else{$vivod=ACTIVATION_ID_INFORMATION;}
+    $title="$confirm $vivod $information_id " . SUCCEED_INFORMATION . "";
+    include('information_list.php');
+        break;
+
+case "Delete":
+    if ($information_id) {
+    $delete=read_data($information_id);
+    $data=browse_information();
+    $title="" . DELETE_CONFITMATION_ID_INFORMATION . " $information_id";
+    echo "<tr class=pageHeading><td>$title  </td></tr>";
+    echo "<tr><td>" . TITLE_INFORMATION . " $delete[info_title]</td></tr><tr><td align=right>";
+    echo tep_draw_form('',FILENAME_INFORMATION_MANAGER, "adgrafics_information=DelSure&information_id=$val[information_id]");
+    echo tep_draw_hidden_field('information_id', "$information_id");
+    echo tep_image_submit('button_delete.gif', IMAGE_DELETE);
+    echo '<a href="' . tep_href_link(FILENAME_INFORMATION_MANAGER, '', 'NONSSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
+    echo "</form></td></tr>";
+    } else {$error="80";}
+    break;
+
+
+case "DelSure":
+  function delete_information ($information_id) {
+  mysql_db_query(DB_DATABASE, "DELETE FROM " . TABLE_INFORMATION . " WHERE information_id=$information_id");
+  }
+    if ($information_id) {
+    delete_information($information_id);
+    $data=browse_information();
+    $title="$confirm " . DELETED_ID_INFORMATION . " $information_id " . SUCCEED_INFORMATION . "";
+    include('information_list.php');
+    } else {$error="80";}
+    break;
+default:
+    $data=browse_information();
+    $title="" . MANAGER_INFORMATION . "";
+    include('information_list.php');
+  }
+if ($error) {
+    $content=error_message($error);
+    echo $content;
+    $data=browse_information();
+    $no=1;
+     if (sizeof($data) > 0) {while (list($key, $val)=each($data)) {$no++; } } ;
+    $title="" . ADD_QUEUE_INFORMATION . " $no";
+    echo tep_draw_form('',FILENAME_INFORMATION_MANAGER, 'adgrafics_information=AddSure');
+    include('information_form.php');
+}
+?>
+</table>
+</td>
+
+
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/install-explain.php
===================================================================
--- trunk/direct.openmoko.com/admin/install-explain.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/install-explain.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,170 @@
+<?php
+/*-----------------------------------------------------------------------------*\
+#################################################################################
+# Script name: admin/install-explain.php
+# Version: v1.0
+#
+# Copyright (C) 2005 Bobby Easland
+# Internet moniker: Chemo
+# Contact: chemo at mesoimpact.com
+#
+# This script is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# Script is intended to be used with:
+# osCommerce, Open Source E-Commerce Solutions
+# http://www.oscommerce.com
+# Copyright (c) 2003 osCommerce
+################################################################################
+\*-----------------------------------------------------------------------------*/
+
+require('includes/application_top.php');
+# Configuration  group insert SQL
+$insert_group = "INSERT INTO `configuration_group` VALUES ('', 'Explain Queries', 'Options for explain queries', 99, 1)";
+# Configuration insert SQL
+$insert_values = array();
+$insert_values[] = "INSERT INTO `configuration` VALUES ('', 'Enable explain queries', 'EXPLAIN_QUERIES', 'false', 'This enables the explain queries feature.', GROUP_INSERT_ID, 0, '', '', NULL, 'tep_cfg_select_option(array(''true'', ''false''),')";
+$insert_values[] = "INSERT INTO `configuration` VALUES ('', 'Limit to certain scripts?', 'EXPLAIN_USE_INCLUDE', 'false', 'This will limit the scripts which will be explained and hence reported on.  Set the values below.', GROUP_INSERT_ID, 1, '', '', NULL, 'tep_cfg_select_option(array(''true'', ''false''),')";
+$insert_values[] = "INSERT INTO `configuration` VALUES ('', 'Included scripts', 'EXPLAIN_INCLUDE_FILES', '', 'These are the scripts that will be explained.  Enter them separated by a comma!', GROUP_INSERT_ID, 2, '', '', NULL, NULL)";
+$insert_values[] = "INSERT INTO `configuration` VALUES ('', 'Exclude certain scripts?', 'EXPLAIN_USE_EXCLUDE', 'false', 'Exclude certain scripts from being explained?', GROUP_INSERT_ID, 3, '', '', NULL, 'tep_cfg_select_option(array(''true'', ''false''),')";
+$insert_values[] = "INSERT INTO `configuration` VALUES ('', 'Excluded scripts', 'EXPLAIN_EXCLUDE_FILES', '', 'These are the scripts that will be excluded from being explained.  Enter them separated by a comma!', GROUP_INSERT_ID, 4, '', '', NULL, NULL)";
+# Create explain table SQL
+$insert_table = "CREATE TABLE `explain_queries` (`explain_id` int(11) NOT NULL auto_increment, `md5query` varchar(32) NOT NULL default '', `query` text, `time` tinytext, `script` tinytext, `request_string` tinytext, `table` tinytext, `type` tinytext, `possible_keys` tinytext, `key` tinytext, `key_len` tinytext, `ref` tinytext, `rows` tinytext, `Extra` tinytext, `Comment` tinytext, PRIMARY KEY  (`explain_id`), KEY `md5query` (`md5query`), KEY `script` (`script`(25)) ) TYPE=MyISAM AUTO_INCREMENT=1" ;
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title><!-- Install (and Uninstall) Database Settings script for osC-Explain - by Chemo --><?php echo INSTALL_EXPLAIN_TXT_1?></title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+<body>
+<?php
+if ( isset($_GET['action']) && $_GET['action'] == 'install' ){
+  //echo '<p><b>Install option selected...running queries</b></p>';
+  echo INSTALL_EXPLAIN_TXT_2;
+  echo INSTALL_EXPLAIN_TXT_3;
+  tep_db_query($insert_group);
+  $group_id = tep_db_insert_id();
+  //echo "<p>Added the configuration group (id=$group_id) successfully...adding configuration values</p>";
+  echo INSTALL_EXPLAIN_TXT_4." (id=$group_id) ".INSTALL_EXPLAIN_TXT_5;
+  //echo '<p>STEP 2 => Add configuration settings</p>';
+  echo INSTALL_EXPLAIN_TXT_6;
+  foreach ($insert_values as $index => $value_query){
+    $value_query = str_replace('GROUP_INSERT_ID', $group_id, $value_query);
+    tep_db_query($value_query);
+    //echo "<blockquote>Success...</blockquote>";
+    echo INSTALL_EXPLAIN_TXT_7;
+  }
+  //echo "<p>Added the configuration settings successfully...adding the 'explain_queries' table</p>";
+  echo INSTALL_EXPLAIN_TXT_8;
+  //echo '<p>STEP 3 => Creating explain_queries table</p>';
+  echo INSTALL_EXPLAIN_TXT_9;
+  tep_db_query($insert_table);
+  //echo '<blockquote>Successfully created the table.</blockquote>';
+  echo INSTALL_EXPLAIN_TXT_10;
+  //echo "<p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>";  
+  echo INSTALL_EXPLAIN_TXT_11;  
+}
+elseif ( isset($_GET['action']) && $_GET['action'] == 'delete' ){
+  /*echo '<p><b>Uninstall optin selected...running queries</b></p>';
+  echo '<p>STEP 1 => Delete the configuration group from configuration_group table</p>';*/
+  echo INSTALL_EXPLAIN_TXT_12;
+
+  tep_db_query("DELETE FROM `configuration_group` WHERE `configuration_group_title` LIKE '%Explain Queries%'");
+  /*
+  echo '<blockquote>Deleted the configuration group successfully...removing configuration values</blockquote>';
+  echo '<p>STEP 2 => Delete configuraton values</p>';
+  */
+  echo INSTALL_EXPLAIN_TXT_13;
+
+  tep_db_query("DELETE FROM `configuration` WHERE `configuration_key` LIKE '%EXPLAIN%'");
+  /*
+  echo '<blockquote>Deleted the configuration values successfully...dropping the explain_queries table</blockquote>';
+  echo '<p>STEP 3 => Dropping explain_queries table</p>';
+  */
+  echo INSTALL_EXPLAIN_TXT_14;
+
+  tep_db_query("DROP TABLE `explain_queries`");
+  /*
+  echo '<blockquote>Table dropped successfully...analyzing tables</blockquote>';
+  echo '<p>STEP 4 => Analyzing configuration_group and configuration table</p>';
+  */
+  echo INSTALL_EXPLAIN_TXT_15;
+
+  tep_db_query("ANALYZE TABLE `configuration_group`");
+    //echo "<blockquote>Analyze configuration_group success...</blockquote>";
+    echo INSTALL_EXPLAIN_TXT_16;
+  tep_db_query("ANALYZE TABLE `configuration`");
+    //echo "<blockquote>Analyze configuration success...</blockquote>";
+    echo INSTALL_EXPLAIN_TXT_17;
+  tep_db_query("OPTIMIZE TABLE `configuration_group`");
+    //echo "<blockquote>Optimize configuration_group success...</blockquote>";
+    echo INSTALL_EXPLAIN_TXT_18;
+  tep_db_query("OPTIMIZE TABLE `configuration`");
+    /*echo "<blockquote>Optimize configuration success...</blockquote>";
+  echo "<p><b>All done!  You should delete this script from the server...or not...you're choice.</b></p>";  */
+  echo INSTALL_EXPLAIN_TXT_19;
+}
+else {
+?>
+<!-- <p>Welcome to the barebones osC-Explain installation script (<a href="http://forums.oscommerce.com/index.php?showuser=9196">by 
+  Chemo</a>)!</p>
+<p>This contribution is GPL and the target audience is fellow coders, optimizers, 
+  and knowledgeable webmasters.&nbsp; I encourage each of you to look over the 
+  code and add functionality so that the rest of us can benefit as well.</p>
+<p>There are two options for this script:</p>
+<p><strong>INSTALL</strong></p>
+<blockquote>
+  <p>This option is self explanatory :)&nbsp; It will add a configuration group 
+    with the title &quot;Explain Queries&quot; and set the sort order to 99 (making 
+    it the last listed).&nbsp; The script will then add values to the configuration 
+    table that is the options for this contribution.&nbsp; Currently, these are 
+    available:</p>
+  <ul>
+    <li> Global on / off</li>
+    <li>Enable on for specific scripts (add one or list separated by comma).&nbsp; 
+      This will be handy for contribution coders since they can enable only for 
+      their development scripts and not waste room for storing other page queries.&nbsp; 
+      In addition, it will speed up the admin report if there are 1,000 rows instead 
+      of 500,000 :)</li>
+    <li>Enable page exclusion for specific scripts.&nbsp; This is handy to exclude 
+      certain scripts (for instance, ones already optimized) but capture the rest.</li>
+  </ul>
+  <p>The last thing this install script does is add a new table called 'explain_queries'.&nbsp; 
+    This is needed to store the data.&nbsp; Do not change the name since the table 
+    name is hardcoded all over the place.&nbsp; Why not add a new define to filenames.php?&nbsp; 
+    If there is room to trim install steps and decrease the number of file changes 
+    I'll take it any day of the week and twice on Sunday.&nbsp; You are (hopefully) 
+    an experienced osC developer so if you want to do define table names the standard 
+    way edit your own files.</p>
+</blockquote>
+<p align="center"><strong><a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=install">INSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p>
+<p align="left"><strong>UNINSTALL</strong></p>
+<blockquote>
+  <p align="left">Hopefully, this option is self-explanatory too :)&nbsp; This 
+    will delete all the values associated with osC-Explain from the configuration_group 
+    and configuration tables.&nbsp; Then it will analyze the tables to reset the 
+    cardinality of the tables.&nbsp; Next, the script will drop the 'explain_queries' 
+    table.</p>
+</blockquote>
+<p align="center"><strong><a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=delete">UNINSTALL</strong> THE DATABASE VALUES FOR OSC-EXPLAIN</a></p>
+<p align="left"><strong>NOTES</strong>: By default all values are set to false.&nbsp; 
+  So, once you have the files uploaded and necessary changes have been made you'll 
+  have to enable it through the admin control panel.&nbsp; </p>
+<blockquote>
+  <p align="left">Configuration -&gt; Explain Queries -&gt; Enable explain queries 
+    -&gt; true</p>
+</blockquote> -->
+<?php echo INSTALL_EXPLAIN_TXT_20?>
+<?php
+} # End default page
+?>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/invoice.php
===================================================================
--- trunk/direct.openmoko.com/admin/invoice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/invoice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,197 @@
+<?php
+/*
+  $Id: invoice.php,v 1.2 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $customer_number_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '". tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['order_id'])) . "'");
+  $customer_number = tep_db_fetch_array($customer_number_query);
+/*
+  if ($customer_number['customers_id'] != $customer_id) {
+    tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
+  }
+*/
+  $payment_info_query = tep_db_query("select payment_info from " . TABLE_ORDERS . " where orders_id = '". tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['order_id'])) . "'");
+  $payment_info = tep_db_fetch_array($payment_info_query);
+  $payment_info = $payment_info['payment_info'];
+
+//  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_INVOICE);
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+  $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");
+
+  include(DIR_WS_CLASSES . 'order.php');
+  $order = new order($oID);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE . ' - ' . TITLE_PRINT_ORDER . $oID; ?></title>
+<link rel="stylesheet" type="text/css" href="print.css">
+</head>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+
+<!-- body_text //-->
+<table width="600" border="0" align="center" cellpadding="2" cellspacing="0">
+  <tr>
+    <td align="center" class="main"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="5">
+      <tr>
+        <td valign="top" align="left" class="main"><script language="JavaScript">
+  if (window.print) {
+    document.write('<a href="javascript:;" onClick="javascript:window.print()" onMouseOut=document.imprim.src="<?php echo (DIR_WS_IMAGES . 'printimage.gif'); ?>" onMouseOver=document.imprim.src="<?php echo (DIR_WS_IMAGES . 'printimage_over.gif'); ?>"><img src="<?php echo (DIR_WS_IMAGES . 'printimage.gif'); ?>" width="43" height="28" align="absbottom" border="0" name="imprim">' + '<?php echo IMAGE_BUTTON_PRINT; ?></a></center>');
+  }
+  else document.write ('<h2><?php echo IMAGE_BUTTON_PRINT; ?></h2>')
+        </script></td>
+        <td align="right" valign="bottom" class="main"><p align="right" class="main"><a href="javascript:window.close();"><img src='images/close_window.jpg' border=0></a></p></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr align="left">
+    <td class="titleHeading"><?php echo tep_draw_separator('pixel_trans.gif', '1', '25'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" align="center" width="75%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . STORE_LOGO, STORE_NAME); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2" align="center" class="titleHeading"><b><?php echo TITLE_PRINT_ORDER  . $oID; ?></b></td>
+          </tr>
+          <tr align="left">
+            <td colspan="2" class="titleHeading"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td align="left" class="main"><table width="100%" border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="main"><?php echo '<b>' . ENTRY_PAYMENT_METHOD . '</b> ' . $order->info['payment_method']; ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo $payment_info; ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="main"><?php echo '<b>' . ENTRY_DATE_PURCHASED . '</b> ' . $order->info['date_purchased']; ?></td>
+  </tr>
+  <tr>
+    <td align="center"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor=#000000>
+          <tr>
+            <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '&nbsp;', '<br>'); ?></td>
+             
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+        <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor=#000000>
+          <tr>
+            <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '&nbsp;', '<br>'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="1" bgcolor=#000000>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr class="dataTableHeadingRow">
+            <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>
+<?php 
+ if (DISPLAY_PRICE_WITH_TAX == 'true') {
+ ?>
+ <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>
+<?php 
+}
+    ?>
+           </tr>
+        <?php
+    for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
+      echo '      <tr class="dataTableRow">' . "\n" .
+           '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
+           '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'] . '<br>';
+
+    if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
+      for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+        echo '<nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i><br></small></nobr>';
+      }
+    }
+    if (DISPLAY_PRICE_WITH_TAX == 'true') {
+     $pricew_tax = '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
+    } 
+      echo '        </td>' . "\n" .
+           '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";
+      echo '        <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .
+           '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
+           '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
+       echo $pricew_tax ;
+  echo '      </tr>' . "\n";
+    
+    }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td align="right" colspan="7"><table border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <?php
+  for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
+    echo '          <tr>' . "\n" .
+         '            <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .
+         '            <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .
+         '          </tr>' . "\n";
+  }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>
+<!-- body_text_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/ipn_test_panel.php
===================================================================
--- trunk/direct.openmoko.com/admin/ipn_test_panel.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/ipn_test_panel.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,273 @@
+<?php
+/*
+  $Id: ipn_test_panel.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/ipn.class.php');
+?>
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<meta name="copyright" content="2004">
+<meta name="author" content="developer&#064;devosc.com">
+<style type='text/css'>
+body {background-color:#FFFFFF;}
+body, td, th {font-family: sans-serif; font-size: 10px;}
+.p {margin-top:0px;padding-top:0px;}
+.box, .boxEmail {border:1px solid black; width:100%;}
+table.box td {color: #003366; }
+input { border:1px solid #003366;}
+</style>
+</head>
+<body onLoad="javascript:document.ipn.custom.select();">
+<form name="ipn" method="POST" action="<?php echo HTTP_SERVER . DIR_WS_CATALOG.'ipn.php'; ?>">
+<input type="hidden" name="business" value="<?php echo MODULE_PAYMENT_PAYPAL_BUSINESS_ID; ?>"/>
+<input type="hidden" name="receiver_email" value="<?php echo MODULE_PAYMENT_PAYPAL_ID; ?>"/>
+<input type="hidden" name="verify_sign" value="PAYPAL_SHOPPING_CART_IPN-TEST_TRANSACTION-00000000000000"/>
+<input type="hidden" name="payment_date" value="<?php echo date("G:i:s M j, Y T"); ?>">
+<input type="hidden" name="digest_key" value="<?php echo ipn::digest_key(); ?>">
+<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2">
+      <tr valign="middle">
+        <td align="center">
+<table border="0" width="780" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="0" class="box">
+          <tr>
+            <td align="center"><img border="0" src="<?php echo HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . '../modules/payment/paypal/images/oscommerce.gif'; ?>" alt=" osCommerce " title=" osCommerce " /></td>
+          </tr>
+          <tr>
+            <td class="pageHeading" style="color:green" align="center">PayPal_Shopping_Cart_IPN</td>
+          </tr>
+          <tr>
+            <td class="pageHeading" style="color:blue; text-align:center; padding-top:5px;">IPN Test Panel</td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php if (MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE == 'Off') { ?>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="boxEmail" style="background-color: red;">
+          <tr>
+            <td class="pageHeading" align="center" style="color: #FFFFFF;">TEST MODE MUST BE SWITCHED ON!</td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php } ?>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="boxEmail">
+          <tr>
+            <td align="center"><table border="0" cellspacing="0" cellpadding="3">
+              <tr>
+                <td class="smallText" nowrap><b>Primary PayPal Email Address</b></td>
+                <td class="smallText" style="padding-left:15px;" nowrap><b>Business ID</b></td>
+                <td class="smallText" style="padding-left:15px;" nowrap><b>Debug Email Address</b></td>
+              </tr>
+              <tr>
+                <td class="smallText" nowrap><?php echo MODULE_PAYMENT_PAYPAL_ID; ?></td>
+                <td class="smallText" style="padding-left:15px;" nowrap><?php echo MODULE_PAYMENT_PAYPAL_BUSINESS_ID; ?></td>
+                <td class="smallText" style="padding-left:15px;" nowrap><?php echo MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2" class="box">
+              <tr valign="top">
+                <td>
+                      <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main" nowrap><b>First Name</b></td><td class="main" nowrap><input type="text" name="first_name" value="John"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Last Name</b></td><td class="main" nowrap><input type="text" name="last_name" value="Doe"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_BUSINESS_NAME; ?></b></td><td class="main" nowrap><input type="text" name="payer_business_name" value="ACME Inc."></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td><td class="main" nowrap><input type="text" name="payer_email" value="root at localhost"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYER_ID; ?></b></td><td class="main" nowrap><input type="text" name="payer_id" value="PAYERID000000"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYER_STATUS; ?></b></td><td class="main" nowrap align="right"><select name="payer_status"><option value="verified">verified</option><option value="unverified">unverified</option></select></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_INVOICE; ?></b></td><td class="main" nowrap><input type="text" name="invoice" value=""></td>
+                      </tr>
+                      </table>
+                </td>
+                <td style="padding-left:5px;">
+                      <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                      <tr valign="top">
+                        <td class="main" nowrap><b>Address Name</b></td><td class="main" nowrap><input type="text" name="address_name" value="John Doe"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address Street</b></td><td class="main" nowrap><input type="text" name="address_street" value="1 Way Street"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address City</b></td><td class="main"><input type="text" name="address_city" value="NeverNever"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address State</b></td><td class="main" nowrap><input type="text" name="address_state" value="CA"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address Zip</b></td><td class="main"><input type="text" name="address_zip" value="12345"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address Country</b></td><td class="main" nowrap><input type="text" name="address_country" value="United States"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address Status</b></td><td class="main" nowrap align="right"><select name="address_status"><option value="confirmed">confirmed</option><option value="unconfirmed">unconfirmed</option></select></td>
+                      </tr>
+                      </table>
+                </td>
+                <td style="padding-left:5px;">
+                      <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYMENT_TYPE; ?></b></td><td class="main" nowrap align="right"><select name="payment_type"><option value="instant">instant</option><option value="echeck">echeck</option></select></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Transaction Type</b></td><td class="main" nowrap align="right"><select name="txn_type"><option value="cart">cart</option><option value="web_accept">web_accept</option><option value="send_money">send_money</option></select></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Custom</b></td><td class="main" nowrap><input type="text" name="custom" value="1" maxlength="32"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYPAL_IPN_TXN; ?></b></td><td class="main" nowrap><input type="text" name="txn_id" value="PAYPAL00000000000" maxlength="17"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_CART_ITEMS; ?></b></td><td class="main"><input type="text" name="num_cart_items" value="1"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Notify Version</b></td><td class="main" nowrap align="right"><select name="notify_version"><option value="1.6" selected>1.6</option></select></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Memo</b></td><td class="main" nowrap><input type="text" name="memo" value="PAYPAL_SHOPPING_CART_IPN TEST"></td>
+                      </tr>
+                      </table>
+                </td>
+              </tr>
+              <tr>
+                <td>
+                        <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_MC_CURRENCY; ?></b></td><td class="main" align="right"><select name="mc_currency"><option value="USD">USD</option><option value="GBP">GBP</option><option value="EUR">EUR</option><option value="CAD">CAD</option><option value="JPY">JPY</option></select></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_MC_GROSS; ?></b></td><td class="main" align="right"><input type="text" name="mc_gross" value="0.01"></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_MC_FEE; ?></b></td><td class="main" align="right"><input type="text" name="mc_fee" value="0.01"></td>
+                          </tr>
+                        </table>
+                </td>
+                <td>
+                        <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_SETTLE_AMOUNT; ?></b></td><td class="main" align="right"><input type="text" name="settle_amount" value="0.00"></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_SETTLE_CURRENCY; ?></b></td><td class="main" align="right"><select name="settle_currency"><option value=""></option><option value="USD">USD</option><option value="GBP">GBP</option><option value="EUR">EUR</option><option value="CAD">CAD</option><option value="JPY">JPY</option></select></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_EXCHANGE_RATE; ?></b></td><td class="main" align="right"><input type="text" name="exchange_rate" value="0.00"></td>
+                          </tr>
+                        </table>
+                </td>
+                <td>
+                        <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                          <tr>
+                            <td class="main" nowrap><b>Payment Status</b></td><td class="main" align="right"><select name="payment_status"><option value="Completed">Completed</option><option value="Pending">Pending</option><option value="Failed">Failed</option><option value="Denied">Denied</option><option value="Refunded">Refunded</option><option value="Reversed">Reversed</option><option value="Canceled_Reversal">Canceled_Reversal</option></select></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b>Pending Reason</b></td><td class="main" align="right"><select name="pending_reason"><option value=""></option><option value="echeck">echeck</option><option value="multi_currency">multi_currency</option><option value="intl">intl</option><option value="verify">verify</option><option value="address">address</option><option value="upgrade">upgrade</option><option value="unilateral">unilateral</option><option value="other">other</option></select></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b>Reason Code</b></td><td class="main" align="right"><select name="reason_code"><option value=""></option><option value="chargeback">chargeback</option><option value="guarantee">guarantee</option><option value="buyer_complaint">buyer_complaint</option><option value="refund">refund</option><option value="other">other</option></select></td>
+                          </tr>
+                        </table>
+                </td>
+              </tr>
+              </table>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td>
+          <table border="0" width="100%" cellspacing="0" cellpadding="5" class="box">
+            <tr valign="top">
+              <td align="center">
+                <input type="submit" name="submit" value="Test IPN">
+              </td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="boxEmail" style="">
+          <tr>
+            <td class="pageHeading" align="center" style="color: #FFFFFF; background-color: #003366;">Instructions</td>
+          </tr>
+          <tr>
+            <td class="main" style="padding:10 0 10 0;">
+<ul>
+<li>Begin to check out as a customer via the store, stop when you get to the PayPal site</li>
+<li>Go into the store admin orders section and find the last order (just created)</li>
+<li>Copy and paste the <b>Transaction Signature</b> into the above <b>Custom</b> field and into the <b>Transaction ID</b> field</li>
+<li>If the <b>Cart Test</b> is on, then make sure that the above <b>MC Gross</b> amount is the same as the order total and that the <b>MC&nbsp;Currency</b> field is set to the same currency as the order.</li>
+<li>Submit the Test IPN</li>
+<li>Now check the admin order status</li>
+</ul>
+<p align="center"><b style="color:red;">If you're testing Pending payments etc, then remember to use the same Transction ID.<br/></b></p>
+</td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="boxEmail" style="border:none;">
+          <tr>
+            <td class="main" style="padding:10 0 10 0;"><?php require(DIR_WS_INCLUDES . 'footer.php'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+</td>
+</tr>
+</table>
+<form>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/languages.php
===================================================================
--- trunk/direct.openmoko.com/admin/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1264 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:38:39 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+        $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
+        $code = tep_db_prepare_input($HTTP_POST_VARS['code']);
+        $image = tep_db_prepare_input($HTTP_POST_VARS['image']);
+        $directory = tep_db_prepare_input($HTTP_POST_VARS['directory']);
+        $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);
+
+        tep_db_query("insert into " . TABLE_LANGUAGES . " (name, code, image, directory, sort_order) values ('" . tep_db_input($name) . "', '" . tep_db_input($code) . "', '" . tep_db_input($image) . "', '" . tep_db_input($directory) . "', '" . tep_db_input($sort_order) . "')");
+        $insert_id = tep_db_insert_id();
+
+// create additional affiliate_news_contents records
+        $language_query1 = tep_db_query("select affiliate_news_contents_id, affiliate_news_id, affiliate_news_languages_id, affiliate_news_headlines , affiliate_news_contents  from " . TABLE_AFFILIATE_NEWS_CONTENTS . " where affiliate_news_languages_id = '" . (int)$languages_id . "' ");
+        while ($language_array1 = tep_db_fetch_array($language_query1)) {
+          tep_db_query("insert into " . TABLE_AFFILIATE_NEWS_CONTENTS . " (affiliate_news_contents_id, affiliate_news_id, affiliate_news_languages_id, affiliate_news_headlines , affiliate_news_contents ) values ('" . (int)$language_array1['affiliate_news_contents_id'] . "', '" . tep_db_input($language_array1['affiliate_news_id']) . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array1['affiliate_news_headlines']) . "', '" . tep_db_input($language_array1['affiliate_news_contents']) . "')");
+}
+
+// create additional affiliate_payment_status records
+        $language_query2 = tep_db_query("select affiliate_payment_status_id, affiliate_language_id, affiliate_payment_status_name from " . TABLE_AFFILIATE_PAYMENT_STATUS . " where affiliate_language_id = '" . (int)$languages_id . "'");
+        while ($language_array2 = tep_db_fetch_array($language_query2)) {
+          tep_db_query("insert into " . TABLE_AFFILIATE_PAYMENT_STATUS . " (affiliate_payment_status_id, affiliate_language_id, affiliate_payment_status_name) values ('" . (int)$language_array2['affiliate_payment_status_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array2['affiliate_payment_status_name']) . "')");
+}
+
+// create additional article reviews description records
+        $language_query = tep_db_query("select reviews_id, reviews_text from " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " where languages_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " (reviews_id, reviews_text, languages_id) values ('" . $language_array['reviews_id'] . "', '" . $language_array['reviews_text'] . "', '" . (int)$insert_id . "')");
+}
+
+// create additional articles description records
+        $language_query = tep_db_query("select articles_id, articles_name, articles_description, articles_url, articles_head_title_tag, articles_head_desc_tag, articles_head_keywords_tag from " . TABLE_ARTICLES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_ARTICLES_DESCRIPTION . " (articles_id, articles_name, articles_description, articles_url, articles_head_title_tag, articles_head_desc_tag, articles_head_keywords_tag, language_id) values ('" . $language_array['articles_id'] . "', '" . $language_array['articles_name'] . "', '" . $language_array['articles_description'] . "', '" . $language_array['articles_url'] . "', '" . $language_array['articles_head_title_tag'] . "', '" . $language_array['articles_head_desc_tag'] . "', '" . $language_array['articles_head_keywords_tag'] . "', '" . (int)$insert_id . "')");
+}
+
+// create additional authors info records
+        $language_query = tep_db_query("select authors_id, authors_description, authors_url from " . TABLE_AUTHORS_INFO . " where languages_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_AUTHORS_INFO . " (authors_id, authors_description, authors_url, languages_id) values ('" . $language_array['reviews_id'] . "', '" . $language_array['authors_description'] . "', '" . $language_array['authors_url'] . "', '" . (int)$insert_id . "')");
+}
+
+
+// create additional categories_description records
+        $language_query3 = tep_db_query("select  categories_id, language_id, categories_name, categories_heading_title ,categories_description, categories_head_title_tag, categories_head_desc_tag, categories_head_keywords_tag from " . TABLE_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array3 = tep_db_fetch_array($language_query3)) {
+          tep_db_query("insert into " . TABLE_CATEGORIES_DESCRIPTION . " (categories_id, language_id, categories_name, categories_heading_title ,categories_description, categories_head_title_tag, categories_head_desc_tag, categories_head_keywords_tag) values ('" . (int)$language_array3['categories_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array3['categories_name']) . "', '" . (int)$language_array3['categories_heading_title'] . "', '" . (int)$language_array3['categories_description'] . "', '" . (int)$language_array3['categories_head_title_tag'] . "', '" . (int)$language_array3['categories_head_desc_tag'] . "', '" . (int)$language_array3['categories_head_keywords_tag'] . "')");
+        }
+
+// create additional coupon_discription records
+        $language_query4 = tep_db_query("select coupon_id, language_id, coupon_name, coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array4 = tep_db_fetch_array($language_query4)) {
+          tep_db_query("insert into " . TABLE_COUPONS_DESCRIPTION . " (coupon_id, language_id, coupon_name, coupon_description) values ('" . (int)$language_array4['coupon_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array4['coupon_name']) . "', '" . tep_db_input($language_array4['coupon_description']) . "')");
+}
+
+// create additional events calendar records
+        $language_query = tep_db_query("select event_id, start_date, end_date, title, event_image, link, OSC_link, description, date_added from " . TABLE_EVENTS_CALENDAR . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_EVENTS_CALENDAR . " (event_id, start_date, end_date, title, event_image, link, OSC_link, description, date_added, language_id) values ('" . $language_array['event_id'] . "', '" . $language_array['start_date'] . "', '" . $language_array['end_date'] . "', '" . $language_array['title'] . "', '" . $language_array['event_image'] . "', '" . $language_array['link'] . "', '" . $language_array['OSC_link'] . "', '" . $language_array['description'] . "', '" . $language_array['date_added'] . "', '" . (int)$insert_id . "')");
+}
+
+// create additional FAQ categories description records
+        $language_query = tep_db_query("select categories_id, categories_name, categories_description from " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " (categories_id, categories_name, categories_description, language_id) values ('" . $language_array['categories_id'] . "', '" . $language_array['categories_name'] . "', '" . $language_array['categories_description'] . "', '" . (int)$insert_id . "')");
+}
+
+// create additional infobox heading records
+        $language_query18 = tep_db_query("select infobox_id, languages_id, box_heading from " . TABLE_INFOBOX_HEADING . " where languages_id = '" . (int)$languages_id . "'");
+        while ($language_array18 = tep_db_fetch_array($language_query18)) {
+          tep_db_query("insert into " . TABLE_INFOBOX_HEADING . " (infobox_id, languages_id, box_heading) values ('" . (int)$language_array18['infobox_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array18['box_heading']) . "')");
+        }
+
+// create additional information records
+        $language_query8 = tep_db_query("select information_id, visible, v_order, info_title, description, languages_id from " . TABLE_INFORMATION . " where languages_id = '" . (int)$languages_id . "'");
+        while ($language_array8 = tep_db_fetch_array($language_query8)) {
+          tep_db_query("insert into " . TABLE_INFORMATION . " (information_id, visible, v_order, info_title, description, languages_id) values ('" . (int)$language_array8['information_id'] . "', '" . tep_db_input($language_array8['visible']) . "', '" . tep_db_input($language_array8['v_order']) . "', '" . tep_db_input($language_array8['info_title']) . "', '" . tep_db_input($language_array8['description']) . "', '" . (int)$insert_id . "')");
+}
+
+// create additional link_categories_description records
+        $language_query9 = tep_db_query("select link_categories_id, language_id, link_categories_name, link_categories_description from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array9 = tep_db_fetch_array($language_query9)) {
+          tep_db_query("insert into " . TABLE_LINK_CATEGORIES_DESCRIPTION . " (link_categories_id, language_id, link_categories_name, link_categories_description) values ('" . (int)$language_array9['link_categories_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array9['link_categories_name']) . "', '" . tep_db_input($language_array9['link_categories_description']) . "')");
+}
+
+// create additional links records
+        $language_query10 = tep_db_query("select links_id, language_id, links_title, links_description from " . TABLE_LINKS_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array10 = tep_db_fetch_array($language_query10)) {
+          tep_db_query("insert into " . TABLE_LINKS_DESCRIPTION . " (links_id, language_id, links_title, links_description) values ('" . (int)$language_array10['links_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array10['links_title']) . "', '" . tep_db_input($language_array10['links_description']) . "')");
+}
+
+// create additional links_status records
+        $language_query11 = tep_db_query("select links_status_id, language_id, links_status_name from " . TABLE_LINKS_STATUS . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array11 = tep_db_fetch_array($language_query11)) {
+          tep_db_query("insert into " . TABLE_LINKS_STATUS . " (links_status_id, language_id, links_status_name) values ('" . (int)$language_array11['links_status_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array11['links_status_name']) . "')");
+}
+
+// create additional manufacturers_info records
+        $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "'");
+        while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+          tep_db_query("insert into " . TABLE_MANUFACTURERS_INFO . " (manufacturers_id, languages_id, manufacturers_url) values ('" . $manufacturers['manufacturers_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($manufacturers['manufacturers_url']) . "')");
+        }
+
+// create additional navmenu links description records
+        $language_query = tep_db_query("select nml_id, nml_name from " . TABLE_NAVMENU_LINKS_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_NAVMENU_LINKS_DESCRIPTION . " (nml_id, nml_name, language_id) values ('" . $language_array['nml_id'] . "', '" . $language_array['nml_name'] . "', '" . (int)$insert_id . "')");
+}
+
+// create additional navmenu categories description records
+        $language_query = tep_db_query("select nmc_id, nmc_name from " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " (nmc_id, nmc_name, language_id) values ('" . $language_array['nmc_id'] . "', '" . $language_array['nmc_name'] . "', '" . (int)$insert_id . "')");
+}
+
+// create additional orders_pay_methods records
+        $language_query12 = tep_db_query("select pay_methods_id, pay_method_language, pay_method_sort, pay_method from " . TABLE_ORDERS_PAY_METHODS . " where pay_method_language = '" . (int)$languages_id . "'");
+        while ($language_array12 = tep_db_fetch_array($language_query12)) {
+          tep_db_query("insert into " . TABLE_ORDERS_PAY_METHODS . " (pay_methods_id, pay_method_language, pay_method_sort, pay_method) values ('" . (int)$language_array12['pay_methods_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array12['pay_method_sort']) . "', '" . tep_db_input($language_array12['pay_method']) . "')");
+}
+
+// create additional orders_ship_method records
+        $language_query13 = tep_db_query("select ship_methods_id, ship_method_language, ship_method_sort, ship_method from " . TABLE_ORDERS_SHIP_METHODS . " where ship_method_language = '" . (int)$languages_id . "'");
+        while ($language_array13 = tep_db_fetch_array($language_query13)) {
+          tep_db_query("insert into " . TABLE_ORDERS_SHIP_METHODS . " (ship_methods_id, ship_method_language, ship_method_sort, ship_method) values ('" . (int)$language_array13['ship_methods_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array13['ship_method_sort']) . "', '" . tep_db_input($language_array13['ship_method']) . "')");
+}
+
+// create additional orders_status records
+        $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
+        while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+          tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . (int)$orders_status['orders_status_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($orders_status['orders_status_name']) . "')");
+        }
+
+// create additional pages categories description records
+        $language_query = tep_db_query("select categories_id, categories_name, categories_description from " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " (categories_id, categories_name, categories_description, language_id) values ('" . $language_array['categories_id'] . "', '" . $language_array['categories_name'] . "', '" . $language_array['categories_description'] . "', '" . (int)$insert_id . "')");
+}
+
+// create additional pages description records
+        $language_query = tep_db_query("select pages_id, pages_title, pages_meta_title, pages_meta_keywords, pages_meta_description, pages_blurb, pages_body from " . TABLE_PAGES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_PAGES_DESCRIPTION . " (pages_id, pages_title, pages_meta_title, pages_meta_keywords, pages_meta_description, pages_blurb, pages_body, language_id) values ('" . $language_array['pages_id'] . "', '" . $language_array['pages_title'] . "', '" . $language_array['pages_meta_title'] . "', '" . $language_array['pages_meta_keywords'] . "', '" . $language_array['pages_meta_description'] . "', '" . $language_array['pages_blurb'] . "', '" . $language_array['pages_body'] . "', '" . (int)$insert_id . "')");
+}
+
+// create additional products_description records
+        $language_query14 = tep_db_query("select products_id, language_id, products_name, products_description,  products_url, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag  from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array14 = tep_db_fetch_array($language_query14)) {
+          tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description,  products_url, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag) values ('" . (int)$language_array14['products_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array14['products_name']) . "', '" . tep_db_input($language_array14['products_description']) . "', '" . tep_db_input($language_array14['products_url']) . "', '" . tep_db_input($language_array14['products_head_title_tag']) . "', '" . tep_db_input($language_array14['products_head_desc_tag']) . "', '" . tep_db_input($language_array14['products_head_keywords_tag']) . "')");
+        }
+
+// create additional products extra fields records
+        $language_query = tep_db_query("select products_extra_fields_id, products_extra_fields_name, products_extra_fields_order, products_extra_fields_status from " . TABLE_PRODUCTS_EXTRA_FIELDS . " where languages_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_PRODUCTS_EXTRA_FIELDS . " (products_extra_fields_id, products_extra_fields_name, products_extra_fields_order, products_extra_fields_status, languages_id) values ('" . $language_array['products_extra_fields_id'] . "', '" . $language_array['products_extra_fields_name'] . "', '" . $language_array['products_extra_fields_order'] . "', '" . $language_array['products_extra_fields_status'] . "', '" . (int)$insert_id . "')");
+}
+
+// create additional products_options text records
+        $language_query15 = tep_db_query("select products_options_text_id, products_options_name, products_options_instruct from " . TABLE_PRODUCTS_OPTIONS_TEXT . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array15 = tep_db_fetch_array($language_query15)) {
+          tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_TEXT . " (products_options_text_id, products_options_name, products_options_instruct, language_id) values ('" . (int)$language_array15['products_options_text_id'] . "', '" . tep_db_input($language_array15['products_options_name']) . "', '" . tep_db_input($language_array15['products_options_instruct']) . "', '" . (int)$insert_id . "')");
+        }
+
+// create additional products_options_values records
+        $language_query16 = tep_db_query("select products_options_values_id, products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array16 = tep_db_fetch_array($language_query16)) {
+          tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int)$language_array16['products_options_values_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array16['products_options_values_name']) . "')");
+        }
+
+// create additional reviews_description records
+        $language_query17 = tep_db_query("select reviews_id, languages_id , reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where languages_id = '" . (int)$languages_id . "'");
+        while ($language_array17 = tep_db_fetch_array($language_query17)) {
+          tep_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id , reviews_text) values ('" . (int)$language_array17['reviews_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($language_array17['reviews_text']) . "')");
+        }
+
+// create additional topics description records
+        $language_query = tep_db_query("select topics_id, topics_name, topics_heading_title, topics_description from " . TABLE_TOPICS_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'");
+        while ($language_array = tep_db_fetch_array($language_query)) {
+          tep_db_query("insert into " . TABLE_TOPICS_DESCRIPTION . " (topics_id, topics_name, topics_heading_title, topics_description, language_id) values ('" . $language_array['topics_id'] . "', '" . $language_array['topics_name'] . "', '" . $language_array['topics_heading_title'] . "', '" . $language_array['topics_description'] . "', '" . (int)$insert_id . "')");
+}
+
+
+        if (isset($HTTP_POST_VARS['default']) && ($HTTP_POST_VARS['default'] == 'on')) {
+          tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($code) . "' where configuration_key = 'DEFAULT_LANGUAGE'");
+        }
+
+        tep_redirect(tep_href_link(FILENAME_LANGUAGES, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'lID=' . $insert_id));
+        break;
+      case 'save':
+        $lID = tep_db_prepare_input($HTTP_GET_VARS['lID']);
+        $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
+        $code = tep_db_prepare_input($HTTP_POST_VARS['code']);
+        $image = tep_db_prepare_input($HTTP_POST_VARS['image']);
+        $directory = tep_db_prepare_input($HTTP_POST_VARS['directory']);
+        $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);
+
+        tep_db_query("update " . TABLE_LANGUAGES . " set name = '" . tep_db_input($name) . "', code = '" . tep_db_input($code) . "', image = '" . tep_db_input($image) . "', directory = '" . tep_db_input($directory) . "', sort_order = '" . tep_db_input($sort_order) . "' where languages_id = '" . (int)$lID . "'");
+
+        if ($HTTP_POST_VARS['default'] == 'on') {
+          tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($code) . "' where configuration_key = 'DEFAULT_LANGUAGE'");
+        }
+
+        tep_redirect(tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $HTTP_GET_VARS['lID']));
+        break;
+      case 'deleteconfirm':
+        $lID = tep_db_prepare_input($HTTP_GET_VARS['lID']);
+
+        $lng_query = tep_db_query("select languages_id from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_CURRENCY . "'");
+        $lng = tep_db_fetch_array($lng_query);
+        if ($lng['languages_id'] == $lID) {
+          tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '' where configuration_key = 'DEFAULT_CURRENCY'");
+        }
+
+tep_db_query("delete from " . TABLE_AFFILIATE_NEWS_CONTENTS . " where affiliate_news_languages_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_AFFILIATE_PAYMENT_STATUS . " where affiliate_language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " where languages_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_ARTICLES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_AUTHORS_INFO . " where languages_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_COUPONS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_EVENTS_CALENDAR . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_INFOBOX_HEADING . " where languages_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_INFORMATION . " where languages_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_LINKS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_LINKS_STATUS . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_NAVMENU_LINKS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_ORDERS_PAY_METHODS . " where pay_method_language = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_ORDERS_SHIP_METHODS . " where ship_method_language = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_PAGES_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_PRODUCTS_EXTRA_FIELDS . " where languages_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_TEXT . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where languages_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_TOPICS_DESCRIPTION . " where language_id = '" . (int)$lID . "'");
+tep_db_query("delete from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'");
+
+       tep_redirect(tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'delete':
+        $lID = tep_db_prepare_input($HTTP_GET_VARS['lID']);
+
+        $lng_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'");
+        $lng = tep_db_fetch_array($lng_query);
+
+        $remove_language = true;
+        if ($lng['code'] == DEFAULT_LANGUAGE) {
+          $remove_language = false;
+          $messageStack->add('search', ERROR_REMOVE_DEFAULT_LANGUAGE, 'error');
+        }
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+    <tr>
+        <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+                <!-- left_navigation //-->
+                <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+                <!-- left_navigation_eof //-->
+            </table></td>
+        <!-- body_text //-->
+        <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                <tr>
+                    <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                            <tr>
+                                <td class="pageHeading"><?php echo HEADING_TITLE; ?>
+                                    <?php
+          if($_GET["action"] == "sync")
+          {           
+            $ln_id = get_degault_language_id();
+
+            $s_lang = "select name from languages where languages_id = ".$ln_id;
+            $res_lang = mysql_query($s_lang) or die(mysql_error());
+            $data_lang = mysql_fetch_array($res_lang);
+            Print(" <span class='dataTableContent'><br> ".DEFAULT_LANGUAGE_IS." ".$data_lang["name"] . "</span>");
+          }
+        ?>
+                                </td>
+                                <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+                            </tr>
+                        </table></td>
+                </tr>
+                <tr>
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+                            <tr>
+                                <td valign="top"><!-- /*******************/ -->
+                                    <?php
+            $s_dbnm = DB_DATABASE;
+            $arr_show = array();
+            $arr_update_show = array();
+            $arr_missing_lang_tables = array();
+
+            if($action == "sync" || $action == 'show')
+            {
+                
+                $s_mode = $action;
+
+                // step 1 : collect default language id
+                $i_default_language_id = get_degault_language_id();
+
+                // step 2 : collect all the table name which has language_id or languages_id as one of its field 
+                $arr_table_names = get_table_names($s_dbnm);
+
+                // step 3 : collect all the defined languages from the language table 
+                $arr_languages_id = collect_all_defined_languages_id();
+                $i_lang_num_rec = count($arr_languages_id);
+
+                // step 4 : Initialization for some escape and explicite tables
+                $arr_escape_tables = array("orders_session_info");
+                $arr_explicite_tables = array("affiliate_news_contents","affiliate_payment_status","orders_pay_methods","orders_ship_methods");
+
+                //step 5 : Merge the explicite tables with the table names find out from step2
+                $arr_table_names = array_merge($arr_table_names,$arr_explicite_tables);
+
+                for($icounter = 0 ; $icounter < count($arr_table_names); $icounter++)
+                {
+                    $s_table_name = $arr_table_names[$icounter];
+                    if(in_array($s_table_name,$arr_escape_tables))
+                    {   
+                        continue;
+                    }
+
+                //step 6 : get the primary coloumn name and language field name from tables to find the unique record for default language  
+
+                    // collect primary key column name
+                    $arr_key_name = get_primary_key_column_name($s_table_name);
+                    
+                    // collect the language defined column name
+                    $s_language_key = get_language_field_name($s_table_name); 
+
+                    if($s_table_name == "orders_pay_methods")
+                    {
+                        $s_language_key = "pay_method_language";
+                    }
+                    
+                    if($s_table_name == "orders_ship_methods")
+                    {
+                        $s_language_key = "ship_method_language";
+                    }
+
+                //  step 7 : collect the no of records for each unique record id. If no. of records are mismatch with teh defined language, the find for which language  the record is missing      
+
+                    // collect the distinct record for default language id
+                    $arr_distinct_id = get_distinct_record_ids($arr_key_name[0],$s_table_name,$i_default_language_id,$s_language_key);
+
+                    // if no record exist 
+                    if(empty($arr_distinct_id))
+                    {
+                        continue;
+                    } 
+                    
+                    $tmp = 0;
+                    $tmp_update = 0;
+                    $s_show = "";
+                    $s_show_update = "";
+                    $f_filename = "sync_".date("YMd")."_".date("h_i_a").".txt"; 
+
+                    for($vloop = 0 ; $vloop < count($arr_distinct_id) ; $vloop++)
+                    {   
+                        // get no of record for each distinct id
+                        $i_num_rec = get_no_of_records_for_distinct_id($arr_distinct_id[$vloop],$arr_key_name[0],$s_table_name);
+
+                        // If record is missing for any language
+                        if($i_num_rec < $i_lang_num_rec)
+                        { 
+                            $arr_missing_lang_tables[] = $s_table_name;
+                            $arr_missing_lang_for_distinct_id[] = $arr_distinct_id[$vloop];
+
+                            //  for each defined langauge
+                            for($iloop = 0 ; $iloop < count($arr_languages_id);$iloop++)
+                            {
+                                // step 8 : So insert the record for missing language same as the record for default language id
+
+                                // Check for which language the record is missing
+                                if(!record_exist_for_languages_id($arr_languages_id[$iloop],$arr_distinct_id[$vloop],$arr_key_name[0],$s_table_name,$s_language_key))
+                                { 
+                                    $total_rec = $iloop;
+                                    $arr_tables_missing_languages[$s_table_name][$arr_distinct_id[$vloop]][] = $arr_languages_id[$iloop];
+
+                                    $arr_tables_missing_languages_only[$s_table_name][] = $arr_languages_id[$iloop];
+
+                                    $arr_tables_distinct_ids_only[$s_table_name][] = 
+                                    $arr_distinct_id[$vloop];
+                                    
+                                    // insert the record for missing langauge         
+                                    $s_show .= insert_record_for_languages_id($i_default_language_id,$arr_languages_id[$iloop],$s_table_name,$arr_key_name[0],$arr_distinct_id[$vloop],$s_language_key,$s_mode)."<br><br>";
+                                    $tmp++;
+                                }
+                            }     
+                        }
+                        /********************************/
+                        // Check for which language the data is missing
+                        //  for each defined langauge
+                        for($iloop = 0 ; $iloop < count($arr_languages_id);$iloop++)
+                        {
+                            if($arr_languages_id[$iloop] == $i_default_language_id)
+                                {
+                                    continue;
+                                }
+
+                            // Check for which language the data is missing
+                            if(data_exist_for_languages_id($arr_languages_id[$iloop],$arr_distinct_id[$vloop],$arr_key_name[0],$s_table_name,$s_language_key))
+                            {         
+                                $s_show_update .=  update_record_for_missing_languages_id($i_default_language_id,$arr_languages_id[$iloop],$s_table_name,$arr_key_name[0],$arr_distinct_id[$vloop],$s_language_key,$s_mode)."<br><br>";
+                                
+                                $arr_update_show[$s_table_name] = $s_show_update;
+                                $arr_update_show_dist_missing_lng[$s_table_name][$arr_distinct_id[$vloop]][]= $arr_languages_id[$iloop];
+                                $arr_update_show_missing_lng[$s_table_name][]= $arr_languages_id[$iloop];
+                                $arr_tables_update_distinct_ids_only[$s_table_name][] = $arr_distinct_id[$vloop];
+
+                                $tmp_update++;
+                            }
+                        } 
+                        /******************************************/
+                    } 
+
+                    // collect total no of records inserted for the table
+                    if($tmp > 0)
+                    {
+                        $arr_added_records[$s_table_name] = $tmp;
+                    }
+
+                    // collect total no of records updated for the table
+                    if($tmp_update > 0)
+                    {
+                        $arr_update_records[$s_table_name] = $tmp_update;
+                    }
+
+                    // collect the insert queries for tables
+                    if($s_show != "")
+                    {
+                        $arr_show[$s_table_name] = $s_show;
+                    } 
+                    
+                }
+
+                // Collect unique table name for missing language records
+                $arr_missing_lang_tables = array_unique($arr_missing_lang_tables);
+
+            }
+      if($_GET["action"] == "sync")
+      { 
+                ?>
+                     <table border="0" width="100%" cellspacing="1" cellpadding="0" bgcolor = "#c9c9c9"><tr>
+                        <td><table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor = "#FFFFFF">
+                <?php
+        if(count($arr_missing_lang_tables) > 0 || count($arr_update_show) > 0)
+        {
+        ?>
+                          <tr>
+                               <td><table border="0" width="100%" cellspacing="1" cellpadding="2">
+                                      <tr class="dataTableHeadingRow">
+                                         <td class="dataTableHeadingContent" style = "padding-left:20"><?php print(TABLE_NAMES);?> </td>
+                                         <td class="dataTableHeadingContent" style = "padding-left:20"><?php print(MISSING_LANGUAGE);?> </td>
+                                         <td class="dataTableHeadingContent" style = "padding-left:20"><?php  print(MISSING_LANGUAGES_FOR_DISTINCT_ID);?></td>
+                                         <td class="dataTableHeadingContent" style = "padding-left:20">
+                                        <?php print(TOTAL_NO_OF_RECORDS_IMPACTED);?> </td>
+                                  </tr>
+                                       <tr  class="dataTableHeadingRow">
+                                          <td>&nbsp;</td>
+                                          <td>&nbsp;</td>
+                                          <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                                                <tr class="dataTableHeadingRow">
+                                                    <td width = "50%"  class="dataTableHeadingContent"><?php print(DISTINCT_ID);?> </td>
+                                                    <td width = "50%" class="dataTableHeadingContent"><?php  print(MISSING_LANGUAGE);?>
+                                                    </td>
+                                                </tr>
+                                            </table></td>
+                                          <td>&nbsp;</td>
+                                      </tr>
+                                        <?php
+                                            $ii_count = 0;
+                                            $ar_count = count($arr_missing_lang_tables);
+                                            if($ar_count > 0)
+                                            {         
+                                        ?>
+                                        <tr>
+                                          <td><B>
+                                          <?php  print(INSERT_RECORDS_ANALYSIS);?>
+                                          </B></td>
+                                        </tr>
+                                        <?php
+                               }
+                               foreach($arr_missing_lang_tables as $s_tbl_name)
+                               {
+                                   ?>
+                                         <tr bgcolor = "#FFFFFF">
+                                           <td style = "padding-left:20" class="dataTableContent" valign = "top"><br>
+                                             <?php print( $s_tbl_name );?> </td>
+                                           <td class="dataTableContent" valign = "top"><br>
+                                             <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                                             <?php
+                          $arr_lang1 = array_unique($arr_tables_missing_languages_only[$s_tbl_name]);
+                          sort($arr_lang1);
+                          for($j = 0 ; $j < count($arr_lang1) ; $j++)
+                          {
+                         ?>
+                                             <tr>
+                                               <td style = "padding-left:20" class="dataTableContent" valign = "top"><?php
+                        print($arr_lang1[$j]);
+                          ?>
+                                               </td>
+                                              </tr>
+                                              <?php
+                           }
+                           ?>
+                                               </table></td>
+                                               <td ><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                                               <?php  
+                             $x_count = 0;
+                             foreach(array_unique($arr_tables_distinct_ids_only[$s_tbl_name]) as $i_dist_id)
+                             {
+                             if($x_count%2 == 0)
+                             {            
+                        ?>
+                                                <tr bgcolor = "#FFFFFF">
+                                                <?php
+                              }
+                              else
+                              {             
+                        ?>
+                                                <tr bgcolor = "#F3F3F3">
+                                                <?php
+                               }
+                      
+                                $x_count++;
+                            ?>
+                                                 <td width = "50%" style = "padding-left:20"><?php
+                            print($i_dist_id);
+                              ?>
+                                                  </td>
+                                                  <td width = "50%" ><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                                                  <?php               
+                          foreach($arr_tables_missing_languages[$s_tbl_name][$i_dist_id] as $val)
+                          {
+                          ?>
+                                                  <tr>
+                                                    <td style = "padding-left:20" ><?php print($val);?> </td>
+                                                  </tr>
+                                                  <?php
+                             }
+                           ?>
+                                                   </table></td>
+                                                   </tr>
+                                                   <?php
+                               }
+                                ?>
+                                                    </table></td>
+                                                    <td style = "padding-left:20" class="dataTableContent" valign = "top"><br>
+                                                    <?php print($arr_added_records[$s_tbl_name]);?> </td>
+                                                    </tr>
+                                                    <?php               
+                                        if($ar_count > 0 && $ii_count < ($ar_count-1) )
+                                        { 
+                                         ?>
+                                                     <tr>
+                                                       <td colspan="10" bgcolor = "#D8D8D8"></td>
+                                                     </tr>
+                                                     <?php
+                                         }
+                                         $ii_count++;                                        
+                                         }                                            
+                
+                                          $iii_count = 0;
+                                          $ar_count = count($arr_update_show);
+                                          if($ar_count > 0)
+                                          {
+                                        ?>
+                                                        <tr>
+                                                           <td colspan="10" bgcolor = "#D8D8D8"></td>
+                                                        </tr>
+                                                        <tr>
+                                                           <td colspan="10"><B><?php print(UPDATE_RECORDS_ANALYSIS);?></B></td>
+                                                        </tr>
+                                                        <?php
+                                            }
+
+                                            foreach($arr_update_show as $x_key_update => $x_val_update)
+                                            {
+                                            if($ii_count > 0 && $iii_count == 0)
+                                            {
+                                        ?>
+                                                          <tr>
+                                                           <td colspan="10" bgcolor = "#D8D8D8"></td>
+                                                          </tr>
+                                                          <?php
+                                             }
+
+                                               ?>
+                                                           <tr>
+                                                             <td style = "padding-left:20" valign = "top"><br>
+                                                               <?php print($x_key_update);?> </td>
+                                                             <td valign = "top"><br>
+                                                                <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                                                                   <?php
+              $arr_lang_update1 = array_unique($arr_update_show_missing_lng[$x_key_update]);
+              sort($arr_lang_update1);
+              for($j = 0 ; $j < count($arr_lang_update1) ; $j++)
+              {
+            ?>
+                                                                            <tr>
+                                                                                <td style = "padding-left:20" valign = "top"><?php
+                print($arr_lang_update1[$j]);
+            ?>
+                                                                                </td>
+                                                                            </tr>
+                                                                            <?php
+              }
+            ?>
+                                                                        </table></td>
+                                                                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                                                                            <?php 
+            $x_count = 0;
+            foreach(array_unique($arr_tables_update_distinct_ids_only[$x_key_update]) as $i_update_dist_id)
+            {     
+
+              if($x_count%2 == 0)
+              {           
+          ?>
+                                                                            <tr bgcolor = "#FFFFFF">
+                                                                                <?php
+            }
+            else
+            {             
+              ?>
+                                                                            <tr bgcolor = "#F3F3F3">
+                                                                                <?php
+            }
+                        
+            $x_count++;
+              ?>
+                                                                                <td width = "50%" style = "padding-left:20"><?php
+                print($i_update_dist_id);
+            ?>
+                                                                                </td>
+                                                                                <td width = "50%"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                                                                                        <?php               
+                  foreach($arr_update_show_dist_missing_lng[$x_key_update][$i_update_dist_id] as $s_update_val)
+                  {
+                    ?>
+                                                                                        <tr>
+                                                                                            <td style = "padding-left:20"><?php print($s_update_val);?> </td>
+                                                                                        </tr>
+                                                                                        <?php
+                  }
+                ?>
+                                                                                    </table></td>
+                                                                            </tr>
+                                                                            <?php
+              }
+                    ?>
+                                                                        </table></td>
+                                                                    <td style = "padding-left:20" valign = "top"><br>
+                                                                        <?php print($arr_update_records[$x_key_update]);?> </td>
+                                                                </tr>
+                                                                <?php               
+                      if($ar_count > 0 && $iii_count < ($ar_count-1) )
+                      { 
+                      ?>
+                                                                <tr>
+                                                                    <td colspan="10" bgcolor = "#D8D8D8"></td>
+                                                                </tr>
+                                                                <?php
+                      }
+                        $iii_count++; 
+                       }
+                      ?>
+                                                            </table></td>
+                                                    </tr>
+                                                    <?php
+        }
+        else
+        {
+          print("<tr><td height = '35'><p><center>".THERE_ARE_NO_MISSING_RECORD_FOR_ANY_LANGUAGES."</center></p></td></tr>");
+        }
+      ?>
+                                                </table></td>
+                                        </tr>
+                                    </table>
+                                    <?php
+
+      }
+      else
+      {
+
+      ?>
+                                    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                                        <tr class="dataTableHeadingRow">
+                                            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LANGUAGE_NAME; ?></td>
+                                            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LANGUAGE_CODE; ?></td>
+                                            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+                                        </tr>
+                                        <?php
+  $languages_query_raw = "select languages_id, name, code, image, directory, sort_order from " . TABLE_LANGUAGES . " order by sort_order";
+  $languages_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $languages_query_raw, $languages_query_numrows);
+  $languages_query = tep_db_query($languages_query_raw);
+
+  while ($languages = tep_db_fetch_array($languages_query)) {
+    if ((!isset($HTTP_GET_VARS['lID']) || (isset($HTTP_GET_VARS['lID']) && ($HTTP_GET_VARS['lID'] == $languages['languages_id']))) && !isset($lInfo) && (substr($action, 0, 3) != 'new')) {
+      $lInfo = new objectInfo($languages);
+    }
+
+    if (isset($lInfo) && is_object($lInfo) && ($languages['languages_id'] == $lInfo->languages_id) ) {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $languages['languages_id']) . '\'">' . "\n";
+    }
+
+    if (DEFAULT_LANGUAGE == $languages['code']) {
+      echo '                <td class="dataTableContent"><b>' . $languages['name'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
+    } else {
+      echo '                <td class="dataTableContent">' . $languages['name'] . '</td>' . "\n";
+    }
+?>
+                                        <td class="dataTableContent"><?php echo $languages['code']; ?></td>
+                                            <td class="dataTableContent" align="right"><?php if (isset($lInfo) && is_object($lInfo) && ($languages['languages_id'] == $lInfo->languages_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $languages['languages_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
+                                                &nbsp;</td>
+                                        </tr>
+                                        <?php
+  }
+?>
+                                        <tr>
+                                            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                                                    <tr>
+                                                        <td class="smallText" valign="top"><?php echo $languages_split->display_count($languages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_LANGUAGES); ?></td>
+                                                        <td class="smallText" align="right"><?php echo $languages_split->display_links($languages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                                                    </tr>
+                                                    <?php
+  if (empty($action)) {
+?>
+                                                    <tr>
+                                                        <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=new') . '">' . tep_image_button('button_new_language.gif', IMAGE_NEW_LANGUAGE) . '</a>'; ?></td>
+                                                    </tr>
+                                                    <?php
+  }
+?>
+                                                </table></td>
+                                        </tr>
+                                    </table>
+                                    <?php
+      }
+      ?>
+                                    <!-- /*********************/ -->
+                                </td>
+                                <?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_LANGUAGE . '</b>');
+
+      $contents = array('form' => tep_draw_form('languages', FILENAME_LANGUAGES, 'action=insert'));
+      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_NAME . '<br>' . tep_draw_input_field('name'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_CODE . '<br>' . tep_draw_input_field('code'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_IMAGE . '<br>' . tep_draw_input_field('image', 'icon.gif'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br>' . tep_draw_input_field('directory'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order'));
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $HTTP_GET_VARS['lID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_LANGUAGE . '</b>');
+
+      $contents = array('form' => tep_draw_form('languages', FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_NAME . '<br>' . tep_draw_input_field('name', $lInfo->name));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_CODE . '<br>' . tep_draw_input_field('code', $lInfo->code));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_IMAGE . '<br>' . tep_draw_input_field('image', $lInfo->image));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br>' . tep_draw_input_field('directory', $lInfo->directory));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', $lInfo->sort_order));
+      if (DEFAULT_LANGUAGE != $lInfo->code) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;    
+    
+  case 'show':    
+      $heading[] = array('text' => '<b>' . TABLE_SYNCHRONIZATION . '</b>');
+      $contents = array('form' => tep_draw_form('languages_sync', FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=sync'));
+
+    if(!empty($arr_missing_lang_tables))
+    {
+      $contents[] = array('text' => "<b><center> ".INSERT_QUERIES." </center></b><br>");
+      foreach($arr_missing_lang_tables as $val1)
+      {
+        $contents[] = array('text' => "<b>$val1</b><br>");
+        $contents[] = array('text' =>$arr_show[$val1]."<br>");
+      }
+    }
+
+    if(!empty($arr_update_show))
+    {
+      $contents[] = array('text' => "<b><center> ".UPDATE_QUERIES." </center></b><br>");
+      foreach($arr_update_show as $x_key=>$x_val)
+      {
+        $contents[] = array('text' => "<b>$x_key</b><br>");
+        $contents[] = array('text' =>$x_val);
+      }
+    }
+    if(empty($arr_missing_lang_tables) && empty($arr_update_show))
+      {
+      $contents[] = array('align' => 'center', 'text' => '<br>' . THERE_ARE_NO_MISSING_RECORD_FOR_ANY_LANGUAGES. '<br><br> <a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      }
+    else
+      {
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+    }
+      break;
+
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_LANGUAGE . '</b>');
+
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $lInfo->name . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . (($remove_language) ? '<a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=deleteconfirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' : '') . ' <a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($lInfo)) {
+        $heading[] = array('text' => '<b>' . $lInfo->name . '</b>');
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_EDIT_TEXT, '&lng=' . $lInfo->directory . '&lngdir=') . '">' . tep_image_button('button_edit_lang_define.gif', IMAGE_EDIT_LANG_DEFINE) . '</a> <a href="' . tep_href_link(FILENAME_LANGUAGES.'?action=show') . '">' . tep_image_button('sync.gif', IMAGE_SYNC). '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_NAME . ' ' . $lInfo->name);
+        $contents[] = array('text' => TEXT_INFO_LANGUAGE_CODE . ' ' . $lInfo->code);
+        $contents[] = array('text' => '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $lInfo->directory . '/images/' . $lInfo->image, $lInfo->name));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_DIRECTORY . '<br>' . DIR_WS_CATALOG_LANGUAGES . '<b>' . $lInfo->directory . '</b>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LANGUAGE_SORT_ORDER . ' ' . $lInfo->sort_order);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+                            </tr>
+                        </table></td>
+                </tr>
+            </table></td>
+        <!-- body_text_eof //-->
+    </tr>
+</table>
+<!-- body_eof //-->
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
+<?php
+
+  #############################################
+  # show all the table names from database  #
+  #############################################
+function show_tables($s_dbnm)
+{
+  // Run a query to get all the table names
+  $s_show_tables = "show tables from ".$s_dbnm." ";
+  $res_show_tables = mysql_query($s_show_tables) or die(mysql_error());
+  While($data_show_tables = mysql_fetch_array($res_show_tables))
+  {
+    $arr_table_name_tmp[] = $data_show_tables[0];
+  }
+
+  return $arr_table_name_tmp;
+}
+  #########################################################
+  # get table names which has language_id/languages_id  #
+  # as one of the field                 # #########################################################
+
+function get_table_names($s_dbnm)
+{ 
+  // show all the tables in database
+  $arr_table_name_tmp = show_tables($s_dbnm); 
+  
+  for($vloop = 0 ; $vloop < count($arr_table_name_tmp) ; $vloop++)
+  {
+    $s_table_name_tmp = $arr_table_name_tmp[$vloop];
+  
+    // escape for language table as it is our reference table
+    if($s_table_name_tmp == "languages")
+    {
+      continue;
+    }
+    
+    // run a query to show all the fields of the table
+    $s_tbl_hving_langs_id = "show fields from ".$s_table_name_tmp."";
+    $res_tbl_hving_langs_id = mysql_query($s_tbl_hving_langs_id) or die(mysql_error());
+    while($data_tbl_hving_langs_id = mysql_fetch_array($res_tbl_hving_langs_id))
+    {     
+      $s_table_field = $data_tbl_hving_langs_id["Field"]; 
+      
+      // If table have `languages_id` as one of its field   
+      if($s_table_field == "language_id")
+      {
+        $arr_table_names[] = $s_table_name_tmp;
+        break;
+      }
+      if($s_table_field == "languages_id")
+      {
+        $arr_table_names[] = $s_table_name_tmp;
+        break;
+      }
+    }
+    
+  } 
+  return $arr_table_names;
+}
+
+  #############################################
+  # Get the primary_key name for table    #
+  #############################################
+
+function get_primary_key_column_name($s_table_name)
+{ 
+  $arr_key_name = array();
+  $s_pkquery = "show keys from `".$s_table_name."`";  
+
+  $res_pkquery = mysql_query($s_pkquery) or die(mysql_error());
+  while($data_pkquery = mysql_fetch_array($res_pkquery))
+  {
+    // collect only the Primaray key colounm name
+    if($data_pkquery["Key_name"] == "PRIMARY" && $data_pkquery["Column_name"] != "languages_id")
+    {
+      $arr_key_name[] = $data_pkquery["Column_name"];
+    }
+  } 
+
+  if(empty($arr_key_name))
+  {
+    $s_pkquery = "show keys from `".$s_table_name."`";
+    $res_pkquery = mysql_query($s_pkquery) or die(mysql_error());
+    
+    while($data_pkquery1 = mysql_fetch_array($res_pkquery))
+    {
+      $arr_key_name[] = $data_pkquery1["Column_name"];
+    }
+  } 
+
+  return $arr_key_name;
+}
+
+  
+
+function get_language_field_name($s_table_name)
+{
+  $s_kquery = "show fields from `".$s_table_name."`";
+  
+  $res_kquery = mysql_query($s_kquery) or die(mysql_error());
+  while($data_kquery = mysql_fetch_array($res_kquery))
+  {
+    // collect only the Primaray key colounm name
+    if(is_numeric(strpos($data_kquery["Field"],"language")) && is_numeric(strpos($data_kquery["Field"],"id")) )
+    {
+      return $data_kquery["Field"];
+    }   
+  } 
+}
+
+  #################################################
+  # Get the get distinct record ids for table #
+  #################################################
+
+function get_distinct_record_ids($s_key_name,$s_table_name,$i_default_language_id,$s_language_key)
+{
+  $arr_distinct_id = array();
+  $s_distinctrec = "select distinct(".$s_key_name.") from `".$s_table_name."` where ".$s_language_key." = ".$i_default_language_id." order by ".$s_key_name; 
+
+  $res_distinctrec = mysql_query($s_distinctrec) or die(mysql_error());
+  while($data_distinctrec = mysql_fetch_array($res_distinctrec))
+  {
+    $arr_distinct_id[] = $data_distinctrec[0];
+  }
+  
+  return($arr_distinct_id);
+}
+
+  #########################################
+  # collect all defined languages id  #
+  #########################################
+
+function collect_all_defined_languages_id()
+{
+  $s_languages_id = "select languages_id from languages order by languages_id";
+  $res_languages_id = mysql_query($s_languages_id) or die(mysql_error());
+  while($data_languages_id = mysql_fetch_array($res_languages_id))
+  {
+    $arr_languages_id[] = $data_languages_id["languages_id"];
+  }
+  return $arr_languages_id;
+}
+
+  #########################################
+  # get no of records for distinct id #
+  #########################################
+
+function get_no_of_records_for_distinct_id($i_distinct_id,$s_key_name,$s_table_name)
+{
+  $s_distinct_id = "select count(*) from ".$s_table_name." where ".$s_key_name." = '".$i_distinct_id."'";
+  $res_distinct_id = mysql_query($s_distinct_id) or die(mysql_error());
+  $data_distinct_id = mysql_fetch_array($res_distinct_id);
+
+  return $data_distinct_id[0];
+}
+
+  #########################################
+  # get no of records for distinct id #
+  #########################################
+
+function record_exist_for_languages_id($i_languages_id,$i_distinct_id,$s_key_name,$s_table_name,$s_language_key)
+{
+  $s_chk_record = "select count(*) from ".$s_table_name." where ".$s_language_key." = '".$i_languages_id."' and ".$s_key_name." = '".$i_distinct_id."'";
+
+  $res_chk_record = mysql_query($s_chk_record) or die(mysql_error());
+  $data_chk_record = mysql_fetch_array($res_chk_record);
+  $i_exist = $data_chk_record[0];
+
+  return $i_exist;
+}
+  #########################################
+  # insert record for languages id    #
+  #########################################
+
+function insert_record_for_languages_id($i_default_language_id,$i_languages_id,$s_table_name,$s_key_name,$i_distinct_id,$s_language_key,$s_mode)
+{
+  // collect fields in array `$arr_default_language_fields`
+  $arr_default_language_fields = get_fields_name($s_table_name);
+
+  // collect field data in array `$arr_default_language_data`
+  $arr_default_language_data = get_fields_data($s_table_name,$i_default_language_id,$s_key_name,$i_distinct_id,$arr_default_language_fields,$i_languages_id,$s_language_key);
+
+  $s_fields = "";
+  $s_data   = "";
+
+  // generate fields string and values string for insert query
+  for($iloop = 0 ;$iloop < count($arr_default_language_fields); $iloop++)
+  {
+    if($iloop == (count($arr_default_language_fields) - 1 ))
+    {
+      $s_fields = $s_fields.$arr_default_language_fields[$iloop];
+      $s_data = $s_data."'".mysql_escape_string($arr_default_language_data[$iloop])."'";
+    }
+    else
+    {
+      $s_fields = $s_fields.$arr_default_language_fields[$iloop].",";
+      $s_data = $s_data."'".mysql_escape_string($arr_default_language_data[$iloop])."' , ";
+    }
+  }
+
+  // insert data in table for missing language
+  $s_insert = "insert into ".$s_table_name." ( ".$s_fields." ) values ( ".$s_data.");";
+
+  if($s_mode == "show")
+  {    
+    return($s_insert);
+  }
+  else if($s_mode == "sync")
+  {   
+    mysql_query($s_insert) or die($s_insert."<br><br>".mysql_error());
+  }
+}
+
+  #########################
+  # get fields name   #
+  #########################
+
+function get_fields_name($s_table_name)
+{
+  // run query to get all the fields from table
+  $s_default_language_fields = "show fields from ".$s_table_name."";
+  $res_default_language_fields = mysql_query($s_default_language_fields) or die(mysql_error());
+  while($data_default_language_fields = mysql_fetch_array($res_default_language_fields))
+  {
+    $arr_default_language_fields[] = $data_default_language_fields["Field"];
+  }
+
+  return $arr_default_language_fields;
+}
+
+  #########################
+  # get_fields_data   #
+  #########################
+function get_fields_data($s_table_name,$i_default_language_id,$s_key_name,$i_distinct_id,$arr_default_language_fields,$i_languages_id,$s_language_key)
+{
+  // Run the query to get the data for default language
+  $s_default_language_data = "select * from ".$s_table_name." where ".$s_language_key." = '".$i_default_language_id."' and ".$s_key_name." = '".$i_distinct_id."'"; 
+
+  $res_default_language_data = mysql_query($s_default_language_data) or die(mysql_error());
+  $data_default_language_data = mysql_fetch_array($res_default_language_data);
+  for($vloop = 0; $vloop < count($arr_default_language_fields) ; $vloop++)
+  {
+    if($arr_default_language_fields[$vloop] == "languages_id" || $arr_default_language_fields[$vloop] == "language_id" || $arr_default_language_fields[$vloop] == "pay_method_language" || $arr_default_language_fields[$vloop] == "ship_method_language" || $arr_default_language_fields[$vloop] == "affiliate_language_id")
+    {
+      $arr_default_language_data[] = $i_languages_id;
+    }   
+    else
+    {
+      $arr_default_language_data[] = $data_default_language_data[$arr_default_language_fields[$vloop]];
+    }   
+  }
+
+  return $arr_default_language_data;
+}
+
+function data_exist_for_languages_id($i_languages_id,$i_distinct_id,$s_key_name,$s_table_name,$s_language_key)
+{
+  $arr_missing_data_field = array();
+
+  // collect all the fields of  the table
+  $arr_table_fields = get_fields_name($s_table_name);
+
+  // run query to collect all the data for perticular record
+  $s_chk_data = "select * from ".$s_table_name." where ".$s_key_name." = '".$i_distinct_id."' and ".$s_language_key." = '".$i_languages_id."'";
+
+  $res_chk_data = mysql_query($s_chk_data) or die(mysql_error($s_chk_data ));
+  $r_count = mysql_num_rows($res_chk_data);
+  $data_chk_data = mysql_fetch_array($res_chk_data);
+  
+  if($r_count > 0)
+  {
+    // check data for each field
+    foreach($arr_table_fields as $s_field)
+    {
+      // if there is blank data for any field then return true else false
+      if($data_chk_data[$s_field] == "")
+      {
+        return true;
+      }
+    }   
+  }
+  return false;
+}
+
+function update_record_for_missing_languages_id($i_default_language_id,$i_languages_id,$s_table_name,$s_key_name,$i_distinct_id,$s_language_key,$s_mode)
+{ 
+  if($i_languages_id == $i_default_language_id)
+  {
+    return;
+  }
+
+  // collect fields in array `$arr_default_language_fields`
+  $arr_default_language_fields = get_fields_name_for_update($i_default_language_id,$i_languages_id,$s_table_name,$s_key_name,$i_distinct_id,$s_language_key);
+
+
+  // collect field data in array `$arr_default_language_data`
+  $arr_default_language_data = get_fields_data($s_table_name,$i_default_language_id,$s_key_name,$i_distinct_id,$arr_default_language_fields,$i_languages_id,$s_language_key);
+
+  $s_fields = "";
+  $s_data   = "";
+  $s_update_string = "";
+
+  $s_update = "update ".$s_table_name." SET ";
+
+  // generate fields string and values string for insert query
+  for($iloop = 0 ;$iloop < count($arr_default_language_fields); $iloop++)
+  {
+    if($iloop == (count($arr_default_language_fields) - 1 ))
+    {
+      $s_update_string = $s_update_string.$arr_default_language_fields[$iloop]." = '".mysql_escape_string($arr_default_language_data[$iloop])."'";
+    }
+    else
+    {
+      $s_update_string = $s_update_string.$arr_default_language_fields[$iloop]." = '".mysql_escape_string($arr_default_language_data[$iloop])."',";
+    }
+  }
+
+  // update data in table for missing language
+  $s_update = $s_update.$s_update_string." where ".$s_key_name." = '".$i_distinct_id."' and ".$s_language_key." = '".$i_languages_id."'"; 
+  
+  if($s_mode == "show")
+  {
+    return($s_update);
+  }
+  else if($s_mode == "sync")
+  {   
+    mysql_query($s_update) or die($s_update."<br><br>".mysql_error());
+  }
+}
+
+
+  #################################
+  # get_fields_name_for_update  #
+  #################################
+
+function get_fields_name_for_update($i_default_language_id,$i_languages_id,$s_table_name,$s_key_name,$i_distinct_id,$s_language_key)
+{
+  // run query to get all the fields from table
+  $s_default_language_fields = "show fields from ".$s_table_name."";
+  $res_default_language_fields = mysql_query($s_default_language_fields) or die(mysql_error());
+  while($data_default_language_fields = mysql_fetch_array($res_default_language_fields))
+  {
+    $arr_default_language_fields[] = $data_default_language_fields["Field"];
+  }
+
+  $s_str = "select * from ".$s_table_name." where ".$s_language_key." = ".$i_languages_id . " and ".$s_key_name. "='".$i_distinct_id."'"; 
+  $res = mysql_query($s_str) or die(mysql_error());
+  $data = mysql_fetch_array($res);
+  foreach($arr_default_language_fields as $xval)
+  {
+    if($data[$xval] == "")
+    {
+      $arr_default_language_fields_1[] = $xval;
+    }
+  }
+
+  return $arr_default_language_fields_1;
+}
+
+function get_degault_language_id()
+{
+    $s = "select * from configuration where configuration_key = 'DEFAULT_LANGUAGE'";
+    $r = mysql_query($s) or die(mysql_error());
+    $d = mysql_fetch_array($r);
+    $ln = $d["configuration_value"];
+
+    $s1 = "select languages_id from languages where code = '$ln'";
+    $r1 = mysql_query($s1) or die(mysql_error());
+    $d1 = mysql_fetch_array($r1);
+    $ln_id = $d1["languages_id"];
+
+    return $ln_id;
+}
+?>

Added: trunk/direct.openmoko.com/admin/link_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/link_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/link_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,331 @@
+<?php
+/*
+  $Id: link_categories.php,v 1.00 2003/10/02 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// define our link functions
+  require(DIR_WS_FUNCTIONS . 'links.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  $error = false;
+  $processed = false;
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'setflag':
+        $status = tep_db_prepare_input($HTTP_GET_VARS['flag']);
+
+        if ($status == '1') {
+          tep_db_query("update " . TABLE_LINK_CATEGORIES . " set link_categories_status = '1' where link_categories_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");
+        } elseif ($status == '0') {
+          tep_db_query("update " . TABLE_LINK_CATEGORIES . " set link_categories_status = '0' where link_categories_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");
+        } 
+
+        tep_redirect(tep_href_link(FILENAME_LINK_CATEGORIES, '&cID=' . $HTTP_GET_VARS['cID']));
+        break;
+      case 'insert':
+      case 'update':
+        if (isset($HTTP_POST_VARS['link_categories_id'])) $link_categories_id = tep_db_prepare_input($HTTP_POST_VARS['link_categories_id']);
+        $link_categories_sort_order = tep_db_prepare_input($HTTP_POST_VARS['link_categories_sort_order']);
+        $link_categories_status = ((tep_db_prepare_input($HTTP_POST_VARS['link_categories_status']) == 'on') ? '1' : '0');
+
+        $sql_data_array = array('link_categories_sort_order' => $link_categories_sort_order, 
+                                'link_categories_status' => $link_categories_status);
+
+        if ($action == 'insert') {
+          $insert_sql_data = array('link_categories_date_added' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+          tep_db_perform(TABLE_LINK_CATEGORIES, $sql_data_array);
+
+          $link_categories_id = tep_db_insert_id();
+        } elseif ($action == 'update') {
+          $update_sql_data = array('link_categories_last_modified' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+          tep_db_perform(TABLE_LINK_CATEGORIES, $sql_data_array, 'update', "link_categories_id = '" . (int)$link_categories_id . "'");
+        }
+
+        $languages = tep_get_languages();
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $link_categories_name_array = $HTTP_POST_VARS['link_categories_name'];
+          $link_categories_description_array = $HTTP_POST_VARS['link_categories_description'];
+
+          $language_id = $languages[$i]['id'];
+
+          $sql_data_array = array('link_categories_name' => tep_db_prepare_input($link_categories_name_array[$language_id]), 
+                                  'link_categories_description' => tep_db_prepare_input($link_categories_description_array[$language_id]));
+
+          if ($action == 'insert') {
+            $insert_sql_data = array('link_categories_id' => $link_categories_id,
+                                     'language_id' => $languages[$i]['id']);
+
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_LINK_CATEGORIES_DESCRIPTION, $sql_data_array);
+          } elseif ($action == 'update') {
+            tep_db_perform(TABLE_LINK_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "link_categories_id = '" . (int)$link_categories_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
+          }
+        }
+
+        if ($link_categories_image = new upload('link_categories_image', DIR_FS_CATALOG_IMAGES)) {
+          tep_db_query("update " . TABLE_LINK_CATEGORIES . " set link_categories_image = '" . tep_db_input($link_categories_image->filename) . "' where link_categories_id = '" . (int)$link_categories_id . "'");
+        }
+
+        tep_redirect(tep_href_link(FILENAME_LINK_CATEGORIES, '&cID=' . $link_categories_id));
+        break;
+      case 'delete_confirm':
+        if (isset($HTTP_POST_VARS['link_categories_id'])) {
+          $link_categories_id = tep_db_prepare_input($HTTP_POST_VARS['link_categories_id']);
+
+          $link_ids_query = tep_db_query("select links_id from " . TABLE_LINKS_TO_LINK_CATEGORIES . " where link_categories_id = '" . (int)$link_categories_id . "'");
+
+          while ($link_ids = tep_db_fetch_array($link_ids_query)) {
+            tep_remove_link($link_ids['links_id']);
+          }
+
+          tep_remove_link_category($link_categories_id);
+        }
+
+        tep_redirect(tep_href_link(FILENAME_LINK_CATEGORIES));
+        break;
+      default:
+        $link_categories_query = tep_db_query("select lc.link_categories_id, lc.link_categories_image, lc.link_categories_status, lc.link_categories_sort_order, lc.link_categories_date_added, lc.link_categories_last_modified, lcd.link_categories_name, lcd.link_categories_description from " . TABLE_LINK_CATEGORIES . " lc left join " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd on lc.link_categories_id = lcd.link_categories_id where lcd.link_categories_id = lc.link_categories_id and lc.link_categories_id = '" . (int)$HTTP_GET_VARS['cID'] . "' and lcd.language_id = '" . (int)$languages_id . "'");
+        $link_categories = tep_db_fetch_array($link_categories_query);
+
+        $links_count_query = tep_db_query("select count(*) as link_categories_count from " . TABLE_LINKS_TO_LINK_CATEGORIES . " where link_categories_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");
+        $links_count = tep_db_fetch_array($links_count_query);
+
+        $cInfo_array = array_merge($link_categories, $links_count);
+        $cInfo = new objectInfo($cInfo_array);
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('search', FILENAME_LINK_CATEGORIES, '', 'get'); 
+            if (isset($HTTP_GET_VARS[tep_session_name()])) {
+              echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+            }
+          ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $search = '';
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+      $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
+      $search = " and lcd.link_categories_name like '%" . $keywords . "%'";
+
+      $link_categories_query_raw = "select lc.link_categories_id, lc.link_categories_image, lc.link_categories_status, lc.link_categories_sort_order, lc.link_categories_date_added, lc.link_categories_last_modified, lcd.link_categories_name, lcd.link_categories_description from " . TABLE_LINK_CATEGORIES . " lc left join " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd on lc.link_categories_id = lcd.link_categories_id where lcd.language_id = '" . (int)$languages_id . "'" . $search . " order by lc.link_categories_sort_order, lcd.link_categories_name";
+    } else {
+      $link_categories_query_raw = "select lc.link_categories_id, lc.link_categories_image, lc.link_categories_status, lc.link_categories_sort_order, lc.link_categories_date_added, lc.link_categories_last_modified, lcd.link_categories_name, lcd.link_categories_description from " . TABLE_LINK_CATEGORIES . " lc left join " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd on lc.link_categories_id = lcd.link_categories_id  where lcd.language_id = '" . (int)$languages_id . "' order by lc.link_categories_sort_order, lcd.link_categories_name";
+    }
+
+    $link_categories_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $link_categories_query_raw, $link_categories_query_numrows);
+    $link_categories_query = tep_db_query($link_categories_query_raw);
+    while ($link_categories = tep_db_fetch_array($link_categories_query)) {
+      if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $link_categories['link_categories_id']))) && !isset($cInfo)) { 
+        $links_count_query = tep_db_query("select count(*) as link_categories_count from " . TABLE_LINKS_TO_LINK_CATEGORIES . " where link_categories_id = '" . (int)$link_categories['link_categories_id'] . "'");
+        $links_count = tep_db_fetch_array($links_count_query);
+
+        $cInfo_array = array_merge($link_categories, $links_count);
+        $cInfo = new objectInfo($cInfo_array);
+      }
+
+      if (isset($cInfo) && is_object($cInfo) && ($link_categories['link_categories_id'] == $cInfo->link_categories_id)) {
+        echo '          <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_LINK_CATEGORIES, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->link_categories_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_LINK_CATEGORIES, tep_get_all_get_params(array('cID')) . 'cID=' . $link_categories['link_categories_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo $link_categories['link_categories_name']; ?></td>
+                <td  class="dataTableContent" align="right">
+<?php
+      if ($link_categories['link_categories_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_LINK_CATEGORIES, 'action=setflag&flag=0&cID=' . $link_categories['link_categories_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_LINK_CATEGORIES, 'action=setflag&flag=1&cID=' . $link_categories['link_categories_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($link_categories['link_categories_id'] == $cInfo->link_categories_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_LINK_CATEGORIES, tep_get_all_get_params(array('cID')) . 'cID=' . $link_categories['link_categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $link_categories_split->display_count($link_categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_LINK_CATEGORIES); ?></td>
+                    <td class="smallText" align="right"><?php echo $link_categories_split->display_links($link_categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
+                  </tr>
+                  <tr>
+<?php
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+?>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_LINK_CATEGORIES) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_LINK_CATEGORIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>'; ?></td>
+<?php
+    } else {
+?>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_LINK_CATEGORIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>'; ?></td>
+<?php
+    }
+?>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_LINK_CATEGORY . '</b>');
+
+      $contents = array('form' => tep_draw_form('new_link_categories', FILENAME_LINK_CATEGORIES, 'action=insert', 'post', 'enctype="multipart/form-data"'));
+      $contents[] = array('text' => TEXT_NEW_LINK_CATEGORIES_INTRO);
+
+      $link_category_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $link_category_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('link_categories_name[' . $languages[$i]['id'] . ']');
+      }
+
+      $link_category_description_inputs_string = '';
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $link_category_description_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;<br>' . tep_draw_textarea_field('link_categories_description[' . $languages[$i]['id'] . ']', 'soft', '40', '5');
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_NAME . $link_category_inputs_string);
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_DESCRIPTION . $link_category_description_inputs_string);
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('link_categories_image'));
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_SORT_ORDER . '<br>' . tep_draw_input_field('link_categories_sort_order', '', 'size="2"'));
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_STATUS . '&nbsp;&nbsp;' . tep_draw_radio_field('link_categories_status', 'on', true) . ' ' . TEXT_LINK_CATEGORIES_STATUS_ENABLE . '&nbsp;&nbsp;' . tep_draw_radio_field('link_categories_status', 'off') . ' ' . TEXT_LINK_CATEGORIES_STATUS_DISABLE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_LINK_CATEGORIES) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_LINK_CATEGORY . '</b>');
+
+      $contents = array('form' => tep_draw_form('edit_link_categories', FILENAME_LINK_CATEGORIES, 'action=update', 'post', 'enctype="multipart/form-data"') . tep_draw_hidden_field('link_categories_id', $cInfo->link_categories_id));
+      $contents[] = array('text' => TEXT_EDIT_LINK_CATEGORIES_INTRO);
+
+      $link_category_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $link_category_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('link_categories_name[' . $languages[$i]['id'] . ']', tep_get_link_category_name($cInfo->link_categories_id, $languages[$i]['id']));
+      }
+
+      $link_category_description_inputs_string = '';
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $link_category_description_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;<br>' . tep_draw_textarea_field('link_categories_description[' . $languages[$i]['id'] . ']', 'soft', '40', '5', tep_get_link_category_description($cInfo->link_categories_id, $languages[$i]['id']));
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_NAME . $link_category_inputs_string);
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_DESCRIPTION . $link_category_description_inputs_string);
+      $contents[] = array('text' => '<br>' . tep_info_image($cInfo->link_categories_image, $cInfo->link_categories_name) . '<br>' . $cInfo->link_categories_image);
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('link_categories_image'));
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_SORT_ORDER . '&nbsp;' . tep_draw_input_field('link_categories_sort_order', $cInfo->link_categories_sort_order, 'size="2"'));
+      $contents[] = array('text' => '<br>' . TEXT_LINK_CATEGORIES_STATUS . '&nbsp;&nbsp;' . tep_draw_radio_field('link_categories_status', 'on', ($cInfo->link_categories_status == '1') ? true : false) . ' ' . TEXT_LINK_CATEGORIES_STATUS_ENABLE . '&nbsp;&nbsp;' . tep_draw_radio_field('link_categories_status', 'off', ($cInfo->link_categories_status == '0') ? true : false) . ' ' . TEXT_LINK_CATEGORIES_STATUS_DISABLE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_LINK_CATEGORIES, 'cID=' . $cInfo->link_categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_LINK_CATEGORY . '</b>');
+
+      $contents = array('form' => tep_draw_form('delete_link_categories', FILENAME_LINK_CATEGORIES, 'action=delete_confirm') . tep_draw_hidden_field('link_categories_id', $cInfo->link_categories_id));
+      $contents[] = array('text' => TEXT_DELETE_LINK_CATEGORIES_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->link_categories_name . '</b>');
+      if ($cInfo->link_categories_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_LINKS, $cInfo->link_categories_count));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_LINK_CATEGORIES, 'cID=' . $cInfo->link_categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->link_categories_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_LINK_CATEGORIES, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->link_categories_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_LINK_CATEGORIES, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->link_categories_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+
+        $contents[] = array('text' => '<br>' . tep_info_image($cInfo->link_categories_image, $cInfo->link_categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->link_categories_image);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LINK_CATEGORY_DESCRIPTION . ' ' . $cInfo->link_categories_description);
+        $contents[] = array('text' => '<br>' . TEXT_DATE_LINK_CATEGORY_CREATED . ' ' . tep_date_short($cInfo->link_categories_date_added));
+        if (tep_not_null($cInfo->link_categories_last_modified)) {
+          $contents[] = array('text' => '<br>' . TEXT_DATE_LINK_CATEGORY_LAST_MODIFIED . ' ' . tep_date_short($cInfo->link_categories_last_modified));
+        }
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LINK_CATEGORY_COUNT . ' '  . $cInfo->link_categories_count);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LINK_CATEGORY_SORT_ORDER . ' '  . $cInfo->link_categories_sort_order);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/links.php
===================================================================
--- trunk/direct.openmoko.com/admin/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,815 @@
+<?php
+/*
+  $Id: links.php,v 1.07 2005/5/28 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.comRrating
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+define('MAX_LINKS_DISPLAY','40');
+
+// define our link functions
+  require(DIR_WS_FUNCTIONS . 'links.php');
+ 
+  $showLinkStatus = 'All';
+  $links_statuses = array();
+  $linkShow = array();
+  $links_status_array = array();
+  $links_status_query = tep_db_query("select links_status_id, links_status_name from " . TABLE_LINKS_STATUS . " where language_id = '" . (int)$languages_id . "'");
+  $linkShow[] = array('id' => 'All', 'text' => 'All');
+  while ($links_status = tep_db_fetch_array($links_status_query)) {
+    $linkShow[] = $links_statuses[] = array('id' => $links_status['links_status_id'],
+                               'text' => $links_status['links_status_name']);
+    $links_status_array[$links_status['links_status_id']] = $links_status['links_status_name'];
+  }
+ 
+   
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+  $action_checkAllLinks = $_POST['num_links_to_check'];
+
+  if (isset($_GET['links_status_list'])) 
+    $showLinkStatus = $_GET['links_status_list'];
+  
+  $error = false;
+  $processed = false;
+  $LINKS_WAITING = 4;
+
+  if (tep_not_null($action)) {  
+    switch ($action) {
+      case 'insert':
+      case 'update':
+        $links_id = tep_db_prepare_input($HTTP_GET_VARS['lID']);
+        $links_title = tep_db_prepare_input($HTTP_POST_VARS['links_title']);
+        $links_url = tep_db_prepare_input($HTTP_POST_VARS['links_url']);
+        $links_category = tep_db_prepare_input($HTTP_POST_VARS['links_category']);
+        $links_description = tep_db_prepare_input($HTTP_POST_VARS['links_description']);
+        $links_image_url = tep_db_prepare_input($HTTP_POST_VARS['links_image_url']);
+        $links_contact_name = tep_db_prepare_input($HTTP_POST_VARS['links_contact_name']);
+        $links_contact_email = tep_db_prepare_input($HTTP_POST_VARS['links_contact_email']);
+        $links_reciprocal_url = tep_db_prepare_input($HTTP_POST_VARS['links_reciprocal_url']);
+        $links_status = tep_db_prepare_input($HTTP_POST_VARS['links_status']);
+        $links_rating = tep_db_prepare_input($HTTP_POST_VARS['links_rating']);
+
+        if (strlen($links_title) < ENTRY_LINKS_TITLE_MIN_LENGTH) {
+          $error = true;
+          $entry_links_title_error = true;
+        } else {
+          $entry_links_title_error = false;
+        }
+
+        if (strlen($links_url) < ENTRY_LINKS_URL_MIN_LENGTH) {
+          $error = true;
+          $entry_links_url_error = true;
+        } else {
+          $entry_links_url_error = false;
+        }
+
+        if (strlen($links_description) < ENTRY_LINKS_DESCRIPTION_MIN_LENGTH) {
+          $error = true;
+          $entry_links_description_error = true;
+        } else {
+          $entry_links_description_error = false;
+        }
+
+        if (strlen($links_contact_name) < ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH) {
+          $error = true;
+          $entry_links_contact_name_error = true;
+        } else {
+          $entry_links_contact_name_error = false;
+        }
+
+        if (strlen($links_contact_email) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
+          $error = true;
+          $entry_links_contact_email_error = true;
+        } else {
+          $entry_links_contact_email_error = false;
+        }
+
+        if (!tep_validate_email($links_contact_email)) {
+          $error = true;
+          $entry_links_contact_email_check_error = true;
+        } else {
+          $entry_links_contact_email_check_error = false;
+        }
+
+        if (strlen($links_reciprocal_url) < ENTRY_LINKS_URL_MIN_LENGTH && $links_status != $LINKS_WAITING) {
+          $error = true;
+          $entry_links_reciprocal_url_error = true;
+        } else {
+          $entry_links_reciprocal_url_error = false;
+        }
+
+        if ($error == false) {
+          if (!tep_not_null($links_image_url) || ($links_image_url == 'http://')) {
+            $links_image_url = '';
+          }
+
+          $sql_data_array = array('links_url' => $links_url,
+                                  'links_image_url' => $links_image_url,
+                                  'links_contact_name' => $links_contact_name,
+                                  'links_contact_email' => $links_contact_email,
+                                  'links_reciprocal_url' => $links_reciprocal_url, 
+                                  'links_status' => $links_status, 
+                                  'links_rating' => $links_rating);
+
+          if ($action == 'update') {
+            $sql_data_array['links_last_modified'] = 'now()';
+          } else if($action == 'insert') {
+            $sql_data_array['links_date_added'] = 'now()';
+          }
+
+          if ($action == 'update') {
+            tep_db_perform(TABLE_LINKS, $sql_data_array, 'update', "links_id = '" . (int)$links_id . "'");
+          } else if($action == 'insert') {
+            tep_db_perform(TABLE_LINKS, $sql_data_array);
+
+            $links_id = tep_db_insert_id();
+          }
+
+          $categories_query = tep_db_query("select link_categories_id from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_name = '" . $links_category . "' and language_id = '" . (int)$languages_id . "'");
+
+          $categories = tep_db_fetch_array($categories_query);
+          $link_categories_id = $categories['link_categories_id'];
+
+          if ($action == 'update') {
+            tep_db_query("update " . TABLE_LINKS_TO_LINK_CATEGORIES . " set link_categories_id = '" . (int)$link_categories_id . "' where links_id = '" . (int)$links_id . "'");
+          } else if($action == 'insert') {
+            tep_db_query("insert into " . TABLE_LINKS_TO_LINK_CATEGORIES . " ( links_id, link_categories_id) values ('" . (int)$links_id . "', '" . (int)$link_categories_id . "')");
+          }
+
+          $sql_data_array = array('links_title' => $links_title,
+                                  'links_description' => $links_description);
+
+          if ($action == 'update') {
+            tep_db_perform(TABLE_LINKS_DESCRIPTION, $sql_data_array, 'update', "links_id = '" . (int)$links_id . "' and language_id = '" . (int)$languages_id . "'");
+          } else if($action == 'insert') {
+            $insert_sql_data = array('links_id' => $links_id,
+                                     'language_id' => $languages_id);
+
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+            tep_db_perform(TABLE_LINKS_DESCRIPTION, $sql_data_array);
+          }
+
+          if (isset($HTTP_POST_VARS['links_notify']) && ($HTTP_POST_VARS['links_notify'] == 'on')) {
+            $email = sprintf(EMAIL_TEXT_STATUS_UPDATE, $links_contact_name, $links_status_array[$links_status]) . "\n\n" . STORE_OWNER . "\n" . STORE_NAME;
+
+            tep_mail($links_contact_name, $links_contact_email, EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+          }
+
+          tep_redirect(tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID', 'action')) . 'lID=' . $links_id));
+        } else if ($error == true) {
+          $lInfo = new objectInfo($HTTP_POST_VARS);
+          $processed = true;
+        }
+
+        break;
+      case 'deleteconfirm':
+        $links_id = tep_db_prepare_input($HTTP_GET_VARS['lID']);
+
+        tep_remove_link($links_id);
+
+        tep_redirect(tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID', 'action'))));
+        break;
+      default:
+        $links_query = tep_db_query("select l.links_id, ld.links_title, l.links_url, ld.links_description, l.links_contact_email, l.links_status, l.links_image_url, l.links_contact_name, l.links_reciprocal_url, l.links_status, l.links_rating from " . TABLE_LINKS . " l left join " . TABLE_LINKS_DESCRIPTION . " ld on ld.links_id = l.links_id where ld.links_id = l.links_id and l.links_id = '" . (int)$HTTP_GET_VARS['lID'] . "' and ld.language_id = '" . (int)$languages_id . "'");
+        $links = tep_db_fetch_array($links_query);
+
+        $categories_query = tep_db_query("select lcd.link_categories_name as links_category from " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2lc left join " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd on lcd.link_categories_id = l2lc.link_categories_id where l2lc.links_id = '" . (int)$HTTP_GET_VARS['lID'] . "' and lcd.language_id = '" . (int)$languages_id . "'");
+        $category = tep_db_fetch_array($categories_query);
+
+        $lInfo_array = array_merge($links, $category);
+        $lInfo = new objectInfo($lInfo_array);
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+<?php
+  if ($action == 'edit' || $action == 'update' || $action == 'new' || $action == 'insert') {
+?>
+<script language="javascript"><!--
+
+function check_form() {
+  var error = 0;
+  var error_message = "<?php echo JS_ERROR; ?>";
+
+  var links_title = document.links.links_title.value;
+  var links_url = document.links.links_url.value;
+  var links_category = document.links.links_category.value;
+  var links_description = document.links.links_description.value;
+  var links_image_url = document.links.links_image_url.value;
+  var links_contact_name = document.links.links_contact_name.value;
+  var links_contact_email = document.links.links_contact_email.value;
+  var links_reciprocal_url = document.links.links_reciprocal_url.value;
+  var links_rating = document.links.links_rating.value;
+  
+  if (links_title == "" || links_title.length < <?php echo ENTRY_LINKS_TITLE_MIN_LENGTH; ?>) {
+    error_message = error_message + "* " + "<?php echo ENTRY_LINKS_TITLE_ERROR; ?>" + "\n";
+    error = 1;
+  }
+
+  if (links_url == "" || links_url.length < <?php echo ENTRY_LINKS_URL_MIN_LENGTH; ?>) {
+    error_message = error_message + "* " + "<?php echo ENTRY_LINKS_URL_ERROR; ?>" + "\n";
+    error = 1;
+  }
+
+  if (links_description == "" || links_description.length < <?php echo ENTRY_LINKS_DESCRIPTION_MIN_LENGTH; ?>) {
+    error_message = error_message + "* " + "<?php echo ENTRY_LINKS_DESCRIPTION_ERROR; ?>" + "\n";
+    error = 1;
+  }
+
+  if (links_contact_name == "" || links_contact_name.length < <?php echo ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH; ?>) {
+    error_message = error_message + "* " + "<?php echo ENTRY_LINKS_CONTACT_NAME_ERROR; ?>" + "\n";
+    error = 1;
+  }
+
+  if (links_contact_email == "" || links_contact_email.length < <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_EMAIL_ADDRESS; ?>";
+    error = 1;
+  }
+ 
+  if (links_reciprocal_url == "" || links_reciprocal_url.length < <?php echo ENTRY_LINKS_URL_MIN_LENGTH; ?>) {
+    error_message = error_message + "* " + "<?php echo ENTRY_LINKS_RECIPROCAL_URL_ERROR; ?>" + "\n";
+    error = 1;
+  }
+
+  if (links_rating == "") {
+    error_message = error_message + "* " + "<?php echo ENTRY_LINKS_RATING_ERROR; ?>" + "\n";
+    error = 1;
+  }
+
+  if (error == 1) {
+    alert(error_message);
+    return false;
+  } else {
+    return true;
+  }
+}
+//--></script>
+<?php
+  }
+?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ($action == 'edit' || $action == 'update' || $action == 'new' || $action == 'insert') {
+    if ($action == 'edit' || $action == 'update') {
+      $form_action = 'update';
+      $contact_name_default = '';
+      $contact_email_default = '';
+    } else {
+      $form_action = 'insert';
+      $contact_name_default = STORE_OWNER;
+      $contact_email_default = STORE_OWNER_EMAIL_ADDRESS;
+    }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right">k<?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('links', FILENAME_LINKS, tep_get_all_get_params(array('action')) . 'action=' . $form_action, 'post', 'onSubmit="return check_form();"'); ?>
+        <td class="formAreaTitle"><?php echo CATEGORY_WEBSITE; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_LINKS_TITLE; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_links_title_error == true) {
+      echo tep_draw_input_field('links_title', $lInfo->links_title, 'maxlength="64"') . '&nbsp;' . ENTRY_LINKS_TITLE_ERROR;
+    } else {
+      echo $lInfo->links_title . tep_draw_hidden_field('links_title');
+    }
+  } else {
+    echo tep_draw_input_field('links_title', $lInfo->links_title, 'size = "64" maxlength="64"', true);
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_LINKS_URL; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_links_url_error == true) {
+      echo tep_draw_input_field('links_url', $lInfo->links_url, 'maxlength="255"') . '&nbsp;' . ENTRY_LINKS_URL_ERROR;
+    } else {
+      echo $lInfo->links_url . tep_draw_hidden_field('links_url');
+    }
+  } else {
+    echo tep_draw_input_field('links_url', tep_not_null($lInfo->links_url) ? $lInfo->links_url : 'http://', 'size = "64" maxlength="255"', true);
+  }
+?></td>
+          </tr>
+<?php
+    $categories_array = array();
+    $categories_query = tep_db_query("select lcd.link_categories_id, lcd.link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");
+    while ($categories_values = tep_db_fetch_array($categories_query)) {
+      $categories_array[] = array('id' => $categories_values['link_categories_name'], 'text' => $categories_values['link_categories_name']);
+    }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_LINKS_CATEGORY; ?></td>
+            <td class="main">
+
+<?php
+  if ($error == true) {
+    echo $lInfo->links_category . tep_draw_hidden_field('links_category');
+  } else {
+    echo tep_draw_pull_down_menu('links_category', $categories_array, $lInfo->links_category, '', true);
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_LINKS_DESCRIPTION; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_links_description_error == true) {
+      echo tep_draw_textarea_field('links_description', 'hard', 40, 5, $lInfo->links_description) . '&nbsp;' . ENTRY_LINKS_DESCRIPTION_ERROR;
+    } else {
+      echo $lInfo->links_description . tep_draw_hidden_field('links_description');
+    }
+  } else {
+    echo tep_draw_textarea_field('links_description', 'hard', 40, 5, $lInfo->links_description) . TEXT_FIELD_REQUIRED;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_LINKS_IMAGE; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    echo $lInfo->links_image_url . tep_draw_hidden_field('links_image_url');
+  } else {
+    echo tep_draw_input_field('links_image_url', tep_not_null($lInfo->links_image_url) ? $lInfo->links_image_url : 'http://', 'size = "70" maxlength="255"');
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_CONTACT; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_LINKS_CONTACT_NAME; ?></td>
+            <td class="main">
+<?php
+    if ($error == true) {
+      if ($entry_links_contact_name_error == true) {
+        echo tep_draw_input_field('links_contact_name', $lInfo->links_contact_name, 'maxlength="64"', true) . '&nbsp;' . ENTRY_LINKS_CONTACT_NAME_ERROR;
+      } else {
+        echo $lInfo->links_contact_name . tep_draw_hidden_field('links_contact_name');
+      }
+    } else {
+      echo tep_draw_input_field('links_contact_name', tep_not_null($lInfo->links_contact_name) ? $lInfo->links_contact_name : $contact_name_default, 'size = "64" maxlength="64"', true);
+    }
+?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_links_contact_email_error == true) {
+      echo tep_draw_input_field('links_contact_email', $lInfo->links_contact_email, 'size = "40" maxlength="96"') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR;
+    } elseif ($entry_links_contact_email_check_error == true) {
+      echo tep_draw_input_field('links_contact_email', $lInfo->links_contact_email, 'size = "40" maxlength="96"') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
+    } else {
+      echo $lInfo->links_contact_email . tep_draw_hidden_field('links_contact_email');
+    }
+  } else {
+    echo tep_draw_input_field('links_contact_email', tep_not_null($lInfo->links_contact_email) ? $lInfo->links_contact_email : $contact_email_default, 'size = "40" maxlength="96"', true);
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_RECIPROCAL; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_LINKS_RECIPROCAL_URL; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_links_reciprocal_url_error == true) {
+      echo tep_draw_input_field('links_reciprocal_url', $lInfo->links_reciprocal_url, 'size = "70" maxlength="255"') . '&nbsp;' . ENTRY_LINKS_RECIPROCAL_URL_ERROR;
+    } else {
+      echo $lInfo->links_reciprocal_url . tep_draw_hidden_field('links_reciprocal_url');
+    }
+  } else {
+    echo tep_draw_input_field('links_reciprocal_url', tep_not_null($lInfo->links_reciprocal_url) ? $lInfo->links_reciprocal_url : 'http://', 'maxlength="255"', true);
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="formAreaTitle"><?php echo CATEGORY_OPTIONS; ?></td>
+      </tr>
+      <tr>
+        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_LINKS_STATUS; ?></td>
+            <td class="main">
+<?php 
+  $link_statuses = array();
+  $links_status_array = array();
+  $links_status_query = tep_db_query("select links_status_id, links_status_name from " . TABLE_LINKS_STATUS . " where language_id = '" . (int)$languages_id . "'");
+  while ($links_status = tep_db_fetch_array($links_status_query)) {
+    $link_statuses[] = array('id' => $links_status['links_status_id'],
+                               'text' => $links_status['links_status_name']);
+    $links_status_array[$links_status['links_status_id']] = $links_status['links_status_name'];
+  }
+
+  echo tep_draw_pull_down_menu('links_status', $link_statuses, $lInfo->links_status); 
+
+  if ($action == 'edit' || $action == 'update') {
+    echo '&nbsp;&nbsp;' . ENTRY_LINKS_NOTIFY_CONTACT;
+    echo tep_draw_checkbox_field('links_notify');
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_LINKS_RATING; ?></td>
+            <td class="main">
+<?php
+  if ($error == true) {
+    if ($entry_links_rating_error == true) {
+      echo tep_draw_input_field('links_rating', $lInfo->links_rating, 'size ="2" maxlength="2"') . '&nbsp;' . ENTRY_LINKS_RATING_ERROR;
+    } else {
+      echo $lInfo->links_rating . tep_draw_hidden_field('links_rating');
+    }
+  } else {
+    echo tep_draw_input_field('links_rating', tep_not_null($lInfo->links_rating) ? $lInfo->links_rating : '0', 'size ="2" maxlength="2"', true);
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><?php echo (($action == 'edit') ? tep_image_submit('button_update.gif', IMAGE_UPDATE) : tep_image_submit('button_insert.gif', IMAGE_INSERT)) . ' <a href="' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('action'))) .'">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </tr></form>
+<?php
+  } else if (tep_not_null($action_checkAllLinks)) {
+    set_time_limit(360);
+?>
+    <tr>
+     <td class="pageHeading"><!-- Links Manager - Checked Links --><?php echo LINKS_MANAGER_CHECKED_LINKS?></td>
+    </tr>
+    <tr><td><table border="0" width="60%"><?php
+    $links_query = tep_db_query("select l.links_id, ld.links_title, l.links_reciprocal_url from " . TABLE_LINKS . " l, " . TABLE_LINKS_DESCRIPTION . " ld where ld.links_id = l.links_id and ld.language_id = '" . (int)$languages_id . "'");
+ 
+    $ctr = 1; 
+    $from = $_POST['links_start'];   
+    $max = (int)$_POST['num_links_to_check'] + $from;
+    if ($max > tep_db_num_rows($links_query))
+     $max =    tep_db_num_rows($links_query);
+      
+    while ($links = tep_db_fetch_array($links_query)) {  
+      if ($ctr < $from)
+      {
+        $ctr++;
+        continue;
+      }
+      $url = $links['links_reciprocal_url'];;
+
+      if (@file($url)) {
+        $file = fopen($url,'r');
+
+        $link_check_status = false;
+
+        while (!feof($file)) {
+          $page_line = trim(fgets($file, 4096));
+
+          if (eregi(LINKS_CHECK_PHRASE, $page_line)) {
+            $link_check_status = true;
+            break;
+          }
+        }
+
+        fclose($file);
+
+        if ($link_check_status == true) {
+          $link_check_status_text = TEXT_INFO_LINK_CHECK_FOUND;
+           $img = 'images/mark_check.jpg';
+        } else {
+          $link_check_status_text = TEXT_INFO_LINK_CHECK_NOT_FOUND;
+           $img = 'images/mark_x.jpg';
+        }
+      } else {
+        $link_check_status_text = TEXT_INFO_LINK_CHECK_ERROR;
+        $img = 'images/mark_x.jpg';
+      }
+    
+      echo '<tr><td class="main" width="5%"><img src="'.$img.'" alt="'.$link_check_status_text.'"></td><td>  ' .$links['links_title'] . '</td></tr>';
+      
+      $ctr++;
+      if ($ctr == $max)
+       break;  
+    }
+    ?>
+    <tr>
+     <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+    </tr>
+    <tr>
+     <td colspan="2" align="center" class="main"><?php echo ' <a href="' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('action'))) .'">' . tep_image_button('button_continue.gif', 'Continue') . '</a>'; ?></td>
+    </tr>        
+   </table></td></tr>   
+   <?php   
+ } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('search', FILENAME_LINKS, '', 'get'); 
+            if (isset($HTTP_GET_VARS[tep_session_name()])) {
+              echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+            }
+          ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_pull_down_menu('links_status_list', $linkShow, '',  'onChange="this.form.submit();"');?></td>
+            <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+          <?php
+// BOC Sort Listing
+          if (! tep_not_null($listing))
+            $listing = 'title';
+          switch ($listing) {              
+              case "title":
+              $order = "ld.links_title";
+              break;
+              case "title-desc":
+              $order = "ld.links_title DESC";
+              break;
+              case "url":
+              $order = "l.links_url";
+              break;
+              case "url-desc":
+              $order = "l.links_url DESC";
+              break;
+              case "clciked":
+              $order = "l.links_clicked";
+              break;
+              case "clicked-desc":
+              $order = "l.links_clicked DESC";
+              break;
+              case "status":
+              $order = "l.links_status";
+              break;
+              case "status-desc":
+              $order = "l.links_status DESC";
+              break;               
+              default:
+              $order = "l.links_id DESC";
+          }
+?>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent" align="center">
+                  <?php echo (($listing=='title' or $listing=='title-desc') ? '<font color="FF0000"><b>' . TABLE_HEADING_TITLE . '</b></font>' : '<b>'. TABLE_HEADING_TITLE . '</b>'); ?><br>
+                  <a href="<?php echo "$PHP_SELF?listing=title"; ?>"><?php echo ($listing=='title' ? '<font color="FF0000"><b>'.ASC.'</b></font>' : '<b>'.ASC.'</b>'); ?></a>&nbsp;
+                  <a href="<?php echo "$PHP_SELF?listing=title-desc"; ?>"><?php echo ($listing=='title-desc' ? '<font color="FF0000"><b>'.DESC.'</b></font>' : '<b>'.DESC.'</b>'); ?></a>
+                </td>
+                <td class="dataTableHeadingContent" align="center">
+                  <?php echo (($listing=='url' or $listing=='url-desc') ? '<font color="FF0000"><b>' . TABLE_HEADING_URL . '</b></font>' : '<b>'. TABLE_HEADING_URL . '</b>'); ?><br>
+                  <a href="<?php echo "$PHP_SELF?listing=url"; ?>"><?php echo ($listing=='url' ? '<font color="FF0000"><b>'.ASC.'</b></font>' : '<b>'.ASC.'</b>'); ?></a>&nbsp;
+                  <a href="<?php echo "$PHP_SELF?listing=url-desc"; ?>"><?php echo ($listing=='url-desc' ? '<font color="FF0000"><b>'.DESC.'</b></font>' : '<b>'.DESC.'</b>'); ?></a>
+                </td> 
+                <td class="dataTableHeadingContent" align="center">
+                  <?php echo (($listing=='clicks' or $listing=='clicks-desc') ? '<font color="FF0000"><b>' . TABLE_HEADING_CLICKS . '</b></font>' : '<b>'. TABLE_HEADING_CLICKS . '</b>'); ?><br>
+                  <a href="<?php echo "$PHP_SELF?listing=clicks"; ?>"><?php echo ($listing=='clicks' ? '<font color="FF0000"><b>'.ASC.'</b></font>' : '<b>'.ASC.'</b>'); ?></a>&nbsp;
+                  <a href="<?php echo "$PHP_SELF?listing=clicks-desc"; ?>"><?php echo ($listing=='clicks-desc' ? '<font color="FF0000"><b>'.DESC.'</b></font>' : '<b>'.DESC.'</b>'); ?></a>
+                </td>
+                <td class="dataTableHeadingContent" align="center">
+                  <?php echo (($listing=='status' or $listing=='status-desc') ? '<font color="FF0000"><b>' . TABLE_HEADING_STATUS . '</b></font>' : '<b>'. TABLE_HEADING_STATUS . '</b>'); ?><br>
+                  <a href="<?php echo "$PHP_SELF?listing=status"; ?>"><?php echo ($listing=='status' ? '<font color="FF0000"><b>'.ASC.'</b></font>' : '<b>'.ASC.'</b>'); ?></a>&nbsp;
+                  <a href="<?php echo "$PHP_SELF?listing=status-desc"; ?>"><?php echo ($listing=='status-desc' ? '<font color="FF0000"><b>'.DESC.'</b></font>' : '<b>'.DESC.'</b>'); ?></a>
+                </td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>              
+<?php
+   //EOC: Sort Listing 
+    $search = '';
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+      $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
+      $search = " and ld.links_title like '%" . $keywords . "%'";
+    }
+    if ($showLinkStatus == 'All')
+      $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_status from " . TABLE_LINKS . " l left join " . TABLE_LINKS_DESCRIPTION . " ld on l.links_id = ld.links_id where ld.language_id = '" . (int)$languages_id . "'" . $search . " order by " . $order;
+    else
+      $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_status from " . TABLE_LINKS . " l left join " . TABLE_LINKS_DESCRIPTION . " ld on l.links_id = ld.links_id where l.links_status = '" . $showLinkStatus . "' and ld.language_id = '" . (int)$languages_id . "'" . $search . " order by " . $order;
+
+    $links_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_LINKS_DISPLAY, $links_query_raw, $links_query_numrows);
+    $links_query = tep_db_query($links_query_raw);
+    while ($links = tep_db_fetch_array($links_query)) {
+      if ((!isset($HTTP_GET_VARS['lID']) || (isset($HTTP_GET_VARS['lID']) && ($HTTP_GET_VARS['lID'] == $links['links_id']))) && !isset($lInfo)) { 
+        $categories_query = tep_db_query("select lcd.link_categories_name as links_category from " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2lc left join " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd on lcd.link_categories_id = l2lc.link_categories_id where l2lc.links_id = '" . (int)$links['links_id'] . "' and lcd.language_id = '" . (int)$languages_id . "'");
+        $category = tep_db_fetch_array($categories_query);
+
+        $lInfo_array = array_merge($links, $category);
+        $lInfo = new objectInfo($lInfo_array);
+      }
+
+      if (isset($lInfo) && is_object($lInfo) && ($links['links_id'] == $lInfo->links_id)) {
+        echo '          <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID', 'action')) . 'lID=' . $lInfo->links_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID')) . 'lID=' . $links['links_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo $links['links_title']; ?></td>
+                <td class="dataTableContent"><?php echo $links['links_url']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $links['links_clicked']; ?></td>
+                <td class="dataTableContent"><?php echo $links_status_array[$links['links_status']]; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($lInfo) && is_object($lInfo) && ($links['links_id'] == $lInfo->links_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID')) . 'lID=' . $links['links_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $links_split->display_count($links_query_numrows, MAX_LINKS_DISPLAY, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_LINKS); ?></td>
+                    <td class="smallText" align="right"><?php echo $links_split->display_links($links_query_numrows, MAX_LINKS_DISPLAY, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'lID'))); ?></td>
+                  </tr>
+                  <tr>
+<?php
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+?>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_LINKS) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_LINKS, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_link.gif', IMAGE_NEW_LINK) . '</a>'; ?></td>
+                  </tr>  
+<?php
+    } else {
+?>
+                   <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                  <tr>
+                   <?php echo tep_draw_form('check_all', FILENAME_LINKS, 'post'); ?>
+                   <td align="right"><?php echo (tep_image_submit('button_check_links.gif', 'Check Links') ) . ' <a href="' . tep_href_link(FILENAME_LINKS ) .'">' . '</a>'; ?></td>
+                   <td class="main" align="center"><?php echo START_AT?>&nbsp;<?php echo tep_draw_input_field('links_start', '1', 'maxlength="255", size="4"',   false); ?> </td>
+                   <td class="main" align="center"><?php echo HOW_MANY?>&nbsp;<?php echo tep_draw_input_field('num_links_to_check', '10', 'maxlength="255", size="4"',   false); ?> </td>
+                   </form>  
+                  </tr>
+                  <tr>
+                   <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                  <tr>        
+                   <td align="right" colspan="4"><?php echo '<a href="' . tep_href_link(FILENAME_LINKS, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_link.gif', IMAGE_NEW_LINK) . '</a>'; ?></td>
+<?php
+    }
+?>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+   switch ($action) {
+    case 'confirm':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_LINK . '</b>');
+
+      $contents = array('form' => tep_draw_form('links', FILENAME_LINKS, tep_get_all_get_params(array('lID', 'action')) . 'lID=' . $lInfo->links_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO . '<br><br><b>' . $lInfo->links_url . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID', 'action')) . 'lID=' . $lInfo->links_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'check':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_CHECK_LINK . '</b>');
+
+      $url = $lInfo->links_reciprocal_url;
+
+      if (@file($url)) {
+        $file = fopen($url,'r');
+
+        $link_check_status = false;
+
+        while (!feof($file)) {
+          $page_line = trim(fgets($file, 4096));
+
+          if (eregi(LINKS_CHECK_PHRASE, $page_line)) {
+            $link_check_status = true;
+            break;
+          }
+        }
+
+        fclose($file);
+
+        if ($link_check_status == true) {
+          $link_check_status_text = TEXT_INFO_LINK_CHECK_FOUND;
+        } else {
+          $link_check_status_text = TEXT_INFO_LINK_CHECK_NOT_FOUND;
+        }
+      } else {
+        $link_check_status_text = TEXT_INFO_LINK_CHECK_ERROR;
+      }
+
+      $contents[] = array('text' => TEXT_INFO_LINK_CHECK_RESULT . ' ' . $link_check_status_text);
+      $contents[] = array('text' => '<br><b>' . $lInfo->links_reciprocal_url . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID', 'action')) . 'lID=' . $lInfo->links_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;    
+    default:
+      if (isset($lInfo) && is_object($lInfo)) {
+        $heading[] = array('text' => '<b>' . $lInfo->links_title . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID', 'action')) . 'lID=' . $lInfo->links_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID', 'action')) . 'lID=' . $lInfo->links_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_LINKS, tep_get_all_get_params(array('lID', 'action')) . 'lID=' . $lInfo->links_id . '&action=check') . '">' . tep_image_button('button_check_link.gif', IMAGE_CHECK_LINK) . '</a> <a href="' . tep_href_link(FILENAME_LINKS_CONTACT, 'link_partner=' . $lInfo->links_contact_email) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
+
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LINK_STATUS . ' '  . $links_status_array[$lInfo->links_status]);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LINK_CATEGORY . ' '  . $lInfo->links_category);
+        $contents[] = array('text' => '<br>' . tep_link_info_image($lInfo->links_image_url, $lInfo->links_title, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $lInfo->links_title);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LINK_CONTACT_NAME . ' '  . $lInfo->links_contact_name);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LINK_CONTACT_EMAIL . ' ' . $lInfo->links_contact_email);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LINK_CLICK_COUNT . ' ' . $lInfo->links_clicked);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_LINK_DESCRIPTION . ' ' . $lInfo->links_description);
+        $contents[] = array('text' => '<br>' . TEXT_DATE_LINK_CREATED . ' ' . tep_date_short($lInfo->links_date_added));
+
+        if (tep_not_null($lInfo->links_last_modified)) {
+          $contents[] = array('text' => '<br>' . TEXT_DATE_LINK_LAST_MODIFIED . ' ' . tep_date_short($lInfo->links_last_modified));
+        }
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/links_contact.php
===================================================================
--- trunk/direct.openmoko.com/admin/links_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/links_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,216 @@
+<?php
+/*
+  $Id: links_contact.php,v 1.00 2003/10/03 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if ( ($action == 'send_email_to_user') && isset($HTTP_POST_VARS['link_partners_email_address']) && !isset($HTTP_POST_VARS['back_x']) ) {
+    switch ($HTTP_POST_VARS['link_partners_email_address']) {
+      case '***':
+        $mail_query = tep_db_query("select distinct links_contact_name, links_contact_email from " . TABLE_LINKS);
+        $mail_sent_to = TEXT_ALL_LINK_PARTNERS;
+        break;
+      default:
+        $link_partners_email_address = tep_db_prepare_input($HTTP_POST_VARS['link_partners_email_address']);
+
+        $mail_query = tep_db_query("select links_contact_email, links_contact_name from " . TABLE_LINKS . " where links_contact_email = '" . tep_db_input($link_partners_email_address) . "'");
+        $mail_sent_to = $HTTP_POST_VARS['link_partners_email_address'];
+        break;
+    }
+
+    $from = tep_db_prepare_input($HTTP_POST_VARS['from']);
+    $subject = tep_db_prepare_input($HTTP_POST_VARS['subject']);
+    $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
+
+    //Let's build a message object using the email class
+    $mimemessage = new email(array('X-Mailer: osCommerce'));
+    // add the message to the object
+    $mimemessage->add_text($message);
+    $mimemessage->build_message();
+    while ($mail = tep_db_fetch_array($mail_query)) {
+      $mimemessage->send($mail['links_contact_name'], $mail['links_contact_email'], '', $from, $subject);
+    }
+
+    tep_redirect(tep_href_link(FILENAME_LINKS_CONTACT, 'mail_sent_to=' . urlencode($mail_sent_to)));
+  }
+
+  if ( ($action == 'preview') && !isset($HTTP_POST_VARS['link_partners_email_address']) ) {
+    $messageStack->add('search', ERROR_NO_LINK_PARTNER_SELECTED, 'error');
+  }
+
+  if (isset($HTTP_GET_VARS['mail_sent_to'])) {
+    $messageStack->add('search', sprintf(NOTICE_EMAIL_SENT_TO, $HTTP_GET_VARS['mail_sent_to']), 'success');
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ( ($action == 'preview') && isset($HTTP_POST_VARS['link_partners_email_address']) ) {
+    switch ($HTTP_POST_VARS['link_partners_email_address']) {
+      case '***':
+        $mail_sent_to = TEXT_ALL_LINK_PARTNERS;
+        break;
+      default:
+        $mail_sent_to = $HTTP_POST_VARS['link_partners_email_address'];
+        break;
+    }
+?>
+          <tr><?php echo tep_draw_form('mail', FILENAME_LINKS_CONTACT, 'action=send_email_to_user'); ?>
+            <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_LINK_PARTNER; ?></b><br><?php echo $mail_sent_to; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_FROM; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['from'])); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_SUBJECT; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['subject'])); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_MESSAGE; ?></b><br><?php echo nl2br(htmlspecialchars(stripslashes($HTTP_POST_VARS['message']))); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td>
+<?php
+/* Re-Post all POST'ed variables */
+    reset($HTTP_POST_VARS);
+    while (list($key, $value) = each($HTTP_POST_VARS)) {
+      if (!is_array($HTTP_POST_VARS[$key])) {
+        echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+      }
+    }
+?>
+                <table border="0" width="100%" cellpadding="0" cellspacing="2">
+                  <tr>
+                    <td><?php echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="back"'); ?></td>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_LINKS_CONTACT) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </form></tr>
+<?php
+  } else {
+?>
+          <tr><?php echo tep_draw_form('mail', FILENAME_LINKS_CONTACT, 'action=preview'); ?>
+            <td><table border="0" cellpadding="0" cellspacing="2">
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+<?php
+    $link_partners = array();
+    $link_partners[] = array('id' => '', 'text' => TEXT_SELECT_LINK_PARTNER);
+    $link_partners[] = array('id' => '***', 'text' => TEXT_ALL_LINK_PARTNERS);
+
+    $mail_query = tep_db_query("select distinct links_contact_email, links_contact_name from " . TABLE_LINKS . " order by links_contact_name");
+    while($link_partners_values = tep_db_fetch_array($mail_query)) {
+      $link_partners[] = array('id' => $link_partners_values['links_contact_email'],
+                           'text' => $link_partners_values['links_contact_name'] . ' (' . $link_partners_values['links_contact_email'] . ')');
+    }
+?>
+              <tr>
+                <td class="main"><?php echo TEXT_LINK_PARTNER; ?></td>
+                <td><?php echo tep_draw_pull_down_menu('link_partners_email_address', $link_partners, (isset($HTTP_GET_VARS['link_partner']) ? $HTTP_GET_VARS['link_partner'] : ''));?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_FROM; ?></td>
+                <td><?php echo tep_draw_input_field('from', EMAIL_FROM); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_SUBJECT; ?></td>
+                <td><?php echo tep_draw_input_field('subject'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td valign="top" class="main"><?php echo TEXT_MESSAGE; ?></td>
+                <td><?php echo tep_draw_textarea_field('message', 'soft', '60', '15'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2" align="right"><?php echo tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
+              </tr>
+            </table></td>
+          </form></tr>
+<?php
+  }
+?>
+<!-- body_text_eof //-->
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/listcategories.php
===================================================================
--- trunk/direct.openmoko.com/admin/listcategories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/listcategories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: validcategories.php,v 0.01 2002/08/17 15:38:34 Richard Fielder
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+
+
+  Copyright (c) 2002 Richard Fielder
+
+  Released under the GNU General Public License
+*/
+
+require('includes/application_top.php');
+
+
+?>
+<html>
+<head>
+<title><!-- Valid Categories/Products List --><?php echo VALID_CATEGORIES_PRODUCTS_LIST?></title>
+<style type="text/css">
+<!--
+h4 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; text-align: center}
+p {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+th {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+-->
+</style>
+<head>
+<body>
+<table width="550" border="1" cellspacing="1" bordercolor="gray">
+<tr>
+<td colspan="4">
+<h4><!-- Valid Categories List --><?php echo VALID_CATEGORIES_LIST?></h4>
+</td>
+</tr>
+<?php 
+   $coupon_get=tep_db_query("select restrict_to_categories from " . TABLE_COUPONS . " where coupon_id='".$HTTP_GET_VARS['cid']."'");
+   $get_result=tep_db_fetch_array($coupon_get);
+   echo "<tr><th>Category ID</th><th>Category Name</th></tr><tr>";
+   $cat_ids = split("[,]", $get_result['restrict_to_categories']);
+   for ($i = 0; $i < count($cat_ids); $i++) {
+     $result = tep_db_query("SELECT * FROM categories, categories_description WHERE categories.categories_id = categories_description.categories_id and categories_description.language_id = '" . $languages_id . "' and categories.categories_id='" . $cat_ids[$i] . "'");
+     if ($row = tep_db_fetch_array($result)) {
+       echo "<td>".$row["categories_id"]."</td>\n";
+       echo "<td>".$row["categories_name"]."</td>\n";
+       echo "</tr>\n";
+     }
+   }
+    echo "</table>\n";
+?>
+<br>
+<table width="550" border="0" cellspacing="1">
+<tr>
+<td align=middle><input type="button" value="Close Window" onClick="window.close()"></td>
+</tr></table>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/listproducts.php
===================================================================
--- trunk/direct.openmoko.com/admin/listproducts.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/listproducts.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: validproducts.php,v 0.01 2002/08/17 15:38:34 Richard Fielder
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+
+
+  Copyright (c) 2002 Richard Fielder
+
+  Released under the GNU General Public License
+*/
+
+require('includes/application_top.php');
+
+
+?>
+<html>
+<head>
+<title><?php echo VALID_CATEGORIES_PRODUCTS_LIST?></title>
+<style type="text/css">
+<!--
+h4 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; text-align: center}
+p {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+th {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+-->
+</style>
+<head>
+<body>
+<table width="550" border="1" cellspacing="1" bordercolor="gray">
+<tr>
+<td colspan="3">
+<h4>Valid Products List</h4>
+</td>
+</tr>
+<?php 
+   $coupon_get=tep_db_query("select restrict_to_products,restrict_to_categories from " . TABLE_COUPONS . "  where coupon_id='".$HTTP_GET_VARS['cid']."'");
+   $get_result=tep_db_fetch_array($coupon_get);
+
+    echo "<tr><th>Product ID</th><th>Product Name</th><th>Product Size</th></tr><tr>";
+    $pr_ids = split("[,]", $get_result['restrict_to_products']);
+    for ($i = 0; $i < count($pr_ids); $i++) {
+      $result = tep_db_query("SELECT * FROM products, products_description WHERE products.products_id = products_description.products_id and products_description.language_id = '" . $languages_id . "'and products.products_id = '" . $pr_ids[$i] . "'");
+      if ($row = tep_db_fetch_array($result)) {
+            echo "<td>".$row["products_id"]."</td>\n";
+            echo "<td>".$row["products_name"]."</td>\n";
+            echo "<td>".$row["products_model"]."</td>\n";
+            echo "</tr>\n";
+      }
+    }
+      echo "</table>\n";
+?>
+<br>
+<table width="550" border="0" cellspacing="1">
+<tr>
+<td align=middle><input type="button" value="Close Window" onClick="window.close()"></td>
+</tr></table>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/login.php
===================================================================
--- trunk/direct.openmoko.com/admin/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,174 @@
+<?php
+/*
+  $Id: login.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if ($session_started == false) {
+  echo 'session not started';
+  }
+
+  $error = false;
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
+    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
+    $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
+
+// Check if email exists
+    $check_admin_query = tep_db_query("select admin_id as login_id, admin_groups_id as login_groups_id, admin_firstname as login_firstname, admin_email_address as login_email_address, admin_password as login_password, admin_modified as login_modified, admin_logdate as login_logdate, admin_lognum as login_lognum from " . TABLE_ADMIN . " where admin_email_address = '" . tep_db_input($email_address) . "'");
+    if (!tep_db_num_rows($check_admin_query)) {
+      $HTTP_GET_VARS['login'] = 'fail';
+    } else {
+      $check_admin = tep_db_fetch_array($check_admin_query);
+
+      //BOF code for cPanel installer - convert password to cre hash
+      $check_password = $check_admin['login_password'];
+      if (substr($check_password, 0, 8) == '_cPanel_'){
+        $check_password = substr($check_password, 8);
+        $password_hash = tep_encrypt_password($check_password);
+        tep_db_query("UPDATE " . TABLE_ADMIN . " SET admin_password = '" . $password_hash . "'");
+        $check_admin_query = tep_db_query("select admin_id as login_id, admin_groups_id as login_groups_id, admin_firstname as login_firstname, admin_email_address as login_email_address, admin_password as login_password, admin_modified as login_modified, admin_logdate as login_logdate, admin_lognum as login_lognum from " . TABLE_ADMIN . " where admin_email_address = '" . tep_db_input($email_address) . "'");
+        $check_admin = tep_db_fetch_array($check_admin_query);
+      }
+      //EOF code for cPanel installer - convert password to cre hash
+
+      // Check that password is good
+      if (!tep_validate_password($password, $check_admin['login_password'])) {
+        $HTTP_GET_VARS['login'] = 'fail';
+      } else {
+        if (tep_session_is_registered('password_forgotten')) {
+          tep_session_unregister('password_forgotten');
+        }
+
+        $login_id = $check_admin['login_id'];
+        $login_groups_id = $check_admin[login_groups_id];
+        $login_firstname = $check_admin['login_firstname'];
+        $login_email_address = $check_admin['login_email_address'];
+        $login_logdate = $check_admin['login_logdate'];
+        $login_lognum = $check_admin['login_lognum'];
+        $login_modified = $check_admin['login_modified'];
+
+        tep_session_register('login_id');
+        tep_session_register('login_groups_id');
+        tep_session_register('login_firstname');
+
+        //$date_now = date('Ymd');
+        tep_db_query("update " . TABLE_ADMIN . " set admin_logdate = now(), admin_lognum = admin_lognum+1 where admin_id = '" . $login_id . "'");
+
+        if (($login_lognum == 0) || !($login_logdate) || ($login_email_address == 'admin at localhost') || ($login_modified == '0000-00-00 00:00:00')) {
+          tep_redirect(tep_href_link(FILENAME_ADMIN_ACCOUNT, '', 'SSL'));
+        } else {
+          tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL'));
+        }
+
+      }
+    }
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);
+  include('includes/functions/rss2html.php');
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<!-- Code related to index.php only -->
+<link type="text/css" rel="StyleSheet" href="includes/index.css" />
+<link type="text/css" rel="StyleSheet" href="includes/helptip.css" />
+<script type="text/javascript" src="includes/javascript/helptip.js"></script>
+<!-- code related to index.php EOF -->
+</head>
+<body>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<table width="100%"  border="0" align="center" cellpadding="2" cellspacing="2">
+  <tr>
+    <td valign="top" width="150">&nbsp;</td>
+    <td valign="top">
+      <table width="100%"  border="0" cellspacing="0" cellpadding="0" style="border:1px solid #CCCCCC; " summary="Title Table">
+        <tr>
+          <td align="center" class="pageHeading"><?php echo PROJECT_VERSION .'[' . PROJECT_PATCH .']';?><br>
+            <?php echo tep_draw_separator('pixel_trans.gif', '100%', '7'); 
+      $upgradeURL="http://store.creloaded.com/index.php?cPath=27&product_version=".urlencode(PROJECT_VERSION)."&product_patchlevel=".'[' . urlencode(PROJECT_PATCH) .']';
+      ?>
+            <input type="submit" name="Submit" value="     <?php echo TEXT_CHECK_UPDATES;?>     " onclick="javascript:window.open('<?php echo $upgradeURL?>','k')">
+&nbsp;&nbsp;&nbsp;
+            <input type="submit" name="Submit" value="     <?php echo TEXT_GET_PRO;?>     " onclick="javascript:window.open('<?php echo $upgradeURL?>','k')">
+            <?php echo tep_draw_separator('pixel_trans.gif', '100%', '7'); ?></td>
+        </tr>
+      </table>
+      <?php echo tep_draw_separator('pixel_trans.gif', '100%', '40'); ?>
+      <table align="center" width="50%"  border="0" cellspacing="0" cellpadding="0" summary="Login Table">
+        <tr>
+          <td><fieldset>
+            <legend><?php echo HEADING_RETURNING_ADMIN; ?></legend>
+            <?php echo tep_draw_form('login', FILENAME_LOGIN, 'action=process', 'post', '', 'SSL'); ?>
+            <?php
+  if ($HTTP_GET_VARS['login'] == 'fail') {
+    $info_message = TEXT_LOGIN_ERROR;
+  }
+  if (isset($info_message)) {
+ echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?>
+            <table align="center" border="0" cellspacing="3" cellpadding="5" style="border:1px solid red;" summary="Error Message Table">
+              <tr>
+                <td colspan="2" class="smallText" align="center"><?php echo $info_message; ?></td>
+              </tr>
+            </table>
+            <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); 
+
+  } else {
+  }
+?>
+            <table width="100%"  border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="login"><label for="email_address"><?php echo ENTRY_EMAIL_ADDRESS; ?></label></td>
+                <td class="login"><?php echo tep_draw_input_field('email_address'); ?></td>
+              </tr>
+              <tr>
+                <td class="login"><label for="password"><?php echo ENTRY_PASSWORD; ?></label></td>
+                <td class="login"><?php echo tep_draw_password_field('password'); ?></td>
+              </tr>
+              <tr>
+                <td></td>
+                <td><?php echo tep_image_submit('button_confirm.gif', IMAGE_BUTTON_LOGIN); ?></td>
+              </tr>
+              <tr>
+                <td class="login"></td>
+                <td class="login"><?php echo '<a class="sub" href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '"><b>' . TEXT_PASSWORD_FORGOTTEN . '</b></a>'; ?></td>
+              </tr>
+            </table>
+            </form>
+            </fieldset></td>
+        </tr>
+      </table>
+      <?php echo tep_draw_separator('pixel_trans.gif', '100%', '40'); ?>
+      <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="Footer Banner Table">
+        <tr>
+          <td align="center"><!--Bottom Banner Code Start-->
+<?php include(DIR_WS_INCLUDES . '/footer.php'); ?> 
+            <!--Bottom Banner Code End-->
+          </td>
+        </tr>
+      </table></td>
+    <td width="150" valign="top">&nbsp;</td>
+  </tr>
+</table>
+<table width="100%"  border="0" cellspacing="0" cellpadding="0">
+  <tr>
+<!--   <td align="center" valign="top"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?>E-Commerce Engine Copyright &copy; 2003 <a href="http://oscommerce.com" target="_blank">osCommerce</a> <br>
+      Supercharged by <a href="http://creloaded.com" target="_blank">CRE Loaded</a></td> -->
+  </tr>
+</table>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/logoff.php
===================================================================
--- trunk/direct.openmoko.com/admin/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<?php
+/*
+  $Id: login.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGOFF);
+
+//tep_session_destroy();
+  tep_session_unregister('login_id');
+  tep_session_unregister('login_firstname');
+  tep_session_unregister('login_groups_id');
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<meta http-equiv="refresh" content="3" src="<?php echo tep_href_link(FILENAME_LOGIN);?>">
+</head>
+<body>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<table width="100%"  border="0" align="center" cellpadding="2" cellspacing="2">
+  <tr>
+    <td valign="top" width="150">&nbsp;</td>
+    <td valign="top">
+      <?php echo tep_draw_separator('pixel_trans.gif', '100%', '40'); ?>
+      <table align="center" width="50%"  border="0" cellspacing="0" cellpadding="0" summary="Login Table">
+        <tr>
+          <td><fieldset>
+            <legend><?php echo HEADING_TITLE; ?></legend>
+       <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+            <table width="100%"  border="0" cellspacing="5" cellpadding="5">
+              <tr>
+                <td class="login" align="left"><?php echo TEXT_MAIN; ?></td>
+              </tr>
+              <tr>
+                <td class="login_heading" align="right"><?php echo '<a class="login_heading" href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+              </tr>
+            </table>
+       <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+            </fieldset></td>
+        </tr>
+      </table>
+      <?php echo tep_draw_separator('pixel_trans.gif', '100%', '40'); ?>
+      <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="Footer Banner Table">
+        <tr>
+          <td align="center"><!--Bottom Banner Code Start-->
+            <script language='JavaScript' type='text/javascript' src='http://adserver.chainreactionweb.com/adx.js'></script>
+            <script language='JavaScript' type='text/javascript'>
+      <!--
+      if (!document.phpAds_used) document.phpAds_used = ',';
+      phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
+
+      document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
+      document.write ("http://adserver.chainreactionweb.com/adjs.php?n=" + phpAds_random);
+      document.write ("&amp;what=zone:5");
+      document.write ("&amp;exclude=" + document.phpAds_used);
+      if (document.referrer)
+      document.write ("&amp;referer=" + escape(document.referrer));
+      document.write ("'><" + "/script>");
+      //-->
+      </script>
+            <noscript>
+            <a href='http://adserver.chainreactionweb.com/adclick.php?n=a3c513ce' target='_blank'><img src='http://adserver.chainreactionweb.com/adview.php?what=zone:5&amp;n=a3c513ce' border='0' alt=''></a>
+            </noscript>
+            <!--Bottom Banner Code End-->
+          </td>
+        </tr>
+      </table></td>
+    <td width="150" valign="top">&nbsp;</td>
+  </tr>
+</table>
+<table width="100%"  border="0" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" valign="top"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?><!-- E-Commerce Engine Copyright &copy; 2003 <a href="http://oscommerce.com" target="_blank">osCommerce</a> <br>
+      Supercharged by <a href="http://creloaded.com" target="_blank">CRE Loaded</a> --><?php echo TEXT_FOOTER?></td>
+  </tr>
+</table>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/mail.php
===================================================================
--- trunk/direct.openmoko.com/admin/mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,268 @@
+<?php
+/*
+  $Id: mail.php,v 1.1.1.1 2004/03/04 23:38:43 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if ( ($action == 'send_email_to_user') && isset($HTTP_POST_VARS['customers_email_address']) && !isset($HTTP_POST_VARS['back_x']) ) {
+    switch ($HTTP_POST_VARS['customers_email_address']) {
+      case '***':
+        $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS);
+        $mail_sent_to = TEXT_ALL_CUSTOMERS;
+        break;
+      case '**D':
+        $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
+        $mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
+        break;
+      default:
+        $customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']);
+
+        $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "'");
+        $mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
+        break;
+    }
+
+    $from = tep_db_prepare_input($HTTP_POST_VARS['from']);
+    $subject = tep_db_prepare_input($HTTP_POST_VARS['email_subject']);
+// changed from subject to email_subject for Contact US Email : DMG 
+    $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
+
+    //Let's build a message object using the email class
+    $mimemessage = new email(array('X-Mailer: osCommerce'));
+    // add the message to the object
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF (Send TEXT Email when WYSIWYG Disabled)
+    if (HTML_WYSIWYG_DISABLE_EMAIL == 'Disable') {
+    $mimemessage->add_text($message);
+    } else {
+    $mimemessage->add_html($message);
+    }
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF (Send HTML Email when WYSIWYG Enabled)
+
+    $mimemessage->build_message();
+    while ($mail = tep_db_fetch_array($mail_query)) {
+//      $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);
+//    }
+// Changed for Contact US Email Subject : DMG
+      $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, EMAIL_SUBJECT.$subject);
+    }
+
+
+    tep_redirect(tep_href_link(FILENAME_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
+  }
+
+  if ( ($action == 'preview') && !isset($HTTP_POST_VARS['customers_email_address']) ) {
+    $messageStack->add('search', ERROR_NO_CUSTOMER_SELECTED, 'error');
+  }
+
+  if (isset($HTTP_GET_VARS['mail_sent_to'])) {
+    $messageStack->add('search', sprintf(NOTICE_EMAIL_SENT_TO, $HTTP_GET_VARS['mail_sent_to']), 'success');
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<?php 
+// Load Editor
+include('includes/javascript/editor.php');
+echo tep_load_html_editor();
+echo tep_insert_html_editor('message','simple','500');
+?>
+<script language="javascript" src="includes/javascript/menu.js"></script>
+       <script language="JavaScript">
+<!-- Begin
+       function init() {
+define('customers_email_address', 'string', 'Customer or Newsletter Group');
+}
+//  End -->
+</script>
+</head>
+<body OnLoad="init()" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ( ($action == 'preview') && isset($HTTP_POST_VARS['customers_email_address']) ) {
+    switch ($HTTP_POST_VARS['customers_email_address']) {
+      case '***':
+        $mail_sent_to = TEXT_ALL_CUSTOMERS;
+        break;
+      case '**D':
+        $mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
+        break;
+      default:
+        $mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
+        break;
+    }
+?>
+          <tr><?php echo tep_draw_form('mail', FILENAME_MAIL, 'action=send_email_to_user'); ?>
+            <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_CUSTOMER; ?></b><br><?php echo $mail_sent_to; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_FROM; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['from'])); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_SUBJECT; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['email_subject'])); ?></td>
+                <!-- Changed above from subject to email_subject for Contact US Email Subject DMG -->
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TEXT_MESSAGE; ?></b><br><?php if (HTML_WYSIWYG_DISABLE_EMAIL == 'Enable') { echo (stripslashes($HTTP_POST_VARS['message'])); } else { echo htmlspecialchars(stripslashes($HTTP_POST_VARS['message'])); } ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td>
+<?php
+/* Re-Post all POST'ed variables */
+    reset($HTTP_POST_VARS);
+    while (list($key, $value) = each($HTTP_POST_VARS)) {
+      if (!is_array($HTTP_POST_VARS[$key])) {
+        echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
+      }
+    }
+?>
+                    <tr>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_MAIL) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
+                    </tr>
+                    <td class="smallText">
+                <?php if (HTML_WYSIWYG_DISABLE_EMAIL == 'Disable'){echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="back"');
+                } ?><?php if (HTML_WYSIWYG_DISABLE_EMAIL == 'Disable') {echo(TEXT_EMAIL_BUTTON_HTML);
+                 } else { echo(TEXT_EMAIL_BUTTON_TEXT); } ?>
+                    </td>
+                  </tr>
+                </table></td>
+             </tr>
+            </table></td>
+          </form></tr>
+
+
+<?php
+  } else {
+?>
+          <tr><?php echo tep_draw_form('mail', FILENAME_MAIL, 'action=preview'); ?>
+            <td><table border="0" cellpadding="0" cellspacing="2">
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+<?php
+    $customers = array();
+    $customers[] = array('id' => '', 'text' => TEXT_SELECT_CUSTOMER);
+    $customers[] = array('id' => '***', 'text' => TEXT_ALL_CUSTOMERS);
+    $customers[] = array('id' => '**D', 'text' => TEXT_NEWSLETTER_CUSTOMERS);
+    $mail_query = tep_db_query("select customers_email_address, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " order by customers_lastname");
+    while($customers_values = tep_db_fetch_array($mail_query)) {
+      $customers[] = array('id' => $customers_values['customers_email_address'],
+                           'text' => $customers_values['customers_lastname'] . ', ' . $customers_values['customers_firstname'] . ' (' . $customers_values['customers_email_address'] . ')');
+    }
+?>
+              <tr>
+                <td class="main"><?php echo TEXT_CUSTOMER; ?></td>
+                <td><?php echo tep_draw_pull_down_menu('customers_email_address', $customers, (isset($HTTP_GET_VARS['customer']) ? $HTTP_GET_VARS['customer'] : ''));?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_FROM; ?></td>
+                <td><?php echo tep_draw_input_field('from', EMAIL_FROM); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_SUBJECT; ?></td>
+              <td><?php echo tep_draw_input_field('email_subject', '', 'size = "60"'); ?></td> 
+ <!-- Changed for Contact US Email Subject :  DMG  -->
+<!--  <td><?php echo tep_draw_pull_down_menu('email_subject',  tep_get_email_subjects_list(array(array('name' => '', 'text' => TEXT_EMAIL_SUBJECTS)))); ?></td> -->
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+                <td valign="top" class="main"><?php echo TEXT_MESSAGE; ?></td>
+                <td><?php echo tep_draw_textarea_field('message', 'soft', '60', '25'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+              </tr>
+              <tr>
+
+
+                <td colspan="2" align="right">
+                 <?php if (HTML_WYSIWYG_DISABLE_EMAIL == 'Enable'){ echo tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL, 'onClick="validate();return returnVal;"');
+                   } else {
+                echo tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); }?>
+                </td>
+
+
+              </tr>
+            </table></td>
+          </form></tr>
+<?php
+  }
+?>
+<!-- body_text_eof //-->
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/admin/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,277 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.1.1.1 2004/03/04 23:38:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+      case 'save':
+        if (isset($HTTP_GET_VARS['mID'])) $manufacturers_id = tep_db_prepare_input($HTTP_GET_VARS['mID']);
+        $manufacturers_name = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_name']);
+
+        $sql_data_array = array('manufacturers_name' => $manufacturers_name);
+
+        if ($action == 'insert') {
+          $insert_sql_data = array('date_added' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+          tep_db_perform(TABLE_MANUFACTURERS, $sql_data_array);
+          $manufacturers_id = tep_db_insert_id();
+        } elseif ($action == 'save') {
+          $update_sql_data = array('last_modified' => 'now()');
+
+          $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+          tep_db_perform(TABLE_MANUFACTURERS, $sql_data_array, 'update', "manufacturers_id = '" . (int)$manufacturers_id . "'");
+        }
+
+        if ($manufacturers_image = new upload('manufacturers_image', DIR_FS_CATALOG_IMAGES)) {
+          tep_db_query("update " . TABLE_MANUFACTURERS . " set manufacturers_image = '" . $manufacturers_image->filename . "' where manufacturers_id = '" . (int)$manufacturers_id . "'");
+        }
+
+        $languages = tep_get_languages();
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $manufacturers_url_array = $HTTP_POST_VARS['manufacturers_url'];
+          $language_id = $languages[$i]['id'];
+
+          $sql_data_array = array('manufacturers_url' => tep_db_prepare_input($manufacturers_url_array[$language_id]));
+
+          if ($action == 'insert') {
+            $insert_sql_data = array('manufacturers_id' => $manufacturers_id,
+                                     'languages_id' => $language_id);
+
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_MANUFACTURERS_INFO, $sql_data_array);
+          } elseif ($action == 'save') {
+            tep_db_perform(TABLE_MANUFACTURERS_INFO, $sql_data_array, 'update', "manufacturers_id = '" . (int)$manufacturers_id . "' and languages_id = '" . (int)$language_id . "'");
+          }
+        }
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('manufacturers');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'mID=' . $manufacturers_id));
+        break;
+      case 'deleteconfirm':
+        $manufacturers_id = tep_db_prepare_input($HTTP_GET_VARS['mID']);
+
+        if (isset($HTTP_POST_VARS['delete_image']) && ($HTTP_POST_VARS['delete_image'] == 'on')) {
+          $manufacturer_query = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturers_id . "'");
+          $manufacturer = tep_db_fetch_array($manufacturer_query);
+
+          $image_location = DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES . $manufacturer['manufacturers_image'];
+
+          if (file_exists($image_location)) @unlink($image_location);
+        }
+
+        tep_db_query("delete from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturers_id . "'");
+        tep_db_query("delete from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$manufacturers_id . "'");
+
+        if (isset($HTTP_POST_VARS['delete_products']) && ($HTTP_POST_VARS['delete_products'] == 'on')) {
+          $products_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where manufacturers_id = '" . (int)$manufacturers_id . "'");
+          while ($products = tep_db_fetch_array($products_query)) {
+            tep_remove_product($products['products_id']);
+          }
+        } else {
+          tep_db_query("update " . TABLE_PRODUCTS . " set manufacturers_id = '' where manufacturers_id = '" . (int)$manufacturers_id . "'");
+        }
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('manufacturers');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MANUFACTURERS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $manufacturers_query_raw = "select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from " . TABLE_MANUFACTURERS . " order by manufacturers_name";
+  $manufacturers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $manufacturers_query_raw, $manufacturers_query_numrows);
+  $manufacturers_query = tep_db_query($manufacturers_query_raw);
+  while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+    if ((!isset($HTTP_GET_VARS['mID']) || (isset($HTTP_GET_VARS['mID']) && ($HTTP_GET_VARS['mID'] == $manufacturers['manufacturers_id']))) && !isset($mInfo) && (substr($action, 0, 3) != 'new')) {
+      $manufacturer_products_query = tep_db_query("select count(*) as products_count from " . TABLE_PRODUCTS . " where manufacturers_id = '" . (int)$manufacturers['manufacturers_id'] . "'");
+      $manufacturer_products = tep_db_fetch_array($manufacturer_products_query);
+
+      $mInfo_array = array_merge($manufacturers, $manufacturer_products);
+      $mInfo = new objectInfo($mInfo_array);
+    }
+
+    if (isset($mInfo) && is_object($mInfo) && ($manufacturers['manufacturers_id'] == $mInfo->manufacturers_id)) {
+      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $manufacturers['manufacturers_id'] . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $manufacturers['manufacturers_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $manufacturers['manufacturers_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($mInfo) && is_object($mInfo) && ($manufacturers['manufacturers_id'] == $mInfo->manufacturers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $manufacturers['manufacturers_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $manufacturers_split->display_count($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $manufacturers_split->display_links($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+<?php
+  if (empty($action)) {
+?>
+              <tr>
+                <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_MANUFACTURER . '</b>');
+
+      $contents = array('form' => tep_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'action=insert', 'post', 'enctype="multipart/form-data"'));
+      $contents[] = array('text' => TEXT_NEW_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_NAME . '<br>' . tep_draw_input_field('manufacturers_name'));
+      $contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_IMAGE . '<br>' . tep_draw_file_field('manufacturers_image'));
+
+      $manufacturer_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        $manufacturer_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('manufacturers_url[' . $languages[$i]['id'] . ']');
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $HTTP_GET_VARS['mID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_MANUFACTURER . '</b>');
+
+      $contents = array('form' => tep_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
+      $contents[] = array('text' => TEXT_EDIT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_NAME . '<br>' . tep_draw_input_field('manufacturers_name', $mInfo->manufacturers_name));
+      $contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_IMAGE . '<br>' . tep_draw_file_field('manufacturers_image') . '<br>' . $mInfo->manufacturers_image);
+
+      $manufacturer_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        $manufacturer_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('manufacturers_url[' . $languages[$i]['id'] . ']', tep_get_manufacturer_url($mInfo->manufacturers_id, $languages[$i]['id']));
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_DELETE_MANUFACTURER . '</b>');
+
+      $contents = array('form' => tep_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $mInfo->manufacturers_name . '</b>');
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE);
+
+      if ($mInfo->products_count > 0) {
+        $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS);
+        $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $mInfo->products_count));
+      }
+
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($mInfo) && is_object($mInfo)) {
+        $heading[] = array('text' => '<b>' . $mInfo->manufacturers_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($mInfo->date_added));
+        if (tep_not_null($mInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($mInfo->last_modified));
+        $contents[] = array('text' => '<br>' . tep_info_image($mInfo->manufacturers_image, $mInfo->manufacturers_name));
+        $contents[] = array('text' => '<br>' . TEXT_PRODUCTS . ' ' . $mInfo->products_count);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/members.php
===================================================================
--- trunk/direct.openmoko.com/admin/members.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/members.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,198 @@
+<?php
+/*
+  $Id: members.php,v 1.1 2003/07/13 20:28:45 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+        case 'confirmaccept':
+        $query=tep_db_query("update " . TABLE_CUSTOMERS . " set member_level = '1' where customers_id = '" . $HTTP_GET_VARS['cID'] . "'");
+        $HTTP_GET_VARS['action'] = '';
+        $HTTP_GET_VARS['cID'] = '';
+        break;
+      case 'deleteconfirm':
+        $customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        if ($HTTP_POST_VARS['delete_reviews'] == 'on') {
+          $reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where customers_id = '" . tep_db_input($customers_id) . "'");
+          while ($reviews = tep_db_fetch_array($reviews_query)) {
+            tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . $reviews['reviews_id'] . "'");
+          }
+          tep_db_query("delete from " . TABLE_REVIEWS . " where customers_id = '" . tep_db_input($customers_id) . "'");
+        } else {
+          tep_db_query("update " . TABLE_REVIEWS . " set customers_id = null where customers_id = '" . tep_db_input($customers_id) . "'");
+        }
+
+        tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . tep_db_input($customers_id) . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . tep_db_input($customers_id) . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . tep_db_input($customers_id) . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . tep_db_input($customers_id) . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . tep_db_input($customers_id) . "'");
+        tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . tep_db_input($customers_id) . "'");
+
+        tep_redirect(tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action'))));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('search', FILENAME_CUSTOMERS, '', 'get'); ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LASTNAME; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $search = '';
+    if ( ($HTTP_GET_VARS['search']) && (tep_not_null($HTTP_GET_VARS['search'])) ) {
+      $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
+      $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "' and member_level = '0'";
+    }
+    if ($search =='') $search = "where member_level = '0'";
+    $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";
+    $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);
+    $customers_query = tep_db_query($customers_query_raw);
+    while ($customers = tep_db_fetch_array($customers_query)) {
+      $info_query = tep_db_query("select customers_info_date_account_created as date_account_created, customers_info_date_account_last_modified as date_account_last_modified, customers_info_date_of_last_logon as date_last_logon, customers_info_number_of_logons as number_of_logons from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'");
+      $info = tep_db_fetch_array($info_query);
+
+      if (((!$HTTP_GET_VARS['cID']) || (@$HTTP_GET_VARS['cID'] == $customers['customers_id'])) && (!$cInfo)) {
+        $country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . $customers['entry_country_id'] . "'");
+        $country = tep_db_fetch_array($country_query);
+
+        $reviews_query = tep_db_query("select count(*) as number_of_reviews from " . TABLE_REVIEWS . " where customers_id = '" . $customers['customers_id'] . "'");
+        $reviews = tep_db_fetch_array($reviews_query);
+
+        $customer_info = array_merge($country, $info, $reviews);
+
+        $cInfo_array = array_merge($customers, $customer_info);
+        $cInfo = new objectInfo($cInfo_array);
+      }
+
+      if ( (is_object($cInfo)) && ($customers['customers_id'] == $cInfo->customers_id) ) {
+        echo '          <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo $customers['customers_lastname']; ?></td>
+                <td class="dataTableContent"><?php echo $customers['customers_firstname']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo tep_date_short($info['date_account_created']); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($customers['customers_id'] == $cInfo->customers_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
+                  </tr>
+<?php
+    if (tep_not_null($HTTP_GET_VARS['search'])) {
+?>
+                  <tr>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CUSTOMERS);
+  $heading = array();
+  $contents = array();
+  switch ($HTTP_GET_VARS['action']) {
+    case 'confirm':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '</b>');
+
+      $contents = array('form' => tep_draw_form('customers', FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
+      if ($cInfo->number_of_reviews > 0) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'accept':
+  $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_CONFIRM . "\n\n" . EMAIL_CONTACT . "\n\n" . EMAIL_WARNING . "\n\n";
+          $heading[] = array('text' => '<b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirmaccept') . '"    onclick="' .tep_mail($cInfo->customers_name, $cInfo->customers_email_address, EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '') . '">' . tep_image_button('button_confirm.gif', IMAGE_CONFIRM) . '</a> <a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($cInfo)) {
+          $heading[] = array('text' => '<b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=accept') . '">' . tep_image_button('button_activate.gif', IMAGE_ACTIVATE) . '</a> <a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br><a href="' . tep_href_link(FILENAME_MAIL, 'selected_box=tools&customer=' . $cInfo->customers_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/menu.css
===================================================================
--- trunk/direct.openmoko.com/admin/menu.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/menu.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,85 @@
+div.menuBar,
+div.menuBar a.menuButton,
+div.menu,
+div.menu a.menuItem {
+  font-family: "MS Sans Serif", Arial, sans-serif;
+  font-size: 8pt;
+  font-style: normal;
+  font-weight: normal;
+  color: #000000;
+}
+
+div.menuBar {
+  background-color: #F1F3F5;
+  border: 2px solid #F1F3F5;
+  padding: 4px 2px 4px 2px;
+  text-align: center;
+  font-weight: bold;
+}
+
+div.menuBar a.menuButton {
+  background-color: transparent;
+  border: 1px solid #e0e0e0;
+  color: #000000;
+  cursor: default;
+  left: 0px;
+  margin: 1px;
+  padding: 2px 6px 2px 6px;
+  position: relative;
+  text-decoration: none;
+  top: 0px;
+  z-index: 100;
+}
+
+div.menuBar a.menuButton:hover {
+  background-color: transparent;
+  border: 1px outset #e0e0e0;
+  color: #000000;
+}
+
+div.menuBar a.menuButtonActive,
+div.menuBar a.menuButtonActive:hover {
+  background-color: #B5CDE8;
+  border: 1px solid #30559C;
+  color: #000000;
+  left: 1px;
+  top: 1px;
+}
+
+div.menu {
+  background-color: #F1F3F5;
+  position: absolute;
+  visibility: hidden;
+  z-index:  100;
+  border:   0;
+  padding:  0;
+  overflow: visible;
+  border:   1px solid #8C867B;
+  filter:progid:DXImageTransform.Microsoft.Shadow(color=#BDC3BD, Direction=135, Strength=4);
+}
+
+div.menu a.menuItem {
+  color: #000000;
+  cursor: default;
+  display: block;
+  padding: 3px;
+  text-decoration: none;
+  white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+  background-color: #B5CDE8;
+  border: 1px solid #30559C;
+}
+
+div.menu a.menuItem span.menuItemText {}
+
+div.menu a.menuItem span.menuItemArrow {
+/*  margin-right: -.75em;*/
+}
+
+div.menu div.menuItemSep {
+  border: 1px inset #e0e0e0;
+  margin: 4px 2px;
+}
+

Added: trunk/direct.openmoko.com/admin/menu.js
===================================================================
--- trunk/direct.openmoko.com/admin/menu.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/menu.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,523 @@
+//<![CDATA[
+
+//*****************************************************************************
+// Do not remove this notice.
+//
+// Copyright 2000 by Mike Hall.
+// See http://www.brainjar.com for terms of use.
+//*****************************************************************************
+
+//----------------------------------------------------------------------------
+// Code to determine the browser and version.
+//----------------------------------------------------------------------------
+
+function Browser() {
+
+  var ua, s, i;
+
+  this.isIE    = false;  // Internet Explorer
+  this.isNS    = false;  // Netscape
+  this.version = null;
+
+  ua = navigator.userAgent;
+
+  s = "MSIE";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isIE = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  s = "Netscape6/";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  // Treat any other "Gecko" browser as NS 6.1.
+
+  s = "Gecko";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = 6.1;
+    return;
+  }
+}
+
+var browser = new Browser();
+
+//----------------------------------------------------------------------------
+// Code for handling the menu bar and active button.
+//----------------------------------------------------------------------------
+
+var activeButton = null;
+
+/* [MODIFIED] This code commented out, not needed for activate/deactivate
+   on mouseover.
+
+// Capture mouse clicks on the page so any active button can be
+// deactivated.
+
+if (browser.isIE)
+  document.onmousedown = pageMousedown;
+else
+  document.addEventListener("mousedown", pageMousedown, true);
+
+function pageMousedown(event) {
+
+  var el;
+
+  // If there is no active button, exit.
+
+  if (activeButton == null)
+    return;
+
+  // Find the element that was clicked on.
+
+  if (browser.isIE)
+    el = window.event.srcElement;
+  else
+    el = (event.target.tagName ? event.target : event.target.parentNode);
+
+  // If the active button was clicked on, exit.
+
+  if (el == activeButton)
+    return;
+
+  // If the element is not part of a menu, reset and clear the active
+  // button.
+
+  if (getContainerWith(el, "DIV", "menu") == null) {
+    resetButton(activeButton);
+    activeButton = null;
+  }
+}
+
+[END MODIFIED] */
+
+function buttonClick(event, menuId) {
+
+  var button;
+
+  // Get the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // Blur focus from the link to remove that annoying outline.
+
+  button.blur();
+
+  // Associate the named menu to this button if not already done.
+  // Additionally, initialize menu display.
+
+  if (button.menu == null) {
+    button.menu = document.getElementById(menuId);
+    if (button.menu.isInitialized == null)
+      menuInit(button.menu);
+  }
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the button, if not already done.
+
+  if (button.onmouseout == null)
+    button.onmouseout = buttonOrMenuMouseout;
+
+  // Exit if this button is the currently active one.
+
+  if (button == activeButton)
+    return false;
+
+  // [END MODIFIED]
+
+  // Reset the currently active button, if any.
+
+  if (activeButton != null)
+    resetButton(activeButton);
+
+  // Activate this button, unless it was the currently active one.
+
+  if (button != activeButton) {
+    depressButton(button);
+    activeButton = button;
+  }
+  else
+    activeButton = null;
+
+  return false;
+}
+
+function buttonMouseover(event, menuId) {
+
+  var button;
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Activates this button's menu if no other is currently active.
+
+  if (activeButton == null) {
+    buttonClick(event, menuId);
+    return;
+  }
+
+  // [END MODIFIED]
+
+  // Find the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // If any other button menu is active, make this one active instead.
+
+  if (activeButton != null && activeButton != button)
+    buttonClick(event, menuId);
+}
+
+function depressButton(button) {
+
+  var x, y;
+
+  // Update the button's style class to make it look like it's
+  // depressed.
+
+  button.className += " menuButtonActive";
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the button, if not already done.
+
+  if (button.onmouseout == null)
+    button.onmouseout = buttonOrMenuMouseout;
+  if (button.menu.onmouseout == null)
+    button.menu.onmouseout = buttonOrMenuMouseout;
+
+  // [END MODIFIED]
+
+  // Position the associated drop down menu under the button and
+  // show it.
+
+  x = getPageOffsetLeft(button);
+  y = getPageOffsetTop(button) + button.offsetHeight;
+
+  // For IE, adjust position.
+
+  if (browser.isIE) {
+    x += button.offsetParent.clientLeft;
+    y += button.offsetParent.clientTop;
+  }
+
+  button.menu.style.left = x + "px";
+  button.menu.style.top  = y + "px";
+  button.menu.style.visibility = "visible";
+}
+
+function resetButton(button) {
+
+  // Restore the button's style class.
+
+  removeClassName(button, "menuButtonActive");
+
+  // Hide the button's menu, first closing any sub menus.
+
+  if (button.menu != null) {
+    closeSubMenu(button.menu);
+    button.menu.style.visibility = "hidden";
+  }
+}
+
+//----------------------------------------------------------------------------
+// Code to handle the menus and sub menus.
+//----------------------------------------------------------------------------
+
+function menuMouseover(event) {
+
+  var menu;
+
+  // Find the target menu element.
+
+  if (browser.isIE)
+    menu = getContainerWith(window.event.srcElement, "DIV", "menu");
+  else
+    menu = event.currentTarget;
+
+  // Close any active sub menu.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+}
+
+function menuItemMouseover(event, menuId) {
+
+  var item, menu, x, y;
+
+  // Find the target item element and its parent menu element.
+
+  if (browser.isIE)
+    item = getContainerWith(window.event.srcElement, "A", "menuItem");
+  else
+    item = event.currentTarget;
+  menu = getContainerWith(item, "DIV", "menu");
+
+  // Close any active sub menu and mark this one as active.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+  menu.activeItem = item;
+
+  // Highlight the item element.
+
+  item.className += " menuItemHighlight";
+
+  // Initialize the sub menu, if not already done.
+
+  if (item.subMenu == null) {
+    item.subMenu = document.getElementById(menuId);
+    if (item.subMenu.isInitialized == null)
+      menuInit(item.subMenu);
+  }
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the sub menu, if not already done.
+
+  if (item.subMenu.onmouseout == null)
+    item.subMenu.onmouseout = buttonOrMenuMouseout;
+
+  // [END MODIFIED]
+
+  // Get position for submenu based on the menu item.
+
+  x = getPageOffsetLeft(item) + item.offsetWidth;
+  y = getPageOffsetTop(item);
+
+  // Adjust position to fit in view.
+
+  var maxX, maxY;
+
+  if (browser.isNS) {
+    maxX = window.scrollX + window.innerWidth;
+    maxY = window.scrollY + window.innerHeight;
+  }
+  if (browser.isIE) {
+    maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) +
+      (document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth);
+    maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) +
+      (document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight);
+  }
+  maxX -= item.subMenu.offsetWidth;
+  maxY -= item.subMenu.offsetHeight;
+
+  if (x > maxX)
+    x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
+      + (menu.offsetWidth - item.offsetWidth));
+  y = Math.max(0, Math.min(y, maxY));
+
+  // Position and show the sub menu.
+
+  item.subMenu.style.left = x + "px";
+  item.subMenu.style.top  = y + "px";
+  item.subMenu.style.visibility = "visible";
+
+  // Stop the event from bubbling.
+
+  if (browser.isIE)
+    window.event.cancelBubble = true;
+  else
+    event.stopPropagation();
+}
+
+function closeSubMenu(menu) {
+
+  if (menu == null || menu.activeItem == null)
+    return;
+
+  // Recursively close any sub menus.
+
+  if (menu.activeItem.subMenu != null) {
+    closeSubMenu(menu.activeItem.subMenu);
+    menu.activeItem.subMenu.style.visibility = "hidden";
+    menu.activeItem.subMenu = null;
+  }
+  removeClassName(menu.activeItem, "menuItemHighlight");
+  menu.activeItem = null;
+}
+
+// [MODIFIED] Added for activate/deactivate on mouseover. Handler for mouseout
+// event on buttons and menus.
+
+function buttonOrMenuMouseout(event) {
+
+  var el;
+
+  // If there is no active button, exit.
+
+  if (activeButton == null)
+    return;
+
+  // Find the element the mouse is moving to.
+
+  if (browser.isIE)
+    el = window.event.toElement;
+  else if (event.relatedTarget != null)
+      el = (event.relatedTarget.tagName ? event.relatedTarget : event.relatedTarget.parentNode);
+
+  // If the element is not part of a menu, reset the active button.
+
+  if (getContainerWith(el, "DIV", "menu") == null) {
+    resetButton(activeButton);
+    activeButton = null;
+  }
+}
+
+// [END MODIFIED]
+
+//----------------------------------------------------------------------------
+// Code to initialize menus.
+//----------------------------------------------------------------------------
+
+function menuInit(menu) {
+
+  var itemList, spanList;
+  var textEl, arrowEl;
+  var itemWidth;
+  var w, dw;
+  var i, j;
+
+  // For IE, replace arrow characters.
+
+  if (browser.isIE) {
+    menu.style.lineHeight = "2.5ex";
+    spanList = menu.getElementsByTagName("SPAN");
+    for (i = 0; i < spanList.length; i++)
+      if (hasClassName(spanList[i], "menuItemArrow")) {
+        spanList[i].style.fontFamily = "Webdings";
+        spanList[i].firstChild.nodeValue = "4";
+      }
+  }
+
+  // Find the width of a menu item.
+
+  itemList = menu.getElementsByTagName("A");
+  if (itemList.length > 0)
+    itemWidth = itemList[0].offsetWidth;
+  else
+    return;
+
+  // For items with arrows, add padding to item text to make the
+  // arrows flush right.
+
+  for (i = 0; i < itemList.length; i++) {
+    spanList = itemList[i].getElementsByTagName("SPAN");
+    textEl  = null;
+    arrowEl = null;
+    for (j = 0; j < spanList.length; j++) {
+      if (hasClassName(spanList[j], "menuItemText"))
+        textEl = spanList[j];
+      if (hasClassName(spanList[j], "menuItemArrow"))
+        arrowEl = spanList[j];
+    }
+    if (textEl != null && arrowEl != null)
+      textEl.style.paddingRight = (itemWidth
+        - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
+  }
+
+  // Fix IE hover problem by setting an explicit width on first item of
+  // the menu.
+
+  if (browser.isIE) {
+    w = itemList[0].offsetWidth;
+    itemList[0].style.width = w + "px";
+    dw = itemList[0].offsetWidth - w;
+    w -= dw;
+    itemList[0].style.width = w + "px";
+  }
+
+  // Mark menu as initialized.
+
+  menu.isInitialized = true;
+}
+
+//----------------------------------------------------------------------------
+// General utility functions.
+//----------------------------------------------------------------------------
+
+function getContainerWith(node, tagName, className) {
+
+  // Starting with the given node, find the nearest containing element
+  // with the specified tag name and style class.
+
+  while (node != null) {
+    if (node.tagName != null && node.tagName == tagName &&
+        hasClassName(node, className))
+      return node;
+    node = node.parentNode;
+  }
+
+  return node;
+}
+
+function hasClassName(el, name) {
+
+  var i, list;
+
+  // Return true if the given element currently has the given class
+  // name.
+
+  list = el.className.split(" ");
+  for (i = 0; i < list.length; i++)
+    if (list[i] == name)
+      return true;
+
+  return false;
+}
+
+function removeClassName(el, name) {
+
+  var i, curList, newList;
+
+  if (el.className == null)
+    return;
+
+  // Remove the given class name from the element's className property.
+
+  newList = new Array();
+  curList = el.className.split(" ");
+  for (i = 0; i < curList.length; i++)
+    if (curList[i] != name)
+      newList.push(curList[i]);
+  el.className = newList.join(" ");
+}
+
+function getPageOffsetLeft(el) {
+
+  var x;
+
+  // Return the x coordinate of an element relative to the page.
+
+  x = el.offsetLeft;
+  if (el.offsetParent != null)
+    x += getPageOffsetLeft(el.offsetParent);
+
+  return x;
+}
+
+function getPageOffsetTop(el) {
+
+  var y;
+
+  // Return the x coordinate of an element relative to the page.
+
+  y = el.offsetTop;
+  if (el.offsetParent != null)
+    y += getPageOffsetTop(el.offsetParent);
+
+  return y;
+}
+
+//]]>

Added: trunk/direct.openmoko.com/admin/modules.php
===================================================================
--- trunk/direct.openmoko.com/admin/modules.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/modules.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,321 @@
+<?php
+/*
+  $Id: modules.php,v 1.1.1.2 2004/03/04 23:38:44 ccwjr Exp $
+  ++++ modified as USPS Methods 2.5 08/02/03 by Brad Waite and Fritz Clapp ++++
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('FILENAME_AUTHORIZENET_HELP', 'authnet_help.php');
+
+  require('includes/application_top.php');
+
+  $set = (isset($HTTP_GET_VARS['set']) ? $HTTP_GET_VARS['set'] : '');
+
+  if (tep_not_null($set)) {
+    switch ($set) {
+      case 'shipping':
+        $module_type = 'shipping';
+        $module_directory = DIR_FS_CATALOG_MODULES . 'shipping/';
+        $module_key = 'MODULE_SHIPPING_INSTALLED';
+        define('HEADING_TITLE', HEADING_TITLE_MODULES_SHIPPING);
+        $SSL= 'NONSSL';
+        break;
+      case 'ordertotal':
+        $module_type = 'order_total';
+        $module_directory = DIR_FS_CATALOG_MODULES . 'order_total/';
+        $module_key = 'MODULE_ORDER_TOTAL_INSTALLED';
+        define('HEADING_TITLE', HEADING_TITLE_MODULES_ORDER_TOTAL);
+        $SSL= 'NONSSL';
+        break;
+      case 'checkout_success':
+        $module_type = 'checkout_success';
+        $module_directory = DIR_FS_CATALOG_MODULES . 'checkout_success/';
+        $module_key = 'MODULE_CHECKOUT_SUCCESS_INSTALLED';
+        define('HEADING_TITLE', HEADING_TITLE_MODULES_CHECKOUT_SUCCESS);
+        $SSL= 'NONSSL';
+        break;
+      case 'payment':
+      default:
+        $module_type = 'payment';
+        $module_directory = DIR_FS_CATALOG_MODULES . 'payment/';
+        $module_key = 'MODULE_PAYMENT_INSTALLED';
+        define('HEADING_TITLE', HEADING_TITLE_MODULES_PAYMENT);
+        $SSL= 'SSL';
+        break;
+    }
+  }
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+
+/* BEGIN: ORIGINAL PRIOR UPS INSTALLATION */
+/*      case 'save':
+        while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
+          if( is_array( $value ) ){
+            $value = implode( ", ", $value);
+            $value = ereg_replace (", --none--", "", $value);
+          }
+          tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
+        }
+        tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'], $SSL));
+        break;*/
+/* END: ORIGINAL PRIOR UPS INSTALLATION */        
+
+/* BEGIN: AFTER UPSXML INSTALLATION */
+      case 'save':
+        while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
+          if( is_array( $value ) ){
+          $value = implode( ", ", $value);
+		  $value = ereg_replace (", --none--", "", $value);
+		    }
+          tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
+        }
+        tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']));
+        break;
+/* END: AFTER UPSXML INSTALLATION */
+        
+      case 'install':
+      case 'remove':
+        $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+        $class = basename($HTTP_GET_VARS['module']);
+        if (file_exists($module_directory . $class . $file_extension)) {
+          include($module_directory . $class . $file_extension);
+          $module = new $class;
+          if ($action == 'install') {
+            $module->install();
+          } elseif ($action == 'remove') {
+            $module->remove();
+          }
+        }
+        tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class, $SSL));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MODULES; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SORT_ORDER; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+  $directory_array = array();
+  if ($dir = @dir($module_directory)) {
+    while ($file = $dir->read()) {
+      if (!is_dir($module_directory . $file)) {
+        if (substr($file, strrpos($file, '.')) == $file_extension) {
+          $directory_array[] = $file;
+        }
+      }
+    }
+    sort($directory_array);
+    $dir->close();
+  }
+
+  $installed_modules = array();
+  for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) {
+    $file = $directory_array[$i];
+
+    include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/' . $module_type . '/' . $file);
+    include($module_directory . $file);
+
+    $class = substr($file, 0, strrpos($file, '.'));
+    if (tep_class_exists($class)) {
+      $module = new $class;
+      if ($module->check() > 0) {
+        if ($module->sort_order > 0) {
+          $installed_modules[$module->sort_order] = $file;
+        } else {
+          $installed_modules[] = $file;
+        }
+      }
+
+      if ((!isset($HTTP_GET_VARS['module']) || (isset($HTTP_GET_VARS['module']) && ($HTTP_GET_VARS['module'] == $class))) && !isset($mInfo)) {
+        $module_info = array('code' => $module->code,
+                             'title' => $module->title,
+                             'description' => $module->description,
+                             'status' => $module->check());
+
+        $module_keys = $module->keys();
+
+        $keys_extra = array();
+        for ($j=0, $k=sizeof($module_keys); $j<$k; $j++) {
+          $key_value_query = tep_db_query("select configuration_title, configuration_value, configuration_description, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_keys[$j] . "'");
+          $key_value = tep_db_fetch_array($key_value_query);
+
+          $keys_extra[$module_keys[$j]]['title'] = $key_value['configuration_title'];
+          $keys_extra[$module_keys[$j]]['value'] = $key_value['configuration_value'];
+          $keys_extra[$module_keys[$j]]['description'] = $key_value['configuration_description'];
+          $keys_extra[$module_keys[$j]]['use_function'] = $key_value['use_function'];
+          $keys_extra[$module_keys[$j]]['set_function'] = $key_value['set_function'];
+        }
+
+        $module_info['keys'] = $keys_extra;
+
+        $mInfo = new objectInfo($module_info);
+      }
+
+      if (isset($mInfo) && is_object($mInfo) && ($class == $mInfo->code) ) {
+        if ($module->check() > 0) {
+          echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class . '&action=edit', $SSL) . '\'">' . "\n";
+        } else {
+          echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
+        }
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo $module->title; ?></td>
+                <td class="dataTableContent" align="right"><?php if (is_numeric($module->sort_order)) echo $module->sort_order; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($mInfo) && is_object($mInfo) && ($class == $mInfo->code) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class, $SSL) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+  }
+
+  ksort($installed_modules);
+  $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_key . "'");
+  if (tep_db_num_rows($check_query)) {
+    $check = tep_db_fetch_array($check_query);
+    if ($check['configuration_value'] != implode(';', $installed_modules)) {
+      tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $installed_modules) . "', last_modified = now() where configuration_key = '" . $module_key . "'");
+    }
+  } else {
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Installed Modules', '" . $module_key . "', '" . implode(';', $installed_modules) . "', 'This is automatically updated. No need to edit.', '6', '0', now())");
+  }
+?>
+              <tr>
+                <td colspan="3" class="smallText"><?php echo TEXT_MODULE_DIRECTORY . ' ' . $module_directory; ?></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'edit':
+      $keys = '';
+      reset($mInfo->keys);
+      while (list($key, $value) = each($mInfo->keys)) {
+        $keys .= '<b>' . $value['title'] . '</b><br>' . $value['description'] . '<br>';
+
+        if ($value['set_function']) {
+          eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");
+        } else {
+          $keys .= tep_draw_input_field('configuration[' . $key . ']', $value['value']);
+        }
+        $keys .= '<br><br>';
+      }
+      $keys = substr($keys, 0, strrpos($keys, '<br><br>'));
+
+      $heading[] = array('text' => '<b>' . $mInfo->title . '</b>');
+      $contents[] = array('text' => '<br>' . $mInfo->description);    
+      $contents[] = array('text' => tep_draw_form('modules', FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=save', 'post', '', $SSL));
+      $contents[] = array('text' => $keys);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '</form> <a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'], 'SSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      $heading[] = array('text' => '<b>' . $mInfo->title . '</b>');
+
+      if ($mInfo->status == '1') {
+        $keys = '';
+        reset($mInfo->keys);
+        while (list(, $value) = each($mInfo->keys)) {
+          $keys .= '<b>' . $value['title'] . '</b><br>';
+          if ($value['use_function']) {
+            $use_function = $value['use_function'];
+            if (ereg('->', $use_function)) {
+              $class_method = explode('->', $use_function);
+              if (!is_object(${$class_method[0]})) {
+                include(DIR_WS_CLASSES . $class_method[0] . '.php');
+                ${$class_method[0]} = new $class_method[0]();
+              }
+              $keys .= tep_call_function($class_method[1], $value['value'], ${$class_method[0]});
+            } else {
+              $keys .= tep_call_function($use_function, $value['value']);
+            }
+          } else {
+            $keys .= $value['value'];
+          }
+          $keys .= '<br><br>';
+        }
+        $keys = substr($keys, 0, strrpos($keys, '<br><br>'));
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=remove', $SSL) . '">' . tep_image_button('button_module_remove.gif', IMAGE_MODULE_REMOVE) . '</a> <a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . (isset($HTTP_GET_VARS['module']) ? '&module=' . $HTTP_GET_VARS['module'] : '') . '&action=edit', $SSL) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+        $contents[] = array('text' => '<br>' . $mInfo->description);
+        $contents[] = array('text' => '<br>' . $keys);
+      } else {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=install', $SSL) . '">' . tep_image_button('button_module_install.gif', IMAGE_MODULE_INSTALL) . '</a>');
+        $contents[] = array('text' => '<br>' . $mInfo->description);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/admin/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,925 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/29 00:18:17 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+//Added for Categories Description 1.5
+  require('includes/functions/categories_description.php');
+//End Categories Description 1.5
+
+
+// define functions (move to seperate file)
+  function tep_nm_childs_in_category_count($categories_id) {
+    $categories_count = 0;
+
+    $categories_query = tep_db_query("select nmc_id from " . TABLE_NAVMENU_CATEGORIES . " where nmc_parent_id = '" . (int)$categories_id . "'");
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $categories_count++;
+      $categories_count += tep_nm_childs_in_category_count($categories['nmc_id']);
+    }
+
+    return $categories_count;
+  }
+
+  function tep_nm_links_in_category_count($categories_id) {
+    $links_count = 0;
+
+    $links_query = tep_db_query("select count(*) as total from " . TABLE_NAVMENU_LINKS . " l, " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c where l.nml_id = l2c.nml_id and l.nml_status = '1' and l2c.nmc_id = '" . (int)$categories_id . "'");
+
+    $links = tep_db_fetch_array($links_query);
+
+    $links_count += $links['total'];
+
+    $childs_query = tep_db_query("select nmc_id from " . TABLE_NAVMENU_CATEGORIES . " where nmc_parent_id = '" . (int)$categories_id . "'");
+    if (tep_db_num_rows($childs_query)) {
+      while ($childs = tep_db_fetch_array($childs_query)) {
+        $links_count += tep_nm_links_in_category_count($childs['nmc_id']);
+      }
+    }
+
+    return $links_count;
+  }
+
+  function tep_nm_get_path($current_category_id = '') {
+    global $nPath_array;
+
+    if ($current_category_id == '') {
+      $nPath_new = implode('_', $nPath_array);
+    } else {
+      if (sizeof($nPath_array) == 0) {
+        $nPath_new = $current_category_id;
+      } else {
+        $nPath_new = '';
+        $last_category_query = tep_db_query("select nmc_parent_id from " . TABLE_NAVMENU_CATEGORIES . " where nmc_id = '" . (int)$nPath_array[(sizeof($nPath_array)-1)] . "'");
+        $last_category = tep_db_fetch_array($last_category_query);
+
+        $current_category_query = tep_db_query("select nmc_parent_id from " . TABLE_NAVMENU_CATEGORIES . " where nmc_id = '" . (int)$current_category_id . "'");
+        $current_category = tep_db_fetch_array($current_category_query);
+
+        if ($last_category['nmc_parent_id'] == $current_category['nmc_parent_id']) {
+          for ($i = 0, $n = sizeof($nPath_array) - 1; $i < $n; $i++) {
+            $nPath_new .= '_' . $nPath_array[$i];
+          }
+        } else {
+          for ($i = 0, $n = sizeof($nPath_array); $i < $n; $i++) {
+            $nPath_new .= '_' . $nPath_array[$i];
+          }
+        }
+
+        $nPath_new .= '_' . $current_category_id;
+
+        if (substr($nPath_new, 0, 1) == '_') {
+          $nPath_new = substr($nPath_new, 1);
+        }
+      }
+    }
+
+    return 'nPath=' . $nPath_new;
+  }
+
+  function tep_nm_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
+    global $languages_id;
+
+    if (!is_array($category_tree_array)) $category_tree_array = array();
+    if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
+
+    if ($include_itself) {
+      $category_query = tep_db_query("select cd.nmc_name from " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.nmc_id = '" . (int)$parent_id . "'");
+      $category = tep_db_fetch_array($category_query);
+      $category_tree_array[] = array('id' => $parent_id, 'text' => $category['nmc_name']);
+    }
+
+    $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name, c.nmc_parent_id from " . TABLE_NAVMENU_CATEGORIES . " c, " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd where c.nmc_id = cd.nmc_id and cd.language_id = '" . (int)$languages_id . "' and c.nmc_parent_id = '" . (int)$parent_id . "' order by c.nmc_sort_order, cd.nmc_name");
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      if ($exclude != $categories['nmc_id']) $category_tree_array[] = array('id' => $categories['nmc_id'], 'text' => $spacing . $categories['nmc_name']);
+      $category_tree_array = tep_nm_get_category_tree($categories['nmc_id'], $spacing . '&nbsp;&nbsp;&nbsp;', $exclude, $category_tree_array);
+    }
+
+    return $category_tree_array;
+  }
+
+  function tep_nm_get_category_name($category_id, $language_id) {
+    $category_query = tep_db_query("select nmc_name from " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " where nmc_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+    return $category['nmc_name'];
+  }
+
+  function tep_nm_get_link_name($link_id, $language_id = 0) {
+    global $languages_id;
+
+    if ($language_id == 0) $language_id = $languages_id;
+    $link_query = tep_db_query("select nml_name from " . TABLE_NAVMENU_LINKS_DESCRIPTION . " where nml_id = '" . (int)$link_id . "' and language_id = '" . (int)$language_id . "'");
+    $link = tep_db_fetch_array($link_query);
+
+    return $link['nml_name'];
+  }
+
+  function tep_nm_draw_products_pull_down($name, $parameters = '', $exclude = '') {
+    global $languages_id;
+
+    if ($exclude == '') {
+      $exclude = array();
+    }
+
+    $select_string = '<select name="' . $name . '"';
+
+    if ($parameters) {
+      $select_string .= ' ' . $parameters;
+    }
+
+    $select_string .= '>';
+
+    $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");
+    while ($products = tep_db_fetch_array($products_query)) {
+      if (!in_array($products['products_id'], $exclude)) {
+        $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . '</option>';
+      }
+    }
+
+    $select_string .= '</select>';
+
+    return $select_string;
+  }
+
+  function tep_nm_draw_links_pull_down($name, $parameters = '', $exclude = '') {
+    global $currencies, $languages_id;
+
+    if ($exclude == '') {
+      $exclude = array();
+    }
+
+    $select_string = '<select name="' . $name . '"';
+
+    if ($parameters) {
+      $select_string .= ' ' . $parameters;
+    }
+
+    $select_string .= '>';
+
+    $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");
+    while ($products = tep_db_fetch_array($products_query)) {
+      if (!in_array($products['products_id'], $exclude)) {
+        $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';
+      }
+    }
+
+    $select_string .= '</select>';
+
+    return $select_string;
+  }
+
+  function tep_nm_remove_category($category_id) {
+    tep_db_query("delete from " . TABLE_NAVMENU_CATEGORIES . " where nmc_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " where nmc_id = '" . (int)$category_id . "'");
+    tep_db_query("delete from " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " where nmc_id = '" . (int)$category_id . "'");
+  }
+
+  function tep_nm_remove_link($link_id) {
+    tep_db_query("delete from " . TABLE_NAVMENU_LINKS . " where nml_id = '" . (int)$link_id . "'");
+    tep_db_query("delete from " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " where nml_id = '" . (int)$link_id . "'");
+    tep_db_query("delete from " . TABLE_NAVMENU_LINKS_DESCRIPTION . " where nml_id = '" . (int)$link_id . "'");
+  }
+
+  $languages = tep_get_languages();
+
+  // category path
+  $nPath = '';
+  if (isset($HTTP_POST_VARS['nPath']) && tep_not_null($HTTP_POST_VARS['nPath'])) {
+    $nPath = tep_db_prepare_input($HTTP_POST_VARS['nPath']);
+  } elseif (isset($HTTP_GET_VARS['nPath']) && tep_not_null($HTTP_GET_VARS['nPath'])) {
+    $nPath = tep_db_prepare_input($HTTP_GET_VARS['nPath']);
+  }
+
+  if (tep_not_null($nPath)) {
+    $nPath_array = tep_parse_category_path($nPath);
+    $nPath = implode('_', $nPath_array);
+    $current_category_id = $nPath_array[(sizeof($nPath_array)-1)];
+  } else {
+    $current_category_id = 0;
+  }
+
+  // clean variables
+  $cID = '';
+  if (isset($HTTP_POST_VARS['cID']) && tep_not_null($HTTP_POST_VARS['cID'])) {
+    $cID = (int)$HTTP_POST_VARS['cID'];
+  } elseif (isset($HTTP_GET_VARS['cID']) && tep_not_null($HTTP_GET_VARS['cID'])) {
+    $cID = (int)$HTTP_GET_VARS['cID'];
+  }
+
+  $lID = '';
+  if (isset($HTTP_POST_VARS['lID']) && tep_not_null($HTTP_POST_VARS['lID'])) {
+    $lID = (int)$HTTP_POST_VARS['lID'];
+  } elseif (isset($HTTP_GET_VARS['lID']) && tep_not_null($HTTP_GET_VARS['lID'])) {
+    $lID = (int)$HTTP_GET_VARS['lID'];
+  }
+
+  $action = '';
+  if (isset($HTTP_POST_VARS['action']) && tep_not_null($HTTP_POST_VARS['action'])) {
+    $action = tep_db_prepare_input($HTTP_POST_VARS['action']);
+  } elseif (isset($HTTP_GET_VARS['action']) && tep_not_null($HTTP_GET_VARS['action'])) {
+    $action = tep_db_prepare_input($HTTP_GET_VARS['action']);
+  } 
+
+  $languages = tep_get_languages();
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+    case 'new_category':
+
+      break;
+    case 'edit_category':
+      $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name, c.nmc_parent_id, c.nmc_sort_order, c.nmc_date_added from " . TABLE_NAVMENU_CATEGORIES . " c, " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd where c.nmc_id = '" . $cID . "' and c.nmc_id = cd.nmc_id and cd.language_id = '" . $languages_id . "'");
+      $category = tep_db_fetch_array($categories_query);
+
+      $cInfo = new objectInfo($category);
+
+      break;
+    case 'insert_category':
+    case 'update_category':
+      $nmc_name_array = tep_db_prepare_input($HTTP_POST_VARS['nmc_name']);
+      $nmc_sort_order = tep_not_null($HTTP_POST_VARS['nmc_sort_order']) ? (int)$HTTP_POST_VARS['nmc_sort_order'] : '0';
+
+      $sql_data_array = array('nmc_parent_id' => $current_category_id, 
+            'nmc_sort_order' => $nmc_sort_order
+            );
+
+      if ($action == 'insert_category') {
+  $sql_data_array['nmc_date_added'] = 'now()';
+
+  tep_db_perform(TABLE_NAVMENU_CATEGORIES, $sql_data_array);
+  $nmc_id = tep_db_insert_id();
+      } else {
+  $nmc_id = (int)$HTTP_POST_VARS['nmc_id'];
+
+  tep_db_perform(TABLE_NAVMENU_CATEGORIES, $sql_data_array, 'update', "nmc_id = '" . $nmc_id . "'");
+      }
+
+      $sql_data_array = array();
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+  $language_id = (int)$languages[$i]['id'];
+
+  if ($action == 'insert_category') {
+    $sql_data_array = array('nmc_id' => (int)$nmc_id, 
+          'language_id' => $language_id, 
+          'nmc_name' => tep_db_prepare_input($nmc_name_array[$language_id])
+          );
+
+    tep_db_perform(TABLE_NAVMENU_CATEGORIES_DESCRIPTION, $sql_data_array);
+  } else {
+    $sql_data_array['nmc_name'] = tep_db_prepare_input($nmc_name_array[$language_id]);
+
+    tep_db_perform(TABLE_NAVMENU_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "nmc_id = '" . (int)$nmc_id . "' and language_id = '" . (int)$language_id . "'");
+  }
+      }
+
+      tep_redirect(tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . (int)$nmc_id));
+
+      break;
+    case 'delete_category_confirm':
+      $nmc_id = (int)$HTTP_POST_VARS['nmc_id'];
+
+      if (isset($nmc_id)) {
+  $categories = tep_nm_get_category_tree($nmc_id, '', '0', '', true);
+  $links = array();
+  $links_delete = array();
+
+  for ($i = 0, $n = sizeof($categories); $i < $n; $i++) {
+    $link_ids_query = tep_db_query("select nml_id from " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " where nmc_id = '" . (int)$categories[$i]['id'] . "'");
+
+    while ($link_ids = tep_db_fetch_array($link_ids_query)) {
+      $links[$link_ids['nml_id']]['categories'][] = $categories[$i]['id'];
+    }
+  }
+
+  reset($links);
+  while (list($key, $value) = each($links)) {
+    $category_ids = '';
+
+    for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) {
+      $category_ids .= "'" . (int)$value['categories'][$i] . "', ";
+    }
+    $category_ids = substr($category_ids, 0, -2);
+
+    $check_query = tep_db_query("select count(*) as total from " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " where nml_id = '" . (int)$key . "' and nmc_id not in (" . $category_ids . ")");
+    $check = tep_db_fetch_array($check_query);
+    if ($check['total'] < '1') {
+      $links_delete[$key] = $key;
+    }
+  }
+
+  // removing categories can be a lengthy process
+  tep_set_time_limit(0);
+  for ($i = 0, $n = sizeof($categories); $i < $n; $i++) {
+    tep_nm_remove_category($categories[$i]['id']);
+  }
+
+  reset($links_delete);
+  while (list($key) = each($links_delete)) {
+    tep_nm_remove_link($key);
+  }
+      }
+
+      tep_redirect(tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath));
+      break;
+    case 'new_link':
+
+      break;
+    case 'edit_link':
+      $links_query = tep_db_query("select l.nml_id, ld.nml_name, l.nml_url, l.nml_status, l.nml_sort_order, l.nml_date_added from " . TABLE_NAVMENU_LINKS . " l, " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld where l.nml_id = '" . $lID . "' and l.nml_id = ld.nml_id and ld.language_id = '" . $languages_id . "'");
+      $links = tep_db_fetch_array($links_query);
+
+      $lInfo = new objectInfo($links);
+
+      break;
+    case 'insert_link':
+    case 'update_link':
+      $nml_name_array = tep_db_prepare_input($HTTP_POST_VARS['nml_name']);
+      $nml_url = tep_db_prepare_input($HTTP_POST_VARS['nml_url']);
+      $nml_status = ($HTTP_POST_VARS['nml_status'] == 'on') ? '1' : '0';
+      $nml_sort_order = tep_not_null($HTTP_POST_VARS['nml_sort_order']) ? (int)$HTTP_POST_VARS['nml_sort_order'] : '0';
+
+      $sql_data_array = array('nml_url' => $nml_url, 
+            'nml_status' => $nml_status, 
+            'nml_sort_order' => $nml_sort_order
+            );
+
+      if ($action == 'insert_link') {
+  $sql_data_array['nml_date_added'] = 'now()';
+
+  tep_db_perform(TABLE_NAVMENU_LINKS, $sql_data_array);
+  $nml_id = tep_db_insert_id();
+
+  // update categories to links table
+  $sql_data_array = array('nml_id' => $nml_id,  
+        'nmc_id' => (int)$current_category_id
+        );
+
+  tep_db_perform(TABLE_NAVMENU_LINKS_TO_CATEGORIES, $sql_data_array);
+      } else {
+  $nml_id = (int)$HTTP_POST_VARS['nml_id'];
+
+  tep_db_perform(TABLE_NAVMENU_LINKS, $sql_data_array, 'update', "nml_id = '" . $nml_id . "'");
+      }
+
+      $sql_data_array = array();
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+  $language_id = (int)$languages[$i]['id'];
+
+  if ($action == 'insert_link') {
+    $sql_data_array = array('nml_id' => (int)$nml_id, 
+          'language_id' => $language_id, 
+          'nml_name' => tep_db_prepare_input($nml_name_array[$language_id])
+          );
+
+    tep_db_perform(TABLE_NAVMENU_LINKS_DESCRIPTION, $sql_data_array);
+  } else {
+    $sql_data_array['nml_name'] = tep_db_prepare_input($nml_name_array[$language_id]);
+
+    tep_db_perform(TABLE_NAVMENU_LINKS_DESCRIPTION, $sql_data_array, 'update', "nml_id = '" . (int)$nml_id . "' and language_id = '" . (int)$language_id . "'");
+  }
+      }
+
+      tep_redirect(tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . (int)$current_category_id . '&lID=' . (int)$nml_id));
+
+      break;
+    case 'link_setflag':
+      $flag = (int)$HTTP_GET_VARS['flag'];
+
+      if (($flag == '0') || ($flag == '1')) {
+  if (isset($lID)) {
+    tep_db_query("update " . TABLE_NAVMENU_LINKS . " set nml_status = '" . $flag . "' where nml_id = '" . (int)$lID . "'");
+  }
+      }
+
+      tep_redirect(tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . (int)$current_category_id . '&lID=' . (int)$lID));
+
+      break;
+    case 'delete_link_confirm':
+      $nml_id = (int)$HTTP_POST_VARS['nml_id'];
+
+      if (isset($nml_id)) {
+  tep_nm_remove_link($nml_id);
+      }
+
+      tep_redirect(tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath));
+
+      break;
+
+      /*
+      case 'move_category_confirm':
+        if (isset($HTTP_POST_VARS['nmc_id']) && ($HTTP_POST_VARS['nmc_id'] != $HTTP_POST_VARS['move_to_category_id'])) {
+          $nmc_id = tep_db_prepare_input($HTTP_POST_VARS['nmc_id']);
+          $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);
+
+          $path = explode('_', tep_get_generated_category_path_ids($new_parent_id));
+
+          if (in_array($nmc_id, $path)) {
+            $messageStack->add_session('search', ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error');
+
+            tep_redirect(tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $nmc_id));
+          } else {
+            tep_db_query("update " . TABLE_NAVMENU_CATEGORIES . " set parent_id = '" . (int)$new_parent_id . "', last_modified = now() where nmc_id = '" . (int)$nmc_id . "'");
+
+            if (USE_CACHE == 'true') {
+              tep_reset_cache_block('categories');
+              tep_reset_cache_block('also_purchased');
+            }
+
+            tep_redirect(tep_href_link(FILENAME_NAVMENU, 'nPath=' . $new_parent_id . '&cID=' . $nmc_id));
+          }
+        }
+
+        break;
+      case 'move_product_confirm':
+        $nml_id = tep_db_prepare_input($HTTP_POST_VARS['nml_id']);
+        $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']);
+
+        $duplicate_check_query = tep_db_query("select count(*) as total from " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " where nml_id = '" . (int)$nml_id . "' and nmc_id = '" . (int)$new_parent_id . "'");
+        $duplicate_check = tep_db_fetch_array($duplicate_check_query);
+        if ($duplicate_check['total'] < 1) tep_db_query("update " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " set nmc_id = '" . (int)$new_parent_id . "' where nml_id = '" . (int)$nml_id . "' and nmc_id = '" . (int)$current_category_id . "'");
+
+        if (USE_CACHE == 'true') {
+          tep_reset_cache_block('categories');
+          tep_reset_cache_block('also_purchased');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_NAVMENU, 'nPath=' . $new_parent_id . '&nID=' . $nml_id));
+        break;
+*/
+    }
+  }
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+  <!-- body_text //-->
+       <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php   
+if ($action == 'new_category') {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_HEADING_NEW_CATEGORY; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('newcategory', FILENAME_NAVMENU, 'nPath=' . $nPath . '&action=insert_category', 'post'); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+<?php
+    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><?php if ($i == 0) echo TEXT_CATEGORIES_NAME; ?></td>
+            <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('nmc_name[' . $languages[$i]['id'] . ']'); ?></td>
+          </tr>
+<?php
+    }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SORT_ORDER; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('nmc_sort_order', '', 'size="2"'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main" align="right"><?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form></tr>
+<?php
+} elseif ($action == 'edit_category') {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_HEADING_EDIT_CATEGORY; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('editcategory', FILENAME_NAVMENU, 'nPath=' . $nPath . '&action=update_category', 'post') . tep_draw_hidden_field('nmc_id', $cInfo->nmc_id); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+<?php
+    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><?php if ($i == 0) echo TEXT_CATEGORIES_NAME; ?></td>
+            <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('nmc_name[' . $languages[$i]['id'] . ']', tep_nm_get_category_name($cInfo->nmc_id, $languages[$i]['id'])); ?></td>
+          </tr>
+<?php
+    }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SORT_ORDER; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('nmc_sort_order', $cInfo->nmc_sort_order, 'size="2"'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main" align="right"><?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $cInfo->nmc_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form></tr>
+<?php
+} elseif ($action == 'new_link') {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_HEADING_NEW_LINK; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('newlink', FILENAME_NAVMENU, 'nPath=' . $nPath . '&action=insert_link', 'post'); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+<?php
+    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><?php if ($i == 0) echo TEXT_LINK_NAME; ?></td>
+            <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('nml_name[' . $languages[$i]['id'] . ']'); ?></td>
+          </tr>
+<?php
+    }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_LINK_PAGE; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_nm_draw_products_pull_down('nml_url'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_STATUS; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_checkbox_field('nml_status', '', true); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SORT_ORDER; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('nml_sort_order', '', 'size="2"'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main" align="right"><?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form></tr>
+<?php
+} elseif ($action == 'edit_link') {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo TEXT_HEADING_EDIT_LINK; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('editlink', FILENAME_NAVMENU, 'nPath=' . $nPath . '&action=update_link', 'post') . tep_draw_hidden_field('nml_id', $lInfo->nml_id); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+<?php
+    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><?php if ($i == 0) echo TEXT_LINK_NAME; ?></td>
+            <td class="main"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('nml_name[' . $languages[$i]['id'] . ']', tep_nm_get_link_name($lInfo->nml_id, $languages[$i]['id'])); ?></td>
+          </tr>
+<?php
+    }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_LINK_PAGE; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_nm_draw_products_pull_down('nml_url'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_STATUS; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_checkbox_field('nml_status', $lInfo->nml_status, true); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SORT_ORDER; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('nml_sort_order', $lInfo->nml_sort_order, 'size="2"'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main" align="right"><?php echo tep_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form></tr>
+<?php
+  } else {
+?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="smallText" align="right">
+<?php
+    echo tep_draw_form('search', FILENAME_NAVMENU, '', 'get');
+    echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search');
+    echo '</form>';
+?>
+                </td>
+              </tr>
+              <tr>
+                <td class="smallText" align="right">
+<?php
+    echo tep_draw_form('goto', FILENAME_NAVMENU, '', 'get');
+    echo HEADING_TITLE_GOTO . ' ' . tep_draw_pull_down_menu('nPath', tep_nm_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"');
+    echo '</form>';
+?>
+                </td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_LINKS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $categories_count = 0;
+    $rows = 0;
+    if (isset($HTTP_GET_VARS['search'])) {
+      $search = tep_db_prepare_input($HTTP_GET_VARS['search']);
+
+      $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name, c.nmc_parent_id, c.nmc_sort_order, c.nmc_date_added from " . TABLE_NAVMENU_CATEGORIES . " c, " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd where c.nmc_id = cd.nmc_id and cd.language_id = '" . (int)$languages_id . "' and cd.nmc_name like '%" . tep_db_input($search) . "%' order by c.nmc_sort_order, cd.nmc_name");
+    } else {
+      $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name, c.nmc_parent_id, c.nmc_sort_order, c.nmc_date_added from " . TABLE_NAVMENU_CATEGORIES . " c, " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd where c.nmc_parent_id = '" . (int)$current_category_id . "' and c.nmc_id = cd.nmc_id and cd.language_id = '" . (int)$languages_id . "' order by c.nmc_sort_order, cd.nmc_name");
+    }
+
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $categories_count++;
+      $rows++;
+
+      // Get parent_id for subcategories if search
+      if (isset($search)) $nPath= $categories['nmc_parent_id'];
+
+      if ((!tep_not_null($cID) && !tep_not_null($lID) || (tep_not_null($cID) && ($cID == $categories['nmc_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+        $category_childs = array('childs_count' => tep_nm_childs_in_category_count($categories['nmc_id']));
+        $category_links = array('links_count' => tep_nm_links_in_category_count($categories['nmc_id']));
+
+        $cInfo_array = array_merge($categories, $category_childs, $category_links);
+        $cInfo = new objectInfo($cInfo_array);
+      }
+
+      if (isset($cInfo) && is_object($cInfo) && ($categories['nmc_id'] == $cInfo->nmc_id) ) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NAVMENU, tep_nm_get_path($categories['nmc_id'])) . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $categories['nmc_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_NAVMENU, tep_nm_get_path($categories['nmc_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;<b>' . $categories['nmc_name'] . '</b>'; ?></td>
+                <td class="dataTableContent" align="center">&nbsp;</td>
+                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($categories['nmc_id'] == $cInfo->nmc_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $categories['nmc_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+
+    $links_count = 0;
+    if (isset($HTTP_GET_VARS['search'])) {
+      $links_query = tep_db_query("select l.nml_id, l.nml_url, ld.nml_name, l.nml_date_added, l.nml_status, l.nml_sort_order from " . TABLE_NAVMENU_LINKS . " l, " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld, " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c where l.nml_id = ld.nml_id and ld.language_id = '" . (int)$languages_id . "' and l.nml_id = l2c.nml_id and ld.nml_name like '%" . tep_db_input($search) . "%' order by l.nml_sort_order, ld.nml_name");
+    } else {
+      $links_query = tep_db_query("select l.nml_id, l.nml_url, ld.nml_name, l.nml_date_added, l.nml_status, l.nml_sort_order from " . TABLE_NAVMENU_LINKS . " l, " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld, " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c where l2c.nmc_id = '" . (int)$current_category_id . "' and l.nml_id = l2c.nml_id and l.nml_id = ld.nml_id and ld.language_id = '" . (int)$languages_id . "' order by l.nml_sort_order, ld.nml_name");
+    }
+
+    while ($links = tep_db_fetch_array($links_query)) {
+      $links_count++;
+      $rows++;
+
+      // Get nmc_id for link if search
+      if (isset($HTTP_GET_VARS['search'])) $nPath = $links['nml_id'];
+
+      if ((!tep_not_null($cID) && !tep_not_null($lID) || (tep_not_null($lID) && ($lID == $links['nml_id']))) && !isset($lInfo) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+        $lInfo = new objectInfo($links);
+      }
+
+      if (isset($lInfo) && is_object($lInfo) && ($links['nml_id'] == $lInfo->nml_id)) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&lID=' . $links['nml_id'] . '&action=edit_link') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&lID=' . $links['nml_id']) . '\'">' . "\n";
+      }
+
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&nID=' . $links['nml_id']) . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $links['nml_name']; ?></td>
+                <td class="dataTableContent" align="center">
+<?php
+      if ($links['nml_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_NAVMENU, 'action=link_setflag&flag=0&lID=' . $links['nml_id'] . '&nPath=' . $nPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_NAVMENU, 'action=link_setflag&flag=1&lID=' . $links['nml_id'] . '&nPath=' . $nPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($lInfo) && is_object($lInfo) && ($links['nml_id'] == $lInfo->nml_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&lID=' . $links['nml_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+
+    $nPath_back = '';
+    if (sizeof($nPath_array) > 0) {
+      for ($i=0, $n=sizeof($nPath_array)-1; $i<$n; $i++) {
+        if (empty($nPath_back)) {
+          $nPath_back .= $nPath_array[$i];
+        } else {
+          $nPath_back .= '_' . $nPath_array[$i];
+        }
+      }
+    }
+
+    $nPath_back = (tep_not_null($nPath_back)) ? 'nPath=' . $nPath_back . '&' : '';
+?>
+              <tr>
+                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText"><?php echo TEXT_CATEGORIES . '&nbsp;' . $categories_count . '<br>' . TEXT_LINKS . '&nbsp;' . $links_count; ?></td>
+                    <td align="right" class="smallText"><?php if (sizeof($nPath_array) > 0) echo '<a href="' . tep_href_link(FILENAME_NAVMENU, $nPath_back . 'cID=' . $current_category_id) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>&nbsp;'; if (!isset($HTTP_GET_VARS['search'])) echo '<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&action=new_category') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>&nbsp;<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&action=new_link') . '">' . tep_image_button('button_new_link.gif', IMAGE_NEW_LINK) . '</a>'; ?>&nbsp;</td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+    $heading = array();
+    $contents = array();
+    switch ($action) {
+      case 'delete_category':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CATEGORY . '</b>');
+
+        $contents = array('form' => tep_draw_form('categories', FILENAME_NAVMENU, 'action=delete_category_confirm&nPath=' . $nPath) . tep_draw_hidden_field('nmc_id', $cInfo->nmc_id));
+        $contents[] = array('text' => TEXT_DELETE_CATEGORY_INTRO);
+        $contents[] = array('text' => '<br><b>' . $cInfo->nmc_name . '</b>');
+        if ($cInfo->childs_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_CHILDS, $cInfo->childs_count));
+        if ($cInfo->links_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_LINKS, $cInfo->links_count));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $cInfo->nmc_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+  /*
+      case 'move_category':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_CATEGORY . '</b>');
+
+        $contents = array('form' => tep_draw_form('categories', FILENAME_NAVMENU, 'action=move_category_confirm&nPath=' . $nPath) . tep_draw_hidden_field('nmc_id', $cInfo->nmc_id));
+        $contents[] = array('text' => sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name));
+        $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $cInfo->categories_name) . '<br>' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $cInfo->nmc_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+  */
+      case 'delete_link':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_LINK . '</b>');
+
+        $contents = array('form' => tep_draw_form('links', FILENAME_NAVMENU, 'action=delete_link_confirm&nPath=' . $nPath) . tep_draw_hidden_field('nml_id', $lInfo->nml_id));
+        $contents[] = array('text' => TEXT_DELETE_LINK_INTRO);
+        $contents[] = array('text' => '<br><b>' . $lInfo->nml_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&nID=' . $lInfo->nml_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+  /*
+      case 'move_product':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_PRODUCT . '</b>');
+
+        $contents = array('form' => tep_draw_form('links', FILENAME_NAVMENU, 'action=move_product_confirm&nPath=' . $nPath) . tep_draw_hidden_field('nml_id', $lInfo->nml_id));
+        $contents[] = array('text' => sprintf(TEXT_MOVE_LINKS_INTRO, $lInfo->links_name));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($lInfo->nml_id, 'product') . '</b>');
+        $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $lInfo->links_name) . '<br>' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&nID=' . $lInfo->nml_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      case 'copy_to':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
+
+        $contents = array('form' => tep_draw_form('copy_to', FILENAME_NAVMENU, 'action=copy_to_confirm&nPath=' . $nPath) . tep_draw_hidden_field('nml_id', $lInfo->nml_id));
+        $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($lInfo->nml_id, 'product') . '</b>');
+        $contents[] = array('text' => '<br>' . TEXT_CATEGORIES . '<br>' . tep_draw_pull_down_menu('nmc_id', tep_get_category_tree(), $current_category_id));
+        $contents[] = array('text' => '<br>' . TEXT_HOW_TO_COPY . '<br>' . tep_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br>' . tep_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);
+
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&nID=' . $lInfo->nml_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+  */
+      default:
+        if ($rows > 0) {
+          if (isset($cInfo) && is_object($cInfo)) { // category info box contents
+            $heading[] = array('text' => '<b>' . $cInfo->nmc_name . '</b>');
+
+            //$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $cInfo->nmc_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $cInfo->nmc_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $cInfo->nmc_id . '&action=move_category') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $cInfo->nmc_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&cID=' . $cInfo->nmc_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->nmc_date_added));
+
+            $contents[] = array('text' => '<br>' . TEXT_SUBCATEGORIES . ' ' . $cInfo->childs_count . '<br>' . TEXT_LINKS . ' ' . $cInfo->links_count);
+          } elseif (isset($lInfo) && is_object($lInfo)) { // product info box contents
+            $heading[] = array('text' => '<b>' . tep_nm_get_link_name($lInfo->nml_id, $languages_id) . '</b>');
+
+            //$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&lID=' . $lInfo->nml_id . '&action=edit_link') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&lID=' . $lInfo->nml_id . '&action=delete_link') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&nID=' . $lInfo->nml_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&lID=' . $lInfo->nml_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>'); 
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&lID=' . $lInfo->nml_id . '&action=edit_link') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_NAVMENU, 'nPath=' . $nPath . '&lID=' . $lInfo->nml_id . '&action=delete_link') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'); 
+
+            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($lInfo->nml_date_added));
+          }
+        } else { 
+          $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');
+
+          $contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_LINKS);
+        }
+        break;
+    }
+
+    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+      echo '            <td width="25%" valign="top">' . "\n";
+
+      $box = new box;
+      echo $box->infoBox($heading, $contents);
+
+      echo '            </td>' . "\n";
+    }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+<?php
+  }
+?>
+    </td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/newsletters.php
===================================================================
--- trunk/direct.openmoko.com/admin/newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,414 @@
+<?php
+/*
+  $Id: newsletters.php,v 1.1.1.1 2004/03/04 23:38:49 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'lock':
+      case 'unlock':
+        $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+        $status = (($action == 'lock') ? '1' : '0');
+
+        tep_db_query("update " . TABLE_NEWSLETTERS . " set locked = '" . $status . "' where newsletters_id = '" . (int)$newsletter_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
+        break;
+      case 'insert':
+      case 'update':
+        if (isset($HTTP_POST_VARS['newsletter_id'])) $newsletter_id = tep_db_prepare_input($HTTP_POST_VARS['newsletter_id']);
+        $newsletter_module = tep_db_prepare_input($HTTP_POST_VARS['module']);
+        $title = tep_db_prepare_input($HTTP_POST_VARS['title']);
+        $content = tep_db_prepare_input($HTTP_POST_VARS['content']);
+
+        $newsletter_error = false;
+        if (empty($title)) {
+          $messageStack->add('search', ERROR_NEWSLETTER_TITLE, 'error');
+          $newsletter_error = true;
+        }
+
+        if (empty($module)) {
+          $messageStack->add('search', ERROR_NEWSLETTER_MODULE, 'error');
+          $newsletter_error = true;
+        }
+
+        if ($newsletter_error == false) {
+          $sql_data_array = array('title' => $title,
+                                  'content' => $content,
+                                  'module' => $newsletter_module);
+
+          if ($action == 'insert') {
+            $sql_data_array['date_added'] = 'now()';
+            $sql_data_array['status'] = '0';
+            $sql_data_array['locked'] = '0';
+
+            tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array);
+            $newsletter_id = tep_db_insert_id();
+          } elseif ($action == 'update') {
+            tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array, 'update', "newsletters_id = '" . (int)$newsletter_id . "'");
+          }
+
+          tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'nID=' . $newsletter_id));
+        } else {
+          $action = 'new';
+        }
+        break;
+      case 'deleteconfirm':
+        $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+        tep_db_query("delete from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'delete':
+      case 'new': if (!isset($HTTP_GET_VARS['nID'])) break;
+      case 'send':
+      case 'confirm_send':
+        $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+        $check_query = tep_db_query("select locked from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'");
+        $check = tep_db_fetch_array($check_query);
+
+        if ($check['locked'] < 1) {
+          switch ($action) {
+            case 'delete': $error = ERROR_REMOVE_UNLOCKED_NEWSLETTER; break;
+            case 'new': $error = ERROR_EDIT_UNLOCKED_NEWSLETTER; break;
+            case 'send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
+            case 'confirm_send': $error = ERROR_SEND_UNLOCKED_NEWSLETTER; break;
+          }
+
+          $messageStack->add_session('search', $error, 'error');
+
+          tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
+        }
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/javascript/menu.js"></script>
+<?php 
+// Load Editor
+include('includes/javascript/editor.php');
+echo tep_load_html_editor();
+echo tep_insert_html_editor('content','simple','500');
+?>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($action == 'new') {
+    $form_action = 'insert';
+
+    $parameters = array('title' => '',
+                        'content' => '',
+                        'module' => '');
+
+    $nInfo = new objectInfo($parameters);
+
+    if (isset($HTTP_GET_VARS['nID'])) {
+      $form_action = 'update';
+
+      $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+      $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
+      $newsletter = tep_db_fetch_array($newsletter_query);
+
+      $nInfo->objectInfo($newsletter);
+    } elseif ($HTTP_POST_VARS) {
+      $nInfo->objectInfo($HTTP_POST_VARS);
+    }
+
+    $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
+    $directory_array = array();
+    if ($dir = dir(DIR_WS_MODULES . 'newsletters/')) {
+      while ($file = $dir->read()) {
+        if (!is_dir(DIR_WS_MODULES . 'newsletters/' . $file)) {
+          if (substr($file, strrpos($file, '.')) == $file_extension) {
+            $directory_array[] = $file;
+          }
+        }
+      }
+      sort($directory_array);
+      $dir->close();
+    }
+
+    for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) {
+      $modules_array[] = array('id' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')), 'text' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')));
+    }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr><?php echo tep_draw_form('newsletter', FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'action=' . $form_action); if ($form_action == 'update') echo tep_draw_hidden_field('newsletter_id', $nID); ?>
+        <td><table border="0" cellspacing="0" cellpadding="2" width="80%">
+          <tr>
+            <td class="main"><?php echo TEXT_NEWSLETTER_MODULE; ?></td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('module', $modules_array, $nInfo->module); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_NEWSLETTER_TITLE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('title', $nInfo->title, '', true); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+
+
+            <td class="main" valign="top"><?php echo TEXT_NEWSLETTER_CONTENT; ?></td>
+            <td class="main"><?php echo tep_draw_textarea_field('content', 'soft', '100%', '20', $nInfo->content,' style="width: 100%" mce_editable="true"'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" align="right"><?php echo (($form_action == 'insert') ? tep_image_submit('button_save.gif', IMAGE_SAVE) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . (isset($HTTP_GET_VARS['nID']) ? 'nID=' . $HTTP_GET_VARS['nID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </form></tr>
+<?php
+  } elseif ($action == 'preview') {
+    $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+    $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
+    $newsletter = tep_db_fetch_array($newsletter_query);
+
+    $nInfo = new objectInfo($newsletter);
+?>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+      <tr>
+        <td><tt><?php echo nl2br($nInfo->content); ?></tt></td>
+      </tr>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+  } elseif ($action == 'send') {
+    $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+    $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
+    $newsletter = tep_db_fetch_array($newsletter_query);
+
+    $nInfo = new objectInfo($newsletter);
+
+    include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    $module_name = $nInfo->module;
+    $module = new $module_name($nInfo->title, $nInfo->content);
+?>
+      <tr>
+        <td><?php if ($module->show_choose_audience) { echo $module->choose_audience(); } else { echo $module->confirm(); } ?></td>
+      </tr>
+<?php
+  } elseif ($action == 'confirm') {
+    $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+    $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
+    $newsletter = tep_db_fetch_array($newsletter_query);
+
+    $nInfo = new objectInfo($newsletter);
+
+    include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    $module_name = $nInfo->module;
+    $module = new $module_name($nInfo->title, $nInfo->content);
+?>
+      <tr>
+        <td><?php echo $module->confirm(); ?></td>
+      </tr>
+<?php
+  } elseif ($action == 'confirm_send') {
+    $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']);
+
+    $newsletter_query = tep_db_query("select newsletters_id, title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
+    $newsletter = tep_db_fetch_array($newsletter_query);
+
+    $nInfo = new objectInfo($newsletter);
+
+    include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    include(DIR_WS_MODULES . 'newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.')));
+    $module_name = $nInfo->module;
+    $module = new $module_name($nInfo->title, $nInfo->content);
+?>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'ani_send_email.gif', IMAGE_ANI_SEND_EMAIL); ?></td>
+            <td class="main" valign="middle"><b><?php echo TEXT_PLEASE_WAIT; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  tep_set_time_limit(0);
+  flush();
+  $module->send($nInfo->newsletters_id);
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><font color="#ff0000"><b><?php echo TEXT_FINISHED_SENDING_EMAILS; ?></b></font></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NEWSLETTERS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SIZE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_MODULE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SENT; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $newsletters_query_raw = "select newsletters_id, title, length(content) as content_length, module, date_added, date_sent, status, locked from " . TABLE_NEWSLETTERS . " order by date_added desc";
+    $newsletters_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $newsletters_query_raw, $newsletters_query_numrows);
+    $newsletters_query = tep_db_query($newsletters_query_raw);
+    while ($newsletters = tep_db_fetch_array($newsletters_query)) {
+    if ((!isset($HTTP_GET_VARS['nID']) || (isset($HTTP_GET_VARS['nID']) && ($HTTP_GET_VARS['nID'] == $newsletters['newsletters_id']))) && !isset($nInfo) && (substr($action, 0, 3) != 'new')) {
+        $nInfo = new objectInfo($newsletters);
+      }
+
+      if (isset($nInfo) && is_object($nInfo) && ($newsletters['newsletters_id'] == $nInfo->newsletters_id) ) {
+        echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '\'">' . "\n";
+      } else {
+        echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id'] . '&action=preview') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $newsletters['title']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo number_format($newsletters['content_length']) . ' bytes'; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $newsletters['module']; ?></td>
+                <td class="dataTableContent" align="center"><?php if ($newsletters['status'] == '1') { echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK); } else { echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS); } ?></td>
+                <td class="dataTableContent" align="center"><?php if ($newsletters['locked'] > 0) { echo tep_image(DIR_WS_ICONS . 'locked.gif', ICON_LOCKED); } else { echo tep_image(DIR_WS_ICONS . 'unlocked.gif', ICON_UNLOCKED); } ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($nInfo) && is_object($nInfo) && ($newsletters['newsletters_id'] == $nInfo->newsletters_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $newsletters['newsletters_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $newsletters_split->display_count($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $newsletters_split->display_links($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                  <tr>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'action=new') . '">' . tep_image_button('button_new_newsletter.gif', IMAGE_NEW_NEWSLETTER) . '</a>'; ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . $nInfo->title . '</b>');
+
+      $contents = array('form' => tep_draw_form('newsletters', FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $nInfo->title . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($nInfo)) {
+        $heading[] = array('text' => '<b>' . $nInfo->title . '</b>');
+
+        if ($nInfo->locked > 0) {
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=send') . '">' . tep_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=unlock') . '">' . tep_image_button('button_unlock.gif', IMAGE_UNLOCK) . '</a>');
+        } else {
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview') . '">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=lock') . '">' . tep_image_button('button_lock.gif', IMAGE_LOCK) . '</a>');
+        }
+        $contents[] = array('text' => '<br>' . TEXT_NEWSLETTER_DATE_ADDED . ' ' . tep_date_short($nInfo->date_added));
+        if ($nInfo->status == '1') $contents[] = array('text' => TEXT_NEWSLETTER_DATE_SENT . ' ' . tep_date_short($nInfo->date_sent));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/options_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/options_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/options_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,467 @@
+<?php
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+  
+  if (tep_not_null($action)) {
+    switch ($action) {
+      // These are the actions that some activity must occur on before presenting the next page
+      case 'save_category':
+        $sort_order = tep_db_prepare_input($HTTP_POST_VARS['new_category_sort_order']);
+        $category_name = tep_db_prepare_input($HTTP_POST_VARS['new_category_name']);
+        $category_description = tep_db_prepare_input($HTTP_POST_VARS['new_category_description']);
+        $sql_data_array['options_categories_sort_order'] = $sort_order;
+        $sql_data_array['options_categories_name'] = $category_name;
+        $sql_data_array['options_categories_description'] = $category_description;
+        $sql_data_array['options_categories_date_added'] = 'now()';
+        $sql_data_array['options_categories_last_modified'] = 'now()';
+        tep_db_perform('options_categories', $sql_data_array);
+        $HTTP_GET_VARS['ocID'] = tep_db_insert_id();
+        $action = '';
+        break;
+        
+      case 'update_category':
+        $sort_order = tep_db_prepare_input($HTTP_POST_VARS['edit_category_sort_order']);
+        $category_name = tep_db_prepare_input($HTTP_POST_VARS['edit_category_name']);
+        $category_description = tep_db_prepare_input($HTTP_POST_VARS['edit_category_description']);
+        $sql_data_array['options_categories_sort_order'] = $sort_order;
+        $sql_data_array['options_categories_name'] = $category_name;
+        $sql_data_array['options_categories_description'] = $category_description;
+        $sql_data_array['options_categories_last_modified'] = 'now()';
+        tep_db_perform('TABLE_OPTION_CATEGORIES', $sql_data_array, 'update', "options_categories_id = '" . (int)$HTTP_POST_VARS['oc_edit_id'] . "'");
+        $HTTP_GET_VARS['ocID'] = $HTTP_POST_VARS['oc_edit_id'];
+        $action = '';
+        break;
+        
+      case 'confirm_category_delete':
+        $oc_delete_id = $HTTP_POST_VARS['oc_delete_id'];
+        $options_query = tep_db_query('select options_id from options where options_categories_id =\'' . (int)$oc_delete_id . '\' ');
+        while ($o = tep_db_fetch_array($options_query)) {
+          tep_db_query("delete from options_values where options_id = '" . $o['options_id'] . "'");
+          tep_db_query("delete from options_values_to_products_id where options_id = '" . $o['options_id'] . "'");
+        }
+        tep_db_query("delete from options where options_categories_id = '" . $oc_delete_id . "'");
+        tep_db_query("delete from TABLE_OPTION_CATEGORIES where options_categories_id = '" . $oc_delete_id . "'");
+        $HTTP_GET_VARS['ocID'] = '';
+        $action = '';
+        break;
+        
+      case 'save_option':
+        $sort_order = tep_db_prepare_input($HTTP_POST_VARS['new_option_sort_order']);
+        $option_name = tep_db_prepare_input($HTTP_POST_VARS['new_option_name']);
+        $option_type = $HTTP_POST_VARS['new_option_type'];
+        $ocID = $HTTP_POST_VARS['ocID'];
+        $sql_data_array['options_sort_order'] = $sort_order;
+        $sql_data_array['options_name'] = $option_name;
+        $sql_data_array['options_type'] = $option_type;
+        $sql_data_array['options_categories_id'] = $ocID;
+        $sql_data_array['options_date_added'] = 'now()';
+        $sql_data_array['options_last_modified'] = 'now()';
+        tep_db_perform('options', $sql_data_array);
+        $oID = tep_db_insert_id();
+        $HTTP_GET_VARS['oID'] = $oID;
+        $HTTP_GET_VARS['ocID'] = $ocID;
+        $action = 'list_options';
+        // special case of a option type 1 - text input
+        if ( $option_type  == 1 ) {
+          $sql_data_array = array();
+          $sql_data_array['options_values_name'] = 'text input field';
+          $sql_data_array['options_id'] = $oID;
+          tep_db_perform('options_values', $sql_data_array);
+        }
+        break;
+        
+      case 'update_option':
+        $sort_order = tep_db_prepare_input($HTTP_POST_VARS['new_option_sort_order']);
+        $option_name = tep_db_prepare_input($HTTP_POST_VARS['new_option_name']);
+        $option_type = $HTTP_POST_VARS['new_option_type'];
+        $ocID = $HTTP_POST_VARS['ocID'];
+        $sql_data_array['options_sort_order'] = $sort_order;
+        $sql_data_array['options_name'] = $option_name;
+        $sql_data_array['options_type'] = $option_type;
+        $sql_data_array['options_categories_id'] = $ocID;
+        $sql_data_array['options_date_added'] = 'now()';
+        $sql_data_array['options_last_modified'] = 'now()';
+        tep_db_perform('options', $sql_data_array, 'update', "options_id = '" . (int)$HTTP_POST_VARS['o_edit_id'] . "'");
+        $HTTP_GET_VARS['oID'] = tep_db_insert_id();
+        $HTTP_GET_VARS['ocID'] = $ocID;
+        $action = 'list_options';
+        break;
+        
+      case 'confirm_option_delete':
+        $o_delete_id = $HTTP_POST_VARS['o_delete_id'];
+        $ocID = $HTTP_POST_VARS['ocID'];
+        tep_db_query("delete from options_values where options_id = '" . $o_delete_id . "'");
+        tep_db_query("delete from options_values_to_products_id where options_id = '" . $o_delete_id . "'");
+        tep_db_query("delete from options where options_id = '" . $o_delete_id . "'");
+        $HTTP_GET_VARS['oID'] = '';
+        $HTTP_GET_VARS['ocID'] = $ocID;
+        $action = 'list_options';
+        break;
+     
+     case 'save_values':
+        $option_type = $HTTP_POST_VARS['option_type'];
+        $ocID = $HTTP_POST_VARS['ocID'];
+        $oID = $HTTP_POST_VARS['oID'];
+        switch ($option_type) {
+          case 0:
+          case 2:
+          case 3:
+            if ( isset($HTTP_POST_VARS['values_select']) ) {
+              foreach ($HTTP_POST_VARS['values_select'] as $k => $v) {
+                $v = trim($v);
+                if ( $v == '' ) {
+                  tep_db_query("delete from options_values where options_values_id = '" . $HTTP_POST_VARS['values_id'][$k] . "'");
+                  tep_db_query("delete from options_values_to_products_id where options_values_id = '" . $HTTP_POST_VARS['values_id'][$k] . "'");
+                } elseif ( $v != $HTTP_POST_VARS['values_old'][$k] || $HTTP_POST_VARS['values_prefix'][$k] != $HTTP_POST_VARS['values_prefix_old'][$k] || $HTTP_POST_VARS['values_price'][$k] != $HTTP_POST_VARS['values_price_old'][$k] ) {
+                  $sql_data_array['options_values_name'] = $v;
+                  $sql_data_array['options_values_prefix'] = $HTTP_POST_VARS['values_prefix'][$k];
+                  $sql_data_array['options_values_price'] = $HTTP_POST_VARS['values_price'][$k];
+                  tep_db_perform('options_values', $sql_data_array, 'update', "options_values_id = '" . (int)$HTTP_POST_VARS['values_id'][$k] . "'");
+                }
+              }
+            }
+            foreach ($HTTP_POST_VARS['values_select_new'] as $k => $v) {
+              $v = trim($v);
+              if ( $v != '' ) {
+                $sql_data_array['options_values_name'] = $v;
+                $sql_data_array['options_id'] = $oID;
+                $sql_data_array['options_values_prefix'] = $HTTP_POST_VARS['values_prefix_new'][$k];
+                  $sql_data_array['options_values_price'] = $HTTP_POST_VARS['values_price_new'][$k];
+                  tep_db_perform('options_values', $sql_data_array);
+              }
+            }
+            break;
+          
+          case 1:
+            $sql_data_array['options_length'] = $HTTP_POST_VARS['values_text_length'];
+            tep_db_perform('options', $sql_data_array, 'update', "options_id = '" . (int)$oID . "'");
+            break;
+        
+        }
+        $HTTP_GET_VARS['oID'] = $oID;
+        $HTTP_GET_VARS['ocID'] = $ocID;
+        $action = 'list_options';
+        break;
+        
+    }
+  }
+  
+  // Draw a pulldown for Option Types
+  function draw_optiontype_pulldown($name, $default = '') {
+    $values = array();
+    $values[] = array('id' => 0, 'text' => 'Select');
+    $values[] = array('id' => 1, 'text' => 'Text');
+    $values[] = array('id' => 2, 'text' => 'Radio');
+    $values[] = array('id' => 3, 'text' => 'Checkbox');
+    return tep_draw_pull_down_menu($name, $values, $default);
+  }
+
+
+  // Translate option_type_values to english string
+  function translate_type_to_name($opt_type) {
+    if ($opt_type == 0) return 'Select';
+    if ($opt_type == 1) return 'Text';
+    if ($opt_type == 2) return 'Radio';
+    if ($opt_type == 3) return 'Checkbox';
+    return 'Error ' . $opt_type;
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top">
+      <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+      <!-- left_navigation //-->
+      <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+      <!-- left_navigation_eof //-->
+      </table>
+    </td>
+    <!-- body_text //-->
+    <td width="100%" valign="top">
+<?php
+  switch ($action) {
+    // use the same row display for all of the related functions
+    case 'new_option':
+    case 'edit_option':
+    case 'delete_option':
+    case 'edit_values':
+    case 'list_options':
+?>
+      <table border="0" width="100%" cellspacing="0" cellpadding="2">
+        <tr>
+          <td class="pageHeading"><?php echo CATEGORY_OPTION_HEADING_TITLE; ?></td>
+        </tr>
+        <tr>
+          <td valign="top">
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_OPTIONS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SORT_ORDER; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_OPTION_TYPE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+      $ocID = $HTTP_GET_VARS['ocID'];
+      if ( isset($HTTP_GET_VARS['oID']) ) {
+        $oID = $HTTP_GET_VARS['oID'];
+      } else {
+        $oID = '';
+      }
+      $options_categories_query_raw = 'select options_id, options_name, options_sort_order, options_type, options_length, options_date_added, options_last_modified from options where options_categories_id =\'' . (int)$ocID . '\' order by options_sort_order ';
+      $options_categories_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $options_categories_query_raw, $options_categories_query_numrows);
+      $options_categories_query = tep_db_query($options_categories_query_raw);
+      while ($o = tep_db_fetch_array($options_categories_query)) {
+        if ( $oID == '' ) $oID = $o['options_id'];
+        if ( $oID == $o['options_id'] ) {
+          $oInfo = new objectInfo($o);
+          echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'action=list_options&ocID=' . $ocID . '&oID=' . $o['options_id']) . '\'">' . "\n";
+        } else {
+          echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'action=list_options&ocID=' . $ocID . '&oID=' . $o['options_id']) . '\'">' . "\n";
+        }
+?>
+                <td class="dataTableContent"><?php echo $o['options_name']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $o['options_sort_order']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo translate_type_to_name($o['options_type']); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( $oID == $o['options_id'] ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'action=list_options&ocID=' . $ocID . '&oID=' . $o['options_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+      }
+?>
+              
+<?php
+      break;
+      
+    // use the same row display for all of the related functions
+    default:
+?>
+      <table border="0" width="100%" cellspacing="0" cellpadding="2">
+        <tr>
+          <td class="pageHeading"><?php echo CATEGORY_OPTION_HEADING_TITLE; ?></td>
+        </tr>
+        <tr>
+          <td valign="top">
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_OPTIONS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SORT_ORDER; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+      if ( isset($HTTP_GET_VARS['ocID']) ) {
+        $ocID = $HTTP_GET_VARS['ocID'];
+      } else {
+        $ocID = '';
+      }
+      $options_categories_query_raw = 'select options_categories_id, options_categories_name, options_categories_sort_order, options_categories_date_added, options_categories_last_modified from options_categories order by options_categories_sort_order ';
+      $options_categories_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $options_categories_query_raw, $options_categories_query_numrows);
+      $options_categories_query = tep_db_query($options_categories_query_raw);
+      while ($oc = tep_db_fetch_array($options_categories_query)) {
+        if ( $ocID == '' ) $ocID = $oc['options_categories_id'];
+        if ( $ocID == $oc['options_categories_id'] ) {
+          $ocInfo = new objectInfo($oc);
+          echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'ocID=' . $oc['options_categories_id']) . '\'">' . "\n";
+        } else {
+          echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'ocID=' . $oc['options_categories_id']) . '\'">' . "\n";
+        }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'action=list_options&ocID=' . $oc['options_categories_id']) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;' . $oc['options_categories_name']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $oc['options_categories_sort_order']; ?></td>
+                <td class="dataTableContent" align="right"><?php if ( $ocID == $oc['options_categories_id'] ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, tep_get_all_get_params(array('ocID')) . 'ocID=' . $oc['options_categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+      }
+      break;
+  }
+  // End of Switch - Back to commom code
+?>
+              <tr>
+                <td colspan="4">
+                  <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                    <tr>
+                      <td class="smallText" valign="top"><?php echo $options_categories_split->display_count($options_categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF); ?></td>
+<?php
+                      if ($action != '') echo '<td><a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, '', 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a></td>';
+?>
+                      <td class="smallText" align="right"><?php echo $options_categories_split->display_links($options_categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
+                    </tr>
+                  </table>
+                </td>
+              </tr>
+            </table>
+          </td>
+          <td width="25%" valign="top">
+<?php
+  $heading = array();
+  $contents = array();
+  switch ($action) {
+        case 'new_option':
+          $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_OPTION . '</b>');
+          $contents = array('form' => tep_draw_form('new_option', FILENAME_OPTION_CATEGORIES, 'action=save_option'));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_OPTION_NAME . tep_draw_input_field('new_option_name', '', 'size="32"'));
+          $contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . tep_draw_input_field('new_option_sort_order', '', 'size="3"'));
+          $contents[] = array('text' => '<br>' . TEXT_OPTION_TYPE . draw_optiontype_pulldown('new_option_type'));
+          $contents[] = array('text' => tep_draw_hidden_field('ocID', $ocID));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, '') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+          break;
+          
+        case 'edit_option':
+          $heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_OPTION . '</b>');
+          $contents = array('form' => tep_draw_form('edit_option', FILENAME_OPTION_CATEGORIES, 'action=update_option'));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_OPTION_NAME . tep_draw_input_field('new_option_name', $oInfo->options_name, 'size="32"'));
+          $contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . tep_draw_input_field('new_option_sort_order', $oInfo->options_sort_order, 'size="3"'));
+          $contents[] = array('text' => '<br>' . TEXT_OPTION_TYPE . draw_optiontype_pulldown('new_option_type', $oInfo->options_type));
+          $contents[] = array('text' => tep_draw_hidden_field('ocID', $ocID) . tep_draw_hidden_field('o_edit_id', $oInfo->options_id));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, '') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+          break;
+          
+        case 'delete_option':
+          $heading[] = array('text' => '<b>' . TEXT_HEADING_DELETE_OPTION . '</b>');
+          $contents = array('form' => tep_draw_form('delete_option', FILENAME_OPTION_CATEGORIES, 'action=confirm_option_delete'));
+          $contents[] = array('text' => TEXT_DELETE_OPTION_INFO);
+          $contents[] = array('text' => '<br><b>' . $oInfo->options_name . '</b>');
+          $contents[] = array('text' => tep_draw_hidden_field('o_delete_id', $oInfo->options_id) . tep_draw_hidden_field('ocID', $ocID));
+          $contents[] = array('text' => TEXT_DELETE_OPTION_WARNING);
+          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, '') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+          break;
+          
+        case 'edit_values':
+          $heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_VALUES . '</b>');
+          $contents = array('form' => tep_draw_form('option_values', FILENAME_OPTION_CATEGORIES, 'action=save_values'));
+          $contents[] = array('text' => TEXT_EDIT_VALUES_INFO);
+          switch ($oInfo->options_type) {
+            case 0:
+            case 2:
+            case 3:
+              $options_values_query_raw = 'select options_values_id, options_values_name, options_values_prefix, options_values_price from options_values where options_id = \'' . $oInfo->options_id . '\' order by options_values_id';
+              $options_values_query = tep_db_query($options_values_query_raw);
+              $i = 0;
+              while ($ov = tep_db_fetch_array($options_values_query)) {
+                $i++;
+                $contents[] = array('text' => '<br>' . tep_draw_input_field('values_select['. $i .']', stripslashes($ov['options_values_name']), 'size="35"') . tep_draw_hidden_field('values_id['. $i .']', $ov['options_values_id']) . tep_draw_hidden_field('values_old['. $i .']', stripslashes($ov['options_values_name'])));
+                $contents[] = array('text' => 'Default&nbsp;(&nbsp;+/-&nbsp;)&nbsp;' . tep_draw_input_field('values_prefix['. $i .']', $ov['options_values_prefix'] == '' ? '+' : $ov['options_values_prefix'], 'size="1"') . '&nbsp;Price&nbsp;' . tep_draw_input_field('values_price['. $i .']', $ov['options_values_price'], 'size="10"') . 
+                                    tep_draw_hidden_field('values_prefix_old['. $i .']', $ov['options_values_prefix']) . tep_draw_hidden_field('values_price_old['. $i .']', $ov['options_values_price']));
+              }
+              for ($i = 0; $i < 5; $i++) {
+                $contents[] = array('text' => '<br>' . tep_draw_input_field('values_select_new['. $i .']', '', 'size="35"'));                 
+                $contents[] = array('text' => 'Default&nbsp;(&nbsp;+/-&nbsp;)&nbsp;' . tep_draw_input_field('values_prefix_new['. $i .']', '+', 'size="1"') . '&nbsp;Price&nbsp;' . tep_draw_input_field('values_price_new['. $i .']', '0', 'size="10"'));
+              }
+              break;
+            case 1:
+              $contents[] = array('text' => '<br>' . TEXT_VALUE_TEXT_FIELD . tep_draw_input_field('values_text_length', $oInfo->options_length, 'size="3"'));
+              break;
+          }
+          $contents[] = array('text' => tep_draw_hidden_field('oID', $oInfo->options_id) . tep_draw_hidden_field('ocID', $ocID) . tep_draw_hidden_field('option_type', $oInfo->options_type));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, '') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+          break;
+          
+        case 'list_options':
+          if ( $oID == '' ) {
+            $heading[] = array('text' => '<b>' . TEXT_HEADING_EMPTY_OPTION . '</b>');
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'action=new_option&ocID=' . $ocID) . '">' . tep_image_button('button_new.gif', IMAGE_NEW));
+          } else {
+            $heading[] = array('text' => '<b>' . $ocInfo->options_categories_name . '</b>');
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'action=edit_option&ocID=' . $ocID . '&oID=' . $oInfo->options_id) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'action=delete_option&ocID=' . $ocID . '&oID=' . $oInfo->options_id) . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($oInfo->options_date_added));
+            $contents[] = array('text' => '<br>' . TEXT_LAST_MODIFIED . ' ' . tep_date_short($oInfo->options_last_modified));
+            $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'action=edit_values&ocID=' . $ocID . '&oID=' . $oInfo->options_id) . '">' . tep_image_button('button_edit_values.gif', 'Edit Options Values') . '</a>');
+            switch ($oInfo->options_type) {
+              case 0:
+              case 2:
+              case 3:
+                $options_values_query_raw = 'select options_values_id, options_values_name from options_values where options_id = \'' . $oInfo->options_id . '\' order by options_values_id';
+                $options_values_query = tep_db_query($options_values_query_raw);
+                while ($ov = tep_db_fetch_array($options_values_query)) {
+                  $contents[] = array('text' => '<br>' . stripslashes($ov['options_values_name']));                 
+                }
+                break;
+              case 1:
+                $contents[] = array('text' => '<br>' . TEXT_VALUE_TEXT_FIELD . ' ' . $oInfo->options_length);
+                break;
+            }
+            $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'action=new_option&ocID=' . $ocID) . '">' . tep_image_button('button_new.gif', IMAGE_NEW) . '</a>');
+          }
+          break;
+        
+        case 'new_category':
+          $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_CATEGORY . '</b>');
+          $contents = array('form' => tep_draw_form('new_options_category', FILENAME_OPTION_CATEGORIES, 'action=save_category'));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_CATEGORY_NAME . tep_draw_input_field('new_category_name', '', 'size="32"'));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_CATEGORY_DESCRIPTION . tep_draw_textarea_field('new_category_description', 'soft', '40', '5', ''));
+          $contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . tep_draw_input_field('new_category_sort_order', '', 'size="3"'));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, '') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+          break;
+          
+        case 'edit_category':
+          $heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_CATEGORY . '</b>');
+          $contents = array('form' => tep_draw_form('edit_options_category', FILENAME_OPTION_CATEGORIES, 'action=update_category'));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_CATEGORY_NAME . tep_draw_input_field('edit_category_name', $ocInfo->options_categories_name, 'size="32"'));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_CATEGORY_DESCRIPTION . tep_draw_textarea_field('edit_category_description', 'soft', '40', '5', $ocInfo->options_categories_description, 'size="32"'));
+          $contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . tep_draw_input_field('edit_category_sort_order', $ocInfo->options_categories_sort_order, 'size="3"'));
+          $contents[] = array('text' => tep_draw_hidden_field('oc_edit_id', $ocInfo->options_categories_id));
+          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, '') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+          break;
+          
+        case 'delete_category':
+          $heading[] = array('text' => '<b>' . TEXT_HEADING_DELETE_CATEGORY . '</b>');
+          $contents = array('form' => tep_draw_form('edit_options_category', FILENAME_OPTION_CATEGORIES, 'action=confirm_category_delete'));
+          $contents[] = array('text' => TEXT_DELETE_CATEGORY_INFO);
+          $contents[] = array('text' => '<br><b>' . $ocInfo->options_categories_name . '</b>');
+          $contents[] = array('text' => tep_draw_hidden_field('oc_delete_id', $ocInfo->options_categories_id));
+          $contents[] = array('text' => TEXT_DELETE_CATEGORY_WARNING);
+          $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, '') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+          break;
+          
+        default:
+          if ( $ocID == '' ) {
+            $heading[] = array('text' => '<b>' . TEXT_HEADING_EMPTY_CATEGORY . '</b>');
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'ocID=' . $ocInfo->options_categories_id . '&action=new_category') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>');
+          } else {
+            $heading[] = array('text' => '<b>' . $ocInfo->options_categories_name . '</b>');
+            if ( $ocID != 0) {
+              $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'ocID=' . $ocInfo->options_categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'ocID=' . $ocInfo->options_categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+            }
+            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($ocInfo->options_categories_date_added));
+            $contents[] = array('text' => '<br>' . TEXT_LAST_MODIFIED . ' ' . tep_date_short($ocInfo->options_categories_last_modified));
+            $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
+            $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_OPTION_CATEGORIES, 'ocID=' . $ocInfo->options_categories_id . '&action=new_category') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>');
+          }
+        break;
+  }
+  $box = new box;
+  echo $box->infoBox($heading, $contents);
+?>
+          </td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/orderlist-styles.css
===================================================================
--- trunk/direct.openmoko.com/admin/orderlist-styles.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/orderlist-styles.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+/* stylesheet for orderlist */
+body, html {
+margin: 0;
+padding: 1em 0;
+text-align: center;
+font-family: arial, sans-serif;
+font-size: 79%;
+}
+table {
+margin: 1em auto;
+border: 1px solid #e00;
+width: 95%;
+font-size: 1em;
+}
+td {
+padding: 0.2em 0.3em;
+font-size: 1em;
+}
+td {
+border: 1px solid #aaa;
+white-space: nowrap;
+color: black;
+background: #f6f6f6;
+}
+tr.headers td {
+color: black;
+background: #fe6;
+white-space: nowrap;
+border: 1px #aaa solid;
+font-weight: bold;
+text-align: center;
+}
+tr.headers td.orderStatus{
+background: #eee;
+text-align: right;
+}
+h1 {
+color: #09c;
+font-size: 2.5em;
+background: #eee;
+border: solid #e00 1px;
+border-width: 2px  0;
+width: 6em;
+margin: 0 auto;
+}
+td.orderNr, td.price, td.qty {
+text-align: right;
+}
+span.orderStat {
+color: #d00;
+}
+span.date {
+float: left;
+}
+/* column width's (should add up to 100%) */
+td.orderNr, td.price {
+width: 7%;
+}
+td.model {
+width: 20%;
+}
+td.name {
+width: 30%;
+}
+td.qty, td.chk {
+width: 5%;
+}
+td.notes {
+width: 26%
+}
+ at media print {
+  body, html, table {
+  font-size: 7pt;
+  }
+}

Added: trunk/direct.openmoko.com/admin/orderlist.php
===================================================================
--- trunk/direct.openmoko.com/admin/orderlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/orderlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,242 @@
+<?php
+/*
+  $Id: orderlist.php,v 1.112 2003/06/29 22:50:52 vj Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+/*
+  Original Credits
+ ==================
+
+  Made by zlack, www.partshop.nl
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+
+  Since i order each day (i keep no stock) i found it very much
+  work to open each order to see what someone ordered.
+
+  This little script does that for me, and shows everything nice in tables,
+  so i can e-mail the output to my distributor :)
+  Questions, comments, thank you's and so on: zlack AT partshop.nl
+  
+  2004/02/16
+  Some modifications by Paul Mathot (panda.nl)
+============================================
+
+  2004/04/13 => orderlist2
+  Modifications by Heiko Oesterling
+
+  I tried to integrate this nice script into the administration.
+
+
+============================================
+  2004/04/14
+  New modifications by zlack (www.partshop.nl)
+  -Now you can select which order status to display even if you have a dozen statusses (like i have :P)
+  -Cleaned up the code a bit
+  -Changed the stylesheet (damn i hate pink)
+  -Some other minor things
+  
+============================================
+ 2004/04/15
+ New modifications by Heiko Oesterling
+ - Select status displayed in the selected language
+ - Now you can download the orderlist
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $orders_statuses = array();
+  $orders_status_array = array();
+  $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
+  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+    $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
+                               'text' => $orders_status['orders_status_name']);
+    $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
+  }
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    if  ($action == 'download') {
+      ob_clean();
+
+      // Output as CSV-file
+      $filename = 'orderlist' . date('Ymd-His');  
+
+      header("Content-Transfer-Encoding: ascii");
+      header("Content-Disposition: attachment; filename=$filename.csv");
+      header("Content-Type: text/comma-separated-values");
+
+      echo '"' . TABLE_HEADING_ORDER_ID . '","' . TABLE_HEADING_PRODUCTS_MODEL . '","' . TABLE_HEADING_PRODUCTS_NAME . '","' . TABLE_HEADING_PRICE . '","' . TABLE_HEADING_QUANTITY . '","' . TABLE_HEADING_NOTES . '","' . TABLE_HEADING_CHK . '"' . "\n";
+
+      if (isset($HTTP_GET_VARS['status']) && tep_not_null($HTTP_GET_VARS['status'])) {
+  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+  $orders_query_raw = "select o.orders_id, op.products_model, op.products_name, op.products_price, op.products_quantity from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_PRODUCTS . " op on op.orders_id = o.orders_id where o.orders_status = '" . (int)$status . "' order by o.orders_id DESC";
+      } else {
+  $orders_query_raw = "select o.orders_id, op.products_model, op.products_name, op.products_price, op.products_quantity from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_PRODUCTS . " op on op.orders_id = o.orders_id order by o.orders_id DESC";
+      }
+
+      $orders_query = tep_db_query($orders_query_raw);
+
+      while ($orders = tep_db_fetch_array($orders_query)) {
+  echo '"' . $orders['orders_id'] . '","' . $orders['products_model'] . '","' . $orders['products_name'] . '","' . $orders['products_price'] . '","' . $orders['products_quantity'] . '"," "," "' . "\n"; 
+      }
+
+      exit();
+    }
+  }
+
+  include(DIR_WS_CLASSES . 'order.php');
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<?php
+  if (($action != 'print')) {
+?>
+<!-- header //-->
+<?php
+  require(DIR_WS_INCLUDES . 'header.php');
+?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+<?php
+  }
+?>
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"><?php
+  if (($action != 'print')) {
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr><?php echo tep_draw_form('status', FILENAME_ORDERLIST, '', 'get'); ?>
+                <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td>
+              </form></tr>            
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" align="center"><?php echo HEADING_TITLE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ORDER_ID; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PRODUCTS_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_QUANTITY; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_NOTES; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_CHK; ?></td>
+              </tr>
+<?php
+    if (isset($HTTP_GET_VARS['status']) && tep_not_null($HTTP_GET_VARS['status'])) {
+      $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+      $orders_query_raw = "select o.orders_id, op.products_model, op.products_name, op.products_price, op.products_quantity from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_PRODUCTS . " op on op.orders_id = o.orders_id where o.orders_status = '" . (int)$status . "' order by o.orders_id DESC";
+    } else {
+      $orders_query_raw = "select o.orders_id, op.products_model, op.products_name, op.products_price, op.products_quantity from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_PRODUCTS . " op on op.orders_id = o.orders_id order by o.orders_id DESC";
+    }
+
+    $orders_query = tep_db_query($orders_query_raw);
+
+    while ($orders = tep_db_fetch_array($orders_query)) {
+?>
+              <tr class="dataTableRow">
+                <td class="dataTableContent" align="center"><?php echo $orders['orders_id']; ?></td>
+                <td class="dataTableContent"><?php echo $orders['products_model']; ?></td>
+                <td class="dataTableContent"><?php echo $orders['products_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $currencies->format($orders['products_price']); ?></td>
+                <td class="dataTableContent" align="center"><?php echo $orders['products_quantity']; ?></td>
+    <td class="dataTableContent">&nbsp;</td>
+                <td class="dataTableContent">&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+      </tr>
+<?php
+  if (($action != 'print')) {
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+      <td class="smallText" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERLIST, tep_get_all_get_params(array('action')) . 'action=download') . '">'. tep_image_button('button_download.gif',TEXT_DOWNLOAD) .'</a>'; ?>&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_ORDERLIST, tep_get_all_get_params(array('action')) . 'action=print') . '">'.tep_image_button('button_print_page.gif',TEXT_PRINT).'</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<?php
+  if (($action != 'print')) {
+?>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<?php
+  }
+?>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,818 @@
+<?php
+/*
+  $Id: orders.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_FUNCTIONS . 'c_orders.php');
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+  // New "Status History" table has different format.
+  $OldNewStatusValues = (tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "old_value") && tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "new_value"));
+  $CommentsWithStatus = tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "comments");
+  $SeparateBillingFields = tep_field_exists(TABLE_ORDERS, "billing_name");
+
+  $orders_statuses = array();
+  $orders_status_array = array();
+  $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
+  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+    $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
+                               'text' => $orders_status['orders_status_name']);
+    $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
+  }
+
+  $orders_ship_method = array();
+  $orders_ship_method_array = array();
+  $orders_ship_method_query = tep_db_query("select ship_method from orders_ship_methods where ship_method_language = '" . (int)$languages_id . "'");
+  while ($orders_ship_methods = tep_db_fetch_array($orders_ship_method_query)) {
+    $orders_ship_method[] = array('id'   => $orders_ship_methods['ship_method'],
+                                  'text' => $orders_ship_methods['ship_method']);
+    $orders_ship_method_array[$orders_ship_methods['ship_method']] = $orders_ship_methods['ship_method'];
+  }
+
+  $orders_pay_method = array();
+  $orders_pay_method_array = array();
+  $orders_pay_method_query = tep_db_query("select pay_method from orders_pay_methods where pay_method_language =  '" . (int)$languages_id . "'");
+  while ($orders_pay_methods = tep_db_fetch_array($orders_pay_method_query)) {
+    $orders_pay_method[] = array('id'   => $orders_pay_methods['pay_method'],
+                                  'text' => $orders_pay_methods['pay_method']);
+    $orders_pay_method_array[$orders_pay_methods['pay_method']] = $orders_pay_methods['pay_method'];
+  }
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : 'edit');
+//UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+$order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "'");
+//UPDATE_INVENTORY_QUANTITY_START##############################################################################################################
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+
+  case 'update_admin_comments':
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+    $comments = tep_db_prepare_input($HTTP_POST_VARS['admin_comments']);
+    $order_updated = false;
+    
+    tep_db_query("insert into admin_comments (orders_id, date_added, comments) values ('" . (int)$oID . "', now(), '" . tep_db_input($comments)  . "')");
+
+        $order_updated = true;
+      
+        if ($order_updated == true) {
+          $messageStack->add_session('search', 'Admin Comments Updated', 'success');
+        } else {
+          $messageStack->add_session('search', 'Admin Comments Not Updated', 'warning');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));
+        break;
+    // EOF Admin Only Comments Box v1.2
+//begin PayPal_Shopping_Cart_IPN  V2.8 DMG    
+        case 'accept_order':
+            include(DIR_FS_CATALOG_MODULES.'payment/paypal/admin/AcceptOrder.inc.php');
+            break;
+//end PayPal_Shopping_Cart_IPN
+      case 'update_order':
+        $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+        $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
+        $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
+
+        $order_updated = false;
+        $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+        $check_status = tep_db_fetch_array($check_status_query);
+// BOF: WebMakers.com Added: Downloads Controller
+// always update date and time on order_status
+// original        if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {
+                   if ( ($check_status['orders_status'] != $status) || $comments != '' || ($status ==DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE) ) {
+          tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
+        $check_status_query2 = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+        $check_status2 = tep_db_fetch_array($check_status_query2);
+      if ( $check_status2['orders_status']==DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE ) {
+        tep_db_query("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_maxdays = '" . tep_get_configuration_key_value('DOWNLOAD_MAX_DAYS') . "', download_count = '" . tep_get_configuration_key_value('DOWNLOAD_MAX_COUNT') . "' where orders_id = '" . (int)$oID . "'");
+      }
+// EOF: WebMakers.com Added: Downloads Controller
+
+          $customer_notified = '0';
+          if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {
+            $notify_comments = '';
+// BOF: WebMakers.com Added: Downloads Controller - Only tell of comments if there are comments
+            if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
+              $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
+            }
+// EOF: WebMakers.com Added: Downloads Controller
+            $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
+            
+      tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT_1 . $oID . EMAIL_TEXT_SUBJECT_2, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+            $customer_notified = '1';
+          }elseif ($HTTP_POST_VARS['notify'] == 'on' & tep_not_null($CP_track_num) ) {
+            $notify_comments = '';
+            if ($HTTP_POST_VARS['notify_comments'] == 'on') {
+                      $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
+            }
+      
+        // begin replacement section for Email Subject contribution
+            $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . 
+        HTTP_SERVER . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . 
+        ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . EMAIL_TEXT_TRACKING_NUMBER . ' ' . HTTP_SERVER . 
+        tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" . $notify_comments . 
+        sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
+
+            tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+
+            $customer_notified = '1';
+          }
+
+          tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");
+
+          $order_updated = true;
+        }
+
+        if ($order_updated == true) {
+         $messageStack->add_session('search', SUCCESS_ORDER_UPDATED, 'success');
+        } else {
+          $messageStack->add_session('search', WARNING_ORDER_NOT_UPDATED, 'warning');
+        }
+
+        tep_redirect(tep_href_link(FILENAME_ORDERS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $HTTP_GET_VARS['oID'] . '&action=edit', 'SSL'));
+        break;
+      case 'deleteconfirm':
+      
+        $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+        $restock1 = $HTTP_POST_VARS['restock'];
+         if ($restock1== 'on'){
+                $restock11 = 'true' ;
+                }
+        tep_remove_order($oID, $HTTP_POST_VARS['restock']);
+
+     //   tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')), 'SSL'));
+        tep_redirect(tep_href_link(FILENAME_ORDERS, 'page=' . $HTTP_GET_VARS['page'], 'SSL'));
+  break;
+// BMC Delete CC info Start
+// Remove CVV Number
+    case 'deleteccinfo':
+      $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+      tep_db_query("update " . TABLE_ORDERS . " set cc_ccv = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_number = '0000000000000000' where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_expires = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_start = null where orders_id = '" . tep_db_input($oID) . "'");
+      tep_db_query("update " . TABLE_ORDERS . " set cc_issue = null where orders_id = '" . tep_db_input($oID) . "'");
+
+      tep_redirect(tep_href_link(FILENAME_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=edit'));
+      break;
+    }
+  }
+
+  if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
+    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+    $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+    $order_exists = true;
+    if (!tep_db_num_rows($orders_query)) {
+      $order_exists = false;
+      $messageStack->add('search', sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
+    }
+  }
+// BOF: WebMakers.com Added: Additional info for Orders
+// Look up things in orders
+$the_extra_query= tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
+$the_extra= tep_db_fetch_array($the_extra_query);
+$the_customers_id= $the_extra['customers_id'];
+// Look up things in customers
+$the_extra_query= tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_id = '" . $the_customers_id . "'");
+$the_extra= tep_db_fetch_array($the_extra_query);
+$the_customers_fax= $the_extra['customers_fax'];
+// EOF: WebMakers.com Added: Additional info for Orders
+
+  include(DIR_WS_CLASSES . 'order.php');
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<script language="javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php
+  require(DIR_WS_INCLUDES . 'header.php');
+?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (($action == 'edit') && ($order_exists == true)) {
+    $order = new order($oID);
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+<?php  //begin PayPal_Shopping_Cart_IPN V3.15 DMG;
+if  ((strtolower($order->info['payment_method']) == 'paypal') && (isset($HTTP_GET_VARS['referer'])) && ($HTTP_GET_VARS['referer'] == 'ipn')) { ?>
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PAYPAL, tep_get_all_get_params(array('action','oID','referer')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+<?php } else { ?>
+
+            <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action','referer')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+<?php
+}
+//end PayPal_Shopping_Cart_IPN
+?>
+<td class="pageHeading" align="right">
+<?php echo '<a href="' . tep_href_link(FILENAME_EDIT_ORDERS, tep_get_all_get_params(array('action')), 'SSL') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> &nbsp; '; ?>
+</td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
+                <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>
+                <td class="main"><?php echo $order->customer['telephone']; ?></td>
+              </tr>
+<?php
+// BOF: WebMakers.com Added: Downloads Controller - Extra order info
+?>
+              <tr>
+                <td class="main"><b><?php echo 'FAX #:'; ?></b></td>
+                <td class="main"><?php echo $the_customers_fax; ?></td>
+              </tr>
+<?php
+// EOF: WebMakers.com Added: Downloads Controller
+?>
+              <tr>
+                <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
+                <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
+              </tr>
+         <tr>
+        
+            <td class="main">&nbsp;</td>
+               </tr>
+               <tr>
+                <td class="main"><b><?php echo ENTRY_IPADDRESS; ?></b></td>
+                <td class="main"><?php echo $order->customer['ipaddy']; ?></td>
+    </tr>
+    <tr>
+    <td class="main"><b><?php echo ENTRY_IPISP; ?></b></td>
+    <td class="main"><?php echo $order->customer['ipisp']; ?></td>
+    </tr>
+    
+        
+            </table></td>
+            <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>
+                <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>
+              </tr>
+            </table></td>
+            <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>
+                <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+<?php
+// BOF: WebMakers.com Added: Show Order Info
+?>
+<!-- add Order # // -->
+<tr>
+<td class="main"><b><!-- Order # --> <?php echo ORDER?></b></td>
+<td class="main"><?php echo tep_db_input($oID); ?></td>
+</tr>
+<!-- add date/time // -->
+<tr>
+<td class="main"><b><!-- Order Date & Time --><?php echo ORDER_DATE_TIME?></b></td>
+<td class="main"><?php echo tep_datetime_short($order->info['date_purchased']); ?></td>
+</tr>
+<?php
+// EOF: WebMakers.com Added: Show Order Info
+
+//begin PayPal_Shopping_Cart_IPN V3.15 DMG
+if (strtolower($order->info['payment_method']) == 'paypal') {
+echo '<tr><td class="main"><b>'. ENTRY_PAYMENT_METHOD . '</b></td></tr>';
+echo ' ';
+
+include(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/TransactionSummaryLogs.inc.php');
+
+}
+
+?>
+
+          <tr>
+            <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
+            <td class="main"><?php echo $order->info['payment_method']; ?></td>
+          </tr>
+<?php
+//}//else not paypal
+//end PayPal_Shopping_Cart_IPN
+    if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td>
+            <td class="main"><?php echo $order->info['cc_type']; ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td>
+            <td class="main"><?php echo $order->info['cc_owner']; ?></td>
+          </tr>
+          <tr>
+<?php  
+unset ($cc_number7) ;
+
+                   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{6})", $order->info['cc_number'])) && !($order->info['cc_number'] == '0000000000000000') ) { 
+                 $cc_number7 = $order->info['cc_number'];
+                 $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+              
+              }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{6})", $order->info['cc_number'])) ) {
+           $cc_number7 = cc_decrypt($order->info['cc_number']);
+           $text_encypt3= TEXT_CARD_ENCRPYT;
+          
+          }else if($order->info['cc_number'] == '0000000000000000') {
+            $cc_number7 = $order->info['cc_number'];
+          $text_encypt3= TEXT_CCV_REMOVED;
+ 
+           }else{
+            $cc_number7 = $order->info['cc_number'];
+            $text_encypt3 = TEXT_CARD_NOT_ENCRPYT ;
+                  }
+                  ?>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>
+            <td class="main"><?php echo $cc_number7; ?></td>
+            <td class="main"><?php echo $text_encypt3; ?></td>
+          </tr>
+          <tr>
+       <?php
+                   if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{4})", $order->info['cc_expires'])) ) { 
+                 $cc_expires7 = $order->info['cc_expires'];
+                 $text_encypt4 = TEXT_EXPIRES_NOT_ENCRPYT ;
+                
+              }else if ( (PAYMENT_CC_CRYPT == 'True') && !(ereg ("([0-9]{4})", $order->info['cc_expires'])) && !($order->info['cc_expires'] == '')  ) {
+           $cc_expires7 = cc_decrypt($order->info['cc_expires']);
+           $text_encypt4= TEXT_EXPIRES_ENCRPYT;
+           
+          }else if($order->info['cc_expires'] == '') {
+           $cc_expires7 = $order->info['cc_expires'];
+           $text_encypt4 =  TEXT_EXPIRES_REMOVED ;
+           
+              }else{
+           $cc_expires7 =$order->info['cc_expires'];
+           $text_encypt4 =  TEXT_EXPIRES_NOT_ENCRPYT ;
+                  }
+                  ?>
+          
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td>
+            <td class="main"><?php echo $cc_expires7; ?></td>
+            <td class="main"><?php echo $text_encypt4; ?></td>
+
+          </tr>
+                    <tr>
+           <?php
+                 //    if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{4})", $order->info['cc_expires'])) ) { 
+
+                       if ( (PAYMENT_CC_CRYPT == 'True') && (ereg ("([0-9]{3})", substr($order->info['cc_ccv'],0 , 3))) ) {
+                     $cc_ccv7 = $order->info['cc_ccv'];
+                     $text_encypt5 = TEXT_CCV_NOT_ENCRPYT ;
+                           
+                  }else if ( (PAYMENT_CC_CRYPT == 'True') &&  !(ereg ("([0-9]{3})", substr($order->info['cc_ccv'],0 ,3))) && !($order->info['cc_ccv'] == '')  ) {
+               $cc_ccv7 = cc_decrypt($order->info['cc_ccv']);
+               $text_encypt5= TEXT_CCV_ENCRPYT;
+               
+              }else if($order->info['cc_ccv'] == '') {
+               $cc_ccv7 = $order->info['cc_ccv'];
+           $text_encypt5= TEXT_CCV_REMOVED;
+
+              }else {
+               $cc_ccv7 =$order->info['cc_ccv'];
+               $text_encypt5=  TEXT_CCV_NOT_ENCRPYT;
+                      }
+                      ?>
+              
+                <td class="main"><?php echo ENTRY_CREDIT_CARD_CCV; ?></td>
+                <td class="main"><?php echo  $cc_ccv7; ?></td>
+                <td class="main"><?php echo $text_encypt5; ?></td>
+    
+              </tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_START_DATE; ?></td>
+            <td class="main"><?php echo $order->info['cc_start']; ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CREDIT_CARD_ISSUE; ?></td>
+            <td class="main"><?php echo $order->info['cc_issue']; ?></td>
+          </tr>
+    <!-- End Credit Card Info Block -->
+<?php
+    }
+?>
+        </table>
+                <?php
+  require(DIR_WS_MODULES . 'afs_v1.0/algo_fraud_screener.php');
+?> 
+        </td>
+        
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+            
+      
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr class="dataTableHeadingRow">
+            <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
+      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_BASE_PRICE; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>
+          </tr>
+  <!-- Begin Products Listings Block -->
+  <?php
+        // Override order.php Class's Field Limitations
+    $index = 0;
+    $order->products = array();
+    $orders_products_query = tep_db_query("select * from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "'");
+    while ($orders_products = tep_db_fetch_array($orders_products_query)) {
+    $order->products[$index] = array('qty' => $orders_products['products_quantity'],
+                                        'name' => str_replace("'", "&#39;", $orders_products['products_name']),
+                                        'model' => $orders_products['products_model'],
+                                        'tax' => $orders_products['products_tax'],
+                                        'price' => $orders_products['products_price'],
+                                        'final_price' => $orders_products['final_price'],
+                                        'orders_products_id' => $orders_products['orders_products_id']);
+
+    $subindex = 0;
+    $attributes_query_string = "select * from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'";
+    $attributes_query = tep_db_query($attributes_query_string);
+
+    if (tep_db_num_rows($attributes_query)) {
+    while ($attributes = tep_db_fetch_array($attributes_query)) {
+      $order->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
+                                                               'value' => $attributes['products_options_values'],
+                                                               'prefix' => $attributes['price_prefix'],
+                                                               'price' => $attributes['options_values_price'],
+                                                               'orders_products_attributes_id' => $attributes['orders_products_attributes_id']);
+    $subindex++;
+    }
+    }
+    $index++;
+    }
+
+  for ($i=0; $i<sizeof($order->products); $i++) {
+    $orders_products_id = $order->products[$i]['orders_products_id'];
+
+    $RowStyle = "dataTableContent";
+
+    echo '    <tr class="dataTableRow">' . "\n" .
+       '      <td class="' . $RowStyle . '" valign="top" align="right">' . $order->products[$i]['qty'] ."&nbsp;x</td>\n" .
+       '      <td class="' . $RowStyle . '" valign="top">' . $order->products[$i]['name'] ;
+
+    // Has Attributes?
+    if (sizeof($order->products[$i]['attributes']) > 0) {
+      for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) {
+        $orders_products_attributes_id = $order->products[$i]['attributes'][$j]['orders_products_attributes_id'];
+        echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ' : ' . $order->products[$i]['attributes'][$j]['value'] . ' ' . $order->products[$i]['attributes'][$j]['prefix'] . ' ' . $currencies->format($order->products[$i]['attributes'][$j]['price']) ;
+        echo '</i></small></nobr>';
+      }
+    }
+
+      echo '            </td>' . "\n" .
+           '            <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
+           '            <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .
+         '  <td class="dataTableContent" align="right" valign="top"><b>' . number_format($order->products[$i]['price'], 2, '.', '') . '</b></td>' . "\n" .
+       //    '          <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
+           '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
+           '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
+      echo '          </tr>' . "\n";
+    }
+?>
+          <tr>
+            <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+    for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
+      echo '              <tr>' . "\n" .
+           '                <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .
+           '                <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .
+           '              </tr>' . "\n";
+    }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><table border="1" cellspacing="0" cellpadding="5">
+          <tr>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>
+            <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+          </tr>
+<?php
+    $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
+    if (tep_db_num_rows($orders_history_query)) {
+      while ($orders_history = tep_db_fetch_array($orders_history_query)) {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
+             '            <td class="smallText" align="center">';
+        if ($orders_history['customer_notified'] == '1') {
+          echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
+        } else {
+          echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
+        }
+        echo '            <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" .
+             '            <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . '&nbsp;</td>' . "\n" .
+             '          </tr>' . "\n";
+      }
+    } else {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
+             '          </tr>' . "\n";
+    }
+?>
+        </table></td>
+      </tr>
+      <tr>
+        <td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+      </tr>
+<tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order', 'post', '', 'SSL'); ?>
+        <td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status_number']); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>
+                <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td>
+              </tr>
+            </table></td>
+            <td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
+          </tr>
+        </table></td>
+      </form></tr>
+  <tr>
+        <?php  //Begin Paypal IPN V3.15 DMG (I improvised here.)
+if (isset($HTTP_GET_VARS[tep_session_name()])) {
+  $oscid = '&' . tep_session_name() . '=' . $HTTP_GET_VARS[tep_session_name()];
+} else {
+  $oscid = '';
+}
+if (strtolower($order->info['payment_method']) == 'paypal' && isset($HTTP_GET_VARS['referer']) && $HTTP_GET_VARS['referer'] == 'ipn'){
+?>
+<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=deleteccinfo') . '">' . tep_image_button('button_removeccinfo.gif', RemoveCVV) . '&nbsp;</a> <a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . $oscid . '\')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a><a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . $oscid . '\')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a><a href="' . tep_href_link(FILENAME_PAYPAL, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+
+<?php } else { //not paypal
+?>
+<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, 'oID=' . $HTTP_GET_VARS['oID'] . '&action=deleteccinfo') . '">' . tep_image_button('button_removeccinfo.gif', RemoveCVV) . '&nbsp;</a> <a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . $oscid . '\')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a><a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . $oscid . '\')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a><a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+<?php
+}  //end PapPal IPN V3.15
+?>
+     </tr>
+ <?php
+        }else{
+        ?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr><?php 
+                  echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get', '', 'SSL'); 
+                  if (isset($HTTP_GET_VARS[tep_session_name()])) {
+                    echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+                  }
+                ?>
+                <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>
+              </form></tr>
+              <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, '', 'get', '', 'SSL'); ?>
+                <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); 
+                  if (isset($HTTP_GET_VARS[tep_session_name()])) {
+                    echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+                  }
+                ?></td>
+              </form></tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (isset($HTTP_GET_VARS[tep_session_name()])) {
+    $oscid = '&' . tep_session_name() . '=' . $HTTP_GET_VARS[tep_session_name()];
+  } else {
+    $oscid = '';
+  }
+  $HEADING_CUSTOMERS = TABLE_HEADING_CUSTOMERS;
+  $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=ascending' . $oscid . '">';
+  $HEADING_CUSTOMERS .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_CUSTOMERS .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=customer&order=decending' . $oscid . '">';
+  $HEADING_CUSTOMERS .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+  $HEADING_DATE_PURCHASED = TABLE_HEADING_DATE_PURCHASED;
+  $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=ascending' . $oscid . '">';
+  $HEADING_DATE_PURCHASED .= '&nbsp;<img src="images/arrow_up.gif" border="0"></a>';
+  $HEADING_DATE_PURCHASED .= '<a href="' . $_SERVER['PHP_SELF'] . '?sort=date&order=decending' . $oscid . '">';
+  $HEADING_DATE_PURCHASED .= '&nbsp;<img src="images/arrow_down.gif" border="0"></a>';
+ ?>
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo $HEADING_CUSTOMERS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo $HEADING_DATE_PURCHASED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $sortorder = 'order by ';
+    if($_GET["sort"] == 'customer') {
+      if($_GET["order"] == 'ascending') {
+        $sortorder .= 'o.customers_name  asc, ';
+      } else {
+        $sortorder .= 'o.customers_name desc, ';
+      }
+    } elseif($_GET["sort"] == 'date') {
+      if($_GET["order"] == 'ascending') {
+        $sortorder .= 'o.date_purchased  asc, ';
+      } else {
+        $sortorder .= 'o.date_purchased desc, ';
+      }
+    }
+    $sortorder .= 'o.orders_id DESC';
+    if (isset($HTTP_GET_VARS['cID'])) {
+      $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+      $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and ot.orders_id = o.orders_id and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
+    } elseif (isset($HTTP_GET_VARS['status']) && (tep_not_null($HTTP_GET_VARS['status']))) {
+      $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+      $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' order by o.orders_id DESC";
+    } else {
+      $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' " . $sortorder;
+    }
+    $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
+    $orders_query = tep_db_query($orders_query_raw);
+    while ($orders = tep_db_fetch_array($orders_query)) {
+   unset($order_total1);
+   $order_total1 = TEXT_INFO_ABANDONDED;
+   $orders_total_query_raw = "select ot.text as order_total from " . TABLE_ORDERS_TOTAL . " ot where  ot.orders_id = '" . $orders['orders_id'] . "' and ot.class = 'ot_total' ";
+   $orders_query_total = tep_db_query($orders_total_query_raw);
+    while ($orders1 = tep_db_fetch_array($orders_query_total)) {
+      $order_total1 = $orders1['order_total'];
+   
+     if (!$order_total1){
+      $order_total1 = TEXT_INFO_ABANDONDED;
+      }
+    }
+    
+    if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
+        $oInfo = new objectInfo($orders);
+      }
+
+      if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'), 'SSL') . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit', 'SSL') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $orders['customers_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo strip_tags($order_total1); ?></td>
+                <td class="dataTableContent" align="center"><?php echo tep_datetime_short($orders['date_purchased']); ?></td>
+                <td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
+                    <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>');
+
+      $contents = array('form' => tep_draw_form('orders', FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm', 'post' , '', 'SSL'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br>');
+      $contents[] = array('text' => TEXT_INFO_DELETE_DATA . '&nbsp;' . $oInfo->customers_name . '<br>');
+      $contents[] = array('text' => TEXT_INFO_DELETE_DATA_OID . '&nbsp;<b>' . $oInfo->orders_id . '</b><br>');
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id, 'SSL') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+
+
+    default:
+      if (isset($oInfo) && is_object($oInfo)) {
+        $heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']&nbsp;&nbsp;' . tep_datetime_short($oInfo->date_purchased) . '</b>');
+
+        if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
+     $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'SSL') . '">' . tep_image_button('button_edit_status.gif', IMAGE_EDIT_STATUS) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete', 'SSL') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_EDIT_ORDERS, 'oID=' . $oInfo->orders_id, 'SSL'). '">' . tep_image_button('button_edit_order.gif', IMAGE_EDIT_ORDER) . '</a>');
+
+     $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');
+     $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method);
+//begin PayPal_Shopping_Cart_IPN V3.15 DMG
+        if (strtolower($oInfo->payment_method) == 'paypal') {
+        include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/functions/general.func.php');
+        $contents[] = array('text' => TABLE_HEADING_PAYMENT_STATUS . ': ' .paypal_payment_status($oInfo->orders_id) );
+    }
+//end PayPal_shopping_Cart_IPN
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/orders_status.php
===================================================================
--- trunk/direct.openmoko.com/admin/orders_status.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/orders_status.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,263 @@
+<?php
+/*
+  $Id: orders_status.php,v 1.1.1.1 2004/03/04 23:38:51 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+      case 'save':
+        if (isset($HTTP_GET_VARS['oID'])) $orders_status_id = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+        $languages = tep_get_languages();
+        for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $orders_status_name_array = $HTTP_POST_VARS['orders_status_name'];
+          $language_id = $languages[$i]['id'];
+
+          $sql_data_array = array('orders_status_name' => tep_db_prepare_input($orders_status_name_array[$language_id]));
+
+          if ($action == 'insert') {
+            if (empty($orders_status_id)) {
+              $next_id_query = tep_db_query("select max(orders_status_id) as orders_status_id from " . TABLE_ORDERS_STATUS . "");
+              $next_id = tep_db_fetch_array($next_id_query);
+              $orders_status_id = $next_id['orders_status_id'] + 1;
+            }
+
+            $insert_sql_data = array('orders_status_id' => $orders_status_id,
+                                     'language_id' => $language_id);
+
+            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+            tep_db_perform(TABLE_ORDERS_STATUS, $sql_data_array);
+          } elseif ($action == 'save') {
+            tep_db_perform(TABLE_ORDERS_STATUS, $sql_data_array, 'update', "orders_status_id = '" . (int)$orders_status_id . "' and language_id = '" . (int)$language_id . "'");
+          }
+        }
+
+        if (isset($HTTP_POST_VARS['default']) && ($HTTP_POST_VARS['default'] == 'on')) {
+          tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($orders_status_id) . "' where configuration_key = 'DEFAULT_ORDERS_STATUS_ID'");
+        }
+
+        tep_redirect(tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $orders_status_id));
+        break;
+      case 'deleteconfirm':
+        $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+        $orders_status_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_ORDERS_STATUS_ID'");
+        $orders_status = tep_db_fetch_array($orders_status_query);
+
+        if ($orders_status['configuration_value'] == $oID) {
+          tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '' where configuration_key = 'DEFAULT_ORDERS_STATUS_ID'");
+        }
+
+        tep_db_query("delete from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . tep_db_input($oID) . "'");
+
+        tep_redirect(tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'delete':
+        $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+
+        $status_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '" . (int)$oID . "'");
+        $status = tep_db_fetch_array($status_query);
+
+        $remove_status = true;
+        if ($oID == DEFAULT_ORDERS_STATUS_ID) {
+          $remove_status = false;
+          $messageStack->add('search', ERROR_REMOVE_DEFAULT_ORDER_STATUS, 'error');
+        } elseif ($status['count'] > 0) {
+          $remove_status = false;
+          $messageStack->add('search', ERROR_STATUS_USED_IN_ORDERS, 'error');
+        } else {
+          $history_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_status_id = '" . (int)$oID . "'");
+          $history = tep_db_fetch_array($history_query);
+          if ($history['count'] > 0) {
+            $remove_status = false;
+            $messageStack->add('search', ERROR_STATUS_USED_IN_HISTORY, 'error');
+          }
+        }
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ORDERS_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $orders_status_query_raw = "select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "' order by orders_status_id";
+  $orders_status_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_status_query_raw, $orders_status_query_numrows);
+  $orders_status_query = tep_db_query($orders_status_query_raw);
+  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+    if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders_status['orders_status_id']))) && !isset($oInfo) && (substr($action, 0, 3) != 'new')) {
+      $oInfo = new objectInfo($orders_status);
+    }
+
+    if (isset($oInfo) && is_object($oInfo) && ($orders_status['orders_status_id'] == $oInfo->orders_status_id)) {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $orders_status['orders_status_id']) . '\'">' . "\n";
+    }
+
+    if (DEFAULT_ORDERS_STATUS_ID == $orders_status['orders_status_id']) {
+      echo '                <td class="dataTableContent"><b>' . $orders_status['orders_status_name'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
+    } else {
+      echo '                <td class="dataTableContent">' . $orders_status['orders_status_name'] . '</td>' . "\n";
+    }
+?>
+                <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders_status['orders_status_id'] == $oInfo->orders_status_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $orders_status['orders_status_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $orders_status_split->display_count($orders_status_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS_STATUS); ?></td>
+                    <td class="smallText" align="right"><?php echo $orders_status_split->display_links($orders_status_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_ORDERS_STATUS . '</b>');
+
+      $contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert'));
+      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+
+      $orders_status_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        $orders_status_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('orders_status_name[' . $languages[$i]['id'] . ']');
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ORDERS_STATUS_NAME . $orders_status_inputs_string);
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_ORDERS_STATUS . '</b>');
+
+      $contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id  . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+
+      $orders_status_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+        $orders_status_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('orders_status_name[' . $languages[$i]['id'] . ']', tep_get_orders_status_name($oInfo->orders_status_id, $languages[$i]['id']));
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ORDERS_STATUS_NAME . $orders_status_inputs_string);
+      if (DEFAULT_ORDERS_STATUS_ID != $oInfo->orders_status_id) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDERS_STATUS . '</b>');
+
+      $contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id  . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $oInfo->orders_status_name . '</b>');
+      if ($remove_status) $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($oInfo) && is_object($oInfo)) {
+        $heading[] = array('text' => '<b>' . $oInfo->orders_status_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+
+        $orders_status_inputs_string = '';
+        $languages = tep_get_languages();
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+          $orders_status_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_get_orders_status_name($oInfo->orders_status_id, $languages[$i]['id']);
+        }
+
+        $contents[] = array('text' => $orders_status_inputs_string);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/packaging.php
===================================================================
--- trunk/direct.openmoko.com/admin/packaging.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/packaging.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,327 @@
+<?php
+/*
+    $Id: packaging.php,v 1.02 2007/01/19 torinwalker Exp $
+    
+    Copyright (c) 2003 Torin Walker
+    
+    This program is free software; you can redistribute it and/or modify it under the terms
+    of the GNU General Public License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+    
+    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+    See the GNU General Public License for more details.
+    
+    You should have received a copy of the GNU General Public License along with this program;
+    If not, you may obtain one by writing to and requesting one from
+    
+    The Free Software Foundation, Inc.,
+    59 Temple Place, Suite 330,
+    Boston, MA 02111-1307 USA
+*/
+
+require('includes/application_top.php');
+require(DIR_WS_CLASSES . 'currencies.php');
+$currencies = new currencies();
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top">
+      <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+      </table>
+        </td>
+<!-- body_text //-->
+     <td width="100%" valign="top">
+	  <table border="0" width="100%" cellspacing="0" cellpadding="2">
+     <tr>
+     <td class="pageHeading">
+	  <?php echo HEADING_TITLE; ?>
+	  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td class="dataTableContent" width="75%" valign="top">
+<?php
+$activeid = $_GET['id'];
+
+//********** New Package
+if(($_POST['name'] != "" && $_POST["Action"] == "newpackage") || ($_POST['id'] != "" && $_POST["Action"] == "updatepackage")) {
+    if (number_format(trim($_POST['length']), 2, '.', '') <= 0) {
+        $error = MIN_LENGTH_NOT_MET;
+    } else if (number_format(trim($_POST['width']), 2, '.', '') <= 0) {
+        $error = MIN_WIDTH_NOT_MET;
+    } else if (number_format(trim($_POST['height']), 2, '.', '') <= 0) {
+        $error = MIN_HEIGHT_NOT_MET;
+    } else if (number_format(trim($_POST['empty_weight']), 2, '.', '') < 0) {	
+        $error = MIN_EMPTY_WEIGHT_NOT_MET;
+    } else if (number_format(trim($_POST['max_weight']), 2, '.', '') < 0) {	
+        $error = MIN_MAX_WEIGHT_NOT_MET;
+    } else {
+        $sql_data_array = array(
+            'package_name' => $_POST['name'],
+            'package_description' => $_POST['description'],
+            'package_length' => $_POST['length'],
+            'package_width' => $_POST['width'],
+            'package_height' => $_POST['height'],
+            'package_empty_weight' => $_POST['empty_weight'],
+            'package_max_weight' => $_POST['max_weight'],
+            'package_cost' => $_POST['cost']
+        );
+        if ($_POST["Action"] == "newpackage") {
+            tep_db_perform(TABLE_PACKAGING, $sql_data_array);
+        } else {
+            tep_db_perform(TABLE_PACKAGING, $sql_data_array, "update", "package_id = '" . $_POST['id'] . "'");
+        }
+    }
+}
+
+//********** Delete Package
+if($_POST['id'] != "" && $_POST["Action"] == "deletepackage") {
+    tep_db_query("delete from " . TABLE_PACKAGING . " where package_id = '" . $_POST['id'] . "'");
+}
+
+// ********* Display Packages
+DisplayPackages($activeid, $error);
+switch ($Action) {
+    case "shownewpackageform":
+    showNewPackageForm();
+    break;
+    case "showupdatepackageform":
+    showUpdatePackageForm();
+    break;
+    case "showconfirmdeletepackageform":
+    showConfirmDeletePackageForm();
+    break;
+    case "":
+    default:
+    showPackageInfoForm();
+    break;
+}
+
+//*******************
+function getPackages() {
+    $packages = array();
+    $packages_query = tep_db_query("select * from " . TABLE_PACKAGING . " order by package_cost;");
+    while ($package = tep_db_fetch_array($packages_query)) {
+        $packages[] = array(
+            'id' => $package['package_id'],
+            'name' => $package['package_name'],
+            'description' => $package['package_description'],
+            'length' => $package['package_length'],
+            'width' => $package['package_width'],
+            'height' => $package['package_height'],
+            'empty_weight' => $package['package_empty_weight'],
+            'max_weight' => $package['package_max_weight'],
+            'cost' => $package['package_cost']
+        );
+    }
+    return $packages;
+}
+
+//************************  DisplayPackages()
+// shows the main menu, lists the admins
+function DisplayPackages($activeid,$error) {
+?>
+
+    <table border="0" width="100%" cellspacing="0" cellpadding="2" width="100%">
+      <tr class="dataTableHeadingRow">
+        <td class="dataTableHeadingContent"><?php echo HEADING_NAME; ?></td>
+        <td class="dataTableHeadingContent" align="left"><?php echo HEADING_DESCRIPTION; ?></td>
+        <td class="dataTableHeadingContent" align="center"><?php echo HEADING_LENGTH; ?></td>
+        <td class="dataTableHeadingContent" align="center"><?php echo HEADING_WIDTH; ?></td>
+        <td class="dataTableHeadingContent" align="center"><?php echo HEADING_HEIGHT; ?></td>
+        <td class="dataTableHeadingContent" align="center"><?php echo HEADING_EMPTY_WEIGHT; ?></td>
+        <td class="dataTableHeadingContent" align="center"><?php echo HEADING_MAX_WEIGHT; ?></td>
+        <td class="dataTableHeadingContent" align="center"><?php echo HEADING_COST; ?></td>
+        <td class="dataTableHeadingContent" align="left"><?php echo HEADING_ACTION; ?></td>
+      </tr>
+
+    <?php
+    $packages = getPackages();
+    if (count($packages) == 0) {
+        echo                         '<tr><td colspan="8">' . NO_PACKAGES_DEFINED . '</td></tr>';
+    }
+    if ($error != "") {
+        echo '<SPAN class="errorText">'.$error.'</SPAN>';
+    }
+    for ($i = 0; $i < count($packages); $i++) {
+        if (($_GET["Action"] != "shownewpackageform") && ($error == "")) {
+            if ($activeid == "") {
+                $activeid = $packages[0]['id'];
+            }
+        }
+        if ($activeid == $packages[$i]['id']) {
+            echo '<tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_PACKAGING, 'id=' . $packages[$i]['id'] ).'\'">' . "\n";
+        } else {
+            echo '<tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_PACKAGING, 'id=' .$packages[$i]['id'] ). '\'">' . "\n";
+        }
+        echo '<td class="dataTableContent" align="left"><br>' . $packages[$i]['name'] . '</td>';
+        echo '<td class="dataTableContent" align="left"><br>' . $packages[$i]['description'] . '</td>';
+        echo '<td class="dataTableContent" align="center"><br>' . $packages[$i]['length'] . '</td>';
+        echo '<td class="dataTableContent" align="center"><br>' . $packages[$i]['width'] . '</td>';
+        echo '<td class="dataTableContent" align="center"><br>' . $packages[$i]['height'] . '</td>';
+        echo '<td class="dataTableContent" align="center"><br>' . $packages[$i]['empty_weight'] . '</td>';
+        echo '<td class="dataTableContent" align="center"><br>' . $packages[$i]['max_weight'] . '</td>';
+        echo '<td class="dataTableContent" align="center"><br>' . $packages[$i]['cost'] . '</td>';
+
+        if ($activeid == $packages[$i]['id'] ) { 
+            echo '<td>' . tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); 
+        } else { 
+            echo '<td><a href="' . tep_href_link(FILENAME_PACKAGING, 'id=' . $packages[$i]['id'] ). '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', ICON_INFO) . '</a>'; 
+        }
+    }
+    echo '</td></tr></table><br>'."\n";
+    echo '<a href="' . tep_href_link( FILENAME_PACKAGING , 'Action=shownewpackageform') .  '">'.tep_image_button('button_new_package.gif', 'New Package').'</a>&nbsp;';
+    if ($activeid == "") {
+        $activeid = $packages[0]['id'];
+        }
+    echo '<a href="' . tep_href_link( FILENAME_PACKAGING , 'Action=showupdatepackageform&id='.$activeid.'') . '">'.tep_image_button('button_edit.gif', IMAGE_EDIT).'</a>&nbsp;' ;	 
+    echo '<a href="' . tep_href_link( FILENAME_PACKAGING , 'Action=showconfirmdeletepackageform&id='.$activeid.'') . '">'.tep_image_button('button_delete.gif', IMAGE_DELETE).'</a>' ;
+   echo '</td><td class="infoBoxContent" valign="top">'."\n";
+}
+
+//******************************   showNewPackageForm()
+// Show the form to create a new package
+function showNewPackageForm() {
+    $packages = getPackages();
+    $cost = 0;
+    for ($i = 0; $i < count($packages); $i++) {
+        if ($packages[$i]['cost'] > $cost) {
+            $cost = $packages[$i]['cost'] + 1;
+        }
+    }
+
+    echo "<table cellspacing='0' width='100%' cellpadding='0'><tr>\n";
+    echo "<td colspan='2' class='infoBoxHeading'>". CREATE_NEW_PACKAGE."</td></tr></table>\n";
+    echo tep_draw_form("newpackage", FILENAME_PACKAGING);
+    echo tep_draw_hidden_field("Action", "newpackage");
+    echo '<table><tr><td class="infoBoxContent"><b>'.HEADING_NAME.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_NAME_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("name").'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_DESCRIPTION.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_DESCRIPTION_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("description").'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_LENGTH.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_LENGTH_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("length").'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_WIDTH.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_WIDTH_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("width").'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_HEIGHT.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_HEIGHT_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("height").'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_EMPTY_WEIGHT.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_EMPTY_WEIGHT_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("empty_weight").'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_MAX_WEIGHT.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_MAX_WEIGHT_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("max_weight").'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_COST.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_COST_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("cost", $cost).'</td></tr>';
+    echo '<tr><td colspan="2">'. tep_image_submit('button_update.gif', 'Save these values as a new package.') ;
+    echo '&nbsp;&nbsp;<a href="' . tep_href_link( FILENAME_PACKAGING ) . '">'.tep_image_button('button_cancel.gif', IMAGE_CANCEL) .'</A>' ;	 
+    echo "</td></tr></table>" ;
+    echo ("</form>");
+}
+
+//******************************   showUpdatePackageForm()
+// Show the form to update a package
+function showUpdatePackageForm() {
+    $packages = getPackages();
+    $activepackage = $packages[0];
+    if ($_GET['id'] != "") {
+        for ($i = 0; $i < count($packages); $i++) {
+            if ($_GET['id'] == $packages[$i]['id']) {
+                $activepackage = $packages[$i];
+            }
+        }
+    }
+    echo "<table cellspacing='0' width='100%' cellpadding='0'> <tr><td colspan='2' class='infoBoxHeading'>". UPDATE_PACKAGE."</td></tr></table>\n";
+    echo tep_draw_form("updatepackage", FILENAME_PACKAGING, 'id='.$activepackage['id'], 'post');
+    echo tep_draw_hidden_field("Action", "updatepackage");
+    echo tep_draw_hidden_field("id", $activepackage['id']);
+    echo '<table><tr><td class="infoBoxContent"><b>'.HEADING_NAME.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_NAME_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("name", $activepackage['name']).'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_DESCRIPTION.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_DESCRIPTION_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("description", $activepackage['description']).'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_LENGTH.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_LENGTH_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("length", $activepackage['length']).'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_WIDTH.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_WIDTH_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("width", $activepackage['width']).'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_HEIGHT.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_HEIGHT_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("height", $activepackage['height']).'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_EMPTY_WEIGHT.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_EMPTY_WEIGHT_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("empty_weight", $activepackage['empty_weight']).'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_MAX_WEIGHT.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_MAX_WEIGHT_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("max_weight", $activepackage['max_weight']).'</td></tr>'."\n";
+    echo '<tr><td class="infoBoxContent"><b>'.HEADING_COST.'</b></td></tr><tr><td class="infoBoxContent">'.HEADING_COST_TEXT.'</td></tr><tr><td class="infoBoxContent">'.tep_draw_input_field("cost", $activepackage['cost']).'</td></tr>';
+    echo '<tr><td colspan="2">'. tep_image_submit('button_update.gif', 'Update the package with these values.') ;
+    echo '&nbsp;&nbsp;<a href="' . tep_href_link( FILENAME_PACKAGING,'id='.$activepackage['id'] ) . '">'.tep_image_button('button_cancel.gif', IMAGE_CANCEL) .'</a>'."\n";	 
+    echo "</td></tr></table>\n" ;
+    echo ("</form>\n");
+}
+
+//*************************** showConfirmDeletePackageForm()
+// Shows the form to confirm package deletion
+function showConfirmDeletePackageForm() {
+    $packages = getPackages();
+    $package_name = "";
+    for ($i = 0; $i < count($packages); $i++) {
+        if ($packages[$i]['id'] == $_GET['id']) {
+            $package_name = $packages[$i]['name'];
+        }
+    }
+    echo "<table cellspacing='0' width='100%' cellpadding='0'> <tr><td colspan='2' class='infoBoxHeading'>". DELETE_PACKAGE."</td></tr></table>";
+    echo tep_draw_form("confirmDeletePackage", FILENAME_PACKAGING);
+    echo tep_draw_hidden_field("Action", "deletepackage");
+    echo tep_draw_hidden_field("id", $_GET['id']);
+    echo '<table cellpadding="5"><tr><td class="infoBoxContent">'.CONFIRM_DELETE.'</td></tr>' ;
+    echo "<tr><td>".$package_name."</td></td>";
+    echo "<tr><td>";
+//    echo '<a href="' . tep_href_link( FILENAME_PACKAGING ) . '">'.tep_image_button('button_confirm.gif', IMAGE_CONFIRM) .'</a>' ;
+    echo tep_image_submit('button_confirm.gif', IMAGE_CONFIRM) ;	 
+    echo '&nbsp;&nbsp;<a href="' . tep_href_link( FILENAME_PACKAGING ) . '">'.tep_image_button('button_cancel.gif', IMAGE_CANCEL) .'</a>' ;	 
+    echo '</td></tr></table>'."\n";
+    echo '</form>'."\n";
+}
+
+//************************  ShowPackageInfo()
+// Shows the info a package
+function showPackageInfoForm() {
+    $packages = getPackages();
+    $activepackage = $packages[0];
+    $activeid = $_GET["id"];
+    if ($activeid != "") {
+        for ($i = 0; $i < count($packages); $i++) {
+            if ($activeid == $packages[$i]['id']) {
+                $activepackage = $packages[$i];
+            }
+        }
+    }
+    if ($error != "") {
+        echo '<SPAN class="errorText">'.$error.'</SPAN>';
+    }
+
+    echo "<table cellspacing='0' width='100%' cellpadding='0'><tr>\n<td colspan='2' class='infoBoxHeading'><b>". HEADING_INFO ."</b></td></tr></table>\n";
+    if (count($packages) != 0) {
+        echo '<table>'."\n";
+        echo '<tr><td class="infoBoxContent"><b>'.    HEADING_NAME    .'</b></td></tr><tr><td class="infoBoxContent">'.$activepackage['name'].'</td></tr>'."\n";
+        echo '<tr><td class="infoBoxContent"><b>'. HEADING_DESCRIPTION.'</b></td></tr><tr><td class="infoBoxContent">'.$activepackage['description'].'</td></tr>'."\n";
+        echo '<tr><td class="infoBoxContent"><b>'.   HEADING_LENGTH   .'</b></td></tr><tr><td class="infoBoxContent">'.$activepackage['length'].'</td></tr>'."\n";
+        echo '<tr><td class="infoBoxContent"><b>'.   HEADING_WIDTH    .'</b></td></tr><tr><td class="infoBoxContent">'.$activepackage['width'].'</td></tr>'."\n";
+        echo '<tr><td class="infoBoxContent"><b>'.   HEADING_HEIGHT   .'</b></td></tr><tr><td class="infoBoxContent">'.$activepackage['height'].'</td></tr>'."\n";
+        echo '<tr><td class="infoBoxContent"><b>'.HEADING_EMPTY_WEIGHT.'</b></td></tr><tr><td class="infoBoxContent">'.$activepackage['empty_weight'].'</td></tr>'."\n";
+        echo '<tr><td class="infoBoxContent"><b>'. HEADING_MAX_WEIGHT .'</b></td></tr><tr><td class="infoBoxContent">'.$activepackage['max_weight'].'</td></tr>'."\n";
+        echo '<tr><td class="infoBoxContent"><b>'.    HEADING_COST    .'</b></td></tr><tr><td class="infoBoxContent">'.$activepackage['cost'].'</td></tr>'."\n";
+        echo "</table>\n";
+    }
+    echo "";
+}
+?>
+        </td>
+      </tr>
+    </table> 
+  </td>
+<!-- body_text_eof //--></tr>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/packingslip.php
===================================================================
--- trunk/direct.openmoko.com/admin/packingslip.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/packingslip.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<?php
+/*
+  $Id: packingslip.php,v 1.2 2004/03/13 15:09:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
+  $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");
+
+  include(DIR_WS_CLASSES . 'order.php');
+  $order = new order($oID);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE . ' - ' . TITLE_PRINT_ORDER . ' #' . $HTTP_GET_VARS['order_id']; ?></title>
+<link rel="stylesheet" type="text/css" href="print.css">
+</head>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<!-- body_text //-->
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td align="center" class="main"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="5">
+      <tr>
+        <td valign="top" align="left" class="main"><script language="JavaScript">
+  if (window.print) {
+    document.write('<a href="javascript:;" onClick="javascript:window.print()" onMouseOut=document.imprim.src="<?php echo (DIR_WS_IMAGES . 'printimage.gif'); ?>" onMouseOver=document.imprim.src="<?php echo (DIR_WS_IMAGES . 'printimage_over.gif'); ?>"><img src="<?php echo (DIR_WS_IMAGES . 'printimage.gif'); ?>" width="43" height="28" align="absbottom" border="0" name="imprim">' + '<?php echo IMAGE_BUTTON_PRINT; ?></a></center>');
+  }
+  else document.write ('<h2><?php echo IMAGE_BUTTON_PRINT; ?></h2>')
+        </script></td>
+        <td align="right" valign="bottom" class="main"><p align="right" class="main"><a href="javascript:window.close();"><img src='images/close_window.jpg' border=0></a></p></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr align="left">
+    <td class="titleHeading"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" align="center" width="75%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . STORE_LOGO, STORE_NAME); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2" align="center" class="titleHeading"><b><?php echo 'Order#' . $HTTP_GET_VARS['oID']; ?></b></td>
+          </tr>
+          <tr align="left">
+            <td colspan="2" class="titleHeading"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="dataTableContent"><?php echo '<b>' . ENTRY_DATE_PURCHASED . '</b> ' . $order->info['date_purchased']; ?></td>
+  </tr>
+  <tr>
+    <td align="center"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor=#000000>
+          <tr>
+            <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '&nbsp;', '<br>'); ?></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo '&nbsp;<b>Telephone#</b>' . '<br>&nbsp;' . $order->customer['telephone']; ?></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo '&nbsp;<b>eMail Address:</b>' . '<br>&nbsp;' . $order->customer['email_address']; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+        <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor=#000000>
+          <tr>
+            <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '&nbsp;', '<br>'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="dataTableHeadingContent"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
+        <td class="dataTableContent"><?php echo $order->info['payment_method']; ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="1" bgcolor=#000000>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr class="dataTableHeadingRow">
+            <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
+          </tr>
+<?php
+    for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
+      echo '      <tr class="dataTableRow">' . "\n" .
+           '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
+           '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];
+
+      if (sizeof($order->products[$i]['attributes']) > 0) {
+        for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
+          echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
+          echo '</i></small></nobr>';
+        }
+      }
+
+      echo '        </td>' . "\n" .
+           '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
+           '      </tr>' . "\n";
+    }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>
+<!-- body_text_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/pages.php
===================================================================
--- trunk/direct.openmoko.com/admin/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,519 @@
+<?php
+/*
+  $Id: pages.php,v 1.1.1.1 2004/03/04 23:38:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+require('includes/application_top.php');
+
+// define functions
+require(DIR_WS_FUNCTIONS . 'pages.php');
+
+$languages = tep_get_languages();
+
+// clean variables
+$pID = '';
+if (isset($HTTP_POST_VARS['pID']) && tep_not_null($HTTP_POST_VARS['pID'])) {
+  $pID = (int)$HTTP_POST_VARS['pID'];
+} elseif (isset($HTTP_GET_VARS['pID']) && tep_not_null($HTTP_GET_VARS['pID'])) {
+  $pID = (int)$HTTP_GET_VARS['pID'];
+}
+
+$action = '';
+if (isset($HTTP_POST_VARS['action']) && tep_not_null($HTTP_POST_VARS['action'])) {
+  $action = tep_db_prepare_input($HTTP_POST_VARS['action']);
+} elseif (isset($HTTP_GET_VARS['action']) && tep_not_null($HTTP_GET_VARS['action'])) {
+  $action = tep_db_prepare_input($HTTP_GET_VARS['action']);
+} 
+
+if (tep_not_null($action)) {
+  switch ($action) {
+  case 'setflag':
+    $flag = (int)$HTTP_GET_VARS['flag'];
+
+    if (($flag == '0') || ($flag == '1')) {
+      if (tep_not_null($pID)) {
+  tep_db_query("update " . TABLE_PAGES . " set pages_status = '" . $flag . "' where pages_id = '" . (int)$pID . "'");
+      }
+    }
+
+    tep_redirect(tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('action'))));
+
+    break;
+  case 'insert':
+  case 'update':
+    $pages_title_array = tep_db_prepare_input($HTTP_POST_VARS['pages_title']);
+    $pages_category = (int)$HTTP_POST_VARS['pages_category'];
+    $pages_blurb_array = tep_db_prepare_input($HTTP_POST_VARS['pages_blurb']);
+    $pages_body_array = tep_db_prepare_input($HTTP_POST_VARS['pages_body']);
+    $pages_meta_title_array = tep_db_prepare_input($HTTP_POST_VARS['pages_meta_title']);
+    $pages_meta_keywords_array = tep_db_prepare_input($HTTP_POST_VARS['pages_meta_keywords']);
+    $pages_meta_description_array = tep_db_prepare_input($HTTP_POST_VARS['pages_meta_description']);
+    $pages_status = ((tep_db_prepare_input($HTTP_POST_VARS['pages_status']) == 'on') ? '1' : '0');
+    $pages_sort_order = tep_not_null($HTTP_POST_VARS['pages_sort_order']) ? (int)$HTTP_POST_VARS['pages_sort_order'] : '0';
+    $pages_author = tep_db_prepare_input($HTTP_POST_VARS['pages_author']);
+
+    $sql_data_array = array('pages_author' => $pages_author,
+          'pages_status' => $pages_status,
+          'pages_sort_order' => $pages_sort_order);
+
+    if ($action == 'update') {
+      $sql_data_array['pages_date_modified'] = 'now()';
+    } elseif ($action == 'insert') {
+      $sql_data_array['pages_date_added'] = 'now()';
+    }
+
+    if ($action == 'update') {
+      tep_db_perform(TABLE_PAGES, $sql_data_array, 'update', "pages_id = '" . (int)$pID . "'");
+    } else if($action == 'insert') {
+      tep_db_perform(TABLE_PAGES, $sql_data_array);
+
+      $pID = tep_db_insert_id();
+    }
+
+    // upload image
+    if ($pages_image = new upload('pages_image', DIR_FS_CATALOG_IMAGES)) {
+      tep_db_query("update " . TABLE_PAGES . " set pages_image = '" . $pages_image->filename . "' where pages_id = '" . (int)$pID . "'");
+    }
+
+    // update description tables
+    $sql_data_array = array();
+    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+      $language_id = (int)$languages[$i]['id'];
+
+      $sql_data_array = array('language_id' => $language_id, 
+            'pages_title' => $pages_title_array[$language_id], 
+            'pages_blurb' => $pages_blurb_array[$language_id], 
+            'pages_body' => $pages_body_array[$language_id], 
+            'pages_meta_title' => $pages_meta_title_array[$language_id], 
+            'pages_meta_keywords' => $pages_meta_keywords_array[$language_id], 
+            'pages_meta_description' => $pages_meta_description_array[$language_id]
+            );
+
+      if ($action == 'insert') {
+  $sql_data_array['pages_id'] = (int)$pID;
+
+  tep_db_perform(TABLE_PAGES_DESCRIPTION, $sql_data_array);
+      } else {
+  tep_db_perform(TABLE_PAGES_DESCRIPTION, $sql_data_array, 'update', "pages_id = '" . (int)$pID . "' and language_id = '" . (int)$language_id . "'");
+      }
+    }
+
+    // update category info
+    if ($action == 'update') {
+      tep_db_query("update " . TABLE_PAGES_TO_CATEGORIES . " set categories_id = '" . (int)$pages_category . "' where pages_id = '" . (int)$pID . "'");
+    } else if($action == 'insert') {
+      tep_db_query("insert into " . TABLE_PAGES_TO_CATEGORIES . " (pages_id, categories_id) values ('" . (int)$pID . "', '" . (int)$pages_category . "')");
+    }
+
+    tep_redirect(tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pID));
+
+    break;
+  case 'deleteconfirm':
+    tep_pages_remove_page($pID);
+
+    tep_redirect(tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('pID', 'action'))));
+    break;
+  default:
+    $pages_query = tep_db_query("select ip.pages_id, ip.pages_image, ip.pages_date_added, ip.pages_date_modified, ip.pages_author, ip.pages_status, ip.pages_sort_order, ipd.pages_title, ipd.pages_blurb from " . TABLE_PAGES . " ip left join " . TABLE_PAGES_DESCRIPTION . " ipd on ip.pages_id = ipd.pages_id where ipd.language_id = '" . (int)$languages_id . "' and ip.pages_id = '" . (int)$pID . "'");
+
+    $pages = tep_db_fetch_array($pages_query);
+    $categories_query = tep_db_query("select icd.categories_id, icd.categories_name from " . TABLE_PAGES_TO_CATEGORIES . " ip2c left join " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd on icd.categories_id = ip2c.categories_id where ip2c.pages_id = '" . (int)$pages['pages_id'] . "' and icd.language_id = '" . (int)$languages_id . "'");
+    $category = tep_db_fetch_array($categories_query);
+
+    $pInfo_array = array_merge($pages, $category);
+    $pInfo = new objectInfo($pInfo_array);
+  }
+}
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+<!-- Tabs code -->
+<script type="text/javascript" src="includes/javascript/tabpane/local/webfxlayout.js"></script>
+<link type="text/css" rel="stylesheet" href="includes/javascript/tabpane/tab.webfx.css">
+<style type="text/css">
+.dynamic-tab-pane-control h2 {
+  text-align: center;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control h2 a {
+  display:  inline;
+  width:    auto;
+}
+
+.dynamic-tab-pane-control a:hover {
+  background: transparent;
+}
+</style>
+<script type="text/javascript" src="includes/javascript/tabpane/tabpane.js"></script>
+<!-- End Tabs -->
+<?php 
+// Load Editor
+include('includes/javascript/editor.php');
+echo tep_load_html_editor();
+  for ($i=0; $i<sizeof($languages); $i++) {
+      $pages_blurb_elements .= 'pages_blurb[' . $languages[$i]['id'] . '],'; 
+      $pages_body_elemtnts .= 'pages_body[' . $languages[$i]['id'] . '],'; 
+    } 
+
+echo tep_insert_html_editor($pages_blurb_elements,'simple','200');
+echo tep_insert_html_editor($pages_body_elemtnts,'advanced','400');
+?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if ($action == 'edit' || $action == 'update' || $action == 'new' || $action == 'insert') {
+    if ($action == 'edit' || $action == 'update') {
+      $form_action = 'update';
+    } else {
+      $form_action = 'insert';
+    }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+
+      <tr><?php echo tep_draw_form('pages', FILENAME_PAGES, tep_get_all_get_params(array('action')) . 'action=' . $form_action, 'post', 'enctype="multipart/form-data"'); ?>
+        <td>
+<?php
+    $categories_array = array();
+    $categories_array[] = array('id' => '', 'text' => TEXT_NO_CATEGORY);
+    $categories_query = tep_db_query("select icd.categories_id, icd.categories_name from " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd where language_id = '" . (int)$languages_id . "' order by icd.categories_name");
+    while ($categories_values = tep_db_fetch_array($categories_query)) {
+      $categories_array[] = array('id' => $categories_values['categories_id'], 'text' => $categories_values['categories_name']);
+    }
+?>
+<table border="0" cellspacing="0" cellpadding="0" width="80%">
+  <tr valign="top">
+    <td width="50%"><table border="0" cellspacing="0" cellpadding="2" width="100%">
+          <tr>
+            <td class="main"><?php echo ENTRY_CATEGORY; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('pages_category', $categories_array, $pInfo->categories_id); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_IMAGE; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_file_field('pages_image'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_STATUS; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_radio_field('pages_status', 'on', ($pInfo->pages_status == '1') ? true : false) . ' ' . TEXT_PAGES_ACTIVE . '&nbsp;&nbsp;' . tep_draw_radio_field('pages_status', 'off', ($pInfo->pages_status == '0') ? true : false) . ' ' . TEXT_PAGES_INACTIVE; ?></td>
+          </tr>
+        </table></td>
+    <td width="50%">    <table border="0" cellspacing="0" cellpadding="2" width="100%">
+      <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_SORT_ORDER; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('pages_sort_order', $pInfo->pages_sort_order, 'size="2"'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_AUTHOR; ?></td>
+            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('pages_author', $pInfo->pages_author); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+    </table></td>
+  </tr>
+</table>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?>
+<div class="tab-pane" id="tabPane1">
+<script type="text/javascript">tp1 = new WebFXTabPane( document.getElementById( "tabPane1" ) );
+</script>
+<?php
+    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+              <div class="tab-page" id="<?php echo $languages[$i]['name'];?>">
+                <h2 class="tab"><nobr><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name'],'align="absmiddle" style="height:16px; width:30px;"') . '&nbsp;' .$languages[$i]['name'];?></nobr></h2>
+                <script type="text/javascript">tp1.addTabPage( document.getElementById( "<?php echo $languages[$i]['name'];?>" ) );</script>
+                <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="tab table">
+                  <tr>
+                    <td valign="top">
+    <table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo ENTRY_TITLE; ?></b></td>
+            <td class="main"><?php echo tep_draw_input_field('pages_title[' . $languages[$i]['id'] . ']', tep_pages_get_page_title($pInfo->pages_id, $languages[$i]['id'])); ?></td>
+          </tr>
+<?php
+//    }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+
+<?php
+//    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><b><?php  echo ENTRY_BLURB; ?></b></td>
+            <td class="main"><?php echo tep_draw_textarea_field('pages_blurb[' . $languages[$i]['id'] . ']', 'hard', 40, 3, tep_pages_get_page_blurb($pInfo->pages_id, $languages[$i]['id']), 'style="width: 100%"'); ?></td>
+          </tr>
+<?php
+//    }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+//    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><b><?php echo ENTRY_BODY; ?></b></td>
+            <td class="main"><?php echo tep_draw_textarea_field('pages_body[' . $languages[$i]['id'] . ']', 'hard', 40, 5, tep_pages_get_page_body($pInfo->pages_id, $languages[$i]['id']), 'style="width: 100%;" mce_editable="true"'); ?></td>
+          </tr>
+<?php
+//    }
+?>
+
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+//    for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><b><?php echo ENTRY_META_TITLE; ?></b></td>
+            <td class="main"><?php echo tep_draw_input_field('pages_meta_title[' . $languages[$i]['id'] . ']', tep_pages_get_page_meta_title($pInfo->pages_id, $languages[$i]['id']), 'style="width: 80%;"'); ?></td>
+          </tr>
+<?php
+//    }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+ //   for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><b><?php  echo ENTRY_META_KEYWORDS; ?></b></td>
+            <td class="main"><?php echo tep_draw_input_field('pages_meta_keywords[' . $languages[$i]['id'] . ']', tep_pages_get_page_meta_keywords($pInfo->pages_id, $languages[$i]['id']), 'style="width: 80%;"'); ?></td>
+          </tr>
+<?php
+ //   }
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+<?php
+ //   for ($i=0; $i<sizeof($languages); $i++) {
+?>
+          <tr>
+            <td class="main"><b><?php echo ENTRY_META_DESCRIPTION; ?></b></td>
+            <td class="main"><?php echo tep_draw_input_field('pages_meta_description[' . $languages[$i]['id'] . ']', tep_pages_get_page_meta_description($pInfo->pages_id, $languages[$i]['id']), 'style="width: 80%;"'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table>
+</td>
+                  </tr>
+                </table>
+              </div>
+<?php
+    }
+?>
+            </div>
+<script type="text/javascript">
+//<![CDATA[
+setupAllTabs();
+//]]>
+</script>
+</td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><?php echo (($action == 'edit') ? tep_image_submit('button_update.gif', IMAGE_UPDATE) : tep_image_submit('button_insert.gif', IMAGE_INSERT)) . ' <a href="' . tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('action'))) .'">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </tr></form>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('search', FILENAME_PAGES, '', 'get'); 
+            if (isset($HTTP_GET_VARS[tep_session_name()])) {
+              echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+            }
+          ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TITLE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $search = '';
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+      $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
+      $search = " and ipd.pages_title like '%" . $keywords . "%'";
+    }
+
+    $pages_query_raw = "select ip.pages_id, ip.pages_image, ip.pages_date_added, ip.pages_date_modified, ip.pages_author, ip.pages_status, ip.pages_sort_order, ipd.pages_title, ipd.pages_blurb from " . TABLE_PAGES . " ip left join " . TABLE_PAGES_DESCRIPTION . " ipd on ipd.pages_id = ip.pages_id where ipd.language_id = '" . (int)$languages_id . "'" . $search . " order by ip.pages_sort_order, ipd.pages_title";
+
+    $pages_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $pages_query_raw, $pages_query_numrows);
+    $pages_query = tep_db_query($pages_query_raw);
+    while ($pages = tep_db_fetch_array($pages_query)) {
+      if ((!isset($HTTP_GET_VARS['pID']) || (isset($HTTP_GET_VARS['pID']) && ($HTTP_GET_VARS['pID'] == $pages['pages_id']))) && !isset($pInfo)) {
+        $categories_query = tep_db_query("select icd.categories_id, icd.categories_name from " . TABLE_PAGES_TO_CATEGORIES . " ip2c left join " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd on icd.categories_id = ip2c.categories_id where ip2c.pages_id = '" . (int)$pages['pages_id'] . "' and icd.language_id = '" . (int)$languages_id . "'");
+        $category = tep_db_fetch_array($categories_query);
+
+        $pInfo_array = array_merge($pages, $category);
+        $pInfo = new objectInfo($pInfo_array);
+      }
+
+      if (isset($pInfo) && is_object($pInfo) && ($pages['pages_id'] == $pInfo->pages_id)) {
+        echo '          <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->pages_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('pID')) . 'pID=' . $pages['pages_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo $pages['pages_title']; ?></td>
+                <td  class="dataTableContent">
+<?php
+      if ($pages['pages_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_PAGES, 'action=setflag&flag=0&pID=' . $pages['pages_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_PAGES, 'action=setflag&flag=1&pID=' . $pages['pages_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($pInfo) && is_object($pInfo) && ($pages['pages_id'] == $pInfo->pages_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('pID')) . 'pID=' . $pages['pages_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+        <td class="smallText" valign="top"><?php echo $pages_split->display_count($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PAGES); ?></td>
+                    <td class="smallText" align="right"><?php echo $pages_split->display_links($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'pages', 'x', 'y', 'pID'))); ?></td>
+                  </tr>
+                  <tr>
+<?php
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+?>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PAGES) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PAGES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new.gif', IMAGE_NEW_PAGE) . '</a>'; ?></td>
+<?php
+    } else {
+?>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_PAGES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new.gif', IMAGE_NEW_PAGE) . '</a>'; ?></td>
+<?php
+    }
+?>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_PAGES_HEADING_DELETE_PAGE . '</b>');
+
+      $contents = array('form' => tep_draw_form('pages', FILENAME_PAGES, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->pages_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO . '<br><br><b>' . $pInfo->pages_title . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->pages_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($pInfo) && is_object($pInfo)) {
+        $heading[] = array('text' => '<b>' . $pInfo->pages_title . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->pages_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_PAGES, tep_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->pages_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+
+  if (tep_not_null($pInfo->categories_name)) {
+    $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORY . ' '  . $pInfo->categories_name);
+  }
+        $contents[] = array('align' => 'center', 
+          'text' => '<br>' . tep_info_image($pInfo->pages_image, $pInfo->pages_title, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT));
+        $contents[] = array('text' => '<br>' . $pInfo->pages_blurb);
+        $contents[] = array('text' => '<br>' . TEXT_DATE_PAGES_CREATED . ' ' . tep_date_short($pInfo->pages_date_added));
+
+  $contents[] = array('text' => '<br>' . TEXT_DATE_PAGES_LAST_MODIFIED . ' ' . tep_date_short($pInfo->pages_date_modified));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/pages_categories.php
===================================================================
--- trunk/direct.openmoko.com/admin/pages_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/pages_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,330 @@
+<?php
+/*
+  $Id: pages_categories.php,v 1.1.1.1 2004/03/04 23:38:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+require('includes/application_top.php');
+
+// define functions
+require(DIR_WS_FUNCTIONS . 'pages.php');
+
+// clean variables
+$cID = '';
+if (isset($HTTP_POST_VARS['cID']) && tep_not_null($HTTP_POST_VARS['cID'])) {
+  $cID = (int)$HTTP_POST_VARS['cID'];
+} elseif (isset($HTTP_GET_VARS['cID']) && tep_not_null($HTTP_GET_VARS['cID'])) {
+  $cID = (int)$HTTP_GET_VARS['cID'];
+}
+
+$action = '';
+if (isset($HTTP_POST_VARS['action']) && tep_not_null($HTTP_POST_VARS['action'])) {
+  $action = tep_db_prepare_input($HTTP_POST_VARS['action']);
+} elseif (isset($HTTP_GET_VARS['action']) && tep_not_null($HTTP_GET_VARS['action'])) {
+  $action = tep_db_prepare_input($HTTP_GET_VARS['action']);
+} 
+
+$error = false;
+$processed = false;
+
+switch ($action) {
+ case 'setflag':
+   $status = tep_db_prepare_input($HTTP_GET_VARS['flag']);
+
+   if ($status == '1') {
+     tep_db_query("update " . TABLE_PAGES_CATEGORIES . " set categories_status = '1' where categories_id = '" . (int)$cID . "'");
+   } elseif ($status == '0') {
+     tep_db_query("update " . TABLE_PAGES_CATEGORIES . " set categories_status = '0' where categories_id = '" . (int)$cID . "'");
+   }
+
+   tep_redirect(tep_href_link(FILENAME_PAGES_CATEGORIES, '&cID=' . $cID));
+   break;
+ case 'insert':
+ case 'update':
+   $categories_sort_order = tep_db_prepare_input($HTTP_POST_VARS['categories_sort_order']);
+   $categories_status = ((tep_db_prepare_input($HTTP_POST_VARS['categories_status']) == 'on') ? '1' : '0');
+
+   $sql_data_array = array('categories_sort_order' => $categories_sort_order,
+         'categories_status' => $categories_status);
+
+   if ($action == 'insert') {
+     $insert_sql_data = array('categories_date_added' => 'now()');
+
+     $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+     tep_db_perform(TABLE_PAGES_CATEGORIES, $sql_data_array);
+
+     $cID = tep_db_insert_id();
+   } elseif ($action == 'update') {
+     $update_sql_data = array('categories_last_modified' => 'now()');
+
+     $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+     tep_db_perform(TABLE_PAGES_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . (int)$cID . "'");
+   }
+
+   $languages = tep_get_languages();
+   for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+     $categories_name_array = $HTTP_POST_VARS['categories_name'];
+     $categories_description_array = $HTTP_POST_VARS['categories_description'];
+
+     $language_id = $languages[$i]['id'];
+
+     $sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]),
+           'categories_description' => tep_db_prepare_input($categories_description_array[$language_id]));
+
+     if ($action == 'insert') {
+       $insert_sql_data = array('categories_id' => $cID,
+        'language_id' => $languages[$i]['id']);
+
+       $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
+
+       tep_db_perform(TABLE_PAGES_CATEGORIES_DESCRIPTION, $sql_data_array);
+     } elseif ($action == 'update') {
+       tep_db_perform(TABLE_PAGES_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$cID . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
+     }
+   }
+
+   if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {
+     tep_db_query("update " . TABLE_PAGES_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$cID . "'");
+   }
+
+   tep_redirect(tep_href_link(FILENAME_PAGES_CATEGORIES, '&cID=' . $cID));
+   break;
+ case 'delete_confirm':
+   if (tep_not_null($cID)) {
+     $page_ids_query = tep_db_query("select pages_id from " . TABLE_PAGES_TO_CATEGORIES . " where categories_id = '" . (int)$cID . "'");
+
+     while ($page_ids = tep_db_fetch_array($page_ids_query)) {
+       tep_pages_remove_page($page_ids['pages_id']);
+     }
+
+     tep_pages_remove_category($cID);
+   }
+
+   tep_redirect(tep_href_link(FILENAME_PAGES_CATEGORIES));
+   break;
+}
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr><?php echo tep_draw_form('search', FILENAME_PAGES_CATEGORIES, '', 'get'); 
+            if (isset($HTTP_GET_VARS[tep_session_name()])) {
+              echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+            }
+          ?>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
+          </form></tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $search = '';
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+      $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
+      $search = " and icd.categories_name like '%" . $keywords . "%'";
+
+      $categories_query_raw = "select ic.categories_id, ic.categories_image, ic.categories_status, ic.categories_sort_order, ic.categories_date_added, ic.categories_last_modified, icd.categories_name, icd.categories_description from " . TABLE_PAGES_CATEGORIES . " ic left join " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd on ic.categories_id = icd.categories_id where icd.language_id = '" . (int)$languages_id . "'" . $search . " order by ic.categories_sort_order, icd.categories_name";
+    } else {
+      $categories_query_raw = "select ic.categories_id, ic.categories_image, ic.categories_status, ic.categories_sort_order, ic.categories_date_added, ic.categories_last_modified, icd.categories_name, icd.categories_description from " . TABLE_PAGES_CATEGORIES . " ic left join " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd on ic.categories_id = icd.categories_id where icd.language_id = '" . (int)$languages_id . "' order by ic.categories_sort_order, icd.categories_name";
+    }
+
+    $categories_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $categories_query_raw, $categories_query_numrows);
+    $categories_query = tep_db_query($categories_query_raw);
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $categories['categories_id']))) && !isset($cInfo)) {
+        $page_count_query = tep_db_query("select count(*) as categories_page_count from " . TABLE_PAGES_TO_CATEGORIES . " where categories_id = '" . (int)$categories['categories_id'] . "'");
+        $page_count = tep_db_fetch_array($page_count_query);
+
+        $cInfo_array = array_merge($categories, $page_count);
+        $cInfo = new objectInfo($cInfo_array);
+      }
+
+      if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id)) {
+        echo '          <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PAGES_CATEGORIES, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '          <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PAGES_CATEGORIES, tep_get_all_get_params(array('cID')) . 'cID=' . $categories['categories_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo $categories['categories_name']; ?></td>
+                <td  class="dataTableContent" align="right">
+<?php
+      if ($categories['categories_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES, 'action=setflag&flag=0&cID=' . $categories['categories_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES, 'action=setflag&flag=1&cID=' . $categories['categories_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($categories['categories_id'] == $cInfo->categories_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES, tep_get_all_get_params(array('cID')) . 'cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $categories_split->display_count($categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PAGES_CATEGORIES); ?></td>
+                    <td class="smallText" align="right"><?php echo $categories_split->display_links($categories_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'pages', 'x', 'y', 'cID'))); ?></td>
+                  </tr>
+                  <tr>
+<?php
+    if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
+?>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
+                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>'; ?></td>
+<?php
+    } else {
+?>
+                    <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_category.gif', IMAGE_NEW_CATEGORY) . '</a>'; ?></td>
+<?php
+    }
+?>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_PAGES_HEADING_NEW_PAGES_CATEGORY . '</b>');
+
+      $contents = array('form' => tep_draw_form('categories_new', FILENAME_PAGES_CATEGORIES, 'action=insert', 'post', 'enctype="multipart/form-data"'));
+      $contents[] = array('text' => TEXT_NEW_PAGES_CATEGORIES_INTRO);
+
+      $category_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $category_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']');
+      }
+
+      $category_description_inputs_string = '';
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $category_description_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;<br>' . tep_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '40', '5');
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_NAME . $category_inputs_string);
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_DESCRIPTION . $category_description_inputs_string);
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_SORT_ORDER . '&nbsp;' . tep_draw_input_field('categories_sort_order', '', 'size="2"'));
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_STATUS . '&nbsp;&nbsp;' . tep_draw_radio_field('categories_status', 'on', true) . ' ' . TEXT_PAGES_CATEGORIES_STATUS_ENABLE . '&nbsp;&nbsp;' . tep_draw_radio_field('categories_status', 'off') . ' ' . TEXT_PAGES_CATEGORIES_STATUS_DISABLE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_PAGES_HEADING_EDIT_PAGES_CATEGORY . '</b>');
+
+      $contents = array('form' => tep_draw_form('categories_edit', FILENAME_PAGES_CATEGORIES, 'action=update', 'post', 'enctype="multipart/form-data"') . tep_draw_hidden_field('cID', $cInfo->categories_id));
+      $contents[] = array('text' => TEXT_EDIT_PAGES_CATEGORIES_INTRO);
+
+      $category_inputs_string = '';
+      $languages = tep_get_languages();
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $category_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', tep_pages_get_category_name($cInfo->categories_id, $languages[$i]['id']));
+      }
+
+      $category_description_inputs_string = '';
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
+        $category_description_inputs_string .= '<br>' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;<br>' . tep_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '40', '5', tep_pages_get_category_description($cInfo->categories_id, $languages[$i]['id']));
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_NAME . $category_inputs_string);
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_DESCRIPTION . $category_description_inputs_string);
+      $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name) . '<br>' . $cInfo->categories_image);
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_SORT_ORDER . '&nbsp;' . tep_draw_input_field('categories_sort_order', $cInfo->categories_sort_order, 'size="2"'));
+      $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORIES_STATUS . '&nbsp;&nbsp;' . tep_draw_radio_field('categories_status', 'on', ($cInfo->categories_status == '1') ? true : false) . ' ' . TEXT_PAGES_CATEGORIES_STATUS_ENABLE . '&nbsp;&nbsp;' . tep_draw_radio_field('categories_status', 'off', ($cInfo->categories_status == '0') ? true : false) . ' ' . TEXT_PAGES_CATEGORIES_STATUS_DISABLE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES, 'cID=' . $cInfo->categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_PAGES_HEADING_DELETE_PAGES_CATEGORY . '</b>');
+
+      $contents = array('form' => tep_draw_form('categories_delete', FILENAME_PAGES_CATEGORIES, 'action=delete_confirm') . tep_draw_hidden_field('cID', $cInfo->categories_id));
+      $contents[] = array('text' => TEXT_DELETE_PAGES_CATEGORIES_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->categories_name . '</b>');
+      if ($cInfo->categories_page_count > 0) $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_PAGES, $cInfo->categories_page_count));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES, 'cID=' . $cInfo->categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->categories_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_PAGES_CATEGORIES, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+
+        $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->categories_image);
+        $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORY_DESCRIPTION . ' ' . $cInfo->categories_description);
+        $contents[] = array('text' => '<br>' . TEXT_DATE_PAGES_CATEGORY_CREATED . ' ' . tep_date_short($cInfo->categories_date_added));
+        if (tep_not_null($cInfo->categories_last_modified)) {
+          $contents[] = array('text' => '<br>' . TEXT_DATE_PAGES_CATEGORY_LAST_MODIFIED . ' ' . tep_date_short($cInfo->categories_last_modified));
+        }
+        $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORY_COUNT . ' '  . $cInfo->categories_page_count);
+        $contents[] = array('text' => '<br>' . TEXT_PAGES_CATEGORY_SORT_ORDER . ' '  . $cInfo->categories_sort_order);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/admin/password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,202 @@
+<?php
+/*
+  $Id: login.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
+    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
+    $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
+    $log_times = $HTTP_POST_VARS['log_times']+1;
+    if ($log_times >= 4) {
+      tep_session_register('password_forgotten');
+    }
+
+// Check if email exists
+    $check_admin_query = tep_db_query("select admin_id as check_id, admin_firstname as check_firstname, admin_lastname as check_lastname, admin_email_address as check_email_address from " . TABLE_ADMIN . " where admin_email_address = '" . tep_db_input($email_address) . "'");
+    if (!tep_db_num_rows($check_admin_query)) {
+      $HTTP_GET_VARS['login'] = 'fail';
+    } else {
+      $check_admin = tep_db_fetch_array($check_admin_query);
+      if ($check_admin['check_firstname'] != $firstname) {
+        $HTTP_GET_VARS['login'] = 'fail';
+      } else {
+        $HTTP_GET_VARS['login'] = 'success';
+
+        function randomize() {
+          $salt = "ABCDEFGHIJKLMNOPQRSTUVWXWZabchefghjkmnpqrstuvwxyz0123456789";
+          srand((double)microtime()*1000000);
+          $i = 0;
+
+          while ($i <= 7) {
+            $num = rand() % 33;
+          $tmp = substr($salt, $num, 1);
+          $pass = $pass . $tmp;
+          $i++;
+      }
+      return $pass;
+        }
+        $makePassword = randomize();
+
+        tep_mail($check_admin['check_firstname'] . ' ' . $check_admin['admin_lastname'], $check_admin['check_email_address'], ADMIN_EMAIL_SUBJECT, sprintf(ADMIN_EMAIL_TEXT, $check_admin['check_firstname'], HTTP_SERVER . DIR_WS_ADMIN, $check_admin['check_email_address'], $makePassword, STORE_OWNER), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+        tep_db_query("update " . TABLE_ADMIN . " set admin_password = '" . tep_encrypt_password($makePassword) . "' where admin_id = '" . $check_admin['check_id'] . "'");
+      }
+    }
+  }
+    require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
+  include('includes/functions/rss2html.php');
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<!-- Code related to index.php only -->
+<link type="text/css" rel="StyleSheet" href="includes/index.css" />
+<link type="text/css" rel="StyleSheet" href="includes/helptip.css" />
+<script type="text/javascript" src="includes/javascript/helptip.js"></script>
+<!-- code related to index.php EOF -->
+</head>
+<body>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<table width="100%"  border="0" align="center" cellpadding="2" cellspacing="2">
+  <tr>
+    <td valign="top" width="150">&nbsp;</td>
+    <td valign="top">
+      <table width="100%"  border="0" cellspacing="0" cellpadding="0" style="border:1px solid #CCCCCC; " summary="Title Table">
+        <tr>
+          <td align="center" class="pageHeading"><?php echo PROJECT_VERSION .'[' . PROJECT_PATCH .']';?><br>
+            <?php echo tep_draw_separator('pixel_trans.gif', '100%', '7'); ?>
+            <input type="submit" name="Submit" value="     <?php echo TEXT_CHECK_UPDATES;?>     " onclick="javascript:window.open('http://store.creloaded.com/index.php?cPath=27','k')">
+&nbsp;&nbsp;&nbsp;
+            <input type="submit" name="Submit" value="     <?php echo TEXT_GET_PRO;?>     " onclick="javascript:window.open('http://store.creloaded.com/index.php?cPath=27','k')">
+            <?php echo tep_draw_separator('pixel_trans.gif', '100%', '7'); ?></td>
+        </tr>
+      </table>
+      <?php echo tep_draw_separator('pixel_trans.gif', '100%', '40'); ?>
+      <table align="center" width="50%"  border="0" cellspacing="0" cellpadding="0" summary="Login Table">
+        <tr>
+          <td><fieldset>
+            <legend><?php echo HEADING_PASSWORD_FORGOTTEN; ?></legend>
+      <?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?>
+           <?php echo tep_draw_form('login', FILENAME_PASSWORD_FORGOTTEN, 'action=process'); ?>
+            <table border="0" width="100%" cellspacing="3" cellpadding="2" align="center" summary="Password Forgoten Table">
+
+<?php
+  if ($HTTP_GET_VARS['login'] == 'success') {
+    $success_message = TEXT_FORGOTTEN_SUCCESS;
+  } elseif ($HTTP_GET_VARS['login'] == 'fail') {
+    $info_message = TEXT_FORGOTTEN_ERROR;
+  }
+  if (tep_session_is_registered('password_forgotten')) {
+?>
+<table align="center" border="0" cellspacing="3" cellpadding="5" style="border:1px solid red;" summary="Error Message Table">
+                                    <tr>
+                                      <td class="smallText"><?php echo TEXT_FORGOTTEN_FAIL; ?></td>
+                                    </tr>
+                                    <tr>
+                                      <td align="center" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_LOGIN, '' , 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+                                    </tr>
+                  </table>
+<?php
+  } elseif (isset($success_message)) {
+?><table align="center" border="0" cellspacing="3" cellpadding="5" summary="Success Message Table">
+                                    <tr>
+                                      <td class="smallText"><?php echo $success_message; ?></td>
+                                    </tr>
+                                    <tr>
+                                      <td align="center" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_LOGIN, '' , 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+                                    </tr>
+                  </table>
+<?php
+  } else {
+    if (isset($info_message)) {
+?><table align="center" border="0" cellspacing="3" cellpadding="5" style="border:1px solid red;" summary="Error Message Table">
+                                    <tr>
+                                      <td colspan="2" class="smallText" align="center"><?php echo $info_message; ?><?php echo tep_draw_hidden_field('log_times', $log_times); ?></td>
+                                    </tr>
+                  </table>
+                  
+<?php
+    } else {
+?>
+                                    <tr>
+                                      <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?><?php echo tep_draw_hidden_field('log_times', '0'); ?></td>
+                                    </tr>
+                  </table>
+<?php
+    }
+?>
+
+<table border="0" width="100%" cellspacing="3" cellpadding="2" align="center" summary="Password Forgoten Table">
+                                    <tr>
+                                      <td class="login"><?php echo ENTRY_FIRSTNAME; ?></td>
+                                      <td class="login"><?php echo tep_draw_input_field('firstname'); ?></td>
+                                    </tr>
+                                    <tr>
+                                      <td class="login"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+                                      <td class="login"><?php echo tep_draw_input_field('email_address'); ?></td>
+                                    </tr>
+                                    <tr>
+                  <td>&nbsp;</td>
+                                      <td valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_LOGIN, '' , 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> ' . tep_image_submit('button_confirm.gif', IMAGE_BUTTON_LOGIN); ?>&nbsp;</td>
+                                    </tr>
+                  </table>
+<?php
+  }
+?>
+                                  
+            </form>
+            </fieldset></td>
+        </tr>
+      </table>
+      <?php echo tep_draw_separator('pixel_trans.gif', '100%', '40'); ?>
+      <table width="100%"  border="0" cellspacing="0" cellpadding="0" summary="Footer Banner Table">
+        <tr>
+          <td align="center"><!--Bottom Banner Code Start-->
+            <script language='JavaScript' type='text/javascript' src='http://adserver.chainreactionweb.com/adx.js'></script>
+            <script language='JavaScript' type='text/javascript'>
+      <!--
+      if (!document.phpAds_used) document.phpAds_used = ',';
+      phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
+
+      document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
+      document.write ("http://adserver.chainreactionweb.com/adjs.php?n=" + phpAds_random);
+      document.write ("&amp;what=zone:5");
+      document.write ("&amp;exclude=" + document.phpAds_used);
+      if (document.referrer)
+      document.write ("&amp;referer=" + escape(document.referrer));
+      document.write ("'><" + "/script>");
+      //-->
+      </script>
+            <noscript>
+            <a href='http://adserver.chainreactionweb.com/adclick.php?n=a3c513ce' target='_blank'><img src='http://adserver.chainreactionweb.com/adview.php?what=zone:5&amp;n=a3c513ce' border='0' alt=''></a>
+            </noscript>
+            <!--Bottom Banner Code End-->
+          </td>
+        </tr>
+      </table></td>
+    <td width="150" valign="top">&nbsp;</td>
+  </tr>
+</table>
+<table width="100%"  border="0" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" valign="top"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?><!-- E-Commerce Engine Copyright &copy; 2003 <a href="http://oscommerce.com" target="_blank">osCommerce</a> <br>
+      Supercharged by <a href="http://creloaded.com" target="_blank">CRE Loaded</a> --><?php echo PASS_FORGOTTEN_FOOTER?></td>
+  </tr>
+</table>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/paypal.php
===================================================================
--- trunk/direct.openmoko.com/admin/paypal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/paypal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,87 @@
+<?php
+/*
+  $Id: paypal.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  define('DIR_WS_CATALOG_MODULES',DIR_WS_CATALOG_LANGUAGES.'../modules/');
+
+  require(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/Page/Page.class.php');
+  require(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.inc.php');
+
+  $page = new PayPal_Page();
+  $page->setBaseDirectory(DIR_FS_CATALOG_MODULES . 'payment/paypal/');
+  $page->setBaseURL(HTTP_SERVER . DIR_WS_CATALOG_MODULES . 'payment/paypal/');
+  $page->includeLanguageFile('admin/languages',$language,'paypal.lng.php');
+  $page->addCSS('paypal.php?action=css&id=general');
+  $page->addCSS('paypal.php?action=css&id=stylesheet');
+  $page->addJavaScript($page->baseURL.'templates/js/general.js');
+  $action = (isset($HTTP_GET_VARS['action'])) ? $HTTP_GET_VARS['action'] : '';
+
+  switch($action) {
+    case 'details':
+      $page->setTitle(HEADING_DETAILS_TITLE);
+      $page->includeLanguageFile('admin/languages',$language,'TransactionDetails.lng.php');
+      $page->setContentFile(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/TransactionDetails.inc.php');
+      $page->setTemplate('popup');
+      break;
+    case 'itp':
+     include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/IPN/IPN.class.php');
+      $page->setTitle(HEADING_ITP_TITLE);
+      $page->setContentFile(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/TestPanel/TestPanel.inc.php');
+      $page->setTemplate('default');
+      $page->setOnLoad('javascript:window.focus();document.ipn.txn_id.select();');
+      break;
+    case 'itp-help':
+      $page->setTitle(HEADING_ITP_HELP_TITLE);
+      $page->setContentLangaugeFile(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/TestPanel/languages',$language,'Help.inc.php');
+      $page->setOnLoad('javascript:window.focus();');
+      $page->setTemplate('popup');
+      break;
+    case 'help':
+      $page->setTitle(HEADING_HELP_CONTENTS_TITLE);
+      $page->setContentLangaugeFile(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/languages',$language,'Help.inc.php');
+      $page->setOnLoad('javascript:window.focus();');
+      $page->setTemplate('popup');
+      break;
+    case 'help-cfg':
+      $page->setTitle(HEADING_HELP_CONFIG_TITLE);
+      $page->setContentLangaugeFile(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/languages',$language,'Help_Config.inc.php');
+      $page->setOnLoad('javascript:window.focus();');
+      $page->setTemplate('default');
+      break;
+    case 'help-faqs':
+      $page->setTitle(HEADING_HELP_FAQS_TITLE);
+      $page->setContentLangaugeFile(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/languages',$language,'Help_FAQs.inc.php');
+      $page->setOnLoad('javascript:window.focus();');
+      $page->setTemplate('default');
+      break;
+    case 'css':
+      header("Content-Type: text/css");
+      echo $page->getCSS($HTTP_GET_VARS['id']);
+      exit;
+      break;
+    case 'logo':
+      header('Content-Type: image/gif'); echo $page->logo(); exit;
+      break;
+    default:
+      $page->setContentFile(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/PayPal.inc.php');
+      $page->setTemplate('osC_Admin');
+      $page->setOnLoad('javascript:SetFocus();');
+     break;
+  }
+  require($page->template());
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/admin/popup_data_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/popup_data_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/popup_data_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,192 @@
+<?php
+/*
+  $Id: popup_data_help.php,v 1.1 2004/03/05 00:36:41 ccwjr Exp $
+
+ 
+  Copyright (c) 2005 Chainreactionworks
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  //$navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_POPUP_DATA_HELP);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<style type="text/css"><!--
+a { color:#080381; text-decoration:none; }
+a:hover { color:#aabbdd; text-decoration:underline; }
+a.text:link, a.text:visited { color: #000000; text-decoration: none; }
+a:text:hover { color: #000000; text-decoration: underline; }
+
+
+
+.smallText { font-family: Verdana, Arial, sans-serif; font-size: 10px; }
+/* info box */
+.DATAHeading { font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #ffffff; background-color: #B3BAC5; }
+.DATAContent { font-family: Verdana; font-size: 10pt; border: 1px outset #9B9B9B; 
+               padding-left: 4; padding-right: 4; padding-top: 1; 
+               padding-bottom: 1; background-color: #FFFFFF }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10" bgcolor="#DEE4E8">
+
+<?php
+  $heading = array();
+  $contents = array();
+
+    switch ($HTTP_GET_VARS['action']) {
+
+      case 'froogle_category':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_HEADING_SET_CATEGORIES . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_SET_CATEGORIES_HELP);
+      break;
+
+      case 'froogle_configure':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_HEADING_CONFIGURE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_CONFIGURE_HELP);
+      break;
+
+      case 'froogle_preprocess':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_HEADING_PRE_FEED . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_PRE_FEED_HELP);
+      break;
+
+      case 'froogle_send':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_HEADING_RUN . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_RUN_HELP);
+      break;
+
+      case 'position':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_DATA . '</b>');
+      $contents[] = array('text'  => TEXT_DATA_HELP_POSITION);
+      break;
+
+      case 'active':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_DATA . '</b>');
+      $contents[] = array('text'  => TEXT_DATA_HELP_ACTIVE);
+      break;
+
+ case 'FEED_LANG_USE':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_LANG_USE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_LANG_USE_HELP);
+      break;
+
+ case 'froogle_feed_name':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_NAME . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_NAME_HELP);
+      break;
+
+ case 'FROOGLE_FEED_DISC':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_DISC . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_DISC_HELP);
+      break;
+
+ case 'FROOGLE_FILE_TYPE':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_FILE_TYPE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_FILE_TYPE_HELP);
+      break;
+      
+case 'FROOGLE_FILE_TYPE_PRODUCT':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_TYPE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_TYPE_HELP);
+      break;
+case 'FROOGLE_FEED_SERVICE':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_FEED_SERVICE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_FEED_SERVICE_HELP);
+      break;      
+      
+case 'FROOGLE_FEED_STATUS':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_STATUS . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_STATUS_HELP);
+      break;      
+case 'FROOGLE_FEED_FILE':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_FILE_TYPE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_FILE_TYPE_HELP);
+      break;
+case 'FROOGLE_FEED_FILE':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_FILE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_FILE_HELP);
+      break; 
+case 'FROOGLE_FEED_IMAGE':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_IMAGE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_IMAGE_HELP);
+      break;
+case 'FROOGLE_FTP_SERVER':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_FTP_SERVER . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_FTP_SERVER_HELP);
+      break;  
+      
+case 'FROOGLE_FTP_USER':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_FTP_USER . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_FTP_USER_HELP);
+      break;  
+      
+
+case 'FROOGLE_FTP_PASSWORD':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_FTP_PASSWORD . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_FTP_PASSWORD_HELP);
+      break;  
+      
+
+case 'FROOGLE_FTP_DIRECTORY':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_FTP_DIRECTORY . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_FTP_DIRECTORY_HELP);
+      break;  
+      
+
+case 'FROOGLE_FEED_CUR':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_CUR . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_CUR_HELP);
+      break;  
+      
+
+case 'FROOGLE_CUR_USE':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_CUR_USE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_CUR_USE_HELP);
+      break;  
+      
+
+case 'FROOGLE_FEED_LANG':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_LANG . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_LANG_HELP);
+      break;  
+      
+
+case 'FROOGLE_LANG_USE':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_LANG_USE . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_LANG_USE_HELP);
+      break;  
+      
+
+case 'FROOGLE_CUR_CON':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_CUR_CON . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_CUR_CON_HELP);
+      break;  
+      
+
+case 'FROOGLE_FEED_TAX':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_FROOGLE_FEED_TAX . '</b>');
+      $contents[] = array('text'  => TEXT_FROOGLE_FEED_TAX_HELP);
+      break;  
+      
+    }
+ $box = new box;
+  echo $box->infoBox($heading, $contents);
+
+
+
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+
+</body>
+
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/popup_encrypt_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/popup_encrypt_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/popup_encrypt_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,118 @@
+<?php
+/*
+  $Id: popup_ep_help.php,v 1.1 2004/03/05 00:36:41 ccwjr Exp $
+
+ 
+  Copyright (c) 2005 Chainreactionworks
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  //$navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_POPUP_EP_HELP);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<style type="text/css"><!--
+a { color:#080381; text-decoration:none; }
+a:hover { color:#aabbdd; text-decoration:underline; }
+a.text:link, a.text:visited { color: #000000; text-decoration: none; }
+a:text:hover { color: #000000; text-decoration: underline; }
+
+
+
+.smallText { font-family: Verdana, Arial, sans-serif; font-size: 10px; }
+/* info box */
+.DATAHeading { font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #ffffff; background-color: #B3BAC5; }
+.DATAContent { font-family: Verdana; font-size: 10pt; border: 1px outset #9B9B9B; 
+               padding-left: 4; padding-right: 4; padding-top: 1; 
+               padding-bottom: 1; background-color: #FFFFFF }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10" bgcolor="#DEE4E8">
+
+<?php
+  $heading = array();
+  $contents = array();
+
+    switch ($HTTP_GET_VARS['action']) {
+
+      case 'ep_file_upload':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_FILE_UPLOAD . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_FILE_UPLOAD);
+      break;
+
+      case 'ep_file_upload_split':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_FILE_UPLOAD_SPLIT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_FILE_UPLOAD_SPLIT);
+      break;
+
+      case 'ep_file_insert':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_FILE_INSERT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_FILE_INSERT);
+      break;
+
+      case 'ep_file_export':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_FILE_EXPORT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_FILE_EXPORT);
+      break;
+
+      case 'ep_select_method':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_SELECT_METHOD . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_SELECT_METHOD);
+      break;
+
+      case 'ep_select_down':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_SELECT_DOWN . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_SELECT_DOWN);
+      break;
+
+      case 'ep_select_sort':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_SELECT_SORT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_SELECT_SORT);
+      break;
+
+      case 'ep_limit_rows':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_LIMIT_ROWS . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_ROWS);
+      break;
+
+      case 'ep_limit_cats':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_LIMIT_CATS . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_CATS);
+      break;
+
+      case 'ep_limit_man':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_LIMIT_MAN . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_MAN);
+      break;
+
+      case 'ep_limit_product':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_LIMIT_PRODUCT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT);
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT1);
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT2);
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT3);
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT4);
+      break;
+
+    }
+ $box = new box;
+  echo $box->infoBox($heading, $contents);
+
+
+
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+
+</body>
+
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/popup_ep_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/popup_ep_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/popup_ep_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,123 @@
+<?php
+/*
+  $Id: popup_ep_help.php,v 1.1 2004/03/05 00:36:41 ccwjr Exp $
+
+ 
+  Copyright (c) 2005 Chainreactionworks
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  //$navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_POPUP_EP_HELP);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<style type="text/css"><!--
+a { color:#080381; text-decoration:none; }
+a:hover { color:#aabbdd; text-decoration:underline; }
+a.text:link, a.text:visited { color: #000000; text-decoration: none; }
+a:text:hover { color: #000000; text-decoration: underline; }
+
+
+
+.smallText { font-family: Verdana, Arial, sans-serif; font-size: 10px; }
+/* info box */
+.DATAHeading { font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #ffffff; background-color: #B3BAC5; }
+.DATAContent { font-family: Verdana; font-size: 10pt; border: 1px outset #9B9B9B; 
+               padding-left: 4; padding-right: 4; padding-top: 1; 
+               padding-bottom: 1; background-color: #FFFFFF }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10" bgcolor="#DEE4E8">
+
+<?php
+  $heading = array();
+  $contents = array();
+
+    switch ($HTTP_GET_VARS['action']) {
+
+      case 'ep_file_upload':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_FILE_UPLOAD . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_FILE_UPLOAD);
+      break;
+
+      case 'ep_file_upload_split':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_FILE_UPLOAD_SPLIT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_FILE_UPLOAD_SPLIT);
+      break;
+      
+      case 'ep_file_split':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_FILE_SPLIT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_FILE_SPLIT);
+      break;
+
+      case 'ep_file_insert':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_FILE_INSERT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_FILE_INSERT);
+      break;
+
+      case 'ep_file_export':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_FILE_EXPORT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_FILE_EXPORT);
+      break;
+
+      case 'ep_select_method':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_SELECT_METHOD . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_SELECT_METHOD);
+      break;
+
+      case 'ep_select_down':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_SELECT_DOWN . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_SELECT_DOWN);
+      break;
+
+      case 'ep_select_sort':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_SELECT_SORT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_SELECT_SORT);
+      break;
+
+      case 'ep_limit_rows':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_LIMIT_ROWS . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_ROWS);
+      break;
+
+      case 'ep_limit_cats':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_LIMIT_CATS . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_CATS);
+      break;
+
+      case 'ep_limit_man':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_LIMIT_MAN . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_MAN);
+      break;
+
+      case 'ep_limit_product':
+      $heading[] = array('text' => '<b>' . TEXT_HEAD_HELP_EP_LIMIT_PRODUCT . '</b>');
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT);
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT1);
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT2);
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT3);
+      $contents[] = array('text'  => TEXT_HELP_EP_LIMIT_PRODUCT4);
+      break;
+
+    }
+ $box = new box;
+  echo $box->infoBox($heading, $contents);
+
+
+
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+
+</body>
+
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/popup_image.php
===================================================================
--- trunk/direct.openmoko.com/admin/popup_image.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/popup_image.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: popup_image.php,v 1.1.1.1 2004/03/04 23:38:52 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+if ($HTTP_GET_VARS['image']) {
+
+     $big_image = tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $HTTP_GET_VARS['image'], $HTTP_GET_VARS['image']);
+
+} else {
+
+  reset($HTTP_GET_VARS);
+  while (list($key, ) = each($HTTP_GET_VARS)) {
+    switch ($key) {
+      case 'banner':
+        $banners_id = tep_db_prepare_input($HTTP_GET_VARS['banner']);
+
+        $banner_query = tep_db_query("select banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'");
+        $banner = tep_db_fetch_array($banner_query);
+
+        $page_title = $banner['banners_title'];
+
+        if ($banner['banners_html_text']) {
+          $image_source = $banner['banners_html_text'];
+        } elseif ($banner['banners_image']) {
+          $image_source = tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $banner['banners_image'], $page_title);
+        }
+        break;
+    }
+  }
+ }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<title><?php echo $page_title . $HTTP_GET_VARS['image']; ?></title>
+<script language="javascript"><!--
+var i=0;
+
+function resize() {
+  if (navigator.appName == 'Netscape') i = 40;
+  window.resizeTo(document.images[0].width + 30, document.images[0].height + 60 - i);
+}
+//--></script>
+</head>
+
+<body onload="resize();">
+
+<?php
+   if ($HTTP_GET_VARS['image']) {
+         echo $big_image;
+         } else {
+         echo $image_source;
+   }
+ ?>
+
+</body>
+
+</html>

Added: trunk/direct.openmoko.com/admin/popup_infobox_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/popup_infobox_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/popup_infobox_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,102 @@
+<?php
+/*
+  $Id: popup_infobox_help.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  //$navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_POPUP_INFOBOX_HELP);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<style type="text/css"><!--
+a { color:#080381; text-decoration:none; }
+a:hover { color:#aabbdd; text-decoration:underline; }
+a.text:link, a.text:visited { color: #000000; text-decoration: none; }
+a:text:hover { color: #000000; text-decoration: underline; }
+
+
+
+.smallText { font-family: Verdana, Arial, sans-serif; font-size: 10px; }
+/* info box */
+.infoBoxHeading { font-family: Verdana, Arial, sans-serif; font-size: 11px; color: #ffffff; background-color: #B3BAC5; }
+.infoBoxContent { font-family: Verdana; font-size: 10pt; border: 1px outset #9B9B9B;
+               padding-left: 4; padding-right: 4; padding-top: 1;
+               padding-bottom: 1; background-color: #FFFFFF }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10" bgcolor="#DEE4E8">
+
+<?php
+  $heading = array();
+  $contents = array();
+
+    switch ($HTTP_GET_VARS['action']) {
+
+      case 'filename':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_INFOBOX . '</b>');
+      $contents[] = array('text'  => TEXT_INFOBOX_HELP_FILENAME);
+      break;
+
+      case 'heading':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_INFOBOX . '</b>');
+      $contents[] = array('text'  => TEXT_INFOBOX_HELP_HEADING);
+      break;
+
+      case 'define':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_INFOBOX . '</b>');
+      $contents[] = array('text'  => TEXT_INFOBOX_HELP_DEFINE);
+      break;
+
+      case 'column':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_INFOBOX . '</b>');
+      $contents[] = array('text'  => TEXT_INFOBOX_HELP_COLUMN);
+      break;
+
+      case 'position':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_INFOBOX . '</b>');
+      $contents[] = array('text'  => TEXT_INFOBOX_HELP_POSITION);
+      break;
+
+      case 'active':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_INFOBOX . '</b>');
+      $contents[] = array('text'  => TEXT_INFOBOX_HELP_ACTIVE);
+      break;
+
+      case 'color':
+          $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_INFOBOX . '</b>');
+          $contents[] = array('text'  => TEXT_INFOBOX_HELP_COLOR);
+          break;
+
+
+      case 'template':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_INFOBOX . '</b>');
+        $contents[] = array('text'  => TEXT_INFOBOX_HELP_TEMPLATE);
+      break;
+
+    }
+ $box = new box;
+  echo $box->infoBox($heading, $contents);
+
+
+
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+
+</body>
+
+</html>

Added: trunk/direct.openmoko.com/admin/print.css
===================================================================
--- trunk/direct.openmoko.com/admin/print.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/print.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+/*
+  $Id: print.css,v 1.3 2003 
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+*/
+
+/* links */
+a:link { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #FF9900; font-weight: normal; }
+a:hover { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #0000ff; font-weight: bold; }
+
+/* page */
+body { background-color: #ffffff; color: #000000; margin: 0px; }
+.pageHeading { font-family: Verdana, Arial, sans-serif; font-size: 14px; color: #727272; font-weight: bold; }
+
+/* data table */
+.dataTableHeadingRow { background-color: #C9C9C9; }
+.dataTableHeadingContent { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; font-weight: bold; }
+.dataTableRow { background-color: #F0F1F1; }
+.dataTableRowSelected { background-color: #DEE4E8; }
+.dataTableRowOver { background-color: #FFFFFF; }
+.dataTableContent { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; }
+
+/* attributes */
+.attributes-odd { background-color: #f4f7fd; }
+.attributes-even { background-color: #ffffff; }
+
+/* miscellaneous */
+.specialPrice { color: #ff0000; }
+.oldPrice { text-decoration: line-through; }
+.fieldRequired { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ff0000; }
+.smallText { font-family: Verdana, Arial, sans-serif; font-size: 10px; }
+.main { font-family: Verdana, Arial, sans-serif; font-size: 12px; }
+.titleHeading {font-family: Verdana, Arial, sans-serif; font-size: 18px; color: #727272; font-weight: bold;
+}

Added: trunk/direct.openmoko.com/admin/product_list_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/product_list_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/product_list_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,206 @@
+<?php
+/*
+  $Id: template_admin.php,v 1.1.1.1 2004/03/04 23:39:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//300
+
+  require('includes/application_top.php');
+  $gID = '8';
+  // #CP - local dir to the template directory where you are uploading the company logo
+  $template_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_TEMPLATE'");
+  $template = tep_db_fetch_array($template_query);
+  $CURR_TEMPLATE = $template['configuration_value'] . '/';
+
+  $upload_fs_dir = DIR_FS_TEMPLATES.$CURR_TEMPLATE.DIR_WS_IMAGES;
+  $upload_ws_dir = DIR_WS_TEMPLATES.$CURR_TEMPLATE.DIR_WS_IMAGES;
+  // #CP
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'save':
+        $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);
+        $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_PRODUCT_LIST_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+        break;
+
+
+// #CP - supporting functions to upload company logo to template images directory
+    }
+// #CP
+  }
+
+
+  $cfg_group_query = tep_db_query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '350'");
+  $cfg_group = tep_db_fetch_array($cfg_group_query);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="12">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo TEXT_HEADER_EXPLAIN ; ?></td>
+            <td" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>            
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+           <td colspan="3" class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_LAYOUT; ?></td>
+          </tr>
+<?php // layout box configuration 
+;?>
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '" . (int)$gID . "' order by sort_order");
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+    if (tep_not_null($configuration['use_function'])) {
+      $use_function = $configuration['use_function'];
+      if (ereg('->', $use_function)) {
+        $class_method = explode('->', $use_function);
+        if (!is_object(${$class_method[0]})) {
+          include(DIR_WS_CLASSES . $class_method[0] . '.php');
+          ${$class_method[0]} = new $class_method[0]();
+        }
+        $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
+      } else {
+        $cfgValue = tep_call_function($use_function, $configuration['configuration_value']);
+      }
+    } else {
+      $cfgValue = $configuration['configuration_value'];
+    }
+
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cfg_extra_query = tep_db_query("select configuration_key, configuration_description, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . (int)$configuration['configuration_id'] . "'");
+      $cfg_extra = tep_db_fetch_array($cfg_extra_query);
+
+      $cInfo_array = array_merge($configuration, $cfg_extra);
+      $cInfo = new objectInfo($cInfo_array);
+    }
+
+    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
+      if($cInfo->set_function == 'file_upload'){
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCT_LIST_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=upload') . '\'">' . "\n";
+      } else {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCT_LIST_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
+      }
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCT_LIST_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $configuration['configuration_title']; ?></td>
+                <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_PRODUCT_LIST_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>                  </table></td>
+
+            
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'edit':
+      $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function) {
+        eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value) . '");');
+      } else {
+        $value_field = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
+      }
+
+      $contents = array('form' => tep_draw_form('configuration', FILENAME_PRODUCT_LIST_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_LIST_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function == 'file_upload') {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_LIST_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=upload') . '">' . tep_image_button('button_upload.gif', IMAGE_EDIT) . '</a>'.'<p>');
+        $contents[] = array('align' => 'center', 'text' => tep_image($upload_ws_dir . $cInfo->configuration_value, IMAGE_EDIT));
+      } else {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_LIST_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+      }
+        $contents[] = array('text' => '<br>' . $cInfo->configuration_description);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
+        if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
+      }
+
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/products_attributes.php
===================================================================
--- trunk/direct.openmoko.com/admin/products_attributes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/products_attributes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1064 @@
+<?php
+/*
+  $Id: products_attributes.php,v 1.3 2004/03/16 22:36:34 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  $languages = tep_get_languages();
+  
+  $page_info = 'option_page=' . (isset($HTTP_GET_VARS['option_page']) ? $HTTP_GET_VARS['option_page'] : '1') . '&value_page=' . (isset($HTTP_GET_VARS['value_page']) ? $HTTP_GET_VARS['value_page'] : '1') . '&attribute_page=' . (isset($HTTP_GET_VARS['attribute_page']) ? $HTTP_GET_VARS['attribute_page'] : '1');
+    
+  if ($HTTP_GET_VARS['action']) {
+    switch($HTTP_GET_VARS['action']) {
+      case 'add_product_options':
+     
+          $options_type = $HTTP_POST_VARS['options_type'];
+          $options_length= $HTTP_POST_VARS['options_length'];
+          $products_options_sort_order = $HTTP_POST_VARS['products_options_sort_order'];
+       tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_sort_order, options_type, options_length) values ('" . $HTTP_POST_VARS['products_options_id'] . "', '" . $products_options_sort_order . "', '" . $options_type . "', '" . $options_length . "')");
+
+      
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
+          $language_id = $languages[$i]['id'];
+          $products_options_name = $HTTP_POST_VARS['products_options_name'];
+          $products_options_instruct = $HTTP_POST_VARS['products_options_instruct'];
+     tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_TEXT . " (products_options_text_id, products_options_name, language_id, products_options_instruct) values ('" . $HTTP_POST_VARS['products_options_id'] . "', '" . $option_name[$languages[$i]['id']] . "', '" . $language_id . "', '" . $products_options_instruct[$languages[$i]['id']] . "')");
+        }
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
+        break;
+      case 'add_product_option_values':
+        $value_name_array = $HTTP_POST_VARS['value_name'];
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
+          $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]);
+          tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . $HTTP_POST_VARS['value_id'] . "', '" . $languages[$i]['id'] . "', '" . tep_db_input($value_name) . "')");
+        }
+        tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_id, products_options_values_id) values ('" . $HTTP_POST_VARS['option_id'] . "', '" . $HTTP_POST_VARS['value_id'] . "')");
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
+        break;
+      case 'add_product_attributes':
+// BOF: WebMakers.com Added: Attribute Sorter
+// OLD        tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $HTTP_POST_VARS['products_id'] . "', '" . $HTTP_POST_VARS['options_id'] . "', '" . $HTTP_POST_VARS['values_id'] . "', '" . $HTTP_POST_VARS['value_price'] . "', '" . $HTTP_POST_VARS['price_prefix'] . "', '" . $HTTP_POST_VARS['sort_order'] . "')");
+        tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $HTTP_POST_VARS['products_id'] . "', '" . $HTTP_POST_VARS['options_id'] . "', '" . $HTTP_POST_VARS['values_id'] . "', '" . $HTTP_POST_VARS['value_price'] . "', '" . $HTTP_POST_VARS['price_prefix'] . "', '" . $HTTP_POST_VARS['sort_order'] . "')");
+// EOF: WebMakers.com Added: Attribute Sorter
+        $products_attributes_id = tep_db_insert_id();
+        if ((DOWNLOAD_ENABLED == 'true') && $HTTP_POST_VARS['products_attributes_filename'] != '') {
+          tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values (" . $products_attributes_id . ", '" . $HTTP_POST_VARS['products_attributes_filename'] . "', '" . $HTTP_POST_VARS['products_attributes_maxdays'] . "', '" . $HTTP_POST_VARS['products_attributes_maxcount'] . "')");
+        }
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
+        break;
+      case 'update_option_name':
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
+// WebMakers.com Added: Product Options Sort Order
+          $option_name = $HTTP_POST_VARS['option_name'];
+          $products_options_sort_order = $HTTP_POST_VARS['products_options_sort_order'];
+          $options_type = $HTTP_POST_VARS['option_type'];
+          $options_length = $HTTP_POST_VARS['products_options_length'];
+          $option_id = $HTTP_POST_VARS['option_id'];
+          $products_options_instruct = $HTTP_POST_VARS['products_options_instruct'];
+          
+      tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set options_type = '" . $options_type . "', options_length = '" . $options_length . "', products_options_sort_order = '" . $products_options_sort_order . "' where products_options_id = '" . $option_id . "'");
+      tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_TEXT . " set products_options_instruct = '" . $products_options_instruct[$languages[$i]['id']] . "', products_options_name = '" . $option_name[$languages[$i]['id']] . "' where  products_options_text_id = '" . $HTTP_POST_VARS['option_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");
+    
+        }
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
+        break;
+      case 'update_value':
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
+          $value_name = $HTTP_POST_VARS['value_name'];
+          tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . $value_name[$languages[$i]['id']] . "' where products_options_values_id = '" . $HTTP_POST_VARS['value_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");
+        }
+        tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " set products_options_id = '" . $HTTP_POST_VARS['option_id'] . "', products_options_values_id = '" . $HTTP_POST_VARS['value_id'] . "'  where products_options_values_to_products_options_id = '" . $HTTP_POST_VARS['value_id'] . "'");
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
+        break;
+      case 'update_product_attribute':
+// BOF: WebMakers.com Added: Attribute Sorter
+          tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . $HTTP_POST_VARS['products_id'] . "', options_id = '" . $HTTP_POST_VARS['options_id'] . "', options_values_id = '" . $HTTP_POST_VARS['values_id'] . "', options_values_price = '" . $HTTP_POST_VARS['value_price'] . "', price_prefix = '" . $HTTP_POST_VARS['price_prefix'] . "', products_options_sort_order = '" . $HTTP_POST_VARS['sort_order'] . "' where products_attributes_id = '" . $HTTP_POST_VARS['attribute_id'] . "'");
+//        tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . $HTTP_POST_VARS['products_id'] . "', options_id = '" . $HTTP_POST_VARS['options_id'] . "', options_values_id = '" . $HTTP_POST_VARS['values_id'] . "', options_values_price = '" . $HTTP_POST_VARS['value_price'] . "', price_prefix = '" . $HTTP_POST_VARS['price_prefix'] . "', products_options_sort_order = '" . $HTTP_POST_VARS['sort_order'] . "'");
+// EOF: WebMakers.com Added: Attribute Sorter
+// BOM Mod: allow for the download filename to be added or deleted when doing an edit
+        if (DOWNLOAD_ENABLED == 'true') {
+          $download_query_raw ="select products_attributes_filename from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
+                              where products_attributes_id='" . $HTTP_POST_VARS['attribute_id'] . "'";
+          $download_query = tep_db_query($download_query_raw);
+          if (tep_db_num_rows($download_query) > 0) {
+            $download_attribute_found = true;
+          } else {
+            $download_attribute_found = false;
+          }
+          if ($HTTP_POST_VARS['products_attributes_filename'] != '') {
+            if ($download_attribute_found) {
+              tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
+                            set products_attributes_filename='" . $HTTP_POST_VARS['products_attributes_filename'] . "',
+                                products_attributes_maxdays='" . $HTTP_POST_VARS['products_attributes_maxdays'] . "',
+                                products_attributes_maxcount='" . $HTTP_POST_VARS['products_attributes_maxcount'] . "'
+                            where products_attributes_id = '" . $HTTP_POST_VARS['attribute_id'] . "'");
+            } else {
+              tep_db_query("insert " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
+                            set products_attributes_id = '" . $HTTP_POST_VARS['attribute_id'] . "',
+                                products_attributes_filename='" . $HTTP_POST_VARS['products_attributes_filename'] . "',
+                                products_attributes_maxdays='" . $HTTP_POST_VARS['products_attributes_maxdays'] . "',
+                                products_attributes_maxcount='" . $HTTP_POST_VARS['products_attributes_maxcount'] . "'");
+            }
+          } else {
+            if ($download_attribute_found) {
+              tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
+                            where products_attributes_id = '" . $HTTP_POST_VARS['attribute_id'] . "'");
+            }
+          }
+        }
+// EOM Mod:
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
+        break;
+      case 'delete_option':
+        tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_TEXT . " where products_options_text_id = '" . $HTTP_GET_VARS['option_id'] . "'");
+        tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $HTTP_GET_VARS['option_id'] . "'");
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
+        break;
+      case 'delete_value':
+        tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . $HTTP_GET_VARS['value_id'] . "'");
+        tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . $HTTP_GET_VARS['value_id'] . "'");
+        tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_values_id = '" . $HTTP_GET_VARS['value_id'] . "'");
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
+        break;
+      case 'delete_attribute':
+        tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id = '" . $HTTP_GET_VARS['attribute_id'] . "'");
+// Added for DOWNLOAD_ENABLED. Always try to remove attributes, even if downloads are no longer enabled
+        tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . $HTTP_GET_VARS['attribute_id'] . "'");
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript"><!--
+function go_option() {
+  if (document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value != "none") {
+    location = "<?php echo tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . ($HTTP_GET_VARS['option_page'] ? $HTTP_GET_VARS['option_page'] : 1)); ?>&option_order_by="+document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value;
+  }
+}
+var options_obj = new Object();
+<?php
+  $values_query = tep_db_query("select povtpo.products_options_id, pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " povtpo,  " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pov.products_options_values_id = povtpo.products_options_values_id and language_id = '" . (int)$languages_id . "' order by povtpo.products_options_id");
+  $notFirstTime = False;
+  $last_option = '';
+  while ($values = tep_db_fetch_array($values_query)) {
+    if ( $values['products_options_id'] != $last_option ) {
+      if ( $notFirstTime ) {      
+        $option_str .= ']; options_obj["' . $values['products_options_id'] . '"] = [' . $values['products_options_values_id'];
+      } else {
+        $option_str .= ' options_obj["' . $values['products_options_id'] . '"] = [' . $values['products_options_values_id'];
+      }
+      $last_option = $values['products_options_id'];
+    } else {
+      $option_str .= ', ' . $values['products_options_values_id'];
+    }
+    $notFirstTime = true;
+  }
+  $option_str.= "]; \n";
+  
+  echo $option_str;
+  
+?>
+var values_obj = new Object();
+<?php
+  $values_query = tep_db_query("select products_options_values_id, products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id = '" . (int)$languages_id . "' order by products_options_values_id");
+  while ($values = tep_db_fetch_array($values_query)) {
+    $value_str .= ' values_obj["' . $values['products_options_values_id'] . '"] = \'' . $values['products_options_values_name'] . '\'; ';
+  }
+  
+  echo $value_str . "\n";
+  
+?>
+function setvalues(form) {
+  opt = document[form].options_id.options[document[form].options_id.selectedIndex].value;
+  document[form].values_id.options.length = 0;
+  if ( options_obj[opt] instanceof Array ) {
+    for ( var v in options_obj[opt] ) {
+      document[form].values_id.options[document[form].values_id.options.length] = new Option( values_obj[options_obj[opt][v]], options_obj[opt][v] );
+    }
+  } else {
+    document[form].values_id.options[document[form].values_id.options.length] = new Option( '<?php echo JAVASCRIPT_TEXT_OPTION_TYPE_TEXT; ?>', 0 );
+  }
+  
+}
+//--></script>
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+<!-- options and values//-->
+      <tr>
+        <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
+          <tr>
+<!-- product_options //-->          
+            <td valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="2">
+<!-- options //-->
+<?php
+  if ($HTTP_GET_VARS['action'] == 'delete_product_option') { // delete product option
+    $options = tep_db_query("select po.products_options_id, pot.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_OPTIONS_TEXT  . " pot where pot.products_options_text_id = po.products_options_id and pot.language_id = '" . (int)$languages_id . "' order by po.products_options_sort_order, pot.products_options_name");
+    $options_values = tep_db_fetch_array($options);
+?>
+              <tr>
+                <td class="pageHeading">&nbsp;<?php echo $options_values['products_options_name']; ?>&nbsp;</td>
+                <td>&nbsp;<?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '53'); ?>&nbsp;</td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td colspan="3"><?php echo tep_black_line(); ?></td>
+                  </tr>
+<?php
+    //$products = tep_db_query("select p.products_id, pd.products_name, pov.products_options_values_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pov.language_id = '" . (int)$languages_id . "' and pd.language_id = '" . (int)$languages_id . "' and pa.products_id = p.products_id and pa.options_id='" . $HTTP_GET_VARS['option_id'] . "' and pov.products_options_values_id = pa.options_values_id order by pd.products_name");
+
+    $products = tep_db_query("select pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po left join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on pov.products_options_values_id = pov2po.products_options_values_id where pov2po.products_options_id = '" . (int)$HTTP_GET_VARS['option_id'] . "' and pov.language_id = '" . (int)$languages_id . "'");
+
+    if (tep_db_num_rows($products)) {
+?>
+                  <tr class="dataTableHeadingRow">
+                    <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_ID; ?>&nbsp;</td>
+                    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT; ?>&nbsp;</td>
+                    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_VALUE; ?>&nbsp;</td>
+                  </tr>
+                  <tr>
+                    <td colspan="7"><?php echo tep_black_line(); ?></td>
+                  </tr>
+<?php
+      while ($products_values = tep_db_fetch_array($products)) {
+        $rows++;
+?>
+                  <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
+                    <td align="center" class="smallText">&nbsp;<?php echo $products_values['products_id']; ?>&nbsp;</td>
+                    <td class="smallText">&nbsp;<?php echo $products_values['products_name']; ?>&nbsp;</td>
+                    <td class="smallText">&nbsp;<?php echo $products_values['products_options_values_name']; ?>&nbsp;</td>
+                  </tr>
+<?php
+      }
+?>
+                  <tr>
+                    <td colspan="3"><?php echo tep_black_line(); ?></td>
+                  </tr>
+                  <tr>
+                    <td colspan="3" class="main"><br><?php echo TEXT_WARNING_OF_DELETE; ?></td>
+                  </tr>
+                  <tr>
+                    <td align="right" colspan="3" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a>&nbsp;</td>
+                  </tr>
+<?php
+    } else {
+?>
+                  <tr>
+                    <td class="main" colspan="3"><br><?php echo TEXT_OK_TO_DELETE; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_option&option_id=' . $HTTP_GET_VARS['option_id'] . '&' . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_delete.gif', ' delete '); ?></a>&nbsp;&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, (isset($HTTP_GET_VARS['order_by']) ? 'order_by=' . $HTTP_GET_VARS['order_by'] . '&' : '') . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a>&nbsp;</td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+              </tr>
+<?php
+  } else {
+    if (isset($HTTP_GET_VARS['option_order_by'])) {
+      $option_order_by = $HTTP_GET_VARS['option_order_by'];
+    } else {
+      $option_order_by = 'products_options_id';
+    }
+?>
+              <tr>
+                <td colspan="2" class="pageHeading">&nbsp;<?php echo HEADING_TITLE_OPT; ?>&nbsp;</td>
+                <td class="smallText" align="center"><?php echo TEXT_OPTION_SORTORDER; ?><br><form name="option_order_by" action="<?php echo FILENAME_PRODUCTS_ATTRIBUTES; ?>"><select name="selected" onChange="go_option()"><option value="products_options_id"<?php if ($option_order_by == 'products_options_id') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_ID; ?></option><option value="products_options_name"<?php if ($option_order_by == 'products_options_name') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_NAME; ?></option></select></form></td>
+              </tr>
+              <tr>
+                <td colspan="3" class="smallText">
+<?php
+    $per_page = MAX_ROW_LISTS_OPTIONS;
+    $options = "select * from " . TABLE_PRODUCTS_OPTIONS . " po," . TABLE_PRODUCTS_OPTIONS_TEXT . " pot where pot.products_options_text_id = po.products_options_id and pot.language_id = '" . (int)$languages_id . "' order by " . $option_order_by;
+    if (!isset($option_page)) {
+      $option_page = 1;
+    }
+    $prev_option_page = $option_page - 1;
+    $next_option_page = $option_page + 1;
+
+    $option_query = tep_db_query($options);
+
+    $option_page_start = ($per_page * $option_page) - $per_page;
+    $num_rows = tep_db_num_rows($option_query);
+
+    if ($num_rows <= $per_page) {
+      $num_pages = 1;
+    } else if (($num_rows % $per_page) == 0) {
+      $num_pages = ($num_rows / $per_page);
+    } else {
+      $num_pages = ($num_rows / $per_page) + 1;
+    }
+    $num_pages = (int) $num_pages;
+    
+    if ($option_page_start <= '0'){
+         $option_page_start = '0';
+         }
+
+    $options = $options . " LIMIT $option_page_start, $per_page";
+
+    // Previous
+    if ($prev_option_page)  {
+      echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . $prev_option_page) . '"> &lt;&lt; </a> | ';
+    }
+
+    for ($i = 1; $i <= $num_pages; $i++) {
+      if ($i != $option_page) {
+        echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . $i) . '">' . $i . '</a> | ';
+      } else {
+        echo '<b><font color=red>' . $i . '</font></b> | ';
+      }
+    }
+
+    // Next
+    if ($option_page != $num_pages) {
+      echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . $next_option_page) . '"> &gt;&gt; </a>';
+    }
+// WebMakers.com Added: Product Options Sort Order
+?>
+                </td>
+              </tr>
+              <tr>
+                <td colspan="7"><?php echo tep_black_line(); ?></td>
+              </tr>
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_ID; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_NAME; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_OPTION_COMMENTS; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_TYPE; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_OPT_SIZE; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_OPTION_SORT_ORDER; ?>&nbsp;</td>
+
+                <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+              <tr>
+                <td colspan="7"><?php echo tep_black_line(); ?></td>
+              </tr>
+<?php
+    $next_id = 1;
+    $options = tep_db_query($options);
+    while ($options_values = tep_db_fetch_array($options)) {
+      $rows++;
+?>
+              <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
+<?php
+//edit line
+      if (($HTTP_GET_VARS['action'] == 'update_option') && ($HTTP_GET_VARS['option_id'] == $options_values['products_options_id'])) {
+        echo '<form name="option" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option_name&' . $page_info, 'NONSSL') . '" method="post">';
+//get option data
+        $inputs = '<td><table>';
+          $option_name_raw = tep_db_query("select  po.options_type, po.options_length, po.products_options_sort_order from " . TABLE_PRODUCTS_OPTIONS . " po where po.products_options_id = '" . $options_values['products_options_id'] . "' order by products_options_sort_order");
+          $option_name = tep_db_fetch_array($option_name_raw);
+//name and comments
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
+         $option_name_raw1 = tep_db_query("select pot.products_options_name, pot.products_options_instruct from " . TABLE_PRODUCTS_OPTIONS_TEXT  . " pot where  pot.products_options_text_id ='" . $options_values['products_options_id'] ."' and pot.language_id = '" . $languages[$i]['id'] . "'");
+         $option_name1 = tep_db_fetch_array($option_name_raw1);
+    $inputs .= '<tr><td class="smallText">' . $languages[$i]['code'] . ':&nbsp;</td><td class="smallText"><input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="15" value="' . $option_name1['products_options_name'] . '">&nbsp;</td><td class="smallText"><input type="text" name="products_options_instruct[' . $languages[$i]['id'] . ']" size="20" value="' . $option_name1['products_options_instruct']. '"></td></tr>';
+    }
+ //display rest of data
+ $inputs .= '</table></td><td class="smallText" align="left">' . draw_optiontype_pulldown('option_type', $options_values['options_type']) . '</td> <td class="smallText" align="left"><input type="text" name="products_options_length" size="3" value="' . $option_name['options_length'] . '"> <td class="smallText" align="center"><input type="text" name="products_options_sort_order" size="3" value="' . $option_name['products_options_sort_order'] . '"></td></tr>';
+?>
+                <td align="center" class="smallText">&nbsp;<?php echo $options_values['products_options_id']; ?><input type="hidden" name="option_id" value="<?php echo $options_values['products_options_id']; ?>">&nbsp;</td>
+                <td colspan="5" class="smallText"><table border="0" width="100%" cellspacing="0" cellpadding="0">  <?php echo $inputs; ?> </table> </td>
+                <td align="center" class="smallText">&nbsp;<?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>&nbsp;</td>
+
+         <?php
+        echo '</form>' . "\n";
+      } else {
+// regular list line
+?>
+                <td align="center" class="smallText">&nbsp;<?php echo $options_values["products_options_id"]; ?>&nbsp;</td>
+                <td class="smallText">&nbsp;<?php echo $options_values["products_options_name"]; ?>&nbsp;</td>
+                <td class="smallText" align="left">&nbsp;<?php echo $options_values["products_options_instruct"]; ?>&nbsp;</td>
+                <td class="smallText">&nbsp;<?php echo translate_type_to_name($options_values["options_type"]); ?>&nbsp;</td>
+                <td align="center" class="smallText">&nbsp;<?php echo $options_values["options_length"]; ?>&nbsp;</td>
+                <td class="smallText" align="center">&nbsp;<?php echo $options_values["products_options_sort_order"]; ?>&nbsp;</td>
+                <td align="center" class="smallText">&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option&option_id=' . $options_values['products_options_id'] . '&option_order_by=' . $option_order_by . '&option_page=' . $option_page, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_option&option_id=' . $options_values['products_options_id'], 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); ?></a>&nbsp;</td>
+<?php
+      }
+?>
+              </tr>
+<?php
+      $max_options_id_query = tep_db_query("select max(products_options_id) + 1 as next_id from " . TABLE_PRODUCTS_OPTIONS);
+      $max_options_id_values = tep_db_fetch_array($max_options_id_query);
+      $next_id = $max_options_id_values['next_id'];
+    }
+?>
+              <tr>
+                <td colspan="7"><?php echo tep_black_line(); ?></td>
+              </tr>
+<?php //new option line
+    if ($HTTP_GET_VARS['action'] != 'update_option') {
+?>
+
+<?php
+// WebMakers.com Added: Product Options Sort Order
+      echo '<form name="options" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=add_product_options&' . $page_info, 'NONSSL') . '" method="post"><input type="hidden" name="products_options_id" value="' . $next_id . '">';
+      $inputs = '';
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
+          $inputs .= '<tr><td>' . $languages[$i]['code'] . ':&nbsp;</td><td><input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="20">&nbsp;</td><td><input type="text" name="products_options_instruct[' . $languages[$i]['id'] . ']" size="32">&nbsp;</td></tr>';
+      }
+?><tr>
+   <td colspan="7" width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+
+               <tr class="dataTableHeadingRow">
+                  <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_ID; ?>&nbsp;</td>
+                 <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_LANGUAGE; ?>&nbsp;&nbsp;&nbsp;<?php echo TABLE_HEADING_OPT_NAME; ?>&nbsp;</td>
+                 <td class="dataTableHeadingContent" align="left">&nbsp;<?php echo TABLE_HEADING_OPTION_COMMENTS; ?>&nbsp;</td>
+                 <td class="dataTableHeadingContent" align="left">&nbsp;<?php echo TABLE_HEADING_OPT_TYPE; ?>&nbsp;</td>
+                 <td class="dataTableHeadingContent" align="left">&nbsp;&nbsp;&nbsp;<?php echo TABLE_HEADING_OPT_SIZE; ?>&nbsp;</td>
+                 <td class="dataTableHeadingContent" align="left">&nbsp;<?php echo TABLE_HEADING_OPTION_SORT_ORDER; ?>&nbsp;</td>
+                 <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+               </tr>
+<tr>
+                <td align="center" class="smallText">&nbsp;<?php echo $next_id; ?>&nbsp;</td>
+                <td colspan="2" class="smallText"><table border="0" width="100%" cellspacing="0" cellpadding="0">  <?php echo $inputs; ?> </table> </td>
+                 <td > <?php echo draw_optiontype_pulldown('options_type', $options_values['options_type']) ;?> </td> <td align="left"><input type="text" name="options_length" size="3"></td><td align="left"><input type="text" name="products_options_sort_order" size="3"</td>
+                <td align="center" class="smallText">&nbsp;<?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT); ?>&nbsp;</td>
+<?php
+      echo '</form>';
+?>
+              </tr>
+   </table></td></tr>
+              <tr>
+                <td colspan="7"><?php echo tep_black_line(); ?></td>
+              </tr>
+<?php
+    }
+  }
+?>
+            </table></td>
+<!-- product_options eof //-->
+  </tr>
+   <tr>
+     
+     <td valign="top" width="50%">
+       <table width="776" border="0" cellspacing="0" cellpadding="2">
+<!-- value //-->
+<?php
+  if ($HTTP_GET_VARS['action'] == 'delete_option_value') { // delete product option value
+    $values = tep_db_query("select products_options_values_id, products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . $HTTP_GET_VARS['value_id'] . "' and language_id = '" . (int)$languages_id . "'");
+    $values_values = tep_db_fetch_array($values);
+?>
+              <tr>
+                <td colspan="3" class="pageHeading">&nbsp;<?php echo $values_values['products_options_values_name']; ?>&nbsp;</td>
+                <td>&nbsp;<?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '53'); ?>&nbsp;</td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td colspan="3"><?php echo tep_black_line(); ?></td>
+                  </tr>
+<!-- value query//-->
+<?php
+    $products1 = tep_db_query("select p.products_id, pd.products_name, pot.products_options_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_OPTIONS_TEXT  . " pot where pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and pot.language_id = '" . (int)$languages_id . "' and pa.products_id = p.products_id and pa.options_values_id='" . $HTTP_GET_VARS['value_id'] . "' and po.products_options_id = pa.options_id and pa.options_id = pot.products_options_text_id   order by pd.products_name, pa.products_options_sort_order, po.products_options_sort_order");
+    if (tep_db_num_rows($products1)) {
+?>
+                  <tr class="dataTableHeadingRow">
+                    <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_ID; ?>&nbsp;</td>
+                    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="right">&nbsp;<?php echo TABLE_HEADING_OPTION_SORT_ORDER; ?>&nbsp;</td>
+                    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_NAME; ?>&nbsp;</td>
+                  </tr>
+                  <tr>
+                    <td colspan="3"><?php echo tep_black_line(); ?></td>
+                  </tr>
+<?php
+      while ($products_values1 = tep_db_fetch_array($products1)) {
+        $rows++;
+?>
+                  <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
+                    <td align="center" class="smallText">&nbsp;<?php echo $products_values1['products_id']; ?>&nbsp;</td>
+                    <td class="smallText">&nbsp;<?php echo $products_values1['products_name']; ?>&nbsp;</td>
+                <td class="smallText" align="right">&nbsp;<?php echo $options_values["products_options_sort_order"]; ?>&nbsp;</td>
+                    <td class="smallText">&nbsp;<?php echo $products_values1['products_options_name']; ?>&nbsp;</td>
+                  </tr>
+<?php
+      }
+?>
+                  <tr>
+                    <td colspan="3"><?php echo tep_black_line(); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main" colspan="3"><br><?php echo TEXT_WARNING_OF_DELETE; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a>&nbsp;</td>
+                  </tr>
+<?php
+    } else {
+?>
+                  <tr>
+                    <td class="main" colspan="3"><br><?php echo TEXT_OK_TO_DELETE; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_value&value_id=' . $HTTP_GET_VARS['value_id'] . '&' . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_delete.gif', ' delete '); ?></a>&nbsp;&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a>&nbsp;</td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+              </tr>
+<?php
+  } else {
+?>
+              <tr>
+                <td colspan="3" class="pageHeading">&nbsp;<?php echo HEADING_TITLE_VAL; ?>&nbsp;</td>
+                <td>&nbsp;<?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '36'); ?>&nbsp;</td>
+              </tr>
+              <tr>
+                <td colspan="4" class="smallText">
+<?php
+    $per_page = MAX_ROW_LISTS_OPTIONS;
+$values = "select pov.products_options_values_id, pov.products_options_values_name, pov2po.products_options_id from
+    " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov,
+    " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po
+    where 
+   pov2po.products_options_values_id = pov.products_options_values_id and 
+    pov.language_id = '" . (int)$languages_id . "' 
+    order by pov.products_options_values_id";
+    if (!$value_page) {
+      $value_page = 1;
+    }
+    $prev_value_page = $value_page - 1;
+    $next_value_page = $value_page + 1;
+
+    $value_query = tep_db_query($values);
+
+    $value_page_start = ($per_page * $value_page) - $per_page;
+    $num_rows = tep_db_num_rows($value_query);
+
+    if ($num_rows <= $per_page) {
+      $num_pages = 1;
+    } else if (($num_rows % $per_page) == 0) {
+      $num_pages = ($num_rows / $per_page);
+    } else {
+      $num_pages = ($num_rows / $per_page) + 1;
+    }
+    $num_pages = (int) $num_pages;
+
+    $values = $values . " LIMIT $value_page_start, $per_page";
+
+    // Previous
+    if ($prev_value_page)  {
+      echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_order_by=' . $option_order_by . '&value_page=' . $prev_value_page) . '"> &lt;&lt; </a> | ';
+    }
+
+    for ($i = 1; $i <= $num_pages; $i++) {
+      if ($i != $value_page) {
+         echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_order_by=' . $option_order_by . '&value_page=' . $i) . '">' . $i . '</a> | ';
+      } else {
+         echo '<b><font color=red>' . $i . '</font></b> | ';
+      }
+    }
+
+    // Next
+    if ($value_page != $num_pages) {
+      echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_order_by=' . $option_order_by . '&value_page=' . $next_value_page) . '"> &gt;&gt;</a> ';
+    }
+?>
+                </td>
+              </tr>
+              <tr>
+                <td colspan="4"><?php echo tep_black_line(); ?></td>
+              </tr>
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_ID; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_NAME; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_VALUE; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+              <tr>
+                <td colspan="4"><?php echo tep_black_line(); ?></td>
+              </tr>
+<?php
+    $next_id = 1;
+    $values = tep_db_query($values);
+    while ($values_values = tep_db_fetch_array($values)) {
+      $options_name = tep_options_name($values_values['products_options_id']);
+      $values_name = $values_values['products_options_values_name'];
+      $rows++;
+?>
+              <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
+<?php
+      if (($HTTP_GET_VARS['action'] == 'update_option_value') && ($HTTP_GET_VARS['value_id'] == $values_values['products_options_values_id'])) {
+        echo '<form name="values" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_value&' . $page_info, 'NONSSL') . '" method="post">';
+        $inputs = '';
+        for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
+          $value_name = tep_db_query("select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . $values_values['products_options_values_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");
+          $value_name = tep_db_fetch_array($value_name);
+          $inputs .= $languages[$i]['code'] . ':&nbsp;<input type="text" name="value_name[' . $languages[$i]['id'] . ']" size="15" value="' . $value_name['products_options_values_name'] . '">&nbsp;<br>';
+        }
+?>
+                <td align="center" class="smallText">&nbsp;<?php echo $values_values['products_options_values_id']; ?><input type="hidden" name="value_id" value="<?php echo $values_values['products_options_values_id']; ?>">&nbsp;</td>
+                <td align="center" class="smallText">&nbsp;<?php echo "\n"; ?><select name="option_id">
+<?php
+        $options = tep_db_query("select po.products_options_id, pot.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " AS po, " . TABLE_PRODUCTS_OPTIONS_TEXT  . " AS pot where po.options_type in (0,2,3) and po.products_options_id = pot.products_options_text_id  and pot.language_id = '" . (int)$languages_id . "' order by po.products_options_sort_order, pot.products_options_name");
+        while ($options_values = tep_db_fetch_array($options)) {
+          echo "\n" . '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '"';
+          if ($values_values['products_options_id'] == $options_values['products_options_id']) {
+            echo ' selected';
+          }
+          echo '>' . $options_values['products_options_name'] . '</option>';
+        }
+?>
+                </select>&nbsp;</td>
+                <td class="smallText"><?php echo $inputs; ?></td>
+                <td align="center" class="smallText">&nbsp;<?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>&nbsp;</td>
+<?php
+        echo '</form>';
+      } else {
+?>
+                <td align="center" class="smallText">&nbsp;<?php echo $values_values["products_options_values_id"]; ?>&nbsp;</td>
+                <td align="center" class="smallText">&nbsp;<?php echo $options_name; ?>&nbsp;</td>
+                <td class="smallText">&nbsp;<?php echo $values_name; ?>&nbsp;</td>
+                <td align="center" class="smallText">&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option_value&value_id=' . $values_values['products_options_values_id'] . '&' . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_option_value&value_id=' . $values_values['products_options_values_id'] . '&' . $page_info, 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); ?></a>&nbsp;</td>
+<?php
+      }
+      $max_values_id_query = tep_db_query("select max(products_options_values_id) + 1 as next_id from " . TABLE_PRODUCTS_OPTIONS_VALUES);
+      $max_values_id_values = tep_db_fetch_array($max_values_id_query);
+      $next_id = $max_values_id_values['next_id'];
+    }
+?>
+              </tr>
+              <tr>
+                <td colspan="4"><?php echo tep_black_line(); ?></td>
+              </tr>
+<?php
+    if ($HTTP_GET_VARS['action'] != 'update_option_value') {
+?>
+              <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
+<?php
+      echo '<form name="values" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=add_product_option_values&' . $page_info, 'NONSSL') . '" method="post">';
+?>
+                <td align="center" class="smallText">&nbsp;<?php echo $next_id; ?>&nbsp;</td>
+                <td align="center" class="smallText">&nbsp;<select name="option_id">
+<?php
+     $options = tep_db_query("select po.products_options_id, pot.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_OPTIONS_TEXT  . " pot where po.options_type in (0,2,3) and pot.products_options_text_id = po.products_options_id and pot.language_id = '" . (int)$languages_id . "' order by po.products_options_sort_order, pot.products_options_name");
+      while ($options_values = tep_db_fetch_array($options)) {
+        echo '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '">' . $options_values['products_options_name'] . '</option>';
+      }
+
+      $inputs = '';
+      for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
+        $inputs .= $languages[$i]['code'] . ':&nbsp;<input type="text" name="value_name[' . $languages[$i]['id'] . ']" size="15">&nbsp;<br>';
+      }
+?>
+                </select>&nbsp;</td>
+                <td class="smallText"><input type="hidden" name="value_id" value="<?php echo $next_id; ?>"><?php echo $inputs; ?></td>
+                <td align="center" class="smallText">&nbsp;<?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT); ?>&nbsp;</td>
+<?php
+      echo '</form>';
+?>
+              </tr>
+              <tr>
+                <td colspan="4"><?php echo tep_black_line(); ?></td>
+              </tr>
+<?php
+    }
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+<!-- option value eof //-->
+      </tr>
+<!-- products_attributes //-->
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading">&nbsp;<?php echo HEADING_TITLE_ATRIB; ?>&nbsp;</td>
+            <td>&nbsp;<?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '53'); ?>&nbsp;</td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+<?php
+    if ($HTTP_GET_VARS['action'] == 'update_attribute') {
+      $form_action = 'update_product_attribute';
+    } else {
+      $form_action = 'add_product_attributes';
+    }
+?>
+
+        <td><form name="attributes" action="<?php echo tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=' . $form_action . '&' . $page_info); ?>" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td colspan="10" class="smallText">
+<?php
+  $per_page = MAX_ROW_LISTS_OPTIONS;
+$attributes = "select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, 
+  " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+  where
+  pd.products_id = pa.products_id and 
+  pd.language_id = '" . (int)$languages_id . "' 
+  order by pd.products_name, pa.products_options_sort_order";
+
+  if (!$attribute_page) {
+    $attribute_page = 1;
+  }
+  $prev_attribute_page = $attribute_page - 1;
+  $next_attribute_page = $attribute_page + 1;
+
+  $attribute_query = tep_db_query($attributes);
+
+  $attribute_page_start = ($per_page * $attribute_page) - $per_page;
+  $num_rows = tep_db_num_rows($attribute_query);
+
+  if ($num_rows <= $per_page) {
+     $num_pages = 1;
+  } else if (($num_rows % $per_page) == 0) {
+     $num_pages = ($num_rows / $per_page);
+  } else {
+     $num_pages = ($num_rows / $per_page) + 1;
+  }
+  $num_pages = (int) $num_pages;
+
+  $attributes = $attributes . " LIMIT $attribute_page_start, $per_page";
+
+  // Previous
+  if ($prev_attribute_page) {
+    echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'attribute_page=' . $prev_attribute_page) . '"> &lt;&lt; </a> | ';
+  }
+
+  for ($i = 1; $i <= $num_pages; $i++) {
+    if ($i != $attribute_page) {
+      echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'attribute_page=' . $i) . '">' . $i . '</a> | ';
+    } else {
+      echo '<b><font color="red">' . $i . '</font></b> | ';
+    }
+  }
+
+  // Next
+  if ($attribute_page != $num_pages) {
+    echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'attribute_page=' . $next_attribute_page) . '"> &gt;&gt; </a>';
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td colspan="9"><?php echo tep_black_line(); ?></td>
+          </tr>
+          <tr class="dataTableHeadingRow">
+            <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_ID; ?>&nbsp;</td>
+            <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT; ?>&nbsp;</td>
+<?php
+// BOF: WebMakers.com Added: FREE-CALL
+//
+?>
+            <td class="dataTableHeadingContent">&nbsp;<?php echo 'FILE NAME'; ?>&nbsp;</td>
+<?php
+// EOF: WebMakers.com Added: FREE-CALL
+//
+?>
+            <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_NAME; ?>&nbsp;</td>
+            <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_VALUE; ?>&nbsp;</td>
+<?php
+// BOF: WebMakers.com Added: FREE-CALL
+//
+?>
+            <td class="dataTableHeadingContent" align="right">&nbsp;<?php echo 'Sort Order '; ?>&nbsp;</td>
+
+<?php
+// EOF: WebMakers.com Added: FREE-CALL
+//
+?>
+            <td class="dataTableHeadingContent" align="right">&nbsp;<?php echo TABLE_HEADING_OPT_PRICE; ?>&nbsp;</td>
+            <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_OPT_PRICE_PREFIX; ?>&nbsp;</td>
+            <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+          </tr>
+          <tr>
+            <td colspan="9"><?php echo tep_black_line(); ?></td>
+          </tr>
+
+<?php
+  $next_id = 1;
+  $attributes = tep_db_query($attributes);
+  while ($attributes_values = tep_db_fetch_array($attributes)) {
+    $products_name_only = tep_get_products_name($attributes_values['products_id']);
+    $options_name = tep_options_name($attributes_values['options_id']);
+    $values_name = tep_values_name($attributes_values['options_values_id']);
+    $rows++;
+?>
+          <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
+<?php
+    if (($HTTP_GET_VARS['action'] == 'update_attribute') && ($HTTP_GET_VARS['attribute_id'] == $attributes_values['products_attributes_id'])) {
+?>
+            <td class="attributeBoxContent">&nbsp;<?php echo $attributes_values['products_attributes_id']; ?><input type="hidden" name="attribute_id" value="<?php echo $attributes_values['products_attributes_id']; ?>">&nbsp;</td>
+            <td class="attributeBoxContent" colspan="2"><pre><?php echo $products_name_only; ?></pre><input type="hidden" name="products_id" value="<?php echo $attributes_values['products_id']; ?>"></td>
+            <td class="attributeBoxContent">&nbsp;<select name="options_id">
+<?php
+      $options = tep_db_query("select po.products_options_id, pot.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_OPTIONS_TEXT  . " pot where pot.products_options_text_id = po.products_options_id and pot.language_id = '" . (int)$languages_id . "' order by po.products_options_sort_order, pot.products_options_name");
+      while($options_values = tep_db_fetch_array($options)) {
+        if ($attributes_values['options_id'] == $options_values['products_options_id']) {
+          echo "\n" . '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '" SELECTED>' . $options_values['products_options_name'] . '</option>';
+        } else {
+          echo "\n" . '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '">' . $options_values['products_options_name'] . '</option>';
+        }
+      }
+?>
+            </select>&nbsp;</td>
+            <td class="attributeBoxContent">&nbsp;<select name="values_id">
+<?php
+      $values = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id ='" . (int)$languages_id . "' order by products_options_values_name");
+      while($values_values = tep_db_fetch_array($values)) {
+        if ($attributes_values['options_values_id'] == $values_values['products_options_values_id']) {
+          echo "\n" . '<option name="' . $values_values['products_options_values_name'] . '" value="' . $values_values['products_options_values_id'] . '" SELECTED>' . $values_values['products_options_values_name'] . '</option>';
+        } else {
+          echo "\n" . '<option name="' . $values_values['products_options_values_name'] . '" value="' . $values_values['products_options_values_id'] . '">' . $values_values['products_options_values_name'] . '</option>';
+        }
+      }
+?>
+            </select>&nbsp;</td>
+<?php
+// BOF: WebMakers.com Added: Attribute Sorter- Edit
+//
+?>
+            <td align="right" class="attributeBoxContent">&nbsp;<?php echo SORT_ORDER?> <input type="text" name="sort_order" value="<?php echo $attributes_values['products_options_sort_order']; ?>" size="2" maxlength="3">&nbsp;</td>
+            <td align="right" class="attributeBoxContent">&nbsp;<?php echo PRICE?> <input type="text" name="value_price" value="<?php echo $attributes_values['options_values_price']; ?>" size="6">&nbsp;</td>
+            <td align="center" class="attributeBoxContent">&nbsp;<input type="text" name="price_prefix" value="<?php echo $attributes_values['price_prefix']; ?>" size="2">&nbsp;</td>
+            <td align="center" class="attributeBoxContent">&nbsp;<?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?>&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '&attribute_page=' . $attribute_page . '&' . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>&nbsp;</td>
+<?php
+      if (DOWNLOAD_ENABLED == 'true') {
+        $download_query_raw ="select products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount
+                              from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
+                              where products_attributes_id='" . $attributes_values['products_attributes_id'] . "'";
+        $download_query = tep_db_query($download_query_raw);
+        if (tep_db_num_rows($download_query) > 0) {
+          $download = tep_db_fetch_array($download_query);
+          $products_attributes_filename = $download['products_attributes_filename'];
+          $products_attributes_maxdays  = $download['products_attributes_maxdays'];
+          $products_attributes_maxcount = $download['products_attributes_maxcount'];
+        }
+?>
+          <tr class="attributeBoxContent">
+            <td class="attributeBoxContent">&nbsp;</td>
+            <td colspan="8">
+              <table>
+                <tr class="attributeBoxContent">
+                  <td align="right" class="attributeBoxContent"><?php echo TABLE_HEADING_DOWNLOAD; ?>&nbsp;</td>
+                  <td align="right" class="attributeBoxContent"><?php echo TABLE_TEXT_FILENAME; ?></td>
+                  <td align="right" class="attributeBoxContent"><?php echo tep_draw_input_field('products_attributes_filename', $products_attributes_filename, 'size="35"'); ?>&nbsp;</td>
+                  <td align="right" class="attributeBoxContent"><?php echo TABLE_TEXT_MAX_DAYS; ?></td>
+                  <td align="right" class="attributeBoxContent"><?php echo tep_draw_input_field('products_attributes_maxdays', $products_attributes_maxdays, 'size="5"'); ?>&nbsp;</td>
+                  <td align="right" class="attributeBoxContent"><?php echo TABLE_TEXT_MAX_COUNT; ?></td>
+                  <td align="right" class="attributeBoxContent"><?php echo tep_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?>&nbsp;</td>
+                </tr>
+              </table>
+            </td>
+            <td>&nbsp;</td>
+          </tr>
+<?php
+      }
+?>
+
+
+
+<?php /* BOF: WebMakers.com Added: Attribute Enhancements Coming Soon */ ?>
+          <tr class="attributeBoxContent">
+            <td class="attributeBoxContent">&nbsp;</td>
+            <td class="attributeBoxContent" colspan="8">
+            </td>
+            <td>&nbsp;</td>
+          </tr>
+<?php /* EOF: WebMakers.com Added: Attribute Enhancements Coming Soon */ ?>
+
+
+
+
+
+<?php
+    } elseif (($HTTP_GET_VARS['action'] == 'delete_product_attribute') && ($HTTP_GET_VARS['attribute_id'] == $attributes_values['products_attributes_id'])) {
+?>
+
+<?php
+// BOF: WebMakers.com Added: Attribute Sorter - Delete
+?>
+            <td class="smallText">&nbsp;<b><?php echo $attributes_values["products_attributes_id"]; ?></b>&nbsp;</td>
+            <td class="smallText">&nbsp;<b><?php echo $products_name_only; ?></b>&nbsp;</td>
+
+            <td class="smallText">&nbsp;<b><?php echo $the_download['products_attributes_filename']; ?></b>&nbsp;</td>
+            <td class="smallText">&nbsp;<b><?php echo $options_name; ?></b>&nbsp;</td>
+            <td class="smallText">&nbsp;<b><?php echo $values_name; ?></b>&nbsp;</td>
+
+            <td align="right" class="smallText">&nbsp;<b><?php echo $attributes_values["products_options_sort_order"]; ?></td>
+            <td align="right" class="smallText">&nbsp;<b><?php echo $attributes_values["options_values_price"]; ?></b>&nbsp;</td>
+            <td align="center" class="smallText">&nbsp;<b><?php echo $attributes_values["price_prefix"]; ?></b>&nbsp;</td>
+
+
+            <td align="center" class="smallText">&nbsp;<b><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_attribute&attribute_id=' . $HTTP_GET_VARS['attribute_id'] . '&' . $page_info) . '">'; ?><?php echo tep_image_button('button_confirm.gif', IMAGE_CONFIRM); ?></a>&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>&nbsp;</b></td>
+<?php
+// EOF: WebMakers.com Added: Attribute Sorter - Delete
+    } else {
+?>
+<?php
+// BOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC.
+        $the_download_query_raw ="select products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id='" . $attributes_values['products_attributes_id'] . "'";
+        $the_download_query = tep_db_query($the_download_query_raw);
+        $the_download= tep_db_fetch_array($the_download_query);
+
+?>
+            <td class="smallText">&nbsp;<?php echo $attributes_values["products_attributes_id"]; ?>&nbsp;</td>
+            <td class="smallText">&nbsp;<?php echo $products_name_only; ?>&nbsp;</td>
+<?php
+// BOF: NOTE
+// Could go into /admin/includes/configure.php
+  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
+  $filename_is_missing='';
+// EOF: NOTE
+if ( $the_download['products_attributes_filename'] ) {
+  if ( !file_exists(DIR_FS_DOWNLOAD . $the_download['products_attributes_filename']) ) {
+    //$filename_is_missing='<FONT COLOR="FF0000"> - <B>*** Missing</B></FONT>';
+    $filename_is_missing='<FONT COLOR="FF0000"> - <B>'.MISSING.'</B></FONT>';
+  } else {
+   // $filename_is_missing='<FONT COLOR="2F4F2F"> - <B>Good File</B></FONT>';
+    $filename_is_missing='<FONT COLOR="2F4F2F"> - <B>'.GOOD_FILE.'</B></FONT>';
+  }
+}
+?>
+            <td class="smallText"><?php echo $the_download['products_attributes_filename'] . $filename_is_missing; ?>&nbsp;</td>
+<?php
+// EOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC.
+?>
+            <td class="smallText">&nbsp;<?php echo $options_name; ?>&nbsp;</td>
+            <td class="smallText">&nbsp;<?php echo $values_name; ?>&nbsp;</td>
+<?php
+// BOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC.
+//
+?>
+            <td align="right" class="smallText"><?php echo $attributes_values["products_options_sort_order"]; ?>&nbsp;</td>
+<?php
+// EOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC.
+//
+?>
+            <td align="right" class="smallText">&nbsp;<?php echo $attributes_values["options_values_price"]; ?>&nbsp;</td>
+            <td align="center" class="smallText">&nbsp;<?php echo $attributes_values["price_prefix"]; ?>&nbsp;</td>
+            <td align="center" class="smallText">&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&' . $page_info, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&' . $page_info, 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); ?></a>&nbsp;</td>
+<?php
+    }
+    $max_attributes_id_query = tep_db_query("select max(products_attributes_id) + 1 as next_id from " . TABLE_PRODUCTS_ATTRIBUTES);
+    $max_attributes_id_values = tep_db_fetch_array($max_attributes_id_query);
+    $next_id = $max_attributes_id_values['next_id'];
+?>
+          </tr>
+<?php
+  }
+  if ($HTTP_GET_VARS['action'] != 'update_attribute') {
+?>
+          <tr>
+            <td colspan="10"><?php echo tep_black_line(); ?></td>
+          </tr>
+          <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>" valign="bottom">
+            <td class="smallText">&nbsp;<?php echo $next_id; ?>&nbsp;</td>
+<?php
+// BOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC.
+?>
+            <td class="smallText" colspan="2">&nbsp;<select name="products_id">
+<?php
+// EOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC.
+?>
+<?php
+    $products = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name");
+    while ($products_values = tep_db_fetch_array($products)) {
+      echo '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_name'] . '</option>';
+    }
+?>
+            </select>&nbsp;</td>
+            <td class="smallText">&nbsp;<select name="options_id" onchange="setvalues(this.form.name)"><option value=""><?php echo TEXT_OPTION_SELECTION; ?></option>
+<?php
+    $options = tep_db_query("select po.products_options_id, pot.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_OPTIONS_TEXT  . " pot where pot.products_options_text_id = po.products_options_id and pot.language_id = '" . (int)$languages_id . "' order by po.products_options_sort_order, pot.products_options_name");
+    while ($options_values = tep_db_fetch_array($options)) {
+      echo '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '">' . $options_values['products_options_name'] . '</option>';
+    }
+?>
+            </select>&nbsp;</td>
+            <td class="smallText">&nbsp;<select name="values_id">
+<?php
+//    $values = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id = '" . (int)$languages_id . "' order by products_options_values_name");
+//    while ($values_values = tep_db_fetch_array($values)) {
+//      echo '<option name="' . $values_values['products_options_values_name'] . '" value="' . $values_values['products_options_values_id'] . '">' . $values_values['products_options_values_name'] . '</option>';
+//    }
+?>
+            </select>&nbsp;</td>
+<?php
+// BOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC.
+?>
+            <td align="right" class="smallText">&nbsp;<input type="text" name="sort_order" size="3" maxlength="3">&nbsp;</td>
+<?php
+// EOF: WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC.
+?>
+            <td align="right" class="smallText">&nbsp;<input type="text" name="value_price" size="6">&nbsp;</td>
+            <td align="right" class="smallText">&nbsp;<input type="text" name="price_prefix" size="2" value="+" maxlength="1">&nbsp;</td>
+            <td align="center" class="smallText">&nbsp;<?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT); ?>&nbsp;</td>
+          </tr>
+<?php
+      if (DOWNLOAD_ENABLED == 'true') {
+        $products_attributes_maxdays  = DOWNLOAD_MAX_DAYS;
+        $products_attributes_maxcount = DOWNLOAD_MAX_COUNT;
+?>
+          <tr class="<?php echo (!($rows % 2)? 'attributes-even' : 'attributes-odd');?>">
+            <td>&nbsp;</td>
+            <td colspan="8">
+              <table>
+                <tr class="<?php echo (!($rows % 2)? 'attributes-even' : 'attributes-odd');?>">
+                  <td class="smallText"><?php echo TABLE_HEADING_DOWNLOAD; ?>&nbsp;</td>
+                  <td class="smallText"><?php echo TABLE_TEXT_FILENAME; ?></td>
+                  <td class="smallText"><?php echo tep_draw_input_field('products_attributes_filename', $products_attributes_filename, 'size="35"'); ?>&nbsp;</td>
+                  <td class="smallText"><?php echo TABLE_TEXT_MAX_DAYS; ?></td>
+                  <td class="smallText"><?php echo tep_draw_input_field('products_attributes_maxdays', $products_attributes_maxdays, 'size="5"'); ?>&nbsp;</td>
+                  <td class="smallText"><?php echo TABLE_TEXT_MAX_COUNT; ?></td>
+                  <td class="smallText"><?php echo tep_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?>&nbsp;</td>
+                </tr>
+              </table>
+            </td>
+            <td>&nbsp;</td>
+          </tr>
+<?php
+      } // end of DOWNLOAD_ENABLED section
+?>
+<?php
+  }
+?>
+          <tr>
+            <td colspan="10"><?php echo tep_black_line(); ?></td>
+          </tr>
+        </table></form></td>
+      </tr>
+    </table></td>
+<!-- products_attributes_eof //-->
+  </tr>
+</table>
+<!-- body_text_eof //-->
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/products_expected.php
===================================================================
--- trunk/direct.openmoko.com/admin/products_expected.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/products_expected.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,124 @@
+<?php
+/*
+  $Id: products_expected.php,v 1.1.1.1 2004/03/04 23:38:55 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  tep_db_query("update " . TABLE_PRODUCTS . " set products_date_available = '' where to_days(now()) > to_days(products_date_available)");
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_EXPECTED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $products_query_raw = "select pd.products_id, pd.products_name, p.products_date_available from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p where p.products_id = pd.products_id and p.products_date_available != '' and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_available DESC";
+  $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);
+  $products_query = tep_db_query($products_query_raw);
+  while ($products = tep_db_fetch_array($products_query)) {
+    if ((!isset($HTTP_GET_VARS['pID']) || (isset($HTTP_GET_VARS['pID']) && ($HTTP_GET_VARS['pID'] == $products['products_id']))) && !isset($pInfo)) {
+      $pInfo = new objectInfo($products);
+    }
+
+    if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'pID=' . $products['products_id'] . '&action=new_product') . '\'">' . "\n";
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, 'page=' . $HTTP_GET_VARS['page'] . '&pID=' . $products['products_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $products['products_name']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo tep_date_short($products['products_date_available']); ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, 'page=' . $HTTP_GET_VARS['page'] . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS_EXPECTED); ?></td>
+                    <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  if (isset($pInfo) && is_object($pInfo)) {
+    $heading[] = array('text' => '<b>' . $pInfo->products_name . '</b>');
+
+    $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+    $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_EXPECTED . ' ' . tep_date_short($pInfo->products_date_available));
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/products_multi.php
===================================================================
--- trunk/direct.openmoko.com/admin/products_multi.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/products_multi.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,384 @@
+<?php
+/*
+  $Id: products_multi.php, v 2.0
+
+  autor: sr, 2003-07-31 / sr at ibis-project.de
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+$cat_stat=0; // internal use -- 0 = no / 1 = yes
+
+  if($action) {
+   $selected_cnt   = count($choose);
+    switch($action) {
+      case 'delete_product_confirm':
+        for ($i = 0; $i < $selected_cnt; $i++) {
+          $product_id = $choose[$i];
+          $product_categories = $HTTP_POST_VARS['product_categories'];
+
+          if($del_art=='complete') {
+        tep_remove_product($product_id);
+      } elseif($del_art=='this_cat') {
+        tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $product_id . "' and categories_id = '" . $current_category_id . "'");
+      }
+
+          if (USE_CACHE == 'true') {
+            tep_reset_cache_block('categories');
+            tep_reset_cache_block('also_purchased');
+          }
+    } // for
+
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_MULTI, 'cPath=' . $cPath));
+        break;
+      case 'move_product_confirm':
+        for ($i = 0; $i < $selected_cnt; $i++) {
+      $products_id = $choose[$i];
+          $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
+
+          $duplicate_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . tep_db_input($products_id) . "' and categories_id = '" . tep_db_input($new_parent_id) . "'");
+          $duplicate_check = tep_db_fetch_array($duplicate_check_query);
+          if ($duplicate_check['total'] < 1) tep_db_query("update " . TABLE_PRODUCTS_TO_CATEGORIES . " set categories_id = '" . tep_db_input($new_parent_id) . "' where products_id = '" . tep_db_input($products_id) . "' and categories_id = '" . $current_category_id . "'");
+
+          if (USE_CACHE == 'true') {
+            tep_reset_cache_block('categories');
+            tep_reset_cache_block('also_purchased');
+          }
+    } // for
+
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_MULTI, 'cPath=' . $new_parent_id . '&pID=' . $products_id));
+        break;
+      case 'copy_to_confirm':
+        for ($i = 0; $i < $selected_cnt; $i++) {
+      $products_id = $choose[$i];
+          $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
+
+            if ($HTTP_POST_VARS['categories_id'] != $current_category_id) {
+              $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . tep_db_input($products_id) . "' and categories_id = '" . tep_db_input($categories_id) . "'");
+              $check = tep_db_fetch_array($check_query);
+              if ($check['total'] < '1') {
+                tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . tep_db_input($products_id) . "', '" . tep_db_input($categories_id) . "')");
+              }
+            } else {
+              $messageStack->add_session('search', ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');
+            }
+
+          if (USE_CACHE == 'true') {
+            tep_reset_cache_block('categories');
+            tep_reset_cache_block('also_purchased');
+          }
+    } // for
+
+        tep_redirect(tep_href_link(FILENAME_PRODUCTS_MULTI, 'cPath=' . $categories_id . '&pID=' . $products_id));
+        break;
+    }
+  }
+
+// check if the catalog image directory exists
+  if (is_dir(DIR_FS_CATALOG_IMAGES)) {
+    if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add('search', ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
+  } else {
+    $messageStack->add('search', ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<div id="spiffycalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading">
+      <?php
+      echo HEADING_TITLE;
+      //echo $action.count($choose).$categories_id.$current_category_id; // nur zu testzwecken - only for tests
+      ?>
+      </td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('spacer/pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
+            <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr><?php echo tep_draw_form('search', FILENAME_PRODUCTS_MULTI, '', 'get'); 
+                if (isset($HTTP_GET_VARS[tep_session_name()])) {
+                  echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+                }
+              ?>
+                <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search', $HTTP_GET_VARS['search']); ?></td>
+              </form></tr>
+              <tr><?php echo tep_draw_form('goto', FILENAME_PRODUCTS_MULTI, '', 'get'); 
+                if (isset($HTTP_GET_VARS[tep_session_name()])) {
+                  echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+                }
+              ?>
+                <td class="smallText" align="right"><?php echo HEADING_TITLE_GOTO . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td>
+              </form></tr>            
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    <?php echo tep_draw_form('mainForm', FILENAME_PRODUCTS_MULTI . '?cPath=' . $cPath . '&cID=' . $cID, '', 'post'); ?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_CHOOSE; ?></td>
+        <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>
+                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?> / <?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $categories_count = 0;
+    $rows = 0;
+    if ($HTTP_GET_VARS['search']) {
+      if($cat_stat==1) {
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' and cd.categories_name like '%" . $HTTP_GET_VARS['search'] . "%' order by c.sort_order, cd.categories_name");
+    } else {
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' and cd.categories_name like '%" . $HTTP_GET_VARS['search'] . "%' order by c.sort_order, cd.categories_name");
+    }
+    } else {
+      if($cat_stat==1) {
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name");
+    } else {
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name");
+    }
+    }
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $categories_count++;
+      $rows++;
+
+// Get parent_id for subcategories if search 
+      if ($HTTP_GET_VARS['search']) $cPath= $categories['parent_id'];
+
+      if ( ((!$HTTP_GET_VARS['cID']) && (!$HTTP_GET_VARS['pID']) || (@$HTTP_GET_VARS['cID'] == $categories['categories_id'])) && (!$cInfo) && (substr($HTTP_GET_VARS['action'], 0, 4) != 'new_') ) {
+        $category_childs = array('childs_count' => tep_childs_in_category_count($categories['categories_id']));
+        $category_products = array('products_count' => tep_products_in_category_count($categories['categories_id']));
+
+        $cInfo_array = array_merge($categories, $category_childs, $category_products);
+        $cInfo = new objectInfo($cInfo_array);
+      }
+
+      if ( (is_object($cInfo)) && ($categories['categories_id'] == $cInfo->categories_id) ) {
+        echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS_MULTI, tep_get_path($categories['categories_id'])) . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS_MULTI, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"></td>
+        <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_MULTI, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;<b>' . $categories['categories_name'] . '</b>'; ?></td>
+                <!-- <td class="dataTableContent" align="center">&nbsp;</td> -->
+        <td class="dataTableContent" align="center">
+<?php
+    if($cat_stat==1) {
+      if ($categories['categories_status'] == '1') {
+          echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10);
+        } else {
+          echo tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+        }
+    }
+?>
+                &nbsp;</td>
+        <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($categories['categories_id'] == $cInfo->categories_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_MULTI, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+
+    $products_count = 0;
+    if ($HTTP_GET_VARS['search']) {
+      $products_query = tep_db_query("select p.products_tax_class_id, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . $HTTP_GET_VARS['search'] . "%' order by pd.products_name"); // original
+    } else {
+      $products_query = tep_db_query("select p.products_tax_class_id, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by pd.products_name"); // original
+    }
+    while ($products = tep_db_fetch_array($products_query)) {
+      $products_count++;
+      $rows++;
+
+// Get categories_id for product if search 
+      if ($HTTP_GET_VARS['search']) $cPath=$products['categories_id'];
+
+      if ( ((!$HTTP_GET_VARS['pID']) && (!$HTTP_GET_VARS['cID']) || (@$HTTP_GET_VARS['pID'] == $products['products_id'])) && (!$pInfo) && (!$cInfo) && (substr($HTTP_GET_VARS['action'], 0, 4) != 'new_') ) {
+// find out the rating average from customer reviews
+        $reviews_query = tep_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . $products['products_id'] . "'");
+        $reviews = tep_db_fetch_array($reviews_query);
+        $pInfo_array = array_merge($products, $reviews);
+        $pInfo = new objectInfo($pInfo_array);
+      }
+
+      if ( (is_object($pInfo)) && ($products['products_id'] == $pInfo->products_id) ) {
+        echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent">
+        <input type="checkbox" name="choose[]" value="<?php echo $products['products_id']; ?>" id="checkbox_choose_<?php echo $products_count; ?>" <?php if($checkall==1) { echo 'checked'; } ?>>
+        </td>
+        <td class="dataTableContent"><label for="checkbox_choose_<?php echo $products_count; ?>"><?php echo $products['products_name']; ?></label></td>
+                <td class="dataTableContent" align="left"><table><tr><td align="left" class="dataTableContent" width="100">
+<?php
+      echo '&nbsp;'.$products['products_model'].'&nbsp;</td><td align="left" class="dataTableContent">';
+    if ($products['products_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10);
+      } else {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?>
+        </td></tr></table></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($pInfo)) && ($products['products_id'] == $pInfo->products_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_MULTI, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    } // zu: while ($products = tep_db_fetch_array($products_query)) {
+
+    if ($cPath_array) {
+      $cPath_back = '';
+      for($i=0;$i<sizeof($cPath_array)-1;$i++) {
+        if ($cPath_back == '') {
+          $cPath_back .= $cPath_array[$i];
+        } else {
+          $cPath_back .= '_' . $cPath_array[$i];
+        }
+      }
+    }
+
+    $cPath_back = ($cPath_back) ? 'cPath=' . $cPath_back : '';
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                          <tr> 
+                            <td width="50%"> <img src="images/icons/arrow_checkall.gif" alt="" width="38" height="22" border="0"> 
+                              <a href="products_multi.php?cPath=<?php echo $cPath; ?>&cID=<?php echo $cID; ?>&checkall=1"><?php echo TEXT_CHOOSE_ALL; ?></a> 
+                              &nbsp;/&nbsp; <a href="products_multi.php?cPath=<?php echo $cPath; ?>&cID=<?php echo $cID; ?>"><?php echo TEXT_CHOOSE_ALL_REMOVE; ?></a> 
+                            </td>
+                            <td width="50%" align="right" class="smallText"> 
+                              <?php
+          if ($cPath) echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_MULTI, $cPath_back . '&cID=' . $current_category_id) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>&nbsp;';
+          ?>
+                              &nbsp;</td>
+                          </tr>
+                          <input type="hidden" name="cPath" value="<?php echo $cPath; ?>">
+                          <input type="hidden" name="cID" value="<?php echo $cID; ?>">
+                          <tr> 
+                            <td width="50%" class="smallText">
+<p>&nbsp;</p></td>
+                            <td width="50%" align="right" class="smallText"></td>
+                          </tr>
+                          <tr> 
+                            <td width="50%" class="smallText"><?php echo TEXT_CATEGORIES . '&nbsp;' . $categories_count . '<br>' . TEXT_PRODUCTS . '&nbsp;' . $products_count; ?></td>
+                            <td width="50%" align="right" class="smallText"> 
+                              <label for="move_product_confirm"><?php echo TEXT_MOVE_TO; ?></label>
+                              <input type="radio" name="action" value="move_product_confirm" id="move_product_confirm"> 
+                              <label for="copy_to_confirm"><?php echo IMAGE_COPY_TO; ?></label>
+                              <input type="radio" name="action" value="copy_to_confirm" id="copy_to_confirm" checked> 
+                              &nbsp;<?php echo tep_draw_pull_down_menu('categories_id', tep_get_category_tree(), $current_category_id); ?></td>
+                          </tr>
+                          <tr> 
+                            <td width="50%" class="smallText"></td>
+                            <td width="50%" align="right" class="smallText"> 
+                              <label for="delete_product_confirm"><?php echo DEL_DELETE; ?></label>
+                              <input type="radio" name="action" value="delete_product_confirm" id="delete_product_confirm"> 
+                              &nbsp; <select name="del_art" title="<?php echo DEL_CHOOSE_DELETE_ART; ?>" id="del_art">
+                                <option value="this_cat" selected><?php echo DEL_THIS_CAT; ?></option>
+                                <option value="complete"><?php echo DEL_COMPLETE; ?></option>
+                              </select> </td>
+                          </tr>
+                          <tr> 
+                            <td width="50%" class="smallText"></td>
+                            <td width="50%" align="right" class="smallText"> 
+                              <input type="submit" name="go" value=" go! " title=" go! "> 
+                              &nbsp;</td>
+                          </tr>
+                          <tr> 
+                            <td class="dataTableContent" colspan="2"> <?php echo TEXT_ATTENTION_DANGER; ?> 
+                            </td>
+                          </tr>
+                        </table></td>
+              </tr>
+            </table></td>
+<?php
+    $heading = array();
+    $contents = array();
+    switch ($HTTP_GET_VARS['action']) {
+      default:
+        if ($rows > 0) {
+          if (is_object($cInfo)) { // category info box contents
+            $heading[] = array('text' => '<b>' . $cInfo->categories_name . '</b>');
+
+            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
+            if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
+            $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->categories_image);
+            $contents[] = array('text' => '<br>' . TEXT_SUBCATEGORIES . ' ' . $cInfo->childs_count . '<br>' . TEXT_PRODUCTS . ' ' . $cInfo->products_count);
+          } elseif (is_object($pInfo)) { // product info box contents
+            $heading[] = array('text' => '<b>' . tep_get_products_name($pInfo->products_id, $languages_id) . '</b>');
+
+            $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($pInfo->products_date_added));
+            if (tep_not_null($pInfo->products_last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($pInfo->products_last_modified));
+            if (date('Y-m-d') < $pInfo->products_date_available) $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . tep_date_short($pInfo->products_date_available));
+            $contents[] = array('text' => '<br>' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $pInfo->products_image);
+      $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
+            $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');
+          }
+        } else { // create category/product info
+          $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');
+
+          $contents[] = array('text' => sprintf(TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS, $parent_categories_name));
+        }
+        break;
+    }
+
+    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+      echo '            <td width="25%" valign="top">' . "\n";
+
+      $box = new box;
+      echo $box->infoBox($heading, $contents);
+
+      echo '            </td>' . "\n";
+    }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  //}
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+
+</table></form>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/quick_attributes_popup.php
===================================================================
--- trunk/direct.openmoko.com/admin/quick_attributes_popup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/quick_attributes_popup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+   quick_attributes_popup.php
+   WebMakers.com Added: Show current attributes of the product
+*/
+
+include('includes/application_top.php');
+require(DIR_WS_CLASSES . 'currencies.php');
+$currencies = new currencies();
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo 'Current Attributes'; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<?php
+// Get Product Info
+  $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $look_it_up . "' and pd.products_id = '" . $look_it_up . "' and pd.language_id = '" . $languages_id . "'");
+  $product_info = tep_db_fetch_array($product_info_query);
+
+?>
+
+<table border="0" width="85%" align="center">
+<tr><td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
+<tr>
+  <td class="main" align="left">Current ID# <?php echo $look_it_up;?></td>
+  <td class="main" align="right"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $product_info['products_image'],'', SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);?></td>
+</tr>
+<tr>
+  <td class="main" align="left"><?php echo $product_info['products_name'];?></td>
+  <td class="main" align="right">Model: <?php echo $product_info['products_model'];?></td>
+</tr>
+<tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+</tr>
+</table>
+
+<?php
+///////////////////////////////////////////////////////////////////////////
+// BOF: attribute options
+
+    echo '<table border="0" width="85%" align="center"><tr><td>';
+
+    $products_attributes = tep_db_query("select poptt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt,  " . TABLE_PRODUCTS_OPTIONS_TEXT  . " poptt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $look_it_up . "' and patrib.options_id = popt.products_options_id and poptt.language_id = '" . $languages_id . "'");
+    if (tep_db_num_rows($products_attributes)) {
+      $products_attributes = '1';
+    } else {
+      $products_attributes = '0';
+      echo '<table border="0" cellpading="0" cellspacing"0">';
+      echo '<tr><td class="main" colspan="2">';
+      echo '<FONT color="FF0000"><b>' . 'NO CURRENT ATTRIBUTES ...' . '</b></FONT>';
+      echo '</td></tr></table>';
+    }
+    if ($products_attributes == '1') {
+      $products_options_name = tep_db_query("select distinct popt.products_options_id, poptt.products_options_name, popt.products_options_sort_order from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT  . " poptt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $look_it_up . "' and patrib.options_id = popt.products_options_id and poptt.language_id = '" . $languages_id . "'" . " order by popt.products_options_sort_order");
+      echo '<table border="0" cellpading="0" cellspacing"0">';
+      echo '<tr><td class="main" colspan="2">';
+      echo '<b>' . 'CURRENT ATTRIBUTES:' . '</b>';
+      echo '</td></tr>';
+      echo '<tr><td colspan="2">' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td></tr>';
+      while ($products_options_name_values = tep_db_fetch_array($products_options_name)) {
+        $selected = 0;
+        $products_options_array = array();
+        echo '<tr><td class="main">' . $products_options_name_values['products_options_name'] . ':</td><td>' . "\n";
+        $products_options = tep_db_query("select pa.products_options_sort_order, pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $look_it_up . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by pa.products_options_sort_order, pa.options_values_price");
+        while ($products_options_values = tep_db_fetch_array($products_options)) {
+          $products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name']);
+          if ($products_options_values['options_values_price'] != '0') {
+            $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options_values['price_prefix'] . $currencies->format($products_options_values['options_values_price']) .') ';
+          }
+        }
+        echo tep_draw_pull_down_menu('id[' . $products_options_name_values['products_options_id'] . ']', $products_options_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name_values['products_options_id']]);
+        echo '</td></tr>';
+      }
+      echo '</table>';
+    }
+
+    echo '</td></tr></table>';
+// EOF: attribute options
+///////////////////////////////////////////////////////////////////////////
+?>
+
+<BR><BR>
+<center>
+<table align="center" border="1" cellpadding="6" cellspacing="3"><tr><td class="main">
+<a href="javascript:window.close()"> Close Window </a>
+</td></tr></table>
+</center>
+<BR><BR>
+
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/quick_products_popup.php
===================================================================
--- trunk/direct.openmoko.com/admin/quick_products_popup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/quick_products_popup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,128 @@
+<?php
+/*
+   WebMakers.com Added: Show current products by categories and attribute option
+   Created from:
+   quick_deactivate.php v1.1 by mattice at xs4all.nl / http://www.matthijs.org
+*/
+
+include('includes/application_top.php');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><!-- Quick Products Listing --><?php echo QUICK_PRODUCTS_POPUP_TXT_0?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+
+<script>
+<!--
+function selectAll(formObj, isInverse)
+{
+   for (var i=0;i < formObj.length;i++)
+   {
+      fldObj = formObj.elements[i];
+      if (fldObj.type == 'checkbox')
+      {
+         if(isInverse)
+            fldObj.checked = (fldObj.checked) ? false : true;
+         else fldObj.checked = true;
+       }
+   }
+}
+-->
+</script>
+
+<?php /* BOF: WebMakers.com Added: PopUp Window */ ?>
+<SCRIPT LANGUAGE="JavaScript">
+<!-- Begin
+function NewWindow3(mypage, myname, w, h, scroll) {
+var winl = (screen.width - w) / 2;
+var wint = (screen.height - h) / 2;
+winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
+win = window.open(mypage, myname, winprops)
+if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
+}
+//  End -->
+</script>
+<?php /* EOF: WebMakers.com Added: PopUp Window */ ?>
+
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<table style="border:none" border="0" align="center" class="none">
+  <tr><td class="smallText">
+<?php
+
+?>
+<br><form method="post" action="quick_products_popup.php">
+<?php
+
+   // first select all categories that have 0 as parent:
+      $sql = tep_db_query("SELECT c.categories_id, cd.categories_name from categories c, categories_description cd WHERE c.parent_id = 0 AND c.categories_id = cd.categories_id AND cd.language_id = 1");
+        echo '<center><b>'.QUICK_PRODUCTS_POPUP_TXT_1.'</b>'. tep_draw_separator('pixel_trans.gif', '100%', '3') . '</center>' . "\n";
+        echo '<table border="1" align="center">' . "\n" . ' ' . ' <tr class="smallText">' . "\n";
+        $count_it=0;
+        while ($parents = tep_db_fetch_array($sql)) {
+          // check if the parent has products
+          $check = tep_db_query("SELECT products_id FROM products_to_categories WHERE categories_id = '" . $parents['categories_id'] . "'");
+          if (tep_db_num_rows($check) > 0) {
+            $tree = tep_get_category_tree();
+            $dropdown= tep_draw_pull_down_menu('cat_id', $tree, '', 'onChange="this.form.submit();"'); //single
+            $all_list = "\n" . '<form method="post" action="quick_products_popup.php"> ' . "\n" . ' ' . ' <td class="smallText" align="left" valign="top" width="115"><FONT COLOR="FF0000"><B>'.QUICK_PRODUCTS_POPUP_TXT_2.'</B></FONT><br>' . $dropdown . '</form></td>' . "\n";
+          } else {
+            // get the tree for that parent
+            $tree = tep_get_category_tree($parents['categories_id']);
+            // draw a dropdown with it:
+            $dropdown = tep_draw_pull_down_menu('cat_id', $tree, '', 'onChange="this.form.submit();"');
+            $list .= "\n" . '<form method="post" action="quick_products_popup.php"> '  . "\n" . ' ' . ' <td class="smallText" align="left" valign="top" width="115">' . $parents['categories_name'] . ':<br>' . $dropdown . '</form></td>' . "\n";
+          }
+            $count_it++;
+            if ($count_it > 4) {
+              $count_it=0;
+              $list .= '</tr>' . "\n" . '<tr class="smallText">';
+            }
+        }
+//       echo $list . $all_list . '</tr></table><p>';
+        echo $all_list . $list;
+
+   // see if there is a category ID:
+
+  if ($HTTP_POST_VARS['cat_id']) {
+
+      // start the table
+      echo "\n" . '<form method="post" action="quick_products_popup.php"><table border="1" width="100%"><tr>' . "\n";
+       $i = 0;
+
+      // get all active prods in that specific category
+
+       $sql2 = tep_db_query("SELECT p.products_id, p.products_status, p.products_image, pd.products_name from products p, products_description pd, products_to_categories ptc where p.products_id = ptc.products_id and p.products_id = pd.products_id and p.products_status=1 and pd.language_id = '" . $languages_id . "' and ptc.categories_id = '" . $HTTP_POST_VARS['cat_id'] . "'");
+
+     while ($results = tep_db_fetch_array($sql2)) {
+           $i++;
+             echo '<td valign="top" class="smallText" align="center">' . tep_image(HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $results['products_image'], $results['products_id'], (SMALL_IMAGE_WIDTH * .50), (SMALL_IMAGE_HEIGHT * .50));
+             echo '<FONT size="3px">&nbsp;#' . $results['products_id'] . '</font><br clear="all">' . $results['products_name'];
+             $show_attributes='<FONT COLOR="FF0000">'.QUICK_PRODUCTS_POPUP_TXT_3.'<br><a href="' . 'quick_attributes_popup.php?look_it_up=' . $results['products_id'] . '&my_languages_id=' . $languages_id . '" onclick="NewWindow3(this.href,\'name3\',\'700\',\'400\',\'yes\');return false;">'.QUICK_PRODUCTS_POPUP_TXT_4.'</a></font>';
+             echo '<P>' . $show_attributes . '</td>' . "\n";
+          if ($i == 5) {
+               echo '</tr><tr>' . "\n";
+               $i =0;
+         }
+    }
+  echo '<input type="hidden" name="cat_id" value="' . $HTTP_POST_VARS['cat_id'] . '">' . "\n";
+  echo '</tr>' . "\n";
+  } //if
+?>
+    </tr></table>
+  </td></tr>
+</table>
+
+<BR><BR>
+<center>
+<table align="center" border="1" cellpadding="6" cellspacing="3"><tr><td class="main">
+<a href="javascript:window.close()"> <!-- Close Window --> <?php echo QUICK_ATTRIBUTES_POPUP_TXT_5?></a>
+</td></tr></table>
+</center>
+<BR><BR>
+
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/quickcom_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/quickcom_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/quickcom_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<?php
+/*
+  $Id: quickcom_help.php,v 1.2 2004/03/13 15:09:11 ccwjr Exp $
+
+  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');
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"><html <?php echo HTML_PARAMS; ?>>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><!-- Quickcommerce Consolidated CRE Help Screen --><?php echo QUICKCOM_HELP_TXT_1?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="admin/includes/general.js"></script>
+</head>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+
+
+     <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><!-- Quickcommerce Consolidated CRE Edition --><?php echo QUICKCOM_HELP_TXT_2?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+       <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+         <td class="main">
+
+<div align="center"><h2><!-- Configuration Help Screen --><?php echo QUICKCOM_HELP_TXT_3?></h2></div>
+</td>
+</tr>
+<tr>
+ <td align="center">
+<!-- <a href=" https://freecreditcardprocessing.com/applynow/online_application.asp?code=chainreaction"> <h2>Link to Apply for Quickcommerce account</h2></a><br>
+(support the CRE project by using our authorize.net partner) --> <?php echo QUICKCOM_HELP_TXT_4?>
+</td>
+</tr>
+<tr>
+<td>
+<hr align="center" size="4" width="450">
+</td>
+</tr>
+<tr>
+<td>
+<!-- User your browser back button to return to the Quickcommerce edit screen
+
+<li>Credit Cart Test Info</li>
+<p>This is an internal cart test number only.
+ For Quickcommerce testing you should use :
+<li>Visa : 4007000000027</li>
+<li>MasterCard : 5424000000000015</li>
+ <LI>Discover :  6011000000000012</li>
+ <li>American Express : 370000000000002</li>
+ <br>
+ Any expiration date after the current date should work.
+ Any CVV code should work.
+</p>
+<li>Enable Quickcommerce Module</li>
+<p>True or False. True is on - False is off</p>
+<li>Login Username</li>
+<p>Your Quickcommerce User ID goes here.</p>
+<li>Login Transaction Key</li>
+<p>Quickcommerce Consolidated uses the AIM method of
+connecting to Quickcommerce.  You must use set the
+ Password Required mode to ON on your gateway.
+  Generate a Transaction Key and enter it here.
+   Do not use your Quickcommerce gateway
+    password here. It will not work.
+ </p>
+<li>cURL Setup</li>
+<p>Generally, enter Compiled if your Host has
+cURL support compiled into the server.  Enter Not
+ Compiled otherwise.  If you don't know - ask your
+  Technical Support department.</p>
+<li>cURL Path</li>
+<p>The correct path to the cURL command on your server if it
+is not compiled.  Some other server
+  settings may prevent cURL from working even if it
+   is compiled. In this case, you may be able to make
+    this module work by setting the cURL path to various default
+     locations where cURL might usually be found on a UNIX server
+    (/usr/bin/curl, /usr/local/bin/curl, /bin/curl etc.</p>
+<li>Transaction Mode</li>
+<p>There are three alternatives.  Test, Test and Debug, and
+Production. Test mode runs tests with no recording of
+module function. Test and Debug mode runs tests and
+prints certain variables contents in a file.  This filename is
+currently hardcoded - look in catalog/temp for a file named authdebug.txt
+You may have to change this filename depending on your servers security
+settings.  You may also have to create a blank file with that name and chmod it to 777.
+</p>
+<li>Transaction Method</li>
+<p>Select Credit Card.  Echeck support is not yet implemented.</p>
+<li>Processing Mode</li>
+<p>Authorize only approves the transaction, but does not transfer funds.  Authorize and Capture does both.</p>
+<li>Sort Order of Display</li>
+<p>This is the order in which the payment module is displayed on the
+payment method selection screen by the checkout process module.
+It should be three digits and be a higher number than that of the
+paypal module if you are using this module with Paypal IPN.</p>
+<li>Customer Notifications</li>
+<p>True if you want authorize.net to send customer notifications, false if not.</p>
+<li>Accepted Credit Cards</li>
+<p>Select only  cards your merchant account allows you to accept.</p>
+<li>Quickcommerce Payment Zone</li>
+<p>You may create a zone in which you wish to accept cards by this method. If you enter a zone here, only
+those geographical areas within that zone will see this
+module on checkout.</p>
+<li>Quickcommerce Set Order Status</li>
+<p>This is the order status to which this module will set an order if it is successfully completed. Processing is suggested.</p>
+<li>Enable CCV Code</li>
+<p>Enable or disable CCV code.  Some merchant banks DO NOT USE CCV security checks.  If your gateway
+is generating a lot of denials you should check to make sure this is set in accordance with
+your merchant banks policies.</p> --> <?php echo QUICKCOM_HELP_TXT_5?>
+<hr align="center" size="4" width="450">
+  </tr>
+        </td></table>
+          </tr>
+         </td>
+
+   </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/results.inc.php
===================================================================
--- trunk/direct.openmoko.com/admin/results.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/results.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,142 @@
+<?php
+/*
+  $Id: results.inc.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<?php 
+define("PAYPAL_SHOPPING_CART_IPN_1","PayPal_Shopping_Cart_IPN");
+define("IPN_TEST_RESULTS","IPN Test Results");
+define("TEST_COMPLETE","Test Complete!");
+define("TEST_NOT_VALID","Test Not Valid!");
+define("FOOTER_TEXT_1",'E-Commerce Engine Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a><br>osCommerce provides no warranty and is redistributable under the <a href="http://www.fsf.org/licenses/gpl.txt" target="_blank">GNU General Public License</a>');
+
+define("FOOTER_TEXT_2",'Powered by <a href="http://www.oscommerce.com" target="_blank">osCommerce</a>');
+
+?>
+
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<meta name="copyright" content="2004">
+<meta name="author" content="developer&#064;devosc.com">
+<style type='text/css'>
+body {background-color: #FFFFFF;}
+body, td, th {font-family: sans-serif; font-size: 10px;}
+.p {margin-top:0px;padding-top:0px;}
+.box, .boxEmail {border:1px solid black; width:100%;}
+table.box td {color: #003366; }
+input { border:1px solid #003366;}
+</style>
+</head>
+<body>
+<form name="ipn" method="GET" action="<?php echo  $_SERVER['HTTP_REFERER']?>">
+<input type="hidden" name="action" value="test"/>
+<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2">
+      <tr valign="middle">
+        <td align="center">
+<table border="0" width="780" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="0" class="box">
+          <tr>
+            <td align="center"><a href="http://www.oscommerce.com"><img border="0" src="<?php echo DIR_WS_MODULES . 'payment/paypal/images/oscommerce.gif'; ?>" alt=" osCommerce " title=" osCommerce " /></a><h1 class="p"> <?php echo PROJECT_VERSION; ?></h1></td>
+          </tr>
+          <tr>
+            <td class="pageHeading" style="color:green" align="center"><!-- PayPal_Shopping_Cart_IPN --> <?php echo PAYPAL_SHOPPING_CART_IPN_1?></td>
+          </tr>
+          <tr>
+            <td class="pageHeading" style="color:blue; text-align:center; padding-top:5px;"><!-- IPN Test Results --><?php echo IPN_TEST_RESULTS?></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '25'); ?></td>
+          </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="0" class="box">
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
+          </tr>
+<?php if(!$debug->error) { ?>
+          <tr>
+            <td class="pageHeading" style="color:red" align="center"><!-- Test Complete! --><?php echo TEST_COMPLETE?></td>
+          </tr>
+<?php } else { ?>
+          <tr>
+            <td class="pageHeading" style="color:red" align="center"><!-- Test Not Valid! --><?php echo TEST_NOT_VALID?></td>
+          </tr>
+<?php } ?>
+<?php if($debug->enabled) { ?>
+          <tr>
+            <td style="padding:5px;" align="left"><?php echo $debug->info(true); ?></td>
+          </tr>
+<?php } ?>
+          <tr>
+            <td style="color:blue; text-align:center; padding-top:5px;"><input type="submit" value="Continue"></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td align="center" class="smallText">
+<?php
+/*
+  The following copyright announcement is in compliance
+  to section 2c of the GNU General Public License, and
+  thus can not be removed, or can only be modified
+  appropriately.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+?>
+<!-- E-Commerce Engine Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a><br>
+osCommerce provides no warranty and is redistributable under the <a href="http://www.fsf.org/licenses/gpl.txt" target="_blank">GNU General Public License</a> -->
+<?php echo FOOTER_TEXT_1?>
+    </td>
+  </tr>
+  <tr>
+    <td><?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5'); ?></td>
+  </tr>
+  <tr>
+    <td align="center" class="smallText"><!-- Powered by <a href="http://www.oscommerce.com" target="_blank">osCommerce</a> -->
+  <?php echo FOOTER_TEXT_2?>
+  </td>
+  </tr>
+</table>
+</td>
+      </tr>
+    </table>
+</td>
+</tr>
+</table>
+</form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/reviews.php
===================================================================
--- trunk/direct.openmoko.com/admin/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,301 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:38:56 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'update':
+        $reviews_id = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+        $reviews_rating = tep_db_prepare_input($HTTP_POST_VARS['reviews_rating']);
+        $reviews_text = tep_db_prepare_input($HTTP_POST_VARS['reviews_text']);
+
+        tep_db_query("update " . TABLE_REVIEWS . " set reviews_rating = '" . tep_db_input($reviews_rating) . "', last_modified = now() where reviews_id = '" . (int)$reviews_id . "'");
+        tep_db_query("update " . TABLE_REVIEWS_DESCRIPTION . " set reviews_text = '" . tep_db_input($reviews_text) . "' where reviews_id = '" . (int)$reviews_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews_id));
+        break;
+      case 'deleteconfirm':
+        $reviews_id = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+
+        tep_db_query("delete from " . TABLE_REVIEWS . " where reviews_id = '" . (int)$reviews_id . "'");
+        tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$reviews_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($action == 'edit') {
+    $rID = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+
+    $reviews_query = tep_db_query("select r.reviews_id, r.products_id, r.customers_name, r.date_added, r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$rID . "' and r.reviews_id = rd.reviews_id");
+    $reviews = tep_db_fetch_array($reviews_query);
+
+    $products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$reviews['products_id'] . "'");
+    $products = tep_db_fetch_array($products_query);
+
+    $products_name_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$reviews['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
+    $products_name = tep_db_fetch_array($products_name_query);
+
+    $rInfo_array = array_merge($reviews, $products, $products_name);
+    $rInfo = new objectInfo($rInfo_array);
+?>
+      <tr><?php echo tep_draw_form('review', FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $HTTP_GET_VARS['rID'] . '&action=preview'); ?>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="main" valign="top"><b><?php echo ENTRY_PRODUCT; ?></b> <?php echo $rInfo->products_name; ?><br><b><?php echo ENTRY_FROM; ?></b> <?php echo $rInfo->customers_name; ?><br><br><b><?php echo ENTRY_DATE; ?></b> <?php echo tep_date_short($rInfo->date_added); ?></td>
+            <td class="main" align="right" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table witdh="100%" border="0" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="main" valign="top"><b><?php echo ENTRY_REVIEW; ?></b><br><br><?php echo tep_draw_textarea_field('reviews_text', 'soft', '60', '15', $rInfo->reviews_text); ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="right"><?php echo ENTRY_REVIEW_TEXT; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo ENTRY_RATING; ?></b>&nbsp;<?php echo TEXT_BAD; ?>&nbsp;<?php for ($i=1; $i<=5; $i++) echo tep_draw_radio_field('reviews_rating', $i, '', $rInfo->reviews_rating) . '&nbsp;'; echo TEXT_GOOD; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><?php echo tep_draw_hidden_field('reviews_id', $rInfo->reviews_id) . tep_draw_hidden_field('products_id', $rInfo->products_id) . tep_draw_hidden_field('customers_name', $rInfo->customers_name) . tep_draw_hidden_field('products_name', $rInfo->products_name) . tep_draw_hidden_field('products_image', $rInfo->products_image) . tep_draw_hidden_field('date_added', $rInfo->date_added) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . ' <a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $HTTP_GET_VARS['rID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form></tr>
+<?php
+  } elseif ($action == 'preview') {
+    if (tep_not_null($HTTP_POST_VARS)) {
+      $rInfo = new objectInfo($HTTP_POST_VARS);
+    } else {
+      $rID = tep_db_prepare_input($HTTP_GET_VARS['rID']);
+
+      $reviews_query = tep_db_query("select r.reviews_id, r.products_id, r.customers_name, r.date_added, r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$rID . "' and r.reviews_id = rd.reviews_id");
+      $reviews = tep_db_fetch_array($reviews_query);
+
+      $products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$reviews['products_id'] . "'");
+      $products = tep_db_fetch_array($products_query);
+
+      $products_name_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$reviews['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
+      $products_name = tep_db_fetch_array($products_name_query);
+
+      $rInfo_array = array_merge($reviews, $products, $products_name);
+      $rInfo = new objectInfo($rInfo_array);
+    }
+?>
+      <tr><?php echo tep_draw_form('update', FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $HTTP_GET_VARS['rID'] . '&action=update', 'post', 'enctype="multipart/form-data"'); ?>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="main" valign="top"><b><?php echo ENTRY_PRODUCT; ?></b> <?php echo $rInfo->products_name; ?><br><b><?php echo ENTRY_FROM; ?></b> <?php echo $rInfo->customers_name; ?><br><br><b><?php echo ENTRY_DATE; ?></b> <?php echo tep_date_short($rInfo->date_added); ?></td>
+            <td class="main" align="right" valign="top"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . $rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?></td>
+          </tr>
+        </table>
+      </tr>
+      <tr>
+        <td><table witdh="100%" border="0" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top" class="main"><b><?php echo ENTRY_REVIEW; ?></b><br><br><?php echo nl2br(tep_db_output(tep_break_string($rInfo->reviews_text, 15))); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo ENTRY_RATING; ?></b>&nbsp;<?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif', sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating)); ?>&nbsp;<small>[<?php echo sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating); ?>]</small></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php
+    if (tep_not_null($HTTP_POST_VARS)) {
+/* Re-Post all POST'ed variables */
+      reset($HTTP_POST_VARS);
+      while(list($key, $value) = each($HTTP_POST_VARS)) echo tep_draw_hidden_field($key, $value);
+?>
+      <tr>
+        <td align="right" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> ' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+      </form></tr>
+<?php
+    } else {
+      if (isset($HTTP_GET_VARS['origin'])) {
+        $back_url = $HTTP_GET_VARS['origin'];
+        $back_url_params = '';
+      } else {
+        $back_url = FILENAME_REVIEWS;
+        $back_url_params = 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id;
+      }
+?>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+    }
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_RATING; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_ADDED; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $reviews_query_raw = "select reviews_id, products_id, date_added, last_modified, reviews_rating from " . TABLE_REVIEWS . " order by date_added DESC";
+    $reviews_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $reviews_query_raw, $reviews_query_numrows);
+    $reviews_query = tep_db_query($reviews_query_raw);
+    while ($reviews = tep_db_fetch_array($reviews_query)) {
+      if ((!isset($HTTP_GET_VARS['rID']) || (isset($HTTP_GET_VARS['rID']) && ($HTTP_GET_VARS['rID'] == $reviews['reviews_id']))) && !isset($rInfo)) {
+        $reviews_text_query = tep_db_query("select r.reviews_read, r.customers_name, length(rd.reviews_text) as reviews_text_size from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$reviews['reviews_id'] . "' and r.reviews_id = rd.reviews_id");
+        $reviews_text = tep_db_fetch_array($reviews_text_query);
+
+        $products_image_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$reviews['products_id'] . "'");
+        $products_image = tep_db_fetch_array($products_image_query);
+
+        $products_name_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$reviews['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
+        $products_name = tep_db_fetch_array($products_name_query);
+
+        $reviews_average_query = tep_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int)$reviews['products_id'] . "'");
+        $reviews_average = tep_db_fetch_array($reviews_average_query);
+
+        $review_info = array_merge($reviews_text, $reviews_average, $products_name);
+        $rInfo_array = array_merge($reviews, $review_info, $products_image);
+        $rInfo = new objectInfo($rInfo_array);
+      }
+
+      if (isset($rInfo) && is_object($rInfo) && ($reviews['reviews_id'] == $rInfo->reviews_id) ) {
+        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=preview') . '\'">' . "\n";
+      } else {
+        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews['reviews_id']) . '\'">' . "\n";
+      }
+?>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews['reviews_id'] . '&action=preview') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . tep_get_products_name($reviews['products_id']); ?></td>
+                <td class="dataTableContent" align="right"><?php echo tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif'); ?></td>
+                <td class="dataTableContent" align="right"><?php echo tep_date_short($reviews['date_added']); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($rInfo)) && ($reviews['reviews_id'] == $rInfo->reviews_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $reviews_split->display_count($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                    <td class="smallText" align="right"><?php echo $reviews_split->display_links($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+    $heading = array();
+    $contents = array();
+
+    switch ($action) {
+      case 'delete':
+        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_REVIEW . '</b>');
+
+        $contents = array('form' => tep_draw_form('reviews', FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=deleteconfirm'));
+        $contents[] = array('text' => TEXT_INFO_DELETE_REVIEW_INTRO);
+        $contents[] = array('text' => '<br><b>' . $rInfo->products_name . '</b>');
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+        break;
+      default:
+      if (isset($rInfo) && is_object($rInfo)) {
+        $heading[] = array('text' => '<b>' . $rInfo->products_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($rInfo->date_added));
+        if (tep_not_null($rInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($rInfo->last_modified));
+        $contents[] = array('text' => '<br>' . tep_info_image($rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_REVIEW_AUTHOR . ' ' . $rInfo->customers_name);
+        $contents[] = array('text' => TEXT_INFO_REVIEW_RATING . ' ' . tep_image(HTTP_SERVER . DIR_WS_CATALOG_IMAGES . 'stars_' . $rInfo->reviews_rating . '.gif'));
+        $contents[] = array('text' => TEXT_INFO_REVIEW_READ . ' ' . $rInfo->reviews_read);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_REVIEW_SIZE . ' ' . $rInfo->reviews_text_size . ' bytes');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_PRODUCTS_AVERAGE_RATING . ' ' . number_format($rInfo->average_rating, 2) . '%');
+      }
+        break;
+    }
+
+    if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+      echo '            <td width="25%" valign="top">' . "\n";
+
+      $box = new box;
+      echo $box->infoBox($heading, $contents);
+
+      echo '            </td>' . "\n";
+    }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/rsslink.php
===================================================================
--- trunk/direct.openmoko.com/admin/rsslink.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/rsslink.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+//rss feed
+// require('includes/application_top.php');
+include('includes/functions/rss2html.php');
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link type="text/css" rel="StyleSheet" href="includes/index.css" />
+</head>
+<body>
+<class="adminLink">
+<?php
+parseRDF("http://creforge.com/export/rss_sfnews.php");
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/salemaker.php
===================================================================
--- trunk/direct.openmoko.com/admin/salemaker.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/salemaker.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,506 @@
+<?php
+/*
+  $Id: salemaker.php,v 1.1.1.1 2004/03/04 23:38:57 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('AUTOCHECK', 'False');
+define('DISPLAYTTT', 'True');
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $specials_condition_array = array(array('id' => '0', 'text' => SPECIALS_CONDITION_DROPDOWN_0),
+                                    array('id' => '1', 'text' => SPECIALS_CONDITION_DROPDOWN_1),
+                                    array('id' => '2', 'text' => SPECIALS_CONDITION_DROPDOWN_2));
+
+  $deduction_type_array = array(array('id' => '0', 'text' => DEDUCTION_TYPE_DROPDOWN_0),
+                                array('id' => '1', 'text' => DEDUCTION_TYPE_DROPDOWN_1),
+                                array('id' => '2', 'text' => DEDUCTION_TYPE_DROPDOWN_2));
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'setflag':
+        $salemaker_data_array = array('sale_status' => tep_db_prepare_input($HTTP_GET_VARS['flag']),
+                                    'sale_date_last_modified' => 'now()',
+                                    'sale_date_status_change' => 'now()');
+
+        tep_db_perform(TABLE_SALEMAKER_SALES, $salemaker_data_array, 'update', "sale_id = '" . tep_db_prepare_input($HTTP_GET_VARS['sID']) . "'");
+
+        tep_redirect(tep_href_link(FILENAME_SALEMAKER, '', 'NONSSL'));
+        break;
+      case 'insert':
+      case 'update':
+// insert a new sale or update an existing sale
+
+// Create a string of all affected (sub-)categories
+        if (tep_not_null($categories)) {
+        $categories_selected = array();
+          $categories_all = array();
+          foreach(tep_db_prepare_input($categories) as $category_path) {
+            $category = array_pop(explode('_', $category_path));
+            $categories_selected[] = $category;
+            $categories_all[] = $category;
+            foreach(tep_get_category_tree($category) as $subcategory) {
+              if ($subcategory['id'] != '0') {
+                $categories_all[] = $subcategory['id'];
+              }
+            }
+          }
+          asort($categories_selected);
+          $categories_selected_string = implode(',', array_unique($categories_selected));
+          asort($categories_all);
+          $categories_all_string = ',' . implode(',', array_unique($categories_all)) . ',';
+        } else {
+          $categories_selected_string = 'null';
+          $categories_all_string = 'null';
+        }
+
+        $salemaker_sales_data_array = array('sale_name' => tep_db_prepare_input($HTTP_POST_VARS['name']),
+                                            'sale_deduction_value' => tep_db_prepare_input($HTTP_POST_VARS['deduction']),
+                                            'sale_deduction_type' => tep_db_prepare_input($HTTP_POST_VARS['type']),
+                                            'sale_pricerange_from' => tep_db_prepare_input($HTTP_POST_VARS['from']),
+                                            'sale_pricerange_to' => tep_db_prepare_input($HTTP_POST_VARS['to']),
+                                            'sale_specials_condition' => tep_db_prepare_input($HTTP_POST_VARS['condition']),
+                                            'sale_categories_selected' => $categories_selected_string,
+                                            'sale_categories_all' => $categories_all_string,
+                                            'sale_date_start' => tep_db_prepare_input($HTTP_POST_VARS['start']),
+                                            'sale_date_end' => tep_db_prepare_input($HTTP_POST_VARS['end']) );
+
+        if ($action == 'insert') {
+          $salemaker_sales['sale_status'] = 0;
+          $salemaker_sales_data_array['sale_date_added'] = 'now()';
+          $salemaker_sales_data_array['sale_date_last_modified'] = '0000-00-00';
+          $salemaker_sales_data_array['sale_date_status_change'] = '0000-00-00';
+          tep_db_perform(TABLE_SALEMAKER_SALES, $salemaker_sales_data_array, 'insert');
+        } else {
+        $salemaker_sales_data_array['sale_date_last_modified'] = 'now()';
+          tep_db_perform(TABLE_SALEMAKER_SALES, $salemaker_sales_data_array, 'update', "sale_id = '" . tep_db_input($HTTP_POST_VARS['sID']) . "'");
+        }
+
+        tep_redirect(tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $HTTP_POST_VARS['sID']));
+        break;
+      case 'copyconfirm':
+        $newname = tep_db_prepare_input($HTTP_POST_VARS['newname']);
+        if (tep_not_null($newname)) {
+          $salemaker_sales_query = tep_db_query("select * from " . TABLE_SALEMAKER_SALES . " where sale_id = '" . tep_db_input($HTTP_GET_VARS['sID']) . "'");
+          if (tep_db_num_rows($salemaker_sales_query)) {
+            $salemaker_sales = tep_db_fetch_array($salemaker_sales_query);
+            $salemaker_sales['sale_id'] = 'null';
+            $salemaker_sales['sale_name'] = $newname;
+            $salemaker_sales['sale_status'] = 0;
+            $salemaker_sales['sale_date_added'] = 'now()';
+            $salemaker_sales['sale_date_last_modified'] = '0000-00-00';
+            $salemaker_sales['sale_date_status_change'] = '0000-00-00';
+
+            tep_db_perform(TABLE_SALEMAKER_SALES, $salemaker_sales, 'insert');
+          }
+        }
+
+        tep_redirect(tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . tep_db_insert_id()));
+        break;
+      case 'deleteconfirm':
+      $sale_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);
+
+        tep_db_query("delete from " . TABLE_SALEMAKER_SALES . " where sale_id = '" . (int)$sale_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php
+  if ( ($action == 'new') || ($action == 'edit') ) {
+?>
+<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
+<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
+<script language="JavaScript">
+function RowClick(RowValue) {
+  for (i=0; i<document.sale_form.length; i++) {
+    if(document.sale_form.elements[i].type == 'checkbox') {
+      if(document.sale_form.elements[i].value == RowValue) {
+        if(document.sale_form.elements[i].disabled == false) {
+         document.sale_form.elements[i].checked = !document.sale_form.elements[i].checked;
+        }
+      }
+    }
+  }
+  SetCategories()
+}
+
+function CheckBoxClick() {
+  if(this.disabled == false) {
+    this.checked = !this.checked;
+  }
+  SetCategories()
+}
+
+function SetCategories() {
+  for (i=0; i<document.sale_form.length; i++) {
+    if(document.sale_form.elements[i].type == 'checkbox') {
+      document.sale_form.elements[i].disabled = false;
+    document.sale_form.elements[i].onclick = CheckBoxClick;
+      document.sale_form.elements[i].parentNode.parentNode.className = 'SaleMakerOver';
+    }
+  }
+  change = true;
+  while(change) {
+    change = false;
+    for (i=0; i<document.sale_form.length; i++) {
+      if(document.sale_form.elements[i].type == 'checkbox') {
+        currentcheckbox = document.sale_form.elements[i];
+        currentrow = currentcheckbox.parentNode.parentNode;
+        if ( (currentcheckbox.checked) && (currentrow.className == 'SaleMakerOver') ) {
+          currentrow.className = 'SaleMakerSelected';
+          for (j=0; j<document.sale_form.length; j++) {
+            if(document.sale_form.elements[j].type == 'checkbox') {
+              relatedcheckbox = document.sale_form.elements[j];
+              relatedrow = relatedcheckbox.parentNode.parentNode;
+              if( (relatedcheckbox != currentcheckbox) && (relatedcheckbox.value.substr(0, currentcheckbox.value.length) == currentcheckbox.value) ) {
+                if(!relatedcheckbox.disabled) {
+<?php
+    if ( (defined('AUTOCHECK')) && (AUTOCHECK == 'True') ) {
+?>
+                  relatedcheckbox.checked = true;
+<?php
+    }
+?>
+                  relatedcheckbox.disabled = true;
+                  relatedrow.className = 'SaleMakerDisabled';
+                  change = true;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+function session_win() {
+  window.open("<?php echo tep_href_link(FILENAME_SALEMAKER_INFO); ?>","salemaker_info","height=460,width=600,scrollbars=yes,resizable=yes").focus();
+}
+</script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetCategories();SetFocus();">
+<div id="spiffycalendar" class="text"></div>
+<?php
+  } else {
+?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<?php
+  }
+?>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ( ($action == 'new') || ($action == 'edit') ) {
+    $form_action = 'insert';
+    if ( ($action == 'edit') && ($HTTP_GET_VARS['sID']) ) {
+    $form_action = 'update';
+
+      $salemaker_sales_query = tep_db_query("select sale_id, sale_status, sale_name, sale_deduction_value, sale_deduction_type, sale_pricerange_from, sale_pricerange_to, sale_specials_condition, sale_categories_selected, sale_categories_all, sale_date_start, sale_date_end, sale_date_added, sale_date_last_modified, sale_date_status_change from " . TABLE_SALEMAKER_SALES . " where sale_id = '" . (int)$HTTP_GET_VARS['sID'] . "'");
+      $salemaker_sales = tep_db_fetch_array($salemaker_sales_query);
+
+      $sInfo = new objectInfo($salemaker_sales);
+    } else {
+      $sInfo = new objectInfo(array());
+    }
+?>
+<script language="javascript">
+var StartDate = new ctlSpiffyCalendarBox("StartDate", "sale_form", "start", "btnDate1","<?php echo (($sInfo->sale_date_start == '0000-00-00') ? '' : tep_date_short($sInfo->sale_date_start)); ?>",scBTNMODE_CUSTOMBLUE);
+var EndDate = new ctlSpiffyCalendarBox("EndDate", "sale_form", "end", "btnDate2","<?php echo (($sInfo->sale_date_end == '0000-00-00') ? '' : tep_date_short($sInfo->sale_date_end)); ?>",scBTNMODE_CUSTOMBLUE);
+</script>
+      <tr><form name="sale_form" <?php echo 'action="' . tep_href_link(FILENAME_SALEMAKER, tep_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('sID', $HTTP_GET_VARS['sID']); ?>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_SALEMAKER_POPUP; ?></td>
+            <td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $HTTP_GET_VARS['sID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_SALEMAKER_NAME; ?>&nbsp;</td>
+            <td class="main"><?php echo tep_draw_input_field('name', $sInfo->sale_name, 'size="37"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SALEMAKER_DEDUCTION; ?>&nbsp;</td>
+            <td class="main"><?php echo tep_draw_input_field('deduction', $sInfo->sale_deduction_value, 'size="8"') . TEXT_SALEMAKER_DEDUCTION_TYPE . tep_draw_pull_down_menu('type', $deduction_type_array, $sInfo->sale_deduction_type); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SALEMAKER_PRICERANGE_FROM; ?>&nbsp;</td>
+            <td class="main"><?php echo tep_draw_input_field('from', $sInfo->sale_pricerange_from, 'size="8"') . TEXT_SALEMAKER_PRICERANGE_TO . tep_draw_input_field('to', $sInfo->sale_pricerange_to, 'size="8"'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SALEMAKER_SPECIALS_CONDITION; ?>&nbsp;</td>
+            <td class="main"><?php echo tep_draw_pull_down_menu('condition', $specials_condition_array, $sInfo->sale_specials_condition); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SALEMAKER_DATE_START; ?>&nbsp;</td>
+            <td class="main"><script language="javascript">StartDate.writeControl(); StartDate.dateFormat="yyyy-MM-dd";</script>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SALEMAKER_DATE_END; ?>&nbsp;</td>
+            <td class="main"><script language="javascript">EndDate.writeControl(); EndDate.dateFormat="yyyy-MM-dd";</script>
+          </tr>
+        </table></td>
+      </tr>
+    </td>
+    <td><table border="0" cellspacing="0" cellpadding="2">
+<?php
+    $categories_query = tep_db_query("select c.categories_id, c.parent_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "'");
+    $categories_array = array();
+    while($categories = tep_db_fetch_array($categories_query)) {
+      $categories_array[] = $categories;
+    }
+    $n = sizeof($categories_array);
+    for($i = 0; $i < $n; $i++) {
+      $categories_array[$i]['path'] = $categories_array[$i]['categories_id'];
+      $categories_array[$i]['indent'] = 0;
+    $parent = $categories_array[$i]['parent_id'];
+      while($parent != 0) {
+        $categories_array[$i]['indent']++;
+        for($j = 0; $j < $n; $j++) {
+          if($categories_array[$j]['categories_id'] == $parent) {
+            $categories_array[$i]['path'] = $parent . '_' . $categories_array[$i]['path'];
+            $parent = $categories_array[$j]['parent_id'];
+            break;
+          }
+        }
+      }
+      $categories_array[$i]['path'] = '0_' . $categories_array[$i]['path'];
+    }
+
+    $order_changed = true;
+    while($order_changed) {
+      $order_changed = false;
+      for($i = 0, $n = (sizeof($categories_array) - 1); $i < $n; $i++) {
+        if($categories_array[$i]['path'] > $categories_array[$i + 1]['path']) {
+          $tmp = $categories_array[$i];
+          $categories_array[$i] = $categories_array[$i + 1];
+          $categories_array[$i + 1] = $tmp;
+          $order_changed = true;
+        }
+      }
+    }
+
+    $categories_selected = explode(',', $sInfo->sale_categories_selected);
+    if (tep_not_null($sInfo->sale_categories_selected)) {
+      $selected = in_array(0, $categories_selected);
+    } else {
+      $selected = false;
+    }
+
+    echo "      <tr>\n";
+    echo '        <td valign="bottom">' . tep_draw_separator('pixel_trans.gif', '4', '1') . tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif') . "</td>\n";
+    echo '        <td class="main"><br>' . TEXT_SALEMAKER_ENTIRE_CATALOG . "</td>\n";
+    echo "      </tr>\n";
+  echo '      <tr onClick="RowClick(\'0\')">' . "\n";
+    echo '        <td width="10">' . tep_draw_checkbox_field('categories[]', '0', $selected) . "</td>\n";
+    echo '        <td>' . TEXT_SALEMAKER_TOP . "</td>\n";
+    echo "      </tr>\n";
+    echo "      <tr>\n";
+    echo '        <td valign="bottom">' . tep_draw_separator('pixel_trans.gif', '4', '1') . tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif') . "</td>\n";
+    echo '        <td class="main"><br>' . TEXT_SALEMAKER_CATEGORIES . "</td>\n";
+    echo "      </tr>\n";
+
+    foreach($categories_array as $category) {
+    if (tep_not_null($sInfo->sale_categories_selected)) {
+        $selected = in_array($category['categories_id'], $categories_selected);
+      } else {
+        $selected = false;
+      }
+    echo '      <tr onClick="RowClick(\'' . $category['path'] . '\')">' . "\n";
+      echo '        <td width="10">' . tep_draw_checkbox_field('categories[]', $category['path'], $selected) . "</td>\n";
+      echo '        <td>' . str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $category['indent']) . $category['categories_name'] . "</td>\n";
+      echo '      </tr>' . "\n";
+    }
+?>
+        </table></td>
+      </form></tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_SALE_NAME; ?></td>
+                <td colspan="2"><table border="0" width="100%" cellpadding="0"cellspacing="2">
+                  <tr>
+                    <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SALE_DEDUCTION; ?></td>
+                  </tr>
+                </table></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SALE_DATE_START; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_SALE_DATE_END; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $salemaker_sales_query_raw = "select sale_id, sale_status, sale_name, sale_deduction_value, sale_deduction_type, sale_pricerange_from, sale_pricerange_to, sale_specials_condition, sale_categories_selected, sale_categories_all, sale_date_start, sale_date_end, sale_date_added, sale_date_last_modified, sale_date_status_change from " . TABLE_SALEMAKER_SALES . " order by sale_name";
+    $salemaker_sales_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $salemaker_sales_query_raw, $salemaker_sales_query_numrows);
+    $salemaker_sales_query = tep_db_query($salemaker_sales_query_raw);
+    while ($salemaker_sales = tep_db_fetch_array($salemaker_sales_query)) {
+      if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $salemaker_sales['sale_id']))) && !isset($sInfo)) {
+        $sInfo_array = $salemaker_sales;
+        $sInfo = new objectInfo($sInfo_array);
+      }
+
+      if (isset($sInfo) && is_object($sInfo) && ($salemaker_sales['sale_id'] == $sInfo->sale_id)) {
+        echo '                  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '                  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '\'">' . "\n";
+      }
+?>
+                <td  class="dataTableContent" align="left"><?php echo $salemaker_sales['sale_name']; ?></td>
+                <td  class="dataTableContent" align="right"><?php echo $salemaker_sales['sale_deduction_value']; ?></td>
+                <td  class="dataTableContent" align="left"><?php echo $deduction_type_array[$salemaker_sales['sale_deduction_type']]['text']; ?></td>
+                <td  class="dataTableContent" align="center"><?php echo (($salemaker_sales['sale_date_start'] == '0000-00-00') ? TEXT_SALEMAKER_IMMEDIATELY : tep_date_short($salemaker_sales['sale_date_start'])); ?></td>
+                <td  class="dataTableContent" align="center"><?php echo (($salemaker_sales['sale_date_end'] == '0000-00-00') ? TEXT_SALEMAKER_NEVER : tep_date_short($salemaker_sales['sale_date_end'])); ?></td>
+                <td  class="dataTableContent" align="center">
+<?php
+      if ($salemaker_sales['sale_status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_SALEMAKER, 'action=setflag&flag=0&sID=' . $salemaker_sales['sale_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_SALEMAKER, 'action=setflag&flag=1&sID=' . $salemaker_sales['sale_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if ( (is_object($sInfo)) && ($salemaker_sales['sale_id'] == $sInfo->sale_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $salemaker_sales['sale_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+      </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="7"><table border="0" width="100%" cellpadding="0"cellspacing="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $salemaker_sales_split->display_count($salemaker_sales_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SALES); ?></td>
+                    <td class="smallText" align="right"><?php echo $salemaker_sales_split->display_links($salemaker_sales_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_sale.gif', IMAGE_NEW_SALE) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'copy':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_SALE . '</b>');
+
+      $contents = array('form' => tep_draw_form('sales', FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->sale_id . '&action=copyconfirm'));
+      $contents[] = array('text' => sprintf(TEXT_INFO_COPY_INTRO, $sInfo->sale_name));
+      $contents[] = array('text' => '<br>&nbsp;' . tep_draw_input_field('newname', $sInfo->sale_name . '_', 'size="31"'));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', IMAGE_COPY) . '&nbsp;<a href="' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->sale_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SALE . '</b>');
+
+      $contents = array('form' => tep_draw_form('sales', FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->sale_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $sInfo->sale_name . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->sale_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($sInfo)) {
+        $heading[] = array('text' => '<b>' . $sInfo->sale_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->sale_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->sale_id . '&action=copy') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a> <a href="' . tep_href_link(FILENAME_SALEMAKER, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->sale_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->sale_date_added));
+        $contents[] = array('text' => '' . TEXT_INFO_DATE_MODIFIED . ' ' . (($sInfo->sale_date_last_modified == '0000-00-00') ? TEXT_SALEMAKER_NEVER : tep_date_short($sInfo->sale_date_last_modified)));
+        $contents[] = array('text' => '' . TEXT_INFO_DATE_STATUS_CHANGE . ' ' . (($sInfo->sale_date_status_change == '0000-00-00') ? TEXT_SALEMAKER_NEVER : tep_date_short($sInfo->sale_date_status_change)));
+
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DEDUCTION . ' ' . $sInfo->sale_deduction_value . ' ' . $deduction_type_array[$sInfo->sale_deduction_type]['text']);
+        $contents[] = array('text' => '' . TEXT_INFO_PRICERANGE_FROM . ' ' . $currencies->format($sInfo->sale_pricerange_from) . TEXT_INFO_PRICERANGE_TO . $currencies->format($sInfo->sale_pricerange_to));
+        $contents[] = array('text' => '<table class="dataTableContent" border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td valign="top">' . TEXT_INFO_SPECIALS_CONDITION . '&nbsp;</td><td>' . $specials_condition_array[$sInfo->sale_specials_condition]['text'] . '</td></tr></table>');
+
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_START . ' ' . (($sInfo->sale_date_start == '0000-00-00') ? TEXT_SALEMAKER_IMMEDIATELY : tep_date_short($sInfo->sale_date_start)));
+        $contents[] = array('text' => '' . TEXT_INFO_DATE_END . ' ' . (($sInfo->sale_date_end == '0000-00-00') ? TEXT_SALEMAKER_NEVER : tep_date_short($sInfo->sale_date_end)));
+      }
+      break;
+  }
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+    echo '            </td>' . "\n";
+  }
+}
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<?php
+if ( (defined('DISPLAYTTT')) && (DISPLAYTTT == 'True') ) {
+?>
+<table border="0" width="100%" cellpadding="0"cellspacing="2">
+  <tr>
+    <td align="center"><?php echo tep_draw_separator('pixel_trans.gif', '4', '1') . tep_image(DIR_WS_IMAGES . 'thinktank.jpg'); ?></td>
+  </tr>
+</table>
+<?php
+}
+?>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/salemaker_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/salemaker_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/salemaker_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: salemaker_info.php,v 1.1.1.1 2004/03/04 23:38:57 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('DISPLAYTTT', 'True');
+
+  require("includes/application_top.php");
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SALEMAKER_INFO);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body>
+<p class="main"><center><h1><?php echo HEADING_TITLE; ?><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></h1></center></p>
+<table width="90%" align="center">
+<p class="main"><h3><?php echo SUBHEADING_TITLE; ?></h3></p>
+<div class="main">
+<?php echo INFO_TEXT; ?>
+</div>
+<p align="center" class="main"><a href="javascript:window.close();"><?php echo TEXT_CLOSE_WINDOW; ?></a></p>
+<?php
+if ( (defined('DISPLAYTTT')) && (DISPLAYTTT == 'True') ) {
+?>
+<center><?php echo tep_draw_separator('pixel_trans.gif', '4', '1') . tep_image(DIR_WS_IMAGES . 'thinktank.jpg'); ?></center>
+<?php
+} else {
+  echo '<br>';
+}
+?>
+</body>
+</html>
+<?php
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/admin/select_color.htm
===================================================================
--- trunk/direct.openmoko.com/admin/select_color.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/select_color.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,232 @@
+<html>
+
+<head>
+<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>New Page 1</title>
+</head>
+
+<body>
+<map name="colmap">
+<area shape="rect" coords="1,1,7,10" href="javascript:showColor('#00FF00')">
+<area shape="rect" coords="9,1,15,10" href="javascript:showColor('#00FF33')">
+<area shape="rect" coords="17,1,23,10" href="javascript:showColor('#00FF66')">
+<area shape="rect" coords="25,1,31,10" href="javascript:showColor('#00FF99')">
+<area shape="rect" coords="33,1,39,10" href="javascript:showColor('#00FFCC')">
+<area shape="rect" coords="41,1,47,10" href="javascript:showColor('#00FFFF')">
+<area shape="rect" coords="49,1,55,10" href="javascript:showColor('#33FF00')">
+<area shape="rect" coords="57,1,63,10" href="javascript:showColor('#33FF33')">
+<area shape="rect" coords="65,1,71,10" href="javascript:showColor('#33FF66')">
+<area shape="rect" coords="73,1,79,10" href="javascript:showColor('#33FF99')">
+<area shape="rect" coords="81,1,87,10" href="javascript:showColor('#33FFCC')">
+<area shape="rect" coords="89,1,95,10" href="javascript:showColor('#33FFFF')">
+<area shape="rect" coords="97,1,103,10" href="javascript:showColor('#66FF00')">
+<area shape="rect" coords="105,1,111,10" href="javascript:showColor('#66FF33')">
+<area shape="rect" coords="113,1,119,10" href="javascript:showColor('#66FF66')">
+<area shape="rect" coords="121,1,127,10" href="javascript:showColor('#66FF99')">
+<area shape="rect" coords="129,1,135,10" href="javascript:showColor('#66FFCC')">
+<area shape="rect" coords="137,1,143,10" href="javascript:showColor('#66FFFF')">
+<area shape="rect" coords="145,1,151,10" href="javascript:showColor('#99FF00')">
+<area shape="rect" coords="153,1,159,10" href="javascript:showColor('#99FF33')">
+<area shape="rect" coords="161,1,167,10" href="javascript:showColor('#99FF66')">
+<area shape="rect" coords="169,1,175,10" href="javascript:showColor('#99FF99')">
+<area shape="rect" coords="177,1,183,10" href="javascript:showColor('#99FFCC')">
+<area shape="rect" coords="185,1,191,10" href="javascript:showColor('#99FFFF')">
+<area shape="rect" coords="193,1,199,10" href="javascript:showColor('#CCFF00')">
+<area shape="rect" coords="201,1,207,10" href="javascript:showColor('#CCFF33')">
+<area shape="rect" coords="209,1,215,10" href="javascript:showColor('#CCFF66')">
+<area shape="rect" coords="217,1,223,10" href="javascript:showColor('#CCFF99')">
+<area shape="rect" coords="225,1,231,10" href="javascript:showColor('#CCFFCC')">
+<area shape="rect" coords="233,1,239,10" href="javascript:showColor('#CCFFFF')">
+<area shape="rect" coords="241,1,247,10" href="javascript:showColor('#FFFF00')">
+<area shape="rect" coords="249,1,255,10" href="javascript:showColor('#FFFF33')">
+<area shape="rect" coords="257,1,263,10" href="javascript:showColor('#FFFF66')">
+<area shape="rect" coords="265,1,271,10" href="javascript:showColor('#FFFF99')">
+<area shape="rect" coords="273,1,279,10" href="javascript:showColor('#FFFFCC')">
+<area shape="rect" coords="281,1,287,10" href="javascript:showColor('#FFFFFF')">
+<area shape="rect" coords="1,12,7,21" href="javascript:showColor('#00CC00')">
+<area shape="rect" coords="9,12,15,21" href="javascript:showColor('#00CC33')">
+<area shape="rect" coords="17,12,23,21" href="javascript:showColor('#00CC66')">
+<area shape="rect" coords="25,12,31,21" href="javascript:showColor('#00CC99')">
+<area shape="rect" coords="33,12,39,21" href="javascript:showColor('#00CCCC')">
+<area shape="rect" coords="41,12,47,21" href="javascript:showColor('#00CCFF')">
+<area shape="rect" coords="49,12,55,21" href="javascript:showColor('#33CC00')">
+<area shape="rect" coords="57,12,63,21" href="javascript:showColor('#33CC33')">
+<area shape="rect" coords="65,12,71,21" href="javascript:showColor('#33CC66')">
+<area shape="rect" coords="73,12,79,21" href="javascript:showColor('#33CC99')">
+<area shape="rect" coords="81,12,87,21" href="javascript:showColor('#33CCCC')">
+<area shape="rect" coords="89,12,95,21" href="javascript:showColor('#33CCFF')">
+<area shape="rect" coords="97,12,103,21" href="javascript:showColor('#66CC00')">
+<area shape="rect" coords="105,12,111,21" href="javascript:showColor('#66CC33')">
+<area shape="rect" coords="113,12,119,21" href="javascript:showColor('#66CC66')">
+<area shape="rect" coords="121,12,127,21" href="javascript:showColor('#66CC99')">
+<area shape="rect" coords="129,12,135,21" href="javascript:showColor('#66CCCC')">
+<area shape="rect" coords="137,12,143,21" href="javascript:showColor('#66CCFF')">
+<area shape="rect" coords="145,12,151,21" href="javascript:showColor('#99CC00')">
+<area shape="rect" coords="153,12,159,21" href="javascript:showColor('#99CC33')">
+<area shape="rect" coords="161,12,167,21" href="javascript:showColor('#99CC66')">
+<area shape="rect" coords="169,12,175,21" href="javascript:showColor('#99CC99')">
+<area shape="rect" coords="177,12,183,21" href="javascript:showColor('#99CCCC')">
+<area shape="rect" coords="185,12,191,21" href="javascript:showColor('#99CCFF')">
+<area shape="rect" coords="193,12,199,21" href="javascript:showColor('#CCCC00')">
+<area shape="rect" coords="201,12,207,21" href="javascript:showColor('#CCCC33')">
+<area shape="rect" coords="209,12,215,21" href="javascript:showColor('#CCCC66')">
+<area shape="rect" coords="217,12,223,21" href="javascript:showColor('#CCCC99')">
+<area shape="rect" coords="225,12,231,21" href="javascript:showColor('#CCCCCC')">
+<area shape="rect" coords="233,12,239,21" href="javascript:showColor('#CCCCFF')">
+<area shape="rect" coords="241,12,247,21" href="javascript:showColor('#FFCC00')">
+<area shape="rect" coords="249,12,255,21" href="javascript:showColor('#FFCC33')">
+<area shape="rect" coords="257,12,263,21" href="javascript:showColor('#FFCC66')">
+<area shape="rect" coords="265,12,271,21" href="javascript:showColor('#FFCC99')">
+<area shape="rect" coords="273,12,279,21" href="javascript:showColor('#FFCCCC')">
+<area shape="rect" coords="281,12,287,21" href="javascript:showColor('#FFCCFF')">
+<area shape="rect" coords="1,23,7,32" href="javascript:showColor('#009900')">
+<area shape="rect" coords="9,23,15,32" href="javascript:showColor('#009933')">
+<area shape="rect" coords="17,23,23,32" href="javascript:showColor('#009966')">
+<area shape="rect" coords="25,23,31,32" href="javascript:showColor('#009999')">
+<area shape="rect" coords="33,23,39,32" href="javascript:showColor('#0099CC')">
+<area shape="rect" coords="41,23,47,32" href="javascript:showColor('#0099FF')">
+<area shape="rect" coords="49,23,55,32" href="javascript:showColor('#339900')">
+<area shape="rect" coords="57,23,63,32" href="javascript:showColor('#339933')">
+<area shape="rect" coords="65,23,71,32" href="javascript:showColor('#339966')">
+<area shape="rect" coords="73,23,79,32" href="javascript:showColor('#339999')">
+<area shape="rect" coords="81,23,87,32" href="javascript:showColor('#3399CC')">
+<area shape="rect" coords="89,23,95,32" href="javascript:showColor('#3399FF')">
+<area shape="rect" coords="97,23,103,32" href="javascript:showColor('#669900')">
+<area shape="rect" coords="105,23,111,32" href="javascript:showColor('#669933')">
+<area shape="rect" coords="113,23,119,32" href="javascript:showColor('#669966')">
+<area shape="rect" coords="121,23,127,32" href="javascript:showColor('#669999')">
+<area shape="rect" coords="129,23,135,32" href="javascript:showColor('#6699CC')">
+<area shape="rect" coords="137,23,143,32" href="javascript:showColor('#6699FF')">
+<area shape="rect" coords="145,23,151,32" href="javascript:showColor('#999900')">
+<area shape="rect" coords="153,23,159,32" href="javascript:showColor('#999933')">
+<area shape="rect" coords="161,23,167,32" href="javascript:showColor('#999966')">
+<area shape="rect" coords="169,23,175,32" href="javascript:showColor('#999999')">
+<area shape="rect" coords="177,23,183,32" href="javascript:showColor('#9999CC')">
+<area shape="rect" coords="185,23,191,32" href="javascript:showColor('#9999FF')">
+<area shape="rect" coords="193,23,199,32" href="javascript:showColor('#CC9900')">
+<area shape="rect" coords="201,23,207,32" href="javascript:showColor('#CC9933')">
+<area shape="rect" coords="209,23,215,32" href="javascript:showColor('#CC9966')">
+<area shape="rect" coords="217,23,223,32" href="javascript:showColor('#CC9999')">
+<area shape="rect" coords="225,23,231,32" href="javascript:showColor('#CC99CC')">
+<area shape="rect" coords="233,23,239,32" href="javascript:showColor('#CC99FF')">
+<area shape="rect" coords="241,23,247,32" href="javascript:showColor('#FF9900')">
+<area shape="rect" coords="249,23,255,32" href="javascript:showColor('#FF9933')">
+<area shape="rect" coords="257,23,263,32" href="javascript:showColor('#FF9966')">
+<area shape="rect" coords="265,23,271,32" href="javascript:showColor('#FF9999')">
+<area shape="rect" coords="273,23,279,32" href="javascript:showColor('#FF99CC')">
+<area shape="rect" coords="281,23,287,32" href="javascript:showColor('#FF99FF')">
+<area shape="rect" coords="1,34,7,43" href="javascript:showColor('#006600')">
+<area shape="rect" coords="9,34,15,43" href="javascript:showColor('#006633')">
+<area shape="rect" coords="17,34,23,43" href="javascript:showColor('#006666')">
+<area shape="rect" coords="25,34,31,43" href="javascript:showColor('#006699')">
+<area shape="rect" coords="33,34,39,43" href="javascript:showColor('#0066CC')">
+<area shape="rect" coords="41,34,47,43" href="javascript:showColor('#0066FF')">
+<area shape="rect" coords="49,34,55,43" href="javascript:showColor('#336600')">
+<area shape="rect" coords="57,34,63,43" href="javascript:showColor('#336633')">
+<area shape="rect" coords="65,34,71,43" href="javascript:showColor('#336666')">
+<area shape="rect" coords="73,34,79,43" href="javascript:showColor('#336699')">
+<area shape="rect" coords="81,34,87,43" href="javascript:showColor('#3366CC')">
+<area shape="rect" coords="89,34,95,43" href="javascript:showColor('#3366FF')">
+<area shape="rect" coords="97,34,103,43" href="javascript:showColor('#666600')">
+<area shape="rect" coords="105,34,111,43" href="javascript:showColor('#666633')">
+<area shape="rect" coords="113,34,119,43" href="javascript:showColor('#666666')">
+<area shape="rect" coords="121,34,127,43" href="javascript:showColor('#666699')">
+<area shape="rect" coords="129,34,135,43" href="javascript:showColor('#6666CC')">
+<area shape="rect" coords="137,34,143,43" href="javascript:showColor('#6666FF')">
+<area shape="rect" coords="145,34,151,43" href="javascript:showColor('#996600')">
+<area shape="rect" coords="153,34,159,43" href="javascript:showColor('#996633')">
+<area shape="rect" coords="161,34,167,43" href="javascript:showColor('#996666')">
+<area shape="rect" coords="169,34,175,43" href="javascript:showColor('#996699')">
+<area shape="rect" coords="177,34,183,43" href="javascript:showColor('#9966CC')">
+<area shape="rect" coords="185,34,191,43" href="javascript:showColor('#9966FF')">
+<area shape="rect" coords="193,34,199,43" href="javascript:showColor('#CC6600')">
+<area shape="rect" coords="201,34,207,43" href="javascript:showColor('#CC6633')">
+<area shape="rect" coords="209,34,215,43" href="javascript:showColor('#CC6666')">
+<area shape="rect" coords="217,34,223,43" href="javascript:showColor('#CC6699')">
+<area shape="rect" coords="225,34,231,43" href="javascript:showColor('#CC66CC')">
+<area shape="rect" coords="233,34,239,43" href="javascript:showColor('#CC66FF')">
+<area shape="rect" coords="241,34,247,43" href="javascript:showColor('#FF6600')">
+<area shape="rect" coords="249,34,255,43" href="javascript:showColor('#FF6633')">
+<area shape="rect" coords="257,34,263,43" href="javascript:showColor('#FF6666')">
+<area shape="rect" coords="265,34,271,43" href="javascript:showColor('#FF6699')">
+<area shape="rect" coords="273,34,279,43" href="javascript:showColor('#FF66CC')">
+<area shape="rect" coords="281,34,287,43" href="javascript:showColor('#FF66FF')">
+<area shape="rect" coords="1,45,7,54" href="javascript:showColor('#003300')">
+<area shape="rect" coords="9,45,15,54" href="javascript:showColor('#003333')">
+<area shape="rect" coords="17,45,23,54" href="javascript:showColor('#003366')">
+<area shape="rect" coords="25,45,31,54" href="javascript:showColor('#003399')">
+<area shape="rect" coords="33,45,39,54" href="javascript:showColor('#0033CC')">
+<area shape="rect" coords="41,45,47,54" href="javascript:showColor('#0033FF')">
+<area shape="rect" coords="49,45,55,54" href="javascript:showColor('#333300')">
+<area shape="rect" coords="57,45,63,54" href="javascript:showColor('#333333')">
+<area shape="rect" coords="65,45,71,54" href="javascript:showColor('#333366')">
+<area shape="rect" coords="73,45,79,54" href="javascript:showColor('#333399')">
+<area shape="rect" coords="81,45,87,54" href="javascript:showColor('#3333CC')">
+<area shape="rect" coords="89,45,95,54" href="javascript:showColor('#3333FF')">
+<area shape="rect" coords="97,45,103,54" href="javascript:showColor('#663300')">
+<area shape="rect" coords="105,45,111,54" href="javascript:showColor('#663333')">
+<area shape="rect" coords="113,45,119,54" href="javascript:showColor('#663366')">
+<area shape="rect" coords="121,45,127,54" href="javascript:showColor('#663399')">
+<area shape="rect" coords="129,45,135,54" href="javascript:showColor('#6633CC')">
+<area shape="rect" coords="137,45,143,54" href="javascript:showColor('#6633FF')">
+<area shape="rect" coords="145,45,151,54" href="javascript:showColor('#993300')">
+<area shape="rect" coords="153,45,159,54" href="javascript:showColor('#993333')">
+<area shape="rect" coords="161,45,167,54" href="javascript:showColor('#993366')">
+<area shape="rect" coords="169,45,175,54" href="javascript:showColor('#993399')">
+<area shape="rect" coords="177,45,183,54" href="javascript:showColor('#9933CC')">
+<area shape="rect" coords="185,45,191,54" href="javascript:showColor('#9933FF')">
+<area shape="rect" coords="193,45,199,54" href="javascript:showColor('#CC3300')">
+<area shape="rect" coords="201,45,207,54" href="javascript:showColor('#CC3333')">
+<area shape="rect" coords="209,45,215,54" href="javascript:showColor('#CC3366')">
+<area shape="rect" coords="217,45,223,54" href="javascript:showColor('#CC3399')">
+<area shape="rect" coords="225,45,231,54" href="javascript:showColor('#CC33CC')">
+<area shape="rect" coords="233,45,239,54" href="javascript:showColor('#CC33FF')">
+<area shape="rect" coords="241,45,247,54" href="javascript:showColor('#FF3300')">
+<area shape="rect" coords="249,45,255,54" href="javascript:showColor('#FF3333')">
+<area shape="rect" coords="257,45,263,54" href="javascript:showColor('#FF3366')">
+<area shape="rect" coords="265,45,271,54" href="javascript:showColor('#FF3399')">
+<area shape="rect" coords="273,45,279,54" href="javascript:showColor('#FF33CC')">
+<area shape="rect" coords="281,45,287,54" href="javascript:showColor('#FF33FF')">
+<area shape="rect" coords="1,56,7,65" href="javascript:showColor('#000000')">
+<area shape="rect" coords="9,56,15,65" href="javascript:showColor('#000033')">
+<area shape="rect" coords="17,56,23,65" href="javascript:showColor('#000066')">
+<area shape="rect" coords="25,56,31,65" href="javascript:showColor('#000099')">
+<area shape="rect" coords="33,56,39,65" href="javascript:showColor('#0000CC')">
+<area shape="rect" coords="41,56,47,65" href="javascript:showColor('#0000FF')">
+<area shape="rect" coords="49,56,55,65" href="javascript:showColor('#330000')">
+<area shape="rect" coords="57,56,63,65" href="javascript:showColor('#330033')">
+<area shape="rect" coords="65,56,71,65" href="javascript:showColor('#330066')">
+<area shape="rect" coords="73,56,79,65" href="javascript:showColor('#330099')">
+<area shape="rect" coords="81,56,87,65" href="javascript:showColor('#3300CC')">
+<area shape="rect" coords="89,56,95,65" href="javascript:showColor('#3300FF')">
+<area shape="rect" coords="97,56,103,65" href="javascript:showColor('#660000')">
+<area shape="rect" coords="105,56,111,65" href="javascript:showColor('#660033')">
+<area shape="rect" coords="113,56,119,65" href="javascript:showColor('#660066')">
+<area shape="rect" coords="121,56,127,65" href="javascript:showColor('#660099')">
+<area shape="rect" coords="129,56,135,65" href="javascript:showColor('#6600CC')">
+<area shape="rect" coords="137,56,143,65" href="javascript:showColor('#6600FF')">
+<area shape="rect" coords="145,56,151,65" href="javascript:showColor('#990000')">
+<area shape="rect" coords="153,56,159,65" href="javascript:showColor('#990033')">
+<area shape="rect" coords="161,56,167,65" href="javascript:showColor('#990066')">
+<area shape="rect" coords="169,56,175,65" href="javascript:showColor('#990099')">
+<area shape="rect" coords="177,56,183,65" href="javascript:showColor('#9900CC')">
+<area shape="rect" coords="185,56,191,65" href="javascript:showColor('#9900FF')">
+<area shape="rect" coords="193,56,199,65" href="javascript:showColor('#CC0000')">
+<area shape="rect" coords="201,56,207,65" href="javascript:showColor('#CC0033')">
+<area shape="rect" coords="209,56,215,65" href="javascript:showColor('#CC0066')">
+<area shape="rect" coords="217,56,223,65" href="javascript:showColor('#CC0099')">
+<area shape="rect" coords="225,56,231,65" href="javascript:showColor('#CC00CC')">
+<area shape="rect" coords="233,56,239,65" href="javascript:showColor('#CC00FF')">
+<area shape="rect" coords="241,56,247,65" href="javascript:showColor('#FF0000')">
+<area shape="rect" coords="249,56,255,65" href="javascript:showColor('#FF0033')">
+<area shape="rect" coords="257,56,263,65" href="javascript:showColor('#FF0066')">
+<area shape="rect" coords="265,56,271,65" href="javascript:showColor('#FF0099')">
+<area shape="rect" coords="273,56,279,65" href="javascript:showColor('#FF00CC')">
+<area shape="rect" coords="281,56,287,65" href="javascript:showColor('#FF00FF')">
+</map>
+<a><img usemap="#colmap" src="images/colortable.gif" align=center border="0"></a>
+</body>
+
+</html>

Added: trunk/direct.openmoko.com/admin/server_info.php
===================================================================
--- trunk/direct.openmoko.com/admin/server_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/server_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,137 @@
+<?php
+/*
+  $Id: server_info.php,v 1.1.1.1 2004/03/04 23:38:58 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $system = tep_get_system_information();
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" cellspacing="0" cellpadding="3">
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_SERVER_HOST; ?></b></td>
+                <td class="smallText"><?php echo $system['host'] . ' (' . $system['ip'] . ')'; ?></td>
+                <td class="smallText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><?php echo TITLE_DATABASE_HOST; ?></b></td>
+                <td class="smallText"><?php echo $system['db_server'] . ' (' . $system['db_ip'] . ')'; ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_SERVER_OS; ?></b></td>
+                <td class="smallText"><?php echo $system['system'] . ' ' . $system['kernel']; ?></td>
+                <td class="smallText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><?php echo TITLE_DATABASE; ?></b></td>
+                <td class="smallText"><?php echo $system['db_version']; ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_SERVER_DATE; ?></b></td>
+                <td class="smallText"><?php echo $system['date']; ?></td>
+                <td class="smallText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><?php echo TITLE_DATABASE_DATE; ?></b></td>
+                <td class="smallText"><?php echo $system['db_date']; ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_SERVER_UP_TIME; ?></b></td>
+                <td colspan="3" class="smallText"><?php echo $system['uptime']; ?></td>
+              </tr>
+              <tr>
+                <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_HTTP_SERVER; ?></b></td>
+                <td colspan="3" class="smallText"><?php echo $system['http_server']; ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><b><?php echo TITLE_PHP_VERSION; ?></b></td>
+                <td colspan="3" class="smallText"><?php echo $system['php'] . ' (' . TITLE_ZEND_VERSION . ' ' . $system['zend'] . ')'; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td>
+<?php
+  if (function_exists('ob_start')) {
+?>
+<style type="text/css">
+body, td, th {font-family: sans-serif; font-size: 10px;}
+.p {text-align: left;}
+.e {background-color: #ccccff; font-weight: bold;}
+.h {background-color: #9999cc; font-weight: bold;}
+.v {background-color: #cccccc;}
+i {color: #666666;}
+hr {display: none;}
+</style>
+<?php
+    ob_start();
+    phpinfo();
+    $phpinfo = ob_get_contents();
+    ob_end_clean();
+
+    $phpinfo = str_replace('border: 1px', '', $phpinfo);
+    ereg('<body>(.*)</body>', $phpinfo, $regs);
+    echo '<table border="1" cellpadding="3" width="600" style="border: 0px; border-color: #000000;">' .
+         '  <tr><td><a href="http://www.oscommerce.com"><img border="0" src="images/oscommerce.gif" alt=" osCommerce " /></a><h1 class="p"> ' . PROJECT_VERSION . ' with patch:' . PROJECT_PATCH . '</h1></td>'.
+         '  </tr>' .
+         '</table>';
+    echo $regs[1];
+  } else {
+    phpinfo();
+  }
+?>
+        </td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/admin/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+require('includes/application_top.php');
+ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHIPWIRE);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+ <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+   <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><img border="0" src="images/shipwire_logo.gif"></td>
+          </tr>
+        </table></td>
+ </tr>
+ <tr>
+   <td class="main">
+     <?php echo CONTENT_TEXT1 ?>
+     <?php echo CONTENT_TEXT2 ?>
+     <?php echo CONTENT_TEXT3 ?>
+     <?php echo CONTENT_TEXT4 ?>
+     <?php echo CONTENT_TEXT5 ?>
+   </td>
+ </tr>
+</table>
+</td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/shopbyprice.php
===================================================================
--- trunk/direct.openmoko.com/admin/shopbyprice.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/shopbyprice.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,204 @@
+<?php
+/*
+  $Id: shopbyprice.php,v 1.1.1.1 2004/03/04 23:39:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+  $error_message = '';
+  if (!isset($HTTP_GET_VARS['oID'])) {
+    $oid = 1;
+  } else {
+    $oid = $HTTP_GET_VARS['oID'];
+  }
+
+  if ($action == 'save') {
+    if ($oid == 1) {
+      $sbp_ranges = tep_db_prepare_input($HTTP_POST_VARS['sbp_ranges']);
+      if (is_numeric($sbp_ranges)) {
+        tep_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . (int)$sbp_ranges . '" where configuration_key = "MODULE_SHOPBYPRICE_RANGES" ');
+        define('MODULE_SHOPBYPRICE_RANGES', $sbp_ranges);
+      } else {
+        $error_message .= TEXT_EDIT_ERROR_RANGES;
+      }
+      tep_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . $HTTP_POST_VARS['configuration_value'] . '" where configuration_key = "MODULE_SHOPBYPRICE_OVER" ');
+
+      if ($error_message != '') {
+        $action = 'edit';
+      }
+    } else {
+      $sbp_input_array = $HTTP_POST_VARS['sbp_range'];
+      $sbp_array[0] = tep_db_prepare_input($sbp_input_array[0]);
+      for ($i = 1, $ii = MODULE_SHOPBYPRICE_RANGES; $i < $ii; $i++) {
+        $sbp_array[$i] = tep_db_prepare_input($sbp_input_array[$i]);
+        if (! is_numeric($sbp_array[$i])) {
+          $error_message .= TEXT_EDIT_ERROR_NUMERIC;
+        } elseif ($sbp_array[$i] <= $sbp_array[$i - 1]) {
+          $error_message .= TEXT_EDIT_ERROR_RANGE;
+        }
+      }
+      if ($error_message == '') {
+        $serial_array = serialize($sbp_array);
+        $text = tep_db_input($serial_array);
+        tep_db_query('update ' . TABLE_CONFIGURATION . ' set configuration_value = "' . $text . '" where configuration_key = "MODULE_SHOPBYPRICE_RANGE" ');
+        define('MODULE_SHOPBYPRICE_RANGE', $serial_array);
+      } else {
+        $action = 'edit';
+      }
+    }
+  }
+
+  $sbp_array = unserialize(MODULE_SHOPBYPRICE_RANGE);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_OPTIONS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+
+  if ($oid == 1) {
+    echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=1&action=edit') . '\'">' . "\n";
+  } else {
+    echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=1') . '\'">' . "\n";
+  }
+?>
+                <td class="dataTableContent"><?php echo TEXT_INFO_OPTION_1; ?></td>
+                <td class="dataTableContent" align="right"><?php if ($HTTP_GET_VARS['oID'] == 1) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=1') . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  if ($oid == 2) {
+      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=2&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=2') . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo TEXT_INFO_OPTION_2; ?></td>
+                <td class="dataTableContent" align="right"><?php if ($HTTP_GET_VARS['oID'] == 2) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=2') . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'edit':
+      if ($oid == 1) {
+        $heading[] = array('text' => '<b>' . TEXT_EDIT_HEADING_OPTIONS . '</b>');
+        $contents = array('form' => tep_draw_form('sbp_options', FILENAME_SHOPBYPRICE, 'oID=1&action=save'));
+        if ($error_message != '') {
+          $contents[] = array('text' => '<font color="red">' . $error_message . '</font>');
+        }
+        $contents[] = array('text' => TEXT_EDIT_OPTIONS_INTRO);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_RANGES . '<br>' . tep_draw_input_field('sbp_ranges', MODULE_SHOPBYPRICE_RANGES));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_OVER . '<br>' . tep_cfg_select_option(array('True', 'False'),MODULE_SHOPBYPRICE_OVER));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=1') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      } elseif (MODULE_SHOPBYPRICE_RANGES > 0) {
+        $heading[] = array('text' => '<b>' . TEXT_EDIT_HEADING_RANGE . '</b>');
+        $contents = array('form' => tep_draw_form('sbp_options', FILENAME_SHOPBYPRICE, 'oID=2&action=save'));
+        if ($error_message != '') {
+          $contents[] = array('text' => '<font color="red">' . $error_message . '</font>');
+        }
+        $contents[] = array('text' => TEXT_EDIT_RANGE_INTRO);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_UNDER . tep_draw_input_field('sbp_range[0]', $sbp_array[0]));
+        for ($i = 1, $ii = MODULE_SHOPBYPRICE_RANGES; $i < $ii; $i++) {
+          $contents[] = array('text' => '<br>' . TEXT_INFO_TO . tep_draw_input_field('sbp_range['.$i.']', $sbp_array[$i]));
+        }
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=1') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      }
+      break;
+    default:
+      if ($oid == 1) {
+        $heading[] = array('text' => '<b>' . TEXT_EDIT_HEADING_OPTIONS . '</b>');
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=1&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_RANGES . ' ' . MODULE_SHOPBYPRICE_RANGES);
+        $contents[] = array('text' => '' . TEXT_INFO_OVER . ' ' . MODULE_SHOPBYPRICE_OVER);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_OPTIONS_DESCRIPTION . '<br>' . $tcInfo->tax_class_description);
+      } else {
+        $heading[] = array('text' => '<b>' . TEXT_EDIT_HEADING_RANGE . '</b>');
+        if (! MODULE_SHOPBYPRICE_RANGES > 0) {
+          $contents[] = array('align' => 'center', 'text' => TEXT_INFO_ZERORANGE);
+        } elseif (MODULE_SHOPBYPRICE_RANGE == '') {
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=2&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+          $contents[] = array('align' => 'center', 'text' => TEXT_INFO_NORANGE);
+        } else {
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SHOPBYPRICE, 'oID=2&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+          $contents[] = array('text' => '<br>' . TEXT_INFO_UNDER . $sbp_array[0]);
+          for ($i = 1, $ii = count($sbp_array); $i < $ii; $i++) {
+            $contents[] = array('text' => '<br>' . TEXT_INFO_TO . $sbp_array[$i]);
+          }
+          if (MODULE_SHOPBYPRICE_OVER) {
+            $contents[] = array('text' => '<br>' . $sbp_array[$i-1] . TEXT_INFO_ABOVE);
+          }
+        }
+      }
+      break;
+  }
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/specials.php
===================================================================
--- trunk/direct.openmoko.com/admin/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,333 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:38:58 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+// Eversun mod for sppc and qty price breaks
+      $customers_groups_query = tep_db_query("select customers_group_name, customers_group_id from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
+    while ($existing_groups =  tep_db_fetch_array($customers_groups_query)) {
+         $input_groups[] = array("id"=>$existing_groups['customers_group_id'], "text"=> $existing_groups['customers_group_name']);
+        $all_groups[$existing_groups['customers_group_id']]=$existing_groups['customers_group_name'];
+    }
+// Eversun mod end for sppc and qty price breaks
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'setflag':
+        tep_set_specials_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']);
+
+        tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $HTTP_GET_VARS['id'], 'NONSSL'));
+        break;
+      case 'insert':
+        $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+        $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
+        $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
+        $day = tep_db_prepare_input($HTTP_POST_VARS['day']);
+        $month = tep_db_prepare_input($HTTP_POST_VARS['month']);
+        $year = tep_db_prepare_input($HTTP_POST_VARS['year']);
+
+// Eversun mod for sppc and qty price breaks
+        $customers_group=tep_db_prepare_input($HTTP_POST_VARS['customers_group']);
+        $price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS. " WHERE products_id = ".(int)$products_id . " AND customers_group_id  = ".(int)$customers_group);
+        while ($gprices = tep_db_fetch_array($price_query)) {
+            $products_price = $gprices['customers_group_price'];
+        }
+// Eversun mod end for sppc and qty price breaks
+
+        if (substr($specials_price, -1) == '%') {
+          $new_special_insert_query = tep_db_query("select products_id, products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
+          $new_special_insert = tep_db_fetch_array($new_special_insert_query);
+
+          $products_price = $new_special_insert['products_price'];
+          $specials_price = ($products_price - (($specials_price / 100) * $products_price));
+        }
+
+        $expires_date = '';
+        if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
+          $expires_date = $year;
+          $expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
+          $expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
+        }
+
+// Eversun mod for sppc and qty price breaks
+//        tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1')");
+        tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status, customers_group_id) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1', ".(int)$customers_group.")");
+// Eversun mod end for sppc and qty price breaks
+
+        tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+      case 'update':
+        $specials_id = tep_db_prepare_input($HTTP_POST_VARS['specials_id']);
+        $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']);
+        $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']);
+        $day = tep_db_prepare_input($HTTP_POST_VARS['day']);
+        $month = tep_db_prepare_input($HTTP_POST_VARS['month']);
+        $year = tep_db_prepare_input($HTTP_POST_VARS['year']);
+
+        if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));
+
+        $expires_date = '';
+        if (tep_not_null($day) && tep_not_null($month) && tep_not_null($year)) {
+          $expires_date = $year;
+          $expires_date .= (strlen($month) == 1) ? '0' . $month : $month;
+          $expires_date .= (strlen($day) == 1) ? '0' . $day : $day;
+        }
+
+        tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = '" . tep_db_input($expires_date) . "' where specials_id = '" . (int)$specials_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials_id));
+        break;
+      case 'deleteconfirm':
+        $specials_id = tep_db_prepare_input($HTTP_GET_VARS['sID']);
+
+        tep_db_query("delete from " . TABLE_SPECIALS . " where specials_id = '" . (int)$specials_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+<?php
+  if ( ($action == 'new') || ($action == 'edit') ) {
+?>
+<link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">
+<script language="JavaScript" src="includes/javascript/calendarcode.js"></script>
+<?php
+  }
+?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<div id="popupcalendar" class="text"></div>
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ( ($action == 'new') || ($action == 'edit') ) {
+    $form_action = 'insert';
+    if ( ($action == 'edit') && isset($HTTP_GET_VARS['sID']) ) {
+      $form_action = 'update';
+
+// Eversun mod for sppc and qty price breaks
+//      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, s.specials_new_products_price, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id and s.specials_id = '" . (int)$HTTP_GET_VARS['sID'] . "'");
+      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, s.specials_new_products_price, s.expires_date, s.customers_group_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id and s.specials_id = '" . (int)$HTTP_GET_VARS['sID'] . "'");
+// Eversun mod end for sppc and qty price breaks
+
+      $product = tep_db_fetch_array($product_query);
+
+      $sInfo = new objectInfo($product);
+    } else {
+      $sInfo = new objectInfo(array());
+
+// create an array of products on special, which will be excluded from the pull down menu of products
+// (when creating a new product on special)
+
+// Eversun mod for sppc and qty price breaks
+/*
+      $specials_array = array();
+      $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id");
+      while ($specials = tep_db_fetch_array($specials_query)) {
+        $specials_array[] = $specials['products_id'];
+      }  */
+      $specials_array = array();
+  $specials_query = tep_db_query("select products_parent_id as products_id from " .  TABLE_PRODUCTS . " where products_parent_id <> 0");
+      while ($specials = tep_db_fetch_array($specials_query)) {
+        $specials_array[] = (int)$specials['products_id'];
+      }
+      $specials_query = tep_db_query("select p.products_id, s.customers_group_id from " .  TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id");
+      while ($specials = tep_db_fetch_array($specials_query)) {
+        $specials_array[] = (int)$specials['products_id'];
+      }
+      if(isset($HTTP_GET_VARS['sID']) && $sInfo->customers_group_id!= '0'){
+        $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $sInfo->products_id . "' and customers_group_id =  '" . $sInfo->customers_group_id . "'");
+        if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
+          $sInfo->products_price = $customer_group_price['customers_group_price'];
+        }
+      }
+// Eversun mod end for sppc and qty price breaks
+
+    }
+?>
+      <tr><form name="new_special" <?php echo 'action="' . tep_href_link(FILENAME_SPECIALS, tep_get_all_get_params(array('action', 'info', 'sID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('specials_id', $HTTP_GET_VARS['sID']); ?>
+        <td><br><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_SPECIALS_PRODUCT; ?>&nbsp;</td>
+            <td class="main"><?php echo (isset($sInfo->products_name)) ? $sInfo->products_name . ' <small>(' . $currencies->format($sInfo->products_price) . ')</small>' : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo tep_draw_hidden_field('products_price', (isset($sInfo->products_price) ? $sInfo->products_price : '')); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SPECIALS_SPECIAL_PRICE; ?>&nbsp;</td>
+            <td class="main"><?php echo tep_draw_input_field('specials_price', (isset($sInfo->specials_new_products_price) ? $sInfo->specials_new_products_price : '')); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo TEXT_SPECIALS_EXPIRES_DATE; ?>&nbsp;</td>
+            <td class="main"><?php echo tep_draw_input_field('day', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 8, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('month', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 5, 2) : ''), 'size="2" maxlength="2" class="cal-TextBox"') . tep_draw_input_field('year', (isset($sInfo->expires_date) ? substr($sInfo->expires_date, 0, 4) : ''), 'size="4" maxlength="4" class="cal-TextBox"'); ?><a class="so-BtnLink" href="javascript:calClick();return false;" onmouseover="calSwapImg('BTN_date', 'img_Date_OVER',true);" onmouseout="calSwapImg('BTN_date', 'img_Date_UP',true);" onclick="calSwapImg('BTN_date', 'img_Date_DOWN');showCalendar('new_special','dteWhen','BTN_date');return false;"><?php echo tep_image(DIR_WS_IMAGES . 'cal_date_up.gif', 'Calendar', '22', '17', 'align="absmiddle" name="BTN_date"'); ?></a></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP; ?></td>
+            <td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' . $HTTP_GET_VARS['sID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </form></tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCTS_PRICE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+    $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = s.products_id order by pd.products_name";
+    $specials_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $specials_query_raw, $specials_query_numrows);
+    $specials_query = tep_db_query($specials_query_raw);
+    while ($specials = tep_db_fetch_array($specials_query)) {
+      if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $specials['specials_id']))) && !isset($sInfo)) {
+        $products_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$specials['products_id'] . "'");
+        $products = tep_db_fetch_array($products_query);
+        $sInfo_array = array_merge($specials, $products);
+        $sInfo = new objectInfo($sInfo_array);
+      }
+
+      if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) {
+        echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '\'">' . "\n";
+      } else {
+        echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '\'">' . "\n";
+      }
+?>
+                <td  class="dataTableContent"><?php echo $specials['products_name']; ?></td>
+                <td  class="dataTableContent" align="right"><span class="oldPrice"><?php echo $currencies->format($specials['products_price']); ?></span> <span class="specialPrice"><?php echo $currencies->format($specials['specials_new_products_price']); ?></span></td>
+                <td  class="dataTableContent" align="right">
+<?php
+      if ($specials['status'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=0&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'action=setflag&flag=1&id=' . $specials['specials_id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($specials['specials_id'] == $sInfo->specials_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials['specials_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+      </tr>
+<?php
+    }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $specials_split->display_count($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>
+                    <td class="smallText" align="right"><?php echo $specials_split->display_links($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SPECIALS . '</b>');
+
+      $contents = array('form' => tep_draw_form('specials', FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $sInfo->products_name . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($sInfo)) {
+        $heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->specials_date_added));
+        $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->specials_last_modified));
+        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($sInfo->products_price));
+        $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price));
+        $contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . ' ' . number_format(100 - (($sInfo->specials_new_products_price / $sInfo->products_price) * 100)) . '%');
+
+        $contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . tep_date_short($sInfo->expires_date) . '</b>');
+        $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . tep_date_short($sInfo->date_status_change));
+      }
+      break;
+  }
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+}
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/ssl_check.php
===================================================================
--- trunk/direct.openmoko.com/admin/ssl_check.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/ssl_check.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,79 @@
+<?php
+/*
+  $Id: ssl_check.php,v 1.1.1.1 2004/03/04 23:38:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SSL_CHECK);
+?>  
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script type="text/javascript" src="includes/menu.js"></script>
+<script type="text/javascript" src="includes/general.js"></script>
+<?php require('includes/account_check.js.php'); ?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><table border="0" width="40%" cellspacing="0" cellpadding="0" align="right">
+          <tr>
+            <td><?php new InfoBoxHeading(array(array('text' => BOX_INFORMATION_HEADING))); ?></td>
+          </tr>
+          <tr>
+            <td><?php new infoBox(array(array('text' => BOX_INFORMATION))); ?></td>
+          </tr>
+        </table><?php echo TEXT_INFORMATION; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_LOGIN) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+      </tr>
+    </table>
+
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>  
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/stats_articles_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_articles_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_articles_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+/*
+  $Id: stats_articles_viewed.php,v 1.29 2003/06/29 22:50:52 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  
+  Copyright &copy; 2006 Chain Reaction Works, Inc
+  
+  Last Modifed by : $Author$
+  Last Modified on : $Date$
+  Latest Revision : $Revision: 300 $
+  
+  
+*/
+
+  require('includes/application_top.php');
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ARTICLES; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VIEWED; ?>&nbsp;</td>
+              </tr>
+<?php
+  if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
+  $rows = 0;
+  $articles_query_raw = "select p.articles_id, pd.articles_name, pd.articles_viewed, l.name from " . TABLE_ARTICLES . " p, " . TABLE_ARTICLES_DESCRIPTION . " pd, " . TABLE_LANGUAGES . " l where p.articles_id = pd.articles_id and l.languages_id = pd.language_id order by pd.articles_viewed DESC";
+  $articles_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $articles_query_raw, $articles_query_numrows);
+  $articles_query = tep_db_query($articles_query_raw);
+  while ($articles = tep_db_fetch_array($articles_query)) {
+    $rows++;
+
+    if (strlen($rows) < 2) {
+      $rows = '0' . $rows;
+    }
+?>
+              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CATEGORIES, 'action=new_article_preview&read=only&pID=' . $articles['articles_id'] . '&origin=' . FILENAME_STATS_ARTICLES_VIEWED . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL'); ?>'">
+                <td class="dataTableContent"><?php echo $rows; ?>.</td>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $articles['articles_id'] . '&origin=' . FILENAME_STATS_ARTICLES_VIEWED . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL') . '">' . $articles['articles_name'] . '</a> (' . $articles['name'] . ')'; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $articles['articles_viewed']; ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+          </tr>
+          <tr>
+            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php echo $articles_split->display_count($articles_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ARTICLES); ?></td>
+                <td class="smallText" align="right"><?php echo $articles_split->display_links($articles_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/stats_credits.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_credits.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_credits.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.31 2003/06/29 22:50:52 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+        </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_PURCHASED; ?>&nbsp;</td>
+              </tr>
+<?php
+  if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
+//  $customers_query_raw = "select c.customers_firstname, c.customers_lastname, sum(op.products_quantity * op.final_price) as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC";
+  $customers_query_raw = "select c.customers_firstname, c.customers_lastname, o.amount from " . TABLE_CUSTOMERS . " c, coupon_gv_customer o  where c.customers_id = o.customer_id group by c.customers_firstname, c.customers_lastname order by c.customers_lastname DESC";
+  $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);
+// fix counted customers
+//  $customers_query_numrows = tep_db_query("select customers_id from " . TABLE_ORDERS . " group by customers_id");
+  $customers_query_numrows = tep_db_query("select customer_id from coupon_gv_customer group by customer_id");
+  $customers_query_numrows = tep_db_num_rows($customers_query_numrows);
+
+  $rows = 0;
+  $customers_query = tep_db_query($customers_query_raw);
+  while ($customers = tep_db_fetch_array($customers_query)) {
+    $rows++;
+
+    if (strlen($rows) < 2) {
+      $rows = '0' . $rows;
+    }
+?>
+              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CUSTOMERS, 'search=' . $customers['customers_lastname'], 'NONSSL'); ?>'">
+                <td class="dataTableContent"><?php echo $rows; ?>.</td>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $customers['customers_lastname'], 'NONSSL') . '">' . $customers['customers_firstname'] . ' ' . $customers['customers_lastname'] . '</a>'; ?></td>
+<!--                <td class="dataTableContent" align="right"><?php echo $currencies->format($customers['ordersum']); ?>&nbsp;</td> -->
+                <td class="dataTableContent" align="right"><?php echo $currencies->format($customers['amount']); ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+          </tr>
+          <tr>
+            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
+                <td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>&nbsp;</td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/stats_customers.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_customers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_customers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,107 @@
+<?php
+/*
+  $Id: stats_customers.php,v 1.1.1.1 2004/03/04 23:38:58 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+        </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_PURCHASED; ?>&nbsp;</td>
+              </tr>
+<?php
+  if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
+  $customers_query_raw = "select c.customers_firstname, c.customers_lastname, sum(op.products_quantity * op.final_price) as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC";
+  $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);
+// fix counted customers
+  $customers_query_numrows = tep_db_query("select customers_id from " . TABLE_ORDERS . " group by customers_id");
+  $customers_query_numrows = tep_db_num_rows($customers_query_numrows);
+
+  $rows = 0;
+  $customers_query = tep_db_query($customers_query_raw);
+  while ($customers = tep_db_fetch_array($customers_query)) {
+    $rows++;
+
+    if (strlen($rows) < 2) {
+      $rows = '0' . $rows;
+    }
+?>
+              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CUSTOMERS, 'search=' . $customers['customers_lastname'], 'NONSSL'); ?>'">
+                <td class="dataTableContent"><?php echo $rows; ?>.</td>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $customers['customers_lastname'], 'NONSSL') . '">' . $customers['customers_firstname'] . ' ' . $customers['customers_lastname'] . '</a>'; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $currencies->format($customers['ordersum']); ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+          </tr>
+          <tr>
+            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
+                <td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>&nbsp;</td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/stats_customers_orders.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_customers_orders.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_customers_orders.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+<?php
/*
  $Id: stats_customers_orders.php,v 1.2 24 mars 2005 

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2005 osCommerce

  originally developed by xaglo
  Released under the GNU General Public License
*/
// change to your needs following
//  list of minimum for dropdown selection
  $list_mini = array("1", "2", "3", "4", "5", "10", "20");
// END CHANGING
  require('includes/configure.php');
  require('includes/application_top.php');
  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

// detecte les constantes ou initialise
  $today = getdate();
  if ($HTTP_GET_VARS['year']) $year = tep_db_prepare_input($HTTP_GET_VARS['year']); 
  else $year = $today['year']; //  else $year = 'ALL';
  if ($HTTP_GET_VARS['month']) $month = tep_db_prepare_input($HTTP_GET_VARS['month']); 
  else $month = $today['mon']; //  else $month = 'ALL';
  if ($HTTP_GET_VARS['mini_ordered']) $mini_ordered = tep_db_prepare_input($HTTP_GET_VARS['mini_ordered']); 
  else $mini_ordered = 1;
  if ($HTTP_GET_VARS['no_status']) $no_status = tep_db_prepare_input($HTTP_GET_VARS['no_status']); 
  if ($HTTP_GET_VARS['status']) $status = tep_db_prepare_input($HTTP_GET_VARS['status']); 

//  get list of years for dropdown selection
$year_begin_query = tep_db_query(" select startdate from counter");
$year_begin = tep_db_fetch_array($year_begin_query);
$year_begin = substr($year_begin['startdate'], 0, 4);
$current_year = $year_begin;
while ($current_year != $today['year'] + 1) {
  $list_year_array[] = array('id' => $current_year,
                              'text' => $current_year);
$current_year++;
}

//  get list of month for dropdown selection
  $list_month = array(JAN, FEV, MAR, AVR, MAI, JUN, JUI, AOU, SEP, OCT, NOV, DEC);
  for ($i = 0, $n = sizeof($list_month); $i < $n; $i++) {
    $list_month_array[] = array('id' => $i+1,
                                'text' => $list_month[$i]);
}

// get list of minimum names for dropdown selection
for ($i = 0, $n = sizeof($list_mini); $i < $n; $i++) {
  $list_mini_array[] = array('id' => $list_mini[$i],
                              'text' => $list_mini[$i]);
}

// get list of orders_status names for dropdown selection
  $orders_statuses = array();
  $orders_status_array = array();
  $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "'");
  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
    $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
                 'text' => $orders_status['orders_status_name']);
    $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
     };

// Total new_customers
  $new_customers_query_raw = "select count(customers_info_id) as tot_new_customers from " . TABLE_CUSTOMERS_INFO . " where 1=1";
  if ($month != 'ALL') $new_customers_query_raw .= " and MONTH(customers_info_date_account_created) = " . $month ;
  if ($year != 'ALL') $new_customers_query_raw .= " and YEAR(customers_info_date_account_created) = " . $year;
  $new_customers_query = tep_db_query($new_customers_query_raw);
  $new_customers = tep_db_fetch_array($new_customers_query);
  $new_customers_count = $new_customers['tot_new_customers'];

//* Total distinct customers
  $customers_query_raw = "select distinct(customers_id) from " . TABLE_ORDERS . " where 1=1";
  if ($month != 'ALL') $customers_query_raw .= " and MONTH(date_purchased) = " . $month ;
  if ($year != 'ALL') $customers_query_raw .= " and YEAR(date_purchased) = " . $year;
  if ($no_status) $customers_query_raw .= " and orders_status <> " . $no_status;
  if ($status) $customers_query_raw .= " and orders_status = " . $status;
  $customers_query = tep_db_query($customers_query_raw);
  $customers_id_array = array();
  while ($customers = tep_db_fetch_array($customers_query)) {
    $customers_id_array[] = $customers['customers_id']; 
  }
  $customers_count = sizeof($customers_id_array);

//* Total new_customers_bought
  $new_customers_bought_query_raw = "select distinct(o.customers_id) from " . TABLE_ORDERS . " o, " . TABLE_CUSTOMERS_INFO . " ci where ci.customers_info_id = o.customers_id";
  if ($month != 'ALL') $new_customers_bought_query_raw .= " and MONTH(o.date_purchased) = " . $month . " and MONTH(ci.customers_info_date_account_created) = " . $month ;
  if ($year != 'ALL') $new_customers_bought_query_raw .= " and YEAR(o.date_purchased) = " . $year .  " and YEAR(ci.customers_info_date_account_created) = " . $year;
  if ($no_status) $new_customers_query_raw .= " and o.orders_status <> " . $no_status;
  if ($status) $new_customers_query_raw .= " and o.orders_status = " . $status;
  $new_customers_bought_query = tep_db_query($new_customers_bought_query_raw);
  $new_customers_bought_id_array = array();
  while ($new_customers_bought = tep_db_fetch_array($new_customers_bought_query)) {
    $new_customers_bought_id_array[] = $new_customers_bought['customers_id']; 
  }
  $new_customers_bought_count = sizeof($new_customers_bought_id_array);
  if ($new_customers_bought_count > 0) $new_customers_bought_percent = tep_round($new_customers_bought_count/$new_customers_count*100, 0);

//* Total customers_bought
  $customers_bought_query_raw = "select customers_id from " . TABLE_ORDERS;
  if ($no_status) $customers_query_raw .= " where orders_status <> " . $no_status;
  if ($status) $customers_query_raw .= " where orders_status = " . $status;
  $customers_bought_query = tep_db_query($customers_bought_query_raw);
  $customers_bought_id_array = array();
  while ($customers_bought = tep_db_fetch_array($customers_bought_query)) { 
    $customers_bought_id_array[] = $customers_bought['customers_id']; 
  }

  $count_customers_again = 0;
  foreach($customers_id_array as $value) {
    $key = sizeof(array_keys($customers_bought_id_array, $value));
    if ($key>$mini_ordered) $count_customers_again++;
  }
  if ($customers_count > 0) $percent_customers_again = tep_round($count_customers_again/$customers_count*100, 0);

//* Total orders
  $orders_query_raw = "select count(*) as total from " . TABLE_ORDERS . " where 1=1 ";
  if ($month != 'ALL') $orders_query_raw .= " and MONTH(date_purchased) = " . $month ;
  if ($year != 'ALL') $orders_query_raw .= " and YEAR(date_purchased) = " . $year;
  if ($no_status) $orders_query_raw .= " and orders_status <> " . $no_status;
  if ($status) $orders_query_raw .= " and orders_status = " . $status;
  $orders_query = tep_db_query($orders_query_raw);
  $orders = tep_db_fetch_array($orders_query);
  $count_orders = $orders['total'];

//* Total sales
  $tot_sale_query_raw = "select sum(ot.value) as total, count(ot.value) as count from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot where ot.class='ot_total' and ot.orders_id=o.orders_id";
  if ($month != 'ALL') $tot_sale_query_raw .= " and MONTH(o.date_purchased) = " . $month ;
  if ($year != 'ALL') $tot_sale_query_raw .= " and YEAR(o.date_purchased) = " . $year;
  if ($no_status) $tot_sale_query_raw .= " and o.orders_status <> " . $no_status;
  if ($status) $tot_sale_query_raw .= " and o.orders_status = " . $status;
  $tot_sale_query = tep_db_query($tot_sale_query_raw);
  $tot_sale = tep_db_fetch_array($tot_sale_query);

//* Total taxes
  $tot_taxes_query_raw = "select sum(ot.value) as total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot where ot.class='ot_tax' and ot.orders_id=o.orders_id";
  if ($month != 'ALL') $tot_taxes_query_raw .= " and MONTH(date_purchased) = " . $month ;
  if ($year != 'ALL') $tot_taxes_query_raw .= " and YEAR(date_purchased) = " . $year;
  if ($no_status) $tot_taxes_query_raw .= " and orders_status <> " . $no_status;
  if ($status) $tot_taxes_query_raw .= " and orders_status = " . $status;
  $tot_taxes_query = tep_db_query($tot_taxes_query_raw);
  $tot_taxes = tep_db_fetch_array($tot_taxes_query);

//* Total shipping
  $tot_shipping_query_raw = "select sum(ot.value) as total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot where ot.class='ot_shipping' and ot.orders_id=o.orders_id";
  if ($month != 'ALL') $tot_shipping_query_raw .= " and MONTH(date_purchased) = " . $month ;
  if ($year != 'ALL') $tot_shipping_query_raw .= " and YEAR(date_purchased) = " . $year;
  if ($no_status) $tot_shipping_query_raw .= " and orders_status <> " . $no_status;
  if ($status) $tot_shipping_query_raw .= " and orders_status = " . $status;
  $tot_shipping_query = tep_db_query($tot_shipping_query_raw);
  $tot_shipping = tep_db_fetch_array($tot_shipping_query);

  $tot_HT=$tot_sale['total']-$tot_taxes['total']-$tot_shipping['total'];
?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
    </table></td>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" cellspacing="0" cellpadding="0"><?php echo tep_draw_form('search', FILENAME_STATS_CUSTOMERS_ORDERS, '', 'get'); 
          if (isset($HTTP_GET_VARS[tep_session_name()])) {
            echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
         }
        ?>
          <tr>
            <td class="dataTableContent" align="center"><?php echo HEADING_MONTH; ?>&nbsp;</td>
            <td class="dataTableContent" align="center"><?php echo HEADING_YEAR; ?>&nbsp;</td>
            <td class="dataTableContent" align="center"><?php echo HEADING_NUMBER_ORDERS; ?>&nbsp;</td>
<?php if ($status == '') { ?>
            <td class="dataTableContent" align="center"><?php echo HEADING_TITLE_NO_STATUS; ?>&nbsp;</td>
<?php } if ($no_status == '') { ?>
            <td class="dataTableContent" align="center"><?php echo HEADING_TITLE_STATUS; ?></td>
<?php } ?>
          </tr>
          <tr>
            <td class="main" align="center"><?php echo tep_draw_pull_down_menu('month', array_merge(array(array('id' => 'ALL', 'text' => TEXT_ALL_MOIS)), $list_month_array), '', 'onChange="this.form.submit();"');?>&nbsp;</td>
            <td class="main" align="center"><?php echo tep_draw_pull_down_menu('year', array_merge(array(array('id' => 'ALL', 'text' => TEXT_ALL_ANNEE)), $list_year_array), '', 'onChange="this.form.submit();"'); ?>&nbsp;</td>
            <td class="main" align="center"><?php echo tep_draw_pull_down_menu('mini_ordered', $list_mini_array, '', 'onChange="this.form.submit();"'); ?>&nbsp;</td>
<?php if ($status == '') { ?>
            <td class="main" align="center"><?php echo tep_draw_pull_down_menu('no_status', array_merge(array(array('id' => '', 'text' => TEXT_NO_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?>&nbsp;</td>
<?php } if ($no_status == '') { ?>
            <td class="main" align="center"><?php echo tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td>
<?php } ?>
          </tr>
        </form></table></td>
      </tr>
      <tr>
        <td><table border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr class="dataTableHeadingRow">
            <td align="right" class="dataTableHeadingContent"><?php echo NEW_CUSTOMERS; ?></td>
            <td class="dataTableHeadingContent"><?php echo $new_customers_count; ?></td>
          </tr>
          <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
            <td align="right" class="dataTableContent"><?php echo CUSTOMERS_BOUGHT; ?></td>
            <td class="dataTableContent"><?php echo $customers_count; ?></td>
          </tr>
          <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
            <td align="right" class="dataTableContent"><?php echo NEW_CUSTOMERS_BOUGHT; ?></td>
            <td class="dataTableContent"><?php echo $new_customers_bought_count . ' (' . $new_customers_bought_percent . "%)"; ?></td>
          </tr>
          <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
            <td align="right" class="dataTableContent"><?php echo sprintf(TEXT_MINI_ORDERED, $mini_ordered);?></td>
            <td class="dataTableContent"><?php echo $count_customers_again . ' (' . $percent_customers_again . '%)'; ?></td>
          </tr>
          <tr class="dataTableHeadingRow">
            <td align="right" class="dataTableHeadingContent"><?php echo NUMBER_ORDER; ?></td>
            <td class="dataTableHeadingContent"><?php echo $count_orders; ?></td>
          </tr>
          <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
            <td align="right" class="dataTableContent"><?php echo TOTAL_TTC; ?></td>
            <td align ="right" class="dataTableContent"><?php echo $currencies->format($tot_sale['total']); ?></td>
          </tr>
          <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
            <td align="right" class="dataTableContent"><?php echo TOTAL_SHIPPING; ?></td>
            <td align ="right"  class="dataTableContent"><?php echo $currencies->format($tot_shipping['total']); ?></td>
          </tr>
          <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
            <td align="right" class="dataTableContent"><?php echo TOTAL_TAX; ?></td>
            <td align ="right"  class="dataTableContent"><?php echo $currencies->format($tot_taxes['total']); ?></td>
          </tr>
          <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
            <td align="right" class="dataTableContent"><?php echo TOTAL_HT; ?></td>
            <td align ="right"  class="dataTableContent"><?php echo $currencies->format($tot_HT); ?></td>
          </tr>
          <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
            <td align="right" class="dataTableContent"><?php echo BASKET_TTC; ?></td>
            <td align ="right"  class="dataTableContent"><?php if ($count_orders > 0) echo $currencies->format($tot_sale['total']/$count_orders); ?></td>
          </tr>
          <tr class="dataTableHeadingRow">
            <td align="right" class="dataTableHeadingContent"><?php echo BASKET_HT; ?></td>
            <td align ="right"  class="dataTableHeadingContent"><?php if ($count_orders > 0) echo $currencies->format($tot_HT/$count_orders); ?></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>

<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
</body>
</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/stats_daily_products_sales_report.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_daily_products_sales_report.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_daily_products_sales_report.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,214 @@
+<?php
+/*
+  Written by Marc Sauton, September 2004
+  Daily Product Report Contribution for the OsCommerce Community
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  // start csv - bounce csv string back as file
+  if (isset($_POST['csv'])) {
+  if ($HTTP_POST_VARS['saveas']) {  // rebound posted csv as save file
+      $savename= $HTTP_POST_VARS['saveas'] . ".csv";
+      }
+      else $savename='unknown.csv';
+  $csv_string = '';
+  if ($HTTP_POST_VARS['csv']) $csv_string=$HTTP_POST_VARS['csv'];
+  if (strlen($csv_string)>0){
+    header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
+    header("Last-Modified: " . gmdate('D,d M Y H:i:s') . ' GMT');
+    header("Cache-Control: no-cache, must-revalidate");
+    header("Pragma: no-cache");
+    header("Content-Type: Application/octet-stream");
+    header("Content-Disposition: attachment; filename=$savename");
+    echo $csv_string;
+  }
+  else echo "CSV string empty";
+  exit;
+  };
+  //end csv
+
+  if( $_REQUEST[ "date"] == "") {
+     $date = date('Y-m-d'); #2003-09-07%
+  } else {
+      if(  ereg( "([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $_REQUEST[ 'date'])) {
+          $date = $_REQUEST[ "date"];
+      } else {
+          $date = date('Y-m-d'); #2003-09-07%
+      }
+  }
+  if( $date == "") { $date = date('Y-m-d'); }
+  $cal1maxdate = date("Y") . "," . date("m") . "," . date("d");
+
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
+<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<div id="spiffycalendar" class="text"></div>
+<script language="javascript"><!--
+  var cal1 = new ctlSpiffyCalendarBox("cal1", "dailyreportform", "reportdate","btnDate3","",scBTNMODE_CALBTN);
+  cal1.readonly=true;
+  cal1.displayLeft=true;
+  // cal1.JStoRunOnSelect="document.dailyreportform.submit();";
+  cal1.JStoRunOnSelect="document.dailyreportform.action='<?php echo basename($_SERVER['PHP_SELF'])?>?date='+document.dailyreportform.reportdate.value; document.dailyreportform.submit();";
+  cal1.useDateRange=true;
+  cal1.setMinDate(2004,1,1);
+  cal1.setMaxDate( <?php echo $cal1maxdate; ?> );
+//--></script>
+
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+        </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE . " for " . $date; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+            <td class=main>
+                <form method="post" action=" <?php echo basename($_SERVER['PHP_SELF']) . '?date=' . $date; ?>" name="dailyreportform">
+                <!-- input type="hidden" name="action" value="dailyreportaction" -->
+                <?php // <br>cal1 value:<script language="javascript">document.write( document.forms.dailyreportform.action);</script><br> ?>
+                <?php echo DISPLAY_ANOTHER_REPORT_DATE;?>
+                <script language="javascript">cal1.writeControl(); cal1.dateFormat="yyyy-MM-dd"; document.dailyreportform.reportdate.value="<?php echo $date; ?>"</script></td>
+                </form>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+<?php
+$csv_accum .= "";
+?>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
+                <td class="dataTableHeadingContent"><?php mirror_out(TABLE_HEADING_ORDER_QUANTITY); ?></td>
+                <td class="dataTableHeadingContent"><?php mirror_out(TABLE_HEADING_PRODUCT_NAME); ?></td>
+                <td class="dataTableHeadingContent"><?php mirror_out(TABLE_HEADING_PRODUCT_MODEL); ?></td>
+                <td class="dataTableHeadingContent"><?php mirror_out(TABLE_HEADING_UNITPRICE); ?></td>
+                <td class="dataTableHeadingContent"><?php mirror_out(TABLE_HEADING_PRODUCT_QUANTITY); ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php mirror_out(TABLE_HEADING_TOTAL_PURCHASED); ?>&nbsp;</td>
+              </tr>
+
+<?php
+// new line for CSV
+$csv_accum .= "\n";
+//
+
+  if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
+  $products_query_raw = "select ot.value, sum(ot.value) as dailyvalue, count(distinct o.orders_id) as howmany_orders, o.orders_id, count(distinct op.orders_products_id) as howmany_tickets, op.products_name, op.products_model, op.final_price as ticket_price, op.final_price * count(distinct op.orders_products_id) as howmuch from orders_total ot, orders o, orders_products op where o.date_purchased like \"$date%\" and o.orders_id = op.orders_id and ot.orders_id = op.orders_id and ot.class='ot_total' group by op.products_name";
+
+
+  $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);
+  $products_query_numrows = tep_db_query($products_query_raw);
+  $products_query_numrows = tep_db_num_rows($products_query_numrows);
+
+  $rows = 0;
+  $products_query = tep_db_query($products_query_raw);
+  while ($products = tep_db_fetch_array($products_query)) {
+    $rows++;
+
+    if (strlen($rows) < 2) {
+      $rows = '0' . $rows;
+    }
+?>
+              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php //echo tep_href_link(FILENAME_CUSTOMERS, 'search=' . $products['products_name'], 'NONSSL'); ?>'">
+                <td class="dataTableContent"><?php echo $rows; ?>.</td>
+                <td class="dataTableContent"><?php mirror_out(number_format($products['howmany_orders'],0)) ?>.</td>
+                <td class="dataTableContent"><?php mirror_out($products['products_name']) ?>.</td>
+                <td class="dataTableContent"><?php mirror_out($products['products_model']) ?></td>
+                <td class="dataTableContent"><?php mirror_out(number_format($products['ticket_price'],2)) ?>.</td>
+                <td class="dataTableContent"><?php mirror_out(number_format($products['howmany_tickets'],0)) ?>.</td>
+                <td class="dataTableContent" align="right"><?php mirror_out(number_format($products['howmuch'],2)); ?></td>
+              </tr>
+<?php
+// new line for CSV
+$csv_accum .= "\n";
+//
+  }
+?>
+            </table></td>
+          </tr>
+          <tr>
+            <td class=main align=center>
+<?php
+  //$products_query_raw = "select sum(ot.value) as dailyvalue from orders_total ot,orders o where ot.orders_id = o.orders_id and ot.class = 'ot_total' and o.date_purchased like \"$date%\"";
+  $products_query_raw = "select   sum(ot.value) as dailyvalue from orders_total ot, orders o, orders_products op where o.date_purchased like \"$date%\" and o.orders_id = op.orders_id and ot.orders_id = op.orders_id and ot.class='ot_total'";
+  $products_query_numrows = tep_db_query($products_query_raw);
+  $products_query_numrows = tep_db_num_rows($products_query_numrows);
+  $rows = 0;
+  $products_query = tep_db_query($products_query_raw);
+  while ($products = tep_db_fetch_array($products_query)) {
+    echo '<b>' . TABLE_DAILY_VALUE . $currencies->format($products['dailyvalue']) . '</b>';
+  }
+?>
+          </tr>
+          <tr>
+            <td class="smallText" colspan="4"><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method=post>
+              <input type='hidden' name='csv' value='<?php echo $csv_accum; ?>'>
+              <input type="hidden" name="saveas" value="daily_product_sales_report_<?php echo date('YmdHi'); ?>">
+              <input type="submit" value="<?php echo TEXT_BUTTON_REPORT_SAVE ;?>"></form>
+            </td>
+          </tr>
+          <tr>
+            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php echo $customers_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+                <td class="smallText" align="right"><?php echo $customers_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>&nbsp;</td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+
+function mirror_out ($field) {
+  global $csv_accum;
+  echo $field;
+  $field = strip_tags($field);
+  $field = ereg_replace (",","",$field);
+  if ($csv_accum=='') $csv_accum=$field; 
+  else 
+  {if (strrpos($csv_accum,chr(10)) == (strlen($csv_accum)-1)) $csv_accum .= $field;
+    else $csv_accum .= "," . $field; };
+  return;
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/stats_explain_queries.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_explain_queries.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_explain_queries.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,268 @@
+<?php
+/*-----------------------------------------------------------------------------*\
+#################################################################################
+# Script name: admin/stats_explain_queries.php
+# Version: v1.0
+#
+# Copyright (C) 2005 Bobby Easland
+# Internet moniker: Chemo
+# Contact: chemo at mesoimpact.com
+#
+# This script is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# Script is intended to be used with:
+# osCommerce, Open Source E-Commerce Solutions
+# http://www.oscommerce.com
+# Copyright (c) 2003 osCommerce
+################################################################################
+\*-----------------------------------------------------------------------------*/
+
+  require('includes/application_top.php');
+  
+/* Set it false initially */
+$run_it = false;
+  
+/* function used to download the CVS export */
+function file_download($filecontents, $filename)
+{ 
+  header('Content-Type: application/octet-stream');
+  header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
+  header('Content-Disposition: attachment; filename="' . $filename . '"');
+  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+  header('Pragma: public');
+  echo $filecontents; 
+  exit();
+}
+
+if ( isset($_POST['truncate']) && $_POST['truncate'] == 'true' ) {
+  tep_db_query('TRUNCATE TABLE `explain_queries`');
+}
+
+if ( isset($_POST['analyze']) && $_POST['analyze'] == 'true' ) {
+  tep_db_query('ANALYZE TABLE `explain_queries`');
+}
+
+$limit = ( (isset($_GET['limit'])) ? (int)$_GET['limit'] : 20);
+$offset = ( (isset($_GET['offset'])) ? (int)$_GET['offset'] : 0);
+
+if ( isset($_GET['script']) && tep_not_null($_GET['script']) ){
+  $type = 'script';
+  $_query_raw = "SELECT `md5query` , `query` , `time` , `script` , `request_string` , `table` , `type` , `possible_keys` , `key` , `key_len` , `ref` , `rows` , `Extra` , `Comment`, avg(time) as average, count(md5query) as num_records, min(time) as min, max(time) as max from explain_queries where script='".$_GET['script']."' GROUP BY md5query ORDER BY average DESC limit $offset, $limit";
+  $run_it = true;
+}
+
+if (isset($_GET['query']) && tep_not_null($_GET['query']) ){
+  $type = 'query';
+  $_query_raw = "SELECT `md5query` , `query` , `time`, `script` , `request_string` , `table` , `type` , `possible_keys` , `key` , `key_len` , `ref` , `rows` , `Extra` , `Comment`, avg(time) as average, count(md5query) as num_records, min(time) as min, max(time) as max from explain_queries WHERE md5query='".$_GET['query']."' GROUP BY script ORDER BY average DESC limit $offset, $limit";
+  $run_it = true;
+}
+
+if (isset($_POST['format'])){
+  switch($_POST['format']){
+    case 'html':
+      $html_out = true;
+    break;
+    case 'cvs':
+    default:
+      $cvsfields = array('time','script','request_string','table','type','possible_keys','key','key_len','ref','rows','Extra','Comment','query');
+      $cvsoutput = implode("\t", $cvsfields) . "\n"; 
+      $cvs_out = true;
+    break;
+  } # End switch
+}
+
+if ($run_it){
+  $_query = tep_db_query($_query_raw);
+
+  while ($temp = tep_db_fetch_array($_query)){
+    if (tep_not_null($temp['Extra'])) $temp['Extra'] = '<font color="#990000">'. $temp['Extra'] . '</font>';
+    if (tep_not_null($temp['Comment'])) $temp['Comment'] = '<font color="#990000">'. $temp['Comment'] . '</font>';
+    $_result[]=$temp;
+    if ($cvs_out){
+      foreach ($cvsfields as $index => $field){
+        $temp_cvs[] = $temp[$field];
+      } # End foreach
+      $cvsoutput .= implode("\t", $temp_cvs)."\n";
+      unset($temp_cvs);
+    } # End if
+  } # End while
+} # End if
+
+/* This is a CVS download so let 'em have it */
+if ($cvs_out){
+  file_download(rtrim($cvsoutput), str_replace('.php', '.txt', $_GET['script']));
+}
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><!-- Explain Queries v1.0 - by Chemo --><?php echo STATS_EXPLAIN_QUERIES_TXT_1?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php
+/* if this is an html export start the buffer to swallow the header and column left */
+if ($html_out) ob_start(); 
+require(DIR_WS_INCLUDES . 'header.php'); 
+?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top">
+  <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+  <!-- left_navigation //-->
+  <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+  <!-- left_navigation_eof //-->
+    </table>
+  <br>
+<!-- truncate and analyze button //-->
+<div align="center">
+  <form action="" method="post">
+    <input type="hidden" name="truncate" value="true">
+    <input type="submit" value="Truncate Table">
+  </form>
+</div>
+  <br>
+<div align="center">
+  <form action="" method="post">
+    <input type="hidden" name="analyze" value="true">
+    <input type="submit" value="Analyze Table">
+  </form>
+</div>
+<!--  truncate and analyze button end //--> 
+  </td>
+<!-- body_text //-->
+    <td width="100%" valign="top">
+  <!--  page heading and export format forum //-->
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+          <td class="pageHeading" align="left"><!-- Explain Queries Report v1.0 <a href="http://forums.oscommerce.com/index.php?showuser=9196">- by Chemo</a> --> <?php echo STATS_EXPLAIN_QUERIES_TXT_2?></td>
+            <td align="right">
+        <form action="<?php echo $_SERVER['PHP_SELF'] . '?' .tep_get_all_get_params(); ?>" method="post">
+        <table border="0" width="100%" cellspacing="0" cellpadding="0" >
+          <tr>
+            <td class="dataTableContent" align="right"><b><!-- Export Format --><?php echo STATS_EXPLAIN_QUERIES_TXT_3?></b></td><td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td class="dataTableContent" align="right"><!-- CVS --> <?php echo STATS_EXPLAIN_QUERIES_TXT_4?> <input type="radio" name="format" value="cvs" checked><!-- HTML --> <?php echo STATS_EXPLAIN_QUERIES_TXT_5?><input type="radio" name="format" value="html"></td>
+            <td align="right"><input type="submit" value="Export"></td>
+          </tr>
+        </table>
+        </form>
+      </td>
+    </tr>
+  </table>
+  <!-- page heading and export format end //-->
+  <!-- script drop down menu filter and limit - offset //-->
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+    <tr>
+    <td class="dataTableContent">
+    <form action="" method="get">
+<?php
+/* Query for total scripts, number of unique queries, and total queries stored for the script */
+$pages_query = tep_db_query('select script, count(distinct md5query) as count, count(*) as total from explain_queries group by script');
+/* Start the drop down menu */
+$page_menu = '<select name="script">';
+while ($temp = tep_db_fetch_array($pages_query)){
+  $pages_indexed[] = $temp['script'];
+  $selected = ( ($_GET['script'] == $temp['script']) ? ' selected' : '' );
+    $page_menu .= '<option value="' . $temp['script'] . '"'.$selected.'>' . $temp['script'] . ' ('.$temp['count'].' / '. $temp['total'].')</option>';
+}
+$page_menu .= '</select>';
+echo $page_menu;
+?>
+&nbsp;<!-- Limit to --><?php echo STATS_EXPLAIN_QUERIES_TXT_6?>&nbsp;<input type="text" size="3" maxlength="3" name="limit" value="<?php echo ( (isset($_GET['limit'])) ? $_GET['limit'] : '20'); ?>">
+&nbsp;<!-- rows starting with row# --><?php echo STATS_EXPLAIN_QUERIES_TXT_7?>&nbsp;<input type="text" size="3" maxlength="3" name="offset" value="<?php echo ( (isset($_GET['offset'])) ? $_GET['offset'] : '0'); ?>">
+      <input type="submit">
+      </form>
+      </td>
+    </tr>
+  </table>
+  <!-- script drop down filter and limit - offset end //-->
+  <br>
+<?php 
+if ($html_out) {
+  /* End the buffer if this is an html export */
+  ob_end_clean(); 
+  /* Give a link back to the page so they won't be stranded */
+  echo '<p><a href="'.$_SERVER['PHP_SELF'].'">'.STATS_EXPLAIN_QUERIES_TXT_8.'</a><p>';
+}
+?>
+  <table border="0" width="100%" cellspacing="0" cellpadding="2">
+    <tr>
+      <td valign="top" class="dataTableContent">
+        <?php echo sizeof($_result); ?> <!-- results returned for: --> <?php echo STATS_EXPLAIN_QUERIES_TXT_9?> <b><?php echo $type . '=' . $_GET[$type]; ?></b>
+      </td>
+    </tr>
+  </table>
+  <br>
+  <table border="0" width="100%" cellspacing="0" cellpadding="2">
+    <tr>
+    <td valign="top">     
+<?php
+/* If we have a result set to work with let's make some pretty tables */
+if (isset($_result)){
+  $i = $offset+1;
+  /* Loop it */
+  foreach($_result as $data){
+?>
+  <!-- data table for query <?php echo $i; ?> //-->
+  <table border="1" width="100%" cellspacing="0" cellpadding="3">
+    <tr class="dataTableHeadingRow">
+      <td class="dataTableHeadingContent"><font color="#990000"><!-- Query# --><?php echo STATS_EXPLAIN_QUERIES_TXT_10?>&nbsp;<?php echo $i; ?> =></font>&nbsp <a href="<?php echo basename($_SERVER['PHP_SELF']).'?query='.$data['md5query'] ?>"><?php echo $data['query']; ?></a></td>
+    </tr>
+  </table>
+  <table border="1" width="100%" cellspacing="0" cellpadding="2">
+    <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
+      <td class="dataTableContent" align="left" valign="top"><!-- Time (ms):  --><?php echo STATS_EXPLAIN_QUERIES_TXT_11?><?php echo number_format($data['min'], 3) .' - <b>'.number_format($data['average'], 3).'</b> - '.number_format($data['max'], 3); ?></td>
+      <td class="dataTableContent" align="left" valign="top"><!-- # Records: --> <?php echo STATS_EXPLAIN_QUERIES_TXT_12?><b><?php echo $data['num_records']; ?></b></td>
+      <td class="dataTableContent" align="left" valign="top"><!-- Script:  --> <?php echo STATS_EXPLAIN_QUERIES_TXT_13?><b><?php echo $data['script']; ?></b></td>
+      <td class="dataTableContent" align="left" valign="top"><!-- Request String: --> <?php echo STATS_EXPLAIN_QUERIES_TXT_14?> <b><?php echo $data['request_string']; ?></b></td>
+    </tr>
+    <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
+      <td class="dataTableContent" align="left" valign="top"><!-- Table:  --><?php echo STATS_EXPLAIN_QUERIES_TXT_15?><b><?php echo $data['table']; ?></b></td>
+      <td class="dataTableContent" align="left" valign="top"><!-- Type:  --><?php echo STATS_EXPLAIN_QUERIES_TXT_16?><b><?php echo $data['type']; ?></b></td>
+      <td class="dataTableContent" align="left" valign="top"><!-- Possible / Used Key:  --><?php echo STATS_EXPLAIN_QUERIES_TXT_17?><b><?php echo $data['possible_keys'].' / '.$data['key']; ?></b></td>
+      <td class="dataTableContent" align="left" valign="top"><!-- Key Len: --> <?php echo STATS_EXPLAIN_QUERIES_TXT_18?> <b><?php echo $data['key_len']; ?></b></td>
+    </tr>
+    <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
+      <td class="dataTableContent" align="left" valign="top"><!-- Rows:  --> <?php echo STATS_EXPLAIN_QUERIES_TXT_19?><b><?php echo $data['rows']; ?></b></td>
+      <td class="dataTableContent" align="left" valign="top"><!-- Ref:  --><?php echo STATS_EXPLAIN_QUERIES_TXT_20?><b><?php echo $data['ref']; ?></b></td>
+      <td class="dataTableContent" align="left" valign="top"><!-- Extra:  --><?php echo STATS_EXPLAIN_QUERIES_TXT_21?><b><?php echo $data['Extra']; ?></b></td>
+      <td class="dataTableContent" align="left" valign="top"><!-- Comment: --> <?php echo STATS_EXPLAIN_QUERIES_TXT_22?><b><?php echo $data['Comment']; ?></b></td>
+    </tr>
+  </table>
+  <!-- end data table for query <?php echo $i; ?> //-->
+  <br>
+<?php
+$i++;
+  }
+}
+/* unset the array since it may be rather large */
+unset($_result);
+?>      
+      </td>
+    </tr>
+  </table>
+      </td>
+    </tr>
+  </table>
+<!-- body_text_eof //-->
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/stats_monthly_sales.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_monthly_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_monthly_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,652 @@
+<?php
+/*
+  $Id: stats_monthly_sales.php, v 2.2 2005/12/24  $
+
+  contributed by Fritz Clapp <fritz at sonnybarger.com>
+
+This report displays a summary of monthly or daily totals:
+  gross income (order totals)
+  subtotals of all orders in the selected period
+  nontaxed sales subtotals
+  taxed sales subtotals
+  tax collected
+  shipping/handling charges
+  low order fees (if present)
+  gift vouchers (or other addl order total component, if present)
+
+The data comes from the orders and orders_total tables, therefore this report
+works only for osCommerce snapshots since 2002/04/08 (including MS1 and MS2).
+
+Data is reported as of order purchase date.
+
+If an order status is chosen, the report summarizes orders with that status.
+
+Version 2.0 introduces the capability to "drill down" on any month
+to report the daily summary for that month.  
+
+Report rows are initially shown in newest to oldest, top to bottom, 
+but this order may be inverted by clicking the "Invert" control button.
+
+Version 2.1 adds a popup display that lists the various types (and their
+subtotals) comprising the tax values in the report rows.
+
+**NOTE:
+This Version 2.2 has columns that summarize nontaxed and taxed order subtotals.
+The taxed column summarizes subtotals for orders in which tax was charged.
+The nontaxed column is the subtotal for the row less the taxed column value.
+
+  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');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+//
+// entry for help popup window
+if (isset($_GET['help'])){ 
+  echo TEXT_HELP;
+  exit;
+};
+//
+// entry for bouncing csv string back as file
+if (isset($_POST['csv'])) {
+if ($HTTP_POST_VARS['saveas']) {  // rebound posted csv as save file
+    $savename= $HTTP_POST_VARS['saveas'] . ".csv";
+    }
+    else $savename='unknown.csv';
+$csv_string = '';
+if ($HTTP_POST_VARS['csv']) $csv_string=$HTTP_POST_VARS['csv'];
+  if (strlen($csv_string)>0){
+  header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
+  header("Last-Modified: " . gmdate('D,d M Y H:i:s') . ' GMT');
+  header("Cache-Control: no-cache, must-revalidate");
+  header("Pragma: no-cache");
+  header("Content-Type: Application/octet-stream");
+  header("Content-Disposition: attachment; filename=$savename");
+  echo $csv_string;
+  }
+  else echo "CSV string empty";
+exit;
+};
+//
+// entry for popup display of tax detail
+// show=ot_tax 
+if (isset($HTTP_GET_VARS['show'])) {
+  $ot_type = tep_db_prepare_input($HTTP_GET_VARS['show']);
+  $sel_month = tep_db_prepare_input($HTTP_GET_VARS['month']);
+  $sel_year = tep_db_prepare_input($HTTP_GET_VARS['year']);
+  $sel_day = 0;
+  if (isset($HTTP_GET_VARS['day'])) $sel_day = tep_db_prepare_input($HTTP_GET_VARS['day']);
+  $status = '';
+  if ($HTTP_GET_VARS['status']) $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+  // construct query for selected detail
+  $detail_query_raw = "select sum(ot.value) amount, ot.title description from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) where ";
+  if ($status<>'') $detail_query_raw .= "o.orders_status ='" . $status . "' and ";
+  $detail_query_raw .= "ot.class = '" . $ot_type . "' and month(o.date_purchased)= '" . $sel_month . "' and year(o.date_purchased)= '" . $sel_year . "'";
+  if ($sel_day<>0) $detail_query_raw .= " and dayofmonth(o.date_purchased) = '" . $sel_day . "'";
+  $detail_query_raw .= " group by ot.title";
+  $detail_query = tep_db_query($detail_query_raw);
+  echo "<!doctype html public \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html " . HTML_PARAMS . "><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . CHARSET . "\">" . "<title>" . TEXT_DETAIL . "</title><link rel=\"stylesheet\" type=\"text/css\" href=\"includes/stylesheet.css\"></head><body><br><table width=\"80%\" align=center><caption align=center>";
+  if ($sel_day<>0) echo $sel_day . "/" ;
+  echo $sel_year . "/" . $sel_month;
+  if ($sel_day<>0) echo "/" . $sel_day;
+  if ($status<>'') echo "<br>" . HEADING_TITLE_STATUS . ":" . "&nbsp;" . $status;
+  echo "</caption>";
+ 
+  while ($detail_line = tep_db_fetch_array($detail_query)) {
+  echo "<tr class=dataTableRow><td align=left width='75%'>" . $detail_line['description'] . "</td><td align=right>" . number_format($detail_line['amount'],2) . "</td></tr>";}
+  echo "</table></body>";
+exit;
+};
+//
+// main entry for report display
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="<?php if(!$print) {
+  echo 'includes/stylesheet.css';}
+  else echo 'includes/printer.css'; ?>">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<?php
+// set printer-friendly toggle
+(tep_db_prepare_input($HTTP_GET_VARS['print']=='yes')) ? $print=true : $print=false;
+// set inversion toggle
+(tep_db_prepare_input($HTTP_GET_VARS['invert']=='yes')) ? $invert=true : $invert=false;
+?>
+<!-- header //-->
+<?php if(!$print) require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+
+<?php  // suppress left column for printer-friendly version
+  if(!$print) {?>
+  <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+  <!-- left_navigation //-->
+  <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+  <!-- left_navigation_eof //-->
+        </table></td>
+<?php };  ?>
+
+<!-- body_text //-->
+    <td width="100%" valign="top">
+  <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td>
+    <table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php if ($print) {
+  echo "<tr><td class=\"pageHeading\">" . STORE_NAME ."</td></tr>";
+  };
+?>
+      <tr>
+            <td class="pageHeading">
+      <?php echo HEADING_TITLE; ?></td>
+<?php 
+// detect whether this is monthly detail request
+$sel_month = 0;
+  if ($HTTP_GET_VARS['month']&& $HTTP_GET_VARS['year']) {
+  $sel_month = tep_db_prepare_input($HTTP_GET_VARS['month']);
+  $sel_year = tep_db_prepare_input($HTTP_GET_VARS['year']);
+  };
+// get list of orders_status names for dropdown selection
+  $orders_statuses = array();
+  $orders_status_array = array();
+  $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "'");
+  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+    $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
+                 'text' => $orders_status['orders_status_name']);
+    $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
+    };
+// name of status selection
+$orders_status_text = TEXT_ALL_ORDERS;
+if ($HTTP_GET_VARS['status']) {
+  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+  $orders_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "' and orders_status_id =" . $status);
+  while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+    $orders_status_text = $orders_status['orders_status_name'];}
+        };  
+if (!$print) { ?>
+      <td align="right">
+      <table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr><td class="smallText" align="right">
+        <?php echo tep_draw_form('status', FILENAME_STATS_MONTHLY_SALES, '', 'get');
+        // get list of orders_status names for dropdown selection
+          if (isset($HTTP_GET_VARS[tep_session_name()])) {
+            echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+          }
+          $orders_statuses = array();
+          $orders_status_array = array();
+          $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "'");
+          while ($orders_status = tep_db_fetch_array($orders_status_query)) {
+            $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
+               'text' => $orders_status['orders_status_name']);
+          $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
+          };
+                echo HEADING_TITLE_STATUS . ': ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?>
+        <input type="hidden" name="selected_box" value="reports">
+        <?php
+          if ($sel_month<>0) 
+          echo "<input type='hidden' name='month' value='" . $sel_month . "'><input type='hidden' name='year' value='" . $sel_year . "'>";
+          if ($invert) echo "<input type='hidden' name='invert' value='yes'>";
+        ?>
+        </td>
+              </form></tr>
+             </table>
+       </td>
+<?php   }; ?>
+
+<?php if ($print) { ?>
+      <td>
+      </td>
+    <tr><td>
+        <table>
+        <tr><td class="smallText"><?php echo HEADING_TITLE_REPORTED . ": "; ?></td>
+        <td width="8"></td>
+        <td class="smallText" align="left"><?php echo date(ltrim(TEXT_REPORT_DATE_FORMAT)); ?></td>
+        </tr>
+        <tr><td class="smallText" align="left">
+        <?php echo HEADING_TITLE_STATUS . ": ";  ?></td>
+        <td width="8"></td>
+        <td class="smallText" align="left">
+        <?php echo $orders_status_text;?>
+        </td>
+        </tr>
+        <table>
+      </td><td></td>
+    </tr>
+<?php   };   ?>
+        </table></td>
+      </tr>
+<?php if(!$print) { ?>
+<!--
+row for buttons to print, save, and help
+-->
+      <tr>
+        <td  align="right">
+        <table align=right cellspacing="10"><tr>
+        <td align="left" class="smallText">
+        <?php  // back button if monthly detail
+        if ($sel_month<>0)   {
+        echo "<a href='" . $_SERVER['PHP_SELF'] . "?&selected_box=reports";
+        if (isset($HTTP_GET_VARS['status'])) echo "&status=" . $status;
+        if (isset($HTTP_GET_VARS['invert'])) echo "&invert=yes";
+        echo "' title='" . TEXT_BUTTON_REPORT_BACK_DESC . "'>" . TEXT_BUTTON_REPORT_BACK . "</a>";
+        };
+        ?>
+        </td>
+        <td class="smallText"><a href="<?php  
+        echo $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'] . "&print=yes";
+        ?>" target="print" title="<?php echo TEXT_BUTTON_REPORT_PRINT_DESC . "\">" . TEXT_BUTTON_REPORT_PRINT; ?></a>
+        </td>
+        <td class="smallText"><a href='<?php echo $_SERVER['PHP_SELF'] . "?" . ereg_replace('&invert=yes','',$_SERVER['QUERY_STRING']);
+        if (!$invert) echo "&invert=yes";
+        echo "' title= '" . TEXT_BUTTON_REPORT_INVERT_DESC . "'>" . TEXT_BUTTON_REPORT_INVERT; ?></a>
+        </td>
+        <td class="smallText"><a href="#" onClick="window.open('<?php  
+        echo $_SERVER['PHP_SELF'] . "?&help=yes"; ?>','help',config='height=400,width=600,scrollbars=1, resizable=1')" title="<?php echo TEXT_BUTTON_REPORT_HELP_DESC . "\">" . TEXT_BUTTON_REPORT_HELP; ?></a>
+        </td>
+        </tr></table>
+        </td>
+      </tr>
+<?php };  
+//
+// determine if loworder fee is enabled in configuration, include/omit the column
+$loworder_query_raw = "select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key =" . "'MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE'";
+$loworder = false;
+$loworder_query = tep_db_query($loworder_query_raw);
+if (tep_db_num_rows($loworder_query)>0) {
+  $low_setting=tep_db_fetch_array($loworder_query);
+  if ($low_setting['configuration_value']=='true') $loworder=true;
+};
+//
+// if there are extended class values in orders_table
+// create extra column so totals are comprehensively correct
+$class_val_subtotal = "'ot_subtotal'";
+$class_val_tax = "'ot_tax'";
+$class_val_shiphndl = "'ot_shipping'";
+$class_val_loworder = "'ot_loworderfee'";
+$class_val_total = "'ot_total'";
+  $extra_class_query_raw = "select value from " . TABLE_ORDERS_TOTAL . " where class <> " . $class_val_subtotal . " and class <>" . $class_val_tax . " and class <>" . $class_val_shiphndl . " and class <>" . $class_val_loworder . " and class <>" . $class_val_total;
+  $extra_class = false;
+  $extra_class_query = tep_db_query($extra_class_query_raw);
+  if (tep_db_num_rows($extra_class_query)>0) $extra_class = true;
+// start accumulator for the report content mirrored in CSV
+$csv_accum = '';
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top">
+      <table border="0" width='100%' cellspacing="0" cellpadding="2">
+<tr class="dataTableHeadingRow">
+<td class="dataTableHeadingContent" width='45' align='left' valign="bottom"><?php 
+if ($sel_month == 0) mirror_out(TABLE_HEADING_MONTH); else mirror_out(TABLE_HEADING_MONTH); ?>
+</td>
+<td class="dataTableHeadingContent" width='35' align='left' valign="bottom"><?php 
+if ($sel_month == 0) mirror_out(TABLE_HEADING_YEAR); else mirror_out(TABLE_HEADING_DAY); ?></td>
+<td class="dataTableHeadingContent" width='70' align='right' valign="bottom"><?php mirror_out(TABLE_HEADING_INCOME); ?></td>
+<td class="dataTableHeadingContent" width='70' align='right' valign="bottom"><?php mirror_out(TABLE_HEADING_SALES); ?></td>
+<td class="dataTableHeadingContent" width='70' align='right' valign="bottom"><?php mirror_out(TABLE_HEADING_NONTAXED); ?></td>
+<td class="dataTableHeadingContent" width='70' align='right' valign="bottom"><?php mirror_out(TABLE_HEADING_TAXED); ?></td>
+<td class="dataTableHeadingContent" width='70' align='right' valign="bottom"><?php mirror_out(TABLE_HEADING_TAX_COLL); ?></td>
+<td class="dataTableHeadingContent" width='70' align='right' valign="bottom"><?php mirror_out(TABLE_HEADING_SHIPHNDL); ?></td>
+<td class="dataTableHeadingContent" width='70' align='right' valign="bottom"><?php mirror_out(TABLE_HEADING_SHIP_TAX); ?></td>
+<?php 
+if ($loworder) { ?>
+<td class="dataTableHeadingContent" width='70' align='right' valign="bottom"><?php mirror_out(TABLE_HEADING_LOWORDER); ?></td>
+<?php }; ?>
+<?php
+if ($extra_class) { ?>
+<td class="dataTableHeadingContent" width='70' align='right' valign="bottom"><?php mirror_out(TABLE_HEADING_OTHER); ?></td>
+<?php }; ?>
+</tr>
+<?php 
+// clear footer totals
+  $footer_gross = 0;
+  $footer_sales = 0;
+  $footer_sales_nontaxed = 0;
+  $footer_sales_taxed = 0;
+  $footer_tax_coll = 0;
+  $footer_shiphndl = 0;
+  $footer_shipping_tax = 0;
+  $footer_loworder = 0;
+  $footer_other = 0;
+// new line for CSV
+$csv_accum .= "\n";
+// order totals, the driving force 
+$status = '';
+$sales_query_raw = "select sum(ot.value) gross_sales, monthname(o.date_purchased) row_month, year(o.date_purchased) row_year, month(o.date_purchased) i_month, dayofmonth(o.date_purchased) row_day  from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) where ";
+if ($HTTP_GET_VARS['status']) {
+  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
+  $sales_query_raw .= "o.orders_status =" . $status . " and ";
+  };
+$sales_query_raw .= "ot.class = " . $class_val_total;
+if ($sel_month<>0) $sales_query_raw .= " and month(o.date_purchased) = " . $sel_month;
+$sales_query_raw .= " group by year(o.date_purchased), month(o.date_purchased)";
+if ($sel_month<>0) $sales_query_raw .= ", dayofmonth(o.date_purchased)";
+$sales_query_raw .=  " order by o.date_purchased ";
+if ($invert) $sales_query_raw .= "asc"; else $sales_query_raw .= "desc";
+$sales_query = tep_db_query($sales_query_raw);
+$num_rows = tep_db_num_rows($sales_query);
+if ($num_rows==0) echo '<tr><td class="smalltext">' . TEXT_NOTHING_FOUND . '</td></tr>';
+$rows=0;
+//
+// loop here for each row reported
+while ($sales = tep_db_fetch_array($sales_query)) {
+  $rows++;
+  if ($rows>1 && $sales['row_year']<>$last_row_year) {  // emit annual footer
+?>
+<tr class="dataTableHeadingRow">
+<td class="dataTableHeadingContent" align="left">
+<?php 
+  if ($sales['row_year']==date("Y")) mirror_out(TABLE_FOOTER_YTD); 
+  else 
+    if ($sel_month==0) mirror_out(TABLE_FOOTER_YEAR);
+    else
+      mirror_out(strtoupper(substr($sales['row_month'],0,3)));
+?>
+</td>
+<td class="dataTableHeadingContent" align="left">
+<?php mirror_out($last_row_year); ?></td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_gross,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_sales,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_sales_nontaxed,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_sales_taxed,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_tax_coll,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_shiphndl,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format(($footer_shipping_tax <= 0) ? 0 : $footer_shipping_tax,2)); ?>
+</td>
+<?php if ($loworder) { ?>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_loworder,2)); ?>
+</td>
+<?php }; ?>
+<?php if ($extra_class) { ?>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_other,2)); ?>
+</td>
+<?php }; 
+// clear footer totals
+$footer_gross = 0;
+$footer_sales = 0;
+$footer_sales_nontaxed = 0;
+$footer_sales_taxed = 0;
+$footer_tax_coll = 0;
+$footer_shiphndl = 0;
+$footer_shipping_tax = 0;
+$footer_loworder = 0;
+$footer_other = 0;
+// new line for CSV
+$csv_accum .= "\n";
+?>
+</tr>
+<?php };
+//
+
+// determine net sales for row
+
+// Retrieve totals for products that are zero VAT rated
+$net_sales_query_raw = "select sum(op.final_price * op.products_quantity) net_sales from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_PRODUCTS . " op on (o.orders_id = op.orders_id) where op.products_tax = 0 and ";
+if ($status<>'') $net_sales_query_raw .= "o.orders_status ='" . $status . "' and ";
+$net_sales_query_raw .= " month(o.date_purchased)= '" . $sales['i_month'] . "' and year(o.date_purchased)= '" . $sales['row_year'] . "'";
+if ($sel_month<>0) $net_sales_query_raw .= " and dayofmonth(o.date_purchased) = '" . $sales['row_day'] . "'";
+
+$net_sales_query = tep_db_query($net_sales_query_raw);
+$net_sales_this_row = 0;
+if (tep_db_num_rows($net_sales_query) > 0)
+  $zero_rated_sales_this_row = tep_db_fetch_array($net_sales_query);
+
+// Retrieve totals for products that are NOT zero VAT rated
+$net_sales_query_raw = "select sum(op.final_price * op.products_quantity) net_sales, sum(op.final_price * op.products_quantity * (1 + (op.products_tax / 100.0))) gross_sales, sum((op.final_price * op.products_quantity * (1 + (op.products_tax / 100.0))) - (op.final_price * op.products_quantity)) tax from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_PRODUCTS . " op on (o.orders_id = op.orders_id) where op.products_tax <> 0 and ";
+if ($status<>'') $net_sales_query_raw .= "o.orders_status ='" . $status . "' and ";
+$net_sales_query_raw .= " month(o.date_purchased)= '" . $sales['i_month'] . "' and year(o.date_purchased)= '" . $sales['row_year'] . "'";
+if ($sel_month<>0) $net_sales_query_raw .= " and dayofmonth(o.date_purchased) = '" . $sales['row_day'] . "'";
+
+$net_sales_query = tep_db_query($net_sales_query_raw);
+$net_sales_this_row = 0;
+if (tep_db_num_rows($net_sales_query) > 0)
+  $net_sales_this_row = tep_db_fetch_array($net_sales_query);
+
+// Total tax. This is needed so we can calculate any tax that has been added to the postage
+$tax_coll_query_raw = "select sum(ot.value) tax_coll from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) where ";
+if ($status<>'') $tax_coll_query_raw .= "o.orders_status ='" . $status . "' and ";
+$tax_coll_query_raw .= "ot.class = " . $class_val_tax . " and month(o.date_purchased)= '" . $sales['i_month'] . "' and year(o.date_purchased)= '" . $sales['row_year'] . "'";
+if ($sel_month<>0) $tax_coll_query_raw .= " and dayofmonth(o.date_purchased) = '" . $sales['row_day'] . "'";
+$tax_coll_query = tep_db_query($tax_coll_query_raw);
+$tax_this_row = 0;
+if (tep_db_num_rows($tax_coll_query)>0) 
+  $tax_this_row = tep_db_fetch_array($tax_coll_query);
+
+//
+// shipping and handling charges for row
+$shiphndl_query_raw = "select sum(ot.value) shiphndl from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) where ";
+if ($status<>'') $shiphndl_query_raw .= "o.orders_status ='" . $status . "' and ";
+$shiphndl_query_raw .= "ot.class = " . $class_val_shiphndl . " and month(o.date_purchased)= '" . $sales['i_month'] . "' and year(o.date_purchased)= '" . $sales['row_year'] . "'";
+if ($sel_month<>0) $shiphndl_query_raw .= " and dayofmonth(o.date_purchased) = '" . $sales['row_day'] . "'";
+$shiphndl_query = tep_db_query($shiphndl_query_raw);
+$shiphndl_this_row = 0;
+if (tep_db_num_rows($shiphndl_query)>0) 
+  $shiphndl_this_row = tep_db_fetch_array($shiphndl_query);
+//
+// low order fees for row
+$loworder_this_row = 0;
+if ($loworder) {
+  $loworder_query_raw = "select sum(ot.value) loworder from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) where ";
+  if ($status<>'') $loworder_query_raw .= "o.orders_status ='" . $status . "' and ";
+  $loworder_query_raw .= "ot.class = " . $class_val_loworder . " and month(o.date_purchased)= '" . $sales['i_month'] . "' and year(o.date_purchased)= '" . $sales['row_year'] . "'";
+  if ($sel_month<>0) $loworder_query_raw .= " and dayofmonth(o.date_purchased) = '" . $sales['row_day'] . "'";
+  $loworder_query = tep_db_query($loworder_query_raw);
+  if (tep_db_num_rows($loworder_query)>0) 
+  $loworder_this_row = tep_db_fetch_array($loworder_query);
+};
+//
+// additional column if extra class value in orders_total table
+$other_this_row = 0;
+if ($extra_class) { 
+  $other_query_raw = "select sum(ot.value) other from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) where ";
+  if ($status<>'') $other_query_raw .= "o.orders_status ='" . $status . "' and ";
+  $other_query_raw .= "ot.class <> " . $class_val_subtotal . " and class <> " . $class_val_tax . " and class <> " . $class_val_shiphndl . " and class <> " . $class_val_loworder . " and class <> " . $class_val_total . " and month(o.date_purchased)= '" . $sales['i_month'] . "' and year(o.date_purchased)= '" . $sales['row_year'] . "'";
+  if ($sel_month<>0) $other_query_raw .= " and dayofmonth(o.date_purchased) = '" . $sales['row_day'] . "'";
+  $other_query = tep_db_query($other_query_raw);
+  if (tep_db_num_rows($other_query)>0)  
+  $other_this_row = tep_db_fetch_array($other_query);
+  };
+
+// Correct any rounding errors
+  $net_sales_this_row['net_sales'] = (floor(($net_sales_this_row['net_sales'] * 100) + 0.5)) / 100;
+  $net_sales_this_row['tax'] = (floor(($net_sales_this_row['tax'] * 100) + 0.5)) / 100;
+  $zero_rated_sales_this_row['net_sales'] = (floor(($zero_rated_sales_this_row['net_sales'] * 100) + 0.5)) / 100;
+  $tax_this_row['tax_coll'] = (floor(($tax_this_row['tax_coll'] * 100) + 0.5)) / 100;
+
+// accumulate row results in footer
+  $footer_gross += $sales['gross_sales']; // Gross Income
+  $footer_sales += $net_sales_this_row['net_sales'] + $zero_rated_sales_this_row['net_sales']; // Product Sales
+  $footer_sales_nontaxed += $zero_rated_sales_this_row['net_sales']; // Nontaxed Sales
+  $footer_sales_taxed += $net_sales_this_row['net_sales']; // Taxed Sales
+  $footer_tax_coll += $net_sales_this_row['tax']; // Taxes Collected
+  $footer_shiphndl += $shiphndl_this_row['shiphndl']; // Shipping & handling
+        $footer_shipping_tax += ($tax_this_row['tax_coll'] - $net_sales_this_row['tax']); // Shipping Tax
+  $footer_loworder += $loworder_this_row['loworder'];
+  if ($extra_class) $footer_other += $other_this_row['other'];
+?>
+<tr class="dataTableRow">
+<td class="dataTableContent" align="left">
+<?php  // live link to report monthly detail
+if ($sel_month == 0 && !$print) {
+  echo "<a href='" . $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'] . "&month=" . $sales['i_month'] . "&year=" . $sales['row_year'] . "' title='" . TEXT_BUTTON_REPORT_GET_DETAIL . "'>";
+  }
+mirror_out(substr($sales['row_month'],0,3)); 
+if ($sel_month == 0 && !$print) echo '</a>';
+?>
+</td>
+<td class="dataTableContent" align="left">
+<?php 
+if ($sel_month==0) mirror_out($sales['row_year']);
+else mirror_out($sales['row_day']);
+$last_row_year = $sales['row_year']; // save this row's year to check for annual footer
+?>
+</td>
+<td class="dataTableContent" width='70' align="right"><?php mirror_out(number_format($sales['gross_sales'],2)); ?></td>
+<td class="dataTableContent" width='70' align="right"><?php mirror_out(number_format($net_sales_this_row['net_sales'] + $zero_rated_sales_this_row['net_sales'],2)); ?></td>
+<td class="dataTableContent" width='70' align="right"><?php mirror_out(number_format($zero_rated_sales_this_row['net_sales'],2)); ?></td>
+<td class="dataTableContent" width='70' align="right"><?php mirror_out(number_format($net_sales_this_row['net_sales'],2)); ?></td>
+<td class="dataTableContent" width='70' align="right">
+<?php 
+  // make this a link to the detail popup if nonzero
+  if (!$print && ($net_sales_this_row['tax']>0)) {
+    echo "<a href=\"#\" onClick=\"window.open('" . $_SERVER['PHP_SELF'] . "?&show=ot_tax&year=" . $sales['row_year'] . "&month=" . $sales['i_month'];
+    if ($sel_month<>0) echo "&day=" . $sales['row_day'];
+    if ($status<>'') echo "&status=" . $status;
+    echo "','detail',config='height=200,width=400,scrollbars=1, resizable=1')\" title=\"Show detail\">";
+  };
+  mirror_out(number_format($net_sales_this_row['tax'],2)); 
+  if (!$print && $net_sales_this_row['tax']>0) echo "</a>";
+?></td>
+<td class="dataTableContent" width='70' align="right"><?php mirror_out(number_format($shiphndl_this_row['shiphndl'],2)); ?></td>
+<td class="dataTableContent" width='70' align="right"><?php $sh_tax = $tax_this_row['tax_coll'] - $net_sales_this_row['tax']; mirror_out(number_format(($sh_tax <= 0) ? 0 : $sh_tax,2)); ?></td>
+<?php if ($loworder) { ?>
+<td class="dataTableContent" width='70' align="right"><?php mirror_out(number_format($loworder_this_row['loworder'],2)); ?></td>
+<?php }; ?>
+<?php
+if ($extra_class) { ?>
+<td class="dataTableContent" width='70' align="right"><?php mirror_out(number_format($other_this_row['other'],2)); ?></td>
+<?php }; ?>
+</tr>
+<?php 
+// new line for CSV
+$csv_accum .= "\n";
+//
+//
+// output footer below ending row
+if ($rows==$num_rows){
+?>
+<tr class="dataTableHeadingRow">
+<td class="dataTableHeadingContent" align="left">
+<?php 
+  if ($sel_month<>0) 
+  mirror_out(strtoupper(substr($sales['row_month'],0,3)));
+  else
+  {if ($sales['row_year']==date("Y")) mirror_out(TABLE_FOOTER_YTD); 
+   else mirror_out(TABLE_FOOTER_YEAR);};
+?>
+</td>
+<td class="dataTableHeadingContent" align="left">
+<?php mirror_out($sales['row_year']); ?></td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_gross,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_sales,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_sales_nontaxed,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_sales_taxed,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_tax_coll,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_shiphndl,2)); ?>
+</td>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format(($footer_shipping_tax <= 0) ? 0 : $footer_shipping_tax,2)); ?>
+</td>
+<?php if ($loworder) { ?>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_loworder,2)); ?>
+</td>
+<?php }; ?>
+<?php if ($extra_class) { ?>
+<td class="dataTableHeadingContent" width='70' align="right">
+<?php mirror_out(number_format($footer_other,2)); ?>
+</td>
+<?php }; 
+// clear footer totals
+$footer_gross = 0;
+$footer_sales = 0;
+$footer_sales_nontaxed = 0;
+$footer_sales_taxed = 0;
+$footer_tax_coll = 0;
+$footer_shiphndl = 0;
+$footer_shipping_tax = 0;
+$footer_loworder = 0;
+$footer_other = 0;
+// new line for CSV
+$csv_accum .= "\n";
+?>
+</tr>
+<?php };
+  };
+// done with report body
+//
+// button for Save CSV
+if ($num_rows>0 && !$print) {
+?>
+<tr>
+        <td class="smallText" colspan="4"><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method=post><input type='hidden' name='csv' value='<?php echo $csv_accum; ?>'><input type='hidden' name='saveas' value='sales_report_<?php
+          //suggested file name for csv, include year and month if detail
+          //include status if selected, end with date and time of report
+        if ($sel_month<10) $sel_month_2 = "0" . $sel_month; 
+        else $sel_month_2 = $sel_month;
+        if ($sel_month<>0) echo $sel_year . $sel_month_2 . "_";
+        if (strpos($orders_status_text,' ')) echo substr($orders_status_text, 0, strpos($orders_status_text,' ')) . "_" . date("YmdHi"); else echo $orders_status_text . "_" . date("YmdHi"); 
+        ?>'><input type="submit" value="<?php echo TEXT_BUTTON_REPORT_SAVE ;?>"></form>
+        </td>
+</tr>
+<?php }; // end button for Save CSV ?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php  // suppress footer for printer-friendly version
+  if(!$print) require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+
+function mirror_out ($field) {
+  global $csv_accum;
+  echo $field;
+  $field = strip_tags($field);
+  $field = ereg_replace (",","",$field);
+  if ($csv_accum=='') $csv_accum=$field; 
+  else 
+  {if (strrpos($csv_accum,chr(10)) == (strlen($csv_accum)-1)) $csv_accum .= $field;
+    else $csv_accum .= "," . $field; };
+  return;
+};
+
+?>

Added: trunk/direct.openmoko.com/admin/stats_not_valid_users.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_not_valid_users.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_not_valid_users.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,127 @@
+<?php
+/*
+  $Id: stats_inactive_user.php,v 1.2 2004/05/02 15:00:00
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+  Created by John Wood - www.z-is.net
+  Modified by Steel Shadow - rebelstyle.com
+
+*/
+
+ require('includes/application_top.php');
+ ?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+        </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="4">
+          <tr>
+            <td valign="top" class="main">
+<?php
+$cust_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $_GET['id'] . "'");
+$cust = tep_db_fetch_array($cust_query);
+
+if ($_GET['go'] == ''){
+?>
+      <table border="0" width="100%" cellspacing="0" cellpadding="4">
+                    <tr class="dataTableHeadingRow">
+                      <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ID; ?></td>
+                      <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
+                      <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_EMAIL; ?></td>
+                      <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></td>
+                      <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LAST_LOGON; ?></td>
+                      <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_DELETE; ?></td>
+                    </tr>
+<?php
+  $siu_query_raw = "select * from " . TABLE_CUSTOMERS_INFO . " ci, " . TABLE_CUSTOMERS . " c where c.customers_id = ci.customers_info_id and c.customers_validation = '0' order by c.customers_id";
+  $siu_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $siu_query_raw, $siu_query_numrows );
+  $siu_query = tep_db_query($siu_query_raw);
+  while ($customers = tep_db_fetch_array($siu_query)) {
+
+ ?>
+      <tr class="dataTableRow"> 
+        <td class="dataTableContent"><?php echo $customers['customers_id'];?></td>
+        <td class="dataTableContent"><?php echo $customers['customers_firstname'] . ' ' . $customers['customers_lastname'];?></td>
+        <td class="dataTableContent"><?php echo '<a href="mailto:' . $customers['customers_email_address'] . '"><u>' . $customers['customers_email_address'] . '</u></a>' ; ?></td>
+        <td class="dataTableContent"><?php echo tep_date_short($customers['customers_info_date_account_created']); ?></td>
+        <td class="dataTableContent"><?php echo tep_date_short($customers['customers_info_date_of_last_logon']); ?></td>
+        <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_STATS_NOT_VALID_USER, 'go=delete&id=' . $customers['customers_id'] . '&page=' . $HTTP_GET_VARS['page']) .'">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'; ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+            } elseif ($_GET['go'] == 'delete')
+      {
+              echo '<br>' . sprintf(SURE_TO_DELETE, $cust[customers_firstname] . ' ' . $cust[customers_lastname]) . '<br><br><a href="' . tep_href_link(FILENAME_STATS_NOT_VALID_USER,  'page=' . $HTTP_GET_VARS['page'] . '&go=deleteyes&id=' . $_GET['id']) . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_STATS_NOT_VALID_USER, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a><br><br>';
+            } elseif ($_GET['go'] == 'deleteyes'){
+      tep_db_query("DELETE FROM " . TABLE_CUSTOMERS . " where customers_id = '" . $_GET['id'] . "'");
+      tep_db_query("DELETE FROM " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $_GET['id'] . "'");
+      tep_db_query("DELETE FROM " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $_GET['id'] . "'");
+      tep_db_query("DELETE FROM " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $_GET['id'] . "'");
+      tep_db_query("DELETE FROM " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $_GET['id'] . "'");
+      tep_db_query("DELETE FROM " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . $_GET['id'] . "'");
+      echo '<br>' . sprintf(SIU_CUSTOMER_DELETED, $cust[customers_firstname] . ' ' . $cust[customers_lastname]) . '<br><br><br><a href="' . tep_href_link(FILENAME_STATS_NOT_VALID_USER, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a><br><br>';
+    }
+        
+?>
+       </table></td>
+      </tr>
+    
+  <?php if ($_GET['go'] == ''){?>   
+      <tr>
+        <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText" valign="top"><?php echo $siu_split->display_count($siu_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
+            <td class="smallText" align="right"><?php echo $siu_split->display_links($siu_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
+          </tr>
+       </table></td>
+     </tr>
+  <?php }?> 
+  
+    </table></td>
+ </tr>
+</table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/stats_products_notifications.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_products_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_products_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,212 @@
+<?php
+/*
+  Id: stats_products_notifications.php,v 1.1 2003/05/16 00:10:05 ft01189 Exp 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Contribution by Radu Manole, radu_manole at hotmail.com
+  
+  
+  Added to CRE Loaded 6.2
+  
+  Last Modified Date : $Date$
+  Last Modified By : $Author$
+   
+*/
+
+  require('includes/application_top.php');
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top">    
+
+<?php
+// show customers for a product
+if ($_GET['action'] == 'show_customers' && (int)$_GET['pID']) {
+  $products_id = (int)$_GET['pID'];
+?>
+
+    <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+  <tr>
+          <td class="dataTableContent"><?php echo TEXT_DESCRIPTION_TO; ?><b>"<?php echo tep_get_products_name($products_id); ?>"</b>.</td>
+        </tr>
+        <tr>
+          <td>&nbsp;</td>
+        </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NAME; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_EMAIL; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_DATE; ?></td>
+              </tr>
+<?php
+  if ($HTTP_GET_VARS['cpage'] > 1) $rows = $HTTP_GET_VARS['cpage'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
+
+    $customers_query_raw = "select c.customers_firstname, c.customers_lastname, c.customers_email_address, pn.date_added
+                            from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn 
+                            where c.customers_id = pn.customers_id and pn.products_id = '" . $products_id . "' 
+                            order by c.customers_firstname, c.customers_lastname";
+
+    $customers_split = new splitPageResults($HTTP_GET_VARS['cpage'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);
+    $customers_query = tep_db_query($customers_query_raw);
+  
+    while ($customers = tep_db_fetch_array($customers_query)) {
+      $rows++;
+
+      if (strlen($rows) < 2) {
+        $rows = '0' . $rows;
+      }
+?>
+              <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
+                <td width="30" nowrap class="dataTableContent"><?php echo $rows; ?>.</td>
+                <td class="dataTableContent"><?php echo $customers['customers_firstname'] . ' ' . $customers['customers_lastname']; ?></td>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_MAIL, 'selected_box=tools&customer=' . $customers['customers_email_address'], 'NONSSL') . '">' . $customers['customers_email_address'] . '</a>'; ?>&nbsp;</td>
+                <td class="dataTableContent"><?php echo $customers['date_added']; ?>&nbsp;</td>
+              </tr>
+<?php
+    }
+?>
+            </table></td>
+          </tr>
+          <tr>
+            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['cpage'], 'Displaying <b>%s</b> to <b>%s</b> (of <b>%s</b> customers)' , '', 'cpage'); ?></td>
+                <td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['cpage'], tep_get_all_get_params(array('cpage')), 'cpage'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+      <table width="100%" border="0" cellspacing="0" cellpadding="0">
+        <tr>
+          <td height="5"></td>
+        </tr>
+        <tr> 
+          <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_STATS_PRODUCTS_NOTIFICATIONS, tep_get_all_get_params(array('action', 'pID', 'cpage'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
+        </tr>
+      </table>
+<?php
+// default
+} else {
+
+?>
+      <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td class="dataTableContent"><?php echo TEXT_DESCRIPTION; ?></td>
+      </tr>
+      <tr>
+        <td>&nbsp;</td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_COUNT; ?>&nbsp;</td>
+              </tr>
+<?php
+  if ($HTTP_GET_VARS['page'] > 1) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
+
+    $products_notifications_query_raw = "select count(pn.products_id) as count_notifications, pn.products_id, pd.products_name 
+                                   from " . TABLE_PRODUCTS_NOTIFICATIONS . " pn, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CUSTOMERS . " c
+                                         where pn.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' 
+                                         and pn.customers_id = c.customers_id 
+                                         group by pn.products_id order by count_notifications desc";
+    // fix numrows
+    $products_count_query = tep_db_query($products_notifications_query_raw);
+
+    $products_notifications_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_notifications_query_raw,     $products_notifications_query_numrows);     
+    $products_notifications_query = tep_db_query($products_notifications_query_raw);
+    $products_notifications_query_numrows = tep_db_num_rows($products_count_query);
+  
+    while ($products = tep_db_fetch_array($products_notifications_query)) {
+      $rows++;
+
+      if (strlen($rows) < 2) {
+        $rows = '0' . $rows;
+      }
+?>
+              <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'" onclick="document.location.href='<?php echo tep_href_link(FILENAME_STATS_PRODUCTS_NOTIFICATIONS, 'action=show_customers&pID=' . $products['products_id'] . '&page=' . $page, 'NONSSL'); ?>'">
+                <td width="30" nowrap class="dataTableContent"><?php echo $rows; ?>.</td>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_STATS_PRODUCTS_NOTIFICATIONS, 'action=show_customers&pID=' . $products['products_id'] . '&page=' . $page, 'NONSSL') . '">' . $products['products_name'] . '</a>'; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $products['count_notifications']; ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+          </tr>
+          <tr>
+            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php echo $products_notifications_split->display_count($products_notifications_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+                <td class="smallText" align="right"><?php echo $products_notifications_split->display_links($products_notifications_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+<?php
+} // end else
+?>
+    </td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/stats_products_purchased.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_products_purchased.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_products_purchased.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,101 @@
+<?php
+/*
+  $Id: stats_products_purchased.php,v 1.1.1.1 2004/03/04 23:38:59 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+        </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PURCHASED; ?>&nbsp;</td>
+              </tr>
+<?php
+  if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
+  $products_query_raw = "select p.products_id, p.products_ordered, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id. "' and p.products_ordered > 0 group by pd.products_id order by p.products_ordered DESC, pd.products_name";
+  $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);
+
+  $rows = 0;
+  $products_query = tep_db_query($products_query_raw);
+  while ($products = tep_db_fetch_array($products_query)) {
+    $rows++;
+
+    if (strlen($rows) < 2) {
+      $rows = '0' . $rows;
+    }
+?>
+              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $products['products_id'] . '&origin=' . FILENAME_STATS_PRODUCTS_PURCHASED . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL'); ?>'">
+                <td class="dataTableContent"><?php echo $rows; ?>.</td>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $products['products_id'] . '&origin=' . FILENAME_STATS_PRODUCTS_PURCHASED . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL') . '">' . $products['products_name'] . '</a>'; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $products['products_ordered']; ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+          </tr>
+          <tr>
+            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+                <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>&nbsp;</td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/stats_products_viewed.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_products_viewed.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_products_viewed.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<?php
+/*
+  $Id: stats_products_viewed.php,v 1.1.1.1 2004/03/04 23:38:59 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VIEWED; ?>&nbsp;</td>
+              </tr>
+<?php
+  if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
+  $rows = 0;
+  $products_query_raw = "select p.products_id, pd.products_name, pd.products_viewed, l.name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_LANGUAGES . " l where p.products_id = pd.products_id and l.languages_id = pd.language_id order by pd.products_viewed DESC";
+  $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);
+  $products_query = tep_db_query($products_query_raw);
+  while ($products = tep_db_fetch_array($products_query)) {
+    $rows++;
+
+    if (strlen($rows) < 2) {
+      $rows = '0' . $rows;
+    }
+?>
+              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $products['products_id'] . '&origin=' . FILENAME_STATS_PRODUCTS_VIEWED . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL'); ?>'">
+                <td class="dataTableContent"><?php echo $rows; ?>.</td>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $products['products_id'] . '&origin=' . FILENAME_STATS_PRODUCTS_VIEWED . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL') . '">' . $products['products_name'] . '</a> (' . $products['name'] . ')'; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $products['products_viewed']; ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+          </tr>
+          <tr>
+            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+                <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/stats_sales_report2.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_sales_report2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_sales_report2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,563 @@
+<?php
+/*
+  $Id: stats_sales_report2.php,v 1.00 2003/03/08 19:02:22 Exp $
+
+  Charly Wilhelm  charly at yoshi.ch
+  
+  Released under the GNU General Public License
+
+  Copyright (c) 2003 osCommerce
+  
+  possible views (srView):
+  1 yearly
+  2 monthly
+  3 weekly
+  4 daily
+  
+  possible options (srDetail):
+  0 no detail
+  1 show details (products)
+  2 show details only (products)
+  
+  export
+  0 normal view
+  1 html view without left and right
+  2 csv
+  
+  sort
+  0 no sorting
+  1 product description asc
+  2 product description desc
+  3 #product asc, product descr asc
+  4 #product desc, product descr desc
+  5 revenue asc, product descr asc
+  6 revenue desc, product descr desc
+  
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  // default detail no detail
+  $srDefaultDetail = 0;
+  // default view (daily)
+  $srDefaultView = 2;
+  // default export
+  $srDefaultExp = 0;
+  // default sort
+  $srDefaultSort = 4;
+  
+  // report views (1: yearly 2: monthly 3: weekly 4: daily)
+  if ( ($HTTP_GET_VARS['report']) && (tep_not_null($HTTP_GET_VARS['report'])) ) 
+{    $srView = $HTTP_GET_VARS['report'];
+  }
+  if ($srView < 1 || $srView > 4) {
+    $srView = $srDefaultView;
+  }
+
+  // detail
+  if ( ($HTTP_GET_VARS['detail']) && (tep_not_null($HTTP_GET_VARS['detail'])) ) 
+{    $srDetail = $HTTP_GET_VARS['detail'];
+  }
+  if ($srDetail < 0 || $srDetail > 2) {
+    $srDetail = $srDefaultDetail;
+  }
+  
+  // report views (1: yearly 2: monthly 3: weekly 4: daily)
+  if ( ($HTTP_GET_VARS['export']) && (tep_not_null($HTTP_GET_VARS['export'])) ) 
+{    $srExp = $HTTP_GET_VARS['export'];
+  }
+  if ($srExp < 0 || $srExp > 2) {
+    $srExp = $srDefaultExp;
+  }
+  
+  // item_level
+  if ( ($HTTP_GET_VARS['max']) && (tep_not_null($HTTP_GET_VARS['max'])) ) {
+    $srMax = $HTTP_GET_VARS['max'];
+  }
+  if (!is_numeric($srMax)) {
+    $srMax = 0;
+  }
+      
+  // order status
+  if ( ($HTTP_GET_VARS['status']) && (tep_not_null($HTTP_GET_VARS['status'])) ) 
+{    $srStatus = $HTTP_GET_VARS['status'];
+  }
+  if (!is_numeric($srStatus)) {
+    $srStatus = 0;
+  }
+  
+  // sort
+  if ( ($HTTP_GET_VARS['sort']) && (tep_not_null($HTTP_GET_VARS['sort'])) ) {
+    $srSort = $HTTP_GET_VARS['sort'];
+  }
+  if ($srSort < 1 || $srSort > 6) {
+    $srSort = $srDefaultSort;
+  }
+    
+  // check start and end Date
+  $startDate = "";
+  $startDateG = 0;
+  if ( ($HTTP_GET_VARS['startD']) && (tep_not_null($HTTP_GET_VARS['startD'])) ) 
+{    $sDay = $HTTP_GET_VARS['startD'];
+    $startDateG = 1;
+  } else {
+    $sDay = 1;
+  }
+  if ( ($HTTP_GET_VARS['startM']) && (tep_not_null($HTTP_GET_VARS['startM'])) ) 
+{    $sMon = $HTTP_GET_VARS['startM'];
+    $startDateG = 1;
+  } else {
+    $sMon = 1;
+  }
+  if ( ($HTTP_GET_VARS['startY']) && (tep_not_null($HTTP_GET_VARS['startY'])) ) 
+{    $sYear = $HTTP_GET_VARS['startY'];
+    $startDateG = 1;
+  } else {
+    $sYear = date("Y");
+  }
+  if ($startDateG) {
+    $startDate = mktime(0, 0, 0, $sMon, $sDay, $sYear);
+  } else {
+    $startDate = mktime(0, 0, 0, date("m"), 1, date("Y"));
+  }
+    
+  $endDate = "";
+  $endDateG = 0;
+  if ( ($HTTP_GET_VARS['endD']) && (tep_not_null($HTTP_GET_VARS['endD'])) ) {
+    $eDay = $HTTP_GET_VARS['endD'];
+    $endDateG = 1;
+  } else {
+    $eDay = 1;
+  }
+  if ( ($HTTP_GET_VARS['endM']) && (tep_not_null($HTTP_GET_VARS['endM'])) ) {
+    $eMon = $HTTP_GET_VARS['endM'];
+    $endDateG = 1;
+  } else {
+    $eMon = 1;
+  }
+  if ( ($HTTP_GET_VARS['endY']) && (tep_not_null($HTTP_GET_VARS['endY'])) ) {
+    $eYear = $HTTP_GET_VARS['endY'];
+    $endDateG = 1;
+  } else {
+    $eYear = date("Y");
+  }
+  if ($endDateG) {
+    $endDate = mktime(0, 0, 0, $eMon, $eDay + 1, $eYear);
+  } else {
+    $endDate = mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"));
+  }
+  
+  require(DIR_WS_CLASSES . 'sales_report2.php');
+  $sr = new sales_report($srView, $startDate, $endDate, $srSort, $srStatus, 
+$srFilter);  $startDate = $sr->startDate;
+  $endDate = $sr->endDate;  
+  
+  if ($srExp < 2) {
+    // not for csv export
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo 
+CHARSET; ?>">  <title><?php echo TITLE; ?></title>
+  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"><!-- header //-->
+<?php
+    if ($srExp < 1) {
+      require(DIR_WS_INCLUDES . 'header.php');
+    }
+?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+<?php
+    if ($srExp < 1) {
+?>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top">
+      <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1"
+cellpadding="1" class="columnLeft">      <!-- left_navigation //-->
+<?php
+      require(DIR_WS_INCLUDES . 'column_left.php');
+?>
+      <!-- left_navigation_eof //-->
+      </table>
+    </td>
+<!-- body_text //-->
+<?php
+    } // end sr_exp
+?>
+    <td width="100%" valign="top">
+      <table border="0" width="100%" cellspacing="0" cellpadding="2">
+        <tr>
+          <td colspan=2>
+            <table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+                <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+<?php
+    if ($srExp < 1) {
+?>
+        <tr>
+          <td colspan="2">
+            <form action="" method="get">
+            <?php
+              if (isset($HTTP_GET_VARS[tep_session_name()])) {
+                echo tep_draw_hidden_field(tep_session_name(), $HTTP_GET_VARS[tep_session_name()]);
+              }
+            ?>
+              <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td align="left" rowspan="2" class="menuBoxHeading">
+                    <input type="radio" name="report" value="1" <?php if ($srView == 1) echo "checked"; ?>><?php echo REPORT_TYPE_YEARLY; ?><br>
+                    <input type="radio" name="report" value="2" <?php if ($srView == 2) echo "checked"; ?>><?php echo REPORT_TYPE_MONTHLY; ?><br>
+                    <input type="radio" name="report" value="3" <?php if ($srView == 3) echo "checked"; ?>><?php echo REPORT_TYPE_WEEKLY; ?><br>
+                    <input type="radio" name="report" value="4" <?php if ($srView == 4) echo "checked"; ?>><?php echo REPORT_TYPE_DAILY; ?><br>
+                  </td>
+                  <td class="menuBoxHeading">
+<?php echo REPORT_START_DATE; ?><br>
+                    <select name="startD" size="1">
+<?php
+      if ($startDate) {
+        $j = date("j", $startDate);
+      } else {
+        $j = 1;
+      }
+      for ($i = 1; $i < 32; $i++) {
+?>
+                        <option<?php if ($j == $i) echo " selected"; ?>><?php echo $i; ?></option>
+<?php
+      }
+?>
+                    </select>
+                    <select name="startM" size="1">
+<?php
+      if ($startDate) {
+        $m = date("n", $startDate);
+      } else {
+        $m = 1;
+      }
+      for ($i = 1; $i < 13; $i++) {
+?>
+                      <option<?php if ($m == $i) echo " selected"; ?> value="<?php echo $i; ?>"><?php echo strftime("%B", mktime(0, 0, 0, $i, 1)); ?></option>
+<?php
+      }
+?>
+                    </select>
+                    <select name="startY" size="1">
+<?php
+      if ($startDate) {
+        $y = date("Y") - date("Y", $startDate);
+      } else {
+        $y = 0;
+      }
+      for ($i = 10; $i >= 0; $i--) {
+?>
+                      <option<?php if ($y == $i) echo " selected"; ?>><?php echo date("Y") - $i; ?></option>
+<?php
+    }
+?>
+                    </select>
+                  </td>
+                  <td rowspan="2" align="left" class="menuBoxHeading">
+                    <?php echo REPORT_DETAIL; ?><br>
+                    <select name="detail" size="1">
+                      <option value="0"<?php if ($srDetail == 0) echo "selected"; ?>><?php echo DET_HEAD_ONLY; ?></option>
+                      <option value="1"<?php if ($srDetail == 1) echo " selected"; ?>><?php echo DET_DETAIL; ?></option>
+                      <option value="2"<?php if ($srDetail == 2) echo " selected"; ?>><?php echo DET_DETAIL_ONLY; ?></option>
+                    </select><br>
+<?php echo REPORT_MAX; ?><br>
+                    <select name="max" size="1">
+                      <option value="0"><?php echo REPORT_ALL; ?></option>
+                      <option<?php if ($srMax == 1) echo " selected"; ?>>1</option>
+                      <option<?php if ($srMax == 3) echo " selected"; ?>>3</option>
+                      <option<?php if ($srMax == 5) echo " selected"; ?>>5</option>
+                      <option<?php if ($srMax == 10) echo " selected"; ?>>10</option>
+                      <option<?php if ($srMax == 25) echo " selected"; ?>>25</option>
+                      <option<?php if ($srMax == 50) echo " selected"; ?>>50</option>
+                    </select>
+                  </td>
+                  <td rowspan="2" align="left" class="menuBoxHeading">
+                    <?php echo REPORT_STATUS_FILTER; ?><br>
+                    <select name="status" size="1">
+                      <option value="0"><?php echo REPORT_ALL; ?></option>
+<?php
+                        foreach ($sr->status as $value) {
+?>
+                      <option value="<?php echo $value["orders_status_id"]?>"<?php if ($srStatus == $value["orders_status_id"]) echo " selected"; ?>><?php echo $value["orders_status_name"] ; ?></option>
+<?php
+                         }
+?>
+                    </select><br>
+                  </td>
+                  <td rowspan="2" align="left" class="menuBoxHeading">
+                    <?php echo REPORT_EXP; ?><br>
+                    <select name="export" size="1">
+                      <option value="0" selected><?php echo EXP_NORMAL; ?></option>
+                      <option value="1"><?php echo EXP_HTML; ?></option>
+                      <option value="2"><?php echo EXP_CSV; ?></option>
+                    </select><br>
+                    <?php echo REPORT_SORT; ?><br>
+                    <select name="sort" size="1">
+                      <option value="0"<?php if ($srSort == 0) echo " selected"; ?>><?php echo SORT_VAL0; ?></option>
+                      <option value="1"<?php if ($srSort == 1) echo " selected"; ?>><?php echo SORT_VAL1; ?></option>
+                      <option value="2"<?php if ($srSort == 2) echo " selected"; ?>><?php echo SORT_VAL2; ?></option>
+                      <option value="3"<?php if ($srSort == 3) echo " selected"; ?>><?php echo SORT_VAL3; ?></option>
+                      <option value="4"<?php if ($srSort == 4) echo " selected"; ?>><?php echo SORT_VAL4; ?></option>
+                      <option value="5"<?php if ($srSort == 5) echo " selected"; ?>><?php echo SORT_VAL5; ?></option>
+                      <option value="6"<?php if ($srSort == 6) echo " selected"; ?>><?php echo SORT_VAL6; ?></option>
+                    </select><br>
+                  </td>
+                </tr>
+                <tr>
+                  <td class="menuBoxHeading">
+<?php echo REPORT_END_DATE; ?><br>
+                    <select name="endD" size="1">
+<?php
+    if ($endDate) {
+      $j = date("j", $endDate - 60* 60 * 24);
+    } else {
+      $j = date("j");
+    }
+    for ($i = 1; $i < 32; $i++) {
+?>
+                      <option<?php if ($j == $i) echo " selected"; ?>><?php echo $i; ?></option>
+<?php
+    }
+?>
+                    </select>
+                    <select name="endM" size="1">
+<?php
+    if ($endDate) {
+      $m = date("n", $endDate - 60* 60 * 24);
+    } else {
+      $m = date("n");
+    }
+    for ($i = 1; $i < 13; $i++) {
+?>
+                      <option<?php if ($m == $i) echo " selected"; ?> value="<?php echo $i; ?>"><?php echo strftime("%B", mktime(0, 0, 0, $i, 1)); ?></option>
+<?php
+    }
+?>
+                    </select>
+                    <select name="endY" size="1">
+<?php
+    if ($endDate) {
+      $y = date("Y") - date("Y", $endDate - 60* 60 * 24);
+    } else {
+      $y = 0;
+    }
+    for ($i = 10; $i >= 0; $i--) {
+?>
+                      <option<?php if ($y == $i) echo " selected"; ?>><?php echo
+date("Y") - $i; ?></option><?php
+    }
+?>
+                    </select>
+                  </td>
+                </tr>
+                <tr>
+                  <td colspan="5" class="menuBoxHeading" align="right">
+                    <input type="submit" value="<?php echo REPORT_SEND; ?>">
+                  </td>
+              </table>
+            </form>
+          </td>
+        </tr>
+<?php
+  } // end of ($srExp < 1)
+?>
+        <tr>
+          <td width=100% valign=top>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td valign="top">
+                  <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                    <tr class="dataTableHeadingRow">
+                      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE; ?></td>
+                      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDERS;?></td>
+                      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ITEMS; ?></td>
+                      <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_REVENUE;?></td>
+                      <td class="dataTableHeadingContent" align="right"><?php echo  TABLE_HEADING_SHIPPING;?></td>
+                    </tr>
+<?php
+} // end of if $srExp < 2 csv export
+$sum = 0;
+while ($sr->actDate < $sr->endDate) {
+  $info = $sr->getNext();
+  $last = sizeof($info) - 1;
+  if ($srExp < 2) {
+?>
+                    <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
+<?php
+    switch ($srView) {
+      case '3':
+?>
+                      <td class="dataTableContent" align="right"><?php echo tep_date_long(date("Y-m-d\ H:i:s", $sr->showDate)) . " - " . tep_date_short(date("Y-m-d\ H:i:s", $sr->showDateEnd)); ?></td>
+<?php
+        break;
+      case '4':
+?>
+                      <td class="dataTableContent" align="right"><?php echo tep_date_long(date("Y-m-d\ H:i:s", $sr->showDate)); ?></td>
+<?php
+        break;
+      default;
+?>
+                      <td class="dataTableContent" align="right"><?php echo tep_date_short(date("Y-m-d\ H:i:s", $sr->showDate)) . " - " . tep_date_short(date("Y-m-d\ H:i:s", $sr->showDateEnd)); ?></td>
+<?php
+    }
+?>
+                      <td class="dataTableContent" align="right"><?php echo $info[0]['order']; ?></td>
+                      <td class="dataTableContent" align="right"><?php echo $info[$last - 1]['totitem']; ?></td>
+                      <td class="dataTableContent" align="right"><?php echo $currencies->format($info[$last - 1]['totsum']);?></td>
+                      <td class="dataTableContent" align="right"><?php echo $currencies->format($info[0]['shipping']);?></td>
+                    </tr>
+<?php
+  } else {
+    // csv export
+    echo date(DATE_FORMAT, $sr->showDate) . SR_SEPARATOR1 . date(DATE_FORMAT, $sr->showDateEnd) . SR_SEPARATOR1;
+    echo $info[0]['order'] . SR_SEPARATOR1;
+    echo $info[$last - 1]['totitem'] . SR_SEPARATOR1;
+    echo $currencies->format($info[$last - 1]['totsum']) . SR_SEPARATOR1;
+    echo $currencies->format($info[0]['shipping']) . SR_NEWLINE;
+  }
+  if ($srDetail) {
+    for ($i = 0; $i < $last; $i++) {
+      if ($srMax == 0 or $i < $srMax) {
+        if ($srExp < 2) {
+?>
+                    <tr class="dataTableRow" onmouseover="this.className='dataTableRowOver';this.style.cursor='hand'" onmouseout="this.className='dataTableRow'">
+                    <td class="dataTableContent">&nbsp;</td>
+                    <td class="dataTableContent" align="left"><a href="<?php echo tep_catalog_href_link("product_info.php?products_id=" . $info[$i]['pid']) ?>" target="_blank"><?php echo $info[$i]['pname']; ?></a>
+<?php
+  if (is_array($info[$i]['attr'])) {
+    $attr_info = $info[$i]['attr'];
+    foreach ($attr_info as $attr) {
+      echo '<div style="font-style:italic;">&nbsp;' . $attr['quant'] . 'x ' ;
+      //  $attr['options'] . ': '
+      $flag = 0;
+      foreach ($attr['options_values'] as $value) {
+        if ($flag > 0) {
+          echo "," . $value;
+        } else {
+          echo $value;
+          $flag = 1;
+        }
+      }
+      $price = 0;
+      foreach ($attr['price'] as $value) {
+        $price += $value;
+      }
+      if ($price != 0) {
+        echo ' (';
+        if ($price > 0) {
+          echo "+";
+        }
+        echo $currencies->format($price). ')';
+      }
+      echo '</div>';
+    }
+  }
+?>                    </td>
+                    <td class="dataTableContent" align="right"><?php echo $info[$i]['pquant']; ?></td>
+<?php
+          if ($srDetail == 2) {?>
+                    <td class="dataTableContent" align="right"><?php echo $currencies->format($info[$i]['psum']); ?></td>
+<?php
+          } else { ?>
+                    <td class="dataTableContent">&nbsp;</td>
+<?php
+          }
+?>
+                    <td class="dataTableContent">&nbsp;</td>
+                  </tr>
+<?php
+        } else {
+        // csv export
+          if (is_array($info[$i]['attr'])) {
+            $attr_info = $info[$i]['attr'];
+            foreach ($attr_info as $attr) {
+              echo $info[$i]['pname'] . "(";
+              $flag = 0;
+              foreach ($attr['options_values'] as $value) {
+                if ($flag > 0) {
+                  echo ", " . $value;
+                } else {
+                  echo $value;
+                  $flag = 1;
+                }
+              }
+              $price = 0;
+              foreach ($attr['price'] as $value) {
+                $price += $value;
+              }
+              if ($price != 0) {
+                echo ' (';
+                if ($price > 0) {
+                  echo "+";
+                } else {
+                  echo " ";
+                }
+                echo $currencies->format($price). ')';
+              }
+              echo ")" . SR_SEPARATOR2;
+              if ($srDetail == 2) {
+                echo $attr['quant'] . SR_SEPARATOR2;
+                echo $currencies->format( $attr['quant'] * ($info[$i]['price'] + $price)) . SR_NEWLINE;
+              } else {
+                echo $attr['quant'] . SR_NEWLINE;
+              }
+              $info[$i]['pquant'] = $info[$i]['pquant'] - $attr['quant'];
+            }
+          }
+          if ($info[$i]['pquant'] > 0) {
+            echo $info[$i]['pname'] . SR_SEPARATOR2;
+            if ($srDetail == 2) {
+              echo $info[$i]['pquant'] . SR_SEPARATOR2;
+              echo $currencies->format($info[$i]['pquant'] * $info[$i]['price']) . SR_NEWLINE;
+            } else {
+              echo $info[$i]['pquant'] . SR_NEWLINE;
+            }
+          }
+        }
+      }
+    }
+  }
+}
+if ($srExp < 2) {
+?>
+                  </table>
+                </td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+      </table>
+    </td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+  if ($srExp < 1) {
+    require(DIR_WS_INCLUDES . 'footer.php');
+  }
+?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+} // end if $srExp < 2
+?>

Added: trunk/direct.openmoko.com/admin/stats_wishlist.php
===================================================================
--- trunk/direct.openmoko.com/admin/stats_wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/stats_wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,175 @@
+<?php
+/*=======================================================================*\
+|| #################### //-- SCRIPT INFO --// ########################### ||
+|| #  Script name: stats_wishlist.php                                 # ||
+|| #  Contribution: Simple Wishlist Report                            # ||
+|| #  Version: 1.0                                                    # ||
+|| #  Date: April 16 2005                                             # ||
+|| # ------------------------------------------------------------------ # ||
+|| #################### //-- COPYRIGHT INFO --// ######################## ||
+|| #  Copyright (C) 2005 Chris LaRocque               # ||
+|| #                                  # ||
+|| #  This script is free software; you can redistribute it and/or  # ||
+|| #  modify it under the terms of the GNU General Public License   # ||
+|| #  as published by the Free Software Foundation; either version 2  # ||
+|| #  of the License, or (at your option) any later version.      # ||
+|| #                                  # ||
+|| #  This script is distributed in the hope that it will be useful,  # ||
+|| #  but WITHOUT ANY WARRANTY; without even the implied warranty of  # ||
+|| #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the # ||
+|| #  GNU General Public License for more details.          # ||
+|| #                                  # ||
+|| #  Script is intended to be used with:               # ||
+|| #  osCommerce, Open Source E-Commerce Solutions          # ||
+|| #  http://www.oscommerce.com                   # ||
+|| #  Copyright (c) 2003 osCommerce                 # ||
+|| ###################################################################### ||
+\*========================================================================*/
+  require('includes/application_top.php');
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+        </table></td>
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo 'Wishlist Report'; ?></td>
+            <td class="pageHeading" align="right">
+      <?php
+      # Get specific list data
+      if (isset($HTTP_GET_VARS['cid'])) { 
+      $customers_query_raw = tep_db_query("select customers_firstname, customers_lastname from " .
+      TABLE_CUSTOMERS . " where customers_id = '".$HTTP_GET_VARS['cid']."'");
+      $customers = tep_db_fetch_array($customers_query_raw);
+      # name
+      echo $customers['customers_firstname'] . ' ' . $customers['customers_lastname'];
+      }else{
+      echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT);
+      } ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    <?php 
+    if (isset($HTTP_GET_VARS['cid'])) {
+    // Display wishlist data ;
+    ?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+    
+    <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo 'Product'; ?></td>
+                <td class="dataTableHeadingContent"><?php echo 'Model'; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo 'Price'; ?>&nbsp;</td>
+              </tr>
+<?php
+     // show the contents
+     $products_query_raw2 = tep_db_query("select * from customers_wishlist where customers_id = '". $HTTP_GET_VARS['cid']."'");
+     while($products2 = tep_db_fetch_array($products_query_raw2)) { 
+    // print_r($products2);
+             $product_query_raw1 = tep_db_query("select p.products_id, p.products_model, p.products_price, pd.products_name, pd.language_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $products2['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
+                while($products1 = tep_db_fetch_array($product_query_raw1)) { 
+            $products_name = $products1['products_name'] ;
+            $products_model = $products1['products_model'] ;
+            $products_price = $products1['products_price'] ;
+             
+
+?>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo $products_name; ?></td>
+                <td class="dataTableContent"><?php echo $products_model; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $currencies->format($products_price); ?>&nbsp;</td>
+              </tr>
+<?php // #eof while
+            }  
+  }
+?>
+            </table></td>
+          </tr>
+    <?php //show the list of wishlist owners
+    }else{ 
+    ;?>
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent">&nbsp;</td>
+                <td class="dataTableHeadingContent"><?php echo 'Customer'; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo 'Products in List'; ?>&nbsp;</td>
+              </tr>
+         <?php
+       # Get list of owners
+       if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) 
+       $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
+       $customers_query_raw = "select c.customers_firstname, c.customers_lastname, cw.customers_id, 
+       count(cw.products_id) as prodcount from " . TABLE_CUSTOMERS . " c, customers_wishlist cw WHERE
+       cw.customers_id = c.customers_id group by c.customers_firstname, c.customers_lastname order by
+       prodcount DESC";
+       $customers_query = tep_db_query($customers_query_raw);
+       
+       $customers_query_numrows = tep_db_num_rows($customers_query);
+       $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);
+       
+       
+       $rows = 0;
+       
+       while ($customers = tep_db_fetch_array($customers_query)) {
+       $rows++;
+       
+       if (strlen($rows) < 2) {
+       $rows = '0' . $rows;
+       }
+       ?>
+              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link('stats_wishlist.php', 'cid=' . $customers['customers_id'], 'NONSSL'); ?>'">
+                <td class="dataTableContent"><?php echo $rows; ?></td>
+                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link('stats_wishlist.php', 'cid=' . $customers['customers_id'], 'NONSSL') . '">' . $customers['customers_firstname'] . ' ' . $customers['customers_lastname'] . '</a>'; ?></td>
+                <td class="dataTableContent" align="right"><?php echo $customers['prodcount']; ?>&nbsp;</td>
+              </tr>
+       <?php
+           } # eof while
+       } # eof if/else list or contents
+       ?>
+            </table></td>
+          </tr>
+      <tr>
+            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText" valign="top"><?php if (!isset($HTTP_GET_VARS['cid'])) echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
+                <td class="smallText" align="right"><?php  if (!isset($HTTP_GET_VARS['cid'])) echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>&nbsp;</td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+
+  </tr>
+</table>
+<!-- body_eof //-->
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/tax_classes.php
===================================================================
--- trunk/direct.openmoko.com/admin/tax_classes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/tax_classes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,191 @@
+<?php
+/*
+  $Id: tax_classes.php,v 1.1.1.1 2004/03/04 23:39:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+        $tax_class_title = tep_db_prepare_input($HTTP_POST_VARS['tax_class_title']);
+        $tax_class_description = tep_db_prepare_input($HTTP_POST_VARS['tax_class_description']);
+
+        tep_db_query("insert into " . TABLE_TAX_CLASS . " (tax_class_title, tax_class_description, date_added) values ('" . tep_db_input($tax_class_title) . "', '" . tep_db_input($tax_class_description) . "', now())");
+
+        tep_redirect(tep_href_link(FILENAME_TAX_CLASSES));
+        break;
+      case 'save':
+        $tax_class_id = tep_db_prepare_input($HTTP_GET_VARS['tID']);
+        $tax_class_title = tep_db_prepare_input($HTTP_POST_VARS['tax_class_title']);
+        $tax_class_description = tep_db_prepare_input($HTTP_POST_VARS['tax_class_description']);
+
+        tep_db_query("update " . TABLE_TAX_CLASS . " set tax_class_id = '" . (int)$tax_class_id . "', tax_class_title = '" . tep_db_input($tax_class_title) . "', tax_class_description = '" . tep_db_input($tax_class_description) . "', last_modified = now() where tax_class_id = '" . (int)$tax_class_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tax_class_id));
+        break;
+      case 'deleteconfirm':
+        $tax_class_id = tep_db_prepare_input($HTTP_GET_VARS['tID']);
+
+        tep_db_query("delete from " . TABLE_TAX_CLASS . " where tax_class_id = '" . (int)$tax_class_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_CLASSES; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $classes_query_raw = "select tax_class_id, tax_class_title, tax_class_description, last_modified, date_added from " . TABLE_TAX_CLASS . " order by tax_class_title";
+  $classes_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $classes_query_raw, $classes_query_numrows);
+  $classes_query = tep_db_query($classes_query_raw);
+  while ($classes = tep_db_fetch_array($classes_query)) {
+    if ((!isset($HTTP_GET_VARS['tID']) || (isset($HTTP_GET_VARS['tID']) && ($HTTP_GET_VARS['tID'] == $classes['tax_class_id']))) && !isset($tcInfo) && (substr($action, 0, 3) != 'new')) {
+      $tcInfo = new objectInfo($classes);
+    }
+
+    if (isset($tcInfo) && is_object($tcInfo) && ($classes['tax_class_id'] == $tcInfo->tax_class_id)) {
+      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo'              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $classes['tax_class_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $classes['tax_class_title']; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($tcInfo) && is_object($tcInfo) && ($classes['tax_class_id'] == $tcInfo->tax_class_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $classes['tax_class_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $classes_split->display_count($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES); ?></td>
+                    <td class="smallText" align="right"><?php echo $classes_split->display_links($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_tax_class.gif', IMAGE_NEW_TAX_CLASS) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_TAX_CLASS . '</b>');
+
+      $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert'));
+      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_TITLE . '<br>' . tep_draw_input_field('tax_class_title'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_DESCRIPTION . '<br>' . tep_draw_input_field('tax_class_description'));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . '&nbsp;<a href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_TAX_CLASS . '</b>');
+
+      $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_TITLE . '<br>' . tep_draw_input_field('tax_class_title', $tcInfo->tax_class_title));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_DESCRIPTION . '<br>' . tep_draw_input_field('tax_class_description', $tcInfo->tax_class_description));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_TAX_CLASS . '</b>');
+
+      $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $tcInfo->tax_class_title . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($tcInfo) && is_object($tcInfo)) {
+        $heading[] = array('text' => '<b>' . $tcInfo->tax_class_title . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($tcInfo->date_added));
+        $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($tcInfo->last_modified));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_DESCRIPTION . '<br>' . $tcInfo->tax_class_description);
+      }
+      break;
+  }
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/tax_rates.php
===================================================================
--- trunk/direct.openmoko.com/admin/tax_rates.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/tax_rates.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,209 @@
+<?php
+/*
+  $Id: tax_rates.php,v 1.1.1.1 2004/03/04 23:39:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+        $tax_zone_id = tep_db_prepare_input($HTTP_POST_VARS['tax_zone_id']);
+        $tax_class_id = tep_db_prepare_input($HTTP_POST_VARS['tax_class_id']);
+        $tax_rate = tep_db_prepare_input($HTTP_POST_VARS['tax_rate']);
+        $tax_description = tep_db_prepare_input($HTTP_POST_VARS['tax_description']);
+        $tax_priority = tep_db_prepare_input($HTTP_POST_VARS['tax_priority']);
+
+        tep_db_query("insert into " . TABLE_TAX_RATES . " (tax_zone_id, tax_class_id, tax_rate, tax_description, tax_priority, date_added) values ('" . (int)$tax_zone_id . "', '" . (int)$tax_class_id . "', '" . tep_db_input($tax_rate) . "', '" . tep_db_input($tax_description) . "', '" . tep_db_input($tax_priority) . "', now())");
+
+        tep_redirect(tep_href_link(FILENAME_TAX_RATES));
+        break;
+      case 'save':
+        $tax_rates_id = tep_db_prepare_input($HTTP_GET_VARS['tID']);
+        $tax_zone_id = tep_db_prepare_input($HTTP_POST_VARS['tax_zone_id']);
+        $tax_class_id = tep_db_prepare_input($HTTP_POST_VARS['tax_class_id']);
+        $tax_rate = tep_db_prepare_input($HTTP_POST_VARS['tax_rate']);
+        $tax_description = tep_db_prepare_input($HTTP_POST_VARS['tax_description']);
+        $tax_priority = tep_db_prepare_input($HTTP_POST_VARS['tax_priority']);
+
+        tep_db_query("update " . TABLE_TAX_RATES . " set tax_rates_id = '" . (int)$tax_rates_id . "', tax_zone_id = '" . (int)$tax_zone_id . "', tax_class_id = '" . (int)$tax_class_id . "', tax_rate = '" . tep_db_input($tax_rate) . "', tax_description = '" . tep_db_input($tax_description) . "', tax_priority = '" . tep_db_input($tax_priority) . "', last_modified = now() where tax_rates_id = '" . (int)$tax_rates_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tax_rates_id));
+        break;
+      case 'deleteconfirm':
+        $tax_rates_id = tep_db_prepare_input($HTTP_GET_VARS['tID']);
+
+        tep_db_query("delete from " . TABLE_TAX_RATES . " where tax_rates_id = '" . (int)$tax_rates_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_RATE_PRIORITY; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_CLASS_TITLE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ZONE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_RATE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $rates_query_raw = "select r.tax_rates_id, z.geo_zone_id, z.geo_zone_name, tc.tax_class_title, tc.tax_class_id, r.tax_priority, r.tax_rate, r.tax_description, r.date_added, r.last_modified from " . TABLE_TAX_CLASS . " tc, " . TABLE_TAX_RATES . " r left join " . TABLE_GEO_ZONES . " z on r.tax_zone_id = z.geo_zone_id where r.tax_class_id = tc.tax_class_id";
+  $rates_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $rates_query_raw, $rates_query_numrows);
+  $rates_query = tep_db_query($rates_query_raw);
+  while ($rates = tep_db_fetch_array($rates_query)) {
+    if ((!isset($HTTP_GET_VARS['tID']) || (isset($HTTP_GET_VARS['tID']) && ($HTTP_GET_VARS['tID'] == $rates['tax_rates_id']))) && !isset($trInfo) && (substr($action, 0, 3) != 'new')) {
+      $trInfo = new objectInfo($rates);
+    }
+
+    if (isset($trInfo) && is_object($trInfo) && ($rates['tax_rates_id'] == $trInfo->tax_rates_id)) {
+      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $rates['tax_rates_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $rates['tax_priority']; ?></td>
+                <td class="dataTableContent"><?php echo $rates['tax_class_title']; ?></td>
+                <td class="dataTableContent"><?php echo $rates['geo_zone_name']; ?></td>
+                <td class="dataTableContent"><?php echo tep_display_tax_value($rates['tax_rate']); ?>%</td>
+                <td class="dataTableContent" align="right"><?php if (isset($trInfo) && is_object($trInfo) && ($rates['tax_rates_id'] == $trInfo->tax_rates_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $rates['tax_rates_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $rates_split->display_count($rates_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_TAX_RATES); ?></td>
+                    <td class="smallText" align="right"><?php echo $rates_split->display_links($rates_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td colspan="5" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_tax_rate.gif', IMAGE_NEW_TAX_RATE) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_TAX_RATE . '</b>');
+
+      $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert'));
+      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_TITLE . '<br>' . tep_tax_classes_pull_down('name="tax_class_id" style="font-size:10px"'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_NAME . '<br>' . tep_geo_zones_pull_down('name="tax_zone_id" style="font-size:10px"'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_TAX_RATE . '<br>' . tep_draw_input_field('tax_rate'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_RATE_DESCRIPTION . '<br>' . tep_draw_input_field('tax_description'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_TAX_RATE_PRIORITY . '<br>' . tep_draw_input_field('tax_priority'));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . '&nbsp;<a href="' . tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_TAX_RATE . '</b>');
+
+      $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id  . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_TITLE . '<br>' . tep_tax_classes_pull_down('name="tax_class_id" style="font-size:10px"', $trInfo->tax_class_id));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_NAME . '<br>' . tep_geo_zones_pull_down('name="tax_zone_id" style="font-size:10px"', $trInfo->geo_zone_id));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_TAX_RATE . '<br>' . tep_draw_input_field('tax_rate', $trInfo->tax_rate));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_RATE_DESCRIPTION . '<br>' . tep_draw_input_field('tax_description', $trInfo->tax_description));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_TAX_RATE_PRIORITY . '<br>' . tep_draw_input_field('tax_priority', $trInfo->tax_priority));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_TAX_RATE . '</b>');
+
+      $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id  . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $trInfo->tax_class_title . ' ' . number_format($trInfo->tax_rate, TAX_DECIMAL_PLACES) . '%</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($trInfo)) {
+        $heading[] = array('text' => '<b>' . $trInfo->tax_class_title . '</b>');
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($trInfo->date_added));
+        $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($trInfo->last_modified));
+        $contents[] = array('text' => '<br>' . TEXT_INFO_RATE_DESCRIPTION . '<br>' . $trInfo->tax_description);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/template_admin.php
===================================================================
--- trunk/direct.openmoko.com/admin/template_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/template_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,223 @@
+<?php
+/*
+  $Id: template_admin.php,v 1.1.1.1 2004/03/04 23:39:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//300
+
+  require('includes/application_top.php');
+
+  // #CP - local dir to the template directory where you are uploading the company logo
+  $template_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_TEMPLATE'");
+  $template = tep_db_fetch_array($template_query);
+  $CURR_TEMPLATE = $template['configuration_value'] . '/';
+
+  $upload_fs_dir = DIR_FS_TEMPLATES.$CURR_TEMPLATE.DIR_WS_IMAGES;
+  $upload_ws_dir = DIR_WS_TEMPLATES.$CURR_TEMPLATE.DIR_WS_IMAGES;
+  // #CP
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'save':
+        $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);
+        $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+        break;
+
+      case 'save1':
+        $configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);
+        $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'");
+
+        tep_redirect(tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID1'] . '&cID=' . $cID));
+        break;
+
+
+
+
+
+// #CP - supporting functions to upload company logo to template images directory
+    }
+// #CP
+  }
+
+  $gID = '300';
+  $cfg_group_query = tep_db_query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '300'");
+  $cfg_group = tep_db_fetch_array($cfg_group_query);
+
+ $gID1 = '350';
+  $cfg_group_query1 = tep_db_query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '350'");
+  $cfg_group1 = tep_db_fetch_array($cfg_group_query1);
+
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="12">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo TEXT_HEADER_EXPLAIN ; ?></td>
+            <td" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>            
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+           <td colspan="3" class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_LAYOUT; ?></td>
+          </tr>
+<?php // layout box configuration 
+;?>
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '" . (int)$gID . "' order by sort_order");
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+    if (tep_not_null($configuration['use_function'])) {
+      $use_function = $configuration['use_function'];
+      if (ereg('->', $use_function)) {
+        $class_method = explode('->', $use_function);
+        if (!is_object(${$class_method[0]})) {
+          include(DIR_WS_CLASSES . $class_method[0] . '.php');
+          ${$class_method[0]} = new $class_method[0]();
+        }
+        $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
+      } else {
+        $cfgValue = tep_call_function($use_function, $configuration['configuration_value']);
+      }
+    } else {
+      $cfgValue = $configuration['configuration_value'];
+    }
+
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cfg_extra_query = tep_db_query("select configuration_key, configuration_description, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . (int)$configuration['configuration_id'] . "'");
+      $cfg_extra = tep_db_fetch_array($cfg_extra_query);
+
+      $cInfo_array = array_merge($configuration, $cfg_extra);
+      $cInfo = new objectInfo($cInfo_array);
+    }
+
+    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
+      if($cInfo->set_function == 'file_upload'){
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=upload') . '\'">' . "\n";
+      } else {
+      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
+      }
+    } else {
+      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $configuration['configuration_title']; ?></td>
+                <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td>
+                <td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>                  </table></td>
+
+            
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'edit':
+      $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function) {
+        eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value) . '");');
+      } else {
+        $value_field = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
+      }
+
+      $contents = array('form' => tep_draw_form('configuration', FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
+
+      if ($cInfo->set_function == 'file_upload') {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=upload') . '">' . tep_image_button('button_upload.gif', IMAGE_EDIT) . '</a>'.'<p>');
+        $contents[] = array('align' => 'center', 'text' => tep_image($upload_ws_dir . $cInfo->configuration_value, IMAGE_EDIT));
+      } else {
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_TEMPLATE_ADMIN, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
+      }
+        $contents[] = array('text' => '<br>' . $cInfo->configuration_description);
+        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
+        if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
+      }
+
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/template_configuration.php
===================================================================
--- trunk/direct.openmoko.com/admin/template_configuration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/template_configuration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,746 @@
+<?php
+/*
+  $Id: template_configuration.php,v 1.1.1.1 2004/03/04 23:39:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+////
+// Alias function for Store configuration values in the Administration Tool
+function tep_fixweight(){
+    global  $infobox_id, $cID;
+    //$column = $HTTP_GET_VARS['flag'];
+    $rightpos = 'right';
+    $leftpos = 'left';
+    $result_query = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where display_in_column = '" . $leftpos . "' and template_id = '" . (int)$cID . "' order by location");
+
+    $sorted_position = 0;
+      while ($result = tep_db_fetch_array($result_query)) {
+  $sorted_position++;
+  tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set location = '" . $sorted_position . "' where infobox_id = '" . (int)$result['infobox_id'] . "' and template_id = '" . (int)$cID . "'");
+    }
+
+    $result_query = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where display_in_column = '" . $rightpos . "' and template_id = '" . (int)$cID . "' order by location");
+
+    $sorted_position = 0;
+      while ($result = tep_db_fetch_array($result_query)) {
+  $sorted_positionright++;
+  tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set location = '" . $sorted_position . "' where infobox_id = '" . (int)$result['infobox_id'] . "' and template_id = '" . (int)$cID . "'");
+    }
+tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $cID . '&action=edit'));
+}
+
+
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+
+case 'fixweight':
+    global  $infobox_id, $cID;
+    $rightpos = 'right';
+    $leftpos = 'left';
+
+    $result_query = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where display_in_column = '" . $leftpos . "' and template_id = '" . (int)$cID . "' order by location");
+
+    $sorted_position = 0;
+      while ($result = tep_db_fetch_array($result_query)) {
+  $sorted_position++;
+  tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set location = '" . $sorted_position . "' where infobox_id = '" . (int)$result['infobox_id'] . "' and template_id = '" . (int)$cID . "'");
+          }
+
+    $result_query = tep_db_query("select infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where display_in_column = '" . $rightpos . "' and template_id = '" . (int)$cID . "' order by location");
+
+    $sorted_position = 0;
+      while ($result = tep_db_fetch_array($result_query)) {
+  $sorted_position++;
+  tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set location = '" . $sorted_position . "' where infobox_id = '" . (int)$result['infobox_id'] . "' and template_id = '" . (int)$cID . "'");
+          }
+
+tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $cID . '&action=edit'));
+        break;
+
+     case 'setflag': //set the status of a template active.
+        if ( ($HTTP_GET_VARS['flag'] == 0) || ($HTTP_GET_VARS['flag'] == 1) ) {
+          if ($HTTP_GET_VARS['cID']) {
+            tep_db_query("update " . TABLE_TEMPLATE . " set active = '" . $HTTP_GET_VARS['flag'] . "' where template_id = '" . (int)$cID . "'");
+          }
+        }
+
+tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $cID));
+        break;
+
+
+     case 'setflagtemplate': //set the status of a template active buttons.
+        if ( ($HTTP_GET_VARS['flag'] == 'no' ) || ($HTTP_GET_VARS['flag'] == 'yes') ) {
+          if ($HTTP_GET_VARS['cID']) {
+        if  ($HTTP_GET_VARS['case'] != 'infobox_display'){
+            tep_db_query("update " . TABLE_TEMPLATE . " set  $case = '" . $HTTP_GET_VARS['flag'] . "' where template_id = '" . (int)$cID . "'");
+
+}else{
+            tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set $case = '" . $HTTP_GET_VARS['flag'] . "' where infobox_id = '" . (int)$iID . "'");
+            }
+          }
+        }
+
+tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $cID . '&action=edit'));
+        break;
+
+     case 'position_update': //set the status of a template active buttons.
+        if ( ($HTTP_GET_VARS['flag'] == 'up') || ($HTTP_GET_VARS['flag'] == 'down') ) {
+          if ($HTTP_GET_VARS['cID']) {
+            tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set  location = '" . $HTTP_GET_VARS['loc'] .  "', last_modified = now() where location = '" . $HTTP_GET_VARS['loc1'] . "' and display_in_column = '" . $HTTP_GET_VARS['col'] . "'");
+
+            tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set  location = '" . $HTTP_GET_VARS['loc1'] .  "', last_modified = now() where infobox_id = '" . (int)$iID . "' and display_in_column = '" . $HTTP_GET_VARS['col'] . "'");
+
+          }
+        }
+
+tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $cID . '&action=edit'));
+        break;
+
+      case 'setflaginfobox': //set the status of a news item.
+        if ( ($HTTP_GET_VARS['flag'] == 'left') || ($HTTP_GET_VARS['flag'] == 'right') ) {
+          if ($HTTP_GET_VARS['cID']) {
+            tep_db_query("update " . TABLE_INFOBOX_CONFIGURATION . " set $case = '" . $HTTP_GET_VARS['flag'] . "' where infobox_id = '" . (int)$iID . "'");
+          }
+        }
+tep_fixweight();
+tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $cID . '&action=edit'));
+        break;
+
+
+      case 'save':
+        $template_name = tep_db_prepare_input($HTTP_POST_VARS['template_name']);
+        $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+      $sql_data_array = array('template_name' => $template_name,
+            'template_cellpadding_main' => $template_cellpadding_main,
+            'template_cellpadding_left' => $template_cellpadding_left,
+            'template_cellpadding_right' => $template_cellpadding_right,
+            'template_cellpadding_sub' => $template_cellpadding_sub,
+            'box_width_left' => $box_width_left,
+            'box_width_right' => $box_width_right,
+            'cart_in_header' => $cart_in_header,
+            'languages_in_header' => $languages_in_header,
+            'show_header_link_buttons' => $show_header_link_buttons,
+            'include_column_left' => $include_column_left,
+            'include_column_right' => $include_column_right,
+            'module_one' => $module_one,
+            'module_two' => $module_two,
+            'module_three' => $module_three,
+            'module_four' => $module_four,
+            'module_five' => $module_five,
+            'module_six' => $module_six,
+            'customer_greeting' => $customer_greeting,
+            'edit_customer_greeting_personal' => $edit_customer_greeting_personal,
+            'edit_customer_greeting_personal_relogon' => $edit_customer_greeting_personal_relogon,
+            'edit_greeting_guest' => $edit_greeting_guest,
+            'main_table_border' => $main_table_border,
+            'show_heading_title_original' => $show_heading_title_original,
+            'site_width' => $site_width,
+            'side_box_left_width' => $side_box_left_width,
+            'side_box_right_width' => $side_box_right_width,
+
+            );
+
+
+        $update_sql_data = array('last_modified' => 'now()');
+        $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+        tep_db_perform(TABLE_TEMPLATE, $sql_data_array, 'update', "template_id = '" . (int)$cID . "'");
+
+       if ($HTTP_POST_VARS['default'] == 'on') {
+        tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $template_name . "' where configuration_key = 'DEFAULT_TEMPLATE'");
+      }
+
+
+tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $cID . '&action=edit'));
+        //tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
+        break;
+
+      case 'insert':
+               // template_name is the same as the template_id
+     if (is_file(DIR_FS_TEMPLATES . "/" . $template_name . "/install.sql")){
+         $template_sql_file = DIR_FS_TEMPLATES . "/" . $template_name . "/install.sql";
+      } else if (is_file(DIR_FS_TEMPLATES . "/" . $template_name . "/" . $template_name . ".sql")) {
+     $template_sql_file = DIR_FS_TEMPLATES . "/" . $template_name . "/" . $template_name . ".sql";
+      } else {
+         $messageStack->add('header', ERROR4, 'warning');
+   }
+      
+    
+if($template_sql_file == 'default.sql'){
+ $messageStack->add('header', ERROR3 , 'warning');
+}else{
+//if names are the same read the install.sql file, read the files and insert the template-id
+       if(file_exists($template_sql_file)){
+//start by createing a blank record with template name
+    $sql_data_array = array('template_name' => $template_name);
+
+        $update_sql_data = array('date_added' => 'now()');
+        $sql_data_array = array_merge($sql_data_array, $update_sql_data);
+
+        tep_db_perform(TABLE_TEMPLATE, $sql_data_array);
+        $cID = tep_db_insert_id();
+//end create blank record
+    // check if the template image directory exists make sure direcories exsist if not in the template
+    if (!file_exists(DIR_FS_TEMPLATES . "/" . $template_name)) {
+        mkdir(DIR_FS_TEMPLATES . "/" . $template_name, 0744);
+      }
+    if (!file_exists(DIR_FS_TEMPLATES . "/" . $template_name . '/boxes')) {
+        mkdir(DIR_FS_TEMPLATES . "/" . $template_name . '/boxes', 0744);
+      }
+    if (!file_exists(DIR_FS_TEMPLATES . "/" . $template_name . '/images')) {
+        mkdir(DIR_FS_TEMPLATES . "/" . $template_name . '/images', 0744);
+      }
+
+               $data_query = fread(fopen( $template_sql_file, 'rb'), filesize($template_sql_file)) ;
+                      $data_query = str_replace('#tID#', $cID, $data_query);
+                      $data_query = str_replace(';', '', $data_query);
+//   echo $data_query ;
+
+   //make an array split on end of line and
+     if (isset($data_query)) {
+              $sql_array = array();
+              $sql_length = strlen($data_query);
+              $pos =  strpos($data_query, "\n");
+
+         $data_query1 = explode("\n",$data_query);
+           $key = key($data_query1);
+                $sql_length = count($data_query1);
+                $pos = $data_query1[$key];
+          for ($i=$key; $i<$sql_length; $i++) {
+      // replace and remove -- coment lines
+
+       // check first few charcters
+      if ( strrchr($data_query1[$i], '--') ) {
+      //if line starts with -- it's a comment ignore
+              } else if ($data_query1[$i] == '') {
+            //if line is empty ignore
+            } else {
+     tep_db_query( $data_query1[$i] );
+                 }
+
+
+   }
+ }
+ //insert header
+ 
+// pull infobox info
+     $infobox_query = tep_db_query("select box_heading, infobox_id from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" .$cID. "'");
+    // $infobox = tep_db_fetch_array($infobox_query);
+ while ($infobox = tep_db_fetch_array($infobox_query)) {
+          $languages = tep_get_languages();
+          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
+          $language_id = $languages[$i]['id'];
+          $box_heading = tep_db_prepare_input($infobox['box_heading']);
+          $infobox_id = $infobox['infobox_id'];
+          $box_heading = str_replace("'", "\\'", $box_heading);
+
+          //$box_heading = strtr ( $box_heading, "\'", '\'' )
+      
+           tep_db_query("insert into " . TABLE_INFOBOX_HEADING . " (infobox_id, languages_id, box_heading) values ('" . $infobox_id . "', '" . $language_id . "', '" . $box_heading . "') ");
+       }
+      } 
+ 
+          }else{
+          //change this to a language define later on
+//  tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION .'?error=error1'));
+    }
+    }
+        tep_redirect(tep_href_link(FILENAME_INFOBOX_CONFIGURATION,'gID=' . $cID));
+
+        break;
+
+    case 'deleteconfirm':
+        $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+      if ($HTTP_POST_VARS['delete_image'] == 'on') {
+        $theme_query = tep_db_query("select template_image from " . TABLE_TEMPLATE . " where template_id = '" . (int)$cID . "'");
+        $theme = tep_db_fetch_array($theme_query);
+        $image_location = DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES . $theme['template_image'];
+        if (file_exists($image_location)) @unlink($image_location);
+      }
+
+    //set customer template to default if selected template is deleted.
+    if ($HTTP_POST_VARS['reset_cust_temp'] == 'on') {
+       $theme_query1 = tep_db_query("select template_name from " . TABLE_TEMPLATE . " where template_id = '" . (int)$cID . "'");
+       $theme1 = tep_db_fetch_array($theme_query1);
+       $sql_data_array5 = array('customers_selected_template' => 'default');
+       tep_db_perform(TABLE_CUSTOMERS, $sql_data_array5, 'update', "customers_selected_template = '" . $theme1['template_name'] . "'");
+      }
+   
+      tep_db_query("delete from " . TABLE_TEMPLATE . " where template_id = '" . (int)$cID . "'");
+      tep_db_query("delete from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . (int)$cID . "'");
+     
+        tep_redirect(tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $cID));
+      break;
+    }
+  }
+
+  $gID = (isset($HTTP_GET_VARS['gID'])) ? $HTTP_GET_VARS['gID'] : 1;
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="12">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TEMPLATE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ACTIVE; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DISPLAY_COLUMN_LEFT; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DISPLAY_COLUMN_RIGHT; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+   $count_left_active = 0;
+   $count_right_active = 0;
+   $infobox_query = tep_db_query("select display_in_column, infobox_display  from " . TABLE_INFOBOX_CONFIGURATION . " where template_id = '" . $HTTP_GET_VARS['cID'] . "'");
+  while ($infobox = tep_db_fetch_array($infobox_query)) {
+
+      $infcol = $infobox['display_in_column'];
+      $infValue = $infobox['infobox_display'];
+   if (($infcol == 'left') && ($infValue != 'no')) {
+    $count_left_active++;
+   } else if (($infcol == 'right') && ($infValue != 'no'))
+   {
+    $count_right_active++;
+    }
+  }
+
+  $template_query = tep_db_query("select * from " . TABLE_TEMPLATE . "  order by template_name");
+  while ($template = tep_db_fetch_array($template_query)) {
+
+  $curr_templates .= $template['template_name'].",";
+
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $template['template_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $tInfo_array = ($template);
+      $tInfo = new objectInfo($tInfo_array);
+    }
+
+    if ( (is_object($tInfo)) && ($template['template_id'] == $tInfo->template_id) ) {
+      echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,'cID=' .       $template['template_id'] . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,'cID=' . $template['template_id']) . '\'">' . "\n";
+    }
+     if (DEFAULT_TEMPLATE == $template['template_name']) {
+      echo '                <td class="dataTableContent"><b>' . $template['template_name'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
+    } else {
+      echo '                <td class="dataTableContent">' . $template['template_name'] . '</td>' . "\n";
+    }
+?>
+
+                <td class="dataTableContent" align="center">
+<?php
+      if ($template['active'] == '1') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'action=setflag&flag=0&cID=' . $template['template_id'] ) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'action=setflag&flag=1&cID=' . $template['template_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
+      }
+?></td>
+                <td class="dataTableContent" align="center">
+<?php
+      if ($template['include_column_left'] == 'yes') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_y_green.gif', IMAGE_ICON_STATUS_GREEN, 16, 16) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'action=setflagtemplate&case=include_column_left&flag=no&cID=' . $template['template_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_n_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 16, 16) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'action=setflagtemplate&case=include_column_left&flag=yes&cID=' . $template['template_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_y_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 16, 16) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_n_red.gif', IMAGE_ICON_STATUS_RED, 16, 16);
+      }
+?></td>
+
+                <td class="dataTableContent" align="center">
+<?php
+      if ($template['include_column_right'] == 'yes') {
+        echo tep_image(DIR_WS_IMAGES . 'icon_y_green.gif', IMAGE_ICON_STATUS_GREEN, 16, 16) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'action=setflagtemplate&case=include_column_right&flag=no&cID=' . $template['template_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_n_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 16, 16) . '</a>';
+      } else {
+        echo '<a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'action=setflagtemplate&case=include_column_right&flag=yes&cID=' . $template['template_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_y_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 16, 16) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_n_red.gif', IMAGE_ICON_STATUS_RED, 16, 16);
+      }
+?></td>
+
+                <td class="dataTableContent" align="right"><?php if ( (isset($tInfo) && is_object($tInfo)) && ($template['template_id'] == $tInfo->template_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $template['template_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+<?php
+  if ($HTTP_GET_VARS['action'] != 'new') {
+?>
+             </tr> <tr>
+                <td align="right" colspan="4" class="smallText"><br><?php echo '<a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,'action=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+
+<?php
+  }
+?>
+<tr><td>
+<?php
+// as more error messages are added this will change into a case statement
+if ($HTTP_GET_VARS['error'] == 'error1'){
+echo ERROR1;
+}
+if ($HTTP_GET_VARS['error'] == 'error2'){
+echo ERROR2;
+}
+ ?>
+ </td></tr>
+            </table></td>
+
+<?php
+
+  $heading = array();
+  $contents = array();
+
+ 
+//get template type
+    if ( file_exists(DIR_FS_TEMPLATES .$tInfo->template_name . '/template.php')) {
+  include_once(DIR_FS_TEMPLATES .$tInfo->template_name . '/template.php');
+ $template_type = TEMPLATE_SYSTEM ;
+     } else {
+  $template_type = 'cre_legacy';    
+    }
+    
+  $template_path = DIR_FS_TEMPLATES .$tInfo->template_name . '/template.php';
+ 
+
+  switch ($action) {
+//************************************************************************************************************************
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_TEMPLATE . '</b>');
+
+      $contents = array('form' => tep_draw_form('new_template', FILENAME_TEMPLATE_CONFIGURATION, 'action=insert', 'post', 'enctype="multipart/form-data"'));
+      $contents[] = array('text' => TEXT_NEW_INTRO);
+
+    if ($handle = opendir(DIR_FS_TEMPLATES)) {
+      /* This is the correct way to loop over the directory. */
+        while (false !== ($file = readdir($handle))) {
+        if(is_dir(DIR_FS_TEMPLATES . '/' . $file) && stristr($curr_templates.".,..,content,CVS", $file ) == FALSE){
+        if ( ($file == 'default') || ($file == 'boxes') || ($file == 'mainpage_modules')|| ($file == '.svn') ){
+        }else{
+        $dirs[] = $file;
+          $dirs_array[] = array('id' => $file,
+                                 'text' => $file);
+           }
+        }
+        }
+        closedir($handle);
+      }
+
+      if(count($dirs_array) == 0){
+    $contents[] = array('text' => '<br>' . TEMPLATE_NAME . '<br>' . tep_draw_input_field('template_name'));
+      }
+      else{
+      sort($dirs_array);
+      $contents[] = array('text' => '<br>' . TEXT_TEMPLATE_NAME . '<br>' . tep_draw_pull_down_menu('template_name', $dirs_array, '', "style='width:150;'"));
+      }
+
+      $contents[] = array('text' => '<br>' . TEXT_TEMPLATE_IMAGE . '<br>' . tep_draw_file_field('template_image'));
+
+
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,'gID=1') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+
+      break;
+//*************************************************************************************************************************
+
+//*************************************************************************************************************************
+      case 'edit':
+
+      switch ($tInfo->cart_in_header) {
+        case 'no': $cart_in_status = false; $cart_out_status = true; break;
+        case 'yes': $cart_in_status = true; $cart_out_status = false; break;
+        default: $cart_in_status = true; $cart_out_status = false;
+      }
+      switch ($tInfo->languages_in_header) {
+        case 'no': $yes_status = false; $no_status = true; break;
+        case 'yes': $yes_status = true; $no_status = false; break;
+        default: $yes_status = true; $no_status = false;
+
+      }
+      switch ($tInfo->include_column_left) {
+        case 'no': $no_left_status = true; $yes_left_status = false; break;
+        case 'yes': $no_left_status = false; $yes_left_status = true; break;
+        default: $no_left_status = false; $yes_left_status = true;
+      }
+      switch ($tInfo->include_column_right) {
+        case 'no': $no_right_status = true; $yes_right_status = false; break;
+        case 'yes': $no_right_status = false; $yes_right_status = true; break;
+        default: $no_right__status = false; $yes_right_status = true;
+      }
+
+      switch ($tInfo->show_header_link_buttons) {
+        case 'no': $links_no_status = true; $links_yes_status = false; break;
+        case 'yes': $links_no_status = false; $links_yes_status = true; break;
+        default: $links_no_status = false; $links_yes_status = true;
+      }
+
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_TEMPLATE . '</b>');
+
+      $contents = array('form' =>  tep_draw_form('template', FILENAME_TEMPLATE_CONFIGURATION,'cID=' . $tInfo->template_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
+
+
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+
+      $contents[] = array('text' => TEXT_TEMPLATE_NAME . tep_draw_hidden_field('template_name', $tInfo->template_name) . $tInfo->template_name);
+      if (DEFAULT_TEMPLATE != $tInfo->template_name) $contents[] = array('text' =>'<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT);
+        $contents[] = array('text' =>  TEXT_TEMPLATE_SYSTEM . '<b>' . $template_type . '</b>'. TEXT_TEMPLATE_SYSTEM_1 . '<br><br>');
+
+      $contents[] = array('text' => TEXT_SITE_WIDTH . '  ' . tep_draw_input_field('site_width', $tInfo->site_width,'size="3"') . '<br>');
+
+      $contents[] = array('text' => TEXT_HEADER . '<br>');
+
+      $contents[] = array('text' => TEXT_INCLUDE_CART_IN_HEADER. '<br>  ' .TEXT_YES . tep_draw_radio_field('cart_in_header', 'yes', $cart_in_status) . '&nbsp;' . tep_draw_radio_field('cart_in_header', 'no', $cart_out_status) . TEXT_NO . '<br>');
+
+
+      $contents[] = array('text' => TEXT_INCLUDE_LANGUAGES_IN_HEADER. '<br>' .TEXT_YES . tep_draw_radio_field('languages_in_header', 'yes', $yes_status) . '&nbsp;' . tep_draw_radio_field('languages_in_header', 'no', $no_status) . TEXT_NO . '<br>');
+
+      $contents[] = array('text' => TEXT_INCLUDE_HEADER_LINK_BUTTONS. '<br>' .TEXT_YES . tep_draw_radio_field('show_header_link_buttons', 'yes', $links_yes_status) . '&nbsp;' . tep_draw_radio_field('show_header_link_buttons', 'no', $links_no_status) . TEXT_NO . '<br>');
+
+    $contents[] = array('text' => '<br>' . TEXT_TABLE_CELL_PADDING . '<br>');
+
+     $select_box = '<select name="template_cellpadding_main" " style="width: 40">';
+for ($i = 0; $i <= 10; $i++) {
+      $select_box .= '<option value="' . $i . '"';
+      if ($i == $tInfo->template_cellpadding_main) $select_box .= ' SELECTED';
+      $select_box .= '>' . $i . '</option>';
+}
+    $select_box .= "</select>";
+
+      $contents[] = array('text' => TEXT_TEMPLATE_CELLPADDING_MAIN . '  ' .  $select_box . '<br>');
+
+     $select_box = '<select name="template_cellpadding_sub" " style="width: 40">';
+for ($i = 0; $i <= 10; $i++) {
+      $select_box .= '<option value="' . $i . '"';
+      if ($i == $tInfo->template_cellpadding_sub) $select_box .= ' SELECTED';
+      $select_box .= '>' . $i . '</option>';
+}
+    $select_box .= "</select>";
+
+      $contents[] = array('text' => TEXT_TEMPLATE_CELLPADDING_SUB . '  ' . $select_box);
+
+
+//-----------
+     $contents[] = array('text' => '<br>' . TEXT_TABLE_CELL_LEFT_RIGHT . '<br>');
+
+       $select_box = '<select name="side_box_left_width" " style="width: 40">';
+  for ($i = 0; $i <= 20; $i++) {
+        $select_box .= '<option value="' . $i . '"';
+        if ($i == $tInfo->side_box_left_width) $select_box .= ' SELECTED';
+        $select_box .= '>' . $i . '</option>';
+  }
+
+    $select_box .= "</select>";
+      $contents[] = array('text' => TEXT_TEMPLATE_LEFT_SIDE . '  ' .  $select_box . '<br>');
+
+           $select_box = '<select name="side_box_right_width" " style="width: 40">';
+    for ($i = 0; $i <= 20; $i++) {
+          $select_box .= '<option value="' . $i . '"';
+          if ($i == $tInfo->side_box_right_width) $select_box .= ' SELECTED';
+          $select_box .= '>' . $i . '</option>';
+    }
+      $select_box .= "</select>";
+      $contents[] = array('text' => TEXT_TEMPLATE_RIGHT_SIDE . '  ' .  $select_box . '<br>');
+
+//--------
+
+      $contents[] = array('text' => '<br>' . TEXT_LEFT_COLUMN . '<br>');
+
+      $contents[] = array('text' => TEXT_INCLUDE_COLUMN_LEFT .'<br>' .TEXT_YES . tep_draw_radio_field('include_column_left', 'yes', $yes_left_status) . '&nbsp;' . tep_draw_radio_field('include_column_left', 'no', $no_left_status) . TEXT_NO . '<br>');
+
+     if ($tInfo->include_column_left == 'yes') {
+      $contents[] = array('text' => TEXT_COLUMN_LEFT_WIDTH . '  ' . tep_draw_input_field('box_width_left', $tInfo->box_width_left,'size="3"'). '<br>');
+     $select_box = '<select name="template_cellpadding_left" " style="width: 40">';
+for ($i = 0; $i <= 10; $i++) {
+      $select_box .= '<option value="' . $i . '"';
+      if ($i == $tInfo->template_cellpadding_left) $select_box .= ' SELECTED';
+      $select_box .= '>' . $i . '</option>';
+}
+    $select_box .= "</select>";
+      $contents[] = array('text' => TEXT_TEMPLATE_CELLPADDING_LEFT . '  ' . $select_box);
+}else {
+      $contents[] = array('text' => tep_draw_hidden_field('box_width_left', $tInfo->box_width_left));
+      $contents[] = array('text' => tep_draw_hidden_field('template_cellpadding_left', $tInfo->template_cellpadding_left));
+}
+      $contents[] = array('text' => '<br>' . TEXT_RIGHT_COLUMN . '<br>');
+
+      $contents[] = array('text' => TEXT_INCLUDE_COLUMN_RIGHT . '<br>' .TEXT_YES . tep_draw_radio_field('include_column_right', 'yes', $yes_right_status) . '&nbsp;' . tep_draw_radio_field('include_column_right', 'no', $no_right_status) . TEXT_NO. '<br>');
+
+     if ($tInfo->include_column_right == 'yes') {
+      $contents[] = array('text' => TEXT_COLUMN_RIGHT_WIDTH . '  ' . tep_draw_input_field('box_width_right', $tInfo->box_width_right,'size="3"') . '<br>');
+
+     $select_box = '<select name="template_cellpadding_right" " style="width: 40">';
+      for ($i = 0; $i <= 10; $i++) {
+      $select_box .= '<option value="' . $i . '"';
+      if ($i == $tInfo->template_cellpadding_right) $select_box .= ' SELECTED';
+      $select_box .= '>' . $i . '</option>';
+  }
+      $select_box .= "</select>";
+
+      $contents[] = array('text' => TEXT_TEMPLATE_CELLPADDING_RIGHT  . '  ' . $select_box . '<br>');
+
+  }else {
+      $contents[] = array('text' => tep_draw_hidden_field('box_width_right', $tInfo->box_width_right));
+      $contents[] = array('text' => tep_draw_hidden_field('template_cellpadding_right', $tInfo->template_cellpadding_right));
+  }
+
+
+//swtich between mainpage_module directoies
+ if ( file_exists(DIR_FS_TEMPLATES . $tInfo->template_name . '/template.php')) {
+
+ if(is_dir(DIR_FS_TEMPLATE_MAINPAGES)) {
+   $modules_folder = DIR_FS_TEMPLATE_MAINPAGES;
+  }else{
+   $modules_folder = (DIR_FS_TEMPLATES .'/default/mainpage_modules/');
+  }
+}else{
+ if(is_dir(DIR_FS_TEMPLATES .$tInfo->template_name . '/mainpage_modules/')) {
+   $modules_folder = (DIR_FS_TEMPLATES .$tInfo->template_name . '/mainpage_modules/');
+  }else{
+   $modules_folder = (DIR_FS_CATALOG_MODULES. 'mainpage_modules');
+  }
+}               
+                 $modules_folder_1 = $modules_folder  ;   
+                 $modules_folder_2 = wordwrap($modules_folder_1, 30, "<br>\n", 1);
+      $contents[] = array('text' => '<br>' . TEXT_MAINPAGE_MODULES .'<br>');
+      $contents[] = array('text' =>  TEXT_MAINPAGE_MODULES_LOCATION .'<br>');
+      
+      $contents[] = array('text' => $modules_folder_2 . '<br>');
+
+
+
+    if ($handle = opendir($modules_folder)) {
+          $dirs[] = array();
+          $dirs_array[] = array('text' => '');
+
+        while (false !== ($file = readdir($handle))) {
+    if (stristr($file,".php") || stristr($file,".htm") || stristr($file,".html")) {
+
+          $dirs_array[] = array('id' => $file,
+                                 'text' => $file);
+           }
+        }
+        closedir($handle);
+      }
+      sort($dirs_array);
+
+      $contents[] = array('text' => '<br>' . '1  ' . tep_draw_pull_down_menu(module_one, $dirs_array, $tInfo->module_one, "style='width:150;'"));
+
+      $contents[] = array('text' => '2  ' . tep_draw_pull_down_menu(module_two, $dirs_array, $tInfo->module_two, "style='width:150;'"));
+
+      $contents[] = array('text' => '3  ' . tep_draw_pull_down_menu(module_three, $dirs_array, $tInfo->module_three, "style='width:150;'"));
+
+      $contents[] = array('text' => '4  ' . tep_draw_pull_down_menu(module_four, $dirs_array, $tInfo->module_four, "style='width:150;'"));
+
+      $contents[] = array('text' => '5  ' . tep_draw_pull_down_menu(module_five, $dirs_array, $tInfo->module_five, "style='width:150;'"));
+
+      $contents[] = array('text' => '6  ' . tep_draw_pull_down_menu(module_six, $dirs_array, $tInfo->module_six, "style='width:150;'"));
+
+
+      $contents[] = array('text' => '<br>' . TEXT_OTHER . '<br>');
+
+      switch ($tInfo->customer_greeting) {
+        case 'no': $show_greet_no = true; $show_greet_yes = false; break;
+        case 'yes': $show_greet_no = false; $show_greet_yes = true; break;
+        default: $show_greet_no = false; $show_greet_yes = true;
+      }
+      switch ($tInfo->main_table_border) {
+        case 'no': $use_border_no = true; $use_border_yes = false; break;
+        case 'yes': $use_border_no = false; $use_border_yes = true; break;
+        default: $use_border_no = false; $use_border_yes = true;
+      }
+      switch ($tInfo->show_heading_title_original) {
+        case 'no': $orig_page_headers_no = true; $orig_page_headers_yes = false; break;
+        case 'yes': $orig_page_headers_no = false; $orig_page_headers_yes = true; break;
+        default: $orig_page_headers_no = false; $orig_page_headers_yes = true;
+      }
+
+      $contents[] = array('text' => TEXT_SHOW_CUSTOMER_GREETING. '<br>' .TEXT_YES . tep_draw_radio_field('customer_greeting', 'yes', $show_greet_yes) . '&nbsp;' . tep_draw_radio_field('customer_greeting', 'no', $show_greet_no) . TEXT_NO . '<br>');
+
+      $contents[] = array('text' => TEXT_INCLUDE_MAIN_TABLE_BORDER.'<br>' .TEXT_YES . tep_draw_radio_field('main_table_border', 'yes', $use_border_yes) . '&nbsp;' . tep_draw_radio_field('main_table_border', 'no', $use_border_no) . TEXT_NO . '<br>');
+
+      $contents[] = array('text' => TEXT_SHOW_ORIGINAL_PAGE_HEADERS. '<br>' .TEXT_YES . tep_draw_radio_field('show_heading_title_original', 'yes', $orig_page_headers_yes) . '&nbsp;' . tep_draw_radio_field('show_heading_title_original', 'no', $orig_page_headers_no) . TEXT_NO . '<br>');
+
+          $contents[] = array('align' => 'center', 'text' => tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,'&cID=' . $tInfo->template_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+
+//*************************************************************************************************************************
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_HEADING_DELETE_TEMPLATE . '</b>');
+      $contents = array('form' => tep_draw_form('theme', FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $tInfo->template_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $tInfo->template_name . '</b>');
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('reset_cust_temp', '', false) . ' ' . TEXT_REST_CUST_TEMP);
+      $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE);
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_module_remove.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,'cID=' . $tInfo->template_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (is_object($tInfo)) {
+        $heading[] = array('text' => '<b>' . $tInfo->template_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION, 'cID=' . $tInfo->template_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_TEMPLATE_CONFIGURATION,'cID=' . $tInfo->template_id . '&action=delete') . '">' . tep_image_button('button_module_remove.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($tInfo->date_added));
+        if (tep_not_null($tInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($tInfo->last_modified));
+        $contents[] = array('text' => '<br>' . tep_image(DIR_WS_TEMPLATES . $tInfo->template_name .'/images/' .$tInfo->template_image, $tInfo->template_name,'200','160'));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '           <td width="25%" valign="top">' . "\n";
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/treeview.php
===================================================================
--- trunk/direct.openmoko.com/admin/treeview.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/treeview.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<?php
+/*
+  $Id: treeview.php,v 1.0 10/08/2005 Beer Monster Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+  <title><!-- Catalog Tree --><?php echo TREEVIEW_TXT_1?></title>
+
+  <link rel="StyleSheet" href="includes/stylesheet.css" type="text/css" />
+  <script type="text/javascript" src="includes/javascript/dtree.js"></script>
+
+</head>
+
+<body>
+<div class="dtree"><form>
+<p><a href="javascript: d.openAll();"><!-- open all --><?php echo TREEVIEW_TXT_2?></a> | <a href="javascript: d.closeAll();"><!-- close all --><?php echo TREEVIEW_TXT_3?></a></p>
+<?php
+    $defaultlanguage_query_raw ="SELECT l.languages_id FROM " . TABLE_LANGUAGES . " as l WHERE l.code ='" . DEFAULT_LANGUAGE . "'";
+    $defaultlanguage_query = tep_db_query($defaultlanguage_query_raw);
+    $defaultlanguage= tep_db_fetch_array($defaultlanguage_query);
+echo "<script type='text/javascript'>
+    <!--
+
+    d = new dTree('d'); \n
+      d.add(0,-1,'Catalog','','');\n";
+
+
+
+    $categories_query_raw = "SELECT c.categories_id, cd.categories_name, c.parent_id FROM " . TABLE_CATEGORIES_DESCRIPTION . " AS cd INNER JOIN categories as c ON cd.categories_id = c.categories_id WHERE cd.language_id =" . $defaultlanguage[languages_id][0] . " ORDER BY c.sort_order";
+    $categories_query = tep_db_query($categories_query_raw);
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      echo "d.add(" . $categories['categories_id'] . "," . $categories['parent_id'] . ",'" . addslashes($categories['categories_name']) . "','', '<input type=checkbox name=categories value=" . $categories['categories_id'] . ">');\n"; //,," . $categories['categories_id'] . ",,,); \n";
+
+    } //end while
+
+    $products_query_raw = "SELECT distinct pc.categories_id, pd.products_id, pd.products_name FROM " .  TABLE_PRODUCTS_TO_CATEGORIES . " as pc INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " as pd ON pc.products_id = pd.products_id";
+    $products_query = tep_db_query($products_query_raw);
+
+    while ($products = tep_db_fetch_array($products_query)) {
+      echo "d.add(" . $products['products_id'] . "0000," . $products['categories_id'] .",'" . addslashes($products['products_name']) . "','', '<input type=checkbox name=products value=" . $products['products_id'] . ">');\n"; //,," . $products['products_id'] . ",,,); \n";
+
+    }//end while
+
+?>
+document.write(d);
+
+    //-->
+  </script>
+<INPUT TYPE="BUTTON" onClick="cycleCheckboxes(this.form)" VALUE="OK"></form>
+<script type='text/javascript'>
+    <!--
+function cycleCheckboxes(what) {
+window.opener.document.coupon.coupon_products.value="";
+window.opener.document.coupon.coupon_categories.value ="";
+    for (var i = 0; i<what.elements.length; i++) {
+        if ((what.elements[i].name.indexOf('products') > -1)) {
+            if (what.elements[i].checked) {
+                window.opener.document.coupon.coupon_products.value += what.elements[i].value + ',';
+            }
+        }
+    }
+
+    for (var i = 0; i<what.elements.length; i++) {
+        if ((what.elements[i].name.indexOf('categories') > -1)) {
+            if (what.elements[i].checked) {
+                window.opener.document.coupon.coupon_categories.value += what.elements[i].value + ',';
+            }
+        }
+    }
+window.close();
+}
+    //-->
+</script>
+</div>
+</body>
+
+</html>

Added: trunk/direct.openmoko.com/admin/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/admin/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,132 @@
+<?php
+/*
+  $Id: validate_New.php,v 1.1.1.1 2004/03/04 23:38:20 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+ THIS IS BETA - Use at your own risk!
+  Step-By-Step Manual Order Entry Verion 0.5
+  Customer Entry through Admin
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_VALIDATE_NEW);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+
+
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top">
+  <form name="sendmail" method="post" <?php echo 'action="' . tep_href_link(FILENAME_VALIDATE_NEW, '') . '"'; ?> >
+  <input type="hidden" name="process" value="sendmail">
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+    <?php    
+    if($HTTP_GET_VARS['process']=='sendmail')
+    {
+    $customerid=$HTTP_GET_VARS['cID'];
+    $check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_password, customers_id,customers_email_address  from " . TABLE_CUSTOMERS . " where customers_id = " . tep_db_input($customerid));
+    if (tep_db_num_rows($check_customer_query)) 
+    {
+      $check_customer = tep_db_fetch_array($check_customer_query);
+      $email_address=$check_customer['customers_email_address'];
+      $pw="ABCDEFGHJKMNOPQRSTUVWXYZabcdefghjkmnopqrstuvwxyz0123456789";
+      srand((double)microtime()*1000000);
+      for ($i=1;$i<=5;$i++)
+      { 
+      $Pass .= $pw{rand(0,strlen($pw)-1)};
+      }
+      $pw1="ABCDEFGHJKMNOPQRSTUVWXYZabcdefghjkmnopqrstuvwxyz0123456789";
+      srand((double)microtime()*1000000);
+      for ($i=1;$i<=5;$i++)
+      { 
+      $Pass_neu .= $pw1{rand(0,strlen($pw1)-1)};
+      }     
+      tep_db_query('update customers set customers_validation_code = "' . $Pass . $Pass_neu . '" where customers_id = ' .  $customerid);      
+      tep_mail($check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'], $email_address, EMAIL_PASSWORD_REMINDER_SUBJECT, 'Dear '.$check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'].','.sprintf(EMAIL_PASSWORD_REMINDER_BODY, $Pass . $Pass_neu) . sprintf(EMAIL_PASSWORD_REMINDER_BODY2, '<a href="' . tep_href_link('pw.php', 'action=reg&pass=' . $Pass . $Pass_neu . '&id=' . (int)$check_customer['customers_id'], 'SSL', false) . '">' . tep_catalog_href_link('pw.php', 'action=reg&pass=' . $Pass . $Pass_neu . '&verifyid=' . (int)$check_customer['customers_id'], 'NONSSL', false) . '</a>'), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);  
+      echo  '<tr><td class="smallText"><br><br>'.SUCCESS_REGISTRATION_CODE_SENT.'</td></tr>';
+      echo "<tr><td  class='main'><br><a href='".tep_href_link(FILENAME_CUSTOMERS,"")."'>".tep_image_button('button_back.gif', IMAGE_BUTTON_BACK)."</a></td></tr>";
+     }
+     }    
+     else
+     {
+    ?>    
+    
+      <?php 
+      $customerid=$HTTP_GET_VARS['cID'];
+      $check_customer_query = tep_db_query("select  customers_validation  from " . TABLE_CUSTOMERS . " where customers_id = " . tep_db_input($customerid));
+      $check_customer = tep_db_fetch_array($check_customer_query);
+      $checkIfValidated=$check_customer['customers_validation'];
+      if($checkIfValidated==0)
+      {
+      ?>            
+         <tr>
+            <td class="smallText"><br><br><?php echo  TEXT_EMAIL_CONFIRMATION.tep_draw_hidden_field('cID',$HTTP_GET_VARS['cID']);?></td>
+            </tr>
+           <tr>
+              <td  class="main">
+               <br><a href='<?php echo tep_href_link(FILENAME_VALIDATE_NEW,"process=sendmail&cID=".$HTTP_GET_VARS['cID'])?>'><?php echo tep_image_button('button_confirm.gif', IMAGE_BUTTON_CONTINUE);?></a></td>
+            </tr>
+      <?php 
+      }
+      else
+      {
+         echo "<tr><td class='smallText'><br><br>".TEXT_ACCOUNT_ALREADY_EXIST."</td>
+            </tr><tr><td  class='main'><br><a href='".tep_href_link(FILENAME_CUSTOMERS,"")."'>".tep_image_button('button_back.gif', IMAGE_BUTTON_BACK)."</a></td></tr>";        
+      }
+      ?> 
+    <?php 
+    }
+    ?> 
+    </table></form></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+    require(DIR_WS_INCLUDES . 'footer.php');
+?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/admin/validcategories.php
===================================================================
--- trunk/direct.openmoko.com/admin/validcategories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/validcategories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: validcategories.php,v 0.01 2002/08/17 15:38:34 Richard Fielder
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+
+
+  Copyright (c) 2002 Richard Fielder
+
+  Released under the GNU General Public License
+*/
+
+require('includes/application_top.php');
+
+
+?>
+<html>
+<head>
+<title>Valid Categories/Products List</title>
+<style type="text/css">
+<!--
+h4 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; text-align: center}
+p {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+th {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+-->
+</style>
+<head>
+<body>
+<table width="550" border="1" cellspacing="1" bordercolor="gray">
+<tr>
+<td colspan="4">
+<h4><?php echo TEXT_VALID_CATEGORIES_LIST; ?></h4>
+</td>
+</tr>
+<?php 
+    echo "<tr><th>" . TEXT_VALID_CATEGORIES_ID . "</th><th>" . TEXT_VALID_CATEGORIES_NAME . "</th></tr><tr>";
+    $result = tep_db_query("SELECT * FROM categories, categories_description WHERE categories.categories_id = categories_description.categories_id and categories_description.language_id = '" . $languages_id . "' ORDER BY categories.categories_id");
+    if ($row = tep_db_fetch_array($result)) {
+        do {
+            echo "<td>".$row["categories_id"]."</td>\n";
+            echo "<td>".$row["categories_name"]."</td>\n";
+            echo "</tr>\n";
+        }
+        while($row = tep_db_fetch_array($result));
+    }
+    echo "</table>\n";
+?>
+<br>
+<table width="550" border="0" cellspacing="1">
+<tr>
+<td align=middle><input type="button" value="Close Window" onClick="window.close()"></td>
+</tr></table>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/validproducts.php
===================================================================
--- trunk/direct.openmoko.com/admin/validproducts.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/validproducts.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: validproducts.php,v 0.01 2002/08/17 15:38:34 Richard Fielder
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+
+
+  Copyright (c) 2002 Richard Fielder
+
+  Released under the GNU General Public License
+*/
+
+require('includes/application_top.php');
+
+
+?>
+<html>
+<head>
+<title><?php echo VALID_CATEGORIES_PRODUCTS_LIST?></title>
+<style type="text/css">
+<!--
+h4 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; text-align: center}
+p {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+th {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
+-->
+</style>
+<head>
+<body>
+<table width="550" border="1" cellspacing="1" bordercolor="gray">
+<tr>
+<td colspan="3">
+<h4><?php echo TEXT_VALID_PRODUCTS_LIST; ?></h4>
+</td>
+</tr>
+<?php 
+    echo "<tr><th>". TEXT_VALID_PRODUCTS_ID . "</th><th>" . TEXT_VALID_PRODUCTS_NAME . "</th><th>" . TEXT_VALID_PRODUCTS_MODEL . "</th></tr><tr>";
+    $result = tep_db_query("SELECT * FROM products, products_description WHERE products.products_id = products_description.products_id and products_description.language_id = '" . $languages_id . "' ORDER BY products_description.products_name");
+    if ($row = tep_db_fetch_array($result)) {
+        do {
+            echo "<td>".$row["products_id"]."</td>\n";
+            echo "<td>".$row["products_name"]."</td>\n";
+            echo "<td>".$row["products_model"]."</td>\n";
+            echo "</tr>\n";
+        }
+        while($row = tep_db_fetch_array($result));
+    }
+    echo "</table>\n";
+?>
+<br>
+<table width="550" border="0" cellspacing="1">
+<tr>
+<td align=middle><input type="button" value="<?php echo QUICK_ATTRIBUTES_POPUP_TXT_5?>" onClick="window.close()"></td>
+</tr></table>
+</body>
+</html>

Added: trunk/direct.openmoko.com/admin/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/admin/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,663 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.32 2003/06/29 22:50:52 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+
+/*
+  Configuration Values
+    Set these to easily personalize your Whos Online
+*/
+
+// Seconds that a visitor is considered "active"
+  $active_time = 300;
+// Seconds before visitor is removed from display
+  $track_time = 900;
+
+// Automatic refresh times in seconds and display names
+//   Time and Display Text order must match between the arrays
+//   "None" is handled separately in the code
+  $refresh_time = array(     30,    60,     120,    180 );
+  $refresh_display = array( ':30', '1:00', '2:00', '3:00' );
+
+// Images used for status lights
+  $status_active_cart = 'icon_status_green.gif';
+  $status_inactive_cart = 'icon_status_red.gif';
+  $status_active_nocart = 'icon_status_green_light.gif';
+  $status_inactive_nocart = 'icon_status_red_light.gif';
+  $status_active_bot = 'icon_status_green_border_light.gif';
+  $status_inactive_bot = 'icon_status_red_border_light.gif';
+
+// Text color used for table entries
+//   Different colored text for different users
+//   Named colors and Hex values should work fine here
+  $fg_color_bot = 'maroon';
+  $fg_color_admin = 'darkblue';
+  $fg_color_guest = 'green';
+  $fg_color_account = '#000000'; // Black
+
+/*
+  Determines status and cart of visitor and displays appropriate icon.
+*/
+function tep_check_cart($which, $customer_id, $session_id) {
+  global $cart, $status_active_cart, $status_inactive_cart, $status_active_nocart, $status_inactive_nocart, $status_inactive_bot, $status_active_bot, $active_time;
+
+    // Pull Session data from the correct source.
+    if (STORE_SESSIONS == 'mysql') {
+      $session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $session_id . "'");
+      $session_data = tep_db_fetch_array($session_data);
+      $session_data = trim($session_data['value']);
+    } else {
+      if ( (file_exists(tep_session_save_path() . '/sess_' . $session_id)) && (filesize(tep_session_save_path() . '/sess_' . $session_id) > 0) ) {
+        $session_data = file(tep_session_save_path() . '/sess_' . $session_id);
+        $session_data = trim(implode('', $session_data));
+      }
+    }
+
+    if ($length = strlen($session_data)) {
+      if (PHP_VERSION < 4) {
+        $start_id = strpos($session_data, 'customer_id[==]s');
+        $start_cart = strpos($session_data, 'cart[==]o');
+        $start_currency = strpos($session_data, 'currency[==]s');
+        $start_country = strpos($session_data, 'customer_country_id[==]s');
+        $start_zone = strpos($session_data, 'customer_zone_id[==]s');
+      } else {
+        $start_id = strpos($session_data, 'customer_id|s');
+        $start_cart = strpos($session_data, 'cart|O');
+        $start_currency = strpos($session_data, 'currency|s');
+        $start_country = strpos($session_data, 'customer_country_id|s');
+        $start_zone = strpos($session_data, 'customer_zone_id|s');
+      }
+
+      for ($i=$start_cart; $i<$length; $i++) {
+        if ($session_data[$i] == '{') {
+          if (isset($tag)) {
+            $tag++;
+          } else {
+            $tag = 1;
+          }
+        } elseif ($session_data[$i] == '}') {
+          $tag--;
+        } elseif ( (isset($tag)) && ($tag < 1) ) {
+          break;
+        }
+      }
+
+      $session_data_id = substr($session_data, $start_id, (strpos($session_data, ';', $start_id) - $start_id + 1));
+      $session_data_cart = substr($session_data, $start_cart, $i);
+      $session_data_currency = substr($session_data, $start_currency, (strpos($session_data, ';', $start_currency) - $start_currency + 1));
+      $session_data_country = substr($session_data, $start_country, (strpos($session_data, ';', $start_country) - $start_country + 1));
+      $session_data_zone = substr($session_data, $start_zone, (strpos($session_data, ';', $start_zone) - $start_zone + 1));
+
+      session_decode($session_data_id);
+      session_decode($session_data_currency);
+      session_decode($session_data_country);
+      session_decode($session_data_zone);
+      session_decode($session_data_cart);
+
+      if (PHP_VERSION < 4) {
+        $broken_cart = $cart;
+        $cart = new shoppingCart;
+        $cart->unserialize($broken_cart);
+      }
+
+      if (is_object($cart)) {
+        $products = $cart->get_products();
+      }
+    }
+    
+  $which_query = $session_data;                               
+  $who_data =   tep_db_query("select time_entry, time_last_click
+                                 from " . TABLE_WHOS_ONLINE . "
+                                 where session_id='" . $session_id . "'");
+  $who_query = tep_db_fetch_array($who_data);                           
+  
+  // Determine if visitor active/inactive
+  $xx_mins_ago_long = (time() - $active_time);
+
+  // Determine Bot active/inactive
+  if( $customer_id < 0 ) {
+    // inactive 
+    if ($who_query['time_last_click'] < $xx_mins_ago_long) {
+      return tep_image(DIR_WS_IMAGES . $status_inactive_bot, TEXT_STATUS_INACTIVE_BOT);
+    // active 
+    } else {
+      return tep_image(DIR_WS_IMAGES . $status_active_bot, TEXT_STATUS_ACTIVE_BOT);
+    }
+  } 
+
+  // Determine active/inactive and cart/no cart status
+  // no cart
+  if ( sizeof($products) == 0 ) {
+    // inactive 
+    if ($who_query['time_last_click'] < $xx_mins_ago_long) {
+      return tep_image(DIR_WS_IMAGES . $status_inactive_nocart, TEXT_STATUS_INACTIVE_NOCART);
+    // active 
+    } else {
+      return tep_image(DIR_WS_IMAGES . $status_active_nocart, TEXT_STATUS_ACTIVE_NOCART);
+    }
+  // cart
+  } else { 
+    // inactive
+    if ($who_query['time_last_click'] < $xx_mins_ago_long) {
+      return tep_image(DIR_WS_IMAGES . $status_inactive_cart, TEXT_STATUS_INACTIVE_CART);
+    // active
+    } else {
+      return tep_image(DIR_WS_IMAGES . $status_active_cart, TEXT_STATUS_ACTIVE_CART);
+    }
+  }
+}
+// WOL 1.5 EOF
+
+/* Display the details about a visitor */
+function display_details() {
+   global $whos_online, $is_bot, $is_admin, $is_guest, $is_account;
+   
+  // Display Name
+   echo '<b>'.TEXT_NAME.'</b> ' . $whos_online['full_name'];
+   echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
+   // Display Customer ID for non-bots
+   if ( !$is_bot ){
+      echo '<b>'.TEXT_CUSTOMER_ID.'</b> ' . $whos_online['customer_id'];
+      echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
+   } 
+  // Display IP Address
+   echo '<b>'.TEXT_IP_ADDRESS.'</b> ' . $whos_online['ip_address'];
+   echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
+  // Display User Agent
+   echo '<b>' . TEXT_USER_AGENT . ':</b> ' . $whos_online['user_agent'];
+   echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
+  // Display Session ID.  Bots with no Session ID, have it set to their IP address.  Don't display these.
+   if ( $whos_online['session_id'] != $whos_online['ip_address'] ) {
+      echo '<b>' . TEXT_OSCID . ':</b> ' . $whos_online['session_id'];
+      echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
+   }
+  // Display Referer if available
+   if($whos_online['http_referer'] != "" ) {
+      echo '<b>'.TEXT_REFERER.'</b> ' . $whos_online['http_referer']; 
+      echo '<br clear="all">' . tep_draw_separator('pixel_trans.gif', '10', '4') . '<br clear="all">';
+   }
+}
+
+
+  // Time to remove old entries
+  $xx_mins_ago = (time() - $track_time);
+
+// remove entries that have expired
+  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+
+<!-- WOL 1.6 - Cleaned up refresh -->
+<?php if( $_SERVER["QUERY_STRING"] > 0 ){  ?>
+  <meta http-equiv="refresh" content="<?php echo $_SERVER["QUERY_STRING"];?>;URL=whos_online.php?<?php echo $_SERVER["QUERY_STRING"];?>">
+<?php } ?>
+<!-- WOL 1.6 EOF -->
+
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="bottom" class="pageHeading">
+            <?php echo HEADING_TITLE; ?>
+            <br clear="all"><span class="smallText" style="color:#909090"><?php echo TEXT_SET_REFRESH_RATE; ?>:</span>
+            <span class="dataTableContent" style="font-size: 10px; color:#000000">
+            <!-- For loop displays refresh time links -->
+            <?php
+              echo '<a href="whos_online.php"><b>None</b></a>';
+              foreach ($refresh_time as $key => $value) {
+                echo ' &#183; <a href="whos_online.php?' . $value . '"><b>' . $refresh_display[$key] . '</b></a>';
+              }
+            ?>
+<script language="JavaScript">
+<!-- Begin
+Stamp = new Date();
+document.write('&nbsp;&nbsp;-&nbsp;&nbsp;Last Refresh: ' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear() + '&nbsp;&nbsp;');
+var Hours;
+var Mins;
+var Time;
+Hours = Stamp.getHours();
+if (Hours >= 12) {
+Time = " p.m.";
+}
+else {
+Time = " a.m.";
+}
+if (Hours > 12) {
+Hours -= 12;
+}
+if (Hours == 0) {
+Hours = 12;
+}
+Mins = Stamp.getMinutes();
+if (Mins < 10) {
+Mins = "0" + Mins;
+} 
+document.write('<strong>' + Hours + ":" + Mins + Time + '</strong>');
+// End -->
+</script>           
+            
+            <!-- Display Profile links -->
+            <br clear="all">
+            <span class="smallText" style="color:#909090"><?php echo TEXT_PROFILE_DISPLAY; ?>:</span>
+            <a href="whos_online.php"><b><?php echo TEXT_NONE_; ?></b></a> &#183; 
+            <a href="whos_online.php?showAll"><b><?php echo TEXT_ALL; ?></b></a> &#183; 
+            <a href="whos_online.php?showBots"><b><!-- Bots --><?php echo TEXT_BOTS?></b></a> &#183; 
+            <a href="whos_online.php?showCust"><b><!-- Customers --><?php echo TEXT_CUSTOMERS?></b></a>
+            </span>
+            </td>
+            <!-- Status Legend - Uses variables for image names -->
+            <td rowspan="2" align="right" class="smallText">
+              <table border="0" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="smallText"><?php echo
+                  tep_image(DIR_WS_IMAGES . $status_active_cart, TEXT_STATUS_ACTIVE_CART) . '&nbsp;' . TEXT_STATUS_ACTIVE_CART . '&nbsp;&nbsp;';
+              ?></td>
+                <td class="smallText"><?php echo
+                  tep_image(DIR_WS_IMAGES . $status_inactive_cart, TEXT_STATUS_INACTIVE_CART) . '&nbsp;' . TEXT_STATUS_INACTIVE_CART . '&nbsp;&nbsp;';
+              ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><?php echo
+                  tep_image(DIR_WS_IMAGES . $status_active_nocart, TEXT_STATUS_ACTIVE_NOCART) . '&nbsp;' . TEXT_STATUS_ACTIVE_NOCART   .'&nbsp;&nbsp;';
+              ?></td>
+                <td class="smallText"><?php echo
+                  tep_image(DIR_WS_IMAGES . $status_inactive_nocart, TEXT_STATUS_INACTIVE_NOCART) . '&nbsp;' . TEXT_STATUS_INACTIVE_NOCART   . '&nbsp;&nbsp;';
+              ?></td>
+              </tr>
+              <tr>
+                <td class="smallText"><?php echo
+                  tep_image(DIR_WS_IMAGES . $status_active_bot, TEXT_STATUS_ACTIVE_BOT) . '&nbsp;' . TEXT_STATUS_ACTIVE_BOT . '&nbsp;&nbsp;';
+              ?></td>
+                <td class="smallText"><?php echo
+                  tep_image(DIR_WS_IMAGES . $status_inactive_bot, TEXT_STATUS_INACTIVE_BOT) . '&nbsp;' . TEXT_STATUS_INACTIVE_BOT . '&nbsp;&nbsp;';
+             ?></td>
+             </tr>
+             </table>
+           </td>
+         </tr>
+         <tr>
+           <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
+           </td>
+         </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td>&nbsp;</td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ONLINE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FULL_NAME; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_IP_ADDRESS; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ENTRY_TIME; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LAST_CLICK; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LAST_PAGE_URL; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_USER_SESSION; ?>&nbsp;</td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_HTTP_REFERER; ?>&nbsp;</td>
+              </tr>
+
+<?php
+  // Order by is on Last Click. Also initialize total_bots and total_admin counts 
+  $whos_online_query = tep_db_query("select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, http_referer, user_agent, session_id from " . TABLE_WHOS_ONLINE . ' order by time_last_click DESC');
+  $total_bots=0;
+  $total_admin=0;
+  $total_guests=0;
+  $total_loggedon=0;
+  $i=0;
+  
+  while ($whos_online = tep_db_fetch_array($whos_online_query)) {
+  
+    $time_online = ($whos_online['time_last_click'] - $whos_online['time_entry']);
+    if ((!isset($HTTP_GET_VARS['info']) || (isset($HTTP_GET_VARS['info']) && ($HTTP_GET_VARS['info'] == $whos_online['session_id']))) && !isset($info)) {
+      $info = $whos_online['session_id'];
+    }
+
+/* BEGIN COUNT MOD */
+    if ($old_array['ip_address'] == $whos_online['ip_address']) {
+      $i++;
+    }
+/* END COUNT MOD */
+
+    if ($whos_online['session_id'] == $info) {
+       if($whos_online['http_referer'] != "")
+       {
+        $http_referer_url = $whos_online['http_referer'];
+       }
+      echo '<tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
+    } else {
+      echo '<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_WHOS_ONLINE, tep_get_all_get_params(array('info', 'action')) . 'info=' . $whos_online['session_id'], 'NONSSL') . '\'">' . "\n";
+    }
+
+   // Display Status
+   //   Check who it is and set values
+    $is_bot = $is_admin = $is_guest = $is_account = false;
+    // Bot detection
+    if ($whos_online['customer_id'] < 0) {
+      $total_bots++;
+      $fg_color = $fg_color_bot;
+      $is_bot = true;
+      // Admin detection
+    } elseif ($whos_online['ip_address'] == tep_get_ip_address() ) { //$_SERVER["REMOTE_ADDR"]) {
+      $total_admin++;
+      $fg_color = $fg_color_admin;
+      $is_admin = true;
+    // Guest detection (may include Bots not detected by Prevent Spider Sessions/spiders.txt)
+    } elseif ($whos_online['customer_id'] == 0) {
+      $fg_color = $fg_color_guest;
+      $is_guest = true;
+      $total_guests++;
+    // Everyone else (should only be account holders)
+    } else {
+      $fg_color = $fg_color_account;
+      $is_account = true;
+      $total_loggedon++;
+    }
+?>
+                <!-- Status Light Column -->
+                <td class="dataTableContent" align="left" valign="top">
+                  <?php echo '&nbsp;' . tep_check_cart($whos_online['session_id'], $whos_online['customer_id'], $whos_online['session_id']); ?>
+                </td>
+
+                <!-- Time Online Column -->
+                <td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">
+                  <?php echo gmdate('H:i:s', $time_online); ?>
+                </font>&nbsp;</td>
+
+                <!-- Name Column -->
+                <td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">
+                  <?php
+                  // WOL 1.6 Restructured to Check for Guest or Admin
+                  if ( $is_guest || $is_admin ) 
+                  { 
+                    echo $whos_online['full_name'] . '&nbsp;';
+                  // Check for Bot
+                  } elseif ( $is_bot ) { 
+                    // Tokenize UserAgent and try to find Bots name
+                    $tok = strtok($whos_online['full_name']," ();/");
+                    while ($tok) {
+                      if ( strlen($tok) > 3 )
+                        if ( !strstr($tok, "mozilla") && 
+                             !strstr($tok, "compatible") &&
+                             !strstr($tok, "msie") &&
+                             !strstr($tok, "windows") 
+                           ) {
+                          echo "$tok";
+                          break;
+                        }
+                      $tok = strtok(" ();/");
+                    }
+                  // Check for Account
+                  } elseif ( $is_account ) {
+                    echo '<a HREF="customers.php?selected_box=customers&cID=' . $whos_online['customer_id'] . '&action=edit">' . $whos_online['full_name'] . '</a>';
+                  } else {
+                    echo TEXT_ERROR;
+                  }
+                  ?>
+                </font>&nbsp;</td>   
+
+                <!-- IP Address Column -->
+                <td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">
+                  <?php
+                  // Show 'Admin' instead of IP for Admin
+                  if ( $is_admin ) 
+                    echo TEXT_ADMIN;
+                  else
+                    // Show IP with link to IP checker
+                    echo '<a HREF="http://www.showmyip.com/?ip=' . $whos_online['ip_address'] . '" target="_blank">' . $whos_online['ip_address'] . '</a>';
+                  ?>
+                </font>&nbsp;</td>
+
+                <!-- Time Entry Column -->
+                <td class="dataTableContent" valign="top"><font color="<?php echo $fg_color; ?>">
+                  <?php echo date('H:i:s', $whos_online['time_entry']); ?>
+                </font></td>
+
+                <!-- Last Click Column -->
+                <td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">
+                  <?php echo date('H:i:s', $whos_online['time_last_click']); ?>
+                </font>&nbsp;</td>
+
+                <!-- Last URL Column -->
+                <td class="dataTableContent" valign="top">
+                <?php 
+                $temp_url_link = $whos_online['last_page_url'];
+                if (eregi('^(.*)' . tep_session_name() . '=[a-f,0-9]+[&]*(.*)', $whos_online['last_page_url'], $array)) {
+                  $temp_url_display =  $array[1] . $array[2];
+                } else {
+                  $temp_url_display = $whos_online['last_page_url'];
+                }
+                // WOL 1.6 - Removes osCid from the Last Click URL and the link
+                if ( $osCsid_position = strpos($temp_url_display, "osCsid") )
+                  $temp_url_display = substr_replace($temp_url_display, "", $osCsid_position - 1 );
+                if ( $osCsid_position = strpos($temp_url_link, "osCsid") )
+                  $temp_url_link = substr_replace($temp_url_link, "", $osCsid_position - 1 );
+                ?>
+                  <a HREF="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . $temp_url_link; ?>" target=\"_blank\">
+                    <font color="<?php echo $fg_color; ?>">
+                      <?php 
+                        echo $temp_url_display;
+                      ?>
+                    </font>
+                  </a>
+                </td>
+
+                <!-- osCsid? Column -->
+                <td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">
+                  <?php
+                  if($whos_online['session_id'] != $whos_online['ip_address']) {
+                      echo 'Y';
+                  } else {
+                      echo "&nbsp;";
+                  }
+                  ?>
+                </font></td>
+
+                <!-- Referer? Column -->
+                <td class="dataTableContent" align="center" valign="top"><font color="<?php echo $fg_color; ?>">
+                  <?php
+                  if($whos_online['http_referer'] == "") {
+                      echo '&nbsp;';
+                  } else {
+                      echo TEXT_HTTP_REFERER_FOUND;
+                  }
+                  ?>
+                </font></td>
+              </tr>
+
+              <tr class="dataTableRow">
+                <td class="dataTableContent" colspan="3"></td>
+                <td class="dataTableContent" colspan="6"><font color="<?php echo $fg_color; ?>">
+                <?php 
+                // Display Details for All
+                if ( $_SERVER["QUERY_STRING"] == showAll ) {
+                  display_details();
+                }
+                // Display Details for Bots
+                else if( $_SERVER["QUERY_STRING"] == showBots ){
+                  if ( $is_bot ) {
+                    display_details();
+                  }
+                } 
+                // Display Details for Customers
+                else if( $_SERVER["QUERY_STRING"] == showCust ){
+                  if ( $is_guest || $is_account || $is_admin ) {
+                    display_details();
+                  }
+                } 
+            ?>
+            </font></td>
+            </tr>
+
+<?php
+ $old_array = $whos_online;
+  }
+
+  if (!$i) {
+    $i=0;
+  }
+  $total_dupes = $i;
+  $total_sess = tep_db_num_rows($whos_online_query);
+  // WOL 1.4 - Subtract Bots and Me from Real Customers.  Only subtract me once as Dupes will remove others
+  $total_cust = $total_sess - $total_dupes - $total_bots - ($total_admin > 1? 1 : $total_admin);
+  // WOL 1.4 eof
+?>
+<?php
+  if(isset($http_referer_url))
+  {
+?>
+  <tr>
+  <td class="smallText" colspan="9"><?php echo '<strong>' . TEXT_HTTP_REFERER_URL . ':</strong> ' . $http_referer_url; ?></td>
+  </tr>
+  <?php
+  }
+  if ($total_cust < 0){
+  $total_cust = 0;
+  }
+
+?>
+              <tr>
+<!-- WOL 1.4 - Added Bot and Me counts -->
+                <td class="smallText" colspan="9"><br><?php echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, $total_sess); ?>
+                  <?php echo "<br>" . TEXT_DUPLICATE_IP . ":" . $total_dupes . "<br>" . TEXT_BOTS . ": " . $total_bots . "<br>" . TEXT_ME . ": " . $total_admin . "<br>" . TEXT_REAL_CUSTOMERS . ": " . $total_cust . "<br><br>" . TEXT_YOUR_IP_ADDRESS . ": " .tep_get_ip_address();?></td><!--  //$_SERVER["REMOTE_ADDR"];?></td> -->
+<!-- WOL 1.4 eof -->                
+              </tr>
+            </table></td>
+
+<?php
+  $heading = array();
+  $contents = array();
+  $heading[] = array('text' => '<b>' . TABLE_HEADING_SHOPPING_CART . '</b>');
+  if (isset($info)) {
+    if (STORE_SESSIONS == 'mysql') {
+      $session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $info . "'");
+      $session_data = tep_db_fetch_array($session_data);
+      $session_data = trim($session_data['value']);
+    } else {
+      if ( (file_exists(tep_session_save_path() . '/sess_' . $info)) && (filesize(tep_session_save_path() . '/sess_' . $info) > 0) ) {
+        $session_data = file(tep_session_save_path() . '/sess_' . $info);
+        $session_data = trim(implode('', $session_data));
+      }
+    }
+
+    if ($length = strlen($session_data)) {
+    
+      if (PHP_VERSION < 4) {
+        $start_id = strpos($session_data, 'customer_id[==]s');
+        $start_cart = strpos($session_data, 'cart[==]o');
+        $start_currency = strpos($session_data, 'currency[==]s');
+        $start_country = strpos($session_data, 'customer_country_id[==]s');
+        $start_zone = strpos($session_data, 'customer_zone_id[==]s');
+      } else {
+        $start_id = strpos($session_data, 'customer_id|s');
+        $start_cart = strpos($session_data, 'cart|O');
+        $start_currency = strpos($session_data, 'currency|s');
+        $start_country = strpos($session_data, 'customer_country_id|s');
+        $start_zone = strpos($session_data, 'customer_zone_id|s');
+      }
+
+      for ($i=$start_cart; $i<$length; $i++) {
+        if ($session_data[$i] == '{') {
+          if (isset($tag)) {
+            $tag++;
+          } else {
+            $tag = 1;
+          }
+        } elseif ($session_data[$i] == '}') {
+          $tag--;
+        } elseif ( (isset($tag)) && ($tag < 1) ) {
+          break;
+        }
+      }
+
+      $session_data_id = substr($session_data, $start_id, (strpos($session_data, ';', $start_id) - $start_id + 1));
+      $session_data_cart = substr($session_data, $start_cart, $i);
+      $session_data_currency = substr($session_data, $start_currency, (strpos($session_data, ';', $start_currency) - $start_currency + 1));
+      $session_data_country = substr($session_data, $start_country, (strpos($session_data, ';', $start_country) - $start_country + 1));
+      $session_data_zone = substr($session_data, $start_zone, (strpos($session_data, ';', $start_zone) - $start_zone + 1));
+
+      session_decode($session_data_id);
+      session_decode($session_data_currency);
+      session_decode($session_data_country);
+      session_decode($session_data_zone);
+      session_decode($session_data_cart);
+
+      if (PHP_VERSION < 4) {
+        $broken_cart = $cart;
+        $cart = new shoppingCart;
+        $cart->unserialize($broken_cart);
+      }
+
+      if (is_object($cart)) {
+        $products = $cart->get_products();
+        for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
+          $contents[] = array('text' => $products[$i]['quantity'] . ' x ' . $products[$i]['name']);
+        }
+
+        if (sizeof($products) > 0) {
+         $contents[] = array('text' => tep_draw_separator('pixel_black.gif', '100%', '1'));
+         $contents[] = array('align' => 'right', 'text'  => TEXT_SHOPPING_CART_SUBTOTAL . ' ' . $currencies->format($cart->show_total(), true, $currency));
+        } else {
+         $contents[] = array('text' => 'Empty');
+      }
+    }
+  }
+ }
+   // Show shopping cart contents for selected entry
+   echo '            <td valign="top">' . "\n";
+
+   $box = new box;
+   echo $box->infoBox($heading, $contents);
+
+   echo '</td>' . "\n";
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/worldpay_help.php
===================================================================
--- trunk/direct.openmoko.com/admin/worldpay_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/worldpay_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+
+If you have installed a previous version of Worldpay 4.0, you must uninstall that version first.  To do this, go to the admin control, select payments and click the red button beside Worldpay.  Follow the instructions below to upgrade.
+
+THE FOLLOWING INSTALLATIONS INSTRUCTIONS ARE FOR THE BASIC FUNCTIONALITY OF USING WORLDPAY 
+- IF YOU WANT TO USE MD5 OR PRE-AUTH, YOU ARE OWN YOUR OWN!
+
+1. Backup everything - That is Catalog, and database.
+2. You do not need to do this edit as it is now hard coded
+3. Go to the worldpay admin screen (www.worldpay.com/admin)
+4. Enter the name and password given to you from Worldpay
+5. In the WorldPay admin screen first enter the Callback URL as follows:
+
+************************************************************************
+IMPORTANT: CALLBACK URL MUST BE SET EXACTLY - INCLUDING CASE - to:
+
+If you ARE using SSL for the checkout procedure 
+
+  https://<wpdisplay item="MC_callback">
+
+If you are NOT using SSL for the checkout procedure 
+
+  http://<wpdisplay item="MC_callback">
+
+NOTE: THIS IS DIFFERENT TO EARLIER RELEASES OF THIS CONTRIBUTION.
+
+************************************************************************
+
+6. Make these additional changes in the WorldPay Admin if not already set:
+
+  Check Callback Enabled? - ie ensure that it is ticked.
+  Check Use callback response? - ie ensure that it is ticked.
+
+  Ensure Callback suspended is unchecked - this automatically selects if callback fails.
+
+  Do not use callback passwords - it is not enabled!
+
+6. Make sure you have Backed up your cart and data.
+
+7. Extract the files in this archive to the relevant locations.  The location pathnames have
+been saved in the archive.
+
+Note that there are 2 Language files (one for the Payment Screens and one for the Callback), 
+plus 2 other key program files.
+
+8. Log onto your site, and go to the Admin section and activate Worldpay payment type, by 
+clicking on the red button. Enter your Worldpay ID and the mode (100=test credit card is 
+authorised, 101=test credit card is not authorised and 0=live)
+
+9. Test using mode 100 or 101 first. If you use Pre-Authorisation, and wish to use it select
+True, followed by E to pre-authorise all transactions.

Added: trunk/direct.openmoko.com/admin/xsell_products.php
===================================================================
--- trunk/direct.openmoko.com/admin/xsell_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/xsell_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,334 @@
+<?php
+/*
+  $Id: xsell_products.php,v 1.1.1.1 2004/03/04 23:39:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+Released under the GNU General Public License
+xsell.php
+Original Idea From Isaac Mualem im at imwebdesigning.com <mailto:im at imwebdesigning.com>
+Complete Recoding From Stephen Walker admin at snjcomputers.com
+  Modified by Andrew Edmond (osc at aravia.com)
+  Sept 16th, 2002
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_CLASSES . 'currencies.php');
+   $currencies = new currencies();
+  switch($_GET['action']){
+    case 'update_cross' :
+    if ($_POST['product']){
+      foreach ($_POST['product'] as $temp_prod){
+          tep_db_query('delete from ' . TABLE_PRODUCTS_XSELL . ' where xsell_id = "'.$temp_prod.'" and products_id = "'.$_GET['add_related_product_ID'].'"');
+      }
+    }
+
+    $sort_start_query = tep_db_query('select sort_order from ' . TABLE_PRODUCTS_XSELL . ' where products_id = "'.$_GET['add_related_product_ID'].'" order by sort_order desc limit 1');
+        $sort_start = tep_db_fetch_array($sort_start_query);
+
+      $sort = (($sort_start['sort_order'] > 0) ? $sort_start['sort_order'] : '0');
+    if ($_POST['cross']){
+        foreach ($_POST['cross'] as $temp){
+      $sort++;
+      $insert_array = array();
+      $insert_array = array('products_id' => $_GET['add_related_product_ID'],
+                          'xsell_id' => $temp,
+                          'sort_order' => $sort);
+              tep_db_perform(TABLE_PRODUCTS_XSELL, $insert_array);
+    }
+    }
+        $messageStack->add('search', CROSS_SELL_SUCCESS, 'success');
+     break;
+    case 'update_sort' :
+        foreach ($_POST as $key_a => $value_a){
+         tep_db_query('update ' . TABLE_PRODUCTS_XSELL . ' set sort_order = "' . $value_a . '" where xsell_id = "' . $key_a . '"');
+      }
+        $messageStack->add('search', SORT_CROSS_SELL_SUCCESS, 'success');
+     break;
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<style>
+.productmenutitle{
+cursor:pointer;
+margin-bottom: 0px;
+background-color:orange;
+color:#FFFFFF;
+font-weight:bold;
+font-family:ms sans serif;
+width:100%;
+padding:3px;
+font-size:12px;
+text-align:center;
+/*/*/border:1px solid #000000;/* */
+}
+.productmenutitle1{
+cursor:pointer;
+margin-bottom: 0px;
+background-color: red;
+color:#FFFFFF;
+font-weight:bold;
+font-family:ms sans serif;
+width:100%;
+padding:3px;
+font-size:12px;
+text-align:center;
+/*/*/border:1px solid #000000;/* */
+}
+</style>
+<script language="JavaScript1.2">
+
+function cOn(td)
+{
+if(document.getElementById||(document.all && !(document.getElementById)))
+{
+td.style.backgroundColor="#CCCCCC";
+}
+}
+
+function cOnA(td)
+{
+if(document.getElementById||(document.all && !(document.getElementById)))
+{
+td.style.backgroundColor="#CCFFFF";
+}
+}
+
+function cOut(td)
+{
+if(document.getElementById||(document.all && !(document.getElementById)))
+{
+td.style.backgroundColor="DFE4F4";
+}
+}
+</script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+ <tr>
+  <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+  </table></td>
+  <td width="100%" valign="top">
+<!-- body_text //-->
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+   <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10');?></td>
+   </tr>
+   <tr>
+    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+   </tr>
+   <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '15');?></td>
+   </tr>
+  </table>
+
+<?php
+  if ($_GET['add_related_product_ID'] == ''){
+?>
+  <table border="0" cellspacing="1" cellpadding="2" bgcolor="#999999" align="center">
+   <tr class="dataTableHeadingRow">
+    <td class="dataTableHeadingContent" width="75"><?php echo TABLE_HEADING_PRODUCT_ID;?></td>
+    <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT_MODEL;?></td>
+    <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT_NAME;?></td>
+    <td class="dataTableHeadingContent" nowrap><?php echo TABLE_HEADING_CURRENT_SELLS;?></td>
+    <td class="dataTableHeadingContent" colspan="2" nowrap align="center"><?php echo TABLE_HEADING_UPDATE_SELLS;?></td>
+   </tr>
+<?php
+    $products_query_raw = 'select p.products_id, p.products_model, pd.products_name, p.products_id from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by p.products_id asc';
+    $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);
+    $products_query = tep_db_query($products_query_raw);
+    while ($products = tep_db_fetch_array($products_query)) {
+?>
+   <tr onMouseOver="cOn(this); this.style.cursor='pointer'; this.style.cursor='hand';" onMouseOut="cOut(this);" bgcolor='#DFE4F4' onClick=document.location.href="<?php echo tep_href_link(FILENAME_XSELL_PRODUCTS, 'add_related_product_ID=' . $products['products_id'], 'NONSSL');?>">
+    <td class="dataTableContent" valign="top">&nbsp;<?php echo $products['products_id'];?>&nbsp;</td>
+    <td class="dataTableContent" valign="top">&nbsp;<?php echo $products['products_model'];?>&nbsp;</td>
+    <td class="dataTableContent" valign="top">&nbsp;<?php echo $products['products_name'];?>&nbsp;</td>
+    <td class="dataTableContent" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+    $products_cross_query = tep_db_query('select p.products_id, p.products_model, pd.products_name, p.products_id, x.products_id, x.xsell_id, x.sort_order, x.ID from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRODUCTS_XSELL.' x where x.xsell_id = p.products_id and x.products_id = "'.$products['products_id'].'" and p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by x.sort_order asc');
+  $i=0;
+    while ($products_cross = tep_db_fetch_array($products_cross_query)){
+    $i++;
+?>
+   <tr>
+    <td class="dataTableContent">&nbsp;<?php echo $i . '.&nbsp;&nbsp;<b>' . $products_cross['products_model'] . '</b>&nbsp;' . $products_cross['products_name'];?>&nbsp;</td>
+   </tr>
+<?php
+  }
+    if ($i <= 0){
+?>
+   <tr>
+    <td class="dataTableContent">&nbsp;--&nbsp;</td>
+   </tr>
+<?php
+  }else{
+?>
+   <tr>
+    <td class="dataTableContent"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10');?></td>
+   </tr>
+<?php
+}
+?>
+    </table></td>
+    <td class="dataTableContent" valign="top">&nbsp;<a href="<?php echo tep_href_link(FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'add_related_product_ID=' . $products['products_id'], 'NONSSL');?>"><?php echo TEXT_EDIT_SELLS;?></a>&nbsp;</td>
+    <td class="dataTableContent" valign="top" align="center">&nbsp;<?php echo (($i > 0) ? '<a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'sort=1&add_related_product_ID=' . $products['products_id'], 'NONSSL') .'">'.TEXT_SORT.'</a>&nbsp;' : '--')?></td>
+   </tr>
+<?php
+  }
+?>
+   <tr>
+    <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent">
+     <tr>
+      <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+      <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td>
+     </tr>
+    </table></td>
+   </tr>
+  </table>
+<?php
+}elseif($_GET['add_related_product_ID'] != '' && $_GET['sort'] == ''){
+  $products_name_query = tep_db_query('select pd.products_name, p.products_model, p.products_image from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = "'.$_GET['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id ="'.(int)$languages_id.'"');
+  $products_name = tep_db_fetch_array($products_name_query);
+?>
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999" align="center">
+   <tr>
+    <td><?php echo tep_draw_form('update_cross', FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=update_cross', 'post');?><table cellpadding="1" cellspacing="1" border="0">
+   <tr>
+    <td colspan="6"><table cellpadding="3" cellspacing="0" border="0" width="100%">
+     <tr class="dataTableHeadingRow">
+      <td valign="top" align="center" colspan="2"><span class="pageHeading"><?php echo TEXT_SETTING_SELLS . '&nbsp;' . $products_name['products_name'].' ('.TEXT_MODEL.': '.$products_name['products_model'].') ('.TEXT_PRODUCT_ID.': '.$_GET['add_related_product_ID'].')';?></span></td>
+     </tr>
+     <tr class="dataTableHeadingRow">
+      <td align="right"><?php echo tep_image('../images/'.$products_name['products_image']);?></td>
+      <td align="right" valign="bottom"><?php echo tep_image_submit('button_update.gif') . '<br><br><a href="'.tep_href_link(FILENAME_XSELL_PRODUCTS, 'men_id=catalog').'">' . tep_image_button('button_cancel.gif') . '</a>';?></td>
+     </tr>
+    </table></td>
+   </tr>
+     <tr class="dataTableHeadingRow">
+      <td class="dataTableHeadingContent" width="75">&nbsp;<?php echo TABLE_HEADING_PRODUCT_ID;?>&nbsp;</td>
+      <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT_MODEL;?>&nbsp;</td>
+    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT_IMAGE;?>&nbsp;</td>
+    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_CROSS_SELL_THIS;?>&nbsp;</td>
+      <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT_NAME;?>&nbsp;</td>
+    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT_PRICE;?>&nbsp;</td>
+   </tr>
+<?php
+    $products_query_raw = 'select p.products_id, p.products_model, p.products_image, p.products_price, pd.products_name, p.products_id from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by p.products_id asc';
+    $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);
+    $products_query = tep_db_query($products_query_raw);
+    while ($products = tep_db_fetch_array($products_query)) {
+    $xsold_query = tep_db_query('select * from '.TABLE_PRODUCTS_XSELL.' where products_id = "'.$_GET['add_related_product_ID'].'" and xsell_id = "'.$products['products_id'].'"');
+?>
+   <tr bgcolor='#DFE4F4'>
+    <td class="dataTableContent" align="center">&nbsp;<?php echo $products['products_id'];?>&nbsp;</td>
+    <td class="dataTableContent" align="center">&nbsp;<?php echo $products['products_model'];?>&nbsp;</td>
+    <td class="dataTableContent" align="center">&nbsp;<?php echo ((is_file('../images/'.$products['products_image'])) ?  tep_image('../images/'.$products['products_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) : '<br>No Image<br>');?>&nbsp;</td>
+    <td class="dataTableContent">&nbsp;<?php echo tep_draw_hidden_field('product[]', $products['products_id']) . tep_draw_checkbox_field('cross[]', $products['products_id'], ((tep_db_num_rows($xsold_query) > 0) ? true : false), '', ' onMouseOver="this.style.cursor=\'hand\'"');?>&nbsp;<label onMouseOver="this.style.cursor='hand'"><?php echo TEXT_CROSS_SELL;?></label>&nbsp;</td>
+    <td class="dataTableContent">&nbsp;<?php echo $products['products_name'];?>&nbsp;</td>
+    <td class="dataTableContent">&nbsp;<?php echo $currencies->format($products['products_price']);?>&nbsp;</td>
+   </tr>
+<?php
+    }
+?>
+  </table></form></td>
+   </tr>
+   <tr>
+    <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent">
+     <tr>
+      <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
+      <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td>
+     </tr>
+    </table></td>
+   </tr>
+  </table>
+<?php
+}elseif($_GET['add_related_product_ID'] != '' && $_GET['sort'] != ''){
+  $products_name_query = tep_db_query('select pd.products_name, p.products_model, p.products_image from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = "'.$_GET['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id ="'.(int)$languages_id.'"');
+  $products_name = tep_db_fetch_array($products_name_query);
+?>
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999" align="center">
+   <tr>
+    <td><?php echo tep_draw_form('update_sort', FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=update_sort', 'post');?><table cellpadding="1" cellspacing="1" border="0">
+   <tr>
+    <td colspan="6"><table cellpadding="3" cellspacing="0" border="0" width="100%">
+     <tr class="dataTableHeadingRow">
+      <td valign="top" align="center" colspan="2"><span class="pageHeading"><?php echo TEXT_SETTING_SELLS.': '.$products_name['products_name'].' ('.TEXT_MODEL.': '.$products_name['products_model'].') ('.TEXT_PRODUCT_ID.': '.$_GET['add_related_product_ID'].')';?></span></td>
+     </tr>
+     <tr class="dataTableHeadingRow">
+      <td align="right"><?php echo tep_image('../images/'.$products_name['products_image']);?></td>
+      <td align="right" valign="bottom"><?php echo tep_image_submit('button_update.gif') . '<br><br><a href="'.tep_href_link(FILENAME_XSELL_PRODUCTS, 'men_id=catalog').'">' . tep_image_button('button_cancel.gif') . '</a>';?></td>
+     </tr>
+    </table></td>
+   </tr>
+     <tr class="dataTableHeadingRow">
+    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT_ID;?>&nbsp;</td>
+    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT_MODEL;?>&nbsp;</td>
+    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT_IMAGE;?>&nbsp;</td>
+    <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_PRODUCT_NAME;?>&nbsp;</td>
+    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT_PRICE;?>&nbsp;</td>
+    <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_PRODUCT_SORT;?>&nbsp;</td>
+   </tr>
+<?php
+    $products_query_raw = 'select p.products_id as products_id, p.products_price, p.products_image, p.products_model, pd.products_name, p.products_id, x.products_id as xproducts_id, x.xsell_id, x.sort_order, x.ID from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRODUCTS_XSELL.' x where x.xsell_id = p.products_id and x.products_id = "'.$_GET['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by x.sort_order asc';
+    $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);
+  $sort_order_drop_array = array();
+  for($i=1;$i<=$products_query_numrows;$i++){
+  $sort_order_drop_array[] = array('id' => $i, 'text' => $i);
+  }
+    $products_query = tep_db_query($products_query_raw);
+ while ($products = tep_db_fetch_array($products_query)){
+?>
+   <tr bgcolor='#DFE4F4'>
+    <td class="dataTableContent" align="center">&nbsp;<?php echo $products['products_id'];?>&nbsp;</td>
+    <td class="dataTableContent" align="center">&nbsp;<?php echo $products['products_model'];?>&nbsp;</td>
+    <td class="dataTableContent" align="center">&nbsp;<?php echo ((is_file('../images/'.$products['products_image'])) ?  tep_image('../images/'.$products['products_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) : '<br>'.TEXT_NO_IMAGE.'<br>');?>&nbsp;</td>
+    <td class="dataTableContent" align="center">&nbsp;<?php echo $products['products_name'];?>&nbsp;</td>
+    <td class="dataTableContent" align="center">&nbsp;<?php echo $currencies->format($products['products_price']);?>&nbsp;</td>
+    <td class="dataTableContent" align="center">&nbsp;<?php echo tep_draw_pull_down_menu($products['products_id'], $sort_order_drop_array, $products['sort_order']);?>&nbsp;</td>
+     </tr>
+<?php
+}
+?>
+    </table></form></td>
+   </tr>
+   <tr>
+    <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent">
+     <tr>
+      <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+      <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td>
+     </tr>
+    </table></td>
+   </tr>
+  </table>
+<?php
+}
+?>
+<!-- body_text_eof //-->
+  </td>
+ </tr>
+</table>
+<!-- body_eof //-->
+<!-- footer //-->
+<?php include(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php include(DIR_WS_INCLUDES . 'application_bottom.php');?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/admin/zones.php
===================================================================
--- trunk/direct.openmoko.com/admin/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/admin/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,199 @@
+<?php
+/*
+  $Id: zones.php,v 1.1.1.1 2004/03/04 23:39:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
+
+  if (tep_not_null($action)) {
+    switch ($action) {
+      case 'insert':
+        $zone_country_id = tep_db_prepare_input($HTTP_POST_VARS['zone_country_id']);
+        $zone_code = tep_db_prepare_input($HTTP_POST_VARS['zone_code']);
+        $zone_name = tep_db_prepare_input($HTTP_POST_VARS['zone_name']);
+
+        tep_db_query("insert into " . TABLE_ZONES . " (zone_country_id, zone_code, zone_name) values ('" . (int)$zone_country_id . "', '" . tep_db_input($zone_code) . "', '" . tep_db_input($zone_name) . "')");
+
+        tep_redirect(tep_href_link(FILENAME_ZONES));
+        break;
+      case 'save':
+        $zone_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+        $zone_country_id = tep_db_prepare_input($HTTP_POST_VARS['zone_country_id']);
+        $zone_code = tep_db_prepare_input($HTTP_POST_VARS['zone_code']);
+        $zone_name = tep_db_prepare_input($HTTP_POST_VARS['zone_name']);
+
+        tep_db_query("update " . TABLE_ZONES . " set zone_country_id = '" . (int)$zone_country_id . "', zone_code = '" . tep_db_input($zone_code) . "', zone_name = '" . tep_db_input($zone_name) . "' where zone_id = '" . (int)$zone_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $zone_id));
+        break;
+      case 'deleteconfirm':
+        $zone_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
+
+        tep_db_query("delete from " . TABLE_ZONES . " where zone_id = '" . (int)$zone_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page']));
+        break;
+    }
+  }
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script language="javascript" src="includes/menu.js"></script>
+<script language="javascript" src="includes/general.js"></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY_NAME; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ZONE_NAME; ?></td>
+                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ZONE_CODE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $zones_query_raw = "select z.zone_id, c.countries_id, c.countries_name, z.zone_name, z.zone_code, z.zone_country_id from " . TABLE_ZONES . " z, " . TABLE_COUNTRIES . " c where z.zone_country_id = c.countries_id order by c.countries_name, z.zone_name";
+  $zones_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
+  $zones_query = tep_db_query($zones_query_raw);
+  while ($zones = tep_db_fetch_array($zones_query)) {
+    if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $zones['zone_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
+      $cInfo = new objectInfo($zones);
+    }
+
+    if (isset($cInfo) && is_object($cInfo) && ($zones['zone_id'] == $cInfo->zone_id)) {
+      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id . '&action=edit') . '\'">' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $zones['zone_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"><?php echo $zones['countries_name']; ?></td>
+                <td class="dataTableContent"><?php echo $zones['zone_name']; ?></td>
+                <td class="dataTableContent" align="center"><?php echo $zones['zone_code']; ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($zones['zone_id'] == $cInfo->zone_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $zones['zone_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $zones_split->display_count($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ZONES); ?></td>
+                    <td class="smallText" align="right"><?php echo $zones_split->display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+<?php
+  if (empty($action)) {
+?>
+                  <tr>
+                    <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_zone.gif', IMAGE_NEW_ZONE) . '</a>'; ?></td>
+                  </tr>
+<?php
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_ZONE . '</b>');
+
+      $contents = array('form' => tep_draw_form('zones', FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert'));
+      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_NAME . '<br>' . tep_draw_input_field('zone_name'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_CODE . '<br>' . tep_draw_input_field('zone_code'));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . tep_draw_pull_down_menu('zone_country_id', tep_get_countries()));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . '&nbsp;<a href="' . tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'edit':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_ZONE . '</b>');
+
+      $contents = array('form' => tep_draw_form('zones', FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id . '&action=save'));
+      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_NAME . '<br>' . tep_draw_input_field('zone_name', $cInfo->zone_name));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_CODE . '<br>' . tep_draw_input_field('zone_code', $cInfo->zone_code));
+      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . tep_draw_pull_down_menu('zone_country_id', tep_get_countries(), $cInfo->countries_id));
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    case 'delete':
+      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ZONE . '</b>');
+
+      $contents = array('form' => tep_draw_form('zones', FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id . '&action=deleteconfirm'));
+      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
+      $contents[] = array('text' => '<br><b>' . $cInfo->zone_name . '</b>');
+      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
+      break;
+    default:
+      if (isset($cInfo) && is_object($cInfo)) {
+        $heading[] = array('text' => '<b>' . $cInfo->zone_name . '</b>');
+
+        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_ZONES_NAME . '<br>' . $cInfo->zone_name . ' (' . $cInfo->zone_code . ')');
+        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . ' ' . $cInfo->countries_name);
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/advanced_search.php
===================================================================
--- trunk/direct.openmoko.com/advanced_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/advanced_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: advanced_search.php,v 1.1.1.1 2004/03/04 23:37:53 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH));
+
+  $content = CONTENT_ADVANCED_SEARCH;
+  $javascript = $content . '.js.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/advanced_search_result.php
===================================================================
--- trunk/direct.openmoko.com/advanced_search_result.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/advanced_search_result.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: advanced_search_result.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  
+  Copyright &copy; 2005-2006
+  
+  Last Modified By : $Author$
+  Last Modified On : $Date$
+  Latest Revision : $Revision: 2633 $
+  
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);
+
+  $error = false;
+
+  if ( (isset($HTTP_GET_VARS['keywords']) && empty($HTTP_GET_VARS['keywords'])) &&
+       (isset($HTTP_GET_VARS['dfrom']) && (empty($HTTP_GET_VARS['dfrom']) || ($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING))) &&
+       (isset($HTTP_GET_VARS['dto']) && (empty($HTTP_GET_VARS['dto']) || ($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING))) &&
+       (isset($HTTP_GET_VARS['pfrom']) && !is_numeric($HTTP_GET_VARS['pfrom'])) &&
+       (isset($HTTP_GET_VARS['pto']) && !is_numeric($HTTP_GET_VARS['pto'])) ) {
+    $error = true;
+
+    $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
+  } else {
+    $dfrom = '';
+    $dto = '';
+    $pfrom = '';
+    $pto = '';
+    $keywords = '';
+
+    if (isset($HTTP_GET_VARS['dfrom'])) {
+      $dfrom = (($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dfrom']);
+    }
+
+    if (isset($HTTP_GET_VARS['dto'])) {
+      $dto = (($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dto']);
+    }
+
+    if (isset($HTTP_GET_VARS['pfrom'])) {
+      $pfrom = $HTTP_GET_VARS['pfrom'];
+    }
+
+    if (isset($HTTP_GET_VARS['pto'])) {
+      $pto = $HTTP_GET_VARS['pto'];
+    }
+    // VJ guest pricing begin
+    // ADDED for ViewPrice
+    if ((tep_not_null($pfrom) || tep_not_null($pto)) && (PRICES_LOGGED_IN == 'true') && (!tep_session_is_registered('customer_id'))){
+      $error = true;
+    //  $messageStack->add_session('search', 'You must be logged in to search for prices.');
+        $messageStack->add_session('search', VIEWPRICE_ERROR);
+    }
+    // END ViewPrice
+    // VJ guest pricing end
+
+    if (isset($HTTP_GET_VARS['keywords'])) {
+      $keywords = $HTTP_GET_VARS['keywords'];
+    }
+
+    $date_check_error = false;
+    if (tep_not_null($dfrom)) {
+      if (!tep_checkdate($dfrom, DOB_FORMAT_STRING, $dfrom_array)) {
+        $error = true;
+        $date_check_error = true;
+
+        $messageStack->add_session('search', ERROR_INVALID_FROM_DATE);
+      }
+    }
+
+    if (tep_not_null($dto)) {
+      if (!tep_checkdate($dto, DOB_FORMAT_STRING, $dto_array)) {
+        $error = true;
+        $date_check_error = true;
+
+        $messageStack->add_session('search', ERROR_INVALID_TO_DATE);
+      }
+    }
+
+    if (($date_check_error == false) && tep_not_null($dfrom) && tep_not_null($dto)) {
+      if (mktime(0, 0, 0, $dfrom_array[1], $dfrom_array[2], $dfrom_array[0]) > mktime(0, 0, 0, $dto_array[1], $dto_array[2], $dto_array[0])) {
+        $error = true;
+
+        $messageStack->add_session('search', ERROR_TO_DATE_LESS_THAN_FROM_DATE);
+      }
+    }
+
+    $price_check_error = false;
+    if (tep_not_null($pfrom)) {
+      if (!settype($pfrom, 'double')) {
+        $error = true;
+        $price_check_error = true;
+
+        $messageStack->add_session('search', ERROR_PRICE_FROM_MUST_BE_NUM);
+      }
+    }
+
+    if (tep_not_null($pto)) {
+      if (!settype($pto, 'double')) {
+        $error = true;
+        $price_check_error = true;
+
+        $messageStack->add_session('search', ERROR_PRICE_TO_MUST_BE_NUM);
+      }
+    }
+
+    if (($price_check_error == false) && is_float($pfrom) && is_float($pto)) {
+      if ($pfrom >= $pto) {
+        $error = true;
+
+        $messageStack->add_session('search', ERROR_PRICE_TO_LESS_THAN_PRICE_FROM);
+      }
+    }
+
+    if (tep_not_null($keywords)) {
+      if (!tep_parse_search_string($keywords, $search_keywords)) {
+        $error = true;
+
+        $messageStack->add_session('search', ERROR_INVALID_KEYWORDS);
+      }
+    }
+  }
+
+  if (empty($dfrom) && empty($dto) && empty($pfrom) && empty($pto) && empty($keywords)) {
+    $error = true;
+
+    $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
+  }
+
+  if ($error == true) {
+    tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(), 'NONSSL', true, false));
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, tep_get_all_get_params(), 'NONSSL', true, false));
+
+  $content = CONTENT_ADVANCED_SEARCH_RESULT;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/affiliate_affiliate.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_affiliate.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
+    $affiliate_username = tep_db_prepare_input($HTTP_POST_VARS['affiliate_username']);
+    $affiliate_password = tep_db_prepare_input($HTTP_POST_VARS['affiliate_password']);
+
+// Check if username exists
+    $check_affiliate_query = tep_db_query("select affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . tep_db_input($affiliate_username) . "'");
+    if (!tep_db_num_rows($check_affiliate_query)) {
+      $HTTP_GET_VARS['login'] = 'fail';
+    } else {
+      $check_affiliate = tep_db_fetch_array($check_affiliate_query);
+// Check that password is good
+      if (!tep_validate_password($affiliate_password, $check_affiliate['affiliate_password'])) {
+        $HTTP_GET_VARS['login'] = 'fail';
+      } else {
+        $affiliate_id = $check_affiliate['affiliate_id'];
+        tep_session_register('affiliate_id');
+
+        $date_now = date('Ymd');
+
+        tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_date_of_last_logon = now(), affiliate_number_of_logons = affiliate_number_of_logons + 1 where affiliate_id = '" . $affiliate_id . "'");
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_SUMMARY,'','SSL'));
+      }
+    }
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+
+
+  $content = CONTENT_AFFILIATE;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_BANNERS));
+
+  $affiliate_banners_values = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_title");
+
+  $content = CONTENT_AFFILIATE_BANNERS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/affiliate_banners_banners.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_banners_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_banners_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,135 @@
+<?php
+/*
+  $Id: affiliate_banners_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS_BANNERS);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_BANNERS_BANNERS));
+
+  $affiliate_banners_values = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_title");
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" height="28" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'affiliate_links.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+    <tr>
+            <td colspan=2 class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table>
+  </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table width="100%" align="center" border="0" cellpadding="0" cellspacing="0"><td>
+<?php
+  if (tep_db_num_rows($affiliate_banners_values)) {
+
+    while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_values)) {
+      $prod_id = $affiliate_banners['affiliate_products_id'];
+      $ban_id = $affiliate_banners['affiliate_banners_id'];
+      switch (AFFILIATE_KIND_OF_BANNERS) {
+        case 1: // Link to Products
+          if ($prod_id < 1) {
+            $link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
+            $link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
+      }
+          break;
+        case 2: // Link to Products
+          if ($prod_id < 1) {
+            $link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
+            $link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
+      }
+          break;
+      }
+
+          if ($prod_id < 1) {
+?>
+      <tr>
+        <td><table width="95%" align="center" border="0" cellpadding="4" cellspacing="0" class="infoBoxContents">
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_NAME; ?>&nbsp;<?php echo $affiliate_banners['affiliate_banners_title']; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center"><br><?php echo $link; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center">
+      <textarea cols="60" rows="4" class="boxText"><?php echo $link1; ?></textarea> 
+   </td> 
+          </tr>
+          </table>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+<?php }
+   }
+}
+?>
+          </table>
+   </td>
+      </tr>
+     </table></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_banners_build.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_banners_build.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_banners_build.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,169 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS_BUILD);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD));
+
+  $affiliate_banners_values = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_title");
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<script type="text/javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=300,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" height="28" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'affiliate_links.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        <tr>
+            <td colspan=2 class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table>
+     </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table width="95%" align="center" border="0" cellpadding="4" cellspacing="0"><td>
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER . ' ' . $affiliate_banners['affiliate_banners_title']; ?></td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+          <tr>
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO . tep_draw_form('individual_banner', tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD) ) . "\n" . tep_draw_input_field('individual_banner_id', '', 'size="5"') . "&nbsp;&nbsp;" . tep_image_submit('button_affiliate_build_a_link.gif', IMAGE_BUTTON_BUILD_A_LINK); ?></form></td>
+          </tr>
+     <tr>
+       <td class="smallText" align="center"><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_VALIDPRODUCTS) . '\')"><b>' . TEXT_AFFILIATE_VALIDPRODUCTS . '</b></a>'; ?>&nbsp;&nbsp;<?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW;?><br><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP;?></td>
+     </tr>
+     <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if (tep_not_null($HTTP_POST_VARS['individual_banner_id']) || tep_not_null($HTTP_GET_VARS['individual_banner_id'])) {
+
+    if (tep_not_null($HTTP_POST_VARS['individual_banner_id'])) $individual_banner_id = $HTTP_POST_VARS['individual_banner_id'];
+    if ($HTTP_GET_VARS['individual_banner_id']) $individual_banner_id = $HTTP_GET_VARS['individual_banner_id'];
+    $affiliate_pbanners_values = tep_db_query("select p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$individual_banner_id . "' and pd.products_id = '" . (int)$individual_banner_id . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'");
+    if ($affiliate_pbanners = tep_db_fetch_array($affiliate_pbanners_values)) {
+      switch (AFFILIATE_KIND_OF_BANNERS) {
+        case 1:
+        $link = '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_pbanners['products_image'] . '" border="0" alt="' . $affiliate_pbanners['products_name'] . '"></a>';
+        $link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_pbanners['products_image'] . '" border="0" alt="' . $affiliate_pbanners['products_name'] . '"></a>';
+        $link2 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank">' . $affiliate_pbanners['products_name'] . '</a>'; 
+      break; 
+      case 2: 
+   // Link to Products 
+        $link = '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_pbanner_id=' . $individual_banner_id . '" border="0" alt="' . $affiliate_pbanners['products_name'] . '"></a>';
+        $link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_pbanner_id=' . $individual_banner_id . '" border="0" alt="' . $affiliate_pbanners['products_name'] . '"></a>';
+        $link2 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank">' . $affiliate_pbanners['products_name'] . '</a>'; 
+      break; 
+     } 
+} 
+?>
+      <tr>
+        <td><table width="100%" align="center" border="0" cellpadding="4" cellspacing="0" class="infoBoxContents">
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_NAME; ?>&nbsp;<?php echo $affiliate_pbanners['products_name']; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center"><?php echo $link; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"> 
+             <textarea cols="60" rows="4" class="boxText"><?php echo $link1; ?></textarea> 
+            </td> 
+          </tr> 
+          <tr> 
+            <td>&nbsp;<td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><b>Text Version:</b> <?php echo $link2; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"> 
+             <textarea cols="60" rows="3" class="boxText"><?php echo $link2; ?></textarea> 
+            </td> 
+          </tr>
+          </table>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+<?php
+}
+?>
+   </td></tr>
+   </td>
+      </tr></table>
+   </td>
+      </tr> 
+     </table></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_banners_build_cat.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_banners_build_cat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_banners_build_cat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,188 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS_BUILD_CAT);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD_CAT));
+
+  $affiliate_banners_values = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_title");
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<?php
+// BOF: WebMakers.com Changed: Header Tag Controller v1.0
+if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
+    require(DIR_WS_INCLUDES . 'header_tags.php');
+  } else {
+    ?> 
+      <title><?php echo TITLE; ?></title>
+      <?php
+    }
+    if (DISPLAY_DHTML_MENU == 'CoolMenu') {
+        echo '<script type="text/javascript" SRC="includes/coolMenu.js"></SCRIPT>';
+      }
+      // EOF: WebMakers.com Changed: Header Tag Controller v1.0
+      ?>
+    
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<script type="text/javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=300,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<?php 
+if (DISPLAY_DHTML_MENU == 'CoolMenu') {
+    require(DIR_WS_INCLUDES . 'coolmenu.php'); 
+  }
+  ?>
+  <!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" height="28" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'affiliate_links.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        <tr>
+            <td colspan=2 class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table>
+     </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table width="95%" align="center" border="0" cellpadding="4" cellspacing="0"><td>
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER . ' ' . $affiliate_banners['affiliate_banners_title']; ?></td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+          <tr>
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO . tep_draw_form('individual_banner', tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD_CAT) ) . "\n" . tep_draw_input_field('individual_banner_id', '', 'size="5"') . "&nbsp;&nbsp;" . tep_image_submit('button_affiliate_build_a_link.gif', IMAGE_BUTTON_BUILD_A_LINK); ?></form></td>
+          </tr>
+     <tr>
+       <td class="smallText" align="center"><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_VALIDCATS) . '\')"><b>' . TEXT_AFFILIATE_VALIDPRODUCTS . '</b></a>'; ?>&nbsp;&nbsp;<?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW;?><br><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP;?></td>
+     </tr>
+     <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if (tep_not_null($HTTP_POST_VARS['individual_banner_id']) || tep_not_null($HTTP_GET_VARS['individual_banner_id'])) {
+
+    if (tep_not_null($HTTP_POST_VARS['individual_banner_id'])) $individual_banner_id = $HTTP_POST_VARS['individual_banner_id'];
+    if ($HTTP_GET_VARS['individual_banner_id']) $individual_banner_id = $HTTP_GET_VARS['individual_banner_id'];
+    $affiliate_pbanners_values = tep_db_query("select c.categories_image, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$individual_banner_id . "' and cd.categories_id = '" . (int)$individual_banner_id . "' and cd.language_id = '" . (int)$languages_id . "'");
+    if ($affiliate_pbanners = tep_db_fetch_array($affiliate_pbanners_values)) {
+      switch (AFFILIATE_KIND_OF_BANNERS) {
+        case 1:
+        $link = '<a href="' . HTTPS_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_pbanners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_pbanners['categories_name'] . '"></a>';
+        $link1 = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_pbanners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_pbanners['categories_name'] . '"></a>';
+        $link2 = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank">' . $affiliate_pbanners['categories_name'] . '</a>'; 
+      break; 
+      case 2: 
+   // Link to Products 
+        $link = '<a href="' . HTTPS_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_pbanner_id=' . $individual_banner_id . '" border="0" alt="' . $affiliate_pbanners['categories_name'] . '"></a>';
+        $link1 = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_pbanner_id=' . $individual_banner_id . '" border="0" alt="' . $affiliate_pbanners['categories_name'] . '"></a>';
+        $link2 = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank">' . $affiliate_pbanners['categories_name'] . '</a>'; 
+      break; 
+     } 
+} 
+?>
+      <tr>
+        <td><table width="100%" align="center" border="0" cellpadding="4" cellspacing="0" class="infoBoxContents">
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_NAME; ?>&nbsp;<?php echo $affiliate_pbanners['categories_name']; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center"><?php echo $link; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"> 
+             <textarea cols="60" rows="4" class="boxText"><?php echo $link1; ?></textarea> 
+            </td> 
+          </tr> 
+          <tr> 
+            <td><td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><b><!-- Text Version: --><?php echo TEXT_VERSION;?></b> <?php echo $link2; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"> 
+             <textarea cols="60" rows="3" class="boxText"><?php echo $link2; ?></textarea> 
+            </td> 
+          </tr>
+          </table>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+<?php
+}
+?>
+   </td></tr>
+   </td>
+      </tr></table>
+   </td>
+      </tr> 
+     </table></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/affiliate_banners_category.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_banners_category.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_banners_category.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,174 @@
+<?php
+/*
+  $Id: affiliate_banner_category.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS_CATEGORY);
+
+  $location = ' &raquo; <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_CATEGORY, '', 'NONSSL') . '" class="headerNavigation">' . NAVBAR_TITLE . '</a>';
+
+// $affiliate_values = tep_db_query("select * from " . TABLE_AFFILIATE . " where affiliate_id = '" . (int)$affiliate_id . "'");
+
+  $affiliate_banners_values = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " where affiliate_category_id >'0' order by affiliate_banners_title");
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<?php
+// BOF: WebMakers.com Changed: Header Tag Controller v1.0
+if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
+    require(DIR_WS_INCLUDES . 'header_tags.php');
+  } else {
+    ?> 
+      <title><?php echo TITLE; ?></title>
+      <?php
+    }
+    if (DISPLAY_DHTML_MENU == 'CoolMenu') {
+        echo '<SCRIPT LANGUAGE="JavaScript1.2" SRC="includes/coolMenu.js"></SCRIPT>';
+      }
+      // EOF: WebMakers.com Changed: Header Tag Controller v1.0
+      ?>
+    
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<?php 
+if (DISPLAY_DHTML_MENU == 'CoolMenu') {
+    require(DIR_WS_INCLUDES . 'coolmenu.php'); 
+  }
+  ?>
+  <!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" height="28" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'affiliate_links.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+    <tr>
+            <td colspan=2 class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table>
+  </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table width="100%" align="center" border="0" cellpadding="0" cellspacing="0"><td>
+<?php
+  if (tep_db_num_rows($affiliate_banners_values)) {
+
+    while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_values)) {
+      $affiliate_categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $affiliate_banners['affiliate_category_id'] . "' and language_id = '" . (int)$languages_id . "'");
+      $affiliate_categories = tep_db_fetch_array($affiliate_categories_query);
+      $prod_id = $affiliate_banners['affiliate_category_id'];
+      $ban_id = $affiliate_banners['affiliate_banners_id'];
+      switch (AFFILIATE_KIND_OF_BANNERS) {
+        case 1: // Link to Categories
+          if ($prod_id > 0) {
+            $link = '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_categories['categories_name'] . '"></a>';
+            $link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_categories['categories_name'] . '"></a>';
+            $link2 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $affiliate_categories['categories_name'] . '</a>';
+      }
+          break;
+        case 2: // Link to Categories
+          if ($prod_id > 0) {
+            $link = '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_categories['categories_name'] . '"></a>';
+            $link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_categories['categories_name'] . '"></a>';
+            $link2 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $affiliate_categories['categories_name'] . '</a>';
+      }
+          break;
+      }
+
+          if ($prod_id > 0) {
+?>
+        <table width="95%" align="center" border="0" cellpadding="4" cellspacing="0" class="infoBoxContents">
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_NAME; ?>&nbsp;<?php echo $affiliate_banners['affiliate_banners_title']; ?></td>
+          </tr>
+          <tr> 
+            <td class="smallText" align="center"><?php echo $link; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"> 
+             <textarea cols="60" rows="4" class="boxText"><?php echo $link1; ?></textarea> 
+   </td> 
+          </tr> 
+          <tr> 
+            <td>&nbsp;<td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><b><?php echo TEXT_VERSION;?></b> <?php echo $link2; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"> 
+             <textarea cols="60" rows="3" class="boxText"><?php echo $link2; ?></textarea> 
+   </td> 
+          </tr>
+          </table>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+
+<?php }
+}
+}
+?>
+          </table>
+   </td>
+      </tr>
+     </table></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_banners_product.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_banners_product.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_banners_product.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,155 @@
+<?php
+/*
+  $Id: affiliate_banner_product.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS_PRODUCT);
+
+  $location = ' &raquo; <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_PRODUCT, '', 'NONSSL') . '" class="headerNavigation">' . NAVBAR_TITLE . '</a>';
+
+// $affiliate_values = tep_db_query("select * from " . TABLE_AFFILIATE . " where affiliate_id = '" . (int)$affiliate_id . "'");
+
+  $affiliate_banners_values = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " where affiliate_products_id >'0' order by affiliate_banners_title");
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" height="28" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'affiliate_links.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+    <tr>
+            <td colspan=2 class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table>
+  </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table width="100%" align="center" border="0" cellpadding="0" cellspacing="0"><td>
+<?php
+  if (tep_db_num_rows($affiliate_banners_values)) {
+
+    while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_values)) {
+      $affiliate_products_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $affiliate_banners['affiliate_products_id'] . "' and language_id = '" . (int)$languages_id . "'");
+      $affiliate_products = tep_db_fetch_array($affiliate_products_query);
+      $prod_id = $affiliate_banners['affiliate_products_id'];
+      $ban_id = $affiliate_banners['affiliate_banners_id'];
+      switch (AFFILIATE_KIND_OF_BANNERS) {
+        case 1: // Link to Products
+          if ($prod_id > 0) {
+            $link = '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
+            $link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
+            $link2 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $affiliate_products['products_name'] . '</a>';
+      }
+          break;
+        case 2: // Link to Products
+          if ($prod_id > 0) {
+            $link = '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
+            $link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
+            $link2 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $affiliate_products['products_name'] . '</a>';
+      }
+          break;
+      }
+
+          if ($prod_id > 0) {
+?>
+        <table width="95%" align="center" border="0" cellpadding="4" cellspacing="0" class="infoBoxContents">
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_NAME; ?>&nbsp;<?php echo $affiliate_banners['affiliate_banners_title']; ?></td>
+          </tr>
+          <tr> 
+            <td class="smallText" align="center"><?php echo $link; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"> 
+             <textarea cols="60" rows="4" class="boxText"><?php echo $link1; ?></textarea> 
+   </td> 
+          </tr> 
+          <tr> 
+            <td>&nbsp;<td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><b><?php echo TEXT_VERSION;?></b> <?php echo $link2; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"> 
+             <textarea cols="60" rows="3" class="boxText"><?php echo $link2; ?></textarea> 
+   </td> 
+          </tr>
+          </table>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+
+<?php }
+}
+}
+?>
+          </table>
+   </td>
+      </tr>
+     </table></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_banners_text.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_banners_text.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_banners_text.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,148 @@
+<?php
+/*
+  $Id: affiliate_banners_text.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS_TEXT);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_BANNERS_TEXT));
+
+  $affiliate_banners_values = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_title");
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" height="28" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'affiliate_links.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+    <tr>
+            <td colspan=2 class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table>
+  </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table width="100%" align="center" border="0" cellpadding="0" cellspacing="0"><td>
+<?php 
+if (tep_db_num_rows($affiliate_banners_values)) { 
+
+   while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_values)) { 
+$prod_id=$affiliate_banners['affiliate_products_id']; 
+$prod_name=$affiliate_banners['affiliate_banners_title']; 
+$ban_id=$affiliate_banners['affiliate_banners_id']; 
+    switch (AFFILIATE_KIND_OF_BANNERS) { 
+     case 1: 
+   // Link to Products 
+   if ($prod_id>0) { 
+
+    $link= '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0"></a>'; 
+    $link2= '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $prod_name . '</a>'; 
+   } 
+   // generic_link 
+   else { 
+    $link= '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0"></a>'; 
+    $link2= '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $prod_name . '</a>'; 
+             } 
+   break; 
+  case 2: 
+   // Link to Products 
+   if ($prod_id>0) { 
+
+    $link= '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0"></a>'; 
+    $link2= '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $prod_name . '</a>'; 
+   } 
+   // generic_link 
+   else { 
+    $link= '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0"></a>'; 
+    $link2= '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $prod_name . '</a>'; 
+             } 
+   break;  
+     } 
+
+?>
+        <table width="95%" align="center" border="0" cellpadding="4" cellspacing="0" class="infoBoxContents">
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_NAME; ?>&nbsp;<?php echo $affiliate_banners['affiliate_banners_title']; ?></td>
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><b><?php echo TEXT_VERSION;?></b> <?php echo $link2; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td> 
+          </tr> 
+          <tr> 
+            <td class="smallText" align="center"> 
+             <textarea cols="50" rows="3" class="boxText"><?php echo $link2; ?></textarea> 
+   </td> 
+          </tr>
+          </table>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+<?php
+   }
+}
+?>
+          </table>
+   </td>
+      </tr>
+     </table></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_CLICKS);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'));
+/*
+  $affiliate_clickthroughs_raw = "
+  select a.*, pd.products_name from
+    " . TABLE_AFFILIATE_CLICKTHROUGHS . " a, 
+    " . TABLE_PRODUCTS . " p ,
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+    where a.affiliate_id = '" . $affiliate_id . "' and
+    a.affiliate_products_id = p.products_id and
+    p.products_id = pd.products_id and
+    pd.language_id = '" . $languages_id . "'
+    ORDER BY a.affiliate_clientdate desc
+    ";
+*/
+  $affiliate_clickthroughs_raw = "select ac.*, pd.products_name from
+" . TABLE_AFFILIATE_CLICKTHROUGHS . " ac left join 
+" . TABLE_PRODUCTS . " p on ac.affiliate_products_id = p.products_id left join
+" . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "'
+where
+ac.affiliate_id = '" .$affiliate_id . "'
+ORDER BY ac.affiliate_clientdate desc";
+
+  $affiliate_clickthroughs_split = new splitPageResults($affiliate_clickthroughs_raw, MAX_DISPLAY_SEARCH_RESULTS);
+
+  $content = CONTENT_AFFILIATE_CLICKS;
+  $javascript = CONTENT_AFFILIATE_SUMMARY . '.js.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_CONTACT);
+
+  $error = false;
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
+    if (tep_validate_email(trim($HTTP_POST_VARS['email']))) {
+      tep_mail(STORE_OWNER, AFFILIATE_EMAIL_ADDRESS, EMAIL_SUBJECT, $HTTP_POST_VARS['enquiry'], $HTTP_POST_VARS['name'], $HTTP_POST_VARS['email']);
+      tep_redirect(tep_href_link(FILENAME_AFFILIATE_CONTACT, 'action=success'));
+    } else {
+      $error = true;
+    }
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_CONTACT));
+
+  $affiliate_values = tep_db_query("select * from " . TABLE_AFFILIATE . " where affiliate_id = '" . (int)$affiliate_id . "'");
+  $affiliate = tep_db_fetch_array($affiliate_values);
+
+  $content = CONTENT_AFFILIATE_CONTACT;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+
+?>

Added: trunk/direct.openmoko.com/affiliate_details.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,283 @@
+<?php
+/*
+  $Id: affiliate_details.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+  
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_DETAILS);
+
+  if (isset($HTTP_POST_VARS['action'])) {
+    $a_gender = tep_db_prepare_input($HTTP_POST_VARS['a_gender']);
+    $a_firstname = tep_db_prepare_input($HTTP_POST_VARS['a_firstname']);
+    $a_lastname = tep_db_prepare_input($HTTP_POST_VARS['a_lastname']);
+    $a_dob = tep_db_prepare_input($HTTP_POST_VARS['a_dob']);
+    $a_email_address = tep_db_prepare_input($HTTP_POST_VARS['a_email_address']);
+    $a_company = tep_db_prepare_input($HTTP_POST_VARS['a_company']);
+    $a_company_taxid = tep_db_prepare_input($HTTP_POST_VARS['a_company_taxid']);
+    $a_payment_check = tep_db_prepare_input($HTTP_POST_VARS['a_payment_check']);
+    $a_payment_paypal = tep_db_prepare_input($HTTP_POST_VARS['a_payment_paypal']);
+    $a_payment_bank_name = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_name']);
+    $a_payment_bank_branch_number = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_branch_number']);
+    $a_payment_bank_swift_code = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_swift_code']);
+    $a_payment_bank_account_name = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_account_name']);
+    $a_payment_bank_account_number = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_account_number']);
+    $a_street_address = tep_db_prepare_input($HTTP_POST_VARS['a_street_address']);
+    $a_suburb = tep_db_prepare_input($HTTP_POST_VARS['a_suburb']);
+    $a_postcode = tep_db_prepare_input($HTTP_POST_VARS['a_postcode']);
+    $a_city = tep_db_prepare_input($HTTP_POST_VARS['a_city']);
+    $a_country=tep_db_prepare_input($HTTP_POST_VARS['a_country']);
+    $a_zone_id = tep_db_prepare_input($HTTP_POST_VARS['a_zone_id']);
+    $a_state = tep_db_prepare_input($HTTP_POST_VARS['a_state']);
+    $a_telephone = tep_db_prepare_input($HTTP_POST_VARS['a_telephone']);
+    $a_fax = tep_db_prepare_input($HTTP_POST_VARS['a_fax']);
+    $a_homepage = tep_db_prepare_input($HTTP_POST_VARS['a_homepage']);
+    $a_password = tep_db_prepare_input($HTTP_POST_VARS['a_password']);
+
+    $error = false; // reset error flag
+
+    if (ACCOUNT_GENDER == 'true') {
+      if (($a_gender == 'm') || ($a_gender == 'f')) {
+        $entry_gender_error = false;
+      } else {
+        $error = true;
+        $entry_gender_error = true;
+      }
+    }
+
+    if (strlen($a_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+      $error = true;
+      $entry_firstname_error = true;
+    } else {
+      $entry_firstname_error = false;
+    }
+
+    if (strlen($a_lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+      $error = true;
+      $entry_lastname_error = true;
+    } else {
+      $entry_lastname_error = false;
+    }
+
+    if (ACCOUNT_DOB == 'true') {
+      if (checkdate(substr(tep_date_raw($a_dob), 4, 2), substr(tep_date_raw($a_dob), 6, 2), substr(tep_date_raw($a_dob), 0, 4))) {
+        $entry_date_of_birth_error = false;
+      } else {
+        $error = true;
+        $entry_date_of_birth_error = true;
+      }
+    }
+  
+    if (strlen($a_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
+      $error = true;
+      $entry_email_address_error = true;
+    } else {
+      $entry_email_address_error = false;
+    }
+
+    if (!tep_validate_email($a_email_address)) {
+      $error = true;
+      $entry_email_address_check_error = true;
+    } else {
+      $entry_email_address_check_error = false;
+    }
+
+    if (strlen($a_street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
+      $error = true;
+      $entry_street_address_error = true;
+    } else {
+      $entry_street_address_error = false;
+    }
+  
+    if (strlen($a_postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
+      $error = true;
+      $entry_post_code_error = true;
+    } else {
+      $entry_post_code_error = false;
+    } 
+
+    if (strlen($a_city) < ENTRY_CITY_MIN_LENGTH) {
+      $error = true;
+      $entry_city_error = true;
+    } else {
+      $entry_city_error = false;
+    }
+
+    if (!$a_country) {
+      $error = true;
+      $entry_country_error = true;
+    } else {
+      $entry_country_error = false;
+    }
+
+    if (ACCOUNT_STATE == 'true') {
+      if ($entry_country_error) {
+        $entry_state_error = true;
+      } else {
+        $a_zone_id = 0;
+        $entry_state_error = false;
+        $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($a_country) . "'");
+        $check_value = tep_db_fetch_array($check_query);
+        $entry_state_has_zones = ($check_value['total'] > 0);
+        if ($entry_state_has_zones) {
+          $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($a_country) . "' and zone_name = '" . tep_db_input($a_state) . "'");
+          if (tep_db_num_rows($zone_query) == 1) {
+            $zone_values = tep_db_fetch_array($zone_query);
+            $a_zone_id = $zone_values['zone_id'];
+          } else {
+            $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($a_country) . "' and zone_code = '" . tep_db_input($a_state) . "'");
+            if (tep_db_num_rows($zone_query) == 1) {
+              $zone_values = tep_db_fetch_array($zone_query);
+              $a_zone_id = $zone_values['zone_id'];
+            } else {
+              $error = true;
+              $entry_state_error = true;
+            }
+          }
+        } else {
+          if (!$a_state) {
+            $error = true;
+            $entry_state_error = true;
+          }
+        }
+      }
+    }
+
+    if (strlen($a_telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
+      $error = true;
+      $entry_telephone_error = true;
+    } else {
+      $entry_telephone_error = false;
+    }
+
+    $passlen = strlen($a_password);
+    if ($passlen < ENTRY_PASSWORD_MIN_LENGTH) {
+      $error = true;
+      $entry_password_error = true;
+    } else {
+      $entry_password_error = false;
+    }
+
+    if ($a_password != $a_confirmation) {
+      $error = true;
+      $entry_password_error = true;
+    }
+
+    $check_email_query = tep_db_query("select count(*) as total from " . TABLE_AFFILIATE . " where affiliate_email_address = '" .  tep_db_input($a_email_address) . "' and affiliate_id != '" . tep_db_input($affiliate_id) . "'");
+    $check_email = tep_db_fetch_array($check_email_query);
+    if ($check_email['total'] > 0) {
+      $error = true;
+      $entry_email_address_exists = true;
+    } else {
+      $entry_email_address_exists = false;
+    }
+
+    // Check Suburb
+    $entry_suburb_error = false;
+
+    // Check Fax
+    $entry_fax_error = false;
+
+    if (!affiliate_check_url($a_homepage)) {
+      $error = true;
+      $entry_homepage_error = true;
+    } else {
+      $entry_homepage_error = false;
+    }
+
+    if (!$a_agb) {
+    $error=true;
+    $entry_agb_error=true;
+    }
+
+    // Check Company 
+    $entry_company_error = false;
+    $entry_company_taxid_error = false;
+
+    // Check Payment
+    $entry_payment_check_error = false;
+    $entry_payment_paypal_error = false;
+    $entry_payment_bank_name_error = false;
+    $entry_payment_bank_branch_number_error = false;
+    $entry_payment_bank_swift_code_error = false;
+    $entry_payment_bank_account_name_error = false;
+    $entry_payment_bank_account_number_error = false;
+
+    if (!$error) {
+
+      $sql_data_array = array('affiliate_firstname' => $a_firstname,
+                              'affiliate_lastname' => $a_lastname,
+                              'affiliate_email_address' => $a_email_address,
+                              'affiliate_payment_check' => $a_payment_check,
+                              'affiliate_payment_paypal' => $a_payment_paypal,
+                              'affiliate_payment_bank_name' => $a_payment_bank_name,
+                              'affiliate_payment_bank_branch_number' => $a_payment_bank_branch_number,
+                              'affiliate_payment_bank_swift_code' => $a_payment_bank_swift_code,
+                              'affiliate_payment_bank_account_name' => $a_payment_bank_account_name,
+                              'affiliate_payment_bank_account_number' => $a_payment_bank_account_number,
+                              'affiliate_street_address' => $a_street_address,
+                              'affiliate_postcode' => $a_postcode,
+                              'affiliate_city' => $a_city,
+                              'affiliate_country_id' => $a_country,
+                              'affiliate_telephone' => $a_telephone,
+                              'affiliate_fax' => $a_fax,
+                              'affiliate_homepage' => $a_homepage,
+                              'affiliate_password' => tep_encrypt_password($a_password),
+                              'affiliate_agb' => '1');
+
+      if (ACCOUNT_GENDER == 'true') $sql_data_array['affiliate_gender'] = $a_gender;
+      if (ACCOUNT_DOB == 'true') $sql_data_array['affiliate_dob'] = tep_date_raw($a_dob);
+      if (ACCOUNT_COMPANY == 'true') {
+        $sql_data_array['affiliate_company'] = $a_company;
+        $sql_data_array['affiliate_company_taxid'] = $a_company_taxid;
+      }
+      if (ACCOUNT_SUBURB == 'true') $sql_data_array['affiliate_suburb'] = $a_suburb;
+      if (ACCOUNT_STATE == 'true') {
+        if ($a_zone_id > 0) {
+          $sql_data_array['affiliate_zone_id'] = $a_zone_id;
+          $sql_data_array['affiliate_state'] = '';
+        } else {
+          $sql_data_array['affiliate_zone_id'] = '0';
+          $sql_data_array['affiliate_state'] = $a_state;
+        }
+      }
+
+      $sql_data_array['affiliate_date_account_last_modified'] = 'now()';
+
+      tep_db_perform(TABLE_AFFILIATE, $sql_data_array, 'update', "affiliate_id = '" . tep_db_input($affiliate_id) . "'");
+
+      tep_redirect(tep_href_link(FILENAME_AFFILIATE_DETAILS_OK, '', 'SSL'));
+    }
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_AFFILIATE_DETAILS, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_AFFILIATE_DETAILS, '', 'SSL'));
+
+
+  $affiliate_query = tep_db_query("select * from " . TABLE_AFFILIATE . " where affiliate_id = '" . (int)$affiliate_id . "'");
+  $affiliate = tep_db_fetch_array($affiliate_query);
+
+
+  $content = CONTENT_AFFILIATE_DETAILS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+
+?>

Added: trunk/direct.openmoko.com/affiliate_details_ok.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_details_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_details_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: affiliate_details_ok.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_DETAILS_OK);
+
+ $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_DETAILS_OK));
+
+ $content = CONTENT_AFFILIATE_SIGNUP_OK ;
+
+require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+?>

Added: trunk/direct.openmoko.com/affiliate_faq.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+
+/*
+
+  $Id: affiliate_faq.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+  OSC-Affiliate
+
+  Contribution based on:
+  osCommerce, Open Source E-Commerce Solutions
+
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+  Released under the GNU General Public License
+
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_FAQ);
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_FAQ));
+
+  $content = CONTENT_AFFILIATE_FAQ; 
+
+  $content_template = TEMPLATENAME_STATIC;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+
+?>

Added: trunk/direct.openmoko.com/affiliate_help1.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate_help1.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => HEADING_SUMMARY_HELP);
+
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_IMPRESSIONS_HELP);
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help10.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help10.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help10.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_CLICKS);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_CLICKTHROUGH_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_CLICKED_PRODUCT_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help11.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help11.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help11.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_CLICKS);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_CLICKTHROUGH_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_REFFERED_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help12.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help12.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help12.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SALES_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_DATE_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help13.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help13.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help13.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SALES_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_SALE_VALUE_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help14.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help14.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help14.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SALES_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_COMMISSION_RATE_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help15.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help15.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help15.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SALES_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_COMMISSION_VALUE_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help16.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help16.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help16.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SALES_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_STATUS_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help17.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help17.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help17.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SUMMARY_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_CLICKTHROUGH_RATE_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help18.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help18.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help18.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SUMMARY_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_PAY_PER_SALE_RATE_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/affiliate_help19.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help19.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help19.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SALES_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_PAYMENT_ID
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/affiliate_help2.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate_help2.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => HEADING_SUMMARY_HELP);
+
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_VISITS_HELP);
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help20.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help20.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help20.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SALES_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_SALES_PAYMENT_DATE
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/affiliate_help21.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help21.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help21.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SALES_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_SALES_PAYMENT_Ammount
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/affiliate_help22.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help22.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help22.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_SALES_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_PAYMENT_STATUS
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/affiliate_help3.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help3.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help3.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate_help3.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => HEADING_SUMMARY_HELP);
+
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_TRANSACTIONS_HELP);
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help4.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help4.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help4.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate_help4.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => HEADING_SUMMARY_HELP);
+
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_CONVERSION_HELP);
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help5.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: affiliate_help5.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc. 
+  
+  $Author$
+  $Date$
+  $Revision: 1940 $ 
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => HEADING_SUMMARY_HELP);
+
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_AMOUNT_HELP);
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help6.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help6.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help6.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate_help6.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => HEADING_SUMMARY_HELP);
+
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_AVERAGE_HELP);
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help7.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help7.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help7.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate_help7.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => HEADING_SUMMARY_HELP);
+
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_COMMISSION_RATE_HELP);
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help8.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help8.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help8.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => HEADING_SUMMARY_HELP);
+
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_COMMISSION_HELP);
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_help9.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_help9.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_help9.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_help8.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_CLICKS);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => HEADING_CLICKTHROUGH_HELP
+                              );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_DATE_HELP
+                              );
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_info.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+
+/*
+  $Id: affiliate_info.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_INFO);
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_INFO));
+
+  $content = CONTENT_AFFILIATE_INFO; 
+
+  $content_template = TEMPLATENAME_STATIC;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+
+?>
+

Added: trunk/direct.openmoko.com/affiliate_logout.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_logout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_logout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+
+/*
+
+  $Id: affiliate_logout.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+
+
+
+  OSC-Affiliate
+
+
+
+  Contribution based on:
+
+
+
+  osCommerce, Open Source E-Commerce Solutions
+
+  http://www.oscommerce.com
+
+
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+
+
+  Released under the GNU General Public License
+
+*/
+
+
+
+
+
+  require('includes/application_top.php');
+
+
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_LOGOUT);
+
+
+
+  $breadcrumb->add(NAVBAR_TITLE);
+
+
+
+  $content = affiliate_logout; 
+
+
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+
+?>

Added: trunk/direct.openmoko.com/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+  $Id: affiliate_news.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_NEWS);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_NEWS));
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'affiliate_news.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+ <tr>
+   <td><br><?php include(DIR_WS_MODULES . FILENAME_AFFILIATE_NEWS); ?></td>
+ </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+        </table></td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,163 @@
+<?php
+/*
+  $Id: affiliate_newsletter.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+// needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_NEWSLETTER);
+
+  $newsletter_query = tep_db_query("select affiliate_newsletter from " . TABLE_AFFILIATE . " where affiliate_id = '" . (int)$affiliate_id . "'");
+  $newsletter = tep_db_fetch_array($newsletter_query);
+
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
+    if (isset($HTTP_POST_VARS['newsletter_affiliate']) && is_numeric($HTTP_POST_VARS['newsletter_affiliate'])) {
+      $newsletter_affiliate = tep_db_prepare_input($HTTP_POST_VARS['newsletter_affiliate']);
+    } else {
+      $newsletter_affiliate = '0';
+    }
+
+    if ($newsletter_affiliate != $newsletter['affiliate_newsletter']) {
+      $newsletter_affiliate = (($newsletter['affiliate_newsletter'] == '1') ? '0' : '1');
+
+      tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_newsletter = '" . (int)$newsletter_affiliate . "' where affiliate_id = '" . (int)$affiliate_id . "'");
+    }
+
+    $messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success');
+
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL'));
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_AFFILIATE_NEWSLETTER, '', 'SSL'));
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<script type="text/javascript"><!--
+function rowOverEffect(object) {
+  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
+}
+
+function checkBox(object) {
+  document.account_newsletter.elements[object].checked = !document.account_newsletter.elements[object].checked;
+}
+//--></script>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><?php echo tep_draw_form('account_newsletter', tep_href_link(FILENAME_AFFILIATE_NEWSLETTER, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'affiliate_notifications.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo MY_NEWSLETTERS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('newsletter_affiliate')">
+                    <td class="main"><?php echo tep_draw_checkbox_field('newsletter_affiliate', '1', (($newsletter['affiliate_newsletter'] == '1') ? true : false), 'onclick="checkBox(\'newsletter_affiliate\')"'); ?></td>
+                    <td class="main"><b><?php echo MY_NEWSLETTERS_AFFILIATE_NEWSLETTER; ?></b></td>
+                  </tr>
+                  <tr>
+                    <td class="main">&nbsp;</td>
+                    <td><table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo MY_NEWSLETTERS_AFFILIATE_NEWSLETTER_DESCRIPTION; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_password.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,185 @@
+<?php
+/*
+  $Id: affiliate_password.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+// needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_PASSWORD);
+
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
+    $password_current = tep_db_prepare_input($HTTP_POST_VARS['password_current']);
+    $password_new = tep_db_prepare_input($HTTP_POST_VARS['password_new']);
+    $password_confirmation = tep_db_prepare_input($HTTP_POST_VARS['password_confirmation']);
+
+    $error = false;
+
+    if (strlen($password_current) < ENTRY_PASSWORD_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('a_password', ENTRY_PASSWORD_CURRENT_ERROR);
+    } elseif (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('a_password', ENTRY_PASSWORD_NEW_ERROR);
+    } elseif ($password_new != $password_confirmation) {
+      $error = true;
+
+      $messageStack->add('a_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
+    }
+
+    if ($error == false) {
+      $check_affiliate_query = tep_db_query("select affiliate_password from " . TABLE_AFFILIATE . " where affiliate_id = '" . (int)$affiliate_id . "'");
+      $check_affiliate = tep_db_fetch_array($check_affiliate_query);
+
+      if (tep_validate_password($password_current, $check_affiliate['affiliate_password'])) {
+        tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_password = '" . tep_encrypt_password($password_new) . "' where affiliate_id = '" . (int)$affiliate_id . "'");
+
+        $messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
+
+        tep_redirect(tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL'));
+      } else {
+        $error = true;
+
+        $messageStack->add('a_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
+      }
+    }
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_AFFILIATE_PASSWORD, '', 'SSL'));
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<?php require('includes/form_check.js.php'); ?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><?php echo tep_draw_form('a_password', tep_href_link(FILENAME_AFFILIATE_PASSWORD, '', 'SSL'), 'post', 'onSubmit="return check_form(a_password);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if ($messageStack->size('a_password') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('a_password'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo MY_PASSWORD_TITLE; ?></b></td>
+                <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="2" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo ENTRY_PASSWORD_CURRENT; ?></td>
+                    <td class="main"><?php echo tep_draw_password_field('password_current') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_CURRENT_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CURRENT_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_PASSWORD_NEW; ?></td>
+                    <td class="main"><?php echo tep_draw_password_field('password_new') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_NEW_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_NEW_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+                    <td class="main"><?php echo tep_draw_password_field('password_confirmation') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: affiliate_password_forgotten.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 -2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_PASSWORD_FORGOTTEN);
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
+    $check_affiliate_query = tep_db_query("select affiliate_firstname, affiliate_lastname, affiliate_password, affiliate_id from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . tep_db_prepare_input($HTTP_POST_VARS['email_address']) . "'");
+    if (tep_db_num_rows($check_affiliate_query)) {
+      $check_affiliate = tep_db_fetch_array($check_affiliate_query);
+      // Crypted password mods - create a new password, update the database and mail it to them
+      $newpass = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
+      $crypted_password = tep_encrypt_password($newpass);
+      tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_password = '" . $crypted_password . "' where affiliate_id = '" . $check_affiliate['affiliate_id'] . "'");
+      
+      tep_mail($check_affiliate['affiliate_firstname'] . " " . $check_affiliate['affiliate_lastname'], $HTTP_POST_VARS['email_address'], EMAIL_PASSWORD_REMINDER_SUBJECT, nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, $newpass)), STORE_OWNER, AFFILIATE_EMAIL_ADDRESS);
+      tep_redirect(tep_href_link(FILENAME_AFFILIATE, 'info_message=' . urlencode(TEXT_PASSWORD_SENT), 'SSL', true, false));
+    } else {
+      tep_redirect(tep_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTEN, 'email=nonexistent', 'SSL'));
+    }
+  } else {
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTEN, '', 'SSL'));
+
+  $content = CONTENT_AFFILIATE_PASSWORD_FORGOTTEN;
+  $javascript = 'popup_window.js';
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_PAYMENT);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'));
+
+  $affiliate_payment_raw = "
+    select p.* , s.affiliate_payment_status_name 
+           from " . TABLE_AFFILIATE_PAYMENT . " p, " . TABLE_AFFILIATE_PAYMENT_STATUS . " s 
+           where p.affiliate_payment_status = s.affiliate_payment_status_id 
+           and s.affiliate_language_id = '" . $languages_id . "' 
+           and p.affiliate_id =  '" . $affiliate_id . "' 
+           order by p.affiliate_payment_id DESC
+           ";
+
+  $affiliate_payment_split = new splitPageResults($affiliate_payment_raw, MAX_DISPLAY_SEARCH_RESULTS);
+
+  $content = CONTENT_AFFILIATE_PAYMENT;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/affiliate_reports.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_reports.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_reports.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,177 @@
+<?php
+/*
+  $Id: shipping.php,v 2.00 2003/10/12
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_REPORTS);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_REPORTS));
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="3">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'affiliate_reports.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+
+      <tr>
+        <td colspan="4"><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
+      </tr>
+      <tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'). '">' . TEXT_AFFILIATE_CLICKS . '</a>';?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+                <td width="60"><img src="images/affiliate_clicks.gif" border="0" alt="" width="60" height="60"></td>
+                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><img src="images/arrow_green.gif" border="0" alt="" width="12" height="10">&nbsp;<?php echo TEXT_INFORMATION_CLICKS ;?></td>
+                    <td width="200" class="main" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL') . '">' . tep_image_button('button_affiliate_clickthroughs.gif', IMAGE_CLICKS) . '</a>';?></td>
+                  </tr>
+                  </table></td>
+               <td width="10" align="right"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+             </tr>
+           </table></td>
+         </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td colspan="4"><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
+      </tr>
+      <tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'). '">' . TEXT_AFFILIATE_SALES . '</a>';?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+                <td width="60"><img src="images/affiliate_sales.gif" border="0" alt="" width="60" height="60"></td>
+                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><img src="images/arrow_green.gif" border="0" alt="" width="12" height="10">&nbsp;<?php echo TEXT_INFORMATION_SALES ;?></td>
+                    <td width="200" class="main" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL') . '">' . tep_image_button('button_affiliate_sales.gif', IMAGE_SALES) . '</a>';?></td>
+                  </tr>
+                  </table></td>
+               <td width="10" align="right"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+             </tr>
+           </table></td>
+         </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td colspan="4"><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
+      </tr>
+      <tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'). '">' . TEXT_AFFILIATE_PAYMENT . '</a>';?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+                <td width="60"><img src="images/affiliate_payment.gif" border="0" alt="" width="60" height="60"></td>
+                <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><img src="images/arrow_green.gif" border="0" alt="" width="12" height="10">&nbsp;<?php echo TEXT_INFORMATION_PAYMENT ;?></td>
+                    <td width="200" class="main" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL') . '">' . tep_image_button('button_affiliate_payment.gif', IMAGE_PAYMENT) . '</a>';?></td>
+                  </tr>
+                  </table></td>
+               <td width="10" align="right"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
+             </tr>
+           </table></td>
+         </tr>
+        </table></td>
+      </tr>
+
+    </table></td>
+<!-- body_text_eof //-->
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+
+/*
+  $Id: affiliate_sales.php,v 1.1.1.1 2004/03/04 23:37:54 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SALES);
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'));
+/*
+  $affiliate_sales_raw = "
+    select  a.*, o.orders_status as orders_status_id, os.orders_status_name as orders_status from " . TABLE_AFFILIATE_SALES . " a, 
+    " . TABLE_ORDERS . " o, 
+    " . TABLE_ORDERS_STATUS . " os
+    where a.affiliate_id = '" . $affiliate_id . "' and
+    o.orders_id = a.affiliate_orders_id and
+    os.orders_status_id and o.orders_status and
+    language_id = '" . $languages_id . "'
+    order by affiliate_date DESC
+    ";
+*/
+  $affiliate_sales_raw = "
+      select asale.*, os.orders_status_name as orders_status, o.orders_status as orders_status_id
+      from " . TABLE_AFFILIATE_SALES . " asale ,
+           " . TABLE_ORDERS . " o,
+           " . TABLE_ORDERS_STATUS . " os,
+           " . TABLE_AFFILIATE . " a
+      where asale.affiliate_id = '" . $affiliate_id . "'
+        and a.affiliate_id = '" . $affiliate_id . "'
+        and asale.affiliate_orders_id = o.orders_id
+        and os.orders_status_id = o.orders_status
+        and language_id = " . $languages_id . "
+      order by affiliate_date desc 
+      ";
+  $affiliate_sales_split = new splitPageResults($affiliate_sales_raw, MAX_DISPLAY_SEARCH_RESULTS);
+  $content = affiliate_sales; 
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+?>

Added: trunk/direct.openmoko.com/affiliate_show_banner.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_show_banner.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_show_banner.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,165 @@
+<?php
+/*
+  $Id: affiliate_show_banner.php,v 1.1.1.1 2004/03/04 23:37:55 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// CHECKIT
+// -> optimize code -> double parts
+
+// require of application_top not possible 
+// cause then whois online registers it also as visitor
+//
+
+  define('TABLE_AFFILIATE_BANNERS_HISTORY', 'affiliate_banners_history');
+  define('TABLE_AFFILIATE_BANNERS', 'affiliate_banners');
+  define('TABLE_PRODUCTS', 'products');
+
+// Set the local configuration parameters - mainly for developers
+  if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');
+  require('includes/configure.php');
+  if (file_exists('includes/local/affiliate_configure.php')) include('includes/local/affiliate_configure.php');
+  require('includes/affiliate_configure.php');
+
+// include the database functions
+  require(DIR_WS_FUNCTIONS . 'database.php');
+// make a connection to the database... now
+ // tep_db_connect() or die('Unable to connect to database server!');
+  tep_db_connect() or die(UNABLE_TO_CONNECT_TO_DATABASE_SERVER);
+
+  function affiliate_show_banner($pic) {
+//Read Pic and send it to browser
+    $fp = fopen($pic, "rb");
+    if (!$fp) exit();
+// Get Image type
+    $img_type = substr($pic, strrpos($pic, ".") + 1);
+// Get Imagename
+    $pos = strrpos($pic, "/");
+    if ($pos) {
+      $img_name = substr($pic, strrpos($pic, "/" ) + 1);
+    } else {
+      $img_name=$pic;
+    }
+    header ("Content-type: image/$img_type");
+    header ("Content-Disposition: inline; filename=$img_name");
+    fpassthru($fp);
+    // The file is closed when fpassthru() is done reading it (leaving handle useless).  
+    // fclose ($fp);
+    exit();
+  }
+
+  function affiliate_debug($banner,$sql) {
+?>
+   <!-- <table border=1 cellpadding=2 cellspacing=2>
+      <tr><td colspan=2>Check the pathes! (catalog/includes/configure.php)</td></tr>
+      <tr><td>absolute path to picture:</td><td><?php echo DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG. DIR_WS_IMAGES . $banner; ?></td></tr>
+      <tr><td>build with:</td><td>DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG . DIR_WS_IMAGES . $banner</td></tr>
+      <tr><td>DIR_FS_DOCUMENT_ROOT</td><td><?php echo DIR_FS_DOCUMENT_ROOT; ?></td></tr>
+      <tr><td>DIR_WS_CATALOG</td><td><?php echo DIR_WS_CATALOG ; ?></td></tr>
+      <tr><td>DIR_WS_IMAGES</td><td><?php echo DIR_WS_IMAGES; ?></td></tr>
+      <tr><td>$banner</td><td><?php echo $banner; ?></td></tr>
+      <tr><td>SQL-Query used:</td><td><?php echo $sql; ?></td></tr>
+      <tr><th>Try to find error:</td><td>&nbsp;</th></tr>
+      <tr><td>SQL-Query:</td><td><?php if ($banner) echo "Got Result"; else echo "No result"; ?></td></tr>
+      <tr><td>Locating Pic</td><td> -->
+
+    <table border=1 cellpadding=2 cellspacing=2>
+      <tr><td colspan=2><?php echo AFFILIATE_SHOW_BANNER_CHECK_PATHES;?></td></tr>
+      <tr><td><?php echo AFFILIATE_SHOW_BANNER_ABSOLUTE_PATH;?></td><td><?php echo DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG. DIR_WS_IMAGES . $banner; ?></td></tr>
+      <tr><td><?php echo AFFILIATE_SHOW_BANNER_BUILD_WITH_1;?></td><td><?php echo AFFILIATE_SHOW_BANNER_BUILD_WITH_2;?></td></tr>
+      <tr><td><?php echo AFFILIATE_SHOW_BANNER_DIR_FS_DOCUMENT_ROOT;?></td><td><?php echo DIR_FS_DOCUMENT_ROOT; ?></td></tr>
+      <tr><td><?php echo AFFILIATE_SHOW_BANNER_DIR_WS_CATALOG;?></td><td><?php echo DIR_WS_CATALOG ; ?></td></tr>
+      <tr><td><?php echo AFFILIATE_SHOW_BANNER_DIR_WS_IMAGES;?></td><td><?php echo DIR_WS_IMAGES; ?></td></tr>
+      <tr><td><?php echo AFFILIATE_SHOW_BANNER_BANNER;?></td><td><?php echo $banner; ?></td></tr>
+      <tr><td><?php echo AFFILIATE_SHOW_BANNER_SQL_QUERY_USED;?></td><td><?php echo $sql; ?></td></tr>
+      <tr><th><?php echo AFFILIATE_SHOW_BANNER_TRY_TO_FIND_ERROR;?></td><td>&nbsp;</th></tr>
+      <tr><td><?php echo AFFILIATE_SHOW_BANNER_SQL_QUERY;?></td><td><?php if ($banner) echo "Got Result"; else echo "No result"; ?></td></tr>
+      <tr><td><?php echo AFFILIATE_SHOW_BANNER_LOCATING_PIC;?></td><td>
+<?php 
+    $pic = DIR_FS_CATALOG . DIR_WS_IMAGES . $banner;
+    echo $pic . "<br>";
+    if (!is_file($pic)) {
+      echo "failed<br>";
+    } else {
+      echo "success<br>";
+    }
+?>
+      </td></tr>
+    </table>
+<?php
+    exit();
+  }
+
+// Register needed Post / Get Variables
+  if ($HTTP_GET_VARS['ref']) $affiliate_id=$HTTP_GET_VARS['ref'];
+  if ($HTTP_POST_VARS['ref']) $affiliate_id=$HTTP_POST_VARS['ref'];
+
+  if ($HTTP_GET_VARS['affiliate_banner_id']) $banner_id = $HTTP_GET_VARS['affiliate_banner_id'];
+  if ($HTTP_POST_VARS['affiliate_banner_id']) $banner_id = $HTTP_POST_VARS['affiliate_banner_id'];
+  if ($HTTP_GET_VARS['affiliate_pbanner_id']) $prod_banner_id = $HTTP_GET_VARS['affiliate_pbanner_id'];
+  if ($HTTP_POST_VARS['affiliate_pbanner_id']) $prod_banner_id = $HTTP_POST_VARS['affiliate_pbanner_id'];
+
+  $banner = '';
+  $products_id = '';
+
+  if ($banner_id) {
+    $sql = "select affiliate_banners_image, affiliate_products_id from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . (int)$banner_id  . "' and affiliate_status = 1";
+    $banner_values = tep_db_query($sql);
+    if ($banner_array = tep_db_fetch_array($banner_values)) {
+      $banner = $banner_array['affiliate_banners_image'];
+      $products_id = $banner_array['affiliate_products_id']; 
+    }
+  }
+
+  if ($prod_banner_id) {
+    $banner_id = 1; // Banner ID for these Banners is one
+    $sql = "select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$prod_banner_id  . "' and products_status = 1";
+    $banner_values = tep_db_query($sql);
+    if ($banner_array = tep_db_fetch_array($banner_values)) {
+      $banner = $banner_array['products_image'];
+      $products_id = (int)$prod_banner_id;
+    }
+  }
+
+// DebugModus
+  if (AFFILIATE_SHOW_BANNERS_DEBUG == 'true') affiliate_debug($banner,$sql);
+
+  if ($banner) {
+    $pic = DIR_FS_CATALOG . DIR_WS_IMAGES . $banner;
+
+    // Show Banner only if it exists:
+    if (is_file($pic)) {
+      $today = date('Y-m-d');
+    // Update stats:
+      if ($affiliate_id) {
+        $banner_stats_query = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . (int)$banner_id  . "' and affiliate_banners_products_id = '" . $products_id ."' and affiliate_banners_affiliate_id = '" . (int)$affiliate_id. "' and affiliate_banners_history_date = '" . $today . "'");
+    // Banner has been shown today 
+        if ($banner_stats_array = tep_db_fetch_array($banner_stats_query)) {
+          tep_db_query("update " . TABLE_AFFILIATE_BANNERS_HISTORY . " set affiliate_banners_shown = affiliate_banners_shown + 1 where affiliate_banners_id = '" . (int)$banner_id  . "' and affiliate_banners_affiliate_id = '" . (int)$affiliate_id. "' and affiliate_banners_products_id = '" . $products_id ."' and affiliate_banners_history_date = '" . $today . "'");
+        } else { // First view of Banner today
+          tep_db_query("insert into " . TABLE_AFFILIATE_BANNERS_HISTORY . " (affiliate_banners_id, affiliate_banners_products_id, affiliate_banners_affiliate_id, affiliate_banners_shown, affiliate_banners_history_date) VALUES ('" . (int)$banner_id  . "', '" .  $products_id ."', '" . (int)$affiliate_id. "', '1', '" . $today . "')");
+        }
+      }
+    // Show Banner
+      affiliate_show_banner($pic);
+    }
+  }
+
+// Show default Banner if none is found
+  if (is_file(AFFILIATE_SHOW_BANNERS_DEFAULT_PIC)) {
+    affiliate_show_banner(AFFILIATE_SHOW_BANNERS_DEFAULT_PIC);
+  } else {
+    echo "<br>"; // Output something to prevent endless loading
+  }
+  exit();
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_signup.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_signup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_signup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,291 @@
+<?php
+/*
+  $Id: affiliate_signup.php,v 1.1.1.1 2004/03/04 23:37:55 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SIGNUP);
+
+  if (isset($HTTP_POST_VARS['action'])) {
+    $a_gender = tep_db_prepare_input($HTTP_POST_VARS['a_gender']);
+    $a_firstname = tep_db_prepare_input($HTTP_POST_VARS['a_firstname']);
+    $a_lastname = tep_db_prepare_input($HTTP_POST_VARS['a_lastname']);
+    $a_dob = tep_db_prepare_input($HTTP_POST_VARS['a_dob']);
+    $a_email_address = tep_db_prepare_input($HTTP_POST_VARS['a_email_address']);
+    $a_company = tep_db_prepare_input($HTTP_POST_VARS['a_company']);
+    $a_company_taxid = tep_db_prepare_input($HTTP_POST_VARS['a_company_taxid']);
+    $a_payment_check = tep_db_prepare_input($HTTP_POST_VARS['a_payment_check']);
+    $a_payment_paypal = tep_db_prepare_input($HTTP_POST_VARS['a_payment_paypal']);
+    $a_payment_bank_name = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_name']);
+    $a_payment_bank_branch_number = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_branch_number']);
+    $a_payment_bank_swift_code = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_swift_code']);
+    $a_payment_bank_account_name = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_account_name']);
+    $a_payment_bank_account_number = tep_db_prepare_input($HTTP_POST_VARS['a_payment_bank_account_number']);
+    $a_street_address = tep_db_prepare_input($HTTP_POST_VARS['a_street_address']);
+    $a_suburb = tep_db_prepare_input($HTTP_POST_VARS['a_suburb']);
+    $a_postcode = tep_db_prepare_input($HTTP_POST_VARS['a_postcode']);
+    $a_city = tep_db_prepare_input($HTTP_POST_VARS['a_city']);
+    $a_country=tep_db_prepare_input($HTTP_POST_VARS['a_country']);
+    $a_zone_id = tep_db_prepare_input($HTTP_POST_VARS['a_zone_id']);
+    $a_state = tep_db_prepare_input($HTTP_POST_VARS['a_state']);
+    $a_telephone = tep_db_prepare_input($HTTP_POST_VARS['a_telephone']);
+    $a_fax = tep_db_prepare_input($HTTP_POST_VARS['a_fax']);
+    $a_homepage = tep_db_prepare_input($HTTP_POST_VARS['a_homepage']);
+    $a_password = tep_db_prepare_input($HTTP_POST_VARS['a_password']);
+
+    $error = false; // reset error flag
+
+    if (ACCOUNT_GENDER == 'true') {
+      if (($a_gender == 'm') || ($a_gender == 'f')) {
+        $entry_gender_error = false;
+      } else {
+        $error = true;
+        $entry_gender_error = true;
+      }
+    }
+
+    if (strlen($a_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+      $error = true;
+      $entry_firstname_error = true;
+    } else {
+      $entry_firstname_error = false;
+    }
+
+    if (strlen($a_lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+      $error = true;
+      $entry_lastname_error = true;
+    } else {
+      $entry_lastname_error = false;
+    }
+
+    if (ACCOUNT_DOB == 'true') {
+      if (checkdate(substr(tep_date_raw($a_dob), 4, 2), substr(tep_date_raw($a_dob), 6, 2), substr(tep_date_raw($a_dob), 0, 4))) {
+        $entry_date_of_birth_error = false;
+      } else {
+        $error = true;
+        $entry_date_of_birth_error = true;
+      }
+    }
+  
+    if (strlen($a_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
+      $error = true;
+      $entry_email_address_error = true;
+    } else {
+      $entry_email_address_error = false;
+    }
+
+    if (!tep_validate_email($a_email_address)) {
+      $error = true;
+      $entry_email_address_check_error = true;
+    } else {
+      $entry_email_address_check_error = false;
+    }
+
+    if (strlen($a_street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
+      $error = true;
+      $entry_street_address_error = true;
+    } else {
+      $entry_street_address_error = false;
+    }
+  
+    if (strlen($a_postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
+      $error = true;
+      $entry_post_code_error = true;
+    } else {
+      $entry_post_code_error = false;
+    } 
+
+    if (strlen($a_city) < ENTRY_CITY_MIN_LENGTH) {
+      $error = true;
+      $entry_city_error = true;
+    } else {
+      $entry_city_error = false;
+    }
+
+    if (!$a_country) {
+      $error = true;
+      $entry_country_error = true;
+    } else {
+      $entry_country_error = false;
+    }
+
+    if (ACCOUNT_STATE == 'true') {
+      if ($entry_country_error) {
+        $entry_state_error = true;
+      } else {
+        $a_zone_id = 0;
+        $entry_state_error = false;
+        $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($a_country) . "'");
+        $check_value = tep_db_fetch_array($check_query);
+        $entry_state_has_zones = ($check_value['total'] > 0);
+        if ($entry_state_has_zones) {
+          $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($a_country) . "' and zone_name = '" . tep_db_input($a_state) . "'");
+          if (tep_db_num_rows($zone_query) == 1) {
+            $zone_values = tep_db_fetch_array($zone_query);
+            $a_zone_id = $zone_values['zone_id'];
+          } else {
+            $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($a_country) . "' and zone_code = '" . tep_db_input($a_state) . "'");
+            if (tep_db_num_rows($zone_query) == 1) {
+              $zone_values = tep_db_fetch_array($zone_query);
+              $a_zone_id = $zone_values['zone_id'];
+            } else {
+              $error = true;
+              $entry_state_error = true;
+            }
+          }
+        } else {
+          if (!$a_state) {
+            $error = true;
+            $entry_state_error = true;
+          }
+        }
+      }
+    }
+
+    if (strlen($a_telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
+      $error = true;
+      $entry_telephone_error = true;
+    } else {
+      $entry_telephone_error = false;
+    }
+
+    $passlen = strlen($a_password);
+    if ($passlen < ENTRY_PASSWORD_MIN_LENGTH) {
+      $error = true;
+      $entry_password_error = true;
+    } else {
+      $entry_password_error = false;
+    }
+
+    if ($a_password != $a_confirmation) {
+      $error = true;
+      $entry_password_error = true;
+    }
+
+    $check_email = tep_db_query("select affiliate_email_address from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . tep_db_input($a_email_address) . "'");
+    if (tep_db_num_rows($check_email)) {
+      $error = true;
+      $entry_email_address_exists = true;
+    } else {
+      $entry_email_address_exists = false;
+    }
+
+    // Check Suburb
+    $entry_suburb_error = false;
+
+    // Check Fax
+    $entry_fax_error = false;
+
+    if (!affiliate_check_url($a_homepage)) {
+      $error = true;
+      $entry_homepage_error = true;
+    } else {
+      $entry_homepage_error = false;
+    }
+
+    if (!$a_agb) {
+    $error=true;
+    $entry_agb_error=true;
+    }
+
+    // Check Company 
+    $entry_company_error = false;
+    $entry_company_taxid_error = false;
+
+    // Check Newsletter 
+    $entry_newsletter_error = false;
+    // Check Payment
+    $entry_payment_check_error = false;
+    $entry_payment_paypal_error = false;
+    $entry_payment_bank_name_error = false;
+    $entry_payment_bank_branch_number_error = false;
+    $entry_payment_bank_swift_code_error = false;
+    $entry_payment_bank_account_name_error = false;
+    $entry_payment_bank_account_number_error = false;
+
+    if (!$error) {
+
+      $sql_data_array = array('affiliate_firstname' => $a_firstname,
+                              'affiliate_lastname' => $a_lastname,
+                              'affiliate_email_address' => $a_email_address,
+                              'affiliate_payment_check' => $a_payment_check,
+                              'affiliate_payment_paypal' => $a_payment_paypal,
+                              'affiliate_payment_bank_name' => $a_payment_bank_name,
+                              'affiliate_payment_bank_branch_number' => $a_payment_bank_branch_number,
+                              'affiliate_payment_bank_swift_code' => $a_payment_bank_swift_code,
+                              'affiliate_payment_bank_account_name' => $a_payment_bank_account_name,
+                              'affiliate_payment_bank_account_number' => $a_payment_bank_account_number,
+                              'affiliate_street_address' => $a_street_address,
+                              'affiliate_postcode' => $a_postcode,
+                              'affiliate_city' => $a_city,
+                              'affiliate_country_id' => $a_country,
+                              'affiliate_telephone' => $a_telephone,
+                              'affiliate_fax' => $a_fax,
+                              'affiliate_homepage' => $a_homepage,
+                              'affiliate_password' => tep_encrypt_password($a_password),
+                              'affiliate_agb' => '1',
+                              'affiliate_newsletter' => $a_newsletter);
+
+      if (ACCOUNT_GENDER == 'true') $sql_data_array['affiliate_gender'] = $a_gender;
+      if (ACCOUNT_DOB == 'true') $sql_data_array['affiliate_dob'] = tep_date_raw($a_dob);
+      if (ACCOUNT_COMPANY == 'true') {
+        $sql_data_array['affiliate_company'] = $a_company;
+        $sql_data_array['affiliate_company_taxid'] = $a_company_taxid;
+      }
+      if (ACCOUNT_SUBURB == 'true') $sql_data_array['affiliate_suburb'] = $a_suburb;
+      if (ACCOUNT_STATE == 'true') {
+        if ($a_zone_id > 0) {
+          $sql_data_array['affiliate_zone_id'] = $a_zone_id;
+          $sql_data_array['affiliate_state'] = '';
+        } else {
+          $sql_data_array['affiliate_zone_id'] = '0';
+          $sql_data_array['affiliate_state'] = $a_state;
+        }
+      }
+
+      $sql_data_array['affiliate_date_account_created'] = 'now()';
+
+      $affiliate_id = affiliate_insert ($sql_data_array, $HTTP_SESSION_VARS['affiliate_ref'] );
+
+      // build the message content
+    $name = $a_firstname . ' ' . $a_lastname;    
+    $email_text = sprintf(MAIL_GREET_NONE, $a_firstname);
+          $email_text .= MAIL_AFFILIATE_HEADER;
+    $email_text .= sprintf(MAIL_AFFILIATE_ID, $affiliate_id);
+    $email_text .= sprintf(MAIL_AFFILIATE_USERNAME, $a_email_address);
+    $email_text .= sprintf(MAIL_AFFILIATE_PASSWORD, $a_password);
+    $email_text .= sprintf(MAIL_AFFILIATE_LINK, HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE) . "\n\n";
+    $email_text .= MAIL_AFFILIATE_FOOTER;
+
+      tep_mail($name, $a_email_address, MAIL_AFFILIATE_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+    
+      tep_session_register('affiliate_id');
+      $affiliate_email = $a_email_address;
+      $affiliate_name = $a_firstname . ' ' . $a_lastname;
+      tep_session_register('affiliate_email');
+      tep_session_register('affiliate_name');
+      tep_redirect(tep_href_link(FILENAME_AFFILIATE_SIGNUP_OK, '', 'SSL'));
+    }
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_SIGNUP, '', 'SSL'));
+
+
+  $content = CONTENT_AFFILIATE_SIGNUP;
+  require('includes/form_check.js.php');
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/affiliate_signup_ok.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_signup_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_signup_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+
+/*
+  $Id: affiliate_signup_ok.php,v 1.1 2004/03/05 01:57:13 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SIGNUP_OK);
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_SIGNUP_OK));
+
+  $content = CONTENT_AFFILIATE_SIGNUP_OK;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+
+?>
+

Added: trunk/direct.openmoko.com/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 1.1.1.1 2004/03/04 23:37:55 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('affiliate_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_SUMMARY);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_SUMMARY));
+
+  $affiliate_banner_history_raw = "select sum(affiliate_banners_shown) as count from " . TABLE_AFFILIATE_BANNERS_HISTORY .  " where affiliate_banners_affiliate_id  = '" . (int)$affiliate_id . "'";
+  $affiliate_banner_history_query=tep_db_query($affiliate_banner_history_raw);
+  $affiliate_banner_history = tep_db_fetch_array($affiliate_banner_history_query);
+  $affiliate_impressions = $affiliate_banner_history['count'];
+  if ($affiliate_impressions == 0) $affiliate_impressions="n/a"; 
+
+  $affiliate_clickthroughs_raw = "select count(*) as count from " . TABLE_AFFILIATE_CLICKTHROUGHS . " where affiliate_id = '" . (int)$affiliate_id . "'";
+  $affiliate_clickthroughs_query = tep_db_query($affiliate_clickthroughs_raw);
+  $affiliate_clickthroughs = tep_db_fetch_array($affiliate_clickthroughs_query);
+  $affiliate_clickthroughs =$affiliate_clickthroughs['count'];
+
+  $affiliate_sales_raw = "select count(*) as count, sum(a.affiliate_value) as total, sum(a.affiliate_payment) as payment from
+      " . TABLE_AFFILIATE_SALES . " a, 
+      " . TABLE_ORDERS . " o
+      where a.affiliate_id = '" . (int)$affiliate_id . "' and 
+      o.orders_id = a.affiliate_orders_id and
+      o.orders_status >= '" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . "' 
+      ";
+  $affiliate_sales_query = tep_db_query($affiliate_sales_raw);
+  $affiliate_sales = tep_db_fetch_array($affiliate_sales_query);
+
+  $affiliate_transactions=$affiliate_sales['count'];
+  if ($affiliate_clickthroughs > 0) {
+  $affiliate_conversions = tep_round(($affiliate_transactions / $affiliate_clickthroughs)*100, 2) . "%";
+  } else {
+    $affiliate_conversions = "n/a";
+  }
+  $affiliate_amount = $affiliate_sales['total'];
+  if ($affiliate_transactions>0) {
+  $affiliate_average = tep_round($affiliate_amount / $affiliate_transactions, 2);
+  } else {
+  $affiliate_average = "n/a";
+  }
+  $affiliate_commission = $affiliate_sales['payment'];
+
+  $affiliate_values = tep_db_query("select * from " . TABLE_AFFILIATE . " where affiliate_id = '" . (int)$affiliate_id . "'");
+  $affiliate = tep_db_fetch_array($affiliate_values);
+  $affiliate_percent = 0;
+  $affiliate_percent = $affiliate['affiliate_commission_percent'];
+  if ($affiliate_percent < AFFILIATE_PERCENT) $affiliate_percent = AFFILIATE_PERCENT;
+
+
+  $content = CONTENT_AFFILIATE_SUMMARY;
+  $javascript = $content . '.js.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+
+?>

Added: trunk/direct.openmoko.com/affiliate_terms.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_terms.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_terms.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+
+/*
+
+  $Id: affiliate_terms.php,v 1.1.1.1 2004/03/04 23:37:55 ccwjr Exp $
+
+
+
+  OSC-Affiliate
+
+
+
+  Contribution based on:
+
+
+
+  osCommerce, Open Source E-Commerce Solutions
+
+  http://www.oscommerce.com
+
+
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+
+
+  Released under the GNU General Public License
+
+*/
+
+  require('includes/application_top.php');
+
+
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_TERMS);
+
+
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_TERMS));
+
+
+
+  $content = CONTENT_AFFILIATE_TERMS; 
+
+
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+
+?>
+

Added: trunk/direct.openmoko.com/affiliate_terms_popup.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_terms_popup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_terms_popup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: affiliate_terms_popup.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_TERMS);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_AFFILIATE_PROGRAM_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/affiliate_validcats.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_validcats.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_validcats.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/*
+  $Id: affiliate_validcats.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS_BUILD_CAT);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD));
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<?php
+// BOF: WebMakers.com Changed: Header Tag Controller v1.0
+if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
+    require(DIR_WS_INCLUDES . 'header_tags.php');
+  } else {
+    ?> 
+      <title><?php echo TITLE; ?></title>
+      <?php
+    }
+    ?>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<head>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+ 
+  <table width="580" class="infoBoxContents">
+<tr>
+<td colspan="2" class="infoBoxHeading" align="center"><?php echo TEXT_VALID_CATEGORIES_LIST; ?></td>
+</tr>
+<?php 
+    echo "<tr><td><b>". TEXT_VALID_CATEGORIES_ID . "</b></td><td><b>" . TEXT_VALID_CATEGORIES_NAME . "</b></td></tr><tr>";
+    $result = mysql_query("SELECT * FROM categories, categories_description WHERE categories.categories_id = categories_description.categories_id and categories_description.language_id = '" . $languages_id . "' ORDER BY categories_description.categories_name");
+    if ($row = mysql_fetch_array($result)) {
+        do {
+            echo "<td class='infoBoxContents'>&nbsp".$row["categories_id"]."</td>\n";
+            echo "<td class='infoBoxContents'>".$row["categories_name"]."</td>\n";
+            echo "</tr>\n";
+        }
+        while($row = mysql_fetch_array($result));
+    }
+    echo "</table>\n";
+?>
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?>&nbsp;&nbsp;&nbsp;</p>
+<br>
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/affiliate_validproducts.php
===================================================================
--- trunk/direct.openmoko.com/affiliate_validproducts.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/affiliate_validproducts.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: affiliate_validproducts.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS_BUILD);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD));
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<head>
+<body>
+<table width="580" class="infoBoxContents">
+<tr>
+<td colspan="2" class="infoBoxHeading" align="center"><?php echo TEXT_VALID_PRODUCTS_LIST; ?></td>
+</tr>
+<?php 
+    echo "<tr><td><b>". TEXT_VALID_PRODUCTS_ID . "</b></td><td><b>" . TEXT_VALID_PRODUCTS_NAME . "</b></td></tr><tr>";
+    $result = mysql_query("SELECT * FROM products, products_description WHERE products.products_id = products_description.products_id and products_description.language_id = '" . $languages_id . "' ORDER BY products_description.products_name");
+    if ($row = mysql_fetch_array($result)) {
+        do {
+            echo "<td class='infoBoxContents'> ".$row["products_id"]."</td>\n";
+            echo "<td class='infoBoxContents'>".$row["products_name"]."</td>\n";
+            echo "</tr>\n";
+        }
+        while($row = mysql_fetch_array($result));
+    }
+    echo "</table>\n";
+?>
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?>&nbsp;&nbsp;&nbsp;</p>
+<br>
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/all_prodcats.php
===================================================================
--- trunk/direct.openmoko.com/all_prodcats.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/all_prodcats.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: all_prodcats.php,v 3.0 2004/02/21 by Ingo (info at gamephisto.de)
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+
+  modified by schizobinky 05/23/2004
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ALL_PRODCATS);
+
+  $breadcrumb->add(HEADING_TITLE, tep_href_link(FILENAME_ALL_PRODCATS, '', 'NONSSL'));
+
+  $content = CONTENT_ALL_PRODCATS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/all_prodmanf.php
===================================================================
--- trunk/direct.openmoko.com/all_prodmanf.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/all_prodmanf.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: all_prodmanf.php,v 3.0 2004/02/21 by Ingo (info at gamephisto.de)
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+
+  modified by schizobinky 05/23/2004
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ALL_PRODMANF);
+
+  $breadcrumb->add(HEADING_TITLE, tep_href_link(FILENAME_ALL_PRODMANF, '', 'NONSSL'));
+
+  $content = CONTENT_ALL_PRODMANF;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/allprods.php
===================================================================
--- trunk/direct.openmoko.com/allprods.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/allprods.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: all_prods.php,v 3.0 2004/02/21 by Ingo (info at gamephisto.de)
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2002 HMCservices
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ALLPRODS);
+
+// Set number of columns in listing
+define ('NR_COLUMNS', 1);
+//
+  $breadcrumb->add(HEADING_TITLE, tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL'));
+
+  $content = CONTENT_ALL_PRODS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/article_info.php
===================================================================
--- trunk/direct.openmoko.com/article_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/article_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: article_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ARTICLE_INFO);
+
+  $article_check_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_status = '1' and a.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and ad.articles_id = a.articles_id and ad.language_id = '" . (int)$languages_id . "'");
+  $article_check = tep_db_fetch_array($article_check_query);
+
+  $content = CONTENT_ARTICLE_INFO;
+ 
+  $javascript = $content . '.js';
+  
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);  
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $article_info_query = tep_db_query("select a.articles_id, ad.articles_name from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "'");
+  if (!tep_db_num_rows($article_info_query)) {
+    tep_redirect(tep_href_link(FILENAME_REVIEWS));
+  } else {
+    $article_info = tep_db_fetch_array($article_info_query);
+  }
+
+  $articles_name = $article_info['articles_name'];
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ARTICLE_REVIEWS);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params()));
+
+  $content = CONTENT_ARTICLE_REVIEWS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);  
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/article_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/article_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/article_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: article_reviews_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (isset($HTTP_GET_VARS['reviews_id']) && tep_not_null($HTTP_GET_VARS['reviews_id']) && isset($HTTP_GET_VARS['articles_id']) && tep_not_null($HTTP_GET_VARS['articles_id'])) {
+    $review_check_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLE_REVIEWS . " r, " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "' and r.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "'");
+    $review_check = tep_db_fetch_array($review_check_query);
+
+    if ($review_check['total'] < 1) {
+      tep_redirect(tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params(array('reviews_id'))));
+    }
+  } else {
+    tep_redirect(tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params(array('reviews_id'))));
+  }
+
+  tep_db_query("update " . TABLE_ARTICLE_REVIEWS . " set reviews_read = reviews_read+1 where reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "'");
+
+  $review_query = tep_db_query("select rd.reviews_text, r.reviews_rating, r.reviews_id, r.customers_name, r.date_added, r.reviews_read, a.articles_id, ad.articles_name from " . TABLE_ARTICLE_REVIEWS . " r, " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where r.reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.articles_id = a.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '". (int)$languages_id . "'");
+  $review = tep_db_fetch_array($review_query);
+
+  $articles_name = $review['articles_name'];
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ARTICLE_REVIEWS_INFO);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params()));
+
+   $content = CONTENT_ARTICLE_REVIEWS_INFO;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);  
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/article_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/article_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/article_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: article_reviews_write.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  $article_info_query = tep_db_query("select a.articles_id, ad.articles_name from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "'");
+  if (!tep_db_num_rows($article_info_query)) {
+    tep_redirect(tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params(array('action'))));
+  } else {
+    $article_info = tep_db_fetch_array($article_info_query);
+  }
+
+  $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+  $customer = tep_db_fetch_array($customer_query);
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
+    $rating = tep_db_prepare_input($HTTP_POST_VARS['article_rating']);
+    $review = tep_db_prepare_input($HTTP_POST_VARS['article_review']);
+
+    $error = false;
+    if (strlen($review) < REVIEW_TEXT_MIN_LENGTH) {
+      $error = true;
+      $messageStack->add('article_review', JS_REVIEW_TEXT);
+    }
+
+    if (($rating < 1) || ($rating > 5)) {
+      $error = true;
+      $messageStack->add('article_review', JS_REVIEW_RATING);
+    }
+
+    if ($error == false) {
+      tep_db_query("insert into " . TABLE_ARTICLE_REVIEWS . " (articles_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int)$HTTP_GET_VARS['articles_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) . "', '" . tep_db_input($rating) . "', now())");
+      $insert_id = tep_db_insert_id();
+
+      tep_db_query("insert into " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($review) . "')");
+
+      tep_redirect(tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params(array('action'))));
+    }
+  }
+
+  $articles_name = $article_info['articles_name'];
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ARTICLE_REVIEWS_WRITE);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params()));
+  
+ $content = CONTENT_ARTICLE_REVIEWS_WRITE;
+    
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+  
+  ?>

Added: trunk/direct.openmoko.com/article_search.php
===================================================================
--- trunk/direct.openmoko.com/article_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/article_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: article_search.php
+  by AlDaffodil:  aldaffodil at hotmail.com
+  Allows you to search articles using article_manager v 1.0
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ARTICLE_SEARCH);
+
+  $akeywords = '';
+
+    if (isset($HTTP_GET_VARS['akeywords'])) {
+      $akeywords = $HTTP_GET_VARS['akeywords'];
+    }
+  
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, tep_get_all_get_params(), 'NONSSL', true, false));
+  $content = CONTENT_ARTICLE_SEARCH;
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);  
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/articles.php
===================================================================
--- trunk/direct.openmoko.com/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// the following tPath references come from application_top.php
+  $topic_depth = 'top';
+
+  if (isset($tPath) && tep_not_null($tPath)) {
+    $topics_articles_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES_TO_TOPICS . " where topics_id = '" . (int)$current_topic_id . "'");
+    $topics_articles = tep_db_fetch_array($topics_articles_query);
+    if ($topics_articles['total'] > 0) {
+      $topic_depth = 'articles'; // display articles
+    } else {
+      $topic_parent_query = tep_db_query("select count(*) as total from " . TABLE_TOPICS . " where parent_id = '" . (int)$current_topic_id . "'");
+      $topic_parent = tep_db_fetch_array($topic_parent_query);
+      if ($topic_parent['total'] > 0) {
+        $topic_depth = 'nested'; // navigate through the topics
+      } else {
+        $topic_depth = 'articles'; // topic has no articles, but display the 'no articles' message
+      }
+    }
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ARTICLES);
+
+  if ($topic_depth == 'top' && !(isset($HTTP_GET_VARS['authors_id'])) ) {
+    $breadcrumb->add(NAVBAR_TITLE_DEFAULT, tep_href_link(FILENAME_ARTICLES));
+  }
+
+  $content = CONTENT_ARTICLES;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); 
+ ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/articles_new.php
===================================================================
--- trunk/direct.openmoko.com/articles_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/articles_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: articles_new.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ARTICLES_NEW);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ARTICLES_NEW));
+
+  $content = CONTENT_ARTICLES_NEW;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);  
+  
+  require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/cache/index.php
===================================================================
--- trunk/direct.openmoko.com/cache/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/cache/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+header('Location: /');
+exit;
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/cache/phpthumb/index.php
===================================================================
--- trunk/direct.openmoko.com/cache/phpthumb/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/cache/phpthumb/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+header('Location: /');
+exit;
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/calendar_content.php
===================================================================
--- trunk/direct.openmoko.com/calendar_content.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/calendar_content.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,133 @@
+<?php
+/*
+  $Id: events_calendar v1.00 2003/03/08 18:09:16 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_EVENTS_CALENDAR);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE ?></title>
+<!-- events_calendar //-->
+<link rel="stylesheet" type="text/css" href="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME . '/stylesheet.css'?>">
+<style type="text/css">
+<!--
+.button {border: 1px outset; margin: 0px; color: #000000; width: 20px; height: 20px;
+}
+-->
+</style>
+<script type="text/javascript">
+function jump(view, url){
+if (document.all||document.getElementById){
+    month= document.calendar._month.options[document.calendar._month.selectedIndex].value;
+    year=  document.calendar._year.options[document.calendar._year.selectedIndex].value;
+    return url +'?_month='+ month +'&amp;_year='+ year +'&amp;year_view='+ view;
+ }
+}
+</SCRIPT>
+</head>
+<body>
+<?php
+// Construct a calendar to show the current month
+$cal = new Calendar;
+$cal->setStartDay(FIRST_DAY_OF_WEEK);
+$this_month = date('m');
+$this_year = date('Y');
+
+if ($HTTP_GET_VARS['_month']) {
+$month = $_month;
+$year = $_year;
+$a = $cal->adjustDate($month, $year);
+$month_ = $a[0];
+$year_= $a[1];
+}else{
+$year = date('Y');
+$month = date('m');
+$month_= $month;
+$year_= $year;
+}
+echo '<form method="get" name="calendar" action="events_calendar.php">';
+echo '<table bgcolor="#EDECE9" width="100%"  align="center" border="0" cellspacing="0" cellpadding="0" style="cursor: default">';
+echo '<tr><td align="center" valign="top">' . $cal->getMonthView($month,$year) . '</td></tr>';
+//echo '<tr>';
+?>
+
+  <tr>
+     <td style="line-height: 2px;">&nbsp;
+     </td>
+  </tr>
+  <tr>
+    <td align="center" valign="top" nowrap>
+<?php
+$monthShort = explode("," ,MONTHS_SHORT_ARRAY);
+echo '<select name="_month" class="select">';
+$month = date('m');
+while (list($key, $value) = each($monthShort)){
+if ($HTTP_GET_VARS['_month']){
+    if($key+1 == $_month){
+        $key=$key+1;
+        echo '<option value="'. $key .'" selected>'. $value .'</option>' . "\n";
+    }else{
+        $key=$key+1;
+    echo '<option value="'. $key .'">'. $value .'</option>' . "\n";
+    }
+}else{
+    if($key+1 == $month){
+        $key=$key+1;
+        echo '<option value="'. $key .'" selected>'. $value .'</option>' . "\n";
+    }else{
+        $key=$key+1;
+    echo '<option value="'. $key .'">'. $value .'</option>' . "\n";
+    }
+  }
+}
+echo '</select>';
+echo '<select name="_year" class="select">';
+$year = date('Y');
+$years = NUMBER_OF_YEARS;
+for ($y=0; $y < $years; $y++){
+$_y = $year+$y;
+if ($HTTP_GET_VARS['_month']){
+    if($_y == $_year){
+    echo '<option value="'. $_y .'" selected>'. $_y .'</option>' . "\n";
+    }else{
+    echo '<option value="'. $_y .'">'. $_y .'</option>' . "\n";
+    }
+}else{
+    if($_y == $year){
+    echo '<option value="'. $_y .'" selected>'. $_y .'</option>' . "\n";
+    }else{
+    echo '<option value="'. $_y .'">'. $_y .'</option>' . "\n";
+    }
+  }
+}
+?>
+</select>
+
+
+<input type="button" class="button" title="<?php echo BOX_GO_BUTTON_TITLE; ?>" value="<?php echo BOX_GO_BUTTON; ?>"  onclick="top.window.location=jump(0,'<?php echo  FILENAME_EVENTS_CALENDAR ; ?>')">
+<?php
+if (($month != $this_month) || ($month_ != $this_month)){
+?>
+<br>
+<input type="button" class="button" title="<?php echo BOX_TODAY_BUTTON_TITLE; ?>" value="<?php echo BOX_TODAY_BUTTON; ?>" onclick=top.calendar.location="<?php echo  FILENAME_EVENTS_CALENDAR_CONTENT ; ?>?_month=<?php echo $this_month .'&amp;_year='. $this_year ?>">
+<?php
+}
+?>
+
+<input type="button" class="button" title="<?php echo BOX_YEAR_VIEW_BUTTON_TITLE; ?>" value="<?php echo BOX_YEAR_VIEW_BUTTON; ?>" onclick="top.window.location=jump(1,'<?php echo  FILENAME_EVENTS_CALENDAR ; ?>')">
+     </td>
+    </tr>
+   
+</table>
+ </form>
+</body>
+</html>
+
+<!-- events_calendar //-->

Added: trunk/direct.openmoko.com/cert/cert_key_pem.txt
===================================================================
--- trunk/direct.openmoko.com/cert/cert_key_pem.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/cert/cert_key_pem.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,6 @@
+-----BEGIN RSA PRIVATE KEY-----
+Dummy file
+-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+dummy file
+-----END CERTIFICATE-----
\ No newline at end of file

Added: trunk/direct.openmoko.com/check_lang.php
===================================================================
--- trunk/direct.openmoko.com/check_lang.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/check_lang.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,550 @@
+<?php
+// W Godefroy
+//  OSCommerce language integrity verification
+//
+// For latest info check:
+// http://buzzy.belgoline.com/hacks/fldr_checklang
+//
+// Copyright (C) 2005 W Godefroy
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+//
+
+define("ERROR_CANNOT_OPEN_LANGUAGE_DIR","FATAL ERROR: Cannot open language dir: ");
+define("CHECK_LANG_FILENAME","Filename");
+define("CHECK_LANG_MISSING_IN","Missing in");
+define("CHECK_LANG_NONE_FOUND","None found");
+define("CHECK_LANG_FOUND_IN","Found in");
+define("CHECK_LANG_DEFINITION_NAME","Definition name");
+define("CHECK_LANG_EQUAL_TO","Equal to");
+define("CHECK_LANG_REFERENCES","References");
+define("CHECK_LANG_ALL_EQUAL","All equal");
+define("CHECK_LANG_WHERE_USED","Where Used");
+define("CHECK_LANG_FOUND_FOR","Found for");
+define("CHECK_LANG_MISSING_FOR","Missing for");
+define("CHECK_LANG_ALL_BUT","All but");
+define("CHECK_LANG_FILE_NAME","File Name");
+define("CHECK_LANG_SELECT_OPTION","Select option");
+define("CHECK_LANG_TO_CHECK_FILE_CONSISTENCY","To check file consistency");
+define("CHECK_LANG_CLICK_HERE","Click Here");
+define("CHECK_LANG_TO_CHECK_DEFINITION_CONSISTENCY","To check definition consistency");
+define("CHECK_LANG_TO_CHECK_EQUAL_DEFINITIONS","To check equal definitions");
+define("CHECK_LANG_HOME","Home");
+define("CHECK_LANG_BACK","Back");
+define("CHECK_LANG_W_GODEFROY","W Godefroy");
+define("CHECK_LANG_EXECUTION_TIME","Execution Time: ");
+define("CHECK_LANG_TITLE","Check Language Integrity");
+define("CHECK_LANG_LIST_OF_FILES_USING","List of files using");
+define("CHECK_LANG_LIST_OF_FILES_PRESENT_FOR_ONE_LANGUAGE","List of files that are present for one language-definition but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_PRESENT_FOR_ONE_LANGUAGE","List of phrase definitions that are present for one language-file but missing for other(s)");
+define("CHECK_LANG_LIST_OF_PHRASE_DEFINITIONS_EQUAL","List of phrase definitions that are equal");
+
+
+
+
+//require('includes/application_top.php');
+define('DIR_WS_INCLUDES', "includes/");
+
+$timeparts = explode(' ',microtime());
+$starttime = $timeparts[1].substr($timeparts[0],1);
+
+function tep_show_array_table(&$myarray, $title, $lev=0) 
+{
+    if($lev) 
+  echo "<table >";
+    else
+  echo "<table border=1 >";
+
+    echo "\n<tr><th colspan=2>$title</th></tr>";
+    foreach($myarray as $key => $values) {
+  echo "<tr><td> $key </td>\n  <td>";
+  if(is_array($values)) {
+      tep_show_array_table($values, $key, $lev + 1);
+  } else {
+      echo "$values";
+  }
+  echo "</td></tr>\n";
+    }
+    echo "</table>";
+}
+
+function tep_show_env() 
+{
+    
+    global $HTTP_SERVER_VARS, $HTTP_ENV_VARS, $HTTP_COOKIE_VARS, $HTTP_GET_VARS;
+    global $HTTP_POST_VARS, $HTTP_SESSION_VARS;
+
+    tep_show_array_table($HTTP_SERVER_VARS, "HTTP_SERVER_VARS");
+    echo"<br>";
+    
+    tep_show_array_table($HTTP_ENV_VARS, "HTTP_ENV_VARS");
+    echo"<br>";
+
+    tep_show_array_table($HTTP_COOKIE_VARS, "HTTP_COOCKIE_VARS");
+    echo"<br>";
+
+    tep_show_array_table($HTTP_GET_VARS, "HTTP_GET_VARS");
+    echo"<br>";
+
+    tep_show_array_table($HTTP_POST_VARS, "HTTP_POST_VARS");
+    echo"<br>";
+
+    tep_show_array_table($HTTP_SESSION_VARS, "HTTP_SESSION_VARS");
+    echo"<br>";
+}
+  
+
+function tep_scan_lang_dirs(&$lar, $lang_dir) {
+    if(is_dir($lang_dir)) {
+  if ($dh = opendir($lang_dir)) {
+      while (false !== ($file = readdir($dh))) {
+    $fpath = $lang_dir . $file;
+      
+    if(is_file($fpath)) {
+        if($lang_name = tep_is_lang_file($fpath)) {
+      $lar[$lang_name]["__filename__"] = $fpath;
+        }
+    }
+      }
+  closedir($dh);
+  }
+    } else {
+  //die("FATAL ERROR: Cannot open language dir: $lang_dir");
+  die(ERROR_CANNOT_OPEN_LANGUAGE_DIR. $lang_dir);
+    }
+}
+
+function tep_is_lang_file($file_name) 
+{
+    $match_pattern = '/(\w+)\.php$/';
+
+    if(preg_match($match_pattern,$file_name,$matches)) {
+  return $matches[1];
+    } else {
+  return 0;
+    }    
+}
+
+function tep_read_files_in_dir($dir_name) 
+{
+    $result = array();
+
+
+    $dirlist = array($dir_name);
+    
+    while($dirlist) {
+  $currdir = array_pop($dirlist);
+  
+  if($dh = opendir($currdir)) {
+      
+      while(false !== ($dire = readdir($dh))) {
+    $fpath = $currdir . '/' . $dire;
+    
+    if(is_file($fpath)) {
+        $result[] = $fpath;
+    } elseif(is_dir($fpath) && $dire != ".." && $dire != "." && $dire != "CVS") {
+        $dirlist[] = $fpath;
+    }
+      }
+      
+      
+  }
+    }
+    
+    return $result;
+}
+
+
+function tep_read_lang_files(&$lar) 
+{
+    foreach ($lar as $key => $value) {
+  //read lang directory
+  $landir = dirname($value["__filename__"]) . "/$key";
+
+  $lar[$key] += tep_read_files_in_dir($landir);
+    }
+}
+
+
+function tep_neuter_lang($lname, $str) 
+{
+    if(preg_match("/(.+)\/$lname(.+)/",$str,$matches)) {
+  return $matches[2];
+    } else {
+  return basename($str);
+    }
+}
+
+
+function tep_create_lang_neutral(&$lar) 
+{
+    $neutral_file_list = array();
+    foreach($lar as $lang => $flist) 
+  foreach($flist as $fname) {
+      $neutral_file = tep_neuter_lang($lang, $fname);
+      if(!(array_search($neutral_file, $neutral_file_list) !== false))
+    $neutral_file_list[] = $neutral_file;
+  }
+
+    return $neutral_file_list;
+}
+
+
+function tep_new_show_missing_files(&$lar) 
+{
+    $lang_list = array_keys($lar);
+
+    $neutral_file_list = tep_create_lang_neutral($lar);
+
+    echo "<table border=1>";
+    //echo "<tr><th>Filename</th><th>Missing in</th></tr>\n";
+    echo "<tr><th>".CHECK_LANG_FILENAME."</th><th>".CHECK_LANG_MISSING_IN."</th></tr>\n";
+    $found_errors = 0;
+    foreach($neutral_file_list as $file_name) {
+  $total = 0;
+  $missing = 0;
+  foreach($lang_list as $lang) {
+      $lang_file = DIR_WS_INCLUDES . "languages/$lang" . $file_name;
+
+      $total++;
+      if(!is_file($lang_file)) {
+    $missing++;
+    $missing_lang .= " [$lang]";
+      } else
+    $lang_found = $lang;
+  }
+
+  if($missing_lang) {
+      $found_errors = 1;
+      
+      $gen_file = "languages/<i>[LANG_NAME]</i>" . $file_name;
+      echo "<tr><td>$gen_file</td><td>";
+
+      if($missing >= $total - 1) 
+    echo "<i>All but $lang_found</i>";
+      else
+    echo $missing_lang;
+
+      echo "</td></tr>\n";
+  }
+    }
+    if(!$found_errors) 
+  //echo "<tr><td colspan=2><i>None found</i></td></tr>\n";
+  echo "<tr><td colspan=2><i>".CHECK_LANG_NONE_FOUND."</i></td></tr>\n";
+    
+    echo "</table>";
+}
+
+function tep_read_lang_words($lang, $file_base) {
+    $file_name = DIR_WS_INCLUDES . "languages/$lang" . $file_base;
+
+    $result = array();
+    
+    if(is_file($file_name)) {
+  $handle = fopen($file_name, "r");
+  while(!feof($handle)) {
+      $fline = fgets($handle);
+      if(preg_match("/define\s*\(\s*(\'|\")(\w+)(\'|\")\s*,\s*(.+)\s*\)\s*;/",$fline,$matches)) {
+    $result[$matches[2]] = $matches[4];
+      }
+  }
+    }
+
+    return $result;
+}
+
+// this function is equal to tep_new_show_missing_def but a few subtile
+// differences which would make a single function for both just unreadable
+function tep_new_show_equal_def(&$lar) 
+{
+    global $my_url;
+
+    $file_defs_checked = array();
+
+    $lang_list = array_keys($lar);
+
+    $neutral_file_list = tep_create_lang_neutral($lar);
+
+    echo "<table border=1>";
+    //echo "<tr><th>Found in</th><th>Definition name</th><th>Equal to</th><th>References</th></tr>\n";
+    echo "<tr><th>".CHECK_LANG_FOUND_IN."</th><th>".CHECK_LANG_DEFINITION_NAME."</th><th>".CHECK_LANG_EQUAL_TO."</th><th>".CHECK_LANG_REFERENCES."</th></tr>\n";
+    foreach($neutral_file_list as $neuter_file) {
+  $first_missing_in_file = 1;
+
+  //create word-definition array
+  $war = array();
+  foreach($lang_list as $lang) 
+      $war[$lang] = tep_read_lang_words($lang, $neuter_file);
+  
+  $def_lang_checked = array();
+  foreach($war as $lang => $lang_def) {
+      foreach($lang_def as $def_name => $def_val) {
+    $total = 0;
+    $matches = 0;
+    $lang_equal = "";
+
+    //keep list of verified ($def_name,$lang)'s to avoid dupes
+    $def_lang = "$def_name $lang";
+    if(!(array_search($def_lang, $def_lang_checked) !== false)) {
+        $def_lang_checked[] = $def_lang;
+
+        foreach($lang_list as $lang_comp) 
+      if($lang_comp != $lang) {
+          $total++;
+
+          if($war[$lang][$def_name] == $war[$lang_comp][$def_name]) {
+        $matches++;
+        $lang_equal .= " [$lang_comp]";
+
+        //add to the list to avoid dupes
+        $def_lang = "$def_name $lang_comp";
+        $def_lang_checked[] = $def_lang;
+          }
+      }
+
+        if($matches) {
+      if($first_missing_in_file) {
+          $first_missing_in_file = 0;
+          echo "<tr><th colspan=3>includes/<i>[LANG_NAME]</i>$neuter_file</th><td></td></tr>\n";
+      }
+
+      echo "<tr><td>$lang</td><td>$def_name</td><td>";
+      if($matches == $total) 
+          echo "<i>".CHECK_LANG_ALL_EQUAL."</i>";
+      else
+          echo $lang_equal;
+
+      //echo "</td><td><a href='$my_url?find_def=$def_name&file_name=$neuter_file'>Where Used</a></td></tr>\n";   
+      echo "</td><td><a href='$my_url?find_def=$def_name&file_name=$neuter_file'>".CHECK_LANG_WHERE_USED."</a></td></tr>\n";   
+        }
+    }
+      }
+  }
+    }
+    echo "</table>";
+}
+
+function tep_new_show_missing_def(&$lar) 
+{
+    global $my_url;
+
+    $file_defs_checked = array();
+
+    $lang_list = array_keys($lar);
+
+    $neutral_file_list = tep_create_lang_neutral($lar);
+
+    //itterate all files to find missing files
+    echo "<table border=1>";
+  //  echo "<tr><th>Found for</th><th>Definition name</th><th>Missing for</th><th>References</th></tr>\n";
+    echo "<tr><th>".CHECK_LANG_FOUND_FOR."</th><th>".CHECK_LANG_DEFINITION_NAME."</th><th>".CHECK_LANG_MISSING_FOR."</th><th>".CHECK_LANG_REFERENCES."</th></tr>\n";
+
+    foreach ($neutral_file_list as $neuter_file) {
+  $first_missing_in_file = 1;
+  
+  //create word-definition array
+  $war = array();
+  foreach($lang_list as $lang) 
+      $war[$lang] = tep_read_lang_words($lang, $neuter_file);
+
+  //check definitions are present for all files
+  $defs_checked = array();
+  foreach($war as $lang => $lang_def) {
+      foreach($lang_def as $def_name => $def_val) {
+    $total = 0;
+    $missing = 0;
+    $lang_missing = "";
+
+    //keep list of verified $def_name's to avoid dupes
+    if(!(array_search($def_name, $defs_checked) !== false)) {
+        $defs_checked[] = $def_name;
+
+        foreach($lang_list as $lang_comp) 
+      if($lang_comp != $lang) {
+          $total++;
+
+//          echo "<br>search $def_name ($lang_comp) in";
+//          print_r($war[$lang_comp]);
+          
+          if(!isset($war[$lang_comp][$def_name])) {
+        $missing++;
+        $lang_missing .= " [$lang_comp]";
+          }
+      }
+
+        if($missing) {
+      if($first_missing_in_file) {
+          $first_missing_in_file = 0;
+          echo "<tr><th colspan=3>includes/<i>[LANG_NAME]</i>$neuter_file</th><td></td></tr>\n";          
+      }
+
+      echo "<tr><td>$lang</td><td>$def_name</td><td>";
+
+      if($missing == $total) 
+          //echo "<i>All but $lang</i>";
+          echo "<i>".CHECK_LANG_ALL_BUT." $lang</i>";
+      else
+          echo $lang_missing;
+
+
+      //echo "</td><td><a href='$my_url?find_def=$def_name&file_name=$neuter_file'>Where Used</a></td></tr>\n";
+      
+      echo "</td><td><a href='$my_url?find_def=$def_name&file_name=$neuter_file'>".CHECK_LANG_WHERE_USED."</a></td></tr>\n";   
+        }
+    }
+      }
+  }
+    }
+    echo "</table>";
+}
+
+function tep_file_contains($def_name, $file_name) 
+{    
+    $contents = file_get_contents($file_name);
+
+    if(strstr($contents, $def_name))
+  return 1;
+    else
+  return 0;
+}    
+    
+function tep_find_occurences($def_name, $dir, $bstr = "") 
+{
+    global $my_url;
+
+    $file_list = tep_read_files_in_dir($dir);
+
+    $none_found = 1;
+    $line_buf = "";
+    //echo "<table>\n<tr><th>File Name</th></tr>\n";
+    echo "<table>\n<tr><th>".CHECK_LANG_FILE_NAME."</th></tr>\n";
+    foreach($file_list as $file) {
+  if(!strstr($file,"/languages/") &&
+     is_file($file) &&
+     tep_file_contains($def_name, $file)) {
+      $none_found = 0;
+      
+      if(strstr($file, $bstr)) 
+    echo "<tr><td><b>$file</b></td></tr>\n";
+      else
+    $line_buf .= "<tr><td>$file</td></tr>\n";
+  }
+    }
+    
+    
+    if($none_found) 
+  //echo "<tr><td cospan=2 align=center><i>None Found</i></td></tr>\n";
+  echo "<tr><td cospan=2 align=center><i>".CHECK_LANG_NONE_FOUND."</i></td></tr>\n";
+    elseif($line_buf)
+  echo $line_buf;
+  
+    echo "</table><br>";
+}
+
+function tep_show_main_menu($my_url) 
+{
+ /*   echo "<table>
+<tr><th colspan=2>Select option</th></tr>
+<tr><td>To check file consistency</td>      <td><a href='$my_url?check_file=1'>Click Here</a></td></tr>
+<tr><td>To check definition consistency</td><td><a href='$my_url?check_def=1'>Click Here</a></td></tr>
+<tr><td>To check equal definitions</td>     <td><a href='$my_url?check_eq=1'>Click Here</a></td></tr>
+</table>";
+*/
+
+echo "<table><tr><th colspan=2>".CHECK_LANG_SELECT_OPTION."</th></tr><tr><td>".CHECK_LANG_TO_CHECK_FILE_CONSISTENCY."</td><td><a href='$my_url?check_file=1'>".CHECK_LANG_CLICK_HERE."</a></td></tr><tr><td>".CHECK_LANG_TO_CHECK_DEFINITION_CONSISTENCY."</td><td><a href='$my_url?check_def=1'>".CHECK_LANG_CLICK_HERE."</a></td></tr><tr><td>".CHECK_LANG_TO_CHECK_EQUAL_DEFINITIONS."</td><td><a href='$my_url?check_eq=1'>".CHECK_LANG_CLICK_HERE."</a></td></tr></table>";
+
+}
+
+function tep_show_footer($my_url, $my_ref, $starttime) {
+    
+   // echo "\n\n<br><a href='$my_url'>Home</a> - <a href='$my_ref'>Back</a>";
+    echo "\n\n<br><a href='$my_url'>".CHECK_LANG_HOME."</a> - <a href='$my_ref'>".CHECK_LANG_BACK."</a>";
+    
+    $timeparts = explode(' ',microtime());
+    $endtime = $timeparts[1].substr($timeparts[0],1);
+    echo "<br><h6> ".CHECK_LANG_W_GODEFROY." - check_lang.php\n";
+    echo " - ".CHECK_LANG_EXECUTION_TIME." " . bcsub($endtime,$starttime,6);
+    echo " s </h6>";
+}
+
+
+//////////////////////////// PROGRAM START \\\\\\\\\\\\\\\\\\\\\\\\\ 
+
+/*echo "<html>
+<head>
+<title>Check Language Integrity</title>
+</head>
+<body>\n";*/
+echo "<html>
+<head>
+<title>".CHECK_LANG_TITLE."</title>
+</head>
+<body>\n";
+
+//tep_show_env();
+
+$lang_dir = DIR_WS_INCLUDES . 'languages/';
+$my_url = $HTTP_SERVER_VARS["PHP_SELF"];
+$my_file = $HTTP_SERVER_VARS["PATH_TRANSLATED"];
+$my_ref = $HTTP_SERVER_VARS["HTTP_REFERER"];
+
+if(isset($HTTP_GET_VARS["find_def"])) {
+    echo "<h3>".CHECK_LANG_LIST_OF_FILES_USING." " . $HTTP_GET_VARS["find_def"] . "</h3><br>\n";
+    
+    tep_find_occurences($HTTP_GET_VARS["find_def"],
+      dirname($my_file),
+      $HTTP_GET_VARS["file_name"]);
+
+} elseif(isset($HTTP_GET_VARS["check_file"])) {
+    $lar = array();
+
+   // echo "<h3>List of files that are present for one language-definition but missing for other(s)</h3><br>\n";
+
+    echo "<h3>".CHECK_LANG_LIST_OF_FILES_PRESENT_FOR_ONE_LANGUAGE."</h3><br>\n";
+
+    tep_scan_lang_dirs($lar, $lang_dir);
+    
+    tep_read_lang_files($lar);
+    
+//    tep_show_missing_files($lar);
+    tep_new_show_missing_files($lar);
+
+} elseif(isset($HTTP_GET_VARS["check_def"])) {
+    //echo "<h3>List of phrase definitions that are present for one language-file but missing for other(s)</h3><br>\n";
+    echo "<h3>".CHECK_LANG_LIST_OF_PHRASE_PRESENT_FOR_ONE_LANGUAGE."</h3><br>\n";
+
+    tep_scan_lang_dirs($lar, $lang_dir);
+    tep_read_lang_files($lar);    
+    //tep_show_missing_equal_def($lar);
+    tep_new_show_missing_def($lar);
+
+} elseif(isset($HTTP_GET_VARS["check_eq"])) {
+    //echo "<h3>List of phrase definitions that are equal</h3><br>\n";
+    echo "<h3>".CHECK_LANG_LIST_OF_PHRASE_DEFINITIONS_EQUAL."</h3><br>\n";
+    tep_scan_lang_dirs($lar, $lang_dir);
+    tep_read_lang_files($lar);
+    //tep_show_missing_equal_def($lar, 1);
+    tep_new_show_equal_def($lar);
+    
+}  else {
+    tep_show_main_menu($my_url);
+}
+
+
+tep_show_footer($my_url, $my_ref, $starttime);
+
+echo "</body></html>\n";
+
+?>

Added: trunk/direct.openmoko.com/checkout_confirmation.php
===================================================================
--- trunk/direct.openmoko.com/checkout_confirmation.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/checkout_confirmation.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,120 @@
+<?php
+/*
+  $Id: checkout_confirmation.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// if the customer is not logged on, redirect them to the login page
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// if there is nothing in the customers cart, redirect them to the shopping cart page
+  if ($cart->count_contents() < 1) {
+    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+  }
+
+// avoid hack attempts during the checkout procedure by checking the internal cartID
+  if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
+    if ($cart->cartID != $cartID) {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+    }
+  }
+
+// if no shipping method has been selected, redirect the customer to the shipping method selection page
+  if (!tep_session_is_registered('shipping')) {
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+  }
+
+  if (!tep_session_is_registered('payment')) tep_session_register('payment');
+  if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment'];
+
+  if (!tep_session_is_registered('comments')) tep_session_register('comments');
+  if (tep_not_null($HTTP_POST_VARS['comments'])) {
+    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
+  }
+
+// load the selected payment module
+  require(DIR_WS_CLASSES . 'payment.php');
+  if ($credit_covers) $payment=''; //ICW added for CREDIT CLASS
+  $payment_modules = new payment($payment);
+  $payment_modules->update_status();
+
+  require(DIR_WS_CLASSES . 'order.php');
+  $order = new order;
+
+  // Stock Check
+  $any_out_of_stock = false;
+  if (STOCK_CHECK == 'true') {
+    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+      if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
+        $any_out_of_stock = true;
+      }
+    }
+    // Out of Stock
+    if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) {
+      tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+    }
+  }
+
+// Ok, the various checks have been applied.  Now if this is thesecond time thru
+// we want to proceed.  The checks are to be applied before the confirmation screen is presented
+// and once again after the confirm button is clicked to reduce possible errors in the order.
+  if ( isset($HTTP_POST_VARS['action']) && $HTTP_POST_VARS['action'] == 'proceed' ) {
+    if (isset($$payment->form_action_url)) {
+      tep_redirect($$payment->form_action_url);
+    } else {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'));
+    }
+  }  
+
+  
+//ICW ADDED FOR CREDIT CLASS SYSTEM
+  require(DIR_WS_CLASSES . 'order_total.php');
+//ICW ADDED FOR CREDIT CLASS SYSTEM
+  $order_total_modules = new order_total;
+//ICW ADDED FOR CREDIT CLASS SYSTEM
+  $order_total_modules->collect_posts();
+//ICW ADDED FOR CREDIT CLASS SYSTEM
+  $order_total_modules->pre_confirmation_check();
+
+// ICW CREDIT CLASS Amended Line
+//  if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
+  if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
+  }
+
+  if (is_array($payment_modules->modules)) {
+    $payment_modules->pre_confirmation_check();
+  }
+
+// load the selected shipping module
+  require(DIR_WS_CLASSES . 'shipping.php');
+  $shipping_modules = new shipping($shipping);
+//ICW Credit class amendment Lines below repositioned
+//  require(DIR_WS_CLASSES . 'order_total.php');
+//  $order_total_modules = new order_total;
+
+  
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2);
+
+  $content = CONTENT_CHECKOUT_CONFIRMATION;
+  
+  if (ACCOUNT_CONDITIONS_REQUIRED == 'true') $javascript = 'checkout_confirmation.js.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/checkout_payment.php
===================================================================
--- trunk/direct.openmoko.com/checkout_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/checkout_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+<?php
+/*
+  $Id: checkout_payment.php,v 1.1.1.3 2004/03/04 23:37:55 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  Updated for: Authorize.net Consolidated v1.7 - CRE loaded6 v4 edition
+  Date: April 10, 2004
+  Added: Rewrote checkout_payment.php for CRE loaded6 v4
+  Author: Austin Renfroe (Austin519)
+  Email: Austin519 at aol.com
+*/
+
+  require('includes/application_top.php');
+
+// if the customer is not logged on, redirect them to the login page
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// if there is nothing in the customers cart, redirect them to the shopping cart page
+  if ($cart->count_contents() < 1) {
+    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+  }
+
+// if no shipping method has been selected, redirect the customer to the shipping method selection page
+  if (!tep_session_is_registered('shipping')) {
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+  }
+
+// avoid hack attempts during the checkout procedure by checking the internal cartID
+  if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
+    if ($cart->cartID != $cartID) {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+    }
+  }
+
+// if we have been here before and are coming back get rid of the credit covers variable
+  if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');  //ICW ADDED FOR CREDIT CLASS SYSTEM
+
+// Stock Check
+  if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
+        tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+        break;
+      }
+    }
+  }
+
+// if no billing destination address was selected, use the customers own address as default
+  if (!tep_session_is_registered('billto')) {
+    tep_session_register('billto');
+    $billto = $customer_default_address_id;
+  } else {
+// verify the selected billing address
+    $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");
+    $check_address = tep_db_fetch_array($check_address_query);
+
+    if ($check_address['total'] != '1') {
+      $billto = $customer_default_address_id;
+      if (tep_session_is_registered('payment')) tep_session_unregister('payment');
+    }
+  }
+
+  require(DIR_WS_CLASSES . 'order.php');
+  $order = new order;
+  require(DIR_WS_CLASSES . 'order_total.php');//ICW ADDED FOR CREDIT CLASS SYSTEM
+  $order_total_modules = new order_total;//ICW ADDED FOR CREDIT CLASS SYSTEM
+  $order_total_modules->clear_posts(); // ADDED FOR CREDIT CLASS SYSTEM by Rigadin in v5.13
+
+  if (!tep_session_is_registered('comments')) tep_session_register('comments');
+
+  $total_weight = $cart->show_weight();
+  $total_count = $cart->count_contents();
+  $total_count = $cart->count_contents_virtual(); //ICW ADDED FOR CREDIT CLASS SYSTEM
+
+// load all enabled payment modules
+  require(DIR_WS_CLASSES . 'payment.php');
+  $payment_modules = new payment;
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+
+  $content = CONTENT_CHECKOUT_PAYMENT;
+  $javascript = $content . '.js.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>
+<script type="text/javascript"><!--
+function CVVPopUpWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=600,height=233,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>

Added: trunk/direct.openmoko.com/checkout_payment_address.php
===================================================================
--- trunk/direct.openmoko.com/checkout_payment_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/checkout_payment_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,205 @@
+<?php
+/*
+  $Id: checkout_payment_address.php,v 1.1.1.1 2004/03/04 23:37:56 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// if the customer is not logged on, redirect them to the login page
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// if there is nothing in the customers cart, redirect them to the shopping cart page
+  if ($cart->count_contents() < 1) {
+    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+  }
+
+// needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT_ADDRESS);
+
+  $error = false;
+  $process = false;
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit')) {
+// process a new billing address
+    if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) && tep_not_null($HTTP_POST_VARS['street_address'])) {
+      $process = true;
+
+      if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
+      if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
+      $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
+      $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
+      $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
+      if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
+      $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
+      $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
+      $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+      if (ACCOUNT_STATE == 'true') {
+        if (isset($HTTP_POST_VARS['zone_id'])) {
+          $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+        } else {
+          $zone_id = false;
+        }
+        $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+      }
+
+      if (ACCOUNT_GENDER == 'true') {
+        if ( ($gender != 'm') && ($gender != 'f') ) {
+          $error = true;
+
+          $messageStack->add('checkout_address', ENTRY_GENDER_ERROR);
+        }
+      }
+
+      if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_FIRST_NAME_ERROR);
+      }
+
+      if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_LAST_NAME_ERROR);
+      }
+
+      if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_STREET_ADDRESS_ERROR);
+      }
+
+      if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_POST_CODE_ERROR);
+      }
+
+      if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_CITY_ERROR);
+      }
+
+      if (ACCOUNT_STATE == 'true') {
+        $zone_id = 0;
+        $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
+        $check = tep_db_fetch_array($check_query);
+        $entry_state_has_zones = ($check['total'] > 0);
+        if ($entry_state_has_zones == true) {
+//State abbreviation bug fix applied. 10/1/2004
+//Now accepts abbreviation - no complaints about capitalization
+$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' OR zone_code = '" . tep_db_input($state) . "')");
+          if (tep_db_num_rows($zone_query) == 1) {
+            $zone = tep_db_fetch_array($zone_query);
+            $zone_id = $zone['zone_id'];
+          } else {
+            $error = true;
+
+            $messageStack->add('checkout_address', ENTRY_STATE_ERROR_SELECT);
+          }
+        } else {
+          if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
+            $error = true;
+
+            $messageStack->add('checkout_address', ENTRY_STATE_ERROR);
+          }
+        }
+      }
+
+      if ( (is_numeric($country) == false) || ($country < 1) ) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_COUNTRY_ERROR);
+      }
+
+      if ($error == false) {
+        $sql_data_array = array('customers_id' => $customer_id,
+                                'entry_firstname' => $firstname,
+                                'entry_lastname' => $lastname,
+                                'entry_street_address' => $street_address,
+                                'entry_postcode' => $postcode,
+                                'entry_city' => $city,
+                                'entry_country_id' => $country);
+
+        if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
+        if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
+        if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
+        if (ACCOUNT_STATE == 'true') {
+          if ($zone_id > 0) {
+            $sql_data_array['entry_zone_id'] = $zone_id;
+            $sql_data_array['entry_state'] = '';
+          } else {
+            $sql_data_array['entry_zone_id'] = '0';
+            $sql_data_array['entry_state'] = $state;
+          }
+        }
+
+        if (!tep_session_is_registered('billto')) tep_session_register('billto');
+
+        tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
+
+        $billto = tep_db_insert_id();
+
+        if (tep_session_is_registered('payment')) tep_session_unregister('payment');
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+      }
+// process the selected billing destination
+    } elseif (isset($HTTP_POST_VARS['address'])) {
+      $reset_payment = false;
+      if (tep_session_is_registered('billto')) {
+        if ($billto != $HTTP_POST_VARS['address']) {
+          if (tep_session_is_registered('payment')) {
+            $reset_payment = true;
+          }
+        }
+      } else {
+        tep_session_register('billto');
+      }
+
+      $billto = $HTTP_POST_VARS['address'];
+
+      $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");
+      $check_address = tep_db_fetch_array($check_address_query);
+
+      if ($check_address['total'] == '1') {
+        if ($reset_payment == true) tep_session_unregister('payment');
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+      } else {
+        tep_session_unregister('billto');
+      }
+// no addresses to select from - customer decided to keep the current assigned address
+    } else {
+      if (!tep_session_is_registered('billto')) tep_session_register('billto');
+      $billto = $customer_default_address_id;
+
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+    }
+  }
+
+// if no billing destination address was selected, use their own address as default
+  if (!tep_session_is_registered('billto')) {
+    $billto = $customer_default_address_id;
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'));
+
+  $addresses_count = tep_count_customer_address_book_entries();
+
+  $content = CONTENT_CHECKOUT_PAYMENT_ADDRESS;
+  $javascript = $content . '.js.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/checkout_paypalipn.php
===================================================================
--- trunk/direct.openmoko.com/checkout_paypalipn.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/checkout_paypalipn.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,262 @@
+<?php
+/*
+  $Id: checkout_paypalipn.php,v 1.1.1.1 2004/03/04 23:37:56 ccwjr Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Paypal IPN v0.981 for Milestone 2
+  Copyright (c) 2003 Pablo Pasqualino
+  pablo_osc at osmosisdc.com
+  http://www.osmosisdc.com
+
+  Released under the GNU General Public License
+*/
+
+  include('includes/application_top.php');
+
+// if the customer is not logged on, redirect them to the login page
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  if (!tep_session_is_registered('sendto')) {
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+  }
+
+  if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+  }
+
+// avoid hack attempts during the checkout procedure by checking the internal cartID
+  if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
+    if ($cart->cartID != $cartID) {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+    }
+  }
+
+  include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);
+
+// load selected payment module
+  require(DIR_WS_CLASSES . 'payment.php');
+  if ($credit_covers) $payment=''; //ICW added for CREDIT CLASS
+  $payment_modules = new payment($payment);
+
+// load the selected shipping module
+  require(DIR_WS_CLASSES . 'shipping.php');
+  $shipping_modules = new shipping($shipping);
+
+  require(DIR_WS_CLASSES . 'order.php');
+  $order = new order;
+  
+// load the before_process function from the payment modules
+  $payment_modules->before_process();
+
+  require(DIR_WS_CLASSES . 'order_total.php');
+  $order_total_modules = new order_total;
+
+  $order_totals = $order_total_modules->process();
+
+// BOF: WebMakers.com Added: Downloads Controller
+  $sql_data_array = array('customers_id' => (int)$customer_id,
+                          'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
+                          'customers_company' => $order->customer['company'],
+                          'customers_street_address' => $order->customer['street_address'],
+                          'customers_suburb' => $order->customer['suburb'],
+                          'customers_city' => $order->customer['city'],
+                          'customers_postcode' => $order->customer['postcode'], 
+                          'customers_state' => $order->customer['state'], 
+                          'customers_country' => $order->customer['country']['title'], 
+                          'customers_telephone' => $order->customer['telephone'], 
+                          'customers_email_address' => $order->customer['email_address'],
+                          'customers_address_format_id' => $order->customer['format_id'], 
+                          'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 
+                          'delivery_company' => $order->delivery['company'],
+                          'delivery_street_address' => $order->delivery['street_address'], 
+                          'delivery_suburb' => $order->delivery['suburb'], 
+                          'delivery_city' => $order->delivery['city'], 
+                          'delivery_postcode' => $order->delivery['postcode'], 
+                          'delivery_state' => $order->delivery['state'], 
+                          'delivery_country' => $order->delivery['country']['title'], 
+                          'delivery_address_format_id' => $order->delivery['format_id'], 
+                          'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 
+                          'billing_company' => $order->billing['company'],
+                          'billing_street_address' => $order->billing['street_address'], 
+                          'billing_suburb' => $order->billing['suburb'], 
+                          'billing_city' => $order->billing['city'], 
+                          'billing_postcode' => $order->billing['postcode'], 
+                          'billing_state' => $order->billing['state'], 
+                          'billing_country' => $order->billing['country']['title'], 
+                          'billing_address_format_id' => $order->billing['format_id'], 
+                          'payment_method' => $order->info['payment_method'],
+// BOF: Lango Added for print order mod 
+                          'payment_info' => $GLOBALS['payment_info'],
+// EOF: Lango Added for print order mod 
+                          'cc_type' => $order->info['cc_type'], 
+                          'cc_owner' => $order->info['cc_owner'], 
+                          'cc_number' => $order->info['cc_number'], 
+                          'cc_expires' => $order->info['cc_expires'], 
+                          'date_purchased' => 'now()', 
+                          'last_modified' => 'now()', 
+                          'orders_status' => 99999, 
+                          'currency' => $order->info['currency'], 
+                          'currency_value' => $order->info['currency_value']);
+// EOF: WebMakers.com Added: Downloads Controller
+  tep_db_perform(TABLE_ORDERS, $sql_data_array);
+  $insert_id = tep_db_insert_id();
+  for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
+    $sql_data_array = array('orders_id' => $insert_id,
+                            'title' => $order_totals[$i]['title'],
+                            'text' => $order_totals[$i]['text'],
+                            'value' => $order_totals[$i]['value'], 
+                            'class' => $order_totals[$i]['code'], 
+                            'sort_order' => $order_totals[$i]['sort_order']);
+    tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
+  }
+
+  $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
+  $sql_data_array = array('orders_id' => $insert_id, 
+                          'orders_status_id' => '99999', 
+                          'date_added' => 'now()', 
+                          'customer_notified' => $customer_notification,
+                          'comments' => $order->info['comments']);
+  tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
+
+  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+// Stock Update - Joao Correia
+    if (STOCK_LIMITED == 'true' && MODULE_PAYMENT_PAYPALIPN_UPDATE_STOCK_BEFORE_PAYMENT=='True') {
+      $downloadable_product = false;
+      if (DOWNLOAD_ENABLED == 'true') {
+        // see if this product actually has a downloadable file in the attributes
+        $download_check_query_raw = "SELECT products_quantity, pad.products_attributes_filename
+                            FROM " . TABLE_PRODUCTS . " p, 
+                            " . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+                            " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                             WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'
+                             and p.products_id=pa.products_id
+                             and pad.products_attributes_id=pa.products_attributes_id ";
+                             
+        $download_check_query = tep_db_query($download_check_query_raw);
+        if (tep_db_num_rows($download_check_query) > 0) {
+          $downloadable_product = true;
+        }
+      }  // end of downloadable product check
+      if ( !$downloadable_product ) {
+        $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        $stock_values = tep_db_fetch_array($stock_query);
+        $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
+        tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        }
+      }
+    }
+
+// Update products_ordered (for bestsellers list) 
+    tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+
+    $sql_data_array = array('orders_id' => $insert_id, 
+                            'products_id' => tep_get_prid($order->products[$i]['id']), 
+                            'products_model' => $order->products[$i]['model'], 
+                            'products_name' => $order->products[$i]['name'], 
+                            'products_price' => $order->products[$i]['price'], 
+                            'final_price' => $order->products[$i]['final_price'], 
+                            'products_tax' => $order->products[$i]['tax'], 
+                            'products_quantity' => $order->products[$i]['qty']);
+    tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
+    $order_products_id = tep_db_insert_id();
+    $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM
+//------insert customer choosen option to order--------
+    $attributes_exist = '0';
+    $products_ordered_attributes = '';
+    if (isset($order->products[$i]['attributes'])) {
+      $attributes_exist = '1';
+      for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+        if (DOWNLOAD_ENABLED == 'true') {
+          $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename 
+                               from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
+                               left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                                on pa.products_attributes_id=pad.products_attributes_id
+                               where pa.products_id = '" . $order->products[$i]['id'] . "' 
+                                and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' 
+                                and pa.options_id = popt.products_options_id 
+                                and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' 
+                                and pa.options_values_id = poval.products_options_values_id 
+                                and poptt.language_id = '" . (int)$languages_id . "' 
+                                and poval.language_id = '" . (int)$languages_id . "'";
+          $attributes = tep_db_query($attributes_query);
+        } else {
+          $attributes = tep_db_query("select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,  " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and poptt.products_options_text_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and poptt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
+        }
+        $attributes_values = tep_db_fetch_array($attributes);
+
+        $sql_data_array = array('orders_id' => $insert_id, 
+                                'orders_products_id' => $order_products_id, 
+                                'products_options' => $attributes_values['products_options_name'],
+                                'products_options_values' => $attributes_values['products_options_values_name'], 
+                                'options_values_price' => $attributes_values['options_values_price'], 
+                                'price_prefix' => $attributes_values['price_prefix']);
+        tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
+  
+        if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
+          $sql_data_array = array('orders_id' => $insert_id, 
+                                  'orders_products_id' => $order_products_id, 
+                                  'orders_products_filename' => $attributes_values['products_attributes_filename'], 
+                                  'download_maxdays' => $attributes_values['products_attributes_maxdays'], 
+                                  'download_count' => $attributes_values['products_attributes_maxcount']);
+          tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
+        }
+        $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
+      }
+    }
+//------insert customer choosen option eof ----
+    $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
+    $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
+    $total_cost += $total_products_price;
+
+    $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
+  }
+  $order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM
+
+ // Include OSC-AFFILIATE  DMG  
+  require(DIR_WS_INCLUDES . 'affiliate_checkout_process.php');
+
+
+// load the after_process function from the payment modules
+  $payment_modules->after_process();
+
+// unregister session variables used during checkout
+  tep_session_unregister('sendto');
+  tep_session_unregister('billto');
+  tep_session_unregister('shipping');
+  tep_session_unregister('payment');
+  tep_session_unregister('comments');
+
+  if (ereg($order->info['currency'],MODULE_PAYMENT_PAYPALIPN_ALLOWED_CURRENCIES)) {
+    $paypal_ipn_currency = $order->info['currency'];
+  } else {
+    $paypal_ipn_currency = MODULE_PAYMENT_PAYPALIPN_DEFAULT_CURRENCY;
+  };
+
+  $paypal_ipn_order_amount = $order->info['total'];
+
+  if (MODULE_PAYMENT_PAYPALIPN_ADD_SHIPPING_TO_AMOUNT=='True') {
+    $paypal_ipn_shipping_amount = 0.00;
+  } else {
+    $paypal_ipn_order_amount -= $order->info['shipping_cost'];
+    $paypal_ipn_shipping_amount = number_format($order->info['shipping_cost'] * $currencies->get_value($paypal_ipn_currency), 2);
+  };
+
+  if (MODULE_PAYMENT_PAYPALIPN_ADD_TAX_TO_AMOUNT=='True') {
+    $paypal_ipn_tax_amount = 0.00;
+  } else {
+    $paypal_ipn_order_amount -= $order->info['tax'];
+    $paypal_ipn_tax_amount = number_format($order->info['tax'] * $currencies->get_value($paypal_ipn_currency), 2);
+  };
+
+  $paypal_ipn_order_amount = number_format($paypal_ipn_order_amount * $currencies->get_value($paypal_ipn_currency), 2);
+
+  tep_redirect("https://www.paypal.com/cgi-bin/webscr?cmd=_ext-enter&redirect_cmd=_xclick&business=".MODULE_PAYMENT_PAYPALIPN_ID."&item_name=".urlencode(STORE_NAME)."&item_number=".$insert_id."&currency_code=".$paypal_ipn_currency."&amount=".$paypal_ipn_order_amount."&shipping=".$paypal_ipn_shipping_amount."&tax=".$paypal_ipn_tax_amount."&first_name=".urlencode($order->customer['firstname'])."&last_name=".urlencode($order->customer['lastname'])."&address1=".urlencode($order->customer['street_address'])."&city=".urlencode($order->customer['city'])."&state=".urlencode($order->customer['state'])."&zip=".urlencode($order->customer['postcode'])."&email=".$order->customer['email_address']."&bn=oscommerce-osmosis-0.981&return=".tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')."&cancel_return=".tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')."&notify_url=".MODULE_PAYMENT_PAYPALIPN_NOTIFY_URL);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/checkout_process.php
===================================================================
--- trunk/direct.openmoko.com/checkout_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/checkout_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,377 @@
+<?php
+/*
+  $Id: checkout_process.php,v 1.1.1.2 2004/03/04 23:37:57 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  include('includes/application_top.php');
+
+  $ip = $HTTP_SERVER_VARS["REMOTE_ADDR"];
+  $client = gethostbyaddr($HTTP_SERVER_VARS["REMOTE_ADDR"]);
+  $str = preg_split("/\./", $client);
+  $i = count($str);
+  $x = $i - 1;
+  $n = $i - 2;
+  $isp = $str[$n] . "." . $str[$x];
+
+// if the customer is not logged on, redirect them to the login page
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  if (!tep_session_is_registered('sendto')) {
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+  }
+
+  if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+ }
+
+// avoid hack attempts during the checkout procedure by checking the internal cartID
+  if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
+    if ($cart->cartID != $cartID) {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+    }
+  }
+
+  include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);
+
+// load selected payment module
+  require(DIR_WS_CLASSES . 'payment.php');
+  if ($credit_covers) $payment=''; //ICW added for CREDIT CLASS
+  $payment_modules = new payment($payment);
+
+// load the selected shipping module
+  require(DIR_WS_CLASSES . 'shipping.php');
+  $shipping_modules = new shipping($shipping);
+  require(DIR_WS_CLASSES . 'order.php');
+  $order = new order;
+
+if(!class_exists('order_total')) {
+ include(DIR_WS_CLASSES . 'order_total.php');
+ $order_total_modules = new order_total;
+}
+
+  $order_totals = $order_total_modules->process();
+
+
+
+// load the before_process function from the payment modules.  
+// Authorize.net/QuickCommerce/PlugnPlay processing - this called moved to a later point
+// This is maintained for compatiblity with all other modules
+// update for incorrect logic - start - 06/09/06 - datazen
+/* old code commented out
+ if (!MODULE_PAYMENT_AUTHORIZENET_STATUS)
+   {
+    $payment_modules->before_process();
+    }
+*/
+ if( ((MODULE_PAYMENT_AUTHORIZENET_STATUS == 'True') && ($payment == 'authorizenet') ) || 
+    ((MODULE_PAYMENT_QUICKCOMMERCE_STATUS =='True') && ($payment == 'quickcommerce') ) || 
+    ((MODULE_PAYMENT_PLUGNPAY_STATUS =='True')  && ($payment == 'plugnpay')) ){
+    //don't load before process
+  } elseif((MODULE_PAYMENT_PAYPAL_STATUS == 'True') && ($payment == 'paypal')) {
+    $payment_modules->before_process();
+    include(DIR_WS_MODULES . 'payment/paypal/catalog/checkout_process.inc.php');
+  } else {
+    $payment_modules->before_process();
+  }
+// update for incorrect logic - end
+  
+  if ( (PAYMENT_CC_CRYPT == 'True' ) && !empty($order->info['cc_number']) ){
+   $cc_number1 = cc_encrypt($order->info['cc_number']);
+   $cc_expires1 = cc_encrypt($order->info['cc_expires']);
+  }else{
+   $cc_number1 =$order->info['cc_number'];
+   $cc_expires1 =$order->info['cc_expires'];
+  }
+  
+  
+// BOF: WebMakers.com Added: Downloads Controller
+  $sql_data_array = array('customers_id' => $customer_id,
+                          'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
+                          'customers_company' => $order->customer['company'],
+                          'customers_street_address' => $order->customer['street_address'],
+                          'customers_suburb' => $order->customer['suburb'],
+                          'customers_city' => $order->customer['city'],
+                          'customers_postcode' => $order->customer['postcode'],
+                          'customers_state' => $order->customer['state'],
+                          'customers_country' => $order->customer['country']['title'],
+                          'customers_telephone' => $order->customer['telephone'],
+                          'customers_email_address' => $order->customer['email_address'],
+                          'customers_address_format_id' => $order->customer['format_id'],
+                          'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
+                          'delivery_company' => $order->delivery['company'],
+                          'delivery_street_address' => $order->delivery['street_address'],
+                          'delivery_suburb' => $order->delivery['suburb'],
+                          'delivery_city' => $order->delivery['city'],
+                          'delivery_postcode' => $order->delivery['postcode'],
+                          'delivery_state' => $order->delivery['state'],
+                          'delivery_country' => $order->delivery['country']['title'],
+                          'delivery_address_format_id' => $order->delivery['format_id'],
+                          'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
+                          'billing_company' => $order->billing['company'],
+                          'billing_street_address' => $order->billing['street_address'],
+                          'billing_suburb' => $order->billing['suburb'],
+                          'billing_city' => $order->billing['city'],
+                          'billing_postcode' => $order->billing['postcode'],
+                          'billing_state' => $order->billing['state'],
+                          'billing_country' => $order->billing['country']['title'],
+                          'billing_address_format_id' => $order->billing['format_id'],
+                          'payment_method' => $order->info['payment_method'],
+                          'payment_info' => $GLOBALS['payment_info'],
+                          'cc_type' => $order->info['cc_type'],
+                          'cc_owner' => $order->info['cc_owner'],
+                          'cc_number' => $cc_number1,
+                          'cc_ccv' => '',
+                          'cc_start' => $order->info['cc_start'],
+                          'cc_issue' => $order->info['cc_issue'],
+                          'cc_expires' => $cc_expires1,
+                          'date_purchased' => 'now()',
+                          'last_modified' => 'now()',
+                          'orders_status' => $order->info['order_status'],
+                          'currency' => $order->info['currency'],
+                          'currency_value' => $order->info['currency_value'],
+                          'ipaddy' => $ip,
+        'ipisp' => $isp);
+              
+// EOF: WebMakers.com Added: Downloads Controller
+  tep_db_perform(TABLE_ORDERS, $sql_data_array);
+  $insert_id = tep_db_insert_id();
+
+// Make sure the /catalog/includes/class/order.php is included
+// and $order object is created before this!!!
+// load the before_process function from the payment modules
+
+//************
+  if(defined(MODULE_PAYMENT_AUTHORIZENET_STATUS) && MODULE_PAYMENT_AUTHORIZENET_STATUS) {
+    include(DIR_WS_MODULES . 'authorizenet_direct.php');
+    $payment_modules->before_process();
+  }
+//************************************************************
+
+ //quickcommerce
+ if(defined(MODULE_PAYMENT_QUICKCOMMERCE_STATUS) && MODULE_PAYMENT_QUICKCOMMERCE_STATUS) {
+    include(DIR_WS_MODULES . 'quickcommerce_direct.php');
+    $payment_modules->before_process();
+  }
+//***********************************
+  if(defined(MODULE_PAYMENT_PLUGNPAY_STATUS) && MODULE_PAYMENT_PLUGNPAY_STATUS) {
+    include(DIR_WS_MODULES . 'plugnpay_api.php');
+    $payment_modules->before_process();
+  }
+
+
+
+//insert order total
+
+  for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
+    $sql_data_array = array('orders_id' => $insert_id,
+                            'title' => $order_totals[$i]['title'],
+                            'text' => $order_totals[$i]['text'],
+                            'value' => $order_totals[$i]['value'],
+                            'class' => $order_totals[$i]['code'],
+                            'sort_order' => $order_totals[$i]['sort_order']);
+    tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
+  }
+
+  $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
+  $sql_data_array = array('orders_id' => $insert_id,
+                          'orders_status_id' => $order->info['order_status'],
+                          'date_added' => 'now()',
+                          'customer_notified' => $customer_notification,
+                          'comments' => $order->info['comments']);
+  tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
+
+// initialized for the email confirmation
+  $products_ordered = '';
+  $subtotal = 0;
+  $total_tax = 0;
+
+  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+// Stock Update - Joao Correia
+    if (STOCK_LIMITED == 'true') {
+      $downloadable_product = false;
+      if (DOWNLOAD_ENABLED == 'true') {
+        // see if this product actually has a downloadable file in the attributes
+        $download_check_query_raw = "SELECT products_quantity, pad.products_attributes_filename
+                            FROM " . TABLE_PRODUCTS . " p, 
+                            " . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+                            " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                             WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'
+                             and p.products_id=pa.products_id
+                             and pad.products_attributes_id=pa.products_attributes_id ";
+                             
+        $download_check_query = tep_db_query($download_check_query_raw);
+        if (tep_db_num_rows($download_check_query) > 0) {
+          $downloadable_product = true;
+        }
+      }  // end of downloadable product check
+      if ( !$downloadable_product ) {
+        $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        $stock_values = tep_db_fetch_array($stock_query);
+        $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
+        tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        }
+      }
+    }
+
+// Update products_ordered (for bestsellers list)
+    tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+
+    $sql_data_array = array('orders_id' => $insert_id,
+                            'products_id' => tep_get_prid($order->products[$i]['id']),
+                            'products_model' => $order->products[$i]['model'],
+                            'products_name' => $order->products[$i]['name'],
+                            'products_price' => $order->products[$i]['price'],
+                            'final_price' => $order->products[$i]['final_price'],
+                            'products_tax' => $order->products[$i]['tax'],
+                            'products_quantity' => $order->products[$i]['qty']);
+    tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
+    $order_products_id = tep_db_insert_id();
+    $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM
+
+//------insert customer choosen option to order--------
+    $products_ordered_attributes = '';
+    if (isset($order->products[$i]['attributes'])) {
+      for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+        
+        $sql_data_array = array('orders_id' => $insert_id,
+                                'orders_products_id' => $order_products_id,
+                                'products_options' => $order->products[$i]['attributes'][$j]['option'],
+                                'products_options_values' => $order->products[$i]['attributes'][$j]['value'],
+                                'options_values_price' => $order->products[$i]['attributes'][$j]['price'],
+                                'price_prefix' => $order->products[$i]['attributes'][$j]['prefix'],
+                                'products_options_id' => $order->products[$i]['attributes'][$j]['option_id'],
+                                'products_options_values_id' => $order->products[$i]['attributes'][$j]['value_id']);
+        tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
+        
+        if (DOWNLOAD_ENABLED == 'true') {
+          $attributes_query = "select pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
+                           from " . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+                                " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                              where pa.products_id = '" . $order->products[$i]['id'] . "'
+                                and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
+                                and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
+                                and pa.products_attributes_id = pad.products_attributes_id";
+          $attributes = tep_db_query($attributes_query);
+          
+          $attributes_values = tep_db_fetch_array($attributes);
+        
+          if ( isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename']) ) {
+            $sql_data_array = array('orders_id' => $insert_id,
+                                    'orders_products_id' => $order_products_id,
+                                    'orders_products_filename' => $attributes_values['products_attributes_filename'],
+                                    'download_maxdays' => $attributes_values['products_attributes_maxdays'],
+                                    'download_count' => $attributes_values['products_attributes_maxcount']);
+            tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
+          }
+        }
+        $products_ordered_attributes .= "\n\t" . $order->products[$i]['attributes'][$j]['option'] . ' ' . $order->products[$i]['attributes'][$j]['value'] . ' ' . $order->products[$i]['attributes'][$j]['prefix'] . ' ' . $currencies->display_price($order->products[$i]['attributes'][$j]['price'], tep_get_tax_rate($products[$i]['tax_class_id']), 1);
+      }
+    }
+//------insert customer choosen option eof ----
+    $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
+    $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
+    $total_cost += $total_products_price;
+
+    $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
+  }
+$order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM
+// lets start with the email confirmation
+
+  // Include OSC-AFFILIATE
+  require(DIR_WS_INCLUDES . 'affiliate_checkout_process.php');
+
+  if (!tep_session_is_registered('noaccount'))
+{
+$email_order = STORE_NAME . "\n" .
+EMAIL_SEPARATOR . "\n" .
+EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
+EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
+EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
+}else{
+$email_order = STORE_NAME . "\n" .
+EMAIL_SEPARATOR . "\n" .
+EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
+EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
+}
+
+// EOF: daithik change for PWA
+
+  if ($order->info['comments']) {
+    $email_order .= tep_db_output($order->info['comments']) . "\n\n";
+  }
+  $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
+                  EMAIL_SEPARATOR . "\n" .
+                  $products_ordered .
+                  EMAIL_SEPARATOR . "\n";
+
+  for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
+    $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
+  }
+
+  if ($order->content_type != 'virtual') {
+    $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
+                    EMAIL_SEPARATOR . "\n" .
+                    tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
+  }
+
+  $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
+                  EMAIL_SEPARATOR . "\n" .
+                  tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
+  if (is_object($$payment)) {
+    $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
+                    EMAIL_SEPARATOR . "\n";
+    $payment_class = $$payment;
+    $email_order .= $payment_class->title . "\n\n";
+    if ($payment_class->email_footer) {
+      $email_order .= $payment_class->email_footer . "\n\n";
+    }
+  }
+  
+  tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+
+// send emails to other people
+  if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
+    tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+  }
+
+// load the after_process function from the payment modules
+  $payment_modules->after_process();
+  
+// AFSv1.0 - record the customers order and ip address info for fraud screening process
+
+$ip = $REMOTE_ADDR;
+$proxy = $HTTP_X_FORWARDED_FOR;
+if($proxy != ''){ $ip = $proxy; }
+$sql_data_array = array( 'order_id' => $insert_id,
+'ip_address' => $ip);
+
+tep_db_perform('algozone_fraud_queries', $sql_data_array);
+
+// End AFSv1.0
+  $cart->reset(true);
+
+// unregister session variables used during checkout
+  tep_session_unregister('sendto');
+  tep_session_unregister('billto');
+  tep_session_unregister('shipping');
+  tep_session_unregister('payment');
+  tep_session_unregister('comments');
+  if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');
+  $order_total_modules->clear_posts();//ICW ADDED FOR CREDIT CLASS SYSTEM
+// BOF: Lango added for print order mod
+  tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'order_id='. $insert_id, 'SSL'));
+// EOF: Lango added for print order mod
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/checkout_shipping.php
===================================================================
--- trunk/direct.openmoko.com/checkout_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/checkout_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,178 @@
+<?php
+/*
+  $Id: checkout_shipping.php,v 1.1.1.1 2004/03/04 23:37:57 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  Shoppe Enhancement Controller - Copyright (c) 2003 WebMakers.com
+  Linda McGrath - osCommerce at WebMakers.com
+*/
+
+  require('includes/application_top.php');
+  require('includes/classes/http_client.php');
+
+// BOF: WebMakers.com Added: Downloads Controller - Free Shipping
+// Reset $shipping if free shipping is on and weight is not 0
+if (tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS') and $cart->show_weight()!=0) {
+  tep_session_unregister('shipping');
+}
+// EOF: WebMakers.com Added: Downloads Controller - Free Shipping
+// if the customer is not logged on, redirect them to the login page
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// if there is nothing in the customers cart, redirect them to the shopping cart page
+  if ($cart->count_contents() < 1) {
+    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+  }
+// BOF: WebMakers.com Added: Attributes Sorter and Copier and Quantity Controller
+// Validate Cart for checkout
+  $valid_to_checkout= true;
+  $cart->get_products(true);
+  if (!$valid_to_checkout) {
+    //$messageStack->add_session('header', 'Please update your order ...', 'error');
+    $messageStack->add_session('header', ERROR_VALID_TO_CHECKOUT, 'error');
+    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+  }
+// EOF: WebMakers.com Added: Attributes Sorter and Copier and Quantity Controller
+
+// if no shipping destination address was selected, use the customers own address as default
+  if (!tep_session_is_registered('sendto')) {
+    tep_session_register('sendto');
+    $sendto = $customer_default_address_id;
+  } else {
+// verify the selected shipping address
+    $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
+    $check_address = tep_db_fetch_array($check_address_query);
+
+    if ($check_address['total'] != '1') {
+      $sendto = $customer_default_address_id;
+      if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
+    }
+  }
+
+  require(DIR_WS_CLASSES . 'order.php');
+  $order = new order;
+
+// register a random ID in the session to check throughout the checkout procedure
+// against alterations in the shopping cart contents
+  if (!tep_session_is_registered('cartID')) tep_session_register('cartID');
+  $cartID = $cart->cartID;
+
+// if the order contains only virtual products, forward the customer to the billing page as
+// a shipping address is not needed
+// ICW CREDIT CLASS GV AMENDE LINE BELOW
+//  if ($order->content_type == 'virtual') {
+  if (($order->content_type == 'virtual') || ($order->content_type == 'virtual_weight') ) {
+    if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
+    $shipping = false;
+    $sendto = false;
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+  }
+
+  $total_weight = $cart->show_weight();
+  $total_count = $cart->count_contents();
+
+// load all enabled shipping modules
+  require(DIR_WS_CLASSES . 'shipping.php');
+  $shipping_modules = new shipping;
+
+  if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
+    $pass = false;
+
+    switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
+      case 'national':
+        if ($order->delivery['country_id'] == STORE_COUNTRY) {
+          $pass = true;
+        }
+        break;
+      case 'international':
+        if ($order->delivery['country_id'] != STORE_COUNTRY) {
+          $pass = true;
+        }
+        break;
+      case 'both':
+        $pass = true;
+        break;
+    }
+
+    $free_shipping = false;
+    if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
+      $free_shipping = true;
+
+      include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
+    }
+  } else {
+    $free_shipping = false;
+  }
+
+// process the selected shipping method
+  if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {
+    if (!tep_session_is_registered('comments')) tep_session_register('comments');
+    if (tep_not_null($HTTP_POST_VARS['comments'])) {
+      $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
+    }
+
+    if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
+
+    if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
+      if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
+        $shipping = $HTTP_POST_VARS['shipping'];
+
+        list($module, $method) = explode('_', $shipping);
+        if ( is_object($$module) || ($shipping == 'free_free') ) {
+          if ($shipping == 'free_free') {
+            $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
+            $quote[0]['methods'][0]['cost'] = '0';
+          } else {
+            $quote = $shipping_modules->quote($method, $module);
+          }
+          if (isset($quote['error'])) {
+            tep_session_unregister('shipping');
+          } else {
+            if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
+              $shipping = array('id' => $shipping,
+                                'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
+                                'cost' => $quote[0]['methods'][0]['cost']);
+
+              tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+            }
+          }
+        } else {
+          tep_session_unregister('shipping');
+        }
+      }
+    } else {
+      $shipping = false;
+                
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+    }    
+  }
+
+// get all available shipping quotes
+  $quotes = $shipping_modules->quote();
+
+// if no shipping method has been selected, automatically select the cheapest method.
+// if the modules status was changed when none were available, to save on implementing
+// a javascript force-selection method, also automatically select the cheapest shipping
+// method if more than one module is now enabled
+  if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING);
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+
+  $content = CONTENT_CHECKOUT_SHIPPING;
+  $javascript = $content . '.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/checkout_shipping_address.php
===================================================================
--- trunk/direct.openmoko.com/checkout_shipping_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/checkout_shipping_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,217 @@
+<?php
+/*
+  $Id: checkout_shipping_address.php,v 1.1.1.1 2004/03/04 23:37:57 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// if the customer is not logged on, redirect them to the login page
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+// if there is nothing in the customers cart, redirect them to the shopping cart page
+  if ($cart->count_contents() < 1) {
+    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+  }
+
+  // needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING_ADDRESS);
+
+  require(DIR_WS_CLASSES . 'order.php');
+  $order = new order;
+
+// if the order contains only virtual products, forward the customer to the billing page as
+// a shipping address is not needed
+  if ($order->content_type == 'virtual') {
+    if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
+    $shipping = false;
+    if (!tep_session_is_registered('sendto')) tep_session_register('sendto');
+    $sendto = false;
+    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+  }
+
+  $error = false;
+  $process = false;
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit')) {
+// process a new shipping address
+    if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) && tep_not_null($HTTP_POST_VARS['street_address'])) {
+      $process = true;
+
+      if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
+      if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
+      $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
+      $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
+      $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
+      if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
+      $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
+      $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
+      $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+      if (ACCOUNT_STATE == 'true') {
+        if (isset($HTTP_POST_VARS['zone_id'])) {
+          $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+        } else {
+          $zone_id = false;
+        }
+        $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+      }
+
+      if (ACCOUNT_GENDER == 'true') {
+        if ( ($gender != 'm') && ($gender != 'f') ) {
+          $error = true;
+
+          $messageStack->add('checkout_address', ENTRY_GENDER_ERROR);
+        }
+      }
+
+      if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_FIRST_NAME_ERROR);
+      }
+
+      if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_LAST_NAME_ERROR);
+      }
+
+      if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_STREET_ADDRESS_ERROR);
+      }
+
+      if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_POST_CODE_ERROR);
+      }
+
+      if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_CITY_ERROR);
+      }
+
+      if (ACCOUNT_STATE == 'true') {
+        $zone_id = 0;
+        $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
+        $check = tep_db_fetch_array($check_query);
+        $entry_state_has_zones = ($check['total'] > 0);
+        if ($entry_state_has_zones == true) {
+//state abbreviation bug fix applied 10/1/2004 DMG
+//now accepts abbreviations - no complaint re capitilization
+$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' OR zone_code = '" . tep_db_input($state) . "')");
+          if (tep_db_num_rows($zone_query) == 1) {
+            $zone = tep_db_fetch_array($zone_query);
+            $zone_id = $zone['zone_id'];
+          } else {
+            $error = true;
+
+            $messageStack->add('checkout_address', ENTRY_STATE_ERROR_SELECT);
+          }
+        } else {
+          if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
+            $error = true;
+
+            $messageStack->add('checkout_address', ENTRY_STATE_ERROR);
+          }
+        }
+      }
+
+      if ( (is_numeric($country) == false) || ($country < 1) ) {
+        $error = true;
+
+        $messageStack->add('checkout_address', ENTRY_COUNTRY_ERROR);
+      }
+
+      if ($error == false) {
+        $sql_data_array = array('customers_id' => $customer_id,
+                                'entry_firstname' => $firstname,
+                                'entry_lastname' => $lastname,
+                                'entry_street_address' => $street_address,
+                                'entry_postcode' => $postcode,
+                                'entry_city' => $city,
+                                'entry_country_id' => $country);
+
+        if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
+        if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
+        if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
+        if (ACCOUNT_STATE == 'true') {
+          if ($zone_id > 0) {
+            $sql_data_array['entry_zone_id'] = $zone_id;
+            $sql_data_array['entry_state'] = '';
+          } else {
+            $sql_data_array['entry_zone_id'] = '0';
+            $sql_data_array['entry_state'] = $state;
+          }
+        }
+
+        if (!tep_session_is_registered('sendto')) tep_session_register('sendto');
+
+        tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
+
+        $sendto = tep_db_insert_id();
+
+        if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+      }
+// process the selected shipping destination
+    } elseif (isset($HTTP_POST_VARS['address'])) {
+      $reset_shipping = false;
+      if (tep_session_is_registered('sendto')) {
+        if ($sendto != $HTTP_POST_VARS['address']) {
+          if (tep_session_is_registered('shipping')) {
+            $reset_shipping = true;
+          }
+        }
+      } else {
+        tep_session_register('sendto');
+      }
+
+      $sendto = $HTTP_POST_VARS['address'];
+
+      $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
+      $check_address = tep_db_fetch_array($check_address_query);
+
+      if ($check_address['total'] == '1') {
+        if ($reset_shipping == true) tep_session_unregister('shipping');
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+      } else {
+        tep_session_unregister('sendto');
+      }
+    } else {
+      if (!tep_session_is_registered('sendto')) tep_session_register('sendto');
+      $sendto = $customer_default_address_id;
+
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+    }
+  }
+
+// if no shipping destination address was selected, use their own address as default
+  if (!tep_session_is_registered('sendto')) {
+    $sendto = $customer_default_address_id;
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'));
+
+  $addresses_count = tep_count_customer_address_book_entries();
+
+  $content = CONTENT_CHECKOUT_SHIPPING_ADDRESS;
+  $javascript = $content . '.js.php';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/checkout_success.php
===================================================================
--- trunk/direct.openmoko.com/checkout_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/checkout_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,76 @@
+<?php
+/*
+  $Id: checkout_success.php,v 1.3 2004/09/25 14:36 DMG Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  // begin PayPal_Shopping_Cart_IPN 2.8 (DMG)
+  require(DIR_WS_MODULES . 'payment/paypal/classes/paypal_order.class.php');
+  // end PayPal_Shopping_Cart_IPN
+  // if the customer is not logged on, redirect them to the shopping cart page
+  if (!tep_session_is_registered('customer_id')) {
+    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+  }
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update')) {
+    $notify_string = 'action=notify&';
+    $notify = $HTTP_POST_VARS['notify'];
+    if (!is_array($notify)) $notify = array($notify);
+    for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
+      $notify_string .= 'notify[]=' . $notify[$i] . '&';
+    }
+    if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1);
+    // BOF: daithik change for PWA//  DMG Merge w. Paypal IPN 2.8
+    if (tep_session_is_registered('noaccount')) {
+      tep_session_destroy();
+      tep_redirect(tep_href_link(FILENAME_DEFAULT, '$notify_string', 'NONSSL'));
+    }else{
+      tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));
+    }
+  } else if ((isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'success')) {
+    //begin PayPal_Shopping_Cart_IPN
+    paypal_order::reset_checkout_cart_session();
+  }
+  //end PayPal_Shopping_Cart_IPN
+  // EOF: daithik change for PWA
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS);
+
+  $breadcrumb->add(NAVBAR_TITLE_1);
+  $breadcrumb->add(NAVBAR_TITLE_2);
+
+
+  // BOF: daithik change for PWA
+  if (tep_session_is_registered('noaccount')) {
+    $order_update = array('purchased_without_account' => '1');
+    tep_db_perform(TABLE_ORDERS, $order_update, 'update', "orders_id = '".$orders['orders_id']."'");
+    //  tep_db_query("insert into " . TABLE_ORDERS . " (purchased_without_account) values ('1') where orders_id = '" . (int)$orders['orders_id'] . "'");
+    tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . tep_db_input($customer_id) . "'");
+    tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . tep_db_input($customer_id) . "'");
+    tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . tep_db_input($customer_id) . "'");
+    tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . tep_db_input($customer_id) . "'");
+    tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . tep_db_input($customer_id) . "'");
+    tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . tep_db_input($customer_id) . "'");
+    if (!tep_session_is_registered('noaccount')){ 
+      tep_session_destroy();
+    }
+  }
+  // EOF: daithik change for PWA
+
+  // load all enabled checkout success modules
+  require(DIR_WS_CLASSES . 'checkout_success.php');
+  $checkout_success_modules = new checkout_success;
+
+  $content = CONTENT_CHECKOUT_SUCCESS;
+  $javascript = 'popup_window_print.js';
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+  
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/contact_us.php
===================================================================
--- trunk/direct.openmoko.com/contact_us.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/contact_us.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,109 @@
+<?php
+/*
+  $Id: contact_us.php,v 1.1.1.1 2004/03/04 23:37:58 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+Email security fix added 
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);
+
+  $vccCheckOk="True";
+  //VISUAL VERIFY CODE start
+    $code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . tep_session_id() . "'");
+    $code_array = tep_db_fetch_array($code_query);
+    $code = $code_array['code'];
+
+    tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . tep_session_id() . "'"); //remove the visual verify code associated with this session to clean database and ensure new results
+
+    $user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
+    if (!(strcasecmp($user_entered_code, $code) == 0)) {    //make the check case insensitive
+        $error = true;
+        
+    if(($HTTP_GET_VARS['action'] == 'send'))
+    {
+      $messageStack->add('contact', VISUAL_VERIFY_CODE_ENTRY_ERROR);
+    }
+    
+    $vccCheckOk="False";    
+    }
+//VISUAL VERIFY CODE stop
+
+  $error = false;
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && $vccCheckOk=='True') {
+    $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
+    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
+    $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
+
+    // VJ enhancement begin
+    $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
+    $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
+    $street = tep_db_prepare_input($HTTP_POST_VARS['street']);
+    $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
+    $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+    $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
+    $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+
+    $topic = tep_db_prepare_input($HTTP_POST_VARS['topic']);
+    $subject = tep_db_prepare_input($HTTP_POST_VARS['subject']);
+
+    $urgent = (tep_db_prepare_input($HTTP_POST_VARS['urgent']) == 'on') ? '1' : '0';
+    $self = (tep_db_prepare_input($HTTP_POST_VARS['self']) == 'on') ? '1' : '0';
+
+    $urgent_string = '';
+    if ($urgent == '1') {
+      $urgent_string = '(' . TEXT_SUBJECT_URGENT . ')';
+    }
+
+    $subject_string = TEXT_SUBJECT_PREFIX . ' ' . $subject . $urgent_string;
+    $message_string = $topic . ": " . $subject . "\n\n" . 
+      $enquiry . "\n\n" . 
+      ENTRY_COMPANY . ' ' . $company . "\n" . 
+      ENTRY_NAME . ' ' . $name . "\n" . 
+      ENTRY_EMAIL . ' ' . $email_address . "\n" . 
+      ENTRY_STREET_ADDRESS . ' ' . $street . "\n" . 
+      ENTRY_CITY . ' ' . $city . "\n" . 
+      ENTRY_STATE . ' ' . $state . "\n" . 
+      ENTRY_POST_CODE . ' ' . $postcode . "\n" . 
+      ENTRY_COUNTRY . ' ' . tep_get_country_name($country) . "\n" . 
+      ENTRY_TELEPHONE_NUMBER . ' ' . $telephone . "\n";
+
+    $ipaddress = $HTTP_SERVER_VARS["REMOTE_ADDR"];
+    $message_string .= "\n\n" . 'IP: ' . $ipaddress . "\n";
+    // VJ enhancement end
+
+    if (tep_validate_email($email_address)) {
+      // VJ enhancement begin
+      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $subject_string, $message_string, $name, $email_address); 
+
+      // email a copy to sender, if opted
+    if ($self == '1') {
+        tep_mail($name, $email_address, $subject_string, $message_string, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); 
+      }
+      // VJ enhancement end
+
+      tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success', 'SSL'));
+    } 
+  else
+  {
+      $error = true;
+      $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
+      $enquiry = "";
+      $name = "";
+      $email = "";      
+    }
+ } 
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US, '', 'SSL'));
+
+  $content = CONTENT_CONTACT_US;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/cookie_usage.php
===================================================================
--- trunk/direct.openmoko.com/cookie_usage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/cookie_usage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: cookie_usage.php,v 1.1.1.1 2004/03/04 23:37:58 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_COOKIE_USAGE);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_COOKIE_USAGE));
+
+  $content = CONTENT_COOKIE_USAGE;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/create_account.php
===================================================================
--- trunk/direct.openmoko.com/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,376 @@
+<?php
+/*
+  $Id: create_account.php,v 1.4 2004/09/25 15:09:15 DMG Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc.
+  
+  Copyright &copy; 2003-2005
+  
+  Last Modified By : $Author$
+  Last Modified On : $Date$
+  Latest Revision :  $Revision: 3444 $
+  
+*/
+
+  require('includes/application_top.php');
+
+  // needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);
+
+  $process = false;  // used by the state routine
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
+    $process = true;
+
+    if (ACCOUNT_GENDER == 'true') {
+      if (isset($HTTP_POST_VARS['gender'])) {
+        $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
+      } else {
+        $gender = false;
+      }
+    }
+    $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
+    $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
+    if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
+    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
+    if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
+    $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
+    if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
+    $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
+    $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
+    if (ACCOUNT_STATE == 'true') {
+      $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+      if (isset($HTTP_POST_VARS['zone_id'])) {
+        $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+      } else {
+        $zone_id = false;
+      }
+    }
+    $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+    $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
+    $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
+    if (isset($HTTP_POST_VARS['newsletter'])) {
+      $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
+    } else {
+      $newsletter = false;
+    }
+    $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
+    $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);
+
+    $error = false;
+
+    if (ACCOUNT_GENDER == 'true') {
+      if ( ($gender != 'm') && ($gender != 'f') ) {
+        $error = true;
+
+        $messageStack->add('create_account', ENTRY_GENDER_ERROR);
+      }
+    }
+
+    if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
+    }
+
+    if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
+    }
+
+    if (ACCOUNT_DOB == 'true') {
+      if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {
+        $error = true;
+
+        $messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
+      }
+    }
+
+    if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
+    } elseif (tep_validate_email($email_address) == false) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
+    } else {
+      $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
+      $check_email = tep_db_fetch_array($check_email_query);
+      // BOF: daithik - PWA
+      //      if ($check_email['total'] > 0) {
+      //        $error = true;
+      //        $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
+      //      }
+      if ($check_email['total'] > 0) {  //PWA delete account
+        $get_customer_info = tep_db_query("select customers_id, customers_email_address, purchased_without_account from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
+        $customer_info = tep_db_fetch_array($get_customer_info);
+        $customer_id = $customer_info['customers_id'];
+        $customer_email_address = $customer_info['customers_email_address'];
+        $customer_pwa = $customer_info['purchased_without_account'];
+        if ($customer_pwa !='1') {
+          $error = true;
+
+          $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
+        } else {
+          tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
+          tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+          tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'");
+          tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "'");
+          tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "'");
+          tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . $customer_id . "'");
+        }
+      }
+      // EOF: daithik - PWA
+    }
+
+    if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR);
+    }
+
+    if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
+    }
+
+    if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_CITY_ERROR);
+    }
+
+    if (is_numeric($country) == false) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
+    }
+
+    if (ACCOUNT_STATE == 'true') {
+      $zone_id = 0;
+      $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
+      $check = tep_db_fetch_array($check_query);
+      $entry_state_has_zones = ($check['total'] > 0);
+      // State selection bug fix applied 10/1/2004 DMG
+      if ($entry_state_has_zones == true) {
+        $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' OR zone_code = '" . tep_db_input($state) . "')");
+        if (tep_db_num_rows($zone_query) == 1) {
+          $zone = tep_db_fetch_array($zone_query);
+          $zone_id = $zone['zone_id'];
+        } else {
+          $error = true;
+
+          $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
+        }
+      } else {
+        if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
+          $error = true;
+
+          $messageStack->add('create_account', ENTRY_STATE_ERROR);
+        }
+      }
+    }
+
+    if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
+    }
+
+
+    if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
+    } elseif ($password != $confirmation) {
+      $error = true;
+
+      $messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
+    }
+
+  
+    //VISUAL VERIFY CODE start
+    $code_query = tep_db_query("select code from " . TABLE_VISUAL_VERIFY_CODE . "  where oscsid = '" . tep_session_id() . "'");
+    $code_array = tep_db_fetch_array($code_query);
+    $code = $code_array['code'];
+
+    tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . tep_session_id() . "'"); //remove the visual verify code associated with this session to clean database and ensure new results
+
+    $user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
+    if (!(strcasecmp($user_entered_code, $code) == 0)) {    //make the check case insensitive
+      $error = true;
+      $messageStack->add('create_account', VISUAL_VERIFY_CODE_ENTRY_ERROR);
+    }
+    //VISUAL VERIFY CODE stop
+
+
+    if ($error == false) {
+      $sql_data_array = array('customers_firstname' => $firstname,
+                              'customers_lastname' => $lastname,
+                              'customers_email_address' => $email_address,
+                              'customers_telephone' => $telephone,
+                              'customers_fax' => $fax,
+                              'customers_newsletter' => $newsletter,
+                              'customers_password' => tep_encrypt_password($password));
+
+      if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
+      if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
+
+      tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
+
+      $customer_id = tep_db_insert_id();
+
+      $sql_data_array = array('customers_id' => $customer_id,
+                              'entry_firstname' => $firstname,
+                              'entry_lastname' => $lastname,
+                              'entry_street_address' => $street_address,
+                              'entry_postcode' => $postcode,
+                              'entry_city' => $city,
+                              'entry_country_id' => $country);
+
+      if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
+      if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
+      if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
+      if (ACCOUNT_STATE == 'true') {
+        if ($zone_id > 0) {
+          $sql_data_array['entry_zone_id'] = $zone_id;
+          $sql_data_array['entry_state'] = '';
+        } else {
+          $sql_data_array['entry_zone_id'] = '0';
+          $sql_data_array['entry_state'] = $state;
+        }
+      }
+
+      tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
+
+      $address_id = tep_db_insert_id();
+
+      tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");
+
+      tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");
+
+      if (SESSION_RECREATE == 'True') {
+        tep_session_recreate();
+      }
+
+      // If we are not doing the email confirmation, then log the customer in
+      if ( ACCOUNT_EMAIL_CONFIRMATION != 'true' ) {
+        $customer_first_name = $firstname;
+        $customer_default_address_id = $address_id;
+        $customer_country_id = $country;
+        $customer_zone_id = $zone_id;
+        tep_session_register('customer_id');
+        tep_session_register('customer_first_name');
+        tep_session_register('customer_default_address_id');
+        tep_session_register('customer_country_id');
+        tep_session_register('customer_zone_id');
+        // restore cart contents
+        $cart->restore_contents();
+
+      } else {  // we need to build the data to do the verification
+        $pw="ABCDEFGHJKMNOPQRSTUVWXYZabcdefghjkmnopqrstuvwxyz0123456789";
+        srand((double)microtime()*1000000);
+        for ($i=1;$i<=5;$i++){ 
+          $Pass .= $pw{rand(0,strlen($pw)-1)};
+        }
+        $pw1="ABCDEFGHJKMNOPQRSTUVWXYZabcdefghjkmnopqrstuvwxyz0123456789";
+        srand((double)microtime()*1000000);
+        for ($i=1;$i<=5;$i++){ 
+          $Pass_neu .= $pw1{rand(0,strlen($pw1)-1)};
+        }
+        tep_db_query('update customers set customers_validation_code = "' . $Pass . $Pass_neu . '" where customers_id = "' . $customer_id . '"');
+      }
+
+      $name = $firstname . ' ' . $lastname;
+
+      if (ACCOUNT_GENDER == 'true') {
+         if ($gender == 'm') {
+           $email_text = sprintf(EMAIL_GREET_MR, $lastname);
+         } else {
+           $email_text = sprintf(EMAIL_GREET_MS, $lastname);
+         }
+      } else {
+        $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
+      }
+
+      $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING . "\n" . "\n";
+      if ( ACCOUNT_EMAIL_CONFIRMATION == 'true' ) {
+        $email_text .=  "\n" . MAIL_VALIDATION . "\n" . '<a href="' . tep_href_link('pw.php', 'action=reg&pass=' . $Pass . $Pass_neu . '&verifyid=' . $customer_id, 'SSL', false) . '">' . VALIDATE_YOUR_MAILADRESS . '</a>' . "\n" . "\n" . '(' . SECOND_LINK . ' ' . tep_href_link('pw.php', 'action=reg&pass=' . $Pass . $Pass_neu . '&verifyid=' . $customer_id, 'SSL', false) . ' )' . "\n" . "\n". OR_VALIDATION_CODE . $Pass . $Pass_neu . "\n" . "\n";          
+      }
+
+// ICW - CREDIT CLASS CODE BLOCK ADDED  ******************************************************* BEGIN
+  if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
+    $coupon_code = create_coupon_code();
+    $insert_query = tep_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");
+    $insert_id = tep_db_insert_id($insert_query);
+    $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $email_address . "', now() )");
+
+    $email_text .= sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) . "\n\n" .
+                   sprintf(EMAIL_GV_REDEEM, $coupon_code) . "\n\n" .
+                   EMAIL_GV_LINK . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code,'NONSSL', false) .
+                   "\n\n";
+  }
+  if (NEW_SIGNUP_DISCOUNT_COUPON != '') {
+    $coupon_code = NEW_SIGNUP_DISCOUNT_COUPON;
+    $coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_code = '" . $coupon_code . "'");
+    $coupon = tep_db_fetch_array($coupon_query);
+    $coupon_id = $coupon['coupon_id'];
+    $coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . (int)$languages_id . "'");
+    $coupon_desc = tep_db_fetch_array($coupon_desc_query);
+    $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )");
+    $email_text .= EMAIL_COUPON_INCENTIVE_HEADER .  "\n" .
+                   sprintf("%s", $coupon_desc['coupon_description']) ."\n\n" .
+                   sprintf(EMAIL_COUPON_REDEEM, $coupon['coupon_code']) . "\n\n" .
+                   "\n\n";
+
+
+
+  }
+//    $email_text .= EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
+// ICW - CREDIT CLASS CODE BLOCK ADDED  ******************************************************* END
+      tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+
+      // VJ member approval begin
+      // admin email notification 
+//      $admin_email_text .= ADMIN_EMAIL_WELCOME . ADMIN_EMAIL_TEXT . EMAIL_WARNING;
+// remove hard coded admin notification for now.      
+//      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $admin_email_text, $name, $email_address, '');
+      // VJ member approval end
+
+      tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
+    }
+  } else {
+    // check to see if someone is already logged in
+    if ( tep_session_is_registered('customer_id') ) {
+      // force a log off
+      tep_session_unregister('customer_id');
+      tep_session_unregister('customer_default_address_id');
+      tep_session_unregister('customer_first_name');
+      tep_session_unregister('customer_country_id');
+      tep_session_unregister('customer_zone_id');
+      tep_session_unregister('comments');
+      //ICW - logout -> unregister GIFT VOUCHER sessions - Thanks Fredrik
+      tep_session_unregister('gv_id');
+      tep_session_unregister('cc_id');
+      //ICW - logout -> unregister GIFT VOUCHER sessions  - Thanks Fredrik
+      $cart->reset();
+    }
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
+
+  $content = CONTENT_CREATE_ACCOUNT;
+  $javascript = 'form_check.js.php';
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.1.1.1 2004/03/04 23:37:58 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT_SUCCESS);
+
+  $breadcrumb->add(NAVBAR_TITLE_1);
+  $breadcrumb->add(NAVBAR_TITLE_2);
+  
+  if (sizeof($navigation->snapshot) > 0) {
+    $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
+    $navigation->clear_snapshot();
+  } else {
+    $origin_href = tep_href_link(FILENAME_DEFAULT);
+  }
+
+  $content = CONTENT_CREATE_ACCOUNT_SUCCESS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/cvv.html
===================================================================
--- trunk/direct.openmoko.com/cvv.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/cvv.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<title>CVV Number Examples</title>
+</head>
+<body>
+<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="569" id="AutoNumber1" height="223">
+  <tr>
+    <td><img border="0" src="images/cvv.jpg" width="569" height="223"></td>
+  </tr>
+</table>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/debug/.htaccess
===================================================================
--- trunk/direct.openmoko.com/debug/.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/debug/.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+# $Id: .htaccess,v 1.1.1.1 2004/03/04 23:40:35 ccwjr Exp $
+#
+# This is used with Apache WebServers
+# The following blocks direct HTTP requests in this directory recursively
+#
+# For this to work, you must include the parameter 'Limit' to the AllowOverride configuration
+#
+# Example:
+#
+#<Directory "/usr/local/apache/htdocs">
+#  AllowOverride Limit
+#
+# 'All' with also work. (This configuration is in your apache/conf/httpd.conf file)
+#
+# This does not affect PHP include/require functions
+#
+# Example: http://server/catalog/includes/application_top.php will not work
+<Files .htaccess>
+order allow,deny
+deny from all
+</Files>
+
+<Files index.php>
+Order Deny,Allow
+deny from all
+</Files>

Added: trunk/direct.openmoko.com/debug/authnet_debug.txt
===================================================================
--- trunk/direct.openmoko.com/debug/authnet_debug.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/debug/authnet_debug.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+x_Login=Your+Login+Name&x_Tran_Key=Your+Transaction+Key&x_Relay_Response=FALSE&x_Delim_Data=TRUE&x_Version=3.1&x_Type=AUTH_CAPTURE&x_Method=CC&x_Amount=25.00&x_Currency_Code=USD&x_Email_Customer=FALSE&x_Email_Merchant=FALSE&x_Cust_ID=5&x_Invoice_Num=7&x_First_Name=test&x_Last_Name=test&x_Company=&x_Address=1234+1&x_City=Last+Chance&x_State=Florida&x_Zip=66666&x_Country=United+States&x_Phone=123+123+1234&x_Email=test%40localhost.com&x_Ship_To_First_Name=&x_Ship_To_Last_Name=&x_Ship_To_Company=&x_Ship_To_Address=&x_Ship_To_City=&x_Ship_To_State=&x_Ship_To_Zip=&x_Ship_To_Country=&x_Customer_IP=192.168.0.25&x_Description=1-%2425+Gift+Certificate%2A%2A&osCsid=b5e525c4956b22c8f31e66c844727a6d&x_Card_Num=4111111111111111&x_Exp_Date=1104&x_Card_Code=123&x_Test_Request=TRUE

Added: trunk/direct.openmoko.com/debug/firepay_debug.txt
===================================================================

Added: trunk/direct.openmoko.com/debug/plugnpay_debug.txt
===================================================================

Added: trunk/direct.openmoko.com/debug/propay_debug.txt
===================================================================
--- trunk/direct.openmoko.com/debug/propay_debug.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/debug/propay_debug.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+

Added: trunk/direct.openmoko.com/debug/quickcommerce_debug.txt
===================================================================
--- trunk/direct.openmoko.com/debug/quickcommerce_debug.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/debug/quickcommerce_debug.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+test

Added: trunk/direct.openmoko.com/down_for_maintenance.php
===================================================================
--- trunk/direct.openmoko.com/down_for_maintenance.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/down_for_maintenance.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  Created by: Linda McGrath osCOMMERCE at WebMakers.com
+  
+  Update by: fram 05-05-2003
+  Updated by: Donald Harriman - 08-08-2003 - MS2
+
+  down_for_maintenance.php v1.1
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . DOWN_FOR_MAINTENANCE_FILENAME);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME));
+
+
+  $content = CONTENT_DOWN_FOR_MAINTAINANCE;
+
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/download/unreal.zip
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/download/unreal.zip
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/download.php
===================================================================
--- trunk/direct.openmoko.com/download.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/download.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,99 @@
+<?php
+/*
+  $Id: download.php,v 1.1.1.1 2004/03/04 23:37:58 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  include('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) die;
+
+// Check download.php was called with proper GET parameters
+  if ((isset($HTTP_GET_VARS['order']) && !is_numeric($HTTP_GET_VARS['order'])) || (isset($HTTP_GET_VARS['id']) && !is_numeric($HTTP_GET_VARS['id'])) ) {
+    die;
+  }
+  
+// Check that order_id, customer_id and filename match
+  $downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = '" . (int)$HTTP_GET_VARS['order'] . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != ''");
+  if (!tep_db_num_rows($downloads_query)) die;
+  $downloads = tep_db_fetch_array($downloads_query);
+// MySQL 3.22 does not have INTERVAL
+  list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
+  $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);
+
+// Die if time expired (maxdays = 0 means no time limit)
+  if (($downloads['download_maxdays'] != 0) && ($download_timestamp <= time())) die;
+// Die if remaining count is <=0
+  if ($downloads['download_count'] <= 0) die;
+// Die if file is not there
+  if (!file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) die;
+  
+// Now decrement counter
+  tep_db_query("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_count = download_count-1 where orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "'");
+
+// Returns a random name, 16 to 20 characters long
+// There are more than 10^28 combinations
+// The directory is "hidden", i.e. starts with '.'
+function tep_random_name()
+{
+  $letters = 'abcdefghijklmnopqrstuvwxyz';
+  $dirname = '.';
+  $length = floor(tep_rand(16,20));
+  for ($i = 1; $i <= $length; $i++) {
+   $q = floor(tep_rand(1,26));
+   $dirname .= $letters[$q];
+  }
+  return $dirname;
+}
+
+// Unlinks all subdirectories and files in $dir
+// Works only on one subdir level, will not recurse
+function tep_unlink_temp_dir($dir)
+{
+  $h1 = opendir($dir);
+  while ($subdir = readdir($h1)) {
+// Ignore non directories
+    if (!is_dir($dir . $subdir)) continue;
+// Ignore . and .. and CVS
+    if ($subdir == '.' || $subdir == '..' || $subdir == 'CVS') continue;
+// Loop and unlink files in subdirectory
+    $h2 = opendir($dir . $subdir);
+    while ($file = readdir($h2)) {
+      if ($file == '.' || $file == '..') continue;
+      @unlink($dir . $subdir . '/' . $file);
+    }
+    closedir($h2); 
+    @rmdir($dir . $subdir);
+  }
+  closedir($h1);
+}
+
+
+// Now send the file with header() magic
+  header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
+  header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT");
+  header("Cache-Control: no-cache, must-revalidate");
+  header("Pragma: no-cache");
+  header("Content-Type: Application/octet-stream");
+  header("Content-disposition: attachment; filename=" . $downloads['orders_products_filename']);
+
+  if (DOWNLOAD_BY_REDIRECT == 'true') {
+// This will work only on Unix/Linux hosts
+    tep_unlink_temp_dir(DIR_FS_DOWNLOAD_PUBLIC);
+    $tempdir = tep_random_name();
+    umask(0000);
+    mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777);
+    symlink(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']);
+    tep_redirect(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']);
+  } else {
+// This will work on all systems, but will need considerable resources
+// We could also loop with fread($fp, 4096) to save memory
+    readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);
+  }
+?>

Added: trunk/direct.openmoko.com/events_calendar.php
===================================================================
--- trunk/direct.openmoko.com/events_calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/events_calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_EVENTS_CALENDAR);
+  
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_EVENTS_CALENDAR, '', 'NONSSL'));
+  $i =1;
+  $cal = new Calendar;
+  $cal->setStartDay(FIRST_DAY_OF_WEEK);
+  $this_month = date('m');
+  $this_year = date('Y');
+
+  if ($HTTP_GET_VARS['_month']) {
+  $month = $_month;
+  $year = $_year;
+  $a = $cal->adjustDate($month, $year);
+  $month_ = $a[0];
+  $year_= $a[1];
+  }else{
+  $year = date('Y');
+  $month = date('m');
+  $yeventear_= $year;
+  $month_= $month;
+  }
+  
+  if($HTTP_GET_VARS['_day']){
+  $ev_query = tep_db_query("select event_id from ". TABLE_EVENTS_CALENDAR ." where DAYOFMONTH(start_date)= '". $_day ."' and MONTH(start_date) = '". $_month ."' and YEAR(start_date) = '". $_year ."' AND language_id = '". (int)$languages_id ."'");
+   if (tep_db_num_rows($ev_query) < 2){
+    $ev = tep_db_fetch_array($ev_query);
+    $single_event = true;
+    $select_event = $ev['event_id'];
+    }
+  }
+  
+  $content = CONTENT_EVENTS_CALENDAR;
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/ext/modules/payment/paypal_wpp/ec.php
===================================================================
--- trunk/direct.openmoko.com/ext/modules/payment/paypal_wpp/ec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/ext/modules/payment/paypal_wpp/ec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  ec.php, v 1.0 09/06/2005
+
+  Copyright (c) 2005 POSTOSC.COM
+
+  Released under the GNU General Public License
+
+  Absolutely no warranty. Use at your own risk.
+*/
+
+chdir('../../../../');
+require('includes/application_top.php');
+
+if(isset($_GET['token'])) {
+  tep_session_register('paypal_token');
+  $paypal_token = $_GET['token'];
+  tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
+}
+
+require('includes/application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/faq.php
===================================================================
--- trunk/direct.openmoko.com/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: faq.php,v 1.2 2004/03/12 19:28:57 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+require('includes/application_top.php');
+
+$cID = 0;
+$display_mode = '';
+
+if (isset($HTTP_GET_VARS['cID']) && tep_not_null($HTTP_GET_VARS['cID'])) {
+  $cID = (int)$HTTP_GET_VARS['cID'];
+  $display_mode = 'faq';
+}
+
+require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FAQ);
+
+// faq breadcrumb
+$faq_categories_query = tep_db_query("select icd.categories_name from " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd, " . TABLE_FAQ_CATEGORIES . " ic where ic.categories_id = icd.categories_id and icd.categories_id = '" . (int)$cID . "' and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1'");
+$faq_categories_value = tep_db_fetch_array($faq_categories_query);
+
+if ($display_mode == 'faq') {
+  $breadcrumb->add(NAVBAR_TITLE, FILENAME_FAQ);
+
+  if (tep_not_null($faq_categories_value['categories_name'])) {
+    $breadcrumb->add($faq_categories_value['categories_name'], FILENAME_FAQ . '?cID=' . $cID);
+  }
+} else {
+  $breadcrumb->add(NAVBAR_TITLE, FILENAME_FAQ);
+}
+
+$content = CONTENT_FAQ;
+
+require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/featured_products.php
===================================================================
--- trunk/direct.openmoko.com/featured_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/featured_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,143 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+this file gets all the reaw data needed by product_listing and product_listing_column to build
+the display
+  
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FEATURED_PRODUCTS);
+    // Eversun mod for sppc and qty price breaks
+       if(!tep_session_is_registered('sppc_customer_group_id')) {
+         $customer_group_id = 'G';
+         } else {
+          $customer_group_id = $sppc_customer_group_id;
+       }
+
+    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
+                         'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
+                         'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
+                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
+                         'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
+                         'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
+                         'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
+                         'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
+
+    asort($define_list);
+
+    $column_list = array();
+    reset($define_list);
+    while (list($key, $value) = each($define_list)) {
+      if ($value > 0) $column_list[] = $key;
+    }
+
+       // find out if sorting by price has been requested
+       if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
+        $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+        if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
+          $status_need_to_get_prices = true;
+          }
+       }
+ if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    }
+
+        $select_column_list = '';
+    
+    $listing_sql .= ' order by ';    
+        for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+          switch ($column_list[$i]) {
+            case 'PRODUCT_LIST_MODEL':
+              $select_column_list .= 'p.products_model, ';
+              break;
+            case 'PRODUCT_LIST_NAME':
+              $select_column_list .= 'pd.products_name, ';
+              break;
+            case 'PRODUCT_LIST_MANUFACTURER':
+              $select_column_list .= 'm.manufacturers_name, ';
+              break;
+            case 'PRODUCT_LIST_QUANTITY':
+              $select_column_list .= 'p.products_quantity, ';
+              break;
+            case 'PRODUCT_LIST_IMAGE':
+              $select_column_list .= 'p.products_image, ';
+              break;
+            case 'PRODUCT_LIST_WEIGHT':
+              $select_column_list .= 'p.products_weight, ';
+              break;
+             }
+    }
+   
+    // We show them all
+   // either retail or no need to get correct special prices
+          $listing_sql = "select distinct " . $select_column_list . "  
+                          p.products_id,
+                          p.products_price as final_price,
+                          p.products_tax_class_id,
+                          p.products_image 
+                        from (" . TABLE_PRODUCTS . " p 
+                        left join " . TABLE_SPECIALS . " s using(products_id)),
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                        where 
+                         p.products_status = '1'
+                         and f.status ='1'
+                         and p.products_id = f.products_id
+                         and pd.products_id = p.products_id
+                         and pd.language_id = '" . (int)$languages_id . "'"; 
+                          
+ if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+   //   $sort = ;
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    
+    $listing_sql .= ' order by ';
+    switch ($sort_column) {
+      case 'PRODUCT_LIST_MODEL':
+        $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $listing_sql .= "pd.products_name";
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      }
+   }
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'));
+
+  $content = CONTENT_FEATURED_PRODUCTS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/gv_faq.php
===================================================================
--- trunk/direct.openmoko.com/gv_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/gv_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: gv_faq.php,v 1.1.1.1 2004/03/04 23:37:59 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001, 2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_GV_FAQ);
+
+  $breadcrumb->add(NAVBAR_TITLE); 
+
+  $content = CONTENT_GV_FAQ;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+
+?>

Added: trunk/direct.openmoko.com/gv_redeem.php
===================================================================
--- trunk/direct.openmoko.com/gv_redeem.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/gv_redeem.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,204 @@
+<?php
+/*
+  $Id: gv_redeem.php,v 1.1.1.1 2004/03/04 23:37:59 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001, 2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// if the customer is not logged on, redirect them to the login page
+if (!tep_session_is_registered('customer_id')) {
+$navigation->set_snapshot();
+tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+}
+// check for a voucher number in the url
+  if (isset($HTTP_GET_VARS['gv_no'])) {
+    $error = true;
+ $voucher_number=tep_db_prepare_input($HTTP_GET_VARS['gv_no']);
+    $gv_query = tep_db_query("select c.coupon_id, c.coupon_amount from " . TABLE_COUPONS . " c, " . TABLE_COUPON_EMAIL_TRACK . " et where coupon_code = '" . addslashes($voucher_number) . "' and c.coupon_id = et.coupon_id");
+    if (tep_db_num_rows($gv_query) >0) {
+      $coupon = tep_db_fetch_array($gv_query);
+      $redeem_query = tep_db_query("select coupon_id from ". TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $coupon['coupon_id'] . "'");
+      if (tep_db_num_rows($redeem_query) == 0 ) {
+// check for required session variables
+        if (!tep_session_is_registered('gv_id')) {
+          tep_session_register('gv_id');
+        }
+        $gv_id = $coupon['coupon_id'];
+        $error = false;
+      } else {
+        $error = true;
+      }
+    }
+  } else {
+    tep_redirect(FILENAME_DEFAULT);
+  }
+  if ((!$error) && (tep_session_is_registered('customer_id'))) {
+// Update redeem status
+    $gv_query = tep_db_query("insert into  " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $coupon['coupon_id'] . "', '" . $customer_id . "', now(),'" . $REMOTE_ADDR . "')");
+    $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $coupon['coupon_id'] . "'");
+    tep_gv_account_update($customer_id, $gv_id);
+    tep_session_unregister('gv_id');   
+  } 
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_GV_REDEEM);
+
+
+/* 
+GV_REDEEM_EXPLOIT_FIX (GVREF)
+---------------------------------------------
+* case: guest accounts can exploit gift voucher sent using "Mail Gift Voucher" (admin area),
+*       by sharing the code until somebody logs with a valid account
+*       or successfully created new account.
+*
+* obv:  the session remains on user while served as a guest. 
+*       The gift voucher can now be reused to all guest users until 
+*       gift voucher is redeemed
+* soln: before releasing the gift voucher, the user must login first
+*       or asked to create an account.
+*
+*
+* -- Frederick Ricaforte
+*/
+
+
+/*
+* connected files:
+*   /catalog/gv_redeem.php
+*   /catalog/login.php
+*   /catalog/create_account.php 
+*   /catalog/includes/languages/english/gv_redeem.php
+*
+*/
+
+/*******************************************************
+**** gv_redeem.php  ************************************
+*******************************************************/
+  //before:  $redeem_query = tep_db_query("select coupon_id from ". TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $coupon['coupon_id'] . "'");
+  //----
+      // add:GVREF
+      if ((tep_session_is_registered('customer_id')) && $voucher_not_redeemed) {
+        $gv_id = $coupon['coupon_id'];
+        $gv_query = tep_db_query("insert into  " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $coupon['coupon_id'] . "', '" . $customer_id . "', now(),'" . $REMOTE_ADDR . "')");
+        $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $coupon['coupon_id'] . "'");
+        tep_gv_account_update($customer_id, $gv_id);
+        $error = false;
+      } elseif($voucher_not_redeemed) {
+      // endof_add:GVREF
+
+      // replace: GVREF
+      /*
+      if (tep_db_num_rows($redeem_query) == 0 ) {
+        // check for required session variables
+        if (!tep_session_is_registered('gv_id')) {
+          tep_session_register('gv_id');
+        }
+        $gv_id = $coupon['coupon_id'];
+        $error = false;
+      } else {
+        $error = true;
+      }
+      */
+
+      // with: GVREF
+        if (!tep_session_is_registered('floating_gv_code')) {
+            tep_session_register('floating_gv_code');
+          //}
+          $floating_gv_code = $HTTP_GET_VARS['gv_no'];
+          $gv_error_message = TEXT_NEEDS_TO_LOGIN;
+      } else {
+        $gv_error_message = TEXT_INVALID_GV;
+     }
+    } else {
+      $gv_error_message = TEXT_INVALID_GV;
+    }
+    // endof_replace: GVREF
+
+  // remove: GVREF
+  /*
+  if ((!$error) && (tep_session_is_registered('customer_id'))) {
+    // Update redeem status
+    $gv_query = tep_db_query("insert into  " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $coupon['coupon_id'] . "', '" . $customer_id . "', now(),'" . $REMOTE_ADDR . "')");
+    $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $coupon['coupon_id'] . "'");
+    tep_gv_account_update($customer_id, $gv_id);
+    tep_session_unregister('gv_id');   
+  } 
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_GV_REDEEM);
+  */
+  // endof_remove: GVREF
+
+  // replace: GVREF
+  // $message = TEXT_INVALID_GV;
+  // with:
+  $message = $gv_error_message;
+  // endof_replace
+  
+  
+
+/*******************************************************
+****  login.php  ******************************************
+*******************************************************/
+  //before:    $cart->restore_contents();
+  //---------
+  //add these new codes:
+        if (tep_session_is_registered('floating_gv_code')) {
+          $gv_query = tep_db_query("SELECT c.coupon_id, c.coupon_amount, IF(rt.coupon_id>0, 'true', 'false') AS redeemed FROM ". TABLE_COUPONS ." c LEFT JOIN ". TABLE_COUPON_REDEEM_TRACK." rt USING(coupon_id), ". TABLE_COUPON_EMAIL_TRACK ." et WHERE c.coupon_code = '". $floating_gv_code ."' AND c.coupon_id = et.coupon_id");
+          // check if coupon exist
+          if (tep_db_num_rows($gv_query) >0) {
+            $coupon = tep_db_fetch_array($gv_query);
+            // check if coupon_id exist and coupon not redeemed
+            if($coupon['coupon_id']>0 && $coupon['redeemed'] == 'false') {
+              tep_session_unregister('floating_gv_code');
+              $gv_query = tep_db_query("insert into  " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $coupon['coupon_id'] . "', '" . $customer_id . "', now(),'" . $REMOTE_ADDR . "')");
+              $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $coupon['coupon_id'] . "'");
+              tep_gv_account_update($customer_id, $coupon['coupon_id']);
+            }
+          }
+        }
+//**********
+
+
+
+/*******************************************************
+****  create_account.php  ***********************************
+*******************************************************/
+  //before: tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+  //---------
+  //add these:
+      if (tep_session_is_registered('floating_gv_code')) {
+        $gv_query = tep_db_query("SELECT c.coupon_id, c.coupon_amount, IF(rt.coupon_id>0, 'true', 'false') AS redeemed FROM ". TABLE_COUPONS ." c LEFT JOIN ". TABLE_COUPON_REDEEM_TRACK." rt USING(coupon_id), ". TABLE_COUPON_EMAIL_TRACK ." et WHERE c.coupon_code = '". $floating_gv_code ."' AND c.coupon_id = et.coupon_id");
+        // check if coupon exist
+        if (tep_db_num_rows($gv_query) >0) {
+          $coupon = tep_db_fetch_array($gv_query);
+          // check if coupon_id exist and coupon not redeemed
+          if($coupon['coupon_id']>0 && $coupon['redeemed'] == 'false') {
+              tep_session_unregister('floating_gv_code');
+              $gv_query = tep_db_query("insert into  " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $coupon['coupon_id'] . "', '" . $customer_id . "', now(),'" . $REMOTE_ADDR . "')");
+              $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $coupon['coupon_id'] . "'");
+              tep_gv_account_update($customer_id, $coupon['coupon_id']);
+          }
+        }
+      }
+
+/*******************************************************
+****  /includes/languages/english/gv_redeem.php ******************
+*******************************************************/
+// add:
+define('TEXT_NEEDS_TO_LOGIN', 'We are sorry but we are unable to process your Gift Voucher claim at this time. You need to login first or create an account with us, if you don\'t already have one, before you can claim your Gift Voucher. Please <a href="' . tep_href_link(FILENAME_LOGIN,'','SSL').'">click here to login or create an account.</a> ');
+  $breadcrumb->add(NAVBAR_TITLE); 
+  $content = CONTENT_GV_REDEEM;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+
+?>

Added: trunk/direct.openmoko.com/gv_send.php
===================================================================
--- trunk/direct.openmoko.com/gv_send.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/gv_send.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,97 @@
+<?php
+/*
+  $Id: gv_send.php,v 1.1.1.1 2004/03/04 23:37:59 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001, 2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require('includes/classes/http_client.php');
+
+// if the customer is not logged on, redirect them to the login page
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_GV_SEND);
+
+  if (($HTTP_POST_VARS['back_x']) || ($HTTP_POST_VARS['back_y'])) {
+    $HTTP_GET_VARS['action'] = '';
+  }
+  if ($HTTP_GET_VARS['action'] == 'send') {
+    $error = false;
+    if (!tep_validate_email(trim($HTTP_POST_VARS['email']))) {
+      $error = true;
+      $error_email = ERROR_ENTRY_EMAIL_ADDRESS_CHECK;
+    }
+    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $gv_result = tep_db_fetch_array($gv_query);
+    $customer_amount = $gv_result['amount'];
+    $gv_amount = trim($HTTP_POST_VARS['amount']);
+    if (ereg('[^0-9/.]', $gv_amount)) {
+      $error = true;
+      $error_amount = ERROR_ENTRY_AMOUNT_CHECK; 
+    }
+    if ($gv_amount>$customer_amount || $gv_amount == 0) {
+      $error = true; 
+      $error_amount = ERROR_ENTRY_AMOUNT_CHECK; 
+    } 
+  }
+  if ($HTTP_GET_VARS['action'] == 'process') {
+    $id1 = create_coupon_code($mail['customers_email_address']);
+    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$customer_id."'");
+    $gv_result=tep_db_fetch_array($gv_query);
+    $new_amount=$gv_result['amount']-(int)$HTTP_POST_VARS['amount'];
+    if ($new_amount<0) {
+      $error= true;
+      $error_amount = ERROR_ENTRY_AMOUNT_CHECK; 
+      $HTTP_GET_VARS['action'] = 'send';
+    } else {
+      $gv_query=tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_amount . "' where customer_id = '" . $customer_id . "'");
+      $gv_query=tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+      $gv_customer=tep_db_fetch_array($gv_query);
+      $gv_query=tep_db_query("insert into " . TABLE_COUPONS . " (coupon_type, coupon_code, date_created, coupon_amount) values ('G', '" . $id1 . "', NOW(), '" . $HTTP_POST_VARS['amount'] . "')");
+      $insert_id = tep_db_insert_id($gv_query);
+      $gv_query=tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, sent_lastname, emailed_to, date_sent) values ('" . $insert_id . "' ,'" . $customer_id . "', '" . addslashes($gv_customer['customers_firstname']) . "', '" . addslashes($gv_customer['customers_lastname']) . "', '" . tep_db_prepare_input($HTTP_POST_VARS['email']) . "', now())");
+
+      $gv_email = STORE_NAME . "\n" .
+              EMAIL_SEPARATOR . "\n" .
+              sprintf(EMAIL_GV_TEXT_HEADER, $currencies->format($HTTP_POST_VARS['amount'])) . "\n" .
+              EMAIL_SEPARATOR . "\n" . 
+              sprintf(EMAIL_GV_FROM, stripslashes($HTTP_POST_VARS['send_name'])) . "\n";
+      if (isset($HTTP_POST_VARS['message'])) {
+        $gv_email .= EMAIL_GV_MESSAGE . "\n";
+        if (isset($HTTP_POST_VARS['to_name'])) {
+          $gv_email .= sprintf(EMAIL_GV_SEND_TO, stripslashes($HTTP_POST_VARS['to_name'])) . "\n\n";
+        }
+        $gv_email .= stripslashes($HTTP_POST_VARS['message']) . "\n\n";
+      } 
+      $gv_email .= sprintf(EMAIL_GV_REDEEM, $id1) . "\n\n";
+    //  $gv_email .= '<a href="' . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1, 'NONSSL', false) . '">' . EMAIL_GV_LINK . '</a>';
+      $gv_email .= EMAIL_GV_LINK . ' ' . "<a HREF='" . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false) . "'>" . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false) . "</a>\n";
+      $gv_email .= "\n\n";  
+      $gv_email .= EMAIL_GV_FIXED_FOOTER . "\n\n";
+      $gv_email .= EMAIL_GV_SHOP_FOOTER . "\n\n";;
+      $gv_email_subject = sprintf(EMAIL_GV_TEXT_SUBJECT, stripslashes($HTTP_POST_VARS['send_name']));             
+      tep_mail('', $HTTP_POST_VARS['email'], $gv_email_subject, nl2br($gv_email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');
+    }
+  }
+  $breadcrumb->add(NAVBAR_TITLE);
+  $content = CONTENT_GV_SEND;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+
+?>

Added: trunk/direct.openmoko.com/iam.php
===================================================================
--- trunk/direct.openmoko.com/iam.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/iam.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+this is the web root

Added: trunk/direct.openmoko.com/images/.htaccess
===================================================================
--- trunk/direct.openmoko.com/images/.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/images/.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+# $Id: .htaccess,v 1.1.1.1 2004/03/04 23:40:35 ccwjr Exp $
+#
+# This is used with Apache WebServers
+# The following blocks direct HTTP requests in this directory recursively
+#
+# For this to work, you must include the parameter 'Limit' to the AllowOverride configuration
+#
+# Example:
+#
+#<Directory "/usr/local/apache/htdocs">
+#  AllowOverride Limit
+#
+# 'All' with also work. (This configuration is in your apache/conf/httpd.conf file)
+#
+# This does not affect PHP include/require functions
+#
+# Example: http://server/catalog/includes/application_top.php will not work
+Options -Indexes

Added: trunk/direct.openmoko.com/images/00add_button.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/00add_button.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/Book-4-mockup.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/Book-4-mockup.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/SPWstarwarskotorepublicgrn.gif.GIF
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/SPWstarwarskotorepublicgrn.gif.GIF
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/SPWstarwarskotorepublicgrn.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/SPWstarwarskotorepublicgrn.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/account_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/account_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/account_orders.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/account_orders.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/account_personal.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/account_personal.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_clicks.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_clicks.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_contact_us.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_contact_us.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_links.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_links.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_news.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_news.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_orders.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_orders.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_payment.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_payment.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_reports.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_reports.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/affiliate_summary.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/affiliate_summary.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/arrow_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/arrow_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/arrow_east_south.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/arrow_east_south.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/arrow_green.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/arrow_green.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/arrow_south_east.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/arrow_south_east.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/120x35ecomm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/120x35ecomm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/120x60ecomm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/120x60ecomm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/468x60ecomm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/468x60ecomm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/blue-steel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/blue-steel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/button-anim-manuals.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/button-anim-manuals.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/cre-button.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/cre-button.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/osc-offer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/osc-offer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/oscommerce.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/oscommerce.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/banners/small_oscommerce.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/banners/small_oscommerce.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/bannersosc-offer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/bannersosc-offer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/blue-steel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/blue-steel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/box_products_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/box_products_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/box_products_notifications_remove.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/box_products_notifications_remove.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/box_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/box_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/boxnboard.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/boxnboard.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/boxnboard.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/boxnboard.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/car_kit.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/car_kit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/car_kit_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/car_kit_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/car_kit_small2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/car_kit_small2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/car_mount_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/car_mount_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/AMEX1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/AMEX1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Amex.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Amex.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Amex_sm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Amex_sm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Australian_BankCard.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Australian_BankCard.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/CS.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/CS.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Carte_Blanche.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Carte_Blanche.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Delta.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Delta.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Diners_Club.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Diners_Club.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Discover.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Discover.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Discover_sm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Discover_sm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Eurocard.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Eurocard.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/JCB.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/JCB.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Logo_CreditCard_CarteBlanche.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Logo_CreditCard_CarteBlanche.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Mastercard.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Mastercard.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Mastercard_sm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Mastercard_sm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Mastro.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Mastro.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Solo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Solo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/UK_Electron.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/UK_Electron.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/UK_Switch.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/UK_Switch.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Visa.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Visa.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/Visa_sm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/Visa_sm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/banner_euros.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/banner_euros.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/cards.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/cards.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/cards1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/cards1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/cards2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/cards2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/credit_cards.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/credit_cards.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/credit_cardsvm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/credit_cardsvm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/icon_amex.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/icon_amex.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/icon_discover.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/icon_discover.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/icon_mastercard.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/icon_mastercard.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/icon_visa.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/icon_visa.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/logo-xclick_paypal.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/logo-xclick_paypal.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/maestro.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/maestro.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/mc_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/mc_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/paypal.bmp
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/paypal.bmp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/paypal_logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/paypal_logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/pp3.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/pp3.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/visa_small.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/visa_small.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cards/x-click_butcc_donate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cards/x-click_butcc_donate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/carolynatmicrophone.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/carolynatmicrophone.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/carrycover_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/carrycover_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/carrying_case.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/carrying_case.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/carrying_tape.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/carrying_tape.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cat_arrow_down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cat_arrow_down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cat_arrow_other.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cat_arrow_other.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cat_arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cat_arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/categories/affiliate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/categories/affiliate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/category_dvd_movies.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/category_dvd_movies.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/category_hardware.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/category_hardware.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/category_software.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/category_software.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/checkout_bullet.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/checkout_bullet.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/close_window.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/close_window.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/crebook.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/crebook.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/credit_cards.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/credit_cards.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/credit_cardsvm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/credit_cardsvm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cvm_help1.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cvm_help1.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cvm_help2.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cvm_help2.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/cvv.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/cvv.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/default/1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/default/1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/default/2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/default/2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/default/3.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/default/3.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/default/4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/default/4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/default.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/default.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/a_bugs_life.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/a_bugs_life.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/beloved.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/beloved.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/blade_runner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/blade_runner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/courage_under_fire.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/courage_under_fire.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/die_hard_3.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/die_hard_3.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/fire_down_below.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/fire_down_below.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/frantic.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/frantic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/lethal_weapon.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/lethal_weapon.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/no_picture.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/no_picture.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/red_corner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/red_corner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/replacement_killers.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/replacement_killers.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/speed.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/speed.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/speed_2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/speed_2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/the_matrix.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/the_matrix.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/theres_something_about_mary.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/theres_something_about_mary.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/under_siege.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/under_siege.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/under_siege2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/under_siege2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/dvd/youve_got_mail.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/dvd/youve_got_mail.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/events_images/SaintJoTshirt_thumb.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/events_images/SaintJoTshirt_thumb.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/events_images/Unbrella_thumb.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/events_images/Unbrella_thumb.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/events_images/cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/events_images/cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/faqdesk_test_osc_action.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/faqdesk_test_osc_action.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/faqdesk_test_osc_cartoons.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/faqdesk_test_osc_cartoons.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/faqdesk_test_osc_graphic.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/faqdesk_test_osc_graphic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/fish.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/fish.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gallery_large03.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gallery_large03.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gallery_large03_1.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gallery_large03_1.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gift/giftcert-25-lrg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gift/giftcert-25-lrg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gift/giftcert-25-sm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gift/giftcert-25-sm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gift/giftcert-25.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gift/giftcert-25.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gift/giftcert-25.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gift/giftcert-25.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gift/gv_100.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gift/gv_100.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gift/gv_25.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gift/gv_25.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gift/gv_25_lrg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gift/gv_25_lrg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gift/gv_50.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gift/gv_50.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/giftcert-25-sm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/giftcert-25-sm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gt_interactive/disciples.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gt_interactive/disciples.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gt_interactive/unreal_tournament.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gt_interactive/unreal_tournament.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gt_interactive/wheel_of_time.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gt_interactive/wheel_of_time.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gv_100.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gv_100.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gv_25.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gv_25.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/gv_50.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/gv_50.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/hackers_lunch_box.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/hackers_lunch_box.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/hackers_lunchbox_small
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/hackers_lunchbox_small
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/hackers_orange_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/hackers_orange_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/hackers_silver_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/hackers_silver_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/header_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/header_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/header_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/header_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/header_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/header_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/Amex.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/Amex.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/Discover.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/Discover.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/Mastercard.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/Mastercard.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/Visa.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/Visa.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/confirm_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/confirm_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/edit_2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/edit_2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/error.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/error.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/icon_status_green.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/icon_status_green.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/icon_status_green_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/icon_status_green_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/icon_status_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/icon_status_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/icon_status_red_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/icon_status_red_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/icon_status_yellow.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/icon_status_yellow.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/period_ani.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/period_ani.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/shipping_canadapost.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/shipping_canadapost.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/shipping_fedex.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/shipping_fedex.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/shipping_free_shipper.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/shipping_free_shipper.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/shipping_ups.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/shipping_ups.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/shipping_usps.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/shipping_usps.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/sort.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/sort.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/success.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/success.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/icons/warning.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/icons/warning.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/lj1100xi.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/lj1100xi.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/loaded6-banner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/loaded6-banner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/loaded_3box_ad.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/loaded_3box_ad.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/mail/background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/mail/background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/main_category_accessories.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/main_category_accessories.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/manufacturer_canon.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/manufacturer_canon.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/manufacturer_fox.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/manufacturer_fox.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/manufacturer_gt_interactive.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/manufacturer_gt_interactive.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/manufacturer_hewlett_packard.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/manufacturer_hewlett_packard.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/manufacturer_logitech.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/manufacturer_logitech.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/manufacturer_matrox.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/manufacturer_matrox.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/manufacturer_microsoft.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/manufacturer_microsoft.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/manufacturer_sierra.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/manufacturer_sierra.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/manufacturer_warner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/manufacturer_warner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/matrox/boxnboard.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/matrox/boxnboard.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/matrox/mg200mms.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/matrox/mg200mms.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/matrox/mg400-32mb.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/matrox/mg400-32mb.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/microsoft/imexplorer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/microsoft/imexplorer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/microsoft/intkeyboardps2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/microsoft/intkeyboardps2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/microsoft/msimpro.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/microsoft/msimpro.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/msimpro.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/msimpro.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/neo_orange_big.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/neo_orange_big.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/neo_orange_big.png_1
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/neo_orange_big.png_1
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/neo_orange_medium.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/neo_orange_medium.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/neo_orange_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/neo_orange_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/neo_range_medium.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/neo_range_medium.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/neo_silver_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/neo_silver_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/newsdesk_test_osc_action.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/newsdesk_test_osc_action.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/newsdesk_test_osc_cartoons.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/newsdesk_test_osc_cartoons.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/newsdesk_test_osc_graphic.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/newsdesk_test_osc_graphic.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/newsdesk_test_osc_sticky.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/newsdesk_test_osc_sticky.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/newsdesk_test_osc_thanks.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/newsdesk_test_osc_thanks.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/no_cammera.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/no_cammera.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/no_picture.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/no_picture.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/osc-offer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/osc-offer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/oscommerce.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/oscommerce.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/paypal/4cards.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/paypal/4cards.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/pixel_black.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/pixel_black.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/pixel_silver.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/pixel_silver.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/printimage.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/printimage.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/printimage_over.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/printimage_over.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/shipwire_banner.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/shipwire_banner.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/sierra/swat_3.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/sierra/swat_3.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/standard_orange_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/standard_orange_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/stars_1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/stars_1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/stars_2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/stars_2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/stars_3.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/stars_3.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/stars_4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/stars_4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/stars_5.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/stars_5.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/stylus.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/stylus.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/stylus_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/stylus_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_action.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_action.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_action_games.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_action_games.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_cartoons.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_cartoons.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_cdrom_drives.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_cdrom_drives.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_comedy.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_comedy.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_drama.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_drama.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_graphic_cards.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_graphic_cards.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_keyboards.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_keyboards.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_memory.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_memory.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_mice.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_mice.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_monitors.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_monitors.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_printers.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_printers.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_science_fiction.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_science_fiction.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_simulation.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_simulation.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_speakers.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_speakers.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_strategy.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_strategy.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/subcategory_thriller.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/subcategory_thriller.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_browse.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_browse.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_confirmation.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_confirmation.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_contact_us.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_contact_us.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_default.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_default.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_delivery.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_delivery.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_list.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_list.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_man_on_board.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_man_on_board.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_password_forgotten.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_password_forgotten.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_payment.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_payment.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_products_new.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_products_new.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_reviews_new.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_reviews_new.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_specials.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_specials.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/table_background_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/table_background_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/test_image200x160.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/test_image200x160.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/test_image500x320.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/test_image500x320.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/the_matrix.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/the_matrix.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/whitelanyard_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/whitelanyard_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/x-click_butcc_donate.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/x-click_butcc_donate.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/xphone.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/xphone.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/xphone2.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/xphone2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/xphone3.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/xphone3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/images/xphone3_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/images/xphone3_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/.htaccess
===================================================================
--- trunk/direct.openmoko.com/includes/.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+# $Id: .htaccess,v 1.1.1.1 2004/03/04 23:40:35 ccwjr Exp $
+#
+# This is used with Apache WebServers
+# The following blocks direct HTTP requests in this directory recursively
+#
+# For this to work, you must include the parameter 'Limit' to the AllowOverride configuration
+#
+# Example:
+#
+#<Directory "/usr/local/apache/htdocs">
+#  AllowOverride Limit
+#
+# 'All' with also work. (This configuration is in your apache/conf/httpd.conf file)
+#
+# This does not affect PHP include/require functions
+#
+# Example: http://server/catalog/includes/application_top.php will not work
+
+<Files *.php>
+Order Deny,Allow
+Deny from all
+</Files>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/ATS_template_application_top.php
===================================================================
--- trunk/direct.openmoko.com/includes/ATS_template_application_top.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/ATS_template_application_top.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,216 @@
+<?php
+/*
+  $Id: template_application_top.php,v 1.1.1.1 2004/03/04 23:40:40 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBoxMessagestack {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBoxMessagestack($contents, $direct_output = false) {
+      $tableBox1_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox1_string .= ' ' . $this->table_parameters;
+      $tableBox1_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox1_string .= $contents[$i]['form'] . "\n";
+        $tableBox1_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox1_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox1_string .= ' ' . $contents[$i]['params'];
+        $tableBox1_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox1_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox1_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox1_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox1_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox1_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox1_string .= $contents[$i][$x]['form'];
+              $tableBox1_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox1_string .= '</form>';
+              $tableBox1_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox1_string .= '    <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox1_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox1_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox1_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox1_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
+        }
+
+        $tableBox1_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox1_string .= '</form>' . "\n";
+      }
+
+      $tableBox1_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox1_string;
+
+      return $tableBox1_string;
+    }
+  }
+//find content
+
+
+//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+//Site template configuration
+
+//get customer selected template if there is a customer selected template
+  $customer_pref_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate = tep_db_fetch_array($customer_pref_template_query);
+
+   if (tep_not_null($cptemplate['template_selected'])) {
+   //use customer selected template
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+    //use store default  
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    //use default   
+    define(TEMPLATE_NAME, 'default');
+    }
+   
+    define(TEMPLATE_STYLE, DIR_WS_TEMPLATES . TEMPLATE_NAME . "/stylesheet.css");
+  
+    define(TEMPLATE_STYLE_ORIGINAL, DIR_WS_TEMPLATES . "/default/stylesheet.css");
+
+    //get table configuration
+    if ( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/template.php')) {
+      require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/template.php');
+    }
+    if ( file_exists(TEMPLATE_BOX_TPL)) {
+      require(TEMPLATE_BOX_TPL);
+    }
+
+//location of DIR_FS_TEMPLATE_BOXES,DIR_FS_TEMPLATE_MAINPAGES, TEMPLATE_BOX_TPL,   
+
+     // define content module location
+     define(DIR_WS_TEMPLATE_MODULES, DIR_WS_TEMPLATES . TEMPLATE_NAME . '/modules/');
+
+ //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+// get template configuration
+
+if ( file_exists(TEMPLATE_HTML_OUT)) {
+  require(TEMPLATE_HTML_OUT);
+}
+
+if (file_exists(DIR_FS_TEMPLATE_MAINPAGES)) {
+$modules_folder = (DIR_FS_TEMPLATE_MAINPAGES);
+}else{
+$modules_folder = DIR_WS_TEMPLATES . '/mainpage_modules/';
+}
+
+if (file_exists(DIR_WS_TEMPLATE_MODULES)) {
+$additional_module_folder = DIR_WS_TEMPLATE_MODULES;
+}else{
+$additional_module_folder = DIR_WS_TEMPLATES . 'default/modules/';
+}
+//Lango Added for template mod: EOF
+
+// Gets template configuration from tables
+  $template_query = tep_db_query("select * from " . TABLE_TEMPLATE . " where template_name = '" . TEMPLATE_NAME . "'");
+  $template = tep_db_fetch_array($template_query);
+
+  define('TEMPLATE_ID', $template[template_id]);
+  define('CELLPADDING_MAIN', $template[template_cellpadding_main]);
+  define('CELLPADDING_LEFT', $template[template_cellpadding_left]);
+  define('CELLPADDING_RIGHT', $template[template_cellpadding_right]);
+  define('CELLPADDING_SUB', $template[template_cellpadding_sub]);
+  define('DISPLAY_COLUMN_LEFT', $template[include_column_left]);
+  define('DISPLAY_COLUMN_RIGHT', $template[include_column_right]);
+
+  define('SITE_WIDTH', $template[site_width]);
+  define('BOX_WIDTH_LEFT', $template[box_width_left]);
+  define('BOX_WIDTH_RIGHT', $template[box_width_right]);
+  define('SIDE_BOX_LEFT_WIDTH', $template[side_box_left_width]);
+  define('SIDE_BOX_RIGHT_WIDTH', $template[side_box_right_width]);
+  define('MAIN_TABLE_BORDER', $template[main_table_border]);
+  define('SHOW_HEADER_LINK_BUTTONS', $template[show_header_link_buttons]);
+ define('SHOW_CART_IN_HEADER', $template[cart_in_header]);
+ define('SHOW_LANGUAGES_IN_HEADER', $template[languages_in_header]);
+ define('SHOW_HEADING_TITLE_ORIGINAL', $template[show_heading_title_original]);
+ define('INCLUDE_MODULE_ONE', $template[module_one]);
+ define('INCLUDE_MODULE_TWO', $template[module_two]);
+ define('INCLUDE_MODULE_THREE', $template[module_three]);
+ define('INCLUDE_MODULE_FOUR', $template[module_four]);
+ define('INCLUDE_MODULE_FIVE', $template[module_five]);
+ define('INCLUDE_MODULE_SIX', $template[module_six]);
+ define('SHOW_CUSTOMER_GREETING', $template[customer_greeting]);
+ 
+ //find content check to see if content in template
+     if( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . $content)){
+       $content = (TEMPLATE_NAME .'/' . $content);
+          } else {
+
+ }
+
+ 
+ //Note these items are still in the data base
+// define('TEXT_GREETING_PERSONAL', stripslashes($template[edit_customer_greeting_personal]));
+// define('TEXT_GREETING_PERSONAL_RELOGON', stripslashes($template[edit_customer_greeting_personal]));
+// define('TEXT_GREETING_GUEST', stripslashes($template[edit_greeting_guest]));
+
+//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+////
+// The HTML image wrapper function
+  function tep_image_infobox($corner, $alt = '', $width = '', $height = '', $params = '') {
+
+
+    $image = '<img src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/' . $corner . '" border="0" alt="' . $alt . '"';
+    if ($alt) {
+      $image .= ' title=" ' . $alt . ' "';
+    }
+    if ($width) {
+      $image .= ' width="' . $width . '"';
+    }
+    if ($height) {
+      $image .= ' height="' . $height . '"';
+    }
+    if ($params) {
+      $image .= ' ' . $params;
+    }
+    $image .= '>';
+
+    return $image;
+  }
+
+//for templatebox
+if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+      case 'update_template':
+
+      if ($template >= '1'){
+         $thema_template = tep_db_prepare_input($HTTP_POST_VARS['template']);
+           tep_db_query("update " . TABLE_CUSTOMERS . " set customers_selected_template = '$thema_template' where customers_id = '" . $customer_id . "'");
+          tep_redirect(tep_href_link(basename(FILENAME_DEFAULT)));
+             }
+         break;
+    }
+  }
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/CRE_template_application_top.php
===================================================================
--- trunk/direct.openmoko.com/includes/CRE_template_application_top.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/CRE_template_application_top.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,224 @@
+<?php
+/*
+  $Id: template_application_top.php,v 1.1.1.1 2004/03/04 23:40:40 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBoxMessagestack {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBoxMessagestack($contents, $direct_output = false) {
+      $tableBox1_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox1_string .= ' ' . $this->table_parameters;
+      $tableBox1_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox1_string .= $contents[$i]['form'] . "\n";
+        $tableBox1_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox1_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox1_string .= ' ' . $contents[$i]['params'];
+        $tableBox1_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox1_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox1_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox1_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox1_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox1_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox1_string .= $contents[$i][$x]['form'];
+              $tableBox1_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox1_string .= '</form>';
+              $tableBox1_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox1_string .= '    <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox1_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox1_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox1_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox1_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
+        }
+
+        $tableBox1_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox1_string .= '</form>' . "\n";
+      }
+
+      $tableBox1_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox1_string;
+
+      return $tableBox1_string;
+    }
+  }
+//find content
+
+
+//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+//Site template configuration
+
+//get customer selected template if there is a customer selected template
+  $customer_pref_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate = tep_db_fetch_array($customer_pref_template_query);
+
+   if (tep_not_null($cptemplate['template_selected'])) {
+   //use customer selected template
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+    //use store default  
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    //use default   
+    define(TEMPLATE_NAME, 'default');
+    }
+   
+    define(TEMPLATE_STYLE, DIR_WS_TEMPLATES . TEMPLATE_NAME . "/stylesheet.css");
+  
+    define(TEMPLATE_STYLE_ORIGINAL, DIR_WS_TEMPLATES  . "/default/stylesheet.css");
+
+      // define content module location
+      $additional_modules_folder = DIR_WS_MODULES;
+
+    //get table configuration
+    if ( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/template.php')) {
+      require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/template.php');
+    } else {
+    }
+
+         //uses default boxes.php if one id not in template directory. 
+             if ( file_exists(TEMPLATE_BOX_TPL)) {
+        require(TEMPLATE_BOX_TPL);
+         }else if( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes.tpl.php')){
+       require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes.tpl.php');
+          } else {
+             require(DIR_WS_TEMPLATES .'/default/boxes.tpl.php');
+}
+define(DIR_FS_TEMPLATE_BOXES, DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes');
+
+if (file_exists(DIR_WS_TEMPLATES .TEMPLATE_NAME . '/mainpage_modules/')) {
+$modules_folder = (DIR_WS_TEMPLATES .TEMPLATE_NAME . '/mainpage_modules/');
+}else{
+$modules_folder = DIR_WS_MODULES . '/mainpage_modules/';
+}
+
+     // define content module location
+     define(DIR_WS_TEMPLATE_MODULES, DIR_WS_MODULES);
+
+$additional_module_folder = DIR_WS_TEMPLATE_MODULES;
+ //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+// get template configuration
+
+if ( file_exists(TEMPLATE_HTML_OUT)) {
+  require(TEMPLATE_HTML_OUT);
+}else if( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/extra_html_output.php')){
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/extra_html_output.php');
+  } else {
+  require(DIR_WS_TEMPLATES . '/default/extra_html_output.php');
+}
+//Lango Added for template mod: EOF
+
+// Gets template configuration from tables
+  $template_query = tep_db_query("select * from " . TABLE_TEMPLATE . " where template_name = '" . TEMPLATE_NAME . "'");
+  $template = tep_db_fetch_array($template_query);
+
+  define('TEMPLATE_ID', $template[template_id]);
+  define('CELLPADDING_MAIN', $template[template_cellpadding_main]);
+  define('CELLPADDING_LEFT', $template[template_cellpadding_left]);
+  define('CELLPADDING_RIGHT', $template[template_cellpadding_right]);
+  define('CELLPADDING_SUB', $template[template_cellpadding_sub]);
+  define('DISPLAY_COLUMN_LEFT', $template[include_column_left]);
+  define('DISPLAY_COLUMN_RIGHT', $template[include_column_right]);
+
+  define('SITE_WIDTH', $template[site_width]);
+  define('BOX_WIDTH_LEFT', $template[box_width_left]);
+  define('BOX_WIDTH_RIGHT', $template[box_width_right]);
+  define('SIDE_BOX_LEFT_WIDTH', $template[side_box_left_width]);
+  define('SIDE_BOX_RIGHT_WIDTH', $template[side_box_right_width]);
+  define('MAIN_TABLE_BORDER', $template[main_table_border]);
+  define('SHOW_HEADER_LINK_BUTTONS', $template[show_header_link_buttons]);
+ define('SHOW_CART_IN_HEADER', $template[cart_in_header]);
+ define('SHOW_LANGUAGES_IN_HEADER', $template[languages_in_header]);
+ define('SHOW_HEADING_TITLE_ORIGINAL', $template[show_heading_title_original]);
+ define('INCLUDE_MODULE_ONE', $template[module_one]);
+ define('INCLUDE_MODULE_TWO', $template[module_two]);
+ define('INCLUDE_MODULE_THREE', $template[module_three]);
+ define('INCLUDE_MODULE_FOUR', $template[module_four]);
+ define('INCLUDE_MODULE_FIVE', $template[module_five]);
+ define('INCLUDE_MODULE_SIX', $template[module_six]);
+ define('SHOW_CUSTOMER_GREETING', $template[customer_greeting]);
+ 
+ //find content check to see if content in template
+     if( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . $content)){
+       $content = (TEMPLATE_NAME .'/' . $content);
+          } else {
+
+ }
+
+ 
+ //Note these items are still in the data base
+// define('TEXT_GREETING_PERSONAL', stripslashes($template[edit_customer_greeting_personal]));
+// define('TEXT_GREETING_PERSONAL_RELOGON', stripslashes($template[edit_customer_greeting_personal]));
+// define('TEXT_GREETING_GUEST', stripslashes($template[edit_greeting_guest]));
+
+//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+////
+// The HTML image wrapper function
+  function tep_image_infobox($corner, $alt = '', $width = '', $height = '', $params = '') {
+
+
+    $image = '<img src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/' . $corner . '" border="0" alt="' . $alt . '"';
+    if ($alt) {
+      $image .= ' title=" ' . $alt . ' "';
+    }
+    if ($width) {
+      $image .= ' width="' . $width . '"';
+    }
+    if ($height) {
+      $image .= ' height="' . $height . '"';
+    }
+    if ($params) {
+      $image .= ' ' . $params;
+    }
+    $image .= '>';
+
+    return $image;
+  }
+
+//for templatebox
+if ($HTTP_GET_VARS['action']) {
+    switch ($HTTP_GET_VARS['action']) {
+      case 'update_template':
+
+      if ($template >= '1'){
+         $thema_template = tep_db_prepare_input($HTTP_POST_VARS['template']);
+           tep_db_query("update " . TABLE_CUSTOMERS . " set customers_selected_template = '$thema_template' where customers_id = '" . $customer_id . "'");
+          tep_redirect(tep_href_link(basename(FILENAME_DEFAULT)));
+             }
+         break;
+    }
+  }
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/__nusoap.php
===================================================================
--- trunk/direct.openmoko.com/includes/__nusoap.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/__nusoap.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,7241 @@
+<?php
+
+/*
+$Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+
+NuSOAP - Web Services Toolkit for PHP
+
+Copyright (c) 2002 NuSphere Corporation
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+If you have any questions or comments, please email:
+
+Dietrich Ayala
+dietrich at ganx4.com
+http://dietrich.ganx4.com/nusoap
+
+NuSphere Corporation
+http://www.nusphere.com
+
+*/
+
+/* load classes
+
+// necessary classes
+require_once('class.soapclient.php');
+require_once('class.soap_val.php');
+require_once('class.soap_parser.php');
+require_once('class.soap_fault.php');
+
+// transport classes
+require_once('class.soap_transport_http.php');
+
+// optional add-on classes
+require_once('class.xmlschema.php');
+require_once('class.wsdl.php');
+
+// server class
+require_once('class.soap_server.php');*/
+
+// class variable emulation
+// cf. http://www.webkreator.com/php/techniques/php-static-class-variables.html
+$GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = 9;
+
+/**
+*
+* nusoap_base
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class nusoap_base {
+	/**
+	 * Identification for HTTP headers.
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $title = 'NuSOAP';
+	/**
+	 * Version for HTTP headers.
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $version = '0.7.2';
+	/**
+	 * CVS revision for HTTP headers.
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $revision = '$Revision: 1.94 $';
+    /**
+     * Current error string (manipulated by getError/setError)
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $error_str = '';
+    /**
+     * Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment)
+	 *
+	 * @var string
+	 * @access private
+	 */
+    var $debug_str = '';
+    /**
+	 * toggles automatic encoding of special characters as entities
+	 * (should always be true, I think)
+	 *
+	 * @var boolean
+	 * @access private
+	 */
+	var $charencoding = true;
+	/**
+	 * the debug level for this instance
+	 *
+	 * @var	integer
+	 * @access private
+	 */
+	var $debugLevel;
+
+    /**
+	* set schema version
+	*
+	* @var      string
+	* @access   public
+	*/
+	var $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema';
+	
+    /**
+	* charset encoding for outgoing messages
+	*
+	* @var      string
+	* @access   public
+	*/
+    var $soap_defencoding = 'ISO-8859-1';
+	//var $soap_defencoding = 'UTF-8';
+
+	/**
+	* namespaces in an array of prefix => uri
+	*
+	* this is "seeded" by a set of constants, but it may be altered by code
+	*
+	* @var      array
+	* @access   public
+	*/
+	var $namespaces = array(
+		'SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/',
+		'xsd' => 'http://www.w3.org/2001/XMLSchema',
+		'xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
+		'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/'
+		);
+
+	/**
+	* namespaces used in the current context, e.g. during serialization
+	*
+	* @var      array
+	* @access   private
+	*/
+	var $usedNamespaces = array();
+
+	/**
+	* XML Schema types in an array of uri => (array of xml type => php type)
+	* is this legacy yet?
+	* no, this is used by the xmlschema class to verify type => namespace mappings.
+	* @var      array
+	* @access   public
+	*/
+	var $typemap = array(
+	'http://www.w3.org/2001/XMLSchema' => array(
+		'string'=>'string','boolean'=>'boolean','float'=>'double','double'=>'double','decimal'=>'double',
+		'duration'=>'','dateTime'=>'string','time'=>'string','date'=>'string','gYearMonth'=>'',
+		'gYear'=>'','gMonthDay'=>'','gDay'=>'','gMonth'=>'','hexBinary'=>'string','base64Binary'=>'string',
+		// abstract "any" types
+		'anyType'=>'string','anySimpleType'=>'string',
+		// derived datatypes
+		'normalizedString'=>'string','token'=>'string','language'=>'','NMTOKEN'=>'','NMTOKENS'=>'','Name'=>'','NCName'=>'','ID'=>'',
+		'IDREF'=>'','IDREFS'=>'','ENTITY'=>'','ENTITIES'=>'','integer'=>'integer','nonPositiveInteger'=>'integer',
+		'negativeInteger'=>'integer','long'=>'integer','int'=>'integer','short'=>'integer','byte'=>'integer','nonNegativeInteger'=>'integer',
+		'unsignedLong'=>'','unsignedInt'=>'','unsignedShort'=>'','unsignedByte'=>'','positiveInteger'=>''),
+	'http://www.w3.org/2000/10/XMLSchema' => array(
+		'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double',
+		'float'=>'double','dateTime'=>'string',
+		'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'),
+	'http://www.w3.org/1999/XMLSchema' => array(
+		'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double',
+		'float'=>'double','dateTime'=>'string',
+		'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'),
+	'http://soapinterop.org/xsd' => array('SOAPStruct'=>'struct'),
+	'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string','array'=>'array','Array'=>'array'),
+    'http://xml.apache.org/xml-soap' => array('Map')
+	);
+
+	/**
+	* XML entities to convert
+	*
+	* @var      array
+	* @access   public
+	* @deprecated
+	* @see	expandEntities
+	*/
+	var $xmlEntities = array('quot' => '"','amp' => '&',
+		'lt' => '<','gt' => '>','apos' => "'");
+
+	/**
+	* constructor
+	*
+	* @access	public
+	*/
+	function nusoap_base() {
+		$this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel;
+	}
+
+	/**
+	* gets the global debug level, which applies to future instances
+	*
+	* @return	integer	Debug level 0-9, where 0 turns off
+	* @access	public
+	*/
+	function getGlobalDebugLevel() {
+		return $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel;
+	}
+
+	/**
+	* sets the global debug level, which applies to future instances
+	*
+	* @param	int	$level	Debug level 0-9, where 0 turns off
+	* @access	public
+	*/
+	function setGlobalDebugLevel($level) {
+		$GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = $level;
+	}
+
+	/**
+	* gets the debug level for this instance
+	*
+	* @return	int	Debug level 0-9, where 0 turns off
+	* @access	public
+	*/
+	function getDebugLevel() {
+		return $this->debugLevel;
+	}
+
+	/**
+	* sets the debug level for this instance
+	*
+	* @param	int	$level	Debug level 0-9, where 0 turns off
+	* @access	public
+	*/
+	function setDebugLevel($level) {
+		$this->debugLevel = $level;
+	}
+
+	/**
+	* adds debug data to the instance debug string with formatting
+	*
+	* @param    string $string debug data
+	* @access   private
+	*/
+	function debug($string){
+		if ($this->debugLevel > 0) {
+			$this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n");
+		}
+	}
+
+	/**
+	* adds debug data to the instance debug string without formatting
+	*
+	* @param    string $string debug data
+	* @access   public
+	*/
+	function appendDebug($string){
+		if ($this->debugLevel > 0) {
+			// it would be nice to use a memory stream here to use
+			// memory more efficiently
+			$this->debug_str .= $string;
+		}
+	}
+
+	/**
+	* clears the current debug data for this instance
+	*
+	* @access   public
+	*/
+	function clearDebug() {
+		// it would be nice to use a memory stream here to use
+		// memory more efficiently
+		$this->debug_str = '';
+	}
+
+	/**
+	* gets the current debug data for this instance
+	*
+	* @return   debug data
+	* @access   public
+	*/
+	function &getDebug() {
+		// it would be nice to use a memory stream here to use
+		// memory more efficiently
+		return $this->debug_str;
+	}
+
+	/**
+	* gets the current debug data for this instance as an XML comment
+	* this may change the contents of the debug data
+	*
+	* @return   debug data as an XML comment
+	* @access   public
+	*/
+	function &getDebugAsXMLComment() {
+		// it would be nice to use a memory stream here to use
+		// memory more efficiently
+		while (strpos($this->debug_str, '--')) {
+			$this->debug_str = str_replace('--', '- -', $this->debug_str);
+		}
+    	return "<!--\n" . $this->debug_str . "\n-->";
+	}
+
+	/**
+	* expands entities, e.g. changes '<' to '&lt;'.
+	*
+	* @param	string	$val	The string in which to expand entities.
+	* @access	private
+	*/
+	function expandEntities($val) {
+		if ($this->charencoding) {
+	    	$val = str_replace('&', '&amp;', $val);
+	    	$val = str_replace("'", '&apos;', $val);
+	    	$val = str_replace('"', '&quot;', $val);
+	    	$val = str_replace('<', '&lt;', $val);
+	    	$val = str_replace('>', '&gt;', $val);
+	    }
+	    return $val;
+	}
+
+	/**
+	* returns error string if present
+	*
+	* @return   mixed error string or false
+	* @access   public
+	*/
+	function getError(){
+		if($this->error_str != ''){
+			return $this->error_str;
+		}
+		return false;
+	}
+
+	/**
+	* sets error string
+	*
+	* @return   boolean $string error string
+	* @access   private
+	*/
+	function setError($str){
+		$this->error_str = $str;
+	}
+
+	/**
+	* detect if array is a simple array or a struct (associative array)
+	*
+	* @param	mixed	$val	The PHP array
+	* @return	string	(arraySimple|arrayStruct)
+	* @access	private
+	*/
+	function isArraySimpleOrStruct($val) {
+        $keyList = array_keys($val);
+		foreach ($keyList as $keyListValue) {
+			if (!is_int($keyListValue)) {
+				return 'arrayStruct';
+			}
+		}
+		return 'arraySimple';
+	}
+
+	/**
+	* serializes PHP values in accordance w/ section 5. Type information is
+	* not serialized if $use == 'literal'.
+	*
+	* @param	mixed	$val	The value to serialize
+	* @param	string	$name	The name (local part) of the XML element
+	* @param	string	$type	The XML schema type (local part) for the element
+	* @param	string	$name_ns	The namespace for the name of the XML element
+	* @param	string	$type_ns	The namespace for the type of the element
+	* @param	array	$attributes	The attributes to serialize as name=>value pairs
+	* @param	string	$use	The WSDL "use" (encoded|literal)
+	* @return	string	The serialized element, possibly with child elements
+    * @access	public
+	*/
+	function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=false,$attributes=false,$use='encoded'){
+		$this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use");
+		$this->appendDebug('value=' . $this->varDump($val));
+		$this->appendDebug('attributes=' . $this->varDump($attributes));
+		
+    	if(is_object($val) && get_class($val) == 'soapval'){
+        	return $val->serialize($use);
+        }
+		// force valid name if necessary
+		if (is_numeric($name)) {
+			$name = '__numeric_' . $name;
+		} elseif (! $name) {
+			$name = 'noname';
+		}
+		// if name has ns, add ns prefix to name
+		$xmlns = '';
+        if($name_ns){
+			$prefix = 'nu'.rand(1000,9999);
+			$name = $prefix.':'.$name;
+			$xmlns .= " xmlns:$prefix=\"$name_ns\"";
+		}
+		// if type is prefixed, create type prefix
+		if($type_ns != '' && $type_ns == $this->namespaces['xsd']){
+			// need to fix this. shouldn't default to xsd if no ns specified
+		    // w/o checking against typemap
+			$type_prefix = 'xsd';
+		} elseif($type_ns){
+			$type_prefix = 'ns'.rand(1000,9999);
+			$xmlns .= " xmlns:$type_prefix=\"$type_ns\"";
+		}
+		// serialize attributes if present
+		$atts = '';
+		if($attributes){
+			foreach($attributes as $k => $v){
+				$atts .= " $k=\"".$this->expandEntities($v).'"';
+			}
+		}
+		// serialize null value
+		if (is_null($val)) {
+			if ($use == 'literal') {
+				// TODO: depends on minOccurs
+	        	return "<$name$xmlns $atts/>";
+        	} else {
+				if (isset($type) && isset($type_prefix)) {
+					$type_str = " xsi:type=\"$type_prefix:$type\"";
+				} else {
+					$type_str = '';
+				}
+	        	return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>";
+        	}
+		}
+        // serialize if an xsd built-in primitive type
+        if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){
+        	if (is_bool($val)) {
+        		if ($type == 'boolean') {
+	        		$val = $val ? 'true' : 'false';
+	        	} elseif (! $val) {
+	        		$val = 0;
+	        	}
+			} else if (is_string($val)) {
+				$val = $this->expandEntities($val);
+			}
+			if ($use == 'literal') {
+	        	return "<$name$xmlns $atts>$val</$name>";
+        	} else {
+	        	return "<$name$xmlns $atts xsi:type=\"xsd:$type\">$val</$name>";
+        	}
+        }
+		// detect type and serialize
+		$xml = '';
+		switch(true) {
+			case (is_bool($val) || $type == 'boolean'):
+        		if ($type == 'boolean') {
+	        		$val = $val ? 'true' : 'false';
+	        	} elseif (! $val) {
+	        		$val = 0;
+	        	}
+				if ($use == 'literal') {
+					$xml .= "<$name$xmlns $atts>$val</$name>";
+				} else {
+					$xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val</$name>";
+				}
+				break;
+			case (is_int($val) || is_long($val) || $type == 'int'):
+				if ($use == 'literal') {
+					$xml .= "<$name$xmlns $atts>$val</$name>";
+				} else {
+					$xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val</$name>";
+				}
+				break;
+			case (is_float($val)|| is_double($val) || $type == 'float'):
+				if ($use == 'literal') {
+					$xml .= "<$name$xmlns $atts>$val</$name>";
+				} else {
+					$xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val</$name>";
+				}
+				break;
+			case (is_string($val) || $type == 'string'):
+				$val = $this->expandEntities($val);
+				if ($use == 'literal') {
+					$xml .= "<$name$xmlns $atts>$val</$name>";
+				} else {
+					$xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val</$name>";
+				}
+				break;
+			case is_object($val):
+				if (! $name) {
+					$name = get_class($val);
+					$this->debug("In serialize_val, used class name $name as element name");
+				} else {
+					$this->debug("In serialize_val, do not override name $name for element name for class " . get_class($val));
+				}
+				foreach(get_object_vars($val) as $k => $v){
+					$pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use);
+				}
+				$xml .= '<'.$name.'>'.$pXml.'</'.$name.'>';
+				break;
+			break;
+			case (is_array($val) || $type):
+				// detect if struct or array
+				$valueType = $this->isArraySimpleOrStruct($val);
+                if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
+					$i = 0;
+					if(is_array($val) && count($val)> 0){
+						foreach($val as $v){
+	                    	if(is_object($v) && get_class($v) ==  'soapval'){
+								$tt_ns = $v->type_ns;
+								$tt = $v->type;
+							} elseif (is_array($v)) {
+								$tt = $this->isArraySimpleOrStruct($v);
+							} else {
+								$tt = gettype($v);
+	                        }
+							$array_types[$tt] = 1;
+							// TODO: for literal, the name should be $name
+							$xml .= $this->serialize_val($v,'item',false,false,false,false,$use);
+							++$i;
+						}
+						if(count($array_types) > 1){
+							$array_typename = 'xsd:anyType';
+						} elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) {
+							if ($tt == 'integer') {
+								$tt = 'int';
+							}
+							$array_typename = 'xsd:'.$tt;
+						} elseif(isset($tt) && $tt == 'arraySimple'){
+							$array_typename = 'SOAP-ENC:Array';
+						} elseif(isset($tt) && $tt == 'arrayStruct'){
+							$array_typename = 'unnamed_struct_use_soapval';
+						} else {
+							// if type is prefixed, create type prefix
+							if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){
+								 $array_typename = 'xsd:' . $tt;
+							} elseif ($tt_ns) {
+								$tt_prefix = 'ns' . rand(1000, 9999);
+								$array_typename = "$tt_prefix:$tt";
+								$xmlns .= " xmlns:$tt_prefix=\"$tt_ns\"";
+							} else {
+								$array_typename = $tt;
+							}
+						}
+						$array_type = $i;
+						if ($use == 'literal') {
+							$type_str = '';
+						} else if (isset($type) && isset($type_prefix)) {
+							$type_str = " xsi:type=\"$type_prefix:$type\"";
+						} else {
+							$type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\"";
+						}
+					// empty array
+					} else {
+						if ($use == 'literal') {
+							$type_str = '';
+						} else if (isset($type) && isset($type_prefix)) {
+							$type_str = " xsi:type=\"$type_prefix:$type\"";
+						} else {
+							$type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\"";
+						}
+					}
+					// TODO: for array in literal, there is no wrapper here
+					$xml = "<$name$xmlns$type_str$atts>".$xml."</$name>";
+				} else {
+					// got a struct
+					if(isset($type) && isset($type_prefix)){
+						$type_str = " xsi:type=\"$type_prefix:$type\"";
+					} else {
+						$type_str = '';
+					}
+					if ($use == 'literal') {
+						$xml .= "<$name$xmlns $atts>";
+					} else {
+						$xml .= "<$name$xmlns$type_str$atts>";
+					}
+					foreach($val as $k => $v){
+						// Apache Map
+						if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') {
+							$xml .= '<item>';
+							$xml .= $this->serialize_val($k,'key',false,false,false,false,$use);
+							$xml .= $this->serialize_val($v,'value',false,false,false,false,$use);
+							$xml .= '</item>';
+						} else {
+							$xml .= $this->serialize_val($v,$k,false,false,false,false,$use);
+						}
+					}
+					$xml .= "</$name>";
+				}
+				break;
+			default:
+				$xml .= 'not detected, got '.gettype($val).' for '.$val;
+				break;
+		}
+		return $xml;
+	}
+
+    /**
+    * serializes a message
+    *
+    * @param string $body the XML of the SOAP body
+    * @param mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers
+    * @param array $namespaces optional the namespaces used in generating the body and headers
+    * @param string $style optional (rpc|document)
+    * @param string $use optional (encoded|literal)
+    * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
+    * @return string the message
+    * @access public
+    */
+    function serializeEnvelope($body,$headers=false,$namespaces=array(),$style='rpc',$use='encoded',$encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'){
+    // TODO: add an option to automatically run utf8_encode on $body and $headers
+    // if $this->soap_defencoding is UTF-8.  Not doing this automatically allows
+    // one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1
+
+	$this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle");
+	$this->debug("headers:");
+	$this->appendDebug($this->varDump($headers));
+	$this->debug("namespaces:");
+	$this->appendDebug($this->varDump($namespaces));
+
+	// serialize namespaces
+    $ns_string = '';
+	foreach(array_merge($this->namespaces,$namespaces) as $k => $v){
+		$ns_string .= " xmlns:$k=\"$v\"";
+	}
+	if($encodingStyle) {
+		$ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string";
+	}
+
+	// serialize headers
+	if($headers){
+		if (is_array($headers)) {
+			$xml = '';
+			foreach ($headers as $header) {
+				$xml .= $this->serialize_val($header, false, false, false, false, false, $use);
+			}
+			$headers = $xml;
+			$this->debug("In serializeEnvelope, serialzied array of headers to $headers");
+		}
+		$headers = "<SOAP-ENV:Header>".$headers."</SOAP-ENV:Header>";
+	}
+	// serialize envelope
+	return
+	'<?xml version="1.0" encoding="'.$this->soap_defencoding .'"?'.">".
+	'<SOAP-ENV:Envelope'.$ns_string.">".
+	$headers.
+	"<SOAP-ENV:Body>".
+		$body.
+	"</SOAP-ENV:Body>".
+	"</SOAP-ENV:Envelope>";
+    }
+
+	/**
+	 * formats a string to be inserted into an HTML stream
+	 *
+	 * @param string $str The string to format
+	 * @return string The formatted string
+	 * @access public
+	 * @deprecated
+	 */
+    function formatDump($str){
+		$str = htmlspecialchars($str);
+		return nl2br($str);
+    }
+
+	/**
+	* contracts (changes namespace to prefix) a qualified name
+	*
+	* @param    string $qname qname
+	* @return	string contracted qname
+	* @access   private
+	*/
+	function contractQname($qname){
+		// get element namespace
+		//$this->xdebug("Contract $qname");
+		if (strrpos($qname, ':')) {
+			// get unqualified name
+			$name = substr($qname, strrpos($qname, ':') + 1);
+			// get ns
+			$ns = substr($qname, 0, strrpos($qname, ':'));
+			$p = $this->getPrefixFromNamespace($ns);
+			if ($p) {
+				return $p . ':' . $name;
+			}
+			return $qname;
+		} else {
+			return $qname;
+		}
+	}
+
+	/**
+	* expands (changes prefix to namespace) a qualified name
+	*
+	* @param    string $string qname
+	* @return	string expanded qname
+	* @access   private
+	*/
+	function expandQname($qname){
+		// get element prefix
+		if(strpos($qname,':') && !ereg('^http://',$qname)){
+			// get unqualified name
+			$name = substr(strstr($qname,':'),1);
+			// get ns prefix
+			$prefix = substr($qname,0,strpos($qname,':'));
+			if(isset($this->namespaces[$prefix])){
+				return $this->namespaces[$prefix].':'.$name;
+			} else {
+				return $qname;
+			}
+		} else {
+			return $qname;
+		}
+	}
+
+    /**
+    * returns the local part of a prefixed string
+    * returns the original string, if not prefixed
+    *
+    * @param string $str The prefixed string
+    * @return string The local part
+    * @access public
+    */
+	function getLocalPart($str){
+		if($sstr = strrchr($str,':')){
+			// get unqualified name
+			return substr( $sstr, 1 );
+		} else {
+			return $str;
+		}
+	}
+
+	/**
+    * returns the prefix part of a prefixed string
+    * returns false, if not prefixed
+    *
+    * @param string $str The prefixed string
+    * @return mixed The prefix or false if there is no prefix
+    * @access public
+    */
+	function getPrefix($str){
+		if($pos = strrpos($str,':')){
+			// get prefix
+			return substr($str,0,$pos);
+		}
+		return false;
+	}
+
+	/**
+    * pass it a prefix, it returns a namespace
+    *
+    * @param string $prefix The prefix
+    * @return mixed The namespace, false if no namespace has the specified prefix
+    * @access public
+    */
+	function getNamespaceFromPrefix($prefix){
+		if (isset($this->namespaces[$prefix])) {
+			return $this->namespaces[$prefix];
+		}
+		//$this->setError("No namespace registered for prefix '$prefix'");
+		return false;
+	}
+
+	/**
+    * returns the prefix for a given namespace (or prefix)
+    * or false if no prefixes registered for the given namespace
+    *
+    * @param string $ns The namespace
+    * @return mixed The prefix, false if the namespace has no prefixes
+    * @access public
+    */
+	function getPrefixFromNamespace($ns) {
+		foreach ($this->namespaces as $p => $n) {
+			if ($ns == $n || $ns == $p) {
+			    $this->usedNamespaces[$p] = $n;
+				return $p;
+			}
+		}
+		return false;
+	}
+
+	/**
+    * returns the time in ODBC canonical form with microseconds
+    *
+    * @return string The time in ODBC canonical form with microseconds
+    * @access public
+    */
+	function getmicrotime() {
+		if (function_exists('gettimeofday')) {
+			$tod = gettimeofday();
+			$sec = $tod['sec'];
+			$usec = $tod['usec'];
+		} else {
+			$sec = time();
+			$usec = 0;
+		}
+		return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec);
+	}
+
+	/**
+	 * Returns a string with the output of var_dump
+	 *
+	 * @param mixed $data The variable to var_dump
+	 * @return string The output of var_dump
+	 * @access public
+	 */
+    function varDump($data) {
+		ob_start();
+		var_dump($data);
+		$ret_val = ob_get_contents();
+		ob_end_clean();
+		return $ret_val;
+	}
+}
+
+// XML Schema Datatype Helper Functions
+
+//xsd:dateTime helpers
+
+/**
+* convert unix timestamp to ISO 8601 compliant date string
+*
+* @param    string $timestamp Unix time stamp
+* @access   public
+*/
+function timestamp_to_iso8601($timestamp,$utc=true){
+	$datestr = date('Y-m-d\TH:i:sO',$timestamp);
+	if($utc){
+		$eregStr =
+		'([0-9]{4})-'.	// centuries & years CCYY-
+		'([0-9]{2})-'.	// months MM-
+		'([0-9]{2})'.	// days DD
+		'T'.			// separator T
+		'([0-9]{2}):'.	// hours hh:
+		'([0-9]{2}):'.	// minutes mm:
+		'([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss...
+		'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
+
+		if(ereg($eregStr,$datestr,$regs)){
+			return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
+		}
+		return false;
+	} else {
+		return $datestr;
+	}
+}
+
+/**
+* convert ISO 8601 compliant date string to unix timestamp
+*
+* @param    string $datestr ISO 8601 compliant date string
+* @access   public
+*/
+function iso8601_to_timestamp($datestr){
+	$eregStr =
+	'([0-9]{4})-'.	// centuries & years CCYY-
+	'([0-9]{2})-'.	// months MM-
+	'([0-9]{2})'.	// days DD
+	'T'.			// separator T
+	'([0-9]{2}):'.	// hours hh:
+	'([0-9]{2}):'.	// minutes mm:
+	'([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss...
+	'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
+	if(ereg($eregStr,$datestr,$regs)){
+		// not utc
+		if($regs[8] != 'Z'){
+			$op = substr($regs[8],0,1);
+			$h = substr($regs[8],1,2);
+			$m = substr($regs[8],strlen($regs[8])-2,2);
+			if($op == '-'){
+				$regs[4] = $regs[4] + $h;
+				$regs[5] = $regs[5] + $m;
+			} elseif($op == '+'){
+				$regs[4] = $regs[4] - $h;
+				$regs[5] = $regs[5] - $m;
+			}
+		}
+		return strtotime("$regs[1]-$regs[2]-$regs[3] $regs[4]:$regs[5]:$regs[6]Z");
+	} else {
+		return false;
+	}
+}
+
+/**
+* sleeps some number of microseconds
+*
+* @param    string $usec the number of microseconds to sleep
+* @access   public
+* @deprecated
+*/
+function usleepWindows($usec)
+{
+	$start = gettimeofday();
+	
+	do
+	{
+		$stop = gettimeofday();
+		$timePassed = 1000000 * ($stop['sec'] - $start['sec'])
+		+ $stop['usec'] - $start['usec'];
+	}
+	while ($timePassed < $usec);
+}
+
+?><?php
+
+
+
+/**
+* Contains information for a SOAP fault.
+* Mainly used for returning faults from deployed functions
+* in a server instance.
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access public
+*/
+class soap_fault extends nusoap_base {
+	/**
+	 * The fault code (client|server)
+	 * @var string
+	 * @access private
+	 */
+	var $faultcode;
+	/**
+	 * The fault actor
+	 * @var string
+	 * @access private
+	 */
+	var $faultactor;
+	/**
+	 * The fault string, a description of the fault
+	 * @var string
+	 * @access private
+	 */
+	var $faultstring;
+	/**
+	 * The fault detail, typically a string or array of string
+	 * @var mixed
+	 * @access private
+	 */
+	var $faultdetail;
+
+	/**
+	* constructor
+    *
+    * @param string $faultcode (client | server)
+    * @param string $faultactor only used when msg routed between multiple actors
+    * @param string $faultstring human readable error message
+    * @param mixed $faultdetail detail, typically a string or array of string
+	*/
+	function soap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
+		parent::nusoap_base();
+		$this->faultcode = $faultcode;
+		$this->faultactor = $faultactor;
+		$this->faultstring = $faultstring;
+		$this->faultdetail = $faultdetail;
+	}
+
+	/**
+	* serialize a fault
+	*
+	* @return	string	The serialization of the fault instance.
+	* @access   public
+	*/
+	function serialize(){
+		$ns_string = '';
+		foreach($this->namespaces as $k => $v){
+			$ns_string .= "\n  xmlns:$k=\"$v\"";
+		}
+		$return_msg =
+			'<?xml version="1.0" encoding="'.$this->soap_defencoding.'"?>'.
+			'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"'.$ns_string.">\n".
+				'<SOAP-ENV:Body>'.
+				'<SOAP-ENV:Fault>'.
+					$this->serialize_val($this->faultcode, 'faultcode').
+					$this->serialize_val($this->faultactor, 'faultactor').
+					$this->serialize_val($this->faultstring, 'faultstring').
+					$this->serialize_val($this->faultdetail, 'detail').
+				'</SOAP-ENV:Fault>'.
+				'</SOAP-ENV:Body>'.
+			'</SOAP-ENV:Envelope>';
+		return $return_msg;
+	}
+}
+
+
+
+?><?php
+
+
+
+/**
+* parses an XML Schema, allows access to it's data, other utility methods
+* no validation... yet.
+* very experimental and limited. As is discussed on XML-DEV, I'm one of the people
+* that just doesn't have time to read the spec(s) thoroughly, and just have a couple of trusty
+* tutorials I refer to :)
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class XMLSchema extends nusoap_base  {
+	
+	// files
+	var $schema = '';
+	var $xml = '';
+	// namespaces
+	var $enclosingNamespaces;
+	// schema info
+	var $schemaInfo = array();
+	var $schemaTargetNamespace = '';
+	// types, elements, attributes defined by the schema
+	var $attributes = array();
+	var $complexTypes = array();
+	var $complexTypeStack = array();
+	var $currentComplexType = null;
+	var $elements = array();
+	var $elementStack = array();
+	var $currentElement = null;
+	var $simpleTypes = array();
+	var $simpleTypeStack = array();
+	var $currentSimpleType = null;
+	// imports
+	var $imports = array();
+	// parser vars
+	var $parser;
+	var $position = 0;
+	var $depth = 0;
+	var $depth_array = array();
+	var $message = array();
+	var $defaultNamespace = array();
+    
+	/**
+	* constructor
+	*
+	* @param    string $schema schema document URI
+	* @param    string $xml xml document URI
+	* @param	string $namespaces namespaces defined in enclosing XML
+	* @access   public
+	*/
+	function XMLSchema($schema='',$xml='',$namespaces=array()){
+		parent::nusoap_base();
+		$this->debug('xmlschema class instantiated, inside constructor');
+		// files
+		$this->schema = $schema;
+		$this->xml = $xml;
+
+		// namespaces
+		$this->enclosingNamespaces = $namespaces;
+		$this->namespaces = array_merge($this->namespaces, $namespaces);
+
+		// parse schema file
+		if($schema != ''){
+			$this->debug('initial schema file: '.$schema);
+			$this->parseFile($schema, 'schema');
+		}
+
+		// parse xml file
+		if($xml != ''){
+			$this->debug('initial xml file: '.$xml);
+			$this->parseFile($xml, 'xml');
+		}
+
+	}
+
+    /**
+    * parse an XML file
+    *
+    * @param string $xml, path/URL to XML file
+    * @param string $type, (schema | xml)
+	* @return boolean
+    * @access public
+    */
+	function parseFile($xml,$type){
+		// parse xml file
+		if($xml != ""){
+			$xmlStr = @join("", at file($xml));
+			if($xmlStr == ""){
+				$msg = 'Error reading XML from '.$xml;
+				$this->setError($msg);
+				$this->debug($msg);
+			return false;
+			} else {
+				$this->debug("parsing $xml");
+				$this->parseString($xmlStr,$type);
+				$this->debug("done parsing $xml");
+			return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	* parse an XML string
+	*
+	* @param    string $xml path or URL
+    * @param string $type, (schema|xml)
+	* @access   private
+	*/
+	function parseString($xml,$type){
+		// parse xml string
+		if($xml != ""){
+
+	    	// Create an XML parser.
+	    	$this->parser = xml_parser_create();
+	    	// Set the options for parsing the XML data.
+	    	xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
+
+	    	// Set the object for the parser.
+	    	xml_set_object($this->parser, $this);
+
+	    	// Set the element handlers for the parser.
+			if($type == "schema"){
+		    	xml_set_element_handler($this->parser, 'schemaStartElement','schemaEndElement');
+		    	xml_set_character_data_handler($this->parser,'schemaCharacterData');
+			} elseif($type == "xml"){
+				xml_set_element_handler($this->parser, 'xmlStartElement','xmlEndElement');
+		    	xml_set_character_data_handler($this->parser,'xmlCharacterData');
+			}
+
+		    // Parse the XML file.
+		    if(!xml_parse($this->parser,$xml,true)){
+			// Display an error message.
+				$errstr = sprintf('XML error parsing XML schema on line %d: %s',
+				xml_get_current_line_number($this->parser),
+				xml_error_string(xml_get_error_code($this->parser))
+				);
+				$this->debug($errstr);
+				$this->debug("XML payload:\n" . $xml);
+				$this->setError($errstr);
+	    	}
+            
+			xml_parser_free($this->parser);
+		} else{
+			$this->debug('no xml passed to parseString()!!');
+			$this->setError('no xml passed to parseString()!!');
+		}
+	}
+
+	/**
+	* start-element handler
+	*
+	* @param    string $parser XML parser object
+	* @param    string $name element name
+	* @param    string $attrs associative array of attributes
+	* @access   private
+	*/
+	function schemaStartElement($parser, $name, $attrs) {
+		
+		// position in the total number of elements, starting from 0
+		$pos = $this->position++;
+		$depth = $this->depth++;
+		// set self as current value for this depth
+		$this->depth_array[$depth] = $pos;
+		$this->message[$pos] = array('cdata' => ''); 
+		if ($depth > 0) {
+			$this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]];
+		} else {
+			$this->defaultNamespace[$pos] = false;
+		}
+
+		// get element prefix
+		if($prefix = $this->getPrefix($name)){
+			// get unqualified name
+			$name = $this->getLocalPart($name);
+		} else {
+        	$prefix = '';
+        }
+		
+        // loop thru attributes, expanding, and registering namespace declarations
+        if(count($attrs) > 0){
+        	foreach($attrs as $k => $v){
+                // if ns declarations, add to class level array of valid namespaces
+				if(ereg("^xmlns",$k)){
+                	//$this->xdebug("$k: $v");
+                	//$this->xdebug('ns_prefix: '.$this->getPrefix($k));
+                	if($ns_prefix = substr(strrchr($k,':'),1)){
+                		//$this->xdebug("Add namespace[$ns_prefix] = $v");
+						$this->namespaces[$ns_prefix] = $v;
+					} else {
+						$this->defaultNamespace[$pos] = $v;
+						if (! $this->getPrefixFromNamespace($v)) {
+							$this->namespaces['ns'.(count($this->namespaces)+1)] = $v;
+						}
+					}
+					if($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema'){
+						$this->XMLSchemaVersion = $v;
+						$this->namespaces['xsi'] = $v.'-instance';
+					}
+				}
+        	}
+        	foreach($attrs as $k => $v){
+                // expand each attribute
+                $k = strpos($k,':') ? $this->expandQname($k) : $k;
+                $v = strpos($v,':') ? $this->expandQname($v) : $v;
+        		$eAttrs[$k] = $v;
+        	}
+        	$attrs = $eAttrs;
+        } else {
+        	$attrs = array();
+        }
+		// find status, register data
+		switch($name){
+			case 'all':			// (optional) compositor content for a complexType
+			case 'choice':
+			case 'group':
+			case 'sequence':
+				//$this->xdebug("compositor $name for currentComplexType: $this->currentComplexType and currentElement: $this->currentElement");
+				$this->complexTypes[$this->currentComplexType]['compositor'] = $name;
+				//if($name == 'all' || $name == 'sequence'){
+				//	$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
+				//}
+			break;
+			case 'attribute':	// complexType attribute
+            	//$this->xdebug("parsing attribute $attrs[name] $attrs[ref] of value: ".$attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']);
+            	$this->xdebug("parsing attribute:");
+            	$this->appendDebug($this->varDump($attrs));
+				if (!isset($attrs['form'])) {
+					$attrs['form'] = $this->schemaInfo['attributeFormDefault'];
+				}
+            	if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) {
+					$v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'];
+					if (!strpos($v, ':')) {
+						// no namespace in arrayType attribute value...
+						if ($this->defaultNamespace[$pos]) {
+							// ...so use the default
+							$attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'] = $this->defaultNamespace[$pos] . ':' . $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'];
+						}
+					}
+            	}
+                if(isset($attrs['name'])){
+					$this->attributes[$attrs['name']] = $attrs;
+					$aname = $attrs['name'];
+				} elseif(isset($attrs['ref']) && $attrs['ref'] == 'http://schemas.xmlsoap.org/soap/encoding/:arrayType'){
+					if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) {
+	                	$aname = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'];
+	                } else {
+	                	$aname = '';
+	                }
+				} elseif(isset($attrs['ref'])){
+					$aname = $attrs['ref'];
+                    $this->attributes[$attrs['ref']] = $attrs;
+				}
+                
+				if($this->currentComplexType){	// This should *always* be
+					$this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs;
+				}
+				// arrayType attribute
+				if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']) || $this->getLocalPart($aname) == 'arrayType'){
+					$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
+                	$prefix = $this->getPrefix($aname);
+					if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])){
+						$v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'];
+					} else {
+						$v = '';
+					}
+                    if(strpos($v,'[,]')){
+                        $this->complexTypes[$this->currentComplexType]['multidimensional'] = true;
+                    }
+                    $v = substr($v,0,strpos($v,'[')); // clip the []
+                    if(!strpos($v,':') && isset($this->typemap[$this->XMLSchemaVersion][$v])){
+                        $v = $this->XMLSchemaVersion.':'.$v;
+                    }
+                    $this->complexTypes[$this->currentComplexType]['arrayType'] = $v;
+				}
+			break;
+			case 'complexContent':	// (optional) content for a complexType
+			break;
+			case 'complexType':
+				array_push($this->complexTypeStack, $this->currentComplexType);
+				if(isset($attrs['name'])){
+					$this->xdebug('processing named complexType '.$attrs['name']);
+					//$this->currentElement = false;
+					$this->currentComplexType = $attrs['name'];
+					$this->complexTypes[$this->currentComplexType] = $attrs;
+					$this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
+					// This is for constructs like
+					//           <complexType name="ListOfString" base="soap:Array">
+					//                <sequence>
+					//                    <element name="string" type="xsd:string"
+					//                        minOccurs="0" maxOccurs="unbounded" />
+					//                </sequence>
+					//            </complexType>
+					if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
+						$this->xdebug('complexType is unusual array');
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
+					} else {
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
+					}
+				}else{
+					$this->xdebug('processing unnamed complexType for element '.$this->currentElement);
+					$this->currentComplexType = $this->currentElement . '_ContainedType';
+					//$this->currentElement = false;
+					$this->complexTypes[$this->currentComplexType] = $attrs;
+					$this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
+					// This is for constructs like
+					//           <complexType name="ListOfString" base="soap:Array">
+					//                <sequence>
+					//                    <element name="string" type="xsd:string"
+					//                        minOccurs="0" maxOccurs="unbounded" />
+					//                </sequence>
+					//            </complexType>
+					if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
+						$this->xdebug('complexType is unusual array');
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
+					} else {
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
+					}
+				}
+			break;
+			case 'element':
+				array_push($this->elementStack, $this->currentElement);
+				// elements defined as part of a complex type should
+				// not really be added to $this->elements, but for some
+				// reason, they are
+				if (!isset($attrs['form'])) {
+					$attrs['form'] = $this->schemaInfo['elementFormDefault'];
+				}
+				if(isset($attrs['type'])){
+					$this->xdebug("processing typed element ".$attrs['name']." of type ".$attrs['type']);
+					if (! $this->getPrefix($attrs['type'])) {
+						if ($this->defaultNamespace[$pos]) {
+							$attrs['type'] = $this->defaultNamespace[$pos] . ':' . $attrs['type'];
+							$this->xdebug('used default namespace to make type ' . $attrs['type']);
+						}
+					}
+					// This is for constructs like
+					//           <complexType name="ListOfString" base="soap:Array">
+					//                <sequence>
+					//                    <element name="string" type="xsd:string"
+					//                        minOccurs="0" maxOccurs="unbounded" />
+					//                </sequence>
+					//            </complexType>
+					if ($this->currentComplexType && $this->complexTypes[$this->currentComplexType]['phpType'] == 'array') {
+						$this->xdebug('arrayType for unusual array is ' . $attrs['type']);
+						$this->complexTypes[$this->currentComplexType]['arrayType'] = $attrs['type'];
+					}
+					$this->currentElement = $attrs['name'];
+					$this->elements[ $attrs['name'] ] = $attrs;
+					$this->elements[ $attrs['name'] ]['typeClass'] = 'element';
+					$ename = $attrs['name'];
+				} elseif(isset($attrs['ref'])){
+					$this->xdebug("processing element as ref to ".$attrs['ref']);
+					$this->currentElement = "ref to ".$attrs['ref'];
+					$ename = $this->getLocalPart($attrs['ref']);
+				} else {
+					$this->xdebug("processing untyped element ".$attrs['name']);
+					$this->currentElement = $attrs['name'];
+					$this->elements[ $attrs['name'] ] = $attrs;
+					$this->elements[ $attrs['name'] ]['typeClass'] = 'element';
+					$attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['name'] . '_ContainedType';
+					$this->elements[ $attrs['name'] ]['type'] = $attrs['type'];
+					$ename = $attrs['name'];
+				}
+				if(isset($ename) && $this->currentComplexType){
+					$this->complexTypes[$this->currentComplexType]['elements'][$ename] = $attrs;
+				}
+			break;
+			case 'enumeration':	//	restriction value list member
+				$this->xdebug('enumeration ' . $attrs['value']);
+				if ($this->currentSimpleType) {
+					$this->simpleTypes[$this->currentSimpleType]['enumeration'][] = $attrs['value'];
+				} elseif ($this->currentComplexType) {
+					$this->complexTypes[$this->currentComplexType]['enumeration'][] = $attrs['value'];
+				}
+			break;
+			case 'extension':	// simpleContent or complexContent type extension
+				$this->xdebug('extension ' . $attrs['base']);
+				if ($this->currentComplexType) {
+					$this->complexTypes[$this->currentComplexType]['extensionBase'] = $attrs['base'];
+				}
+			break;
+			case 'import':
+			    if (isset($attrs['schemaLocation'])) {
+					//$this->xdebug('import namespace ' . $attrs['namespace'] . ' from ' . $attrs['schemaLocation']);
+                    $this->imports[$attrs['namespace']][] = array('location' => $attrs['schemaLocation'], 'loaded' => false);
+				} else {
+					//$this->xdebug('import namespace ' . $attrs['namespace']);
+                    $this->imports[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
+					if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
+						$this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace'];
+					}
+				}
+			break;
+			case 'list':	// simpleType value list
+			break;
+			case 'restriction':	// simpleType, simpleContent or complexContent value restriction
+				$this->xdebug('restriction ' . $attrs['base']);
+				if($this->currentSimpleType){
+					$this->simpleTypes[$this->currentSimpleType]['type'] = $attrs['base'];
+				} elseif($this->currentComplexType){
+					$this->complexTypes[$this->currentComplexType]['restrictionBase'] = $attrs['base'];
+					if(strstr($attrs['base'],':') == ':Array'){
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
+					}
+				}
+			break;
+			case 'schema':
+				$this->schemaInfo = $attrs;
+				$this->schemaInfo['schemaVersion'] = $this->getNamespaceFromPrefix($prefix);
+				if (isset($attrs['targetNamespace'])) {
+					$this->schemaTargetNamespace = $attrs['targetNamespace'];
+				}
+				if (!isset($attrs['elementFormDefault'])) {
+					$this->schemaInfo['elementFormDefault'] = 'unqualified';
+				}
+				if (!isset($attrs['attributeFormDefault'])) {
+					$this->schemaInfo['attributeFormDefault'] = 'unqualified';
+				}
+			break;
+			case 'simpleContent':	// (optional) content for a complexType
+			break;
+			case 'simpleType':
+				array_push($this->simpleTypeStack, $this->currentSimpleType);
+				if(isset($attrs['name'])){
+					$this->xdebug("processing simpleType for name " . $attrs['name']);
+					$this->currentSimpleType = $attrs['name'];
+					$this->simpleTypes[ $attrs['name'] ] = $attrs;
+					$this->simpleTypes[ $attrs['name'] ]['typeClass'] = 'simpleType';
+					$this->simpleTypes[ $attrs['name'] ]['phpType'] = 'scalar';
+				} else {
+					$this->xdebug('processing unnamed simpleType for element '.$this->currentElement);
+					$this->currentSimpleType = $this->currentElement . '_ContainedType';
+					//$this->currentElement = false;
+					$this->simpleTypes[$this->currentSimpleType] = $attrs;
+					$this->simpleTypes[$this->currentSimpleType]['phpType'] = 'scalar';
+				}
+			break;
+			case 'union':	// simpleType type list
+			break;
+			default:
+				//$this->xdebug("do not have anything to do for element $name");
+		}
+	}
+
+	/**
+	* end-element handler
+	*
+	* @param    string $parser XML parser object
+	* @param    string $name element name
+	* @access   private
+	*/
+	function schemaEndElement($parser, $name) {
+		// bring depth down a notch
+		$this->depth--;
+		// position of current element is equal to the last value left in depth_array for my depth
+		if(isset($this->depth_array[$this->depth])){
+        	$pos = $this->depth_array[$this->depth];
+        }
+		// get element prefix
+		if ($prefix = $this->getPrefix($name)){
+			// get unqualified name
+			$name = $this->getLocalPart($name);
+		} else {
+        	$prefix = '';
+        }
+		// move on...
+		if($name == 'complexType'){
+			$this->xdebug('done processing complexType ' . ($this->currentComplexType ? $this->currentComplexType : '(unknown)'));
+			$this->currentComplexType = array_pop($this->complexTypeStack);
+			//$this->currentElement = false;
+		}
+		if($name == 'element'){
+			$this->xdebug('done processing element ' . ($this->currentElement ? $this->currentElement : '(unknown)'));
+			$this->currentElement = array_pop($this->elementStack);
+		}
+		if($name == 'simpleType'){
+			$this->xdebug('done processing simpleType ' . ($this->currentSimpleType ? $this->currentSimpleType : '(unknown)'));
+			$this->currentSimpleType = array_pop($this->simpleTypeStack);
+		}
+	}
+
+	/**
+	* element content handler
+	*
+	* @param    string $parser XML parser object
+	* @param    string $data element content
+	* @access   private
+	*/
+	function schemaCharacterData($parser, $data){
+		$pos = $this->depth_array[$this->depth - 1];
+		$this->message[$pos]['cdata'] .= $data;
+	}
+
+	/**
+	* serialize the schema
+	*
+	* @access   public
+	*/
+	function serializeSchema(){
+
+		$schemaPrefix = $this->getPrefixFromNamespace($this->XMLSchemaVersion);
+		$xml = '';
+		// imports
+		if (sizeof($this->imports) > 0) {
+			foreach($this->imports as $ns => $list) {
+				foreach ($list as $ii) {
+					if ($ii['location'] != '') {
+						$xml .= " <$schemaPrefix:import location=\"" . $ii['location'] . '" namespace="' . $ns . "\" />\n";
+					} else {
+						$xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n";
+					}
+				}
+			} 
+		} 
+		// complex types
+		foreach($this->complexTypes as $typeName => $attrs){
+			$contentStr = '';
+			// serialize child elements
+			if(isset($attrs['elements']) && (count($attrs['elements']) > 0)){
+				foreach($attrs['elements'] as $element => $eParts){
+					if(isset($eParts['ref'])){
+						$contentStr .= "   <$schemaPrefix:element ref=\"$element\"/>\n";
+					} else {
+						$contentStr .= "   <$schemaPrefix:element name=\"$element\" type=\"" . $this->contractQName($eParts['type']) . "\"";
+						foreach ($eParts as $aName => $aValue) {
+							// handle, e.g., abstract, default, form, minOccurs, maxOccurs, nillable
+							if ($aName != 'name' && $aName != 'type') {
+								$contentStr .= " $aName=\"$aValue\"";
+							}
+						}
+						$contentStr .= "/>\n";
+					}
+				}
+				// compositor wraps elements
+				if (isset($attrs['compositor']) && ($attrs['compositor'] != '')) {
+					$contentStr = "  <$schemaPrefix:$attrs[compositor]>\n".$contentStr."  </$schemaPrefix:$attrs[compositor]>\n";
+				}
+			}
+			// attributes
+			if(isset($attrs['attrs']) && (count($attrs['attrs']) >= 1)){
+				foreach($attrs['attrs'] as $attr => $aParts){
+					$contentStr .= "    <$schemaPrefix:attribute";
+					foreach ($aParts as $a => $v) {
+						if ($a == 'ref' || $a == 'type') {
+							$contentStr .= " $a=\"".$this->contractQName($v).'"';
+						} elseif ($a == 'http://schemas.xmlsoap.org/wsdl/:arrayType') {
+							$this->usedNamespaces['wsdl'] = $this->namespaces['wsdl'];
+							$contentStr .= ' wsdl:arrayType="'.$this->contractQName($v).'"';
+						} else {
+							$contentStr .= " $a=\"$v\"";
+						}
+					}
+					$contentStr .= "/>\n";
+				}
+			}
+			// if restriction
+			if (isset($attrs['restrictionBase']) && $attrs['restrictionBase'] != ''){
+				$contentStr = "   <$schemaPrefix:restriction base=\"".$this->contractQName($attrs['restrictionBase'])."\">\n".$contentStr."   </$schemaPrefix:restriction>\n";
+				// complex or simple content
+				if ((isset($attrs['elements']) && count($attrs['elements']) > 0) || (isset($attrs['attrs']) && count($attrs['attrs']) > 0)){
+					$contentStr = "  <$schemaPrefix:complexContent>\n".$contentStr."  </$schemaPrefix:complexContent>\n";
+				}
+			}
+			// finalize complex type
+			if($contentStr != ''){
+				$contentStr = " <$schemaPrefix:complexType name=\"$typeName\">\n".$contentStr." </$schemaPrefix:complexType>\n";
+			} else {
+				$contentStr = " <$schemaPrefix:complexType name=\"$typeName\"/>\n";
+			}
+			$xml .= $contentStr;
+		}
+		// simple types
+		if(isset($this->simpleTypes) && count($this->simpleTypes) > 0){
+			foreach($this->simpleTypes as $typeName => $eParts){
+				$xml .= " <$schemaPrefix:simpleType name=\"$typeName\">\n  <$schemaPrefix:restriction base=\"".$this->contractQName($eParts['type'])."\"/>\n";
+				if (isset($eParts['enumeration'])) {
+					foreach ($eParts['enumeration'] as $e) {
+						$xml .= "  <$schemaPrefix:enumeration value=\"$e\"/>\n";
+					}
+				}
+				$xml .= " </$schemaPrefix:simpleType>";
+			}
+		}
+		// elements
+		if(isset($this->elements) && count($this->elements) > 0){
+			foreach($this->elements as $element => $eParts){
+				$xml .= " <$schemaPrefix:element name=\"$element\" type=\"".$this->contractQName($eParts['type'])."\"/>\n";
+			}
+		}
+		// attributes
+		if(isset($this->attributes) && count($this->attributes) > 0){
+			foreach($this->attributes as $attr => $aParts){
+				$xml .= " <$schemaPrefix:attribute name=\"$attr\" type=\"".$this->contractQName($aParts['type'])."\"\n/>";
+			}
+		}
+		// finish 'er up
+		$el = "<$schemaPrefix:schema targetNamespace=\"$this->schemaTargetNamespace\"\n";
+		foreach (array_diff($this->usedNamespaces, $this->enclosingNamespaces) as $nsp => $ns) {
+			$el .= " xmlns:$nsp=\"$ns\"\n";
+		}
+		$xml = $el . ">\n".$xml."</$schemaPrefix:schema>\n";
+		return $xml;
+	}
+
+	/**
+	* adds debug data to the clas level debug string
+	*
+	* @param    string $string debug data
+	* @access   private
+	*/
+	function xdebug($string){
+		$this->debug('<' . $this->schemaTargetNamespace . '> '.$string);
+	}
+
+    /**
+    * get the PHP type of a user defined type in the schema
+    * PHP type is kind of a misnomer since it actually returns 'struct' for assoc. arrays
+    * returns false if no type exists, or not w/ the given namespace
+    * else returns a string that is either a native php type, or 'struct'
+    *
+    * @param string $type, name of defined type
+    * @param string $ns, namespace of type
+    * @return mixed
+    * @access public
+    * @deprecated
+    */
+	function getPHPType($type,$ns){
+		if(isset($this->typemap[$ns][$type])){
+			//print "found type '$type' and ns $ns in typemap<br>";
+			return $this->typemap[$ns][$type];
+		} elseif(isset($this->complexTypes[$type])){
+			//print "getting type '$type' and ns $ns from complexTypes array<br>";
+			return $this->complexTypes[$type]['phpType'];
+		}
+		return false;
+	}
+
+	/**
+    * returns an associative array of information about a given type
+    * returns false if no type exists by the given name
+    *
+	*	For a complexType typeDef = array(
+	*	'restrictionBase' => '',
+	*	'phpType' => '',
+	*	'compositor' => '(sequence|all)',
+	*	'elements' => array(), // refs to elements array
+	*	'attrs' => array() // refs to attributes array
+	*	... and so on (see addComplexType)
+	*	)
+	*
+	*   For simpleType or element, the array has different keys.
+    *
+    * @param string
+    * @return mixed
+    * @access public
+    * @see addComplexType
+    * @see addSimpleType
+    * @see addElement
+    */
+	function getTypeDef($type){
+		//$this->debug("in getTypeDef for type $type");
+		if(isset($this->complexTypes[$type])){
+			$this->xdebug("in getTypeDef, found complexType $type");
+			return $this->complexTypes[$type];
+		} elseif(isset($this->simpleTypes[$type])){
+			$this->xdebug("in getTypeDef, found simpleType $type");
+			if (!isset($this->simpleTypes[$type]['phpType'])) {
+				// get info for type to tack onto the simple type
+				// TODO: can this ever really apply (i.e. what is a simpleType really?)
+				$uqType = substr($this->simpleTypes[$type]['type'], strrpos($this->simpleTypes[$type]['type'], ':') + 1);
+				$ns = substr($this->simpleTypes[$type]['type'], 0, strrpos($this->simpleTypes[$type]['type'], ':'));
+				$etype = $this->getTypeDef($uqType);
+				if ($etype) {
+					$this->xdebug("in getTypeDef, found type for simpleType $type:");
+					$this->xdebug($this->varDump($etype));
+					if (isset($etype['phpType'])) {
+						$this->simpleTypes[$type]['phpType'] = $etype['phpType'];
+					}
+					if (isset($etype['elements'])) {
+						$this->simpleTypes[$type]['elements'] = $etype['elements'];
+					}
+				}
+			}
+			return $this->simpleTypes[$type];
+		} elseif(isset($this->elements[$type])){
+			$this->xdebug("in getTypeDef, found element $type");
+			if (!isset($this->elements[$type]['phpType'])) {
+				// get info for type to tack onto the element
+				$uqType = substr($this->elements[$type]['type'], strrpos($this->elements[$type]['type'], ':') + 1);
+				$ns = substr($this->elements[$type]['type'], 0, strrpos($this->elements[$type]['type'], ':'));
+				$etype = $this->getTypeDef($uqType);
+				if ($etype) {
+					$this->xdebug("in getTypeDef, found type for element $type:");
+					$this->xdebug($this->varDump($etype));
+					if (isset($etype['phpType'])) {
+						$this->elements[$type]['phpType'] = $etype['phpType'];
+					}
+					if (isset($etype['elements'])) {
+						$this->elements[$type]['elements'] = $etype['elements'];
+					}
+				} elseif ($ns == 'http://www.w3.org/2001/XMLSchema') {
+					$this->xdebug("in getTypeDef, element $type is an XSD type");
+					$this->elements[$type]['phpType'] = 'scalar';
+				}
+			}
+			return $this->elements[$type];
+		} elseif(isset($this->attributes[$type])){
+			$this->xdebug("in getTypeDef, found attribute $type");
+			return $this->attributes[$type];
+		} elseif (ereg('_ContainedType$', $type)) {
+			$this->xdebug("in getTypeDef, have an untyped element $type");
+			$typeDef['typeClass'] = 'simpleType';
+			$typeDef['phpType'] = 'scalar';
+			$typeDef['type'] = 'http://www.w3.org/2001/XMLSchema:string';
+			return $typeDef;
+		}
+		$this->xdebug("in getTypeDef, did not find $type");
+		return false;
+	}
+
+	/**
+    * returns a sample serialization of a given type, or false if no type by the given name
+    *
+    * @param string $type, name of type
+    * @return mixed
+    * @access public
+    * @deprecated
+    */
+    function serializeTypeDef($type){
+    	//print "in sTD() for type $type<br>";
+	if($typeDef = $this->getTypeDef($type)){
+		$str .= '<'.$type;
+	    if(is_array($typeDef['attrs'])){
+		foreach($attrs as $attName => $data){
+		    $str .= " $attName=\"{type = ".$data['type']."}\"";
+		}
+	    }
+	    $str .= " xmlns=\"".$this->schema['targetNamespace']."\"";
+	    if(count($typeDef['elements']) > 0){
+		$str .= ">";
+		foreach($typeDef['elements'] as $element => $eData){
+		    $str .= $this->serializeTypeDef($element);
+		}
+		$str .= "</$type>";
+	    } elseif($typeDef['typeClass'] == 'element') {
+		$str .= "></$type>";
+	    } else {
+		$str .= "/>";
+	    }
+			return $str;
+	}
+    	return false;
+    }
+
+    /**
+    * returns HTML form elements that allow a user
+    * to enter values for creating an instance of the given type.
+    *
+    * @param string $name, name for type instance
+    * @param string $type, name of type
+    * @return string
+    * @access public
+    * @deprecated
+	*/
+	function typeToForm($name,$type){
+		// get typedef
+		if($typeDef = $this->getTypeDef($type)){
+			// if struct
+			if($typeDef['phpType'] == 'struct'){
+				$buffer .= '<table>';
+				foreach($typeDef['elements'] as $child => $childDef){
+					$buffer .= "
+					<tr><td align='right'>$childDef[name] (type: ".$this->getLocalPart($childDef['type'])."):</td>
+					<td><input type='text' name='parameters[".$name."][$childDef[name]]'></td></tr>";
+				}
+				$buffer .= '</table>';
+			// if array
+			} elseif($typeDef['phpType'] == 'array'){
+				$buffer .= '<table>';
+				for($i=0;$i < 3; $i++){
+					$buffer .= "
+					<tr><td align='right'>array item (type: $typeDef[arrayType]):</td>
+					<td><input type='text' name='parameters[".$name."][]'></td></tr>";
+				}
+				$buffer .= '</table>';
+			// if scalar
+			} else {
+				$buffer .= "<input type='text' name='parameters[$name]'>";
+			}
+		} else {
+			$buffer .= "<input type='text' name='parameters[$name]'>";
+		}
+		return $buffer;
+	}
+	
+	/**
+	* adds a complex type to the schema
+	* 
+	* example: array
+	* 
+	* addType(
+	* 	'ArrayOfstring',
+	* 	'complexType',
+	* 	'array',
+	* 	'',
+	* 	'SOAP-ENC:Array',
+	* 	array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'),
+	* 	'xsd:string'
+	* );
+	* 
+	* example: PHP associative array ( SOAP Struct )
+	* 
+	* addType(
+	* 	'SOAPStruct',
+	* 	'complexType',
+	* 	'struct',
+	* 	'all',
+	* 	array('myVar'=> array('name'=>'myVar','type'=>'string')
+	* );
+	* 
+	* @param name
+	* @param typeClass (complexType|simpleType|attribute)
+	* @param phpType: currently supported are array and struct (php assoc array)
+	* @param compositor (all|sequence|choice)
+	* @param restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
+	* @param elements = array ( name = array(name=>'',type=>'') )
+	* @param attrs = array(
+	* 	array(
+	*		'ref' => "http://schemas.xmlsoap.org/soap/encoding/:arrayType",
+	*		"http://schemas.xmlsoap.org/wsdl/:arrayType" => "string[]"
+	* 	)
+	* )
+	* @param arrayType: namespace:name (http://www.w3.org/2001/XMLSchema:string)
+	* @access public
+	* @see getTypeDef
+	*/
+	function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType=''){
+		$this->complexTypes[$name] = array(
+	    'name'		=> $name,
+	    'typeClass'	=> $typeClass,
+	    'phpType'	=> $phpType,
+		'compositor'=> $compositor,
+	    'restrictionBase' => $restrictionBase,
+		'elements'	=> $elements,
+	    'attrs'		=> $attrs,
+	    'arrayType'	=> $arrayType
+		);
+		
+		$this->xdebug("addComplexType $name:");
+		$this->appendDebug($this->varDump($this->complexTypes[$name]));
+	}
+	
+	/**
+	* adds a simple type to the schema
+	*
+	* @param string $name
+	* @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
+	* @param string $typeClass (should always be simpleType)
+	* @param string $phpType (should always be scalar)
+	* @param array $enumeration array of values
+	* @access public
+	* @see xmlschema
+	* @see getTypeDef
+	*/
+	function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) {
+		$this->simpleTypes[$name] = array(
+	    'name'			=> $name,
+	    'typeClass'		=> $typeClass,
+	    'phpType'		=> $phpType,
+	    'type'			=> $restrictionBase,
+	    'enumeration'	=> $enumeration
+		);
+		
+		$this->xdebug("addSimpleType $name:");
+		$this->appendDebug($this->varDump($this->simpleTypes[$name]));
+	}
+
+	/**
+	* adds an element to the schema
+	*
+	* @param array $attrs attributes that must include name and type
+	* @see xmlschema
+	* @access public
+	*/
+	function addElement($attrs) {
+		if (! $this->getPrefix($attrs['type'])) {
+			$attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type'];
+		}
+		$this->elements[ $attrs['name'] ] = $attrs;
+		$this->elements[ $attrs['name'] ]['typeClass'] = 'element';
+		
+		$this->xdebug("addElement " . $attrs['name']);
+		$this->appendDebug($this->varDump($this->elements[ $attrs['name'] ]));
+	}
+}
+
+
+
+?><?php
+
+
+
+/**
+* For creating serializable abstractions of native PHP types.  This class
+* allows element name/namespace, XSD type, and XML attributes to be
+* associated with a value.  This is extremely useful when WSDL is not
+* used, but is also useful when WSDL is used with polymorphic types, including
+* xsd:anyType and user-defined types.
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class soapval extends nusoap_base {
+	/**
+	 * The XML element name
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $name;
+	/**
+	 * The XML type name (string or false)
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $type;
+	/**
+	 * The PHP value
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $value;
+	/**
+	 * The XML element namespace (string or false)
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $element_ns;
+	/**
+	 * The XML type namespace (string or false)
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $type_ns;
+	/**
+	 * The XML element attributes (array or false)
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $attributes;
+
+	/**
+	* constructor
+	*
+	* @param    string $name optional name
+	* @param    mixed $type optional type name
+	* @param	mixed $value optional value
+	* @param	mixed $element_ns optional namespace of value
+	* @param	mixed $type_ns optional namespace of type
+	* @param	mixed $attributes associative array of attributes to add to element serialization
+	* @access   public
+	*/
+  	function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
+		parent::nusoap_base();
+		$this->name = $name;
+		$this->type = $type;
+		$this->value = $value;
+		$this->element_ns = $element_ns;
+		$this->type_ns = $type_ns;
+		$this->attributes = $attributes;
+    }
+
+	/**
+	* return serialized value
+	*
+	* @param	string $use The WSDL use value (encoded|literal)
+	* @return	string XML data
+	* @access   public
+	*/
+	function serialize($use='encoded') {
+		return $this->serialize_val($this->value,$this->name,$this->type,$this->element_ns,$this->type_ns,$this->attributes,$use);
+    }
+
+	/**
+	* decodes a soapval object into a PHP native type
+	*
+	* @return	mixed
+	* @access   public
+	*/
+	function decode(){
+		return $this->value;
+	}
+}
+
+
+
+?><?php
+
+
+
+/**
+* transport class for sending/receiving data via HTTP and HTTPS
+* NOTE: PHP must be compiled with the CURL extension for HTTPS support
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access public
+*/
+class soap_transport_http extends nusoap_base {
+
+	var $url = '';
+	var $uri = '';
+	var $digest_uri = '';
+	var $scheme = '';
+	var $host = '';
+	var $port = '';
+	var $path = '';
+	var $request_method = 'POST';
+	var $protocol_version = '1.0';
+	var $encoding = '';
+	var $outgoing_headers = array();
+	var $incoming_headers = array();
+	var $incoming_cookies = array();
+	var $outgoing_payload = '';
+	var $incoming_payload = '';
+	var $useSOAPAction = true;
+	var $persistentConnection = false;
+	var $ch = false;	// cURL handle
+	var $username = '';
+	var $password = '';
+	var $authtype = '';
+	var $digestRequest = array();
+	var $certRequest = array();	// keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional)
+								// cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem'
+								// sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem'
+								// sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem'
+								// passphrase: SSL key password/passphrase
+								// verifypeer: default is 1
+								// verifyhost: default is 1
+
+	/**
+	* constructor
+	*/
+	function soap_transport_http($url){
+		parent::nusoap_base();
+		$this->setURL($url);
+		ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+		$this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
+		$this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']);
+	}
+
+	function setURL($url) {
+		$this->url = $url;
+
+		$u = parse_url($url);
+		foreach($u as $k => $v){
+			$this->debug("$k = $v");
+			$this->$k = $v;
+		}
+		
+		// add any GET params to path
+		if(isset($u['query']) && $u['query'] != ''){
+            $this->path .= '?' . $u['query'];
+		}
+		
+		// set default port
+		if(!isset($u['port'])){
+			if($u['scheme'] == 'https'){
+				$this->port = 443;
+			} else {
+				$this->port = 80;
+			}
+		}
+		
+		$this->uri = $this->path;
+		$this->digest_uri = $this->uri;
+		
+		// build headers
+		if (!isset($u['port'])) {
+			$this->outgoing_headers['Host'] = $this->host;
+		} else {
+			$this->outgoing_headers['Host'] = $this->host.':'.$this->port;
+		}
+		$this->debug('set Host: ' . $this->outgoing_headers['Host']);
+
+		if (isset($u['user']) && $u['user'] != '') {
+			$this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : '');
+		}
+	}
+	
+	function connect($connection_timeout=0,$response_timeout=30){
+	  	// For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like
+	  	// "regular" socket.
+	  	// TODO: disabled for now because OpenSSL must be *compiled* in (not just
+	  	//       loaded), and until PHP5 stream_get_wrappers is not available.
+//	  	if ($this->scheme == 'https') {
+//		  	if (version_compare(phpversion(), '4.3.0') >= 0) {
+//		  		if (extension_loaded('openssl')) {
+//		  			$this->scheme = 'ssl';
+//		  			$this->debug('Using SSL over OpenSSL');
+//		  		}
+//		  	}
+//		}
+		$this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port");
+	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
+		// use persistent connection
+		if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){
+			if (!feof($this->fp)) {
+				$this->debug('Re-use persistent connection');
+				return true;
+			}
+			fclose($this->fp);
+			$this->debug('Closed persistent connection at EOF');
+		}
+
+		// munge host if using OpenSSL
+		if ($this->scheme == 'ssl') {
+			$host = 'ssl://' . $this->host;
+		} else {
+			$host = $this->host;
+		}
+		$this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout);
+
+		// open socket
+		if($connection_timeout > 0){
+			$this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout);
+		} else {
+			$this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str);
+		}
+		
+		// test pointer
+		if(!$this->fp) {
+			$msg = 'Couldn\'t open socket connection to server ' . $this->url;
+			if ($this->errno) {
+				$msg .= ', Error ('.$this->errno.'): '.$this->error_str;
+			} else {
+				$msg .= ' prior to connect().  This is often a problem looking up the host name.';
+			}
+			$this->debug($msg);
+			$this->setError($msg);
+			return false;
+		}
+		
+		// set response timeout
+		$this->debug('set response timeout to ' . $response_timeout);
+		socket_set_timeout( $this->fp, $response_timeout);
+
+		$this->debug('socket connected');
+		return true;
+	  } else if ($this->scheme == 'https') {
+		if (!extension_loaded('curl')) {
+			$this->setError('CURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS');
+			return false;
+		}
+		$this->debug('connect using https');
+		// init CURL
+		$this->ch = curl_init();
+		// set url
+		$hostURL = ($this->port != '') ? "https://$this->host:$this->port" : "https://$this->host";
+		// add path
+		$hostURL .= $this->path;
+		curl_setopt($this->ch, CURLOPT_URL, $hostURL);
+		// follow location headers (re-directs)
+		curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
+		// ask for headers in the response output
+		curl_setopt($this->ch, CURLOPT_HEADER, 1);
+		// ask for the response output as the return value
+		curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
+		// encode
+		// We manage this ourselves through headers and encoding
+//		if(function_exists('gzuncompress')){
+//			curl_setopt($this->ch, CURLOPT_ENCODING, 'deflate');
+//		}
+		// persistent connection
+		if ($this->persistentConnection) {
+			// The way we send data, we cannot use persistent connections, since
+			// there will be some "junk" at the end of our request.
+			//curl_setopt($this->ch, CURL_HTTP_VERSION_1_1, true);
+			$this->persistentConnection = false;
+			$this->outgoing_headers['Connection'] = 'close';
+			$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
+		}
+		// set timeout
+		if ($connection_timeout != 0) {
+			curl_setopt($this->ch, CURLOPT_TIMEOUT, $connection_timeout);
+		}
+		// TODO: cURL has added a connection timeout separate from the response timeout
+		//if ($connection_timeout != 0) {
+		//	curl_setopt($this->ch, CURLOPT_CONNECTIONTIMEOUT, $connection_timeout);
+		//}
+		//if ($response_timeout != 0) {
+		//	curl_setopt($this->ch, CURLOPT_TIMEOUT, $response_timeout);
+		//}
+
+		// recent versions of cURL turn on peer/host checking by default,
+		// while PHP binaries are not compiled with a default location for the
+		// CA cert bundle, so disable peer/host checking.
+//curl_setopt($this->ch, CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt');		
+		curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
+		curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
+
+		// support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo)
+		if ($this->authtype == 'certificate') {
+			if (isset($this->certRequest['cainfofile'])) {
+				curl_setopt($this->ch, CURLOPT_CAINFO, $this->certRequest['cainfofile']);
+			}
+			if (isset($this->certRequest['verifypeer'])) {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']);
+			} else {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 1);
+			}
+			if (isset($this->certRequest['verifyhost'])) {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']);
+			} else {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 1);
+			}
+			if (isset($this->certRequest['sslcertfile'])) {
+				curl_setopt($this->ch, CURLOPT_SSLCERT, $this->certRequest['sslcertfile']);
+			}
+			if (isset($this->certRequest['sslkeyfile'])) {
+				curl_setopt($this->ch, CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']);
+			}
+			if (isset($this->certRequest['passphrase'])) {
+				curl_setopt($this->ch, CURLOPT_SSLKEYPASSWD , $this->certRequest['passphrase']);
+			}
+		}
+		$this->debug('cURL connection set up');
+		return true;
+	  } else {
+		$this->setError('Unknown scheme ' . $this->scheme);
+		$this->debug('Unknown scheme ' . $this->scheme);
+		return false;
+	  }
+	}
+	
+	/**
+	* send the SOAP message via HTTP
+	*
+	* @param    string $data message data
+	* @param    integer $timeout set connection timeout in seconds
+	* @param	integer $response_timeout set response timeout in seconds
+	* @param	array $cookies cookies to send
+	* @return	string data
+	* @access   public
+	*/
+	function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) {
+		
+		$this->debug('entered send() with data of length: '.strlen($data));
+
+		$this->tryagain = true;
+		$tries = 0;
+		while ($this->tryagain) {
+			$this->tryagain = false;
+			if ($tries++ < 2) {
+				// make connnection
+				if (!$this->connect($timeout, $response_timeout)){
+					return false;
+				}
+				
+				// send request
+				if (!$this->sendRequest($data, $cookies)){
+					return false;
+				}
+				
+				// get response
+				$respdata = $this->getResponse();
+			} else {
+				$this->setError('Too many tries to get an OK response');
+			}
+		}		
+		$this->debug('end of send()');
+		return $respdata;
+	}
+
+
+	/**
+	* send the SOAP message via HTTPS 1.0 using CURL
+	*
+	* @param    string $msg message data
+	* @param    integer $timeout set connection timeout in seconds
+	* @param	integer $response_timeout set response timeout in seconds
+	* @param	array $cookies cookies to send
+	* @return	string data
+	* @access   public
+	*/
+	function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) {
+		return $this->send($data, $timeout, $response_timeout, $cookies);
+	}
+	
+	/**
+	* if authenticating, set user credentials here
+	*
+	* @param    string $username
+	* @param    string $password
+	* @param	string $authtype (basic, digest, certificate)
+	* @param	array $digestRequest (keys must be nonce, nc, realm, qop)
+	* @param	array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)
+	* @access   public
+	*/
+	function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) {
+		$this->debug("Set credentials for authtype $authtype");
+		// cf. RFC 2617
+		if ($authtype == 'basic') {
+			$this->outgoing_headers['Authorization'] = 'Basic '.base64_encode(str_replace(':','',$username).':'.$password);
+		} elseif ($authtype == 'digest') {
+			if (isset($digestRequest['nonce'])) {
+				$digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1;
+				
+				// calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html)
+	
+				// A1 = unq(username-value) ":" unq(realm-value) ":" passwd
+				$A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password;
+	
+				// H(A1) = MD5(A1)
+				$HA1 = md5($A1);
+	
+				// A2 = Method ":" digest-uri-value
+				$A2 = 'POST:' . $this->digest_uri;
+	
+				// H(A2)
+				$HA2 =  md5($A2);
+	
+				// KD(secret, data) = H(concat(secret, ":", data))
+				// if qop == auth:
+				// request-digest  = <"> < KD ( H(A1),     unq(nonce-value)
+				//                              ":" nc-value
+				//                              ":" unq(cnonce-value)
+				//                              ":" unq(qop-value)
+				//                              ":" H(A2)
+				//                            ) <">
+				// if qop is missing,
+				// request-digest  = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <">
+	
+				$unhashedDigest = '';
+				$nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : '';
+				$cnonce = $nonce;
+				if ($digestRequest['qop'] != '') {
+					$unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2;
+				} else {
+					$unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2;
+				}
+	
+				$hashedDigest = md5($unhashedDigest);
+	
+				$this->outgoing_headers['Authorization'] = 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"';
+			}
+		} elseif ($authtype == 'certificate') {
+			$this->certRequest = $certRequest;
+		}
+		$this->username = $username;
+		$this->password = $password;
+		$this->authtype = $authtype;
+		$this->digestRequest = $digestRequest;
+		
+		if (isset($this->outgoing_headers['Authorization'])) {
+			$this->debug('set Authorization: ' . substr($this->outgoing_headers['Authorization'], 0, 12) . '...');
+		} else {
+			$this->debug('Authorization header not set');
+		}
+	}
+	
+	/**
+	* set the soapaction value
+	*
+	* @param    string $soapaction
+	* @access   public
+	*/
+	function setSOAPAction($soapaction) {
+		$this->outgoing_headers['SOAPAction'] = '"' . $soapaction . '"';
+		$this->debug('set SOAPAction: ' . $this->outgoing_headers['SOAPAction']);
+	}
+	
+	/**
+	* use http encoding
+	*
+	* @param    string $enc encoding style. supported values: gzip, deflate, or both
+	* @access   public
+	*/
+	function setEncoding($enc='gzip, deflate') {
+		if (function_exists('gzdeflate')) {
+			$this->protocol_version = '1.1';
+			$this->outgoing_headers['Accept-Encoding'] = $enc;
+			$this->debug('set Accept-Encoding: ' . $this->outgoing_headers['Accept-Encoding']);
+			if (!isset($this->outgoing_headers['Connection'])) {
+				$this->outgoing_headers['Connection'] = 'close';
+				$this->persistentConnection = false;
+				$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
+			}
+			set_magic_quotes_runtime(0);
+			// deprecated
+			$this->encoding = $enc;
+		}
+	}
+	
+	/**
+	* set proxy info here
+	*
+	* @param    string $proxyhost
+	* @param    string $proxyport
+	* @param	string $proxyusername
+	* @param	string $proxypassword
+	* @access   public
+	*/
+	function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') {
+		$this->uri = $this->url;
+		$this->host = $proxyhost;
+		$this->port = $proxyport;
+		if ($proxyusername != '' && $proxypassword != '') {
+			$this->outgoing_headers['Proxy-Authorization'] = ' Basic '.base64_encode($proxyusername.':'.$proxypassword);
+			$this->debug('set Proxy-Authorization: ' . $this->outgoing_headers['Proxy-Authorization']);
+		}
+	}
+	
+	/**
+	* decode a string that is encoded w/ "chunked' transfer encoding
+ 	* as defined in RFC2068 19.4.6
+	*
+	* @param    string $buffer
+	* @param    string $lb
+	* @returns	string
+	* @access   public
+	* @deprecated
+	*/
+	function decodeChunked($buffer, $lb){
+		// length := 0
+		$length = 0;
+		$new = '';
+		
+		// read chunk-size, chunk-extension (if any) and CRLF
+		// get the position of the linebreak
+		$chunkend = strpos($buffer, $lb);
+		if ($chunkend == FALSE) {
+			$this->debug('no linebreak found in decodeChunked');
+			return $new;
+		}
+		$temp = substr($buffer,0,$chunkend);
+		$chunk_size = hexdec( trim($temp) );
+		$chunkstart = $chunkend + strlen($lb);
+		// while (chunk-size > 0) {
+		while ($chunk_size > 0) {
+			$this->debug("chunkstart: $chunkstart chunk_size: $chunk_size");
+			$chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size);
+		  	
+			// Just in case we got a broken connection
+		  	if ($chunkend == FALSE) {
+		  	    $chunk = substr($buffer,$chunkstart);
+				// append chunk-data to entity-body
+		    	$new .= $chunk;
+		  	    $length += strlen($chunk);
+		  	    break;
+			}
+			
+		  	// read chunk-data and CRLF
+		  	$chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart);
+		  	// append chunk-data to entity-body
+		  	$new .= $chunk;
+		  	// length := length + chunk-size
+		  	$length += strlen($chunk);
+		  	// read chunk-size and CRLF
+		  	$chunkstart = $chunkend + strlen($lb);
+			
+		  	$chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb);
+			if ($chunkend == FALSE) {
+				break; //Just in case we got a broken connection
+			}
+			$temp = substr($buffer,$chunkstart,$chunkend-$chunkstart);
+			$chunk_size = hexdec( trim($temp) );
+			$chunkstart = $chunkend;
+		}
+		return $new;
+	}
+	
+	/*
+	 *	Writes payload, including HTTP headers, to $this->outgoing_payload.
+	 */
+	function buildPayload($data, $cookie_str = '') {
+		// add content-length header
+		$this->outgoing_headers['Content-Length'] = strlen($data);
+		$this->debug('set Content-Length: ' . $this->outgoing_headers['Content-Length']);
+
+		// start building outgoing payload:
+		$req = "$this->request_method $this->uri HTTP/$this->protocol_version";
+		$this->debug("HTTP request: $req");
+		$this->outgoing_payload = "$req\r\n";
+
+		// loop thru headers, serializing
+		foreach($this->outgoing_headers as $k => $v){
+			$hdr = $k.': '.$v;
+			$this->debug("HTTP header: $hdr");
+			$this->outgoing_payload .= "$hdr\r\n";
+		}
+
+		// add any cookies
+		if ($cookie_str != '') {
+			$hdr = 'Cookie: '.$cookie_str;
+			$this->debug("HTTP header: $hdr");
+			$this->outgoing_payload .= "$hdr\r\n";
+		}
+
+		// header/body separator
+		$this->outgoing_payload .= "\r\n";
+		
+		// add data
+		$this->outgoing_payload .= $data;
+	}
+
+	function sendRequest($data, $cookies = NULL) {
+		// build cookie string
+		$cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https')));
+
+		// build payload
+		$this->buildPayload($data, $cookie_str);
+
+	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
+		// send payload
+		if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) {
+			$this->setError('couldn\'t write message data to socket');
+			$this->debug('couldn\'t write message data to socket');
+			return false;
+		}
+		$this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload));
+		return true;
+	  } else if ($this->scheme == 'https') {
+		// set payload
+		// TODO: cURL does say this should only be the verb, and in fact it
+		// turns out that the URI and HTTP version are appended to this, which
+		// some servers refuse to work with
+		//curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $this->outgoing_payload);
+		foreach($this->outgoing_headers as $k => $v){
+			$curl_headers[] = "$k: $v";
+		}
+		if ($cookie_str != '') {
+			$curl_headers[] = 'Cookie: ' . $cookie_str;
+		}
+		curl_setopt($this->ch, CURLOPT_HTTPHEADER, $curl_headers);
+		if ($this->request_method == "POST") {
+	  		curl_setopt($this->ch, CURLOPT_POST, 1);
+	  		curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data);
+	  	} else {
+	  	}
+		$this->debug('set cURL payload');
+		return true;
+	  }
+	}
+
+	function getResponse(){
+		$this->incoming_payload = '';
+	    
+	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
+	    // loop until headers have been retrieved
+	    $data = '';
+	    while (!isset($lb)){
+
+			// We might EOF during header read.
+			if(feof($this->fp)) {
+				$this->incoming_payload = $data;
+				$this->debug('found no headers before EOF after length ' . strlen($data));
+				$this->debug("received before EOF:\n" . $data);
+				$this->setError('server failed to send headers');
+				return false;
+			}
+
+			$tmp = fgets($this->fp, 256);
+			$tmplen = strlen($tmp);
+			$this->debug("read line of $tmplen bytes: " . trim($tmp));
+
+			if ($tmplen == 0) {
+				$this->incoming_payload = $data;
+				$this->debug('socket read of headers timed out after length ' . strlen($data));
+				$this->debug("read before timeout: " . $data);
+				$this->setError('socket read of headers timed out');
+				return false;
+			}
+
+			$data .= $tmp;
+			$pos = strpos($data,"\r\n\r\n");
+			if($pos > 1){
+				$lb = "\r\n";
+			} else {
+				$pos = strpos($data,"\n\n");
+				if($pos > 1){
+					$lb = "\n";
+				}
+			}
+			// remove 100 header
+			if(isset($lb) && ereg('^HTTP/1.1 100',$data)){
+				unset($lb);
+				$data = '';
+			}//
+		}
+		// store header data
+		$this->incoming_payload .= $data;
+		$this->debug('found end of headers after length ' . strlen($data));
+		// process headers
+		$header_data = trim(substr($data,0,$pos));
+		$header_array = explode($lb,$header_data);
+		$this->incoming_headers = array();
+		$this->incoming_cookies = array();
+		foreach($header_array as $header_line){
+			$arr = explode(':',$header_line, 2);
+			if(count($arr) > 1){
+				$header_name = strtolower(trim($arr[0]));
+				$this->incoming_headers[$header_name] = trim($arr[1]);
+				if ($header_name == 'set-cookie') {
+					// TODO: allow multiple cookies from parseCookie
+					$cookie = $this->parseCookie(trim($arr[1]));
+					if ($cookie) {
+						$this->incoming_cookies[] = $cookie;
+						$this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
+					} else {
+						$this->debug('did not find cookie in ' . trim($arr[1]));
+					}
+    			}
+			} else if (isset($header_name)) {
+				// append continuation line to previous header
+				$this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
+			}
+		}
+		
+		// loop until msg has been received
+		if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') {
+			$content_length =  2147483647;	// ignore any content-length header
+			$chunked = true;
+			$this->debug("want to read chunked content");
+		} elseif (isset($this->incoming_headers['content-length'])) {
+			$content_length = $this->incoming_headers['content-length'];
+			$chunked = false;
+			$this->debug("want to read content of length $content_length");
+		} else {
+			$content_length =  2147483647;
+			$chunked = false;
+			$this->debug("want to read content to EOF");
+		}
+		$data = '';
+		do {
+			if ($chunked) {
+				$tmp = fgets($this->fp, 256);
+				$tmplen = strlen($tmp);
+				$this->debug("read chunk line of $tmplen bytes");
+				if ($tmplen == 0) {
+					$this->incoming_payload = $data;
+					$this->debug('socket read of chunk length timed out after length ' . strlen($data));
+					$this->debug("read before timeout:\n" . $data);
+					$this->setError('socket read of chunk length timed out');
+					return false;
+				}
+				$content_length = hexdec(trim($tmp));
+				$this->debug("chunk length $content_length");
+			}
+			$strlen = 0;
+		    while (($strlen < $content_length) && (!feof($this->fp))) {
+		    	$readlen = min(8192, $content_length - $strlen);
+				$tmp = fread($this->fp, $readlen);
+				$tmplen = strlen($tmp);
+				$this->debug("read buffer of $tmplen bytes");
+				if (($tmplen == 0) && (!feof($this->fp))) {
+					$this->incoming_payload = $data;
+					$this->debug('socket read of body timed out after length ' . strlen($data));
+					$this->debug("read before timeout:\n" . $data);
+					$this->setError('socket read of body timed out');
+					return false;
+				}
+				$strlen += $tmplen;
+				$data .= $tmp;
+			}
+			if ($chunked && ($content_length > 0)) {
+				$tmp = fgets($this->fp, 256);
+				$tmplen = strlen($tmp);
+				$this->debug("read chunk terminator of $tmplen bytes");
+				if ($tmplen == 0) {
+					$this->incoming_payload = $data;
+					$this->debug('socket read of chunk terminator timed out after length ' . strlen($data));
+					$this->debug("read before timeout:\n" . $data);
+					$this->setError('socket read of chunk terminator timed out');
+					return false;
+				}
+			}
+		} while ($chunked && ($content_length > 0) && (!feof($this->fp)));
+		if (feof($this->fp)) {
+			$this->debug('read to EOF');
+		}
+		$this->debug('read body of length ' . strlen($data));
+		$this->incoming_payload .= $data;
+		$this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server');
+		
+		// close filepointer
+		if(
+			(isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || 
+			(! $this->persistentConnection) || feof($this->fp)){
+			fclose($this->fp);
+			$this->fp = false;
+			$this->debug('closed socket');
+		}
+		
+		// connection was closed unexpectedly
+		if($this->incoming_payload == ''){
+			$this->setError('no response from server');
+			return false;
+		}
+		
+		// decode transfer-encoding
+//		if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){
+//			if(!$data = $this->decodeChunked($data, $lb)){
+//				$this->setError('Decoding of chunked data failed');
+//				return false;
+//			}
+			//print "<pre>\nde-chunked:\n---------------\n$data\n\n---------------\n</pre>";
+			// set decoded payload
+//			$this->incoming_payload = $header_data.$lb.$lb.$data;
+//		}
+	
+	  } else if ($this->scheme == 'https') {
+		// send and receive
+		$this->debug('send and receive with cURL');
+		$this->incoming_payload = curl_exec($this->ch);
+		$data = $this->incoming_payload;
+
+        $cErr = curl_error($this->ch);
+		if ($cErr != '') {
+        	$err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'<br>';
+        	// TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE
+			foreach(curl_getinfo($this->ch) as $k => $v){
+				$err .= "$k: $v<br>";
+			}
+			$this->debug($err);
+			$this->setError($err);
+			curl_close($this->ch);
+	    	return false;
+		} else {
+			//echo '<pre>';
+			//var_dump(curl_getinfo($this->ch));
+			//echo '</pre>';
+		}
+		// close curl
+		$this->debug('No cURL error, closing cURL');
+		curl_close($this->ch);
+		
+		// remove 100 header(s)
+		while (ereg('^HTTP/1.1 100',$data)) {
+			if ($pos = strpos($data,"\r\n\r\n")) {
+				$data = ltrim(substr($data,$pos));
+			} elseif($pos = strpos($data,"\n\n") ) {
+				$data = ltrim(substr($data,$pos));
+			}
+		}
+		
+		// separate content from HTTP headers
+		if ($pos = strpos($data,"\r\n\r\n")) {
+			$lb = "\r\n";
+		} elseif( $pos = strpos($data,"\n\n")) {
+			$lb = "\n";
+		} else {
+			$this->debug('no proper separation of headers and document');
+			$this->setError('no proper separation of headers and document');
+			return false;
+		}
+		$header_data = trim(substr($data,0,$pos));
+		$header_array = explode($lb,$header_data);
+		$data = ltrim(substr($data,$pos));
+		$this->debug('found proper separation of headers and document');
+		$this->debug('cleaned data, stringlen: '.strlen($data));
+		// clean headers
+		foreach ($header_array as $header_line) {
+			$arr = explode(':',$header_line,2);
+			if(count($arr) > 1){
+				$header_name = strtolower(trim($arr[0]));
+				$this->incoming_headers[$header_name] = trim($arr[1]);
+				if ($header_name == 'set-cookie') {
+					// TODO: allow multiple cookies from parseCookie
+					$cookie = $this->parseCookie(trim($arr[1]));
+					if ($cookie) {
+						$this->incoming_cookies[] = $cookie;
+						$this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
+					} else {
+						$this->debug('did not find cookie in ' . trim($arr[1]));
+					}
+    			}
+			} else if (isset($header_name)) {
+				// append continuation line to previous header
+				$this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
+			}
+		}
+	  }
+
+		$arr = explode(' ', $header_array[0], 3);
+		$http_version = $arr[0];
+		$http_status = intval($arr[1]);
+		$http_reason = count($arr) > 2 ? $arr[2] : '';
+
+ 		// see if we need to resend the request with http digest authentication
+ 		if (isset($this->incoming_headers['location']) && $http_status == 301) {
+ 			$this->debug("Got 301 $http_reason with Location: " . $this->incoming_headers['location']);
+ 			$this->setURL($this->incoming_headers['location']);
+			$this->tryagain = true;
+			return false;
+		}
+
+ 		// see if we need to resend the request with http digest authentication
+ 		if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) {
+ 			$this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']);
+ 			if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) {
+ 				$this->debug('Server wants digest authentication');
+ 				// remove "Digest " from our elements
+ 				$digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']);
+ 				
+ 				// parse elements into array
+ 				$digestElements = explode(',', $digestString);
+ 				foreach ($digestElements as $val) {
+ 					$tempElement = explode('=', trim($val), 2);
+ 					$digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]);
+ 				}
+
+				// should have (at least) qop, realm, nonce
+ 				if (isset($digestRequest['nonce'])) {
+ 					$this->setCredentials($this->username, $this->password, 'digest', $digestRequest);
+ 					$this->tryagain = true;
+ 					return false;
+ 				}
+ 			}
+			$this->debug('HTTP authentication failed');
+			$this->setError('HTTP authentication failed');
+			return false;
+ 		}
+		
+		if (
+			($http_status >= 300 && $http_status <= 307) ||
+			($http_status >= 400 && $http_status <= 417) ||
+			($http_status >= 501 && $http_status <= 505)
+		   ) {
+			$this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient->response has contents of the response)");
+			return false;
+		}
+
+		// decode content-encoding
+		if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){
+			if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){
+    			// if decoding works, use it. else assume data wasn't gzencoded
+    			if(function_exists('gzinflate')){
+					//$timer->setMarker('starting decoding of gzip/deflated content');
+					// IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress)
+					// this means there are no Zlib headers, although there should be
+					$this->debug('The gzinflate function exists');
+					$datalen = strlen($data);
+					if ($this->incoming_headers['content-encoding'] == 'deflate') {
+						if ($degzdata = @gzinflate($data)) {
+	    					$data = $degzdata;
+	    					$this->debug('The payload has been inflated to ' . strlen($data) . ' bytes');
+	    					if (strlen($data) < $datalen) {
+	    						// test for the case that the payload has been compressed twice
+		    					$this->debug('The inflated payload is smaller than the gzipped one; try again');
+								if ($degzdata = @gzinflate($data)) {
+			    					$data = $degzdata;
+			    					$this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes');
+								}
+	    					}
+	    				} else {
+	    					$this->debug('Error using gzinflate to inflate the payload');
+	    					$this->setError('Error using gzinflate to inflate the payload');
+	    				}
+					} elseif ($this->incoming_headers['content-encoding'] == 'gzip') {
+						if ($degzdata = @gzinflate(substr($data, 10))) {	// do our best
+							$data = $degzdata;
+	    					$this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes');
+	    					if (strlen($data) < $datalen) {
+	    						// test for the case that the payload has been compressed twice
+		    					$this->debug('The un-gzipped payload is smaller than the gzipped one; try again');
+								if ($degzdata = @gzinflate(substr($data, 10))) {
+			    					$data = $degzdata;
+			    					$this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes');
+								}
+	    					}
+	    				} else {
+	    					$this->debug('Error using gzinflate to un-gzip the payload');
+							$this->setError('Error using gzinflate to un-gzip the payload');
+	    				}
+					}
+					//$timer->setMarker('finished decoding of gzip/deflated content');
+					//print "<xmp>\nde-inflated:\n---------------\n$data\n-------------\n</xmp>";
+					// set decoded payload
+					$this->incoming_payload = $header_data.$lb.$lb.$data;
+    			} else {
+					$this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
+					$this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
+				}
+			} else {
+				$this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
+				$this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
+			}
+		} else {
+			$this->debug('No Content-Encoding header');
+		}
+		
+		if(strlen($data) == 0){
+			$this->debug('no data after headers!');
+			$this->setError('no data present after HTTP headers');
+			return false;
+		}
+		
+		return $data;
+	}
+
+	function setContentType($type, $charset = false) {
+		$this->outgoing_headers['Content-Type'] = $type . ($charset ? '; charset=' . $charset : '');
+		$this->debug('set Content-Type: ' . $this->outgoing_headers['Content-Type']);
+	}
+
+	function usePersistentConnection(){
+		if (isset($this->outgoing_headers['Accept-Encoding'])) {
+			return false;
+		}
+		$this->protocol_version = '1.1';
+		$this->persistentConnection = true;
+		$this->outgoing_headers['Connection'] = 'Keep-Alive';
+		$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
+		return true;
+	}
+
+	/**
+	 * parse an incoming Cookie into it's parts
+	 *
+	 * @param	string $cookie_str content of cookie
+	 * @return	array with data of that cookie
+	 * @access	private
+	 */
+	/*
+	 * TODO: allow a Set-Cookie string to be parsed into multiple cookies
+	 */
+	function parseCookie($cookie_str) {
+		$cookie_str = str_replace('; ', ';', $cookie_str) . ';';
+		$data = split(';', $cookie_str);
+		$value_str = $data[0];
+
+		$cookie_param = 'domain=';
+		$start = strpos($cookie_str, $cookie_param);
+		if ($start > 0) {
+			$domain = substr($cookie_str, $start + strlen($cookie_param));
+			$domain = substr($domain, 0, strpos($domain, ';'));
+		} else {
+			$domain = '';
+		}
+
+		$cookie_param = 'expires=';
+		$start = strpos($cookie_str, $cookie_param);
+		if ($start > 0) {
+			$expires = substr($cookie_str, $start + strlen($cookie_param));
+			$expires = substr($expires, 0, strpos($expires, ';'));
+		} else {
+			$expires = '';
+		}
+
+		$cookie_param = 'path=';
+		$start = strpos($cookie_str, $cookie_param);
+		if ( $start > 0 ) {
+			$path = substr($cookie_str, $start + strlen($cookie_param));
+			$path = substr($path, 0, strpos($path, ';'));
+		} else {
+			$path = '/';
+		}
+						
+		$cookie_param = ';secure;';
+		if (strpos($cookie_str, $cookie_param) !== FALSE) {
+			$secure = true;
+		} else {
+			$secure = false;
+		}
+
+		$sep_pos = strpos($value_str, '=');
+
+		if ($sep_pos) {
+			$name = substr($value_str, 0, $sep_pos);
+			$value = substr($value_str, $sep_pos + 1);
+			$cookie= array(	'name' => $name,
+			                'value' => $value,
+							'domain' => $domain,
+							'path' => $path,
+							'expires' => $expires,
+							'secure' => $secure
+							);		
+			return $cookie;
+		}
+		return false;
+	}
+  
+	/**
+	 * sort out cookies for the current request
+	 *
+	 * @param	array $cookies array with all cookies
+	 * @param	boolean $secure is the send-content secure or not?
+	 * @return	string for Cookie-HTTP-Header
+	 * @access	private
+	 */
+	function getCookiesForRequest($cookies, $secure=false) {
+		$cookie_str = '';
+		if ((! is_null($cookies)) && (is_array($cookies))) {
+			foreach ($cookies as $cookie) {
+				if (! is_array($cookie)) {
+					continue;
+				}
+	    		$this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']);
+				if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
+					if (strtotime($cookie['expires']) <= time()) {
+						$this->debug('cookie has expired');
+						continue;
+					}
+				}
+				if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) {
+					$domain = preg_quote($cookie['domain']);
+					if (! preg_match("'.*$domain$'i", $this->host)) {
+						$this->debug('cookie has different domain');
+						continue;
+					}
+				}
+				if ((isset($cookie['path'])) && (! empty($cookie['path']))) {
+					$path = preg_quote($cookie['path']);
+					if (! preg_match("'^$path.*'i", $this->path)) {
+						$this->debug('cookie is for a different path');
+						continue;
+					}
+				}
+				if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) {
+					$this->debug('cookie is secure, transport is not');
+					continue;
+				}
+				$cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; ';
+	    		$this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']);
+			}
+		}
+		return $cookie_str;
+  }
+}
+
+?><?php
+
+
+
+/**
+*
+* soap_server allows the user to create a SOAP server
+* that is capable of receiving messages and returning responses
+*
+* NOTE: WSDL functionality is experimental
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class soap_server extends nusoap_base {
+	/**
+	 * HTTP headers of request
+	 * @var array
+	 * @access private
+	 */
+	var $headers = array();
+	/**
+	 * HTTP request
+	 * @var string
+	 * @access private
+	 */
+	var $request = '';
+	/**
+	 * SOAP headers from request (incomplete namespace resolution; special characters not escaped) (text)
+	 * @var string
+	 * @access public
+	 */
+	var $requestHeaders = '';
+	/**
+	 * SOAP body request portion (incomplete namespace resolution; special characters not escaped) (text)
+	 * @var string
+	 * @access public
+	 */
+	var $document = '';
+	/**
+	 * SOAP payload for request (text)
+	 * @var string
+	 * @access public
+	 */
+	var $requestSOAP = '';
+	/**
+	 * requested method namespace URI
+	 * @var string
+	 * @access private
+	 */
+	var $methodURI = '';
+	/**
+	 * name of method requested
+	 * @var string
+	 * @access private
+	 */
+	var $methodname = '';
+	/**
+	 * method parameters from request
+	 * @var array
+	 * @access private
+	 */
+	var $methodparams = array();
+	/**
+	 * SOAP Action from request
+	 * @var string
+	 * @access private
+	 */
+	var $SOAPAction = '';
+	/**
+	 * character set encoding of incoming (request) messages
+	 * @var string
+	 * @access public
+	 */
+	var $xml_encoding = '';
+	/**
+	 * toggles whether the parser decodes element content w/ utf8_decode()
+	 * @var boolean
+	 * @access public
+	 */
+    var $decode_utf8 = true;
+
+	/**
+	 * HTTP headers of response
+	 * @var array
+	 * @access public
+	 */
+	var $outgoing_headers = array();
+	/**
+	 * HTTP response
+	 * @var string
+	 * @access private
+	 */
+	var $response = '';
+	/**
+	 * SOAP headers for response (text)
+	 * @var string
+	 * @access public
+	 */
+	var $responseHeaders = '';
+	/**
+	 * SOAP payload for response (text)
+	 * @var string
+	 * @access private
+	 */
+	var $responseSOAP = '';
+	/**
+	 * method return value to place in response
+	 * @var mixed
+	 * @access private
+	 */
+	var $methodreturn = false;
+	/**
+	 * whether $methodreturn is a string of literal XML
+	 * @var boolean
+	 * @access public
+	 */
+	var $methodreturnisliteralxml = false;
+	/**
+	 * SOAP fault for response (or false)
+	 * @var mixed
+	 * @access private
+	 */
+	var $fault = false;
+	/**
+	 * text indication of result (for debugging)
+	 * @var string
+	 * @access private
+	 */
+	var $result = 'successful';
+
+	/**
+	 * assoc array of operations => opData; operations are added by the register()
+	 * method or by parsing an external WSDL definition
+	 * @var array
+	 * @access private
+	 */
+	var $operations = array();
+	/**
+	 * wsdl instance (if one)
+	 * @var mixed
+	 * @access private
+	 */
+	var $wsdl = false;
+	/**
+	 * URL for WSDL (if one)
+	 * @var mixed
+	 * @access private
+	 */
+	var $externalWSDLURL = false;
+	/**
+	 * whether to append debug to response as XML comment
+	 * @var boolean
+	 * @access public
+	 */
+	var $debug_flag = false;
+
+
+	/**
+	* constructor
+    * the optional parameter is a path to a WSDL file that you'd like to bind the server instance to.
+	*
+    * @param mixed $wsdl file path or URL (string), or wsdl instance (object)
+	* @access   public
+	*/
+	function soap_server($wsdl=false){
+		parent::nusoap_base();
+		// turn on debugging?
+		global $debug;
+		global $HTTP_SERVER_VARS;
+
+		if (isset($_SERVER)) {
+			$this->debug("_SERVER is defined:");
+			$this->appendDebug($this->varDump($_SERVER));
+		} elseif (isset($HTTP_SERVER_VARS)) {
+			$this->debug("HTTP_SERVER_VARS is defined:");
+			$this->appendDebug($this->varDump($HTTP_SERVER_VARS));
+		} else {
+			$this->debug("Neither _SERVER nor HTTP_SERVER_VARS is defined.");
+		}
+
+		if (isset($debug)) {
+			$this->debug("In soap_server, set debug_flag=$debug based on global flag");
+			$this->debug_flag = $debug;
+		} elseif (isset($_SERVER['QUERY_STRING'])) {
+			$qs = explode('&', $_SERVER['QUERY_STRING']);
+			foreach ($qs as $v) {
+				if (substr($v, 0, 6) == 'debug=') {
+					$this->debug("In soap_server, set debug_flag=" . substr($v, 6) . " based on query string #1");
+					$this->debug_flag = substr($v, 6);
+				}
+			}
+		} elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
+			$qs = explode('&', $HTTP_SERVER_VARS['QUERY_STRING']);
+			foreach ($qs as $v) {
+				if (substr($v, 0, 6) == 'debug=') {
+					$this->debug("In soap_server, set debug_flag=" . substr($v, 6) . " based on query string #2");
+					$this->debug_flag = substr($v, 6);
+				}
+			}
+		}
+
+		// wsdl
+		if($wsdl){
+			$this->debug("In soap_server, WSDL is specified");
+			if (is_object($wsdl) && (get_class($wsdl) == 'wsdl')) {
+				$this->wsdl = $wsdl;
+				$this->externalWSDLURL = $this->wsdl->wsdl;
+				$this->debug('Use existing wsdl instance from ' . $this->externalWSDLURL);
+			} else {
+				$this->debug('Create wsdl from ' . $wsdl);
+				$this->wsdl = new wsdl($wsdl);
+				$this->externalWSDLURL = $wsdl;
+			}
+			$this->appendDebug($this->wsdl->getDebug());
+			$this->wsdl->clearDebug();
+			if($err = $this->wsdl->getError()){
+				die('WSDL ERROR: '.$err);
+			}
+		}
+	}
+
+	/**
+	* processes request and returns response
+	*
+	* @param    string $data usually is the value of $HTTP_RAW_POST_DATA
+	* @access   public
+	*/
+	function service($data){
+		global $HTTP_SERVER_VARS;
+
+		if (isset($_SERVER['QUERY_STRING'])) {
+			$qs = $_SERVER['QUERY_STRING'];
+		} elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
+			$qs = $HTTP_SERVER_VARS['QUERY_STRING'];
+		} else {
+			$qs = '';
+		}
+		$this->debug("In service, query string=$qs");
+
+		if (ereg('wsdl', $qs) ){
+			$this->debug("In service, this is a request for WSDL");
+			if($this->externalWSDLURL){
+              if (strpos($this->externalWSDLURL,"://")!==false) { // assume URL
+				header('Location: '.$this->externalWSDLURL);
+              } else { // assume file
+                header("Content-Type: text/xml\r\n");
+                $fp = fopen($this->externalWSDLURL, 'r');
+                fpassthru($fp);
+              }
+			} elseif ($this->wsdl) {
+				header("Content-Type: text/xml; charset=ISO-8859-1\r\n");
+				print $this->wsdl->serialize($this->debug_flag);
+				if ($this->debug_flag) {
+					$this->debug('wsdl:');
+					$this->appendDebug($this->varDump($this->wsdl));
+					print $this->getDebugAsXMLComment();
+				}
+			} else {
+				header("Content-Type: text/html; charset=ISO-8859-1\r\n");
+				print "This service does not provide WSDL";
+			}
+		} elseif ($data == '' && $this->wsdl) {
+			$this->debug("In service, there is no data, so return Web description");
+			print $this->wsdl->webDescription();
+		} else {
+			$this->debug("In service, invoke the request");
+			$this->parse_request($data);
+			if (! $this->fault) {
+				$this->invoke_method();
+			}
+			if (! $this->fault) {
+				$this->serialize_return();
+			}
+			$this->send_response();
+		}
+	}
+
+	/**
+	* parses HTTP request headers.
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* headers
+	* request
+	* xml_encoding
+	* SOAPAction
+	*
+	* @access   private
+	*/
+	function parse_http_headers() {
+		global $HTTP_SERVER_VARS;
+
+		$this->request = '';
+		$this->SOAPAction = '';
+		if(function_exists('getallheaders')){
+			$this->debug("In parse_http_headers, use getallheaders");
+			$headers = getallheaders();
+			foreach($headers as $k=>$v){
+				$k = strtolower($k);
+				$this->headers[$k] = $v;
+				$this->request .= "$k: $v\r\n";
+				$this->debug("$k: $v");
+			}
+			// get SOAPAction header
+			if(isset($this->headers['soapaction'])){
+				$this->SOAPAction = str_replace('"','',$this->headers['soapaction']);
+			}
+			// get the character encoding of the incoming request
+			if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
+				$enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1));
+				if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+					$this->xml_encoding = strtoupper($enc);
+				} else {
+					$this->xml_encoding = 'US-ASCII';
+				}
+			} else {
+				// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+				$this->xml_encoding = 'ISO-8859-1';
+			}
+		} elseif(isset($_SERVER) && is_array($_SERVER)){
+			$this->debug("In parse_http_headers, use _SERVER");
+			foreach ($_SERVER as $k => $v) {
+				if (substr($k, 0, 5) == 'HTTP_') {
+					$k = str_replace(' ', '-', strtolower(str_replace('_', ' ', substr($k, 5)))); 	                                         $k = strtolower(substr($k, 5));
+				} else {
+					$k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k))); 	                                         $k = strtolower($k);
+				}
+				if ($k == 'soapaction') {
+					// get SOAPAction header
+					$k = 'SOAPAction';
+					$v = str_replace('"', '', $v);
+					$v = str_replace('\\', '', $v);
+					$this->SOAPAction = $v;
+				} else if ($k == 'content-type') {
+					// get the character encoding of the incoming request
+					if (strpos($v, '=')) {
+						$enc = substr(strstr($v, '='), 1);
+						$enc = str_replace('"', '', $enc);
+						$enc = str_replace('\\', '', $enc);
+						if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+							$this->xml_encoding = strtoupper($enc);
+						} else {
+							$this->xml_encoding = 'US-ASCII';
+						}
+					} else {
+						// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+						$this->xml_encoding = 'ISO-8859-1';
+					}
+				}
+				$this->headers[$k] = $v;
+				$this->request .= "$k: $v\r\n";
+				$this->debug("$k: $v");
+			}
+		} elseif (is_array($HTTP_SERVER_VARS)) {
+			$this->debug("In parse_http_headers, use HTTP_SERVER_VARS");
+			foreach ($HTTP_SERVER_VARS as $k => $v) {
+				if (substr($k, 0, 5) == 'HTTP_') {
+					$k = str_replace(' ', '-', strtolower(str_replace('_', ' ', substr($k, 5)))); 	                                         $k = strtolower(substr($k, 5));
+				} else {
+					$k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k))); 	                                         $k = strtolower($k);
+				}
+				if ($k == 'soapaction') {
+					// get SOAPAction header
+					$k = 'SOAPAction';
+					$v = str_replace('"', '', $v);
+					$v = str_replace('\\', '', $v);
+					$this->SOAPAction = $v;
+				} else if ($k == 'content-type') {
+					// get the character encoding of the incoming request
+					if (strpos($v, '=')) {
+						$enc = substr(strstr($v, '='), 1);
+						$enc = str_replace('"', '', $enc);
+						$enc = str_replace('\\', '', $enc);
+						if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+							$this->xml_encoding = strtoupper($enc);
+						} else {
+							$this->xml_encoding = 'US-ASCII';
+						}
+					} else {
+						// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+						$this->xml_encoding = 'ISO-8859-1';
+					}
+				}
+				$this->headers[$k] = $v;
+				$this->request .= "$k: $v\r\n";
+				$this->debug("$k: $v");
+			}
+		} else {
+			$this->debug("In parse_http_headers, HTTP headers not accessible");
+			$this->setError("HTTP headers not accessible");
+		}
+	}
+
+	/**
+	* parses a request
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* headers
+	* request
+	* xml_encoding
+	* SOAPAction
+	* request
+	* requestSOAP
+	* methodURI
+	* methodname
+	* methodparams
+	* requestHeaders
+	* document
+	*
+	* This sets the fault field on error
+	*
+	* @param    string $data XML string
+	* @access   private
+	*/
+	function parse_request($data='') {
+		$this->debug('entering parse_request()');
+		$this->parse_http_headers();
+		$this->debug('got character encoding: '.$this->xml_encoding);
+		// uncompress if necessary
+		if (isset($this->headers['content-encoding']) && $this->headers['content-encoding'] != '') {
+			$this->debug('got content encoding: ' . $this->headers['content-encoding']);
+			if ($this->headers['content-encoding'] == 'deflate' || $this->headers['content-encoding'] == 'gzip') {
+		    	// if decoding works, use it. else assume data wasn't gzencoded
+				if (function_exists('gzuncompress')) {
+					if ($this->headers['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) {
+						$data = $degzdata;
+					} elseif ($this->headers['content-encoding'] == 'gzip' && $degzdata = gzinflate(substr($data, 10))) {
+						$data = $degzdata;
+					} else {
+						$this->fault('Client', 'Errors occurred when trying to decode the data');
+						return;
+					}
+				} else {
+					$this->fault('Client', 'This Server does not support compressed data');
+					return;
+				}
+			}
+		}
+		$this->request .= "\r\n".$data;
+		$data = $this->parseRequest($this->headers, $data);
+		$this->requestSOAP = $data;
+		$this->debug('leaving parse_request');
+	}
+
+	/**
+	* invokes a PHP function for the requested SOAP method
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* methodreturn
+	*
+	* Note that the PHP function that is called may also set the following
+	* fields to affect the response sent to the client
+	*
+	* responseHeaders
+	* outgoing_headers
+	*
+	* This sets the fault field on error
+	*
+	* @access   private
+	*/
+	function invoke_method() {
+		$this->debug('in invoke_method, methodname=' . $this->methodname . ' methodURI=' . $this->methodURI . ' SOAPAction=' . $this->SOAPAction);
+
+		if ($this->wsdl) {
+			if ($this->opData = $this->wsdl->getOperationData($this->methodname)) {
+				$this->debug('in invoke_method, found WSDL operation=' . $this->methodname);
+				$this->appendDebug('opData=' . $this->varDump($this->opData));
+			} elseif ($this->opData = $this->wsdl->getOperationDataForSoapAction($this->SOAPAction)) {
+				// Note: hopefully this case will only be used for doc/lit, since rpc services should have wrapper element
+				$this->debug('in invoke_method, found WSDL soapAction=' . $this->SOAPAction . ' for operation=' . $this->opData['name']);
+				$this->appendDebug('opData=' . $this->varDump($this->opData));
+				$this->methodname = $this->opData['name'];
+			} else {
+				$this->debug('in invoke_method, no WSDL for operation=' . $this->methodname);
+				$this->fault('Client', "Operation '" . $this->methodname . "' is not defined in the WSDL for this service");
+				return;
+			}
+		} else {
+			$this->debug('in invoke_method, no WSDL to validate method');
+		}
+
+		// if a . is present in $this->methodname, we see if there is a class in scope,
+		// which could be referred to. We will also distinguish between two deliminators,
+		// to allow methods to be called a the class or an instance
+		$class = '';
+		$method = '';
+		if (strpos($this->methodname, '..') > 0) {
+			$delim = '..';
+		} else if (strpos($this->methodname, '.') > 0) {
+			$delim = '.';
+		} else {
+			$delim = '';
+		}
+
+		if (strlen($delim) > 0 && substr_count($this->methodname, $delim) == 1 &&
+			class_exists(substr($this->methodname, 0, strpos($this->methodname, $delim)))) {
+			// get the class and method name
+			$class = substr($this->methodname, 0, strpos($this->methodname, $delim));
+			$method = substr($this->methodname, strpos($this->methodname, $delim) + strlen($delim));
+			$this->debug("in invoke_method, class=$class method=$method delim=$delim");
+		}
+
+		// does method exist?
+		if ($class == '') {
+			if (!function_exists($this->methodname)) {
+				$this->debug("in invoke_method, function '$this->methodname' not found!");
+				$this->result = 'fault: method not found';
+				$this->fault('Client',"method '$this->methodname' not defined in service");
+				return;
+			}
+		} else {
+			$method_to_compare = (substr(phpversion(), 0, 2) == '4.') ? strtolower($method) : $method;
+			if (!in_array($method_to_compare, get_class_methods($class))) {
+				$this->debug("in invoke_method, method '$this->methodname' not found in class '$class'!");
+				$this->result = 'fault: method not found';
+				$this->fault('Client',"method '$this->methodname' not defined in service");
+				return;
+			}
+		}
+
+		// evaluate message, getting back parameters
+		// verify that request parameters match the method's signature
+		if(! $this->verify_method($this->methodname,$this->methodparams)){
+			// debug
+			$this->debug('ERROR: request not verified against method signature');
+			$this->result = 'fault: request failed validation against method signature';
+			// return fault
+			$this->fault('Client',"Operation '$this->methodname' not defined in service.");
+			return;
+		}
+
+		// if there are parameters to pass
+		$this->debug('in invoke_method, params:');
+		$this->appendDebug($this->varDump($this->methodparams));
+		$this->debug("in invoke_method, calling '$this->methodname'");
+		if (!function_exists('call_user_func_array')) {
+			if ($class == '') {
+				$this->debug('in invoke_method, calling function using eval()');
+				$funcCall = "\$this->methodreturn = $this->methodname(";
+			} else {
+				if ($delim == '..') {
+					$this->debug('in invoke_method, calling class method using eval()');
+					$funcCall = "\$this->methodreturn = ".$class."::".$method."(";
+				} else {
+					$this->debug('in invoke_method, calling instance method using eval()');
+					// generate unique instance name
+					$instname = "\$inst_".time();
+					$funcCall = $instname." = new ".$class."(); ";
+					$funcCall .= "\$this->methodreturn = ".$instname."->".$method."(";
+				}
+			}
+			if ($this->methodparams) {
+				foreach ($this->methodparams as $param) {
+					if (is_array($param)) {
+						$this->fault('Client', 'NuSOAP does not handle complexType parameters correctly when using eval; call_user_func_array must be available');
+						return;
+					}
+					$funcCall .= "\"$param\",";
+				}
+				$funcCall = substr($funcCall, 0, -1);
+			}
+			$funcCall .= ');';
+			$this->debug('in invoke_method, function call: '.$funcCall);
+			@eval($funcCall);
+		} else {
+			if ($class == '') {
+				$this->debug('in invoke_method, calling function using call_user_func_array()');
+				$call_arg = "$this->methodname";	// straight assignment changes $this->methodname to lower case after call_user_func_array()
+			} elseif ($delim == '..') {
+				$this->debug('in invoke_method, calling class method using call_user_func_array()');
+				$call_arg = array ($class, $method);
+			} else {
+				$this->debug('in invoke_method, calling instance method using call_user_func_array()');
+				$instance = new $class ();
+				$call_arg = array(&$instance, $method);
+			}
+			$this->methodreturn = call_user_func_array($call_arg, $this->methodparams);
+		}
+        $this->debug('in invoke_method, methodreturn:');
+        $this->appendDebug($this->varDump($this->methodreturn));
+		$this->debug("in invoke_method, called method $this->methodname, received $this->methodreturn of type ".gettype($this->methodreturn));
+	}
+
+	/**
+	* serializes the return value from a PHP function into a full SOAP Envelope
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* responseSOAP
+	*
+	* This sets the fault field on error
+	*
+	* @access   private
+	*/
+	function serialize_return() {
+		$this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
+		// if fault
+		if (isset($this->methodreturn) && (get_class($this->methodreturn) == 'soap_fault')) {
+			$this->debug('got a fault object from method');
+			$this->fault = $this->methodreturn;
+			return;
+		} elseif ($this->methodreturnisliteralxml) {
+			$return_val = $this->methodreturn;
+		// returned value(s)
+		} else {
+			$this->debug('got a(n) '.gettype($this->methodreturn).' from method');
+			$this->debug('serializing return value');
+			if($this->wsdl){
+				// weak attempt at supporting multiple output params
+				if(sizeof($this->opData['output']['parts']) > 1){
+			    	$opParams = $this->methodreturn;
+			    } else {
+			    	// TODO: is this really necessary?
+			    	$opParams = array($this->methodreturn);
+			    }
+			    $return_val = $this->wsdl->serializeRPCParameters($this->methodname,'output',$opParams);
+			    $this->appendDebug($this->wsdl->getDebug());
+			    $this->wsdl->clearDebug();
+				if($errstr = $this->wsdl->getError()){
+					$this->debug('got wsdl error: '.$errstr);
+					$this->fault('Server', 'unable to serialize result');
+					return;
+				}
+			} else {
+				if (isset($this->methodreturn)) {
+					$return_val = $this->serialize_val($this->methodreturn, 'return');
+				} else {
+					$return_val = '';
+					$this->debug('in absence of WSDL, assume void return for backward compatibility');
+				}
+			}
+		}
+		$this->debug('return value:');
+		$this->appendDebug($this->varDump($return_val));
+
+		$this->debug('serializing response');
+		if ($this->wsdl) {
+			$this->debug('have WSDL for serialization: style is ' . $this->opData['style']);
+			if ($this->opData['style'] == 'rpc') {
+				$this->debug('style is rpc for serialization: use is ' . $this->opData['output']['use']);
+				if ($this->opData['output']['use'] == 'literal') {
+					$payload = '<'.$this->methodname.'Response xmlns="'.$this->methodURI.'">'.$return_val.'</'.$this->methodname."Response>";
+				} else {
+					$payload = '<ns1:'.$this->methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'</ns1:'.$this->methodname."Response>";
+				}
+			} else {
+				$this->debug('style is not rpc for serialization: assume document');
+				$payload = $return_val;
+			}
+		} else {
+			$this->debug('do not have WSDL for serialization: assume rpc/encoded');
+			$payload = '<ns1:'.$this->methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'</ns1:'.$this->methodname."Response>";
+		}
+		$this->result = 'successful';
+		if($this->wsdl){
+			//if($this->debug_flag){
+            	$this->appendDebug($this->wsdl->getDebug());
+            //	}
+			if (isset($opData['output']['encodingStyle'])) {
+				$encodingStyle = $opData['output']['encodingStyle'];
+			} else {
+				$encodingStyle = '';
+			}
+			// Added: In case we use a WSDL, return a serialized env. WITH the usedNamespaces.
+			$this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders,$this->wsdl->usedNamespaces,$this->opData['style'],$encodingStyle);
+		} else {
+			$this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders);
+		}
+		$this->debug("Leaving serialize_return");
+	}
+
+	/**
+	* sends an HTTP response
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* outgoing_headers
+	* response
+	*
+	* @access   private
+	*/
+	function send_response() {
+		$this->debug('Enter send_response');
+		if ($this->fault) {
+			$payload = $this->fault->serialize();
+			$this->outgoing_headers[] = "HTTP/1.0 500 Internal Server Error";
+			$this->outgoing_headers[] = "Status: 500 Internal Server Error";
+		} else {
+			$payload = $this->responseSOAP;
+			// Some combinations of PHP+Web server allow the Status
+			// to come through as a header.  Since OK is the default
+			// just do nothing.
+			// $this->outgoing_headers[] = "HTTP/1.0 200 OK";
+			// $this->outgoing_headers[] = "Status: 200 OK";
+		}
+        // add debug data if in debug mode
+		if(isset($this->debug_flag) && $this->debug_flag){
+        	$payload .= $this->getDebugAsXMLComment();
+        }
+		$this->outgoing_headers[] = "Server: $this->title Server v$this->version";
+		ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+		$this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
+		// Let the Web server decide about this
+		//$this->outgoing_headers[] = "Connection: Close\r\n";
+		$payload = $this->getHTTPBody($payload);
+		$type = $this->getHTTPContentType();
+		$charset = $this->getHTTPContentTypeCharset();
+		$this->outgoing_headers[] = "Content-Type: $type" . ($charset ? '; charset=' . $charset : '');
+		//begin code to compress payload - by John
+		// NOTE: there is no way to know whether the Web server will also compress
+		// this data.
+		if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) {	
+			if (strstr($this->headers['accept-encoding'], 'gzip')) {
+				if (function_exists('gzencode')) {
+					if (isset($this->debug_flag) && $this->debug_flag) {
+						$payload .= "<!-- Content being gzipped -->";
+					}
+					$this->outgoing_headers[] = "Content-Encoding: gzip";
+					$payload = gzencode($payload);
+				} else {
+					if (isset($this->debug_flag) && $this->debug_flag) {
+						$payload .= "<!-- Content will not be gzipped: no gzencode -->";
+					}
+				}
+			} elseif (strstr($this->headers['accept-encoding'], 'deflate')) {
+				// Note: MSIE requires gzdeflate output (no Zlib header and checksum),
+				// instead of gzcompress output,
+				// which conflicts with HTTP 1.1 spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.5)
+				if (function_exists('gzdeflate')) {
+					if (isset($this->debug_flag) && $this->debug_flag) {
+						$payload .= "<!-- Content being deflated -->";
+					}
+					$this->outgoing_headers[] = "Content-Encoding: deflate";
+					$payload = gzdeflate($payload);
+				} else {
+					if (isset($this->debug_flag) && $this->debug_flag) {
+						$payload .= "<!-- Content will not be deflated: no gzcompress -->";
+					}
+				}
+			}
+		}
+		//end code
+		$this->outgoing_headers[] = "Content-Length: ".strlen($payload);
+		reset($this->outgoing_headers);
+		foreach($this->outgoing_headers as $hdr){
+			header($hdr, false);
+		}
+		print $payload;
+		$this->response = join("\r\n",$this->outgoing_headers)."\r\n\r\n".$payload;
+	}
+
+	/**
+	* takes the value that was created by parsing the request
+	* and compares to the method's signature, if available.
+	*
+	* @param	string	$operation	The operation to be invoked
+	* @param	array	$request	The array of parameter values
+	* @return	boolean	Whether the operation was found
+	* @access   private
+	*/
+	function verify_method($operation,$request){
+		if(isset($this->wsdl) && is_object($this->wsdl)){
+			if($this->wsdl->getOperationData($operation)){
+				return true;
+			}
+	    } elseif(isset($this->operations[$operation])){
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	* processes SOAP message received from client
+	*
+	* @param	array	$headers	The HTTP headers
+	* @param	string	$data		unprocessed request data from client
+	* @return	mixed	value of the message, decoded into a PHP type
+	* @access   private
+	*/
+    function parseRequest($headers, $data) {
+		$this->debug('Entering parseRequest() for data of length ' . strlen($data) . ' and type ' . $headers['content-type']);
+		if (!strstr($headers['content-type'], 'text/xml')) {
+			$this->setError('Request not of type text/xml');
+			return false;
+		}
+		if (strpos($headers['content-type'], '=')) {
+			$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
+			$this->debug('Got response encoding: ' . $enc);
+			if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+				$this->xml_encoding = strtoupper($enc);
+			} else {
+				$this->xml_encoding = 'US-ASCII';
+			}
+		} else {
+			// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+			$this->xml_encoding = 'ISO-8859-1';
+		}
+		$this->debug('Use encoding: ' . $this->xml_encoding . ' when creating soap_parser');
+		// parse response, get soap parser obj
+		$parser = new soap_parser($data,$this->xml_encoding,'',$this->decode_utf8);
+		// parser debug
+		$this->debug("parser debug: \n".$parser->getDebug());
+		// if fault occurred during message parsing
+		if($err = $parser->getError()){
+			$this->result = 'fault: error in msg parsing: '.$err;
+			$this->fault('Client',"error in msg parsing:\n".$err);
+		// else successfully parsed request into soapval object
+		} else {
+			// get/set methodname
+			$this->methodURI = $parser->root_struct_namespace;
+			$this->methodname = $parser->root_struct_name;
+			$this->debug('methodname: '.$this->methodname.' methodURI: '.$this->methodURI);
+			$this->debug('calling parser->get_response()');
+			$this->methodparams = $parser->get_response();
+			// get SOAP headers
+			$this->requestHeaders = $parser->getHeaders();
+            // add document for doclit support
+            $this->document = $parser->document;
+		}
+	 }
+
+	/**
+	* gets the HTTP body for the current response.
+	*
+	* @param string $soapmsg The SOAP payload
+	* @return string The HTTP body, which includes the SOAP payload
+	* @access private
+	*/
+	function getHTTPBody($soapmsg) {
+		return $soapmsg;
+	}
+	
+	/**
+	* gets the HTTP content type for the current response.
+	*
+	* Note: getHTTPBody must be called before this.
+	*
+	* @return string the HTTP content type for the current response.
+	* @access private
+	*/
+	function getHTTPContentType() {
+		return 'text/xml';
+	}
+	
+	/**
+	* gets the HTTP content type charset for the current response.
+	* returns false for non-text content types.
+	*
+	* Note: getHTTPBody must be called before this.
+	*
+	* @return string the HTTP content type charset for the current response.
+	* @access private
+	*/
+	function getHTTPContentTypeCharset() {
+		return $this->soap_defencoding;
+	}
+
+	/**
+	* add a method to the dispatch map (this has been replaced by the register method)
+	*
+	* @param    string $methodname
+	* @param    string $in array of input values
+	* @param    string $out array of output values
+	* @access   public
+	* @deprecated
+	*/
+	function add_to_map($methodname,$in,$out){
+			$this->operations[$methodname] = array('name' => $methodname,'in' => $in,'out' => $out);
+	}
+
+	/**
+	* register a service function with the server
+	*
+	* @param    string $name the name of the PHP function, class.method or class..method
+	* @param    array $in assoc array of input values: key = param name, value = param type
+	* @param    array $out assoc array of output values: key = param name, value = param type
+	* @param	mixed $namespace the element namespace for the method or false
+	* @param	mixed $soapaction the soapaction for the method or false
+	* @param	mixed $style optional (rpc|document) or false Note: when 'document' is specified, parameter and return wrappers are created for you automatically
+	* @param	mixed $use optional (encoded|literal) or false
+	* @param	string $documentation optional Description to include in WSDL
+	* @param	string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
+	* @access   public
+	*/
+	function register($name,$in=array(),$out=array(),$namespace=false,$soapaction=false,$style=false,$use=false,$documentation='',$encodingStyle=''){
+		global $HTTP_SERVER_VARS;
+
+		if($this->externalWSDLURL){
+			die('You cannot bind to an external WSDL file, and register methods outside of it! Please choose either WSDL or no WSDL.');
+		}
+		if (! $name) {
+			die('You must specify a name when you register an operation');
+		}
+		if (!is_array($in)) {
+			die('You must provide an array for operation inputs');
+		}
+		if (!is_array($out)) {
+			die('You must provide an array for operation outputs');
+		}
+		if(false == $namespace) {
+		}
+		if(false == $soapaction) {
+			if (isset($_SERVER)) {
+				$SERVER_NAME = $_SERVER['SERVER_NAME'];
+				$SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
+			} elseif (isset($HTTP_SERVER_VARS)) {
+				$SERVER_NAME = $HTTP_SERVER_VARS['SERVER_NAME'];
+				$SCRIPT_NAME = isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
+			} else {
+				$this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available");
+			}
+			$soapaction = "http://$SERVER_NAME$SCRIPT_NAME/$name";
+		}
+		if(false == $style) {
+			$style = "rpc";
+		}
+		if(false == $use) {
+			$use = "encoded";
+		}
+		if ($use == 'encoded' && $encodingStyle = '') {
+			$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+		}
+
+		$this->operations[$name] = array(
+	    'name' => $name,
+	    'in' => $in,
+	    'out' => $out,
+	    'namespace' => $namespace,
+	    'soapaction' => $soapaction,
+	    'style' => $style);
+        if($this->wsdl){
+        	$this->wsdl->addOperation($name,$in,$out,$namespace,$soapaction,$style,$use,$documentation,$encodingStyle);
+	    }
+		return true;
+	}
+
+	/**
+	* Specify a fault to be returned to the client.
+	* This also acts as a flag to the server that a fault has occured.
+	*
+	* @param	string $faultcode
+	* @param	string $faultstring
+	* @param	string $faultactor
+	* @param	string $faultdetail
+	* @access   public
+	*/
+	function fault($faultcode,$faultstring,$faultactor='',$faultdetail=''){
+		if ($faultdetail == '' && $this->debug_flag) {
+			$faultdetail = $this->getDebug();
+		}
+		$this->fault = new soap_fault($faultcode,$faultactor,$faultstring,$faultdetail);
+		$this->fault->soap_defencoding = $this->soap_defencoding;
+	}
+
+    /**
+    * Sets up wsdl object.
+    * Acts as a flag to enable internal WSDL generation
+    *
+    * @param string $serviceName, name of the service
+    * @param mixed $namespace optional 'tns' service namespace or false
+    * @param mixed $endpoint optional URL of service endpoint or false
+    * @param string $style optional (rpc|document) WSDL style (also specified by operation)
+    * @param string $transport optional SOAP transport
+    * @param mixed $schemaTargetNamespace optional 'types' targetNamespace for service schema or false
+    */
+    function configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http://schemas.xmlsoap.org/soap/http', $schemaTargetNamespace = false)
+    {
+    	global $HTTP_SERVER_VARS;
+
+		if (isset($_SERVER)) {
+			$SERVER_NAME = $_SERVER['SERVER_NAME'];
+			$SERVER_PORT = $_SERVER['SERVER_PORT'];
+			$SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
+			$HTTPS = $_SERVER['HTTPS'];
+		} elseif (isset($HTTP_SERVER_VARS)) {
+			$SERVER_NAME = $HTTP_SERVER_VARS['SERVER_NAME'];
+			$SERVER_PORT = $HTTP_SERVER_VARS['SERVER_PORT'];
+			$SCRIPT_NAME = isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
+			$HTTPS = $HTTP_SERVER_VARS['HTTPS'];
+		} else {
+			$this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available");
+		}
+		if ($SERVER_PORT == 80) {
+			$SERVER_PORT = '';
+		} else {
+			$SERVER_PORT = ':' . $SERVER_PORT;
+		}
+        if(false == $namespace) {
+            $namespace = "http://$SERVER_NAME/soap/$serviceName";
+        }
+        
+        if(false == $endpoint) {
+        	if ($HTTPS == '1' || $HTTPS == 'on') {
+        		$SCHEME = 'https';
+        	} else {
+        		$SCHEME = 'http';
+        	}
+            $endpoint = "$SCHEME://$SERVER_NAME$SERVER_PORT$SCRIPT_NAME";
+        }
+        
+        if(false == $schemaTargetNamespace) {
+            $schemaTargetNamespace = $namespace;
+        }
+        
+		$this->wsdl = new wsdl;
+		$this->wsdl->serviceName = $serviceName;
+        $this->wsdl->endpoint = $endpoint;
+		$this->wsdl->namespaces['tns'] = $namespace;
+		$this->wsdl->namespaces['soap'] = 'http://schemas.xmlsoap.org/wsdl/soap/';
+		$this->wsdl->namespaces['wsdl'] = 'http://schemas.xmlsoap.org/wsdl/';
+		if ($schemaTargetNamespace != $namespace) {
+			$this->wsdl->namespaces['types'] = $schemaTargetNamespace;
+		}
+        $this->wsdl->schemas[$schemaTargetNamespace][0] = new xmlschema('', '', $this->wsdl->namespaces);
+        $this->wsdl->schemas[$schemaTargetNamespace][0]->schemaTargetNamespace = $schemaTargetNamespace;
+        $this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/soap/encoding/'][0] = array('location' => '', 'loaded' => true);
+        $this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/wsdl/'][0] = array('location' => '', 'loaded' => true);
+        $this->wsdl->bindings[$serviceName.'Binding'] = array(
+        	'name'=>$serviceName.'Binding',
+            'style'=>$style,
+            'transport'=>$transport,
+            'portType'=>$serviceName.'PortType');
+        $this->wsdl->ports[$serviceName.'Port'] = array(
+        	'binding'=>$serviceName.'Binding',
+            'location'=>$endpoint,
+            'bindingType'=>'http://schemas.xmlsoap.org/wsdl/soap/');
+    }
+}
+
+
+
+?><?php
+
+
+
+/**
+* parses a WSDL file, allows access to it's data, other utility methods
+* 
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access public 
+*/
+class wsdl extends nusoap_base {
+	// URL or filename of the root of this WSDL
+    var $wsdl; 
+    // define internal arrays of bindings, ports, operations, messages, etc.
+    var $schemas = array();
+    var $currentSchema;
+    var $message = array();
+    var $complexTypes = array();
+    var $messages = array();
+    var $currentMessage;
+    var $currentOperation;
+    var $portTypes = array();
+    var $currentPortType;
+    var $bindings = array();
+    var $currentBinding;
+    var $ports = array();
+    var $currentPort;
+    var $opData = array();
+    var $status = '';
+    var $documentation = false;
+    var $endpoint = ''; 
+    // array of wsdl docs to import
+    var $import = array(); 
+    // parser vars
+    var $parser;
+    var $position = 0;
+    var $depth = 0;
+    var $depth_array = array();
+	// for getting wsdl
+	var $proxyhost = '';
+    var $proxyport = '';
+	var $proxyusername = '';
+	var $proxypassword = '';
+	var $timeout = 0;
+	var $response_timeout = 30;
+
+    /**
+     * constructor
+     * 
+     * @param string $wsdl WSDL document URL
+	 * @param string $proxyhost
+	 * @param string $proxyport
+	 * @param string $proxyusername
+	 * @param string $proxypassword
+	 * @param integer $timeout set the connection timeout
+	 * @param integer $response_timeout set the response timeout
+     * @access public 
+     */
+    function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30){
+		parent::nusoap_base();
+        $this->wsdl = $wsdl;
+        $this->proxyhost = $proxyhost;
+        $this->proxyport = $proxyport;
+		$this->proxyusername = $proxyusername;
+		$this->proxypassword = $proxypassword;
+		$this->timeout = $timeout;
+		$this->response_timeout = $response_timeout;
+        
+        // parse wsdl file
+        if ($wsdl != "") {
+            $this->debug('initial wsdl URL: ' . $wsdl);
+            $this->parseWSDL($wsdl);
+        }
+        // imports
+        // TODO: handle imports more properly, grabbing them in-line and nesting them
+        	$imported_urls = array();
+        	$imported = 1;
+        	while ($imported > 0) {
+        		$imported = 0;
+        		// Schema imports
+        		foreach ($this->schemas as $ns => $list) {
+        			foreach ($list as $xs) {
+						$wsdlparts = parse_url($this->wsdl);	// this is bogusly simple!
+			            foreach ($xs->imports as $ns2 => $list2) {
+			                for ($ii = 0; $ii < count($list2); $ii++) {
+			                	if (! $list2[$ii]['loaded']) {
+			                		$this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true;
+			                		$url = $list2[$ii]['location'];
+									if ($url != '') {
+										$urlparts = parse_url($url);
+										if (!isset($urlparts['host'])) {
+											$url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' .$wsdlparts['port'] : '') .
+													substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
+										}
+										if (! in_array($url, $imported_urls)) {
+						                	$this->parseWSDL($url);
+					                		$imported++;
+					                		$imported_urls[] = $url;
+					                	}
+									} else {
+										$this->debug("Unexpected scenario: empty URL for unloaded import");
+									}
+								}
+							}
+			            } 
+        			}
+        		}
+        		// WSDL imports
+				$wsdlparts = parse_url($this->wsdl);	// this is bogusly simple!
+	            foreach ($this->import as $ns => $list) {
+	                for ($ii = 0; $ii < count($list); $ii++) {
+	                	if (! $list[$ii]['loaded']) {
+	                		$this->import[$ns][$ii]['loaded'] = true;
+	                		$url = $list[$ii]['location'];
+							if ($url != '') {
+								$urlparts = parse_url($url);
+								if (!isset($urlparts['host'])) {
+									$url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') .
+											substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
+								}
+								if (! in_array($url, $imported_urls)) {
+				                	$this->parseWSDL($url);
+			                		$imported++;
+			                		$imported_urls[] = $url;
+			                	}
+							} else {
+								$this->debug("Unexpected scenario: empty URL for unloaded import");
+							}
+						}
+					}
+	            } 
+			}
+        // add new data to operation data
+        foreach($this->bindings as $binding => $bindingData) {
+            if (isset($bindingData['operations']) && is_array($bindingData['operations'])) {
+                foreach($bindingData['operations'] as $operation => $data) {
+                    $this->debug('post-parse data gathering for ' . $operation);
+                    $this->bindings[$binding]['operations'][$operation]['input'] = 
+						isset($this->bindings[$binding]['operations'][$operation]['input']) ? 
+						array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) :
+						$this->portTypes[ $bindingData['portType'] ][$operation]['input'];
+                    $this->bindings[$binding]['operations'][$operation]['output'] = 
+						isset($this->bindings[$binding]['operations'][$operation]['output']) ?
+						array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) :
+						$this->portTypes[ $bindingData['portType'] ][$operation]['output'];
+                    if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ])){
+						$this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ];
+					}
+					if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ])){
+                   		$this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ];
+                    }
+					if (isset($bindingData['style'])) {
+                        $this->bindings[$binding]['operations'][$operation]['style'] = $bindingData['style'];
+                    }
+                    $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : '';
+                    $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : '';
+                    $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : '';
+                } 
+            } 
+        }
+    }
+
+    /**
+     * parses the wsdl document
+     * 
+     * @param string $wsdl path or URL
+     * @access private 
+     */
+    function parseWSDL($wsdl = '')
+    {
+        if ($wsdl == '') {
+            $this->debug('no wsdl passed to parseWSDL()!!');
+            $this->setError('no wsdl passed to parseWSDL()!!');
+            return false;
+        }
+        
+        // parse $wsdl for url format
+        $wsdl_props = parse_url($wsdl);
+
+        if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'http' || $wsdl_props['scheme'] == 'https')) {
+            $this->debug('getting WSDL http(s) URL ' . $wsdl);
+        	// get wsdl
+	        $tr = new soap_transport_http($wsdl);
+			$tr->request_method = 'GET';
+			$tr->useSOAPAction = false;
+			if($this->proxyhost && $this->proxyport){
+				$tr->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword);
+			}
+			$tr->setEncoding('gzip, deflate');
+			$wsdl_string = $tr->send('', $this->timeout, $this->response_timeout);
+			//$this->debug("WSDL request\n" . $tr->outgoing_payload);
+			//$this->debug("WSDL response\n" . $tr->incoming_payload);
+			$this->appendDebug($tr->getDebug());
+			// catch errors
+			if($err = $tr->getError() ){
+				$errstr = 'HTTP ERROR: '.$err;
+				$this->debug($errstr);
+	            $this->setError($errstr);
+				unset($tr);
+	            return false;
+			}
+			unset($tr);
+			$this->debug("got WSDL URL");
+        } else {
+            // $wsdl is not http(s), so treat it as a file URL or plain file path
+        	if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'file') && isset($wsdl_props['path'])) {
+        		$path = isset($wsdl_props['host']) ? ($wsdl_props['host'] . ':' . $wsdl_props['path']) : $wsdl_props['path'];
+        	} else {
+        		$path = $wsdl;
+        	}
+            $this->debug('getting WSDL file ' . $path);
+            if ($fp = @fopen($path, 'r')) {
+                $wsdl_string = '';
+                while ($data = fread($fp, 32768)) {
+                    $wsdl_string .= $data;
+                } 
+                fclose($fp);
+            } else {
+            	$errstr = "Bad path to WSDL file $path";
+            	$this->debug($errstr);
+                $this->setError($errstr);
+                return false;
+            } 
+        }
+        $this->debug('Parse WSDL');
+        // end new code added
+        // Create an XML parser.
+        $this->parser = xml_parser_create(); 
+        // Set the options for parsing the XML data.
+        // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
+        xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); 
+        // Set the object for the parser.
+        xml_set_object($this->parser, $this); 
+        // Set the element handlers for the parser.
+        xml_set_element_handler($this->parser, 'start_element', 'end_element');
+        xml_set_character_data_handler($this->parser, 'character_data');
+        // Parse the XML file.
+        if (!xml_parse($this->parser, $wsdl_string, true)) {
+            // Display an error message.
+            $errstr = sprintf(
+				'XML error parsing WSDL from %s on line %d: %s',
+				$wsdl,
+                xml_get_current_line_number($this->parser),
+                xml_error_string(xml_get_error_code($this->parser))
+                );
+            $this->debug($errstr);
+			$this->debug("XML payload:\n" . $wsdl_string);
+            $this->setError($errstr);
+            return false;
+        } 
+		// free the parser
+        xml_parser_free($this->parser);
+        $this->debug('Parsing WSDL done');
+		// catch wsdl parse errors
+		if($this->getError()){
+			return false;
+		}
+        return true;
+    } 
+
+    /**
+     * start-element handler
+     * 
+     * @param string $parser XML parser object
+     * @param string $name element name
+     * @param string $attrs associative array of attributes
+     * @access private 
+     */
+    function start_element($parser, $name, $attrs)
+    {
+        if ($this->status == 'schema') {
+            $this->currentSchema->schemaStartElement($parser, $name, $attrs);
+            $this->appendDebug($this->currentSchema->getDebug());
+            $this->currentSchema->clearDebug();
+        } elseif (ereg('schema$', $name)) {
+        	$this->debug('Parsing WSDL schema');
+            // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
+            $this->status = 'schema';
+            $this->currentSchema = new xmlschema('', '', $this->namespaces);
+            $this->currentSchema->schemaStartElement($parser, $name, $attrs);
+            $this->appendDebug($this->currentSchema->getDebug());
+            $this->currentSchema->clearDebug();
+        } else {
+            // position in the total number of elements, starting from 0
+            $pos = $this->position++;
+            $depth = $this->depth++; 
+            // set self as current value for this depth
+            $this->depth_array[$depth] = $pos;
+            $this->message[$pos] = array('cdata' => ''); 
+            // process attributes
+            if (count($attrs) > 0) {
+				// register namespace declarations
+                foreach($attrs as $k => $v) {
+                    if (ereg("^xmlns", $k)) {
+                        if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
+                            $this->namespaces[$ns_prefix] = $v;
+                        } else {
+                            $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v;
+                        } 
+                        if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') {
+                            $this->XMLSchemaVersion = $v;
+                            $this->namespaces['xsi'] = $v . '-instance';
+                        } 
+                    }
+                }
+                // expand each attribute prefix to its namespace
+                foreach($attrs as $k => $v) {
+                    $k = strpos($k, ':') ? $this->expandQname($k) : $k;
+                    if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') {
+                        $v = strpos($v, ':') ? $this->expandQname($v) : $v;
+                    } 
+                    $eAttrs[$k] = $v;
+                } 
+                $attrs = $eAttrs;
+            } else {
+                $attrs = array();
+            } 
+            // get element prefix, namespace and name
+            if (ereg(':', $name)) {
+                // get ns prefix
+                $prefix = substr($name, 0, strpos($name, ':')); 
+                // get ns
+                $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : ''; 
+                // get unqualified name
+                $name = substr(strstr($name, ':'), 1);
+            } 
+			// process attributes, expanding any prefixes to namespaces
+            // find status, register data
+            switch ($this->status) {
+                case 'message':
+                    if ($name == 'part') {
+			            if (isset($attrs['type'])) {
+		                    $this->debug("msg " . $this->currentMessage . ": found part $attrs[name]: " . implode(',', $attrs));
+		                    $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type'];
+            			} 
+			            if (isset($attrs['element'])) {
+		                    $this->debug("msg " . $this->currentMessage . ": found part $attrs[name]: " . implode(',', $attrs));
+			                $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'];
+			            } 
+        			} 
+        			break;
+			    case 'portType':
+			        switch ($name) {
+			            case 'operation':
+			                $this->currentPortOperation = $attrs['name'];
+			                $this->debug("portType $this->currentPortType operation: $this->currentPortOperation");
+			                if (isset($attrs['parameterOrder'])) {
+			                	$this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder'];
+			        		} 
+			        		break;
+					    case 'documentation':
+					        $this->documentation = true;
+					        break; 
+					    // merge input/output data
+					    default:
+					        $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : '';
+					        $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m;
+					        break;
+					} 
+			    	break;
+				case 'binding':
+				    switch ($name) {
+				        case 'binding': 
+				            // get ns prefix
+				            if (isset($attrs['style'])) {
+				            $this->bindings[$this->currentBinding]['prefix'] = $prefix;
+					    	} 
+					    	$this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs);
+					    	break;
+						case 'header':
+						    $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus]['headers'][] = $attrs;
+						    break;
+						case 'operation':
+						    if (isset($attrs['soapAction'])) {
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction'];
+						    } 
+						    if (isset($attrs['style'])) {
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style'];
+						    } 
+						    if (isset($attrs['name'])) {
+						        $this->currentOperation = $attrs['name'];
+						        $this->debug("current binding operation: $this->currentOperation");
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name'];
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding;
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : '';
+						    } 
+						    break;
+						case 'input':
+						    $this->opStatus = 'input';
+						    break;
+						case 'output':
+						    $this->opStatus = 'output';
+						    break;
+						case 'body':
+						    if (isset($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus])) {
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs);
+						    } else {
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs;
+						    } 
+						    break;
+					} 
+					break;
+				case 'service':
+					switch ($name) {
+					    case 'port':
+					        $this->currentPort = $attrs['name'];
+					        $this->debug('current port: ' . $this->currentPort);
+					        $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']);
+					
+					        break;
+					    case 'address':
+					        $this->ports[$this->currentPort]['location'] = $attrs['location'];
+					        $this->ports[$this->currentPort]['bindingType'] = $namespace;
+					        $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace;
+					        $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location'];
+					        break;
+					} 
+					break;
+			} 
+		// set status
+		switch ($name) {
+			case 'import':
+			    if (isset($attrs['location'])) {
+                    $this->import[$attrs['namespace']][] = array('location' => $attrs['location'], 'loaded' => false);
+                    $this->debug('parsing import ' . $attrs['namespace']. ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]).')');
+				} else {
+                    $this->import[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
+					if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
+						$this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace'];
+					}
+                    $this->debug('parsing import ' . $attrs['namespace']. ' - [no location] (' . count($this->import[$attrs['namespace']]).')');
+				}
+				break;
+			//wait for schema
+			//case 'types':
+			//	$this->status = 'schema';
+			//	break;
+			case 'message':
+				$this->status = 'message';
+				$this->messages[$attrs['name']] = array();
+				$this->currentMessage = $attrs['name'];
+				break;
+			case 'portType':
+				$this->status = 'portType';
+				$this->portTypes[$attrs['name']] = array();
+				$this->currentPortType = $attrs['name'];
+				break;
+			case "binding":
+				if (isset($attrs['name'])) {
+				// get binding name
+					if (strpos($attrs['name'], ':')) {
+			    		$this->currentBinding = $this->getLocalPart($attrs['name']);
+					} else {
+			    		$this->currentBinding = $attrs['name'];
+					} 
+					$this->status = 'binding';
+					$this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']);
+					$this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']);
+				} 
+				break;
+			case 'service':
+				$this->serviceName = $attrs['name'];
+				$this->status = 'service';
+				$this->debug('current service: ' . $this->serviceName);
+				break;
+			case 'definitions':
+				foreach ($attrs as $name => $value) {
+					$this->wsdl_info[$name] = $value;
+				} 
+				break;
+			} 
+		} 
+	} 
+
+	/**
+	* end-element handler
+	* 
+	* @param string $parser XML parser object
+	* @param string $name element name
+	* @access private 
+	*/
+	function end_element($parser, $name){ 
+		// unset schema status
+		if (/*ereg('types$', $name) ||*/ ereg('schema$', $name)) {
+			$this->status = "";
+            $this->appendDebug($this->currentSchema->getDebug());
+            $this->currentSchema->clearDebug();
+			$this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema;
+        	$this->debug('Parsing WSDL schema done');
+		} 
+		if ($this->status == 'schema') {
+			$this->currentSchema->schemaEndElement($parser, $name);
+		} else {
+			// bring depth down a notch
+			$this->depth--;
+		} 
+		// end documentation
+		if ($this->documentation) {
+			//TODO: track the node to which documentation should be assigned; it can be a part, message, etc.
+			//$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation;
+			$this->documentation = false;
+		} 
+	} 
+
+	/**
+	 * element content handler
+	 * 
+	 * @param string $parser XML parser object
+	 * @param string $data element content
+	 * @access private 
+	 */
+	function character_data($parser, $data)
+	{
+		$pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0;
+		if (isset($this->message[$pos]['cdata'])) {
+			$this->message[$pos]['cdata'] .= $data;
+		} 
+		if ($this->documentation) {
+			$this->documentation .= $data;
+		} 
+	} 
+	
+	function getBindingData($binding)
+	{
+		if (is_array($this->bindings[$binding])) {
+			return $this->bindings[$binding];
+		} 
+	}
+	
+	/**
+	 * returns an assoc array of operation names => operation data
+	 * 
+	 * @param string $bindingType eg: soap, smtp, dime (only soap is currently supported)
+	 * @return array 
+	 * @access public 
+	 */
+	function getOperations($bindingType = 'soap')
+	{
+		$ops = array();
+		if ($bindingType == 'soap') {
+			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
+		}
+		// loop thru ports
+		foreach($this->ports as $port => $portData) {
+			// binding type of port matches parameter
+			if ($portData['bindingType'] == $bindingType) {
+				//$this->debug("getOperations for port $port");
+				//$this->debug("port data: " . $this->varDump($portData));
+				//$this->debug("bindings: " . $this->varDump($this->bindings[ $portData['binding'] ]));
+				// merge bindings
+				if (isset($this->bindings[ $portData['binding'] ]['operations'])) {
+					$ops = array_merge ($ops, $this->bindings[ $portData['binding'] ]['operations']);
+				}
+			}
+		} 
+		return $ops;
+	} 
+	
+	/**
+	 * returns an associative array of data necessary for calling an operation
+	 * 
+	 * @param string $operation , name of operation
+	 * @param string $bindingType , type of binding eg: soap
+	 * @return array 
+	 * @access public 
+	 */
+	function getOperationData($operation, $bindingType = 'soap')
+	{
+		if ($bindingType == 'soap') {
+			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
+		}
+		// loop thru ports
+		foreach($this->ports as $port => $portData) {
+			// binding type of port matches parameter
+			if ($portData['bindingType'] == $bindingType) {
+				// get binding
+				//foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
+				foreach(array_keys($this->bindings[ $portData['binding'] ]['operations']) as $bOperation) {
+					// note that we could/should also check the namespace here
+					if ($operation == $bOperation) {
+						$opData = $this->bindings[ $portData['binding'] ]['operations'][$operation];
+					    return $opData;
+					} 
+				} 
+			}
+		} 
+	}
+	
+	/**
+	 * returns an associative array of data necessary for calling an operation
+	 * 
+	 * @param string $soapAction soapAction for operation
+	 * @param string $bindingType type of binding eg: soap
+	 * @return array 
+	 * @access public 
+	 */
+	function getOperationDataForSoapAction($soapAction, $bindingType = 'soap') {
+		if ($bindingType == 'soap') {
+			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
+		}
+		// loop thru ports
+		foreach($this->ports as $port => $portData) {
+			// binding type of port matches parameter
+			if ($portData['bindingType'] == $bindingType) {
+				// loop through operations for the binding
+				foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
+					if ($opData['soapAction'] == $soapAction) {
+					    return $opData;
+					} 
+				} 
+			}
+		} 
+	}
+	
+	/**
+    * returns an array of information about a given type
+    * returns false if no type exists by the given name
+    *
+	*	 typeDef = array(
+	*	 'elements' => array(), // refs to elements array
+	*	'restrictionBase' => '',
+	*	'phpType' => '',
+	*	'order' => '(sequence|all)',
+	*	'attrs' => array() // refs to attributes array
+	*	)
+    *
+    * @param $type string the type
+    * @param $ns string namespace (not prefix) of the type
+    * @return mixed
+    * @access public
+    * @see xmlschema
+    */
+	function getTypeDef($type, $ns) {
+		$this->debug("in getTypeDef: type=$type, ns=$ns");
+		if ((! $ns) && isset($this->namespaces['tns'])) {
+			$ns = $this->namespaces['tns'];
+			$this->debug("in getTypeDef: type namespace forced to $ns");
+		}
+		if (isset($this->schemas[$ns])) {
+			$this->debug("in getTypeDef: have schema for namespace $ns");
+			for ($i = 0; $i < count($this->schemas[$ns]); $i++) {
+				$xs = &$this->schemas[$ns][$i];
+				$t = $xs->getTypeDef($type);
+				$this->appendDebug($xs->getDebug());
+				$xs->clearDebug();
+				if ($t) {
+					if (!isset($t['phpType'])) {
+						// get info for type to tack onto the element
+						$uqType = substr($t['type'], strrpos($t['type'], ':') + 1);
+						$ns = substr($t['type'], 0, strrpos($t['type'], ':'));
+						$etype = $this->getTypeDef($uqType, $ns);
+						if ($etype) {
+							$this->debug("found type for [element] $type:");
+							$this->debug($this->varDump($etype));
+							if (isset($etype['phpType'])) {
+								$t['phpType'] = $etype['phpType'];
+							}
+							if (isset($etype['elements'])) {
+								$t['elements'] = $etype['elements'];
+							}
+							if (isset($etype['attrs'])) {
+								$t['attrs'] = $etype['attrs'];
+							}
+						}
+					}
+					return $t;
+				}
+			}
+		} else {
+			$this->debug("in getTypeDef: do not have schema for namespace $ns");
+		}
+		return false;
+	}
+
+    /**
+    * prints html description of services
+    *
+    * @access private
+    */
+    function webDescription(){
+    	global $HTTP_SERVER_VARS;
+
+		if (isset($_SERVER)) {
+			$PHP_SELF = $_SERVER['PHP_SELF'];
+		} elseif (isset($HTTP_SERVER_VARS)) {
+			$PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
+		} else {
+			$this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available");
+		}
+
+		$b = '
+		<html><head><title>NuSOAP: '.$this->serviceName.'</title>
+		<style type="text/css">
+		    body    { font-family: arial; color: #000000; background-color: #ffffff; margin: 0px 0px 0px 0px; }
+		    p       { font-family: arial; color: #000000; margin-top: 0px; margin-bottom: 12px; }
+		    pre { background-color: silver; padding: 5px; font-family: Courier New; font-size: x-small; color: #000000;}
+		    ul      { margin-top: 10px; margin-left: 20px; }
+		    li      { list-style-type: none; margin-top: 10px; color: #000000; }
+		    .content{
+			margin-left: 0px; padding-bottom: 2em; }
+		    .nav {
+			padding-top: 10px; padding-bottom: 10px; padding-left: 15px; font-size: .70em;
+			margin-top: 10px; margin-left: 0px; color: #000000;
+			background-color: #ccccff; width: 20%; margin-left: 20px; margin-top: 20px; }
+		    .title {
+			font-family: arial; font-size: 26px; color: #ffffff;
+			background-color: #999999; width: 105%; margin-left: 0px;
+			padding-top: 10px; padding-bottom: 10px; padding-left: 15px;}
+		    .hidden {
+			position: absolute; visibility: hidden; z-index: 200; left: 250px; top: 100px;
+			font-family: arial; overflow: hidden; width: 600;
+			padding: 20px; font-size: 10px; background-color: #999999;
+			layer-background-color:#FFFFFF; }
+		    a,a:active  { color: charcoal; font-weight: bold; }
+		    a:visited   { color: #666666; font-weight: bold; }
+		    a:hover     { color: cc3300; font-weight: bold; }
+		</style>
+		<script language="JavaScript" type="text/javascript">
+		<!--
+		// POP-UP CAPTIONS...
+		function lib_bwcheck(){ //Browsercheck (needed)
+		    this.ver=navigator.appVersion
+		    this.agent=navigator.userAgent
+		    this.dom=document.getElementById?1:0
+		    this.opera5=this.agent.indexOf("Opera 5")>-1
+		    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
+		    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
+		    this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
+		    this.ie=this.ie4||this.ie5||this.ie6
+		    this.mac=this.agent.indexOf("Mac")>-1
+		    this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
+		    this.ns4=(document.layers && !this.dom)?1:0;
+		    this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
+		    return this
+		}
+		var bw = new lib_bwcheck()
+		//Makes crossbrowser object.
+		function makeObj(obj){
+		    this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
+		    if(!this.evnt) return false
+		    this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;
+		    this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;
+		    this.writeIt=b_writeIt;
+		    return this
+		}
+		// A unit of measure that will be added when setting the position of a layer.
+		//var px = bw.ns4||window.opera?"":"px";
+		function b_writeIt(text){
+		    if (bw.ns4){this.wref.write(text);this.wref.close()}
+		    else this.wref.innerHTML = text
+		}
+		//Shows the messages
+		var oDesc;
+		function popup(divid){
+		    if(oDesc = new makeObj(divid)){
+			oDesc.css.visibility = "visible"
+		    }
+		}
+		function popout(){ // Hides message
+		    if(oDesc) oDesc.css.visibility = "hidden"
+		}
+		//-->
+		</script>
+		</head>
+		<body>
+		<div class=content>
+			<br><br>
+			<div class=title>'.$this->serviceName.'</div>
+			<div class=nav>
+				<p>View the <a href="'.$PHP_SELF.'?wsdl">WSDL</a> for the service.
+				Click on an operation name to view it&apos;s details.</p>
+				<ul>';
+				foreach($this->getOperations() as $op => $data){
+				    $b .= "<li><a href='#' onclick=\"popout();popup('$op')\">$op</a></li>";
+				    // create hidden div
+				    $b .= "<div id='$op' class='hidden'>
+				    <a href='#' onclick='popout()'><font color='#ffffff'>Close</font></a><br><br>";
+				    foreach($data as $donnie => $marie){ // loop through opdata
+						if($donnie == 'input' || $donnie == 'output'){ // show input/output data
+						    $b .= "<font color='white'>".ucfirst($donnie).':</font><br>';
+						    foreach($marie as $captain => $tenille){ // loop through data
+								if($captain == 'parts'){ // loop thru parts
+								    $b .= "&nbsp;&nbsp;$captain:<br>";
+					                //if(is_array($tenille)){
+								    	foreach($tenille as $joanie => $chachi){
+											$b .= "&nbsp;&nbsp;&nbsp;&nbsp;$joanie: $chachi<br>";
+								    	}
+					        		//}
+								} else {
+								    $b .= "&nbsp;&nbsp;$captain: $tenille<br>";
+								}
+						    }
+						} else {
+						    $b .= "<font color='white'>".ucfirst($donnie).":</font> $marie<br>";
+						}
+				    }
+					$b .= '</div>';
+				}
+				$b .= '
+				<ul>
+			</div>
+		</div></body></html>';
+		return $b;
+    }
+
+	/**
+	* serialize the parsed wsdl
+	*
+	* @param mixed $debug whether to put debug=1 in endpoint URL
+	* @return string serialization of WSDL
+	* @access public 
+	*/
+	function serialize($debug = 0)
+	{
+		$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>';
+		$xml .= "\n<definitions";
+		foreach($this->namespaces as $k => $v) {
+			$xml .= " xmlns:$k=\"$v\"";
+		} 
+		// 10.9.02 - add poulter fix for wsdl and tns declarations
+		if (isset($this->namespaces['wsdl'])) {
+			$xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\"";
+		} 
+		if (isset($this->namespaces['tns'])) {
+			$xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\"";
+		} 
+		$xml .= '>'; 
+		// imports
+		if (sizeof($this->import) > 0) {
+			foreach($this->import as $ns => $list) {
+				foreach ($list as $ii) {
+					if ($ii['location'] != '') {
+						$xml .= '<import location="' . $ii['location'] . '" namespace="' . $ns . '" />';
+					} else {
+						$xml .= '<import namespace="' . $ns . '" />';
+					}
+				}
+			} 
+		} 
+		// types
+		if (count($this->schemas)>=1) {
+			$xml .= "\n<types>";
+			foreach ($this->schemas as $ns => $list) {
+				foreach ($list as $xs) {
+					$xml .= $xs->serializeSchema();
+				}
+			}
+			$xml .= '</types>';
+		} 
+		// messages
+		if (count($this->messages) >= 1) {
+			foreach($this->messages as $msgName => $msgParts) {
+				$xml .= "\n<message name=\"" . $msgName . '">';
+				if(is_array($msgParts)){
+					foreach($msgParts as $partName => $partType) {
+						// print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'<br>';
+						if (strpos($partType, ':')) {
+						    $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType));
+						} elseif (isset($this->typemap[$this->namespaces['xsd']][$partType])) {
+						    // print 'checking typemap: '.$this->XMLSchemaVersion.'<br>';
+						    $typePrefix = 'xsd';
+						} else {
+						    foreach($this->typemap as $ns => $types) {
+						        if (isset($types[$partType])) {
+						            $typePrefix = $this->getPrefixFromNamespace($ns);
+						        } 
+						    } 
+						    if (!isset($typePrefix)) {
+						        die("$partType has no namespace!");
+						    } 
+						}
+						$ns = $this->getNamespaceFromPrefix($typePrefix);
+						$typeDef = $this->getTypeDef($this->getLocalPart($partType), $ns);
+						if ($typeDef['typeClass'] == 'element') {
+							$elementortype = 'element';
+						} else {
+							$elementortype = 'type';
+						}
+						$xml .= '<part name="' . $partName . '" ' . $elementortype . '="' . $typePrefix . ':' . $this->getLocalPart($partType) . '" />';
+					}
+				}
+				$xml .= '</message>';
+			} 
+		} 
+		// bindings & porttypes
+		if (count($this->bindings) >= 1) {
+			$binding_xml = '';
+			$portType_xml = '';
+			foreach($this->bindings as $bindingName => $attrs) {
+				$binding_xml .= "\n<binding name=\"" . $bindingName . '" type="tns:' . $attrs['portType'] . '">';
+				$binding_xml .= '<soap:binding style="' . $attrs['style'] . '" transport="' . $attrs['transport'] . '"/>';
+				$portType_xml .= "\n<portType name=\"" . $attrs['portType'] . '">';
+				foreach($attrs['operations'] as $opName => $opParts) {
+					$binding_xml .= '<operation name="' . $opName . '">';
+					$binding_xml .= '<soap:operation soapAction="' . $opParts['soapAction'] . '" style="'. $opParts['style'] . '"/>';
+					if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') {
+						$enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
+					} else {
+						$enc_style = '';
+					}
+					$binding_xml .= '<input><soap:body use="' . $opParts['input']['use'] . '" namespace="' . $opParts['input']['namespace'] . '"' . $enc_style . '/></input>';
+					if (isset($opParts['output']['encodingStyle']) && $opParts['output']['encodingStyle'] != '') {
+						$enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"';
+					} else {
+						$enc_style = '';
+					}
+					$binding_xml .= '<output><soap:body use="' . $opParts['output']['use'] . '" namespace="' . $opParts['output']['namespace'] . '"' . $enc_style . '/></output>';
+					$binding_xml .= '</operation>';
+					$portType_xml .= '<operation name="' . $opParts['name'] . '"';
+					if (isset($opParts['parameterOrder'])) {
+					    $portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"';
+					} 
+					$portType_xml .= '>';
+					if(isset($opParts['documentation']) && $opParts['documentation'] != '') {
+						$portType_xml .= '<documentation>' . htmlspecialchars($opParts['documentation']) . '</documentation>';
+					}
+					$portType_xml .= '<input message="tns:' . $opParts['input']['message'] . '"/>';
+					$portType_xml .= '<output message="tns:' . $opParts['output']['message'] . '"/>';
+					$portType_xml .= '</operation>';
+				} 
+				$portType_xml .= '</portType>';
+				$binding_xml .= '</binding>';
+			} 
+			$xml .= $portType_xml . $binding_xml;
+		} 
+		// services
+		$xml .= "\n<service name=\"" . $this->serviceName . '">';
+		if (count($this->ports) >= 1) {
+			foreach($this->ports as $pName => $attrs) {
+				$xml .= '<port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">';
+				$xml .= '<soap:address location="' . $attrs['location'] . ($debug ? '?debug=1' : '') . '"/>';
+				$xml .= '</port>';
+			} 
+		} 
+		$xml .= '</service>';
+		return $xml . "\n</definitions>";
+	} 
+	
+	/**
+	 * serialize PHP values according to a WSDL message definition
+	 *
+	 * TODO
+	 * - multi-ref serialization
+	 * - validate PHP values against type definitions, return errors if invalid
+	 * 
+	 * @param string $operation operation name
+	 * @param string $direction (input|output)
+	 * @param mixed $parameters parameter value(s)
+	 * @return mixed parameters serialized as XML or false on error (e.g. operation not found)
+	 * @access public
+	 */
+	function serializeRPCParameters($operation, $direction, $parameters)
+	{
+		$this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); 
+		$this->appendDebug('parameters=' . $this->varDump($parameters));
+		
+		if ($direction != 'input' && $direction != 'output') {
+			$this->debug('The value of the \$direction argument needs to be either "input" or "output"');
+			$this->setError('The value of the \$direction argument needs to be either "input" or "output"');
+			return false;
+		} 
+		if (!$opData = $this->getOperationData($operation)) {
+			$this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
+			$this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
+			return false;
+		}
+		$this->debug('opData:');
+		$this->appendDebug($this->varDump($opData));
+
+		// Get encoding style for output and set to current
+		$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+		if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
+			$encodingStyle = $opData['output']['encodingStyle'];
+			$enc_style = $encodingStyle;
+		}
+
+		// set input params
+		$xml = '';
+		if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
+			
+			$use = $opData[$direction]['use'];
+			$this->debug('have ' . count($opData[$direction]['parts']) . ' part(s) to serialize');
+			if (is_array($parameters)) {
+				$parametersArrayType = $this->isArraySimpleOrStruct($parameters);
+				$this->debug('have ' . count($parameters) . ' parameter(s) provided as ' . $parametersArrayType . ' to serialize');
+				foreach($opData[$direction]['parts'] as $name => $type) {
+					$this->debug('serializing part "'.$name.'" of type "'.$type.'"');
+					// Track encoding style
+					if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
+						$encodingStyle = $opData[$direction]['encodingStyle'];			
+						$enc_style = $encodingStyle;
+					} else {
+						$enc_style = false;
+					}
+					// NOTE: add error handling here
+					// if serializeType returns false, then catch global error and fault
+					if ($parametersArrayType == 'arraySimple') {
+						$p = array_shift($parameters);
+						$this->debug('calling serializeType w/indexed param');
+						$xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
+					} elseif (isset($parameters[$name])) {
+						$this->debug('calling serializeType w/named param');
+						$xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
+					} else {
+						// TODO: only send nillable
+						$this->debug('calling serializeType w/null param');
+						$xml .= $this->serializeType($name, $type, null, $use, $enc_style);
+					}
+				}
+			} else {
+				$this->debug('no parameters passed.');
+			}
+		}
+		$this->debug("serializeRPCParameters returning: $xml");
+		return $xml;
+	} 
+	
+	/**
+	 * serialize a PHP value according to a WSDL message definition
+	 * 
+	 * TODO
+	 * - multi-ref serialization
+	 * - validate PHP values against type definitions, return errors if invalid
+	 * 
+	 * @param string $ type name
+	 * @param mixed $ param value
+	 * @return mixed new param or false if initial value didn't validate
+	 * @access public
+	 * @deprecated
+	 */
+	function serializeParameters($operation, $direction, $parameters)
+	{
+		$this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); 
+		$this->appendDebug('parameters=' . $this->varDump($parameters));
+		
+		if ($direction != 'input' && $direction != 'output') {
+			$this->debug('The value of the \$direction argument needs to be either "input" or "output"');
+			$this->setError('The value of the \$direction argument needs to be either "input" or "output"');
+			return false;
+		} 
+		if (!$opData = $this->getOperationData($operation)) {
+			$this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
+			$this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
+			return false;
+		}
+		$this->debug('opData:');
+		$this->appendDebug($this->varDump($opData));
+		
+		// Get encoding style for output and set to current
+		$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+		if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
+			$encodingStyle = $opData['output']['encodingStyle'];
+			$enc_style = $encodingStyle;
+		}
+		
+		// set input params
+		$xml = '';
+		if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
+			
+			$use = $opData[$direction]['use'];
+			$this->debug("use=$use");
+			$this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
+			if (is_array($parameters)) {
+				$parametersArrayType = $this->isArraySimpleOrStruct($parameters);
+				$this->debug('have ' . $parametersArrayType . ' parameters');
+				foreach($opData[$direction]['parts'] as $name => $type) {
+					$this->debug('serializing part "'.$name.'" of type "'.$type.'"');
+					// Track encoding style
+					if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
+						$encodingStyle = $opData[$direction]['encodingStyle'];			
+						$enc_style = $encodingStyle;
+					} else {
+						$enc_style = false;
+					}
+					// NOTE: add error handling here
+					// if serializeType returns false, then catch global error and fault
+					if ($parametersArrayType == 'arraySimple') {
+						$p = array_shift($parameters);
+						$this->debug('calling serializeType w/indexed param');
+						$xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
+					} elseif (isset($parameters[$name])) {
+						$this->debug('calling serializeType w/named param');
+						$xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
+					} else {
+						// TODO: only send nillable
+						$this->debug('calling serializeType w/null param');
+						$xml .= $this->serializeType($name, $type, null, $use, $enc_style);
+					}
+				}
+			} else {
+				$this->debug('no parameters passed.');
+			}
+		}
+		$this->debug("serializeParameters returning: $xml");
+		return $xml;
+	} 
+	
+	/**
+	 * serializes a PHP value according a given type definition
+	 * 
+	 * @param string $name name of value (part or element)
+	 * @param string $type XML schema type of value (type or element)
+	 * @param mixed $value a native PHP value (parameter value)
+	 * @param string $use use for part (encoded|literal)
+	 * @param string $encodingStyle SOAP encoding style for the value (if different than the enclosing style)
+	 * @param boolean $unqualified a kludge for what should be XML namespace form handling
+	 * @return string value serialized as an XML string
+	 * @access private
+	 */
+	function serializeType($name, $type, $value, $use='encoded', $encodingStyle=false, $unqualified=false)
+	{
+		$this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified"));
+		$this->appendDebug("value=" . $this->varDump($value));
+		if($use == 'encoded' && $encodingStyle) {
+			$encodingStyle = ' SOAP-ENV:encodingStyle="' . $encodingStyle . '"';
+		}
+
+		// if a soapval has been supplied, let its type override the WSDL
+    	if (is_object($value) && get_class($value) == 'soapval') {
+    		if ($value->type_ns) {
+    			$type = $value->type_ns . ':' . $value->type;
+		    	$forceType = true;
+		    	$this->debug("in serializeType: soapval overrides type to $type");
+    		} elseif ($value->type) {
+	    		$type = $value->type;
+		    	$forceType = true;
+		    	$this->debug("in serializeType: soapval overrides type to $type");
+	    	} else {
+	    		$forceType = false;
+		    	$this->debug("in serializeType: soapval does not override type");
+	    	}
+	    	$attrs = $value->attributes;
+	    	$value = $value->value;
+	    	$this->debug("in serializeType: soapval overrides value to $value");
+	    	if ($attrs) {
+	    		if (!is_array($value)) {
+	    			$value['!'] = $value;
+	    		}
+	    		foreach ($attrs as $n => $v) {
+	    			$value['!' . $n] = $v;
+	    		}
+		    	$this->debug("in serializeType: soapval provides attributes");
+		    }
+        } else {
+        	$forceType = false;
+        }
+
+		$xml = '';
+		if (strpos($type, ':')) {
+			$uqType = substr($type, strrpos($type, ':') + 1);
+			$ns = substr($type, 0, strrpos($type, ':'));
+			$this->debug("in serializeType: got a prefixed type: $uqType, $ns");
+			if ($this->getNamespaceFromPrefix($ns)) {
+				$ns = $this->getNamespaceFromPrefix($ns);
+				$this->debug("in serializeType: expanded prefixed type: $uqType, $ns");
+			}
+
+			if($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/'){
+				$this->debug('in serializeType: type namespace indicates XML Schema or SOAP Encoding type');
+				if ($unqualified  && $use == 'literal') {
+					$elementNS = " xmlns=\"\"";
+				} else {
+					$elementNS = '';
+				}
+				if (is_null($value)) {
+					if ($use == 'literal') {
+						// TODO: depends on minOccurs
+						$xml = "<$name$elementNS/>";
+					} else {
+						// TODO: depends on nillable, which should be checked before calling this method
+						$xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
+					}
+					$this->debug("in serializeType: returning: $xml");
+					return $xml;
+				}
+		    	if ($uqType == 'boolean') {
+		    		if ((is_string($value) && $value == 'false') || (! $value)) {
+						$value = 'false';
+					} else {
+						$value = 'true';
+					}
+				} 
+				if ($uqType == 'string' && gettype($value) == 'string') {
+					$value = $this->expandEntities($value);
+				}
+				if (($uqType == 'long' || $uqType == 'unsignedLong') && gettype($value) == 'double') {
+					$value = sprintf("%.0lf", $value);
+				}
+				// it's a scalar
+				// TODO: what about null/nil values?
+				// check type isn't a custom type extending xmlschema namespace
+				if (!$this->getTypeDef($uqType, $ns)) {
+					if ($use == 'literal') {
+						if ($forceType) {
+							$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
+						} else {
+							$xml = "<$name$elementNS>$value</$name>";
+						}
+					} else {
+						$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
+					}
+					$this->debug("in serializeType: returning: $xml");
+					return $xml;
+				}
+				$this->debug('custom type extends XML Schema or SOAP Encoding namespace (yuck)');
+			} else if ($ns == 'http://xml.apache.org/xml-soap') {
+				$this->debug('in serializeType: appears to be Apache SOAP type');
+				if ($uqType == 'Map') {
+					$tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
+					if (! $tt_prefix) {
+						$this->debug('in serializeType: Add namespace for Apache SOAP type');
+						$tt_prefix = 'ns' . rand(1000, 9999);
+						$this->namespaces[$tt_prefix] = 'http://xml.apache.org/xml-soap';
+						// force this to be added to usedNamespaces
+						$tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
+					}
+					$contents = '';
+					foreach($value as $k => $v) {
+						$this->debug("serializing map element: key $k, value $v");
+						$contents .= '<item>';
+						$contents .= $this->serialize_val($k,'key',false,false,false,false,$use);
+						$contents .= $this->serialize_val($v,'value',false,false,false,false,$use);
+						$contents .= '</item>';
+					}
+					if ($use == 'literal') {
+						if ($forceType) {
+							$xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\">$contents</$name>";
+						} else {
+							$xml = "<$name>$contents</$name>";
+						}
+					} else {
+						$xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\"$encodingStyle>$contents</$name>";
+					}
+					$this->debug("in serializeType: returning: $xml");
+					return $xml;
+				}
+				$this->debug('in serializeType: Apache SOAP type, but only support Map');
+			}
+		} else {
+			// TODO: should the type be compared to types in XSD, and the namespace
+			// set to XSD if the type matches?
+			$this->debug("in serializeType: No namespace for type $type");
+			$ns = '';
+			$uqType = $type;
+		}
+		if(!$typeDef = $this->getTypeDef($uqType, $ns)){
+			$this->setError("$type ($uqType) is not a supported type.");
+			$this->debug("in serializeType: $type ($uqType) is not a supported type.");
+			return false;
+		} else {
+			$this->debug("in serializeType: found typeDef");
+			$this->appendDebug('typeDef=' . $this->varDump($typeDef));
+		}
+		$phpType = $typeDef['phpType'];
+		$this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); 
+		// if php type == struct, map value to the <all> element names
+		if ($phpType == 'struct') {
+			if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') {
+				$elementName = $uqType;
+				if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
+					$elementNS = " xmlns=\"$ns\"";
+				} else {
+					$elementNS = " xmlns=\"\"";
+				}
+			} else {
+				$elementName = $name;
+				if ($unqualified) {
+					$elementNS = " xmlns=\"\"";
+				} else {
+					$elementNS = '';
+				}
+			}
+			if (is_null($value)) {
+				if ($use == 'literal') {
+					// TODO: depends on minOccurs
+					$xml = "<$elementName$elementNS/>";
+				} else {
+					$xml = "<$elementName$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
+				}
+				$this->debug("in serializeType: returning: $xml");
+				return $xml;
+			}
+			if (is_object($value)) {
+				$value = get_object_vars($value);
+			}
+			if (is_array($value)) {
+				$elementAttrs = $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
+				if ($use == 'literal') {
+					if ($forceType) {
+						$xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">";
+					} else {
+						$xml = "<$elementName$elementNS$elementAttrs>";
+					}
+				} else {
+					$xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>";
+				}
+	
+				$xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle);
+				$xml .= "</$elementName>";
+			} else {
+				$this->debug("in serializeType: phpType is struct, but value is not an array");
+				$this->setError("phpType is struct, but value is not an array: see debug output for details");
+				$xml = '';
+			}
+		} elseif ($phpType == 'array') {
+			if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
+				$elementNS = " xmlns=\"$ns\"";
+			} else {
+				if ($unqualified) {
+					$elementNS = " xmlns=\"\"";
+				} else {
+					$elementNS = '';
+				}
+			}
+			if (is_null($value)) {
+				if ($use == 'literal') {
+					// TODO: depends on minOccurs
+					$xml = "<$name$elementNS/>";
+				} else {
+					$xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" .
+						$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
+						":Array\" " .
+						$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
+						':arrayType="' .
+						$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) .
+						':' .
+						$this->getLocalPart($typeDef['arrayType'])."[0]\"/>";
+				}
+				$this->debug("in serializeType: returning: $xml");
+				return $xml;
+			}
+			if (isset($typeDef['multidimensional'])) {
+				$nv = array();
+				foreach($value as $v) {
+					$cols = ',' . sizeof($v);
+					$nv = array_merge($nv, $v);
+				} 
+				$value = $nv;
+			} else {
+				$cols = '';
+			} 
+			if (is_array($value) && sizeof($value) >= 1) {
+				$rows = sizeof($value);
+				$contents = '';
+				foreach($value as $k => $v) {
+					$this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]");
+					//if (strpos($typeDef['arrayType'], ':') ) {
+					if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) {
+					    $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);
+					} else {
+					    $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use);
+					} 
+				}
+			} else {
+				$rows = 0;
+				$contents = null;
+			}
+			// TODO: for now, an empty value will be serialized as a zero element
+			// array.  Revisit this when coding the handling of null/nil values.
+			if ($use == 'literal') {
+				$xml = "<$name$elementNS>"
+					.$contents
+					."</$name>";
+			} else {
+				$xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/').':Array" '.
+					$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/')
+					.':arrayType="'
+					.$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType']))
+					.":".$this->getLocalPart($typeDef['arrayType'])."[$rows$cols]\">"
+					.$contents
+					."</$name>";
+			}
+		} elseif ($phpType == 'scalar') {
+			if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
+				$elementNS = " xmlns=\"$ns\"";
+			} else {
+				if ($unqualified) {
+					$elementNS = " xmlns=\"\"";
+				} else {
+					$elementNS = '';
+				}
+			}
+			if ($use == 'literal') {
+				if ($forceType) {
+					$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
+				} else {
+					$xml = "<$name$elementNS>$value</$name>";
+				}
+			} else {
+				$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
+			}
+		}
+		$this->debug("in serializeType: returning: $xml");
+		return $xml;
+	}
+	
+	/**
+	 * serializes the attributes for a complexType
+	 *
+	 * @param array $typeDef our internal representation of an XML schema type (or element)
+	 * @param mixed $value a native PHP value (parameter value)
+	 * @param string $ns the namespace of the type
+	 * @param string $uqType the local part of the type
+	 * @return string value serialized as an XML string
+	 * @access private
+	 */
+	function serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType) {
+		$xml = '';
+		if (isset($typeDef['attrs']) && is_array($typeDef['attrs'])) {
+			$this->debug("serialize attributes for XML Schema type $ns:$uqType");
+			if (is_array($value)) {
+				$xvalue = $value;
+			} elseif (is_object($value)) {
+				$xvalue = get_object_vars($value);
+			} else {
+				$this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
+				$xvalue = array();
+			}
+			foreach ($typeDef['attrs'] as $aName => $attrs) {
+				if (isset($xvalue['!' . $aName])) {
+					$xname = '!' . $aName;
+					$this->debug("value provided for attribute $aName with key $xname");
+				} elseif (isset($xvalue[$aName])) {
+					$xname = $aName;
+					$this->debug("value provided for attribute $aName with key $xname");
+				} elseif (isset($attrs['default'])) {
+					$xname = '!' . $aName;
+					$xvalue[$xname] = $attrs['default'];
+					$this->debug('use default value of ' . $xvalue[$aName] . ' for attribute ' . $aName);
+				} else {
+					$xname = '';
+					$this->debug("no value provided for attribute $aName");
+				}
+				if ($xname) {
+					$xml .=  " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\"";
+				}
+			} 
+		} else {
+			$this->debug("no attributes to serialize for XML Schema type $ns:$uqType");
+		}
+		if (isset($typeDef['extensionBase'])) {
+			$ns = $this->getPrefix($typeDef['extensionBase']);
+			$uqType = $this->getLocalPart($typeDef['extensionBase']);
+			if ($this->getNamespaceFromPrefix($ns)) {
+				$ns = $this->getNamespaceFromPrefix($ns);
+			}
+			if ($typeDef = $this->getTypeDef($uqType, $ns)) {
+				$this->debug("serialize attributes for extension base $ns:$uqType");
+				$xml .= $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
+			} else {
+				$this->debug("extension base $ns:$uqType is not a supported type");
+			}
+		}
+		return $xml;
+	}
+
+	/**
+	 * serializes the elements for a complexType
+	 *
+	 * @param array $typeDef our internal representation of an XML schema type (or element)
+	 * @param mixed $value a native PHP value (parameter value)
+	 * @param string $ns the namespace of the type
+	 * @param string $uqType the local part of the type
+	 * @param string $use use for part (encoded|literal)
+	 * @param string $encodingStyle SOAP encoding style for the value (if different than the enclosing style)
+	 * @return string value serialized as an XML string
+	 * @access private
+	 */
+	function serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false) {
+		$xml = '';
+		if (isset($typeDef['elements']) && is_array($typeDef['elements'])) {
+			$this->debug("in serializeComplexTypeElements, serialize elements for XML Schema type $ns:$uqType");
+			if (is_array($value)) {
+				$xvalue = $value;
+			} elseif (is_object($value)) {
+				$xvalue = get_object_vars($value);
+			} else {
+				$this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
+				$xvalue = array();
+			}
+			// toggle whether all elements are present - ideally should validate against schema
+			if (count($typeDef['elements']) != count($xvalue)){
+				$optionals = true;
+			}
+			foreach ($typeDef['elements'] as $eName => $attrs) {
+				if (!isset($xvalue[$eName])) {
+					if (isset($attrs['default'])) {
+						$xvalue[$eName] = $attrs['default'];
+						$this->debug('use default value of ' . $xvalue[$eName] . ' for element ' . $eName);
+					}
+				}
+				// if user took advantage of a minOccurs=0, then only serialize named parameters
+				if (isset($optionals)
+				    && (!isset($xvalue[$eName])) 
+					&& ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
+					){
+					if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') {
+						$this->debug("apparent error: no value provided for element $eName with minOccurs=" . $attrs['minOccurs']);
+					}
+					// do nothing
+					$this->debug("no value provided for complexType element $eName and element is not nillable, so serialize nothing");
+				} else {
+					// get value
+					if (isset($xvalue[$eName])) {
+					    $v = $xvalue[$eName];
+					} else {
+					    $v = null;
+					}
+					if (isset($attrs['form'])) {
+						$unqualified = ($attrs['form'] == 'unqualified');
+					} else {
+						$unqualified = false;
+					}
+					if (isset($attrs['maxOccurs']) && ($attrs['maxOccurs'] == 'unbounded' || $attrs['maxOccurs'] > 1) && isset($v) && is_array($v) && $this->isArraySimpleOrStruct($v) == 'arraySimple') {
+						$vv = $v;
+						foreach ($vv as $k => $v) {
+							if (isset($attrs['type']) || isset($attrs['ref'])) {
+								// serialize schema-defined type
+							    $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
+							} else {
+								// serialize generic type (can this ever really happen?)
+							    $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
+							    $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
+							}
+						}
+					} else {
+						if (isset($attrs['type']) || isset($attrs['ref'])) {
+							// serialize schema-defined type
+						    $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
+						} else {
+							// serialize generic type (can this ever really happen?)
+						    $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
+						    $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
+						}
+					}
+				}
+			} 
+		} else {
+			$this->debug("no elements to serialize for XML Schema type $ns:$uqType");
+		}
+		if (isset($typeDef['extensionBase'])) {
+			$ns = $this->getPrefix($typeDef['extensionBase']);
+			$uqType = $this->getLocalPart($typeDef['extensionBase']);
+			if ($this->getNamespaceFromPrefix($ns)) {
+				$ns = $this->getNamespaceFromPrefix($ns);
+			}
+			if ($typeDef = $this->getTypeDef($uqType, $ns)) {
+				$this->debug("serialize elements for extension base $ns:$uqType");
+				$xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle);
+			} else {
+				$this->debug("extension base $ns:$uqType is not a supported type");
+			}
+		}
+		return $xml;
+	}
+
+	/**
+	* adds an XML Schema complex type to the WSDL types
+	*
+	* @param string	name
+	* @param string typeClass (complexType|simpleType|attribute)
+	* @param string phpType: currently supported are array and struct (php assoc array)
+	* @param string compositor (all|sequence|choice)
+	* @param string restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
+	* @param array elements = array ( name => array(name=>'',type=>'') )
+	* @param array attrs = 	array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]'))
+	* @param string arrayType: namespace:name (xsd:string)
+	* @see xmlschema
+	* @access public
+	*/
+	function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType='') {
+		if (count($elements) > 0) {
+	    	foreach($elements as $n => $e){
+	            // expand each element
+	            foreach ($e as $k => $v) {
+		            $k = strpos($k,':') ? $this->expandQname($k) : $k;
+		            $v = strpos($v,':') ? $this->expandQname($v) : $v;
+		            $ee[$k] = $v;
+		    	}
+	    		$eElements[$n] = $ee;
+	    	}
+	    	$elements = $eElements;
+		}
+		
+		if (count($attrs) > 0) {
+	    	foreach($attrs as $n => $a){
+	            // expand each attribute
+	            foreach ($a as $k => $v) {
+		            $k = strpos($k,':') ? $this->expandQname($k) : $k;
+		            $v = strpos($v,':') ? $this->expandQname($v) : $v;
+		            $aa[$k] = $v;
+		    	}
+	    		$eAttrs[$n] = $aa;
+	    	}
+	    	$attrs = $eAttrs;
+		}
+
+		$restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
+		$arrayType = strpos($arrayType,':') ? $this->expandQname($arrayType) : $arrayType;
+
+		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
+		$this->schemas[$typens][0]->addComplexType($name,$typeClass,$phpType,$compositor,$restrictionBase,$elements,$attrs,$arrayType);
+	}
+
+	/**
+	* adds an XML Schema simple type to the WSDL types
+	*
+	* @param string $name
+	* @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
+	* @param string $typeClass (should always be simpleType)
+	* @param string $phpType (should always be scalar)
+	* @param array $enumeration array of values
+	* @see xmlschema
+	* @access public
+	*/
+	function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) {
+		$restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
+
+		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
+		$this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType, $enumeration);
+	}
+
+	/**
+	* adds an element to the WSDL types
+	*
+	* @param array $attrs attributes that must include name and type
+	* @see xmlschema
+	* @access public
+	*/
+	function addElement($attrs) {
+		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
+		$this->schemas[$typens][0]->addElement($attrs);
+	}
+
+	/**
+	* register an operation with the server
+	* 
+	* @param string $name operation (method) name
+	* @param array $in assoc array of input values: key = param name, value = param type
+	* @param array $out assoc array of output values: key = param name, value = param type
+	* @param string $namespace optional The namespace for the operation
+	* @param string $soapaction optional The soapaction for the operation
+	* @param string $style (rpc|document) optional The style for the operation Note: when 'document' is specified, parameter and return wrappers are created for you automatically
+	* @param string $use (encoded|literal) optional The use for the parameters (cannot mix right now)
+	* @param string $documentation optional The description to include in the WSDL
+	* @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
+	* @access public 
+	*/
+	function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){
+		if ($use == 'encoded' && $encodingStyle == '') {
+			$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+		}
+
+		if ($style == 'document') {
+			$elements = array();
+			foreach ($in as $n => $t) {
+				$elements[$n] = array('name' => $n, 'type' => $t);
+			}
+			$this->addComplexType($name . 'RequestType', 'complexType', 'struct', 'all', '', $elements);
+			$this->addElement(array('name' => $name, 'type' => $name . 'RequestType'));
+			$in = array('parameters' => 'tns:' . $name);
+
+			$elements = array();
+			foreach ($out as $n => $t) {
+				$elements[$n] = array('name' => $n, 'type' => $t);
+			}
+			$this->addComplexType($name . 'ResponseType', 'complexType', 'struct', 'all', '', $elements);
+			$this->addElement(array('name' => $name . 'Response', 'type' => $name . 'ResponseType'));
+			$out = array('parameters' => 'tns:' . $name . 'Response');
+		}
+
+		// get binding
+		$this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] =
+		array(
+		'name' => $name,
+		'binding' => $this->serviceName . 'Binding',
+		'endpoint' => $this->endpoint,
+		'soapAction' => $soapaction,
+		'style' => $style,
+		'input' => array(
+			'use' => $use,
+			'namespace' => $namespace,
+			'encodingStyle' => $encodingStyle,
+			'message' => $name . 'Request',
+			'parts' => $in),
+		'output' => array(
+			'use' => $use,
+			'namespace' => $namespace,
+			'encodingStyle' => $encodingStyle,
+			'message' => $name . 'Response',
+			'parts' => $out),
+		'namespace' => $namespace,
+		'transport' => 'http://schemas.xmlsoap.org/soap/http',
+		'documentation' => $documentation); 
+		// add portTypes
+		// add messages
+		if($in)
+		{
+			foreach($in as $pName => $pType)
+			{
+				if(strpos($pType,':')) {
+					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
+				}
+				$this->messages[$name.'Request'][$pName] = $pType;
+			}
+		} else {
+            $this->messages[$name.'Request']= '0';
+        }
+		if($out)
+		{
+			foreach($out as $pName => $pType)
+			{
+				if(strpos($pType,':')) {
+					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
+				}
+				$this->messages[$name.'Response'][$pName] = $pType;
+			}
+		} else {
+            $this->messages[$name.'Response']= '0';
+        }
+		return true;
+	} 
+}
+?><?php
+
+
+
+/**
+*
+* soap_parser class parses SOAP XML messages into native PHP values
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class soap_parser extends nusoap_base {
+
+	var $xml = '';
+	var $xml_encoding = '';
+	var $method = '';
+	var $root_struct = '';
+	var $root_struct_name = '';
+	var $root_struct_namespace = '';
+	var $root_header = '';
+    var $document = '';			// incoming SOAP body (text)
+	// determines where in the message we are (envelope,header,body,method)
+	var $status = '';
+	var $position = 0;
+	var $depth = 0;
+	var $default_namespace = '';
+	var $namespaces = array();
+	var $message = array();
+    var $parent = '';
+	var $fault = false;
+	var $fault_code = '';
+	var $fault_str = '';
+	var $fault_detail = '';
+	var $depth_array = array();
+	var $debug_flag = true;
+	var $soapresponse = NULL;
+	var $responseHeaders = '';	// incoming SOAP headers (text)
+	var $body_position = 0;
+	// for multiref parsing:
+	// array of id => pos
+	var $ids = array();
+	// array of id => hrefs => pos
+	var $multirefs = array();
+	// toggle for auto-decoding element content
+	var $decode_utf8 = true;
+
+	/**
+	* constructor that actually does the parsing
+	*
+	* @param    string $xml SOAP message
+	* @param    string $encoding character encoding scheme of message
+	* @param    string $method method for which XML is parsed (unused?)
+	* @param    string $decode_utf8 whether to decode UTF-8 to ISO-8859-1
+	* @access   public
+	*/
+	function soap_parser($xml,$encoding='UTF-8',$method='',$decode_utf8=true){
+		parent::nusoap_base();
+		$this->xml = $xml;
+		$this->xml_encoding = $encoding;
+		$this->method = $method;
+		$this->decode_utf8 = $decode_utf8;
+
+		// Check whether content has been read.
+		if(!empty($xml)){
+			// Check XML encoding
+			$pos_xml = strpos($xml, '<?xml');
+			if ($pos_xml !== FALSE) {
+				$xml_decl = substr($xml, $pos_xml, strpos($xml, '?>', $pos_xml + 2) - $pos_xml + 1);
+				if (preg_match("/encoding=[\"']([^\"']*)[\"']/", $xml_decl, $res)) {
+					$xml_encoding = $res[1];
+					if (strtoupper($xml_encoding) != $encoding) {
+						$err = "Charset from HTTP Content-Type '" . $encoding . "' does not match encoding from XML declaration '" . $xml_encoding . "'";
+						$this->debug($err);
+						if ($encoding != 'ISO-8859-1' || strtoupper($xml_encoding) != 'UTF-8') {
+							$this->setError($err);
+							return;
+						}
+						// when HTTP says ISO-8859-1 (the default) and XML says UTF-8 (the typical), assume the other endpoint is just sloppy and proceed
+					} else {
+						$this->debug('Charset from HTTP Content-Type matches encoding from XML declaration');
+					}
+				} else {
+					$this->debug('No encoding specified in XML declaration');
+				}
+			} else {
+				$this->debug('No XML declaration');
+			}
+			$this->debug('Entering soap_parser(), length='.strlen($xml).', encoding='.$encoding);
+			// Create an XML parser - why not xml_parser_create_ns?
+			$this->parser = xml_parser_create($this->xml_encoding);
+			// Set the options for parsing the XML data.
+			//xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
+			xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
+			xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->xml_encoding);
+			// Set the object for the parser.
+			xml_set_object($this->parser, $this);
+			// Set the element handlers for the parser.
+			xml_set_element_handler($this->parser, 'start_element','end_element');
+			xml_set_character_data_handler($this->parser,'character_data');
+
+			// Parse the XML file.
+			if(!xml_parse($this->parser,$xml,true)){
+			    // Display an error message.
+			    $err = sprintf('XML error parsing SOAP payload on line %d: %s',
+			    xml_get_current_line_number($this->parser),
+			    xml_error_string(xml_get_error_code($this->parser)));
+				$this->debug($err);
+				$this->debug("XML payload:\n" . $xml);
+				$this->setError($err);
+			} else {
+				$this->debug('parsed successfully, found root struct: '.$this->root_struct.' of name '.$this->root_struct_name);
+				// get final value
+				$this->soapresponse = $this->message[$this->root_struct]['result'];
+				// get header value: no, because this is documented as XML string
+//				if($this->root_header != '' && isset($this->message[$this->root_header]['result'])){
+//					$this->responseHeaders = $this->message[$this->root_header]['result'];
+//				}
+				// resolve hrefs/ids
+				if(sizeof($this->multirefs) > 0){
+					foreach($this->multirefs as $id => $hrefs){
+						$this->debug('resolving multirefs for id: '.$id);
+						$idVal = $this->buildVal($this->ids[$id]);
+						if (is_array($idVal) && isset($idVal['!id'])) {
+							unset($idVal['!id']);
+						}
+						foreach($hrefs as $refPos => $ref){
+							$this->debug('resolving href at pos '.$refPos);
+							$this->multirefs[$id][$refPos] = $idVal;
+						}
+					}
+				}
+			}
+			xml_parser_free($this->parser);
+		} else {
+			$this->debug('xml was empty, didn\'t parse!');
+			$this->setError('xml was empty, didn\'t parse!');
+		}
+	}
+
+	/**
+	* start-element handler
+	*
+	* @param    resource $parser XML parser object
+	* @param    string $name element name
+	* @param    array $attrs associative array of attributes
+	* @access   private
+	*/
+	function start_element($parser, $name, $attrs) {
+		// position in a total number of elements, starting from 0
+		// update class level pos
+		$pos = $this->position++;
+		// and set mine
+		$this->message[$pos] = array('pos' => $pos,'children'=>'','cdata'=>'');
+		// depth = how many levels removed from root?
+		// set mine as current global depth and increment global depth value
+		$this->message[$pos]['depth'] = $this->depth++;
+
+		// else add self as child to whoever the current parent is
+		if($pos != 0){
+			$this->message[$this->parent]['children'] .= '|'.$pos;
+		}
+		// set my parent
+		$this->message[$pos]['parent'] = $this->parent;
+		// set self as current parent
+		$this->parent = $pos;
+		// set self as current value for this depth
+		$this->depth_array[$this->depth] = $pos;
+		// get element prefix
+		if(strpos($name,':')){
+			// get ns prefix
+			$prefix = substr($name,0,strpos($name,':'));
+			// get unqualified name
+			$name = substr(strstr($name,':'),1);
+		}
+		// set status
+		if($name == 'Envelope'){
+			$this->status = 'envelope';
+		} elseif($name == 'Header'){
+			$this->root_header = $pos;
+			$this->status = 'header';
+		} elseif($name == 'Body'){
+			$this->status = 'body';
+			$this->body_position = $pos;
+		// set method
+		} elseif($this->status == 'body' && $pos == ($this->body_position+1)){
+			$this->status = 'method';
+			$this->root_struct_name = $name;
+			$this->root_struct = $pos;
+			$this->message[$pos]['type'] = 'struct';
+			$this->debug("found root struct $this->root_struct_name, pos $this->root_struct");
+		}
+		// set my status
+		$this->message[$pos]['status'] = $this->status;
+		// set name
+		$this->message[$pos]['name'] = htmlspecialchars($name);
+		// set attrs
+		$this->message[$pos]['attrs'] = $attrs;
+
+		// loop through atts, logging ns and type declarations
+        $attstr = '';
+		foreach($attrs as $key => $value){
+        	$key_prefix = $this->getPrefix($key);
+			$key_localpart = $this->getLocalPart($key);
+			// if ns declarations, add to class level array of valid namespaces
+            if($key_prefix == 'xmlns'){
+				if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
+					$this->XMLSchemaVersion = $value;
+					$this->namespaces['xsd'] = $this->XMLSchemaVersion;
+					$this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
+				}
+                $this->namespaces[$key_localpart] = $value;
+				// set method namespace
+				if($name == $this->root_struct_name){
+					$this->methodNamespace = $value;
+				}
+			// if it's a type declaration, set type
+            } elseif($key_localpart == 'type'){
+            	$value_prefix = $this->getPrefix($value);
+                $value_localpart = $this->getLocalPart($value);
+				$this->message[$pos]['type'] = $value_localpart;
+				$this->message[$pos]['typePrefix'] = $value_prefix;
+                if(isset($this->namespaces[$value_prefix])){
+                	$this->message[$pos]['type_namespace'] = $this->namespaces[$value_prefix];
+                } else if(isset($attrs['xmlns:'.$value_prefix])) {
+					$this->message[$pos]['type_namespace'] = $attrs['xmlns:'.$value_prefix];
+                }
+				// should do something here with the namespace of specified type?
+			} elseif($key_localpart == 'arrayType'){
+				$this->message[$pos]['type'] = 'array';
+				/* do arrayType ereg here
+				[1]    arrayTypeValue    ::=    atype asize
+				[2]    atype    ::=    QName rank*
+				[3]    rank    ::=    '[' (',')* ']'
+				[4]    asize    ::=    '[' length~ ']'
+				[5]    length    ::=    nextDimension* Digit+
+				[6]    nextDimension    ::=    Digit+ ','
+				*/
+				$expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
+				if(ereg($expr,$value,$regs)){
+					$this->message[$pos]['typePrefix'] = $regs[1];
+					$this->message[$pos]['arrayTypePrefix'] = $regs[1];
+	                if (isset($this->namespaces[$regs[1]])) {
+	                	$this->message[$pos]['arrayTypeNamespace'] = $this->namespaces[$regs[1]];
+	                } else if (isset($attrs['xmlns:'.$regs[1]])) {
+						$this->message[$pos]['arrayTypeNamespace'] = $attrs['xmlns:'.$regs[1]];
+	                }
+					$this->message[$pos]['arrayType'] = $regs[2];
+					$this->message[$pos]['arraySize'] = $regs[3];
+					$this->message[$pos]['arrayCols'] = $regs[4];
+				}
+			// specifies nil value (or not)
+			} elseif ($key_localpart == 'nil'){
+				$this->message[$pos]['nil'] = ($value == 'true' || $value == '1');
+			// some other attribute
+			} elseif ($key != 'href' && $key != 'xmlns' && $key_localpart != 'encodingStyle' && $key_localpart != 'root') {
+				$this->message[$pos]['xattrs']['!' . $key] = $value;
+			}
+
+			if ($key == 'xmlns') {
+				$this->default_namespace = $value;
+			}
+			// log id
+			if($key == 'id'){
+				$this->ids[$value] = $pos;
+			}
+			// root
+			if($key_localpart == 'root' && $value == 1){
+				$this->status = 'method';
+				$this->root_struct_name = $name;
+				$this->root_struct = $pos;
+				$this->debug("found root struct $this->root_struct_name, pos $pos");
+			}
+            // for doclit
+            $attstr .= " $key=\"$value\"";
+		}
+        // get namespace - must be done after namespace atts are processed
+		if(isset($prefix)){
+			$this->message[$pos]['namespace'] = $this->namespaces[$prefix];
+			$this->default_namespace = $this->namespaces[$prefix];
+		} else {
+			$this->message[$pos]['namespace'] = $this->default_namespace;
+		}
+        if($this->status == 'header'){
+        	if ($this->root_header != $pos) {
+	        	$this->responseHeaders .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>";
+	        }
+        } elseif($this->root_struct_name != ''){
+        	$this->document .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>";
+        }
+	}
+
+	/**
+	* end-element handler
+	*
+	* @param    resource $parser XML parser object
+	* @param    string $name element name
+	* @access   private
+	*/
+	function end_element($parser, $name) {
+		// position of current element is equal to the last value left in depth_array for my depth
+		$pos = $this->depth_array[$this->depth--];
+
+        // get element prefix
+		if(strpos($name,':')){
+			// get ns prefix
+			$prefix = substr($name,0,strpos($name,':'));
+			// get unqualified name
+			$name = substr(strstr($name,':'),1);
+		}
+		
+		// build to native type
+		if(isset($this->body_position) && $pos > $this->body_position){
+			// deal w/ multirefs
+			if(isset($this->message[$pos]['attrs']['href'])){
+				// get id
+				$id = substr($this->message[$pos]['attrs']['href'],1);
+				// add placeholder to href array
+				$this->multirefs[$id][$pos] = 'placeholder';
+				// add set a reference to it as the result value
+				$this->message[$pos]['result'] =& $this->multirefs[$id][$pos];
+            // build complexType values
+			} elseif($this->message[$pos]['children'] != ''){
+				// if result has already been generated (struct/array)
+				if(!isset($this->message[$pos]['result'])){
+					$this->message[$pos]['result'] = $this->buildVal($pos);
+				}
+			// build complexType values of attributes and possibly simpleContent
+			} elseif (isset($this->message[$pos]['xattrs'])) {
+				if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) {
+					$this->message[$pos]['xattrs']['!'] = null;
+				} elseif (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') {
+	            	if (isset($this->message[$pos]['type'])) {
+						$this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
+					} else {
+						$parent = $this->message[$pos]['parent'];
+						if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
+							$this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
+						} else {
+							$this->message[$pos]['xattrs']['!'] = $this->message[$pos]['cdata'];
+						}
+					}
+				}
+				$this->message[$pos]['result'] = $this->message[$pos]['xattrs'];
+			// set value of simpleType (or nil complexType)
+			} else {
+            	//$this->debug('adding data for scalar value '.$this->message[$pos]['name'].' of value '.$this->message[$pos]['cdata']);
+				if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) {
+					$this->message[$pos]['xattrs']['!'] = null;
+				} elseif (isset($this->message[$pos]['type'])) {
+					$this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
+				} else {
+					$parent = $this->message[$pos]['parent'];
+					if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
+						$this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
+					} else {
+						$this->message[$pos]['result'] = $this->message[$pos]['cdata'];
+					}
+				}
+
+				/* add value to parent's result, if parent is struct/array
+				$parent = $this->message[$pos]['parent'];
+				if($this->message[$parent]['type'] != 'map'){
+					if(strtolower($this->message[$parent]['type']) == 'array'){
+						$this->message[$parent]['result'][] = $this->message[$pos]['result'];
+					} else {
+						$this->message[$parent]['result'][$this->message[$pos]['name']] = $this->message[$pos]['result'];
+					}
+				}
+				*/
+			}
+		}
+		
+        // for doclit
+        if($this->status == 'header'){
+        	if ($this->root_header != $pos) {
+	        	$this->responseHeaders .= "</" . (isset($prefix) ? $prefix . ':' : '') . "$name>";
+	        }
+        } elseif($pos >= $this->root_struct){
+        	$this->document .= "</" . (isset($prefix) ? $prefix . ':' : '') . "$name>";
+        }
+		// switch status
+		if($pos == $this->root_struct){
+			$this->status = 'body';
+			$this->root_struct_namespace = $this->message[$pos]['namespace'];
+		} elseif($name == 'Body'){
+			$this->status = 'envelope';
+		 } elseif($name == 'Header'){
+			$this->status = 'envelope';
+		} elseif($name == 'Envelope'){
+			//
+		}
+		// set parent back to my parent
+		$this->parent = $this->message[$pos]['parent'];
+	}
+
+	/**
+	* element content handler
+	*
+	* @param    resource $parser XML parser object
+	* @param    string $data element content
+	* @access   private
+	*/
+	function character_data($parser, $data){
+		$pos = $this->depth_array[$this->depth];
+		if ($this->xml_encoding=='UTF-8'){
+			// TODO: add an option to disable this for folks who want
+			// raw UTF-8 that, e.g., might not map to iso-8859-1
+			// TODO: this can also be handled with xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1");
+			if($this->decode_utf8){
+				$data = utf8_decode($data);
+			}
+		}
+        $this->message[$pos]['cdata'] .= $data;
+        // for doclit
+        if($this->status == 'header'){
+        	$this->responseHeaders .= $data;
+        } else {
+        	$this->document .= $data;
+        }
+	}
+
+	/**
+	* get the parsed message
+	*
+	* @return	mixed
+	* @access   public
+	*/
+	function get_response(){
+		return $this->soapresponse;
+	}
+
+	/**
+	* get the parsed headers
+	*
+	* @return	string XML or empty if no headers
+	* @access   public
+	*/
+	function getHeaders(){
+	    return $this->responseHeaders;
+	}
+
+	/**
+	* decodes simple types into PHP variables
+	*
+	* @param    string $value value to decode
+	* @param    string $type XML type to decode
+	* @param    string $typens XML type namespace to decode
+	* @return	mixed PHP value
+	* @access   private
+	*/
+	function decodeSimple($value, $type, $typens) {
+		// TODO: use the namespace!
+		if ((!isset($type)) || $type == 'string' || $type == 'long' || $type == 'unsignedLong') {
+			return (string) $value;
+		}
+		if ($type == 'int' || $type == 'integer' || $type == 'short' || $type == 'byte') {
+			return (int) $value;
+		}
+		if ($type == 'float' || $type == 'double' || $type == 'decimal') {
+			return (double) $value;
+		}
+		if ($type == 'boolean') {
+			if (strtolower($value) == 'false' || strtolower($value) == 'f') {
+				return false;
+			}
+			return (boolean) $value;
+		}
+		if ($type == 'base64' || $type == 'base64Binary') {
+			$this->debug('Decode base64 value');
+			return base64_decode($value);
+		}
+		// obscure numeric types
+		if ($type == 'nonPositiveInteger' || $type == 'negativeInteger'
+			|| $type == 'nonNegativeInteger' || $type == 'positiveInteger'
+			|| $type == 'unsignedInt'
+			|| $type == 'unsignedShort' || $type == 'unsignedByte') {
+			return (int) $value;
+		}
+		// bogus: parser treats array with no elements as a simple type
+		if ($type == 'array') {
+			return array();
+		}
+		// everything else
+		return (string) $value;
+	}
+
+	/**
+	* builds response structures for compound values (arrays/structs)
+	* and scalars
+	*
+	* @param    integer $pos position in node tree
+	* @return	mixed	PHP value
+	* @access   private
+	*/
+	function buildVal($pos){
+		if(!isset($this->message[$pos]['type'])){
+			$this->message[$pos]['type'] = '';
+		}
+		$this->debug('in buildVal() for '.$this->message[$pos]['name']."(pos $pos) of type ".$this->message[$pos]['type']);
+		// if there are children...
+		if($this->message[$pos]['children'] != ''){
+			$this->debug('in buildVal, there are children');
+			$children = explode('|',$this->message[$pos]['children']);
+			array_shift($children); // knock off empty
+			// md array
+			if(isset($this->message[$pos]['arrayCols']) && $this->message[$pos]['arrayCols'] != ''){
+            	$r=0; // rowcount
+            	$c=0; // colcount
+            	foreach($children as $child_pos){
+					$this->debug("in buildVal, got an MD array element: $r, $c");
+					$params[$r][] = $this->message[$child_pos]['result'];
+				    $c++;
+				    if($c == $this->message[$pos]['arrayCols']){
+				    	$c = 0;
+						$r++;
+				    }
+                }
+            // array
+			} elseif($this->message[$pos]['type'] == 'array' || $this->message[$pos]['type'] == 'Array'){
+                $this->debug('in buildVal, adding array '.$this->message[$pos]['name']);
+                foreach($children as $child_pos){
+                	$params[] = &$this->message[$child_pos]['result'];
+                }
+            // apache Map type: java hashtable
+            } elseif($this->message[$pos]['type'] == 'Map' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap'){
+                $this->debug('in buildVal, Java Map '.$this->message[$pos]['name']);
+                foreach($children as $child_pos){
+                	$kv = explode("|",$this->message[$child_pos]['children']);
+                   	$params[$this->message[$kv[1]]['result']] = &$this->message[$kv[2]]['result'];
+                }
+            // generic compound type
+            //} elseif($this->message[$pos]['type'] == 'SOAPStruct' || $this->message[$pos]['type'] == 'struct') {
+		    } else {
+	    		// Apache Vector type: treat as an array
+                $this->debug('in buildVal, adding Java Vector '.$this->message[$pos]['name']);
+				if ($this->message[$pos]['type'] == 'Vector' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap') {
+					$notstruct = 1;
+				} else {
+					$notstruct = 0;
+	            }
+            	//
+            	foreach($children as $child_pos){
+            		if($notstruct){
+            			$params[] = &$this->message[$child_pos]['result'];
+            		} else {
+            			if (isset($params[$this->message[$child_pos]['name']])) {
+            				// de-serialize repeated element name into an array
+            				if ((!is_array($params[$this->message[$child_pos]['name']])) || (!isset($params[$this->message[$child_pos]['name']][0]))) {
+            					$params[$this->message[$child_pos]['name']] = array($params[$this->message[$child_pos]['name']]);
+            				}
+            				$params[$this->message[$child_pos]['name']][] = &$this->message[$child_pos]['result'];
+            			} else {
+					    	$params[$this->message[$child_pos]['name']] = &$this->message[$child_pos]['result'];
+					    }
+                	}
+                }
+			}
+			if (isset($this->message[$pos]['xattrs'])) {
+                $this->debug('in buildVal, handling attributes');
+				foreach ($this->message[$pos]['xattrs'] as $n => $v) {
+					$params[$n] = $v;
+				}
+			}
+			// handle simpleContent
+			if (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') {
+                $this->debug('in buildVal, handling simpleContent');
+            	if (isset($this->message[$pos]['type'])) {
+					$params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
+				} else {
+					$parent = $this->message[$pos]['parent'];
+					if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
+						$params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
+					} else {
+						$params['!'] = $this->message[$pos]['cdata'];
+					}
+				}
+			}
+			return is_array($params) ? $params : array();
+		} else {
+        	$this->debug('in buildVal, no children, building scalar');
+			$cdata = isset($this->message[$pos]['cdata']) ? $this->message[$pos]['cdata'] : '';
+        	if (isset($this->message[$pos]['type'])) {
+				return $this->decodeSimple($cdata, $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
+			}
+			$parent = $this->message[$pos]['parent'];
+			if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
+				return $this->decodeSimple($cdata, $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
+			}
+           	return $this->message[$pos]['cdata'];
+		}
+	}
+}
+
+
+
+?><?php
+
+
+
+/**
+*
+* soapclient higher level class for easy usage.
+*
+* usage:
+*
+* // instantiate client with server info
+* $soapclient = new soapclient( string path [ ,boolean wsdl] );
+*
+* // call method, get results
+* echo $soapclient->call( string methodname [ ,array parameters] );
+*
+* // bye bye client
+* unset($soapclient);
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class soapclient extends nusoap_base  {
+
+	var $username = '';
+	var $password = '';
+	var $authtype = '';
+	var $certRequest = array();
+	var $requestHeaders = false;	// SOAP headers in request (text)
+	var $responseHeaders = '';		// SOAP headers from response (incomplete namespace resolution) (text)
+	var $document = '';				// SOAP body response portion (incomplete namespace resolution) (text)
+	var $endpoint;
+	var $forceEndpoint = '';		// overrides WSDL endpoint
+    var $proxyhost = '';
+    var $proxyport = '';
+	var $proxyusername = '';
+	var $proxypassword = '';
+    var $xml_encoding = '';			// character set encoding of incoming (response) messages
+	var $http_encoding = false;
+	var $timeout = 0;				// HTTP connection timeout
+	var $response_timeout = 30;		// HTTP response timeout
+	var $endpointType = '';			// soap|wsdl, empty for WSDL initialization error
+	var $persistentConnection = false;
+	var $defaultRpcParams = false;	// This is no longer used
+	var $request = '';				// HTTP request
+	var $response = '';				// HTTP response
+	var $responseData = '';			// SOAP payload of response
+	var $cookies = array();			// Cookies from response or for request
+    var $decode_utf8 = true;		// toggles whether the parser decodes element content w/ utf8_decode()
+	var $operations = array();		// WSDL operations, empty for WSDL initialization error
+	
+	/*
+	 * fault related variables
+	 */
+	/**
+	 * @var      fault
+	 * @access   public
+	 */
+	var $fault;
+	/**
+	 * @var      faultcode
+	 * @access   public
+	 */
+	var $faultcode;
+	/**
+	 * @var      faultstring
+	 * @access   public
+	 */
+	var $faultstring;
+	/**
+	 * @var      faultdetail
+	 * @access   public
+	 */
+	var $faultdetail;
+
+	/**
+	* constructor
+	*
+	* @param    mixed $endpoint SOAP server or WSDL URL (string), or wsdl instance (object)
+	* @param    bool $wsdl optional, set to true if using WSDL
+	* @param	int $portName optional portName in WSDL document
+	* @param    string $proxyhost
+	* @param    string $proxyport
+	* @param	string $proxyusername
+	* @param	string $proxypassword
+	* @param	integer $timeout set the connection timeout
+	* @param	integer $response_timeout set the response timeout
+	* @access   public
+	*/
+	function soapclient($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30){
+		parent::nusoap_base();
+		$this->endpoint = $endpoint;
+		$this->proxyhost = $proxyhost;
+		$this->proxyport = $proxyport;
+		$this->proxyusername = $proxyusername;
+		$this->proxypassword = $proxypassword;
+		$this->timeout = $timeout;
+		$this->response_timeout = $response_timeout;
+
+		// make values
+		if($wsdl){
+			if (is_object($endpoint) && (get_class($endpoint) == 'wsdl')) {
+				$this->wsdl = $endpoint;
+				$this->endpoint = $this->wsdl->wsdl;
+				$this->wsdlFile = $this->endpoint;
+				$this->debug('existing wsdl instance created from ' . $this->endpoint);
+			} else {
+				$this->wsdlFile = $this->endpoint;
+				
+				// instantiate wsdl object and parse wsdl file
+				$this->debug('instantiating wsdl class with doc: '.$endpoint);
+				$this->wsdl =& new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout);
+			}
+			$this->appendDebug($this->wsdl->getDebug());
+			$this->wsdl->clearDebug();
+			// catch errors
+			if($errstr = $this->wsdl->getError()){
+				$this->debug('got wsdl error: '.$errstr);
+				$this->setError('wsdl error: '.$errstr);
+			} elseif($this->operations = $this->wsdl->getOperations()){
+				$this->debug( 'got '.count($this->operations).' operations from wsdl '.$this->wsdlFile);
+				$this->endpointType = 'wsdl';
+			} else {
+				$this->debug( 'getOperations returned false');
+				$this->setError('no operations defined in the WSDL document!');
+			}
+		} else {
+			$this->debug("instantiate SOAP with endpoint at $endpoint");
+			$this->endpointType = 'soap';
+		}
+	}
+
+	/**
+	* calls method, returns PHP native type
+	*
+	* @param    string $method SOAP server URL or path
+	* @param    mixed $params An array, associative or simple, of the parameters
+	*			              for the method call, or a string that is the XML
+	*			              for the call.  For rpc style, this call will
+	*			              wrap the XML in a tag named after the method, as
+	*			              well as the SOAP Envelope and Body.  For document
+	*			              style, this will only wrap with the Envelope and Body.
+	*			              IMPORTANT: when using an array with document style,
+	*			              in which case there
+	*                         is really one parameter, the root of the fragment
+	*                         used in the call, which encloses what programmers
+	*                         normally think of parameters.  A parameter array
+	*                         *must* include the wrapper.
+	* @param	string $namespace optional method namespace (WSDL can override)
+	* @param	string $soapAction optional SOAPAction value (WSDL can override)
+	* @param	mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers
+	* @param	boolean $rpcParams optional (no longer used)
+	* @param	string	$style optional (rpc|document) the style to use when serializing parameters (WSDL can override)
+	* @param	string	$use optional (encoded|literal) the use when serializing parameters (WSDL can override)
+	* @return	mixed	response from SOAP call
+	* @access   public
+	*/
+	function call($operation,$params=array(),$namespace='http://tempuri.org',$soapAction='',$headers=false,$rpcParams=null,$style='rpc',$use='encoded'){
+		$this->operation = $operation;
+		$this->fault = false;
+		$this->setError('');
+		$this->request = '';
+		$this->response = '';
+		$this->responseData = '';
+		$this->faultstring = '';
+		$this->faultcode = '';
+		$this->opData = array();
+		
+		$this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType");
+		$this->appendDebug('params=' . $this->varDump($params));
+		$this->appendDebug('headers=' . $this->varDump($headers));
+		if ($headers) {
+			$this->requestHeaders = $headers;
+		}
+		// serialize parameters
+		if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){
+			// use WSDL for operation
+			$this->opData = $opData;
+			$this->debug("found operation");
+			$this->appendDebug('opData=' . $this->varDump($opData));
+			if (isset($opData['soapAction'])) {
+				$soapAction = $opData['soapAction'];
+			}
+			if (! $this->forceEndpoint) {
+				$this->endpoint = $opData['endpoint'];
+			} else {
+				$this->endpoint = $this->forceEndpoint;
+			}
+			$namespace = isset($opData['input']['namespace']) ? $opData['input']['namespace'] :	$namespace;
+			$style = $opData['style'];
+			$use = $opData['input']['use'];
+			// add ns to ns array
+			if($namespace != '' && !isset($this->wsdl->namespaces[$namespace])){
+				$nsPrefix = 'ns' . rand(1000, 9999);
+				$this->wsdl->namespaces[$nsPrefix] = $namespace;
+			}
+            $nsPrefix = $this->wsdl->getPrefixFromNamespace($namespace);
+			// serialize payload
+			if (is_string($params)) {
+				$this->debug("serializing param string for WSDL operation $operation");
+				$payload = $params;
+			} elseif (is_array($params)) {
+				$this->debug("serializing param array for WSDL operation $operation");
+				$payload = $this->wsdl->serializeRPCParameters($operation,'input',$params);
+			} else {
+				$this->debug('params must be array or string');
+				$this->setError('params must be array or string');
+				return false;
+			}
+            $usedNamespaces = $this->wsdl->usedNamespaces;
+			if (isset($opData['input']['encodingStyle'])) {
+				$encodingStyle = $opData['input']['encodingStyle'];
+			} else {
+				$encodingStyle = '';
+			}
+			$this->appendDebug($this->wsdl->getDebug());
+			$this->wsdl->clearDebug();
+			if ($errstr = $this->wsdl->getError()) {
+				$this->debug('got wsdl error: '.$errstr);
+				$this->setError('wsdl error: '.$errstr);
+				return false;
+			}
+		} elseif($this->endpointType == 'wsdl') {
+			// operation not in WSDL
+			$this->appendDebug($this->wsdl->getDebug());
+			$this->wsdl->clearDebug();
+			$this->setError( 'operation '.$operation.' not present.');
+			$this->debug("operation '$operation' not present.");
+			return false;
+		} else {
+			// no WSDL
+			//$this->namespaces['ns1'] = $namespace;
+			$nsPrefix = 'ns' . rand(1000, 9999);
+			// serialize 
+			$payload = '';
+			if (is_string($params)) {
+				$this->debug("serializing param string for operation $operation");
+				$payload = $params;
+			} elseif (is_array($params)) {
+				$this->debug("serializing param array for operation $operation");
+				foreach($params as $k => $v){
+					$payload .= $this->serialize_val($v,$k,false,false,false,false,$use);
+				}
+			} else {
+				$this->debug('params must be array or string');
+				$this->setError('params must be array or string');
+				return false;
+			}
+			$usedNamespaces = array();
+			if ($use == 'encoded') {
+				$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+			} else {
+				$encodingStyle = '';
+			}
+		}
+		// wrap RPC calls with method element
+		if ($style == 'rpc') {
+			if ($use == 'literal') {
+				$this->debug("wrapping RPC request with literal method element");
+				if ($namespace) {
+					$payload = "<$operation xmlns=\"$namespace\">" . $payload . "</$operation>";
+				} else {
+					$payload = "<$operation>" . $payload . "</$operation>";
+				}
+			} else {
+				$this->debug("wrapping RPC request with encoded method element");
+				if ($namespace) {
+					$payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" .
+								$payload .
+								"</$nsPrefix:$operation>";
+				} else {
+					$payload = "<$operation>" .
+								$payload .
+								"</$operation>";
+				}
+			}
+		}
+		// serialize envelope
+		$soapmsg = $this->serializeEnvelope($payload,$this->requestHeaders,$usedNamespaces,$style,$use,$encodingStyle);
+		$this->debug("endpoint=$this->endpoint, soapAction=$soapAction, namespace=$namespace, style=$style, use=$use, encodingStyle=$encodingStyle");
+		$this->debug('SOAP message length=' . strlen($soapmsg) . ' contents (max 1000 bytes)=' . substr($soapmsg, 0, 1000));
+		// send
+		$return = $this->send($this->getHTTPBody($soapmsg),$soapAction,$this->timeout,$this->response_timeout);
+		if($errstr = $this->getError()){
+			$this->debug('Error: '.$errstr);
+			return false;
+		} else {
+			$this->return = $return;
+			$this->debug('sent message successfully and got a(n) '.gettype($return));
+           	$this->appendDebug('return=' . $this->varDump($return));
+			
+			// fault?
+			if(is_array($return) && isset($return['faultcode'])){
+				$this->debug('got fault');
+				$this->setError($return['faultcode'].': '.$return['faultstring']);
+				$this->fault = true;
+				foreach($return as $k => $v){
+					$this->$k = $v;
+					$this->debug("$k = $v<br>");
+				}
+				return $return;
+			} elseif ($style == 'document') {
+				// NOTE: if the response is defined to have multiple parts (i.e. unwrapped),
+				// we are only going to return the first part here...sorry about that
+				return $return;
+			} else {
+				// array of return values
+				if(is_array($return)){
+					// multiple 'out' parameters, which we return wrapped up
+					// in the array
+					if(sizeof($return) > 1){
+						return $return;
+					}
+					// single 'out' parameter (normally the return value)
+					$return = array_shift($return);
+					$this->debug('return shifted value: ');
+					$this->appendDebug($this->varDump($return));
+           			return $return;
+				// nothing returned (ie, echoVoid)
+				} else {
+					return "";
+				}
+			}
+		}
+	}
+
+	/**
+	* get available data pertaining to an operation
+	*
+	* @param    string $operation operation name
+	* @return	array array of data pertaining to the operation
+	* @access   public
+	*/
+	function getOperationData($operation){
+		if(isset($this->operations[$operation])){
+			return $this->operations[$operation];
+		}
+		$this->debug("No data for operation: $operation");
+	}
+
+    /**
+    * send the SOAP message
+    *
+    * Note: if the operation has multiple return values
+    * the return value of this method will be an array
+    * of those values.
+    *
+	* @param    string $msg a SOAPx4 soapmsg object
+	* @param    string $soapaction SOAPAction value
+	* @param    integer $timeout set connection timeout in seconds
+	* @param	integer $response_timeout set response timeout in seconds
+	* @return	mixed native PHP types.
+	* @access   private
+	*/
+	function send($msg, $soapaction = '', $timeout=0, $response_timeout=30) {
+		$this->checkCookies();
+		// detect transport
+		switch(true){
+			// http(s)
+			case ereg('^http',$this->endpoint):
+				$this->debug('transporting via HTTP');
+				if($this->persistentConnection == true && is_object($this->persistentConnection)){
+					$http =& $this->persistentConnection;
+				} else {
+					$http = new soap_transport_http($this->endpoint);
+					if ($this->persistentConnection) {
+						$http->usePersistentConnection();
+					}
+				}
+				$http->setContentType($this->getHTTPContentType(), $this->getHTTPContentTypeCharset());
+				$http->setSOAPAction($soapaction);
+				if($this->proxyhost && $this->proxyport){
+					$http->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword);
+				}
+                if($this->authtype != '') {
+					$http->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
+				}
+				if($this->http_encoding != ''){
+					$http->setEncoding($this->http_encoding);
+				}
+				$this->debug('sending message, length='.strlen($msg));
+				if(ereg('^http:',$this->endpoint)){
+				//if(strpos($this->endpoint,'http:')){
+					$this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies);
+				} elseif(ereg('^https',$this->endpoint)){
+				//} elseif(strpos($this->endpoint,'https:')){
+					//if(phpversion() == '4.3.0-dev'){
+						//$response = $http->send($msg,$timeout,$response_timeout);
+                   		//$this->request = $http->outgoing_payload;
+						//$this->response = $http->incoming_payload;
+					//} else
+					$this->responseData = $http->sendHTTPS($msg,$timeout,$response_timeout,$this->cookies);
+				} else {
+					$this->setError('no http/s in endpoint url');
+				}
+				$this->request = $http->outgoing_payload;
+				$this->response = $http->incoming_payload;
+				$this->appendDebug($http->getDebug());
+				$this->UpdateCookies($http->incoming_cookies);
+
+				// save transport object if using persistent connections
+				if ($this->persistentConnection) {
+					$http->clearDebug();
+					if (!is_object($this->persistentConnection)) {
+						$this->persistentConnection = $http;
+					}
+				}
+				
+				if($err = $http->getError()){
+					$this->setError('HTTP Error: '.$err);
+					return false;
+				} elseif($this->getError()){
+					return false;
+				} else {
+					$this->debug('got response, length='. strlen($this->responseData).' type='.$http->incoming_headers['content-type']);
+					return $this->parseResponse($http->incoming_headers, $this->responseData);
+				}
+			break;
+			default:
+				$this->setError('no transport found, or selected transport is not yet supported!');
+			return false;
+			break;
+		}
+	}
+
+	/**
+	* processes SOAP message returned from server
+	*
+	* @param	array	$headers	The HTTP headers
+	* @param	string	$data		unprocessed response data from server
+	* @return	mixed	value of the message, decoded into a PHP type
+	* @access   private
+	*/
+    function parseResponse($headers, $data) {
+		$this->debug('Entering parseResponse() for data of length ' . strlen($data) . ' and type ' . $headers['content-type']);
+		if (!strstr($headers['content-type'], 'text/xml')) {
+			$this->setError('Response not of type text/xml');
+			return false;
+		}
+		if (strpos($headers['content-type'], '=')) {
+			$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
+			$this->debug('Got response encoding: ' . $enc);
+			if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+				$this->xml_encoding = strtoupper($enc);
+			} else {
+				$this->xml_encoding = 'US-ASCII';
+			}
+		} else {
+			// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+			$this->xml_encoding = 'ISO-8859-1';
+		}
+		$this->debug('Use encoding: ' . $this->xml_encoding . ' when creating soap_parser');
+		$parser = new soap_parser($data,$this->xml_encoding,$this->operation,$this->decode_utf8);
+		// add parser debug data to our debug
+		$this->appendDebug($parser->getDebug());
+		// if parse errors
+		if($errstr = $parser->getError()){
+			$this->setError( $errstr);
+			// destroy the parser object
+			unset($parser);
+			return false;
+		} else {
+			// get SOAP headers
+			$this->responseHeaders = $parser->getHeaders();
+			// get decoded message
+			$return = $parser->get_response();
+            // add document for doclit support
+            $this->document = $parser->document;
+			// destroy the parser object
+			unset($parser);
+			// return decode message
+			return $return;
+		}
+	 }
+
+	/**
+	* sets the SOAP endpoint, which can override WSDL
+	*
+	* @param	$endpoint string The endpoint URL to use, or empty string or false to prevent override
+	* @access   public
+	*/
+	function setEndpoint($endpoint) {
+		$this->forceEndpoint = $endpoint;
+	}
+
+	/**
+	* set the SOAP headers
+	*
+	* @param	$headers mixed String of XML with SOAP header content, or array of soapval objects for SOAP headers
+	* @access   public
+	*/
+	function setHeaders($headers){
+		$this->requestHeaders = $headers;
+	}
+
+	/**
+	* get the SOAP response headers (namespace resolution incomplete)
+	*
+	* @return	string
+	* @access   public
+	*/
+	function getHeaders(){
+		return $this->responseHeaders;
+	}
+
+	/**
+	* set proxy info here
+	*
+	* @param    string $proxyhost
+	* @param    string $proxyport
+	* @param	string $proxyusername
+	* @param	string $proxypassword
+	* @access   public
+	*/
+	function setHTTPProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') {
+		$this->proxyhost = $proxyhost;
+		$this->proxyport = $proxyport;
+		$this->proxyusername = $proxyusername;
+		$this->proxypassword = $proxypassword;
+	}
+
+	/**
+	* if authenticating, set user credentials here
+	*
+	* @param    string $username
+	* @param    string $password
+	* @param	string $authtype (basic|digest|certificate)
+	* @param	array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)
+	* @access   public
+	*/
+	function setCredentials($username, $password, $authtype = 'basic', $certRequest = array()) {
+		$this->username = $username;
+		$this->password = $password;
+		$this->authtype = $authtype;
+		$this->certRequest = $certRequest;
+	}
+	
+	/**
+	* use HTTP encoding
+	*
+	* @param    string $enc
+	* @access   public
+	*/
+	function setHTTPEncoding($enc='gzip, deflate'){
+		$this->http_encoding = $enc;
+	}
+	
+	/**
+	* use HTTP persistent connections if possible
+	*
+	* @access   public
+	*/
+	function useHTTPPersistentConnection(){
+		$this->persistentConnection = true;
+	}
+	
+	/**
+	* gets the default RPC parameter setting.
+	* If true, default is that call params are like RPC even for document style.
+	* Each call() can override this value.
+	*
+	* This is no longer used.
+	*
+	* @return boolean
+	* @access public
+	* @deprecated
+	*/
+	function getDefaultRpcParams() {
+		return $this->defaultRpcParams;
+	}
+
+	/**
+	* sets the default RPC parameter setting.
+	* If true, default is that call params are like RPC even for document style
+	* Each call() can override this value.
+	*
+	* This is no longer used.
+	*
+	* @param    boolean $rpcParams
+	* @access public
+	* @deprecated
+	*/
+	function setDefaultRpcParams($rpcParams) {
+		$this->defaultRpcParams = $rpcParams;
+	}
+	
+	/**
+	* dynamically creates an instance of a proxy class,
+	* allowing user to directly call methods from wsdl
+	*
+	* @return   object soap_proxy object
+	* @access   public
+	*/
+	function getProxy(){
+		$r = rand();
+		$evalStr = $this->_getProxyClassCode($r);
+		//$this->debug("proxy class: $evalStr";
+		// eval the class
+		eval($evalStr);
+		// instantiate proxy object
+		eval("\$proxy = new soap_proxy_$r('');");
+		// transfer current wsdl data to the proxy thereby avoiding parsing the wsdl twice
+		$proxy->endpointType = 'wsdl';
+		$proxy->wsdlFile = $this->wsdlFile;
+		$proxy->wsdl = $this->wsdl;
+		$proxy->operations = $this->operations;
+		$proxy->defaultRpcParams = $this->defaultRpcParams;
+		// transfer other state
+		$proxy->username = $this->username;
+		$proxy->password = $this->password;
+		$proxy->authtype = $this->authtype;
+		$proxy->proxyhost = $this->proxyhost;
+		$proxy->proxyport = $this->proxyport;
+		$proxy->proxyusername = $this->proxyusername;
+		$proxy->proxypassword = $this->proxypassword;
+		$proxy->timeout = $this->timeout;
+		$proxy->response_timeout = $this->response_timeout;
+		$proxy->http_encoding = $this->http_encoding;
+		$proxy->persistentConnection = $this->persistentConnection;
+		$proxy->requestHeaders = $this->requestHeaders;
+		$proxy->soap_defencoding = $this->soap_defencoding;
+		$proxy->endpoint = $this->endpoint;
+		$proxy->forceEndpoint = $this->forceEndpoint;
+		return $proxy;
+	}
+
+	/**
+	* dynamically creates proxy class code
+	*
+	* @return   string PHP/NuSOAP code for the proxy class
+	* @access   private
+	*/
+	function _getProxyClassCode($r) {
+		if ($this->endpointType != 'wsdl') {
+			$evalStr = 'A proxy can only be created for a WSDL client';
+			$this->setError($evalStr);
+			return $evalStr;
+		}
+		$evalStr = '';
+		foreach ($this->operations as $operation => $opData) {
+			if ($operation != '') {
+				// create param string and param comment string
+				if (sizeof($opData['input']['parts']) > 0) {
+					$paramStr = '';
+					$paramArrayStr = '';
+					$paramCommentStr = '';
+					foreach ($opData['input']['parts'] as $name => $type) {
+						$paramStr .= "\$$name, ";
+						$paramArrayStr .= "'$name' => \$$name, ";
+						$paramCommentStr .= "$type \$$name, ";
+					}
+					$paramStr = substr($paramStr, 0, strlen($paramStr)-2);
+					$paramArrayStr = substr($paramArrayStr, 0, strlen($paramArrayStr)-2);
+					$paramCommentStr = substr($paramCommentStr, 0, strlen($paramCommentStr)-2);
+				} else {
+					$paramStr = '';
+					$paramCommentStr = 'void';
+				}
+				$opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace'];
+				$evalStr .= "// $paramCommentStr
+	function " . str_replace('.', '__', $operation) . "($paramStr) {
+		\$params = array($paramArrayStr);
+		return \$this->call('$operation', \$params, '".$opData['namespace']."', '".(isset($opData['soapAction']) ? $opData['soapAction'] : '')."');
+	}
+	";
+				unset($paramStr);
+				unset($paramCommentStr);
+			}
+		}
+		$evalStr = 'class soap_proxy_'.$r.' extends soapclient {
+	'.$evalStr.'
+}';
+		return $evalStr;
+	}
+
+	/**
+	* dynamically creates proxy class code
+	*
+	* @return   string PHP/NuSOAP code for the proxy class
+	* @access   public
+	*/
+	function getProxyClassCode() {
+		$r = rand();
+		return $this->_getProxyClassCode($r);
+	}
+
+	/**
+	* gets the HTTP body for the current request.
+	*
+	* @param string $soapmsg The SOAP payload
+	* @return string The HTTP body, which includes the SOAP payload
+	* @access private
+	*/
+	function getHTTPBody($soapmsg) {
+		return $soapmsg;
+	}
+	
+	/**
+	* gets the HTTP content type for the current request.
+	*
+	* Note: getHTTPBody must be called before this.
+	*
+	* @return string the HTTP content type for the current request.
+	* @access private
+	*/
+	function getHTTPContentType() {
+		return 'text/xml';
+	}
+	
+	/**
+	* gets the HTTP content type charset for the current request.
+	* returns false for non-text content types.
+	*
+	* Note: getHTTPBody must be called before this.
+	*
+	* @return string the HTTP content type charset for the current request.
+	* @access private
+	*/
+	function getHTTPContentTypeCharset() {
+		return $this->soap_defencoding;
+	}
+
+	/*
+	* whether or not parser should decode utf8 element content
+    *
+    * @return   always returns true
+    * @access   public
+    */
+    function decodeUTF8($bool){
+		$this->decode_utf8 = $bool;
+		return true;
+    }
+
+	/**
+	 * adds a new Cookie into $this->cookies array
+	 *
+	 * @param	string $name Cookie Name
+	 * @param	string $value Cookie Value
+	 * @return	if cookie-set was successful returns true, else false
+	 * @access	public
+	 */
+	function setCookie($name, $value) {
+		if (strlen($name) == 0) {
+			return false;
+		}
+		$this->cookies[] = array('name' => $name, 'value' => $value);
+		return true;
+	}
+
+	/**
+	 * gets all Cookies
+	 *
+	 * @return   array with all internal cookies
+	 * @access   public
+	 */
+	function getCookies() {
+		return $this->cookies;
+	}
+
+	/**
+	 * checks all Cookies and delete those which are expired
+	 *
+	 * @return   always return true
+	 * @access   private
+	 */
+	function checkCookies() {
+		if (sizeof($this->cookies) == 0) {
+			return true;
+		}
+		$this->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies');
+		$curr_cookies = $this->cookies;
+		$this->cookies = array();
+		foreach ($curr_cookies as $cookie) {
+			if (! is_array($cookie)) {
+				$this->debug('Remove cookie that is not an array');
+				continue;
+			}
+			if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
+				if (strtotime($cookie['expires']) > time()) {
+					$this->cookies[] = $cookie;
+				} else {
+					$this->debug('Remove expired cookie ' . $cookie['name']);
+				}
+			} else {
+				$this->cookies[] = $cookie;
+			}
+		}
+		$this->debug('checkCookie: '.sizeof($this->cookies).' cookies left in array');
+		return true;
+	}
+
+	/**
+	 * updates the current cookies with a new set
+	 *
+	 * @param	array $cookies new cookies with which to update current ones
+	 * @return	always return true
+	 * @access	private
+	 */
+	function UpdateCookies($cookies) {
+		if (sizeof($this->cookies) == 0) {
+			// no existing cookies: take whatever is new
+			if (sizeof($cookies) > 0) {
+				$this->debug('Setting new cookie(s)');
+				$this->cookies = $cookies;
+			}
+			return true;
+		}
+		if (sizeof($cookies) == 0) {
+			// no new cookies: keep what we've got
+			return true;
+		}
+		// merge
+		foreach ($cookies as $newCookie) {
+			if (!is_array($newCookie)) {
+				continue;
+			}
+			if ((!isset($newCookie['name'])) || (!isset($newCookie['value']))) {
+				continue;
+			}
+			$newName = $newCookie['name'];
+
+			$found = false;
+			for ($i = 0; $i < count($this->cookies); $i++) {
+				$cookie = $this->cookies[$i];
+				if (!is_array($cookie)) {
+					continue;
+				}
+				if (!isset($cookie['name'])) {
+					continue;
+				}
+				if ($newName != $cookie['name']) {
+					continue;
+				}
+				$newDomain = isset($newCookie['domain']) ? $newCookie['domain'] : 'NODOMAIN';
+				$domain = isset($cookie['domain']) ? $cookie['domain'] : 'NODOMAIN';
+				if ($newDomain != $domain) {
+					continue;
+				}
+				$newPath = isset($newCookie['path']) ? $newCookie['path'] : 'NOPATH';
+				$path = isset($cookie['path']) ? $cookie['path'] : 'NOPATH';
+				if ($newPath != $path) {
+					continue;
+				}
+				$this->cookies[$i] = $newCookie;
+				$found = true;
+				$this->debug('Update cookie ' . $newName . '=' . $newCookie['value']);
+				break;
+			}
+			if (! $found) {
+				$this->debug('Add cookie ' . $newName . '=' . $newCookie['value']);
+				$this->cookies[] = $newCookie;
+			}
+		}
+		return true;
+	}
+}
+?>

Added: trunk/direct.openmoko.com/includes/add_ccgvdc_application_top.php
===================================================================
--- trunk/direct.openmoko.com/includes/add_ccgvdc_application_top.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/add_ccgvdc_application_top.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+  define('FILENAME_GV_FAQ', 'gv_faq.php');
+  define('FILENAME_GV_REDEEM', 'gv_redeem.php');
+  define('FILENAME_GV_REDEEM_PROCESS', 'gv_redeem_process.php');
+  define('FILENAME_GV_SEND', 'gv_send.php');
+  define('FILENAME_GV_SEND_PROCESS', 'gv_send_process.php');
+  define('FILENAME_PRODUCT_LISTING_COL', 'product_listing_col.php');
+  define('FILENAME_POPUP_COUPON_HELP', 'popup_coupon_help.php');
+
+  define('TABLE_COUPON_GV_CUSTOMER', 'coupon_gv_customer');
+  define('TABLE_COUPON_GV_QUEUE', 'coupon_gv_queue');
+  define('TABLE_COUPON_REDEEM_TRACK', 'coupon_redeem_track');
+  define('TABLE_COUPON_EMAIL_TRACK', 'coupon_email_track');
+  define('TABLE_COUPONS', 'coupons');
+  define('TABLE_COUPONS_DESCRIPTION', 'coupons_description');
+
+// Below are some defines which affect the way the discount coupon/gift voucher system work
+// Be careful when editing them.
+//
+// Set the length of the redeem code, the longer the more secure
+  define('SECURITY_CODE_LENGTH', '10');
+//
+// The settings below determine whether a new customer receives an incentive when they first signup
+//
+// Set the amount of a Gift Voucher that the new signup will receive, set to 0 for none
+//  define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '10');  // placed in the admin configuration mystore
+//
+// Set the coupon ID that will be sent by email to a new signup, if no id is set then no email :)
+//  define('NEW_SIGNUP_DISCOUNT_COUPON', '3'); // placed in the admin configuration mystore
+
+
+////
+// Create a Coupon Code. length may be between 1 and 16 Characters
+// $salt needs some thought.
+
+  function create_coupon_code($salt="secret", $length = SECURITY_CODE_LENGTH) {
+    $ccid = md5(uniqid("","salt"));
+    $ccid .= md5(uniqid("","salt"));
+    $ccid .= md5(uniqid("","salt"));
+    $ccid .= md5(uniqid("","salt"));
+    srand((double)microtime()*1000000); // seed the random number generator
+    $random_start = @rand(0, (128-$length));
+    $good_result = 0;
+    while ($good_result == 0) {
+      $id1=substr($ccid, $random_start,$length);
+      $query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . $id1 . "'");
+      if (tep_db_num_rows($query) == 0) $good_result = 1;
+    }
+    return $id1;
+  }
+////
+// Update the Customers GV account
+  function tep_gv_account_update($customer_id, $gv_id) {
+    $customer_gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . (int)$customer_id . "'");
+    $coupon_gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . (int)$gv_id . "'");
+    $coupon_gv = tep_db_fetch_array($coupon_gv_query);
+    if (tep_db_num_rows($customer_gv_query) > 0) {
+      $customer_gv = tep_db_fetch_array($customer_gv_query);
+      $new_gv_amount = $customer_gv['amount'] + $coupon_gv['coupon_amount'];
+   // new code bugfix
+   $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "' where customer_id = '" . (int)$customer_id . "'");
+   // original code $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "'");
+    } else {
+      $gv_query = tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . (int)$customer_id . "', '" . $coupon_gv['coupon_amount'] . "')");
+    }
+  }
+////
+// Get tax rate from tax description
+  function tep_get_tax_rate_from_desc($tax_desc) {
+    $tax_query = tep_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_description = '" . $tax_desc . "'");
+    $tax = tep_db_fetch_array($tax_query);
+    return $tax['tax_rate'];
+  }
+?>

Added: trunk/direct.openmoko.com/includes/affiliate_application_top.php
===================================================================
--- trunk/direct.openmoko.com/includes/affiliate_application_top.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/affiliate_application_top.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,171 @@
+<?php
+/*
+  $Id: affiliate_application_top.php,v 1.1.1.1 2004/03/04 23:40:36 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+// Set the local configuration parameters - mainly for developers
+  if (file_exists(DIR_WS_INCLUDES . 'local/affiliate_configure.php')) include(DIR_WS_INCLUDES . 'local/affiliate_configure.php');
+
+ // require(DIR_WS_INCLUDES . 'affiliate_configure.php');
+  require(DIR_WS_FUNCTIONS . 'affiliate_functions.php');
+
+// define the database table names used in the contribution
+  define('TABLE_AFFILIATE', 'affiliate_affiliate');
+  define('TABLE_AFFILIATE_NEWS', 'affiliate_news');
+// if you change this -> affiliate_show_banner must be changed too
+  define('TABLE_AFFILIATE_BANNERS', 'affiliate_banners');
+  define('TABLE_AFFILIATE_BANNERS_HISTORY', 'affiliate_banners_history');
+  define('TABLE_AFFILIATE_CLICKTHROUGHS', 'affiliate_clickthroughs');
+  define('TABLE_AFFILIATE_SALES', 'affiliate_sales');
+  define('TABLE_AFFILIATE_PAYMENT', 'affiliate_payment');
+  define('TABLE_AFFILIATE_PAYMENT_STATUS', 'affiliate_payment_status');
+  define('TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY', 'affiliate_payment_status_history');
+
+// define the filenames used in the project
+  define('FILENAME_AFFILIATE_SUMMARY', 'affiliate_summary.php');
+  define('FILENAME_AFFILIATE_LOGOUT', 'affiliate_logout.php');
+  define('FILENAME_AFFILIATE', 'affiliate_affiliate.php');
+  define('FILENAME_AFFILIATE_CONTACT', 'affiliate_contact.php');
+  define('FILENAME_AFFILIATE_FAQ', 'affiliate_faq.php');
+  define('FILENAME_AFFILIATE_ACCOUNT', 'affiliate_details.php');
+  define('FILENAME_AFFILIATE_DETAILS', 'affiliate_details.php');
+  define('FILENAME_AFFILIATE_DETAILS_OK', 'affiliate_details_ok.php');
+  define('FILENAME_AFFILIATE_TERMS','affiliate_terms.php');
+  define('FILENAME_AFFILIATE_TERMS_POPUP','affiliate_terms_popup.php');
+  define('FILENAME_AFFILIATE_NEWS', 'affiliate_news.php');
+  define('FILENAME_AFFILIATE_NEWSLETTER', 'affiliate_newsletter.php');
+
+  define('FILENAME_AFFILIATE_HELP_1', 'affiliate_help1.php');
+  define('FILENAME_AFFILIATE_HELP_2', 'affiliate_help2.php');
+  define('FILENAME_AFFILIATE_HELP_3', 'affiliate_help3.php');
+  define('FILENAME_AFFILIATE_HELP_4', 'affiliate_help4.php');
+  define('FILENAME_AFFILIATE_HELP_5', 'affiliate_help5.php');
+  define('FILENAME_AFFILIATE_HELP_6', 'affiliate_help6.php');
+  define('FILENAME_AFFILIATE_HELP_7', 'affiliate_help7.php');
+  define('FILENAME_AFFILIATE_HELP_8', 'affiliate_help8.php');
+  define('FILENAME_AFFILIATE_HELP_9', 'affiliate_help9.php');
+  define('FILENAME_AFFILIATE_HELP_10', 'affiliate_help10.php');
+  define('FILENAME_AFFILIATE_HELP_11', 'affiliate_help11.php');
+  define('FILENAME_AFFILIATE_HELP_12', 'affiliate_help12.php');
+  define('FILENAME_AFFILIATE_HELP_13', 'affiliate_help13.php');
+  define('FILENAME_AFFILIATE_HELP_14', 'affiliate_help14.php');
+  define('FILENAME_AFFILIATE_HELP_15', 'affiliate_help15.php');
+  define('FILENAME_AFFILIATE_HELP_16', 'affiliate_help16.php');
+  define('FILENAME_AFFILIATE_HELP_17', 'affiliate_help17.php');
+  define('FILENAME_AFFILIATE_HELP_18', 'affiliate_help18.php');
+  define('FILENAME_AFFILIATE_HELP_19', 'affiliate_help19.php');
+  define('FILENAME_AFFILIATE_HELP_20', 'affiliate_help20.php');
+  define('FILENAME_AFFILIATE_HELP_21', 'affiliate_help21.php');
+  define('FILENAME_AFFILIATE_HELP_22', 'affiliate_help22.php');
+  define('FILENAME_AFFILIATE_BANNERS_CATEGORY', 'affiliate_banners_category.php');
+  define('FILENAME_AFFILIATE_BANNERS_BUILD_CAT', 'affiliate_banners_build_cat.php');
+  define('FILENAME_AFFILIATE_VALIDCATS', 'affiliate_validcats.php');
+  define('FILENAME_AFFILIATE_INFO', 'affiliate_info.php');
+  define('TABLE_AFFILIATE_NEWS_CONTENTS', 'affiliate_news_contents');
+  define('FILENAME_AFFILIATE_BANNERS', 'affiliate_banners.php');
+  define('FILENAME_AFFILIATE_BANNERS_BANNERS', 'affiliate_banners_banners.php');
+  define('FILENAME_AFFILIATE_BANNERS_BUILD', 'affiliate_banners_build.php');
+  define('FILENAME_AFFILIATE_BANNERS_PRODUCT', 'affiliate_banners_product.php');
+  define('FILENAME_AFFILIATE_BANNERS_TEXT', 'affiliate_banners_text.php');
+  define('FILENAME_AFFILIATE_SHOW_BANNER', 'affiliate_show_banner.php');
+
+  define('FILENAME_AFFILIATE_REPORTS', 'affiliate_reports.php');
+  define('FILENAME_AFFILIATE_CLICKS', 'affiliate_clicks.php');
+  define('FILENAME_AFFILIATE_VALIDPRODUCTS', 'affiliate_validproducts.php');
+
+  define('FILENAME_AFFILIATE_PASSWORD', 'affiliate_password.php');
+  define('FILENAME_AFFILIATE_PASSWORD_FORGOTTEN', 'affiliate_password_forgotten.php');
+
+  define('FILENAME_AFFILIATE_LOGOUT', 'affiliate_logout.php');
+  define('FILENAME_AFFILIATE_SALES', 'affiliate_sales.php');
+  define('FILENAME_AFFILIATE_SIGNUP', 'affiliate_signup.php');
+
+  define('FILENAME_AFFILIATE_SIGNUP_OK', 'affiliate_signup_ok.php');
+  define('FILENAME_AFFILIATE_PAYMENT', 'affiliate_payment.php');
+
+// include the language translations
+  require(DIR_WS_LANGUAGES . 'affiliate_' . $language . '.php');
+
+  $affiliate_clientdate = (date ("Y-m-d H:i:s"));
+  $affiliate_clientbrowser = $HTTP_SERVER_VARS["HTTP_USER_AGENT"];
+  $affiliate_clientip = $HTTP_SERVER_VARS["REMOTE_ADDR"];
+  $affiliate_clientreferer = $HTTP_SERVER_VARS["HTTP_REFERER"];
+
+  if (! isset($HTTP_SESSION_VARS['affiliate_ref']) ) {
+    tep_session_register('affiliate_ref');
+    tep_session_register('affiliate_clickthroughs_id');
+    if ( isset($HTTP_GET_VARS['ref']) || isset($HTTP_POST_VARS['ref']) ) {
+      if ( isset($HTTP_GET_VARS['ref']) ) $affiliate_ref = (int)$HTTP_GET_VARS['ref'];
+      if ( isset($HTTP_POST_VARS['ref']) ) $affiliate_ref = (int)$HTTP_POST_VARS['ref'];
+      if ( isset($HTTP_GET_VARS['products_id']) ) $affiliate_products_id = (int)$HTTP_GET_VARS['products_id'];
+      if ( isset($HTTP_POST_VARS['products_id']) ) $affiliate_products_id = (int)$HTTP_POST_VARS['products_id'];
+      if ( isset($HTTP_GET_VARS['affiliate_banner_id']) ) $affiliate_banner_id = (int)$HTTP_GET_VARS['affiliate_banner_id'];
+      if ( isset($HTTP_POST_VARS['affiliate_banner_id']) ) $affiliate_banner_id = (int)$HTTP_POST_VARS['affiliate_banner_id'];
+
+      $sql_data_array = array('affiliate_id' => $affiliate_ref,
+                              'affiliate_clientdate' => $affiliate_clientdate,
+                              'affiliate_clientbrowser' => $affiliate_clientbrowser,
+                              'affiliate_clientip' => $affiliate_clientip,
+                              'affiliate_clientreferer' => $affiliate_clientreferer,
+                              'affiliate_products_id' => $affiliate_products_id,
+                              'affiliate_banner_id' => $affiliate_banner_id);
+      tep_db_perform(TABLE_AFFILIATE_CLICKTHROUGHS, $sql_data_array);
+      $affiliate_clickthroughs_id = tep_db_insert_id();
+
+   // Banner has been clicked, update stats:
+      if ($affiliate_banner_id && $affiliate_ref) {
+        $today = date('Y-m-d');
+        $sql = "select * from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . $affiliate_banner_id  . "' and  affiliate_banners_affiliate_id = '" . $affiliate_ref . "' and affiliate_banners_history_date = '" . $today . "'";
+        $banner_stats_query = tep_db_query($sql);
+
+     // Banner has been shown today
+        if (tep_db_fetch_array($banner_stats_query)) {
+        tep_db_query("update " . TABLE_AFFILIATE_BANNERS_HISTORY . " set affiliate_banners_clicks = affiliate_banners_clicks + 1 where affiliate_banners_id = '" . $affiliate_banner_id . "' and affiliate_banners_affiliate_id = '" . $affiliate_ref. "' and affiliate_banners_history_date = '" . $today . "'");
+   // Initial entry if banner has not been shown
+      } else {
+        $sql_data_array = array('affiliate_banners_id' => $affiliate_banner_id,
+                                'affiliate_banners_products_id' => $affiliate_products_id,
+                                'affiliate_banners_affiliate_id' => $affiliate_ref,
+                                'affiliate_banners_clicks' => '1',
+                                'affiliate_banners_history_date' => $today);
+        tep_db_perform(TABLE_AFFILIATE_BANNERS_HISTORY, $sql_data_array);
+      }
+    }
+
+ // Set Cookie if the customer comes back and orders it counts
+    setcookie('affiliate_ref', $affiliate_ref, time() + AFFILIATE_COOKIE_LIFETIME);
+    }
+    if ( isset($HTTP_COOKIE_VARS['affiliate_ref']) ) { // Customer comes back and is registered in cookie
+      $affiliate_ref = (int)$HTTP_COOKIE_VARS['affiliate_ref'];
+    }
+  }
+
+////
+// Compatibility to older Snapshots
+
+// set the type of request (secure or not)
+  if (!isset($request_type)) $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
+
+// Emulate the breadcrumb class
+  if (!class_exists(breadcrumb)) {
+    class breadcrumb {
+      function add($title, $link = '') {
+        global $location;
+        $location='&raquo; <a href="' . $link . '" class="headerNavigation">' . $title . '</a>';
+      }
+    }
+    $breadcrumb = new breadcrumb;
+  }
+?>

Added: trunk/direct.openmoko.com/includes/affiliate_checkout_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/affiliate_checkout_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/affiliate_checkout_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/*
+  $Id: affiliate_checkout_process.php,v 1.1.1.1 2004/03/04 23:40:36 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// fetch the net total of an order
+  $affiliate_total = 0;
+  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+    $affiliate_total += $order->products[$i]['final_price'] * $order->products[$i]['qty'];
+  }
+  
+ 
+//subtract disocunt  
+            // get order total info
+      $totals_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$insert_id . "' order by sort_order");
+      $order->totals = array();
+      while ($totals = tep_db_fetch_array($totals_query)) { $order->totals[] = array('title' => $totals['title'], 'text' => $totals['text'], 'class' => $totals['class'], 'value' => $totals['value'], 'orders_total_id' => $totals['orders_total_id']); }
+  
+    $TotalsArray = array();
+    for ($i=0; $i<sizeof($order->totals); $i++) {
+      $TotalsArray[] = array("Name" => $order->totals[$i]['title'], "Price" => number_format($order->totals[$i]['value'], 2, '.', ''), "Class" => $order->totals[$i]['class'], "TotalID" => $order->totals[$i]['orders_total_id']);
+      $TotalsArray[] = array("Name" => "          ", "Price" => "", "Class" => "ot_custom", "TotalID" => "0");
+    }
+  
+    array_pop($TotalsArray);
+    foreach($TotalsArray as $TotalIndex => $TotalDetails)
+    {
+    //set discount at 0
+          $discount='0';
+          //test for each discount avalaible in default cart and add them to gether.
+            if($TotalDetails["Class"] == "ot_coupon") {
+             $discount += $TotalIndex[value];
+            }
+              if($TotalDetails["Class"] == "ot_gv ") {
+             $discount += $TotalIndex[value];
+            }
+            if($TotalDetails["Class"] == "ot_lev_discount") {
+             $discount += $TotalIndex[value];
+            }
+            if($TotalDetails["Class"] == "ot_qty_discount") {
+             $discount += $TotalIndex[value];
+            }
+           
+             
+          }  
+      //subtract discount form product final total    
+         $affiliate_total -=  $discount;  
+      //end subtract discount
+   $affiliate_total = tep_round($affiliate_total, 2);
+
+// Check for individual commission
+  $affiliate_percentage = 0;
+  if (AFFILATE_INDIVIDUAL_PERCENTAGE == 'true') {
+    $affiliate_commission_query = tep_db_query ("select affiliate_commission_percent from " . TABLE_AFFILIATE . " where affiliate_id = '" . $affiliate_ref . "'");
+    $affiliate_commission = tep_db_fetch_array($affiliate_commission_query);
+    $affiliate_percent = $affiliate_commission['affiliate_commission_percent'];
+  }
+  if ($affiliate_percent < AFFILIATE_PERCENT) $affiliate_percent = AFFILIATE_PERCENT;
+  $affiliate_payment = tep_round(($affiliate_total * $affiliate_percent / 100), 2);
+
+  if ($HTTP_SESSION_VARS['affiliate_ref']) {
+    $sql_data_array = array('affiliate_id' => $affiliate_ref,
+                            'affiliate_date' => $affiliate_clientdate,
+                            'affiliate_browser' => $affiliate_clientbrowser,
+                            'affiliate_ipaddress' => $affiliate_clientip,
+                            'affiliate_value' => $affiliate_total,
+                            'affiliate_payment' => $affiliate_payment,
+                            'affiliate_orders_id' => $insert_id,
+                            'affiliate_clickthroughs_id' => $affiliate_clickthroughs_id,
+                            'affiliate_percent' => $affiliate_percent,
+                            'affiliate_salesman' => $affiliate_ref);
+    tep_db_perform(TABLE_AFFILIATE_SALES, $sql_data_array);
+
+    if (AFFILATE_USE_TIER == 'true') {
+      $affiliate_tiers_query = tep_db_query ("SELECT aa2.affiliate_id, (aa2.affiliate_rgt - aa2.affiliate_lft) as height
+                                                      FROM affiliate_affiliate AS aa1, affiliate_affiliate AS aa2
+                                                      WHERE  aa1.affiliate_root = aa2.affiliate_root
+                                                            AND aa1.affiliate_lft BETWEEN aa2.affiliate_lft AND aa2.affiliate_rgt
+                                                            AND aa1.affiliate_rgt BETWEEN aa2.affiliate_lft AND aa2.affiliate_rgt
+                                                            AND aa1.affiliate_id =  '" . $affiliate_ref . "'
+                                                      ORDER by height asc limit 1, " . AFFILIATE_TIER_LEVELS . "
+                                              ");
+      $affiliate_tier_percentage = split("[;]" , AFFILIATE_TIER_PERCENTAGE);
+      $i=0;
+      while ($affiliate_tiers_array = tep_db_fetch_array($affiliate_tiers_query)) {
+
+        $affiliate_percent = $affiliate_tier_percentage[$i];
+        $affiliate_payment = tep_round(($affiliate_total * $affiliate_percent / 100), 2);
+        if ($affiliate_payment > 0) {
+          $sql_data_array = array('affiliate_id' => $affiliate_tiers_array['affiliate_id'],
+                                  'affiliate_date' => $affiliate_clientdate,
+                                  'affiliate_browser' => $affiliate_clientbrowser,
+                                  'affiliate_ipaddress' => $affiliate_clientip,
+                                  'affiliate_value' => $affiliate_total,
+                                  'affiliate_payment' => $affiliate_payment,
+                                  'affiliate_orders_id' => $insert_id,
+                                  'affiliate_clickthroughs_id' => $affiliate_clickthroughs_id,
+                                  'affiliate_percent' => $affiliate_percent,
+                                  'affiliate_salesman' => $affiliate_ref);
+          tep_db_perform(TABLE_AFFILIATE_SALES, $sql_data_array);
+        }
+        $i++;
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/affiliate_configure.php
===================================================================
--- trunk/direct.openmoko.com/includes/affiliate_configure.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/affiliate_configure.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_configure.php,v 1.1.1.1 2004/03/04 23:40:36 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('AFFILIATE_KIND_OF_BANNERS','1');          // 1 Direct Link to Banner ; no counting of how much banners are shown
+                                                    // 2 Banners are shown with affiliate_show_banner.php; bannerviews are counted (recommended)
+  define('AFFILIATE_SHOW_BANNERS_DEBUG', 'false');  // Debug for affiliate_show_banner.php; If you have difficulties geting banners set to true,
+                                                    // and try to load the banner in a new Browserwindow
+                                                    // i.e.: http://yourdomain.com/affiliate_show_banner.php?ref=3569&affiliate_banner_id=3
+  define('AFFILIATE_SHOW_BANNERS_DEFAULT_PIC', '/images/banners/oscommerce.gif'); // absolute path to default pic for affiliate_show_banner.php, which is showed if no banner is found
+                                                    // Only works with AFFILIATE_KIND_OF_BANNERS=2
+?>

Added: trunk/direct.openmoko.com/includes/application_bottom.php
===================================================================
--- trunk/direct.openmoko.com/includes/application_bottom.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/application_bottom.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: application_bottom.php,v 1.1.1.1 2004/03/04 23:40:36 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+/*--------------------------------------------------------*\
+# Page cache contribution - by Chemo
+# CRE Mods - by Clarocque
+\*--------------------------------------------------------*/
+if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && 
+class_exists('page_cache')) {
+global $page_cache;
+$page_cache->end_page_cache();
+}#eof if
+# eof Page Cache
+//include($cart_links);
+  tep_session_close();
+
+  if (STORE_PAGE_PARSE_TIME == 'true') {
+    $time_start = explode(' ', PAGE_PARSE_START_TIME);
+    $time_end = explode(' ', microtime());
+    $parse_time = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
+    error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' - ' . getenv('REQUEST_URI') . ' (' . $parse_time . 's)' . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
+
+    if (DISPLAY_PAGE_PARSE_TIME == 'true') {
+      echo '<span class="smallText">Parse Time: ' . $parse_time . 's</span>';
+    }
+  }
+
+  if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded == true) && ($ini_zlib_output_compression < 1) ) {
+    if ( (PHP_VERSION < '4.0.4') && (PHP_VERSION >= '4') ) {
+      tep_gzip_output(GZIP_LEVEL);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/application_top.php
===================================================================
--- trunk/direct.openmoko.com/includes/application_top.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/application_top.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,806 @@
+<?php
+/*
+  $Id: application_top.php,v 1.1.1.1 2004/03/04 23:40:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// start the timer for the page parse time log
+  define('PAGE_PARSE_START_TIME', microtime());
+  define('UPS_LOG_FILE','D:/tmp/omshop/upslog.txt');
+  define('UPS_ERROR_FILE','D:/tmp/omshop/upserror.txt');
+
+// set the level of error reporting
+  error_reporting(E_ALL & ~E_NOTICE);
+  //error_reporting(E_ALL);
+
+// check if register_globals is enabled.
+// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
+  if (function_exists('ini_get')) {
+    ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');
+  }
+
+// Set the local configuration parameters - mainly for developers
+  if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');
+
+define('TEXT_PREFIX', 'text_');
+define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 4); //Must match id for user defined "TEXT" value in db table TABLE_PRODUCTS_OPTIONS_VALUES
+
+ 
+// include server parameters
+#  require('includes/configure.php');
+if (file_exists('includes/configure.php')) {
+  require('includes/configure.php');
+} else {
+  echo '<a href="install/index.php"><b>Proceed to installation</b></a>';
+exit();
+}
+// define the project version
+//  define('PROJECT_VERSION', '[CRE Loaded6 v6.1]');
+include('includes/version.php');
+
+// set the type of request (secure or not)
+  $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
+
+// set php_self in the local scope
+  if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
+
+  if ($request_type == 'NONSSL') {
+    define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
+  } else {
+    define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
+  }
+
+// set php_self in the local scope
+  $PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);
+// include the list of project filenames
+  require(DIR_WS_INCLUDES . 'filenames.php');
+
+// include the list of project database tables
+  require(DIR_WS_INCLUDES . 'database_tables.php');
+
+// customization for the design layout
+//define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)
+
+// include the database functions
+  require(DIR_WS_FUNCTIONS . 'database.php');
+
+// make a connection to the database... now
+  tep_db_connect() or die('Unable to connect to database server!');
+
+// set the application parameters
+  $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+    define($configuration['cfgKey'], $configuration['cfgValue']);
+  }
+
+// if gzip_compression is enabled, start to buffer the output
+  if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {
+    if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {
+      if (PHP_VERSION >= '4.0.4') {
+        ob_start('ob_gzhandler');
+      } else {
+        include(DIR_WS_FUNCTIONS . 'gzip_compression.php');
+        ob_start();
+        ob_implicit_flush();
+      }
+    } else {
+      ini_set('zlib.output_compression_level', GZIP_LEVEL);
+    }
+  }
+  
+include('includes/application_top_cre_setting.php');  
+  
+if (TEMPLATE_USE_CONFIGURABLE_PRODUCT_INFO == 'true'){
+     define('CONTENT_PRODUCT_INFO', 'product_info_configureable');
+  }else{ 
+     define('CONTENT_PRODUCT_INFO', 'product_info');
+  }
+
+define('FILENAME_PRODUCT_INFO', CONTENT_PRODUCT_INFO . '.php');
+
+// define general functions used application-wide
+  require(DIR_WS_FUNCTIONS . 'general.php');
+  require(DIR_WS_FUNCTIONS . 'html_output.php');
+
+// include calendar class
+require(DIR_WS_CLASSES . 'calendar.php');
+
+// set the cookie domain
+  $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);
+  $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH);
+
+// include cache functions if enabled
+  if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php');
+
+// include shopping cart class
+  require(DIR_WS_CLASSES . 'shopping_cart.php');
+// begin PayPal_Shopping_Cart_IPN 2.8 (DMG)
+    require(DIR_WS_MODULES . 'payment/paypal/classes/osC/osC.class.php');
+// end PayPal_Shopping_Cart_IPN
+
+// include navigation history class
+  require(DIR_WS_CLASSES . 'navigation_history.php');
+
+// some code to solve compatibility issues
+  require(DIR_WS_FUNCTIONS . 'compatibility.php');
+
+// define how the session functions will be used
+  require(DIR_WS_FUNCTIONS . 'sessions.php');
+
+  // set the session name and save path
+  tep_session_name('osCsid');
+  tep_session_save_path(SESSION_WRITE_DIRECTORY);
+
+  // set the session cookie parameters
+  session_set_cookie_params(0, $cookie_path, $cookie_domain);
+  
+  $session_started = false;
+  // If the is a coolie with the session name, use it and ignore all else
+  if ( isset($_COOKIE[tep_session_name()]) ) {
+    tep_session_id($_COOKIE[tep_session_name()]);
+    tep_session_start();
+    $session_started = true;
+  // if there is a $_POST session id passed, use it
+  } elseif ( isset($_POST[tep_session_name()]) ) {
+    tep_session_id($_POST[tep_session_name()]);
+    tep_session_start();
+    $session_started = true;
+  // if SSL and there is a $_GET session id, use it
+  } elseif ( ($request_type == 'SSL') && isset($_GET[tep_session_name()]) ) {
+    tep_session_id($_GET[tep_session_name()]);
+    tep_session_start();
+    $session_started = true;
+  // At this point, a session needs to be created
+  // Check for Forced cookie usage
+  } elseif (SESSION_FORCE_COOKIE_USE == 'True') {
+    tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);
+    // If this is the 2nd time thru, cookies may be working
+    if ( isset($_COOKIE['cookie_test']) ) {
+      tep_session_start();
+      $session_started = true;
+    }
+  // Check for spider may be required
+  } elseif (SESSION_BLOCK_SPIDERS == 'True') {
+    $user_agent = strtolower(getenv('HTTP_USER_AGENT'));
+    $spider_flag = false;
+    if ( tep_not_null($user_agent) ) {
+      $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');
+      for ($i=0, $n=sizeof($spiders); $i<$n; ++$i) {
+        if ( tep_not_null($spiders[$i]) ) {
+          if ( is_integer( strpos($user_agent, trim($spiders[$i])) ) ) {
+            $spider_flag = true;
+            // no need to create a session
+            break;
+          }
+        }
+      }
+    }
+    if ($spider_flag == false) {
+      tep_session_start();
+      $session_started = true;
+    }
+  // At this point, all checks are complete, so start a session
+  } else {
+    tep_session_start();
+    $session_started = true;
+  }
+
+// set SID once, even if empty
+  $SID = (defined('SID') ? SID : '');
+
+// verify the ssl_session_id if the feature is enabled
+  if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {
+    $ssl_session_id = getenv('SSL_SESSION_ID');
+    if (!tep_session_is_registered('SSL_SESSION_ID')) {
+      $SESSION_SSL_ID = $ssl_session_id;
+      tep_session_register('SESSION_SSL_ID');
+    }
+
+    if ($SESSION_SSL_ID != $ssl_session_id) {
+      tep_session_destroy();
+      tep_redirect(tep_href_link(FILENAME_SSL_CHECK));
+    }
+  }
+
+// verify the browser user agent if the feature is enabled
+  if (SESSION_CHECK_USER_AGENT == 'True') {
+    $http_user_agent = getenv('HTTP_USER_AGENT');
+    if (!tep_session_is_registered('SESSION_USER_AGENT')) {
+      $SESSION_USER_AGENT = $http_user_agent;
+      tep_session_register('SESSION_USER_AGENT');
+    }
+
+    if ($SESSION_USER_AGENT != $http_user_agent) {
+      tep_session_destroy();
+      tep_redirect(tep_href_link(FILENAME_LOGIN));
+    }
+  }
+
+// verify the IP address if the feature is enabled
+  if (SESSION_CHECK_IP_ADDRESS == 'True') {
+    $ip_address = tep_get_ip_address();
+    if (!tep_session_is_registered('SESSION_IP_ADDRESS')) {
+      $SESSION_IP_ADDRESS = $ip_address;
+      tep_session_register('SESSION_IP_ADDRESS');
+    }
+
+    if ($SESSION_IP_ADDRESS != $ip_address) {
+      tep_session_destroy();
+      tep_redirect(tep_href_link(FILENAME_LOGIN));
+    }
+  }
+
+// create the shopping cart & fix the cart if necesary
+  if (tep_session_is_registered('cart') && is_object($cart)) {
+    if (PHP_VERSION < 4) {
+      $broken_cart = $cart;
+      $cart = new shoppingCart;
+      $cart->unserialize($broken_cart);
+    }
+  } else {
+    tep_session_register('cart');
+    $cart = new shoppingCart;
+  }
+
+// begin PayPal_Shopping_Cart_IPN V2.8 DMG
+//   require_once DIR_WS_MODULES . 'payment/paypal/functions/paypal.fnc.php';
+  PayPal_osC::check_order_status(true);
+// end PayPal_Shopping_Cart_IPN
+
+// include currencies class and create an instance
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+//Eversun mod for sppc and qty price breaks
+require(DIR_WS_CLASSES . 'PriceFormatter.php');
+  $pf = new PriceFormatter;
+ // Eversun end mod for sppc and qty price breaks
+// include the mail classes
+  require(DIR_WS_CLASSES . 'mime.php');
+  require(DIR_WS_CLASSES . 'email.php');
+
+  // ensure that the followin variables are loaded from the session information
+  $customer_id = (int)$_SESSION['customer_id'];
+  
+  
+// set the language
+  if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
+    if (!tep_session_is_registered('language')) {
+      tep_session_register('language');
+      tep_session_register('languages_id');
+    }
+
+    include(DIR_WS_CLASSES . 'language.php');
+    $lng = new language();
+
+    if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
+      $lng->set_language($HTTP_GET_VARS['language']);
+    } else {
+      $lng->get_browser_language();
+    }
+
+    $language = $lng->language['directory'];
+    $languages_id = $lng->language['id'];
+  }
+
+// include the language translations
+  require(DIR_WS_LANGUAGES . $language . '.php');
+
+// currency
+  if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {
+    if (!tep_session_is_registered('currency')) tep_session_register('currency');
+
+    if (isset($HTTP_GET_VARS['currency'])) {
+      if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
+    } else {
+      $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
+    }
+  }
+
+// navigation history
+  if (tep_session_is_registered('navigation')) {
+    if (PHP_VERSION < 4) {
+      $broken_navigation = $navigation;
+      $navigation = new navigationHistory;
+      $navigation->unserialize($broken_navigation);
+    }
+  } else {
+    tep_session_register('navigation');
+    $navigation = new navigationHistory;
+  }
+  $navigation->add_current_page();
+
+// BOF: Down for Maintenance except for admin ip
+if (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE != getenv('REMOTE_ADDR')){
+  if (DOWN_FOR_MAINTENANCE=='true' and !strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) { tep_redirect(tep_href_link(DOWN_FOR_MAINTENANCE_FILENAME)); }
+  }
+// do not let people get to down for maintenance page if not turned on
+if (DOWN_FOR_MAINTENANCE=='false' and strstr($PHP_SELF,DOWN_FOR_MAINTENANCE_FILENAME)) {
+    tep_redirect(tep_href_link(FILENAME_DEFAULT));
+}
+// EOF: WebMakers.com Added: Down for Maintenance
+
+
+// BOF: WebMakers.com Added: Functions Library
+    include(DIR_WS_FUNCTIONS . 'webmakers_added_functions.php');
+// EOF: WebMakers.com Added: Functions Library
+
+// Shopping cart actions
+
+  if (isset($HTTP_GET_VARS['action'])) {
+// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
+    if ($session_started == false) {
+      tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
+    }
+
+    if (DISPLAY_CART == 'true') {
+      $goto =  FILENAME_SHOPPING_CART;
+      $parameters = array('action', 'cPath', 'products_id', 'pid');
+    } else {
+      $goto = basename($PHP_SELF);
+      if ($HTTP_GET_VARS['action'] == 'buy_now') {
+        $parameters = array('action', 'pid', 'products_id');
+      } else {
+        $parameters = array('action', 'pid');
+      }
+    }
+    switch ($HTTP_GET_VARS['action']) {
+      // customer wants to update the product quantity in their shopping cart
+      case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {
+                                if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {
+                                  $cart->remove($HTTP_POST_VARS['products_id'][$i]);
+                                } else {
+                                  if (PHP_VERSION < 4) {
+                                    // if PHP3, make correction for lack of multidimensional array.
+                                    reset($HTTP_POST_VARS);
+                                    while (list($key, $value) = each($HTTP_POST_VARS)) {
+                                      if (is_array($value)) {
+                                        while (list($key2, $value2) = each($value)) {
+                                          if (ereg ("(.*)\]\[(.*)", $key2, $var)) {
+                                            $id2[$var[1]][$var[2]] = $value2;
+                                          }
+                                        }
+                                      }
+                                    }
+                                    $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';
+                                  } else {
+                                    $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';
+                                  }
+                                  
+                   //Eversun mod for sppc and qty price breaks
+                                 // $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);
+/*
+                  $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']);
+                  */
+                   $cart->add_cart($HTTP_POST_VARS['products_id'][$i],  $HTTP_POST_VARS['cart_quantity'][$i],$attributes, false);
+                  //Eversun mod end for sppc and qty price breaks
+                                }
+                              }
+                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
+                              break;
+/*
+      // customer adds a product from the products page
+      case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
+                                $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
+                              }
+                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
+                              break;
+*/
+
+
+
+      // customer adds a product from the products page
+      case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
+                  if (tep_session_is_registered('customer_id')) tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id");
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product, add sub products into cart
+  if (isset($HTTP_POST_VARS['sub_products_qty'])) {
+    $i = 0;
+    foreach ($HTTP_POST_VARS['sub_products_id'] as $sub_products_id) {
+      if ($sub_products_qty[$i] > 0) {
+        $cart->add_cart($sub_products_id, $cart->get_quantity($sub_products_id)+$sub_products_qty[$i], $HTTP_POST_VARS['id']);
+      }
+      $i++;
+    }
+  } else {
+                  /*
+                  $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+$quantity, $HTTP_POST_VARS['id']); // VJ product quantity changed
+*/
+     // Eversun mod for SPPP Qty Price Break Enhancement
+                   $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']);
+                // Eversun mod end for SPPP Qty Price Break Enhancement
+                }
+                // MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+                              }
+                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters), 'NONSSL'));
+   break;
+      // customer adds a product from the products page
+
+// Wishlist Checkboxes - start
+case 'add_del_products_wishlist' : 
+  //delete selected products from wishlist
+  if (isset($HTTP_POST_VARS['del_wishprod'])) {
+    foreach ($HTTP_POST_VARS['del_wishprod'] as $value) {
+      if (ereg('^[0-9]+$', $value)) {
+           tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = $value and customers_id = '" . $customer_id . "'");
+         }
+     }
+  }
+  // add selected products to wishlist
+  if (isset($HTTP_POST_VARS['add_wishprod'])) {
+    foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
+      if (ereg('^[0-9]+$', $value)) {
+        tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = $value and customers_id = '" . $customer_id . "'");
+        $cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id'][$value]))+1, $HTTP_POST_VARS['id'][$value]);
+      }
+    }
+  }
+  $wishlist_query_raw = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 and customers_id > 0 order by products_name";
+  $wishlist_query = tep_db_query($wishlist_query_raw);
+
+  if ( (!tep_db_num_rows($wishlist_query)) && ($cart->count_contents() > 0) ) {
+    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+  }else{
+    tep_redirect(tep_href_link(FILENAME_WISHLIST));
+  }
+  break;
+// Wishlist Checkboxes - end
+
+// Add product to the wishlist
+      case 'add_wishlist' :   if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {
+                                if ($HTTP_POST_VARS['products_id']) {
+                                  tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
+                                  tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $HTTP_POST_VARS['products_id'] . "', '" . tep_db_input($HTTP_POST_VARS['products_model']) . "', '" . tep_db_input($$HTTP_POST_VARS['products_name']) . "', '" . tep_db_input($HTTP_POST_VARS['products_price']) . "' )");
+                                  // Eversun mod for wishlist attribute
+                                  tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
+                                  if (isset ($HTTP_POST_VARS['id'])) {
+                                    foreach($HTTP_POST_VARS['id'] as $att_option => $att_value) {
+                                      tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $HTTP_POST_VARS['products_id'] . "', '" . (int)$att_option . "', '" . (int)$att_value . "' )");
+                                    }
+                                  }
+                                  // Eversun mod end for wishlist attribute
+                                }
+                              }
+                              tep_redirect(tep_href_link(FILENAME_WISHLIST));
+                              break;
+
+
+      /*  this code has been removed becuase it it is no longer used in the cart
+      case 'wishlist_add_cart': reset ($lvnr);
+                                reset ($lvanz);
+                                  while (list($key,$elem) =each ($lvnr))
+                                        {
+                                        (list($key1,$elem1) =each ($lvanz));
+                                        tep_db_query("update " . TABLE_WISHLIST . " set products_quantity = '" . $elem1 . "' where customers_id = '" . $customer_id . "' and products_id = '" . $elem . "'");
+                                        tep_db_query("delete from " . TABLE_WISHLIST . " where customers_id= '" . $customer_id . "' and products_quantity = '999'");
+                                        $produkte_mit_anzahl=tep_db_query("select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id = '" . $elem . "' and products_quantity<>'0'");
+
+                                  while ($HTTP_GET_VARS=tep_db_fetch_array($produkte_mit_anzahl))
+                                  {
+                                  $cart->add_cart($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['products_quantity']);
+                                  }
+                                          }
+                                reset ($lvanz);
+                              tep_redirect(tep_href_link(FILENAME_WISHLIST));
+                              break;
+      */
+
+// remove item from the wishlist
+      case 'remove_wishlist':
+                              tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . (int)$HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'");
+                              tep_redirect(tep_href_link(FILENAME_WISHLIST));
+                              break;
+
+      // performed by the 'buy now' button in product listings and review page
+      case 'buy_now' :        if ( isset($HTTP_GET_VARS['products_id']) || ereg('^[0-9]+$', $HTTP_GET_VARS['products_id']) ) {
+                                //Wishlist 2.0.1 Modification
+                                 if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id= '" . $HTTP_GET_VARS['products_id'] . "'"); }
+                                // End Wishlist 2.0.1 Modification
+                                if (tep_has_product_attributes($HTTP_GET_VARS['products_id']) || tep_has_product_subproducts($HTTP_GET_VARS['products_id']) ) {
+                                  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
+                                } else {
+                                  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
+                                }
+                              }
+                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
+                              break;
+
+      case 'notify' :         if (tep_session_is_registered('customer_id')) {
+                                if (isset($HTTP_GET_VARS['products_id'])) {
+                                  $notify = $HTTP_GET_VARS['products_id'];
+                                } elseif (isset($HTTP_GET_VARS['notify'])) {
+                                  $notify = $HTTP_GET_VARS['notify'];
+                                } elseif (isset($HTTP_POST_VARS['notify'])) {
+                                  $notify = $HTTP_POST_VARS['notify'];
+                                } else {
+                                  tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
+                                }
+                                if (!is_array($notify)) $notify = array($notify);
+                                for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
+                                  $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$notify[$i] . "' and customers_id = '" . $customer_id . "'");
+                                  $check = tep_db_fetch_array($check_query);
+                                  if ($check['count'] < 1) {
+                                    tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . (int)$notify[$i] . "', '" . $customer_id . "', now())");
+                                  }
+                                }
+                                tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
+                              } else {
+                                $navigation->set_snapshot();
+                                tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+                              }
+                              break;
+      case 'notify_remove' :  if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {
+                                $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
+                                $check = tep_db_fetch_array($check_query);
+                                if ($check['count'] > 0) {
+                                  tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
+                                }
+                                tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));
+                              } else {
+                                $navigation->set_snapshot();
+                                tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+                              }
+                              break;
+
+
+      case 'cust_order' :     if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
+                                if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {
+                                  // Although the product has attributes we still delete it from the WISHLIST:
+                                  if ($rfw == 1) tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id='" . (int)$HTTP_GET_VARS['pid'] . "'");
+                                  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$HTTP_GET_VARS['pid'], 'NONSSL'));
+                                } else {
+                                  // First delete from wishlist:
+                                  if ($rfw == 1) tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id='" . (int)$HTTP_GET_VARS['pid'] . "'");
+                                  $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);
+                                }
+                              }
+                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters), 'NONSSL'));
+                              break;
+
+    }
+  }
+
+// encrypt
+if (PAYMENT_CC_CRYPT =='True'){
+require(DIR_WS_FUNCTIONS . 'crypt.php');
+}
+
+// include the who's online functions
+ if (basename($PHP_SELF) != FILENAME_EVENTS_CALENDAR_CONTENT){
+  require(DIR_WS_FUNCTIONS . 'whos_online.php');
+  tep_update_whos_online();
+}
+// include the password crypto functions
+  require(DIR_WS_FUNCTIONS . 'password_funcs.php');
+
+// include validation functions (right now only email address)
+  require(DIR_WS_FUNCTIONS . 'validations.php');
+
+// split-page-results
+  require(DIR_WS_CLASSES . 'split_page_results.php');
+
+// Lango added for template BOF:
+  require(DIR_WS_INCLUDES . 'template_application_top.php');
+// Lango added for template EOF:
+
+
+// auto activate and expire banners
+  require(DIR_WS_FUNCTIONS . 'banner.php');
+  tep_activate_banners();
+  tep_expire_banners();
+
+// auto expire special products
+  require(DIR_WS_FUNCTIONS . 'specials.php');
+  tep_expire_specials();
+
+// auto expire featured products
+  require(DIR_WS_FUNCTIONS . 'featured.php');
+  tep_expire_featured();
+// calculate category path
+  if (isset($HTTP_GET_VARS['cPath'])) {
+    $cPath = $HTTP_GET_VARS['cPath'];
+  } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
+    $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
+  } else {
+    $cPath = '';
+  }
+
+  if (tep_not_null($cPath)) {
+    $cPath_array = tep_parse_category_path($cPath);
+    $cPath = implode('_', $cPath_array);
+    $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
+  } else {
+    $current_category_id = 0;
+  }
+
+/*--------------------------------------------------------*\
+# Page cache contribution - by Chemo
+#   CRE Mods - by Clarocque
+# Define the pages to be cached in the $cache_pages array
+\*--------------------------------------------------------*/
+define('PAGE_CACHE_DIR', DIR_FS_CATALOG . 'cache/'); // the path to cache folder
+////////////// PAGES TO CACHE ARE LISTED HERE////////////////////
+$cache_pages = array('index.php', 'product_info.php');
+
+if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true') {
+   # Start the output buffer for the shopping cart
+   ob_start();
+    # cart info box
+      $column_query = tep_db_query('select display_in_column as cfgcol, infobox_file_name as cfgtitle,
+    infobox_display as cfgvalue, infobox_define as cfgkey, display_in_column as cfgcol, box_heading,
+    box_template, box_heading_font_color from ' . TABLE_INFOBOX_CONFIGURATION . ' where template_id = ' .
+    TEMPLATE_ID . ' and infobox_display = "yes" and infobox_file_name = "shopping_cart.php" ');
+
+      while ($column = tep_db_fetch_array($column_query)) {
+        #MOD-clarocque
+        #MOD if ( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle'])) {
+        define($column['cfgkey'],$column['box_heading']);
+        $infobox_define = $column['box_heading'];
+        $infobox_template = $column['box_template'];
+        $font_color = $column['box_heading_font_color'];
+        $infobox_class = $column['box_template'];
+        $infobox_side = $column['cfgcol'];
+     #MOD require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle']);
+        file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle'])
+         ? require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/' . $column['cfgtitle'])
+      #   : require(DIR_WS_BOXES . $column['cfgtitle']);    #  DMG attempt at ATS fix
+      :require(DIR_WS_TEMPLATES . 'default/boxes/' . $column['cfgtitle']);
+       #MOD}# if
+       }#eof while
+   $cart_cache = ob_get_clean();
+
+   # End the output buffer for cart and save as $cart_cache string
+
+      # Loop through the $cache_pages array and start caching if found
+    
+     foreach ($cache_pages as $index => $page){
+           if (strpos($_SERVER['PHP_SELF'], $page) ){
+       include_once(DIR_WS_CLASSES . 'page_cache.php');
+       $page_cache = new page_cache($cart_cache);
+      $page_cache->cache_this_page();
+      }# eof if
+      } #eof foreach
+ } #eof if enabled      
+#eof page cache
+
+
+// include the breadcrumb class and start the breadcrumb trail
+  require(DIR_WS_CLASSES . 'breadcrumb.php');
+  $breadcrumb = new breadcrumb;
+
+  $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
+  $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));
+
+// add category names or the manufacturer name to the breadcrumb trail
+  if (isset($cPath_array)) {
+    for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
+      $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
+      if (tep_db_num_rows($categories_query) > 0) {
+        $categories = tep_db_fetch_array($categories_query);
+        $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
+      } else {
+        break;
+      }
+    }
+  } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
+    $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
+    if (tep_db_num_rows($manufacturers_query)) {
+      $manufacturers = tep_db_fetch_array($manufacturers_query);
+      $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
+    }
+  }
+
+// add the products model to the breadcrumb trail
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+    if (tep_db_num_rows($model_query)) {
+      $model = tep_db_fetch_array($model_query);
+      $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
+    }
+  }
+// For Article Manager Begin DMG
+
+// include the articles functions
+  require(DIR_WS_FUNCTIONS . 'articles.php');
+  require(DIR_WS_FUNCTIONS . 'article_header_tags.php'); 
+
+// calculate topic path
+  if (isset($HTTP_GET_VARS['tPath'])) {
+    $tPath = $HTTP_GET_VARS['tPath'];
+  } elseif (isset($HTTP_GET_VARS['articles_id']) && !isset($HTTP_GET_VARS['authors_id'])) {
+    $tPath = tep_get_article_path($HTTP_GET_VARS['articles_id']);
+  } else {
+    $tPath = '';
+  }
+
+  if (tep_not_null($tPath)) {
+    $tPath_array = tep_parse_topic_path($tPath);
+    $tPath = implode('_', $tPath_array);
+    $current_topic_id = $tPath_array[(sizeof($tPath_array)-1)];
+  } else {
+    $current_topic_id = 0;
+  }
+
+// add topic names or the author name to the breadcrumb trail
+  if (isset($tPath_array)) {
+    for ($i=0, $n=sizeof($tPath_array); $i<$n; $i++) {
+      $topics_query = tep_db_query("select topics_name from " . TABLE_TOPICS_DESCRIPTION . " where topics_id = '" . (int)$tPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
+      if (tep_db_num_rows($topics_query) > 0) {
+        $topics = tep_db_fetch_array($topics_query);
+        $breadcrumb->add($topics['topics_name'], tep_href_link(FILENAME_ARTICLES, 'tPath=' . implode('_', array_slice($tPath_array, 0, ($i+1)))));
+      } else {
+        break;
+      }
+    }
+  } elseif (isset($HTTP_GET_VARS['authors_id'])) {
+    $authors_query = tep_db_query("select authors_name from " . TABLE_AUTHORS . " where authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "'");
+    if (tep_db_num_rows($authors_query)) {
+      $authors = tep_db_fetch_array($authors_query);
+      $breadcrumb->add('Articles by ' . $authors['authors_name'], tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $HTTP_GET_VARS['authors_id']));
+    }
+  }
+
+// add the articles name to the breadcrumb trail
+  if (isset($HTTP_GET_VARS['articles_id'])) {
+    $article_query = tep_db_query("select articles_name from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "'");
+    if (tep_db_num_rows($article_query)) {
+      $article = tep_db_fetch_array($article_query);
+      if (isset($HTTP_GET_VARS['authors_id'])) {
+        $breadcrumb->add($article['articles_name'], tep_href_link(FILENAME_ARTICLE_INFO, 'authors_id=' . $HTTP_GET_VARS['authors_id'] . '&articles_id=' . $HTTP_GET_VARS['articles_id']));
+      } else {
+        $breadcrumb->add($article['articles_name'], tep_href_link(FILENAME_ARTICLE_INFO, 'tPath=' . $tPath . '&articles_id=' . $HTTP_GET_VARS['articles_id']));
+      }
+    }
+  }
+    $cart_links = DIR_WS_JAVASCRIPT . 'cart_links.js.php';
+
+//for article manager end - DMG
+
+// initialize the message stack for output messages
+  require(DIR_WS_CLASSES . 'message_stack.php');
+  $messageStack = new messageStack;
+
+// set which precautions should be checked
+  define('WARN_INSTALL_EXISTENCE', 'true');
+  define('WARN_CONFIG_WRITEABLE', 'true');
+  define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
+  define('WARN_SESSION_AUTO_START', 'true');
+  define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
+// Include OSC-AFFILIATE
+  require(DIR_WS_INCLUDES . 'affiliate_application_top.php');
+
+if(file_exists("includes/application_top_newsdesk.php"))
+   include("includes/application_top_newsdesk.php");
+   
+if(file_exists("includes/application_top_faqdesk.php"))
+   include("includes/application_top_faqdesk.php");
+
+  
+require(DIR_WS_FUNCTIONS . 'gv_functions.php');
+
+// BOF: WebMakers.com Added: Header Tags Controller v1.0
+  require(DIR_WS_FUNCTIONS . 'header_tags.php');
+// Clean out HTML comments from ALT tags etc.
+    require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php');
+    require_once(DIR_WS_FUNCTIONS . 'header_tags.php');
+  
+
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  require(DIR_WS_FUNCTIONS . 'information_html_output.php');
+
+// down for manpatance code, moved from main_page.tpl.php
+if (DOWN_FOR_MAINTENANCE == 'true') {
+  $maintenance_on_at_time_raw = tep_db_query("select last_modified from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'DOWN_FOR_MAINTENANCE'");
+  $maintenance_on_at_time= tep_db_fetch_array($maintenance_on_at_time_raw);
+  define('TEXT_DATE_TIME', $maintenance_on_at_time['last_modified']);
+}
+?>

Added: trunk/direct.openmoko.com/includes/application_top_cre_setting.php
===================================================================
--- trunk/direct.openmoko.com/includes/application_top_cre_setting.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/application_top_cre_setting.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: application_top_cre_setting.php ,v 1.
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+//define banner type for box add
+ define('BOX_AD_BANNER_TYPE', 'box-ad');
+ 
+// define setting for wishlist
+  define('MAX_DISPLAY_WISHLIST_PRODUCTS', '6'); // How many wishlist items to show per page on the main wishlist.php file
+  define('MAX_DISPLAY_WISHLIST_BOX', '4'); // How many wishlist items to display in the infobox before it changes to a counter
+
+
+//Settings for gift voucher credit class
+// Set the length of the redeem code, the longer the more secure
+  define('SECURITY_CODE_LENGTH', '10');
+
+//faqdesk
+//define('DIR_WS_RSS', DIR_WS_INCLUDES . 'modules/faqdesk/rss/');
+//newsdesk
+//define('DIR_WS_RSS', DIR_WS_INCLUDES . 'modules/newsdesk/rss/');
+
+//configuration for affiliates.
+  define('AFFILIATE_KIND_OF_BANNERS','1');          // 1 Direct Link to Banner ; no counting of how much banners are shown
+                                                    // 2 Banners are shown with affiliate_show_banner.php; bannerviews are counted (recommended)
+  define('AFFILIATE_SHOW_BANNERS_DEBUG', 'false');  // Debug for affiliate_show_banner.php; If you have difficulties geting banners set to true,
+                                                    // and try to load the banner in a new Browserwindow
+                                                    // i.e.: http://yourdomain.com/affiliate_show_banner.php?ref=3569&affiliate_banner_id=3
+  define('AFFILIATE_SHOW_BANNERS_DEFAULT_PIC', '/images/banners/oscommerce.gif'); // absolute path to default pic for affiliate_show_banner.php, which is showed if no banner is found
+                                                    // Only works with AFFILIATE_KIND_OF_BANNERS=2
+
+
+//add to switch between text and html in emails, should be moved to admin group 12
+ define('TELL_PRODUCT_EMAIL_USE_HTML', 'true');
+ define('TELL_ARTICLE_EMAIL_USE_HTML', 'true');
+ define('GV_EMAIL_USE_HTML', 'true');
+ define('WISH_EMAIL_USE_HTML', 'true');
+ 
+ // upcoming products product listing, this ads the date expected to the colomun for display inthis list only
+  define('PRODUCT_LIST_DATE_EXPECTED', '4');
+//specials
+ define('MAX_DISPLAY_SPECIALS_PRODUCTS', '10');
+//products-new.php New setting define new product interval, how days in the past to since the product was added new products
+ define('NEW_PRODUCT_INTERVAL', '30');
+ 
+//number of upsell products to sell 
+ define('MAX_DISPLAY_XSELL', '4');
+ 
+//maxium artcles to display for articles module
+define('MAX_DISPLAY_MODULES_ARTICLES', '5');
+
+//faq mainpage module
+define('MAX_DISPLAY_MODULES_FAQ_CATEGORY', '5');
+define('MAX_DISPLAY_MODULES_FAQ', '2');
+
+//product_info set up
+define('TEMPLATE_USE_CONFIGURABLE_PRODUCT_INFO', 'false');
+
+//define('CONTENT_PRODUCT_INFO', 'product_info_configureable');
+//product_info modules to use and order
+define('TEMPLATE_PRODUCT_INFO_MODULES_ONE', 'product_discription.php');
+define('TEMPLATE_PRODUCT_INFO_MODULES_TWO', 'product_attributes.php');
+define('TEMPLATE_PRODUCT_INFO_MODULES_THREE', 'additional_images.php');
+define('TEMPLATE_PRODUCT_INFO_MODULES_FOUR', 'product_buttons.php');
+define('TEMPLATE_PRODUCT_INFO_MODULES_FIVE', 'product_quantity_table.php');
+define('TEMPLATE_PRODUCT_INFO_MODULES_SIX', 'featured_products.php');
+define('TEMPLATE_PRODUCT_INFO_MODULES_SEVEN', '');
+define('TEMPLATE_PRODUCT_INFO_MODULES_EIGHT', '');
+define('TEMPLATE_PRODUCT_INFO_MODULES_NINE', '');
+define('TEMPLATE_PRODUCT_INFO_MODULES_TEN', '');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/categories_tab.php
===================================================================
--- trunk/direct.openmoko.com/includes/categories_tab.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/categories_tab.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,120 @@
+<?php
+/*
+  $Id: categories.php,v 1.1.1.1 2003/02/25 02:59:49 root Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+function show_category_tabs($counter) 
+{
+  global $foo, $categories_string, $id, $HTTP_GET_VARS;
+  if ($foo[$counter]['parent'] == 0) {
+    $cPath_new = 'cPath=' . $counter;
+  }
+  if ($HTTP_GET_VARS['cPath'] != 0){
+    $base = substr($HTTP_GET_VARS['cPath'], 0, strpos($HTTP_GET_VARS['cPath'], '_'));
+    if ($counter == $HTTP_GET_VARS['cPath']) {
+      $onpage = 1;
+    } elseif ($counter == $base) {
+      $onpage = 1;
+    }
+  }
+
+  if ($onpage) {
+    $categories_string .= '<li class="here">';
+  } else {
+    $categories_string .= '<li>';
+  }   
+
+  $categories_string .= '<a';
+  if ($onpage) {
+    $categories_string .= ' class="here" href="';
+  } else {
+    $categories_string .= ' href="';
+  }
+  $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string .= '">';
+  // display category name
+  $categories_string .= $foo[$counter]['name'];
+  
+  $categories_string .= '</a></li>';
+
+  
+  if ($foo[$counter]['next_id']) {
+    $onpage = 0;
+    show_category_tabs($foo[$counter]['next_id']);
+  }
+}
+?>
+
+
+<!-- categories //-->
+
+<?php
+  // Always add the home link first
+  $categories_string = '';
+  if (!$cPath) {
+    $onpage = 1;
+  }
+
+  if ($onpage) {
+    $categories_string .= '<li class="here">';
+  } else {
+    $categories_string .= '<li>';
+  } 
+  $categories_string .= '<a';
+  if ($onpage) {
+    $categories_string .= ' class="here" href="';
+  } else {
+    $categories_string .= ' href="';
+  }   
+
+  $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string .= ' ">';
+  // display category name
+  $categories_string .= "Home";
+  
+  $categories_string .= '</a></li>';
+  
+  if ($foo[$counter]['next_id']) {
+    $onpage = 0;
+    show_category_tabs($foo[$counter]['next_id']);
+  }
+  
+  // start the tabs
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+      'name' => $categories['categories_name'],
+      'parent' => $categories['parent_id'],
+      'level' => 0,
+      'path' => $categories['categories_id'],
+      'next_id' => false
+    );
+  
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+  
+    $prev_id = $categories['categories_id'];
+  
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+  
+  show_category_tabs($first_element); 
+  echo $categories_string;
+
+?>
+
+          
+<!-- categories_eof //-->
+
+
+

Added: trunk/direct.openmoko.com/includes/classes/PriceFormatter.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/PriceFormatter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/PriceFormatter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,596 @@
+<?php
+/*
+  $Id: PriceFormatter.php,v 1.6 2003/06/25 08:29:26 petri Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+/*
+    PriceFormatter.php - module to support quantity pricing
+
+    Created 2003, Beezle Software based on some code mods by WasaLab Oy (Thanks!)
+*/
+
+class PriceFormatter {
+  var $hiPrice;
+  var $lowPrice;
+  var $quantity;
+  var $hasQuantityPrice;
+  var $hasCustomersGroupPrice;
+  var $customers_group_thePrice;
+ var $customers_group_lowPrice;
+  var $customers_group_hiPrice;
+  
+ 
+  function PriceFormatter($prices=NULL) {
+    $this->productsID = -1;
+
+    $this->hasQuantityPrice=false;
+
+    $this->hasSpecialPrice=false;
+   $this->hasCustomersGroupPrice=false;
+    $this->hiPrice=-1;
+    $this->lowPrice=-1;
+  $this->customers_group_thePrice=-1;
+  $this->customers_group_lowPrice=-1;
+  $this->customers_group_hiPrice=-1;
+    for ($i=1; $i<=11; $i++){
+      $this->quantity[$i] = -1;
+      $this->prices[$i] = -1;
+    }
+    $this->thePrice = -1;
+    $this->specialPrice = -1;
+    $this->qtyBlocks = 1;
+
+    if($prices)
+      $this->parse($prices);
+  }
+
+  function encode() {
+  $str = $this->productsID . ":"
+         . (($this->hasQuantityPrice == true) ? "1" : "0") . ":"
+         . (($this->hasSpecialPrice == true) ? "1" : "0") . ":"
+         . $this->quantity[1] . ":"
+         . $this->quantity[2] . ":"
+         . $this->quantity[3] . ":"
+         . $this->quantity[4] . ":"
+       . $this->quantity[5] . ":"
+       . $this->quantity[6] . ":"
+       . $this->quantity[7] . ":"
+         . $this->quantity[8] . ":"
+       . $this->quantity[9] . ":"
+       . $this->quantity[10] . ":"
+       . $this->quantity[11] . ":"
+         . $this->price[1] . ":"
+         . $this->price[2] . ":"
+         . $this->price[3] . ":"
+         . $this->price[4] . ":"
+       . $this->price[5] . ":"
+       . $this->price[6] . ":"
+       . $this->price[7] . ":"
+         . $this->price[8] . ":"
+       . $this->price[9] . ":"
+       . $this->price[10] . ":"
+       . $this->price[11] . ":"
+         . $this->thePrice . ":"
+         . $this->specialPrice . ":"
+         . $this->qtyBlocks . ":"
+         . $this->taxClass;
+  return $str;
+  }
+
+  function decode($str) {
+  list($this->productsID,
+       $this->hasQuantityPrice,
+       $this->hasSpecialPrice,
+       $this->quantity[1],
+       $this->quantity[2],
+       $this->quantity[3],
+       $this->quantity[4],
+       $this->quantity[5],
+       $this->quantity[6],
+       $this->quantity[7],
+       $this->quantity[8],
+     $this->quantity[9],
+     $this->quantity[10],
+     $this->quantity[11],
+       $this->price[1],
+       $this->price[2],
+       $this->price[3],
+       $this->price[4],
+       $this->price[5],
+       $this->price[6],
+       $this->price[7],
+       $this->price[8],
+     $this->price[9],
+     $this->price[10],
+    $this->price[11],
+       $this->thePrice,
+       $this->specialPrice,
+       $this->qtyBlocks,
+       $this->taxClass) = explode(":", $str);
+
+  $this->hasQuantityPrice = (($this->hasQuantityPrice == 1) ? true : false);
+  $this->hasSpecialPrice = (($this->hasSpecialPrice == 1) ? true : false);
+  }
+
+  function parse($prices) {
+  
+    $this->productsID = $prices['products_id'];
+    $this->hasQuantityPrice=false;
+    $this->hasSpecialPrice=false;
+$this->hasCustomersGroupPrice='false';
+    $this->quantity[1]=$prices['products_price1_qty'];
+    $this->quantity[2]=$prices['products_price2_qty'];
+    $this->quantity[3]=$prices['products_price3_qty'];
+    $this->quantity[4]=$prices['products_price4_qty'];
+    $this->quantity[5]=$prices['products_price5_qty'];
+    $this->quantity[6]=$prices['products_price6_qty'];
+    $this->quantity[7]=$prices['products_price7_qty'];
+    $this->quantity[8]=$prices['products_price8_qty'];
+  $this->quantity[9]=$prices['products_price9_qty'];
+  $this->quantity[10]=$prices['products_price10_qty'];
+  $this->quantity[11]=$prices['products_price11_qty'];
+
+    $this->thePrice=$prices['products_price'];
+//    $this->specialPrice=$prices['specials_new_products_price'];
+
+// BOF QTY Price Break
+    $this->specialPrice=tep_get_products_special_price($prices['products_id']);
+// EOF QTY Price Break
+
+  $this->hasSpecialPrice=tep_not_null($this->specialPrice);
+
+  $this->price[1]=$prices['products_price1'];
+    $this->price[2]=$prices['products_price2'];
+    $this->price[3]=$prices['products_price3'];
+    $this->price[4]=$prices['products_price4'];
+  $this->price[5]=$prices['products_price5'];
+  $this->price[6]=$prices['products_price6'];
+  $this->price[7]=$prices['products_price7'];
+    $this->price[8]=$prices['products_price8'];
+  $this->price[9]=$prices['products_price9'];
+    $this->price[10]=$prices['products_price10'];
+  $this->price[11]=$prices['products_price11'];
+    /*
+       Change support special prices
+     If any price level has a price greater than the special
+     price lower it to the special price
+  */
+  if ($this->hasSpecialPrice == true) {
+    for($i=1; $i<=11; $i++) {
+      if ($this->price[$i] > $this->specialPrice)
+        $this->price[$i] = $this->specialPrice;
+    }
+  }
+  //end changes to support special prices
+
+
+if ( $prices['customers_group_flag']=='true')
+    {
+    $this->hasCustomersGroupPrice='true';
+    $this->customers_group_thePrice=$prices['customers_group_price'];
+      $this->customers_group_price[1]= $prices['customers_group_price1'];
+      $this->customers_group_price[2]= $prices['customers_group_price2'];
+      $this->customers_group_price[3]= $prices['customers_group_price3'];
+      $this->customers_group_price[4]= $prices['customers_group_price4'];
+      $this->customers_group_price[5]= $prices['customers_group_price5'];
+      $this->customers_group_price[6]= $prices['customers_group_price6'];
+      $this->customers_group_price[7]= $prices['customers_group_price7'];
+      $this->customers_group_price[8]= $prices['customers_group_price8'];
+      $this->customers_group_price[9]= $prices['customers_group_price9'];
+      $this->customers_group_price[10]= $prices['customers_group_price10'];
+      $this->customers_group_price[11]= $prices['customers_group_price11'];
+    }
+else
+    {
+      $this->hasCustomersGroupPrice='false';
+      $this->customers_group_thePrice=0;
+      $this->customers_group_price[1]= 0;
+      $this->customers_group_price[2]= 0;
+      $this->customers_group_price[3]= 0;
+      $this->customers_group_price[4]= 0;
+      $this->customers_group_price[5]= 0;
+      $this->customers_group_price[6]= 0;
+      $this->customers_group_price[7]= 0;
+      $this->customers_group_price[8]= 0;
+      $this->customers_group_price[9]= 0;
+      $this->customers_group_price[10]= 0;
+      $this->customers_group_price[11]= 0;
+      
+    }
+    // Eversun mod end for SPPP Qty Price Break Enhancement
+
+   
+    $this->qtyBlocks=$prices['products_qty_blocks'];
+
+    $this->taxClass=$prices['products_tax_class_id'];
+
+    if ($this->quantity[1] > 0) {
+      $this->hasQuantityPrice = true;
+      $this->hiPrice = $this->thePrice;
+      $this->lowPrice = $this->thePrice;
+// Eversun mod for SPPP Qty Price Break Enhancement
+if ( $prices['customers_group_flag']=='true')
+    {
+    $this->customers_group_hiPrice = $this->customers_group_thePrice;
+      $this->customers_group_lowPrice = $this->customers_group_thePrice;
+   // echo $this->customers_group_lowPrice.'{'.$this->customers_group_thePrice;
+    }
+   else
+    {
+      $this->customers_group_hiPrice = 0;
+      $this->customers_group_lowPrice = 0;
+    }
+// Eversun mod end for SPPP Qty Price Break Enhancement
+      for($i=1; $i<=11; $i++) {
+    if($this->quantity[$i] > 0) {
+      if ($this->price[$i] > $this->hiPrice) {
+        $this->hiPrice = $this->price[$i];
+      }
+      if ($this->price[$i] < $this->lowPrice) {
+        $this->lowPrice = $this->price[$i];
+      }
+    }
+    }
+
+// Eversun mod for SPPP Qty Price Break Enhancement
+if ( $prices['customers_group_flag']=='true')
+    {
+for($i=1; $i<=11; $i++) {
+  // echo '{'.$this->customers_group_lowPrice.'--'.$this->customers_group_thePrice.'--'.$this->customers_group_hiPrice.'}';
+    if($this->quantity[$i] > 0) {
+      if ($this->customers_group_price[$i] > $this->customers_group_hiPrice) {
+        $this->customers_group_hiPrice = $this->customers_group_price[$i];
+      }
+      if ($this->customers_group_price[$i] < $this->customers_group_lowPrice) {
+        $this->customers_group_lowPrice = $this->customers_group_price[$i];
+      }
+    }
+    }
+    }
+// Eversun mod end for SPPP Qty Price Break Enhancement
+    }
+
+  }
+
+  function loadProduct($product_id, $language_id=1)
+  {
+    
+  
+    $sql="select pd.products_name, p.products_model, p.products_image, p.products_id," .
+        " p.manufacturers_id, p.products_price, p.products_weight," .
+        " p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8,p.products_price9,p.products_price10,p.products_price11," .
+        " p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_price4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_price8_qty,p.products_price9_qty,p.products_price10_qty,p.products_price11_qty," .
+        " p.products_qty_blocks," .
+        " p.products_tax_class_id," .
+        " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price," .
+        " IF(s.status, s.specials_new_products_price, p.products_price) as final_price" .
+        " from " . TABLE_PRODUCTS . " p " .
+        " left join " . TABLE_SPECIALS . " s using(products_id), " .
+        "      " . TABLE_PRODUCTS_DESCRIPTION . " pd " .
+        " where  p.products_id = '" . (int)$product_id . "'" .
+        "   and pd.products_id = '" . (int)$product_id . "'" .
+        "   and pd.language_id = '". (int)$language_id . "'";
+
+    $product_info_query = tep_db_query($sql);
+    $product_info = tep_db_fetch_array($product_info_query);
+    
+  // Eversun mod for SPPP Qty Price Break Enhancement
+      $product_info['customers_group_price1']= 0;
+      $product_info['customers_group_price2']= 0;
+      $product_info['customers_group_price3']= 0;
+      $product_info['customers_group_price4']= 0;
+      $product_info['customers_group_price5']= 0;
+      $product_info['customers_group_price6']= 0;
+      $product_info['customers_group_price7']= 0;
+      $product_info['customers_group_price8']= 0;
+      $product_info['customers_group_price9']= 0;
+      $product_info['customers_group_price10']= 0;
+      $product_info['customers_group_price11']= 0;
+      $product_info['customers_group_flag']='false';
+
+ $sql1="select  pg.customers_group_price , pg.customers_group_price1 ,pg.customers_group_price2 ,pg.customers_group_price3 ,pg.customers_group_price4 , pg.customers_group_price5 ,pg.customers_group_price6 ,pg.customers_group_price7 ,pg.customers_group_price8 ,pg.customers_group_price9 ,pg.customers_group_price10 ,pg.customers_group_price11" . " from " .TABLE_PRODUCTS_GROUPS ." pg " .    
+        " where  pg.products_id = '". (int)$product_id ."'".
+    "   and pg.customers_group_id = '". (int)$GLOBALS['sppc_customer_group_id'] ."'"  ;
+    
+  $scustomer_group_price_query = tep_db_query($sql1);
+  if(tep_db_num_rows( $scustomer_group_price_query)>0){
+    
+       $scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query) ;
+      
+      
+      $product_info['customers_group_price']= $scustomer_group_price['customers_group_price'];
+      $product_info['customers_group_price1']= $scustomer_group_price['customers_group_price1'];
+      $product_info['customers_group_price2']= $scustomer_group_price['customers_group_price2'];
+      $product_info['customers_group_price3']= $scustomer_group_price['customers_group_price3'];
+      $product_info['customers_group_price4']= $scustomer_group_price['customers_group_price4'];
+      $product_info['customers_group_price5']= $scustomer_group_price['customers_group_price5'];
+      $product_info['customers_group_price6']= $scustomer_group_price['customers_group_price6'];
+      $product_info['customers_group_price7']= $scustomer_group_price['customers_group_price7'];
+      $product_info['customers_group_price8']= $scustomer_group_price['customers_group_price8'];
+      $product_info['customers_group_price9']= $scustomer_group_price['customers_group_price9'];
+      $product_info['customers_group_price10']= $scustomer_group_price['customers_group_price10'];
+      $product_info['customers_group_price11']= $scustomer_group_price['customers_group_price11'];
+      $product_info['customers_group_flag']='true';
+      
+    }
+    
+// Eversun mod end for SPPP Qty Price Break Enhancement
+    $this->parse($product_info);
+    return $product_info;
+  }
+
+  function computePrice($qty)
+  {
+  $qty = $this->adjustQty($qty);
+
+  // Compute base price, taking into account the possibility of a special
+  $price = ($this->hasSpecialPrice === TRUE) ? $this->specialPrice : $this->thePrice;
+
+  for ($i=1; $i<=11; $i++)
+    if (($this->quantity[$i] > 0) && ($qty > $this->quantity[$i]))
+      $price = $this->price[$i];
+ // Eversun mod  for SPPP Qty Price Break Enhancement
+ /*
+ if($this->hasCustomersGroupPrice=='true')
+    {
+   $price =$this->customers_group_thePrice;
+for ($i=1; $i<=11; $i++)
+    if (($this->quantity[$i] > 0) && ($qty >= $this->quantity[$i]))
+      $price = $this->customers_group_price[$i];
+    }
+ // Eversun mod end for SPPP Qty Price Break Enhancement
+  //echo $price;
+  */
+  return $price;
+  }
+
+  function adjustQty($qty) {
+  // Force QTY_BLOCKS granularity
+  $qb = $this->getQtyBlocks();
+  if ($qty < 1)
+    $qty = 1;
+
+  if ($qb >= 1)
+  {
+    if ($qty < $qb)
+      $qty = $qb;
+
+    if (($qty % $qb) != 0)
+      $qty += ($qb - ($qty % $qb));
+  }
+  return $qty;
+  }
+
+  function getQtyBlocks() {
+    return $this->qtyBlocks;
+  }
+
+  function getPrice() {
+    return $this->thePrice;
+  }
+
+  function getLowPrice() {
+    return $this->lowPrice;
+  }
+
+  function getHiPrice() {
+    return $this->hiPrice;
+  }
+
+  function hasSpecialPrice() {
+    return $this->hasSpecialPrice;
+  }
+
+  function hasQuantityPrice() {
+    return $this->hasQuantityPrice;
+  }
+
+  function getPriceString($style='productPriceInBox') {
+    global $currencies;
+
+    if ($this->hasSpecialPrice == true) {
+      $lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">';
+        $lc_text .= '<tr><td align="center" class=' . $style. ' colspan="2">';
+        $lc_text .= '&nbsp;<s>'
+    . $currencies->display_price($this->thePrice,
+             tep_get_tax_rate($this->taxClass))
+    . '</s>&nbsp;&nbsp;<span class="productSpecialPrice">'
+    . $currencies->display_price($this->specialPrice,
+             tep_get_tax_rate($this->taxClass))
+    . '</span>&nbsp;'
+    .'</td></tr>';
+    }
+    else
+    {
+    // Eversun mod  for SPPP Qty Price Break Enhancement
+    if($this->hasCustomersGroupPrice=='true')
+    {
+    $lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">';
+    $lc_text .= '<tr><td align="center" class=' . $style. ' colspan="2">'
+    . $currencies->display_price($this->customers_group_thePrice,
+    tep_get_tax_rate($this->taxClass))
+    . '</td></tr>';
+    }
+    else
+    {
+      $lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">';
+    $lc_text .= '<tr><td align="center" class=' . $style. ' colspan="2">'
+    . $currencies->display_price($this->thePrice,
+    tep_get_tax_rate($this->taxClass))
+    . '</td></tr>';
+    }
+    // Eversun end mod  for SPPP Qty Price Break Enhancement
+    }
+      // If you want to change the format of the price/quantity table
+      // displayed on the product information page, here is where you do it.
+
+    if($this->hasQuantityPrice == true) {
+// Eversun mod  for SPPP Qty Price Break Enhancement
+    if($this->hasCustomersGroupPrice=='true')
+    {
+      for($i=1; $i<=11; $i++) {
+      if($this->quantity[$i] > 0) {
+        $lc_text .= '<tr><td class='.$style.'>'
+        . $this->quantity[$i]
+        .'+&nbsp;</td><td class='.$style.'>'
+        . $currencies->display_price($this->customers_group_price[$i],
+        tep_get_tax_rate($this->taxClass))
+        .'</td></tr>';
+    }
+    }
+    }
+    else
+    {
+      
+    for($i=1; $i<=11; $i++) {
+      if($this->quantity[$i] > 0) {
+        $lc_text .= '<tr><td class='.$style.'>'
+        . $this->quantity[$i]
+        .'+&nbsp;</td><td class='.$style.'>'
+        . $currencies->display_price($this->price[$i],
+        tep_get_tax_rate($this->taxClass))
+        .'</td></tr>';
+      }
+    }
+  }
+  // Eversun mod end for SPPP Qty Price Break Enhancement
+    $lc_text .= '</table>';
+
+      }
+      else {
+    if ($this->hasSpecialPrice == true) {
+      $lc_text = '&nbsp;<s>'
+        . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass))
+        . '</s>&nbsp;&nbsp;<span class="productSpecialPrice">'
+        . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass))
+        . '</span>&nbsp;';
+    }
+    else {
+    // Eversun mod  for SPPP Qty Price Break Enhancement
+      if($this->hasCustomersGroupPrice=='true')
+      {
+        $lc_text = '&nbsp;'
+        . $currencies->display_price($this->customers_group_thePrice,
+               tep_get_tax_rate($this->taxClass))
+        . '&nbsp;';
+      }
+      else
+      {
+      $lc_text = '&nbsp;'
+        . $currencies->display_price($this->thePrice,
+               tep_get_tax_rate($this->taxClass))
+        . '&nbsp;';
+      }
+      // Eversun mod end for SPPP Qty Price Break Enhancement
+    }
+        }
+
+    return $lc_text;
+  }
+
+  function getPriceStringShort() {
+    global $currencies;
+
+    if ($this->hasSpecialPrice == true) {
+      $lc_text = '&nbsp;<s>'
+  . $currencies->display_price($this->thePrice,
+             tep_get_tax_rate($this->taxClass))
+  . '</s>&nbsp;&nbsp;<span class="productSpecialPrice">'
+  . $currencies->display_price($this->specialPrice,
+             tep_get_tax_rate($this->taxClass))
+  . '</span>&nbsp;';
+    }
+    else {
+      if($this->hasQuantityPrice == true) {
+if($this->hasCustomersGroupPrice=='true')
+      {
+  $lc_text = '&nbsp;'
+    . $currencies->display_price($this->customers_group_lowPrice,
+               tep_get_tax_rate($this->taxClass))
+    . ' - '
+    . $currencies->display_price($this->customers_group_hiPrice,
+               tep_get_tax_rate($this->taxClass))
+    . '&nbsp;';
+      }
+    else
+      {
+      $lc_text = '&nbsp;'
+    . $currencies->display_price($this->lowPrice,
+               tep_get_tax_rate($this->taxClass))
+    . ' - '. $currencies->display_price($this->hiPrice,
+               tep_get_tax_rate($this->taxClass)) . '&nbsp;';
+      }
+      }
+      else {
+      if($this->hasCustomersGroupPrice=='true')
+      {
+  $lc_text = '&nbsp;'
+    . $currencies->display_price($this->customers_group_thePrice,
+               tep_get_tax_rate($this->taxClass))
+    . '&nbsp;';
+      }
+    else
+      {
+      $lc_text = '&nbsp;'
+    . $currencies->display_price($this->thePrice,
+               tep_get_tax_rate($this->taxClass))
+    . '&nbsp;';
+      }
+      }
+    }
+    return $lc_text;
+  }
+
+
+// Eversun mod  for SPPP Qty Price Break Enhancement
+ function getCustomerGroupPrice() {
+    return $this->customers_group_thePrice;
+  }
+ function getCustomerGroupLowPrice() {
+    return $this->customers_group_lowPrice;
+  }
+
+  function getCustomerGroupHiPrice() {
+   
+    return $this->customers_group_hiPrice;
+  }
+
+
+
+  function hasCustomerGroupPrice() {
+  
+    return $this->hasCustomersGroupPrice;
+  }
+
+  function hasCustomerGroupcomputePrice($qty)
+  {
+  $qty = $this->adjustQty($qty);
+
+  // Compute base price, taking into account the possibility of a special
+  $price = ($this->hasSpecialPrice === TRUE) ? $this->specialPrice : $this->thePrice;
+
+  for ($i=1; $i<=11; $i++)
+    if (($this->quantity[$i] > 0) && ($qty >= $this->quantity[$i]))
+      $price = $this->price[$i];
+ // Eversun mod  for SPPP Qty Price Break Enhancement
+ if($this->hasCustomersGroupPrice=='true')
+    {
+   $price =$this->customers_group_thePrice;
+for ($i=1; $i<=11; $i++)
+    if (($this->quantity[$i] > 0) && ($qty > $this->quantity[$i]))
+      $price = $this->customers_group_price[$i];
+    }
+ // Eversun mod end for SPPP Qty Price Break Enhancement
+  //echo '{price='.$price.'}';
+  return $price;
+  }
+// Eversun mod end for SPPP Qty Price Break Enhancement
+}
+?>

Added: trunk/direct.openmoko.com/includes/classes/boxes.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/boxes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/boxes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,178 @@
+<?php
+/*
+  $Id: boxes.php,v 1.1.1.1 2004/03/04 23:40:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBox {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBox($contents, $direct_output = false) {
+      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
+      $tableBox_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
+        $tableBox_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
+        $tableBox_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
+              $tableBox_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
+              $tableBox_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox_string .= '    <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
+        }
+
+        $tableBox_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
+      }
+
+      $tableBox_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox_string;
+
+      return $tableBox_string;
+    }
+  }
+
+  class infoBox extends tableBox {
+    function infoBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function infoBoxContents($contents) {
+      $this->table_cellpadding = '3';
+      $this->table_parameters = 'class="infoBoxContents"';
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
+                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
+                                           'params' => 'class="boxText"',
+                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
+      }
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      return $this->tableBox($info_box_contents);
+    }
+  }
+
+  class infoBoxHeading extends tableBox {
+    function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+
+      if ($left_corner == true) {
+        $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif');
+      }
+      if ($right_arrow == true) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner == true) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif');
+      } else {
+        $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => 'width="100%" height="14" class="infoBoxHeading"',
+                                         'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading" nowrap',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class contentBox extends tableBox {
+    function contentBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function contentBoxContents($contents) {
+      $this->table_cellpadding = '4';
+      $this->table_parameters = 'class="infoBoxContents"';
+      return $this->tableBox($contents);
+    }
+  }
+
+  class contentBoxHeading extends tableBox {
+    function contentBoxHeading($contents) {
+      $this->table_width = '100%';
+      $this->table_cellpadding = '0';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')),
+                                   array('params' => 'height="14" class="infoBoxHeading" width="100%"',
+                                         'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif')));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class errorBox extends tableBox {
+    function errorBox($contents) {
+      $this->table_data_parameters = 'class="errorBox"';
+      $this->tableBox($contents, true);
+    }
+  }
+
+  class productListingBox extends tableBox {
+    function productListingBox($contents) {
+      $this->table_parameters = 'class="productListing"';
+      $this->tableBox($contents, true);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/breadcrumb.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/breadcrumb.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/breadcrumb.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: breadcrumb.php,v 1.1.1.1 2004/03/04 23:40:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class breadcrumb {
+    var $_trail;
+
+    function breadcrumb() {
+      $this->reset();
+    }
+
+    function reset() {
+      $this->_trail = array();
+    }
+
+    function add($title, $link = '') {
+      $this->_trail[] = array('title' => $title, 'link' => $link);
+    }
+
+    function trail($separator = ' - ') {
+      $trail_string = '';
+
+      for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) {
+        if (isset($this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) {
+          $trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>';
+        } else {
+          $trail_string .= $this->_trail[$i]['title'];
+        }
+
+        if (($i+1) < $n) $trail_string .= $separator;
+      }
+
+      return $trail_string;
+    }
+
+    function size() {
+  return sizeof($this->_trail);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/calendar.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,429 @@
+<?php
+
+// PHP Calendar Class Version 1.4 (5th March 2001)
+//  
+// Copyright David Wilkinson 2000 - 2001. All Rights reserved.
+// 
+// This software may be used, modified and distributed freely
+// providing this copyright notice remains intact at the head 
+// of the file.
+//
+// This software is freeware. The author accepts no liability for
+// any loss or damages whatsoever incurred directly or indirectly 
+// from the use of this script. The author of this software makes 
+// no claims as to its fitness for any purpose whatsoever. If you 
+// wish to use this software you should first satisfy yourself that 
+// it meets your requirements.
+//
+// URL:   http://www.cascade.org.uk/software/php/calendar/
+// Email: davidw at cascade.org.uk
+
+class Calendar
+{
+    /*
+        Constructor for the Calendar class
+    */
+    function Calendar()
+    {
+    }
+    
+    /*
+        Get the array of strings used to label the days of the week. This array contains seven 
+        elements, one for each day of the week. The first entry in this array represents Sunday. 
+    */
+    function getDayNames()
+    {
+        return $this->dayNames;
+    }
+    
+    /*
+        Set the array of strings used to label the days of the week. This array must contain seven 
+        elements, one for each day of the week. The first entry in this array represents Sunday. 
+    */
+    function setDayNames($names)
+    {
+
+        $this->dayNames = $names;
+    }
+
+    /*
+        Get the array of strings used to label the months of the year. This array contains twelve
+        elements, one for each month of the year. The first entry in this array represents January.
+    */
+    function getMonthNames()
+    {
+        $this->monthNames;
+    }
+
+    /*
+        Set the array of strings used to label the months of the year. This array must contain twelve
+        elements, one for each month of the year. The first entry in this array represents January.
+    */
+    function setMonthNames($names)
+    {
+         $this->monthNames = $names;
+    }
+    
+    /* 
+        Gets the start day of the week. This is the day that appears in the first column
+        of the calendar. Sunday = 0.
+    */
+      function getStartDay()
+    {
+        return $this->startDay;
+    }
+    
+    /* 
+        Sets the start day of the week. This is the day that appears in the first column
+        of the calendar. Sunday = 0.
+    */
+    function setStartDay($day)
+    {
+        $this->startDay = $day;
+    }
+    
+    
+    /* 
+        Gets the start month of the year. This is the month that appears first in the year
+        view. January = 1.
+    */
+    function getStartMonth()
+    {
+        return $this->startMonth;
+    }
+    
+    /* 
+        Sets the start month of the year. This is the month that appears first in the year
+        view. January = 1.
+    */
+    function setStartMonth($month)
+    {
+        $this->startMonth = $month;
+    }
+    
+    
+    /*
+        Return the URL to link to in order to display a calendar for a given month/year.
+        You must override this method if you want to activate the "forward" and "back" 
+        feature of the calendar.
+        
+        Note: If you return an empty string from this function, no navigation link will
+        be displayed. This is the default behaviour.
+        
+        If the calendar is being displayed in "year" view, $month will be set to 1.
+    */
+
+    function getCalendarLink($month, $year)
+    {
+         return "?_month=$month&amp;_year=$year";
+    }
+
+    function pad($s, $n)
+    {
+    $r = $s;
+    while (strlen($r) < $n)
+    {
+    $r = "0".$r;
+    }
+    return $r;
+    }
+
+    function getFileName($day, $month, $year)
+    {
+    return $this->pad($year, 4) ."-". $this->pad($month, 2) ."-". $this->pad($day, 2);
+    }
+
+    function getDbLink($day, $month, $year)
+    {
+    $request = tep_db_query("select start_date from " . TABLE_EVENTS_CALENDAR );
+    while ($row = tep_db_fetch_array($request)){
+    $data =  $row['start_date'];
+    $bname = FILENAME_EVENTS_CALENDAR;
+    if ($this->getFileName($day, $month, $year) == $data)
+    {
+        return "$bname?_day=$day&amp;_month=$month&amp;_year=$year";
+        }
+      }
+    }
+
+    /*
+        Return the HTML for the current month
+    */
+    function getCurrentMonthView()
+    {
+        $d = getdate(time());
+        return $this->getMonthView($d["mon"], $d["year"]);
+    }
+    
+
+    /*
+        Return the HTML for the current year
+    */
+    function getCurrentYearView()
+    {
+        $d = getdate(time());
+        return $this->getYearView($d["year"]);
+    }
+    
+    
+    /*
+        Return the HTML for a specified month
+    */
+    function getMonthView($month, $year)
+    {
+        return $this->getMonthHTML($month, $year);
+    }
+
+    /*
+        Return the HTML for a specified year
+    */
+    function getYearView($year)
+    {
+        return $this->getYearHTML($year);
+    }
+    
+    /********************************************************************************
+    
+        The rest are private methods. No user-servicable parts inside.
+        
+        You shouldn't need to call any of these functions directly.
+        
+    *********************************************************************************/
+
+    /*
+        Calculate the number of days in a month, taking into account leap years.
+    */
+    function getDaysInMonth($month, $year)
+    {
+        if ($month < 1 || $month > 12)
+        {
+            return 0;
+        }
+   
+        $d = $this->daysInMonth[$month - 1];
+   
+        if ($month == 2)
+        {
+            // Check for leap year
+            if ($year%4 == 0)
+            {
+                if ($year%100 == 0)
+                {
+                    if ($year%400 == 0)
+                    {
+                        $d = 29;
+                    }
+                }
+                else
+                {
+                    $d = 29;
+                }
+            }
+        }
+        return $d;
+    }
+    
+    /*
+        Generate the HTML for a given month
+    */
+    function getMonthHTML($m, $y, $show = 1)
+    {
+        $s = "";
+        
+        $a = $this->adjustDate($m, $y);
+        $month = $a[0];
+        $year  = $a[1];
+        
+      $daysInMonth = $this->getDaysInMonth($month, $year);
+      $date = @getdate(@mktime(12, 0, 0, $month, 1, $year));
+      
+      $first = $date["wday"];
+        $monthName = $this->monthNames[$month - 1];
+      
+      $prev = $this->adjustDate($month - 1, $year);
+      $next = $this->adjustDate($month + 1, $year);
+      
+      $this_month = date('m');
+        $this_year = date('Y');
+      $header = $monthName . (($show > 0) ? " " . $year : "");
+      $D = $this->monthNames[11].'&nbsp;';
+      $J = $this->monthNames[0].'&nbsp;';
+      
+      if ($show == 1)
+      {
+         $prevMonth = '<a href='. FILENAME_EVENTS_CALENDAR_CONTENT . $this->getCalendarLink($prev[0], $prev[1]).' target=calendar title='. $this->monthNames[$month - 2] . (($month-2 < 1) ? $D.($year-1) : '&nbsp;'. $year) .' >&lt;</a>';
+         $nextMonth = '<a href='. FILENAME_EVENTS_CALENDAR_CONTENT . $this->getCalendarLink($next[0], $next[1]).' target=calendar title='. $this->monthNames[$month + 0] . (($month+0 > 11) ? $J.($year+1) : '&nbsp;'. $year) .' >&gt;</a>';
+      }
+      else
+      {
+          $prevMonth = "";
+          $nextMonth = "";
+      }
+      
+      $s .= "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
+      $s .= "<tr class=\"calendarHeader\">\n";
+      $s .= "<td align=\"left\">$header</td>\n";
+        $s .= "<td align=\"center\" class=\"yearHeader\">\n";
+        if(@mktime (0,0,0,$month ,0,$year) > @mktime (0,0,0,$this_month ,0,$this_year)){
+        $s .= $prevMonth;
+        }else{
+        $s .= "&nbsp;";
+        }
+        $s .= "</td>\n";
+      $s .= "<td align=\"center\" class=\"yearHeader\">$nextMonth</td></tr>\n";
+      $s .= "<tr><td colspan=\"3\">\n";
+        $s .= "<table cellspacing=\"1\" cellpadding=\"0\" border=\"0\" class=\"calendarMonth\"><tr class=\"calendarHeader\">\n";
+        $s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay)%7] . "</td>\n";
+      $s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+1)%7] . "</td>\n";
+      $s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+2)%7] . "</td>\n";
+      $s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+3)%7] . "</td>\n";
+      $s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+4)%7] . "</td>\n";
+      $s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+5)%7] . "</td>\n";
+      $s .= "<td align=\"center\" valign=\"middle\">" . $this->dayNames[($this->startDay+6)%7] . "</td>\n";
+      $s .= "</tr>\n";
+      
+      // We need to work out what date to start at so that the first appears in the correct column
+      $d = $this->startDay + 1 - $first;
+      while ($d > 1)
+      {
+          $d -= 7;
+      }
+
+        // Make sure we know when today is, so that we can use a different CSS style
+        $today = getdate(time());
+        $start_day = $this->getStartDay();
+        $click = BOX_CLICK_LINK;
+      while ($d <= $daysInMonth)
+      {
+          $s .= "<tr>\n";
+          for ($i = 0; $i < 7; $i++)
+          {
+              $class = (($i < (6-$start_day) &! $i <= $start_day) ? (($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "calendarToday" : "calendar" ) : (($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "calendarToday" : "calendarWeekend"));
+              if ($d > 0 && $d <= $daysInMonth)
+              {
+               $link = $this->getDbLink($d, $month, $year);
+                 $s .= (($link == "") ? "<td class=\"$class\" align=\"left\" valign=\"bottom\">" : "<td class=\"$class\" onclick=top.window.location=\"$link\" align=\"left\" valign=\"bottom\" style=\"cursor: hand;\">" );
+                 if($show == 1){
+                 $s .= (($link == "") ? $d : "<a href=javascript:// onClick=top.window.location=\"$link\" title=\"$click\">$d</a>");
+                 }else{
+                 $s .= (($link == "") ? $d : "<a href=\"$link\" title=\"$click\">$d</a>");
+                 }
+              }
+              else
+              {
+                  $s .= "<td class=\"empty\">&nbsp;";
+              }
+                $s .= "</td>\n";       
+              $d++;
+          }
+          $s .= "</tr>\n";    
+      }
+      $s .= "</table>\n";
+      $s .= "</td></tr></table>\n";
+        return $s;    
+    }
+
+    /*
+        Generate the HTML for a given year
+    */
+    function getYearHTML($year)
+    {
+        $year_view = 1;
+        $s = "";
+      $prev = FILENAME_EVENTS_CALENDAR . $this->getCalendarLink(1, $year - 1) .'&year_view=1';
+      $next = FILENAME_EVENTS_CALENDAR . $this->getCalendarLink(1, $year + 1) .'&year_view=1';
+      $this_year = date('Y');
+
+        $s .= "<table align=\"center\" cellspacing=\"2\" cellpadding=\"0\" border=\"0\" style=\"cursor: default\">\n";
+        $s .= "<tr>";
+        
+        if($year > $this_year){
+        $s .= "<td class=\"yearHeader\" align=\"center\" align=\"left\">" . (($prev == "") ? "&nbsp;" : "<a href=\"$prev\">&lt;&lt;</a>")  . "</td>\n";
+        }else{
+        $s .= "<td class=\"yearHeader\" align=\"center\" align=\"left\">&nbsp;</td>\n";
+        }
+        
+        $s .= "<td height=\"20\" class=\"yearHeader\" align=\"center\">" . (($this->startMonth > 1) ? $year . " - " . ($year + 1) : $year) ."</td>\n";
+      $s .= "<td class=\"yearHeader\" align=\"center\" align=\"right\">" . (($next == "") ? "&nbsp;" : "<a href=\"$next\">&gt;&gt;</a>")  . "</td>\n";
+        $s .= "</tr>\n";
+        $s .= "<tr>";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(0 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(1 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(2 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "</tr>\n";
+        $s .= "<tr>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(3 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(4 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(5 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "</tr>\n";
+        $s .= "<tr>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(6 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(7 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(8 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "</tr>\n";
+        $s .= "<tr>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(9 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(10 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "<td valign=\"top\">" . $this->getMonthHTML(11 + $this->startMonth, $year, 0) ."</td>\n";
+        $s .= "</tr>\n";
+        $s .= "</table>\n";
+        return $s;
+    }
+
+    /*
+        Adjust dates to allow months > 12 and < 0. Just adjust the years appropriately.
+        e.g. Month 14 of the year 2001 is actually month 2 of year 2002.
+    */
+    function adjustDate($month, $year)
+    {
+        $a = array();  
+        $a[0] = $month;
+        $a[1] = $year;
+        while ($a[0] > 12)
+        {
+            $a[0] -= 12;
+            $a[1]++;
+        }
+        while ($a[0] <= 0)
+        {
+            $a[0] += 12;
+            $a[1]--;
+        }
+        return $a;
+    }
+    
+    /*
+        The start day of the week. This is the day that appears in the first column
+        of the calendar. Sunday = 0.
+    */
+    var $startDay = 0;
+
+    /*
+        The start month of the year. This is the month that appears in the first slot
+        of the calendar in the year view. January = 1.
+    */
+    var $startMonth = 1;
+
+    /*
+        The labels to display for the days of the week. The first entry in this array
+        represents Sunday.
+    */
+    var $dayNames = array(S,M,T,W,T,F,S,S);
+
+    /*
+        The labels to display for the months of the year. The first entry in this array
+        represents January.
+    */
+    
+    var $monthNames = array(JANUARY,FEBRUARY,MARCH,APRIL,MAY,JUNE,JULY,AUGUST,SEPTEMBER,OCTOBER,NOVEMBER,DECEMBER);
+
+
+    /*
+        The number of days in each month. You're unlikely to want to change this...
+        The first entry in this array represents January.
+    */
+    var $daysInMonth = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+    
+}
+
+?>

Added: trunk/direct.openmoko.com/includes/classes/cc_validation.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/cc_validation.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/cc_validation.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,407 @@
+<?php
+/*
+  $Id: cc_validation.php,v 1.1.1.2 2004/03/04 23:40:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  Update: March 12, 2004
+  Added: CCV Card Specific Checking
+  Author: Austin Renfroe (Austin519), Code Thanks to Dansken
+  Email: Austin519 @ aol.com
+
+Card Blacklist by Mark Evans 
+additional cc validation by:  barry at mainframes.co.uk
+switch between 3 and 5 item check by David Graham
+
+*/
+
+  class cc_validation {
+    var $cc_number, $cc_expiry_month, $cc_expiry_year, $ccv, $cc_type ;
+
+      // this method implements the overloading workaround
+    function validate()
+    {
+        $vald = 'validate'.func_num_args();
+        $args = func_get_args();
+        $return1 = @ call_user_func_array(array(&$this, $vald), $args);
+        return $return1;
+    }
+
+  function validate3($number, $expiry_m, $expiry_y) {
+    $this->cc_number = ereg_replace('[^0-9]', '', $number);
+      // 4 number and 6 number checks   
+          $NumberLeft4 = substr($this->cc_number, 0, 4);
+          $NumberLeft6 = substr($this->cc_number, 0, 6);
+          $NumberLength = strlen($this->cc_number);
+      //empty these variables just to be sure
+          $ShouldLength2='';
+          $ShouldLength3='';
+
+      if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {
+        $this->cc_type = 'Visa';
+         $ShouldLength = 13;
+         $ShouldLength2 = 16;
+//visa
+      } elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) {
+        $this->cc_type = 'Mastercard';
+         $ShouldLength = 16;
+//Mastercard
+      } elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {
+        $this->cc_type = 'Amex';
+        $ShouldLength = 15;
+// amex
+      } elseif ( (($NumberLeft4 >= 3400) && ($NumberLeft4 <= 3499))
+              || (($NumberLeft4 >= 3700) && ($NumberLeft4 <= 3799)) ) {
+        $this->cc_type = 'American Express';
+        $ShouldLength = 15;   
+//American Express      
+      } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) {
+        $this->cc_type = 'Discover';
+        $ShouldLength = 16;
+//Discover        
+      } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) {
+        $this->cc_type = 'JCB';
+        $ShouldLength = 16;
+        $ShouldLength2 = 15;
+//JCB        
+      } elseif ( (($NumberLeft6 >= 413733) && ($NumberLeft6 <= 413737))
+            || (($NumberLeft6 >= 446200) && ($NumberLeft6 <= 446299))
+            || (($NumberLeft6 >= 453978) && ($NumberLeft6 <= 453979))
+            ||  ($NumberLeft6 == 454313)
+            || (($NumberLeft6 >= 454432) && ($NumberLeft6 <= 454435))
+            ||  ($NumberLeft6 == 454742)
+            || (($NumberLeft6 >= 456725) && ($NumberLeft6 <= 456745))
+            || (($NumberLeft6 >= 465830) && ($NumberLeft6 <= 465879))
+            || (($NumberLeft6 >= 465901) && ($NumberLeft6 <= 465950))
+            || (($NumberLeft6 >= 490960) && ($NumberLeft6 <= 490979))
+            || (($NumberLeft6 >= 492181) && ($NumberLeft6 <= 492182))
+            ||  ($NumberLeft6 == 498824) ) {
+        $this->cc_type = 'Delta';
+        $ShouldLength = 16;
+// Delta        
+      } elseif ( (($NumberLeft6 >= 490302) && ($NumberLeft6 <= 490309))
+            || (($NumberLeft6 >= 490335) && ($NumberLeft6 <= 490339))
+            || (($NumberLeft6 >= 491101) && ($NumberLeft6 <= 491102))
+            || (($NumberLeft6 >= 491174) && ($NumberLeft6 <= 491182))
+            || (($NumberLeft6 >= 493600) && ($NumberLeft6 <= 493699))
+            ||  ($NumberLeft6 == 564182)
+            || (($NumberLeft6 >= 633300) && ($NumberLeft6 <= 633349))
+            || (($NumberLeft6 >= 675900) && ($NumberLeft6 <= 675999)) ) {
+        $this->cc_type = 'UK Switch';
+        $ShouldLength = 16;
+        $ShouldLength2= 18;
+        $ShouldLength3= 19;
+// Switch        
+      } elseif ( (($NumberLeft6 >= 633450) && ($NumberLeft6 <= 633499))
+            || (($NumberLeft6 >= 676700) && ($NumberLeft6 <= 676799)) ) {
+        $this->cc_type = 'Solo';
+        $ShouldLength = 16;
+        $ShouldLength2= 18;
+        $ShouldLength3= 19;
+// Solo       
+    }  elseif (( ($NumberLeft6 == 450875)
+                  || (($NumberLeft6 >= 484406) && ($NumberLeft6 <= 484408))
+                  || (($NumberLeft6 >= 484411) && ($NumberLeft6 <= 484455))
+                  || (($NumberLeft6 >= 491730) && ($NumberLeft6 <= 491759))
+                  ||  ($NumberLeft6 == 491880)
+        ) && (ereg('[0-9]{16}', $this->cc_number)) ) {
+          $this->cc_type = "UK Electron";
+           $ShouldLength = 16;
+//UK Electron            
+     } elseif (( (($NumberLeft6 >= 493698) && ($NumberLeft6 <= 493699))
+             ||  ($NumberLeft6 == 490303)
+               || (($NumberLeft6 >= 633302) && ($NumberLeft6 <= 633349))
+               || (($NumberLeft6 >= 675900) && ($NumberLeft6 <= 675999))
+               || (($NumberLeft6 >= 500000) && ($NumberLeft6 <= 509999))
+               || (($NumberLeft6 >= 560000) && ($NumberLeft6 <= 589999))
+               || (($NumberLeft6 >= 600000) && ($NumberLeft6 <= 699999))
+                ) && (ereg('[0-9]{16}', $this->cc_number)) ) {
+          $this->cc_type = "Maestro";
+          $ShouldLength = 14;
+          $ShouldLength2 = 18;
+//Maestro        
+ } elseif ( (($NumberLeft4 >= 3000) && ($NumberLeft4 <= 3059))
+      || (($NumberLeft4 >= 3600) && ($NumberLeft4 <= 3699))
+      || (($NumberLeft4 >= 3800) && ($NumberLeft4 <= 3889)) ) {
+     $this->cc_type = 'Diners Club';
+     $ShouldLength = 14;
+// Diners Club     
+      } elseif ( ($NumberLeft4 >= 3890) && ($NumberLeft4 <= 3899) ) {
+        $this->cc_type = 'Carte Blanche';
+        $ShouldLength = 14;
+// Carte Blanche
+      } elseif ( $NumberLeft4 == 5610 ) {
+        $this->cc_type = 'Australian BankCard';
+  $ShouldLength = 16;
+// Australian Bankcard    
+      } else {
+        return -1;
+      }
+    
+// function to check the number length
+// Is the number the right length?
+    
+    if ( !( ($NumberLength == $ShouldLength)
+          || ( !(empty($ShouldLength2)) && ($NumberLength == $ShouldLength2) )
+          || ( !(empty($ShouldLength3)) && ($NumberLength == $ShouldLength3) ) ) ) {
+          //return -6;
+         }
+//  } else {
+//  $this->cc_type = 'CC';
+//  }
+if ( strtolower(CC_BLACK) == 'true' ) {      
+// Blacklist check
+    $card_info = tep_db_query("select c.blacklist_card_number from " . TABLE_BLACKLIST . " c where c.blacklist_card_number = '" . $this->cc_number . "'");
+      if (tep_db_num_rows($card_info) != 0) { // card not found in database
+        return -7;
+      }
+  }
+
+      if (is_numeric($expiry_m) && ($expiry_m > 0) && ($expiry_m < 13)) {
+        $this->cc_expiry_month = $expiry_m;
+      } else {
+        return -2;
+      }
+
+      $current_year = date('Y');
+      $expiry_y = substr($current_year, 0, 2) . $expiry_y;
+      if (is_numeric($expiry_y) && ($expiry_y >= $current_year) && ($expiry_y <= ($current_year + 10))) {
+        $this->cc_expiry_year = $expiry_y;
+      } else {
+        return -3;
+      }
+
+      if ($expiry_y == $current_year) {
+        if ($expiry_m < date('n')) {
+          return -4;
+        }
+      }
+
+      return $this->is_valid();
+    }
+    
+        function validate5($number, $expiry_m, $expiry_y, $ccv, $cc_type ) {
+  //  function validate5($cc_type, $number, $ccv, $expiry_m, $expiry_y) {
+          $this->cc_number = ereg_replace('[^0-9]', '', $number);
+
+      // 4 number and 6 number checks   
+          $NumberLeft4 = substr($this->cc_number, 0, 4);
+          $NumberLeft6 = substr($this->cc_number, 0, 6);
+          $NumberLength = strlen($this->cc_number);
+       //    $ShouldLength= '' ;
+           $ShouldLength2= '' ;
+           $ShouldLength3= '' ; 
+ unset($ShouldLength) ;
+ //     if ( strtolower(CC_VAL) == 'true' ) { 
+      //empty these variables just to be sure
+      
+
+      if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {
+        $this->cc_type = 'Visa';
+         $ShouldLength = 13;
+         $ShouldLength2 = 16;
+//visa
+      } elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) {
+        $this->cc_type = 'Mastercard';
+         $ShouldLength = 16;
+//Mastercard
+      } elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {
+        $this->cc_type = 'Amex';
+        $ShouldLength = 15;
+// amex
+      } elseif ( (($NumberLeft4 >= 3400) && ($NumberLeft4 <= 3499))
+              || (($NumberLeft4 >= 3700) && ($NumberLeft4 <= 3799)) ) {
+        $this->cc_type = 'American Express';
+        $ShouldLength = 15;   
+//American Express      
+      } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) {
+        $this->cc_type = 'Discover';
+        $ShouldLength = 16;
+//Discover        
+      } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) {
+        $this->cc_type = 'JCB';
+        $ShouldLength = 16;
+        $ShouldLength2 = 15;
+//JCB        
+      } elseif ( (($NumberLeft6 >= 413733) && ($NumberLeft6 <= 413737))
+            || (($NumberLeft6 >= 446200) && ($NumberLeft6 <= 446299))
+            || (($NumberLeft6 >= 453978) && ($NumberLeft6 <= 453979))
+            ||  ($NumberLeft6 == 454313)
+            || (($NumberLeft6 >= 454432) && ($NumberLeft6 <= 454435))
+            ||  ($NumberLeft6 == 454742)
+            || (($NumberLeft6 >= 456725) && ($NumberLeft6 <= 456745))
+            || (($NumberLeft6 >= 465830) && ($NumberLeft6 <= 465879))
+            || (($NumberLeft6 >= 465901) && ($NumberLeft6 <= 465950))
+            || (($NumberLeft6 >= 490960) && ($NumberLeft6 <= 490979))
+            || (($NumberLeft6 >= 492181) && ($NumberLeft6 <= 492182))
+            ||  ($NumberLeft6 == 498824) ) {
+        $this->cc_type = 'Delta';
+        $ShouldLength = 16;
+// Delta        
+      } elseif ( (($NumberLeft6 >= 490302) && ($NumberLeft6 <= 490309))
+            || (($NumberLeft6 >= 490335) && ($NumberLeft6 <= 490339))
+            || (($NumberLeft6 >= 491101) && ($NumberLeft6 <= 491102))
+            || (($NumberLeft6 >= 491174) && ($NumberLeft6 <= 491182))
+            || (($NumberLeft6 >= 493600) && ($NumberLeft6 <= 493699))
+            ||  ($NumberLeft6 == 564182)
+            || (($NumberLeft6 >= 633300) && ($NumberLeft6 <= 633349))
+            || (($NumberLeft6 >= 675900) && ($NumberLeft6 <= 675999)) ) {
+        $this->cc_type = 'UK Switch';
+        $ShouldLength = 16;
+        $ShouldLength2= 18;
+        $ShouldLength3= 19;
+// Switch        
+      } elseif ( (($NumberLeft6 >= 633450) && ($NumberLeft6 <= 633499))
+            || (($NumberLeft6 >= 676700) && ($NumberLeft6 <= 676799)) ) {
+        $this->cc_type = 'Solo';
+        $ShouldLength = 16;
+        $ShouldLength2= 18;
+        $ShouldLength3= 19;
+// Solo       
+    }  elseif (( ($NumberLeft6 == 450875)
+                  || (($NumberLeft6 >= 484406) && ($NumberLeft6 <= 484408))
+                  || (($NumberLeft6 >= 484411) && ($NumberLeft6 <= 484455))
+                  || (($NumberLeft6 >= 491730) && ($NumberLeft6 <= 491759))
+                  ||  ($NumberLeft6 == 491880)
+        ) && (ereg('[0-9]{16}', $this->cc_number)) ) {
+          $this->cc_type = "UK Electron";
+           $ShouldLength = 16;
+//UK Electron            
+     } elseif (( (($NumberLeft6 >= 493698) && ($NumberLeft6 <= 493699))
+             ||  ($NumberLeft6 == 490303)
+               || (($NumberLeft6 >= 633302) && ($NumberLeft6 <= 633349))
+               || (($NumberLeft6 >= 675900) && ($NumberLeft6 <= 675999))
+               || (($NumberLeft6 >= 500000) && ($NumberLeft6 <= 509999))
+               || (($NumberLeft6 >= 560000) && ($NumberLeft6 <= 589999))
+               || (($NumberLeft6 >= 600000) && ($NumberLeft6 <= 699999))
+                ) && (ereg('[0-9]{16}', $this->cc_number)) ) {
+          $this->cc_type = "Maestro";
+          $ShouldLength = 14;
+          $ShouldLength2 = 18;
+//Maestro        
+ } elseif ( (($NumberLeft4 >= 3000) && ($NumberLeft4 <= 3059))
+      || (($NumberLeft4 >= 3600) && ($NumberLeft4 <= 3699))
+      || (($NumberLeft4 >= 3800) && ($NumberLeft4 <= 3889)) ) {
+     $this->cc_type = 'Diners Club';
+     $ShouldLength = 14;
+// Diners Club     
+      } elseif ( ($NumberLeft4 >= 3890) && ($NumberLeft4 <= 3899) ) {
+        $this->cc_type = 'Carte Blanche';
+        $ShouldLength = 14;
+// Carte Blanche
+      } elseif ( $NumberLeft4 == 5610 ) {
+        $this->cc_type = 'Australian BankCard';
+  $ShouldLength = 16;
+// Australian Bankcard    
+      } else {
+        return -1;
+      }
+    
+// function to check the number length
+// Is the number the right length?
+    
+//    if  ( !($NumberLength == $ShouldLength) || ( !(empty($ShouldLength2)) && !($NumberLength == $ShouldLength2) ) || (!(empty($ShouldLength3)) && !($NumberLength == $ShouldLength3)) )  {
+if ( ($NumberLength == $ShouldLength)|| ( !(empty($ShouldLength2)) && ($NumberLength == $ShouldLength2) ) || (!(empty($ShouldLength3)) && ($NumberLength == $ShouldLength3))) { 
+   // return ;
+    } else { 
+         return -6;
+         }
+
+
+if ( strtolower(CC_BLACK) == 'true' ) {      
+// Blacklist check
+    $card_info = tep_db_query("select c.blacklist_card_number from " . TABLE_BLACKLIST . " c where c.blacklist_card_number = '" . $this->cc_number . "'");
+      if (tep_db_num_rows($card_info) != 0) { // card not found in database
+        return -7;
+      }
+  }
+
+      if (is_numeric($expiry_m) && ($expiry_m > 0) && ($expiry_m < 13)) {
+        $this->cc_expiry_month = $expiry_m;
+      }
+      else {
+        return -2;
+      }
+
+      $current_year = date('Y');
+      $expiry_y = substr($current_year, 0, 2) . $expiry_y;
+      if (is_numeric($expiry_y) && ($expiry_y >= $current_year) && ($expiry_y <= ($current_year + 10))) {
+        $this->cc_expiry_year = $expiry_y;
+      } else {
+        return -3;
+      }
+
+      if ($expiry_y == $current_year) {
+        if ($expiry_m < date('n')) {
+          return -4;
+        }
+      }
+
+    
+if($ccv != '') {
+  $l = strlen($ccv);
+  
+//This sets length if select card type is not used
+
+If ($this->cc_type != ''){
+ if (($this->cc_type == 'Amex') || ($this->cc_type == 'American Express') ){
+            $len = 4;
+  }else{
+    $len = 3;  
+    }
+    if ($len != $l) {
+  return -8;
+   }
+//This sets length if select card type is used Delta, UK Switch, Solo, UK Electron,Maestro  not checked
+If ($this->cr_card_type != '')
+  if (($this->cc_type == 'Amex') || ($this->cc_type == 'American Express') ){
+     $len = 4;
+      }else{
+    $len = 3;  
+    }
+  }  
+//this check the card type length to the length entered
+     if ($ccv == '') {
+        $l = $len;
+     }
+     
+    if ($len != $l) {
+        return -8;
+    }
+  
+     return $this->is_valid();
+    }
+  }
+//luen10 checking 
+    function is_valid() {
+      $cardNumber = strrev($this->cc_number);
+      $numSum = 0;
+
+      for ($i=0; $i<strlen($cardNumber); $i++) {
+        $currentNum = substr($cardNumber, $i, 1);
+
+// Double every second digit
+        if ($i % 2 == 1) {
+          $currentNum *= 2;
+        }
+
+// Add digits of 2-digit numbers together
+        if ($currentNum > 9) {
+          $firstNum = $currentNum % 10;
+          $secondNum = ($currentNum - $firstNum) / 10;
+          $currentNum = $firstNum + $secondNum;
+        }
+
+        $numSum += $currentNum;
+      }
+
+// If the total has no remainder it's OK
+      return ($numSum % 10 == 0);
+    }
+  
+ } 
+?>

Added: trunk/direct.openmoko.com/includes/classes/cc_validation1.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/cc_validation1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/cc_validation1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,86 @@
+<?php
+/*
+  $Id: cc_validation1.php,v 1.1.1.1 2004/03/04 23:40:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class cc_validation {
+    var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year;
+
+    function validate($number, $expiry_m, $expiry_y) {
+      $this->cc_number = ereg_replace('[^0-9]', '', $number);
+
+      if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {
+        $this->cc_type = 'Visa';
+      } elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) {
+        $this->cc_type = 'Master Card';
+      } elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {
+        $this->cc_type = 'American Express';
+      } elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) {
+        $this->cc_type = 'Diners Club';
+      } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) {
+        $this->cc_type = 'Discover';
+      } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) {
+        $this->cc_type = 'JCB';
+      } elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) {
+        $this->cc_type = 'Australian BankCard';
+      } else {
+        return -1;
+      }
+
+      if (is_numeric($expiry_m) && ($expiry_m > 0) && ($expiry_m < 13)) {
+        $this->cc_expiry_month = $expiry_m;
+      } else {
+        return -2;
+      }
+
+      $current_year = date('Y');
+      $expiry_y = substr($current_year, 0, 2) . $expiry_y;
+      if (is_numeric($expiry_y) && ($expiry_y >= $current_year) && ($expiry_y <= ($current_year + 10))) {
+        $this->cc_expiry_year = $expiry_y;
+      } else {
+        return -3;
+      }
+
+      if ($expiry_y == $current_year) {
+        if ($expiry_m < date('n')) {
+          return -4;
+        }
+      }
+
+      return $this->is_valid();
+    }
+
+    function is_valid() {
+      $cardNumber = strrev($this->cc_number);
+      $numSum = 0;
+
+      for ($i=0; $i<strlen($cardNumber); $i++) {
+        $currentNum = substr($cardNumber, $i, 1);
+
+// Double every second digit
+        if ($i % 2 == 1) {
+          $currentNum *= 2;
+        }
+
+// Add digits of 2-digit numbers together
+        if ($currentNum > 9) {
+          $firstNum = $currentNum % 10;
+          $secondNum = ($currentNum - $firstNum) / 10;
+          $currentNum = $firstNum + $secondNum;
+        }
+
+        $numSum += $currentNum;
+      }
+
+// If the total has no remainder it's OK
+      return ($numSum % 10 == 0);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/checkout_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/checkout_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/checkout_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: checkout_success.php,v 1.1.1.1 2006/06/26 23:40:46 datazen Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class checkout_success {
+    var $modules;
+
+// class constructor
+    function checkout_success() {
+      global $language;
+
+      if (defined('MODULE_CHECKOUT_SUCCESS_INSTALLED') && tep_not_null(MODULE_CHECKOUT_SUCCESS_INSTALLED)) {
+        $this->modules = explode(';', MODULE_CHECKOUT_SUCCESS_INSTALLED);
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          include(DIR_WS_LANGUAGES . $language . '/modules/checkout_success/' . $value);
+          include(DIR_WS_MODULES . 'checkout_success/' . $value);
+
+          $class = substr($value, 0, strrpos($value, '.'));
+          $GLOBALS[$class] = new $class;
+        }
+      }
+    }
+
+    function process() {
+      $checkout_success_array = array();
+      if (is_array($this->modules)) {
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          $GLOBALS[$class]->process();
+          for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
+            if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
+              $checkout_success_array[] = array('code' => $GLOBALS[$class]->code,
+                                           'title' => $GLOBALS[$class]->output[$i]['title'],
+                                           'text' => $GLOBALS[$class]->output[$i]['text'],
+                                           'value' => $GLOBALS[$class]->output[$i]['value'],
+                                           'sort_order' => $GLOBALS[$class]->sort_order);
+            }
+          }
+        }
+      }
+      return $checkout_success_array;
+    }
+
+    function output() {
+
+      if ($no_output == 1) { return; }
+
+      $output_string = '';
+      if (is_array($this->modules)) {
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          $size = sizeof($GLOBALS[$class]->output);
+          for ($i=0; $i<$size; $i++) {
+            $output_string .= '              <tr>' . "\n" .
+                              '                <td>' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" .
+                              '              </tr>';
+          }
+        }
+      }
+      return $output_string;
+    }
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/classes/currencies.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:40:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// Class to handle currencies
+// TABLES: currencies
+  class currencies {
+    var $currencies;
+
+// class constructor
+    function currencies() {
+      $this->currencies = array();
+      $currencies_query = tep_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES);
+      while ($currencies = tep_db_fetch_array($currencies_query)) {
+        $this->currencies[$currencies['code']] = array('title' => $currencies['title'],
+                                                       'symbol_left' => $currencies['symbol_left'],
+                                                       'symbol_right' => $currencies['symbol_right'],
+                                                       'decimal_point' => $currencies['decimal_point'],
+                                                       'thousands_point' => $currencies['thousands_point'],
+                                                       'decimal_places' => $currencies['decimal_places'],
+                                                       'value' => $currencies['value']);
+      }
+    }
+
+// class methods
+    function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') {
+      global $currency;
+
+      if (empty($currency_type)) $currency_type = $currency;
+
+      if ($calculate_currency_value == true) {
+        $rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value'];
+        $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
+// if the selected currency is in the european euro-conversion and the default currency is euro,
+// the currency will displayed in the national currency and euro currency
+        if ( (DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' || $currency_type == 'BEF' || $currency_type == 'LUF' || $currency_type == 'ESP' || $currency_type == 'FRF' || $currency_type == 'IEP' || $currency_type == 'ITL' || $currency_type == 'NLG' || $currency_type == 'ATS' || $currency_type == 'PTE' || $currency_type == 'FIM' || $currency_type == 'GRD') ) {
+          $format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';
+        }
+      } else {
+        $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];
+      }
+
+// BOF: WebMakers.com Added: Down for Maintenance
+      if (DOWN_FOR_MAINTENANCE=='true' && DOWN_FOR_MAINTENANCE_PRICES_OFF=='true') {
+        $format_string= '';
+      }
+// BOF: WebMakers.com Added: Down for Maintenance
+
+        return $format_string;
+    }
+
+    function is_set($code) {
+      if (isset($this->currencies[$code]) && tep_not_null($this->currencies[$code])) {
+        return true;
+      } else {
+        return false;
+      }
+    }
+
+    function get_value($code) {
+      return $this->currencies[$code]['value'];
+    }
+
+    function get_decimal_places($code) {
+      return $this->currencies[$code]['decimal_places'];
+    }
+    
+    function get_thousands_point($code) {
+      return $this->currencies[$code]['thousands_point'];
+    }
+    
+    function get_decimal_point($code) {
+      return $this->currencies[$code]['decimal_point'];
+    }
+
+    function display_price($products_price, $products_tax, $quantity = 1) {
+      return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/email.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/email.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/email.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,574 @@
+<?php
+/*
+  $Id: email.php,v 1.1.1.1 2004/03/04 23:40:43 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  mail.php - a class to assist in building mime-HTML eMails
+
+  The original class was made by Richard Heyes <richard at phpguru.org>
+  and can be found here: http://www.phpguru.org
+
+  Renamed and Modified by Jan Wildeboer for osCommerce
+*/
+
+  class email {
+    var $html;
+    var $text;
+    var $output;
+    var $html_text;
+    var $html_images;
+    var $image_types;
+    var $build_params;
+    var $attachments;
+    var $headers;
+
+    function email($headers = '') {
+      if ($headers == '') $headers = array();
+
+      $this->html_images = array();
+      $this->headers = array();
+
+      if (EMAIL_LINEFEED == 'CRLF') {
+        $this->lf = "\r\n";
+      } else {
+        $this->lf = "\n";
+      }
+
+/**
+ * If you want the auto load functionality
+ * to find other mime-image/file types, add the
+ * extension and content type here.
+ */
+
+      $this->image_types = array('gif' => 'image/gif',
+                                 'jpg' => 'image/jpeg',
+                                 'jpeg' => 'image/jpeg',
+                                 'jpe' => 'image/jpeg',
+                                 'bmp' => 'image/bmp',
+                                 'png' => 'image/png',
+                                 'tif' => 'image/tiff',
+                                 'tiff' => 'image/tiff',
+                                 'swf' => 'application/x-shockwave-flash');
+
+      $this->build_params['html_encoding'] = 'quoted-printable';
+      $this->build_params['text_encoding'] = '7bit';
+      $this->build_params['html_charset'] = constant('CHARSET');
+      $this->build_params['text_charset'] = constant('CHARSET');
+      $this->build_params['text_wrap'] = 998;
+
+/**
+ * Make sure the MIME version header is first.
+ */
+
+      $this->headers[] = 'MIME-Version: 1.0';
+
+      reset($headers);
+      while (list(,$value) = each($headers)) {
+        if (tep_not_null($value)) {
+          $this->headers[] = $value;
+        }
+      }
+    }
+
+/**
+ * This function will read a file in
+ * from a supplied filename and return
+ * it. This can then be given as the first
+ * argument of the the functions
+ * add_html_image() or add_attachment().
+ */
+
+    function get_file($filename) {
+      $return = '';
+
+      if ($fp = fopen($filename, 'rb')) {
+        while (!feof($fp)) {
+          $return .= fread($fp, 1024);
+        }
+        fclose($fp);
+
+        return $return;
+      } else {
+        return false;
+      }
+    }
+
+/**
+ * Function for extracting images from
+ * html source. This function will look
+ * through the html code supplied by add_html()
+ * and find any file that ends in one of the
+ * extensions defined in $obj->image_types.
+ * If the file exists it will read it in and
+ * embed it, (not an attachment).
+ *
+ * Function contributed by Dan Allen
+ */
+
+    function find_html_images($images_dir) {
+// Build the list of image extensions
+      while (list($key, ) = each($this->image_types)) {
+        $extensions[] = $key;
+      }
+
+      preg_match_all('/"([^"]+\.(' . implode('|', $extensions).'))"/Ui', $this->html, $images);
+
+      for ($i=0; $i<count($images[1]); $i++) {
+        if (file_exists($images_dir . $images[1][$i])) {
+          $html_images[] = $images[1][$i];
+          $this->html = str_replace($images[1][$i], basename($images[1][$i]), $this->html);
+        }
+      }
+
+      if (tep_not_null($html_images)) {
+// If duplicate images are embedded, they may show up as attachments, so remove them.
+        $html_images = array_unique($html_images);
+        sort($html_images);
+
+        for ($i=0; $i<count($html_images); $i++) {
+          if ($image = $this->get_file($images_dir . $html_images[$i])) {
+            $content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)];
+            $this->add_html_image($image, basename($html_images[$i]), $content_type);
+          }
+        }
+      }
+    }
+
+/**
+ * Adds plain text. Use this function
+ * when NOT sending html email
+ */
+
+    function add_text($text = '') {
+      $this->text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);
+    }
+
+/**
+ * Adds a html part to the mail.
+ * Also replaces image names with
+ * content-id's.
+ */
+
+    function add_html($html, $text = NULL, $images_dir = NULL) {
+      $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html);
+      $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);
+
+      if (isset($images_dir)) $this->find_html_images($images_dir);
+    }
+
+/**
+ * Adds an image to the list of embedded
+ * images.
+ */
+
+    function add_html_image($file, $name = '', $c_type='application/octet-stream') {
+      $this->html_images[] = array('body' => $file,
+                                   'name' => $name,
+                                   'c_type' => $c_type,
+                                   'cid' => md5(uniqid(time())));
+    }
+
+/**
+ * Adds a file to the list of attachments.
+ */
+
+    function add_attachment($file, $name = '', $c_type='application/octet-stream', $encoding = 'base64') {
+      $this->attachments[] = array('body' => $file,
+                                   'name' => $name,
+                                   'c_type' => $c_type,
+                                   'encoding' => $encoding);
+    }
+
+/**
+ * Adds a text subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_text_part(&$obj, $text) {
+    function add_text_part(&$obj, $text) {
+      $params['content_type'] = 'text/plain';
+      $params['encoding'] = $this->build_params['text_encoding'];
+      $params['charset'] = $this->build_params['text_charset'];
+
+      if (is_object($obj)) {
+        return $obj->addSubpart($text, $params);
+      } else {
+        return new mime($text, $params);
+      }
+    }
+
+/**
+ * Adds a html subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_html_part(&$obj) {
+    function add_html_part(&$obj) {
+      $params['content_type'] = 'text/html';
+      $params['encoding'] = $this->build_params['html_encoding'];
+      $params['charset'] = $this->build_params['html_charset'];
+
+      if (is_object($obj)) {
+        return $obj->addSubpart($this->html, $params);
+      } else {
+        return new mime($this->html, $params);
+      }
+    }
+
+/**
+ * Starts a message with a mixed part
+ */
+
+/* HPDL PHP3 */
+//    function &add_mixed_part() {
+    function add_mixed_part() {
+      $params['content_type'] = 'multipart/mixed';
+
+      return new mime('', $params);
+    }
+
+/**
+ * Adds an alternative part to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_alternative_part(&$obj) {
+    function add_alternative_part(&$obj) {
+      $params['content_type'] = 'multipart/alternative';
+
+      if (is_object($obj)) {
+        return $obj->addSubpart('', $params);
+      } else {
+        return new mime('', $params);
+      }
+    }
+
+/**
+ * Adds a html subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_related_part(&$obj) {
+    function add_related_part(&$obj) {
+      $params['content_type'] = 'multipart/related';
+
+      if (is_object($obj)) {
+        return $obj->addSubpart('', $params);
+      } else {
+        return new mime('', $params);
+      }
+    }
+
+/**
+ * Adds an html image subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_html_image_part(&$obj, $value) {
+    function add_html_image_part(&$obj, $value) {
+      $params['content_type'] = $value['c_type'];
+      $params['encoding'] = 'base64';
+      $params['disposition'] = 'inline';
+      $params['dfilename'] = $value['name'];
+      $params['cid'] = $value['cid'];
+
+      $obj->addSubpart($value['body'], $params);
+    }
+
+/**
+ * Adds an attachment subpart to a mime_part object
+ */
+
+/* HPDL PHP3 */
+//    function &add_attachment_part(&$obj, $value) {
+    function add_attachment_part(&$obj, $value) {
+      $params['content_type'] = $value['c_type'];
+      $params['encoding'] = $value['encoding'];
+      $params['disposition'] = 'attachment';
+      $params['dfilename'] = $value['name'];
+
+      $obj->addSubpart($value['body'], $params);
+    }
+
+/**
+ * Builds the multipart message from the
+ * list ($this->_parts). $params is an
+ * array of parameters that shape the building
+ * of the message. Currently supported are:
+ *
+ * $params['html_encoding'] - The type of encoding to use on html. Valid options are
+ *                            "7bit", "quoted-printable" or "base64" (all without quotes).
+ *                            7bit is EXPRESSLY NOT RECOMMENDED. Default is quoted-printable
+ * $params['text_encoding'] - The type of encoding to use on plain text Valid options are
+ *                            "7bit", "quoted-printable" or "base64" (all without quotes).
+ *                            Default is 7bit
+ * $params['text_wrap']     - The character count at which to wrap 7bit encoded data.
+ *                            Default this is 998.
+ * $params['html_charset']  - The character set to use for a html section.
+ *                            Default is iso-8859-1
+ * $params['text_charset']  - The character set to use for a text section.
+ *                          - Default is iso-8859-1
+ */
+
+/* HPDL PHP3 */
+//    function build_message($params = array()) {
+    function build_message($params = '') {
+      if ($params == '') $params = array();
+
+      if (count($params) > 0) {
+        reset($params);
+        while(list($key, $value) = each($params)) {
+          $this->build_params[$key] = $value;
+        }
+      }
+
+      if (tep_not_null($this->html_images)) {
+        reset($this->html_images);
+        while (list(,$value) = each($this->html_images)) {
+          $this->html = str_replace($value['name'], 'cid:' . $value['cid'], $this->html);
+        }
+      }
+
+      $null = NULL;
+      $attachments = ((tep_not_null($this->attachments)) ? true : false);
+      $html_images = ((tep_not_null($this->html_images)) ? true : false);
+      $html = ((tep_not_null($this->html)) ? true : false);
+      $text = ((tep_not_null($this->text)) ? true : false);
+
+      switch (true) {
+        case (($text == true) && ($attachments == false)):
+/* HPDL PHP3 */
+//          $message =& $this->add_text_part($null, $this->text);
+          $message = $this->add_text_part($null, $this->text);
+          break;
+        case (($text == false) && ($attachments == true) && ($html == false)):
+/* HPDL PHP3 */
+//          $message =& $this->add_mixed_part();
+          $message = $this->add_mixed_part();
+
+          for ($i=0; $i<count($this->attachments); $i++) {
+            $this->add_attachment_part($message, $this->attachments[$i]);
+          }
+          break;
+        case (($text == true) && ($attachments == true)):
+/* HPDL PHP3 */
+//          $message =& $this->add_mixed_part();
+          $message = $this->add_mixed_part();
+          $this->add_text_part($message, $this->text);
+
+          for ($i=0; $i<count($this->attachments); $i++) {
+            $this->add_attachment_part($message, $this->attachments[$i]);
+          }
+          break;
+        case (($html == true) && ($attachments == false) && ($html_images == false)):
+          if (tep_not_null($this->html_text)) {
+/* HPDL PHP3 */
+//            $message =& $this->add_alternative_part($null);
+            $message = $this->add_alternative_part($null);
+            $this->add_text_part($message, $this->html_text);
+            $this->add_html_part($message);
+          } else {
+/* HPDL PHP3 */
+//            $message =& $this->add_html_part($null);
+            $message = $this->add_html_part($null);
+          }
+          break;
+        case (($html == true) && ($attachments == false) && ($html_images == true)):
+          if (tep_not_null($this->html_text)) {
+/* HPDL PHP3 */
+//            $message =& $this->add_alternative_part($null);
+            $message = $this->add_alternative_part($null);
+            $this->add_text_part($message, $this->html_text);
+/* HPDL PHP3 */
+//            $related =& $this->add_related_part($message);
+            $related = $this->add_related_part($message);
+          } else {
+/* HPDL PHP3 */
+//            $message =& $this->add_related_part($null);
+//            $related =& $message;
+            $message = $this->add_related_part($null);
+            $related = $message;
+          }
+          $this->add_html_part($related);
+
+          for ($i=0; $i<count($this->html_images); $i++) {
+            $this->add_html_image_part($related, $this->html_images[$i]);
+          }
+          break;
+        case (($html == true) && ($attachments == true) && ($html_images == false)):
+/* HPDL PHP3 */
+//          $message =& $this->add_mixed_part();
+          $message = $this->add_mixed_part();
+          if (tep_not_null($this->html_text)) {
+/* HPDL PHP3 */
+//            $alt =& $this->add_alternative_part($message);
+            $alt = $this->add_alternative_part($message);
+            $this->add_text_part($alt, $this->html_text);
+            $this->add_html_part($alt);
+          } else {
+            $this->add_html_part($message);
+          }
+
+          for ($i=0; $i<count($this->attachments); $i++) {
+            $this->add_attachment_part($message, $this->attachments[$i]);
+          }
+          break;
+        case (($html == true) && ($attachments == true) && ($html_images == true)):
+/* HPDL PHP3 */
+//          $message =& $this->add_mixed_part();
+          $message = $this->add_mixed_part();
+
+          if (tep_not_null($this->html_text)) {
+/* HPDL PHP3 */
+//            $alt =& $this->add_alternative_part($message);
+            $alt = $this->add_alternative_part($message);
+            $this->add_text_part($alt, $this->html_text);
+/* HPDL PHP3 */
+//            $rel =& $this->add_related_part($alt);
+            $rel = $this->add_related_part($alt);
+          } else {
+/* HPDL PHP3 */
+//            $rel =& $this->add_related_part($message);
+            $rel = $this->add_related_part($message);
+          }
+          $this->add_html_part($rel);
+
+          for ($i=0; $i<count($this->html_images); $i++) {
+            $this->add_html_image_part($rel, $this->html_images[$i]);
+          }
+
+          for ($i=0; $i<count($this->attachments); $i++) {
+            $this->add_attachment_part($message, $this->attachments[$i]);
+          }
+          break;
+      }
+
+      if ( (isset($message)) && (is_object($message)) ) {
+        $output = $message->encode();
+        $this->output = $output['body'];
+
+        reset($output['headers']);
+        while (list($key, $value) = each($output['headers'])) {
+          $headers[] = $key . ': ' . $value;
+        }
+
+        $this->headers = array_merge($this->headers, $headers);
+
+        return true;
+      } else {
+        return false;
+      }
+    }
+
+/**
+ * Sends the mail.
+ */
+
+    function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') {
+      if ((strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false)) {
+        return false;
+      }
+      if ((strstr($to_addr, "\n") != false) || (strstr($to_addr, "\r") != false)) {
+        return false;
+      }
+      if ((strstr($subject, "\n") != false) || (strstr($subject, "\r") != false)) {
+        return false;
+      }
+      if ((strstr($from_name, "\n") != false) || (strstr($from_name, "\r") != false)) {
+        return false;
+      }
+      if ((strstr($from_addr, "\n") != false) || (strstr($from_addr, "\r") != false)) {
+        return false;
+      }
+
+      $to = (($to_name != '') ? '"' . $to_name . '" <' . $to_addr . '>' : $to_addr);
+      $from = (($from_name != '') ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr);
+
+      if (is_string($headers)) {
+        $headers = explode($this->lf, trim($headers));
+      }
+
+      for ($i=0; $i<count($headers); $i++) {
+        if (is_array($headers[$i])) {
+          for ($j=0; $j<count($headers[$i]); $j++) {
+            if ($headers[$i][$j] != '') {
+              $xtra_headers[] = $headers[$i][$j];
+            }
+          }
+        }
+
+        if ($headers[$i] != '') {
+          $xtra_headers[] = $headers[$i];
+        }
+      }
+
+      if (!isset($xtra_headers)) {
+        $xtra_headers = array();
+      }
+
+      if (EMAIL_TRANSPORT == 'smtp') {
+        return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));
+      } else {
+        return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));
+      }
+    }
+
+/**
+ * Use this method to return the email
+ * in message/rfc822 format. Useful for
+ * adding an email to another email as
+ * an attachment. there's a commented
+ * out example in example.php.
+ *
+ * string get_rfc822(string To name,
+ *       string To email,
+ *       string From name,
+ *       string From email,
+ *       [string Subject,
+ *        string Extra headers])
+ */
+
+    function get_rfc822($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') {
+// Make up the date header as according to RFC822
+      $date = 'Date: ' . date('D, d M y H:i:s');
+      $to = (($to_name != '') ? 'To: "' . $to_name . '" <' . $to_addr . '>' : 'To: ' . $to_addr);
+      $from = (($from_name != '') ? 'From: "' . $from_name . '" <' . $from_addr . '>' : 'From: ' . $from_addr);
+
+      if (is_string($subject)) {
+        $subject = 'Subject: ' . $subject;
+      }
+
+      if (is_string($headers)) {
+        $headers = explode($this->lf, trim($headers));
+      }
+
+      for ($i=0; $i<count($headers); $i++) {
+        if (is_array($headers[$i])) {
+          for ($j=0; $j<count($headers[$i]); $j++) {
+            if ($headers[$i][$j] != '') {
+              $xtra_headers[] = $headers[$i][$j];
+            }
+          }
+        }
+
+        if ($headers[$i] != '') {
+          $xtra_headers[] = $headers[$i];
+        }
+      }
+
+      if (!isset($xtra_headers)) {
+        $xtra_headers = array();
+      }
+
+      $headers = array_merge($this->headers, $xtra_headers);
+
+      return $date . $this->lf . $from . $this->lf . $to . $this->lf . $subject . $this->lf . implode($this->lf, $headers) . $this->lf . $this->lf . $this->output;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/http_client.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/http_client.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/http_client.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,459 @@
+<?php
+/*
+  $Id: http_client.php,v 1.1.1.1 2004/03/04 23:40:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Copyright 2001 Leo West <west_leo at yahoo-REMOVE-.com> Net_HTTP_Client v0.6
+
+  Minimal Example:
+
+  $http = new httpClient();
+  $http->Connect("somehost", 80) or die("Connect problem");
+  $status = $http->Get("/index.html");
+  if ($status != 200) {
+    die("Problem : " . $http->getStatusMessage());
+  } else {
+    echo $http->getBody();
+  }
+  $http->Disconnect();
+
+  Persistent Example:
+
+  $http = new httpClient("dir.yahoo.com", 80);
+  $http->addHeader("Host", "dir.yahoo.com");
+  $http->addHeader("Connection", "keep-alive");
+
+  if ($http->Get("/Reference/Libraries/") == 200) $page1 = $http->getBody();
+  if ($http->Get("/News_and_Media/") == 200 ) $page2 = $http->getBody();
+  $http->disconnect();
+*/
+
+  class httpClient {
+    var $url; // array containg server URL, similar to parseurl() returned array
+    var $reply; // response code
+    var $replyString; // full response
+    var $protocolVersion = '1.1';
+    var $requestHeaders, $requestBody;
+    var $socket = false;
+// proxy stuff
+    var $useProxy = false;
+    var $proxyHost, $proxyPort;
+
+/**
+ * httpClient constructor
+ * Note: when host and port are defined, the connection is immediate
+ * @seeAlso connect
+ **/
+    function httpClient($host = '', $port = '') {
+      if (tep_not_null($host)) {
+        $this->connect($host, $port);
+      }
+    }
+
+/**
+ * turn on proxy support
+ * @param proxyHost proxy host address eg "proxy.mycorp.com"
+ * @param proxyPort proxy port usually 80 or 8080
+ **/
+    function setProxy($proxyHost, $proxyPort) {
+      $this->useProxy = true;
+      $this->proxyHost = $proxyHost;
+      $this->proxyPort = $proxyPort;
+    }
+
+/**
+ * setProtocolVersion
+ * define the HTTP protocol version to use
+ * @param version string the version number with one decimal: "0.9", "1.0", "1.1"
+ * when using 1.1, you MUST set the mandatory headers "Host"
+ * @return boolean false if the version number is bad, true if ok
+ **/
+    function setProtocolVersion($version) {
+      if ( ($version > 0) && ($version <= 1.1) ) {
+        $this->protocolVersion = $version;
+        return true;
+      } else {
+        return false;
+      }
+    }
+
+/**
+ * set a username and password to access a protected resource
+ * Only "Basic" authentication scheme is supported yet
+ * @param username string - identifier
+ * @param password string - clear password
+ **/
+    function setCredentials($username, $password) {
+      $this->addHeader('Authorization', 'Basic ' . base64_encode($username . ':' . $password));
+     }
+
+/**
+ * define a set of HTTP headers to be sent to the server
+ * header names are lowercased to avoid duplicated headers
+ * @param headers hash array containing the headers as headerName => headerValue pairs
+ **/
+    function setHeaders($headers) {
+      if (is_array($headers)) {
+        reset($headers);
+        while (list($name, $value) = each($headers)) {
+          $this->requestHeaders[$name] = $value;
+        }
+      }
+    }
+
+/**
+ * addHeader
+ * set a unique request header
+ * @param headerName the header name
+ * @param headerValue the header value, ( unencoded)
+ **/
+    function addHeader($headerName, $headerValue) {
+      $this->requestHeaders[$headerName] = $headerValue;
+    }
+
+/**
+ * removeHeader
+ * unset a request header
+ * @param headerName the header name
+ **/
+    function removeHeader($headerName) {
+      unset($this->requestHeaders[$headerName]);
+    }
+
+/**
+ * Connect
+ * open the connection to the server
+ * @param host string server address (or IP)
+ * @param port string server listening port - defaults to 80
+ * @return boolean false is connection failed, true otherwise
+ **/
+    function Connect($host, $port = '') {
+      $this->url['scheme'] = 'http';
+      $this->url['host'] = $host;
+      if (tep_not_null($port)) $this->url['port'] = $port;
+
+      return true;
+    }
+
+/**
+ * Disconnect
+ * close the connection to the  server
+ **/
+    function Disconnect() {
+      if ($this->socket) fclose($this->socket);
+    }
+
+/**
+ * head
+ * issue a HEAD request
+ * @param uri string URI of the document
+ * @return string response status code (200 if ok)
+ * @seeAlso getHeaders()
+ **/
+    function Head($uri) {
+      $this->responseHeaders = $this->responseBody = '';
+
+      $uri = $this->makeUri($uri);
+
+      if ($this->sendCommand('HEAD ' . $uri . ' HTTP/' . $this->protocolVersion)) {
+        $this->processReply();
+      }
+
+      return $this->reply;
+    }
+
+/**
+ * get
+ * issue a GET http request
+ * @param uri URI (path on server) or full URL of the document
+ * @return string response status code (200 if ok)
+ * @seeAlso getHeaders(), getBody()
+ **/
+    function Get($url) {
+      $this->responseHeaders = $this->responseBody = '';
+
+      $uri = $this->makeUri($url);
+
+      if ($this->sendCommand('GET ' . $uri . ' HTTP/' . $this->protocolVersion)) {
+        $this->processReply();
+      }
+
+      return $this->reply;
+    }
+
+/**
+ * Post
+ * issue a POST http request
+ * @param uri string URI of the document
+ * @param query_params array parameters to send in the form "parameter name" => value
+ * @return string response status code (200 if ok)
+ * @example
+ * $params = array( "login" => "tiger", "password" => "secret" );
+ * $http->post( "/login.php", $params );
+ **/
+    function Post($uri, $query_params = '') {
+      $uri = $this->makeUri($uri);
+
+      if (is_array($query_params)) {
+        $postArray = array();
+        reset($query_params);
+        while (list($k, $v) = each($query_params)) {
+          $postArray[] = urlencode($k) . '=' . urlencode($v);
+        }
+
+        $this->requestBody = implode('&', $postArray);
+      }
+
+// set the content type for post parameters
+      $this->addHeader('Content-Type', 'application/x-www-form-urlencoded');
+
+      if ($this->sendCommand('POST ' . $uri . ' HTTP/' . $this->protocolVersion)) {
+        $this->processReply();
+      }
+
+      $this->removeHeader('Content-Type');
+      $this->removeHeader('Content-Length');
+      $this->requestBody = '';
+
+      return $this->reply;
+    }
+
+/**
+ * Put
+ * Send a PUT request
+ * PUT is the method to sending a file on the server. it is *not* widely supported
+ * @param uri the location of the file on the server. dont forget the heading "/"
+ * @param filecontent the content of the file. binary content accepted
+ * @return string response status code 201 (Created) if ok
+ * @see RFC2518 "HTTP Extensions for Distributed Authoring WEBDAV"
+ **/
+    function Put($uri, $filecontent) {
+      $uri = $this->makeUri($uri);
+      $this->requestBody = $filecontent;
+
+      if ($this->sendCommand('PUT ' . $uri . ' HTTP/' . $this->protocolVersion)) {
+        $this->processReply();
+      }
+
+      return $this->reply;
+    }
+
+/**
+ * getHeaders
+ * return the response headers
+ * to be called after a Get() or Head() call
+ * @return array headers received from server in the form headername => value
+ * @seeAlso get, head
+ **/
+    function getHeaders() {
+      return $this->responseHeaders;
+    }
+
+/**
+ * getHeader
+ * return the response header "headername"
+ * @param headername the name of the header
+ * @return header value or NULL if no such header is defined
+ **/
+    function getHeader($headername) {
+      return $this->responseHeaders[$headername];
+    }
+
+/**
+ * getBody
+ * return the response body
+ * invoke it after a Get() call for instance, to retrieve the response
+ * @return string body content
+ * @seeAlso get, head
+ **/
+    function getBody() {
+      return $this->responseBody;
+    }
+
+/**
+ * getStatus return the server response's status code
+ * @return string a status code
+ * code are divided in classes (where x is a digit)
+ *  - 20x : request processed OK
+ *  - 30x : document moved
+ *  - 40x : client error ( bad url, document not found, etc...)
+ *  - 50x : server error
+ * @see RFC2616 "Hypertext Transfer Protocol -- HTTP/1.1"
+ **/
+    function getStatus() {
+      return $this->reply;
+    }
+
+/**
+ * getStatusMessage return the full response status, of the form "CODE Message"
+ * eg. "404 Document not found"
+ * @return string the message
+ **/
+    function getStatusMessage() {
+      return $this->replyString;
+    }
+
+/**
+ * @scope only protected or private methods below
+ **/
+
+/**
+ * send a request
+ * data sent are in order
+ * a) the command
+ * b) the request headers if they are defined
+ * c) the request body if defined
+ * @return string the server repsonse status code
+ **/
+    function sendCommand($command) {
+      $this->responseHeaders = array();
+      $this->responseBody = '';
+
+// connect if necessary
+      if ( ($this->socket == false) || (feof($this->socket)) ) {
+        if ($this->useProxy) {
+          $host = $this->proxyHost;
+          $port = $this->proxyPort;
+        } else {
+          $host = $this->url['host'];
+          $port = $this->url['port'];
+        }
+
+        if (!tep_not_null($port)) $port = 80;
+
+        if (!$this->socket = fsockopen($host, $port, $this->reply, $this->replyString)) {
+          return false;
+        }
+
+        if (tep_not_null($this->requestBody)) {
+          $this->addHeader('Content-Length', strlen($this->requestBody));
+        }
+
+        $this->request = $command;
+        $cmd = $command . "\r\n";
+        if (is_array($this->requestHeaders)) {
+          reset($this->requestHeaders);
+          while (list($k, $v) = each($this->requestHeaders)) {
+            $cmd .= $k . ': ' . $v . "\r\n";
+          }
+        }
+
+        if (tep_not_null($this->requestBody)) {
+          $cmd .= "\r\n" . $this->requestBody;
+        }
+
+// unset body (in case of successive requests)
+        $this->requestBody = '';
+
+        fputs($this->socket, $cmd . "\r\n");
+
+        return true;
+      }
+    }
+
+    function processReply() {
+      $this->replyString = trim(fgets($this->socket, 1024));
+
+      if (preg_match('|^HTTP/\S+ (\d+) |i', $this->replyString, $a )) {
+        $this->reply = $a[1];
+      } else {
+        $this->reply = 'Bad Response';
+      }
+
+//get response headers and body
+      $this->responseHeaders = $this->processHeader();
+      $this->responseBody = $this->processBody();
+
+      return $this->reply;
+    }
+
+/**
+ * processHeader() reads header lines from socket until the line equals $lastLine
+ * @scope protected
+ * @return array of headers with header names as keys and header content as values
+ **/
+    function processHeader($lastLine = "\r\n") {
+      $headers = array();
+      $finished = false;
+
+      while ( (!$finished) && (!feof($this->socket)) ) {
+        $str = fgets($this->socket, 1024);
+        $finished = ($str == $lastLine);
+        if (!$finished) {
+          list($hdr, $value) = split(': ', $str, 2);
+// nasty workaround broken multiple same headers (eg. Set-Cookie headers) @FIXME
+          if (isset($headers[$hdr])) {
+            $headers[$hdr] .= '; ' . trim($value);
+          } else {
+            $headers[$hdr] = trim($value);
+          }
+        }
+      }
+
+      return $headers;
+    }
+
+/**
+ * processBody() reads the body from the socket
+ * the body is the "real" content of the reply
+ * @return string body content
+ * @scope private
+ **/
+    function processBody() {
+      $data = '';
+      $counter = 0;
+
+      do {
+        $status = socket_get_status($this->socket);
+        if ($status['eof'] == 1) {
+          break;
+        }
+
+        if ($status['unread_bytes'] > 0) {
+          $buffer = fread($this->socket, $status['unread_bytes']);
+          $counter = 0;
+        } else {
+          $buffer = fread($this->socket, 128);
+          $counter++;
+          usleep(2);
+        }
+
+        $data .= $buffer;
+      } while ( ($status['unread_bytes'] > 0) || ($counter++ < 10) );
+
+      return $data;
+    }
+
+/**
+ * Calculate and return the URI to be sent ( proxy purpose )
+ * @param the local URI
+ * @return URI to be used in the HTTP request
+ * @scope private
+ **/
+    function makeUri($uri) {
+      $a = parse_url($uri);
+
+      if ( (isset($a['scheme'])) && (isset($a['host'])) ) {
+        $this->url = $a;
+      } else {
+        unset($this->url['query']);
+        unset($this->url['fragment']);
+        $this->url = array_merge($this->url, $a);
+      }
+
+      if ($this->useProxy) {
+        $requesturi = 'http://' . $this->url['host'] . (empty($this->url['port']) ? '' : ':' . $this->url['port']) . $this->url['path'] . (empty($this->url['query']) ? '' : '?' . $this->url['query']);
+      } else {
+        $requesturi = $this->url['path'] . (empty($this->url['query']) ? '' : '?' . $this->url['query']);
+      }
+
+      return $requesturi;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/language.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/language.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/language.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/*
+  $Id: language.php,v 1.1.1.1 2004/03/04 23:40:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  browser language detection logic Copyright phpMyAdmin (select_lang.lib.php3 v1.24 04/19/2002)
+                                   Copyright Stephane Garin <sgarin at sgarin.com> (detect_language.php v0.1 04/02/2002)
+*/
+
+  class language {
+    var $languages, $catalog_languages, $browser_languages, $language;
+
+    function language($lng = '') {
+      $this->languages = array('ar' => 'ar([-_][[:alpha:]]{2})?|arabic',
+                               'bg' => 'bg|bulgarian',
+                               'br' => 'pt[-_]br|brazilian portuguese',
+                               'ca' => 'ca|catalan',
+                               'cs' => 'cs|czech',
+                               'da' => 'da|danish',
+                               'de' => 'de([-_][[:alpha:]]{2})?|german',
+                               'el' => 'el|greek',
+                               'en' => 'en([-_][[:alpha:]]{2})?|english',
+                               'es' => 'es([-_][[:alpha:]]{2})?|spanish',
+                               'et' => 'et|estonian',
+                               'fi' => 'fi|finnish',
+                               'fr' => 'fr([-_][[:alpha:]]{2})?|french',
+                               'gl' => 'gl|galician',
+                               'he' => 'he|hebrew',
+                               'hu' => 'hu|hungarian',
+                               'id' => 'id|indonesian',
+                               'it' => 'it|italian',
+                               'ja' => 'ja|japanese',
+                               'ko' => 'ko|korean',
+                               'ka' => 'ka|georgian',
+                               'lt' => 'lt|lithuanian',
+                               'lv' => 'lv|latvian',
+                               'nl' => 'nl([-_][[:alpha:]]{2})?|dutch',
+                               'no' => 'no|norwegian',
+                               'pl' => 'pl|polish',
+                               'pt' => 'pt([-_][[:alpha:]]{2})?|portuguese',
+                               'ro' => 'ro|romanian',
+                               'ru' => 'ru|russian',
+                               'sk' => 'sk|slovak',
+                               'sr' => 'sr|serbian',
+                               'sv' => 'sv|swedish',
+                               'th' => 'th|thai',
+                               'tr' => 'tr|turkish',
+                               'uk' => 'uk|ukrainian',
+                               'tw' => 'zh[-_]tw|chinese traditional',
+                               'zh' => 'zh|chinese simplified');
+
+      $this->catalog_languages = array();
+      $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
+      while ($languages = tep_db_fetch_array($languages_query)) {
+        $this->catalog_languages[$languages['code']] = array('id' => $languages['languages_id'],
+                                                             'name' => $languages['name'],
+                                                             'image' => $languages['image'],
+                                                             'directory' => $languages['directory']);
+      }
+
+      $this->browser_languages = '';
+      $this->language = '';
+
+      $this->set_language($lng);
+    }
+
+    function set_language($language) {
+      if ( (tep_not_null($language)) && (isset($this->catalog_languages[$language])) ) {
+        $this->language = $this->catalog_languages[$language];
+      } else {
+        $this->language = $this->catalog_languages[DEFAULT_LANGUAGE];
+      }
+    }
+
+    function get_browser_language() {
+      $this->browser_languages = explode(',', getenv('HTTP_ACCEPT_LANGUAGE'));
+
+      for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
+        reset($this->languages);
+        while (list($key, $value) = each($this->languages)) {
+          if (eregi('^(' . $value . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
+            $this->language = $this->catalog_languages[$key];
+            break 2;
+          }
+        }
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/message_stack.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/message_stack.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/message_stack.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,91 @@
+<?php
+/*
+  $Id: message_stack.php,v 1.1.1.1 2004/03/04 23:40:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Example usage:
+
+  $messageStack = new messageStack();
+  $messageStack->add('general', 'Error: Error 1', 'error');
+  $messageStack->add('general', 'Error: Error 2', 'warning');
+  if ($messageStack->size('general') > 0) echo $messageStack->output('general');
+*/
+//Lango Added for template mod: BOF
+  class messageStack extends tableBoxMessagestack {
+//Lango Added for template mod: EOF
+
+// class constructor
+    function messageStack() {
+      global $messageToStack;
+
+      $this->messages = array();
+
+      if (tep_session_is_registered('messageToStack')) {
+        for ($i=0, $n=sizeof($messageToStack); $i<$n; $i++) {
+          $this->add($messageToStack[$i]['class'], $messageToStack[$i]['text'], $messageToStack[$i]['type']);
+        }
+        tep_session_unregister('messageToStack');
+      }
+    }
+
+// class methods
+    function add($class, $message, $type = 'error') {
+      if ($type == 'error') {
+        $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'error.gif', ICON_ERROR) . '&nbsp;' . $message);
+      } elseif ($type == 'warning') {
+        $this->messages[] = array('params' => 'class="messageStackWarning"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . '&nbsp;' . $message);
+      } elseif ($type == 'success') {
+        $this->messages[] = array('params' => 'class="messageStackSuccess"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . '&nbsp;' . $message);
+      } else {
+        $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => $message);
+      }
+    }
+
+    function add_session($class, $message, $type = 'error') {
+      global $messageToStack;
+
+      if (!tep_session_is_registered('messageToStack')) {
+        tep_session_register('messageToStack');
+        $messageToStack = array();
+      }
+
+      $messageToStack[] = array('class' => $class, 'text' => $message, 'type' => $type);
+    }
+
+    function reset() {
+      $this->messages = array();
+    }
+
+    function output($class) {
+      $this->table_data_parameters = 'class="messageBox"';
+
+      $output = array();
+      for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
+        if ($this->messages[$i]['class'] == $class) {
+          $output[] = $this->messages[$i];
+        }
+      }
+//Lango Added for template mod: BOF
+      return $this->tableBoxMessagestack($output);
+//Lango Added for template mod: EOF
+    }
+
+    function size($class) {
+      $count = 0;
+
+      for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
+        if ($this->messages[$i]['class'] == $class) {
+          $count++;
+        }
+      }
+
+      return $count;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/mime.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/mime.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/mime.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,250 @@
+<?php
+/*
+  $Id: mime.php,v 1.1.1.1 2004/03/04 23:40:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  mime.php - a class to assist in building mime-HTML eMails
+
+  The original class was made by Richard Heyes <richard at phpguru.org>
+  and can be found here: http://www.phpguru.org
+
+  Renamed and Modified by Jan Wildeboer for osCommerce
+*/
+
+  class mime {
+    var $_encoding;
+    var $_subparts;
+    var $_encoded;
+    var $_headers;
+    var $_body;
+
+/**
+ * Constructor.
+ *
+ * Sets up the object.
+ *
+ * @param $body   - The body of the mime part if any.
+ * @param $params - An associative array of parameters:
+ *                  content_type - The content type for this part eg multipart/mixed
+ *                  encoding     - The encoding to use, 7bit, base64, or quoted-printable
+ *                  cid          - Content ID to apply
+ *                  disposition  - Content disposition, inline or attachment
+ *                  dfilename    - Optional filename parameter for content disposition
+ *                  description  - Content description
+ * @access public
+ */
+
+    function mime($body, $params = '') {
+      if ($params == '') $params = array();
+
+// Make sure we use the correct linfeed sequence
+      if (EMAIL_LINEFEED == 'CRLF') {
+        $this->lf = "\r\n";
+      } else {
+        $this->lf = "\n";
+      }
+
+      reset($params);
+      while (list($key, $value) = each($params)) {
+        switch ($key) {
+          case 'content_type':
+            $headers['Content-Type'] = $value . (isset($charset) ? '; charset="' . $charset . '"' : '');
+            break;
+          case 'encoding':
+            $this->_encoding = $value;
+            $headers['Content-Transfer-Encoding'] = $value;
+            break;
+          case 'cid':
+            $headers['Content-ID'] = '<' . $value . '>';
+            break;
+          case 'disposition':
+            $headers['Content-Disposition'] = $value . (isset($dfilename) ? '; filename="' . $dfilename . '"' : '');
+            break;
+          case 'dfilename':
+            if (isset($headers['Content-Disposition'])) {
+              $headers['Content-Disposition'] .= '; filename="' . $value . '"';
+            } else {
+              $dfilename = $value;
+            }
+            break;
+          case 'description':
+            $headers['Content-Description'] = $value;
+            break;
+          case 'charset':
+            if (isset($headers['Content-Type'])) {
+              $headers['Content-Type'] .= '; charset="' . $value . '"';
+            } else {
+              $charset = $value;
+            }
+            break;
+        }
+      }
+
+// Default content-type
+      if (!isset($_headers['Content-Type'])) {
+        $_headers['Content-Type'] = 'text/plain';
+      }
+
+// Assign stuff to member variables
+      $this->_encoded = array();
+/* HPDL PHP3 */
+//      $this->_headers  =& $headers;
+      $this->_headers = $headers;
+      $this->_body = $body;
+    }
+
+/**
+ * encode()
+ *
+ * Encodes and returns the email. Also stores
+ * it in the encoded member variable
+ *
+ * @return An associative array containing two elements,
+ *         body and headers. The headers element is itself
+ *         an indexed array.
+ * @access public
+ */
+
+    function encode() {
+/* HPDL PHP3 */
+//      $encoded =& $this->_encoded;
+      $encoded = $this->_encoded;
+
+      if (tep_not_null($this->_subparts)) {
+        $boundary = '=_' . md5(uniqid(tep_rand()) . microtime());
+        $this->_headers['Content-Type'] .= ';' . $this->lf . chr(9) . 'boundary="' . $boundary . '"';
+
+// Add body parts to $subparts
+        for ($i=0; $i<count($this->_subparts); $i++) {
+          $headers = array();
+/* HPDL PHP3 */
+//          $tmp = $this->_subparts[$i]->encode();
+          $_subparts = $this->_subparts[$i];
+          $tmp = $_subparts->encode();
+
+          reset($tmp['headers']);
+          while (list($key, $value) = each($tmp['headers'])) {
+            $headers[] = $key . ': ' . $value;
+          }
+
+          $subparts[] = implode($this->lf, $headers) . $this->lf . $this->lf . $tmp['body'];
+        }
+
+        $encoded['body'] = '--' . $boundary . $this->lf . implode('--' . $boundary . $this->lf, $subparts) . '--' . $boundary.'--' . $this->lf;
+      } else {
+        $encoded['body'] = $this->_getEncodedData($this->_body, $this->_encoding) . $this->lf;
+      }
+
+// Add headers to $encoded
+/* HPDL PHP3 */
+//      $encoded['headers'] =& $this->_headers;
+      $encoded['headers'] = $this->_headers;
+
+      return $encoded;
+    }
+
+/**
+ * &addSubPart()
+ *
+ * Adds a subpart to current mime part and returns
+ * a reference to it
+ *
+ * @param $body   The body of the subpart, if any.
+ * @param $params The parameters for the subpart, same
+ *                as the $params argument for constructor.
+ * @return A reference to the part you just added. It is
+ *         crucial if using multipart/* in your subparts that
+ *         you use =& in your script when calling this function,
+ *         otherwise you will not be able to add further subparts.
+ * @access public
+ */
+
+/* HPDL PHP3 */
+//    function &addSubPart($body, $params) {
+    function addSubPart($body, $params) {
+      $this->_subparts[] = new mime($body, $params);
+
+      return $this->_subparts[count($this->_subparts) - 1];
+    }
+
+/**
+ * _getEncodedData()
+ *
+ * Returns encoded data based upon encoding passed to it
+ *
+ * @param $data     The data to encode.
+ * @param $encoding The encoding type to use, 7bit, base64,
+ *                  or quoted-printable.
+ * @access private
+ */
+
+    function _getEncodedData($data, $encoding) {
+      switch ($encoding) {
+       case '7bit':
+         return $data;
+         break;
+       case 'quoted-printable':
+         return $this->_quotedPrintableEncode($data);
+         break;
+       case 'base64':
+         return rtrim(chunk_split(base64_encode($data), 76, $this->lf));
+         break;
+      }
+    }
+
+/**
+ * quoteadPrintableEncode()
+ *
+ * Encodes data to quoted-printable standard.
+ *
+ * @param $input    The data to encode
+ * @param $line_max Optional max line length. Should
+ *                  not be more than 76 chars
+ *
+ * @access private
+ */
+
+    function _quotedPrintableEncode($input , $line_max = 76) {
+      $lines = preg_split("/\r\n|\r|\n/", $input);
+      $eol = $this->lf;
+      $escape = '=';
+      $output = '';
+
+      while (list(, $line) = each($lines)) {
+        $linlen = strlen($line);
+        $newline = '';
+
+        for ($i = 0; $i < $linlen; $i++) {
+          $char = substr($line, $i, 1);
+          $dec = ord($char);
+
+// convert space at eol only
+          if ( ($dec == 32) && ($i == ($linlen - 1)) ) {
+            $char = '=20';
+          } elseif ($dec == 9) {
+// Do nothing if a tab.
+          } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) {
+            $char = $escape . strtoupper(sprintf('%02s', dechex($dec)));
+          }
+
+// $this->lf is not counted
+          if ((strlen($newline) + strlen($char)) >= $line_max) {
+// soft line break; " =\r\n" is okay
+            $output .= $newline . $escape . $eol;
+            $newline = '';
+          }
+          $newline .= $char;
+        }
+        $output .= $newline . $eol;
+      }
+// Don't want last crlf
+      $output = substr($output, 0, -1 * strlen($eol));
+
+      return $output;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/navigation_history.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/navigation_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/navigation_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,135 @@
+<?php
+/*
+  $Id: navigation_history.php,v 1.1.1.1 2004/03/04 23:40:44 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class navigationHistory {
+    var $path, $snapshot;
+
+    function navigationHistory() {
+      $this->reset();
+    }
+
+    function reset() {
+      $this->path = array();
+      $this->snapshot = array();
+    }
+
+    function add_current_page() {
+      global $PHP_SELF, $HTTP_GET_VARS, $HTTP_POST_VARS, $request_type, $cPath;
+
+      $set = 'true';
+      for ($i=0, $n=sizeof($this->path); $i<$n; $i++) {
+        if ( ($this->path[$i]['page'] == basename($PHP_SELF)) ) {
+          if (isset($cPath)) {
+            if (!isset($this->path[$i]['get']['cPath'])) {
+              continue;
+            } else {
+              if ($this->path[$i]['get']['cPath'] == $cPath) {
+                array_splice($this->path, ($i+1));
+                $set = 'false';
+                break;
+              } else {
+                $old_cPath = explode('_', $this->path[$i]['get']['cPath']);
+                $new_cPath = explode('_', $cPath);
+
+                for ($j=0, $n2=sizeof($old_cPath); $j<$n2; $j++) {
+                  if ($old_cPath[$j] != $new_cPath[$j]) {
+                    array_splice($this->path, ($i));
+                    $set = 'true';
+                    break 2;
+                  }
+                }
+              }
+            }
+          } else {
+            array_splice($this->path, ($i));
+            $set = 'true';
+            break;
+          }
+        }
+      }
+
+      if ($set == 'true') {
+        $this->path[] = array('page' => basename($PHP_SELF),
+                              'mode' => $request_type,
+                              'get' => $HTTP_GET_VARS,
+                              'post' => $HTTP_POST_VARS);
+      }
+    }
+
+    function remove_current_page() {
+      global $PHP_SELF;
+
+      $last_entry_position = sizeof($this->path) - 1;
+      if ($this->path[$last_entry_position]['page'] == basename($PHP_SELF)) {
+        unset($this->path[$last_entry_position]);
+      }
+    }
+
+    function set_snapshot($page = '') {
+      global $PHP_SELF, $HTTP_GET_VARS, $HTTP_POST_VARS, $request_type;
+
+      if (is_array($page)) {
+        $this->snapshot = array('page' => $page['page'],
+                                'mode' => $page['mode'],
+                                'get' => $page['get'],
+                                'post' => $page['post']);
+      } else {
+        $this->snapshot = array('page' => basename($PHP_SELF),
+                                'mode' => $request_type,
+                                'get' => $HTTP_GET_VARS,
+                                'post' => $HTTP_POST_VARS);
+      }
+    }
+
+    function clear_snapshot() {
+      $this->snapshot = array();
+    }
+
+    function set_path_as_snapshot($history = 0) {
+      $pos = (sizeof($this->path)-1-$history);
+      $this->snapshot = array('page' => $this->path[$pos]['page'],
+                              'mode' => $this->path[$pos]['mode'],
+                              'get' => $this->path[$pos]['get'],
+                              'post' => $this->path[$pos]['post']);
+    }
+
+    function debug() {
+      for ($i=0, $n=sizeof($this->path); $i<$n; $i++) {
+        echo $this->path[$i]['page'] . '?';
+        while (list($key, $value) = each($this->path[$i]['get'])) {
+          echo $key . '=' . $value . '&';
+        }
+        if (sizeof($this->path[$i]['post']) > 0) {
+          echo '<br>';
+          while (list($key, $value) = each($this->path[$i]['post'])) {
+            echo '&nbsp;&nbsp;<b>' . $key . '=' . $value . '</b><br>';
+          }
+        }
+        echo '<br>';
+      }
+
+      if (sizeof($this->snapshot) > 0) {
+        echo '<br><br>';
+
+        echo $this->snapshot['mode'] . ' ' . $this->snapshot['page'] . '?' . tep_array_to_string($this->snapshot['get'], array(tep_session_name())) . '<br>';
+      }
+    }
+
+    function unserialize($broken) {
+      for(reset($broken);$kv=each($broken);) {
+        $key=$kv['key'];
+        if (gettype($this->$key)!="user function")
+        $this->$key=$kv['value'];
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/order.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/order.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/order.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,486 @@
+<?php
+/*
+  $Id: order.php,v 1.1.1.1 2004/03/04 23:40:45 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class order {
+    var $info, $totals, $products, $customer, $delivery, $content_type, $states, $country, $s_states, $s_country, $b_states, $b_country ;
+
+    function order($order_id = '') {
+      $this->info = array();
+      $this->totals = array();
+      $this->products = array();
+      $this->customer = array();
+      $this->delivery = array();
+      $this->billing = array();
+      
+      
+      if (tep_not_null($order_id)) {
+        $this->query($order_id);
+      } else {
+        $this->cart();
+      }
+    }
+
+    function query($order_id) {
+      global $languages_id;
+
+      $order_id = tep_db_prepare_input($order_id);
+
+      $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_ccv, cc_expires, currency, currency_value, date_purchased, orders_status, ipaddy, ipisp, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
+      $order = tep_db_fetch_array($order_query);
+
+      $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
+      while ($totals = tep_db_fetch_array($totals_query)) {
+        $this->totals[] = array('title' => $totals['title'],
+                                'text' => $totals['text']);
+      }
+
+// begin PayPal_Shopping_Cart_IPN V2.8 DMG
+      $order_total_query = tep_db_query("select text, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_total'");
+// end PayPal_Shopping_Cart_IPN
+      $order_total = tep_db_fetch_array($order_total_query);
+
+//begin PayPal_Shopping_Cart_IPN V2.8 DMG
+      $shipping_method_query = tep_db_query("select title, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_shipping'");
+//end PayPal_Shopping_Cart_IPN
+      $shipping_method = tep_db_fetch_array($shipping_method_query);
+
+      $order_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order['orders_status'] . "' and language_id = '" . (int)$languages_id . "'");
+      $order_status = tep_db_fetch_array($order_status_query);
+
+      $this->info = array('currency' => $order['currency'],
+                          'currency_value' => $order['currency_value'],
+                          'payment_method' => $order['payment_method'],
+                          'cc_type' => $order['cc_type'],
+                          'cc_owner' => $order['cc_owner'],
+                          'cc_number' => $order['cc_number'],
+                          'cc_start' => $order['cc_start'],
+                          'cc_issue' => $order['cc_issue'],
+                          'cc_ccv' => $order['cc_ccv'],
+                          'cc_expires' => $order['cc_expires'],
+                          'date_purchased' => $order['date_purchased'],
+//begin PayPal_Shopping_Cart_IPN
+                          'payment_id' => $order['payment_id'],
+                          'orders_status' => $order['orders_status'],
+                          'shipping_cost' => $shipping_method['value'],
+                          'total_value' => $order_total['value'],
+//end PayPal_Shopping_Cart_IPN
+                          'orders_status' => $order_status['orders_status_name'],
+                          'orders_status_number' => $order['orders_status'],
+                          'last_modified' => $order['last_modified'],
+                          'total' => strip_tags($order_total['text']),
+                          'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])));
+
+      $this->customer = array('name' => $order['customers_name'],
+                              //begin PayPal_Shopping_Cart_IPN
+                              'id' => $order['customers_id'],
+                              //end PayPal_Shopping_Cart_IPN
+                              'company' => $order['customers_company'],
+                              'street_address' => $order['customers_street_address'],
+                              'suburb' => $order['customers_suburb'],
+                              'city' => $order['customers_city'],
+                              'postcode' => $order['customers_postcode'],
+                              'state' => $order['customers_state'],
+                              'country' => $order['customers_country'],
+                              'format_id' => $order['customers_address_format_id'],
+                              'telephone' => $order['customers_telephone'],
+                              'email_address' => $order['customers_email_address'],
+                              'ipaddy' => $order['ipaddy'],
+            'ipisp' => $order['ipisp']);
+                
+
+      $this->delivery = array('name' => $order['delivery_name'],
+                              'company' => $order['delivery_company'],
+                              'street_address' => $order['delivery_street_address'],
+                              'suburb' => $order['delivery_suburb'],
+                              'city' => $order['delivery_city'],
+                              'postcode' => $order['delivery_postcode'],
+                              'state' => $order['delivery_state'],
+                              'country' => $order['delivery_country'],
+                              'format_id' => $order['delivery_address_format_id']);
+
+      if (empty($this->delivery['name']) && empty($this->delivery['street_address'])) {
+        $this->delivery = false;
+      }
+
+      $this->billing = array('name' => $order['billing_name'],
+                             'company' => $order['billing_company'],
+                             'street_address' => $order['billing_street_address'],
+                             'suburb' => $order['billing_suburb'],
+                             'city' => $order['billing_city'],
+                             'postcode' => $order['billing_postcode'],
+                             'state' => $order['billing_state'],
+                             'country' => $order['billing_country'],
+                             'format_id' => $order['billing_address_format_id']);
+
+      $index = 0;
+      $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
+      while ($orders_products = tep_db_fetch_array($orders_products_query)) {
+       $this->products[$index] = array('qty' => $orders_products['products_quantity'],
+                                  'id' => $orders_products['products_id'],
+//begin PayPal_Shopping_Cart_IPN
+                                        'orders_products_id' => $orders_products['orders_products_id'],
+//end PayPal_Shopping_Cart_IPN
+                                        'name' => $orders_products['products_name'],
+                                        'model' => $orders_products['products_model'],
+                                        'tax' => $orders_products['products_tax'],
+                                        'price' => $orders_products['products_price'],
+                                        'final_price' => $orders_products['final_price']);
+
+  // Eversun mod for sppc and qty price breaks
+  if(!tep_session_is_registered('sppc_customer_group_id')) {
+    $customer_group_id = '0';
+  } else {
+    $customer_group_id = $sppc_customer_group_id;
+  }
+  if ($customer_group_id != '0'){
+    $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id . "' and products_id = '" . $products[$i]['id'] . "'");
+    if ($orders_customers = tep_db_fetch_array($orders_customers_price)){
+      $this->products[$index] = array('price' => $orders_customers['customers_group_price'], 'final_price' => $orders_customers['customers_group_price']);
+    }
+  }
+// Eversun mod for sppc and qty price breaks
+
+        $subindex = 0;
+//      $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
+        //begin PayPal_Shopping_Cart_IPN V2.8 DMG
+        $attributes_query = tep_db_query("select products_options_id, products_options, products_options_values_id, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
+        //end PayPal_Shopping_Cart_IPN
+        if (tep_db_num_rows($attributes_query)) {
+          while ($attributes = tep_db_fetch_array($attributes_query)) {
+            $this->products[$index]['attributes'][$subindex] = array(
+//begin PayPal_Shopping_Cart_IPN
+                                  'option_id' => $attributes['products_options_id'],
+                                  'value_id' => $attributes['products_options_values_id'],
+//end PayPal_Shopping_Cart_IPN
+                                  'value' => $attributes['products_options_values'],
+                                  'option' => $attributes['products_options'],
+                                  'option_name' => $attributes['products_options_name'],
+                                  'prefix' => $attributes['price_prefix'],
+                                  'price' => $attributes['options_values_price']);
+
+            $subindex++;
+          }
+        }
+
+        $this->info['tax_groups']["{$this->products[$index]['tax']}"] = '1';
+
+        $index++;
+      }
+    }
+
+    function cart() {
+       global $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment, $statea, $country_title_s, $format_id_s;
+ 
+       $this->content_type = $cart->get_content_type();
+      $this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,
+                          'currency' => $currency,
+                          'currency_value' => $currencies->currencies[$currency]['value'],
+                          'payment_method' => $payment,
+                          'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),
+                          'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),
+                          'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),
+                          'cc_ccv' => (isset($GLOBALS['cc_ccv']) ? $GLOBALS['cc_ccv'] : ''),
+                          'cc_start' => (isset($GLOBALS['cc_start']) ? $GLOBALS['cc_start'] : ''),
+                          'cc_issue' => (isset($GLOBALS['cc_issue']) ? $GLOBALS['cc_issue'] : ''),
+                          'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),
+                          'shipping_method' => $shipping['title'],
+                          'shipping_cost' => $shipping['cost'],
+                          'subtotal' => 0,
+                          'tax' => 0,
+                          'tax_groups' => array(),
+                          'comments' => (isset($GLOBALS['comments']) ? $GLOBALS['comments'] : ''));
+
+      if (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment])) {
+        $this->info['payment_method'] = $GLOBALS[$payment]->title;
+
+        if ( isset($GLOBALS[$payment]->order_status) && is_numeric($GLOBALS[$payment]->order_status) && ($GLOBALS[$payment]->order_status > 0) ) {
+          $this->info['order_status'] = $GLOBALS[$payment]->order_status;
+        }
+      }
+// Get cutomeradress info
+      $customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, ab.entry_state, ab.entry_country_id from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab  where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and c.customers_default_address_id = ab.address_book_id"); 
+ while ( $customer_address = tep_db_fetch_array($customer_address_query) ){
+ 
+$customer_country_query = tep_db_query("select co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id from " . TABLE_COUNTRIES . " co  where co.countries_id = '" . $customer_address['entry_country_id'] . "'");
+ while ($customer_country = tep_db_fetch_array($customer_country_query) ) { 
+                              $country_array = array('id' => $customer_country['countries_id'], 'title' => $customer_country['countries_name'], 'iso_code_2' => $customer_country['countries_iso_code_2'], 'iso_code_3' => $customer_country['countries_iso_code_3']); 
+                                
+
+  $customer_zone_query = tep_db_query("select z.zone_name from " . TABLE_ZONES . " z where z.zone_id ='" . $customer_address['entry_zone_id'] . "' ");
+               if (tep_not_null($customer_address['entry_state'])){
+                   $states = $customer_address['entry_state']; 
+                  }else{
+       while ($customer_zone1 = tep_db_fetch_array($customer_zone_query) ) { 
+                   $states = $customer_zone1['zone_name'];
+                   }
+                }
+                
+                
+//build customer info array
+  $this->customer = array('firstname' => $customer_address['customers_firstname'],
+                              'lastname' => $customer_address['customers_lastname'],
+                              'company' => $customer_address['entry_company'],
+                              'street_address' => $customer_address['entry_street_address'],
+                              'suburb' => $customer_address['entry_suburb'],
+                              'city' => $customer_address['entry_city'],
+                              'postcode' => $customer_address['entry_postcode'],
+                              'state' => $states,
+                              'zone_id' => $customer_address['entry_zone_id'],
+                              'country' => $country_array, 
+                              'country_id' => $customer_address['entry_country_id'],
+                              'format_id' => $customer_country['address_format_id'],
+                              'telephone' => $customer_address['customers_telephone'],
+                              'email_address' => $customer_address['customers_email_address'],
+                              );
+
+}
+}
+     $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, ab.entry_country_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$sendto . "'");
+ while ($shipping_address = tep_db_fetch_array($shipping_address_query) ){
+
+    $shipping_zone_query= tep_db_query("select co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id from "  . TABLE_COUNTRIES . " co  where co.countries_id = '" . $shipping_address['entry_country_id'] ."'");
+   while ($shipping_zone = tep_db_fetch_array($shipping_zone_query) ) {
+                                   $s_country = array('id' => $shipping_zone['countries_id'], 'title' => $shipping_zone['countries_name'], 'iso_code_2' => $shipping_zone['countries_iso_code_2'], 'iso_code_3' => $shipping_zone['countries_iso_code_3']);
+                    
+
+      $shipping_zone_query1= tep_db_query("select  z.zone_name from " . TABLE_ZONES . " z where z.zone_id = '" . $shipping_address['entry_zone_id'] . "' ");
+               if (tep_not_null($shipping_address['entry_state'])){
+                            $s_states = $shipping_address['entry_state']; 
+                                }else{
+                   while ($shipping_zone1 = tep_db_fetch_array($shipping_zone_query1) ) {
+                                  $s_states = $shipping_zone1['zone_name'];
+                                  }
+                                }  
+                                
+$this->delivery = array('firstname' => $shipping_address['entry_firstname'],
+                              'lastname' => $shipping_address['entry_lastname'],
+                              'company' => $shipping_address['entry_company'],
+                              'street_address' => $shipping_address['entry_street_address'],
+                              'suburb' => $shipping_address['entry_suburb'],
+                              'city' => $shipping_address['entry_city'],
+                              'postcode' => $shipping_address['entry_postcode'],
+                              'state' => $s_states,
+                              'zone_id' => $shipping_address['entry_zone_id'],
+                              'country' =>  $s_country,
+                              'country_id' => $shipping_address['entry_country_id'],
+                              'format_id' => $shipping_zone['address_format_id']);
+  
+  }
+ }
+//}
+      $billing_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, ab.entry_country_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$billto . "'");
+      while ($billing_address = tep_db_fetch_array($billing_address_query) ){
+ 
+     
+        $billing_zone_query= tep_db_query("select co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id from " . TABLE_COUNTRIES . " co  where co.countries_id = '" . $billing_address['entry_country_id'] ."'");
+        while ($billing_zone = tep_db_fetch_array($billing_zone_query) ){
+                 $b_country = array('id' => $billing_zone['countries_id'], 'title' => $billing_zone['countries_name'], 'iso_code_2' => $billing_zone['countries_iso_code_2'], 'iso_code_3' => $billing_zone['countries_iso_code_3']);
+                   
+       $billing_zone_query1= tep_db_query("select z.zone_name from " . TABLE_ZONES . " z where z.zone_id ='" . $billing_address['entry_zone_id'] . "' ");
+         if (tep_not_null($billing_address['entry_state'])){
+                  $b_state = $billing_address['entry_state']; 
+              }else{
+          while ($billing_zone1 = tep_db_fetch_array($billing_zone_query1) ){
+              $b_state = $billing_zone1['zone_name'];
+              }
+           }
+      $this->billing = array('firstname' => $billing_address['entry_firstname'],
+                             'lastname' => $billing_address['entry_lastname'],
+                             'company' => $billing_address['entry_company'],
+                             'street_address' => $billing_address['entry_street_address'],
+                             'suburb' => $billing_address['entry_suburb'],
+                             'city' => $billing_address['entry_city'],
+                             'postcode' => $billing_address['entry_postcode'],
+                              'state' => $b_state,
+                              'zone_id' => $billing_address['entry_zone_id'],
+                              'country' => $b_country,
+                              'country_id' => $billing_address['entry_country_id'],
+                              'format_id' => $billing_zone['address_format_id']);
+  } 
+}
+      $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'");
+      $tax_address = tep_db_fetch_array($tax_address_query);
+    
+    $index = 0;
+      $products = $cart->get_products();
+      for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+        $this->products[$index] = array('qty' => $products[$i]['quantity'],
+                                        'name' => $products[$i]['name'],
+                                        'model' => $products[$i]['model'],
+                                        'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
+                                        'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
+                                        'price' => $products[$i]['price'],
+                                        'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
+                                        'weight' => $products[$i]['weight'],
+                                        'id' => $products[$i]['id']);
+// Eversun mod for sppc and qty price breaks
+/*
+    if(!tep_session_is_registered('sppc_customer_group_id')) {
+    $customer_group_id = '0';
+    } else {
+     $customer_group_id = $sppc_customer_group_id;
+    }
+    if ($customer_group_id != '0'){
+    $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id . "' and products_id = '" . $products[$i]['id'] . "'");
+    $orders_customers = tep_db_fetch_array($orders_customers_price);
+    if ($orders_customers = tep_db_fetch_array($orders_customers_price)) {
+    $this->products[$index] = array('price' => $orders_customers['customers_group_price'],
+                      'final_price' => $orders_customers['customers_group_price'] + $cart->attributes_price($products[$i]['id']));
+    }
+    }
+    */
+// Eversun mod for sppc and qty price breaks
+
+        if ($products[$i]['attributes']) {
+          $subindex = 0;
+          reset($products[$i]['attributes']);
+          while (list($option, $value) = each($products[$i]['attributes'])) {
+            // BOM - Options Catagories
+            /*
+            $attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
+            $attributes = tep_db_fetch_array($attributes_query);
+
+            $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
+                                                                     'value' => $attributes['products_options_values_name'],
+                                                                     'option_id' => $option,
+                                                                     'value_id' => $value,
+                                                                     'prefix' => $attributes['price_prefix'],
+                                                                     'price' => $attributes['options_values_price']);
+
+            $subindex++;
+            */
+            if ( !is_array($value) ) {
+              $attributes_query = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, ov.products_options_values_name, op.options_values_price as price, op.price_prefix
+                                                from " . TABLE_PRODUCTS_ATTRIBUTES . " op,
+                                                     " . TABLE_PRODUCTS_OPTIONS . " o,
+                                                     " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot,
+                                                     " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov
+                                                where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                                  and op.options_id = '" . $option . "'
+                                                  and o.products_options_id = '" . $option . "'
+                                                  and ot.products_options_text_id = '" . $option . "'
+                                                  and op.options_values_id = '" . $value . "'
+                                                  and ov.products_options_values_id = '" . $value . "'
+                                                  and ov.language_id = '" . (int)$languages_id . "'
+                                                  and ot.language_id = '" . (int)$languages_id . "'
+                                               ");
+              $attributes = tep_db_fetch_array($attributes_query);
+              $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
+                                                                       'value' => $attributes['products_options_values_name'],
+                                                                       'option_id' => $option,
+                                                                       'value_id' => $value,
+                                                                       'prefix' => $attributes['price_prefix'],
+                                                                       'price' => $attributes['price']);
+              $subindex++;
+            } elseif ( isset($value['c'] ) ) {
+              foreach ($value['c'] as $v) {
+                $attributes_query = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, ov.products_options_values_name, op.options_values_price as price, op.price_prefix
+                                                  from " . TABLE_PRODUCTS_ATTRIBUTES . " op,
+                                                     " . TABLE_PRODUCTS_OPTIONS . " o,
+                                                     " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot,
+                                                     " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov
+                                                  where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                                    and op.options_id = '" . $option . "'
+                                                    and o.products_options_id = '" . $option . "'
+                                                    and ot.products_options_text_id = '" . $option . "'
+                                                    and op.options_values_id = '" . $v . "'
+                                                    and ov.products_options_values_id = '" . $v . "'
+                                                    and ov.language_id = '" . (int)$languages_id . "'
+                                                    and ot.language_id = '" . (int)$languages_id . "'
+                                                 ");
+                $attributes = tep_db_fetch_array($attributes_query);
+                $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
+                                                                       'value' => $attributes['products_options_values_name'],
+                                                                       'option_id' => $option,
+                                                                       'value_id' => $v,
+                                                                       'prefix' => $attributes['price_prefix'],
+                                                                       'price' => $attributes['price']);
+                $subindex++;
+              }
+            } elseif ( isset($value['t'] ) ) {
+              $attributes_query = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, op.options_values_price as price, op.price_prefix
+                                                from " . TABLE_PRODUCTS_ATTRIBUTES . " op,
+                                                     " . TABLE_PRODUCTS_OPTIONS . " o,
+                                                     " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot
+                                                where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                                  and op.options_id = '" . $option . "'
+                                                  and o.products_options_id = '" . $option . "'
+                                                  and ot.products_options_text_id = '" . $option . "'
+                                                  and ot.language_id = '" . (int)$languages_id . "'
+                                               ");
+              $attributes = tep_db_fetch_array($attributes_query);
+              $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
+                                                                       'value' => $value['t'],
+                                                                       'option_id' => $option,
+                                                                       'value_id' => '0',
+                                                                       'prefix' => $attributes['price_prefix'],
+                                                                       'price' => $attributes['price']);
+              $subindex++;
+            }
+// EOM - Options Catagories
+          }
+        }
+
+        $shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
+        $this->info['subtotal'] += $shown_price;
+
+        $products_tax = $this->products[$index]['tax'];
+        $products_tax_description = $this->products[$index]['tax_description'];
+       
+      // Eversun mod for sppc and qty price breaks
+//       if (DISPLAY_PRICE_WITH_TAX == 'true') {
+    global $sppc_customer_group_show_tax;
+    if(!tep_session_is_registered('sppc_customer_group_show_tax')) {
+      $customer_group_show_tax = '1';
+    } else {
+      $customer_group_show_tax = $sppc_customer_group_show_tax;
+    }
+    if (DISPLAY_PRICE_WITH_TAX == 'true' && $customer_group_show_tax == '1') {
+// Eversun mod for sppc and qty price breaks
+
+          $this->info['tax'] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
+          if (isset($this->info['tax_groups']["$products_tax_description"])) {
+            $this->info['tax_groups']["$products_tax_description"] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
+          } else {
+            $this->info['tax_groups']["$products_tax_description"] = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
+          }
+        } else {
+          $this->info['tax'] += ($products_tax / 100) * $shown_price;
+          if (isset($this->info['tax_groups']["$products_tax_description"])) {
+            $this->info['tax_groups']["$products_tax_description"] += ($products_tax / 100) * $shown_price;
+          } else {
+            $this->info['tax_groups']["$products_tax_description"] = ($products_tax / 100) * $shown_price;
+          }
+        }
+
+        $index++;
+      }
+
+      
+       //Eversun mod for sppc and qty price breaks
+//      if (DISPLAY_PRICE_WITH_TAX == 'true') {
+  global $sppc_customer_group_show_tax;
+        if(!tep_session_is_registered('sppc_customer_group_show_tax')) {
+        $customer_group_show_tax = '1';
+        } else {
+        $customer_group_show_tax = $sppc_customer_group_show_tax;
+        }
+        if ((DISPLAY_PRICE_WITH_TAX == 'true') && ($customer_group_show_tax == '1')) {
+// Eversun mod for sppc and qty price breaks
+        $this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];
+      } else {
+        $this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];
+      }
+    }
+
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/order_total.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/order_total.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/order_total.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,259 @@
+<?php
+/*
+  $Id: order_total.php,v 1.2 2004/03/09 18:56:37 ccwjr Exp $
+  orig : order_total.php,v 1.4 2003/02/11 00:04:53 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class order_total {
+    var $modules;
+
+// class constructor
+    function order_total() {
+      global $language;
+
+      if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {
+        $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
+
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          include(DIR_WS_LANGUAGES . $language . '/modules/order_total/' . $value);
+          include(DIR_WS_MODULES . 'order_total/' . $value);
+
+          $class = substr($value, 0, strrpos($value, '.'));
+          $GLOBALS[$class] = new $class;
+        }
+      }
+    }
+
+    function process() {
+      $order_total_array = array();
+      if (is_array($this->modules)) {
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ($GLOBALS[$class]->enabled) {
+            $GLOBALS[$class]->process();
+
+            for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
+              if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
+                $order_total_array[] = array('code' => $GLOBALS[$class]->code,
+                                             'title' => $GLOBALS[$class]->output[$i]['title'],
+                                             'text' => $GLOBALS[$class]->output[$i]['text'],
+                                             'value' => $GLOBALS[$class]->output[$i]['value'],
+                                             'sort_order' => $GLOBALS[$class]->sort_order);
+              }
+            }
+          }
+        }
+      }
+
+      return $order_total_array;
+    }
+
+    function output() {
+      $output_string = '';
+      if (is_array($this->modules)) {
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ($GLOBALS[$class]->enabled) {
+            $size = sizeof($GLOBALS[$class]->output);
+            for ($i=0; $i<$size; $i++) {
+              $output_string .= '              <tr>' . "\n" .
+                                '                <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . '</td>' . "\n" .
+                                '                <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" .
+                                '              </tr>';
+            }
+          }
+        }
+      }
+
+      return $output_string;
+    }
+// ICW ORDER TOTAL CREDIT CLASS/GV SYSTEM - START ADDITION
+//
+// This function is called in checkout payment after display of payment methods. It actually calls
+// two credit class functions.
+//
+// use_credit_amount() is normally a checkbox used to decide whether the credit amount should be applied to reduce
+// the order total. Whether this is a Gift Voucher, or discount coupon or reward points etc.
+//
+// The second function called is credit_selection(). This in the credit classes already made is usually a redeem box.
+// for entering a Gift Voucher number. Note credit classes can decide whether this part is displayed depending on
+// E.g. a setting in the admin section.
+//
+    function credit_selection() {
+      $selection_string = '';
+      $close_string = '';
+      $credit_class_string = '' ;
+      if (MODULE_ORDER_TOTAL_INSTALLED) {
+        $header_string = '<tr>' . "\n";
+        $header_string .= '   <td><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";
+        $header_string .= '      <tr>' . "\n";
+        $header_string .= '        <td class="main"><b>' . TABLE_HEADING_CREDIT . '</b></td>' . "\n";
+        $header_string .= '      </tr>' . "\n";
+        $header_string .= '    </table></td>' . "\n";
+        $header_string .= '  </tr>' . "\n";
+        $header_string .= '<tr>' . "\n";
+        $header_string .= '   <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">' . "\n";
+        $header_string .= '     <tr class="infoBoxContents"><td><table border="0" width="100%" cellspacing="0" cellpadding="2">' ."\n";
+        $header_string .= '       <tr><td width="10">' .  tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . "\n";
+        $header_string .= '           <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";
+        $close_string   = '                           </table></td>';
+        $close_string  .= '<td width="10">' .  tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';
+        $close_string  .= '</tr></table></td></tr></table></td>';
+        $close_string  .= '<tr><td width="100%">' .  tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>';
+        reset($this->modules);
+        $output_string = '';
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {
+            $use_credit_string = $GLOBALS[$class]->use_credit_amount();
+//            if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection();
+            $selection_string = $GLOBALS[$class]->credit_selection();
+            if ( ($use_credit_string !='' ) || ($selection_string != '') ) {
+              $output_string .=  '<tr><td colspan="4">' .  tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>' . "\n";
+              $output_string .= ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" .
+                               '     <td class="main"><b>' . $GLOBALS[$class]->title . '</b></td>' . "\n" . $use_credit_string;
+              $output_string .= '  </tr>' . "\n";
+              $output_string .= $selection_string;
+            }
+
+          }
+        }
+        if ($output_string != '') {
+          $return_string = $header_string . $output_string . $close_string;
+        } else {
+          $return_string = '';
+        }
+      }
+      return $return_string;
+    }
+
+
+//            if ($selection_string !='') {
+//              $output_string .= '</td>' . "\n";
+//              $output_string .= $selection_string;
+//            }
+
+
+
+
+// update_credit_account is called in checkout process on a per product basis. It's purpose
+// is to decide whether each product in the cart should add something to a credit account.
+// e.g. for the Gift Voucher it checks whether the product is a Gift voucher and then adds the amount
+// to the Gift Voucher account.
+// Another use would be to check if the product would give reward points and add these to the points/reward account.
+//
+    function update_credit_account($i) {
+      if (MODULE_ORDER_TOTAL_INSTALLED) {
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
+            $GLOBALS[$class]->update_credit_account($i);
+          }
+        }
+      }
+    }
+// This function is called in checkout confirmation.
+// It's main use is for credit classes that use the credit_selection() method. This is usually for
+// entering redeem codes(Gift Vouchers/Discount Coupons). This function is used to validate these codes.
+// If they are valid then the necessary actions are taken, if not valid we are returned to checkout payment
+// with an error
+//
+    function collect_posts() {
+      global $HTTP_POST_VARS,$HTTP_SESSION_VARS;
+      if (MODULE_ORDER_TOTAL_INSTALLED) {
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
+            $post_var = 'c' . $GLOBALS[$class]->code;
+            if ($HTTP_POST_VARS[$post_var]) {
+    if (!tep_session_is_registered($post_var)) tep_session_register($post_var);
+    $post_var = $HTTP_POST_VARS[$post_var];
+            }
+            $GLOBALS[$class]->collect_posts();
+          }
+        }
+      }
+    }
+// pre_confirmation_check is called on checkout confirmation. It's function is to decide whether the
+// credits available are greater than the order total. If they are then a variable (credit_covers) is set to
+// true. This is used to bypass the payment method. In other words if the Gift Voucher is more than the order
+// total, we don't want to go to paypal etc.
+//
+    function pre_confirmation_check() {
+      global $payment, $order, $credit_covers;
+      if (MODULE_ORDER_TOTAL_INSTALLED) {
+        $total_deductions  = 0;
+        reset($this->modules);
+        $order_total = $order->info['total'];
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          $order_total = $this->get_order_total_main($class,$order_total);
+          if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
+            $total_deductions = $total_deductions + $GLOBALS[$class]->pre_confirmation_check($order_total);
+            $order_total = $order_total - $GLOBALS[$class]->pre_confirmation_check($order_total);
+          }
+        }
+        if ($order->info['total'] - $total_deductions <= 0 ) {
+          if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers');
+          $credit_covers = true;
+        }
+        else{   // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart
+          if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');
+        }
+      }
+    }
+// this function is called in checkout process. it tests whether a decision was made at checkout payment to use
+// the credit amount be applied aginst the order. If so some action is taken. E.g. for a Gift voucher the account
+// is reduced the order total amount.
+//
+    function apply_credit() {
+      if (MODULE_ORDER_TOTAL_INSTALLED) {
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
+            $GLOBALS[$class]->apply_credit();
+          }
+        }
+      }
+    }
+// Called in checkout process to clear session variables created by each credit class module.
+//
+    function clear_posts() {
+      global $HTTP_POST_VARS,$HTTP_SESSION_VARS;
+      if (MODULE_ORDER_TOTAL_INSTALLED) {
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
+            $post_var = 'c' . $GLOBALS[$class]->code;
+              if (tep_session_is_registered($post_var)) tep_session_unregister($post_var);
+          }
+        }
+      }
+    }
+// Called at various times. This function calulates the total value of the order that the
+// credit will be appled aginst. This varies depending on whether the credit class applies
+// to shipping & tax
+//
+    function get_order_total_main($class, $order_total) {
+      global $credit, $order;
+    // if ($GLOBALS[$class]->include_tax == 'false') $order_total=$order_total-$order->info['tax'];
+    // if ($GLOBALS[$class]->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost'];
+      return $order_total;
+    }
+// ICW ORDER TOTAL CREDIT CLASS/GV SYSTEM - END ADDITION
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/page_cache.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/page_cache.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/page_cache.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,390 @@
+<?php
+/*=======================================================================*\
+|| #################### //-- SCRIPT INFO --// ########################### ||
+|| #  Script name: page_cache.php                                     # ||
+|| #  Contribution: Page Cache                                        # ||
+|| #  Version: 1.6CRE                                                 # ||
+|| #  Date: April 1, 2005                                             # ||
+|| # ------------------------------------------------------------------ # ||
+|| #################### //-- COPYRIGHT INFO --// ######################## ||
+|| #  Original Author = Bobby Easland                   # ||
+|| #  Upgrade Author & CRE Changes = Chris LaRocque             # ||
+|| #                                  # ||
+|| #  This script is free software; you can redistribute it and/or  # ||
+|| #  modify it under the terms of the GNU General Public License   # ||
+|| #  as published by the Free Software Foundation; either version 2  # ||
+|| #  of the License, or (at your option) any later version.      # ||
+|| #                                  # ||
+|| #  This script is distributed in the hope that it will be useful,  # ||
+|| #  but WITHOUT ANY WARRANTY; without even the implied warranty of  # ||
+|| #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the # ||
+|| #  GNU General Public License for more details.          # ||
+|| #                                  # ||
+|| #  Script is intended to be used with:               # ||
+|| #  CRE Loaded 6.1a                                       # ||
+|| #  http://www.creloaded.com                    # ||
+|| ###################################################################### ||
+\*========================================================================*/
+#--------------------------------------------------------------------------#
+############################################################################ 
+#  DO NOT ALTER OR EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING #
+############################################################################ 
+#--------------------------------------------------------------------------# 
+
+class page_cache {
+  # Define class variables
+  var $cache_dir, $cache_filename, $cache_param, $cache_file, $customer_cart, $cache_compress, $cache_language, $cache_currency, $customer_sid;
+  var $debug_ouput = array();
+  var $cache_lifetime = 5;
+  var $is_guest = false;
+  var $debug_messages = false;
+  var $cache_file_exists = false;
+  var $cache_file_is_expired = true;
+  var $write_cache_file = false;
+  var $output_ob = false;
+
+/*##################################################################################
+
+Class constructor must have the $cart_cache passed to keep the customer shopping cart dynamic
+
+###################################################################################*/
+  function page_cache($cart_info, $cache_time = PAGE_CACHE_LIFETIME, $debug_switch = PAGE_CACHE_DEBUG_MODE) {
+    global $SID;
+    # Start populating the debug array with the current database settings 
+    $this->debug_output['admin_config_settings']['ENABLE_PAGE_CACHE'] = ENABLE_PAGE_CACHE;
+    $this->debug_output['admin_config_settings']['PAGE_CACHE_LIFETIME'] = PAGE_CACHE_LIFETIME;
+    $this->debug_output['admin_config_settings']['PAGE_CACHE_DEBUG_MODE'] = PAGE_CACHE_DEBUG_MODE;
+    $this->debug_output['admin_config_settings']['PAGE_CACHE_DISABLE_PARAMETERS'] = PAGE_CACHE_DISABLE_PARAMETERS; 
+    $this->debug_output['admin_config_settings']['PAGE_CACHE_DELETE_FILES'] = PAGE_CACHE_DELETE_FILES;
+    $this->debug_output['admin_config_settings']['PAGE_CACHE_UPDATE_CONFIG_FILES'] = PAGE_CACHE_UPDATE_CONFIG_FILES;
+    
+    # Set the cache directory and store the setting in the debug array
+    $this->cache_dir = PAGE_CACHE_DIR;
+    $this->debug_output['cache_dir'] = $this->cache_dir;
+      
+    # If the delete cache file switch is true then let's go through this code
+    if (PAGE_CACHE_DELETE_FILES == 'true') {
+      # Check to see if there is a configuration cache contribution installed and the file exists 
+      $this->debug_output['PAGE_CACHE_UPDATE_CONFIG_FILE_EXISTS'] = (file_exists(PAGE_CACHE_UPDATE_CONFIG_FILES) ? 'true' : 'false');
+      # Call the delete_cache_files() method
+      $this->delete_cache_files();
+      # Add the "deleted cache files" message to the debug array
+      ///$this->debug_output['delete_cache_files'] = 'cache files deleted - top level';
+      $this->debug_output['delete_cache_files'] = DELETE_CACHE_FILES;
+      # Change the delete cache file switch to "false"
+      tep_db_query("UPDATE configuration SET configuration_value = 'false' WHERE configuration_key = 'PAGE_CACHE_DELETE_FILES'");   
+      # Add the switch change to the debug array
+      //$this->debug_ouput['update_configuration_setting'] = 'PAGE_CACHE_DELETE_FILES reset to false';
+      $this->debug_ouput['update_configuration_setting'] = 'PAGE_CACHE_DELETE_FILES '.UPDATE_CONFIGURATION_SETTING;
+      # If a configuration cache file is specified include it if it exists
+      if ( file_exists(PAGE_CACHE_UPDATE_CONFIG_FILES) ) {
+        require(PAGE_CACHE_UPDATE_CONFIG_FILES);
+        # Add the "config cache file updated" message to the debug array
+        //$this->debug_ouput['update_config_files'] = 'configuration cache files updated';
+        $this->debug_ouput['update_config_files'] = UPDATE_CONFIG_FILES_EXIST;
+        } # END if file_exists
+        else {
+          //$this->debug_ouput['update_config_files'] = 'ERROR: update file does not exist';
+          $this->debug_ouput['update_config_files'] = UPDATE_CONFIG_FILES_NOTEXIST;
+        }   
+      } # END delete cache files
+       
+    # Take the PHP_SELF global and replace all the /'s
+    # This should work with ALL URL's but best for search engine safe
+    $this->cache_filename = str_replace("/", "_", $_SERVER['PHP_SELF']);
+    # Add the constructed cache_filename to the debug output
+    $this->debug_output['cache_filename'] = $this->cache_filename; 
+    # Replace all the /'s in the URL parameters.  Should not be needed but just in case...
+    $this->cache_param = str_replace("/", "_", $_SERVER["QUERY_STRING"]);
+    # Remove the osCsid from the cache parameters
+    $this->cache_param = preg_replace("/([&]|)osCsid=.{32}/", "", $_SERVER["QUERY_STRING"]);
+    # Add the constructed cache_param to debug output
+    $this->debug_output['cache_param'] = $this->cache_param;
+    #Add the cache language and store it
+    $this->cache_language = '_' . $_SESSION['language'];
+    $this->debug_output['cache_language'] = $this->cache_language;
+    # Set the cache file currency and store it
+    $this->cache_currency = '_' . $_SESSION['currency'];
+    $this->debug_output['cache_currency'] = $this->cache_currency;
+    # Check whether page parameters are disabled
+    # May be needed in some cases where live help is offered and the LHO session ID is appended to URL's, etc.
+    if (PAGE_CACHE_DISABLE_PARAMETERS == 'false') {
+      # Parameters are NOT disabled so include them in the cache_file naming 
+      $this->cache_file = $this->cache_dir.$this->cache_filename.'_'.$this->cache_param.$this->cache_language.$this->cache_currency.".cache";
+      } else {
+        # Parameters ARE disabled so DO NOT include them in the cache_file naming
+        $this->cache_file = $this->cache_dir.$this->cache_filename.$this->cache_language.$this->cache_currency.".cache";
+        }
+      # Add the constructed cache_file setting to the debug array
+      $this->debug_output['cache_file'] = $this->cache_file;
+    # Convert cache time from minutes to seconds
+    $this->cache_lifetime = $cache_time * 60;
+    # collect the garbage if not set to daily expiration
+    if (PAGE_CACHE_LIFETIME == '0') {
+    $this->collect_garbage_daily(); // runs daily
+    }else{
+    if ( rand(0, 100) <= 5 ) $this->collect_garbage();  // 5% chance of triggering GC
+    }
+    # Add the lifetime to the debug array
+    $this->debug_output['cache_lifetime'] = $this->cache_lifetime . ' seconds';
+    # Add a way to output the debug array other than globally
+    # To activate this switch append ?debug=1 to the end of a cached file URL
+    ($_GET['debug'] ? $this->debug_messages = 'true' : $this->debug_messages = $debug_switch);
+    # Add the setting to the debug array
+    $this->debug_output['debug_output'] = $this->debug_messages;
+    # Check to see if the customer is a guest and add to the debug array
+    if ( !tep_session_is_registered('customer_id') ) $this->is_guest = true;
+    $this->debug_output['is_guest'] = $this->is_guest; 
+    
+    if ( file_exists($this->cache_file) ) {
+      # File does exist and add to debug array
+      $this->cache_file_exists = true;
+      $this->debug_output['cache_file_exists'] = $this->cache_file_exists;
+      # check to see if expired and GC did not grab it
+      if (PAGE_CACHE_LIFETIME == '0'){
+       # Get debug array info
+        $this->cache_file_is_expired = false;
+        $this->debug_output['cache_file_date'] = date("m/d/Y",filemtime($this->cache_file)); 
+        $this->debug_output['valid_date'] = date("m/d/Y");
+      }else{
+      # Check to see whether the file is expired and add to the debug array
+      if ( (time() - $this->cache_lifetime) < filemtime($this->cache_file) ) $this->cache_file_is_expired = false;
+      $this->debug_output['cache_file_is_expired'] = $this->cache_file_is_expired;
+      }   
+    } # END if file_exists
+    # Define the customer_cart variable and compress the data then add the message to debug array
+    # The data used here is passed to the class contructor
+    $this->customer_cart = $this->compress_buffer( $cart_info );
+    $this->debug_output['customer_cart'] = ( is_string($this->customer_cart)  ? true : false );
+    # Set the customers_sid and store it
+    $this->customer_sid = $SID;     
+    $this->debug_output['customer_sid'] = $this->customer_sid;
+} # END of page_cache constructor
+  
+/*##################################################################################
+
+cache_this_page() method
+  - no arguments
+  - no return
+
+###################################################################################*/
+  function cache_this_page () {
+    global $debug;
+    # Check to see if the customer is logged in and whether the page cache is enabled   
+    if ($this->is_guest && ENABLE_PAGE_CACHE =='true') {
+      # Add to the debug array
+      //$this->debug_output['is_guest_check'] = 'customer_id not set - cache_this_page()';
+      $this->debug_output['is_guest_check'] = IS_GUEST_CHECK.' - cache_this_page()';
+      # Check to see if the file exists and it is not expired
+      if ( $this->cache_file_exists && !$this->cache_file_is_expired ) {
+        # Good...it does exist and is not expired
+        //$this->debug_output['file_exists_and_is_not_expired'] = 'file exists and is not expired';
+        $this->debug_output['file_exists_and_is_not_expired'] = FILE_EXISTS_AND_IS_NOT_EXPIRED;
+        # Now let's see if they have cookie support enabled
+        if ( !tep_not_null($this->customer_sid) ) {
+          # They have cookies enabled...let's remove the osCsid from the URL's since it is being pulled from cookie
+          echo str_replace(array("<%CART_CACHE%>", "?<osCsid>", "&<osCsid>"), array($this->customer_cart, $this->customer_sid, $this->customer_sid), file_get_contents($this->cache_file) );
+        } else {
+          # No cookies enabled so let's append the osCsid to every URL
+          echo str_replace(array("<%CART_CACHE%>", "<osCsid>"), array($this->customer_cart, $this->customer_sid), file_get_contents($this->cache_file) );       
+        }       
+        $this->debug();
+        include_once (DIR_WS_INCLUDES . 'application_bottom.php');
+        exit;
+      } # END file exists and is not expired
+      
+      # Does the file exist or is it expired?     
+      if ( !$this->cache_file_exists || $this->cache_file_is_expired ) {
+        # Either it does not exist or is expired.  Let's start the cache
+        # Add the info to the debug array
+        //$this->debug_output['no_file_or_expired'] = 'file does not exist or is expired'; 
+        $this->debug_output['no_file_or_expired'] = NO_FILE_OR_EXPIRED; 
+        # Set the flag to write the cache file
+        $this->write_cache_file = true;
+        # We'll need to output the buffer as well
+        $this->output_ob = true;
+        # Start the output buffer
+        ob_start();
+        # Add the info to the debug array
+        //$this->debug_output['ob_started'] = 'ob started @ '. time();
+        $this->debug_output['ob_started'] = OB_STARTED. time();
+      } # END is file does not exist or is expired      
+    } # END if $this->is_guest    
+  } # END cache_this_page method
+  
+/*##################################################################################
+
+end_page_cache() method
+  - no arguments
+  - no return
+
+###################################################################################*/
+  function end_page_cache() {
+    # Check to see if the customer is logged in and whether the page cache is enabled 
+    if ($this->is_guest && ENABLE_PAGE_CACHE =='true') {
+      # Passed the check...let's add the info to the debug array
+      //$this->debug_output['is_guess_check_end'] = 'customer_id not set - end_page_cache()';
+      $this->debug_output['is_guess_check_end'] = IS_GUESS_CHECK_END.' - end_page_cache()';
+      # If the output switch is true lets output the buffer
+      if ( $this->output_ob ) {
+        # Switch enabled...add the info to the debug array
+        $this->debug_output['output_ob'] = 'output_ob = true';
+        # Store the compressed buffer as a variable
+        $this->cache_compress = $this->compress_buffer( ob_get_clean() );
+        # Add the info to the debug array
+      //  $this->debug_output['ob_compressed'] = 'output buffer flushed and compressed';
+        $this->debug_output['ob_compressed'] = OB_COMPRESSED;
+        # Output the compressed buffer
+        $this->output_buffer($this->cache_compress);
+        # Add the info to the debug array
+        //$this->debug_output['output'] = 'compressed ob sent to screen';
+        $this->debug_output['output'] = CACHE_OUTPUTT;
+      } # END if $this->output_buffer
+      
+      # If the write to file swith is true let's write the file
+      if ( $this->write_cache_file ) {
+        # Passed check.  Write the file
+        $this->write_file ( $this->cache_compress );
+        # Let's add the info to the debug array
+        //$this->debug_output['write_file'] = 'compressed ob written to file'; 
+        $this->debug_output['write_file'] = CACHE_WRITE_FILE; 
+      } # END if write cache file
+      
+      # Unset the buffer
+      unset ($this->cache_compress);
+      # Add the info to the debug array
+      ///$this->debug_output['unset_cache_compress'] = 'cache compress unset';
+      $this->debug_output['unset_cache_compress'] = UNSET_CACHE_COMPRESS;
+    } #END if $this->is_guest   
+    $this->debug();
+    //include (DIR_WS_INCLUDES . 'counter.php');    
+    include (DIR_WS_INCLUDES . FILENAME_COUNTER);   
+  } #END end_page_cache method
+
+/*##################################################################################
+
+compress_buffer() method
+  - arguments: $buffer (string)
+  - return: compressed $buffer
+
+###################################################################################*/
+  function compress_buffer ($buffer) {
+    # Add the info to the debug array
+    //$this->debug_output['compress_buffer'] = 'compressing buffer';
+    $this->debug_output['compress_buffer'] = COMPRESS_BUFFER;
+    # Return the compressed buffer
+    return preg_replace('/\>\s+\</', '> <', $buffer);
+  } # END compress buffer
+  
+/*##################################################################################
+
+write_file() method
+  - arguments: $buffer (string)
+  - return: true;
+
+###################################################################################*/
+  function write_file($buffer) {
+    $fp = fopen($this->cache_file,'w+');
+    fwrite($fp, $buffer);
+    fclose($fp);
+    //$this->debug_output['file_write'] = 'buffer writtent to file';
+    $this->debug_output['file_write'] = CACHE_FILE_WRITE;
+    unset($buffer);
+    //$this->debug_output['unset_write_buffer'] = 'write buffer unset';
+    $this->debug_output['unset_write_buffer'] = CACHE_UNSET_WRITE_BUFFER;
+    return true;
+  } # END write_cache_file method
+
+/*##################################################################################
+
+outpur_buffer() method
+  - arguments: $buffer (string)
+  - return: buffer with customer cart
+  
+###################################################################################*/
+  function output_buffer($buffer) {
+    if ( !tep_not_null($this->customer_sid) ) {
+      echo str_replace(array("<%CART_CACHE%>", "?<osCsid>", "&<osCsid>"), array($this->customer_cart, $this->customer_sid, $this->customer_sid), $buffer );
+    } else {
+      echo str_replace(array("<%CART_CACHE%>", "<osCsid>"), array($this->customer_cart, $this->customer_sid), $buffer);       
+    }       
+    //$this->debug_output['output_2_screen'] = 'successfully output to screen';
+    $this->debug_output['output_2_screen'] = OUTPUT_2_SCREEN;
+    unset($buffer);
+    //$this->debug_output['unset_screen_buffer'] = 'screen buffer unset';     
+    $this->debug_output['unset_screen_buffer'] = CACHE_UNSET_SCREEN_BUFFER;     
+  } # END output_buffer() method
+  
+/*##################################################################################
+
+debug() method
+  - arguments: none
+  - return: debug array
+
+###################################################################################*/
+  function debug () {
+    if ($this->debug_messages == 'true') {
+      $data_store['PAGE_CACHE'] = $this->debug_output;
+      $data_store['COOKIE_INFO'] = $_COOKIE;
+      $data_store['SESSION_INFO'] = $_SESSION;
+      echo '<pre>';
+      #echo print_r($this->debug_output + $_COOKIE + $_SESSION);
+      echo print_r($data_store);
+      echo '</pre>';
+    }   
+  } # END debug() method
+  
+/*##################################################################################
+
+delete_cache_file() method
+  - arguments: none
+  - return: true;
+
+###################################################################################*/
+
+  function delete_cache_files () {
+    foreach (glob($this->cache_dir."{*.cache*}", GLOB_BRACE) as $filename) {
+       $this->debug_output['deleting_file'][]= $filename;
+       unlink($filename);
+    }
+    return true;
+  } # END delete_cache_files() method
+  
+/*##################################################################################
+
+collect_garbage_daily() & collect_garbage() method
+  - arguments: none
+  - return: true;
+
+###################################################################################*/
+          
+  function collect_garbage_daily() {
+    $dat_file= $this->cache_dir . 'gc.DAT';
+       
+      if  (file_exists($dat_file)) { 
+        if (date("m/d/Y") != date("m/d/Y",filemtime($dat_file))){
+            foreach (glob($this->cache_dir."{*.cache*}", GLOB_BRACE) as $filename) {
+          @unlink($filename);
+        } #eof foreach
+       }# eof if date = date
+     }# eof if  file_exists  
+    
+     
+      $fpdf = fopen($dat_file,'w');
+              fwrite($fpdf, date("m/d/Y"));
+              fclose($fpdf) ;
+   return true;
+  } # END collect_garbage_daily() method      
+    
+#--------------------------------------------------------------------------------#        
+  
+  function collect_garbage() {
+    foreach (glob($this->cache_dir."{*.cache*}", GLOB_BRACE) as $filename) {
+       if ( ( filemtime($filename) + $this->cache_lifetime) < time() )
+      @unlink($filename);
+     } #eof foreach
+    return true;
+  } # END collect_garbage() method
+  
+} #END of class
+?>

Added: trunk/direct.openmoko.com/includes/classes/payment.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,252 @@
+<?php
+/*
+  $Id: payment.php,v 1.1.1.1 2004/03/04 23:40:46 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class payment {
+    var $modules, $selected_module;
+
+// class constructor
+    function payment($module = '') {
+// BOF: WebMakers.com Added: Downloads Controller
+      global $payment, $language, $PHP_SELF, $cart;
+// EOF: WebMakers.com Added: Downloads Controller
+
+      if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED)) {
+      //Eversun mod for sppc and qty price breaks
+//       $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
+     global $sppc_customer_group_id, $customer_id;
+     if(!tep_session_is_registered('sppc_customer_group_id')) {
+      $customer_group_id = '0';
+     } else {
+      $customer_group_id = $sppc_customer_group_id;
+     }
+     $customer_payment_query = tep_db_query("select IF(c.customers_payment_allowed <> '', c.customers_payment_allowed, cg.group_payment_allowed) as payment_allowed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_GROUPS . " cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id =  '" . $customer_group_id . "'");
+     if ($customer_payment = tep_db_fetch_array($customer_payment_query)  ) {
+       if (tep_not_null($customer_payment['payment_allowed'])) {
+        $temp_payment_array = explode(';', $customer_payment['payment_allowed']);
+        $installed_modules = explode(';', MODULE_PAYMENT_INSTALLED);
+        for ($n = 0; $n < sizeof($installed_modules) ; $n++) {
+          // check to see if a payment method is not de-installed
+          if ( in_array($installed_modules[$n], $temp_payment_array ) ) {
+            $payment_array[] = $installed_modules[$n];
+          }
+        } // end for loop
+        if (is_array($payment_array)) {
+                                $this->modules = $payment_array;
+                          } else {
+                                $this->modules = array();
+                          }
+        } else {
+        $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
+        }
+      } else { // default
+        $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
+      }
+// Eversun mod end for sppc and qty price breaks
+        
+
+        $include_modules = array();
+
+        if ( (tep_not_null($module)) && (in_array($module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {
+          $this->selected_module = $module;
+
+          $include_modules[] = array('class' => $module, 'file' => $module . '.php');
+        } else {
+          reset($this->modules);
+// BOF: WebMakers.com Added: Downloads Controller - Free Shipping and Payments
+// Show either normal payment modules or free payment module when Free Shipping Module is On
+          // Free Payment Only
+
+          if (tep_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER_STATUS') and ($cart->show_total()==0 and $cart->show_weight==0)) {
+            $this->selected_module = $module;
+            $include_modules[] = array('class'=> 'freecharger', 'file' => 'freecharger.php');
+          } else {
+            // All Other Payment Modules
+            while (list(, $value) = each($this->modules)) {
+              $class = substr($value, 0, strrpos($value, '.'));
+              // Don't show Free Payment Module
+              if ($class !='freecharger') {
+                $include_modules[] = array('class' => $class, 'file' => $value);
+              }
+            }
+// EOF: WebMakers.com Added: Downloads Controller
+          }
+        }
+
+        for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {
+          include(DIR_WS_LANGUAGES . $language . '/modules/payment/' . $include_modules[$i]['file']);
+          include(DIR_WS_MODULES . 'payment/' . $include_modules[$i]['file']);
+
+          $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];
+        }
+
+// if there is only one payment method, select it as default because in
+// checkout_confirmation.php the $payment variable is being assigned the
+// $HTTP_POST_VARS['payment'] value which will be empty (no radio button selection possible)
+        if ( (tep_count_payment_modules() == 1) && (!isset($GLOBALS[$payment]) || (isset($GLOBALS[$payment]) && !is_object($GLOBALS[$payment]))) ) {
+          $payment = $include_modules[0]['class'];
+        }
+
+        if ( (tep_not_null($module)) && (in_array($module, $this->modules)) && (isset($GLOBALS[$module]->form_action_url)) ) {
+          $this->form_action_url = $GLOBALS[$module]->form_action_url;
+        }
+      }
+    }
+
+// class methods
+/* The following method is needed in the checkout_confirmation.php page
+   due to a chicken and egg problem with the payment class and order class.
+   The payment modules needs the order destination data for the dynamic status
+   feature, and the order class needs the payment module title.
+   The following method is a work-around to implementing the method in all
+   payment modules available which would break the modules in the contributions
+   section. This should be looked into again post 2.2.
+*/
+    function update_status() {
+      if (is_array($this->modules)) {
+        if (is_object($GLOBALS[$this->selected_module])) {
+          if (function_exists('method_exists')) {
+            if (method_exists($GLOBALS[$this->selected_module], 'update_status')) {
+              $GLOBALS[$this->selected_module]->update_status();
+            }
+          } else { // PHP3 compatibility
+            @call_user_method('update_status', $GLOBALS[$this->selected_module]);
+          }
+        }
+      }
+    }
+
+    function javascript_validation() {
+      $js = '';
+      if (is_array($this->modules)) {
+        $js = '<script type="text/javascript"><!-- ' . "\n" .
+              'function check_form() {' . "\n" .
+              '  var error = 0;' . "\n" .
+              '  var error_message = "' . JS_ERROR . '";' . "\n" .
+              '  var payment_value = null;' . "\n" .
+              '  if (document.checkout_payment.payment.length) {' . "\n" .
+              '    for (var i=0; i<document.checkout_payment.payment.length; i++) {' . "\n" .
+              '      if (document.checkout_payment.payment[i].checked) {' . "\n" .
+              '        payment_value = document.checkout_payment.payment[i].value;' . "\n" .
+              '      }' . "\n" .
+              '    }' . "\n" .
+              '  } else if (document.checkout_payment.payment.checked) {' . "\n" .
+              '    payment_value = document.checkout_payment.payment.value;' . "\n" .
+              '  } else if (document.checkout_payment.payment.value) {' . "\n" .
+              '    payment_value = document.checkout_payment.payment.value;' . "\n" .
+              '  }' . "\n\n";
+
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ($GLOBALS[$class]->enabled) {
+            $js .= $GLOBALS[$class]->javascript_validation();
+          }
+        }
+
+        $js .= "\n" . '  if (payment_value == null && submitter != 1) {' . "\n" . // ICW CREDIT CLASS Gift Voucher System
+               '    error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n" .
+               '    error = 1;' . "\n" .
+               '  }' . "\n\n" .
+//  ICW CREDIT CLASS Gift Voucher System Line below amended
+               '  if (error == 1 && submitter != 1) {' . "\n" .
+               '    alert(error_message);' . "\n" .
+               '    return false;' . "\n" .
+               '  } else {' . "\n" .
+               '    return true;' . "\n" .
+               '  }' . "\n" .
+               '}' . "\n" .
+               '//--></script>' . "\n";
+      }
+
+      return $js;
+    }
+
+    function selection() {
+      $selection_array = array();
+
+      if (is_array($this->modules)) {
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ($GLOBALS[$class]->enabled) {
+            $selection = $GLOBALS[$class]->selection();
+            if (is_array($selection)) $selection_array[] = $selection;
+          }
+        }
+      }
+
+      return $selection_array;
+    }
+ //ICW CREDIT CLASS Gift Voucher System
+ // check credit covers was setup to test whether credit covers is set in other parts of the code
+function check_credit_covers() {
+  global $credit_covers;
+
+  return $credit_covers;
+}
+    function pre_confirmation_check() {
+      global $credit_covers, $payment_modules; //ICW CREDIT CLASS Gift Voucher System
+      if (is_array($this->modules)) {
+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
+
+          if ($credit_covers) { //  ICW CREDIT CLASS Gift Voucher System
+            $GLOBALS[$this->selected_module]->enabled = false; //ICW CREDIT CLASS Gift Voucher System
+            $GLOBALS[$this->selected_module] = NULL; //ICW CREDIT CLASS Gift Voucher System
+            $payment_modules = ''; //ICW CREDIT CLASS Gift Voucher System
+          } else { //ICW CREDIT CLASS Gift Voucher System
+            $GLOBALS[$this->selected_module]->pre_confirmation_check();
+          }
+        }
+      }
+    } //ICW CREDIT CLASS Gift Voucher System
+
+    function confirmation() {
+      if (is_array($this->modules)) {
+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
+          return $GLOBALS[$this->selected_module]->confirmation();
+        }
+      }
+    }
+
+    function process_button() {
+      if (is_array($this->modules)) {
+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
+          return $GLOBALS[$this->selected_module]->process_button();
+        }
+      }
+    }
+
+    function before_process() {
+      if (is_array($this->modules)) {
+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
+          return $GLOBALS[$this->selected_module]->before_process();
+        }
+      }
+    }
+
+    function after_process() {
+      if (is_array($this->modules)) {
+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
+          return $GLOBALS[$this->selected_module]->after_process();
+        }
+      }
+    }
+
+    function get_error() {
+      if (is_array($this->modules)) {
+        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
+          return $GLOBALS[$this->selected_module]->get_error();
+        }
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/rci.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/rci.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/rci.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,85 @@
+<?php
+/*
+  $Id: cre_RCI.php,v 1.0.0.0 2006/11/21 13:41:11 ccwjr Exp $
+
+  CRE Loaded, Open Source E-Commerce Solutions
+  http://www.creloaded.com
+
+  Copyright (c) 2006 CRE Loaded
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class cre_RCI {
+    var $_folders = array();
+
+    function cre_RCI() {
+      if ( ! isset($_SESSION['cre_RCI_data']) ) {
+        $_SESSION['cre_RCI_data'] = array('folders' => array() );
+      }
+      $this->_folders =& $_SESSION['cre_RCI_data']['folders'];
+    }
+
+    function get($pageName, $function, $display = true) {
+      $pageName = strtolower($pageName);
+      $function = strtolower($function);
+      $rci_holder = '';
+      
+      // if cache is allowed, see if the page name is known
+      if (USE_CACHE == 'false' || USE_CACHE == 'False' || ! array_key_exists($pageName, $this->_folders) ) {
+        $this->_build_folder($pageName);
+      }
+
+      if ( array_key_exists($function, $this->_folders[$pageName]) ) {
+        foreach( $this->_folders[$pageName][$function] as $fileName ) {
+          // safety check in case a fasle positive was received on the cache check
+          if ( ! file_exists(DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName) ) {
+            $this->_folders = array();  // invalid the cache since it is corrupt
+            continue;
+          }
+          $rci = '';
+          if ($pageName == 'stylesheet') {  // special case of a style sheet
+            $rci = '<link rel="stylesheet" type="text/css" href="' . DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName . '" />';
+          } else {
+            include(DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName);
+          }
+          if ((DISPLAY_PAGE_PARSE_TIME == 'true') && ($display == true)) {
+            $rci_holder .= '<!-- RCI [BOM] -' . $pageName . '-' . $function . ' : ' . DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName . ' --->' . $rci . '<!-- RCI [EOM] -' . $pageName . '-' . $function . ' : ' . DIR_WS_INCLUDES . 'runtime/' . $pageName . '/' . $fileName . ' --->';
+          } else {
+            $rci_holder .= $rci;
+          }
+        }
+      }
+      return $rci_holder;
+    }
+
+    function _build_folder($pageName) {
+      $this->_folders[$pageName] = array();    
+      if ( is_dir(DIR_WS_INCLUDES . 'runtime/' . $pageName) ) {
+        $filesFound = array();
+        if ($pageName == 'stylesheet') {
+          $pattern = '/(\w*)_*(\w+)_(\w+)_(\w+)\.css$/';
+        }else{
+          $pattern = '/(\w*)_*(\w+)_(\w+)_(\w+)\.php$/';
+        }
+        $dir = opendir(DIR_WS_INCLUDES . 'runtime/' . $pageName);
+        while( $file = readdir( $dir ) ) {
+          if ($file == '.'  || $file == '..') continue;
+          $match = array();
+          if ( preg_match($pattern, $file, $match) > 0 ) {
+            if ( $match[3] == $pageName ) {
+              $filesFound[$match[0]] = $match[4];
+            }
+          }
+        }
+        if ( count($filesFound) > 0) {
+          ksort($filesFound);
+          foreach( $filesFound as $file => $function ) {
+            $this->_folders[$pageName][$function][] = $file;
+          }
+        }
+      }
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/classes/sessions.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/sessions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/sessions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,521 @@
+<?php
+/*
+  $Id: sessions.php,v 1.1.1.1 2004/03/04 23:40:46 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  Original source from Web Application Development with PHP (Tobias Ratschiller, Till Gerken)
+  Copyright (c) 2000, New Riders Publishing
+*/
+
+  $SID = '';
+
+  class php3session {
+    var $name = PHP_SESSION_NAME;
+    var $auto_start = false;
+    var $referer_check = false;
+
+    var $save_path = PHP_SESSION_SAVE_PATH;
+    var $save_handler = 'php3session_files';
+
+    var $lifetime = 0;
+
+    var $cache_limiter = 'nocache';
+    var $cache_expire = 180;
+
+    var $use_cookies = true;
+    var $cookie_lifetime = 0;
+    var $cookie_path = PHP_SESSION_PATH;
+    var $cookie_domain = PHP_SESSION_DOMAIN;
+
+    var $gc_probability = 1;
+    var $gc_maxlifetime = 0;
+
+    var $serialize_handler = 'php';
+    var $ID;
+
+    var $nr_open_sessions = 0;
+    var $mod_name = '';
+    var $id;
+    var $delimiter = "\n";
+    var $delimiter_value = '[==]';
+
+    var $vars;
+
+    function php3session() {
+      $this->mod_name = $this->save_handler;
+      $this->vars = array();
+    }
+  }
+
+  class php3session_user {
+    var $open_func, $close_func, $read_func, $write_func, $destroy_func, $gc_func;
+
+    function open($save_path, $sess_name) {
+      $func = $this->open_func;
+      if (function_exists($func)) {
+        return $func($save_path, $sess_name);
+      }
+
+      return true;
+    }
+
+    function close($save_path, $sess_name) {
+      $func = $this->close_func;
+      if (function_exists($func)) {
+        return $func();
+      }
+
+      return true;
+    }
+
+    function read($sess_id) {
+      $func = $this->read_func;
+
+      return $func($sess_id);
+    }
+
+    function write($sess_id, $val) {
+      $func = $this->write_func;
+
+      return $func($sess_id, $val);
+    }
+
+    function destroy($sess_id) {
+      $func = $this->destroy_func;
+      if (function_exists($func)) {
+        return $func($sess_id);
+      }
+
+      return true;
+    }
+
+    function gc($max_lifetime) {
+      $func = $this->gc_func;
+      if (function_exists($func)) {
+        return $func($max_lifetime);
+      }
+
+      return true;
+    }
+  }
+
+  class php3session_files {
+    function open($save_path, $sess_name) {
+      return true;
+    }
+
+    function close() {
+      return true;
+    }
+
+    function read($sess_id) {
+      global $session;
+
+// Open, read in, close file with session data
+      $file = $session->save_path . '/sess_' . $sess_id;
+      if (!file_exists($file)) {
+// Create it
+        touch($file);
+      }
+     // $fp = fopen($file, 'r') or die('Could not open session file (' . $file . ').');
+      $fp = fopen($file, 'r') or die(OPEN_SESSION_FILE_ERROR.' (' . $file . ').');
+      $val = fread($fp, filesize($file));
+      fclose($fp);
+
+      return $val;
+    }
+
+    function write($sess_id, $val) {
+      global $session;
+
+// Open, write to, close file with session data
+      $file = $session->save_path . '/sess_' . $sess_id;
+     // $fp = fopen($file, 'w') or die('Could not write session file (' . $file . ')');
+      $fp = fopen($file, 'w') or die(WRITE_SESSION_FILE_ERROR.' (' . $file . ')');
+      $val = fputs($fp, $val);
+      fclose($fp);
+
+      return true;
+    }
+
+    function destroy($sess_id) {
+      global $session;
+
+      $file = $session->save_path . '/sess_' . $sess_id;
+      unlink($file);
+
+      return true;
+    }
+
+    function gc($max_lifetime) {
+// We return true, since all cleanup should be handled by
+// an external entity (i.e. find -ctime x | xargs rm)
+      return true;
+    }
+  }
+
+  function _session_create_id() {
+    return md5(uniqid(microtime()));
+  }
+
+  function _session_cache_limiter() {
+    global $session;
+
+    switch ($session->cache_limiter) {
+      case 'nocache':
+                      header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
+                      header('Cache-Control: no-cache');
+                      header('Pragma: no-cache');
+                      break;
+      case 'private':
+                      header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
+                      header(sprintf('Cache-Control: private, max-age=%s', $session->cache_expire * 60));
+                      header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime(basename($GLOBALS['PHP_SELF']))) . ' GMT');
+                      break;
+      case 'public':
+                      $now = time();
+                      $now += $session->cache_expire * 60;
+                      $now = gmdate('D, d M Y H:i:s', $now) . ' GMT';
+                      header('Expires: ' . $now);
+                      header(sprintf('Cache-Control: public, max-age=%s', $session->cache_expire * 60));
+                      header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime(basename($GLOBALS['PHP_SELF']))) . ' GMT');
+                      break;
+      default:
+                      die('Caching method ' . $session->cache_limiter . ' not implemented.');
+    }
+  }
+
+  function _php_encode() {
+    global $session;
+
+    $ret = '';
+// Create a string containing the serialized variables
+    for (reset($session->vars); list($i)=each($session->vars);) {
+      $ret .= $session->vars[$i] . $session->delimiter_value . serialize($GLOBALS[$session->vars[$i]]) . $session->delimiter;
+    }
+
+    return $ret;
+  }
+
+  function _php_decode($data) {
+    global $session;
+
+    $data = trim($data);
+    $vars = explode($session->delimiter, $data);
+
+// Add the variables to the global namespace
+    for (reset($vars); list($i)=each($vars);) {
+      $tmp = explode($session->delimiter_value, $vars[$i]);
+      $name = trim($tmp[0]);
+      $value = trim($tmp[1]);
+      $GLOBALS[$name] = unserialize($value);
+      $session->vars[] = trim($name);
+    }
+  }
+
+  function _wddx_encode($data) {
+    global $session;
+
+    $ret = wddx_serialize_vars($session->vars);
+
+    return $ret;
+  }
+
+  function _wddx_decode($data) {
+    return wddx_deserialize($data);
+  }
+
+  function session_name($name = '') {
+    global $session;
+
+    if (empty($name)) {
+      return $session->name;
+    }
+
+    $session->name = $name;
+  }
+
+  function session_set_save_handler($open, $close, $read, $write, $destroy, $gc) {
+    global $session, $php3session_user;
+
+    $php3session_user = new php3session_user;
+    $php3session_user->open_func = $open;
+    $php3session_user->close_func = $close;
+    $php3session_user->read_func = $read;
+    $php3session_user->write_func = $write;
+    $php3session_user->destroy_func = $destroy;
+    $php3session_user->gc_func = $gc;
+    $session->mod_name = 'php3session_user';
+  }
+
+  function session_module_name($name = '') {
+    global $session;
+
+    if (empty($name)) {
+      return $session->mod_name;
+    }
+
+    $session->mod_name = $name;
+  }
+
+  function session_save_path($path = '') {
+    global $session;
+
+    if(empty($path)) {
+      return $session->save_path;
+    }
+
+    $session->save_path = $path;
+  }
+
+  function session_id($id = '') {
+    global $session;
+
+    if(empty($id)) {
+      return $session->id;
+    }
+
+    $session->id = $id;
+  }
+
+  function session_register($var) {
+    global $session;
+
+    if ($session->nr_open_sessions == 0) {
+      session_start();
+    }
+
+    $session->vars[] = trim($var);
+  }
+
+  function session_unregister($var) {
+    global $session;
+
+    for (reset($session->vars); list($i)=each($session->vars);) {
+      if ($session->vars[$i] == trim($var)) {
+        unset($session->vars[$i]);
+        break;
+      }
+    }
+  }
+
+  function session_is_registered($var) {
+    global $session;
+
+    for (reset($session->vars); list($i)=each($session->vars);) {
+      if ($session->vars[$i] == trim($var)) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  function session_encode() {
+    global $session;
+
+    $serializer = '_' . $session->serialize_handler . '_encode';
+    $ret = $serializer();
+
+    return $ret;
+  }
+
+  function session_decode($data) {
+    global $session;
+
+    $serializer = '_' . $session->serialize_handler . '_decode';
+    $ret = $serializer($data);
+
+    return $ret;
+  }
+
+  function session_start() {
+    global $session, $SID, $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS;
+
+// Define the global variable $SID?
+    $define_sid = true;
+
+// Send the session cookie?
+    $send_cookie = true;
+
+// Is track_vars enabled?
+    $track_vars = ( (isset($HTTP_COOKIE_VARS)) || (isset($HTTP_GET_VARS)) || (isset($HTTP_POST_VARS)) ) ? true : false;
+
+// Check if session_start() has been called once already
+    if ($session->nr_open_sessions != 0) {
+      return false;
+    }
+
+// If our only resource is the global symbol_table, then check it.
+// If track_vars are enabled, we prefer these, because they are more
+// reliable, and we always know whether the user has accepted the
+// cookie.
+    if ( (isset($GLOBALS[$session->name])) && (!empty($GLOBALS[$session->name])) && (!$track_vars) ) {
+      $session->id = $GLOBALS[$session->name];
+      $send_cookie = false;
+    }
+
+// Now check the track_vars. Cookies are preferred, because initially
+// cookie and get variables will be available.
+    if ( (empty($session->id)) && ($track_vars) ) {
+      if (isset($HTTP_COOKIE_VARS[$session->name])) {
+        $session->id = $HTTP_COOKIE_VARS[$session->name];
+        $define_sid = false;
+        $send_cookie = false;
+      }
+
+      if (isset($HTTP_GET_VARS[$session->name])) {
+        $session->id = $HTTP_GET_VARS[$session->name];
+      }
+
+      if (isset($HTTP_POST_VARS[$session->name])) {
+        $session->id = $HTTP_POST_VARS[$session->name];
+      }
+    }
+
+/*
+// Check the REQUEST_URI symbol for a string of the form
+// '<session-name>=<session-id>' to allow URLs of the form
+// http://yoursite/<session-name>=<session-id>/script.php
+    if (empty($session->id)) {
+      eregi($session->name . '=([^/]+)', $GLOBALS['REQUEST_URI'], $regs);
+      $regs[1] = trim($regs[1]);
+      if (!empty($regs[1])) {
+        $session->id = $regs[1];
+      }
+    }
+*/
+
+// Check whether the current request was referred to by
+// an external site which invalidates the previously found ID
+    if ( (!empty($session->id)) && ($session->referer_check) ) {
+      $url = parse_url($GLOBALS['HTTP_REFERER']);
+      if (trim($url['host']) != $GLOBALS['SERVER_NAME']) {
+        unset($session->id);
+        $send_cookie = true;
+        $define_sid = true;
+      }
+    }
+
+// Do we have an existing session ID?
+    if (empty($session->id)) {
+// Create new session ID
+      $session->id = _session_create_id();
+    }
+
+// Is use_cookies set to false?
+    if ( (!$session->use_cookies) && ($send_cookie) ) {
+      $define_sid = true;
+      $send_cookie = false;
+    }
+
+// Should we send a cookie?
+    if ($send_cookie) {
+      setcookie($session->name, $session->id, $session->cookie_lifetime, $session->cookie_path, $session->cookie_domain);
+    }
+
+// Should we define the SID?
+    if($define_sid) {
+      $SID = $session->name . '=' . $session->id;
+    }
+
+    $session->nr_open_sessions++;
+
+// Send caching headers
+
+// Start session
+    $mod = $GLOBALS[$session->mod_name];
+    if (!$mod->open($session->save_path, $session->name)) {
+      //die('Failed to initialize session module.');
+      die(SESSION_MODULE_ERROR);
+    }
+
+// Read session data
+    if ($val = $mod->read($session->id)) {
+// Decode session data
+      session_decode($val);
+    }
+
+// Send HTTP cache headers
+    _session_cache_limiter();
+
+// Check if we should clean up (call the garbage collection routines)
+    if ($session->gc_probability > 0) {
+      $randmax = getrandmax();
+      $nrand = (int)(100 * tep_rand() / $randmax);
+      if ($nrand < $session->gc_probability) {
+        $mod->gc($session->gc_maxlifetime);
+      }
+    }
+
+    if ($define_sid) {
+      define('SID', $SID);
+    } else {
+      define('SID', '');
+    }
+
+    return true;
+  }
+
+  function session_destroy() {
+    global $session;
+
+    if ($session->nr_open_sessions == 0) {
+      return false;
+    }
+
+// Destroy session
+    $mod = $GLOBALS[$session->mod_name];
+    if (!$mod->destroy($session->id)) {
+      return false;
+    }
+    unset($session);
+    $session = new php3session;
+
+    return true;
+  }
+
+  function session_close() {
+    global $session, $SID;
+
+    if ($session->nr_open_sessions == 0) {
+      return false;
+    }
+// Encode session
+    $val = session_encode();
+    $len = strlen($val);
+
+// Save session
+    $mod = $GLOBALS[$session->mod_name];
+    if (!$mod->write($session->id, $val)) {
+     // die('Session could not be saved.');
+      die(SESSION_NOT_SAVED);
+    }
+// Close session
+    if ( (function_exists($session->mod_name . '->close')) && (!$mod->close()) ) {
+     // die('Session could not be closed.');
+      die(SESSION_NOT_CLOSED);
+    }
+    $SID = '';
+    $session->nr_open_sessions--;
+
+    return true;
+  }
+
+  $session = new php3session;
+  $mod = $session->save_handler;
+  $$mod = new $mod;
+
+  if ($session->auto_start) {
+   // $ret = session_start() or die('Session could not be started.');
+    $ret = session_start() or die(SESSION_NOT_STARTED);
+  }
+
+  register_shutdown_function('session_close');
+?>

Added: trunk/direct.openmoko.com/includes/classes/shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,163 @@
+<?php
+/*
+  $Id: shipping.php,v 1.1.1.1 2004/03/04 23:40:46 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class shipping {
+    var $modules;
+
+// class constructor
+    function shipping($module = '') {
+// BOF: WebMakers.com Added: Downloads Controller
+      global $language, $PHP_SELF, $cart;
+// EOF: WebMakers.com Added: Downloads Controller
+
+      if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) {
+       
+// Eversun mod for sppc and qty price breaks
+//   $this->modules = explode(';', MODULE_SHIPPING_INSTALLED);
+     global $sppc_customer_group_id, $customer_id;
+     if(!tep_session_is_registered('sppc_customer_group_id')) {
+     $customer_group_id = '0';
+     } else {
+      $customer_group_id = $sppc_customer_group_id;
+     }
+   $customer_shipment_query = tep_db_query("select IF(c.customers_shipment_allowed <> '', c.customers_shipment_allowed, cg.group_shipment_allowed) as shipment_allowed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_GROUPS . " cg where c.customers_id = '" . $customer_id . "' and cg.customers_group_id =  '" . $customer_group_id . "'");
+   if ($customer_shipment = tep_db_fetch_array($customer_shipment_query)  ) {
+     if (tep_not_null($customer_shipment['shipment_allowed']) ) {
+    $temp_shipment_array = explode(';', $customer_shipment['shipment_allowed']);
+    $installed_modules = explode(';', MODULE_SHIPPING_INSTALLED);
+    for ($n = 0; $n < sizeof($installed_modules) ; $n++) {
+      // check to see if a shipping module is not de-installed
+      if ( in_array($installed_modules[$n], $temp_shipment_array ) ) {
+        $shipment_array[] = $installed_modules[$n];
+      }
+    } // end for loop
+    $this->modules = $shipment_array;
+   } else {
+     $this->modules = explode(';', MODULE_SHIPPING_INSTALLED);
+   }
+   } else { // default
+     $this->modules = explode(';', MODULE_SHIPPING_INSTALLED);
+   }
+// Eversun mod end for sppc and qty price breaks
+        $include_modules = array();
+
+        if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {
+          $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));
+        } else {
+          reset($this->modules);
+// BOF: WebMakers.com Added: Downloads Controller - Free Shipping and Payments
+// Show either normal shipping modules or free shipping module when Free Shipping Module is On
+          // Free Shipping Only
+          if ( (tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS')=='1' and $cart->show_weight()==0) ) {
+            $include_modules[] = array('class'=> 'freeshipper', 'file' => 'freeshipper.php');
+          } else {
+          // All Other Shipping Modules
+            while (list(, $value) = each($this->modules)) {
+              $class = substr($value, 0, strrpos($value, '.'));
+              // Don't show Free Shipping Module
+              if ($class !='freeshipper') {
+                $include_modules[] = array('class' => $class, 'file' => $value);
+              }
+            }
+          }
+// EOF: WebMakers.com Added: Downloads Controller - Free Shipping and Payments
+        }
+
+        for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {
+          include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']);
+          include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']);
+
+          $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];
+        }
+      }
+    }
+
+    function quote($method = '', $module = '') {
+      global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
+
+      $quotes_array = array();
+
+      if (is_array($this->modules)) {
+        $shipping_quoted = '';
+        $shipping_num_boxes = 1;
+        $shipping_weight = $total_weight;
+
+        if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) {
+          $shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT;
+        } else {
+          $shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100);
+        }
+
+        if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes
+          $shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT);
+          $shipping_weight = $shipping_weight/$shipping_num_boxes;
+        }
+
+        $include_quotes = array();
+
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if (tep_not_null($module)) {
+            if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) {
+              $include_quotes[] = $class;
+            }
+          } elseif ($GLOBALS[$class]->enabled) {
+            $include_quotes[] = $class;
+          }
+        }
+
+        $size = sizeof($include_quotes);
+        for ($i=0; $i<$size; $i++) {
+          $quotes = $GLOBALS[$include_quotes[$i]]->quote($method);
+          if (is_array($quotes)) $quotes_array[] = $quotes;
+        }
+      }
+
+      return $quotes_array;
+    }
+
+    function cheapest() {
+      if (is_array($this->modules)) {
+        $rates = array();
+
+        reset($this->modules);
+        while (list(, $value) = each($this->modules)) {
+          $class = substr($value, 0, strrpos($value, '.'));
+          if ($GLOBALS[$class]->enabled) {
+            $quotes = $GLOBALS[$class]->quotes;
+            for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
+              if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) {
+                $rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
+                                 'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',
+                                 'cost' => $quotes['methods'][$i]['cost']);
+              }
+            }
+          }
+        }
+
+        $cheapest = false;
+        for ($i=0, $n=sizeof($rates); $i<$n; $i++) {
+          if (is_array($cheapest)) {
+            if ($rates[$i]['cost'] < $cheapest['cost']) {
+              $cheapest = $rates[$i];
+            }
+          } else {
+            $cheapest = $rates[$i];
+          }
+        }
+
+        return $cheapest;
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,575 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.1.1.1 2004/03/04 23:40:47 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class shoppingCart {
+    var $contents, $total, $weight, $cartID, $content_type;
+
+    function shoppingCart() {
+      $this->reset();
+    }
+
+    function restore_contents() {
+//ICW replace line
+      global $customer_id, $gv_id, $REMOTE_ADDR;
+//      global $customer_id;
+
+      if (!tep_session_is_registered('customer_id')) return false;
+
+// insert current cart contents in database
+      if (is_array($this->contents)) {
+        reset($this->contents);
+        while (list($products_id, ) = each($this->contents)) {
+          $qty = $this->contents[$products_id]['qty'];
+          $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+          if (!tep_db_num_rows($product_query)) {
+            tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");
+            if (isset($this->contents[$products_id]['attributes'])) {
+              reset($this->contents[$products_id]['attributes']);
+              while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
+                // BOM - Options Catagories
+                if ( is_array($value) ) {
+                  $new_value = 0;
+                  $attr_value = serialize($value);
+                } else {
+                  $new_value = $value;
+                  $attr_value = NULL;
+                }
+                tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$new_value . "', '" . tep_db_input($attr_value) . "')");
+                // EOM - Options Catagories
+              }
+            }
+          } else {
+            tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $qty . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+          }
+        }
+//ICW ADDDED FOR CREDIT CLASS GV - START
+        if (tep_session_is_registered('gv_id')) {
+          $gv_query = tep_db_query("insert into  " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . (int)$gv_id . "', '" . (int)$customer_id . "', now(),'" . $REMOTE_ADDR . "')");
+          $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . (int)$gv_id . "'");
+          tep_gv_account_update($customer_id, $gv_id);
+          tep_session_unregister('gv_id');
+        }
+//ICW ADDDED FOR CREDIT CLASS GV - END
+      }
+
+// reset per-session cart contents, but not the database contents
+      $this->reset(false);
+
+      $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
+      while ($products = tep_db_fetch_array($products_query)) {
+        $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']);
+// attributes
+        // BOM - Options Catagories
+        $attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
+        while ($attributes = tep_db_fetch_array($attributes_query)) {
+          if ( ($attributes['products_options_value_id'] == 0)  &&  ! is_null($attributes['products_options_value_text']) ) {
+            $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = unserialize($attributes['products_options_value_text']);
+          } else {
+            $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
+          }
+        }
+        // EOM - Options Catagories
+      }
+
+      $this->cleanup();
+    }
+
+    function reset($reset_database = false) {
+      global $customer_id;
+
+      $this->contents = array();
+      $this->total = 0;
+      $this->weight = 0;
+      $this->content_type = false;
+
+      if (tep_session_is_registered('customer_id') && ($reset_database == true)) {
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'");
+      }
+
+      unset($this->cartID);
+      if (tep_session_is_registered('cartID')) tep_session_unregister('cartID');
+    }
+
+    function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
+      global $new_products_id_in_cart, $customer_id;
+      $products_id = tep_get_uprid($products_id, $attributes);
+      if ($notify == true) {
+        $new_products_id_in_cart = $products_id;
+        tep_session_register('new_products_id_in_cart');
+      }
+
+      if ($this->in_cart($products_id)) {
+        $this->update_quantity($products_id, $qty, $attributes);
+      } else {
+        $this->contents[] = array($products_id);
+        $this->contents[$products_id] = array('qty' => $qty);
+
+        if (tep_session_is_registered('customer_id')){
+          tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");
+        }
+        
+        if (is_array($attributes)) {
+          reset($attributes);
+          while (list($option, $value) = each($attributes)) {
+            if ( !is_array($value) ) {
+              $this->contents[$products_id]['attributes'][$option] = $value;
+              $attr_value = NULL;
+              if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')");
+            } else {
+              $this->contents[$products_id]['attributes'][$option] = $value;
+              $attr_value = serialize($value); 
+              if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '0', '" . tep_db_input($attr_value) . "')");
+            }
+          }    
+        }
+      }
+      
+      $this->cleanup();
+      
+// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
+      $this->cartID = $this->generate_cart_id();
+    }
+
+    function update_quantity($products_id, $quantity = '', $attributes = '') {
+      global $customer_id;
+      if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true..
+
+      $this->contents[$products_id]['qty'] = $quantity;
+// update database
+      if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+
+      if (is_array($attributes)) {
+        reset($attributes);
+        while (list($option, $value) = each($attributes)) {
+          // BOM - Options Catagories
+          $attr_value = NULL;
+          $this->contents[$products_id]['attributes'][$option] = $value;
+          if ( !is_array($value) ) {
+            $attr_value = $value;
+            if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
+          } elseif ( isset($attributes[$option]['t']) ) {
+            $attr_value = htmlspecialchars(stripslashes($attributes[$option]['t']), ENT_QUOTES);
+            if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
+          } elseif ( isset($attributes[$option]['c']) ) {
+            foreach ($value as $v) {
+              $attr_value = $v;
+              if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
+            }
+          }
+          // EOM - Options Catagories
+        }
+      }
+    }
+
+    function cleanup() {
+      global $customer_id;
+
+      reset($this->contents);
+      while (list($key,) = each($this->contents)) {
+        if ($this->contents[$key]['qty'] < 1) {
+          unset($this->contents[$key]);
+// remove from database
+          if (tep_session_is_registered('customer_id')) {
+            tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
+            tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'");
+          }
+        }
+      }
+    }
+
+    function count_contents() {  // get total number of items in cart
+      $total_items = 0;
+      if (is_array($this->contents)) {
+        reset($this->contents);
+        while (list($products_id, ) = each($this->contents)) {
+          $total_items += $this->get_quantity($products_id);
+        }
+      }
+
+      return $total_items;
+    }
+
+    function get_quantity($products_id) {
+      if (isset($this->contents[$products_id])) {
+        return $this->contents[$products_id]['qty'];
+      } else {
+        return 0;
+      }
+    }
+
+    function in_cart($products_id) {
+      if (isset($this->contents[$products_id])) {
+        return true;
+      } else {
+        return false;
+      }
+    }
+
+    function remove($products_id) {
+      global $customer_id;
+      // BOM - Options Catagories
+//      $products_id = tep_get_uprid($products_id, $attributes);
+      $products_id = tep_get_uprid($products_id, '');
+      // EOM - Options Catagories
+      unset($this->contents[$products_id]);
+// remove from database
+      if (tep_session_is_registered('customer_id')) {
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+        tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
+      }
+
+// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
+      $this->cartID = $this->generate_cart_id();
+      
+    }
+
+    function remove_all() {
+      $this->reset();
+    }
+
+    function get_product_id_list() {
+      $product_id_list = '';
+      if (is_array($this->contents)) {
+        reset($this->contents);
+        while (list($products_id, ) = each($this->contents)) {
+          $product_id_list .= ', ' . $products_id;
+        }
+      }
+
+      return substr($product_id_list, 2);
+    }
+
+    function calculate() {
+      global $languages_id;// Eversun mod for SPPP Qty Price Break Enhancement
+      $this->total_virtual = 0; // ICW Gift Voucher System
+      $this->total = 0;
+      $this->weight = 0;
+      if (!is_array($this->contents)) return 0;
+
+      reset($this->contents);
+      while (list($products_id, ) = each($this->contents)) {
+        $qty = $this->contents[$products_id]['qty'];
+$pf = new PriceFormatter;
+// products price
+        $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
+       
+       if ($product = $pf->loadProduct($products_id, $languages_id)) {
+// ICW ORDER TOTAL CREDIT CLASS Start Amendment
+          $no_count = 1;
+          $gv_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
+          $gv_result = tep_db_fetch_array($gv_query);
+          if (ereg('^GIFT', $gv_result['products_model'])) {
+            $no_count = 0;
+          }
+// ICW ORDER TOTAL  CREDIT CLASS End Amendment
+          $prid = $product['products_id'];
+          $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
+
+          
+      // Eversun mod end for sppc and qty price breaks
+          //$products_price = $product['products_price'];
+       $products_price = $pf->computePrice($qty);
+          $products_weight = $product['products_weight'];
+
+          $special_price = tep_get_products_special_price($prid);
+     
+          if ($special_price) {
+            $products_price = $special_price;
+          }
+          $this->total_virtual += tep_add_tax($products_price, $products_tax) * $qty * $no_count;// ICW CREDIT CLASS;
+          $this->weight_virtual += ($qty * $products_weight) * $no_count;// ICW CREDIT CLASS;
+          $this->total += tep_add_tax($products_price, $products_tax) * $qty;
+          $this->weight += ($qty * $products_weight);
+        }
+
+// attributes price
+        if (isset($this->contents[$products_id]['attributes'])) {
+          reset($this->contents[$products_id]['attributes']);
+          while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
+            // BOM - Options Catagories
+            /*
+            $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
+            $attribute_price = tep_db_fetch_array($attribute_price_query);
+            if ($attribute_price['price_prefix'] == '+') {
+              $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
+            } else {
+              $this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
+            }
+            */
+            if ( !is_array($value) ) {
+              $attribute_price_query = tep_db_query("select options_values_price as price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
+              $attribute_price = tep_db_fetch_array($attribute_price_query);
+              if ($attribute_price['price_prefix'] == '+') {
+                $this->total += $qty * tep_add_tax($attribute_price['price'], $products_tax);
+              } else {
+                $this->total -= $qty * tep_add_tax($attribute_price['price'], $products_tax);
+              }
+            } elseif ( isset($value['t']) ) {
+              $attribute_price_query = tep_db_query("select options_values_price as price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '0'");
+              $attribute_price = tep_db_fetch_array($attribute_price_query);
+              if ($attribute_price['price_prefix'] == '+') {
+                $this->total += $qty * tep_add_tax($attribute_price['price'], $products_tax);
+              } else {
+                $this->total -= $qty * tep_add_tax($attribute_price['price'], $products_tax);
+              }
+            } elseif ( isset($value['c']) ) {
+              foreach ( $value['c'] as $v ) {
+                $attribute_price_query = tep_db_query("select options_values_price as price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$v . "'");
+                $attribute_price = tep_db_fetch_array($attribute_price_query);
+                if ($attribute_price['price_prefix'] == '+') {
+                  $this->total += $qty * tep_add_tax($attribute_price['price'], $products_tax);
+                } else {
+                  $this->total -= $qty * tep_add_tax($attribute_price['price'], $products_tax);
+                }
+              }
+            }
+            // EOM - Options Catagories
+          }
+        }
+      }
+    }
+
+    function attributes_price($products_id) {
+      $attributes_price = 0;
+
+      if (isset($this->contents[$products_id]['attributes'])) {
+        reset($this->contents[$products_id]['attributes']);
+        while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
+          // BOM - Options Catagories
+          /*
+          $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
+          $attribute_price = tep_db_fetch_array($attribute_price_query);
+          if ($attribute_price['price_prefix'] == '+') {
+            $attributes_price += $attribute_price['options_values_price'];
+          } else {
+            $attributes_price -= $attribute_price['options_values_price'];
+          }
+          */
+          if ( !is_array($value) ) {
+            $attribute_price_query = tep_db_query("select options_values_price as price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
+            $attribute_price = tep_db_fetch_array($attribute_price_query);
+            if ($attribute_price['price_prefix'] == '+') {
+              $attributes_price += $attribute_price['price'];
+            } else {
+              $attributes_price -= $attribute_price['price'];
+            }
+          } elseif ( isset($value['t']) ) {
+            $attribute_price_query = tep_db_query("select options_values_price as price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '0'");
+            $attribute_price = tep_db_fetch_array($attribute_price_query);
+            if ($attribute_price['price_prefix'] == '+') {
+              $attributes_price += $attribute_price['price'];
+            } else {
+              $attributes_price -= $attribute_price['price'];
+            }
+          } elseif ( isset($value['c']) ) {
+            foreach ( $value['c'] as $v ) {
+              $attribute_price_query = tep_db_query("select options_values_price as price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$v . "'");
+              $attribute_price = tep_db_fetch_array($attribute_price_query);
+              if ($attribute_price['price_prefix'] == '+') {
+                $attributes_price += $attribute_price['price'];
+              } else {
+                $attributes_price -= $attribute_price['price'];
+              }
+            }
+          }
+          // EOM - Options Catagories
+        }
+      }
+
+      return $attributes_price;
+    }
+
+    function get_products() {
+      global $languages_id;
+      $pf = new PriceFormatter;
+      // Eversun mod end for sppc and qty price breaks
+      if (!is_array($this->contents)) return false;
+
+      $products_array = array();
+      reset($this->contents);
+      while (list($products_id, ) = each($this->contents)) {
+        if ($products = $pf->loadProduct($products_id, $languages_id)) {
+          $products_price = $pf->computePrice($this->contents[$products_id]['qty']);
+          //Eversun mod end for sppc and qty price breaks
+          $products_array[] = array('id' => $products_id,
+                                    'name' => $products['products_name'],
+                                    'model' => $products['products_model'],
+                                    'image' => $products['products_image'],
+                                    'price' => $products_price,
+                                    'quantity' => $this->contents[$products_id]['qty'],
+                                    'weight' => $products['products_weight'],
+                                    'final_price' => ($products_price + $this->attributes_price($products_id)),
+                                    'tax_class_id' => $products['products_tax_class_id'],
+                                    'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
+        }
+      }
+
+      return $products_array;
+    }
+
+    function show_total() {
+      $this->calculate();
+
+      return $this->total;
+    }
+
+    function show_weight() {
+      $this->calculate();
+
+      return $this->weight;
+    }
+// CREDIT CLASS Start Amendment
+    function show_total_virtual() {
+      $this->calculate();
+
+      return $this->total_virtual;
+    }
+
+    function show_weight_virtual() {
+      $this->calculate();
+
+      return $this->weight_virtual;
+    }
+// CREDIT CLASS End Amendment
+
+    function generate_cart_id($length = 5) {
+      return tep_create_random_value($length, 'digits');
+    }
+
+    function get_content_type() {
+      $this->content_type = false;
+
+      if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) {
+        reset($this->contents);
+        while (list($products_id, ) = each($this->contents)) {
+          if (isset($this->contents[$products_id]['attributes'])) {
+            reset($this->contents[$products_id]['attributes']);
+            while (list(, $value) = each($this->contents[$products_id]['attributes'])) {
+              $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$products_id . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id");
+              $virtual_check = tep_db_fetch_array($virtual_check_query);
+
+              if ($virtual_check['total'] > 0) {
+                switch ($this->content_type) {
+                  case 'physical':
+                    $this->content_type = 'mixed';
+
+                    return $this->content_type;
+                    break;
+                  default:
+                    $this->content_type = 'virtual';
+                    break;
+                }
+              } else {
+                switch ($this->content_type) {
+                  case 'virtual':
+                    $this->content_type = 'mixed';
+
+                    return $this->content_type;
+                    break;
+                  default:
+                    $this->content_type = 'physical';
+                    break;
+                }
+              }
+            }
+// ICW ADDED CREDIT CLASS - Begin
+          } elseif ($this->show_weight() == 0) {
+            reset($this->contents);
+            while (list($products_id, ) = each($this->contents)) {
+              $virtual_check_query = tep_db_query("select products_weight from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'");
+              $virtual_check = tep_db_fetch_array($virtual_check_query);
+              if ($virtual_check['products_weight'] == 0) {
+                switch ($this->content_type) {
+                  case 'physical':
+                    $this->content_type = 'mixed';
+
+                    return $this->content_type;
+                    break;
+                  default:
+                    $this->content_type = 'virtual_weight';
+                    break;
+                }
+              } else {
+                switch ($this->content_type) {
+                  case 'virtual':
+                    $this->content_type = 'mixed';
+
+                    return $this->content_type;
+                    break;
+                  default:
+                    $this->content_type = 'physical';
+                    break;
+                }
+              }
+            }
+// ICW ADDED CREDIT CLASS - End
+          } else {
+            switch ($this->content_type) {
+              case 'virtual':
+                $this->content_type = 'mixed';
+
+                return $this->content_type;
+                break;
+              default:
+                $this->content_type = 'physical';
+                break;
+            }
+          }
+        }
+      } else {
+        $this->content_type = 'physical';
+      }
+
+      return $this->content_type;
+    }
+
+    function unserialize($broken) {
+      for(reset($broken);$kv=each($broken);) {
+        $key=$kv['key'];
+        if (gettype($this->$key)!="user function")
+        $this->$key=$kv['value'];
+      }
+    }
+   // ------------------------ ICWILSON CREDIT CLASS Gift Voucher Addittion-------------------------------Start
+   // amend count_contents to show nil contents for shipping
+   // as we don't want to quote for 'virtual' item
+   // GLOBAL CONSTANTS if NO_COUNT_ZERO_WEIGHT is true then we don't count any product with a weight
+   // which is less than or equal to MINIMUM_WEIGHT
+   // otherwise we just don't count gift certificates
+
+    function count_contents_virtual() {  // get total number of items in cart disregard gift vouchers
+      $total_items = 0;
+      if (is_array($this->contents)) {
+        reset($this->contents);
+        while (list($products_id, ) = each($this->contents)) {
+          $no_count = false;
+          $gv_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'");
+          $gv_result = tep_db_fetch_array($gv_query);
+          if (ereg('^GIFT', $gv_result['products_model'])) {
+            $no_count=true;
+          }
+          if (NO_COUNT_ZERO_WEIGHT == 1) {
+            $gv_query = tep_db_query("select products_weight from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($products_id) . "'");
+            $gv_result=tep_db_fetch_array($gv_query);
+            if ($gv_result['products_weight']<=MINIMUM_WEIGHT) {
+              $no_count=true;
+            }
+          }
+          if (!$no_count) $total_items += $this->get_quantity($products_id);
+        }
+      }
+      return $total_items;
+    }
+// ------------------------ ICWILSON CREDIT CLASS Gift Voucher Addittion-------------------------------End
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/split_page_results.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/split_page_results.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/split_page_results.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,148 @@
+<?php
+/*
+  $Id: split_page_results.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class splitPageResults {
+    var $sql_query, $number_of_rows, $current_page_number, $number_of_pages, $number_of_rows_per_page, $page_name;
+
+/* class constructor */
+    function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page') {
+      global $HTTP_GET_VARS, $HTTP_POST_VARS;
+
+      $this->sql_query = $query;
+      $this->page_name = $page_holder;
+
+      if (isset($HTTP_GET_VARS[$page_holder])) {
+        $page = $HTTP_GET_VARS[$page_holder];
+      } elseif (isset($HTTP_POST_VARS[$page_holder])) {
+        $page = $HTTP_POST_VARS[$page_holder];
+      } else {
+        $page = '';
+      }
+
+      if (empty($page) || !is_numeric($page)) $page = 1;
+      $this->current_page_number = $page;
+         
+         if ($max_rows <= 0){
+          $max_rows = '1';
+          }
+
+      $this->number_of_rows_per_page = $max_rows;
+
+
+
+      $pos_to = strlen($this->sql_query);
+      $pos_from = strpos($this->sql_query, ' from', 0);
+
+      $pos_group_by = strpos($this->sql_query, ' group by', $pos_from);
+      if (($pos_group_by < $pos_to) && ($pos_group_by != false)) $pos_to = $pos_group_by;
+
+      $pos_having = strpos($this->sql_query, ' having', $pos_from);
+      if (($pos_having < $pos_to) && ($pos_having != false)) $pos_to = $pos_having;
+
+      $pos_order_by = strpos($this->sql_query, ' order by', $pos_from);
+      if (($pos_order_by < $pos_to) && ($pos_order_by != false)) $pos_to = $pos_order_by;
+
+      if (strpos($this->sql_query, 'distinct') || strpos($this->sql_query, 'group by')) {
+        $count_string = 'distinct ' . tep_db_input($count_key);
+      } else {
+        $count_string = tep_db_input($count_key);
+      }
+
+      $count_query = tep_db_query("select count(" . $count_string . ") as total " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from)));
+      $count = tep_db_fetch_array($count_query);
+
+      $this->number_of_rows = $count['total'];
+
+      $this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);
+
+      if ($this->current_page_number > $this->number_of_pages) {
+        $this->current_page_number = $this->number_of_pages;
+      }
+
+      $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));
+      //newer version of mysql can not handle neg number in limit, temp fix
+      if ($offset < '0'){
+         $offset = '1';
+         }
+      $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;
+    }
+
+/* class functions */
+
+// display split-page-number-links
+    function display_links($max_page_links, $parameters = '') {
+      global $PHP_SELF, $request_type;
+
+      $display_links_string = '';
+      
+         if ($max_page_links <= 0){
+          $max_page_links = '1';
+          }
+          
+      $class = 'class="pageResults"';
+// BOM Mod:allow for a call when there are no rows to be displayed
+      if ($this->number_of_pages > 0) {
+
+      if (tep_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&';
+
+// previous button - not displayed on first page
+      if ($this->current_page_number > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><u>' . PREVNEXT_BUTTON_PREV . '</u></a>&nbsp;&nbsp;';
+
+// check if number_of_pages > $max_page_links
+      $cur_window_num = intval($this->current_page_number / $max_page_links);
+      if ($this->current_page_number % $max_page_links) $cur_window_num++;
+
+      $max_window_num = intval($this->number_of_pages / $max_page_links);
+      if ($this->number_of_pages % $max_page_links) $max_window_num++;
+
+// previous window of pages
+      if ($cur_window_num > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . (($cur_window_num - 1) * $max_page_links), $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';
+
+// page nn button
+      for ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) {
+        if ($jump_to_page == $this->current_page_number) {
+          $display_links_string .= '&nbsp;<b>' . $jump_to_page . '</b>&nbsp;';
+        } else {
+          $display_links_string .= '&nbsp;<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' "><u>' . $jump_to_page . '</u></a>&nbsp;';
+        }
+      }
+
+// next window of pages
+      if ($cur_window_num < $max_window_num) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>&nbsp;';
+
+// next button
+      if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) $display_links_string .= '&nbsp;<a href="' . tep_href_link(basename($PHP_SELF), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' "><u>' . PREVNEXT_BUTTON_NEXT . '</u></a>&nbsp;';
+
+      } else {  // if zero rows, then simply say that
+        $display_links_string .= '&nbsp;<b>0</b>&nbsp;';
+      }
+// EMO Mod
+      return $display_links_string;
+    }
+
+// display number of total products found
+    function display_count($text_output) {
+      $to_num = ($this->number_of_rows_per_page * $this->current_page_number);
+      if ($to_num > $this->number_of_rows) $to_num = $this->number_of_rows;
+
+      $from_num = ($this->number_of_rows_per_page * ($this->current_page_number - 1));
+
+      if ($to_num == 0) {
+        $from_num = 0;
+      } else {
+        $from_num++;
+      }
+
+      return sprintf($text_output, $from_num, $to_num, $this->number_of_rows);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/classes/xmldocument.php
===================================================================
--- trunk/direct.openmoko.com/includes/classes/xmldocument.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/classes/xmldocument.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,302 @@
+<?php
+/*
+    $Id: xmldocument.php,v 1.5 2003/06/27 01:03:03 torinwalker Exp $
+    
+    Written by Torin Walker
+    torinwalker at rogers.com
+    
+    Generic XML Document support for when there is none.
+    
+    Copyright(c) 2003 by Torin Walker, All rights reserved.
+    
+    Released under the GNU General Public License
+*/
+
+define("ELEMENT", 0);
+define("TEXTELEMENT", 1);
+
+//*****************
+class XMLDocument {
+    var $root;
+    var $children;
+
+    function XMLDocument() {
+    }
+
+    function createElement($name) {
+        $node = new Node();
+        $node->setName($name);
+        $node->setType(ELEMENT);
+        return $node;
+    }
+
+    function createTextElement($text) {
+        $node = new Node();
+        $node->setType(TEXTELEMENT);
+        $node->setValue($text);
+        return $node;
+    }
+
+    function getRoot() {
+        return $this->root;
+    }
+
+    function setRoot($node) {
+        $this->root = $node;
+    }
+
+    function toString() {
+        if ($this->root) {
+            return $this->root->toString();
+        } else {
+            return "DOCUMENT ROOT NOT SET";
+        }
+    }
+
+    function getValueByPath($path) {
+        $pathArray = split("/", $path);
+        if ($pathArray[0] == $this->root->getName()) {
+            //print_r("Looking for " . $pathArray[0] . "<br>");
+            array_shift($pathArray);
+            $newPath = implode("/", $pathArray);
+            return $this->root->getValueByPath($newPath);
+        }
+    }
+}
+
+//**********
+class Node {
+    var $name;
+    var $type;
+    var $text;
+    var $parent;
+    var $children;
+    var $attributes;
+
+    function Node() {
+        $this->children = array();
+        $this->attributes = array();
+    }
+
+    function getName() {
+        return $this->name;
+    }
+
+    function setName($name) {
+        $this->name = $name;
+    }
+
+    function setParent(&$node) {
+        $this->parent =& $node;
+    }
+
+    function &getParent() {
+        return $this->parent;
+    }
+
+    function &getChildren() {
+        return $this->children;
+    }
+
+    function getType() {
+        return $this->type;
+    }
+
+    function setType($type) {
+        $this->type = $type;
+    }
+
+    function getElementByName($name) {
+        for ($i = 0; $i < count($this->children); $i++) {
+            if ($this->children[$i]->getType() == ELEMENT) {
+                if ($this->children[$i]->getName() == $name) {
+                    return $this->children[$i];
+                }
+            }
+        }
+        return null;
+    }
+
+    function getElementsByName($name) {
+        $elements = array();
+        for ($i = 0; $i < count($this->children); $i++) {
+            if ($this->children[$i]->getType() == ELEMENT) {
+                if ($this->children[$i]->getName() == $name) {
+                    $elements[] = $this->children[$i];
+                }
+            }
+        }
+        return $elements;
+    }
+
+    function getValueByPath($path) {
+        $pathArray = split('/', $path);
+        $node = $this;
+        for ($i = 0; $i < count($pathArray); $i++) {
+            //print_r("Looking for " . $pathArray[$i] ."<br>");
+            if ($node->getChildren()) {
+                for ($j = 0; $j < count($node->getChildren()); $j++) {
+                    if ($node->children[$j]->getType() == ELEMENT) {
+                        if ($node->children[$j]->getName() == $pathArray[$i]) {
+                            //print_r("Found " . $pathArray[$i] ."<br>");
+                            $node = $node->children[$j];
+                        }
+                    }
+                }
+            }
+        }
+        return $node->getValue();
+    } 
+
+    function getText() {
+        return $this->text();
+    }
+
+    function setValue($text) {
+        $this->text = $text;
+    }
+
+    function getValue() {
+        $value = NULL;
+        if ($this->getType() == ELEMENT) {
+            for ($i = 0; $i < count($this->children); $i++) {
+                $value .= $this->children[$i]->getValue();
+            }
+        } elseif ($this->getType() == TEXTELEMENT) {
+            $value .= $this->text;
+        }
+        return $value;
+    }
+
+    function setAttribute($name, $value) {
+        $attributes[$name] = $value;
+    }
+
+    function getAttribute($name) {
+        return $attributes[$name];
+    }
+
+    function addNode(&$node) {
+        $this->children[] =& $node;
+        $node->parent =& $this;
+    }
+
+    function parentToString($node) {
+        while($node->parent) {
+            //print_r("Node " . $node->name . " has parent<br>");
+            $node = $node->parent;
+        }
+        //print_r("Node contents from root: " . $node->toString() . "<br>");
+    }
+
+    function toString() {
+        $string = NULL;    
+        //print_r("toString child count " . $this->name . " contains " . count($this->children) . "<br>");    
+        if ($this->type == ELEMENT) {
+            $string .= '{' . $this->name . '}';
+            for ($i = 0; $i < count($this->children); $i++) {
+                $string .= $this->children[$i]->toString();
+            }
+            $string .= '{/' . $this->name . '}';
+        } else {
+            $string .= $this->getValue();
+        }
+        return $string;
+    }
+}
+
+//**************
+class XMLParser {
+    var $xp;
+    var $document;
+    var $current;
+    var $error;
+
+    function XMLParser() {
+        $this->document = new XMLDocument();
+        $this->error = array();
+    }
+
+    function setDocument($document) {
+        $this->document = $document;
+    }
+
+    function getDocument() {
+        return $this->document;
+    }
+
+    function destruct(){
+        xml_parser_free($this->xp);
+    }
+
+    // return 1 for an error, 0 for no error
+    function hasErrors() {
+        if (sizeof($this->error) > 0) {
+            return 1;
+        } else {
+            return 0;
+        }
+    }
+
+    // return array of error messages
+    function getError() {
+        return $this->error;
+    }
+
+    // process xml start tag
+    function startElement($xp, $name, $attrs) {
+        //print_r("Found Start Tag: " . $name . "<br>");
+        $node =& $this->document->createElement($name);
+        if ($this->document->getRoot()) {
+            $this->current->addNode($node);
+        } else {
+            $this->document->root =& $node;
+        }
+        $this->current =& $node;
+    }
+
+    // process xml end tag
+    function endElement($xp, $name){
+        //print_r("Found End Tag: " . $name . "<br>");
+        if ($this->current->getParent()) {
+            $this->current =& $this->current->getParent();
+        }
+    }
+
+    // process data between xml tags
+    function dataHandler($xp, $text) {
+        //print_r("Adding Data: \"" . $text . "\"<br>");
+        $node =& $this->document->createTextElement($text);
+        $this->current->addNode($node);
+    }
+
+    // parse xml document from string
+    function parse($xmlString) {
+        if(!($this->xp = @xml_parser_create())) {
+            $this->error['description'] = 'Could not create xml parser';
+        }
+        if(!$this->hasErrors()) {
+            if(!@xml_set_object($this->xp, $this)) {
+                $this->error['description'] = 'Could not set xml parser for object';
+            }
+        }
+        if(!$this->hasErrors()) {
+            if(!@xml_set_element_handler($this->xp, 'startElement', 'endElement')) {
+                $this->error['description'] = 'Could not set xml element handler';
+            }
+        }
+        if(!$this->hasErrors()) {
+            if(!@xml_set_character_data_handler($this->xp, 'dataHandler')) {
+                $this->error['description'] = 'Could not set xml character handler';
+            }
+        } 
+        xml_parser_set_option($this->xp, XML_OPTION_CASE_FOLDING, false);
+        if (!$this->hasErrors()) {
+            if(!@xml_parse($this->xp, $xmlString)) {
+                $this->error['description'] = xml_error_string(xml_get_error_code($this->xp));
+                $this->error['line'] = xml_get_current_line_number($this->xp);
+            }
+        }
+    }
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/column_left.php
===================================================================
--- trunk/direct.openmoko.com/includes/column_left.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/column_left.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: column_left.php,v 1.1.1.1 2004/03/04 23:40:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  $column_query = tep_db_query('select infobox_id, display_in_column as cfgcol, infobox_file_name as cfgtitle, infobox_display as cfgvalue, infobox_define as cfgkey, box_template, box_heading_font_color from ' . TABLE_INFOBOX_CONFIGURATION . ' where template_id = ' . TEMPLATE_ID . ' and infobox_display = "yes" and display_in_column = "left" order by location');
+  while ($column = tep_db_fetch_array($column_query)) {
+
+if ( file_exists(DIR_FS_TEMPLATE_BOXES . '/boxes/' . $column['cfgtitle'])) {
+$box_heading = tep_get_box_heading($column['infobox_id'], $languages_id);
+
+define($column['cfgkey'], $box_heading);
+//$infobox_define = $box_heading;
+$infobox_template = $column['box_template'];
+$font_color = $column['box_heading_font_color'];
+$infobox_class = $column['box_template'];
+//cache control side box detect
+if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories1.php') ) {
+     echo tep_cache_categories_box();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories.php') ) {
+     echo tep_cache_categories_box();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories2.php') ) {
+     echo tep_cache_categories_box1();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories3.php') ) {
+     echo tep_cache_categories_box3();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories4.php') ) {
+     echo tep_cache_categories_box4();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories5.php') ) {
+     echo tep_cache_categories_box5();
+  } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'coolmenu.php') ) {
+     echo tep_cache_coolmenu();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'manufacturers.php') ) {
+     echo tep_cache_manufacturers_box();
+ } else {
+require(DIR_FS_TEMPLATE_BOXES . '/' . $column['cfgtitle']);
+      }
+   // end cache control code   
+ }else{
+ 
+$box_heading = tep_get_box_heading($column['infobox_id'], $languages_id);
+//echo 'side ' . $column['infobox_id'] . $box_heading . $languages_id;
+define($column['cfgkey'],$box_heading);
+//$infobox_define = $box_heading;
+$infobox_template = $column['box_template'];
+$font_color = $column['box_heading_font_color'];
+$infobox_class = $column['box_template'];
+require(DIR_FS_TEMPLATE_BOXES . '/' . $column['cfgtitle']);
+
+}
+}
+?>
+

Added: trunk/direct.openmoko.com/includes/column_right.php
===================================================================
--- trunk/direct.openmoko.com/includes/column_right.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/column_right.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: column_right.php,v 1.1.1.1 2004/03/04 23:40:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  $column_query = tep_db_query('select infobox_id, display_in_column as cfgcol, infobox_file_name as cfgtitle, infobox_display as cfgvalue, infobox_define as cfgkey, box_template, box_heading_font_color from ' . TABLE_INFOBOX_CONFIGURATION . ' where template_id = ' . TEMPLATE_ID . ' and infobox_display = "yes" and display_in_column = "right" order by location');
+  while ($column = tep_db_fetch_array($column_query)) {
+
+if ( file_exists(DIR_FS_TEMPLATE_BOXES . '/boxes/' . $column['cfgtitle'])) {
+$box_heading = tep_get_box_heading($column['infobox_id'], $languages_id);
+
+define($column['cfgkey'], $box_heading);
+//$infobox_define = $box_heading;
+$infobox_template = $column['box_template'];
+$font_color = $column['box_heading_font_color'];
+$infobox_class = $column['box_template'];
+//cache control side box detect
+if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories1.php') ) {
+     echo tep_cache_categories_box();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories.php') ) {
+     echo tep_cache_categories_box();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories2.php') ) {
+     echo tep_cache_categories_box1();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories3.php') ) {
+     echo tep_cache_categories_box3();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories4.php') ) {
+     echo tep_cache_categories_box4();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories5.php') ) {
+     echo tep_cache_categories_box5();
+  } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'coolmenu.php') ) {
+     echo tep_cache_coolmenu();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'manufacturers.php') ) {
+     echo tep_cache_manufacturers_box();
+ } else {
+require(DIR_FS_TEMPLATE_BOXES . '/' . $column['cfgtitle']);
+      }
+   // end cache control code   
+ }else{
+ 
+ 	
+$box_heading = tep_get_box_heading($column['infobox_id'], $languages_id);
+//echo 'side ' . $column['infobox_id'] . $box_heading . $languages_id;
+define($column['cfgkey'],$box_heading);
+//$infobox_define = $box_heading;
+$infobox_template = $column['box_template'];
+$font_color = $column['box_heading_font_color'];
+$infobox_class = $column['box_template'];
+require(DIR_FS_TEMPLATE_BOXES . '/' . $column['cfgtitle']);
+
+}
+}
+?>
+

Added: trunk/direct.openmoko.com/includes/configure.php
===================================================================
--- trunk/direct.openmoko.com/includes/configure.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/configure.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+require_once '../openmoko_common_cfg.php';
+
+// Define the webserver and path parameters
+// * DIR_FS_* = Filesystem directories (local/physical)
+// * DIR_WS_* = Webserver directories (virtual/URL)
+  define('HTTP_SERVER',			'http://'.OPENMOKO_SHOP_HOST); // eg, http://localhost - should not be empty for productive servers
+  define('HTTPS_SERVER',		'https://'.OPENMOKO_SHOP_HOST); // eg, https://localhost - should not be empty for productive servers
+  define('ENABLE_SSL',			true); // secure webserver for checkout procedure?
+  define('HTTP_COOKIE_DOMAIN',		OPENMOKO_SHOP_HOST);
+  define('HTTPS_COOKIE_DOMAIN',		OPENMOKO_SHOP_HOST);
+  define('HTTP_COOKIE_PATH',		OPENMOKO_SHOP_WS_PATH.'/');
+  define('HTTPS_COOKIE_PATH',		OPENMOKO_SHOP_WS_PATH.'/');
+  define('DIR_WS_HTTP_CATALOG',		OPENMOKO_SHOP_WS_PATH.'/');
+  define('DIR_WS_HTTPS_CATALOG',	OPENMOKO_SHOP_WS_PATH.'/');
+  define('DIR_WS_IMAGES', 'images/');
+  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
+  define('DIR_WS_INCLUDES', 'includes/');
+  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
+  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
+  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
+  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
+  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
+
+//Added for BTS1.0
+  define('DIR_WS_TEMPLATES', 'templates/');
+  define('DIR_WS_CONTENT', DIR_WS_TEMPLATES . 'content/');
+  define('DIR_WS_JAVASCRIPT', DIR_WS_INCLUDES . 'javascript/');
+//End BTS1.0
+  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
+  define('DIR_FS_CATALOG',		OPENMOKO_SHOP_FS_PATH);
+  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
+  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
+
+// define our database connection
+  define('DB_SERVER',		OPENMOKO_SHOP_DB_HOST); // eg, localhost - should not be empty for productive servers
+  define('DB_SERVER_USERNAME',	OPENMOKO_SHOP_DB_USER);
+  define('DB_SERVER_PASSWORD',	OPENMOKO_SHOP_DB_PASSWD);
+  define('DB_DATABASE',		OPENMOKO_SHOP_DB_NAME);
+  define('USE_PCONNECT', 'true'); // use persistent connections?
+  define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/configure_dist.php
===================================================================
--- trunk/direct.openmoko.com/includes/configure_dist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/configure_dist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// Define the webserver and path parameters
+// * DIR_FS_* = Filesystem directories (local/physical)
+// * DIR_WS_* = Webserver directories (virtual/URL)
+  define('HTTP_SERVER', 'http://192.168.1.35'); // eg, http://localhost - should not be empty for productive servers
+  define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers
+  define('ENABLE_SSL', false); // secure webserver for checkout procedure?
+  define('HTTP_COOKIE_DOMAIN', '192.168.1.35');
+  define('HTTPS_COOKIE_DOMAIN', '');
+  define('HTTP_COOKIE_PATH', '/acremainsvn/branches/loaded62free/');
+  define('HTTPS_COOKIE_PATH', '');
+  define('DIR_WS_HTTP_CATALOG', '/acremainsvn/branches/loaded62free/');
+  define('DIR_WS_HTTPS_CATALOG', '');
+  define('DIR_WS_IMAGES', 'images/');
+  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
+  define('DIR_WS_INCLUDES', 'includes/');
+  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
+  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
+  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
+  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
+  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
+
+//Added for BTS1.0
+  define('DIR_WS_TEMPLATES', 'templates/');
+  define('DIR_WS_CONTENT', DIR_WS_TEMPLATES . 'content/');
+  define('DIR_WS_JAVASCRIPT', DIR_WS_INCLUDES . 'javascript/');
+//End BTS1.0
+  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
+  define('DIR_FS_CATALOG', 'C:/aserve/apachefriends/xampp/htdocs/acremainsvn/branches/loaded62free/');
+  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
+  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
+
+// define our database connection
+  define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
+  define('DB_SERVER_USERNAME', 'root');
+  define('DB_SERVER_PASSWORD', '');
+  define('DB_DATABASE', '62free5');
+  define('USE_PCONNECT', 'false'); // use persistent connections?
+  define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/counter.php
===================================================================
--- trunk/direct.openmoko.com/includes/counter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/counter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: counter.php,v 1.1.1.1 2004/03/04 23:40:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  $counter_query = tep_db_query("select startdate, counter from " . TABLE_COUNTER);
+
+  if (!tep_db_num_rows($counter_query)) {
+    $date_now = date('Ymd');
+    tep_db_query("insert into " . TABLE_COUNTER . " (startdate, counter) values ('" . $date_now . "', '1')");
+    $counter_startdate = $date_now;
+    $counter_now = 1;
+  } else {
+    $counter = tep_db_fetch_array($counter_query);
+    $counter_startdate = $counter['startdate'];
+    $counter_now = ($counter['counter'] + 1);
+    tep_db_query("update " . TABLE_COUNTER . " set counter = '" . $counter_now . "'");
+  }
+
+  $counter_startdate_formatted = strftime(DATE_FORMAT_LONG, mktime(0, 0, 0, substr($counter_startdate, 4, 2), substr($counter_startdate, -2), substr($counter_startdate, 0, 4)));
+?>

Added: trunk/direct.openmoko.com/includes/database_tables.php
===================================================================
--- trunk/direct.openmoko.com/includes/database_tables.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/database_tables.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,169 @@
+<?php
+/*
+  $Id: database_tables.php,v 1.1.1.1 2004/03/04 23:40:38 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TABLE_VISUAL_VERIFY_CODE', 'visual_verify_code');
+
+// define the database table names used in the project
+  define('TABLE_ADDRESS_BOOK', 'address_book');
+  define('TABLE_ADDRESS_FORMAT', 'address_format');
+  define('TABLE_BANNERS', 'banners');
+  define('TABLE_BANNERS_HISTORY', 'banners_history');
+  define('TABLE_CATEGORIES', 'categories');
+  define('TABLE_CATEGORIES_DESCRIPTION', 'categories_description');
+  define('TABLE_CONFIGURATION', 'configuration');
+  define('TABLE_CONFIGURATION_GROUP', 'configuration_group');
+  define('TABLE_COUNTER', 'counter');
+  define('TABLE_COUNTER_HISTORY', 'counter_history');
+  define('TABLE_COUNTRIES', 'countries');
+  define('TABLE_CURRENCIES', 'currencies');
+  define('TABLE_CUSTOMERS', 'customers');
+  define('TABLE_CUSTOMERS_BASKET', 'customers_basket');
+  define('TABLE_CUSTOMERS_BASKET_ATTRIBUTES', 'customers_basket_attributes');
+  define('TABLE_CUSTOMERS_INFO', 'customers_info');
+  define('TABLE_LANGUAGES', 'languages');
+  define('TABLE_MANUFACTURERS', 'manufacturers');
+  define('TABLE_MANUFACTURERS_INFO', 'manufacturers_info');
+  define('TABLE_ORDERS', 'orders');
+  define('TABLE_ORDERS_PRODUCTS', 'orders_products');
+  define('TABLE_ORDERS_PRODUCTS_ATTRIBUTES', 'orders_products_attributes');
+  define('TABLE_ORDERS_PRODUCTS_DOWNLOAD', 'orders_products_download');
+  define('TABLE_ORDERS_STATUS', 'orders_status');
+  define('TABLE_ORDERS_STATUS_HISTORY', 'orders_status_history');
+  define('TABLE_ORDERS_TOTAL', 'orders_total');
+  define('TABLE_PRODUCTS', 'products');
+   define('TABLE_PRODUCTS_ATTRIBUTES', 'products_attributes');
+  define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', 'products_attributes_download');
+  define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');
+  define('TABLE_PRODUCTS_NOTIFICATIONS', 'products_notifications');
+  define('TABLE_PRODUCTS_OPTIONS', 'products_options');
+  define('TABLE_PRODUCTS_OPTIONS_TEXT', 'products_options_text');
+  define('TABLE_PRODUCTS_OPTIONS_VALUES', 'products_options_values');
+  define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', 'products_options_values_to_products_options');
+  define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');
+  define('TABLE_REVIEWS', 'reviews');
+  define('TABLE_REVIEWS_DESCRIPTION', 'reviews_description');
+  define('TABLE_SESSIONS', 'sessions');
+  define('TABLE_SPECIALS', 'specials');
+  define('TABLE_TAX_CLASS', 'tax_class');
+  define('TABLE_TAX_RATES', 'tax_rates');
+  define('TABLE_GEO_ZONES', 'geo_zones');
+  define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones');
+  define('TABLE_WHOS_ONLINE', 'whos_online');
+  define('TABLE_ZONES', 'zones');
+
+// Added for Xsell Products Mod
+  define('TABLE_PRODUCTS_XSELL', 'products_xsell');
+
+// Lango Added for template and infobox mod
+  define('TABLE_INFOBOX_CONFIGURATION', 'infobox_configuration');
+  define('TABLE_TEMPLATE', 'template');
+  define('TABLE_INFOBOX_HEADING', 'infobox_heading');
+  
+// Lango Added for Salemaker mod
+  define('TABLE_SALEMAKER_SALES', 'salemaker_sales');
+
+// Lango Added for Featured Products
+  define('TABLE_FEATURED', 'featured');
+
+// Lango Added for Wishlist
+  define('TABLE_WISHLIST', 'customers_wishlist');
+  define('TABLE_WISHLIST_ATTRIBUTES', 'customers_wishlist_attributes');
+
+// VJ Links Manager v1.00 begin
+  define('TABLE_LINK_CATEGORIES', 'link_categories');
+  define('TABLE_LINK_CATEGORIES_DESCRIPTION', 'link_categories_description');
+  define('TABLE_LINKS', 'links');
+  define('TABLE_LINKS_DESCRIPTION', 'links_description');
+  define('TABLE_LINKS_TO_LINK_CATEGORIES', 'links_to_link_categories');
+// VJ Links Manager v1.00 end
+
+// BMC CC Mod Start
+  define('TABLE_BLACKLIST', 'card_blacklist');
+// BMC CC Mod End
+  define('TABLE_INFORMATION', 'information');
+//added for GV
+  define('TABLE_COUPON_GV_CUSTOMER', 'coupon_gv_customer');
+  define('TABLE_COUPON_GV_QUEUE', 'coupon_gv_queue');
+  define('TABLE_COUPON_REDEEM_TRACK', 'coupon_redeem_track');
+  define('TABLE_COUPON_EMAIL_TRACK', 'coupon_email_track');
+  define('TABLE_COUPONS', 'coupons');
+  define('TABLE_COUPONS_DESCRIPTION', 'coupons_description');
+  
+// define the database table names used in the contribution
+  define('TABLE_AFFILIATE', 'affiliate_affiliate');
+// if you change this -> affiliate_show_banner must be changed too
+  define('TABLE_AFFILIATE_BANNERS', 'affiliate_banners');
+  define('TABLE_AFFILIATE_BANNERS_HISTORY', 'affiliate_banners_history');
+  define('TABLE_AFFILIATE_CLICKTHROUGHS', 'affiliate_clickthroughs');
+  define('TABLE_AFFILIATE_SALES', 'affiliate_sales');
+  define('TABLE_AFFILIATE_PAYMENT', 'affiliate_payment');
+  define('TABLE_AFFILIATE_PAYMENT_STATUS', 'affiliate_payment_status');
+  define('TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY', 'affiliate_payment_status_history');
+//CALENDAR
+define('TABLE_EVENTS_CALENDAR', 'events_calendar');
+
+// Added for FAQ System 2.1 DMG
+define('TABLE_FAQ','faq');
+
+// VJ faq manager added
+  define('TABLE_FAQ_CATEGORIES', 'faq_categories');
+  define('TABLE_FAQ_CATEGORIES_DESCRIPTION', 'faq_categories_description');
+  define('TABLE_FAQ_TO_CATEGORIES', 'faq_to_categories');
+
+//Added for Article Manager
+
+  define('TABLE_ARTICLE_REVIEWS', 'article_reviews');
+  define('TABLE_ARTICLE_REVIEWS_DESCRIPTION', 'article_reviews_description');
+  define('TABLE_ARTICLES', 'articles');
+  define('TABLE_ARTICLES_DESCRIPTION', 'articles_description');
+  define('TABLE_ARTICLES_TO_TOPICS', 'articles_to_topics');
+  define('TABLE_ARTICLES_XSELL', 'articles_xsell');
+  define('TABLE_AUTHORS', 'authors');
+  define('TABLE_AUTHORS_INFO', 'authors_info');
+  define('TABLE_TOPICS', 'topics');
+  define('TABLE_TOPICS_DESCRIPTION', 'topics_description');
+  
+// START: Product Extra Fields  DMG
+    define('TABLE_PRODUCTS_EXTRA_FIELDS', 'products_extra_fields');
+    define('TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS', 'products_to_products_extra_fields');
+// END: Product Extra Fields
+
+// Contact US Email Subject : DMG
+  define('TABLE_EMAIL_SUBJECTS', 'email_subjects');
+
+  // Eversun mod for sppc and qty price breaks
+  define('TABLE_PRODUCTS_GROUPS', 'products_groups');
+  define('TABLE_SPECIALS_RETAIL_PRICES', 'specials_retail_prices');
+  define('TABLE_PRODUCTS_GROUP_PRICES', 'products_group_prices_cg_');
+  define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');
+  // this will define the maximum time in minutes between updates of a products_group_prices_cg_# table
+  // changes in table specials will trigger an immediate update if a query needs this particular table
+  define('MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE', '15');
+  // Eversun mod end for sppc and qty price breaks
+
+
+// VJ navmenu begin
+define('TABLE_NAVMENU_CATEGORIES', 'navmenu_categories');
+define('TABLE_NAVMENU_CATEGORIES_DESCRIPTION', 'navmenu_categories_description');
+define('TABLE_NAVMENU_LINKS', 'navmenu_links');
+define('TABLE_NAVMENU_LINKS_DESCRIPTION', 'navmenu_links_description');
+define('TABLE_NAVMENU_LINKS_TO_CATEGORIES', 'navmenu_links_to_categories');
+// VJ navmenu end
+
+// VJ  CRE Page Manager begin
+  define('TABLE_PAGES_CATEGORIES', 'pages_categories');
+  define('TABLE_PAGES_CATEGORIES_DESCRIPTION', 'pages_categories_description');
+  define('TABLE_PAGES', 'pages');
+  define('TABLE_PAGES_DESCRIPTION', 'pages_description');
+  define('TABLE_PAGES_TO_CATEGORIES', 'pages_to_categories');
+// VJ Page Manager end
+?>

Added: trunk/direct.openmoko.com/includes/filenames.php
===================================================================
--- trunk/direct.openmoko.com/includes/filenames.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/filenames.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,421 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//VVC Check
+define('FILENAME_VISUAL_VERIFY_CODE_DISPLAY', 'vvc_display.php');
+
+//Email Verification
+define('CONTENT_PW', 'pw');
+define('FILENAME_PW', CONTENT_PW . '.php');
+define('CONTENT_VALIDATE_NEW', 'validate_new'); 
+define('FILENAME_VALIDATE_NEW', CONTENT_VALIDATE_NEW . '.php');
+define('FILENAME_LOGIN_ACC','login_acc.php');
+
+// define the content used in the project
+  define('FILENAME_WPCALLBACK', 'wpcallback.php');
+  define('CONTENT_ACCOUNT', 'account');
+  define('CONTENT_ACCOUNT_EDIT', 'account_edit');
+  define('CONTENT_ACCOUNT_HISTORY', 'account_history');
+  define('CONTENT_ACCOUNT_HISTORY_INFO', 'account_history_info');
+  define('CONTENT_ACCOUNT_NEWSLETTERS', 'account_newsletters');
+  define('CONTENT_ACCOUNT_NOTIFICATIONS', 'account_notifications');
+  define('CONTENT_ACCOUNT_PASSWORD', 'account_password');
+  define('CONTENT_ADDRESS_BOOK', 'address_book');
+  define('CONTENT_ADDRESS_BOOK_PROCESS', 'address_book_process');
+  define('CONTENT_ADVANCED_SEARCH', 'advanced_search');
+  define('CONTENT_ADVANCED_SEARCH_RESULT', 'advanced_search_result');
+  define('CONTENT_ALSO_PURCHASED_PRODUCTS', 'also_purchased_products');
+  define('CONTENT_CHECKOUT_CONFIRMATION', 'checkout_confirmation');
+  define('CONTENT_CHECKOUT_PAYMENT', 'checkout_payment');
+  define('CONTENT_CHECKOUT_PAYMENT_ADDRESS', 'checkout_payment_address');
+  define('CONTENT_CHECKOUT_SHIPPING', 'checkout_shipping');
+  define('CONTENT_CHECKOUT_SHIPPING_ADDRESS', 'checkout_shipping_address');
+  define('CONTENT_CHECKOUT_SUCCESS', 'checkout_success');
+  define('CONTENT_CONTACT_US', 'contact_us');
+  define('CONTENT_CONDITIONS', 'conditions');
+  define('CONTENT_COOKIE_USAGE', 'cookie_usage');
+  define('CONTENT_CREATE_ACCOUNT', 'create_account');
+  define('CONTENT_CREATE_ACCOUNT_SUCCESS', 'create_account_success');
+  define('CONTENT_DOWNLOAD', 'download');
+  define('CONTENT_INDEX_DEFAULT', 'index_default');
+  define('CONTENT_INDEX_NESTED', 'index_nested');
+  define('CONTENT_INDEX_PRODUCTS', 'index_products');
+  define('CONTENT_INFO_SHOPPING_CART', 'info_shopping_cart');
+  define('CONTENT_LOGIN', 'login');
+  define('CONTENT_LOGOFF', 'logoff');
+  define('CONTENT_NEW_PRODUCTS', 'new_products');
+  define('CONTENT_PASSWORD_FORGOTTEN', 'password_forgotten');
+  define('CONTENT_POPUP_IMAGE', 'popup_image');
+  define('CONTENT_POPUP_SEARCH_HELP', 'popup_search_help');
+  define('CONTENT_PRIVACY', 'privacy');
+  define('CONTENT_PRODUCT_REVIEWS', 'product_reviews');
+  define('CONTENT_PRODUCT_REVIEWS_INFO', 'product_reviews_info');
+  define('CONTENT_PRODUCT_REVIEWS_WRITE', 'product_reviews_write');
+  define('CONTENT_PRODUCTS_NEW', 'products_new');
+  define('CONTENT_EVENTS_CALENDER', 'events_calendar');
+  define('CONTENT_REVIEWS', 'reviews');
+  define('CONTENT_SHIPPING', 'shipping');
+  define('CONTENT_SHOPPING_CART', 'shopping_cart');
+  define('CONTENT_SPECIALS', 'specials');
+  define('CONTENT_SSL_CHECK', 'ssl_check');
+  define('CONTENT_TELL_A_FRIEND', 'tell_a_friend');
+  define('CONTENT_UPCOMING_PRODUCTS', 'upcoming_products');
+  define('CONTENT_CHECKOUT_PROCESS', 'checkout_process');
+
+// Lango added for GV FAQ: BOF
+  define('CONTENT_GV_FAQ', 'gv_faq');
+  define('CONTENT_GV_REDEEM', 'gv_redeem');
+  define('CONTENT_GV_SEND', 'gv_send');
+  define('CONTENT_GV_REDEEM_PROCESS', 'gv_redeem_process');
+  define('CONTENT_GV_SEND_PROCESS', 'gv_send_process');
+  define('CONTENT_POPUP_COUPON_HELP', 'popup_coupon_help');
+ 
+  define('FILENAME_GV_FAQ', CONTENT_GV_FAQ . '.php');
+  define('FILENAME_GV_REDEEM', CONTENT_GV_REDEEM . '.php');
+  define('FILENAME_GV_SEND', CONTENT_GV_SEND . '.php');
+  define('FILENAME_GV_REDEEM_PROCESS', CONTENT_GV_REDEEM_PROCESS . 'php');
+  define('FILENAME_GV_SEND_PROCESS', CONTENT_GV_SEND_PROCESS . 'php');
+  define('FILENAME_POPUP_COUPON_HELP', CONTENT_POPUP_COUPON_HELP . '.php');
+
+// Lango Added for Down for Maintainance Mod: BOF
+  define('CONTENT_DOWN_FOR_MAINTAINANCE', 'down_for_maintenance');
+// Lango Added for Down for Maintainance Mod: EOF
+
+// Lango added forALL_PRODS: BOF
+  define('CONTENT_ALL_PRODS', 'allprods');
+
+define('CONTENT_ALL_PRODCATS', 'all_prodcats');   // all products and used categories
+define('FILENAME_ALL_PRODCATS', 'all_prodcats.php');   // all products and used categories
+
+define('CONTENT_ALL_PRODMANF', 'all_prodmanf');   // all products and used categories
+define('FILENAME_ALL_PRODMANF', 'all_prodmanf.php');   // all products and used categories
+
+// Lango added forALL_PRODS: EOF
+
+// Lango added for osC-PrintOrder v1.0: BOF
+  define('CONTENT_ORDERS_PRINTABLE', 'printorder');
+// Lango added for osC-PrintOrder v1.0: EOF
+
+// Lango added for Featured products: BOF
+  define('CONTENT_FEATURED', 'featured');
+  define('CONTENT_FEATURED_PRODUCTS', 'featured_products');
+  
+// Lango added for Featured products: EOF
+
+// Lango Added for WishList Mod: BOF
+  define('CONTENT_WISHLIST_SEND', 'wishlist_email');
+  define('CONTENT_WISHLIST_HELP', 'wishlist_help');
+  define('CONTENT_WISHLIST', 'wishlist');
+
+// Lango Added for WishList Mod: EOF
+// Lango Added for Links Manager Mod: BOF
+  define('CONTENT_LINKS', 'links');
+  define('CONTENT_LINKS_SUBMIT', 'links_submit');
+  define('CONTENT_LINKS_SUBMIT_SUCCESS', 'links_submit_success');
+// Lango Added for Links Manager Mod:
+
+  define('FILENAME_FEATURED', 'featured.php');
+  define('FILENAME_FEATURED_PRODUCTS', 'featured_products.php'); // This is the featured products page
+
+
+  define('FILENAME_LANGUAGES', 'languages.php');
+
+// Lango Added for shop by price Mod: BOF
+  define('CONTENT_SHOP_BY_PRICE', 'shop_by_price');
+// Lango Added for shop by price Mod: EOF
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  define('CONTENT_INFORMATION', 'information');
+//DWD Modify End
+
+// define the filenames used in the project
+  define('FILENAME_ACCOUNT', CONTENT_ACCOUNT . '.php');
+  define('FILENAME_ACCOUNT_EDIT', CONTENT_ACCOUNT_EDIT . '.php');
+  define('FILENAME_ACCOUNT_HISTORY', CONTENT_ACCOUNT_HISTORY . '.php');
+  define('FILENAME_ACCOUNT_HISTORY_INFO', CONTENT_ACCOUNT_HISTORY_INFO . '.php');
+  define('FILENAME_ACCOUNT_NEWSLETTERS', CONTENT_ACCOUNT_NEWSLETTERS . '.php');
+  define('FILENAME_ACCOUNT_NOTIFICATIONS', CONTENT_ACCOUNT_NOTIFICATIONS . '.php');
+  define('FILENAME_ACCOUNT_PASSWORD', CONTENT_ACCOUNT_PASSWORD . '.php');
+  define('FILENAME_ADDRESS_BOOK', CONTENT_ADDRESS_BOOK . '.php');
+  define('FILENAME_ADDRESS_BOOK_PROCESS', CONTENT_ADDRESS_BOOK_PROCESS . '.php');
+  define('FILENAME_ADVANCED_SEARCH', CONTENT_ADVANCED_SEARCH . '.php');
+  define('FILENAME_ADVANCED_SEARCH_RESULT', CONTENT_ADVANCED_SEARCH_RESULT . '.php');
+  define('FILENAME_ALSO_PURCHASED_PRODUCTS', CONTENT_ALSO_PURCHASED_PRODUCTS . '.php');
+  define('FILENAME_CHECKOUT_CONFIRMATION', CONTENT_CHECKOUT_CONFIRMATION . '.php');
+  define('FILENAME_CHECKOUT_PAYMENT', CONTENT_CHECKOUT_PAYMENT . '.php');
+  define('FILENAME_CHECKOUT_PAYMENT_ADDRESS', CONTENT_CHECKOUT_PAYMENT_ADDRESS . '.php');
+  define('FILENAME_CHECKOUT_PROCESS', CONTENT_CHECKOUT_PROCESS . '.php');
+  define('FILENAME_CHECKOUT_SHIPPING', CONTENT_CHECKOUT_SHIPPING . '.php');
+  define('FILENAME_CHECKOUT_SHIPPING_ADDRESS', CONTENT_CHECKOUT_SHIPPING_ADDRESS . '.php');
+  define('FILENAME_CHECKOUT_SUCCESS', CONTENT_CHECKOUT_SUCCESS . '.php');
+  define('FILENAME_CONTACT_US', CONTENT_CONTACT_US . '.php');
+  define('FILENAME_CONDITIONS', CONTENT_CONDITIONS . '.php');
+  define('FILENAME_COOKIE_USAGE', CONTENT_COOKIE_USAGE . '.php');
+  define('FILENAME_CREATE_ACCOUNT', CONTENT_CREATE_ACCOUNT . '.php');
+  define('FILENAME_CREATE_ACCOUNT_SUCCESS', CONTENT_CREATE_ACCOUNT_SUCCESS . '.php');
+  define('FILENAME_DEFAULT', 'index.php');
+  define('FILENAME_DEFAULT_SPECIALS', 'default_specials.php');
+  define('FILENAME_DOWNLOAD', CONTENT_DOWNLOAD . '.php');
+  define('FILENAME_INFO_SHOPPING_CART', CONTENT_INFO_SHOPPING_CART . '.php');
+  define('FILENAME_LOGIN', CONTENT_LOGIN . '.php');
+  define('FILENAME_LOGOFF', CONTENT_LOGOFF . '.php');
+  define('FILENAME_NEW_PRODUCTS', CONTENT_NEW_PRODUCTS . '.php');
+  define('FILENAME_PASSWORD_FORGOTTEN', CONTENT_PASSWORD_FORGOTTEN . '.php');
+  define('FILENAME_POPUP_IMAGE', CONTENT_POPUP_IMAGE . '.php');
+  define('FILENAME_POPUP_SEARCH_HELP', CONTENT_POPUP_SEARCH_HELP . '.php');
+  define('FILENAME_PRIVACY', CONTENT_PRIVACY . '.php');
+  define('FILENAME_PRODUCT_REVIEWS', CONTENT_PRODUCT_REVIEWS . '.php');
+  define('FILENAME_PRODUCT_REVIEWS_INFO', CONTENT_PRODUCT_REVIEWS_INFO . '.php');
+  define('FILENAME_PRODUCT_REVIEWS_WRITE', CONTENT_PRODUCT_REVIEWS_WRITE . '.php');
+  define('FILENAME_PRODUCTS_NEW', CONTENT_PRODUCTS_NEW . '.php');
+  define('FILENAME_REDIRECT', 'redirect.php');
+  define('FILENAME_REVIEWS', CONTENT_REVIEWS . '.php');
+  define('FILENAME_EVENTS_CALENDER', CONTENT_EVENTS_CALENDER . '.php?view=all_events');
+  define('FILENAME_SHIPPING', CONTENT_SHIPPING . '.php');
+  define('FILENAME_SHOPPING_CART', CONTENT_SHOPPING_CART . '.php');
+  define('FILENAME_SPECIALS', CONTENT_SPECIALS . '.php');
+  define('FILENAME_SSL_CHECK', CONTENT_SSL_CHECK . '.php');
+  define('FILENAME_TELL_A_FRIEND', CONTENT_TELL_A_FRIEND . '.php');
+  define('FILENAME_UPCOMING_PRODUCTS', CONTENT_UPCOMING_PRODUCTS . '.php');
+  define('FILENAME_CHECKOUT_PAYPALIPN', 'checkout_paypalipn.php'); // PAYPALIPN
+//begin PayPal_Shopping_Cart_IPN
+  define('FILENAME_PAYPAL', 'paypal.php');
+//end PayPal_Shopping_Cart_IPN
+// Added for Xsell Products Mod
+  define('FILENAME_XSELL_PRODUCTS', 'xsell_products_buynow.php');
+  define('FILENAME_PRODUCT_LISTING_COL', 'product_listing_col.php');
+  define('FILENAME_XSELL_PRODUCTS_BUYNOW', 'xsell_products_buynow.php');
+
+//BEGIN allprods modification
+define('FILENAME_ALLPRODS', 'allprods.php');
+//END allprods modification
+
+// Lango Added for GV: BOF
+  define('FILENAME_GV_FAQ', CONTENT_GV_FAQ . '.php');
+  define('FILENAME_GV_REDEEM', CONTENT_GV_REDEEM . '.php');
+  define('FILENAME_GV_SEND', CONTENT_GV_SEND . '.php');
+
+// MaxiDVD Added Line For WYSIWYG HTML Area: BOF
+  define('FILENAME_DEFINE_MAINPAGE', 'mainpage.php');
+// MaxiDVD Added Line For WYSIWYG HTML Area: EOF
+
+// Lango Added for ALL_PODS Mod: BOF
+  define('FILENAME_ALL_PRODS', CONTENT_ALL_PRODS . '.php');
+// Lango Added for ALL_PRODS Mod: EOF
+
+// Lango Added for ALL_PODS Mod: BOF
+  define('FILENAME_ORDERS_PRINTABLE', CONTENT_ORDERS_PRINTABLE . '.php');
+// Lango Added for ALL_PRODS Mod: EOF
+
+// Lango Added for Featured Products: BOF
+  define('FILENAME_FEATURED', CONTENT_FEATURED . '.php');
+  define('FILENAME_FEATURED_PRODUCTS', CONTENT_FEATURED_PRODUCTS . '.php');
+// Lango Added for Featured Product: EOF
+
+// Lango Added for ALL_PODS Mod: BOF
+  define('FILENAME_POPUP_AFFILIATE_HELP', 'popup_affiliate_help.php');
+// Lango Added for ALL_PRODS Mod: EOF
+
+// Lango Added for WishList Mod: BOF
+  define('FILENAME_WISHLIST_SEND', CONTENT_WISHLIST_SEND . '.php');
+  define('FILENAME_WISHLIST_HELP', CONTENT_WISHLIST_HELP . '.php');
+  define('FILENAME_WISHLIST', CONTENT_WISHLIST . '.php');
+// Lango Added for WishList Mod: EOF
+
+// Lango Added for Links Manager Mod: BOF
+  define('FILENAME_LINKS', CONTENT_LINKS . '.php');
+  define('FILENAME_LINKS_SUBMIT', CONTENT_LINKS_SUBMIT . '.php');
+  define('FILENAME_LINKS_SUBMIT_SUCCESS', CONTENT_LINKS_SUBMIT_SUCCESS . '.php');
+  define('FILENAME_LINK_LISTING', 'link_listing.php');
+  define('FILENAME_POPUP_LINKS_HELP', 'popup_links_help.php');
+// Lango Added for Links Manager Mod: EOF
+
+// Lango Added for shop by price Mod: BOF
+  define('FILENAME_SHOP_BY_PRICE', CONTENT_SHOP_BY_PRICE . '.php');
+// Lango Added for shop by price Mod: EOF
+
+//Begin Checkout Without Account Modifications
+
+  define('CONTENT_ORDER_INFO', 'Order_Info');
+  define('FILENAME_ORDER_INFO', CONTENT_ORDER_INFO . '.php');
+  define('CONTENT_ORDER_INFO_PROCESS', 'Order_Info_Process');
+  define('FILENAME_ORDER_INFO_PROCESS', CONTENT_ORDER_INFO_PROCESS . '.php');
+  define('FILENAME_PWA_PWA_LOGIN', 'login_pwa.php');
+  define('FILENAME_PWA_ACC_LOGIN', 'login_acc.php');
+  define('FILENAME_CHECKOUT', 'Order_Info.php');
+
+// define the templatenames used in the project
+  define('TEMPLATENAME_BOX', 'box.tpl.php');
+  define('TEMPLATENAME_MAIN_PAGE', 'main_page.tpl.php');
+  define('TEMPLATENAME_POPUP', 'popup.tpl.php');
+  define('TEMPLATENAME_STATIC', 'static.tpl.php');
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  define('FILENAME_INFORMATION', CONTENT_INFORMATION . '.php');
+//DWD Modify End
+
+ define('FILENAME_POPUP_CVS_HELP', 'popup_cvs_help.php');
+ define('FILENAME_CVS_HELP', 'cvs_help.php');
+ 
+//product listing colum vs row fix
+ define('CONTENT_PRODUCT_LISTING', 'product_listing');
+ define('CONTENT_PRODUCT_LISTING_COL', 'product_listing_col');
+ define('FILENAME_PRODUCT_LISTING', CONTENT_PRODUCT_LISTING . '.php');
+ define('FILENAME_PRODUCT_LISTING_COL', CONTENT_PRODUCT_LISTING_COL . '.php');
+
+// define the filenames used for affiliates
+// Lango added for Affiliate Mod: BOF
+  define('CONTENT_AFFILIATE', 'affiliate_affiliate');
+  define('CONTENT_AFFILIATE_SIGNUP', 'affiliate_signup');
+  define('CONTENT_AFFILIATE_BANNERS', 'affiliate_banners');
+  define('CONTENT_AFFILIATE_SUMMARY', 'affiliate_summary');
+  define('CONTENT_AFFILIATE_DETAILS', 'affiliate_details');
+  define('CONTENT_AFFILIATE_CLICKS', 'affiliate_clicks');
+  define('CONTENT_AFFILIATE_CONTACT', 'affiliate_contact');
+  define('CONTENT_AFFILIATE_PAYMENT', 'affiliate_payment');
+  define('CONTENT_AFFILIATE_FAQ', 'affiliate_faq');
+  define('CONTENT_AFFILIATE_INFO', 'affiliate_info');
+  define('CONTENT_AFFILIATE_LOGOUT', 'affiliate_logout');
+  define('CONTENT_AFFILIATE_TERMS', 'affiliate_terms');
+  define('CONTENT_AFFILIATE_PASSWORD_FORGOTTEN', 'affiliate_password_forgotten');
+  define('CONTENT_AFFILIATE_SIGNUP_OK', 'affiliate_signup_ok');
+
+// Lango added for Affiliate Mod: BOF
+  define('FILENAME_AFFILIATE', CONTENT_AFFILIATE . '.php');
+  define('FILENAME_AFFILIATE_SIGNUP', CONTENT_AFFILIATE_SIGNUP . '.php');
+  define('FILENAME_AFFILIATE_BANNERS', CONTENT_AFFILIATE_BANNERS . '.php');
+  define('FILENAME_AFFILIATE_SUMMARY', CONTENT_AFFILIATE_SUMMARY . '.php');
+  define('FILENAME_AFFILIATE_DETAILS', CONTENT_AFFILIATE_DETAILS . '.php');
+  define('FILENAME_AFFILIATE_CLICKS', CONTENT_AFFILIATE_CLICKS . '.php');
+  define('FILENAME_AFFILIATE_CONTACT', CONTENT_AFFILIATE_CONTACT . '.php');
+  define('FILENAME_AFFILIATE_PAYMENT', CONTENT_AFFILIATE_PAYMENT . '.php');
+  define('FILENAME_AFFILIATE_FAQ', CONTENT_AFFILIATE_FAQ . '.php');
+  define('FILENAME_AFFILIATE_INFO', CONTENT_AFFILIATE_INFO . '.php');
+  define('FILENAME_AFFILIATE_LOGOUT', CONTENT_AFFILIATE_LOGOUT . '.php');
+  define('FILENAME_AFFILIATE_TERMS', CONTENT_AFFILIATE_TERMS . '.php');
+  define('FILENAME_AFFILIATE_PASSWORD_FORGOTTEN', CONTENT_AFFILIATE_PASSWORD_FORGOTTEN . '.php');
+  define('FILENAME_AFFILIATE_SIGNUP_OK', CONTENT_AFFILIATE_SIGNUP_OK . '.php');
+ 
+  define('FILENAME_AFFILIATE_ACCOUNT', 'affiliate_details.php');
+  define('FILENAME_AFFILIATE_DETAILS_OK', 'affiliate_details_ok.php');
+  define('FILENAME_AFFILIATE_HELP_1', 'affiliate_help1.php');
+  define('FILENAME_AFFILIATE_HELP_2', 'affiliate_help2.php');
+  define('FILENAME_AFFILIATE_HELP_3', 'affiliate_help3.php');
+  define('FILENAME_AFFILIATE_HELP_4', 'affiliate_help4.php');
+  define('FILENAME_AFFILIATE_HELP_5', 'affiliate_help5.php');
+  define('FILENAME_AFFILIATE_HELP_6', 'affiliate_help6.php');
+  define('FILENAME_AFFILIATE_HELP_7', 'affiliate_help7.php');
+  define('FILENAME_AFFILIATE_HELP_8', 'affiliate_help8.php');
+  define('FILENAME_AFFILIATE_INFO', 'affiliate_info.php');
+  define('FILENAME_AFFILIATE_SHOW_BANNER', 'affiliate_show_banner.php');
+  define('FILENAME_AFFILIATE_CLICKS', 'affiliate_clicks.php');
+  define('FILENAME_AFFILIATE_SALES', 'affiliate_sales.php');
+  define('FILENAME_AFFILIATE_SIGNUP', 'affiliate_signup.php');
+
+ //events_calendar
+  define('CONTENT_EVENTS_CALENDAR', 'events_calendar');
+  define('CONTENT_EVENTS_CALENDAR_CONTENT', 'calendar_content');
+    
+  //FAQ Content
+  define('CONTENT_FAQ','faq');
+  
+  define('FILENAME_EVENTS_CALENDAR', CONTENT_EVENTS_CALENDAR . '.php');
+  define('FILENAME_EVENTS_CALENDAR_CONTENT', CONTENT_EVENTS_CALENDAR_CONTENT . '.php');
+  
+// Added for FAQ System 2.1 DMG
+  define('FILENAME_FAQ','faq.php');
+  
+//added for Article Manager
+  define('CONTENT_ARTICLE_INFO', 'article_info');
+  define('CONTENT_ARTICLE_LISTING', 'article_listing');
+  define('CONTENT_ARTICLE_REVIEWS', 'article_reviews');
+  define('CONTENT_ARTICLE_REVIEWS_INFO', 'article_reviews_info');
+  define('CONTENT_ARTICLE_REVIEWS_WRITE', 'article_reviews_write');
+  define('CONTENT_ARTICLES', 'articles');
+  define('CONTENT_ARTICLES_NEW', 'articles_new');
+  define('CONTENT_ARTICLES_UPCOMING', 'articles_upcoming'); 
+  define('CONTENT_ARTICLES_XSELL', 'articles_xsell');
+  define('CONTENT_NEW_ARTICLES', 'new_articles');
+  define('CONTENT_ARTICLE_SEARCH', 'article_search');
+
+  define('FILENAME_ARTICLE_INFO', CONTENT_ARTICLE_INFO . '.php');
+  define('FILENAME_ARTICLE_LISTING', CONTENT_ARTICLE_LISTING . '.php');
+  define('FILENAME_ARTICLE_REVIEWS', CONTENT_ARTICLE_REVIEWS . '.php');
+  define('FILENAME_ARTICLE_REVIEWS_INFO', CONTENT_ARTICLE_REVIEWS_INFO . '.php');
+  define('FILENAME_ARTICLE_REVIEWS_WRITE', CONTENT_ARTICLE_REVIEWS_WRITE . '.php');
+  define('FILENAME_ARTICLES', CONTENT_ARTICLES . '.php');
+  define('FILENAME_ARTICLES_NEW', CONTENT_ARTICLES_NEW . '.php');
+  define('FILENAME_ARTICLES_UPCOMING', CONTENT_ARTICLES_UPCOMING . '.php'); 
+  define('FILENAME_ARTICLES_XSELL', CONTENT_ARTICLES_XSELL . '.php');
+  define('FILENAME_NEW_ARTICLES', CONTENT_NEW_ARTICLES . '.php');
+  define('FILENAME_ARTICLE_SEARCH',CONTENT_ARTICLE_SEARCH . '.php');
+
+ define('CONTENT_TELL_A_FRIEND_ARTICLE', 'tell_a_friend_article');
+ define('FILENAME_TELL_A_FRIEND_ARTICLE', CONTENT_TELL_A_FRIEND_ARTICLE . '.php');
+
+// VJ infosystem added
+  define('CONTENT_PAGES', 'pages');
+  define('FILENAME_PAGES', CONTENT_PAGES . '.php');
+
+#################    Starts - 15 June 2006    #################
+
+define('FILENAME_DOWNLOADBOX','downloadbox.php');
+define('FILENAME_INFORMATIONBOX','informationbox.php');
+define('FILENAME_LANGUAGE','language.php');
+define('FILENAME_LOGINBOX','loginbox.php');
+define('FILENAME_WHOS_ONLINEBOX','whos_onlinebox.php');
+define('FILENAME_COUNTER','counter.php');
+define('FILENAME_HEADER_TAGS','header_tags.php');
+define('FILENAME_WARNINGS','warnings.php');
+define('FILENAME_HEADER','header.php');
+define('FILENAME_COLUMN_LEFT','column_left.php');
+define('FILENAME_COLUMN_RIGHT','column_right.php');
+define('FILENAME_FOOTER','footer.php');
+define('FILENAME_LINKS_HTM','links.htm');
+
+#################    Ends - 15 June 2006    #################
+
+
+
+#################    Starts - 15 June 2006    #################
+
+define('FILENAME_SEARCH_IN_HEADER','search_in_header.php');
+define('FILENAME_LANGUAGES_IN_HEADER','languages_in_header.php');
+
+#################    Ends - 15 June 2006    #################
+
+
+#################    Starts - 19 June 2006    #################
+
+define('FILENAME_DOWNLOADS','downloads.php');
+define('FILENAME_ADDRESS_BOOK_DETAILS','address_book_details.php');
+define('FILENAME_AFFILIATE_ACCOUNT_DETAILS','affiliate_account_details.php');
+define('FILENAME_ADD_CHECKOUT_SUCCESS','add_checkout_success.php');
+define('FILENAME_ORDER_INFO_CHECK','Order_Info_Check.php');
+define('FILENAME_SHIPPING_ESTIMATOR','shipping_estimator.php');
+
+#################    Ends - 19 June 2006    #################
+
+
+#################    Starts - 20 June 2006    #################
+
+define('FILENAME_FREECHARGER', 'freecharger.php');
+
+define('FILENAME_ARTICLESS', 'articles.php');
+define('FILENAME_AUTHORS', 'authors.php');
+define('FILENAME_DOWNLOADS_CONTROLLER', 'downloads_controller.php');
+
+define('FILENAME_FORM_CHECK_JS', 'form_check.js.php');
+
+
+#################    Ends - 20 June 2006    #################
+
+?>

Added: trunk/direct.openmoko.com/includes/footer.php
===================================================================
--- trunk/direct.openmoko.com/includes/footer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/footer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: footer.php,v 1.1.1.1 2004/03/04 23:40:38 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//You will need to edit this file In the /templates/(template name)/
+
+//If it is used by the template you are using>
+?>

Added: trunk/direct.openmoko.com/includes/form_check.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/form_check.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/form_check.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,134 @@
+<?php
+/*
+  $Id: form_check.js.php,v 1.1.1.1 2004/03/04 23:40:38 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<script type="text/javascript"><!--
+var form = "";
+var submitted = false;
+var error = false;
+var error_message = "";
+
+function check_input(field_name, field_size, message) {
+  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
+    var field_value = form.elements[field_name].value;
+
+    if (field_value == '' || field_value.length < field_size) {
+      error_message = error_message + "* " + message + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_radio(field_name, message) {
+  var isChecked = false;
+
+  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
+    var radio = form.elements[field_name];
+
+    for (var i=0; i<radio.length; i++) {
+      if (radio[i].checked == true) {
+        isChecked = true;
+        break;
+      }
+    }
+
+    if (isChecked == false) {
+      error_message = error_message + "* " + message + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_select(field_name, field_default, message) {
+  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
+    var field_value = form.elements[field_name].value;
+
+    if (field_value == field_default) {
+      error_message = error_message + "* " + message + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_password(field_name_1, field_name_2, field_size, message_1, message_2) {
+  if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
+    var password = form.elements[field_name_1].value;
+    var confirmation = form.elements[field_name_2].value;
+
+    if (password == '' || password.length < field_size) {
+      error_message = error_message + "* " + message_1 + "\n";
+      error = true;
+    } else if (password != confirmation) {
+      error_message = error_message + "* " + message_2 + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_password_new(field_name_1, field_name_2, field_name_3, field_size, message_1, message_2, message_3) {
+  if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
+    var password_current = form.elements[field_name_1].value;
+    var password_new = form.elements[field_name_2].value;
+    var password_confirmation = form.elements[field_name_3].value;
+
+    if (password_current == '' || password_current.length < field_size) {
+      error_message = error_message + "* " + message_1 + "\n";
+      error = true;
+    } else if (password_new == '' || password_new.length < field_size) {
+      error_message = error_message + "* " + message_2 + "\n";
+      error = true;
+    } else if (password_new != password_confirmation) {
+      error_message = error_message + "* " + message_3 + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_form(form_name) {
+  if (submitted == true) {
+    alert("<?php echo JS_ERROR_SUBMITTED; ?>");
+    return false;
+  }
+
+  error = false;
+  form = form_name;
+  error_message = "<?php echo JS_ERROR; ?>";
+
+<?php if (ACCOUNT_GENDER == 'true') echo '  check_radio("gender", "' . ENTRY_GENDER_ERROR . '");' . "\n"; ?>
+
+  check_input("firstname", <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_FIRST_NAME_ERROR; ?>");
+  check_input("lastname", <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_LAST_NAME_ERROR; ?>");
+
+<?php if (ACCOUNT_DOB == 'true') echo '  check_input("dob", ' . ENTRY_DOB_MIN_LENGTH . ', "' . ENTRY_DATE_OF_BIRTH_ERROR . '");' . "\n"; ?>
+
+  check_input("email_address", <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_EMAIL_ADDRESS_ERROR; ?>");
+  check_input("street_address", <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_STREET_ADDRESS_ERROR; ?>");
+  check_input("postcode", <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>, "<?php echo ENTRY_POST_CODE_ERROR; ?>");
+  check_input("city", <?php echo ENTRY_CITY_MIN_LENGTH; ?>, "<?php echo ENTRY_CITY_ERROR; ?>");
+
+<?php if (ACCOUNT_STATE == 'true') echo '  check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '");' . "\n"; ?>
+
+  check_select("country", "", "<?php echo ENTRY_COUNTRY_ERROR; ?>");
+
+  check_input("telephone", <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>, "<?php echo ENTRY_TELEPHONE_NUMBER_ERROR; ?>");
+
+  check_password("password", "confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_ERROR_NOT_MATCHING; ?>");
+  check_password_new("password_current", "password_new", "password_confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING; ?>");
+
+  if (error == true) {
+    alert(error_message);
+    return false;
+  } else {
+    submitted = true;
+    return true;
+  }
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/functions/affiliate_functions.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/affiliate_functions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/affiliate_functions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+  $Id: affiliate_functions.php,v 1.1.1.1 2004/03/04 23:40:47 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function affiliate_check_url($url) {
+    return eregi("^https?://[a-z0-9]([-_.]?[a-z0-9])+[.][a-z0-9][a-z0-9/=?.&\~_-]+$",$url);
+  }
+
+  function affiliate_insert ($sql_data_array, $affiliate_parent = 0) {
+    // LOCK TABLES
+    tep_db_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE");
+    if ($affiliate_parent > 0) {
+      $affiliate_root_query = tep_db_query("select affiliate_root, affiliate_rgt, affiliate_lft from  " . TABLE_AFFILIATE . " where affiliate_id = '" . (int)$affiliate_parent . "' ");
+      // Check if we have a parent affiliate
+      if ($affiliate_root_array = tep_db_fetch_array($affiliate_root_query)) {
+        tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_lft = affiliate_lft + 2 WHERE affiliate_root  =  '" . $affiliate_root_array['affiliate_root'] . "' and  affiliate_lft > "  . $affiliate_root_array['affiliate_rgt'] . "  AND affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
+        tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_rgt = affiliate_rgt + 2 WHERE affiliate_root  =  '" . $affiliate_root_array['affiliate_root'] . "' and  affiliate_rgt >= "  . $affiliate_root_array['affiliate_rgt'] . "  ");
+
+
+        $sql_data_array['affiliate_root'] = $affiliate_root_array['affiliate_root'];
+        $sql_data_array['affiliate_lft'] = $affiliate_root_array['affiliate_rgt'];
+        $sql_data_array['affiliate_rgt'] = ($affiliate_root_array['affiliate_rgt'] + 1);
+        tep_db_perform(TABLE_AFFILIATE, $sql_data_array);
+        $affiliate_id = tep_db_insert_id();
+      }
+    // no parent -> new root
+    } else {
+      $sql_data_array['affiliate_lft'] = '1';
+      $sql_data_array['affiliate_rgt'] = '2';
+      tep_db_perform(TABLE_AFFILIATE, $sql_data_array);
+      $affiliate_id = tep_db_insert_id();
+      tep_db_query ("update " . TABLE_AFFILIATE . " set affiliate_root = '" . $affiliate_id . "' where affiliate_id = '" . $affiliate_id . "' ");
+    }
+    // UNLOCK TABLES
+    tep_db_query("UNLOCK TABLES");
+    return $affiliate_id;
+
+  }
+
+
+
+////
+// Compatibility to older Snapshots
+  if (!function_exists('tep_round')) {
+    function tep_round($value, $precision) {
+      if (PHP_VERSION < 4) {
+        $exp = pow(10, $precision);
+        return round($value * $exp) / $exp;
+      } else {
+        return round($value, $precision);
+      }
+    }
+  }
+
+////
+// Output a form
+  if (!function_exists('tep_draw_form')) {
+    function tep_draw_form($name, $action, $method = 'post', $parameters = '') {
+      $form = '<form name="' . tep_parse_input_field_data($name, array('"' => '&quot;')) . '" action="' . tep_parse_input_field_data($action, array('"' => '&quot;')) . '" method="' . tep_parse_input_field_data($method, array('"' => '&quot;')) . '"';
+
+      if (tep_not_null($parameters)) $form .= ' ' . $parameters;
+
+      $form .= '>';
+
+      return $form;
+    }
+  }
+
+////
+// This funstion validates a plain text password with an encrpyted password
+  if (!function_exists('tep_validate_password')) {
+    function tep_validate_password($plain, $encrypted) {
+      if (tep_not_null($plain) && tep_not_null($encrypted)) {
+// split apart the hash / salt
+        $stack = explode(':', $encrypted);
+
+        if (sizeof($stack) != 2) return false;
+
+        if (md5($stack[1] . $plain) == $stack[0]) {
+          return true;
+        }
+      }
+
+      return false;
+    }
+  }
+
+////
+// This function makes a new password from a plaintext password.
+  if (!function_exists('tep_encrypt_password')) {
+    function tep_encrypt_password($plain) {
+      $password = '';
+
+      for ($i=0; $i<10; $i++) {
+        $password .= tep_rand();
+      }
+
+      $salt = substr(md5($password), 0, 2);
+
+      $password = md5($salt . $plain) . ':' . $salt;
+
+      return $password;
+    }
+  }
+
+////
+// Return a random value
+  if (!function_exists('tep_rand')) {
+    function tep_rand($min = null, $max = null) {
+      static $seeded;
+
+      if (!isset($seeded)) {
+        mt_srand((double)microtime()*1000000);
+        $seeded = true;
+      }
+
+      if (isset($min) && isset($max)) {
+        if ($min >= $max) {
+          return $min;
+        } else {
+          return mt_rand($min, $max);
+        }
+      } else {
+        return mt_rand();
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/article_header_tags.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/article_header_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/article_header_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+/*
+  $Id: article_header_tags.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// Modification of Header Tags Contribution
+// WebMakers.com Added: Header Tags Generator v2.0 
+
+////
+// Get articles_head_title_tag
+// TABLES: articles_description
+function tep_get_header_tag_articles_title($article_id) {
+  global $languages_id, $HTTP_GET_VARS; 
+
+  $article_header_tags = tep_db_query("select articles_head_title_tag from " . TABLE_ARTICLES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "' and articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "'");
+  $article_header_tags_values = tep_db_fetch_array($article_header_tags);
+
+  return clean_html_comments($article_header_tags_values['articles_head_title_tag']);
+  }
+
+
+////
+// Get articles_head_keywords_tag
+// TABLES: articles_description
+function tep_get_header_tag_articles_keywords($article_id) {
+  global $languages_id, $HTTP_GET_VARS; 
+
+  $article_header_tags = tep_db_query("select articles_head_keywords_tag from " . TABLE_ARTICLES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "' and articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "'");
+  $article_header_tags_values = tep_db_fetch_array($article_header_tags);
+
+  return $article_header_tags_values['articles_head_keywords_tag'];
+  }
+
+
+////
+// Get articles_head_desc_tag
+// TABLES: articles_description
+function tep_get_header_tag_articles_desc($article_id) {
+  global $languages_id, $HTTP_GET_VARS; 
+
+  $article_header_tags = tep_db_query("select articles_head_desc_tag from " . TABLE_ARTICLES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "' and articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "'");
+  $article_header_tags_values = tep_db_fetch_array($article_header_tags);
+
+  return $article_header_tags_values['articles_head_desc_tag'];
+  }
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/functions/articles.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,248 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// Parse and secure the tPath parameter values
+  function tep_parse_topic_path($tPath) {
+    // make sure the topic IDs are integers
+    $tPath_array = array_map('tep_string_to_int', explode('_', $tPath));
+
+// make sure no duplicate topic IDs exist which could lock the server in a loop
+    $tmp_array = array();
+    $n = sizeof($tPath_array);
+    for ($i=0; $i<$n; $i++) {
+      if (!in_array($tPath_array[$i], $tmp_array)) {
+        $tmp_array[] = $tPath_array[$i];
+      }
+    }
+
+    return $tmp_array;
+  }
+
+////
+// Generate a path to topics
+// TABLES: topics
+  function tep_get_topic_path($current_topic_id = '') {
+    global $tPath_array;
+
+    if (tep_not_null($current_topic_id)) {
+      $cp_size = sizeof($tPath_array);
+      if ($cp_size == 0) {
+        $tPath_new = $current_topic_id;
+      } else {
+        $tPath_new = '';
+        $last_topic_query = tep_db_query("select parent_id from " . TABLE_TOPICS . " where topics_id = '" . (int)$tPath_array[($cp_size-1)] . "'");
+        $last_topic = tep_db_fetch_array($last_topic_query);
+
+        $current_topic_query = tep_db_query("select parent_id from " . TABLE_TOPICS . " where topics_id = '" . (int)$current_topic_id . "'");
+        $current_topic = tep_db_fetch_array($current_topic_query);
+
+        if ($last_topic['parent_id'] == $current_topic['parent_id']) {
+          for ($i=0; $i<($cp_size-1); $i++) {
+            $tPath_new .= '_' . $tPath_array[$i];
+          }
+        } else {
+          for ($i=0; $i<$cp_size; $i++) {
+            $tPath_new .= '_' . $tPath_array[$i];
+          }
+        }
+        $tPath_new .= '_' . $current_topic_id;
+
+        if (substr($tPath_new, 0, 1) == '_') {
+          $tPath_new = substr($tPath_new, 1);
+        }
+      }
+    } else {
+      $tPath_new = implode('_', $tPath_array);
+    }
+
+    return 'tPath=' . $tPath_new;
+  }
+
+////
+// Return the number of articles in a topic
+// TABLES: articles, articles_to_topics, topics
+  function tep_count_articles_in_topic($topic_id, $include_inactive = false) {
+    $articles_count = 0;
+    if ($include_inactive == true) {
+      $articles_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a2t.topics_id = '" . (int)$topic_id . "'");
+    } else {
+      $articles_query = tep_db_query("select count(*) as total from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a2t.topics_id = '" . (int)$topic_id . "'");
+    }
+    $articles = tep_db_fetch_array($articles_query);
+    $articles_count += $articles['total'];
+
+    $child_topics_query = tep_db_query("select topics_id from " . TABLE_TOPICS . " where parent_id = '" . (int)$topic_id . "'");
+    if (tep_db_num_rows($child_topics_query)) {
+      while ($child_topics = tep_db_fetch_array($child_topics_query)) {
+        $articles_count += tep_count_articles_in_topic($child_topics['topics_id'], $include_inactive);
+      }
+    }
+
+    return $articles_count;
+  }
+
+////
+// Return true if the topic has subtopics
+// TABLES: topics
+  function tep_has_topic_subtopics($topic_id) {
+    $child_topic_query = tep_db_query("select count(*) as count from " . TABLE_TOPICS . " where parent_id = '" . (int)$topic_id . "'");
+    $child_topic = tep_db_fetch_array($child_topic_query);
+
+    if ($child_topic['count'] > 0) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+////
+// Return all topics
+// TABLES: topics, topic_descriptions
+  function tep_get_topics($topics_array = '', $parent_id = '0', $indent = '') {
+    global $languages_id;
+
+    if (!is_array($topics_array)) $topics_array = array();
+
+    $topics_query = tep_db_query("select t.topics_id, td.topics_name from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where parent_id = '" . (int)$parent_id . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+    while ($topics = tep_db_fetch_array($topics_query)) {
+      $topics_array[] = array('id' => $topics['topics_id'],
+                                  'text' => $indent . $topics['topics_name']);
+
+      if ($topics['topics_id'] != $parent_id) {
+        $topics_array = tep_get_topics($topics_array, $topics['topics_id'], $indent . '&nbsp;&nbsp;');
+      }
+    }
+
+    return $topics_array;
+  }
+
+////
+// Return all authors
+// TABLES: authors
+  function tep_get_authors($authors_array = '') {
+    if (!is_array($authors_array)) $authors_array = array();
+
+    $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name");
+    while ($authors = tep_db_fetch_array($authors_query)) {
+      $authors_array[] = array('id' => $authors['authors_id'], 'text' => $authors['authors_name']);
+    }
+
+    return $authors_array;
+  }
+
+////
+// Return all subtopic IDs
+// TABLES: topics
+  function tep_get_subtopics(&$subtopics_array, $parent_id = 0) {
+    $subtopics_query = tep_db_query("select topics_id from " . TABLE_TOPICS . " where parent_id = '" . (int)$parent_id . "'");
+    while ($subtopics = tep_db_fetch_array($subtopics_query)) {
+      $subtopics_array[sizeof($subtopics_array)] = $subtopics['topics_id'];
+      if ($subtopics['topics_id'] != $parent_id) {
+        tep_get_subtopics($subtopics_array, $subtopics['topics_id']);
+      }
+    }
+  }
+
+////
+// Recursively go through the topics and retreive all parent topic IDs
+// TABLES: topics
+  function tep_get_parent_topics(&$topics, $topics_id) {
+    $parent_topics_query = tep_db_query("select parent_id from " . TABLE_TOPICS . " where topics_id = '" . (int)$topics_id . "'");
+    while ($parent_topics = tep_db_fetch_array($parent_topics_query)) {
+      if ($parent_topics['parent_id'] == 0) return true;
+      $topics[sizeof($topics)] = $parent_topics['parent_id'];
+      if ($parent_topics['parent_id'] != $topics_id) {
+        tep_get_parent_topics($topics, $parent_topics['parent_id']);
+      }
+    }
+  }
+
+////
+// Construct a topic path to the article
+// TABLES: articles_to_topics
+  function tep_get_article_path($articles_id) {
+    $tPath = '';
+
+    $topic_query = tep_db_query("select a2t.topics_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t where a.articles_id = '" . (int)$articles_id . "' and a.articles_status = '1' and a.articles_id = a2t.articles_id limit 1");
+    if (tep_db_num_rows($topic_query)) {
+      $topic = tep_db_fetch_array($topic_query);
+
+      $topics = array();
+      tep_get_parent_topics($topics, $topic['topics_id']);
+
+      $topics = array_reverse($topics);
+
+      $tPath = implode('_', $topics);
+
+      if (tep_not_null($tPath)) $tPath .= '_';
+      $tPath .= $topic['topics_id'];
+    }
+
+    return $tPath;
+  }
+
+////
+// Return an article's name
+// TABLES: articles
+  function tep_get_articles_name($article_id, $language = '') {
+    global $languages_id;
+
+    if (empty($language)) $language = $languages_id;
+
+    $article_query = tep_db_query("select articles_name from " . TABLE_ARTICLES_DESCRIPTION . " where articles_id = '" . (int)$article_id . "' and language_id = '" . (int)$language . "'");
+    $article = tep_db_fetch_array($article_query);
+
+    return $article['articles_name'];
+  }
+
+////
+//! Cache the articles box
+// Cache the articles box
+  function tep_cache_topics_box($auto_expire = false, $refresh = false) {
+    global $tPath, $language, $languages_id, $tree, $tPath_array, $topics_string;
+
+    if (($refresh == true) || !read_cache($cache_output, 'topics_box-' . $language . '.cache' . $tPath, $auto_expire)) {
+      ob_start();
+    //  include(DIR_WS_BOXES . 'articles.php');
+      include(DIR_WS_BOXES . FILENAME_ARTICLESS);
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'topics_box-' . $language . '.cache' . $tPath);
+    }
+
+    return $cache_output;
+  }
+
+////
+//! Cache the authors box
+// Cache the authors box
+  function tep_cache_authors_box($auto_expire = false, $refresh = false) {
+    global $HTTP_GET_VARS, $language;
+
+    $authors_id = '';
+    if (isset($HTTP_GET_VARS['authors_id']) && tep_not_null($HTTP_GET_VARS['authors_id'])) {
+      $authors_id = (int)$HTTP_GET_VARS['authors_id'];
+    }
+
+    if (($refresh == true) || !read_cache($cache_output, 'authors_box-' . $language . '.cache' . $authors_id, $auto_expire)) {
+      ob_start();
+      //include(DIR_WS_BOXES . 'authors.php');
+      include(DIR_WS_BOXES . FILENAME_AUTHORS);
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'authors_box-' . $language . '.cache' . $authors_id);
+    }
+
+    return $cache_output;
+  }
+
+?>

Added: trunk/direct.openmoko.com/includes/functions/banner.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/banner.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/banner.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,128 @@
+<?php
+/*
+  $Id: banner.php,v 1.1.1.1 2004/03/04 23:40:48 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// Sets the status of a banner
+  function tep_set_banner_status($banners_id, $status) {
+    if ($status == '1') {
+      return tep_db_query("update " . TABLE_BANNERS . " set status = '1', date_status_change = now(), date_scheduled = NULL where banners_id = '" . (int)$banners_id . "'");
+    } elseif ($status == '0') {
+      return tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_status_change = now() where banners_id = '" . (int)$banners_id . "'");
+    } else {
+      return -1;
+    }
+  }
+
+////
+// Auto activate banners
+  function tep_activate_banners() {
+    $banners_query = tep_db_query("select banners_id, date_scheduled from " . TABLE_BANNERS . " where date_scheduled != ''");
+    if (tep_db_num_rows($banners_query)) {
+      while ($banners = tep_db_fetch_array($banners_query)) {
+        if (date('Y-m-d H:i:s') >= $banners['date_scheduled']) {
+          tep_set_banner_status($banners['banners_id'], '1');
+        }
+      }
+    }
+  }
+
+////
+// Auto expire banners
+  function tep_expire_banners() {
+    $banners_query = tep_db_query("select b.banners_id, b.expires_date, b.expires_impressions, sum(bh.banners_shown) as banners_shown from " . TABLE_BANNERS . " b, " . TABLE_BANNERS_HISTORY . " bh where b.status = '1' and b.banners_id = bh.banners_id group by b.banners_id");
+    if (tep_db_num_rows($banners_query)) {
+      while ($banners = tep_db_fetch_array($banners_query)) {
+        if (tep_not_null($banners['expires_date'])) {
+          if (date('Y-m-d H:i:s') >= $banners['expires_date']) {
+            tep_set_banner_status($banners['banners_id'], '0');
+          }
+        } elseif (tep_not_null($banners['expires_impressions'])) {
+          if ( ($banners['expires_impressions'] > 0) && ($banners['banners_shown'] >= $banners['expires_impressions']) ) {
+            tep_set_banner_status($banners['banners_id'], '0');
+          }
+        }
+      }
+    }
+  }
+
+////
+// Display a banner from the specified group or banner id ($identifier)
+  function tep_display_banner($action, $identifier) {
+    if ($action == 'dynamic') {
+      $banners_query = tep_db_query("select count(*) as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
+      $banners = tep_db_fetch_array($banners_query);
+      if ($banners['count'] > 0) {
+        $banner = tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
+      } else {
+        //return '<b>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</b>';
+        return NO_BANNER_WITH_GROUP_ERROR1.' (tep_display_banner(' . $action . ', ' . $identifier . ') -> '.NO_BANNER_WITH_GROUP_ERROR2 .' \'' . $identifier . '\' '.NO_BANNER_WITH_GROUP_ERROR3;
+      }
+    } elseif ($action == 'static') {
+      if (is_array($identifier)) {
+        $banner = $identifier;
+      } else {
+        $banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int)$identifier . "'");
+        if (tep_db_num_rows($banner_query)) {
+          $banner = tep_db_fetch_array($banner_query);
+        } else {
+          //return '<b>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Banner with ID \'' . $identifier . '\' not found, or status inactive</b>';
+          return NO_BANNER_WITH_ID_ERROR1.' (tep_display_banner(' . $action . ', ' . $identifier . ') -> '.NO_BANNER_WITH_ID_ERROR2.' \'' . $identifier . '\' '.NO_BANNER_WITH_ID_ERROR3;
+        }
+      }
+    } else {
+      //return '<b>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'</b>';
+      return NO_BANNER_WITH_UNKNOWN_PARAM_ERROR1.' (tep_display_banner(' . $action . ', ' . $identifier . ') -> '.NO_BANNER_WITH_UNKNOWN_PARAM_ERROR2.' $action '.NO_BANNER_WITH_UNKNOWN_PARAM_ERROR3.'\''.NO_BANNER_WITH_UNKNOWN_PARAM_ERROR4.'\' or \''.NO_BANNER_WITH_UNKNOWN_PARAM_ERROR5.'\'</b>';
+    }
+
+    if (tep_not_null($banner['banners_html_text'])) {
+      $banner_string = $banner['banners_html_text'];
+    } else {
+      $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&amp;goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';
+    }
+
+    tep_update_banner_display_count($banner['banners_id']);
+
+    return $banner_string;
+  }
+
+////
+// Check to see if a banner exists
+  function tep_banner_exists($action, $identifier) {
+    if ($action == 'dynamic') {
+      return tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
+    } elseif ($action == 'static') {
+      $banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int)$identifier . "'");
+      return tep_db_fetch_array($banner_query);
+    } else {
+      return false;
+    }
+  }
+
+////
+// Update the banner display statistics
+  function tep_update_banner_display_count($banner_id) {
+    $banner_check_query = tep_db_query("select count(*) as count from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')");
+    $banner_check = tep_db_fetch_array($banner_check_query);
+
+    if ($banner_check['count'] > 0) {
+      tep_db_query("update " . TABLE_BANNERS_HISTORY . " set banners_shown = banners_shown + 1 where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')");
+    } else {
+      tep_db_query("insert into " . TABLE_BANNERS_HISTORY . " (banners_id, banners_shown, banners_history_date) values ('" . (int)$banner_id . "', 1, now())");
+    }
+  }
+
+////
+// Update the banner click statistics
+  function tep_update_banner_click_count($banner_id) {
+    tep_db_query("update " . TABLE_BANNERS_HISTORY . " set banners_clicked = banners_clicked + 1 where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')");
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/cache.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/cache.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/cache.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,346 @@
+<?php
+/*
+  $Id: cache.php,v 1.1.1.1 2004/03/04 23:40:48 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+//! Write out serialized data.
+//  write_cache uses serialize() to store $var in $filename.
+//  $var      -  The variable to be written out.
+//  $filename -  The name of the file to write to.
+  function write_cache(&$var, $filename) {
+    $filename = DIR_FS_CATALOG . DIR_FS_CACHE . $filename;
+    $success = false;
+
+// try to open the file
+    if ($fp = @fopen($filename, 'w')) {
+// obtain a file lock to stop corruptions occuring
+      flock($fp, 2); // LOCK_EX
+// write serialized data
+      fputs($fp, serialize($var));
+// release the file lock
+      flock($fp, 3); // LOCK_UN
+      fclose($fp);
+      $success = true;
+    }
+
+    return $success;
+  }
+
+////
+//! Read in seralized data.
+//  read_cache reads the serialized data in $filename and
+//  fills $var using unserialize().
+//  $var      -  The variable to be filled.
+//  $filename -  The name of the file to read.
+  function read_cache(&$var, $filename, $auto_expire = false){
+    $filename = DIR_FS_CATALOG . DIR_FS_CACHE . $filename;
+    $success = false;
+
+    if (($auto_expire == true) && file_exists($filename)) {
+      $now = time();
+      $filetime = filemtime($filename);
+      $difference = $now - $filetime;
+
+      if ($difference >= $auto_expire) {
+        return false;
+      }
+    }
+
+// try to open file
+    if ($fp = @fopen($filename, 'r')) {
+// read in serialized data
+      $szdata = fread($fp, filesize($filename));
+      fclose($fp);
+// unserialze the data
+      $var = unserialize($szdata);
+
+      $success = true;
+    }
+
+    return $success;
+  }
+
+////
+//! Get data from the cache or the database.
+//  get_db_cache checks the cache for cached SQL data in $filename
+//  or retreives it from the database is the cache is not present.
+//  $SQL      -  The SQL query to exectue if needed.
+//  $filename -  The name of the cache file.
+//  $var      -  The variable to be filled.
+//  $refresh  -  Optional.  If true, do not read from the cache.
+  function get_db_cache($sql, &$var, $filename, $refresh = false){
+    $var = array();
+
+// check for the refresh flag and try to the data
+    if (($refresh == true)|| !read_cache($var, $filename)) {
+// Didn' get cache so go to the database.
+//      $conn = mysql_connect("localhost", "apachecon", "apachecon");
+      $res = tep_db_query($sql);
+//      if ($err = mysql_error()) trigger_error($err, E_USER_ERROR);
+// loop through the results and add them to an array
+      while ($rec = tep_db_fetch_array($res)) {
+        $var[] = $rec;
+      }
+// write the data to the file
+      write_cache($var, $filename);
+    }
+  }
+
+////
+// Cache the categories box
+  function tep_cache_coolmenu($auto_expire = false, $refresh = false) {
+    global $cPath, $language, $languages_id, $tree, $cPath_array, $categories_string, $foo, $id, $aa;
+
+    if (($refresh == true) || !read_cache($cache_output, 'tep_cache_coolmenu-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath, $auto_expire)) {
+
+//get default template name
+  $customer_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate1 = tep_db_fetch_array($customer_template_query);
+
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+ //set all possible catagories X.php names    
+     ob_start();
+       include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/coolmenu.php');
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'coolmenu-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath);
+    }
+
+    return $cache_output;
+  }
+
+////
+// Cache the categories box
+  function tep_cache_categories_box($auto_expire = false, $refresh = false) {
+    global $cPath, $language, $languages_id, $tree, $cPath_array, $categories_string, $foo, $id, $aa;
+
+    if (($refresh == true) || !read_cache($cache_output, 'categories_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath, $auto_expire)) {
+
+//get default template name
+  $customer_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate1 = tep_db_fetch_array($customer_template_query);
+
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+ //set all possible catagories X.php names    
+     ob_start();
+       include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/categories.php');
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'categories_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath);
+    }
+
+    return $cache_output;
+  }
+
+////
+// Cache the categories box1
+function tep_cache_categories_box1($auto_expire = false, $refresh = false) {
+    global $cPath, $language, $languages_id, $tree, $cPath_array, $categories_string1, $foo, $id, $aa;
+
+    if (($refresh == true) || !read_cache($cache_output, 'categories1_box-' . TEMPLATE_NAME . '.' . $language . '.cache' . $cPath, $auto_expire)) {
+
+//get default template name
+  $customer_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate1 = tep_db_fetch_array($customer_template_query);
+
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+ //set all possible catagories X.php names    
+     ob_start();
+       include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/categories1.php');
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'categories1_box-' . TEMPLATE_NAME . '.' . $language . '.cache' . $cPath);
+    }
+
+    return $cache_output;
+  }
+////
+// Cache the categories box
+  function tep_cache_categories_box2($auto_expire = false, $refresh = false) {
+    global $cPath, $language, $languages_id, $tree, $cPath_array, $categories_string, $foo, $id, $aa;
+
+    if (($refresh == true) || !read_cache($cache_output, 'categories2_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath, $auto_expire)) {
+
+//get default template name
+  $customer_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate1 = tep_db_fetch_array($customer_template_query);
+
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+ //set all possible catagories X.php names    
+     ob_start();
+       include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/categories2.php');
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'categories2_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath);
+    }
+
+    return $cache_output;
+  }
+////
+// Cache the categories box
+  function tep_cache_categories_box3($auto_expire = false, $refresh = false) {
+    global $cPath, $language, $languages_id, $tree, $cPath_array, $categories_string, $foo, $id, $aa;
+
+    if (($refresh == true) || !read_cache($cache_output, 'categories3_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath, $auto_expire)) {
+
+//get default template name
+  $customer_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate1 = tep_db_fetch_array($customer_template_query);
+
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+ //set all possible catagories X.php names    
+     ob_start();
+       include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/categories3.php');
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'categories3_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath);
+    }
+
+    return $cache_output;
+  }
+
+////
+// Cache the categories box4
+function tep_cache_categories_box4($auto_expire = false, $refresh = false) {
+    global $cPath, $language, $languages_id, $tree, $cPath_array, $categories_string4, $foo, $id, $aa;
+
+    if (($refresh == true) || !read_cache($cache_output, 'categories4_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath, $auto_expire)) {
+
+//get default template name
+  $customer_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate1 = tep_db_fetch_array($customer_template_query);
+
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+ //set all possible catagories X.php names    
+     ob_start();
+       include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/categories4.php');
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'categories4_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath);
+    }
+
+    return $cache_output;
+  }
+
+////
+// Cache the categories box
+  function tep_cache_categories_box5($auto_expire = false, $refresh = false) {
+    global $cPath, $language, $languages_id, $tree, $cPath_array, $categories_string, $foo, $id, $aa;
+
+    if (($refresh == true) || !read_cache($cache_output, 'categories5_box-' . TEMPLATE_NAME . '.' . $language . '.cache' . $cPath, $auto_expire)) {
+
+//get default template name
+  $customer_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate1 = tep_db_fetch_array($customer_template_query);
+
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+ //set all possible catagories X.php names    
+     ob_start();
+       include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/categories5.php');
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'categories5_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $cPath);
+    }
+
+    return $cache_output;
+  }
+
+////
+//! Cache the manufacturers box
+// Cache the manufacturers box
+  function tep_cache_manufacturers_box($auto_expire = false, $refresh = false) {
+    global $HTTP_GET_VARS, $language;
+  $customer_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate1 = tep_db_fetch_array($customer_template_query);
+
+   if (tep_not_null($cptemplate1['template_selected'])) {
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    define(TEMPLATE_NAME, 'default');
+    }
+
+    $manufacturers_id = '';
+    if (isset($HTTP_GET_VARS['manufactuers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
+      $manufacturers_id = $HTTP_GET_VARS['manufacturers_id'];
+    }
+
+    if (($refresh == true) || !read_cache($cache_output, 'manufacturers_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $manufacturers_id, $auto_expire)) {
+     ob_start();
+      include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/manufacturers.php');
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'manufacturers_box-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $manufacturers_id);
+    }
+
+    return $cache_output;
+  }
+
+////
+//! Cache the also purchased module
+// Cache the also purchased module
+  function tep_cache_also_purchased($auto_expire = false, $refresh = false) {
+    global $HTTP_GET_VARS, $language, $languages_id;
+
+    if (($refresh == true) || !read_cache($cache_output, 'also_purchased-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $HTTP_GET_VARS['products_id'], $auto_expire)) {
+      ob_start();
+      include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
+      $cache_output = ob_get_contents();
+      ob_end_clean();
+      write_cache($cache_output, 'also_purchased-'. TEMPLATE_NAME . '.'  . $language . '.cache' . $HTTP_GET_VARS['products_id']);
+    }
+
+    return $cache_output;
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/categories_lookup.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/categories_lookup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/categories_lookup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  Categories Functions
+*/
+
+////
+// Return a product's catagory
+// TABLES: products_to_catagories
+  function tep_get_products_catagory_id($products_id) {
+    global $languages_id;
+
+    $the_products_catagory_query = tep_db_query("select products_id, categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $products_id . "'" . " order by products_id,categories_id");
+    $the_products_catagory = tep_db_fetch_array($the_products_catagory_query);
+
+    return $the_products_catagory['categories_id'];
+  }
+
+////
+// WebMakers.com Added: Find a Categories Name
+// TABLES: categories_description
+  function tep_get_categories_name($who_am_i) {
+    global $languages_id;
+    $the_categories_name_query= tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id= '" . $who_am_i . "' and language_id= '" . $languages_id . "'");
+
+    $the_categories_name = tep_db_fetch_array($the_categories_name_query);
+    return $the_categories_name['categories_name'];
+  }
+
+
+////
+// WebMakers.com Added: Find a Categories image
+// TABLES: categories_image
+  function tep_get_categories_image($what_am_i) {
+    $the_categories_image_query= tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id= '" . $what_am_i . "'");
+
+    $the_categories_image = tep_db_fetch_array($the_categories_image_query);
+    return $the_categories_image['categories_image'];
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/clean_html_comments.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/clean_html_comments.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/clean_html_comments.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+// /catalog/includes/functions/clean_html_comments.php
+// WebMakers.com Added: Header Tags Generator v2.0
+// WebMakers.com Added: FREE-CALL FOR PRICE-COMING SOON ETC. v3.0
+//
+// BE CAREFUL NOT to use this function where it will effect currencies.php or the listings for product name
+// This is used for cosmetic purposes for what the visitor sees and not for what the php code sees. The php code needs to see the HTML comment tags.
+//
+// Removes the <!--//* and *//--> from Product Names
+
+////
+// Clean out HTML comments code
+function clean_html_comments($clean_html) {
+global $its_cleaned;
+
+if ( strpos($clean_html,'<!--//*')>1 ) {
+  $the_end1= strpos($clean_html,'<!--//*')-1;
+  $the_start2= strpos($clean_html,'*//-->')+7;
+
+  $its_cleaned= substr($clean_html,0,$the_end1);
+  $its_cleaned.= substr($clean_html,$the_start2);
+} else {
+  $its_cleaned= $clean_html;
+}
+  return $its_cleaned;
+}
+
+?>

Added: trunk/direct.openmoko.com/includes/functions/compatibility.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/compatibility.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/compatibility.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,172 @@
+<?php
+/*
+  $Id: compatibility.php,v 1.1.1.1 2004/03/04 23:40:48 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  Modified by Marco Canini, <m.canini at libero.it>
+  - Fixed a bug with arrays in $HTTP_xxx_VARS
+*/
+
+////
+// Recursively handle magic_quotes_gpc turned off.
+// This is due to the possibility of have an array in
+// $HTTP_xxx_VARS
+// Ie, products attributes
+  function do_magic_quotes_gpc(&$ar) {
+    if (!is_array($ar)) return false;
+
+    while (list($key, $value) = each($ar)) {
+      if (is_array($value)) {
+        do_magic_quotes_gpc($value);
+      } else {
+        $ar[$key] = addslashes($value);
+      }
+    }
+  }
+
+// $HTTP_xxx_VARS are always set on php4
+  if (!is_array($HTTP_GET_VARS)) $HTTP_GET_VARS = array();
+  if (!is_array($HTTP_POST_VARS)) $HTTP_POST_VARS = array();
+  if (!is_array($HTTP_COOKIE_VARS)) $HTTP_COOKIE_VARS = array();
+
+// handle magic_quotes_gpc turned off.
+  if (!get_magic_quotes_gpc()) {
+    do_magic_quotes_gpc($HTTP_GET_VARS);
+    do_magic_quotes_gpc($HTTP_POST_VARS);
+    do_magic_quotes_gpc($HTTP_COOKIE_VARS);
+  }
+
+  if (!function_exists('array_splice')) {
+    function array_splice(&$array, $maximum) {
+      if (sizeof($array) >= $maximum) {
+        for ($i=0; $i<$maximum; $i++) {
+          $new_array[$i] = $array[$i];
+        }
+        $array = $new_array;
+      }
+    }
+  }
+
+  if (!function_exists('in_array')) {
+    function in_array($lookup_value, $lookup_array) {
+      reset($lookup_array);
+      while (list($key, $value) = each($lookup_array)) {
+        if ($value == $lookup_value) return true;
+      }
+
+      return false;
+    }
+  }
+
+  if (!function_exists('array_reverse')) {
+    function array_reverse($array) {
+      for ($i=0, $n=sizeof($array); $i<$n; $i++) $array_reversed[$i] = $array[($n-$i-1)];
+
+      return $array_reversed;
+    }
+  }
+
+  if (!function_exists('constant')) {
+    function constant($constant) {
+      eval("\$temp=$constant;");
+
+      return $temp;
+    }
+  }
+
+  if (!function_exists('is_null')) {
+    function is_null($value) {
+      if (is_array($value)) {
+        if (sizeof($value) > 0) {
+          return false;
+        } else {
+          return true;
+        }
+      } else {
+        if (($value != '') && ($value != 'NULL') && (strlen(trim($value)) > 0)) {
+          return false;
+        } else {
+          return true;
+        }
+      }
+    }
+  }
+
+  if (!function_exists('array_merge')) {
+    function array_merge($array1, $array2, $array3 = '') {
+      if (empty($array3) && !is_array($array3)) $array3 = array();
+      while (list($key, $val) = each($array1)) $array_merged[$key] = $val;
+      while (list($key, $val) = each($array2)) $array_merged[$key] = $val;
+      if (sizeof($array3) > 0) while (list($key, $val) = each($array3)) $array_merged[$key] = $val;
+
+      return (array) $array_merged;
+    }
+  }
+
+  if (!function_exists('is_numeric')) {
+    function is_numeric($param) {
+      return ereg('^[0-9]{1,50}.?[0-9]{0,50}$', $param);
+    }
+  }
+
+  if (!function_exists('array_slice')) {
+    function array_slice($array, $offset, $length = 0) {
+      if ($offset < 0 ) {
+        $offset = sizeof($array) + $offset;
+      }
+      $length = ((!$length) ? sizeof($array) : (($length < 0) ? sizeof($array) - $length : $length + $offset));
+      for ($i = $offset; $i<$length; $i++) {
+        $tmp[] = $array[$i];
+      }
+
+      return $tmp;
+    }
+  }
+
+  if (!function_exists('array_map')) {
+    function array_map($callback, $array) {
+      if (is_array($array)) {
+        $_new_array = array();
+        reset($array);
+        while (list($key, $value) = each($array)) {
+          $_new_array[$key] = array_map($callback, $array[$key]);
+        }
+        return $_new_array;
+      } else {
+        return $callback($array);
+      }
+    }
+  }
+
+  if (!function_exists('str_repeat')) {
+    function str_repeat($string, $number) {
+      $repeat = '';
+
+      for ($i=0; $i<$number; $i++) {
+        $repeat .= $string;
+      }
+
+      return $repeat;
+    }
+  }
+
+  if (!function_exists('checkdnsrr')) {
+    function checkdnsrr($host, $type) {
+      if(tep_not_null($host) && tep_not_null($type)) {
+        @exec("nslookup -type=$type $host", $output);
+        while(list($k, $line) = each($output)) {
+          if(eregi("^$host", $line)) {
+            return true;
+          }
+        }
+      }
+      return false;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/crypt.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/crypt.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/crypt.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: crypt.php,v 1.1.1.1 2004/03/04 23:40:48 ccwjr Exp $
+
+    Copyright (c) 2005 
+
+  Released under the GNU General Public License
+*/
+
+
+  function cc_encrypt($text) {
+    /*  Removed because the configuration keys are already loaded
+    $encrypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+    $encrypt = tep_db_fetch_array($encrypt_query);
+    $encrypt_path = $encrypt['configuration_value'];
+    $crypt_query1 = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_FILE'");
+    $encrypt1 = tep_db_fetch_array($crypt_query1);
+    $encrypt_file = $encrypt1['configuration_value'];
+    */
+    if ( defined('PAYMENT_CC_CRYPT_PATH') ) $encrypt_path = PAYMENT_CC_CRYPT_PATH;
+    if ( defined('PAYMENT_CC_CRYPT_FILE') ) $encrypt_file = PAYMENT_CC_CRYPT_FILE;
+
+
+  //get key 
+    include (DIR_FS_CATALOG . DIR_WS_INCLUDES . $encrypt_path . $encrypt_file);
+
+   $key = CC_KEY;
+   $key = md5($key);
+   $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
+   $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+   $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
+   
+  
+  return base64_encode($crypttext);
+   }
+   
+function cc_decrypt($enc) {
+ /*  Removed because the configuration keys are already loaded
+ $encrypt_query = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_PATH'");
+  $encrypt = tep_db_fetch_array($encrypt_query);
+  $encrypt_path = $encrypt['configuration_value'];
+  $crypt_query1 = tep_db_query("select configuration_id, configuration_title, configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'PAYMENT_CC_CRYPT_FILE'");
+  $encrypt1 = tep_db_fetch_array($crypt_query1);
+  $encrypt_file = $encrypt1['configuration_value'];
+  */
+  if ( defined('PAYMENT_CC_CRYPT_PATH') ) $encrypt_path = PAYMENT_CC_CRYPT_PATH;
+  if ( defined('PAYMENT_CC_CRYPT_FILE') ) $encrypt_file = PAYMENT_CC_CRYPT_FILE;
+
+  //get key 
+include (DIR_FS_CATALOG . DIR_WS_INCLUDES . $encrypt_path . $encrypt_file);
+$key = CC_KEY;
+$enc =base64_decode($enc);
+$key = md5($key);
+$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
+$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+$decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $enc, MCRYPT_MODE_ECB, $iv);
+$decrypttext1 = trim($decrypttext);
+return ($decrypttext1) ;
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/functions/database.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/database.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/database.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,306 @@
+<?php
+/*
+  $Id: database.php,v 1.1.1.1 2004/03/04 23:40:48 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
+    global $$link;
+
+    if (USE_PCONNECT == 'true') {
+      $$link = mysql_pconnect($server, $username, $password);
+    } else {
+      $$link = mysql_connect($server, $username, $password);
+    }
+
+    if ($$link) mysql_select_db($database);
+
+    return $$link;
+  }
+
+  function tep_db_close($link = 'db_link') {
+    global $$link;
+
+    return mysql_close($$link);
+  }
+
+  function tep_db_error($query, $errno, $error) {
+    //die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');
+    die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">'.TEP_DB_ERRORR.'</font></small><br><br></b></font>');
+  }
+
+/*  function tep_db_query($query, $link = 'db_link') {
+    global $$link;
+
+    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
+      error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
+    }
+
+    $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());
+
+    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
+       $result_error = mysql_error();
+       error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
+    }
+
+    return $result;
+  }
+*/
+// Begin osC Explain Query modifications
+
+  function tep_db_query($query, $link = 'db_link') {
+    global $$link;
+
+    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
+      error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
+    }
+    
+    $_start = explode(' ', microtime());
+    $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());
+    $_end = explode(' ', microtime());
+    $_time = number_format(($_end[1] + $_end[0] - ($_start[1] + $_start[0])), 8);
+
+  if ( defined('EXPLAIN_QUERIES') && (EXPLAIN_QUERIES == 'true') ){   
+    /* Initially set to store every query */
+    $explain_this_query = true;
+    /* If the include filter is true just explain queries for those scripts */    
+    if ( defined('EXPLAIN_USE_INCLUDE') && (EXPLAIN_USE_INCLUDE == 'true') ){
+      $explain_this_query = ( ( stripos( EXPLAIN_INCLUDE_FILES, basename($_SERVER['PHP_SELF']) ) ) === false ? false : true );
+    }
+    /* If the exclude filter is true just explain queries for those that are not listed */    
+    if ( defined('EXPLAIN_USE_EXCLUDE') && (EXPLAIN_USE_EXCLUDE == 'true') ){
+      $explain_this_query = ( ( stripos( EXPLAIN_EXCLUDE_FILES, basename($_SERVER['PHP_SELF']) ) ) === false ? true : false );
+    }     
+    /* If it still true after running it through the filters store it */  
+    if ($explain_this_query) tep_explain_query($query, $_time);     
+  } # End if EXPLAIN_QUERIES
+  
+  if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
+       $result_error = mysql_error();
+       error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
+    }
+  
+    return $result;
+  }
+
+   function wrap(&$array, $wrapwith="'"){
+    foreach ($array as $index => $value){
+      if ($value!='') $array[$index] = $wrapwith . tep_db_input($value) . $wrapwith;
+        else $array[$index] = "''" ;
+    } 
+  }
+
+  function tep_explain_query($query, $_time, $link = 'db_link') {
+    global $$link;
+  /* Makes sure it's a select query and it's not for a session */
+  if ( stristr($query, 'select') && !stristr($query, 'sessions') ) { 
+    /* Add the EXPLAIN to the query */
+    $explain_query = 'EXPLAIN ' . $query;
+    $_query = array('explain_id' => '', # Leave blank to get an autoincrement
+            'md5query' => md5($query), # MD5() the query to get a unique that can be indexed
+            'query' => $query, # Actual query
+            'time' => $_time*1000, # Multiply by 1000 to get milliseconds
+            'script' => basename($_SERVER['PHP_SELF']), # Script name
+            'request_string' => $_SERVER['QUERY_STRING'] # Query string since some pages are constructed from parameters
+            );
+    /* Merge the _query and explain arrays */
+    $container = array_merge($_query, mysql_fetch_assoc(mysql_query($explain_query)));
+    /* Break the array into components so elements can be wrapped */
+    foreach($container as $column => $value){
+        $columns[] = $column;
+        $values[] = $value;
+    }   
+    /* Wrap the columns and values */ 
+    wrap($columns, '`');
+    wrap($values);
+    /* Implode the columns so they can be used for the insert query below */
+    $_columns = implode(', ', $columns);
+    $_values = implode(', ', $values);
+    /* Insert the data */
+    $explain_insert = "INSERT into `explain_queries` ($_columns) VALUES ($_values)";
+    mysql_query($explain_insert) or tep_db_error($explain_insert, mysql_errno(), mysql_error());    
+    /* unset some variables...clean as we go */
+    unset( $_query, $container, $columns, $values, $_columns, $_values );
+  }
+  }
+// End osC Explain Query Modifications
+  function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') {
+    reset($data);
+    if ($action == 'insert') {
+      $query = 'insert into ' . $table . ' (';
+      while (list($columns, ) = each($data)) {
+        $query .= $columns . ', ';
+      }
+      $query = substr($query, 0, -2) . ') values (';
+      reset($data);
+      while (list(, $value) = each($data)) {
+        switch ((string)$value) {
+          case 'now()':
+            $query .= 'now(), ';
+            break;
+          case 'null':
+            $query .= 'null, ';
+            break;
+          default:
+            $query .= '\'' . tep_db_input($value) . '\', ';
+            break;
+        }
+      }
+      $query = substr($query, 0, -2) . ')';
+    } elseif ($action == 'update') {
+      $query = 'update ' . $table . ' set ';
+      while (list($columns, $value) = each($data)) {
+        switch ((string)$value) {
+          case 'now()':
+            $query .= $columns . ' = now(), ';
+            break;
+          case 'null':
+            $query .= $columns .= ' = null, ';
+            break;
+          default:
+            $query .= $columns . ' = \'' . tep_db_input($value) . '\', ';
+            break;
+        }
+      }
+      $query = substr($query, 0, -2) . ' where ' . $parameters;
+    }
+
+    return tep_db_query($query, $link);
+  }
+
+  function tep_db_fetch_array($db_query) {
+    return mysql_fetch_array($db_query, MYSQL_ASSOC);
+  }
+
+  function tep_db_num_rows($db_query) {
+    return mysql_num_rows($db_query);
+  }
+
+  function tep_db_data_seek($db_query, $row_number) {
+    return mysql_data_seek($db_query, $row_number);
+  }
+
+  function tep_db_insert_id() {
+    return mysql_insert_id();
+  }
+
+  function tep_db_free_result($db_query) {
+    return mysql_free_result($db_query);
+  }
+
+  function tep_db_fetch_fields($db_query) {
+    return mysql_fetch_field($db_query);
+  }
+
+  function tep_db_output($string) {
+    return htmlspecialchars($string);
+  }
+
+  function tep_db_input($string) {
+    return addslashes($string);
+  }
+
+  function tep_db_prepare_input($string) {
+    if (is_string($string)) {
+      return trim(tep_sanitize_string(stripslashes($string)));
+    } elseif (is_array($string)) {
+      reset($string);
+      while (list($key, $value) = each($string)) {
+        $string[$key] = tep_db_prepare_input($value);
+      }
+      return $string;
+    } else {
+      return $string;
+    }
+  }
+
+  //Eversun mod for sppc and qty price breaks
+ function tep_db_table_exists($table, $link = 'db_link') {
+    $result = tep_db_query("show table status from `" . DB_DATABASE . "`");
+    while ($list_tables = tep_db_fetch_array($result)) {
+    if ($list_tables['Name'] == $table) {
+      return true;
+    }
+    }
+    return false;
+  }
+
+  function tep_db_check_age_specials_retail_table() {
+    $result = tep_db_query("show table status from `" . DB_DATABASE . "`");
+    $last_update_table_specials = "2000-01-01 12:00:00";
+    $table_srp_exists = false;
+    while ($list_tables = tep_db_fetch_array($result)) {
+    if ($list_tables['Name'] == TABLE_SPECIALS_RETAIL_PRICES) {
+    $table_srp_exists = true;
+    $last_update_table_srp = $list_tables['Update_time'];
+    }
+    if ($list_tables['Name'] == TABLE_SPECIALS) {
+    $last_update_table_specials = $list_tables['Update_time'];
+    }
+    } // end while
+
+    if(!$table_srp_exists || ($last_update_table_specials > $last_update_table_srp)) {
+       if ($table_srp_exists) {
+         $query1 = "truncate " . TABLE_SPECIALS_RETAIL_PRICES . "";
+         if (tep_db_query($query1)) {
+     $query2 = "insert into " . TABLE_SPECIALS_RETAIL_PRICES . " select s.products_id, s.specials_new_products_price, s.status, s.customers_group_id from " . TABLE_SPECIALS . " s where s.customers_group_id = '0'";
+     $result =  tep_db_query($query2);
+     }
+       } else { // table specials_retail_prices does not exist
+         $query1 = "create table " . TABLE_SPECIALS_RETAIL_PRICES . " (products_id int NOT NULL default '0', specials_new_products_price decimal(15,4) NOT NULL default '0.0000', status tinyint, customers_group_id smallint, primary key (products_id) )" ;
+         $query2 = "insert into " . TABLE_SPECIALS_RETAIL_PRICES . " select s.products_id, s.specials_new_products_price, s.status, s.customers_group_id from " . TABLE_SPECIALS . " s where s.customers_group_id = '0'";
+         if( tep_db_query($query1) && tep_db_query($query2) ) {
+      ; // execution succesfull
+        }
+       } // end else
+    } // end if(!$table_srp_exists || ($last_update_table_specials....
+  }
+
+  function tep_db_check_age_products_group_prices_cg_table($customer_group_id) {
+    $result = tep_db_query("show table status from `" . DB_DATABASE . "`");
+    $last_update_table_pgp = strtotime('2000-01-01 12:00:00');
+    $table_pgp_exists = false;
+    while ($list_tables = tep_db_fetch_array($result)) {
+    if ($list_tables['Name'] == TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id) {
+    $table_pgp_exists = true;
+    $last_update_table_pgp = strtotime($list_tables['Update_time']);
+    } elseif ($list_tables['Name'] == TABLE_SPECIALS ) {
+    $last_update_table_specials = strtotime($list_tables['Update_time']);
+    } elseif ($list_tables['Name'] == TABLE_PRODUCTS ) {
+    $last_update_table_products = strtotime($list_tables['Update_time']);
+    } elseif ($list_tables['Name'] == TABLE_PRODUCTS_GROUPS ) {
+    $last_update_table_products_groups = strtotime($list_tables['Update_time']);
+    }
+    } // end while
+
+   if ($table_pgp_exists == false) {
+      $create_table_sql = "create table " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id . " (products_id int NOT NULL default '0', products_price decimal(15,4) NOT NULL default '0.0000', specials_new_products_price decimal(15,4) default NULL, status tinyint, primary key (products_id) )" ;
+      $fill_table_sql1 = "insert into " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." select p.products_id, p.products_price, NULL as specials_new_products_price, NULL as status FROM " . TABLE_PRODUCTS . " p";
+      $update_table_sql1 = "update " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." ppt left join " . TABLE_PRODUCTS_GROUPS . " pg using(products_id) set ppt.products_price = pg.customers_group_price where ppt.products_id = pg.products_id and pg.customers_group_id ='" . $customer_group_id . "'";
+      $update_table_sql2 = "update " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." ppt left join " . TABLE_SPECIALS . " s using(products_id) set ppt.specials_new_products_price = s.specials_new_products_price, ppt.status = s.status where ppt.products_id = s.products_id and s.customers_group_id = '" . $customer_group_id . "'";
+      if ( tep_db_query($create_table_sql) && tep_db_query($fill_table_sql1) && tep_db_query($update_table_sql1) && tep_db_query($update_table_sql2) ) {
+         return true;
+              }
+   } // end if ($table_pgp_exists == false)
+
+   if ( ($last_update_table_pgp < $last_update_table_products && (time() - $last_update_table_products > (int)MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE * 60) ) || $last_update_table_specials > $last_update_table_pgp || $last_update_table_products_groups > $last_update_table_pgp ) { // then the table should be updated
+      $empty_query = "truncate " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id . "";
+      $fill_table_sql1 = "insert into " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." select p.products_id, p.products_price, NULL as specials_new_products_price, NULL as status FROM " . TABLE_PRODUCTS . " p";
+      $update_table_sql1 = "update " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." ppt left join " . TABLE_PRODUCTS_GROUPS . " pg using(products_id) set ppt.products_price = pg.customers_group_price where ppt.products_id = pg.products_id and pg.customers_group_id ='" . $customer_group_id . "'";
+      $update_table_sql2 = "update " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." ppt left join " . TABLE_SPECIALS . " s using(products_id) set ppt.specials_new_products_price = s.specials_new_products_price, ppt.status = s.status where ppt.products_id = s.products_id and s.customers_group_id = '" . $customer_group_id . "'";
+      if ( tep_db_query($empty_query) && tep_db_query($fill_table_sql1) && tep_db_query($update_table_sql1) && tep_db_query($update_table_sql2) ) {
+         return true;
+              }
+   } else { // no need to update
+     return true;
+   } // end checking for update
+
+  }
+  //Eversun mod end for sppc and qty price breaks
+?>

Added: trunk/direct.openmoko.com/includes/functions/downloads_controller.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/downloads_controller.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/downloads_controller.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+
+  WebMakers.com Added: Downloads Controller Functions
+  NOTE: Some function may already exist in other Add-Ons I have created.
+
+*/
+?>
+<?php
+
+////
+// BOF: WebMakers.com Added: configuration key value lookup
+  function tep_get_configuration_key_value($lookup) {
+    $configuration_query_raw= tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key='" . $lookup . "'");
+    $configuration_query= tep_db_fetch_array($configuration_query_raw);
+    $lookup_value= $configuration_query['configuration_value'];
+    if ( !($lookup_value) ) {
+      $lookup_value='<font color="FF0000">' . $lookup . '</font>';
+    }
+    return $lookup_value;
+  }
+// EOF: WebMakers.com Added: configuration key value lookup
+
+?>

Added: trunk/direct.openmoko.com/includes/functions/faqdesk_general.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/faqdesk_general.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/faqdesk_general.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,181 @@
+<?php
+
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Generate a path to categories
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+function faqdesk_get_path($current_category_id = '') {
+global $faqPath_array;
+
+if ($current_category_id) {
+  $cp_size = sizeof($faqPath_array);
+  if ($cp_size == 0) {
+    $faqPath_new = $current_category_id;
+  } else {
+    $faqPath_new = '';
+    $last_category_query = tep_db_query("select parent_id from " . TABLE_FAQDESK_CATEGORIES . " where categories_id = '" . $faqPath_array[($cp_size-1)] . "'");
+    $last_category = tep_db_fetch_array($last_category_query);
+    $current_category_query = tep_db_query("select parent_id from " . TABLE_FAQDESK_CATEGORIES . " where categories_id = '" . $current_category_id . "'");
+    $current_category = tep_db_fetch_array($current_category_query);
+    if ($last_category['parent_id'] == $current_category['parent_id']) {
+      for ($i=0; $i<($cp_size-1); $i++) {
+        $faqPath_new .= '_' . $faqPath_array[$i];
+      }
+    } else {
+      for ($i=0; $i<$cp_size; $i++) {
+        $faqPath_new .= '_' . $faqPath_array[$i];
+      }
+    }
+    $faqPath_new .= '_' . $current_category_id;
+    if (substr($faqPath_new, 0, 1) == '_') {
+      $faqPath_new = substr($faqPath_new, 1);
+    }
+  }
+} else {
+  $faqPath_new = implode('_', $faqPath_array);
+}
+
+return 'faqPath=' . $faqPath_new;
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Parse and secure the faqPath parameter values
+function faqdesk_parse_category_path($faqPath) {
+// make sure the category IDs are integers
+$faqPath_array = array_map('tep_string_to_int', explode('_', $faqPath));
+
+// make sure no duplicate category IDs exist which could lock the server in a loop
+$tmp_array = array();
+$n = sizeof($faqPath_array);
+for ($i=0; $i<$n; $i++) {
+  if (!in_array($faqPath_array[$i], $tmp_array)) {
+    $tmp_array[] = $faqPath_array[$i];
+  }
+}
+
+return $tmp_array;
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Return true if the category has subcategories
+// TABLES: categories
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+function faqdesk_has_category_subcategories($category_id) {
+$child_category_query = tep_db_query("select count(*) as count from " . TABLE_FAQDESK_CATEGORIES . " where parent_id = '" . $category_id . "'");
+$child_category = tep_db_fetch_array($child_category_query);
+
+if ($child_category['count'] > 0) {
+  return true;
+} else {
+  return false;
+}
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Construct a category path to the product
+// TABLES: products_to_categories
+function faqdesk_get_product_path($faqdesk_id) {
+$faqPath = '';
+
+$cat_count_sql = tep_db_query("select count(*) as count from " . TABLE_FAQDESK_TO_CATEGORIES . " where faqdesk_id = '" . $faqdesk_id . "'");
+$cat_count_data = tep_db_fetch_array($cat_count_sql);
+
+if ($cat_count_data['count'] == 1) {
+  $categories = array();
+
+  $cat_id_sql = tep_db_query("select categories_id from " . TABLE_FAQDESK_TO_CATEGORIES . " where faqdesk_id = '" . $faqdesk_id . "'");
+  $cat_id_data = tep_db_fetch_array($cat_id_sql);
+  faqdesk_get_parent_categories($categories, $cat_id_data['categories_id']);
+
+  $size = sizeof($categories)-1;
+  for ($i = $size; $i >= 0; $i--) {
+    if ($faqPath != '') $faqPath .= '_';
+      $faqPath .= $categories[$i];
+  }
+  if ($faqPath != '') $faqPath .= '_';
+    $faqPath .= $cat_id_data['categories_id'];
+}
+
+return $faqPath;
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Recursively go through the categories and retreive all parent categories IDs
+// TABLES: categories
+function faqdesk_get_parent_categories(&$categories, $categories_id) {
+$parent_categories_query = tep_db_query("select parent_id from " . TABLE_FAQDESK_CATEGORIES . " where categories_id = '" . $categories_id . "'");
+
+while ($parent_categories = tep_db_fetch_array($parent_categories_query)) {
+  if ($parent_categories['parent_id'] == 0) return true;
+    $categories[sizeof($categories)] = $parent_categories['parent_id'];
+    if ($parent_categories['parent_id'] != $categories_id) {
+      faqdesk_get_parent_categories($categories, $parent_categories['parent_id']);
+    }
+  }
+}
+
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+function faqdesk_get_categories($categories_array = '', $parent_id = '0', $indent = '') {
+global $languages_id;
+
+$parent_id = tep_db_prepare_input($parent_id);
+
+if (!is_array($categories_array)) $categories_array = array();
+
+$categories_query = tep_db_query(
+"select c.categories_id, cd.categories_name from " . TABLE_FAQDESK_CATEGORIES . " c, " . TABLE_FAQDESK_CATEGORIES_DESCRIPTION . "
+cd where c.catagory_status = '1' and parent_id = '" . tep_db_input($parent_id) . "' and c.categories_id = cd.categories_id and cd.language_id = '"
+. $languages_id . "' order by sort_order, cd.categories_name"
+);
+
+while ($categories = tep_db_fetch_array($categories_query)) {
+  $categories_array[] = array(
+    'id' => $categories['categories_id'],
+    'text' => $indent . $categories['categories_name']
+  );
+
+  if ($categories['categories_id'] != $parent_id) {
+    $categories_array = faqdesk_get_categories($categories_array, $categories['categories_id'], $indent . '&nbsp;&nbsp;');
+  }
+}
+
+return $categories_array;
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Return all subcategory IDs
+// TABLES: categories
+function faqdesk_get_subcategories(&$subcategories_array, $parent_id = 0) {
+$subcategories_query = tep_db_query("select categories_id from " . TABLE_FAQDESK_CATEGORIES . " where parent_id = '" . $parent_id . "'");
+
+while ($subcategories = tep_db_fetch_array($subcategories_query)) {
+  $subcategories_array[sizeof($subcategories_array)] = $subcategories['categories_id'];
+  if ($subcategories['categories_id'] != $parent_id) {
+    faqdesk_get_subcategories($subcategories_array, $subcategories['categories_id']);
+  }
+}
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+
+?>
+
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions ---- http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+  Released under the GNU General Public License
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution but an add-on contributed to the osC community.
+  Please read the NOTE and INSTALL documents that are provided with this file for further information and installation notes.
+
+  script name:      FAQDesk
+  version:      1.01.0
+  date:             22-06-2004 (dd/mm/yyyy)
+  original author:    Carsten aka moyashi
+  web site:           www..com
+  modified code by:   Wolfen aka 241
+*/
+?>

Added: trunk/direct.openmoko.com/includes/functions/featured.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Featured Products V1.1
+  Expiry Functions
+*/
+
+////
+// Sets the status of a featured product
+  function tep_set_featured_status($featured_id, $status) {
+    return tep_db_query("update " . TABLE_FEATURED . " set status = '" . $status . "', date_status_change = now() where featured_id = '" . $featured_id . "'");
+  }
+
+////
+// Auto expire featured products
+  function tep_expire_featured() {
+    $featured_query = tep_db_query("select featured_id from " . TABLE_FEATURED . " where status = '1' and now() >= expires_date and expires_date > 0");
+    if (tep_db_num_rows($featured_query)) {
+      while ($featured = tep_db_fetch_array($featured_query)) {
+        tep_set_featured_status($featured['featured_id'], '0');
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/general.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/general.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/general.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1499 @@
+<?php
+/*
+  $Id: general.php,v 1.1.1.1 2004/03/04 23:40:50 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+function tep_return_broken($bad_string) {
+  $char_count = 35;
+  $formatted_string = '';
+  $countbefore = 0;
+  $i = 0;
+  while ($i < strlen($bad_string)) {
+    $formatted_string .= $bad_string[$i];
+    $countbefore ++;
+    if ($countbefore > $char_count) {
+      $formatted_string .= chr(13);
+      $countbefore = 0;
+    }
+    $i ++;
+  } // End of while loop on strlen of bad string
+  return $formatted_string;
+}
+////
+// Stop from parsing any further PHP code
+  function tep_exit() {
+   tep_session_close();
+   exit();
+  }
+
+////
+// Redirect to another page or site
+  function tep_redirect($url) {
+    if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) { 
+      tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
+    }
+
+    if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page
+      if (substr($url, 0, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)) == HTTP_SERVER . DIR_WS_HTTP_CATALOG) { // NONSSL url
+        $url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL
+      }
+    }
+
+    header('Location: ' . $url);
+
+    tep_exit();
+  }
+
+////
+// Parse the data used in the html tags to ensure the tags will not break
+  function tep_parse_input_field_data($data, $parse) {
+    return strtr(trim($data), $parse);
+  }
+
+  function tep_output_string($string, $translate = false, $protected = false) {
+    if ($protected == true) {
+      return htmlspecialchars($string);
+    } else {
+      if ($translate == false) {
+        return tep_parse_input_field_data($string, array('"' => '&quot;'));
+      } else {
+        return tep_parse_input_field_data($string, $translate);
+      }
+    }
+  }
+
+  function tep_output_string_protected($string) {
+    return tep_output_string($string, false, true);
+  }
+
+  function tep_sanitize_string($string) {
+    $string = ereg_replace(' +', ' ', trim($string));
+
+    return preg_replace("/[<>]/", '_', $string);
+  }
+
+////
+// Return a random row from a database query
+  function tep_random_select($query) {
+    $random_product = '';
+    $random_query = tep_db_query($query);
+    $num_rows = tep_db_num_rows($random_query);
+    if ($num_rows > 0) {
+      $random_row = tep_rand(0, ($num_rows - 1));
+      tep_db_data_seek($random_query, $random_row);
+      $random_product = tep_db_fetch_array($random_query);
+    }
+
+    return $random_product;
+  }
+
+////
+// Return a product's name
+// TABLES: products
+  function tep_get_products_name($product_id, $language = '') {
+    global $languages_id;
+
+    if (empty($language)) $language = $languages_id;
+
+    $product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_name'];
+  }
+//
+// Return a product's name
+// TABLES: products
+  function tep_get_products_image($product_id) {
+    global $languages_id;
+
+    $product_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['products_image'];
+  }
+
+//gets manufacurs name for a manufacture
+ function tep_get_manufacturers_name($manufacturers_id) {
+
+    $manufactures_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturers_id . "'");
+    $manufactures = tep_db_fetch_array($manufactures_query);
+
+    return $manufactures['manufacturers_name'];
+  }
+  
+////
+// Return a product's special price (returns nothing if there is no offer)
+// TABLES: products
+  function tep_get_products_special_price($product_id) {
+    $product_query = tep_db_query("select products_price, products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
+    if (tep_db_num_rows($product_query)) {
+      $product = tep_db_fetch_array($product_query);
+    $product_price = $product['products_price'];
+    } else {
+    return false;
+    }
+// Eversun mod for sppc and qty price breaks
+//    $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $product_id . "' and status");
+  global $sppc_customer_group_id;
+
+    if(!tep_session_is_registered('sppc_customer_group_id')) {
+    $customer_group_id = '0';
+    } else {
+      $customer_group_id = $sppc_customer_group_id;
+    }
+    $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status and customers_group_id = '" . (int)$customer_group_id . "'");
+// Eversun mod for sppc and qty price breaks
+    
+    if (tep_db_num_rows($specials_query)) {
+      $special = tep_db_fetch_array($specials_query);
+    $special_price = $special['specials_new_products_price'];
+    } else {
+    $special_price = false;
+    }
+
+    if(substr($product['products_model'], 0, 4) == 'GIFT') {    //Never apply a salededuction to Ian Wilson's Giftvouchers
+      return $special_price;
+    }
+
+    $product_to_categories_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'");
+    $product_to_categories = tep_db_fetch_array($product_to_categories_query);
+    $category = $product_to_categories['categories_id'];
+
+    $sale_query = tep_db_query("select sale_specials_condition, sale_deduction_value, sale_deduction_type from " . TABLE_SALEMAKER_SALES . " where sale_categories_all like '%," . $category . ",%' and sale_status = '1' and (sale_date_start <= now() or sale_date_start = '0000-00-00') and (sale_date_end >= now() or sale_date_end = '0000-00-00') and (sale_pricerange_from <= '" . $product_price . "' or sale_pricerange_from = '0') and (sale_pricerange_to >= '" . $product_price . "' or sale_pricerange_to = '0')");
+    if (tep_db_num_rows($sale_query)) {
+      $sale = tep_db_fetch_array($sale_query);
+    } else {
+    return $special_price;
+    }
+
+    if (!$special_price) {
+      $tmp_special_price = $product_price;
+    } else {
+      $tmp_special_price = $special_price;
+    }
+
+    switch ($sale['sale_deduction_type']) {
+      case 0:
+        $sale_product_price = $product_price - $sale['sale_deduction_value'];
+        $sale_special_price = $tmp_special_price - $sale['sale_deduction_value'];
+        break;
+      case 1:
+        $sale_product_price = $product_price - (($product_price * $sale['sale_deduction_value']) / 100);
+        $sale_special_price = $tmp_special_price - (($tmp_special_price * $sale['sale_deduction_value']) / 100);
+        break;
+      case 2:
+        $sale_product_price = $sale['sale_deduction_value'];
+        $sale_special_price = $sale['sale_deduction_value'];
+        break;
+      default:
+        return $special_price;
+    }
+
+    if ($sale_product_price < 0) {
+      $sale_product_price = 0;
+    }
+
+    if ($sale_special_price < 0) {
+      $sale_special_price = 0;
+    }
+
+    if (!$special_price) {
+      return number_format($sale_product_price, 4, '.', '');
+  } else {
+      switch($sale['sale_specials_condition']){
+        case 0:
+          return number_format($sale_product_price, 4, '.', '');
+          break;
+        case 1:
+          return number_format($special_price, 4, '.', '');
+          break;
+        case 2:
+          return number_format($sale_special_price, 4, '.', '');
+          break;
+        default:
+          return number_format($special_price, 4, '.', '');
+      }
+    }
+  }
+
+// Return a product ID from a product ID with attributes
+/*function tep_get_prid($uprid) {
+    $pieces = explode('{', $uprid);
+
+    if (is_numeric($pieces[0])) {
+      return $pieces[0];
+    } else {
+      return false;
+    }
+  }
+
+*/////
+
+
+////
+// Return a product's stock
+// TABLES: products
+  function tep_get_products_stock($products_id) {
+    $products_id = tep_get_prid($products_id);
+    $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
+    $stock_values = tep_db_fetch_array($stock_query);
+
+    return $stock_values['products_quantity'];
+  }
+
+////
+// Check if the required stock is available
+// If insufficent stock is available return an out of stock message
+  function tep_check_stock($products_id, $products_quantity) {
+    $stock_left = tep_get_products_stock($products_id) - $products_quantity;
+    $out_of_stock = '';
+
+    if ($stock_left < 0) {
+      $out_of_stock = '<span class="markProductOutOfStock">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>';
+    }
+
+    return $out_of_stock;
+  }
+
+////
+// Break a word in a string if it is longer than a specified length ($len)
+  function tep_break_string($string, $len, $break_char = '-') {
+    $l = 0;
+    $output = '';
+    for ($i=0, $n=strlen($string); $i<$n; $i++) {
+      $char = substr($string, $i, 1);
+      if ($char != ' ') {
+        $l++;
+      } else {
+        $l = 0;
+      }
+      if ($l > $len) {
+        $l = 1;
+        $output .= $break_char;
+      }
+      $output .= $char;
+    }
+
+    return $output;
+  }
+
+////
+// Return all HTTP GET variables, except those passed as a parameter
+  function tep_get_all_get_params($exclude_array = '') {
+    global $HTTP_GET_VARS;
+
+    if (!is_array($exclude_array)) $exclude_array = array();
+
+    $get_url = '';
+    if (is_array($HTTP_GET_VARS) && (sizeof($HTTP_GET_VARS) > 0)) {
+      reset($HTTP_GET_VARS);
+      while (list($key, $value) = each($HTTP_GET_VARS)) {
+        if ( (strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) {
+          $get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&amp;';
+        }
+      }
+    }
+
+    return $get_url;
+  }
+
+////
+// Returns an array with countries
+// TABLES: countries
+  function tep_get_countries($countries_id = '', $with_iso_codes = false) {
+    $countries_array = array();
+    if (tep_not_null($countries_id)) {
+      if ($with_iso_codes == true) {
+        $countries = tep_db_query("select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "' order by countries_name");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name'],
+                                 'countries_iso_code_2' => $countries_values['countries_iso_code_2'],
+                                 'countries_iso_code_3' => $countries_values['countries_iso_code_3']);
+      } else {
+        $countries = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "'");
+        $countries_values = tep_db_fetch_array($countries);
+        $countries_array = array('countries_name' => $countries_values['countries_name']);
+      }
+    } else {
+      $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name");
+      while ($countries_values = tep_db_fetch_array($countries)) {
+        $countries_array[] = array('countries_id' => $countries_values['countries_id'],
+                                   'countries_name' => $countries_values['countries_name']);
+      }
+    }
+
+    return $countries_array;
+  }
+
+////
+// Alias function to tep_get_countries, which also returns the countries iso codes
+  function tep_get_countries_with_iso_codes($countries_id) {
+    return tep_get_countries($countries_id, true);
+  }
+
+////
+// Generate a path to categories
+  function tep_get_path($current_category_id = '') {
+    global $cPath_array;
+
+    if (tep_not_null($current_category_id)) {
+      $cp_size = sizeof($cPath_array);
+      if ($cp_size == 0) {
+        $cPath_new = $current_category_id;
+      } else {
+        $cPath_new = '';
+        $last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$cPath_array[($cp_size-1)] . "'");
+        $last_category = tep_db_fetch_array($last_category_query);
+
+        $current_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
+        $current_category = tep_db_fetch_array($current_category_query);
+
+        if ($last_category['parent_id'] == $current_category['parent_id']) {
+          for ($i=0; $i<($cp_size-1); $i++) {
+            $cPath_new .= '_' . $cPath_array[$i];
+          }
+        } else {
+          for ($i=0; $i<$cp_size; $i++) {
+            $cPath_new .= '_' . $cPath_array[$i];
+          }
+        }
+        $cPath_new .= '_' . $current_category_id;
+
+        if (substr($cPath_new, 0, 1) == '_') {
+          $cPath_new = substr($cPath_new, 1);
+        }
+      }
+    } else {
+      $cPath_new = implode('_', $cPath_array);
+    }
+
+    return 'cPath=' . $cPath_new;
+  }
+
+////
+// Returns the clients browser
+  function tep_browser_detect($component) {
+    global $HTTP_USER_AGENT;
+
+    return stristr($HTTP_USER_AGENT, $component);
+  }
+
+////
+// Alias function to tep_get_countries()
+  function tep_get_country_name($country_id) {
+    $country_array = tep_get_countries($country_id);
+
+    return $country_array['countries_name'];
+  }
+
+////
+// Returns the zone (State/Province) name
+// TABLES: zones
+  function tep_get_zone_name($country_id, $zone_id, $default_zone) {
+    $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' and zone_id = '" . (int)$zone_id . "'");
+    if (tep_db_num_rows($zone_query)) {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_name'];
+    } else {
+      return $default_zone;
+    }
+  }
+
+////
+// Returns the zone (State/Province) code
+// TABLES: zones
+  function tep_get_zone_code($country_id, $zone_id, $default_zone) {
+    $zone_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' and zone_id = '" . (int)$zone_id . "'");
+    if (tep_db_num_rows($zone_query)) {
+      $zone = tep_db_fetch_array($zone_query);
+      return $zone['zone_code'];
+    } else {
+      return $default_zone;
+    }
+  }
+
+////
+// Wrapper function for round()
+  function tep_round($number, $precision) {
+    if (strpos($number, '.') && (strlen(substr($number, strpos($number, '.')+1)) > $precision)) {
+      $number = substr($number, 0, strpos($number, '.') + 1 + $precision + 1);
+
+      if (substr($number, -1) >= 5) {
+        if ($precision > 1) {
+          $number = substr($number, 0, -1) + ('0.' . str_repeat(0, $precision-1) . '1');
+        } elseif ($precision == 1) {
+          $number = substr($number, 0, -1) + 0.1;
+        } else {
+          $number = substr($number, 0, -1) + 1;
+        }
+      } else {
+        $number = substr($number, 0, -1);
+      }
+    }
+
+    return $number;
+  }
+
+////
+// Returns the tax rate for a zone / class
+// TABLES: tax_rates, zones_to_geo_zones
+  function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
+
+    
+//Eversun mod for sppc and qty price breaks
+//  global $customer_zone_id, $customer_country_id;
+    global $customer_zone_id, $customer_country_id, $sppc_customer_group_tax_exempt;
+
+     if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) {
+     $customer_group_tax_exempt = '0';
+     } else {
+     $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;
+     }
+
+     if ($customer_group_tax_exempt == '1') {
+       return 0;
+     }
+//Eversun mod end for sppc and qty price breaks
+    if ( ($country_id == -1) && ($zone_id == -1) ) {
+      if (!tep_session_is_registered('customer_id')) {
+        $country_id = STORE_COUNTRY;
+        $zone_id = STORE_ZONE;
+      } else {
+        $country_id = $customer_country_id;
+        $zone_id = $customer_zone_id;
+      }
+    }
+
+    $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' group by tr.tax_priority");
+    if (tep_db_num_rows($tax_query)) {
+      $tax_multiplier = 1.0;
+      while ($tax = tep_db_fetch_array($tax_query)) {
+        $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);
+      }
+      return ($tax_multiplier - 1.0) * 100;
+    } else {
+      return 0;
+    }
+  }
+
+////
+// Return the tax description for a zone / class
+// TABLES: tax_rates;
+  function tep_get_tax_description($class_id, $country_id, $zone_id) {
+    $tax_query = tep_db_query("select tax_description from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' order by tr.tax_priority");
+    if (tep_db_num_rows($tax_query)) {
+      $tax_description = '';
+      while ($tax = tep_db_fetch_array($tax_query)) {
+        $tax_description .= $tax['tax_description'] . ' + ';
+      }
+      $tax_description = substr($tax_description, 0, -3);
+
+      return $tax_description;
+    } else {
+      return TEXT_UNKNOWN_TAX_RATE;
+    }
+  }
+
+////
+// Add tax to a products price
+  function tep_add_tax($price, $tax) {
+    global $currencies;
+
+    if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
+      return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax);
+    } else {
+      return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
+    }
+  }
+
+// Calculates Tax rounding the result
+  function tep_calculate_tax($price, $tax) {
+    global $currencies;
+
+    return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);
+  }
+
+////
+// Return the number of products in a category
+// TABLES: products, products_to_categories, categories
+  function tep_count_products_in_category($category_id, $include_inactive = false) {
+    $products_count = 0;
+    if ($include_inactive == true) {
+      $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$category_id . "'");
+    } else {
+      $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int)$category_id . "'");
+    }
+    $products = tep_db_fetch_array($products_query);
+    $products_count += $products['total'];
+
+    $child_categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "'");
+    if (tep_db_num_rows($child_categories_query)) {
+      while ($child_categories = tep_db_fetch_array($child_categories_query)) {
+        $products_count += tep_count_products_in_category($child_categories['categories_id'], $include_inactive);
+      }
+    }
+
+    return $products_count;
+  }
+
+////
+// Return true if the category has subcategories
+// TABLES: categories
+  function tep_has_category_subcategories($category_id) {
+    $child_category_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "'");
+    $child_category = tep_db_fetch_array($child_category_query);
+
+    if ($child_category['count'] > 0) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+////
+// Returns the address_format_id for the given country
+// TABLES: countries;
+  function tep_get_address_format_id($country_id) {
+    $address_format_query = tep_db_query("select address_format_id as format_id from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'");
+    if (tep_db_num_rows($address_format_query)) {
+      $address_format = tep_db_fetch_array($address_format_query);
+      return $address_format['format_id'];
+    } else {
+      return '1';
+    }
+  }
+
+////
+// Return a formatted address
+// TABLES: address_format
+  function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
+    $address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'");
+    $address_format = tep_db_fetch_array($address_format_query);
+
+    $company = tep_output_string_protected($address['company']);
+    if (isset($address['firstname']) && tep_not_null($address['firstname'])) {
+      $firstname = tep_output_string_protected($address['firstname']);
+      $lastname = tep_output_string_protected($address['lastname']);
+    } elseif (isset($address['name']) && tep_not_null($address['name'])) {
+      $firstname = tep_output_string_protected($address['name']);
+      $lastname = '';
+    } else {
+      $firstname = '';
+      $lastname = '';
+    }
+    $street = tep_output_string_protected($address['street_address']);
+    $suburb = tep_output_string_protected($address['suburb']);
+    $city = tep_output_string_protected($address['city']);
+    $state = tep_output_string_protected($address['state']);
+    if (isset($address['country_id']) && tep_not_null($address['country_id'])) {
+      $country = tep_get_country_name($address['country_id']);
+
+      if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {
+        $state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);
+      }
+    } elseif (isset($address['country']) && tep_not_null($address['country'])) {
+      $country = tep_output_string_protected($address['country']);
+    } else {
+      $country = '';
+    }
+    $postcode = tep_output_string_protected($address['postcode']);
+    $zip = $postcode;
+
+    if ($html) {
+// HTML Mode
+      $HR = '<hr>';
+      $hr = '<hr>';
+      if ( ($boln == '') && ($eoln == "\n") ) { // Values not specified, use rational defaults
+        $CR = '<br>';
+        $cr = '<br>';
+        $eoln = $cr;
+      } else { // Use values supplied
+        $CR = $eoln . $boln;
+        $cr = $CR;
+      }
+    } else {
+// Text Mode
+      $CR = $eoln;
+      $cr = $CR;
+      $HR = '----------------------------------------';
+      $hr = '----------------------------------------';
+    }
+
+    $statecomma = '';
+    $streets = $street;
+    if ($suburb != '') $streets = $street . $cr . $suburb;
+    if ($country == '') $country = tep_output_string_protected($address['country']);
+    if ($state != '') $statecomma = $state . ', ';
+
+    $fmt = $address_format['format'];
+    eval("\$address = \"$fmt\";");
+
+    if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {
+      $address = $company . $cr . $address;
+    }
+
+    return $address;
+  }
+
+////
+// Return a formatted address
+// TABLES: customers, address_book
+  function tep_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") {
+    $address_query = tep_db_query("select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$address_id . "'");
+    $address = tep_db_fetch_array($address_query);
+
+    $format_id = tep_get_address_format_id($address['country_id']);
+
+    return tep_address_format($format_id, $address, $html, $boln, $eoln);
+  }
+
+  function tep_row_number_format($number) {
+    if ( ($number < 10) && (substr($number, 0, 1) != '0') ) $number = '0' . $number;
+
+    return $number;
+  }
+
+  function tep_get_categories($categories_array = '', $parent_id = '0', $indent = '') {
+    global $languages_id;
+
+    if (!is_array($categories_array)) $categories_array = array();
+
+    $categories_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $categories_array[] = array('id' => $categories['categories_id'],
+                                  'text' => $indent . $categories['categories_name']);
+
+      if ($categories['categories_id'] != $parent_id) {
+        $categories_array = tep_get_categories($categories_array, $categories['categories_id'], $indent . '&nbsp;&nbsp;');
+      }
+    }
+
+    return $categories_array;
+  }
+
+  function tep_get_manufacturers($manufacturers_array = '') {
+    if (!is_array($manufacturers_array)) $manufacturers_array = array();
+
+    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+      $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']);
+    }
+
+    return $manufacturers_array;
+  }
+
+////
+// Return all subcategory IDs
+// TABLES: categories
+  function tep_get_subcategories(&$subcategories_array, $parent_id = 0) {
+    $subcategories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$parent_id . "'");
+    while ($subcategories = tep_db_fetch_array($subcategories_query)) {
+      $subcategories_array[sizeof($subcategories_array)] = $subcategories['categories_id'];
+      if ($subcategories['categories_id'] != $parent_id) {
+        tep_get_subcategories($subcategories_array, $subcategories['categories_id']);
+      }
+    }
+  }
+
+// Output a raw date string in the selected locale date format
+// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
+  function tep_date_long($raw_date) {
+    if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;
+
+    $year = (int)substr($raw_date, 0, 4);
+    $month = (int)substr($raw_date, 5, 2);
+    $day = (int)substr($raw_date, 8, 2);
+    $hour = (int)substr($raw_date, 11, 2);
+    $minute = (int)substr($raw_date, 14, 2);
+    $second = (int)substr($raw_date, 17, 2);
+
+    return strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));
+  }
+
+////
+// Output a raw date string in the selected locale date format
+// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
+// NOTE: Includes a workaround for dates before 01/01/1970 that fail on windows servers
+  function tep_date_short($raw_date) {
+    if ( ($raw_date == '0000-00-00 00:00:00') || empty($raw_date) ) return false;
+
+    $year = substr($raw_date, 0, 4);
+    $month = (int)substr($raw_date, 5, 2);
+    $day = (int)substr($raw_date, 8, 2);
+    $hour = (int)substr($raw_date, 11, 2);
+    $minute = (int)substr($raw_date, 14, 2);
+    $second = (int)substr($raw_date, 17, 2);
+
+    if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
+      return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
+    } else {
+      return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
+    }
+  }
+
+////
+// Parse search string into indivual objects
+  function tep_parse_search_string($search_str = '', &$objects) {
+    $search_str = trim(strtolower($search_str));
+
+// Break up $search_str on whitespace; quoted string will be reconstructed later
+    $pieces = split('[[:space:]]+', $search_str);
+    $objects = array();
+    $tmpstring = '';
+    $flag = '';
+
+    for ($k=0; $k<count($pieces); $k++) {
+      while (substr($pieces[$k], 0, 1) == '(') {
+        $objects[] = '(';
+        if (strlen($pieces[$k]) > 1) {
+          $pieces[$k] = substr($pieces[$k], 1);
+        } else {
+          $pieces[$k] = '';
+        }
+      }
+
+      $post_objects = array();
+
+      while (substr($pieces[$k], -1) == ')')  {
+        $post_objects[] = ')';
+        if (strlen($pieces[$k]) > 1) {
+          $pieces[$k] = substr($pieces[$k], 0, -1);
+        } else {
+          $pieces[$k] = '';
+        }
+      }
+
+// Check individual words
+
+      if ( (substr($pieces[$k], -1) != '"') && (substr($pieces[$k], 0, 1) != '"') ) {
+        $objects[] = trim($pieces[$k]);
+
+        for ($j=0; $j<count($post_objects); $j++) {
+          $objects[] = $post_objects[$j];
+        }
+      } else {
+/* This means that the $piece is either the beginning or the end of a string.
+   So, we'll slurp up the $pieces and stick them together until we get to the
+   end of the string or run out of pieces.
+*/
+
+// Add this word to the $tmpstring, starting the $tmpstring
+        $tmpstring = trim(ereg_replace('"', ' ', $pieces[$k]));
+
+// Check for one possible exception to the rule. That there is a single quoted word.
+        if (substr($pieces[$k], -1 ) == '"') {
+// Turn the flag off for future iterations
+          $flag = 'off';
+
+          $objects[] = trim($pieces[$k]);
+
+          for ($j=0; $j<count($post_objects); $j++) {
+            $objects[] = $post_objects[$j];
+          }
+
+          unset($tmpstring);
+
+// Stop looking for the end of the string and move onto the next word.
+          continue;
+        }
+
+// Otherwise, turn on the flag to indicate no quotes have been found attached to this word in the string.
+        $flag = 'on';
+
+// Move on to the next word
+        $k++;
+
+// Keep reading until the end of the string as long as the $flag is on
+
+        while ( ($flag == 'on') && ($k < count($pieces)) ) {
+          while (substr($pieces[$k], -1) == ')') {
+            $post_objects[] = ')';
+            if (strlen($pieces[$k]) > 1) {
+              $pieces[$k] = substr($pieces[$k], 0, -1);
+            } else {
+              $pieces[$k] = '';
+            }
+          }
+
+// If the word doesn't end in double quotes, append it to the $tmpstring.
+          if (substr($pieces[$k], -1) != '"') {
+// Tack this word onto the current string entity
+            $tmpstring .= ' ' . $pieces[$k];
+
+// Move on to the next word
+            $k++;
+            continue;
+          } else {
+/* If the $piece ends in double quotes, strip the double quotes, tack the
+   $piece onto the tail of the string, push the $tmpstring onto the $haves,
+   kill the $tmpstring, turn the $flag "off", and return.
+*/
+            $tmpstring .= ' ' . trim(ereg_replace('"', ' ', $pieces[$k]));
+
+// Push the $tmpstring onto the array of stuff to search for
+            $objects[] = trim($tmpstring);
+
+            for ($j=0; $j<count($post_objects); $j++) {
+              $objects[] = $post_objects[$j];
+            }
+
+            unset($tmpstring);
+
+// Turn off the flag to exit the loop
+            $flag = 'off';
+          }
+        }
+      }
+    }
+
+// add default logical operators if needed
+    $temp = array();
+    for($i=0; $i<(count($objects)-1); $i++) {
+      $temp[] = $objects[$i];
+      if ( ($objects[$i] != 'and') &&
+           ($objects[$i] != 'or') &&
+           ($objects[$i] != '(') &&
+           ($objects[$i+1] != 'and') &&
+           ($objects[$i+1] != 'or') &&
+           ($objects[$i+1] != ')') ) {
+        $temp[] = ADVANCED_SEARCH_DEFAULT_OPERATOR;
+      }
+    }
+    $temp[] = $objects[$i];
+    $objects = $temp;
+
+    $keyword_count = 0;
+    $operator_count = 0;
+    $balance = 0;
+    for($i=0; $i<count($objects); $i++) {
+      if ($objects[$i] == '(') $balance --;
+      if ($objects[$i] == ')') $balance ++;
+      if ( ($objects[$i] == 'and') || ($objects[$i] == 'or') ) {
+        $operator_count ++;
+      } elseif ( ($objects[$i]) && ($objects[$i] != '(') && ($objects[$i] != ')') ) {
+        $keyword_count ++;
+      }
+    }
+
+    if ( ($operator_count < $keyword_count) && ($balance == 0) ) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+////
+// Check date
+  function tep_checkdate($date_to_check, $format_string, &$date_array) {
+    $separator_idx = -1;
+
+    $separators = array('-', ' ', '/', '.');
+    $month_abbr = array('jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec');
+    $no_of_days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+
+    $format_string = strtolower($format_string);
+
+    if (strlen($date_to_check) != strlen($format_string)) {
+      return false;
+    }
+
+    $size = sizeof($separators);
+    for ($i=0; $i<$size; $i++) {
+      $pos_separator = strpos($date_to_check, $separators[$i]);
+      if ($pos_separator != false) {
+        $date_separator_idx = $i;
+        break;
+      }
+    }
+
+    for ($i=0; $i<$size; $i++) {
+      $pos_separator = strpos($format_string, $separators[$i]);
+      if ($pos_separator != false) {
+        $format_separator_idx = $i;
+        break;
+      }
+    }
+
+    if ($date_separator_idx != $format_separator_idx) {
+      return false;
+    }
+
+    if ($date_separator_idx != -1) {
+      $format_string_array = explode( $separators[$date_separator_idx], $format_string );
+      if (sizeof($format_string_array) != 3) {
+        return false;
+      }
+
+      $date_to_check_array = explode( $separators[$date_separator_idx], $date_to_check );
+      if (sizeof($date_to_check_array) != 3) {
+        return false;
+      }
+
+      $size = sizeof($format_string_array);
+      for ($i=0; $i<$size; $i++) {
+        if ($format_string_array[$i] == 'mm' || $format_string_array[$i] == 'mmm') $month = $date_to_check_array[$i];
+        if ($format_string_array[$i] == 'dd') $day = $date_to_check_array[$i];
+        if ( ($format_string_array[$i] == 'yyyy') || ($format_string_array[$i] == 'aaaa') ) $year = $date_to_check_array[$i];
+      }
+    } else {
+      if (strlen($format_string) == 8 || strlen($format_string) == 9) {
+        $pos_month = strpos($format_string, 'mmm');
+        if ($pos_month != false) {
+          $month = substr( $date_to_check, $pos_month, 3 );
+          $size = sizeof($month_abbr);
+          for ($i=0; $i<$size; $i++) {
+            if ($month == $month_abbr[$i]) {
+              $month = $i;
+              break;
+            }
+          }
+        } else {
+          $month = substr($date_to_check, strpos($format_string, 'mm'), 2);
+        }
+      } else {
+        return false;
+      }
+
+      $day = substr($date_to_check, strpos($format_string, 'dd'), 2);
+      $year = substr($date_to_check, strpos($format_string, 'yyyy'), 4);
+    }
+
+    if (strlen($year) != 4) {
+      return false;
+    }
+
+    if (!settype($year, 'integer') || !settype($month, 'integer') || !settype($day, 'integer')) {
+      return false;
+    }
+
+    if ($month > 12 || $month < 1) {
+      return false;
+    }
+
+    if ($day < 1) {
+      return false;
+    }
+
+    if (tep_is_leap_year($year)) {
+      $no_of_days[1] = 29;
+    }
+
+    if ($day > $no_of_days[$month - 1]) {
+      return false;
+    }
+
+    $date_array = array($year, $month, $day);
+
+    return true;
+  }
+
+////
+// Check if year is a leap year
+  function tep_is_leap_year($year) {
+    if ($year % 100 == 0) {
+      if ($year % 400 == 0) return true;
+    } else {
+      if (($year % 4) == 0) return true;
+    }
+
+    return false;
+  }
+
+////
+// Return table heading with sorting capabilities
+  function tep_create_sort_heading($sortby, $colnum, $heading) {
+    global $PHP_SELF;
+
+    $sort_prefix = '';
+    $sort_suffix = '';
+
+    if ($sortby) {
+      $sort_prefix = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '" title="' . tep_output_string(TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . '" class="productListing-heading">' ;
+      $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . '</a>';
+    }
+
+    return $sort_prefix . $heading . $sort_suffix;
+  }
+
+////
+// Recursively go through the categories and retreive all parent categories IDs
+// TABLES: categories
+  function tep_get_parent_categories(&$categories, $categories_id) {
+    $parent_categories_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$categories_id . "'");
+    while ($parent_categories = tep_db_fetch_array($parent_categories_query)) {
+      if ($parent_categories['parent_id'] == 0) return true;
+      $categories[sizeof($categories)] = $parent_categories['parent_id'];
+      if ($parent_categories['parent_id'] != $categories_id) {
+        tep_get_parent_categories($categories, $parent_categories['parent_id']);
+      }
+    }
+  }
+
+////
+// Construct a category path to the product
+// TABLES: products_to_categories
+  function tep_get_product_path($products_id) {
+    $cPath = '';
+
+    $category_query = tep_db_query("select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int)$products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id limit 1");
+    if (tep_db_num_rows($category_query)) {
+      $category = tep_db_fetch_array($category_query);
+
+      $categories = array();
+      tep_get_parent_categories($categories, $category['categories_id']);
+
+      $categories = array_reverse($categories);
+
+      $cPath = implode('_', $categories);
+
+      if (tep_not_null($cPath)) $cPath .= '_';
+      $cPath .= $category['categories_id'];
+    }
+
+    return $cPath;
+  }
+
+////
+// Return a product ID with attributes
+  function tep_get_uprid($prid, $params) {
+    $uprid = $prid;
+    if ( (is_array($params)) && (!strstr($prid, '{')) ) {
+      while (list($option, $value) = each($params)) {
+        $uprid = $uprid . '{' . $option . '}' . $value;
+      }
+    }
+
+    return $uprid;
+  }
+
+////
+// Return a product ID from a product ID with attributes
+  function tep_get_prid($uprid) {
+    $pieces = explode('{', $uprid);
+
+    return $pieces[0];
+  }
+
+////
+// Return a customer greeting
+  function tep_customer_greeting() {
+    global $customer_id, $customer_first_name;
+
+    if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
+      $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
+    } else {
+      $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
+    }
+
+    return $greeting_string;
+  }
+
+////
+//! Send email (text/html) using MIME
+// This is the central mail function. The SMTP Server should be configured
+// correct in php.ini
+// Parameters:
+// $to_name           The name of the recipient, e.g. "Jan Wildeboer"
+// $to_email_address  The eMail address of the recipient,
+//                    e.g. jan.wildeboer at gmx.de
+// $email_subject     The subject of the eMail
+// $email_text        The text of the eMail, may contain HTML entities
+// $from_email_name   The name of the sender, e.g. Shop Administration
+// $from_email_adress The eMail address of the sender,
+//                    e.g. info at mytepshop.com
+
+  function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) {
+    if (SEND_EMAILS != 'true') return false;
+
+    // Instantiate a new mail object
+    $message = new email(array('X-Mailer: osCommerce Mailer'));
+
+    // Build the text version
+    $text = strip_tags($email_text);
+    if (EMAIL_USE_HTML == 'true') {
+      $message->add_html($email_text, $text);
+    } else {
+      $message->add_text($text);
+    }
+
+    // Send message
+    $message->build_message();
+    $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
+  }
+
+////
+// Check if product has attributes
+  function tep_has_product_attributes($products_id) {
+    $attributes_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "'");
+    $attributes = tep_db_fetch_array($attributes_query);
+
+    if ($attributes['count'] > 0) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+// Check if product has attributes
+  function tep_has_product_subproducts($products_id) {
+    $subproducts_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_parent_id  = '" . (int)$products_id . "'");
+    $subproducts = tep_db_fetch_array($subproducts_query);
+
+    if ($subproducts['count'] > 0) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+////
+// Get the number of times a word/character is present in a string
+  function tep_word_count($string, $needle) {
+    $temp_array = split($needle, $string);
+
+    return sizeof($temp_array);
+  }
+
+  function tep_count_modules($modules = '') {
+    $count = 0;
+
+    if (empty($modules)) return $count;
+
+    $modules_array = split(';', $modules);
+
+    for ($i=0, $n=sizeof($modules_array); $i<$n; $i++) {
+      $class = substr($modules_array[$i], 0, strrpos($modules_array[$i], '.'));
+
+      if (is_object($GLOBALS[$class])) {
+        if ($GLOBALS[$class]->enabled) {
+          $count++;
+        }
+      }
+    }
+
+    return $count;
+  }
+
+  function tep_count_payment_modules() {
+    return tep_count_modules(MODULE_PAYMENT_INSTALLED);
+  }
+
+  function tep_count_shipping_modules() {
+    return tep_count_modules(MODULE_SHIPPING_INSTALLED);
+  }
+
+  function tep_create_random_value($length, $type = 'mixed') {
+    if ( ($type != 'mixed') && ($type != 'chars') && ($type != 'digits')) return false;
+
+    $rand_value = '';
+    while (strlen($rand_value) < $length) {
+      if ($type == 'digits') {
+        $char = tep_rand(0,9);
+      } else {
+        $char = chr(tep_rand(0,255));
+      }
+      if ($type == 'mixed') {
+        if (eregi('^[a-z0-9]$', $char)) $rand_value .= $char;
+      } elseif ($type == 'chars') {
+        if (eregi('^[a-z]$', $char)) $rand_value .= $char;
+      } elseif ($type == 'digits') {
+        if (ereg('^[0-9]$', $char)) $rand_value .= $char;
+      }
+    }
+
+    return $rand_value;
+  }
+
+  function tep_array_to_string($array, $exclude = '', $equals = '=', $separator = '&') {
+    if (!is_array($exclude)) $exclude = array();
+
+    $get_string = '';
+    if (sizeof($array) > 0) {
+      while (list($key, $value) = each($array)) {
+        if ( (!in_array($key, $exclude)) && ($key != 'x') && ($key != 'y') ) {
+          $get_string .= $key . $equals . $value . $separator;
+        }
+      }
+      $remove_chars = strlen($separator);
+      $get_string = substr($get_string, 0, -$remove_chars);
+    }
+
+    return $get_string;
+  }
+
+  function tep_not_null($value) {
+    if (is_array($value)) {
+      if (sizeof($value) > 0) {
+        return true;
+      } else {
+        return false;
+      }
+    } else {
+      if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) {
+        return true;
+      } else {
+        return false;
+      }
+    }
+  }
+
+////
+// Output the tax percentage with optional padded decimals
+  function tep_display_tax_value($value, $padding = TAX_DECIMAL_PLACES) {
+    if (strpos($value, '.')) {
+      $loop = true;
+      while ($loop) {
+        if (substr($value, -1) == '0') {
+          $value = substr($value, 0, -1);
+        } else {
+          $loop = false;
+          if (substr($value, -1) == '.') {
+            $value = substr($value, 0, -1);
+          }
+        }
+      }
+    }
+
+    if ($padding > 0) {
+      if ($decimal_pos = strpos($value, '.')) {
+        $decimals = strlen(substr($value, ($decimal_pos+1)));
+        for ($i=$decimals; $i<$padding; $i++) {
+          $value .= '0';
+        }
+      } else {
+        $value .= '.';
+        for ($i=0; $i<$padding; $i++) {
+          $value .= '0';
+        }
+      }
+    }
+
+    return $value;
+  }
+
+////
+// Checks to see if the currency code exists as a currency
+// TABLES: currencies
+  function tep_currency_exists($code) {
+    $code = tep_db_prepare_input($code);
+
+    $currency_code = tep_db_query("select currencies_id from " . TABLE_CURRENCIES . " where code = '" . tep_db_input($code) . "'");
+    if (tep_db_num_rows($currency_code)) {
+      return $code;
+    } else {
+      return false;
+    }
+  }
+
+  function tep_string_to_int($string) {
+    return (int)$string;
+  }
+
+////
+// Parse and secure the cPath parameter values
+  function tep_parse_category_path($cPath) {
+// make sure the category IDs are integers
+    $cPath_array = array_map('tep_string_to_int', explode('_', $cPath));
+
+// make sure no duplicate category IDs exist which could lock the server in a loop
+    $tmp_array = array();
+    $n = sizeof($cPath_array);
+    for ($i=0; $i<$n; $i++) {
+      if (!in_array($cPath_array[$i], $tmp_array)) {
+        $tmp_array[] = $cPath_array[$i];
+      }
+    }
+
+    return $tmp_array;
+  }
+
+////
+// Return a random value
+  function tep_rand($min = null, $max = null) {
+    static $seeded;
+
+    if (!isset($seeded)) {
+      mt_srand((double)microtime()*1000000);
+      $seeded = true;
+    }
+
+    if (isset($min) && isset($max)) {
+      if ($min >= $max) {
+        return $min;
+      } else {
+        return mt_rand($min, $max);
+      }
+    } else {
+      return mt_rand();
+    }
+  }
+
+  function tep_setcookie($name, $value = '', $expire = 0, $path = '/', $domain = '', $secure = 0) {
+    setcookie($name, $value, $expire, $path, (tep_not_null($domain) ? $domain : ''), $secure);
+  }
+
+  function tep_get_ip_address() {
+    if (isset($_SERVER)) {
+      if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+      } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
+        $ip = $_SERVER['HTTP_CLIENT_IP'];
+      } else {
+        $ip = $_SERVER['REMOTE_ADDR'];
+      }
+    } else {
+      if (getenv('HTTP_X_FORWARDED_FOR')) {
+        $ip = getenv('HTTP_X_FORWARDED_FOR');
+      } elseif (getenv('HTTP_CLIENT_IP')) {
+        $ip = getenv('HTTP_CLIENT_IP');
+      } else {
+        $ip = getenv('REMOTE_ADDR');
+      }
+    }
+
+    return $ip;
+  }
+
+  function tep_count_customer_orders($id = '', $check_session = true) {
+    global $customer_id;
+
+    if (is_numeric($id) == false) {
+      if (tep_session_is_registered('customer_id')) {
+        $id = $customer_id;
+      } else {
+        return 0;
+      }
+    }
+
+    if ($check_session == true) {
+      if ( (tep_session_is_registered('customer_id') == false) || ($id != $customer_id) ) {
+        return 0;
+      }
+    }
+
+    $orders_check_query = tep_db_query("select count(*) as total from " . TABLE_ORDERS . " where customers_id = '" . (int)$id . "'");
+    $orders_check = tep_db_fetch_array($orders_check_query);
+
+    return $orders_check['total'];
+  }
+
+  function tep_count_customer_address_book_entries($id = '', $check_session = true) {
+    global $customer_id;
+
+    if (is_numeric($id) == false) {
+      if (tep_session_is_registered('customer_id')) {
+        $id = $customer_id;
+      } else {
+        return 0;
+      }
+    }
+
+    if ($check_session == true) {
+      if ( (tep_session_is_registered('customer_id') == false) || ($id != $customer_id) ) {
+        return 0;
+      }
+    }
+
+    $addresses_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$id . "'");
+    $addresses = tep_db_fetch_array($addresses_query);
+
+    return $addresses['total'];
+  }
+
+// nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n)
+  function tep_convert_linefeeds($from, $to, $string) {
+    if ((PHP_VERSION < "4.0.5") && is_array($from)) {
+      return ereg_replace('(' . implode('|', $from) . ')', $to, $string);
+    } else {
+      return str_replace($from, $to, $string);
+    }
+  }
+
+// BOF: WebMakers.com Added: Downloads Controller
+//require(DIR_WS_FUNCTIONS . 'downloads_controller.php');
+require(DIR_WS_FUNCTIONS . FILENAME_DOWNLOADS_CONTROLLER);
+// EOF: WebMakers.com Added: Downloads Controller
+////
+//CLR 030228 Add function tep_decode_specialchars
+// Decode string encoded with htmlspecialchars()
+  function tep_decode_specialchars($string){
+    $string=str_replace('&gt;', '>', $string);
+    $string=str_replace('&lt;', '<', $string);
+    $string=str_replace('&#039;', "'", $string);
+    $string=str_replace('&quot;', "\"", $string);
+    $string=str_replace('&amp;', '&', $string);
+
+    return $string;
+  }
+
+////
+// saved from old code
+  function tep_output_warning($warning) {
+  return  (tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . $warning);
+  }
+  
+  // Draw a pulldown for Option Types
+  function draw_optiontype_pulldown($name, $default = '') {
+    $values = array();
+    $values[] = array('id' => 0, 'text' => 'Select');
+    $values[] = array('id' => 1, 'text' => 'Text');
+    $values[] = array('id' => 2, 'text' => 'Radio');
+    $values[] = array('id' => 3, 'text' => 'Checkbox');
+    $values[] = array('id' => 4, 'text' => 'Text Area');
+    
+    return tep_draw_pull_down_menu($name, $values, $default);
+  }
+  
+  //CLR 030312 add function to translate type_id to name
+  // Translate option_type_values to english string
+  function translate_type_to_name($opt_type) {
+    if ($opt_type == 0) return 'Select';
+    if ($opt_type == 1) return 'Text';
+    if ($opt_type == 2) return 'Radio';
+    if ($opt_type == 3) return 'Checkbox';
+    if ($opt_type == 4) return 'Text Area';
+    return 'Error ' . $opt_type;
+  }
+
+  function tep_get_box_heading($infobox_id, $languages_id) {
+      $configuration_query12 = tep_db_query("select box_heading from " . TABLE_INFOBOX_HEADING . " where infobox_id = '" . (int)$infobox_id . "' and languages_id = '" . (int)$languages_id . "'");
+      $configuration12 = tep_db_fetch_array($configuration_query12);
+  
+      return $configuration12['box_heading'];
+    }
+  
+// Contact Us Email Subject : DMG
+// PassionSeed Contact Us Email Subject begin
+  function tep_get_email_subjects_list($subjects_array = '') {
+    if (!is_array($subjects_array)) $subjects_array = array();
+
+    $subjects_query = tep_db_query("select email_subjects_id, email_subjects_name, email_subjects_category from " . TABLE_EMAIL_SUBJECTS . " where email_subjects_category = '2' order by email_subjects_name");
+    while ($subjects = tep_db_fetch_array($subjects_query)) {
+      $subjects_array[] = array('id' => $subjects['email_subjects_name'], 'text' => $subjects['email_subjects_name']);
+    }
+
+    return $subjects_array;
+  }
+// PassionSeed Contact us Email Subject end
+
+// Randomizer for specials modules ($products_id, $max_displayed)
+  function cre_random_array($random,$i){
+    srand((float) microtime() * 10000000);
+    $rand_keys = array_rand($random, $i);
+    $res = array();
+    if($i > 1){
+      for($a=0;$a<$i;$a++){
+       $res[] = $random[$rand_keys[$a]];
+      }
+    }else{
+      $res[] = $random[$rand_keys];   
+    }
+    return $res;
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/gv_functions.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/gv_functions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/gv_functions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: gv_functions.php ,v 1.
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function create_coupon_code($salt="secret", $length = SECURITY_CODE_LENGTH) {
+    $ccid = md5(uniqid("","salt"));
+    $ccid .= md5(uniqid("","salt"));
+    $ccid .= md5(uniqid("","salt"));
+    $ccid .= md5(uniqid("","salt"));
+    srand((double)microtime()*1000000); // seed the random number generator
+    $random_start = @rand(0, (128-$length));
+    $good_result = 0;
+    while ($good_result == 0) {
+      $id1=substr($ccid, $random_start,$length);
+      $query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . $id1 . "'");
+      if (tep_db_num_rows($query) == 0) $good_result = 1;
+    }
+    return $id1;
+  }
+////
+// Update the Customers GV account
+  function tep_gv_account_update($customer_id, $gv_id) {
+    $customer_gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $coupon_gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . (int)$gv_id . "'");
+    $coupon_gv = tep_db_fetch_array($coupon_gv_query);
+    if (tep_db_num_rows($customer_gv_query) > 0) {
+      $customer_gv = tep_db_fetch_array($customer_gv_query);
+      $new_gv_amount = $customer_gv['amount'] + $coupon_gv['coupon_amount'];
+   // new code bugfix
+   $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "' where customer_id = '" . $customer_id . "'");
+   // original code $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "'");
+    } else {
+      $gv_query = tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $coupon_gv['coupon_amount'] . "')");
+    }
+  }
+////
+// Get tax rate from tax description
+  function tep_get_tax_rate_from_desc($tax_desc) {
+    $tax_query = tep_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_description = '" . $tax_desc . "'");
+    $tax = tep_db_fetch_array($tax_query);
+    return $tax['tax_rate'];
+  }
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/functions/gzip_compression.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/gzip_compression.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/gzip_compression.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: gzip_compression.php,v 1.1.1.1 2004/03/04 23:40:50 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function tep_check_gzip() {
+    global $HTTP_ACCEPT_ENCODING;
+
+    if (headers_sent() || connection_aborted()) {
+      return false;
+    }
+
+    if (strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false) return 'x-gzip';
+
+    if (strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false) return 'gzip';
+
+    return false;
+  }
+
+/* $level = compression level 0-9, 0=none, 9=max */
+  function tep_gzip_output($level = 5) {
+    if ($encoding = tep_check_gzip()) {
+      $contents = ob_get_contents();
+      ob_end_clean();
+
+      header('Content-Encoding: ' . $encoding);
+
+      $size = strlen($contents);
+      $crc = crc32($contents);
+
+      $contents = gzcompress($contents, $level);
+      $contents = substr($contents, 0, strlen($contents) - 4);
+
+      echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
+      echo $contents;
+      echo pack('V', $crc);
+      echo pack('V', $size);
+    } else {
+      ob_end_flush();
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/header_tags.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/header_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/header_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+// /catalog/includes/functions/header_tags.php
+// WebMakers.com Added: Header Tags Generator v2.0
+
+////
+// Get products_head_title_tag
+// TABLES: products_description
+function tep_get_header_tag_products_title($product_id) {
+  global $languages_id, $HTTP_GET_VARS; 
+
+  $product_header_tags = tep_db_query("select products_head_title_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . (int)$languages_id . "' and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+  $product_header_tags_values = tep_db_fetch_array($product_header_tags);
+
+  return clean_html_comments($product_header_tags_values['products_head_title_tag']);
+  }
+
+
+////
+// Get products_head_keywords_tag
+// TABLES: products_description
+function tep_get_header_tag_products_keywords($product_id) {
+  global $languages_id, $HTTP_GET_VARS; 
+
+  $product_header_tags = tep_db_query("select products_head_keywords_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . (int)$languages_id . "' and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+  $product_header_tags_values = tep_db_fetch_array($product_header_tags);
+
+  return $product_header_tags_values['products_head_keywords_tag'];
+  }
+
+
+////
+// Get products_head_desc_tag
+// TABLES: products_description
+function tep_get_header_tag_products_desc($product_id) {
+  global $languages_id, $HTTP_GET_VARS; 
+
+  $product_header_tags = tep_db_query("select products_head_desc_tag from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . (int)$languages_id . "' and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+  $product_header_tags_values = tep_db_fetch_array($product_header_tags);
+
+  return $product_header_tags_values['products_head_desc_tag'];
+  }
+  
+////
+//used to add new pages without adding a lot of code
+function tep_header_tag_page($htta, $htta_string, $htda, $htda_string, $htka, $htka_string) {
+  global $tags_array;
+
+  if ($htda=='1') {
+    $tags_array['desc']= $htda_string . ' ' . HEAD_DESC_TAG_ALL;
+  } else {
+    $tags_array['desc']= $htda_string;
+  }
+
+  if ($htka=='1') {
+    $tags_array['keywords']= $htka_string . ' ' . HEAD_KEY_TAG_ALL;
+  } else {
+    $tags_array['keywords']= $htka_string ;
+  }
+  
+  if ($htta=='1') {
+    $tags_array['title']= $htta_string . ' ' . HEAD_TITLE_TAG_ALL;
+  } else {
+    $tags_array['title']= $htta_string;
+  }
+
+  return $tags_array;
+}
+?>

Added: trunk/direct.openmoko.com/includes/functions/html_output.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,390 @@
+<?php
+/*
+  $Id: html_output.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// The HTML href link wrapper function
+  function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
+    global $request_type, $session_started, $SID, $spider_flag;
+
+    if (!tep_not_null($page)) {
+     // die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
+      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000">'.TEP_HREF_LINK_ERROR1);
+    }
+
+    if ($connection == 'NONSSL') {
+      $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
+    } elseif ($connection == 'SSL') {
+      if (ENABLE_SSL == true) {
+        $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
+      } else {
+        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
+      }
+    } else {
+      //die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
+      die('</td></tr></table></td></tr></table><br><br><font color="#ff0000">'.TEP_HREF_LINK_ERROR2);
+    }
+
+    if (tep_not_null($parameters)) {
+      while ( (substr($parameters, -5) == '&amp;') ) $parameters = substr($parameters, 0, strlen($parameters)-5);
+      $link .= $page . '?' . tep_output_string($parameters);
+      $separator = '&amp;';
+    } else {
+      $link .= $page;
+      $separator = '?';
+    }
+
+    // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
+    // there is a minor logic problem with the original osCommerce code
+    // the SESSION_FORCE_COOKIE_USE must not be honored if changing from nonssl to ssl
+    if ( ($add_session_id == true) && ($session_started == true) ){
+      if ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
+        if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
+          $_sid = tep_session_name() . '=' . tep_session_id();
+        } elseif ( tep_not_null($SID) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
+          $_sid = $SID;
+        }
+      }
+    } 
+
+/*--------------------------------------------------------*\
+# Page cache contribution - by Chemo
+# CRE Mods - by Clarocque
+\*--------------------------------------------------------*/
+if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && 
+class_exists('page_cache')) {
+     $link .= $separator . '<osCsid>';
+} elseif (isset($_sid) && !$spider_flag) {
+      $link .= $separator . tep_output_string($_sid);
+}#eof if
+# eof Page Cache
+
+    return $link;
+  }
+
+////
+// The HTML image wrapper function
+  function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
+    if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
+      return false;
+    }
+
+// alt is added to the img tag even if it is null to prevent browsers from outputting
+// the image filename as default
+    $image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) {
+      $image .= ' title=" ' . tep_output_string($alt) . ' "';
+    }
+
+    if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
+      if ($image_size = @getimagesize($src)) {
+        if (empty($width) && tep_not_null($height)) {
+          $ratio = $height / $image_size[1];
+          $width = $image_size[0] * $ratio;
+        } elseif (tep_not_null($width) && empty($height)) {
+          $ratio = $width / $image_size[0];
+          $height = $image_size[1] * $ratio;
+        } elseif (empty($width) && empty($height)) {
+          $width = $image_size[0];
+          $height = $image_size[1];
+        }
+      } elseif (IMAGE_REQUIRED == 'false') {
+        return false;
+      }
+    }
+
+    if (tep_not_null($width) && tep_not_null($height)) {
+      $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
+    }
+
+    if (tep_not_null($parameters)) $image .= ' ' . $parameters;
+
+    $image .= '>';
+
+    return $image;
+  }
+
+
+// The Javascript Image wrapper build a image tag for a dummy picture,
+// then uses javascript to load the actual picure.  This approach prevents spiders from stealing images.
+  function tep_javascript_image($src, $name, $alt = '', $width = '', $height = '', $parameters = '', $popup = 'false') {
+    global $product_info;
+    $image = '';
+    if ( empty($name) || ((empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false')) ) {
+      return false;
+    }
+    // Do we need to add the pop up link code?
+    if ( $popup ) {
+      $image .= '<div align="center"><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=0') . '\')">' . "\n";
+    }
+    // alt is added to the img tag even if it is null to prevent browsers from outputting
+    // the image filename as default
+    $image .= '<img name="' . tep_output_string($name) . '" src="' . DIR_WS_IMAGES . 'pixel_trans.gif" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) {
+      $image .= ' title=" ' . tep_output_string($alt) . ' "';
+    }
+
+    if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
+      if ($image_size = @getimagesize($src)) {
+        if (empty($width) && tep_not_null($height)) {
+          $ratio = $height / $image_size[1];
+          $width = $image_size[0] * $ratio;
+        } elseif (tep_not_null($width) && empty($height)) {
+          $ratio = $width / $image_size[0];
+          $height = $image_size[1] * $ratio;
+        } elseif (empty($width) && empty($height)) {
+          $width = $image_size[0];
+          $height = $image_size[1];
+        }
+      } elseif (IMAGE_REQUIRED == 'false') {
+        return false;
+      }
+    }
+
+    if (tep_not_null($width) && tep_not_null($height)) {
+      $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
+    }
+
+    if (tep_not_null($parameters)) $image .= ' ' . $parameters;
+
+    $image .= '>' . "\n";
+    
+    if ( $popup ) {
+      $image .= '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a></div>' . "\n";
+    }
+    
+    // Now for the Javascript loading code
+    $image .= '<script type="text/javascript"><!-- ' . "\n";
+    $image .= "document['" . tep_output_string($name) . "'].src = '" . tep_output_string($src) . "'" . "\n";
+    $image .= ' //--></script>' ."\n";
+
+    return $image;
+  }
+
+
+  
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+// BOM Mod: force all buttons to come from the tempalte folders
+//  $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" alt="' . tep_output_string($alt) . '"';
+// EOM
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_image_button($image, $alt = '', $parameters = '') {
+    global $language;
+// BOM Mod: force all buttons to come from the tempalte folders
+//    return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
+     return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+// EOM
+  }
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_image_nontemplate_submit($image, $alt = '', $parameters = '') {
+    global $language;
+// BOM Mod: force all buttons to come from the tempalte folders
+  $image_submit = '<input type="image" src="' . tep_output_string($image) . '" alt="' . tep_output_string($alt) . '"';
+//    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" alt="' . tep_output_string($alt) . '"';
+// EOM
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_image_nontemplate_button($image, $alt = '', $parameters = '') {
+    global $language;
+// BOM Mod: force all buttons to come from the tempalte folders
+    return tep_image($image, $alt, '', '', $parameters);
+//     return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+// EOM
+  }
+
+////
+// Output a separator either through whitespace, or with an image
+  function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') {
+    return tep_image(DIR_WS_IMAGES . $image, '', $width, $height);
+  }
+
+////
+// Output a form
+  function tep_draw_form($name, $action, $method = 'post', $parameters = '') {
+    $form = '<form name="' . tep_output_string($name) . '" action="' . tep_output_string($action) . '" method="' . tep_output_string($method) . '"';
+
+    if (tep_not_null($parameters)) $form .= ' ' . $parameters;
+
+    $form .= '>';
+
+    return $form;
+  }
+
+////
+// Output a form input field
+  function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true) {
+    $field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
+
+    if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
+      $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';
+    } elseif (tep_not_null($value)) {
+      $field .= ' value="' . tep_output_string($value) . '"';
+    }
+
+    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
+
+    $field .= '>';
+
+    return $field;
+  }
+
+////
+// Output a form password field
+  function tep_draw_password_field($name, $value = '', $parameters = 'maxlength="40"') {
+    return tep_draw_input_field($name, $value, $parameters, 'password', false);
+  }
+
+////
+// Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field()
+  function tep_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {
+    $selection = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
+
+    if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($value) . '"';
+
+    if ( ($checked == true) || ( isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && ( ($GLOBALS[$name] == 'on') || (isset($value) && (stripslashes($GLOBALS[$name]) == $value)) ) ) ) {
+      $selection .= ' CHECKED';
+    }
+
+    if (tep_not_null($parameters)) $selection .= ' ' . $parameters;
+
+    $selection .= '>';
+
+    return $selection;
+  }
+
+////
+// Output a form checkbox field
+  function tep_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {
+    return tep_draw_selection_field($name, 'checkbox', $value, $checked, $parameters);
+  }
+
+////
+// Output a form radio field
+  function tep_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {
+    return tep_draw_selection_field($name, 'radio', $value, $checked, $parameters);
+  }
+
+////
+// Output a form textarea field
+  function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
+    $field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
+
+    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
+
+    $field .= '>';
+
+    if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
+      $field .= tep_output_string_protected(stripslashes($GLOBALS[$name]));
+    } elseif (tep_not_null($text)) {
+      $field .= tep_output_string_protected($text);
+    }
+
+    $field .= '</textarea>';
+
+    return $field;
+  }
+
+////
+// Output a form hidden field
+  function tep_draw_hidden_field($name, $value = '', $parameters = '') {
+    $field = '<input type="hidden" name="' . tep_output_string($name) . '"';
+
+    if (tep_not_null($value)) {
+      $field .= ' value="' . tep_output_string($value) . '"';
+    } elseif (isset($GLOBALS[$name])) {
+      $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';
+    }
+
+    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
+
+    $field .= '>';
+
+    return $field;
+  }
+
+////
+// Hide form elements
+  function tep_hide_session_id() {
+    global $session_started, $SID;
+
+    if (($session_started == true) && tep_not_null($SID)) {
+      return tep_draw_hidden_field(tep_session_name(), tep_session_id());
+    }
+  }
+
+////
+// Output a form pull down menu
+  function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
+    $field = '<select name="' . tep_output_string($name) . '"';
+
+    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
+
+    $field .= '>';
+
+    if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);
+
+    for ($i=0, $n=sizeof($values); $i<$n; $i++) {
+      $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
+      if ($default == $values[$i]['id']) {
+        $field .= ' SELECTED';
+      }
+
+      $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>';
+    }
+    $field .= '</select>';
+
+    if ($required == true) $field .= TEXT_FIELD_REQUIRED;
+
+    return $field;
+  }
+
+////
+// Creates a pull-down list of countries
+  function tep_get_country_list($name, $selected = '', $parameters = '') {
+    $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
+    $countries = tep_get_countries();
+
+    for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
+      $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
+    }
+
+    return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/information_html_output.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/information_html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/information_html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+
+// Output a function button in the selected language
+  function tep_information_image_button($image, $alt = '', $params = '') {
+    global $language;
+
+    return tep_image(DIR_WS_LANGUAGES . $language . '/images/' . $image, $alt, '', '', $params);
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/links.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: links.php,v 1.1.1.1 2004/03/04 23:40:51 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// Construct a path to the link
+// TABLES: links_to_link_categories
+  function tep_get_link_path($links_id) {
+    $lPath = '';
+
+    $category_query = tep_db_query("select l2c.link_categories_id from " . TABLE_LINKS . " l, " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2c where l.links_id = '" . (int)$links_id . "' and l.links_id = l2c.links_id limit 1");
+    if (tep_db_num_rows($category_query)) {
+      $category = tep_db_fetch_array($category_query);
+
+      $lPath .= $category['link_categories_id'];
+    }
+
+    return $lPath;
+  }
+
+
+////
+// The HTML image wrapper function
+  function tep_links_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
+    if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
+      return false;
+    }
+
+// alt is added to the img tag even if it is null to prevent browsers from outputting
+// the image filename as default
+    $image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) {
+      $image .= ' title=" ' . tep_output_string($alt) . ' "';
+    }
+
+    if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
+      if ($image_size = @getimagesize($src)) {
+        if (empty($width) && tep_not_null($height)) {
+          $ratio = $height / $image_size[1];
+          $width = $image_size[0] * $ratio;
+        } elseif (tep_not_null($width) && empty($height)) {
+          $ratio = $width / $image_size[0];
+          $height = $image_size[1] * $ratio;
+        } elseif (empty($width) && empty($height)) {
+          $width = $image_size[0];
+          $height = $image_size[1];
+        }
+      } elseif (IMAGE_REQUIRED == 'false') {
+        return false;
+      }
+    }
+
+    // VJ begin maintain image proportion
+    $calculate_image_proportion = 'true';
+
+    if( ($calculate_image_proportion == 'true') && (!empty($width) && !empty($height))) {
+      if ($image_size = @getimagesize($src)) {
+        $image_width = $image_size[0];
+        $image_height = $image_size[1];
+
+        if (($image_width != 1) && ($image_height != 1)) {
+          $whfactor = $image_width/$image_height;
+          $hwfactor = $image_height/$image_width;
+
+          if ( !($image_width > $width) && !($image_height > $height)) {
+            $width = $image_width;
+            $height = $image_height;
+          } elseif ( ($image_width > $width) && !($image_height > $height)) {
+            $height = $width * $hwfactor;
+          } elseif ( !($image_width > $width) && ($image_height > $height)) {
+            $width = $height * $whfactor;
+          } elseif ( ($image_width > $width) && ($image_height > $height)) {
+            if ($image_width > $image_height) {
+              $height = $width * $hwfactor;
+            } else {
+              $width = $height * $whfactor;
+            }
+          }
+        }
+      }
+    }
+    //VJ end maintain image proportion
+
+    if (tep_not_null($width) && tep_not_null($height)) {
+      $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
+    }
+
+    if (tep_not_null($parameters)) $image .= ' ' . $parameters;
+
+    $image .= '>';
+
+    return $image;
+  }
+
+////
+// Return the links url, based on whether click count is turned on/off
+  function tep_get_links_url($identifier) {
+    $links_query = tep_db_query("select links_id, links_url from " . TABLE_LINKS . " where links_id = '" . (int)$identifier . "'");
+
+    $link = tep_db_fetch_array($links_query);
+
+    if (ENABLE_LINKS_COUNT == 'True') {
+      if (ENABLE_SPIDER_FRIENDLY_LINKS == 'True') {
+        $user_agent = strtolower(getenv('HTTP_USER_AGENT'));
+        $spider_flag = false;
+
+        if (tep_not_null($user_agent)) {
+          $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');
+
+          for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {
+            if (tep_not_null($spiders[$i])) {
+              if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
+                $spider_flag = true;
+                break;
+              }
+            }
+          }
+        }
+
+        if ($spider_flag == true) {
+          $links_string = $link['links_url'];
+        } else {
+          $links_string = tep_href_link(FILENAME_REDIRECT, 'action=links&goto=' . $link['links_id']);
+        }
+      } else {
+          $links_string = tep_href_link(FILENAME_REDIRECT, 'action=links&goto=' . $link['links_id']);
+      }
+    } else {
+      $links_string = $link['links_url'];
+    }
+
+    return $links_string;
+  }
+
+////
+// Update the links click statistics
+  function tep_update_links_click_count($links_id) {
+    tep_db_query("update " . TABLE_LINKS . " set links_clicked = links_clicked + 1 where links_id = '" . (int)$links_id . "'");
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/newsdesk_general.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/newsdesk_general.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/newsdesk_general.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,179 @@
+<?php
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Generate a path to categories
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+function newsdesk_get_path($current_category_id = '') {
+global $newsPath_array;
+
+if ($current_category_id) {
+  $cp_size = sizeof($newsPath_array);
+  if ($cp_size == 0) {
+    $newsPath_new = $current_category_id;
+  } else {
+    $newsPath_new = '';
+    $last_category_query = tep_db_query("select parent_id from " . TABLE_NEWSDESK_CATEGORIES . " where categories_id = '" . $newsPath_array[($cp_size-1)] . "'");
+    $last_category = tep_db_fetch_array($last_category_query);
+    $current_category_query = tep_db_query("select parent_id from " . TABLE_NEWSDESK_CATEGORIES . " where categories_id = '" . $current_category_id . "'");
+    $current_category = tep_db_fetch_array($current_category_query);
+    if ($last_category['parent_id'] == $current_category['parent_id']) {
+      for ($i=0; $i<($cp_size-1); $i++) {
+        $newsPath_new .= '_' . $newsPath_array[$i];
+      }
+    } else {
+      for ($i=0; $i<$cp_size; $i++) {
+        $newsPath_new .= '_' . $newsPath_array[$i];
+      }
+    }
+    $newsPath_new .= '_' . $current_category_id;
+    if (substr($newsPath_new, 0, 1) == '_') {
+      $newsPath_new = substr($newsPath_new, 1);
+    }
+  }
+} else {
+  $newsPath_new = implode('_', $newsPath_array);
+}
+
+return 'newsPath=' . $newsPath_new;
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Parse and secure the newsPath parameter values
+function newsdesk_parse_category_path($newsPath) {
+// make sure the category IDs are integers
+$newsPath_array = array_map('tep_string_to_int', explode('_', $newsPath));
+
+// make sure no duplicate category IDs exist which could lock the server in a loop
+$tmp_array = array();
+$n = sizeof($newsPath_array);
+for ($i=0; $i<$n; $i++) {
+  if (!in_array($newsPath_array[$i], $tmp_array)) {
+    $tmp_array[] = $newsPath_array[$i];
+  }
+}
+
+return $tmp_array;
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Return true if the category has subcategories
+// TABLES: categories
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+function newsdesk_has_category_subcategories($category_id) {
+$child_category_query = tep_db_query("select count(*) as count from " . TABLE_NEWSDESK_CATEGORIES . " where parent_id = '" . $category_id . "'");
+$child_category = tep_db_fetch_array($child_category_query);
+
+if ($child_category['count'] > 0) {
+  return true;
+} else {
+  return false;
+}
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Construct a category path to the product
+// TABLES: products_to_categories
+function newsdesk_get_product_path($products_id) {
+$newsPath = '';
+
+$cat_count_sql = tep_db_query("select count(*) as count from " . TABLE_NEWSDESK_TO_CATEGORIES . " where newsdesk_id = '" . $products_id . "'");
+$cat_count_data = tep_db_fetch_array($cat_count_sql);
+
+if ($cat_count_data['count'] == 1) {
+  $categories = array();
+
+  $cat_id_sql = tep_db_query("select categories_id from " . TABLE_NEWSDESK_TO_CATEGORIES . " where newsdesk_id = '" . $products_id . "'");
+  $cat_id_data = tep_db_fetch_array($cat_id_sql);
+  newsdesk_get_parent_categories($categories, $cat_id_data['categories_id']);
+
+  $size = sizeof($categories)-1;
+  for ($i = $size; $i >= 0; $i--) {
+    if ($newsPath != '') $newsPath .= '_';
+      $newsPath .= $categories[$i];
+  }
+  if ($newsPath != '') $newsPath .= '_';
+    $newsPath .= $cat_id_data['categories_id'];
+}
+
+return $newsPath;
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Recursively go through the categories and retreive all parent categories IDs
+// TABLES: categories
+function newsdesk_get_parent_categories(&$categories, $categories_id) {
+$parent_categories_query = tep_db_query("select parent_id from " . TABLE_NEWSDESK_CATEGORIES . " where categories_id = '" . $categories_id . "'");
+
+while ($parent_categories = tep_db_fetch_array($parent_categories_query)) {
+  if ($parent_categories['parent_id'] == 0) return true;
+    $categories[sizeof($categories)] = $parent_categories['parent_id'];
+    if ($parent_categories['parent_id'] != $categories_id) {
+      newsdesk_get_parent_categories($categories, $parent_categories['parent_id']);
+    }
+  }
+}
+
+// Wolfen added code BOF
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+function newsdesk_get_categories($categories_array = '', $parent_id = '0', $indent = '') {
+global $languages_id;
+
+$parent_id = tep_db_prepare_input($parent_id);
+
+if (!is_array($categories_array)) $categories_array = array();
+
+$categories_query = tep_db_query(
+"select c.categories_id, cd.categories_name from " . TABLE_NEWSDESK_CATEGORIES . " c, " . TABLE_NEWSDESK_CATEGORIES_DESCRIPTION . "
+cd where c.catagory_status = '1' and parent_id = '" . tep_db_input($parent_id) . "' and c.categories_id = cd.categories_id and cd.language_id = '"
+. $languages_id . "' order by sort_order, cd.categories_name"
+);
+
+while ($categories = tep_db_fetch_array($categories_query)) {
+  $categories_array[] = array(
+    'id' => $categories['categories_id'],
+    'text' => $indent . $categories['categories_name']
+  );
+
+  if ($categories['categories_id'] != $parent_id) {
+    $categories_array = newsdesk_get_categories($categories_array, $categories['categories_id'], $indent . '&nbsp;&nbsp;');
+  }
+}
+
+return $categories_array;
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Return all subcategory IDs
+// TABLES: categories
+function newsdesk_get_subcategories(&$subcategories_array, $parent_id = 0) {
+$subcategories_query = tep_db_query("select categories_id from " . TABLE_NEWSDESK_CATEGORIES . " where parent_id = '" . $parent_id . "'");
+
+while ($subcategories = tep_db_fetch_array($subcategories_query)) {
+  $subcategories_array[sizeof($subcategories_array)] = $subcategories['categories_id'];
+  if ($subcategories['categories_id'] != $parent_id) {
+    newsdesk_get_subcategories($subcategories_array, $subcategories['categories_id']);
+  }
+}
+
+}
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+// Wolfen added code EOF
+
+
+/*
+
+  osCommerce, Open Source E-Commerce Solutions ---- http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+  Released under the GNU General Public License
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution but an add-on contributed to the osC community.
+  Please read the NOTE and INSTALL documents that are provided with this file for further information and installation notes.
+
+  script name:      NewsDesk
+  version:            1.48.2
+  date:             22-06-2004 (dd/mm/yyyy)
+  original author:    Carsten aka moyashi
+  web site:           www..com
+  modified code by:   Wolfen aka 241
+*/
+?>

Added: trunk/direct.openmoko.com/includes/functions/password_funcs.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/password_funcs.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/password_funcs.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: password_funcs.php,v 1.1.1.1 2004/03/04 23:40:51 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// This funstion validates a plain text password with an
+// encrpyted password
+  function tep_validate_password($plain, $encrypted) {
+    if (tep_not_null($plain) && tep_not_null($encrypted)) {
+// split apart the hash / salt
+      $stack = explode(':', $encrypted);
+
+      if (sizeof($stack) != 2) return false;
+
+      if (md5($stack[1] . $plain) == $stack[0]) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+////
+// This function makes a new password from a plaintext password.
+  function tep_encrypt_password($plain) {
+    $password = '';
+
+    for ($i=0; $i<10; $i++) {
+      $password .= tep_rand();
+    }
+
+    $salt = substr(md5($password), 0, 2);
+
+    $password = md5($salt . $plain) . ':' . $salt;
+
+    return $password;
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/sessions.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/sessions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/sessions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,173 @@
+<?php
+/*
+  $Id: sessions.php,v 1.1.1.1 2004/03/04 23:40:51 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (STORE_SESSIONS == 'mysql') {
+    if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
+      $SESS_LIFE = 1440;
+    }
+
+    function _sess_open($save_path, $session_name) {
+      return true;
+    }
+
+    function _sess_close() {
+      return true;
+    }
+
+    function _sess_read($key) {
+      $value_query = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "' and expiry > '" . time() . "'");
+      $value = tep_db_fetch_array($value_query);
+
+      if (isset($value['value'])) {
+        return $value['value'];
+      }
+
+      return false;
+    }
+
+    function _sess_write($key, $val) {
+      global $SESS_LIFE;
+
+      $expiry = time() + $SESS_LIFE;
+      $value = $val;
+
+      $check_query = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      if ($check['total'] > 0) {
+        return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . tep_db_input($expiry) . "', value = '" . tep_db_input($value) . "' where sesskey = '" . tep_db_input($key) . "'");
+      } else {
+        return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . tep_db_input($key) . "', '" . tep_db_input($expiry) . "', '" . tep_db_input($value) . "')");
+      }
+    }
+
+    function _sess_destroy($key) {
+      return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
+    }
+
+    function _sess_gc($maxlifetime) {
+      tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");
+
+      return true;
+    }
+
+    session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
+  }
+
+  function tep_session_start() {
+    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;
+
+    $sane_session_id = true;
+
+    if (isset($HTTP_GET_VARS[tep_session_name()])) {
+      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_GET_VARS[tep_session_name()]) == false) {
+        unset($HTTP_GET_VARS[tep_session_name()]);
+
+        $sane_session_id = false;
+      }
+    } elseif (isset($HTTP_POST_VARS[tep_session_name()])) {
+      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_POST_VARS[tep_session_name()]) == false) {
+        unset($HTTP_POST_VARS[tep_session_name()]);
+
+        $sane_session_id = false;
+      }
+    } elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {
+      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {
+        $session_data = session_get_cookie_params();
+
+        setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);
+
+        $sane_session_id = false;
+      }
+    }
+
+    if ($sane_session_id == false) {
+      tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
+    }
+
+    return session_start();
+  }
+
+  function tep_session_register($variable) {
+    global $session_started;
+
+    if ($session_started == true) {
+      return session_register($variable);
+    } else {
+      return false;
+    }
+  }
+
+  function tep_session_is_registered($variable) {
+    return session_is_registered($variable);
+  }
+
+  function tep_session_unregister($variable) {
+    return session_unregister($variable);
+  }
+
+  function tep_session_id($sessid = '') {
+    if (!empty($sessid)) {
+      return session_id($sessid);
+    } else {
+      return session_id();
+    }
+  }
+
+  function tep_session_name($name = '') {
+    if (!empty($name)) {
+      return session_name($name);
+    } else {
+      return session_name();
+    }
+  }
+
+  function tep_session_close() {
+    if (PHP_VERSION >= '4.0.4') {
+      return session_write_close();
+    } elseif (function_exists('session_close')) {
+      return session_close();
+    }
+  }
+
+  function tep_session_destroy() {
+    return session_destroy();
+  }
+
+  function tep_session_save_path($path = '') {
+    if (!empty($path)) {
+      return session_save_path($path);
+    } else {
+      return session_save_path();
+    }
+  }
+
+  function tep_session_recreate() {
+    if (PHP_VERSION >= 4.1) {
+      $session_backup = $_SESSION;
+
+      unset($_COOKIE[tep_session_name()]);
+
+      tep_session_destroy();
+
+      if (STORE_SESSIONS == 'mysql') {
+        session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
+      }
+
+      tep_session_start();
+
+      $_SESSION = $session_backup;
+      unset($session_backup);
+    }
+  }
+
+?>

Added: trunk/direct.openmoko.com/includes/functions/specials.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:40:51 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// Sets the status of a special product
+  function tep_set_specials_status($specials_id, $status) {
+    return tep_db_query("update " . TABLE_SPECIALS . " set status = '" . $status . "', date_status_change = now() where specials_id = '" . (int)$specials_id . "'");
+  }
+
+////
+// Auto expire products on special
+  function tep_expire_specials() {
+    $specials_query = tep_db_query("select specials_id from " . TABLE_SPECIALS . " where status = '1' and now() >= expires_date and expires_date > 0");
+    if (tep_db_num_rows($specials_query)) {
+      while ($specials = tep_db_fetch_array($specials_query)) {
+        tep_set_specials_status($specials['specials_id'], '0');
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/validations.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/validations.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/validations.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,122 @@
+<?php
+/*
+  $Id: validations.php,v 1.1.1.1 2004/03/04 23:40:51 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Function    : tep_validate_email
+  //
+  // Arguments   : email   email address to be checked
+  //
+  // Return      : true  - valid email address
+  //               false - invalid email address
+  //
+  // Description : function for validating email address that conforms to RFC 822 specs
+  //
+  //               This function is converted from a JavaScript written by
+  //               Sandeep V. Tamhankar (stamhankar at hotmail.com). The original JavaScript
+  //               is available at http://javascript.internet.com
+  //
+  // Sample Valid Addresses:
+  //
+  //    first.last at host.com
+  //    firstlast at host.to
+  //    "first last"@host.com
+  //    "first at last"@host.com
+  //    first-last at host.com
+  //    first.last@[123.123.123.123]
+  //
+  // Invalid Addresses:
+  //
+  //    first last at host.com
+  //
+  //
+  ////////////////////////////////////////////////////////////////////////////////////////////////
+  function tep_validate_email($email) {
+    $valid_address = true;
+
+    $mail_pat = '^(.+)@(.+)$';
+    $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
+    $atom = "$valid_chars+";
+    $quoted_user='(\"[^\"]*\")';
+    $word = "($atom|$quoted_user)";
+    $user_pat = "^$word(\.$word)*$";
+    $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
+    $domain_pat = "^$atom(\.$atom)*$";
+
+    if (eregi($mail_pat, $email, $components)) {
+      $user = $components[1];
+      $domain = $components[2];
+      // validate user
+      if (eregi($user_pat, $user)) {
+        // validate domain
+        if (eregi($ip_domain_pat, $domain, $ip_components)) {
+          // this is an IP address
+          for ($i=1;$i<=4;$i++) {
+            if ($ip_components[$i] > 255) {
+              $valid_address = false;
+              break;
+            }
+          }
+        }
+        else {
+          // Domain is a name, not an IP
+          if (eregi($domain_pat, $domain)) {
+            /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD
+               and that there's a hostname preceding the domain or country. */
+            $domain_components = explode(".", $domain);
+            // Make sure there's a host name preceding the domain.
+            if (sizeof($domain_components) < 2) {
+              $valid_address = false;
+            } else {
+              $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);
+              // Allow all 2-letter TLDs (ccTLDs)
+              if (eregi('^[a-z][a-z]$', $top_level_domain) != 1) {
+                $tld_pattern = '';
+                // Get authorized TLDs from text file
+                $tlds = file(DIR_WS_INCLUDES . 'tld.txt');
+                while (list(,$line) = each($tlds)) {
+                  // Get rid of comments
+                  $words = explode('#', $line);
+                  $tld = trim($words[0]);
+                  // TLDs should be 3 letters or more
+                  if (eregi('^[a-z]{3,}$', $tld) == 1) {
+                    $tld_pattern .= '^' . $tld . '$|';
+                  }
+                }
+                // Remove last '|'
+                $tld_pattern = substr($tld_pattern, 0, -1);
+                if (eregi("$tld_pattern", $top_level_domain) == 0) {
+                    $valid_address = false;
+                }
+              }
+            }
+          }
+          else {
+            $valid_address = false;
+          }
+        }
+      }
+      else {
+        $valid_address = false;
+      }
+    }
+    else {
+      $valid_address = false;
+    }
+    if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') {
+      if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) {
+        $valid_address = false;
+      }
+    }
+    return $valid_address;
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/visual_verify_code.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/visual_verify_code.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/visual_verify_code.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+///////////////////////////////////////////////////
+  file: visual_verify_code.php,v 1.0 26SEP03
+
+Written for use with:
+  osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com
+Part of Contribution Named:
+  Visual Verify Code (VVC) by William L. Peer, Jr. (wpeer at forgepower.com) for www.onlyvotives.com
+
+[Modified By] [Date] [Mods Made]
+-------------------------------------------
+
+
+-------------------------------------------
+*/
+
+//////////////////////////////
+/* This funtion has the responsibility of displaying the actual visual code with random results.
+   It randomly picks an x and y position as well as font size for each character in the visual code
+*/
+  function vvcode_render_code($code) {
+        if (!empty($code)) {
+            $imwidth=100;
+            $imheight=25;
+            Header("Content-type: image/Jpeg");
+            $im = @ImageCreate ($imwidth, $imheight) or die ("ERROR! Cannot create new GD image - see: verify_code_img_gen.php");
+
+            $background_color = ImageColorAllocate ($im, 255, 255, 255);
+            $text_color = ImageColorAllocate ($im, 0, 0, 0);
+            $border_color = ImageColorAllocate ($im, 154, 154, 154);
+
+            //strip any spaces that may have crept in
+            //end-user wouldn't know to type the space! :)
+            $code = str_replace(" ", "", $code);
+            $x=0;
+
+            $stringlength = strlen($code);
+            for ($i = 0; $i< $stringlength; $i++) {
+                 $x = $x + (rand (8, 15));
+                 $y = rand (2, 10);
+                 $font = rand (2,5);
+                 $single_char = substr($code, $i, 1);
+                 imagechar($im, $font, $x, $y, $single_char, $text_color);
+                }
+
+            imagerectangle ($im, 2, 2, $imwidth-2, $imheight-2, $border_color);
+
+            ImageJpeg($im);
+            ImageDestroy;
+        }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/webmakers_added_functions.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/webmakers_added_functions.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/webmakers_added_functions.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,155 @@
+<?php
+/*
+  WebMakers.com Added: Additional Functions
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+////
+// Verify Free Shipping or Regular Shipping modules to show
+  function tep_get_free_shipper($chk_shipper) {
+  global $cart;
+  $show_shipper =false;
+    switch (true) {
+      case ( ($chk_shipper =='freeshipper' and $cart->show_weight() == 0) ):
+        $show_shipper=true;
+        break;
+      case ( ($chk_shipper !='freeshipper' and $cart->show_weight() == 0) ):
+        $show_shipper=false;
+        break;
+
+      case ( ($chk_shipper =='freeshipper' and $cart->show_weight() != 0) ):
+        $show_shipper=false;
+        break;
+      case ( ($chk_shipper !='freeshipper' and $cart->show_weight() != 0) ):
+        $show_shipper=true;
+        break;
+      default:
+        $show_shipper=false;
+        break;
+    }
+
+  return $show_shipper;
+  }
+
+
+////
+// Verify Free Charge or Regular Payment methods to show
+  function tep_get_free_charger($chk_module) {
+  global $cart;
+
+  $show_it =false;
+    switch (true) {
+      case ( ($chk_module =='freecharger' and ($cart->show_total()==0 and $cart->show_weight() == 0)) ):
+        $show_it=true;
+        break;
+      case ( ($chk_module !='freecharger' and ($cart->show_total()==0 and $cart->show_weight() == 0)) ):
+        $show_it=false;
+        break;
+
+      case ( ($chk_module =='freecharger' and ($cart->show_total()!=0 or $cart->show_weight() != 0)) ):
+        $show_it=false;
+        break;
+      case ( ($chk_module !='freecharger' and ($cart->show_total()!=0 or $cart->show_weight() != 0)) ):
+        $show_it=true;
+        break;
+    }
+
+  return $show_it;
+  }
+
+////
+
+////
+// Display Price Retail
+// Specials and Tax Included
+  function tep_get_products_display_price($products_id, $prefix_tag=false, $value_price_only=false, $include_units=true) {
+    global $currencies;
+    $product_check_query = tep_db_query("select products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call, product_is_showroom_only from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'" . " limit 1");
+    $product_check = tep_db_fetch_array($product_check_query);
+
+    $display_price='';
+    $value_price=0;
+    // Price is either normal or priced by attributes
+      if ($product_check['products_priced_by_attribute']) {
+        $attributes_priced=tep_get_products_base_price($products_id, $include_units);
+        $display_price=$currencies->display_price( ($product_check['products_price'] + $attributes_priced + ($attributes_priced * ($product_check['products_price_markup']/100))),'',1);
+        $value_price=($product_check['products_price'] + $attributes_priced + ($attributes_priced * ($product_check['products_price_markup']/100)));
+      } else {
+        if ($product_check['products_price'] !=0) {
+          $display_price=$currencies->display_price($product_check['products_price'],tep_get_tax_rate($product_check['products_tax_class_id']),1);
+        }
+      }
+
+      // If a Special, Show it
+      if ($add_special=tep_get_products_special_price($products_id)) {
+        //       $products_price = '<s>' . $currencies->display_price($product_info_values['products_price'], tep_get_tax_rate($product_info_values['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info_values['products_tax_class_id'])) . '</span>';
+        $display_price = '<s>' . $display_price . '</s> <span class="productSpecialPrice"> ' . $currencies->display_price($add_special,tep_get_tax_rate($product_check['products_tax_class_id']),'1') .  '</span> ';
+      }
+
+      // If Free, Show it
+      if ($product_check['product_is_free']) {
+        if (PRODUCTS_PRICE_IS_FREE_IMAGE_ON=='0') {
+          $free_tag= ' ' . PRODUCTS_PRICE_IS_FREE_TEXT;
+        } else {
+          $free_tag= ' ' . tep_image(DIR_WS_IMAGES . PRODUCTS_PRICE_IS_FREE_IMAGE,PRODUCTS_PRICE_IS_FREE_TEXT);
+        }
+
+        if ($product_check['products_price'] !=0) {
+          $display_price='<s>' . $display_price . '</s>' . '<br><span class="ProductIsFree">' . $free_tag . '</span>';
+        } else {
+          $display_price='<span class="ProductIsFree">' . $free_tag . '</span>';
+        }
+      } // FREE
+
+      // If Call for Price, Show it
+      if ($product_check['product_is_call']) {
+        if (PRODUCTS_PRICE_IS_FREE_IMAGE_ON=='0') {
+          $call_tag=' ' . PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT;
+        } else {
+          $call_tag= ' ' . tep_image(DIR_WS_IMAGES . PRODUCTS_PRICE_IS_CALL_FOR_PRICE_IMAGE,PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT);
+        }
+
+        if ($product_check['products_price'] !=0) {
+          $display_price='<s>' . $display_price . '</s> ' .  $call_tag;
+        } else {
+          $display_price=$call_tag;
+        }
+      } // CALL
+
+      // If Showroom, Show it
+      if ($product_check['product_is_showroom_only']) {
+        if (PRODUCTS_PRICE_IS_SHOWROOM_IMAGE_ON=='0') {
+          $showroom_only_tag= ' ' . PRODUCTS_PRICE_IS_SHOWROOM_ONLY_TEXT;
+        } else {
+          $showroom_only_tag= ' ' . tep_image(DIR_WS_IMAGES . PRODUCTS_PRICE_IS_SHOWROOM_ONLY_IMAGE,PRODUCTS_PRICE_IS_SHOWROOM_ONLY_TEXT);
+        }
+
+        if ($product_check['products_price'] !=0) {
+//          $display_price='<s>' . $display_price . '</s>' . '<br><span class="ProductIsShowroomOnly">' . $showroom_only_tag . '</span>';
+          $display_price=$display_price . '<br><span class="ProductIsShowroomOnly">' . $showroom_only_tag . '</span>';
+        } else {
+          $display_price='<span class="ProductIsShowroomOnly">' . $showroom_only_tag . '</span>';
+        }
+      } // FREE
+
+
+
+    if ($value_price_only) {
+      return $value_price;
+    } else {
+      if ($display_price) {
+        return ($prefix_tag ? $prefix_tag . ' ' : '') . $display_price;
+      } else {
+        return false;
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/functions/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/includes/functions/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/functions/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.11 2003/06/20 00:12:59 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  function tep_update_whos_online() {
+    global $customer_id;
+
+    if (tep_session_is_registered('customer_id')) {
+      $wo_customer_id = $customer_id;
+
+      $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+      $customer = tep_db_fetch_array($customer_query);
+
+      $wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
+    } else {
+      $wo_customer_id = '';
+      $wo_full_name = 'Guest';
+    }
+
+    $wo_session_id = tep_session_id();
+    $wo_ip_address = getenv('REMOTE_ADDR');
+    $wo_last_page_url = getenv('REQUEST_URI');
+
+    $current_time = time();
+    $xx_mins_ago = ($current_time - 900);
+
+// remove entries that have expired
+    tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
+
+    $stored_customer_query = tep_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where session_id = '" . tep_db_input($wo_session_id) . "'");
+    $stored_customer = tep_db_fetch_array($stored_customer_query);
+
+    if ($stored_customer['count'] > 0) {
+      tep_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int)$wo_customer_id . "', full_name = '" . tep_db_input($wo_full_name) . "', ip_address = '" . tep_db_input($wo_ip_address) . "', time_last_click = '" . tep_db_input($current_time) . "', last_page_url = '" . tep_db_input($wo_last_page_url) . "' where session_id = '" . tep_db_input($wo_session_id) . "'");
+    } else {
+      tep_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url, http_referer) values ('" . (int)$wo_customer_id . "', '" . tep_db_input($wo_full_name) . "', '" . tep_db_input($wo_session_id) . "', '" . tep_db_input($wo_ip_address) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($wo_last_page_url) . "', '" . tep_db_input($_SERVER['HTTP_REFERER']) . "')");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/general.js
===================================================================
--- trunk/direct.openmoko.com/includes/general.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/general.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,190 @@
+/*
+  $Id: general.js,v 1.1.1.1 2004/03/04 23:40:38 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+function SetFocus(TargetFormName) {
+  var target = 0;
+  if (TargetFormName != "") {
+    for (i=0; i<document.forms.length; i++) {
+      if (document.forms[i].name == TargetFormName) {
+        target = i;
+        break;
+      }
+    }
+  }
+
+  var TargetForm = document.forms[target];
+    
+  for (i=0; i<TargetForm.length; i++) {
+    if ( (TargetForm.elements[i].type != "image") && (TargetForm.elements[i].type != "hidden") && (TargetForm.elements[i].type != "reset") && (TargetForm.elements[i].type != "submit") ) {
+      TargetForm.elements[i].focus();
+
+      if ( (TargetForm.elements[i].type == "text") || (TargetForm.elements[i].type == "password") ) {
+        TargetForm.elements[i].select();
+      }
+
+      break;
+    }
+  }
+}
+
+function RemoveFormatString(TargetElement, FormatString) {
+  if (TargetElement.value == FormatString) {
+    TargetElement.value = "";
+  }
+
+  TargetElement.select();
+}
+
+function CheckDateRange(from, to) {
+  if (Date.parse(from.value) <= Date.parse(to.value)) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+function IsValidDate(DateToCheck, FormatString) {
+  var strDateToCheck;
+  var strDateToCheckArray;
+  var strFormatArray;
+  var strFormatString;
+  var strDay;
+  var strMonth;
+  var strYear;
+  var intday;
+  var intMonth;
+  var intYear;
+  var intDateSeparatorIdx = -1;
+  var intFormatSeparatorIdx = -1;
+  var strSeparatorArray = new Array("-"," ","/",".");
+  var strMonthArray = new Array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
+  var intDaysArray = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+
+  strDateToCheck = DateToCheck.toLowerCase();
+  strFormatString = FormatString.toLowerCase();
+  
+  if (strDateToCheck.length != strFormatString.length) {
+    return false;
+  }
+
+  for (i=0; i<strSeparatorArray.length; i++) {
+    if (strFormatString.indexOf(strSeparatorArray[i]) != -1) {
+      intFormatSeparatorIdx = i;
+      break;
+    }
+  }
+
+  for (i=0; i<strSeparatorArray.length; i++) {
+    if (strDateToCheck.indexOf(strSeparatorArray[i]) != -1) {
+      intDateSeparatorIdx = i;
+      break;
+    }
+  }
+
+  if (intDateSeparatorIdx != intFormatSeparatorIdx) {
+    return false;
+  }
+
+  if (intDateSeparatorIdx != -1) {
+    strFormatArray = strFormatString.split(strSeparatorArray[intFormatSeparatorIdx]);
+    if (strFormatArray.length != 3) {
+      return false;
+    }
+
+    strDateToCheckArray = strDateToCheck.split(strSeparatorArray[intDateSeparatorIdx]);
+    if (strDateToCheckArray.length != 3) {
+      return false;
+    }
+
+    for (i=0; i<strFormatArray.length; i++) {
+      if (strFormatArray[i] == 'mm' || strFormatArray[i] == 'mmm') {
+        strMonth = strDateToCheckArray[i];
+      }
+
+      if (strFormatArray[i] == 'dd') {
+        strDay = strDateToCheckArray[i];
+      }
+
+      if (strFormatArray[i] == 'yyyy') {
+        strYear = strDateToCheckArray[i];
+      }
+    }
+  } else {
+    if (FormatString.length > 7) {
+      if (strFormatString.indexOf('mmm') == -1) {
+        strMonth = strDateToCheck.substring(strFormatString.indexOf('mm'), 2);
+      } else {
+        strMonth = strDateToCheck.substring(strFormatString.indexOf('mmm'), 3);
+      }
+
+      strDay = strDateToCheck.substring(strFormatString.indexOf('dd'), 2);
+      strYear = strDateToCheck.substring(strFormatString.indexOf('yyyy'), 2);
+    } else {
+      return false;
+    }
+  }
+
+  if (strYear.length != 4) {
+    return false;
+  }
+
+  intday = parseInt(strDay, 10);
+  if (isNaN(intday)) {
+    return false;
+  }
+  if (intday < 1) {
+    return false;
+  }
+
+  intMonth = parseInt(strMonth, 10);
+  if (isNaN(intMonth)) {
+    for (i=0; i<strMonthArray.length; i++) {
+      if (strMonth == strMonthArray[i]) {
+        intMonth = i+1;
+        break;
+      }
+    }
+    if (isNaN(intMonth)) {
+      return false;
+    }
+  }
+  if (intMonth > 12 || intMonth < 1) {
+    return false;
+  }
+
+  intYear = parseInt(strYear, 10);
+  if (isNaN(intYear)) {
+    return false;
+  }
+  if (IsLeapYear(intYear) == true) {
+    intDaysArray[1] = 29;
+  }
+
+  if (intday > intDaysArray[intMonth - 1]) {
+    return false;
+  }
+  
+  return true;
+}
+
+function IsLeapYear(intYear) {
+  if (intYear % 100 == 0) {
+    if (intYear % 400 == 0) {
+      return true;
+    }
+  } else {
+    if ((intYear % 4) == 0) {
+      return true;
+    }
+  }
+
+  return false;
+}

Added: trunk/direct.openmoko.com/includes/header.php
===================================================================
--- trunk/direct.openmoko.com/includes/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: header.php,v 1.1.1.1 2004/03/04 23:40:39 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//You will need to edit this file In the /templates/(template name)/
+
+//If it is used by the template you are using>
+
+?>

Added: trunk/direct.openmoko.com/includes/header_tags.php
===================================================================
--- trunk/direct.openmoko.com/includes/header_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/header_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,516 @@
+<?php
+/*
+  /catalog/includes/header_tags.php
+  WebMakers.com Added: Header Tags Generator v2.0
+  Add META TAGS and Modify TITLE
+
+  NOTE: Globally replace all fields in products table with current product name just to get things started:
+  In phpMyAdmin use: UPDATE products_description set PRODUCTS_HEAD_TITLE_TAG = PRODUCTS_NAME
+
+  Shoppe Enhancement Controller - Copyright (c) 2003 WebMakers.com
+  Linda McGrath - osCommerce at WebMakers.com
+*/
+
+
+require(DIR_WS_LANGUAGES . $language . '/' . 'header_tags.php');
+
+$tags_array = array();
+
+// Define specific settings per page:
+switch (true) {
+  // ALLPRODS.PHP
+  case (strstr($_SERVER['PHP_SELF'],FILENAME_ALLPRODS) or strstr($PHP_SELF,FILENAME_ALLPRODS) ):
+    $the_category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");
+    $the_category = tep_db_fetch_array($the_category_query);
+
+    if ( isset( $HTTP_GET_VARS['manufacturers_id'] ) ) {
+      $the_manufacturers_query= tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
+      $the_manufacturers = tep_db_fetch_array($the_manufacturers_query);
+    } else {
+      $the_manufacturers['manufacturers_name'] = '';
+    }
+
+    if (HTDA_ALLPRODS_ON=='1') {
+      $tags_array['desc']= HEAD_DESC_TAG_ALLPRODS . ' ' . HEAD_DESC_TAG_ALL;
+    } else {
+      $tags_array['desc']= HEAD_DESC_TAG_ALLPRODS;
+    }
+
+    if (HTKA_ALLPRODS_ON=='1') {
+      $tags_array['keywords']= HEAD_KEY_TAG_ALL . ' ' . HEAD_KEY_TAG_ALLPRODS;
+    } else {
+      $tags_array['keywords']= HEAD_KEY_TAG_ALLPRODS;
+    }
+
+    if (HTTA_ALLPRODS_ON=='1') {
+      $tags_array['title']= HEAD_TITLE_TAG_ALLPRODS . ' ' . HEAD_TITLE_TAG_ALL . " " . $the_category['categories_name'] . $the_manufacturers['manufacturers_name'];
+    } else {
+      $tags_array['title']= HEAD_TITLE_TAG_ALLPRODS;
+    }
+    break;
+
+
+
+// INDEX.PHP
+  case (strstr($_SERVER['PHP_SELF'],FILENAME_DEFAULT) or strstr($PHP_SELF,FILENAME_DEFAULT) ):
+    $the_category_query = tep_db_query("select categories_name, categories_head_title_tag, categories_head_desc_tag, categories_head_keywords_tag  from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");
+   // $the_category_query = tep_db_query("select cd.categories_name, cd.categories_head_desc_tag ,cd.categories_head_title_tag, cd.categories_head_keywords_tag from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");
+    $the_category = tep_db_fetch_array($the_category_query);
+
+    if ( isset( $HTTP_GET_VARS['manufacturers_id'] ) ) {
+      $the_manufacturers_query= tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
+      $the_manufacturers = tep_db_fetch_array($the_manufacturers_query);
+    } else {
+      $the_manufacturers['manufacturers_name'] = '';
+    }
+ 
+    $showCatTags = false;
+    if ($category_depth == 'nested' || ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id']))) 
+      $showCatTags = true;
+    
+    if (HTDA_DEFAULT_ON=='1') {
+      if ($showCatTags == true) {
+         if (HTTA_CAT_DEFAULT_ON=='1') {
+           $tags_array['desc']= $the_category['categories_head_desc_tag'] . ' ' . HEAD_DESC_TAG_DEFAULT . ' ' . HEAD_DESC_TAG_ALL;
+         } else {
+           $tags_array['desc']= $the_category['categories_head_desc_tag'] . ' ' . HEAD_DESC_TAG_ALL;
+         }
+    //  $the_desc= $the_category['categories_head_desc_tag'] . ' ' . HEAD_DESC_TAG_ALL;
+      } else {
+        $tags_array['desc']= HEAD_DESC_TAG_DEFAULT . ' ' . HEAD_DESC_TAG_ALL;
+      }
+    } else {
+      if ($showCatTags == true) {
+         if (HTTA_CAT_DEFAULT_ON=='1') {
+           $tags_array['desc']= $the_category['categories_head_desc_tag'] . ' ' . HEAD_DESC_TAG_DEFAULT;
+    //  $the_desc= $the_category['categories_head_desc_tag'] . ' ' . HEAD_DESC_TAG_DEFAULT;
+         } else {
+           $tags_array['desc']= $the_category['categories_head_desc_tag'];
+         }
+      } else {
+        $tags_array['desc']= HEAD_DESC_TAG_DEFAULT;
+      }  
+    }
+
+    if (HTKA_DEFAULT_ON=='1') {
+      if ($showCatTags == true) {
+  //    $the_key_words= clean_html_comments($the_category['categories_head_keywords_tag']) . ' ' . HEAD_KEY_TAG_ALL;
+          if (HTTA_CAT_DEFAULT_ON=='1') {
+            $tags_array['keywords']= $the_category['categories_head_keywords_tag'] . ' ' . HEAD_KEY_TAG_ALL . ' ' . HEAD_KEY_TAG_DEFAULT;
+          } else {  
+            $tags_array['keywords']= $the_category['categories_head_keywords_tag'] .  ' ' . HEAD_KEY_TAG_DEFAULT;
+          }
+      } else {
+        $tags_array['keywords']= HEAD_KEY_TAG_ALL . ' ' . HEAD_KEY_TAG_DEFAULT;
+      }  
+    } else {
+      if ($showCatTags == true) {
+    //  $the_key_words= clean_html_comments($the_category['categories_head_keywords_tag']) . ' ' . HEAD_KEY_TAG_DEFAULT;
+         if (HTTA_CAT_DEFAULT_ON=='1') {
+           $tags_array['keywords']= $the_category['categories_head_keywords_tag'] . ' ' . HEAD_KEY_TAG_DEFAULT;
+         } else {
+           $tags_array['keywords']= $the_category['categories_head_keywords_tag'];
+         }  
+      } else {
+         $tags_array['keywords']= HEAD_KEY_TAG_DEFAULT;
+      }   
+    }
+
+    if (HTTA_DEFAULT_ON=='1') {
+      if ($showCatTags == true) {
+    //  $the_title= $the_category['categories_head_title_tag'] . ' ' . HEAD_TITLE_TAG_ALL . " " . $the_category['categories_name'] . $the_manufacturers['manufacturers_name'];
+        if (HTTA_CAT_DEFAULT_ON=='1') {
+          $tags_array['title']= $the_category['categories_head_title_tag'] .' '.  HEAD_TITLE_TAG_DEFAULT . " " .  $the_manufacturers['manufacturers_name'] . ' - ' . HEAD_TITLE_TAG_ALL;
+        } else {
+          $tags_array['title']= $the_category['categories_head_title_tag'] .' '.  $the_manufacturers['manufacturers_name'] . ' - ' . HEAD_TITLE_TAG_ALL;
+        }
+      } else {
+        $tags_array['title']= HEAD_TITLE_TAG_DEFAULT . " " . $the_category['categories_name'] . $the_manufacturers['manufacturers_name'] . ' - ' . HEAD_TITLE_TAG_ALL;
+      }
+    } else {
+      if ($showCatTags == true) {
+        if (HTTA_CAT_DEFAULT_ON=='1') {
+          $tags_array['title']= $the_category['categories_head_title_tag'] . ' ' . HEAD_TITLE_TAG_DEFAULT;
+    //  $the_title= $the_category['categories_head_title_tag'] . ' ' . HEAD_TITLE_TAG_DEFAULT;
+        } else {
+          $tags_array['title']= $the_category['categories_head_title_tag'];
+        } 
+      } else {
+        $tags_array['title']= HEAD_TITLE_TAG_DEFAULT;
+      }  
+    }
+
+    break;
+
+// PRODUCT_INFO.PHP
+  case ( strstr($_SERVER['PHP_SELF'],FILENAME_PRODUCT_INFO) or strstr($PHP_SELF,FILENAME_PRODUCT_INFO) ):
+//    $the_product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_keywords_tag, pd.products_head_desc_tag, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "'");
+    $the_product_info_query = tep_db_query("select pd.language_id, p.products_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_keywords_tag, pd.products_head_desc_tag, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" . " and pd.language_id ='" .  $languages_id . "'");
+    $the_product_info = tep_db_fetch_array($the_product_info_query);
+
+    if (empty($the_product_info['products_head_desc_tag'])) {
+      $tags_array['desc']= HEAD_DESC_TAG_ALL;
+    } else {
+      if ( HTDA_PRODUCT_INFO_ON=='1' ) {
+        $tags_array['desc']= $the_product_info['products_head_desc_tag'] . ' ' . HEAD_DESC_TAG_ALL;
+      } else {
+        $tags_array['desc']= $the_product_info['products_head_desc_tag'];
+      }
+    }
+
+    if (empty($the_product_info['products_head_keywords_tag'])) {
+      $tags_array['keywords']= HEAD_KEY_TAG_ALL;
+    } else {
+      if ( HTKA_PRODUCT_INFO_ON=='1' ) {
+        $tags_array['keywords']= $the_product_info['products_head_keywords_tag'] . ' ' . HEAD_KEY_TAG_ALL;
+      } else {
+        $tags_array['keywords']= $the_product_info['products_head_keywords_tag'];
+      }
+    }
+
+    if (empty($the_product_info['products_head_title_tag'])) {
+      $tags_array['title']= HEAD_TITLE_TAG_ALL;
+    } else {
+      if ( HTTA_PRODUCT_INFO_ON=='1' ) {
+        $tags_array['title']= clean_html_comments($the_product_info['products_head_title_tag']) . ' ' . HEAD_TITLE_TAG_ALL;
+      } else {
+        $tags_array['title']= clean_html_comments($the_product_info['products_head_title_tag']);
+      }
+    }
+
+    break;
+
+
+// PRODUCTS_NEW.PHP
+  case ( strstr($_SERVER['PHP_SELF'],FILENAME_PRODUCTS_NEW) or strstr($PHP_SELF,FILENAME_PRODUCTS_NEW) ):
+    if ( HEAD_DESC_TAG_WHATS_NEW!='' ) {
+      if ( HTDA_WHATS_NEW_ON=='1' ) {
+        $tags_array['desc']= HEAD_DESC_TAG_WHATS_NEW . ' ' . HEAD_DESC_TAG_ALL;
+      } else {
+        $tags_array['desc']= HEAD_DESC_TAG_WHATS_NEW;
+      }
+    } else {
+      $tags_array['desc']= HEAD_DESC_TAG_ALL;
+    }
+
+    if ( HEAD_KEY_TAG_WHATS_NEW!='' ) {
+      if ( HTKA_WHATS_NEW_ON=='1' ) {
+        $tags_array['keywords']= HEAD_KEY_TAG_WHATS_NEW . ' ' . HEAD_KEY_TAG_ALL;
+      } else {
+        $tags_array['keywords']= HEAD_KEY_TAG_WHATS_NEW;
+      }
+    } else {
+      $tags_array['keywords']= HEAD_KEY_TAG_ALL;
+    }
+
+    if ( HEAD_TITLE_TAG_WHATS_NEW!='' ) {
+      if ( HTTA_WHATS_NEW_ON=='1' ) {
+        $tags_array['title']= HEAD_TITLE_TAG_WHATS_NEW . ' ' . HEAD_TITLE_TAG_ALL;
+      } else {
+        $tags_array['title']= HEAD_TITLE_TAG_WHATS_NEW;
+      }
+    } else {
+      $tags_array['title']= HEAD_TITLE_TAG_ALL;
+    }
+
+    break;
+
+
+// SPECIALS.PHP
+  case ( strstr($_SERVER['PHP_SELF'],FILENAME_SPECIALS)  or strstr($PHP_SELF,FILENAME_SPECIALS) ):
+    if ( HEAD_DESC_TAG_SPECIALS!='' ) {
+      if ( HTDA_SPECIALS_ON=='1' ) {
+        $tags_array['desc']= HEAD_DESC_TAG_SPECIALS . ' ' . HEAD_DESC_TAG_ALL;
+      } else {
+        $tags_array['desc']= HEAD_DESC_TAG_SPECIALS;
+      }
+    } else {
+      $tags_array['desc']= HEAD_DESC_TAG_ALL;
+    }
+
+    if ( HEAD_KEY_TAG_SPECIALS=='' ) {
+      // Build a list of ALL specials product names to put in keywords
+      $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC ");
+      $row = 0;
+      $the_specials='';
+      while ($new_values = tep_db_fetch_array($new)) {
+        $the_specials .= clean_html_comments($new_values['products_name']) . ', ';
+      }
+      if ( HTKA_SPECIALS_ON=='1' ) {
+        $tags_array['keywords']= $the_specials . ' ' . HEAD_KEY_TAG_ALL;
+      } else {
+        $tags_array['keywords']= $the_specials;
+      }
+    } else {
+      $tags_array['keywords']= HEAD_KEY_TAG_SPECIALS . ' ' . HEAD_KEY_TAG_ALL;
+    }
+
+    if ( HEAD_TITLE_TAG_SPECIALS!='' ) {
+      if ( HTTA_SPECIALS_ON=='1' ) {
+        $tags_array['title']= HEAD_TITLE_TAG_SPECIALS . ' ' . HEAD_TITLE_TAG_ALL;
+      } else {
+        $tags_array['title']= HEAD_TITLE_TAG_SPECIALS;
+      }
+    } else {
+      $tags_array['title']= HEAD_TITLE_TAG_ALL;
+    }
+
+    break;
+
+
+// PRODUCTS_REVIEWS_INFO.PHP and PRODUCTS_REVIEWS.PHP
+    case((basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS) or (basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_INFO)):
+    if ( HEAD_DESC_TAG_PRODUCT_REVIEWS_INFO=='' ) {
+      if ( HTDA_PRODUCT_REVIEWS_INFO_ON=='1' ) {
+        $tags_array['desc']= tep_get_header_tag_products_desc($HTTP_GET_VARS['reviews_id']) . ' ' . HEAD_DESC_TAG_ALL;
+      } else {
+        $tags_array['desc']= tep_get_header_tag_products_desc($HTTP_GET_VARS['reviews_id']);
+      }
+    } else {
+      $tags_array['desc']= HEAD_DESC_TAG_PRODUCT_REVIEWS_INFO;
+    }
+
+    if ( HEAD_KEY_TAG_PRODUCT_REVIEWS_INFO=='' ) {
+      if ( HTKA_PRODUCT_REVIEWS_INFO_ON=='1' ) {
+        $tags_array['keywords']= tep_get_header_tag_products_keywords($HTTP_GET_VARS['reviews_id']) . ' ' . HEAD_KEY_TAG_ALL;
+      } else {
+        $tags_array['keywords']= tep_get_header_tag_products_keywords($HTTP_GET_VARS['reviews_id']);
+      }
+    } else {
+      $tags_array['keywords']= HEAD_KEY_TAG_PRODUCT_REVIEWS_INFO;
+    }
+
+    if ( HEAD_TITLE_TAG_PRODUCT_REVIEWS_INFO=='' ) {
+      if ( HTTA_PRODUCT_REVIEWS_INFO_ON=='1' ) {
+        $tags_array['title']= ' Reviews: ' . tep_get_header_tag_products_title($HTTP_GET_VARS['reviews_id']) . HEAD_TITLE_TAG_ALL;
+      } else {
+        $tags_array['title']= tep_get_header_tag_products_title($HTTP_GET_VARS['reviews_id']);
+      }
+    } else {
+      $tags_array['title']= HEAD_TITLE_TAG_PRODUCT_REVIEWS_INFO;
+    }
+    break;
+
+// PRODUCTS_REVIEWS_WRITE.PHP
+    case((basename($PHP_SELF)==FILENAME_PRODUCT_REVIEWS_WRITE)):
+    if ( HEAD_DESC_TAG_PRODUCT_REVIEWS_WRITE=='' ) {
+      if ( HTDA_PRODUCT_REVIEWS_WRITE_ON=='1' ) {
+        $tags_array['desc']= tep_get_header_tag_products_desc($HTTP_GET_VARS['reviews_id']) . ' ' . HEAD_DESC_TAG_ALL;
+      } else {
+        $tags_array['desc']= tep_get_header_tag_products_desc($HTTP_GET_VARS['reviews_id']);
+      }
+    } else {
+      $tags_array['desc']= HEAD_DESC_TAG_PRODUCT_REVIEWS_WRITE;
+    }
+
+    if ( HEAD_KEY_TAG_PRODUCT_REVIEWS_WRITE=='' ) {
+      if ( HTKA_PRODUCT_REVIEWS_WRITE_ON=='1' ) {
+        $tags_array['keywords']= tep_get_header_tag_products_keywords($HTTP_GET_VARS['reviews_id']) . ' ' . HEAD_KEY_TAG_ALL;
+      } else {
+        $tags_array['keywords']= tep_get_header_tag_products_keywords($HTTP_GET_VARS['reviews_id']);
+      }
+    } else {
+      $tags_array['keywords']= HEAD_KEY_TAG_PRODUCT_REVIEWS_WRITE;
+    }
+
+    if ( HEAD_TITLE_TAG_PRODUCT_REVIEWS_WRITE=='' ) {
+      if ( HTTA_PRODUCT_REVIEWS_WRITE_ON=='1' ) {
+        $tags_array['title']= ' Reviews: ' . tep_get_header_tag_products_title($HTTP_GET_VARS['reviews_id']) . HEAD_TITLE_TAG_ALL;
+      } else {
+        $tags_array['title']= tep_get_header_tag_products_title($HTTP_GET_VARS['reviews_id']);
+      }
+    } else {
+      $tags_array['title']= HEAD_TITLE_TAG_PRODUCT_REVIEWS_WRITE;
+    }
+    break;
+    
+  // ARTICLES.PHP
+    case ((strstr($_SERVER['PHP_SELF'],'articles.php') or strstr($PHP_SELF,'articles.php')) &! strstr($PHP_SELF,'new_articles.php')):
+    $the_topic_query = tep_db_query("select td.topics_name from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.topics_id = '" . (int)$current_topic_id . "' and td.topics_id = '" . (int)$current_topic_id . "' and td.language_id = '" . (int)$languages_id . "'");
+    $the_topic = tep_db_fetch_array($the_topic_query);
+
+    $the_authors_query= tep_db_query("select authors_name from " . TABLE_AUTHORS . " where authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "'");
+    $the_authors = tep_db_fetch_array($the_authors_query);
+
+    if (HTDA_ARTICLES_ON=='1') {
+      $tags_array['desc']= HEAD_DESC_TAG_ARTICLES . '. ' . HEAD_DESC_TAG_ALL;
+    } else {
+      $tags_array['desc']= HEAD_DESC_TAG_ARTICLES;
+    }
+
+    if (HTKA_ARTICLES_ON=='1') {
+
+      if (tep_not_null($the_topic['topics_name'])) {
+        $tags_array['keywords'] .= $the_topic['topics_name'];
+      } else {
+        if (tep_not_null($the_authors['authors_name'])) {
+          $tags_array['keywords'] .= $the_authors['authors_name'];
+        }
+      }
+
+      $tags_array['keywords'] = HEAD_KEY_TAG_ARTICLES . ', ' . $tags_array['keywords'] . ', ' . HEAD_KEY_TAG_ALL;
+
+    } else {
+      $tags_array['keywords']= HEAD_KEY_TAG_ARTICLES;
+    }
+
+    if (HTTA_ARTICLES_ON=='1') {
+      $tags_array['title']= HEAD_TITLE_TAG_ALL . ' - ' . HEAD_TITLE_TAG_ARTICLES;
+
+      if (tep_not_null($the_topic['topics_name'])) {
+        $tags_array['title'] .= ' - ' . $the_topic['topics_name'];
+      } else {
+        if (tep_not_null($the_authors['authors_name'])) {
+          $tags_array['title'] .= TEXT_BY . $the_authors['authors_name'];
+        }
+      }
+
+    } else {
+      $tags_array['title']= HEAD_TITLE_TAG_ARTICLES;
+    }
+
+    break;
+
+// ARTICLE_INFO.PHP
+  case ( strstr($_SERVER['PHP_SELF'],'article_info.php') or strstr($PHP_SELF,'article_info.php') ):
+    $the_article_info_query = tep_db_query("select a.articles_id, ad.articles_name, ad.articles_description, ad.articles_head_title_tag, ad.articles_head_keywords_tag, ad.articles_head_desc_tag, ad.articles_url, a.articles_date_added, a.articles_date_available, a.authors_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_id = '" . $HTTP_GET_VARS['articles_id'] . "' and ad.articles_id = '" . $HTTP_GET_VARS['articles_id'] . "'");
+    $the_article_info_query = tep_db_query("select ad.language_id, a.articles_id, ad.articles_name, ad.articles_description, ad.articles_head_title_tag, ad.articles_head_keywords_tag, ad.articles_head_desc_tag, ad.articles_url, a.articles_date_added, a.articles_date_available, a.authors_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and ad.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "'" . " and ad.language_id ='" .  (int)$languages_id . "'");
+    $the_article_info = tep_db_fetch_array($the_article_info_query);
+
+    if (empty($the_article_info['articles_head_desc_tag'])) {
+      $tags_array['desc']= NAVBAR_TITLE . '. ' . HEAD_DESC_TAG_ALL;
+    } else {
+      if ( HTDA_ARTICLE_INFO_ON=='1' ) {
+        $tags_array['desc']= $the_article_info['articles_head_desc_tag'] . ' ' . HEAD_DESC_TAG_ALL;
+      } else {
+        $tags_array['desc']= $the_article_info['articles_head_desc_tag'];
+      }
+    }
+
+    if (empty($the_article_info['articles_head_keywords_tag'])) {
+      $tags_array['keywords']= NAVBAR_TITLE . ', ' . HEAD_KEY_TAG_ALL;
+    } else {
+      if ( HTKA_ARTICLE_INFO_ON=='1' ) {
+        $tags_array['keywords']= $the_article_info['articles_head_keywords_tag'] . ', ' . HEAD_KEY_TAG_ALL;
+      } else {
+        $tags_array['keywords']= $the_article_info['articles_head_keywords_tag'];
+      }
+    }
+
+    if (empty($the_article_info['articles_head_title_tag'])) {
+      $tags_array['title']= HEAD_TITLE_TAG_ALL . ' - ' . NAVBAR_TITLE;
+    } else {
+      if ( HTTA_ARTICLE_INFO_ON=='1' ) {
+        $tags_array['title']= HEAD_TITLE_TAG_ALL . ' - ' .  HEAD_TITLE_TAG_ARTICLE_INFO . ' - ' . $topics['topics_name'] . $authors['authors_name'] . ' - ' . clean_html_comments($the_article_info['articles_head_title_tag']);
+      } else {
+        $tags_array['title']= clean_html_comments($the_article_info['articles_head_title_tag']);
+      }
+    }
+
+    break;
+
+// ARTICLES_NEW.PHP
+  case ( strstr($_SERVER['PHP_SELF'],'articles_new.php') or strstr($PHP_SELF,'articles_new.php') ):
+    if ( HEAD_DESC_TAG_ARTICLES_NEW!='' ) {
+      if ( HTDA_ARTICLES_NEW_ON=='1' ) {
+        $tags_array['desc']= HEAD_DESC_TAG_ARTICLES_NEW . '. ' . HEAD_DESC_TAG_ALL;
+      } else {
+        $tags_array['desc']= HEAD_DESC_TAG_ARTICLES_NEW;
+      }
+    } else {
+      $tags_array['desc']= NAVBAR_TITLE . '. ' . HEAD_DESC_TAG_ALL;
+    }
+
+    if ( HEAD_KEY_TAG_ARTICLES_NEW=='' ) {
+      // Build a list of ALL new article names to put in keywords
+      $articles_new_array = array();
+      $articles_new_query_raw = "select ad.articles_name
+                                 from " . TABLE_ARTICLES . " a,
+                                      " . TABLE_AUTHORS . " au,
+                                      " . TABLE_ARTICLES_DESCRIPTION . " ad
+                                 where a.articles_status = '1'
+                                   and a.authors_id = au.authors_id
+                                   and a.articles_id = ad.articles_id
+                                   and ad.language_id = '" . (int)$languages_id . "'
+                                 order by a.articles_date_added DESC, ad.articles_name";
+      $articles_new_split = new splitPageResults($articles_new_query_raw, MAX_NEW_ARTICLES_PER_PAGE);
+      $articles_new_query = tep_db_query($articles_new_split->sql_query);
+
+      $row = 0;
+      $the_new_articles='';
+      while ($articles_new = tep_db_fetch_array($articles_new_query)) {
+        $the_new_articles .= clean_html_comments($articles_new['articles_name']) . ', ';
+      }
+      if ( HTKA_ARTICLES_NEW_ON=='1' ) {
+        $tags_array['keywords']= NAVBAR_TITLE . ', ' . $the_new_articles . ', ' . HEAD_KEY_TAG_ALL;
+      } else {
+        $tags_array['keywords']= NAVBAR_TITLE . ', ' . $the_new_articles;
+      }
+    } else {
+      $tags_array['keywords']= HEAD_KEY_TAG_ARTICLES_NEW . ', ' . HEAD_KEY_TAG_ALL;
+    }
+
+    if ( HEAD_TITLE_TAG_ARTICLES_NEW!='' ) {
+      if ( HTTA_ARTICLES_NEW_ON=='1' ) {
+        $tags_array['title']= HEAD_TITLE_TAG_ALL . ' - ' . HEAD_TITLE_TAG_ARTICLES_NEW;
+      } else {
+        $tags_array['title']= HEAD_TITLE_TAG_ARTICLES_NEW;
+      }
+    } else {
+      $tags_array['title']= HEAD_TITLE_TAG_ALL . ' - ' . NAVBAR_TITLE;
+    }
+
+    break;
+
+// ARTICLES_REVIEWS_INFO.PHP and ARTICLES_REVIEWS.PHP
+  case ( strstr($_SERVER['PHP_SELF'],'article_reviews_info.php') or strstr($_SERVER['PHP_SELF'],'article_reviews.php') or strstr($PHP_SELF,'article_reviews_info.php') or strstr($PHP_SELF,'article_reviews.php') ):
+    if ( HEAD_DESC_TAG_ARTICLE_REVIEWS_INFO=='' ) {
+      if ( HTDA_ARTICLE_REVIEWS_INFO_ON=='1' ) {
+        $tags_array['desc']= NAVBAR_TITLE . '. ' . tep_get_header_tag_articles_desc(isset($HTTP_GET_VARS['reviews_id'])) . ' ' . HEAD_DESC_TAG_ALL;
+      } else {
+        $tags_array['desc']= NAVBAR_TITLE . '. ' . tep_get_header_tag_articles_desc(isset($HTTP_GET_VARS['reviews_id']));
+      }
+    } else {
+      $tags_array['desc']= HEAD_DESC_TAG_ARTICLE_REVIEWS_INFO;
+    }
+
+    if ( HEAD_KEY_TAG_ARTICLE_REVIEWS_INFO=='' ) {
+      if ( HTKA_ARTICLE_REVIEWS_INFO_ON=='1' ) {
+        $tags_array['keywords']= NAVBAR_TITLE . ', ' . tep_get_header_tag_articles_keywords(isset($HTTP_GET_VARS['reviews_id'])) . ', ' . HEAD_KEY_TAG_ALL;
+      } else {
+        $tags_array['keywords']= NAVBAR_TITLE . ', ' . tep_get_header_tag_articles_keywords(isset($HTTP_GET_VARS['reviews_id']));
+      }
+    } else {
+      $tags_array['keywords']= HEAD_KEY_TAG_ARTICLE_REVIEWS_INFO;
+    }
+
+    if ( HEAD_TITLE_TAG_ARTICLE_REVIEWS_INFO=='' ) {
+      if ( HTTA_ARTICLE_REVIEWS_INFO_ON=='1' ) {
+        $tags_array['title']= HEAD_TITLE_TAG_ALL . ' - ' . HEADING_TITLE . tep_get_header_tag_articles_title(isset($HTTP_GET_VARS['reviews_id']));
+      } else {
+        $tags_array['title']= tep_get_header_tag_articles_title(isset($HTTP_GET_VARS['reviews_id']));
+      }
+    } else {
+      $tags_array['title']= HEAD_TITLE_TAG_ARTICLE_REVIEWS_INFO;
+    }
+
+    break;
+
+// ALL OTHER PAGES NOT DEFINED ABOVE
+  default:
+    $tags_array['desc'] = HEAD_DESC_TAG_ALL;
+    $tags_array['keywords'] = HEAD_KEY_TAG_ALL;
+    $tags_array['title'] = HEAD_TITLE_TAG_ALL;
+    break;
+  }
+
+echo ' <meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET  . '">'."\n";
+echo ' <title>' . $tags_array['title'] . '</title>' . "\n";
+echo ' <meta name="Description" Content="' . $tags_array['desc'] . '">' . "\n";
+echo ' <meta name="Keywords" content="' . $tags_array['keywords'] . '">' . "\n";
+echo ' <meta name="Reply-to" content="' . HEAD_REPLY_TAG_ALL . '">' . "\n";
+echo ' <meta name="robots" content="index, follow">' . "\n";
+echo ' <meta name="revisit-after" content="30 days">' . "\n";
+echo ' <meta name="generator" content="' . PROJECT_VERSION . '[' . PROJECT_PATCH . ']">' . "\n";
+echo ' <!-- EOF: Generated Meta Tags -->' . "\n";
+?>

Added: trunk/direct.openmoko.com/includes/javascript/account.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/account.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/account.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,9 @@
+<script type="text/javascript"><!--
+function rowOverEffect(object) {
+  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/account_edit.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/account_edit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/account_edit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+<?php require('includes/javascript/form_check.js.php'); ?>

Added: trunk/direct.openmoko.com/includes/javascript/account_newsletters.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/account_newsletters.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/account_newsletters.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<script type="text/javascript"><!--
+function rowOverEffect(object) {
+  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
+}
+
+function checkBox(object) {
+  document.account_newsletter.elements[object].checked = !document.account_newsletter.elements[object].checked;
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/account_notifications.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/account_notifications.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/account_notifications.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<script type="text/javascript"><!--
+function rowOverEffect(object) {
+  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
+}
+
+function checkBox(object) {
+  document.account_notifications.elements[object].checked = !document.account_notifications.elements[object].checked;
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/account_password.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/account_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/account_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+<?php require('includes/javascript/form_check.js.php'); ?>

Added: trunk/direct.openmoko.com/includes/javascript/address_book.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/address_book.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/address_book.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,9 @@
+<script type="text/javascript"><!--
+function rowOverEffect(object) {
+  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/address_book_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/address_book_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/address_book_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+<?php
+  if (!isset($HTTP_GET_VARS['delete'])) {
+    include('includes/javascript/form_check.js.php');
+  }
+?>

Added: trunk/direct.openmoko.com/includes/javascript/advanced_search.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/advanced_search.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/advanced_search.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<script type="text/javascript" src="includes/javascript/general.js"></script>
+<script type="text/javascript"><!--
+function check_form() {
+  var error_message = "<?php echo JS_ERROR; ?>";
+  var error_found = false;
+  var error_field;
+  var keywords = document.advanced_search.keywords.value;
+  var dfrom = document.advanced_search.dfrom.value;
+  var dto = document.advanced_search.dto.value;
+  var pfrom = document.advanced_search.pfrom.value;
+  var pto = document.advanced_search.pto.value;
+  var pfrom_float;
+  var pto_float;
+
+  if ( ((keywords == '') || (keywords.length < 1)) && ((dfrom == '') || (dfrom == '<?php echo DOB_FORMAT_STRING; ?>') || (dfrom.length < 1)) && ((dto == '') || (dto == '<?php echo DOB_FORMAT_STRING; ?>') || (dto.length < 1)) && ((pfrom == '') || (pfrom.length < 1)) && ((pto == '') || (pto.length < 1)) ) {
+    error_message = error_message + "* <?php echo ERROR_AT_LEAST_ONE_INPUT; ?>\n";
+    error_field = document.advanced_search.keywords;
+    error_found = true;
+  }
+
+  if ((dfrom.length > 0) && (dfrom != '<?php echo DOB_FORMAT_STRING; ?>')) {
+    if (!IsValidDate(dfrom, '<?php echo DOB_FORMAT_STRING; ?>')) {
+      error_message = error_message + "* <?php echo ERROR_INVALID_FROM_DATE; ?>\n";
+      error_field = document.advanced_search.dfrom;
+      error_found = true;
+    }
+  }
+
+  if ((dto.length > 0) && (dto != '<?php echo DOB_FORMAT_STRING; ?>')) {
+    if (!IsValidDate(dto, '<?php echo DOB_FORMAT_STRING; ?>')) {
+      error_message = error_message + "* <?php echo ERROR_INVALID_TO_DATE; ?>\n";
+      error_field = document.advanced_search.dto;
+      error_found = true;
+    }
+  }
+
+  if ((dfrom.length > 0) && (dfrom != '<?php echo DOB_FORMAT_STRING; ?>') && (IsValidDate(dfrom, '<?php echo DOB_FORMAT_STRING; ?>')) && (dto.length > 0) && (dto != '<?php echo DOB_FORMAT_STRING; ?>') && (IsValidDate(dto, '<?php echo DOB_FORMAT_STRING; ?>'))) {
+    if (!CheckDateRange(document.advanced_search.dfrom, document.advanced_search.dto)) {
+      error_message = error_message + "* <?php echo ERROR_TO_DATE_LESS_THAN_FROM_DATE; ?>\n";
+      error_field = document.advanced_search.dto;
+      error_found = true;
+    }
+  }
+
+  if (pfrom.length > 0) {
+    pfrom_float = parseFloat(pfrom);
+    if (isNaN(pfrom_float)) {
+      error_message = error_message + "* <?php echo ERROR_PRICE_FROM_MUST_BE_NUM; ?>\n";
+      error_field = document.advanced_search.pfrom;
+      error_found = true;
+    }
+  } else {
+    pfrom_float = 0;
+  }
+
+  if (pto.length > 0) {
+    pto_float = parseFloat(pto);
+    if (isNaN(pto_float)) {
+      error_message = error_message + "* <?php echo ERROR_PRICE_TO_MUST_BE_NUM; ?>\n";
+      error_field = document.advanced_search.pto;
+      error_found = true;
+    }
+  } else {
+    pto_float = 0;
+  }
+
+  if ( (pfrom.length > 0) && (pto.length > 0) ) {
+    if ( (!isNaN(pfrom_float)) && (!isNaN(pto_float)) && (pto_float < pfrom_float) ) {
+      error_message = error_message + "* <?php echo ERROR_PRICE_TO_LESS_THAN_PRICE_FROM; ?>\n";
+      error_field = document.advanced_search.pto;
+      error_found = true;
+    }
+  }
+
+  if (error_found == true) {
+    alert(error_message);
+    error_field.focus();
+    return false;
+  } else {
+    RemoveFormatString(document.advanced_search.dfrom, "<?php echo DOB_FORMAT_STRING; ?>");
+    RemoveFormatString(document.advanced_search.dto, "<?php echo DOB_FORMAT_STRING; ?>");
+    return true;
+  }
+}
+
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/advanced_search.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/advanced_search.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/advanced_search.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<script type="text/javascript" src="includes/javascript/general.js"></script>
+<script type="text/javascript"><!--
+function check_form() {
+  var error_message = "<?php echo JS_ERROR; ?>";
+  var error_found = false;
+  var error_field;
+  var keywords = document.advanced_search.keywords.value;
+  var dfrom = document.advanced_search.dfrom.value;
+  var dto = document.advanced_search.dto.value;
+  var pfrom = document.advanced_search.pfrom.value;
+  var pto = document.advanced_search.pto.value;
+  var pfrom_float;
+  var pto_float;
+
+  if ( ((keywords == '') || (keywords.length < 1)) && ((dfrom == '') || (dfrom == '<?php echo DOB_FORMAT_STRING; ?>') || (dfrom.length < 1)) && ((dto == '') || (dto == '<?php echo DOB_FORMAT_STRING; ?>') || (dto.length < 1)) && ((pfrom == '') || (pfrom.length < 1)) && ((pto == '') || (pto.length < 1)) ) {
+    error_message = error_message + "* <?php echo ERROR_AT_LEAST_ONE_INPUT; ?>\n";
+    error_field = document.advanced_search.keywords;
+    error_found = true;
+  }
+
+  if ((dfrom.length > 0) && (dfrom != '<?php echo DOB_FORMAT_STRING; ?>')) {
+    if (!IsValidDate(dfrom, '<?php echo DOB_FORMAT_STRING; ?>')) {
+      error_message = error_message + "* <?php echo ERROR_INVALID_FROM_DATE; ?>\n";
+      error_field = document.advanced_search.dfrom;
+      error_found = true;
+    }
+  }
+
+  if ((dto.length > 0) && (dto != '<?php echo DOB_FORMAT_STRING; ?>')) {
+    if (!IsValidDate(dto, '<?php echo DOB_FORMAT_STRING; ?>')) {
+      error_message = error_message + "* <?php echo ERROR_INVALID_TO_DATE; ?>\n";
+      error_field = document.advanced_search.dto;
+      error_found = true;
+    }
+  }
+
+  if ((dfrom.length > 0) && (dfrom != '<?php echo DOB_FORMAT_STRING; ?>') && (IsValidDate(dfrom, '<?php echo DOB_FORMAT_STRING; ?>')) && (dto.length > 0) && (dto != '<?php echo DOB_FORMAT_STRING; ?>') && (IsValidDate(dto, '<?php echo DOB_FORMAT_STRING; ?>'))) {
+    if (!CheckDateRange(document.advanced_search.dfrom, document.advanced_search.dto)) {
+      error_message = error_message + "* <?php echo ERROR_TO_DATE_LESS_THAN_FROM_DATE; ?>\n";
+      error_field = document.advanced_search.dto;
+      error_found = true;
+    }
+  }
+
+  if (pfrom.length > 0) {
+    pfrom_float = parseFloat(pfrom);
+    if (isNaN(pfrom_float)) {
+      error_message = error_message + "* <?php echo ERROR_PRICE_FROM_MUST_BE_NUM; ?>\n";
+      error_field = document.advanced_search.pfrom;
+      error_found = true;
+    }
+  } else {
+    pfrom_float = 0;
+  }
+
+  if (pto.length > 0) {
+    pto_float = parseFloat(pto);
+    if (isNaN(pto_float)) {
+      error_message = error_message + "* <?php echo ERROR_PRICE_TO_MUST_BE_NUM; ?>\n";
+      error_field = document.advanced_search.pto;
+      error_found = true;
+    }
+  } else {
+    pto_float = 0;
+  }
+
+  if ( (pfrom.length > 0) && (pto.length > 0) ) {
+    if ( (!isNaN(pfrom_float)) && (!isNaN(pto_float)) && (pto_float < pfrom_float) ) {
+      error_message = error_message + "* <?php echo ERROR_PRICE_TO_LESS_THAN_PRICE_FROM; ?>\n";
+      error_field = document.advanced_search.pto;
+      error_found = true;
+    }
+  }
+
+  if (error_found == true) {
+    alert(error_message);
+    error_field.focus();
+    return false;
+  } else {
+    RemoveFormatString(document.advanced_search.dfrom, "<?php echo DOB_FORMAT_STRING; ?>");
+    RemoveFormatString(document.advanced_search.dto, "<?php echo DOB_FORMAT_STRING; ?>");
+    return true;
+  }
+}
+
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=360,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/affiliate_summary.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/affiliate_summary.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/affiliate_summary.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,7 @@
+<script type="text/javascript" src="includes/javascript/general.js"></script>
+<script type="text/javascript"><!--
+
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/article_info.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/article_info.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/article_info.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+<script type="text/javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/javascript/cart_links.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/cart_links.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/cart_links.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,12 @@
+<?php 
+if ($cart_links == 'close'){
+$cart_link1= 'dothis';
+} else if ($cart_links == 'close') {
+$paymentclose = 'true';
+}
+echo '<table width="100%" cellspacing="3" cellpadding="' .CELLPADDING_MAIN . '"><tr>';
+echo '<td width="100%" style="text-align: center">';
+include('http://creloaded.com/cre_google.js');
+echo '</td></tr></table>';
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/javascript/checkout_confirmation.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/checkout_confirmation.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/checkout_confirmation.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,10 @@
+<script type="text/javascript">
+function checkCheckBox(f){
+if (f.agree.checked == false )
+{
+alert('<?php echo CONDITION_AGREEMENT_WARNING; ?>');
+return false;
+}else
+return true;
+}
+</script>

Added: trunk/direct.openmoko.com/includes/javascript/checkout_payment.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/checkout_payment.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/checkout_payment.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<script type="text/javascript"><!--
+var selected;
+var submitter = null;
+function submitFunction() {
+   submitter = 1;
+   }
+function selectRowEffect(object, buttonSelect) {
+  if (!selected) {
+    if (document.getElementById) {
+      selected = document.getElementById('defaultSelected');
+    } else {
+      selected = document.all['defaultSelected'];
+    }
+  }
+
+  if (selected) selected.className = 'moduleRow';
+  object.className = 'moduleRowSelected';
+  selected = object;
+
+// one button is not an array
+  if (document.checkout_payment.payment[0]) {
+    document.checkout_payment.payment[buttonSelect].checked=true;
+  } else {
+    document.checkout_payment.payment.checked=true;
+  }
+}
+
+function rowOverEffect(object) {
+  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
+}
+
+function popupWindow(url) {
+window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=500,screenX=150,screenY=30,top=30,left=150')
+}
+//--></script>
+<?php echo $payment_modules->javascript_validation(); ?>

Added: trunk/direct.openmoko.com/includes/javascript/checkout_payment_address.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/checkout_payment_address.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/checkout_payment_address.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<script type="text/javascript"><!--
+var selected;
+
+function selectRowEffect(object, buttonSelect) {
+  if (!selected) {
+    if (document.getElementById) {
+      selected = document.getElementById('defaultSelected');
+    } else {
+      selected = document.all['defaultSelected'];
+    }
+  }
+
+  if (selected) selected.className = 'moduleRow';
+  object.className = 'moduleRowSelected';
+  selected = object;
+
+// one button is not an array
+  if (document.checkout_address.address[0]) {
+    document.checkout_address.address[buttonSelect].checked=true;
+  } else {
+    document.checkout_address.address.checked=true;
+  }
+}
+
+function rowOverEffect(object) {
+  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
+}
+
+function check_form_optional(form_name) {
+  var form = form_name;
+
+  var firstname = form.elements['firstname'].value;
+  var lastname = form.elements['lastname'].value;
+  var street_address = form.elements['street_address'].value;
+
+  if (firstname == '' && lastname == '' && street_address == '') {
+    return true;
+  } else {
+    return check_form(form_name);
+  }
+}
+//--></script>
+<?php 
+
+//require(DIR_WS_JAVASCRIPT . 'form_check.js.php'); 
+require(DIR_WS_JAVASCRIPT . FILENAME_FORM_CHECK_JS); 
+
+?>

Added: trunk/direct.openmoko.com/includes/javascript/checkout_shipping.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/checkout_shipping.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/checkout_shipping.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<script type="text/javascript"><!--
+var selected;
+
+function selectRowEffect(object, buttonSelect) {
+  if (!selected) {
+    if (document.getElementById) {
+      selected = document.getElementById('defaultSelected');
+    } else {
+      selected = document.all['defaultSelected'];
+    }
+  }
+
+  if (selected) selected.className = 'moduleRow';
+  object.className = 'moduleRowSelected';
+  selected = object;
+
+// one button is not an array
+  if (document.checkout_address.shipping[0]) {
+    document.checkout_address.shipping[buttonSelect].checked=true;
+  } else {
+    document.checkout_address.shipping.checked=true;
+  }
+}
+
+function rowOverEffect(object) {
+  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/checkout_shipping_address.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/checkout_shipping_address.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/checkout_shipping_address.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<script type="text/javascript"><!--
+var selected;
+
+function selectRowEffect(object, buttonSelect) {
+  if (!selected) {
+    if (document.getElementById) {
+      selected = document.getElementById('defaultSelected');
+    } else {
+      selected = document.all['defaultSelected'];
+    }
+  }
+
+  if (selected) selected.className = 'moduleRow';
+  object.className = 'moduleRowSelected';
+  selected = object;
+
+// one button is not an array
+  if (document.checkout_address.address[0]) {
+    document.checkout_address.address[buttonSelect].checked=true;
+  } else {
+    document.checkout_address.address.checked=true;
+  }
+}
+
+function rowOverEffect(object) {
+  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
+}
+
+function rowOutEffect(object) {
+  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
+}
+
+function check_form_optional(form_name) {
+  var form = form_name;
+
+  var firstname = form.elements['firstname'].value;
+  var lastname = form.elements['lastname'].value;
+  var street_address = form.elements['street_address'].value;
+
+  if (firstname == '' && lastname == '' && street_address == '') {
+    return true;
+  } else {
+    return check_form(form_name);
+  }
+}
+//--></script>
+<?php
+/// require(DIR_WS_JAVASCRIPT . 'form_check.js.php'); 
+  require(DIR_WS_JAVASCRIPT . FILENAME_FORM_CHECK_JS); 
+
+  ?>

Added: trunk/direct.openmoko.com/includes/javascript/cvvpopup.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/cvvpopup.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/cvvpopup.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,6 @@
+<script type="text/javascript"><!--
+
+function CVVPopUpWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=600,height=233,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/form_article_check.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/form_article_check.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/form_article_check.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: form_check.js.php,v 1.1.1.1 2004/03/04 23:40:52 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<script type="text/javascript"><!--
+function checkForm() {
+  var error = 0;
+  var error_message = "<?php echo JS_ERROR; ?>";
+
+  var review = document.article_reviews_write.article_review.value;
+
+  if (article_review.length < <?php echo REVIEW_TEXT_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_REVIEW_TEXT; ?>";
+    error = 1;
+  }
+
+  if ((document.article_reviews_write.article_rating[0].checked) || (document.article_reviews_write.article_rating[1].checked) || (document.article_reviews_write.article_rating[2].checked) || (document.article_reviews_write.article_rating[3].checked) || (document.article_reviews_article_rating.rating[4].checked)) {
+  } else {
+    error_message = error_message + "<?php echo JS_REVIEW_RATING; ?>";
+    error = 1;
+  }
+
+  if (error == 1) {
+    alert(error_message);
+    return false;
+  } else {
+    return true;
+  }
+}
+
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/javascript/form_check.js.php
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/form_check.js.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/form_check.js.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,134 @@
+<?php
+/*
+  $Id: form_check.js.php,v 1.1.1.1 2004/03/04 23:40:52 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<script type="text/javascript"><!--
+var form = "";
+var submitted = false;
+var error = false;
+var error_message = "";
+
+function check_input(field_name, field_size, message) {
+  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
+    var field_value = form.elements[field_name].value;
+
+    if (field_value == '' || field_value.length < field_size) {
+      error_message = error_message + "* " + message + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_radio(field_name, message) {
+  var isChecked = false;
+
+  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
+    var radio = form.elements[field_name];
+
+    for (var i=0; i<radio.length; i++) {
+      if (radio[i].checked == true) {
+        isChecked = true;
+        break;
+      }
+    }
+
+    if (isChecked == false) {
+      error_message = error_message + "* " + message + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_select(field_name, field_default, message) {
+  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
+    var field_value = form.elements[field_name].value;
+
+    if (field_value == field_default) {
+      error_message = error_message + "* " + message + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_password(field_name_1, field_name_2, field_size, message_1, message_2) {
+  if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
+    var password = form.elements[field_name_1].value;
+    var confirmation = form.elements[field_name_2].value;
+
+    if (password == '' || password.length < field_size) {
+      error_message = error_message + "* " + message_1 + "\n";
+      error = true;
+    } else if (password != confirmation) {
+      error_message = error_message + "* " + message_2 + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_password_new(field_name_1, field_name_2, field_name_3, field_size, message_1, message_2, message_3) {
+  if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
+    var password_current = form.elements[field_name_1].value;
+    var password_new = form.elements[field_name_2].value;
+    var password_confirmation = form.elements[field_name_3].value;
+
+    if (password_current == '' || password_current.length < field_size) {
+      error_message = error_message + "* " + message_1 + "\n";
+      error = true;
+    } else if (password_new == '' || password_new.length < field_size) {
+      error_message = error_message + "* " + message_2 + "\n";
+      error = true;
+    } else if (password_new != password_confirmation) {
+      error_message = error_message + "* " + message_3 + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_form(form_name) {
+  if (submitted == true) {
+    alert("<?php echo JS_ERROR_SUBMITTED; ?>");
+    return false;
+  }
+
+  error = false;
+  form = form_name;
+  error_message = "<?php echo JS_ERROR; ?>";
+
+<?php if (ACCOUNT_GENDER == 'true') echo '  check_radio("gender", "' . ENTRY_GENDER_ERROR . '");' . "\n"; ?>
+
+  check_input("firstname", <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_FIRST_NAME_ERROR; ?>");
+  check_input("lastname", <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_LAST_NAME_ERROR; ?>");
+
+<?php if (ACCOUNT_DOB == 'true') echo '  check_input("dob", ' . ENTRY_DOB_MIN_LENGTH . ', "' . ENTRY_DATE_OF_BIRTH_ERROR . '");' . "\n"; ?>
+
+  check_input("email_address", <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_EMAIL_ADDRESS_ERROR; ?>");
+  check_input("street_address", <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_STREET_ADDRESS_ERROR; ?>");
+  check_input("postcode", <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>, "<?php echo ENTRY_POST_CODE_ERROR; ?>");
+  check_input("city", <?php echo ENTRY_CITY_MIN_LENGTH; ?>, "<?php echo ENTRY_CITY_ERROR; ?>");
+
+<?php if (ACCOUNT_STATE == 'true') echo '  check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '");' . "\n"; ?>
+
+  check_select("country", "", "<?php echo ENTRY_COUNTRY_ERROR; ?>");
+
+  check_input("telephone", <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>, "<?php echo ENTRY_TELEPHONE_NUMBER_ERROR; ?>");
+
+  check_password("password", "confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_ERROR_NOT_MATCHING; ?>");
+  check_password_new("password_current", "password_new", "password_confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING; ?>");
+
+  if (error == true) {
+    alert(error_message);
+    return false;
+  } else {
+    submitted = true;
+    return true;
+  }
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/general.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/general.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/general.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,190 @@
+/*
+  $Id: general.js,v 1.1.1.1 2004/03/04 23:40:52 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+function SetFocus(TargetFormName) {
+  var target = 0;
+  if (TargetFormName != "") {
+    for (i=0; i<document.forms.length; i++) {
+      if (document.forms[i].name == TargetFormName) {
+        target = i;
+        break;
+      }
+    }
+  }
+
+  var TargetForm = document.forms[target];
+    
+  for (i=0; i<TargetForm.length; i++) {
+    if ( (TargetForm.elements[i].type != "image") && (TargetForm.elements[i].type != "hidden") && (TargetForm.elements[i].type != "reset") && (TargetForm.elements[i].type != "submit") ) {
+      TargetForm.elements[i].focus();
+
+      if ( (TargetForm.elements[i].type == "text") || (TargetForm.elements[i].type == "password") ) {
+        TargetForm.elements[i].select();
+      }
+
+      break;
+    }
+  }
+}
+
+function RemoveFormatString(TargetElement, FormatString) {
+  if (TargetElement.value == FormatString) {
+    TargetElement.value = "";
+  }
+
+  TargetElement.select();
+}
+
+function CheckDateRange(from, to) {
+  if (Date.parse(from.value) <= Date.parse(to.value)) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+function IsValidDate(DateToCheck, FormatString) {
+  var strDateToCheck;
+  var strDateToCheckArray;
+  var strFormatArray;
+  var strFormatString;
+  var strDay;
+  var strMonth;
+  var strYear;
+  var intday;
+  var intMonth;
+  var intYear;
+  var intDateSeparatorIdx = -1;
+  var intFormatSeparatorIdx = -1;
+  var strSeparatorArray = new Array("-"," ","/",".");
+  var strMonthArray = new Array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
+  var intDaysArray = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+
+  strDateToCheck = DateToCheck.toLowerCase();
+  strFormatString = FormatString.toLowerCase();
+  
+  if (strDateToCheck.length != strFormatString.length) {
+    return false;
+  }
+
+  for (i=0; i<strSeparatorArray.length; i++) {
+    if (strFormatString.indexOf(strSeparatorArray[i]) != -1) {
+      intFormatSeparatorIdx = i;
+      break;
+    }
+  }
+
+  for (i=0; i<strSeparatorArray.length; i++) {
+    if (strDateToCheck.indexOf(strSeparatorArray[i]) != -1) {
+      intDateSeparatorIdx = i;
+      break;
+    }
+  }
+
+  if (intDateSeparatorIdx != intFormatSeparatorIdx) {
+    return false;
+  }
+
+  if (intDateSeparatorIdx != -1) {
+    strFormatArray = strFormatString.split(strSeparatorArray[intFormatSeparatorIdx]);
+    if (strFormatArray.length != 3) {
+      return false;
+    }
+
+    strDateToCheckArray = strDateToCheck.split(strSeparatorArray[intDateSeparatorIdx]);
+    if (strDateToCheckArray.length != 3) {
+      return false;
+    }
+
+    for (i=0; i<strFormatArray.length; i++) {
+      if (strFormatArray[i] == 'mm' || strFormatArray[i] == 'mmm') {
+        strMonth = strDateToCheckArray[i];
+      }
+
+      if (strFormatArray[i] == 'dd') {
+        strDay = strDateToCheckArray[i];
+      }
+
+      if (strFormatArray[i] == 'yyyy') {
+        strYear = strDateToCheckArray[i];
+      }
+    }
+  } else {
+    if (FormatString.length > 7) {
+      if (strFormatString.indexOf('mmm') == -1) {
+        strMonth = strDateToCheck.substring(strFormatString.indexOf('mm'), 2);
+      } else {
+        strMonth = strDateToCheck.substring(strFormatString.indexOf('mmm'), 3);
+      }
+
+      strDay = strDateToCheck.substring(strFormatString.indexOf('dd'), 2);
+      strYear = strDateToCheck.substring(strFormatString.indexOf('yyyy'), 2);
+    } else {
+      return false;
+    }
+  }
+
+  if (strYear.length != 4) {
+    return false;
+  }
+
+  intday = parseInt(strDay, 10);
+  if (isNaN(intday)) {
+    return false;
+  }
+  if (intday < 1) {
+    return false;
+  }
+
+  intMonth = parseInt(strMonth, 10);
+  if (isNaN(intMonth)) {
+    for (i=0; i<strMonthArray.length; i++) {
+      if (strMonth == strMonthArray[i]) {
+        intMonth = i+1;
+        break;
+      }
+    }
+    if (isNaN(intMonth)) {
+      return false;
+    }
+  }
+  if (intMonth > 12 || intMonth < 1) {
+    return false;
+  }
+
+  intYear = parseInt(strYear, 10);
+  if (isNaN(intYear)) {
+    return false;
+  }
+  if (IsLeapYear(intYear) == true) {
+    intDaysArray[1] = 29;
+  }
+
+  if (intday > intDaysArray[intMonth - 1]) {
+    return false;
+  }
+  
+  return true;
+}
+
+function IsLeapYear(intYear) {
+  if (intYear % 100 == 0) {
+    if (intYear % 400 == 0) {
+      return true;
+    }
+  } else {
+    if ((intYear % 4) == 0) {
+      return true;
+    }
+  }
+
+  return false;
+}

Added: trunk/direct.openmoko.com/includes/javascript/links_submit.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/links_submit.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/links_submit.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<script type="text/javascript"><!--
+var form = "";
+var submitted = false;
+var error = false;
+var error_message = "";
+
+function check_input(field_name, field_size, message) {
+  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
+    var field_value = form.elements[field_name].value;
+
+    if (field_value == '' || field_value.length < field_size) {
+      error_message = error_message + "* " + message + "\n";
+      error = true;
+    }
+  }
+}
+
+function check_form(form_name) {
+  if (submitted == true) {
+    alert("<?php echo JS_ERROR_SUBMITTED; ?>");
+    return false;
+  }
+
+  error = false;
+  form = form_name;
+  error_message = "<?php echo JS_ERROR; ?>";
+
+  check_input("links_title", <?php echo ENTRY_LINKS_TITLE_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_TITLE_ERROR; ?>");
+  check_input("links_url", <?php echo ENTRY_LINKS_URL_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_URL_ERROR; ?>");
+  check_input("links_description", <?php echo ENTRY_LINKS_DESCRIPTION_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_DESCRIPTION_ERROR; ?>");
+  check_input("links_contact_name", <?php echo ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_CONTACT_NAME_ERROR; ?>");
+  check_input("links_contact_email", <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_EMAIL_ADDRESS_ERROR; ?>");
+  check_input("links_reciprocal_url", <?php echo ENTRY_LINKS_URL_MIN_LENGTH; ?>, "<?php echo ENTRY_LINKS_RECIPROCAL_URL_ERROR; ?>");
+
+  if (error == true) {
+    alert(error_message);
+    return false;
+  } else {
+    submitted = true;
+    return true;
+  }
+}
+
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=400,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/login.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/login.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/login.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+<script type="text/javascript"><!--
+function session_win() {
+  window.open("<?php echo tep_href_link(FILENAME_INFO_SHOPPING_CART); ?>","info_shopping_cart","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus();
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/popup_image.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/popup_image.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/popup_image.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<script type="text/javascript"><!--
+var i=0;
+var s=0;
+function resize() {
+  if (navigator.appName == 'Netscape') i=40;
+   if (window.navigator.userAgent.indexOf("SV1") != -1) s=20; //This browser is Internet Explorer in SP2.
+    if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i+s);
+    self.focus();
+  if (document.images[0]) {
+  imgHeight = document.images[0].height+65-i;
+  imgWidth = document.images[0].width+30;
+  var height = screen.height;
+  var width = screen.width;
+  var leftpos = width / 2 - imgWidth / 2;
+  var toppos = height / 2 - imgHeight / 2; 
+  window.moveTo(leftpos, toppos);  
+  window.resizeTo(imgWidth, imgHeight);
+  }
+  self.focus();
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/popup_window.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/popup_window.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/popup_window.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+<script type="text/javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/popup_window_print.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/popup_window_print.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/popup_window_print.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+<script type="text/javascript"><!--
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=600,height=900,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/javascript/product_reviews_write.js
===================================================================
--- trunk/direct.openmoko.com/includes/javascript/product_reviews_write.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/javascript/product_reviews_write.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<script type="text/javascript"><!--
+function checkForm() {
+  var error = 0;
+  var error_message = "<?php echo JS_ERROR; ?>";
+
+  var review = document.product_reviews_write.review.value;
+
+  if (review.length < <?php echo REVIEW_TEXT_MIN_LENGTH; ?>) {
+    error_message = error_message + "<?php echo JS_REVIEW_TEXT; ?>";
+    error = 1;
+  }
+
+  if ((document.product_reviews_write.rating[0].checked) || (document.product_reviews_write.rating[1].checked) || (document.product_reviews_write.rating[2].checked) || (document.product_reviews_write.rating[3].checked) || (document.product_reviews_write.rating[4].checked)) {
+  } else {
+    error_message = error_message + "<?php echo JS_REVIEW_RATING; ?>";
+    error = 1;
+  }
+
+  if (error == 1) {
+    alert(error_message);
+    return false;
+  } else {
+    return true;
+  }
+}
+
+function popupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>

Added: trunk/direct.openmoko.com/includes/key/.htaccess
===================================================================
--- trunk/direct.openmoko.com/includes/key/.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/key/.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+# $Id: .htaccess,v 1.1.1.1 2004/03/04 23:40:35 ccwjr Exp $
+#
+# This is used with Apache WebServers
+# The following blocks direct HTTP requests in this directory recursively
+#
+# For this to work, you must include the parameter 'Limit' to the AllowOverride configuration
+#
+# Example:
+#
+#<Directory "/usr/local/apache/htdocs">
+#  AllowOverride Limit
+#
+# 'All' with also work. (This configuration is in your apache/conf/httpd.conf file)
+#
+# This does not affect PHP include/require functions
+#
+# Example: http://server/catalog/includes/application_top.php will not work
+
+<Files .htaccess>
+order allow,deny
+deny from all
+</Files>
+
+<Files index.php>
+Order Deny,Allow
+deny from all
+</Files>
+
+# <Files *.php>
+# Order Deny,Allow
+# Deny from all
+# </Files>

Added: trunk/direct.openmoko.com/includes/key/bak.htaccess
===================================================================
--- trunk/direct.openmoko.com/includes/key/bak.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/key/bak.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+# $Id: .htaccess,v 1.1.1.1 2004/03/04 23:40:35 ccwjr Exp $
+#
+# This is used with Apache WebServers
+# The following blocks direct HTTP requests in this directory recursively
+#
+# For this to work, you must include the parameter 'Limit' to the AllowOverride configuration
+#
+# Example:
+#
+#<Directory "/usr/local/apache/htdocs">
+#  AllowOverride Limit
+#
+# 'All' with also work. (This configuration is in your apache/conf/httpd.conf file)
+#
+# This does not affect PHP include/require functions
+#
+# Example: http://server/catalog/includes/application_top.php will not work
+
+<Files *.php>
+Order Deny,Allow
+Deny from all
+</Files>

Added: trunk/direct.openmoko.com/includes/key/cc_key.bkp
===================================================================
--- trunk/direct.openmoko.com/includes/key/cc_key.bkp	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/key/cc_key.bkp	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: cc_key.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//This is my key do not change this unless you have key utilities installes
+define('CC_KEY', '12345678abcdefgh');
+
+?> 

Added: trunk/direct.openmoko.com/includes/key/cc_key.php
===================================================================
--- trunk/direct.openmoko.com/includes/key/cc_key.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/key/cc_key.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3 @@
+<?php
+define('CC_KEY', 'gFEq5QsCrcV2nMPJ');
+?>

Added: trunk/direct.openmoko.com/includes/key/new_cc_key.bkp
===================================================================
--- trunk/direct.openmoko.com/includes/key/new_cc_key.bkp	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/key/new_cc_key.bkp	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+/*
+  $Id: cc_key.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//This is my key do not change this unless you have key utilities installes
+define('CC_KEY1', '12345678abcdefgh1234');
+?> 

Added: trunk/direct.openmoko.com/includes/key/new_cc_key.php
===================================================================
--- trunk/direct.openmoko.com/includes/key/new_cc_key.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/key/new_cc_key.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+/*
+  $Id: cc_key.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//This is my key do not change this unless you have key utilities installes
+define('CC_KEY1', '12345678abcdefgh1234');
+?> 

Added: trunk/direct.openmoko.com/includes/languages/affiliate_english.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/affiliate_english.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/affiliate_english.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,87 @@
+<?php
+/*
+  $Id: affiliate_english.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('BOX_INFORMATION_AFFILIATE', 'The Affiliate Program');
+//define('BOX_HEADING_AFFILIATE', 'Affiliate Program');
+define('BOX_HEADING_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_CENTRE', 'Affiliate Center');
+define('BOX_AFFILIATE_BANNER_CENTRE', 'Affiliate Links');
+define('BOX_AFFILIATE_REPORT_CENTRE', 'Affiliate Reports');
+define('BOX_AFFILIATE_INFO', 'Affiliate Information');
+define('BOX_AFFILIATE_SUMMARY', 'Affiliate Summary');
+define('BOX_AFFILIATE_PASSWORD', 'Change Password');
+define('BOX_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_NEWSLETTER', 'Newsletter');
+define('BOX_AFFILIATE_ACCOUNT', 'Edit Affiliate Account');
+define('BOX_AFFILIATE_REPORTS', 'Affiliate Reports');
+define('BOX_AFFILIATE_CLICKRATE', 'Clickthrough Report');
+define('BOX_AFFILIATE_PAYMENT', 'Payment Report');
+define('BOX_AFFILIATE_SALES', 'Sales Report');
+define('BOX_AFFILIATE_BANNERS', 'Affiliate Banners');
+define('BOX_AFFILIATE_BANNERS_BANNERS', 'WebSite Banners');
+define('BOX_AFFILIATE_BANNERS_BUILD_CAT', 'Build Category Link');
+define('BOX_AFFILIATE_BANNERS_BUILD', 'Build Product Link');
+define('BOX_AFFILIATE_BANNERS_PRODUCT', 'Product Banners');
+define('BOX_AFFILIATE_BANNERS_CATEGORY', 'Category Banners');
+define('BOX_AFFILIATE_BANNERS_TEXT', 'Text Links');
+define('TEXT_PAYMENT_ID', 'Shows the ID Number, of payments.');
+define('TEXT_SALES_PAYMENT_DATE', 'Shows the date, of payments.');
+define('TEXT_SALES_PAYMENT_Ammount', 'Affiliate Earnings represents the commission due on the sale');
+define('TEXT_PAYMENT_STATUS', 'Sale Status represents the status the sale.');
+define('BOX_AFFILIATE_CONTACT', 'Contact Us');
+define('BOX_AFFILIATE_FAQ', 'Affiliate Program FAQ');
+define('BOX_AFFILIATE_LOGIN', 'Affiliate Log In');
+define('BOX_AFFILIATE_LOGOUT', 'Affiliate Log Out');
+
+define('ENTRY_AFFILIATE_PAYMENT_DETAILS', 'Payable to:');
+define('ENTRY_AFFILIATE_ACCEPT_AGB', 'Check here to indicate that you have read and agree to the <a target="_new" href="' . tep_href_link(FILENAME_AFFILIATE_TERMS, '', 'SSL') . '">Associates Terms & Conditions</a>.');
+define('ENTRY_AFFILIATE_ACCEPT_AGB_TEXT', 'Affiliate Program Terms and Conditions ');
+define('ENTRY_AFFILIATE_AGB_ERROR', ' &nbsp;<small><font color="#FF0000">You must accept our Affiliate Program Terms & Conditions</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK', 'Check Payee Name:');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL', 'PayPal Account Email:');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME', 'Bank Name:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME', 'Account Name:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER', 'Account Number:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER', 'ABA/BSB number (branch number):');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE', 'SWIFT Code:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_COMPANY', 'Company');
+define('ENTRY_AFFILIATE_COMPANY_TEXT', '');
+define('ENTRY_AFFILIATE_COMPANY_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_COMPANY_TAXID', 'TAX ID.:');
+define('ENTRY_AFFILIATE_COMPANY_TAXID_TEXT', '');
+define('ENTRY_AFFILIATE_COMPANY_TAXID_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_HOMEPAGE', 'Homepage');
+define('ENTRY_AFFILIATE_HOMEPAGE_TEXT', '&nbsp;<small><font color="#AABBDD">required (http://)</font></small>');
+define('ENTRY_AFFILIATE_HOMEPAGE_ERROR', '&nbsp;<small><font color="#FF0000">required (http://)</font></small>');
+define('ENTRY_AFFILIATE_NEWSLETTER', 'Affiliate Newsletter');
+define('ENTRY_AFFILIATE_NEWSLETTER_TEXT', '');
+define('ENTRY_AFFILIATE_NEWSLETTER_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('CATEGORY_PAYMENT_DETAILS', 'You get your money by:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/affiliate_espanol.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/affiliate_espanol.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/affiliate_espanol.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+<?php
+/*
+  $Id: affiliate_espanol.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('BOX_INFORMATION_AFFILIATE', 'Programa de Afiliados');
+//define('BOX_HEADING_AFFILIATE', 'Programa de Afilidos');
+define('BOX_HEADING_AFFILIATE_NEWS', 'Novedades de Afiliados');
+define('BOX_AFFILIATE_CENTRE', 'Affiliate Center');
+define('BOX_AFFILIATE_BANNER_CENTRE', 'Affiliate Links');
+define('BOX_AFFILIATE_REPORT_CENTRE', 'Affiliate Reports');
+define('BOX_AFFILIATE_INFO', 'Información de Afiliados');
+define('BOX_AFFILIATE_SUMMARY', 'Sumario de Afiliados');
+define('BOX_AFFILIATE_PASSWORD', 'Change Password');
+define('BOX_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_NEWSLETTER', 'Newsletter');
+define('BOX_AFFILIATE_ACCOUNT', 'Modificar Cuenta de Afiliados');
+define('BOX_AFFILIATE_REPORTS', 'Affiliate Reports');
+define('BOX_AFFILIATE_CLICKRATE', 'Reporte de Clicks');
+define('BOX_AFFILIATE_PAYMENT', 'Reporte de Pagos');
+define('BOX_AFFILIATE_SALES', 'Reporte de Ventas');
+define('BOX_AFFILIATE_BANNERS', 'Banners de Afiliados');
+define('BOX_AFFILIATE_BANNERS_BANNERS', 'WebSite Banners');
+define('BOX_AFFILIATE_BANNERS_BUILD_CAT', 'Build Category Link');
+define('BOX_AFFILIATE_BANNERS_BUILD', 'Build Product Link');
+define('BOX_AFFILIATE_BANNERS_PRODUCT', 'Product Banners');
+define('BOX_AFFILIATE_BANNERS_CATEGORY', 'Category Banners');
+define('BOX_AFFILIATE_BANNERS_TEXT', 'Text Links');
+define('TEXT_PAYMENT_ID', 'Shows the ID Number, of payments.');
+define('TEXT_SALES_PAYMENT_DATE', 'Shows the date, of payments.');
+define('TEXT_SALES_PAYMENT_Ammount', 'Affiliate Earnings represents the commission due on the sale');
+define('TEXT_PAYMENT_STATUS', 'Sale Status represents the status the sale.');
+define('BOX_AFFILIATE_CONTACT', 'Contáctenos');
+define('BOX_AFFILIATE_FAQ', 'FAQ de Programa de Afiliados');
+define('BOX_AFFILIATE_LOGIN', 'Ingreso de Afiliados');
+define('BOX_AFFILIATE_LOGOUT', 'Salir de Afiliados');
+
+define('ENTRY_AFFILIATE_PAYMENT_DETAILS', 'Beneficiario:');
+define('ENTRY_AFFILIATE_ACCEPT_AGB', 'CLick aquí para indicar que Usted ha leído y acepta las <a target="_new" href="' . tep_href_link(FILENAME_AFFILIATE_TERMS, '', 'SSL') . '">Condiciones y Términos de Asociados</a>.');
+define('ENTRY_AFFILIATE_ACCEPT_AGB_TEXT', 'Affiliate Program Terms and Conditions ');
+define('ENTRY_AFFILIATE_AGB_ERROR', ' &nbsp;<small><font color="#FF0000">Usted debe aceptar nuestras Condiciones y Términos de Asociados</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK', 'Cheque a la Orden de:');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL', 'Email de Cuenta de PayPal:');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME', 'Nombre del Banco:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME', 'Titular de Cuenta:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER', 'Número de Cuenta:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER', 'Código ABA/BSB (sucursal):');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE', 'Código SWIFT:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio</font></small>');
+define('ENTRY_AFFILIATE_COMPANY', 'Empresa');
+define('ENTRY_AFFILIATE_COMPANY_TEXT', '');
+define('ENTRY_AFFILIATE_COMPANY_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio</font></small>');
+define('ENTRY_AFFILIATE_COMPANY_TAXID', 'Identificación de Impuesto:');
+define('ENTRY_AFFILIATE_COMPANY_TAXID_TEXT', '');
+define('ENTRY_AFFILIATE_COMPANY_TAXID_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio</font></small>');
+define('ENTRY_AFFILIATE_HOMEPAGE', 'Página Web');
+define('ENTRY_AFFILIATE_HOMEPAGE_TEXT', '&nbsp;<small><font color="#AABBDD">obligatorio (http://)</font></small>');
+define('ENTRY_AFFILIATE_HOMEPAGE_ERROR', '&nbsp;<small><font color="#FF0000">obligatorio (http://)</font></small>');
+define('ENTRY_AFFILIATE_NEWSLETTER', 'Affiliate Newsletter');
+define('ENTRY_AFFILIATE_NEWSLETTER_TEXT', '');
+define('ENTRY_AFFILIATE_NEWSLETTER_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+
+define('CATEGORY_PAYMENT_DETAILS', 'Obtiene su dinero por:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/affiliate_french.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/affiliate_french.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/affiliate_french.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+<?php
+/*
+  $Id: affiliate_french.php,v 1.1.1.1 2003/09/18 19:04:27 wilt Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('BOX_INFORMATION_AFFILIATE', 'The Affiliate Program');
+//define('BOX_HEADING_AFFILIATE', 'Affiliate Program');
+define('BOX_HEADING_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_CENTRE', 'Affiliate Center');
+define('BOX_AFFILIATE_BANNER_CENTRE', 'Affiliate Links');
+define('BOX_AFFILIATE_REPORT_CENTRE', 'Affiliate Reports');
+define('BOX_AFFILIATE_INFO', 'Affiliate Information');
+define('BOX_AFFILIATE_SUMMARY', 'Affiliate Summary');
+define('BOX_AFFILIATE_PASSWORD', 'Change Password');
+define('BOX_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_NEWSLETTER', 'Newsletter');
+define('BOX_AFFILIATE_ACCOUNT', 'Edit Affiliate Account');
+define('BOX_AFFILIATE_REPORTS', 'Affiliate Reports');
+define('BOX_AFFILIATE_CLICKRATE', 'Clickthrough Report');
+define('BOX_AFFILIATE_PAYMENT', 'Payment Report');
+define('BOX_AFFILIATE_SALES', 'Sales Report');
+define('BOX_AFFILIATE_BANNERS', 'Affiliate Banners');
+define('BOX_AFFILIATE_BANNERS_BANNERS', 'WebSite Banners');
+define('BOX_AFFILIATE_BANNERS_BUILD_CAT', 'Build Category Link');
+define('BOX_AFFILIATE_BANNERS_BUILD', 'Build Product Link');
+define('BOX_AFFILIATE_BANNERS_PRODUCT', 'Product Banners');
+define('BOX_AFFILIATE_BANNERS_CATEGORY', 'Category Banners');
+define('BOX_AFFILIATE_BANNERS_TEXT', 'Text Links');
+define('TEXT_PAYMENT_ID', 'Shows the ID Number, of payments.');
+define('TEXT_SALES_PAYMENT_DATE', 'Shows the date, of payments.');
+define('TEXT_SALES_PAYMENT_Ammount', 'Affiliate Earnings represents the commission due on the sale');
+define('TEXT_PAYMENT_STATUS', 'Sale Status represents the status the sale.');
+define('BOX_AFFILIATE_CONTACT', 'Contact Us');
+define('BOX_AFFILIATE_FAQ', 'Affiliate Program FAQ');
+define('BOX_AFFILIATE_LOGIN', 'Affiliate Log In');
+define('BOX_AFFILIATE_LOGOUT', 'Affiliate Log Out');
+
+define('ENTRY_AFFILIATE_PAYMENT_DETAILS', 'Payable to:');
+define('ENTRY_AFFILIATE_ACCEPT_AGB', 'Check here to indicate that you have read and agree to the <a target="_new" href="' . tep_href_link(FILENAME_AFFILIATE_TERMS, '', 'SSL') . '">Associates Terms & Conditions</a>.');
+define('ENTRY_AFFILIATE_ACCEPT_AGB_TEXT', 'Affiliate Program Terms and Conditions ');
+define('ENTRY_AFFILIATE_AGB_ERROR', ' &nbsp;<small><font color="#FF0000">You must accept our Affiliate Program Terms & Conditions</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK', 'Check Payee Name:');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL', 'PayPal Account Email:');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME', 'Bank Name:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME', 'Account Name:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER', 'Account Number:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER', 'ABA/BSB number (branch number):');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE', 'SWIFT Code:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_COMPANY', 'Company');
+define('ENTRY_AFFILIATE_COMPANY_TEXT', '');
+define('ENTRY_AFFILIATE_COMPANY_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_COMPANY_TAXID', 'VAT-Id.:');
+define('ENTRY_AFFILIATE_COMPANY_TAXID_TEXT', '');
+define('ENTRY_AFFILIATE_COMPANY_TAXID_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+define('ENTRY_AFFILIATE_HOMEPAGE', 'Homepage');
+define('ENTRY_AFFILIATE_HOMEPAGE_TEXT', '&nbsp;<small><font color="#AABBDD">required (http://)</font></small>');
+define('ENTRY_AFFILIATE_HOMEPAGE_ERROR', '&nbsp;<small><font color="#FF0000">required (http://)</font></small>');
+define('ENTRY_AFFILIATE_NEWSLETTER', 'Affiliate Newsletter');
+define('ENTRY_AFFILIATE_NEWSLETTER_TEXT', '');
+define('ENTRY_AFFILIATE_NEWSLETTER_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+
+define('CATEGORY_PAYMENT_DETAILS', 'You get your money by:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/affiliate_german.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/affiliate_german.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/affiliate_german.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+<?php
+/*
+  $Id: affiliate_german.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('BOX_INFORMATION_AFFILIATE', 'Partnerprogramm');
+//define('BOX_HEADING_AFFILIATE', 'Partnerprogramm');
+define('BOX_HEADING_AFFILIATE_NEWS', 'Partner News');
+define('BOX_AFFILIATE_CENTRE', 'Affiliate Center');
+define('BOX_AFFILIATE_BANNER_CENTRE', 'Affiliate Links');
+define('BOX_AFFILIATE_REPORT_CENTRE', 'Affiliate Reports');
+define('BOX_AFFILIATE_INFO', 'Partner Informationen');
+define('BOX_AFFILIATE_SUMMARY', 'Partnerkonto &Uuml;bersicht');
+define('BOX_AFFILIATE_PASSWORD', 'Change Password');
+define('BOX_AFFILIATE_NEWS', 'Affiliate News');
+define('BOX_AFFILIATE_NEWSLETTER', 'Newsletter');
+define('BOX_AFFILIATE_ACCOUNT', 'Partnerkonto bearbeiten');
+define('BOX_AFFILIATE_REPORTS', 'Affiliate Reports');
+define('BOX_AFFILIATE_CLICKRATE', '&Uuml;bersicht Klicks');
+define('BOX_AFFILIATE_PAYMENT', 'Provisionszahlungen');
+define('BOX_AFFILIATE_SALES', '&Uuml;bersicht Verk&auml;ufe');
+define('BOX_AFFILIATE_BANNERS', 'Banner');
+define('BOX_AFFILIATE_BANNERS_BANNERS', 'WebSite Banners');
+define('BOX_AFFILIATE_BANNERS_BUILD_CAT', 'Build Category Link');
+define('BOX_AFFILIATE_BANNERS_BUILD', 'Build Product Link');
+define('BOX_AFFILIATE_BANNERS_PRODUCT', 'Product Banners');
+define('BOX_AFFILIATE_BANNERS_CATEGORY', 'Category Banners');
+define('BOX_AFFILIATE_BANNERS_TEXT', 'Text Links');
+define('TEXT_PAYMENT_ID', 'Shows the ID Number, of payments.');
+define('TEXT_SALES_PAYMENT_DATE', 'Shows the date, of payments.');
+define('TEXT_SALES_PAYMENT_Ammount', 'Affiliate Earnings represents the commission due on the sale');
+define('TEXT_PAYMENT_STATUS', 'Sale Status represents the status the sale.');
+define('BOX_AFFILIATE_CONTACT', 'Kontakt');
+define('BOX_AFFILIATE_FAQ', 'FAQ');
+define('BOX_AFFILIATE_LOGIN', 'Partner Anmeldung');
+define('BOX_AFFILIATE_LOGOUT', 'Abmelden');
+
+define('ENTRY_AFFILIATE_PAYMENT_DETAILS', 'Zahlbar an:');
+define('ENTRY_AFFILIATE_ACCEPT_AGB', 'Bitte best&auml;tigen Sie, dass Sie mit unseren <a target="_new" href="' . tep_href_link(FILENAME_AFFILIATE_TERMS, '', 'SSL') . '">AGB\'s</a> einverstanden sind.');
+define('ENTRY_AFFILIATE_AGB_ERROR', '&nbsp;<small><font color="#FF0000">Sie m&uuml;ssen sich mit unseren AGB\'s einverstanden erkl&auml;ren.</font></small>');
+define('ENTRY_AFFILIATE_AGB_ERROR', ' &nbsp;<small><font color="#FF0000">You must accept our Affiliate Program Terms & Conditions</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK', 'Empf&auml;nger des Schecks:');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_CHECK_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL', 'PayPal Account Email:');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_PAYPAL_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME', 'Kreditinstitut:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_NAME_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME', 'Kontoinhaber:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER', 'Konto-Nr.:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER', 'Bankleitzahl:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich</font></small>');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE', 'SWIFT Code:');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_TEXT', '');
+define('ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich</font></small>');
+define('ENTRY_AFFILIATE_COMPANY', 'Firma');
+define('ENTRY_AFFILIATE_COMPANY_TEXT', '');
+define('ENTRY_AFFILIATE_COMPANY_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich</font></small>');
+define('ENTRY_AFFILIATE_COMPANY_TAXID', 'UID-Nr.:');
+define('ENTRY_AFFILIATE_COMPANY_TAXID_TEXT', '');
+define('ENTRY_AFFILIATE_COMPANY_TAXID_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich</font></small>');
+define('ENTRY_AFFILIATE_HOMEPAGE', 'Homepage');
+define('ENTRY_AFFILIATE_HOMEPAGE_TEXT', '&nbsp;<small><font color="#000000"> (http://)</font></small>');
+define('ENTRY_AFFILIATE_HOMEPAGE_ERROR', '&nbsp;<small><font color="#FF0000">erforderlich (http://)</font></small>');
+define('ENTRY_AFFILIATE_NEWSLETTER', 'Affiliate Newsletter');
+define('ENTRY_AFFILIATE_NEWSLETTER_TEXT', '');
+define('ENTRY_AFFILIATE_NEWSLETTER_ERROR', '&nbsp;<small><font color="#FF0000">required</font></small>');
+
+define('CATEGORY_PAYMENT_DETAILS','Auszahlung kann erfolgen &uuml;ber');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/account.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: account.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'My Account');
+define('HEADING_TITLE', 'My Account Information');
+
+define('OVERVIEW_TITLE', 'Overview');
+define('OVERVIEW_SHOW_ALL_ORDERS', '(show all orders)');
+define('OVERVIEW_PREVIOUS_ORDERS', 'Previous Orders');
+
+define('MY_ACCOUNT_TITLE', 'My Account');
+define('MY_ACCOUNT_INFORMATION', 'View or change my account information.');
+define('MY_ACCOUNT_ADDRESS_BOOK', 'View or change entries in my address book.');
+define('MY_ACCOUNT_PASSWORD', 'Change my account password.');
+
+define('MY_ORDERS_TITLE', 'My Orders');
+define('MY_ORDERS_VIEW', 'View the orders I have made.');
+
+define('EMAIL_NOTIFICATIONS_TITLE', 'E-Mail Notifications');
+define('EMAIL_NOTIFICATIONS_NEWSLETTERS', 'Subscribe or unsubscribe from newsletters.');
+define('EMAIL_NOTIFICATIONS_PRODUCTS', 'View or change my product notification list.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/account_edit.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/account_edit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/account_edit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: account_edit.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'My Account');
+define('NAVBAR_TITLE_2', 'Edit Account');
+
+define('HEADING_TITLE', 'My Account Information');
+
+define('MY_ACCOUNT_TITLE', 'My Account');
+
+define('SUCCESS_ACCOUNT_UPDATED', 'Your account has been successfully updated.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/account_history.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/account_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/account_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: account_history.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'My Account');
+define('NAVBAR_TITLE_2', 'History');
+
+define('HEADING_TITLE', 'My Order History');
+
+define('TEXT_ORDER_NUMBER', 'Order Number:');
+define('TEXT_ORDER_STATUS', 'Order Status:');
+define('TEXT_ORDER_DATE', 'Order Date:');
+define('TEXT_ORDER_SHIPPED_TO', 'Shipped To:');
+define('TEXT_ORDER_BILLED_TO', 'Billed To:');
+define('TEXT_ORDER_PRODUCTS', 'Products:');
+define('TEXT_ORDER_COST', 'Order Cost:');
+define('TEXT_VIEW_ORDER', 'View Order');
+
+define('TEXT_NO_PURCHASES', 'You have not yet made any purchases.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/account_history_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/account_history_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/account_history_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: account_history_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'My Account');
+define('NAVBAR_TITLE_2', 'History');
+define('NAVBAR_TITLE_3', 'Order #%s');
+
+define('HEADING_TITLE', 'Order Information');
+
+define('HEADING_ORDER_NUMBER', 'Order #%s');
+define('HEADING_ORDER_DATE', 'Order Date:');
+define('HEADING_ORDER_TOTAL', 'Order Total:');
+
+define('HEADING_DELIVERY_ADDRESS', 'Delivery Address');
+define('HEADING_SHIPPING_METHOD', 'Shipping Method');
+
+define('HEADING_PRODUCTS', 'Products');
+define('HEADING_OPTIONS', 'Option\'s');
+define('HEADING_PRODUCTS_BASE_PRICE', 'Base');
+define('HEADING_PRODUCTS_FINAL_PRICE', 'Final');
+define('HEADING_TAX', 'Tax');
+define('HEADING_TOTAL', 'Total');
+
+define('HEADING_BILLING_INFORMATION', 'Billing Information');
+define('HEADING_BILLING_ADDRESS', 'Billing Address');
+define('HEADING_PAYMENT_METHOD', 'Payment Method');
+
+define('HEADING_ORDER_HISTORY', 'Order History');
+define('HEADING_COMMENT', 'Comments');
+define('TEXT_NO_COMMENTS_AVAILABLE', 'No comments available.');
+
+define('TABLE_HEADING_DOWNLOAD_DATE', 'Link expires: ');
+define('TABLE_HEADING_DOWNLOAD_COUNT', ' downloads remaining');
+define('HEADING_DOWNLOAD', 'Download links');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/account_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/account_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/account_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: account_newsletters.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'My Account');
+define('NAVBAR_TITLE_2', 'Newsletter Subscriptions');
+
+define('HEADING_TITLE', 'Newsletter Subscriptions');
+
+define('MY_NEWSLETTERS_TITLE', 'My Newsletter Subscriptions');
+define('MY_NEWSLETTERS_GENERAL_NEWSLETTER', 'General Newsletter');
+define('MY_NEWSLETTERS_GENERAL_NEWSLETTER_DESCRIPTION', 'Including store news, new products, special offers, and other promotional announcements.');
+
+define('SUCCESS_NEWSLETTER_UPDATED', 'Your newsletter subscriptions have been successfully updated.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/account_notifications.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/account_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/account_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: account_notifications.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'My Account');
+define('NAVBAR_TITLE_2', 'Product Notifications');
+
+define('HEADING_TITLE', 'Product Notifications');
+
+define('MY_NOTIFICATIONS_TITLE', 'My Product Notifications');
+define('MY_NOTIFICATIONS_DESCRIPTION', 'The product notification list allows you to stay up to date on products you find of interest.<br><br>To be up to date on all product changes, select <b>Global Product Notifications</b>.');
+
+define('GLOBAL_NOTIFICATIONS_TITLE', 'Global Product Notifications');
+define('GLOBAL_NOTIFICATIONS_DESCRIPTION', 'Recieve notifications on all available products.');
+
+define('NOTIFICATIONS_TITLE', 'Product Notifications');
+define('NOTIFICATIONS_DESCRIPTION', 'To remove a product notification, clear the products checkbox and click on Continue.');
+define('NOTIFICATIONS_NON_EXISTING', 'There are currently no products marked to be notified on.<br><br>To add products to your product notification list, click on the notification link available on the detailed product information page.');
+
+define('SUCCESS_NOTIFICATIONS_UPDATED', 'Your product notifications have been successfully updated.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/account_password.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/account_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/account_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: account_password.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'My Account');
+define('NAVBAR_TITLE_2', 'Change Password');
+
+define('HEADING_TITLE', 'My Password');
+
+define('MY_PASSWORD_TITLE', 'My Password');
+
+define('SUCCESS_PASSWORD_UPDATED', 'Your password has been successfully updated.');
+define('ERROR_CURRENT_PASSWORD_NOT_MATCHING', 'Your Current Password did not match the password in our records. Please try again.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/address_book.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/address_book.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/address_book.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: address_book.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'My Account');
+define('NAVBAR_TITLE_2', 'Address Book');
+
+define('HEADING_TITLE', 'My Personal Address Book');
+
+define('PRIMARY_ADDRESS_TITLE', 'Primary Address');
+define('PRIMARY_ADDRESS_DESCRIPTION', 'This address is used as the pre-selected shipping and billing address for orders placed on this store.<br><br>This address is also used as the base for product and service tax calculations.');
+
+define('ADDRESS_BOOK_TITLE', 'Address Book Entries');
+
+define('PRIMARY_ADDRESS', '(primary address)');
+
+define('TEXT_MAXIMUM_ENTRIES', '<font color="#ff0000"><b>NOTE:</b></font> A maximum of %s address book entries allowed.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/address_book_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/address_book_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/address_book_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: address_book_process.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'My Account');
+define('NAVBAR_TITLE_2', 'Address Book');
+
+define('NAVBAR_TITLE_ADD_ENTRY', 'New Entry');
+define('NAVBAR_TITLE_MODIFY_ENTRY', 'Update Entry');
+define('NAVBAR_TITLE_DELETE_ENTRY', 'Delete Entry');
+
+define('HEADING_TITLE_ADD_ENTRY', 'New Address Book Entry');
+define('HEADING_TITLE_MODIFY_ENTRY', 'Update Address Book Entry');
+define('HEADING_TITLE_DELETE_ENTRY', 'Delete Address Book Entry');
+
+define('DELETE_ADDRESS_TITLE', 'Delete Address');
+define('DELETE_ADDRESS_DESCRIPTION', 'Are you sure you would like to delete the selected address from your address book?');
+
+define('NEW_ADDRESS_TITLE', 'New Address Book Entry');
+
+define('SELECTED_ADDRESS', 'Selected Address');
+define('SET_AS_PRIMARY', 'Set as primary address.');
+
+define('SUCCESS_ADDRESS_BOOK_ENTRY_DELETED', 'The selected address has been successfully removed from your address book.');
+define('SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED', 'Your address book has been successfully updated.');
+
+define('WARNING_PRIMARY_ADDRESS_DELETION', 'The primary address cannot be deleted. Please set another address as the primary address and try again.');
+
+define('ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY', 'The address book entry does not exist.');
+define('ERROR_ADDRESS_BOOK_FULL', 'Your address book is full. Please delete an unneeded address to save a new one.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/advanced_search.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/advanced_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/advanced_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: advanced_search.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Advanced Search\'s');
+define('NAVBAR_TITLE_2', 'Search Results');
+
+define('HEADING_TITLE_1', 'Advanced Search');
+define('HEADING_TITLE_2', 'Products meeting the search criteria');
+
+define('HEADING_SEARCH_CRITERIA', 'Search Criteria');
+
+define('TEXT_SEARCH_IN_DESCRIPTION', 'Search In Product Descriptions');
+define('ENTRY_CATEGORIES', 'Categories:');
+define('ENTRY_INCLUDE_SUBCATEGORIES', 'Include Subcategories');
+define('ENTRY_MANUFACTURERS', 'Manufacturers:');
+define('ENTRY_PRICE_FROM', 'Price From:');
+define('ENTRY_PRICE_TO', 'Price To:');
+define('ENTRY_DATE_FROM', 'Date From:');
+define('ENTRY_DATE_TO', 'Date To:');
+
+define('TEXT_SEARCH_HELP_LINK', '<u>Search Help</u> [?]');
+
+define('TEXT_ALL_CATEGORIES', 'All Categories');
+define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');
+
+define('HEADING_SEARCH_HELP', 'Search Help');
+define('TEXT_SEARCH_HELP', 'Keywords may be separated by AND and/or OR statements for greater control of the search results.<br><br>For example, <u>Microsoft AND mouse</u> would generate a result set that contain both words. However, for <u>mouse OR keyboard</u>, the result set returned would contain both or either words.<br><br>Exact matches can be searched for by enclosing keywords in double-quotes.<br><br>For example, <u>"notebook computer"</u> would generate a result set which match the exact string.<br><br>Brackets can be used for further control on the result set.<br><br>For example, <u>Microsoft and (keyboard or mouse or "visual basic")</u>.');
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('TABLE_HEADING_IMAGE', '');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+
+define('TEXT_NO_PRODUCTS', 'There is no product that matches the search criteria.');
+
+define('ERROR_AT_LEAST_ONE_INPUT', 'At least one of the fields in the search form must be entered.');
+define('ERROR_INVALID_FROM_DATE', 'Invalid From Date.');
+define('ERROR_INVALID_TO_DATE', 'Invalid To Date.');
+define('ERROR_TO_DATE_LESS_THAN_FROM_DATE', 'To Date must be greater than or equal to From Date.');
+define('ERROR_PRICE_FROM_MUST_BE_NUM', 'Price From must be a number.');
+define('ERROR_PRICE_TO_MUST_BE_NUM', 'Price To must be a number.');
+define('ERROR_PRICE_TO_LESS_THAN_PRICE_FROM', 'Price To must be greater than or equal to Price From.');
+define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_affiliate.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_affiliate.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Login');
+define('HEADING_TITLE', 'Affiliate Login');
+define('HEADING_TITLE_ERROR', 'Registration Error');
+
+define('TEXT_AFFILIATE_LOGOFF', 'Log Out');
+define('TEXT_AFFILIATE_ID', 'Affiliate Email:');
+define('TEXT_AFFILIATE_PASSWORD', 'Password:');
+
+define('HEADING_NEW_AFFILIATE', 'New Affiliate');
+define('TEXT_NEW_AFFILIATE', 'I am a new affiliate.');
+define('TEXT_NEW_AFFILIATE_INTRODUCTION', 'By creating an affiliate account at ' . STORE_NAME . ' you will be able to earn valuable extra revenue by referring your website\'s visitors to us.');
+define('TEXT_NEW_AFFILIATE_TERMS', 'Our Affiliate Terms & Conditions');
+
+define('HEADING_RETURNING_AFFILIATE', 'Returning Affiliate');
+define('TEXT_RETURNING_AFFILIATE', 'I am a returning affiliate.');
+
+define('TEXT_AFFILIATE_PASSWORD_FORGOTTEN', 'Password forgotten? Click here.');
+
+define('TEXT_LOGIN_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> No match for \'Affiliate ID\' and/or \'Password\'.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program: Banners');
+
+define('TEXT_AFFILIATE_BANNERS', 'Banner Links');
+define('TEXT_AFFILIATE_BANNERS_BUILD', 'Build a Link');
+define('TEXT_AFFILIATE_BANNERS_PRODUCT', 'Product Links');
+define('TEXT_AFFILIATE_BANNERS_TEXT', 'Text Links');
+
+define('TEXT_INFORMATION_BANNERS_BANNERS', 'Effective HIGHLY colorful graphical links in various shapes and sizes');
+define('TEXT_INFORMATION_BANNERS_BUILD', 'Create dynamic links to a particular product of your choice.');
+define('TEXT_INFORMATION_BANNERS_PRODUCT', 'Recommend specific products to your visitors by linking directly to a particular product.');
+define('TEXT_INFORMATION_BANNERS_TEXT', 'Get maximum sales from these proven to-be-effective and easy-to-use text based links.');
+define('TEXT_INFORMATION', 'Obtain a range of affiliate links that you can display on your website.');
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER', 'BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO', 'Enter the product number you wish to link to.');
+
+define('IMAGE_BUTTON_BUILD_A_LINK','Build a Link for a Product Banner.');
+define('IMAGE_BANNERS','Banners');
+define('IMAGE_PRODUCT','Product Links');
+define('IMAGE_BUILD','Build a Link');
+define('IMAGE_TEXT','Text Links');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_banners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: affiliate_banners_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Banners');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Choose the banner you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_build.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_build.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_build.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Build a Link');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Enter the product number of the product you wish to build a link for:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER','BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO','Enter the product number you wish to link to and press the enter&nbsp;');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available products.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the product number from the popup window and enter the number in the Build A Link field.');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Available Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Product #');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('IMAGE_BUTTON_BUILD_A_LINK', 'BUILD-A-LINK');
+
+
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_build_cat.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_build_cat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_build_cat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Build a CATEGORY Link');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Enter the CATEGORY number of the CATEGORY you wish to build a link for:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER','BUILD-A-CATEGORY-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO','Enter the CATEGORY number you wish to link to and press the enter&nbsp;');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available categories.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the category number from the popup window and enter the number in the Build Category Link field.');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Available Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Categories #');
+define('TEXT_VALID_CATEGORIES_NAME', 'Categories Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('IMAGE_BUTTON_BUILD_A_LINK', 'BUILD-A-LINK');
+
+define('TEXT_VERSION', 'Text Version:');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_category.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_category.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_category.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: affiliate_banners_category.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Category Links');
+
+define('TEXT_AFFILIATE_NAME', 'Category Name:');
+define('TEXT_INFORMATION', 'Choose the CATEGORY you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_product.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_product.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_product.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: affiliate_banners_product.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Product Links');
+
+define('TEXT_AFFILIATE_NAME', 'Product Name:');
+define('TEXT_INFORMATION', 'Choose the product you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_text.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_text.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_banners_text.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_banners_text.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Text Links');
+
+define('TEXT_AFFILIATE_NAME', 'Link Name:');
+define('TEXT_INFORMATION', 'Choose the link you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+
+define('TEXT_VERSION', 'Text Version:');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program: Clickthroughs');
+
+define('TABLE_HEADING_DATE', 'Date');
+define('TABLE_HEADING_REFFERED', 'Referrer');
+define('TABLE_HEADING_IP', 'IP Address');
+define('TABLE_HEADING_BROWSER', 'Browser');
+define('TABLE_HEADING_CLICKED_PRODUCT', 'Product or Page');
+
+define('TEXT_AFFILIATE_HEADER', 'Total clickthroughs from your site:');
+define('TEXT_NO_CLICKS', 'No clickthroughs have been recorded from your site.');
+define('TEXT_DISPLAY_NUMBER_OF_CLICKS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> clickthroughs)');
+define('TEXT_CLICKTHROUGH_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_CLICKS', 'Click on [?] to see a description of each category.');
+define('HEADING_CLICKTHROUGH_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the clickthrough from your site.');
+define('TEXT_CLICKED_PRODUCT_HELP', '<i>Product or Page</i> represents the page or product clicked through to');
+define('TEXT_REFFERED_HELP', '<i>Referrer</i> represents the url that the clickthrough came from.');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Contact Form');
+
+define('TEXT_SUCCESS', 'Your message has been successfully sent to the Affiliate Program Team');
+
+define('EMAIL_SUBJECT', 'Affiliate Program');
+define('ENTRY_NAME', 'Your Full Name:');
+define('ENTRY_EMAIL', 'Your Email Address:');
+define('ENTRY_ENQUIRY', 'Your Message:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_details.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_details.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'The Affiliate Program');
+define('NAVBAR_TITLE_2', 'Edit Affiliate Account');
+define('HEADING_TITLE', 'The Affiliate Program - Your Account Details<br><small>You may edit any information below:</small>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_details_ok.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_details_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_details_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_details_ok.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Your Account Details were changed!');
+define('TEXT_INFORMATION', 'We have updated your account details, Please click the continue button.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<?php
+/*
+  $Id: affiliate_faq.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program FAQ');
+define('HEADING_TITLE', 'Affiliate Program - Frequently Asked Questions');
+
+define('TEXT_INFORMATION', '' . STORE_NAME . ' has compiled this info so that you may be better informed about our affiliate program.<br>
+ If you have any questions please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a> for more information.<br>
+<ul>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#1">Question 1?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#2">Question 2?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#3">Question 3?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#4">Question 4?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#5">Question 5?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#6">Question 6?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#7">Question 7?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#8">Question 8?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#9">Question 9?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#10">Question 10?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#11">Question 11?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#12">Question 12?</a>
+</ul>
+<hr width ="90%">
+<BR>
+<FONT COLOR="#000000" size="4"><B><U>Frequently Asked Questions</U></B></FONT>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 1?</font><a name="1"></a><br>
+Answer 1.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 2?</font><a name="2"></a><br>
+Answer 2.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 3?</font><a name="3"></a><br>
+Answer 3.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 4?</font><a name="4"></a><br>
+Answer 4.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 5?</font><a name="5"></a><br>
+Answer 5.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 6?</font><a name="6"></a><br>
+Answer 6.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 7?</font><a name="7"></a><br>
+Answer 7.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 8?</font><a name="8"></a><br>
+Answer 8.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 9?</font><a name="9"></a><br>
+Answer 9.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 10?</font><a name="10"></a><br>
+Answer 10.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 11?</font><a name="11"></a><br>
+Answer 11.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 12?</font><a name="12"></a><br>
+Answer 12.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p align="right" style="line-height: 100%; word-spacing: 0: text-indent: 0: margin: 0:">This text can be edited in includes/languages/<selected language>/affiliate_faq.php.</p>
+');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program');
+
+define('HEADING_AFFILIATE_PROGRAM_TITLE', 'The ' . STORE_NAME . ' Affiliate Program');
+
+// Delete this line - or place two forward slashes before the word 'define'
+define('TEXT_INFORMATION', 'Your Affiliate Information Goes in /catalog/includes/languages/YOUR LANGUAGE/affiliate_info.php ');
+
+// define('TEXT_INFORMATION',' <DELETE THE BRACKETS AND ALL TEXT IN BETWEEN - PUT YOUR INFORMATION HERE>');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_logout.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_logout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_logout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: affiliate_logout.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'The Affiliate Program');
+define('HEADING_TITLE', 'The Affiliate Program');
+
+define('TEXT_INFORMATION', 'You were logged out successfully.');
+define('TEXT_INFORMATION_ERROR_1', 'You could not be logged out.');
+define('TEXT_INFORMATION_ERROR_2', 'You were not logged in and can therefore not be logged out.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.10 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate News');
+
+define('TABLE_HEADING_AFFILIATE_NEWS', 'Affiliate News');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Choose the banner or link you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER', 'BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO', 'Enter the product number you wish to link to.');
+
+define('IMAGE_BUTTON_BUILD_A_LINK','Build a Link for a Product Banner.');
+
+//add on \admin\includes\english\affiliate_news.php
+// npe admin begin #add
+define('TEXT_AFFILIATE_NEWS_CONTENT_DELETE', 'Delete displayed news in this language!');
+define('EMPTY_CATEGORY', 'Empty news');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'There are no news which can be displayed to your affiliate partners.');
+// npe admin begin #add
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Affiliate Program');
+define('NAVBAR_TITLE_2', 'Newsletter Subscriptions');
+
+define('HEADING_TITLE', 'Newsletter Subscriptions');
+
+define('MY_NEWSLETTERS_TITLE', 'My Newsletter Subscriptions');
+define('MY_NEWSLETTERS_AFFILIATE_NEWSLETTER', 'Affiliate Newsletter');
+define('MY_NEWSLETTERS_AFFILIATE_NEWSLETTER_DESCRIPTION', 'Including affiliate news, new products, special offers, and other promotional announcements.');
+
+define('SUCCESS_NEWSLETTER_UPDATED', 'Your newsletter subscriptions have been successfully updated.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_password.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Affiliate Program');
+define('NAVBAR_TITLE_2', 'Change Password');
+
+define('HEADING_TITLE', 'My Password');
+
+define('MY_PASSWORD_TITLE', 'My Password');
+
+define('SUCCESS_PASSWORD_UPDATED', 'Your password has been successfully updated.');
+define('ERROR_CURRENT_PASSWORD_NOT_MATCHING', 'Your Current Password did not match the password in our records. Please try again.');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_password_forgotten.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Login');
+define('NAVBAR_TITLE_2', 'Affiliate Password Forgotten');
+define('HEADING_TITLE', 'I\'ve Forgotten My Affiliate Password!');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', '<font color="#ff0000"><b>NOTE:</b></font> The E-Mail Address was not found in our records. Please try again.');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - New Affiliate Password');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'A new affiliate password was requested from ' . $REMOTE_ADDR . '.' . "\n\n" . 'Your new affiliate password to \'' . STORE_NAME . '\' is:' . "\n\n" . '   %s' . "\n\n");
+define('TEXT_PASSWORD_SENT', 'A New Affiliate Password Has Been Sent To Your Email Address');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program: Payment');
+
+define('TEXT_AFFILIATE_HEADER', 'Your Payments:');
+
+define('TABLE_HEADING_DATE', 'Payment Date');
+define('TABLE_HEADING_PAYMENT', 'Affiliate Earnings');
+define('TABLE_HEADING_STATUS', 'Payment Status');
+define('TABLE_HEADING_PAYMENT_ID','Payment-ID');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> payments)');
+define('TEXT_INFORMATION_PAYMENT_TOTAL', 'Your current earnings amount to:');
+define('TEXT_NO_PAYMENTS', 'No payments have been recorded yet.');
+define('TEXT_PAYMENT_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_PAYMENT', 'Click on [?] to see a description of each category.');
+define('HEADING_PAYMENT_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the payment made to the affiliate.');
+define('TEXT_PAYMENT_ID_HELP', '<i>Payment-ID</i> represents the payment number associated to the payment.');
+define('TEXT_PAYMENT_HELP', '<i>Affiliate Earnings</i> represents the value of payment made to the affiliate.');
+define('TEXT_STATUS_HELP', '<i>Payment Status</i> represents the status of the payment made to the affiliate');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_reports.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_reports.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_reports.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program: Affiliate Reports');
+
+define('TEXT_INFORMATION', 'Obtain affiliate links that you can display on your website.');
+
+define('TEXT_AFFILIATE_CLICKS', 'Clickthrough Report');
+define('TEXT_AFFILIATE_SALES', 'Sales Report');
+define('TEXT_AFFILIATE_PAYMENT', 'Payment Report');
+
+
+define('TEXT_INFORMATION_CLICKS', 'View Clickthrough information from your website');
+define('TEXT_INFORMATION_SALES', 'View your current and previous Affiliate Sales');
+define('TEXT_INFORMATION_PAYMENT', 'View all affiliate payments made to you');
+
+define('IMAGE_CLICKS','Clickthrough Report');
+define('IMAGE_SALES','Sales Report');
+define('IMAGE_PAYMENT','Payment Report');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: affiliate_sales.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program: Sales');
+
+define('TABLE_HEADING_DATE', 'Date');
+define('TABLE_HEADING_SALES', 'Affiliate Earnings (excl.)');
+define('TABLE_HEADING_VALUE', 'Sale Value (excl.)');
+define('TABLE_HEADING_PERCENTAGE','Commission Rate');
+define('TABLE_HEADING_STATUS', 'Sale Status');
+
+define('TEXT_DELETED_ORDER_BY_ADMIN', 'Deleted (Admin)');
+define('TEXT_INFORMATION_SALES_TOTAL', 'Your current earnings amount (excl.) to:');
+define('TEXT_INFORMATION_SALES_TOTAL2', '<br>Only delivered sales are counted!');
+define('TEXT_NO_SALES', 'No sales have been recorded yet.');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> sales)');
+
+define('TEXT_AFFILIATE_HEADER', 'Sales from your website:');
+define('TEXT_SALES_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_SALES', 'Click on [?] to see a description of each category.');
+define('HEADING_SALES_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the sale.');
+define('TEXT_TIME_HELP', '<i>Time</i> represents the time of the sale.');
+define('TEXT_SALE_VALUE_HELP', '<i>Sale Value</i> represents the value of the sale.');
+define('TEXT_COMMISSION_RATE_HELP', '<i>Commission Rate</i> represents the commission rate paid on the sale.');
+define('TEXT_COMMISSION_VALUE_HELP', '<i>Affiliate Earnings</i> represents the commission due on the sale.');
+define('TEXT_STATUS_HELP', '<i>Sale Status</i> represents the status the sale.');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_signup.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_signup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_signup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: affiliate_signup.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Sign Up');
+
+define('MAIL_AFFILIATE_SUBJECT', 'Welcome to the Affiliate Program');
+define('MAIL_GREET_NONE', 'Dear %s' . "\n\n");//em001
+define('MAIL_AFFILIATE_HEADER', 'Thank you for joining the Affiliate Program' . "\n\n" .'Your Account Information:
+***********************'."\n\n");
+define('MAIL_AFFILIATE_ID', 'Your Affiliate ID is: %s' . "\n");
+define('MAIL_AFFILIATE_USERNAME', 'Your Affiliate Username is: %s' . "\n");
+define('MAIL_AFFILIATE_PASSWORD', 'Your Password is: %s' . "\n\n");
+define('MAIL_AFFILIATE_LINK', 'Link to your account by going to this URL: %s');
+define('MAIL_AFFILIATE_FOOTER', 'Have fun earning referral fees!'."\n\n".'Your Affiliate Team');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_signup_ok.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_signup_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_signup_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: affiliate_signup_ok.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Signup');
+define('HEADING_TITLE', 'Congratulations!');
+define('TEXT_INFORMATION', 'Congratulations! Your new Affiliate account application has been submitted! You will shortly receive an email containing important information regarding your Affiliate Account, including you affiliate login details. If you have not received it within the hour, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.<br><br>If you have <small><b>ANY</b></small> questions about the affiliate program, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.');
+define('TEXT_ACCOUNT_CREATED', 'Congratulations! Your new Affiliate account application has been submitted! You will shortly receive an email containing important information regarding your Affiliate Account, including you affiliate login details. If you have not received it within the hour, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.<br><br>If you have <small><b>ANY</b></small> questions about the affiliate program, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Your Summary');
+define('HEADING_TITLE', 'The Affiliate Program');
+
+define('TEXT_AFFILIATE_CENTRE', 'Affiliate Center');
+define('TEXT_AFFILIATE_BANNER_CENTRE', 'Affiliate Banners');
+define('TEXT_AFFILIATE_REPORT_CENTRE', 'Affiliate Reports');
+define('TEXT_AFFILIATE_INFO', 'Affiliate Information');
+define('TEXT_AFFILIATE_SUMMARY', 'Affiliate Summary');
+define('TEXT_AFFILIATE_PASSWORD', 'Change Password');
+define('TEXT_AFFILIATE_NEWS', 'Affiliate News');
+define('TEXT_AFFILIATE_NEWSLETTER', 'Newsletter');
+define('TEXT_AFFILIATE_ACCOUNT', 'Edit Affiliate Account');
+define('TEXT_AFFILIATE_REPORTS', 'Affiliate Reports');
+define('TEXT_AFFILIATE_CLICKRATE', 'Clickthrough Report');
+define('TEXT_AFFILIATE_PAYMENT', 'Payment Report');
+define('TEXT_AFFILIATE_SALES', 'Sales Report');
+define('TEXT_AFFILIATE_BANNERS', 'Affiliate Banners');
+define('TEXT_AFFILIATE_BANNERS_BANNERS', 'Banner Links');
+define('TEXT_AFFILIATE_BANNERS_BUILD', 'Build a Link');
+define('TEXT_AFFILIATE_BANNERS_PRODUCT', 'Product Links');
+define('TEXT_AFFILIATE_BANNERS_TEXT', 'Text Links');
+define('TEXT_INFORMATION', 'Your affiliate Information goes here');
+define('TEXT_SUMMARY_TITLE', 'Affiliate Summary');
+define('TEXT_IMPRESSIONS', 'Impressions: ');
+define('TEXT_VISITS', 'Visits: ');
+define('TEXT_TRANSACTIONS', 'Transactions: ');
+define('TEXT_CONVERSION', 'Conversion: ');
+define('TEXT_AMOUNT', 'Sales Amount: ');
+define('TEXT_AVERAGE', 'Sales Average: ');
+define('TEXT_COMMISSION_RATE', 'Commission Rate: ');
+define('TEXT_PAYPERSALE_RATE', 'Pay Per Sale Rate: ');
+define('TEXT_CLICKTHROUGH_RATE', 'Clickthrough Rate: ');
+define('TEXT_COMMISSION', 'Commission: ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Click on [?] to see a description of each category.');
+define('HEADING_SUMMARY_HELP', 'Affiliate Help');
+define('TEXT_IMPRESSIONS_HELP', '<b>Impressions:</b> displays the total number of times a banner or link has been displayed in the given time period.');
+define('TEXT_VISITS_HELP', '<b>Visits:</b> represents the total number of click-throughs by visitors from your website.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Transactions:</b> represents the total number of successful transactions credited to your account.');
+define('TEXT_CONVERSION_HELP', '<b>Conversions:</b> represents the percentage of visitors (click-throughs) completing a transaction.');
+define('TEXT_AMOUNT_HELP', '<b>Sales Amount:</b> represents the total sales value of delivered orders credited to your account.');
+define('TEXT_AVERAGE_HELP', '<b>Sales Average:</b> represents the average sales value credited to your account.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Commission Rate:</b> represents the rate you are paid for sales as a percentage.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<b>Clickthrough Rate:</b> represents the rate you are paid for clickthroughs on a per click basis.');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<b>Pay Per Sale Rate:</b> represents the rate you are paid for sales on a sale by sale basis.');
+define('TEXT_COMMISSION_HELP', '<b>Commission Rate:</b> represents the total commission owed to you.');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+
+define('TEXT_GREETING','Welcome ');
+define('TEXT_AFFILIATE_ID', 'Your Affiliate ID: ');
+
+define('IMAGE_BANNERS','Banners');
+define('IMAGE_CLICKTHROUGHS','Clickthrough Report');
+define('IMAGE_SALES','Sales Report');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/affiliate_terms.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/affiliate_terms.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/affiliate_terms.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: affiliate_terms.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program');
+
+define('HEADING_AFFILIATE_PROGRAM_TITLE', 'The ' . STORE_NAME . ' Affiliate Terms');
+define('TEXT_INFORMATION', 'Your Affiliate Terms Goes in Here');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/all_prodcats.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/all_prodcats.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/all_prodcats.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: all_products.php, v 3.00 2004/02/21 by Ingo info at gamephisto.de
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'All Categproes and Products');
+define('HEADING_TITLE', 'All Categories and Products');
+
+define('HEADING_ALL_CATSUB', 'Categories and Sub-Subcategories');
+define('HEADING_ALL_PRODUCTS', 'Products');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/all_prodmanf.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/all_prodmanf.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/all_prodmanf.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: all_prodmanf.php, v 1.00 2004/09/04
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'All Manufactures and Products');
+define('HEADING_TITLE', 'All Manufactures and Products');
+
+define('HEADING_ALL_CATSUB', 'Manufactures');
+define('HEADING_ALL_PRODUCTS', 'Products');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/allprods.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/allprods.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/allprods.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: allprods.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'All Products');
+define('HEADING_TITLE', 'All Products');
+
+define('BOX_INFORMATION_ALLPRODS', 'View All of Our Products');
+define('HEADING_TEXT_PRODUCT', 'Product Name');
+define('HEADING_TEXT_MODEL', 'Model');
+define('HEADING_TEXT_PRICE', 'Price');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/article_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/article_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/article_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: article_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_ARTICLE_NOT_FOUND', 'Article Not Found');
+define('TEXT_ARTICLE_NOT_FOUND', 'Sorry, but the article you requested is not available in this site.');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this articles <a href="%s" target="_blank"><u>web page</u></a>.');
+define('TEXT_DATE_ADDED', 'This article was published on %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#FF0000">This article will be published on %s.</font>');
+define('TEXT_BY', 'by ');
+define('TEXT_CURRENT_REVIEWS', 'Current Reviews:');
+define('BOX_TEXT_TELL_A_FRIEND', 'Tell a friend'); 
+define('TEXT_TELL_A_FRIEND', 'Tell a friend about this article:');
+define('TEXT_XSELL_ARTICLES', 'Products related to this article:');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/article_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/article_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/article_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+define('TEXT_MAIN', '');
+define('TABLE_HEADING_NEW_ARTICLES', 'New Articles');
+  define('HEADING_TITLE', $topics['topics_name']);
+  define('TABLE_HEADING_ARTICLES', 'Articles');
+  define('TABLE_HEADING_AUTHOR', 'Author');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles in this topic.');
+  define('TEXT_NO_ARTICLES2', 'There are currently no articles available from this author.');
+  define('TEXT_NUMBER_OF_ARTICLES', 'Number of Articles: ');
+  define('TEXT_SHOW', 'Display:');
+  define('TEXT_NOW', '\' now');
+  define('TEXT_ALL_TOPICS', 'All Topics');
+  define('TEXT_ALL_AUTHORS', 'All Authors');
+  define('TEXT_ARTICLES_BY', 'Articles by ');
+  define('TEXT_ARTICLES', 'Below is a list of articles with the most recent ones listed first.');  
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+  define('TEXT_MORE_INFORMATION', 'For more information, please visit this authors <a href="http://%s" target="_blank">web page</a>.');
+?>  
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Reviews of ');
+define('NAVBAR_TITLE', 'Reviews');
+
+define('TEXT_NO_ARTICLE_REVIEWS', 'There are currently no aproved reviews for this article.');
+define('TEXT_OF_5_STARS', '%s out of 5 Stars');
+define('TEXT_REVIEW_VIEWS', 'Number of times read: ');
+define('TEXT_READ_REVIEW', 'Read Review...');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/article_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/article_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/article_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: article_reviews_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Review');
+define('HEADING_TITLE', 'Review of ');
+define('SUB_TITLE_ARTICLE', 'Article:');
+define('SUB_TITLE_FROM', 'From:');
+define('SUB_TITLE_DATE', 'Date:');
+define('SUB_TITLE_REVIEW', 'Review:');
+define('SUB_TITLE_RATING', 'Rating:');
+define('TEXT_OF_5_STARS', '%s of 5 Stars');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/article_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/article_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/article_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: article_reviews_write.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Reviews');
+define('HEADING_TITLE', 'Write Review of \'');
+
+define('SUB_TITLE_FROM', 'From:');
+define('SUB_TITLE_REVIEW', 'Your Review:');
+define('SUB_TITLE_RATING', 'Rating:');
+
+define('TEXT_APPROVAL_WARNING', 'Note: Your review will not appear until it has been approved.');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>Poor</b></font></small>');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>Excellent</b></font></small>');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/article_search.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/article_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/article_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: article_search.php
+  By AlDaffodil:  aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_1', 'Article Search');
+define('HEADING_TITLE_2', 'Articles meeting the search criteria');
+
+define('NAVBAR_TITLE_1', 'Article Search');
+define('NAVBAR_TITLE_2', 'Articles meeting the search criteria');
+define('TABLE_HEADING_ARTICLES', 'Article');
+
+define('TEXT_ARTICLE_NAME' , 'Article Title & Link');
+define('TEXT_ARTICLE_EXCERPT' , 'Article Excerpt');
+
+define('TEXT_NO_ARTICLES', 'There are no articles matching the search criteria.');
+
+define('ERROR_INPUT', 'Please enter a search term.');
+define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/articles.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_MAIN', '');
+define('TABLE_HEADING_NEW_ARTICLES', 'New Articles in %s');
+
+if ( ($topic_depth == 'articles') || (isset($HTTP_GET_VARS['authors_id'])) ) {
+  define('HEADING_TITLE', $topics['topics_name']);
+  define('TABLE_HEADING_ARTICLES', 'Articles');
+  define('TABLE_HEADING_AUTHOR', 'Author');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles in this topic.');
+  define('TEXT_NO_ARTICLES2', 'There are currently no articles available from this author.');
+  define('TEXT_NUMBER_OF_ARTICLES', 'Number of Articles: ');
+  define('TEXT_SHOW', 'Display:');
+  define('TEXT_NOW', '\' now');
+  define('TEXT_ALL_TOPICS', 'All Topics');
+  define('TEXT_ALL_AUTHORS', 'All Authors');
+  define('TEXT_ARTICLES_BY', 'Articles by ');
+  define('TEXT_ARTICLES', 'Below is a list of articles with the most recent ones listed first.');  
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+  define('TEXT_MORE_INFORMATION', 'For more information, please visit this authors <a href="http://%s" target="_blank">web page</a>.');
+} elseif ($topic_depth == 'top') {
+  define('HEADING_TITLE', 'All Articles');
+  define('TEXT_ALL_ARTICLES', 'Below is a list of all articles with the most recent ones listed first.');
+  define('TEXT_CURRENT_ARTICLES', 'Current Articles');
+  define('TEXT_UPCOMING_ARTICLES', 'Upcoming Articles');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles listed.');
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_DATE_EXPECTED', 'Expected:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+} elseif ($topic_depth == 'nested') {
+  define('HEADING_TITLE', 'Articles');
+}
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/articles_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/articles_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/articles_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: articles_new.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'New Articles');
+define('HEADING_TITLE', 'New Articles');
+
+define('TEXT_NEW_ARTICLES', 'The following articles were added in the last %s days.');
+define('TEXT_NO_NEW_ARTICLES', 'No new articles have been added in the last %s days.');
+define('TEXT_DATE_ADDED', 'Published:');
+define('TEXT_AUTHOR', 'Author:');
+define('TEXT_TOPIC', 'Topic:');
+define('TEXT_BY', 'by');
+define('TEXT_READ_MORE', 'Read More');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/attributes_sorter.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/attributes_sorter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/attributes_sorter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,11 @@
+<?php
+/*
+  WebMakers.com Added: Attributes Sorter
+*/
+
+// Sorter for product_info.php
+define('PRODUCTS_OPTIONS_SORT_BY_PRICE','1'); // 1= sort by products_options_sort_order + name; 0= sort by products_options_sort_order + price
+
+// Categories Image and Name on product_info.php
+define('SHOW_CATEGORIES','0'); // 0= off  1=on
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/cards1_box.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/cards1_box.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/cards1_box.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: card.php,v 1.1 2004/06/24 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ // information box text in templates/(mytemplate)/boxes/cards.php
+
+define('BOX_INFORMATION_CARD', 'Information');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/checkout_confirmation.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/checkout_confirmation.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/checkout_confirmation.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: checkout_confirmation.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Checkout');
+define('NAVBAR_TITLE_2', 'Confirmation');
+
+define('HEADING_TITLE', 'Order Confirmation');
+
+define('HEADING_DELIVERY_ADDRESS', 'Delivery Address');
+define('HEADING_SHIPPING_METHOD', 'Shipping Method');
+define('HEADING_PRODUCTS', 'Products');
+define('HEADING_TAX', 'Tax');
+define('HEADING_TOTAL', 'Total');
+define('HEADING_BILLING_INFORMATION', 'Billing Information');
+define('HEADING_BILLING_ADDRESS', 'Billing Address');
+define('HEADING_PAYMENT_METHOD', 'Payment Method');
+define('HEADING_PAYMENT_INFORMATION', 'Payment Information');
+define('HEADING_ORDER_COMMENTS', 'Comments About Your Order');
+define('HEADING_IPRECORDED_1','NOTE! The below IP and ISP has been recorded for security purposes.');
+define('YOUR_IP_IPRECORDED', 'IP Address');
+define('YOUR_ISP_IPRECORDED', 'ISP');
+
+define('TEXT_EDIT', 'Edit');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continue Checkout Procedure');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'to confirm this order.');
+//please change the info_id=1 to the ID number for your condition in the information system
+define('CONDITION_AGREEMENT', 'I have read the <a href="information.php?info_id=1" target="_blank">conditions of use</a> and I agree to them');
+define('CONDITION_AGREEMENT_WARNING', 'Please read our conditions of use and agree to them. If you do not so, we can not deliver to you.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/checkout_payment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/checkout_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/checkout_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_payment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Checkout');
+define('NAVBAR_TITLE_2', 'Payment Method');
+
+define('HEADING_TITLE', 'Payment Information');
+
+define('TABLE_HEADING_BILLING_ADDRESS', 'Billing Address');
+define('TEXT_SELECTED_BILLING_DESTINATION', 'Please choose from your address book where you would like the invoice to be sent to.');
+define('TITLE_BILLING_ADDRESS', 'Billing Address:');
+
+define('TABLE_HEADING_PAYMENT_METHOD', 'Payment Method');
+define('TEXT_SELECT_PAYMENT_METHOD', 'Please select the preferred payment method to use on this order.');
+define('TITLE_PLEASE_SELECT', 'Please Select');
+define('TEXT_ENTER_PAYMENT_INFORMATION', 'This is currently the only payment method available to use on this order.');
+
+define('TABLE_HEADING_COMMENTS', 'Add Comments About Your Order');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continue Checkout Procedure');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'to confirm this order.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/checkout_payment_address.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/checkout_payment_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/checkout_payment_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_payment_address.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Checkout');
+define('NAVBAR_TITLE_2', 'Change Billing Address');
+
+define('HEADING_TITLE', 'Payment Information');
+
+define('TABLE_HEADING_PAYMENT_ADDRESS', 'Billing Address');
+define('TEXT_SELECTED_PAYMENT_DESTINATION', 'This is the currently selected billing address where the invoice to this order will be delivered to.');
+define('TITLE_PAYMENT_ADDRESS', 'Billing Address:');
+
+define('TABLE_HEADING_ADDRESS_BOOK_ENTRIES', 'Address Book Entries');
+define('TEXT_SELECT_OTHER_PAYMENT_DESTINATION', 'Please select the preferred billing address if the invoice to this order is to be delivered elsewhere.');
+define('TITLE_PLEASE_SELECT', 'Please Select');
+
+define('TABLE_HEADING_NEW_PAYMENT_ADDRESS', 'New Billing Address');
+define('TEXT_CREATE_NEW_PAYMENT_ADDRESS', 'Please use the following form to create a new billing address to use for this order.');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continue Checkout Procedure');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'to select the preferred payment method.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/checkout_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/checkout_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/checkout_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: checkout_process.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('EMAIL_TEXT_SUBJECT', 'Order Process');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');
+define('EMAIL_TEXT_PRODUCTS', 'Products');
+define('EMAIL_TEXT_SUBTOTAL', 'Sub-Total:');
+define('EMAIL_TEXT_TAX', 'Tax:        ');
+define('EMAIL_TEXT_SHIPPING', 'Shipping: ');
+define('EMAIL_TEXT_TOTAL', 'Total:    ');
+define('EMAIL_TEXT_DELIVERY_ADDRESS', 'Delivery Address');
+define('EMAIL_TEXT_BILLING_ADDRESS', 'Billing Address');
+define('EMAIL_TEXT_PAYMENT_METHOD', 'Payment Method');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('TEXT_EMAIL_VIA', 'via');
+define('TEXT_SHIPWIRE_TRANSACTION_ID', 'Shipwire Fullfillment Transaction Successful. Transaction ID: ');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/checkout_shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/checkout_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/checkout_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: checkout_shipping.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Checkout');
+define('NAVBAR_TITLE_2', 'Shipping Method');
+
+define('HEADING_TITLE', 'Delivery Information');
+
+define('TABLE_HEADING_SHIPPING_ADDRESS', 'Shipping Address');
+define('TEXT_CHOOSE_SHIPPING_DESTINATION', 'Please choose from your address book where you would like the items to be delivered to.');
+define('TITLE_SHIPPING_ADDRESS', 'Shipping Address:');
+
+define('TABLE_HEADING_SHIPPING_METHOD', 'Shipping Method');
+define('TEXT_CHOOSE_SHIPPING_METHOD', 'Please select the preferred shipping method to use on this order.');
+define('TITLE_PLEASE_SELECT', 'Please Select');
+define('TEXT_ENTER_SHIPPING_INFORMATION', 'This is currently the only shipping method available to use on this order.');
+
+define('TABLE_HEADING_COMMENTS', 'Add Comments About Your Order');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continue Checkout Procedure');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'to select the preferred payment method.');
+define('ERROR_VALID_TO_CHECKOUT', 'Please update your order ...');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/checkout_shipping_address.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/checkout_shipping_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/checkout_shipping_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_shipping_address.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Checkout');
+define('NAVBAR_TITLE_2', 'Change Shipping Address');
+
+define('HEADING_TITLE', 'Delivery Information');
+
+define('TABLE_HEADING_SHIPPING_ADDRESS', 'Shipping Address');
+define('TEXT_SELECTED_SHIPPING_DESTINATION', 'This is the currently selected shipping address where the items in this order will be delivered to.');
+define('TITLE_SHIPPING_ADDRESS', 'Shipping Address:');
+
+define('TABLE_HEADING_ADDRESS_BOOK_ENTRIES', 'Address Book Entries');
+define('TEXT_SELECT_OTHER_SHIPPING_DESTINATION', 'Please select the preferred shipping address if the items in this order are to be delivered elsewhere.');
+define('TITLE_PLEASE_SELECT', 'Please Select');
+
+define('TABLE_HEADING_NEW_SHIPPING_ADDRESS', 'New Shipping Address');
+define('TEXT_CREATE_NEW_SHIPPING_ADDRESS', 'Please use the following form to create a new shipping address to use for this order.');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continue Checkout Procedure');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'to select the preferred shipping method.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/checkout_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/checkout_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/checkout_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: checkout_success.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Checkout');
+define('NAVBAR_TITLE_2', 'Success');
+
+define('HEADING_TITLE', 'Your Order Has Been Processed!');
+
+define('TEXT_SUCCESS', 'Your order has been successfully processed! Your products will arrive at their destination within 2-5 working days.');
+define('TEXT_NOTIFY_PRODUCTS', 'Please notify me of updates to the products I have selected below:');
+define('TEXT_SEE_ORDERS', 'You can view your order history by going to the <a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">\'My Account\'</a> page and by clicking on <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">\'History\'</a>.');
+define('TEXT_CONTACT_STORE_OWNER', 'Please direct any questions you have to the <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">store owner</a>.');
+define('TEXT_THANKS_FOR_SHOPPING', 'Thanks for shopping with us online!');
+
+define('TABLE_HEADING_COMMENTS', 'Enter a comment for the order processed');
+
+define('TABLE_HEADING_DOWNLOAD_DATE', 'Expiry date: ');
+define('TABLE_HEADING_DOWNLOAD_COUNT', ' downloads remaining');
+define('HEADING_DOWNLOAD', 'Download your products here:');
+define('FOOTER_DOWNLOAD', 'You can also download your products at a later time at \'%s\'');
+
+define('PAYPAL_NAVBAR_TITLE_2_OK', 'Success'); // PAYPALIPN
+define('PAYPAL_NAVBAR_TITLE_2_PENDING', 'Your Order is being processed.'); // PAYPALIPN
+define('PAYPAL_NAVBAR_TITLE_2_FAILED', 'Your payment has failed'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_OK', 'Your Order Has Been Processed!'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_PENDING', 'Your Order is being processed!'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_FAILED', 'Your payment has failed!'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_OK', 'Your order has been successfully processed! Your products will arrive at their destination within 2-5 working days.'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_PENDING', 'Your Order is being processed!'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_FAILED', 'Your payment has failed! Please verify your submitted information to pay with PayPal.'); // PAYPALIPN
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/contact_us.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/contact_us.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/contact_us.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/*
+  $Id: contact_us.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Contact Us');
+define('NAVBAR_TITLE', 'Contact Us');
+define('TEXT_SUCCESS', 'Your enquiry has been successfully sent to the Store Owner.');
+define('EMAIL_SUBJECT', 'Enquiry from ' . STORE_NAME);
+
+define('ENTRY_NAME', 'Full Name:');
+define('ENTRY_EMAIL', 'E-Mail Address:');
+define('ENTRY_ENQUIRY', 'Enquiry:');
+
+// Contact US Email Subject : DMG
+define('TEXT_EMAIL_SUBJECTS', '* select a subject *');
+define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME. ': ');
+define('ENTRY_SUBJECT','Subject:');
+
+// CRE Contact Us Enhancements 
+// VJ
+define('ENTRY_URGENT', 'Urgent:');
+define('ENTRY_SELF', 'Send myself a copy:');
+define('TEXT_SUBJECT_URGENT', 'Urgent');
+define('ENTRY_TOPIC','Email Topic:');
+define('ENTRY_TOPIC_1', 'Sales');
+define('ENTRY_TOPIC_2', 'Tracking');
+define('ENTRY_TOPIC_3', 'Technical');
+define('ENTRY_TOPIC_4', 'Sponsorship');
+define('ENTRY_TOPIC_5', 'Wholesale');
+
+define('TEXT_SUBJECT_PREFIX', 'Contact from ' . STORE_NAME . ': ');
+define('TEXT_BODY', '<DIV ><font class="text_14n">Corporate Headquarters:</font></A>
+
+
+
+<DIV ><font class="text_12wn"><b>Your Business Name <br>
+
+                              
+
+                                     Your Business Street Address<br>
+
+
+
+                                     Your Business City and Postal Code.<br>
+
+
+
+                                     Business Country</b></DIV><br>
+
+
+
+                                     Tel:  Telephone Number<br>
+
+
+
+                                     Fax:  Fax Number<br>
+
+
+
+                                     
+
+
+
+  <DIV ><br><font class="text_14n"><b>E-mail Contacts:</b></font></A>
+
+
+
+<DIV ><font class="text_12wn">Business Relations - <a href="mailto:info at yourstore.com" target="blank">info at yourstore.com</a><br>
+
+
+
+                                       Wholesale Inquiries - <a href="mailto:wholesale at yourstore.com" target="blank">wholesale at yourstore.com</a><br>
+
+
+
+                                       Technical Assistance - <a href="mailto:tech at yourstore.com" target="blank">tech at yourstore.com</a><br>
+
+
+
+                                     Product Inquiries - <a href="mailto:sales at yourstore.com" target="blank">sales at yourstore.com</a><br>
+
+
+
+                                     Order Status - <a href="mailto:tracking at yourstore.com" target="blank">tracking at yourstore.com</a><br>
+
+
+
+                                     <br>
+
+
+
+                                   
+
+
+
+<DIV ><font class="text_14n"><b>AOL IM Help:</b></font></A>
+
+
+
+<DIV ><font class="text_12wn">YourBusinessName -   <A href="aim:goim?screenname=YourAIM_ScreenName&message=Hi.+Are+you+there?">Click Here</a><br>
+
+: Edit this information in includes/languages/contact_us.php<br>
+
+
+
+');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/cookie_usage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/cookie_usage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/cookie_usage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: cookie_usage.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Cookie Usage');
+define('HEADING_TITLE', 'Cookie Usage');
+
+define('TEXT_INFORMATION', 'We have detected that your browser does not support cookies, or has set cookies to be disabled.<br><br>To continue shopping online, we encourage you to enable cookies on your browser.<br><br>For <b>Internet Explorer</b> browsers, please follow these instructions:<br><ol><li>Click on the Tools menubar, and select Internet Options</li><li>Select the Security tab, and reset the security level to Medium</li></ol>We have taken this measurement of security for your benefit, and apologize upfront if any inconveniences are caused.<br><br>Please contact the store owner if you have any questions relating to this requirement, or to continue purchasing products offline.');
+
+define('BOX_INFORMATION_HEADING', 'Cookies, Privacy and Security');
+define('BOX_INFORMATION', 'Cookies must be enabled to purchase online on this store to embrace privacy and security related issues regarding your visit to this site.<br><br>By enabling cookie support on your browser, the communication between you and this site is strengthened to be certain it is you who are making transactions on your own behalf, and to prevent leakage of your privacy information.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/create_account.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: create_account.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+// MAIL VALIDATION START //
+define('VALIDATE_YOUR_MAILADRESS', 'Click here to Validate/Activate Your account');
+define('SECOND_LINK', '<B>Or you can manually copy and paste in the following link into your browsers window:</B><BR> ');
+define('OR_VALIDATION_CODE', '<B>Your Validation Code is:</B> ');
+define('MAIL_VALIDATION', '<FONT COLOR="#FF0000"><B>You have to validate/activate your account before you can login.</B></FONT><P><B>Please click on the link below to finish the account creation process:</B> ');
+// MAIL VALIDATION END //
+
+define('NAVBAR_TITLE', 'Create an Account');
+
+define('HEADING_TITLE', 'My Account Information');
+
+define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><b>NOTE:</b></font></small> If you already have an account with us, please login at the <a href="%s"><u>login page</u></a>.');
+
+define('EMAIL_SUBJECT', 'Welcome to ' . STORE_NAME);
+define('EMAIL_GREET_MR', 'Dear Mr. %s,' . "\n\n");
+define('EMAIL_GREET_MS', 'Dear Ms. %s,' . "\n\n");
+define('EMAIL_GREET_NONE', 'Dear %s' . "\n\n");
+define('EMAIL_WELCOME', 'We welcome you to <b>' . STORE_NAME . '</b>.' . "\n\n");
+
+define('EMAIL_TEXT', 'You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n\n");
+define('ADMIN_EMAIL_WELCOME', 'Application to become a wholesale customer of <b>' . STORE_NAME . '</b>.' . "\n\n");
+define('ADMIN_EMAIL_TEXT', 'You have received an application to become a wholesale customer from your website.  Information regarding this application can be found at your online administration panel.' . "\n\n");
+
+define('EMAIL_CONFIRMATION', 'Thank you for submitting your account information to our ' . STORE_NAME . "\n\n" . 'To finish your account setup please verify your e-mail address by clicking the link below: ' . "\n\n");
+define('EMAIL_CONTACT', 'For help with any of our online services, please email the store-owner: ');
+define('EMAIL_CONTACT_TEXT', '<a href=\"mailto:' . STORE_OWNER_EMAIL_ADDRESSS . '\">' . STORE_OWNER_EMAIL_ADDRESS . '</a>' . "\n\n");
+define('EMAIL_WARNING', '<b>Note:</b> This Email address was given to us by one of our customers. If you did not signup to be a member, please send an email to ');
+define('EMAIL_WARNING_TEXT', '<a href=\"mailto:' . STORE_OWNER_EMAIL_ADDRESS . '\">' . STORE_OWNER_EMAIL_ADDRESS . '</a>' . "\n");
+
+/* ICW Credit class gift voucher begin */
+define('EMAIL_GV_INCENTIVE_HEADER', "\n\n" .'As part of our welcome to new customers, we have sent you a Gift Voucher worth %s');
+define('EMAIL_GV_REDEEM', 'The redeem code for your Gift Voucher is %s. You can enter the redeem code when checking out while making a purchase');
+define('EMAIL_GV_LINK', 'or by following this link ');
+define('EMAIL_COUPON_INCENTIVE_HEADER', 'Congratulations! to make your first visit to our online shop a more rewarding experience, we are sending you an e-Discount Coupon.' . "\n" .
+                                        ' Below are details of the Discount Coupon created just for you' . "\n");
+define('EMAIL_COUPON_REDEEM', 'To use the coupon enter the redeem code which is %s during checkout while making a purchase');
+/* ICW Credit class gift voucher end */
+define('HEADING_TITLE_CHECKOUT','Checkout Personal Info');// Added by sheetal for PWA form Title
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Create an Account');
+define('NAVBAR_TITLE_2', 'Success');
+define('HEADING_TITLE', 'Your Account Has Been Created!');
+
+define('TEXT_ACCOUNT_CREATED', 'Congratulations, Your new account has been successfully created, You can now take advantage of member privileges to enhance your online shopping experience with us. If you have <small><b>ANY</b></small> questions about the operation of this online shop, please email the <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">store owner</a>.<P>
+A confirmation email with a validation/activation code has been sent to the email address that you provided us with.<P>
+You Must <b>Validate/Activate</b> Your Account Before You Can Login, Please Follow The Instructions In The Email That We Have Sent You.<P>
+If you have not received this email within five minutes, one of two things has happened:<P>
+1. Your Confirmation email was mistakenly sent to your "BULK MAIL" or "SPAM MAIL" folder by your Internet Service Provider, please check for it there.
+<P> OR <P>2. You entered your email address in wrong, please double check it or re-sign up again for an account.
+<P> If after you have checked those things, you still have not received a confirmation email please <U><a href="' . tep_href_link(FILENAME_CONTACT_US) . '">contact us</a></U> for assistence.');
+
+define('TEXT_ACCOUNT_CREATED1', 'Congratulations, Your new account has been successfully created, You can now take advantage of member privileges to enhance your online shopping experience with us. If you have <small><b>ANY</b></small> questions about the operation of this online shop, please email the <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">store owner</a> ' );
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/cvs_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/cvs_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/cvs_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+// this file was created by Clifton Murphy <blue_glowstick at yahoo.com>
+// using code supplied in a previous release by Thomas Nordstrom <t_nordstrom at yahoo.com>
+// I take no credit for any of this work. I simply created this file and
+// recompiled the distribution zip file with the fixes to prevent parse errors.
+// see the main language file for translations (IE: english.php
+/*
+  $Id: cvs_help.php,v 1.3 2004/02/4 07:28:00 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo CVV_HELP_TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 5px; margin-left: 5px; margin-right: 5px; margin-top: 5px; }
+table.ccv/cvc/ccv2/cidhelp { background: #ffffff; border: 1px solid red;}
+//--></style>
+<body marginwidth="5" marginheight="5" topmargin="5" bottommargin="5" leftmargin="5" rightmargin="5">
+<table class="ccv/cvc/ccv2/cidhelp" width="100%" border="0" cellspacing="5" cellpadding="0">
+  <tr>
+    <td colspan="2">
+    <?php echo CVV_HELP_DESC1;?>
+      </td>
+  </tr>
+  <tr>
+    <td>
+    <?php echo CVV_HELP_DESC2;?>
+    
+    </td>
+    <td><img src="images/cvm_help1.jpg" width="200" height="139"></td>
+  </tr>
+  <tr>
+    <td>&nbsp;</td>
+    <td>&nbsp;</td>
+  </tr>
+  <tr>
+    <td>
+    <?php echo CVV_HELP_DESC3;?>
+    </td>
+    <td><img src="images/cvm_help2.jpg" width="200" height="139"></td>
+  </tr>
+</table>
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/includes/languages/english/down_for_maintenance.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/down_for_maintenance.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/down_for_maintenance.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  Created by: Linda McGrath osCOMMERCE at WebMakers.com
+  
+  Update by: fram 05-05-2003
+  Updated by: Donald Harriman - 08-08-2003 - MS2
+
+  down_for_maintenance.php v1.1
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Down for Maintenance');
+define('HEADING_TITLE', 'Down for Maintenance ...');
+define('DOWN_FOR_MAINTENANCE_TEXT_INFORMATION', 'The site is currently down for maintenance. Please excuse the dust, and try back later.');
+define('TEXT_MAINTENANCE_ON_AT_TIME', 'The Admin / Webmaster has enabled maintenance at : ');
+define('TEXT_MAINTENANCE_PERIOD', 'Maintenance period : ');
+define('DOWN_FOR_MAINTENANCE_STATUS_TEXT', 'To verify the site status ... Click here:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/download.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/download.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/download.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,12 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/downloadbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/downloadbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/downloadbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ define('TEXT_HEADING_DOWNLOAD_DATE', 'Date Download');
+ define('TEXT_HEADING_DOWNLOAD_COUNT', 'Number of times downloaded');
+ define('TEXT_DOWNLOAD_MY_ACCOUNT', 'My Account');
+ define('TEXT_HEADING_DOWNLOAD_FILE', 'Your download is ready. Please click the title below');
+ define('TEXT_FOOTER_DOWNLOAD', 'If your download does not appear above, you can check you order at this link:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/events_calendar.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/events_calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/events_calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: events_calendar v1.00 2003/03/08 18:09:16 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+
+  define('NAVBAR_TITLE', 'Events Calendar');
+  define('HEADING_TITLE', 'Events Calendar');
+  define('TEXT_SELECT_EVENT', 'Select event');
+  
+  define('TEXT_EVENTS_FOR', 'Events for ');
+  define('TEXT_EVENT_DATE', 'Date :');
+  define('TEXT_EVENTS_START', 'Events starting on ');
+  define('TEXT_EVENT_START_DATE', 'From :');
+  define('TEXT_EVENT_END_DATE', 'Through :');
+  define('TEXT_EVENT_LINK', 'Link :');
+  define('TEXT_EVENT_OSC_LINK', 'Event link :');
+  define('TEXT_EVENT_TITLE', 'Title :');
+  define('TEXT_EVENT_DESCRIPTION', 'Event :');
+  define('TEXT_EVENT_MORE', '... More >>');
+  define('TEXT_NO_EVENTS', 'No Events found.');
+  define('TEXT_OTHER_EVENTS', 'Other events for today :');
+
+  define('TEXT_DISPLAY_NUMBER_OF_EVENTS', 'Displaying event n° <b>%d</b><b>%_</b> of <b>%d</b> for ');
+  define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> events) ');
+  define('MAX_DISPLAY_PAGE_LINKS', 5);
+  define('MAX_DISPLAY_NUMBER_EVENTS', 5);
+  
+  define('BOX_CALENDAR_TITLE', ' View all events');
+  define('BOX_GO_BUTTON', 'go');
+  define('BOX_GO_BUTTON_TITLE', ' submit - month view ');
+  define('BOX_TODAY_BUTTON', ' T ');
+  define('BOX_TODAY_BUTTON_TITLE', ' view this month ');
+  define('BOX_YEAR_VIEW_BUTTON', ' Y ');
+  define('BOX_YEAR_VIEW_BUTTON_TITLE', ' year view ');
+  define('BOX_NEXT_LINK', 'next_month');
+  define('BOX_PREV_LINK', 'previous_month');
+  define('BOX_CLICK_LINK', 'Click for events');
+  
+  define('FIRST_DAY_OF_WEEK', 0);// First day of the week  1=Monday 0=Sunday;
+
+  define('NUMBER_OF_YEARS', 5);  //n° of years to be shown in drop-down
+  
+  define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
+  
+
+  
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+define('NAVBAR_TITLE', 'FAQ');
+
+define('HEADING_TITLE', 'Frequently Asked Questions');
+define('FAQ_BACK_TO_TOP', '[Back To Top]');
+
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/faq_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/faq_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/faq_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+define('NAVBAR_TITLE', 'FAQ');
+
+define('TABLE_HEADING_NEW_FAQ', 'Frequently Asked Questions');
+define('FAQ_BACK_TO_TOP', '[Back To Top]');
+
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/featured_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/featured_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/featured_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Featured Products Listing Language File
+*/
+
+define('NAVBAR_TITLE', 'Featured Products');
+define('HEADING_TITLE', 'Featured Products');
+
+define('TEXT_NO_FEATURED_PRODUCTS', 'There are no featured products.');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_MANUFACTURER', 'Manufacturer:');
+define('TEXT_PRICE', 'Price:');
+
+  define('TABLE_HEADING_IMAGE', 'Product Image');
+  define('TABLE_HEADING_MODEL', 'Model');
+  define('TABLE_HEADING_PRODUCTS', 'Product Name');
+  define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+  define('TABLE_HEADING_QUANTITY', 'Quantity');
+  define('TABLE_HEADING_PRICE', 'Price');
+  define('TABLE_HEADING_WEIGHT', 'Weight');
+  define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+  define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+  define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+  define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+  define('TEXT_SHOW', '<b>Show:</b>');
+  define('TEXT_BUY', 'Buy 1 \'');
+  define('TEXT_NOW', '\' now');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/gv_faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/gv_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/gv_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,87 @@
+<?php
+/*
+  $Id: gv_faq.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Gift Voucher FAQ');
+define('HEADING_TITLE', 'Gift Voucher FAQ');
+
+define('TEXT_INFORMATION', '<a name="Top"></a>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=1','NONSSL').'">Purchasing Gift Vouchers</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=2','NONSSL').'">How to send Gift vouchers</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=3','NONSSL').'">Buying with Gift Vouchers</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=4','NONSSL').'">Redeeming Gift Vouchers</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=5','NONSSL').'">When problems occur</a><br>
+');
+switch ($HTTP_GET_VARS['faq_item']) {
+  case '1':
+define('SUB_HEADING_TITLE','Purchasing Gift Vouchers.');
+define('SUB_HEADING_TEXT','Gift Vouchers are purchased just like any other item in our store.  You can 
+  pay for them using the stores standard payment method(s).
+  Once purchased the value of the Gift Voucher will be added to your own personal 
+  Gift Voucher Account.  If you have funds in your Gift Voucher Account, you will 
+  notice that the amount now shows in the Shopping Cart box, and also provides a 
+  link to a page where you can send the Gift Voucher to some one via email.');
+  break;
+  case '2':
+define('SUB_HEADING_TITLE','How to Send Gift Vouchers.');
+define('SUB_HEADING_TEXT','To send a Gift Voucher you need to go to our Send Gift Voucher Page. You can 
+  find the link to this page in the Shopping Cart Box in the right hand column of 
+  each page.
+  When you send a Gift Voucher, you need to specify the following.
+  The name of the person you are sending the Gift Voucher to.
+  The email address of the person you are sending the Gift Voucher to.
+  The amount you want to send. (Note you don\'t have to send the full amount that 
+  is in your Gift Voucher Account.)
+  A short message which will appear in the email.
+  Please ensure that you have entered all of the information correctly, although 
+  you will be given the opportunity to change this as much as you want before 
+  the email is actually sent.');  
+  break;
+  case '3':
+  define('SUB_HEADING_TITLE','Buying with Gift Vouchers.');
+  define('SUB_HEADING_TEXT','If you have funds in your Gift Voucher Account, you can use those funds to 
+  purchase other items in our store.  At the checkout stage, an extra box will 
+  appear.  Ticking this box will apply those funds in your Gift Voucher Account. 
+  Please note, you will still have to select another payment method if there 
+  is not enough in your Gift Voucher Account to cover the cost of your purchase. 
+  If you have more funds in your Gift Voucher Account than the total cost of 
+  your purchase the balance will be left in your Gift Voucher Account for 
+  future purchases.');
+  break;
+  case '4':
+  define('SUB_HEADING_TITLE','Redeeming Gift Vouchers.');
+  define('SUB_HEADING_TEXT','If you receive a Gift Voucher by email it will contain details of who sent 
+  you the Gift Voucher, along with possibly a short message from them.  The Email 
+  will also contain the Gift Voucher Number.  It is probably a good idea to print 
+  out this email for future reference.  You can now redeem the Gift Voucher in 
+  two ways.<br>
+  1. By clicking on the link contained within the email for this express purpose. 
+  This will take you to the store\'s Redeem Voucher page.  You will then be requested 
+  to create an account, before the Gift Voucher is validated and placed in your 
+  Gift Voucher Account ready for you to spend it on whatever you want.<br>
+  2. During the checkout process, on the same page that you select a payment method 
+there will be a box to enter a Redeem Code.  Enter the code here, and click the redeem button.  The code will be
+validated and added to your Gift Voucher account.  You can then use the amount to purchase any item from our store');
+  break;
+  case '5':
+  define('SUB_HEADING_TITLE','When problems occur.');
+  define('SUB_HEADING_TEXT','For any queries regarding the Gift Voucher System, please contact the store 
+  by email at '. STORE_OWNER_EMAIL_ADDRESS . '. Please make sure you give 
+  as much information as possible in the email. ');
+  break;
+  default:
+  define('SUB_HEADING_TITLE','');
+  define('SUB_HEADING_TEXT','Please choose from one of the questions above.');
+
+  }
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/gv_redeem.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/gv_redeem.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/gv_redeem.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: gv_redeem.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Redeem Gift Voucher');
+define('HEADING_TITLE', 'Redeem Gift Voucher');
+define('TEXT_INFORMATION', 'For more information regarding Gift Vouchers, please see our <a href="' . tep_href_link(FILENAME_GV_FAQ,'','NONSSL').'">'.GV_FAQ.'.</a>');
+define('TEXT_INVALID_GV', 'The Gift Voucher number may be invalid or has already been redeemed. To contact the shop owner please use the Contact Page');
+define('TEXT_VALID_GV', 'Congratulations, you have redeemed a Gift Voucher worth %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/gv_send.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/gv_send.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/gv_send.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: gv_send.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Send Gift Voucher');
+define('NAVBAR_TITLE', 'Send Gift Voucher');
+define('EMAIL_SUBJECT', 'Enquiry from ' . STORE_NAME);
+define('HEADING_TEXT','<br>Please enter below the details of the Gift Voucher you wish to send. For more information, please see our <a href="' . tep_href_link(FILENAME_GV_FAQ,'','NONSSL').'">'.GV_FAQ.'.</a><br>');
+define('ENTRY_NAME', 'Recipients Name:');
+define('ENTRY_EMAIL', 'Recipients E-Mail Address:');
+define('ENTRY_MESSAGE', 'Message to Recipients:');
+define('ENTRY_AMOUNT', 'Amount of Gift Voucher:');
+define('ERROR_ENTRY_AMOUNT_CHECK', '&nbsp;&nbsp;<span class="errorText">Invalid Amount</span>');
+define('ERROR_ENTRY_EMAIL_ADDRESS_CHECK', '&nbsp;&nbsp;<span class="errorText">Invalid Email Address</span>');
+define('MAIN_MESSAGE', 'You have decided to post a gift voucher worth %s to %s who\'s email address is %s<br><br>The text accompanying the email will read<br><br>Dear %s<br><br>
+                        You have been sent a Gift Voucher worth %s by %s');
+
+define('PERSONAL_MESSAGE', '%s says');
+define('TEXT_SUCCESS', 'Congratulations, your Gift Voucher has successfully been sent');
+
+
+define('EMAIL_SEPARATOR', '----------------------------------------------------------------------------------------');
+define('EMAIL_GV_TEXT_HEADER', 'Congratulations, You have received a gift voucher worth %s');
+define('EMAIL_GV_TEXT_SUBJECT', 'A gift from %s');
+define('EMAIL_GV_FROM', 'This Gift Voucher has been sent to you by %s');
+define('EMAIL_GV_MESSAGE', 'With a message saying ');
+define('EMAIL_GV_SEND_TO', 'Hi, %s');
+define('EMAIL_GV_REDEEM', 'To redeem this Gift Voucher, please click on the link below. Please also write down the redemption code which is %s. (In case you have problems)');
+define('EMAIL_GV_LINK', 'To redeem please click ');
+define('EMAIL_GV_VISIT', ' or visit ');
+define('EMAIL_GV_ENTER', ' and enter the code ');
+define('EMAIL_GV_FIXED_FOOTER', 'If you encounter problems redeeming the Gift Voucher using the automated link above, ' . "\n" .
+                                'you can also enter the Gift Voucher code during the checkout process at our store.' . "\n\n");
+define('EMAIL_GV_SHOP_FOOTER', '');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/header_tags.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/header_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/header_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+// /catalog/includes/languages/english/header_tags.php
+// WebMakers.com Added: Header Tags Generator v2.5.2
+// Add META TAGS and Modify TITLE
+//
+// DEFINITIONS FOR /includes/languages/english/header_tags.php
+
+// Define your email address to appear on all pages
+define('HEAD_REPLY_TAG_ALL', STORE_OWNER_EMAIL_ADDRESS);
+
+// For all pages not defined or left blank, and for products not defined
+// These are included unless you set the toggle switch in each section below to OFF ( '0' )
+// The HEAD_TITLE_TAG_ALL is included AFTER the specific one for the page
+// The HEAD_DESC_TAG_ALL is included AFTER the specific one for the page
+// The HEAD_KEY_TAG_ALL is included AFTER the specific one for the page
+define('HEAD_TITLE_TAG_ALL', STORE_NAME);
+define('HEAD_DESC_TAG_ALL','What\'s New Here? - Hardware Software DVD Movies');
+define('HEAD_KEY_TAG_ALL','Hardware, Software, DVD Movies, Computer');
+
+// DEFINE TAGS FOR INDIVIDUAL PAGES
+
+// index.php
+define('HTTA_DEFAULT_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title
+define('HTKA_DEFAULT_ON','1'); // Include HEAD_KEY_TAG_ALL in Keywords
+define('HTDA_DEFAULT_ON','1'); // Include HEAD_DESC_TAG_ALL in Description
+define('HTTA_CAT_DEFAULT_ON', '0'); //Include HEADE_TITLE_DEFAULT in CATEGORY DISPLAY
+define('HEAD_TITLE_TAG_DEFAULT', 'CRE Loaded 6');
+define('HEAD_DESC_TAG_DEFAULT','osCommerce : What\'s New Here? - Hardware Software DVD Movies');
+define('HEAD_KEY_TAG_DEFAULT','Hardware, Software, DVD Movies, Computer');
+
+// product_info.php - if left blank in products_description table these values will be used
+define('HTTA_PRODUCT_INFO_ON','1');
+define('HTKA_PRODUCT_INFO_ON','1');
+define('HTDA_PRODUCT_INFO_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_INFO','');
+define('HEAD_DESC_TAG_PRODUCT_INFO','');
+define('HEAD_KEY_TAG_PRODUCT_INFO','');
+
+// products_new.php - whats_new
+define('HTTA_WHATS_NEW_ON','1');
+define('HTKA_WHATS_NEW_ON','1');
+define('HTDA_WHATS_NEW_ON','1');
+define('HEAD_TITLE_TAG_WHATS_NEW', 'New Products');
+define('HEAD_DESC_TAG_WHATS_NEW', '');
+define('HEAD_KEY_TAG_WHATS_NEW', '');
+
+// specials.php
+// If HEAD_KEY_TAG_SPECIALS is left blank, it will build the keywords from the products_names of all products on special
+define('HTTA_SPECIALS_ON','1');
+define('HTKA_SPECIALS_ON','1');
+define('HTDA_SPECIALS_ON','1');
+define('HEAD_TITLE_TAG_SPECIALS','Specials');
+define('HEAD_DESC_TAG_SPECIALS','');
+define('HEAD_KEY_TAG_SPECIALS','');
+
+// product_reviews_info.php and product_reviews.php - if left blank in products_description table these values will be used
+define('HTTA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HTKA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HTDA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_REVIEWS_INFO','');
+define('HEAD_DESC_TAG_PRODUCT_REVIEWS_INFO','');
+define('HEAD_KEY_TAG_PRODUCT_REVIEWS_INFO','');
+
+// PRODUCTS_REVIEWS_WRITE.PHP
+define('HTTA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HTKA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HTDA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_REVIEWS_WRITE','');
+define('HEAD_DESC_TAG_PRODUCT_REVIEWS_WRITE','');
+define('HEAD_KEY_TAG_PRODUCT_REVIEWS_WRITE','');
+
+ // ALLPRODS.PHP
+define('HTTA_ALLPRODS_ON','1');
+define('HTKA_ALLPRODS_ON','1');
+define('HTDA_ALLPRODS_ON','1');
+define('HEAD_TITLE_TAG_ALLPRODS','');
+define('HEAD_DESC_TAG_ALLPRODS','');
+define('HEAD_KEY_TAG_ALLPRODS','');
+
+// articles.php
+define('HTTA_ARTICLES_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title
+define('HTKA_ARTICLES_ON','0'); // Include HEAD_KEY_TAG_ALL in Keywords
+define('HTDA_ARTICLES_ON','0'); // Include HEAD_DESC_TAG_ALL in Description
+define('HEAD_TITLE_TAG_ARTICLES','CRE Loaded Store Articles');
+define('HEAD_DESC_TAG_ARTICLES','Articles');
+define('HEAD_KEY_TAG_ARTICLES','articles');
+
+// article_info.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_INFO_ON','1');
+define('HTKA_ARTICLE_INFO_ON','1');
+define('HTDA_ARTICLE_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_INFO','Articles');
+define('HEAD_DESC_TAG_ARTICLE_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_INFO','');
+
+// articles_new.php - new articles
+// If HEAD_KEY_TAG_ARTICLES_NEW is left blank, it will build the keywords from the articles_names of all new articles
+define('HTTA_ARTICLES_NEW_ON','1');
+define('HTKA_ARTICLES_NEW_ON','1');
+define('HTDA_ARTICLES_NEW_ON','1');
+define('HEAD_TITLE_TAG_ARTICLES_NEW','Lastest Articles');
+define('HEAD_DESC_TAG_ARTICLES_NEW','');
+define('HEAD_KEY_TAG_ARTICLES_NEW','');
+
+// article_reviews_info.php and article_reviews.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTKA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTDA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_DESC_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_REVIEWS_INFO','');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/images/icon.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/languages/english/images/icon.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/languages/english/images/icon.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/languages/english/images/icon.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/languages/english/index.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: index.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_MAIN', 'This is a default setup of the osCommerce project, products shown are for demonstrational purposes, <b>any products purchased will not be delivered nor will the customer be billed</b>. Any information seen on these products is to be treated as fictional.<br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>Error Messages</b><br><br>If there are any error or warning messages shown above, please correct them first before proceeding.<br><br>Error messages are displayed at the very top of the page with a complete <span class="messageStackError">background</span> color.<br><br>Several checks are performed to ensure a healthy setup of your online store - these checks can be disabled by editing the appropriate parameters at the bottom of the includes/application_top.php file.</td></tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main" valign="top"><b>Editing Page Texts</b><br><br>The text shown here can be modified in the following file, on each language basis:<br><br><nobr class="messageStackSuccess">[path to catalog]/includes/languages/' . $language . '/' . FILENAME_DEFAULT . '</nobr><br><br>That file can be edited manually, or via the Administration Tool with the <nobr class="messageStackSuccess">Languages->' . ucfirst($language) . '->Define</nobr> or <nobr class="messageStackSuccess">Tools->File Manager</nobr> modules.<br><br>The text is set in the following manner:<br><br><nobr>define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">This is a default setup of the osCommerce project...</span>\');</nobr><br><br>The text highlighted in green may be modified - it is important to keep the define() of the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the following example is used where only two single quote characters exist:<br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>More information concerning the PHP define() function can be read <a href="http://www.php.net/define" target="_blank"><u>here</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>Securing The Administration Tool</b><br><br>It is important to secure the Administration Tool as there is currently no security implementation available.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/4.gif') . '</td><td class="main" valign="top"><b>Online Documentation</b><br><br>Online documentation can be read at the <a href="http://wiki.oscommerce.com" target="_blank"><u>osCommerce Wiki Documentation Effort</u></a> site.<br><br>Community support is available at the <a href="http://forums.oscommerce.com" target="_blank"><u>osCommerce Community Support Forums</u></a> site.</td></tr></table><br>If you wish to download the solution powering this shop, or if you wish to contribute to the osCommerce project, please visit the <a href="http://www.oscommerce.com" target="_blank"><u>support site of osCommerce</u></a>. This shop is running on osCommerce version <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font>.');
+define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
+define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
+define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
+define('TABLE_HEADING_DEFAULT_SPECIALS', 'Specials For %s');
+
+if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
+  define('HEADING_TITLE', 'Let\'s See What We Have Here');
+
+  define('TABLE_HEADING_IMAGE', '');
+  define('TABLE_HEADING_MODEL', 'Model');
+  define('TABLE_HEADING_PRODUCTS', 'Product Name');
+  define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+  define('TABLE_HEADING_QUANTITY', 'Quantity');
+  define('TABLE_HEADING_PRICE', 'Price');
+  define('TABLE_HEADING_WEIGHT', 'Weight');
+  define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+  define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+  define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+  define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+  define('TEXT_SHOW', '<b>Show:</b>');
+  define('TEXT_BUY', 'Buy 1 \'');
+  define('TEXT_NOW', '\' now');
+  define('TEXT_ALL_CATEGORIES', 'All Categories');
+  define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');
+} elseif ($category_depth == 'top') {
+  define('HEADING_TITLE', 'What\'s New Here?');
+} elseif ($category_depth == 'nested') {
+  define('HEADING_TITLE', 'Categories');
+}
+  define('HEADING_CUSTOMER_GREETING', 'Our Customer Greeting');
+  define('MAINPAGE_HEADING_TITLE', 'Main Page Heading Title');
+// BOF: Lango added for Featured Products
+  define('TABLE_HEADING_FEATURED_PRODUCTS', 'Featured Products');
+  define('TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY', 'Featured Products in %s'); 
+// EOF: Lango added for Featured Products
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/info_shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/info_shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/info_shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: info_shopping_cart.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Visitors Cart / Members Cart');
+define('SUB_HEADING_TITLE_1', 'Visitors Cart');
+define('SUB_HEADING_TITLE_2', 'Members Cart');
+define('SUB_HEADING_TITLE_3', 'Info');
+define('SUB_HEADING_TEXT_1', 'Every visitor to our online shop will be given a \'Visitors Cart\'. This allows the visitor to store their products in a temporary shopping cart. Once the visitor leaves the online shop, so will the contents of their shopping cart.');
+define('SUB_HEADING_TEXT_2', 'Every member to our online shop that logs in is given a \'Members Cart\'. This allows the member to add products to their shopping cart, and come back at a later date to finalize their checkout. All products remain in their shopping cart until the member has  checked them out, or removed the products themselves.');
+define('SUB_HEADING_TEXT_3', 'If a member adds products to their \'Visitors Cart\' and decides to log in to the online shop to use their \'Members Cart\', the contents of their \'Visitors Cart\' will merge with their \'Members Cart\' contents automatically.');
+define('TEXT_CLOSE_WINDOW', '[ close window ]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/information.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+  define('HEADING_TITLE', 'Information');
+  define('ACTION_INFORMATION', 'Action');
+  define('ACTIVATION_ID_INFORMATION', 'Activation the information ID=');
+  define('ADD_INFORMATION', 'Add new information');
+  define('ADD_QUEUE_INFORMATION', ' Add information to queue');
+  define('ALERT_INFORMATION', 'Empty information system');
+  define('ANSWER_INFORMATION', 'Answer');
+  define('CONFIRM_INFORMATION', 'Confirm');
+  define('DEACTIVATION_ID_INFORMATION', 'Deactivation the information ID=');
+  define('DELETE_CONFITMATION_ID_INFORMATION', 'Delete Confirmation information ID=');
+  define('DELETE_ID_INFORMATION', 'Delete the information ID=');
+  define('DELETED_ID_INFORMATION', 'Deleted the information ID=');
+  define('EDIT_ID_INFORMATION', 'Edit the information ID=');
+  define('ERROR_20_INFORMATION', 'You have not defined a valid value for option <b>Queue</b>. You can only define a numeric value');
+  define('ERROR_80_INFORMATION', 'You did not fill all <b>necessary fields</b>');
+  define('INFORMATION_ID_ACTIVE', 'this information is Active');
+  define('INFORMATION_ID_DEACTIVE', 'this information is NOT active');
+  define('ID_INFORMATION', 'ID');
+  define('TITLE_INFORMATION', 'Title');
+  define('DESCRIPTION_INFORMATION', 'Description');
+  define('QUEUE_INFORMATION', 'Queue');
+  define('QUEUE_INFORMATION_LIST', 'QueueList: ');
+  define('MANAGER_INFORMATION', 'Information Manager');
+  define('NO_INFORMATION', 'No');
+  define('PUBLIC_INFORMATION', 'Public');
+  define('SORT_BY', 'In information Page this Sort by');
+  define('SUCCED_INFORMATION', ' Succeed');
+  define('TITLE', 'Information system');
+  define('VIEW_INFORMATION', 'Information View');
+  define('VISIBLE_INFORMATION', 'Visible');
+  define('VISIBLE_INFORMATION_DO', '( To Do visible )');
+  define('UPDATE_ID_INFORMATION', 'Updated information ID=');
+  define('WARNING_INFORMATION', 'Warning');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/informationbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/informationbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/informationbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ // information box text in includes/boxes/information.php
+define('BOX_HEADING_INFORMATION', 'Information');
+define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
+define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
+define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');
+define('BOX_INFORMATION_CONTACT', 'Contact Us');
+define('BOX_INFORMATION_LINKS', 'Links');
+define('BOX_INFORMATION_TRACKING', 'Information');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/ipn.lng.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/ipn.lng.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/ipn.lng.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: ipn.lng.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('UNKNOWN_TXN_TYPE', 'Unknown Transaction Type');
+  define('UNKNOWN_TXN_TYPE_MSG', 'An unknown transaction (%s) occurred from ' . $_SERVER['REMOTE_ADDR'] . "\nAre you running any tests?\n\n");
+  define('UNKNOWN_POST', 'Unknown Post');
+  define('UNKNOWN_POST_MSG', "An unknown POST from %s was received.\nAre you running any tests?\n\n");
+  define('EMAIL_SEPARATOR', "------------------------------------------------------");
+  define('RESPONSE_VERIFIED', 'Verified');
+  define('RESPONSE_MSG', "Connection Type\n".EMAIL_SEPARATOR."\ncurl= %s, socket= %s, domain= %s, port= %s \n\nPayPal Response\n".EMAIL_SEPARATOR."\n%s \n\n");
+  define('RESPONSE_INVALID', 'Invalid PayPal Response');
+  define('RESPONSE_UNKNOWN', 'Unknown Verfication');
+  define('EMAIL_RECEIVER', 'Email and Business ID config');
+  define('EMAIL_RECEIVER_MSG', "Store Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n".EMAIL_SEPARATOR."\nPayPal Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n\n");
+  define('EMAIL_RECEIVER_ERROR_MSG', "Store Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n".EMAIL_SEPARATOR."\nPayPal Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n\nPayPal Transaction ID: %s\n\n");
+  define('TXN_DUPLICATE', 'Duplicate Transaction');
+  define('TXN_DUPLICATE_MSG', "A duplicate IPN transaction (%s) has been received.\nPlease check your PayPal Account\n\n");
+  define('IPN_TXN_INSERT', "IPN INSERTED");
+  define('IPN_TXN_INSERT_MSG', "IPN %s has been inserted\n\n");
+  define('CHECK_CURRENCY', 'Validate Currency');
+  define('CHECK_CURRENCY_MSG', "Incorrect Currency\nPayPal: %s\nosC: %s\n\n");
+  define('CHECK_TXN_SIGNATURE', 'Validate PayPal_Shopping_Cart Transaction Signature');
+  define('CHECK_TXN_SIGNATURE_MSG', "Incorrect Signature\nPayPal: %s\nosC: %s\n\n");
+  define('CHECK_TOTAL', 'Validate Total Transaction Amount');
+  define('CHECK_TOTAL_MSG', "Incorrect Total\nPayPal: %s\nSession: %s\n\n");
+  define('DEBUG', 'Debug');
+  define('DEBUG_MSG', "\nOriginal Post\n".EMAIL_SEPARATOR."\n%s\n\n\nReconstructed Post\n".EMAIL_SEPARATOR."\n%s\n\n");
+  define('PAYMENT_SEND_MONEY_DESCRIPTION', 'Money Received');
+  define('PAYMENT_SEND_MONEY_DESCRIPTION_MSG', "You have received a payment of %s %s \n".EMAIL_SEPARATOR."\nThis payment was sent by someone from the PayPal website, using the Send Money tab\n\n");
+  define('TEST_INCOMPLETE', 'Invalid Test');
+  define('TEST_INCOMPLETE_MSG', "An error has occured, mostly likely because the Custom field in the IPN Test Panel did not have a valid transaction id.\n\n\n");
+  define('HTTP_ERROR', 'HTTP Error');
+  define('HTTP_ERROR_MSG', "An HTTP Error occured during authentication\n".EMAIL_SEPARATOR."\ncurl= %s, socket= %s, domain= %s, port= %s\n\n");
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/links.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: links.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Links');
+
+if ($display_mode == 'links') {
+  define('HEADING_TITLE', 'Links');
+  define('TABLE_HEADING_LINKS_IMAGE', '');
+  define('TABLE_HEADING_LINKS_TITLE', 'Title');
+  define('TABLE_HEADING_LINKS_URL', 'URL');
+  define('TABLE_HEADING_LINKS_DESCRIPTION', 'Description');
+  define('TABLE_HEADING_LINKS_COUNT', 'Clicks');
+  define('TEXT_NO_LINKS', 'There are no links to list in this category.');
+} elseif ($display_mode == 'categories') {
+  define('HEADING_TITLE', 'Link Categories');
+  define('TEXT_NO_CATEGORIES', 'There are no link categories to list yet.');
+}
+
+// VJ todo - move to common language file
+define('TEXT_DISPLAY_NUMBER_OF_LINKS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> links)');
+
+define('IMAGE_BUTTON_SUBMIT_LINK', 'Submit Link');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/links_submit.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/links_submit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/links_submit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: links_submit.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Links');
+define('NAVBAR_TITLE_2', 'Submit A Link');
+
+define('HEADING_TITLE', 'Link Information');
+
+define('TEXT_MAIN', 'Please fill out the following form to submit your website.');
+
+define('EMAIL_SUBJECT', 'Welcome to ' . STORE_NAME . ' link exchange.');
+define('EMAIL_GREET_NONE', 'Dear %s' . "\n\n");
+define('EMAIL_WELCOME', 'We welcome you to the <b>' . STORE_NAME . '</b> link exchange program.' . "\n\n");
+define('EMAIL_TEXT', 'Your link has been successfully submitted at ' . STORE_NAME . '. It will be added to our listing as soon as we approve it. You will receive an email about the status of your submittal. If you have not received it within the next 48 hours, please contact us before submitting your link again.' . "\n\n");
+define('EMAIL_CONTACT', 'For help with our link exchange program, please email the store-owner: ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n\n");
+define('EMAIL_WARNING', '<b>Note:</b> This email address was given to us during a link submittal. If you have a problem, please send an email to ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n");
+define('EMAIL_OWNER_SUBJECT', 'Link submittal at ' . STORE_NAME);
+define('EMAIL_OWNER_TEXT', 'A new link was submitted at ' . STORE_NAME . '. It is not yet approved. Please verify this link and activate.' . "\n\n");
+
+define('TEXT_LINKS_HELP_LINK', '&nbsp;Help&nbsp;[?]');
+
+define('HEADING_LINKS_HELP', 'Links Help');
+define('TEXT_LINKS_HELP', '<b>Site Title:</b> A descriptive title for your website.<br><br><b>URL:</b> The absolute web address of your website, including the \'http://\'.<br><br><b>Category:</b> Most appropriate category under which your website falls.<br><br><b>Description:</b> A brief description of your website.<br><br><b>Image URL:</b> The absolute URL of the image you wish to submit, including the \'http://\'. This image will be displayed along with your website link.<br>Eg: http://your-domain.com/path/to/your/image.gif <br><br><b>Full Name:</b> Your full name.<br><br><b>Email:</b> Your email address. Please enter a valid email, as you will be notified via email.<br><br><b>Reciprocal Page:</b> The absolute URL of your links page, where a link to our website will be listed/displayed.<br>Eg: http://your-domain.com/path/to/your/links_page.php');
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+// VJ todo - move to common language file
+define('CATEGORY_WEBSITE', 'Website Details');
+define('CATEGORY_RECIPROCAL', 'Reciprocal Page Details');
+
+define('ENTRY_LINKS_TITLE', 'Site Title:');
+define('ENTRY_LINKS_TITLE_ERROR', 'Link title must contain a minimum of ' . ENTRY_LINKS_TITLE_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_TITLE_TEXT', '*');
+define('ENTRY_LINKS_URL', 'URL:');
+define('ENTRY_LINKS_URL_ERROR', 'URL must contain a minimum of ' . ENTRY_LINKS_URL_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_URL_TEXT', '*');
+define('ENTRY_LINKS_CATEGORY', 'Category:');
+define('ENTRY_LINKS_CATEGORY_TEXT', '*');
+define('ENTRY_LINKS_DESCRIPTION', 'Description:');
+define('ENTRY_LINKS_DESCRIPTION_ERROR', 'Description must contain a minimum of ' . ENTRY_LINKS_DESCRIPTION_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_DESCRIPTION_TEXT', '*');
+define('ENTRY_LINKS_IMAGE', 'Image URL:');
+define('ENTRY_LINKS_IMAGE_TEXT', '');
+define('ENTRY_LINKS_CONTACT_NAME', 'Full Name:');
+define('ENTRY_LINKS_CONTACT_NAME_ERROR', 'Your Full Name must contain a minimum of ' . ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_CONTACT_NAME_TEXT', '*');
+define('ENTRY_LINKS_RECIPROCAL_URL', 'Reciprocal Page:');
+define('ENTRY_LINKS_RECIPROCAL_URL_ERROR', 'Reciprocal page must contain a minimum of ' . ENTRY_LINKS_URL_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_RECIPROCAL_URL_TEXT', '*');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/links_submit_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/links_submit_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/links_submit_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: links_submit_success.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Links');
+define('NAVBAR_TITLE_2', 'Success');
+define('HEADING_TITLE', 'Your Link Has Been Submitted!');
+define('TEXT_LINK_SUBMITTED', 'Congratulations! Your link has been successfully submitted! It will be added to our listing as soon as we approve it. If you have <small><b>ANY</b></small> questions, please email the <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">store owner</a>.<br><br>You will receive an email confirming your submittal. If you have not received it within the hour, please <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">contact us</a>. Also, you will receive an email as soon as your link is approved.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/login.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: login.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//Email Validation
+define('TEXT_LOGIN_ERROR_VALIDATION', 'Error: Your account is not validated.');
+define('TEXT_YOU_HAVE_TO_VALIDATE', 'Please insert your Validation-key to confirm your registration');
+define('ENTRY_VALIDATION_CODE', 'Validation-key');
+define('TEXT_NEW_VALIDATION_CODE', '<b>Request a new Validation-key <u>here</u></b>');
+
+define('NAVBAR_TITLE', 'Login Page');
+
+define('HEADING_TITLE', 'Welcome, Please Sign In');
+
+define('HEADING_NEW_CUSTOMER', 'New Customer');
+define('TEXT_NEW_CUSTOMER', 'I am a new customer.');
+define('TEXT_NEW_CUSTOMER_INTRODUCTION', 'By creating an account at ' . STORE_NAME . ' you will be able to shop faster, be up to date on an orders status, and keep track of the orders you have previously made.');
+define('HEADING_RETURNING_CUSTOMER', 'Returning Customer');
+define('TEXT_RETURNING_CUSTOMER', 'I am a returning customer.');
+
+define('TEXT_PASSWORD_FORGOTTEN', 'Password forgotten? Click here.');
+
+define('TEXT_LOGIN_ERROR', 'Error: No match for E-Mail Address and/or Password.');
+define('TEXT_VISITORS_CART', '<font color="#ff0000"><b>Note:</b></font> Your &quot;Visitors Cart&quot; contents will be merged with your &quot;Members Cart&quot; contents once you have logged on. <a href="javascript:session_win();">[More Info]</a>');
+// Begin Checkout Without Account v0.70 changes
+
+define('PWA_FAIL_ACCOUNT_EXISTS', 'An account already exists for the email address {EMAIL_ADDRESS}.  You must login here with the password for that account before proceeding to checkout.');
+// Begin Checkout Without Account v0.60 changes
+define('HEADING_CHECKOUT', 'Proceed Directly to Checkout');
+define('TEXT_CHECKOUT_INTRODUCTION', 'Proceed to Checkout without creating an account. By choosing this option none of your user information will be kept in our records, and you will not be able to review your order status, nor keep track of your previous orders.');
+define('PROCEED_TO_CHECKOUT', 'Proceed to Checkout without Registering');
+// End Checkout Without Account changes
+// Eversun mod for sppc and qty price breaks
+// define the email address that can change customer_group_id on login
+define('SPPC_TOGGLE_LOGIN_PASSWORD', 'support at creloaded.com');
+// Eversun mod for sppc and qty price breaks
+
+define('LOGIN_TITLE1', 'Choose a Customer Group');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  WebMakers.com Added: loginbox.php
+  Originally written by: Aubrey Kilian <aubrey at mycon.co.za>
+  Re-written by Linda McGrath osCOMMERCE at WebMakers.com
+  Modified by Justin of World Famous Comics <justin at wfcomics.com>
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('BOX_HEADING_LOGIN_BOX_MY_ACCOUNT','My Account Info.');
+
+  define('LOGIN_BOX_MY_ACCOUNT','My Account Overview');
+  define('LOGIN_BOX_ACCOUNT_EDIT','Edit My Account Information');
+  define('LOGIN_BOX_ADDRESS_BOOK','Edit Address Book');
+  define('LOGIN_BOX_ACCOUNT_HISTORY','View My Order History');
+  define('LOGIN_BOX_PRODUCT_NOTIFICATIONS','Product Notifications');
+
+  define('LOGIN_BOX_PASSWORD_FORGOTTEN','Password Forgotten?');
+
+  define('BOX_LOGINBOX_EMAIL','Your Email Address');
+  define('BOX_LOGINBOX_PASSWORD','Your Password');
+  define('LOGIN_BOX_LOGOFF','Logoff');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/logoff.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Log Off');
+define('NAVBAR_TITLE', 'Log Off');
+define('TEXT_MAIN', 'You have been logged off your account. It is now safe to leave the computer.<br><br>Your shopping cart has been saved, the items inside it will be restored whenever you log back into your account.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1 @@
+This is the OpenMoko Online Store. This content will be customized by designers / coders at a later time. For now...just the essentials.
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/checkout_success/notifications.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/checkout_success/notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/checkout_success/notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+define('MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_TITLE', 'Notifications');
+define('MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_DESCRIPTION', 'Product Notifications Checkout Success Module');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/checkout_success/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/checkout_success/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/checkout_success/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+<?php
+define('MODULE_CHECKOUT_SUCCESS_SHIPWIRE_TITLE', 'ShipWire');
+define('MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DESCRIPTION', 'ShipWire Checkout Success Module');
+define('TEXT_SHIPWIRE_TRANSACTION_ID', 'ShipWire Fullfillment ID:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_coupon.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_coupon.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_coupon.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: ot_coupon.php,v 1.3 2004/03/09 18:56:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR', 'Message');
+  define('MODULE_ORDER_TOTAL_COUPON_TITLE', 'Discount Coupons');
+  define('MODULE_ORDER_TOTAL_COUPON_HEADER', 'Gift Vouchers/Discount Coupons');
+  define('MODULE_ORDER_TOTAL_COUPON_DESCRIPTION', 'Discount Coupon');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+  define('MODULE_ORDER_TOTAL_COUPON_USER_PROMPT', '');
+  define('ERROR_NO_INVALID_REDEEM_COUPON', 'Invalid Coupon Code');
+  define('ERROR_INVALID_STARTDATE_COUPON', 'This coupon is not available yet');
+  define('ERROR_INVALID_FINISDATE_COUPON', 'This coupon has expired');
+  define('ERROR_INVALID_USES_COUPON', 'This coupon could only be used ');
+  define('TIMES', ' times.');
+  define('ERROR_INVALID_USES_USER_COUPON', 'You have used the coupon the maximum number of times allowed per customer.');
+  define('REDEEMED_COUPON', 'a coupon worth ');
+  define('REDEEMED_MIN_ORDER', 'on orders over ');
+  define('REDEEMED_RESTRICTIONS', ' [Product-Category restrictions apply]');
+  define('TEXT_ENTER_COUPON_CODE', 'Enter Redeem Code&nbsp;&nbsp;');
+  define('IMAGE_REDEEM_VOUCHER', 'Redeem Code Voucher');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_gv.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ot_gv.php,v 1.3 2004/03/09 18:56:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_GV_TITLE', 'Gift Vouchers');
+  define('MODULE_ORDER_TOTAL_GV_HEADER', 'Gift Vouchers/Discount Coupons');
+  define('MODULE_ORDER_TOTAL_GV_DESCRIPTION', 'Gift Vouchers');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+  define('MODULE_ORDER_TOTAL_GV_USER_PROMPT', 'Tick to use Gift Voucher account balance ->&nbsp;');
+  define('TEXT_ENTER_GV_CODE', 'Enter Redeem Code&nbsp;&nbsp;');
+  define('IMAGE_REDEEM_VOUCHER', 'Redeem Code Voucher');
+  define('MODULE_ORDER_TOTAL_GV_TEXT_ERROR', 'Gift Voucher/Discount coupon');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_lev_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_lev_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_lev_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: ot_lev_discount.php,v 1.1 2002/08/30 21:05:04 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_LEV_DISCOUNT_TITLE', 'Price Break Discount');
+  define('MODULE_LEV_DISCOUNT_DESCRIPTION', 'Price Break Discount');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_loworderfee.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_loworderfee.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_loworderfee.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_loworderfee.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE', 'Low Order Fee');
+  define('MODULE_ORDER_TOTAL_LOWORDERFEE_DESCRIPTION', 'Low Order Fee');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_qty_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_qty_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_qty_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ot_qty_discount.php,v 1.4 2004-08-22 dreamscape Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 Josh Dechant
+  Protions Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_QTY_DISCOUNT_TITLE', 'Global Quantity Discount');
+  define('MODULE_QTY_DISCOUNT_DESCRIPTION', 'Quantity specific discount percentage or flat rate - Specify discount rate based on the number of items in the cart (global across all products).');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+
+  define('MODULE_QTY_DISCOUNT_PERCENTAGE_TEXT_EXTENSION', ' (%s%%)'); // %s is the percent discount as a number; %% displays a % sign
+  define('MODULE_QTY_DISCOUNT_FORMATED_TITLE', '<strong>Quantity Discount%s:</strong>'); // %s is the placement of the MODULE_QTY_DISCOUNT_PERCENTAGE_TEXT_EXTENSION
+  define('MODULE_QTY_DISCOUNT_FORMATED_TEXT', '<strong>-%s</strong>'); // %s is the discount amount formated for the currency
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: ot_shipping.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_SHIPPING_TITLE', 'Shipping');
+  define('MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION', 'Order Shipping Cost');
+
+  define('FREE_SHIPPING_TITLE', 'Free Shipping');
+  define('FREE_SHIPPING_DESCRIPTION', 'Free shipping for orders over %s');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_subtotal.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_subtotal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_subtotal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_subtotal.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_SUBTOTAL_TITLE', 'Sub-Total');
+  define('MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION', 'Order Sub-Total');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_tax.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_tax.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_tax.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_tax.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_TAX_TITLE', 'Tax');
+  define('MODULE_ORDER_TOTAL_TAX_DESCRIPTION', 'Order Tax');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_total.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_total.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/order_total/ot_total.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_total.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_TOTAL_TITLE', 'Total');
+  define('MODULE_ORDER_TOTAL_TOTAL_DESCRIPTION', 'Order Total');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/SecurePay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/SecurePay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/SecurePay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+
+ Based on payment Module of iongate.php (06/11/2003) Modified for Securepay.com by:
+
+Tony Reynolds  <tonyr at securepay.com>
+
+SecurePay.php version 1.2 06/11/2003
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_TITLE', 'Credit Card : SecurePay');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_DESCRIPTION', 'SecurePay payment module. <BR>Credit Card Test Info:<br>Aprovals<br>CC#: 4111111111111111<br>Expiry: Any <BR> Declines <BR>CC#: 5105105105105100<br>Expiry: Any ');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_GATEWAY_TIMEOUT', 'There was an error contacting the credit card processor. Please try again.');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_ERROR', 'There was a problem processing your Credit Card! Not-Approved');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_WRONG_TYPE', 'The Credit Card Number does not match the Credit Card Type.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/authorizenet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/authorizenet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/authorizenet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: authorizenet.php,v 1.3 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+ */
+
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_TITLE', 'Credit Card : Authorize.net');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DESCRIPTION', 'Authorize.net <a href=\"' . tep_href_link(FILENAME_AUTHORIZENET_HELP, '', 'NONSSL') . '\" target=\"authnetHelp\" style=\"color:#0033cc\"> [Setup Help]</a> </style><br> Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_AUTHORIZENET_CVV_NUMBER', 'CVV number');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_cvc.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_cvc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_cvc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_CVC_TEXT_TITLE', 'Credit Card : with CCV');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DESCRIPTION', 'Credit Card with CCV checking Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CCV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_CCV', 'ccv/cvc/ccv2/cid code 3 or 4 digits');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_CVV', '* You must enter a CCV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_VISA', 'Visa');
+    
+    define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+    define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Master Card');
+    define('MODULE_PAYMENT_CC_TEXT_DISCOVERY', 'Discover');
+    define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+    define('MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS', 'American Express');
+    define('MODULE_PAYMENT_CC_TEXT_DELTA', 'Delta');
+    define('MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON', 'UK Electron');
+    define('MODULE_PAYMENT_CC_TEXT_MEASTRO', 'Maestro');
+    define('MODULE_PAYMENT_CC_TEXT_UK_SWITCH', 'UK Switch');
+    define('MODULE_PAYMENT_CC_TEXT_SOLO', 'Solo');
+    define('MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD', 'Australian BankCard');
+    define('MODULE_PAYMENT_CC_TEXT_JCB', 'JCB');
+    define('MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE', 'Carte Blanche');
+    define('MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB', 'Diners Club');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_old.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_old.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_old.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_TEXT_TITLE', 'Credit Card');
+  define('MODULE_PAYMENT_CC_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_uk.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_uk.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/cc_uk.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_UK_TEXT_TITLE', 'Credit Card UK,');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DESCRIPTION', 'Credit Card for UK with CVC checking Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_UK_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START', 'Credit Card Start Date:');
+//  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE', 'Credit Card Issue Date:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE','<BR>*** ISSUE NUMBER. This number can be found on debit cards on the front side, on the bottom row , just before the expiry date.');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV', '3 or 4 Digit Security Code:');      
+  
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CCV', 'CCV number:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_UK_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+    define('MODULE_PAYMENT_CC_UK_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_UK_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_UK_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Master Card');
+  define('MODULE_PAYMENT_CC_TEXT_DISCOVERY', 'Discover');
+  define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS', 'American Express');
+  define('MODULE_PAYMENT_CC_TEXT_DELTA', 'Delta');
+  define('MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON', 'UK Electron');
+  define('MODULE_PAYMENT_CC_TEXT_MEASTRO', 'Maestro');
+  define('MODULE_PAYMENT_CC_TEXT_UK_SWITCH', 'UK Switch');
+  define('MODULE_PAYMENT_CC_TEXT_SOLO', 'Solo');
+  define('MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD', 'Australian BankCard');
+  define('MODULE_PAYMENT_CC_TEXT_JCB', 'JCB');
+  define('MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE', 'Carte Blanche');
+  define('MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB', 'Diners Club');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/ccerr.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/ccerr.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/ccerr.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: cc.php,v 1.10 2002/11/01 05:14:11 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CCERR_TEXT_TITLE', 'Credit Class Error');
+  define('MODULE_PAYMENT_CCERR_TEXT_DESCRIPTION', 'Credit Class Error, needed with Gift Voucher');  
+  define('MODULE_PAYMENT_CCERR_TEXT_ERROR', 'Payment selection error');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/citibank.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/citibank.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/citibank.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: citibank.php,v 1.0 2003/03/11 05:36:58 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 by PIGSTUY.COM
+
+  Released under the GNU General Public License
+*/
+
+	define('MODULE_PAYMENT_CITIBANK_TEXT_TITLE', 'Citibank payment module ');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_TYPE','Credit Card Type');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_OWNER','Credit Card Owner (name on the card)');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_EXPIRES','Credit Card Expiration Date');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_CVV_LINK','What is CVV');
+	
+	// labels for CreditCard types
+	define('MODULE_PAYMENT_CITIBANK_TEXT_VISA', 'Visa');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_MASTER', 'Mastercard');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_JCB','JCB Card');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_UCARD','UCARD Card');
+	
+	// define cards that are accepted by payment module (VISA,AMEX,DISCOVER,MASTERCARD). Separate with ','. Uperrcase is required.
+	define('MODULE_PAYMENT_CITIBANK_ACCEPTED_CC','VISA,MASTER,JCB,UCARD');
+	//VISA, MASTER, JCB, or UCARD
+	
+	//description of payment module
+	define('MODULE_PAYMENT_CITIBANK_TEXT_DESCRIPTION', "Module for Citibank");
+	
+	define('MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+	
+	define('MODULE_PAYMENT_CITIBANK_TEXT_DECLINED_TRANSACTION', 'Bank has declined this transaction');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_INVALID_PRICE', 'Your shopping cart has invalid total price');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_MISSING_FORM_DATA', 'Credit Card form is not filled correctly');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_CONFIGURATION_ERROR', 'Payment module is not configured correctly please contact site administrator');
+	define('MODULE_PAYMENT_CITIBANK_TEXT_PROCESSING_ERROR', 'There was error in transaction');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/ckmerchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/ckmerchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/ckmerchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ckmerchantpartners.php,v 1.4 2002/11/01 05:35:33 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_TITLE', 'Electronic Check : Pay Me Now');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_DESCRIPTION', 'Merchant Partners Pay Me now Electronic Check Number:<br><br>ACCT#: 999999999<br>ABA: 999999999');
+  define('CKMERCHANTPARTNERS_ERROR_HEADING', 'There has been an error processing your Electronic Check');
+  define('CKMERCHANTPARTNERS_ERROR_MESSAGE', 'Please check your Check details!');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_OWNER', 'Name on Check:');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_NUMBER', 'Check Account Number:');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_ABA', 'Check Routing Number (ABA):');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_JS_CK_NUMBER', '* The check number must be at least ' . CK_NUMBER_MIN_LENGTH . ' characters.\n');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/cod.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/cod.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/cod.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: cod.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_COD_TEXT_TITLE', 'Cash on Delivery');
+  define('MODULE_PAYMENT_COD_TEXT_DESCRIPTION', 'Cash on Delivery');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/efsnet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/efsnet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/efsnet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: efsnet.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('MODULE_PAYMENT_EFSNET_TEXT_TITLE', 'EFSNet');
+  define('MODULE_PAYMENT_EFSNET_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_EFSNET_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EFSNET_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EFSNET_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_EFSNET_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_EFSNET_TEXT_ERROR', 'Credit Card Error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/egold.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/egold.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/egold.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: e-gold.php,v 1 2003/07/23
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  e-Gold module Crated by Craig Harrison
+*/
+
+  define('MODULE_PAYMENT_EGOLD_TEXT_TITLE', 'e-Gold');
+  define('MODULE_PAYMENT_EGOLD_TEXT_DESCRIPTION', 'e-Gold');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/epssecurenet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/epssecurenet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/epssecurenet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: epssecurenet.php,v 1.0 2003/08/19 Exp $
+
+// EPSsecurenet
+// Built For osCommerce 2.2MS2 version 
+//--------------------------------
+// Developed BY Greg Goodman
+// Copyright 2003 Electronic Payment Systems
+//--------------------------------
+// This code is provided as is. EPS provides no warranty for the code
+// and the use of this code is done so with the express understanding that
+// it is used at the user's risk. Furthermore EPS may not be held
+// accountable for any losses resulting from the use of this code, including
+// associated modules.
+//--------------------------------
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('MODULE_PAYMENT_EFSNET_TEXT_TITLE', 'Credit Card : EPSsecurenet');
+  define('MODULE_PAYMENT_EPSSECURENET_CART_SYSTEM_NAME', 'OsCommerce');
+  define('MODULE_PAYMENT_EPSSECURENET_CONNECTION_TYPE', 'sd');
+  define('MODULE_PAYMENT_EPSSECURENET_ORDER_DESCRIP', 'Refer to OScommerce Customer Order Screen');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_TITLE', 'EPSsecurenet');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_DESCRIPTION', 'EPSsecurenet Payment Module Credit Card Test Info:<br><br>CC#: 5123456789012346<br>Expiry: Any'); 
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_CVV2', 'CVV2 Security Number:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_CVV2', '* The CVV2 Number must at least be three or four characters.\n    -For VISA/MasterCard this number is on the back of the Card.\n    -For American Express it is 4 digits and located on the front of the Card.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_ERROR', 'Credit Card Error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/eustandardtransfer.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/eustandardtransfer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/eustandardtransfer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_TITLE', 'EU-Standard Bank Transfer');
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION', '<BR>Please use the following details to transfer your total order value:<BR>' .
+                                                         '<BR>Bank Name: ' . MODULE_PAYMENT_EUTRANSFER_BANKNAM .
+                                                         '<BR>Branch: ' . MODULE_PAYMENT_EUTRANSFER_BRANCH .
+                                                         '<BR>Account Name: ' . MODULE_PAYMENT_EUTRANSFER_ACCNAM .
+                                                         '<br>Account No.: ' . MODULE_PAYMENT_EUTRANSFER_ACCNUM .
+                                                         '<BR>IBAN:: ' . MODULE_PAYMENT_EUTRANSFER_ACCIBAN .
+                                                         '<BR>BIC/SWIFT: ' . MODULE_PAYMENT_EUTRANSFER_BANKBIC .
+//                                                         '<BR>Sort Code: ' . MODULE_PAYMENT_EUTRANSFER_SORTCODE .
+                                                         '<BR><BR>Your order will not ship until we receive payment in the above account.<BR>');
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_EMAIL_FOOTER', str_replace('<BR>','\n',MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION));
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/firepay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/firepay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/firepay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+
+
+  define('MODULE_PAYMENT_FIREPAY_TEXT_TITLE', 'Credit Card : FirePay');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DESCRIPTION', 'Payment processor for SureFire Commerce. Uses FirePay gateway.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CCV_NUMBER', 'CVV number');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DINERSCLUB', 'Diners Club');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_FIREPAY', 'FirePay');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_VISA', 'Visa');
+
+ ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/freecharger.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/freecharger.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/freecharger.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_TITLE', 'The WebMakers Corner FREE CHARGE CARD');
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_DESCRIPTION', 'Used for purchase of FREE CHARGE ONLY');
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_EMAIL_FOOTER', 'Used with purchases via Free Charge');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/geotrust.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/geotrust.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/geotrust.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: geotrust.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce / Paul Kim
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_TITLE', 'Credit Card : GeoTrust QuickPayments');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4445999922225<br>Expiry: Any');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_FIRST_NAME', 'First Name:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_LAST_NAME', 'Last Name:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER', 'Name:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiriration Date:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2', 'Card Verification Value:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2_LOCATION', '(last 3 digits, located at the back of the credit card)');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/ipayment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/ipayment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/ipayment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: ipayment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_TITLE', 'Credit Card : iPayment');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('IPAYMENT_ERROR_HEADING', 'There has been an error processing your credit card');
+  define('IPAYMENT_ERROR_MESSAGE', 'Please check your credit card details!');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER', 'Credit Card Checknumber:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION', '(located at the back of the credit card)');
+
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/merchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/merchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/merchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: merchantpartners.php,v 1.4 2002/11/01 05:35:33 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_TITLE', 'Credit Card : Pay Me Now');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_DESCRIPTION', 'Merchant Partners, Pay me now(Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MERCHANTPARTNERS_ERROR_HEADING', 'There has been an error processing your credit card');
+  define('MERCHANTPARTNERS_ERROR_MESSAGE', 'Please check your credit card details!');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2', 'CVV2/CCV2/CID number:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2_LOCATION', '(3 or 4 digit # on back of card):');
+
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/moneyorder.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/moneyorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/moneyorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: moneyorder.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_TITLE', 'Check/Money Order');
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION', 'Make Payable To:&nbsp;' . MODULE_PAYMENT_MONEYORDER_PAYTO . '<br><br>Send To:<br>' . nl2br(STORE_NAME_ADDRESS) . '<br><br>' . 'Your order will not ship until we receive payment.');
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', "Make Payable To: ". MODULE_PAYMENT_MONEYORDER_PAYTO . "\n\nSend To:\n" . STORE_NAME_ADDRESS . "\n\n" . 'Your order will not ship until we receive payment.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/nochex.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/nochex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/nochex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: nochex.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_NOCHEX_TEXT_TITLE', 'NOCHEX');
+  define('MODULE_PAYMENT_NOCHEX_TEXT_DESCRIPTION', 'NOCHEX Requires the GBP currency.<br><br>NOCHEX limits transactions to 100 GBP.  Anything over requires either a Merchant Account or a NOCHEX account.<br>');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/paybox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/paybox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/paybox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  Contribution by Emmanuel Alliel <manu at maboutique.biz>
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYBOX_TEXT_TITLE', 'Credit Card : Paybox');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_DESCRIPTION', 'Paybox module made by Emmanuel Alliel<br>Email: manu at maboutique.biz');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/payflowpro.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/payflowpro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/payflowpro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: PAYFLOWPRO.php,v 1.9 2002/01/04 10:45:18 hpdl Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE', 'Pay by Credit Card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE1', 'Your credit card information will be kept secure and private.  We use Verisign payment processing.');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE2', '');
+ 
+ 
+
+  define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'The Credit Card number doe snot match the Card Type:');
+ 
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_TYPE', 'Card Type:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_OWNER', 'Card Owner:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_HOLDER_FIRST_NAME', 'First Name and Initial as shown on the card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_HOLDER_LAST_NAME', 'Last Name and Suffix as shown on your card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_EXPIRES', 'Expiration:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC', 'Card Verification Number');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_TEXT', '(On the back of your card, locate the final 3 digit number)');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_HELP', 'Help Finding Card Verification Number');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_AMEX', 'Using Amex?');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.n');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR_MESSAGE', 'There has been an error processing you credit card, please try again, or call us ');
+  
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR1', 'Local not sent to processor');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR', 'There has been an error processing you credit card. Please double check the information you entered. 
+  <p> 1)  Does the bill to address match the credit card billing address?
+   </p> 2) Try to re-enter the credit card information.  Sorry that this step is necessary, the re-entry is a security requirement.
+  3) If you are still having a problem, please call or email us.  Your items are stored in the system and we can easily help you during normal business hours.  We will still be able to promptly send you your merchandise. 
+  Card error #');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/payjunction.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/payjunction.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/payjunction.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_TITLE', 'Credit Card : PayJunction');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_DESCRIPTION', 'Accept payments through the <b>PayJunction</b> gateway.<br/><br/>Use this credit card to test: 4433221111223344 (12/17)');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NAME', 'Cardholder name:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NUMBER', 'Credit card number:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_CODE', 'CVV2/CVC2 code:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_EXPIRES', 'Credit card expiration:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR', 'Credit card error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: paypal.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE', 'PayPal');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION', 'PayPal');
+
+  define('MODULE_PAYMENT_PAYPAL_CC_TEXT', "Credit Card&nbsp;%s%s%s%s&nbsp;or&nbsp;%s");
+
+  define('MODULE_PAYMENT_PAYPAL_IMAGE_BUTTON_CHECKOUT', 'PayPal Checkout');
+  define('MODULE_PAYMENT_PAYPAL_CC_DESCRIPTION','You do not need to be a PayPal member to pay by credit card');
+  define('MODULE_PAYMENT_PAYPAL_CC_URL_TEXT','<font color="blue"><u>[info]</u></font>');
+
+  define('MODULE_PAYMENT_PAYPAL_CUSTOMER_COMMENTS', 'Add Comments About Your Order');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE_PROCESSING', 'Processing transaction');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION_PROCESSING', 'If this page appears for more than 5 seconds, please click the PayPal Checkout button to complete your order.');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal_dp.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal_dp.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal_dp.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  paypal_dp.php, v 1.0 09/06/2005
+  Copyright (c) 2005 POSTOSC.COM
+  Released under the GNU General Public License
+  Absolutely no warranty. Use at your own risk.
+*/
+
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE', 'Paypal Pro Credit Card Payment');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_DESCRIPTION', 'PayPal Pro Credit Card Payment');
+define('MODULE_PAYMENT_PAYPAL_DP_CLIENT_DESCRIPTION', 'Credit Card');
+define('MODULE_PAYMENT_PAYPAL_DP_IMAGE_DESCRIPTION', '<img src="images/paypal/4cards.gif">');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_FIRSTNAME', 'Owner First Name:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_LASTNAME', 'Owner Last Name:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_CVV2', '<a href="http://www.paypal.com/cgi-bin/webscr?cmd=p/acc/cvv_info_pop-outside" target="_blank"><b>Card Verification Number (<u>CLICK FOR DETAILS</u>)</b></a>:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_EXPIRES', 'Card Expiration Date:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_FIRSTNAME', '* The owner\'s first name of the credit card must be at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_LASTNAME', '* The owner\'s last name of the credit card must be at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_CVV2', '* The card verification value cannot be more than 4 characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_ERROR', 'Credit Card Error!');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_PROCESS_ERROR', 'There has been an error processing your credit card. Please try again.');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal_ec.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal_ec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypal_ec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  paypal_ec.php, v 1.0 09/06/2005
+
+  Copyright (c) 2005 POSTOSC.COM
+
+  Released under the GNU General Public License
+
+  Absolutely no warranty. Use at your own risk.
+*/
+
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_TITLE', 'PayPal Pro Express Checkout');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_DESCRIPTION', 'PayPal Pro Express Checkout');
+define('MODULE_PAYMENT_PAYPAL_EC_CLIENT_DESCRIPTION', 'PayPal');
+define('MODULE_PAYMENT_PAYPAL_EC_IMAGE_DESCRIPTION', '<img src="images/buttons/x-click-but6.gif" align="left" style="margin-right:7px;"><span style="font-size:11px; font-family: Arial, Verdana;">Save time. Checkout securely. Pay without sharing your financial information.</span>');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_ERROR', 'PayPal Process Error!');
+define('MODULE_PAYMENT_PAYPAL_EC_BILLING_ERROR', 'Please enter your PayPal billing address.');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_PROCESS_ERROR', 'There has been an error processing your payment. Please try again.');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_DECLINED_MESSAGE', 'Your card was declined. Please try another card or contact your bank for more info.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypalipn.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypalipn.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/paypalipn.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: paypalipn.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Paypal IPN v0.981 for Milestone 2
+  Copyright (c) 2003 Pablo Pasqualino
+  pablo_osc at osmosisdc.com
+  http://www.osmosisdc.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_TITLE', 'PayPal IPN');
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_DESCRIPTION', 'PayPal IPN');
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_CURL', 'cURL Enabled');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/plugnpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/plugnpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/plugnpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: plugnpay.php,v 1.13 2003/01/03 17:25:43 thomasamoulton Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+  Released under the GNU General Public License
+
+  Last Updated: 09/17/04
+*/
+
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_TITLE', 'Credit Card : PlugnPay');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DESCRIPTION', 'PlugnPay API');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_CVV', 'CVV/CVV2:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCTTYPE', 'Account Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ROUTINGNUM', 'Routing Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCOUNTNUM', 'Account Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_CHECKNUM', 'Check Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_PAYTYPE', 'Payment Method:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/pm2checkout.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/pm2checkout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/pm2checkout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: pm2checkout.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_TITLE', 'Credit Card : 2CheckOut');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_FIRST_NAME', 'Credit Card Owner First Name:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_LAST_NAME', 'Credit Card Owner Last Name:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER', 'Credit Card Checknumber:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION', '(located at the back of the credit card)');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR', 'Credit Card Error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/psigate.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/psigate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/psigate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: psigate.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PSIGATE_TEXT_TITLE', 'Credit Card : PSiGate');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_ERROR', 'Credit Card Error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/qchex.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/qchex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/qchex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: qchex.php,v 3.0 2003/11/10 23:25:32 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_QCHEX_TEXT_TITLE', 'QChex (Electronic Check Payment)');
+  define('MODULE_PAYMENT_QCHEX_TEXT_DESCRIPTION', 'QChex (Electronic Check Payment)');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/quickcommerce.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/quickcommerce.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/quickcommerce.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: authorizenet.php,v 1.3 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+*/
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_TITLE', 'Credit Card : Quick Commerce Pro');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/secpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/secpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/secpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: secpay.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_SECPAY_TEXT_TITLE', ' Credit Card : SECPay');
+  define('MODULE_PAYMENT_SECPAY_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4444333322221111<br>Expiry: Any');
+  define('MODULE_PAYMENT_SECPAY_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_SECPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/payment/worldpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/payment/worldpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/payment/worldpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: worldpay.php,v MS1a 2003/04/06 21:30
+  Author :  Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.4
+
+  Revisions:
+  Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+          Now posting language code to WP, Redirect on failure now to Checkout Payment,
+      Reduced re-direct time to 8 seconds, added MD5, made callback dynamic 
+      NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+  Version 1.4 Removes boxes to prevent users from clicking away before update, 
+      Fixes currency for Yen, 
+      Redirects to Checkout_Process after 10 seconds or click by user
+  Version 1.3 Fixes problem with Multi Currency
+  Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+  Version 1.1 Added Worldpay Pre-Authorisation ability
+  Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_WORLDPAY_TEXT_TITLE', 'Worldpay Credit Card Payment');
+  define('MODULE_PAYMENT_WORLDPAY_TEXT_DESCRIPTION', 'Worldpay Junior Payment Module');
+   
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspost.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspost.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_TEXT_TITLE', 'AusPOST Parcel Post');
+define('MODULE_SHIPPING_AUSPOST_TEXT_DESCRIPTION', 'AusPOST Parcel Post');
+define('MODULE_SHIPPING_AUSPOST_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostair.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostair.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostair.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostair.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_TITLE', 'AusPOST International Parcel Post - AIR');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_DESCRIPTION', 'AusPOST International Parcel Post - AIR');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/ausposteconomy.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/ausposteconomy.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/ausposteconomy.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: ausposteconomy.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_TITLE', 'AusPOST International Parcel Post - Economy');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_DESCRIPTION', 'Int. Parcel Post - Economy');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostexpress.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostexpress.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostexpress.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostexpress.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_TITLE', 'AusPOST Express Post Parcel');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_DESCRIPTION', 'AusPOST Express Post Parcel');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostsea.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostsea.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/auspostsea.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostsea.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_TITLE', 'AusPOST International Parcel Post - SEA');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_DESCRIPTION', 'AusPOST International Parcel Post - SEA');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/canadapost.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/canadapost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/canadapost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  canadapost.php version 0.3
+  
+  Before use this class, you should open a Canada 
+  Post Eparcel Account, and change the CPCIP to
+  your ID. Visit www.canadapost.ca for detail.
+  
+  XML connection method with Canada Post.
+
+  Copyright (c) 2002,2003 Kelvin Zhang (kelvin at syngear.com)
+  Modified by Kenneth Wang (kenneth at cqww.net), 2002.11.12
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_CANADAPOST_TEXT_TITLE', 'Canada Post');
+define('MODULE_SHIPPING_CANADAPOST_TEXT_DESCRIPTION', 'Canada Post Parcel Service');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/cod.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/cod.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/cod.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: flat.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_COD_TEXT_TITLE', 'COD Rate');
+define('MODULE_SHIPPING_COD_TEXT_DESCRIPTION', 'COD Rate');
+define('MODULE_SHIPPING_COD_TEXT_WAY', 'Best Way');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/fedex1.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/fedex1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/fedex1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+
+  Verions 2.00 for OSC 2.2 MSS and earlier
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002, 2003 Steve Fatula of Fatula Consulting
+  compconsultant at yahoo.com
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FEDEX1_TEXT_TITLE', 'Federal Express');
+define('MODULE_SHIPPING_FEDEX1_TEXT_DESCRIPTION', 'Federal Express<br><br>You will need to have registered an account with FEDEX to use this module. Please see the README.TXT file for other requirements.');
+
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_01', 'Priority (by 10:30AM, later for rural)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_03', '2 Day Air');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_05', 'Standard Overnight (by 3PM, later for rural)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_06', 'First Overnight');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_20', 'Express Saver (3 Day)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_90', 'Home Delivery');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_92', 'Ground Service');
+
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_01', 'International Priority (1-3 Days)');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_03', 'International Economy (4-5 Days)');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_06', 'International First');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_90', 'Home Delivery');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_92', 'Ground Service');
+
+define('MODULE_SHIPPING_FEDEX1_ERROR_1', 'An error occured with the fedex shipping calculations.<br>Fedex may not deliver to your country, or your postal code may be wrong.');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_1', "Data sent to Fedex for Meter: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_2', "Data returned from Fedex for Meter: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_3', 'No response to CURL from Fedex server, check CURL availability, or maybe timeout was set too low, or maybe the Fedex site is down');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_4', 'No meter number was obtained, check configuration. Error ');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_5', 'You forgot to set up your Fedex account number, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_6', 'You forgot to set up your ship from street address line 1, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_7', 'You forgot to set up your ship from City, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_8', 'You forgot to set up your ship from postal code, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_9', 'You forgot to set up your ship from phone number, this can be set up in Admin -> Modules -> Shipping');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_10', "Data sent to Fedex for Rating: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_11', "Data returned from Fedex for Rating: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_12', 'No data returned from Fedex, perhaps the Fedex site is down');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_13', 'No Rates Returned, ');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/flat.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/flat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/flat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: flat.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FLAT_TEXT_TITLE', 'Flat Rate');
+define('MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION', 'Flat Rate');
+define('MODULE_SHIPPING_FLAT_TEXT_WAY', 'Best Way');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/freeshipper.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/freeshipper.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/freeshipper.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE', 'FREE SHIPPING!');
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_DESCRIPTION', 'FREE SHIPPING');
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_WAY', 'Free Shipping Only');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/item.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/item.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/item.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: item.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ITEM_TEXT_TITLE', 'Per Item');
+define('MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION', 'Per Item');
+define('MODULE_SHIPPING_ITEM_TEXT_WAY', 'Best Way');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/percent.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/percent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/percent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: percent.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001,2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('MODULE_SHIPPING_PERCENT_TEXT_TITLE', 'Shipping');
+define('MODULE_SHIPPING_PERCENT_TEXT_TITLE_ADMIN', 'Percent Rate');
+define('MODULE_SHIPPING_PERCENT_TEXT_DESCRIPTION', 'Percent Rate Shipping');
+define('MODULE_SHIPPING_PERCENT_TEXT_WAY', 'Total');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/reg.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/reg.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/reg.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_REG_TEXT_TITLE', 'Royal Mail Registered');
+define('MODULE_SHIPPING_REG_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_REG_TEXT_WAY', '');
+define('MODULE_SHIPPING_REG_TEXT_UNITS', '');
+define('MODULE_SHIPPING_REG_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_REG_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/spec.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/spec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/spec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_SPEC_TEXT_TITLE', 'Royal Mail Special Delivery');
+define('MODULE_SHIPPING_SPEC_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_SPEC_TEXT_WAY', '');
+define('MODULE_SHIPPING_SPEC_TEXT_UNITS', '');
+define('MODULE_SHIPPING_SPEC_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_SPEC_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/spu.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/spu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/spu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: spu.php,v 1.3 2002/06/15 01:15:42 mbs Exp $
+  CONTRIB is Store Pickup Shipping Module (http://www.oscommerce.com/community/contributions,164)
+  Created by Michael Halvorsen
+  http://www.arachnia-web.com
+
+  Copyright (c) 2002 Arachnia-web Development.
+  Released under the GNU General Public License.
+  May be used and modified without permission.
+*/
+
+define('MODULE_SHIPPING_SPU_TEXT_TITLE', 'Store Pickup');
+define('MODULE_SHIPPING_SPU_TEXT_DESCRIPTION', 'In-store pickup during regular business hours.');
+define('MODULE_SHIPPING_SPU_TEXT_WAY', 'No shipping charge added.  Pickup during regular business hours.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/stand.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/stand.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/stand.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_STAND_TEXT_TITLE', 'Royal Mail Standard Parcel');
+define('MODULE_SHIPPING_STAND_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_STAND_TEXT_WAY', '');
+define('MODULE_SHIPPING_STAND_TEXT_UNITS', '');
+define('MODULE_SHIPPING_STAND_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_STAND_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/table.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: table.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_TABLE_TEXT_TITLE', 'Table Rate');
+define('MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION', 'Table Rate');
+define('MODULE_SHIPPING_TABLE_TEXT_WAY', 'Best Way');
+define('MODULE_SHIPPING_TABLE_TEXT_WEIGHT', 'Weight');
+define('MODULE_SHIPPING_TABLE_TEXT_AMOUNT', 'Amount');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/ups.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/ups.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/ups.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: ups.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_UPS_TEXT_TITLE', 'United Parcel Service');
+define('MODULE_SHIPPING_UPS_TEXT_DESCRIPTION', 'United Parcel Service');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_GND', 'UPS Ground');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DM', 'Next Day Air Early AM');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DA', 'Next Day Air');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DP', 'Next Day Air Saver');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_2DM', '2nd Day Air Early AM');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_3DS', '3 Day Select');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_STD', 'Canada Standard');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XPR', 'Worldwide Express');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XDM', 'Worldwide Express Plus');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XPD', 'Worldwide Expedited');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/upsxml.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/upsxml.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/upsxml.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: upsxml.php,v 1.2 2006/12/26 JanZ Exp $
+
+  Written by Torin Walker
+  torinwalker at rogers.com
+  
+  Last update in accordance with UPS OnLine Tools, Rates and Service Selection, XML Programming Information,
+  Version 1.0, Volume 7, Number 1, Revision Date: December 17, 2006
+
+  Copyright(c) 2003 by Torin Walker, All rights reserved.
+
+  Released under the GNU General Public License
+*/
+
+	define('MODULE_SHIPPING_UPSXML_RATES_TEXT_TITLE', 'UPS');
+	define('MODULE_SHIPPING_UPSXML_RATES_TEXT_DESCRIPTION', 'United Parcel Service (XML)');
+	define('MODULE_SHIPPING_UPSXML_RATES_TEXT_UNKNOWN_ERROR', 'An unknown error occured with the ups shipping calculations.');
+	define('MODULE_SHIPPING_UPSXML_RATES_TEXT_IF_YOU_PREFER', 'If you prefer to use ups as your shipping method, please contact');
+	define('MODULE_SHIPPING_UPSXML_RATES_TEXT_COMM_ERROR', 'A communication error occured while attempting to contact the UPS gateway');
+	define('MODULE_SHIPPING_UPSXML_RATES_TEXT_COMM_UNKNOWN_ERROR', 'An unknown error occured while attempting to contact the UPS gateway');
+	define('MODULE_SHIPPING_UPSXML_RATES_TEXT_COMM_VERSION_ERROR', 'This module supports only xpci version 1.0001 of the UPS Rates Interface. Please contact the webmaster for additional assistance.');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_01', 'UPS Next Day Air');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_02', 'UPS 2nd Day Air');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_03', 'UPS Ground');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_07', 'UPS Worldwide Express');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_08', 'UPS Worldwide Expedited');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_11', 'UPS Standard');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_12', 'UPS 3 Day Select');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_13', 'UPS Next Day Air Saver');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_14', 'UPS Next Day Air Early A.M.');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_54', 'UPS Worldwide Express Plus');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_59', 'UPS 2nd Day Air A.M.');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_65', 'UPS Saver');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_01', 'UPS Express');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_02', 'UPS Expedited');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_07', 'UPS Worldwide Express');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_08', 'UPS Worldwide Expedited');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_11', 'UPS Standard');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_12', 'UPS 3 Day Select');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_13', 'UPS Saver');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_14', 'UPS Express Early A.M.');
+	// CANADA origin 54 will not be offered after Jan 2, 2007
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_54', 'UPS Worldwide Express Plus');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_65', 'UPS Saver');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_07', 'UPS Express');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_11', 'UPS Standard');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_54', 'UPS Worldwide Express Plus');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_65', 'UPS Saver');
+	// next three services Poland domestic only (Stolica) 
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_82', 'UPS Today Standard');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_83', 'UPS Today Dedicated Courier');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_84', 'UPS Today Intercity');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_01', 'UPS Next Day Air');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_02', 'UPS 2nd Day Air');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_03', 'UPS Ground');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_07', 'UPS Worldwide Express');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_08', 'UPS Worldwide Expedited');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_14', 'UPS Next Day Air Early A.M.');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_54', 'UPS Worldwide Express Plus');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_65', 'UPS Saver');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_07', 'UPS Express');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_08', 'UPS Expedited');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_54', 'UPS Express Plus');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_65', 'UPS Saver');
+	// service 7 seems to be gone by Jan 2, 2007 for other origins
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_OTHER_ORIGIN_07', 'UPS Worldwide Express');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_OTHER_ORIGIN_08', 'UPS Worldwide Expedited');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_OTHER_ORIGIN_54', 'UPS Worldwide Express Plus');
+	define('MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_65', 'UPS Saver');
+	// SHIPPING_DAYS_DELAY is already defined as a constant in the table configuration as a number...
+	// define('SHIPPING_DAYS_DELAY', 'Shipping Delay');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/usps.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/usps.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/usps.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: usps.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  ++++ modified as USPS Methods 2.5 08/02/03 by Brad Waite and Fritz Clapp ++++
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_USPS_TEXT_TITLE', 'United States Postal Service');
+define('MODULE_SHIPPING_USPS_TEXT_DESCRIPTION', 'United States Postal Service<br><br>You will need to have registered an account with USPS at http://www.uspsprioritymail.com/et_regcert.html to use this module<br><br>USPS expects you to use pounds as weight measure for your products.');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_PP', 'Parcel Post');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_PM', 'Priority Mail');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_EX', 'Express Mail');
+define('MODULE_SHIPPING_USPS_TEXT_ERROR', 'An error occured with the USPS shipping calculations.<br>If you prefer to use USPS as your shipping method, please contact the store owner.');
+define('MODULE_SHIPPING_USPS_TEXT_DAY', 'Day');
+define('MODULE_SHIPPING_USPS_TEXT_DAYS', 'Days');
+define('MODULE_SHIPPING_USPS_TEXT_WEEKS', 'Weeks');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/zones.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ZONES_TEXT_TITLE', 'World Zone Rates');
+define('MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION', 'World Zone Based Rates');
+define('MODULE_SHIPPING_ZONES_TEXT_WAY', 'Shipping to');
+//define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'lb(s)');
+define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_ZONES_INVALID_ZONE', 'No shipping available to the selected country');
+define('MODULE_SHIPPING_ZONES_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping/zones_single.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping/zones_single.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping/zones_single.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_TITLE', 'Single Zone Rates');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_DESCRIPTION', 'Single Zone Based Rates');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_WAY', 'Shipping to');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_UNITS', 'lb(s)');
+define('MODULE_SHIPPING_ZONES_SINGLE_INVALID_ZONE', 'No shipping available to the selected country');
+define('MODULE_SHIPPING_ZONES_SINGLE_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/modules/shipping_estimator.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/shipping_estimator.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/shipping_estimator.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: shiupping estimator.php,v 1.1 2004/12/01  $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 CREloaded
+
+  Released under the GNU General Public License
+*/
+
+ define('SHIPPING_OPTIONS', 'Shipping Options:');
+ define('SHIPPING_OPTIONS_LOGIN_A', 'Please <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>, to display your personal shipping costs.');
+ define('SHIPPING_OPTIONS_LOGIN_B', 'Please Log In, to display your personal shipping costs.');
+  define('SHIPPING_METHOD_TEXT','Shipping Methods:');
+  define('SHIPPING_METHOD_RATES','Rates:');
+  define('SHIPPING_METHOD_TO','Ship to: ');
+  define('SHIPPING_METHOD_TO_NOLOGIN', 'Ship to: <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>');
+  define('SHIPPING_METHOD_FREE_TEXT','Free Shipping');
+  define('SHIPPING_METHOD_ALL_DOWNLOADS','- Downloads');
+  define('SHIPPING_METHOD_RECALCULATE','Recalculate');
+  define('SHIPPING_METHOD_ZIP_REQUIRED','true');
+  define('SHIPPING_METHOD_ADDRESS','Address:');
+  define('SHIPPING_METHOD_ITEM','ITEM:');
+  define('SHIPPING_METHOD_ITEMS','ITEMS:');
+  define('SHIPPING_METHOD_WEIGHT','Weight:');
+  define('SHIPPING_METHOD_WEIGHT_UNIT','lbs');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/modules/xsell_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/modules/xsell_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/modules/xsell_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: xsell_products.php, v1
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+  define('TEXT_XSELL_PRODUCTS', 'We Also Recommend :');
+  define('TEXT_BUY', 'Buy 1 \'');
+  define('TEXT_NOW', '\' now');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Navigation Menu');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_CATEGORIES_LINKS', 'Categories / Links');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Products Image:</b><small><br>Main Image used in <br><u>catalog & description</u> pages.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Small Image:</b><br><small> Image on<br><u>products list</u> pages.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Image:</b><br><small> Large Image on<br><u>pop-up window</u> page.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Store Product/s Sharing this Image =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Remove</b> this Image from this Product?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>Delete</b> this Image from the Server (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Remove');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'Delete');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Small Images.</b> If a "SM" image is used<br>(Alone) NO Pop-up window link is created, the "SM"<br> will be placed directly under the products<br>description. If used in conjunction with an <br>"XL" image on the right, a Pop-up Window Link<br> is created and the "XL" image will be<br>shown in a Pop-up window.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Large Images.</b> Used for the Pop-up image<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Additional Images - These will appear below product description if used.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Image 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Image 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Image 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Image 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Image 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Image 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Image 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Image 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Image 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Image 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Image 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Image 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DELETE_IMAGE', 'Delete Image');
+
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Category heading title:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Category heading Description:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Category Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Category Description Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Category Key Word Meta Tag :');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method :');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Product Keywords :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Edit Product Attributes');
+
+// Added for Navigation Menu DMG
+
+define('TEXT_LINKS','Links');
+define('TEXT_HEADING_EDIT_CATEGORY','Edit Navigation Category');
+define('TEXT_HEADING_NEW_LINK','Create New Navigation Link');
+define('TEXT_LINK_NAME','Link Text : ');
+define('TEXT_LINK_PAGE','Link Target : ');
+define('TEXT_STATUS','Link Status : ');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/pages.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: pages.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc
+  
+  Copyright &copy; 2006 Chain Reaction Works, Inc
+  
+  Last Modifed By : $Author$
+  Last Modified On :  $Date$
+  Latest Revision :  $Revision$
+  
+  
+*/
+
+define('NAVBAR_TITLE', 'Pages');
+
+define('HEADING_TITLE', 'Pages');
+define('TEXT_NO_PAGES', 'There are no pages to list in this category.');
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: password_forgotten.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Login');
+define('NAVBAR_TITLE_2', 'Password Forgotten');
+
+define('HEADING_TITLE', 'I\'ve Forgotten My Password!');
+
+define('TEXT_MAIN', 'If you\'ve forgotten your password, enter your e-mail address below and we\'ll send you an e-mail message containing your new password.');
+
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'Error: The E-Mail Address was not found in our records, please try again.');
+
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - New Password');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'A new password was requested from ' . $REMOTE_ADDR . '.' . "\n\n" . 'Your new password to \'' . STORE_NAME . '\' is:' . "\n\n" . '   %s' . "\n\n");
+
+define('SUCCESS_PASSWORD_SENT', 'Success: A new password has been sent to your e-mail address.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/popup_affiliate_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/popup_affiliate_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/popup_affiliate_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: popup_affiliate_help.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Infobox Help');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Infobox Help');
+
+define('HEADING_SUMMARY_HELP', 'Affiliate Help');
+define('TEXT_IMPRESSIONS_HELP', '<b>Impressions:</b> displays the total number of times a banner or link has been displayed in the given time period.');
+define('TEXT_VISITS_HELP', '<b>Visits:</b> represents the total number of click-throughs by visitors from your website.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Transactions:</b> represents the total number of successful transactions credited to your account.');
+define('TEXT_CONVERSION_HELP', '<b>Conversions:</b> represents the percentage of visitors (click-throughs) completing a transaction.');
+define('TEXT_AMOUNT_HELP', '<b>Amount:</b> represents the total sales value of delivered orders credited to your account.');
+define('TEXT_AVERAGE_HELP', '<b>Average:</b> represents the average sales value credited to your account.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Commission Rate</b> represents the rate you are paid for sales in a percentage format.');
+define('TEXT_COMMISSION_HELP', '<b>Commission</b> represents the total commission owed to you');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/popup_coupon_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/popup_coupon_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/popup_coupon_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: popup_coupon_help.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_COUPON_HELP', 'Discount Coupon Help');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+define('TEXT_COUPON_HELP_HEADER', 'Congratulations, you have redeemed a Discount Coupon.');
+define('TEXT_COUPON_HELP_NAME', '<br><br>Coupon Name : %s');
+define('TEXT_COUPON_HELP_FIXED', '<br><br>The coupon is worth %s discount against your order');
+define('TEXT_COUPON_HELP_MINORDER', '<br><br>You need to spend %s to use this coupon');
+define('TEXT_COUPON_HELP_FREESHIP', '<br><br>This coupon gives you free shipping on your order');
+define('TEXT_COUPON_HELP_DESC', '<br><br>Coupon Description: %s');
+define('TEXT_COUPON_HELP_DATE', '<br><br>The coupon is valid between %s and %s');
+define('TEXT_COUPON_HELP_RESTRICT', '<br><br>Product/Category Restrictions');
+define('TEXT_COUPON_HELP_CATEGORIES', 'Category');
+define('TEXT_COUPON_HELP_PRODUCTS', 'Product');
+define('TEXT_NONE', 'NONE');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/popup_image.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/popup_image.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/popup_image.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: popup_image.php,v 1.2 2004/01/18 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('TEXT_CLOSE_WINDOW', 'Click to Close Window [x]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/printorder.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/printorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/printorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: invoice.php,v 1.1 2003/05 xaglo
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TITLE_PRINT_ORDER', 'ORDER');
+
+define('TABLE_HEADING_COMMENTS', 'Yours comments');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Products');
+define('TABLE_HEADING_TAX', 'Tax');
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Price (ex)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Price (inc)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ex)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inc)');
+
+define('IMAGE_BUTTON_PRINT', 'Print');
+
+define('ENTRY_SOLD_TO', 'SOLD TO:');
+define('ENTRY_SHIP_TO', 'SHIP TO:');
+define('ENTRY_PAYMENT_METHOD', 'Payment Method:');
+
+define('ENTRY_DATE_PURCHASED', 'Date Purchased:');
+
+define('ENTRY_ACCESS_ERROR', 'You are not authorized to access this order.<br />If you feel you have received this message in error, please cotact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/product_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/product_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/product_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: product_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_PRODUCT_NOT_FOUND', 'Product not found!');
+define('TEXT_CURRENT_REVIEWS', 'Current Reviews:');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this products <a href="%s" target="_blank"><u>webpage</u></a>.');
+define('TEXT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#ff0000">This product will be in stock on %s.</font>');
+define('TEXT_ALSO_PURCHASED_PRODUCTS', 'Customers who bought this product also purchased');
+define('TEXT_PRODUCT_OPTIONS', 'Available Options:');
+define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
+define('TEXT_NO_MOPICS', 'Coming soon!');
+/*Eversun mod end for sppc and qty price breaks*/
+define('TEXT_ENTER_QUANTITY', 'Quantity');
+/*Eversun mod end for sppc and qty price breaks*/
+
+define("LINK_ALT","Make a link");
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/product_info_configureable.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/product_info_configureable.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/product_info_configureable.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: product_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_PRODUCT_NOT_FOUND', 'Product not found!');
+define('TEXT_CURRENT_REVIEWS', 'Current Reviews:');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this products <a href="%s" target="_blank"><u>webpage</u></a>.');
+define('TEXT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#ff0000">This product will be in stock on %s.</font>');
+define('TEXT_ALSO_PURCHASED_PRODUCTS', 'Customers who bought this product also purchased');
+define('TEXT_PRODUCT_OPTIONS', 'Available Options:');
+define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
+define('TEXT_NO_MOPICS', 'Coming soon!');
+/*Eversun mod end for sppc and qty price breaks*/
+define('TEXT_ENTER_QUANTITY', 'Quantity');
+define('TEXT_QUALITY_PRICE_CHART','Quantity Price Chart');
+/*Eversun mod end for sppc and qty price breaks*/
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/product_reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/product_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/product_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: product_reviews.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Reviews');
+
+define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
+
+define('TEXT_OF_5_STARS', '%s of 5 Stars!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/product_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/product_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/product_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: product_reviews_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Reviews');
+define('HEADING_TITLE', ' %s Reviews');
+define('SUB_TITLE_PRODUCT', 'Product:');
+define('SUB_TITLE_FROM', 'From:');
+define('SUB_TITLE_DATE', 'Date:');
+define('SUB_TITLE_REVIEW', 'Review:');
+define('SUB_TITLE_RATING', 'Rating:');
+define('TEXT_OF_5_STARS', '%s of 5 Stars!');
+define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/product_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/product_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/product_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: product_reviews_write.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Reviews');
+
+define('SUB_TITLE_FROM', 'From:');
+define('SUB_TITLE_REVIEW', 'Your Review:');
+define('SUB_TITLE_RATING', 'Rating:');
+
+define('TEXT_NO_HTML', '<small><font color="#ff0000"><b>NOTE:</b></font></small>&nbsp;HTML is not translated!');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>BAD</b></font></small>');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>GOOD</b></font></small>');
+
+define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/products_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/products_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/products_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: products_new.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'New Products');
+define('HEADING_TITLE', 'New Products');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_MANUFACTURER', 'Manufacturer:');
+define('TEXT_PRICE', 'Price:');
+
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/pw.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/pw.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/pw.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,8 @@
+<?php
+define('TEXT_ACCOUNT_CREATED','Your Account is now active !');
+define('TEXT_YOUR_ACCOUNT_ALREADY_EXIST', 'Your Account is already active!');
+define('HEADIN_TITLE', 'Account validation');
+define('NAVBAR_TITLE', 'Account validation');
+define('TEXT_ACCOUNT_CREATED_FAIL', 'The validation/activation code you entered is incorrect');
+define('TEXT_ACCOUNT_CREATED_FAIL2', 'The email address or validation/activation code you entered is not valid');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: reviews.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Reviews');
+define('HEADING_TITLE', 'Read What Others Are Saying');
+define('TEXT_OF_5_STARS', '%s of 5 Stars!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Shop by Price');
+define('HEADING_TITLE', 'Shop by Price');
+define('BOX_HEADING_SHOP_BY_PRICE', 'Shop By Price');
+define('TABLE_HEADING_IMAGE', '');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+
+define('TEXT_INFO_UNDER', 'Under&nbsp;');
+define('TEXT_INFO_FROM', 'From&nbsp;');
+define('TEXT_INFO_TO', '&nbsp;to&nbsp;');
+define('TEXT_INFO_ABOVE', '&nbsp;and above');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Cart Contents');
+define('HEADING_TITLE', 'What\'s In My Cart?');
+define('TABLE_HEADING_REMOVE', 'Remove');
+define('TABLE_HEADING_QUANTITY', 'Qty.');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product(s)');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TEXT_CART_EMPTY', 'Your Shopping Cart is empty!');
+define('SUB_TITLE_SUB_TOTAL', 'Sub-Total:');
+define('SUB_TITLE_TOTAL', 'Total:');
+
+define('OUT_OF_STOCK_CANT_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' don\'t exist in desired quantity in our stock.<br>Please alter the quantity of products marked with (' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '), Thank you');
+define('OUT_OF_STOCK_CAN_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' don\'t exist in desired quantity in our stock.<br>You can buy them anyway and check the quantity we have in stock for immediate deliver in the checkout process.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/specials.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: specials.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Specials');
+define('HEADING_TITLE', 'Get Them While They\'re Hot!');
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/ssl_check.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/ssl_check.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/ssl_check.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: ssl_check.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Security Check');
+define('HEADING_TITLE', 'Security Check');
+
+define('TEXT_INFORMATION', 'We have detected that your browser has generated a different SSL Session ID used throughout our secure pages.<br><br>For security measures you will need to logon to your account again to continue shopping online.<br><br>Some browsers such as Konqueror 3.1 does not have the capability of generating a secure SSL Session ID automatically which we require. If you use such a browser, we recommend switching to another browser such as <a href="http://www.microsoft.com/ie/" target="_blank">Microsoft Internet Explorer</a>, <a href="http://channels.netscape.com/ns/browsers/download_other.jsp" target="_blank">Netscape</a>, or <a href="http://www.mozilla.org/releases/" target="_blank">Mozilla</a>, to continue your online shopping experience.<br><br>We have taken this measurement of security for your benefit, and apologize upfront if any inconveniences are caused.<br><br>Please contact the store owner if you have any questions relating to this requirement, or to continue purchasing products offline.');
+
+define('BOX_INFORMATION_HEADING', 'Privacy and Security');
+define('BOX_INFORMATION', 'We validate the SSL Session ID automatically generated by your browser on every secure page request made to this server.<br><br>This validation assures that it is you who is navigating on this site with your account and not somebody else.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Tell A Friend');
+
+define('HEADING_TITLE', 'Tell A Friend About \'%s\'');
+
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Your Details');
+define('FORM_TITLE_FRIEND_DETAILS', 'Your Friends Details');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Your Message');
+
+define('FORM_FIELD_CUSTOMER_NAME', 'Your Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Your E-Mail Address:');
+define('FORM_FIELD_FRIEND_NAME', 'Your Friends Name:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Your Friends E-Mail Address:');
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email about <b>%s</b> has been successfully sent to <b>%s</b>.');
+
+define('TEXT_EMAIL_SUBJECT', 'Your friend %s has recommended this great product from %s');
+define('TEXT_EMAIL_INTRO', 'Hi %s!' . "\n\n" . 'Your friend, %s, thought that you would be interested in %s from %s.');
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE', 'To view the article click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE_TEXT', 'To view the article copy and paste the link into your web browser:' . "\n\n");
+
+define('TEXT_EMAIL_SIGNATURE', 'Regards,' . "\n\n");
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/tell_a_friend_article.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/tell_a_friend_article.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/tell_a_friend_article.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Tell A Friend');
+
+define('HEADING_TITLE', 'Tell A Friend About \'%s\'');
+
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Your Details');
+define('FORM_TITLE_FRIEND_DETAILS', 'Your Friends Details');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Your Message');
+
+define('FORM_FIELD_CUSTOMER_NAME', 'Your Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Your E-Mail Address:');
+define('FORM_FIELD_FRIEND_NAME', 'Your Friends Name:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Your Friends E-Mail Address:');
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email about <b>%s</b> has been successfully sent to <b>%s</b>.');
+
+define('TEXT_EMAIL_SUBJECT', 'Your friend %s has recommended this great product from %s');
+define('TEXT_EMAIL_INTRO', 'Hi %s!' . "\n\n" . 'Your friend, %s, thought that you would be interested in %s from %s.');
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE', 'To view the article click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE_TEXT', 'To view the article copy and paste the link into your web browser:' . "\n\n");
+
+define('TEXT_EMAIL_SIGNATURE', 'Regards,' . "\n\n");
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/english/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: products_new.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Upcoming Products');
+define('HEADING_TITLE', 'Upcoming Products');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_MANUFACTURER', 'Manufacturer:');
+define('TEXT_PRICE', 'Price:');
+define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: login.php,v 1.15 2003/06/09 22:46:46 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+function get_ip() {
+if (isset($_SERVER)) {
+if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
+$ip = $_SERVER['HTTP_CLIENT_IP'];
+} else {
+$ip = $_SERVER['REMOTE_ADDR'];
+}
+} else {
+if ( getenv('HTTP_X_FORWARDED_FOR') ) {
+$ip = getenv('HTTP_X_FORWARDED_FOR');
+} elseif ( getenv('HTTP_CLIENT_IP') ) {
+$ip = getenv('HTTP_CLIENT_IP');
+} else {
+$ip = getenv('REMOTE_ADDR');
+}
+}
+return $ip; 
+}
+$user_ip = get_ip();
+
+
+define('NAVBAR_TITLE_1', 'Account');
+define('NAVBAR_TITLE_2', 'Account Validation');
+define('HEADING_TITLE', 'Account Validation');
+define('TEXT_MAIN', 'Do you need a new Validation Link ?');
+define('ENTRY_EMAIL_ADDRESS', 'Emailadress: ');
+define('SUCCESS_REGISTRATION_CODE_SENT', 'Your new validation code was sent. Please check your email account');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'This email address is not registered');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Your Validation Code is');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'We received a request from the IP ' . $user_ip . ' to renew your Validation Code.' . "\n\n" . 'Your Validation Code for \'' . STORE_NAME . '\' :' . "\n\n" . '%s' . "\n\n");
+define('EMAIL_PASSWORD_REMINDER_BODY2', 'Please follow this link to validate your account: %s' . "\n\n");
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/whos_onlinebox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/whos_onlinebox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/whos_onlinebox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.1 2004/05/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+define('BOX_WHOS_ONLINE_THEREIS', 'There currently is');
+define('BOX_WHOS_ONLINE_THEREARE', 'There currently are');
+define('BOX_WHOS_ONLINE_GUEST', 'guest');
+define('BOX_WHOS_ONLINE_GUESTS', 'guests');
+define('BOX_WHOS_ONLINE_AND', 'and');
+define('BOX_WHOS_ONLINE_MEMBER', 'member');
+define('BOX_WHOS_ONLINE_MEMBERS', 'members');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: wishlist.php,v 1 2004/09/12
+
+  OS Commerce - Community Made Shopping!
+  http://www.oscommerce.com
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'My Wishlist');
+define('HEADING_TITLE', 'My Wishlist contains:');
+define('BOX_TEXT_PRICE', 'Price:');
+define('BOX_TEXT_SEND', 'Email your Wishlist to a friend.');
+define('BOX_TEXT_MOVE_TO_CART', 'Move to Cart');
+define('BOX_TEXT_DELETE', 'Delete');
+define('BOX_TEXT_VIEW', 'Show');
+define('BOX_TEXT_HELP', 'Help');
+define('BOX_TEXT_SELECTED_PRODUCTS', 'Selected Products');
+define('BOX_TEXT_SELECT_PRODUCT', 'Select Product ');
+
+define('BOX_TEXT_NO_ITEMS', 'No products are in your Wishlist. <br><br><b><a href="wishlist_help.php"><u>Click here</u></a> for help on using your Wishlist</b>');
+define('TEXT_WISHLIST_COUNT', 'Currently %s items are on your Wishlist.');
+define('TEXT_DISPLAY_NUMBER_OF_WISHLIST', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> items on your wishlist)');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/wishlist_email.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/wishlist_email.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/wishlist_email.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: wishlist_email.php,v 1 2003/11/20
+
+  OS Commerce - Community Made Shopping!
+  http://www.oscommerce.com
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+
+define('NAVBAR_TITLE', 'Send your Wishlist');
+define('HEADING_TITLE', 'Send your Wishlist to a friend.');
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Your Details');
+define('FORM_FIELD_CUSTOMER_NAME', 'Your Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Your Email Address:');
+define('FORM_TITLE_FRIEND_DETAILS', 'Your Friend\'s Details');
+define('FORM_FIELD_FRIEND_NAME', 'Your Friend\'s Name:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Your Friend\'s Email Address:');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Add a Personal Message Here');
+define('FORM_FIELD_TEXT_AREA', 'My Wishlist contains:'. "\n\n");
+
+define('FORM_FIELD_PRODUCTS', 'Products on my wish list'. "\n\n");
+
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email has been successfully sent to <b>%s</b> at the email adress <b>%s</b>.');
+define('TEXT_EMAIL_SUBJECT', 'Your friend %s wants to share his Wishlist at %s');
+define('TEXT_EMAIL_INTRO', 'Hi %s,' . "\n\n" . '%s has created a Wishlist at %s which they would like to share with you.');
+define('TEXT_EMAIL_SIGNATURE', 'Regards,' . "\n\n");
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below :' . "\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n");
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/wishlist_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/wishlist_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/wishlist_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: wishlist_help.php,v 1 2002/11/09
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'My Wishlist F.A.Q.');
+define('HEADING_TITLE', 'My Wishlist F.A.Q.');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('TEXT_INFORMATION', '<b>What is ' . BOX_HEADING_CUSTOMER_WISHLIST . '?</b><br>' .
+BOX_HEADING_CUSTOMER_WISHLIST . ' is a way to save items of interest to a holding area until ready to purchase.  <span class="errorText">If you are not a current customer, please at least create a wishlist account to save your shopping cart contents for when you return. Credit card information is NOT required to create a wishlist account.</span><br>
+<br>
+<b>How do I add items to ' . BOX_HEADING_CUSTOMER_WISHLIST . '? </b><br>
+To add an item to ' . BOX_HEADING_CUSTOMER_WISHLIST . ', just click the "Add to Wishlist" button for any item that interests you. The "Add to Wishlist" button appears next to the "Add to Cart" button in the product info pages.
+<br>
+<br>
+<b>Can I add "out-of-stock" items or "coming-soon items"?</b><br>
+Yes. You can add any item you choose to ' . BOX_HEADING_CUSTOMER_WISHLIST .
+'<br>
+<br>
+<b>How do I view ' . BOX_HEADING_CUSTOMER_WISHLIST . '?</b><br>
+On the right column is a "' . BOX_HEADING_CUSTOMER_WISHLIST . '" box.  This box shows the current status of ' . BOX_HEADING_CUSTOMER_WISHLIST . '.  If there are 4 or less items in ' . BOX_HEADING_CUSTOMER_WISHLIST . ', they will be listed here.  If there are more than 4 items, there will be a simple counter with the total number of items in ' . BOX_HEADING_CUSTOMER_WISHLIST . '.  You can change the total number of items in the box via the Administration area.
+<br>
+<br>
+' . BOX_HEADING_CUSTOMER_WISHLIST . ' may be viewed at any time by clicking either the link found in the "' . BOX_HEADING_CUSTOMER_WISHLIST . '" box (<i><u>View ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</i>).  or by clicking the right arrow on the "' . BOX_HEADING_CUSTOMER_WISHLIST . '" box.
+<br>
+<br>
+<b>How do I move ' . BOX_HEADING_CUSTOMER_WISHLIST . ' items to my Shopping Cart?</b><br>
+To move ' . BOX_HEADING_CUSTOMER_WISHLIST . ' items to the Shopping Cart, either click "Move to Cart" under the product name in the "' . BOX_HEADING_CUSTOMER_WISHLIST . '" box (if the ' . BOX_HEADING_CUSTOMER_WISHLIST . ' items are shown in the box) or check the "Move to Cart" checkbox next to the item(s) on the ' . BOX_HEADING_CUSTOMER_WISHLIST . ' main page and click the "Update" button.
+<br>
+<br>
+<b>How do I remove items from ' . BOX_HEADING_CUSTOMER_WISHLIST . '?</b><br>
+To remove items from ' . BOX_HEADING_CUSTOMER_WISHLIST . ', either click "Delete" under the item\'s name in the "' . BOX_HEADING_CUSTOMER_WISHLIST . '" box or check the "Delete" checkbox next to the item(s) on the ' . BOX_HEADING_CUSTOMER_WISHLIST . ' main page and click the "Update" button.
+<br>
+<br>
+<b>Can I "remove" and "move to cart" at the same time?</b><br>
+Yes.  On the ' . BOX_HEADING_CUSTOMER_WISHLIST . ' mainpage, you can check the boxes next to the item(s) you want to "Delete" and "Move to cart" and click the "Update" button to perform all operations simultaneously.
+<br>
+<br>
+<b> Can I make ' . BOX_HEADING_CUSTOMER_WISHLIST . ' available to others? </b><br>
+Sorry. Currently ' . BOX_HEADING_CUSTOMER_WISHLIST . ' is only "saved" when you create / log in to your account. Therefore, you are the only one that can see it.  However, you can email your wishlist to a friend by visiting the ' . BOX_HEADING_CUSTOMER_WISHLIST . ' main page, entering their email address into the \'send your wishlist to a friend\' box and clicking the email envelope.
+');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/english/wpcallback.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english/wpcallback.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english/wpcallback.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: wpcallback.php,v MS1a 2003/04/06 21:30
+  Author :  Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.4
+
+  Revisions:
+  Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+          Now posting language code to WP, Redirect on failure now to Checkout Payment,
+      Reduced re-direct time to 8 seconds, added MD5, made callback dynamic 
+      NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+  Version 1.4 Removes boxes to prevent users from clicking away before update, 
+      Fixes currency for Yen, 
+      Redirects to Checkout_Process after 10 seconds or click by user
+  Version 1.3 Fixes problem with Multi Currency
+  Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+  Version 1.1 Added Worldpay Pre-Authorisation ability
+  Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'WorldPay');
+define('WP_TEXT_HEADING', 'Response from WorldPay:');
+define('HEADING_TITLE', 'Thank you for shopping with ' . STORE_NAME . ' .... ');
+define('WP_TEXT_SUCCESS', '... your payment was successfully received.');
+define('WP_TEXT_SUCCESS_WAIT', '<b><font color="#FF0000">Please wait...</font></b> whilst we finish processing your order.<br>If you are not automatically re-directed in 10 seconds, please click continue.');
+define('WP_TEXT_FAILURE', '... Your payment has been cancelled!');
+define('WP_TEXT_FAILURE_WAIT', '<b><font color="#FF0000">Please wait...</font></b><br>If you are not automatically re-directed in 10 seconds, please click continue.');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/english.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/english.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/english.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,737 @@
+<?php
+/*
+  $Id: english.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// look in your $PATH_LOCALE/locale directory for available locales
+// or type locale -a on the server.
+// Examples:
+// on RedHat try 'en_US'
+// on FreeBSD try 'en_US.ISO_8859-1'
+// on Windows try 'en', or 'English'
+
+//VVC Constants
+define('VISUAL_VERIFY_CODE_CHARACTER_POOL', 'abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789FJWNVB63HDLAJAF');  //no zeros or O
+define('VISUAL_VERIFY_CODE_CATEGORY', 'Verify security code');
+define('VISUAL_VERIFY_CODE_ENTRY_ERROR', 'The security code you entered did not match the one displayed.');
+define('VISUAL_VERIFY_CODE_ENTRY_TEXT', '*');
+define('VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS', 'Type security code here:');
+define('VISUAL_VERIFY_CODE_BOX_IDENTIFIER', '<- Security Code');
+
+// this  is used to switch between US and UK formates
+if (ENGLISH_LANGAUGE_SET == 'uk'){
+
+ @setlocale(LC_TIME, 'en_UK.ISO_8859-1'); // #Credits to Brian Sim (aka Simmy) http://forums.oscommerce.com/index.php?showtopic=129520&st=0&p=520992&##
+define('DATE_FORMAT_SHORT', '%d/%m/%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
+define('DATE_FORMAT', 'd/m/Y'); // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+////
+// Return date in raw format GB Format
+// $date should be in format mm/dd/yyyy
+// raw date is in format YYYYMMDD, or DDMMYYYY
+function tep_date_raw($date, $reverse = false) {
+  if ($reverse) {
+    return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
+  }
+}
+
+// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
+define('LANGUAGE_CURRENCY', 'GBP');
+
+define('DOB_FORMAT_STRING', 'dd/mm/yyyy');
+
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class=\'errorText\'>(eg. 21/05/1970)</span>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 21/05/1970)');
+
+
+define('ENTRY_SUBURB', 'Address Line 2:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+
+define('ENTRY_POST_CODE', 'Post Code:');
+define('ENTRY_POST_CODE_ERROR', 'Your Post Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');
+
+
+define('ENTRY_STATE', 'County/State:');
+define('ENTRY_STATE_ERROR', 'Your County/State must contain a minimum of ' . ENTRY_STATE_MIN_LENGTH . ' characters.');
+define('ENTRY_STATE_ERROR_SELECT', 'Please select a county/state from the County/State pull down menu.');
+
+
+} else {
+ at setlocale(LC_TIME, 'en_US.ISO_8859-1');
+define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
+define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+
+//function tep_date_raw($date, $reverse = false) {
+
+function tep_date_raw($date, $reverse = false) {
+  if ($reverse) {
+    return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
+  }
+}
+
+// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
+define('LANGUAGE_CURRENCY', 'USD');
+
+// text for date of birth example
+define('DOB_FORMAT_STRING', 'mm/dd/yyyy');
+
+
+define('ENTRY_DATE_OF_BIRTH_ERROR', '&nbsp;<span class=\'errorText\'>(eg. 05/21/1970)</span>');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)');
+
+//US format
+define('ENTRY_SUBURB', 'Suburb:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+
+// US format
+define('ENTRY_POST_CODE', 'Zip Code:');
+define('ENTRY_POST_CODE_ERROR', 'Your Zip Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');
+
+define('ENTRY_STATE', 'State/Province:');
+define('ENTRY_STATE_ERROR', 'Your State must contain a minimum of ' . ENTRY_STATE_MIN_LENGTH . ' characters.');
+define('ENTRY_STATE_ERROR_SELECT', 'Please select a state from the States pull down menu.');
+
+}
+
+//#################################
+// Global entries for the <html> tag
+define('HTML_PARAMS','dir="LTR" lang="en"');
+
+// charset for web pages and emails
+define('CHARSET', 'iso-8859-1');
+
+// page title
+define('TITLE', 'Your Store Name, change in catalog/includes/languages/   your language');
+
+// ######## CCGV
+define('BOX_INFORMATION_GV', 'Gift Voucher FAQ');
+define('VOUCHER_BALANCE', 'Voucher Balance');
+define('BOX_HEADING_GIFT_VOUCHER', 'Gift Voucher Account'); 
+define('GV_FAQ', 'Gift Voucher FAQ');
+define('ERROR_REDEEMED_AMOUNT', 'Congratulations, you have redeemed ');
+define('ERROR_NO_REDEEM_CODE', 'You did not enter a redeem code.');  
+define('ERROR_NO_INVALID_REDEEM_GV', 'Invalid Gift Voucher Code'); 
+define('TABLE_HEADING_CREDIT', 'Credits Available');
+define('GV_HAS_VOUCHERA', 'You have funds in your Gift Voucher Account. If you want <br>
+                         you can send those funds by <a class="pageResults" href="');
+       
+define('GV_HAS_VOUCHERB', '"><b>email</b></a> to someone'); 
+define('ENTRY_AMOUNT_CHECK_ERROR', 'You do not have enough funds to send this amount.'); 
+define('BOX_SEND_TO_FRIEND', 'Send Gift Voucher');
+
+define('VOUCHER_REDEEMED', 'Voucher Redeemed');
+define('CART_COUPON', 'Coupon :');
+define('CART_COUPON_INFO', 'more info');
+define('MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR', 'Coupon Redemption');
+define('ERROR_REDEEMED_AMOUNT_ZERO', "***No reduction currently available, please see the coupon restrictions***");
+// header text in includes/header.php
+define('HEADER_TITLE_CREATE_ACCOUNT', 'Create an Account');
+define('HEADER_TITLE_MY_ACCOUNT', 'My Account');
+define('HEADER_TITLE_CART_CONTENTS', 'Cart Contents');
+define('HEADER_TITLE_CHECKOUT', 'Checkout');
+define('HEADER_TITLE_TOP', 'Top');
+define('HEADER_TITLE_CATALOG', 'Catalog');
+define('HEADER_TITLE_LOGOFF', 'Log Off');
+define('HEADER_TITLE_LOGIN', 'Log In');
+
+// footer text in includes/footer.php
+define('FOOTER_TEXT_REQUESTS_SINCE', 'requests since');
+
+// text for gender
+define('MALE', 'Male');
+define('FEMALE', 'Female');
+define('MALE_ADDRESS', 'Mr.');
+define('FEMALE_ADDRESS', 'Ms.');
+
+
+// categories mainpage
+define('BOX_HEADING_CATEGORIES_MAIN_PAGE', 'Categories');
+
+
+// quick_find box text in includes/boxes/quick_find.php
+define('BOX_SEARCH_TEXT', 'Use keywords to find the product you are looking for.');
+define('BOX_SEARCH_ADVANCED_SEARCH', 'Advanced Search');
+
+
+// reviews box text in includes/boxes/reviews.php
+
+define('BOX_REVIEWS_WRITE_REVIEW', 'Write a review on this product!');
+define('BOX_REVIEWS_NO_REVIEWS', 'There are currently no product reviews');
+define('BOX_REVIEWS_TEXT_OF_5_STARS', '%s of 5 Stars!');
+
+// shopping_cart box text in includes/boxes/shopping_cart.php
+
+define('BOX_SHOPPING_CART_EMPTY', '0 items');
+
+
+// best_sellers box text in includes/boxes/best_sellers.php
+define('BOX_HEADING_BESTSELLERS_IN', 'Bestsellers in<br>&nbsp;&nbsp;');
+
+// notifications box text in includes/boxes/products_notifications.php
+
+define('BOX_NOTIFICATIONS_NOTIFY', 'Notify me of updates to <b>%s</b>');
+define('BOX_NOTIFICATIONS_NOTIFY_REMOVE', 'Do not notify me of updates to <b>%s</b>');
+
+// manufacturer box text
+
+define('BOX_MANUFACTURER_INFO_HOMEPAGE', '%s Homepage');
+define('BOX_MANUFACTURER_INFO_OTHER_PRODUCTS', 'Other products');
+
+// tell a friend box text in includes/boxes/tell_a_friend.php
+define('BOX_TELL_A_FRIEND_TEXT', 'Tell someone you know about this product.');
+
+//BEGIN allprods modification
+define('BOX_INFORMATION_ALLPRODS', 'View All Products');
+//END allprods modification
+
+//BEGIN all categories and products modification
+define ('ALL_PRODUCTS_LINK', 'All Products sorted by Categories');
+//END categories and products modification
+
+//BEGIN all categories and products modification
+define ('ALL_PRODUCTS_MANF', 'All Products sorted by Manufacturers');
+//END categories and products modification
+// VJ Links Manager v1.00 begin
+define('BOX_INFORMATION_LINKS', 'Links');
+// VJ Links Manager v1.00 end
+
+// checkout procedure text
+define('CHECKOUT_BAR_DELIVERY', 'Delivery Information');
+define('CHECKOUT_BAR_PAYMENT', 'Payment Information');
+define('CHECKOUT_BAR_CONFIRMATION', 'Confirmation');
+define('CHECKOUT_BAR_FINISHED', 'Finished!');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Please Select');
+define('TYPE_BELOW', 'Type Below');
+
+// javascript messages
+define('JS_ERROR', 'Errors have occured during the process of your form.\n\nPlease make the following corrections:\n\n');
+
+define('JS_REVIEW_TEXT', '* The \'Review Text\' must have at least ' . REVIEW_TEXT_MIN_LENGTH . ' characters.\n');
+define('JS_REVIEW_RATING', '* You must rate the product for your review.\n');
+
+define('JS_ERROR_NO_PAYMENT_MODULE_SELECTED', '* Please select a payment method for your order.\n');
+
+define('JS_ERROR_SUBMITTED', 'This form has already been submitted. Please press Ok and wait for this process to be completed.');
+
+define('ERROR_NO_PAYMENT_MODULE_SELECTED', 'Please select a payment method for your order.');
+
+define('CATEGORY_COMPANY', 'Company Details');
+define('CATEGORY_PERSONAL', 'Your Personal Details');
+define('CATEGORY_ADDRESS', 'Your Address');
+define('CATEGORY_CONTACT', 'Your Contact Information');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Your Password');
+
+define('ENTRY_COMPANY', 'Company Name:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Gender:');
+define('ENTRY_GENDER_ERROR', 'Please select your Gender.');
+define('ENTRY_GENDER_TEXT', '*');
+define('ENTRY_FIRST_NAME', 'First Name:');
+define('ENTRY_FIRST_NAME_ERROR', 'Your First Name must contain a minimum of ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.');
+define('ENTRY_FIRST_NAME_TEXT', '*');
+define('ENTRY_LAST_NAME', 'Last Name:');
+define('ENTRY_LAST_NAME_ERROR', 'Your Last Name must contain a minimum of ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.');
+define('ENTRY_LAST_NAME_TEXT', '*');
+
+
+
+//define ENTRY_DATE_OF_BIRTH_TEXT and ENTRY_DATE_OF_BIRTH_ERROR
+// moved to UK/US section above
+define('ENTRY_DATE_OF_BIRTH', 'Date of Birth:');
+
+define('ENTRY_EMAIL_ADDRESS', 'E-Mail Address:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', 'Your E-Mail Address must contain a minimum of ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' characters.');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', 'Your E-Mail Address does not appear to be valid - please make any necessary corrections.');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', 'Your E-Mail Address already exists in our records - please log in with the e-mail address or create an account with a different address.');
+define('ENTRY_EMAIL_CHECK_ERROR', 'There has been an error with sending this email please! Contact the store owner.');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '*');
+define('ENTRY_STREET_ADDRESS', 'Street Address:');
+define('ENTRY_STREET_ADDRESS_ERROR', 'Your Street Address must contain a minimum of ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.');
+define('ENTRY_STREET_ADDRESS_TEXT', '*');
+
+
+// ENTRY_SUBURB, ENTRY_SUBURB_ERROR, ENTRY_SUBURB_TEXT move to us/uk
+//section above
+
+// ENTRY_POST_CODE, ENTRY_POST_CODE_ERROR
+//moved to us/uk section above
+define('ENTRY_POST_CODE_TEXT', '*');
+
+define('ENTRY_CITY', 'City:');
+define('ENTRY_CITY_ERROR', 'Your City must contain a minimum of ' . ENTRY_CITY_MIN_LENGTH . ' characters.');
+define('ENTRY_CITY_TEXT', '*');
+
+
+//define ENTRY_STATE, ENTRY_STATE_ERROR, ENTRY_STATE_ERROR_SELECT
+// see uk/us section above
+
+//GB format
+define('ENTRY_STATE_TEXT', '*');
+
+
+define('ENTRY_COUNTRY', 'Country:');
+define('ENTRY_COUNTRY_ERROR', 'You must select a country from the Countries pull down menu.');
+define('ENTRY_COUNTRY_TEXT', '*');
+define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', 'Your Telephone Number must contain a minimum of ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');
+define('ENTRY_FAX_NUMBER', 'Fax Number:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Subscribed');
+define('ENTRY_NEWSLETTER_NO', 'Unsubscribed');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Password:');
+define('ENTRY_PASSWORD_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_ERROR_NOT_MATCHING', 'The Password Confirmation must match your Password.');
+define('ENTRY_PASSWORD_TEXT', '*');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Password Confirmation:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT', 'Current Password:');
+define('ENTRY_PASSWORD_CURRENT_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW', 'New Password:');
+define('ENTRY_PASSWORD_NEW_TEXT', '*');
+define('ENTRY_PASSWORD_NEW_ERROR', 'Your new Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');
+define('ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING', 'The Password Confirmation must match your new Password.');
+define('PASSWORD_HIDDEN', '--HIDDEN--');
+
+define('FORM_REQUIRED_INFORMATION', '* Required information');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_RESULT_PAGE', 'Result Pages:');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> products)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> orders)');
+define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> reviews)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> new products)');
+define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> specials)');
+define('TEXT_DISPLAY_NUMBER_OF_FEATURED', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> featured products)');
+
+define('PREVNEXT_TITLE_FIRST_PAGE', 'First Page');
+define('PREVNEXT_TITLE_PREVIOUS_PAGE', 'Previous Page');
+define('PREVNEXT_TITLE_NEXT_PAGE', 'Next Page');
+define('PREVNEXT_TITLE_LAST_PAGE', 'Last Page');
+define('PREVNEXT_TITLE_PAGE_NO', 'Page %d');
+define('PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE', 'Previous Set of %d Pages');
+define('PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE', 'Next Set of %d Pages');
+define('PREVNEXT_BUTTON_FIRST', '&lt;&lt;FIRST');
+define('PREVNEXT_BUTTON_PREV', '[&lt;&lt;&nbsp;Prev]');
+define('PREVNEXT_BUTTON_NEXT', '[Next&nbsp;&gt;&gt;]');
+define('PREVNEXT_BUTTON_LAST', 'LAST&gt;&gt;');
+
+define('IMAGE_BUTTON_ADD_ADDRESS', 'Add Address');
+define('IMAGE_BUTTON_ADDRESS_BOOK', 'Address Book');
+define('IMAGE_BUTTON_BACK', 'Back');
+define('IMAGE_BUTTON_BUY_NOW', 'Buy Now');
+define('IMAGE_BUTTON_CHANGE_ADDRESS', 'Change Address');
+define('IMAGE_BUTTON_CHECKOUT', 'Checkout');
+define('IMAGE_BUTTON_CONFIRM_ORDER', 'Confirm Order');
+define('IMAGE_BUTTON_CONTINUE', 'Continue');
+define('IMAGE_BUTTON_CONTINUE_SHOPPING', 'Continue Shopping');
+define('IMAGE_BUTTON_DELETE', 'Delete');
+define('IMAGE_BUTTON_EDIT_ACCOUNT', 'Edit Account');
+define('IMAGE_BUTTON_HISTORY', 'Order History');
+define('IMAGE_BUTTON_LOGIN', 'Sign In');
+define('IMAGE_BUTTON_IN_CART', 'Add to Cart');
+define('IMAGE_BUTTON_NOTIFICATIONS', 'Notifications');
+define('IMAGE_BUTTON_QUICK_FIND', 'Quick Find');
+define('IMAGE_BUTTON_REMOVE_NOTIFICATIONS', 'Remove Notifications');
+define('IMAGE_BUTTON_REVIEWS', 'Reviews');
+define('IMAGE_BUTTON_SEARCH', 'Search');
+define('IMAGE_BUTTON_SHIPPING_OPTIONS', 'Shipping Options');
+define('IMAGE_BUTTON_TELL_A_FRIEND', 'Tell a Friend');
+define('IMAGE_BUTTON_UPDATE', 'Update');
+define('IMAGE_BUTTON_UPDATE_CART', 'Update Cart');
+define('IMAGE_BUTTON_WRITE_REVIEW', 'Write Review');
+
+define('SMALL_IMAGE_BUTTON_DELETE', 'Delete');
+define('SMALL_IMAGE_BUTTON_EDIT', 'Edit');
+define('SMALL_IMAGE_BUTTON_VIEW', 'View');
+
+define('ICON_ARROW_RIGHT', 'more');
+define('ICON_CART', 'In Cart');
+define('ICON_ERROR', 'Error');
+define('ICON_SUCCESS', 'Success');
+define('ICON_WARNING', 'Warning');
+
+define('TEXT_CUSTOMER_GREETING_HEADER', 'Our Customer Greeting');
+define('TEXT_GREETING_PERSONAL', 'Welcome back <span class="greetUser">%s!</span> Would you like to see which <a href="%s"><u>new products</u></a> are available to purchase?');
+define('TEXT_GREETING_PERSONAL_RELOGON', '<small>If you are not %s, please <a href="%s"><u>log yourself in</u></a> with your account information.</small>');
+define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> Would you like to <a href="%s"><u>log yourself in</u></a>? Or would you prefer to <a href="%s"><u>create an account</u></a>?');
+
+define('TEXT_SORT_PRODUCTS', 'Sort products ');
+define('TEXT_DESCENDINGLY', 'descending');
+define('TEXT_ASCENDINGLY', 'ascending');
+define('TEXT_BY', ' by ');
+
+define('TEXT_REVIEW_BY', 'Review by %s');
+define('TEXT_REVIEW_WORD_COUNT', '%s words');
+define('TEXT_REVIEW_RATING', 'Rating: %s [%s]');
+define('TEXT_REVIEW_DATE_ADDED', 'Date Added: %s');
+define('TEXT_NO_REVIEWS', 'There are currently no product reviews.');
+
+define('TEXT_NO_NEW_PRODUCTS', 'There are currently no products.');
+
+define('TEXT_NO_PRODUCTS', 'There are currently no products in this range.');
+
+define('TEXT_UNKNOWN_TAX_RATE', 'Unknown tax rate');
+
+define('TEXT_REQUIRED', '<span class="errorText">Required</span>');
+
+// Down For Maintenance
+define('TEXT_BEFORE_DOWN_FOR_MAINTENANCE', 'NOTICE: This website will be down for maintenance on: ');
+define('TEXT_ADMIN_DOWN_FOR_MAINTENANCE', 'NOTICE: The website is currently Down For Maintenance to the public');
+
+define('ERROR_TEP_MAIL', '<font face="Verdana, Arial" size="2" color="#ff0000"><b><small>TEP ERROR:</small> Cannot send the email through the specified SMTP server. Please check your php.ini setting and correct the SMTP server if necessary.</b></font>');
+define('WARNING_INSTALL_DIRECTORY_EXISTS', 'Warning: Installation directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install. Please remove this directory for security reasons.');
+define('WARNING_UPGRADES_DIRECTORY_EXISTS', 'Warning: Upgrades directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/upgrades. Please remove this directory for security reasons.');
+define('WARNING_CONFIG_FILE_WRITEABLE', 'Warning: I am able to write to the configuration file: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
+define('WARNING_SESSION_DIRECTORY_NON_EXISTENT', 'Warning: The sessions directory does not exist: ' . tep_session_save_path() . '. Sessions will not work until this directory is created.');
+define('WARNING_SESSION_DIRECTORY_NOT_WRITEABLE', 'Warning: I am not able to write to the sessions directory: ' . tep_session_save_path() . '. Sessions will not work until the right user permissions are set.');
+define('WARNING_SESSION_AUTO_START', 'Warning: session.auto_start is enabled - please disable this php feature in php.ini and restart the web server.');
+define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Warning: The downloadable products directory does not exist: ' . DIR_FS_DOWNLOAD . '. Downloadable products will not work until this directory is valid.');
+define('WARNING_ENCRYPT_FILE_MISSING', 'Warning: The Encryption key file is missing.');
+
+
+define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'Error: 01 The first four digits of the number entered are: %s If that number is correct, we do not accept that type of credit card.If it is wrong, please try again.');
+define('TEXT_CCVAL_ERROR_INVALID_MONTH', 'Error: 02 The expiry date Motnth entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_YEAR', 'Error: 03 The expiry date year entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Error: 04 The expiry date entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 05 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 05 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_SHORT', 'Error: 06 You have not entered the correct amount of digits. Please ensure you have entered all of the long number displayed on the front of your card');
+define('TEXT_CCVAL_ERROR_BLACKLIST', 'Error: 07 We cannot accept your card as it is blacklisted, if you feel you have recieved this message in error please contact your card issuer.');
+define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'Error: 08 The CCV/CVV/CID number entered is the incorrect length. Please try again.');
+define('TEXT_CCVAL_ERROR_NOT_ACCEPTED', 'Error: 09 The credit card number you have entered appears to be a %s card. Unfortunately at this time we do not accept %s as payment.');
+define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Error: 10 The credit card number entered is invalid. Please check the number for misstyped numbers and try again.');
+
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default Chainreaction-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+
+define('FOOTER_TEXT_BODY', 'Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a> and <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.creloaded.com" target="_blank">CRE Loaded Team</a><br>Using Version ' . PROJECT_VERSION );
+
+/////////////////////////////////////////////////////////////////////
+// HEADER.PHP
+// Header Links
+define('HEADER_LINKS_DEFAULT','HOME');
+define('HEADER_LINKS_WHATS_NEW','WHAT\'S NEW?');
+define('HEADER_LINKS_SPECIALS','SPECIALS');
+define('HEADER_LINKS_REVIEWS','REVIEWS');
+define('HEADER_LINKS_LOGIN','LOGIN');
+define('HEADER_LINKS_LOGOFF','LOG OFF');
+define('HEADER_LINKS_PRODUCTS_ALL','CATALOG');
+define('HEADER_LINKS_ACCOUNT_INFO','ACCOUNT INFO');
+define('HEADER_LINKS_LINKS','LINKS');
+define('HEADER_LINKS_FAQ','FAQS');
+define('HEADER_LINKS_NEWS','NEWS');
+define('HEADER_LINKS_INFORMATION','INFORMATION');
+/////////////////////////////////////////////////////////////////////
+
+// BOF: Lango added for print order mod
+define('IMAGE_BUTTON_PRINT_ORDER', 'Order printable');
+// EOF: Lango added for print order mod
+
+// WebMakers.com Added: Attributes Sorter
+require(DIR_WS_LANGUAGES . $language . '/' . 'attributes_sorter.php');
+
+// wishlist box text in includes/boxes/wishlist.php
+define('BOX_HEADING_CUSTOMER_WISHLIST', 'My Wishlist');
+define('BOX_WISHLIST_EMPTY', 'You have no items on your Wishlist');
+define('IMAGE_BUTTON_ADD_WISHLIST', 'Add to Wishlist');
+define('TEXT_WISHLIST_COUNT', 'Currently %s items are on your Wishlist.');
+define('TEXT_DISPLAY_NUMBER_OF_WISHLIST', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> items on your wishlist)');
+define('BOX_HEADING_CUSTOMER_WISHLIST_HELP', 'Wishlist Help');
+define('BOX_HEADING_SEND_WISHLIST', 'Send your Wishlist');
+define('BOX_TEXT_MOVE_TO_CART', 'Move to Cart');
+define('BOX_TEXT_DELETE', 'Delete');
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+// define('BOX_HEADING_INFORMATION', 'Info System');
+  define('BOX_INFORMATION_MANAGER', 'Info Manager');
+//DWD Modify End
+
+if(file_exists('includes/languages/english_newsdesk.php')) {
+include('includes/languages/english_newsdesk.php');
+include('includes/languages/english_faqdesk.php');
+}
+
+/*Begin Checkout Without Account images*/
+define('IMAGE_BUTTON_CREATE_ACCOUNT', 'Create Account');
+define('NAV_ORDER_INFO', 'Order Info');
+/*End Checkout WIthout Account images*/
+
+// Include for Events Calendar 2.0 Contribution 
+define('BOX_TOOLS_EVENTS_MANAGER', 'Events Manager');
+define('IMAGE_NEW_EVENT', 'New Event');
+
+// VJ guest pricing begin
+// ADDED for Viewprice
+// Text to replace price in InfoBoxes
+define('PRICES_LOGGED_IN_TEXT', 'Trade Price');
+// Text to replace price in Product Info, Specials & New Products lists
+define('PRICES_LOGGED_IN_SUBMIT','Trade Price');
+// Text to replace Buy 'Now button'
+define('PRICES_LOGGED_IN_BUY_TEXT', 'Trade Only');
+// END ViewPrice
+// VJ guest pricing end
+
+//Added for FAQ System 2.1 DMG
+
+  define('BOX_INFORMATION_FAQ', 'FAQ');
+
+//Added for Article Manager DMG
+
+// Article Manager
+define('BOX_HEADING_ARTICLES', 'Articles');
+define('BOX_ALL_ARTICLES', 'All Articles');
+define('BOX_NEW_ARTICLES', 'New Articles');
+define('TEXT_DISPLAY_NUMBER_OF_ARTICLES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> articles)');
+define('TEXT_DISPLAY_NUMBER_OF_ARTICLES_NEW', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> new articles)');
+define('TABLE_HEADING_AUTHOR', 'Author');
+define('TABLE_HEADING_ABSTRACT', 'Abstract');
+define('BOX_HEADING_AUTHORS', 'Articles by Author');
+define('NAVBAR_TITLE_DEFAULT', 'Articles');
+define('BOX_ASEARCH_TEXT','Search Articles Text');
+// Eversun mod for sppc and qty price breaks
+define('ENTRY_COMPANY_TAX_ID', 'Company\'s tax id number:');
+define('ENTRY_COMPANY_TAX_ID_ERROR', '');
+define('ENTRY_COMPANY_TAX_ID_TEXT', '');
+// Eversun mod end for sppc and qty price breaks  
+
+
+#################    Starts - 15 June 2006    #################
+
+
+define('IFRAME_ERROR','Sorry, you browser does not support iframes.');
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_1","You still have</br>");
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_2","</br>left to spend in your Gift Voucher Account<br><br>");
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_3","Send to a Friend");
+define("DONATE_BUTTON_IMAGE_ALT","Make payments with PayPal - it\'s fast, free and secure");
+
+
+#################    Ends - 15 June 2006    #################
+
+
+#################    Starts - 16 June 2006    #################
+
+
+define("LOGIN_ALT","login");
+define("LOGOFF_ALT","logoff");
+define("MYACCOUNT_ALT","MyAccount");
+define("SPECIALS_ALT","Specials");
+define("WHATS_NEW_ALT","What\'s New");
+define("CONTACT_US_ALT","Contact Us");
+define("IMAGE_ALT","image");
+define("BOX_ALT","box");
+
+#################    Ends - 16 June 2006    #################
+
+
+#################    Starts - 20 June 2006    #################
+
+//dayNames in calender
+define("S","S");
+define("M","M");
+define("T","T");
+define("W","W");
+define("T","T");
+define("F","F");
+define("S","S");
+
+//monthNames  in calender
+define("JANUARY","JANUARY");
+define("FEBRUARY","FEBRUARY");
+define("MARCH","MARCH");
+define("APRIL","APRIL");
+define("MAY","MAY");
+define("JUNE","JUNE");
+define("JULY","JULY");
+define("AUGUST","AUGUST");
+define("SEPTEMBER","SEPTEMBER");
+define("OCTOBER","OCTOBER");
+define("NOVEMBER","NOVEMBER");
+define("DECEMBER","DECEMBER");
+
+
+
+define("DELETE_CACHE_FILES",'cache files deleted - top level');
+define("UPDATE_CONFIGURATION_SETTING",'reset to false');
+define("UPDATE_CONFIG_FILES_EXIST",'configuration cache files updated');
+define("UPDATE_CONFIG_FILES_NOTEXIST",'ERROR: update file does not exist');
+define("IS_GUEST_CHECK",'customer_id not set');
+define("FILE_EXISTS_AND_IS_NOT_EXPIRED",'file exists and is not expired');
+define("NO_FILE_OR_EXPIRED",'file does not exist or is expired');
+define("OB_STARTED",'ob started @ ');
+define("IS_GUESS_CHECK_END",'customer_id not set ');
+define("OB_COMPRESSED",'output buffer flushed and compressed');
+define("CACHE_OUTPUTT",'compressed ob sent to screen');
+define("CACHE_WRITE_FILE",'compressed ob written to file');
+define("UNSET_CACHE_COMPRESS", 'cache compress unset');
+define("COMPRESS_BUFFER", 'compressing buffer');
+define("CACHE_FILE_WRITE", 'buffer writtent to file');
+define("CACHE_UNSET_WRITE_BUFFER", 'write buffer unset');
+define("OUTPUT_2_SCREEN", 'successfully output to screen');
+define("CACHE_UNSET_SCREEN_BUFFER", 'screen buffer unset');
+
+define("OPEN_SESSION_FILE_ERROR", 'Could not open session file');
+define("WRITE_SESSION_FILE_ERROR", 'Could not write session file');
+define("SESSION_MODULE_ERROR", 'Failed to initialize session module.');
+define("SESSION_NOT_SAVED", 'Session could not be saved.');
+define("SESSION_NOT_CLOSED", 'Session could not be closed.');
+define("SESSION_NOT_STARTED", 'Session could not be started.');
+
+///
+define("NO_BANNER_WITH_GROUP_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_GROUP_ERROR2", 'No banners with group');
+define("NO_BANNER_WITH_GROUP_ERROR3", ' found!</b>');
+define("NO_BANNER_WITH_ID_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_ID_ERROR2", 'Banner with ID');
+define("NO_BANNER_WITH_ID_ERROR3", ' not found, or status inactive</b>');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR2", 'Unknown');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR3", 'parameter value - it must be either');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR4", 'dynamic');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR5", 'static');
+define("TEP_DB_ERRORR", '[TEP STOP]');
+define("TEP_HREF_LINK_ERROR1", '<b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
+define("TEP_HREF_LINK_ERROR2", '<b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
+
+///
+
+#################    Ends - 20 June 2006    #################
+
+
+#################    Starts - 21 June 2006    #################
+
+
+
+define("CVV_HELP_TITLE","Card Verification Value (ccv/cvc/ccv2/cid) Help");
+define("CVV_HELP_DESC1","<p><strong>What is a Card Verification Value (ccv/cvc/ccv2/cid)?</strong>
+      </p>
+      <p>The Card Verification Value (ccv/cvc/ccv2/cid) is a 3-digit number found on the signature
+        panel on the back of your credit card. It is an additional safeguard that
+        helps us validate your purchase and protect against fraud. It is not contained
+        in the magnetic stripe information and is therefore not printed on sales
+        receipts.</p>
+      <p><strong>Where is the ccv/cvc/ccv2/cid located?</strong></p>");
+
+
+define("CVV_HELP_DESC2","<p><strong>VISA, MASTERCARD,  DISCOVERY &amp; most other cards</strong><br>
+        You can find your card verification code on the reverse side of your credit
+        card, printed into the signature field. It is a 3-digit group for MasterCard,
+        Visa, Discovery, and most other cards.<br>
+      </p> ");
+
+
+define("CVV_HELP_DESC3","<p><strong>AMERICAN EXPRESS</strong><br>
+        The American Express Card verification code is a 4-digit number printed
+        on the front of your card. It appears after and to the right (above) of
+        your card number.<br>
+      </p>");
+
+
+#################    Start - 23 June 2006   #################
+
+define("INFO_CC_1","Make Shopping Easier for Customers with Website Payments");
+define("INFO_CC_2",''.tep_image(DIR_WS_MODULES . 'payment/paypal/images/hdr_ppGlobev4_160x76.gif',' PayPal ','','','align=right valign="top" style="margin: 10px;"').'
+PayPal has optimized their checkout experience by launching an exciting new improvement to their payment flow.
+<br/><br/>For new buyers, signing up for a PayPal account is now optional. This means you can complete your payment first, and then decide whether to save your information for future purchases.
+<p>To pay by credit card, look for this button:<br/>
+<p align="center">'.tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-ContinueCheckout.gif','','','').'</p>
+<br/>
+Or you may see this:<br/>
+<p align="center">'.tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-no-account-Click-Here.gif','','','').'</p>
+<br/>
+One of these options should appear on the first PayPal screen.<br/>
+<p>Note: if you are a PayPal member, you can either use your account,
+or use a credit card that is not associated with a PayPal account.
+In that case you\'d also need to use an email address that\'s not associated with a PayPal account.</p> ');
+
+
+define("PAYPAL_SHOPPING_CART_IPN_SUBJECT","PayPal_Shopping_Cart_IPN");
+define("PAYPAL_SHOPPING_CART_IPN_FROM","PayPal_Shopping_Cart_IPN");
+
+#################    End - 23 June 2006   #################
+
+
+#################    Start - 28 June 2006   #################
+
+define("BOX_HEADING_CUSTOMER_WISHLIST_VIEW","My Wishlist View");
+define("BOX_HEADING_CUSTOMER_WISHLIST_HELP","My Wishlist Help");
+
+#################    End - 28 June 2006   #################
+
+
+#################    Start - 29 June 2006   #################
+
+
+define("VIEWPRICE_ERROR",'You must be logged in to search for prices.');
+
+define("UNABLE_TO_CONNECT_TO_DATABASE_SERVER",'Unable to connect to database server!');
+define("AFFILIATE_SHOW_BANNER_CHECK_PATHES",'Check the pathes! (catalog/includes/configure.php)');
+define("AFFILIATE_SHOW_BANNER_ABSOLUTE_PATH",'absolute path to picture:');
+define("AFFILIATE_SHOW_BANNER_BUILD_WITH_1",'build with:');
+define("AFFILIATE_SHOW_BANNER_BUILD_WITH_2",'DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG . DIR_WS_IMAGES . $banner');
+define("AFFILIATE_SHOW_BANNER_DIR_FS_DOCUMENT_ROOT",'DIR_FS_DOCUMENT_ROOT');
+define("AFFILIATE_SHOW_BANNER_DIR_WS_CATALOG",'DIR_WS_CATALOG');
+define("AFFILIATE_SHOW_BANNER_DIR_WS_IMAGES",'DIR_WS_IMAGES');
+define("AFFILIATE_SHOW_BANNER_BANNER",'$banner');
+define("AFFILIATE_SHOW_BANNER_SQL_QUERY_USED",'SQL-Query used:');
+define("AFFILIATE_SHOW_BANNER_TRY_TO_FIND_ERROR",'Try to find error:');
+define("AFFILIATE_SHOW_BANNER_SQL_QUERY",'SQL-Query:');
+define("AFFILIATE_SHOW_BANNER_LOCATING_PIC",'Locating Pic');
+
+
+#################    End - 29 June 2006   #################
+
+#################    End - 01 July 2006   #################
+
+define("PAYPAL_NOTIFY_IPN_TEST_1","TEST IPN Processed for order #");
+define("PAYPAL_NOTIFY_IPN_TEST_2","You need to specify an order #");
+define("PAYPAL_NOTIFY_RECEIVED_ERROR_1","Error: no valid ");
+define("PAYPAL_NOTIFY_RECEIVED_ERROR_2"," received.");
+
+define('TEXT_CLOSE_WINDOW', 'Close Window');
+
+
+#################    End - 01 July 2006   #################
+
+define("TEXT_YOUR_CONTENT_HERE","Your Content here");
+define("TEXT_NO_SPECIALS","There are currently no specials defined.");
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/account.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: account.php,v 1.1.1.1 2004/03/04 23:41:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Mi Cuenta');
+define('HEADING_TITLE', 'Datos de Mi Cuenta');
+
+define('OVERVIEW_TITLE', 'Resumen');
+define('OVERVIEW_SHOW_ALL_ORDERS', '(ver todos mis pedidos)');
+define('OVERVIEW_PREVIOUS_ORDERS', 'Pedidos Anteriores');
+
+define('MY_ACCOUNT_TITLE', 'Mi Cuenta');
+define('MY_ACCOUNT_INFORMATION', 'Ver o modificar datos de mi cuenta.');
+define('MY_ACCOUNT_ADDRESS_BOOK', 'Ver o modificar mis direcciones.');
+define('MY_ACCOUNT_PASSWORD', 'Modificar mi contrase&ntilde;a de acceso.');
+
+define('MY_ORDERS_TITLE', 'Mis Pedidos');
+define('MY_ORDERS_VIEW', 'Ver los pedidos que he realizado.');
+
+define('EMAIL_NOTIFICATIONS_TITLE', 'Notificaciones por E-Mail');
+define('EMAIL_NOTIFICATIONS_NEWSLETTERS', 'Subscribirse or no a los boletines.');
+define('EMAIL_NOTIFICATIONS_PRODUCTS', 'Ver o modificar mis notificaciones de productos.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/account_edit.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/account_edit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/account_edit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: account_edit.php,v 1.1.1.1 2004/03/04 23:41:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mi Cuenta');
+define('NAVBAR_TITLE_2', 'Editar Cuenta');
+
+define('HEADING_TITLE', 'Datos de Mi Cuenta');
+
+define('MY_ACCOUNT_TITLE', 'Mi Cuenta');
+
+define('SUCCESS_ACCOUNT_UPDATED', 'Se ha actualizado su cuenta correctamente.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/account_history.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/account_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/account_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: account_history.php,v 1.1.1.1 2004/03/04 23:41:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mi Cuenta');
+define('NAVBAR_TITLE_2', 'Pedidos');
+
+define('HEADING_TITLE', 'Todos Mis Pedidos');
+
+define('TEXT_ORDER_NUMBER', 'N&uacute;mero:');
+define('TEXT_ORDER_STATUS', 'Estado:');
+define('TEXT_ORDER_DATE', 'Fecha:');
+define('TEXT_ORDER_SHIPPED_TO', 'Enviado A:');
+define('TEXT_ORDER_BILLED_TO', 'Facturado A:');
+define('TEXT_ORDER_PRODUCTS', 'Productos:');
+define('TEXT_ORDER_COST', 'Precio:');
+define('TEXT_VIEW_ORDER', 'Ver Pedido');
+
+define('TEXT_NO_PURCHASES', 'No ha realizado ningun pedido a&uacute;n.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/account_history_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/account_history_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/account_history_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: account_history_info.php,v 1.1.1.1 2004/03/04 23:41:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mi Cuenta');
+define('NAVBAR_TITLE_2', 'Historial');
+define('NAVBAR_TITLE_3', 'Pedido Num. %s');
+
+define('HEADING_TITLE', 'Datos del Pedido');
+
+define('HEADING_ORDER_NUMBER', 'Pedido Num. %s');
+define('HEADING_ORDER_DATE', 'Fecha del Pedido:');
+define('HEADING_ORDER_TOTAL', 'Total del Pedido:');
+
+define('HEADING_DELIVERY_ADDRESS', 'Direcci&oacute;n de Entrega');
+define('HEADING_SHIPPING_METHOD', 'Gastos de Env&iacute;o');
+
+define('HEADING_PRODUCTS', 'Producto');
+define('HEADING_OPTIONS', 'Option\'s');
+define('HEADING_PRODUCTS_BASE_PRICE', 'Base');
+define('HEADING_PRODUCTS_FINAL_PRICE', 'Final');
+define('HEADING_TAX', 'Impuestos');
+define('HEADING_TOTAL', 'Total');
+
+define('HEADING_BILLING_INFORMATION', 'Datos de Facturaci&oacute;n');
+define('HEADING_BILLING_ADDRESS', 'Direcci&oacute;n de Facturaci&oacute;n');
+define('HEADING_PAYMENT_METHOD', 'Forma de Pago');
+
+define('HEADING_ORDER_HISTORY', 'Mis Pedidos');
+define('HEADING_COMMENT', 'Comentarios');
+define('TEXT_NO_COMMENTS_AVAILABLE', 'No hay comentarios.');
+
+define('TABLE_HEADING_DOWNLOAD_DATE', 'Fecha Caducidad: ');
+define('TABLE_HEADING_DOWNLOAD_COUNT', ' descargas restantes');
+define('HEADING_DOWNLOAD', 'Descarga tus productos aqui');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/account_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/account_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/account_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: account_newsletters.php,v 1.1.1.1 2004/03/04 23:41:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mi Cuenta');
+define('NAVBAR_TITLE_2', 'Subscripci&oacute;n a Boletines');
+
+define('HEADING_TITLE', 'Subscripci&oacute;n a Boletines');
+
+define('MY_NEWSLETTERS_TITLE', 'Mis Subscripciones');
+define('MY_NEWSLETTERS_GENERAL_NEWSLETTER', 'Bolet&iacute;n General');
+define('MY_NEWSLETTERS_GENERAL_NEWSLETTER_DESCRIPTION', 'Incluye noticias, nuevos productos, ofertas especiales y otros anuncios promocionales.');
+
+define('SUCCESS_NEWSLETTER_UPDATED', 'Se han actualizado sus subscrictiones correctamente.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/account_notifications.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/account_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/account_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: account_notifications.php,v 1.1.1.1 2004/03/04 23:41:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mi Cuenta');
+define('NAVBAR_TITLE_2', 'Avisos de Productos');
+
+define('HEADING_TITLE', 'Avisos de Productos');
+
+define('MY_NOTIFICATIONS_TITLE', 'Mis Avisos de Productos');
+define('MY_NOTIFICATIONS_DESCRIPTION', 'La lista de avisos de productos le permite estar al dia sobre los productos de su inter&eacute;s.<br><br>Para estar al d&iacute;a sobre todos los productos seleccione <b>Aviso Global de Productos</b>.');
+
+define('GLOBAL_NOTIFICATIONS_TITLE', 'Aviso Global de Productos');
+define('GLOBAL_NOTIFICATIONS_DESCRIPTION', 'Recibir avisos de todos los productos disponibles.');
+
+define('NOTIFICATIONS_TITLE', 'Avisos de Productos');
+define('NOTIFICATIONS_DESCRIPTION', 'Para quitar un aviso, desmarque la casilla correspondiente y pulse en Continuar.');
+define('NOTIFICATIONS_NON_EXISTING', 'No tiene configurados avisos para ningun producto.<br><br>Para a&ntilde;adir productos a su lista de avisos, vaya a la p&aacute;gina de informaci&oacute;n del producto y use el enlace para activar el aviso.');
+
+define('SUCCESS_NOTIFICATIONS_UPDATED', 'Se han actualizado sus avisos correctamente.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/account_password.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/account_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/account_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: account_password.php,v 1.1.1.1 2004/03/04 23:41:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mi Cuenta');
+define('NAVBAR_TITLE_2', 'Modificar Contrase&ntilde;a');
+
+define('HEADING_TITLE', 'Mi Contrase&ntilde;a');
+
+define('MY_PASSWORD_TITLE', 'Mi Contrase&ntilde;a');
+
+define('SUCCESS_PASSWORD_UPDATED', 'Se ha actualizado su contrase&ntilde;a correctamente.');
+define('ERROR_CURRENT_PASSWORD_NOT_MATCHING', 'Su contrase&ntilde;a actual no coincide. Por favor int&eacute;ntelo de nuevo.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/address_book.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/address_book.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/address_book.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: address_book.php,v 1.1.1.1 2004/03/04 23:41:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mi Cuenta');
+define('NAVBAR_TITLE_2', 'Mis Direcciones');
+
+define('HEADING_TITLE', 'Mis Direcciones Postales');
+
+define('PRIMARY_ADDRESS_TITLE', 'Direcci&oacute;n Principal');
+define('PRIMARY_ADDRESS_DESCRIPTION', 'Esta direcci&oacute;n se seleccionara por defecto para el envio y para la facturaci&oacute;n de sus pedidos.<br><br>Esta direcci&oacute;n tambi&eacute;n se utiliz&aacute; para calcular los impuestos que le corresponden.');
+
+define('ADDRESS_BOOK_TITLE', 'Direcciones');
+
+define('PRIMARY_ADDRESS', '(direcci&oacute;n principal)');
+
+define('TEXT_MAXIMUM_ENTRIES', '<font color="#ff0000"><b>NOTA:</b></font> Se permiten un m&aacute;ximo de %s direcciones.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/address_book_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/address_book_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/address_book_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: address_book_process.php,v 1.1.1.1 2004/03/04 23:41:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mi Cuenta');
+define('NAVBAR_TITLE_2', 'Mis Direcciones');
+
+define('NAVBAR_TITLE_ADD_ENTRY', 'Nueva Direcci&oacute;n');
+define('NAVBAR_TITLE_MODIFY_ENTRY', 'Modificar Direcci&oacute;n');
+define('NAVBAR_TITLE_DELETE_ENTRY', 'Eliminar Direcci&oacute;n');
+
+define('HEADING_TITLE_ADD_ENTRY', 'Nueva Direcci&oacute;n');
+define('HEADING_TITLE_MODIFY_ENTRY', 'Modificar Direcci&oacute;n');
+define('HEADING_TITLE_DELETE_ENTRY', 'Elminar Direcci&oacute;n');
+
+define('DELETE_ADDRESS_TITLE', 'Eliminar Direcci&oacute;n');
+define('DELETE_ADDRESS_DESCRIPTION', 'Esta seguro de que quiere eliminar la direcci&oacute;n seleccionada?');
+
+define('NEW_ADDRESS_TITLE', 'Nueva Direcci&oacute;n');
+
+define('SELECTED_ADDRESS', 'Direcci&oacute;n Seleccionada');
+define('SET_AS_PRIMARY', 'Direcci&oacute;n Principal.');
+
+define('SUCCESS_ADDRESS_BOOK_ENTRY_DELETED', 'Se ha eliminado la direcci&oacute;n correctamente.');
+define('SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED', 'Se ha actualizado la direcci&oacute;n correctamente.');
+
+define('WARNING_PRIMARY_ADDRESS_DELETION', 'La direcci&oacute;n principal no se puede eliminar. Seleccione otra direcci&oacute;n como la principal e int&eacute;ntelo de nuevo.');
+
+define('ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY', 'No existe la direcci&oacute;n.');
+define('ERROR_ADDRESS_BOOK_FULL', 'Ha llegado al limite de direcciones permitidas. Elimine una direcci&oacute;n que no utilice para poder a&ntilde;adir una nueva.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/advanced_search.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/advanced_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/advanced_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: advanced_search.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'B&uacute;squeda Avanzada');
+define('NAVBAR_TITLE_2', 'Resultados de la B&uacute;squeda');
+
+define('HEADING_TITLE_1', 'B&uacute;squeda Avanzada');
+define('HEADING_TITLE_2', 'Productos que satisfacen los criterios de b&uacute;squeda');
+
+define('HEADING_SEARCH_CRITERIA', 'B&uacute;squeda Avanzada');
+
+define('TEXT_SEARCH_IN_DESCRIPTION', 'Buscar tambien en la descripci&oacute;n');
+define('ENTRY_CATEGORIES', 'Categorías:');
+define('ENTRY_INCLUDE_SUBCATEGORIES', 'Incluir Subcategorías');
+define('ENTRY_MANUFACTURERS', 'Fabricante:');
+define('ENTRY_PRICE_FROM', 'Desde precio:');
+define('ENTRY_PRICE_TO', 'a precio:');
+define('ENTRY_DATE_FROM', 'De fecha de alta:');
+define('ENTRY_DATE_TO', 'a alta:');
+
+define('TEXT_SEARCH_HELP_LINK', '<u>Ayuda</u> [?]');
+
+define('TEXT_ALL_CATEGORIES', 'Todas');
+define('TEXT_ALL_MANUFACTURERS', 'Todos');
+
+define('HEADING_SEARCH_HELP', 'Consejos para B&uacute;squeda Avanzada');
+define('TEXT_SEARCH_HELP', 'El motor de b&uacute;squeda le permite hacer una b&uacute;squeda por palabras clave en el modelo, nombre y descripci&oacute;n del producto y en el nombre del fabricante.<br><br>Cuando haga una busqueda por palabras o frases clave, puede separar estas con los operadores l&oacute;gicos AND y OR. Por ejemplo, puede hacer una busqueda por <u>microsoft AND raton</u>. Esta b&uacute;squeda dar&iacute;a como resultado los productos que contengan ambas palabras. Por el contrario, si teclea  <u>raton OR teclado</u>, conseguir&aacute; una lista de los productos que contengan las dos o solo una de las palabras. Si no se separan las palabras o frases clave con AND o con OR, la b&uacute;squeda se hara usando por defecto el operador logico AND.<br><br>Puede realizar busquedas exactas de varias palabras encerrandolas entre comillas. Por ejemplo, si busca <u>"ordenador portatil"</u>, obtendr&aacute;s una lista de productos que tengan exactamente esa cadena en ellos.<br><br>Se pueden usar paratensis para controlar el orden de las operaciones l&oacute;gicas. Por ejemplo, puede introducir <u>microsoft and (teclado or raton or "visual basic")</u>.');
+define('TEXT_CLOSE_WINDOW', '<u>Cerrar Ventana</u> [x]');
+
+define('TABLE_HEADING_IMAGE', '');
+define('TABLE_HEADING_MODEL', 'Modelo');
+define('TABLE_HEADING_PRODUCTS', 'Descripci&oacute;n');
+define('TABLE_HEADING_MANUFACTURER', 'Fabricante');
+define('TABLE_HEADING_QUANTITY', 'Cantidad');
+define('TABLE_HEADING_PRICE', 'Precio');
+define('TABLE_HEADING_WEIGHT', 'Peso');
+define('TABLE_HEADING_BUY_NOW', 'Compre Ahora');
+
+define('TEXT_NO_PRODUCTS', 'No hay productos que corresponden con los criterios de b&uacute;squeda.');
+
+define('ERROR_AT_LEAST_ONE_INPUT', 'Debe introducir al menos un criterio de b&uacute;squeda.');
+define('ERROR_INVALID_FROM_DATE', 'La Fecha de Alta Desde es inv&aacute;lida');
+define('ERROR_INVALID_TO_DATE', 'La Fecha de Alta Hasta es inv&aacute;lida');
+define('ERROR_TO_DATE_LESS_THAN_FROM_DATE', 'Fecha de Alta Hasta debe ser mayor que Fecha de Alta Desde');
+define('ERROR_PRICE_FROM_MUST_BE_NUM', 'El Precio Desde debe ser n&uacute;merico');
+define('ERROR_PRICE_TO_MUST_BE_NUM', 'El Precio Hasta debe ser n&uacute;merico');
+define('ERROR_PRICE_TO_LESS_THAN_PRICE_FROM', 'Precio Hasta debe ser mayor o igual que Precio Desde');
+define('ERROR_INVALID_KEYWORDS', 'Palabras clave incorrectas');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_affiliate.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_affiliate.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Entrada de Afiliado');
+define('HEADING_TITLE', 'Entrada de Afiliado');;
+define('HEADING_TITLE_ERROR', 'Error de Registro');
+
+define('TEXT_AFFILIATE_LOGOFF', 'Termino de sesion');
+define('TEXT_AFFILIATE_ID', 'Afiliado E-Mail:');
+define('TEXT_AFFILIATE_PASSWORD', 'Contraseña:');
+
+define('HEADING_NEW_AFFILIATE', 'Nuevo Afiliado');
+define('TEXT_NEW_AFFILIATE', 'Yo soy un afiliado nuevo.');
+define('TEXT_NEW_AFFILIATE_INTRODUCTION', 'Creando una cuenta de afiliado at ' . STORE_NAME . ' Usted prodra ganar adicional dinero solo por referir los visitantes de su website a nosotros.');
+define('TEXT_NEW_AFFILIATE_TERMS','Ponga aqui sus condiciones de Afiliado');
+
+define('HEADING_RETURNING_AFFILIATE', 'Ya Soy Affiliado');
+define('TEXT_RETURNING_AFFILIATE', 'Yo soy un afiliado de regreso.');
+
+define('TEXT_AFFILIATE_PASSWORD_FORGOTTEN', '¿Ha olvidado su contraseña? Siga este enlace y se la enviamos.');
+
+define('TEXT_LOGIN_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> El \'E-Mail\' y/o \'Contraseña\' no figuran en nuestros datos.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa Afiliado');
+define('HEADING_TITLE', 'Programa Afiliado: Banderas');
+
+define('TEXT_AFFILIATE_BANNERS', 'Banner Links');
+define('TEXT_AFFILIATE_BANNERS_BUILD', 'Build a Link');
+define('TEXT_AFFILIATE_BANNERS_PRODUCT', 'Product Links');
+define('TEXT_AFFILIATE_BANNERS_TEXT', 'Text Links');
+
+define('TEXT_INFORMATION_BANNERS_BANNERS', 'Effective HIGHLY colorful graphical links in various shapes and sizes');
+define('TEXT_INFORMATION_BANNERS_BUILD', 'Create dynamic links to a particular product of your choice.');
+define('TEXT_INFORMATION_BANNERS_PRODUCT', 'Recommend specific products to your visitors by linking directly to a particular product.');
+define('TEXT_INFORMATION_BANNERS_TEXT', 'Get maximum sales from these proven to-be-effective and easy-to-use text based links.');
+define('TEXT_INFORMATION', 'Elija la bandera o el acoplamiento que desea exhibir en su website de las opciones de abajo :');
+define('TEXT_AFFILIATE_NAME', 'Nombre the la Bandera:');
+define('TEXT_AFFILIATE_INFO', 'Copia el codigo que es demostrado abajo y pegalo a tu website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER', 'BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO', 'Entre el numero del producto que desea acoplar.');
+
+define('IMAGE_BUTTON_BUILD_A_LINK','Contruir el acoplamiento para la bandera del Product.');
+define('IMAGE_BANNERS','Banners');
+define('IMAGE_PRODUCT','Product Links');
+define('IMAGE_BUILD','Build a Link');
+define('IMAGE_TEXT','Text Links');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_banners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: affiliate_banners_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Banners');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Choose the banner you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_build.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_build.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_build.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Build a Link');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Enter the product number of the product you wish to build a link for:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER','BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO','Enter the product number you wish to link to and press the enter&nbsp;');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available products.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the product number from the popup window and enter the number in the Build A Link field.');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Available Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Product #');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('IMAGE_BUTTON_BUILD_A_LINK', 'BUILD-A-LINK');
+
+
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_build_cat.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_build_cat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_build_cat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Build a CATEGORY Link');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Enter the CATEGORY number of the CATEGORY you wish to build a link for:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER','BUILD-A-CATEGORY-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO','Enter the CATEGORY number you wish to link to and press the enter&nbsp;');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available categories.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the category number from the popup window and enter the number in the Build Category Link field.');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Available Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Categories #');
+define('TEXT_VALID_CATEGORIES_NAME', 'Categories Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('IMAGE_BUTTON_BUILD_A_LINK', 'BUILD-A-LINK');
+
+define('TEXT_VERSION', 'Text Version:');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_category.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_category.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_category.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: affiliate_banners_category.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Category Links');
+
+define('TEXT_AFFILIATE_NAME', 'Category Name:');
+define('TEXT_INFORMATION', 'Choose the CATEGORY you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_product.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_product.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_product.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: affiliate_banners_product.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Product Links');
+
+define('TEXT_AFFILIATE_NAME', 'Product Name:');
+define('TEXT_INFORMATION', 'Choose the product you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_text.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_text.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_banners_text.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_banners_text.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Text Links');
+
+define('TEXT_AFFILIATE_NAME', 'Link Name:');
+define('TEXT_INFORMATION', 'Choose the link you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+
+define('TEXT_VERSION', 'Text Version:');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa Afiliado');
+define('HEADING_TITLE', 'Programa Afiliado: Teclados');
+
+define('TABLE_HEADING_DATE', 'Fecha');
+define('TABLE_HEADING_REFFERED', 'Referer');
+define('TABLE_HEADING_IP', 'IP Direccion');
+define('TABLE_HEADING_BROWSER', 'Browser');
+define('TABLE_HEADING_CLICKED_PRODUCT', 'Producto');
+
+define('TEXT_AFFILIATE_HEADER', 'Total de teclados for tu sitio:');
+define('TEXT_NO_CLICKS', 'No Teclados Registrados in tu sitio.');
+define('TEXT_DISPLAY_NUMBER_OF_CLICKS', 'Exhibir <b>%d</b> de <b>%d</b> (of <b>%d</b> teclados)');
+define('TEXT_CLICKTHROUGH_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_CLICKS', 'Click on [?] to see a description of each category.');
+define('HEADING_CLICKTHROUGH_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the clickthrough from your site.');
+define('TEXT_CLICKED_PRODUCT_HELP', '<i>Product or Page</i> represents the page or product clicked through to');
+define('TEXT_REFFERED_HELP', '<i>Referrer</i> represents the url that the clickthrough came from.');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa de Afiliados');
+define('HEADING_TITLE', 'Programa de Afiliados - Forma de contactarnos');
+
+define('TEXT_SUCCESS', 'Su consulta ha sido enviada al encargado de la tienda.');
+
+define('EMAIL_SUBJECT', 'Programa de Afiliados');
+define('ENTRY_NAME', 'Nombre Completo:');
+define('ENTRY_EMAIL', 'Direccion E-Mail:');
+define('ENTRY_ENQUIRY', 'Consulta:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_details.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_details.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'El Program de Afiliados');
+define('NAVBAR_TITLE_2', 'Correccion de la Cuenta de Afiliados');
+define('HEADING_TITLE', 'El Programa de Afiliados - Detalles de su Cuenta<br><small>Usted puede correjir cualquier Informacion abajo:</small>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_details_ok.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_details_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_details_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+
+<?php
+/*
+  $Id: affiliate_details_ok.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa de Afilados');
+define('HEADING_TITLE', 'Los Detalles de su Cuenta fueron Cambiados!');
+define('TEXT_INFORMATION', 'We have updated your account details, Please click the continue button.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<?php
+/*
+  $Id: affiliate_faq.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa Afiliado FAQ');
+define('HEADING_TITLE', 'Programa Afiliado - Frecuente Preguntas');
+
+define('TEXT_INFORMATION', '' . STORE_NAME . ' has compilado esta informacion para estar mejor iformado sobre nuestro programa afiliado.<br>
+ If you have any questions please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a> for more information.<br>
+<ul>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#1">Question 1?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#2">Question 2?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#3">Question 3?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#4">Question 4?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#5">Question 5?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#6">Question 6?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#7">Question 7?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#8">Question 8?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#9">Question 9?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#10">Question 10?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#11">Question 11?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#12">Question 12?</a>
+</ul>
+<hr width ="90%">
+<BR>
+<FONT COLOR="#000000" size="4"><B><U>Frequently Asked Questions</U></B></FONT>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 1?</font><a name="1"></a><br>
+Answer 1.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 2?</font><a name="2"></a><br>
+Answer 2.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 3?</font><a name="3"></a><br>
+Answer 3.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 4?</font><a name="4"></a><br>
+Answer 4.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 5?</font><a name="5"></a><br>
+Answer 5.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 6?</font><a name="6"></a><br>
+Answer 6.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 7?</font><a name="7"></a><br>
+Answer 7.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 8?</font><a name="8"></a><br>
+Answer 8.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 9?</font><a name="9"></a><br>
+Answer 9.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 10?</font><a name="10"></a><br>
+Answer 10.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 11?</font><a name="11"></a><br>
+Answer 11.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 12?</font><a name="12"></a><br>
+Answer 12.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p align="right" style="line-height: 100%; word-spacing: 0: text-indent: 0: margin: 0:">This text can be edited in includes/languages/<selected language>/affiliate_faq.php.</p>
+');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_info.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa de Afiliacion');
+define('HEADING_TITLE', 'Programan de Afilicion');
+
+define('HEADING_AFFILIATE_PROGRAM_TITLE', 'El ' . STORE_NAME . ' Programa de Afiliacion');
+
+// Delete this line - or place two forward slashes before the word 'define'
+define('TEXT_INFORMATION', 'La Informacion de su Afiliacion va aqui');
+
+// define('TEXT_INFORMATION',' <DELETE THE BRACKETS AND ALL TEXT IN BETWEEN - PUT YOUR INFORMATION HERE>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_logout.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_logout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_logout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: affiliate_logout.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'El Programa Afiliado');
+define('HEADING_TITLE', 'El Programa Afiliado');
+
+define('TEXT_INFORMATION', 'Su Registro termino con exito.');
+define('TEXT_INFORMATION_ERROR_1', 'Su Registro no ha podido ser terminado.');
+define('TEXT_INFORMATION_ERROR_2', 'Usted no se Registro con exito por lo tanto su registro no puede ser terminado.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.10 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate News');
+
+define('TABLE_HEADING_AFFILIATE_NEWS', 'Affiliate News');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Choose the banner or link you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER', 'BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO', 'Enter the product number you wish to link to.');
+
+define('IMAGE_BUTTON_BUILD_A_LINK','Build a Link for a Product Banner.');
+
+//add on \admin\includes\english\affiliate_news.php
+// npe admin begin #add
+define('TEXT_AFFILIATE_NEWS_CONTENT_DELETE', 'Delete displayed news in this language!');
+define('EMPTY_CATEGORY', 'Empty news');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'There are no news which can be displayed to your affiliate partners.');
+// npe admin begin #add
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Affiliate Program');
+define('NAVBAR_TITLE_2', 'Newsletter Subscriptions');
+
+define('HEADING_TITLE', 'Newsletter Subscriptions');
+
+define('MY_NEWSLETTERS_TITLE', 'My Newsletter Subscriptions');
+define('MY_NEWSLETTERS_AFFILIATE_NEWSLETTER', 'Affiliate Newsletter');
+define('MY_NEWSLETTERS_AFFILIATE_NEWSLETTER_DESCRIPTION', 'Including affiliate news, new products, special offers, and other promotional announcements.');
+
+define('SUCCESS_NEWSLETTER_UPDATED', 'Your newsletter subscriptions have been successfully updated.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_password.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Affiliate Program');
+define('NAVBAR_TITLE_2', 'Change Password');
+
+define('HEADING_TITLE', 'My Password');
+
+define('MY_PASSWORD_TITLE', 'My Password');
+
+define('SUCCESS_PASSWORD_UPDATED', 'Your password has been successfully updated.');
+define('ERROR_CURRENT_PASSWORD_NOT_MATCHING', 'Your Current Password did not match the password in our records. Please try again.');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_password_forgotten.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Entrar');
+define('NAVBAR_TITLE_2', 'Affiliate Constraseña Olvidada');
+define('HEADING_TITLE', 'He olvidado mi Contraseña!');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', '<font color="#ff0000"><b>NOTA:</b></font> Ese E-Mail no figura en nuestros datos, intentelo de nuevo.');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Nueva Contraseña');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'Ha solicitado una Nueva Contraseña desde ' . $REMOTE_ADDR . '.' . "\n\n" . 'Su nueva contraseña para \'' . STORE_NAME . '\' es:' . "\n\n" . '   %s' . "\n\n");
+define('TEXT_PASSWORD_SENT', 'Se Ha Enviado Una Nueva Contraseña a Tu Email');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa de Afiliado');
+define('HEADING_TITLE', 'Programa de Afilado: Pagos');
+
+define('TEXT_AFFILIATE_HEADER', 'Sus Pagos:');
+
+define('TABLE_HEADING_DATE', 'Fecha de Pagos');
+define('TABLE_HEADING_PAYMENT', 'Ingresos del Afiliado');
+define('TABLE_HEADING_STATUS', 'Estado de Pagos');
+define('TABLE_HEADING_PAYMENT_ID','Identificacion de Pago Payment-ID');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENTS', 'Exhibir <b>%d</b> los <b>%d</b> (of <b>%d</b> pagos)');
+define('TEXT_INFORMATION_PAYMENT_TOTAL', 'total de sus Ingresos to:');
+define('TEXT_NO_PAYMENTS', 'No pagos han sido registrados.');
+define('TEXT_PAYMENT_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_PAYMENT', 'Click on [?] to see a description of each category.');
+define('HEADING_PAYMENT_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the payment made to the affiliate.');
+define('TEXT_PAYMENT_ID_HELP', '<i>Payment-ID</i> represents the payment number associated to the payment.');
+define('TEXT_PAYMENT_HELP', '<i>Affiliate Earnings</i> represents the value of payment made to the affiliate.');
+define('TEXT_STATUS_HELP', '<i>Payment Status</i> represents the status of the payment made to the affiliate');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_reports.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_reports.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_reports.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program: Affiliate Reports');
+
+define('TEXT_INFORMATION', 'Obtain affiliate links that you can display on your website.');
+
+define('TEXT_AFFILIATE_CLICKS', 'Clickthrough Report');
+define('TEXT_AFFILIATE_SALES', 'Sales Report');
+define('TEXT_AFFILIATE_PAYMENT', 'Payment Report');
+
+
+define('TEXT_INFORMATION_CLICKS', 'View Clickthrough information from your website');
+define('TEXT_INFORMATION_SALES', 'View your current and previous Affiliate Sales');
+define('TEXT_INFORMATION_PAYMENT', 'View all affiliate payments made to you');
+
+define('IMAGE_CLICKS','Clickthrough Report');
+define('IMAGE_SALES','Sales Report');
+define('IMAGE_PAYMENT','Payment Report');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: affiliate_sales.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa de Afiliados');
+define('HEADING_TITLE', 'Programa de Afiliados: Ventas');
+
+define('TABLE_HEADING_DATE', 'Fecha');
+define('TABLE_HEADING_SALES', 'Ingresos del Afilado (excl.)');
+define('TABLE_HEADING_VALUE', 'Valor de las Ventas (excl.)');
+define('TABLE_HEADING_PERCENTAGE','Porcentage de Comisiones');
+define('TABLE_HEADING_STATUS', 'Estado de Ventas');
+
+define('TEXT_DELETED_ORDER_BY_ADMIN', 'Cancelacion (Admin)');
+define('TEXT_INFORMATION_SALES_TOTAL', 'Total de sus ingresos (excl.) to:');
+define('TEXT_INFORMATION_SALES_TOTAL2', '<br>Solo las ventas entregadas son contadas!');
+define('TEXT_NO_SALES', 'No ventas han sido registradas.');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Exhibir <b>%d</b> las <b>%d</b> (of <b>%d</b> Ventas)');
+
+define('TEXT_AFFILIATE_HEADER', 'Ventas de tu website:');
+define('TEXT_SALES_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_SALES', 'Click on [?] to see a description of each category.');
+define('HEADING_SALES_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the sale.');
+define('TEXT_TIME_HELP', '<i>Time</i> represents the time of the sale.');
+define('TEXT_SALE_VALUE_HELP', '<i>Sale Value</i> represents the value of the sale.');
+define('TEXT_COMMISSION_RATE_HELP', '<i>Commission Rate</i> represents the commission rate paid on the sale.');
+define('TEXT_COMMISSION_VALUE_HELP', '<i>Affiliate Earnings</i> represents the commission due on the sale.');
+define('TEXT_STATUS_HELP', '<i>Sale Status</i> represents the status the sale.');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_signup.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_signup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_signup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: affiliate_signup.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa de Afiliado');
+define('HEADING_TITLE', 'Programa de Afiliado - Sign Up');
+
+define('MAIL_AFFILIATE_SUBJECT', 'Bien venido al Programa Afiliado');
+define('MAIL_GREET_NONE', 'Dear %s' . "\n\n");//em001
+define('MAIL_AFFILIATE_HEADER', 'Estimado Afilado, gracias por unirse al programa de afiliados.'."\n\n".' Informacion de su cuenta: ***********************'."\n\n");
+define('MAIL_AFFILIATE_ID', 'El Numero de su identification ID is: ');
+define('MAIL_AFFILIATE_USERNAME', 'El nombre de su identificacion is: ');
+define('MAIL_AFFILIATE_PASSWORD', 'Su contrasena is: ');
+define('MAIL_AFFILIATE_LINK', 'este es el Acoplamiento de su cuenta:');
+define('MAIL_AFFILIATE_FOOTER', 'Diviertase ganando honorarios sobre referencias! '."\n\n".' Your Affiliate Team');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_signup_ok.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_signup_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_signup_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: affiliate_signup_ok.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Registracion del Afiliado');
+define('HEADING_TITLE', 'Felicidades!');
+define('TEXT_INFORMATION', 'Felicidades! Su forma de la cuenta de Afiliados ha sido sometida! Usted recibira en un corto tiempo an email con informacion muy importante in referencias con su Cuenta de Afiliado, incluyendo su afiliado registacion con detalles. Si no recibe la information dentro de una hora, porfavor, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">Entremos en contacto</a>.<br><br>Si usted tiene<small><b>QUALQUIER</b></small> pregunta aserca del programa de afiliados, Porfavor <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">Entremos en contacto</a>.');
+define('TEXT_ACCOUNT_CREATED', 'Congratulations! Your new Affiliate account application has been submitted! You will shortly receive an email containing important information regarding your Affiliate Account, including you affiliate login details. If you have not received it within the hour, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.<br><br>If you have <small><b>ANY</b></small> questions about the affiliate program, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Su resumen');
+define('HEADING_TITLE', 'El programa de Affiliado');
+
+define('TEXT_AFFILIATE_CENTRE', 'Affiliate Center');
+define('TEXT_AFFILIATE_BANNER_CENTRE', 'Affiliate Banners');
+define('TEXT_AFFILIATE_REPORT_CENTRE', 'Affiliate Reports');
+define('TEXT_AFFILIATE_INFO', 'Affiliate Information');
+define('TEXT_AFFILIATE_SUMMARY', 'Affiliate Summary');
+define('TEXT_AFFILIATE_PASSWORD', 'Change Password');
+define('TEXT_AFFILIATE_NEWS', 'Affiliate News');
+define('TEXT_AFFILIATE_NEWSLETTER', 'Newsletter');
+define('TEXT_AFFILIATE_ACCOUNT', 'Edit Affiliate Account');
+define('TEXT_AFFILIATE_REPORTS', 'Affiliate Reports');
+define('TEXT_AFFILIATE_CLICKRATE', 'Clickthrough Report');
+define('TEXT_AFFILIATE_PAYMENT', 'Payment Report');
+define('TEXT_AFFILIATE_SALES', 'Sales Report');
+define('TEXT_AFFILIATE_BANNERS', 'Affiliate Banners');
+define('TEXT_AFFILIATE_BANNERS_BANNERS', 'Banner Links');
+define('TEXT_AFFILIATE_BANNERS_BUILD', 'Build a Link');
+define('TEXT_AFFILIATE_BANNERS_PRODUCT', 'Product Links');
+define('TEXT_AFFILIATE_BANNERS_TEXT', 'Text Links');
+define('TEXT_INFORMATION', 'Entre aqui su afiliado informacion');
+define('TEXT_SUMMARY_TITLE', 'Resumen de Afiliado');
+define('TEXT_IMPRESSIONS', 'Impressiones: ');
+define('TEXT_VISITS', 'Visitas: ');
+define('TEXT_TRANSACTIONS', 'Transaccions: ');
+define('TEXT_CONVERSION', 'Conversiones: ');
+define('TEXT_AMOUNT', 'Total: ');
+define('TEXT_AVERAGE', 'Promedio: ');
+define('TEXT_COMMISSION_RATE', 'Tarifa Commission : ');
+define('TEXT_PAYPERSALE_RATE', 'Pago de tarifa por venta: ');
+define('TEXT_CLICKTHROUGH_RATE', 'Teclado Tarifa: ');
+define('TEXT_COMMISSION', 'Commission: ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Click on [?] Para ver la descripcion de cada categoria.');
+define('HEADING_SUMMARY_HELP', 'Affiliate Help');
+define('TEXT_IMPRESSIONS_HELP', '<b>Impressions:</b> Exhibe el total number de ocasiones que la bandera or link has been displayed in the given time period.');
+define('TEXT_VISITS_HELP', '<b>Visits:</b> representa el total de number of teclados por visitantes de su website.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Transacciones:</b> representa el total de transacciones acreditadas a su cuenta.');
+define('TEXT_CONVERSION_HELP', '<b>Conversiones:</b> representa el porcentage de visitantes (click-throughs) Transactiones completas.');
+define('TEXT_AMOUNT_HELP', '<b>Cantidad:</b> representa el total de ventas or el valor de ordenes entregads y acreditadas a su cuenta.');
+define('TEXT_AVERAGE_HELP', '<b>Promedio:</b> representa el promedio de ventas acreditado a su cuenta.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Tarifa de Comission:</b> representa el porcentage de comission sobre las ventas.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<b>Tarifa de teclado:</b> representa la tarifa que se paga por cada tecleo basis.');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<b>Tarifa sobre el pago de Ventas:</b> represents la tarifa que se paga por las ventas basis.');
+define('TEXT_COMMISSION_HELP', '<b>Commission:</b> represents el total de commission de entregado que se le debe a usted.');
+define('TEXT_CLOSE_WINDOW', 'Cierre Window [x]');
+
+define('TEXT_GREETING','Bien Venido ');
+define('TEXT_AFFILIATE_ID', 'Su Affiliate ID: ');
+
+define('IMAGE_BANNERS','Banderas');
+define('IMAGE_CLICKTHROUGHS','Informacion de Teclado');
+define('IMAGE_SALES','Informacion de ventas');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/affiliate_terms.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/affiliate_terms.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/affiliate_terms.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: affiliate_terms.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programa de Afiliado');
+define('HEADING_TITLE', 'Programa de Afiliado');
+
+define('HEADING_AFFILIATE_PROGRAM_TITLE', 'The ' . STORE_NAME . ' Terminos de Afifiliado');
+define('TEXT_INFORMATION', 'Sus terminos de afiliado van aqui');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/all_prodcats.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/all_prodcats.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/all_prodcats.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: all_products.php, v 3.00 2004/02/21 by Ingo info at gamephisto.de
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'All Categproes and Products');
+define('HEADING_TITLE', 'All Categories and Products');
+
+define('HEADING_ALL_CATSUB', 'Categories and Sub-Subcategories');
+define('HEADING_ALL_PRODUCTS', 'Products');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/all_prodmanf.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/all_prodmanf.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/all_prodmanf.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: all_prodmanf.php, v 1.00 2004/09/04
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'All Manufactures and Products');
+define('HEADING_TITLE', 'All Manufactures and Products');
+
+define('HEADING_ALL_CATSUB', 'Manufactures');
+define('HEADING_ALL_PRODUCTS', 'Products');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/allprods.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/allprods.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/allprods.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: allprods.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Todos los Productos');
+define('HEADING_TITLE', 'Todos los Productos');
+
+define('BOX_INFORMATION_ALLPRODS', 'Informacion de todos nuestros Productos');
+define('HEADING_TEXT_PRODUCT', 'Product Name');
+define('HEADING_TEXT_MODEL', 'Model');
+define('HEADING_TEXT_PRICE', 'Price');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/article_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/article_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/article_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: article_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_ARTICLE_NOT_FOUND', 'Noticia no encontrada');
+define('TEXT_ARTICLE_NOT_FOUND', 'Disculpe, pero la noticia requerida no est&aacute; disponible en esta web.');
+define('TEXT_MORE_INFORMATION', 'Para obtener m&aacute;s informaci&oacute;n, haga click <a href="%s" target="_blank"><u>aqu&iacute;</u></a>.');
+define('TEXT_DATE_ADDED', 'Esta noticia ha sido publicada el %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#FF0000">Esta noticia ser&aacute; publicada el %s.</font>');
+define('TEXT_BY', 'por ');
+define('TEXT_CURRENT_REVIEWS', 'Comentarios actuales:');
+define('BOX_TEXT_TELL_A_FRIEND', 'D&iacute;selo a un amigo');
+define('TEXT_TELL_A_FRIEND', 'H&aacute;blale a un amigo de esta noticia:');
+define('TEXT_XSELL_ARTICLES', 'Productos relacionados con esta noticia:');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/article_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/article_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/article_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+define('TEXT_MAIN', '');
+define('TABLE_HEADING_NEW_ARTICLES', 'New Articles');
+  define('HEADING_TITLE', $topics['topics_name']);
+  define('TABLE_HEADING_ARTICLES', 'Articles');
+  define('TABLE_HEADING_AUTHOR', 'Author');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles in this topic.');
+  define('TEXT_NO_ARTICLES2', 'There are currently no articles available from this author.');
+  define('TEXT_NUMBER_OF_ARTICLES', 'Number of Articles: ');
+  define('TEXT_SHOW', 'Display:');
+  define('TEXT_NOW', '\' now');
+  define('TEXT_ALL_TOPICS', 'All Topics');
+  define('TEXT_ALL_AUTHORS', 'All Authors');
+  define('TEXT_ARTICLES_BY', 'Articles by ');
+  define('TEXT_ARTICLES', 'Below is a list of articles with the most recent ones listed first.');  
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+  define('TEXT_MORE_INFORMATION', 'For more information, please visit this authors <a href="http://%s" target="_blank">web page</a>.');
+?>  
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Comentarios de ');
+define('NAVBAR_TITLE', 'Comentarios');
+
+define('TEXT_NO_ARTICLE_REVIEWS', 'Actualmente no hay comentarios aprobados para esta noticia.');
+define('TEXT_OF_5_STARS', '%s de 5 estrellas');
+define('TEXT_REVIEW_VIEWS', 'N&uacute;mero de veces que se ha leido: ');
+define('TEXT_READ_REVIEW', 'Leer comentario...');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/article_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/article_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/article_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: article_reviews_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Comentario');
+define('HEADING_TITLE', 'Comentario de ');
+define('SUB_TITLE_ARTICLE', 'Noticia:');
+define('SUB_TITLE_FROM', 'De:');
+define('SUB_TITLE_DATE', 'Fecha:');
+define('SUB_TITLE_REVIEW', 'Comentario:');
+define('SUB_TITLE_RATING', 'Puntuaci&oacute;n:');
+define('TEXT_OF_5_STARS', '%s de 5 estrellas');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/article_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/article_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/article_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: article_reviews_write.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Comentarios');
+define('HEADING_TITLE', 'Escribir un comentario de \'');
+
+define('SUB_TITLE_FROM', 'De:');
+define('SUB_TITLE_REVIEW', 'Tu comentario:');
+define('SUB_TITLE_RATING', 'Puntuaci&oacute;n:');
+
+define('TEXT_APPROVAL_WARNING', 'Nota: Tu comentario no ser&aacute; publicado hasta que sea aprobado por el administrador.');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>Pobre</b></font></small>');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>Excelente</b></font></small>');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/article_search.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/article_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/article_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: article_search.php
+  By AlDaffodil:  aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_1', 'Article Search');
+define('HEADING_TITLE_2', 'Articles meeting the search criteria');
+
+define('NAVBAR_TITLE_1', 'Article Search');
+define('NAVBAR_TITLE_2', 'Articles meeting the search criteria');
+define('TABLE_HEADING_ARTICLES', 'Article');
+
+define('TEXT_ARTICLE_NAME' , 'Article Title & Link');
+define('TEXT_ARTICLE_EXCERPT' , 'Article Excerpt');
+
+define('TEXT_NO_ARTICLES', 'There are no articles matching the search criteria.');
+
+define('ERROR_INPUT', 'Please enter a search term.');
+define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/articles.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_MAIN', '');
+define('TABLE_HEADING_NEW_ARTICLES', 'Nuevas noticias en %s');
+
+if ( ($topic_depth == 'articles') || (isset($HTTP_GET_VARS['authors_id'])) ) {
+  define('HEADING_TITLE', $topics['topics_name']);
+  define('TABLE_HEADING_ARTICLES', 'Noticias');
+  define('TABLE_HEADING_AUTHOR', 'Autor');
+  define('TEXT_NO_ARTICLES', 'Actualmente no hay noticias en esta secci&oacute;n.');
+  define('TEXT_NO_ARTICLES2', 'Actualmente no ha noticias disponible de este autor.');
+  define('TEXT_NUMBER_OF_ARTICLES', 'N&uacute;mero de noticias: ');
+  define('TEXT_SHOW', 'Mostrar:');
+  define('TEXT_NOW', '\' ahora');
+  define('TEXT_ALL_TOPICS', 'Todas las secciones');
+  define('TEXT_ALL_AUTHORS', 'Todos los autores');
+  define('TEXT_ARTICLES_BY', 'Noticias por ');
+  define('TEXT_ARTICLES', 'Debajo hay una lista de todas las noticias con las m&aacute;s recientes listadas al principio.');
+  define('TEXT_DATE_ADDED', 'Publicado:');
+  define('TEXT_AUTHOR', 'Autor:');
+  define('TEXT_TOPIC', 'Secci&oacute;n:');
+  define('TEXT_BY', 'por');
+  define('TEXT_READ_MORE', 'Leer m&aacute;s...');
+  define('TEXT_MORE_INFORMATION', 'Para obtener m&aacute;s informaci&oacute;n, visita estos autores <a href="http://%s" target="_blank">aqu&iacute;</a>.');
+} elseif ($topic_depth == 'top') {
+  define('HEADING_TITLE', 'Todas las noticias');
+  define('TEXT_ALL_ARTICLES', 'Debajo hay una lista de todas las noticias con las m&aacute;s recientes listadas al principio.');
+  define('TEXT_CURRENT_ARTICLES', 'Noticias disponibles');
+  define('TEXT_UPCOMING_ARTICLES', 'Pr&oacute;ximas noticias');
+  define('TEXT_NO_ARTICLES', 'TNo hay noticias disponibles.');
+  define('TEXT_DATE_ADDED', 'Publicado:');
+  define('TEXT_DATE_EXPECTED', 'Esperado:');
+  define('TEXT_AUTHOR', 'Autor:');
+  define('TEXT_TOPIC', 'Secci&oacute;n:');
+  define('TEXT_BY', 'por');
+  define('TEXT_READ_MORE', 'Leer m&aacute;s...');
+} elseif ($topic_depth == 'nested') {
+  define('HEADING_TITLE', 'Noticias');
+}
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/articles_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/articles_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/articles_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: articles_new.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', '&Uacute;ltimas noticias');
+define('HEADING_TITLE', '&Uacute;ltimas noticias');
+
+define('TEXT_NEW_ARTICLES', 'Las siguientes noticias han sido añadidas en los &uacute;ltimos %s d&iacute;as.');
+define('TEXT_NO_NEW_ARTICLES', 'No hay noticias añadidas en los &uacute;ltimos %s d&iacute;s.');
+define('TEXT_DATE_ADDED', 'Publicado:');
+define('TEXT_AUTHOR', 'Autor:');
+define('TEXT_TOPIC', 'Secci&oacute;n:');
+define('TEXT_BY', 'por');
+define('TEXT_READ_MORE', 'Leer m&aacute;s');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/attributes_sorter.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/attributes_sorter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/attributes_sorter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,11 @@
+<?php
+/*
+  WebMakers.com Added: Attributes Sorter
+*/
+
+// Sorter for product_info.php
+define('PRODUCTS_OPTIONS_SORT_BY_PRICE','1'); // 1= sort by products_options_sort_order + name; 0= sort by products_options_sort_order + price
+
+// Categories Image and Name on product_info.php
+define('SHOW_CATEGORIES','0'); // 0= off  1=on
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/cards1_box.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/cards1_box.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/cards1_box.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: card.php,v 1.1 2004/06/24 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ // information box text in templates/(mytemplate)/boxes/cards.php
+
+define('BOX_INFORMATION_CARD', 'Information');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/checkout_confirmation.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/checkout_confirmation.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/checkout_confirmation.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: checkout_confirmation.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Realizar Pedido');
+define('NAVBAR_TITLE_2', 'Confirmaci&oacute;n');
+
+define('HEADING_TITLE', 'Estoy preparado para Comprar!');
+
+define('HEADING_DELIVERY_ADDRESS', 'Direcci&oacute;n de Entrega');
+define('HEADING_SHIPPING_METHOD', 'Forma de Envio');
+define('HEADING_PRODUCTS', 'Producto');
+define('HEADING_TAX', 'Impuestos');
+define('HEADING_TOTAL', 'Total');
+define('HEADING_BILLING_INFORMATION', 'Datos de Facturaci&oacute;n');
+define('HEADING_BILLING_ADDRESS', 'Direcci&oacute;n de Facturaci&oacute;n');
+define('HEADING_PAYMENT_METHOD', 'Forma de Pago');
+define('HEADING_PAYMENT_INFORMATION', 'Datos del Pago');
+define('HEADING_ORDER_COMMENTS', 'Comentarios Sobre Su Orden');
+define('HEADING_IPRECORDED_1','NOTE! The below IP and ISP has been recorded for security purposes.');
+define('YOUR_IP_IPRECORDED', 'IP Address');
+define('YOUR_ISP_IPRECORDED', 'ISP');
+
+define('TEXT_EDIT', 'Cambio');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuacion del processo the salida de la mercancia');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'Para verificar esta orden.');
+//please change the info_id=1 to the ID number for your condition in the information system
+define('CONDITION_AGREEMENT', '<a href="conditions.php" target="_blank"> Yo accepto las condiciones</a>');
+define('CONDITION_AGREEMENT_WARNING', 'For favor lea las condiciones y si usted no esta de acurdo con ellas, entonce no podemos enviarle la orden.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/checkout_payment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/checkout_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/checkout_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_payment.php,v 1.1.1.1 2004/03/04 23:41:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Realizar Pedido');
+define('NAVBAR_TITLE_2', 'Forma de Pago');
+
+define('HEADING_TITLE', 'Forma de Pago');
+
+define('TABLE_HEADING_BILLING_ADDRESS', 'Direcci&oacute;n de Facturaci&oacute;n');
+define('TEXT_SELECTED_BILLING_DESTINATION', 'Elija la direcci&oacute;n de su libreta donde quiera recibir la factura.');
+define('TITLE_BILLING_ADDRESS', 'Direcci&oacute;n de Facturaci&oacute;n:');
+
+define('TABLE_HEADING_PAYMENT_METHOD', 'Forma de Pago');
+define('TEXT_SELECT_PAYMENT_METHOD', 'Escoja la forma de pago preferida para este pedido.');
+define('TITLE_PLEASE_SELECT', 'Seleccione');
+define('TEXT_ENTER_PAYMENT_INFORMATION', 'Esta es la unica forma de pago disponible para este pedido.');
+
+define('TABLE_HEADING_COMMENTS', 'Agregue Los Comentarios Sobre Su Orden');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuar con el Proceso de Compra');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'para confirmar este pedido.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/checkout_payment_address.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/checkout_payment_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/checkout_payment_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_payment_address.php,v 1.1.1.1 2004/03/04 23:41:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Realizar Pedido');
+define('NAVBAR_TITLE_2', 'Cambiar Direcci&oacute;n de Facturaci&oacute;n');
+
+define('HEADING_TITLE', 'Forma de Pago');
+
+define('TABLE_HEADING_PAYMENT_ADDRESS', 'Direcci&oacute;n de Facturaci&oacute;n');
+define('TEXT_SELECTED_PAYMENT_DESTINATION', 'Esta es la direcci&oacute;n de facturaci&oacute;n seleccionada, donde se enviar&aacute; la factura.');
+define('TITLE_PAYMENT_ADDRESS', 'Direcci&oacute;n de Facturaci&oacute;n:');
+
+define('TABLE_HEADING_ADDRESS_BOOK_ENTRIES', 'Libreta de Direcciones');
+define('TEXT_SELECT_OTHER_PAYMENT_DESTINATION', 'Seleccione la direcci&oacute;n para el env&iacute;o de la factura de este pedido si quiere que sea enviada a un sitio diferente.');
+define('TITLE_PLEASE_SELECT', 'Seleccione');
+
+define('TABLE_HEADING_NEW_PAYMENT_ADDRESS', 'Nueva Direcci&oacute;n de Facturaci&oacute;n');
+define('TEXT_CREATE_NEW_PAYMENT_ADDRESS', 'Use el formulario siguiente para crear una nueva direcci&oacute;n en su libreta y usarla como direcci&oacute;n de facturaci&oacute;n en este pedido.');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuar con el Proceso de Compra');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'para seleccionar el m&eacute;todo de pago.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/checkout_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/checkout_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/checkout_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: checkout_process.php,v 1.1.1.1 2004/03/04 23:41:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('EMAIL_TEXT_SUBJECT', 'Procesar Pedido');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Número de Pedido:');
+define('EMAIL_TEXT_INVOICE_URL', 'Pedido Detallado:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Fecha del Pedido:');
+define('EMAIL_TEXT_PRODUCTS', 'Productos');
+define('EMAIL_TEXT_SUBTOTAL', 'Subtotal:');
+define('EMAIL_TEXT_TAX', 'Impuestos:      ');
+define('EMAIL_TEXT_SHIPPING', 'Gastos de Envío: ');
+define('EMAIL_TEXT_TOTAL', 'Total:    ');
+define('EMAIL_TEXT_DELIVERY_ADDRESS', 'Direcciön de Entrega');
+define('EMAIL_TEXT_BILLING_ADDRESS', 'Dirección de Facturación');
+define('EMAIL_TEXT_PAYMENT_METHOD', 'Forma de Pago');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('TEXT_EMAIL_VIA', 'por');
+define('TEXT_SHIPWIRE_TRANSACTION_ID', 'Shipwire Fullfillment Transaction Successful. Transaction ID: ');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/checkout_shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/checkout_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/checkout_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: checkout_shipping.php,v 1.1.1.1 2004/03/04 23:41:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Realizar Pedido');
+define('NAVBAR_TITLE_2', 'Forma de Env&iacute;o');
+
+define('HEADING_TITLE', 'Datos del Env&iacute;o');
+
+define('TABLE_HEADING_SHIPPING_ADDRESS', 'Direcci&oacute;n de Entrega');
+define('TEXT_CHOOSE_SHIPPING_DESTINATION', 'Escoja una direcci&oacute;n de su libreta para la entrega de los productos de este pedido.');
+define('TITLE_SHIPPING_ADDRESS', 'Direcci&oacute;n de Entrega:');
+
+define('TABLE_HEADING_SHIPPING_METHOD', 'Forma de Env&iacute;o');
+define('TEXT_CHOOSE_SHIPPING_METHOD', 'Seleccione la forma de env&iacute;o preferida para la entrega de este pedido.');
+define('TITLE_PLEASE_SELECT', 'Seleccione');
+define('TEXT_ENTER_SHIPPING_INFORMATION', 'Esta es la unica forma de env&iacute;o disponible para su pedido.');
+
+define('TABLE_HEADING_COMMENTS', 'Agregue Los Comentarios Sobre Su Orden');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuar con el Proceso de Compra');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'para seleccionar la forma de pago.');
+define('ERROR_VALID_TO_CHECKOUT', 'Please update your order ...');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/checkout_shipping_address.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/checkout_shipping_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/checkout_shipping_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_shipping_address.php,v 1.1.1.1 2004/03/04 23:41:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Realizar Compra');
+define('NAVBAR_TITLE_2', 'Cambiar Direcci&oacute;n de Entrega');
+
+define('HEADING_TITLE', 'Datos del Env&iacute;o');
+
+define('TABLE_HEADING_SHIPPING_ADDRESS', 'Direcci&oacute;n de Entrega');
+define('TEXT_SELECTED_SHIPPING_DESTINATION', 'Esta es la direcci&oacute;n de entrega seleccionada para el env&iacute;o de los productos de su pedido.');
+define('TITLE_SHIPPING_ADDRESS', 'Direcci&oacute;n de Entrega:');
+
+define('TABLE_HEADING_ADDRESS_BOOK_ENTRIES', 'Libreta de Direcciones');
+define('TEXT_SELECT_OTHER_SHIPPING_DESTINATION', 'Seleccione otra direcci&oacute;n de entrega para su pedido si quiere que sea entregado en un sitio diferente.');
+define('TITLE_PLEASE_SELECT', 'Seleccione');
+
+define('TABLE_HEADING_NEW_SHIPPING_ADDRESS', 'Nueva Direcci&oacute;n');
+define('TEXT_CREATE_NEW_SHIPPING_ADDRESS', 'Use el formulario siguiente para crear una direcci&oacute;n nueva en su libreta y usarla como direcci&oacute;n de entrega para su pedido.');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuar con el Proceso de Compra');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'para seleccionar la forma de envio.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/checkout_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/checkout_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/checkout_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: checkout_success.php,v 1.1.1.1 2004/03/04 23:41:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Pedido');
+define('NAVBAR_TITLE_2', 'Realizado con Exito');
+
+define('HEADING_TITLE', 'Su Pedido ha sido Procesado!');
+
+define('TEXT_SUCCESS', 'Su pedido ha sido realizado con &eacute;xito! Sus productos llegar&aacute;n a su destino de 2 a 5 dias laborales.');
+define('TEXT_NOTIFY_PRODUCTS', 'Por favor notifiqueme de cambios realizados a los productos seleccionados:');
+define('TEXT_SEE_ORDERS', 'Puede ver sus pedidos viendo la pagina de <a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">\'Su Cuenta\'</a> y pulsando sobre <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">\'Historial\'</a>.');
+define('TEXT_CONTACT_STORE_OWNER', 'Dirija sus preguntas al <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">administrador</a>.');
+define('TEXT_THANKS_FOR_SHOPPING', '¡Gracias por comprar con nosotros!');
+
+define('TABLE_HEADING_COMMENTS', 'Introduzca un comentario sobre su pedido');
+
+define('TABLE_HEADING_DOWNLOAD_DATE', 'Fecha Caducidad: ');
+define('TABLE_HEADING_DOWNLOAD_COUNT', ' descargas restantes');
+define('HEADING_DOWNLOAD', 'Descargue sus productos aqui:');
+define('FOOTER_DOWNLOAD', 'Puede descargar sus productos mas tarde en \'%s\'');
+
+define('PAYPAL_NAVBAR_TITLE_2_OK', 'Realizado con Exito'); // PAYPALIPN
+define('PAYPAL_NAVBAR_TITLE_2_PENDING', 'Pedido en procesamiento'); // PAYPALIPN
+define('PAYPAL_NAVBAR_TITLE_2_FAILED', 'Fallo en el pago'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_OK', 'Su Pedido ha sido Procesado!'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_PENDING', 'Su Pedido esta siendo procesado!!'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_FAILED', 'Su pago a fallado!'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_OK', 'Su pedido ha sido realizado con exito! Sus productos llegaran a su destino de 2 a 5 dias laborales.'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_PENDING', 'Su pedido esta siendo procesado!'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_FAILED', 'Su pago a fallado! Por favor verifique que los datos ingresados para pagar con Paypal sea correctos.'); // PAYPALIPN
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/contact_us.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/contact_us.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/contact_us.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/*
+  $Id: contact_us.php,v 1.1.1.1 2004/03/04 23:41:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Contactenos');
+define('NAVBAR_TITLE', 'Contactenos');
+define('TEXT_SUCCESS', 'Su consulta ha sido enviada al encargado de la tienda.');
+define('EMAIL_SUBJECT', 'Consulta desde ' . STORE_NAME);
+
+define('ENTRY_NAME', 'Nombre Completo:');
+define('ENTRY_EMAIL', 'Direcci&oacute;n E-Mail:');
+define('ENTRY_ENQUIRY', 'Consulta:');
+
+// Contact US Email Subject : DMG
+define('TEXT_EMAIL_SUBJECTS', '* select a subject *');
+define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME. ': ');
+define('ENTRY_SUBJECT','Subject:');
+
+// CRE Contact Us Enhancements 
+// VJ
+define('ENTRY_URGENT', 'Urgent:');
+define('ENTRY_SELF', 'Send myself a copy:');
+define('TEXT_SUBJECT_URGENT', 'Urgent');
+define('ENTRY_TOPIC','Email Topic:');
+define('ENTRY_TOPIC_1', 'Sales');
+define('ENTRY_TOPIC_2', 'Tracking');
+define('ENTRY_TOPIC_3', 'Technical');
+define('ENTRY_TOPIC_4', 'Sponsorship');
+define('ENTRY_TOPIC_5', 'Wholesale');
+
+define('TEXT_SUBJECT_PREFIX', 'Contact from ' . STORE_NAME . ': ');
+define('TEXT_BODY', '<DIV ><font class="text_14n">Corporate Headquarters:</font></A>
+
+
+
+<DIV ><font class="text_12wn"><b>Your Business Name <br>
+
+                              
+
+                                     Your Business Streed Address<br>
+
+
+
+                                     Your business City and postal code.<br>
+
+
+
+                                     business country</b></DIV><br>
+
+
+
+                                     Tel:  Telephone Number<br>
+
+
+
+                                     Fax:  Fax Number<br>
+
+
+
+                                     
+
+
+
+  <DIV ><br><font class="text_14n"><b>Email Contacts:</b></font></A>
+
+
+
+<DIV ><font class="text_12wn">Business Relations - <a href="mailto:info at yourstore.com" target="blank">info at yourstore.com</a><br>
+
+
+
+                                       Wholesale Inquiries - <a href="mailto:wholesale at yourstore.com" target="blank">wholesale at yourstore.com</a><br>
+
+
+
+                                       Technical Assistance - <a href="mailto:tech at yourstore.com" target="blank">tech at yourstore.com</a><br>
+
+
+
+                                     Product Inquiries - <a href="mailto:sales at yourstore.com" target="blank">sales at yourstore.com</a><br>
+
+
+
+                                     Order Status - <a href="mailto:tracking at yourstore.com" target="blank">tracking at yourstore.com</a><br>
+
+
+
+                                     <br>
+
+
+
+                                   
+
+
+
+<DIV ><font class="text_14n"><b>AOL IM Help:</b></font></A>
+
+
+
+<DIV ><font class="text_12wn">YourBusinessName -   <A href="aim:goim?screenname=YourAIM_ScreenName&message=Hi.+Are+you+there?">Click Here</a><br>
+
+: Edit this information in includes/languages/contact_us.php<br>
+
+
+
+');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/cookie_usage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/cookie_usage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/cookie_usage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: cookie_usage.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Uso de Cookies');
+define('HEADING_TITLE', 'Uso de Cookies');
+
+define('TEXT_INFORMATION', 'Hemos detectado que su navegador no soporta cookies o los tiene desactivados.<br><br>Para continuar comprando, le invitamos a activar los cookies en su navegador.<br><br>Para el navegador <b>Internet Explorer</b>, siga estas instrucciones:<br><ol><li>En el men&uacute; de Herramientas seleccione Opciones de Internet</li><li>Seleccione la pesta&ntilde;a de Seguridad y establezca el nivel de seguridad en la posici&oacute;n Media</li></ol>Hemos adoptado esta medida de seguridad en su beneficio y le pedimos disculpas anticipadas por cualquier inconveniente que pudiera ocasionarle.<br><br>Pongase en contacto con nosotros con cualquier pregunta que tenga al respecto o para realizar sus compras offline.');
+
+define('BOX_INFORMATION_HEADING', 'Seguridad y Privacidad de los Cookies');
+define('BOX_INFORMATION', 'Se deben activar cookies para continuar comprando en esta tienda para realzar la privacidad y seguridad de su visita a este sitio.<br><br>Habilitando soporte para cookies en su navegador podemos garantizar que solo usted realizar operaciones en su nombre y se asegura la privacidad de sus datos.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/create_account.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: create_account.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+// MAIL VALIDATION START //
+define('VALIDATE_YOUR_MAILADRESS', 'Click here to Validate/Activate Your account');
+define('SECOND_LINK', '<B>Or you can manually copy and paste in the following link into your browsers window:</B><BR> ');
+define('OR_VALIDATION_CODE', '<B>Your Validation Code is:</B> ');
+define('MAIL_VALIDATION', '<FONT COLOR="#FF0000"><B>You have to validate/activate your account before you can login.</B></FONT><P><B>Please click on the link below to finish the account creation process:</B> ');
+// MAIL VALIDATION END //
+
+define('NAVBAR_TITLE', 'Crear una Cuenta');
+
+define('HEADING_TITLE', 'Datos de Mi Cuenta');
+
+define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><b>NOTA:</b></font></small> Si ya ha pasado por este proceso y tiene una cuenta, por favor <a href="%s"><u>entre</u></a> en ella.');
+
+define('EMAIL_SUBJECT', 'Bienvenido a ' . STORE_NAME);
+define('EMAIL_GREET_MR', 'Estimado ' . stripslashes($HTTP_POST_VARS['Apellido']) . ',' . "\n\n");
+define('EMAIL_GREET_MS', 'Estimado ' . stripslashes($HTTP_POST_VARS['Apellido']) . ',' . "\n\n");
+define('EMAIL_GREET_NONE', 'Estimado ' . stripslashes($HTTP_POST_VARS['Nombre']) . ',' . "\n\n");
+define('EMAIL_WELCOME', 'Le damos la bienvenida a <b>' . STORE_NAME . '</b>.' . "\n\n");
+
+define('EMAIL_TEXT', 'You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n\n");
+define('ADMIN_EMAIL_WELCOME', 'Application to become a wholesale customer of <b>' . STORE_NAME . '</b>.' . "\n\n");
+define('ADMIN_EMAIL_TEXT', 'You have received an application to become a wholesale customer from your website.  Information regarding this application can be found at your online administration panel.' . "\n\n");
+
+define('EMAIL_CONFIRMATION', 'Thank you for submitting your account information to our ' . STORE_NAME . "\n\n" . 'To finish your account setup please verify your e-mail address by clicking the link below: ' . "\n\n");
+define('EMAIL_CONTACT', 'For help with any of our online services, please email the store-owner: ');
+define('EMAIL_CONTACT_TEXT', '<a href=\"mailto:' . STORE_OWNER_EMAIL_ADDRESSS . '\">' . STORE_OWNER_EMAIL_ADDRESS . '</a>' . "\n\n");
+define('EMAIL_WARNING', '<b>Note:</b> This Email address was given to us by one of our customers. If you did not signup to be a member, please send an email to ');
+define('EMAIL_WARNING_TEXT', '<a href=\"mailto:' . STORE_OWNER_EMAIL_ADDRESS . '\">' . STORE_OWNER_EMAIL_ADDRESS . '</a>' . "\n");
+
+/* ICW Credit class gift voucher begin */
+define('EMAIL_GV_INCENTIVE_HEADER', "\n\n" .'As part of our welcome to new customers, we have sent you a Gift Voucher worth %s');
+define('EMAIL_GV_REDEEM', 'The redeem code for your Gift Voucher is %s. You can enter the redeem code when checking out while making a purchase');
+define('EMAIL_GV_LINK', 'or by following this link ');
+define('EMAIL_COUPON_INCENTIVE_HEADER', 'Congratulations! to make your first visit to our online shop a more rewarding experience, we are sending you an e-Discount Coupon.' . "\n" .
+                                        ' Below are details of the Discount Coupon created just for you' . "\n");
+define('EMAIL_COUPON_REDEEM', 'To use the coupon enter the redeem code which is %s during checkout while making a purchase');
+/* ICW Credit class gift voucher end */
+define('HEADING_TITLE_CHECKOUT','Checkout Personal Info');// Added by sheetal for PWA form Title
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Crear una Cuenta');
+define('NAVBAR_TITLE_2', 'Exito');
+define('HEADING_TITLE', 'Su cuenta ha sido creada!');
+
+define('TEXT_ACCOUNT_CREATED', 'Congratulations, Your new account has been successfully created, You can now take advantage of member privileges to enhance your online shopping experience with us. If you have <small><b>ANY</b></small> questions about the operation of this online shop, please email the <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">store owner</a>.<P>
+A confirmation email with a validation/activation code has been sent to the email address that you provided us with.<P>
+You Must <b>Validate/Activate</b> Your Account Before You Can Login, Please Follow The Instructions In The Email That We Have Sent You.<P>
+If you have not received this email within five minutes, one of two things has happened:<P>
+1. Your Confirmation email was mistakenly sent to your "BULK MAIL" or "SPAM MAIL" folder by your Internet Service Provider, please check for it there.
+<P> OR <P>2. You entered your email address in wrong, please double check it or re-sign up again for an account.
+<P> If after you have checked those things, you still have not received a confirmation email please <U><a href="' . tep_href_link(FILENAME_CONTACT_US) . '">contact us</a></U> for assistence.');
+
+define('TEXT_ACCOUNT_CREATED1', 'Congratulations, Your new account has been successfully created, You can now take advantage of member privileges to enhance your online shopping experience with us. If you have <small><b>ANY</b></small> questions about the operation of this online shop, please email the <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">store owner</a> ' );
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/cvs_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/cvs_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/cvs_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+// this file was created by Clifton Murphy <blue_glowstick at yahoo.com>
+// using code supplied in a previous release by Thomas Nordstrom <t_nordstrom at yahoo.com>
+// I take no credit for any of this work. I simply created this file and
+// recompiled the distribution zip file with the fixes to prevent parse errors.
+// see the main language file for translations (IE: english.php
+/*
+  $Id: cvs_help.php,v 1.3 2004/02/4 07:28:00 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo CVV_HELP_TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 5px; margin-left: 5px; margin-right: 5px; margin-top: 5px; }
+table.ccv/cvc/ccv2/cidhelp { background: #ffffff; border: 1px solid red;}
+//--></style>
+<body marginwidth="5" marginheight="5" topmargin="5" bottommargin="5" leftmargin="5" rightmargin="5">
+<table class="ccv/cvc/ccv2/cidhelp" width="100%" border="0" cellspacing="5" cellpadding="0">
+  <tr>
+    <td colspan="2">
+    <?php echo CVV_HELP_DESC1;?>
+      </td>
+  </tr>
+  <tr>
+    <td>
+    <?php echo CVV_HELP_DESC2;?>
+    
+    </td>
+    <td><img src="images/cvm_help1.jpg" width="200" height="139"></td>
+  </tr>
+  <tr>
+    <td>&nbsp;</td>
+    <td>&nbsp;</td>
+  </tr>
+  <tr>
+    <td>
+    <?php echo CVV_HELP_DESC3;?>
+    </td>
+    <td><img src="images/cvm_help2.jpg" width="200" height="139"></td>
+  </tr>
+</table>
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/down_for_maintenance.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/down_for_maintenance.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/down_for_maintenance.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  Created by: Linda McGrath osCOMMERCE at WebMakers.com
+  
+  Update by: fram 05-05-2003
+  Updated by: Donald Harriman - 08-08-2003 - MS2
+
+  down_for_maintenance.php v1.1
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Systema no operativo - Mantenimiento');
+define('HEADING_TITLE', 'Systema no operativo _ Mantenimiento ...');
+define('DOWN_FOR_MAINTENANCE_TEXT_INFORMATION', 'Este sitio no esta fuera de servicio por mantenimiento. Porfavor intente despues.');
+define('TEXT_MAINTENANCE_ON_AT_TIME', 'The Admin / Webmaster ha permitido el mantenimiento at : ');
+define('TEXT_MAINTENANCE_PERIOD', 'Periodo de Mantenimiento : ');
+define('DOWN_FOR_MAINTENANCE_STATUS_TEXT', 'Para verificar el estado del sitio ... Tecleo aqui:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/download.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/download.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/download.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,12 @@
+<?php
+/*
+  $Id: download.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/downloadbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/downloadbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/downloadbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ define('TEXT_HEADING_DOWNLOAD_DATE', 'Date Download');
+ define('TEXT_HEADING_DOWNLOAD_COUNT', 'Number of times downloaded');
+ define('TEXT_DOWNLOAD_MY_ACCOUNT', 'My Account');
+ define('TEXT_HEADING_DOWNLOAD_FILE', 'Your download is ready. Please click the title below');
+ define('TEXT_FOOTER_DOWNLOAD', 'If your download does not appear above, you can check you order at this link:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/events_calendar.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/events_calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/events_calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: events_calendar v1.00 2003/03/08 18:09:16 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+
+  define('NAVBAR_TITLE', 'Events Calendar');
+  define('HEADING_TITLE', 'Events Calendar');
+  define('TEXT_SELECT_EVENT', 'Select event');
+  
+  define('TEXT_EVENTS_FOR', 'Events for ');
+  define('TEXT_EVENT_DATE', 'Date :');
+  define('TEXT_EVENTS_START', 'Events starting on ');
+  define('TEXT_EVENT_START_DATE', 'From :');
+  define('TEXT_EVENT_END_DATE', 'Through :');
+  define('TEXT_EVENT_LINK', 'Link :');
+  define('TEXT_EVENT_OSC_LINK', 'Event link :');
+  define('TEXT_EVENT_TITLE', 'Title :');
+  define('TEXT_EVENT_DESCRIPTION', 'Event :');
+  define('TEXT_EVENT_MORE', '... More >>');
+  define('TEXT_NO_EVENTS', 'No Events found.');
+  define('TEXT_OTHER_EVENTS', 'Other events for today :');
+
+  define('TEXT_DISPLAY_NUMBER_OF_EVENTS', 'Displaying event n° <b>%d</b><b>%_</b> of <b>%d</b> for ');
+  define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> events) ');
+  define('MAX_DISPLAY_PAGE_LINKS', 5);
+  define('MAX_DISPLAY_NUMBER_EVENTS', 5);
+  
+  define('BOX_CALENDAR_TITLE', ' View all events');
+  define('BOX_GO_BUTTON', 'go');
+  define('BOX_GO_BUTTON_TITLE', ' submit - month view ');
+  define('BOX_TODAY_BUTTON', ' T ');
+  define('BOX_TODAY_BUTTON_TITLE', ' view this month ');
+  define('BOX_YEAR_VIEW_BUTTON', ' Y ');
+  define('BOX_YEAR_VIEW_BUTTON_TITLE', ' year view ');
+  define('BOX_NEXT_LINK', 'next_month');
+  define('BOX_PREV_LINK', 'previous_month');
+  define('BOX_CLICK_LINK', 'Click for events');
+  
+  define('FIRST_DAY_OF_WEEK', 0);// First day of the week  1=Monday 0=Sunday;
+
+  define('NUMBER_OF_YEARS', 5);  //n° of years to be shown in drop-down
+  
+  define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
+  
+
+  
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+define('NAVBAR_TITLE', 'FAQ');
+
+define('HEADING_TITLE', 'Frequently Asked Questions');
+define('FAQ_BACK_TO_TOP', '[Back To Top]');
+
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/faq_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/faq_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/faq_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+define('NAVBAR_TITLE', 'FAQ');
+
+define('TABLE_HEADING_NEW_FAQ', 'Frequently Asked Questions');
+define('FAQ_BACK_TO_TOP', '[Back To Top]');
+
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/featured_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/featured_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/featured_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Featured Products Listing Language File
+*/
+
+define('NAVBAR_TITLE', 'Productos Ofrecidos');
+define('HEADING_TITLE', 'Productos Ofrecidos');
+
+define('TEXT_NO_FEATURED_PRODUCTS', 'No hay Productos Ofrecidos.');
+define('TEXT_DATE_ADDED', 'Fecha Agregada:');
+define('TEXT_MANUFACTURER', 'Fabricante:');
+define('TEXT_PRICE', 'Precio:');
+
+  define('TABLE_HEADING_IMAGE', 'Product Image');
+  define('TABLE_HEADING_MODEL', 'Model');
+  define('TABLE_HEADING_PRODUCTS', 'Product Name');
+  define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+  define('TABLE_HEADING_QUANTITY', 'Quantity');
+  define('TABLE_HEADING_PRICE', 'Price');
+  define('TABLE_HEADING_WEIGHT', 'Weight');
+  define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+  define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+  define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+  define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+  define('TEXT_SHOW', '<b>Show:</b>');
+  define('TEXT_BUY', 'Buy 1 \'');
+  define('TEXT_NOW', '\' now');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/gv_faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/gv_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/gv_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: gv_faq.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Vale del Regalo FAQ');
+define('HEADING_TITLE', 'Vale del Regalo FAQ');
+
+define('TEXT_INFORMATION', '<a name="Top"></a>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=1','NONSSL').'">Compra del Vale de Regalo</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=2','NONSSL').'">Como enviar los vales del Regalo</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=3','NONSSL').'">Compra con los vales del Regalo</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=4','NONSSL').'">Vales del Regalo el redimir</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=5','NONSSL').'">Cuando ocurren los problems</a><br>
+');
+switch ($HTTP_GET_VARS['faq_item']) {
+  case '1':
+define('SUB_HEADING_TITLE','Compra de vales de Regalo.');
+define('SUB_HEADING_TEXT','Los vales de regalo son comprados como cualquiera otro articulo in nuestra tienda. Usted puede pagar por ellos utilizando los metodos corrientes de la tienda. 
+  Una vez que usted haya comprado el Vale de Regalo, el sera agregado automaticamente a su cuenta de Vales de Regalo. SI usted tiene fondos en la cuenta de Vales de Regalo, Usted notara la cantidad que aparecera en la cuenta de ahorros, tambien es proporsionado el acoplamiento a una pagine adonde usted puede enviar el vale de regalo a alguien via Email.');
+  break;
+  case '2':
+define('SUB_HEADING_TITLE','Como enviar el Vale de Regalo.');
+define('SUB_HEADING_TEXT','Para enviar un Vale de Regalo usted necesita ir a nuestra Pagina de Vales de Regalo. Usted puede encontrar el acoplamiento de esta pagina en la caja del carro de compras, en el las columnas del lado derecho de cada pagina. Cuando usted envie un Vale de Regalo, Usted necesita especificar la siguiente Informacion.
+  El Nombre de la persona a quien usted esta enviando el Vale de Regalo, La direccion del Email a quien usted esta enviando el Vale de Regalo, La cantida que usted desea enviar.(Nota usted no tiene que mandar toda la candidad que es en su cuenta de vales de regalo.)
+  A corto mensage que aparecera en el email.
+  Pofavor verifique qu la informacion es correcta, ademas usted tendra la oportunidad de hacer todos los cambios que usted desea antes de enviar el email.');  
+  break;
+  case '3':
+  define('SUB_HEADING_TITLE','Comprar con Vales de Regalos.');
+  define('SUB_HEADING_TEXT','Si usted tiene fondos en la cuenta de vales de regalos, Usted puede utilizar esos fondos para comprar otros articulos en la tienda. En la etapa de Comprobacion, una addicional caja aparecera. En esta caja se applicaran los fondos en su cuenta de vales de regalo. 
+  Porfavor tome nota que usted tiene que seleccionar otro medio de pago si no hay suficiente cantidad in su cuenta de vales de regalo que cubran el costo de las compras. 
+  SI usted tiene fondos en su cuenta de Vales de Regalo, entonces el total de sus compras seran substraidas de la cuenta de vales de regalo y el balace sera mantenido en la cuenta para futuras compras.');
+  break;
+  case '4':
+  define('SUB_HEADING_TITLE','Redimir Vales de Regalo.');
+  define('SUB_HEADING_TEXT','Si usted recivio el vale de regalos por Email, el contendra la informacion de quien lo envio, tambien con un mensage corto. El Email tambien contiene el Numero del Vale de Regalo. Es recomendado que se imprima el email fara futuras referencias. Usted puede redimir este vale de regalo en dos formas.<br>
+  1. Por Teclando el acoplamiento que contiene este Email. 
+  Este lo llevara a la tienda\'s Redeem Voucher page. Se le pedira que Habra una cuenta antes que el vale de regalo sea validado y puesto en su Cuenta de Vale de Regalo y este lista para que usted comience a hacer sus compras.<br>
+  2. Durante el proceso de la comprabacion en la misma pagina usted puede selecionar la forma de pago, habra una caja para que usted pueda entrar el code de dedimir. Entre el code aqui, y oprima el boton the redimir. El code sera validado y agregado a su cuenta de vale de regalo. Usted puede utilizar la cantidad para comprar cualquier articulo en nustra tienda');
+  break;
+  case '5':
+  define('SUB_HEADING_TITLE','Cuando problemas occurren.');
+  define('SUB_HEADING_TEXT','Para cualquier preguntas relationadas con los Vales de Regalos System, favor de contactar a la tienda 
+  by email at '. STORE_OWNER_EMAIL_ADDRESS . '. Porfavor Conciorese de dar tanta informacion posible en el email. ');
+  break;
+  default:
+  define('SUB_HEADING_TITLE','');
+  define('SUB_HEADING_TEXT','Porvavor elija una de las preguntas de arriba.');
+
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/gv_redeem.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/gv_redeem.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/gv_redeem.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: gv_redeem.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Redima el Vale del Regalo');
+define('HEADING_TITLE', 'Redima el Vale del Regalo');
+define('TEXT_INFORMATION', 'Para obtener mayor informacion in referencia con los vales del regalo, Porfavor vea  nuestro <a href="' . tep_href_link(FILENAME_GV_FAQ,'','NONSSL').'">'.GV_FAQ.'.</a>');
+define('TEXT_INVALID_GV', 'El numero del Vale de Regalo es incorrecto o el ha sido redimido. Para entran en contacto con el dueno de la tienda, porfavor use la pagina del contacto');
+define('TEXT_VALID_GV', 'Felicidades usted ha demidido el vale de regalo con valor %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/gv_send.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/gv_send.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/gv_send.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: gv_send.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Envie el Vale del Regalo');
+define('NAVBAR_TITLE', 'Envie el Vale del Regalo');
+define('EMAIL_SUBJECT', 'Investigue' . STORE_NAME);
+define('HEADING_TEXT','<br>Entre por favor debajo de los detalles del vale del regalo que usted desea enviar. para mas informacion, por favor vea nuestro <a href="' . tep_href_link(FILENAME_GV_FAQ,'','NONSSL').'">'.GV_FAQ.'.</a><br>');
+define('ENTRY_NAME', 'Nombre de los Recipientes:');
+define('ENTRY_EMAIL', 'Recipientes E-Mail Address:');
+define('ENTRY_MESSAGE', 'Mensaje para los Recipientes:');
+define('ENTRY_AMOUNT', 'Cantidad de Vale del Regalo:');
+define('ERROR_ENTRY_AMOUNT_CHECK', '&nbsp;&nbsp;<span class="errorText">Invalid Amount</span>');
+define('ERROR_ENTRY_EMAIL_ADDRESS_CHECK', '&nbsp;&nbsp;<span class="errorText">Invalid Email Address</span>');
+define('MAIN_MESSAGE', 'Usted ha decidido fijar un valor del vale de regalo %s to %s who\'s email address is %s<br><br>El texto que acompana el email dice<br><br>Dear %s<br><br>
+                        Le han enviado un vale con valor de %s by %s');
+
+define('PERSONAL_MESSAGE', '%s mensage');
+define('TEXT_SUCCESS', 'Felicidades, su vale de regalo ha sido enviado con exito');
+
+
+define('EMAIL_SEPARATOR', '----------------------------------------------------------------------------------------');
+define('EMAIL_GV_TEXT_HEADER', 'Felicidas, Usted ha recivido un vale de regalo con valor de %s');
+define('EMAIL_GV_TEXT_SUBJECT', 'El Regalo es de %s');
+define('EMAIL_GV_FROM', 'Este vale de regalo ha sido enviado para usted de %s');
+define('EMAIL_GV_MESSAGE', 'Con un refran del mensaje ');
+define('EMAIL_GV_SEND_TO', 'Hola, %s');
+define('EMAIL_GV_REDEEM', 'Para redimir este vale de regalo, chasque porfavor encendido el acoplamiento abajo. Porfavor tambien escriba el codigo de rescate is %s. (In caso que tenga problemas)');
+define('EMAIL_GV_LINK', 'Para dedimir por favor chasque');
+define('EMAIL_GV_VISIT', ' or visite ');
+define('EMAIL_GV_ENTER', ' and entre el code ');
+define('EMAIL_GV_FIXED_FOOTER', 'Si usted encuentra problemas que redime el vale del regalo usando el acoplamiento usado arriba, ' . "\n" .
+                                'Usted puede tambien introducir el codigo del vale de regalo durante el processo de dela comprobacion en nuestra tienda.' . "\n\n");
+define('EMAIL_GV_SHOP_FOOTER', '');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/header_tags.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/header_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/header_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+// /catalog/includes/languages/english/header_tags.php
+// WebMakers.com Added: Header Tags Generator v2.5.2
+// Add META TAGS and Modify TITLE
+//
+// DEFINITIONS FOR /includes/languages/english/header_tags.php
+
+// Define your email address to appear on all pages
+define('HEAD_REPLY_TAG_ALL', STORE_OWNER_EMAIL_ADDRESS);
+
+// For all pages not defined or left blank, and for products not defined
+// These are included unless you set the toggle switch in each section below to OFF ( '0' )
+// The HEAD_TITLE_TAG_ALL is included AFTER the specific one for the page
+// The HEAD_DESC_TAG_ALL is included AFTER the specific one for the page
+// The HEAD_KEY_TAG_ALL is included AFTER the specific one for the page
+define('HEAD_TITLE_TAG_ALL', STORE_NAME);
+define('HEAD_DESC_TAG_ALL','What\'s New Here? - Hardware Software DVD Movies');
+define('HEAD_KEY_TAG_ALL','Hardware, Software, DVD Movies, Computer');
+
+// DEFINE TAGS FOR INDIVIDUAL PAGES
+
+// index.php
+define('HTTA_DEFAULT_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title
+define('HTKA_DEFAULT_ON','1'); // Include HEAD_KEY_TAG_ALL in Keywords
+define('HTDA_DEFAULT_ON','1'); // Include HEAD_DESC_TAG_ALL in Description
+define('HTTA_CAT_DEFAULT_ON', '0'); //Include HEADE_TITLE_DEFAULT in CATEGORY DISPLAY
+define('HEAD_TITLE_TAG_DEFAULT', 'CRE Loaded 6');
+define('HEAD_DESC_TAG_DEFAULT','osCommerce : What\'s New Here? - Hardware Software DVD Movies');
+define('HEAD_KEY_TAG_DEFAULT','Hardware, Software, DVD Movies, Computer');
+
+// product_info.php - if left blank in products_description table these values will be used
+define('HTTA_PRODUCT_INFO_ON','1');
+define('HTKA_PRODUCT_INFO_ON','1');
+define('HTDA_PRODUCT_INFO_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_INFO','');
+define('HEAD_DESC_TAG_PRODUCT_INFO','');
+define('HEAD_KEY_TAG_PRODUCT_INFO','');
+
+// products_new.php - whats_new
+define('HTTA_WHATS_NEW_ON','1');
+define('HTKA_WHATS_NEW_ON','1');
+define('HTDA_WHATS_NEW_ON','1');
+define('HEAD_TITLE_TAG_WHATS_NEW', 'New Products');
+define('HEAD_DESC_TAG_WHATS_NEW', '');
+define('HEAD_KEY_TAG_WHATS_NEW', '');
+
+// specials.php
+// If HEAD_KEY_TAG_SPECIALS is left blank, it will build the keywords from the products_names of all products on special
+define('HTTA_SPECIALS_ON','1');
+define('HTKA_SPECIALS_ON','1');
+define('HTDA_SPECIALS_ON','1');
+define('HEAD_TITLE_TAG_SPECIALS','Specials');
+define('HEAD_DESC_TAG_SPECIALS','');
+define('HEAD_KEY_TAG_SPECIALS','');
+
+// product_reviews_info.php and product_reviews.php - if left blank in products_description table these values will be used
+define('HTTA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HTKA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HTDA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_REVIEWS_INFO','');
+define('HEAD_DESC_TAG_PRODUCT_REVIEWS_INFO','');
+define('HEAD_KEY_TAG_PRODUCT_REVIEWS_INFO','');
+
+// PRODUCTS_REVIEWS_WRITE.PHP
+define('HTTA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HTKA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HTDA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_REVIEWS_WRITE','');
+define('HEAD_DESC_TAG_PRODUCT_REVIEWS_WRITE','');
+define('HEAD_KEY_TAG_PRODUCT_REVIEWS_WRITE','');
+
+ // ALLPRODS.PHP
+define('HTTA_ALLPRODS_ON','1');
+define('HTKA_ALLPRODS_ON','1');
+define('HTDA_ALLPRODS_ON','1');
+define('HEAD_TITLE_TAG_ALLPRODS','');
+define('HEAD_DESC_TAG_ALLPRODS','');
+define('HEAD_KEY_TAG_ALLPRODS','');
+
+// articles.php
+define('HTTA_ARTICLES_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title
+define('HTKA_ARTICLES_ON','0'); // Include HEAD_KEY_TAG_ALL in Keywords
+define('HTDA_ARTICLES_ON','0'); // Include HEAD_DESC_TAG_ALL in Description
+define('HEAD_TITLE_TAG_ARTICLES','CRE Loaded Store Articles');
+define('HEAD_DESC_TAG_ARTICLES','Articles');
+define('HEAD_KEY_TAG_ARTICLES','articles');
+
+// article_info.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_INFO_ON','1');
+define('HTKA_ARTICLE_INFO_ON','1');
+define('HTDA_ARTICLE_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_INFO','Articles');
+define('HEAD_DESC_TAG_ARTICLE_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_INFO','');
+
+// articles_new.php - new articles
+// If HEAD_KEY_TAG_ARTICLES_NEW is left blank, it will build the keywords from the articles_names of all new articles
+define('HTTA_ARTICLES_NEW_ON','1');
+define('HTKA_ARTICLES_NEW_ON','1');
+define('HTDA_ARTICLES_NEW_ON','1');
+define('HEAD_TITLE_TAG_ARTICLES_NEW','Lastest Articles');
+define('HEAD_DESC_TAG_ARTICLES_NEW','');
+define('HEAD_KEY_TAG_ARTICLES_NEW','');
+
+// article_reviews_info.php and article_reviews.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTKA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTDA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_DESC_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_REVIEWS_INFO','');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/images/icon.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/languages/espanol/images/icon.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/languages/espanol/images/icon.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/languages/espanol/images/icon.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/languages/espanol/index.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: index.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_MAIN', 'Esta es la configuraci&oacute;n por defecto de osCommerce, los productos mostrados aqui son &uacute;nicamente para demonstraci&oacute;n, <b>cualquier compra realizada no ser&aacute; entregada al cliente, ni se le cobrar&aacute;</b>. Cualquier informaci&oacute;n que vea sobre estos productos debe ser tratada como ficticia.<br><br>Si desea descargar la soluci&oacute;n que hace posible esta tienda, o si quiere contribuir al proyecto de osCommerce, por favor visite <a href="http://oscommerce.com"><u>la web de soporte de osCommerce</u></a>. Esta tienda corre bajo la version <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font>.<br><br>Este texto se puede cambiar editando el siguiente fichero, uno por cada idioma: [camino&nbsp;al&nbsp;cat&aacute;logo]/includes/languages/[language]/default.php.<br><br>Puede editarlo manualmente, o a traves de la Herramienta de Administraci&oacute;n con la opci&oacute;n Idiomas->[idioma]->Definir, o utilizando el Herramientas->Administrador de Ficheros.');
+define('TABLE_HEADING_NEW_PRODUCTS', 'Nuevos Productos En %s');
+define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Pr&oacute;ximamente');
+define('TABLE_HEADING_DATE_EXPECTED', 'Lanzamiento');
+define('TABLE_HEADING_DEFAULT_SPECIALS', 'Specials For %s');
+
+if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
+  define('HEADING_TITLE', 'A ver que tenemos aqui');
+
+  define('TABLE_HEADING_IMAGE', '');
+  define('TABLE_HEADING_MODEL', 'Modelo');
+  define('TABLE_HEADING_PRODUCTS', 'Productos');
+  define('TABLE_HEADING_MANUFACTURER', 'Fabricante');
+  define('TABLE_HEADING_QUANTITY', 'Cantidad');
+  define('TABLE_HEADING_PRICE', 'Precio');
+  define('TABLE_HEADING_WEIGHT', 'Peso');
+  define('TABLE_HEADING_BUY_NOW', 'Compre Ahora');
+  define('TEXT_NO_PRODUCTS', 'No hay productos en esta categoria.');
+  define('TEXT_NO_PRODUCTS2', 'No hay productos de este fabricante.');
+  define('TEXT_NUMBER_OF_PRODUCTS', 'N&uacute;mero de Productos: ');
+  define('TEXT_SHOW', '<b>Mostrar:</b>');
+  define('TEXT_BUY', 'Compre 1 \'');
+  define('TEXT_NOW', '\' ahora');
+  define('TEXT_ALL_CATEGORIES', 'Todas');
+  define('TEXT_ALL_MANUFACTURERS', 'Todos');
+} elseif ($category_depth == 'top') {
+  define('HEADING_TITLE', '&iquest;Que hay de nuevo por aqui?');
+} elseif ($category_depth == 'nested') {
+  define('HEADING_TITLE', 'Categorias');
+}
+  define('HEADING_CUSTOMER_GREETING', 'Our Customer Greeting');
+  define('MAINPAGE_HEADING_TITLE', 'Main Page Heading Title');
+// BOF: Lango added for Featured Products
+  define('TABLE_HEADING_FEATURED_PRODUCTS', 'Featured Products');
+  define('TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY', 'Featured Products in %s'); 
+// EOF: Lango added for Featured Products
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/info_shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/info_shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/info_shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: info_shopping_cart.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Cesta del Visitante / Cesta del Asociado');
+define('SUB_HEADING_TITLE_1', 'Cesta de Visitante');
+define('SUB_HEADING_TITLE_2', 'Cesta de Asociado');
+define('SUB_HEADING_TITLE_3', 'Informaci&oacute;n');
+define('SUB_HEADING_TEXT_1', 'A cada visitante de nuestro cat&aacute;logo le es asignado una \'Cesta de Visitante\'. Esto permite al invitado guardar sus productos en una cesta temporal. Una vez que el visitante abandona el cat&aacute;logo, tambien desaparece el contenido de su cesta.');
+define('SUB_HEADING_TEXT_2', 'A cada miembro nuestro se le asigna una \'Cesta de Asociado\'. Esto permite al asociado a&ntilde;adir productos a su cesta de la compra, y volver mas tarde para finalizar el pedido. Todos los productos permanecen en la cesta hasta que el asociado ha realizado el pedido, o hasta que sean eliminados de la cesta manualmente.');
+define('SUB_HEADING_TEXT_3', 'Si un asociado a&ntilde;ade un articulo a su \'Cesta de Visitante\' y despues decide Entrar a su Cuenta para usar su \'Cesta de Asociado\', el contenido de la \'Cesta de Visitante\' sera a&ntilde;adido a la \'Cesta de Asociado\' autom&aacute;ticamente.');
+define('TEXT_CLOSE_WINDOW', '[ cerrar ventana ]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/information.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+  define('HEADING_TITLE', 'Information');
+  define('ACTION_INFORMATION', 'Action');
+  define('ACTIVATION_ID_INFORMATION', 'Activation the information ID=');
+  define('ADD_INFORMATION', 'Add new information');
+  define('ADD_QUEUE_INFORMATION', ' Add information to queue');
+  define('ALERT_INFORMATION', 'Empty information system');
+  define('ANSWER_INFORMATION', 'Answer');
+  define('CONFIRM_INFORMATION', 'Confirm');
+  define('DEACTIVATION_ID_INFORMATION', 'Deactivation the information ID=');
+  define('DELETE_CONFITMATION_ID_INFORMATION', 'Delete Confirmation information ID=');
+  define('DELETE_ID_INFORMATION', 'Delete the information ID=');
+  define('DELETED_ID_INFORMATION', 'Deleted the information ID=');
+  define('EDIT_ID_INFORMATION', 'Edit the information ID=');
+  define('ERROR_20_INFORMATION', 'You have not defined a valid value for option <b>Queue</b>. You can only define a numeric value');
+  define('ERROR_80_INFORMATION', 'You did not fill all <b>necessary fields</b>');
+  define('INFORMATION_ID_ACTIVE', 'this information is Active');
+  define('INFORMATION_ID_DEACTIVE', 'this information is NOT active');
+  define('ID_INFORMATION', 'ID');
+  define('TITLE_INFORMATION', 'Title');
+  define('DESCRIPTION_INFORMATION', 'Description');
+  define('QUEUE_INFORMATION', 'Queue');
+  define('QUEUE_INFORMATION_LIST', 'QueueList: ');
+  define('MANAGER_INFORMATION', 'Information Manager');
+  define('NO_INFORMATION', 'No');
+  define('PUBLIC_INFORMATION', 'Public');
+  define('SORT_BY', 'In information Page this Sort by');
+  define('SUCCED_INFORMATION', ' Succeed');
+  define('TITLE', 'Information system');
+  define('VIEW_INFORMATION', 'Information View');
+  define('VISIBLE_INFORMATION', 'Visible');
+  define('VISIBLE_INFORMATION_DO', '( To Do visible )');
+  define('UPDATE_ID_INFORMATION', 'Updated information ID=');
+  define('WARNING_INFORMATION', 'Warning');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/informationbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/informationbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/informationbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ // information box text in includes/boxes/information.php
+define('BOX_HEADING_INFORMATION', 'Information');
+define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
+define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
+define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');
+define('BOX_INFORMATION_CONTACT', 'Contact Us');
+define('BOX_INFORMATION_LINKS', 'Links');
+define('BOX_INFORMATION_TRACKING', 'Information');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/ipn.lng.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/ipn.lng.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/ipn.lng.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: ipn.lng.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('UNKNOWN_TXN_TYPE', 'Unknown Transaction Type');
+  define('UNKNOWN_TXN_TYPE_MSG', 'An unknown transaction (%s) occurred from ' . $_SERVER['REMOTE_ADDR'] . "\nAre you running any tests?\n\n");
+  define('UNKNOWN_POST', 'Unknown Post');
+  define('UNKNOWN_POST_MSG', "An unknown POST from %s was received.\nAre you running any tests?\n\n");
+  define('EMAIL_SEPARATOR', "------------------------------------------------------");
+  define('RESPONSE_VERIFIED', 'Verified');
+  define('RESPONSE_MSG', "Connection Type\n".EMAIL_SEPARATOR."\ncurl= %s, socket= %s, domain= %s, port= %s \n\nPayPal Response\n".EMAIL_SEPARATOR."\n%s \n\n");
+  define('RESPONSE_INVALID', 'Invalid PayPal Response');
+  define('RESPONSE_UNKNOWN', 'Unknown Verfication');
+  define('EMAIL_RECEIVER', 'Email and Business ID config');
+  define('EMAIL_RECEIVER_MSG', "Store Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n".EMAIL_SEPARATOR."\nPayPal Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n\n");
+  define('EMAIL_RECEIVER_ERROR_MSG', "Store Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n".EMAIL_SEPARATOR."\nPayPal Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n\nPayPal Transaction ID: %s\n\n");
+  define('TXN_DUPLICATE', 'Duplicate Transaction');
+  define('TXN_DUPLICATE_MSG', "A duplicate IPN transaction (%s) has been received.\nPlease check your PayPal Account\n\n");
+  define('IPN_TXN_INSERT', "IPN INSERTED");
+  define('IPN_TXN_INSERT_MSG', "IPN %s has been inserted\n\n");
+  define('CHECK_CURRENCY', 'Validate Currency');
+  define('CHECK_CURRENCY_MSG', "Incorrect Currency\nPayPal: %s\nosC: %s\n\n");
+  define('CHECK_TXN_SIGNATURE', 'Validate PayPal_Shopping_Cart Transaction Signature');
+  define('CHECK_TXN_SIGNATURE_MSG', "Incorrect Signature\nPayPal: %s\nosC: %s\n\n");
+  define('CHECK_TOTAL', 'Validate Total Transaction Amount');
+  define('CHECK_TOTAL_MSG', "Incorrect Total\nPayPal: %s\nSession: %s\n\n");
+  define('DEBUG', 'Debug');
+  define('DEBUG_MSG', "\nOriginal Post\n".EMAIL_SEPARATOR."\n%s\n\n\nReconstructed Post\n".EMAIL_SEPARATOR."\n%s\n\n");
+  define('PAYMENT_SEND_MONEY_DESCRIPTION', 'Money Received');
+  define('PAYMENT_SEND_MONEY_DESCRIPTION_MSG', "You have received a payment of %s %s \n".EMAIL_SEPARATOR."\nThis payment was sent by someone from the PayPal website, using the Send Money tab\n\n");
+  define('TEST_INCOMPLETE', 'Invalid Test');
+  define('TEST_INCOMPLETE_MSG', "An error has occured, mostly likely because the Custom field in the IPN Test Panel did not have a valid transaction id.\n\n\n");
+  define('HTTP_ERROR', 'HTTP Error');
+  define('HTTP_ERROR_MSG', "An HTTP Error occured during authentication\n".EMAIL_SEPARATOR."\ncurl= %s, socket= %s, domain= %s, port= %s\n\n");
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/links.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: links.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Acoplamiento');
+
+if ($display_mode == 'links') {
+  define('HEADING_TITLE', 'Acoplamiento');
+  define('TABLE_HEADING_LINKS_IMAGE', '');
+  define('TABLE_HEADING_LINKS_TITLE', 'Titulo');
+  define('TABLE_HEADING_LINKS_URL', 'URL');
+  define('TABLE_HEADING_LINKS_DESCRIPTION', 'Descripcion');
+  define('TABLE_HEADING_LINKS_COUNT', 'Tecleo');
+  define('TEXT_NO_LINKS', 'No hay acoplamientos a enumerar e esta categoria.');
+} elseif ($display_mode == 'categories') {
+  define('HEADING_TITLE', 'Categorias del Acoplamiento');
+  define('TEXT_NO_CATEGORIES', 'No hay categorias del acoplamiento a enumerar todavia.');
+}
+
+// VJ todo - move to common language file
+define('TEXT_DISPLAY_NUMBER_OF_LINKS', 'Exibir <b>%d</b> to <b>%d</b> (of <b>%d</b> acoplamiento)');
+
+define('IMAGE_BUTTON_SUBMIT_LINK', 'Somete el Acoplamiento');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/links_submit.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/links_submit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/links_submit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: links_submit.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Acoplamiento');
+define('NAVBAR_TITLE_2', 'Someta un Acomplamiento');
+
+define('HEADING_TITLE', 'Informacion del Acomplamiento');
+
+define('TEXT_MAIN', 'Favor de llenar la siguiente forma para sometir a su website.');
+
+define('EMAIL_SUBJECT', 'Bien venido a' . STORE_NAME . ' Intercambio del Acoplamiento.');
+define('EMAIL_GREET_NONE', 'Querido %s' . "\n\n");
+define('EMAIL_WELCOME', 'Nosotros le damos la bien venida <b>' . STORE_NAME . '</b> Programa de acoplamiento y intercambio.' . "\n\n");
+define('EMAIL_TEXT', 'Su acoplamiento ha sido submitido con exito ' . STORE_NAME . '. El sera agregado a nuestro listado tan pronto cuando el sea aprovado. Uster recibira un email en referencia con el estado de su submittal. Si usted no lo ha recibido dentro de las proximas 48 horas, Porfavor contacte nos antes de someter su acoplamiento otra vez.' . "\n\n");
+define('EMAIL_CONTACT', 'Para la ayuda dentro de nuestro programa de intercambio del acoplamiento, Porfavor email al dueno de la tienda: ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n\n");
+define('EMAIL_WARNING', '<b>Note:</b> Esta direccion del email fue proporcionada a nosotros cuando su acoplamiento fue sometido. Si usted tiene problemas, favor de enviar un email to ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n");
+define('EMAIL_OWNER_SUBJECT', 'Acoplamiento submitido at ' . STORE_NAME);
+define('EMAIL_OWNER_TEXT', 'An nuevo acoplamiento fue submitido al ' . STORE_NAME . '. Si el no ha sido aprovado. por favor de verificar que el acoplamiento este activo.' . "\n\n");
+
+define('TEXT_LINKS_HELP_LINK', '&nbsp;Help&nbsp;[?]');
+
+define('HEADING_LINKS_HELP', 'Links Help');
+define('TEXT_LINKS_HELP', '<b>Titulo del Sitio:</b> Un descriptive titulo para su website.<br><br><b>URL:</b> La  absoluta direccion de su website, incluyendo las \'http://\'.<br><br><b>Categorias:</b> las mas appopiadas categorias bajo dela cual su website caiga.<br><br><b>Description:</b> Una breve escripcion de su website.<br><br><b>Image URL:</b> La absoluta URL de la image que usted desea submitir, incluyendo el \'http://\'. Esta image sera exibida junto con su website acoplamiento.<br>Eg: http://your-domain.com/path/to/your/image.gif <br><br><b>Full Name:</b> Su Nombre Completo.<br><br><b>Email:</b> La direccion de su email. Por favor entre un email valido, Usted sera notificado via email.<br><br><b>Reciprocal Page:</b> El absolute URL del acoplamiento de su pagina, adonde el acoplamiento a nuestra website sera mencionado/displayed.<br>Eg: http://your-domain.com/path/to/your/links_page.php');
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+// VJ todo - move to common language file
+define('CATEGORY_WEBSITE', 'Detalles del Website');
+define('CATEGORY_RECIPROCAL', 'Detalles Reciprocal de la Pagina');
+
+define('ENTRY_LINKS_TITLE', 'Titulo del Sitio:');
+define('ENTRY_LINKS_TITLE_ERROR', 'El Titulo del acoplamiento debe de contener un minimo de ' . ENTRY_LINKS_TITLE_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_TITLE_TEXT', '*');
+define('ENTRY_LINKS_URL', 'URL:');
+define('ENTRY_LINKS_URL_ERROR', 'URL debe de contener un minimo de ' . ENTRY_LINKS_URL_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_URL_TEXT', '*');
+define('ENTRY_LINKS_CATEGORY', 'Categoria:');
+define('ENTRY_LINKS_CATEGORY_TEXT', '*');
+define('ENTRY_LINKS_DESCRIPTION', 'Descripcion:');
+define('ENTRY_LINKS_DESCRIPTION_ERROR', 'Descripcion debe de contener un minimo de ' . ENTRY_LINKS_DESCRIPTION_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_DESCRIPTION_TEXT', '*');
+define('ENTRY_LINKS_IMAGE', 'Image URL:');
+define('ENTRY_LINKS_IMAGE_TEXT', '');
+define('ENTRY_LINKS_CONTACT_NAME', 'Nombre completo:');
+define('ENTRY_LINKS_CONTACT_NAME_ERROR', 'Su Nombre completo debe de contener un minimo de ' . ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_CONTACT_NAME_TEXT', '*');
+define('ENTRY_LINKS_RECIPROCAL_URL', 'Reciprocal Pagina:');
+define('ENTRY_LINKS_RECIPROCAL_URL_ERROR', 'Reciprocal pagina debe de contener un minimo de ' . ENTRY_LINKS_URL_MIN_LENGTH . ' characters.');
+define('ENTRY_LINKS_RECIPROCAL_URL_TEXT', '*');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/links_submit_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/links_submit_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/links_submit_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: links_submit_success.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Acoplamiento');
+define('NAVBAR_TITLE_2', 'Exito');
+define('HEADING_TITLE', 'Se ha submitido su acoplamiento!');
+define('TEXT_LINK_SUBMITTED', 'Felicidades! Su acoplamiento ha sido submitido con exito! El sera agregado en nuestra lista tan pronto como lo aprovemos a el. Si usted tiene <small><b>ANY</b></small> preguntas, porfavor email the <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">dueno de la tienda</a>.<br><br>Usted recivira un email confirmando su submittal. Si usted no lo recibe dentro de una hora, por favor <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">contact us</a>. Tambien, Uster recivira un email cuando su acoplamiento sea aprovado.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/login.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: login.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//Email Validation
+define('TEXT_LOGIN_ERROR_VALIDATION', 'Error: Your account is not validated.');
+define('TEXT_YOU_HAVE_TO_VALIDATE', 'Please insert your Validation-key to confirm your registration');
+define('ENTRY_VALIDATION_CODE', 'Validation-key');
+define('TEXT_NEW_VALIDATION_CODE', '<b>Request a new Validation-key <u>here</u></b>');
+
+define('NAVBAR_TITLE', 'Entrar');
+
+define('HEADING_TITLE', 'Dejame Entrar!');
+
+define('HEADING_NEW_CUSTOMER', 'Nuevo Cliente');
+define('TEXT_NEW_CUSTOMER', 'Soy un nuevo cliente.');
+define('TEXT_NEW_CUSTOMER_INTRODUCTION', 'Al crear una cuenta en ' . STORE_NAME . ' podrá realizar sus compras rapidamente, revisar el estado de sus pedidos y consultar sus operaciones anteriores.');
+define('HEADING_RETURNING_CUSTOMER', 'Ya Soy Cliente');
+define('TEXT_RETURNING_CUSTOMER', 'He comprado otras veces.');
+
+define('TEXT_PASSWORD_FORGOTTEN', '&iquest;Ha olvidado su contrase&ntilde;a? Siga este enlace y se la enviamos.');
+
+define('TEXT_LOGIN_ERROR', 'Error: El E-Mail y/o Contrase&ntilde;a no figuran en nuestros datos.');
+define('TEXT_VISITORS_CART', '<font color="#ff0000"><b>Nota:</b></font> El contenido de su &quot;Cesta de Visitante&quot; ser&aacute; a&ntilde;adido a su &quot;Cesta de Asociado&quot; una vez que haya entrado. <a href="javascript:session_win();">[M&aacute;s Informaci&oacute;n]</a>');
+// Begin Checkout Without Account v0.70 changes
+
+define('PWA_FAIL_ACCOUNT_EXISTS', 'An account already exists for the email address {EMAIL_ADDRESS}.  You must login here with the password for that account before proceeding to checkout.');
+// Begin Checkout Without Account v0.60 changes
+define('HEADING_CHECKOUT', '<font size="2">Proceed Directly to Checkout</font>');
+define('TEXT_CHECKOUT_INTRODUCTION', 'Proceed to Checkout without creating an account. By choosing this option none of your user information will be kept in our records, and you will not be able to review your order status, nor keep track of your previous orders.');
+define('PROCEED_TO_CHECKOUT', 'Proceed to Checkout without Registering');
+// End Checkout Without Account changes
+// Eversun mod for sppc and qty price breaks
+// define the email address that can change customer_group_id on login
+define('SPPC_TOGGLE_LOGIN_PASSWORD', 'support at creloaded.com');
+// Eversun mod for sppc and qty price breaks
+
+define('LOGIN_TITLE1', 'Choose a Customer Group');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  WebMakers.com Added: loginbox.php
+  Originally written by: Aubrey Kilian <aubrey at mycon.co.za>
+  Re-written by Linda McGrath osCOMMERCE at WebMakers.com
+  Modified by Justin of World Famous Comics <justin at wfcomics.com>
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('BOX_HEADING_LOGIN_BOX_MY_ACCOUNT','Inoformacion de mi cuenta.');
+
+  define('LOGIN_BOX_MY_ACCOUNT','Descripcion de mi Cuenta');
+  define('LOGIN_BOX_ACCOUNT_EDIT','Corrija la inofrmacion de mi cuenta');
+  define('LOGIN_BOX_ADDRESS_BOOK','Corrija el Directorio');
+  define('LOGIN_BOX_ACCOUNT_HISTORY','Historia de mis ordenes');
+  define('LOGIN_BOX_PRODUCT_NOTIFICATIONS','Notificaciones del producto');
+
+  define('LOGIN_BOX_PASSWORD_FORGOTTEN','Contrasena olvidada?');
+
+  define('BOX_LOGINBOX_EMAIL','Your Email Address');
+  define('BOX_LOGINBOX_PASSWORD','Your Password');
+  define('LOGIN_BOX_LOGOFF','Logoff');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/logoff.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Salir');
+define('NAVBAR_TITLE', 'Salir');
+define('TEXT_MAIN', 'Ha solicitado salir de su cuenta. Ahora es seguro abandonar el ordenador.<br><br>Su carrito de la compra ha sido guardado y el contenido del mismo ser&aacute; restaurado cuando vuelva a entrar en su cuenta.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,272 @@
+<table cellspacing="0" cellpadding="5" width="550" align="center" border="0" class = "infoBoxContents">
+  <tbody><tr><td><p >You have just successfully installed
+          CRE Loaded Oscommerce version 6.2 Standard Edtion!</p>
+        <p >Login to your admin <u><strong><a href="http://creloaded.com/admin/">here</a></strong></u> with
+          the username and password you set up during installation.</p></td></tr><tr>
+    <td><img src="images/loaded_3box_ad.jpg" width="550" height="198" alt="loaded bosex"></td>
+  </tr>
+          <tr>
+            <td><p>CRE Loaded Standard Version is the perfect
+                application to power your e-Commerce websites. However, if you
+                need features that only a Pro-level application can deliver,
+                please take a look at all the powerful options our Pro Version
+                adds. If you are looking to deploy a powerful Business to Business
+                solution, our Pro B2B has added features to enhance sales and
+                productivity.</p>
+              <p >Feel free to contact us for more details or usage
+            guidlines.</p></td>
+          </tr>
+          <tr>
+            <td><table width="550" border="0" cellspacing="1" cellpadding="2">
+              <tr class="infoBox">
+                <td><strong>Features</strong></td>
+                <td width="60" align="center"><strong>Standard </strong></td>
+                <td width="60" align="center"><strong>Pro </strong></td>
+                <td width="60" align="center"><strong>Pro
+                    B2B </strong></td>
+              </tr>
+              <tr>
+                <td > Multple Product Images</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Coupons and Vouchers</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Templating System</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Checkout Success Module System</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Ship Wire Order Fulfillment Integration</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Credit Card Encryption</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Page Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Language File Editor</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Attribute Option Type Features</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Tiny MCE WYSIWYG Editor throughout Admin</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Algozone Fraud Zone</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >FAQ Manager (Replaces FAQDesk)</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Article Manager (Replaces NewsDesk)</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Sales Report 2</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Customer State/Zip Code Mismatch</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Customer Statistics</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Daily Products Report</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Articles Viewed</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Update : Wishlist to 5.15</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Update: Affiliate Program to 2.5a</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Payment Module Updates : UK support</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Shipping Module: AusPOST</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Shipping Module: Canada Post</td>
+                <td align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >                New Shipping Module:
+                Royal Mail</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Sub Product Choices</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Bulk Attribute Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Multiple Products Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Product Extra Fields</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Credit Card Encryption Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Credit Card Blacklist</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Specials by Category</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Generate Order List (Order List
+                  3.1)</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Customer State Mismatch Report</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Google Ads removed</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Separate Price Groups</td>
+                <td align="center" bgcolor="#FBFBFB" >no</td>
+                <td align="center" bgcolor="#DEEFFF" >no</td>
+                <td align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td ><p>Per Product Qty Discount </p></td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" >no</td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Require Login to See Content</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" >no</td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Approve Account</td>
+                <td align="center" bgcolor="#FBFBFB" >no</td>
+                <td align="center" bgcolor="#DEEFFF" >no</td>
+                <td align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Limited 30 Day Support</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" >no</td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Upgrade Now </td>
+                <td width="60" align="center" bgcolor="#FBFBFB">&nbsp;</td>
+                <td width="60" align="center" bgcolor="#DEEFFF"><a href="http://store.creloaded.com/product_info.php?cPath=27&amp;products_id=51" target="_blank"><img src="images/00add_button.gif" alt="add button" width="35" height="24" border="0" /></a></td>
+                <td width="60" align="center" bgcolor="#D1CFD0"><a href="http://store.creloaded.com/product_info.php?cPath=27&amp;products_id=52" target="_blank"><img src="images/00add_button.gif" alt="add button" width="35" height="24" border="0" /></a></td>
+              </tr>
+            </table></td>
+          </tr>
+  </tbody></table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/checkout_success/notifications.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/checkout_success/notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/checkout_success/notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+define('MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_TITLE', 'Notificaciones');
+define('MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_DESCRIPTION', 'Módulo Del Éxito De la Comprobación De las Notificaciones Del Producto');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/checkout_success/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/checkout_success/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/checkout_success/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+<?php
+define('MODULE_CHECKOUT_SUCCESS_SHIPWIRE_TITLE', 'ShipWire');
+define('MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DESCRIPTION', 'ShipWire Checkout Success Module');
+define('TEXT_SHIPWIRE_TRANSACTION_ID', 'ShipWire Fullfillment ID:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_coupon.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_coupon.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_coupon.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: ot_coupon.php,v 1.3 2004/03/09 18:56:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR', 'Message');
+  define('MODULE_ORDER_TOTAL_COUPON_TITLE', 'Discount Coupons');
+  define('MODULE_ORDER_TOTAL_COUPON_HEADER', 'Gift Vouchers/Discount Coupons');
+  define('MODULE_ORDER_TOTAL_COUPON_DESCRIPTION', 'Discount Coupon');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+  define('MODULE_ORDER_TOTAL_COUPON_USER_PROMPT', '');
+  define('ERROR_NO_INVALID_REDEEM_COUPON', 'Invalid Coupon Code');
+  define('ERROR_INVALID_STARTDATE_COUPON', 'This coupon is not available yet');
+  define('ERROR_INVALID_FINISDATE_COUPON', 'This coupon has expired');
+  define('ERROR_INVALID_USES_COUPON', 'This coupon could only be used ');  
+  define('TIMES', ' times.');
+  define('ERROR_INVALID_USES_USER_COUPON', 'You have used the coupon the maximum number of times allowed per customer.'); 
+  define('REDEEMED_COUPON', 'a coupon worth ');  
+  define('REDEEMED_MIN_ORDER', 'on orders over ');  
+  define('REDEEMED_RESTRICTIONS', ' [Product-Category restrictions apply]');  
+  define('TEXT_ENTER_COUPON_CODE', 'Enter Redeem Code&nbsp;&nbsp;');
+  define('IMAGE_REDEEM_VOUCHER', 'Redeem Code Voucher');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_gv.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ot_gv.php,v 1.3 2004/03/09 18:56:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_GV_TITLE', 'Gift Vouchers');
+  define('MODULE_ORDER_TOTAL_GV_HEADER', 'Gift Vouchers/Discount Coupons');
+  define('MODULE_ORDER_TOTAL_GV_DESCRIPTION', 'Gift Vouchers');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+  define('MODULE_ORDER_TOTAL_GV_USER_PROMPT', 'Tick to use Gift Voucher account balance ->&nbsp;');
+  define('TEXT_ENTER_GV_CODE', 'Enter Redeem Code&nbsp;&nbsp;');
+  define('IMAGE_REDEEM_VOUCHER', 'Redeem Code Voucher');
+  define('MODULE_ORDER_TOTAL_GV_TEXT_ERROR', 'Gift Voucher/Discount coupon');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_lev_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_lev_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_lev_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: ot_lev_discount.php,v 1.1 2002/08/30 21:05:04 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_LEV_DISCOUNT_TITLE', 'Price Break Discount');
+  define('MODULE_LEV_DISCOUNT_DESCRIPTION', 'Price Break Discount');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_loworderfee.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_loworderfee.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_loworderfee.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_loworderfee.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE', 'Cargo por Pedido M&iacute;nimo');
+  define('MODULE_ORDER_TOTAL_LOWORDERFEE_DESCRIPTION', 'Cargo por Pedido M&iacute;nimo');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_qty_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_qty_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_qty_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ot_qty_discount.php,v 1.4 2004-08-22 dreamscape Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 Josh Dechant
+  Protions Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_QTY_DISCOUNT_TITLE', 'Global Quantity Discount');
+  define('MODULE_QTY_DISCOUNT_DESCRIPTION', 'Quantity specific discount percentage or flat rate - Specify discount rate based on the number of items in the cart (global across all products).');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+
+  define('MODULE_QTY_DISCOUNT_PERCENTAGE_TEXT_EXTENSION', ' (%s%%)'); // %s is the percent discount as a number; %% displays a % sign
+  define('MODULE_QTY_DISCOUNT_FORMATED_TITLE', '<strong>Quantity Discount%s:</strong>'); // %s is the placement of the MODULE_QTY_DISCOUNT_PERCENTAGE_TEXT_EXTENSION
+  define('MODULE_QTY_DISCOUNT_FORMATED_TEXT', '<strong>-%s</strong>'); // %s is the discount amount formated for the currency
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: ot_shipping.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_SHIPPING_TITLE', 'Gastos de Env&iacute;o');
+  define('MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION', 'Gastos de Env&iacute;o del Pedido');
+
+  define('FREE_SHIPPING_TITLE', 'Env&iacute;o Gratuito');
+  define('FREE_SHIPPING_DESCRIPTION', 'Env&iacute;o gratuito para pedidos sobre %s');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_subtotal.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_subtotal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_subtotal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_subtotal.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_SUBTOTAL_TITLE', 'Subtotal');
+  define('MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION', 'Subtotal del Pedido');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_tax.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_tax.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_tax.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_tax.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_TAX_TITLE', 'Impuestos');
+  define('MODULE_ORDER_TOTAL_TAX_DESCRIPTION', 'Impuestos del Pedido');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_total.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_total.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/order_total/ot_total.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_total.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_TOTAL_TITLE', 'Total');
+  define('MODULE_ORDER_TOTAL_TOTAL_DESCRIPTION', 'Total del Pedido');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/SecurePay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/SecurePay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/SecurePay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+
+ Based on payment Module of iongate.php (06/11/2003) Modified for Securepay.com by:
+
+Tony Reynolds  <tonyr at securepay.com>
+
+SecurePay.php version 1.2 06/11/2003
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_TITLE', 'Credit Card : SecurePay');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_DESCRIPTION', 'SecurePay payment module. <BR>Credit Card Test Info:<br>Aprovals<br>CC#: 4111111111111111<br>Expiry: Any <BR> Declines <BR>CC#: 5105105105105100<br>Expiry: Any ');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_GATEWAY_TIMEOUT', 'There was an error contacting the credit card processor. Please try again.');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_ERROR', 'There was a problem processing your Credit Card! Not-Approved');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_WRONG_TYPE', 'The Credit Card Number does not match the Credit Card Type.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/authorizenet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/authorizenet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/authorizenet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: authorizenet.php,v 1.3 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+ */
+
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_TITLE', 'Authorize.net');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DESCRIPTION', 'Tarjeta de Cr&eacute;dito para Pruebas:<br><br>Numero: 4111111111111111<br>Caducidad: Cualquiera');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_TYPE', 'Tipo de Tarjeta:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER', 'Titular de la Tarjeta:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER', 'N&uacute;mero de la Tarjeta:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES', 'Fecha de Caducidad:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_OWNER', '* El nombre del titular de la tarjeta de cr&eacute;dito debe de tener al menos ' . CC_OWNER_MIN_LENGTH . ' caracteres.\n');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_NUMBER', '* El n&uacute;mero de la tarjeta de credito debe de tener al menos ' . CC_NUMBER_MIN_LENGTH . ' numeros.\n');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE', 'Ha ocurrido un error procesando su tarjeta de cr&eacute;dito. Por favor, int&eacute;ntelo de nuevo.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DECLINED_MESSAGE', 'Su tarjeta ha sido denegada. Pruebe con otra tarjeta o consulte con su banco.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR', 'Error en Tarjeta de Cr&eacute;dito!');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_AUTHORIZENET_CVV_NUMBER', 'CVV number');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_cvc.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_cvc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_cvc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_CVC_TEXT_TITLE', 'Credit Card : with CCV');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DESCRIPTION', 'Credit Card with CCV checking Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CCV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_CCV', 'ccv/cvc/ccv2/cid code 3 or 4 digits');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_CVV', '* You must enter a CCV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_VISA', 'Visa');
+    
+    define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+    define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Master Card');
+    define('MODULE_PAYMENT_CC_TEXT_DISCOVERY', 'Discover');
+    define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+    define('MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS', 'American Express');
+    define('MODULE_PAYMENT_CC_TEXT_DELTA', 'Delta');
+    define('MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON', 'UK Electron');
+    define('MODULE_PAYMENT_CC_TEXT_MEASTRO', 'Maestro');
+    define('MODULE_PAYMENT_CC_TEXT_UK_SWITCH', 'UK Switch');
+    define('MODULE_PAYMENT_CC_TEXT_SOLO', 'Solo');
+    define('MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD', 'Australian BankCard');
+    define('MODULE_PAYMENT_CC_TEXT_JCB', 'JCB');
+    define('MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE', 'Carte Blanche');
+    define('MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB', 'Diners Club');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_old.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_old.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_old.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_TEXT_TITLE', 'Credit Card');
+  define('MODULE_PAYMENT_CC_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_uk.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_uk.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cc_uk.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_UK_TEXT_TITLE', 'Credit Card UK,');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DESCRIPTION', 'Credit Card for UK with CVC checking Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_UK_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START', 'Credit Card Start Date:');
+//  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE', 'Credit Card Issue Date:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE','<BR>*** ISSUE NUMBER. This number can be found on debit cards on the front side, on the bottom row , just before the expiry date.');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV', '3 or 4 Digit Security Code:');      
+  
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CCV', 'CCV number:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_UK_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+    define('MODULE_PAYMENT_CC_UK_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_UK_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_UK_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Master Card');
+  define('MODULE_PAYMENT_CC_TEXT_DISCOVERY', 'Discover');
+  define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS', 'American Express');
+  define('MODULE_PAYMENT_CC_TEXT_DELTA', 'Delta');
+  define('MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON', 'UK Electron');
+  define('MODULE_PAYMENT_CC_TEXT_MEASTRO', 'Maestro');
+  define('MODULE_PAYMENT_CC_TEXT_UK_SWITCH', 'UK Switch');
+  define('MODULE_PAYMENT_CC_TEXT_SOLO', 'Solo');
+  define('MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD', 'Australian BankCard');
+  define('MODULE_PAYMENT_CC_TEXT_JCB', 'JCB');
+  define('MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE', 'Carte Blanche');
+  define('MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB', 'Diners Club');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ccerr.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ccerr.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ccerr.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: cc.php,v 1.10 2002/11/01 05:14:11 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CCERR_TEXT_TITLE', 'Credit Class Error');
+  define('MODULE_PAYMENT_CCERR_TEXT_DESCRIPTION', 'Credit Class Error, needed with Gift Voucher');  
+  define('MODULE_PAYMENT_CCERR_TEXT_ERROR', 'Payment selection error');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ckmerchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ckmerchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ckmerchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ckmerchantpartners.php,v 1.4 2002/11/01 05:35:33 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_TITLE', 'Electronic Check : Pay Me Now');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_DESCRIPTION', 'Merchant Partners Pay Me now Electronic Check Number:<br><br>ACCT#: 999999999<br>ABA: 999999999');
+  define('CKMERCHANTPARTNERS_ERROR_HEADING', 'There has been an error processing your Electronic Check');
+  define('CKMERCHANTPARTNERS_ERROR_MESSAGE', 'Please check your Check details!');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_OWNER', 'Name on Check:');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_NUMBER', 'Check Account Number:');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_ABA', 'Check Routing Number (ABA):');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_JS_CK_NUMBER', '* The check number must be at least ' . CK_NUMBER_MIN_LENGTH . ' characters.\n');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cod.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cod.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/cod.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: cod.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_COD_TEXT_TITLE', 'Contra Reembolso');
+  define('MODULE_PAYMENT_COD_TEXT_DESCRIPTION', 'Contra Reembolso');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/efsnet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/efsnet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/efsnet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: efsnet.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('MODULE_PAYMENT_EFSNET_TEXT_TITLE', 'EFSNet');
+  define('MODULE_PAYMENT_EFSNET_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_EFSNET_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EFSNET_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EFSNET_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_EFSNET_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_EFSNET_TEXT_ERROR', 'Credit Card Error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/egold.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/egold.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/egold.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: e-gold.php,v 1 2003/07/23 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  e-Gold module Crated by Craig Harrison
+*/
+
+  define('MODULE_PAYMENT_EGOLD_TEXT_TITLE', 'e-Gold');
+  define('MODULE_PAYMENT_EGOLD_TEXT_DESCRIPTION', 'e-Gold');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/epssecurenet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/epssecurenet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/epssecurenet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: epssecurenet.php,v 1.0 2003/08/19 Exp $
+
+// EPSsecurenet
+// Built For osCommerce 2.2MS2 version 
+//--------------------------------
+// Developed BY Greg Goodman
+// Copyright 2003 Electronic Payment Systems
+//--------------------------------
+// This code is provided as is. EPS provides no warranty for the code
+// and the use of this code is done so with the express understanding that
+// it is used at the user's risk. Furthermore EPS may not be held
+// accountable for any losses resulting from the use of this code, including
+// associated modules.
+//--------------------------------
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('MODULE_PAYMENT_EFSNET_TEXT_TITLE', 'Credit Card : EPSsecurenet');
+  define('MODULE_PAYMENT_EPSSECURENET_CART_SYSTEM_NAME', 'OsCommerce');
+  define('MODULE_PAYMENT_EPSSECURENET_CONNECTION_TYPE', 'sd');
+  define('MODULE_PAYMENT_EPSSECURENET_ORDER_DESCRIP', 'Refer to OScommerce Customer Order Screen');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_TITLE', 'EPSsecurenet');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_DESCRIPTION', 'EPSsecurenet Payment Module Credit Card Test Info:<br><br>CC#: 5123456789012346<br>Expiry: Any'); 
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_CVV2', 'CVV2 Security Number:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_CVV2', '* The CVV2 Number must at least be three or four characters.\n    -For VISA/MasterCard this number is on the back of the Card.\n    -For American Express it is 4 digits and located on the front of the Card.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_ERROR', 'Credit Card Error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/eustandardtransfer.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/eustandardtransfer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/eustandardtransfer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_TITLE', 'EU-Standard Bank Transfer');
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION', '<BR>Please use the following details to transfer your total order value:<BR>' .
+                                                         '<BR>Bank Name: ' . MODULE_PAYMENT_EUTRANSFER_BANKNAM .
+                                                         '<BR>Branch: ' . MODULE_PAYMENT_EUTRANSFER_BRANCH .
+                                                         '<BR>Account Name: ' . MODULE_PAYMENT_EUTRANSFER_ACCNAM .
+                                                         '<br>Account No.: ' . MODULE_PAYMENT_EUTRANSFER_ACCNUM .
+                                                         '<BR>IBAN:: ' . MODULE_PAYMENT_EUTRANSFER_ACCIBAN .
+                                                         '<BR>BIC/SWIFT: ' . MODULE_PAYMENT_EUTRANSFER_BANKBIC .
+//                                                         '<BR>Sort Code: ' . MODULE_PAYMENT_EUTRANSFER_SORTCODE .
+                                                         '<BR><BR>Your order will not ship until we receive payment in the above account.<BR>');
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_EMAIL_FOOTER', str_replace('<BR>','\n',MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION));
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/firepay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/firepay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/firepay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+
+
+  define('MODULE_PAYMENT_FIREPAY_TEXT_TITLE', 'Credit Card : FirePay');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DESCRIPTION', 'Payment processor for SureFire Commerce. Uses FirePay gateway.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CCV_NUMBER', 'CVV number');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DINERSCLUB', 'Diners Club');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_FIREPAY', 'FirePay');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_VISA', 'Visa');
+
+ ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/freecharger.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/freecharger.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/freecharger.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_TITLE', 'The WebMakers Corner FREE CHARGE CARD');
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_DESCRIPTION', 'Used for purchase of FREE CHARGE ONLY');
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_EMAIL_FOOTER', 'Used with purchases via Free Charge');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/geotrust.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/geotrust.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/geotrust.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: geotrust.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce / Paul Kim
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_TITLE', 'Credit Card : GeoTrust QuickPayments');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4445999922225<br>Expiry: Any');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_FIRST_NAME', 'First Name:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_LAST_NAME', 'Last Name:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER', 'Name:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiriration Date:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2', 'Card Verification Value:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2_LOCATION', '(last 3 digits, located at the back of the credit card)');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ipayment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ipayment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/ipayment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: ipayment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_TITLE', 'Credit Card : iPayment');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_DESCRIPTION', 'Tarjeta de Cr&eacute;dito para Pruebas:<br><br>Numero: 4111111111111111<br>Caducidad: Cualquiera');
+  define('IPAYMENT_ERROR_HEADING', 'Ha ocurrido un error procesando su tarjeta de cr&eacute;dito');
+  define('IPAYMENT_ERROR_MESSAGE', '¡Revise los datos de su tarjeta de cr&eacute;dito!');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER', 'Titular de la Tarjeta:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_NUMBER', 'N&uacute;mero de la Tarjeta:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES', 'Fecha de Caducidad:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER', 'N&uacute;mero de Comprobaci&oacute;n:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION', '(lo puede encontrar en la parte de atr&aacute;s de la tarjeta de credito)');
+
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_OWNER', '* El nombre del titular de la tarjeta de cr&eacute;dito debe de tener al menos ' . CC_OWNER_MIN_LENGTH . ' caracteres.\n');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_NUMBER', '* El n&uacute;mero de la tarjeta de cr&eacute;dito debe tener al menos ' . CC_NUMBER_MIN_LENGTH . ' caracteres.\n');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/merchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/merchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/merchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: merchantpartners.php,v 1.4 2002/11/01 05:35:33 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_TITLE', 'Credit Card : Pay Me Now');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_DESCRIPTION', 'Merchant Partners, Pay me now(Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MERCHANTPARTNERS_ERROR_HEADING', 'There has been an error processing your credit card');
+  define('MERCHANTPARTNERS_ERROR_MESSAGE', 'Please check your credit card details!');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2', 'CVV2/CCV2/CID number:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2_LOCATION', '(3 or 4 digit # on back of card):');
+
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/moneyorder.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/moneyorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/moneyorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: moneyorder.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_TITLE', 'Cheque/Transferencia Bancaria');
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION', 'Pagadero a:&nbsp;' . MODULE_PAYMENT_MONEYORDER_PAYTO . '<br><br>Enviar a<br>' . nl2br(STORE_NAME_ADDRESS) . '<br><br>' . '&nbsp;Su pedido se enviará en cuanto se reciba el pago.');
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', "Pagadero a: ". MODULE_PAYMENT_MONEYORDER_PAYTO . "\n\nEnviar a\n" . STORE_NAME_ADDRESS . "\n\n" . 'Su pedido se enviará en cuanto se reciba el pago.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/nochex.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/nochex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/nochex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: nochex.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_NOCHEX_TEXT_TITLE', 'NOCHEX');
+  define('MODULE_PAYMENT_NOCHEX_TEXT_DESCRIPTION', 'NOCHEX Requiere la moneda GBP (Libras).<br><br>NOCHEX limita transacciones a 100 GBP. Cualquier cosa excedente requiere cualquier una cuenta mercantil o una cuenta de NOCHEX.<br>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paybox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paybox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paybox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  Contribution by Emmanuel Alliel <manu at maboutique.biz>
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYBOX_TEXT_TITLE', 'Credit Card : Paybox');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_DESCRIPTION', 'Paybox module made by Emmanuel Alliel<br>Email: manu at maboutique.biz');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/payflowpro.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/payflowpro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/payflowpro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: PAYFLOWPRO.php,v 1.9 2002/01/04 10:45:18 hpdl Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE', 'Pay by Credit Card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE1', 'Your credit card information will be kept secure and private.  We use Verisign payment processing.');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE2', '');
+ 
+ 
+
+  define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'The Credit Card number doe snot match the Card Type:');
+ 
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_TYPE', 'Card Type:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_OWNER', 'Card Owner:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_HOLDER_FIRST_NAME', 'First Name and Initial as shown on the card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_HOLDER_LAST_NAME', 'Last Name and Suffix as shown on your card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_EXPIRES', 'Expiration:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC', 'Card Verification Number');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_TEXT', '(On the back of your card, locate the final 3 digit number)');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_HELP', 'Help Finding Card Verification Number');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_AMEX', 'Using Amex?');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.n');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR_MESSAGE', 'There has been an error processing you credit card, please try again, or call us ');
+  
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR1', 'Local not sent to processor');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR', 'There has been an error processing you credit card. Please double check the information you entered. 
+  <p> 1)  Does the bill to address match the credit card billing address?
+   </p> 2) Try to re-enter the credit card information.  Sorry that this step is necessary, the re-entry is a security requirement.
+  3) If you are still having a problem, please call or email us.  Your items are stored in the system and we can easily help you during normal business hours.  We will still be able to promptly send you your merchandise. 
+  Card error #');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/payjunction.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/payjunction.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/payjunction.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_TITLE', 'Credit Card : PayJunction');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_DESCRIPTION', 'Accept payments through the <b>PayJunction</b> gateway.<br/><br/>Use this credit card to test: 4433221111223344 (12/17)');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NAME', 'Cardholder name:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NUMBER', 'Credit card number:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_CODE', 'CVV2/CVC2 code:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_EXPIRES', 'Credit card expiration:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR', 'Credit card error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: paypal.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE', 'PayPal');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION', 'PayPal');
+
+  define('MODULE_PAYMENT_PAYPAL_CC_TEXT', "Credit Card&nbsp;%s%s%s%s&nbsp;or&nbsp;%s");
+
+  define('MODULE_PAYMENT_PAYPAL_IMAGE_BUTTON_CHECKOUT', 'PayPal Checkout');
+  define('MODULE_PAYMENT_PAYPAL_CC_DESCRIPTION','You do not need to be a PayPal member to pay by credit card');
+  define('MODULE_PAYMENT_PAYPAL_CC_URL_TEXT','<font color="blue"><u>[info]</u></font>');
+
+  define('MODULE_PAYMENT_PAYPAL_CUSTOMER_COMMENTS', 'Add Comments About Your Order');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE_PROCESSING', 'Processing transaction');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION_PROCESSING', 'If this page appears for more than 5 seconds, please click the PayPal Checkout button to complete your order.');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal_dp.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal_dp.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal_dp.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  paypal_dp.php, v 1.0 09/06/2005
+  Copyright (c) 2005 POSTOSC.COM
+  Released under the GNU General Public License
+  Absolutely no warranty. Use at your own risk.
+*/
+
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE', 'Paypal Pro Credit Card Payment');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_DESCRIPTION', 'Paypal Pro Credit Card Payment');
+define('MODULE_PAYMENT_PAYPAL_DP_CLIENT_DESCRIPTION', 'Credit Card');
+define('MODULE_PAYMENT_PAYPAL_DP_IMAGE_DESCRIPTION', '<img src="images/paypal/4cards.gif">');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_FIRSTNAME', 'Owner First Name:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_LASTNAME', 'Owner Last Name:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_CVV2', '<a href="http://www.paypal.com/cgi-bin/webscr?cmd=p/acc/cvv_info_pop-outside" target="_blank"><b>Card Verification Number (<u>CLICK FOR DETAILS</u>)</b></a>:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_EXPIRES', 'Card Expiration Date:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_FIRSTNAME', '* The owner\'s first name of the credit card must be at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_LASTNAME', '* The owner\'s last name of the credit card must be at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_CVV2', '* The card verification value cannot be more than 4 characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_ERROR', 'Credit Card Error!');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_PROCESS_ERROR', 'There has been an error processing your credit card. Please try again.');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal_ec.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal_ec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypal_ec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  paypal_ec.php, v 1.0 09/06/2005
+
+  Copyright (c) 2005 POSTOSC.COM
+
+  Released under the GNU General Public License
+
+  Absolutely no warranty. Use at your own risk.
+*/
+
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_TITLE', 'PayPal Pro Express Checkout');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_DESCRIPTION', 'PayPal Pro Express Checkout');
+define('MODULE_PAYMENT_PAYPAL_EC_CLIENT_DESCRIPTION', 'PayPal');
+define('MODULE_PAYMENT_PAYPAL_EC_IMAGE_DESCRIPTION', '<img src="images/buttons/x-click-but6.gif" align="left" style="margin-right:7px;"><span style="font-size:11px; font-family: Arial, Verdana;">Save time. Checkout securely. Pay without sharing your financial information.</span>');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_ERROR', 'PayPal Process Error!');
+define('MODULE_PAYMENT_PAYPAL_EC_BILLING_ERROR', 'Please enter your PayPal billing address.');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_PROCESS_ERROR', 'There has been an error processing your payment. Please try again.');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_DECLINED_MESSAGE', 'Your card was declined. Please try another card or contact your bank for more info.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypalipn.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypalipn.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/paypalipn.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: paypalipn.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Paypal IPN v0.981 for Milestone 2
+  Copyright (c) 2003 Pablo Pasqualino
+  pablo_osc at osmosisdc.com
+  http://www.osmosisdc.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_TITLE', 'PayPal IPN');
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_DESCRIPTION', 'PayPal IPN');
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_CURL', 'cURL Activado');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/plugnpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/plugnpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/plugnpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: plugnpay.php,v 1.13 2003/01/03 17:25:43 thomasamoulton Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+  Released under the GNU General Public License
+
+  Last Updated: 09/17/04
+*/
+
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_TITLE', 'Credit Card : PlugnPay');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DESCRIPTION', 'PlugnPay API');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_CVV', 'CVV/CVV2:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCTTYPE', 'Account Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ROUTINGNUM', 'Routing Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCOUNTNUM', 'Account Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_CHECKNUM', 'Check Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_PAYTYPE', 'Payment Method:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/pm2checkout.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/pm2checkout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/pm2checkout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: pm2checkout.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_TITLE', 'Credit Card : 2CheckOut');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_DESCRIPTION', 'Tarjeta de Cr&eacute;dito para Pruebas:<br><br>Numero: 4111111111111111<br>Caducidad: Cualquiera');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_TYPE', 'Tipo:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER', 'Titular de la Tarjeta:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_FIRST_NAME', 'Nombre del Titular:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_LAST_NAME', 'Apellidos del Titular:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_NUMBER', 'N&uacute;mero de la Tarjeta:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_EXPIRES', 'Fecha de Caducidad:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER', 'N&uacute;mero de comprobaci&oacute;n:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION', '(lo puede encontrar en la parte de atr&aacute;s de la tarjeta de credito)');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_JS_CC_NUMBER', '* El n&uacute;mero de la tarjeta de cr&eacute;dito debe tener al menos ' . CC_NUMBER_MIN_LENGTH . ' caracteres.\n');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR_MESSAGE', 'Ha ocurrido un error procesando su tarjeta de cr&eacute;dito, por favor int&eacute;ntelo de nuevo.');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR', 'Error de Tarjeta de Cr&eacute;dito!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/psigate.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/psigate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/psigate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: psigate.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PSIGATE_TEXT_TITLE', 'Credit Card : PSiGate');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_DESCRIPTION', 'Tarjeta de Cr&eacute;dito para Pruebas:<br><br>Numero: 4111111111111111<br>Caducidad: Cualquiera');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER', 'Titular de la Tarjeta:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER', 'N&uacute;mero de la Tarjeta:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES', 'Fecha de Caducidad:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_TYPE', 'Tipo de Tarjeta:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_JS_CC_NUMBER', '* El n&uacute;mero de la tarjeta de cr&eacute;dito debe de tener al menos ' . CC_NUMBER_MIN_LENGTH . ' numeros.\n');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_ERROR_MESSAGE', 'Ha ocurrido un error procesando su tarjeta de cr&eacute;dito, por favor intentelo de nuevo.');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_ERROR', 'Error en Tarjeta de Cr&eacute;dito!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/qchex.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/qchex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/qchex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: qchex.php,v 3.0 2003/11/10 23:25:32 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_QCHEX_TEXT_TITLE', 'QChex (Electronic Check Payment)');
+  define('MODULE_PAYMENT_QCHEX_TEXT_DESCRIPTION', 'QChex (Electronic Check Payment)');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/quickcommerce.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/quickcommerce.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/quickcommerce.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: authorizenet.php,v 1.3 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+*/
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_TITLE', 'Credit Card : Quick Commerce Pro');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/secpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/secpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/secpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: secpay.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_SECPAY_TEXT_TITLE', ' Credit Card : SECPay');
+  define('MODULE_PAYMENT_SECPAY_TEXT_DESCRIPTION', 'Tarjeta de Cr&eacute;dito para Pruebas:<br><br>Numero: 4444333322221111<br>Caducidad Cualquiera');
+  define('MODULE_PAYMENT_SECPAY_TEXT_ERROR', 'Error de Tarjeta de Cr&eacute;dito!');
+  define('MODULE_PAYMENT_SECPAY_TEXT_ERROR_MESSAGE', 'Ha ocurrido un error procesando su tarjeta de cr&eacute;dito. Por favor, intentelo de nuevo.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/worldpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/worldpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/payment/worldpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: worldpay.php,v MS1a 2003/04/06 21:30
+  Author :  Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.4
+
+  Revisions:
+  Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+          Now posting language code to WP, Redirect on failure now to Checkout Payment,
+      Reduced re-direct time to 8 seconds, added MD5, made callback dynamic 
+      NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+  Version 1.4 Removes boxes to prevent users from clicking away before update, 
+      Fixes currency for Yen, 
+      Redirects to Checkout_Process after 10 seconds or click by user
+  Version 1.3 Fixes problem with Multi Currency
+  Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+  Version 1.1 Added Worldpay Pre-Authorisation ability
+  Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_WORLDPAY_TEXT_TITLE', 'Worldpay Credit Card Payment');
+  define('MODULE_PAYMENT_WORLDPAY_TEXT_DESCRIPTION', 'Worldpay Junior Payment Module');
+   
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspost.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspost.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_TEXT_TITLE', 'AusPOST Parcel Post');
+define('MODULE_SHIPPING_AUSPOST_TEXT_DESCRIPTION', 'AusPOST Parcel Post');
+define('MODULE_SHIPPING_AUSPOST_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostair.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostair.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostair.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostair.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_TITLE', 'AusPOST International Parcel Post - AIR');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_DESCRIPTION', 'AusPOST International Parcel Post - AIR');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/ausposteconomy.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/ausposteconomy.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/ausposteconomy.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: ausposteconomy.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_TITLE', 'AusPOST International Parcel Post - Economy');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_DESCRIPTION', 'Int. Parcel Post - Economy');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostexpress.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostexpress.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostexpress.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostexpress.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_TITLE', 'AusPOST Express Post Parcel');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_DESCRIPTION', 'AusPOST Express Post Parcel');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostsea.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostsea.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/auspostsea.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostsea.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_TITLE', 'AusPOST International Parcel Post - SEA');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_DESCRIPTION', 'AusPOST International Parcel Post - SEA');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/canadapost.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/canadapost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/canadapost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  canadapost.php version 0.3
+  
+  Before use this class, you should open a Canada 
+  Post Eparcel Account, and change the CPCIP to
+  your ID. Visit www.canadapost.ca for detail.
+  
+  XML connection method with Canada Post.
+
+  Copyright (c) 2002,2003 Kelvin Zhang (kelvin at syngear.com)
+  Modified by Kenneth Wang (kenneth at cqww.net), 2002.11.12
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_CANADAPOST_TEXT_TITLE', 'Canada Post');
+define('MODULE_SHIPPING_CANADAPOST_TEXT_DESCRIPTION', 'Canada Post Parcel Service');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/cod.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/cod.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/cod.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: flat.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_COD_TEXT_TITLE', 'COD Rate');
+define('MODULE_SHIPPING_COD_TEXT_DESCRIPTION', 'COD Rate');
+define('MODULE_SHIPPING_COD_TEXT_WAY', 'Best Way');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/fedex1.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/fedex1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/fedex1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+
+  Verions 1.11 for OSC 2.2 MS1
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002, 2003 Steve Fatula of Fatula Consulting
+  compconsultant at yahoo.com
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FEDEX1_TEXT_TITLE', 'Federal Express');
+define('MODULE_SHIPPING_FEDEX1_TEXT_DESCRIPTION', 'Federal Express<br><br>You will need to have registered an account with FEDEX to use this module. Please see the README.TXT file for other requirements.');
+
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_01', 'Priority (by 10:30AM, later for rural)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_03', '2 Day Air');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_05', 'Standard Overnight (by 3PM, later for rural)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_06', 'First Overnight');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_20', 'Express Saver (3 Day)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_90', 'Home Delivery');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_92', 'Ground Service');
+
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_01', 'International Priority (1-3 Days)');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_03', 'International Economy (4-5 Days)');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_06', 'International First');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_90', 'Home Delivery');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_92', 'Ground Service');
+
+define('MODULE_SHIPPING_FEDEX1_ERROR_1', 'An error occured with the fedex shipping calculations.<br>Fedex may not deliver to your country, or your postal code may be wrong.');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_1', "Data sent to Fedex for Meter: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_2', "Data returned from Fedex for Meter: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_3', 'No response to CURL from Fedex server, check CURL availability, or maybe timeout was set too low, or maybe the Fedex site is down');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_4', 'No meter number was obtained, check configuration. Error ');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_5', 'You forgot to set up your Fedex account number, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_6', 'You forgot to set up your ship from street address line 1, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_7', 'You forgot to set up your ship from City, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_8', 'You forgot to set up your ship from postal code, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_9', 'You forgot to set up your ship from phone number, this can be set up in Admin -> Modules -> Shipping');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_10', "Data sent to Fedex for Rating: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_11', "Data returned from Fedex for Rating: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_12', 'No data returned from Fedex, perhaps the Fedex site is down');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_13', 'No Rates Returned, ');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/flat.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/flat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/flat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: flat.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FLAT_TEXT_TITLE', 'Tarifa Unica');
+define('MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION', 'Tarifa Unica por Pedido');
+define('MODULE_SHIPPING_FLAT_TEXT_WAY', 'La mejor opcion');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/freeshipper.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/freeshipper.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/freeshipper.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE', 'FREE SHIPPING!');
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_DESCRIPTION', 'FREE SHIPPING');
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_WAY', 'Free Shipping Only');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/item.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/item.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/item.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: item.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ITEM_TEXT_TITLE', 'Por artículo');
+define('MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION', 'Por artículo');
+define('MODULE_SHIPPING_ITEM_TEXT_WAY', 'La Mejor Opcion');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/percent.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/percent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/percent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: percent.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001,2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('MODULE_SHIPPING_PERCENT_TEXT_TITLE', 'Shipping');
+define('MODULE_SHIPPING_PERCENT_TEXT_TITLE_ADMIN', 'Percent Rate');
+define('MODULE_SHIPPING_PERCENT_TEXT_DESCRIPTION', 'Percent Rate Shipping');
+define('MODULE_SHIPPING_PERCENT_TEXT_WAY', 'Total');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/reg.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/reg.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/reg.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_REG_TEXT_TITLE', 'Royal Mail Registered');
+define('MODULE_SHIPPING_REG_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_REG_TEXT_WAY', '');
+define('MODULE_SHIPPING_REG_TEXT_UNITS', '');
+define('MODULE_SHIPPING_REG_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_REG_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/spec.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/spec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/spec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_SPEC_TEXT_TITLE', 'Royal Mail Special Delivery');
+define('MODULE_SHIPPING_SPEC_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_SPEC_TEXT_WAY', '');
+define('MODULE_SHIPPING_SPEC_TEXT_UNITS', '');
+define('MODULE_SHIPPING_SPEC_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_SPEC_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/spu.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/spu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/spu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: spu.php,v 1.3 2002/06/15 01:15:42 mbs Exp $
+  CONTRIB is Store Pickup Shipping Module (http://www.oscommerce.com/community/contributions,164)
+  Created by Michael Halvorsen
+  http://www.arachnia-web.com
+
+  Copyright (c) 2002 Arachnia-web Development.
+  Released under the GNU General Public License.
+  May be used and modified without permission.
+*/
+
+define('MODULE_SHIPPING_SPU_TEXT_TITLE', 'Store Pickup');
+define('MODULE_SHIPPING_SPU_TEXT_DESCRIPTION', 'In-store pickup during regular business hours.');
+define('MODULE_SHIPPING_SPU_TEXT_WAY', 'No shipping charge added.  Pickup during regular business hours.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/stand.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/stand.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/stand.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_STAND_TEXT_TITLE', 'Royal Mail Standard Parcel');
+define('MODULE_SHIPPING_STAND_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_STAND_TEXT_WAY', '');
+define('MODULE_SHIPPING_STAND_TEXT_UNITS', '');
+define('MODULE_SHIPPING_STAND_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_STAND_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/table.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: table.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_TABLE_TEXT_TITLE', 'Tabla de Tarifas');
+define('MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION', 'Tabla de Tarifas');
+define('MODULE_SHIPPING_TABLE_TEXT_WAY', 'Best Way');
+define('MODULE_SHIPPING_TABLE_TEXT_WEIGHT', 'Peso');
+define('MODULE_SHIPPING_TABLE_TEXT_AMOUNT', 'Total');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/ups.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/ups.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/ups.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: ups.php,v 1.1.1.1 2004/03/04 23:41:04 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_UPS_TEXT_TITLE', 'United Parcel Service');
+define('MODULE_SHIPPING_UPS_TEXT_DESCRIPTION', 'United Parcel Service');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_GND', 'UPS Ground');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DM', 'Next Day Air Early AM');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DA', 'Next Day Air');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DP', 'Next Day Air Saver');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_2DM', '2nd Day Air Early AM');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_3DS', '3 Day Select');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_STD', 'Canada Standard');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XPR', 'Worldwide Express');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XDM', 'Worldwide Express Plus');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XPD', 'Worldwide Expedited');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/usps.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/usps.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/usps.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: usps.php,v 1.1.1.1 2004/03/04 23:41:04 ccwjr Exp $
+  ++++ modified as USPS Methods 2.5 08/02/03 by Brad Waite and Fritz Clapp ++++
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_USPS_TEXT_TITLE', 'United States Postal Service');
+define('MODULE_SHIPPING_USPS_TEXT_DESCRIPTION', 'United States Postal Service<br><br>You will need to have registered an account with USPS at http://www.uspsprioritymail.com/et_regcert.html to use this module<br><br>USPS expects you to use pounds as weight measure for your products.');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_PP', 'Parcel Post');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_PM', 'Priority Mail');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_EX', 'Express Mail');
+define('MODULE_SHIPPING_USPS_TEXT_ERROR', 'Ha ocurrido un error calculando los gastos de envio.<br>Si aun desea usar USPS para su envio, contacte con el administrador.');
+define('MODULE_SHIPPING_USPS_TEXT_DAY', 'Day');
+define('MODULE_SHIPPING_USPS_TEXT_DAYS', 'Days');
+define('MODULE_SHIPPING_USPS_TEXT_WEEKS', 'Weeks');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/zones.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.4 2002/11/19 01:14:34 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ZONES_TEXT_TITLE', 'Tarifa por Zona');
+define('MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION', 'Tarifa basada en Zonas');
+define('MODULE_SHIPPING_ZONES_TEXT_WAY', 'Enviar A');
+define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_ZONES_INVALID_ZONE', 'No hay envio disponible para ese pais.');
+define('MODULE_SHIPPING_ZONES_UNDEFINED_RATE', 'No se han podido calcular los gastos de envio');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/zones_single.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/zones_single.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping/zones_single.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.1.1.1 2004/03/04 23:41:04 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_TITLE', 'Tarifa por Zona');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_DESCRIPTION', 'Tarifa basada en Zonas');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_WAY', 'Enviar A');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_ZONES_SINGLE_INVALID_ZONE', 'No hay envio disponible para ese pais.');
+define('MODULE_SHIPPING_ZONES_SINGLE_UNDEFINED_RATE', 'No se han podido calcular los gastos de envio');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping_estimator.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping_estimator.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/shipping_estimator.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: shiupping estimator.php,v 1.1 2004/12/01  $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 CREloaded
+
+  Released under the GNU General Public License
+*/
+
+ define('SHIPPING_OPTIONS', 'Shipping Options:');
+ define('SHIPPING_OPTIONS_LOGIN_A', 'Please <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>, to display your personal shipping costs.');
+ define('SHIPPING_OPTIONS_LOGIN_B', 'Please Log In, to display your personal shipping costs.');
+  define('SHIPPING_METHOD_TEXT','Shipping Methods:');
+  define('SHIPPING_METHOD_RATES','Rates:');
+  define('SHIPPING_METHOD_TO','Ship to: ');
+  define('SHIPPING_METHOD_TO_NOLOGIN', 'Ship to: <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>');
+  define('SHIPPING_METHOD_FREE_TEXT','Free Shipping');
+  define('SHIPPING_METHOD_ALL_DOWNLOADS','- Downloads');
+  define('SHIPPING_METHOD_RECALCULATE','Recalculate');
+  define('SHIPPING_METHOD_ZIP_REQUIRED','true');
+  define('SHIPPING_METHOD_ADDRESS','Address:');
+  define('SHIPPING_METHOD_ITEM','ITEM:');
+  define('SHIPPING_METHOD_ITEMS','ITEMS:');
+  define('SHIPPING_METHOD_WEIGHT','Weight:');
+  define('SHIPPING_METHOD_WEIGHT_UNIT','lbs');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/modules/xsell_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/modules/xsell_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/modules/xsell_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: xsell_products.php, v1
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+  define('TEXT_XSELL_PRODUCTS', 'We Also Recommend :');
+  define('TEXT_BUY', 'Comprar 1 \'');
+  define('TEXT_NOW', '\' Ahora');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Navigation Menu');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_CATEGORIES_LINKS', 'Categories / Links');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Products Image:</b><small><br>Main Image used in <br><u>catalog & description</u> pages.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Small Image:</b><br><small> Image on<br><u>products list</u> pages.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Image:</b><br><small> Large Image on<br><u>pop-up window</u> page.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Store Product/s Sharing this Image =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Remove</b> this Image from this Product?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>Delete</b> this Image from the Server (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Remove');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'Delete');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Small Images.</b> If a "SM" image is used<br>(Alone) NO Pop-up window link is created, the "SM"<br> will be placed directly under the products<br>description. If used in conjunction with an <br>"XL" image on the right, a Pop-up Window Link<br> is created and the "XL" image will be<br>shown in a Pop-up window.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Large Images.</b> Used for the Pop-up image<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Additional Images - These will appear below product description if used.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Image 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Image 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Image 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Image 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Image 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Image 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Image 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Image 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Image 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Image 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Image 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Image 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DELETE_IMAGE', 'Delete Image');
+
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Category heading title:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Category heading Description:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Category Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Category Description Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Category Key Word Meta Tag :');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method :');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Product Keywords :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Edit Product Attributes');
+
+// Added for Navigation Menu DMG
+
+define('TEXT_LINKS','Links');
+define('TEXT_HEADING_EDIT_CATEGORY','Edit Navigation Category');
+define('TEXT_HEADING_NEW_LINK','Create New Navigation Link');
+define('TEXT_LINK_NAME','Link Text : ');
+define('TEXT_LINK_PAGE','Link Target : ');
+define('TEXT_STATUS','Link Status : ');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/pages.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: pages.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc
+  
+  Copyright &copy; 2006 Chain Reaction Works, Inc
+  
+  Last Modifed By : $Author$
+  Last Modified On :  $Date$
+  Latest Revision :  $Revision$
+  
+  
+*/
+
+define('NAVBAR_TITLE', 'Pages');
+
+define('HEADING_TITLE', 'Pages');
+define('TEXT_NO_PAGES', 'There are no pages to list in this category.');
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: password_forgotten.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Entrar');
+define('NAVBAR_TITLE_2', 'Constrase&ntilde;a Olvidada');
+
+define('HEADING_TITLE', 'He olvidado mi Contrase&ntilde;a!');
+
+define('TEXT_MAIN', 'Si ha olvidado su contrase&ntilde;a, introduzca su direcci&oacute;n de e-mail y le enviaremos un mensaje por e-mail con una contrase&ntilde;a nueva.');
+
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'Error: Ese E-Mail no figura en nuestros datos, int&eacute;ntelo de nuevo.');
+
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Nueva Contraseña');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'Ha solicitado una Nueva Contraseña desde ' . $REMOTE_ADDR . '.' . "\n\n" . 'Su nueva contraseña para \'' . STORE_NAME . '\' es:' . "\n\n" . '   %s' . "\n\n");
+
+define('SUCCESS_PASSWORD_SENT', 'Exito: Se ha enviado una nueva contrase&ntilde;a a su e-mail');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/popup_affiliate_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/popup_affiliate_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/popup_affiliate_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: popup_affiliate_help.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Infobox Help');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Infobox Help');
+
+define('HEADING_SUMMARY_HELP', 'Affiliate Help');
+define('TEXT_IMPRESSIONS_HELP', '<b>Impressions:</b> Exhibe el numbero total de epocas una bandera o el acoplamieto se ha exibido en el periodo dado.');
+define('TEXT_VISITS_HELP', '<b>Visitas:</b> representa el total numero de teclados-throughs de los visitantes de su website.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Transactions:</b> representa el total numero de transacciones acertadas acreditadas a su cuenta.');
+define('TEXT_CONVERSION_HELP', '<b>Conversions:</b> representa el porcentage de visitas (click-throughs) con transacciones completas.');
+define('TEXT_AMOUNT_HELP', '<b>Cantidad:</b> representa el valor de las ventas y el valor de las ordenes entregadas acreditadas a su cuenta.');
+define('TEXT_AVERAGE_HELP', '<b>Promedio:</b> representa el valor de las ventas medio acreditadas a su cuenta.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Tarifa de Commission</b> representa la tarifa que usted ha sido pagado por el porcentage de las ventas.');
+define('TEXT_COMMISSION_HELP', '<b>Commission</b> representa el total de comision que se le debe a usted');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/popup_coupon_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/popup_coupon_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/popup_coupon_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: popup_coupon_help.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_COUPON_HELP', 'Cupon de Descuento Help');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+define('TEXT_COUPON_HELP_HEADER', 'Felicidades, Usted ha remidido el cupon de descuento.');
+define('TEXT_COUPON_HELP_NAME', '<br><br>Nombre del Cupon : %s');
+define('TEXT_COUPON_HELP_FIXED', '<br><br>El valor del cupon es %s descuento contra su orden');
+define('TEXT_COUPON_HELP_MINORDER', '<br><br>Usted necesita gastar %s para utilizar este coupon');
+define('TEXT_COUPON_HELP_FREESHIP', '<br><br>Este cupon le da un envio gratuito con su orden');
+define('TEXT_COUPON_HELP_DESC', '<br><br>Description del cupon: %s');
+define('TEXT_COUPON_HELP_DATE', '<br><br>El cupon es valido dentro %s and %s');
+define('TEXT_COUPON_HELP_RESTRICT', '<br><br>Producto/Categoria Restrictiones');
+define('TEXT_COUPON_HELP_CATEGORIES', 'Categoria');
+define('TEXT_COUPON_HELP_PRODUCTS', 'Producto');
+define('TEXT_NONE', 'NONE');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/popup_image.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/popup_image.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/popup_image.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: popup_image.php,v 1.2 2004/01/18 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('TEXT_CLOSE_WINDOW', 'Click to Close Window [x]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/printorder.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/printorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/printorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: invoice.php,v 1.1 2003/05 xaglo
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TITLE_PRINT_ORDER', 'ORDER');
+
+define('TABLE_HEADING_COMMENTS', 'Sus comentarios');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Productos');
+define('TABLE_HEADING_TAX', 'Impuestos');
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Precio (ex)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Precio (inc)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ex)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inc)');
+
+define('IMAGE_BUTTON_PRINT', 'Imprimir');
+
+define('ENTRY_SOLD_TO', 'VENDIDO A:');
+define('ENTRY_SHIP_TO', 'ENVIO A:');
+define('ENTRY_PAYMENT_METHOD', 'Metodo de Pago:');
+
+define('ENTRY_DATE_PURCHASED', 'Fecha de Compra:');
+
+define('ENTRY_ACCESS_ERROR', 'Usted no esta autorizado para obtener esta orden.<br />Si usted cree que ha recivido este mensaje erroreamente, Pod favor notique al dueno de la tienda.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/product_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/product_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/product_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: product_info.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_PRODUCT_NOT_FOUND', 'No encontrado!');
+define('TEXT_CURRENT_REVIEWS', 'Comentarios:');
+define('TEXT_MORE_INFORMATION', 'Para obtener m&aacute;s informaci&oacute;n, visite la <a href="%s" target="_blank"><u>p&aacute;gina</u></a> del producto.');
+define('TEXT_DATE_ADDED', 'Este producto esta en nuestro cat&aacute;logo desde %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#ff0000">Este producto estar&aacute; disponible el %s.</font>');
+define('TEXT_ALSO_PURCHASED_PRODUCTS', 'Clientes que compraron este producto, tambi&eacute;n han comprado');
+define('TEXT_PRODUCT_OPTIONS', 'Opciones:');
+define('TEXT_CLICK_TO_ENLARGE', 'Tecleo aqui para agrandar');
+define('TEXT_NO_MOPICS', 'Coming soon!');
+/*Eversun mod end for sppc and qty price breaks*/
+define('TEXT_ENTER_QUANTITY', 'Quantity');
+/*Eversun mod end for sppc and qty price breaks*/
+
+define("LINK_ALT","Make a link");
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/product_info_configureable.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/product_info_configureable.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/product_info_configureable.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: product_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_PRODUCT_NOT_FOUND', 'Product not found!');
+define('TEXT_CURRENT_REVIEWS', 'Current Reviews:');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this products <a href="%s" target="_blank"><u>webpage</u></a>.');
+define('TEXT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#ff0000">This product will be in stock on %s.</font>');
+define('TEXT_ALSO_PURCHASED_PRODUCTS', 'Customers who bought this product also purchased');
+define('TEXT_PRODUCT_OPTIONS', 'Available Options:');
+define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
+define('TEXT_NO_MOPICS', 'Coming soon!');
+/*Eversun mod end for sppc and qty price breaks*/
+define('TEXT_ENTER_QUANTITY', 'Quantity');
+define('TEXT_QUALITY_PRICE_CHART','Quantity Price Chart');
+/*Eversun mod end for sppc and qty price breaks*/
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/product_reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/product_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/product_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: product_reviews.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Comentarios');
+
+define('TEXT_CLICK_TO_ENLARGE', 'Tecleo aqui para agrandar');
+
+define('TEXT_OF_5_STARS', '%s de 5 Estrellas!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/product_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/product_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/product_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: product_reviews_info.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Comentarios');
+define('HEADING_TITLE', ' %s Comentarios');
+define('SUB_TITLE_PRODUCT', 'Producto:');
+define('SUB_TITLE_FROM', 'De:');
+define('SUB_TITLE_DATE', 'Fecha:');
+define('SUB_TITLE_REVIEW', 'Comentario:');
+define('SUB_TITLE_RATING', 'Evaluaci&oacute;n:');
+define('TEXT_OF_5_STARS', '%s de 5 Estrellas!');
+define('TEXT_CLICK_TO_ENLARGE', 'Tecleo aqui para agrandar');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/product_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/product_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/product_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: product_reviews_write.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Comentarios');
+
+define('SUB_TITLE_FROM', 'De:');
+define('SUB_TITLE_REVIEW', 'Comentario:');
+define('SUB_TITLE_RATING', 'Evaluaci&oacute;n:');
+
+define('TEXT_NO_HTML', '<small><font color="#ff0000"><b>NOTA:</b></font></small>&nbsp;No se traducir&aacute; el codigo HTML!');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>MALO</b></font></small>');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>BUENO</b></font></small>');
+
+define('TEXT_CLICK_TO_ENLARGE', 'Tecleo aqui para agrandar');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/products_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/products_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/products_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: products_new.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Novedades');
+define('HEADING_TITLE', 'Novedades');
+
+define('TEXT_DATE_ADDED', 'Fecha Alta:');
+define('TEXT_MANUFACTURER', 'Fabricante:');
+define('TEXT_PRICE', 'Precio:');
+
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/pw.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/pw.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/pw.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,8 @@
+<?php
+define('TEXT_ACCOUNT_CREATED','Your Account is now active !');
+define('TEXT_YOUR_ACCOUNT_ALREADY_EXIST', 'Your Account is already active!');
+define('HEADIN_TITLE', 'Account validation');
+define('NAVBAR_TITLE', 'Account validation');
+define('TEXT_ACCOUNT_CREATED_FAIL', 'The validation/activation code you entered is incorrect');
+define('TEXT_ACCOUNT_CREATED_FAIL2', 'The email address or validation/activation code you entered is not valid');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Comentarios');
+define('HEADING_TITLE', 'Lea lo que estan diciendo los demas');
+define('TEXT_OF_5_STARS', '%s de 5 Estrellas!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.2 2004/03/15 12:13:02 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Precio de Tienda');
+define('HEADING_TITLE', 'Precio de Tienda');
+define('BOX_HEADING_SHOP_BY_PRICE', 'Precio de Tienda');
+define('TABLE_HEADING_IMAGE', '');
+define('TABLE_HEADING_PRICE', 'Precio');
+define('TABLE_HEADING_BUY_NOW', 'Compra Ahora');
+define('TABLE_HEADING_MODEL', 'Modelo');
+define('TABLE_HEADING_PRODUCTS', 'Nombre delProducto');
+define('TABLE_HEADING_MANUFACTURER', 'Fabricante');
+define('TABLE_HEADING_QUANTITY', 'Cantidad');
+
+define('TEXT_INFO_UNDER', 'Under&nbsp;');
+define('TEXT_INFO_FROM', 'From&nbsp;');
+define('TEXT_INFO_TO', '&nbsp;to&nbsp;');
+define('TEXT_INFO_ABOVE', '&nbsp;and above');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Contenido de la Cesta');
+define('HEADING_TITLE', 'Que hay en mi Cesta?');
+define('TABLE_HEADING_REMOVE', 'Quitar');
+define('TABLE_HEADING_QUANTITY', 'Cantidad');
+define('TABLE_HEADING_MODEL', 'Modelo');
+define('TABLE_HEADING_PRODUCTS', 'Producto(s)');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TEXT_CART_EMPTY', 'Tu Cesta de la Compra esta vacia!');
+define('SUB_TITLE_SUB_TOTAL', 'Subtotal:');
+define('SUB_TITLE_TOTAL', 'Total:');
+
+define('OUT_OF_STOCK_CANT_CHECKOUT', 'Los productos marcados con ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' no estan disponibles en la cantidad que requiere.<br>Modifique la cantidad de productos marcados con ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ', Gracias');
+define('OUT_OF_STOCK_CAN_CHECKOUT', 'Los productos marcados con ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' no estan disponibles en cantidad que requiere.<br>De todas formas, puede comprar los que hay disponibles y el resto se lo enviamos mas tarde o esperar a que la cantidad requerida este disponible.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/specials.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:41:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Ofertas');
+define('HEADING_TITLE', 'Consiguelas mientras estan Calientes!');
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/ssl_check.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/ssl_check.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/ssl_check.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: ssl_check.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Comprobaci&oacute;n de Seguridad');
+define('HEADING_TITLE', 'Comprobaci&oacute;n de Seguridad');
+
+define('TEXT_INFORMATION', 'Hemos detectado que su navegador ha generado un Identificativo de Sesion Seguro diferente al que ha estado usando a lo largo de su visita.<br><br>Por razones de seguridad debera entrar de nuevo en su cuenta para verificar su identidad.<br><br>Algunos navegadores como Konqueror 3.1 no tienen la habilidad de generar un Identificativo de Sesion Seguro autom&aacute;ticamente. Si usa este navegador, le recomendamos cambiar a otro como <a href="http://www.microsoft.com/ie/" target="_blank">Microsoft Internet Explorer</a>, <a href="http://channels.netscape.com/ns/browsers/download_other.jsp" target="_blank">Netscape</a>, o <a href="http://www.mozilla.org/releases/" target="_blank">Mozilla</a>, para continuar con su experiencia.<br><br>Hemos adoptado esta medida de seguridad en su beneficio y le pedimos disculpas anticipadas por cualquier inconveniente que pudiera ocasionarle.<br><br>Pongase en contacto con nosotros con cualquier pregunta que tenga al respecto o para realizar sus compras offline.');
+
+define('BOX_INFORMATION_HEADING', 'Seguridad y Privacidad');
+define('BOX_INFORMATION', 'Validamos el Identificativo de Sesi&oacute;n Seguro generado autom&aacute;ticamente por su navegador en cada petici&oacute;n que realiza a este servidor.<br><br>Esta validaci&oacute;n asegura que es usted quien navega con su cuenta y no otra persona.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:41:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Enviar a un Amigo');
+
+define('HEADING_TITLE', 'Enviar informaci&oacute;n sobre \'%s\' un amigo');
+
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Tus Datos');
+define('FORM_TITLE_FRIEND_DETAILS', 'Los Datos De Tu Amigo');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Tu Mensaje');
+
+define('FORM_FIELD_CUSTOMER_NAME', 'Tu Nombre:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Tu Email:');
+define('FORM_FIELD_FRIEND_NAME', 'El Nombre De Tu Amigo:');
+define('FORM_FIELD_FRIEND_EMAIL', 'El Email De Tu Amigo:');
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Tu email sobre <b>%s</b> ha sido enviado con &eacute;xito a <b>%s</b>.');
+
+define('TEXT_EMAIL_SUBJECT', 'Tu amigo %s te quiere recomendar "%s"');
+define('TEXT_EMAIL_INTRO', 'Hola %s!' . "\n\n" . 'Tu amigo %s, pensó que estarias interesado en %s de %s.');
+define('TEXT_EMAIL_LINK', 'Para ver el producto usa el siguiente enlace:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE', 'Para visualizar el producto haz click en el v&iacute;nculo de abajo o bien copia y pega el v&iacute;nculo en tu navegador:' . "\n\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE_TEXT', 'To view the article copy and paste the link into your web browser:' . "\n\n");
+
+define('TEXT_EMAIL_SIGNATURE', 'Atentamente,' . "\n\n");
+
+define('ERROR_TO_NAME', 'Error: La direcci&oacute;n de su amigo no puede estar vacia.');
+define('ERROR_TO_ADDRESS', 'Error: La direcci&oacute;n de su amigo debe ser v&aacute;lida.');
+define('ERROR_FROM_NAME', 'Error: Su nombre no debe estar vacio.');
+define('ERROR_FROM_ADDRESS', 'Error: Su direcci&oacute;n de email debe de ser v&aacute;lida.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/tell_a_friend_article.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/tell_a_friend_article.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/tell_a_friend_article.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Tell A Friend');
+
+define('HEADING_TITLE', 'Tell A Friend About \'%s\'');
+
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Your Details');
+define('FORM_TITLE_FRIEND_DETAILS', 'Your Friends Details');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Your Message');
+
+define('FORM_FIELD_CUSTOMER_NAME', 'Your Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Your E-Mail Address:');
+define('FORM_FIELD_FRIEND_NAME', 'Your Friends Name:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Your Friends E-Mail Address:');
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email about <b>%s</b> has been successfully sent to <b>%s</b>.');
+
+define('TEXT_EMAIL_SUBJECT', 'Your friend %s has recommended this great product from %s');
+define('TEXT_EMAIL_INTRO', 'Hi %s!' . "\n\n" . 'Your friend, %s, thought that you would be interested in %s from %s.');
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE', 'To view the article click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE_TEXT', 'To view the article copy and paste the link into your web browser:' . "\n\n");
+
+define('TEXT_EMAIL_SIGNATURE', 'Regards,' . "\n\n");
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: products_new.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Upcoming Products');
+define('HEADING_TITLE', 'Upcoming Products');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_MANUFACTURER', 'Manufacturer:');
+define('TEXT_PRICE', 'Price:');
+define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: login.php,v 1.15 2003/06/09 22:46:46 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+function get_ip() {
+if (isset($_SERVER)) {
+if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
+$ip = $_SERVER['HTTP_CLIENT_IP'];
+} else {
+$ip = $_SERVER['REMOTE_ADDR'];
+}
+} else {
+if ( getenv('HTTP_X_FORWARDED_FOR') ) {
+$ip = getenv('HTTP_X_FORWARDED_FOR');
+} elseif ( getenv('HTTP_CLIENT_IP') ) {
+$ip = getenv('HTTP_CLIENT_IP');
+} else {
+$ip = getenv('REMOTE_ADDR');
+}
+}
+return $ip; 
+}
+$user_ip = get_ip();
+
+
+define('NAVBAR_TITLE_1', 'Account');
+define('NAVBAR_TITLE_2', 'Account Validation');
+define('HEADING_TITLE', 'Account Validation');
+define('TEXT_MAIN', 'Do you need a new Validation Link ?');
+define('ENTRY_EMAIL_ADDRESS', 'Emailadress: ');
+define('SUCCESS_REGISTRATION_CODE_SENT', 'Your new validation code was sent. Please check your email account');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'This email address is not registered');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Your Validation Code is');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'We received a request from the IP ' . $user_ip . ' to renew your Validation Code.' . "\n\n" . 'Your Validation Code for \'' . STORE_NAME . '\' :' . "\n\n" . '%s' . "\n\n");
+define('EMAIL_PASSWORD_REMINDER_BODY2', 'Please follow this link to validate your account: %s' . "\n\n");
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/whos_onlinebox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/whos_onlinebox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/whos_onlinebox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.1 2004/05/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+define('BOX_WHOS_ONLINE_THEREIS', 'There currently is');
+define('BOX_WHOS_ONLINE_THEREARE', 'There currently are');
+define('BOX_WHOS_ONLINE_GUEST', 'guest');
+define('BOX_WHOS_ONLINE_GUESTS', 'guests');
+define('BOX_WHOS_ONLINE_AND', 'and');
+define('BOX_WHOS_ONLINE_MEMBER', 'member');
+define('BOX_WHOS_ONLINE_MEMBERS', 'members');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: wishlist.php,v 1 2004/09/12
+
+  OS Commerce - Community Made Shopping!
+  http://www.oscommerce.com
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Mi lista de deseos');
+define('HEADING_TITLE', 'Mi lista de deseos');
+define('BOX_TEXT_PRICE', 'Price:');
+define('BOX_TEXT_SEND', 'Email your Wishlist to a friend.');
+define('BOX_TEXT_MOVE_TO_CART', 'Move to Cart');
+define('BOX_TEXT_DELETE', 'Delete');
+define('BOX_TEXT_VIEW', 'Show');
+define('BOX_TEXT_HELP', 'Help');
+define('BOX_TEXT_SELECTED_PRODUCTS', 'Selected Products');
+define('BOX_TEXT_SELECT_PRODUCT', 'Select Product ');
+
+define('BOX_TEXT_NO_ITEMS', 'No products are in your Wishlist. <br><br><b><a href="wishlist_help.php"><u>Click here</u></a> for help on using your Wishlist</b>');
+define('TEXT_WISHLIST_COUNT', 'Currently %s items are on your Wishlist.');
+define('TEXT_DISPLAY_NUMBER_OF_WISHLIST', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> items on your wishlist)');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/wishlist_email.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/wishlist_email.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/wishlist_email.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: wishlist_email.php,v 1 2003/11/20
+
+  OS Commerce - Community Made Shopping!
+  http://www.oscommerce.com
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+
+define('NAVBAR_TITLE', 'Send your Wishlist');
+define('HEADING_TITLE', 'Send your Wishlist to a friend.');
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Your Details');
+define('FORM_FIELD_CUSTOMER_NAME', 'Your Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Your Email Address:');
+define('FORM_TITLE_FRIEND_DETAILS', 'Your Friend\'s Details');
+define('FORM_FIELD_FRIEND_NAME', 'Your Friend\'s Name:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Your Friend\'s Email Address:');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Add a Personal Message Here');
+define('FORM_FIELD_TEXT_AREA', 'My Wishlist contains:'. "\n\n");
+
+define('FORM_FIELD_PRODUCTS', 'Products on my wish list'. "\n\n");
+
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email has been successfully sent to <b>%s</b> at the email adress <b>%s</b>.');
+define('TEXT_EMAIL_SUBJECT', 'Your friend %s wants to share his Wishlist at %s');
+define('TEXT_EMAIL_INTRO', 'Hi %s,' . "\n\n" . '%s has created a Wishlist at %s which they would like to share with you.');
+define('TEXT_EMAIL_SIGNATURE', 'Regards,' . "\n\n");
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below :' . "\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n");
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol/wishlist_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/wishlist_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/wishlist_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+/*
+  $Id: wishlist_help.php,v 1 2002/11/09
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Mi Lista del Deseo F.A.Q.');
+define('HEADING_TITLE', 'Mi Lista del Deseo F.A.Q.');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('TEXT_INFORMATION', '<b>What is ' . BOX_HEADING_CUSTOMER_WISHLIST . '?</b><br>' .
+BOX_HEADING_CUSTOMER_WISHLIST . ' Es basicamente la manera de recordarle sobre un articulo que desea comprar despues o que no en nuestro almacen.
+// EoF Modification by: Rob Woodgate
+<br>
+<br>
+<b>Como puedo agregar articulos a' . BOX_HEADING_CUSTOMER_WISHLIST . '? </b><br>
+Para agregar un articuloa a ' . BOX_HEADING_CUSTOMER_WISHLIST . ', justamente tecleo el "Add to Wishlist" boton Pora cualquier Articulo que le interese. The "Add to Wishlist" boton aparece proximo al "Add to Cart" boton en el producto info paginas.
+<br>
+<br>
+<b>Podria yo agregat "out-of-stock" articulos or "coming-soon items"?</b><br>
+Ai. Usted puede agregar cualquier articulo que haya seleccionado a la ' . BOX_HEADING_CUSTOMER_WISHLIST .'
+<br>
+<br>
+<b>Como puedo revisar la ' . BOX_HEADING_CUSTOMER_WISHLIST . '?</b><br>
+en la columna de la derecha esta la "' . BOX_HEADING_CUSTOMER_WISHLIST . '" box.  Esta caja le demustra el estado actual de ' . BOX_HEADING_CUSTOMER_WISHLIST . '.  Si hay menos de 5 articulos ' . BOX_HEADING_CUSTOMER_WISHLIST . ', Ellos seran enumerados aqui.  Si hay mas de 5 articulos, habra un simple contador con el total de articulos ' . BOX_HEADING_CUSTOMER_WISHLIST . '.
+<br>
+<br>
+' . BOX_HEADING_CUSTOMER_WISHLIST . ' podria ser revisado a cualquier momento simplemente tecle el acoplamiento en la  "' . BOX_HEADING_CUSTOMER_WISHLIST . '" box (<i><u>View ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</i>).  o chascando la flecha del lado derecha de la "' . BOX_HEADING_CUSTOMER_WISHLIST . '" caja.
+<br>
+<br>
+<b>Como puedo mover ' . BOX_HEADING_CUSTOMER_WISHLIST . ' articulos para mi carro de compras?</b><br>
+para mover ' . BOX_HEADING_CUSTOMER_WISHLIST . ' articulos al carrito de compras, tecle el "Move to Cart" abajo de los nombres del producto "' . BOX_HEADING_CUSTOMER_WISHLIST . '" caja (si el ' . BOX_HEADING_CUSTOMER_WISHLIST . ' articulos estan en la caja) o tecle el "Move to Cart" debajo de los articulos in la ' . BOX_HEADING_CUSTOMER_WISHLIST . ' de la pagina principal and voila! el articulo is movido al carrito de compras.
+<br>
+<br>
+<b>Como puede retirar articulos de la ' . BOX_HEADING_CUSTOMER_WISHLIST . '?</b><br>
+mover articulos de la ' . BOX_HEADING_CUSTOMER_WISHLIST . ', tecle "Delete" bajo del producto\'s nombre en el "' . BOX_HEADING_CUSTOMER_WISHLIST . '" caja o tecle "Delete" bajo del articulo en la ' . BOX_HEADING_CUSTOMER_WISHLIST . ' pagina principal de los articulos que usted le gustaria remover. 
+<br>
+<br>
+<b> puedo poner mi Wishlist en disposicion de otros? </b><br>
+Lo sentimos mucho. Actualmente "my Wishlist" es solamente accessible cuando usted ha sido registrado. Por lo tanto , usted es la unica persona que puede verlo.
+// EoF Modification by: Talon177
+// BoF Modification by: Rob Woodgate & Talon177
+Sorry. Currently ' . BOX_HEADING_CUSTOMER_WISHLIST . ' is only accessible when you are logged in to your account. Therefore, you are the only one that can see it.  However, you can email your wishlist to a friend by visiting the ' . BOX_HEADING_CUSTOMER_WISHLIST . ' main page, entering their email address into the \'send your wishlist to a friend\' box and clicking the email envelope.
+// EoF Modification by: Rob Woodgate & Talon177
+<br>
+<br>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/espanol/wpcallback.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol/wpcallback.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol/wpcallback.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: wpcallback.php,v MS1a 2003/04/06 21:30
+  Author :  Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.4
+
+  Revisions:
+  Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+          Now posting language code to WP, Redirect on failure now to Checkout Payment,
+      Reduced re-direct time to 8 seconds, added MD5, made callback dynamic 
+      NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+  Version 1.4 Removes boxes to prevent users from clicking away before update, 
+      Fixes currency for Yen, 
+      Redirects to Checkout_Process after 10 seconds or click by user
+  Version 1.3 Fixes problem with Multi Currency
+  Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+  Version 1.1 Added Worldpay Pre-Authorisation ability
+  Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'WorldPay');
+define('WP_TEXT_HEADING', 'Response from WorldPay:');
+define('HEADING_TITLE', 'Thank you for shopping with ' . STORE_NAME . ' .... ');
+define('WP_TEXT_SUCCESS', '... your payment was successfully received.');
+define('WP_TEXT_SUCCESS_WAIT', '<b><font color="#FF0000">Please wait...</font></b> whilst we finish processing your order.<br>If you are not automatically re-directed in 10 seconds, please click continue.');
+define('WP_TEXT_FAILURE', '... Your payment has been cancelled!');
+define('WP_TEXT_FAILURE_WAIT', '<b><font color="#FF0000">Please wait...</font></b><br>If you are not automatically re-directed in 10 seconds, please click continue.');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/espanol.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/espanol.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/espanol.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,661 @@
+<?php
+/*
+  $Id: espanol.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+  Translated by: jparis v1.0
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// look in your $PATH_LOCALE/locale directory for available locales
+// or type locale -a on the server.
+// Examples:
+// on RedHat try 'es_ES'
+// on FreeBSD try 'es_ES.ISO_8859-1'
+// on Windows try 'sp', or 'Spanish'
+//@setlocale(LC_TIME, 'es_ES.ISO_8859-1');
+ at setlocale(LC_TIME, 'Spanish');
+//VVC Constants
+define('VISUAL_VERIFY_CODE_CHARACTER_POOL', 'abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789FJWNVB63HDLAJAF');  //no zeros or O
+define('VISUAL_VERIFY_CODE_CATEGORY', 'Verify security code');
+define('VISUAL_VERIFY_CODE_ENTRY_ERROR', 'The security code you entered did not match the one displayed.');
+define('VISUAL_VERIFY_CODE_ENTRY_TEXT', '*');
+define('VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS', 'Type security code here:');
+define('VISUAL_VERIFY_CODE_BOX_IDENTIFIER', '<- Security Code');
+
+define('DATE_FORMAT_SHORT', '%d/%m/%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
+define('DATE_FORMAT', 'd/m/Y');  // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+
+////
+// Return date in raw format
+// $date should be in format mm/dd/yyyy
+// raw date is in format YYYYMMDD, or DDMMYYYY
+function tep_date_raw($date, $reverse = false) {
+  if ($reverse) {
+    return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
+  }
+}
+
+// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
+define('LANGUAGE_CURRENCY', 'EUR');
+
+// Global entries for the <html> tag
+define('HTML_PARAMS','dir="LTR" lang="es"');
+
+// charset for web pages and emails
+define('CHARSET', 'iso-8859-1');
+
+// page title
+define('TITLE', 'El nombre de su tienda, cámbielo en catalog/includes/languajes/   su idioma');
+
+// ######## CCGV
+define('BOX_INFORMATION_GV', 'Gift Voucher FAQ');
+define('VOUCHER_BALANCE', 'Voucher Balance');
+define('BOX_HEADING_GIFT_VOUCHER', 'Gift Voucher Account'); 
+define('GV_FAQ', 'Gift Voucher FAQ');
+define('ERROR_REDEEMED_AMOUNT', 'Congratulations, you have redeemed ');
+define('ERROR_NO_REDEEM_CODE', 'You did not enter a redeem code.');  
+define('ERROR_NO_INVALID_REDEEM_GV', 'Invalid Gift Voucher Code'); 
+define('TABLE_HEADING_CREDIT', 'Credits Available');
+define('GV_HAS_VOUCHERA', 'You have funds in your Gift Voucher Account. If you want <br>
+                         you can send those funds by <a class="pageResults" href="');
+       
+define('GV_HAS_VOUCHERB', '"><b>email</b></a> to someone'); 
+define('ENTRY_AMOUNT_CHECK_ERROR', 'You do not have enough funds to send this amount.'); 
+define('BOX_SEND_TO_FRIEND', 'Send Gift Voucher');
+
+define('VOUCHER_REDEEMED', 'Voucher Redeemed');
+define('CART_COUPON', 'Coupon :');
+define('CART_COUPON_INFO', 'more info');
+define('MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR', 'Coupon Redemption');
+define('ERROR_REDEEMED_AMOUNT_ZERO', '<BR>***HOWEVER:No reducion available, please see the coupon restrictions***');
+// header text in includes/header.php
+define('HEADER_TITLE_CREATE_ACCOUNT', 'Crear una cuenta');
+define('HEADER_TITLE_MY_ACCOUNT', 'Mi cuenta');
+define('HEADER_TITLE_CART_CONTENTS', 'Ver carrito');
+define('HEADER_TITLE_CHECKOUT', 'Hacer efectivo el pedido');
+define('HEADER_TITLE_TOP', 'Inicio');
+define('HEADER_TITLE_CATALOG', 'Catálogo');
+define('HEADER_TITLE_LOGOFF', 'Salir');
+define('HEADER_TITLE_LOGIN', 'Registrarse');
+
+// footer text in includes/footer.php
+define('FOOTER_TEXT_REQUESTS_SINCE', 'peticiones desde');
+
+// text for gender
+define('MALE', 'Hombre');
+define('FEMALE', 'Mujer');
+define('MALE_ADDRESS', 'Sr.');
+define('FEMALE_ADDRESS', 'Sra.');
+
+// text for date of birth example
+define('DOB_FORMAT_STRING', 'dd/mm/aaaa');
+
+// categories mainpage
+define('BOX_HEADING_CATEGORIES_MAIN_PAGE', 'Categorías');
+
+
+// quick_find box text in includes/boxes/quick_find.php
+define('BOX_SEARCH_TEXT', 'Use palabras clave para encontrar el producto que busca.');
+define('BOX_SEARCH_ADVANCED_SEARCH', 'Búsqueda avanzada');
+
+
+// reviews box text in includes/boxes/reviews.php
+define('BOX_HEADING_REVIEWS', 'Comentarios');
+define('BOX_REVIEWS_WRITE_REVIEW', 'Escriba un comentario para este producto');
+define('BOX_REVIEWS_NO_REVIEWS', 'En este momento, no hay ningún comentario');
+define('BOX_REVIEWS_TEXT_OF_5_STARS', '%s de 5 estrellas!');
+
+// shopping_cart box text in includes/boxes/shopping_cart.php
+
+define('BOX_SHOPPING_CART_EMPTY', '0 productos');
+
+
+// best_sellers box text in includes/boxes/best_sellers.php
+define('BOX_HEADING_BESTSELLERS_IN', 'Los más vendidos en <br>&nbsp;&nbsp;');
+
+// notifications box text in includes/boxes/products_notifications.php
+define('BOX_HEADING_NOTIFICATIONS', 'Avisos');
+define('BOX_NOTIFICATIONS_NOTIFY', 'Avíseme de cambios a <b>%s</b>');
+define('BOX_NOTIFICATIONS_NOTIFY_REMOVE', 'No me avisen de cambios a <b>%s</b>');
+
+// manufacturer box text
+
+define('BOX_MANUFACTURER_INFO_HOMEPAGE', 'Sitio Web de %s');
+define('BOX_MANUFACTURER_INFO_OTHER_PRODUCTS', 'Otros productos');
+
+// tell a friend box text in includes/boxes/tell_a_friend.php
+define('BOX_TELL_A_FRIEND_TEXT', 'Envíe información a alguien sobre este producto.');
+
+//BEGIN allprods modification
+define('BOX_INFORMATION_ALLPRODS', 'Ver todos los productos');
+//END allprods modification
+
+//BEGIN all categories and products modification
+define ('ALL_PRODUCTS_LINK', 'Todos los productos ordenados por categorías');
+//END categories and products modification
+
+//BEGIN all categories and products modification
+define ('ALL_PRODUCTS_MANF', 'Todos los productos ordenados por fabricantes');
+//END categories and products modification
+// VJ Links Manager v1.00 begin
+define('BOX_INFORMATION_LINKS', 'Enlaces');
+// VJ Links Manager v1.00 end
+
+// checkout procedure text
+define('CHECKOUT_BAR_DELIVERY', 'Información de envío');
+define('CHECKOUT_BAR_PAYMENT', 'Información de pago');
+define('CHECKOUT_BAR_CONFIRMATION', 'Confirmación');
+define('CHECKOUT_BAR_FINISHED', '¡Finalizado!');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Seleccione');
+define('TYPE_BELOW', 'Escriba debajo');
+
+// javascript messages
+define('JS_ERROR', '¡Hay errores en su formulario!\nPor favor, haga las siguientes correcciones:\n\n');
+
+define('JS_REVIEW_TEXT', '* Su \'comentario\' debe tener al menos ' . REVIEW_TEXT_MIN_LENGTH . ' caracteres.\n');
+define('JS_REVIEW_RATING', '* Debe evaluar el producto sobre el que opina.\n');
+
+define('JS_ERROR_NO_PAYMENT_MODULE_SELECTED', '* Por favor seleccione un método de pago para su pedido.\n');
+
+define('JS_ERROR_SUBMITTED', 'Ya ha enviado antes el formulario. Pulse Aceptar y espere a que termine el proceso.');
+
+define('ERROR_NO_PAYMENT_MODULE_SELECTED', 'Por favor seleccione un método de pago para su pedido.');
+
+define('CATEGORY_COMPANY', 'Datos de la empresa');
+define('CATEGORY_PERSONAL', 'Datos personales');
+define('CATEGORY_ADDRESS', 'Dirección');
+define('CATEGORY_CONTACT', 'Información de contacto');
+define('CATEGORY_OPTIONS', 'Opciones');
+define('CATEGORY_PASSWORD', 'Contraseña');
+
+define('ENTRY_COMPANY', 'Nombre de la empresa:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Sexo:');
+define('ENTRY_GENDER_ERROR', 'Por favor seleccione una opción.');
+define('ENTRY_GENDER_TEXT', '*');
+define('ENTRY_FIRST_NAME', 'Nombre:');
+define('ENTRY_FIRST_NAME_ERROR', 'Su nombre debe tener al menos ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' caracteres.');
+define('ENTRY_FIRST_NAME_TEXT', '*');
+define('ENTRY_LAST_NAME', 'Apellidos:');
+define('ENTRY_LAST_NAME_ERROR', 'Sus apellidos deben tener al menos ' . ENTRY_LAST_NAME_MIN_LENGTH . ' caracteres.');
+define('ENTRY_LAST_NAME_TEXT', '*');
+define('ENTRY_DATE_OF_BIRTH', 'Fecha de nacimiento:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', 'Su fecha de nacimiento debe tener este formato: DD/MM/AAAA (p.ej. 21/05/1970)');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '* (ej. 21/05/1970)');
+define('ENTRY_EMAIL_ADDRESS', 'Dirección de e-mail:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', 'Su dirección de e-mail debe tener al menos ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' caracteres.');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', 'Su dirección de e-mail no parece válida - por favor haga los cambios necesarios.');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', 'Su dirección de e-mail ya figura en nuestros registros - puede entrar a su cuenta con esta dirección o crear una cuenta nueva con una dirección diferente.');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '*');
+define('ENTRY_STREET_ADDRESS', 'Dirección:');
+define('ENTRY_STREET_ADDRESS_ERROR', 'Su dirección debe tener al menos ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' caracteres.');
+define('ENTRY_STREET_ADDRESS_TEXT', '*');
+define('ENTRY_SUBURB', 'Suburbio');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Código postal:');
+define('ENTRY_POST_CODE_ERROR', 'Su código postal debe tener al menos ' . ENTRY_POSTCODE_MIN_LENGTH . ' caracteres.');
+define('ENTRY_POST_CODE_TEXT', '*');
+define('ENTRY_CITY', 'Población:');
+define('ENTRY_CITY_ERROR', 'Su población debe tener al menos ' . ENTRY_CITY_MIN_LENGTH . ' caracteres.');
+define('ENTRY_CITY_TEXT', '*');
+define('ENTRY_STATE', 'Provincia/Estado:');
+define('ENTRY_STATE_ERROR', 'Su provincia/estado debe tener al menos ' . ENTRY_STATE_MIN_LENGTH . ' caracteres.');
+define('ENTRY_STATE_ERROR_SELECT', 'Por favor seleccione un estado de la lista desplegable.');
+define('ENTRY_STATE_TEXT', '*');
+
+
+define('ENTRY_COUNTRY', 'País:');
+define('ENTRY_COUNTRY_ERROR', 'Debe seleccionar un país de la lista desplegable.');
+define('ENTRY_COUNTRY_TEXT', '*');
+define('ENTRY_TELEPHONE_NUMBER', 'Teléfono:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', 'Su número de teléfono debe tener al menos ' . ENTRY_TELEPHONE_MIN_LENGTH . ' números.');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');
+define('ENTRY_FAX_NUMBER', 'Fax:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Boletín de noticias:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Suscrito');
+define('ENTRY_NEWSLETTER_NO', 'No suscrito');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Contraseña:');
+define('ENTRY_PASSWORD_ERROR', 'Su contraseña debe tener al menos ' . ENTRY_PASSWORD_MIN_LENGTH . ' caracteres.');
+define('ENTRY_PASSWORD_ERROR_NOT_MATCHING', 'La confirmación de la contraseña debe coincidir con la contraseña.');
+define('ENTRY_PASSWORD_TEXT', '*');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Confirme la contraseña:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT', 'Contraseña actual:');
+define('ENTRY_PASSWORD_CURRENT_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT_ERROR', 'Su contraseña debe tener al menos ' . ENTRY_PASSWORD_MIN_LENGTH . ' caracteres.');
+define('ENTRY_PASSWORD_NEW', 'Nueva contraseña:');
+define('ENTRY_PASSWORD_NEW_TEXT', '*');
+define('ENTRY_PASSWORD_NEW_ERROR', 'Su contraseña nueva debe tener al menos ' . ENTRY_PASSWORD_MIN_LENGTH . ' caracateres.');
+define('ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING', 'La confirmación de su contraseña debe coincidir con su contraseña nueva.');
+define('PASSWORD_HIDDEN', '--OCULTO--');
+
+define('FORM_REQUIRED_INFORMATION', '* Dato necesario');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_RESULT_PAGE', 'Páginas de resultados:');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Mostrando del <b>%d</b> al <b>%d</b> (de <b>%d</b> productos)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS', 'Mostrando del <b>%d</b> al <b>%d</b> (de <b>%d</b> pedidos)');
+define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', 'Mostrando del <b>%d</b> al <b>%d</b> (de <b>%d</b> comentarios)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW', 'Mostrando del <b>%d</b> al <b>%d</b> (de <b>%d</b> productos nuevos)');
+define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Mostrando del <b>%d</b> al <b>%d</b> (de <b>%d</b> ofertas)');
+define('TEXT_DISPLAY_NUMBER_OF_FEATURED', 'Mostrando del <b>%d</b> al <b>%d</b> (de <b>%d</b> productos destacados)');
+
+define('PREVNEXT_TITLE_FIRST_PAGE', 'Primera página');
+define('PREVNEXT_TITLE_PREVIOUS_PAGE', 'Página anterior');
+define('PREVNEXT_TITLE_NEXT_PAGE', 'Página siguiente');
+define('PREVNEXT_TITLE_LAST_PAGE', 'Última página');
+define('PREVNEXT_TITLE_PAGE_NO', 'Página %d');
+define('PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE', '%d páginas anteriores');
+define('PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE', '%d páginas siguientes');
+define('PREVNEXT_BUTTON_FIRST', '&lt;&lt;PRINCIPIO');
+define('PREVNEXT_BUTTON_PREV', '[&lt;&lt;&nbsp;Anterior]');
+define('PREVNEXT_BUTTON_NEXT', '[Siguiente&nbsp;&gt;&gt;]');
+define('PREVNEXT_BUTTON_LAST', 'FINAL&gt;&gt;');
+
+define('IMAGE_BUTTON_ADD_ADDRESS', 'Añadir dirección');
+define('IMAGE_BUTTON_ADDRESS_BOOK', 'Libreta de direcciones');
+define('IMAGE_BUTTON_BACK', 'Atrás');
+define('IMAGE_BUTTON_BUY_NOW', 'Comprar Ahora');
+define('IMAGE_BUTTON_CHANGE_ADDRESS', 'Cambiar Dirección');
+define('IMAGE_BUTTON_CHECKOUT', 'Hacer efectivo el pedido');
+define('IMAGE_BUTTON_CONFIRM_ORDER', 'Confirmar el pedido');
+define('IMAGE_BUTTON_CONTINUE', 'Continuar');
+define('IMAGE_BUTTON_CONTINUE_SHOPPING', 'Seguir comprando');
+define('IMAGE_BUTTON_DELETE', 'Eliminar');
+define('IMAGE_BUTTON_EDIT_ACCOUNT', 'Editar cuenta');
+define('IMAGE_BUTTON_HISTORY', 'Historial de pedidos');
+define('IMAGE_BUTTON_LOGIN', 'Registrarse');
+define('IMAGE_BUTTON_IN_CART', 'Añadir al carrito');
+define('IMAGE_BUTTON_NOTIFICATIONS', 'Notificaciones');
+define('IMAGE_BUTTON_QUICK_FIND', 'Búsqueda rápida');
+define('IMAGE_BUTTON_REMOVE_NOTIFICATIONS', 'Eliminar avisos');
+define('IMAGE_BUTTON_REVIEWS', 'Comentarios');
+define('IMAGE_BUTTON_SEARCH', 'Buscar');
+define('IMAGE_BUTTON_SHIPPING_OPTIONS', 'Opciones de envío');
+define('IMAGE_BUTTON_TELL_A_FRIEND', 'Enviar información a alguien');
+define('IMAGE_BUTTON_UPDATE', 'Actualizar');
+define('IMAGE_BUTTON_UPDATE_CART', 'Actualizar carrito');
+define('IMAGE_BUTTON_WRITE_REVIEW', 'Escribir comentario');
+
+define('SMALL_IMAGE_BUTTON_DELETE', 'Eliminar');
+define('SMALL_IMAGE_BUTTON_EDIT', 'Modificar');
+define('SMALL_IMAGE_BUTTON_VIEW', 'Ver');
+
+define('ICON_ARROW_RIGHT', 'más');
+define('ICON_CART', 'En el carrito');
+define('ICON_ERROR', 'Error');
+define('ICON_SUCCESS', 'Correcto');
+define('ICON_WARNING', 'Aviso');
+
+define('TEXT_CUSTOMER_GREETING_HEADER', 'Bienvenida');
+define('TEXT_GREETING_PERSONAL', '¡Bienvenido de nuevo <span class="greetUser">%s!</span> ¿Le gustaría ver que <a href="%s"><u>nuevos productos</u></a> hay disponibles?');
+define('TEXT_GREETING_PERSONAL_RELOGON', '<small>Si usted no es %s, por favor <a href="%s"><u>regístrese</u></a> con sus propios datos.</small>');
+define('TEXT_GREETING_GUEST', '¡Bienvenido <span class="greetUser">Invitado!</span> ¿Le gustaría <a href="%s"><u>registrarse</u></a> o prefiere <a href="%s"><u>crear una cuenta nueva</u></a>?');
+
+define('TEXT_SORT_PRODUCTS', 'Ordenar productos ');
+define('TEXT_DESCENDINGLY', 'orden descendente');
+define('TEXT_ASCENDINGLY', 'orden ascendente');
+define('TEXT_BY', ' por ');
+
+define('TEXT_REVIEW_BY', 'por %s');
+define('TEXT_REVIEW_WORD_COUNT', '%s palabras');
+define('TEXT_REVIEW_RATING', 'Valoración: %s [%s]');
+define('TEXT_REVIEW_DATE_ADDED', 'Añadido en: %s');
+define('TEXT_NO_REVIEWS', 'Actualmente no hay ningún comentario.');
+
+define('TEXT_NO_NEW_PRODUCTS', 'Actualmente no hay novedades.');
+
+define('TEXT_NO_PRODUCTS', 'No existen productos en ese rango.');
+
+define('TEXT_UNKNOWN_TAX_RATE', 'Impuesto desconocido');
+
+define('TEXT_REQUIRED', '<span class="errorText">Necesario</span>');
+
+// Down For Maintenance
+define('TEXT_BEFORE_DOWN_FOR_MAINTENANCE', 'NOTA: Este sitio estará cerrado por mantenimiento el: ');
+define('TEXT_ADMIN_DOWN_FOR_MAINTENANCE', 'NOTA: Este sitio está cerrado al público por mantenimiento');
+
+define('ERROR_TEP_MAIL', '<font face="Verdana, Arial" size="2" color="#ff0000"><b><small>TEP ERROR:</small> No se ha podido enviar el email con el servidor SMTP especificado. Configure su servidor SMTP en la sección adecuada del fichero php.ini.</b></font>');
+define('WARNING_INSTALL_DIRECTORY_EXISTS', 'Aviso: La carpeta de instalación existe en: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install. Por razones de seguridad, elimine esta carpeta completamente.');
+define('WARNING_UPGRADES_DIRECTORY_EXISTS', 'Warning: Upgrades directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/upgrades. Please remove this directory for security reasons.');
+define('WARNING_CONFIG_FILE_WRITEABLE', 'Aviso: Se puede escribir en el archivo de configuración: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php. En determinadas circunstancias esto puede suponer un riesgo - por favor cambie los permisos de este archivo.');
+define('WARNING_SESSION_DIRECTORY_NON_EXISTENT', 'Aviso: La carpeta para guardar datos de sesión no existe: ' . tep_session_save_path() . '. Las sesiones no funcionarán hasta que no se solvente este error.');
+define('WARNING_SESSION_DIRECTORY_NOT_WRITEABLE', 'Aviso: No es posible escribir en la carpeta para datos de sesión: ' . tep_session_save_path() . '. Las sesiones no funcionarán hasta que no se solvente este error.');
+define('WARNING_SESSION_AUTO_START', 'Aviso: session.auto_start esta activado - por favor, desactive esta característica php en el archivo php.ini y reinicie el servidor web.');
+define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Aviso: La carpeta para productos descargables no existe: ' . DIR_FS_DOWNLOAD . '. Los productos descargables no funcionarán hasta que no se solvente este error.');
+define('WARNING_ENCRYPT_FILE_MISSING', 'Warning: The Encryption key file is missing.');
+
+
+define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'Error: 01 The first four digits of the number entered are: %s If that number is correct, we do not accept that type of credit card.If it is wrong, please try again.');
+define('TEXT_CCVAL_ERROR_INVALID_MONTH', 'Error: 02 The expiry date Motnth entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_YEAR', 'Error: 03 The expiry date year entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Error: 04 The expiry date entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 05 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_SHORT', 'Error: 06 You have not entered the correct amount of digits. Please ensure you have entered all of the long number displayed on the front of your card');
+define('TEXT_CCVAL_ERROR_BLACKLIST', 'Error: 07 We cannot accept your card as it is blacklisted, if you feel you have recieved this message in error please contact your card issuer.');
+define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'Error: 08 The CCV/CVV/CID number entered is the incorrect length. Please try again.');
+define('TEXT_CCVAL_ERROR_NOT_ACCEPTED', 'Error: 09 The credit card number you have entered appears to be a %s card. Unfortunately at this time we do not accept %s as payment.');
+define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Error: 10 The credit card number entered is invalid. Please check the number for misstyped numbers and try again.');
+
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default Chainreaction-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+define('FOOTER_TEXT_BODY', 'Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">OsCommerce</a> y <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Funcionando con <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.creloaded.com" target="_blank">CRE Loaded Team</a><br>Programación adicional: <a href="http://www.primersitio.com" target="_blank">Qbix Soluciones Lógicas</a><br>Versión ' . PROJECT_VERSION);
+/////////////////////////////////////////////////////////////////////
+// HEADER.PHP
+// Header Links
+define('HEADER_LINKS_DEFAULT','PRINCIPAL');
+define('HEADER_LINKS_WHATS_NEW','NOVEDADES');
+define('HEADER_LINKS_SPECIALS','OFERTAS');
+define('HEADER_LINKS_REVIEWS','COMENTARIOS');
+define('HEADER_LINKS_LOGIN','REGISTRARSE');
+define('HEADER_LINKS_LOGOFF','SALIR');
+define('HEADER_LINKS_PRODUCTS_ALL','CATÁLOGO');
+define('HEADER_LINKS_ACCOUNT_INFO','SU CUENTA');
+define('HEADER_LINKS_LINKS','ENLACES');
+define('HEADER_LINKS_FAQ','PREGUNTAS FRECUENTES (FAQ)');
+define('HEADER_LINKS_NEWS','NOVEDADES');
+define('HEADER_LINKS_INFORMATION','INFORMACIÓN');
+/////////////////////////////////////////////////////////////////////
+
+// BOF: Lango added for print order mod
+define('IMAGE_BUTTON_PRINT_ORDER', 'Pedido imprimible');
+// EOF: Lango added for print order mod
+
+// WebMakers.com Added: Attributes Sorter
+require(DIR_WS_LANGUAGES . $language . '/' . 'attributes_sorter.php');
+
+// wishlist box text in includes/boxes/wishlist.php
+define('BOX_HEADING_CUSTOMER_WISHLIST', 'Mis artículos favoritos');
+define('BOX_WISHLIST_EMPTY', 'Usted no tiene artículos en su lista de favoritos');
+define('IMAGE_BUTTON_ADD_WISHLIST', 'Agregar a la lista de favoritos');
+define('TEXT_WISHLIST_COUNT', 'Existen %s artículos favoritos en su lista.');
+define('TEXT_DISPLAY_NUMBER_OF_WISHLIST', 'Mostrando del <b>%d</b> al <b>%d</b> (de <b>%d</b> artículos favoritos en su lista)');
+define('BOX_HEADING_CUSTOMER_WISHLIST_HELP', 'Ayuda de la lista de favoritos');
+define('BOX_HEADING_SEND_WISHLIST', 'Enviar su lista de favoritos');
+define('BOX_TEXT_MOVE_TO_CART', 'Mover al carrito');
+define('BOX_TEXT_DELETE', 'Eliminar');
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+// define('BOX_HEADING_INFORMATION', 'Sistema de información');
+ define('BOX_INFORMATION_MANAGER', 'Gestor de información');
+//DWD Modify End
+
+if(file_exists('includes/languages/espanol_newsdesk.php')) {
+include('includes/languages/espanol_newsdesk.php');
+include('includes/languages/espanol_faqdesk.php');
+}
+
+/*Begin Checkout Without Account images*/
+define('IMAGE_BUTTON_CREATE_ACCOUNT', 'Crear cuenta');
+define('NAV_ORDER_INFO', 'Información de pedido');
+/*End Checkout WIthout Account images*/
+
+// Include for Events Calendar 2.0 Contribution 
+define('BOX_TOOLS_EVENTS_MANAGER', 'Events Manager');
+define('IMAGE_NEW_EVENT', 'New Event');
+
+// VJ guest pricing begin
+// ADDED for Viewprice
+// Text to replace price in InfoBoxes
+define('PRICES_LOGGED_IN_TEXT', 'Trade Price');
+// Text to replace price in Product Info, Specials & New Products lists
+define('PRICES_LOGGED_IN_SUBMIT','Trade Price');
+// Text to replace Buy 'Now button'
+define('PRICES_LOGGED_IN_BUY_TEXT', 'Trade Only');
+// END ViewPrice
+// VJ guest pricing end
+
+//Added for FAQ System 2.1 DMG
+
+  define('BOX_INFORMATION_FAQ', 'FAQ');
+
+//added for Article Manager DMG
+
+// Article Manager
+define('BOX_HEADING_ARTICLES', 'Noticias');
+define('BOX_ALL_ARTICLES', 'Todas las noticias');
+define('BOX_NEW_ARTICLES', '&Uacute;ltimas noticias');
+define('TEXT_DISPLAY_NUMBER_OF_ARTICLES', 'Mostrando de <b>%d</b> a <b>%d</b> (de <b>%d</b> noticias)');
+define('TEXT_DISPLAY_NUMBER_OF_ARTICLES_NEW', 'Mostrando de <b>%d</b> a <b>%d</b> (de <b>%d</b> &uacute;ltimas noticias)');
+define('TABLE_HEADING_AUTHOR', 'Autor');
+define('TABLE_HEADING_ABSTRACT', 'Extracto');
+define('BOX_HEADING_AUTHORS', 'Noticias por autor');
+define('NAVBAR_TITLE_DEFAULT', 'Noticias');
+define('BOX_ASEARCH_TEXT','Search Articles Text');
+// Eversun mod for sppc and qty price breaks
+define('ENTRY_COMPANY_TAX_ID', 'Company\'s tax id number:');
+define('ENTRY_COMPANY_TAX_ID_ERROR', '');
+define('ENTRY_COMPANY_TAX_ID_TEXT', '');
+// Eversun mod end for sppc and qty price breaks  
+
+
+#################    Starts - 15 June 2006    #################
+
+
+define('IFRAME_ERROR','Sorry, you browser does not support iframes.');
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_1","You still have</br>");
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_2","</br>left to spend in your Gift Voucher Account<br><br>");
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_3","Send to a Friend");
+define("DONATE_BUTTON_IMAGE_ALT","Make payments with PayPal - it\'s fast, free and secure");
+
+
+#################    Ends - 15 June 2006    #################
+
+
+#################    Starts - 16 June 2006    #################
+
+
+define("LOGIN_ALT","login");
+define("LOGOFF_ALT","logoff");
+define("MYACCOUNT_ALT","MyAccount");
+define("SPECIALS_ALT","Specials");
+define("WHATS_NEW_ALT","What\'s New");
+define("CONTACT_US_ALT","Contact Us");
+define("IMAGE_ALT","image");
+define("BOX_ALT","box");
+
+#################    Ends - 16 June 2006    #################
+
+
+#################    Starts - 20 June 2006    #################
+
+//dayNames in calender
+define("S","S");
+define("M","M");
+define("T","T");
+define("W","W");
+define("T","T");
+define("F","F");
+define("S","S");
+
+//monthNames  in calender
+define("JANUARY","JANUARY");
+define("FEBRUARY","FEBRUARY");
+define("MARCH","MARCH");
+define("APRIL","APRIL");
+define("MAY","MAY");
+define("JUNE","JUNE");
+define("JULY","JULY");
+define("AUGUST","AUGUST");
+define("SEPTEMBER","SEPTEMBER");
+define("OCTOBER","OCTOBER");
+define("NOVEMBER","NOVEMBER");
+define("DECEMBER","DECEMBER");
+
+
+
+define("DELETE_CACHE_FILES",'cache files deleted - top level');
+define("UPDATE_CONFIGURATION_SETTING",'reset to false');
+define("UPDATE_CONFIG_FILES_EXIST",'configuration cache files updated');
+define("UPDATE_CONFIG_FILES_NOTEXIST",'ERROR: update file does not exist');
+define("IS_GUEST_CHECK",'customer_id not set');
+define("FILE_EXISTS_AND_IS_NOT_EXPIRED",'file exists and is not expired');
+define("NO_FILE_OR_EXPIRED",'file does not exist or is expired');
+define("OB_STARTED",'ob started @ ');
+define("IS_GUESS_CHECK_END",'customer_id not set ');
+define("OB_COMPRESSED",'output buffer flushed and compressed');
+define("CACHE_OUTPUTT",'compressed ob sent to screen');
+define("CACHE_WRITE_FILE",'compressed ob written to file');
+define("UNSET_CACHE_COMPRESS", 'cache compress unset');
+define("COMPRESS_BUFFER", 'compressing buffer');
+define("CACHE_FILE_WRITE", 'buffer writtent to file');
+define("CACHE_UNSET_WRITE_BUFFER", 'write buffer unset');
+define("OUTPUT_2_SCREEN", 'successfully output to screen');
+define("CACHE_UNSET_SCREEN_BUFFER", 'screen buffer unset');
+
+define("OPEN_SESSION_FILE_ERROR", 'Could not open session file');
+define("WRITE_SESSION_FILE_ERROR", 'Could not write session file');
+define("SESSION_MODULE_ERROR", 'Failed to initialize session module.');
+define("SESSION_NOT_SAVED", 'Session could not be saved.');
+define("SESSION_NOT_CLOSED", 'Session could not be closed.');
+define("SESSION_NOT_STARTED", 'Session could not be started.');
+
+///
+define("NO_BANNER_WITH_GROUP_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_GROUP_ERROR2", 'No banners with group');
+define("NO_BANNER_WITH_GROUP_ERROR3", ' found!</b>');
+define("NO_BANNER_WITH_ID_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_ID_ERROR2", 'Banner with ID');
+define("NO_BANNER_WITH_ID_ERROR3", ' not found, or status inactive</b>');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR2", 'Unknown');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR3", 'parameter value - it must be either');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR4", 'dynamic');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR5", 'static');
+define("TEP_DB_ERRORR", '[TEP STOP]');
+define("TEP_HREF_LINK_ERROR1", '<b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
+define("TEP_HREF_LINK_ERROR2", '<b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
+
+///
+
+#################    Ends - 20 June 2006    #################
+
+
+#################    Starts - 21 June 2006    #################
+
+
+
+define("CVV_HELP_TITLE","Card Verification Value (ccv/cvc/ccv2/cid) Help");
+define("CVV_HELP_DESC1","<p><strong>What is a Card Verification Value (ccv/cvc/ccv2/cid)?</strong>
+      </p>
+      <p>The Card Verification Value (ccv/cvc/ccv2/cid) is a 3-digit number found on the signature
+        panel on the back of your credit card. It is an additional safeguard that
+        helps us validate your purchase and protect against fraud. It is not contained
+        in the magnetic stripe information and is therefore not printed on sales
+        receipts.</p>
+      <p><strong>Where is the ccv/cvc/ccv2/cid located?</strong></p>");
+
+
+define("CVV_HELP_DESC2","<p><strong>VISA, MASTERCARD,  DISCOVERY &amp; most other cards</strong><br>
+        You can find your card verification code on the reverse side of your credit
+        card, printed into the signature field. It is a 3-digit group for MasterCard,
+        Visa, Discovery, and most other cards.<br>
+      </p> ");
+
+
+define("CVV_HELP_DESC3","<p><strong>AMERICAN EXPRESS</strong><br>
+        The American Express Card verification code is a 4-digit number printed
+        on the front of your card. It appears after and to the right (above) of
+        your card number.<br>
+      </p>");
+
+
+#################    Start - 23 June 2006   #################
+
+define("INFO_CC_1","Make Shopping Easier for Customers with Website Payments");
+define("INFO_CC_2",''.tep_image(DIR_WS_MODULES . 'payment/paypal/images/hdr_ppGlobev4_160x76.gif',' PayPal ','','','align=right valign="top" style="margin: 10px;"').'
+PayPal has optimized their checkout experience by launching an exciting new improvement to their payment flow.
+<br/><br/>For new buyers, signing up for a PayPal account is now optional. This means you can complete your payment first, and then decide whether to save your information for future purchases.
+<p>To pay by credit card, look for this button:<br/>
+<p align="center">'.tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-ContinueCheckout.gif','','','').'</p>
+<br/>
+Or you may see this:<br/>
+<p align="center">'.tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-no-account-Click-Here.gif','','','').'</p>
+<br/>
+One of these options should appear on the first PayPal screen.<br/>
+<p>Note: if you are a PayPal member, you can either use your account,
+or use a credit card that is not associated with a PayPal account.
+In that case you\'d also need to use an email address that\'s not associated with a PayPal account.</p> ');
+
+
+define("PAYPAL_SHOPPING_CART_IPN_SUBJECT","PayPal_Shopping_Cart_IPN");
+define("PAYPAL_SHOPPING_CART_IPN_FROM","PayPal_Shopping_Cart_IPN");
+
+#################    End - 23 June 2006   #################
+
+
+#################    Start - 28 June 2006   #################
+
+define("BOX_HEADING_CUSTOMER_WISHLIST_VIEW","My Wishlist View");
+define("BOX_HEADING_CUSTOMER_WISHLIST_HELP","My Wishlist Help");
+
+#################    End - 28 June 2006   #################
+
+
+#################    Start - 29 June 2006   #################
+
+
+define("VIEWPRICE_ERROR",'You must be logged in to search for prices.');
+
+define("UNABLE_TO_CONNECT_TO_DATABASE_SERVER",'Unable to connect to database server!');
+define("AFFILIATE_SHOW_BANNER_CHECK_PATHES",'Check the pathes! (catalog/includes/configure.php)');
+define("AFFILIATE_SHOW_BANNER_ABSOLUTE_PATH",'absolute path to picture:');
+define("AFFILIATE_SHOW_BANNER_BUILD_WITH_1",'build with:');
+define("AFFILIATE_SHOW_BANNER_BUILD_WITH_2",'DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG . DIR_WS_IMAGES . $banner');
+define("AFFILIATE_SHOW_BANNER_DIR_FS_DOCUMENT_ROOT",'DIR_FS_DOCUMENT_ROOT');
+define("AFFILIATE_SHOW_BANNER_DIR_WS_CATALOG",'DIR_WS_CATALOG');
+define("AFFILIATE_SHOW_BANNER_DIR_WS_IMAGES",'DIR_WS_IMAGES');
+define("AFFILIATE_SHOW_BANNER_BANNER",'$banner');
+define("AFFILIATE_SHOW_BANNER_SQL_QUERY_USED",'SQL-Query used:');
+define("AFFILIATE_SHOW_BANNER_TRY_TO_FIND_ERROR",'Try to find error:');
+define("AFFILIATE_SHOW_BANNER_SQL_QUERY",'SQL-Query:');
+define("AFFILIATE_SHOW_BANNER_LOCATING_PIC",'Locating Pic');
+
+
+#################    End - 29 June 2006   #################
+
+#################    End - 01 July 2006   #################
+
+define("PAYPAL_NOTIFY_IPN_TEST_1","TEST IPN Processed for order #");
+define("PAYPAL_NOTIFY_IPN_TEST_2","You need to specify an order #");
+define("PAYPAL_NOTIFY_RECEIVED_ERROR_1","Error: no valid ");
+define("PAYPAL_NOTIFY_RECEIVED_ERROR_2"," received.");
+
+define('TEXT_CLOSE_WINDOW', 'Close Window');
+
+
+#################    End - 01 July 2006   #################
+
+define("TEXT_YOUR_CONTENT_HERE","Your Content here");
+define("TEXT_NO_SPECIALS","There are currently no specials defined.");
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/account.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: account.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Mon compte');
+define('HEADING_TITLE', 'Information sur mon compte');
+
+define('OVERVIEW_TITLE', 'Aper&ccedil;u g&eacute;n&eacute;ral');
+define('OVERVIEW_SHOW_ALL_ORDERS', '(Afficher toutes mes commandes)');
+define('OVERVIEW_PREVIOUS_ORDERS', 'Commandes pr&eacute;c&eacute;dentes');
+
+define('MY_ACCOUNT_TITLE', 'Mon compte');
+define('MY_ACCOUNT_INFORMATION', 'Afficher ou modifier les informations de mon compte.');
+define('MY_ACCOUNT_ADDRESS_BOOK', 'Afficher ou modifier des entr&eacute;es dans mon carnet d\'adresses.');
+define('MY_ACCOUNT_PASSWORD', 'Changer le mot de passe de mon compte.');
+
+define('MY_ORDERS_TITLE', 'Mes commandes');
+define('MY_ORDERS_VIEW', 'Afficher les commandes que j\'ai effectu&eacute;es.');
+
+define('EMAIL_NOTIFICATIONS_TITLE', 'Notifications courrier &eacute;lectronique');
+define('EMAIL_NOTIFICATIONS_NEWSLETTERS', 'S\'abonner ou se d&eacute;sabonner des bulletins d\'informations.');
+define('EMAIL_NOTIFICATIONS_PRODUCTS', 'Afficher ou modifier ma liste de notification de produit.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/account_edit.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/account_edit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/account_edit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: account_edit.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mon compte');
+define('NAVBAR_TITLE_2', 'Editer compte');
+
+define('HEADING_TITLE', 'Information de mon compte');
+
+define('MY_ACCOUNT_TITLE', 'Mon compte');
+
+define('SUCCESS_ACCOUNT_UPDATED', 'Votre compte a &eacute;t&eacute; mis &agrave; jour avec succ&egrave;s.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/account_history.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/account_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/account_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: account_history.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mon compte');
+define('NAVBAR_TITLE_2', 'Historique');
+
+define('HEADING_TITLE', 'Historique de mes commandes');
+
+define('TEXT_ORDER_NUMBER', 'Num&eacute;ro de commande :');
+define('TEXT_ORDER_STATUS', 'Statut de la commande :');
+define('TEXT_ORDER_DATE', 'Date de la commande :');
+define('TEXT_ORDER_SHIPPED_TO', 'Exp&eacute;diez &agrave; :');
+define('TEXT_ORDER_BILLED_TO', 'Factur&eacute; &agrave; :');
+define('TEXT_ORDER_PRODUCTS', 'Produits:');
+define('TEXT_ORDER_COST', 'Total de la commande :');
+define('TEXT_VIEW_ORDER', 'Afficher la commande');
+
+define('TEXT_NO_PURCHASES', 'Vous n\'avez pas encore d\'achat.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/account_history_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/account_history_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/account_history_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: account_history_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mon compte');
+define('NAVBAR_TITLE_2', 'Historique');
+define('NAVBAR_TITLE_3', 'Commande #%s');
+
+define('HEADING_TITLE', 'Information commande');
+
+define('HEADING_ORDER_NUMBER', 'Commande #%s');
+define('HEADING_ORDER_DATE', 'Date de la commande :');
+define('HEADING_ORDER_TOTAL', 'Total de la commande:');
+
+define('HEADING_DELIVERY_ADDRESS', 'Adresse de livraison');
+define('HEADING_SHIPPING_METHOD', 'Mode d\'exp&eacute;dition');
+
+define('HEADING_PRODUCTS', 'Produits');
+define('HEADING_OPTIONS', 'Option\'s');
+define('HEADING_PRODUCTS_BASE_PRICE', 'Base');
+define('HEADING_PRODUCTS_FINAL_PRICE', 'Final');
+define('HEADING_TAX', 'Taxe');
+define('HEADING_TOTAL', 'Total');
+
+define('HEADING_BILLING_INFORMATION', 'Information facturation');
+define('HEADING_BILLING_ADDRESS', 'Adresse de facturation');
+define('HEADING_PAYMENT_METHOD', 'Mode de paiement');
+
+define('HEADING_ORDER_HISTORY', 'Historique de la commande');
+define('HEADING_COMMENT', 'Commentaires');
+define('TEXT_NO_COMMENTS_AVAILABLE', 'Aucun commentaire disponible.');
+
+define('TABLE_HEADING_DOWNLOAD_DATE', 'Liens expir&eacute;s : ');
+define('TABLE_HEADING_DOWNLOAD_COUNT', 'T&eacute;l&eacute;chargements restants');
+define('HEADING_DOWNLOAD', 'Liens de t&eacute;l&eacute;chargement');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/account_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/account_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/account_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: account_newsletters.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mon compte');
+define('NAVBAR_TITLE_2', 'Souscription bulletin d\'informations');
+
+define('HEADING_TITLE', 'Souscription au bulletin d\'informations');
+
+define('MY_NEWSLETTERS_TITLE', 'Mes souscriptions bulletin d\'informations');
+define('MY_NEWSLETTERS_GENERAL_NEWSLETTER', 'Bulletin d\'informations g&eacute;n&eacute;ral');
+define('MY_NEWSLETTERS_GENERAL_NEWSLETTER_DESCRIPTION', 'Y compris les actualit&eacute;s du magasin, les nouveaux produits, les offres sp&eacute;ciales, et les autres annonces promotionnelles.');
+
+define('SUCCESS_NEWSLETTER_UPDATED', 'Vos abonnements au bulletin d\'informations ont &eacute;t&eacute; mis &agrave; jour avec succ&egrave;s.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/account_notifications.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/account_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/account_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: account_notifications.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mon compte');
+define('NAVBAR_TITLE_2', 'Notifications de produits');
+
+define('HEADING_TITLE', 'Notifications de produits');
+
+define('MY_NOTIFICATIONS_TITLE', 'Mes notifications de produits');
+define('MY_NOTIFICATIONS_DESCRIPTION', 'La liste de notification de produit vous permet de veiller sur les produits qui vous int&eacute;ressent.<br><br>Pour &ecirc;tre inform&eacute; de tous changements sur les produits, choisissez les <b>notifications globales de produit</b>.');
+
+define('GLOBAL_NOTIFICATIONS_TITLE', 'Notifications globales de produits');
+define('GLOBAL_NOTIFICATIONS_DESCRIPTION', 'Recevoir des notifications sur tous produits disponibles.');
+
+define('NOTIFICATIONS_TITLE', 'Notifications de produits');
+define('NOTIFICATIONS_DESCRIPTION', 'Pour supprimer une notification de produit, d&eacute;cochez la case &agrave; cocher du produit et cliquez sur Continuer.');
+define('NOTIFICATIONS_NON_EXISTING', 'Il n\'y a actuellement aucun produit coch&eacute;.<br><br>Pour ajouter des produits à votre liste de notification de produit, cliquez sur le lien notification disponible sur la page d\'information de produit d&eacute;taill&eacute;e.');
+
+define('SUCCESS_NOTIFICATIONS_UPDATED', 'Vos notifications de produit ont &eacute;t&eacute; mises &agrave; jour avec succ&egrave;s.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/account_password.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/account_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/account_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: account_password.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mon compte');
+define('NAVBAR_TITLE_2', 'Changer de mot de pase');
+
+define('HEADING_TITLE', 'Mon mot de passe');
+
+define('MY_PASSWORD_TITLE', 'Mon mot de passe');
+
+define('SUCCESS_PASSWORD_UPDATED', 'Votre mot de passe a &eacute;t&eacute; mis &agrave; jour avec succ&egrave;s.');
+define('ERROR_CURRENT_PASSWORD_NOT_MATCHING', 'Votre mot de passe courant doit &ecirc;tre diff&eacute;rent du mot de passe actuellement enregistr&eacute; sur notre site. Veuillez essayer de nouveau.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/address_book.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/address_book.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/address_book.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: address_book.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mon compte');
+define('NAVBAR_TITLE_2', 'Carnet d\'adresse');
+
+define('HEADING_TITLE', 'Carnet d\'adresses personnel');
+
+define('PRIMARY_ADDRESS_TITLE', 'Adresse principale');
+define('PRIMARY_ADDRESS_DESCRIPTION', 'Cette adresse est employ&eacute;e comme adresse principale d\'exp&eacute;dition et de facturation pour des commandes pass&eacute;es sur ce magasin.<br><br>Cette adresse est &eacute;galement employ&eacute;e comme base pour le produit et les calculs de taxes sur le service.');
+
+define('ADDRESS_BOOK_TITLE', 'Entr&eacute;es du carnet d\'adresses');
+
+define('PRIMARY_ADDRESS', '(Adresse principale)');
+
+define('TEXT_MAXIMUM_ENTRIES', '<font color="#ff0000"><b>REMARQUE :</b></font> Un maximum de %s entr&eacute;es dans le carnet d\'adresses est autoris&eacute;.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/address_book_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/address_book_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/address_book_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: address_book_process.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Mon compte');
+define('NAVBAR_TITLE_2', 'Carnet d\'adresses');
+
+define('NAVBAR_TITLE_ADD_ENTRY', 'Nouvelle entr&eacute;e');
+define('NAVBAR_TITLE_MODIFY_ENTRY', 'Mise &agrave; jour entr&eacute;e');
+define('NAVBAR_TITLE_DELETE_ENTRY', 'Supprimer entr&eacute;e');
+
+define('HEADING_TITLE_ADD_ENTRY', 'Nouvelle entr&eacute;e sur carnet d\'adresses');
+define('HEADING_TITLE_MODIFY_ENTRY', 'Mise &agrave; jour entr&eacute;e sur carnet d\'adresses');
+define('HEADING_TITLE_DELETE_ENTRY', 'Supprimer entr&eacute;e sur carnet d\'adresses');
+
+define('DELETE_ADDRESS_TITLE', 'Supprimer l\'adresse');
+define('DELETE_ADDRESS_DESCRIPTION', 'Etes-vous s&ucirc;r de vouloir supprimer l\'adresse s&eacute;lectionn&eacute;e dans votre carnet d\'adresses ?');
+
+define('NEW_ADDRESS_TITLE', 'Nouvelle entr&eacute;e sur carnet d\'adresses');
+
+define('SELECTED_ADDRESS', 'Adresse s&eacute;lectionn&eacute;e');
+define('SET_AS_PRIMARY', 'S&eacute;lectionner comme adresse principale.');
+
+define('SUCCESS_ADDRESS_BOOK_ENTRY_DELETED', 'L\'adresse s&eacute;lectionn&eacute;e a &eacute;t&eacute; supprim&eacute;e avec succ&egrave;s de votre carnet d\'adresses.');
+define('SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED', 'Votre carnet d\'adresses a &eacute;t&eacute; mis &agrave; jour avec succ&egrave;s.');
+
+define('WARNING_PRIMARY_ADDRESS_DELETION', 'L\'adresse principale ne peut pas &ecirc;tre suprim&eacute;e. Veuillez s&eacute;lectionner une autre adresse comme adresse principale et essayez de nouveau.');
+
+define('ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY', 'L\'entr&eacute;e du carnet d\'adresses n\'existe pas.');
+define('ERROR_ADDRESS_BOOK_FULL', 'Votre carnet d\'adresses est plein. Veuillez supprimer une adresse inutile pour en enregistrer une nouvelle.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/advanced_search.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/advanced_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/advanced_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: advanced_search.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Recherche avanc&eacute;e');
+define('NAVBAR_TITLE_2', 'R&eacute;sultats de recherche');
+
+define('HEADING_TITLE_1', 'Recherche avanc&eacute;e');
+define('HEADING_TITLE_2', 'Produits r&eacute;pondant aux crit&egrave;res de recherche');
+
+define('HEADING_SEARCH_CRITERIA', 'Crit&egrave;res de recherche');
+
+define('TEXT_SEARCH_IN_DESCRIPTION', 'Chercher dans les descriptions de produits');
+define('ENTRY_CATEGORIES', 'Cat&eacute;gories:');
+define('ENTRY_INCLUDE_SUBCATEGORIES', 'Inclure les sous-cat&eacute;gories');
+define('ENTRY_MANUFACTURERS', 'Fabricants:');
+define('ENTRY_PRICE_FROM', 'Prix &agrave; partir de :');
+define('ENTRY_PRICE_TO', 'Prix jusqu\'&agrave; :');
+define('ENTRY_DATE_FROM', 'Depuis la date :');
+define('ENTRY_DATE_TO', 'Jusqu\'&agrave; la date :');
+
+define('TEXT_SEARCH_HELP_LINK', '<u>Aide pour la recherche</u> [?]');
+
+define('TEXT_ALL_CATEGORIES', 'Toutes les cat&eacute;gories');
+define('TEXT_ALL_MANUFACTURERS', 'Tous les fabricants');
+
+define('HEADING_SEARCH_HELP', 'Aide pour la recherche');
+define('TEXT_SEARCH_HELP', 'Vous pouvez s&eacute;parer les mots cl&eacute;s par les op&eacute;rateurs logiques AND et OR. Par exemple, vous pouvez entrer <u>Microsoft AND souris</u>. Cette recherche vous affichera les r&eacute;sultats qui r&eacute;pondent simultan&eacute;ment aux deux crit&egrave;res. Toutefois, si vous tapez <u>souris OR clavier</u>, seront list&eacute;s les articles qui ont au moins l\'un des deux mots dans les champs s&eacute;lectionn&eacute;s. Si aucun op&eacute;rateur n\'est pr&eacute;cis&eacute;, la recherche s\'effectuera avec l\'op&eacute;rateur AND.<br><br>Vous pouvez &eacute;galement faire une recherche sur une chaine en l\'encadrant de guillements. Par exemple, une recherche sur <u>ordinateur portable</u> vous affichera la liste de tous les articles ayant exactement cette chaine dans leur description.<br><br>Les parenth&egrave;ses peuvent &ecirc;tre utilis&eacute;es pour contr&ocirc;ler l\'ordre de traitement des op&eacute;rateurs logiques. Par exemple entrez <u>Microsoft and (clavier or souris or visual basic)</u>.');
+define('TEXT_CLOSE_WINDOW', '<u>Fermer la fen&ecirc;tre</u> [x]');
+
+define('TABLE_HEADING_IMAGE', '');
+define('TABLE_HEADING_MODEL', 'Mod&egrave;le');
+define('TABLE_HEADING_PRODUCTS', 'Nom du produit');
+define('TABLE_HEADING_MANUFACTURER', 'Fabricant');
+define('TABLE_HEADING_QUANTITY', 'Quantit&eacute;');
+define('TABLE_HEADING_PRICE', 'Prix');
+define('TABLE_HEADING_WEIGHT', 'Poids');
+define('TABLE_HEADING_BUY_NOW', 'Acheter maintenant');
+
+define('TEXT_NO_PRODUCTS', 'Il n\y a pas de produit correspondant &agrave; vos crit&egrave;res de recherche.');
+
+define('ERROR_AT_LEAST_ONE_INPUT', 'Au moins un des champs dans le formulaire de recherche doit &ecirc;tre rempli.');
+define('ERROR_INVALID_FROM_DATE', 'Date du champ <b>Depuis la date</b> invalide.'); 
+define('ERROR_INVALID_TO_DATE', 'Date du champ <b>Jusqu\'&agrave; la date</b>  invalide.'); 
+define('ERROR_TO_DATE_LESS_THAN_FROM_DATE', 'La date du champ <b>Jusqu\'&agrave; la date</b> doit &ecirc;tre sup&eacute;rieure ou &eacute;gale &agrave; la date du champ <b>Depuis la date</b>'); 
+define('ERROR_PRICE_FROM_MUST_BE_NUM', 'Le prix du champ <b>Prix &agrave; partir de</b> ne doit contenir que des chiffres.'); 
+define('ERROR_PRICE_TO_MUST_BE_NUM', 'Le prix du champ <b>Prix jusqu\'&agrave;</b> ne doit contenir que des chiffres.'); 
+define('ERROR_PRICE_TO_LESS_THAN_PRICE_FROM', 'Le prix du champ <b>Prix jusqu\'&agrave;</b> doit &ecirc;tre sup&eacute;rieure ou &eacute;gale au prix du champ <b>Prix &agrave; partir de</b>.');
+define('ERROR_INVALID_KEYWORDS', 'Mots-cl&eacute;s invalides.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_affiliate.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_affiliate.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Connexion de partenaire');
+define('HEADING_TITLE', 'Connexion de partenaire');
+define('HEADING_TITLE_ERROR', 'Message d\'erreur');
+
+define('TEXT_AFFILIATE_LOGOFF', 'D&eacute;connexion');
+define('TEXT_AFFILIATE_ID', 'Votre email:');
+define('TEXT_AFFILIATE_PASSWORD', 'Mot de passe:');
+
+define('HEADING_NEW_AFFILIATE', 'Nouveau partenaire');
+define('TEXT_NEW_AFFILIATE', 'Je suis un nouveau partenaire.');
+define('TEXT_NEW_AFFILIATE_INTRODUCTION', 'En cr&eacute;ant un compte de partenariat sur ' . STORE_NAME . ' vous gagnerez de l\'argent pour chacun de vos visiteurs qui se connectera sur notre site.');
+define('TEXT_NEW_AFFILIATE_TERMS', 'Conditions g&eacute;n&eacute;rales de partenariat');
+
+define('HEADING_RETURNING_AFFILIATE', 'Partenaire enregistr&eacute;');
+define('TEXT_RETURNING_AFFILIATE', 'Je suis d&eacute;j&agrave; partenaire');
+
+define('TEXT_AFFILIATE_PASSWORD_FORGOTTEN', 'Mot de passe oubli&eacute;? Cliqu&eacute; ici.');
+
+define('TEXT_LOGIN_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> Pas d\'enregistrement pour \'Partenaire ID\' et/ou \'Mot de passe\'.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programme de partenariat');
+define('HEADING_TITLE', 'Banni&egrave;re du programme d\'affiliation');
+
+define('TEXT_AFFILIATE_BANNERS', 'Banner Links');
+define('TEXT_AFFILIATE_BANNERS_BUILD', 'Build a Link');
+define('TEXT_AFFILIATE_BANNERS_PRODUCT', 'Product Links');
+define('TEXT_AFFILIATE_BANNERS_TEXT', 'Text Links');
+
+define('TEXT_INFORMATION_BANNERS_BANNERS', 'Effective HIGHLY colorful graphical links in various shapes and sizes');
+define('TEXT_INFORMATION_BANNERS_BUILD', 'Create dynamic links to a particular product of your choice.');
+define('TEXT_INFORMATION_BANNERS_PRODUCT', 'Recommend specific products to your visitors by linking directly to a particular product.');
+define('TEXT_INFORMATION_BANNERS_TEXT', 'Get maximum sales from these proven to-be-effective and easy-to-use text based links.');
+define('TEXT_INFORMATION', 'S&eacute;lectionnez une banni&egrave;re ou l\'URL que vous voulez afficher sur votre site parmi la liste suivante :');
+define('TEXT_AFFILIATE_NAME', 'Nom de la banni&egrave;re:');
+define('TEXT_AFFILIATE_INFO', 'Copiez le code ci-dessous et coller le sur votre site');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER', 'CREEZ UN LIEN');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO', 'Inscrivez le num&eacute;ro du produit s&eacute;lectionn&eacute; pour le lien.');
+
+define('IMAGE_BUTTON_BUILD_A_LINK','Cr&eacute;ez un lien sur une banni&egrave;re produit.');
+define('IMAGE_BANNERS','Banners');
+define('IMAGE_PRODUCT','Product Links');
+define('IMAGE_BUILD','Build a Link');
+define('IMAGE_TEXT','Text Links');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_banners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: affiliate_banners_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Banners');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Choose the banner you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_build.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_build.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_build.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Build a Link');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Enter the product number of the product you wish to build a link for:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER','BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO','Enter the product number you wish to link to and press the enter&nbsp;');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available products.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the product number from the popup window and enter the number in the Build A Link field.');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Available Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Product #');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('IMAGE_BUTTON_BUILD_A_LINK', 'BUILD-A-LINK');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_build_cat.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_build_cat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_build_cat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Build a CATEGORY Link');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Enter the CATEGORY number of the CATEGORY you wish to build a link for:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER','BUILD-A-CATEGORY-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO','Enter the CATEGORY number you wish to link to and press the enter&nbsp;');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available categories.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the category number from the popup window and enter the number in the Build Category Link field.');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Available Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Categories #');
+define('TEXT_VALID_CATEGORIES_NAME', 'Categories Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('IMAGE_BUTTON_BUILD_A_LINK', 'BUILD-A-LINK');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_category.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_category.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_category.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_banners_category.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Category Links');
+
+define('TEXT_AFFILIATE_NAME', 'Category Name:');
+define('TEXT_INFORMATION', 'Choose the CATEGORY you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_product.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_product.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_product.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_banners_product.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Product Links');
+
+define('TEXT_AFFILIATE_NAME', 'Product Name:');
+define('TEXT_INFORMATION', 'Choose the product you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_text.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_text.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_banners_text.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_banners_text.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Text Links');
+
+define('TEXT_AFFILIATE_NAME', 'Link Name:');
+define('TEXT_INFORMATION', 'Choose the link you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programme de partenariat');
+define('HEADING_TITLE', 'Programme de partenariat : Compteur de clics');
+
+define('TABLE_HEADING_DATE', 'Date');
+define('TABLE_HEADING_REFFERED', 'Ref&eacute;rant');
+define('TABLE_HEADING_IP', 'Adresse IP');
+define('TABLE_HEADING_BROWSER', 'Navigateur');
+define('TABLE_HEADING_CLICKED_PRODUCT', 'Produit');
+
+define('TEXT_AFFILIATE_HEADER', 'Total des clics venant de votre site:');
+define('TEXT_NO_CLICKS', 'Aucun clic enregistr&eacute; venant de votre site.');
+define('TEXT_DISPLAY_NUMBER_OF_CLICKS', 'Affichage <b>%d</b> de <b>%d</b> (sur <b>%d</b> de clics)');
+define('TEXT_CLICKTHROUGH_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_CLICKS', 'Click on [?] to see a description of each category.');
+define('HEADING_CLICKTHROUGH_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the clickthrough from your site.');
+define('TEXT_CLICKED_PRODUCT_HELP', '<i>Product or Page</i> represents the page or product clicked through to');
+define('TEXT_REFFERED_HELP', '<i>Referrer</i> represents the url that the clickthrough came from.');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programme de partenariat');
+define('HEADING_TITLE', 'Programme de partenariat - Formulaire de contact');
+
+define('TEXT_SUCCESS', 'Votre message à &eacute;t&eacute; envoy&eacute; avec succ&egrave;s &agrave; l\'Equipe du Programme de Partenariat.');
+
+define('EMAIL_SUBJECT', 'Programme de partenariat');
+define('ENTRY_NAME', 'Votre nom complet :');
+define('ENTRY_EMAIL', 'Votre adresse email :');
+define('ENTRY_ENQUIRY', 'Votre message :');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_details.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_details.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Le Programme de Partenariat');
+define('NAVBAR_TITLE_2', 'Edition de votre compte Partenaire');
+define('HEADING_TITLE', 'Le Programme de Partenariat - Les infos de votre compte<br><small>Vous pouvez &eacute;diter toutes vos informations ci-dessous :</small>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_details_ok.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_details_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_details_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: affiliate_details_ok.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programme de partenariat');
+define('HEADING_TITLE', 'Les informations de votre compte ont &eacute;t&eacute; modifi&eacute;es !');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<?php
+/*
+  $Id: affiliate_faq.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'FAQ du Programme de partenariat FAQ');
+define('HEADING_TITLE', 'Programme de partenariat - Questions les plus fr&eacute;quentes');
+
+define('TEXT_INFORMATION', '' . STORE_NAME . ' a rassembl&eacute; ces infos afin que vous soyez mieux inform&eacute; sur notre Programme de Partenariat.<br>
+ Si vous avez d\'autres questions <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a> pour plus d\'information.<br>
+<ul>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#1">Question 1?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#2">Question 2?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#3">Question 3?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#4">Question 4?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#5">Question 5?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#6">Question 6?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#7">Question 7?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#8">Question 8?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#9">Question 9?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#10">Question 10?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#11">Question 11?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#12">Question 12?</a>
+</ul>
+<hr width ="90%">
+<BR>
+<FONT COLOR="#000000" size="4"><B><U>Questions les plus fr&eacute;quentes</U></B></FONT>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 1?</font><a name="1"></a><br>
+R&eacute;ponse 1.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 2?</font><a name="2"></a><br>
+R&eacute;ponse 2.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 3?</font><a name="3"></a><br>
+R&eacute;ponse 3.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 4?</font><a name="4"></a><br>
+R&eacute;ponse 4.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 5?</font><a name="5"></a><br>
+R&eacute;ponse 5.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 6?</font><a name="6"></a><br>
+R&eacute;ponse 6.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 7?</font><a name="7"></a><br>
+R&eacute;ponse 7.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 8?</font><a name="8"></a><br>
+R&eacute;ponse 8.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 9?</font><a name="9"></a><br>
+R&eacute;ponse 9.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 10?</font><a name="10"></a><br>
+R&eacute;ponse 10.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 11?</font><a name="11"></a><br>
+R&eacute;ponse 11.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Question 12?</font><a name="12"></a><br>
+R&eacute;ponse 12.</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p align="right" style="line-height: 100%; word-spacing: 0: text-indent: 0: margin: 0:">This text can be edited in includes/languages/<selected language>/affiliate_faq.php.</p>
+');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programme de Partenariat');
+define('HEADING_TITLE', 'Programme de Partenariat');
+
+define('HEADING_AFFILIATE_PROGRAM_TITLE', 'Le Programme de partenariat de ' . STORE_NAME );
+
+// Delete this line - or place two forward slashes before the word 'define'
+define('TEXT_INFORMATION', 'Vos infos de partenariat se trouvent dans /catalog/includes/languages/YOUR LANGUAGE/affiliate_info.php ');
+
+// define('TEXT_INFORMATION',' Vos infos de partenariat se trouvent ici.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_logout.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_logout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_logout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: affiliate_logout.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Le Programme de Partenariat');
+define('HEADING_TITLE', 'Le Programme de Partenariat');
+
+define('TEXT_INFORMATION', 'Vous avez &eacute;t&eacute; connect&eacute; avec succ&egrave;s.');
+define('TEXT_INFORMATION_ERROR_1', 'Vous ne pouvez &ecirc;tre d&eacute;connecter.');
+define('TEXT_INFORMATION_ERROR_2', 'Vous n\'avez pas &eacute;t&eacute; connect&eacute; et donc vous ne pouvez pas &ecirc;tre d&eacute;connecter.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.10 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate News');
+
+define('TABLE_HEADING_AFFILIATE_NEWS', 'Affiliate News');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Choose the banner or link you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER', 'BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO', 'Enter the product number you wish to link to.');
+
+define('IMAGE_BUTTON_BUILD_A_LINK','Build a Link for a Product Banner.');
+
+//add on \admin\includes\english\affiliate_news.php
+// npe admin begin #add
+define('TEXT_AFFILIATE_NEWS_CONTENT_DELETE', 'Delete displayed news in this language!');
+define('EMPTY_CATEGORY', 'Empty news');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'There are no news which can be displayed to your affiliate partners.');
+// npe admin begin #add
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Affiliate Program');
+define('NAVBAR_TITLE_2', 'Newsletter Subscriptions');
+
+define('HEADING_TITLE', 'Newsletter Subscriptions');
+
+define('MY_NEWSLETTERS_TITLE', 'My Newsletter Subscriptions');
+define('MY_NEWSLETTERS_AFFILIATE_NEWSLETTER', 'Affiliate Newsletter');
+define('MY_NEWSLETTERS_AFFILIATE_NEWSLETTER_DESCRIPTION', 'Including affiliate news, new products, special offers, and other promotional announcements.');
+
+define('SUCCESS_NEWSLETTER_UPDATED', 'Your newsletter subscriptions have been successfully updated.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_password.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Affiliate Program');
+define('NAVBAR_TITLE_2', 'Change Password');
+
+define('HEADING_TITLE', 'My Password');
+
+define('MY_PASSWORD_TITLE', 'My Password');
+
+define('SUCCESS_PASSWORD_UPDATED', 'Your password has been successfully updated.');
+define('ERROR_CURRENT_PASSWORD_NOT_MATCHING', 'Your Current Password did not match the password in our records. Please try again.');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_password_forgotten.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Connexion');
+define('NAVBAR_TITLE_2', 'Mot de passe de partenaire oubli&eacute;');
+define('HEADING_TITLE', 'J\ai oubli&eacute; mon mot de passe de partenaire !');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', '<font color="#ff0000"><b>NOTE:</b></font> Cette adresse E-Mail n\'a pas &eacute;t&eacute; trouv&eacute;e parmi nos inscrits. Essayez de nouveau, merci.');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Nouveau mot de passe de partenaire');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'Un nouveau mot de passe de partenaire a &eacute;t&eacute; demand&eacute; par ' . $REMOTE_ADDR . '.' . "\n\n" . 'Votre nouveau mot de passe de partenaire pour le site \'' . STORE_NAME . '\' est :' . "\n\n" . '   %s' . "\n\n");
+define('TEXT_PASSWORD_SENT', 'Un nouveau mot de passe de partenaire a &eacute;t&eacute; envoy&eacute; &agrave; votre adresse E-mail');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programme de Partenariat');
+define('HEADING_TITLE', 'Programme de Partenariat : Paiement');
+
+define('TEXT_AFFILIATE_HEADER', 'Vos paiements :');
+
+define('TABLE_HEADING_DATE', 'Date de paiement');
+define('TABLE_HEADING_PAYMENT', 'B&eacute;n&eacute;fices du partenariat');
+define('TABLE_HEADING_STATUS', 'Statuts de votre paiement');
+define('TABLE_HEADING_PAYMENT_ID','Num&eacute;ro de paiement');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENTS', 'Affichage <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> paiements)');
+define('TEXT_INFORMATION_PAYMENT_TOTAL', 'Votre b&eacute;n&eacute;fice courant s\'&eacute;l&egrave;ve; :');
+define('TEXT_NO_PAYMENTS', 'Aucun paiement n\' a &eacute;t&eacute; enregistr&eacute;.');
+define('TEXT_PAYMENT_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_PAYMENT', 'Click on [?] to see a description of each category.');
+define('HEADING_PAYMENT_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the payment made to the affiliate.');
+define('TEXT_PAYMENT_ID_HELP', '<i>Payment-ID</i> represents the payment number associated to the payment.');
+define('TEXT_PAYMENT_HELP', '<i>Affiliate Earnings</i> represents the value of payment made to the affiliate.');
+define('TEXT_STATUS_HELP', '<i>Payment Status</i> represents the status of the payment made to the affiliate');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_reports.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_reports.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_reports.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program: Affiliate Reports');
+
+define('TEXT_INFORMATION', 'Obtain affiliate links that you can display on your website.');
+
+define('TEXT_AFFILIATE_CLICKS', 'Clickthrough Report');
+define('TEXT_AFFILIATE_SALES', 'Sales Report');
+define('TEXT_AFFILIATE_PAYMENT', 'Payment Report');
+
+
+define('TEXT_INFORMATION_CLICKS', 'View Clickthrough information from your website');
+define('TEXT_INFORMATION_SALES', 'View your current and previous Affiliate Sales');
+define('TEXT_INFORMATION_PAYMENT', 'View all affiliate payments made to you');
+
+define('IMAGE_CLICKS','Clickthrough Report');
+define('IMAGE_SALES','Sales Report');
+define('IMAGE_PAYMENT','Payment Report');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: affiliate_sales.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programme de Partenariat');
+define('HEADING_TITLE', 'Programme de Partenariat : Ventes');
+
+define('TABLE_HEADING_DATE', 'Date');
+define('TABLE_HEADING_SALES', 'B&eacute;n&eacute;fice de partenaire (HT)');
+define('TABLE_HEADING_VALUE', 'Prix de vente (HT)');
+define('TABLE_HEADING_PERCENTAGE','Taux de commission');
+define('TABLE_HEADING_STATUS', 'Statut de la vente');
+
+define('TEXT_DELETED_ORDER_BY_ADMIN', 'Effacer (Admin)');
+define('TEXT_INFORMATION_SALES_TOTAL', 'Votre b&eacute;n&eacute;fice courant s\'&eacute;l&egrave;ve &agrave; (HT) :');
+define('TEXT_INFORMATION_SALES_TOTAL2', '<br>Seules les ventes livr&eacute;es sont comptabilis&eacute;es!');
+define('TEXT_NO_SALES', 'Aucune vente n\'a &eacute;t&eacute; enregistr&eacute;e pour le moment.');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'Afficher <b>%d</b> &agrave; <b>%d</b> (des <b>%d</b> ventes)');
+
+define('TEXT_AFFILIATE_HEADER', 'Ventes provenant de votre site :');
+define('TEXT_SALES_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_SALES', 'Click on [?] to see a description of each category.');
+define('HEADING_SALES_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the sale.');
+define('TEXT_TIME_HELP', '<i>Time</i> represents the time of the sale.');
+define('TEXT_SALE_VALUE_HELP', '<i>Sale Value</i> represents the value of the sale.');
+define('TEXT_COMMISSION_RATE_HELP', '<i>Commission Rate</i> represents the commission rate paid on the sale.');
+define('TEXT_COMMISSION_VALUE_HELP', '<i>Affiliate Earnings</i> represents the commission due on the sale.');
+define('TEXT_STATUS_HELP', '<i>Sale Status</i> represents the status the sale.');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_signup.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_signup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_signup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: affiliate_signup.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programme de Partenariat');
+define('HEADING_TITLE', 'Programme de Partenariat - Enregistrement');
+
+define('MAIL_AFFILIATE_SUBJECT', 'Bienvenue au Programme de Partenariat');
+define('MAIL_GREET_NONE', 'Dear %s' . "\n\n");//em001
+define('MAIL_AFFILIATE_HEADER', 'Cher Partenaire,
+
+F&eacute;licitation pour votre inscription au Programme de Partenariat.
+
+Les informations de votre compte :
+***********************
+
+');
+define('MAIL_AFFILIATE_ID', 'Votre num&eacute;ro de partenaire est : ');
+define('MAIL_AFFILIATE_USERNAME', 'Votre nom d\'utilisateur: ');
+define('MAIL_AFFILIATE_PASSWORD', 'Votre mot de passe est : ');
+define('MAIL_AFFILIATE_LINK', 'Allez sur votre compte :');
+define('MAIL_AFFILIATE_FOOTER', 'Prenez du plaisir gr&acirc;ce &agrave; vos liens! L\'&eacute;quipe du Programme de Partenariat');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_signup_ok.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_signup_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_signup_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: affiliate_signup_ok.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Enregistrement Partenariat');
+define('HEADING_TITLE', 'F&eacute;licitations!');
+define('TEXT_INFORMATION', 'F&eacute;licitations! Nous avons bien reçu votre demande de compte! Vous allez recevoir rapidement un email contenant des informations importantes au sujet de votre compte mais aussi vos param&egrave;tres de connexion. Si vous ne recevez pas vos param&egrave;tres de connexion, veuillez <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">nous contacter</a>.<br><br>Pour <small><b>DES</b></small> questions au sujet du programme de partenariat, veuillez <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">nous contacter</a>.');
+define('TEXT_ACCOUNT_CREATED', 'Congratulations! Your new Affiliate account application has been submitted! You will shortly receive an email containing important information regarding your Affiliate Account, including you affiliate login details. If you have not received it within the hour, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.<br><br>If you have <small><b>ANY</b></small> questions about the affiliate program, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Votre r&eacute;capitulatif');
+define('HEADING_TITLE', 'Le Programme de Partenariat');
+
+define('TEXT_AFFILIATE_CENTRE', 'Affiliate Center');
+define('TEXT_AFFILIATE_BANNER_CENTRE', 'Affiliate Banners');
+define('TEXT_AFFILIATE_REPORT_CENTRE', 'Affiliate Reports');
+define('TEXT_AFFILIATE_INFO', 'Affiliate Information');
+define('TEXT_AFFILIATE_SUMMARY', 'Affiliate Summary');
+define('TEXT_AFFILIATE_PASSWORD', 'Change Password');
+define('TEXT_AFFILIATE_NEWS', 'Affiliate News');
+define('TEXT_AFFILIATE_NEWSLETTER', 'Newsletter');
+define('TEXT_AFFILIATE_ACCOUNT', 'Edit Affiliate Account');
+define('TEXT_AFFILIATE_REPORTS', 'Affiliate Reports');
+define('TEXT_AFFILIATE_CLICKRATE', 'Clickthrough Report');
+define('TEXT_AFFILIATE_PAYMENT', 'Payment Report');
+define('TEXT_AFFILIATE_SALES', 'Sales Report');
+define('TEXT_AFFILIATE_BANNERS', 'Affiliate Banners');
+define('TEXT_AFFILIATE_BANNERS_BANNERS', 'Banner Links');
+define('TEXT_AFFILIATE_BANNERS_BUILD', 'Build a Link');
+define('TEXT_AFFILIATE_BANNERS_PRODUCT', 'Product Links');
+define('TEXT_AFFILIATE_BANNERS_TEXT', 'Text Links');
+define('TEXT_INFORMATION', 'Vos informations de partenaire se trouvent ici.');
+define('TEXT_SUMMARY_TITLE', 'Partenariat - R&eacute;capitulatif');
+define('TEXT_IMPRESSIONS', 'Impressions : ');
+define('TEXT_VISITS', 'Visites : ');
+define('TEXT_TRANSACTIONS', 'Transactions : ');
+define('TEXT_CONVERSION', 'Conversion : ');
+define('TEXT_AMOUNT', 'Total : ');
+define('TEXT_AVERAGE', 'Moyenne : ');
+define('TEXT_COMMISSION_RATE', 'Taux de commission : ');
+define('TEXT_PAYPERSALE_RATE', 'Taux de r&eacute;mun&eacute;ration par vente : ');
+define('TEXT_CLICKTHROUGH_RATE', 'Taux par connexion : ');
+define('TEXT_COMMISSION', 'Commission : ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Cliquez ici [?] pour voir une description de chaque cat&eacute;gorie.');
+define('HEADING_SUMMARY_HELP', 'Aide Partenaire');
+define('TEXT_IMPRESSIONS_HELP', '<b>Impressions :</b> Affichez le nombre total de fois une banni&egrave;re ou un lien a &eacute;t&eacute; affich&eacute; pendant la p&eacute;riode attribu&eacute;e.');
+define('TEXT_VISITS_HELP', '<b>Visites :</b> repr&eacute;sente le total de connexions des visiteurs par votre site.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Transactions :</b> repr&eacute;sente le total des transactions abouties et cr&eacute;dit&eacute;es &agrave; votre compte.');
+define('TEXT_CONVERSION_HELP', '<b>Conversions:</b> repr&eacute;sente le pourcentage de connexion visiteurs conclue par une transaction.');
+define('TEXT_AMOUNT_HELP', '<b>Total :</b> repr&eacute;sente le total du chiffre d\'affaires des commandes pass&eacute;es et cr&eacute;dit&eacute;es sur votre compte.');
+define('TEXT_AVERAGE_HELP', '<b>Moyenne :</b> repr&eacute;sente la moyenne du prix des ventes cr&eacute;dit&eacute;es à votre compte.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Taux Commissionnement:</b> repr&eacute;sente le taux de votre r&eacute;mun&eacute;ration par vente en pourcentage.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<b>Taux par connexions :</b> repr&eacute;sente le taux de votre r&eacute;mun&eacute;ration compar&eacute; &agrave; un taux par connexion basique.');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<b>Taux de r&eacute;mun&eacute;ration par vente :</b> repr&eacute;sente le taux de votre r&eacute;mun&eacute;ration compar&eacute; &agrave; un taux par vente basique.');
+define('TEXT_COMMISSION_HELP', '<b>Commission :</b> rep&eacute;sente le total des commissions qui vous sont dues.');
+define('TEXT_CLOSE_WINDOW', 'Fermer la fen&ecirc;tre [x]');
+
+define('TEXT_GREETING','Bienvenue');
+define('TEXT_AFFILIATE_ID', 'Votre num&eacute;ro de partenaire : ');
+
+define('IMAGE_BANNERS','Banni&egrave;res');
+define('IMAGE_CLICKTHROUGHS','Rapport des connexions');
+define('IMAGE_SALES','Rapport des ventes');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/affiliate_terms.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/affiliate_terms.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/affiliate_terms.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: affiliate_terms.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Programme de Partenariat');
+define('HEADING_TITLE', 'Programme de Partenariat');
+
+define('HEADING_AFFILIATE_PROGRAM_TITLE', 'Les conditions de Partenariat du site ' . STORE_NAME );
+define('TEXT_INFORMATION', 'Vos conditions de partenariats sont disponibles ici.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/all_prodcats.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/all_prodcats.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/all_prodcats.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: all_products.php, v 3.00 2004/02/21 by Ingo info at gamephisto.de
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Toutes les cat&eacute;gories et tous les produits');
+define('HEADING_TITLE', 'Toutes les cat&eacute;gories et tous les produits');
+
+define('HEADING_ALL_CATSUB', 'Cat&eacute;gories et Sous-cat&eacute;gories secondaires');
+define('HEADING_ALL_PRODUCTS', 'Produits');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/all_prodmanf.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/all_prodmanf.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/all_prodmanf.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: all_prodmanf.php, v 1.00 2004/09/04
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Tous les constructeurs et tous les produits');
+define('HEADING_TITLE', 'Tous les constructeurs et tous les produits');
+
+define('HEADING_ALL_CATSUB', 'Constructeurs');
+define('HEADING_ALL_PRODUCTS', 'Produits');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/allprods.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/allprods.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/allprods.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: allprods.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Tous les produits');
+define('HEADING_TITLE', 'Tous les produits');
+
+define('BOX_INFORMATION_ALLPRODS', 'Voir tous les produits');
+define('HEADING_TEXT_PRODUCT', 'Nom Produit');
+define('HEADING_TEXT_MODEL', 'Mod&egrave;le');
+define('HEADING_TEXT_PRICE', 'Prix');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/article_header_tags.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/article_header_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/article_header_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: article_header_tags.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// Mofification of Header Tags Contribution
+// WebMakers.com Added: Header Tags Generator v2.0
+
+/* If you have the Header Tags Controller already installed, replicate the
+   global details from header_tags.php into the indented section below  */
+
+   // Define your email address to appear on all pages
+   define('HEAD_REPLY_TAG_ALL','admin at sitename.com');
+
+   // For all pages not defined or left blank, and for articles not defined
+   // These are included unless you set the toggle switch in each section below to OFF ( '0' )
+   // The HEAD_TITLE_TAG_ALL is included BEFORE the specific one for the page
+   // The HEAD_DESC_TAG_ALL is included AFTER the specific one for the page
+   // The HEAD_KEY_TAG_ALL is included AFTER the specific one for the page
+   define('HEAD_TITLE_TAG_ALL','Site Name');
+   define('HEAD_DESC_TAG_ALL','This is a description for the entire site.');
+   define('HEAD_KEY_TAG_ALL','keyword1, keyword2, keyword3');
+
+/* End of Indented Section */
+
+// DEFINE TAGS FOR INDIVIDUAL PAGES
+
+// articles.php
+define('HTTA_ARTICLES_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title
+define('HTKA_ARTICLES_ON','1'); // Include HEAD_KEY_TAG_ALL in Keywords
+define('HTDA_ARTICLES_ON','1'); // Include HEAD_DESC_TAG_ALL in Description
+define('HEAD_TITLE_TAG_ARTICLES','Articles');
+define('HEAD_DESC_TAG_ARTICLES','Articles');
+define('HEAD_KEY_TAG_ARTICLES','articles');
+
+// article_info.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_INFO_ON','1');
+define('HTKA_ARTICLE_INFO_ON','1');
+define('HTDA_ARTICLE_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_INFO','Articles');
+define('HEAD_DESC_TAG_ARTICLE_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_INFO','');
+
+// articles_new.php - new articles
+// If HEAD_KEY_TAG_ARTICLES_NEW is left blank, it will build the keywords from the articles_names of all new articles
+define('HTTA_ARTICLES_NEW_ON','1');
+define('HTKA_ARTICLES_NEW_ON','1');
+define('HTDA_ARTICLES_NEW_ON','1');
+define('HEAD_TITLE_TAG_ARTICLES_NEW','');
+define('HEAD_DESC_TAG_ARTICLES_NEW','');
+define('HEAD_KEY_TAG_ARTICLES_NEW','');
+
+// article_reviews_info.php and article_reviews.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTKA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTDA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_DESC_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_REVIEWS_INFO','');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/article_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/article_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/article_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: article_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_ARTICLE_NOT_FOUND', 'Article Not Found');
+define('TEXT_ARTICLE_NOT_FOUND', 'Sorry, but the article you requested is not available in this site.');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this articles <a href="%s" target="_blank"><u>web page</u></a>.');
+define('TEXT_DATE_ADDED', 'This article was published on %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#FF0000">This article will be published on %s.</font>');
+define('TEXT_BY', 'by ');
+define('TEXT_CURRENT_REVIEWS', 'Current Reviews:');
+define('BOX_TEXT_TELL_A_FRIEND', 'Tell a friend'); 
+define('TEXT_TELL_A_FRIEND', 'Tell a friend about this article:');
+define('TEXT_XSELL_ARTICLES', 'Products related to this article:');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/article_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/article_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/article_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+define('TEXT_MAIN', '');
+define('TABLE_HEADING_NEW_ARTICLES', 'New Articles');
+  define('HEADING_TITLE', $topics['topics_name']);
+  define('TABLE_HEADING_ARTICLES', 'Articles');
+  define('TABLE_HEADING_AUTHOR', 'Author');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles in this topic.');
+  define('TEXT_NO_ARTICLES2', 'There are currently no articles available from this author.');
+  define('TEXT_NUMBER_OF_ARTICLES', 'Number of Articles: ');
+  define('TEXT_SHOW', 'Display:');
+  define('TEXT_NOW', '\' now');
+  define('TEXT_ALL_TOPICS', 'All Topics');
+  define('TEXT_ALL_AUTHORS', 'All Authors');
+  define('TEXT_ARTICLES_BY', 'Articles by ');
+  define('TEXT_ARTICLES', 'Below is a list of articles with the most recent ones listed first.');  
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+  define('TEXT_MORE_INFORMATION', 'For more information, please visit this authors <a href="http://%s" target="_blank">web page</a>.');
+?>  
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Reviews of ');
+define('NAVBAR_TITLE', 'Reviews');
+
+define('TEXT_NO_ARTICLE_REVIEWS', 'There are currently no aproved reviews for this article.');
+define('TEXT_OF_5_STARS', '%s out of 5 Stars');
+define('TEXT_REVIEW_VIEWS', 'Number of times read: ');
+define('TEXT_READ_REVIEW', 'Read Review...');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/article_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/article_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/article_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: article_reviews_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Review');
+define('HEADING_TITLE', 'Review of ');
+define('SUB_TITLE_ARTICLE', 'Article:');
+define('SUB_TITLE_FROM', 'From:');
+define('SUB_TITLE_DATE', 'Date:');
+define('SUB_TITLE_REVIEW', 'Review:');
+define('SUB_TITLE_RATING', 'Rating:');
+define('TEXT_OF_5_STARS', '%s of 5 Stars');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/article_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/article_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/article_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: article_reviews_write.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Reviews');
+define('HEADING_TITLE', 'Write Review of \'');
+
+define('SUB_TITLE_FROM', 'From:');
+define('SUB_TITLE_REVIEW', 'Your Review:');
+define('SUB_TITLE_RATING', 'Rating:');
+
+define('TEXT_APPROVAL_WARNING', 'Note: Your review will not appear until it has been approved.');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>Poor</b></font></small>');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>Excellent</b></font></small>');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/article_search.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/article_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/article_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: article_search.php
+  By AlDaffodil:  aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_1', 'Article Search');
+define('HEADING_TITLE_2', 'Articles meeting the search criteria');
+
+define('NAVBAR_TITLE_1', 'Article Search');
+define('NAVBAR_TITLE_2', 'Articles meeting the search criteria');
+define('TABLE_HEADING_ARTICLES', 'Article');
+
+define('TEXT_ARTICLE_NAME' , 'Article Title & Link');
+define('TEXT_ARTICLE_EXCERPT' , 'Article Excerpt');
+
+define('TEXT_NO_ARTICLES', 'There are no articles matching the search criteria.');
+
+define('ERROR_INPUT', 'Please enter a search term.');
+define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/articles.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_MAIN', '');
+define('TABLE_HEADING_NEW_ARTICLES', 'New Articles in %s');
+
+if ( ($topic_depth == 'articles') || (isset($HTTP_GET_VARS['authors_id'])) ) {
+  define('HEADING_TITLE', $topics['topics_name']);
+  define('TABLE_HEADING_ARTICLES', 'Articles');
+  define('TABLE_HEADING_AUTHOR', 'Author');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles in this topic.');
+  define('TEXT_NO_ARTICLES2', 'There are currently no articles available from this author.');
+  define('TEXT_NUMBER_OF_ARTICLES', 'Number of Articles: ');
+  define('TEXT_SHOW', 'Display:');
+  define('TEXT_NOW', '\' now');
+  define('TEXT_ALL_TOPICS', 'All Topics');
+  define('TEXT_ALL_AUTHORS', 'All Authors');
+  define('TEXT_ARTICLES_BY', 'Articles by ');
+  define('TEXT_ARTICLES', 'Below is a list of articles with the most recent ones listed first.');  
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+  define('TEXT_MORE_INFORMATION', 'For more information, please visit this authors <a href="http://%s" target="_blank">web page</a>.');
+} elseif ($topic_depth == 'top') {
+  define('HEADING_TITLE', 'All Articles');
+  define('TEXT_ALL_ARTICLES', 'Below is a list of all articles with the most recent ones listed first.');
+  define('TEXT_CURRENT_ARTICLES', 'Current Articles');
+  define('TEXT_UPCOMING_ARTICLES', 'Upcoming Articles');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles listed.');
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_DATE_EXPECTED', 'Expected:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+} elseif ($topic_depth == 'nested') {
+  define('HEADING_TITLE', 'Articles');
+}
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/articles_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/articles_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/articles_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: articles_new.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'New Articles');
+define('HEADING_TITLE', 'New Articles');
+
+define('TEXT_NEW_ARTICLES', 'The following articles were added in the last %s days.');
+define('TEXT_NO_NEW_ARTICLES', 'No new articles have been added in the last %s days.');
+define('TEXT_DATE_ADDED', 'Published:');
+define('TEXT_AUTHOR', 'Author:');
+define('TEXT_TOPIC', 'Topic:');
+define('TEXT_BY', 'by');
+define('TEXT_READ_MORE', 'Read More');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/attributes_sorter.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/attributes_sorter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/attributes_sorter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,11 @@
+<?php
+/*
+  WebMakers.com Added: Attributes Sorter
+*/
+
+// Sorter for product_info.php
+define('PRODUCTS_OPTIONS_SORT_BY_PRICE','1'); // 1= sort by products_options_sort_order + name; 0= sort by products_options_sort_order + price
+
+// Categories Image and Name on product_info.php
+define('SHOW_CATEGORIES','0'); // 0= off  1=on
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/cards1_box.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/cards1_box.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/cards1_box.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: card.php,v 1.1 2004/06/24 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ // information box text in templates/(mytemplate)/boxes/cards.php
+
+define('BOX_INFORMATION_CARD', 'Information');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/checkout_confirmation.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/checkout_confirmation.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/checkout_confirmation.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: checkout_confirmation.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Commander');
+define('NAVBAR_TITLE_2', 'Validation');
+
+define('HEADING_TITLE', 'Validation de commande');
+
+define('HEADING_DELIVERY_ADDRESS', 'Adresse de livraison');
+define('HEADING_SHIPPING_METHOD', 'Mode de livraison');
+define('HEADING_PRODUCTS', 'Produits');
+define('HEADING_TAX', 'Taxe');
+define('HEADING_TOTAL', 'Total');
+define('HEADING_BILLING_INFORMATION', 'Information de facturation');
+define('HEADING_BILLING_ADDRESS', 'Adresse de facturation');
+define('HEADING_PAYMENT_METHOD', 'Moyen de paiement');
+define('HEADING_PAYMENT_INFORMATION', 'Information sur le paiement');
+define('HEADING_ORDER_COMMENTS', 'Commentaire sur votre commande');
+define('HEADING_IPRECORDED_1','NOTE! The below IP and ISP has been recorded for security purposes.');
+define('YOUR_IP_IPRECORDED', 'IP Address');
+define('YOUR_ISP_IPRECORDED', 'ISP');
+
+define('TEXT_EDIT', 'Modifier');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuez la validation');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'pour confirmer la commande.');
+//please change the info_id=1 to the ID number for your condition in the information system
+define('CONDITION_AGREEMENT', 'j\'ai lu <a href="conditions.php" target="_blank">les conditions g&eacute;n&eacute;rales de vente</a> et je les accepte');
+define('CONDITION_AGREEMENT_WARNING', 'Veuillez lire nos conditions g&eacute;n&eacute;rales de vente et les accepter sinon nous ne pourrons vous livrer.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/checkout_payment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/checkout_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/checkout_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_payment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Commander');
+define('NAVBAR_TITLE_2', 'Moyen de paiement');
+
+define('HEADING_TITLE', 'Information sur le paiement');
+
+define('TABLE_HEADING_BILLING_ADDRESS', 'Adresse de facturation');
+define('TEXT_SELECTED_BILLING_DESTINATION', 'Veuillez choisir dans votre carnet d\'adresses celle où vous d&eacute;sirez que la facture vous soit envoy&eacute;e.');
+define('TITLE_BILLING_ADDRESS', 'Adresse de facturation&nbsp;:');
+
+define('TABLE_HEADING_PAYMENT_METHOD', 'Moyen de paiement');
+define('TEXT_SELECT_PAYMENT_METHOD', 'Veuillez choisir le moyen de paiement à utiliser pour cette commande.');
+define('TITLE_PLEASE_SELECT', 'Veuillez s&eacute;lectionner');
+define('TEXT_ENTER_PAYMENT_INFORMATION', 'C\'est actuellement le seul moyen de paiement disponible pour cette commande.');
+
+define('TABLE_HEADING_COMMENTS', 'Ajouter un commentaire à propos de votre commande');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuer l\'enregistrement de la commande');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'pour valider cette commande.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/checkout_payment_address.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/checkout_payment_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/checkout_payment_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_payment_address.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Commande');
+define('NAVBAR_TITLE_2', 'Changer l\'adresse de facturation');
+
+define('HEADING_TITLE', 'Informations sur le paiement');
+
+define('TABLE_HEADING_PAYMENT_ADDRESS', 'Adresse de facturation');
+define('TEXT_SELECTED_PAYMENT_DESTINATION', 'C\'est actuellement l\'adresse de facturation o&ugrave; sera envoy&eacute;e la facture relative &agrave; cette commande.');
+define('TITLE_PAYMENT_ADDRESS', 'Adresse de facturation :');
+
+define('TABLE_HEADING_ADDRESS_BOOK_ENTRIES', 'Entr&eacute;es du carnet d\'adresses');
+define('TEXT_SELECT_OTHER_PAYMENT_DESTINATION', 'Veuillez s&eacute;lectionner l\'adresse de facturation d&eacute;sir&eacute;e au cas o&ugrave; la facture relative &agrave; cette commande doit &ecirc;tre envoy&eacute;e ailleurs.');
+define('TITLE_PLEASE_SELECT', 'Veuillez s&eacute;lectionner');
+
+define('TABLE_HEADING_NEW_PAYMENT_ADDRESS', 'Nouvelle adresse de facturation');
+define('TEXT_CREATE_NEW_PAYMENT_ADDRESS', 'Veuillez utiliser le formulaire suivant pour cr&eacute;er une nouvelle adresse de facturation &agrave; utiliser pour cette commande.');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuer l\'enregistrement de la commande');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'pour s&eacute;lectionner le moyen de paiement d&eacute;sir&eacute;.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/checkout_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/checkout_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/checkout_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: checkout_process.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('EMAIL_TEXT_SUBJECT', 'Traitement de la commande');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Num&eacute;ro de la commande :');
+define('EMAIL_TEXT_INVOICE_URL', 'D&eacute;tail de la commande :');
+define('EMAIL_TEXT_DATE_ORDERED', 'Date de la commande :');
+define('EMAIL_TEXT_PRODUCTS', 'Articles');
+define('EMAIL_TEXT_SUBTOTAL', 'Sous-Total :');
+define('EMAIL_TEXT_TAX', 'dont TVA :        ');
+define('EMAIL_TEXT_SHIPPING', 'Exp&eacute;dition : ');
+define('EMAIL_TEXT_TOTAL', 'Total :    ');
+define('EMAIL_TEXT_DELIVERY_ADDRESS', 'Adresse de livraison');
+define('EMAIL_TEXT_BILLING_ADDRESS', 'Adresse de facturation');
+define('EMAIL_TEXT_PAYMENT_METHOD', 'M&eacute;thode de paiement');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('TEXT_EMAIL_VIA', 'via');
+define('TEXT_SHIPWIRE_TRANSACTION_ID', 'Shipwire Fullfillment Transaction Successful. Transaction ID: ');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/checkout_shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/checkout_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/checkout_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: checkout_shipping.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Commande');
+define('NAVBAR_TITLE_2', 'Mode de livraison');
+
+define('HEADING_TITLE', 'Information de livraison');
+
+define('TABLE_HEADING_SHIPPING_ADDRESS', 'Adresse de livraison');
+define('TEXT_CHOOSE_SHIPPING_DESTINATION', 'Veuillez s&eacute;lectionner dans votre carnet d\'adresses celle o&ugrave; vous d&eacute;sirez que soient livr&eacute;s les produits.');
+define('TITLE_SHIPPING_ADDRESS', 'Adresse de livraison :');
+
+define('TABLE_HEADING_SHIPPING_METHOD', 'Mode de livraison');
+define('TEXT_CHOOSE_SHIPPING_METHOD', 'Veuillez s&eacute;lectionner le mode de livraison d&eacute;sir&eacute; pour l\'envoi de cette commande.');
+define('TITLE_PLEASE_SELECT', 'Veuillez s&eacute;lectionner');
+define('TEXT_ENTER_SHIPPING_INFORMATION', 'C\'est actuellement le seul mode de livraison disponible pour l\'envoi de cette commande.');
+
+define('TABLE_HEADING_COMMENTS', 'Ajouter un commentaire &agrave; propos de votre commande');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuer l\'enregistrement de la commande');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'pour s&eacute;lectionner le moyen de paiement d&eacute;sir&eacute;.');
+define('ERROR_VALID_TO_CHECKOUT', 'Please update your order ...');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/checkout_shipping_address.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/checkout_shipping_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/checkout_shipping_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_shipping_address.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Commande');
+define('NAVBAR_TITLE_2', 'Modifier l\'adresse de livraison');
+
+define('HEADING_TITLE', 'Information sur la livraison');
+
+define('TABLE_HEADING_SHIPPING_ADDRESS', 'Adresse de livraison');
+define('TEXT_SELECTED_SHIPPING_DESTINATION', 'C\'est actuellement l\'adresse de livraison s&eacute;lectionn&eacute;e pour l\'envoi des produits de cette commande.');
+define('TITLE_SHIPPING_ADDRESS', 'Adresse de livraison :');
+
+define('TABLE_HEADING_ADDRESS_BOOK_ENTRIES', 'Entr&eacute;es du carnet d\'adresses');
+define('TEXT_SELECT_OTHER_SHIPPING_DESTINATION', 'Veuillez s&eacute;lectionner l\'adresse de livraison d&eacute;sir&eacute;e si les produits de cette commande doivent &ecirc;tre envoy&eacute;s ailleurs.');
+define('TITLE_PLEASE_SELECT', 'Veuillez s&eacute;lectionner');
+
+define('TABLE_HEADING_NEW_SHIPPING_ADDRESS', 'Nouvelle adresse de livraison');
+define('TEXT_CREATE_NEW_SHIPPING_ADDRESS', 'Veuillez utiliser le formulaire suivant pour cr&eacute;er une nouvelle adresse de livraison &agrave; utiliser pour cette commande.');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continuer l\'enregistrement de la commande');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'pour s&eacute;lectionner le mode de livraison d&eacute;sir&eacute;.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/checkout_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/checkout_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/checkout_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: checkout_success.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Commande');
+define('NAVBAR_TITLE_2', 'Succ&egrave;s');
+
+define('HEADING_TITLE', 'Votre commande a &eacute;t&eacute; valid&eacute;e !');
+
+define('TEXT_SUCCESS', 'Votre commande a &eacute;t&eacute; enregistr&eacute;e avec succ&egrave;s ! Vos produits arriveront &agrave; destination d\'ici 2 à 5 jours ouvrables.');
+define('TEXT_NOTIFY_PRODUCTS', 'Veuillez m\'avertir des mises &agrave; jour des produits que j\'ai s&eacute;lectionn&eacute;s ci-dessous :');
+define('TEXT_SEE_ORDERS', 'Vous pouvez consulter l\'historique de vos commandes en allant à la page <a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">\'Mon compte\'</a> et en cliquant sur <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">\'Historique\'</a>.');
+define('TEXT_CONTACT_STORE_OWNER', 'Pour toutes questions, veuillez vous adresser au <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">responsable de la boutique en ligne</a>.');
+define('TEXT_THANKS_FOR_SHOPPING', 'Merci d\'avoir effectu&eacute; vos achats en ligne chez nous !');
+
+define('TABLE_HEADING_COMMENTS', 'Ajouter un commentaire à propos de la commande trait&eacute;e');
+
+define('TABLE_HEADING_DOWNLOAD_DATE', 'Date d\'expiration : ');
+define('TABLE_HEADING_DOWNLOAD_COUNT', ' t&eacute;l&eacute;chargements restant.');
+define('HEADING_DOWNLOAD', 'T&eacute;l&eacute;charger vos produits ici :');
+define('FOOTER_DOWNLOAD', 'Vous pouvez aussi t&eacute;l&eacute;charger vos produits ult&eacute;rieurement à \'%s\'');
+
+define('PAYPAL_NAVBAR_TITLE_2_OK', 'Succ&egrave;s'); // PAYPALIPN
+define('PAYPAL_NAVBAR_TITLE_2_PENDING', 'Vote commande est en cours de traitement.'); // PAYPALIPN
+define('PAYPAL_NAVBAR_TITLE_2_FAILED', 'Echec du paiement!'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_OK', 'Votre commande a &eacute;t&eacute; trait&eacute;e avec succ&egrave;s !'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_PENDING', 'Vote commande est en cours de traitement'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_FAILED', 'Echec du paiement!'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_OK', 'Votre commande a &eacute;t&eacute; trait&eacute;e avec succ&egrave;s ! Vos produits arriveront &agrave; destination d\'ici 2 à 5 jours ouvr&eacute;s.'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_PENDING', 'Vote commande est en cours de traitement.'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_FAILED', 'Echec du paiement! V&eacute;rifiez que les informations Paypal sont correctes.'); // PAYPALIPN
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/contact_us.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/contact_us.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/contact_us.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/*
+  $Id: contact_us.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Contacts');
+define('NAVBAR_TITLE', 'Contacts');
+define('TEXT_SUCCESS', 'Votre message a &eacute;t&eacute; bien envoy&eacute;.');
+define('EMAIL_SUBJECT', 'Mail pour ' . STORE_NAME);
+
+define('ENTRY_NAME', 'Votre nom :');
+define('ENTRY_EMAIL', 'Votre adresse E-Mail :');
+define('ENTRY_ENQUIRY', 'Enquiry:');
+
+// Contact US Email Subject : DMG
+define('TEXT_EMAIL_SUBJECTS', '* select a subject *');
+define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME. ': ');
+define('ENTRY_SUBJECT','Subject:');
+
+// CRE Contact Us Enhancements 
+// VJ
+define('ENTRY_URGENT', 'Urgent:');
+define('ENTRY_SELF', 'Send myself a copy:');
+define('TEXT_SUBJECT_URGENT', 'Urgent');
+define('ENTRY_TOPIC','Email Topic:');
+define('ENTRY_TOPIC_1', 'Sales');
+define('ENTRY_TOPIC_2', 'Tracking');
+define('ENTRY_TOPIC_3', 'Technical');
+define('ENTRY_TOPIC_4', 'Sponsorship');
+define('ENTRY_TOPIC_5', 'Wholesale');
+
+define('TEXT_SUBJECT_PREFIX', 'Contact from ' . STORE_NAME . ': ');
+define('TEXT_BODY', '<DIV ><font class="text_14n">Corporate Headquarters:</font></A>
+
+
+
+<DIV ><font class="text_12wn"><b>Your Business Name <br>
+
+                              
+
+                                     Your Business Streed Address<br>
+
+
+
+                                     Your business City and postal code.<br>
+
+
+
+                                     business country</b></DIV><br>
+
+
+
+                                     Tel:  Telephone Number<br>
+
+
+
+                                     Fax:  Fax Number<br>
+
+
+
+                                     
+
+
+
+  <DIV ><br><font class="text_14n"><b>Email Contacts:</b></font></A>
+
+
+
+<DIV ><font class="text_12wn">Business Relations - <a href="mailto:info at yourstore.com" target="blank">info at yourstore.com</a><br>
+
+
+
+                                       Wholesale Inquiries - <a href="mailto:wholesale at yourstore.com" target="blank">wholesale at yourstore.com</a><br>
+
+
+
+                                       Technical Assistance - <a href="mailto:tech at yourstore.com" target="blank">tech at yourstore.com</a><br>
+
+
+
+                                     Product Inquiries - <a href="mailto:sales at yourstore.com" target="blank">sales at yourstore.com</a><br>
+
+
+
+                                     Order Status - <a href="mailto:tracking at yourstore.com" target="blank">tracking at yourstore.com</a><br>
+
+
+
+                                     <br>
+
+
+
+                                   
+
+
+
+<DIV ><font class="text_14n"><b>AOL IM Help:</b></font></A>
+
+
+
+<DIV ><font class="text_12wn">YourBusinessName -   <A href="aim:goim?screenname=YourAIM_ScreenName&message=Hi.+Are+you+there?">Click Here</a><br>
+
+: Edit this information in includes/languages/contact_us.php<br>
+
+
+
+');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/cookie_usage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/cookie_usage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/cookie_usage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: cookie_usage.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Utilisation des cookies');
+define('HEADING_TITLE', 'Utilisation des cookies');
+
+define('TEXT_INFORMATION', 'Votre navigateur ne supporte pas les cookies ou ceux-ci ont &eacute;t&eacute; d&eacute;sactiv&eacute;s.<br><br>Pour continuer les achats nous vous enjoignons d\'activer les cookies dans votre navigateur.<br><br>Pour <b>Internet Explorer</b> veuillez suivre les instructions suivantes&nbsp;:<br><ol><li>Cliquez sur le menu Outils et s&eacute;lectionnez Options Internet</li><li>Selectionnez l\'onglet S&eacute;curit&eacute; et restaurez le niveau de s&eacute;curit&eacute; &agrave; Moyen (Niveau par d&eacute;faut)</li></ol>Nous avons pris ces mesures de s&eacute;curit&eacute; pour votre b&eacute;n&eacute;fice et vous prions de nous excuser si cela vous cause quelque inconv&eacute;nient.<br><br>Veuillez contacter le responsable de la boutique pour toutes questions relatives &agrave; cet imp&eacute;ratif ou pour continuer &agrave; faire des achats hors internet.');
+
+define('BOX_INFORMATION_HEADING', 'S&eacute;curit&eacute; et confidentialit&eacute; des cookies');
+define('BOX_INFORMATION', 'Les cookies doivent &ecirc;tre activ&eacute;s pour acheter en ligne afin de respecter les mesures de confidentialit&eacute; et de s&eacute;curit&eacute; concernant votre visite sur ce site.<br><br>En activant les cookies dans votre navigateur, la communication entre vous et ce site est renforc&eacute; par le fait d\'&ecirc;tre certain que ce soit bien vous qui effectuez une transaction et en emp&ecirc;chant tout d&eacute;tournement de vos informations priv&eacute;es.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/create_account.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: create_account.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+// MAIL VALIDATION START //
+define('VALIDATE_YOUR_MAILADRESS', 'Click here to Validate/Activate Your account');
+define('SECOND_LINK', '<B>Or you can manually copy and paste in the following link into your browsers window:</B><BR> ');
+define('OR_VALIDATION_CODE', '<B>Your Validation Code is:</B> ');
+define('MAIL_VALIDATION', '<FONT COLOR="#FF0000"><B>You have to validate/activate your account before you can login.</B></FONT><P><B>Please click on the link below to finish the account creation process:</B> ');
+// MAIL VALIDATION END //
+
+define('NAVBAR_TITLE', 'Cr&eacute;er un compte');
+
+define('HEADING_TITLE', 'Mon compte :');
+
+define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><b>NOTE :</b></font></small> Si vous poss&eacute;dez d&eacute;j&agrave; un compte, merci de vous identifier &agrave; la <a href="%s"><u>page de connexion</u></a>.');
+
+define('EMAIL_SUBJECT', 'Bienvenue chez' . STORE_NAME);
+define('EMAIL_GREET_MR', 'Cher Mr. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_MS', 'Ch&egrave;re Ms. ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_NONE', 'Cher ' . stripslashes($HTTP_POST_VARS['firstname']) . ',' . "\n\n");
+define('EMAIL_WELCOME', 'Nous vous souhaitons la bienvenue chez <b>' . STORE_NAME . '</b>.' . "\n\n");
+
+define('EMAIL_TEXT', 'Vous avez acc&egrave;s maintenant à de  <b>nombreux services</b> qui vous sont offerts. Ceci Inclu :' . "\n\n" . '<li><b>Caddie Permanent</b> - Tous les produits ajout&eacute;s sur le site sont stock&eacute;s jusqu\'à ce que vous les supprimiez ou vous passiez une s&eacute;lection.' . "\n" . '<li><b>Carnet d\'adresse</b> - Vous pouvez utilisez une autre adresse pour envoyer votre s&eacute;lection.' . "\n" . '<li><b>Historique des s&eacute;lections</b> - Vosu avez acc&egrave;s à l\'historique de vos s&eacute;lections.' . "\n" . '<li><b>Commentaires</b> - Vous pouvez &eacute;mettre une ou des opinions sur nos produits.' . "\n\n");
+define('ADMIN_EMAIL_WELCOME', 'Application to become a wholesale customer of <b>' . STORE_NAME . '</b>.' . "\n\n");
+define('ADMIN_EMAIL_TEXT', 'You have received an application to become a wholesale customer from your website.  Information regarding this application can be found at your online administration panel.' . "\n\n");
+
+define('EMAIL_CONFIRMATION', 'Thank you for submitting your account information to our ' . STORE_NAME . "\n\n" . 'To finish your account setup please verify your e-mail address by clicking the link below: ' . "\n\n");
+define('EMAIL_CONTACT', 'For help with any of our online services, please email the store-owner: ');
+define('EMAIL_CONTACT_TEXT', '<a href=\"mailto:' . STORE_OWNER_EMAIL_ADDRESSS . '\">' . STORE_OWNER_EMAIL_ADDRESS . '</a>' . "\n\n");
+define('EMAIL_WARNING', '<b>Note:</b> This Email address was given to us by one of our customers. If you did not signup to be a member, please send an email to ');
+define('EMAIL_WARNING_TEXT', '<a href=\"mailto:' . STORE_OWNER_EMAIL_ADDRESS . '\">' . STORE_OWNER_EMAIL_ADDRESS . '</a>' . "\n");
+
+/* ICW Credit class gift voucher begin */
+define('EMAIL_GV_INCENTIVE_HEADER', "\n\n" .'As part of our welcome to new customers, we have sent you a Gift Voucher worth %s');
+define('EMAIL_GV_REDEEM', 'The redeem code for your Gift Voucher is %s. You can enter the redeem code when checking out while making a purchase');
+define('EMAIL_GV_LINK', 'or by following this link ');
+define('EMAIL_COUPON_INCENTIVE_HEADER', 'Congratulations! to make your first visit to our online shop a more rewarding experience, we are sending you an e-Discount Coupon.' . "\n" .
+                                        ' Below are details of the Discount Coupon created just for you' . "\n");
+define('EMAIL_COUPON_REDEEM', 'To use the coupon enter the redeem code which is %s during checkout while making a purchase');
+/* ICW Credit class gift voucher end */
+define('HEADING_TITLE_CHECKOUT','Checkout Personal Info');// Added by sheetal for PWA form Title
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'cr&eacute;er un compte');
+define('NAVBAR_TITLE_2', 'compte cr&eacute;&eacute;');
+define('HEADING_TITLE', 'f&eacute;licitations !');
+
+define('TEXT_ACCOUNT_CREATED', 'Congratulations, Your new account has been successfully created, You can now take advantage of member privileges to enhance your online shopping experience with us. If you have <small><b>ANY</b></small> questions about the operation of this online shop, please email the <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">store owner</a>.<P>
+A confirmation email with a validation/activation code has been sent to the email address that you provided us with.<P>
+You Must <b>Validate/Activate</b> Your Account Before You Can Login, Please Follow The Instructions In The Email That We Have Sent You.<P>
+If you have not received this email within five minutes, one of two things has happened:<P>
+1. Your Confirmation email was mistakenly sent to your "BULK MAIL" or "SPAM MAIL" folder by your Internet Service Provider, please check for it there.
+<P> OR <P>2. You entered your email address in wrong, please double check it or re-sign up again for an account.
+<P> If after you have checked those things, you still have not received a confirmation email please <U><a href="' . tep_href_link(FILENAME_CONTACT_US) . '">contact us</a></U> for assistence.');
+
+define('TEXT_ACCOUNT_CREATED1', 'Congratulations, Your new account has been successfully created, You can now take advantage of member privileges to enhance your online shopping experience with us. If you have <small><b>ANY</b></small> questions about the operation of this online shop, please email the <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">store owner</a> ' );
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/cvs_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/cvs_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/cvs_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+// this file was created by Clifton Murphy <blue_glowstick at yahoo.com>
+// using code supplied in a previous release by Thomas Nordstrom <t_nordstrom at yahoo.com>
+// I take no credit for any of this work. I simply created this file and
+// recompiled the distribution zip file with the fixes to prevent parse errors.
+/*
+  $Id: cvs_help.php,v 1.3 2004/02/4 07:28:00 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title>Card Verification Value (ccv/cvc/ccv2/cid) Help</title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 5px; margin-left: 5px; margin-right: 5px; margin-top: 5px; }
+table.ccv/cvc/ccv2/cidhelp { background: #ffffff; border: 1px solid red;}
+//--></style>
+<body marginwidth="5" marginheight="5" topmargin="5" bottommargin="5" leftmargin="5" rightmargin="5">
+<table class="ccv/cvc/ccv2/cidhelp" width="100%" border="0" cellspacing="5" cellpadding="0">
+  <tr>
+    <td colspan="2"><p><strong>What is a Card Verification Value (ccv/cvc/ccv2/cid)?</strong>
+      </p>
+      <p>The Card Verification Value (ccv/cvc/ccv2/cid) is a 3-digit number found on the signature
+        panel on the back of your credit card. It is an additional safeguard that
+        helps us validate your purchase and protect against fraud. It is not contained
+        in the magnetic stripe information and is therefore not printed on sales
+        receipts.</p>
+      <p><strong>Where is the ccv/cvc/ccv2/cid located?</strong></p>
+      </td>
+  </tr>
+  <tr>
+    <td><p><strong>VISA, MASTERCARD,  DISCOVERY &amp; most other cards</strong><br>
+        You can find your card verification code on the reverse side of your credit
+        card, printed into the signature field. It is a 3-digit group for MasterCard,
+        Visa, Discovery, and most other cards.<br>
+      </p></td>
+    <td><img src="images/cvm_help1.jpg" width="200" height="139"></td>
+  </tr>
+  <tr>
+    <td>&nbsp;</td>
+    <td>&nbsp;</td>
+  </tr>
+  <tr>
+    <td><p><strong>AMERICAN EXPRESS</strong><br>
+        The American Express Card verification code is a 4-digit number printed
+        on the front of your card. It appears after and to the right (above) of
+        your card number.<br>
+      </p></td>
+    <td><img src="images/cvm_help2.jpg" width="200" height="139"></td>
+  </tr>
+</table>
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/includes/languages/french/down_for_maintenance.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/down_for_maintenance.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/down_for_maintenance.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  Created by: Linda McGrath osCOMMERCE at WebMakers.com
+  
+  Update by: fram 05-05-2003
+  Updated by: Donald Harriman - 08-08-2003 - MS2
+
+  down_for_maintenance.php v1.1
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Ferm&eacute; pour Maintenance');
+define('HEADING_TITLE', 'Ferm&eacute; pour Maintenance ...');
+define('DOWN_FOR_MAINTENANCE_TEXT_INFORMATION', 'Le site est ferm&eacute; pour cause de maintenance, veuillez nous en excuser, &agrave; tr&egrave;s bientot.');
+define('TEXT_MAINTENANCE_ON_AT_TIME', 'Le Webmaster a commenc&eacute; la maintenance &agrave; : ');
+define('TEXT_MAINTENANCE_PERIOD', 'Dur&eacute;e de la Maintenance : ');
+define('DOWN_FOR_MAINTENANCE_STATUS_TEXT', 'Pour v&eacute;rifier le statut du site ... Cliquez ici :');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/download.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/download.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/download.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,12 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/downloadbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/downloadbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/downloadbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ define('TEXT_HEADING_DOWNLOAD_DATE', 'Date de T&eacute;l&eacute;chargement');
+ define('TEXT_HEADING_DOWNLOAD_COUNT', 'Nombre de t&eacute;l&eacute;chargements');
+ define('TEXT_DOWNLOAD_MY_ACCOUNT', 'Votre compte');
+ define('TEXT_HEADING_DOWNLOAD_FILE', 'Votre t&eacute;l&eacute;chargement est pret. Veuillez cliquer sur le titre ci-dessous');
+ define('TEXT_FOOTER_DOWNLOAD', 'Si votre t&eacute;l&eacute;chargement n\'apparaît pas, vous pouvez vous v&eacute;rifier votre commande en cliquant sur ce lien:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/events_calendar.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/events_calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/events_calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: events_calendar v1.00 2003/03/08 18:09:16 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+
+  define('NAVBAR_TITLE', 'Events Calendar');
+  define('HEADING_TITLE', 'Events Calendar');
+  define('TEXT_SELECT_EVENT', 'Select event');
+  
+  define('TEXT_EVENTS_FOR', 'Events for ');
+  define('TEXT_EVENT_DATE', 'Date :');
+  define('TEXT_EVENTS_START', 'Events starting on ');
+  define('TEXT_EVENT_START_DATE', 'From :');
+  define('TEXT_EVENT_END_DATE', 'Through :');
+  define('TEXT_EVENT_LINK', 'Link :');
+  define('TEXT_EVENT_OSC_LINK', 'Event link :');
+  define('TEXT_EVENT_TITLE', 'Title :');
+  define('TEXT_EVENT_DESCRIPTION', 'Event :');
+  define('TEXT_EVENT_MORE', '... More >>');
+  define('TEXT_NO_EVENTS', 'No Events found.');
+  define('TEXT_OTHER_EVENTS', 'Other events for today :');
+
+  define('TEXT_DISPLAY_NUMBER_OF_EVENTS', 'Displaying event n° <b>%d</b><b>%_</b> of <b>%d</b> for ');
+  define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> events) ');
+  define('MAX_DISPLAY_PAGE_LINKS', 5);
+  define('MAX_DISPLAY_NUMBER_EVENTS', 5);
+  
+  define('BOX_CALENDAR_TITLE', ' View all events');
+  define('BOX_GO_BUTTON', 'go');
+  define('BOX_GO_BUTTON_TITLE', ' submit - month view ');
+  define('BOX_TODAY_BUTTON', ' T ');
+  define('BOX_TODAY_BUTTON_TITLE', ' view this month ');
+  define('BOX_YEAR_VIEW_BUTTON', ' Y ');
+  define('BOX_YEAR_VIEW_BUTTON_TITLE', ' year view ');
+  define('BOX_NEXT_LINK', 'next_month');
+  define('BOX_PREV_LINK', 'previous_month');
+  define('BOX_CLICK_LINK', 'Click for events');
+  
+  define('FIRST_DAY_OF_WEEK', 0);// First day of the week  1=Monday 0=Sunday;
+
+  define('NUMBER_OF_YEARS', 5);  //n° of years to be shown in drop-down
+  
+  define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
+  
+
+  
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+define('NAVBAR_TITLE', 'FAQ');
+
+define('HEADING_TITLE', 'Frequently Asked Questions');
+define('FAQ_BACK_TO_TOP', '[Back To Top]');
+
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/faq_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/faq_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/faq_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+define('NAVBAR_TITLE', 'FAQ');
+
+define('TABLE_HEADING_NEW_FAQ', 'Frequently Asked Questions');
+define('FAQ_BACK_TO_TOP', '[Back To Top]');
+
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/featured_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/featured_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/featured_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Featured Products Listing Language File
+*/
+
+define('NAVBAR_TITLE', 'Description produits');
+define('HEADING_TITLE', 'Description produits');
+
+define('TEXT_NO_FEATURED_PRODUCTS', 'Aucune description produits.');
+define('TEXT_DATE_ADDED', 'Date d\'ajout:');
+define('TEXT_MANUFACTURER', 'Constructeur:');
+define('TEXT_PRICE', 'Prix:');
+
+  define('TABLE_HEADING_IMAGE', 'Product Image');
+  define('TABLE_HEADING_MODEL', 'Model');
+  define('TABLE_HEADING_PRODUCTS', 'Product Name');
+  define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+  define('TABLE_HEADING_QUANTITY', 'Quantity');
+  define('TABLE_HEADING_PRICE', 'Price');
+  define('TABLE_HEADING_WEIGHT', 'Weight');
+  define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+  define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+  define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+  define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+  define('TEXT_SHOW', '<b>Show:</b>');
+  define('TEXT_BUY', 'Buy 1 \'');
+  define('TEXT_NOW', '\' now');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/gv_faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/gv_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/gv_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: gv_faq.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'FAQ - Ch&egrave;ques cadeaux'); 
+define('HEADING_TITLE', 'FAQ - Ch&egrave;ques cadeaux'); 
+
+define('TEXT_INFORMATION', '<a name="Top"></a> 
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=1','NONSSL').'">1 - Pourquoi acheter des ch&egrave;ques cadeaux ?</a><br> 
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=2','NONSSL').'">2 - Comment envoyer des ch&egrave;ques cadeaux &agrave; vos proches ?</a><br> 
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=3','NONSSL').'">3 - Comment effectuer des achats &agrave; l\'aide de ch&egrave;que cadeau ?</a><br> 
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=4','NONSSL').'">4 - Comment valider un ch&egrave;que cadeau ?</a><br> 
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=5','NONSSL').'">5 - En cas de probl&egrave;mes !</a><br> 
+'); 
+switch ($HTTP_GET_VARS['faq_item']) { 
+  case '1': 
+define('SUB_HEADING_TITLE','<br>' . 'Pourquoi acheter des ch&egrave;ques cadeaux ?'); 
+define('SUB_HEADING_TEXT','<br>' . 'Tr&egrave;s utile, les ch&egrave;ques cadeaux peuvent servir pour faire plaisir &agrave; l\'un de vos proches, pour qui vous ne savez pas 
+quoi lui offrir. Ils s\'ach&egrave;tent sur le site comme un article.<br><br>Si vous avez actuellement des ch&egrave;ques cadeaux sur votre compte, une bo&icirc;te 
+appara&icirc;tra dans la colonne de droite.<br><br>Cette bo&icirc;te indique le montant disponible en ch&egrave;que cadeau sur votre compte et elle vous permet d\'en 
+faire b&eacute;nificier vos proches par simple email.'); 
+  break; 
+  case '2': 
+define('SUB_HEADING_TITLE','<br>' . 'Pour envoyer un ch&egrave;que cadeau &agrave vos proches ?'); 
+define('SUB_HEADING_TEXT','<br>' . 'Vous pouvez y acc&eacute;der par la bo&icirc;te correspondant au ch&egrave;que cadeau qui se trouve dans la colonne de  droite 
+(Cette boite s\'affiche seulement si vous poss&eacute;dez des ch&egrave;ques cadeaux sur votre compte).<br><br>Pour faire beneficier un ch&egrave;que cadeau 
+&agrave; un proche veuillez sp&eacute;cifier :<br>&nbsp;&nbsp;&nbsp;&nbsp;- Le nom de la personne.<br>&nbsp;&nbsp;&nbsp;&nbsp;- Son adresse e-mail. 
+<br>&nbsp;&nbsp;&nbsp;&nbsp;- Le montant que vous desirez lui faire parvenir (Vous n\'&ecirc;tes pas obliger de mettre la totalit&eacute; du montant qui est 
+dans votre compte.).<br>&nbsp;&nbsp;&nbsp;&nbsp;- Et si vous le d&eacute;sirez laisser lui un message qui appara&icirc;tra dans l\'email.<br><br>Veuillez-vous 
+assurer que toutes les informations inscrites sont correctes, elles sont changeables autant que vous le d&eacute;sirez avant l\'envoie d&eacute;finitif des emails.'); 
+  break; 
+  case '3': 
+  define('SUB_HEADING_TITLE','<br>' . 'Comment effectuer des achats &agrave; l\'aide de ch&egrave;que cadeau ?'); 
+  define('SUB_HEADING_TEXT','<br>' . 'Librement faite vos achats sur le site et ensuite au moment de la commande utiliser vos ch&egrave;ques cadeaux comme un mode de paiement. 
+  <br><br>Si l\'un  des articles choisi d&eacute;passe le montant du ch&egrave;que cadeau, vous devez choisir une m&eacute;thode de paiement suppl&eacute;mentaire pour 
+  r&eacute;gler la diff&eacute;rence. En outre, si le montant des articles est &eacute;gal ou inf&eacute;rieur &agrave; la somme de vos ch&egrave;ques cadeaux, 
+  le paiement suppl&eacute;mentaire sera ignor&eacute; et/ou le reste de la somme de vos ch&egrave;ques cadeaux sera libre pour effectuer vos futurs achats.'); 
+  break; 
+  case '4': 
+  define('SUB_HEADING_TITLE','<br>' . 'Comment valider un ch&egrave;que cadeau ?'); 
+  define('SUB_HEADING_TEXT','<br>' . 'Si vous recevez un ch&egrave;que cadeau par email, celui-ci contiendra des informations sur la personne qui vous l&agrave; fait parvenir, 
+  ainsi qu\'un court message de sa part. Cet email indiquera aussi le code du ch&egrave;que cadeau, que vous pouvez imprimer.<br><br>Pour utiliser votre ch&egrave;que cadeau, 
+   cliquer sur le lien fourni dans l\'email, cr&eacute;er votre compte qui est obligatoire, si vous n\'&ecirc;tes pas encore client. Apr&egrave;s validation de notre part, 
+   vous pouvez effectuer vos achats sur le site. Un lien est disponible &agrave; tout moments pour valider votre ch&egrave;que cadeau dans la rubrique information se trouvant 
+   dans la colonne de gauche.<br><br>Nous vous rappelons, pour la validation d\'un ch&egrave;que cadeau, vous &ecirc;tes dans l\'obligation d\'ouvrir un compte.'); 
+  break; 
+  case '5': 
+  define('SUB_HEADING_TITLE','<br>' . 'En cas de probl&egrave;mes !'); 
+  define('SUB_HEADING_TEXT','<br>' . 'Pour tous autres renseignements ou en cas de probl&egrave;mes avec les ch&egrave;ques cadeaux, n\'h&eacute;siter pas &agrave; prendre contact 
+  avec nous par email root at localhost et assurez-vous que vous nous avez fournit le maximum d\'informations pour vous r&eacute;pondre et vous satisfaire dans les plus bref 
+  d&eacute;lais.'); 
+  break; 
+  default: 
+  define('SUB_HEADING_TITLE',''); 
+  define('SUB_HEADING_TEXT','<br>' . 'Choisissez une question ci-dessus.'); 
+
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/gv_redeem.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/gv_redeem.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/gv_redeem.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: gv_redeem.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Envoi des Bons Cadeaux');
+define('HEADING_TITLE', 'Envoi des Bons Cadeaux');
+define('TEXT_INFORMATION', 'Pour plus d\'information concernant les bons cadeaux, lisez s\'il vous plait la notice (FAQ) <a href="' . tep_href_link(FILENAME_GV_FAQ,'','NONSSL').'">'.GV_FAQ.'.</a>');
+define('TEXT_INVALID_GV', 'Le nombre de bons cadeaux peut &ecirc;tre incorrect ou a &eacute;t&eacute; d&eacute;j&agrave; envoy&eacute;. Pour contacter le service client du magasin utilisez notre page de contact.');
+define('TEXT_VALID_GV', 'F&eacute;licitations, vous avez envoy&eacute; un bon cadeau d\'une  valeur de %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/gv_send.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/gv_send.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/gv_send.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: gv_send.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Envoi Des Bons Cadeaux');
+define('NAVBAR_TITLE', 'Envoi Des Bons Cadeaux');
+define('EMAIL_SUBJECT', 'Sujet ' . STORE_NAME);
+define('HEADING_TEXT','<br>Entrez SVP ci-dessous les d&eacute;tails du bon cadeau que vous souhaitez envoyer. Pour plus d\'information, voyez SVP la notice <a href="' . tep_href_link(FILENAME_GV_FAQ,'','NONSSL').'">'.GV_FAQ.'.</a><br>');
+define('ENTRY_NAME', 'Nom du Destinataire :');
+define('ENTRY_EMAIL', 'Adresse d\'Email du Destinataire :');
+define('ENTRY_MESSAGE', 'Message au destinataire :');
+define('ENTRY_AMOUNT', 'Valeur du bon cadeau :');
+define('ERROR_ENTRY_AMOUNT_CHECK', '&nbsp;&nbsp;<span class="errorText">Quantit&eacute; Impossible</span>');
+define('ERROR_ENTRY_EMAIL_ADDRESS_CHECK', '&nbsp;&nbsp;<span class="errorText">Adresse Incorrecte d\'E-mail</span>');
+define('MAIN_MESSAGE', 'Vous avez choisi d\'envoyer un bon cadeau d\'une valeur %s  &agrave; %s. Dont l\'adresse email est %s<br><br>Le texte accompagnant l\'email
+sera <br><br>Cher %s<br><br>
+                        Vous avez envoy&eacute; un bon cadeau de la valeur %s par %s');
+
+define('PERSONAL_MESSAGE', '%s dit');
+define('TEXT_SUCCESS', 'F&eacute;licitations, votre bon cadeau &agrave; &eacute;t&eacute; envoy&eacute; avec succ&egrave;s ');
+
+
+define('EMAIL_SEPARATOR', '----------------------------------------------------------------------------------------');
+define('EMAIL_GV_TEXT_HEADER', 'F&eacute;licitations, vous avez reçu un bon cadeau d\'une valeur %s');
+define('EMAIL_GV_TEXT_SUBJECT', 'Un bon cadeau de %s');
+define('EMAIL_GV_FROM', 'Ce bon cadeau vous a &eacute;t&eacute; envoy&eacute; par %s');
+define('EMAIL_GV_MESSAGE', 'Avec le message suivant ');
+define('EMAIL_GV_SEND_TO', 'Bonjour, %s');
+define('EMAIL_GV_REDEEM', 'Pour utiliser ce bon cadeau, cliquez svp sur le lien ci-dessous. Veuillez noter &eacute;galement le code d\'utilisation qui est' . "\n" . ' %s ' . "\n" . 'Au cas où vous auriez des probl&egrave;mes.');
+define('EMAIL_GV_LINK', 'Pour utiliser svp cliquez ');
+define('EMAIL_GV_VISIT', ' ou visitez ');
+define('EMAIL_GV_ENTER', ' et &eacute;crivez le code ');
+define('EMAIL_GV_FIXED_FOOTER', 'Si vous avez des probl&egrave;mes pour envoyer le bon cadeau utilisez le lien automatis&eacute; ci-dessus, ' . "\n" .
+                                'vous pouvez &eacute;galement &eacute;crire le code du bon cadeau pendant le proc&eacute;d&eacute; de contr&ocirc;le de notre magasin.' . "\n\n");
+define('EMAIL_GV_SHOP_FOOTER', '');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/header_tags.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/header_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/header_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+// /catalog/includes/languages/english/header_tags.php
+// WebMakers.com Added: Header Tags Generator v2.5.2
+// Add META TAGS and Modify TITLE
+//
+// DEFINITIONS FOR /includes/languages/english/header_tags.php
+
+// Define your email address to appear on all pages
+define('HEAD_REPLY_TAG_ALL', STORE_OWNER_EMAIL_ADDRESS);
+
+// For all pages not defined or left blank, and for products not defined
+// These are included unless you set the toggle switch in each section below to OFF ( '0' )
+// The HEAD_TITLE_TAG_ALL is included AFTER the specific one for the page
+// The HEAD_DESC_TAG_ALL is included AFTER the specific one for the page
+// The HEAD_KEY_TAG_ALL is included AFTER the specific one for the page
+define('HEAD_TITLE_TAG_ALL', STORE_NAME);
+define('HEAD_DESC_TAG_ALL','What\'s New Here? - Hardware Software DVD Movies');
+define('HEAD_KEY_TAG_ALL','Hardware, Software, DVD Movies, Computer');
+
+// DEFINE TAGS FOR INDIVIDUAL PAGES
+
+// index.php
+define('HTTA_DEFAULT_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title
+define('HTKA_DEFAULT_ON','1'); // Include HEAD_KEY_TAG_ALL in Keywords
+define('HTDA_DEFAULT_ON','1'); // Include HEAD_DESC_TAG_ALL in Description
+define('HTTA_CAT_DEFAULT_ON', '0'); //Include HEADE_TITLE_DEFAULT in CATEGORY DISPLAY
+define('HEAD_TITLE_TAG_DEFAULT', 'CRE Loaded 6');
+define('HEAD_DESC_TAG_DEFAULT','osCommerce : What\'s New Here? - Hardware Software DVD Movies');
+define('HEAD_KEY_TAG_DEFAULT','Hardware, Software, DVD Movies, Computer');
+
+// product_info.php - if left blank in products_description table these values will be used
+define('HTTA_PRODUCT_INFO_ON','1');
+define('HTKA_PRODUCT_INFO_ON','1');
+define('HTDA_PRODUCT_INFO_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_INFO','');
+define('HEAD_DESC_TAG_PRODUCT_INFO','');
+define('HEAD_KEY_TAG_PRODUCT_INFO','');
+
+// products_new.php - whats_new
+define('HTTA_WHATS_NEW_ON','1');
+define('HTKA_WHATS_NEW_ON','1');
+define('HTDA_WHATS_NEW_ON','1');
+define('HEAD_TITLE_TAG_WHATS_NEW', 'New Products');
+define('HEAD_DESC_TAG_WHATS_NEW', '');
+define('HEAD_KEY_TAG_WHATS_NEW', '');
+
+// specials.php
+// If HEAD_KEY_TAG_SPECIALS is left blank, it will build the keywords from the products_names of all products on special
+define('HTTA_SPECIALS_ON','1');
+define('HTKA_SPECIALS_ON','1');
+define('HTDA_SPECIALS_ON','1');
+define('HEAD_TITLE_TAG_SPECIALS','Specials');
+define('HEAD_DESC_TAG_SPECIALS','');
+define('HEAD_KEY_TAG_SPECIALS','');
+
+// product_reviews_info.php and product_reviews.php - if left blank in products_description table these values will be used
+define('HTTA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HTKA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HTDA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_REVIEWS_INFO','');
+define('HEAD_DESC_TAG_PRODUCT_REVIEWS_INFO','');
+define('HEAD_KEY_TAG_PRODUCT_REVIEWS_INFO','');
+
+// PRODUCTS_REVIEWS_WRITE.PHP
+define('HTTA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HTKA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HTDA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_REVIEWS_WRITE','');
+define('HEAD_DESC_TAG_PRODUCT_REVIEWS_WRITE','');
+define('HEAD_KEY_TAG_PRODUCT_REVIEWS_WRITE','');
+
+ // ALLPRODS.PHP
+define('HTTA_ALLPRODS_ON','1');
+define('HTKA_ALLPRODS_ON','1');
+define('HTDA_ALLPRODS_ON','1');
+define('HEAD_TITLE_TAG_ALLPRODS','');
+define('HEAD_DESC_TAG_ALLPRODS','');
+define('HEAD_KEY_TAG_ALLPRODS','');
+
+// articles.php
+define('HTTA_ARTICLES_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title
+define('HTKA_ARTICLES_ON','0'); // Include HEAD_KEY_TAG_ALL in Keywords
+define('HTDA_ARTICLES_ON','0'); // Include HEAD_DESC_TAG_ALL in Description
+define('HEAD_TITLE_TAG_ARTICLES','CRE Loaded Store Articles');
+define('HEAD_DESC_TAG_ARTICLES','Articles');
+define('HEAD_KEY_TAG_ARTICLES','articles');
+
+// article_info.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_INFO_ON','1');
+define('HTKA_ARTICLE_INFO_ON','1');
+define('HTDA_ARTICLE_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_INFO','Articles');
+define('HEAD_DESC_TAG_ARTICLE_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_INFO','');
+
+// articles_new.php - new articles
+// If HEAD_KEY_TAG_ARTICLES_NEW is left blank, it will build the keywords from the articles_names of all new articles
+define('HTTA_ARTICLES_NEW_ON','1');
+define('HTKA_ARTICLES_NEW_ON','1');
+define('HTDA_ARTICLES_NEW_ON','1');
+define('HEAD_TITLE_TAG_ARTICLES_NEW','Lastest Articles');
+define('HEAD_DESC_TAG_ARTICLES_NEW','');
+define('HEAD_KEY_TAG_ARTICLES_NEW','');
+
+// article_reviews_info.php and article_reviews.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTKA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTDA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_DESC_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_REVIEWS_INFO','');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/images/icon.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/languages/french/images/icon.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/languages/french/images/icon.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/languages/french/images/icon.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/languages/french/index.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: index.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_MAIN', 'Ceci est la pr&eacute;sentation par d&eacute;faut du projet osCommerce, les produits propos&eacute;s le sont uniquement pour d&eacute;monstration, <b>aucun produit achet&eacute; ne sera livr&eacute; et le client ne sera pas factur&eacute;</b>. Toutes les informations affich&eacute;es pour ces produits doivent &ecirc;tre consid&eacute;r&eacute;es comme fictives.<br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>Messages d\'erreur</b><br><br>S\'il est affich&eacute; ci-dessus un quelconque message d\'erreur ou d\'avertissement, veullez commencer par le corriger avant de continuer.<br><br>Les messages d\'erreur sont affich&eacute;s au tout d&eacute;but de la page sur un <span class="messageStackError">fond</span> de couleur unie.<br><br>Plusieurs v&eacute;rifications sont faites pour s\'assurer du param&egrave;trage correct de votre boutique en ligne - ces v&eacute;rifications peuvent &ecirc;tre d&eacute;sactiv&eacute;es en modifiant les param&egrave;tres concern&eacute;s au bas du fichier  includes/application_top.php.</td></tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main" valign="top"><b>Modifier les textes des pages</b><br><br>Ce texte peut &ecirc;tre modifi&eacute;, pour chaque langue, dans le fichier suivant&nbsp;:<br><br><nobr class="messageStackSuccess">[chemin vers catalogue]/includes/languages/' . $language . '/' . FILENAME_DEFAULT . '</nobr><br><br>Ce fichier peut &ecirc;tre &eacute;dit&eacute; manuellement ou via le panneau d\'administration dans le menu <nobr class="messageStackSuccess">Langues->' . ucfirst($language) . '->D&eacute;finir</nobr> ou dans le module <nobr class="messageStackSuccess">Outils->Gestion fichiers</nobr>.<br><br>Le texte est d&eacute;fini de la mani&egrave;re suivante&nbsp;:<br><br><nobr>define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">Ceci est la pr&eacute;sentation par d&eacute;faut du projet osCommerce...</span>\');</nobr><br><br>Le text surlign&eacute; en vert peut &ecirc;tre modifi&eacute; - il est important de laisser le define() du mot-clef TEXT_MAIN. Pour supprimer compl&egrave;tement le texte pour TEXT_MAIN, il faut utiliser l\'exemple suivant avec simplement deux guillemets simples&nbsp;:<br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>Plus d\'informations sur l\'utilsation de la fonction PHP define() peuvent &ecirc;tre consult&eacute;es <a href="http://www.php.net/define" target="_blank"><u>ici</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>S&eacute;curiser le panneau d\'administration</b><br><br>Il est important de s&eacute;curiser le panneau d\'administration car il n\'existe actuellement aucune impl&eacute;mentation de s&eacute;curit&eacute;.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/4.gif') . '</td><td class="main" valign="top"><b>Documentation en ligne</b><br><br>Une documention en ligne peut &ecirc;tre consult&eacute;e sur le site <a href="http://wiki.oscommerce.com" target="_blank"><u>osCommerce Wiki Documentation Effort</u></a>.<br><br>Un support communautaire est disponible sur le site <a href="http://forums.oscommerce.com" target="_blank"><u>osCommerce Community Support Forums</u></a>.</td></tr></table><br>Si vous d&eacute;sirez t&eacute;l&eacute;charger le programme de cette boutique en ligne ou si vous voulez contribuer au projet osCommerce, veuillez visitez le site <a href="http://www.oscommerce.com" target="_blank"><u>support d\' osCommerce</u></a>. Cette boutique tourne sous le version <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font> d\'osCommerce.');
+define('TABLE_HEADING_NEW_PRODUCTS', 'Nouveaux produits pour %s');
+define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Produits &agrave; venir');
+define('TABLE_HEADING_DATE_EXPECTED', 'Date pr&eacute;vue');
+define('TABLE_HEADING_DEFAULT_SPECIALS', 'Promotions pour %s');
+
+if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
+  define('HEADING_TITLE', 'Faites votre choix :');
+
+  define('TABLE_HEADING_IMAGE', '');
+  define('TABLE_HEADING_MODEL', 'Mod&egrave;le');
+  define('TABLE_HEADING_PRODUCTS', 'Nom du produit');
+  define('TABLE_HEADING_MANUFACTURER', 'Constructeurs');
+  define('TABLE_HEADING_QUANTITY', 'Qte');
+  define('TABLE_HEADING_PRICE', 'Prix');
+  define('TABLE_HEADING_WEIGHT', 'Poids');
+  define('TABLE_HEADING_BUY_NOW', 'Acheter');
+  define('TEXT_NO_PRODUCTS', 'Il n\'y a aucun produit dans cette cat&eacute;gorie.');
+  define('TEXT_NO_PRODUCTS2', 'Il n\'y a aucun produit de ce fabricant.');
+  define('TEXT_NUMBER_OF_PRODUCTS', 'Nombre de produits : ');
+  define('TEXT_SHOW', '<b>Voir :</b>');
+  define('TEXT_BUY', 'Acheter 1 \'');
+  define('TEXT_NOW', '\' maintenant');
+  define('TEXT_ALL_CATEGORIES', 'Toutes cat&eacute;gories');
+  define('TEXT_ALL_MANUFACTURERS', 'Tous fabricants');
+} elseif ($category_depth == 'top') {
+  define('HEADING_TITLE', 'Quoi de neuf ?');
+} elseif ($category_depth == 'nested') {
+  define('HEADING_TITLE', 'Cat&eacute;gories');
+}
+  define('HEADING_CUSTOMER_GREETING', 'F&eacute;licitation cher client');
+  define('MAINPAGE_HEADING_TITLE', 'Titre principal de la page');
+// BOF: Lango added for Featured Products
+  define('TABLE_HEADING_FEATURED_PRODUCTS', 'Descriptions Produits');
+  define('TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY', 'Descriptions Produits %s'); 
+// EOF: Lango added for Featured Products
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/info_shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/info_shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/info_shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: info_shopping_cart.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Panier visiteur/Panier membre');
+define('SUB_HEADING_TITLE_1', 'Panier visiteur');
+define('SUB_HEADING_TITLE_2', 'Panier membre');
+define('SUB_HEADING_TITLE_3', 'Information');
+define('SUB_HEADING_TEXT_1', 'Chaque visiteur de notre boutique en ligne se voit attribu&eacute; un \'Panier visiteur\'. Cela permet au visiteur de pouvoir conserver ses produits dans un panier d\'achat temporaire. Quand le visiteur quitte le site, le panier et son contenu sont effac&eacute;s.');
+define('SUB_HEADING_TEXT_2', 'Chaque membre de notre boutique en ligne qui s\'identifie se voit attribu&eacute; un \'Panier membre\'. Cela permet au membre de pouvoir ajouter des produits &agrave; son panier et y revenir plus tard voire un autre jour pour finaliser sa commande. Tous les produits restent dans le panier d\'achat jusqu\'&agrave; ce que le membre les aie command&eacute;s ou bien les aie effac&eacute;s lui-m&ecirc;me.');
+define('SUB_HEADING_TEXT_3', 'Si un membre ajoute des produits &agrave; son \'Panier visiteur\' et d&eacute;cide de s\'identifier aupr&egrave;s de la boutique en ligne pour utiliser son \'Panier membre\', le contenu de son \'Panier visiteur\' sera ajout&eacute;  au contenu de son  \'Panier membre\' automatiquement.');
+define('TEXT_CLOSE_WINDOW', '[ Fermer la fen&ecirc;tre ]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/information.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+  define('HEADING_TITLE', 'Information');
+  define('ACTION_INFORMATION', 'Action');
+  define('ACTIVATION_ID_INFORMATION', 'Activation information ID=');
+  define('ADD_INFORMATION', 'Ajouter nouvelle information');
+  define('ADD_QUEUE_INFORMATION', ' Ajouter information dans la file d\'attente');
+  define('ALERT_INFORMATION', 'Syst&egrave;me d\'information vide');
+  define('ANSWER_INFORMATION', 'R&eacute;ponse');
+  define('CONFIRM_INFORMATION', 'Confirmer');
+  define('DEACTIVATION_ID_INFORMATION', 'D&eacute;sactivation information ID=');
+  define('DELETE_CONFITMATION_ID_INFORMATION', 'confirmation d\'effacement de l\'information ID=');
+  define('DELETE_ID_INFORMATION', 'Effacer l\'information ID=');
+  define('DELETED_ID_INFORMATION', 'Suppression r&eacute;ussi de l\'information ID=');
+  define('EDIT_ID_INFORMATION', 'Editer l\'information ID=');
+  define('ERROR_20_INFORMATION', 'Vous n\'avez pas d&eacute;fini une valeur valide pour l\'option <b>File d\'attente</b>. Vous pouvez seulement d&eacute;finir une valeur num&eacute;rique.');
+  define('ERROR_80_INFORMATION', 'Vous n\'avez pas rempli tous <b>les champs n&eacute;cessaires</b>');
+  define('INFORMATION_ID_ACTIVE', 'Cette information est active');
+  define('INFORMATION_ID_DEACTIVE', 'Cette information n\'est pas active');
+  define('ID_INFORMATION', 'ID');
+  define('TITLE_INFORMATION', 'Titre');
+  define('DESCRIPTION_INFORMATION', 'Description');
+  define('QUEUE_INFORMATION', 'File d\'attente');
+  define('QUEUE_INFORMATION_LIST', 'Liste en file d\'attente: ');
+  define('MANAGER_INFORMATION', 'Gestion information');
+  define('NO_INFORMATION', 'Non');
+  define('PUBLIC_INFORMATION', 'Public');
+  define('SORT_BY', 'La page d\'information est tri&eacute;e par');
+  define('SUCCED_INFORMATION', ' Succ&egrave;s');
+  define('TITLE', 'Information syst&egrave;me');
+  define('VIEW_INFORMATION', 'Voir Information');
+  define('VISIBLE_INFORMATION', 'Visible');
+  define('VISIBLE_INFORMATION_DO', '( To Do visible )');
+  define('UPDATE_ID_INFORMATION', 'Mise à jour information ID=');
+  define('WARNING_INFORMATION', 'Attention');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/informationbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/informationbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/informationbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ // information box text in includes/boxes/information.php
+define('BOX_HEADING_INFORMATION', 'Information');
+define('BOX_INFORMATION_PRIVACY', 'Vie Priv&eacute;e');
+define('BOX_INFORMATION_CONDITIONS', 'Conditions g&eacute;n&eacute;rales de vente');
+define('BOX_INFORMATION_SHIPPING', 'Livraisons et Retours');
+define('BOX_INFORMATION_CONTACT', 'Nous contacter');
+define('BOX_INFORMATION_LINKS', 'Liens');
+define('BOX_INFORMATION_TRACKING', 'Information');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/ipn.lng.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/ipn.lng.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/ipn.lng.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: ipn.lng.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('UNKNOWN_TXN_TYPE', 'Type De Transaction Inconnue');
+  define('UNKNOWN_TXN_TYPE_MSG', 'Une transaction inconnue (%s) provenant de ' . $_SERVER['REMOTE_ADDR'] . "\nAvez-vous fait tous les tests?\n\n");
+  define('UNKNOWN_POST', 'Message inconnu');
+  define('UNKNOWN_POST_MSG', "Un MESSAGE inconnu de %s a &eacute;t&eacute; reçu.\nAvez-vous fait tous les tests?\n\n");
+  define('EMAIL_SEPARATOR', "------------------------------------------------------");
+  define('RESPONSE_VERIFIED', 'V&eacute;rifi&eacute;');
+  define('RESPONSE_MSG', "Type de connection\n".EMAIL_SEPARATOR."\ncurl= %s, socket= %s, domain= %s, port= %s \n\nResponse PayPal\n".EMAIL_SEPARATOR."\n%s \n\n");
+  define('RESPONSE_INVALID', 'Response PayPal invalide');
+  define('RESPONSE_UNKNOWN', 'V&eacute;rification inconnue');
+  define('EMAIL_RECEIVER', 'Configuration ID email et boutique');
+  define('EMAIL_RECEIVER_MSG', "Configuration propri&eacute;t&eacute;s boutique\nPremi&egrave;re adresse email PayPal: %s\nBoutique ID: %s\n".EMAIL_SEPARATOR."\nConfiguration propri&eacute;t&eacute;s PayPal\nPremi&egrave;re adresse email PayPal: %s\nBoutique ID: %s\n\n");
+  define('EMAIL_RECEIVER_ERROR_MSG', "Configuration propri&eacute;t&eacute;s boutique\nPremi&egrave;re adresse email PayPal: %s\nBoutique ID: %s\n".EMAIL_SEPARATOR."\nConfiguration propri&eacute;t&eacute;s PayPal\nPremi&egrave;re adresse email PayPal: %s\nBoutique ID: %s\n\nTransaction PayPal ID: %s\n\n");
+  define('TXN_DUPLICATE', 'Dupliquer transaction');
+  define('TXN_DUPLICATE_MSG', "La transaction IPN dupliquer (%s) a &eacute;t&eacute; reçu.\nV&eacute;rifiez votre compte PayPal\n\n");
+  define('IPN_TXN_INSERT', "IPN INSÉRÉ");
+  define('IPN_TXN_INSERT_MSG', "IPN %s a &eacute;t&eacute; ins&eacute;r&eacute;\n\n");
+  define('CHECK_CURRENCY', 'Validez la devise');
+  define('CHECK_CURRENCY_MSG', "Devise incorrecte\nPayPal: %s\nosC: %s\n\n");
+  define('CHECK_TXN_SIGNATURE', 'Validez la signature de transaction de PayPal_Shopping_Cart');
+  define('CHECK_TXN_SIGNATURE_MSG', "Signature incorrecte\nPayPal: %s\nosC: %s\n\n");
+  define('CHECK_TOTAL', 'Valider le montant total de la transaction');
+  define('CHECK_TOTAL_MSG', "Total incorrect\nPayPal: %s\nSession: %s\n\n");
+  define('DEBUG', 'Corriger');
+  define('DEBUG_MSG', "\nMessage original\n".EMAIL_SEPARATOR."\n%s\n\n\nMessage reconstruit\n".EMAIL_SEPARATOR."\n%s\n\n");
+  define('PAYMENT_SEND_MONEY_DESCRIPTION', 'Somme transf&eacute;r&eacute;e');
+  define('PAYMENT_SEND_MONEY_DESCRIPTION_MSG', "Vous avez reçu un paiement de %s %s \n".EMAIL_SEPARATOR."\nCe paiement a &eacute;t&eacute; envoy&eacute; par une personne du site PayPal, en utilisant le lien ENVOYER ARGENT\n\n");
+  define('TEST_INCOMPLETE', 'Test invalide');
+  define('TEST_INCOMPLETE_MSG', "Une erreur s'est produite, la plupart du temps à cause du champ de la commande dans le panneau d\'essai d\'Ipn qui n\'a pas eu une identification valide de transaction.\n\n\n");
+  define('HTTP_ERROR', 'Erreur HTTP');
+  define('HTTP_ERROR_MSG', "Une erreur HTTP s'est produite durant l\'identification\n".EMAIL_SEPARATOR."\ncurl= %s, socket= %s, domain= %s, port= %s\n\n");
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/links.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: links.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Liens');
+
+if ($display_mode == 'links') {
+  define('HEADING_TITLE', 'Liens');
+  define('TABLE_HEADING_LINKS_IMAGE', '');
+  define('TABLE_HEADING_LINKS_TITLE', 'Titre');
+  define('TABLE_HEADING_LINKS_URL', 'URL');
+  define('TABLE_HEADING_LINKS_DESCRIPTION', 'Description');
+  define('TABLE_HEADING_LINKS_COUNT', 'Clics');
+  define('TEXT_NO_LINKS', 'Il n\' y a pas de liens pour cette cat&eacute;gorie.');
+} elseif ($display_mode == 'categories') {
+  define('HEADING_TITLE', 'Liens Cat&eacute;gories');
+  define('TEXT_NO_CATEGORIES', 'Il n\' y a pas de liens pour cette cat&eacute;gorie pour le moment.');
+}
+
+// VJ todo - move to common language file
+define('TEXT_DISPLAY_NUMBER_OF_LINKS', 'Voir de <b>%d</b> à <b>%d</b> (sur <b>%d</b> liens)');
+
+define('IMAGE_BUTTON_SUBMIT_LINK', 'Soumettre un lien');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/links_submit.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/links_submit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/links_submit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: links_submit.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Liens');
+define('NAVBAR_TITLE_2', 'Soumettre un lien');
+
+define('HEADING_TITLE', 'Information sur le lien');
+
+define('TEXT_MAIN', 'Veuillez compl&eacute;ter le formulaire suivant pour soumettre votre site.');
+
+define('EMAIL_SUBJECT', 'Bienvenue dans l\'espace d\'&eacute;change de liens de ' . STORE_NAME);
+define('EMAIL_GREET_NONE', 'Ch&egrave;r(e) %s' . "\n\n");
+define('EMAIL_WELCOME', 'Nous vous accueillons dans le programme d\'&eacute;change de liens de <b>' . STORE_NAME . '</b>'. "\n\n");
+define('EMAIL_TEXT', 'Votre lien a &eacute;t&eacute; soumis avec succ&egrave;s à ' . STORE_NAME . '. Votre lien sera ajout&eacute; à notre liste d&egrave;s que nous l\'approuverons.  Vous recevrez un email au sujet du statut de votre soumission.  Si vous ne l\'avez pas reçu dans les 48 heures suivantes, svp contactez-nous avant de soumettre votre lien une nouvelle fois.' . "\n\n");
+define('EMAIL_CONTACT', 'Pour nous aider avec notre programme d\'&eacute;change de lien, entrez l\'email du propri&eacute;taire du magasin: ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n\n");
+define('EMAIL_WARNING', '<b>Note:</b> Cette adresse email nous a &eacute;t&eacute; donn&eacute;e pendant la soumission d\'un site.  Si vous avez un probl&egrave;me, envoyez svp un email à ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n");
+define('EMAIL_OWNER_SUBJECT', 'Lien soumis ' . STORE_NAME);
+define('EMAIL_OWNER_TEXT', 'Un nouveau lien a &eacute;t&eacute; soumis ' . STORE_NAME . '. Il n\'est pas encore approuv&eacute;.  Veuillez le v&eacute;rifier et l\'activer.' . "\n\n");
+
+define('TEXT_LINKS_HELP_LINK', '&nbsp;Aide&nbsp;[?]');
+
+define('HEADING_LINKS_HELP', 'Aide sur les liens');
+define('TEXT_LINKS_HELP', '<b>Titre du site:</b> Un titre descriptif pour votre site.<br><br><b>URL:</b> L\'adresse absolue de votre site, y compris \'http://\'.<br><br><b>Cat&eacute;gorie:</b> Cat&eacute;gorie la plus appropri&eacute;e pour votre site.<br><br><b>Description:</b> Une courte description de votre site.<br><br><b>Image URL:</b> L\'URL Absolue de l\'image que vous souhaitez soumettre, y compris \'http://\'. Cette image sera montr&eacute;e avec le lien de votre site.<br>Ex : http://your-domain.com/path/to/your/image.gif <br><br><b> Nom Complet:</b> Votre Nom Complet.<br><br><b>Email:</b> Votre adresse Email. Veuillez &eacute;crire un email valide, car on vous contactera par l\'interm&eacute;diaire de cet email.<br><br><b>Votre page de liens:</b> L\'URL Absolue de votre page de liens, o&ugrave; un lien vers votre site sera list&eacute; / visible.<br>Ex : http://votre-domaine.com/path/to/your/links_page.php');
+define('TEXT_CLOSE_WINDOW', '<u>Fermer la fen&ecirc;tre</u> [x]');
+
+// VJ todo - move to common language file
+define('CATEGORY_WEBSITE', 'D&eacute;tails du site');
+define('CATEGORY_RECIPROCAL', 'D&eacute;tails de votre lien');
+
+define('ENTRY_LINKS_TITLE', 'Titre du site:');
+define('ENTRY_LINKS_TITLE_ERROR', 'Le titre du lien doit contenir un minimum de ' . ENTRY_LINKS_TITLE_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_TITLE_TEXT', '*');
+define('ENTRY_LINKS_URL', 'URL:');
+define('ENTRY_LINKS_URL_ERROR', 'L\'URL doit contenir un minimum de ' . ENTRY_LINKS_URL_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_URL_TEXT', '*');
+define('ENTRY_LINKS_CATEGORY', 'Cat&eacute;gorie:');
+define('ENTRY_LINKS_CATEGORY_TEXT', '*');
+define('ENTRY_LINKS_DESCRIPTION', 'Description:');
+define('ENTRY_LINKS_DESCRIPTION_ERROR', 'La description doit contenir un minimum de ' . ENTRY_LINKS_DESCRIPTION_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_DESCRIPTION_TEXT', '*');
+define('ENTRY_LINKS_IMAGE', 'URL de l\'image:');
+define('ENTRY_LINKS_IMAGE_TEXT', '');
+define('ENTRY_LINKS_CONTACT_NAME', 'Nom complet:');
+define('ENTRY_LINKS_CONTACT_NAME_ERROR', 'Votre nom et pr&eacute;nom doit contenir un minimum de ' . ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_CONTACT_NAME_TEXT', '*');
+define('ENTRY_LINKS_RECIPROCAL_URL', 'Votre page de liens:');
+define('ENTRY_LINKS_RECIPROCAL_URL_ERROR', 'Votre page de liens doit contenir un minimum de ' . ENTRY_LINKS_URL_MIN_LENGTH . ' caract&egrave;res.');
+define('ENTRY_LINKS_RECIPROCAL_URL_TEXT', '*');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/links_submit_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/links_submit_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/links_submit_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: links_submit_success.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Liens');
+define('NAVBAR_TITLE_2', 'Succ&egrave;s');
+define('HEADING_TITLE', 'Votre Lien a &eacute;t&eacute; soumis!');
+define('TEXT_LINK_SUBMITTED', 'F&eacute;licitations! Votre lien a &eacute;t&eacute; soumis avec succ&egrave;s! On l\'ajoutera &agrave; notre liste d&egrave;s que nous l\'approuverons.  Si vous avez <small><b>des questions</b></small>, envoyez un email au <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">responsable en ligne</a>.<br><br>Vous recevrez un email confirmant votre soumission.  Si vous ne l\'avez pas reçu dans l\'heure, veuillez <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">nous contacter</a>. En outre, vous recevrez un email d&egrave;s que votre lien sera approuv&eacute;.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/login.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: login.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//Email Validation
+define('TEXT_LOGIN_ERROR_VALIDATION', 'Error: Your account is not validated.');
+define('TEXT_YOU_HAVE_TO_VALIDATE', 'Please insert your Validation-key to confirm your registration');
+define('ENTRY_VALIDATION_CODE', 'Validation-key');
+define('TEXT_NEW_VALIDATION_CODE', '<b>Request a new Validation-key <u>here</u></b>');
+
+define('NAVBAR_TITLE', 'Identification');
+
+define('HEADING_TITLE', 'Ouvrez une session, ouvrez un compte <br> ou faites directement un achat.');
+
+define('HEADING_NEW_CUSTOMER', 'Nouveau client');
+define('TEXT_NEW_CUSTOMER', 'Je suis un nouveau client.');
+define('TEXT_NEW_CUSTOMER_INTRODUCTION', 'En cr&eacute;ant un compte sur ' . STORE_NAME . ' vous pourrez faire vos achats plus rapidement, garder votre panier d\'une visite à l\'autre et suivre vos commandes.');
+define('HEADING_RETURNING_CUSTOMER', 'Client enregistr&eacute;');
+define('TEXT_RETURNING_CUSTOMER', 'J\'ai d&eacute;jà command&eacute;.');
+
+define('TEXT_PASSWORD_FORGOTTEN', 'Mot de passe oubli&eacute;&nbsp;? Cliquez ici.');
+
+define('TEXT_LOGIN_ERROR', 'Erreur&nbsp;: Aucune correspondance pour l\'adresse email et/ou le mot de passe.');
+define('TEXT_VISITORS_CART', '<font color="#ff0000"><b>Note&nbsp;:</b></font> Le contenu de votre &quot;Panier visiteur&quot; sera ajout&eacute; au contenu de votre &quot;Panier membre&quot; une fois que vous vous serez identifi&eacute;. <a href="javascript:session_win();">[Plus d\'information]</a>');
+// Begin Checkout Without Account v0.70 changes
+
+define('PWA_FAIL_ACCOUNT_EXISTS', 'Un compte existe d&eacute;jà avec cette adresse Email {EMAIL_ADDRESS}.  Vous devez vous connecter sur ce compte avec le mot de passe appropri&eacute;.');
+// Begin Checkout Without Account v0.60 changes
+define('HEADING_CHECKOUT', '<font size="2">Faire directement votre achat</font>');
+define('TEXT_CHECKOUT_INTRODUCTION', 'En choisissant cette option, vous ouvrez un compte provisoire qui sera d&eacute;truit de nos serveurs d&egrave;s votre commande pass&eacute;e, vous ne serez pas capable de v&eacute;rifier le statut de votre commande pas plus que vous ne pourrez consulter vos commandes ant&eacute;rieures.');
+define('PROCEED_TO_CHECKOUT', 'Je veux faire un achat sans ouvrir de compte.');
+// End Checkout Without Account changes
+// Eversun mod for sppc and qty price breaks
+// define the email address that can change customer_group_id on login
+define('SPPC_TOGGLE_LOGIN_PASSWORD', 'support at creloaded.com');
+// Eversun mod for sppc and qty price breaks
+
+define('LOGIN_TITLE1', 'Choose a Customer Group');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  WebMakers.com Added: loginbox.php
+  Originally written by: Aubrey Kilian <aubrey at mycon.co.za>
+  Re-written by Linda McGrath osCOMMERCE at WebMakers.com
+  Modified by Justin of World Famous Comics <justin at wfcomics.com>
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('BOX_HEADING_LOGIN_BOX_MY_ACCOUNT','Information sur mon compte');
+
+  define('LOGIN_BOX_MY_ACCOUNT','Apercu de mon compte');
+  define('LOGIN_BOX_ACCOUNT_EDIT','Editer mes informations');
+  define('LOGIN_BOX_ADDRESS_BOOK','Editer mon carnet d\'adresses');
+  define('LOGIN_BOX_ACCOUNT_HISTORY','Historique des commandes');
+  define('LOGIN_BOX_PRODUCT_NOTIFICATIONS','Notifications sur les produits');
+
+  define('LOGIN_BOX_PASSWORD_FORGOTTEN','Mot de passe oubli&eacute;?');
+
+  define('BOX_LOGINBOX_EMAIL','Votre Adresse Email');
+  define('BOX_LOGINBOX_PASSWORD','Votre Mot de Passe');
+  define('LOGIN_BOX_LOGOFF','Se Deconnecter');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/logoff.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'D&eacute;connexion');
+define('NAVBAR_TITLE', 'D&eacute;connexion');
+define('TEXT_MAIN', 'Vous vous &ecirc;tes d&eacute;connect&eacute; de votre compte. Vous pouvez &agrave; pr&eacute;sent laisser votre ordinateur en tout s&eacute;curit&eacute;.<br><br>Votre panier d\'achat a &eacute;t&eacute; sauvegard&eacute;, et vous retrouverez son contenu &agrave; chaque fois que vous vous identifierez &agrave; nouveau sur votre compte.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,272 @@
+<table cellspacing="0" cellpadding="5" width="550" align="center" border="0" class = "infoBoxContents">
+  <tbody><tr><td><p >You have just successfully installed
+          CRE Loaded Oscommerce version 6.2 Standard Edtion!</p>
+        <p >Login to your admin <u><strong><a href="http://creloaded.com/admin/">here</a></strong></u> with
+          the username and password you set up during installation.</p></td></tr><tr>
+    <td><img src="images/loaded_3box_ad.jpg" width="550" height="198" alt="loaded bosex"></td>
+  </tr>
+          <tr>
+            <td><p>CRE Loaded Standard Version is the perfect
+                application to power your e-Commerce websites. However, if you
+                need features that only a Pro-level application can deliver,
+                please take a look at all the powerful options our Pro Version
+                adds. If you are looking to deploy a powerful Business to Business
+                solution, our Pro B2B has added features to enhance sales and
+                productivity.</p>
+              <p >Feel free to contact us for more details or usage
+            guidlines.</p></td>
+          </tr>
+          <tr>
+            <td><table width="550" border="0" cellspacing="1" cellpadding="2">
+              <tr class="infoBox">
+                <td><strong>Features</strong></td>
+                <td width="60" align="center"><strong>Standard </strong></td>
+                <td width="60" align="center"><strong>Pro </strong></td>
+                <td width="60" align="center"><strong>Pro
+                    B2B </strong></td>
+              </tr>
+              <tr>
+                <td > Multple Product Images</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Coupons and Vouchers</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Templating System</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Checkout Success Module System</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Ship Wire Order Fulfillment Integration</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Credit Card Encryption</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Page Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Language File Editor</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Attribute Option Type Features</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Tiny MCE WYSIWYG Editor throughout Admin</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Algozone Fraud Zone</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >FAQ Manager (Replaces FAQDesk)</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Article Manager (Replaces NewsDesk)</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Sales Report 2</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Customer State/Zip Code Mismatch</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Customer Statistics</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Daily Products Report</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Articles Viewed</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Update : Wishlist to 5.15</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Update: Affiliate Program to 2.5a</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Payment Module Updates : UK support</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Shipping Module: AusPOST</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Shipping Module: Canada Post</td>
+                <td align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >                New Shipping Module:
+                Royal Mail</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Sub Product Choices</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Bulk Attribute Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Multiple Products Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Product Extra Fields</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Credit Card Encryption Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Credit Card Blacklist</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Specials by Category</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Generate Order List (Order List
+                  3.1)</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Customer State Mismatch Report</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Google Ads removed</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Separate Price Groups</td>
+                <td align="center" bgcolor="#FBFBFB" >no</td>
+                <td align="center" bgcolor="#DEEFFF" >no</td>
+                <td align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td ><p>Per Product Qty Discount </p></td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" >no</td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Require Login to See Content</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" >no</td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Approve Account</td>
+                <td align="center" bgcolor="#FBFBFB" >no</td>
+                <td align="center" bgcolor="#DEEFFF" >no</td>
+                <td align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Limited 30 Day Support</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" >no</td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Upgrade Now </td>
+                <td width="60" align="center" bgcolor="#FBFBFB">&nbsp;</td>
+                <td width="60" align="center" bgcolor="#DEEFFF"><a href="http://store.creloaded.com/product_info.php?cPath=27&amp;products_id=51" target="_blank"><img src="images/00add_button.gif" alt="add button" width="35" height="24" border="0" /></a></td>
+                <td width="60" align="center" bgcolor="#D1CFD0"><a href="http://store.creloaded.com/product_info.php?cPath=27&amp;products_id=52" target="_blank"><img src="images/00add_button.gif" alt="add button" width="35" height="24" border="0" /></a></td>
+              </tr>
+            </table></td>
+          </tr>
+  </tbody></table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/checkout_success/notifications.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/checkout_success/notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/checkout_success/notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+define('MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_TITLE', 'Avis');
+define('MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_DESCRIPTION', 'Module De Succès De Contrôle D\'Avis De Produit');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/checkout_success/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/checkout_success/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/checkout_success/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+<?php
+define('MODULE_CHECKOUT_SUCCESS_SHIPWIRE_TITLE', 'ShipWire');
+define('MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DESCRIPTION', 'ShipWire Checkout Success Module');
+define('TEXT_SHIPWIRE_TRANSACTION_ID', 'ShipWire Fullfillment ID:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_coupon.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_coupon.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_coupon.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: ot_coupon.php,v 1.3 2004/03/09 18:56:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR', 'Message');
+  define('MODULE_ORDER_TOTAL_COUPON_TITLE', 'Coupon r&eacute;duction'); //apparait dans la validationd ecommande
+  define('MODULE_ORDER_TOTAL_COUPON_HEADER', 'Ch&egrave;ques Cadeaux/Coupons r&egrave;ductions');
+  define('MODULE_ORDER_TOTAL_COUPON_DESCRIPTION', 'Coupon r&eacute;duction2');
+  define('SHIPPING_NOT_INCLUDED', ' [Livraison non incluse]');
+  define('TAX_NOT_INCLUDED', ' [TVA non incluse]');
+  define('MODULE_ORDER_TOTAL_COUPON_USER_PROMPT', '');
+  define('ERROR_NO_INVALID_REDEEM_COUPON', 'Code de coupon non valide');
+  define('ERROR_INVALID_STARTDATE_COUPON', 'Ce coupon n\'est pas encore disponible');
+  define('ERROR_INVALID_FINISDATE_COUPON', 'Ce coupon a expiré');  //doit rester avec les accents
+  define('ERROR_INVALID_USES_COUPON', 'Ce coupon ne peut être utilisé que ');  //doit rester avec les accents  
+  define('TIMES', ' fois.');
+  define('ERROR_INVALID_USES_USER_COUPON', 'L\'utilisation maximale du coupon a été atteinte');  //doit rester avec les accents
+  define('REDEEMED_COUPON', 'Valeur du Ch&egrave;que ');  
+  define('REDEEMED_MIN_ORDER', 'pour une commande supérieure à ');  //doit rester avec les accents
+  define('REDEEMED_RESTRICTIONS', ' [Appliquer les restrictions de Produits/Cat&eacute;gories]');  
+  define('TEXT_ENTER_COUPON_CODE', 'Entrer votre Code&nbsp;&nbsp;');
+  define('IMAGE_REDEEM_VOUCHER', 'Redeem Code Voucher');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_gv.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ot_gv.php,v 1.3 2004/03/09 18:56:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_GV_TITLE', 'Ch&egrave;que Cadeau');
+  define('MODULE_ORDER_TOTAL_GV_HEADER', 'Ch&egrave;que Cadeau/Coupon R&eacute;duction');
+  define('MODULE_ORDER_TOTAL_GV_DESCRIPTION', 'Ch&egrave;ques Cadeaux');
+  define('SHIPPING_NOT_INCLUDED', ' [Livraison non incluse]');
+  define('TAX_NOT_INCLUDED', ' [Taxe non incluse]');
+  define('MODULE_ORDER_TOTAL_GV_USER_PROMPT', 'Cochez cette case pour utiliser la balance du compte Ch&egrave;que Cadeau en d&eacute;duction du montant de cette commande -> &nbsp;');
+  define('TEXT_ENTER_GV_CODE', 'Entrer un Code&nbsp;&nbsp;');
+  define('IMAGE_REDEEM_VOUCHER', 'Redeem Code Voucher');
+  define('MODULE_ORDER_TOTAL_GV_TEXT_ERROR', 'Gift Voucher/Discount coupon');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_lev_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_lev_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_lev_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: ot_lev_discount.php,v 1.1 2002/08/30 21:05:04 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_LEV_DISCOUNT_TITLE', 'Price Break Discount');
+  define('MODULE_LEV_DISCOUNT_DESCRIPTION', 'Price Break Discount');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_loworderfee.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_loworderfee.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_loworderfee.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_loworderfee.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE', 'Commission sur petite commande');
+  define('MODULE_ORDER_TOTAL_LOWORDERFEE_DESCRIPTION', 'Commission sur petite commande');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_qty_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_qty_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_qty_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ot_qty_discount.php,v 1.4 2004-08-22 dreamscape Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 Josh Dechant
+  Protions Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_QTY_DISCOUNT_TITLE', 'Global Quantity Discount');
+  define('MODULE_QTY_DISCOUNT_DESCRIPTION', 'Quantity specific discount percentage or flat rate - Specify discount rate based on the number of items in the cart (global across all products).');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+
+  define('MODULE_QTY_DISCOUNT_PERCENTAGE_TEXT_EXTENSION', ' (%s%%)'); // %s is the percent discount as a number; %% displays a % sign
+  define('MODULE_QTY_DISCOUNT_FORMATED_TITLE', '<strong>Quantity Discount%s:</strong>'); // %s is the placement of the MODULE_QTY_DISCOUNT_PERCENTAGE_TEXT_EXTENSION
+  define('MODULE_QTY_DISCOUNT_FORMATED_TEXT', '<strong>-%s</strong>'); // %s is the discount amount formated for the currency
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: ot_shipping.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_SHIPPING_TITLE', 'Exp&eacute;dition');
+  define('MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION', 'Frais d\'exp&eacute;dition de la commande');
+
+  define('FREE_SHIPPING_TITLE', 'Livraison gratuite');
+  define('FREE_SHIPPING_DESCRIPTION', 'Livraison gratuite pour commande d\'un montant sup&eacute;rieure à %s');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_subtotal.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_subtotal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_subtotal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_subtotal.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_SUBTOTAL_TITLE', 'Sous Total');
+  define('MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION', 'Sous-Total commande');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_tax.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_tax.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_tax.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_tax.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_TAX_TITLE', 'Taxe');
+  define('MODULE_ORDER_TOTAL_TAX_DESCRIPTION', 'Taxe commande');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_total.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_total.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/order_total/ot_total.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_total.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_TOTAL_TITLE', 'Total');
+  define('MODULE_ORDER_TOTAL_TOTAL_DESCRIPTION', 'Total Commande');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/SecurePay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/SecurePay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/SecurePay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+
+ Based on payment Module of iongate.php (06/11/2003) Modified for Securepay.com by:
+
+Tony Reynolds  <tonyr at securepay.com>
+
+SecurePay.php version 1.2 06/11/2003
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_TITLE', 'Credit Card : SecurePay');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_DESCRIPTION', 'SecurePay payment module. <BR>Credit Card Test Info:<br>Aprovals<br>CC#: 4111111111111111<br>Expiry: Any <BR> Declines <BR>CC#: 5105105105105100<br>Expiry: Any ');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_GATEWAY_TIMEOUT', 'There was an error contacting the credit card processor. Please try again.');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_ERROR', 'There was a problem processing your Credit Card! Not-Approved');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_WRONG_TYPE', 'The Credit Card Number does not match the Credit Card Type.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/authorizenet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/authorizenet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/authorizenet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: authorizenet.php,v 1.3 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_TITLE', 'Carte de crédit Via Authorize.net 1.7');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DESCRIPTION', 'No de carte de cr&eacute;dit test<br><br>CC# : 4111111111111111<br>Date d\'exiration : n\'importe');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER', 'Propri&eacute;taire de la carte de cr&eacute;dit :');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER', 'Num&eacute;ro de carte :');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES', 'Date d\'expiration carte :');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_TYPE', 'Type de carte:');
+   define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_OWNER', '* Le nom du propriétaire de la carte de crédit doit avoir au moins  ' . CC_OWNER_MIN_LENGTH . ' caractères.\n');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_NUMBER', '* Le numéro de carte doit avoir au moins ' . CC_NUMBER_MIN_LENGTH . ' caractères.\n');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE', 'Il y a eu une erreur lors du traitement de votre carte. Merci de r&eacute;essayer.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DECLINED_MESSAGE', 'Votre carte de cr&eacute;dit a &eacute;t&eacute; refus&eacute;e. Veuillez essayer une autre carte ou contactez votre banque pour plus d\'information.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR', 'Erreur carte de crédit !');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_CVV', '* Vous devez saisir un numéro CVV pour continuer.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'La carte de crédit choisi ne correspond pas au numéro saisie. Veuillez vérifier le numéro et le type de carte de crédit et recommencer.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'Le numéro CVV saisie est incorrect. Recommencer.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_AUTHORIZENET_CVV_NUMBER', 'CVV number');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_cvc.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_cvc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_cvc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_CVC_TEXT_TITLE', 'Carte de cr&eacute;dit');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DESCRIPTION', 'No de carte de cr&eacute;dit test<br><br>CC# : 4111111111111111<br>Date d\'expiration : n\'importe');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_TYPE', 'Type de la carte :');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_OWNER', 'Propri&eacute;taire de la carte :');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_NUMBER', 'Num&eacute;ro de la carte :');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_EXPIRES', 'Date d\'expiration de la carte :');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_OWNER', '* Le nom du propriétaire de la carte doit avoir au moins ' . CC_OWNER_MIN_LENGTH . ' caractères.\n');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CCV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_CCV', 'ccv/cvc/ccv2/cid code 3 or 4 digits');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_ERROR', 'Erreur carte de cr&eacute;dit !');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_VISA', 'Visa');
+    
+    define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+    define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Master Card');
+    define('MODULE_PAYMENT_CC_TEXT_DISCOVERY', 'Discover');
+    define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+    define('MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS', 'American Express');
+    define('MODULE_PAYMENT_CC_TEXT_DELTA', 'Delta');
+    define('MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON', 'UK Electron');
+    define('MODULE_PAYMENT_CC_TEXT_MEASTRO', 'Maestro');
+    define('MODULE_PAYMENT_CC_TEXT_UK_SWITCH', 'UK Switch');
+    define('MODULE_PAYMENT_CC_TEXT_SOLO', 'Solo');
+    define('MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD', 'Australian BankCard');
+    define('MODULE_PAYMENT_CC_TEXT_JCB', 'JCB');
+    define('MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE', 'Carte Blanche');
+    define('MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB', 'Diners Club');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_old.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_old.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_old.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_TEXT_TITLE', 'Carte de cr&eacute;dit');
+  define('MODULE_PAYMENT_CC_TEXT_DESCRIPTION', 'No de carte de cr&eacute;dit test<br><br>CC# : 4111111111111111<br>Date d\'expiration : n\'importe');
+  define('MODULE_PAYMENT_CC_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_TYPE', 'Type de la carte :');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER', 'Propri&eacute;taire de la carte :');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER', 'Num&eacute;ro de la carte :');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES', 'Date d\'expiration de la carte :');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_OWNER', '* Le nom du propriétaire de la carte doit avoir au moins ' . CC_OWNER_MIN_LENGTH . ' caractères.\n');
+  define('MODULE_PAYMENT_CC_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_TEXT_ERROR', 'Erreur carte de cr&eacute;dit !');
+  define('MODULE_PAYMENT_CC_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_uk.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_uk.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/cc_uk.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_UK_TEXT_TITLE', 'Credit Card UK,');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DESCRIPTION', 'Credit Card for UK with CVC checking Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_UK_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START', 'Credit Card Start Date:');
+//  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE', 'Credit Card Issue Date:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE','<BR>*** ISSUE NUMBER. This number can be found on debit cards on the front side, on the bottom row , just before the expiry date.');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV', '3 or 4 Digit Security Code:');      
+  
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CCV', 'CCV number:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_UK_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+    define('MODULE_PAYMENT_CC_UK_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_UK_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_UK_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Master Card');
+  define('MODULE_PAYMENT_CC_TEXT_DISCOVERY', 'Discover');
+  define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS', 'American Express');
+  define('MODULE_PAYMENT_CC_TEXT_DELTA', 'Delta');
+  define('MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON', 'UK Electron');
+  define('MODULE_PAYMENT_CC_TEXT_MEASTRO', 'Maestro');
+  define('MODULE_PAYMENT_CC_TEXT_UK_SWITCH', 'UK Switch');
+  define('MODULE_PAYMENT_CC_TEXT_SOLO', 'Solo');
+  define('MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD', 'Australian BankCard');
+  define('MODULE_PAYMENT_CC_TEXT_JCB', 'JCB');
+  define('MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE', 'Carte Blanche');
+  define('MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB', 'Diners Club');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/ccerr.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/ccerr.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/ccerr.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: cc.php,v 1.10 2002/11/01 05:14:11 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_PAYMENT_CCERR_TEXT_TITLE', '      Credit Class Error                  ');
+
+
+
+  define('MODULE_PAYMENT_CCERR_TEXT_DESCRIPTION', 'Credit Class Error, needed with Gift Voucher');  
+  define('MODULE_PAYMENT_CCERR_TEXT_ERROR', 'Payment selection error');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/ckmerchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/ckmerchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/ckmerchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ckmerchantpartners.php,v 1.4 2002/11/01 05:35:33 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_TITLE', 'Electronic Check : Pay Me Now');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_DESCRIPTION', 'Merchant Partners Pay Me now Electronic Check Number:<br><br>ACCT#: 999999999<br>ABA: 999999999');
+  define('CKMERCHANTPARTNERS_ERROR_HEADING', 'There has been an error processing your Electronic Check');
+  define('CKMERCHANTPARTNERS_ERROR_MESSAGE', 'Please check your Check details!');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_OWNER', 'Name on Check:');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_NUMBER', 'Check Account Number:');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_ABA', 'Check Routing Number (ABA):');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_JS_CK_NUMBER', '* The check number must be at least ' . CK_NUMBER_MIN_LENGTH . ' characters.\n');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/cod.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/cod.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/cod.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: cod.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_PAYMENT_COD_TEXT_TITLE', 'Contre Remboursement'); 
+define('MODULE_PAYMENT_COD_TEXT_DESCRIPTION', 'Contre Remboursement');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/efsnet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/efsnet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/efsnet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: efsnet.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('MODULE_PAYMENT_EFSNET_TEXT_TITLE', 'EFSNet');
+  define('MODULE_PAYMENT_EFSNET_TEXT_DESCRIPTION', 'Information Test Carte de cr&eacute;dit:<br><br>CC#: 4111111111111111<br>Expire : Jamais');
+  define('MODULE_PAYMENT_EFSNET_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_OWNER', 'Propri&eacute;taire de la carte de crédit:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_NUMBER', 'Num&eacute;ro carte de cr&eacute;dit :');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_EXPIRES', 'Date expiration carte de cr&eacute;dit :');
+  define('MODULE_PAYMENT_EFSNET_TEXT_JS_CC_OWNER', '* Le Nom du proprietaire de la carte de cr&eacute;dit doit contenir au moins ' . CC_OWNER_MIN_LENGTH . ' caract&egrave;res.\n');
+  define('MODULE_PAYMENT_EFSNET_TEXT_JS_CC_NUMBER', '* Le Num&eacute;ro de carte de cr&eacute;dit doit avoir au moins ' . CC_NUMBER_MIN_LENGTH . ' caract&egrave;res.\n');
+  define('MODULE_PAYMENT_EFSNET_TEXT_ERROR_MESSAGE', 'Une erreur est survenue pendant le traitement de votre carte de cr&eacute;dit. Veuillez recommencer.');
+  define('MODULE_PAYMENT_EFSNET_TEXT_DECLINED_MESSAGE', 'Votre carte de cr&eacute;dit a &eacute;t&eacute; refus&eacute;e. Veuillez recommencer avec une autre carte de cr&eacute;dit ou contacter votre banque pour avoir plus d\'informations.');
+  define('MODULE_PAYMENT_EFSNET_TEXT_ERROR', 'Erreur Carte de Cr&eacute;dit!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/egold.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/egold.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/egold.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: e-gold.php,v 1 2003/07/23 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  e-Gold module Crated by Craig Harrison
+*/
+
+  define('MODULE_PAYMENT_EGOLD_TEXT_TITLE', 'e-Gold');
+  define('MODULE_PAYMENT_EGOLD_TEXT_DESCRIPTION', 'e-Gold');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/epssecurenet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/epssecurenet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/epssecurenet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: epssecurenet.php,v 1.0 2003/08/19 Exp $
+
+// EPSsecurenet
+// Built For osCommerce 2.2MS2 version 
+//--------------------------------
+// Developed BY Greg Goodman
+// Copyright 2003 Electronic Payment Systems
+//--------------------------------
+// This code is provided as is. EPS provides no warranty for the code
+// and the use of this code is done so with the express understanding that
+// it is used at the user's risk. Furthermore EPS may not be held
+// accountable for any losses resulting from the use of this code, including
+// associated modules.
+//--------------------------------
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('MODULE_PAYMENT_EFSNET_TEXT_TITLE', 'Credit Card : EPSsecurenet');
+  define('MODULE_PAYMENT_EPSSECURENET_CART_SYSTEM_NAME', 'OsCommerce');
+  define('MODULE_PAYMENT_EPSSECURENET_CONNECTION_TYPE', 'sd');
+  define('MODULE_PAYMENT_EPSSECURENET_ORDER_DESCRIP', 'Refer to OScommerce Customer Order Screen');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_TITLE', 'EPSsecurenet');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_DESCRIPTION', 'EPSsecurenet Payment Module Credit Card Test Info:<br><br>CC#: 5123456789012346<br>Expiry: Any'); 
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_CVV2', 'CVV2 Security Number:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_CVV2', '* The CVV2 Number must at least be three or four characters.\n    -For VISA/MasterCard this number is on the back of the Card.\n    -For American Express it is 4 digits and located on the front of the Card.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_ERROR', 'Credit Card Error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/eustandardtransfer.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/eustandardtransfer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/eustandardtransfer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_TITLE', 'EU - Virement bancaire Standard');
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION', '<BR>Veuillez employer les détails suivants pour transférer votre somme:<BR>' .
+                                                         '<BR>Nom de la banque: ' . MODULE_PAYMENT_EUTRANSFER_BANKNAM .
+                                                         '<BR>Branche: ' . MODULE_PAYMENT_EUTRANSFER_BRANCH .
+                                                         '<BR>Nom du compte: ' . MODULE_PAYMENT_EUTRANSFER_ACCNAM .
+                                                         '<br>No. compte: ' . MODULE_PAYMENT_EUTRANSFER_ACCNUM .
+                                                         '<BR>IBAN:: ' . MODULE_PAYMENT_EUTRANSFER_ACCIBAN .
+                                                         '<BR>BIC/SWIFT: ' . MODULE_PAYMENT_EUTRANSFER_BANKBIC .
+//                                                         '<BR>Code: ' . MODULE_PAYMENT_EUTRANSFER_SORTCODE .
+                                                         '<BR><BR>Votre commande sera envoyer dès que nous recevrons l\'accord de virement.<BR>');
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_EMAIL_FOOTER', str_replace('<BR>','\n',MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION));
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/firepay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/firepay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/firepay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+
+
+  define('MODULE_PAYMENT_FIREPAY_TEXT_TITLE', 'Credit Card : FirePay');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DESCRIPTION', 'Payment processor for SureFire Commerce. Uses FirePay gateway.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CCV_NUMBER', 'CVV number');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DINERSCLUB', 'Diners Club');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_FIREPAY', 'FirePay');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_VISA', 'Visa');
+
+ ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/freecharger.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/freecharger.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/freecharger.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_TITLE', 'Le coin des faiseurs de site CARTE DE GRATUITEE');
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_DESCRIPTION', 'A utiliser uniquement pour les achats GRATUITS');
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_EMAIL_FOOTER', 'A utiliser avec les ACHATS GRATUITS');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/geotrust.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/geotrust.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/geotrust.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: geotrust.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce / Paul Kim
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_TITLE', 'Paiement express GeoTrust');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_DESCRIPTION', 'Informations Tests pour carte de cr&eacute;dit:<br><br>N°#: 4445999922225<br>Expire: jamais');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_ERROR', 'Erreur carte de cr&eacute;dit !');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_ERROR_MESSAGE', 'Une erreur est survenue pendant le traitement de votre carte de cr&eacute;dit. Veuillez recommencer.');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_FIRST_NAME', 'Pr&eacute;nom :');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_LAST_NAME', 'Nom :');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER', 'Nom complet :');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_NUMBER', 'Num&eacute;ro de carte de cr&eacute;dit :');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_EXPIRES', 'Date d\'expiration carte de cr&eacute;dit :');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2', 'Valeur v&eacute;rification de carte :');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2_LOCATION', '(Les 3 derniers chiffres, présents au dos de votre carte de cr&eacute;dit)');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_JS_CC_OWNER', '* Le nom de propriétaire de la carte doit contenir au moins ' . CC_OWNER_MIN_LENGTH . ' caratères.\n');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_JS_CC_NUMBER', '* Le numéro de carte de crédit doit comporter au moins ' . CC_NUMBER_MIN_LENGTH . ' caractères.\n');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/ipayment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/ipayment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/ipayment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: ipayment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_TITLE', 'iPayment');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_DESCRIPTION', 'N&deg; de carte de cr&eacute;dit test<br><br>CC# : 4111111111111111<br>Date d\'expiration : n\'importe');
+  define('IPAYMENT_ERROR_HEADING', 'Une erreur est survenue lors du traitement de votre carte de cr&eacute;dit');
+  define('IPAYMENT_ERROR_MESSAGE', 'Merci de v&eacute;rifier les informations fournies !');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER', 'Propri&eacute;taire de la carte :');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_NUMBER', 'Num&eacute;ro de carte :');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES', 'Date d\'expiration de la carte :');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER', 'Num&eacute;ro de contr&ocirc;le :');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION', 'Num&eacute;ro qui se trouve au dos de la carte de cr&eacute;dit au dessus de la signature)');
+
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_OWNER', '* Le nom du propriétaire de la carte doit comporté au moins ' . CC_OWNER_MIN_LENGTH . '  caractères.\n');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_NUMBER', '* Le numéro de la carte de crédit doit comporté au moins ' . CC_NUMBER_MIN_LENGTH . ' caractères.\n');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/merchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/merchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/merchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: merchantpartners.php,v 1.4 2002/11/01 05:35:33 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_TITLE', 'Credit Card : Pay Me Now');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_DESCRIPTION', 'Merchant Partners, Pay me now(Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MERCHANTPARTNERS_ERROR_HEADING', 'There has been an error processing your credit card');
+  define('MERCHANTPARTNERS_ERROR_MESSAGE', 'Please check your credit card details!');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2', 'CVV2/CCV2/CID number:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2_LOCATION', '(3 or 4 digit # on back of card):');
+
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/moneyorder.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/moneyorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/moneyorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: moneyorder.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_TITLE', 'Paiement par ch&egrave;que');
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION', '<br>Etablir le ch&egrave;que &agrave; l\'ordre de :&nbsp;<br>' . MODULE_PAYMENT_MONEYORDER_PAYTO . '<br><br>Envoyer &agrave; :<br>' . nl2br(STORE_NAME_ADDRESS) . '<br><br>' . 'Votre commande ne sera envoy&eacute;e qu\'&agrave; r&eacute;ception du r&egrave;glement et de sa validation par notre banque.');
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', '<br>Etablir le ch&egrave;que &agrave; l\'ordre de :&nbsp;<br>'. MODULE_PAYMENT_MONEYORDER_PAYTO . '<br><br>Envoyer &agrave;:<br>' . STORE_NAME_ADDRESS . '' . '<br><br>Votre commande ne sera envoy&eacute;e qu\'&agrave; r&eacute;ception du r&egrave;glement et de sa validation par notre banque.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/nochex.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/nochex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/nochex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: nochex.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_NOCHEX_TEXT_TITLE', 'NOCHEX');
+  define('MODULE_PAYMENT_NOCHEX_TEXT_DESCRIPTION', 'NOCHEX Ne fonctionne qu\'avec la livre sterling (GBP).<br><br>NOCHEX limite des transactions à 100 GBP. Quelque chose excédent exige l\'un ou l\'autre un compte marchand ou un compte de NOCHEX.<br>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/paybox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/paybox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/paybox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  Contribution by Emmanuel Alliel <manu at maboutique.biz>
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYBOX_TEXT_TITLE', 'Carte de cr&eacute;dit (Paybox)');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_DESCRIPTION', 'Le module paybox a &eacute;t&eacute; réalis&eacute; par Emmanuel Alliel<br>Email: manu at maboutique.biz');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_ERROR', 'Erreur Carte de Cr&eacute;dit!');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_ERROR_MESSAGE', 'Une erreur est survenue pendant le traitement de votre carte de cr&eacute;dit. Veuillez recommencer.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/payflowpro.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/payflowpro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/payflowpro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: PAYFLOWPRO.php,v 1.9 2002/01/04 10:45:18 hpdl Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE', 'Pay by Credit Card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE1', 'Your credit card information will be kept secure and private.  We use Verisign payment processing.');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE2', '');
+ 
+ 
+
+  define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'The Credit Card number doe snot match the Card Type:');
+ 
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_TYPE', 'Card Type:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_OWNER', 'Card Owner:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_HOLDER_FIRST_NAME', 'First Name and Initial as shown on the card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_HOLDER_LAST_NAME', 'Last Name and Suffix as shown on your card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_EXPIRES', 'Expiration:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC', 'Card Verification Number');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_TEXT', '(On the back of your card, locate the final 3 digit number)');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_HELP', 'Help Finding Card Verification Number');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_AMEX', 'Using Amex?');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.n');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR_MESSAGE', 'There has been an error processing you credit card, please try again, or call us ');
+  
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR1', 'Local not sent to processor');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR', 'There has been an error processing you credit card. Please double check the information you entered. 
+  <p> 1)  Does the bill to address match the credit card billing address?
+   </p> 2) Try to re-enter the credit card information.  Sorry that this step is necessary, the re-entry is a security requirement.
+  3) If you are still having a problem, please call or email us.  Your items are stored in the system and we can easily help you during normal business hours.  We will still be able to promptly send you your merchandise. 
+  Card error #');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/payjunction.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/payjunction.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/payjunction.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_TITLE', 'Credit Card : PayJunction');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_DESCRIPTION', 'Accept payments through the <b>PayJunction</b> gateway.<br/><br/>Use this credit card to test: 4433221111223344 (12/17)');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NAME', 'Cardholder name:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NUMBER', 'Credit card number:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_CODE', 'CVV2/CVC2 code:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_EXPIRES', 'Credit card expiration:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR', 'Credit card error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: paypal.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE', 'PayPal');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION', 'PayPal');
+
+  define('MODULE_PAYMENT_PAYPAL_CC_TEXT', "Carte de crédit&nbsp;%s%s%s%s&nbsp;ou&nbsp;%s");
+
+  define('MODULE_PAYMENT_PAYPAL_IMAGE_BUTTON_CHECKOUT', 'Paiement PayPal');
+  define('MODULE_PAYMENT_PAYPAL_CC_DESCRIPTION','Vous n\avez pas besoin d\'être un membre de PayPal pour payer par carte de crédit');
+  define('MODULE_PAYMENT_PAYPAL_CC_URL_TEXT','<font color="blue"><u>[info]</u></font>');
+
+  define('MODULE_PAYMENT_PAYPAL_CUSTOMER_COMMENTS', 'Ajoutez des commentaires au sujet de votre commande');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE_PROCESSING', 'Traitement de la transaction');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION_PROCESSING', 'Si cette page reste afficher plus de 5 secondes, cliquez svp sur le bouton de contrôle PayPal pour exécuter votre commande.');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal_dp.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal_dp.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal_dp.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  paypal_dp.php, v 1.0 09/06/2005
+  Copyright (c) 2005 POSTOSC.COM
+  Released under the GNU General Public License
+  Absolutely no warranty. Use at your own risk.
+*/
+
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE', 'Paypal Pro Credit Card Payment');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_DESCRIPTION', 'PayPal Pro Credit Card Payment');
+define('MODULE_PAYMENT_PAYPAL_DP_CLIENT_DESCRIPTION', 'Credit Card');
+define('MODULE_PAYMENT_PAYPAL_DP_IMAGE_DESCRIPTION', '<img src="images/paypal/4cards.gif">');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_FIRSTNAME', 'Owner First Name:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_LASTNAME', 'Owner Last Name:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_CVV2', '<a href="http://www.paypal.com/cgi-bin/webscr?cmd=p/acc/cvv_info_pop-outside" target="_blank"><b>Card Verification Number (<u>CLICK FOR DETAILS</u>)</b></a>:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_EXPIRES', 'Card Expiration Date:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_FIRSTNAME', '* The owner\'s first name of the credit card must be at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_LASTNAME', '* The owner\'s last name of the credit card must be at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_CVV2', '* The card verification value cannot be more than 4 characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_ERROR', 'Credit Card Error!');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_PROCESS_ERROR', 'There has been an error processing your credit card. Please try again.');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal_ec.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal_ec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypal_ec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  paypal_ec.php, v 1.0 09/06/2005
+
+  Copyright (c) 2005 POSTOSC.COM
+
+  Released under the GNU General Public License
+
+  Absolutely no warranty. Use at your own risk.
+*/
+
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_TITLE', 'PayPal Pro Express Checkout');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_DESCRIPTION', 'PayPal Pro Express Checkout');
+define('MODULE_PAYMENT_PAYPAL_EC_CLIENT_DESCRIPTION', 'PayPal');
+define('MODULE_PAYMENT_PAYPAL_EC_IMAGE_DESCRIPTION', '<img src="images/buttons/x-click-but6.gif" align="left" style="margin-right:7px;"><span style="font-size:11px; font-family: Arial, Verdana;">Save time. Checkout securely. Pay without sharing your financial information.</span>');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_ERROR', 'PayPal Process Error!');
+define('MODULE_PAYMENT_PAYPAL_EC_BILLING_ERROR', 'Please enter your PayPal billing address.');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_PROCESS_ERROR', 'There has been an error processing your payment. Please try again.');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_DECLINED_MESSAGE', 'Your card was declined. Please try another card or contact your bank for more info.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypalipn.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypalipn.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/paypalipn.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: paypalipn.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Paypal IPN v0.981 for Milestone 2
+  Copyright (c) 2003 Pablo Pasqualino
+  pablo_osc at osmosisdc.com
+  http://www.osmosisdc.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_TITLE', 'PayPal IPN');
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_DESCRIPTION', 'PayPal IPN');
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_CURL', 'cURL Activ&eacute;');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/plugnpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/plugnpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/plugnpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: plugnpay.php,v 1.13 2003/01/03 17:25:43 thomasamoulton Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+  Released under the GNU General Public License
+
+  Last Updated: 09/17/04
+*/
+
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_TITLE', 'Credit Card : PlugnPay');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DESCRIPTION', 'PlugnPay API');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_CVV', 'CVV/CVV2:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCTTYPE', 'Account Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ROUTINGNUM', 'Routing Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCOUNTNUM', 'Account Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_CHECKNUM', 'Check Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_PAYTYPE', 'Payment Method:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/pm2checkout.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/pm2checkout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/pm2checkout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: pm2checkout.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_TITLE', '2CheckOut');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_DESCRIPTION', 'No de carte de cr&eacute;dit test<br><br>CC# : 4111111111111111<br>Date d\'expiration : n\'importe');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_TYPE', 'Type :');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER', 'Propri&eacute;taire de la carte :');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_FIRST_NAME', 'Pr&eacute;nom du propri&eacute;taire de la carte de cr&eacute;ditCredit :');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_LAST_NAME', 'Nom du propri&eacute;taire de la carte :');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_NUMBER', 'Num&eacute;ro de la carte de cr&eacute;dit :');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_EXPIRES', 'Date d\'expiration :');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER', 'Num&eacute;ro de v&eacute;rification de votre carte :');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION', '(Num&eacute;ro qui se trouve au dos de la carte de cr&eacute;dit au dessus de la signature)');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_JS_CC_NUMBER', '* Le numéro de la carte de crédit doit compoté au moins ' . CC_NUMBER_MIN_LENGTH . ' caractères.\n');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR_MESSAGE', 'Une erreur est survenue lors de la validation de votre carte. Merci de bien vouloir recommencer.');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR', 'Votre carte de cr&eacute;dit n\'a pas &eacute;t&eacute; accept&eacute;e !');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/psigate.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/psigate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/psigate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: psigate.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PSIGATE_TEXT_TITLE', 'PSiGate');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_DESCRIPTION', 'Information Test carte de cr&eacute;dit :<br><br>CC#: 4111111111111111<br>Expire: n\'importe');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER', 'Propri&eacute;taire carte de cr&eacute;dit :');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER', 'Num&eacute;ro Carte de cr&eacute;dit :');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES', 'Date d\'expiration :');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_JS_CC_NUMBER', '* Le numéro de carte de crédit doit comporté un minimum de ' . CC_NUMBER_MIN_LENGTH . ' caractères.\n');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_ERROR_MESSAGE', 'Une erreur est survenue pendant le traitement de votre carte de cr&eacute;dit. Veuillez recommencer.');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_ERROR', 'Erreur carte de cr&eacute;dit!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/qchex.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/qchex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/qchex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: qchex.php,v 3.0 2003/11/10 23:25:32 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_QCHEX_TEXT_TITLE', 'QChex (Electronic Check Payment)');
+  define('MODULE_PAYMENT_QCHEX_TEXT_DESCRIPTION', 'QChex (Electronic Check Payment)');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/quickcommerce.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/quickcommerce.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/quickcommerce.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: authorizenet.php,v 1.3 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+*/
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_TITLE', 'Credit Card : Quick Commerce Pro');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/secpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/secpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/secpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: secpay.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_SECPAY_TEXT_TITLE', 'SECPay');
+  define('MODULE_PAYMENT_SECPAY_TEXT_DESCRIPTION', 'No de carte de cr&eacute;dit test<br><br>CC# : 4444333322221111<br>Date d\'expiration : n\'importe');
+  define('MODULE_PAYMENT_SECPAY_TEXT_ERROR', 'Erreur sur la carte de cr&eacute;dit !');
+  define('MODULE_PAYMENT_SECPAY_TEXT_ERROR_MESSAGE', 'Une erreur est survenue lors du traitement de votre carte. Veuillez recommencer.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/payment/worldpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/payment/worldpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/payment/worldpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: worldpay.php,v MS1a 2003/04/06 21:30
+  Author :  Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.4
+
+  Revisions:
+  Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+          Now posting language code to WP, Redirect on failure now to Checkout Payment,
+      Reduced re-direct time to 8 seconds, added MD5, made callback dynamic 
+      NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+  Version 1.4 Removes boxes to prevent users from clicking away before update, 
+      Fixes currency for Yen, 
+      Redirects to Checkout_Process after 10 seconds or click by user
+  Version 1.3 Fixes problem with Multi Currency
+  Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+  Version 1.1 Added Worldpay Pre-Authorisation ability
+  Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_WORLDPAY_TEXT_TITLE', 'Worldpay Credit Card Payment');
+  define('MODULE_PAYMENT_WORLDPAY_TEXT_DESCRIPTION', 'Worldpay Junior Payment Module');
+   
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspost.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspost.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_TEXT_TITLE', 'AusPOST Parcel Post');
+define('MODULE_SHIPPING_AUSPOST_TEXT_DESCRIPTION', 'AusPOST Parcel Post');
+define('MODULE_SHIPPING_AUSPOST_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostair.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostair.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostair.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostair.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_TITLE', 'AusPOST International Parcel Post - AIR');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_DESCRIPTION', 'AusPOST International Parcel Post - AIR');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/ausposteconomy.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/ausposteconomy.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/ausposteconomy.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: ausposteconomy.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_TITLE', 'AusPOST International Parcel Post - Economy');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_DESCRIPTION', 'Int. Parcel Post - Economy');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostexpress.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostexpress.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostexpress.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostexpress.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_TITLE', 'AusPOST Express Post Parcel');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_DESCRIPTION', 'AusPOST Express Post Parcel');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostsea.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostsea.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/auspostsea.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostsea.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_TITLE', 'AusPOST International Parcel Post - SEA');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_DESCRIPTION', 'AusPOST International Parcel Post - SEA');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/canadapost.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/canadapost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/canadapost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  canadapost.php version 0.3
+  
+  Before use this class, you should open a Canada 
+  Post Eparcel Account, and change the CPCIP to
+  your ID. Visit www.canadapost.ca for detail.
+  
+  XML connection method with Canada Post.
+
+  Copyright (c) 2002,2003 Kelvin Zhang (kelvin at syngear.com)
+  Modified by Kenneth Wang (kenneth at cqww.net), 2002.11.12
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_CANADAPOST_TEXT_TITLE', 'Canada Post');
+define('MODULE_SHIPPING_CANADAPOST_TEXT_DESCRIPTION', 'Canada Post Parcel Service');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/cod.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/cod.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/cod.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: flat.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_COD_TEXT_TITLE', 'COD Rate');
+define('MODULE_SHIPPING_COD_TEXT_DESCRIPTION', 'COD Rate');
+define('MODULE_SHIPPING_COD_TEXT_WAY', 'Best Way');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/fedex1.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/fedex1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/fedex1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+
+  Verions 2.00 for OSC 2.2 MSS and earlier
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002, 2003 Steve Fatula of Fatula Consulting
+  compconsultant at yahoo.com
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FEDEX1_TEXT_TITLE', 'Federal Express');
+define('MODULE_SHIPPING_FEDEX1_TEXT_DESCRIPTION', 'Federal Express<br><br>L\'utilisation de ce module n&eacute;cessite d\'avoir un compte enregistr&eacute; chez FEXDEX. Veuillez lire le fichier README.TXT pour connaitre les autres &eacute;l&eacute;ments n&eacute;cessaires.');
+
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_01', 'Priority (by 10:30AM, later for rural)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_03', '2 Day Air');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_05', 'Standard Overnight (by 3PM, later for rural)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_06', 'First Overnight');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_20', 'Express Saver (3 Day)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_90', 'Home Delivery');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_92', 'Ground Service');
+
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_01', 'International Priority (1-3 Days)');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_03', 'International Economy (4-5 Days)');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_06', 'International First');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_90', 'Home Delivery');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_92', 'Ground Service');
+
+define('MODULE_SHIPPING_FEDEX1_ERROR_1', 'An error occured with the fedex shipping calculations.<br>Fedex may not deliver to your country, or your postal code may be wrong.');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_1', "Data sent to Fedex for Meter: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_2', "Data returned from Fedex for Meter: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_3', 'No response to CURL from Fedex server, check CURL availability, or maybe timeout was set too low, or maybe the Fedex site is down');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_4', 'No meter number was obtained, check configuration. Error ');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_5', 'You forgot to set up your Fedex account number, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_6', 'You forgot to set up your ship from street address line 1, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_7', 'You forgot to set up your ship from City, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_8', 'You forgot to set up your ship from postal code, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_9', 'You forgot to set up your ship from phone number, this can be set up in Admin -> Modules -> Shipping');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_10', "Data sent to Fedex for Rating: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_11', "Data returned from Fedex for Rating: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_12', 'No data returned from Fedex, perhaps the Fedex site is down');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_13', 'No Rates Returned, ');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/flat.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/flat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/flat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: flat.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FLAT_TEXT_TITLE', 'Frais d\'envoi');
+define('MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION', 'Frais d\'envoi');
+define('MODULE_SHIPPING_FLAT_TEXT_WAY', 'Tarif Normal');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/freeshipper.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/freeshipper.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/freeshipper.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE', 'Livraison GRATUITE!');
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_DESCRIPTION', 'Livraison GRATUITE');
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_WAY', 'Livraison GRATUITE uniquement');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/item.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/item.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/item.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: item.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ITEM_TEXT_TITLE', 'Par Article');
+define('MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION', 'Par Article');
+define('MODULE_SHIPPING_ITEM_TEXT_WAY', 'Meilleur choix');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/percent.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/percent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/percent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: percent.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001,2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('MODULE_SHIPPING_PERCENT_TEXT_TITLE', 'Shipping');
+define('MODULE_SHIPPING_PERCENT_TEXT_TITLE_ADMIN', 'Percent Rate');
+define('MODULE_SHIPPING_PERCENT_TEXT_DESCRIPTION', 'Percent Rate Shipping');
+define('MODULE_SHIPPING_PERCENT_TEXT_WAY', 'Total');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/reg.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/reg.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/reg.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_REG_TEXT_TITLE', 'Royal Mail Registered');
+define('MODULE_SHIPPING_REG_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_REG_TEXT_WAY', '');
+define('MODULE_SHIPPING_REG_TEXT_UNITS', '');
+define('MODULE_SHIPPING_REG_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_REG_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/spec.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/spec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/spec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_SPEC_TEXT_TITLE', 'Royal Mail Special Delivery');
+define('MODULE_SHIPPING_SPEC_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_SPEC_TEXT_WAY', '');
+define('MODULE_SHIPPING_SPEC_TEXT_UNITS', '');
+define('MODULE_SHIPPING_SPEC_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_SPEC_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/spu.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/spu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/spu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: spu.php,v 1.3 2002/06/15 01:15:42 mbs Exp $
+  CONTRIB is Store Pickup Shipping Module (http://www.oscommerce.com/community/contributions,164)
+  Created by Michael Halvorsen
+  http://www.arachnia-web.com
+
+  Copyright (c) 2002 Arachnia-web Development.
+  Released under the GNU General Public License.
+  May be used and modified without permission.
+*/
+
+define('MODULE_SHIPPING_SPU_TEXT_TITLE', 'Store Pickup');
+define('MODULE_SHIPPING_SPU_TEXT_DESCRIPTION', 'In-store pickup during regular business hours.');
+define('MODULE_SHIPPING_SPU_TEXT_WAY', 'No shipping charge added.  Pickup during regular business hours.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/stand.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/stand.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/stand.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_STAND_TEXT_TITLE', 'Royal Mail Standard Parcel');
+define('MODULE_SHIPPING_STAND_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_STAND_TEXT_WAY', '');
+define('MODULE_SHIPPING_STAND_TEXT_UNITS', '');
+define('MODULE_SHIPPING_STAND_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_STAND_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/table.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: table.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_TABLE_TEXT_TITLE', 'Frais au Total');
+define('MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION', 'Frais au Total');
+define('MODULE_SHIPPING_TABLE_TEXT_WAY', 'Meilleur choix');
+define('MODULE_SHIPPING_TABLE_TEXT_WEIGHT', 'Poids');
+define('MODULE_SHIPPING_TABLE_TEXT_AMOUNT', 'Montant');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/ups.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/ups.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/ups.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: ups.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_UPS_TEXT_TITLE', 'UPS (United Parcel Service)');
+define('MODULE_SHIPPING_UPS_TEXT_DESCRIPTION', 'Livraison par UPS');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_GND', 'UPS Ground');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DM', 'Le lendemain par avion et dans la matin&eacute;e');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DA', 'Le lendemain par avion');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DP', 'Le lendemain par avion a tarif &eacute;conomique');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_2DM', 'Dans les 2 jours par avion et dans la matin&eacute;e');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_3DS', 'Dans les 3 jours');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_STD', 'Canada Standard');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XPR', 'Livraison dans le monde en Express');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XDM', 'Livraison dans le monde en Express Plus');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XPD', 'Livraison dans le monde en Acc&eacute;l&eacute;r&eacute;e');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/usps.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/usps.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/usps.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: usps.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  ++++ modified as USPS Methods 2.5 08/02/03 by Brad Waite and Fritz Clapp ++++
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_USPS_TEXT_TITLE', 'USPS (United States Postal Service)');
+define('MODULE_SHIPPING_USPS_TEXT_DESCRIPTION', 'United States Postal Service<br><br>Vous devez avoir un compte enregistr&eacute; chez USPS (http://www.uspsprioritymail.com/et_regcert.html) pour pouvoir utiliser ce module.<br><br>USPS attends de vous que vous utilisiez la valeur m&eacute;trique \'pound\' comme mesure de poids pour vos produits');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_PP', 'Colis postaux');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_PM', 'Envoie prioritaire');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_EX', 'Envoie express');
+define('MODULE_SHIPPING_USPS_TEXT_ERROR', 'Une erreur est intervenue avec le calcul de votre livraison USPS.<br>Si vous d&eacute;sirez utilis&eacute; USPS comme m&eacute;thode de livraison, merci de bien vouloir contacter le responsable de la boutique.');
+define('MODULE_SHIPPING_USPS_TEXT_DAY', 'Jour');
+define('MODULE_SHIPPING_USPS_TEXT_DAYS', 'Jours');
+define('MODULE_SHIPPING_USPS_TEXT_WEEKS', 'Semaines');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/zones.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ZONES_TEXT_TITLE', 'Tableau de cout de livraison par zone et r&eacute;gions');
+define('MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION', 'Cout d\'envoie par zone et r&eacute;gion');
+define('MODULE_SHIPPING_ZONES_TEXT_WAY', 'Livraison vers');
+define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'Kg(s)');
+define('MODULE_SHIPPING_ZONES_INVALID_ZONE', 'Pas de livraison possible vers le pays s&eacute;lectionn&eacute;');
+define('MODULE_SHIPPING_ZONES_UNDEFINED_RATE', 'Le cout de livraison ne peut etre d&eacute;termin&eacute; pour le moment');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping/zones_single.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping/zones_single.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping/zones_single.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_TITLE', 'Single Zone Rates');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_DESCRIPTION', 'Single Zone Based Rates');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_WAY', 'Shipping to');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_UNITS', 'lb(s)');
+define('MODULE_SHIPPING_ZONES_SINGLE_INVALID_ZONE', 'No shipping available to the selected country');
+define('MODULE_SHIPPING_ZONES_SINGLE_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/modules/shipping_estimator.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/shipping_estimator.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/shipping_estimator.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: shiupping estimator.php,v 1.1 2004/12/01  $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 CREloaded
+
+  Released under the GNU General Public License
+*/
+
+ define('SHIPPING_OPTIONS', 'Shipping Options:');
+ define('SHIPPING_OPTIONS_LOGIN_A', 'Please <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>, to display your personal shipping costs.');
+ define('SHIPPING_OPTIONS_LOGIN_B', 'Please Log In, to display your personal shipping costs.');
+  define('SHIPPING_METHOD_TEXT','Shipping Methods:');
+  define('SHIPPING_METHOD_RATES','Rates:');
+  define('SHIPPING_METHOD_TO','Ship to: ');
+  define('SHIPPING_METHOD_TO_NOLOGIN', 'Ship to: <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>');
+  define('SHIPPING_METHOD_FREE_TEXT','Free Shipping');
+  define('SHIPPING_METHOD_ALL_DOWNLOADS','- Downloads');
+  define('SHIPPING_METHOD_RECALCULATE','Recalculate');
+  define('SHIPPING_METHOD_ZIP_REQUIRED','true');
+  define('SHIPPING_METHOD_ADDRESS','Address:');
+  define('SHIPPING_METHOD_ITEM','ITEM:');
+  define('SHIPPING_METHOD_ITEMS','ITEMS:');
+  define('SHIPPING_METHOD_WEIGHT','Weight:');
+  define('SHIPPING_METHOD_WEIGHT_UNIT','lbs');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/modules/xsell_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/modules/xsell_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/modules/xsell_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: xsell_products.php, v1
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+  define('TEXT_XSELL_PRODUCTS', 'Nous vous recommandons aussi :');
+  define('TEXT_BUY', 'Acheter 1 \'');
+  define('TEXT_NOW', '\' maintenance');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Navigation Menu');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_CATEGORIES_LINKS', 'Categories / Links');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Products Image:</b><small><br>Main Image used in <br><u>catalog & description</u> pages.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Small Image:</b><br><small> Image on<br><u>products list</u> pages.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Image:</b><br><small> Large Image on<br><u>pop-up window</u> page.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Store Product/s Sharing this Image =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Remove</b> this Image from this Product?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>Delete</b> this Image from the Server (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Remove');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'Delete');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Small Images.</b> If a "SM" image is used<br>(Alone) NO Pop-up window link is created, the "SM"<br> will be placed directly under the products<br>description. If used in conjunction with an <br>"XL" image on the right, a Pop-up Window Link<br> is created and the "XL" image will be<br>shown in a Pop-up window.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Large Images.</b> Used for the Pop-up image<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Additional Images - These will appear below product description if used.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Image 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Image 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Image 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Image 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Image 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Image 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Image 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Image 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Image 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Image 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Image 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Image 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DELETE_IMAGE', 'Delete Image');
+
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Category heading title:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Category heading Description:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Category Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Category Description Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Category Key Word Meta Tag :');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method :');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Product Keywords :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Edit Product Attributes');
+
+// Added for Navigation Menu DMG
+
+define('TEXT_LINKS','Links');
+define('TEXT_HEADING_EDIT_CATEGORY','Edit Navigation Category');
+define('TEXT_HEADING_NEW_LINK','Create New Navigation Link');
+define('TEXT_LINK_NAME','Link Text : ');
+define('TEXT_LINK_PAGE','Link Target : ');
+define('TEXT_STATUS','Link Status : ');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/pages.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: pages.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc
+  
+  Copyright &copy; 2006 Chain Reaction Works, Inc
+  
+  Last Modifed By : $Author$
+  Last Modified On :  $Date$
+  Latest Revision :  $Revision$
+  
+  
+*/
+
+define('NAVBAR_TITLE', 'Pages');
+
+define('HEADING_TITLE', 'Pages');
+define('TEXT_NO_PAGES', 'There are no pages to list in this category.');
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: password_forgotten.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Identification');
+define('NAVBAR_TITLE_2', 'Mot de passe oubli&eacute;');
+
+define('HEADING_TITLE', 'J\'ai oubli&eacute; mon mot de passe&nbsp;!');
+
+define('TEXT_MAIN', 'Si vous avez oubli&eacute; votre mot de passe, saisissez ci-dessous votre adresse email et nous vous enverrons un message avec votre nouveau mot de passe.');
+
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'Erreur&nbsp;: L\'adresse email n\'est pas r&eacute;pertori&eacute;e chez nous, veuillez essayer &agrave; nouveau.');
+
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Nouveau mot de passe');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'Un nouveau mot de passe a &eacute;t&eacute; demand&eacute; depuis ' . $REMOTE_ADDR . '.' . "\n\n" . 'Votre nouveau mot de passe pour \'' . STORE_NAME . '\' est :' . "\n\n" . '   %s' . "\n\n");
+
+define('SUCCESS_PASSWORD_SENT', 'Succ&egrave;s&nbsp;: Un nouveau mot de passe a &eacute;t&eacute; envoy&eacute; &agrave; votre adresse email.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/popup_affiliate_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/popup_affiliate_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/popup_affiliate_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: popup_affiliate_help.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Aide Infobox');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Aide Infobox');
+
+define('HEADING_SUMMARY_HELP', 'Aide des partenaires');
+define('TEXT_IMPRESSIONS_HELP', '<b>Affichage:</b> Affiche le nombre de fois qu\'une banni&egrave;re ou un lien a &eacute;t&eacute; montr&eacute; pour une p&eacute;riode donn&eacute;e.');
+define('TEXT_VISITS_HELP', '<b>Visites:</b> Repr&eacute;sente le nombre de clics g&eacute;n&eacute;r&eacute;s par des visiteurs depuis votre site.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Transactions:</b> Repr&eacute;sente le nombre de transactions r&eacute;ussies cr&eacute;dit&eacute;es sur votre compte.');
+define('TEXT_CONVERSION_HELP', '<b>Conversions:</b> Repr&eacute;sente le pourcentage des visiteurs accomplissant une transaction.');
+define('TEXT_AMOUNT_HELP', '<b>Montant:</b> Repr&eacute;sente le montant des ventes cr&eacute;dit&eacute;es &agrave; votre compte.');
+define('TEXT_AVERAGE_HELP', '<b>Moyenne:</b> Repr&eacute;sente la moyenne des ventes cr&eacute;dit&eacute;es &agrave; votre compte.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Taux de Commission</b>  Repr&eacute;sente le taux que vous touchez sur les ventes en pourcentage.');
+define('TEXT_COMMISSION_HELP', '<b>Total Commission</b>  Repr&eacute;sente la commission totale qui vous est due');
+define('TEXT_CLOSE_WINDOW', 'Fermer la fenetre [x]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/popup_coupon_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/popup_coupon_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/popup_coupon_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: popup_coupon_help.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_COUPON_HELP', 'Aide bon de remise');
+define('TEXT_CLOSE_WINDOW', 'Fermer la fenetre [x]');
+define('TEXT_COUPON_HELP_HEADER', 'F&eacute;licitations, vous avez recu un bon de remise.');
+define('TEXT_COUPON_HELP_NAME', '<br><br>Nom du bon : %s');
+define('TEXT_COUPON_HELP_FIXED', '<br><br>Ce bon vous donne droit à %s de remise sur votre commande');
+define('TEXT_COUPON_HELP_MINORDER', '<br><br>Vous devez d&eacute;penser %s pour utiliser ce bon');
+define('TEXT_COUPON_HELP_FREESHIP', '<br><br>Ce bon vous donne droit à l\'exp&eacute;dition gratuite de votre commande');
+define('TEXT_COUPON_HELP_DESC', '<br><br>Description du bon : %s');
+define('TEXT_COUPON_HELP_DATE', '<br><br>Ce bon est valable du %s au %s');
+define('TEXT_COUPON_HELP_RESTRICT', '<br><br>Restriction sur les produits et/ou Cat&eacute;gories');
+define('TEXT_COUPON_HELP_CATEGORIES', 'Cat&eacute;gories');
+define('TEXT_COUPON_HELP_PRODUCTS', 'Produits');
+define('TEXT_NONE', 'NONE');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/popup_image.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/popup_image.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/popup_image.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: popup_image.php,v 1.2 2004/01/18 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('TEXT_CLOSE_WINDOW', 'Click to Close Window [x]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/printorder.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/printorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/printorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: invoice.php,v 1.1 2003/05 xaglo
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TITLE_PRINT_ORDER', 'Commande');
+
+define('TABLE_HEADING_COMMENTS', 'Vos commentaires');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Mod&egrave;le');
+define('TABLE_HEADING_PRODUCTS', 'Produits');
+define('TABLE_HEADING_TAX', 'Taxes');
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Prix HT');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Prix TTC');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total HT');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total TTC');
+
+define('IMAGE_BUTTON_PRINT', 'Imprimer');
+
+define('ENTRY_SOLD_TO', 'VENDU A :');
+define('ENTRY_SHIP_TO', 'ENVOYE A :');
+define('ENTRY_PAYMENT_METHOD', 'Moyen de paiement :');
+
+define('ENTRY_DATE_PURCHASED', 'Date de la commande: ');
+
+define('ENTRY_ACCESS_ERROR', 'Vous n\'avez pas acc&egrave;s a cette commande.<br />Si vous pensez avoir reçut ce message par erreur, contactez l\'administrateur de la boutique.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/product_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/product_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/product_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: product_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_PRODUCT_NOT_FOUND', 'Article indisponible pour le moment!');
+define('TEXT_CURRENT_REVIEWS', 'Critiques:');
+define('TEXT_MORE_INFORMATION', 'Pour plus d\'information, vous pouvez &eacute;galement vous rendre sur la <a href="%s" target="_blank"><u>page web</u></a> suivante.');
+define('TEXT_DATE_ADDED', 'Cet article a &eacute;t&eacute; ajout&eacute; le %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#ff0000">Cet article sera en stock le %s.</font>');
+define('TEXT_ALSO_PURCHASED_PRODUCTS', 'Les clients ayant achet&eacute; cet article ont &eacute;galement achet&eacute;:');
+define('TEXT_PRODUCT_OPTIONS', '<b>Veuillez s&eacute;lectionner les options disponibles ainsi que la quantit&eacute; d&eacute;sir&eacute;e pour ce produit:</b>');
+define('TEXT_CLICK_TO_ENLARGE', 'Cliquez pour agrandir');
+define('TEXT_NO_MOPICS', 'Coming soon!');
+/*Eversun mod end for sppc and qty price breaks*/
+define('TEXT_ENTER_QUANTITY', 'Quantity')
+/*Eversun mod end for sppc and qty price breaks*/
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/product_info_configureable.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/product_info_configureable.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/product_info_configureable.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: product_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_PRODUCT_NOT_FOUND', 'Product not found!');
+define('TEXT_CURRENT_REVIEWS', 'Current Reviews:');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this products <a href="%s" target="_blank"><u>webpage</u></a>.');
+define('TEXT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#ff0000">This product will be in stock on %s.</font>');
+define('TEXT_ALSO_PURCHASED_PRODUCTS', 'Customers who bought this product also purchased');
+define('TEXT_PRODUCT_OPTIONS', 'Available Options:');
+define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
+define('TEXT_NO_MOPICS', 'Coming soon!');
+/*Eversun mod end for sppc and qty price breaks*/
+define('TEXT_ENTER_QUANTITY', 'Quantity');
+define('TEXT_QUALITY_PRICE_CHART','Quantity Price Chart');
+/*Eversun mod end for sppc and qty price breaks*/
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/product_reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/product_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/product_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: product_reviews.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Impressions');
+
+define('TEXT_CLICK_TO_ENLARGE', 'Cliquez pour agrandir');
+
+define('TEXT_OF_5_STARS', '%s sur 5 &eacute;toiles!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/product_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/product_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/product_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: product_reviews_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Impressions');
+define('HEADING_TITLE', ' Les impressions de %s');
+define('SUB_TITLE_PRODUCT', 'Article:');
+define('SUB_TITLE_FROM', 'De:');
+define('SUB_TITLE_DATE', 'Date:');
+define('SUB_TITLE_REVIEW', 'Impression:');
+define('SUB_TITLE_RATING', 'Note:');
+define('TEXT_OF_5_STARS', '%s sur 5 Etoiles!');
+define('TEXT_CLICK_TO_ENLARGE', 'Cliquez pour agrandir');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/product_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/product_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/product_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: product_reviews_write.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Impressions');
+
+define('SUB_TITLE_FROM', 'De:');
+define('SUB_TITLE_REVIEW', 'Impression:');
+define('SUB_TITLE_RATING', 'Note:');
+
+define('TEXT_NO_HTML', '<small><font color="#ff0000"><b>NOTE:</b></font></small>&nbsp;Le HTML n\'est pas converti');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>MAUVAIS</b></font></small>');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>BON</b></font></small>');
+
+define('TEXT_CLICK_TO_ENLARGE', 'Cliquez pour agrandir');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/products_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/products_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/products_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: products_new.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Nouveaux Produits');
+define('HEADING_TITLE', 'Nouveaux Produits');
+
+define('TEXT_DATE_ADDED', 'Date d\'ajout:');
+define('TEXT_MANUFACTURER', 'Constructeur:');
+define('TEXT_PRICE', 'Prix:');
+
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/pw.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/pw.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/pw.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,8 @@
+<?php
+define('TEXT_ACCOUNT_CREATED','Your Account is now active !');
+define('TEXT_YOUR_ACCOUNT_ALREADY_EXIST', 'Your Account is already active!');
+define('HEADIN_TITLE', 'Account validation');
+define('NAVBAR_TITLE', 'Account validation');
+define('TEXT_ACCOUNT_CREATED_FAIL', 'The validation/activation code you entered is incorrect');
+define('TEXT_ACCOUNT_CREATED_FAIL2', 'The email address or validation/activation code you entered is not valid');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: reviews.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Impressions');
+define('HEADING_TITLE', 'Ce que pensent les utilisateurs de l\'article');
+define('TEXT_OF_5_STARS', '%s sur 5 Etoiles!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Acheter par tranche de prix');
+define('HEADING_TITLE', 'Acheter par tranche de prix');
+define('BOX_HEADING_SHOP_BY_PRICE', 'Acheter par tranche de prix');
+define('TABLE_HEADING_IMAGE', '');
+define('TABLE_HEADING_PRICE', 'Prix');
+define('TABLE_HEADING_BUY_NOW', 'Achetez Maintenant');
+define('TABLE_HEADING_MODEL', 'Mod&egrave;le');
+define('TABLE_HEADING_PRODUCTS', 'Nom Produit');
+define('TABLE_HEADING_MANUFACTURER', 'Marques');
+define('TABLE_HEADING_QUANTITY', 'Quantit&eacute;');
+
+define('TEXT_INFO_UNDER', 'Au dessous de&nbsp;');
+define('TEXT_INFO_FROM', 'de&nbsp;');
+define('TEXT_INFO_TO', '&nbsp;à&nbsp;');
+define('TEXT_INFO_ABOVE', '&nbsp;et plus');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Votre panier');
+define('HEADING_TITLE', 'Qu\'y a t\'il dans le panier ? ');
+define('TABLE_HEADING_REMOVE', 'Supprimer');
+define('TABLE_HEADING_QUANTITY', 'Qt&eacute;.');
+define('TABLE_HEADING_MODEL', 'Mod&egrave;le');
+define('TABLE_HEADING_PRODUCTS', 'Produit(s)');
+define('TABLE_HEADING_TOTAL', 'Total');
+define('TEXT_CART_EMPTY', 'Votre panier est vide!!');
+define('SUB_TITLE_SUB_TOTAL', 'Sous-Total:');
+define('SUB_TITLE_TOTAL', 'Total:');
+
+define('OUT_OF_STOCK_CANT_CHECKOUT', 'Les articles marqu&eacute;s' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' ne sont pas en stock dans la quantit&eacute; d&eacute;sir&eacute;e.<br>Veuillez ajuster la quantit&eacute; des produits marqu&eacute;s (' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '), Merci');
+define('OUT_OF_STOCK_CAN_CHECKOUT', 'Les articles marqu&eacute;s' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' ne sont pas en stock dans la quantit&eacute; d&eacute;sir&eacute;e.<br>N&eacute;anmoins vous pouvez acheter ces articles et v&eacute;rifier la quantit&eacute; que nous avons en stock pour une livraison imm&eacute;diate lors de votre achat.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/specials.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: specials.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Promotions');
+define('HEADING_TITLE', 'A ne pas manquer!');
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/ssl_check.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/ssl_check.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/ssl_check.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: ssl_check.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Point S&eacute;curit&eacute;');
+define('HEADING_TITLE', 'Point S&eacute;curit&eacute;');
+
+define('TEXT_INFORMATION', 'Nous avons d&eacute;tect&eacute; que votre navigateur a g&eacute;n&eacute;r&eacute; une session ID SSL diff&eacute;rente de celle utilis&eacute;e sur nos pages s&eacute;curis&eacute;es.<br><br>Pour une raison de s&eacute;curit&eacute;, nous vous prions de vous r&eacute;-enregistrer &agrave; votre compte afin de continuer vos achats en ligne en toute s&eacute;curit&eacute;.<br><br>Certains navigateurs tel que Konqueror 3.1 n\'ont pas la capacit&eacute; de g&eacute;n&eacute;rer une session ID SSL automatique et prot&eacute;g&eacute;e. Si vous utilisez ce navigateur, nous vous recommandons de changer de navigateur par un autre tel que <a href="http://www.microsoft.com/ie/" target="_blank">Microsoft Internet Explorer</a>, <a href="http://channels.netscape.com/ns/browsers/download_other.jsp" target="_blank">Netscape</a>, ou <a href="http://www.mozilla.org/releases/" target="_blank">Mozilla</a>, afin de continuer vos achats en ligne en toute s&eacute;curit&eacute; .<br><br>Nous avons pris cette mesure suppl&eacute;mentaire pour vous faire b&eacute;n&eacute;ficier d\'une totale s&eacute;curit&eacute;, et nous nous excusons d\'avance pour tous les d&eacute;sagr&eacute;ments occasionn&eacute;s.<br><br>Pour toutes questions, vous pouvez contacter le propri&egrave;taire du magasin, ou simplement continuer vos achats.');
+
+define('BOX_INFORMATION_HEADING', 'Confidentialit&eacute; et S&eacute;curit&eacute;');
+define('BOX_INFORMATION', 'Nous validons la Session ID SSL g&eacute;n&eacute;rer automatiquement par votre navigateur sur chacune de nos pages s&eacute;curis&eacute;es.<br><br>Cette validation nous permet de nous assurer que c\'est bien vous qui naviguez sur ce site avec votre compte et personne d\'autre.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Faire connaitre à un(e) ami(e)');
+
+define('HEADING_TITLE', 'Faire connaitre à un(e) ami(e):  \'%s\'');
+
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Vous');
+define('FORM_TITLE_FRIEND_DETAILS', 'Votre ami(e)');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Votre message');
+
+define('FORM_FIELD_CUSTOMER_NAME', 'Votre nom:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Votre adresse email:');
+define('FORM_FIELD_FRIEND_NAME', 'Le nom de votre ami(e):');
+define('FORM_FIELD_FRIEND_EMAIL', 'Son adresse email:');
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Votre email à propos de <b>%s</b> vient d\'être envoy&eacute; à <b>%s</b>.');
+
+define('TEXT_EMAIL_SUBJECT', 'Votre ami(e) %s vous recommande cet article d\' %s');
+define('TEXT_EMAIL_INTRO', '<b>Bonjour %s!</b><br><br>' . "\n\n" . 'Votre ami(e), %s, a pens&eacute; que vous pourriez être int&eacute;ress&eacute; par ce produit: ' . "<br><br>" . '<b>%s</b> d\' %s.'. "<br><br>");
+define('TEXT_EMAIL_LINK', "<p></p>" . 'Pour aller voir cet article, cliquez sur le lien ou copiez/collez le lien ci-apr&egrave;s:' . "\n\n" . '<a target="_blank">%s</a>' . "<br><br>");
+define('TEXT_EMAIL_LINK_ARTICLE', 'To view the article click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE_TEXT', 'To view the article copy and paste the link into your web browser:' . "\n\n");
+
+define('TEXT_EMAIL_SIGNATURE', 'Cordialement,' . "\n\n");
+
+define('ERROR_TO_NAME', 'Erreur: Le nom de votre ami(e) doit comporter au moins des caract&egrave;res.');
+define('ERROR_TO_ADDRESS', 'Erreur: L\'adresse email de votre ami(e) doit &ecirc;tre une adresse valide.');
+define('ERROR_FROM_NAME', 'Erreur: Votre nom doit comporter au moins des caract&egrave;res.');
+define('ERROR_FROM_ADDRESS', 'Erreur: Votre adresse email doit &ecirc;tre une adresse valide.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/tell_a_friend_article.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/tell_a_friend_article.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/tell_a_friend_article.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Tell A Friend');
+
+define('HEADING_TITLE', 'Tell A Friend About \'%s\'');
+
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Your Details');
+define('FORM_TITLE_FRIEND_DETAILS', 'Your Friends Details');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Your Message');
+
+define('FORM_FIELD_CUSTOMER_NAME', 'Your Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Your E-Mail Address:');
+define('FORM_FIELD_FRIEND_NAME', 'Your Friends Name:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Your Friends E-Mail Address:');
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email about <b>%s</b> has been successfully sent to <b>%s</b>.');
+
+define('TEXT_EMAIL_SUBJECT', 'Your friend %s has recommended this great product from %s');
+define('TEXT_EMAIL_INTRO', 'Hi %s!' . "\n\n" . 'Your friend, %s, thought that you would be interested in %s from %s.');
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE', 'To view the article click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE_TEXT', 'To view the article copy and paste the link into your web browser:' . "\n\n");
+
+define('TEXT_EMAIL_SIGNATURE', 'Regards,' . "\n\n");
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: products_new.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Upcoming Products');
+define('HEADING_TITLE', 'Upcoming Products');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_MANUFACTURER', 'Manufacturer:');
+define('TEXT_PRICE', 'Price:');
+define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: login.php,v 1.15 2003/06/09 22:46:46 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+function get_ip() {
+if (isset($_SERVER)) {
+if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
+$ip = $_SERVER['HTTP_CLIENT_IP'];
+} else {
+$ip = $_SERVER['REMOTE_ADDR'];
+}
+} else {
+if ( getenv('HTTP_X_FORWARDED_FOR') ) {
+$ip = getenv('HTTP_X_FORWARDED_FOR');
+} elseif ( getenv('HTTP_CLIENT_IP') ) {
+$ip = getenv('HTTP_CLIENT_IP');
+} else {
+$ip = getenv('REMOTE_ADDR');
+}
+}
+return $ip; 
+}
+$user_ip = get_ip();
+
+
+define('NAVBAR_TITLE_1', 'Account');
+define('NAVBAR_TITLE_2', 'Account Validation');
+define('HEADING_TITLE', 'Account Validation');
+define('TEXT_MAIN', 'Do you need a new Validation Link ?');
+define('ENTRY_EMAIL_ADDRESS', 'Emailadress: ');
+define('SUCCESS_REGISTRATION_CODE_SENT', 'Your new validation code was sent. Please check your email account');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'This email address is not registered');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Your Validation Code is');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'We received a request from the IP ' . $user_ip . ' to renew your Validation Code.' . "\n\n" . 'Your Validation Code for \'' . STORE_NAME . '\' :' . "\n\n" . '%s' . "\n\n");
+define('EMAIL_PASSWORD_REMINDER_BODY2', 'Please follow this link to validate your account: %s' . "\n\n");
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/whos_onlinebox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/whos_onlinebox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/whos_onlinebox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.1 2004/05/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+define('BOX_WHOS_ONLINE_THEREIS', 'Il y a actuellement');
+define('BOX_WHOS_ONLINE_THEREARE', 'Il y a actuellement');
+define('BOX_WHOS_ONLINE_GUEST', 'invit&eacute;');
+define('BOX_WHOS_ONLINE_GUESTS', 'invit&eacute;s');
+define('BOX_WHOS_ONLINE_AND', 'et');
+define('BOX_WHOS_ONLINE_MEMBER', 'membre');
+define('BOX_WHOS_ONLINE_MEMBERS', 'membres');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: wishlist.php,v 1 2004/09/12
+
+  OS Commerce - Community Made Shopping!
+  http://www.oscommerce.com
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Ma liste');
+define('HEADING_TITLE', 'Ma Liste');
+define('BOX_TEXT_PRICE', 'Prix:');
+define('BOX_TEXT_SEND', 'Envoyer par Email votre liste à un ami.');
+define('BOX_TEXT_MOVE_TO_CART', 'Envoyer vers le panier');
+define('BOX_TEXT_DELETE', 'Effacer');
+define('BOX_TEXT_VIEW', 'Montrer');
+define('BOX_TEXT_HELP', 'Aide');
+define('BOX_TEXT_SELECTED_PRODUCTS', 'Selected Products');
+define('BOX_TEXT_SELECT_PRODUCT', 'Select Product ');
+
+define('BOX_TEXT_NO_ITEMS', 'Il n\'y a pas de produits dans votre liste. <br><br><b><a href="wishlist_help"><u>Click here</u></a> for help on using your Wishlist</b>');
+define('TEXT_WISHLIST_COUNT', 'Currently %s items are on your Wishlist.');
+define('TEXT_DISPLAY_NUMBER_OF_WISHLIST', 'Affichage <b>%d</b> à <b>%d</b> (sur <b>%d</b> produits dans votre liste)');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/wishlist_email.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/wishlist_email.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/wishlist_email.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: wishlist_email.php,v 1 2003/11/20
+
+  OS Commerce - Community Made Shopping!
+  http://www.oscommerce.com
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+
+define('NAVBAR_TITLE', 'Envoyer votre liste à un ami');
+define('HEADING_TITLE', 'Envoyer votre liste à un ami.');
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Vos d&eacute;tails personnels');
+define('FORM_FIELD_CUSTOMER_NAME', 'Votre Nom:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Votre Adresse Email:');
+define('FORM_TITLE_FRIEND_DETAILS', 'Coordonn&eacute;es de votre ami');
+define('FORM_FIELD_FRIEND_NAME', 'Nom de votre ami:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Adresse Email de votre ami:');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Votre message');
+define('FORM_FIELD_TEXT_AREA', 'Ma liste contient:'. "\n\n");
+
+define('FORM_FIELD_PRODUCTS', 'Products on my wish list'. "\n\n");
+
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email has been successfully sent to <b>%s</b> at the email adress <b>%s</b>.');
+define('TEXT_EMAIL_SUBJECT', 'Votre ami %s veut partager sa liste de chez %s');
+define('TEXT_EMAIL_INTRO', 'Bonjour %s,' . "\n\n" . '%s a cr&eacute;er une liste chez%s %s et il souhaiterais la partager avec vous.');
+define('TEXT_EMAIL_SIGNATURE', 'Cordialement,' . "\n\n");
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below :' . "\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n");
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/french/wishlist_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/wishlist_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/wishlist_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: wishlist_help.php,v 1 2002/11/09
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Liste de mes futurs achats.');
+define('HEADING_TITLE', 'Liste de mes futurs achats.');
+
+define('TEXT_CLOSE_WINDOW', '<u>Fermer la Fen&ecirc;tre</u> [x]');
+
+define('TEXT_INFORMATION', '<b>Que signifie "'. BOX_HEADING_CUSTOMER_WISHLIST .'" ?</b><br>"' .
+BOX_HEADING_CUSTOMER_WISHLIST . '" est une mani&egrave;re pour vous de garder en m&eacute;moire un article que vous voudriez acheter plus tard ou un article qui n\'est pas en stock actuellement. 
+<br>
+<br>
+<b>Comment puis-je ajouter des articles à 
+"' . BOX_HEADING_CUSTOMER_WISHLIST . '" ? </b><br>
+Pour ajouter un article à "' . BOX_HEADING_CUSTOMER_WISHLIST . '", cliquez simplement sur le bouton "Ajouter à Ma Liste" sur l\'article souhait&eacute;. Le bouton "Ajouter à Ma Liste" apparait pr&egrave;s du bouton "Ajouter Au Panier" dans la page d\'information d\'un produit.
+<br>
+<br>
+<b>Puis-je ajouter des articles "Plus en Stock" ou "Prochains articles" dans ma liste ?</b><br>
+Oui. Vous pouvez ajouter n\'importe quel article que vous choisissez à "' . BOX_HEADING_CUSTOMER_WISHLIST .
+'".<br>
+<br>
+<b>Comment voir "' . BOX_HEADING_CUSTOMER_WISHLIST . '" ?</b><br>
+Dans la colonne de droite vous pouvez apercevoir la boxe intitul&eacute;e "' . BOX_HEADING_CUSTOMER_WISHLIST . '" .  Cette boxe montre l\'&eacute;tat actuel de ' . BOX_HEADING_CUSTOMER_WISHLIST . '. S\' il y a moins de 5 articles dans ' . BOX_HEADING_CUSTOMER_WISHLIST . ', ces produits seront list&eacute;s ici.  S\'il y a plus de 5 articles, il vous sera montr&eacute; simplement la somme totale de ces articles dans ' . BOX_HEADING_CUSTOMER_WISHLIST . '.
+<br>
+<br>
+"' . BOX_HEADING_CUSTOMER_WISHLIST . '" peut &ecirc;tre vue &agrave; n\'importe quel moment en cliquant le lien pr&eacute;sent dans la boxe "' . BOX_HEADING_CUSTOMER_WISHLIST . '" (<i><u>Voir ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</i>).  ou en cliquant sur la fl&egrave;che de droite de la boxe "' . BOX_HEADING_CUSTOMER_WISHLIST . '".
+<br>
+<br>
+<b>Comment peut-on mettre "' . BOX_HEADING_CUSTOMER_WISHLIST . '" les articles vers mon panier ?</b><br>
+Pour mettre un article de "' . BOX_HEADING_CUSTOMER_WISHLIST . '" vers mon panier, vous pouvez soit cliquer sur le lien "Ajouter au panier" sous le nom du produit dans la box "' . BOX_HEADING_CUSTOMER_WISHLIST . '" (Si ' . BOX_HEADING_CUSTOMER_WISHLIST . ' les articles sont montr&eacute;s) soit cliquer "Ajouter au panier" sous l\'article pr&eacute;sent sur ' . BOX_HEADING_CUSTOMER_WISHLIST . ' de la page principale! L\'article a &eacute;t&eacute; mis dans le panier.
+<br>
+<br>
+<b>Comment puis-je supprimer les articles de la boxe "' . BOX_HEADING_CUSTOMER_WISHLIST . '" ?</b><br>
+Pour supprimer les articles de la boxe "' . BOX_HEADING_CUSTOMER_WISHLIST . '", soit cliquer sur "Supprimer de ma liste" sous le nom de l\'article dans la boxe "' . BOX_HEADING_CUSTOMER_WISHLIST . '" soit cliquer sur "Supprimer" sous l\'article "' . BOX_HEADING_CUSTOMER_WISHLIST . '" pr&eacute;sent sur la page principale. 
+<br>
+<br>
+<b> Puis-je rendre disponible ma ' . BOX_HEADING_CUSTOMER_WISHLIST . ' à d\'autres personnes? </b><br>
+D&eacute;sol&eacute;. Actuellement, cette ' . BOX_HEADING_CUSTOMER_WISHLIST . ' est uniquement disponible lorsque vous vous enregistrez sur votre compte. Donc, vous &ecirc;tes le seul à pouvoir la voir.  Cependant, vous pouvez envoyer par Email votre liste à un ami en visitant la page d\'accueil ' . BOX_HEADING_CUSTOMER_WISHLIST . ' , en &eacute;crivant leur adresse Email.
+<br>
+<br>');
+?>

Added: trunk/direct.openmoko.com/includes/languages/french/wpcallback.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french/wpcallback.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french/wpcallback.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: wpcallback.php,v MS1a 2003/04/06 21:30
+  Author :  Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.4
+
+  Revisions:
+  Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+          Now posting language code to WP, Redirect on failure now to Checkout Payment,
+      Reduced re-direct time to 8 seconds, added MD5, made callback dynamic 
+      NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+  Version 1.4 Removes boxes to prevent users from clicking away before update, 
+      Fixes currency for Yen, 
+      Redirects to Checkout_Process after 10 seconds or click by user
+  Version 1.3 Fixes problem with Multi Currency
+  Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+  Version 1.1 Added Worldpay Pre-Authorisation ability
+  Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'WorldPay');
+define('WP_TEXT_HEADING', 'Response from WorldPay:');
+define('HEADING_TITLE', 'Thank you for shopping with ' . STORE_NAME . ' .... ');
+define('WP_TEXT_SUCCESS', '... your payment was successfully received.');
+define('WP_TEXT_SUCCESS_WAIT', '<b><font color="#FF0000">Please wait...</font></b> whilst we finish processing your order.<br>If you are not automatically re-directed in 10 seconds, please click continue.');
+define('WP_TEXT_FAILURE', '... Your payment has been cancelled!');
+define('WP_TEXT_FAILURE_WAIT', '<b><font color="#FF0000">Please wait...</font></b><br>If you are not automatically re-directed in 10 seconds, please click continue.');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/french.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/french.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/french.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,662 @@
+<?php
+/*
+  $Id: english.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// look in your $PATH_LOCALE/locale directory for available locales
+// or type locale -a on the server.
+// Examples:
+// on RedHat try 'en_US'
+// on FreeBSD try 'en_US.ISO_8859-1'
+// on Windows try 'en', or 'English'
+//@setlocale(LC_TIME, 'fr');
+setlocale(LC_TIME, 'fr_FR.ISO_8859-1');
+
+
+//VVC Constants
+define('VISUAL_VERIFY_CODE_CHARACTER_POOL', 'abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789FJWNVB63HDLAJAF');  //no zeros or O
+define('VISUAL_VERIFY_CODE_CATEGORY', 'Verify security code');
+define('VISUAL_VERIFY_CODE_ENTRY_ERROR', 'The security code you entered did not match the one displayed.');
+define('VISUAL_VERIFY_CODE_ENTRY_TEXT', '*');
+define('VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS', 'Type security code here:');
+define('VISUAL_VERIFY_CODE_BOX_IDENTIFIER', '<- Security Code');
+
+define('DATE_FORMAT_SHORT', '%d/%m/%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
+define('DATE_FORMAT', 'd/m/Y'); // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+
+////
+// Return date in raw format
+// $date should be in format mm/dd/yyyy
+// raw date is in format YYYYMMDD, or DDMMYYYY
+function tep_date_raw($date, $reverse = false) {
+  if ($reverse) {
+    return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
+  }
+}
+
+// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
+define('LANGUAGE_CURRENCY', 'EUR');
+
+// Global entries for the <html> tag
+define('HTML_PARAMS','dir="LTR" lang="fr"');
+
+// charset for web pages and emails
+define('CHARSET', 'iso-8859-1');
+
+// page title
+define('TITLE', 'Nom de votre boutique, &agrave; changer dans catalog/includes/languages/french');
+
+// ######## CCGV
+define('BOX_INFORMATION_GV', 'Gift Voucher FAQ');
+define('VOUCHER_BALANCE', 'Voucher Balance');
+define('BOX_HEADING_GIFT_VOUCHER', 'Gift Voucher Account'); 
+define('GV_FAQ', 'Gift Voucher FAQ');
+define('ERROR_REDEEMED_AMOUNT', 'Congratulations, you have redeemed ');
+define('ERROR_NO_REDEEM_CODE', 'You did not enter a redeem code.');  
+define('ERROR_NO_INVALID_REDEEM_GV', 'Invalid Gift Voucher Code'); 
+define('TABLE_HEADING_CREDIT', 'Credits Available');
+define('GV_HAS_VOUCHERA', 'You have funds in your Gift Voucher Account. If you want <br>
+                         you can send those funds by <a class="pageResults" href="');
+       
+define('GV_HAS_VOUCHERB', '"><b>email</b></a> to someone'); 
+define('ENTRY_AMOUNT_CHECK_ERROR', 'You do not have enough funds to send this amount.'); 
+define('BOX_SEND_TO_FRIEND', 'Send Gift Voucher');
+
+define('VOUCHER_REDEEMED', 'Voucher Redeemed');
+define('CART_COUPON', 'Coupon :');
+define('CART_COUPON_INFO', 'more info');
+define('MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR', 'Coupon Redemption');
+define('ERROR_REDEEMED_AMOUNT_ZERO', '<BR>***HOWEVER:No reducion available, please see the coupon restrictions***');
+// header text in includes/header.php
+define('HEADER_TITLE_CREATE_ACCOUNT', 'Cr&eacute;er un compte');
+define('HEADER_TITLE_MY_ACCOUNT', 'Mon compte');
+define('HEADER_TITLE_CART_CONTENTS', 'Mon panier');
+define('HEADER_TITLE_CHECKOUT', 'Commander');
+define('HEADER_TITLE_TOP', 'Accueil');
+define('HEADER_TITLE_CATALOG', 'Catalogue');
+define('HEADER_TITLE_LOGOFF', 'Se d&eacute;connecter');
+define('HEADER_TITLE_LOGIN', 'S\'identifier');
+
+// footer text in includes/footer.php
+define('FOOTER_TEXT_REQUESTS_SINCE', 'visites depuis');
+
+// text for gender
+define('MALE', 'Monsieur');
+define('FEMALE', 'Madame');
+define('MALE_ADDRESS', 'Mr.');
+define('FEMALE_ADDRESS', 'Mme.');
+
+// text for date of birth example
+define('DOB_FORMAT_STRING', 'jj/mm/aaaa');
+
+
+// categories mainpage
+define('BOX_HEADING_CATEGORIES_MAIN_PAGE', 'Categories');
+
+
+// quick_find box text in includes/boxes/quick_find.php
+define('BOX_SEARCH_TEXT', 'Utilisez des mots clefs pour trouver le produit que vous cherchez.');
+define('BOX_SEARCH_ADVANCED_SEARCH', 'Recherche Avanc&eacute;e');
+
+
+// reviews box text in includes/boxes/reviews.php
+define('BOX_HEADING_REVIEWS', 'Commentaires');
+define('BOX_REVIEWS_WRITE_REVIEW', 'R&eacute;diger un commentaire pour ce produit!');
+define('BOX_REVIEWS_NO_REVIEWS', 'Il n\'y a actuellement aucun commentaire');
+define('BOX_REVIEWS_TEXT_OF_5_STARS', '%s de 5 &eacute;toiles!');
+
+// shopping_cart box text in includes/boxes/shopping_cart.php
+
+define('BOX_SHOPPING_CART_EMPTY', '0 produits');
+
+
+// best_sellers box text in includes/boxes/best_sellers.php
+define('BOX_HEADING_BESTSELLERS_IN', 'Meilleures Ventes Pour<br>&nbsp;&nbsp;');
+
+// notifications box text in includes/boxes/products_notifications.php
+
+define('BOX_NOTIFICATIONS_NOTIFY', 'M\'informer des mises &agrave; jour de <b>%s</b>');
+define('BOX_NOTIFICATIONS_NOTIFY_REMOVE', 'Ne pas m\'informer des mises &agrave; jour de <b>%s</b>');
+
+// manufacturer box text
+
+define('BOX_MANUFACTURER_INFO_HOMEPAGE', '%s page d\'accueil');
+define('BOX_MANUFACTURER_INFO_OTHER_PRODUCTS', 'Autres produits');
+
+// tell a friend box text in includes/boxes/tell_a_friend.php
+define('BOX_TELL_A_FRIEND_TEXT', 'Informer un(e) ami(e) de ce produit.');
+
+//BEGIN allprods modification
+define('BOX_INFORMATION_ALLPRODS', 'Voir tous les articles');
+//END allprods modification
+
+//BEGIN all categories and products modification
+define ('ALL_PRODUCTS_LINK', 'Tous les produits par catégories');
+//END categories and products modification
+
+//BEGIN all categories and products modification
+define ('ALL_PRODUCTS_MANF', 'Tous les produits par constructeur');
+//END categories and products modification
+// VJ Links Manager v1.00 begin
+define('BOX_INFORMATION_LINKS', 'Liens');
+// VJ Links Manager v1.00 end
+
+// checkout procedure text
+define('CHECKOUT_BAR_DELIVERY', 'Informations de livraison');
+define('CHECKOUT_BAR_PAYMENT', 'Informations sur le paiement');
+define('CHECKOUT_BAR_CONFIRMATION', 'Confirmation');
+define('CHECKOUT_BAR_FINISHED', 'C\'est fini!');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Veuillez s&eacute;lectionner');
+define('TYPE_BELOW', 'un type ci-dessous');
+
+// javascript messages
+define('JS_ERROR', 'Des erreurs sont apparues pendant le traitement de votre formulaire.\n\nVeuillez faire les corrections suivantes:\n\n');
+
+define('JS_REVIEW_TEXT', '* Le \'commentaire\' doit avoir au moins ' . REVIEW_TEXT_MIN_LENGTH . ' caractères.\n');
+define('JS_REVIEW_RATING', '* Vous devez évaluer le produit pour votre commentaire.\n');
+
+define('JS_ERROR_NO_PAYMENT_MODULE_SELECTED', '* Veuillez sélectionner un mode de paiement pour votre commande.\n');
+
+define('JS_ERROR_SUBMITTED', 'Ce formulaire a déjà été soumis. Veuillez cliquer sur Ok et attendre la fin du traitement.');
+
+define('ERROR_NO_PAYMENT_MODULE_SELECTED', 'Veuillez choisir un mode de paiement pour votre commande.');
+
+define('CATEGORY_COMPANY', 'Information soci&eacute;t&eacute;');
+define('CATEGORY_PERSONAL', 'Vos informations personnelles');
+define('CATEGORY_ADDRESS', 'Votre adresse');
+define('CATEGORY_CONTACT', 'Vos informations de contact');
+define('CATEGORY_OPTIONS', 'Options');
+define('CATEGORY_PASSWORD', 'Votre mot de passe');
+
+define('ENTRY_COMPANY', 'Nom de la soci&eacute;t&eacute;:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Civilités:');
+define('ENTRY_GENDER_ERROR', 'Veuillez sélectionner les civilités.');
+define('ENTRY_GENDER_TEXT', '*');
+define('ENTRY_FIRST_NAME', 'Votre Pr&eacute;nom:');
+define('ENTRY_FIRST_NAME_ERROR', 'Votre prénom doit contenir un minimum de ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' caractères.');
+define('ENTRY_FIRST_NAME_TEXT', '*');
+define('ENTRY_LAST_NAME', 'Votre Nom:');
+define('ENTRY_LAST_NAME_ERROR', 'Votre Nom doit contenir un minimum de ' . ENTRY_LAST_NAME_MIN_LENGTH . ' caractères.');
+define('ENTRY_LAST_NAME_TEXT', '*');
+define('ENTRY_DATE_OF_BIRTH', 'Date de naissance:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', 'Votre date de naissance doit être au format: JJ/MM/AAAA (ex 03/02/1961)');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '* (ex. 03/02/1961)');
+define('ENTRY_EMAIL_ADDRESS', 'Votre adresse email:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', 'Votre adresse email doit contenir un minimum de ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' caractères.');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', 'Votre adresse email ne semble pas valide - Veuillez faire les corrections nécessaires.');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', 'Votre adresse email figure déjà dans notre base de données - Veuillez vous identifier avec cette adresse ou alors créer un nouveau compte avec une adresse email différente.');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '*');
+define('ENTRY_STREET_ADDRESS', 'Rue:');
+define('ENTRY_STREET_ADDRESS_ERROR', 'Votre Rue doit contenir un minimum de ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' caractères.');
+define('ENTRY_STREET_ADDRESS_TEXT', '*');
+define('ENTRY_SUBURB', 'Quartier:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Code postal:');
+define('ENTRY_POST_CODE_ERROR', 'Votre code postal doit contenir un minimum de ' . ENTRY_POSTCODE_MIN_LENGTH . ' caractères.');
+define('ENTRY_POST_CODE_TEXT', '*');
+define('ENTRY_CITY', 'Ville:');
+define('ENTRY_CITY_ERROR', 'Votre ville doit contenir un minimum de ' . ENTRY_CITY_MIN_LENGTH . ' caractères.');
+define('ENTRY_CITY_TEXT', '*');
+define('ENTRY_STATE', 'N&deg; d&eacute;part./Etat:');
+define('ENTRY_STATE_ERROR', 'Votre N° de départ/Etat doit contenir un minimum de ' . ENTRY_STATE_MIN_LENGTH . ' caractères.');
+define('ENTRY_STATE_ERROR_SELECT', 'Veuillez sélectionner un N° départ./Etat à partir de la liste déroulante.');
+define('ENTRY_STATE_TEXT', '*');
+define('ENTRY_COUNTRY', 'Pays:');
+define('ENTRY_COUNTRY_ERROR', 'Vous devez sélectionner un pays dans la liste déroulante.');
+define('ENTRY_COUNTRY_TEXT', '*');
+define('ENTRY_TELEPHONE_NUMBER', 'Num&eacute;ro de t&eacute;l&eacute;phone:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', 'Votre N° de téléphone doit contenir un minimum de ' . ENTRY_TELEPHONE_MIN_LENGTH . ' caractères.');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');
+define('ENTRY_FAX_NUMBER', 'Num&eacute;ro de Fax:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Lettre d\'information:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'Je veux souscrire');
+define('ENTRY_NEWSLETTER_NO', 'Je ne veux pas souscrire');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Mot de passe:');
+define('ENTRY_PASSWORD_ERROR', 'Votre mot de passe doit contenir un minimum de ' . ENTRY_PASSWORD_MIN_LENGTH . ' caractères.');
+define('ENTRY_PASSWORD_ERROR_NOT_MATCHING', 'La confirmation du mot de passe doit correspondre au mot de passe saisi pr&eacute;c&eacute;demment.');
+define('ENTRY_PASSWORD_TEXT', '*');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Confirmation du mot de passe:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT', 'Mot de passe actuel:');
+define('ENTRY_PASSWORD_CURRENT_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT_ERROR', 'Votre mot de passe doit contenir un minimum de ' . ENTRY_PASSWORD_MIN_LENGTH . ' caractères.');
+define('ENTRY_PASSWORD_NEW', 'Nouveau mot de passe:');
+define('ENTRY_PASSWORD_NEW_TEXT', '*');
+define('ENTRY_PASSWORD_NEW_ERROR', 'Votre nouveau mot de passe doit contenir un minimum de ' . ENTRY_PASSWORD_MIN_LENGTH . ' caractères.');
+define('ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING', 'La confirmation du mot de passe doit correspondre au nouveau mot de passe saisi.');
+define('PASSWORD_HIDDEN', '--Masqu&eacute;--');
+
+define('FORM_REQUIRED_INFORMATION', '* Informations n&eacute;cessaires');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_RESULT_PAGE', 'Page de r&eacute;sultats:');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Afficher <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> produits)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS', 'Afficher <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> commandes)');
+define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', 'Afficher <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> commentaires)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW', 'Afficher <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> nouveaux produits)');
+define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Afficher <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> promotions)');
+define('TEXT_DISPLAY_NUMBER_OF_FEATURED', 'Afficher <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> produits d&eacute;crits)');
+
+define('PREVNEXT_TITLE_FIRST_PAGE', 'Premi&egrave;re page');
+define('PREVNEXT_TITLE_PREVIOUS_PAGE', 'Page Pr&eacute;c&eacute;dente');
+define('PREVNEXT_TITLE_NEXT_PAGE', 'Page Suivante');
+define('PREVNEXT_TITLE_LAST_PAGE', 'Derni&egrave;re Page');
+define('PREVNEXT_TITLE_PAGE_NO', 'Page %d');
+define('PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE', 'Groupe pr&eacute;c&eacute;dent de %d Pages');
+define('PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE', 'Groupe suivant de %d Pages');
+define('PREVNEXT_BUTTON_FIRST', '&lt;&lt;Premier');
+define('PREVNEXT_BUTTON_PREV', '[&lt;&lt;&nbsp;Prec]');
+define('PREVNEXT_BUTTON_NEXT', '[Suiv&nbsp;&gt;&gt;]');
+define('PREVNEXT_BUTTON_LAST', 'Derni&egrave;re&gt;&gt;');
+
+define('IMAGE_BUTTON_ADD_ADDRESS', 'Ajouter une adresse');
+define('IMAGE_BUTTON_ADDRESS_BOOK', 'Carnet d\'adresse');
+define('IMAGE_BUTTON_BACK', 'Retour');
+define('IMAGE_BUTTON_BUY_NOW', 'Acheter maintenant');
+define('IMAGE_BUTTON_CHANGE_ADDRESS', 'Changer l\'adresse');
+define('IMAGE_BUTTON_CHECKOUT', 'Confirmation');
+define('IMAGE_BUTTON_CONFIRM_ORDER', 'Valider la commande');
+define('IMAGE_BUTTON_CONTINUE', 'Continuer');
+define('IMAGE_BUTTON_CONTINUE_SHOPPING', 'Continuer vos achats');
+define('IMAGE_BUTTON_DELETE', 'Supprimer');
+define('IMAGE_BUTTON_EDIT_ACCOUNT', 'Editer mon compte');
+define('IMAGE_BUTTON_HISTORY', 'Historique des commandes');
+define('IMAGE_BUTTON_LOGIN', 'S\'inscrire');
+define('IMAGE_BUTTON_IN_CART', 'Ajouter au panier');
+define('IMAGE_BUTTON_NOTIFICATIONS', 'Mon avis');
+define('IMAGE_BUTTON_QUICK_FIND', 'Trouver rapidement');
+define('IMAGE_BUTTON_REMOVE_NOTIFICATIONS', 'Supprimer mon avis');
+define('IMAGE_BUTTON_REVIEWS', 'Commentaires');
+define('IMAGE_BUTTON_SEARCH', 'Rechercher');
+define('IMAGE_BUTTON_SHIPPING_OPTIONS', 'Options de Livraison');
+define('IMAGE_BUTTON_TELL_A_FRIEND', 'Informer un(e) ami(e)');
+define('IMAGE_BUTTON_UPDATE', 'Mise &agrave; jour');
+define('IMAGE_BUTTON_UPDATE_CART', 'Mettre &agrave; jour le panier');
+define('IMAGE_BUTTON_WRITE_REVIEW', 'R&eacute;diger un commentaire');
+
+define('SMALL_IMAGE_BUTTON_DELETE', 'Supprimer');
+define('SMALL_IMAGE_BUTTON_EDIT', 'Editer');
+define('SMALL_IMAGE_BUTTON_VIEW', 'Voir');
+
+define('ICON_ARROW_RIGHT', 'plus');
+define('ICON_CART', 'Dans le panier');
+define('ICON_ERROR', 'Erreur');
+define('ICON_SUCCESS', 'Succ&egrave;s');
+define('ICON_WARNING', 'Attention');
+
+define('TEXT_CUSTOMER_GREETING_HEADER', 'Bienvenue &agrave; nos clients');
+define('TEXT_GREETING_PERSONAL', 'Soyez le bienvenu <span class="greetUser">%s</span>, voulez-vous prendre connaissance des <a href="%s"><u>nouveaux produits</u></a> mis en vente ?');
+define('TEXT_GREETING_PERSONAL_RELOGON', '<small>Si vous n\'&ecirc;tes pas %s, veuillez <a href="%s"><u>vous identifier &agrave; nouveau</u></a> avec votre propre compte.</small>');
+define('TEXT_GREETING_GUEST', 'Bonjour et Bienvenue <span class="greetUser">cher visiteur</span>, voulez vous vous <a href="%s"><u>identifier</u></a> ou d&eacute;sirez vous <a href="%s"><u>cr&eacute;er votre compte</u></a> ?');
+
+define('TEXT_SORT_PRODUCTS', 'Produits tri&eacute;s  ');
+define('TEXT_DESCENDINGLY', 'D&eacute;croissant');
+define('TEXT_ASCENDINGLY', 'Croissant');
+define('TEXT_BY', ' par ');
+
+define('TEXT_REVIEW_BY', 'par %s');
+define('TEXT_REVIEW_WORD_COUNT', '%s mots');
+define('TEXT_REVIEW_RATING', 'Ratio: %s [%s]');
+define('TEXT_REVIEW_DATE_ADDED', 'Ajout&eacute; le : %s');
+define('TEXT_NO_REVIEWS', 'Actuellement, aucun commentaire n\'est disponible.');
+
+define('TEXT_NO_NEW_PRODUCTS', 'Actuellement, aucun produit n\'est disponible.');
+
+define('TEXT_NO_PRODUCTS', 'Actuellement, aucun produit n\'est disponible dans cette gamme.');
+
+define('TEXT_UNKNOWN_TAX_RATE', 'Taux de taxe inconnue');
+
+define('TEXT_REQUIRED', '<span class="errorText">Obligatoire</span>');
+
+// Down For Maintenance
+define('TEXT_BEFORE_DOWN_FOR_MAINTENANCE', 'ATTENTION: Ce site Internet sera en maintenance &agrave; partir de : ');
+define('TEXT_ADMIN_DOWN_FOR_MAINTENANCE', 'ATTENTION: Ce site Internet est &agrave; l\'heure actuelle indisponible pour des raisons de maintenance');
+
+define('ERROR_TEP_MAIL', '<font face="Verdana, Arial" size="2" color="#ff0000"><b><small>TEP ERROR:</small> Impossible d\'envoyer des emails avec la configuration actuelle du serveur SMTP. Veuillez v&eacute;rifier les r&eacute;glages de votre php.ini et corriger le serveur SMTP si n&eacute;cessaire.</b></font>');
+define('WARNING_INSTALL_DIRECTORY_EXISTS', 'Attention : Le r&eacute;pertoire d\'installation existe &agrave; : ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install. Pour des raisons de s&eacute;curit&eacute;, veuillez supprimer ce dossier.');
+define('WARNING_CONFIG_FILE_WRITEABLE', 'Attention : Je suis en mesure d\'&eacute;crire sur votre fichier configure.php &agrave; : ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php. Veuillez SVP faire un CHMOD 444 sur ce fichier pour r&eacute;duire les risques et am&eacute;liorer la s&eacute;curit&eacute;.');
+define('WARNING_SESSION_DIRECTORY_NON_EXISTENT', 'Attention : Le r&eacute;pertoire des sessions n\'existe pas : ' . tep_session_save_path() . '. L\'enregistrement des sessions ne pourra se faire tant que le r&eacute;pertoire ne sera pas cr&eacute;&eacute;.');
+define('WARNING_SESSION_DIRECTORY_NOT_WRITEABLE', 'Attention : Je ne suis pas en mesure d\'&eacute;crire dans le r&eacute;pertoire de sessions : ' . tep_session_save_path() . '. Les sessions ne seront pas disponibles tant que ce r&eacute;pertoire n\'aura pas les bonnes permissions (CHMOD 777).');
+define('WARNING_SESSION_AUTO_START', 'Attention: session.auto_start est activ&eacute; - Veuillez d&eacute;sactiver cette fonction de php dans php.ini et redemarrer le serveur web.');
+define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Attention : Le r&eacute;pertoire de t&eacute;l&eacute;chargement des produits n\'existe pas : ' . DIR_FS_DOWNLOAD . '. Le t&eacute;l&eacute;chargement de produits ne fonctionnera pas tant que le r&eacute;pertoire se sera pas cr&eacute;&eacute;.');
+define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Warning: The downloadable products directory does not exist: ' . DIR_FS_DOWNLOAD . '. Downloadable products will not work until this directory is valid.');
+define('WARNING_ENCRYPT_FILE_MISSING', 'Warning: The Encryption key file is missing.');
+
+
+define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'Error: 01 The first four digits of the number entered are: %s If that number is correct, we do not accept that type of credit card.If it is wrong, please try again.');
+define('TEXT_CCVAL_ERROR_INVALID_MONTH', 'Error: 02 The expiry date Motnth entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_YEAR', 'Error: 03 The expiry date year entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Error: 04 The expiry date entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 05 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_SHORT', 'Error: 06 You have not entered the correct amount of digits. Please ensure you have entered all of the long number displayed on the front of your card');
+define('TEXT_CCVAL_ERROR_BLACKLIST', 'Error: 07 We cannot accept your card as it is blacklisted, if you feel you have recieved this message in error please contact your card issuer.');
+define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'Error: 08 The CCV/CVV/CID number entered is the incorrect length. Please try again.');
+define('TEXT_CCVAL_ERROR_NOT_ACCEPTED', 'Error: 09 The credit card number you have entered appears to be a %s card. Unfortunately at this time we do not accept %s as payment.');
+define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Error: 10 The credit card number entered is invalid. Please check the number for misstyped numbers and try again.');
+
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default Chainreaction-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+define('FOOTER_TEXT_BODY', 'Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a> and <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.creloaded.com" target="_blank">CRE Loaded Team</a><br><font color="blue"> Traduction française par uurbana, thdt98, jeanmarie et cyberghost</font><br>Using Version ' . PROJECT_VERSION);
+/////////////////////////////////////////////////////////////////////
+// HEADER.PHP
+// Header Links
+define('HEADER_LINKS_DEFAULT','ACCUEIL');
+define('HEADER_LINKS_WHATS_NEW','NOUVEAUTES');
+define('HEADER_LINKS_SPECIALS','PROMOTIONS');
+define('HEADER_LINKS_REVIEWS','COMMENTAIRES');
+define('HEADER_LINKS_LOGIN','S\'IDENTIFIER');
+define('HEADER_LINKS_LOGOFF','SE DECONNECTER');
+define('HEADER_LINKS_PRODUCTS_ALL','CATALOGUE');
+define('HEADER_LINKS_ACCOUNT_INFO','INFORMATION COMPTE');
+define('HEADER_LINKS_LINKS','LIENS');
+define('HEADER_LINKS_FAQ','FAQS');
+define('HEADER_LINKS_NEWS','NEWS');
+define('HEADER_LINKS_INFORMATION','INFORMATION');
+/////////////////////////////////////////////////////////////////////
+
+// BOF: Lango added for print order mod
+define('IMAGE_BUTTON_PRINT_ORDER', 'Commande imprimable');
+// EOF: Lango added for print order mod
+
+// WebMakers.com Added: Attributes Sorter
+require(DIR_WS_LANGUAGES . $language . '/' . 'attributes_sorter.php');
+
+// wishlist box text in includes/boxes/wishlist.php
+define('BOX_HEADING_CUSTOMER_WISHLIST', 'Mes futurs achats');
+define('BOX_WISHLIST_EMPTY', 'Vous n\'avez pas d\'article dans votre liste des futurs achats');
+define('IMAGE_BUTTON_ADD_WISHLIST', 'Ajouter &agrave; ma liste d\'achats futurs');
+define('TEXT_WISHLIST_COUNT', 'Actuellement %s articles sont dans votre liste d\'achat futurs.');
+define('TEXT_DISPLAY_NUMBER_OF_WISHLIST', 'Afficher <b>%d</b> &agrave; <b>%d</b> (de <b>%d</b> articles de votre liste des futurs achats)');
+define('BOX_HEADING_CUSTOMER_WISHLIST_HELP', 'Aide sur "mes futurs achats"');
+define('BOX_HEADING_SEND_WISHLIST', 'Envoyer mes futurs achats');
+define('BOX_TEXT_MOVE_TO_CART', 'Envoyer vers Panier');
+define('BOX_TEXT_DELETE', 'Effacer');
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+  define('BOX_HEADING_INFORMATION', 'Info système');
+  define('BOX_INFORMATION_MANAGER', 'Configurer Info');
+//DWD Modify End
+
+if(file_exists('includes/languages/english_newsdesk.php')) {
+include('includes/languages/french_newsdesk.php');
+include('includes/languages/french_faqdesk.php');
+}
+
+/*Begin Checkout Without Account images*/
+define('IMAGE_BUTTON_CREATE_ACCOUNT', 'Créer Compte');
+define('NAV_ORDER_INFO', 'Information Commande');
+/*End Checkout WIthout Account images*/
+
+// Include for Events Calendar 2.0 Contribution 
+define('BOX_TOOLS_EVENTS_MANAGER', 'Events Manager');
+define('IMAGE_NEW_EVENT', 'New Event');
+
+// VJ guest pricing begin
+// ADDED for Viewprice
+// Text to replace price in InfoBoxes
+define('PRICES_LOGGED_IN_TEXT', 'Trade Price');
+// Text to replace price in Product Info, Specials & New Products lists
+define('PRICES_LOGGED_IN_SUBMIT','Trade Price');
+// Text to replace Buy 'Now button'
+define('PRICES_LOGGED_IN_BUY_TEXT', 'Trade Only');
+// END ViewPrice
+// VJ guest pricing end
+
+//Added for FAQ System 2.1 DMG
+
+  define('BOX_INFORMATION_FAQ', 'FAQ');
+
+//Added for Article Manager DMG
+
+// Article Manager
+define('BOX_HEADING_ARTICLES', 'Articles');
+define('BOX_ALL_ARTICLES', 'All Articles');
+define('BOX_NEW_ARTICLES', 'New Articles');
+define('TEXT_DISPLAY_NUMBER_OF_ARTICLES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> articles)');
+define('TEXT_DISPLAY_NUMBER_OF_ARTICLES_NEW', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> new articles)');
+define('TABLE_HEADING_AUTHOR', 'Author');
+define('TABLE_HEADING_ABSTRACT', 'Abstract');
+define('BOX_HEADING_AUTHORS', 'Articles by Author');
+define('NAVBAR_TITLE_DEFAULT', 'Articles');
+define('BOX_ASEARCH_TEXT','Search Articles Text');
+// Eversun mod for sppc and qty price breaks
+define('ENTRY_COMPANY_TAX_ID', 'Company\'s tax id number:');
+define('ENTRY_COMPANY_TAX_ID_ERROR', '');
+define('ENTRY_COMPANY_TAX_ID_TEXT', '');
+// Eversun mod end for sppc and qty price breaks  
+
+
+#################    Starts - 15 June 2006    #################
+
+
+define('IFRAME_ERROR','Sorry, you browser does not support iframes.');
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_1","You still have</br>");
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_2","</br>left to spend in your Gift Voucher Account<br><br>");
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_3","Send to a Friend");
+define("DONATE_BUTTON_IMAGE_ALT","Make payments with PayPal - it\'s fast, free and secure");
+
+
+#################    Ends - 15 June 2006    #################
+
+
+#################    Starts - 16 June 2006    #################
+
+
+define("LOGIN_ALT","login");
+define("LOGOFF_ALT","logoff");
+define("MYACCOUNT_ALT","MyAccount");
+define("SPECIALS_ALT","Specials");
+define("WHATS_NEW_ALT","What\'s New");
+define("CONTACT_US_ALT","Contact Us");
+define("IMAGE_ALT","image");
+define("BOX_ALT","box");
+
+#################    Ends - 16 June 2006    #################
+
+
+#################    Starts - 20 June 2006    #################
+
+//dayNames in calender
+define("S","S");
+define("M","M");
+define("T","T");
+define("W","W");
+define("T","T");
+define("F","F");
+define("S","S");
+
+//monthNames  in calender
+define("JANUARY","JANUARY");
+define("FEBRUARY","FEBRUARY");
+define("MARCH","MARCH");
+define("APRIL","APRIL");
+define("MAY","MAY");
+define("JUNE","JUNE");
+define("JULY","JULY");
+define("AUGUST","AUGUST");
+define("SEPTEMBER","SEPTEMBER");
+define("OCTOBER","OCTOBER");
+define("NOVEMBER","NOVEMBER");
+define("DECEMBER","DECEMBER");
+
+
+
+define("DELETE_CACHE_FILES",'cache files deleted - top level');
+define("UPDATE_CONFIGURATION_SETTING",'reset to false');
+define("UPDATE_CONFIG_FILES_EXIST",'configuration cache files updated');
+define("UPDATE_CONFIG_FILES_NOTEXIST",'ERROR: update file does not exist');
+define("IS_GUEST_CHECK",'customer_id not set');
+define("FILE_EXISTS_AND_IS_NOT_EXPIRED",'file exists and is not expired');
+define("NO_FILE_OR_EXPIRED",'file does not exist or is expired');
+define("OB_STARTED",'ob started @ ');
+define("IS_GUESS_CHECK_END",'customer_id not set ');
+define("OB_COMPRESSED",'output buffer flushed and compressed');
+define("CACHE_OUTPUTT",'compressed ob sent to screen');
+define("CACHE_WRITE_FILE",'compressed ob written to file');
+define("UNSET_CACHE_COMPRESS", 'cache compress unset');
+define("COMPRESS_BUFFER", 'compressing buffer');
+define("CACHE_FILE_WRITE", 'buffer writtent to file');
+define("CACHE_UNSET_WRITE_BUFFER", 'write buffer unset');
+define("OUTPUT_2_SCREEN", 'successfully output to screen');
+define("CACHE_UNSET_SCREEN_BUFFER", 'screen buffer unset');
+
+define("OPEN_SESSION_FILE_ERROR", 'Could not open session file');
+define("WRITE_SESSION_FILE_ERROR", 'Could not write session file');
+define("SESSION_MODULE_ERROR", 'Failed to initialize session module.');
+define("SESSION_NOT_SAVED", 'Session could not be saved.');
+define("SESSION_NOT_CLOSED", 'Session could not be closed.');
+define("SESSION_NOT_STARTED", 'Session could not be started.');
+
+///
+define("NO_BANNER_WITH_GROUP_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_GROUP_ERROR2", 'No banners with group');
+define("NO_BANNER_WITH_GROUP_ERROR3", ' found!</b>');
+define("NO_BANNER_WITH_ID_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_ID_ERROR2", 'Banner with ID');
+define("NO_BANNER_WITH_ID_ERROR3", ' not found, or status inactive</b>');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR2", 'Unknown');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR3", 'parameter value - it must be either');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR4", 'dynamic');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR5", 'static');
+define("TEP_DB_ERRORR", '[TEP STOP]');
+define("TEP_HREF_LINK_ERROR1", '<b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
+define("TEP_HREF_LINK_ERROR2", '<b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
+
+///
+
+#################    Ends - 20 June 2006    #################
+
+
+#################    Starts - 21 June 2006    #################
+
+
+
+define("CVV_HELP_TITLE","Card Verification Value (ccv/cvc/ccv2/cid) Help");
+define("CVV_HELP_DESC1","<p><strong>What is a Card Verification Value (ccv/cvc/ccv2/cid)?</strong>
+      </p>
+      <p>The Card Verification Value (ccv/cvc/ccv2/cid) is a 3-digit number found on the signature
+        panel on the back of your credit card. It is an additional safeguard that
+        helps us validate your purchase and protect against fraud. It is not contained
+        in the magnetic stripe information and is therefore not printed on sales
+        receipts.</p>
+      <p><strong>Where is the ccv/cvc/ccv2/cid located?</strong></p>");
+
+
+define("CVV_HELP_DESC2","<p><strong>VISA, MASTERCARD,  DISCOVERY &amp; most other cards</strong><br>
+        You can find your card verification code on the reverse side of your credit
+        card, printed into the signature field. It is a 3-digit group for MasterCard,
+        Visa, Discovery, and most other cards.<br>
+      </p> ");
+
+
+define("CVV_HELP_DESC3","<p><strong>AMERICAN EXPRESS</strong><br>
+        The American Express Card verification code is a 4-digit number printed
+        on the front of your card. It appears after and to the right (above) of
+        your card number.<br>
+      </p>");
+
+
+#################    Start - 23 June 2006   #################
+
+define("INFO_CC_1","Make Shopping Easier for Customers with Website Payments");
+define("INFO_CC_2",''.tep_image(DIR_WS_MODULES . 'payment/paypal/images/hdr_ppGlobev4_160x76.gif',' PayPal ','','','align=right valign="top" style="margin: 10px;"').'
+PayPal has optimized their checkout experience by launching an exciting new improvement to their payment flow.
+<br/><br/>For new buyers, signing up for a PayPal account is now optional. This means you can complete your payment first, and then decide whether to save your information for future purchases.
+<p>To pay by credit card, look for this button:<br/>
+<p align="center">'.tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-ContinueCheckout.gif','','','').'</p>
+<br/>
+Or you may see this:<br/>
+<p align="center">'.tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-no-account-Click-Here.gif','','','').'</p>
+<br/>
+One of these options should appear on the first PayPal screen.<br/>
+<p>Note: if you are a PayPal member, you can either use your account,
+or use a credit card that is not associated with a PayPal account.
+In that case you\'d also need to use an email address that\'s not associated with a PayPal account.</p> ');
+
+
+define("PAYPAL_SHOPPING_CART_IPN_SUBJECT","PayPal_Shopping_Cart_IPN");
+define("PAYPAL_SHOPPING_CART_IPN_FROM","PayPal_Shopping_Cart_IPN");
+
+#################    End - 23 June 2006   #################
+
+
+#################    Start - 28 June 2006   #################
+
+define("BOX_HEADING_CUSTOMER_WISHLIST_VIEW","My Wishlist View");
+define("BOX_HEADING_CUSTOMER_WISHLIST_HELP","My Wishlist Help");
+
+#################    End - 28 June 2006   #################
+
+
+#################    Start - 29 June 2006   #################
+
+
+define("VIEWPRICE_ERROR",'You must be logged in to search for prices.');
+
+define("UNABLE_TO_CONNECT_TO_DATABASE_SERVER",'Unable to connect to database server!');
+define("AFFILIATE_SHOW_BANNER_CHECK_PATHES",'Check the pathes! (catalog/includes/configure.php)');
+define("AFFILIATE_SHOW_BANNER_ABSOLUTE_PATH",'absolute path to picture:');
+define("AFFILIATE_SHOW_BANNER_BUILD_WITH_1",'build with:');
+define("AFFILIATE_SHOW_BANNER_BUILD_WITH_2",'DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG . DIR_WS_IMAGES . $banner');
+define("AFFILIATE_SHOW_BANNER_DIR_FS_DOCUMENT_ROOT",'DIR_FS_DOCUMENT_ROOT');
+define("AFFILIATE_SHOW_BANNER_DIR_WS_CATALOG",'DIR_WS_CATALOG');
+define("AFFILIATE_SHOW_BANNER_DIR_WS_IMAGES",'DIR_WS_IMAGES');
+define("AFFILIATE_SHOW_BANNER_BANNER",'$banner');
+define("AFFILIATE_SHOW_BANNER_SQL_QUERY_USED",'SQL-Query used:');
+define("AFFILIATE_SHOW_BANNER_TRY_TO_FIND_ERROR",'Try to find error:');
+define("AFFILIATE_SHOW_BANNER_SQL_QUERY",'SQL-Query:');
+define("AFFILIATE_SHOW_BANNER_LOCATING_PIC",'Locating Pic');
+
+
+#################    End - 29 June 2006   #################
+
+#################    End - 01 July 2006   #################
+
+define("PAYPAL_NOTIFY_IPN_TEST_1","TEST IPN Processed for order #");
+define("PAYPAL_NOTIFY_IPN_TEST_2","You need to specify an order #");
+define("PAYPAL_NOTIFY_RECEIVED_ERROR_1","Error: no valid ");
+define("PAYPAL_NOTIFY_RECEIVED_ERROR_2"," received.");
+
+define('TEXT_CLOSE_WINDOW', 'Close Window');
+
+
+#################    End - 01 July 2006   #################
+
+define("TEXT_YOUR_CONTENT_HERE","Your Content here");
+define("TEXT_NO_SPECIALS","There are currently no specials defined.");
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/account.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: account.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Ihr Konto');
+define('HEADING_TITLE', 'Ihre pers&ouml;nlichen Daten');
+
+define('OVERVIEW_TITLE', '&Uuml;bersicht');
+define('OVERVIEW_SHOW_ALL_ORDERS', '(alle Bestellungen anzeigen)');
+define('OVERVIEW_PREVIOUS_ORDERS', 'Bisherige Bestellungen');
+
+define('MY_ACCOUNT_TITLE', 'Ihr Konto');
+define('MY_ACCOUNT_INFORMATION', 'Meine Kontoinformationen anzeigen oder &auml;ndern');
+define('MY_ACCOUNT_ADDRESS_BOOK', 'Adressbucheintr&auml;ge anzeigen oder &auml;ndern');
+define('MY_ACCOUNT_PASSWORD', 'Mein Passwort &auml;ndern');
+
+define('MY_ORDERS_TITLE', 'Meine Bestellungen');
+define('MY_ORDERS_VIEW', 'Meine bisherigen Bestellungen anzeigen');
+
+define('EMAIL_NOTIFICATIONS_TITLE', 'E-Mail Benachrichtigungen');
+define('EMAIL_NOTIFICATIONS_NEWSLETTERS', 'Newsletter abonnieren oder abbestellen.');
+define('EMAIL_NOTIFICATIONS_PRODUCTS', 'Meine Produktbenachrichtigungen anzeigen oder &auml;ndern.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/account_edit.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/account_edit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/account_edit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: account_edit.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Ihr Konto');
+define('NAVBAR_TITLE_2', 'Ihre pers&ouml;nlichen Daten &auml;ndern');
+
+define('HEADING_TITLE', 'Ihre pers&ouml;nlichen Daten &auml;ndern');
+
+define('MY_ACCOUNT_TITLE', 'Ihr Konto');
+
+define('SUCCESS_ACCOUNT_UPDATED', 'Ihre Daten wurden erfolgreich aktualisiert!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/account_history.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/account_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/account_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: account_history.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Ihr Konto');
+define('NAVBAR_TITLE_2', 'Ihre get&auml;tigten Bestellungen');
+
+define('HEADING_TITLE', 'Ihre get&auml;tigten Bestellungen');
+
+define('TEXT_ORDER_NUMBER', 'Bestellnummer:');
+define('TEXT_ORDER_STATUS', 'Bestellstatus:');
+define('TEXT_ORDER_DATE', 'Bestelldatum:');
+define('TEXT_ORDER_SHIPPED_TO', 'Lieferanschrift:');
+define('TEXT_ORDER_BILLED_TO', 'Rechnungsanschrift:');
+define('TEXT_ORDER_PRODUCTS', 'Artikel:');
+define('TEXT_ORDER_COST', 'Summe:');
+define('TEXT_VIEW_ORDER', 'Bestellung ansehen');
+
+define('TEXT_NO_PURCHASES', 'Sie haben noch keine Bestellungen get&auml;tigt.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/account_history_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/account_history_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/account_history_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: account_history_info.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Ihr Konto');
+define('NAVBAR_TITLE_2', 'Get&auml;tigte Bestellung');
+define('NAVBAR_TITLE_3', 'Bestellnummer %s');
+
+define('HEADING_TITLE', 'Bestellinformationen');
+
+define('HEADING_ORDER_NUMBER', 'Bestellnummer %s');
+define('HEADING_ORDER_DATE', 'Bestelldatum:');
+define('HEADING_ORDER_TOTAL', 'Summe:');
+
+define('HEADING_DELIVERY_ADDRESS', 'Lieferanschrift');
+define('HEADING_SHIPPING_METHOD', 'Versandart');
+
+define('HEADING_PRODUCTS', 'Artikel');
+define('HEADING_OPTIONS', 'Option\'s');
+define('HEADING_PRODUCTS_BASE_PRICE', 'Base');
+define('HEADING_PRODUCTS_FINAL_PRICE', 'Final');
+define('HEADING_TAX', 'MwSt.');
+define('HEADING_TOTAL', 'Summe');
+
+define('HEADING_BILLING_INFORMATION', 'Rechnungsinformationen');
+define('HEADING_BILLING_ADDRESS', 'Rechnungsadresse');
+define('HEADING_PAYMENT_METHOD', 'Zahlungsweise');
+
+define('HEADING_ORDER_HISTORY', 'Bestellhistorie');
+define('HEADING_COMMENT', 'Kommentar');
+define('TEXT_NO_COMMENTS_AVAILABLE', 'Kein Kommentar vorhanden.');
+
+define('TABLE_HEADING_DOWNLOAD_DATE', 'Herunterladen m&ouml;glich bis:');
+define('TABLE_HEADING_DOWNLOAD_COUNT', 'max. Anz. Downloads');
+define('HEADING_DOWNLOAD', 'Artikel herunterladen:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/account_newsletters.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/account_newsletters.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/account_newsletters.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: account_newsletters.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Ihr Konto');
+define('NAVBAR_TITLE_2', 'Newsletter Abonnements');
+
+define('HEADING_TITLE', 'Newsletter Abonnements');
+
+define('MY_NEWSLETTERS_TITLE', 'Meine Newsletter Abonnements');
+define('MY_NEWSLETTERS_GENERAL_NEWSLETTER', 'Allgmeiner Newsletter');
+define('MY_NEWSLETTERS_GENERAL_NEWSLETTER_DESCRIPTION', 'Beinhaltet allgemeine Nachrichten &uuml;nseren Shop, Informationen &uuml;ber neue Artikel, Sonderangebote und andere Informationen von allgemeinem Interesse.');
+
+define('SUCCESS_NEWSLETTER_UPDATED', 'Ihre Newsletter Abonnements wurden erfolgreich aktualisiert!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/account_notifications.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/account_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/account_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: account_notifications.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Ihr Konto');
+define('NAVBAR_TITLE_2', 'Produktbenachrichtungen');
+
+define('HEADING_TITLE', 'Produktbenachrichtigungen');
+
+define('MY_NOTIFICATIONS_TITLE', 'Meine Produktbenachrichtigungen');
+define('MY_NOTIFICATIONS_DESCRIPTION', 'Diese Benachrichtigungen erlabuben es Ihnen, &uuml;ber alle &Auml;nderungen an einem Artikel informiert zu werden.<br><br>Wenn Sie Benachrichtigungen f&uuml; unser komplettes Angebot erhalten wollen, sollten Sie die allgemeinen Benachrichtigungen aktivieren.');
+
+define('GLOBAL_NOTIFICATIONS_TITLE', 'Allgemeine Benachrichtungen');
+define('GLOBAL_NOTIFICATIONS_DESCRIPTION', '&Uuml;ber alle &Auml;nderungen informiert werden.');
+
+define('NOTIFICATIONS_TITLE', 'Produktspezifische Benachrichtungen.');
+define('NOTIFICATIONS_DESCRIPTION', 'Um eine aktivierte Benachrichtigung zu entfernen, einfach die Checkbox deaktivieren und auf den <b>Weiter<b>-Button klicken.');
+define('NOTIFICATIONS_NON_EXISTING', 'Sie haben momentan keine Prouktbenachrichtigungen aktiviert.<br><br>Wenn Sie Produktbenachrichtigungen aktivieren wollen, k&ouml;nnen Sie dies direkt auf der Artikelseite aktivieren.');
+
+define('SUCCESS_NOTIFICATIONS_UPDATED', 'Ihre Produktbenachrichtigungen wurden erfolgreich aktualisiert!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/account_password.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/account_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/account_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: account_password.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Ihr Konto');
+define('NAVBAR_TITLE_2', 'Passwort &auml;ndern');
+
+define('HEADING_TITLE', 'Mein Passwort');
+
+define('MY_PASSWORD_TITLE', 'Mein Passwort');
+
+define('SUCCESS_PASSWORD_UPDATED', 'Ihr Passwort wurde erfolgreich ge&auml;ndert!');
+define('ERROR_CURRENT_PASSWORD_NOT_MATCHING', 'Das eingegebene Passwort stimmt nicht mit dem gespeichertem Passwort &uuml;berein. Bitte probieren Sie es noch einmal.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/address_book.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/address_book.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/address_book.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: address_book.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Ihr Konto');
+define('NAVBAR_TITLE_2', 'Adressbuch');
+
+define('HEADING_TITLE', 'Mein pers&ouml;nliches Adressbuch');
+
+define('PRIMARY_ADDRESS_TITLE', 'Standardadresse');
+define('PRIMARY_ADDRESS_DESCRIPTION', 'Diese Adresse wird automatisch als Liefer- und Rechnungsadresse gew&auml;hlt wenn Sie eine Bestellung aufgeben.<br><br>Diese Adresse wird auch als Basis f&uuml;r die Berechnung eventueller Steuern und Versandkosten verwendet.');
+
+define('ADDRESS_BOOK_TITLE', 'Adressbucheintr&auml;ge');
+
+define('PRIMARY_ADDRESS', '(Standardadresse)');
+
+define('TEXT_MAXIMUM_ENTRIES', '<font color="#ff0000"><b>Hinweis:</b></font> Ihnen stehen %s Adressbucheintr&auml;ge zur Verf&uuml;gung!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/address_book_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/address_book_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/address_book_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: address_book_process.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Ihr Konto');
+define('NAVBAR_TITLE_2', 'Adressbuch');
+
+define('NAVBAR_TITLE_ADD_ENTRY', 'Neuer Eintrag');
+define('NAVBAR_TITLE_MODIFY_ENTRY', 'Eintrag &auml;ndern');
+define('NAVBAR_TITLE_DELETE_ENTRY', 'Eintrag l&ouml;schen');
+
+define('HEADING_TITLE_ADD_ENTRY', 'Adressbuch: Neuer Eintrag');
+define('HEADING_TITLE_MODIFY_ENTRY', 'Adressbuch: Eintrag &auml;ndern');
+define('HEADING_TITLE_DELETE_ENTRY', 'Adressbuch: Eintrag l&ouml;schen');
+
+define('DELETE_ADDRESS_TITLE', 'Eintrag l&ouml;schen');
+define('DELETE_ADDRESS_DESCRIPTION', 'Wollen Sie diese Adresse unwiderruflich aus Ihrem Adressbuch entfernen?');
+
+define('NEW_ADDRESS_TITLE', 'Adressbuch: Neuer Eintrag');
+
+define('SELECTED_ADDRESS', 'Standardadresse');
+define('SET_AS_PRIMARY', 'Als Standardadresse gesetzt.');
+
+define('SUCCESS_ADDRESS_BOOK_ENTRY_DELETED', 'Der ausgew&auml;hlte Eintrag wurde erflogreich gel&ouml;scht.');
+define('SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED', 'Ihr Adressbuch wurde erfolgreich aktualisiert!');
+
+define('WARNING_PRIMARY_ADDRESS_DELETION', 'Die Standardadresse kann nicht gel&ouml;scht werden. Bitte erst eine andere Standardadresse w&auml;hlen. Danach kann der Eintrag gel&ouml;scht werden.');
+
+define('ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY', 'Dieser Adressbucheintrag ist nicht vorhanden.');
+define('ERROR_ADDRESS_BOOK_FULL', 'Ihr Adressbuch kann keine weiteren Adressen aufnehmen. Bitte l&ouml;schen Sie eine nicht mehr ben&ouml;tigte Adresse. Danach k&ouml;nnen Sie einen neuen Eintrag speichern.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/advanced_search.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/advanced_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/advanced_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: advanced_search.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Erweiterte Suche');
+define('NAVBAR_TITLE_2', 'Suchergebnisse');
+
+define('HEADING_TITLE_1', 'Geben Sie Ihre Suchkriterien ein');
+define('HEADING_TITLE_2', 'Artikel, welche den Suchkriterien entsprechen');
+
+define('HEADING_SEARCH_CRITERIA', 'Geben Sie Ihre Stichworte ein');
+
+define('TEXT_SEARCH_IN_DESCRIPTION', 'Auch in den Beschreibungen suchen');
+define('ENTRY_CATEGORIES', 'Kategorien:');
+define('ENTRY_INCLUDE_SUBCATEGORIES', 'Unterkategorien miteinbeziehen');
+define('ENTRY_MANUFACTURERS', 'Hersteller:');
+define('ENTRY_PRICE_FROM', 'Preis ab:');
+define('ENTRY_PRICE_TO', 'Preis bis:');
+define('ENTRY_DATE_FROM', 'hinzugef&uuml;gt von:');
+define('ENTRY_DATE_TO', 'hinzugef&uuml;gt bis:');
+
+define('TEXT_SEARCH_HELP_LINK', '<u>Hilfe zur erweiterten Suche</u> [?]');
+
+define('TEXT_ALL_CATEGORIES', 'Alle Kategorien');
+define('TEXT_ALL_MANUFACTURERS', 'Alle Hersteller');
+
+define('HEADING_SEARCH_HELP', 'Hilfe zur erweiterten Suche');
+define('TEXT_SEARCH_HELP', 'Die Suchfunktion erm&ouml;glicht Ihnen die Suche in den Artikelnamen, Artikelbeschreibungen, Herstellern und Artikelnummern.<br><br>Sie haben die M&ouml;glichkeit logische Operatoren wie "AND" (Und) und "OR" (oder) zu verwenden.<br><br>Als Beispiel k&ouml;nnten Sie also angeben: <u>Microsoft AND Maus</u>.<br><br>Desweiteren k&ouml;nnen Sie Klammern verwenden um die Suche zu verschachteln, also z.B.:<br><br><u>Microsoft AND (Maus OR Tastatur OR "Visual Basic")</u>.<br><br>Mit Anf&uuml;hrungszeichen k&ouml;nnen Sie mehrere Worte zu einem Suchbegriff zusammenfassen.');
+define('TEXT_CLOSE_WINDOW', '<u>Fenster schliessen</u> [x]');
+
+define('TABLE_HEADING_IMAGE', '');
+define('TABLE_HEADING_MODEL', 'Artikelnr.');
+define('TABLE_HEADING_PRODUCTS', 'Artikel');
+define('TABLE_HEADING_MANUFACTURER', 'Hersteller');
+define('TABLE_HEADING_QUANTITY', 'Anzahl');
+define('TABLE_HEADING_PRICE', 'Einzelpreis');
+define('TABLE_HEADING_WEIGHT', 'Gewicht');
+define('TABLE_HEADING_BUY_NOW', 'jetzt bestellen');
+
+define('TEXT_NO_PRODUCTS', 'Es wurden keine Artikel gefunden, die den Suchkriterien entsprechen.');
+
+define('ERROR_AT_LEAST_ONE_INPUT', 'Wenigstens ein Feld des Suchformulars muss ausgefüllt werden.');
+define('ERROR_INVALID_FROM_DATE', 'Unzul&auml;ssiges <b>von</b> Datum');
+define('ERROR_INVALID_TO_DATE', 'Unzul&auml;ssiges <b>bis jetzt</b> Datum');
+define('ERROR_TO_DATE_LESS_THAN_FROM_DATE', 'Das Datum <b>von</b> muss gr&ouml;sser oder gleich dem <b>bis jetzt</b> Datum sein');
+define('ERROR_PRICE_FROM_MUST_BE_NUM', '<b>Preis ab</b> muss eine Zahl sein');
+define('ERROR_PRICE_TO_MUST_BE_NUM', '<b>Preis bis</b> muss eine Zahl sein');
+define('ERROR_PRICE_TO_LESS_THAN_PRICE_FROM', '<b>Preis bis</b> muss gr&ouml;&szlig;er oder gleich <b>Preis ab</b> sein.');
+define('ERROR_INVALID_KEYWORDS', 'Suchbegriff unzul&aum&auml;ssig');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_affiliate.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_affiliate.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Anmeldung Partnerprogramm');
+define('HEADING_TITLE', 'Melden Sie sich an oder geben Sie Ihre Benutzerkennung ein:');
+define('HEADING_TITLE_ERROR', 'Registrierungsfehler');
+
+define('TEXT_AFFILIATE_LOGOFF', 'Abmelden');
+define('TEXT_AFFILIATE_ID', 'Ihre Email-Adresse:');
+define('TEXT_AFFILIATE_PASSWORD', 'Ihr Passwort:');
+
+define('HEADING_NEW_AFFILIATE', 'Sie sind ein neuer Partner');
+define('TEXT_NEW_AFFILIATE', 'Ich bin ein neuer Partner');
+define('TEXT_NEW_AFFILIATE_INTRODUCTION', 'Mit der Einrichtung eines Partner Kontos bei ' . STORE_NAME . ' k&ouml;nnen Sie Ihr Einkommen als Webmaster einer gut frequentierten Website steigern, indem Sie Ihre Besucher auf unsere Website leiten und an den &uuml;ber Sie get&auml;tigten Verk&auml;ufen direkt mitverdienen.');
+define('TEXT_NEW_AFFILIATE_TERMS','Unsere Allgemeinen Gesch&auml;ftsbedingungen zum Partnerprogramm finden Sie <u>hier</u>!');
+
+define('HEADING_RETURNING_AFFILIATE', 'Sie sind bereits Partner und haben ein Passwort');
+define('TEXT_RETURNING_AFFILIATE', 'Nach dem Login k&ouml;nnen Sie sich s&auml;mtliche Informationen zum aktuellen Stand Ihres Partner-Kontos aufrufen.');
+
+define('TEXT_AFFILIATE_PASSWORD_FORGOTTEN', 'Sie haben Ihr Passwort vergessen? Dann klicken Sie <u>hier</u>!');
+
+define('TEXT_LOGIN_ERROR', '<font color="#ff0000"><b>FEHLER:</b></font> Keine &Uuml;bereinstimmung der eingebenen \'Partner-ID\' und/oder des \'Passwortes\'.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_banners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm');
+define('HEADING_TITLE', 'Partnerprogramm: Banner');
+
+define('TEXT_AFFILIATE_BANNERS', 'Banner Links');
+define('TEXT_AFFILIATE_BANNERS_BUILD', 'Build a Link');
+define('TEXT_AFFILIATE_BANNERS_PRODUCT', 'Product Links');
+define('TEXT_AFFILIATE_BANNERS_TEXT', 'Text Links');
+
+define('TEXT_INFORMATION_BANNERS_BANNERS', 'Effective HIGHLY colorful graphical links in various shapes and sizes');
+define('TEXT_INFORMATION_BANNERS_BUILD', 'Create dynamic links to a particular product of your choice.');
+define('TEXT_INFORMATION_BANNERS_PRODUCT', 'Recommend specific products to your visitors by linking directly to a particular product.');
+define('TEXT_INFORMATION_BANNERS_TEXT', 'Get maximum sales from these proven to-be-effective and easy-to-use text based links.');
+define('TEXT_INFORMATION', 'W&auml;hlen Sie den Banner oder den Link aus den untenhalb angebotenen M&ouml;glichkeiten, den Sie auf Ihrer Webseite publizieren m&ouml;chten.');
+define('TEXT_AFFILIATE_NAME', 'Banner Name: ');
+define('TEXT_AFFILIATE_INFO', 'Kopieren Sie den HTML Code und f&uuml;gen Sie diesen in Ihrer Webseite ein.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER', 'ERSTELLE-EINEN-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO', 'Geben Sie die Artikel-ID (in der URL sichtbar) von dem Artikel ein, das Sie auf Ihrer Webseite anbieten m&ouml;chten und bet&auml;tigen Sie den Button "Build a Link"');
+
+define('IMAGE_BUTTON_BUILD_A_LINK','Link für einen Artikel Banner erzeugen');
+define('IMAGE_BANNERS','Banners');
+define('IMAGE_PRODUCT','Product Links');
+define('IMAGE_BUILD','Build a Link');
+define('IMAGE_TEXT','Text Links');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_banners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_banners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_banners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: affiliate_banners_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Banners');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Choose the banner you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_build.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_build.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_build.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Build a Link');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Enter the product number of the product you wish to build a link for:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER','BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO','Enter the product number you wish to link to and press the enter&nbsp;');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available products.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the product number from the popup window and enter the number in the Build A Link field.');
+
+define('TEXT_VALID_PRODUCTS_LIST', 'Available Products List');
+define('TEXT_VALID_PRODUCTS_ID', 'Product #');
+define('TEXT_VALID_PRODUCTS_NAME', 'Products Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('IMAGE_BUTTON_BUILD_A_LINK', 'BUILD-A-LINK');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_build_cat.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_build_cat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_build_cat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: affiliate_banners_build.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Build a CATEGORY Link');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Enter the CATEGORY number of the CATEGORY you wish to build a link for:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER','BUILD-A-CATEGORY-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO','Enter the CATEGORY number you wish to link to and press the enter&nbsp;');
+define('TEXT_AFFILIATE_VALIDPRODUCTS', 'Click Here:');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_VIEW', 'to view available categories.');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_HELP', 'Select the category number from the popup window and enter the number in the Build Category Link field.');
+
+define('TEXT_VALID_CATEGORIES_LIST', 'Available Categories List');
+define('TEXT_VALID_CATEGORIES_ID', 'Categories #');
+define('TEXT_VALID_CATEGORIES_NAME', 'Categories Name');
+
+define('TEXT_CLOSE_WINDOW', '<u>Close Window</u> [x]');
+
+define('IMAGE_BUTTON_BUILD_A_LINK', 'BUILD-A-LINK');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_category.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_category.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_category.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_banners_category.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Category Links');
+
+define('TEXT_AFFILIATE_NAME', 'Category Name:');
+define('TEXT_INFORMATION', 'Choose the CATEGORY you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_product.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_product.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_product.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_banners_product.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Product Links');
+
+define('TEXT_AFFILIATE_NAME', 'Product Name:');
+define('TEXT_INFORMATION', 'Choose the product you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_text.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_text.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_banners_text.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_banners_text.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program - Text Links');
+
+define('TEXT_AFFILIATE_NAME', 'Link Name:');
+define('TEXT_INFORMATION', 'Choose the link you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_VERSION', 'Text Version:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_clicks.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_clicks.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_clicks.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_clicks.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm');
+define('HEADING_TITLE', 'Partnerprogramm: Klicks');
+
+define('TABLE_HEADING_DATE', 'Datum');
+define('TABLE_HEADING_REFFERED', 'Referenz');
+define('TABLE_HEADING_IP', 'IP Adresse');
+define('TABLE_HEADING_BROWSER', 'Browser');
+define('TABLE_HEADING_CLICKED_PRODUCT', 'Artikel');
+
+define('TEXT_AFFILIATE_HEADER', 'Alle Klicks von Ihrer Website:');
+define('TEXT_NO_CLICKS', 'Es wurden noch keine Klicks von Ihrer Website aufgezeichnet.');
+define('TEXT_DISPLAY_NUMBER_OF_CLICKS', 'Zeige <b>%d</b> bis <b>%d</b> (von <b>%d</b> insgesamt Klicks)');
+define('TEXT_CLICKTHROUGH_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_CLICKS', 'Click on [?] to see a description of each category.');
+define('HEADING_CLICKTHROUGH_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the clickthrough from your site.');
+define('TEXT_CLICKED_PRODUCT_HELP', '<i>Product or Page</i> represents the page or product clicked through to');
+define('TEXT_REFFERED_HELP', '<i>Referrer</i> represents the url that the clickthrough came from.');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_contact.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_contact.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_contact.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: affiliate_contact.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm');
+define('HEADING_TITLE', 'Partnerprogramm - Kontaktformular');
+
+define('TEXT_SUCCESS', 'Ihre Nachricht wurde erfolgreich an uns gesendet.');
+
+define('EMAIL_SUBJECT', 'Partnerprogramm');
+define('ENTRY_NAME', 'Vor- und Nachname:');
+define('ENTRY_EMAIL', 'Email-Adresse:');
+define('ENTRY_ENQUIRY', 'Ihre Nachricht:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_details.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_details.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Partnerprogramm');
+define('NAVBAR_TITLE_2', 'Daten &auml;ndern');
+define('HEADING_TITLE', 'Partnerkonto Daten &auml;ndern');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_details_ok.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_details_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_details_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: affiliate_details_ok.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm - Ihre Kontodaten');
+define('HEADING_TITLE', 'Ihre Kontodaten wurden ge&auml;ndert!');
+define('TEXT_INFORMATION', 'We have updated your account details, Please click the continue button.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<?php
+/*
+  $Id: affiliate_faq.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm FAQ');
+define('HEADING_TITLE', 'Partnerprogramm - H&auml;ufig gestellte Fragen');
+
+define('TEXT_INFORMATION', '' . STORE_NAME . ' hat diese FAQ geschrieben, um Ihnen die h&auml;ufigsten Fragen zu unserem Partnerprogramm schnell beantworten zu k&ouml;nnen.<br>
+ Falls Sie weitere Fragen haben <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '"> <u>kontaktieren</u></a> Sie uns bitte f&uuml;r weitere Informationen.<br>
+<ul>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#1">Frage 1?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#2">Frage 2?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#3">Frage 3?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#4">Frage 4?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#5">Frage 5?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#6">Frage 6?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#7">Frage 7?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#8">Frage 8?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#9">Frage 9?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#10">Frage 10?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#11">Frage 11?</a>
+<li><a href="' . tep_href_link('affiliate_faq.php') . '#12">Frage 12?</a>
+</ul>
+<hr width ="90%">
+<br>
+<font color="#000000" size="3"><b><u>H&auml;ufig gestellte Fragen</u></b></font>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 1?</font><a name="1"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 2?</font><a name="2"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 3?</font><a name="3"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 4?</font><a name="4"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 5?</font><a name="5"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 6?</font><a name="6"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 7?</font><a name="7"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 8?</font><a name="8"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 9?</font><a name="9"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 10?</font><a name="10"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 11?</font><a name="11"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><font color="maroon">Frage: 12?</font><a name="12"></a><br>
+Antwort</p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0"><a href="' . tep_href_link('affiliate_faq.php') . '#0">top</a></p>
+<p align="right" style="line-height: 100%; word-spacing: 0; text-indent: 0; margin: 0">&nbsp;</p>
+<p align="right" style="line-height: 100%; word-spacing: 0: text-indent: 0: margin: 0:">This text can be edited in includes/languages/<selected language>/affiliate_faq.php.</p>
+');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: affiliate_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm');
+define('HEADING_TITLE', 'Partnerprogramm');
+
+define('HEADING_AFFILIATE_PROGRAM_TITLE', 'Das ' . STORE_NAME . ' Partnerprogramm');
+// Delete this line - or place two forward slashes before the word 'define'
+define('TEXT_INFORMATION', 'F&uuml;gen Sie hier Ihre Informationen zum Partnerprogramm ein.');
+
+// define('TEXT_INFORMATION',' <DELETE THE BRACKETS AND ALL TEXT IN BETWEEN - PUT YOUR INFORMATION HERE>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_logout.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_logout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_logout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: affiliate_logout.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm');
+define('HEADING_TITLE', 'Partnerprogramm abmelden');
+
+define('TEXT_INFORMATION', 'Sie wurden abgemeldet.');
+define('TEXT_INFORMATION_ERROR_1', 'Sie konnten nicht abgemeldet werden!');
+define('TEXT_INFORMATION_ERROR_2', 'Sie waren nicht angemeldet und k&ouml;nnen deshalb nicht abgemeldet werden!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.10 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate News');
+
+define('TABLE_HEADING_AFFILIATE_NEWS', 'Affiliate News');
+
+define('TEXT_AFFILIATE_NAME', 'Banner Name:');
+define('TEXT_INFORMATION', 'Choose the banner or link you want to display on your website from the choices below:');
+define('TEXT_AFFILIATE_INFO', 'Copy the code shown below and paste into your website');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER', 'BUILD-A-LINK');
+define('TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO', 'Enter the product number you wish to link to.');
+
+define('IMAGE_BUTTON_BUILD_A_LINK','Build a Link for a Product Banner.');
+
+//add on \admin\includes\english\affiliate_news.php
+// npe admin begin #add
+define('TEXT_AFFILIATE_NEWS_CONTENT_DELETE', 'Delete displayed news in this language!');
+define('EMPTY_CATEGORY', 'Empty news');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'There are no news which can be displayed to your affiliate partners.');
+// npe admin begin #add
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_newsletter.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_newsletter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_newsletter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Affiliate Program');
+define('NAVBAR_TITLE_2', 'Newsletter Subscriptions');
+
+define('HEADING_TITLE', 'Newsletter Subscriptions');
+
+define('MY_NEWSLETTERS_TITLE', 'My Newsletter Subscriptions');
+define('MY_NEWSLETTERS_AFFILIATE_NEWSLETTER', 'Affiliate Newsletter');
+define('MY_NEWSLETTERS_AFFILIATE_NEWSLETTER_DESCRIPTION', 'Including affiliate news, new products, special offers, and other promotional announcements.');
+
+define('SUCCESS_NEWSLETTER_UPDATED', 'Your newsletter subscriptions have been successfully updated.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_password.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_password.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_password.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Affiliate Program');
+define('NAVBAR_TITLE_2', 'Change Password');
+
+define('HEADING_TITLE', 'My Password');
+
+define('MY_PASSWORD_TITLE', 'My Password');
+
+define('SUCCESS_PASSWORD_UPDATED', 'Your password has been successfully updated.');
+define('ERROR_CURRENT_PASSWORD_NOT_MATCHING', 'Your Current Password did not match the password in our records. Please try again.');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: affiliate_password_forgotten.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Anmelden');
+define('NAVBAR_TITLE_2', 'Passwort zum Partnerprogramm vergessen');
+define('HEADING_TITLE', 'Wie war noch mal mein Passwort?');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', '<font color="#ff0000"><b>ACHTUNG:</b></font> Die eingegebene Email-Adresse ist nicht registriert. Bitte versuchen Sie es noch einmal.');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Neues Passwort zum Partnerprogramm');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'Über die Adresse ' . $REMOTE_ADDR . ' haben wir eine Anfrage zur Passworterneuerung für Ihren Zugang zum Partnerprogramm erhalten.' . "\n\n" . 'Ihr neues Passwort für Ihren Zugang zum Partnerprogramm von \'' . STORE_NAME . '\' lautet ab sofort:' . "\n\n" . '   %s' . "\n\n");
+define('TEXT_PASSWORD_SENT', 'Ein neues Passwort wurde per Email verschickt.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_payment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  $Id: affiliate_payment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm');
+define('HEADING_TITLE', 'Partnerprogramm: Provisionszahlungen');
+
+define('TEXT_AFFILIATE_HEADER', 'Ihre Provisionszahlungen:');
+
+define('TABLE_HEADING_DATE', 'Datum');
+define('TABLE_HEADING_PAYMENT', 'Provision');
+define('TABLE_HEADING_STATUS', 'Status');
+define('TABLE_HEADING_PAYMENT_ID','lfd-Nr.');
+define('TEXT_DISPLAY_NUMBER_OF_PAYMENTS', 'angezeigte Provisionszahlungen <b>%d</b> bis <b>%d</b> (von <b>%d</b> insgesamt)');
+define('TEXT_INFORMATION_PAYMENT_TOTAL', 'Ihre Gesamtprovision bisher:');
+define('TEXT_NO_PAYMENTS', 'Bis jetzt wurden noch keine Provisionszahlungen registriert.');
+define('TEXT_PAYMENT_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_PAYMENT', 'Click on [?] to see a description of each category.');
+define('HEADING_PAYMENT_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the payment made to the affiliate.');
+define('TEXT_PAYMENT_ID_HELP', '<i>Payment-ID</i> represents the payment number associated to the payment.');
+define('TEXT_PAYMENT_HELP_1', '<i>Affiliate Earnings</i> represents the value of payment made to the affiliate.');
+define('TEXT_STATUS_HELP', '<i>Payment Status</i> represents the status of the payment made to the affiliate');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_reports.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_reports.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_reports.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: affiliate_banners.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Affiliate Program');
+define('HEADING_TITLE', 'Affiliate Program: Affiliate Reports');
+
+define('TEXT_INFORMATION', 'Obtain affiliate links that you can display on your website.');
+
+define('TEXT_AFFILIATE_CLICKS', 'Clickthrough Report');
+define('TEXT_AFFILIATE_SALES', 'Sales Report');
+define('TEXT_AFFILIATE_PAYMENT', 'Payment Report');
+
+
+define('TEXT_INFORMATION_CLICKS', 'View Clickthrough information from your website');
+define('TEXT_INFORMATION_SALES', 'View your current and previous Affiliate Sales');
+define('TEXT_INFORMATION_PAYMENT', 'View all affiliate payments made to you');
+
+define('IMAGE_CLICKS','Clickthrough Report');
+define('IMAGE_SALES','Sales Report');
+define('IMAGE_PAYMENT','Payment Report');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_sales.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_sales.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_sales.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: affiliate_sales.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm');
+define('HEADING_TITLE', 'Partnerprogramm: Verk&auml;ufe');
+
+define('TABLE_HEADING_DATE', 'Datum');
+define('TABLE_HEADING_SALES', 'Provision (exkl.)');
+define('TABLE_HEADING_VALUE', 'Bestellwert (exkl.)');
+define('TABLE_HEADING_PERCENTAGE','% Provision');
+define('TABLE_HEADING_STATUS', 'Status');
+
+define('TEXT_DELETED_ORDER_BY_ADMIN', 'Gel&ouml;scht (Admin)');
+define('TEXT_INFORMATION_SALES_TOTAL', 'Ihre momentane Provision (exkl.) betr&auml;gt:');
+define('TEXT_INFORMATION_SALES_TOTAL2', '<br>Es werden nur versandte Verk&auml;ufe summiert!');
+define('TEXT_NO_SALES', 'Bis jetzt wurden noch keine Verk&auml;ufe &uuml;ber Ihre Webseite get&auml;tigt.');
+define('TEXT_DISPLAY_NUMBER_OF_SALES', 'angezeigte Verk&auml;ufe <b>%d</b> bis <b>%d</b> (von <b>%d</b> insgesamt)');
+
+define('TEXT_AFFILIATE_HEADER', 'Verk&auml;ufe &uuml;ber Ihre Webseite:');
+define('TEXT_SALES_HELP', ' <font color="#FFFFFF">[?]</font>');
+define('TEXT_SALES', 'Click on [?] to see a description of each category.');
+define('HEADING_SALES_HELP', 'Affiliate Help');
+define('TEXT_DATE_HELP', '<i>Date</i> represents the date of the sale.');
+define('TEXT_TIME_HELP', '<i>Time</i> represents the time of the sale.');
+define('TEXT_SALE_VALUE_HELP', '<i>Sale Value</i> represents the value of the sale.');
+define('TEXT_COMMISSION_RATE_HELP', '<i>Commission Rate</i> represents the commission rate paid on the sale.');
+define('TEXT_COMMISSION_VALUE_HELP', '<i>Affiliate Earnings</i> represents the commission due on the sale.');
+define('TEXT_STATUS_HELP', '<i>Sale Status</i> represents the status the sale.');
+define('TEXT_CLOSE_WINDOW', 'Close Window [x]');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_signup.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_signup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_signup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: affiliate_signup.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm');
+define('HEADING_TITLE', 'Anmeldung zu unserem Partnerprogramm');
+
+define('MAIL_AFFILIATE_SUBJECT', 'Willkommen zum Partnerprogramm von' . STORE_NAME);
+define('MAIL_GREET_NONE', 'Dear %s' . "\n\n");//em001
+define('MAIL_AFFILIATE_HEADER', 'Sehr geehrter Partner
+
+Vielen Dank für Ihre Anmeldung bei unserem Partnerprogramm.
+
+Ihre Anmeldeinformationen:
+***********************'."\n\n");
+define('MAIL_AFFILIATE_ID', 'Ihre Partner-ID ist: ');
+define('MAIL_AFFILIATE_USERNAME', 'Ihr Benutzername ist: ');
+define('MAIL_AFFILIATE_PASSWORD', 'Ihr Passwort ist: ');
+define('MAIL_AFFILIATE_LINK', 'Melden Sie sich hier an: ');
+define('MAIL_AFFILIATE_FOOTER', 'Wir freuen uns auf eine gute Zusammenarbeit mit Ihnen!'."\n\n".'Ihr Partnerprogramm Team');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_signup_ok.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_signup_ok.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_signup_ok.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: affiliate_signup_ok.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partner Registrierung');
+define('HEADING_TITLE', 'Partnerkonto erfolgreich er&ouml;ffnet!');
+define('TEXT_INFORMATION', 'Vielen Dank! Ihr neues Partner Konto wurde erfolgreich er&ouml;ffnet!<br><br>Eine Best&auml;tigung &uuml;ber Ihr neues Konto wird Ihnen zugesendet. Falls Sie dieses Email nicht innerhalb einer Stunde erhalten, <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">kontaktieren Sie uns</a> bitte.<br><br>Wenn Sie Fragen haben, <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">kontaktieren Sie uns</a> bitte ebenfalls.');
+define('TEXT_ACCOUNT_CREATED', 'Congratulations! Your new Affiliate account application has been submitted! You will shortly receive an email containing important information regarding your Affiliate Account, including you affiliate login details. If you have not received it within the hour, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.<br><br>If you have <small><b>ANY</b></small> questions about the affiliate program, please <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT) . '">contact us</a>.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_summary.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_summary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_summary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: affiliate_summary.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm &Uuml;bersicht');
+define('HEADING_TITLE', 'Partnerprogramm Zusammenfassung');
+
+define('TEXT_AFFILIATE_CENTRE', 'Affiliate Center');
+define('TEXT_AFFILIATE_BANNER_CENTRE', 'Affiliate Banners');
+define('TEXT_AFFILIATE_REPORT_CENTRE', 'Affiliate Reports');
+define('TEXT_AFFILIATE_INFO', 'Affiliate Information');
+define('TEXT_AFFILIATE_SUMMARY', 'Affiliate Summary');
+define('TEXT_AFFILIATE_PASSWORD', 'Change Password');
+define('TEXT_AFFILIATE_NEWS', 'Affiliate News');
+define('TEXT_AFFILIATE_NEWSLETTER', 'Newsletter');
+define('TEXT_AFFILIATE_ACCOUNT', 'Edit Affiliate Account');
+define('TEXT_AFFILIATE_REPORTS', 'Affiliate Reports');
+define('TEXT_AFFILIATE_CLICKRATE', 'Clickthrough Report');
+define('TEXT_AFFILIATE_PAYMENT', 'Payment Report');
+define('TEXT_AFFILIATE_SALES', 'Sales Report');
+define('TEXT_AFFILIATE_BANNERS', 'Affiliate Banners');
+define('TEXT_AFFILIATE_BANNERS_BANNERS', 'Banner Links');
+define('TEXT_AFFILIATE_BANNERS_BUILD', 'Build a Link');
+define('TEXT_AFFILIATE_BANNERS_PRODUCT', 'Product Links');
+define('TEXT_AFFILIATE_BANNERS_TEXT', 'Text Links');
+define('TEXT_INFORMATION', 'Your affiliate Information goes here');
+define('TEXT_SUMMARY_TITLE', 'Affiliate Summary');
+define('TEXT_IMPRESSIONS', 'Banner Impressionen: ');
+define('TEXT_VISITS', 'Besucher: ');
+define('TEXT_TRANSACTIONS', 'Partner Verk&auml;ufe: ');
+define('TEXT_CONVERSION', 'Verk&auml;ufe/Klicks: ');
+define('TEXT_AMOUNT', 'Summe Bestellwert: ');
+define('TEXT_AVERAGE', 'Durchschnitt: ');
+define('TEXT_COMMISSION_RATE', 'Provison: ');
+define('TEXT_PAYPERSALE_RATE', 'Provision pro Verkauf: ');
+define('TEXT_CLICKTHROUGH_RATE', 'Provision pro Klick: ');
+define('TEXT_COMMISSION', 'Provisionsbetrag: ');
+define('TEXT_SUMMARY_HELP', '[?]');
+define('TEXT_SUMMARY', 'Klicken Sie auf [?] um eine Beschreibung zu jeder Kategorie zu lesen.');
+define('HEADING_SUMMARY_HELP', 'Hilfe');
+define('TEXT_IMPRESSIONS_HELP', '<b>Banner Impressionen</b> zeigt an, wie oft ein Banner im vorgegebenen Zeitraum angezeigt wurde.');
+define('TEXT_VISITS_HELP', '<b>Besucher</b> zeigt an, wie viele Klicks von Besuchern, welche &uuml;ber Ihre Webseite gekommen sind, vorgenommen wurden.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Partner Verk&auml;ufe</b> zeigt an, wieviele Verk&auml;ufe &uuml;ber Ihre Webseite get&auml;tigt wurden.');
+define('TEXT_CONVERSION_HELP', '<b>Verk&auml;ufe/Klicks</b> zeigt in einem Prozentsatz an, wieviele der von Ihrer Webseite kommenden Besucher bei uns einen Kauf get&auml;tigt haben.');
+define('TEXT_AMOUNT_HELP', '<b>Summe Bestellwert</b> zeigt die Bestellsumme aller ausgelieferten Verk&auml;ufe an.');
+define('TEXT_AVERAGE_HELP', '<b>Durchschnitt</b> repr&auml;sentiert den durchschnittlichen Verkaufswert, welcher &uuml;ber Ihr Konto erwirtschaftet wurde.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Provison</b> steht f&uuml;r die prozentuale Provision, mit der wir, &uuml;ber Sie get&auml;tigte Verk&auml;ufe, abrechnen.');
+define('TEXT_CLICKTHROUGH_RATE_HELP', '<b>Pay per Klick</b> steht f&uuml;r die Provision die Sie bei einer "Provision pro Klick" Provisionsbasis erhalten.');
+define('TEXT_PAY_PER_SALE_RATE_HELP', '<b>Pay per Sale</b> steht f&uuml;r die Provision die Sie bei einer "Provision pro Sale" Provisionsbasis erhalten.');
+define('TEXT_COMMISSION_HELP', '<b>Provisionsbetrag</b> zeigt Ihre Provisionseink&uuml;nfte &uuml;ber alle ausgelieferten Verk&auml;ufe an.');
+define('TEXT_CLOSE_WINDOW', 'Fenster schliessen [x]');
+
+define('TEXT_GREETING','Willkommen ');
+define('TEXT_AFFILIATE_ID', 'Ihre Partner ID: ');
+
+define('IMAGE_BANNERS','Partner Banner');
+define('IMAGE_CLICKTHROUGHS','Bericht &uuml;ber Klicks');
+define('IMAGE_SALES','Bericht &uuml;ber Verk&auml;ufe');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/affiliate_terms.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/affiliate_terms.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/affiliate_terms.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: affiliate_terms.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Partnerprogramm AGB\'s');
+define('HEADING_TITLE', 'Partnerprogramm AGB\'s');
+
+define('HEADING_AFFILIATE_PROGRAM_TITLE', 'Die ' . STORE_NAME . ' Partnerprogramm AGB\'s');
+define('TEXT_INFORMATION', 'F&uuml;gen Sie hier Ihre allgemeinen Geschäftsbedingungen zum Partnerprogramm ein.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/all_prodcats.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/all_prodcats.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/all_prodcats.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: all_products.php,v 3.00 2004/02/21 by Ingo info at gamephisto.de
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Alle Artikel');
+define('HEADING_TITLE', 'Alle Artikel');
+
+define('HEADING_ALL_CATSUB', 'Kategorien und Unter-Kategorien');
+define('HEADING_ALL_PRODUCTS', 'Produkte');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/all_prodmanf.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/all_prodmanf.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/all_prodmanf.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: all_prodmanf.php, v 1.00 2004/09/04
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'All Manufactures and Products');
+define('HEADING_TITLE', 'All Manufactures and Products');
+
+define('HEADING_ALL_CATSUB', 'Manufactures');
+define('HEADING_ALL_PRODUCTS', 'Products');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/allprods.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/allprods.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/allprods.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: allprods.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Alle Artikel');
+define('HEADING_TITLE', 'Alle Artikel');
+
+define('BOX_INFORMATION_ALLPRODS', 'Sehen Sie sich alle unsere Artikel an');
+define('HEADING_TEXT_PRODUCT', 'Product Name');
+define('HEADING_TEXT_MODEL', 'Model');
+define('HEADING_TEXT_PRICE', 'Price');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/article_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/article_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/article_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: article_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_ARTICLE_NOT_FOUND', 'Article Not Found');
+define('TEXT_ARTICLE_NOT_FOUND', 'Sorry, but the article you requested is not available in this site.');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this articles <a href="%s" target="_blank"><u>web page</u></a>.');
+define('TEXT_DATE_ADDED', 'This article was published on %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#FF0000">This article will be published on %s.</font>');
+define('TEXT_BY', 'by ');
+define('TEXT_CURRENT_REVIEWS', 'Current Reviews:');
+define('BOX_TEXT_TELL_A_FRIEND', 'Tell a friend'); 
+define('TEXT_TELL_A_FRIEND', 'Tell a friend about this article:');
+define('TEXT_XSELL_ARTICLES', 'Products related to this article:');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/article_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/article_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/article_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+define('TEXT_MAIN', '');
+define('TABLE_HEADING_NEW_ARTICLES', 'New Articles');
+  define('HEADING_TITLE', $topics['topics_name']);
+  define('TABLE_HEADING_ARTICLES', 'Articles');
+  define('TABLE_HEADING_AUTHOR', 'Author');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles in this topic.');
+  define('TEXT_NO_ARTICLES2', 'There are currently no articles available from this author.');
+  define('TEXT_NUMBER_OF_ARTICLES', 'Number of Articles: ');
+  define('TEXT_SHOW', 'Display:');
+  define('TEXT_NOW', '\' now');
+  define('TEXT_ALL_TOPICS', 'All Topics');
+  define('TEXT_ALL_AUTHORS', 'All Authors');
+  define('TEXT_ARTICLES_BY', 'Articles by ');
+  define('TEXT_ARTICLES', 'Below is a list of articles with the most recent ones listed first.');  
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+  define('TEXT_MORE_INFORMATION', 'For more information, please visit this authors <a href="http://%s" target="_blank">web page</a>.');
+?>  
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/article_reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/article_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/article_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: article_reviews.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Reviews of ');
+define('NAVBAR_TITLE', 'Reviews');
+
+define('TEXT_NO_ARTICLE_REVIEWS', 'There are currently no aproved reviews for this article.');
+define('TEXT_OF_5_STARS', '%s out of 5 Stars');
+define('TEXT_REVIEW_VIEWS', 'Number of times read: ');
+define('TEXT_READ_REVIEW', 'Read Review...');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/article_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/article_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/article_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: article_reviews_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Review');
+define('HEADING_TITLE', 'Review of ');
+define('SUB_TITLE_ARTICLE', 'Article:');
+define('SUB_TITLE_FROM', 'From:');
+define('SUB_TITLE_DATE', 'Date:');
+define('SUB_TITLE_REVIEW', 'Review:');
+define('SUB_TITLE_RATING', 'Rating:');
+define('TEXT_OF_5_STARS', '%s of 5 Stars');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/article_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/article_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/article_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: article_reviews_write.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Reviews');
+define('HEADING_TITLE', 'Write Review of \'');
+
+define('SUB_TITLE_FROM', 'From:');
+define('SUB_TITLE_REVIEW', 'Your Review:');
+define('SUB_TITLE_RATING', 'Rating:');
+
+define('TEXT_APPROVAL_WARNING', 'Note: Your review will not appear until it has been approved.');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>Poor</b></font></small>');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>Excellent</b></font></small>');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/article_search.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/article_search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/article_search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: article_search.php
+  By AlDaffodil:  aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE_1', 'Article Search');
+define('HEADING_TITLE_2', 'Articles meeting the search criteria');
+
+define('NAVBAR_TITLE_1', 'Article Search');
+define('NAVBAR_TITLE_2', 'Articles meeting the search criteria');
+define('TABLE_HEADING_ARTICLES', 'Article');
+
+define('TEXT_ARTICLE_NAME' , 'Article Title & Link');
+define('TEXT_ARTICLE_EXCERPT' , 'Article Excerpt');
+
+define('TEXT_NO_ARTICLES', 'There are no articles matching the search criteria.');
+
+define('ERROR_INPUT', 'Please enter a search term.');
+define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/articles.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_MAIN', '');
+define('TABLE_HEADING_NEW_ARTICLES', 'New Articles in %s');
+
+if ( ($topic_depth == 'articles') || (isset($HTTP_GET_VARS['authors_id'])) ) {
+  define('HEADING_TITLE', $topics['topics_name']);
+  define('TABLE_HEADING_ARTICLES', 'Articles');
+  define('TABLE_HEADING_AUTHOR', 'Author');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles in this topic.');
+  define('TEXT_NO_ARTICLES2', 'There are currently no articles available from this author.');
+  define('TEXT_NUMBER_OF_ARTICLES', 'Number of Articles: ');
+  define('TEXT_SHOW', 'Display:');
+  define('TEXT_NOW', '\' now');
+  define('TEXT_ALL_TOPICS', 'All Topics');
+  define('TEXT_ALL_AUTHORS', 'All Authors');
+  define('TEXT_ARTICLES_BY', 'Articles by ');
+  define('TEXT_ARTICLES', 'Below is a list of articles with the most recent ones listed first.');  
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+  define('TEXT_MORE_INFORMATION', 'For more information, please visit this authors <a href="http://%s" target="_blank">web page</a>.');
+} elseif ($topic_depth == 'top') {
+  define('HEADING_TITLE', 'All Articles');
+  define('TEXT_ALL_ARTICLES', 'Below is a list of all articles with the most recent ones listed first.');
+  define('TEXT_CURRENT_ARTICLES', 'Current Articles');
+  define('TEXT_UPCOMING_ARTICLES', 'Upcoming Articles');
+  define('TEXT_NO_ARTICLES', 'There are currently no articles listed.');
+  define('TEXT_DATE_ADDED', 'Published:');
+  define('TEXT_DATE_EXPECTED', 'Expected:');
+  define('TEXT_AUTHOR', 'Author:');
+  define('TEXT_TOPIC', 'Topic:');
+  define('TEXT_BY', 'by');
+  define('TEXT_READ_MORE', 'Read More...');
+} elseif ($topic_depth == 'nested') {
+  define('HEADING_TITLE', 'Articles');
+}
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/articles_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/articles_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/articles_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: articles_new.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'New Articles');
+define('HEADING_TITLE', 'New Articles');
+
+define('TEXT_NEW_ARTICLES', 'The following articles were added in the last %s days.');
+define('TEXT_NO_NEW_ARTICLES', 'No new articles have been added in the last %s days.');
+define('TEXT_DATE_ADDED', 'Published:');
+define('TEXT_AUTHOR', 'Author:');
+define('TEXT_TOPIC', 'Topic:');
+define('TEXT_BY', 'by');
+define('TEXT_READ_MORE', 'Read More');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/attributes_sorter.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/attributes_sorter.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/attributes_sorter.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,11 @@
+<?php
+/*
+  WebMakers.com Added: Attributes Sorter
+*/
+
+// Sorter for product_info.php
+define('PRODUCTS_OPTIONS_SORT_BY_PRICE','1'); // 1= sort by products_options_sort_order + name; 0= sort by products_options_sort_order + price
+
+// Categories Image and Name on product_info.php
+define('SHOW_CATEGORIES','0'); // 0= off  1=on
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/cards1_box.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/cards1_box.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/cards1_box.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: card.php,v 1.1 2004/06/24 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ // information box text in templates/(mytemplate)/boxes/cards.php
+
+define('BOX_INFORMATION_CARD', 'Information');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/checkout_confirmation.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/checkout_confirmation.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/checkout_confirmation.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: checkout_confirmation.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Kasse');
+define('NAVBAR_TITLE_2', 'Best&auml;tigung');
+
+define('HEADING_TITLE', 'Bestellung aufgeben:');
+
+define('HEADING_DELIVERY_ADDRESS', 'Versandadresse');
+define('HEADING_SHIPPING_METHOD', 'Versandart');
+define('HEADING_PRODUCTS', 'Artikel');
+define('HEADING_TAX', 'MwSt.');
+define('HEADING_TOTAL', 'Summe');
+define('HEADING_BILLING_INFORMATION', 'Rechnungsinformationen');
+define('HEADING_BILLING_ADDRESS', 'Rechnungsadresse');
+define('HEADING_PAYMENT_METHOD', 'Zahlungsweise');
+define('HEADING_PAYMENT_INFORMATION', 'Zahlungsinformationen');
+define('HEADING_ORDER_COMMENTS', 'Anmerkung zu Ihrer Bestellung');
+define('HEADING_IPRECORDED_1','NOTE! The below IP and ISP has been recorded for security purposes.');
+define('YOUR_IP_IPRECORDED', 'IP Address');
+define('YOUR_ISP_IPRECORDED', 'ISP');
+
+define('TEXT_EDIT', 'Bearbeiten');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Kasse-Prozess fortsetzen');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'um diese Bestellung zu best&auml;tigen.');
+//please change the info_id=1 to the ID number for your condition in the information system
+define('CONDITION_AGREEMENT', 'I have read the <a href="information.php?info_id=1" target="_blank">conditions of use</a> and I agree to them');
+define('CONDITION_AGREEMENT_WARNING', 'Please read our conditions of use and agree to them. If you do not so, we can not deliver to you.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/checkout_payment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/checkout_payment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/checkout_payment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_payment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Kasse');
+define('NAVBAR_TITLE_2', 'Zahlungsweise');
+
+define('HEADING_TITLE', 'Zahlungsweise');
+
+define('TABLE_HEADING_BILLING_ADDRESS', 'Rechnungsadresse');
+define('TEXT_SELECTED_BILLING_DESTINATION', 'Bitte w&auml;hlen Sie aus Ihrem Adressbuch die gew&uuml;nschte Rechnungsadresse f&uuml;r Ihre Bestellung aus.');
+define('TITLE_BILLING_ADDRESS', 'Rechnungsadresse:');
+
+define('TABLE_HEADING_PAYMENT_METHOD', 'Zahlungsweise');
+define('TEXT_SELECT_PAYMENT_METHOD', 'Bitte w&auml;hlen Sie die gew&uuml;nschte Zahlungsweise f&uuml;r Ihre Bestellung aus.');
+define('TITLE_PLEASE_SELECT', 'Bitte w&auml;hlen Sie');
+define('TEXT_ENTER_PAYMENT_INFORMATION', 'Zur Zeit bieten wir Ihnen nur eine Zahlungsweise an.');
+
+define('TABLE_HEADING_COMMENTS', 'F&uuml;gen Sie hier Ihre Anmerkungen zu dieser Bestellung ein');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Fortsetzung des Bestellvorganges');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'zur Best&auml;tigung Ihrer Bestellung.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/checkout_payment_address.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/checkout_payment_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/checkout_payment_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_payment_address.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Kasse');
+define('NAVBAR_TITLE_2', 'Rechnungsadresse &auml;ndern');
+
+define('HEADING_TITLE', 'Informationen zur Rechnungsadresse');
+
+define('TABLE_HEADING_PAYMENT_ADDRESS', 'Rechnungsadresse');
+define('TEXT_SELECTED_PAYMENT_DESTINATION', 'Dies ist die aktuell ausgew&auml;hlte Rechnungsadresse, auf die die Rechnung ausgestellt wird.');
+define('TITLE_PAYMENT_ADDRESS', 'Rechnungsadresse:');
+
+define('TABLE_HEADING_ADDRESS_BOOK_ENTRIES', 'Adressbucheintr&auml;ge');
+define('TEXT_SELECT_OTHER_PAYMENT_DESTINATION', 'Bitte w&auml;hlen Sie die gew&uuml;nschte Rechnungsadresse, auf die wir die Rechnung ausstellen sollen.');
+define('TITLE_PLEASE_SELECT', 'Bitte w&auml;hlen Sie');
+
+define('TABLE_HEADING_NEW_PAYMENT_ADDRESS', 'Neue Rechnungsadresse');
+define('TEXT_CREATE_NEW_PAYMENT_ADDRESS', 'Bitte nutzen Sie dieses Formular, um eine neue Rechnungsadresse f&uuml;r Ihre Bestellung zu erfassen.');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Fortsetzung des Bestellvorganges');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'Zur Auswahl der gew&uuml;nschten Zahlungsweise.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/checkout_process.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/checkout_process.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/checkout_process.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: checkout_process.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('EMAIL_TEXT_SUBJECT', 'Bestellung');
+define('EMAIL_TEXT_ORDER_NUMBER', 'Bestellnummer:');
+define('EMAIL_TEXT_INVOICE_URL', 'Detailierte Bestell&uuml;bersicht:');
+define('EMAIL_TEXT_DATE_ORDERED', 'Bestelldatum:');
+define('EMAIL_TEXT_PRODUCTS', 'Artikel');
+define('EMAIL_TEXT_SUBTOTAL', 'Zwischensumme:');
+define('EMAIL_TEXT_TAX', 'MwSt.');
+define('EMAIL_TEXT_SHIPPING', 'Versandkosten:');
+define('EMAIL_TEXT_TOTAL', 'Summe:        ');
+define('EMAIL_TEXT_DELIVERY_ADDRESS', 'Lieferanschrift');
+define('EMAIL_TEXT_BILLING_ADDRESS', 'Rechnungsanschrift');
+define('EMAIL_TEXT_PAYMENT_METHOD', 'Zahlungsweise');
+
+define('EMAIL_SEPARATOR', '------------------------------------------------------');
+define('TEXT_EMAIL_VIA', 'durch');
+define('TEXT_SHIPWIRE_TRANSACTION_ID', 'Shipwire Fullfillment Transaction Successful. Transaction ID: ');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/checkout_shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/checkout_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/checkout_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: checkout_shipping.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Kasse');
+define('NAVBAR_TITLE_2', 'Versandinformationen');
+
+define('HEADING_TITLE', 'Versandinformationen');
+
+define('TABLE_HEADING_SHIPPING_ADDRESS', 'Versandadresse');
+define('TEXT_CHOOSE_SHIPPING_DESTINATION', 'Bitte w&auml;hlen Sie aus Ihrem Adressbuch die gew&uuml;nschte Versandadresse f&uuml;r Ihre Bestellung aus.');
+define('TITLE_SHIPPING_ADDRESS', 'Versandadresse:');
+
+define('TABLE_HEADING_SHIPPING_METHOD', 'Versandart');
+define('TEXT_CHOOSE_SHIPPING_METHOD', 'Bitte w&auml;hlen Sie die gew&uuml;nschte Versandart f&uuml;r Ihre Bestellung aus.');
+define('TITLE_PLEASE_SELECT', 'Bitte w&auml;hlen Sie');
+define('TEXT_ENTER_SHIPPING_INFORMATION', 'Zur Zeit bieten wir Ihnen nur eine Versandart an.');
+
+define('TABLE_HEADING_COMMENTS', 'F&uuml;gen Sie hier Ihre Anmerkungen zu dieser Bestellung ein');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Fortsetzung des Bestellvorganges');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'zur Auswahl der gew&uuml;nschten Zahlungsweise.');
+define('ERROR_VALID_TO_CHECKOUT', 'Please update your order ...');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/checkout_shipping_address.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/checkout_shipping_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/checkout_shipping_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: checkout_shipping_address.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Kasse');
+define('NAVBAR_TITLE_2', 'Versandadresse &auml;ndern');
+
+define('HEADING_TITLE', 'Informationen zur Versandadresse');
+
+define('TABLE_HEADING_SHIPPING_ADDRESS', 'Versandadresse');
+define('TEXT_SELECTED_SHIPPING_DESTINATION', 'Dies ist die aktuell ausgew&auml;hlte Versandadresse, an die Ihre Bestellung geliefert wird.');
+define('TITLE_SHIPPING_ADDRESS', 'Versandadresse:');
+
+define('TABLE_HEADING_ADDRESS_BOOK_ENTRIES', 'Adressbucheintr&auml;ge');
+define('TEXT_SELECT_OTHER_SHIPPING_DESTINATION', 'Bitte w&auml;hlen Sie die gew&uuml;nschte Versandadresse, an die wir die Auslieferung vornehmen sollen.');
+define('TITLE_PLEASE_SELECT', 'Bitte w&auml;hlen Sie');
+
+define('TABLE_HEADING_NEW_SHIPPING_ADDRESS', 'Neue Versandadresse');
+define('TEXT_CREATE_NEW_SHIPPING_ADDRESS', 'Bitte nutzen Sie dieses Formular, um eine neue Versandadresse f&uuml;r Ihre Bestellung zu erfassen.');
+
+define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Fortsetzung des Bestellvorganges');
+define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'zur Auswahl der gew&uuml;nschten Versandart.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/checkout_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/checkout_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/checkout_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: checkout_success.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Kasse');
+define('NAVBAR_TITLE_2', 'Erfolg');
+
+define('HEADING_TITLE', 'Ihr Bestellung ist ausgef&uuml;hrt worden.');
+
+define('TEXT_SUCCESS', 'Ihre Bestellung ist eingegangen und wird bearbeitet! Die Lieferung erfolgt innerhalb von ca. 2-5 Werktagen.');
+define('TEXT_NOTIFY_PRODUCTS', 'Bitte benachrichtigen Sie mich &uuml;ber Aktuelles zu folgenden Artikeln:');
+define('TEXT_SEE_ORDERS', 'Sie k&ouml;nnen Ihre Bestellung(en) auf der Seite <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '"><u>\'Ihr Konto\'</a></u> jederzeit einsehen und sich dort auch Ihre <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '"><u>\'Bestell&uuml;bersicht\'</u></a> anzeigen lassen.');
+define('TEXT_CONTACT_STORE_OWNER', 'Falls Sie Fragen bez&uuml;glich Ihrer Bestellung haben, wenden Sie sich an unseren <a href="' . tep_href_link(FILENAME_CONTACT_US) . '"><u>Vertrieb</u></a>.');
+define('TEXT_THANKS_FOR_SHOPPING', 'Wir danken Ihnen f&uuml;r Ihren Online-Einkauf!');
+
+define('TABLE_HEADING_COMMENTS', 'Ihr Kommentar zur Bestellung');
+
+define('TABLE_HEADING_DOWNLOAD_DATE', 'herunterladen m&ouml;glich bis:');
+define('TABLE_HEADING_DOWNLOAD_COUNT', 'max. Anz. Downloads');
+define('HEADING_DOWNLOAD', 'Artikel herunterladen:');
+define('FOOTER_DOWNLOAD', 'Sie k&ouml;nnen Ihre Artikel auch sp&auml;ter unter \'%s\' herunterladen');
+
+define('PAYPAL_NAVBAR_TITLE_2_OK', 'Erfolg'); // PAYPALIPN
+define('PAYPAL_NAVBAR_TITLE_2_PENDING', 'Ihre Bestellung wird bearbeitet.'); // PAYPALIPN
+define('PAYPAL_NAVBAR_TITLE_2_FAILED', 'Ihre Bezahlung ist fehlgeschlagen'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_OK', 'Ihre Bestellung wurde bearbeitet!'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_PENDING', 'Ihre Bestellung wird bearbeitet!'); // PAYPALIPN
+define('PAYPAL_HEADING_TITLE_FAILED', 'Ihre Bezahlung ist fehlgeschlagen!'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_OK', 'Ihre Bestellung wurde erfolgreich bearbeitet! Ihre Artikel sollten innerhalb von 2-5 Werktagen bei Ihnen eintreffen.'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_PENDING', 'Ihre Bestellung wird bearbeitet!'); // PAYPALIPN
+define('PAYPAL_TEXT_SUCCESS_FAILED', 'Ihre Bezahlung ist fehlgeschlagen! Bitte &uuml;berpr&uuml;fen Sie Ihre Eingabe um mit PayPal bezahlen zu k&ouml;nnen.'); // PAYPALIPN
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/contact_us.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/contact_us.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/contact_us.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/*
+  $Id: contact_us.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Kontakt');
+define('NAVBAR_TITLE', 'Kontakt');
+define('TEXT_SUCCESS', 'Ihre Anfrage wurde erfolgreich an den Vertrieb gesendet.');
+define('EMAIL_SUBJECT', 'Anfrage von ' . STORE_NAME);
+
+define('ENTRY_NAME', 'Vollst&auml;ndiger Name:');
+define('ENTRY_EMAIL', 'Email-Adresse:');
+define('ENTRY_ENQUIRY', 'Anfrage:');
+
+// Contact US Email Subject : DMG
+define('TEXT_EMAIL_SUBJECTS', '* select a subject *');
+define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME. ': ');
+define('ENTRY_SUBJECT','Subject:');
+
+// CRE Contact Us Enhancements 
+// VJ
+define('ENTRY_URGENT', 'Urgent:');
+define('ENTRY_SELF', 'Send myself a copy:');
+define('TEXT_SUBJECT_URGENT', 'Urgent');
+define('ENTRY_TOPIC','Email Topic:');
+define('ENTRY_TOPIC_1', 'Sales');
+define('ENTRY_TOPIC_2', 'Tracking');
+define('ENTRY_TOPIC_3', 'Technical');
+define('ENTRY_TOPIC_4', 'Sponsorship');
+define('ENTRY_TOPIC_5', 'Wholesale');
+
+define('TEXT_SUBJECT_PREFIX', 'Contact from ' . STORE_NAME . ': ');
+define('TEXT_BODY', '<DIV ><font class="text_14n">Corporate Headquarters:</font></A>
+
+
+
+<DIV ><font class="text_12wn"><b>Your Business Name <br>
+
+                              
+
+                                     Your Business Streed Address<br>
+
+
+
+                                     Your business City and postal code.<br>
+
+
+
+                                     business country</b></DIV><br>
+
+
+
+                                     Tel:  Telephone Number<br>
+
+
+
+                                     Fax:  Fax Number<br>
+
+
+
+                                     
+
+
+
+  <DIV ><br><font class="text_14n"><b>Email Contacts:</b></font></A>
+
+
+
+<DIV ><font class="text_12wn">Business Relations - <a href="mailto:info at yourstore.com" target="blank">info at yourstore.com</a><br>
+
+
+
+                                       Wholesale Inquiries - <a href="mailto:wholesale at yourstore.com" target="blank">wholesale at yourstore.com</a><br>
+
+
+
+                                       Technical Assistance - <a href="mailto:tech at yourstore.com" target="blank">tech at yourstore.com</a><br>
+
+
+
+                                     Product Inquiries - <a href="mailto:sales at yourstore.com" target="blank">sales at yourstore.com</a><br>
+
+
+
+                                     Order Status - <a href="mailto:tracking at yourstore.com" target="blank">tracking at yourstore.com</a><br>
+
+
+
+                                     <br>
+
+
+
+                                   
+
+
+
+<DIV ><font class="text_14n"><b>AOL IM Help:</b></font></A>
+
+
+
+<DIV ><font class="text_12wn">YourBusinessName -   <A href="aim:goim?screenname=YourAIM_ScreenName&message=Hi.+Are+you+there?">Click Here</a><br>
+
+: Edit this information in includes/languages/contact_us.php<br>
+
+
+
+');
+
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/cookie_usage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/cookie_usage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/cookie_usage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: cookie_usage.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Gebrauch von Cookies');
+define('HEADING_TITLE', 'Gebrauch von Cookies');
+
+define('TEXT_INFORMATION', 'Ihr Browser erlaubt keine Cookies.<br><br>Damit Sie Ihren Einkauf fortsetzen k&ouml;nnen, sollten Sie dieser Seite erlauben, Cookies zu setzen.<br><br>F&uuml;r den <b>Internet Explorer</b> gehen Sie dazu bitte folgendermassen vor:<br><ol><li>Im Men&uuml; <b>Extras</b> w&auml;hlen Sie <b>Internetoptionen</b></li><li>Dort klicken Sie auf <b>Sicherheit-Stufe anpassen</b></li><li>Im unteren Bereich findet sich eine Drop-Down-Box, in der Sie <b>Mittel</b> w&auml;hlen.</li><li>Klicken Sie nun auf <b>Zur&uuml;cksetzen</b></li></ol>Diese Massnahme dient Ihrer Sicherheit. Sollten dadurch Probleme enstehen, bitten wir um Entschuldigung. Bitte setzen Sie sich mit uns in Verbindung, wenn Sie Fragen zu diesem Problem haben.');
+
+define('BOX_INFORMATION_HEADING', 'Cookies, Ihre Privatsph&auml;re und Sicherheit');
+define('BOX_INFORMATION', 'Durch den Einsatz von Cookies wird die Sicherheit verbessert und Ihre Privatsph&auml;re besser gesch&uuml;tzt.<br><br>Im Cookie sind keine pers&ouml;nlichen Daten enthalten.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/create_account.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/create_account.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/create_account.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: create_account.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+// MAIL VALIDATION START //
+define('VALIDATE_YOUR_MAILADRESS', 'Click here to Validate/Activate Your account');
+define('SECOND_LINK', '<B>Or you can manually copy and paste in the following link into your browsers window:</B><BR> ');
+define('OR_VALIDATION_CODE', '<B>Your Validation Code is:</B> ');
+define('MAIL_VALIDATION', '<FONT COLOR="#FF0000"><B>You have to validate/activate your account before you can login.</B></FONT><P><B>Please click on the link below to finish the account creation process:</B> ');
+// MAIL VALIDATION END //
+
+define('NAVBAR_TITLE', 'Konto erstellen');
+
+define('HEADING_TITLE', 'Informationen zu Ihrem Kundenkonto');
+
+define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><b>ACHTUNG:</b></font></small> Wenn Sie bereits ein Konto besitzen, so melden Sie sich bitte <a href="%s"><u><b>hier</b></u></a> an.');
+
+define('EMAIL_SUBJECT', 'Willkommen zu ' . STORE_NAME);
+define('EMAIL_GREET_MR', 'Sehr geehrter Herr ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_MS', 'Sehr geehrte Frau ' . stripslashes($HTTP_POST_VARS['lastname']) . ',' . "\n\n");
+define('EMAIL_GREET_NONE', 'Hallo ' . stripslashes($HTTP_POST_VARS['firstname']) . ',' . "\n\n");
+define('EMAIL_WELCOME', 'willkommen bei <b>' . STORE_NAME . '</b>.' . "\n\n");
+
+define('EMAIL_TEXT', 'Sie k&ouml;nnen jetzt unseren <b>Online-Service</b> nutzen. Der Service bietet unter anderem:' . "\n\n" . '<li><b>Kundenwarenkorb</b> - Jeder Artikel bleibt registriert bis Sie zur Kasse gehen, oder die Artikel aus dem Warenkorb entfernen.' . "\n" . '<li><b>Adressbuch</b> - Wir k&ouml;nnen jetzt die Artikel zu der von Ihnen ausgesuchten Adresse senden. Der perfekte Weg ein Geburtstagsgeschenk zu versenden.' . "\n" . '<li><b>Vorherige Bestellungen</b> - Sie k&ouml;nnen jederzeit Ihre vorherigen Bestellungen &uuml;berpr&uuml;fen.' . "\n" . '<li><b>Meinungen &uuml;ber Artikel</b> - Teilen Sie Ihre Meinung zu unseren Artikeln mit anderen Kunden.' . "\n\n");
+define('ADMIN_EMAIL_WELCOME', 'Application to become a wholesale customer of <b>' . STORE_NAME . '</b>.' . "\n\n");
+define('ADMIN_EMAIL_TEXT', 'You have received an application to become a wholesale customer from your website.  Information regarding this application can be found at your online administration panel.' . "\n\n");
+
+define('EMAIL_CONFIRMATION', 'Thank you for submitting your account information to our ' . STORE_NAME . "\n\n" . 'To finish your account setup please verify your e-mail address by clicking the link below: ' . "\n\n");
+define('EMAIL_CONTACT', 'For help with any of our online services, please email the store-owner: ');
+define('EMAIL_CONTACT_TEXT', '<a href=\"mailto:' . STORE_OWNER_EMAIL_ADDRESSS . '\">' . STORE_OWNER_EMAIL_ADDRESS . '</a>' . "\n\n");
+define('EMAIL_WARNING', '<b>Note:</b> This Email address was given to us by one of our customers. If you did not signup to be a member, please send an email to ');
+define('EMAIL_WARNING_TEXT', '<a href=\"mailto:' . STORE_OWNER_EMAIL_ADDRESS . '\">' . STORE_OWNER_EMAIL_ADDRESS . '</a>' . "\n");
+
+/* ICW Credit class gift voucher begin */
+define('EMAIL_GV_INCENTIVE_HEADER', "\n\n" .'Als Dankesch&ouml;n für Neukunden, haben wir Ihnen einen Geschenk-Gutschein im Wert von %s geschickt');
+define('EMAIL_GV_REDEEM', 'Der Einl&ouml;secode für Ihren Geschenk-Gutschein lautet %s. Sie können diesen Einl&ouml;secode bei einem Einkauf an der Kasse einl&ouml;sen');
+define('EMAIL_GV_LINK', 'oder wenn Sie diesem Link folgen ');
+define('EMAIL_COUPON_INCENTIVE_HEADER', 'Glückwunsch! Damit Ihr erster Besuch in unserem Onlineshop eine lohnende Erfahrung wird, haben wir Ihnen einen Rabatt-Kupon zugesandt.' . "\n" .
+                                        ' Unten finden Sie die Details zu dem f&uuml;r Sie erstellten Rabatt-Kupon' . "\n");
+define('EMAIL_COUPON_REDEEM', 'Um den Kupon einzul&ouml;sen, geben Sie bitte diesen Einl&ouml;secode bei einem Einkauf an der Kasse ein: %s');
+/* ICW Credit class gift voucher end */
+define('HEADING_TITLE_CHECKOUT','Checkout Personal Info');// Added by sheetal for PWA form Title
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/create_account_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/create_account_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/create_account_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: create_account_success.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Konto erstellen');
+define('NAVBAR_TITLE_2', 'Erfolg');
+define('HEADING_TITLE', 'Ihr Konto wurde erfolgreich er&ouml;ffnet!');
+define('TEXT_ACCOUNT_CREATED', 'Herzlichen Gl&uuml;ckwunsch! Ihr neues Konto wurde erfolgreich er&ouml;ffnet! Sie k&ouml;nnen jetzt &uuml;ber Ihr Kundenkonto unseren \'Online-Service\' effizienter nutzen. Wenn Sie Fragen zum diesem Online-Shop haben, wenden Sie sich bitte an den <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '"><u>Vertrieb</u></a>.<br><br>Eine Best&auml;tigung &uuml;ber Ihr neues Konto wird Ihnen zugesandt. Falls Sie diese Email nicht innerhalb einer Stunde erhalten, wenden Sie sich bitte an den <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '"><u>Vertrieb</u></a>.');
+define('TEXT_ACCOUNT_CREATED1', 'Congratulations, Your new account has been successfully created, You can now take advantage of member privileges to enhance your online shopping experience with us. If you have <small><b>ANY</b></small> questions about the operation of this online shop, please email the <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">store owner</a> ' ;
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/cvs_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/cvs_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/cvs_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+// this file was created by Clifton Murphy <blue_glowstick at yahoo.com>
+// using code supplied in a previous release by Thomas Nordstrom <t_nordstrom at yahoo.com>
+// I take no credit for any of this work. I simply created this file and
+// recompiled the distribution zip file with the fixes to prevent parse errors.
+// see the main language file for translations (IE: english.php
+/*
+  $Id: cvs_help.php,v 1.3 2004/02/4 07:28:00 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo CVV_HELP_TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 5px; margin-left: 5px; margin-right: 5px; margin-top: 5px; }
+table.ccv/cvc/ccv2/cidhelp { background: #ffffff; border: 1px solid red;}
+//--></style>
+<body marginwidth="5" marginheight="5" topmargin="5" bottommargin="5" leftmargin="5" rightmargin="5">
+<table class="ccv/cvc/ccv2/cidhelp" width="100%" border="0" cellspacing="5" cellpadding="0">
+  <tr>
+    <td colspan="2">
+    <?php echo CVV_HELP_DESC1;?>
+      </td>
+  </tr>
+  <tr>
+    <td>
+    <?php echo CVV_HELP_DESC2;?>
+    
+    </td>
+    <td><img src="images/cvm_help1.jpg" width="200" height="139"></td>
+  </tr>
+  <tr>
+    <td>&nbsp;</td>
+    <td>&nbsp;</td>
+  </tr>
+  <tr>
+    <td>
+    <?php echo CVV_HELP_DESC3;?>
+    </td>
+    <td><img src="images/cvm_help2.jpg" width="200" height="139"></td>
+  </tr>
+</table>
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/includes/languages/german/down_for_maintenance.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/down_for_maintenance.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/down_for_maintenance.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  Created by: Linda McGrath osCOMMERCE at WebMakers.com
+  
+  Update by: fram 05-05-2003
+  Updated by: Donald Harriman - 08-08-2003 - MS2
+
+  down_for_maintenance.php v1.1
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Offline f&uuml;r Wartungsarbeiten');
+define('HEADING_TITLE', 'Offline f&uuml;r Wartungsarbeiten ...');
+define('DOWN_FOR_MAINTENANCE_TEXT_INFORMATION', 'Diese Seite wird derzeit Wartungsarbeiten unterzogen. Bitte versuchen Sie es sp&auml;ter nocheinmal. Vielen Dank f&uuml;r Ihr Verst&auml;ndnis.');
+define('TEXT_MAINTENANCE_ON_AT_TIME', 'Der Admin / Webmaster has die Wartungsarbeiten begonnen um: ');
+define('TEXT_MAINTENANCE_PERIOD', 'voraussichtliche Dauer der Wartungsarbeiten: ');
+define('DOWN_FOR_MAINTENANCE_STATUS_TEXT', 'Um den Status der Seite abzufragen ... Hier Klicken:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/download.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/download.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/download.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,12 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/downloadbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/downloadbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/downloadbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ define('TEXT_HEADING_DOWNLOAD_DATE', 'Date Download');
+ define('TEXT_HEADING_DOWNLOAD_COUNT', 'Number of times downloaded');
+ define('TEXT_DOWNLOAD_MY_ACCOUNT', 'My Account');
+ define('TEXT_HEADING_DOWNLOAD_FILE', 'Your download is ready. Please click the title below');
+ define('TEXT_FOOTER_DOWNLOAD', 'If your download does not appear above, you can check you order at this link:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/events_calendar.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/events_calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/events_calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: events_calendar v1.00 2003/03/08 18:09:16 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+
+
+  define('NAVBAR_TITLE', 'Events Calendar');
+  define('HEADING_TITLE', 'Events Calendar');
+  define('TEXT_SELECT_EVENT', 'Select event');
+  
+  define('TEXT_EVENTS_FOR', 'Events for ');
+  define('TEXT_EVENT_DATE', 'Date :');
+  define('TEXT_EVENTS_START', 'Events starting on ');
+  define('TEXT_EVENT_START_DATE', 'From :');
+  define('TEXT_EVENT_END_DATE', 'Through :');
+  define('TEXT_EVENT_LINK', 'Link :');
+  define('TEXT_EVENT_OSC_LINK', 'Event link :');
+  define('TEXT_EVENT_TITLE', 'Title :');
+  define('TEXT_EVENT_DESCRIPTION', 'Event :');
+  define('TEXT_EVENT_MORE', '... More >>');
+  define('TEXT_NO_EVENTS', 'No Events found.');
+  define('TEXT_OTHER_EVENTS', 'Other events for today :');
+
+  define('TEXT_DISPLAY_NUMBER_OF_EVENTS', 'Displaying event n° <b>%d</b><b>%_</b> of <b>%d</b> for ');
+  define('TEXT_DISPLAY_NUMBER_OF_PAGES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> events) ');
+  define('MAX_DISPLAY_PAGE_LINKS', 5);
+  define('MAX_DISPLAY_NUMBER_EVENTS', 5);
+  
+  define('BOX_CALENDAR_TITLE', ' View all events');
+  define('BOX_GO_BUTTON', 'go');
+  define('BOX_GO_BUTTON_TITLE', ' submit - month view ');
+  define('BOX_TODAY_BUTTON', ' T ');
+  define('BOX_TODAY_BUTTON_TITLE', ' view this month ');
+  define('BOX_YEAR_VIEW_BUTTON', ' Y ');
+  define('BOX_YEAR_VIEW_BUTTON_TITLE', ' year view ');
+  define('BOX_NEXT_LINK', 'next_month');
+  define('BOX_PREV_LINK', 'previous_month');
+  define('BOX_CLICK_LINK', 'Click for events');
+  
+  define('FIRST_DAY_OF_WEEK', 0);// First day of the week  1=Monday 0=Sunday;
+
+  define('NUMBER_OF_YEARS', 5);  //n° of years to be shown in drop-down
+  
+  define('MONTHS_SHORT_ARRAY', 'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC');
+  
+
+  
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+define('NAVBAR_TITLE', 'FAQ');
+
+define('HEADING_TITLE', 'Frequently Asked Questions');
+define('FAQ_BACK_TO_TOP', '[Nach Oben]');
+
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/faq_mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/faq_mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/faq_mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  FAQ system for OSC 2.2 MS2 v2.1  22.02.2005
+  Originally Created by: http://adgrafics.com admin at adgrafics.net
+  Updated by: http://www.webandpepper.ch osc at webandpepper.ch v2.0 (03.03.2004)
+  Last Modified: http://shopandgo.caesium55.com timmhaas at web.de v2.1 (22.02.2005)
+  Released under the GNU General Public License
+  osCommerce, Open Source E-Commerce Solutions
+  Copyright (c) 2004 osCommerce
+*/
+
+define('NAVBAR_TITLE', 'FAQ');
+
+define('TABLE_HEADING_NEW_FAQ', 'Frequently Asked Questions');
+define('FAQ_BACK_TO_TOP', '[Back To Top]');
+
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/featured_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/featured_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/featured_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Featured Products Listing Language File
+*/
+
+define('NAVBAR_TITLE', 'Spezielle Produkte');
+define('HEADING_TITLE', 'Spezielle Produkte');
+
+define('TEXT_NO_FEATURED_PRODUCTS', 'Keine Speziellen Produkte vorhanden.');
+define('TEXT_DATE_ADDED', 'Hinzugef&uuml;gt am:');
+define('TEXT_MANUFACTURER', 'Hersteller:');
+define('TEXT_PRICE', 'Preis:');
+
+  define('TABLE_HEADING_IMAGE', 'Product Image');
+  define('TABLE_HEADING_MODEL', 'Model');
+  define('TABLE_HEADING_PRODUCTS', 'Product Name');
+  define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+  define('TABLE_HEADING_QUANTITY', 'Quantity');
+  define('TABLE_HEADING_PRICE', 'Price');
+  define('TABLE_HEADING_WEIGHT', 'Weight');
+  define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+  define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+  define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+  define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+  define('TEXT_SHOW', '<b>Show:</b>');
+  define('TEXT_BUY', 'Buy 1 \'');
+  define('TEXT_NOW', '\' now');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/gv_faq.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/gv_faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/gv_faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: gv_faq.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Geschenk-Gutschein FAQ');
+define('HEADING_TITLE', 'Geschenk-Gutschein FAQ');
+
+define('TEXT_INFORMATION', '<a name="Top"></a>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=1','NONSSL').'">Geschenk-Gutscheine kaufen</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=2','NONSSL').'">Wie Sie Geschenk-Gutscheine versenden</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=3','NONSSL').'">Einkaufen mit Geschenkgutscheinen</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=4','NONSSL').'">Einl&ouml;sen von Geschenk-Gutscheinen</a><br>
+  <a href="'.tep_href_link(FILENAME_GV_FAQ,'faq_item=5','NONSSL').'">Wenn Probleme auftauchen</a><br>
+');
+switch ($HTTP_GET_VARS['faq_item']) {
+  case '1':
+define('SUB_HEADING_TITLE','Geschenk-Gutscheine kaufen.');
+define('SUB_HEADING_TEXT','Geschenk-Gutscheine werden genauso wie andere Artikel in unserem Shop gekauft.
+  Sie k&ouml;nnen diese auch durch die Standard-Zahlungsweise des Shops bezahlen.
+  Sobald gekauft, wird der Wert des Geschenk-Gutscheines zu Ihrem pers&ouml;nlichen
+  Geschenk-Gutschein Konto gebucht. Wenn Sie Guthaben auf Ihrem Geschenk-Gutschein Konto haben,
+  wird der Gegenwert in der Warenkorb-Box angezeigt, und ein Link zu der Seite hergestellt,
+  von der aus Sie den Gutschein an jemanden per email versenden k&ouml;nnen.');
+  break;
+  case '2':
+define('SUB_HEADING_TITLE','Wie Sie Geschenk-Gutscheine versenden.');
+define('SUB_HEADING_TEXT','Um einen Geschenk-Gutschein zu senden, m&uuml;ssen Sie unsere Geschenk-Gutschein-Seite besuchen.
+  Sie k&ouml;nnen den Link zu dieser Seite in der Warenkorb-Box an der rechtsseitigen Spalte auf jeder Seite finden.
+  Wenn Sie einen Geschenk-Gutschein versenden, m&uuml;ssen Sie folgendes angeben:
+  - Name und Email Adresse des Geschenk-Gutschein-Empf&auml;ngers
+  - Der Wert, den Sie versenden wollen. (Beachten Sie: Sie m&uuml;ssen nicht den gesamten Betrag auf einmal versenden,
+    den Sie auf Ihrem Geschenk-Gutschein-Konto zur Verf&uuml; gung haben.)
+  - Eine kurze Nachricht an den Empf&auml;nger, welche in der Email stehen wird.
+  Bitte stellen Sie sicher, dass Sie die Informationen korrekt eingegeben haben, obgleich
+  Sie nat&uuml;rlich die M&ouml;glichkeit haben, diese Informationen vor dem Versenden der Email beliebig zu &auml;ndern.');
+  break;
+  case '3':
+  define('SUB_HEADING_TITLE','Einkaufen mit Geschenkgutscheinen.');
+  define('SUB_HEADING_TEXT','Wenn Sie &uuml;ber Guthaben auf Ihrem Gutschein-Konto verf&uuml;gen, k&ouml;nnen Sie damit Artikel aus dem Onlineshop kaufen.
+  An der Kasse wird eine zus&auml;tzliche Checkbox erscheinen.
+  Wenn Sie das H&auml;kchen dort setzen, wird der Ihr Einkauf mit dem Gutschein-Konto verrechnet.
+  Bitte beachten Sie, dass falls Ihr Guthaben auf dem Gutschein-Konto die Kosten des Einkaufs nicht abdecken sollte, m&uuml;ssen Sie noch eine andere Zahlungsmethode w&auml;hlen.
+  Sollte Ihr Guthaben auf den Gutschein-Konto gr&ouml;ßer sein als Ihre Rechnungssumme, verbleibt der Restbetrag auf Ihrem Gutschrift-Konto für zuk&uuml;nftige Eink&auml;ufe.');
+  break;
+  case '4':
+  define('SUB_HEADING_TITLE','Einl&ouml;sen von Geschenk-Gutscheinen.');
+  define('SUB_HEADING_TEXT','Wenn Sie einen Geschenk-Gutschein per E-Mail bekommen, enth&auml;lt diese Angaben dar&uuml;ber, wer Ihnen diesen Gutschein gesendet hat; evtl. mit einer kurzen Nachricht des Absenders.
+  Die E-Mail enth&auml;lt auch die Geschenk-Gutschein-Nummer.
+  Eine gute Idee ist es, sich einen Ausdruck dieser Email zu machen um sp&auml;ter Bezug darauf nehmen zu k&ouml;nnen.
+  Sie k&ouml;nnen den Geschenk-Gutschein nun auf zwei Arten einl&ouml;sen<br>
+    1. Durch klicken des Links in dieser Email:<br>
+    Dadurch gelangen Sie direkt zur Seite "Gutschein einl&ouml;sen".
+    Bevor der Geschenkgutschein &uuml;berpr&uuml;ft wird und auf Ihr Geschenk-Gutschein-Konto gebucht werden kann, sind Sie aufgefordert, ein Konto zu er&ouml;ffnen.
+    Die Einrichtung dieses Kontos ist für Sie kostenlos und ohne Verpflichtungen.
+    2. Auf der Kasse-Seite beim W&auml;hlen der Zahlungsmethode ist ein Feld für den Gutschein-Code vorgesehen.
+    Geben Sie dort den Code ein und klicken sie auf den "Einl&ouml;sen" Button.
+    Der Code wird nach erfolgter &Uuml;berpr&uuml;fung Ihrem Geschenk-Gutschein-Konto gutgeschrieben.
+    Sie k&ouml;nnen den Betrag nun f&uuml;r jeden Artikel unseres Online-Shops verwenden.');
+  break;
+  case '5':
+  define('SUB_HEADING_TITLE','Wenn Probleme auftauchen.');
+  define('SUB_HEADING_TEXT','F&uuml;r alle das Geschenk-Gutschein-System betreffenden Anfragen, kontaktieren Sie uns bitte
+  per Email an '. STORE_OWNER_EMAIL_ADDRESS . '. Bitte geben Sie uns in Ihrer Email an uns so viel Informationen als m&ouml;glich an. ');
+  break;
+  default:
+  define('SUB_HEADING_TITLE','');
+  define('SUB_HEADING_TEXT','Bitte w&auml;hlen Sie eine der obigen Fragen aus.');
+
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/gv_redeem.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/gv_redeem.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/gv_redeem.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: gv_redeem.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Geschenk-Gutschein einl&ouml;sen');
+define('HEADING_TITLE', 'Geschenk-Gutschein einl&ouml;sen');
+define('TEXT_INFORMATION', 'F&uuml;r weitere Informationen zu unseren Geschenk-Gutscheinen sehen Sie sich bitte unsere <a href="' . tep_href_link(FILENAME_GV_FAQ,'','NONSSL').'">'.GV_FAQ.'</a> an.');
+define('TEXT_INVALID_GV', 'Dieser Geschenk-Gutschein kann ung&uuml;ltig sein, oder wurde bereits eingel&ouml;st. Um den Shop-Besitzer zu kontaktieren, benutzen Sie bitte die Kontaktseite');
+define('TEXT_VALID_GV', 'Gl&uuml;ckwunsch, Sie haben einen Geschenk-Gutschein im Wert von %s eingel&ouml;st');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/gv_send.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/gv_send.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/gv_send.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: gv_send.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Gift Voucher System v1.0
+  Copyright (c) 2001,2002 Ian C Wilson
+  http://www.phesis.org
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Geschenk-Gutschein versenden');
+define('NAVBAR_TITLE', 'Geschenk-Gutschein versenden');
+define('EMAIL_SUBJECT', 'Anfrage von ' . STORE_NAME);
+define('HEADING_TEXT','<br>Bitte machen Sie unterhalb Angaben zum Geschenk-Gutschein, den Sie versenden m&ouml;chten. F&uuml;r weitere Informationen sehen Sie bitte in unsere <a href="' . tep_href_link(FILENAME_GV_FAQ,'','NONSSL').'">'.GV_FAQ.'.</a><br>');
+define('ENTRY_NAME', 'Name des Empf&auml;ngers:');
+define('ENTRY_EMAIL', 'Emailadresse des Empf&auml;ngers:');
+define('ENTRY_MESSAGE', 'Nachricht an Empf&auml;nger:');
+define('ENTRY_AMOUNT', 'Wert des Geschenk-Gutscheins:');
+define('ERROR_ENTRY_AMOUNT_CHECK', '&nbsp;&nbsp;<span class="errorText">Ung&uuml;ltiger Wert</span>');
+define('ERROR_ENTRY_EMAIL_ADDRESS_CHECK', '&nbsp;&nbsp;<span class="errorText">Ung&uuml;ltige Emailadresse</span>');
+define('MAIN_MESSAGE', 'Sie haben entschieden einen Geschenk-Gutschein im Wert von %s an %s mit der Emailadresse %s zu versenden<br><br>Das Begleitschreiben wird folgendermassen aussehen:<br><br>Hallo %s<br><br>
+                        Ihnen wurde ein Geschenk-Gutschein im Wert von %s durch %s zugesandt');
+
+define('PERSONAL_MESSAGE', '%s sagt');
+define('TEXT_SUCCESS', 'Gl&uuml;ckwunsch, Ihr Geschenk-Gutschein wurde erfolgreich versandt');
+
+
+define('EMAIL_SEPARATOR', '----------------------------------------------------------------------------------------');
+define('EMAIL_GV_TEXT_HEADER', 'Glückwunsch, Sie haben einen Geschenk-Gutschen im Wert von %s erhalten');
+define('EMAIL_GV_TEXT_SUBJECT', 'Ein Geschenk von %s');
+define('EMAIL_GV_FROM', 'Dieser Geschenk-Gutschein wurde Ihnen von %s zugesandt');
+define('EMAIL_GV_MESSAGE', 'mit folgendem Begleitschreiben ');
+define('EMAIL_GV_SEND_TO', 'Hallo, %s');
+define('EMAIL_GV_REDEEM', 'Um diesen Geschenk-Gutschein einzul&ouml;sen, klicken Sie bitte auf den Link unterhalb. Bitte notieren Sie sich auch den Einl&ouml;se-Code, welcher lautet %s. (F&uuml;r den Fall, daß Probleme auftauchen)');
+define('EMAIL_GV_LINK', 'Zum Einl&ouml;sen klicken Sie bitte ');
+define('EMAIL_GV_VISIT', ' oder besuchen Sie ');
+define('EMAIL_GV_ENTER', ' und geben Sie diesen Code ein: ');
+define('EMAIL_GV_FIXED_FOOTER', 'Wenn Sie Probleme haben, den Gutschen mit dem automatisierten Link oberhalb einzulösen, ' . "\n" .
+                                'k&ouml;nnen Sie auch den Geschenk-Gutschein Code auch an der Kasse unseres Online-Shops einl&ouml;sen.' . "\n\n");
+define('EMAIL_GV_SHOP_FOOTER', '');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/header_tags.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/header_tags.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/header_tags.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+// /catalog/includes/languages/english/header_tags.php
+// WebMakers.com Added: Header Tags Generator v2.5.2
+// Add META TAGS and Modify TITLE
+//
+// DEFINITIONS FOR /includes/languages/english/header_tags.php
+
+// Define your email address to appear on all pages
+define('HEAD_REPLY_TAG_ALL', STORE_OWNER_EMAIL_ADDRESS);
+
+// For all pages not defined or left blank, and for products not defined
+// These are included unless you set the toggle switch in each section below to OFF ( '0' )
+// The HEAD_TITLE_TAG_ALL is included AFTER the specific one for the page
+// The HEAD_DESC_TAG_ALL is included AFTER the specific one for the page
+// The HEAD_KEY_TAG_ALL is included AFTER the specific one for the page
+define('HEAD_TITLE_TAG_ALL', STORE_NAME);
+define('HEAD_DESC_TAG_ALL','What\'s New Here? - Hardware Software DVD Movies');
+define('HEAD_KEY_TAG_ALL','Hardware, Software, DVD Movies, Computer');
+
+// DEFINE TAGS FOR INDIVIDUAL PAGES
+
+// index.php
+define('HTTA_DEFAULT_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title
+define('HTKA_DEFAULT_ON','1'); // Include HEAD_KEY_TAG_ALL in Keywords
+define('HTDA_DEFAULT_ON','1'); // Include HEAD_DESC_TAG_ALL in Description
+define('HTTA_CAT_DEFAULT_ON', '0'); //Include HEADE_TITLE_DEFAULT in CATEGORY DISPLAY
+define('HEAD_TITLE_TAG_DEFAULT', 'CRE Loaded 6');
+define('HEAD_DESC_TAG_DEFAULT','osCommerce : What\'s New Here? - Hardware Software DVD Movies');
+define('HEAD_KEY_TAG_DEFAULT','Hardware, Software, DVD Movies, Computer');
+
+// product_info.php - if left blank in products_description table these values will be used
+define('HTTA_PRODUCT_INFO_ON','1');
+define('HTKA_PRODUCT_INFO_ON','1');
+define('HTDA_PRODUCT_INFO_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_INFO','');
+define('HEAD_DESC_TAG_PRODUCT_INFO','');
+define('HEAD_KEY_TAG_PRODUCT_INFO','');
+
+// products_new.php - whats_new
+define('HTTA_WHATS_NEW_ON','1');
+define('HTKA_WHATS_NEW_ON','1');
+define('HTDA_WHATS_NEW_ON','1');
+define('HEAD_TITLE_TAG_WHATS_NEW', 'New Products');
+define('HEAD_DESC_TAG_WHATS_NEW', '');
+define('HEAD_KEY_TAG_WHATS_NEW', '');
+
+// specials.php
+// If HEAD_KEY_TAG_SPECIALS is left blank, it will build the keywords from the products_names of all products on special
+define('HTTA_SPECIALS_ON','1');
+define('HTKA_SPECIALS_ON','1');
+define('HTDA_SPECIALS_ON','1');
+define('HEAD_TITLE_TAG_SPECIALS','Specials');
+define('HEAD_DESC_TAG_SPECIALS','');
+define('HEAD_KEY_TAG_SPECIALS','');
+
+// product_reviews_info.php and product_reviews.php - if left blank in products_description table these values will be used
+define('HTTA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HTKA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HTDA_PRODUCT_REVIEWS_INFO_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_REVIEWS_INFO','');
+define('HEAD_DESC_TAG_PRODUCT_REVIEWS_INFO','');
+define('HEAD_KEY_TAG_PRODUCT_REVIEWS_INFO','');
+
+// PRODUCTS_REVIEWS_WRITE.PHP
+define('HTTA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HTKA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HTDA_PRODUCT_REVIEWS_WRITE_ON','1');
+define('HEAD_TITLE_TAG_PRODUCT_REVIEWS_WRITE','');
+define('HEAD_DESC_TAG_PRODUCT_REVIEWS_WRITE','');
+define('HEAD_KEY_TAG_PRODUCT_REVIEWS_WRITE','');
+
+ // ALLPRODS.PHP
+define('HTTA_ALLPRODS_ON','1');
+define('HTKA_ALLPRODS_ON','1');
+define('HTDA_ALLPRODS_ON','1');
+define('HEAD_TITLE_TAG_ALLPRODS','');
+define('HEAD_DESC_TAG_ALLPRODS','');
+define('HEAD_KEY_TAG_ALLPRODS','');
+
+// articles.php
+define('HTTA_ARTICLES_ON','1'); // Include HEAD_TITLE_TAG_ALL in Title
+define('HTKA_ARTICLES_ON','0'); // Include HEAD_KEY_TAG_ALL in Keywords
+define('HTDA_ARTICLES_ON','0'); // Include HEAD_DESC_TAG_ALL in Description
+define('HEAD_TITLE_TAG_ARTICLES','CRE Loaded Store Articles');
+define('HEAD_DESC_TAG_ARTICLES','Articles');
+define('HEAD_KEY_TAG_ARTICLES','articles');
+
+// article_info.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_INFO_ON','1');
+define('HTKA_ARTICLE_INFO_ON','1');
+define('HTDA_ARTICLE_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_INFO','Articles');
+define('HEAD_DESC_TAG_ARTICLE_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_INFO','');
+
+// articles_new.php - new articles
+// If HEAD_KEY_TAG_ARTICLES_NEW is left blank, it will build the keywords from the articles_names of all new articles
+define('HTTA_ARTICLES_NEW_ON','1');
+define('HTKA_ARTICLES_NEW_ON','1');
+define('HTDA_ARTICLES_NEW_ON','1');
+define('HEAD_TITLE_TAG_ARTICLES_NEW','Lastest Articles');
+define('HEAD_DESC_TAG_ARTICLES_NEW','');
+define('HEAD_KEY_TAG_ARTICLES_NEW','');
+
+// article_reviews_info.php and article_reviews.php - if left blank in articles_description table these values will be used
+define('HTTA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTKA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HTDA_ARTICLE_REVIEWS_INFO_ON','1');
+define('HEAD_TITLE_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_DESC_TAG_ARTICLE_REVIEWS_INFO','');
+define('HEAD_KEY_TAG_ARTICLE_REVIEWS_INFO','');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/images/icon.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/languages/german/images/icon.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/languages/german/images/icon.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/languages/german/images/icon.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/languages/german/index.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: index.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
+  define('HEADING_TITLE', 'Unser Angebot');
+} elseif ($category_depth == 'top') {
+  define('HEADING_TITLE', 'Unser Angebot');
+} elseif ($category_depth == 'nested') {
+  define('HEADING_TITLE', 'Kategorien');
+}
+define('TEXT_MAIN', 'Dies ist eine Standardinstallation von osCommerce. Alle hier gezeigten Artikel sind fiktiv zu verstehen. <b>Eine hier get&auml;tigte Bestellung wird NICHT ausgef&uuml;hrt werden, Sie erhalten keine Lieferung oder Rechnung.</b><br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>Fehlermeldungen</b><br><br>Sollten sich im oberen Bildschirmbereich Fehler oder Warnungen befinden, korrigieren Sie diese bitte entsprechend den dort gegebenen Hinweisen.<br><br>Fehlermeldungen sind durch eine entsprechende <span class="messageStackError">Hintergrundfarbe</span> gekennzeichnet.<br><br>Es werden standardm&auml;ssig verschiedene &Uuml;berpr&uuml;fungen durchgef&uuml;hrt. Sie k&ouml;nnen diese Checks durch &Auml;nderungen in der Datei includes/application_top.php abschalten.</td></tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main" valign="top"><b>Seiteninhalte bearbeiten</b><br><br>Dieser Text befindet sich im jeweiligen Sprachverzeichnis in folgender Datei: <br><br><nobr class="messageStackSuccess">[Pfad zu catalog]/includes/languages/' . $language . '/' . FILENAME_DEFAULT . '</nobr><br><br>Sie k&ouml;nnen diese Datei entweder direkt mit einem Editor bearbeiten, oder im Administrations-Modus &uuml;ber <nobr class="messageStackSuccess">Languages->' . ucfirst($language) . '->Sprachen</nobr> oder &uuml;ber <nobr class="messageStackSuccess">Hilfsprogramme->Datei-Manager</nobr>.<br><br>Der Text wird folgendermassen gesetzt: <br><br><nobr>define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">Dies ist eine Standardinstallation von osCommerce ...</span>\');</nobr><br><br>Der gr&uuml;n hinterlegte Teil soll dabei ge&auml;ndert werden - wicthig ist, dass Sie auf keinen Fall den define()-Befehl f&uml;r TEXT_MAIN editieren. Um den kompletten Text zu entfernen, setzen Sie TEXT_MAIN folgendermassen: <br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>Mehr Informationen &uuml;ber diesen Befehl erhalten Sie <a href="http://www.php.net/define" target="_blank"><u>hier</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>Das Administrationswerkzeug sichern</b><br><br>Nach einer Standardinstallation von osCommerce ist das Administrationswerkzeug NICHT gesch&uuml;tzt. Es ist daher sehr wichtig diesen Teil von osCommerce abzusichern.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/4.gif') . '</td><td class="main" valign="top"><b>Online-Handbuch</b><br><br>Unser Online-Handbuch auf Englisch befindet sich unter <a href="http://wiki.oscommerce.com" target="_blank"><u>osCommerce Wiki Documentation Effort</u></a>.<br><br>Unsere deutschsprachige Support Community finden Sie unter <a href="http://forums.oscommerce.de" target="_blank"><u>osCommerce German Community Support Forums</u></a>.</td></tr></table><br>Wenn Sie dass System hinter diesem Shop downloaden wollen, oder wenn Sie L&ouml;sungen zu osCommerce beitragen wollen, besuchen Sie uns bitte unter <a href="http://www.oscommerce.com" target="_blank"><u>der Support Site von osCommerce</u></a>. Dieser Shop verwendet osCommerce in der Version <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font>.');
+define('TABLE_HEADING_NEW_PRODUCTS', 'Neue Artikel im %s');
+define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Wann ist was verf&uuml;gbar');
+define('TABLE_HEADING_DATE_EXPECTED', 'Voraussichtlich ab');
+define('TABLE_HEADING_DEFAULT_SPECIALS', 'Angebote f&uuml;r %s');
+  define('TABLE_HEADING_IMAGE', '');
+  define('TABLE_HEADING_MODEL', 'Artikel-Nr.');
+  define('TABLE_HEADING_PRODUCTS', 'Artikel');
+  define('TABLE_HEADING_MANUFACTURER', 'Hersteller');
+  define('TABLE_HEADING_QUANTITY', 'Anzahl');
+  define('TABLE_HEADING_PRICE', 'Preis');
+  define('TABLE_HEADING_WEIGHT', 'Gewicht');
+  define('TABLE_HEADING_BUY_NOW', 'Bestellen');
+  define('TEXT_NO_PRODUCTS', 'Es gibt keine Artikel in dieser Kategorie.');
+  define('TEXT_NO_PRODUCTS2', 'Es gibt keinen Artikel, das von diesem Hersteller stammt.');
+  define('TEXT_NUMBER_OF_PRODUCTS', 'Artikel: ');
+  define('TEXT_SHOW', '<b>Darstellen:</b>');
+  define('TEXT_BUY', '1 x \'');
+  define('TEXT_NOW', '\' bestellen!');
+  define('TEXT_ALL_CATEGORIES', 'Alle Kategorien');
+  define('TEXT_ALL_MANUFACTURERS', 'Alle Hersteller');
+  define('HEADING_CUSTOMER_GREETING', 'Unsere Kundenbegr&uuml;ssung');
+  define('MAINPAGE_HEADING_TITLE', 'Hauptseiten-Heading Titel');
+// BOF: Lango added for Featured Products
+  define('TABLE_HEADING_FEATURED_PRODUCTS', 'Spezielle Produkte');
+  define('TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY', 'Spezielle Produkte in %s');
+// EOF: Lango added for Featured Products
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/info_shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/info_shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/info_shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: info_shopping_cart.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Besucherwarenkorb / Kundenwarenkorb');
+define('SUB_HEADING_TITLE_1', 'Besucherwarenkorb');
+define('SUB_HEADING_TITLE_2', 'Kundenwarenkorb');
+define('SUB_HEADING_TITLE_3', 'Information');
+define('SUB_HEADING_TEXT_1', 'Jeder Besucher unseres Online-Shops bekommt einen \'Besucherwarenkorb\'. Damit kann er seine ausgew&auml;hlten Artikel sammeln. Sobald der Besucher den Online-Shop verl&auml;sst, verf&auml;llt dessen Inhalt.');
+define('SUB_HEADING_TEXT_2', 'Jeder angemeldete Kunde verf&uuml;gt &uuml;ber einen \'Kundenwarenkorb\' zum Einkaufen, mit dem er auch zu einem sp&auml;terem Zeitpunkt den Einkauf beenden kann. Jeder Artikel bleibt darin registriert bis der Kunde zur Kasse geht, oder die Artikel darin l&ouml;scht.');
+define('SUB_HEADING_TEXT_3', 'Die Besuchereingaben werden automatisch bei der Registrierung als Kunde in den Kundenwarenkorb &uuml;bernommen.');
+define('TEXT_CLOSE_WINDOW', '<b><u>[Fenster schliessen]</b></u>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/information.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/02
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+  define('HEADING_TITLE', 'Information');
+  define('ACTION_INFORMATION', 'Action');
+  define('ACTIVATION_ID_INFORMATION', 'Activation the information ID=');
+  define('ADD_INFORMATION', 'Add new information');
+  define('ADD_QUEUE_INFORMATION', ' Add information to queue');
+  define('ALERT_INFORMATION', 'Empty information system');
+  define('ANSWER_INFORMATION', 'Answer');
+  define('CONFIRM_INFORMATION', 'Confirm');
+  define('DEACTIVATION_ID_INFORMATION', 'Deactivation the information ID=');
+  define('DELETE_CONFITMATION_ID_INFORMATION', 'Delete Confirmation information ID=');
+  define('DELETE_ID_INFORMATION', 'Delete the information ID=');
+  define('DELETED_ID_INFORMATION', 'Deleted the information ID=');
+  define('EDIT_ID_INFORMATION', 'Edit the information ID=');
+  define('ERROR_20_INFORMATION', 'You have not defined a valid value for option <b>Queue</b>. You can only define a numeric value');
+  define('ERROR_80_INFORMATION', 'You did not fill all <b>necessary fields</b>');
+  define('INFORMATION_ID_ACTIVE', 'this information is Active');
+  define('INFORMATION_ID_DEACTIVE', 'this information is NOT active');
+  define('ID_INFORMATION', 'ID');
+  define('TITLE_INFORMATION', 'Title');
+  define('DESCRIPTION_INFORMATION', 'Description');
+  define('QUEUE_INFORMATION', 'Queue');
+  define('QUEUE_INFORMATION_LIST', 'QueueList: ');
+  define('MANAGER_INFORMATION', 'Information Manager');
+  define('NO_INFORMATION', 'No');
+  define('PUBLIC_INFORMATION', 'Public');
+  define('SORT_BY', 'In information Page this Sort by');
+  define('SUCCED_INFORMATION', ' Succeed');
+  define('TITLE', 'Information system');
+  define('VIEW_INFORMATION', 'Information View');
+  define('VISIBLE_INFORMATION', 'Visible');
+  define('VISIBLE_INFORMATION_DO', '( To Do visible )');
+  define('UPDATE_ID_INFORMATION', 'Updated information ID=');
+  define('WARNING_INFORMATION', 'Warning');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/informationbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/informationbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/informationbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  $Id: download.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+ // information box text in includes/boxes/information.php
+define('BOX_HEADING_INFORMATION', 'Information');
+define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
+define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
+define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');
+define('BOX_INFORMATION_CONTACT', 'Contact Us');
+define('BOX_INFORMATION_LINKS', 'Links');
+define('BOX_INFORMATION_TRACKING', 'Information');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/ipn.lng.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/ipn.lng.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/ipn.lng.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: ipn.lng.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('UNKNOWN_TXN_TYPE', 'Unknown Transaction Type');
+  define('UNKNOWN_TXN_TYPE_MSG', 'An unknown transaction (%s) occurred from ' . $_SERVER['REMOTE_ADDR'] . "\nAre you running any tests?\n\n");
+  define('UNKNOWN_POST', 'Unknown Post');
+  define('UNKNOWN_POST_MSG', "An unknown POST from %s was received.\nAre you running any tests?\n\n");
+  define('EMAIL_SEPARATOR', "------------------------------------------------------");
+  define('RESPONSE_VERIFIED', 'Verified');
+  define('RESPONSE_MSG', "Connection Type\n".EMAIL_SEPARATOR."\ncurl= %s, socket= %s, domain= %s, port= %s \n\nPayPal Response\n".EMAIL_SEPARATOR."\n%s \n\n");
+  define('RESPONSE_INVALID', 'Invalid PayPal Response');
+  define('RESPONSE_UNKNOWN', 'Unknown Verfication');
+  define('EMAIL_RECEIVER', 'Email and Business ID config');
+  define('EMAIL_RECEIVER_MSG', "Store Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n".EMAIL_SEPARATOR."\nPayPal Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n\n");
+  define('EMAIL_RECEIVER_ERROR_MSG', "Store Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n".EMAIL_SEPARATOR."\nPayPal Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n\nPayPal Transaction ID: %s\n\n");
+  define('TXN_DUPLICATE', 'Duplicate Transaction');
+  define('TXN_DUPLICATE_MSG', "A duplicate IPN transaction (%s) has been received.\nPlease check your PayPal Account\n\n");
+  define('IPN_TXN_INSERT', "IPN INSERTED");
+  define('IPN_TXN_INSERT_MSG', "IPN %s has been inserted\n\n");
+  define('CHECK_CURRENCY', 'Validate Currency');
+  define('CHECK_CURRENCY_MSG', "Incorrect Currency\nPayPal: %s\nosC: %s\n\n");
+  define('CHECK_TXN_SIGNATURE', 'Validate PayPal_Shopping_Cart Transaction Signature');
+  define('CHECK_TXN_SIGNATURE_MSG', "Incorrect Signature\nPayPal: %s\nosC: %s\n\n");
+  define('CHECK_TOTAL', 'Validate Total Transaction Amount');
+  define('CHECK_TOTAL_MSG', "Incorrect Total\nPayPal: %s\nSession: %s\n\n");
+  define('DEBUG', 'Debug');
+  define('DEBUG_MSG', "\nOriginal Post\n".EMAIL_SEPARATOR."\n%s\n\n\nReconstructed Post\n".EMAIL_SEPARATOR."\n%s\n\n");
+  define('PAYMENT_SEND_MONEY_DESCRIPTION', 'Money Received');
+  define('PAYMENT_SEND_MONEY_DESCRIPTION_MSG', "You have received a payment of %s %s \n".EMAIL_SEPARATOR."\nThis payment was sent by someone from the PayPal website, using the Send Money tab\n\n");
+  define('TEST_INCOMPLETE', 'Invalid Test');
+  define('TEST_INCOMPLETE_MSG', "An error has occured, mostly likely because the Custom field in the IPN Test Panel did not have a valid transaction id.\n\n\n");
+  define('HTTP_ERROR', 'HTTP Error');
+  define('HTTP_ERROR_MSG', "An HTTP Error occured during authentication\n".EMAIL_SEPARATOR."\ncurl= %s, socket= %s, domain= %s, port= %s\n\n");
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/links.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: links.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Links');
+
+if ($display_mode == 'links') {
+  define('HEADING_TITLE', 'Links');
+} elseif ($display_mode == 'categories') {
+  define('HEADING_TITLE', 'Link Kategorien');
+}
+
+  define('TABLE_HEADING_LINKS_IMAGE', '');
+  define('TABLE_HEADING_LINKS_TITLE', 'Titel');
+  define('TABLE_HEADING_LINKS_URL', 'URL');
+  define('TABLE_HEADING_LINKS_DESCRIPTION', 'Beschreibung');
+  define('TABLE_HEADING_LINKS_COUNT', 'Klicks');
+  define('TEXT_NO_LINKS', 'Es befinden sich keine Links in dieser Kategorie.');
+  define('TEXT_NO_CATEGORIES', 'Es sind keine Link Kategorien vorhanden.');
+
+
+// VJ todo - move to common language file
+define('TEXT_DISPLAY_NUMBER_OF_LINKS', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Links as)');
+
+define('IMAGE_BUTTON_SUBMIT_LINK', 'Link eintragen');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/links_submit.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/links_submit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/links_submit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: links_submit.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Links');
+define('NAVBAR_TITLE_2', 'Link eintragen');
+
+define('HEADING_TITLE', 'Link Information');
+
+define('TEXT_MAIN', 'Bitte geben Sie die folgenden Informationen an, um Ihre Webseite einzutragen.');
+
+define('EMAIL_SUBJECT', 'Willkommen beim ' . STORE_NAME . ' link exchange.');
+define('EMAIL_GREET_NONE', 'Hallo %s' . "\n\n");
+define('EMAIL_WELCOME', 'Wir heissen Sie willkommen beim <b>' . STORE_NAME . '</b> Link-Tausch.' . "\n\n");
+define('EMAIL_TEXT', 'Ihr Link wurde erfolgreich bei ' . STORE_NAME . ' eingetragen. Er wird angezeigt, sobald wir diesen Link positiv begutachtet haben. Sie werden eine Email &uuml;ber den Status des Eintrags erhalten. Sollten Sie diese Email nicht innerhalb von 48 Stunden nach Eintrag erhalten, kontaktieren Sie uns bitte, bevor Sie den Link abermals eintragen.' . "\n\n");
+define('EMAIL_CONTACT', 'F&uuml;r Hilfe zu unserem Link-Tausch Programm kontaktieren Sie uns bitte: ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n\n");
+define('EMAIL_WARNING', '<b>Achtung:</b> Diese Emailadresse wurde uns im Zuge eines Linkeintrags genannt. Wenn Sie auf Probleme stossen, kontaktieren Sie und bitte: ' . STORE_OWNER_EMAIL_ADDRESS . '.' . "\n");
+define('EMAIL_OWNER_SUBJECT', 'Link Eintrag bei ' . STORE_NAME);
+define('EMAIL_OWNER_TEXT', 'Ein neuer Link wurde bei ' . STORE_NAME . ' eingetragen. Er ist noch nicht begutachtet. Bitte &uuml;berpr&uuml;fen und aktivieren Sie den Link' . "\n\n");
+
+define('TEXT_LINKS_HELP_LINK', '&nbsp;Hilfe&nbsp;[?]');
+
+define('HEADING_LINKS_HELP', 'Links Hilfe');
+define('TEXT_LINKS_HELP', '<b>Seitentitel:</b> Ein aussagekr&auml;ftiger Titel f&uuml;r Ihre Webseite.<br><br><b>URL:</b> Die absolute Web-Adresse Ihrer Seite, welche das \'http://\' beinhaltet.<br><br><b>Kategorie:</b> Meist zutreffende Kategorie unter die Ihre Webseite f&auml;llt.<br><br><b>Beschreibung:</b> Eine kurze Beschreibung Ihrer Webseite.<br><br><b>Bild URL:</b> Die absolute URL des Bildes, welches Sie eintragen m&ouml;chten, inklusive dem \'http://\' davor. Dieses Bild wird gemeinsam mit Ihrem Webseiten-Link angezeigt.<br>zB: http://ihre-domain.com/pfad/zu/ihrem/bild.gif <br><br><b>Name:</b> Ihr ganzer Name.<br><br><b>Email:</b> Ihre Emailadresse. Bitte geben Sie eine g&uuml;ltige Emailadresse an, da Sie per Email &uuml;ber den Status benachrichtigt werden.<br><br><b>Reziprokale Seite:</b> Die absolute URL von Ihrer Links Seite, wo ein Link zu unserer Webseite angef&uuml;hrt ist.<br>zB: http://ihre-domain.com/pfad/zu/ihrer/links_seite.php');
+define('TEXT_CLOSE_WINDOW', '<u>Fenster schliessen</u> [x]');
+
+// VJ todo - move to common language file
+define('CATEGORY_WEBSITE', 'Webseiten Details');
+define('CATEGORY_RECIPROCAL', 'Details zur Reziprokalen Seite');
+
+define('ENTRY_LINKS_TITLE', 'Seitentitel:');
+define('ENTRY_LINKS_TITLE_ERROR', 'Linktitel muss zumindest ' . ENTRY_LINKS_TITLE_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_LINKS_TITLE_TEXT', '*');
+define('ENTRY_LINKS_URL', 'URL:');
+define('ENTRY_LINKS_URL_ERROR', 'URL muss zumindest ' . ENTRY_LINKS_URL_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_LINKS_URL_TEXT', '*');
+define('ENTRY_LINKS_CATEGORY', 'Kategorie:');
+define('ENTRY_LINKS_CATEGORY_TEXT', '*');
+define('ENTRY_LINKS_DESCRIPTION', 'Beschreibung:');
+define('ENTRY_LINKS_DESCRIPTION_ERROR', 'Beschreibung muss zumindest ' . ENTRY_LINKS_DESCRIPTION_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_LINKS_DESCRIPTION_TEXT', '*');
+define('ENTRY_LINKS_IMAGE', 'Bild URL:');
+define('ENTRY_LINKS_IMAGE_TEXT', '');
+define('ENTRY_LINKS_CONTACT_NAME', 'Name:');
+define('ENTRY_LINKS_CONTACT_NAME_ERROR', 'Ihr ganzer Name muss zumindest ' . ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_LINKS_CONTACT_NAME_TEXT', '*');
+define('ENTRY_LINKS_RECIPROCAL_URL', 'Reziprokale Seite:');
+define('ENTRY_LINKS_RECIPROCAL_URL_ERROR', 'Reziprokale Seite muss zumindest ' . ENTRY_LINKS_URL_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_LINKS_RECIPROCAL_URL_TEXT', '*');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/links_submit_success.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/links_submit_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/links_submit_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: links_submit_success.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Links');
+define('NAVBAR_TITLE_2', 'Erfolg');
+define('HEADING_TITLE', 'Ihr Link wurde eingetragen!');
+define('TEXT_LINK_SUBMITTED', 'Gl&uuml;chkwunsch! Ihr Link wurde erfolgreich abgeschickt! Er wird zu unserer Liste hinzugef&uuml;gt, sobald wir ihn genehmigt haben. Wenn Sie dazu <small><b>IRGENDWELCHE</b></small> Fragen haben, senden Sie bitte eine Email an unseren <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '"> Webmaster</a>.<br><br>Sie werden eine Best&auml;tigung des Link-Eintrags per Email erhalten. Wenn Sie dieses nicht innerhalb einer Stunde erhaltenr, <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '"> kontaktieren Sie uns</a> bitte. Ebenfalls werden Sie eine Email erhalten, sobald ein von Ihnen ageschickter Link zum Eintrag genehmigt wurde.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/login.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: login.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+//Email Validation
+define('TEXT_LOGIN_ERROR_VALIDATION', 'Error: Your account is not validated.');
+define('TEXT_YOU_HAVE_TO_VALIDATE', 'Please insert your Validation-key to confirm your registration');
+define('ENTRY_VALIDATION_CODE', 'Validation-key');
+define('TEXT_NEW_VALIDATION_CODE', '<b>Request a new Validation-key <u>here</u></b>');
+
+define('NAVBAR_TITLE', 'Anmelden');
+
+define('HEADING_TITLE', 'Melden Sie sich an');
+
+define('HEADING_NEW_CUSTOMER', 'Neuer Kunde');
+define('TEXT_NEW_CUSTOMER', 'Ich bin ein neuer Kunde.');
+define('TEXT_NEW_CUSTOMER_INTRODUCTION', 'Durch Ihre Anmeldung bei ' . STORE_NAME . ' sind Sie in der Lage schneller zu bestellen, kennen jederzeit den Status Ihrer Bestellungen und haben immer eine aktuelle &Uuml;bersicht &uuml;ber Ihre bisherigen Bestellungen.');
+define('HEADING_RETURNING_CUSTOMER', 'Bereits Kunde');
+define('TEXT_RETURNING_CUSTOMER', 'Ich bin bereits Kunde.');
+
+define('TEXT_PASSWORD_FORGOTTEN', 'Sie haben Ihr Passwort vergessen? Dann klicken Sie <u>hier</u>');
+
+define('TEXT_LOGIN_ERROR', 'Fehler: Keine &Uuml;bereinstimmung der eingebenen Email-Adresse und/oder dem Passwort.');
+define('TEXT_VISITORS_CART', '<font color="#ff0000"><b>Achtung:</b></font> Ihre Besuchereingaben werden automatisch mit Ihrem Kundenkonto verbunden. <a href="javascript:session_win();">[Mehr Information]</a>');
+// Begin Checkout Without Account v0.70 changes
+
+define('PWA_FAIL_ACCOUNT_EXISTS', 'An account already exists for the email address {EMAIL_ADDRESS}.  You must login here with the password for that account before proceeding to checkout.');
+// Begin Checkout Without Account v0.60 changes
+define('HEADING_CHECKOUT', 'Proceed Directly to Checkout');
+define('TEXT_CHECKOUT_INTRODUCTION', 'Proceed to Checkout without creating an account. By choosing this option none of your user information will be kept in our records, and you will not be able to review your order status, nor keep track of your previous orders.');
+define('PROCEED_TO_CHECKOUT', 'Proceed to Checkout without Registering');
+// End Checkout Without Account changes
+// Eversun mod for sppc and qty price breaks
+// define the email address that can change customer_group_id on login
+define('SPPC_TOGGLE_LOGIN_PASSWORD', 'support at creloaded.com');
+// Eversun mod for sppc and qty price breaks
+
+define('LOGIN_TITLE1', 'Choose a Customer Group');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  WebMakers.com Added: loginbox.php
+  Originally written by: Aubrey Kilian <aubrey at mycon.co.za>
+  Re-written by Linda McGrath osCOMMERCE at WebMakers.com
+  Modified by Justin of World Famous Comics <justin at wfcomics.com>
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('BOX_HEADING_LOGIN_BOX_MY_ACCOUNT','Konto Info.');
+
+  define('LOGIN_BOX_MY_ACCOUNT','Konto Übersicht');
+  define('LOGIN_BOX_ACCOUNT_EDIT','Konto Info bearbeiten');
+  define('LOGIN_BOX_ADDRESS_BOOK','Adressbuch bearbeiten');
+  define('LOGIN_BOX_ACCOUNT_HISTORY','Bestell-/Uuml;bersicht anzeigen');
+  define('LOGIN_BOX_PRODUCT_NOTIFICATIONS','Produktbenachrichtigungen');
+
+  define('LOGIN_BOX_PASSWORD_FORGOTTEN','Passwort vergessen??');
+
+  define('BOX_LOGINBOX_EMAIL','Ihre Email-Adresse');
+  define('BOX_LOGINBOX_PASSWORD','Ihr Passwort');
+  define('LOGIN_BOX_LOGOFF','abmelden');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/logoff.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: logoff.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Abmelduen');
+define('NAVBAR_TITLE', 'Abmeldung');
+define('TEXT_MAIN', 'Sie wurden soeben sicher abgemeldet, sodass niemand mehr Ihre Daten einsehen kann.<br><br>Ihr Warenkorb wurde zwischengespeichert und steht Ihnen nach der n&auml;chsten Anmeldung wieder zur Verf&uuml;gung.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,272 @@
+<table cellspacing="0" cellpadding="5" width="550" align="center" border="0" class = "infoBoxContents">
+  <tbody><tr><td><p >You have just successfully installed
+          CRE Loaded Oscommerce version 6.2 Standard Edtion!</p>
+        <p >Login to your admin <u><strong><a href="http://creloaded.com/admin/">here</a></strong></u> with
+          the username and password you set up during installation.</p></td></tr><tr>
+    <td><img src="images/loaded_3box_ad.jpg" width="550" height="198" alt="loaded bosex"></td>
+  </tr>
+          <tr>
+            <td><p>CRE Loaded Standard Version is the perfect
+                application to power your e-Commerce websites. However, if you
+                need features that only a Pro-level application can deliver,
+                please take a look at all the powerful options our Pro Version
+                adds. If you are looking to deploy a powerful Business to Business
+                solution, our Pro B2B has added features to enhance sales and
+                productivity.</p>
+              <p >Feel free to contact us for more details or usage
+            guidlines.</p></td>
+          </tr>
+          <tr>
+            <td><table width="550" border="0" cellspacing="1" cellpadding="2">
+              <tr class="infoBox">
+                <td><strong>Features</strong></td>
+                <td width="60" align="center"><strong>Standard </strong></td>
+                <td width="60" align="center"><strong>Pro </strong></td>
+                <td width="60" align="center"><strong>Pro
+                    B2B </strong></td>
+              </tr>
+              <tr>
+                <td > Multple Product Images</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Coupons and Vouchers</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Templating System</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Checkout Success Module System</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Ship Wire Order Fulfillment Integration</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Credit Card Encryption</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Page Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Language File Editor</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Attribute Option Type Features</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Tiny MCE WYSIWYG Editor throughout Admin</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Algozone Fraud Zone</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >FAQ Manager (Replaces FAQDesk)</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Article Manager (Replaces NewsDesk)</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Sales Report 2</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Customer State/Zip Code Mismatch</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Customer Statistics</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Daily Products Report</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Articles Viewed</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Update : Wishlist to 5.15</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Update: Affiliate Program to 2.5a</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Payment Module Updates : UK support</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Shipping Module: AusPOST</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Shipping Module: Canada Post</td>
+                <td align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >                New Shipping Module:
+                Royal Mail</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Sub Product Choices</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >CRE Bulk Attribute Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Multiple Products Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Product Extra Fields</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Credit Card Encryption Manager</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Credit Card Blacklist</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Specials by Category</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >New Report: Generate Order List (Order List
+                  3.1)</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Customer State Mismatch Report</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Google Ads removed</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" ><strong>yes</strong></td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Separate Price Groups</td>
+                <td align="center" bgcolor="#FBFBFB" >no</td>
+                <td align="center" bgcolor="#DEEFFF" >no</td>
+                <td align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td ><p>Per Product Qty Discount </p></td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" >no</td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Require Login to See Content</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" >no</td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Approve Account</td>
+                <td align="center" bgcolor="#FBFBFB" >no</td>
+                <td align="center" bgcolor="#DEEFFF" >no</td>
+                <td align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Limited 30 Day Support</td>
+                <td width="60" align="center" bgcolor="#FBFBFB" >no</td>
+                <td width="60" align="center" bgcolor="#DEEFFF" >no</td>
+                <td width="60" align="center" bgcolor="#D1CFD0" ><strong>yes</strong></td>
+              </tr>
+              <tr>
+                <td >Upgrade Now </td>
+                <td width="60" align="center" bgcolor="#FBFBFB">&nbsp;</td>
+                <td width="60" align="center" bgcolor="#DEEFFF"><a href="http://store.creloaded.com/product_info.php?cPath=27&amp;products_id=51" target="_blank"><img src="images/00add_button.gif" alt="add button" width="35" height="24" border="0" /></a></td>
+                <td width="60" align="center" bgcolor="#D1CFD0"><a href="http://store.creloaded.com/product_info.php?cPath=27&amp;products_id=52" target="_blank"><img src="images/00add_button.gif" alt="add button" width="35" height="24" border="0" /></a></td>
+              </tr>
+            </table></td>
+          </tr>
+  </tbody></table>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/checkout_success/notifications.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/checkout_success/notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/checkout_success/notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,4 @@
+<?php
+define('MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_TITLE', 'Mitteilungen');
+define('MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_DESCRIPTION', 'Produkt-Mitteilungen Prüfung Erfolg-Modul');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/checkout_success/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/checkout_success/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/checkout_success/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+<?php
+define('MODULE_CHECKOUT_SUCCESS_SHIPWIRE_TITLE', 'ShipWire');
+define('MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DESCRIPTION', 'ShipWire Checkout Success Module');
+define('TEXT_SHIPWIRE_TRANSACTION_ID', 'ShipWire Fullfillment ID:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_coupon.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_coupon.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_coupon.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: ot_coupon.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR', 'Message');
+  define('MODULE_ORDER_TOTAL_COUPON_TITLE', 'Rabatt-Kupons');
+  define('MODULE_ORDER_TOTAL_COUPON_HEADER', 'Geschenk-Gutscheine/Rabatt-Kupons');
+  define('MODULE_ORDER_TOTAL_COUPON_DESCRIPTION', 'Rabatt-Kupon');
+  define('SHIPPING_NOT_INCLUDED', ' [Versand nicht enthalten]');
+  define('TAX_NOT_INCLUDED', ' [MwSt. nicht enthalten]');
+  define('MODULE_ORDER_TOTAL_COUPON_USER_PROMPT', '');
+  define('ERROR_NO_INVALID_REDEEM_COUPON', 'Ung&uuml;ltiger Kupon-Code');
+  define('ERROR_INVALID_STARTDATE_COUPON', 'Dieser Kupon ist nicht verf&uuml;gbar');
+  define('ERROR_INVALID_FINISDATE_COUPON', 'Dieser Kupon ist abgelaufen');
+  define('ERROR_INVALID_USES_COUPON', 'Dieser Kupon kann so oft benutzt werden: ');
+  define('TIMES', ' mal.');
+  define('ERROR_INVALID_USES_USER_COUPON', 'Sie haben nun den Kupon nun so oft benutzt, wie es maximal pro Kunden erlaubt ist.');
+  define('REDEEMED_COUPON', 'ein Kupon im Wert von ');
+  define('REDEEMED_MIN_ORDER', 'bei Bestellungen &uuml;ber mindestens ');
+  define('REDEEMED_RESTRICTIONS', ' [Zutreffende Artikel-Kategorie Einschr&auml;nkungen]');
+  define('TEXT_ENTER_COUPON_CODE', 'Einl&ouml;secode eingeben&nbsp;&nbsp;');
+  define('IMAGE_REDEEM_VOUCHER', 'Redeem Code Voucher');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_gv.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ot_gv.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_GV_TITLE', 'Geschenk-Gutscheine');
+  define('MODULE_ORDER_TOTAL_GV_HEADER', 'Geschenk-Gutscheine/Rabatt-Kupons');
+  define('MODULE_ORDER_TOTAL_GV_DESCRIPTION', 'Geschenk-Gutscheine');
+  define('SHIPPING_NOT_INCLUDED', ' [Versand nicht enthalten]');
+  define('TAX_NOT_INCLUDED', ' [MwSt. nicht enthalten]');
+  define('MODULE_ORDER_TOTAL_GV_USER_PROMPT', 'H&auml;kchen setzen um mit Geschenk-Gutschein-Konto zu verrechnen ->&nbsp;');
+  define('TEXT_ENTER_GV_CODE', 'Einl&ouml;secode eingeben&nbsp;&nbsp;');
+  define('IMAGE_REDEEM_VOUCHER', 'Redeem Code Voucher');
+  define('MODULE_ORDER_TOTAL_GV_TEXT_ERROR', 'Gift Voucher/Discount coupon');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_lev_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_lev_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_lev_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: ot_lev_discount.php,v 1.1 2002/08/30 21:05:04 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_LEV_DISCOUNT_TITLE', 'Price Break Discount');
+  define('MODULE_LEV_DISCOUNT_DESCRIPTION', 'Price Break Discount');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_loworderfee.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_loworderfee.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_loworderfee.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_loworderfee.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE', 'Mindermengenzuschlag');
+  define('MODULE_ORDER_TOTAL_LOWORDERFEE_DESCRIPTION', 'Zuschlag bei Unterschreitung des Mindestbestellwertes');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_qty_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_qty_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_qty_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ot_qty_discount.php,v 1.4 2004-08-22 dreamscape Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 Josh Dechant
+  Protions Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_QTY_DISCOUNT_TITLE', 'Global Quantity Discount');
+  define('MODULE_QTY_DISCOUNT_DESCRIPTION', 'Quantity specific discount percentage or flat rate - Specify discount rate based on the number of items in the cart (global across all products).');
+  define('SHIPPING_NOT_INCLUDED', ' [Shipping not included]');
+  define('TAX_NOT_INCLUDED', ' [Tax not included]');
+
+  define('MODULE_QTY_DISCOUNT_PERCENTAGE_TEXT_EXTENSION', ' (%s%%)'); // %s is the percent discount as a number; %% displays a % sign
+  define('MODULE_QTY_DISCOUNT_FORMATED_TITLE', '<strong>Quantity Discount%s:</strong>'); // %s is the placement of the MODULE_QTY_DISCOUNT_PERCENTAGE_TEXT_EXTENSION
+  define('MODULE_QTY_DISCOUNT_FORMATED_TEXT', '<strong>-%s</strong>'); // %s is the discount amount formated for the currency
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: ot_shipping.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_SHIPPING_TITLE', 'Versandkosten');
+  define('MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION', 'Versandkosten einer Bestellung');
+
+  define('FREE_SHIPPING_TITLE', 'Versandkostenfrei');
+  define('FREE_SHIPPING_DESCRIPTION', 'Versandkostenfrei bei einem Bestellwert &uuml;ber %s');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_subtotal.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_subtotal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_subtotal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_subtotal.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_SUBTOTAL_TITLE', 'Zwischensumme');
+  define('MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION', 'Zwischensumme einer Bestellung');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_tax.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_tax.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_tax.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_tax.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_TAX_TITLE', 'MwSt.');
+  define('MODULE_ORDER_TOTAL_TAX_DESCRIPTION', 'Mehrwertsteuer');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_total.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_total.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/order_total/ot_total.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: ot_total.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_ORDER_TOTAL_TOTAL_TITLE', '<b>Summe</b>');
+  define('MODULE_ORDER_TOTAL_TOTAL_DESCRIPTION', 'Summe der Bestellung');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/SecurePay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/SecurePay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/SecurePay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+
+ Based on payment Module of iongate.php (06/11/2003) Modified for Securepay.com by:
+
+Tony Reynolds  <tonyr at securepay.com>
+
+SecurePay.php version 1.2 06/11/2003
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_TITLE', 'Credit Card : SecurePay');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_DESCRIPTION', 'SecurePay payment module. <BR>Credit Card Test Info:<br>Aprovals<br>CC#: 4111111111111111<br>Expiry: Any <BR> Declines <BR>CC#: 5105105105105100<br>Expiry: Any ');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_GATEWAY_TIMEOUT', 'There was an error contacting the credit card processor. Please try again.');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_ERROR', 'There was a problem processing your Credit Card! Not-Approved');
+  define('MODULE_PAYMENT_SECUREPAY_TEXT_WRONG_TYPE', 'The Credit Card Number does not match the Credit Card Type.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/authorizenet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/authorizenet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/authorizenet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: authorizenet.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+*/
+
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_TITLE', 'Authorize.net');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DESCRIPTION', 'Kreditkarten Test Info:<br><br>CC#: 4111111111111111<br>G&uuml;ltig bis: Any');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_TYPE', 'Typ:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER', 'Kreditkarteninhaber:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER', 'Kreditkarten-Nr.:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES', 'G&uuml;ltig bis:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_OWNER', '* Der Name des Kreditkarteninhabers muss mindestens aus  ' . CC_OWNER_MIN_LENGTH . ' Zeichen bestehen.\n');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_NUMBER', '* Die \'Kreditkarten-Nr.\' muss mindestens aus ' . CC_NUMBER_MIN_LENGTH . ' Zahlen bestehen.\n');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE', 'Fehler bei der &Uuml;berp&uuml;fung der Kreditkarte!');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DECLINED_MESSAGE', 'Ihre Kreditkarte wurde abgelehnt. Bitte versuchen Sie es mit einer anderen Karte oder kontaktieren Sie Ihre Bank f&uuml;r weitere Informationen.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_AUTHORIZENET_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_AUTHORIZENET_CVV_NUMBER', 'CVV number');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_cvc.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_cvc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_cvc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_CVC_TEXT_TITLE', 'Credit Card : with CCV');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DESCRIPTION', 'Credit Card with CCV checking Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CCV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_CCV', 'ccv/cvc/ccv2/cid code 3 or 4 digits');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_CVV', '* You must enter a CCV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_CVC_TEXT_VISA', 'Visa');
+    
+    define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+    define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Master Card');
+    define('MODULE_PAYMENT_CC_TEXT_DISCOVERY', 'Discover');
+    define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+    define('MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS', 'American Express');
+    define('MODULE_PAYMENT_CC_TEXT_DELTA', 'Delta');
+    define('MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON', 'UK Electron');
+    define('MODULE_PAYMENT_CC_TEXT_MEASTRO', 'Maestro');
+    define('MODULE_PAYMENT_CC_TEXT_UK_SWITCH', 'UK Switch');
+    define('MODULE_PAYMENT_CC_TEXT_SOLO', 'Solo');
+    define('MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD', 'Australian BankCard');
+    define('MODULE_PAYMENT_CC_TEXT_JCB', 'JCB');
+    define('MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE', 'Carte Blanche');
+    define('MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB', 'Diners Club');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_old.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_old.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_old.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_TEXT_TITLE', 'Credit Card');
+  define('MODULE_PAYMENT_CC_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_uk.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_uk.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/cc_uk.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: cc.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CC_UK_TEXT_TITLE', 'Credit Card UK,');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DESCRIPTION', 'Credit Card for UK with CVC checking Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_CC_UK_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START', 'Credit Card Start Date:');
+//  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE', 'Credit Card Issue Date:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE','<BR>*** ISSUE NUMBER. This number can be found on debit cards on the front side, on the bottom row , just before the expiry date.');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV', '3 or 4 Digit Security Code:');      
+  
+  define('MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CCV', 'CCV number:');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_CC_UK_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_CC_UK_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed. Please click (What is it?) for help.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+    define('MODULE_PAYMENT_CC_UK_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_UK_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_CC_UK_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_CC_UK_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_CC_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_CC_TEXT_MASTERCARD', 'Master Card');
+  define('MODULE_PAYMENT_CC_TEXT_DISCOVERY', 'Discover');
+  define('MODULE_PAYMENT_CC_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS', 'American Express');
+  define('MODULE_PAYMENT_CC_TEXT_DELTA', 'Delta');
+  define('MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON', 'UK Electron');
+  define('MODULE_PAYMENT_CC_TEXT_MEASTRO', 'Maestro');
+  define('MODULE_PAYMENT_CC_TEXT_UK_SWITCH', 'UK Switch');
+  define('MODULE_PAYMENT_CC_TEXT_SOLO', 'Solo');
+  define('MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD', 'Australian BankCard');
+  define('MODULE_PAYMENT_CC_TEXT_JCB', 'JCB');
+  define('MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE', 'Carte Blanche');
+  define('MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB', 'Diners Club');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/ccerr.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/ccerr.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/ccerr.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: cc.php,v 1.10 2002/11/01 05:14:11 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_CCERR_TEXT_TITLE', 'Credit Class Error');
+  define('MODULE_PAYMENT_CCERR_TEXT_DESCRIPTION', 'Credit Class Error, needed with Gift Voucher');  
+  define('MODULE_PAYMENT_CCERR_TEXT_ERROR', 'Payment selection error');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/ckmerchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/ckmerchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/ckmerchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: ckmerchantpartners.php,v 1.4 2002/11/01 05:35:33 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_TITLE', 'Electronic Check : Pay Me Now');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_DESCRIPTION', 'Merchant Partners Pay Me now Electronic Check Number:<br><br>ACCT#: 999999999<br>ABA: 999999999');
+  define('CKMERCHANTPARTNERS_ERROR_HEADING', 'There has been an error processing your Electronic Check');
+  define('CKMERCHANTPARTNERS_ERROR_MESSAGE', 'Please check your Check details!');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_OWNER', 'Name on Check:');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_NUMBER', 'Check Account Number:');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_ABA', 'Check Routing Number (ABA):');
+  define('MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_JS_CK_NUMBER', '* The check number must be at least ' . CK_NUMBER_MIN_LENGTH . ' characters.\n');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/cod.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/cod.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/cod.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: cod.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_COD_TEXT_TITLE', 'Nachnahme');
+  define('MODULE_PAYMENT_COD_TEXT_DESCRIPTION', 'Nachnahme');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/efsnet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/efsnet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/efsnet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: efsnet.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  define('MODULE_PAYMENT_EFSNET_TEXT_TITLE', 'EFSNet');
+  define('MODULE_PAYMENT_EFSNET_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_EFSNET_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_EFSNET_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EFSNET_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EFSNET_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_EFSNET_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_EFSNET_TEXT_ERROR', 'Credit Card Error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/egold.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/egold.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/egold.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: e-gold.php,v 1 2003/07/23 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  e-Gold module Crated by Craig Harrison
+*/
+
+  define('MODULE_PAYMENT_EGOLD_TEXT_TITLE', 'e-Gold');
+  define('MODULE_PAYMENT_EGOLD_TEXT_DESCRIPTION', 'e-Gold');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/epssecurenet.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/epssecurenet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/epssecurenet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: epssecurenet.php,v 1.0 2003/08/19 Exp $
+
+// EPSsecurenet
+// Built For osCommerce 2.2MS2 version 
+//--------------------------------
+// Developed BY Greg Goodman
+// Copyright 2003 Electronic Payment Systems
+//--------------------------------
+// This code is provided as is. EPS provides no warranty for the code
+// and the use of this code is done so with the express understanding that
+// it is used at the user's risk. Furthermore EPS may not be held
+// accountable for any losses resulting from the use of this code, including
+// associated modules.
+//--------------------------------
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('MODULE_PAYMENT_EFSNET_TEXT_TITLE', 'Credit Card : EPSsecurenet');
+  define('MODULE_PAYMENT_EPSSECURENET_CART_SYSTEM_NAME', 'OsCommerce');
+  define('MODULE_PAYMENT_EPSSECURENET_CONNECTION_TYPE', 'sd');
+  define('MODULE_PAYMENT_EPSSECURENET_ORDER_DESCRIP', 'Refer to OScommerce Customer Order Screen');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_TITLE', 'EPSsecurenet');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_DESCRIPTION', 'EPSsecurenet Payment Module Credit Card Test Info:<br><br>CC#: 5123456789012346<br>Expiry: Any'); 
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_CREDIT_CARD_CVV2', 'CVV2 Security Number:');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_JS_CC_CVV2', '* The CVV2 Number must at least be three or four characters.\n    -For VISA/MasterCard this number is on the back of the Card.\n    -For American Express it is 4 digits and located on the front of the Card.\n');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_EPSSECURENET_TEXT_ERROR', 'Credit Card Error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/eustandardtransfer.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/eustandardtransfer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/eustandardtransfer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_TITLE', 'EU-Standard Bank Transfer');
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION', '<BR>Die billigste und einfachste Zahlungsmethode innerhalb der EU ist die Überweisung mittels IBAN und BIC.' .
+                                                       '<BR>Name der Bank: ' . MODULE_PAYMENT_EUTRANSFER_BANKNAM .
+                                                       '<BR>Zweigstelle: ' . MODULE_PAYMENT_EUTRANSFER_BRANCH .
+                                                       '<BR>Kontoname: ' . MODULE_PAYMENT_EUTRANSFER_ACCNAM .
+                                                       '<br>Kontonummer: ' . MODULE_PAYMENT_EUTRANSFER_ACCNUM .
+                                                       '<BR>IBAN:: ' . MODULE_PAYMENT_EUTRANSFER_ACCIBAN .
+                                                       '<BR>BIC/SWIFT: ' . MODULE_PAYMENT_EUTRANSFER_BANKBIC .
+//                                                     '<BR>Sort Code: ' . MODULE_PAYMENT_EUTRANSFER_SORTCODE .
+                                                       '<BR><BR>Die Ware wird ausgeliefert wenn der Betrag auf unserem Konto eingegangen ist.<BR>');
+  define('MODULE_PAYMENT_EUTRANSFER_TEXT_EMAIL_FOOTER', str_replace('<BR>','\n',MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION));
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/firepay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/firepay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/firepay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+
+
+  define('MODULE_PAYMENT_FIREPAY_TEXT_TITLE', 'Credit Card : FirePay');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DESCRIPTION', 'Payment processor for SureFire Commerce. Uses FirePay gateway.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CCV_NUMBER', 'CVV number');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_DINERSCLUB', 'Diners Club');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_FIREPAY', 'FirePay');
+  define('MODULE_PAYMENT_FIREPAY_TEXT_VISA', 'Visa');
+
+ ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/freecharger.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/freecharger.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/freecharger.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_TITLE', 'The WebMakers Corner FREE CHARGE CARD');
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_DESCRIPTION', 'Used for purchase of FREE CHARGE ONLY');
+  define('MODULE_PAYMENT_FREECHARGER_TEXT_EMAIL_FOOTER', 'Used with purchases via Free Charge');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/geotrust.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/geotrust.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/geotrust.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: geotrust.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce / Paul Kim
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_TITLE', 'Credit Card : GeoTrust QuickPayments');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4445999922225<br>Expiry: Any');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_FIRST_NAME', 'First Name:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_LAST_NAME', 'Last Name:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER', 'Name:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiriration Date:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2', 'Card Verification Value:');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2_LOCATION', '(last 3 digits, located at the back of the credit card)');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_GEOTRUST_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/ipayment.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/ipayment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/ipayment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: ipayment.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_TITLE', 'Credit Card : iPayment');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_DESCRIPTION', 'Kreditkarten Test Info:<br><br>CC#: 4111111111111111<br>G&uuml;ltig bis: Any');
+  define('IPAYMENT_ERROR_HEADING', 'Folgender Fehler wurde von iPayment w&auml;hrend des Prozesses gemeldet:');
+  define('IPAYMENT_ERROR_MESSAGE', 'Bitte kontrollieren Sie die Daten Ihrer Kreditkarte!');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER', 'Kreditkarteninhaber');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_NUMBER', 'Kreditkarten-Nr.:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES', 'G&uuml;ltig bis:');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER', 'Karten-Pr&uuml;fnummer');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION', '(Auf der Kartenr&uuml;ckseite im Unterschriftsfeld)');
+
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_OWNER', '* Der Name des Kreditkarteninhabers mss mindestens aus  ' . CC_OWNER_MIN_LENGTH . ' Zeichen bestehen.\n');
+  define('MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_NUMBER', '* Die \'Kreditkarten-Nr.\' muss mindestens aus ' . CC_NUMBER_MIN_LENGTH . ' Zahlen bestehen.\n');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/merchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/merchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/merchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: merchantpartners.php,v 1.4 2002/11/01 05:35:33 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_TITLE', 'Credit Card : Pay Me Now');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_DESCRIPTION', 'Merchant Partners, Pay me now(Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MERCHANTPARTNERS_ERROR_HEADING', 'There has been an error processing your credit card');
+  define('MERCHANTPARTNERS_ERROR_MESSAGE', 'Please check your credit card details!');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2', 'CVV2/CCV2/CID number:');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2_LOCATION', '(3 or 4 digit # on back of card):');
+
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/moneyorder.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/moneyorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/moneyorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: moneyorder.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_TITLE', 'Scheck/Vorkasse');
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION', 'Zahlbar an:&nbsp;' . MODULE_PAYMENT_MONEYORDER_PAYTO . '<br>Adressat:<br><br>' . nl2br(STORE_NAME_ADDRESS) . '<br><br>' . 'Ihre Bestellung wird nicht versandt, bis wir das Geld erhalten haben!');
+  define('MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER', "Zahlbar an: ". MODULE_PAYMENT_MONEYORDER_PAYTO . "\n\nAdressat:\n" . STORE_NAME_ADDRESS . "\n\n" . 'Ihre Bestellung wir nicht versandt, bis wird das Geld erhalten haben!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/nochex.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/nochex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/nochex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: nochex.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_NOCHEX_TEXT_TITLE', 'NOCHEX');
+  define('MODULE_PAYMENT_NOCHEX_TEXT_DESCRIPTION', 'NOCHEX Erfordert die W&auml;hrung GBP.<br><br>NOCHEX begrenzt Verhandlungen auf 100 GBP. Alles Überschuß erfordert jedes ein Handelskonto oder ein NOCHEX Kont<br>');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/paybox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/paybox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/paybox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  Contribution by Emmanuel Alliel <manu at maboutique.biz>
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYBOX_TEXT_TITLE', 'Credit Card : Paybox');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_DESCRIPTION', 'Paybox module made by Emmanuel Alliel<br>Email: manu at maboutique.biz');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_PAYBOX_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/payflowpro.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/payflowpro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/payflowpro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: PAYFLOWPRO.php,v 1.9 2002/01/04 10:45:18 hpdl Exp $
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE', 'Pay by Credit Card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE1', 'Your credit card information will be kept secure and private.  We use Verisign payment processing.');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE2', '');
+ 
+ 
+
+  define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'The Credit Card number doe snot match the Card Type:');
+ 
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_TYPE', 'Card Type:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_OWNER', 'Card Owner:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_HOLDER_FIRST_NAME', 'First Name and Initial as shown on the card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_HOLDER_LAST_NAME', 'Last Name and Suffix as shown on your card');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_EXPIRES', 'Expiration:');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC', 'Card Verification Number');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_TEXT', '(On the back of your card, locate the final 3 digit number)');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_HELP', 'Help Finding Card Verification Number');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_AMEX', 'Using Amex?');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.n');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR_MESSAGE', 'There has been an error processing you credit card, please try again, or call us ');
+  
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR1', 'Local not sent to processor');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR', 'There has been an error processing you credit card. Please double check the information you entered. 
+  <p> 1)  Does the bill to address match the credit card billing address?
+   </p> 2) Try to re-enter the credit card information.  Sorry that this step is necessary, the re-entry is a security requirement.
+  3) If you are still having a problem, please call or email us.  Your items are stored in the system and we can easily help you during normal business hours.  We will still be able to promptly send you your merchandise. 
+  Card error #');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_PAYFLOWPRO_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/payjunction.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/payjunction.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/payjunction.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,14 @@
+<?php
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_TITLE', 'Credit Card : PayJunction');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_DESCRIPTION', 'Accept payments through the <b>PayJunction</b> gateway.<br/><br/>Use this credit card to test: 4433221111223344 (12/17)');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NAME', 'Cardholder name:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NUMBER', 'Credit card number:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_CODE', 'CVV2/CVC2 code:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_EXPIRES', 'Credit card expiration:');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR', 'Credit card error!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: paypal.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE', 'PayPal');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION', 'PayPal');
+
+  define('MODULE_PAYMENT_PAYPAL_CC_TEXT', "Credit Card&nbsp;%s%s%s%s&nbsp;or&nbsp;%s");
+
+  define('MODULE_PAYMENT_PAYPAL_IMAGE_BUTTON_CHECKOUT', 'PayPal Checkout');
+  define('MODULE_PAYMENT_PAYPAL_CC_DESCRIPTION','You do not need to be a PayPal member to pay by credit card');
+  define('MODULE_PAYMENT_PAYPAL_CC_URL_TEXT','<font color="blue"><u>[info]</u></font>');
+
+  define('MODULE_PAYMENT_PAYPAL_CUSTOMER_COMMENTS', 'Add Comments About Your Order');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE_PROCESSING', 'Processing transaction');
+  define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION_PROCESSING', 'If this page appears for more than 5 seconds, please click the PayPal Checkout button to complete your order.');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal_dp.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal_dp.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal_dp.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  paypal_dp.php, v 1.0 09/06/2005
+  Copyright (c) 2005 POSTOSC.COM
+  Released under the GNU General Public License
+  Absolutely no warranty. Use at your own risk.
+*/
+
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE', 'Paypal Pro Credit Card Payment');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_DESCRIPTION', 'Paypal Pro Credit Card Payment');
+define('MODULE_PAYMENT_PAYPAL_DP_CLIENT_DESCRIPTION', 'Credit Card');
+define('MODULE_PAYMENT_PAYPAL_DP_IMAGE_DESCRIPTION', '<img src="images/paypal/4cards.gif">');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_FIRSTNAME', 'Owner First Name:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_LASTNAME', 'Owner Last Name:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_CVV2', '<a href="http://www.paypal.com/cgi-bin/webscr?cmd=p/acc/cvv_info_pop-outside" target="_blank"><b>Card Verification Number (<u>CLICK FOR DETAILS</u>)</b></a>:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_EXPIRES', 'Card Expiration Date:');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_FIRSTNAME', '* The owner\'s first name of the credit card must be at least ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_LASTNAME', '* The owner\'s last name of the credit card must be at least ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_CVV2', '* The card verification value cannot be more than 4 characters.\n');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_ERROR', 'Credit Card Error!');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_PROCESS_ERROR', 'There has been an error processing your credit card. Please try again.');
+define('MODULE_PAYMENT_PAYPAL_DP_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal_ec.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal_ec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypal_ec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  paypal_ec.php, v 1.0 09/06/2005
+
+  Copyright (c) 2005 POSTOSC.COM
+
+  Released under the GNU General Public License
+
+  Absolutely no warranty. Use at your own risk.
+*/
+
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_TITLE', 'PayPal Pro Express Checkout');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_DESCRIPTION', 'PayPal Pro Express Checkout');
+define('MODULE_PAYMENT_PAYPAL_EC_CLIENT_DESCRIPTION', 'PayPal');
+define('MODULE_PAYMENT_PAYPAL_EC_IMAGE_DESCRIPTION', '<img src="images/buttons/x-click-but6.gif" align="left" style="margin-right:7px;"><span style="font-size:11px; font-family: Arial, Verdana;">Save time. Checkout securely. Pay without sharing your financial information.</span>');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_ERROR', 'PayPal Process Error!');
+define('MODULE_PAYMENT_PAYPAL_EC_BILLING_ERROR', 'Please enter your PayPal billing address.');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_PROCESS_ERROR', 'There has been an error processing your payment. Please try again.');
+define('MODULE_PAYMENT_PAYPAL_EC_TEXT_DECLINED_MESSAGE', 'Your card was declined. Please try another card or contact your bank for more info.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypalipn.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypalipn.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/paypalipn.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: paypalipn.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Paypal IPN v0.981 for Milestone 2
+  Copyright (c) 2003 Pablo Pasqualino
+  pablo_osc at osmosisdc.com
+  http://www.osmosisdc.com
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_TITLE', 'PayPal IPN');
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_DESCRIPTION', 'PayPal IPN');
+  define('MODULE_PAYMENT_PAYPALIPN_TEXT_CURL', 'cURL Enabled');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/plugnpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/plugnpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/plugnpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: plugnpay.php,v 1.13 2003/01/03 17:25:43 thomasamoulton Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 osCommerce
+  Released under the GNU General Public License
+
+  Last Updated: 09/17/04
+*/
+
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_TITLE', 'Credit Card : PlugnPay');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DESCRIPTION', 'PlugnPay API');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_CVV', 'CVV/CVV2:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_VISA', 'Visa');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCTTYPE', 'Account Type:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ROUTINGNUM', 'Routing Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCOUNTNUM', 'Account Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_CHECKNUM', 'Check Number:');
+  define('MODULE_PAYMENT_PLUGNPAY_TEXT_PAYTYPE', 'Payment Method:');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/pm2checkout.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/pm2checkout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/pm2checkout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: pm2checkout.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_TITLE', 'Credit Card : 2CheckOut');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_DESCRIPTION', 'Kreditkarten Test Info:<br><br>CC#: 4111111111111111<br>G&uuml;ltig bis: Any');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_TYPE', 'Typ:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER', 'Kreditkarteninhaber:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_FIRST_NAME', 'Kreditkarteninhaber Vorname:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_LAST_NAME', 'Kreditkarteninhaber Nachname:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_NUMBER', 'Kreditkarten-Nr.:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_EXPIRES', 'G&uuml;ltig bis:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER', 'Karten-Pr&uuml;fnummer:');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION', '(Auf der Kartenr&uuml;ckseite im Unterschriftsfeld)');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_JS_CC_NUMBER', '* Die \'Kreditkarten-Nr.\' muss mindestens aus ' . CC_NUMBER_MIN_LENGTH . ' Zahlen bestehen.\n');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR_MESSAGE', 'Bei der &Uuml;berp&uuml;fung Ihrer Kreditkarte ist ein Fehler aufgetreten! Bitte versuchen Sie es nochmal.');
+  define('MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR', 'Fehler bei der &Uuml;berp&uuml;fung der Kreditkarte!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/psigate.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/psigate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/psigate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: psigate.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_PSIGATE_TEXT_TITLE', 'PSiGate');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_DESCRIPTION', 'Kreditkarten Test Info:<br><br>CC#: 4111111111111111<br>G&uuml;ltig bis: Any');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER', 'Kreditkarteninhaber:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER', 'Kreditkarten-Nr.:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES', 'G&uuml;ltig bis:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_TYPE', 'Typ:');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_JS_CC_NUMBER', '* Die \'Kreditkarten-Nr.\' muss mindestens aus ' . CC_NUMBER_MIN_LENGTH . ' Zahlen bestehen.\n');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_ERROR_MESSAGE', 'Bei der &Uuml;berp&uuml;fung Ihrer Kreditkarte ist ein Fehler aufgetreten! Bitte versuchen Sie es nochmal.');
+  define('MODULE_PAYMENT_PSIGATE_TEXT_ERROR', 'Fehler bei der &Uuml;berp&uuml;fung der Kreditkarte!');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/qchex.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/qchex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/qchex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: qchex.php,v 3.0 2003/11/10 23:25:32 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_QCHEX_TEXT_TITLE', 'QChex (Electronic Check Payment)');
+  define('MODULE_PAYMENT_QCHEX_TEXT_DESCRIPTION', 'QChex (Electronic Check Payment)');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/quickcommerce.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/quickcommerce.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/quickcommerce.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: authorizenet.php,v 1.3 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+*/
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_TITLE', 'Credit Card : Quick Commerce Pro');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DESCRIPTION', 'Credit Card Test Info:<br><br>CC#: 4111111111111111<br>Expiry: Any');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_TYPE', 'Type:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_OWNER', 'Credit Card Owner:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_NUMBER', 'Credit Card Number:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_EXPIRES', 'Credit Card Expiry Date:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_TYPE', 'Credit Card Type:');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_OWNER', '* The owner\'s name of the credit card must be at least ' . CC_OWNER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CVV_LINK', 'What is it?');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_NUMBER', '* The credit card number must be at least ' . CC_NUMBER_MIN_LENGTH . ' characters.\n');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_ERROR_MESSAGE', 'There has been an error processing your credit card. Please try again.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DECLINED_MESSAGE', 'Your credit card was declined. Please try another card or contact your bank for more info.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_ERROR', 'Credit Card Error!');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_CVV', '* You must enter a CVV number to proceed.\n');
+  define('TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH', 'The credit card type you\'ve chosen does not match the credit card number entered. Please check the number and credit card type and try again.');
+  define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'The CVV number entered is incorrect. Please try again.');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_AMEX', 'Amex');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DISCOVER', 'Discover');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_MASTERCARD', 'Mastercard');
+  define('MODULE_PAYMENT_QUICKCOMMERCE_TEXT_VISA', 'Visa');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/secpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/secpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/secpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?php
+/*
+  $Id: secpay.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_SECPAY_TEXT_TITLE', ' Credit Card : SECPay');
+  define('MODULE_PAYMENT_SECPAY_TEXT_DESCRIPTION', 'Kreditkarten Test Info:<br><br>CC#: 4444333322221111<br>G&uuml;ltig bis: Any');
+  define('MODULE_PAYMENT_SECPAY_TEXT_ERROR', 'Fehler bei der &Uuml;berp&uuml;fung der Kreditkarte!');
+  define('MODULE_PAYMENT_SECPAY_TEXT_ERROR_MESSAGE', 'Bei der &Uuml;berp&uuml;fung Ihrer Kreditkarte ist ein Fehler aufgetreten! Bitte versuchen Sie es nochmal.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/payment/worldpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/payment/worldpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/payment/worldpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: worldpay.php,v MS1a 2003/04/06 21:30
+  Author :  Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.4
+
+  Revisions:
+  Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+          Now posting language code to WP, Redirect on failure now to Checkout Payment,
+      Reduced re-direct time to 8 seconds, added MD5, made callback dynamic 
+      NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+  Version 1.4 Removes boxes to prevent users from clicking away before update, 
+      Fixes currency for Yen, 
+      Redirects to Checkout_Process after 10 seconds or click by user
+  Version 1.3 Fixes problem with Multi Currency
+  Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+  Version 1.1 Added Worldpay Pre-Authorisation ability
+  Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+  define('MODULE_PAYMENT_WORLDPAY_TEXT_TITLE', 'Worldpay Credit Card Payment');
+  define('MODULE_PAYMENT_WORLDPAY_TEXT_DESCRIPTION', 'Worldpay Junior Payment Module');
+   
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspost.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspost.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_TEXT_TITLE', 'AusPOST Parcel Post');
+define('MODULE_SHIPPING_AUSPOST_TEXT_DESCRIPTION', 'AusPOST Parcel Post');
+define('MODULE_SHIPPING_AUSPOST_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostair.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostair.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostair.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostair.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_TITLE', 'AusPOST International Parcel Post - AIR');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_DESCRIPTION', 'AusPOST International Parcel Post - AIR');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOSTAIR_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/ausposteconomy.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/ausposteconomy.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/ausposteconomy.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: ausposteconomy.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_TITLE', 'AusPOST International Parcel Post - Economy');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_DESCRIPTION', 'Int. Parcel Post - Economy');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostexpress.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostexpress.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostexpress.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostexpress.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_TITLE', 'AusPOST Express Post Parcel');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_DESCRIPTION', 'AusPOST Express Post Parcel');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostsea.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostsea.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/auspostsea.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: auspostsea.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_TITLE', 'AusPOST International Parcel Post - SEA');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_DESCRIPTION', 'AusPOST International Parcel Post - SEA');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_UNITS', 'kg(s)');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_BOXES', 'boxes');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_INCLUDE', 'incl');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_HANDLING', 'handling');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_INSURANCE', 'insurance');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_SHIPPINGDAYS', 'days Estimated Delivery Time*');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_WAY', 'Delivery to');
+define('MODULE_SHIPPING_AUSPOST_SEA_TEXT_ERROR', '<font color="#FF0000">ERROR:</font></b> The delivery rate for this option cannot be determined at this time<br>If you prefer to use this option as your shipping method, please contact the store owner.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/canadapost.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/canadapost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/canadapost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  canadapost.php version 0.3
+  
+  Before use this class, you should open a Canada 
+  Post Eparcel Account, and change the CPCIP to
+  your ID. Visit www.canadapost.ca for detail.
+  
+  XML connection method with Canada Post.
+
+  Copyright (c) 2002,2003 Kelvin Zhang (kelvin at syngear.com)
+  Modified by Kenneth Wang (kenneth at cqww.net), 2002.11.12
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_CANADAPOST_TEXT_TITLE', 'Canada Post');
+define('MODULE_SHIPPING_CANADAPOST_TEXT_DESCRIPTION', 'Canada Post Parcel Service');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/cod.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/cod.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/cod.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: flat.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_COD_TEXT_TITLE', 'COD Rate');
+define('MODULE_SHIPPING_COD_TEXT_DESCRIPTION', 'COD Rate');
+define('MODULE_SHIPPING_COD_TEXT_WAY', 'Best Way');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/fedex1.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/fedex1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/fedex1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+
+  Verions 2.00 for OSC 2.2 MSS and earlier
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002, 2003 Steve Fatula of Fatula Consulting
+  compconsultant at yahoo.com
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FEDEX1_TEXT_TITLE', 'Federal Express');
+define('MODULE_SHIPPING_FEDEX1_TEXT_DESCRIPTION', 'Federal Express<br><br>You will need to have registered an account with FEDEX to use this module. Please see the README.TXT file for other requirements.');
+
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_01', 'Priority (by 10:30AM, later for rural)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_03', '2 Day Air');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_05', 'Standard Overnight (by 3PM, later for rural)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_06', 'First Overnight');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_20', 'Express Saver (3 Day)');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_90', 'Home Delivery');
+define('MODULE_SHIPPING_FEDEX1_DOMESTIC_TYPES_92', 'Ground Service');
+
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_01', 'International Priority (1-3 Days)');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_03', 'International Economy (4-5 Days)');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_06', 'International First');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_90', 'Home Delivery');
+define('MODULE_SHIPPING_FEDEX1_INTERNATIONAL_TYPES_92', 'Ground Service');
+
+define('MODULE_SHIPPING_FEDEX1_ERROR_1', 'An error occured with the fedex shipping calculations.<br>Fedex may not deliver to your country, or your postal code may be wrong.');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_1', "Data sent to Fedex for Meter: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_2', "Data returned from Fedex for Meter: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_3', 'No response to CURL from Fedex server, check CURL availability, or maybe timeout was set too low, or maybe the Fedex site is down');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_4', 'No meter number was obtained, check configuration. Error ');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_5', 'You forgot to set up your Fedex account number, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_6', 'You forgot to set up your ship from street address line 1, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_7', 'You forgot to set up your ship from City, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_8', 'You forgot to set up your ship from postal code, this can be set up in Admin -> Modules -> Shipping');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_9', 'You forgot to set up your ship from phone number, this can be set up in Admin -> Modules -> Shipping');
+
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_10', "Data sent to Fedex for Rating: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_11', "Data returned from Fedex for Rating: ");
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_12', 'No data returned from Fedex, perhaps the Fedex site is down');
+define('MODULE_SHIPPING_FEDEX1_MESSAGE_13', 'No Rates Returned, ');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/flat.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/flat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/flat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: flat.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FLAT_TEXT_TITLE', 'Pauschale Versandkosten');
+define('MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION', 'Pauschale Versandkosten');
+define('MODULE_SHIPPING_FLAT_TEXT_WAY', '');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/freeshipper.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/freeshipper.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/freeshipper.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE', 'FREE SHIPPING!');
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_DESCRIPTION', 'FREE SHIPPING');
+define('MODULE_SHIPPING_FREESHIPPER_TEXT_WAY', 'Free Shipping Only');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/item.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/item.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/item.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: item.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ITEM_TEXT_TITLE', 'Versandkosten pro St&uuml;ck');
+define('MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION', 'Versandkosten pro St&uuml;ck');
+define('MODULE_SHIPPING_ITEM_TEXT_WAY', '');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/percent.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/percent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/percent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: percent.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001,2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('MODULE_SHIPPING_PERCENT_TEXT_TITLE', 'Shipping');
+define('MODULE_SHIPPING_PERCENT_TEXT_TITLE_ADMIN', 'Percent Rate');
+define('MODULE_SHIPPING_PERCENT_TEXT_DESCRIPTION', 'Percent Rate Shipping');
+define('MODULE_SHIPPING_PERCENT_TEXT_WAY', 'Total');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/reg.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/reg.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/reg.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_REG_TEXT_TITLE', 'Royal Mail Registered');
+define('MODULE_SHIPPING_REG_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_REG_TEXT_WAY', '');
+define('MODULE_SHIPPING_REG_TEXT_UNITS', '');
+define('MODULE_SHIPPING_REG_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_REG_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/spec.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/spec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/spec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_SPEC_TEXT_TITLE', 'Royal Mail Special Delivery');
+define('MODULE_SHIPPING_SPEC_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_SPEC_TEXT_WAY', '');
+define('MODULE_SHIPPING_SPEC_TEXT_UNITS', '');
+define('MODULE_SHIPPING_SPEC_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_SPEC_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/spu.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/spu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/spu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: spu.php,v 1.3 2002/06/15 01:15:42 mbs Exp $
+  CONTRIB is Store Pickup Shipping Module (http://www.oscommerce.com/community/contributions,164)
+  Created by Michael Halvorsen
+  http://www.arachnia-web.com
+
+  Copyright (c) 2002 Arachnia-web Development.
+  Released under the GNU General Public License.
+  May be used and modified without permission.
+*/
+
+define('MODULE_SHIPPING_SPU_TEXT_TITLE', 'Store Pickup');
+define('MODULE_SHIPPING_SPU_TEXT_DESCRIPTION', 'In-store pickup during regular business hours.');
+define('MODULE_SHIPPING_SPU_TEXT_WAY', 'No shipping charge added.  Pickup during regular business hours.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/stand.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/stand.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/stand.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.3 2002/11/19 01:48:08 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_STAND_TEXT_TITLE', 'Royal Mail Standard Parcel');
+define('MODULE_SHIPPING_STAND_TEXT_DESCRIPTION', 'Zone Based Rates');
+define('MODULE_SHIPPING_STAND_TEXT_WAY', '');
+define('MODULE_SHIPPING_STAND_TEXT_UNITS', '');
+define('MODULE_SHIPPING_STAND_INVALID_ZONE', 'Sorry, this shipping option is not available for this order');
+define('MODULE_SHIPPING_STAND_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/table.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: table.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_TABLE_TEXT_TITLE', 'Tabellarische Versandkosten');
+define('MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION', 'Tabellarische Versandkosten');
+define('MODULE_SHIPPING_TABLE_TEXT_WAY', '');
+define('MODULE_SHIPPING_TABLE_TEXT_WEIGHT', 'Gewicht');
+define('MODULE_SHIPPING_TABLE_TEXT_AMOUNT', 'Menge');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/ups.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/ups.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/ups.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: ups.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_UPS_TEXT_TITLE', 'United Parcel Service');
+define('MODULE_SHIPPING_UPS_TEXT_DESCRIPTION', 'United Parcel Service');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_GND', 'UPS Ground');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DM', 'Next Day Air Early AM');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DA', 'Next Day Air');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_1DP', 'Next Day Air Saver');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_2DM', '2nd Day Air Early AM');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_3DS', '3 Day Select');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_STD', 'Canada Standard');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XPR', 'Worldwide Express');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XDM', 'Worldwide Express Plus');
+define('MODULE_SHIPPING_UPS_TEXT_OPT_XPD', 'Worldwide Expedited');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/usps.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/usps.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/usps.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+  $Id: usps.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+  ++++ modified as USPS Methods 2.5 08/02/03 by Brad Waite and Fritz Clapp ++++
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_USPS_TEXT_TITLE', 'United States Postal Service');
+define('MODULE_SHIPPING_USPS_TEXT_DESCRIPTION', 'United States Postal Service<br><br>Sie ben&ouml;tigen einen Account bei USPS unter http://www.uspsprioritymail.com/et_regcert.html um dieses Modul nutzen zu k&ouml;nnen<br><br>USPS erwartet, dass Sie <b>lbs</b> als Gewichtseinheit bei Ihren Artikeln verwenden.');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_PP', 'Parcel Post');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_PM', 'Priority Mail');
+define('MODULE_SHIPPING_USPS_TEXT_OPT_EX', 'Express Mail');
+define('MODULE_SHIPPING_USPS_TEXT_ERROR', 'Es ist ein Fehler bei der Berechnung der USPS Versandkosten aufgetreten.<br>Wenn Sie USPS als Ihre gew&uuml;nschte Versandart verwenden wollen, nehmen Sie bitte Kontakt mit uns auf.');
+define('MODULE_SHIPPING_USPS_TEXT_DAY', 'Day');
+define('MODULE_SHIPPING_USPS_TEXT_DAYS', 'Days');
+define('MODULE_SHIPPING_USPS_TEXT_WEEKS', 'Weeks');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/zones.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.4 2003/07/11 09:04:23 jan0815 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ZONES_TEXT_TITLE', 'Versandkosten nach Zonen');
+define('MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION', 'Versandkosten Zonenbasierend');
+define('MODULE_SHIPPING_ZONES_TEXT_WAY', 'Versand nach:');
+define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'kg');
+define('MODULE_SHIPPING_ZONES_INVALID_ZONE', 'Es ist kein Versand in dieses Land m&ouml;glich!');
+define('MODULE_SHIPPING_ZONES_UNDEFINED_RATE', 'Die Versandkosten k&ouml;nnen im Moment nicht berechnet werden.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping/zones_single.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping/zones_single.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping/zones_single.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<?php
+/*
+  $Id: zones.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_TITLE', 'Versandkosten nach Zonen');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_DESCRIPTION', 'Versandkosten Zonenbasierend');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_WAY', 'Versand nach:');
+define('MODULE_SHIPPING_ZONES_SINGLE_TEXT_UNITS', 'kg');
+define('MODULE_SHIPPING_ZONES_SINGLE_INVALID_ZONE', 'Es ist kein Versand in dieses Land m&ouml;glich!');
+define('MODULE_SHIPPING_ZONES_SINGLE_UNDEFINED_RATE', 'Die Versandkosten k&ouml;nnen im Moment nicht berechnet werden.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/modules/shipping_estimator.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/shipping_estimator.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/shipping_estimator.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: shiupping estimator.php,v 1.1 2004/12/01  $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 CREloaded
+
+  Released under the GNU General Public License
+*/
+
+ define('SHIPPING_OPTIONS', 'Shipping Options:');
+ define('SHIPPING_OPTIONS_LOGIN_A', 'Please <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>, to display your personal shipping costs.');
+ define('SHIPPING_OPTIONS_LOGIN_B', 'Please Log In, to display your personal shipping costs.');
+  define('SHIPPING_METHOD_TEXT','Shipping Methods:');
+  define('SHIPPING_METHOD_RATES','Rates:');
+  define('SHIPPING_METHOD_TO','Ship to: ');
+  define('SHIPPING_METHOD_TO_NOLOGIN', 'Ship to: <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '"><u>Log In</u></a>');
+  define('SHIPPING_METHOD_FREE_TEXT','Free Shipping');
+  define('SHIPPING_METHOD_ALL_DOWNLOADS','- Downloads');
+  define('SHIPPING_METHOD_RECALCULATE','Recalculate');
+  define('SHIPPING_METHOD_ZIP_REQUIRED','true');
+  define('SHIPPING_METHOD_ADDRESS','Address:');
+  define('SHIPPING_METHOD_ITEM','ITEM:');
+  define('SHIPPING_METHOD_ITEMS','ITEMS:');
+  define('SHIPPING_METHOD_WEIGHT','Weight:');
+  define('SHIPPING_METHOD_WEIGHT_UNIT','lbs');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/modules/xsell_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/modules/xsell_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/modules/xsell_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: xsell_products.php, v1
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+  define('TEXT_XSELL_PRODUCTS', 'Wir Empfehlen Auch :');
+  define('TEXT_BUY', 'Kaufe 1 \'');
+  define('TEXT_NOW', '\' jetzt');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,153 @@
+<?php
+/*
+  $Id: categories.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_TITLE', 'Navigation Menu');
+define('HEADING_TITLE_SEARCH', 'Search:');
+define('HEADING_TITLE_GOTO', 'Go To:');
+
+define('TABLE_HEADING_CATEGORIES_LINKS', 'Categories / Links');
+define('TABLE_HEADING_ACTION', 'Action');
+define('TABLE_HEADING_STATUS', 'Status');
+
+
+
+// BOF MaxiDVD: Added For Ultimate-Images Pack!
+define('TEXT_PRODUCTS_IMAGE_NOTE','<b>Products Image:</b><small><br>Main Image used in <br><u>catalog & description</u> pages.<small>');
+define('TEXT_PRODUCTS_IMAGE_MEDIUM', '<b>Small Image:</b><br><small> Image on<br><u>products list</u> pages.</small>');
+define('TEXT_PRODUCTS_IMAGE_LARGE', '<b>Pop-up Image:</b><br><small> Large Image on<br><u>pop-up window</u> page.</small>');
+define('TEXT_PRODUCTS_IMAGE_LINKED', '<u>Store Product/s Sharing this Image =</u>');
+define('TEXT_PRODUCTS_IMAGE_REMOVE', '<b>Remove</b> this Image from this Product?');
+define('TEXT_PRODUCTS_IMAGE_DELETE', '<b>Delete</b> this Image from the Server (Permanent!)?');
+define('TEXT_PRODUCTS_IMAGE_REMOVE_SHORT', 'Remove');
+define('TEXT_PRODUCTS_IMAGE_DELETE_SHORT', 'Delete');
+define('TEXT_PRODUCTS_IMAGE_TH_NOTICE', '<b>SM = Small Images.</b> If a "SM" image is used<br>(Alone) NO Pop-up window link is created, the "SM"<br> will be placed directly under the products<br>description. If used in conjunction with an <br>"XL" image on the right, a Pop-up Window Link<br> is created and the "XL" image will be<br>shown in a Pop-up window.<br><br>');
+define('TEXT_PRODUCTS_IMAGE_XL_NOTICE', '<b>XL = Large Images.</b> Used for the Pop-up image<br><br><br>');
+define('TEXT_PRODUCTS_IMAGE_ADDITIONAL', 'Additional Images - These will appear below product description if used.');
+define('TEXT_PRODUCTS_IMAGE_SM_1', 'SM Image 1:');
+define('TEXT_PRODUCTS_IMAGE_XL_1', 'XL Image 1:');
+define('TEXT_PRODUCTS_IMAGE_SM_2', 'SM Image 2:');
+define('TEXT_PRODUCTS_IMAGE_XL_2', 'XL Image 2:');
+define('TEXT_PRODUCTS_IMAGE_SM_3', 'SM Image 3:');
+define('TEXT_PRODUCTS_IMAGE_XL_3', 'XL Image 3:');
+define('TEXT_PRODUCTS_IMAGE_SM_4', 'SM Image 4:');
+define('TEXT_PRODUCTS_IMAGE_XL_4', 'XL Image 4:');
+define('TEXT_PRODUCTS_IMAGE_SM_5', 'SM Image 5:');
+define('TEXT_PRODUCTS_IMAGE_XL_5', 'XL Image 5:');
+define('TEXT_PRODUCTS_IMAGE_SM_6', 'SM Image 6:');
+define('TEXT_PRODUCTS_IMAGE_XL_6', 'XL Image 6:');
+// EOF MaxiDVD: Added For Ultimate-Images Pack!
+
+
+
+define('TEXT_NEW_PRODUCT', 'New Product in &quot;%s&quot;');
+define('TEXT_CATEGORIES', 'Categories:');
+define('TEXT_SUBCATEGORIES', 'Subcategories:');
+define('TEXT_PRODUCTS', 'Products:');
+define('TEXT_PRODUCTS_PRICE_INFO', 'Price:');
+define('TEXT_PRODUCTS_TAX_CLASS', 'Tax Class:');
+define('TEXT_PRODUCTS_AVERAGE_RATING', 'Average Rating:');
+define('TEXT_PRODUCTS_QUANTITY_INFO', 'Quantity:');
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_DELETE_IMAGE', 'Delete Image');
+
+define('TEXT_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_LAST_MODIFIED', 'Last Modified:');
+define('TEXT_IMAGE_NONEXISTENT', 'IMAGE DOES NOT EXIST');
+define('TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS', 'Please insert a new category or product in this level.');
+define('TEXT_PRODUCT_MORE_INFORMATION', 'For more information, please visit this products <a href="http://%s" target="blank"><u>webpage</u></a>.');
+define('TEXT_PRODUCT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_PRODUCT_DATE_AVAILABLE', 'This product will be in stock on %s.');
+
+define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
+define('TEXT_EDIT_CATEGORIES_ID', 'Category ID:');
+define('TEXT_EDIT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_EDIT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_EDIT_SORT_ORDER', 'Sort Order:');
+define('TEXT_EDIT_CATEGORIES_HEADING_TITLE', 'Category heading title:');
+define('TEXT_EDIT_CATEGORIES_DESCRIPTION', 'Category heading Description:');
+define('TEXT_EDIT_CATEGORIES_TITLE_TAG', 'Category Title Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_DESC_TAG', 'Category Description Meta Tag :');
+define('TEXT_EDIT_CATEGORIES_KEYWORDS_TAG', 'Category Key Word Meta Tag :');
+
+define('TEXT_INFO_COPY_TO_INTRO', 'Please choose a new category you wish to copy this product to');
+define('TEXT_INFO_CURRENT_CATEGORIES', 'Current Categories:');
+
+define('TEXT_INFO_HEADING_NEW_CATEGORY', 'New Category');
+define('TEXT_INFO_HEADING_EDIT_CATEGORY', 'Edit Category');
+define('TEXT_INFO_HEADING_DELETE_CATEGORY', 'Delete Category');
+define('TEXT_INFO_HEADING_MOVE_CATEGORY', 'Move Category');
+define('TEXT_INFO_HEADING_DELETE_PRODUCT', 'Delete Product');
+define('TEXT_INFO_HEADING_MOVE_PRODUCT', 'Move Product');
+define('TEXT_INFO_HEADING_COPY_TO', 'Copy To');
+
+define('TEXT_DELETE_CATEGORY_INTRO', 'Are you sure you want to delete this category?');
+define('TEXT_DELETE_PRODUCT_INTRO', 'Are you sure you want to permanently delete this product?');
+
+define('TEXT_DELETE_WARNING_CHILDS', '<b>WARNING:</b> There are %s (child-)categories still linked to this category!');
+define('TEXT_DELETE_WARNING_PRODUCTS', '<b>WARNING:</b> There are %s products still linked to this category!');
+
+define('TEXT_MOVE_PRODUCTS_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE_CATEGORIES_INTRO', 'Please select which category you wish <b>%s</b> to reside in');
+define('TEXT_MOVE', 'Move <b>%s</b> to:');
+
+define('TEXT_NEW_CATEGORY_INTRO', 'Please fill out the following information for the new category');
+define('TEXT_CATEGORIES_NAME', 'Category Name:');
+define('TEXT_CATEGORIES_IMAGE', 'Category Image:');
+define('TEXT_SORT_ORDER', 'Sort Order:');
+
+define('TEXT_PRODUCTS_STATUS', 'Products Status:');
+define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');
+define('TEXT_PRODUCT_AVAILABLE', 'In Stock');
+define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');
+define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');
+define('TEXT_PRODUCTS_NAME', 'Products Name:');
+define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
+define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');
+define('TEXT_PRODUCTS_MODEL', 'Products Model:');
+define('TEXT_PRODUCTS_IMAGE', 'Products Image:');
+define('TEXT_PRODUCTS_URL', 'Products URL:');
+define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');
+define('TEXT_PRODUCTS_PRICE_NET', 'Products Price (Net):');
+define('TEXT_PRODUCTS_PRICE_GROSS', 'Products Price (Gross):');
+define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');
+define('TEXT_NONE', '--none--');
+
+define('EMPTY_CATEGORY', 'Empty Category');
+
+define('TEXT_HOW_TO_COPY', 'Copy Method :');
+define('TEXT_COPY_AS_LINK', 'Link product');
+define('TEXT_COPY_AS_DUPLICATE', 'Duplicate product');
+
+define('ERROR_CANNOT_LINK_TO_SAME_CATEGORY', 'Error: Can not link products in the same category.');
+define('ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE', 'Error: Catalog images directory is not writeable: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST', 'Error: Catalog images directory does not exist: ' . DIR_FS_CATALOG_IMAGES);
+define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
+
+//Header Tags Controller Admin
+define('TEXT_PRODUCT_METTA_INFO', '<b>Meta Tag Information</b>');
+define('TEXT_PRODUCTS_PAGE_TITLE', 'Products Page Title :');
+define('TEXT_PRODUCTS_HEADER_DESCRIPTION', 'Page Header Description :');
+define('TEXT_PRODUCTS_KEYWORDS', 'Product Keywords :');
+
+define('IMAGE_EDIT_ATTRIBUTES', 'Edit Product Attributes');
+
+// Added for Navigation Menu DMG
+
+define('TEXT_LINKS','Links');
+define('TEXT_HEADING_EDIT_CATEGORY','Edit Navigation Category');
+define('TEXT_HEADING_NEW_LINK','Create New Navigation Link');
+define('TEXT_LINK_NAME','Link Text : ');
+define('TEXT_LINK_PAGE','Link Target : ');
+define('TEXT_STATUS','Link Status : ');
+
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/pages.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,28 @@
+<?php
+/*
+  $Id: pages.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc
+  
+  Copyright &copy; 2006 Chain Reaction Works, Inc
+  
+  Last Modifed By : $Author$
+  Last Modified On :  $Date$
+  Latest Revision :  $Revision$
+  
+  
+*/
+
+define('NAVBAR_TITLE', 'Pages');
+
+define('HEADING_TITLE', 'Pages');
+define('TEXT_NO_PAGES', 'There are no pages to list in this category.');
+define('TEXT_NO_CATEGORIES', 'There are no categories to list yet.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: password_forgotten.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE_1', 'Anmelden');
+define('NAVBAR_TITLE_2', 'Passwort vergessen');
+
+define('HEADING_TITLE', 'Wie war noch mal mein Passwort?');
+
+define('TEXT_MAIN', 'Sollten Sie Ihr Passwort nicht mehr wissen, geben Sie bitte unten Ihre Email-Adresse ein um umgehend ein neues Passwort per Email zu erhalten.');
+
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'Fehler: Die eingegebene Email-Adresse ist nicht registriert. Bitte versuchen Sie es noch einmal.');
+
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Ihr neues Passwort.');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'Über die Adresse ' . $REMOTE_ADDR . ' haben wir eine Anfrage zur Passworterneuerung erhalten.' . "\n\n" . 'Ihr neues Passwort für \'' . STORE_NAME . '\' lautet ab sofort:' . "\n\n" . '   %s' . "\n\n");
+
+define('SUCCESS_PASSWORD_SENT', 'Erfolg: Ein neues Passwort wurde per Email verschickt.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/popup_affiliate_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/popup_affiliate_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/popup_affiliate_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: popup_affiliate_help.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Infobox Hilfe');
+define('TEXT_INFO_HEADING_NEW_INFOBOX', 'Infobox Hilfe');
+
+define('HEADING_SUMMARY_HELP', 'Hilfe zum Partnerprogramm');
+define('TEXT_IMPRESSIONS_HELP', '<b>Impressionen:</b> zeigt an, wie oft ein Banner im vorgegebenen Zeitraum angezeigt wurde.');
+define('TEXT_VISITS_HELP', '<b>Besuche:</b> zeigt an, wie viele Klicks von Besuchern, welche &uuml;ber Ihre Webseite gekommen sind, vorgenommen wurden.');
+define('TEXT_TRANSACTIONS_HELP', '<b>Verk&auml;ufe:</b> zeigt an, wieviele Verk&auml;ufe &uuml;ber die Partnerseiten get&auml;tigt wurden.');
+define('TEXT_CONVERSION_HELP', '<b>Verk&auml;ufe/Klicks:</b> zeigt in einem Prozentsatz an, wieviele der von Ihrer Webseite kommenden Besucher bei uns einen Kauf get&auml;tigt haben.');
+define('TEXT_AMOUNT_HELP', '<b>Bestellwert:</b> zeigt die Bestellsumme aller ausgelieferten Verk&auml;ufe an.');
+define('TEXT_AVERAGE_HELP', '<b>Durschschnitt:</b> repr&auml;sentiert den durchschnittlichen Verkaufswert, welcher &uuml;ber Ihr Konto erwirtschaftet wurde.');
+define('TEXT_COMMISSION_RATE_HELP', '<b>Provision</b> steht f&uuml;r die prozentuale Provision, mit der wir, &uuml;ber Sie get&auml;tigte Verk&auml;ufe, abrechnen.');
+define('TEXT_COMMISSION_HELP', '<b>Provisionsbetrag</b> zeigt Ihre Provisionseink&uuml;nfte &uuml;ber alle ausgelieferten Verk&auml;ufe an');
+define('TEXT_CLOSE_WINDOW', 'Fenster schliessen [x]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/popup_coupon_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/popup_coupon_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/popup_coupon_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: popup_coupon_help.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('HEADING_COUPON_HELP', 'Hilfe zu Rabatt-Kupons');
+define('TEXT_CLOSE_WINDOW', 'Fenster Schliessen [x]');
+define('TEXT_COUPON_HELP_HEADER', 'Gl&uuml;ckwunsch, Sie haben einen Rabatt-Kupon eingel&ouml;st.');
+define('TEXT_COUPON_HELP_NAME', '<br><br>Kupon-Name : %s');
+define('TEXT_COUPON_HELP_FIXED', '<br><br>Der Gutschein ist %s Wert f&uuml;r Ihre Bestellung');
+define('TEXT_COUPON_HELP_MINORDER', '<br><br>Damit sie diesen Kupon verwenden können, m&uuml;ssen Sie %s ausgeben');
+define('TEXT_COUPON_HELP_FREESHIP', '<br><br>Dieser Kupon stellt macht Ihre Bestellung versandkostenfrei');
+define('TEXT_COUPON_HELP_DESC', '<br><br>Kupon Beschreibung: %s');
+define('TEXT_COUPON_HELP_DATE', '<br><br>Der Kupon ist g&uuml;ltig zwischen %s und %s');
+define('TEXT_COUPON_HELP_RESTRICT', '<br><br>Artikel/Kategorien Einschr&auml;nkungen');
+define('TEXT_COUPON_HELP_CATEGORIES', 'Kategorie');
+define('TEXT_COUPON_HELP_PRODUCTS', 'Artikel');
+define('TEXT_NONE', 'NONE');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/popup_image.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/popup_image.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/popup_image.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: popup_image.php,v 1.2 2004/01/18 
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+define('TEXT_CLOSE_WINDOW', 'Click to Close Window [x]');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/printorder.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/printorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/printorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: invoice.php,v 1.1 2003/05 xaglo
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TITLE_PRINT_ORDER', 'Bestellung');
+
+define('TABLE_HEADING_COMMENTS', 'Ihre Kommentare');
+define('TABLE_HEADING_PRODUCTS_MODEL', 'Modell');
+define('TABLE_HEADING_PRODUCTS', 'Artikel');
+define('TABLE_HEADING_TAX', 'MwSt.');
+define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Preis (exkl.)');
+define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Preis (inkl)');
+define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Summe (exkl.)');
+define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Summe (inkl.)');
+
+define('IMAGE_BUTTON_PRINT', 'Drucken');
+
+define('ENTRY_SOLD_TO', 'Rechnungsadresse:');
+define('ENTRY_SHIP_TO', 'Lieferadresse:');
+define('ENTRY_PAYMENT_METHOD', 'Zahlweise:');
+
+define('ENTRY_DATE_PURCHASED', 'Gekauft am:');
+
+define('ENTRY_ACCESS_ERROR', 'Sie haben für diese Bestellung keine Zugangsberechtigung.<br>Wenn Sie diese Nachricht ungerechtfertigt erhalten haben, kontaktieren Sie bitte den Shop-Inhaber.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/product_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/product_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/product_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: product_info.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_PRODUCT_NOT_FOUND', 'Artikel wurde nicht gefunden!');
+define('TEXT_CURRENT_REVIEWS', 'Aktuelle Meinungen:');
+define('TEXT_MORE_INFORMATION', 'F&uuml;r weitere Informationen, besuchen Sie bitte die <a href="%s" target="_blank"><u>Homepage</u></a> zu diesem Artikel.');
+define('TEXT_DATE_ADDED', 'Diesen Artikel haben wir am %s in unseren Katalog aufgenommen.');
+define('TEXT_DATE_AVAILABLE', '<font color="#ff0000">Dieser Artikel wird voraussichtlich ab dem %s wieder vorr&auml;tig sein.</font>');
+define('TEXT_ALSO_PURCHASED_PRODUCTS', 'Kunden, die diesen Artikel gekauft haben, haben auch folgende Artikel gekauft:');
+define('TEXT_PRODUCT_OPTIONS', 'Optionen:');
+define('TEXT_CLICK_TO_ENLARGE', 'F&uuml;r eine gr&ouml;ssere Darstellung<br>klicken Sie auf das Bild.');
+define('TEXT_NO_MOPICS', 'Bald erh&auml;ltlich!');
+/*Eversun mod end for sppc and qty price breaks*/
+define('TEXT_ENTER_QUANTITY', 'St&uuml;ck')
+/*Eversun mod end for sppc and qty price breaks*/
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/product_info_configureable.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/product_info_configureable.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/product_info_configureable.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: product_info.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('TEXT_PRODUCT_NOT_FOUND', 'Product not found!');
+define('TEXT_CURRENT_REVIEWS', 'Current Reviews:');
+define('TEXT_MORE_INFORMATION', 'For more information, please visit this products <a href="%s" target="_blank"><u>webpage</u></a>.');
+define('TEXT_DATE_ADDED', 'This product was added to our catalog on %s.');
+define('TEXT_DATE_AVAILABLE', '<font color="#ff0000">This product will be in stock on %s.</font>');
+define('TEXT_ALSO_PURCHASED_PRODUCTS', 'Customers who bought this product also purchased');
+define('TEXT_PRODUCT_OPTIONS', 'Available Options:');
+define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
+define('TEXT_NO_MOPICS', 'Coming soon!');
+/*Eversun mod end for sppc and qty price breaks*/
+define('TEXT_ENTER_QUANTITY', 'Quantity');
+define('TEXT_QUALITY_PRICE_CHART','Quantity Price Chart');
+/*Eversun mod end for sppc and qty price breaks*/
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/product_reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/product_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/product_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  $Id: product_reviews.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Meinungen');
+
+define('TEXT_CLICK_TO_ENLARGE', 'F&uuml;r eine gr&ouml;ssere Darstellung<br>klicken Sie auf das Bild.');
+
+define('TEXT_OF_5_STARS', '%s von 5 Sternen!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/product_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/product_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/product_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+/*
+  $Id: product_reviews_info.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Meinungen');
+define('HEADING_TITLE', 'Meinung zu \'%s\'');
+define('SUB_TITLE_PRODUCT', 'Artikel:');
+define('SUB_TITLE_FROM', 'Autor:');
+define('SUB_TITLE_DATE', 'Datum:');
+define('SUB_TITLE_REVIEW', 'Meinung:');
+define('SUB_TITLE_RATING', 'Bewertung:');
+define('TEXT_OF_5_STARS', '%s von 5 Sternen!');
+define('TEXT_CLICK_TO_ENLARGE', 'F&uuml;r eine gr&ouml;ssere Darstellung<br>klicken Sie auf das Bild.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/product_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/product_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/product_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: product_reviews_write.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Meinungen');
+
+define('SUB_TITLE_FROM', 'Autor:');
+define('SUB_TITLE_REVIEW', 'Ihre Meinung:');
+define('SUB_TITLE_RATING', 'Bewertung:');
+
+define('TEXT_NO_HTML', '<small><font color="#ff0000"><b>ACHTUNG:</b></font></small>&nbsp;HTML wird nicht unterst&uuml;tzt!');
+define('TEXT_BAD', '<small><font color="#ff0000"><b>SCHLECHT</b></font></small>');
+define('TEXT_GOOD', '<small><font color="#ff0000"><b>GUT</b></font></small>');
+
+define('TEXT_CLICK_TO_ENLARGE', 'F&uuml;r eine gr&ouml;ssere Darstellung<br>klicken Sie auf das Bild.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/products_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/products_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/products_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: products_new.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Neue Artikel');
+define('HEADING_TITLE', 'Neue Artikel');
+
+define('TEXT_DATE_ADDED', 'aufgenommen am:');
+define('TEXT_MANUFACTURER', 'Hersteller:');
+define('TEXT_PRICE', 'Preis:');
+
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/pw.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/pw.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/pw.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,8 @@
+<?php
+define('TEXT_ACCOUNT_CREATED','Your Account is now active !');
+define('TEXT_YOUR_ACCOUNT_ALREADY_EXIST', 'Your Account is already active!');
+define('HEADIN_TITLE', 'Account validation');
+define('NAVBAR_TITLE', 'Account validation');
+define('TEXT_ACCOUNT_CREATED_FAIL', 'The validation/activation code you entered is incorrect');
+define('TEXT_ACCOUNT_CREATED_FAIL2', 'The email address or validation/activation code you entered is not valid');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/reviews.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,16 @@
+<?php
+/*
+  $Id: reviews.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Meinungen');
+define('HEADING_TITLE', 'Was sagen die Anderen?');
+define('TEXT_OF_5_STARS', '%s von 5 Sternen!');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Nach Preis einkaufen');
+define('HEADING_TITLE', 'Nach Preis einkaufen');
+define('BOX_HEADING_SHOP_BY_PRICE', 'Nach Preis einkaufen');
+define('TABLE_HEADING_IMAGE', '');
+define('TABLE_HEADING_PRICE', 'Preis');
+define('TABLE_HEADING_BUY_NOW', 'Jetzt kaufen');
+define('TABLE_HEADING_MODEL', 'Modell');
+define('TABLE_HEADING_PRODUCTS', 'Artikelname');
+define('TABLE_HEADING_MANUFACTURER', 'Hersteller');
+define('TABLE_HEADING_QUANTITY', 'St&uuml;ckzahl');
+
+define('TEXT_INFO_UNDER', 'Under&nbsp;');
+define('TEXT_INFO_FROM', 'From&nbsp;');
+define('TEXT_INFO_TO', '&nbsp;to&nbsp;');
+define('TEXT_INFO_ABOVE', '&nbsp;and above');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Warenkorb');
+define('HEADING_TITLE', 'Ihr Warenkorb enth&auml;lt :');
+define('TABLE_HEADING_REMOVE', 'Entfernen');
+define('TABLE_HEADING_QUANTITY', 'Anzahl');
+define('TABLE_HEADING_MODEL', 'Artikelnr.');
+define('TABLE_HEADING_PRODUCTS', 'Artikel');
+define('TABLE_HEADING_TOTAL', 'Summe');
+define('TEXT_CART_EMPTY', 'Sie haben noch nichts in Ihrem Warenkorb.');
+define('SUB_TITLE_SUB_TOTAL', 'Zwischensumme:');
+define('SUB_TITLE_TOTAL', 'Summe:');
+
+define('OUT_OF_STOCK_CANT_CHECKOUT', 'Die mit ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' markierten Artikel, sind leider nicht in der von Ihnen gew&uuml;nschten Menge auf Lager.<br>Bitte reduzieren Sie Ihre Bestellmenge f&uuml;r die gekennzeichneten Artikel. Vielen Dank.');
+define('OUT_OF_STOCK_CAN_CHECKOUT', 'Die mit ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' markierten Artikel, sind leider nicht in der von Ihnen gew&uuml;nschten Menge auf Lager.<br>Die bestellte Menge wird kurzfristig von uns geliefert, wenn Sie es w&uuml;nschen nehmen wir auch eine Teillieferung vor.');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/specials.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: specials.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Angebote');
+define('HEADING_TITLE', 'Unsere Sonderangebote:');
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/ssl_check.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/ssl_check.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/ssl_check.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: ssl_check.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Sicherheitshinweis');
+define('HEADING_TITLE', 'Sicherheitshinweis');
+
+define('TEXT_INFORMATION', 'Unsere Sicherheits&uuml;berpr&uuml;fung hat ergeben, dass der Ihrerseits verwendete Browser die SSL-Session-Id w&auml;hrend Ihres Besuches gewechselt hat.<br><br>Aus Sicherheitsgr&uuml;nden bitten wir Sie sich noch einmal anzumelden.<br><br>Manche Browser, z.B. Konqueror 3.1, k&ouml;nnen die  Secure SSL Session-Id nicht automatisch erzeugen - dies ist jedoch bei uns Voraussetzung. Wenn Sein einen solchen Browser verwenden, bitten wir SIe netweder eine aktualisierte Version zu installieren oder einen anderen Browser zu verwenden. Zum Beipiel  <a href="http://www.microsoft.com/ie/" target="_blank">Microsoft Internet Explorer</a>, <a href="http://channels.netscape.com/ns/browsers/download_other.jsp" target="_blank">Netscape</a>, oderr <a href="http://www.mozilla.org/releases/" target="_blank">Mozilla</a>. Nach diesem Update sollten sie problemlos bei euns einkaufen k&ouml;nnen, mit der Gewissheit auf der sicheren Seite zu sein.<br><br>Diese Sicherheitsmassnahme dient Ihrer Sicherheit. Sollten Sie trotzdem Probleme haben, bitten wir um Entschuldigung und bieten Ihnen gerne an, mit uns Kontakt aufzunehmen.');
+
+define('BOX_INFORMATION_HEADING', 'Privatsph&auml;re und Sicherheit');
+define('BOX_INFORMATION', 'Die von Ihrem Browser erzeugte SSL-Session ID wird von uns bei jedem Zugriff auf eine sichere Seite &Uuml;berpr&uuml;ft.<br><br>Diese &Uuml;berpr&uuml;fung garantiert, dass der Zugriff tatsächlich von Ihrem Browser erfolgte und nicht von einem anderen Browser stammt.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Artikel weiterempfehlen');
+
+define('HEADING_TITLE', 'Empfehlen Sie \'%s\' weiter');
+
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Ihre Angaben');
+define('FORM_TITLE_FRIEND_DETAILS', 'Angaben Ihres Freundes');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Ihre Nachricht (wird mit der Empfehlung versendet)');
+
+define('FORM_FIELD_CUSTOMER_NAME', 'Ihr Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Ihre Email-Adresse:');
+define('FORM_FIELD_FRIEND_NAME', 'Name Ihres Freundes:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Email-Adresse Ihres Freundes:');
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Ihre Email &uuml;ber <b>%s</b> wurde gesendet an <b>%s</b>.');
+
+define('TEXT_EMAIL_SUBJECT', 'Ihr Freund %s, hat diesen Artikel gefunden, und zwar hier: %s');
+define('TEXT_EMAIL_INTRO', 'Hallo %s!' . "\n\n" . 'Ihr Freund, %s, hat diesen Artikelt %s bei %s gefunden.');
+define('TEXT_EMAIL_LINK', 'Um den Artikel anzusehen, klicken Sie bitte auf den Link oder kopieren diesen und fügen Sie ihn in der Adress-Zeile Ihres Browsers ein:' . "\n\n" . '%s');
+define('TEXT_EMAIL_LINK_ARTICLE', 'To view the article click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE_TEXT', 'To view the article copy and paste the link into your web browser:' . "\n\n");
+
+define('TEXT_EMAIL_SIGNATURE', 'Mit freundlichen Grüssen,' . "\n\n");
+
+define('ERROR_TO_NAME', 'Fehler: Der Empf&auml;ngername darf nicht leer sein.');
+define('ERROR_TO_ADDRESS', 'Fehler: Die Empf&auml;nger-Email-Adresse darf nicht leer sein.');
+define('ERROR_FROM_NAME', 'Fehler: Der Absendername (Ihr Name) muss angegeben werden.');
+define('ERROR_FROM_ADDRESS', 'Fehler: Die Absenderadresse muss eine g&uuml;ltige Email-Adresse sein.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/tell_a_friend_article.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/tell_a_friend_article.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/tell_a_friend_article.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Tell A Friend');
+
+define('HEADING_TITLE', 'Tell A Friend About \'%s\'');
+
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Your Details');
+define('FORM_TITLE_FRIEND_DETAILS', 'Your Friends Details');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Your Message');
+
+define('FORM_FIELD_CUSTOMER_NAME', 'Your Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Your E-Mail Address:');
+define('FORM_FIELD_FRIEND_NAME', 'Your Friends Name:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Your Friends E-Mail Address:');
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email about <b>%s</b> has been successfully sent to <b>%s</b>.');
+
+define('TEXT_EMAIL_SUBJECT', 'Your friend %s has recommended this great product from %s');
+define('TEXT_EMAIL_INTRO', 'Hi %s!' . "\n\n" . 'Your friend, %s, thought that you would be interested in %s from %s.');
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE', 'To view the article click on the link below or copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n\n");
+define('TEXT_EMAIL_LINK_ARTICLE_TEXT', 'To view the article copy and paste the link into your web browser:' . "\n\n");
+
+define('TEXT_EMAIL_SIGNATURE', 'Regards,' . "\n\n");
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: products_new.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Upcoming Products');
+define('HEADING_TITLE', 'Upcoming Products');
+
+define('TEXT_DATE_ADDED', 'Date Added:');
+define('TEXT_MANUFACTURER', 'Manufacturer:');
+define('TEXT_PRICE', 'Price:');
+define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
+define('TABLE_HEADING_IMAGE', 'Product Image');
+define('TABLE_HEADING_MODEL', 'Model');
+define('TABLE_HEADING_PRODUCTS', 'Product Name');
+define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
+define('TABLE_HEADING_QUANTITY', 'Quantity');
+define('TABLE_HEADING_PRICE', 'Price');
+define('TABLE_HEADING_WEIGHT', 'Weight');
+define('TABLE_HEADING_BUY_NOW', 'Buy Now');
+define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
+define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
+define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
+define('TEXT_SHOW', '<b>Show:</b>');
+define('TEXT_BUY', 'Buy 1 \'');
+define('TEXT_NOW', '\' now');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: login.php,v 1.15 2003/06/09 22:46:46 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+function get_ip() {
+if (isset($_SERVER)) {
+if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
+$ip = $_SERVER['HTTP_CLIENT_IP'];
+} else {
+$ip = $_SERVER['REMOTE_ADDR'];
+}
+} else {
+if ( getenv('HTTP_X_FORWARDED_FOR') ) {
+$ip = getenv('HTTP_X_FORWARDED_FOR');
+} elseif ( getenv('HTTP_CLIENT_IP') ) {
+$ip = getenv('HTTP_CLIENT_IP');
+} else {
+$ip = getenv('REMOTE_ADDR');
+}
+}
+return $ip; 
+}
+$user_ip = get_ip();
+
+
+define('NAVBAR_TITLE_1', 'Account');
+define('NAVBAR_TITLE_2', 'Account Validation');
+define('HEADING_TITLE', 'Account Validation');
+define('TEXT_MAIN', 'Do you need a new Validation Link ?');
+define('ENTRY_EMAIL_ADDRESS', 'Emailadress: ');
+define('SUCCESS_REGISTRATION_CODE_SENT', 'Your new validation code was sent. Please check your email account');
+define('TEXT_NO_EMAIL_ADDRESS_FOUND', 'This email address is not registered');
+define('EMAIL_PASSWORD_REMINDER_SUBJECT', STORE_NAME . ' - Your Validation Code is');
+define('EMAIL_PASSWORD_REMINDER_BODY', 'We received a request from the IP ' . $user_ip . ' to renew your Validation Code.' . "\n\n" . 'Your Validation Code for \'' . STORE_NAME . '\' :' . "\n\n" . '%s' . "\n\n");
+define('EMAIL_PASSWORD_REMINDER_BODY2', 'Please follow this link to validate your account: %s' . "\n\n");
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/whos_onlinebox.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/whos_onlinebox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/whos_onlinebox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+/*
+  $Id: whos_online.php,v 1.1 2004/05/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+ */
+
+define('BOX_WHOS_ONLINE_THEREIS', 'Es ist ');
+define('BOX_WHOS_ONLINE_THEREARE', 'Es sind');
+define('BOX_WHOS_ONLINE_GUEST', 'Gast');
+define('BOX_WHOS_ONLINE_GUESTS', 'G&auml;ste');
+define('BOX_WHOS_ONLINE_AND', 'und');
+define('BOX_WHOS_ONLINE_MEMBER', 'Kunde');
+define('BOX_WHOS_ONLINE_MEMBERS', 'Kunden');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,27 @@
+<?php
+/*
+  $Id: wishlist_help.php,v 1 2002/11/09
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Meine Wunschliste');
+define('HEADING_TITLE', 'Meine Wunschliste');
+define('BOX_TEXT_PRICE', 'Preis:');
+define('BOX_TEXT_SEND', 'Schicken Sie den Wunschzettel an Ihre Freunde.');
+define('BOX_TEXT_MOVE_TO_CART', 'In den Warenkorb');
+define('BOX_TEXT_DELETE', 'L&ouml;schen');
+define('BOX_TEXT_VIEW', 'Anzeigen');
+define('BOX_TEXT_HELP', 'Hilfe');
+define('BOX_TEXT_SELECTED_PRODUCTS', 'Ausgew&auml;hlte Produkte');
+define('BOX_TEXT_SELECT_PRODUCT', 'Produkt ausw&auml;hlen ');
+
+define('BOX_TEXT_NO_ITEMS', 'Es dind keine Produkte in Ihrer Wunschliste vorhanden. <br><br><b><a href="wishlist_help.php"><u>Klicken Sie hier</u></a> um zu erfahren, wie Sie mit dem Bereich Wunschliste arbeiten können.</b>');
+define('TEXT_WISHLIST_COUNT', 'Momentan %s Artikel in Ihrer Wunschliste.');
+define('TEXT_DISPLAY_NUMBER_OF_WISHLIST', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Artikeln in Ihrer Wunschliste)');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/wishlist_email.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/wishlist_email.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/wishlist_email.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: wishlist_email.php,v 1 2003/11/20
+
+  OS Commerce - Community Made Shopping!
+  http://www.oscommerce.com
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+
+define('NAVBAR_TITLE', 'Wunschliste versenden');
+define('HEADING_TITLE', 'Schicken Sie den Wunschzettel an Ihre Freunde.');
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Ihre Informationen');
+define('FORM_FIELD_CUSTOMER_NAME', 'Ihr Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Ihre Email Adresse:');
+define('FORM_TITLE_FRIEND_DETAILS', 'Empf&auml;nger Informationen');
+define('FORM_FIELD_FRIEND_NAME', 'Der Name Ihres Freundes');
+define('FORM_FIELD_FRIEND_EMAIL', 'Die Email Adresse Ihres Freundes:');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Ihre Nachricht');
+define('FORM_FIELD_TEXT_AREA', 'Meine Wunschliste:'. "\n\n");
+
+define('FORM_FIELD_PRODUCTS', 'Products on my wish list'. "\n\n");
+
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Ihre Email zu <b>%s</b> wurde an <b>%s</b> erfoglrech versendet.');
+define('TEXT_EMAIL_SUBJECT', 'Ihr Freund %s möchte Ihnen gerne seine Wunschliste %s zeigen.');
+define('TEXT_EMAIL_INTRO', 'Hi %s!' . "\n\n" . 'Ihr Freund, %s, dachte, dass Sie seine Wunschliste bei %s %s sehen möchten.');
+define('TEXT_EMAIL_SIGNATURE', 'Viele Grüße,' . "\n\n");
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below :' . "\n");
+define('TEXT_EMAIL_LINK_TEXT', 'To view the product copy and paste the link into your web browser:' . "\n");
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>

Added: trunk/direct.openmoko.com/includes/languages/german/wishlist_help.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/wishlist_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/wishlist_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: wishlist_help.php,v 1 2002/11/09
+
+  The Exchange Project - Community Made Shopping!
+  http://www.theexchangeproject.org
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Meine Wunschliste F.A.Q.');
+define('HEADING_TITLE', 'Meine Wunschliste F.A.Q.');
+
+define('TEXT_CLOSE_WINDOW', '<u>Fenster Schliessen</u> [x]');
+
+define('TEXT_INFORMATION', '<b>Was ist ' . BOX_HEADING_CUSTOMER_WISHLIST . '?</b><br>' .
+BOX_HEADING_CUSTOMER_WISHLIST . ' ist eine M&ouml;glichkeit f&uuml;r Sie, eine Erinnerung an einen Artikel anzulegen, welchen Sie gerne kaufen würden, oder welcher momentan nicht lagernd ist.
+<br>
+<br>
+<b>Wie gebe ich Artikel zu meiner ' . BOX_HEADING_CUSTOMER_WISHLIST . '? </b><br>
+Um einen Artikel Ihrer ' . BOX_HEADING_CUSTOMER_WISHLIST . 'zu geben, klicken Sie einfach auf den Button "In die Wunschliste" f&uuml;r jeden Artikel, der Sie interessiert. Der "In die Wunschliste" Button erscheint neben dem "In den Warenkorb" Button in den jeweiligen Artikel-Infoseiten.
+<br>
+<br>
+<b>Kann ich "nicht lagernd" oder "bald erhältlich" Artikel hinzuf&uuml;gen?</b><br>
+Ja, Sie k&ouml;nnen diese Ihrer ' . BOX_HEADING_CUSTOMER_WISHLIST . ' hinzuf&uuml;gen<br>
+<br>
+<br>
+<b>Wie sehe ich mir meine ' . BOX_HEADING_CUSTOMER_WISHLIST . ' an?</b><br>
+In der rechten Spalte ist eine  "' . BOX_HEADING_CUSTOMER_WISHLIST . '" Box.  Diese Box zeigt Ihnen den aktuellen Status Ihrer ' . BOX_HEADING_CUSTOMER_WISHLIST . ' an.  Wenn dort 5 oder weniger Artikel in Ihrer ' . BOX_HEADING_CUSTOMER_WISHLIST . ' sind, werden diese dort aufgelistet. Wenn dort mehr als 5 Artikel vorhanden sind, wird ein einfacher Counter mit der Gesamtanzahl der Artikel in der ' . BOX_HEADING_CUSTOMER_WISHLIST . ' angezeigt.
+<br>
+<br>
+Die ' . BOX_HEADING_CUSTOMER_WISHLIST . ' kann jederzeit eingesehen werden; entweder durch Klicken auf den Link, den Sie in der "' . BOX_HEADING_CUSTOMER_WISHLIST . '" box (<i><u>Zeige ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</i>).  oder durch Klicken auf den rechten Pfeil in der "' . BOX_HEADING_CUSTOMER_WISHLIST . '" Box.
+<br>
+<br>
+<b>Wie verschiebe ich Artikel aus meiner ' . BOX_HEADING_CUSTOMER_WISHLIST . ' in meinen Warenkorb?</b><br>
+Um ' . BOX_HEADING_CUSTOMER_WISHLIST . '-Artikel in den Warenkorb zu verschieben, klicken Sie entweder auf "In den Warenkorb" unter dem Artikel-Namen in der "' . BOX_HEADING_CUSTOMER_WISHLIST . '" Box (wenn die ' . BOX_HEADING_CUSTOMER_WISHLIST . ' Artikel in der Box sind) oder klicken Sie auf "In den Warenkorb veschieben" unterhalb der Artikel in der ' . BOX_HEADING_CUSTOMER_WISHLIST . ' Hauptseite und voila! Der Artikel ist nun in den Warenkorb verschoben worden.
+<br>
+<br>
+<b>Wie entferne ich Artikel aus meiner ' . BOX_HEADING_CUSTOMER_WISHLIST . '?</b><br>
+Um Artikel von der ' . BOX_HEADING_CUSTOMER_WISHLIST . ' zu entfernen, klicken Sie entweder "L&ouml;schen" unter dem Artikelnamen in der "' . BOX_HEADING_CUSTOMER_WISHLIST . '" Box oder klicken Sie "L&ouml;schen" unterhalb der Artikel in der ' . BOX_HEADING_CUSTOMER_WISHLIST . ' Hauptseite bei den Artikeln, die Sie entfernen wollen.
+<br>
+<br>
+<b> Kann ich meine Wunschliste anderen zug&auml;nglich machen? </b><br>
+Leider nicht. Im Moment ist "Meine Wunschliste" nur erreichbar, wenn Sie sich bei Ihrem Konto angemeldet haben. Daher k&ouml;nnen nur Sie selbst die Wunschliste einsehen.
+<br>
+<br>');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/languages/german/wpcallback.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german/wpcallback.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german/wpcallback.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: wpcallback.php,v MS1a 2003/04/06 21:30
+  Author :  Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.4
+
+  Revisions:
+  Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+          Now posting language code to WP, Redirect on failure now to Checkout Payment,
+      Reduced re-direct time to 8 seconds, added MD5, made callback dynamic 
+      NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+  Version 1.4 Removes boxes to prevent users from clicking away before update, 
+      Fixes currency for Yen, 
+      Redirects to Checkout_Process after 10 seconds or click by user
+  Version 1.3 Fixes problem with Multi Currency
+  Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+  Version 1.1 Added Worldpay Pre-Authorisation ability
+  Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'WorldPay');
+define('WP_TEXT_HEADING', 'Response from WorldPay:');
+define('HEADING_TITLE', 'Thank you for shopping with ' . STORE_NAME . ' .... ');
+define('WP_TEXT_SUCCESS', '... your payment was successfully received.');
+define('WP_TEXT_SUCCESS_WAIT', '<b><font color="#FF0000">Please wait...</font></b> whilst we finish processing your order.<br>If you are not automatically re-directed in 10 seconds, please click continue.');
+define('WP_TEXT_FAILURE', '... Your payment has been cancelled!');
+define('WP_TEXT_FAILURE_WAIT', '<b><font color="#FF0000">Please wait...</font></b><br>If you are not automatically re-directed in 10 seconds, please click continue.');
+
+?>

Added: trunk/direct.openmoko.com/includes/languages/german.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/german.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/german.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,661 @@
+<?php
+/*
+  $Id: german.php,v 1.3 2004/03/15 12:13:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// look in your $PATH_LOCALE/locale directory for available locales
+// or type locale -a on the server.
+// Examples:
+// on RedHat try 'de_DE'
+// on FreeBSD try 'de_DE.ISO_8859-1'
+// on Windows try 'de' or 'German'
+ at setlocale(LC_TIME, 'de_DE.ISO_8859-1');
+
+//VVC Constants
+define('VISUAL_VERIFY_CODE_CHARACTER_POOL', 'abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789FJWNVB63HDLAJAF');  //no zeros or O
+define('VISUAL_VERIFY_CODE_CATEGORY', 'Verify security code');
+define('VISUAL_VERIFY_CODE_ENTRY_ERROR', 'The security code you entered did not match the one displayed.');
+define('VISUAL_VERIFY_CODE_ENTRY_TEXT', '*');
+define('VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS', 'Type security code here:');
+define('VISUAL_VERIFY_CODE_BOX_IDENTIFIER', '<- Security Code');
+
+define('DATE_FORMAT_SHORT', '%d.%m.%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A, %d. %B %Y'); // this is used for strftime()
+define('DATE_FORMAT', 'd.m.Y');  // this is used for strftime()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+
+////
+// Return date in raw format
+// $date should be in format dd/mm/yyyy
+// raw date is in format YYYYMMDD, or DDMMYYYY
+function tep_date_raw($date, $reverse = false) {
+  if ($reverse) {
+    return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
+  }
+}
+
+// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
+define('LANGUAGE_CURRENCY', 'EUR');
+
+// Global entries for the <html> tag
+define('HTML_PARAMS','dir="LTR" lang="de"');
+
+// charset for web pages and emails
+define('CHARSET', 'iso-8859-1');
+
+// page title
+define('TITLE', 'Your Store Name, change in catalog/includes/languages/   your language');
+
+// ######## CCGV
+define('BOX_INFORMATION_GV', '      Geschenk-Gutschein einl&ouml;sen      ');
+define('VOUCHER_BALANCE', 'Geschenk-Gutscheinwert');
+define('BOX_HEADING_GIFT_VOUCHER', 'Geschenk-Gutschein Konto');
+define('GV_FAQ', 'Geschenk-Gutschein FAQ');
+define('ERROR_REEDEEMED_AMOUNT', 'Gl&uuml;ckwunsch, Sie haben eingel&ouml;st: ');
+define('ERROR_NO_REDEEM_CODE', 'Sie haben keinen einl&ouml;se-Code eingegeben.');
+define('ERROR_NO_INVALID_REDEEM_GV', 'Ung&uuml;ltiger Geschenk-Gutschein-Code');
+define('TABLE_HEADING_CREDIT', 'Guthaben verf&uuml;gbar');
+define('GV_HAS_VOUCHERA', 'Sie haben Guthaben in Ihrem Geschenk-Gutschein-Konto. Wenn Sie m&ouml;chten, <br>k&ouml;nnen Sie dieses Guthaben per <a class="pageResults" href="');
+       
+define('GV_HAS_VOUCHERB', '"><b>Email</b></a> an jemanden versenden');
+define('ENTRY_AMOUNT_CHECK_ERROR', 'Sie haben nicht gen&uuml;gend Guthaben, um diesen Wert zu versenden.');
+define('BOX_SEND_TO_FRIEND', 'Geschenk-Gutschein versenden');
+
+define('VOUCHER_REDEEMED', 'Gutschein eingel&ouml;st');
+define('CART_COUPON', 'Kupon :');
+define('CART_COUPON_INFO', 'Mehr Info');
+define('MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR', 'Coupon Redemption');
+define('ERROR_REDEEMED_AMOUNT_ZERO', '<BR>***HOWEVER:No reducion available, please see the coupon restrictions***');
+// header text in includes/header.php
+define('HEADER_TITLE_CREATE_ACCOUNT', 'Neues Konto');
+define('HEADER_TITLE_MY_ACCOUNT', 'Ihr Konto');
+define('HEADER_TITLE_CART_CONTENTS', 'Warenkorb');
+define('HEADER_TITLE_CHECKOUT', 'Kasse');
+define('HEADER_TITLE_TOP', 'Startseite');
+define('HEADER_TITLE_CATALOG', 'Katalog');
+define('HEADER_TITLE_LOGOFF', 'Abmelden');
+define('HEADER_TITLE_LOGIN', 'Anmelden');
+
+// footer text in includes/footer.php
+define('FOOTER_TEXT_REQUESTS_SINCE', 'Zugriffe seit');
+
+// text for gender
+define('MALE', 'Herr');
+define('FEMALE', 'Frau');
+define('MALE_ADDRESS', 'Herr');
+define('FEMALE_ADDRESS', 'Frau');
+
+// text for date of birth example
+define('DOB_FORMAT_STRING', 'dd/mm/aaaa');
+
+// categories mainpage
+define('BOX_HEADING_CATEGORIES_MAIN_PAGE', 'Kategorien');
+
+
+// quick_find box text in includes/boxes/quick_find.php
+define('BOX_SEARCH_TEXT', 'Use keywords to find the product you are looking for.');
+define('BOX_SEARCH_ADVANCED_SEARCH', 'erweiterte Suche');
+
+
+// reviews box text in includes/boxes/reviews.php
+//define('BOX_HEADING_REVIEWS', 'Bewertungen');
+define('BOX_REVIEWS_WRITE_REVIEW', 'Bewerten Sie diesen Artikel!');
+define('BOX_REVIEWS_NO_REVIEWS', 'Es liegen noch keine Bewertungen vor');
+define('BOX_REVIEWS_TEXT_OF_5_STARS', '%s von 5 Sternen!');
+
+// shopping_cart box text in includes/boxes/shopping_cart.php
+
+define('BOX_SHOPPING_CART_EMPTY', '0 Artikel');
+
+
+// best_sellers box text in includes/boxes/best_sellers.php
+define('BOX_HEADING_BESTSELLERS_IN', 'Bestseller<br>&nbsp;&nbsp;');
+
+// notifications box text in includes/boxes/products_notifications.php
+
+define('BOX_NOTIFICATIONS_NOTIFY', 'Benachrichtigen Sie mich &uuml;ber Aktuelles zu diesem Artikel <b>%s</b>');
+define('BOX_NOTIFICATIONS_NOTIFY_REMOVE', 'Benachrichtigen Sie mich nicht mehr zu diesem Artikel <b>%s</b>');
+
+// manufacturer box text
+
+define('BOX_MANUFACTURER_INFO_HOMEPAGE', '%s Homepage');
+define('BOX_MANUFACTURER_INFO_OTHER_PRODUCTS', 'Mehr Artikel');
+
+// tell a friend box text in includes/boxes/tell_a_friend.php
+define('BOX_TELL_A_FRIEND_TEXT', 'Tell someone you know about this product.');
+
+//BEGIN allprods modification
+define('BOX_INFORMATION_ALLPRODS', 'Zeige alle Artikel');
+//END allprods modification
+
+//BEGIN all categories and products modification
+define ('ALL_PRODUCTS_LINK', 'All Products sorted by Categories');
+//END categories and products modification
+
+//BEGIN all categories and products modification
+define ('ALL_PRODUCTS_MANF', 'All Products sorted by Manufacturers');
+//END categories and products modification
+// VJ Links Manager v1.00 begin
+define('BOX_INFORMATION_LINKS', 'Links');
+// VJ Links Manager v1.00 end
+
+// checkout procedure text
+define('CHECKOUT_BAR_DELIVERY', 'Versandinformationen');
+define('CHECKOUT_BAR_PAYMENT', 'Zahlungsweise');
+define('CHECKOUT_BAR_CONFIRMATION', 'Best&auml;tigung');
+define('CHECKOUT_BAR_FINISHED', 'Fertig!');
+
+// pull down default text
+define('PULL_DOWN_DEFAULT', 'Bitte w&auml;hlen');
+define('TYPE_BELOW', 'bitte unten eingeben');
+
+// javascript messages
+define('JS_ERROR', 'Notwendige Angaben fehlen!\nBitte richtig ausf&uml;llen.\n\n');
+
+define('JS_REVIEW_TEXT', '* Der Text muss mindestens aus ' . REVIEW_TEXT_MIN_LENGTH . ' Buchstaben bestehen.\n');
+define('JS_REVIEW_RATING', '* Geben Sie Ihre Bewertung ein.\n');
+
+define('JS_ERROR_NO_PAYMENT_MODULE_SELECTED', '* Bitte wählen Sie eine Zahlungsweise für Ihre Bestellung.\n');
+
+define('JS_ERROR_SUBMITTED', 'Diese Seite wurde bereits bestätigt. Betätigen Sie bitte OK und warten bis der Prozess durchgeführt wurde.');
+
+define('ERROR_NO_PAYMENT_MODULE_SELECTED', 'Bitte wählen Sie eine Zahlungsweise für Ihre Bestellung.');
+
+define('CATEGORY_COMPANY', 'Firmendaten');
+define('CATEGORY_PERSONAL', 'Ihre pers&ouml;nlichen Daten');
+define('CATEGORY_ADDRESS', 'Ihre Adresse');
+define('CATEGORY_CONTACT', 'Ihre Kontaktinformationen');
+define('CATEGORY_OPTIONS', 'Optionen');
+define('CATEGORY_PASSWORD', 'Ihr Passwort');
+
+define('ENTRY_COMPANY', 'Firmenname:');
+define('ENTRY_COMPANY_ERROR', '');
+define('ENTRY_COMPANY_TEXT', '');
+define('ENTRY_GENDER', 'Anrede:');
+define('ENTRY_GENDER_ERROR', 'Bitte das Geschlecht angeben.');
+define('ENTRY_GENDER_TEXT', '*');
+define('ENTRY_FIRST_NAME', 'Vorname:');
+define('ENTRY_FIRST_NAME_ERROR', 'Der Vorname sollte mindestens ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_FIRST_NAME_TEXT', '*');
+define('ENTRY_LAST_NAME', 'Nachname:');
+define('ENTRY_LAST_NAME_ERROR', 'Der Nachname sollte mindestens ' . ENTRY_LAST_NAME_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_LAST_NAME_TEXT', '*');
+define('ENTRY_DATE_OF_BIRTH', 'Geburtsdatum:');
+define('ENTRY_DATE_OF_BIRTH_ERROR', 'Bitte geben Sie Ihr Geburtsdatum in folgendem Format ein: TT.MM.JJJJ (z.B. 21.05.1970)');
+define('ENTRY_DATE_OF_BIRTH_TEXT', '* (z.B. 21.05.1970)');
+define('ENTRY_EMAIL_ADDRESS', 'Email-Adresse:');
+define('ENTRY_EMAIL_ADDRESS_ERROR', 'Die Email Adresse sollte mindestens ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', 'Die Email Adresse scheint nicht gültig zu sein - bitte korrigieren.');
+define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', 'Die Email Adresse ist bereits gespeichert - bitte melden Sie sich mit dieser Adresse an oder eröffnen Sie ein neues Konto mit einer anderen Adresse.');
+define('ENTRY_EMAIL_CHECK_ERROR', 'There has been an error with sending this email please! Contact the store owner.');
+define('ENTRY_EMAIL_ADDRESS_TEXT', '*');
+define('ENTRY_STREET_ADDRESS', 'Strasse/Nr.:');
+define('ENTRY_STREET_ADDRESS_ERROR', 'Die Strassenadresse sollte mindestens ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_STREET_ADDRESS_TEXT', '*');
+define('ENTRY_SUBURB', 'Stadtteil:');
+define('ENTRY_SUBURB_ERROR', '');
+define('ENTRY_SUBURB_TEXT', '');
+define('ENTRY_POST_CODE', 'Postleitzahl:');
+define('ENTRY_POST_CODE_ERROR', 'Die Postleitzahl sollte mindestens ' . ENTRY_POSTCODE_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_POST_CODE_TEXT', '*');
+define('ENTRY_CITY', 'Ort:');
+define('ENTRY_CITY_ERROR', 'Die Stadt sollte mindestens ' . ENTRY_CITY_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_CITY_TEXT', '*');
+define('ENTRY_STATE', 'Bundesland:');
+define('ENTRY_STATE_ERROR', 'Das Bundesland sollte mindestens ' . ENTRY_STATE_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_STATE_ERROR_SELECT', 'Bitte wählen Sie ein Bundesland aus der Liste.');
+
+define('ENTRY_STATE_TEXT', '*');
+
+
+define('ENTRY_COUNTRY', 'Land:');
+define('ENTRY_COUNTRY_ERROR', 'Bitte wählen Sie ein Land aus der Liste.');
+define('ENTRY_COUNTRY_TEXT', '*');
+define('ENTRY_TELEPHONE_NUMBER', 'Telefonnummer:');
+define('ENTRY_TELEPHONE_NUMBER_ERROR', 'Die Telefonnummer sollte mindestens ' . ENTRY_TELEPHONE_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');
+define('ENTRY_FAX_NUMBER', 'Telefaxnummer:');
+define('ENTRY_FAX_NUMBER_ERROR', '');
+define('ENTRY_FAX_NUMBER_TEXT', '');
+define('ENTRY_NEWSLETTER', 'Newsletter:');
+define('ENTRY_NEWSLETTER_TEXT', '');
+define('ENTRY_NEWSLETTER_YES', 'abonniert');
+define('ENTRY_NEWSLETTER_NO', 'nicht abonniert');
+define('ENTRY_NEWSLETTER_ERROR', '');
+define('ENTRY_PASSWORD', 'Passwort:');
+define('ENTRY_PASSWORD_ERROR', 'Das Passwort sollte mindestens ' . ENTRY_PASSWORD_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_PASSWORD_ERROR_NOT_MATCHING', 'Beide eingegebenen Passwörter müssen identisch sein.');
+define('ENTRY_PASSWORD_TEXT', '*');
+define('ENTRY_PASSWORD_CONFIRMATION', 'Best&auml;tigung:');
+define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT', 'Current Password:');
+define('ENTRY_PASSWORD_CURRENT_TEXT', '*');
+define('ENTRY_PASSWORD_CURRENT_ERROR', 'Das Passwort sollte mindestens ' . ENTRY_PASSWORD_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_PASSWORD_NEW', 'New Password:');
+define('ENTRY_PASSWORD_NEW_TEXT', '*');
+define('ENTRY_PASSWORD_NEW_ERROR', 'Das neue Passwort sollte mindestens ' . ENTRY_PASSWORD_MIN_LENGTH . ' Zeichen enthalten.');
+define('ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING', 'Die Passwort-Bestätigung muss mit Ihrem neuen Passwort übereinstimmen.');
+define('PASSWORD_HIDDEN', '--VERSTECKT--');
+
+define('FORM_REQUIRED_INFORMATION', '* Notwendige Eingabe');
+
+// constants for use in tep_prev_next_display function
+define('TEXT_RESULT_PAGE', 'Seiten:');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Artikel)');
+define('TEXT_DISPLAY_NUMBER_OF_ORDERS', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bestellungen)');
+define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Meinungen)');
+define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> neuen Artikeln)');
+define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Angeboten)');
+define('TEXT_DISPLAY_NUMBER_OF_FEATURED', 'Zeige <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Speziellen Produkten)');
+
+define('PREVNEXT_TITLE_FIRST_PAGE', 'erste Seite');
+define('PREVNEXT_TITLE_PREVIOUS_PAGE', 'vorherige Seite');
+define('PREVNEXT_TITLE_NEXT_PAGE', 'n&auml;chste Seite');
+define('PREVNEXT_TITLE_LAST_PAGE', 'letzte Seite');
+define('PREVNEXT_TITLE_PAGE_NO', 'Seite %d');
+define('PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE', 'Vorhergehende %d Seiten');
+define('PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE', 'N&auml;chste %d Seiten');
+define('PREVNEXT_BUTTON_FIRST', '&lt;&lt;ERSTE');
+define('PREVNEXT_BUTTON_PREV', '[&lt;&lt;&nbsp;vorherige]');
+define('PREVNEXT_BUTTON_NEXT', '[n&auml;chste&nbsp;&gt;&gt;]');
+define('PREVNEXT_BUTTON_LAST', 'LETZTE&gt;&gt;');
+
+define('IMAGE_BUTTON_ADD_ADDRESS', 'Neue Adresse');
+define('IMAGE_BUTTON_ADDRESS_BOOK', 'Adressbuch');
+define('IMAGE_BUTTON_BACK', 'Zurück');
+define('IMAGE_BUTTON_BUY_NOW', 'Buy Now');
+define('IMAGE_BUTTON_CHANGE_ADDRESS', 'Adresse ändern');
+define('IMAGE_BUTTON_CHECKOUT', 'Kasse');
+define('IMAGE_BUTTON_CONFIRM_ORDER', 'Bestellung bestätigen');
+define('IMAGE_BUTTON_CONTINUE', 'Weiter');
+define('IMAGE_BUTTON_CONTINUE_SHOPPING', 'Einkauf fortsetzen');
+define('IMAGE_BUTTON_DELETE', 'Löschen');
+define('IMAGE_BUTTON_EDIT_ACCOUNT', 'Daten ändern');
+define('IMAGE_BUTTON_HISTORY', 'Bestellübersicht');
+define('IMAGE_BUTTON_LOGIN', 'Anmelden');
+define('IMAGE_BUTTON_IN_CART', 'In den Warenkorb');
+define('IMAGE_BUTTON_NOTIFICATIONS', 'Benachrichtigungen');
+define('IMAGE_BUTTON_QUICK_FIND', 'Schnellsuche');
+define('IMAGE_BUTTON_REMOVE_NOTIFICATIONS', 'Benachrichtigungen löschen');
+define('IMAGE_BUTTON_REVIEWS', 'Bewertungen');
+define('IMAGE_BUTTON_SEARCH', 'Suchen');
+define('IMAGE_BUTTON_SHIPPING_OPTIONS', 'Versandoptionen');
+define('IMAGE_BUTTON_TELL_A_FRIEND', 'Weiterempfehlen');
+define('IMAGE_BUTTON_UPDATE', 'Aktualisieren');
+define('IMAGE_BUTTON_UPDATE_CART', 'Warenkorb aktualisieren');
+define('IMAGE_BUTTON_WRITE_REVIEW', 'Bewertung schreiben');
+
+define('SMALL_IMAGE_BUTTON_DELETE', 'Delete');
+define('SMALL_IMAGE_BUTTON_EDIT', 'Edit');
+define('SMALL_IMAGE_BUTTON_VIEW', 'View');
+
+define('ICON_ARROW_RIGHT', 'Zeige mehr');
+define('ICON_CART', 'In den Warenkorb');
+define('ICON_ERROR', 'Fehler');
+define('ICON_SUCCESS', 'Success');
+define('ICON_WARNING', 'Warnung');
+
+define('TEXT_CUSTOMER_GREETING_HEADER', 'Unsere Kunden-Begr&uuml;ssung');
+define('TEXT_GREETING_PERSONAL', 'Sch&ouml;n das Sie wieder da sind <span class="greetUser">%s!</span> M&ouml;chten Sie die <a href="%s"><u>neuen Artikel</u></a> ansehen?');
+define('TEXT_GREETING_PERSONAL_RELOGON', '<small>Wenn Sie nicht %s sind, melden Sie sich bitte <a href="%s"><u>hier</u></a> mit Ihrem Kundenkonto an.</small>');
+define('TEXT_GREETING_GUEST', 'Herzlich Willkommen <span class="greetUser">Gast!</span> M&ouml;chten Sie sich <a href="%s"><u>anmelden</u></a>? Oder wollen Sie ein <a href="%s"><u>Kundenkonto</u></a> er&ouml;ffnen?');
+
+define('TEXT_SORT_PRODUCTS', 'Sortierung der Artikel ');
+define('TEXT_DESCENDINGLY', 'absteigend');
+define('TEXT_ASCENDINGLY', 'aufsteigend');
+define('TEXT_BY', ' nach ');
+
+define('TEXT_REVIEW_BY', 'von %s');
+define('TEXT_REVIEW_WORD_COUNT', '%s Worte');
+define('TEXT_REVIEW_RATING', 'Bewertung: %s [%s]');
+define('TEXT_REVIEW_DATE_ADDED', 'Datum hinzugef&uuml;gt: %s');
+define('TEXT_NO_REVIEWS', 'Es liegen noch keine Bewertungen vor.');
+
+define('TEXT_NO_NEW_PRODUCTS', 'Zur Zeit gibt es keine neuen Artikel.');
+
+define('TEXT_NO_PRODUCTS', 'Es sind keine Artikel in diesem BEreich vorhanden.');
+
+define('TEXT_UNKNOWN_TAX_RATE', 'Unbekannter Steuersatz');
+
+define('TEXT_REQUIRED', '<span class="errorText">erforderlich</span>');
+
+// Down For Maintenance
+define('TEXT_BEFORE_DOWN_FOR_MAINTENANCE', 'ACHTUNG: Diese Seite wird wegen Wartungsarbeiten offline sein am: ');
+define('TEXT_ADMIN_DOWN_FOR_MAINTENANCE', 'ACHTUNG: Diese Seite ist im Moment offline wegen Wartungsarbeiten.');
+
+define('ERROR_TEP_MAIL', '<font face="Verdana, Arial" size="2" color="#ff0000"><b><small>Fehler:</small> Die Email kann nicht &uuml;ber den angegebenen SMTP-Server verschickt werden. Bitte kontrollieren Sie die Einstellungen in der php.ini Datei und f&uuml;hren Sie notwendige Korrekturen durch!</b></font>');
+define('WARNING_INSTALL_DIRECTORY_EXISTS', 'Warnung: Das Installationverzeichnis ist noch vorhanden auf: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install. Bitte l&ouml;schen Sie das Verzeichnis aus Gr&uuml;nden der Sicherheit!');
+define('WARNING_UPGRADES_DIRECTORY_EXISTS', 'Warning: Upgrades directory exists at: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/upgrades. Please remove this directory for security reasons.');
+define('WARNING_CONFIG_FILE_WRITEABLE', 'Warnung: osC kann in die Konfigurationsdatei schreiben: ' . dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php. Das stellt ein m&ouml;gliches Sicherheitsrisiko dar - bitte korrigieren Sie die Benutzerberechtigungen zu dieser Datei!');
+define('WARNING_SESSION_DIRECTORY_NON_EXISTENT', 'Warnung: Das Verzeichnis f&uuml;r die Sessions existiert nicht: ' . tep_session_save_path() . '. Die Sessions werden nicht funktionieren bis das Verzeichnis erstellt wurde!');
+define('WARNING_SESSION_DIRECTORY_NOT_WRITEABLE', 'Warnung: osC kann nicht in das Sessions Verzeichnis schreiben: ' . tep_session_save_path() . '. Die Sessions werden nicht funktionieren bis die richtigen Benutzerberechtigungen gesetzt wurden!');
+define('WARNING_SESSION_AUTO_START', 'Warnung: session.auto_start ist enabled - Bitte disablen Sie dieses PHP Feature in der php.ini und starten Sie den WEB-Server neu!');
+define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Warnung: Das Verzeichnis für den Artikel Download existiert nicht: ' . DIR_FS_DOWNLOAD . '. Diese Funktion wird nicht funktionieren bis das Verzeichnis erstellt wurde!');
+define('WARNING_ENCRYPT_FILE_MISSING', 'Warning: The Encryption key file is missing.');
+
+
+define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'Error: 01 The first four digits of the number entered are: %s If that number is correct, we do not accept that type of credit card.If it is wrong, please try again.');
+define('TEXT_CCVAL_ERROR_INVALID_MONTH', 'Error: 02 The expiry date Motnth entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_YEAR', 'Error: 03 The expiry date year entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CCVAL_ERROR_INVALID_DATE', 'Error: 04 The expiry date entered for the credit card is invalid.Please check the date and try again.');
+define('TEXT_CSCAL_ERROR_CARD_TYPE_MISMATCH', 'Error: 05 The Credit Card number does not match the Card Type:');
+define('TEXT_CCVAL_ERROR_SHORT', 'Error: 06 You have not entered the correct amount of digits. Please ensure you have entered all of the long number displayed on the front of your card');
+define('TEXT_CCVAL_ERROR_BLACKLIST', 'Error: 07 We cannot accept your card as it is blacklisted, if you feel you have recieved this message in error please contact your card issuer.');
+define('TEXT_CCVAL_ERROR_CVV_LENGTH', 'Error: 08 The CCV/CVV/CID number entered is the incorrect length. Please try again.');
+define('TEXT_CCVAL_ERROR_NOT_ACCEPTED', 'Error: 09 The credit card number you have entered appears to be a %s card. Unfortunately at this time we do not accept %s as payment.');
+define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'Error: 10 The credit card number entered is invalid. Please check the number for misstyped numbers and try again.');
+
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default osCommerce-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+define('FOOTER_TEXT_BODY', 'Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a> and <a href="http://www.chainreactionweb.com" target="_blank">CRE Loaded Team</a><br>Powered by <a href="http://www.oscommerce.com" target="_blank">Oscommerce</a><font color="red"> Supercharged by</font> <a href="http://www.creloaded.com" target="_blank">CRE Loaded Team</a><br>Using Version ' . PROJECT_VERSION);
+/////////////////////////////////////////////////////////////////////
+// HEADER.PHP
+// Header Links
+define('HEADER_LINKS_DEFAULT','HOME');
+define('HEADER_LINKS_WHATS_NEW','WHAT\'S NEW?');
+define('HEADER_LINKS_SPECIALS','SPECIALS');
+define('HEADER_LINKS_REVIEWS','REVIEWS');
+define('HEADER_LINKS_LOGIN','LOGIN');
+define('HEADER_LINKS_LOGOFF','LOG OFF');
+define('HEADER_LINKS_PRODUCTS_ALL','CATALOG');
+define('HEADER_LINKS_ACCOUNT_INFO','ACCOUNT INFO');
+define('HEADER_LINKS_LINKS','LINKS');
+define('HEADER_LINKS_FAQ','FAQS');
+define('HEADER_LINKS_NEWS','NEWS');
+define('HEADER_LINKS_INFORMATION','INFORMATION');
+/////////////////////////////////////////////////////////////////////
+
+// BOF: Lango added for print order mod
+define('IMAGE_BUTTON_PRINT_ORDER', 'Order printable');
+// EOF: Lango added for print order mod
+
+// WebMakers.com Added: Attributes Sorter
+require(DIR_WS_LANGUAGES . $language . '/' . 'attributes_sorter.php');
+
+// wishlist box text in includes/boxes/wishlist.php
+define('BOX_HEADING_CUSTOMER_WISHLIST', 'My Wishlist');
+define('BOX_WISHLIST_EMPTY', 'You have no items on your Wishlist');
+define('IMAGE_BUTTON_ADD_WISHLIST', 'Add to Wishlist');
+define('TEXT_WISHLIST_COUNT', 'Currently %s items are on your Wishlist.');
+define('TEXT_DISPLAY_NUMBER_OF_WISHLIST', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> items on your wishlist)');
+define('BOX_HEADING_CUSTOMER_WISHLIST_HELP', 'Wishlist Help');
+define('BOX_HEADING_SEND_WISHLIST', 'Send your Wishlist');
+define('BOX_TEXT_MOVE_TO_CART', 'Move to Cart');
+define('BOX_TEXT_DELETE', 'Delete');
+
+//DWD Modify: Information Page Unlimited 1.1f - PT
+ // define('BOX_HEADING_INFORMATION', 'Info system');
+  define('BOX_INFORMATION_MANAGER', 'Info Manager');
+//DWD Modify End
+
+if(file_exists('includes/languages/english_newsdesk.php')) {
+include('includes/languages/german_newsdesk.php');
+include('includes/languages/german_faqdesk.php');
+}
+
+/*Begin Checkout Without Account images*/
+define('IMAGE_BUTTON_CREATE_ACCOUNT', 'Create Account');
+define('NAV_ORDER_INFO', 'Order Info');
+/*End Checkout WIthout Account images*/
+
+// Include for Events Calendar 2.0 Contribution 
+define('BOX_TOOLS_EVENTS_MANAGER', 'Events Manager');
+define('IMAGE_NEW_EVENT', 'New Event');
+
+// VJ guest pricing begin
+// ADDED for Viewprice
+// Text to replace price in InfoBoxes
+define('PRICES_LOGGED_IN_TEXT', 'Trade Price');
+// Text to replace price in Product Info, Specials & New Products lists
+define('PRICES_LOGGED_IN_SUBMIT','Trade Price');
+// Text to replace Buy 'Now button'
+define('PRICES_LOGGED_IN_BUY_TEXT', 'Trade Only');
+// END ViewPrice
+// VJ guest pricing end
+
+//Added for FAQ System 2.1 DMG
+
+  define('BOX_INFORMATION_FAQ', 'FAQ');
+
+//Added for Article Manager DMG
+
+// Article Manager
+define('BOX_HEADING_ARTICLES', 'Articles');
+define('BOX_ALL_ARTICLES', 'All Articles');
+define('BOX_NEW_ARTICLES', 'New Articles');
+define('TEXT_DISPLAY_NUMBER_OF_ARTICLES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> articles)');
+define('TEXT_DISPLAY_NUMBER_OF_ARTICLES_NEW', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> new articles)');
+define('TABLE_HEADING_AUTHOR', 'Author');
+define('TABLE_HEADING_ABSTRACT', 'Abstract');
+define('BOX_HEADING_AUTHORS', 'Articles by Author');
+define('NAVBAR_TITLE_DEFAULT', 'Articles');
+define('BOX_ASEARCH_TEXT','Search Articles Text');
+// Eversun mod for sppc and qty price breaks
+define('ENTRY_COMPANY_TAX_ID', 'Company\'s tax id number:');
+define('ENTRY_COMPANY_TAX_ID_ERROR', '');
+define('ENTRY_COMPANY_TAX_ID_TEXT', '');
+// Eversun mod end for sppc and qty price breaks  
+
+
+#################    Starts - 15 June 2006    #################
+
+
+define('IFRAME_ERROR','Sorry, you browser does not support iframes.');
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_1","You still have</br>");
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_2","</br>left to spend in your Gift Voucher Account<br><br>");
+define("GIFT_VOUCHER_ACCOUNT_BALANCE_3","Send to a Friend");
+define("DONATE_BUTTON_IMAGE_ALT","Make payments with PayPal - it\'s fast, free and secure");
+
+
+#################    Ends - 15 June 2006    #################
+
+
+#################    Starts - 16 June 2006    #################
+
+
+define("LOGIN_ALT","login");
+define("LOGOFF_ALT","logoff");
+define("MYACCOUNT_ALT","MyAccount");
+define("SPECIALS_ALT","Specials");
+define("WHATS_NEW_ALT","What\'s New");
+define("CONTACT_US_ALT","Contact Us");
+define("IMAGE_ALT","image");
+define("BOX_ALT","box");
+
+#################    Ends - 16 June 2006    #################
+
+
+#################    Starts - 20 June 2006    #################
+
+//dayNames in calender
+define("S","S");
+define("M","M");
+define("T","T");
+define("W","W");
+define("T","T");
+define("F","F");
+define("S","S");
+
+//monthNames  in calender
+define("JANUARY","JANUARY");
+define("FEBRUARY","FEBRUARY");
+define("MARCH","MARCH");
+define("APRIL","APRIL");
+define("MAY","MAY");
+define("JUNE","JUNE");
+define("JULY","JULY");
+define("AUGUST","AUGUST");
+define("SEPTEMBER","SEPTEMBER");
+define("OCTOBER","OCTOBER");
+define("NOVEMBER","NOVEMBER");
+define("DECEMBER","DECEMBER");
+
+
+
+define("DELETE_CACHE_FILES",'cache files deleted - top level');
+define("UPDATE_CONFIGURATION_SETTING",'reset to false');
+define("UPDATE_CONFIG_FILES_EXIST",'configuration cache files updated');
+define("UPDATE_CONFIG_FILES_NOTEXIST",'ERROR: update file does not exist');
+define("IS_GUEST_CHECK",'customer_id not set');
+define("FILE_EXISTS_AND_IS_NOT_EXPIRED",'file exists and is not expired');
+define("NO_FILE_OR_EXPIRED",'file does not exist or is expired');
+define("OB_STARTED",'ob started @ ');
+define("IS_GUESS_CHECK_END",'customer_id not set ');
+define("OB_COMPRESSED",'output buffer flushed and compressed');
+define("CACHE_OUTPUTT",'compressed ob sent to screen');
+define("CACHE_WRITE_FILE",'compressed ob written to file');
+define("UNSET_CACHE_COMPRESS", 'cache compress unset');
+define("COMPRESS_BUFFER", 'compressing buffer');
+define("CACHE_FILE_WRITE", 'buffer writtent to file');
+define("CACHE_UNSET_WRITE_BUFFER", 'write buffer unset');
+define("OUTPUT_2_SCREEN", 'successfully output to screen');
+define("CACHE_UNSET_SCREEN_BUFFER", 'screen buffer unset');
+
+define("OPEN_SESSION_FILE_ERROR", 'Could not open session file');
+define("WRITE_SESSION_FILE_ERROR", 'Could not write session file');
+define("SESSION_MODULE_ERROR", 'Failed to initialize session module.');
+define("SESSION_NOT_SAVED", 'Session could not be saved.');
+define("SESSION_NOT_CLOSED", 'Session could not be closed.');
+define("SESSION_NOT_STARTED", 'Session could not be started.');
+
+///
+define("NO_BANNER_WITH_GROUP_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_GROUP_ERROR2", 'No banners with group');
+define("NO_BANNER_WITH_GROUP_ERROR3", ' found!</b>');
+define("NO_BANNER_WITH_ID_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_ID_ERROR2", 'Banner with ID');
+define("NO_BANNER_WITH_ID_ERROR3", ' not found, or status inactive</b>');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR1", '<b>TEP ERROR!');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR2", 'Unknown');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR3", 'parameter value - it must be either');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR4", 'dynamic');
+define("NO_BANNER_WITH_UNKNOWN_PARAM_ERROR5", 'static');
+define("TEP_DB_ERRORR", '[TEP STOP]');
+define("TEP_HREF_LINK_ERROR1", '<b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
+define("TEP_HREF_LINK_ERROR2", '<b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
+
+///
+
+#################    Ends - 20 June 2006    #################
+
+
+#################    Starts - 21 June 2006    #################
+
+
+
+define("CVV_HELP_TITLE","Card Verification Value (ccv/cvc/ccv2/cid) Help");
+define("CVV_HELP_DESC1","<p><strong>What is a Card Verification Value (ccv/cvc/ccv2/cid)?</strong>
+      </p>
+      <p>The Card Verification Value (ccv/cvc/ccv2/cid) is a 3-digit number found on the signature
+        panel on the back of your credit card. It is an additional safeguard that
+        helps us validate your purchase and protect against fraud. It is not contained
+        in the magnetic stripe information and is therefore not printed on sales
+        receipts.</p>
+      <p><strong>Where is the ccv/cvc/ccv2/cid located?</strong></p>");
+
+
+define("CVV_HELP_DESC2","<p><strong>VISA, MASTERCARD,  DISCOVERY &amp; most other cards</strong><br>
+        You can find your card verification code on the reverse side of your credit
+        card, printed into the signature field. It is a 3-digit group for MasterCard,
+        Visa, Discovery, and most other cards.<br>
+      </p> ");
+
+
+define("CVV_HELP_DESC3","<p><strong>AMERICAN EXPRESS</strong><br>
+        The American Express Card verification code is a 4-digit number printed
+        on the front of your card. It appears after and to the right (above) of
+        your card number.<br>
+      </p>");
+
+
+#################    Start - 23 June 2006   #################
+
+define("INFO_CC_1","Make Shopping Easier for Customers with Website Payments");
+define("INFO_CC_2",''.tep_image(DIR_WS_MODULES . 'payment/paypal/images/hdr_ppGlobev4_160x76.gif',' PayPal ','','','align=right valign="top" style="margin: 10px;"').'
+PayPal has optimized their checkout experience by launching an exciting new improvement to their payment flow.
+<br/><br/>For new buyers, signing up for a PayPal account is now optional. This means you can complete your payment first, and then decide whether to save your information for future purchases.
+<p>To pay by credit card, look for this button:<br/>
+<p align="center">'.tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-ContinueCheckout.gif','','','').'</p>
+<br/>
+Or you may see this:<br/>
+<p align="center">'.tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-no-account-Click-Here.gif','','','').'</p>
+<br/>
+One of these options should appear on the first PayPal screen.<br/>
+<p>Note: if you are a PayPal member, you can either use your account,
+or use a credit card that is not associated with a PayPal account.
+In that case you\'d also need to use an email address that\'s not associated with a PayPal account.</p> ');
+
+
+define("PAYPAL_SHOPPING_CART_IPN_SUBJECT","PayPal_Shopping_Cart_IPN");
+define("PAYPAL_SHOPPING_CART_IPN_FROM","PayPal_Shopping_Cart_IPN");
+
+#################    End - 23 June 2006   #################
+
+
+#################    Start - 28 June 2006   #################
+
+define("BOX_HEADING_CUSTOMER_WISHLIST_VIEW","My Wishlist View");
+define("BOX_HEADING_CUSTOMER_WISHLIST_HELP","My Wishlist Help");
+
+#################    End - 28 June 2006   #################
+
+
+#################    Start - 29 June 2006   #################
+
+
+define("VIEWPRICE_ERROR",'You must be logged in to search for prices.');
+
+define("UNABLE_TO_CONNECT_TO_DATABASE_SERVER",'Unable to connect to database server!');
+define("AFFILIATE_SHOW_BANNER_CHECK_PATHES",'Check the pathes! (catalog/includes/configure.php)');
+define("AFFILIATE_SHOW_BANNER_ABSOLUTE_PATH",'absolute path to picture:');
+define("AFFILIATE_SHOW_BANNER_BUILD_WITH_1",'build with:');
+define("AFFILIATE_SHOW_BANNER_BUILD_WITH_2",'DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG . DIR_WS_IMAGES . $banner');
+define("AFFILIATE_SHOW_BANNER_DIR_FS_DOCUMENT_ROOT",'DIR_FS_DOCUMENT_ROOT');
+define("AFFILIATE_SHOW_BANNER_DIR_WS_CATALOG",'DIR_WS_CATALOG');
+define("AFFILIATE_SHOW_BANNER_DIR_WS_IMAGES",'DIR_WS_IMAGES');
+define("AFFILIATE_SHOW_BANNER_BANNER",'$banner');
+define("AFFILIATE_SHOW_BANNER_SQL_QUERY_USED",'SQL-Query used:');
+define("AFFILIATE_SHOW_BANNER_TRY_TO_FIND_ERROR",'Try to find error:');
+define("AFFILIATE_SHOW_BANNER_SQL_QUERY",'SQL-Query:');
+define("AFFILIATE_SHOW_BANNER_LOCATING_PIC",'Locating Pic');
+
+
+#################    End - 29 June 2006   #################
+
+#################    End - 01 July 2006   #################
+
+define("PAYPAL_NOTIFY_IPN_TEST_1","TEST IPN Processed for order #");
+define("PAYPAL_NOTIFY_IPN_TEST_2","You need to specify an order #");
+define("PAYPAL_NOTIFY_RECEIVED_ERROR_1","Error: no valid ");
+define("PAYPAL_NOTIFY_RECEIVED_ERROR_2"," received.");
+
+define('TEXT_CLOSE_WINDOW', 'Close Window');
+
+
+#################    End - 01 July 2006   #################
+
+define("TEXT_NO_SPECIALS","There are currently no specials defined.");
+?>

Added: trunk/direct.openmoko.com/includes/languages/tell_a_friend_article.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages/tell_a_friend_article.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages/tell_a_friend_article.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.7 2003/06/10 18:20:39 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+define('NAVBAR_TITLE', 'Tell A Friend');
+
+define('HEADING_TITLE', 'Tell A Friend About \'%s\'');
+
+define('FORM_TITLE_CUSTOMER_DETAILS', 'Your Details');
+define('FORM_TITLE_FRIEND_DETAILS', 'Your Friends Details');
+define('FORM_TITLE_FRIEND_MESSAGE', 'Your Message');
+
+define('FORM_FIELD_CUSTOMER_NAME', 'Your Name:');
+define('FORM_FIELD_CUSTOMER_EMAIL', 'Your E-Mail Address:');
+define('FORM_FIELD_FRIEND_NAME', 'Your Friends Name:');
+define('FORM_FIELD_FRIEND_EMAIL', 'Your Friends E-Mail Address:');
+
+define('TEXT_EMAIL_SUCCESSFUL_SENT', 'Your email about <b>%s</b> has been successfully sent to <b>%s</b>.');
+
+define('TEXT_EMAIL_SUBJECT', 'Your friend %s has recommended this great product from %s');
+define('TEXT_EMAIL_INTRO', 'Hi %s!' . "\n\n" . 'Your friend, %s, thought that you would be interested in %s from %s.');
+define('TEXT_EMAIL_LINK', 'To view the product click on the link below or copy and paste the link into your web browser:' . "\n\n" . '%s');
+define('TEXT_EMAIL_LINK_ARTICLE', 'To view the article click on the link below or copy and paste the link into your web browser:' . "\n\n" . '%s');
+define('TEXT_EMAIL_SIGNATURE', 'Regards,' . "\n\n" . '%s');
+
+define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
+define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
+define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
+define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+?>

Added: trunk/direct.openmoko.com/includes/languages_in_header.php
===================================================================
--- trunk/direct.openmoko.com/includes/languages_in_header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/languages_in_header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  language_header.php
+
+  Shoppe Enhancement Controller - Copyright (c) 2003 WebMakers.com
+  Linda McGrath - osCommerce at WebMakers.com
+
+*/
+?>
+<!-- languages_header //-->
+        <table>
+          <tr>
+            <td>
+<?php
+  if (!is_object($lng)) {
+    include(DIR_WS_CLASSES . 'language.php');
+    $lng = new language;
+  }
+
+  if (getenv('HTTPS') == 'on') $connection = 'SSL';
+  else $connection = 'NONSSL';
+
+  $languages_string = '';
+  reset($lng->catalog_languages);
+  while (list($key, $value) = each($lng->catalog_languages)) {
+    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $connection) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
+  }
+
+echo $languages_string;
+?>
+            </td>
+          </tr>
+        </table>
+<!-- languages_header_eof //-->

Added: trunk/direct.openmoko.com/includes/local/README
===================================================================
--- trunk/direct.openmoko.com/includes/local/README	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/local/README	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,6 @@
+This directory contains local configuration information.
+
+It also must contain a file named configure.php that can be used to override
+the defaults set in application_top.php
+
+Remember to execute PHP commands the file needs to start with <?php and end with ?>

Added: trunk/direct.openmoko.com/includes/login_acc.php
===================================================================
--- trunk/direct.openmoko.com/includes/login_acc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/login_acc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,163 @@
+<td>
+
+<?php
+//BOF: MaxiDVD Returning Customer Info SECTION
+//===========================================================
+$returning_customer_title = HEADING_RETURNING_CUSTOMER; // DDB - 040620 - PWA - change TEXT by HEADING
+if ($setme != '')
+{
+$returning_customer_info = "
+<!--Confirm Block-->
+<td width=\"50%\" height=\"100%\" valign=\"top\"><table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"1\" cellpadding=\"2\" class=\"infoBox\">
+<tr class=\"infoBoxContents\">
+<td>
+<table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\" colspan=\"2\">".TEXT_YOU_HAVE_TO_VALIDATE."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\"><b>". ENTRY_EMAIL_ADDRESS."</b></td>
+   <td class=\"main\">". tep_draw_input_field('email_address')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\"><b>". ENTRY_VALIDATION_CODE."</b></td>
+   <td class=\"main\">".tep_draw_input_field('pass').tep_draw_input_field('password',$HTTP_POST_VARS['password'],'','hidden')."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"smallText\" colspan=\"2\">". '<a href="' . tep_href_link('validate_new.php', '', 'SSL') . '">' . TEXT_NEW_VALIDATION_CODE . '</a>'."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">". tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
+     <tr>
+       <td width=\"10\">". tep_draw_separator('pixel_trans.gif', '10', '1')."</td>
+       <td align=\"right\">".tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE)."</td>
+       <td width=\"10\">".tep_draw_separator('pixel_trans.gif', '10', '1')."</td>
+     </tr>
+</table>
+        </table></td>
+      </tr>
+    </table></form></td>
+
+<!--Confirm Block END-->
+";  
+
+}else 
+{
+$returning_customer_info = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  <tr>
+    <td class=\"main\"> 
+<table width=\"70%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">
+  <tr>
+    <td class=\"main\">" . ENTRY_EMAIL_ADDRESS . "</td>
+    <td>" . tep_draw_input_field('email_address') . "</td>
+  </tr>
+  <tr>
+    <td class=\"main\">" . ENTRY_PASSWORD . "<br><br></td>
+  <td>" . tep_draw_password_field('password') . "<br><br></td>
+  </tr>
+</table>
+<table width=\"30%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"right\">
+  <tr>
+  <td align=\"center\" class=\"smalltext\">" . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "<br><br>" . '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>' . "<br><br></td>
+  </tr>
+</table>
+</td>
+  </tr>
+</table>
+
+";
+}
+//===========================================================
+?>
+<!-- login_acc -->
+<table width="100%" cellpadding="5" cellspacing="0" border="0">
+    <tr>
+     <td class="main" width=100% valign="top" align="center">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $returning_customer_title );
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $returning_customer_info);
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+  </td>
+ </tr>
+</table>
+<?php
+//EOF: MaxiDVD Returning Customer Info SECTION
+//===========================================================
+
+
+
+
+
+//MaxiDVD New Account Sign Up SECTION
+//===========================================================
+$create_account_title = HEADING_NEW_CUSTOMER;
+$create_account_info = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\"  width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . TEXT_NEW_CUSTOMER_INTRODUCTION . "</td>
+  </tr>
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  <tr>
+    <td width=\"33%\" class=\"main\"></td>
+    <td width=\"33%\"></td>
+    <td width=\"34%\" rowspan=\"3\" align=\"center\">" . '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a>' . "<br><br></td>
+  </tr>
+</table>";
+//===========================================================
+?>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?>
+<table width="100%" cellpadding="5" cellspacing="0" border="0">
+    <tr>
+     <td class="main" width=100% valign="top" align="center">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $create_account_title );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $create_account_info);
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+  </td>
+  </tr>
+</table>
+<?php
+//EOF: MaxiDVD New Account Sign Up SECTION
+//===========================================================
+?>
+</td>

Added: trunk/direct.openmoko.com/includes/login_pwa.php
===================================================================
--- trunk/direct.openmoko.com/includes/login_pwa.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/login_pwa.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,211 @@
+<?php
+//BOF: MaxiDVD Returning Customer Info SECTION
+//===========================================================
+$returning_customer_title = HEADING_RETURNING_CUSTOMER; // DDB - 040620 - PWA - change TEXT by HEADING
+if ($setme != '')
+{
+$returning_customer_info = "
+<!--Confirm Block-->
+<td width=\"50%\" height=\"100%\" valign=\"top\"><table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"1\" cellpadding=\"2\" class=\"infoBox\">
+<tr class=\"infoBoxContents\">
+<td>
+<table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\" colspan=\"2\">".TEXT_YOU_HAVE_TO_VALIDATE."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\"><b>". ENTRY_EMAIL_ADDRESS."</b></td>
+   <td class=\"main\">". tep_draw_input_field('email_address')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\"><b>". ENTRY_VALIDATION_CODE."</b></td>
+   <td class=\"main\">".tep_draw_input_field('pass').tep_draw_input_field('password',$HTTP_POST_VARS['password'],'','hidden')."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"smallText\" colspan=\"2\">". '<a href="' . tep_href_link('validate_new.php', '', 'SSL') . '">' . TEXT_NEW_VALIDATION_CODE . '</a>'."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">". tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
+     <tr>
+       <td width=\"10\">". tep_draw_separator('pixel_trans.gif', '10', '1')."</td>
+       <td align=\"right\">".tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE)."</td>
+       <td width=\"10\">".tep_draw_separator('pixel_trans.gif', '10', '1')."</td>
+     </tr>
+</table>
+        </table></td>
+      </tr>
+    </table></form></td>
+
+<!--Confirm Block END-->
+";  
+
+}else 
+{
+$returning_customer_info = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . TEXT_RETURNING_CUSTOMER . "</td>
+  </tr>
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  <tr>
+    <td class=\"main\">
+
+<table width=\"70%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">
+  <tr>
+    <td class=\"main\">" . ENTRY_EMAIL_ADDRESS . "</td>
+    <td>" . tep_draw_input_field('email_address') . "</td>
+  </tr>
+  <tr>
+    <td class=\"main\">" . ENTRY_PASSWORD . "<br><br></td>
+        <td>" . tep_draw_password_field('password') . "<br><br></td>
+  </tr>
+</table>
+<table width=\"30%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"right\">
+  <tr>
+        <td align=\"center\" class=\"smalltext\">" . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "<br><br>" . '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>' . "<br><br></td>
+  </tr>
+</table>
+</td>
+  </tr>
+</table>
+";
+}
+//===========================================================
+?>
+<!-- login_pwa -->
+
+    <tr>
+     <td class="main" width=100% valign="top" align="center">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $returning_customer_title );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $returning_customer_info);
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+  </td>
+ </tr>
+
+<?php
+//EOF: MaxiDVD Returning Customer Info SECTION
+//===========================================================
+
+
+
+
+
+//MaxiDVD New Account Sign Up SECTION
+//===========================================================
+$create_account_title = HEADING_NEW_CUSTOMER;
+$create_account_info = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . TEXT_NEW_CUSTOMER . '<br><br>' . TEXT_NEW_CUSTOMER_INTRODUCTION . "</td>
+  </tr>
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  <tr>
+    <td width=\"33%\" class=\"main\"></td>
+    <td width=\"33%\"></td>
+    <td width=\"34%\" rowspan=\"3\" align=\"center\">" . '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a>' . "<br><br></td>
+  </tr>
+</table>";
+//===========================================================
+?>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?>
+    <tr>
+     <td class="main" width=100% valign="top" align="center">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $create_account_title );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $create_account_info);
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+  </td>
+  </tr>
+
+<?php
+//EOF: MaxiDVD New Account Sign Up SECTION
+//===========================================================
+
+
+
+
+
+//BOF: MaxiDVD Purchase With-Out An Account SECTION
+//===========================================================
+$pwa_checkout_title = HEADING_CHECKOUT;
+$pwa_checkout_info = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . TEXT_CHECKOUT_INTRODUCTION . "</td>
+  </tr>
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  <tr>
+    <td width=\"33%\" class=\"main\"></td>
+    <td width=\"33%\"></td>
+    <td width=\"34%\" rowspan=\"3\" align=\"center\">" . '<a href="' . tep_href_link(FILENAME_CHECKOUT, '', 'SSL') . '">' . tep_template_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>' . "<br><br></td>
+  </tr>
+</table>";
+//===========================================================
+?>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?>
+
+    <tr>
+     <td class="main" width=100% valign="top" align="center">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $pwa_checkout_title );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $pwa_checkout_info);
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+  </td>
+  </tr>
+
+  <?php
+//EOF: MaxiDVD Purchase With-Out An Account SECTION
+//===========================================================
+?>

Added: trunk/direct.openmoko.com/includes/login_pwa_optimal.php
===================================================================
--- trunk/direct.openmoko.com/includes/login_pwa_optimal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/login_pwa_optimal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,120 @@
+              <tr>
+               <!-- login_pwa_optimal -->
+              <td class="main" width="33%" valign="top" align="center">&nbsp;</TD>
+
+              <td class="main" width="33%" valign="top" align="center">&nbsp;</TD>
+
+              <td class="main" width="33%" valign="top" align="center">&nbsp;</td>
+                <td class="main" width="33%" valign="top">&nbsp;</td>
+              </tr>
+              <tr>
+                <td width="33%" height="100%" valign="top" align="center"> <table width="100%" height="100%" border="0" cellpadding="1" cellspacing="0" class="infoBox">
+                  <tr>
+
+                    <td valign="top">
+                      <table width="100%" height="250" border="0" cellpadding="2" cellspacing="0" class="infoBoxContents">
+                        <tr>
+                          <td height="20" align="center" valign="top"><b><?php echo HEADING_CHECKOUT; ?><br>
+                            </b></td>
+                        </tr>
+                        <tr>
+                          <td height="10" valign="top"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                        </tr>
+                        <tr>
+                          <td height="100" valign="top" class="main"><?php echo TEXT_CHECKOUT_INTRODUCTION; ?></td>
+                        </tr>
+                          <td height="20" align="center" valign="bottom" class="main"><br>
+                            <?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
+                        </tr>
+                        <tr>
+                          <td height="10" valign="top"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                        </tr>
+                      </table></td>
+                    </tr>
+                  </table>
+
+
+              </td>
+                <td width="33%" valign="top" align="center">
+
+                                <table width="100%" height="100%" border="0" cellpadding="1" cellspacing="0" class="infoBox">
+                  <tr>
+
+                    <td valign="top">
+                      <table width="100%" height="250" border="0" cellpadding="2" cellspacing="0" class="infoBoxContents">
+                        <tr>
+                          <td height="20" align="center" valign="top"><b><?php echo HEADING_NEW_CUSTOMER; ?><br>
+                            <br>
+                            </b></td>
+                        </tr>
+                        <tr>
+                          <td height="10" valign="top"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                        </tr>
+                          <td height="100" valign="top" class="main"> <?php echo TEXT_NEW_CUSTOMER_INTRODUCTION; ?></td>
+                        </tr>
+                        <tr>
+                          <td height="20" align="center" valign="bottom" class="main"><br>
+                            <br>
+                            <br>
+                            <?php echo '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a>'; ?></td>
+                        </tr>
+                        <tr>
+                          <td height="10" valign="top"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                        </tr>
+                      </table>
+
+                                                </td>
+                    </tr>
+                  </table>
+
+
+
+              </td>
+                <td width="33%" height="100%" valign="top" align="center"> <table width="100%" height="100%" border="0" cellpadding="1" cellspacing="0" class="infoBox">
+                  <tr>
+
+                    <td valign="top">
+<table width="100%" height="250" border="0" cellpadding="2" cellspacing="0" class="infoBoxContents">
+                        <!--<tr>
+                    <td class="main" colspan="2"><?php echo TEXT_RETURNING_CUSTOMER; ?></td>
+                  </tr>//-->
+                        <tr align="center">
+                          <td height="20" colspan="2"><b><?php echo HEADING_RETURNING_CUSTOMER; ?><br>
+                            <br>
+                            </b></td>
+                        </tr>
+                        <tr valign="top">
+                          <td height="10" colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                        </tr>
+                        <tr valign="top">
+                          <td height="50" class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
+                          <td height="50" class="main"><?php echo tep_draw_input_field('email_address'); ?></td>
+                        </tr>
+                        <tr valign="top">
+                          <td height="50" class="main"><b><?php echo ENTRY_PASSWORD; ?></b></td>
+                          <td height="50" class="main"><?php echo tep_draw_password_field('password'); ?></td>
+                        </tr>
+                        <tr valign="top">
+                          <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                        </tr>
+                        <tr valign="top">
+                          <td colspan="2" class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?></td>
+                        </tr>
+                        <tr valign="bottom">
+                          <td height="20" colspan="2" align="center" class="smallText"><br>
+                            <?php echo tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN); ?></td>
+                        </tr>
+                        <tr>
+                          <td height="10" colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                        </tr>
+                      </table></td>
+              </tr>
+            </table>
+
+              </td>
+          </tr>
+          <tr>
+              <td width="33%" align="center" valign="top">&nbsp;</TD>
+              <td width="33%" align="center" valign="top">&nbsp;</td>
+              <td width="33%" align="center" valign="top">&nbsp;</td>
+          </tr>

Added: trunk/direct.openmoko.com/includes/modules/Order_Info_Check.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/Order_Info_Check.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/Order_Info_Check.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,348 @@
+<?php
+/*
+  $Id: Order_Info_Check.php,v 0.52 2002/09/21 hpdl Exp $
+  by Cheng
+  
+        OSCommerce v2.2 CVS (09/17/02)
+  
+   Modified versions of create_account.php and related
+  files.  Allowing 'purchase without account'.        
+
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="main"><b><?php echo CATEGORY_PERSONAL; ?></b></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    $male = ($account['customers_gender'] == 'm') ? true : false;
+    $female = ($account['customers_gender'] == 'f') ? true : false;
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_GENDER; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo ($account['customers_gender'] == 'm') ? MALE : FEMALE;
+    } elseif ($error) {
+      if ($entry_gender_error) {
+        echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp' . FEMALE . '&nbsp;' . ENTRY_GENDER_ERROR;
+      } else {
+        echo ($gender == 'm') ? MALE : FEMALE;
+        echo tep_draw_hidden_field('gender');
+      }
+    } else {
+      echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_firstname'];
+  } elseif ($error) {
+    if ($entry_firstname_error) {
+      echo tep_draw_input_field('firstname') . '&nbsp;' . ENTRY_FIRST_NAME_ERROR;
+    } else {
+      echo $firstname . tep_draw_hidden_field('firstname');
+    }
+  } else {
+    echo tep_draw_input_field('firstname', $account['customers_firstname']) . '&nbsp;' . ENTRY_FIRST_NAME_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_lastname'];
+  } elseif ($error) {
+    if ($entry_lastname_error) {
+      echo tep_draw_input_field('lastname') . '&nbsp;' . ENTRY_LAST_NAME_ERROR;
+    } else {
+      echo $lastname . tep_draw_hidden_field('lastname');
+    }
+  } else {
+    echo tep_draw_input_field('lastname', $account['customers_lastname']) . '&nbsp;' . ENTRY_LAST_NAME_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_DOB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo tep_date_short($account['customers_dob']);
+    } elseif ($error) {
+      if ($entry_date_of_birth_error) {
+        echo tep_draw_input_field('dob') . '&nbsp;' . ENTRY_DATE_OF_BIRTH_ERROR;
+      } else {
+        echo $dob . tep_draw_hidden_field('dob');
+      }
+    } else {
+      echo tep_draw_input_field('dob', tep_date_short($account['customers_dob'])) . '&nbsp;' . ENTRY_DATE_OF_BIRTH_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_email_address'];
+  } elseif ($error) {
+    if ($entry_email_address_error) {
+      echo tep_draw_input_field('email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR;
+    } elseif ($entry_email_address_check_error) {
+      echo tep_draw_input_field('email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
+    } elseif ($entry_email_address_exists) {
+      echo tep_draw_input_field('email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
+    } else {
+      echo $email_address . tep_draw_hidden_field('email_address');
+    }
+  } else {
+    echo tep_draw_input_field('email_address', $account['customers_email_address']) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_TEXT;
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>  
+  <tr>
+    <td class="main"><b><?php echo CATEGORY_COMPANY; ?></b></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_COMPANY; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo $account['entry_company'];
+    } elseif ($error) {
+      if ($entry_company_error) {
+        echo tep_draw_input_field('company') . '&nbsp;' . ENTRY_COMPANY_ERROR;
+      } else {
+        echo $company . tep_draw_hidden_field('company');
+      }
+    } else {
+      echo tep_draw_input_field('company', $account['entry_company']) . '&nbsp;' . ENTRY_COMPANY_TEXT;
+    }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  }
+?>
+  <tr>
+    <td class="main"><b><?php echo CATEGORY_ADDRESS; ?></b></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['entry_street_address'];
+  } elseif ($error) {
+    if ($entry_street_address_error) {
+      echo tep_draw_input_field('street_address') . '&nbsp;' . ENTRY_STREET_ADDRESS_ERROR;
+    } else {
+      echo $street_address . tep_draw_hidden_field('street_address');
+    }
+  } else {
+    echo tep_draw_input_field('street_address', $account['entry_street_address']) . '&nbsp;' . ENTRY_STREET_ADDRESS_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_SUBURB; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only) {
+      echo $account['entry_suburb'];
+    } elseif ($error) {
+      if ($entry_suburb_error) {
+        echo tep_draw_input_field('suburb') . '&nbsp;' . ENTRY_SUBURB_ERROR;
+      } else {
+        echo $suburb . tep_draw_hidden_field('suburb');
+      }
+    } else {
+      echo tep_draw_input_field('suburb', $account['entry_suburb']) . '&nbsp;' . ENTRY_SUBURB_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_CITY; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['entry_city'];
+  } elseif ($error) {
+    if ($entry_city_error) {
+      echo tep_draw_input_field('city') . '&nbsp;' . ENTRY_CITY_ERROR;
+    } else {
+      echo $city . tep_draw_hidden_field('city');
+    }
+  } else {
+    echo tep_draw_input_field('city', $account['entry_city']) . '&nbsp;' . ENTRY_CITY_TEXT;
+  }
+?></td>
+          </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STATE; ?></td>
+            <td class="main">&nbsp;
+<?php
+    $state = tep_get_zone_name($country, $zone_id, $state);
+    if ($is_read_only) {
+      echo tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state']);
+    } elseif ($error) {
+      if ($entry_state_error) {
+        if ($entry_state_has_zones) {
+          $zones_array = array();
+          $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' order by zone_name");
+          while ($zones_values = tep_db_fetch_array($zones_query)) {
+            $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+          }
+          echo tep_draw_pull_down_menu('state', $zones_array) . '&nbsp;' . ENTRY_STATE_ERROR;
+        } else {
+          echo tep_draw_input_field('state') . '&nbsp;' . ENTRY_STATE_ERROR;
+        }
+      } else {
+        echo $state . tep_draw_hidden_field('zone_id') . tep_draw_hidden_field('state');
+      }
+    } else {
+      echo tep_draw_input_field('state', tep_get_zone_name($account['entry_country_id'], $account['entry_zone_id'], $account['entry_state'])) . '&nbsp;' . ENTRY_STATE_TEXT;
+    }
+?></td>
+          </tr>
+<?php
+  }
+?>      
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['entry_postcode'];
+  } elseif ($error) {
+    if ($entry_post_code_error) {
+      echo tep_draw_input_field('postcode') . '&nbsp;' . ENTRY_POST_CODE_ERROR;
+    } else {
+      echo $postcode . tep_draw_hidden_field('postcode');
+    }
+  } else {
+    echo tep_draw_input_field('postcode', $account['entry_postcode']) . '&nbsp;' . ENTRY_POST_CODE_TEXT;
+  }
+?></td>
+          </tr>
+
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_COUNTRY; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo tep_get_country_name($account['entry_country_id']);
+  } elseif ($error) {
+    if ($entry_country_error) {
+      echo tep_get_country_list('country') . '&nbsp;' . ENTRY_COUNTRY_ERROR;
+    } else {
+      echo tep_get_country_name($country) . tep_draw_hidden_field('country');
+    }
+  } else {
+    echo tep_get_country_list('country', $account['entry_country_id']) . '&nbsp;' . ENTRY_COUNTRY_TEXT;
+  }
+?></td>
+          </tr>
+
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="main"><b><?php echo CATEGORY_CONTACT; ?></b></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_telephone'];
+  } elseif ($error) {
+    if ($entry_telephone_error) {
+      echo tep_draw_input_field('telephone') . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_ERROR;
+    } else {
+      echo $telephone . tep_draw_hidden_field('telephone');
+    }
+  } else {
+    echo tep_draw_input_field('telephone', $account['customers_telephone']) . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_TEXT;
+  }
+?></td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FAX_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only) {
+    echo $account['customers_fax'];
+  } elseif ($processed) {
+    echo $fax . tep_draw_hidden_field('fax');
+  } else {
+    echo tep_draw_input_field('fax', $account['customers_fax']) . '&nbsp;' . ENTRY_FAX_NUMBER_TEXT;
+  }
+?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/includes/modules/additional_images.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/additional_images.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/additional_images.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,191 @@
+<!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //-->
+    <tr>
+      <td><table width="100%">
+       <tr>
+
+<?php
+    if (($product_info['products_image_sm_1'] != '') && ($product_info['products_image_xl_1'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_1'] != '') && ($product_info['products_image_sm_1'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=1') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_1']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_1'] == '') && ($product_info['products_image_xl_1'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_1'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+<?php
+    if (($product_info['products_image_sm_2'] != '') && ($product_info['products_image_xl_2'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_2'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_2'] != '') && ($product_info['products_image_sm_2'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=2') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_2'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_2']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_2'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_2'] == '') && ($product_info['products_image_xl_2'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_2'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+<?php
+    if (($product_info['products_image_sm_3'] != '') && ($product_info['products_image_xl_3'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_3'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_3'] != '') && ($product_info['products_image_sm_3'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=3') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_3'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_3']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_3'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_3'] == '') && ($product_info['products_image_xl_3'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_3'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+
+</tr>
+<tr>
+
+
+<?php
+    if (($product_info['products_image_sm_4'] != '') && ($product_info['products_image_xl_4'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_4'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_4'] != '') && ($product_info['products_image_sm_4'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=4') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_4'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_4']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_4'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_4'] == '') && ($product_info['products_image_xl_4'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_4'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+
+<?php
+    if (($product_info['products_image_sm_5'] != '') && ($product_info['products_image_xl_5'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_5'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_5'] != '') && ($product_info['products_image_sm_5'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=5') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_5'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_5']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_5'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_5'] == '') && ($product_info['products_image_xl_5'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_5'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+
+<?php
+    if (($product_info['products_image_sm_6'] != '') && ($product_info['products_image_xl_6'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_6'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_6'] != '') && ($product_info['products_image_sm_6'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=6') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_6'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_6']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_6'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_6'] == '') && ($product_info['products_image_xl_6'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_6'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+
+     </tr>
+        </table></td>
+     </tr>
+<!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //-->

Added: trunk/direct.openmoko.com/includes/modules/address_book_details.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/address_book_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/address_book_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,140 @@
+<?php
+/*
+  $Id: address_book_details.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (!isset($process)) $process = false;
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="main"><b><?php echo NEW_ADDRESS_TITLE; ?></b></td>
+        <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+      <tr class="infoBoxContents">
+        <td><table border="0" cellspacing="2" cellpadding="2">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    if (isset($gender)) {
+      $male = ($gender == 'm') ? true : false;
+    } else {
+      $male = ($entry['entry_gender'] == 'm') ? true : false;
+    }
+    $female = !$male;
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_GENDER; ?></td>
+            <td class="main"><?php echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('firstname', $entry['entry_firstname']) . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('lastname', $entry['entry_lastname']) . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_COMPANY; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('company', $entry['entry_company']) . '&nbsp;' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>
+          </tr>
+
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('street_address', $entry['entry_street_address']) . '&nbsp;' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_SUBURB; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('suburb', $entry['entry_suburb']) . '&nbsp;' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('postcode', $entry['entry_postcode']) . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CITY; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('city', $entry['entry_city']) . '&nbsp;' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_STATE; ?></td>
+            <td class="main">
+<?php
+    if ($process == true) {
+      if ($entry_state_has_zones == true) {
+        $zones_array = array();
+        $zones_array[] = array('id' => '', 'text' => '');
+        $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
+        while ($zones_values = tep_db_fetch_array($zones_query)) {
+          $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+        }
+        echo tep_draw_pull_down_menu('state', $zones_array);
+      } else {
+        echo tep_draw_input_field('state');
+      }
+    } else {
+      echo tep_draw_input_field('state', tep_get_zone_name($entry['entry_country_id'], $entry['entry_zone_id'], $entry['entry_state']));
+    }
+
+    if (tep_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="inputRequirement">' . ENTRY_STATE_TEXT;
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
+            <td class="main"><?php echo tep_get_country_list('country', $entry['entry_country_id']) . '&nbsp;' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  if ((isset($HTTP_GET_VARS['edit']) && ($customer_default_address_id != $HTTP_GET_VARS['edit'])) || (isset($HTTP_GET_VARS['edit']) == false) ) {
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2" class="main"><?php echo tep_draw_checkbox_field('primary', 'on', false, 'id="primary"') . ' ' . SET_AS_PRIMARY; ?></td>
+          </tr>
+<?php
+  }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/includes/modules/affiliate_account_details.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/affiliate_account_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/affiliate_account_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,621 @@
+<?php
+/*
+  $Id: affiliate_account_details.php,v 2.0 2002/09/29 SDK
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (!isset($is_read_only)) $is_read_only = false;
+  if (!isset($processed)) $processed = false;
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    $male = ($affiliate['affiliate_gender'] == 'm') ? true : false;
+    $female = ($affiliate['affiliate_gender'] == 'f') ? true : false;
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_GENDER; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo ($affiliate['affiliate_gender'] == 'm') ? MALE : FEMALE;
+    } elseif ($error == true) {
+      if ($entry_gender_error == true) {
+        echo tep_draw_radio_field('a_gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('a_gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_ERROR;
+      } else {
+        echo ($a_gender == 'm') ? MALE : FEMALE;
+        echo tep_draw_hidden_field('a_gender');
+      }
+    } else {
+      echo tep_draw_radio_field('a_gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('a_gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_firstname'];
+  } elseif ($error == true) {
+    if ($entry_firstname_error == true) {
+      echo tep_draw_input_field('a_firstname') . '&nbsp;' . ENTRY_FIRST_NAME_ERROR;
+    } else {
+      echo $a_firstname . tep_draw_hidden_field('a_firstname');
+    }
+  } else {
+    echo tep_draw_input_field('a_firstname', $affiliate['affiliate_firstname']) . '&nbsp;' . ENTRY_FIRST_NAME_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_lastname'];
+  } elseif ($error == true) {
+    if ($entry_lastname_error == true) {
+      echo tep_draw_input_field('a_lastname') . '&nbsp;' . ENTRY_LAST_NAME_ERROR;
+    } else {
+      echo $a_lastname . tep_draw_hidden_field('a_lastname');
+    }
+  } else {
+    echo tep_draw_input_field('a_lastname', $affiliate['affiliate_lastname']) . '&nbsp;' . ENTRY_FIRST_NAME_TEXT;
+  }
+?>
+            </td>
+          </tr>
+<?php
+  if (ACCOUNT_DOB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo tep_date_short($affiliate['affiliate_dob']);
+    } elseif ($error == true) {
+      if ($entry_date_of_birth_error == true) {
+        echo tep_draw_input_field('a_dob') . '&nbsp;' . ENTRY_DATE_OF_BIRTH_ERROR;
+      } else {
+        echo $a_dob . tep_draw_hidden_field('a_dob');
+      }
+    } else {
+      echo tep_draw_input_field('a_dob', tep_date_short($affiliate['affiliate_dob'])) . '&nbsp;' . ENTRY_DATE_OF_BIRTH_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_email_address'];
+  } elseif ($error == true) {
+    if ($entry_email_address_error == true) {
+      echo tep_draw_input_field('a_email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR;
+    } elseif ($entry_email_address_check_error == true) {
+      echo tep_draw_input_field('a_email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
+    } elseif ($entry_email_address_exists == true) {
+      echo tep_draw_input_field('a_email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
+    } else {
+      echo $a_email_address . tep_draw_hidden_field('a_email_address');
+    }
+  } else {
+    echo tep_draw_input_field('a_email_address', $affiliate['affiliate_email_address']) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_TEXT;
+  }
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>  
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_COMPANY; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_COMPANY; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_company'];
+    } elseif ($error == true) {
+      if ($entry_company_error == true) {
+        echo tep_draw_input_field('a_company') . '&nbsp;' . ENTRY_AFFILIATE_COMPANY_ERROR;
+      } else {
+        echo $a_company . tep_draw_hidden_field('a_company');
+      }
+    } else {
+      echo tep_draw_input_field('a_company', $affiliate['affiliate_company']) . '&nbsp;' . ENTRY_AFFILIATE_COMPANY_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_COMPANY_TAXID; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_company_taxid'];
+    } elseif ($error == true) {
+      if ($entry_company_taxid_error == true) {
+        echo tep_draw_input_field('a_company_taxid') . '&nbsp;' . ENTRY_AFFILIATE_COMPANY_TAXID_ERROR;
+      } else {
+        echo $a_company_taxid . tep_draw_hidden_field('a_company_taxid');
+      }
+    } else {
+      echo tep_draw_input_field('a_company_taxid', $affiliate['affiliate_company_taxid']) . '&nbsp;' . ENTRY_AFFILIATE_COMPANY_TAXID_TEXT;
+    }
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  }
+?>  
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_PAYMENT_DETAILS; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (AFFILIATE_USE_CHECK == 'true') {
+?>  
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_CHECK; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_check'];
+    } elseif ($error == true) {
+      if ($entry_payment_check_error == true) {
+        echo tep_draw_input_field('a_payment_check') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_CHECK_ERROR;
+      } else {
+        echo $a_payment_check . tep_draw_hidden_field('a_payment_check');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_check', $affiliate['affiliate_payment_check']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_CHECK_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+  if (AFFILIATE_USE_PAYPAL == 'true') {
+?>  
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_PAYPAL; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_paypal'];
+    } elseif ($error == true) {
+      if ($entry_payment_paypal_error == true) {
+        echo tep_draw_input_field('a_payment_paypal') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_PAYPAL_ERROR;
+      } else {
+        echo $a_payment_paypal . tep_draw_hidden_field('a_payment_paypal');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_paypal', $affiliate['affiliate_payment_paypal']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_PAYPAL_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+  if (AFFILIATE_USE_BANK == 'true') {
+?>  
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_name'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_name_error == true) {
+        echo tep_draw_input_field('a_payment_bank_name') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_NAME_ERROR;
+      } else {
+        echo $a_payment_bank_name . tep_draw_hidden_field('a_payment_bank_name');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_name', $affiliate['affiliate_payment_bank_name']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_NAME_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_branch_number'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_branch_number_error == true) {
+        echo tep_draw_input_field('a_payment_bank_branch_number') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_ERROR;
+      } else {
+        echo $a_payment_bank_branch_number . tep_draw_hidden_field('a_payment_bank_branch_number');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_branch_number', $affiliate['affiliate_payment_bank_branch_number']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_swift_code'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_swift_code_error == true) {
+        echo tep_draw_input_field('a_payment_bank_swift_code') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_ERROR;
+      } else {
+        echo $a_payment_bank_swift_code . tep_draw_hidden_field('a_payment_bank_swift_code');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_swift_code', $affiliate['affiliate_payment_bank_swift_code']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_account_name'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_account_name_error == true) {
+        echo tep_draw_input_field('a_payment_bank_account_name') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_ERROR;
+      } else {
+        echo $a_payment_bank_account_name . tep_draw_hidden_field('a_payment_bank_account_name');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_account_name', $affiliate['affiliate_payment_bank_account_name']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_account_number'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_account_number_error == true) {
+        echo tep_draw_input_field('a_payment_bank_account_number') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_ERROR;
+      } else {
+        echo $a_payment_bank_account_number . tep_draw_hidden_field('a_payment_bank_account_number');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_account_number', $affiliate['affiliate_payment_bank_account_number']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?> 
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_ADDRESS; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_street_address'];
+  } elseif ($error == true) {
+    if ($entry_street_address_error == true) {
+      echo tep_draw_input_field('a_street_address') . '&nbsp;' . ENTRY_STREET_ADDRESS_ERROR;
+    } else {
+      echo $a_street_address . tep_draw_hidden_field('a_street_address');
+    }
+  } else {
+    echo tep_draw_input_field('a_street_address', $affiliate['affiliate_street_address']) . '&nbsp;' . ENTRY_STREET_ADDRESS_TEXT;
+  }
+?>
+            </td>
+          </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_SUBURB; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_suburb'];
+    } elseif ($error == true) {
+      if ($entry_suburb_error == true) {
+        echo tep_draw_input_field('a_suburb') . '&nbsp;' . ENTRY_SUBURB_ERROR;
+      } else {
+        echo $a_suburb . tep_draw_hidden_field('a_suburb');
+      }
+    } else {
+      echo tep_draw_input_field('a_suburb', $affiliate['affiliate_suburb']) . '&nbsp;' . ENTRY_SUBURB_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_postcode'];
+  } elseif ($error == true) {
+    if ($entry_post_code_error == true) {
+      echo tep_draw_input_field('a_postcode') . '&nbsp;' . ENTRY_POST_CODE_ERROR;
+    } else {
+      echo $a_postcode . tep_draw_hidden_field('a_postcode');
+    }
+  } else {
+    echo tep_draw_input_field('a_postcode', $affiliate['affiliate_postcode']) . '&nbsp;' . ENTRY_POST_CODE_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_CITY; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_city'];
+  } elseif ($error == true) {
+    if ($entry_city_error == true) {
+      echo tep_draw_input_field('a_city') . '&nbsp;' . ENTRY_CITY_ERROR;
+    } else {
+      echo $a_city . tep_draw_hidden_field('a_city');
+    }
+  } else {
+    echo tep_draw_input_field('a_city', $affiliate['affiliate_city']) . '&nbsp;' . ENTRY_CITY_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_COUNTRY; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo tep_get_country_name($affiliate['affiliate_country_id']);
+  } elseif ($error == true) {
+    if ($entry_country_error == true) {
+      echo tep_get_country_list('a_country') . '&nbsp;' . ENTRY_COUNTRY_ERROR;
+    } else {
+      echo tep_get_country_name($a_country) . tep_draw_hidden_field('a_country');
+    }
+  } else {
+    echo tep_get_country_list('a_country', $affiliate['affiliate_country_id']) . '&nbsp;' . ENTRY_COUNTRY_TEXT;
+  }
+?>
+            </td>
+          </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STATE; ?></td>
+            <td class="main">&nbsp;
+<?php
+    $state = tep_get_zone_name($a_country, $a_zone_id, $a_state);
+    if ($is_read_only == true) {
+      echo tep_get_zone_name($affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id'], $affiliate['affiliate_state']);
+    } elseif ($error == true) {
+      if ($entry_state_error == true) {
+        if ($entry_state_has_zones == true) {
+          $zones_array = array();
+          $zones_array[] = array('id' => '', 'text' => '');
+          $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($a_country) . "' order by zone_name");
+          while ($zones_values = tep_db_fetch_array($zones_query)) {
+            $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+          }
+          echo tep_draw_pull_down_menu('a_state', $zones_array) . '&nbsp;' . ENTRY_STATE_ERROR;
+        } else {
+          echo tep_draw_input_field('a_state') . '&nbsp;' . ENTRY_STATE_ERROR;
+        }
+      } else {
+        echo $state . tep_draw_hidden_field('a_zone_id') . tep_draw_hidden_field('a_state');
+      }
+    } else {
+      echo tep_draw_input_field('a_state', tep_get_zone_name($affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id'], $affiliate['affiliate_state'])) . '&nbsp;' . ENTRY_STATE_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_CONTACT; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_telephone'];
+  } elseif ($error == true) {
+    if ($entry_telephone_error == true) {
+      echo tep_draw_input_field('a_telephone') . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_ERROR;
+    } else {
+      echo $a_telephone . tep_draw_hidden_field('a_telephone');
+    }
+  } else {
+    echo tep_draw_input_field('a_telephone', $affiliate['affiliate_telephone']) . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FAX_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_fax'];
+  } elseif ($error == true) {
+    if ($entry_fax_error == true) {
+      echo tep_draw_input_field('a_fax') . '&nbsp;' . ENTRY_FAX_NUMBER_ERROR;
+    } else {
+      echo $a_fax . tep_draw_hidden_field('a_fax');
+    }
+  } else {
+    echo tep_draw_input_field('a_fax', $affiliate['affiliate_fax']) . '&nbsp;' . ENTRY_FAX_NUMBER_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_HOMEPAGE; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_homepage'];
+  } elseif ($error == true) {
+    if ($entry_homepage_error == true) {
+      echo tep_draw_input_field('a_homepage') . '&nbsp;' . ENTRY_AFFILIATE_HOMEPAGE_ERROR;
+    } else {
+      echo $a_homepage . tep_draw_hidden_field('a_homepage');
+    }
+  } else {
+    echo tep_draw_input_field('a_homepage', $affiliate['affiliate_homepage']) . '&nbsp;' . ENTRY_AFFILIATE_HOMEPAGE_TEXT;
+  }
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  if ($is_read_only == false) {
+?>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_PASSWORD; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_PASSWORD; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($error == true) {
+      if ($entry_password_error == true) {
+        echo tep_draw_password_field('a_password') . '&nbsp;' . ENTRY_PASSWORD_ERROR;
+      } else {
+        echo PASSWORD_HIDDEN . tep_draw_hidden_field('a_password') . tep_draw_hidden_field('a_confirmation');
+      }
+    } else {
+      echo tep_draw_password_field('a_password') . '&nbsp;' . ENTRY_PASSWORD_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+    if ( ($error == false) || ($entry_password_error == true) ) {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+            <td class="main">&nbsp;
+<?php
+      echo tep_draw_password_field('a_confirmation') . '&nbsp;' . ENTRY_PASSWORD_CONFIRMATION_TEXT;
+?>
+            </td>
+          </tr>
+<?php
+    }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;</td>
+            <td class="main">&nbsp;
+<?php 
+  echo tep_draw_checkbox_field('a_agb', $value = '1', $checked = $affiliate['affiliate_agb']) . ENTRY_AFFILIATE_ACCEPT_AGB;
+    if ($entry_agb_error == true) {
+      echo "<br>".ENTRY_AFFILIATE_AGB_ERROR;
+    }
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  }
+?>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/affiliate_news.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/affiliate_news.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/affiliate_news.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: affiliate_news.php,v 2.1 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- affiliate_news //-->
+<?php
+
+// npe catalog begin add multi lingual news #change
+//  $affiliate_news_query = tep_db_query('SELECT * from ' . TABLE_AFFILIATE_NEWS . ' WHERE status = 1 ORDER BY date_added DESC LIMIT ' . MAX_DISPLAY_AFFILIATE_NEWS);
+
+    $affiliate_news_query = tep_db_query('select affiliate_news_headlines as headline, affiliate_news_contents as content,date_added, news_status from ' . TABLE_AFFILIATE_NEWS . ', ' . TABLE_AFFILIATE_NEWS_CONTENTS . " where news_id = affiliate_news_id and affiliate_news_languages_id = '" . $languages_id . "' and news_status = 1 order by date_added desc");
+
+  if (!tep_db_num_rows($affiliate_news_query)) { // there is no news
+    echo '<!-- ' . TEXT_NO_AFFILIATE_NEWS . ' -->';
+  } else {
+
+    $info_box_contents = array();
+    $row = 0;
+    while ($affiliate_news = tep_db_fetch_array($affiliate_news_query)) {
+      $info_box_contents[$row] = array('align' => 'left',
+                                       'params' => 'class="smallText" valign="top"',
+                                       'text' => '<b>' . $affiliate_news['headline'] . '</b> - <i>' . tep_date_long($affiliate_news['date_added']) . '</i><br>' . nl2br($affiliate_news['content']) . '<br>');
+      $row++;
+    }
+    new contentBox($info_box_contents);
+  }
+?>
+<!-- affiliate_news_eof //-->

Added: trunk/direct.openmoko.com/includes/modules/affiliate_signup_details.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/affiliate_signup_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/affiliate_signup_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,652 @@
+<?php
+/*
+  $Id: affiliate_account_details.php,v 2.0 2002/09/29 SDK
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (!isset($is_read_only)) $is_read_only = false;
+  if (!isset($processed)) $processed = false;
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    $male = ($affiliate['affiliate_gender'] == 'm') ? true : false;
+    $female = ($affiliate['affiliate_gender'] == 'f') ? true : false;
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_GENDER; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo ($affiliate['affiliate_gender'] == 'm') ? MALE : FEMALE;
+    } elseif ($error == true) {
+      if ($entry_gender_error == true) {
+        echo tep_draw_radio_field('a_gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('a_gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_ERROR;
+      } else {
+        echo ($a_gender == 'm') ? MALE : FEMALE;
+        echo tep_draw_hidden_field('a_gender');
+      }
+    } else {
+      echo tep_draw_radio_field('a_gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('a_gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_firstname'];
+  } elseif ($error == true) {
+    if ($entry_firstname_error == true) {
+      echo tep_draw_input_field('a_firstname') . '&nbsp;' . ENTRY_FIRST_NAME_ERROR;
+    } else {
+      echo $a_firstname . tep_draw_hidden_field('a_firstname');
+    }
+  } else {
+    echo tep_draw_input_field('a_firstname', $affiliate['affiliate_firstname']) . '&nbsp;' . ENTRY_FIRST_NAME_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_lastname'];
+  } elseif ($error == true) {
+    if ($entry_lastname_error == true) {
+      echo tep_draw_input_field('a_lastname') . '&nbsp;' . ENTRY_LAST_NAME_ERROR;
+    } else {
+      echo $a_lastname . tep_draw_hidden_field('a_lastname');
+    }
+  } else {
+    echo tep_draw_input_field('a_lastname', $affiliate['affiliate_lastname']) . '&nbsp;' . ENTRY_FIRST_NAME_TEXT;
+  }
+?>
+            </td>
+          </tr>
+<?php
+  if (ACCOUNT_DOB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo tep_date_short($affiliate['affiliate_dob']);
+    } elseif ($error == true) {
+      if ($entry_date_of_birth_error == true) {
+        echo tep_draw_input_field('a_dob') . '&nbsp;' . ENTRY_DATE_OF_BIRTH_ERROR;
+      } else {
+        echo $a_dob . tep_draw_hidden_field('a_dob');
+      }
+    } else {
+      echo tep_draw_input_field('a_dob', tep_date_short($affiliate['affiliate_dob'])) . '&nbsp;' . ENTRY_DATE_OF_BIRTH_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_email_address'];
+  } elseif ($error == true) {
+    if ($entry_email_address_error == true) {
+      echo tep_draw_input_field('a_email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR;
+    } elseif ($entry_email_address_check_error == true) {
+      echo tep_draw_input_field('a_email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
+    } elseif ($entry_email_address_exists == true) {
+      echo tep_draw_input_field('a_email_address') . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
+    } else {
+      echo $a_email_address . tep_draw_hidden_field('a_email_address');
+    }
+  } else {
+    echo tep_draw_input_field('a_email_address', $affiliate['affiliate_email_address']) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_TEXT;
+  }
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>  
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_COMPANY; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_COMPANY; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_company'];
+    } elseif ($error == true) {
+      if ($entry_company_error == true) {
+        echo tep_draw_input_field('a_company') . '&nbsp;' . ENTRY_AFFILIATE_COMPANY_ERROR;
+      } else {
+        echo $a_company . tep_draw_hidden_field('a_company');
+      }
+    } else {
+      echo tep_draw_input_field('a_company', $affiliate['affiliate_company']) . '&nbsp;' . ENTRY_AFFILIATE_COMPANY_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_COMPANY_TAXID; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_company_taxid'];
+    } elseif ($error == true) {
+      if ($entry_company_taxid_error == true) {
+        echo tep_draw_input_field('a_company_taxid') . '&nbsp;' . ENTRY_AFFILIATE_COMPANY_TAXID_ERROR;
+      } else {
+        echo $a_company_taxid . tep_draw_hidden_field('a_company_taxid');
+      }
+    } else {
+      echo tep_draw_input_field('a_company_taxid', $affiliate['affiliate_company_taxid']) . '&nbsp;' . ENTRY_AFFILIATE_COMPANY_TAXID_TEXT;
+    }
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  }
+?>  
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_PAYMENT_DETAILS; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (AFFILIATE_USE_CHECK == 'true') {
+?>  
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_CHECK; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_check'];
+    } elseif ($error == true) {
+      if ($entry_payment_check_error == true) {
+        echo tep_draw_input_field('a_payment_check') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_CHECK_ERROR;
+      } else {
+        echo $a_payment_check . tep_draw_hidden_field('a_payment_check');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_check', $affiliate['affiliate_payment_check']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_CHECK_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+  if (AFFILIATE_USE_PAYPAL == 'true') {
+?>  
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_PAYPAL; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_paypal'];
+    } elseif ($error == true) {
+      if ($entry_payment_paypal_error == true) {
+        echo tep_draw_input_field('a_payment_paypal') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_PAYPAL_ERROR;
+      } else {
+        echo $a_payment_paypal . tep_draw_hidden_field('a_payment_paypal');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_paypal', $affiliate['affiliate_payment_paypal']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_PAYPAL_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+  if (AFFILIATE_USE_BANK == 'true') {
+?>  
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_name'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_name_error == true) {
+        echo tep_draw_input_field('a_payment_bank_name') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_NAME_ERROR;
+      } else {
+        echo $a_payment_bank_name . tep_draw_hidden_field('a_payment_bank_name');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_name', $affiliate['affiliate_payment_bank_name']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_NAME_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_branch_number'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_branch_number_error == true) {
+        echo tep_draw_input_field('a_payment_bank_branch_number') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_ERROR;
+      } else {
+        echo $a_payment_bank_branch_number . tep_draw_hidden_field('a_payment_bank_branch_number');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_branch_number', $affiliate['affiliate_payment_bank_branch_number']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_BRANCH_NUMBER_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_swift_code'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_swift_code_error == true) {
+        echo tep_draw_input_field('a_payment_bank_swift_code') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_ERROR;
+      } else {
+        echo $a_payment_bank_swift_code . tep_draw_hidden_field('a_payment_bank_swift_code');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_swift_code', $affiliate['affiliate_payment_bank_swift_code']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_SWIFT_CODE_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_account_name'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_account_name_error == true) {
+        echo tep_draw_input_field('a_payment_bank_account_name') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_ERROR;
+      } else {
+        echo $a_payment_bank_account_name . tep_draw_hidden_field('a_payment_bank_account_name');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_account_name', $affiliate['affiliate_payment_bank_account_name']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NAME_TEXT;
+    }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_payment_bank_account_number'];
+    } elseif ($error == true) {
+      if ($entry_payment_bank_account_number_error == true) {
+        echo tep_draw_input_field('a_payment_bank_account_number') . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_ERROR;
+      } else {
+        echo $a_payment_bank_account_number . tep_draw_hidden_field('a_payment_bank_account_number');
+      }
+    } else {
+      echo tep_draw_input_field('a_payment_bank_account_number', $affiliate['affiliate_payment_bank_account_number']) . '&nbsp;' . ENTRY_AFFILIATE_PAYMENT_BANK_ACCOUNT_NUMBER_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?> 
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_ADDRESS; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_street_address'];
+  } elseif ($error == true) {
+    if ($entry_street_address_error == true) {
+      echo tep_draw_input_field('a_street_address') . '&nbsp;' . ENTRY_STREET_ADDRESS_ERROR;
+    } else {
+      echo $a_street_address . tep_draw_hidden_field('a_street_address');
+    }
+  } else {
+    echo tep_draw_input_field('a_street_address', $affiliate['affiliate_street_address']) . '&nbsp;' . ENTRY_STREET_ADDRESS_TEXT;
+  }
+?>
+            </td>
+          </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_SUBURB; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($is_read_only == true) {
+      echo $affiliate['affiliate_suburb'];
+    } elseif ($error == true) {
+      if ($entry_suburb_error == true) {
+        echo tep_draw_input_field('a_suburb') . '&nbsp;' . ENTRY_SUBURB_ERROR;
+      } else {
+        echo $a_suburb . tep_draw_hidden_field('a_suburb');
+      }
+    } else {
+      echo tep_draw_input_field('a_suburb', $affiliate['affiliate_suburb']) . '&nbsp;' . ENTRY_SUBURB_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_postcode'];
+  } elseif ($error == true) {
+    if ($entry_post_code_error == true) {
+      echo tep_draw_input_field('a_postcode') . '&nbsp;' . ENTRY_POST_CODE_ERROR;
+    } else {
+      echo $a_postcode . tep_draw_hidden_field('a_postcode');
+    }
+  } else {
+    echo tep_draw_input_field('a_postcode', $affiliate['affiliate_postcode']) . '&nbsp;' . ENTRY_POST_CODE_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_CITY; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_city'];
+  } elseif ($error == true) {
+    if ($entry_city_error == true) {
+      echo tep_draw_input_field('a_city') . '&nbsp;' . ENTRY_CITY_ERROR;
+    } else {
+      echo $a_city . tep_draw_hidden_field('a_city');
+    }
+  } else {
+    echo tep_draw_input_field('a_city', $affiliate['affiliate_city']) . '&nbsp;' . ENTRY_CITY_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_COUNTRY; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo tep_get_country_name($affiliate['affiliate_country_id']);
+  } elseif ($error == true) {
+    if ($entry_country_error == true) {
+      echo tep_get_country_list('a_country') . '&nbsp;' . ENTRY_COUNTRY_ERROR;
+    } else {
+      echo tep_get_country_name($a_country) . tep_draw_hidden_field('a_country');
+    }
+  } else {
+    echo tep_get_country_list('a_country', $affiliate['affiliate_country_id']) . '&nbsp;' . ENTRY_COUNTRY_TEXT;
+  }
+?>
+            </td>
+          </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_STATE; ?></td>
+            <td class="main">&nbsp;
+<?php
+    $state = tep_get_zone_name($a_country, $a_zone_id, $a_state);
+    if ($is_read_only == true) {
+      echo tep_get_zone_name($affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id'], $affiliate['affiliate_state']);
+    } elseif ($error == true) {
+      if ($entry_state_error == true) {
+        if ($entry_state_has_zones == true) {
+          $zones_array = array();
+          $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($a_country) . "' order by zone_name");
+          while ($zones_values = tep_db_fetch_array($zones_query)) {
+            $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+          }
+          echo tep_draw_pull_down_menu('a_state', $zones_array) . '&nbsp;' . ENTRY_STATE_ERROR;
+        } else {
+          echo tep_draw_input_field('a_state') . '&nbsp;' . ENTRY_STATE_ERROR;
+        }
+      } else {
+        echo $state . tep_draw_hidden_field('a_zone_id') . tep_draw_hidden_field('a_state');
+      }
+    } else {
+      echo tep_draw_input_field('a_state', tep_get_zone_name($affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id'], $affiliate['affiliate_state'])) . '&nbsp;' . ENTRY_STATE_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_CONTACT; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_telephone'];
+  } elseif ($error == true) {
+    if ($entry_telephone_error == true) {
+      echo tep_draw_input_field('a_telephone') . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_ERROR;
+    } else {
+      echo $a_telephone . tep_draw_hidden_field('a_telephone');
+    }
+  } else {
+    echo tep_draw_input_field('a_telephone', $affiliate['affiliate_telephone']) . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_FAX_NUMBER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_fax'];
+  } elseif ($error == true) {
+    if ($entry_fax_error == true) {
+      echo tep_draw_input_field('a_fax') . '&nbsp;' . ENTRY_FAX_NUMBER_ERROR;
+    } else {
+      echo $a_fax . tep_draw_hidden_field('a_fax');
+    }
+  } else {
+    echo tep_draw_input_field('a_fax', $affiliate['affiliate_fax']) . '&nbsp;' . ENTRY_FAX_NUMBER_TEXT;
+  }
+?>
+            </td>
+          </tr>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_HOMEPAGE; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_homepage'];
+  } elseif ($error == true) {
+    if ($entry_homepage_error == true) {
+      echo tep_draw_input_field('a_homepage') . '&nbsp;' . ENTRY_AFFILIATE_HOMEPAGE_ERROR;
+    } else {
+      echo $a_homepage . tep_draw_hidden_field('a_homepage');
+    }
+  } else {
+    echo tep_draw_input_field('a_homepage', $affiliate['affiliate_homepage']) . '&nbsp;' . ENTRY_AFFILIATE_HOMEPAGE_TEXT;
+  }
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  if ($is_read_only == false) {
+?>
+  <tr>
+    <td class="formAreaTitle"><br><?php echo CATEGORY_PASSWORD; ?></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_PASSWORD; ?></td>
+            <td class="main">&nbsp;
+<?php
+    if ($error == true) {
+      if ($entry_password_error == true) {
+        echo tep_draw_password_field('a_password') . '&nbsp;' . ENTRY_PASSWORD_ERROR;
+      } else {
+        echo PASSWORD_HIDDEN . tep_draw_hidden_field('a_password') . tep_draw_hidden_field('a_confirmation');
+      }
+    } else {
+      echo tep_draw_password_field('a_password') . '&nbsp;' . ENTRY_PASSWORD_TEXT;
+    }
+?>
+            </td>
+          </tr>
+<?php
+    if ( ($error == false) || ($entry_password_error == true) ) {
+?>
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+            <td class="main">&nbsp;
+<?php
+      echo tep_draw_password_field('a_confirmation') . '&nbsp;' . ENTRY_PASSWORD_CONFIRMATION_TEXT;
+?>
+            </td>
+          </tr>
+<?php
+    }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo CATEGORY_OPTIONS; ?></b></td>
+      </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;<?php echo ENTRY_AFFILIATE_NEWSLETTER; ?></td>
+            <td class="main">&nbsp;
+<?php
+  if ($is_read_only == true) {
+    echo $affiliate['affiliate_newsletter'];
+  } elseif ($error == true) {
+    if ($entry_newsletter_error == true) {
+      echo tep_draw_checkbox_field('a_newsletter', '1') . '&nbsp;' . ENTRY_AFFILIATE_NEWSLETTER_ERROR;
+    } else {
+      echo $a_newsletter . tep_draw_checkbox_field('a_newsletter', '1');
+    }
+  } else {
+    echo tep_draw_checkbox_field('a_newsletter', '1', $affiliate['affiliate_newsletter']) . '&nbsp;' . ENTRY_AFFILIATE_NEWSLETTER_TEXT;
+  }
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="formAreaTitle"><br></td>
+  </tr>
+  <tr>
+    <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
+      <tr>
+        <td class="main"><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">&nbsp;</td>
+            <td class="main">&nbsp;
+<?php 
+  echo tep_draw_checkbox_field('a_agb', $value = '1', $checked = $affiliate['affiliate_agb']) . ENTRY_AFFILIATE_ACCEPT_AGB . '<b><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_TERMS_POPUP, '', 'SSL') . '\')">' . ENTRY_AFFILIATE_ACCEPT_AGB_TEXT . '</a></b>';
+    if ($entry_agb_error == true) {
+      echo "<br>".ENTRY_AFFILIATE_AGB_ERROR;
+    }
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+  }
+?>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/also_purchased_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/also_purchased_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/also_purchased_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: also_purchased_products.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED);
+    $num_products_ordered = tep_db_num_rows($orders_query);
+    if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) {
+?>
+<!-- also_purchased_products //-->
+          <tr>
+            <td>
+
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => TEXT_ALSO_PURCHASED_PRODUCTS);
+
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $row = 0;
+      $col = 0;
+      $info_box_contents = array();
+      while ($orders = tep_db_fetch_array($orders_query)) {
+        $orders['products_name'] = tep_get_products_name($orders['products_id']);
+        $info_box_contents[$row][$col] = array('align' => 'center',
+                                               'params' => 'class="navBbrown" width="33%" valign="top"',
+                                               'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $orders['products_image'], $orders['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a>');
+
+        $col ++;
+        if ($col > 2) {
+          $col = 0;
+          $row ++;
+        }
+      }
+
+      new contentBox($info_box_contents);
+      
+if (MAIN_TABLE_BORDER == 'yes'){
+   $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, false, false);
+}
+?>
+           </td>
+          </tr>
+<!-- also_purchased_products_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/an_example.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/an_example.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/an_example.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<!-- specials //-->
+  <tr>
+    <td valign="top" width="100%" align="center">
+    <table border="0" cellspacing="0" cellpadding="2" height="160">
+      <tr>
+        <td width="45%"> 
+ <table border="0" cellspacing="0" cellpadding="0" width="100%"> 
+
+  <tr>
+    <td align="center"><img src="templates/example/images/sale2_button_198x134.gif" border="0" alt=""></td> 
+  </tr> 
+</table> 
+</td>
+<td width="10%">&nbsp;</td>
+<td width="45%"><table border="0" cellpadding="0" cellspacing="0" width="100%"> 
+  <tr>  
+    <td height="19" class="promo1title"><?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/featured.php');?>
+</td> 
+  </tr> 
+       </table></td>
+  </tr>
+</table>
+            </td>
+          </tr>
+<!-- specials_eof //--> 
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/article_listing.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/article_listing.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/article_listing.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,118 @@
+<?php
+/*
+  $Id: article_listing.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+$listing_split = new splitPageResults($listing_sql, MAX_ARTICLES_PER_PAGE);
+  if (($listing_split->number_of_rows > 0) && ((ARTICLE_PREV_NEXT_BAR_LOCATION == 'top') || (ARTICLE_PREV_NEXT_BAR_LOCATION == 'both'))) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_ARTICLES); ?></td>
+            <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+  if ($listing_split->number_of_rows > 0) {
+    $articles_listing_query = tep_db_query($listing_split->sql_query);
+?>
+      <tr>
+        <td class="main"><?php echo TEXT_ARTICLES; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    while ($articles_listing = tep_db_fetch_array($articles_listing_query)) {
+?>
+          <tr>
+            <td valign="top" class="main" width="75%">
+<?php
+  echo '<a href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $articles_listing['articles_id']) . '"><b>' . $articles_listing['articles_name'] . '</b></a> ';
+  if (DISPLAY_AUTHOR_ARTICLE_LISTING == 'true' && tep_not_null($articles_listing['authors_name'])) {
+   echo TEXT_BY . ' ' . '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $articles_listing['authors_id']) . '"> ' . $articles_listing['authors_name'] . '</a>';
+  }
+?>
+            </td>
+<?php
+      if (DISPLAY_TOPIC_ARTICLE_LISTING == 'true' && tep_not_null($articles_listing['topics_name'])) {
+?>
+            <td valign="top" class="main" width="25%" nowrap><?php echo TEXT_TOPIC . '&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $articles_listing['topics_id']) . '">' . $articles_listing['topics_name'] . '</a>'; ?></td>
+<?php
+      }
+?>
+          </tr>
+<?php
+      if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true') {
+?>
+          <tr>
+            <td class="main" style="padding-left:15px"><?php echo clean_html_comments(substr($articles_listing['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_listing['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>
+          </tr>
+<?php
+      }
+      if (DISPLAY_DATE_ADDED_ARTICLE_LISTING == 'true') {
+?>
+          <tr>
+            <td class="smalltext" style="padding-left:15px"><?php echo TEXT_DATE_ADDED . ' ' . tep_date_long($articles_listing['articles_date_added']); ?></td>
+          </tr>
+<?php
+      }
+      if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true' || DISPLAY_DATE_ADDED_ARTICLE_LISTING) {
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+ }
+    } // End of listing loop
+  } else {
+?>
+          <tr>
+            <td class="main"><?php if ($topic_depth == 'articles') {
+                                     echo TEXT_NO_ARTICLES;
+                                   } else if (isset($HTTP_GET_VARS['authors_id'])) {
+                                    echo  TEXT_NO_ARTICLES2;
+                                   } ?></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if (($listing_split->number_of_rows > 0) && ((ARTICLE_PREV_NEXT_BAR_LOCATION == 'bottom') || (ARTICLE_PREV_NEXT_BAR_LOCATION == 'both'))) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_ARTICLES); ?></td>
+            <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/articles_upcoming.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/articles_upcoming.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/articles_upcoming.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+  $Id: articles_upcoming.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+?>
+<?php
+  $expected_query = tep_db_query("select a.articles_id, a.articles_date_added, a.articles_date_available as date_expected, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t, " . TABLE_TOPICS_DESCRIPTION . " td, " . TABLE_AUTHORS . " au, " . TABLE_ARTICLES_DESCRIPTION . " ad where to_days(a.articles_date_available) > to_days(now()) and a.articles_id = a2t.articles_id and a2t.topics_id = td.topics_id and a.authors_id = au.authors_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' order by date_expected limit " . MAX_DISPLAY_UPCOMING_ARTICLES);
+  if (tep_db_num_rows($expected_query) > 0) {
+?>
+<!-- upcoming_articles //-->
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td class="main"><?php echo '<b>' . TEXT_UPCOMING_ARTICLES . '</b>'; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    while ($articles_expected = tep_db_fetch_array($expected_query)) {
+?>
+          <tr>
+            <td valign="top" class="main" width="75%">
+<?php
+  echo '<font color="#999999"><b>' . $articles_expected['articles_name'] . '</b></font> ';
+  if (DISPLAY_AUTHOR_ARTICLE_LISTING == 'true') {
+   echo TEXT_BY . ' ' . $articles_expected['authors_name'];
+  }
+?>
+            </td>
+<?php
+      if (DISPLAY_TOPIC_ARTICLE_LISTING == 'true') {
+?>
+            <td valign="top" class="main" width="25%" nowrap><?php echo TEXT_TOPIC . '&nbsp;' . $articles_expected['topics_name']; ?></td>
+<?php
+      }
+?>
+          </tr>
+<?php
+      if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true') {
+?>
+          <tr>
+            <td class="main" style="padding-left:15px"><?php echo clean_html_comments(substr($articles_expected['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_expected['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>
+          </tr>
+<?php
+      }
+?>
+          <tr>
+            <td class="smalltext" style="padding-left:15px"><?php echo TEXT_DATE_EXPECTED . ' ' . tep_date_long($articles_expected['date_expected']); ?></td>
+          </tr>
+<?php
+      if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true' || DISPLAY_DATE_ADDED_ARTICLE_LISTING) {
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+     }
+  } // End of listing loop
+?>
+        </table></td>
+      </tr>
+<!-- eof upcoming_articles //-->
+<?php
+  }
+?>
+

Added: trunk/direct.openmoko.com/includes/modules/articles_xsell.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/articles_xsell.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/articles_xsell.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+
+<?php
+/* 
+  $Id: articles_xsell.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+osCommerce, Open Source E-Commerce Solutions 
+  http://www.oscommerce.com
+
+Copyright (c) 2003 osCommerce 
+
+Released under the GNU General Public License 
+*/ 
+
+if ($HTTP_GET_VARS['articles_id']) {
+$xsell_query = tep_db_query("select distinct a.products_id, a.products_image, ad.products_name from " . TABLE_ARTICLES_XSELL . " ax, " . TABLE_PRODUCTS . " a, " . TABLE_PRODUCTS_DESCRIPTION . " ad where ax.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and ax.xsell_id = a.products_id and a.products_id = ad.products_id and ad.language_id = '" . (int)$languages_id . "' and a.products_status = '1' order by ax.sort_order asc limit " . MAX_DISPLAY_ARTICLES_XSELL);
+$num_products_xsell = tep_db_num_rows($xsell_query); 
+if ($num_products_xsell >= MIN_DISPLAY_ARTICLES_XSELL) {
+?> 
+<!-- xsell_articles //-->
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_ARTICLES);
+      new contentBoxHeading($info_box_contents);
+
+      $row = 0;
+      $col = 0;
+      $info_box_contents = array();
+      while ($xsell = tep_db_fetch_array($xsell_query)) {
+        $xsell['products_name'] = tep_get_products_name($xsell['products_id']);
+        $info_box_contents[$row][$col] = array('align' => 'center',
+                                               'params' => 'class="smallText" width="33%" valign="top"',
+                                               'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] . '</a>');
+        $col ++;
+        if ($col > 2) {
+          $col = 0;
+          $row ++;
+        }
+      }
+      new contentBox($info_box_contents);
+    
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new contentboxFooter($info_box_contents, false, false);
+?>
+<!-- xsell_articles_eof //-->
+<?php
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/authorizenet_direct.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/authorizenet_direct.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/authorizenet_direct.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,206 @@
+<?php
+/*
+  osCommerce 2.2 (Snapshot on November 10, 2002) Open Source E-Commerce Solutions
+  Authorizenet ADC Direct Connection
+  Last Update: November 10, 2002
+  Author: Bao Nguyen
+  Email: baonguyenx at yahoo.com
+
+  Update: August 13, 2003
+  Added: Transaction Key, Sort Order
+  Author: Austin Renfroe (Austin519)
+  Email: Austin519 at aol.com
+
+  Updated for: Authorize.net Consolidated v1.4
+  Date: February 28, 2004
+  Added: Credit Card Processing Mode, Currency Code, Company Information, Updated Billing Address, Invoice Number, Echeck Foundation, Debug Code
+  Author: Austin Renfroe (Austin519)
+  Email: Austin519 at aol.com
+
+  Updated for: Authorize.net Consolidated v1.4
+  Date: March 1, 2004
+  Added: Linux Compatibility
+  Author: Austin Renfroe (Austin519)
+  Email: Austin519 at aol.com
+
+  Updated for: Authorize.net Consolidated v1.5
+  Date: March 12, 2004
+  Added: CVV Card Specific Checking, CC Images
+  Author: Austin Renfroe (Austin519), some code thanks to Dansken
+  Email: Austin519 at aol.com
+
+  Updated for: Authorize.net Consolidated v1.5
+  Date: March 24, 2004
+  Added: Relay Response var, Test and Debug Mode, cURL var for admin module, cURL autofind, Windows 2003 Compatibility
+  Author: Austin Renfroe (Austin519), some code thanks to dreamscape
+  Email: Austin519 at aol.com
+*/
+
+  unset($form_data);
+  $xx = '';
+  for ($i=0; $i<sizeof($order->products); $i++) {
+    $xx .= $order->products[$i]['qty'] . '-' . ($order->products[$i]['name']) . '**';
+  }
+  //Austin519 - added transaction key, ccmode
+  $form_data = array(
+  x_Login => MODULE_PAYMENT_AUTHORIZENET_LOGIN,
+  x_Tran_Key => MODULE_PAYMENT_AUTHORIZENET_TRANSKEY,
+  x_Relay_Response => 'FALSE',
+  x_Delim_Data => 'TRUE',
+  x_Version => '3.1',
+  x_Type => MODULE_PAYMENT_AUTHORIZENET_CCMODE == 'Authorize Only' ? 'AUTH_ONLY' : 'AUTH_CAPTURE',
+  x_Method => MODULE_PAYMENT_AUTHORIZENET_METHOD == 'Credit Card' ? 'CC' : 'ECHECK',
+  x_Amount => number_format($order->info['total'], 2),
+  x_Currency_Code => "{$order->info['currency']}",
+  x_Email_Customer => MODULE_PAYMENT_AUTHORIZENET_EMAIL_CUSTOMER == 'True' ? 'TRUE': 'FALSE',
+  x_Email_Merchant => MODULE_PAYMENT_AUTHORIZENET_EMAIL_MERCHANT == 'True' ? 'TRUE': 'FALSE',
+  x_Cust_ID => "$customer_id",
+  x_Invoice_Num => "$insert_id",
+  x_First_Name => "{$order->billing['firstname']}",
+  x_Last_Name => "{$order->billing['lastname']}",
+  x_Company => "{$order->billing['company']}",
+  x_Address => "{$order->billing['street_address']}",
+  x_City => "{$order->billing['city']}",
+  x_State => "{$order->billing['state']}",
+  x_Zip => "{$order->billing['postcode']}",
+  x_Country => "{$order->billing['country']['title']}",
+  x_Phone => "{$order->customer['telephone']}",
+  x_Email => "{$order->customer['email_address']}",
+  x_Ship_To_First_Name => "{$order->delivery['firstname']}",
+  x_Ship_To_Last_Name => "{$order->delivery['lastname']}",
+  x_Ship_To_Company => "{$order->delivery['company']}",
+  x_Ship_To_Address => "{$order->delivery['street_address']}",
+  x_Ship_To_City => "{$order->delivery['city']}",
+  x_Ship_To_State => "{$order->delivery['state']}",
+  x_Ship_To_Zip => "{$order->delivery['postcode']}",
+  x_Ship_To_Country => "{$order->delivery['country']['title']}",
+  x_Customer_IP => "{$HTTP_SERVER_VARS['REMOTE_ADDR']}",
+  x_Description => "$xx",
+  tep_session_name() => tep_session_id());
+
+  if(MODULE_PAYMENT_AUTHORIZENET_METHOD == 'Credit Card') {
+
+// Eversun mod for authorize.net problem
+//    $form_data['x_Card_Num'] = "$x_Card_Num";
+//    $form_data['x_Exp_Date'] = "$x_Exp_Date";
+    $form_data['x_Card_Num'] = $_SESSION['x_Card_Num'];
+    $form_data['x_Exp_Date'] = $_SESSION['x_Exp_Date'];
+// Eversun mod end for authorize.net problem
+        
+  if(MODULE_PAYMENT_AUTHORIZENET_CCV  == 'True' ) {
+    
+// Eversun mod for authorize.net problem
+//    $form_data['x_Card_Code'] = "$x_Card_Code";
+    $form_data['x_Card_Code'] = $_SESSION['x_Card_Code'];
+// Eversun mod end for authorize.net problem
+    
+  }
+  } else {
+    //E-check Information (Currently NOT IMPLEMENTED!)
+    $form_data['x_Recurring_Billing'] = '';
+    $form_data['x_Bank_Aba_Code'] = '';
+    $form_data['x_Bank_Acct_Num'] = '';
+    $form_data['x_Bank_Acct_Type'] = '';
+    $form_data['x_Bank_Name'] = '';
+    $form_data['x_Bank_Acct_Name'] = '';
+    $form_data['x_echeck_type'] = '';
+    $form_data['x_drivers_license_num'] = '';
+    $form_data['x_drivers_license_state'] = '';
+    $form_data['x_drivers_license_DOB'] = '';
+  }
+
+     if (($x_Card_Num == '4111111111111111') || ($x_Card_Num == '370000000000002') || ($x_Card_Num == '6011000000000012') || ($x_Card_Num == '5424000000000015') || ($x_Card_Num == '4007000000027')) {
+      $cardtestmode=1;
+    } else {
+      $cardtestmode=0;
+    }
+
+  if((MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test') || (MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test And Debug') ) {
+    $form_data['x_Test_Request'] = 'TRUE';
+  }
+
+  // concatenate order information variables to $data
+  while(list($key, $value) = each($form_data)) {
+    $data .= $key . '=' . urlencode(ereg_replace(',', '', $value)) . '&';
+  }
+
+  // take the last & out for the string
+  $data = substr($data, 0, -1);
+
+  /* Debug code - will dump cURL data to a file when
+   * the admin module Transaction Mode is set to Test and Debug.
+   * The file is written into the root directory of the catalog
+   */
+  if (MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test And Debug') {
+    $filename = './debug/authnet_debug.txt';
+    $fp = fopen($filename, "a");
+    $write = fputs($fp, $data);
+    fclose($fp);
+  }
+  unset($response);
+
+/******************************************************************************************
+ * Post order info data to Authorize.net, make sure you have curl installed
+ *    Those with cURL not compiled into PHP (Windows users, some Linux users):
+ *          Please type in your path in the admin module.  The code below will TRY to find
+ *          your cURL path for you (may not work under Windows) and if it finds it, will
+ *          default to that, but you should enter your cURL path in the admin module to be
+ *          sure.  You no longer need to edit the code manually in this file (that code thanks
+ *          to dreamscape).
+ *    Those with cURL compiled into PHP (some Linux users):
+ *          This should work without any editing if cURL is compiled into your PHP and you
+ *          have PHP configured to realize it (per the PHP guides).
+ ******************************************************************************************
+ */
+  if (MODULE_PAYMENT_AUTHORIZENET_CURL == 'Not Compiled') {
+    if (function_exists('exec')) {
+      exec('which curl', $curl_output);
+      if ($curl_output) {
+        $curl_path = $curl_output[0];
+      }else {
+        $curl_path = MODULE_PAYMENT_AUTHORIZENET_CURL_PATH;
+      }
+    }
+    if (($x_Card_Num == '4111111111111111') || ($x_Card_Num == '370000000000002') || ($x_Card_Num == '6011000000000012') || ($x_Card_Num == '5424000000000015') || ($x_Card_Num == '4007000000027')) {
+      $cardtestmode=1;
+    } else {
+      $cardtestmode=0;
+    }
+    if((MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test') || (MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test And Debug') ) {
+      exec("$curl_path -d \"$data\" https://certification.authorize.net/gateway/transact.dll", $response);
+    } else {
+      exec("$curl_path -d \"$data\" https://secure.authorize.net/gateway/transact.dll", $response);
+    }
+
+  } else {
+    if((MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test') || (MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test And Debug') ) {
+      $url = "https://certification.authorize.net/gateway/transact.dll";
+    } else {
+      $url = "https://secure.authorize.net/gateway/transact.dll";
+    }
+    $agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)";
+    $ch = curl_init();
+    curl_setopt($ch, CURLOPT_URL,$url);
+    curl_setopt($ch, CURLOPT_VERBOSE, 1);
+    curl_setopt($ch, CURLOPT_POST, 1);
+    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+                curl_setopt($ch, CURLOPT_TIMEOUT, 120);
+                curl_setopt($ch, CURLOPT_USERAGENT, $agent);
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);  //Windows 2003 Compatibility
+    $authorize = curl_exec($ch);
+    curl_close($ch);
+    $response = explode(',', $authorize);
+  }
+
+
+  if (MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test And Debug') {
+          $filename2 = './debug/authnet_debug.txt';
+        $authorize2=' :data String : ' . $data . '\n';
+        $response2 = ' :Response String : ' . $authorize . '\n';
+          $fp2 = fopen($filename2,"ab");
+          $write = fputs($fp2, $authorize2, strlen($authorize2));
+    $write = fputs($fp2, $response2, strlen($response2));
+          fclose($fp2);
+          }
+?>

Added: trunk/direct.openmoko.com/includes/modules/checkout_new_address.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/checkout_new_address.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/checkout_new_address.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+<?php
+/*
+  $Id: checkout_new_address.php,v 1.1.1.1 2004/03/04 23:41:09 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (!isset($process)) $process = false;
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    if (isset($gender)) {
+      $male = ($gender == 'm') ? true : false;
+      $female = ($gender == 'f') ? true : false;
+    } else {
+      $male = false;
+      $female = false;
+    }
+?>
+  <tr>
+    <td class="main"><?php echo ENTRY_GENDER; ?></td>
+    <td class="main"><?php echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
+  </tr>
+<?php
+  }
+?>
+  <tr>
+    <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
+    <td class="main"><?php echo tep_draw_input_field('firstname') . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
+  </tr>
+  <tr>
+    <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
+    <td class="main"><?php echo tep_draw_input_field('lastname') . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
+  </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>
+  <tr>
+    <td class="main"><?php echo ENTRY_COMPANY; ?></td>
+    <td class="main"><?php echo tep_draw_input_field('company') . '&nbsp;' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>
+  </tr>
+<?php
+  }
+?>
+  <tr>
+    <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
+    <td class="main"><?php echo tep_draw_input_field('street_address') . '&nbsp;' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
+  </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+  <tr>
+    <td class="main"><?php echo ENTRY_SUBURB; ?></td>
+    <td class="main"><?php echo tep_draw_input_field('suburb') . '&nbsp;' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
+  </tr>
+<?php
+  }
+?>
+  <tr>
+    <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
+    <td class="main"><?php echo tep_draw_input_field('postcode') . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
+  </tr>
+  <tr>
+    <td class="main"><?php echo ENTRY_CITY; ?></td>
+    <td class="main"><?php echo tep_draw_input_field('city') . '&nbsp;' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
+  </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+  <tr>
+    <td class="main"><?php echo ENTRY_STATE; ?></td>
+    <td class="main">
+<?php
+    if ($process == true) {
+      if ($entry_state_has_zones == true) {
+        $zones_array = array();
+        $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
+        while ($zones_values = tep_db_fetch_array($zones_query)) {
+          $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+        }
+        echo tep_draw_pull_down_menu('state', $zones_array);
+      } else {
+        echo tep_draw_input_field('state');
+      }
+    } else {
+      echo tep_draw_input_field('state');
+    }
+
+    if (tep_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="inputRequirement">' . ENTRY_STATE_TEXT;
+?>
+    </td>
+  </tr>
+<?php
+  }
+?>
+  <tr>
+    <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
+    <td class="main"><?php echo tep_get_country_list('country') . '&nbsp;' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/includes/modules/checkout_success/notifications.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/checkout_success/notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/checkout_success/notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/*
+  $Id: notifcations.php,v 1.1.1.1 2006/07/04 23:41:17 datazen Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class notifications {
+    var $title, $output;
+
+    function notifications() {
+      $this->code = 'notifications';
+      $this->title = MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_TITLE;
+      $this->description = MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_DESCRIPTION;
+      $this->enabled = ((MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_STATUS == 'true') ? true : false);
+      $this->sort_order = MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_SORT_ORDER;
+
+      $this->output = array();
+    }
+
+    function process() {
+      global $customer_id;
+
+      if (MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_STATUS != 'True') { return; }
+
+      $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'");
+      $global = tep_db_fetch_array($global_query);
+
+      if ($global['global_product_notifications'] != '1') {
+        $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
+        $orders = tep_db_fetch_array($orders_query);
+
+        $products_array = array();
+        $products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $products_array[] = array('id' => $products['products_id'],
+                                              'text' => $products['products_name']);
+        }
+      }
+
+      if ($global['global_product_notifications'] != '1') {
+        $notify_products = TEXT_NOTIFY_PRODUCTS . '<br><p class="productsNotifications">';
+        $products_displayed = array();
+        for ($i=0, $n=sizeof($products_array); $i<$n; $i++) {
+          if (!in_array($products_array[$i]['id'], $products_displayed)) {
+            $notify_products .= tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br>';
+            $products_displayed[] = $products_array[$i]['id'];
+          }
+        }
+        $notify_products .= '</p>';
+      } else {
+        $notify_products = TEXT_SEE_ORDERS . '<br><br>' . TEXT_CONTACT_STORE_OWNER;
+      }
+      $output_text ='';
+      if (MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_TABLE_BORDER == 'True') {
+        $output_text .= '<tr><td valign=top width=100%><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td bgcolor=#99AECE><table width=100% border=0 cellspacing=0 cellpadding=1>';
+        $output_text .= '<tr><td><table width=100% border=0 cellspacing=0 cellpadding=1><tr><td bgcolor=#f8f8f9><table width=100% border=0 cellspacing=0 cellpadding=4><tr><td>';
+      }
+      $output_text .= '<table border=0 width=100% cellspacing=4 cellpadding=2><tr><td valign=top>' . tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', $HEADING_TITLE) .'</td>';
+      $output_text .= '<td valign=top class=main>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '<br>' . $notify_products . '<h3>' .  TEXT_THANKS_FOR_SHOPPING . '</h3></td></tr></table>';
+      if (MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_TABLE_BORDER == 'True') {
+        $output_text .= '</td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr><tr><td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td></tr>';
+      }
+      $this->output[] = array('text' => $output_text);
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+
+      return $this->_check;
+    }
+
+    function keys() {
+      return array('MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_STATUS', 'MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_TABLE_BORDER', 'MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_SORT_ORDER');
+    }
+
+  function install() {
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Product Notifications', 'MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_STATUS', 'True', 'Do you want to enable Product Notifications?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Table Border', 'MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_TABLE_BORDER', 'False', 'Display Product Notifications with table border?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CHECKOUT_SUCCESS_NOTIFICATIONS_SORT_ORDER', '0', 'Sort order of display.', '6', '3', now())");     
+  }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/checkout_success/shipwire.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/checkout_success/shipwire.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/checkout_success/shipwire.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,342 @@
+<?php
+/*
+  $Id: expressshipping.php
+
+   Released under the GNU General Public License
+*/
+  class shipwire { 
+    var $code, $title, $descrption, $enabled, $sort_order;
+
+//  class constructor
+    function shipwire() {
+      global $order, $cart;
+
+      $this->code = 'shipwire';
+      $this->title = MODULE_CHECKOUT_SUCCESS_SHIPWIRE_TITLE;
+      $this->description = MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DESCRIPTION;
+      $this->enabled = ((MODULE_CHECKOUT_SUCCESS_SHIPWIRE_STATUS == 'True') ? true : false);
+      $this->sort_order = MODULE_CHECKOUT_SUCCESS_SHIPWIRE_SORT_ORDER;
+
+      $this->output = array();
+    }
+
+    function process() {
+      global $customer_id, $customer_email, $full_name;
+
+      if (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_STATUS != 'True') { return; }
+
+      $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
+      $orders = tep_db_fetch_array($orders_query);
+
+      $shipw = $this->shipwire_process($orders['orders_id']);
+    
+      //BOF update orders->comments
+      $orders_status_query = tep_db_query("select comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$orders['orders_id'] . "'");
+      $orders_status = tep_db_fetch_array($orders_status_query);
+      if (tep_not_null($orders_status)){
+        if($orders_status['comments'] == ''){       
+          $new_comments = TEXT_SHIPWIRE_TRANSACTION_ID  . ' ' . $shipw['transaction_id'];
+        }else{       
+          $new_comments = trim($orders_status['comments']) . "\n" . TEXT_SHIPWIRE_TRANSACTION_ID  . ' ' . $shipw['transaction_id'];
+        }
+        tep_db_query("update " . TABLE_ORDERS_STATUS_HISTORY . " set comments = '" . trim($new_comments) . "' where orders_id = '" . (int)$orders['orders_id'] . "'");
+      }
+      //EOF update orders->comments
+
+      $output_text = '';
+      if (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_BANNER == 'True'){
+        $output_text .= '<DIV align="center"><table BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><tr><td align="center" class="main"><a target="_blank" href="'.  MODULE_CHECKOUT_SUCCESS_SHIPWIRE_AFFILIATE_URL .'">' . tep_image(DIR_WS_IMAGES . 'shipwire_banner.gif') . '</a></td></tr><tr><td align="center" class="main">' . TEXT_SHIPWIRE_TRANSACTION_ID . '<b>' . $shipw['transaction_id'] . '</b></td></tr></table></DIV>';
+      }
+      $this->output[] = array('text' => $output_text);
+
+      $email_subject = "Your Shipwire Transaction ID for Order # " . $orders['orders_id'];
+      $email_order =  "\n" . 'Your Shipwire Transaction ID for Order ' . $orders['orders_id'] . ' is ' . $shipw['transaction_id'] . "\n";     
+      tep_mail($full_name, $customer_email, $email_subject, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);                  
+    }
+
+    function shipwire_process($order_id) {
+      global $order, $customer_id, $customer_email, $full_name;
+      
+      // check to see if we are running in debug mode
+      if (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DEBUG == 'True') {
+        // open the file and write the starting information
+        $filename = DIR_FS_CATALOG . 'debug/shipwire_debug.txt';
+        $fp = fopen($filename, "a");
+        $data = 'Shipwire module entered at ' . microtime() . "\n";
+        $write = fputs($fp, $data);
+      }
+      
+      // replace the "email" & "passWd" String values with your Shipwire email and password
+      $email = MODULE_CHECKOUT_SUCCESS_SHIPWIRE_EMAIL;
+      $passwd = MODULE_CHECKOUT_SUCCESS_SHIPWIRE_PASSWORD;
+      $server = MODULE_CHECKOUT_SUCCESS_SHIPWIRE_SERVER;
+      $warehouse = "00"; // Leave "00" if you want Shipwire to determine the warehouse
+
+      $products_array = array();
+      $products_query = tep_db_query("select products_id, products_name, products_model, products_quantity, final_price, products_tax from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "' order by products_id");
+      while ($products = tep_db_fetch_array($products_query)) {
+        $products_array[] = array('id' => $products['products_id'],
+                                  'name' => $products['products_name'],
+                                  'model' => $products['products_model'],
+                                  'qty' => $products['products_quantity'],
+                                  'final_price' => $products['final_price'],
+                                  'tax' => $products['products_tax'],
+                                 );
+      }
+      $items = '';
+      for ($i=0;$i < sizeof($products_array);$i++) {
+        $items .= '<Item num="' . $i . '">';
+        $items .= '<Id>' . $products_array[$i]['id'] . '</Id>';
+        $items .= '<Code>' . html_entity_decode($products_array[$i]['model'], ENT_QUOTES) . '</Code>';
+        $items .= '<Quantity>' . $products_array[$i]['qty'] . '</Quantity>';
+        $items .= '<Unit-Price>' . $products_array[$i]['final_price'] . '</Unit-Price>';
+        $items .= '<Description>' . html_entity_decode($products_array[$i]['name'], ENT_QUOTES) . '</Description>';
+        $items .= '<Taxable>' . ($products_array[$i]['tax'] != '' ? 'YES' : 'NO') . '</Taxable>';
+        $items .= '<Url>' . HTTP_SERVER . '/index.php?products_id=' . $products_array[$i]['id'] . '</Url>';
+        $items .= '</Item>';
+      }
+
+      $orders_query = tep_db_query("select * from " . TABLE_ORDERS . " WHERE customers_id = '" . (int)$customer_id . "' AND orders_id = '" . (int)$order_id . "'");
+      $orders = tep_db_fetch_array($orders_query);
+
+      $order_shipping_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int)$order_id . "' AND class = 'ot_shipping'");
+      $order_shipping_method = tep_db_fetch_array($order_shipping_method_query);
+
+      $order_totals_query = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int)$order_id . "' AND class = 'ot_total'");
+      $order_totals = tep_db_fetch_array($order_totals_query);
+
+      $country = ($orders['delivery_country'] == '') ? $orders['billing_country'] : $orders['delivery_country'];
+      $countries_query = tep_db_query("select countries_iso_code_2 from " . TABLE_COUNTRIES . " WHERE countries_name = '" . $country . "'");
+      $countries = tep_db_fetch_array($countries_query);
+      $order_country = $countries['countries_iso_code_2'];
+
+      $customer_email = $orders['customers_email_address'];
+      $full_name = ($orders['delivery_name'] == '') ? $orders['billing_name'] : $orders['delivery_name'];
+
+      $OrderList = '<OrderList StoreAccountName="CRELOADED">' .
+        '<EmailAddress>' . $email . '</EmailAddress>' .
+        '<Password>' . $passwd . '</Password>' .
+        '<Server>'. $server .'</Server>' .
+        '<Order id="' . $order_id . '">' .
+        '<Time>' . date("D M j G:i:s Y") . ' GMT</Time>' .
+        '<NumericTime>' . time() . '</NumericTime>' .
+        '<Referer>CRELOADED</Referer>' .
+        '<Warehouse>' . $warehouse . '</Warehouse>';
+        if ($orders['delivery_street_address'] != '') {
+          $OrderList .= '<AddressInfo type="ship">' .
+            '<Name>' .
+              '<Full>' . html_entity_decode($orders['delivery_name'], ENT_QUOTES) . '</Full>' .
+            '</Name>' .
+            '<Address1>' . html_entity_decode($orders['delivery_street_address'], ENT_QUOTES) . '</Address1>' .
+            '<Address2>' . html_entity_decode($orders['delivery_suburb'], ENT_QUOTES) . '</Address2>' .
+            '<City>' . $orders['delivery_city'] . '</City>' .
+            '<State>' . $orders['delivery_state'] . '</State>' .
+            '<Country>' . $order_country . '</Country>' .
+            '<Zip>' . $orders['delivery_postcode'] . '</Zip>' .
+            '<Phone>' . $orders['customers_telephone'] . '</Phone>' .
+          '</AddressInfo>';
+        }else{
+          $OrderList .= '<AddressInfo type="ship">' .
+            '<Name>' .
+              '<Full>' . html_entity_decode($orders['billing_name'], ENT_QUOTES) . '</Full>' .
+            '</Name>' .
+            '<Address1>' . html_entity_decode($orders['billing_street_address'], ENT_QUOTES) . '</Address1>' .
+            '<Address2>' . html_entity_decode($orders['billing_suburb'], ENT_QUOTES) . '</Address2>' .
+            '<City>' . $orders['billing_city'] . '</City>' .
+            '<State>' . $orders['billing_state'] . '</State>' .
+            '<Country>' . $order_country . '</Country>' .
+            '<Zip>' . $orders['billing_postcode'] . '</Zip>' .
+            '<Phone>' . $orders['customers_telephone'] . '</Phone>' .
+          '</AddressInfo>';
+        }
+        $OrderList .= '<AddressInfo type="bill">' .
+          '<Name>' .
+            '<Full>' . html_entity_decode($orders['billing_name'], ENT_QUOTES) . '</Full>' .
+          '</Name>' .
+          '<Address1>' . html_entity_decode($orders['billing_street_address'], ENT_QUOTES) . '</Address1>' .
+          '<Address2>' . html_entity_decode($orders['billing_suburb'], ENT_QUOTES) . '</Address2>' .
+          '<City>' . $orders['billing_city'] . '</City>' .
+          '<State>' . $orders['billing_state'] . '</State>' .
+          '<Country>' . $order_country . '</Country>' .
+          '<Zip>' . $orders['billing_postcode'] . '</Zip>' .
+          '<Phone>' . $orders['customers_telephone'] . '</Phone>' .
+          '<Email>' . $orders['customers_email_address'] . '</Email>' .
+        '</AddressInfo>' .
+        '<Shipping>' . $order_shipping_method['title'] . '</Shipping>' .
+        '<CreditCard type="' . $orders['cc_type'] . '" expiration="' . $orders['cc_expires'] . '"></CreditCard>' .
+        $items . 
+        '<Total>' .
+          '<Line name="Total">' . $order_totals['value'] . '</Line>' .
+        '</Total>' .
+        '<Bogus/>' .
+        '</Order>' .
+      '</OrderList>';
+
+      // check to see if we are running in debug mode
+      if (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DEBUG == 'True') {
+        $data = 'Before encoding : ' . "\n";
+        $write = fputs($fp, $data);
+        $data = $OrderList . "\n";
+        $write = fputs($fp, $data);
+      }
+      
+      //Convert characters to proper format for post
+      $OrderList = urlencode($OrderList);
+
+      // check to see if we are running in debug mode
+      if (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DEBUG == 'True') {
+        $data = 'The data to transmitted : ' . "\n";
+        $write = fputs($fp, $data);
+        $data = $OrderList . "\n";
+        $write = fputs($fp, $data);
+      }
+      
+      // open synchronous connection to Shipwire servlet    
+      // NOTE:  you must have the cURL libraries installed with PHP on your server--
+      // If you need them, see your System Administrator, who can get then at 
+      // http://curl.haxx.se/download.html
+
+      // in debug mode record the time
+      if (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DEBUG == 'True') {
+        $data = 'Setting up the curl connection at ' . microtime() . "\n";
+        $write = fputs($fp, $data);
+      }
+   
+      $urlConn = curl_init (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_URL);
+      curl_setopt ($urlConn, CURLOPT_POST, 1);
+      curl_setopt ($urlConn, CURLOPT_HTTPHEADER, array("Content-type", "application/x-www-form-urlencoded"));
+      curl_setopt ($urlConn, CURLOPT_POSTFIELDS, "OrderListXML=".$OrderList);
+      
+      // in debug mode record the time
+      if (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DEBUG == 'True') {
+        $data = 'Starting transmission at ' . microtime() . "\n";
+        $write = fputs($fp, $data);
+      }
+     
+      ob_start();
+      curl_exec($urlConn);
+      $orderSubmitted = ob_get_contents();
+      ob_end_clean();
+      
+      // in debug mode record the time
+      if (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DEBUG == 'True') {
+        $data = 'Transmission completed at ' . microtime() . "\n";
+        $write = fputs($fp, $data);
+      }
+  
+      // Parse the response
+      $parser= xml_parser_create(); 
+      xml_parse_into_struct($parser,$orderSubmitted,$XMLvals,$XMLindex); 
+      xml_parser_free($parser);
+
+      $error_data_response = '';      
+      $error_data_response = $this->get_error($XMLvals);
+      $total_order_response = $this->get_total_order($XMLvals);
+      $transaction_id_response = $this->get_transaction_id($XMLvals);
+      
+      $ret = array('error' => $error_data,
+                   'total_order' => $total_order_response,
+                   'transaction_id' => $transaction_id_response);     
+      
+      // if we are in debug mode, close it up
+      if (MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DEBUG == 'True') {
+        $data = 'Error Response : ' . "\n" . $error_data_response . "\n";
+        $write = fputs($fp, $data);
+        $data = 'Total Order Response : ' . "\n" . $total_order_response . "\n";
+        $write = fputs($fp, $data);
+        $data = 'Transmission ID : ' . "\n" . $transaction_id_response . "\n";
+        $write = fputs($fp, $data);
+        $data = "\n\n\n\n";
+        $write = fputs($fp, $data);
+        fclose($fp);
+      }
+      return $ret;
+    }
+
+    // This function will return an array of the values of an element 
+    // given the $vals and $index arrays, and the element name
+    function getElementValue($XMLvals, $elName) { 
+      $elValue = null;
+      foreach ($XMLvals as $arrkey => $arrvalue) {
+        foreach ($arrvalue as $key => $value) {
+          if ($value==strtoupper($elName)){
+            $elValue[] = $arrvalue['value'];
+          }
+        }
+      }
+      return $elValue;
+    }
+    
+    function get_error($XMLvals) {
+      $errorMessage = $this->getElementValue($XMLvals,"ErrorMessage");
+      $ret_value = '';
+      if (isset($errorMessage)) {
+        foreach ($errorMessage as $key => $err) {
+          $ret_value .= $err;
+        }
+      }
+      return $ret_value;
+    }
+    
+    function get_transaction_id($XMLvals) {
+      $transactionId = $this->getElementValue($XMLvals,"TransactionId");
+      $ret_value = '';
+      if (isset($transactionId)) {
+        foreach ($transactionId as $key => $tra) {
+          $ret_value .= $tra;
+        }
+      }else{ 
+          $ret_value .= 'error';
+      }
+      return $ret_value;
+    }
+    
+    function get_total_order($XMLvals) {
+      $totalOrders = $this->getElementValue($XMLvals,"TotalOrders");
+      $ret_value = '';
+      if (isset($totalOrders)) {
+        foreach ($totalOrders as $key => $tot) {
+          $ret_value .= $tot;
+        }
+      }else{
+        $ret_value = 'error';
+      }
+      return $ret_value;
+    }
+    
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable ShipWire', 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_STATUS', 'True', 'Do you want to enable ShipWire?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display ShipWire Banner', 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_BANNER', 'True', 'Display ShipWire Banner and Shipwire Fullfillment ID on successful checkout?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipwire Affiliate URL', 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_AFFILIATE_URL', 'http://www.shipwire.com/exec/creloaded.php?ref=6133361', 'Enter your Shipwire Affiliate URL.', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('ShipWire Host Address', 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_URL', 'http://www.shipwire.com/exec/FulfillmentServices.php', 'ShipWire Host Address', '6', '3', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('ShipWire Server Address', 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_SERVER', 'Test', 'ShipWire Server Name (Test or  Production)', '6', '4', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Email Address', 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_EMAIL', '', 'Email Address', '6', '5', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('ShipWire Password', 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_PASSWORD', '', 'Case-sensitive password.', '6', '6', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Debug', 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DEBUG', 'False', 'Set to True to capture the information being transmitted.', '6', '11', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_SORT_ORDER', '0', 'Sort order of display.', '6', '12', now())");     
+    }
+
+    function remove() {
+      $keys = '';
+      $keys_array = $this->keys();
+      for ($i=0; $i < sizeof($keys_array); $i++) {
+        $keys .= "'" . $keys_array[$i] . "',";
+      }
+      $keys = substr($keys, 0, -1);
+
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
+    }
+
+    function keys() {
+    return array('MODULE_CHECKOUT_SUCCESS_SHIPWIRE_STATUS','MODULE_CHECKOUT_SUCCESS_SHIPWIRE_BANNER','MODULE_CHECKOUT_SUCCESS_SHIPWIRE_AFFILIATE_URL','MODULE_CHECKOUT_SUCCESS_SHIPWIRE_URL','MODULE_CHECKOUT_SUCCESS_SHIPWIRE_SERVER' ,'MODULE_CHECKOUT_SUCCESS_SHIPWIRE_EMAIL','MODULE_CHECKOUT_SUCCESS_SHIPWIRE_PASSWORD','MODULE_CHECKOUT_SUCCESS_SHIPWIRE_DEBUG','MODULE_CHECKOUT_SUCCESS_SHIPWIRE_SORT_ORDER');
+   }
+ }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/default_specials.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/default_specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/default_specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: default_specials.php,v 2.1 2006/09/07 23:42:27 datazen Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- default_specials mainpage //-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
+  
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+  $random_specials = array();
+  $specials_array = array();
+  $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC");
+  while ($specials = tep_db_fetch_array($specials_query)) {
+    $random_specials[] .= $specials['products_id'];
+  }
+
+  $row = 0;
+  $col = 0;
+
+  if (sizeof($random_specials)!=0){
+    $max_displayed = (MAX_DISPLAY_SPECIAL_PRODUCTS > sizeof($random_specials)) ? sizeof($random_specials) : MAX_DISPLAY_SPECIAL_PRODUCTS;
+    $special_products = cre_random_array($random_specials, $max_displayed);
+    for($i=0; $i < $max_displayed; $i++) {
+      $product_array = array();
+      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price as special_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where  p.products_id = $special_products[$i] and  s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");
+      $product = tep_db_fetch_array($product_query);
+
+      $pf->loadProduct($product['products_id'],$languages_id);
+      $products_price_s = $pf->getPriceStringShort();
+
+      $buyitnow='<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+ 
+      $info_box_contents[$row][$col] = array('align' => 'center',
+                                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                                             'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $product['products_image'], $product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . $product['products_name'] . '</a><br>' . $products_price_s . '<br>'. $buyitnow);
+      $col ++;
+      if ($col > 2) {
+        $col = 0;
+        $row ++;
+      }
+    }
+  }else{
+      $info_box_contents[$row][$col] = array('align' => 'left',
+                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                             'text' => TEXT_NO_SPECIALS);
+  }
+  
+  new contentBox($info_box_contents);
+
+  $info_box_contents = array();
+  if (MAIN_TABLE_BORDER == 'yes'){
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                             );
+    new infoboxFooter($info_box_contents, true, true);
+  }
+?><!-- default_specials_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/downloads.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/downloads.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/downloads.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+<?php
+/*
+  $Id: downloads.php,v 1.3 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- downloads //-->
+<?php
+  if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+// Get last order id for checkout_success
+    $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by orders_id desc limit 1");
+    $orders = tep_db_fetch_array($orders_query);
+    $last_order = $orders['orders_id'];
+  } else {
+    $last_order = $HTTP_GET_VARS['order_id'];
+  }
+
+// Now get all downloadable products in that order
+// BOF: WebMakers.com Added: Downloads Controller
+// DEFINE WHICH ORDERS_STATUS TO USE IN downloads_controller.php
+// USE last_modified instead of date_purchased
+// original  $downloads_query = tep_db_query("select                 date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");
+             $downloads_query = tep_db_query("select o.orders_status, date_format(o.last_modified, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_status >= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS . "' and o.orders_status != '99999' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");
+
+  if (tep_db_num_rows($downloads_query) > 0) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo HEADING_DOWNLOAD; ?></b></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td colspan="2"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+<!-- list of products -->
+<?php
+    while ($downloads = tep_db_fetch_array($downloads_query)) {
+// MySQL 3.22 does not have INTERVAL
+      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
+      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);
+      $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
+?>
+          <tr class="infoBoxContents">
+<!-- left box -->
+<?php
+// The link will appear only if:
+// - Download remaining count is > 0, AND
+// - The file is present in the DOWNLOAD directory, AND EITHER
+// - No expiry date is enforced (maxdays == 0), OR
+// - The expiry date is not reached
+      if ( ($downloads['download_count'] > 0) && (file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) && ( ($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) ) {
+// WebMakers.com Added: Downloads Controller Show Button
+// original MS1        echo '            <td class="main"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '</a></td>' . "\n";
+        echo '            <td class="main" align="center"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '<br>' . tep_image_button('button_download.gif', '') . '</a></td>' . "\n";
+      } else {
+        echo '            <td class="main">' . $downloads['products_name'] . '</td>' . "\n";
+      }
+?>
+<!-- right box -->
+<?php
+// BOF: WebMakers.com Added: Downloads Controller
+      echo '            <td class="main">' . TABLE_HEADING_DOWNLOAD_DATE . '<br>' . tep_date_long($download_expiry) . '</td>' . "\n" .
+           '            <td class="main" align="right">' . $downloads['download_count'] . TABLE_HEADING_DOWNLOAD_COUNT . '</td>' . "\n" .
+           '          </tr>' . "\n";
+// EOF: WebMakers.com Added: Downloads Controller
+    }
+?>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+    if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="smalltext" colspan="4"><p><?php printf(FOOTER_DOWNLOAD, '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>'); ?></p></td>
+      </tr>
+<?php
+    }
+  }
+?>
+<?php
+// BOF: WebMakers.com Added: Downloads Controller
+// If there is a download in the order and they cannot get it, tell customer about download rules
+  $downloads_check_query = tep_db_query("select o.orders_id, opd.orders_products_download_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.orders_id = opd.orders_id and o.orders_id = '" . (int)$last_order . "' and opd.orders_products_filename != ''");
+
+if (tep_db_num_rows($downloads_check_query) > 0 and tep_db_num_rows($downloads_query) < 1) {
+// if (tep_db_num_rows($downloads_query) < 1) {
+?>
+      <tr>
+        <td colspan="3" align="center" valign="top" class="main" height="30"><FONT FACE="Arial" SIZE=1 COLOR="FF000"><?php echo DOWNLOADS_CONTROLLER_ON_HOLD_MSG ?></FONT></td>
+      </tr>
+<?php
+}
+// EOF: WebMakers.com Added: Downloads Controller
+?>
+<!-- downloads_eof //-->

Added: trunk/direct.openmoko.com/includes/modules/example.html
===================================================================
--- trunk/direct.openmoko.com/includes/modules/example.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/example.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<table width="100%" border="0" bgcolor="FFA814" cellspacing="0" cellpadding="0">
+  <tr>
+    <td bgcolor="#CCCCCC">
+    <table width="100%" border="0" cellpadding="0" cellspacing="1">
+      <tr>
+        <td class="infoBoxHeading">
+        Example HTML Mainpage Module</td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+  <tr>
+    <td valign="top" width="100%">
+    <table width="100%" border="0" class="infobox" cellspacing="0" cellpadding="1">
+      <tr>
+        <td valign="top" width="100%">
+        <table width="100%" border="0" class="infoboxContents" cellspacing="0" cellpadding="0">
+      <!-- change from here to next-->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+          <tr>
+            <td align="center">
+            <img width="426" height="75" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr01.gif" border="0"></td>
+          </tr>
+          <tr>
+            <td valign="top" align="center">
+            <img valign="top" width="117" height="90" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr02.gif" border="0"></a><img width="117" height="90" valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr03.gif" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr04.gif" height="90" width="96" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr05.gif" width="96" height="90" border="0"></td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <!-- change from here to above-->
+        </table>
+        </td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/featured.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,79 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Featured Products V1.1
+  Displays a list of featured products, selected from admin
+  For use as an Infobox instead of the "New Products" Infobox  
+*/
+?>
+<!-- featured_products //-->
+<?php
+ 
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+      $featured_products_2bb_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_image 
+         from (" . TABLE_PRODUCTS . " p 
+         left join " . TABLE_SPECIALS . " s using(products_id)),
+          " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+          " . TABLE_FEATURED . " f
+          where 
+          p.products_status = '1'
+          and f.status ='1'
+          and p.products_id = f.products_id
+                            and pd.products_id = p.products_id
+                            and pd.language_id = '" . $languages_id . "'
+                            order by rand(), p.products_date_added DESC, pd.products_name");
+   
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($featured_products_2bb = tep_db_fetch_array($featured_products_2bb_query)) {
+
+    $num ++;
+  
+    if ($num == 1) {
+    new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+    }    
+
+   
+//   $featured_products_2bb['products_name'] = tep_get_products_name($featured_products_2bb['products_id']);
+
+  $pf->loadProduct($featured_products_2bb['products_id'],$languages_id);
+        $products_price_2bb = $pf->getPriceStringShort();
+
+
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products_2bb['products_image'], $featured_products_2bb['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . $featured_products_2bb['products_name'] . '</a><br>' . $products_price_2bb);
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+  $info_box_contents = array();
+if (MAIN_TABLE_BORDER == 'yes'){
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+}
+ }
+?>
+<!-- featured_products_eof //-->

Added: trunk/direct.openmoko.com/includes/modules/featured_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/featured_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/featured_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,124 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Featured Products Listing Module
+*/
+?>
+<!--D featured_prodcts-->
+<?php
+ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FEATURED_PRODUCTS);
+
+ $featured_products2_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_price as final_price,
+         p.products_tax_class_id,
+         p.products_image,
+         p.products_date_added,
+         p.manufacturers_id
+         from " . TABLE_PRODUCTS . " p,
+          " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+          " . TABLE_FEATURED . " f
+          where 
+          p.products_status = '1'
+          and f.status ='1'
+          and p.products_id = f.products_id
+                            and pd.products_id = p.products_id
+                            and pd.language_id = '" . $languages_id . "'
+                                   order by rand(), p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
+   
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  
+  while ($featured_products4 = tep_db_fetch_array($featured_products2_query)) {
+   $num ++;
+   $featured_products4_array[] = array('id' => $featured_products4['products_id'],
+                                  'name' => $featured_products4['products_name'],
+                                  'image' => $featured_products4['products_image'],
+                                  'price' => $featured_products4['products_price'],
+                                  'tax_class_id' => $featured_products4['products_tax_class_id'],
+                                  'date_added' => tep_date_long($featured_products4['products_date_added']),
+                                  'manufacturer' => tep_get_manufacturers_name($featured_products4['manufacturers_id'])   );
+  }
+  
+ // BOF: Lango Added for template MOD
+ 
+
+  
+    for($i=0; $i<sizeof($featured_products4_array); $i++) {
+  $pf->loadProduct($featured_products4_array[$i]['id'],$languages_id);
+        $products_price = $pf->getPriceStringShort();
+  // }
+
+$featured_string1a .= '  <tr>' .
+                   '    <td class= "boxText" width="100%" align="center" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products4_array[$i]['id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $featured_products4_array[$i]['image'], $featured_products4_array[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br>' .
+                   '    <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products4_array[$i]['id'], 'NONSSL') . '"><b><u>' . $featured_products4_array[$i]['name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . $featured_products4_array[$i]['date_added'] . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products4_array[$i]['manufacturer'] . '<br>' . TEXT_PRICE . ' ' . $products_price . '<br>' .
+                   '    <a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=buy_now&amp;products_id=' . $featured_products4_array[$i]['id'], 'NONSSL') . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a></td>' .
+                   '  </tr>' ;
+
+    
+  }
+//build box  
+?>
+ <tr>
+<td valign="top" width="100%">
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+ <?php
+ 
+ 
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+ new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+?>
+  
+    <table width="100%" border="0" cellspacing="0" cellpadding="0">
+       <tr>
+       <td cellpadding="0" align="left"  width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" height="1"></td>
+          <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+            <tr>
+              <td class ="templateinfobox"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                       <tr>
+                        <td class= "boxText">
+                         <table width="100%"  border="0" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB ;?>">
+      
+<?php       
+     echo $featured_string1a;
+  ?>            
+                       
+                       </tr>
+                     </table></td>  
+                   </tr>
+               </table></td> 
+            </tr> 
+         </table></td> 
+  <td cellpadding="0" cellspacing="0" align="left" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" height="1"></td>
+      </tr>
+  </table></td>    
+  </tr>
+</table>
+
+<?php 
+////// footer here  
+  if($num) {
+      new contentBox($info_box_contents);
+  $info_box_contents = array();
+if (MAIN_TABLE_BORDER == 'yes'){
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+}
+ }
+?>

Added: trunk/direct.openmoko.com/includes/modules/link_listing.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/link_listing.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/link_listing.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,139 @@
+<?php
+/*
+  $Id: link_listing.php,v 1.1.1.1 2004/03/04 23:41:10 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class linkListingBox extends tableBox {
+    function linkListingBox($contents) {
+      $this->table_parameters = 'class="linkListing"';
+      $this->tableBox($contents, true);
+    }
+  }
+
+  $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'l.links_id');
+
+  if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_LINKS); ?></td>
+    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+  </tr>
+</table>
+<?php
+  }
+
+  $list_box_contents = array();
+
+  for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
+    switch ($column_list[$col]) {
+      case 'LINK_LIST_TITLE':
+        $lc_text = TABLE_HEADING_LINKS_TITLE;
+        $lc_align = '';
+        break;
+      case 'LINK_LIST_URL':
+        $lc_text = TABLE_HEADING_LINKS_URL;
+        $lc_align = '';
+        break;
+      case 'LINK_LIST_IMAGE':
+        $lc_text = TABLE_HEADING_LINKS_IMAGE;
+        $lc_align = 'center';
+        break;
+      case 'LINK_LIST_DESCRIPTION':
+        $lc_text = TABLE_HEADING_LINKS_DESCRIPTION;
+        $lc_align = 'center';
+        break;
+      case 'LINK_LIST_COUNT':
+        $lc_text = TABLE_HEADING_LINKS_COUNT;
+        $lc_align = '';
+        break;
+    }
+
+    if ($column_list[$col] != 'LINK_LIST_IMAGE') {
+      $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
+    }
+
+    $list_box_contents[0][] = array('align' => $lc_align,
+                                    'params' => 'class="linkListing-heading"',
+                                    'text' => '&nbsp;' . $lc_text . '&nbsp;');
+  }
+
+  if ($listing_split->number_of_rows > 0) {
+    $rows = 0;
+    $listing_query = tep_db_query($listing_split->sql_query);
+    while ($listing = tep_db_fetch_array($listing_query)) {
+      $rows++;
+
+      if (($rows/2) == floor($rows/2)) {
+        $list_box_contents[] = array('params' => 'class="linkListing-even"');
+      } else {
+        $list_box_contents[] = array('params' => 'class="linkListing-odd"');
+      }
+
+      $cur_row = sizeof($list_box_contents) - 1;
+
+      for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
+        $lc_align = '';
+
+        switch ($column_list[$col]) {
+          case 'LINK_LIST_TITLE':
+            $lc_align = '';
+            $lc_text = $listing['links_title'];
+            break;
+          case 'LINK_LIST_URL':
+            $lc_align = '';
+            $lc_text = '<a href="' . tep_get_links_url($listing['links_id']) . '" target="_blank">' . $listing['links_url'] . '</a>';
+            break;
+          case 'LINK_LIST_DESCRIPTION':
+            $lc_align = '';
+            $lc_text = $listing['links_description'];
+            break;
+          case 'LINK_LIST_IMAGE':
+            $lc_align = 'center';
+            if (tep_not_null($listing['links_image_url'])) {
+              $lc_text = '<a href="' . tep_get_links_url($listing['links_id']) . '" target="_blank">' . tep_links_image($listing['links_image_url'], $listing['links_title'], LINKS_IMAGE_WIDTH, LINKS_IMAGE_HEIGHT) . '</a>';
+            } else {
+              $lc_text = '<a href="' . tep_get_links_url($listing['links_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . 'no_picture.gif', $listing['links_title'], LINKS_IMAGE_WIDTH, LINKS_IMAGE_HEIGHT) . '</a>';
+            }
+            break;
+          case 'LINK_LIST_COUNT':
+            $lc_align = '';
+            $lc_text = $listing['links_clicked'];
+            break;
+        }
+
+        $list_box_contents[$cur_row][] = array('align' => $lc_align,
+                                               'params' => 'class="linkListing-data"',
+                                               'text'  => $lc_text);
+      }
+    }
+
+    new linkListingBox($list_box_contents);
+  } else {
+    $list_box_contents = array();
+
+    $list_box_contents[0] = array('params' => 'class="linkListing-odd"');
+    $list_box_contents[0][] = array('params' => 'class="linkListing-data"',
+                                   'text' => TEXT_NO_LINKS);
+
+    new linkListingBox($list_box_contents);
+  }
+
+  if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_LINKS); ?></td>
+    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+  </tr>
+</table>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: mainpage.php,v 2.1 2004/04/07
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+  to change the contents of this file edit
+  includes/languages/(language)/mainpage.php
+*/
+?>
+<!-- D Main_page //-->
+
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, HEADING_TITLE);
+}
+// EOF: Lango Added for template MOD
+
+
+include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE);
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<!-- Main_page eof //-->

Added: trunk/direct.openmoko.com/includes/modules/new_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/new_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/new_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: new_products.php,v 1.1.1.1 2004/03/04 23:41:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- D mainpages_modules.new_products.php//-->
+<?php
+
+//Eversun mod for sppc and qty price breaks
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
+
+  
+      $new_products_query = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                          p.products_image 
+                          from (" . TABLE_PRODUCTS . " p 
+                         left join " . TABLE_SPECIALS . " s using(products_id)),
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd
+                        where 
+                        p.products_status = '1' 
+                       and pd.products_id = p.products_id
+                       and pd.language_id = '" . $languages_id . "' 
+                       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+                       order by rand(), p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
+
+  
+
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($new_products = tep_db_fetch_array($new_products_query)) {
+  
+    $num ++;
+      if ($num == 1) { 
+  new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_PRODUCTS_NEW));
+      }
+
+  $pf->loadProduct($new_products['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+
+  
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $products_price_s);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+  $info_box_contents = array();
+if (MAIN_TABLE_BORDER == 'yes'){
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+}
+ }
+?>
+<!-- new_products_eof //-->

Added: trunk/direct.openmoko.com/includes/modules/order_total/ot_coupon.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/order_total/ot_coupon.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/order_total/ot_coupon.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,597 @@
+<?php
+/*
+  $Id: ot_coupon.php,v 1.4 2004/03/09 17:56:06 ccwjr Exp $
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+class ot_coupon {
+var $title, $output;
+
+function ot_coupon() {
+
+  $this->code = 'ot_coupon';
+  $this->header = MODULE_ORDER_TOTAL_COUPON_HEADER;
+  $this->title = MODULE_ORDER_TOTAL_COUPON_TITLE;
+  $this->description = MODULE_ORDER_TOTAL_COUPON_DESCRIPTION;
+  $this->user_prompt = '';
+  $this->enabled = MODULE_ORDER_TOTAL_COUPON_STATUS;
+  $this->sort_order = MODULE_ORDER_TOTAL_COUPON_SORT_ORDER;
+  $this->include_shipping = MODULE_ORDER_TOTAL_COUPON_INC_SHIPPING;
+  $this->include_tax = MODULE_ORDER_TOTAL_COUPON_INC_TAX;
+  $this->calculate_tax = MODULE_ORDER_TOTAL_COUPON_CALC_TAX;
+  $this->tax_class = MODULE_ORDER_TOTAL_COUPON_TAX_CLASS;
+  $this->credit_class = true;
+  $this->output = array();
+
+}
+
+function process() {
+global $PHP_SELF, $order, $currencies, $cc_id;
+
+  $order_total=$this->get_order_total();
+  $od_amount = $this->calculate_credit($order_total);
+  $tod_amount = 0.0; //Fred
+  $this->deduction = $od_amount;
+  if ($this->calculate_tax != 'None') { //Fred - changed from 'none' to 'None'!
+    $tod_amount = $this->calculate_tax_deduction($order_total, $this->deduction, $this->calculate_tax);
+  }
+
+  if ($od_amount > 0) {
+    $order->info['total'] = $order->info['total'] - $od_amount;
+    $this->output[] = array('title' => $this->title . ':' . $this->coupon_code .':','text' => '<b>-' . $currencies->format($od_amount) . '</b>', 'value' => $od_amount); //Fred added hyphen
+  }
+}
+
+function selection_test() {
+  return false;
+}
+
+
+function pre_confirmation_check($order_total) {
+global $customer_id;
+  return $this->calculate_credit($order_total);
+}
+
+function use_credit_amount() {
+  return $output_string;
+}
+
+/*
+function credit_selection() {
+global $customer_id, $currencies, $language;
+  $selection_string = '';
+  $selection_string .= '<tr>' . "\n";
+  $selection_string .= ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>';
+  $selection_string .= ' <td class="main">' . "\n";
+  $image_submit = '<input type="image" name="submit_redeem" onClick="submitFunction()" src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/button_redeem.gif" border="0" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">';
+  $selection_string .= TEXT_ENTER_COUPON_CODE . tep_draw_input_field('gv_redeem_code') . '</td>';
+  $selection_string .= ' <td align="right">' . $image_submit . '</td>';
+  $selection_string .= ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';
+  $selection_string .= '</tr>' . "\n";
+  return $selection_string;
+}
+*/
+function credit_selection() {
+global $customer_id, $currencies, $language;
+  $selection_string2 = '';
+  $selection_string2 .= '<tr>' . "\n";
+  $selection_string2 .= '<td class="main">' . "\n";
+        $selection_string2 .= TEXT_ENTER_GV_CODE . tep_draw_input_field('gv_redeem_code') . ' and click ';
+  $image_submit2 = '<input type="image" name="submit_redeem" onClick="submitFunction()" src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/button_redeem.gif" border="0" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">';
+  $selection_string2 .= ' </td><td align="right">' . $image_submit2 . '</td>';
+  $selection_string2 .= '</tr>' . "\n";
+        return $selection_string2;
+}
+
+function collect_posts() {
+global $HTTP_POST_VARS, $customer_id, $currencies, $cc_id;
+  if ($HTTP_POST_VARS['gv_redeem_code']) {
+
+// get some info from the coupon table
+  $coupon_query=tep_db_query("select coupon_id, coupon_amount, coupon_type, coupon_minimum_order,uses_per_coupon, uses_per_user, restrict_to_products,restrict_to_categories from " . TABLE_COUPONS . " where coupon_code='".tep_db_input($HTTP_POST_VARS['gv_redeem_code'])."' and coupon_active='Y'");
+  $coupon_result=tep_db_fetch_array($coupon_query);
+
+  if ($coupon_result['coupon_type'] != 'G') {
+
+    if (tep_db_num_rows($coupon_query)==0) {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_NO_INVALID_REDEEM_COUPON), 'SSL'));
+    }
+
+    $date_query=tep_db_query("select coupon_start_date from " . TABLE_COUPONS . " where coupon_start_date <= now() and coupon_code='".tep_db_input($HTTP_POST_VARS['gv_redeem_code'])."'");
+
+    if (tep_db_num_rows($date_query)==0) {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_INVALID_STARTDATE_COUPON), 'SSL'));
+  }
+
+    $date_query=tep_db_query("select coupon_expire_date from " . TABLE_COUPONS . " where coupon_expire_date >= now() and coupon_code='".tep_db_input($HTTP_POST_VARS['gv_redeem_code'])."'");
+
+    if (tep_db_num_rows($date_query)==0) {
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_INVALID_FINISDATE_COUPON), 'SSL'));
+    }
+
+    $coupon_count = tep_db_query("select coupon_id from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $coupon_result['coupon_id']."'");
+    $coupon_count_customer = tep_db_query("select coupon_id from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $coupon_result['coupon_id']."' and customer_id = '" . $customer_id . "'");
+
+    if (tep_db_num_rows($coupon_count)>=$coupon_result['uses_per_coupon'] && $coupon_result['uses_per_coupon'] > 0) {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_INVALID_USES_COUPON . $coupon_result['uses_per_coupon'] . TIMES ), 'SSL'));
+  }
+
+    if (tep_db_num_rows($coupon_count_customer)>=$coupon_result['uses_per_user'] && $coupon_result['uses_per_user'] > 0) {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_INVALID_USES_USER_COUPON . $coupon_result['uses_per_user'] . TIMES ), 'SSL'));
+  }
+
+/*
+    if ($coupon_result['coupon_type']=='S') {
+      $coupon_amount = $order->info['shipping_cost'];
+    } else {
+      $coupon_amount = $currencies->format($coupon_result['coupon_amount']) . ' ';
+    }
+    if ($coupon_result['coupon_type']=='P') $coupon_amount = $coupon_result['coupon_amount'] . '% ';
+    if ($coupon_result['coupon_minimum_order']>0) $coupon_amount .= 'on orders greater than ' . $coupon_result['coupon_minimum_order'];
+    if (!tep_session_is_registered('cc_id')) tep_session_register('cc_id'); //Fred - this was commented out before
+    $cc_id = $coupon_result['coupon_id']; //Fred ADDED, set the global and session variable
+                tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_REDEEMED_AMOUNT), 'SSL')); // Added in v5.13a by Rigadin
+*/
+                global $order,$ot_coupon,$currency,$cc_id;
+
+                if (!tep_session_is_registered('cc_id')) tep_session_register('cc_id');
+                $cc_id = $coupon_result['coupon_id'];
+
+                $coupon_amount= tep_round($ot_coupon->pre_confirmation_check($order->info['subtotal']), $currencies->currencies[$currency]['decimal_places']); // $cc_id
+
+/* you will need to uncomment this if your tax order total module is AFTER shipping eg you have all of your tax, including tax from shipping module, in your tax total.
+                if ($coupon_result['coupon_type']=='S')  {
+                        //if not zero rated add vat to shipping
+                        $coupon_amount = tep_add_tax($coupon_amount, '17.5');
+                }
+*/
+                $coupon_amount_out = $currencies->format($coupon_amount) . ' ';
+                if ($coupon_result['coupon_minimum_order']>0) $coupon_amount_out .= 'on orders greater than ' . $currencies->format($coupon_result['coupon_minimum_order']);
+
+                if ( strlen($cc_id) > 0 && $coupon_amount == 0 ) {
+                        $err_msg = ERROR_REDEEMED_AMOUNT_ZERO;
+                } else {
+                        $err_msg = ERROR_REDEEMED_AMOUNT.$coupon_amount_out;
+                }
+                tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode($err_msg), 'SSL'));
+//**si** 09-11-05 end
+
+                // $_SESSION['cc_id'] = $coupon_result['coupon_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead.
+          } // ENDIF valid coupon code
+        } // ENDIF code entered 
+        // v5.13a If no code entered and coupon redeem button pressed, give an alarm
+        if ($HTTP_POST_VARS['submit_redeem_coupon_x']) tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_NO_REDEEM_CODE), 'SSL'));
+}
+
+function calculate_credit($amount) {
+  global $customer_id, $order, $cc_id;
+  //$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead.
+  $od_amount = 0;
+  if (isset($cc_id) ) {
+    $coupon_query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'");
+    if (tep_db_num_rows($coupon_query) !=0 ) {
+      $coupon_result = tep_db_fetch_array($coupon_query);
+      $this->coupon_code = $coupon_result['coupon_code'];
+      $coupon_get = tep_db_query("select coupon_amount, coupon_minimum_order, restrict_to_products, restrict_to_categories, coupon_type from " . TABLE_COUPONS ." where coupon_code = '". $coupon_result['coupon_code'] . "'");
+      $get_result = tep_db_fetch_array($coupon_get);
+      $c_deduct = $get_result['coupon_amount'];
+      if ($get_result['coupon_type']=='S') $c_deduct = $order->info['shipping_cost'];
+      //v5.14 id coupon total > 0
+      if ($get_result['coupon_type']=='S') $c_deduct = $order->info['shipping_cost'];
+      if ($get_result['coupon_type']=='S' && $get_result['coupon_amount'] > 0 ) $c_deduct = $order->info['shipping_cost'] + $get_result['coupon_amount'];
+      if ($get_result['coupon_minimum_order'] <= $this->get_order_total()) {
+        if ($get_result['restrict_to_products'] || $get_result['restrict_to_categories']) {
+          for ($i=0; $i < sizeof($order->products); $i++) {
+            if ($get_result['restrict_to_products']) {
+              $pr_ids = split("[,]", $get_result['restrict_to_products']);
+              for ($ii = 0; $ii < count($pr_ids); $ii++) {
+                if ($pr_ids[$ii] == tep_get_prid($order->products[$i]['id'])) {
+                  if ($get_result['coupon_type'] == 'P') {
+                    /* Fixes to Gift Voucher module 5.03
+                    =================================
+                    Submitted by Rob Cote, robc at traininghott.com
+                    original code:
+                                        $od_amount = round($amount*10)/10*$c_deduct/100;
+                    $pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty'];
+                    $pod_amount = round($pr_c*10)/10*$c_deduct/100;
+                    */
+                     //$pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty'];
+                    
+                    $pr_c = $this->product_price($pr_ids[$ii]); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT!
+                    $pod_amount = round($pr_c*10)/10*$c_deduct/100;
+                     $od_amount = $od_amount + $pod_amount;
+                  } else {
+                    $od_amount = $c_deduct;
+                  }
+                }
+              }
+            } else {
+              $cat_ids = split("[,]", $get_result['restrict_to_categories']);
+              for ($i=0; $i < sizeof($order->products); $i++) {
+                $my_path = tep_get_product_path(tep_get_prid($order->products[$i]['id']));
+                $sub_cat_ids = split("[_]", $my_path);
+                for ($iii = 0; $iii < count($sub_cat_ids); $iii++) {
+                  for ($ii = 0; $ii < count($cat_ids); $ii++) {
+                    if ($sub_cat_ids[$iii] == $cat_ids[$ii]) {
+                      if ($get_result['coupon_type'] == 'P') {
+                        /* Category Restriction Fix to Gift Voucher module 5.04
+                        Date: August 3, 2003
+                        =================================
+                        Nick Stanko of UkiDev.com, nick at ukidev.com
+                        original code:
+                        $od_amount = round($amount*10)/10*$c_deduct/100;
+                        $pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty'];
+                        $pod_amount = round($pr_c*10)/10*$c_deduct/100;
+                        */
+                        //$od_amount = round($amount*10)/10*$c_deduct/100;
+                        //$pr_c = $order->products[$i]['final_price']*$order->products[$i]['qty'];
+                                                
+                        $pr_c = $this->product_price(tep_get_prid($order->products[$i]['id'])); //Fred 2003-10-28, fix for the row above, otherwise the discount is calc based on price excl VAT!
+                        $pod_amount = round($pr_c*10)/10*$c_deduct/100;
+                        $od_amount = $od_amount + $pod_amount;
+                        continue 3;      // v5.13a Tanaka 2005-4-30: to prevent double counting of a product discount
+                      } else {
+                        $od_amount = $c_deduct;
+                        continue 3;      // Tanaka 2005-4-30: to prevent double counting of a product discount
+                      }
+                    }
+                  }
+                }
+              }
+            } //endif $get_result['restrict_to_products']
+                } //end for sizeof($order->products)
+        } else {
+          if ($get_result['coupon_type'] !='P') {
+            $od_amount = $c_deduct;
+          } else {
+            $od_amount = $amount * $get_result['coupon_amount'] / 100;
+          }
+        } 
+      }
+    }
+    if ($od_amount>$amount) $od_amount = $amount;
+  }
+  return $od_amount;
+}
+
+function calculate_tax_deduction($amount, $od_amount, $method) {
+global $customer_id, $order, $cc_id, $cart;
+//$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead.
+  $coupon_query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'");
+  if (tep_db_num_rows($coupon_query) !=0 ) {
+    $coupon_result = tep_db_fetch_array($coupon_query);
+    $coupon_get = tep_db_query("select coupon_amount, coupon_minimum_order, restrict_to_products, restrict_to_categories, coupon_type from " . TABLE_COUPONS . " where coupon_code = '". $coupon_result['coupon_code'] . "'");
+    $get_result = tep_db_fetch_array($coupon_get);
+    if ($get_result['coupon_type'] != 'S') {
+
+      //RESTRICTION--------------------------------
+      if ($get_result['restrict_to_products'] || $get_result['restrict_to_categories']) {
+        // What to do here.
+        // Loop through all products and build a list of all product_ids, price, tax class
+        // at the same time create total net amount.
+        // then
+        // for percentage discounts. simply reduce tax group per product by discount percentage
+        // or
+        // for fixed payment amount
+        // calculate ratio based on total net
+        // for each product reduce tax group per product by ratio amount.
+        $products = $cart->get_products();
+        $valid_product = false;
+        for ($i=0; $i < sizeof($products); $i++) {
+        $valid_product = false;
+          $t_prid = tep_get_prid($products[$i]['id']);
+          $cc_query = tep_db_query("select products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");
+          $cc_result = tep_db_fetch_array($cc_query);
+          if ($get_result['restrict_to_products']) {
+            $pr_ids = split("[,]", $get_result['restrict_to_products']);
+            for ($p = 0; $p < sizeof($pr_ids); $p++) {
+              if ($pr_ids[$p] == $t_prid) $valid_product = true;
+            }
+          }
+          if ($get_result['restrict_to_categories']) {
+                        // Tanaka 2005-4-30:  Original Code
+                        /*$cat_ids = split("[,]", $get_result['restrict_to_categories']);
+                        for ($c = 0; $c < sizeof($cat_ids); $c++) {
+                            // Tanaka 2005-4-30:  changed $products_id to $t_prid and changed $i to $c
+                            $cat_query = tep_db_query("select products_id from products_to_categories where products_id = '" . $t_prid . "' and categories_id = '" . $cat_ids[$c] . "'");
+                            if (tep_db_num_rows($cat_query) !=0 ) $valid_product = true;
+                        }*/
+                        // v5.13a Tanaka 2005-4-30:  New code, this correctly identifies valid products in subcategories
+                        $cat_ids = split("[,]", $get_result['restrict_to_categories']);
+                        $my_path = tep_get_product_path($t_prid);
+                        $sub_cat_ids = split("[_]", $my_path);
+                        for ($iii = 0; $iii < count($sub_cat_ids); $iii++) {
+                            for ($ii = 0; $ii < count($cat_ids); $ii++) {
+                                if ($sub_cat_ids[$iii] == $cat_ids[$ii]) {
+                                    $valid_product = true;
+                                    continue 2;
+                                }
+                            }
+                        }
+          }
+          if ($valid_product) {
+            $price_excl_vat = $products[$i]['final_price'] * $products[$i]['quantity']; //Fred - added
+            $price_incl_vat = $this->product_price($t_prid); //Fred - added
+            $valid_array[] = array('product_id' => $t_prid, 'products_price' => $price_excl_vat, 'products_tax_class' => $cc_result['products_tax_class_id']); //jason //Fred - changed from $products[$i]['final_price'] 'products_tax_class' => $cc_result['products_tax_class_id']);
+//            $total_price += $price_incl_vat; //Fred - changed
+            $total_price += $price_excl_vat; // changed
+          }
+        }
+        if (sizeof($valid_array) > 0) { // if ($valid_product) {
+          if ($get_result['coupon_type'] == 'P') {
+            $ratio = $get_result['coupon_amount']/100;
+          } else {
+            $ratio = $od_amount / $total_price;
+          }
+          if ($get_result['coupon_type'] == 'S') $ratio = 1;
+          if ($method=='Credit Note') {
+            $tax_rate = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+            $tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+            if ($get_result['coupon_type'] == 'P') {
+              $tod_amount = $od_amount / (100 + $tax_rate)* $tax_rate;
+            } else {
+              $tod_amount = $order->info['tax_groups'][$tax_desc] * $od_amount/100;
+            }
+            $order->info['tax_groups'][$tax_desc] -= $tod_amount;
+            $order->info['total'] -= $tod_amount; //  need to modify total ...OLD
+            $order->info['tax'] -= $tod_amount; //Fred - added
+          } else {
+            for ($p=0; $p<sizeof($valid_array); $p++) {
+              $tax_rate = tep_get_tax_rate($valid_array[$p]['products_tax_class'], $order->delivery['country']['id'], $order->delivery['zone_id']);
+              $tax_desc = tep_get_tax_description($valid_array[$p]['products_tax_class'], $order->delivery['country']['id'], $order->delivery['zone_id']);
+              if ($tax_rate > 0) {
+                //Fred $tod_amount[$tax_desc] += ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; //OLD
+                $tod_amount = ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; // calc total tax Fred - added
+                $order->info['tax_groups'][$tax_desc] -= ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio;
+                $order->info['total'] -= ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; // adjust total
+                $order->info['tax'] -= ($valid_array[$p]['products_price'] * $tax_rate)/100 * $ratio; // adjust tax -- Fred - added
+              }
+            }
+          }
+        }
+        //NO RESTRICTION--------------------------------
+      } else {
+        if ($get_result['coupon_type'] =='F') {
+          $tod_amount = 0;
+          if ($method=='Credit Note') {
+            $tax_rate = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+            $tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+            $tod_amount = $od_amount / (100 + $tax_rate)* $tax_rate;
+            $order->info['tax_groups'][$tax_desc] -= $tod_amount;
+          } else {
+//            $ratio1 = $od_amount/$amount;   // this produces the wrong ratipo on fixed amounts
+            reset($order->info['tax_groups']);
+            while (list($key, $value) = each($order->info['tax_groups'])) {
+              $ratio1 = $od_amount/($amount-$order->info['tax_groups'][$key]); ////debug
+              $tax_rate = tep_get_tax_rate_from_desc($key);
+              $net = $tax_rate * $order->info['tax_groups'][$key];
+              if ($net>0) {
+                $god_amount = $order->info['tax_groups'][$key] * $ratio1;
+                $tod_amount += $god_amount;
+                $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
+              }
+            }
+          }
+          $order->info['total'] -= $tod_amount; //OLD
+          $order->info['tax'] -= $tod_amount; //Fred - added
+      }
+      if ($get_result['coupon_type'] =='P') {
+        $tod_amount=0;
+        if ($method=='Credit Note') {
+          $tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+          $tod_amount = $order->info['tax_groups'][$tax_desc] * $od_amount/100;
+          $order->info['tax_groups'][$tax_desc] -= $tod_amount;
+        } else {
+          reset($order->info['tax_groups']);
+          while (list($key, $value) = each($order->info['tax_groups'])) {
+            $god_amount=0;
+            $tax_rate = tep_get_tax_rate_from_desc($key);
+            $net = $tax_rate * $order->info['tax_groups'][$key];
+            if ($net>0) {
+              $god_amount = $order->info['tax_groups'][$key] * $get_result['coupon_amount']/100;
+              $tod_amount += $god_amount;
+              $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
+            }
+          }
+        }
+        $order->info['total'] -= $tod_amount; // have to modify total also
+        $order->info['tax'] -= $tod_amount;
+      }
+    }
+  }
+}
+return $tod_amount;
+}
+
+function update_credit_account($i) {
+  return false;
+}
+
+function apply_credit() {
+global $insert_id, $customer_id, $REMOTE_ADDR, $cc_id;
+  //$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead.
+  if ($this->deduction !=0) {
+    tep_db_query("insert into " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, redeem_date, redeem_ip, customer_id, order_id) values ('" . $cc_id . "', now(), '" . $REMOTE_ADDR . "', '" . $customer_id . "', '" . $insert_id . "')");
+  }
+  tep_session_unregister('cc_id');
+}
+
+function get_order_total() {
+global $order, $cart, $customer_id, $cc_id;
+  //$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead.
+  $order_total = $order->info['total'];
+  // Check if gift voucher is in cart and adjust total
+  $products = $cart->get_products();
+  for ($i=0; $i<sizeof($products); $i++) {
+    $t_prid = tep_get_prid($products[$i]['id']);
+    $gv_query = tep_db_query("select products_price, products_tax_class_id, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");
+    $gv_result = tep_db_fetch_array($gv_query);
+    if (ereg('^GIFT', addslashes($gv_result['products_model']))) {
+      $qty = $cart->get_quantity($t_prid);
+      $products_tax = tep_get_tax_rate($gv_result['products_tax_class_id']);
+      if ($this->include_tax =='false') {
+        $gv_amount = $gv_result['products_price'] * $qty;
+      } else {
+        $gv_amount = ($gv_result['products_price'] + tep_calculate_tax($gv_result['products_price'],$products_tax)) * $qty;
+      }
+      $order_total=$order_total - $gv_amount;
+    }
+  }
+  if ($this->include_tax == 'false') $order_total=$order_total-$order->info['tax'];
+  if ($this->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost'];
+  // OK thats fine for global coupons but what about restricted coupons
+  // where you can only redeem against certain products/categories.
+  // and I though this was going to be easy !!!
+  $coupon_query=tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_id='".$cc_id."'");
+  if (tep_db_num_rows($coupon_query) !=0) {
+    $coupon_result=tep_db_fetch_array($coupon_query);
+    $coupon_get=tep_db_query("select coupon_amount, coupon_minimum_order,restrict_to_products,restrict_to_categories, coupon_type from " . TABLE_COUPONS . " where coupon_code='".$coupon_result['coupon_code']."'");
+    $get_result=tep_db_fetch_array($coupon_get);
+    $in_cat = true;
+    if ($get_result['restrict_to_categories']) {
+      $cat_ids = split("[,]", $get_result['restrict_to_categories']);
+      $in_cat=false;
+      for ($i = 0; $i < count($cat_ids); $i++) {
+        if (is_array($this->contents)) {
+          reset($this->contents);
+          while (list($products_id, ) = each($this->contents)) {
+            $cat_query = tep_db_query("select products_id from products_to_categories where products_id = '" . $products_id . "' and categories_id = '" . $cat_ids[$i] . "'");
+            if (tep_db_num_rows($cat_query) !=0 ) {
+              $in_cat = true;
+              $total_price += $this->get_product_price($products_id);
+            }
+          }
+        }
+      }
+    }
+    $in_cart = true;
+    if ($get_result['restrict_to_products']) {
+
+      $pr_ids = split("[,]", $get_result['restrict_to_products']);
+
+      $in_cart=false;
+      $products_array = $cart->get_products();
+
+      for ($i = 0; $i < sizeof($pr_ids); $i++) {
+        for ($ii = 1; $ii<=sizeof($products_array); $ii++) {
+          if (tep_get_prid($products_array[$ii-1]['id']) == $pr_ids[$i]) {
+            $in_cart=true;
+            $total_price += $this->get_product_price($products_array[$ii-1]['id']);
+          }
+        }
+      }
+      $order_total = $total_price;
+    }
+  }
+return $order_total;
+}
+
+function get_product_price($product_id) {
+global $cart, $order;
+  $products_id = tep_get_prid($product_id);
+  // products price
+  $qty = $cart->contents[$product_id]['qty'];
+  $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id='" . $product_id . "'");
+  if ($product = tep_db_fetch_array($product_query)) {
+    $prid = $product['products_id'];
+    $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
+    $products_price = $product['products_price'];
+    $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $prid . "' and status = '1'");
+    if (tep_db_num_rows ($specials_query)) {
+      $specials = tep_db_fetch_array($specials_query);
+      $products_price = $specials['specials_new_products_price'];
+    }
+    if ($this->include_tax == 'true') {
+      $total_price += ($products_price + tep_calculate_tax($products_price, $products_tax)) * $qty;
+    } else {
+      $total_price += $products_price * $qty;
+    }
+
+    // attributes price
+    if (isset($cart->contents[$product_id]['attributes'])) {
+      reset($cart->contents[$product_id]['attributes']);
+      while (list($option, $value) = each($cart->contents[$product_id]['attributes'])) {
+        $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $prid . "' and options_id = '" . $option . "' and options_values_id = '" . $value . "'");
+        $attribute_price = tep_db_fetch_array($attribute_price_query);
+        if ($attribute_price['price_prefix'] == '+') {
+          if ($this->include_tax == 'true') {
+            $total_price += $qty * ($attribute_price['options_values_price'] + tep_calculate_tax($attribute_price['options_values_price'], $products_tax));
+          } else {
+            $total_price += $qty * ($attribute_price['options_values_price']);
+          }
+        } else {
+          if ($this->include_tax == 'true') {
+            $total_price -= $qty * ($attribute_price['options_values_price'] + tep_calculate_tax($attribute_price['options_values_price'], $products_tax));
+          } else {
+            $total_price -= $qty * ($attribute_price['options_values_price']);
+          }
+        }
+      }
+    }
+  }
+  if ($this->include_shipping == 'true') {
+
+    $total_price += $order->info['shipping_cost'];
+  }
+  return $total_price;
+}
+
+//Added by Fred -- BOF -----------------------------------------------------
+//JUST RETURN THE PRODUCT PRICE (INCL ATTRIBUTE PRICES) WITH OR WITHOUT TAX
+function product_price($product_id) {
+  $total_price = $this->get_product_price($product_id);
+  if ($this->include_shipping == 'true') $total_price -= $order->info['shipping_cost'];
+  return $total_price;
+}
+//Added by Fred -- EOF -----------------------------------------------------
+
+// START added by Rigadin in v5.13, needed to show module errors on checkout_payment page
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+
+function check() {
+  if (!isset($this->check)) {
+    $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_COUPON_STATUS'");
+    $this->check = tep_db_num_rows($check_query);
+  }
+
+  return $this->check;
+}
+
+function keys() {
+  return array('MODULE_ORDER_TOTAL_COUPON_STATUS', 'MODULE_ORDER_TOTAL_COUPON_SORT_ORDER', 'MODULE_ORDER_TOTAL_COUPON_INC_SHIPPING', 'MODULE_ORDER_TOTAL_COUPON_INC_TAX', 'MODULE_ORDER_TOTAL_COUPON_CALC_TAX', 'MODULE_ORDER_TOTAL_COUPON_TAX_CLASS');
+}
+
+function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Total', 'MODULE_ORDER_TOTAL_COUPON_STATUS', 'true', 'Do you want to display the Discount Coupon value?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_COUPON_SORT_ORDER', '9', 'Sort order of display.', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Shipping', 'MODULE_ORDER_TOTAL_COUPON_INC_SHIPPING', 'true', 'Include Shipping in calculation', '6', '5', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Tax', 'MODULE_ORDER_TOTAL_COUPON_INC_TAX', 'true', 'Include Tax in calculation.', '6', '6','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Re-calculate Tax', 'MODULE_ORDER_TOTAL_COUPON_CALC_TAX', 'None', 'Re-Calculate Tax', '6', '7','tep_cfg_select_option(array(\'None\', \'Standard\', \'Credit Note\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_ORDER_TOTAL_COUPON_TAX_CLASS', '0', 'Use the following tax class when treating Discount Coupon as Credit Note.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+}
+
+function remove() {
+  $keys = '';
+  $keys_array = $this->keys();
+  for ($i=0; $i<sizeof($keys_array); $i++) {
+    $keys .= "'" . $keys_array[$i] . "',";
+  }
+  $keys = substr($keys, 0, -1);
+
+  tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
+  }
+}
+?>

Added: trunk/direct.openmoko.com/includes/modules/order_total/ot_gv.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/order_total/ot_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/order_total/ot_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,331 @@
+<?php
+/*
+  $Id: ot_gv.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ot_gv {
+    var $title, $output;
+
+    function ot_gv() {
+      $this->code = 'ot_gv';
+      $this->title = MODULE_ORDER_TOTAL_GV_TITLE;
+      $this->header = MODULE_ORDER_TOTAL_GV_HEADER;
+      $this->description = MODULE_ORDER_TOTAL_GV_DESCRIPTION;
+      $this->user_prompt = MODULE_ORDER_TOTAL_GV_USER_PROMPT;
+      $this->enabled = MODULE_ORDER_TOTAL_GV_STATUS;
+      $this->sort_order = MODULE_ORDER_TOTAL_GV_SORT_ORDER;
+      $this->include_shipping = MODULE_ORDER_TOTAL_GV_INC_SHIPPING;
+      $this->include_tax = MODULE_ORDER_TOTAL_GV_INC_TAX;
+      $this->calculate_tax = MODULE_ORDER_TOTAL_GV_CALC_TAX;
+      $this->credit_tax = MODULE_ORDER_TOTAL_GV_CREDIT_TAX;
+      $this->tax_class  = MODULE_ORDER_TOTAL_GV_TAX_CLASS;
+      $this->show_redeem_box = MODULE_ORDER_TOTAL_GV_REDEEM_BOX;
+      $this->credit_class = true;
+      $this->checkbox = $this->user_prompt . '<input type="checkbox" onClick="submitFunction()" name="' . 'c' . $this->code . '">';
+      $this->output = array();
+    }
+
+    function process() {
+       global $order, $currencies, $cot_gv;
+//       if ($_SESSION['cot_gv']) {  // old code Strider
+        if (tep_session_is_registered('cot_gv')) {
+        $order_total = $this->get_order_total();
+        $od_amount = $this->calculate_credit($order_total);
+        if ($this->calculate_tax != "None") {
+      //  if ($this->calculate_tax != "none") {
+          $tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax);
+          $od_amount = $this->calculate_credit($order_total);
+        }
+        $this->deduction = $od_amount;
+//        if (($this->calculate_tax == "Credit Note") && (DISPLAY_PRICE_WITH_TAX != 'true')) {
+//          $od_amount -= $tod_amount;
+//          $order->info['total'] -= $tod_amount;
+//        }
+        $order->info['total'] = $order->info['total'] - $od_amount;
+        if ($od_amount > 0) {
+          $this->output[] = array('title' => $this->title . ':',
+                           'text' => '<b>' . $currencies->format($od_amount) . '</b>',
+                           'value' => $od_amount);
+        }
+      }
+    }
+
+    function selection_test() {
+      global $customer_id;
+      if ($this->user_has_gv_account($customer_id)) {
+        return true;
+      } else {
+        return false;
+      }
+    }
+
+ function pre_confirmation_check($order_total) {
+    global $cot_gv, $order;
+//    if ($_SESSION['cot_gv']) {  // old code Strider
+      $od_amount = 0; // set the default amount we will send back
+      if (tep_session_is_registered('cot_gv')) {
+// pre confirmation check doesn't do a true order process. It just attempts to see if
+// there is enough to handle the order. But depending on settings it will not be shown
+// all of the order so this is why we do this runaround jane. What do we know so far.
+// nothing. Since we need to know if we process the full amount we need to call get order total
+// if there has been something before us then
+
+        if ($this->include_tax == 'false') {
+          $order_total = $order_total - $order->info['tax'];
+        }
+        if ($this->include_shipping == 'false') {
+          $order_total = $order_total - $order->info['shipping_cost'];
+        }
+        $od_amount = $this->calculate_credit($order_total);
+
+
+        if ($this->calculate_tax != "None") {
+          $tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax);
+          $od_amount = $this->calculate_credit($order_total)+$tod_amount;
+        }
+      }
+    return $od_amount;
+  }
+    // original code
+  /*function pre_confirmation_check($order_total) {
+      if ($SESSION['cot_gv']) {
+        $gv_payment_amount = $this->calculate_credit($order_total);
+      }
+      return $gv_payment_amount;
+    } */
+
+    function use_credit_amount() {
+    global $cot_gv;
+//    $_SESSION['cot_gv'] = false;     // old code - Strider
+      $cot_gv = false;
+      if ($this->selection_test()) {
+        $output_string .=  '<tr>   <td align="right" class="main">';
+        $output_string .= '<b>' . $this->checkbox . '</b>' . '</td> <td></td></tr>' . "\n";
+      }
+      return $output_string;
+    }
+
+    function update_credit_account($i) {
+      global $order, $customer_id, $insert_id, $REMOTE_ADDR;
+      if (ereg('^GIFT', addslashes($order->products[$i]['model']))) {
+        $gv_order_amount = ($order->products[$i]['final_price'] * $order->products[$i]['qty']);
+        if ($this->credit_tax=='true') $gv_order_amount = $gv_order_amount * (100 + $order->products[$i]['tax']) / 100;
+//        $gv_order_amount += 0.001;
+        $gv_order_amount = $gv_order_amount * 100 / 100;
+        if (MODULE_ORDER_TOTAL_GV_QUEUE == 'false') {
+          // GV_QUEUE is true so release amount to account immediately
+          $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+          $customer_gv = false;
+          $total_gv_amount = 0;
+          if ($gv_result = tep_db_fetch_array($gv_query)) {
+            $total_gv_amount = $gv_result['amount'];
+            $customer_gv = true;
+          }
+          $total_gv_amount = $total_gv_amount + $gv_order_amount;
+          if ($customer_gv) {
+            $gv_update=tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $total_gv_amount . "' where customer_id = '" . $customer_id . "'");
+          } else {
+            $gv_insert=tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $total_gv_amount . "')");
+          }
+        } else {
+         // GV_QUEUE is true - so queue the gv for release by store owner
+          $gv_insert=tep_db_query("insert into " . TABLE_COUPON_GV_QUEUE . " (customer_id, order_id, amount, date_created, ipaddr) values ('" . $customer_id . "', '" . $insert_id . "', '" . $gv_order_amount . "', NOW(), '" . $REMOTE_ADDR . "')");
+        }
+      }
+    }
+
+    function credit_selection() {
+      global $customer_id, $currencies, $language;
+      $selection_string1 = '';
+      $gv_query = tep_db_query("select coupon_id from " . TABLE_COUPONS . " where coupon_type = 'G' and coupon_active='Y'");
+  /*    if (tep_db_num_rows($gv_query)) {
+        $selection_string1 .= '<tr>' . "\n";
+        $selection_string1 .= '<td class="main">' . "\n";
+        $image_submit1 = '<input type="image" name="submit_redeem" onClick="submitFunction()" src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/button_redeem.gif" border="0" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">';
+        $selection_string1 .= TEXT_ENTER_GV_CODE . tep_draw_input_field('gv_redeem_code') . '</td>';
+        $selection_string1 .= '  <td align="right">' . $image_submit1 . '</td>';
+     $selection_string1 .= '</tr>' . "\n";
+      }
+     */    
+    return $selection_string1;
+    }
+
+    function apply_credit() {
+      global $order, $customer_id, $coupon_no, $cot_gv;
+      if (tep_session_is_registered('cot_gv')) {
+        $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+        $gv_result = tep_db_fetch_array($gv_query);
+        $gv_payment_amount = $this->deduction;
+        $gv_amount = $gv_result['amount'] - $gv_payment_amount;
+        $gv_update = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $gv_amount . "' where customer_id = '" . $customer_id . "'");
+      }
+      return $gv_payment_amount;
+    }
+
+    function collect_posts() {
+      global $currencies, $HTTP_POST_VARS, $customer_id, $coupon_no, $REMOTE_ADDR, $cot_gv;
+      if ($HTTP_POST_VARS['gv_redeem_code']) {
+        $gv_query = tep_db_query("select coupon_id, coupon_type, coupon_amount from " . TABLE_COUPONS . " where coupon_code = '" . tep_db_input($HTTP_POST_VARS['gv_redeem_code']) . "'");
+        $gv_result = tep_db_fetch_array($gv_query);
+        if (tep_db_num_rows($gv_query) != 0) {
+          $redeem_query = tep_db_query("select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $gv_result['coupon_id'] . "'");
+          if ( (tep_db_num_rows($redeem_query) != 0) && ($gv_result['coupon_type'] == 'G') ) {
+            tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_NO_INVALID_REDEEM_GV), 'SSL'));
+          //  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_INVALID_REDEEM_GV), 'SSL'));
+          }
+
+        }
+
+    elseif ($HTTP_POST_VARS['submit_redeem_x']) tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_NO_INVALID_REDEEM_GV), 'SSL'));
+   //   tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_INVALID_REDEEM_GV), 'SSL'));
+
+        if ($gv_result['coupon_type'] == 'G') {
+          $gv_amount = $gv_result['coupon_amount'];
+          // Things to set
+          // ip address of claimant
+          // customer id of claimant
+          // date
+          // redemption flag
+          // now update customer account with gv_amount
+          $gv_amount_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+          $customer_gv = false;
+          $total_gv_amount = $gv_amount;
+          if ($gv_amount_result = tep_db_fetch_array($gv_amount_query)) {
+            $total_gv_amount = $gv_amount_result['amount'] + $gv_amount;
+            $customer_gv = true;
+          }
+          $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $gv_result['coupon_id'] . "'");
+          $gv_redeem = tep_db_query("insert into  " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $gv_result['coupon_id'] . "', '" . $customer_id . "', now(),'" . $REMOTE_ADDR . "')");
+          if ($customer_gv) {
+            // already has gv_amount so update
+            $gv_update = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $total_gv_amount . "' where customer_id = '" . $customer_id . "'");
+          } else {
+            // no gv_amount so insert
+            $gv_insert = tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $total_gv_amount . "')");
+          }
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_REDEEMED_AMOUNT. $currencies->format($gv_amount)), 'SSL'));
+         // tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_REDEEMED_AMOUNT. $currencies->format($gv_amount)), 'SSL'));
+       }
+     }
+     if ($HTTP_POST_VARS['submit_redeem_x'] && !$HTTP_POST_VARS['gv_redeem_code']) tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_NO_REDEEM_CODE), 'SSL'));
+    // if ($HTTP_POST_VARS['submit_redeem_x'] && $gv_result['coupon_type'] == 'G') tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_REDEEM_CODE), 'SSL'));
+   }
+
+    function calculate_credit($amount) {
+      global $customer_id, $order;
+      $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+      $gv_result=tep_db_fetch_array($gv_query);
+      $gv_payment_amount = $gv_result['amount'];
+      $gv_amount = $gv_payment_amount;
+      $save_total_cost = $amount;
+      $full_cost = $save_total_cost - $gv_payment_amount;
+      if ($full_cost <= 0) {
+        $full_cost = 0;
+        $gv_payment_amount = $save_total_cost;
+      }
+      return tep_round($gv_payment_amount,2);
+    }
+
+    function calculate_tax_deduction($amount, $od_amount, $method) {
+      global $order;
+      switch ($method) {
+        case 'Standard':
+        //$ratio1 = tep_round($od_amount / $amount,2);
+        $ratio1= ($amount==0? 0 : tep_round($od_amount / $amount,2) );
+        $tod_amount = 0;
+        reset($order->info['tax_groups']);
+        while (list($key, $value) = each($order->info['tax_groups'])) {
+          $tax_rate = tep_get_tax_rate_from_desc($key);
+          $total_net += $tax_rate * $order->info['tax_groups'][$key];
+        }
+        if ($od_amount > $total_net) $od_amount = $total_net;
+        reset($order->info['tax_groups']);
+        while (list($key, $value) = each($order->info['tax_groups'])) {
+          $tax_rate = tep_get_tax_rate_from_desc($key);
+          $net = $tax_rate * $order->info['tax_groups'][$key];
+          if ($net > 0) {
+            $god_amount = $order->info['tax_groups'][$key] * $ratio1;
+            $tod_amount += $god_amount;
+            $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
+          }
+        }
+        $order->info['tax'] -= $tod_amount;
+        $order->info['total'] -= $tod_amount;
+        break;
+        case 'Credit Note':
+          $tax_rate = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+          $tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+          $tod_amount = $this->deduction / (100 + $tax_rate)* $tax_rate;
+          $order->info['tax_groups'][$tax_desc] -= $tod_amount;
+//          $order->info['total'] -= $tod_amount;
+        break;
+        default:
+      }
+      return $tod_amount;
+    }
+
+    function user_has_gv_account($c_id) {
+      $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $c_id . "'");
+      if ($gv_result = tep_db_fetch_array($gv_query)) {
+        if ($gv_result['amount']>0) {
+          return true;
+        }
+      }
+      return false;
+    }
+
+    function get_order_total() {
+      global $order;
+      $order_total = $order->info['total'];
+      if ($this->include_tax == 'false') $order_total = $order_total - $order->info['tax'];
+      if ($this->include_shipping == 'false') $order_total = $order_total - $order->info['shipping_cost'];
+
+      return $order_total;
+    }
+// START added by Rigadin in v5.13, needed to show module errors on checkout_payment page
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_ORDER_TOTAL_GV_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+// END added by Rigadin   
+
+    function check() {
+      if (!isset($this->check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_GV_STATUS'");
+        $this->check = tep_db_num_rows($check_query);
+      }
+
+      return $this->check;
+    }
+
+    function keys() {
+      return array('MODULE_ORDER_TOTAL_GV_STATUS', 'MODULE_ORDER_TOTAL_GV_SORT_ORDER', 'MODULE_ORDER_TOTAL_GV_QUEUE', 'MODULE_ORDER_TOTAL_GV_INC_SHIPPING', 'MODULE_ORDER_TOTAL_GV_INC_TAX', 'MODULE_ORDER_TOTAL_GV_CALC_TAX', 'MODULE_ORDER_TOTAL_GV_TAX_CLASS', 'MODULE_ORDER_TOTAL_GV_CREDIT_TAX');
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Total', 'MODULE_ORDER_TOTAL_GV_STATUS', 'true', 'Do you want to display the Gift Voucher value?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_GV_SORT_ORDER', '740', 'Sort order of display.', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Queue Purchases', 'MODULE_ORDER_TOTAL_GV_QUEUE', 'true', 'Do you want to queue purchases of the Gift Voucher?', '6', '3','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Shipping', 'MODULE_ORDER_TOTAL_GV_INC_SHIPPING', 'true', 'Include Shipping in calculation', '6', '5', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Tax', 'MODULE_ORDER_TOTAL_GV_INC_TAX', 'true', 'Include Tax in calculation.', '6', '6','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Re-calculate Tax', 'MODULE_ORDER_TOTAL_GV_CALC_TAX', 'None', 'Re-Calculate Tax', '6', '7','tep_cfg_select_option(array(\'None\', \'Standard\', \'Credit Note\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_ORDER_TOTAL_GV_TAX_CLASS', '0', 'Use the following tax class when treating Gift Voucher as Credit Note.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Credit including Tax', 'MODULE_ORDER_TOTAL_GV_CREDIT_TAX', 'false', 'Add tax to purchased Gift Voucher when crediting to Account', '6', '8','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/order_total/ot_lev_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/order_total/ot_lev_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/order_total/ot_lev_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,137 @@
+<?php
+/*
+<<<<<<< ot_lev_discount.php
+  $Id: ot_lev_discount.php,v 1.0 2002/04/08 01:13:43 hpdl Exp $
+=======
+  $Id: ot_lev_discount.php,v 1.3 2002/09/04 22:49:11 wilt Exp $
+>>>>>>> 1.3
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ot_lev_discount {
+    var $title, $output;
+
+    function ot_lev_discount() {
+      $this->code = 'ot_lev_discount';
+      $this->title = MODULE_LEV_DISCOUNT_TITLE;
+      $this->description = MODULE_LEV_DISCOUNT_DESCRIPTION;
+      $this->enabled = MODULE_LEV_DISCOUNT_STATUS;
+      $this->sort_order = MODULE_LEV_DISCOUNT_SORT_ORDER;
+      $this->include_shipping = MODULE_LEV_DISCOUNT_INC_SHIPPING;
+      $this->include_tax = MODULE_LEV_DISCOUNT_INC_TAX;
+      $this->calculate_tax = MODULE_LEV_DISCOUNT_CALC_TAX;
+      $this->table = MODULE_LEV_DISCOUNT_TABLE;
+//      $this->credit_class = true;
+      $this->output = array();
+    }
+
+    function process() {
+      global $order, $ot_subtotal, $currencies;
+      $od_amount = $this->calculate_credit($this->get_order_total());
+      if ($od_amount>0) {
+      $this->deduction = $od_amount;
+      $this->output[] = array('title' => $this->title . ':',
+                              'text' => '<b>' . $currencies->format($od_amount) . '</b>',
+                              'value' => $od_amount);
+    $order->info['total'] = $order->info['total'] - $od_amount;
+    if ($this->sort_order < $ot_subtotal->sort_order) {
+      $order->info['subtotal'] = $order->info['subtotal'] - $od_amount;
+    }
+}
+    }
+
+
+  function calculate_credit($amount) {
+    global $order;
+    $od_amount=0;
+    $table_cost = split("[:,]" , MODULE_LEV_DISCOUNT_TABLE);
+    for ($i = 0; $i < count($table_cost); $i+=2) {
+          if ($amount >= $table_cost[$i]) {
+            $od_pc = $table_cost[$i+1];
+          }
+        }
+// Calculate tax reduction if necessary
+    if($this->calculate_tax == 'true') {
+// Calculate main tax reduction
+      $tod_amount = round($order->info['tax']*10)/10*$od_pc/100;
+      $order->info['tax'] = $order->info['tax'] - $tod_amount;
+// Calculate tax group deductions
+      reset($order->info['tax_groups']);
+      while (list($key, $value) = each($order->info['tax_groups'])) {
+        $god_amount = round($value*10)/10*$od_pc/100;
+        $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
+      }
+    }
+    $od_amount = round($amount*10)/10*$od_pc/100;
+    $od_amount = $od_amount + $tod_amount;
+    return $od_amount;
+  }
+
+
+  function get_order_total() {
+    global  $order, $cart;
+    $order_total = $order->info['total'];
+// Check if gift voucher is in cart and adjust total
+    $products = $cart->get_products();
+    for ($i=0; $i<sizeof($products); $i++) {
+      $t_prid = tep_get_prid($products[$i]['id']);
+      $gv_query = tep_db_query("select products_price, products_tax_class_id, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");
+      $gv_result = tep_db_fetch_array($gv_query);
+      if (ereg('^GIFT', addslashes($gv_result['products_model']))) {
+        $qty = $cart->get_quantity($t_prid);
+        $products_tax = tep_get_tax_rate($gv_result['products_tax_class_id']);
+        if ($this->include_tax =='false') {
+           $gv_amount = $gv_result['products_price'] * $qty;
+        } else {
+          $gv_amount = ($gv_result['products_price'] + tep_calculate_tax($gv_result['products_price'],$products_tax)) * $qty;
+        }
+        $order_total=$order_total - $gv_amount;
+      }
+    }
+    if ($this->include_tax == 'false') $order_total=$order_total-$order->info['tax'];
+    if ($this->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost'];
+    return $order_total;
+  }
+
+
+
+    function check() {
+      if (!isset($this->check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_LEV_DISCOUNT_STATUS'");
+        $this->check = tep_db_num_rows($check_query);
+      }
+
+      return $this->check;
+    }
+
+    function keys() {
+      return array('MODULE_LEV_DISCOUNT_STATUS', 'MODULE_LEV_DISCOUNT_SORT_ORDER','MODULE_LEV_DISCOUNT_TABLE', 'MODULE_LEV_DISCOUNT_INC_SHIPPING', 'MODULE_LEV_DISCOUNT_INC_TAX','MODULE_LEV_DISCOUNT_CALC_TAX');
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Total', 'MODULE_LEV_DISCOUNT_STATUS', 'true', 'Do you want to enable the Order Discount?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_LEV_DISCOUNT_SORT_ORDER', '999', 'Sort order of display.', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Shipping', 'MODULE_LEV_DISCOUNT_INC_SHIPPING', 'true', 'Include Shipping in calculation', '6', '3', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Tax', 'MODULE_LEV_DISCOUNT_INC_TAX', 'true', 'Include Tax in calculation.', '6', '4','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Calculate Tax', 'MODULE_LEV_DISCOUNT_CALC_TAX', 'false', 'Re-calculate Tax on discounted amount.', '6', '5','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Discount Percentage', 'MODULE_LEV_DISCOUNT_TABLE', '100:7.5,250:10,500:12.5,1000:15', 'Set the price breaks and discount percentages', '6', '6', now())");
+    }
+
+    function remove() {
+      $keys = '';
+      $keys_array = $this->keys();
+      for ($i=0; $i<sizeof($keys_array); $i++) {
+        $keys .= "'" . $keys_array[$i] . "',";
+      }
+      $keys = substr($keys, 0, -1);
+
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/order_total/ot_loworderfee.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/order_total/ot_loworderfee.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/order_total/ot_loworderfee.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,83 @@
+<?php
+/*
+  $Id: ot_loworderfee.php,v 1.1.1.1 2004/03/04 23:41:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ot_loworderfee {
+    var $title, $output;
+
+    function ot_loworderfee() {
+      $this->code = 'ot_loworderfee';
+      $this->title = MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE;
+      $this->description = MODULE_ORDER_TOTAL_LOWORDERFEE_DESCRIPTION;
+      $this->enabled = ((MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS == 'true') ? true : false);
+      $this->sort_order = MODULE_ORDER_TOTAL_LOWORDERFEE_SORT_ORDER;
+
+      $this->output = array();
+    }
+
+    function process() {
+      global $order, $currencies;
+
+      if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
+        switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
+          case 'national':
+            if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
+          case 'international':
+            if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
+          case 'both':
+            $pass = true; break;
+          default:
+            $pass = false; break;
+        }
+
+        if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) < MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER) ) {
+          $tax = tep_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
+          $tax_description = tep_get_tax_description(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
+
+          $order->info['tax'] += tep_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
+          $order->info['tax_groups']["$tax_description"] += tep_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
+          $order->info['total'] += MODULE_ORDER_TOTAL_LOWORDERFEE_FEE + tep_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
+
+          $this->output[] = array('title' => $this->title . ':',
+                                  'text' => $currencies->format(tep_add_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax), true, $order->info['currency'], $order->info['currency_value']),
+                                  'value' => tep_add_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax));
+        }
+      }
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+
+      return $this->_check;
+    }
+
+    function keys() {
+      return array('MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS', 'MODULE_ORDER_TOTAL_LOWORDERFEE_SORT_ORDER', 'MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE', 'MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER', 'MODULE_ORDER_TOTAL_LOWORDERFEE_FEE', 'MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION', 'MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS');
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Low Order Fee', 'MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS', 'true', 'Do you want to display the low order fee?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_LOWORDERFEE_SORT_ORDER', '4', 'Sort order of display.', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Low Order Fee', 'MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE', 'false', 'Do you want to allow low order fees?', '6', '3', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Order Fee For Orders Under', 'MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER', '50', 'Add the low order fee to orders under this amount.', '6', '4', 'currencies->format', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Order Fee', 'MODULE_ORDER_TOTAL_LOWORDERFEE_FEE', '5', 'Low order fee.', '6', '5', 'currencies->format', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Attach Low Order Fee On Orders Made', 'MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION', 'both', 'Attach low order fee for orders sent to the set destination.', '6', '6', 'tep_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS', '0', 'Use the following tax class on the low order fee.', '6', '7', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/order_total/ot_qty_discount.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/order_total/ot_qty_discount.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/order_total/ot_qty_discount.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,158 @@
+<?php
+/*
+  $Id: ot_qty_discount.php,v 1.41 2004-09-14 dreamscape Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 Josh Dechant
+  Protions Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ot_qty_discount {
+    var $title, $output;
+
+    function ot_qty_discount() {
+      $this->code = 'ot_qty_discount';
+      $this->title = MODULE_QTY_DISCOUNT_TITLE;
+      $this->description = MODULE_QTY_DISCOUNT_DESCRIPTION;
+      $this->enabled = MODULE_QTY_DISCOUNT_STATUS;
+      $this->sort_order = MODULE_QTY_DISCOUNT_SORT_ORDER;
+      $this->include_shipping = MODULE_QTY_DISCOUNT_INC_SHIPPING;
+      $this->include_tax = MODULE_QTY_DISCOUNT_INC_TAX;
+      $this->calculate_tax = MODULE_QTY_DISCOUNT_CALC_TAX;
+      $this->output = array();
+    }
+
+    function process() {
+      global $order, $currencies, $ot_subtotal;
+
+      $od_amount = $this->calculate_discount($this->get_order_total());
+      if ($this->calculate_tax == 'true') $tod_amount = $this->calculate_tax_effect($od_amount);
+
+      if ($od_amount > 0) {
+        if (MODULE_QTY_DISCOUNT_RATE_TYPE == 'percentage') $title_ext = sprintf(MODULE_QTY_DISCOUNT_PERCENTAGE_TEXT_EXTENSION ,$this->calculate_rate($_SESSION['cart']->count_contents()));
+        $this->deduction = $od_amount+$tod_amount;
+        $this->output[] = array('title' => sprintf(MODULE_QTY_DISCOUNT_FORMATED_TITLE, $title_ext),
+                                'text' => sprintf(MODULE_QTY_DISCOUNT_FORMATED_TEXT, $currencies->format($od_amount)),
+                                'value' => $od_amount);
+        $order->info['total'] -= $this->deduction;
+        $order->info['tax'] -= $tod_amount;
+        if ($this->sort_order < $ot_subtotal->sort_order) $order->info['subtotal'] -= $this->deduction;
+      }
+    }
+
+    function calculate_discount($amount) {
+      global $qty_discount, $order_total_array;
+
+      $od_amount = 0;
+      if ((MODULE_QTY_DISCOUNT_DISABLE_WITH_COUPON == 'true') && (isset($_SESSION['cc_id']))) return $od_amount;
+
+      $qty_discount = $this->calculate_rate($_SESSION['cart']->count_contents());
+      if ($qty_discount > 0) {
+        if (MODULE_QTY_DISCOUNT_RATE_TYPE == 'percentage') {
+          $od_amount = round((($amount*10)/10)*($qty_discount/100), 2);
+        } else {
+          $od_amount = round((($qty_discount*10)/10), 2);
+        }
+      }
+
+      return $od_amount;
+    }
+
+    function calculate_rate($order_qty) {
+      $discount_rate = split("[:,]" , MODULE_QTY_DISCOUNT_RATES);
+      $size = sizeof($discount_rate);
+      for ($i=0, $n=$size; $i<$n; $i+=2) {
+        if ($order_qty >= $discount_rate[$i]) {
+          $qty_discount = $discount_rate[$i+1];
+        }
+      }
+
+      return $qty_discount;
+    }
+
+    function calculate_tax_effect($od_amount) {
+      global $order;
+
+      if (MODULE_QTY_DISCOUNT_RATE_TYPE == 'percentage') {
+        $tod_amount = 0;
+        reset($order->info['tax_groups']);
+        while (list($key, $value) = each($order->info['tax_groups'])) {
+          $god_amount = 0;
+          $tax_rate = tep_get_tax_rate_from_desc($key);
+          $net = ($tax_rate * $order->info['tax_groups'][$key]);
+          if ($net > 0) {
+            $god_amount = $this->calculate_discount($order->info['tax_groups'][$key]);
+            $tod_amount += $god_amount;
+            $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
+          }
+        }
+      } else {
+        $tod_amount = 0;
+        reset($order->info['tax_groups']);
+        while (list($key, $value) = each($order->info['tax_groups'])) {
+          $god_amount = 0;
+          $tax_rate = tep_get_tax_rate_from_desc($key);
+          $net = ($tax_rate * $order->info['tax_groups'][$key]);
+          if ($net>0) {
+            $god_amount = ($tax_rate/100)*$od_amount;
+            $tod_amount += $god_amount;
+            $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
+          }
+        }
+      }
+
+      return $tod_amount;
+    }
+
+    function get_order_total() {
+      global $order;
+
+      $order_total = $order->info['total'];
+      if ($this->include_tax == 'false') $order_total = ($order_total - $order->info['tax']);
+      if ($this->include_shipping == 'false') $order_total = ($order_total - $order->info['shipping_cost']);
+      return $order_total;
+    }
+
+    function check() {
+      if (!isset($this->check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_QTY_DISCOUNT_STATUS'");
+        $this->check = tep_db_num_rows($check_query);
+      }
+
+      return $this->check;
+    }
+
+    function keys() {
+      return array('MODULE_QTY_DISCOUNT_STATUS', 'MODULE_QTY_DISCOUNT_SORT_ORDER', 'MODULE_QTY_DISCOUNT_DISABLE_WITH_COUPON', 'MODULE_QTY_DISCOUNT_RATE_TYPE', 'MODULE_QTY_DISCOUNT_RATES', 'MODULE_QTY_DISCOUNT_INC_SHIPPING', 'MODULE_QTY_DISCOUNT_INC_TAX', 'MODULE_QTY_DISCOUNT_CALC_TAX');
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Quantity Discount', 'MODULE_QTY_DISCOUNT_STATUS', 'true', 'Do you want to enable the quantity discount module?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_QTY_DISCOUNT_SORT_ORDER', '2', 'Sort order of display.', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Disable If Coupon Used', 'MODULE_QTY_DISCOUNT_DISABLE_WITH_COUPON', 'true', 'Do you want to disable the quantity discount module if a discount coupon is being used by the user?', '6', '3','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Discount Rate Type', 'MODULE_QTY_DISCOUNT_RATE_TYPE', 'percentage', 'Choose the type of discount rate - percentage or flat rate', '6', '4','tep_cfg_select_option(array(\'percentage\', \'flat rate\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Discount Rates', 'MODULE_QTY_DISCOUNT_RATES', '10:5,20:10', 'The discount is based on the total number of items.  Example: 10:5,20:10.. 10 or more items get a 5% or $5 discount; 20 or more items receive a 10% or $10 disount; depending on the rate type.', '6', '5', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Shipping', 'MODULE_QTY_DISCOUNT_INC_SHIPPING', 'false', 'Include Shipping in calculation', '6', '6', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Include Tax', 'MODULE_QTY_DISCOUNT_INC_TAX', 'false', 'Include Tax in calculation.', '6', '7','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Calculate Tax', 'MODULE_QTY_DISCOUNT_CALC_TAX', 'true', 'Re-calculate Tax on discounted amount.', '6', '8','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+  }
+
+////
+// Get tax rate from tax description
+  if (!function_exists(tep_get_tax_rate_from_desc)) {
+    function tep_get_tax_rate_from_desc($tax_desc) {
+      $tax_query = tep_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_description = '" . $tax_desc . "'");
+      $tax = mysql_fetch_assoc($tax_query);
+      return $tax['tax_rate'];
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/order_total/ot_shipping.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/order_total/ot_shipping.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/order_total/ot_shipping.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<?php
+/*
+  $Id: ot_shipping.php,v 1.1.1.1 2004/03/04 23:41:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ot_shipping {
+    var $title, $output;
+
+    function ot_shipping() {
+      $this->code = 'ot_shipping';
+      $this->title = MODULE_ORDER_TOTAL_SHIPPING_TITLE;
+      $this->description = MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION;
+      $this->enabled = ((MODULE_ORDER_TOTAL_SHIPPING_STATUS == 'true') ? true : false);
+      $this->sort_order = MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER;
+
+      $this->output = array();
+    }
+
+    function process() {
+      global $order, $currencies;
+
+      if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
+        switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
+          case 'national':
+            if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
+          case 'international':
+            if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
+          case 'both':
+            $pass = true; break;
+          default:
+            $pass = false; break;
+        }
+
+        if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
+          $order->info['shipping_method'] = $this->title;
+          $order->info['total'] -= $order->info['shipping_cost'];
+          $order->info['shipping_cost'] = 0;
+        }
+      }
+
+      $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));
+
+      if (tep_not_null($order->info['shipping_method'])) {
+        if ($GLOBALS[$module]->tax_class > 0) {
+          $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+          $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+
+          $order->info['tax'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);
+          $order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);
+          $order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);
+
+          if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);
+        }
+
+        $this->output[] = array('title' => $order->info['shipping_method'] . ':',
+                                'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
+                                'value' => $order->info['shipping_cost']);
+      }
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_SHIPPING_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+
+      return $this->_check;
+    }
+
+    function keys() {
+      return array('MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION');
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'true', 'Do you want to display the order shipping cost?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '2', 'Sort order of display.', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Free Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'false', 'Do you want to allow free shipping?', '6', '3', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Free Shipping For Orders Over', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', '50', 'Provide free shipping for orders over the set amount.', '6', '4', 'currencies->format', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Provide Free Shipping For Orders Made', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION', 'national', 'Provide free shipping for orders sent to the set destination.', '6', '5', 'tep_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/order_total/ot_subtotal.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/order_total/ot_subtotal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/order_total/ot_subtotal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: ot_subtotal.php,v 1.1.1.1 2004/03/04 23:41:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ot_subtotal {
+    var $title, $output;
+
+    function ot_subtotal() {
+      $this->code = 'ot_subtotal';
+      $this->title = MODULE_ORDER_TOTAL_SUBTOTAL_TITLE;
+      $this->description = MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION;
+      $this->enabled = ((MODULE_ORDER_TOTAL_SUBTOTAL_STATUS == 'true') ? true : false);
+      $this->sort_order = MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER;
+
+      $this->output = array();
+    }
+
+    function process() {
+      global $order, $currencies;
+
+      $this->output[] = array('title' => $this->title . ':',
+                              'text' => $currencies->format($order->info['subtotal'], true, $order->info['currency'], $order->info['currency_value']),
+                              'value' => $order->info['subtotal']);
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_SUBTOTAL_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+
+      return $this->_check;
+    }
+
+    function keys() {
+      return array('MODULE_ORDER_TOTAL_SUBTOTAL_STATUS', 'MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER');
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Sub-Total', 'MODULE_ORDER_TOTAL_SUBTOTAL_STATUS', 'true', 'Do you want to display the order sub-total cost?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER', '1', 'Sort order of display.', '6', '2', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/order_total/ot_tax.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/order_total/ot_tax.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/order_total/ot_tax.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: ot_tax.php,v 1.1.1.1 2004/03/04 23:41:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ot_tax {
+    var $title, $output;
+
+    function ot_tax() {
+      $this->code = 'ot_tax';
+      $this->title = MODULE_ORDER_TOTAL_TAX_TITLE;
+      $this->description = MODULE_ORDER_TOTAL_TAX_DESCRIPTION;
+      $this->enabled = ((MODULE_ORDER_TOTAL_TAX_STATUS == 'true') ? true : false);
+      $this->sort_order = MODULE_ORDER_TOTAL_TAX_SORT_ORDER;
+
+      $this->output = array();
+    }
+
+    function process() {
+      global $order, $currencies;
+
+      reset($order->info['tax_groups']);
+      while (list($key, $value) = each($order->info['tax_groups'])) {
+        if ($value > 0) {
+          $this->output[] = array('title' => $key . ':',
+                                  'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
+                                  'value' => $value);
+        }
+      }
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_TAX_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+
+      return $this->_check;
+    }
+
+    function keys() {
+      return array('MODULE_ORDER_TOTAL_TAX_STATUS', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER');
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Tax', 'MODULE_ORDER_TOTAL_TAX_STATUS', 'true', 'Do you want to display the order tax value?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER', '3', 'Sort order of display.', '6', '2', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/order_total/ot_total.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/order_total/ot_total.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/order_total/ot_total.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: ot_total.php,v 1.1.1.1 2004/03/04 23:41:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ot_total {
+    var $title, $output;
+
+    function ot_total() {
+      $this->code = 'ot_total';
+      $this->title = MODULE_ORDER_TOTAL_TOTAL_TITLE;
+      $this->description = MODULE_ORDER_TOTAL_TOTAL_DESCRIPTION;
+      $this->enabled = ((MODULE_ORDER_TOTAL_TOTAL_STATUS == 'true') ? true : false);
+      $this->sort_order = MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER;
+
+      $this->output = array();
+    }
+
+    function process() {
+      global $order, $currencies;
+
+      $this->output[] = array('title' => $this->title . ':',
+                              'text' => '<b>' . $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value']) . '</b>',
+                              'value' => $order->info['total']);
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_TOTAL_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+
+      return $this->_check;
+    }
+
+    function keys() {
+      return array('MODULE_ORDER_TOTAL_TOTAL_STATUS', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER');
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Total', 'MODULE_ORDER_TOTAL_TOTAL_STATUS', 'true', 'Do you want to display the total order value?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER', '4', 'Sort order of display.', '6', '2', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/SecurePay.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/SecurePay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/SecurePay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,326 @@
+<?php
+/*
+Based on payment Module of iongate.php (06/11/2003) Modified for Securepay.com by:
+
+Tony Reynolds  <tonyr at securepay.com>
+
+SecurePay.php version 1.2 06/11/2003
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class SecurePay {
+    var $code, $title, $description, $enabled, $states;
+
+// class constructor
+    function SecurePay() {
+      $this->code = 'SecurePay';
+      $this->title = MODULE_PAYMENT_SECUREPAY_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_SECUREPAY_TEXT_DESCRIPTION;
+      $this->enabled = ((MODULE_PAYMENT_SECUREPAY_STATUS == 'True') ? true : false);
+
+      $this->form_action_url = 'https://www.securepay.com/oscommerce/index.cfm';
+      $this->states = $this->_state_list();
+    }
+
+// class methods
+    // this method returns the javascript that will validate the form entry
+    function javascript_validation() {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.SecurePay_cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.SecurePay_cc_number.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_SECUREPAY_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+
+      return $js;
+    }
+
+    // this method returns the html that creates the input form
+    function selection() {
+      global $order;
+
+      for ($i=1; $i<13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+      if (MODULE_PAYMENT_SECUREPAY_ACCEPT_VISA == 'True') {
+        $creditCardTypes[] = array('id' => 'VISA', 'text' => 'Visa');
+      }
+      if (MODULE_PAYMENT_SECUREPAY_ACCEPT_MASTERCARD == 'True') {
+        $creditCardTypes[] = array('id' => 'MASTERCARD', 'text' => 'MasterCard');
+      }
+      if (MODULE_PAYMENT_SECUREPAY_ACCEPT_AMEX == 'True') {
+        $creditCardTypes[] = array('id' => 'AMEX', 'text' => 'American Express');
+      }
+      if (MODULE_PAYMENT_SECUREPAY_ACCEPT_DISCOVER == 'True') {
+        $creditCardTypes[] = array('id' => 'DISCOVER', 'text' => 'Discover');
+      }
+
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('SecurePay_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_SECUREPAY_TEXT_TYPE,
+                                                 'field' => tep_draw_pull_down_menu('SecurePay_cc_type', $creditCardTypes)),
+                                           array('title' => MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('SecurePay_cc_number')),
+                                           array('title' => MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('SecurePay_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('SecurePay_cc_expires_year', $expires_year))));
+
+      return $selection;
+    }
+
+    // this method is called before the data is sent to the credit card processor
+    // here you can do any field validation that you need to do
+    // we also set the global variables here from the form values
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+      include(DIR_WS_CLASSES . 'cc_validation1.php');
+
+      $cc_validation = new cc_validation();
+      $result = $cc_validation->validate($HTTP_POST_VARS['SecurePay_cc_number'], $HTTP_POST_VARS['SecurePay_cc_expires_month'], $HTTP_POST_VARS['SecurePay_cc_expires_year']);
+
+      $error = '';
+      switch ($result) {
+        case -1:
+          $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+          break;
+        case -2:
+        case -3:
+        case -4:
+          $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+          break;
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&SecurePay_cc_owner=' . urlencode($HTTP_POST_VARS['SecurePay_cc_owner']) . '&SecurePay_cc_type=' . urlencode($HTTP_POST_VARS['SecurePay_cc_type']) . '&SecurePay_cc_expires_month=' . $HTTP_POST_VARS['SecurePay_cc_expires_month'] . '&SecurePay_cc_expires_year=' . $HTTP_POST_VARS['SecurePay_cc_expires_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      // check the type the user said the card was, versus the type that cc_validation
+      // says it is.
+
+      if (($cc_validation->cc_type ==  'Visa' &&
+           $HTTP_POST_VARS['SecurePay_cc_type'] != 'VISA') ||
+          ($cc_validation->cc_type ==  'Master Card' &&
+           $HTTP_POST_VARS['SecurePay_cc_type'] != 'MASTERCARD') ||
+          ($cc_validation->cc_type ==  'American Express' &&
+           $HTTP_POST_VARS['SecurePay_cc_type'] != 'AMEX') ||
+          ($cc_validation->cc_type ==  'Discover' &&
+           $HTTP_POST_VARS['SecurePay_cc_type'] != 'DISCOVER')) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode(MODULE_PAYMENT_SECUREPAY_TEXT_WRONG_TYPE) . '&SecurePay_cc_owner=' . urlencode($HTTP_POST_VARS['SecurePay_cc_owner']) . '&SecurePay_cc_type=' . urlencode($HTTP_POST_VARS['SecurePay_cc_type']) . '&SecurePay_cc_expires_month=' . $HTTP_POST_VARS['SecurePay_cc_expires_month'] . '&SecurePay_cc_expires_year=' . $HTTP_POST_VARS['SecurePay_cc_expires_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_owner = $HTTP_POST_VARS['SecurePay_cc_owner'];
+      $this->cc_card_type = $HTTP_POST_VARS['SecurePay_cc_type'];
+      $this->cc_card_number = $cc_validation->cc_number;
+      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+    }
+
+    // this method returns the data for the confirmation page
+    function confirmation() {
+      global $HTTP_POST_VARS;
+
+      $confirmation = array('title' => $this->title,
+                            'fields' => array(array('title' => MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['SecurePay_cc_owner']),
+                                              array('title' => MODULE_PAYMENT_SECUREPAY_TEXT_TYPE,
+                                                    'field' => $HTTP_POST_VARS['SecurePay_cc_type']),
+                                              array('title' => MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                              array('title' => MODULE_PAYMENT_SECUREPAY_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['SecurePay_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['SecurePay_cc_expires_year'])))));
+
+      return $confirmation;
+    }
+
+    // this method performs the authorization by sending the data to the processor, and getting the result
+    function process_button() {
+      global $HTTP_SERVER_VARS, $order, $customer_id, $insert_id;
+
+      $process_button_string = tep_draw_hidden_field('login', ((MODULE_PAYMENT_SECUREPAY_TESTMODE == 'Production') ? MODULE_PAYMENT_SECUREPAY_LOGIN : '34704')) .
+                               tep_draw_hidden_field('amount', number_format($order->info['total'], 2)) .
+                               tep_draw_hidden_field('cardtype', $this->cc_card_type) .
+                               tep_draw_hidden_field('cardnum', $this->cc_card_number) .
+                               tep_draw_hidden_field('expires', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .
+                               tep_draw_hidden_field('cardname', $this->cc_card_owner) .
+                               tep_draw_hidden_field('address', $order->billing['street_address']) .
+                               tep_draw_hidden_field('address2', $order->billing['suburb']) .
+                               tep_draw_hidden_field('city', $order->billing['city']) .
+                               // SecurePay expects 2 digit capilalized state codes
+                               tep_draw_hidden_field('state', $this->states[strtoupper($order->billing['state'])]) .
+                               tep_draw_hidden_field('zip', $order->billing['postcode']) .
+                               tep_draw_hidden_field('country', $order->billing['country']['title']) .
+                               tep_draw_hidden_field('phone', $order->customer['telephone']) .
+                               tep_draw_hidden_field('email', $order->customer['email_address']) .
+                               tep_draw_hidden_field('merchemail', ((MODULE_PAYMENT_SECUREPAY_EMAIL_MERCHANT == 'True') ? MODULE_PAYMENT_SECUREPAY_MERCHANT_EMAIL : 'NO')) .
+                               tep_draw_hidden_field('custno', $customer_id) .
+                               // I would like to get the order number here
+                               // but it isn't available under after this code
+                               // executes.  So, we'll put the date in there
+                               // so that we have something to reference.  If
+                               // we get more than one order per second we
+                               // have problems, but I guess that would be
+                               // a pretty good problem to have :)
+                               tep_draw_hidden_field('invoiceno', MODULE_PAYMENT_SECUREPAY_LOGIN . (MODULE_PAYMENT_SECUREPAY_LOGIN  + date('Ymd') + date('his')) . $customer_id) .
+                               tep_draw_hidden_field('description', 'Order Submitted from IP: ' .  $HTTP_SERVER_VARS['REMOTE_ADDR'] . "\n" .  $products_list) .
+                               tep_draw_hidden_field('receipturl', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false)) .
+                               // if you don't set this, SecurePay will display input forms for any missing
+                               // or invalid data.
+                               tep_draw_hidden_field('returnallerrors', 'YES') .
+
+      $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
+
+      return $process_button_string;
+    }
+
+    // this method gets called after the processing is done but before the app server
+    // accepts the result.  It is used to check for errors.
+    function before_process() {
+      global $HTTP_GET_VARS;
+
+      if ($HTTP_GET_VARS['RESPONSE_CODE'] != 'AA') {
+       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . urlencode($HTTP_GET_VARS['AUTH_RESPONSE']), 'SSL', true, false));
+      }
+      Elseif ($HTTP_GET_VARS['RETURN_CODE'] != 'Y' ) {
+       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . urlencode($HTTP_GET_VARS['AUTH_RESPONSE']), 'SSL', true, false));
+      }
+      }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+      $error = array('title' => MODULE_PAYMENT_SECUREPAY_TEXT_ERROR,
+       'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_SECUREPAY_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable SecurePay Module', 'MODULE_PAYMENT_SECUREPAY_STATUS', 'True', 'Do you want to accept credit card payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('SecurePay ID:', 'MODULE_PAYMENT_SECUREPAY_LOGIN', '34704', 'Your 5 digit Securepay ID:', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_SECUREPAY_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Production\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Merchant Notifications', 'MODULE_PAYMENT_SECUREPAY_EMAIL_MERCHANT', 'True', 'Should SecurePay e-mail a receipt to the store owner?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchants Email Address', 'MODULE_PAYMENT_SECUREPAY_MERCHANT_EMAIL', 'demo at securepay.com', 'The Merchants email address?', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accept Visa', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_VISA', 'True', 'Should we accept Visa?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accept Mastercard', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_MASTERCARD', 'True', 'Should we accept Mastercard?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accept American Express', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_AMEX', 'True', 'Should we accept American Express?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accept Discover', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_DISCOVER', 'True', 'Should we accept Discover?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accept Diners Club', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_DINERS', 'True', 'Should we accept Diners Club?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accept JCB', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_JCB', 'True', 'Should we accept JCB?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_SECUREPAY_STATUS', 'MODULE_PAYMENT_SECUREPAY_LOGIN', 'MODULE_PAYMENT_SECUREPAY_TESTMODE', 'MODULE_PAYMENT_SECUREPAY_EMAIL_MERCHANT','MODULE_PAYMENT_SECUREPAY_MERCHANT_EMAIL', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_VISA', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_MASTERCARD', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_AMEX', 'MODULE_PAYMENT_SECUREPAY_ACCEPT_DISCOVER');
+    }
+
+    // this internal method returns an array keyed by state name, with a value of state code
+    function _state_list() {
+      $list = array('ALABAMA' => 'AL' ,
+                    'ALASKA' => 'AK' ,
+                    'AMERICAN SAMOA' => 'AS' ,
+                    'ARIZONA' => 'AZ' ,
+                    'ARKANSAS' => 'AR' ,
+                    'CALIFORNIA' => 'CA' ,
+                    'COLORADO' => 'CO' ,
+                    'CONNECTICUT' => 'CT' ,
+                    'DELAWARE' => 'DE' ,
+                    'DISTRICT OF COLUMBIA' => 'DC' ,
+                    'FEDERATED STATES OF MICRONESIA' => 'FM' ,
+                    'FLORIDA' => 'FL' ,
+                    'GEORGIA' => 'GA' ,
+                    'GUAM' => 'GU' ,
+                    'HAWAII' => 'HI' ,
+                    'IDAHO' => 'ID' ,
+                    'ILLINOIS' => 'IL' ,
+                    'INDIANA' => 'IN' ,
+                    'IOWA' => 'IA' ,
+                    'KANSAS' => 'KS' ,
+                    'KENTUCKY' => 'KY' ,
+                    'LOUISIANA' => 'LA' ,
+                    'MAINE' => 'ME' ,
+                    'MARSHALL ISLANDS' => 'MH' ,
+                    'MARYLAND' => 'MD' ,
+                    'MASSACHUSETTS' => 'MA' ,
+                    'MICHIGAN' => 'MI' ,
+                    'MINNESOTA' => 'MN' ,
+                    'MISSOURI' => 'MS' ,
+                    'MONTANA' => 'MT' ,
+                    'NEBRASKA' => 'NE' ,
+                    'NEVADA' => 'NV' ,
+                    'NEW HAMPSHIRE' => 'NH' ,
+                    'NEW JERSEY' => 'NJ' ,
+                    'NEW MEXICO' => 'NM' ,
+                    'NEW YORK' => 'NY' ,
+                    'NORTH CAROLINA' => 'NC' ,
+                    'NORTH DAKOTA' => 'ND' ,
+                    'NORTHERN MARIANA ISLANDS' => 'MP' ,
+                    'OHIO' => 'OH' ,
+                    'OKLAHOMA' => 'OK' ,
+                    'OREGON' => 'OR' ,
+                    'PALAU' => 'PW' ,
+                    'PENNSYLVANIA' => 'PA' ,
+                    'PUERTO RICO' => 'PR' ,
+                    'RHODE ISLAND' => 'RI' ,
+                    'SOUTH CAROLINA' => 'SC' ,
+                    'SOUTH DAKOTA' => 'SD' ,
+                    'TENNESSEE' => 'TN' ,
+                    'TEXAS' => 'TX' ,
+                    'UTAH' => 'UT' ,
+                    'VERMONT' => 'VT' ,
+                    'VIRGIN ISLANDS' => 'VI' ,
+                    'VIRGINIA' => 'VA' ,
+                    'WASHINGTON' => 'WA' ,
+                    'WEST VIRGINIA' => 'WV' ,
+                    'WISCONSIN' => 'WI' ,
+                    'WYOMING' => 'WY' ,
+                    'ARMED FORCES AFRICA' => 'AE' ,
+                    'ARMED FORCES EUROPE' => 'AE' ,
+                    'ARMED FORCES CANADA' => 'AE' ,
+                    'ARMED FORCES MIDDLE EAST' => 'AE' ,
+                    'ARMED FORCES AMERICAS' => 'AA' ,
+                    'ARMED FORCES PACIFIC' => 'AP');
+
+      return $list;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/authorizenet.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/authorizenet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/authorizenet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,330 @@
+<?php
+/*
+  $Id: authorizenet.php,v 1.4 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+ */
+
+// define('FILENAME_AUTHORIZENET_HELP', 'authnet_help.html');
+
+  class authorizenet {
+    var $code, $title, $description, $enabled, $sort_order;
+    var $accepted_cc, $card_types, $allowed_types;
+
+// class constructor
+  function authorizenet() {
+    global $order;
+    $this->code = 'authorizenet';
+    $this->title = MODULE_PAYMENT_AUTHORIZENET_TEXT_TITLE;
+    $this->description = MODULE_PAYMENT_AUTHORIZENET_TEXT_DESCRIPTION;
+    $this->sort_order = MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER;
+    $this->enabled = ((MODULE_PAYMENT_AUTHORIZENET_STATUS == 'True') ? true : false);
+    $this->accepted_cc = MODULE_PAYMENT_AUTHORIZENET_ACCEPTED_CC;
+
+    if ((int)MODULE_PAYMENT_AUTHORIZENET_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_AUTHORIZENET_ORDER_STATUS_ID;
+    }
+
+    if (is_object($order)) $this->update_status();
+
+    //array for credit card selection
+    $this->card_types = array('Amex' => MODULE_PAYMENT_AUTHORIZENET_TEXT_AMEX,
+        'Mastercard' => MODULE_PAYMENT_AUTHORIZENET_TEXT_MASTERCARD,
+        'Discover' => MODULE_PAYMENT_AUTHORIZENET_TEXT_DISCOVER,
+        'Visa' => MODULE_PAYMENT_AUTHORIZENET_TEXT_VISA);
+    $this->allowed_types = array();
+
+    // Credit card pulldown list
+    $cc_array = explode(', ', MODULE_PAYMENT_AUTHORIZENET_ACCEPTED_CC);
+    while (list($key, $value) = each($cc_array)) {
+      $this->allowed_types[$value] = $this->card_types[$value];
+    }
+
+    // Processing via Authorize.net AIM
+    $this->form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false);
+  }
+
+// class methods
+  function update_status() {
+    global $order;
+    if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_ZONE > 0) ) {
+      $check_flag = false;
+      $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+      while ($check = tep_db_fetch_array($check_query)) {
+        if ($check['zone_id'] < 1) {
+          $check_flag = true;
+          break;
+        } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+          $check_flag = true;
+          break;
+        }
+      }
+      if ($check_flag == false) {
+        $this->enabled = false;
+      }
+    }
+  }
+
+
+//concatenate to get CC images
+function get_cc_images() {
+  $cc_images = '';
+  reset($this->allowed_types);
+  while (list($key, $value) = each($this->allowed_types)) {
+    $cc_images .= tep_image(DIR_WS_ICONS . $key . '.gif', $value);
+  }
+  return $cc_images;
+}
+
+function javascript_validation() {
+   if(MODULE_PAYMENT_AUTHORIZENET_CCV == 'True' ) {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.authorizenet_cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.authorizenet_cc_number.value;' . "\n" .
+            '    var cc_cvv = document.checkout_payment.cvv.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+             '    if (cc_cvv != "" && cc_cvv.length < "3") {' . "\n".
+            '      error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_CVV . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+          }else{
+    $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.authorizenet_cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.authorizenet_cc_number.value;' . "\n" .
+            '    var cc_cvv = document.checkout_payment.cvv.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_AUTHORIZENET_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+    }
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+  reset($this->allowed_types);
+  while (list($key, $value) = each($this->allowed_types)) {
+    $card_menu[] = array('id' => $key, 'text' => $value);
+  }
+
+      for ($i=1; $i<13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+if(MODULE_PAYMENT_AUTHORIZENET_CCV  == 'True' ) {
+  $selection = array('id' => $this->code,
+    'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images(),
+    'fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_TYPE,
+      'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+    array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER,
+      'field' => tep_draw_input_field('authorizenet_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+    array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER,
+      'field' => tep_draw_input_field('authorizenet_cc_number')),
+    array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES,
+      'field' => tep_draw_pull_down_menu('authorizenet_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('authorizenet_cc_expires_year', $expires_year)),
+      array('title' => 'CVV number ' . ' ' .'<a href="javascript:CVVPopUpWindow(\'' . tep_href_link('cvv.html') . '\')">' . '<u><i>' . '(' . MODULE_PAYMENT_AUTHORIZENET_TEXT_CVV_LINK . ')' . '</i></u></a>',
+      'field' => tep_draw_input_field('cvv','',"SIZE=4, MAXLENGTH=4"))));
+ }else{
+$selection = array('id' => $this->code,
+    'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images(),
+    'fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_TYPE,
+      'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+    array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER,
+      'field' => tep_draw_input_field('authorizenet_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+    array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER,
+      'field' => tep_draw_input_field('authorizenet_cc_number')),
+    array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES,
+      'field' => tep_draw_pull_down_menu('authorizenet_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('authorizenet_cc_expires_year', $expires_year))));
+ }
+     return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS, $cvv;
+      include(DIR_WS_CLASSES . 'cc_validation.php');
+      $cc_validation = new cc_validation();
+      if(MODULE_PAYMENT_AUTHORIZENET_CCV  == 'True' ) {
+        $result = $cc_validation->validate($HTTP_POST_VARS['authorizenet_cc_number'], $HTTP_POST_VARS['authorizenet_cc_expires_month'], $HTTP_POST_VARS['authorizenet_cc_expires_year'], $HTTP_POST_VARS['cvv'], $HTTP_POST_VARS['credit_card_type']);
+      } else {
+        $result = $cc_validation->validate($HTTP_POST_VARS['authorizenet_cc_number'], $HTTP_POST_VARS['authorizenet_cc_expires_month'], $HTTP_POST_VARS['authorizenet_cc_expires_year']);
+      }
+      $error = '';
+  switch ($result) {
+    case -1:
+      $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+      break;
+    case -2:
+    case -3:
+    case -4:
+      $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+      break;
+    case -5:
+      $error = TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH;
+      break;
+    case -6;
+      $error = TEXT_CCVAL_ERROR_CVV_LENGTH;
+      break;
+    case false:
+      $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+      break;
+  }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&authorizenet_cc_owner=' . urlencode($HTTP_POST_VARS['authorizenet_cc_owner']) . '&authorizenet_cc_expires_month=' . $HTTP_POST_VARS['authorizenet_cc_expires_month'] . '&authorizenet_cc_expires_year=' . $HTTP_POST_VARS['authorizenet_cc_expires_year'];
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = $cc_validation->cc_type;
+      $this->cc_card_number = $cc_validation->cc_number;
+      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+      $this->x_Card_Code = $HTTP_POST_VARS['cvv'];
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS, $x_Card_Code;
+       $x_Card_Code=$HTTP_POST_VARS['cvv'];
+       $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => 'CVV number',
+                                                    'field' => $HTTP_POST_VARS['cvv']),
+                                                    array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['authorizenet_cc_owner']),
+                                              array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                              array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['authorizenet_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['authorizenet_cc_expires_year'])))));
+                $this->x_Card_Code=$HTTP_POST_VARS['cvv'];
+      return $confirmation;
+    }
+
+    function process_button() {
+     // Change made by using ADC Direct Connection
+
+      $process_button_string = tep_draw_hidden_field('x_Card_Code', $HTTP_POST_VARS['cvv']) .
+                               tep_draw_hidden_field('x_Card_Num', $this->cc_card_number) .
+                               tep_draw_hidden_field('x_Exp_Date', $this->cc_expiry_month . substr($this->cc_expiry_year, -2));
+
+// Eversun mod for authorize.net problem
+  $_SESSION['x_Card_Code'] = $this->x_Card_Code;
+  $_SESSION['x_Card_Num'] = $this->cc_card_number;
+  $_SESSION['x_Exp_Date'] = $this->cc_expiry_month . substr($this->cc_expiry_year, -2);
+// Eversun mod end for authorize.net problem
+                  
+      $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $response,$insert_id;
+
+      // Change made by using ADC Direct Connection
+      $response_vars = explode(',', $response[0]);
+      $x_response_code = $response_vars[0];
+      $x_response_subcode = $response_vars[1];
+      $x_response_reason_code = $response_vars[2];
+      $x_response_reason_text = $response_vars[3];
+      //check to see if the value is encapsulated; if so, remove
+      $x_response_code = str_replace('|', '', $x_response_code);
+
+      if ($x_response_code != '1') {
+        tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$insert_id . "'"); //Remove order
+        if($x_response_code == '') {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('The server cannot connect to Authorize.net.  Please check your cURL and server settings.'), 'SSL', true, false));
+        } else if($x_response_code == '2') {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode($x_response_text) . urlencode(' (' . $x_response_reason_text . ') - ') . urlencode(MODULE_PAYMENT_AUTHORIZENET_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
+        } else if($x_response_code == '3') {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an error processing your credit card ') . urlencode(' - (' . $x_response_reason_code . '): ' . $x_response_reason_text), 'SSL', true, false));
+        } else {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an unspecified error processing your credit card.'), 'SSL', true, false));
+        }
+      }
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_AUTHORIZENET_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Authorize.net Module', 'MODULE_PAYMENT_AUTHORIZENET_STATUS', 'True', 'Do you want to accept payments through Authorize.net?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login Username', 'MODULE_PAYMENT_AUTHORIZENET_LOGIN', 'Your Login Name', 'The login username used for the Authorize.net service', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login Transaction Key', 'MODULE_PAYMENT_AUTHORIZENET_TRANSKEY', 'Your Transaction Key', 'The transaction key used for the Authorize.net service', '6', '0', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('cURL Setup', 'MODULE_PAYMENT_AUTHORIZENET_CURL', 'Not Compiled', 'Whether cURL is compiled into PHP or not.  Windows users, select not compiled.', '6', '0', 'tep_cfg_select_option(array(\'Not Compiled\', \'Compiled\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Path', 'MODULE_PAYMENT_AUTHORIZENET_CURL_PATH', 'The Path To cURL', 'For Not Compiled mode only, input path to the cURL binary (i.e. c:/curl/curl)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_AUTHORIZENET_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Test And Debug\', \'Production\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Method', 'MODULE_PAYMENT_AUTHORIZENET_METHOD', 'Credit Card', 'Transaction method used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Credit Card\', \'eCheck\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Processing Mode', 'MODULE_PAYMENT_AUTHORIZENET_CCMODE', 'Authorize And Capture', 'Credit card processing mode', '6', '0', 'tep_cfg_select_option(array(\'Authorize And Capture\', \'Authorize Only\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order Of Display', 'MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER', '200', 'The order in which this payment type is dislayed. Lowest is displayed first.', '6', '0' , now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_AUTHORIZENET_EMAIL_CUSTOMER', 'False', 'Should Authorize.Net e-mail a receipt to the customer?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accepted Credit Cards', 'MODULE_PAYMENT_AUTHORIZENET_ACCEPTED_CC', 'Mastercard, Visa', 'The credit cards you currently accept', '6', '0', '_selectOptions(array(\'Amex\',\'Discover\', \'Mastercard\', \'Visa\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Authorizenet - Payment Zone', 'MODULE_PAYMENT_AUTHORIZENET_ZONE', '0', 'Authorizenet - If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CCV code', 'MODULE_PAYMENT_AUTHORIZENET_CCV', 'True', 'Do you want to enable ccv code checking?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Authorizenet - Set Order Status', 'MODULE_PAYMENT_AUTHORIZENET_ORDER_STATUS_ID', '0', 'Authorizenet - Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+   }
+
+    function remove() {
+      $keys = '';
+      $keys_array = $this->keys();
+      for ($i=0; $i<sizeof($keys_array); $i++) {
+        $keys .= "'" . $keys_array[$i] . "',";
+      }
+      $keys = substr($keys, 0, -1);
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_AUTHORIZENET_STATUS', 'MODULE_PAYMENT_AUTHORIZENET_LOGIN', 'MODULE_PAYMENT_AUTHORIZENET_TRANSKEY', 'MODULE_PAYMENT_AUTHORIZENET_CURL', 'MODULE_PAYMENT_AUTHORIZENET_CURL_PATH', 'MODULE_PAYMENT_AUTHORIZENET_TESTMODE', 'MODULE_PAYMENT_AUTHORIZENET_METHOD', 'MODULE_PAYMENT_AUTHORIZENET_CCMODE', 'MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER', 'MODULE_PAYMENT_AUTHORIZENET_EMAIL_CUSTOMER', 'MODULE_PAYMENT_AUTHORIZENET_ACCEPTED_CC', 'MODULE_PAYMENT_AUTHORIZENET_ZONE', 'MODULE_PAYMENT_AUTHORIZENET_ORDER_STATUS_ID', 'MODULE_PAYMENT_AUTHORIZENET_CCV');
+    }
+  }
+
+// Authorize.net Consolidated Credit Card Checkbox Implementation
+// Code from UPS Choice v1.7 - Fritz Clapp (aka dreamscape, thanks Fritz!)
+function _selectOptions($select_array, $key_value, $key = '') {
+  for ($i=0; $i<(sizeof($select_array)); $i++) {
+    $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+    $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+    $key_values = explode(", ", $key_value);
+    if (in_array($select_array[$i], $key_values)) $string .= ' checked="checked"';
+    $string .= '> ' . $select_array[$i];
+  }
+  return $string;
+}
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/cc_cvc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/cc_cvc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/cc_cvc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,342 @@
+<?php
+/*
+  $Id: cc.php,v 1.1.1.1 2004/03/04 23:41:17 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class cc_cvc {
+    var $code, $title, $description, $enabled, $sort_order;
+    var $accepted_cc, $card_types, $allowed_types, $cc_ccv, $cc_middle;
+// class constructor
+    function cc_cvc() {
+      global $order, $cc_ccv;
+      
+      $this->code = 'cc_cvc';
+      $this->title = MODULE_PAYMENT_CC_CVC_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_CC_CVC_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_CC_CVC_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_CC_CVC_STATUS == 'True') ? true : false);
+      $this->accepted_cc = MODULE_PAYMENT_CC_CVC_ACCEPTED_CC; 
+      
+      if ((int)MODULE_PAYMENT_CC_CVC_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_CC_CVC_ORDER_STATUS_ID;
+      }
+
+    if (is_object($order)) $this->update_status();
+       //array for credit card selection
+          $this->card_types = array('Visa' => MODULE_PAYMENT_CC_TEXT_VISA ,
+                              'Mastercard' => MODULE_PAYMENT_CC_TEXT_MASTERCARD  ,
+                                'Discover' => MODULE_PAYMENT_CC_TEXT_DISCOVERY  ,
+                                    'Amex' => MODULE_PAYMENT_CC_TEXT_AMEX  ,
+                        'American_Express' => MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS  ,
+                                   'Delta' => MODULE_PAYMENT_CC_TEXT_DELTA  ,
+                             'UK_Electron' => MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON  ,
+                                 'Maestro' => MODULE_PAYMENT_CC_TEXT_MEASTRO  ,
+                               'UK_Switch' => MODULE_PAYMENT_CC_TEXT_UK_SWITCH  ,
+                                    'Solo' => MODULE_PAYMENT_CC_TEXT_SOLO  ,
+                     'Australian_BankCard' => MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD  ,
+                                     'JCB' => MODULE_PAYMENT_CC_TEXT_JCB  ,
+                           'Carte_Blanche' => MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE  ,
+                             'Diners_Club' => MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB  );
+
+          $this->allowed_types = array();
+      
+          // Credit card pulldown list
+          $cc_array = explode(', ', MODULE_PAYMENT_CC_CVC_ACCEPTED_CC);
+          while (list($key, $value) = each($cc_array)) {
+            $this->allowed_types[$value] = $this->card_types[$value];
+          }
+      
+          // this may not be right
+        //  $this->form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false);
+        }
+
+ //   }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_CC_CVC_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_CC_CVC_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+//concatenate to get CC images
+function get_cc_images() {
+  $cc_images = '';
+  reset($this->allowed_types);
+  while (list($key, $value) = each($this->allowed_types)) {
+  //  $cc_images .= tep_image(DIR_WS_ICONS . $key . '.gif', $value);
+    $cc_images .= tep_image(DIR_WS_IMAGES. 'cards/' . $key . '.gif', $value); 
+  }
+  return $cc_images;
+}
+function javascript_validation() {
+ if(MODULE_PAYMENT_CC_CCV == 'True' ) {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.cc_number.value;' . "\n" .
+            '    var cc_ccv = document.checkout_payment.cc_ccv.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+             '    if (cc_ccv == "" || cc_ccv.length < "3") {' . "\n".
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_CVC . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+          }else{
+    $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.cc_number.value;' . "\n" .
+            '    var cc_ccv = document.checkout_payment.ccv.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_CVC_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+    }
+
+      return $js;
+    }
+
+
+
+    function selection() {
+      global $order;
+        reset($this->allowed_types);
+        while (list($key, $value) = each($this->allowed_types)) {
+          $card_menu[] = array('id' => $key, 'text' => $value);
+        }
+
+      for ($i=1; $i<13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime(' %m',mktime(0,0,0,$i,1,2000)));
+     //   $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+if(MODULE_PAYMENT_CC_CCV == 'True' ) {
+      $selection = array('id' => $this->code,
+                 'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images(),
+                 'fields' => array(array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_TYPE,
+     'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+                  array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_OWNER,
+                         'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                  array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_NUMBER,
+                         'field' => tep_draw_input_field('cc_number')),
+                  array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_EXPIRES,
+                         'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
+            array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_CCV . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVS_HELP, '', 'SSL') . '\')">' . '<u><i>' . '(' . MODULE_PAYMENT_CC_CVC_TEXT_CCV_LINK . ')' . '</i></u></a>',
+      'field' => tep_draw_input_field('cc_ccv','',"SIZE=4, MAXLENGTH=4"))));
+}else{
+      $selection = array('id' => $this->code,
+          'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images(),
+                 'fields' => array(array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_TYPE,
+     'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+                  array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_OWNER,
+                        'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                  array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_NUMBER,
+                        'field' => tep_draw_input_field('cc_number')),
+                  array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_EXPIRES,
+                        'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year))));
+  }
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+        include(DIR_WS_CLASSES . 'cc_validation.php');
+        $cc_validation = new cc_validation();
+    $result = $cc_validation->validate( $HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year'], $HTTP_POST_VARS['cc_ccv'], $HTTP_POST_VARS['credit_card_type']);
+       // $result = $cc_validation->validate($HTTP_POST_VARS['credit_card_type'], $HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_ccv'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year']);
+        $error = '';
+    switch ($result) {
+      case -1:
+        $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+        break;
+      case -2:
+      case -3:
+      case -4:
+        $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+        break;
+      case -5:
+        $error = TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH;
+        break;
+      case -6;
+                        $error = TEXT_CCVAL_ERROR_SHORT;
+                        break;
+    case -7:
+            $error = TEXT_CCVAL_ERROR_BLACKLIST;
+      break;
+    case -8:
+            $error = TEXT_CCVAL_ERROR_CVV_LENGTH;
+      break;          
+  
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['cc_owner']) . '&cc_expires_month=' . $HTTP_POST_VARS['cc_expires_month'] . '&cc_expires_year=' . $HTTP_POST_VARS['cc_expires_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+            $this->cc_card_type = $cc_validation->cc_type;
+            $this->cc_card_number = $cc_validation->cc_number;
+            $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+            $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+            $this->cc_ccv = $cc_validation->cc_ccv;
+   
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS, $x_Card_Code, $cc_ccv;
+
+       $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_CCV,
+                                                    'field' => str_repeat('X', (strlen($HTTP_POST_VARS['cc_ccv'])))),
+                                              array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                                              array('title' => MODULE_PAYMENT_CC_CVC_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year'])),
+                                                      )));
+      return $confirmation;
+    }
+
+    function process_button() {
+      global $HTTP_POST_VARS;
+
+      $process_button_string = tep_draw_hidden_field('cc_owner', $HTTP_POST_VARS['cc_owner']) .
+                               tep_draw_hidden_field('cc_expires',$this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .
+                               tep_draw_hidden_field('cc_type', $this->cc_card_type) .
+                               tep_draw_hidden_field('cc_number', $this->cc_card_number) .
+                               tep_draw_hidden_field('cc_ccv', $this->cc_ccv);
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $HTTP_POST_VARS, $order, $cc_middle, $cc_ccv; 
+
+      if ( (defined('MODULE_PAYMENT_CC_CVC_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_CVC_EMAIL)) ) {
+        $len = strlen($HTTP_POST_VARS['cc_number']);
+
+        $this->cc_middle = substr($HTTP_POST_VARS['cc_number'], 4, ($len-8));
+        $this->cc_ccv = (int)$HTTP_POST_VARS['cc_ccv'];
+        $order->info['cc_number'] = substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4);
+      }
+    }
+
+    function after_process() {
+      global $insert_id, $HTTP_POST_VARS, $order;
+     if ( (defined('MODULE_PAYMENT_CC_CVC_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_CVC_EMAIL)) ) {
+        $len = strlen($HTTP_POST_VARS['cc_number']);
+
+        $this->cc_middle = substr($HTTP_POST_VARS['cc_number'], 4, ($len-8));
+      $this->cc_ccv = $HTTP_POST_VARS['cc_ccv'];
+      $order->info['cc_number'] = substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4);
+      }
+
+      if ( (defined('MODULE_PAYMENT_CC_CVC_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_CVC_EMAIL)) ) {
+        $message = 'Order #' . $insert_id . "\n\n" .  'Middle: ' . $this->cc_middle . "\n\n" .  'ccv : ' . $this->cc_ccv . "\n\n" ;
+
+        tep_mail('', MODULE_PAYMENT_CC_CVC_EMAIL, 'Extra Order Info: #' . $insert_id, $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+  //      tep_db_query("update " . TABLE_ORDERS . " set cc_number = '" . $order->info['cc_number'] . "' where orders_id = '" . $insert_id . "'");
+      }
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_CC_CVC_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CC_CVC_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('CC Enable Credit Card Module', 'MODULE_PAYMENT_CC_CVC_STATUS', 'True', 'Do you want to accept credit card payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('CC Split Credit Card E-Mail Address', 'MODULE_PAYMENT_CC_CVC_EMAIL', '', 'If an e-mail address is entered, the middle digits of the credit card number will be sent to the e-mail address (the outside digits are stored in the database with the middle digits censored)<br>If you enable ccv checking you must enter an Email here', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accepted Credit Cards', 'MODULE_PAYMENT_CC_CVC_ACCEPTED_CC', 'Mastercard, Visa', 'The credit cards you currently accept', '6', '3', '_selectOptionscc(array(\'Visa\', \'Mastercard\', \'Discover\', \'Amex\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CCV code', 'MODULE_PAYMENT_CC_CCV', 'True', 'Do you want to enable ccv code checking?<br> The ccv code will not be store but emailed to you. Please ensure that you enter your email address in CC Split Credit Card E-Mail Address.', '6', '4', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('CC Sort order of  display.', 'MODULE_PAYMENT_CC_CVC_SORT_ORDER', '40', 'Sort order of CC display. Lowest is displayed first.', '6', '5' , now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('CC Payment Zone', 'MODULE_PAYMENT_CC_CVC_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '6', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('CC Set Order Status', 'MODULE_PAYMENT_CC_CVC_ORDER_STATUS_ID', '0', 'Set the status of CC orders made with this payment module to this value', '6', '7', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+   
+   }
+
+    function remove() {
+          $keys = '';
+          $keys_array = $this->keys();
+          for ($i=0; $i<sizeof($keys_array); $i++) {
+            $keys .= "'" . $keys_array[$i] . "',";
+          }
+          $keys = substr($keys, 0, -1);
+
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_CC_CVC_STATUS', 'MODULE_PAYMENT_CC_CVC_EMAIL', 'MODULE_PAYMENT_CC_CVC_ACCEPTED_CC', 'MODULE_PAYMENT_CC_CCV', 'MODULE_PAYMENT_CC_CVC_ZONE', 'MODULE_PAYMENT_CC_CVC_ORDER_STATUS_ID', 'MODULE_PAYMENT_CC_CVC_SORT_ORDER');
+    }
+  }
+  // Authorize.net Consolidated Credit Card Checkbox Implementation
+  // Code from UPS Choice v1.7 - Fritz Clapp (aka dreamscape, thanks Fritz!)
+ function _selectOptionscc($select_array, $key_value, $key = '') {
+    for ($i=0; $i<(sizeof($select_array)); $i++) {
+      $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+      $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+      $key_values = explode(", ", $key_value);
+      if (in_array($select_array[$i], $key_values)) $string .= ' checked="checked"';
+      $string .= '> ' . $select_array[$i];
+    }
+    return $string;
+  }
+
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/cc_old.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/cc_old.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/cc_old.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,210 @@
+<?php
+/*
+  $Id: cc.php,v 1.1.1.1 2004/03/04 23:41:17 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class cc_old {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function cc_old() {
+      global $order;
+
+      $this->code = 'cc_old';
+      $this->title = MODULE_PAYMENT_CC_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_CC_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_CC_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_CC_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_CC_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_CC_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_CC_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_CC_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.cc_number.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+
+      for ($i=1; $i<13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('cc_number')),
+                                           array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year))));
+
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+      include(DIR_WS_CLASSES . 'cc_validation.php');
+
+      $cc_validation = new cc_validation();
+      $result = $cc_validation->validate($HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year']);
+
+      $error = '';
+      switch ($result) {
+        case -1:
+          $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+          break;
+        case -2:
+        case -3:
+        case -4:
+          $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+          break;
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['cc_owner']) . '&cc_expires_month=' . $HTTP_POST_VARS['cc_expires_month'] . '&cc_expires_year=' . $HTTP_POST_VARS['cc_expires_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = $cc_validation->cc_type;
+      $this->cc_card_number = $cc_validation->cc_number;
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS;
+
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,
+                                                  'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                                              //      'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                              array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year'])))));
+
+      return $confirmation;
+    }
+
+    function process_button() {
+      global $HTTP_POST_VARS;
+
+      $process_button_string = tep_draw_hidden_field('cc_owner', $HTTP_POST_VARS['cc_owner']) .
+                               tep_draw_hidden_field('cc_expires', $HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year']) .
+                               tep_draw_hidden_field('cc_type', $this->cc_card_type) .
+                               tep_draw_hidden_field('cc_number', $this->cc_card_number);
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $HTTP_POST_VARS, $order;
+
+      if ( (defined('MODULE_PAYMENT_CC_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_EMAIL)) ) {
+        $len = strlen($HTTP_POST_VARS['cc_number']);
+
+        $this->cc_middle = substr($HTTP_POST_VARS['cc_number'], 4, ($len-8));
+        $order->info['cc_number'] = substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4);
+      }
+    }
+
+    function after_process() {
+      global $insert_id;
+
+      if ( (defined('MODULE_PAYMENT_CC_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_EMAIL)) ) {
+        $message = 'Order #' . $insert_id . "\n\n" . 'Middle: ' . $this->cc_middle . "\n\n";
+
+        tep_mail('', MODULE_PAYMENT_CC_EMAIL, 'Extra Order Info: #' . $insert_id, $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+      }
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_CC_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CC_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('CC Enable Credit Card Module', 'MODULE_PAYMENT_CC_STATUS', 'True', 'Do you want to accept credit card payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('CC Split Credit Card E-Mail Address', 'MODULE_PAYMENT_CC_EMAIL', '', 'If an e-mail address is entered, the middle digits of the credit card number will be sent to the e-mail address (the outside digits are stored in the database with the middle digits censored)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('CC Sort order of  display.', 'MODULE_PAYMENT_CC_SORT_ORDER', '0', 'Sort order of CC display. Lowest is displayed first.', '6', '0' , now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('CC Payment Zone', 'MODULE_PAYMENT_CC_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('CC Set Order Status', 'MODULE_PAYMENT_CC_ORDER_STATUS_ID', '0', 'Set the status of CC orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_CC_STATUS', 'MODULE_PAYMENT_CC_EMAIL', 'MODULE_PAYMENT_CC_ZONE', 'MODULE_PAYMENT_CC_ORDER_STATUS_ID', 'MODULE_PAYMENT_CC_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/cc_uk.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/cc_uk.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/cc_uk.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,539 @@
+<?php
+/*
+  $Id: cc.php,v 1.1.1.1 2004/03/04 23:41:17 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class cc_uk {
+    var $code, $title, $description, $enabled, $sort_order;
+    var $accepted_cc, $card_types, $allowed_types, $cc_ccv, $cc_middle;
+// class constructor
+    function cc_uk() {
+      global $order;
+      
+      $this->code = 'cc_uk';
+      $this->title = MODULE_PAYMENT_CC_UK_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_CC_UK_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_CC_UK_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_CC_UK_STATUS == 'True') ? true : false);
+      $this->accepted_cc = MODULE_PAYMENT_CC_UK_ACCEPTED_CC; 
+      
+      if ((int)MODULE_PAYMENT_CC_UK_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_CC_UK_ORDER_STATUS_ID;
+      }
+
+     if (is_object($order)) $this->update_status();
+       //array for credit card selection
+          $this->card_types = array('Visa' => MODULE_PAYMENT_CC_TEXT_VISA ,
+                              'Mastercard' => MODULE_PAYMENT_CC_TEXT_MASTERCARD  ,
+                                'Discover' => MODULE_PAYMENT_CC_TEXT_DISCOVERY  ,
+                                    'Amex' => MODULE_PAYMENT_CC_TEXT_AMEX  ,
+                        'American_Express' => MODULE_PAYMENT_CC_TEXT_AMERICAN_EXPRESS  ,
+                                   'Delta' => MODULE_PAYMENT_CC_TEXT_DELTA  ,
+                             'UK_Electron' => MODULE_PAYMENT_CC_TEXT_UK_ELCECTRON  ,
+                                 'Maestro' => MODULE_PAYMENT_CC_TEXT_MEASTRO  ,
+                               'UK_Switch' => MODULE_PAYMENT_CC_TEXT_UK_SWITCH  ,
+                                    'Solo' => MODULE_PAYMENT_CC_TEXT_SOLO  ,
+                     'Australian_BankCard' => MODULE_PAYMENT_CC_TEXT_AUSTRALIAN_BANKCARD  ,
+                                     'JCB' => MODULE_PAYMENT_CC_TEXT_JCB  ,
+                           'Carte_Blanche' => MODULE_PAYMENT_CC_TEXT_CATRE_BLANCHE  ,
+                             'Diners_Club' => MODULE_PAYMENT_CC_TEXT_DINNERS_CLUB  );
+          
+          $this->allowed_types = array();
+      
+          // Credit card pulldown list
+          $cc_array = explode(', ', MODULE_PAYMENT_CC_UK_ACCEPTED_CC);
+          while (list($key, $value) = each($cc_array)) {
+            $this->allowed_types[$value] = $this->card_types[$value];
+          }
+      
+          // this may not be right
+        //  $this->form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false);
+        }
+
+ //   }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_CC_UK_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_CC_UK_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+//concatenate to get CC images
+function get_cc_images() {
+  $cc_images = '';
+  reset($this->allowed_types);
+  while (list($key, $value) = each($this->allowed_types)) {
+  //  $cc_images .= tep_image(DIR_WS_ICONS . $key . '.gif', $value);
+    $cc_images .= tep_image(DIR_WS_IMAGES. 'cards/' . $key . '.gif', $value); 
+  }
+  return $cc_images;
+}
+function javascript_validation() {
+ if(MODULE_PAYMENT_CC_UK_CCV  == 'True' ) {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.cc_number.value;' . "\n" .
+            '    var cc_ccv = document.checkout_payment.ccv.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_UK_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_UK_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+             '    if (cc_ccv == "" || cc_ccv.length < "3") {' . "\n".
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_UK_TEXT_JS_CC_UK . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+          }else{
+    $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.cc_number.value;' . "\n" .
+            '    var cc_ccv = document.checkout_payment.ccv.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_UK_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CC_UK_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+    }
+
+      return $js;
+    }
+
+
+
+    function selection() {
+      global $order;
+        reset($this->allowed_types);
+        while (list($key, $value) = each($this->allowed_types)) {
+          $card_menu[] = array('id' => $key, 'text' => $value);
+        }
+
+      for ($i=1; $i<13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime(' %m',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+// BMC Changes Start
+// for start date
+      for ($i=1; $i < 13; $i++) {
+        $start_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime(' %m',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate(); 
+      for ($i=$today['year']-4; $i <= $today['year']; $i++) {
+        $start_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }   
+    if (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) == 'true' )) {
+// ++ issue ++ ccv ++ start date
+      $selection = array('id' => $this->code,
+                 'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images(),
+                 'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_TYPE,
+     'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+                  array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('cc_number')),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START,
+                                                 'field' => tep_draw_pull_down_menu('cc_start_month', $start_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_start_year', $start_year)),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV  . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVS_HELP, '', 'SSL') . '\')">' . MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK . '</a>',
+                                                 'field' => tep_draw_input_field('cc_ccv', '', 'size=4 maxlength=4')),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE,
+                                                 'field' => tep_draw_input_field('cc_issue', '', 'size=2 maxlength=2'))));
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) == 'true' )) {
+// -- cvv ++ issue ++ start date
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('cc_number')),
+             array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START,
+                   'field' => tep_draw_pull_down_menu('cc_start_month', $start_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_start_year', $start_year)),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
+             array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE,
+             'field' => tep_draw_input_field('cc_issue', '', 'size=2 maxlength=2'))));
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) == 'true' )) {
+// ++ cvv -- issue ++ start date
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('cc_number')),
+             array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START,
+             'field' => tep_draw_pull_down_menu('cc_start_month', $start_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_start_year', $start_year)),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV  . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVS_HELP, '', 'SSL') . '\')">' . MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK . '</a>',
+             'field' => tep_draw_input_field('cc_ccv', '', 'size=4 maxlength=4')),
+));
+      } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) != 'true' )) {
+// -- cvv ++ issue -- start date
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('cc_number')),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
+             array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE,
+             'field' => tep_draw_input_field('cc_issue', '', 'size=2 maxlength=2'))));
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) != 'true' )) {
+// ++ cvv -- issue -- start date
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('cc_number')),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV  . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVS_HELP, '', 'SSL') . '\')">' . MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK . '</a>',
+             'field' => tep_draw_input_field('cc_ccv', '', 'size=4 maxlength=4')),
+));
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) != 'true' )) {
+// ++ cvv ++ issue -- start date
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('cc_number')),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV  . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVS_HELP, '', 'SSL') . '\')">' . MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK . '</a>',
+             'field' => tep_draw_input_field('cc_ccv', '', 'size=4 maxlength=4')),
+             array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE,
+             'field' => tep_draw_input_field('cc_issue', '', 'size=2 maxlength=2'))));
+    } else {
+// -- cvv -- issue -- start date
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('cc_number')),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
+));
+          }
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+        include(DIR_WS_CLASSES . 'cc_validation.php');
+        $cc_validation = new cc_validation();
+    $result = $cc_validation->validate( $HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year'], $HTTP_POST_VARS['cc_ccv'], $HTTP_POST_VARS['credit_card_type']);
+       // $result = $cc_validation->validate($HTTP_POST_VARS['credit_card_type'], $HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_ccv'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year']);
+        $error = '';
+    switch ($result) {
+      case -1:
+        $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+        break;
+      case -2:
+      case -3:
+      case -4:
+        $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+        break;
+      case -5:
+        $error = TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH;
+        break;
+      case -6;
+                        $error = TEXT_CCVAL_ERROR_SHORT;
+                        break;
+    case -7:
+            $error = TEXT_CCVAL_ERROR_BLACKLIST;
+      break;
+    case -8:
+            $error = TEXT_CCVAL_ERROR_CVV_LENGTH;
+      break;          
+  
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['cc_owner']) . '&cc_expires_month=' . $HTTP_POST_VARS['cc_expires_month'] . '&cc_expires_year=' . $HTTP_POST_VARS['cc_expires_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+    if ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) != 'true' ) {
+    $this->cc_ccv = '000';
+    }
+            $this->cc_card_type = $cc_validation->cc_type;
+            $this->cc_card_number = $cc_validation->cc_number;
+            $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+            $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+            $this->cc_ccv = $cc_validation->cc_ccv;
+   
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS, $x_Card_Code, $cc_ccv;
+if (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) == 'true' )) {
+// ++ cvv ++ issue ++ start date
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START, 
+                                'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_start_month'],1,$HTTP_POST_VARS['cc_start_year']))),                                              
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV  . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVS_HELP, '', 'SSL') . '\')">' . MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK . '</a>',
+                      'field' => str_repeat('X', (strlen($HTTP_POST_VARS['cc_ccv'])))),
+                      array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE,
+                  'field' => $HTTP_POST_VARS['cc_issue'])));
+      return $confirmation;    
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) == 'true' )) {
+// -- cvv ++ issue ++ start date
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                    array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START, 
+                                'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_start_month'],1,$HTTP_POST_VARS['cc_start_year']))),                                              
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE,
+                'field' => $HTTP_POST_VARS['cc_issue'])));
+      return $confirmation;
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) == 'true' )) {
+// ++ cvv -- issue ++ start date
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START, 
+                                'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_start_month'],1,$HTTP_POST_VARS['cc_start_year']))),                                              
+                      array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV  . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVS_HELP, '', 'SSL') . '\')">' . MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK . '</a>',
+                      'field' => str_repeat('X', (strlen($HTTP_POST_VARS['cc_ccv'])))),
+));
+      return $confirmation;
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) != 'true' )) {
+// -- cvv ++ issue -- start date
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                  array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),
+                    array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE,
+                    'field' => $HTTP_POST_VARS['cc_issue'])));
+      return $confirmation;
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) == 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) != 'true' )) {
+// ++ cvv -- issue -- start date
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),
+                                           array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV  . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVS_HELP, '', 'SSL') . '\')">' . MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK . '</a>',
+                'field' => str_repeat('X', (strlen($HTTP_POST_VARS['cc_ccv'])))),
+));
+      return $confirmation;
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) == 'true' )) {
+// -- cvv -- issue ++ start date
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_START, 
+                                'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_start_month'],1,$HTTP_POST_VARS['cc_start_year']))),                                              
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),
+));
+      return $confirmation;
+    } elseif (( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_CVV) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS) != 'true' ) && ( strtolower(MODULE_PAYMENT_CC_UK_USE_CC_START) == 'true' )) {
+// ++ cvv ++ issue -- start date
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),
+                                            array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_CVV  . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVS_HELP, '', 'SSL') . '\')">' . MODULE_PAYMENT_CC_UK_TEXT_CVV_LINK . '</a>',
+                  'field' => str_repeat('X', (strlen($HTTP_POST_VARS['cc_ccv'])))),
+                 array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_ISSUE,
+                   'field' => $HTTP_POST_VARS['cc_issue'])));
+      return $confirmation;
+    } else {
+// -- cvv -- issue -- start date
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['cc_owner']),
+                                              array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4)),
+                array('title' => MODULE_PAYMENT_CC_UK_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),
+));
+      return $confirmation;
+    }
+    }
+
+    function process_button() {
+      global $HTTP_POST_VARS;
+
+      $process_button_string = tep_draw_hidden_field('cc_owner', $HTTP_POST_VARS['cc_owner']) .
+                               tep_draw_hidden_field('cc_expires',$this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .
+                               tep_draw_hidden_field('cc_type', $this->cc_card_type) .
+                               tep_draw_hidden_field('cc_number', $this->cc_card_number) .
+             tep_draw_hidden_field('cc_start', $HTTP_POST_VARS['cc_start_month'] . $HTTP_POST_VARS['cc_start_year']) .
+             tep_draw_hidden_field('cc_issue', $HTTP_POST_VARS['cc_issue']) .
+                               tep_draw_hidden_field('cc_ccv', $this->cc_ccv);
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $HTTP_POST_VARS, $order, $cc_middle, $cc_ccv; 
+
+      if ( (defined('MODULE_PAYMENT_CC_UK_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_UK_EMAIL)) ) {
+        $len = strlen($HTTP_POST_VARS['cc_number']);
+
+        $this->cc_middle = substr($HTTP_POST_VARS['cc_number'], 4, ($len-8));
+        $order->info['cc_ccv'] = (int)$HTTP_POST_VARS['cc_ccv'];
+        $order->info['cc_number'] = substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4);
+      $this->cc_ccv = $HTTP_POST_VARS['cc_ccv'];
+  $this->cc_start = $HTTP_POST_VARS['cc_start'];
+  $this->cc_issue = $HTTP_POST_VARS['cc_issue'];
+      }
+    }
+
+    function after_process() {
+      global $insert_id, $HTTP_POST_VARS, $order;
+     if ( (defined('MODULE_PAYMENT_CC_UK_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_UK_EMAIL)) ) {
+        $len = strlen($HTTP_POST_VARS['cc_number']);
+
+        $this->cc_middle = substr($HTTP_POST_VARS['cc_number'], 4, ($len-8));
+      $order->info['cc_ccv'] = (int)$HTTP_POST_VARS['cc_ccv'];
+      $order->info['cc_number'] = substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4);
+      }
+
+      if ( (defined('MODULE_PAYMENT_CC_UK_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_UK_EMAIL)) ) {
+        $message = 'Order #' . $insert_id . "\n\n" . 'Middle: ' . $this->cc_middle . "\n\n" . 
+    'CCV:' . $this->cc_ccv . "\n\n" . 'Start:' . $this->cc_start . "\n\n" . 
+    'ISSUE:' . $this->cc_issue . "\n\n";
+
+        tep_mail('', MODULE_PAYMENT_CC_UK_EMAIL, 'Extra Order Info: #' . $insert_id, $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+      //  tep_db_query("update " . TABLE_ORDERS . " set cc_number = '" . $order->info['cc_number'] . "' where orders_id = '" . $insert_id . "'");
+      }
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_CC_UK_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CC_UK_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('CC Enable Credit Card Module', 'MODULE_PAYMENT_CC_UK_STATUS', 'True', 'Do you want to accept credit card payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CC Validation', 'MODULE_PAYMENT_CC_UK_VAL', 'True', 'Do you want to enable CC validation and identify cards?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CC Blacklist Check', 'MODULE_PAYMENT_CC_BLACK_UK', 'True', 'Do you want to enable CC blacklist check?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Encrypt CC Info', 'MODULE_PAYMENT_CC_ENC_UK', 'True', 'Do you want to encypt cc info?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('CC Split Credit Card E-Mail Address', 'MODULE_PAYMENT_CC_UK_EMAIL', '', 'If an e-mail address is entered, the middle digits of the credit card number will be sent to the e-mail address (the outside digits are stored in the database with the middle digits censored)<br>If you enable ccv checking you must enter an Email here', '6', '2', now())");
+   //   tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accepted Credit Cards', 'MODULE_PAYMENT_CC_UK_ACCEPTED_CC', 'Mastercard, Visa', 'The credit cards you currently accept', '6', '3', '_selectOptionscc_uk(array(\'Visa\', \'Mastercard\', \'Discover\', \'Amex\'), ', now())");
+   //   tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CCV code', 'MODULE_PAYMENT_CC_UK_CCV', 'True', 'Do you want to enable ccv code checking?', '6', '4', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('CC Sort order of  display.', 'MODULE_PAYMENT_CC_UK_SORT_ORDER', '40', 'Sort order of CC display. Lowest is displayed first.', '6', '5' , now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('CC Payment Zone', 'MODULE_PAYMENT_CC_UK_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '6', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('CC Set Order Status', 'MODULE_PAYMENT_CC_UK_ORDER_STATUS_ID', '0', 'Set the status of CC orders made with this payment module to this value', '6', '7', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Collect CCV Number', 'MODULE_PAYMENT_CC_UK_USE_CC_CVV', 'True', 'Do you want to collect CCV Number?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Collect Issue Number', 'MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS', 'True', 'Do you want to collect Issue Number?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Collect Start Date', 'MODULE_PAYMENT_CC_UK_USE_CC_START', 'True', 'Do you want to collect the Start Date?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('CCV Number Length', 'MODULE_PAYMENT_CC_UK_CVV_MIN_LENGTH', '3', 'Define CCV length. The default is 3 and should not be changed unless the industry standard changes.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Split  Card E-Mail Address', 'MODULE_PAYMENT_CC_UK_EMAIL', '', 'If an e-mail address is entered, the middle digits of the  card number will be sent to the e-mail address (the outside digits are stored in the database with the middle digits censored)', '6', '0', now())");
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accepted Credit Cards', 'MODULE_PAYMENT_CC_UK_ACCEPTED_CC', 'Mastercard, Visa', 'The credit cards you currently accept', '6', '3', '_selectOptionscc_uk(array(\'Visa\', \'Mastercard\', \'Discover\', \'AMEX\', \'American_Express\', \'Delta\', \'UK_Electron\', \'Maestro\', \'UK_Switch\', \'Solo\', \'Australian_BankCard\', \'JCB\', \'Carte_Blanche\', \'Diners_Club\'), ', now())");
+// BMC Changes End
+    }
+
+    function remove() {
+          $keys = '';
+          $keys_array = $this->keys();
+          for ($i=0; $i<sizeof($keys_array); $i++) {
+            $keys .= "'" . $keys_array[$i] . "',";
+          }
+          $keys = substr($keys, 0, -1);
+
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_CC_UK_STATUS', 'MODULE_PAYMENT_CC_UK_USE_CC_CVV', 'MODULE_PAYMENT_CC_UK_USE_USE_CC_ISS', 'MODULE_PAYMENT_CC_UK_USE_CC_START', 'MODULE_PAYMENT_CC_UK_CVV_MIN_LENGTH', 'MODULE_PAYMENT_CC_ENC_UK', 'MODULE_PAYMENT_CC_UK_VAL', 'MODULE_PAYMENT_CC_BLACK_UK', 'MODULE_PAYMENT_CC_UK_EMAIL', 'MODULE_PAYMENT_CC_UK_ZONE', 'MODULE_PAYMENT_CC_UK_ORDER_STATUS_ID', 'MODULE_PAYMENT_CC_UK_SORT_ORDER', 'MODULE_PAYMENT_CC_UK_ACCEPTED_CC');
+    }
+  }
+  // Authorize.net Consolidated Credit Card Checkbox Implementation
+  // Code from UPS Choice v1.7 - Fritz Clapp (aka dreamscape, thanks Fritz!)
+ function _selectOptionscc_uk($select_array, $key_value, $key = '') {
+    for ($i=0; $i<(sizeof($select_array)); $i++) {
+      $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+      $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+      $key_values = explode(", ", $key_value);
+      if (in_array($select_array[$i], $key_values)) $string .= ' checked="checked"';
+      $string .= '> ' . $select_array[$i];
+    }
+    return $string;
+  }
+
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/ccerr.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/ccerr.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/ccerr.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,91 @@
+<?php
+/*
+  $Id: cod.php,v 1.28 2003/02/14 05:51:31 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ccerr {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function ccerr() {
+      global $order;
+
+      $this->code = 'ccerr';
+      $this->title = MODULE_PAYMENT_CCERR_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_CCERR_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_CCERR_SORT_ORDER;
+      $this->enabled = false;
+    }
+
+// class methods
+    function update_status() {
+          $this->enabled = false;
+    }
+
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+      return array('id' => $this->code,
+                   'module' => $this->title);
+    }
+
+    function pre_confirmation_check() {
+      return false;
+    }
+
+    function confirmation() {
+      return false;
+    }
+
+    function process_button() {
+      return false;
+    }
+
+    function before_process() {
+      return false;
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => 'Error',
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+
+    function check() {
+  // Check if module is installed or not
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CCERR_SORT_ORDER'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_CCERR_SORT_ORDER', '99', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+   }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_CCERR_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/citibank.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/citibank.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/citibank.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,310 @@
+<?php
+/*
+  $Id: citibank.php,v 1.0 2003/03/11 05:03:10 hpdl Exp $
+
+
+  Copyright (c) 2003 by PIGSTUY.COM
+
+  Released under the GNU General Public License
+*/
+
+  class citibank {
+    var $code, $title, $description, $enabled;
+    var $allowed_types,$card_types;
+    var $cc_data,$x_Card_Code;
+    var $cart_id;
+    var $response;
+    	
+   	// class constructor
+    function citibank() {
+    	$this->cc_data = array();
+    	
+		$this->code = 'citibank';
+		
+		$this->title = MODULE_PAYMENT_CITIBANK_TEXT_TITLE;
+		$this->description = MODULE_PAYMENT_CITIBANK_TEXT_DESCRIPTION;
+		$this->enabled = ((MODULE_PAYMENT_CITIBANK_STATUS == 'True') ? true : false);
+		
+		$this->email_footer = MODULE_PAYMENT_CITIBANK_TEXT_EMAIL_FOOTER;
+      
+		$this->allowed_types = array();
+		
+		// Define all supported CC types for transactions
+	    $this->card_types = array(
+	    	'VISA' => MODULE_PAYMENT_CITIBANK_TEXT_VISA,
+	        'MASTER' => MODULE_PAYMENT_CITIBANK_TEXT_MASTER,
+	        'JCB' => MODULE_PAYMENT_CITIBANK_TEXT_JCB,
+	        'UCARD' => MODULE_PAYMENT_CITIBANK_TEXT_UCARD
+	    );
+		
+        // Define allowed CC types for transactions (it gets them from MODULE_PAYMENT_CITIBANK_ACCEPTED_CC constant)
+	    $cc_array = explode(',', MODULE_PAYMENT_CITIBANK_ACCEPTED_CC);
+	    while (list($key, $value) = each($cc_array)) {
+	    	$this->allowed_types[$value] = $this->card_types[$value];
+	    }
+
+    }
+
+// class methods
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+		global $order;
+		
+		// prepare forms for data input
+		
+		$selection = array('id' => $this->code,
+	    'module' => $this->title ,
+	    'fields' => array(
+	    
+	    array('title' => MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_TYPE,
+	    	  'field' => tep_draw_pull_down_menu('cc_type', $this->getAllowedCreditCards())),
+	    	  
+	    array('title' => MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_OWNER,
+	    	  'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+	    	  
+	    array('title' => MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_NUMBER,
+	          'field' => tep_draw_input_field('cc_number')),
+	          
+	    array('title' => MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_EXPIRES,
+	    	  'field' => tep_draw_pull_down_menu('cc_expires_month', $this->getExpireMonths()) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $this->getExpireYears())),
+	    	  
+	    array('title' => 'CVV number ' . ' ' .'<a href="javascript:CVVPopUpWindow(\'' . tep_href_link('cvv.html') . '\')">' . '<u><i>' . '(' . MODULE_PAYMENT_CITIBANK_TEXT_CVV_LINK . ')' . '</i></u></a>',
+	      	  'field' => tep_draw_input_field('cc_cvv','',"SIZE=4, MAXLENGTH=4"))));
+	      
+		return $selection;
+    }
+
+    function pre_confirmation_check() {
+		
+		// include CC validation class and execute validation script
+		include(DIR_WS_CLASSES . 'cc_validation.php');
+		$cc_validation = new cc_validation();
+		
+		//$result = $cc_validation->validate($_POST['cc_number'], $_POST['cc_expires_month'], $_POST['cc_expires_year'], $_POST['cc_cvv'], $_POST['cc_type']);
+		$result = $cc_validation->validate5($_POST['cc_number'], $_POST['cc_expires_month'], $_POST['cc_expires_year'], $_POST['cc_cvv'], $_POST['cc_type']);
+      
+		// if CC validation was unsuccessfull, we need to get error message
+		$error = '';
+		switch ($result) {
+			case -1:
+				$error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+				break;
+			case -2:
+			case -3:
+			case -4:
+				$error = TEXT_CCVAL_ERROR_INVALID_DATE;
+				break;
+			case -5:
+				$error = TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH;
+				break;
+			case -6;
+				$error = TEXT_CCVAL_ERROR_CVV_LENGTH;
+				break;
+			case false:
+				$error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+				break;
+		}
+		
+		// If validation fails redirect to the previous page and print validation error;
+		if ( ($result == false) || ($result < 1) ) {
+			$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($_POST['cc_owner']) . '&cc_expires_month=' . $_POST['cc_expires_month'] . '&cc_expires_year=' . $_POST['cc_expires_year'];
+			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+		}
+
+		// file object data with validated information and prepare for confirmation method
+		$this->cc_data['type'] = $_POST['cc_type'];
+		$this->cc_data['number'] = $cc_validation->cc_number;
+		$this->cc_data['expiry_month'] = $cc_validation->cc_expiry_month;
+		$this->cc_data['expiry_year'] = $cc_validation->cc_expiry_year;
+		$this->cc_data['ccv'] = $_POST['cc_cvv'];
+		$this->cc_data['owner'] = $_POST['cc_owner'];
+    }
+    
+ 	//prepare data for confirmation page
+    function confirmation() {
+       $confirmation = array('title' => $this->title . ': ' . $this->cc_data['type'],
+                            'fields' => array(array('title' => 'CVV number',
+                                                    'field' => $this->cc_data['ccv']),
+                                                    array('title' => MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $this->cc_data['owner']),
+                                              array('title' => MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($this->cc_data['number'], 0, 4) . str_repeat('x', (strlen($this->cc_data['number']) - 8)) . substr($this->cc_data['number'], -4)),
+                                              array('title' => MODULE_PAYMENT_CITIBANK_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$this->cc_data['expiry_month'], 1, $this->cc_data['expiry_year'])))));
+      return $confirmation;
+    }
+
+    // prepare data for final processing (store it into form or into session)
+    function process_button() {
+		$process_button_string = tep_draw_hidden_field('cc_data_ccv', $this->cc_data['ccv']);
+		$process_button_string.= tep_draw_hidden_field('cc_data_type', $this->cc_data['type']);
+		$process_button_string.= tep_draw_hidden_field('cc_data_number', $this->cc_data['number']);
+		$process_button_string.= tep_draw_hidden_field('cc_data_owner',$this->cc_data['owner']);
+		$process_button_string.= tep_draw_hidden_field('cc_data_exp_month',$this->cc_data['expiry_month']);
+		$process_button_string.= tep_draw_hidden_field('cc_data_exp_year',$this->cc_data['expiry_year']);
+		$process_button_string.= tep_draw_hidden_field('cc_data_exp_date', $this->cc_data['expiry_month'] . substr($this->cc_data['expiry_year'], -2));              
+		return $process_button_string;
+    }
+
+    function before_process() {
+    	global $order;
+    	
+		$this->cc_data['type'] = $_POST['cc_data_type'];
+		$this->cc_data['number'] = $_POST['cc_data_number'];
+		$this->cc_data['expiry_month'] = $_POST['cc_data_exp_month'];
+		$this->cc_data['expiry_year'] = $_POST['cc_data_exp_year'];
+		$this->cc_data['expiry_date'] = $_POST['cc_data_exp_date'];
+		$this->cc_data['ccv'] = $_POST['cc_data_ccv'];
+		$this->cc_data['owner'] = $_POST['cc_data_owner'];
+		
+		$error = null;
+
+		if (
+				!MODULE_PAYMENT_CITIBANK_AGENT_URL || (MODULE_PAYMENT_CITIBANK_AGENT_URL=='') ||
+				!MODULE_PAYMENT_CITIBANK_ACCOUNT || (MODULE_PAYMENT_CITIBANK_ACCOUNT=='') || 
+				!MODULE_PAYMENT_CITIBANK_CUSTOMER_ID || (MODULE_PAYMENT_CITIBANK_CUSTOMER_ID=='') || 
+				!MODULE_PAYMENT_CITIBANK_AGREEMENT_ID || (MODULE_PAYMENT_CITIBANK_AGREEMENT_ID=='')
+			) {
+			$error = MODULE_PAYMENT_CITIBANK_TEXT_CONFIGURATION_ERROR;
+		}
+		
+		if (
+				!$this->cc_data['type'] || ($this->cc_data['type'] == '') ||
+				!$this->cc_data['number'] || ($this->cc_data['number'] == '') ||
+				!$this->cc_data['expiry_date'] || ($this->cc_data['expiry_date'] == '') ||
+				!$this->cc_data['ccv'] || ($this->cc_data['ccv'] == '') ||
+				!$this->cc_data['owner'] || ($this->cc_data['owner'] == '')
+    	) {
+    		$error = MODULE_PAYMENT_CITIBANK_TEXT_MISSING_FORM_DATA;
+    	}
+		
+    	
+    	$cart = new shoppingCart();
+    	$cart = $_SESSION['cart'];
+    	
+    	if (!$order->info['total'] || $order->info['total']<=0 || $order->info['total']=="") {
+    		$error = MODULE_PAYMENT_CITIBANK_TEXT_INVALID_PRICE;
+    	}
+    	
+    	if ($error) {
+			$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($this->cc_data['owner']) . '&cc_expires_month=' .$this->cc_data['expiry_month'] . '&cc_expires_year=' . $this->cc_data['expiry_year'];
+			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+    	}
+    	
+		require_once(DIR_WS_INCLUDES.'nusoap.php');
+			
+		$soapclient = new soapclient(MODULE_PAYMENT_CITIBANK_AGENT_URL,true);
+		$proxy = $soapclient->getProxy();		
+
+		$params = array(
+			'customerUserID' => MODULE_PAYMENT_CITIBANK_ACCOUNT, //ok
+			'agreementID' => MODULE_PAYMENT_CITIBANK_AGREEMENT_ID, // ok
+			'customerID' => MODULE_PAYMENT_CITIBANK_CUSTOMER_ID, // ok
+			'cardType' => $this->cc_data['type'],
+			'cardNo' => $this->cc_data['number'],
+			'CVV' => $this->cc_data['ccv'],
+			'expiredDate' => $this->cc_data['expiry_date'],
+			'authAmnt' => $order->info['total'],
+			'orderID' => $_SESSION['cart_address_id']
+		);
+		
+		$this->cart_id = $_SESSION['cart_address_id'];
+		
+		// testing
+		$result=$proxy->normalAuthorize($params);
+		
+		
+		// processing
+		//$result=$proxy->saleAuthorize($params);
+		
+		if (!$result) {
+			$error=MODULE_PAYMENT_CITIBANK_TEXT_PROCESSING_ERROR;
+			$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($this->cc_data['owner']) . '&cc_expires_month=' .$this->cc_data['expiry_month'] . '&cc_expires_year=' . $this->cc_data['expiry_year'];
+			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+		}
+		
+		if ($result['errorMessage']!=null or $result['responseCode']!='00') {
+			$error=MODULE_PAYMENT_CITIBANK_TEXT_DECLINED_TRANSACTION;
+			$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($this->cc_data['owner']) . '&cc_expires_month=' .$this->cc_data['expiry_month'] . '&cc_expires_year=' . $this->cc_data['expiry_year'];
+			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+		}
+		
+		$this->response = $result;
+		
+		return $result;
+    }
+
+    function after_process() {
+    	global $insert_id, $order;
+    	
+    	$result = $this->response;
+    	tep_db_query("insert into citibank_transaction_history (cart_id, approved_code, auth_amnt, bank_id, bank_name, bank_rrn, hub_rrn, terminal_id, trans_date, trans_time) values ('".$insert_id."','".$result['approveCode']."', '".$result['authAmnt']."', '".$result['bankID']."', '".$result['bankName']."', '".$result['bankRRN']."', '".$result['hubRRN']."', '".$result['terminalID']."', '".$result['transDate']."','".$result['transTime']."');");	
+    	var_dump($this->response);
+    	die();
+    	
+		return false;
+    }
+
+    function get_error() {
+      return false;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CITIBANK_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Citibank payment module', 'MODULE_PAYMENT_CITIBANK_STATUS', 'True', 'Enable citibank payment module', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Citibank agent URL', 'MODULE_PAYMENT_CITIBANK_AGENT_URL', 'http://220.130.23.177/epayment/services/EpayHubPhpSoap?wsdl', 'Url to Citibank\'s SOAP application (leave default if you don\'t know what it means)', '6', '1', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Citibank account', 'MODULE_PAYMENT_CITIBANK_ACCOUNT', '', 'Account name with citibank institution', '6', '1', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Customer ID', 'MODULE_PAYMENT_CITIBANK_CUSTOMER_ID', '', '', '6', '1', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Agreement ID', 'MODULE_PAYMENT_CITIBANK_AGREEMENT_ID', '', '', '6', '1', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CITIBANK_STATUS'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CITIBANK_ACCOUNT'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CITIBANK_AGENT_URL'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CITIBANK_CUSTOMER_ID'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CITIBANK_AGREEMENT_ID'");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_CITIBANK_STATUS','MODULE_PAYMENT_CITIBANK_AGENT_URL','MODULE_PAYMENT_CITIBANK_ACCOUNT','MODULE_PAYMENT_CITIBANK_CUSTOMER_ID','MODULE_PAYMENT_CITIBANK_AGREEMENT_ID');
+    }
+    
+    /* ADDITIONAL FUNCTIONS */
+    
+    function getExpireMonths() {
+		for ($i=1; $i<13; $i++) {
+			$expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+		}
+		return $expires_month;
+    }
+	
+    function getExpireYears() {
+    	$today = getdate();
+		for ($i=$today['year']; $i < $today['year']+10; $i++) {
+			$expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+		}
+		return $expires_year;
+    }
+    
+    function getAllowedCreditCards() {
+  		reset($this->allowed_types);
+		while (list($key, $value) = each($this->allowed_types)) {
+			$card_menu[] = array('id' => $key, 'text' => $value);
+		}
+		
+		return $card_menu;
+    }
+    	
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/ckmerchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/ckmerchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/ckmerchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,240 @@
+<?php
+/*
+  $Id: ckmerchantpartners.php,v 1.47 2004/02/06 05:51:31 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  class ckmerchantpartners {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function ckmerchantpartners() {
+      global $order;
+
+      $this->code = 'ckmerchantpartners';
+      $this->title = MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_CKMERCHANTPARTNERS_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_CKMERCHANTPARTNERS_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_CKMERCHANTPARTNERS_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_CKMERCHANTPARTNERS_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://trans.atsbank.com/cgi-bin/trans.cgi';
+
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_CKMERCHANTPARTNERS_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_CKMERCHANTPARTNERS_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var ck_owner = document.checkout_payment.ckmerchantpartners_ck_owner.value;' . "\n" .
+            '    var ck_number = document.checkout_payment.ckmerchantpartners_ck_number.value;' . "\n" .
+            '    if (ck_owner == "") { ' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_JS_CK_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (ck_number == "") {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_JS_CK_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+
+      for ($i=1; $i < 13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_OWNER,
+                                                 'field' => tep_draw_input_field('ckmerchantpartners_ck_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_NUMBER,
+                                                 'field' => tep_draw_input_field('ckmerchantpartners_ck_number')),
+                                           array('title' => MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_ABA,
+                                                 'field' => tep_draw_input_field('ckmerchantpartners_ck_aba'))));
+
+      return $selection;
+    }
+
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+      include(DIR_WS_CLASSES . 'cc_validation.php');
+
+      $cc_validation = new cc_validation();
+      $result = '1';
+
+      $error = '';
+      switch ($result) {
+        case -1:
+          $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->ck_number, 0, 4));
+          break;
+        case -2:
+        case -3:
+        case -4:
+          $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+          break;
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&ckmerchantpartners_cc_owner=' . urlencode($HTTP_POST_VARS['ckmerchantpartners_cc_owner']) . '&ckmerchantpartners_cc_expires_month=' . $HTTP_POST_VARS['ckmerchantpartners_cc_expires_month'] . '&ckmerchantpartners_cc_expires_year=' . $HTTP_POST_VARS['ckmerchantpartners_cc_expires_year'] . '&ckmerchantpartners_cc_checkcode=' . $HTTP_POST_VARS['ckmerchantpartners_cc_checkcode'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = 'CK'; // $cc_validation->cc_type;
+      $this->ck_number = $HTTP_POST_VARS['ckmerchantpartners_ck_number'];   // $cc_validation->ck_number;
+      $this->ck_aba = $HTTP_POST_VARS['ckmerchantpartners_ck_aba']; // $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS;
+
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_OWNER,
+                                                    'field' => $HTTP_POST_VARS['ckmerchantpartners_ck_owner']),
+                                              array('title' => MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_NUMBER,
+                                                    'field' => $HTTP_POST_VARS['ckmerchantpartners_ck_number']),
+                                              array('title' => MODULE_PAYMENT_CKMERCHANTPARTNERS_TEXT_CHECK_ABA,
+                                                    'field' => $HTTP_POST_VARS['ckmerchantpartners_ck_aba'])));
+
+
+      return $confirmation;
+    }
+
+
+   function process_button() {
+    global $HTTP_POST_VARS, $HTTP_GET_VARS, $order, $customer_id, $session_id;
+    $ns_quicksale = 'ns_quicksale_check';
+
+    $declineurl = 'http://trans.atsbank.com/cgi-bin/redirect.cgi?' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true) . '?' .  'payment_error=' . $this->code . '&ckmerchantpartners_ck_owner=' . urlencode($HTTP_POST_VARS['ckmerchantpartners_ck_owner']);
+
+    $accepturl = 'http://trans.atsbank.com/cgi-bin/redirect.cgi?' . tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false) . '?';
+
+    $process_button_string =   tep_draw_hidden_field('action', $ns_quicksale) .
+                               tep_draw_hidden_field('acctid', MODULE_PAYMENT_CKMERCHANTPARTNERS_ACCTID) .
+                               tep_draw_hidden_field('subid', MODULE_PAYMENT_CKMERCHANTPARTNERS_SUBID) .
+                               tep_draw_hidden_field('ckname', $HTTP_POST_VARS['ckmerchantpartners_ck_owner']) .
+                               tep_draw_hidden_field('ckacct', $HTTP_POST_VARS['ckmerchantpartners_ck_number']) .
+                               tep_draw_hidden_field('ckaba', $HTTP_POST_VARS['ckmerchantpartners_ck_aba']) .
+                         tep_draw_hidden_field('ci_memo', $HTTP_POST_VARS['comments']) .
+                               tep_draw_hidden_field('amount', number_format($order->info['total'], 2 )) .
+                               tep_draw_hidden_field('ci_email', $order->customer['email_address']) .
+                               tep_draw_hidden_field('ci_billaddr1', $order->customer['street_address']) .
+                               tep_draw_hidden_field('ci_billaddr2', $order->customer['suburb']) .
+                               tep_draw_hidden_field('ci_billcity', $order->customer['city']) .
+                               tep_draw_hidden_field('ci_billstate', $order->customer['state']) .
+                               tep_draw_hidden_field('ci_billzip', $order->customer['postcode']) .
+                               tep_draw_hidden_field('ci_billcountry', $order->customer['country']['title']) .
+                               tep_draw_hidden_field('ship_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) .
+                               tep_draw_hidden_field('ship_addr_1', $order->delivery['street_address']) .
+                               tep_draw_hidden_field('ship_addr_2', $order->delivery['suburb']) .
+                               tep_draw_hidden_field('ship_city', $order->delivery['city']) .
+                               tep_draw_hidden_field('ship_state', $order->delivery['state']) .
+                               tep_draw_hidden_field('ship_post_code', $order->delivery['postcode']) .
+                               tep_draw_hidden_field('ship_country', $order->delivery['country']['title']) .
+                               tep_draw_hidden_field('Session_ID', $customer_id) .
+                               tep_draw_hidden_field('declineurl', $declineurl, '', 'SSL', false) .
+                               tep_draw_hidden_field('accepturl', $accepturl, '', 'SSL', false) .
+                               tep_draw_hidden_field('ci_phone', $order->customer['telephone']);
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+    global $HTTP_POST_VARS;
+    }
+
+
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS, $HTTP_POST_VARS;
+
+      if (isset($HTTP_GET_VARS['Status'])) {
+         $error = array('title' => CKMERCHANTPARTNERS_ERROR_HEADING,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['Status'])) . ': ' .  stripslashes(urldecode($HTTP_GET_VARS['Reason'])));
+      }
+      else {
+      $error = array('title' => CKMERCHANTPARTNERS_ERROR_HEADING,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+      }
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CKMERCHANTPARTNERS_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable merchantPartners Check Module', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_STATUS', 'True', 'Do you want to accept merchantPartners payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('AcctID', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_ACCTID', 'TEST0', 'The acctID used for the merchantPartners service', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('SubID', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_SUBID', '', 'The subID for the merchantPartners service', '6', '3', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_CKMERCHANTPARTNERS_STATUS', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_ACCTID', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_SUBID', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_ZONE', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_ORDER_STATUS_ID', 'MODULE_PAYMENT_CKMERCHANTPARTNERS_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/cod.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/cod.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/cod.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,119 @@
+<?php
+/*
+  $Id: cod.php,v 1.1.1.1 2004/03/04 23:41:17 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class cod {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function cod() {
+      global $order;
+
+      $this->code = 'cod';
+      $this->title = MODULE_PAYMENT_COD_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_COD_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_COD_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_COD_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_COD_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_COD_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_COD_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_COD_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+
+// disable the module if the order only contains virtual products
+      if ($this->enabled == true) {
+        if ($order->content_type == 'virtual') {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+      return array('id' => $this->code,
+                   'module' => $this->title);
+    }
+
+    function pre_confirmation_check() {
+      return false;
+    }
+
+    function confirmation() {
+      return false;
+    }
+
+    function process_button() {
+      return false;
+    }
+
+    function before_process() {
+      return false;
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      return false;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_COD_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('COD Enable Cash On Delivery Module', 'MODULE_PAYMENT_COD_STATUS', 'True', 'Do you want to accept Cash On Delevery payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('COD Payment Zone', 'MODULE_PAYMENT_COD_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('COD Sort order of  display.', 'MODULE_PAYMENT_COD_SORT_ORDER', '0', 'Sort order of COD display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('COD Set Order Status', 'MODULE_PAYMENT_COD_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+   }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_COD_STATUS', 'MODULE_PAYMENT_COD_ZONE', 'MODULE_PAYMENT_COD_ORDER_STATUS_ID', 'MODULE_PAYMENT_COD_SORT_ORDER');
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/efsnet.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/efsnet.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/efsnet.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,301 @@
+<?php
+/*
+
+   $Id: efsnet.php,v 1.1.1.1 2004/03/04 23:41:18 ccwjr Exp $
+
+   osCommerce 2.2, Open Source E-Commerce Solutions
+   EFSnet Named Pair Connection
+   Last Update: 08/03/03
+   Author: John Nelson
+   Email: info at phpmage.com
+
+   This class is based off of the authorize.net payment module.  If anything does not work,
+   or any updates are made to improve it's behavior, please email me any changes or
+   questions you may have.
+
+   DISCLAIMER:
+
+     This code is distributed in the hope that it will be useful, but without any warranty;
+     without even the implied warranty of merchantability or fitness for a particular
+     purpose.
+
+*/
+class efsnet {
+
+  // class constructor
+  function efsnet() {
+    global $order;
+
+    $this->code = 'efsnet';
+    $this->title = MODULE_PAYMENT_EFSNET_TEXT_TITLE;
+    $this->description = MODULE_PAYMENT_EFSNET_TEXT_DESCRIPTION;
+    $this->enabled = ((MODULE_PAYMENT_EFSNET_STATUS == 'True') ? true : false);
+    $this->sort_order = MODULE_PAYMENT_EFSNET_SORT_ORDER;
+
+    if ((int)MODULE_PAYMENT_EFSNET_ORDER_STATUS_ID > 0) {
+    $this->order_status = MODULE_PAYMENT_EFSNET_ORDER_STATUS_ID;
+    }
+
+    if (is_object($order)) $this->update_status();
+  }
+
+  function pre_confirmation_check() {
+    global $HTTP_POST_VARS;
+    include(DIR_WS_CLASSES . 'cc_validation1.php');
+    $cc_validation = new cc_validation();
+    $result = $cc_validation->validate($HTTP_POST_VARS['efsnet_cc_number'], $HTTP_POST_VARS['efsnet_cc_expires_month'], $HTTP_POST_VARS['efsnet_cc_expires_year']);
+
+    $error = '';
+
+    switch ($result) {
+    case -1:
+      $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+      break;
+    case -2:
+    case -3:
+    case -4:
+      $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+      break;
+    case false:
+      $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+      break;
+    }
+
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&efsnet_cc_owner=' . urlencode($HTTP_POST_VARS['efsnet_cc_owner']) . '&efsnet_cc_expires_month=' . $HTTP_POST_VARS['efsnet_cc_expires_month'] . '&efsnet_cc_expires_year=' . $HTTP_POST_VARS['efsnet_cc_expires_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = $cc_validation->cc_type;
+      $this->cc_card_number = $cc_validation->cc_number;
+      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+
+
+  }
+
+  function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_EFSNET_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_EFSNET_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.efsnet_cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.efsnet_cc_number.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_EFSNET_TEXT_JS_CC_OWNER . '";' . "\n" .
+
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_EFSNET_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+
+      for ($i=1; $i<13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('efsnet_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('efsnet_cc_number')),
+                                           array('title' => MODULE_PAYMENT_EFSNET_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('efsnet_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('efsnet_cc_expires_year', $expires_year))));
+
+      return $selection;
+    }
+
+
+
+  function confirmation() {
+    global $order;
+  }
+
+  function process_button() {
+    global $HTTP_SERVER_VARS, $order, $customer_id;
+    // place credit card variables into the form for the transact method
+    foreach($_POST as $var => $val)
+      echo '<input type="hidden" name="'.$var.'" value="'.$val.'">'."\r\n";
+  }
+
+  // this function is ran before the order is processed
+  function before_process() {
+    global $order;
+    $result = $this->transact();
+    if ($result['ResponseCode'] == '00') return;
+    if ($result['ResponseCode'] == '0') return;
+
+    if (($result['ResponseCode'] != '0')||($result['ResponseCode'] != '00')) {
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_EFSNET_TEXT_DECLINED_MESSAGE.$result['ResultMessage'].$result['data'].print_r($order->info, true)), 'SSL', true, false));
+        }
+
+        // Any other ResponseCode is an error as well
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_EFSNET_TEXT_ERROR_MESSAGE.$result['ResultMessage'].$result['data'].print_r($order->info, true)), 'SSL', true, false));
+        return $result();
+  }
+
+  function after_process() {
+    global $order;
+  }
+
+  function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_EFSNET_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+
+  // execute the transaction
+  function transact() {
+    global $HTTP_SERVER_VARS, $order, $customer_id;
+    unset($form_data);
+
+    $form_data = array(
+    Method => MODULE_PAYMENT_EFSNET_METHOD,
+    StoreID => MODULE_PAYMENT_EFSNET_STOREID,
+    StoreKey   => MODULE_PAYMENT_EFSNET_STOREKEY,
+    ApplicationID => 'EFSNet OSCommerce Method',
+    ReferenceNumber => $customer_id,
+    TransactionAmount => number_format($order->info['total'], 2),
+    SalesTaxAmount => number_format($order->info['tax'], 2),
+    AccountNumber => $_POST['efsnet_cc_number'],
+    ExpirationMonth => $_POST['efsnet_cc_expires_month'],
+    ExpirationYear => $_POST['efsnet_cc_expires_month'],
+    BillingName => urlencode($_POST['efsnet_cc_owner']),
+    BillingAddress => $order->customer['street_address'],
+    BillingCity => $order->customer['city'],
+    BillingState => $order->customer['state'],
+    BillingPostalCode => $order->customer['postcode'],
+    BillingCountry => $order->customer['country']['title'],
+    BillingPhone => $order->customer['telephone'],
+    BillingEmail => $order->customer['email_address'],
+    ShippingName => urlencode($order->delivery['firstname']." ".$order->delivery['lastname']),
+    ShippingAddress => $order->delivery['street_address'],
+    ShippingCity => $order->delivery['city'],
+    ShippingState => $order->delivery['state'],
+    ShippingPostalCode => $order->delivery['postcode'],
+    ShippingCountry => $order->delivery['country']['title'],
+    ClientIPAddress => $_SERVER['REMOTE_ADDR']
+    );
+
+    // concatenate order information variables to $data
+    while(list($key, $value) = each($form_data))
+    { $data .= $key . '=' . urlencode(ereg_replace(',', '', $value)) . '&';   }
+
+    // take the last & out for the string
+    $data = substr($data, 0, -1);
+
+    unset($response);
+
+
+    // Post order info data to EFSNet, make sure you have curl installed
+
+    //BEGIN PHP_CURL.DLL CODE - Author: Peter Drake - 4/29/03
+    //Use for Win32 or Unix-type systems with php-curl.dll
+    // Get a CURL handle
+    $curl_handle = curl_init ();
+
+    // Tell CURL the URL of the CGI
+    if (MODULE_PAYMENT_EFSNET_TESTMODE == 'Test')
+      curl_setopt ($curl_handle, CURLOPT_URL, "https://testefsnet.concordebiz.com/EFSnet.dll");
+      else curl_setopt ($curl_handle, CURLOPT_URL, "https://efsnet.concordebiz.com/efsnet.dll");
+
+    // This section sets various options. See http://www.php.net/manual/en/function.curl-setopt.php
+    // for more details
+    curl_setopt ($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
+    curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1);
+    curl_setopt ($curl_handle, CURLOPT_POST, 1);
+    curl_setopt ($curl_handle, CURLOPT_POSTFIELDS, $data);
+
+    // Perform the POST and get the data returned by the server.
+    $response = curl_exec ($curl_handle) or die ("There has been an error connecting to EFSNet.");
+
+    // Close the CURL handle
+    curl_close ($curl_handle);
+
+    $details = explode("&", $response);
+
+    foreach($details as $row) {
+      $tmp = explode("=",$row);
+      $result[$tmp[0]] = $tmp[1];
+    }
+    unset($tmp);
+    $result['data'] = $data;
+    return $result;
+
+
+    //END PHP_CURL.DLL CODE
+  }
+
+  // check to see if this module is installed already
+  function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_EFSNET_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+  // install the module
+  function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable EFSnet Module', 'MODULE_PAYMENT_EFSNET_STATUS', 'True', 'Do you want to accept EFSNet payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('EFSnet Login Username', 'MODULE_PAYMENT_EFSNET_STOREID', 'testing', 'The StoreID used for the EFSNet service', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('EFSnet Transaction Key', 'MODULE_PAYMENT_EFSNET_STOREKEY', 'Test', 'Store Key used for encrypting data', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('EFSnet Transaction Mode', 'MODULE_PAYMENT_EFSNET_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Production\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('EFSnet Transaction Method', 'MODULE_PAYMENT_EFSNET_METHOD', 'CreditCardCharge', 'Transaction method used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'CreditCardCharge\',\'CreditCardAuthorize\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('EFSnet Sort order of display.', 'MODULE_PAYMENT_EFSNET_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('EFSnet Payment Zone', 'MODULE_PAYMENT_EFSNET_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('EFSnet Set Order Status', 'MODULE_PAYMENT_EFSNET_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    // remove the module
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    // keys that this module installs into the configuration database
+    function keys() {
+      return array('MODULE_PAYMENT_EFSNET_STATUS', 'MODULE_PAYMENT_EFSNET_STOREID', 'MODULE_PAYMENT_EFSNET_STOREKEY', 'MODULE_PAYMENT_EFSNET_TESTMODE', 'MODULE_PAYMENT_EFSNET_METHOD', 'MODULE_PAYMENT_EFSNET_ZONE', 'MODULE_PAYMENT_EFSNET_ORDER_STATUS_ID', 'MODULE_PAYMENT_EFSNET_SORT_ORDER');
+    }
+
+
+
+
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/freecharger.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/freecharger.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/freecharger.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,120 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class freecharger {
+    var $code, $title, $description, $enabled, $payment;
+
+// class constructor
+    function freecharger() {
+      global $order;
+      $this->code = 'freecharger';
+      $this->title = MODULE_PAYMENT_FREECHARGER_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_FREECHARGER_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_FREECHARGER_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_FREECHARGER_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_FREECHARGER_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_FREECHARGER_ORDER_STATUS_ID;
+        $payment='freecharger';
+      } else {
+        if ($payment=='freecharger') {
+          $payment='';
+        }
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->email_footer = MODULE_PAYMENT_FREECHARGER_TEXT_EMAIL_FOOTER;
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_FREECHARGER_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_FREECHARGER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+      return array('id' => $this->code,
+                   'module' => $this->title);
+    }
+
+    function pre_confirmation_check() {
+      return false;
+    }
+
+    function confirmation() {
+      return array('title' => MODULE_PAYMENT_FREECHARGER_TEXT_DESCRIPTION);
+    }
+
+    function process_button() {
+      return false;
+    }
+
+    function before_process() {
+      return false;
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      return false;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_FREECHARGER_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Free Charge Module', 'MODULE_PAYMENT_FREECHARGER_STATUS', 'True', 'Do you want to accept Free Charge payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Free Charge Sort order of display.', 'MODULE_PAYMENT_FREECHARGER_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Free Charge Payment Zone', 'MODULE_PAYMENT_FREECHARGER_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Free Charge Set Order Status', 'MODULE_PAYMENT_FREECHARGER_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_FREECHARGER_STATUS', 'MODULE_PAYMENT_FREECHARGER_ZONE', 'MODULE_PAYMENT_FREECHARGER_ORDER_STATUS_ID', 'MODULE_PAYMENT_FREECHARGER_SORT_ORDER');
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/geotrust.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/geotrust.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/geotrust.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,223 @@
+<?php
+/*
+  $Id: geotrust.php,v 1.1.1.1 2004/03/04 23:41:18 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce / Paul Kim
+
+  Released under the GNU General Public License
+*/
+
+  class geotrust{
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function geotrust() {
+      global $order;
+
+      $this->code = 'geotrust';
+      $this->title = MODULE_PAYMENT_GEOTRUST_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_GEOTRUST_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_GEOTRUST_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_GEOTRUST_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_GEOTRUST_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_GEOTRUST_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://developer.skipjackic.com/scripts/EvolvCC.dll?Authorize';
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_GEOTRUST_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_GEOTRUST_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_number = document.checkout_payment.geotrust_cc_number.value;' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_GEOTRUST_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+
+      for ($i=1; $i < 13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_FIRST_NAME,
+                                                 'field' => tep_draw_input_field('geotrust_cc_owner_firstname', $order->billing['firstname'])),
+                                           array('title' => MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER_LAST_NAME,
+                                                 'field' => tep_draw_input_field('geotrust_cc_owner_lastname', $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('geotrust_cc_number')),
+                                           array('title' => MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('geotrust_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('geotrust_cc_expires_year', $expires_year)),
+                                           array('title' => MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2,
+                                                 'field' => tep_draw_input_field('geotrust_cc_cvv2', '', 'size="4" maxlength="3"') . '&nbsp;<small>' . MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_CVV2_LOCATION . '</small>')));
+
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+      include(DIR_WS_CLASSES . 'cc_validation1.php');
+
+      $cc_validation = new cc_validation();
+      $result = $cc_validation->validate($HTTP_POST_VARS['geotrust_cc_number'], $HTTP_POST_VARS['geotrust_cc_expires_month'], $HTTP_POST_VARS['geotrust_cc_expires_year']);
+
+      $error = '';
+      switch ($result) {
+        case -1:
+          $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+          break;
+        case -2:
+        case -3:
+        case -4:
+          $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+          break;
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&geotrust_cc_owner_firstname=' . urlencode($HTTP_POST_VARS['geotrust_cc_owner_firstname']) . '&geotrust_cc_owner_lastname=' . urlencode($HTTP_POST_VARS['geotrust_cc_owner_lastname']) . '&geotrust_cc_expires_month=' . $HTTP_POST_VARS['geotrust_cc_expires_month'] . '&geotrust_cc_expires_year=' . $HTTP_POST_VARS['geotrust_cc_expires_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = $cc_validation->cc_type;
+      $this->cc_card_number = $cc_validation->cc_number;
+      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS;
+
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['geotrust_cc_owner_firstname'] . ' ' . $HTTP_POST_VARS['geotrust_cc_owner_lastname']),
+                                              array('title' => MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                              array('title' => MODULE_PAYMENT_GEOTRUST_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['geotrust_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['geotrust_cc_expires_year'])))));
+
+      return $confirmation;
+    }
+
+    function process_button() {
+      global $HTTP_POST_VARS, $order;
+
+     $process_button_string =  tep_draw_hidden_field('Month', $this->cc_expiry_month) .
+                 tep_draw_hidden_field('Year', substr($this->cc_expiry_year, -2)) .
+                               tep_draw_hidden_field('Accountnumber', $this->cc_card_number) .
+                 tep_draw_hidden_field('Serialnumber', MODULE_PAYMENT_GEOTRUST_MERCHANT_ID) .
+                               tep_draw_hidden_field('Ordernumber', STORE_NAME . date('YmdHis')) .
+                               tep_draw_hidden_field('Transactionamount', number_format($order->info['total'], 2, '', '')) .
+                 tep_draw_hidden_field('Orderstring', 'Teanas~' . date('YmdHis') . '~' . number_format($order->info['total'], 2, '', '') . '~1~Y||') .
+                 tep_draw_hidden_field('cvv2', $HTTP_POST_VARS['geotrust_cc_cvv2']) .
+                               tep_draw_hidden_field('sjname', $HTTP_POST_VARS['geotrust_cc_owner_firstname'] . ' ' . $HTTP_POST_VARS['geotrust_cc_owner_lastname']) .
+                               tep_draw_hidden_field('Streetaddress', $order->billing['street_address']) .
+                               tep_draw_hidden_field('Streetaddress2', $order->billing['suburb']) .
+                               tep_draw_hidden_field('City', $order->billing['city']) .
+                               tep_draw_hidden_field('State', $order->billing['state']) .
+                               tep_draw_hidden_field('Zipcode', $order->billing['postcode']) .
+                               tep_draw_hidden_field('Country', $order->billing['country']['title']) .
+                               tep_draw_hidden_field('Shiptophone', $order->customer['telephone']) .
+                               tep_draw_hidden_field('Email', $order->customer['email_address']) .
+                               tep_draw_hidden_field('Shiptoname', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) .
+                               tep_draw_hidden_field('Shiptostreetaddress', $order->delivery['street_address']) .
+                               tep_draw_hidden_field('Shiptostreetaddress2', $order->delivery['suburb']) .
+                               tep_draw_hidden_field('Shiptocity', $order->delivery['city']) .
+                               tep_draw_hidden_field('Shiptostate', $order->delivery['state']) .
+                               tep_draw_hidden_field('Shiptozipcode', $order->delivery['postcode']) .
+                               tep_draw_hidden_field('Shiptocountry', $order->delivery['country']['title']);
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $HTTP_POST_VARS;
+
+      if ($HTTP_POST_VARS['szIsApproved'] != '1') {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_GEOTRUST_TEXT_ERROR_MESSAGE), 'SSL', true, false));
+      }
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_GEOTRUST_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GEOTRUST_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable GeoTrust QuickPayments Module', 'MODULE_PAYMENT_GEOTRUST_STATUS', 'True', 'Do you want to accept GeoTrust QuickPayments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('GeoTrust Merchant ID', 'MODULE_PAYMENT_GEOTRUST_MERCHANT_ID', 'serial #', 'Merchant Serial # to use for the GEOTRUST QuickPayments service', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('GeoTrust Sort order of display.', 'MODULE_PAYMENT_GEOTRUST_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('GeoTrust Payment Zone', 'MODULE_PAYMENT_GEOTRUST_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('GeoTrust Set Order Status', 'MODULE_PAYMENT_GEOTRUST_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_GEOTRUST_STATUS', 'MODULE_PAYMENT_GEOTRUST_MERCHANT_ID', 'MODULE_PAYMENT_GEOTRUST_ZONE', 'MODULE_PAYMENT_GEOTRUST_ORDER_STATUS_ID', 'MODULE_PAYMENT_GEOTRUST_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/ipayment.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/ipayment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/ipayment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,245 @@
+<?php
+/*
+  $Id: ipayment.php,v 1.1.1.1 2004/03/04 23:41:19 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ipayment {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function ipayment() {
+      global $order;
+
+      $this->code = 'ipayment';
+      $this->title = MODULE_PAYMENT_IPAYMENT_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_IPAYMENT_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_IPAYMENT_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_IPAYMENT_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_IPAYMENT_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_IPAYMENT_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://ipayment.de/merchant/' . MODULE_PAYMENT_IPAYMENT_ID . '/processor.php';
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_IPAYMENT_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_IPAYMENT_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.ipayment_cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.ipayment_cc_number.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_IPAYMENT_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+
+      for ($i=1; $i < 13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('ipayment_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('ipayment_cc_number')),
+                                           array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('ipayment_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('ipayment_cc_expires_year', $expires_year)),
+                                           array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER,
+                                                 'field' => tep_draw_input_field('ipayment_cc_checkcode', '', 'size="4" maxlength="4"') . '&nbsp;<small>' . MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION . '</small>')));
+
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+      include(DIR_WS_CLASSES . 'cc_validation1.php');
+
+      $cc_validation = new cc_validation();
+      $result = $cc_validation->validate($HTTP_POST_VARS['ipayment_cc_number'], $HTTP_POST_VARS['ipayment_cc_expires_month'], $HTTP_POST_VARS['ipayment_cc_expires_year']);
+
+      $error = '';
+      switch ($result) {
+        case -1:
+          $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+          break;
+        case -2:
+        case -3:
+        case -4:
+          $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+          break;
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&ipayment_cc_owner=' . urlencode($HTTP_POST_VARS['ipayment_cc_owner']) . '&ipayment_cc_expires_month=' . $HTTP_POST_VARS['ipayment_cc_expires_month'] . '&ipayment_cc_expires_year=' . $HTTP_POST_VARS['ipayment_cc_expires_year'] . '&ipayment_cc_checkcode=' . $HTTP_POST_VARS['ipayment_cc_checkcode'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = $cc_validation->cc_type;
+      $this->cc_card_number = $cc_validation->cc_number;
+      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS;
+
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['ipayment_cc_owner']),
+                                              array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                              array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['ipayment_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['ipayment_cc_expires_year'])))));
+
+      if (tep_not_null($HTTP_POST_VARS['ipayment_cc_checkcode'])) {
+        $confirmation['fields'][] = array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER,
+                                          'field' => $HTTP_POST_VARS['ipayment_cc_checkcode']);
+      }
+
+      return $confirmation;
+    }
+
+    function process_button() {
+      global $HTTP_POST_VARS, $order, $currencies, $currency;
+
+      switch (MODULE_PAYMENT_IPAYMENT_CURRENCY) {
+        case 'Always EUR':
+          $trx_currency = 'EUR';
+          break;
+        case 'Always USD':
+          $trx_currency = 'USD';
+          break;
+        case 'Either EUR or USD, else EUR':
+          if ( ($currency == 'EUR') || ($currency == 'USD') ) {
+            $trx_currency = $currency;
+          } else {
+            $trx_currency = 'EUR';
+          }
+          break;
+        case 'Either EUR or USD, else USD':
+          if ( ($currency == 'EUR') || ($currency == 'USD') ) {
+            $trx_currency = $currency;
+          } else {
+            $trx_currency = 'USD';
+          }
+          break;
+      }
+
+      $process_button_string = tep_draw_hidden_field('silent', '1') .
+                               tep_draw_hidden_field('trx_paymenttyp', 'cc') .
+                               tep_draw_hidden_field('trxuser_id', MODULE_PAYMENT_IPAYMENT_USER_ID) .
+                               tep_draw_hidden_field('trxpassword', MODULE_PAYMENT_IPAYMENT_PASSWORD) .
+                               tep_draw_hidden_field('item_name', STORE_NAME) .
+                               tep_draw_hidden_field('trx_currency', $trx_currency) .
+                               tep_draw_hidden_field('trx_amount', number_format($order->info['total'] * 100 * $currencies->get_value($trx_currency), 0, '','')) .
+                               tep_draw_hidden_field('cc_expdate_month', $HTTP_POST_VARS['ipayment_cc_expires_month']) .
+                               tep_draw_hidden_field('cc_expdate_year', $HTTP_POST_VARS['ipayment_cc_expires_year']) .
+                               tep_draw_hidden_field('cc_number', $HTTP_POST_VARS['ipayment_cc_number']) .
+                               tep_draw_hidden_field('cc_checkcode', $HTTP_POST_VARS['ipayment_cc_checkcode']) .
+                               tep_draw_hidden_field('addr_name', $HTTP_POST_VARS['ipayment_cc_owner']) .
+                               tep_draw_hidden_field('addr_email', $order->customer['email_address']) .
+                               tep_draw_hidden_field('redirect_url', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true)) .
+                               tep_draw_hidden_field('silent_error_url', tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&ipayment_cc_owner=' . urlencode($HTTP_POST_VARS['ipayment_cc_owner']), 'SSL', true));
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      return false;
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => IPAYMENT_ERROR_HEADING,
+                     'error' => ((isset($HTTP_GET_VARS['error'])) ? stripslashes(urldecode($HTTP_GET_VARS['error'])) : IPAYMENT_ERROR_MESSAGE));
+
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_IPAYMENT_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable iPayment Module', 'MODULE_PAYMENT_IPAYMENT_STATUS', 'True', 'Do you want to accept iPayment payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iPayment Account Number', 'MODULE_PAYMENT_IPAYMENT_ID', '99999', 'The account number used for the iPayment service', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iPayment User ID', 'MODULE_PAYMENT_IPAYMENT_USER_ID', '99999', 'The user ID for the iPayment service', '6', '3', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iPayment User Password', 'MODULE_PAYMENT_IPAYMENT_PASSWORD', '0', 'The user password for the iPayment service', '6', '4', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('iPayment Transaction Currency', 'MODULE_PAYMENT_IPAYMENT_CURRENCY', 'Either EUR or USD, else EUR', 'The currency to use for credit card transactions', '6', '5', 'tep_cfg_select_option(array(\'Always EUR\', \'Always USD\', \'Either EUR or USD, else EUR\', \'Either EUR or USD, else USD\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('iPayment Sort order of display.', 'MODULE_PAYMENT_IPAYMENT_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('iPayment Payment Zone', 'MODULE_PAYMENT_IPAYMENT_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('iPayment Set Order Status', 'MODULE_PAYMENT_IPAYMENT_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_IPAYMENT_STATUS', 'MODULE_PAYMENT_IPAYMENT_ID', 'MODULE_PAYMENT_IPAYMENT_USER_ID', 'MODULE_PAYMENT_IPAYMENT_PASSWORD', 'MODULE_PAYMENT_IPAYMENT_CURRENCY', 'MODULE_PAYMENT_IPAYMENT_ZONE', 'MODULE_PAYMENT_IPAYMENT_ORDER_STATUS_ID', 'MODULE_PAYMENT_IPAYMENT_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/merchantpartners.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/merchantpartners.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/merchantpartners.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,251 @@
+<?php
+/*
+  $Id: merchantpartners.php,v 1.47 2003/02/14 05:51:31 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+----- Tony Cun tcun at merchantpartners.com ------
+*/
+
+  class merchantpartners {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function merchantpartners() {
+      global $order;
+
+      $this->code = 'merchantpartners';
+      $this->title = MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_MERCHANTPARTNERS_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_MERCHANTPARTNERS_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_MERCHANTPARTNERS_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_MERCHANTPARTNERS_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://trans.atsbank.com/cgi-bin/trans.cgi';
+
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_MERCHANTPARTNERS_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_MERCHANTPARTNERS_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.merchantpartners_cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.merchantpartners_cc_number.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+
+      for ($i=1; $i < 13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_OWNER,
+                                                 'field' => tep_draw_input_field('merchantpartners_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('merchantpartners_cc_number')),
+                                           array('title' => MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('merchantpartners_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('merchantpartners_cc_expires_year', $expires_year)),
+                                           array('title' => MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2,
+                                                 'field' => tep_draw_input_field('cvv2', '', 'size="5" maxlength="4"') . '&nbsp;<small>' . MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_CVV2_LOCATION . '</small>')));
+
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+      include(DIR_WS_CLASSES . 'cc_validation.php');
+
+      $cc_validation = new cc_validation();
+      $result = $cc_validation->validate($HTTP_POST_VARS['merchantpartners_cc_number'], $HTTP_POST_VARS['merchantpartners_cc_expires_month'], $HTTP_POST_VARS['merchantpartners_cc_expires_year']);
+
+      $error = '';
+      switch ($result) {
+        case -1:
+          $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+          break;
+        case -2:
+        case -3:
+        case -4:
+          $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+          break;
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&merchantpartners_cc_owner=' . urlencode($HTTP_POST_VARS['merchantpartners_cc_owner']) . '&merchantpartners_cc_expires_month=' . $HTTP_POST_VARS['merchantpartners_cc_expires_month'] . '&merchantpartners_cc_expires_year=' . $HTTP_POST_VARS['merchantpartners_cc_expires_year'] . '&merchantpartners_cc_checkcode=' . $HTTP_POST_VARS['merchantpartners_cc_checkcode'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = $cc_validation->cc_type;
+      $this->cc_card_number = $cc_validation->cc_number;
+      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS;
+
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['merchantpartners_cc_owner']),
+                                              array('title' => MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                              array('title' => MODULE_PAYMENT_MERCHANTPARTNERS_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['merchantpartners_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['merchantpartners_cc_expires_year'])))));
+
+
+      return $confirmation;
+    }
+
+   function process_button() {
+    global $HTTP_POST_VARS, $HTTP_GET_VARS, $order, $customer_id, $session_id;
+    $ns_quicksale = 'ns_quicksale_cc';
+
+    $declineurl = 'http://trans.atsbank.com/cgi-bin/redirect.cgi?' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true) . '?' .  'payment_error=' . $this->code . '&merchantpartners_cc_owner=' . urlencode($HTTP_POST_VARS['merchantpartners_cc_owner']);
+
+    $accepturl = 'http://trans.atsbank.com/cgi-bin/redirect.cgi?' . tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false) . '?';
+
+    $process_button_string =   tep_draw_hidden_field('action', $ns_quicksale) .
+                               tep_draw_hidden_field('acctid', MODULE_PAYMENT_MERCHANTPARTNERS_ACCTID) .
+                               tep_draw_hidden_field('subid', MODULE_PAYMENT_MERCHANTPARTNERS_SUBID) .
+                               tep_draw_hidden_field('ccname', $HTTP_POST_VARS['merchantpartners_cc_owner']) .
+                               tep_draw_hidden_field('ccnum', $HTTP_POST_VARS['merchantpartners_cc_number']) .
+                               tep_draw_hidden_field('expmonth', $HTTP_POST_VARS['merchantpartners_cc_expires_month']) .
+             tep_draw_hidden_field('expyear', $HTTP_POST_VARS['merchantpartners_cc_expires_year']) .
+             tep_draw_hidden_field('cvv2', $HTTP_POST_VARS['cvv2']) .
+             tep_draw_hidden_field('ci_memo', $HTTP_POST_VARS['comments']) .
+                               tep_draw_hidden_field('amount', number_format($order->info['total'], 2 )) .
+                               tep_draw_hidden_field('ci_email', $order->customer['email_address']) .
+                               tep_draw_hidden_field('ci_billaddr1', $order->customer['street_address']) .
+                               tep_draw_hidden_field('ci_billaddr2', $order->customer['suburb']) .
+                               tep_draw_hidden_field('ci_billcity', $order->customer['city']) .
+                               tep_draw_hidden_field('ci_billstate', $order->customer['state']) .
+                               tep_draw_hidden_field('ci_billzip', $order->customer['postcode']) .
+                               tep_draw_hidden_field('ci_billcountry', $order->customer['country']['title']) .
+                               tep_draw_hidden_field('ship_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) .
+                               tep_draw_hidden_field('ship_addr_1', $order->delivery['street_address']) .
+                               tep_draw_hidden_field('ship_addr_2', $order->delivery['suburb']) .
+                               tep_draw_hidden_field('ship_city', $order->delivery['city']) .
+                               tep_draw_hidden_field('ship_state', $order->delivery['state']) .
+                               tep_draw_hidden_field('ship_post_code', $order->delivery['postcode']) .
+                               tep_draw_hidden_field('ship_country', $order->delivery['country']['title']) .
+                               tep_draw_hidden_field('Session_ID', $customer_id) .
+                               tep_draw_hidden_field('declineurl', $declineurl, '', 'SSL', false) .
+                               tep_draw_hidden_field('accepturl', $accepturl, '', 'SSL', false) .
+                               tep_draw_hidden_field('ci_phone', $order->customer['telephone']);
+
+          if (MODULE_PAYMENT_MERCHANTPARTNERS_AUTHONLY == 'true') {
+          $process_button_string .= tep_draw_hidden_field('authonly', '1');
+          }
+          else {
+          $process_button_string .= tep_draw_hidden_field('authonly', '0');
+          }
+;
+      return $process_button_string;
+    }
+
+    function before_process() {
+    global $HTTP_POST_VARS;
+    }
+
+
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS, $HTTP_POST_VARS;
+
+      if (isset($HTTP_GET_VARS['Status'])) {
+         $error = array('title' => MERCHANTPARTNERS_ERROR_HEADING,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['Status'])) . ': ' .  stripslashes(urldecode($HTTP_GET_VARS['Reason'])));
+      }
+      else {
+      $error = array('title' => MERCHANTPARTNERS_ERROR_HEADING,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+      }
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_MERCHANTPARTNERS_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable merchantPartners Module', 'MODULE_PAYMENT_MERCHANTPARTNERS_STATUS', 'True', 'Do you want to accept merchantPartners payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('AcctID', 'MODULE_PAYMENT_MERCHANTPARTNERS_ACCTID', 'TEST0', 'The acctID used for the merchantPartners service', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('SubID', 'MODULE_PAYMENT_MERCHANTPARTNERS_SUBID', '', 'The subID for the merchantPartners service', '6', '3', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PreAuth', 'MODULE_PAYMENT_MERCHANTPARTNERS_AUTHONLY', 'true', 'Do you Pre-Auth Only?', '6', '1', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_MERCHANTPARTNERS_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_MERCHANTPARTNERS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_MERCHANTPARTNERS_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_MERCHANTPARTNERS_STATUS', 'MODULE_PAYMENT_MERCHANTPARTNERS_ACCTID', 'MODULE_PAYMENT_MERCHANTPARTNERS_SUBID', 'MODULE_PAYMENT_MERCHANTPARTNERS_AUTHONLY', 'MODULE_PAYMENT_MERCHANTPARTNERS_ZONE', 'MODULE_PAYMENT_MERCHANTPARTNERS_ORDER_STATUS_ID', 'MODULE_PAYMENT_MERCHANTPARTNERS_SORT_ORDER');
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/moneyorder.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/moneyorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/moneyorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,115 @@
+<?php
+/*
+  $Id: moneyorder.php,v 1.1.1.1 2004/03/04 23:41:19 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class moneyorder {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function moneyorder() {
+      global $order;
+
+      $this->code = 'moneyorder';
+      $this->title = MODULE_PAYMENT_MONEYORDER_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_MONEYORDER_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+    
+      $this->email_footer = MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER;
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_MONEYORDER_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_MONEYORDER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+      return array('id' => $this->code,
+                   'module' => $this->title);
+    }
+
+    function pre_confirmation_check() {
+      return false;
+    }
+
+    function confirmation() {
+      return array('title' => MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION);
+    }
+
+    function process_button() {
+      return false;
+    }
+
+    function before_process() {
+      return false;
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      return false;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_MONEYORDER_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Check/Money Order Module', 'MODULE_PAYMENT_MONEYORDER_STATUS', 'True', 'Do you want to accept Check/Money Order payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Money Order  Make Payable to:', 'MODULE_PAYMENT_MONEYORDER_PAYTO', 'Make Payable to:', 'Who should payments be made payable to?', '6', '1', now());");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Money Order  Sort order of display.', 'MODULE_PAYMENT_MONEYORDER_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Money Order  Payment Zone', 'MODULE_PAYMENT_MONEYORDER_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Money Order  Set Order Status', 'MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_MONEYORDER_STATUS', 'MODULE_PAYMENT_MONEYORDER_ZONE', 'MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID', 'MODULE_PAYMENT_MONEYORDER_SORT_ORDER', 'MODULE_PAYMENT_MONEYORDER_PAYTO');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/nochex.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/nochex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/nochex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,124 @@
+<?php
+/*
+  $Id: nochex.php,v 1.1.1.1 2004/03/04 23:41:19 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class nochex {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function nochex() {
+      global $order;
+
+      $this->code = 'nochex';
+      $this->title = MODULE_PAYMENT_NOCHEX_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_NOCHEX_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_NOCHEX_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_NOCHEX_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://www.nochex.com/nochex.dll/checkout';
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_NOCHEX_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_NOCHEX_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+      return array('id' => $this->code,
+                   'module' => $this->title);
+    }
+
+    function pre_confirmation_check() {
+      return false;
+    }
+
+    function confirmation() {
+      return false;
+    }
+
+    function process_button() {
+      global $order, $currencies, $customer_id;
+
+      $process_button_string = tep_draw_hidden_field('cmd', '_xclick') .
+                               tep_draw_hidden_field('email', MODULE_PAYMENT_NOCHEX_ID) .
+                               tep_draw_hidden_field('amount', number_format($order->info['total'] * $currencies->currencies['GBP']['value'], $currencies->currencies['GBP']['decimal_places'])) .
+                               tep_draw_hidden_field('ordernumber', $customer_id . '-' . date('Ymdhis')) .
+                               tep_draw_hidden_field('returnurl', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .
+                               tep_draw_hidden_field('cancel_return', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      return false;
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function output_error() {
+      return false;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_NOCHEX_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable NOCHEX Module', 'MODULE_PAYMENT_NOCHEX_STATUS', 'True', 'Do you want to accept NOCHEX payments?', '6', '3', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('NOCHEX E-Mail Address', 'MODULE_PAYMENT_NOCHEX_ID', 'you at yourbuisness.com', 'The e-mail address to use for the NOCHEX service', '6', '4', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('NOCHEX Sort order of display.', 'MODULE_PAYMENT_NOCHEX_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('NOCHEX Payment Zone', 'MODULE_PAYMENT_NOCHEX_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('NOCHEX Set Order Status', 'MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_NOCHEX_STATUS', 'MODULE_PAYMENT_NOCHEX_ID', 'MODULE_PAYMENT_NOCHEX_ZONE', 'MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID', 'MODULE_PAYMENT_NOCHEX_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paybox.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paybox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paybox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,155 @@
+<?php
+/*
+  Contribution by Emmanuel Alliel <manu at maboutique.biz>
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class paybox {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function paybox() {
+      global $order;
+
+      $this->code = 'paybox';
+      $this->title = MODULE_PAYMENT_PAYBOX_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_PAYBOX_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_PAYBOX_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_PAYBOX_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_PAYBOX_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_PAYBOX_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = MODULE_PAYMENT_PAYBOX_CGI;
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYBOX_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYBOX_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+      return array('id' => $this->code,
+                   'module' => $this->title);
+    }
+
+    function pre_confirmation_check() {
+      return false;
+    }
+
+    function confirmation() {
+      return false;
+    }
+
+    function process_button() {
+      global $order;
+
+      $process_button_string = tep_draw_hidden_field('IBS_MODE', '1') .
+                               tep_draw_hidden_field('IBS_SITE', '1999888') .
+                               tep_draw_hidden_field('IBS_RANG', '99') .
+                               tep_draw_hidden_field('IBS_TOTAL', $order->info['total'] * 100) .
+                               tep_draw_hidden_field('IBS_DEVISE', '978') .
+                               tep_draw_hidden_field('IBS_CMD', $order->customer['email_address'] . '|' . $order->info['total']) .
+                         tep_draw_hidden_field('IBS_PORTEUR', $order->customer['email_address']) .
+                               tep_draw_hidden_field('IBS_RETOUR', 'IBS_TOTAL:M;IBS_CMD:R;auto:A;trans:T') .
+  tep_draw_hidden_field('IBS_ANNULE', tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'NONSSL', true)) .
+  tep_draw_hidden_field('IBS_REFUSE', tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'NONSSL', true)) .
+                               tep_draw_hidden_field('IBS_EFFECTUE', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false)) .
+                               tep_draw_hidden_field(tep_session_name(), tep_session_id()) .
+                               tep_draw_hidden_field('options', 'test_status=' . $test_status . ',dups=false,cb_post=true,cb_flds=' . tep_session_name());
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $HTTP_POST_VARS;
+
+      if ($HTTP_POST_VARS['valid'] == 'true') {
+        if ($remote_host = getenv('REMOTE_HOST')) {
+          if ($remote_host != 'paybox.com') {
+            $remote_host = gethostbyaddr($remote_host);
+          }
+          if ($remote_host != 'paybox.com') {
+            tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false));
+          }
+        } else {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false));
+        }
+      }
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      if (isset($HTTP_GET_VARS['message']) && (strlen($HTTP_GET_VARS['message']) > 0)) {
+        $error = stripslashes(urldecode($HTTP_GET_VARS['message']));
+      } else {
+        $error = MODULE_PAYMENT_PAYBOX_TEXT_ERROR_MESSAGE;
+      }
+
+      return array('title' => MODULE_PAYMENT_PAYBOX_TEXT_ERROR,
+                   'error' => $error);
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYBOX_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Paybox Module', 'MODULE_PAYMENT_PAYBOX_STATUS', 'True', 'Activer ce module Paybox ?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Paybox IBS_SITE', 'MODULE_PAYMENT_PAYBOX_IBS_SITE', '1999888', 'IBS_SITE fournit par Paybox', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Paybox IBS_RANG', 'MODULE_PAYMENT_PAYBOX_IBS_RANG', '99', 'IBS_RANG fournit par Paybox', '6', '3', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Paybox CGI Path', 'MODULE_PAYMENT_PAYBOX_CGI', 'http://www.maboutique.biz/cgi-bin/paybox.cgi', 'Chemin de votre module CGI fournit par Paybox', '6', '4', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Paybox Sort order of display.', 'MODULE_PAYMENT_PAYBOX_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Paybox Payment Zone', 'MODULE_PAYMENT_PAYBOX_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Paybox Set Order Status', 'MODULE_PAYMENT_PAYBOX_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_PAYBOX_STATUS', 'MODULE_PAYMENT_PAYBOX_IBS_SITE', 'MODULE_PAYMENT_PAYBOX_IBS_RANG', 'MODULE_PAYMENT_PAYBOX_CGI', 'MODULE_PAYMENT_PAYBOX_ZONE', 'MODULE_PAYMENT_PAYBOX_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYBOX_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/payflowpro.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/payflowpro.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/payflowpro.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,367 @@
+<?php
+/*
+  $Id: payflowpro.php,v 1.0 2002/05/10 01:22:51 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+  class payflowpro {
+    var $code, $title, $description, $enabled, $sort_order;
+
+// class constructor
+    function payflowpro() {
+    global $order;
+      $this->code = 'payflowpro';
+      $this->title = MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_PAYFLOWPRO_TEXT_DESCRIPTION;
+      $this->enabled = MODULE_PAYMENT_PAYFLOWPRO_STATUS;
+
+      $this->sort_order = MODULE_PAYMENT_PAYFLO_SORT_ORDER;
+
+     if ((int)MODULE_PAYMENT_PAYFLOWPRO_ORDER_STATUS_ID > 0) {
+           $this->order_status = MODULE_PAYMENT_PAYFLOWPRO_ORDER_STATUS_ID;
+         }
+
+    //     if (is_object($order)) $this->update_status();
+    //     $this->form_action_url = MODULE_PAYMENT_PAYFLOWPRO_HOSTADDRESS ;
+
+   }
+
+// class methods
+    function javascript_validation() {
+      $validation_string = 'if (payment_value == "' . $this->code . '") {' . "\n" .
+                           '  var cc_number = document.checkout_payment.payflowpro_cc_number.value;' . "\n" .
+                           '  if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+                           '    error_message = error_message + "' . MODULE_PAYMENT_PAYFLOWPRO_TEXT_JS_CC_NUMBER . '";' . "\n" .
+                           '    error = 1;' . "\n" .
+                           '  }' . "\n" .
+                           '}' . "\n";
+     if (MODULE_PAYMENT_PAYFLOWPRO_CSC=="1"){
+      $validation_string .=  'if (payment_value== "' . $this->code . '" && document.checkout_payment.payflowpro_cc_csc.value==""){ ' . "\n" .
+                           '  error_message = error_message + " You must provide a CSC ";' . "\n".
+                           ' error=1;} ' . "\n";}
+      return $validation_string;
+    }
+
+    function selection() {
+      for ($i=1; $i < 13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%m',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+      $fields[0]=array('title' => '<tr><td colspan=5 class=main><B>'.MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE1.'<a href="'.tep_href_link(FILENAME_PRIVACY, '', 'NONSSL').'">'. MODULE_PAYMENT_PAYFLOWPRO_TEXT_TITLE2 .'</a> </B></td></tr>' ,
+                       'field' => '<tr><td colspan=5>' .tep_image(DIR_WS_IMAGES.'cclogos.gif'). '</td></tr>');
+
+      $fields[1]=array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_NUMBER,
+                       'field' =>tep_draw_input_field('payflowpro_cc_number','','valign=Center') );
+
+       $fields[2]=array('title' =>  MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_EXPIRES ,
+                          'field' => tep_draw_pull_down_menu('payflowpro_cc_expires_month', $expires_month) . '&nbsp;&nbsp;' . tep_draw_pull_down_menu('payflowpro_cc_expires_year', $expires_year));
+
+     if (MODULE_PAYMENT_PAYFLOWPRO_CSC=="1"){
+       $fields[3]=array('title' =>  MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC,
+                          'field' => '<table border="0" cellpadding="2" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="100%">'.
+                          '<tr><td >'.tep_draw_input_field('payflowpro_cc_csc','','size="4" maxlenght="4" valign="center"') . '&nbsp;</td>'.
+                          '<td  valign="center"><a href=javascript:{}; onclick="javascript:{window.open(\'./csc.htm\',\'test\',\'height=550,width=800,top=100,left=100\');false}">'.tep_image(DIR_WS_IMAGES.'csc.gif').'</a></td>'.
+                          '<td><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><tr>'.
+                          '</tr><tr><td class="main" >'.MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_TEXT.'</td>'.
+                          '</tr><tr><td class="main" ><a href=javascript:{}; onclick="javascript:{window.open(\'./csc.htm\',\'test\',\'height=550,width=800,top=100,left=100\');false}">'.MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_HELP.'</a></td>'.
+                          '<td class="main" >&nbsp;&nbsp;</td>'.
+                          '</tr><tr><td class="main" align="left"><a href=javascript:{}; onclick="javascript:{window.open(\'./csc_amex.htm\',\'test\',\'height=550,width=800,top=100,left=100\');false}">'.MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_AMEX.'</a></td>'.
+                          '</tr></table></tr></table>');}
+
+
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => $fields);
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $payment, $HTTP_POST_VARS;
+
+      include(DIR_WS_CLASSES . 'cc_validation1.php');
+
+      $cc_validation = new cc_validation();
+      $result = $cc_validation->validate($HTTP_POST_VARS['payflowpro_cc_number'], $HTTP_POST_VARS['payflowpro_cc_expires_month'], $HTTP_POST_VARS['payflowpro_cc_expires_year']);
+
+      $error = '';
+      switch ($result) {
+        case -1:
+          $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+          break;
+        case -2:
+        case -3:
+        case -4:
+          $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+          break;
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) .  '&cc_expires_month=' .$HTTP_POST_VARS['payflowpro_cc_expires_month'].  '&shipping_selected=' . $HTTP_POST_VARS['shipping_selected'] . '&cc_expires_year=' . $HTTP_POST_VARS['payflowpro_cc_expires_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = $cc_validation->cc_type;
+      $this->cc_card_number = $cc_validation->cc_number;
+      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = str_replace("20", "", $cc_validation->cc_expiry_year);
+
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS, $CardName, $CardNumber, $checkout_form_action;
+
+
+      $fields[0]=array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_NUMBER ,
+                       'field' => $this->cc_card_number );
+     if (MODULE_PAYMENT_PAYFLOWPRO_CSC=="1"){
+      $fields[1]=array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC ,
+                       'field' => $HTTP_POST_VARS['payflowpro_cc_csc'] );
+     }else{
+      $fields[1]=array('title' => '' ,
+                       'field' => '' );
+     }
+      $fields[2]=array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_EXPIRES ,
+                       'field' => strftime('%B/%Y', mktime(0,0,0,$HTTP_POST_VARS['payflowpro_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['payflowpro_cc_expires_year'])) );
+
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => $fields);
+
+      return $confirmation;
+    }
+
+    function process_button() {
+      global $HTTP_POST_VARS, $CardName, $CardNumber, $order;
+
+      $process_button_string = tep_draw_hidden_field('cc_expires', $this->cc_expiry_month . $this->cc_expiry_year) .
+                               tep_draw_hidden_field('cc_type', $this->cc_card_type) .
+                               tep_draw_hidden_field('cc_number', $this->cc_card_number) ;
+     if (MODULE_PAYMENT_PAYFLOWPRO_CSC=="1"){
+        $process_button_string .= tep_draw_hidden_field('CSC', $HTTP_POST_VARS['payflowpro_cc_csc']);
+     }
+     
+    // add convert to state code;
+     $state_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_name = '" . $order->customer['state'] ."' ");
+      $state = tep_db_fetch_array($state_query);
+    
+    // convert delivery state  ;
+    
+      $stated_query = tep_db_query("select  zone_code from " . TABLE_ZONES . " where zone_name = '" . $order->delivery['state'] ."' ");
+      $stated = tep_db_fetch_array($stated_query);
+
+    
+        $process_button_string .= tep_draw_hidden_field('AMT', number_format($order->info['total'], 2, '.', '')).
+                               tep_draw_hidden_field('FREIGHTAMT', number_format($order->info['shipping_cost'], 2, '.', '')).
+                               tep_draw_hidden_field('TAXAMT', number_format($order->info['tax'], 2, '.', '')).
+                               tep_draw_hidden_field('FIRSTNAME', $order->customer['firstname']) .
+                               tep_draw_hidden_field('LASTNAME', $order->customer['lastname']) .
+                               tep_draw_hidden_field('STREET', $order->customer['street_address']) .
+                               tep_draw_hidden_field('CITY', $order->customer['city']) .
+                               tep_draw_hidden_field('STATE', $state['zone_code']) .
+                               tep_draw_hidden_field('ZIP', $order->customer['postcode']) .
+                               tep_draw_hidden_field('COUNTRY', $order->customer['country']['iso_code_2']) .
+                           //    tep_draw_hidden_field('COUNTRY', $order->customer['country']['title']) .
+                               tep_draw_hidden_field('EMAIL', $order->customer['email_address']) .
+                               tep_draw_hidden_field('SHIPTOFIRSTNAME', $order->delivery['firstname']) .
+                               tep_draw_hidden_field('SHIPTOLASTNAME', $order->delivery['lastname']) .
+                               tep_draw_hidden_field('SHIPTOSTREET', $order->delivery['street_address']) .
+                               tep_draw_hidden_field('SHIPTOCITY', $order->delivery['city']) .
+                               tep_draw_hidden_field('SHIPTOSTATE', $state['zone_code']) .
+                               tep_draw_hidden_field('COMMENT1', $order->customer['firstname'] . $order->customer['lastname']) .
+                               tep_draw_hidden_field('COMMENT2', 'W' . $order_id) .
+                               tep_draw_hidden_field('SHIPTOZIP', $order->delivery['postcode']) ;
+      $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $HTTP_POST_VARS,$order,$response;
+          shell_exec("PFPRO_CERT_PATH=/usr/cert/");
+    shell_exec ("LD_LIBRARY_PATH=/usr/lib/;export LD_LIBRARY_PATH");
+     $transaction ='USER=' . trim(MODULE_PAYMENT_PAYFLOWPRO_USER) . '&';
+     $transaction .='VENDOR=' . (MODULE_PAYMENT_PAYFLOWPRO_VENDOR) . '&';
+     $transaction .='PARTNER=' . trim(MODULE_PAYMENT_PAYFLOWPRO_PARTNER) . '&';
+     $transaction .='PWD=' . trim(MODULE_PAYMENT_PAYFLOWPRO_PWD) . '&';
+     $transaction .='TRXTYPE=' . trim(MODULE_PAYMENT_PAYFLOWPRO_TRXTYPE) . '&';
+     $transaction .='TENDER=' . trim(MODULE_PAYMENT_PAYFLOWPRO_TENDER) . '&';
+     $transaction .='AMT=' . $HTTP_POST_VARS['AMT'] . '&';
+     $transaction .='ACCT=' . $HTTP_POST_VARS['cc_number'] . '&';
+     $transaction .='EXPDATE=' . $HTTP_POST_VARS['cc_expires'] . '&';
+     $transaction .='FREIGHTAMT=' . $HTTP_POST_VARS['FREIGHTAMT'] . '&';
+     $transaction .='TAXAMT=' . $HTTP_POST_VARS['TAXAMT'] . '&';
+     $transaction .='FIRSTNAME=' . $HTTP_POST_VARS['FIRSTNAME'] . '&';
+     $transaction .='LASTNAME=' . $HTTP_POST_VARS['LASTNAME'] . '&';
+     $transaction .='STREET=' . $HTTP_POST_VARS['STREET'] . '&';
+     $transaction .='CITY=' . $HTTP_POST_VARS['CITY'] . '&';
+     $transaction .='STATE=' . $HTTP_POST_VARS['STATE'] . '&';
+     $transaction .='ZIP=' . $HTTP_POST_VARS['ZIP'] . '&';
+     $transaction .='COUNTRY=' . $HTTP_POST_VARS['COUNTRY'] . '&';
+     $transaction .='EMAIL=' . $HTTP_POST_VARS['EMAIL'] . '&';
+     $transaction .='SHIPTOFIRSTNAME=' . $HTTP_POST_VARS['SHIPTOFIRSTNAME'] . '&';
+     $transaction .='SHIPTOLASTNAME=' . $HTTP_POST_VARS['SHIPTOLASTNAME'] . '&';
+     $transaction .='SHIPTOSTREET=' . $HTTP_POST_VARS['SHIPTOSTREET'] . '&';
+     $transaction .='SHIPTOCITY=' . $HTTP_POST_VARS['SHIPTOCITY'] . '&';
+     $transaction .='SHIPTOSTATE=' . $HTTP_POST_VARS['SHIPTOSTATE'] . '&';
+     $transaction .='SHIPTOZIP=' . $HTTP_POST_VARS['SHIPTOZIP'] . '&';
+     $transaction .='CSC=' . $HTTP_POST_VARS['CSC'] . '&';
+     $transaction .='COMMENT1=' . $HTTP_POST_VARS['COMMENT1'] . '&';
+     $transaction .='COMMENT2=' . $HTTP_POST_VARS['COMMENT2'] . '&';
+
+
+$path = "/sbin/pfpro" ;
+$url = MODULE_PAYMENT_PAYFLOWPRO_HOSTADDRESS;
+$port =  MODULE_PAYMENT_PAYFLOWPRO_HOSTPORT;
+$response = shell_exec ("$path  $url  $port  \"$transaction\" 10");
+
+
+
+             $response1= array();
+                     $response1 = explode('&',$response);
+                       $text1 = $response1[0];
+               $text2 = $response1[1];
+               $text3 = $response1[2];
+               $text4 = $response1[3];
+               $text5 = $response1[4];
+               $text6 = $response1[5];
+               $text7 = $response1[6];
+
+                         $text1a = str_replace('RESULT=', '', $text1);
+                         $text2a = str_replace('PNREF=', '', $text2);
+                         $text3a = str_replace('RESPMSG=', '', $text3);
+                         $text4a = str_replace('AVSADDR=', '', $text4);
+                         $text5a = str_replace('AVSZIP=', '', $text5);
+                         $text6a = str_replace('IAVS=', '', $text6);
+                         $text7a = str_replace('PREFPSMSG=', '', $text7);
+
+                        $response2= array();
+                         $response2 = explode('=',$response1);
+
+//if (MODULE_PAYMENT_PAYFLOWPRO_TESTMODE == 'Test And Debug') {
+          $filename2 = 'propay_debug.txt';
+                  // $response2a = array();
+                   //$response3a = array();
+                                  //      $line_num => $response2a
+          $transaction2=' :Transaction String : ' . $transaction . "\n";
+          $response1a = ' :Response String raw : ' . $response . "\n";
+
+          $response2a .= ' :Response String array1 : Results ' . $text1 . ' Error Msg ' . $text7a . "\n";
+
+                    $response3a = ' :Response String array2 : ' . $response1a . "\n";
+
+
+if (MODULE_PAYMENT_PAYFLOWPRO_TESTMODE == 'Test And Debug') {
+
+          $fp2 = fopen($filename2,"ab");
+                  $write = fputs($fp2, $transaction2, strlen($transaction2));
+          $write = fputs($fp2, $response1c, strlen($response1c));
+
+          $write = fputs($fp2, $response2a, strlen($response2a));
+
+          $write = fputs($fp2, $response3a, strlen($response3a));
+          fclose($fp2);
+
+}
+ if (!$text1 ||($text1 != 'RESULT=0') ){
+                 tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR.' '.$text1a), 'SSL', true, false));
+   }else{
+
+ }
+
+    }
+
+    function after_process() {
+             return false;
+    }
+
+    function output_error() {
+      global $HTTP_GET_VARS;
+
+      $output_error_string = '<table border="0" cellspacing="0" cellpadding="0" width="100%">' . "\n" .
+                             '  <tr>' . "\n" .
+                             '    <td class="main">&nbsp;<font color="#FF0000">error<b>' . MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR . '</b></font><br>&nbsp;' . stripslashes($HTTP_GET_VARS['cc_val']) . '&nbsp;</td>' . "\n" .
+                             '  </tr>' . "\n" .
+                             '</table>' . "\n";
+
+      return $output_error_string;
+    }
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+    function check() {
+      if (!isset($this->check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_STATUS'");
+        $this->check = tep_db_num_rows($check_query);
+      }
+      return $this->check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Allow PayflowPro', 'MODULE_PAYMENT_PAYFLOWPRO_STATUS', '1', 'Do you want to accept PlayfowPro payments?', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Currency', 'MODULE_PAYMENT_PAYFLOWPRO_CURRENCY', 'USD', 'Currency', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_PAYFLOWPRO_TESTMODE', 'Test', 'Transaction mode used for processing order', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Test And Debug\', \'Production\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayflowPro Host Address', 'MODULE_PAYMENT_PAYFLOWPRO_HOSTADDRESS',  'test-payflow.verisign.com', 'Verisign Host Name', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayflowPro Host Port', 'MODULE_PAYMENT_PAYFLOWPRO_HOSTPORT', '443', 'Verisign Host Port Number', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayflowPro Transaction Type', 'MODULE_PAYMENT_PAYFLOWPRO_TRXTYPE', 'S', 'Indicates type of transaction effecting the cardholder’s account (S = sale)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayflowPro Transaction Tender', 'MODULE_PAYMENT_PAYFLOWPRO_TENDER', 'C', 'Indicates type of tender being used (C = credit card)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayflowPro Partner', 'MODULE_PAYMENT_PAYFLOWPRO_PARTNER', 'PartnerId', 'VeriSign Your partner ID is provided to you by the authorized VeriSign Reseller who signed you up for the Payflow Pro service. If you signed up yourself, use VeriSign.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayflowPro Vendor', 'MODULE_PAYMENT_PAYFLOWPRO_VENDOR', 'login', 'Your case-sensitive login that you defined at registration.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayflowPro User', 'MODULE_PAYMENT_PAYFLOWPRO_USER', 'login', 'For now you must use your login for this parameter.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayflowPro Password', 'MODULE_PAYMENT_PAYFLOWPRO_PWD', 'password', 'Case-sensitive password.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayflowPro Transaction Timeout', 'MODULE_PAYMENT_PAYFLOWPRO_TIMEOUT', '45', 'This value specifies a timeout period for the transaction. If not specified, the timeout value will default to 45 seconds. The minimum recommended timeout value is 30 seconds. The VeriSign client will begin tracking the timeout value from the point that it actually sends the transaction request to the VeriSign server.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Proxy Address', 'MODULE_PAYMENT_PAYFLOWPRO_PROXY_ADDRESS', '', 'Proxy server address.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Proxy Port', 'MODULE_PAYMENT_PAYFLOWPRO_PROXY_PORT', '', 'Proxy server port.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Proxy Logon', 'MODULE_PAYMENT_PAYFLOWPRO_PROXY_LOGON', '', 'Proxy server logon ID.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Proxy Password', 'MODULE_PAYMENT_PAYFLOWPRO_PROXY_PASSWORD', '', 'Proxy server logon password.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('CSC', 'MODULE_PAYMENT_PAYFLOWPRO_CSC', '1', 'Allow CSC, or ccv checking 0 = Disable 1 = Enable', '6', '0', 'tep_cfg_select_option(array(\'0\', \'1\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Pay Flo Pro - Set Order Status', 'MODULE_PAYMENT_PAYFLOWPRO_ORDER_STATUS_ID', '0', 'Pay Flo Pro - Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Payflopro - Sort order of display.', 'MODULE_PAYMENT_PAYFLO_SORT_ORDER', '0', 'Pay Flo Pro - Sort order of  display. Lowest is displayed first.', '6', '0', now())");
+  }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_STATUS'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_CURRENCY'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_TESTMODE'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_HOSTADDRESS'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_HOSTPORT'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_TRXTYPE'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_TENDER'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_PARTNER'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_VENDOR'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_USER'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_PWD'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_TIMEOUT'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_PROXY_ADDRESS'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_PROXY_PORT'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_PROXY_LOGON'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_PWD'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_CSC'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLOWPRO_ORDER_STATUS_ID'");
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYFLO_SORT_ORDER'");
+
+   }
+
+    function keys() {
+      $keys = array('MODULE_PAYMENT_PAYFLOWPRO_STATUS', 'MODULE_PAYMENT_PAYFLOWPRO_CURRENCY', 'MODULE_PAYMENT_PAYFLOWPRO_TESTMODE', 'MODULE_PAYMENT_PAYFLOWPRO_HOSTADDRESS', 'MODULE_PAYMENT_PAYFLOWPRO_HOSTPORT', 'MODULE_PAYMENT_PAYFLOWPRO_TRXTYPE', 'MODULE_PAYMENT_PAYFLOWPRO_TENDER', 'MODULE_PAYMENT_PAYFLOWPRO_PARTNER','MODULE_PAYMENT_PAYFLOWPRO_VENDOR','MODULE_PAYMENT_PAYFLOWPRO_USER','MODULE_PAYMENT_PAYFLOWPRO_PWD','MODULE_PAYMENT_PAYFLOWPRO_TIMEOUT','MODULE_PAYMENT_PAYFLOWPRO_PROXY_ADDRESS','MODULE_PAYMENT_PAYFLOWPRO_PROXY_PORT','MODULE_PAYMENT_PAYFLOWPRO_PROXY_LOGON','MODULE_PAYMENT_PAYFLOWPRO_PWD','MODULE_PAYMENT_PAYFLOWPRO_CSC', 'MODULE_PAYMENT_PAYFLOWPRO_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYFLO_SORT_ORDER');
+
+      return $keys;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/payjunction.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/payjunction.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/payjunction.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,256 @@
+<?php
+  class payjunction {
+    var $code, $title, $description, $enabled;
+
+    function payjunction() {
+      global $order;
+
+      $this->code = 'payjunction';
+      $this->title = MODULE_PAYMENT_PAYJUNCTION_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_PAYJUNCTION_TEXT_DESCRIPTION;
+      $this->enabled = ((MODULE_PAYMENT_PAYJUNCTION_STATUS == 'True') ? true : false);
+      $this->sort_order = MODULE_PAYMENT_PAYJUNCTION_SORT_ORDER;
+
+      if ((int)MODULE_PAYMENT_PAYJUNCTION_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_PAYJUNCTION_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://payjunction.com/live/vendor/special/authorize_net';
+    }
+
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYJUNCTION_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYJUNCTION_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.pj_cardholder_name.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.pj_card_number.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_NAME_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_NAME . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_PAYJUNCTION_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+    '';
+
+  if (MODULE_PAYMENT_PAYJUNCTION_CODE == 'Yes')
+  {
+    $js = 'var cc_code = document.checkout_payment.pj_card_code.value;' . "\n" .
+      'if (cc_code == "" || cc_code.length < 3) { error_message = error_message + "The CVV2/CVC2 code must be at least 3 digits."; error = 1; }' . "\n";
+
+  }
+
+  $js = $js .
+            '    }' . "\n" .
+            '  }' . "\n";
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+
+      for ($i=1; $i<13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate(); 
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NAME,
+                                                 'field' => tep_draw_input_field('pj_cardholder_name', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('pj_card_number')),
+  (MODULE_PAYMENT_PAYJUNCTION_CODE == 'Yes' ?
+    array('title' => MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_CODE, 'field' => tep_draw_input_field('pj_card_code', '', 'size="4"')) :
+    array()),
+                                           array('title' => MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('pj_card_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('pj_card_year', $expires_year))));
+
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+      include(DIR_WS_CLASSES . 'cc_validation1.php');
+
+      $cc_validation = new cc_validation();
+      $result = $cc_validation->validate($HTTP_POST_VARS['pj_card_number'], $HTTP_POST_VARS['pj_card_month'], $HTTP_POST_VARS['pj_card_year']);
+      $error = '';
+      switch ($result) {
+        case -1:
+          $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+          break;
+        case -2:
+        case -3:
+        case -4:
+          $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+          break;
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+  if ($result == false || $result < 1) {}
+  elseif (MODULE_PAYMENT_PAYJUNCTION_CODE == 'Yes')
+  {
+          $this->pj_card_code = $HTTP_POST_VARS['pj_card_code'];
+    if ($this->pj_card_code == '' || strlen($this->pj_card_code) < 3)
+    {
+      $error = "The CVV2/CVC2 code must be at least 3 digits.";
+      $result = false;
+    }
+  }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&pj_cardholder_name=' . urlencode($HTTP_POST_VARS['pj_cardholder_name']) . '&pj_card_month=' . $HTTP_POST_VARS['pj_card_month'] . '&pj_card_year=' . $HTTP_POST_VARS['pj_card_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->pj_card_brand = $cc_validation->cc_type;
+      $this->pj_card_number = $cc_validation->cc_number;
+      $this->pj_card_month = $cc_validation->cc_expiry_month;
+      $this->pj_card_year = $cc_validation->cc_expiry_year;
+      $this->pj_card_code = $HTTP_POST_VARS['pj_card_code'];
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS;
+
+      $confirmation = array('title' => $this->title . ': ' . $this->pj_card_brand,
+                            'fields' => array(array('title' => MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NAME,
+                                                    'field' => $HTTP_POST_VARS['pj_cardholder_name']),
+                                              array('title' => MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($this->pj_card_number, 0, 4) . str_repeat('X', (strlen($this->pj_card_number) - 8)) . substr($this->pj_card_number, -4)),
+                                              array('title' => MODULE_PAYMENT_PAYJUNCTION_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B %Y', mktime(0,0,0,$HTTP_POST_VARS['pj_card_month'], 1, '20' . $HTTP_POST_VARS['pj_card_year'])))));
+
+      return $confirmation;
+    }
+
+    function process_button() {
+      global $HTTP_SERVER_VARS, $order, $customer_id;
+
+      $sequence = rand(1, 1000);
+      $process_button_string = tep_draw_hidden_field('x_Login', MODULE_PAYMENT_PAYJUNCTION_USERNAME) .
+                               tep_draw_hidden_field('x_Card_Num', $this->pj_card_number) .
+                               tep_draw_hidden_field('x_Exp_Date', $this->pj_card_month . substr($this->pj_card_year, -2)) .
+                               tep_draw_hidden_field('x_Card_Code', $this->pj_card_code) .
+                               tep_draw_hidden_field('x_Amount', number_format($order->info['total'], 2)) .
+                               tep_draw_hidden_field('x_Relay_URL', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false)) .
+                               tep_draw_hidden_field('x_Relay_Response', 'TRUE') .
+                               tep_draw_hidden_field('x_Method', 'CC') .
+                               tep_draw_hidden_field('x_Version', '3.0') .
+                               tep_draw_hidden_field('x_Cust_ID', $customer_id) .
+                               tep_draw_hidden_field('x_first_name', $order->billing['firstname']) .
+                               tep_draw_hidden_field('x_last_name', $order->billing['lastname']) .
+                               tep_draw_hidden_field('x_address', $order->billing['street_address']) .
+                               tep_draw_hidden_field('x_city', $order->billing['city']) .
+                               tep_draw_hidden_field('x_state', $order->billing['state']) .
+                               tep_draw_hidden_field('x_zip', $order->billing['postcode']) .
+                               tep_draw_hidden_field('x_country', $order->billing['country']['title']) .
+                               tep_draw_hidden_field('x_phone', $order->customer['telephone']) .
+                               tep_draw_hidden_field('x_email', $order->customer['email_address']) .
+                               tep_draw_hidden_field('x_ship_to_first_name', $order->delivery['firstname']) .
+                               tep_draw_hidden_field('x_ship_to_last_name', $order->delivery['lastname']) .
+                               tep_draw_hidden_field('x_ship_to_address', $order->delivery['street_address']) .
+                               tep_draw_hidden_field('x_ship_to_city', $order->delivery['city']) .
+                               tep_draw_hidden_field('x_ship_to_state', $order->delivery['state']) .
+                               tep_draw_hidden_field('x_ship_to_zip', $order->delivery['postcode']) .
+                               tep_draw_hidden_field('x_ship_to_country', $order->delivery['country']['title']) .
+                               tep_draw_hidden_field('x_Customer_IP', $HTTP_SERVER_VARS['REMOTE_ADDR']) .
+                               tep_draw_hidden_field('x_type', 'auth_capture');
+
+        if (MODULE_PAYMENT_PAYJUNCTION_TEST == 'Yes') $process_button_string .= tep_draw_hidden_field('x_Test_Request', 'TRUE');
+
+      $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $HTTP_POST_VARS;
+
+      if ($HTTP_POST_VARS['x_response_code'] == '1') return;
+      if ($HTTP_POST_VARS['x_response_code'] == '2') {
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_PAYJUNCTION_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
+      }
+      // Code 3 is an error - but anything else is an error too (IMHO)
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR_MESSAGE), 'SSL', true, false));
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_PAYJUNCTION_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYJUNCTION_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayJunction Module', 'MODULE_PAYMENT_PAYJUNCTION_STATUS', 'True', 'Do you want to accept PayJunction payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('username', 'MODULE_PAYMENT_PAYJUNCTION_USERNAME', 'commerce', 'The username for your PayJunction service', '6', '0', now())");
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Only test transactions?', 'MODULE_PAYMENT_PAYJUNCTION_TEST', 'Yes', 'Run only test transactions.', '6', '0', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now())");
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Prompt for CVV2/CVC2 code?', 'MODULE_PAYMENT_PAYJUNCTION_CODE', 'No', 'Prompt for CVV2/CVC2 code for additional security.', '6', '0', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now())");
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYJUNCTION_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYJUNCTION_ZONE', '0', 'If a zone is selected, only enable this payment module for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYJUNCTION_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_PAYJUNCTION_STATUS', 'MODULE_PAYMENT_PAYJUNCTION_USERNAME', 'MODULE_PAYMENT_PAYJUNCTION_CODE', 'MODULE_PAYMENT_PAYJUNCTION_TEST', 'MODULE_PAYMENT_PAYJUNCTION_ZONE', 'MODULE_PAYMENT_PAYJUNCTION_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYJUNCTION_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/AcceptOrder.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/AcceptOrder.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/AcceptOrder.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: AcceptOrder.inc.php,v 1.1.1.1 2004/09/22 13:45:13 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+
+  include(DIR_WS_CLASSES . 'order.php');
+  $order = new order($HTTP_GET_VARS['oID']);
+
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/languages/' . $language . '/paypal.lng.php');
+
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/TransactionDetails/TransactionDetails.class.php');
+  $paypal = new PayPal_TransactionDetails(TABLE_PAYPAL,$order->info['payment_id']);
+
+  if($HTTP_GET_VARS['digest'] != $paypal->digest()) {
+    $messageStack->add_session(ERROR_UNAUTHORIZED_REQUEST);
+  } elseif($paypal->info['payment_status'] === 'Completed' && $order->info['orders_status'] === MODULE_PAYMENT_PAYPAL_ORDER_ONHOLD_STATUS_ID) {
+
+    include(DIR_FS_CATALOG_MODULES . 'payment/paypal/functions/addressbook.func.php');
+    include(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/osC/Order.class.php');
+    $PayPal_osC_Order = new PayPal_osC_Order();
+    $PayPal_osC_Order->setOrderID($HTTP_GET_VARS['oID']);
+    $PayPal_osC_Order->loadOrdersSessionInfo();
+    //$currency = $PayPal_osC_Order->currency;
+    $PayPal_osC_Order->setAccountHistoryInfoURL(tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $PayPal_osC_Order->orderID, 'SSL', false));
+    $PayPal_osC_Order->setCheckoutProcessLanguageFile(DIR_FS_CATALOG_LANGUAGES . $PayPal_osC_Order->language . '/' . 'checkout_process.php');
+    $PayPal_osC_Order->updateProducts($order,$currencies);
+    $PayPal_osC_Order->notifyCustomer($order);
+    $affiliate_ref = $PayPal_osC_Order->affiliate_id;
+    $affiliate_clickthroughs_id = $PayPal_osC_Order->affiliate_clickthroughs_id;
+    $affiliate_clientdate = $PayPal_osC_Order->affiliate_date;
+    $affiliate_clientbrowser = $PayPal_osC_Order->affiliate_browser;
+    $affiliate_clientip = $PayPal_osC_Order->affiliate_ipaddress;
+    if (tep_not_null($affiliate_ref) && $affiliate_ref != '0') {
+      define('MODULE_PAYMENT_PAYPAL_SHOPPING_IPN_AFFILIATE','True');
+      $insert_id = $PayPal_osC_Order->orderID;
+      include(DIR_FS_CATALOG_MODULES . '../affiliate_checkout_process.php');
+    }
+    $PayPal_osC_Order->updateOrderStatus(MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID);
+    $PayPal_osC_Order->removeOrdersSession();
+    $messageStack->add_session(SUCCESS_ORDER_ACCEPTED, 'success');
+  } else {
+    $messageStack->add_session(ERROR_ORDER_UNPAID);
+  }
+  tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/PayPal.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/PayPal.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/PayPal.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: PayPal.inc.php,v 1.1.1.1 2004/09/22 13:45:13 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/TransactionDetails/TransactionDetails.class.php');
+  include_once(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  $payment_statuses = array(
+                              array('id' =>'Completed',          'text' => 'Completed'),
+                              array('id' =>'Pending',            'text' => 'Pending'),
+                              array('id' =>'Failed',             'text' => 'Failed'),
+                              array('id' =>'Denied',             'text' => 'Denied'),
+                              array('id' =>'Refunded',           'text' => 'Refunded'),
+                              array('id' =>'Reversed',           'text' => 'Reversed'),
+                              array('id' =>'Canceled_Reversal',  'text' => 'Canceled_Reversal')
+                            );
+?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_ADMIN_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+            <td class="smallText" align="right"><?php echo tep_draw_form('payment_status', FILENAME_PAYPAL, '', 'get') . HEADING_PAYMENT_STATUS . ' ' . tep_draw_pull_down_menu('payment_status', array_merge(array(array('id' => 'ALL', 'text' => TEXT_ALL_IPNS)), $payment_statuses), $HTTP_GET_VARS['payment_status'], 'onChange="this.form.submit();"').'</form>'; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_DATE; ?></td>
+                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PAYMENT_STATUS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PAYMENT_GROSS; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PAYMENT_FEE; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PAYMENT_NET_AMOUNT; ?></td>
+                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              </tr>
+<?php
+  $common_vars = "p.txn_id, p.parent_txn_id, p.paypal_id, p.txn_type, p.payment_type, p.payment_status, p.pending_reason, p.mc_currency, p.mc_fee, p.payer_status, p.mc_currency, p.date_added, p.mc_gross, p.payment_date";
+  if(isset($HTTP_GET_VARS['payment_status']) && tep_not_null($HTTP_GET_VARS['payment_status']) && $HTTP_GET_VARS['payment_status'] != 'ALL') {
+    $ipn_search = " p.payment_status = '" . tep_db_prepare_input($HTTP_GET_VARS['payment_status']) . "'";
+    switch($HTTP_GET_VARS['payment_status']) {
+      case 'Pending':
+      case 'Completed':
+      default:
+        $ipn_query_raw = "select " . $common_vars . " from " . TABLE_PAYPAL . " as p  where " . $ipn_search . " order by p.paypal_id DESC";
+      break;
+    }
+  } else {
+        $ipn_query_raw = "select " . $common_vars . " from " . TABLE_PAYPAL . " as p order by p.paypal_id DESC";
+  }
+  $ipn_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $ipn_query_raw, $ipn_query_numrows);
+  $ipn_query = tep_db_query($ipn_query_raw);
+  while ($ipn_trans = tep_db_fetch_array($ipn_query)) {
+    if ((!isset($HTTP_GET_VARS['ipnID']) || (isset($HTTP_GET_VARS['ipnID']) && ($HTTP_GET_VARS['ipnID'] == $ipn_trans['paypal_id']))) && !isset($ipnInfo) ) {
+      $ipnInfo = new objectInfo($ipn_trans);
+    }
+
+    if (isset($ipnInfo) && is_object($ipnInfo) && ($ipn_trans['paypal_id'] === $ipnInfo->paypal_id) ) {
+        $rArray = array('Refunded','Reversed','Canceled_Reversal');
+        if(in_array($ipnInfo->payment_status,$rArray)) {
+          $txn_id = $ipnInfo->parent_txn_id;
+        } else {
+          $txn_id = $ipnInfo->txn_id;
+        }
+        $order_query = tep_db_query("select o.orders_id from " . TABLE_ORDERS . " o left join " . TABLE_PAYPAL . " p on p.paypal_id = o.payment_id where p.txn_id = '" . tep_db_input($txn_id) . "'");
+        $onClick = '';
+        if(tep_db_num_rows($order_query)) {
+          $order = tep_db_fetch_array($order_query);
+          $ipnInfo->orders_id = $order['orders_id'];
+          $onClick = "onclick=\"document.location.href='" . tep_href_link(FILENAME_ORDERS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $ipnInfo->orders_id . '&action=edit' . '&referer=ipn') . "'\"";
+        }
+      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" '. $onClick .'>' . "\n";
+    } else {
+      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PAYPAL, 'page=' . $HTTP_GET_VARS['page'] . '&ipnID=' . $ipn_trans['paypal_id']) . '\'">' . "\n";
+    }
+?>
+                <td class="dataTableContent"> <?php echo PayPal_TransactionDetails::date($ipn_trans['payment_date']); ?> </td>
+                <td class="dataTableContent"><?php echo $ipn_trans['payment_status']; ?></td>
+                <td class="dataTableContent" align="right"><?php echo PayPal_TransactionDetails::format($ipn_trans['mc_gross'], $ipn_trans['mc_currency']); ?></td>
+                <td class="dataTableContent" align="right"><?php echo PayPal_TransactionDetails::format($ipn_trans['mc_fee'], $ipn_trans['mc_currency']); ?></td>
+                <td class="dataTableContent" align="right"><?php echo PayPal_TransactionDetails::format($ipn_trans['mc_gross']-$ipn_trans['mc_fee'], $ipn_trans['mc_currency']); ?></td>
+                <td class="dataTableContent" align="right"><?php if (isset($ipnInfo) && is_object($ipnInfo) && ($ipn_trans['paypal_id'] == $ipnInfo->paypal_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_PAYPAL, 'page=' . $HTTP_GET_VARS['page'] . '&ipnID=' . $ipn_trans['paypal_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText" valign="top"><?php echo $ipn_split->display_count($ipn_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_TRANSACTIONS); ?></td>
+                    <td class="smallText" align="right"><?php echo $ipn_split->display_links($ipn_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+<?php
+  $heading = array();
+  $contents = array();
+
+  switch ($action) {
+    case 'new':
+      break;
+    case 'edit':
+      break;
+    case 'delete':
+      break;
+    default:
+      if (is_object($ipnInfo)) {
+        $heading[] = array('text' => '<b>' . TEXT_INFO_PAYPAL_IPN_HEADING.' #' . $ipnInfo->paypal_id . '</b>');
+        if(tep_not_null($ipnInfo->orders_id)) {
+          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('ipnID', 'oID', 'action')) . 'oID=' . $ipnInfo->orders_id .'&action=edit&referer=ipn') . '">' . tep_image_button('button_orders.gif', IMAGE_ORDERS) . '</a>');
+        } elseif(tep_not_null($ipnInfo->txn_id)) {
+          $contents[] = array('align' => 'center', 'text' => '<a href="javascript:openWindow(\''.tep_href_link(FILENAME_PAYPAL, tep_get_all_get_params(array('ipnID', 'oID', 'action')) . 'action=details&info=' . $ipnInfo->txn_id ).'\');">' . tep_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>');
+        }
+        $contents[] = array('text' => '<br>' . TABLE_HEADING_DATE . ': ' . PayPal_TransactionDetails::date($ipnInfo->payment_date));
+      }
+      break;
+  }
+
+  if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
+    echo '            <td width="25%" valign="top">' . "\n";
+
+    $box = new box;
+    echo $box->infoBox($heading, $contents);
+
+    echo '            </td>' . "\n";
+  }
+?>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/Results.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/Results.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/Results.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: Results.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<form name="ipn" method="GET" action="<?php echo  $_SERVER['HTTP_REFERER']?>">
+<input type="hidden" name="action" value="itp"/>
+<table border="0" cellspacing="0" cellpadding="0" class="main">
+<?php if(!$debug->error) { ?>
+  <tr>
+    <td>
+      <table border="0" cellspacing="0" cellpadding="0" style="padding: 4px; border:1px solid #aaaaaa; background: #ffffcc;">
+        <tr>
+          <td><br class="text_spacer"></td>
+          <td class="pperrorbold" style="text-align: center; width:100%;"><?php echo TEST_COMPLETE; ?></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+<?php if($debug->enabled) { ?>
+  <tr>
+    <td style="pptext"><?php echo $debug->info(true); ?></td>
+  </tr>
+<?php   } ?>
+<?php } else { ?>
+  <tr>
+    <td>
+      <table border="0" cellspacing="0" cellpadding="0" style="padding: 4px; border:1px solid #aaaaaa; background: #ffffcc;">
+        <tr>
+          <td><?php echo $page->image('icon_error_40x40.gif',IMAGE_ERROR); ?></td>
+          <td><br class="text_spacer"></td>
+          <td class="pperrorbold" style="text-align: center; width:100%;"><?php echo TEST_INCOMPLETE; ?></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr><td><br class="h10"/></td></tr>
+  <tr>
+    <td class="ppsmalltext"><?php echo TEST_INCOMPLETE_MSG; ?></td>
+  </tr>
+  <tr><td><br class="h10"/></td></tr>
+<?php } ?>
+  <tr><td><hr class="solid"/></td></tr>
+  <tr><td class="buttontd"><input class="ppbuttonsmall" type="submit" name="submit" value="Continue"></td></tr>
+</table>
+</form>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/TestPanel.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/TestPanel.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/TestPanel.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<?php
+/*
+  $Id: TestPanel.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<form name="ipn" method="POST" action="<?php echo tep_catalog_href_link('ipn.php'); ?>">
+<input type="hidden" name="business" value="<?php echo MODULE_PAYMENT_PAYPAL_BUSINESS_ID; ?>"/>
+<input type="hidden" name="receiver_email" value="<?php echo MODULE_PAYMENT_PAYPAL_ID; ?>"/>
+<input type="hidden" name="verify_sign" value="PAYPAL_SHOPPING_CART_IPN-TEST_TRANSACTION-00000000000000"/>
+<input type="hidden" name="payment_date" value="<?php echo date("H:i:s M d, Y T"); ?>">
+<input type="hidden" name="digestKey" value="<?php echo PayPal_IPN::digestKey(); ?>">
+<table border="0" cellspacing="0" cellpadding="2" class="main">
+<?php if (MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE == 'Off') { ?>
+  <tr>
+    <td>
+      <table border="0" cellspacing="0" cellpadding="0" style="padding: 4px; border:1px solid #aaaaaa; background: #ffffcc;">
+        <tr>
+          <td><?php echo $page->image('icon_error_40x40.gif','Error icon'); ?></td>
+          <td><br class="text_spacer"></td>
+          <td class="pperrorbold" style="text-align: center; width:100%;">Test Mode must be enabled!</td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td><br class="h10"></td>
+  </tr>
+<?php } ?>
+  <tr>
+    <td style="text-align: right;"><a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=itp&mode=advanced'); ?>">Advanced</a>&nbsp;&nbsp;&nbsp;<a href="#" onclick="openWindow('<?php echo tep_href_link('paypal.php','action=itp-help'); ?>');">Help with this page</a>&nbsp;<a href="#" onclick="openWindow('<?php echo tep_href_link('paypal.php','action=itp-help'); ?>');"><img src="<?php echo $page->imagePath('help.gif')?>" border="0" hspace="0" align="top"></a></td>
+  </tr>
+  <tr>
+    <td>
+      <table border="0" cellspacing="0" cellpadding="2" class="ppheaderborder" width="100%">
+        <tr>
+          <td align="center">
+            <table border="0" cellspacing="0" cellpadding="3" class="testpanelinfo">
+              <tr>
+                <td class="pptextbold" nowrap>Primary PayPal Email Address</td>
+                <td class="pptextbold" nowrap>Business ID</td>
+                <td class="pptextbold" nowrap>Debug Email Address</td>
+              </tr>
+              <tr>
+                <td nowrap><?php echo MODULE_PAYMENT_PAYPAL_ID; ?></td>
+                <td nowrap><?php echo MODULE_PAYMENT_PAYPAL_BUSINESS_ID; ?></td>
+                <td nowrap><?php echo MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL; ?></td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td><br class="h10"></td>
+  </tr>
+  <tr valign="top">
+    <td>
+      <table border="0" cellspacing="0" cellpadding="5" class="testpanel">
+        <tr valign="top">
+          <td>
+            <table width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr><td nowrap>First Name</td><td nowrap><input type="text" name="first_name" value="John"></td></tr>
+              <tr><td nowrap>Last Name</td><td nowrap><input type="text" name="last_name" value="Doe"></td></tr>
+              <tr><td nowrap>Business Name</td><td nowrap><input type="text" name="payer_business_name" value="ACME Inc."></td></tr>
+              <tr><td nowrap>Email Address</td><td nowrap><input type="text" name="payer_email" value="root at localhost"></td></tr>
+              <tr><td nowrap>Payer ID</td><td nowrap><input type="text" name="payer_id" value="PAYERID000000"></td></tr>
+              <tr><td nowrap>Payer Status</td><td nowrap align="right"><select name="payer_status"><option value="verified">verified</option><option value="unverified">unverified</option></select></td></tr>
+              <tr><td nowrap>Invoice</td><td nowrap><input type="text" name="invoice" value=""></td></tr>
+            </table>
+          </td>
+          <td>
+            <table border="0" cellspacing="0" cellpadding="2">
+              <tr valign="top"><td nowrap>Address Name</td><td nowrap><input type="text" name="address_name" value="John Doe"></td></tr>
+              <tr><td nowrap>Address Street</td><td nowrap><input type="text" name="address_street" value="1 Way Street"></td></tr>
+              <tr><td nowrap>Address City</td><td><input type="text" name="address_city" value="NeverNever"></td></tr>
+              <tr><td nowrap>Address State</td><td nowrap><input type="text" name="address_state" value="CA"></td></tr>
+              <tr><td nowrap>Address Zip</td><td><input type="text" name="address_zip" value="12345"></td></tr>
+              <tr><td nowrap>Address Country</td><td nowrap><input type="text" name="address_country" value="United States"></td></tr>
+              <tr><td nowrap>Address Status</td><td nowrap align="right"><select name="address_status"><option value="confirmed">confirmed</option><option value="unconfirmed">unconfirmed</option></select></td></tr>
+            </table>
+          </td>
+          <td>
+            <table border="0" cellspacing="0" cellpadding="2">
+              <tr><td nowrap>Payment Type</td><td nowrap align="right"><select name="payment_type"><option value="instant">instant</option><option value="echeck">echeck</option></select></td></tr>
+              <tr><td nowrap>Transaction Type</td><td nowrap align="right"><select name="txn_type"><option value="">--select--</option><option value="cart">cart</option><option value="web_accept">web_accept</option><option value="send_money">send_money</option></select></td></tr>
+              <tr><td nowrap>Custom</td><td nowrap><input type="text" name="custom" value="1" maxlength="32"></td></tr>
+              <tr><td nowrap>Transaction ID</td><td nowrap><input type="text" name="txn_id" value="PAYPAL00000000000" maxlength="17"></td></tr>
+              <tr><td nowrap>Parent Transaction ID</td><td nowrap><input type="text" name="parent_txn_id" value="" maxlength="17"></td></tr>
+              <tr><td nowrap>No. Cart Items</td><td><input type="text" name="num_cart_items" value="1"></td></tr>
+              <tr><td nowrap>Notify Version</td><td nowrap align="right"><select name="notify_version"><option value="1.6" selected>1.6</option></select></td></tr>
+              <tr><td nowrap>Memo</td><td nowrap><input type="text" name="memo" value="PAYPAL_SHOPPING_CART_IPN TEST"></td></tr>
+            </table>
+          </td>
+        </tr>
+        <tr valign="top">
+          <td>
+            <table border="0" cellspacing="0" cellpadding="2">
+              <tr><td nowrap>MC Currency</td><td align="right"><select name="mc_currency"><option value="USD">USD</option><option value="GBP">GBP</option><option value="EUR">EUR</option><option value="CAD">CAD</option><option value="JPY">JPY</option></select></td></tr>
+              <tr><td nowrap>MC Gross</td><td align="right"><input type="text" name="mc_gross" value="0.01"></td></tr>
+              <tr><td nowrap>MC Fee</td><td align="right"><input type="text" name="mc_fee" value="0.01"></td></tr>
+            </table>
+          </td>
+          <td>
+            <table border="0" cellspacing="0" cellpadding="2">
+              <tr><td nowrap>Settle Amount</td><td align="right"><input type="text" name="settle_amount" value="0.00"></td></tr>
+              <tr><td nowrap>Settle Currency</td><td align="right"><select name="settle_currency"><option value=""></option><option value="USD">USD</option><option value="GBP">GBP</option><option value="EUR">EUR</option><option value="CAD">CAD</option><option value="JPY">JPY</option></select></td></tr>
+              <tr><td nowrap>Exchange Rate</td><td align="right"><input type="text" name="exchange_rate" value="0.00"></td></tr>
+            </table>
+          </td>
+          <td>
+            <table border="0" cellspacing="0" cellpadding="2">
+              <tr><td nowrap>Payment Status</td><td align="right"><select name="payment_status"><option value="Completed">Completed</option><option value="Pending">Pending</option><option value="Failed">Failed</option><option value="Denied">Denied</option><option value="Refunded">Refunded</option><option value="Reversed">Reversed</option><option value="Canceled_Reversal">Canceled_Reversal</option></select></td></tr>
+              <tr><td nowrap>Pending Reason</td><td align="right"><select name="pending_reason"><option value=""></option><option value="echeck">echeck</option><option value="multi_currency">multi_currency</option><option value="intl">intl</option><option value="verify">verify</option><option value="address">address</option><option value="upgrade">upgrade</option><option value="unilateral">unilateral</option><option value="other">other</option></select></td></tr>
+              <tr><td nowrap>Reason Code</td><td align="right"><select name="reason_code"><option value=""></option><option value="chargeback">chargeback</option><option value="guarantee">guarantee</option><option value="buyer_complaint">buyer_complaint</option><option value="refund">refund</option><option value="other">other</option></select></td></tr>
+            </table>
+          </td>
+        </tr>
+<?php if (isset($HTTP_GET_VARS['mode']) && $HTTP_GET_VARS='Advanced') { ?>
+        <tr valign="top">
+          <td>
+            <table border="0" cellspacing="0" cellpadding="2">
+              <tr><td nowrap>Tax</td><td align="right"><input type="text" name="tax" value="0.00"></td></tr>
+            </table>
+          </td>
+          <td>
+            <table border="0" cellspacing="0" cellpadding="2">
+              <tr><td nowrap>For Auction</td><td align="right"><select name="for_auction"><option value="">No</option><option value="true">Yes</option></select></td></tr>
+              <tr><td nowrap>Auction Buyer ID</td><td align="right"><input type="text" name="auction_buyer_id" value=""></td></tr>
+              <tr><td nowrap>Auction Closing Date</td><td align="right"><input type="text" name="auction_closing_date" value="<?php echo date("H:i:s M d, Y T"); ?>"></td></tr>
+              <tr><td nowrap>Auction Multi-Item</td><td align="right"><input type="text" name="auction_multi_item" value=""></td></tr>
+            </table>
+          </td>
+          <td>
+            <table border="0" cellspacing="0" cellpadding="2">
+              <tr><td nowrap>Item Name</td><td align="right"><input type="text" name="item_name" value=""></td></tr>
+              <tr><td nowrap>Item Number</td><td align="right"><input type="text" name="item_number" value=""></td></tr>
+              <tr><td nowrap>Quantity</td><td align="right"><input type="text" name="quantity" value=""></td></tr>
+            </table>
+          </td>
+        </tr>
+<?php } ?>
+      </table>
+    </td>
+  </tr>
+  <tr><td><hr class="solid"/></td></tr>
+  <tr><td class="buttontd"><input class="ppbuttonsmall" type="submit" name="submit" value="Test IPN"></td></tr>
+</table>
+<form>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/languages/english/Help.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/languages/english/Help.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TestPanel/languages/english/Help.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: Help.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td class="pptext" colspan="2">The following is a quick guide towards simmulating your own IPNs:</td>
+  </tr>
+  <tr>
+    <td class="ppsmalltext" valign="top">
+    <br><ol>
+      <li>Begin to check out as a customer via the store, stop when you get to the PayPal site</li><br><br class="h6">
+      <li>Go into the store admin orders section and find the last order (just created)</li><br><br class="h6">
+      <li>Select a <b>Transaction Type</b>, usually cart or web_accept, but nothing for refunds, reversals, or canceled_reversals payments</li><br><br class="h6">
+      <li>Copy and paste the <b>Transaction Signature</b> into the <b>Custom</b> field and into the <b>Transaction ID</b> field</li><br><br class="h6">
+      <li>If the <b>Cart Test</b> is on, then make sure that the above <b>MC Gross</b> amount is the same as the order total and that the <b>MC&nbsp;Currency</b> field is set to the same currency as the order.</li><br><br class="h6">
+      <li>Submit the Test IPN</li><br><br class="h6">
+      <li>Now check the admin order status</li><br><br class="h6">
+    </ol></td>
+  </tr>
+  <tr>
+    <td><table border="0" cellspacing="0" cellpadding="0" style="width: 100%; padding: 4px; border:1px solid #aaaaaa; background: #ffffcc;">
+        <tr>
+          <td><?php echo $page->image('icon_error_40x40.gif',IMAGE_ERROR); ?></td>
+          <td><br class="text_spacer">&nbsp;</td>
+          <td class="pperrorbold" nowrap>When testing Pending payments etc, remember to use the same Transction ID</td>
+        </tr></table></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TransactionDetails.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TransactionDetails.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TransactionDetails.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,127 @@
+<?php
+/*
+  $Id: TransactionDetails.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  include_once(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/TransactionDetails/TransactionDetails.class.php');
+  $paypal = new PayPal_TransactionDetails(TABLE_PAYPAL);
+  $paypal->query($HTTP_GET_VARS['info']);
+?>
+<table width="100%" cellpadding="0" cellspacing="0" align="center">
+<tr>
+  <td width="150"><?php echo tep_image(DIR_WS_CATALOG_MODULES . 'payment/paypal/images/pixel.gif','','150','1'); ?></td>
+  <td width="6"><?php echo tep_image(DIR_WS_CATALOG_MODULES . 'payment/paypal/images/pixel.gif','','6','1'); ?></td>
+  <td width="100%"><?php echo tep_image(DIR_WS_CATALOG_MODULES . 'payment/paypal/images/pixel.gif','','432','1'); ?></td>
+</tr>
+<tr>
+  <td colspan="3">
+<?php if($paypal->isReversal()) {
+  switch($paypal->info['payment_status']){
+    case 'Reversed': $reversalType = ENTRY_REVERSED; break;
+    case 'Refunded': $reversalType = ENTRY_REFUND; break;
+  }
+?>
+    <span class="pptextbold"><?php echo $reversalType; ?></span>
+<?php } else { ?>
+    <span class="pptextbold"><?php echo ENTRY_PAYMENT_RECEIVED; ?></span>
+<?php } ?>
+    <span class="ppsmalltext">(ID # <?php echo $paypal->info['txn_id']; ?>)</span>
+  </td>
+</tr>
+<tr><td colspan=3><br class="h10"></td></tr>
+<tr><td colspan=3><br class="h10"></td></tr>
+<tr valign="top">
+  <td align="right" class="pplabel"><?php echo ENTRY_CUSTOMER_NAME; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->customer['first_name'].' '.$paypal->customer['last_name']; ?>&nbsp;&nbsp;&nbsp;&nbsp;<?php if(!$paypal->isReversal()) { ?>(The sender of this payment is <span class="ppem106"><?php echo ucfirst($paypal->customer['payer_status']); ?></span>)<?php } ?></td>
+</tr>
+<tr valign="top">
+  <td align="right" class="pplabel"><?php echo ENTRY_CUSTOMER_EMAIL; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->customer['payer_email']; ?></td>
+</tr>
+<?php if($paypal->info['for_auction'] === 'true') { ?>
+<tr valign="top">
+  <td align="right" class="pplabel"><?php echo ENTRY_CUSTOMER_AUCTION_BUYER_ID; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->customer['auction_buyer_id']; ?></td>
+</tr>
+<?php } ?>
+<tr><td colspan=3><hr class="dotted"></td></tr>
+<tr><td colspan=3><br class="h10"></td></tr>
+<tr valign=top>
+  <td class="pplabel" align=right><?php echo ENTRY_TXN_GROSS_AMOUNT; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->format($paypal->txn['mc_gross'],$paypal->txn['mc_currency']); ?></td>
+</tr>
+<tr valign=top>
+  <td class="pplabel" align=right><?php echo ENTRY_TXN_FEE_AMOUNT; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->format($paypal->txn['mc_fee'],$paypal->txn['mc_currency']); ?></td>
+</tr>
+<tr valign=top>
+  <td class="pplabel" align=right><?php echo ENTRY_TXN_NET_AMOUNT; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->format($paypal->txn['mc_gross']-$paypal->txn['mc_fee'],$paypal->txn['mc_currency']); ?></td>
+</tr>
+<tr><td colspan=3><hr class="dotted"></td></tr>
+<tr><td colspan=3><br class="h10"></td></tr>
+<tr valign="top">
+  <td align="right" class="pplabel"><?php echo ENTRY_INFO_DATE; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->date($paypal->info['date_added']); ?></td>
+</tr>
+<tr valign="top">
+  <td align="right" class="pplabel"><?php echo ENTRY_INFO_TIME; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->time($paypal->info['date_added']).' '.$paypal->info['payment_time_zone']; ?></td>
+</tr>
+<tr valign="top">
+  <td align="right" class="pplabel"><?php echo ENTRY_TXN_STATUS; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->info['payment_status']; ?></td>
+</tr>
+<?php if($paypal->isPending()) { ?>
+<tr valign="top">
+  <td align="right" class="pplabel"><?php echo ENTRY_TXN_PENDING_REASON; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->info['pending_reason']; ?></td>
+</tr>
+<?php } elseif($paypal->isReversal()) { ?>
+<tr valign="top">
+  <td align="right" class="pplabel"><?php echo ENTRY_TXN_REASON; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->info['reason_code']; ?></td>
+</tr>
+<?php } ?>
+<tr><td colspan=3><hr class="dotted"></td></tr>
+<tr><td colspan=3><br class="h10"></td></tr>
+<tr valign=top>
+  <td class="pplabel" align=right><?php echo ENTRY_CUSTOMER_SHIPPING_ADDRESS; ?><br></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext"><?php echo $paypal->customer['address_name']; ?><br><?php echo $paypal->customer['address_street']; ?><br><?php echo $paypal->customer['address_city']; ?>, <?php echo $paypal->customer['address_state']; ?>  <?php echo $paypal->customer['address_zip']; ?><br><?php echo $paypal->customer['address_country']; ?>
+  <?php if(!$paypal->isReversal()) { ?><br><span class="ppinlinegreen"><b><?php echo ucfirst($paypal->customer['address_status']); ?></b></span><?php } ?>
+  </td>
+</tr>
+<tr><td colspan=3><hr class="dotted"></td></tr>
+<tr><td colspan=3><br class="h10"></td></tr>
+<tr valign="top">
+  <td align="right" class="pplabel"><?php echo ENTRY_TXN_PAYMENT_TYPE; ?></td>
+  <td><br class="text_spacer"></td>
+  <td class="ppsmalltext" style="vertical-align: middle"><?php echo $paypal->displayPaymentType(); ?></td>
+</tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TransactionSummaryLogs.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TransactionSummaryLogs.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/TransactionSummaryLogs.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,94 @@
+<?php
+/*
+  $Id: TransactionSummaryLogs.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/TransactionDetails/TransactionDetails.class.php');
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/Page/Page.class.php');
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/functions/general.func.php');
+  paypal_include_lng(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/languages/', $language, 'paypal.lng.php');
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.inc.php');
+  $paypal = new PayPal_TransactionDetails(TABLE_PAYPAL,$order->info['payment_id']);
+?>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr valign="top">
+            <td colspan="2" style="padding-bottom:0px;"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . '../modules/payment/paypal/images/paypal_logo.gif','PayPal'); ?></td>
+          </tr>
+          <tr valign="top">
+            <td class="main">
+            <style type="text/css">.Txns{font-family: Verdana;font-size: 10px;color: #000000;background-color: #aaaaaa;}.Txns td {padding: 2px 4px;}.TxnsTitle td {color: #000000;font-weight: bold;font-size: 13px;}.TxnsSTitle td{background-color: #ccddee;color: #000000;font-weight: bold;}</style>
+            <script type="text/javascript">function openWindow(url,name,args) {if (url == null || url == '') exit;if (name == null || name == '') name = 'popupWin';if (args == null || args == '') args = 'toolbar,status,scrollbars,resizable,width=640,height=480,left=50,top=50';popupWin = window.open(url,name,args);popupWin.focus();}</script>
+            <table cellspacing="1" cellpadding="1" border="0" class="Txns">
+            <tr><td colspan="7" bgcolor="#EEEEEE">&nbsp;<b><?php echo TABLE_HEADING_TXN_ACTIVITY; ?></b></td></tr>
+            <tr class="TxnsSTitle">
+              <td nowrap>&nbsp;<?php echo TABLE_HEADING_DATE; ?>&nbsp;</td>
+              <td nowrap>&nbsp;<?php echo TABLE_HEADING_PAYMENT_STATUS; ?>&nbsp;</td>
+              <td nowrap>&nbsp;<?php echo TABLE_HEADING_DETAILS; ?>&nbsp;</td>
+              <td nowrap>&nbsp;<?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
+              <td nowrap align="right">&nbsp;<?php echo TABLE_HEADING_PAYMENT_GROSS; ?>&nbsp;</td>
+              <td nowrap align="right">&nbsp;<?php echo TABLE_HEADING_PAYMENT_FEE; ?>&nbsp;</td>
+              <td nowrap align="right">&nbsp;<?php echo TABLE_HEADING_PAYMENT_NET_AMOUNT; ?>&nbsp;</td>
+          </tr>
+<?php
+  if (tep_not_null($paypal->info['txn_id'])) {
+    $paypal_history_query = tep_db_query("select txn_id, payment_status, mc_gross, mc_fee, mc_currency, date_added, payment_date from " . TABLE_PAYPAL . " where parent_txn_id = '" . tep_db_input($paypal->info['txn_id']) . "' order by date_added desc");
+    if (tep_db_num_rows($paypal_history_query)) {
+      $phCount = 1;
+      while ($paypal_history = tep_db_fetch_array($paypal_history_query)) {
+        $phColor = (($phCount/2) == floor($phCount/2)) ? '#FFFFFF' : '#EEEEEE';
+        echo '          <tr bgcolor="'.$phColor.'">' . "\n" .
+             '            <td nowrap>&nbsp;' . $paypal->date($paypal_history['payment_date']) . '&nbsp;</td>' . "\n".
+             '            <td nowrap>&nbsp;' . $paypal_history['payment_status'] . '&nbsp;</td>' . "\n" .
+             '            <td nowrap>&nbsp;'. PayPal_Page::draw_href_link(TABLE_HEADING_DETAILS,'action=details&info='.$paypal_history['txn_id']).'&nbsp;</td>' . "\n" .
+
+             '            <td nowrap>&nbsp;</td>' . "\n" . //Action
+
+
+             '            <td nowrap align="right">&nbsp;'. $paypal->format($paypal_history['mc_gross'],$paypal_history['mc_currency']) . '&nbsp;</td>' . "\n" .
+             '            <td nowrap align="right">&nbsp;'. $paypal->format($paypal_history['mc_fee'],$paypal_history['mc_currency']) . '&nbsp;</td>' . "\n" .
+             '            <td nowrap align="right">&nbsp;'. $paypal->format($paypal_history['mc_gross']-$paypal_history['mc_fee'],$paypal_history['mc_currency']) . '&nbsp;</td>' . "\n" .
+
+             '          </tr>' . "\n";
+        $phCount++;
+      }
+    }
+
+  //Now determine whether the order is on hold
+  if($order->info['orders_status'] === MODULE_PAYMENT_PAYPAL_ORDER_ONHOLD_STATUS_ID) {
+    $ppImgAccept = tep_image(DIR_WS_CATALOG_LANGUAGES . '../modules/payment/paypal/images/act_accept.gif',IMAGE_BUTTON_TXN_ACCEPT);
+    $ppAction = '<a href="'.tep_href_link(FILENAME_ORDERS,tep_get_all_get_params(array('action')).'action=accept_order&digest='.$paypal->digest()).'">'.$ppImgAccept.'</a>';
+  } else {
+    $ppAction = '';
+  }
+?>
+          <tr bgcolor="#FFFFFF">
+            <td nowrap>&nbsp;<?php echo $paypal->date($paypal->info['payment_date']); ?>&nbsp;</td>
+            <td nowrap>&nbsp;<?php echo $paypal->info['payment_status']; ?>&nbsp;</td>
+            <td nowrap>&nbsp;<?php echo PayPal_Page::draw_href_link(TABLE_HEADING_DETAILS,'action=details&info='.$paypal->info['txn_id']); ?>&nbsp;</td>
+
+            <td nowrap>&nbsp;<?php echo $ppAction; ?>&nbsp;</td>
+
+            <td align="right" nowrap>&nbsp;<?php echo $paypal->format($paypal->txn['mc_gross'],$paypal->txn['mc_currency']); ?>&nbsp;</td>
+            <td align="right" nowrap>&nbsp;<?php echo $paypal->format($paypal->txn['mc_fee'],$paypal->txn['mc_currency']); ?>&nbsp;</td>
+            <td align="right" nowrap>&nbsp;<?php echo $paypal->format($paypal->txn['mc_gross']-$paypal->txn['mc_fee'],$paypal->txn['mc_currency']); ?>&nbsp;</td>
+        </tr>
+<?php } else { ?>
+        <tr bgcolor="#FFFFFF">
+          <td colspan="7" nowrap>&nbsp;<?php echo sprintf(TEXT_NO_IPN_HISTORY,$paypal->transactionSignature($oID)); ?>&nbsp;</td>
+        </tr>
+<?php } ?>
+        </table>
+      </td>
+      <td></td>
+    </tr>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/ipn_test_panel.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/ipn_test_panel.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/ipn_test_panel.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,273 @@
+<?php
+/*
+  $Id: ipn_test_panel.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/classes/ipn.class.php');
+?>
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<meta name="copyright" content="2004">
+<meta name="author" content="developer&#064;devosc.com">
+<style type='text/css'>
+body {background-color:#FFFFFF;}
+body, td, th {font-family: sans-serif; font-size: 10px;}
+.p {margin-top:0px;padding-top:0px;}
+.box, .boxEmail {border:1px solid black; width:100%;}
+table.box td {color: #003366; }
+input { border:1px solid #003366;}
+</style>
+</head>
+<body onLoad="javascript:document.ipn.custom.select();">
+<form name="ipn" method="POST" action="<?php echo DIR_WS_CATALOG.'ipn.php'; ?>">
+<input type="hidden" name="business" value="<?php echo MODULE_PAYMENT_PAYPAL_BUSINESS_ID; ?>"/>
+<input type="hidden" name="receiver_email" value="<?php echo MODULE_PAYMENT_PAYPAL_ID; ?>"/>
+<input type="hidden" name="verify_sign" value="PAYPAL_SHOPPING_CART_IPN-TEST_TRANSACTION-00000000000000"/>
+<input type="hidden" name="payment_date" value="<?php echo date("G:i:s M j, Y T"); ?>">
+<input type="hidden" name="digest_key" value="<?php echo ipn::digest_key(); ?>">
+<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2">
+      <tr valign="middle">
+        <td align="center">
+<table border="0" width="780" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="0" class="box">
+          <tr>
+            <td align="center"><img border="0" src="<?php echo DIR_WS_CATALOG_LANGUAGES . '../modules/payment/paypal/images/oscommerce.gif'; ?>" alt=" osCommerce " title=" osCommerce " /></td>
+          </tr>
+          <tr>
+            <td class="pageHeading" style="color:green" align="center">PayPal_Shopping_Cart_IPN</td>
+          </tr>
+          <tr>
+            <td class="pageHeading" style="color:blue; text-align:center; padding-top:5px;">IPN Test Panel</td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php if (MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE == 'Off') { ?>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="boxEmail" style="background-color: red;">
+          <tr>
+            <td class="pageHeading" align="center" style="color: #FFFFFF;">TEST MODE MUST BE SWITCHED ON!</td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+<?php } ?>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="boxEmail">
+          <tr>
+            <td align="center"><table border="0" cellspacing="0" cellpadding="3">
+              <tr>
+                <td class="smallText" nowrap><b>Primary PayPal Email Address</b></td>
+                <td class="smallText" style="padding-left:15px;" nowrap><b>Business ID</b></td>
+                <td class="smallText" style="padding-left:15px;" nowrap><b>Debug Email Address</b></td>
+              </tr>
+              <tr>
+                <td class="smallText" nowrap><?php echo MODULE_PAYMENT_PAYPAL_ID; ?></td>
+                <td class="smallText" style="padding-left:15px;" nowrap><?php echo MODULE_PAYMENT_PAYPAL_BUSINESS_ID; ?></td>
+                <td class="smallText" style="padding-left:15px;" nowrap><?php echo MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2" class="box">
+              <tr valign="top">
+                <td>
+                      <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main" nowrap><b>First Name</b></td><td class="main" nowrap><input type="text" name="first_name" value="John"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Last Name</b></td><td class="main" nowrap><input type="text" name="last_name" value="Doe"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_BUSINESS_NAME; ?></b></td><td class="main" nowrap><input type="text" name="payer_business_name" value="ACME Inc."></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td><td class="main" nowrap><input type="text" name="payer_email" value="root at localhost"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYER_ID; ?></b></td><td class="main" nowrap><input type="text" name="payer_id" value="PAYERID000000"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYER_STATUS; ?></b></td><td class="main" nowrap align="right"><select name="payer_status"><option value="verified">verified</option><option value="unverified">unverified</option></select></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_INVOICE; ?></b></td><td class="main" nowrap><input type="text" name="invoice" value=""></td>
+                      </tr>
+                      </table>
+                </td>
+                <td style="padding-left:5px;">
+                      <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                      <tr valign="top">
+                        <td class="main" nowrap><b>Address Name</b></td><td class="main" nowrap><input type="text" name="address_name" value="John Doe"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address Street</b></td><td class="main" nowrap><input type="text" name="address_street" value="1 Way Street"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address City</b></td><td class="main"><input type="text" name="address_city" value="NeverNever"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address State</b></td><td class="main" nowrap><input type="text" name="address_state" value="CA"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address Zip</b></td><td class="main"><input type="text" name="address_zip" value="12345"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address Country</b></td><td class="main" nowrap><input type="text" name="address_country" value="United States"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Address Status</b></td><td class="main" nowrap align="right"><select name="address_status"><option value="confirmed">confirmed</option><option value="unconfirmed">unconfirmed</option></select></td>
+                      </tr>
+                      </table>
+                </td>
+                <td style="padding-left:5px;">
+                      <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYMENT_TYPE; ?></b></td><td class="main" nowrap align="right"><select name="payment_type"><option value="instant">instant</option><option value="echeck">echeck</option></select></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Transaction Type</b></td><td class="main" nowrap align="right"><select name="txn_type"><option value="cart">cart</option><option value="web_accept">web_accept</option><option value="send_money">send_money</option></select></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Custom</b></td><td class="main" nowrap><input type="text" name="custom" value="1" maxlength="32"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYPAL_IPN_TXN; ?></b></td><td class="main" nowrap><input type="text" name="txn_id" value="PAYPAL00000000000" maxlength="17"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_CART_ITEMS; ?></b></td><td class="main"><input type="text" name="num_cart_items" value="1"></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Notify Version</b></td><td class="main" nowrap align="right"><select name="notify_version"><option value="1.6" selected>1.6</option></select></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b>Memo</b></td><td class="main" nowrap><input type="text" name="memo" value="PAYPAL_SHOPPING_CART_IPN TEST"></td>
+                      </tr>
+                      </table>
+                </td>
+              </tr>
+              <tr>
+                <td>
+                        <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_MC_CURRENCY; ?></b></td><td class="main" align="right"><select name="mc_currency"><option value="USD">USD</option><option value="GBP">GBP</option><option value="EUR">EUR</option><option value="CAD">CAD</option><option value="JPY">JPY</option></select></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_MC_GROSS; ?></b></td><td class="main" align="right"><input type="text" name="mc_gross" value="0.01"></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_MC_FEE; ?></b></td><td class="main" align="right"><input type="text" name="mc_fee" value="0.01"></td>
+                          </tr>
+                        </table>
+                </td>
+                <td>
+                        <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_SETTLE_AMOUNT; ?></b></td><td class="main" align="right"><input type="text" name="settle_amount" value="0.00"></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_SETTLE_CURRENCY; ?></b></td><td class="main" align="right"><select name="settle_currency"><option value=""></option><option value="USD">USD</option><option value="GBP">GBP</option><option value="EUR">EUR</option><option value="CAD">CAD</option><option value="JPY">JPY</option></select></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b><?php echo ENTRY_EXCHANGE_RATE; ?></b></td><td class="main" align="right"><input type="text" name="exchange_rate" value="0.00"></td>
+                          </tr>
+                        </table>
+                </td>
+                <td>
+                        <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                          <tr>
+                            <td class="main" nowrap><b>Payment Status</b></td><td class="main" align="right"><select name="payment_status"><option value="Completed">Completed</option><option value="Pending">Pending</option><option value="Failed">Failed</option><option value="Denied">Denied</option><option value="Refunded">Refunded</option><option value="Reversed">Reversed</option><option value="Canceled_Reversal">Canceled_Reversal</option></select></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b>Pending Reason</b></td><td class="main" align="right"><select name="pending_reason"><option value=""></option><option value="echeck">echeck</option><option value="multi_currency">multi_currency</option><option value="intl">intl</option><option value="verify">verify</option><option value="address">address</option><option value="upgrade">upgrade</option><option value="unilateral">unilateral</option><option value="other">other</option></select></td>
+                          </tr>
+                          <tr>
+                            <td class="main" nowrap><b>Reason Code</b></td><td class="main" align="right"><select name="reason_code"><option value=""></option><option value="chargeback">chargeback</option><option value="guarantee">guarantee</option><option value="buyer_complaint">buyer_complaint</option><option value="refund">refund</option><option value="other">other</option></select></td>
+                          </tr>
+                        </table>
+                </td>
+              </tr>
+              </table>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td>
+          <table border="0" width="100%" cellspacing="0" cellpadding="5" class="box">
+            <tr valign="top">
+              <td align="center">
+                <input type="submit" name="submit" value="Test IPN">
+              </td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="boxEmail" style="">
+          <tr>
+            <td class="pageHeading" align="center" style="color: #FFFFFF; background-color: #003366;">Instructions</td>
+          </tr>
+          <tr>
+            <td class="main" style="padding:10 0 10 0;">
+<ul>
+<li>Begin to check out as a customer via the store, stop when you get to the PayPal site</li>
+<li>Go into the store admin orders section and find the last order (just created)</li>
+<li>Copy and paste the <b>Transaction Signature</b> into the above <b>Custom</b> field and into the <b>Transaction ID</b> field</li>
+<li>If the <b>Cart Test</b> is on, then make sure that the above <b>MC Gross</b> amount is the same as the order total and that the <b>MC&nbsp;Currency</b> field is set to the same currency as the order.</li>
+<li>Submit the Test IPN</li>
+<li>Now check the admin order status</li>
+</ul>
+<p align="center"><b style="color:red;">If you're testing Pending payments etc, then remember to use the same Transction ID.<br/></b></p>
+</td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2" class="boxEmail" style="border:none;">
+          <tr>
+            <td class="main" style="padding:10 0 10 0;"><?php require(DIR_WS_INCLUDES . 'footer.php'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+</td>
+</tr>
+</table>
+<form>
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,32 @@
+<?php
+/*
+  $Id: Help.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center" style="background: #ffffff url(<?php echo $page->baseURL.'images/hdr_ppGlobev4_160x76.gif'?>) no-repeat top right;">
+  <tr>
+    <tr><td><br class="h10"></td></tr>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 20px; padding: 0px 0px 0px 5px; list-style-image: url(<?php echo $page->baseURL.'images/contents.gif'; ?>);">
+      <li>&nbsp;<b><a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=help-cfg','NONSSL'); ?>">Configuration Guide</a></b></li><br /><br class="h6" />
+      <li>&nbsp;<b><a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL'); ?>">Frequently Asked Questions</a></b></li><br /><br class="h6" />
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><br class="h10"></td></tr>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_Config.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_Config.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_Config.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: Help_Config.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td style="padding-bottom: 5px; text-align: right;"><?php echo tep_image($page->baseURL . 'images/contents.gif','Contents','','','align=absmiddle'); ?>&nbsp;<a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=help','NONSSL'); ?>">Contents</a>&nbsp;</td>
+  </tr>
+  <tr>
+    <td class="pptext">The following is a guide towards configuring your store's PayPal payment module settings:</td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">Enable PayPal Module</b><br />Since you have just done the installation, by default it will say yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">E-Mail Address</b><br />Enter your Primary PayPal email address here, if you have more than one email address registered with PayPal then you must login your PayPal account to determine which one is your <b>Primary</b> email address.</li><br /><br class="h6" />
+      <li><b class="ppem380">Business ID</b><br />If you have configured a secondary email address to be your Business ID (email address) in your PayPal profile account, then enter this here, otherwise enter the one used above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Transaction Currency</b><br />Choose which currencies you want to accept PayPal payments with.</li><br /><br class="h6" />
+      <li><b class="ppem380">Payment Zone</b><br />If a zone is selected, only enable this payment method for that zone.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Pending Notification</b> Order Status</b><br />Set the Pending Notification status of orders made with this payment module to this value, '<b style="color:blue">Pending</b>' is suggested or alternatively the optional order status created in step 4 above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Order</b> Status</b><br />Set the status of orders made with this payment module to this value <b style="color:red">Do not set it to 'default' but specifically choose the status required</b>, '<b style="color:blue">Processing</b>' is suggested.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>On Hold Order</b> Status</b><br />This order status is used when the Cart Test has failed, eg. the expected payment amount did not match.</li><br /><br class="h6" />
+      <li><b class="ppem380">Set <b>Canceled Order</b> Status</b><br />Refunded, Reversed, Failed or Denied payments will be set to this order status.</li><br /><br class="h6" />
+      <li><b class="ppem380">Synchronize Invoice</b><br />Specify whether the osCommerce order number should be used as a <b>unique</b> PayPal invoice number, similiar to PayPal's Send Money feature, this will enable customers to resume an order via their osCommerce account history info page for that order for pending transactions which were not previously completed.</li><br /><br class="h6" />
+      <li><b class="ppem380">Sort order of display</b><br />Sort order of display. Lowest is displayed first.</li><br /><br class="h6" />
+      <li><b class="ppem380">Background Color</b><br />Select the background color of PayPal's payment pages, either black or white.</li><br /><br class="h6" />
+      <li><b class="ppem380">Processing logo</b><br />Specify the image file name to be used in the store's checkout process splash page, must be located in <code>catalog/images</code> directory.</li><br /><br class="h6" />
+      <li><b class="ppem380">Store logo</b><br />Specify the image file name for PayPal to display on their payment pages pages, must be located in <code>catalog/images</code> directory. If you do not have SSL then leave this field blank.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Page Style Name</b><br />Specify the name of the page style you have configured in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">Include a note with payment</b><br />When a customer arrives at the PayPal payment page you can choose whether or not to show them another note field which will have seperate contents from that of the one provided in your store's checkout process but will be included in PayPal's invoice and receipt.<br />To change the title appearing above this field on the PayPal payment page look in the corresponding catalog langauge file (<code>catalog/includes/langauges/english/modules/payment/paypal.php</code>).</li><br /><br class="h6" />
+      <li><b class="ppem380">Shopping Cart Method</b><br />Choose which type of PayPal Shopping Cart you want to use, Aggregate simply means the total amount is passed (with a list of the products shown in a single item field), whereas an Itemized Cart will list indivudally all the items the customer has selected in their PayPal invoice.</li><br /><br class="h6" />
+      <li><b class="ppem380">Enable PayPal Shipping Address</b><br />Allow the customer to choose their own PayPal shipping address. (See <a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL'); ?>">FAQ's</a> for more info)</li><br /><br class="h6" />
+      <li><b class="ppem380">Digest Key</b><br />Specify a unique digest key, this will then be used similiar to a password while testing via the IPN Test Panel <b>and</b> also the store's PayPal transaction signature digest key.</li><br /><br class="h6" />
+      <li><b class="ppem380">Test Mode</b><br />This should be off for live environments.<br />You can simulate your own IPNs via the <a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=itp'); ?>">IPN Test Panel</a>.</li><br /><br class="h6" />
+      <li><b class="ppem380">Cart Test</b><br />This test verifies that the amount received via PayPal matches to what is expected (See <a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=help-faqs','NONSSL'); ?>">FAQ's</a> for more info).</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notifications</b><br />Choose whether you want to receive debug emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Debug Email Notification Address</b><br />Enter a seperate email address where you wish to receive <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">PayPal Domain</b><br />This must be set to <b>paypal.com</b> for live production environments, this setting is to facilate PayPal's sandbox and is not related to the IPN Test Panel or the above Test Mode option.</li><br /><br class="h6" />
+      <li><b class="ppem380">Return URL behavior</b><br />This determines what method PayPal should use when returning the customer back to the store, leave this set to 1 (GET).</li><br /><br class="h6" />
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd"><form name="contents" action="<?php echo tep_href_link(FILENAME_PAYPAL,'','NONSSL'); ?>"><input type="hidden" name="action" value="help" /><input type="submit" value="Contents" class="ppbuttonsmall" /></form></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_Config.inc_notes.txt
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_Config.inc_notes.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_Config.inc_notes.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3 @@
+CRE Loaded Changelog
+==========================
+9/20/2004 - various minor spelling corrections  DMG

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_FAQs.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_FAQs.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/Help_FAQs.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: Help_FAQs.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table class="popupmain" cellspacing="0" cellpadding="0" border="0" align="center">
+  <tr>
+    <td style="padding-bottom: 5px; text-align: right;"><?php echo tep_image($page->baseURL . 'images/contents.gif','Contents','','','align=absmiddle'); ?>&nbsp;<a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=help','NONSSL'); ?>">Contents</a>&nbsp;</td>
+  </tr>
+  <tr>
+    <td class="pptext">The following are some frequently asked questions about this payment module:</td>
+  </tr>
+  <tr>
+    <td class="pptext" valign="top">
+    <ul style="margin: 10px 0px 0px 0px; padding: 0px 0px 0px 5px; list-style-type: none;">
+      <li><b class="ppem380">My shipping costs are different once the customer arrives at the PayPal site.</b></legend><div>In your PayPal account profile in the shipping section, check the box that allows overriding the shipping costs.</li><br /><br class="h6" />
+      <li><b class="ppem380">Do I need to enable IPN in my PayPal account profile.</b><br />No.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the IPN feature to be used.</b><br />You don't need to, it will automatically be specified.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why doesn't the Auto-Return feature work.</b><br />You must enable it first in your PayPal account profile.</li><br /><br class="h6" />
+      <li><b class="ppem380">What url should I specify for the Auto-Return feature.</b><br />It doesn't matter, this contribution will automatically specify the correct script url location, which is now <code>catalog/checkout_success.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Does this contribution support PayPal Credit Card payments.</b><br />Yes.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I getting so many emails per transaction.</b><br />You get <b>one</b> from PayPal and <b>one</b> osCommerce order confirmation email, and another which is the <b>debug email</b>, either disable <b>debug</b> email notification or specify a sperate email address for <b>debug</b> emails.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why am I not receiving any IPNs.</b><br />You must ensure that your <b>Primary Email Address</b> and <b>Business ID</b> are configured correctly.<br />Login to your PayPal Account and see what and how many email addresses you are using and which one is the Primary address.<br />Also check your debug emails as it will also specify the Primary Email Address of the intended receiver.</li><br /><br class="h6" />
+      <li><b class="ppem380">I'm having problems with Multi-Currencies.</b><br />This problem should now be resolved, previously the <b>Cart Test</b> was comparing the currency and amounts of the actual order to what PayPal received as opposed to actually comparing the currency and amounts prior to transfering the customer to PayPal.<br /><br /><b>However</b>, if you're using the Itemized Shopping Cart then discrepancies may arise due to PayPal's two decimal place calculations, in such an event the order will be placed on hold. Although this type of discrepancy may not affect all orders it does however exist and now adds a future requirement to enable you to finalize the transaction via your store's admin.</li><br /><br class="h6" />
+      <li><b class="ppem380">I'm having problems verifying the Cart Totals.</b><br />See above.</li><br /><br class="h6" />
+      <li><b class="ppem380">Why is there no PayPal shipping address details in the IPN info?</b><br />Set Enable PayPal Shipping Address to 'No' if you require a PayPal verified shipping address or set to 'Yes' if you do not.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can I customize the Checkout redirect page.</b><br />The splash template page shown while transfering the customer to PayPal is:<br /><code>catalog/includes/modules/payment/paypal/catalog/checkout_splash.inc.php</code></li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find more PayPal logo buttons.</b><br />Login to your PayPal account and click Merchant Tools or Auction Tools.</li><br /><br class="h6" />
+      <li><b class="ppem380">Where can I find PayPal documentation.</b><br /><ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;"><li><a href="https://www.paypal.com/en_US/pdf/integration_guide.pdf">PayPal Integration Manual</a></li></ul></li><br /><br class="h6" />
+
+      <li><b class="ppem380">How do I use PayPal's Sandbox.</b>
+        <ul style="margin-left: 15px; margin-top: 5px; padding-left: 5px;">
+          <li>Register with <a href="https://developer.paypal.com/" target="PPDC">PayPal Developer Central</a></li><br class="h6" />
+          <li>Then create <b>two virtual accounts</b> types:<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Personal Account</li><li>Premier or Business Account</li></ul></li><br class="h6" />
+          <li>Confirm both accounts (each is just a single click option).</li><br class="h6" />
+          <li>Transfer some virtual money into your personal account (Click the add funds link).</li><br class="h6" />
+          <li>Emails to both accounts will appear in the section where you initially login into the PayPal Developer Central, no real emails are sent so the email addresses for your virtual accounts should be fictitious.</li><br class="h6" />
+          <li>Now in your <a href="<?php echo tep_href_link(FILENAME_MODULES,'set=payment&module=paypal&action=edit'); ?>" target="_blank">osCommerce::Admin::Modules::Payment::PayPal</a> configuration section<ul style="margin-top: 5px; margin-left: 10px; padding-left: 10px;"><li>Enter the virtual business account email address into both the Primary Email Address and Business ID fields</li><li>Set the domain to www.sandbox.paypal.com</li></ul></li><br class="h6" />
+          <li>Now checkout as a customer via the store, this account should have a real email address (so that you can receive the osC customer order confirmation email), and when you arrive at the PayPal Sandbox site (look for their logo) then login using the virtual personal account details and finalize the payment process.</li>
+        </ul>
+       <br /><p class="ppsmallerrorbold">Note that you must first login via the PayPal Developer Central prior to testing the Sandbox/Checkout process.</p>
+      </li><br /><br class="h6" />
+
+      <li><b class="ppem380">What's the difference between the IPN Test Panel and using PayPal's Sandbox.</b><br />The <a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=itp'); ?>" target="itp">IPN Test Panel</a> is an independent osCommerce Contribution feature, for testing and development purposes, which allows you to simmulate your own IPNs without having to interact with PayPal.<br /><br /><p class="ppsmallerrorbold">All Test IPNs via the IPN Test Panel will be invalid according to PayPal since they're not authentic transactions.</p></li><br /><br class="h6" />
+      <li><b class="ppem380">Is the IPN Test Panel related to PayPal's Sandbox.</b><br />No, see above.</li><br /><br class="h6" />
+      <li><b class="ppem380">What's the purpose of the digest key.</b><br />Currently the digest key serves two purposes, it authenticates and allows you to use the <a href="<?php echo tep_href_link(FILENAME_PAYPAL,'action=itp'); ?>" target="itp">IPN Test Panel</a>, secondly, untill such time that PayPal provides a secure method of associating an IPN specifically to a particular order, it serves as a unique transaction signature identifier.</li><br /><br class="h6" />
+      <li><b class="ppem380">Should I change the digest key default value.</b><br />Yes, but remember what it is if uninstalling and reinstalling this contrib payment module in the admin since there might be existing pending orders which will require it in order to associate with to their corresponding IPN(s).</li><br /><br class="h6" />
+      <li><b class="ppem380">How are IPNs deleted.</b><br />Currently, an IPN appearing the admin section is deleted automatically when deleting it's corresponding order.</li><br /><br class="h6" />
+      <li><b class="ppem380">How can a customer resume their order.</b><br />Currently, if the customer abandons the checkout process at the PayPal site, e.g for some reason they did not actually pay at that time, then they can log into their osCommerce account and click the confirm order button when viewing the details of that particular order in their account_history_info.<br /><br />This feature is only available when <b>synchronizing invoices</b> with PayPal.<br /><br />This means that if you ever reset the osCommerce <code>orders</code> database table then you must also update it's auto-increment value to be greater than the last known <code>order_id</code>.</li><br /><br class="h6" />
+      <li><b class="ppem380">I'm getting errors after installing the contribution.</b><br />First, go through the installation edits and remove any blank spaces at the beginning of the line(s), some text editors will insert hidden characters which is a side effect of copying and pasting from HTML documentation.<br />Make sure that the alterations have been performed as well as running the paypal_ipn.sql script.</li><br /><br class="h6" />
+
+      <li><b class="ppem380">What type of PayPal account do I need.</b><br />You will need either a Premier or Merchant Business Account. <a href="https://www.paypal.com/refer/pal=PS2X9Q773CKG4" target="_blank">Click&nbsp;here&nbsp;to&nbsp;register&nbsp;for&nbsp;an&nbsp;account</a> if you do not already have one.</li><br /><br class="h6" />
+    </ul>
+    </td>
+  </tr>
+  <tr>
+    <tr><td><hr class="solid"></td></tr>
+  </tr>
+  <tr>
+    <td class="buttontd"><form name="contents" action="<?php echo tep_href_link(FILENAME_PAYPAL,'','NONSSL'); ?>"><input type="hidden" name="action" value="help" /><input type="submit" value="Contents" class="ppbuttonsmall" /></form></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/TransactionDetails.lng.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/TransactionDetails.lng.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/TransactionDetails.lng.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: TransactionDetails.lng.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+define('ENTRY_PAYMENT_RECEIVED', 'Payment Received');
+define('ENTRY_REFUND', 'Refund');
+define('ENTRY_REVERSED', 'Reversal');
+
+define('ENTRY_CUSTOMER_NAME', 'Name:');
+define('ENTRY_CUSTOMER_EMAIL', 'Email:');
+define('ENTRY_CUSTOMER_AUCTION_BUYER_ID', 'Auction Buyer ID:');
+
+define('ENTRY_TXN_GROSS_AMOUNT', 'Total Amount:');
+define('ENTRY_TXN_FEE_AMOUNT', 'Fee Amount:');
+define('ENTRY_TXN_NET_AMOUNT', 'Net Amount:');
+
+define('ENTRY_INFO_DATE', 'Date:');
+define('ENTRY_INFO_TIME', 'Time:');
+
+define('ENTRY_TXN_STATUS', 'Status:');
+define('ENTRY_TXN_PENDING_REASON', 'Pending Reason:');
+define('ENTRY_TXN_REASON', 'Reason:');
+
+define('ENTRY_CUSTOMER_SHIPPING_ADDRESS', 'Shipping Address:');
+
+define('ENTRY_TXN_PAYMENT_TYPE', 'Payment Type:');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/paypal.lng.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/paypal.lng.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/languages/english/paypal.lng.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: paypal.lng.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  //begin ADMIN text
+  define('HEADING_ADMIN_TITLE', 'PayPal Instant Payment Notifications');
+  define('HEADING_PAYMENT_STATUS', 'Status');
+  define('TEXT_ALL_IPNS', 'All');
+  define('TEXT_INFO_PAYPAL_IPN_HEADING', 'PayPal IPN');
+  define('TABLE_HEADING_ACTION', 'Action');
+  define('TEXT_DISPLAY_NUMBER_OF_TRANSACTIONS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> IPN\'s)');
+
+  //shared with TransactionSummaryLogs
+  define('TABLE_HEADING_DATE', 'Date');
+  define('TABLE_HEADING_DETAILS', 'Details');
+  define('TABLE_HEADING_PAYMENT_STATUS', 'Status');
+  define('TABLE_HEADING_PAYMENT_GROSS', 'Gross');
+  define('TABLE_HEADING_PAYMENT_FEE', 'Fee');
+  define('TABLE_HEADING_PAYMENT_NET_AMOUNT', 'Net Amount');
+
+  //TransactionSummaryLogs
+  define('TABLE_HEADING_TXN_ACTIVITY', 'Transaction Activity');
+  define('IMAGE_BUTTON_TXN_ACCEPT', 'Accept');
+
+  //AcceptOrder
+  define('SUCCESS_ORDER_ACCEPTED', 'Order Accepted!');
+  define('ERROR_UNAUTHORIZED_REQUEST', 'Unauthorized Request!');
+  define('ERROR_ORDER_UNPAID', 'Payment has not been Completed!');
+
+  //Template Page Titles
+  define('TEXT_NO_IPN_HISTORY', 'No PayPal Transaction Information Available (%s)');
+  define('HEADING_DETAILS_TITLE', 'Transaction Details');
+  define('HEADING_ITP_TITLE', 'IPN Test Panel');
+  define('HEADING_ITP_HELP_TITLE', 'IPN Test Panel - Guide');
+  define('HEADING_HELP_CONTENTS_TITLE', 'Help Contents');
+  define('HEADING_HELP_CONFIG_TITLE', 'Configuration Guide');
+  define('HEADING_HELP_FAQS_TITLE', 'Frequently Asked Questions');
+  define('HEADING_ITP_RESULTS_TITLE', 'IPN Test Panel - Results');
+  //IPN Test Panel
+  define('IMAGE_ERROR', 'Error icon');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/orders.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/orders.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/orders.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,169 @@
+<?php
+/*
+  $Id: orders.inc.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal.php');
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/functions/paypal.fnc.php');
+  paypal_include_lng(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/languages/', $language, 'paypal.lng.php');
+  require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.inc.php');
+  $paypal = new paypal($order->info['paypal_ipn_id']);
+?>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td colspan="2" style="padding-bottom:0px;"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . '../modules/payment/paypal/images/paypal_logo.gif','PayPal'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2" style="padding-top:0px;"><?php echo tep_draw_separator(); ?></td>
+          </tr>
+          <tr>
+            <td class="main" colspan="2">
+              <table border="0" width="510" cellspacing="0" cellpadding="2">
+              <tr valign="top">
+                <td>
+                      <table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_CUSTOMER; ?></b></td><td class="main" nowrap>&nbsp;<?php echo $paypal->customer['first_name'] . ' ' . $paypal->customer['last_name'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_BUSINESS_NAME; ?></b></td><td class="main" nowrap>&nbsp;<?php echo $paypal->customer['payer_business_name'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td><td class="main" nowrap>&nbsp;<?php echo $paypal->customer['payer_email'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYER_ID; ?></b></td><td class="main" nowrap>&nbsp;<?php echo $paypal->customer['payer_id'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYER_STATUS; ?></b></td><td class="main" nowrap>&nbsp;<?php echo $paypal->customer['payer_status'];?></td>
+                      </tr>
+                      </table>
+                </td>
+                <td style="padding-left:50px;">
+                      <table border="0" cellspacing="0" cellpadding="2">
+                      <tr valign="top">
+                        <td class="main" style="padding-right: 10px;" nowrap><?php echo '<b>' . ENTRY_ADDRESS . '</b><br>' . $paypal->customer['address_status']; ?></td>
+                        <td class="main" nowrap><?php echo $paypal->customer['address_name'] . '<br>' . $paypal->customer['address_street'] . '<br>' . $paypal->customer['address_city'] . '<br>' . $paypal->customer['address_state'] . '<br>' . $paypal->customer['address_zip'] . '<br>' . $paypal->customer['address_country']; ?></td>
+                      </tr>
+                      </table>
+                </td>
+                <td style="padding-left:50px;">
+                      <table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYMENT_TYPE; ?></b>&nbsp;</td><td class="main" nowrap><?php echo $paypal->info['payment_type'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_CART_ITEMS; ?></b>&nbsp;</td><td class="main"><?php echo $paypal->txn['num_cart_items'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_PAYPAL_IPN_TXN; ?></b>&nbsp;</td><td class="main" nowrap><?php echo $paypal->info['txn_id'];?></td>
+                      </tr>
+<?php
+    $txn_signature_query = tep_db_query("select txn_signature from " . TABLE_ORDERS_SESSION_INFO . " where orders_id = '" . (int)$oID . "' limit 1");
+    if (tep_db_num_rows($txn_signature_query)) {
+      $txn_signature = tep_db_fetch_array($txn_signature_query);
+      echo            '<tr>' .
+                      '  <td class="main" nowrap><b>' . TEXT_TXN_SIGNATURE . '</b>&nbsp;</td><td class="main" nowrap>' . $txn_signature['txn_signature'] . '</td>' .
+                      '</tr>';
+
+    }
+?>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_INVOICE; ?></b>&nbsp;</td><td class="main" nowrap><?php echo $paypal->info['invoice'];?></td>
+                      </tr>
+                      </table>
+                </td>
+              </tr>
+              </table>
+           </td>
+          </tr>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+          <tr valign="top">
+            <td class="main">
+              <table border="0" cellspacing="0" cellpadding="2">
+              <tr valign="top">
+                <td>
+                      <table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_MC_CURRENCY; ?></b></td><td class="main">&nbsp;<?php echo $paypal->info['mc_currency'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_MC_GROSS; ?></b></td><td class="main">&nbsp;<?php echo $paypal->txn['mc_gross'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_MC_FEE; ?></b></td><td class="main">&nbsp;<?php echo $paypal->txn['mc_fee'];?></td>
+                      </tr>
+                      </table>
+             </td>
+             <td class="main" style="padding-left:50px;">
+                      <table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_SETTLE_AMOUNT; ?></b></td><td class="main">&nbsp;<?php echo $paypal->txn['settle_amount'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_SETTLE_CURRENCY; ?></b></td><td class="main">&nbsp;<?php echo $paypal->txn['settle_currency'];?></td>
+                      </tr>
+                      <tr>
+                        <td class="main" nowrap><b><?php echo ENTRY_EXCHANGE_RATE; ?></b></td><td class="main">&nbsp;<?php echo $paypal->txn['exchange_rate'];?></td>
+                      </tr>
+                      </table>
+             </td>
+              </tr>
+              </table>
+           </td>
+           <td class="main" width="100%" height="100%" rowspan="2" style="padding-left:50px;">
+                      <table border="0" width="100%" height="100%" cellspacing="2" cellpadding="0">
+                      <tr valign="top">
+                        <td class="main" nowrap><?php echo '<b>' . ENTRY_CUSTOMER_COMMENTS . '</b>'; if (tep_not_null($paypal->customer['memo'])) echo ' (' . tep_datetime_short($paypal->info['payment_date']) . ') '; ?></td>
+                      </tr>
+<?php if (tep_not_null($paypal->customer['memo'])) { ?>
+                      <tr valign="top">
+                        <td class="main" height="100%">
+                          <?php echo '<div style="border:0px solid gray; padding: 5px auto; width:100%;">' . nl2br(tep_db_output($paypal->customer['memo'])) . '</div>' ;?>
+                        </td>
+                      </tr>
+<?php } ?>
+                      </table>
+           </td>
+          </tr>
+          <tr valign="top">
+            <td class="main">
+                  <table border="1" cellspacing="0" cellpadding="5">
+                  <tr>
+                    <td class="smallText" align="center" nowrap><b><?php echo TABLE_HEADING_IPN_DATE; ?></b></td>
+                    <td class="smallText" align="center" nowrap><b><?php echo TABLE_HEADING_PAYMENT_STATUS; ?></b></td>
+                    <td class="smallText" align="center" nowrap><b><?php echo TABLE_HEADING_PENDING_REASON; ?></b></td>
+                  </tr>
+<?php
+    $paypal_history_query = tep_db_query("select payment_status, pending_reason, date_added from " . TABLE_PAYPAL_PAYMENT_STATUS_HISTORY . " where paypal_ipn_id = '" . (int)$order->info['paypal_ipn_id'] . "' order by date_added");
+    if (tep_db_num_rows($paypal_history_query)) {
+      while ($paypal_history = tep_db_fetch_array($paypal_history_query)) {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" align="center" nowrap>' . tep_datetime_short($paypal_history['date_added']) . '</td>' . "\n".
+             '            <td class="smallText" nowrap>' . $paypal_history['payment_status'] . '</td>' . "\n" .
+             '            <td class="smallText" align="center" nowrap>'. (tep_not_null($paypal_history['pending_reason']) ? $paypal_history['pending_reason'] : '&nbsp;') . '</td>' . "\n" .
+             '          </tr>' . "\n";
+      }
+    } else {
+        echo '          <tr>' . "\n" .
+             '            <td class="smallText" colspan="3" nowrap>' . TEXT_NO_IPN_HISTORY . '</td>' . "\n" .
+             '          </tr>' . "\n";
+    }
+?>
+                  </table>
+           </td>
+           <td></td>
+          </tr>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/results.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/results.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/admin/results.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,128 @@
+<?php
+/*
+  $Id: results.inc.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<meta name="copyright" content="2004">
+<meta name="author" content="developer&#064;devosc.com">
+<style type='text/css'>
+body {background-color: #FFFFFF;}
+body, td, th {font-family: sans-serif; font-size: 10px;}
+.p {margin-top:0px;padding-top:0px;}
+.box, .boxEmail {border:1px solid black; width:100%;}
+table.box td {color: #003366; }
+input { border:1px solid #003366;}
+</style>
+</head>
+<body>
+<form name="ipn" method="GET" action="<?php echo  $_SERVER['HTTP_REFERER']?>">
+<input type="hidden" name="action" value="test"/>
+<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2">
+      <tr valign="middle">
+        <td align="center">
+<table border="0" width="780" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="0" class="box">
+          <tr>
+            <td align="center"><a href="http://www.oscommerce.com"><img border="0" src="<?php echo DIR_WS_MODULES . 'payment/paypal/images/oscommerce.gif'; ?>" alt=" osCommerce " title=" osCommerce " /></a><h1 class="p"> <?php echo PROJECT_VERSION; ?></h1></td>
+          </tr>
+          <tr>
+            <td class="pageHeading" style="color:green" align="center">PayPal_Shopping_Cart_IPN</td>
+          </tr>
+          <tr>
+            <td class="pageHeading" style="color:blue; text-align:center; padding-top:5px;">IPN Test Results</td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '25'); ?></td>
+          </tr>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="0" class="box">
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
+          </tr>
+<?php if(!$debug->error) { ?>
+          <tr>
+            <td class="pageHeading" style="color:red" align="center">Test Complete!</td>
+          </tr>
+<?php } else { ?>
+          <tr>
+            <td class="pageHeading" style="color:red" align="center">Test Not Valid!</td>
+          </tr>
+<?php } ?>
+<?php if($debug->enabled) { ?>
+          <tr>
+            <td style="padding:5px;" align="left"><?php echo $debug->info(true); ?></td>
+          </tr>
+<?php } ?>
+          <tr>
+            <td style="color:blue; text-align:center; padding-top:5px;"><input type="submit" value="Continue"></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td align="center" class="smallText">
+<?php
+/*
+  The following copyright announcement is in compliance
+  to section 2c of the GNU General Public License, and
+  thus can not be removed, or can only be modified
+  appropriately.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+?>
+E-Commerce Engine Copyright &copy; 2003 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a><br>
+osCommerce provides no warranty and is redistributable under the <a href="http://www.fsf.org/licenses/gpl.txt" target="_blank">GNU General Public License</a>
+    </td>
+  </tr>
+  <tr>
+    <td><?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5'); ?></td>
+  </tr>
+  <tr>
+    <td align="center" class="smallText">Powered by <a href="http://www.oscommerce.com" target="_blank">osCommerce</a></td>
+  </tr>
+</table>
+</td>
+      </tr>
+    </table>
+</td>
+</tr>
+</table>
+</form>
+</body>
+</html>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/application_bottom.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/application_bottom.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/application_bottom.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: application_bottom.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+// close session (store variables)
+  tep_session_close();
+
+  if (STORE_PAGE_PARSE_TIME == 'true') {
+    $time_start = explode(' ', PAGE_PARSE_START_TIME);
+    $time_end = explode(' ', microtime());
+    $parse_time = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
+    error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' - ' . getenv('REQUEST_URI') . ' (' . $parse_time . 's)' . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/application_top.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/application_top.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/application_top.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,97 @@
+<?php
+/*
+  $Id: application_top.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+  if ( strcmp(phpversion(),'4.0.6') <= 0 ) {
+    $_GET = $HTTP_GET_VARS;
+    $_POST = $HTTP_POST_VARS;
+    $_SERVER = $HTTP_SERVER_VARS;
+  }
+  unset($_GET,$HTTP_GET_VARS,$HTTP_POST_VARS);
+
+
+// set the level of error reporting
+    //error_reporting(E_ALL & ~E_NOTICE);
+    //error_reporting(0);
+
+// check if register_globals is enabled.
+// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
+  if (function_exists('ini_get')) {
+    ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');
+  }
+
+
+// Set the local configuration parameters - mainly for developers
+  if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');
+
+// include server parameters
+  require('includes/configure.php');
+
+// define the project version
+  define('PROJECT_VERSION', 'osCommerce 2.2-MS2');
+  define('IPN_PAYMENT_MODULE_NAME', 'PayPal_Shopping_Cart_IPN');
+
+// set php_self in the local scope
+  if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];
+
+// include the list of project filenames
+  require(DIR_WS_INCLUDES . 'filenames.php');
+
+// include the list of project database tables
+  require(DIR_WS_INCLUDES . 'database_tables.php');
+  require(DIR_WS_INCLUDES . 'modules/payment/paypal/database_tables.inc.php');
+
+// include the database functions
+  require(DIR_WS_FUNCTIONS . 'database.php');
+
+// make a connection to the database... now
+  tep_db_connect() or die('Unable to connect to database server!');
+
+// set the application parameters
+  $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
+  while ($configuration = tep_db_fetch_array($configuration_query)) {
+    define($configuration['cfgKey'], $configuration['cfgValue']);
+  }
+
+// define general functions used application-wide
+  require(DIR_WS_FUNCTIONS . 'general.php');
+  require(DIR_WS_FUNCTIONS . 'html_output.php');
+
+// some code to solve compatibility issues
+  require(DIR_WS_FUNCTIONS . 'compatibility.php');
+
+// define how the session functions will be used
+  require(DIR_WS_FUNCTIONS . 'sessions.php');
+
+// include currencies class and create an instance
+  require(DIR_WS_CLASSES . 'currencies.php');
+  $currencies = new currencies();
+
+// include the mail classes
+  require(DIR_WS_CLASSES . 'mime.php');
+  require(DIR_WS_CLASSES . 'email.php');
+
+  include(DIR_WS_MODULES . 'payment/paypal/classes/osC/Order.class.php');
+  $PayPal_osC_Order = new PayPal_osC_Order();
+  $PayPal_osC_Order->loadTransactionSessionInfo($_POST['custom']);
+
+  if(isset($PayPal_osC_Order->language)) {
+    // include the language translations
+    $language = $PayPal_osC_Order->language;
+    include(DIR_WS_LANGUAGES . $PayPal_osC_Order->language . '.php');
+  } else {
+    //later on change to Store Default
+    include(DIR_WS_INCLUDES . 'modules/payment/paypal/languages/english.php');
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_process.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_process.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_process.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,259 @@
+<?php
+/*
+  $Id: checkout_process.inc.php,v 1.2 2005/03/13 22:00:34 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  global $payment_modules, $shipping_modules, $order, $currencies, $cart, $PayPal_osC, $customer_id, $ip, $isp,
+         $sendto, $billto, $shipping, $payment, $language, $currency, $languages_id, $order_total_modules, $order_totals;
+
+  require_once(DIR_WS_INCLUDES . 'modules/payment/paypal/database_tables.inc.php');
+
+
+
+  if(!class_exists('order_total')) {
+    include_once(DIR_WS_CLASSES . 'order_total.php');
+  }
+
+  if ( !is_object($order_total_modules) )
+    $order_total_modules = new order_total;
+
+  if ( !is_array($order_totals) )
+    $order_totals = $order_total_modules->process();
+
+  $sql_data_array = array('customers_id' => $customer_id,
+                          'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
+                          'customers_company' => $order->customer['company'],
+                          'customers_street_address' => $order->customer['street_address'],
+                          'customers_suburb' => $order->customer['suburb'],
+                          'customers_city' => $order->customer['city'],
+                          'customers_postcode' => $order->customer['postcode'],
+                          'customers_state' => $order->customer['state'],
+                          'customers_country' => $order->customer['country']['title'],
+                          'customers_telephone' => $order->customer['telephone'],
+                          'customers_email_address' => $order->customer['email_address'],
+                          'customers_address_format_id' => $order->customer['format_id'],
+                          'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
+                          'delivery_company' => $order->delivery['company'],
+                          'delivery_street_address' => $order->delivery['street_address'],
+                          'delivery_suburb' => $order->delivery['suburb'],
+                          'delivery_city' => $order->delivery['city'],
+                          'delivery_postcode' => $order->delivery['postcode'],
+                          'delivery_state' => $order->delivery['state'],
+                          'delivery_country' => $order->delivery['country']['title'],
+                          'delivery_address_format_id' => $order->delivery['format_id'],
+                          'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
+                          'billing_company' => $order->billing['company'],
+                          'billing_street_address' => $order->billing['street_address'],
+                          'billing_suburb' => $order->billing['suburb'],
+                          'billing_city' => $order->billing['city'],
+                          'billing_postcode' => $order->billing['postcode'],
+                          'billing_state' => $order->billing['state'],
+                          'billing_country' => $order->billing['country']['title'],
+                          'billing_address_format_id' => $order->billing['format_id'],
+                          'payment_method' => $this->codeTitle,
+                          'cc_type' => $order->info['cc_type'],
+                          'cc_owner' => $order->info['cc_owner'],
+                          'cc_number' => $order->info['cc_number'],
+                          'cc_expires' => $order->info['cc_expires'],
+                          'orders_status' => MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID,
+                          'last_modified' => 'now()',
+                          'currency' => $order->info['currency'],
+                          'currency_value' => $order->info['currency_value'],
+                          'ipaddy' => $ip,
+                          'ipisp' => $isp);
+   $session_exists = false;
+   if(tep_session_is_registered('PayPal_osC')) {
+     $orders_session_query = tep_db_query("select osi.orders_id, o.payment_id from " . TABLE_ORDERS_SESSION_INFO . " osi left join " . TABLE_ORDERS . " o on osi.orders_id = o.orders_id where osi.txn_signature ='" . tep_db_input($PayPal_osC->txn_signature) . "'");
+     $orders_check = tep_db_fetch_array($orders_session_query);
+     //Now check to see whether order session info exists AND that this order
+     //does not currently have an IPN.
+     if ($orders_check['orders_id'] > 0 &&  $orders_check['payment_id'] == '0' ) {
+       $session_exists = true;
+       $this->orders_id = $orders_check['orders_id'];
+     }
+   }
+
+   if($session_exists) {
+    tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'");
+   } else {
+    $sql_data_array['date_purchased'] = 'now()';
+    tep_db_perform(TABLE_ORDERS, $sql_data_array);
+    $this->orders_id = tep_db_insert_id();
+   }
+
+ if($session_exists) {
+    tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$this->orders_id . "'");
+  }
+  for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
+    $sql_data_array = array('orders_id' => (int)$this->orders_id,
+                            'title' => $order_totals[$i]['title'],
+                            'text' => $order_totals[$i]['text'],
+                            'value' => $order_totals[$i]['value'],
+                            'class' => $order_totals[$i]['code'],
+                            'sort_order' => $order_totals[$i]['sort_order']);
+    tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
+  }
+
+  $sql_data_array = array('orders_status_id' => MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID,
+                          'date_added' => 'now()',
+                          'customer_notified' => 0,
+                          'comments' => $order->info['comments']);
+
+  if($session_exists) {
+    tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'");
+
+    tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$this->orders_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$this->orders_id . "'");
+  } else {
+    $sql_data_array['orders_id'] = $this->orders_id;
+    tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
+  }
+
+  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+
+// Eversun mod for stock does not decrement when using paypal
+    if (STOCK_LIMITED == 'true') {
+      $downloadable_product = false;
+      if (DOWNLOAD_ENABLED == 'true') {
+        // see if this product actually has a downloadable file in the attributes
+        $download_check_query_raw = "SELECT products_quantity, pad.products_attributes_filename
+                            FROM " . TABLE_PRODUCTS . " p, 
+                            " . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+                            " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                             WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'
+                             and p.products_id=pa.products_id
+                             and pad.products_attributes_id=pa.products_attributes_id ";                             
+        $download_check_query = tep_db_query($download_check_query_raw);
+        if (tep_db_num_rows($download_check_query) > 0) {
+          $downloadable_product = true;
+        }
+      }  // end of downloadable product check
+      if ( !$downloadable_product ) {
+        $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        $stock_values = tep_db_fetch_array($stock_query);
+        $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
+        tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        }
+      }
+    }
+// Eversun mod end for stock does not decrement when using paypal
+
+    $sql_data_array = array('orders_id' => (int)$this->orders_id,
+                            'products_id' => tep_get_prid($order->products[$i]['id']),
+                            'products_model' => $order->products[$i]['model'],
+                            'products_name' => $order->products[$i]['name'],
+                            'products_price' => $order->products[$i]['price'],
+                            'final_price' => $order->products[$i]['final_price'],
+                            'products_tax' => $order->products[$i]['tax'],
+                            'products_quantity' => $order->products[$i]['qty']);
+
+    tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
+
+    $order_products_id = tep_db_insert_id();
+
+    if(is_callable(array($order_total_modules, 'update_credit_account'))) {
+
+     global $insert_id;
+
+     $insert_id = $this->orders_id;
+
+     $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM
+   }
+
+//------insert customer choosen option to order--------
+    $attributes_exist = '0';
+    if (isset($order->products[$i]['attributes'])) {
+      $attributes_exist = '1';
+      for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+        if (DOWNLOAD_ENABLED == 'true') {
+          $attributes_query = "select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
+                               from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
+                               left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                                on pa.products_attributes_id=pad.products_attributes_id
+                               where pa.products_id = '" . $order->products[$i]['id'] . "'
+                                and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
+                                and pa.options_id = popt.products_options_id
+                                and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
+                                and pa.options_values_id = poval.products_options_values_id
+        and poptt.products_options_text_id = popt.products_options_id
+                                and poptt.language_id = '" . $languages_id . "'
+                                and poval.language_id = '" . $languages_id . "'";
+          $attributes = tep_db_query($attributes_query);
+        } else {
+          $attributes = tep_db_query("select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and poptt.products_options_text_id = popt.products_options_id and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and poptt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
+        }
+        $attributes_values = tep_db_fetch_array($attributes);
+
+        $sql_data_array = array('orders_id' => (int)$this->orders_id,
+                                'orders_products_id' => $order_products_id,
+                                'products_options_id' => $order->products[$i]['attributes'][$j]['option_id'],
+                                'products_options' => $attributes_values['products_options_name'],
+                                'products_options_values_id' => $order->products[$i]['attributes'][$j]['value_id'],
+                                'products_options_values' => $attributes_values['products_options_values_name'],
+                                'options_values_price' => $attributes_values['options_values_price'],
+                                'price_prefix' => $attributes_values['price_prefix']);
+
+        tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
+      }
+    }
+//------insert customer choosen option eof ----
+    $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
+    $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
+    $total_cost += $total_products_price;
+  }
+$order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM
+
+// store the session info for notification update - gsb
+  $sql_data_array = array('sendto' => $sendto,
+                          'billto' => $billto,
+                          'firstname' => $order->billing['firstname'],
+                          'lastname' =>  $order->billing['lastname'],
+                          'payment' => $payment,
+                          'payment_title' => $this->codeTitle,
+                          'payment_amount' => $this->grossPaymentAmount($this->currency()),
+                          'payment_currency' => $this->currency(),
+                          'payment_currency_val' => $currencies->get_value($this->currency()),
+                          'language' => $language,
+                          'language_id' => $languages_id,
+                          'currency' => $currency,
+                          'currency_value' => $currencies->get_value($currency),
+                          'content_type' => $order->content_type,
+                          'txn_signature' => $this->setTransactionID());
+
+  global $affiliate_ref, $affiliate_clickthroughs_id, $affiliate_clientdate, $affiliate_clientbrowser, $affiliate_clientip;
+  if (tep_session_is_registered('affiliate_ref') && tep_not_null($affiliate_ref)) {
+    $sql_data_array['affiliate_id'] = $affiliate_ref;
+    $sql_data_array['affiliate_clickthroughs_id'] = $affiliate_clickthroughs_id;
+    $sql_data_array['affiliate_date'] = $affiliate_clientdate;
+    $sql_data_array['affiliate_browser'] = $affiliate_clientbrowser;
+    $sql_data_array['affiliate_ipaddress'] = $affiliate_clientip;
+  }
+
+  if($session_exists) {
+    tep_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'");
+    $PayPal_osC->txn_signature = $this->digest;
+  } else {
+    $sql_data_array['orders_id'] = (int)$this->orders_id;
+    tep_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array);
+    $PayPal_osC = new PayPal_osC($this->orders_id,$this->digest);
+    tep_session_register('PayPal_osC');
+  }
+
+  if(is_callable(array($order_total_modules, 'apply_credit')))
+    $order_total_modules->apply_credit();
+
+  require(DIR_WS_INCLUDES . 'modules/payment/paypal/catalog/checkout_splash.inc.php');
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_process.inc_modified.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_process.inc_modified.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_process.inc_modified.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,226 @@
+<?php
+/*
+  $Id: checkout_process.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  global $payment_modules, $shipping_modules, $order, $currencies, $cart, $PayPal_osC, $customer_id,
+         $sendto, $billto, $shipping, $payment, $language, $currency, $languages_id, $order_total_modules, $order_totals;
+
+  require_once(DIR_WS_INCLUDES . 'modules/payment/paypal/database_tables.inc.php');
+
+
+
+  if(!class_exists('order_total')) {
+    include_once(DIR_WS_CLASSES . 'order_total.php');
+  }
+
+  if ( !is_object($order_total_modules) )
+    $order_total_modules = new order_total;
+
+  if ( !is_array($order_totals) )
+    $order_totals = $order_total_modules->process();
+
+  $sql_data_array = array('customers_id' => $customer_id,
+                          'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
+                          'customers_company' => $order->customer['company'],
+                          'customers_street_address' => $order->customer['street_address'],
+                          'customers_suburb' => $order->customer['suburb'],
+                          'customers_city' => $order->customer['city'],
+                          'customers_postcode' => $order->customer['postcode'],
+                          'customers_state' => $order->customer['state'],
+                          'customers_country' => $order->customer['country']['title'],
+                          'customers_telephone' => $order->customer['telephone'],
+                          'customers_email_address' => $order->customer['email_address'],
+                          'customers_address_format_id' => $order->customer['format_id'],
+                          'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
+                          'delivery_company' => $order->delivery['company'],
+                          'delivery_street_address' => $order->delivery['street_address'],
+                          'delivery_suburb' => $order->delivery['suburb'],
+                          'delivery_city' => $order->delivery['city'],
+                          'delivery_postcode' => $order->delivery['postcode'],
+                          'delivery_state' => $order->delivery['state'],
+                          'delivery_country' => $order->delivery['country']['title'],
+                          'delivery_address_format_id' => $order->delivery['format_id'],
+                          'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
+                          'billing_company' => $order->billing['company'],
+                          'billing_street_address' => $order->billing['street_address'],
+                          'billing_suburb' => $order->billing['suburb'],
+                          'billing_city' => $order->billing['city'],
+                          'billing_postcode' => $order->billing['postcode'],
+                          'billing_state' => $order->billing['state'],
+                          'billing_country' => $order->billing['country']['title'],
+                          'billing_address_format_id' => $order->billing['format_id'],
+                          'payment_method' => $this->codeTitle,
+                          'cc_type' => $order->info['cc_type'],
+                          'cc_owner' => $order->info['cc_owner'],
+                          'cc_number' => $order->info['cc_number'],
+                          'cc_expires' => $order->info['cc_expires'],
+                          'orders_status' => MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID,
+                          'last_modified' => 'now()',
+                          'currency' => $order->info['currency'],
+                          'currency_value' => $order->info['currency_value']);
+   $session_exists = false;
+   if(tep_session_is_registered('PayPal_osC')) {
+     $orders_session_query = tep_db_query("select osi.orders_id, o.payment_id from " . TABLE_ORDERS_SESSION_INFO . " osi left join " . TABLE_ORDERS . " o on osi.orders_id = o.orders_id where osi.txn_signature ='" . tep_db_input($PayPal_osC->txn_signature) . "'");
+     $orders_check = tep_db_fetch_array($orders_session_query);
+     //Now check to see whether order session info exists AND that this order
+     //does not currently have an IPN.
+     if ($orders_check['orders_id'] > 0 &&  $orders_check['payment_id'] == '0' ) {
+       $session_exists = true;
+       $this->orders_id = $orders_check['orders_id'];
+     }
+   }
+
+   if($session_exists) {
+    tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'");
+   } else {
+    $sql_data_array['date_purchased'] = 'now()';
+    tep_db_perform(TABLE_ORDERS, $sql_data_array);
+    $this->orders_id = tep_db_insert_id();
+   }
+
+ if($session_exists) {
+    tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$this->orders_id . "'");
+  }
+  for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
+    $sql_data_array = array('orders_id' => (int)$this->orders_id,
+                            'title' => $order_totals[$i]['title'],
+                            'text' => $order_totals[$i]['text'],
+                            'value' => $order_totals[$i]['value'],
+                            'class' => $order_totals[$i]['code'],
+                            'sort_order' => $order_totals[$i]['sort_order']);
+    tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
+  }
+
+  $sql_data_array = array('orders_status_id' => MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID,
+                          'date_added' => 'now()',
+                          'customer_notified' => 0,
+                          'comments' => $order->info['comments']);
+
+  if($session_exists) {
+    tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'");
+
+    tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$this->orders_id . "'");
+    tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$this->orders_id . "'");
+  } else {
+    $sql_data_array['orders_id'] = $this->orders_id;
+    tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
+  }
+
+  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+    $sql_data_array = array('orders_id' => (int)$this->orders_id,
+                            'products_id' => tep_get_prid($order->products[$i]['id']),
+                            'products_model' => $order->products[$i]['model'],
+                            'products_name' => $order->products[$i]['name'],
+                            'products_price' => $order->products[$i]['price'],
+                            'final_price' => $order->products[$i]['final_price'],
+                            'products_tax' => $order->products[$i]['tax'],
+                            'products_quantity' => $order->products[$i]['qty']);
+
+    tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
+
+    $order_products_id = tep_db_insert_id();
+
+    if(is_callable(array($order_total_modules, 'update_credit_account'))) {
+
+     global $insert_id;
+
+     $insert_id = $this->orders_id;
+
+     $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM
+}
+//------insert customer choosen option to order--------
+    $attributes_exist = '0';
+    if (isset($order->products[$i]['attributes'])) {
+      $attributes_exist = '1';
+      for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+        if (DOWNLOAD_ENABLED == 'true') {
+          $attributes_query = "select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
+                               from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
+                               left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                                on pa.products_attributes_id=pad.products_attributes_id
+                               where pa.products_id = '" . $order->products[$i]['id'] . "'
+                                and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
+                                and pa.options_id = popt.products_options_id
+                                and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
+                                and pa.options_values_id = poval.products_options_values_id
+        and poptt.products_options_text_id = popt.products_options_id
+                                and poptt.language_id = '" . $languages_id . "'
+                                and poval.language_id = '" . $languages_id . "'";
+          $attributes = tep_db_query($attributes_query);
+        } else {
+          $attributes = tep_db_query("select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and poptt.products_options_text_id = popt.products_options_id and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and poptt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
+        }
+        $attributes_values = tep_db_fetch_array($attributes);
+
+        $sql_data_array = array('orders_id' => (int)$this->orders_id,
+                                'orders_products_id' => $order_products_id,
+                                'products_options_id' => $order->products[$i]['attributes'][$j]['option_id'],
+                                'products_options' => $attributes_values['products_options_name'],
+                                'products_options_values_id' => $order->products[$i]['attributes'][$j]['value_id'],
+                                'products_options_values' => $attributes_values['products_options_values_name'],
+                                'options_values_price' => $attributes_values['options_values_price'],
+                                'price_prefix' => $attributes_values['price_prefix']);
+
+        tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
+      }
+    }
+//------insert customer choosen option eof ----
+    $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
+    $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
+    $total_cost += $total_products_price;
+  }
+$order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM
+
+// store the session info for notification update - gsb
+  $sql_data_array = array('sendto' => $sendto,
+                          'billto' => $billto,
+                          'firstname' => $order->billing['firstname'],
+                          'lastname' =>  $order->billing['lastname'],
+                          'payment' => $payment,
+                          'payment_title' => $this->codeTitle,
+                          'payment_amount' => $this->grossPaymentAmount($this->currency()),
+                          'payment_currency' => $this->currency(),
+                          'payment_currency_val' => $currencies->get_value($this->currency()),
+                          'language' => $language,
+                          'language_id' => $languages_id,
+                          'currency' => $currency,
+                          'currency_value' => $currencies->get_value($currency),
+                          'content_type' => $order->content_type,
+                          'txn_signature' => $this->setTransactionID());
+
+  global $affiliate_ref, $affiliate_clickthroughs_id, $affiliate_clientdate, $affiliate_clientbrowser, $affiliate_clientip;
+  if (tep_session_is_registered('affiliate_ref') && tep_not_null($affiliate_ref)) {
+    $sql_data_array['affiliate_id'] = $affiliate_ref;
+    $sql_data_array['affiliate_clickthroughs_id'] = $affiliate_clickthroughs_id;
+    $sql_data_array['affiliate_date'] = $affiliate_clientdate;
+    $sql_data_array['affiliate_browser'] = $affiliate_clientbrowser;
+    $sql_data_array['affiliate_ipaddress'] = $affiliate_clientip;
+  }
+
+  if($session_exists) {
+    tep_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'");
+    $PayPal_osC->txn_signature = $this->digest;
+  } else {
+    $sql_data_array['orders_id'] = (int)$this->orders_id;
+    tep_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array);
+    $PayPal_osC = new PayPal_osC($this->orders_id,$this->digest);
+    tep_session_register('PayPal_osC');
+  }
+
+  if(is_callable(array($order_total_modules, 'apply_credit')))
+    $order_total_modules->apply_credit();
+
+  require(DIR_WS_INCLUDES . 'modules/payment/paypal/catalog/checkout_splash.inc.php');
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_splash.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_splash.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_splash.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: checkout_splash.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<title><?php echo STORE_NAME; ?></title>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<style type="text/css">
+body {background-color:#FFFFFF;}
+body, td, div {font-family: verdana, arial, sans-serif;}
+</style>
+</head>
+<body onload="return document.paypal_payment_info.submit();">
+<?php echo "\n".tep_draw_form('paypal_payment_info', $this->form_paypal_url, 'post'); ?>
+<table cellpadding="0" width="100%" height="100%" cellspacing="0" style="border:1px solid #003366;">
+  <tr><td align="middle" style="height:100%; vertical-align:middle;">
+    <div><?php if (tep_not_null(MODULE_PAYMENT_PAYPAL_PROCESSING_LOGO)) echo tep_image(DIR_WS_IMAGES . MODULE_PAYMENT_PAYPAL_PROCESSING_LOGO); ?></div>
+    <div style="color:#003366"><h1><?php echo MODULE_PAYMENT_PAYPAL_TEXT_TITLE_PROCESSING . tep_image(DIR_WS_MODULES .'payment/paypal/images/period_ani.gif'); ?></h1></div>
+    <div style="margin:10px;padding:10px;"><?php echo MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION_PROCESSING?></div>
+    <div style="margin:10px;padding:10px;"><?php echo tep_image_submit('button_ppcheckout.gif', MODULE_PAYMENT_PAYPAL_IMAGE_BUTTON_CHECKOUT); ?></div>
+  </td></tr>
+</table>
+<?php echo $this->formFields()."\n"; ?>
+</body></html>
+<?php require(DIR_WS_MODULES . 'payment/paypal/application_bottom.inc.php'); ?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_update.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_update.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/checkout_update.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/*
+  $Id: checkout_update.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  $PayPal_osC_Order->setAccountHistoryInfoURL(tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $PayPal_osC_Order->orderID, 'SSL', false));
+  $PayPal_osC_Order->setCheckoutProcessLanguageFile(DIR_WS_LANGUAGES . $PayPal_osC_Order->language . '/' . FILENAME_CHECKOUT_PROCESS);
+  $PayPal_osC_Order->updateProducts($order);
+  $PayPal_osC_Order->notifyCustomer($order);
+  $affiliate_ref = $PayPal_osC_Order->affiliate_id;
+  $affiliate_clickthroughs_id = $PayPal_osC_Order->affiliate_clickthroughs_id;
+  $affiliate_clientdate = $PayPal_osC_Order->affiliate_date;
+  $affiliate_clientbrowser = $PayPal_osC_Order->affiliate_browser;
+  $affiliate_clientip = $PayPal_osC_Order->affiliate_ipaddress;
+  if (tep_not_null($affiliate_ref) && $affiliate_ref != '0') {
+    define('MODULE_PAYMENT_PAYPAL_SHOPPING_IPN_AFFILIATE','True');
+    $insert_id = $PayPal_osC_Order->orderID;
+    include(DIR_WS_INCLUDES . 'affiliate_checkout_process.php');
+  }
+  $PayPal_osC_Order->updateOrderStatus(MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID);
+  $PayPal_osC_Order->removeOrdersSession();
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/languages/english/info_cc.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/languages/english/info_cc.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/languages/english/info_cc.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: info_cc.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<table border="0" cellpadding="0" cellspacing="0" class="popupmain">
+  <tr><td class="ppheading" style="height: 50px;">Make Shopping Easier for Customers with Website Payments</TD></tr>
+  <tr><td><hr class="solid"></td></tr>
+  <tr>
+      <td class="pptext"><?php echo tep_image(DIR_WS_MODULES . 'payment/paypal/images/hdr_ppGlobev4_160x76.gif',' PayPal ','','','align=right valign="top" style="margin: 10px;"'); ?>
+PayPal has optimized their checkout experience by launching an exciting new improvement to their payment flow.
+<br/><br/>For new buyers, signing up for a PayPal account is now optional. This means you can complete your payment first, and then decide whether to save your information for future purchases.
+<p>To pay by credit card, look for this button:<br/>
+<p align="center"><?php echo tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-ContinueCheckout.gif','','',''); ?></p>
+<br/>
+Or you may see this:<br/>
+<p align="center"><?php echo tep_image(DIR_WS_MODULES . 'payment/paypal/images/PayPal-no-account-Click-Here.gif','','',''); ?></p>
+<br/>
+One of these options should appear on the first PayPal screen.<br/>
+<p>Note: if you are a PayPal member, you can either use your account,
+or use a credit card that is not associated with a PayPal account.
+In that case you'd also need to use an email address that's not associated with a PayPal account.</p>
+    </td>
+  </tr>
+  <tr><td><br class="h10"></td></tr>
+</table>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/order_send_money.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/order_send_money.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/catalog/order_send_money.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: order_send_money.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  if(strtolower($order->info['payment_method']) == 'paypal' && $order->info['orders_status_id'] == MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID && MODULE_PAYMENT_PAYPAL_INVOICE_REQUIRED == 'True' ) {
+    include_once(DIR_WS_MODULES . 'payment/paypal.php');
+    $paypal = new PayPal();
+    echo '<div style="float:right">' . "\n";
+    echo tep_draw_form('paypal', $paypal->form_paypal_url, 'post');
+    echo $paypal->sendMoneyFields($order,$HTTP_GET_VARS['order_id'])."\n";
+    echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n";
+    echo '</div>' . "\n";
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Client/Connector.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Client/Connector.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Client/Connector.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,171 @@
+<?php
+/*
+  $Id: Connector.class.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+
+*/
+
+class PayPal_Client_Connector {
+
+  function PayPal_Client_Connector() {
+  }
+
+  function getResponse($domain) {
+    global $debug;
+    $response = '';
+    $curl_flag = function_exists('curl_exec');
+    if($curl_flag) {
+      $ch = @curl_init();
+      @curl_setopt($ch,CURLOPT_URL, "https://$domain/cgi-bin/webscr");
+      @curl_setopt($ch,CURLOPT_POST, 1);
+      @curl_setopt($ch,CURLOPT_POSTFIELDS, $this->response_string);
+      @curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
+      @curl_setopt($ch,CURLOPT_HEADER, 0);
+      @curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, 0);
+      @curl_setopt($ch,CURLOPT_TIMEOUT, 60);
+      $response = @curl_exec($ch);
+      @curl_close($ch);
+      if($response == '') $curl_flag = false;
+    }
+    if(!$curl_flag) {
+      $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
+      $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
+      $header .= "Content-Length: ".strlen($this->response_string)."\r\n\r\n";
+      $transport  = 'ssl://'; $port = '443';
+      $fp = @fsockopen($transport.$domain,$port, $errno, $errstr, 30);
+      if(!$fp) {
+        $transport = 'tcp://'; $port = '80';
+        $fp = @fsockopen($transport.$domain,$port, $errno, $errstr, 30);
+      }
+      if(!$fp) {
+          $fp = @fopen('https://'.$domain.'/cgi-bin/webscr?'.$this->response_string,'rb');
+          $response = $this->getRequestBodyContents($fp); @fclose($fp);
+          if (!$response) {
+            $response = @file('http://'.$domain.'/cgi-bin/webscr?'.$this->response_string);
+            if (!$response && ($debug->enabled)) $debug->add(HTTP_ERROR,sprintf(HTTP_ERROR_MSG,$curl_flag,$transport,$domain,$port));
+          }
+      } else {
+        @fputs($fp, $header . $this->response_string);
+        $response = $this->getRequestBodyContents($fp);
+        @fclose($fp);
+      }
+      unset($this->response_string);
+    }
+
+    if($debug->enabled) {
+      $debug->add(PAYPAL_RESPONSE,sprintf(PAYPAL_RESPONSE_MSG,$this->getVerificationResponse($response)));
+      $debug->add(CONNECTION_TYPE,sprintf(CONNECTION_TYPE_MSG,$curl_flag,$transport,$domain,$port));
+    }
+    return $response;
+  }
+
+  function getVerificationResponse($response) {
+    if(is_array($response)) {
+      return @$response[0];
+    } elseif (is_string($response)) {
+      $array = explode("\n",$response);
+      return @$array[0];
+    }
+    return false;
+  }
+
+  function getRequestBodyContents(&$handle) {
+    $headerdone = false;
+    if ($handle) {
+      while (!feof($handle)) {
+        $line = @fgets($handle, 1024);
+        if (!strcmp($line, "\r\n")) {
+          // read the header
+          $headerdone = true;
+        } elseif ($headerdone) {
+          // header has been read. now read the contents
+          $buffer .= $line;
+        } elseif (in_array($line,array('VERIFIED','INVALID'))) {
+          return $line;
+        }
+      }
+      return $buffer;
+    }
+    return false;
+  }
+
+  //Test both receiver email address and business ID
+  //Modified to accept semicolon delimited business ID list.
+  function validateReceiverEmail($receiver_email,$business) {
+      global $debug;
+    if(!strcmp(strtolower($receiver_email),strtolower($this->key['receiver_email'])) && in_array(strtolower($this->key['business']),explode(';',strtolower($business)))) {
+        if($debug->enabled) $debug->add(EMAIL_RECEIVER,sprintf(EMAIL_RECEIVER_MSG,$receiver_email,$business,$this->key['receiver_email'],$this->key['business']));
+        return true;
+      } else {
+        if($debug->enabled) $debug->add(EMAIL_RECEIVER,sprintf(EMAIL_RECEIVER_ERROR_MSG,$receiver_email,$business,$this->key['receiver_email'],$this->key['business'],$this->key['txn_id']));
+        return false;
+      }
+  }
+
+  function validPayment($amount,$currency) {
+    global $debug;
+    $valid_payment = true;
+    //check the payment currency and amount
+    if ( ($this->key['mc_currency'] != $currency) || ($this->key['mc_gross'] != $amount) )
+      $valid_payment = false;
+    if($valid_payment === false && $debug->enabled) $debug->add(CART_TEST,sprintf(CART_TEST_ERR_MSG,$amount,$currency,$this->key['mc_gross'],$this->key['mc_currency']));
+    return $valid_payment;
+  }
+
+  function dienice($status = '200') {
+    switch($status) {
+      case '200';
+        header("HTTP/1.0 200 OK");
+        break;
+      case '500':
+      default:
+        if(isset($this->key['digestKey']) && $this->key['digestKey'] === $this->digestKey()) {
+          header("HTTP/1.0 204 No Content"); exit;
+        } else {
+          header("HTTP/1.0 500 Internal Server Error"); exit;
+        }
+        break;
+    }
+  }
+
+  function digestKey() {
+    return strrev(md5(md5(strrev(md5(MODULE_PAYMENT_PAYPAL_IPN_DIGEST_KEY)))));
+  }
+
+  function validDigest() {
+    return (isset($this->key['digestKey']) && $this->key['digestKey'] === $this->digestKey());
+  }
+
+  function setTestMode($testMode) {
+    switch($testMode) {
+      case 'On':
+        $this->testMode = 'On';
+        break;
+      default:
+        $this->testMode = 'Off';
+      break;
+    }
+  }
+
+  function testMode($testMode='') {
+    if(tep_not_null($testMode)) {
+      return ($this->testMode === $testMode);
+    } elseif (isset($this->testMode)) {
+      return ($this->testMode === 'On');
+    }
+
+    return false;
+  }
+
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Debug/Debug.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Debug/Debug.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Debug/Debug.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: Debug.class.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+
+*/
+
+class PayPal_Debug {
+
+  function PayPal_Debug($email_address, $debug_enabled = 'No') {
+    $this->email_address = $email_address;
+    $this->enabled = ($debug_enabled == 'Yes') ? true : false;
+    $this->error = false;
+    $this->info = array();
+  }
+
+  function init($debug_str) {
+    $debug_string = sprintf(DEBUG_MSG,str_replace('&', "\r\n", $debug_str ));
+    $this->add(DEBUG,$debug_string);
+  }
+
+  function add($subject,$msg) {
+    $this->info[] = array( 'subject' => $subject, 'msg' => $msg);
+  }
+
+  function raiseError($subject, $msg, $clear_stack = false) {
+    if($clear_stack === true) unset($this->info);
+    $this->add($subject,$msg);
+    $this->error = true;
+  }
+
+  function info($html = false) {
+    $debug_string = '';
+    $lf = "\r\n";
+    $debug = $this->info;
+    reset($debug);
+    $nMsgs = count($debug);
+    for ($i=0; $i<$nMsgs; $i++) {
+      $debug_string .= EMAIL_SEPARATOR.$lf.$debug[$i]['subject'].$lf.EMAIL_SEPARATOR.$lf.$debug[$i]['msg'].$lf.$lf;
+    }
+    return ($html === true) ? str_replace("\n", "\n<br />", $debug_string) : $debug_string;
+  }
+
+  function sendEmail() {
+    if(count($this->info) > 0) {
+      $to_name = '';
+      $to_address = $this->email_address;
+      $subject = IPN_PAYMENT_MODULE_NAME;
+      $this->add(IPN_EMAIL,IPN_EMAIL_MSG);
+      $msg = strip_tags(nl2br($this->info()));
+      $from_name = IPN_PAYMENT_MODULE_NAME;
+      $from_address = strtolower(trim($this->email_address));
+      tep_mail($to_name, $to_address, $subject, $msg, $from_name, $from_address);
+    }
+  }
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/IPN/IPN.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/IPN/IPN.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/IPN/IPN.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,299 @@
+<?php
+/*
+  $Id: IPN.class.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+
+*/
+
+//admin workaround!
+$modules_directory = defined('DIR_FS_CATALOG_MODULES') ? DIR_FS_CATALOG_MODULES : DIR_WS_MODULES;
+
+require_once($modules_directory . 'payment/paypal/classes/Client/Connector.class.php');
+
+class PayPal_IPN extends PayPal_Client_Connector {
+
+  function PayPal_IPN($post_vars) {
+    global $debug;
+    if (!in_array($post_vars['payment_type'],array('instant','echeck'))) {
+      if ($debug->enabled) $debug->add(UNKNOWN_TXN_TYPE,sprintf(UNKNOWN_TXN_TYPE_MSG,$post_vars['payment_type']));
+    } else if(strlen($post_vars['txn_id']) == 17) {
+      $this->init($post_vars); //Looks like a PayPal transaction
+    } else {
+      if ($debug->enabled) $debug->add(UNKNOWN_POST,sprintf(UNKNOWN_POST_MSG,$_SERVER['REMOTE_ADDR']));
+    }
+    $this->setTestMode('Off');
+    register_shutdown_function(array($this,'_PayPal_IPN'));
+  }
+
+  function _PayPal_IPN() {
+    global $debug;
+    if ($debug->enabled) $debug->sendEmail();
+  }
+
+  function init($post_vars) {
+    global $debug;
+    $debug_string = '';
+    $this->key = array();
+    $this->response_string = 'cmd=_notify-validate';
+    reset($post_vars);
+    foreach ($post_vars as $var => $val) {
+      $var = urldecode($var); $val = tep_db_prepare_input(urldecode($val));
+      if ($debug->enabled) $debug_string .= $var . '=' . $val .'&';
+      if (!strcasecmp($var,'cmd') || !eregi("^[_0-9a-z-]{1,32}$",$var)) {
+        unset($var); unset($val);
+      } elseif (tep_not_null($var)) {
+        if($var === 'custom') {
+          $this->setTxnSignature($val);
+        } else {
+          $this->key[$var] = $val;
+        }
+        $this->response_string .= '&' . urlencode($var) . '=' . urlencode($val);
+      }
+    }
+    if ($debug->enabled) $debug->init($debug_string);
+    unset($post_vars, $debug_string);
+  }
+
+  function insert($paypal_id = '') {
+    global $debug;
+    $key_vars = array(
+        'txn_type', 'reason_code', 'payment_type',
+        'payment_status', 'pending_reason', 'invoice',
+        'mc_currency', 'first_name', 'last_name',
+        'payer_business_name', 'address_name', 'address_street',
+        'address_city', 'address_state', 'address_zip',
+        'address_country', 'address_status', 'payer_email',
+        'payer_id', 'payer_status', 'business',
+        'receiver_email', 'receiver_id', 'txn_id',
+        'parent_txn_id', 'mc_gross', 'mc_fee',
+        'payment_gross', 'payment_fee', 'settle_amount',
+        'settle_currency', 'exchange_rate', 'for_auction',
+        'auction_buyer_id', 'auction_multi_item',
+        'quantity', 'tax', 'notify_version',
+        'verify_sign', 'memo'
+      );
+
+    $sql_data_array = $this->setSQLDataElements($key_vars);
+    $sql_data_array['num_cart_items'] = $this->txnType('cart') ? $this->key['num_cart_items'] : '1';
+    $sql_data_array['payment_date'] = $this->datetime_to_sql_format($this->key['payment_date']);
+    $sql_data_array['payment_time_zone'] = $this->paymentTimeZone($this->key['payment_date']);
+    $sql_data_array['auction_closing_date'] = $this->datetime_to_sql_format($this->key['auction_closing_date']);
+    $sql_data_array['date_added'] = 'now()';
+    tep_db_perform(TABLE_PAYPAL, $sql_data_array);
+    $this->ipnID = tep_db_insert_id();
+    $this->updatePaymentStatusHistory( !empty($paypal_id) ? $paypal_id : $this->ipnID );
+    if($this->isAuction()) $this->processAuction($this->ipnID);
+    if($debug->enabled) $debug->add(IPN_TXN_INSERT,sprintf(IPN_TXN_INSERT_MSG,$this->ipnID));
+    return $this->ipnID;
+  }
+
+  function updatePaymentStatusHistory($paypal_id) {
+    $sql_data_array  = $this->setSQLDataElements(array('payment_status', 'pending_reason', 'reason'));
+    $sql_data_array['paypal_id'] = $paypal_id;
+    $sql_data_array['date_added'] = 'now()';
+    tep_db_perform(TABLE_PAYPAL_PAYMENT_STATUS_HISTORY, $sql_data_array);
+  }
+
+  function updateStatus($paypal_id) {
+
+    $key_vars = array(
+                        'first_name', 'last_name', 'payer_business_name',
+                        'address_name', 'address_street', 'address_city',
+                        'address_state','address_zip', 'address_country',
+                        'address_status',
+                        'mc_gross', 'mc_currency', 'mc_fee',
+                        'settle_amount', 'settle_currency',
+                        'exchange_rate',
+                        'payment_status'
+                     );
+    $sql_data_array  = $this->setSQLDataElements($key_vars);
+    $sql_data_array['last_modified'] = 'now()';
+    tep_db_perform(TABLE_PAYPAL, $sql_data_array, 'update', "paypal_id = '" . (int)$paypal_id . "'");
+    $this->updatePaymentStatusHistory($paypal_id);
+  }
+
+  function updateOrderStatus($paypal_id,$status) {
+    //Orders
+    $sql_data_array = array(
+                              'orders_status'    => tep_db_input($status),
+                              'last_modified'    => 'now()'
+                            );
+    tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "payment_id = '" . (int)$paypal_id . "'");
+
+    //Orders Status History
+    $sql_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where payment_id = '" . (int)$paypal_id . "'");
+    $sql_result = tep_db_fetch_array($sql_query);
+    $sql_data_array = array(
+                              'orders_id'     => $sql_result['orders_id'],
+                              'orders_status_id' => tep_db_input($status),
+                              'date_added'    => 'now()'
+                            );
+    tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array, 'insert');
+  }
+
+  function queryTxnID($txn_id) {
+    $sql_query = tep_db_query("select paypal_id from " . TABLE_PAYPAL . " where txn_id = '" . tep_db_input($txn_id) . "' limit 0,1");
+    return tep_db_fetch_array($sql_query);
+  }
+
+  function queryPendingStatus($txn_id) {
+    $sql_query = tep_db_query("select paypal_id, payment_status, pending_reason from " . TABLE_PAYPAL . " where txn_id = '" . tep_db_input($txn_id) . "' limit 0,1");
+    return tep_db_fetch_array($sql_query);
+  }
+
+  function authenticate($domain, $success = 'VERIFIED') {
+    $paypal_response = $this->getResponse($domain);
+    $paypal_verification = $this->getVerificationResponse($paypal_response);
+    return strstr($paypal_verification,$success);
+  }
+
+  function uniqueTxnID() {
+    global $debug;
+    if (isset($this->uniqueTxnID)) {
+      return $this->uniqueTxnID;
+    } else {
+      $txn_id_query = tep_db_query("select txn_id from " . TABLE_PAYPAL . " where txn_id = '" . tep_db_input($this->txnID()) . "' limit 0,1");
+      if (!tep_db_num_rows($txn_id_query)) { //txn_id doesn't exist
+        $this->uniqueTxnID = true;
+        return $this->uniqueTxnID;
+      } else {
+        if($debug->enabled) $debug->add(TXN_DUPLICATE,sprintf(TXN_DUPLICATE_MSG,$this->txnID()));
+        $this->uniqueTxnID = false;
+        return $this->uniqueTxnID;
+      }
+    }
+  }
+
+  function validPayment($amount,$currency) {
+    if (MODULE_PAYMENT_PAYPAL_IPN_CART_TEST == 'Off') return true;
+    return parent::validPayment($amount,$currency);
+  }
+
+  //returns TABLE_PAYPAL.paypal_id
+  function ID() {
+    return $this->ipnID;
+  }
+
+  function txnID() {
+    return $this->key['txn_id'];
+  }
+
+  //returns the transaction type (paypal.txn_type)
+  function txnType($txnTypeName = '') {
+    if(!empty($txnTypeName)) {
+      return ($this->key['txn_type'] === $txnTypeName);
+    }
+
+    return $this->key['txn_type'];
+  }
+
+  function paymentStatus($statusName = '') {
+    if(!empty($statusName)) {
+      return ($this->key['payment_status'] == $statusName);
+    }
+
+    return $this->key['payment_status'];
+  }
+
+  function isCartPayment() {
+    return in_array($this->key['txn_type'],array('web_accept','cart'));
+  }
+
+  function isReversal() {
+    return in_array($this->key['payment_status'],array('Refunded','Reversed','Canceled_Reversal'));
+  }
+
+  function reversalType() {
+    return $this->key['payment_status'];
+  }
+
+  function datetime_to_sql_format($paypalDateTime) {
+    $months = array('Jan' => '01', 'Feb' => '02', 'Mar' => '03', 'Apr' => '04', 'May' => '05',  'Jun' => '06',  'Jul' => '07', 'Aug' => '08', 'Sep' => '09', 'Oct' => '10', 'Nov' => '11', 'Dec' => '12');
+    $array = explode(" ",$paypalDateTime);
+    $time = explode(":",$array[0]);
+    $hour = $time[0];$minute = $time[1];$second = $time[2];
+    $month = $months[$array[1]];
+    $day = substr_replace($array[2],'',-1,1);
+    $year = $array[3];
+    return ($year . "-" . $month . "-" . $day . " " . $hour . ":" . $minute . ":" . $second);
+  }
+
+  function paymentTimeZone($paypalDateTime) {
+    $array = explode(" ",$paypalDateTime);
+    return $array[4];
+  }
+
+  function setSQLDataElements($varnames) {
+    $sql_data_array = array();
+    $nVars = count($varnames);
+    for($i=0; $i<$nVars; $i++) {
+      if(isset($this->key[$varnames[$i]]) && !empty($this->key[$varnames[$i]]) && trim($this->key[$varnames[$i]]) != '')
+        $sql_data_array[$varnames[$i]] = $this->key[$varnames[$i]];
+    }
+    return $sql_data_array;
+  }
+
+  function isAuction() {
+    return (isset($this->key['for_auction']) && $this->key['for_auction'] === 'true');
+  }
+
+  function processAuction($paypal_id) {
+    if(defined('TABLE_PAYPAL_AUCTION')) {
+      if($this->isAuction() && strlen($this->key['item_number']) > 0) {
+        $items = explode(',', $this->key['item_number']);
+        foreach($items as $key => $item_id) {
+          // Save the auction IDs for correlation later
+          $txn_check = tep_db_query("select auction_buyer_id from " . TABLE_PAYPAL_AUCTION . " where paypal_id = '" . (int)$paypal_id . "' and item_number = '" . tep_db_input($item_id) . "'");
+          if (!tep_db_num_rows($txn_check)) {
+            $sql_data_array = $this->setSQLDataElements(array('auction_buyer_id','auction_multi_item'));
+            $sql_data_array['paypal_id'] = (int)$paypal_id;
+            $sql_data_array['item_number'] = $item_id;
+            tep_db_perform(TABLE_PAYPAL_AUCTION, $sql_data_array);
+          }
+         }
+       }
+    }
+  }
+
+  function setTxnSignature($txnSignature = '') {
+    if(!isset($this->txnSignature)) $this->txnSignature = $txnSignature;
+  }
+
+  function txnSignature() {
+    return $this->txnSignature;
+  }
+
+  /*
+  //Test that the store owner's 'custom' transaction signature doesn't exist
+  //Really this is only for preventing mistakes via the IPN Test Panel
+  function uniqueTxnSignature() {
+    global $debug;
+
+    if(!$this->isTestMode()) return true;
+
+    if (isset($this->uniqueTxnSignature)) {
+      return $this->uniqueTxnSignature;
+    } else {
+      $txn_sign_query = tep_db_query("select txn_sign from " . TABLE_PAYPAL . " where txn_sign = '" . tep_db_input($this->txnSignature()) . "' limit 0,1");
+      if (!tep_db_num_rows($txn_sign_query)) { //txn_sign doesn't exist
+        $this->uniqueTxnSignature = true;
+        return $this->uniqueTxnSignature;
+      } else {
+        if($debug->enabled) $debug->add(TXN_DUPLICATE_SIGNATURE,sprintf(TXN_DUPLICATE_SIGNATURE_MSG,$this->txnSignature()));
+        $this->uniqueTxnSignature = false;
+        return $this->uniqueTxnSignature;
+      }
+    }
+  }*/
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Page/Page.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Page/Page.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/Page/Page.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+<?php
+/*
+  $Id: Page.class.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+class PayPal_Page {
+
+  var $baseDirectory;
+
+  var $metaTitle = 'osCommerce: PayPal_Shopping_Cart_IPN';
+
+  // class constructor
+  function PayPal_Page() {
+  }
+
+  function template() {
+    return $this->baseDirectory . 'templates/' . $this->templateName . '.tpl.php';
+  }
+
+  function setTemplate($template) {
+    $this->templateName = $template;
+  }
+
+  function setContentFile($contentFile = '') {
+    $this->contentFile = $contentFile;
+  }
+
+  function setContentLangaugeFile($base_dir, $lng_dir, $lng_file) {
+    if(file_exists($base_dir .'/'. $lng_dir . '/' . $lng_file)) {
+      $this->contentFile = $base_dir .'/'. $lng_dir . '/' . $lng_file;
+    } elseif (file_exists($base_dir . '/english/' . $lng_file)) {
+      $this->contentFile =  $base_dir . '/english/' . $lng_file;
+    }
+  }
+
+  function setTitle($title = '') {
+    $this->pageTitle = $title;
+  }
+
+  function setOnLoad($javascript) {
+    $this->onLoad = $javascript;
+  }
+
+  function setMetaTitle($title) {
+    $this->metaTitle = $title;
+  }
+
+  function includeLanguageFile($paypal_dir, $lng_dir, $lng_file) {
+    $base_dir = $this->baseDirectory . $paypal_dir . '/';
+    if(file_exists($base_dir . $lng_dir . '/' . $lng_file)) {
+      include_once($base_dir . $lng_dir . '/' . $lng_file);
+    } elseif (file_exists($base_dir . 'english/' . $lng_file)) {
+      include_once($base_dir . 'english/' . $lng_file);
+    }
+  }
+
+  function setBaseDirectory($dir) {
+    $this->baseDirectory = $dir;
+  }
+
+  function setBaseURL($location) {
+    $this->baseURL = $location;
+  }
+
+  function imagePath($image) {
+    return $this->baseURL. 'images/'.$image;
+  }
+
+  function image($img,$alt='') {
+    return tep_image($this->baseURL.'images/'.$img,$alt);
+  }
+
+  function draw_href_link($ppURLText, $ppURLParams = '', $ppURL = FILENAME_PAYPAL, $js = true) {
+    //$ppURL = tep_href_link(FILENAME_PAYPAL,'action=details&info='.$ppTxnID);
+    $ppURL = tep_href_link($ppURL,$ppURLParams);
+    if ($js === true) {
+      $ppScriptLink = '<script type="text/javascript"><!--
+      document.write("<a style=\"color: #0033cc; text-decoration: none;\" href=\"javascript:openWindow(\''.$ppURL.'\');\" tabindex=\"-1\">'.$ppURLText.'</a>");
+      --></script><noscript><a style="color: #0033cc; text-decoration: none;" href="'.$ppURL.'" target="PayPal">'.$ppURLText.'</a></noscript>';
+    } else {
+      $ppScriptLink = '<a style="color: #0033cc; text-decoration: none;" href="'.$ppURL.'" target="PayPal">'.$ppURLText.'</a>';
+    }
+    return $ppScriptLink;
+  }
+
+  function addJavaScript($filename) {
+    $this->javascript[] = tep_db_input($filename);
+  }
+
+  function importJavaScript() {
+    if(is_array($this->javascript)) {
+      $javascript = '';
+      $javascriptCount = count($this->javascript);
+      for($i=0; $i<$javascriptCount; $i++) {
+        $javascript .= '<script language="javascript" src="' . $this->javascript[$i] . '"></script>'."\n";
+      }
+      return $javascript;
+    }
+  }
+
+  function addCSS($filename) {
+    $this->css[] = tep_db_input($filename);
+  }
+
+  function getCSS($filename) {
+    $css = '';
+    if(function_exists(file_get_contents)) {
+      $css = file_get_contents($this->baseDirectory.'templates/css/'.basename($filename).'.css');
+    } else {
+      $fh = @fopen($this->baseDirectory.'templates/css/'.basename($filename).'.css','rb');
+      if ($fh) {
+        while (!feof($fh))
+          $css .= @fread($fh,1024);
+        @fclose($fh);
+      }
+    }
+    return $css;
+  }
+
+  function importCSS() {
+    $css = "<style type='text/css' media=\"all\">\n";
+    if(is_array($this->css)) {
+      $cssCount = count($this->css);
+      for($i=0; $i<$cssCount; $i++) {
+        $css .= "@import url(" . $this->css[$i] . ");\n";
+      }
+    }
+    return $css."</style>\n";
+  }
+
+
+  function copyright() {
+  return "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
+      <tr><td><br class=\"h10\"/></td></tr>
+      <tr><td align=\"center\" class=\"ppfooter\">E-Commerce Engine Copyright &copy; 2000-2004 <a href=\"http://www.oscommerce.com\" class=\"copyright\" target=\"_blank\">osCommerce</a><br/>osCommerce provides no warranty and is redistributable under the <a href=\"http://www.fsf.org/licenses/gpl.txt\" class=\"copyright\" target=\"_blank\">GNU General Public License</a></td></tr>
+      <tr><td><br class=\"h10\"/></td></tr><tr><td align=\"center\" class=\"ppfooter\"><a href=\"http://www.oscommerce.com\" target=\"_blank\" class=\"poweredByButton\"><span class=\"poweredBy\">Powered By</span><span class=\"osCommerce\">" . PROJECT_VERSION . "</span></a></td></tr><tr><td><br class=\"h10\"/></td></tr></table>";
+  }
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/TransactionDetails/TransactionDetails.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/TransactionDetails/TransactionDetails.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/TransactionDetails/TransactionDetails.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,114 @@
+<?php
+/*
+  $Id: TransactionDetails.class.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+require_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.inc.php');
+
+class PayPal_TransactionDetails {
+  // class constructor
+  function PayPal_TransactionDetails($tablename,$paypal_id = '') {
+    $this->setMySQLPaymentTable($tablename);
+    if (!empty($paypal_id)) {
+      $this->simpleQuery($paypal_id);
+    }
+  }
+
+  function setMySQLPaymentTable($tablename) {
+    $this->paymentTableName = tep_db_prepare_input($tablename);
+  }
+
+  function date($raw_date) {
+    $cal = array('01' => 'Jan', '02' => 'Feb', '03' => 'Mar', '04' => 'Apr', '05' => 'May',  '06' => 'Jun',  '07' => 'Jul', '08' => 'Aug', '09' => 'Sep', '10' => 'Oct', '11' => 'Nov', '12' => 'Dec');
+    list($date, $time) = explode(" ",$raw_date);
+    list($year, $month, $day) = explode("-",$date);
+    return $cal[$month] . '. ' . $day . ', ' . $year;
+  }
+
+  function time($raw_date) {
+    list($date, $time) = explode(" ", $raw_date);
+    return $time;
+  }
+
+  function getSQLDataElements(&$srcArray,$varNames) {
+    $nVars = count($varNames); $array = array();
+    reset($srcArray); for ($i=0; $i<$nVars; $i++) $array[$varNames[$i]] = trim(stripslashes($srcArray[$varNames[$i]]));
+    return $array;
+  }
+
+
+  function simpleQuery($paypal_id) {
+    $info = array('payment_status','txn_id','date_added','payment_date');
+    $txn = array('mc_currency','mc_gross','mc_fee');
+    $ipn_query = tep_db_query("select " . implode(',',array_merge($info,$txn)) . " from " . tep_db_input($this->paymentTableName) . " where paypal_id = '" . (int)$paypal_id . "'");
+    if (tep_db_num_rows($ipn_query)) {
+      $ipn = tep_db_fetch_array($ipn_query);
+      $this->info = $this->getSQLDataElements($ipn,$info);
+      $this->txn = $this->getSQLDataElements($ipn,$txn);
+    }
+  }
+
+  function query($txn_id) {
+    $transaction_id = tep_db_prepare_input($txn_id);
+    $info = array('txn_type','reason_code','payment_type','payment_status','pending_reason','invoice','payment_date','payment_time_zone','business','receiver_email','receiver_id','txn_id','parent_txn_id','notify_version','last_modified','date_added','for_auction','auction_closing_date');
+    $txn = array('num_cart_items','mc_currency','mc_gross','mc_fee','payment_gross','payment_fee','settle_amount','settle_currency','exchange_rate');
+    $customer = array('first_name','last_name','payer_business_name','address_name','address_street','address_city','address_state','address_zip','address_country','address_status','payer_email','payer_id','auction_buyer_id','payer_status','memo');
+    $ipn_query = tep_db_query("select " . implode(',',array_merge($info,$txn,$customer)) . " from " . tep_db_input($this->paymentTableName) . " where txn_id = '" . tep_db_input($transaction_id) . "'");
+    if (tep_db_num_rows($ipn_query)) {
+      $ipn = tep_db_fetch_array($ipn_query);
+      $this->info = $this->getSQLDataElements($ipn,$info);
+      $this->txn = $this->getSQLDataElements($ipn,$txn);
+      $this->customer = $this->getSQLDataElements($ipn,$customer);
+    }
+  }
+
+  function isPending() {
+    return ($this->info['payment_status'] === 'Pending');
+  }
+
+  function isReversal() {
+    //Canceled_Reversal ommitted on purpose!
+    return in_array($this->info['payment_status'],array('Refunded','Reversed'));
+  }
+
+  function format($amount,$currency) {
+    global $currencies;
+    if ($amount < 0) {
+      $tmpAmount = $amount*(-1);
+      $prefix = '-';
+    } else {
+      $tmpAmount = $amount;
+      $prefix = '';
+    }
+    return $prefix.$currencies->format($tmpAmount, false, $currency);
+  }
+
+  function displayPaymentType() {
+    $array = array('instant' => 'Instant', 'echeck' => 'eCheck');
+    return $array[$this->info['payment_type']];
+  }
+
+  function transactionSignature($order_id) {
+    $txn_signature_query = tep_db_query("select txn_signature from " . TABLE_ORDERS_SESSION_INFO . " where orders_id = '" . (int)$order_id . "' limit 1");
+    if (tep_db_num_rows($txn_signature_query)) {
+      $txn_signature = tep_db_fetch_array($txn_signature_query);
+      return $txn_signature['txn_signature'];
+    }
+  }
+
+  function digest() {
+    return strrev(md5(md5(strrev(md5(MODULE_PAYMENT_PAYPAL_IPN_DIGEST_KEY)))));
+  }
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/debug.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/debug.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/debug.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: debug.class.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+
+*/
+
+class debug {
+
+  function debug($email_address, $debug_enabled = 'No') {
+    $this->email_address = $email_address;
+    $this->enabled = ($debug_enabled == 'Yes') ? true : false;
+    $this->error = false;
+    $this->info = array();
+  }
+
+  function init($debug_str, $response_str) {
+    $debug_string = sprintf(DEBUG_MSG,str_replace('&', "\r\n", $debug_str ),str_replace('&', "\r\n", $response_str ));
+    $this->add(DEBUG,$debug_string);
+  }
+
+  function add($subject,$msg) {
+    $this->info[] = array( 'subject' => $subject, 'msg' => $msg);
+  }
+
+  function raise_error($subject, $msg, $clear_stack = false) {
+    if($clear_stack === true) unset($this->info);
+    $this->add($subject,$msg);
+    $this->error = true;
+  }
+
+  function info($html = false) {
+    $debug_string = '';
+    $seperator = "\r\n".EMAIL_SEPARATOR."\r\n";
+    $debug = $this->info;
+    reset($debug);
+    $debug_msg_total = count($debug);
+    for ($i=0; $i<$debug_msg_total; $i++) {
+      $debug_string .= $seperator.$debug[$i]['subject'].$seperator.$debug[$i]['msg']."\r\n";
+    }
+    if($html === true) $debug_string = str_replace("\n", "\n<br />", $debug_string);
+    return $debug_string;
+  }
+
+  function send_email() {
+    if(count($this->info) > 0) {
+      $to_name = '';
+      $to_address = $this->email_address;
+      $subject = "PayPal_Shopping_Cart_IPN";
+      $msg = strip_tags(nl2br($this->info()));
+      $from_name = 'PayPal_Shopping_Cart_IPN';
+      $from_address = strtolower(trim($this->email_address));
+      tep_mail($to_name, $to_address, $subject, $msg, $from_name, $from_address);
+    }
+  }
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/ipn.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/ipn.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/ipn.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,245 @@
+<?php
+/*
+  $Id: ipn.class.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+
+*/
+
+class ipn {
+
+  var $key,
+      $response_string,
+      $ipn_id;
+
+  function ipn($post_vars) {
+    global $debug;
+    $transaction_list = array('web_accept','cart','send_money'); //accepted transactions v1.6
+    if (!in_array($post_vars['txn_type'],$transaction_list)) {
+      if ($debug->enabled) $debug->add(UNKNOWN_TXN_TYPE,sprintf(UNKNOWN_TXN_TYPE_MSG, $post_vars['txn_type']));
+    } else if(strlen($post_vars['txn_id']) == 17) {
+      $this->init($post_vars,$custom_list); //Looks like a PayPal transaction
+    } else {
+      if ($debug->enabled) $debug->add(UNKNOWN_POST,sprintf(UNKNOWN_POST_MSG,$_SERVER['REMOTE_ADDR']));
+    }
+  }
+
+  function init($post_vars,$custom_list) {
+    global $debug;
+    $debug_string = '';
+    $this->key = array();
+    $this->response_string = 'cmd=_notify-validate';
+    reset($post_vars);
+    foreach ($post_vars as $var => $val) {
+      if ($debug->enabled) $debug_string .= $var . '=' . $val .'&';
+      $val = tep_db_prepare_input($val);
+      if (!strcasecmp($var,'cmd') || !eregi("^[_0-9a-z-]{1,32}$",$var)) {
+        unset($var); unset($val);
+      } elseif ($var != '') {
+        $this->key[$var] = $val;
+        $this->response_string .= '&' . $var . '=' . urlencode($val);
+      }
+    }
+    if ($debug->enabled) $debug->init($debug_string, $this->response_string);
+    unset($post_vars, $debug_string);
+  }
+
+  function authenticate($domain) {
+    global $debug;
+    $paypal_response = '';
+    $curl_flag = function_exists('curl_exec');
+    if($curl_flag) {
+      $ch = @curl_init();
+      @curl_setopt($ch,CURLOPT_URL, "https://$domain/cgi-bin/webscr");
+      @curl_setopt($ch,CURLOPT_POST, 1);
+      @curl_setopt($ch,CURLOPT_POSTFIELDS, $this->response_string);
+      @curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
+      @curl_setopt($ch,CURLOPT_HEADER, 0);
+      @curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, 0);
+      @curl_setopt($ch,CURLOPT_TIMEOUT, 60);
+      $paypal_response = @curl_exec($ch);
+      @curl_close($ch);
+      if($paypal_response == '') $curl_flag = false;
+    }
+    if(!$curl_flag) {
+      $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
+      $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
+      $header .= "Content-Length: ".strlen($this->response_string)."\r\n\r\n";
+      $socket  = 'ssl://'; $port = '443';
+      $fp = @fsockopen($socket.$domain,$port, $errno, $errstr, 30);
+      if(!$fp) {
+        $socket = 'tcp://'; $port = '80';
+        $fp = @fsockopen($socket.$domain,$port, $errno, $errstr, 30);
+      }
+      if(!$fp) {
+          $fp = @fopen('https://'.$domain.'/cgi-bin/webscr?'.$this->response_string);
+          $paypal_response = @fgets($fp, 1024); @fclose($fp);
+          if (!$paypal_response) {
+            $paypal_http_response = @file('http://'.$domain.'/cgi-bin/webscr?'.$this->response_string);
+            $paypal_response = @$paypal_http_response[0];
+            if (!$paypal_response && ($debug->enabled)) $debug->add(HTTP_ERROR,sprintf(HTTP_ERROR_MSG,$curl_flag,$socket,$domain,$port));
+          }
+      } else {
+        @fputs($fp, $header . $this->response_string);
+        while (!feof($fp)) {
+          $paypal_response .= @fgets($fp, 1024);
+        }
+        @fclose($fp);
+      }
+      unset($this->response_string);
+    }
+
+    if (strstr($paypal_response,'VERIFIED')) {
+      if($debug->enabled) $debug->add(RESPONSE_VERIFIED,sprintf(RESPONSE_MSG,$curl_flag,$socket,$domain,$port,$paypal_response));
+      return true;
+    } else if (strstr($paypal_response,'INVALID')) {
+      if($debug->enabled) $debug->add(RESPONSE_INVALID,sprintf(RESPONSE_MSG,$curl_flag,$socket,$domain,$port,$paypal_response));
+      return false;
+    } else {
+      if($debug->enabled) $debug->add(RESPONSE_UNKNOWN,sprintf(RESPONSE_MSG,$curl_flag,$socket,$domain,$port,$paypal_response));
+      return false;
+    }
+  }
+
+  //Test both receiver email address and business ID
+  function validate_receiver_email($receiver_email,$business) {
+      global $debug;
+      if(!strcmp(strtolower($receiver_email),strtolower($this->key['receiver_email'])) && !strcmp(strtolower($business),strtolower($this->key['business']))) {
+        if($debug->enabled) $debug->add(EMAIL_RECEIVER,sprintf(EMAIL_RECEIVER_MSG,$receiver_email,$business,$this->key['receiver_email'],$this->key['business']));
+        return true;
+      } else {
+        if($debug->enabled) $debug->add(EMAIL_RECEIVER,sprintf(EMAIL_RECEIVER_ERROR_MSG,$receiver_email,$business,$this->key['receiver_email'],$this->key['business'],$this->key['txn_id']));
+        return false;
+      }
+    }
+
+  function unique_txn_id() {
+      global $debug;
+      $txn_id_query = tep_db_query("select count(*) as count from " . TABLE_PAYPAL . " where txn_id = '" . tep_db_input($this->key['txn_id']) . "'");
+      $txn_id = tep_db_fetch_array($txn_id_query);
+      if ($txn_id['count'] < 1) { //txn_id doesn't exist
+        return true;
+      } else {
+        if($debug->enabled) $debug->add(TXN_DUPLICATE,sprintf(TXN_DUPLICATE_MSG,$this->key['txn_id']));
+        return false;
+      }
+  }
+
+  function insert_ipn_txn() {
+    global $debug;
+    $sql_data_array = array(
+        'txn_type'            => $this->key['txn_type'],
+        'reason_code'         => $this->key['reason_code'],
+        'payment_type'        => $this->key['payment_type'],
+        'payment_status'      => $this->key['payment_status'],
+        'pending_reason'      => $this->key['pending_reason'],
+        'invoice'             => $this->key['invoice'],
+        'mc_currency'         => $this->key['mc_currency'],
+        'first_name'          => $this->key['first_name'],
+        'last_name'           => $this->key['last_name'],
+        'payer_business_name' => $this->key['payer_business_name'],
+        'address_name'        => $this->key['address_name'],
+        'address_street'      => $this->key['address_street'],
+        'address_city'        => $this->key['address_city'],
+        'address_state'       => $this->key['address_state'],
+        'address_zip'         => $this->key['address_zip'],
+        'address_country'     => $this->key['address_country'],
+        'address_status'      => $this->key['address_status'],
+        'payer_email'         => $this->key['payer_email'],
+        'payer_id'            => $this->key['payer_id'],
+        'payer_status'        => $this->key['payer_status'],
+        'payment_date'        => $this->datetime_to_sql_format($this->key['payment_date']),
+        'business'            => $this->key['business'],
+        'receiver_email'      => $this->key['receiver_email'],
+        'receiver_id'         => $this->key['receiver_id'],
+        'txn_id'              => $this->key['txn_id'],
+        'parent_txn_id'       => $this->key['parent_txn_id'],
+        'num_cart_items'      => $this->key['txn_type'] == 'cart' ? $this->key['num_cart_items'] : '1',
+        'mc_gross'            => $this->key['mc_gross'],
+        'mc_fee'              => $this->key['mc_fee'],
+        'payment_gross'       => $this->key['payment_gross'],
+        'payment_fee'         => $this->key['payment_fee'],
+        'settle_amount'       => $this->key['settle_amount'],
+        'settle_currency'     => $this->key['settle_currency'],
+        'exchange_rate'       => $this->key['exchange_rate'],
+        'notify_version'      => $this->key['notify_version'],
+        'verify_sign'         => $this->key['verify_sign'],
+        'date_added'          => 'now()',
+        'memo'                => $this->key['memo']);
+    tep_db_perform(TABLE_PAYPAL, $sql_data_array);
+    $this->ipn_id = tep_db_insert_id();
+    $this->update_status($this->ipn_id,$this->key['payment_status'],$this->key['pending_reason']);
+    if($debug->enabled) $debug->add(IPN_TXN_INSERT,sprintf(IPN_TXN_INSERT_MSG,$this->ipn_id));
+    return $this->ipn_id;
+  }
+
+  function update_status($paypal_ipn_id, $payment_status, $pending_reason) {
+    tep_db_query("update " . TABLE_PAYPAL . " set payment_status = '" . tep_db_input($payment_status) . "', pending_reason = '" . tep_db_input($pending_reason) . "', last_modified = now() where paypal_ipn_id = '" . (int)$paypal_ipn_id . "'");
+    tep_db_query("insert into " . TABLE_PAYPAL_PAYMENT_STATUS_HISTORY . " (paypal_ipn_id, payment_status, pending_reason, date_added) values ('" . (int)$paypal_ipn_id . "', '" . tep_db_input($payment_status) . "', '" . tep_db_input($pending_reason) . "', now())");
+  }
+
+  function valid_payment() {
+    global $order, $currencies, $currency, $debug;
+    if (MODULE_PAYMENT_PAYPAL_IPN_CART_TEST == 'Off') return true;
+    $valid_payment = true;
+    //check the payment_currency
+    if( $this->key['mc_currency'] != $currency) {
+      if ($debug->enabled) $debug->add(CHECK_CURRENCY,sprintf(CHECK_CURRENCY_MSG,$this->key['mc_currency'],$currency));
+      $valid_payment = false;
+    }
+    //check the payment_amount
+    if ( $currencies->currencies[$currency]['symbol_left'].$this->key['mc_gross'].$currencies->currencies[$currency]['symbol_right'] != $order->info['total'] ) {
+      if ($debug->enabled) $debug->add(CHECK_TOTAL,sprintf(CHECK_TOTAL_MSG,$this->key['mc_gross'],$order->info['total']));
+      $valid_payment = false;
+    }
+    return $valid_payment;
+  }
+
+  //returns TABLE_PAYPAL.paypal_ipn_id
+  function id() {
+    return $this->ipn_id;
+  }
+
+  //returns the transaction type (paypal.txn_type)
+  function txn_type() {
+    return $this->key['txn_type'];
+  }
+
+  function datetime_to_sql_format($raw_datetime) {
+    $months = array('Jan' => '01', 'Feb' => '02', 'Mar' => '03', 'Apr' => '04', 'May' => '05',  'Jun' => '06',  'Jul' => '07', 'Aug' => '08', 'Sep' => '09', 'Oct' => '10', 'Nov' => '11', 'Dec' => '12');
+    $hour = substr($raw_datetime, 0, 2);$minute = substr($raw_datetime, 3, 2);$second = substr($raw_datetime, 6, 2);
+    $month = $months[substr($raw_datetime, 9, 3)];$day = substr($raw_datetime, 13, 2);$year = substr($raw_datetime, 17, 4);
+    return ($year . "-" . $month . "-" . $day . " " . $hour . ":" . $minute . ":" . $second);
+  }
+
+  function dienice() {
+    if ( strcmp(phpversion(),'3.0') <= 0 ) {
+      if($this->key['digest_key'] == $this->digest_key()) {
+        header("status: 204");
+      } else {
+        header("status: 500");
+      }
+    } else {
+      if($this->key['digest_key'] == $this->digest_key()) {
+        header("HTTP/1.0 204 No Response");
+      } else {
+        header("HTTP/1.0 500 Internal Server Error");
+      }
+    }
+    exit;
+  }
+
+  function digest_key() {
+    return strrev(md5(md5(strrev(md5(MODULE_PAYMENT_PAYPAL_IPN_DIGEST_KEY)))));
+  }
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/ipn_query.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/ipn_query.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/ipn_query.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: ipn_info.class.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+  class ipn_query {
+    var $info, $txn, $customer;
+
+    function ipn_query($paypal_ipn_id) {
+      $this->info = array();
+      $this->txn = array();
+      $this->customer = array();
+      $this->query($paypal_ipn_id);
+    }
+
+    function query($paypal_ipn_id) {
+      $ipn_query = tep_db_query("select * from " . TABLE_PAYPAL . " where paypal_ipn_id = '" . (int)$paypal_ipn_id . "'");
+      $ipn = tep_db_fetch_array($ipn_query);
+      $this->info = array(
+        'txn_type'            => $ipn['txn_type'],
+        'reason_code'         => $ipn['reason_code'],
+        'payment_type'        => $ipn['payment_type'],
+        'payment_status'      => $ipn['payment_status'],
+        'pending_reason'      => $ipn['pending_reason'],
+        'invoice'             => $ipn['invoice'],
+        'mc_currency'         => $ipn['mc_currency'],
+        'payment_date'        => $ipn['payment_date'],
+        'business'            => $ipn['business'],
+        'receiver_email'      => $ipn['receiver_email'],
+        'receiver_id'         => $ipn['receiver_id'],
+        'paypal_address_id'   => $ipn['papal_address_id'],
+        'txn_id'              => $ipn['txn_id'],
+        'parent_txn_id'       => $ipn['parent_txn_id'],
+        'notify_version'      => $ipn['notify_version'],
+        'verify_sign'         => $ipn['verify_sign'],
+        'last_modified'       => $ipn['last_modified'],
+        'date_added'          => $ipn['date_added']);
+
+      $this->txn = array(
+        'num_cart_items'      => $ipn['num_cart_items'],
+        'mc_gross'            => $ipn['mc_gross'],
+        'mc_fee'              => $ipn['mc_fee'],
+        'payment_gross'       => $ipn['payment_gross'],
+        'payment_fee'         => $ipn['payment_fee'],
+        'settle_amount'       => $ipn['settle_amount'],
+        'settle_currency'     => $ipn['settle_currency'],
+        'exchange_rate'       => $ipn['exchange_rate']);
+
+      $this->customer = array(
+        'first_name'          => $ipn['first_name'],
+        'last_name'           => $ipn['last_name'],
+        'payer_business_name' => $ipn['payer_business_name'],
+        'address_name'        => $ipn['address_name'],
+        'address_street'      => $ipn['address_street'],
+        'address_city'        => $ipn['address_city'],
+        'address_state'       => $ipn['address_state'],
+        'address_zip'         => $ipn['address_zip'],
+        'address_country'     => $ipn['address_country'],
+        'address_status'      => $ipn['address_status'],
+        'address_owner'       => $ipn['address_owner'],
+        'payer_email'         => $ipn['payer_email'],
+        'payer_id'            => $ipn['payer_id'],
+        'payer_status'        => $ipn['payer_status'],
+        'memo'                => $ipn['memo']);
+    }
+  }//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/orders_session.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/orders_session.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/orders_session.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+<?php
+/*
+  $Id: orders_session.class.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+class orders_session {
+  function orders_session($txn_sign) {
+    include_once(DIR_WS_MODULES . 'payment/paypal/database_tables.inc.php');
+    $txn_signature = tep_db_prepare_input($txn_sign);
+    $orders_session_query = tep_db_query("select * from " . TABLE_ORDERS_SESSION_INFO . " where txn_signature ='" . tep_db_input($txn_signature) . "' limit 1");
+    if(tep_db_num_rows($orders_session_query)) {
+      $orders_session = tep_db_fetch_array($orders_session_query);
+      while (list($key, $value) = each($orders_session)) {
+        $this->$key = $value;
+      }
+    }
+  }
+}
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/osC/Order.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/osC/Order.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/osC/Order.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,308 @@
+<?php
+/*
+  $Id: Order.class.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+class PayPal_osC_Order {
+
+  function PayPal_osC_Order() {
+  }
+
+  function setCommonVars($osC) {
+    $this->setContentType($osC['content_type']);
+    $this->setPaymentTitle($osC['payment_title']);
+    $this->setLanguage($osC['language']);
+    $this->setLanguageID($osC['language_id']);
+    $this->setBillTo($osC['billto']);
+    $this->setSendTo($osC['sendto']);
+    $this->currency = $osC['currency'];
+    $this->currency_value = $osC['currency_value'];
+    $this->affiliate_id = $osC['affiliate_id'];
+    $this->affiliate_clickthroughs_id = $osC['affiliate_clickthroughs_id'];
+    $this->affiliate_date = $osC['affiliate_date'];
+    $this->affiliate_browser = $osC['affiliate_browser'];
+    $this->affiliate_ipaddress = $osC['affiliate_ipaddress'];
+  }
+
+  function loadTransactionSessionInfo($txn_sign) {
+    $txn_signature = tep_db_prepare_input($txn_sign);
+    $orders_session_query = tep_db_query("select orders_id, content_type, payment_title, language, language_id, billto, sendto, currency, currency_value, payment_amount, payment_currency, affiliate_id, affiliate_clickthroughs_id, affiliate_date, affiliate_browser, affiliate_ipaddress from " . TABLE_ORDERS_SESSION_INFO . " where txn_signature ='" . tep_db_input($txn_signature) . "' limit 1");
+    if(tep_db_num_rows($orders_session_query)) {
+      $orders_session = tep_db_fetch_array($orders_session_query);
+      $this->setCommonVars($orders_session);
+      $this->setOrderID($orders_session['orders_id']);
+      $this->payment_amount = $orders_session['payment_amount'];
+      $this->payment_currency = $orders_session['payment_currency'];
+    }
+  }
+
+  function loadOrdersSessionInfo() {
+    $orders_session_query = tep_db_query("select content_type, payment_title, language, language_id, billto, sendto, currency, currency_value, affiliate_id, affiliate_clickthroughs_id, affiliate_date, affiliate_browser, affiliate_ipaddress from " . TABLE_ORDERS_SESSION_INFO . " where orders_id ='" . (int)$this->orderID . "' limit 1");
+    if(tep_db_num_rows($orders_session_query)) {
+      $orders_session = tep_db_fetch_array($orders_session_query);
+      $this->setCommonVars($orders_session);
+    }
+  }
+
+  function removeOrdersSession() {
+    tep_db_query("delete from " . TABLE_ORDERS_SESSION_INFO . " where orders_id = '" . (int)$this->orderID . "'");
+  }
+
+  function updateOrderStatus($order_status = MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID) {
+    // update the order's status
+    tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($order_status) . "', last_modified = now() where orders_id = '" . (int)$this->orderID . "'");
+  }
+
+  function updateProducts(&$order) {
+    // initialized for the email confirmation
+    $this->products_ordered = '';
+    $subtotal = 0;
+    $total_tax = 0;
+    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+    // Stock Update - Joao Correia
+      if (STOCK_LIMITED == 'true') {
+        if (DOWNLOAD_ENABLED == 'true') {
+          $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename
+                              FROM " . TABLE_PRODUCTS . " p
+                              LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
+                               ON p.products_id=pa.products_id
+                              LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                               ON pa.products_attributes_id=pad.products_attributes_id
+                              WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
+          // Will work with only one option for downloadable products
+          // otherwise, we have to build the query dynamically with a loop
+          $products_attributes = $order->products[$i]['attributes'];
+          if (is_array($products_attributes)) {
+            $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
+          }
+          $stock_query = tep_db_query($stock_query_raw);
+        } else {
+          $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        }
+        if (tep_db_num_rows($stock_query) > 0) {
+          $stock_values = tep_db_fetch_array($stock_query);
+          // do not decrement quantities if products_attributes_filename exists
+          if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
+            $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
+          } else {
+            $stock_left = $stock_values['products_quantity'];
+          }
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+          if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
+            tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+          }
+        }
+      }
+
+      // Update products_ordered (for bestsellers list)
+      tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+
+      //------insert customer choosen option to order--------
+      $attributes_exist = '0';
+      $products_ordered_attributes = '';
+      if (isset($order->products[$i]['attributes'])) {
+        $attributes_exist = '1';
+        for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+          if (DOWNLOAD_ENABLED == 'true') {
+            $attributes_query = "select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
+                                 from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
+                                 left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                                  on pa.products_attributes_id=pad.products_attributes_id
+                                 where pa.products_id = '" . $order->products[$i]['id'] . "'
+                                  and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
+                                  and pa.options_id = popt.products_options_id
+                                  and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
+                                  and pa.options_values_id = poval.products_options_values_id
+          and poptt.products_options_text_id = popt.products_options_id
+                                  and poptt.language_id = '" . $this->languageID . "'
+                                  and poval.language_id = '" . $this->languageID . "'";
+            $attributes = tep_db_query($attributes_query);
+          } else {
+            $attributes = tep_db_query("select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and poptt.products_options_text_id = popt.products_options_id and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and poptt.language_id = '" . $this->languageID . "' and poval.language_id = '" . $this->languageID . "'");
+          }
+          $attributes_values = tep_db_fetch_array($attributes);
+          if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename']) ) {
+            $sql_data_array = array('orders_id' => $this->orderID,
+                                    'orders_products_id' => $order->products[$i]['orders_products_id'],
+                                    'orders_products_filename' => $attributes_values['products_attributes_filename'],
+                                    'download_maxdays' => $attributes_values['products_attributes_maxdays'],
+                                    'download_count' => $attributes_values['products_attributes_maxcount']);
+            tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
+          }
+          $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
+        }
+      }
+      //------insert customer choosen option eof ----
+      $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
+      $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
+      $total_cost += $total_products_price;
+
+      //$currency_price = $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);
+      $products_ordered_price = $this->displayPrice($order->products[$i]['final_price'],$order->products[$i]['tax'],$order->products[$i]['qty']);
+
+      $this->products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $products_ordered_price . $products_ordered_attributes . "\n";
+    }
+  }
+
+  function displayPrice($amount, $tax, $qty = 1) {
+    global $currencies;
+
+    if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
+      return $currencies->format(tep_add_tax($amount, $tax) * $qty, true, $this->currency, $this->currency_value);
+    }
+
+    return $currencies->format($amount * $qty, true, $this->currency, $this->currency_value);
+  }
+
+
+  function getCustomerComments() {
+    $orders_history_query = tep_db_query("select comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$this->orderID . "' order by date_added limit 1");
+    if (tep_db_num_rows($orders_history_query)) {
+      $orders_history = tep_db_fetch_array($orders_history_query);
+      return $orders_history['comments'];
+    }
+    return false;
+  }
+
+
+  function setLanguage($lng) {
+    $this->language = $lng;
+  }
+
+  function setLanguageID($id) {
+    $this->languageID = $id;
+  }
+
+  function setOrderID($id) {
+    $this->orderID = $id;
+  }
+
+  function setBillTo($id) {
+    $this->billTo = $id;
+  }
+
+  function setSendTo($id) {
+    $this->sendTo = $id;
+  }
+
+  function setPaymentTitle($title) {
+    $this->paymentTitle = $title;
+  }
+
+  function setContentType($type) {
+    $this->contentType = $type;
+  }
+
+  function setCheckoutProcessLanguageFile($filename) {
+    $this->checkoutProcessLanguageFile = $filename;
+  }
+
+  function setAccountHistoryInfoURL($url) {
+    $this->accountHistoryInfoURL= $url;
+  }
+
+
+   function notifyCustomer(&$order) {
+    $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
+    tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified) values (" . (int)$this->orderID . ", '" . MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID . "', now(), '" . $customer_notification . "')");
+
+    // lets start with the email confirmation
+    include($this->checkoutProcessLanguageFile);
+
+    $email_order = STORE_NAME . "\n" .
+                   EMAIL_SEPARATOR . "\n" .
+                   EMAIL_TEXT_ORDER_NUMBER . ' ' . $item_number . "\n" .
+                   EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $item_number, 'SSL', false) . "\n" .
+                   EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
+
+    $customerComments = $this->getCustomerComments();
+
+    if ($customerComments)
+      $email_order .= tep_db_output($customerComments) . "\n\n";
+
+
+    $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
+                    EMAIL_SEPARATOR . "\n" .
+                    $this->products_ordered .
+                    EMAIL_SEPARATOR . "\n";
+
+    for ($i=0, $n=sizeof($order->totals); $i<$n; $i++)
+      $email_order .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n";
+
+
+    if ($order->content_type != 'virtual') {
+
+      $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
+                           EMAIL_SEPARATOR . "\n";
+
+      if ($order->delivery['company'])
+        $email_order .= $order->delivery['company'] . "\n";
+
+      $email_order .= $order->delivery['name'] . "\n" .
+                      $order->delivery['street_address'] . "\n";
+
+      if ($order->delivery['suburb'])
+        $email_order .= $order->delivery['suburb'] . "\n";
+
+      $email_order .= $order->delivery['city'] . ', ' . $order->delivery['postcode'] . "\n";
+
+      if ($order->delivery['state'])
+        $email_order .= $order->delivery['state'] . ', ';
+
+      $email_order .= $order->delivery['country'] . "\n";
+    }
+
+    $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
+                           EMAIL_SEPARATOR . "\n";
+
+    if ($order->billing['company'])
+      $email_order .= $order->billing['company'] . "\n";
+
+    $email_order .= $order->billing['name'] . "\n" .
+                    $order->billing['street_address'] . "\n";
+
+    if ($order->billing['suburb'])
+      $email_order .= $order->billing['suburb'] . "\n";
+
+    $email_order .= $order->billing['city'] . ', ' . $order->billing['postcode'] . "\n";
+
+    if ($order->billing['state'])
+      $email_order .= $order->billing['state'] . ', ';
+
+    $email_order .= $order->billing['country'] . "\n\n";
+
+    $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
+                    EMAIL_SEPARATOR . "\n" .
+                    $this->paymentTitle . "\n\n";
+
+    tep_mail($order->customer['name'],$order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');
+
+    // send emails to other people
+    if (SEND_EXTRA_ORDER_EMAILS_TO != '')
+      tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT,  $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');
+
+  }//end function notifyCustomer
+  
+  function setOrderPaymentID($payment_id,$oID='') {
+      $order_id = !empty($oID) ? $oID : $this->orderID;
+      tep_db_query("update " . TABLE_ORDERS . " set payment_id = '" . (int)$payment_id . "' where orders_id = '" . (int)$order_id . "'");
+  }
+
+  function removeCustomersBasket($customer_id) {
+      tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'");
+      tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'");
+  }
+
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/osC/osC.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/osC/osC.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/osC/osC.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+  $Id: osC.class.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+
+*/
+
+class PayPal_osC {
+
+  function PayPal_osC($orders_id = '', $txn_signature = '') {
+    $this->orders_id =  tep_not_null($orders_id) ? $orders_id : '';
+    $this->txn_signature = tep_not_null($txn_signature) ? $txn_signature : '';
+  }
+
+  function check_order_status($start = false) {
+    global $PayPal_osC, $customers_id;
+    include_once(DIR_WS_MODULES . 'payment/paypal/database_tables.inc.php');
+    if(tep_session_is_registered('PayPal_osC')) {
+      if ($start === true && PHP_VERSION < 4) {
+        $PayPal_osC_backup = $PayPal_osC;
+        $PayPal_osC = new PayPal_osC;
+        $PayPal_osC->unserialize($PayPal_osC_backup);
+      }
+      $orders_session_query = tep_db_query("select payment_id from " . TABLE_ORDERS . " where orders_id ='" . (int)$PayPal_osC->orders_id . "'");
+      $orders_session_check = tep_db_fetch_array($orders_session_query);
+      if ($orders_session_check['payment_id'] > 0 ) {
+        PayPal_osC::reset_checkout_cart_session();
+        return true;
+      }
+      return false;
+    }
+    return false;
+  }
+
+  function reset_checkout_cart_session() {
+    global $cart;
+    $cart->reset(true);
+    tep_session_unregister('sendto');
+    tep_session_unregister('billto');
+    tep_session_unregister('shipping');
+    tep_session_unregister('payment');
+    tep_session_unregister('comments');
+    tep_session_unregister('PayPal_osC');
+//credit class support DMG 9/21/2004
+
+if(tep_session_is_registered('credit_covers')) {
+    tep_session_unregister('credit_covers');
+     if(!class_exists('order_total')) {
+       include_once(DIR_WS_CLASSES . 'order_total.php');
+       }
+  $order_total_modules->clear_posts();//ICW ADDED FOR CREDIT CLASS SYSTEM
+  }
+}
+  function unserialize($broken) {
+    for(reset($broken);$kv=each($broken);) {
+      $key=$kv['key'];
+      if (gettype($this->$key)!="user function")
+      $this->$key=$kv['value'];
+    }
+  }
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/paypal_order.class.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/paypal_order.class.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/classes/paypal_order.class.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,64 @@
+<?php
+/*
+  $Id: paypal_order.class.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+
+*/
+
+class paypal_order {
+
+  function paypal_order($orders_id = '', $txn_signature = '') {
+    $this->orders_id =  tep_not_null($orders_id) ? $orders_id : '';
+    $this->txn_signature = tep_not_null($txn_signature) ? $txn_signature : '';
+  }
+
+  function check_order_status($start = false) {
+    global $paypal_order, $customers_id;
+    include_once(DIR_WS_MODULES . 'payment/paypal/database_tables.inc.php');
+    if(tep_session_is_registered('paypal_order')) {
+      if ($start === true && PHP_VERSION < 4) {
+        $paypal_session_order = $paypal_order;
+        $paypal_order = new paypal_order;
+        $paypal_order->unserialize($paypal_session_order);
+      }
+      $orders_session_query = tep_db_query("select paypal_ipn_id from " . TABLE_ORDERS . " where orders_id ='" . (int)$paypal_order->orders_id . "'");
+      $orders_session_check = tep_db_fetch_array($orders_session_query);
+      if ($orders_session_check['paypal_ipn_id'] > 0 ) {
+        paypal_order::reset_checkout_cart_session();
+        return true;
+      }
+      return false;
+    }
+    return false;
+  }
+
+  function reset_checkout_cart_session() {
+    global $cart;
+    $cart->reset(true);
+    tep_session_unregister('sendto');
+    tep_session_unregister('billto');
+    tep_session_unregister('shipping');
+    tep_session_unregister('payment');
+    tep_session_unregister('comments');
+    tep_session_unregister('paypal_order');
+  }
+
+  function unserialize($broken) {
+    for(reset($broken);$kv=each($broken);) {
+      $key=$kv['key'];
+      if (gettype($this->$key)!="user function")
+      $this->$key=$kv['value'];
+    }
+  }
+}//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/database_tables.inc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/database_tables.inc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/database_tables.inc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+<?php
+/*
+  $Id: database_tables.inc.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('TABLE_PAYPAL','paypal');
+  define('TABLE_PAYPAL_PAYMENT_STATUS_HISTORY','paypal_payment_status_history');
+  define('TABLE_ORDERS_SESSION_INFO', 'orders_session_info');
+  define('TABLE_PAYPAL_PAYMENT_STATUS_HISTORY','paypal_payment_status_history');
+  //define('TABLE_PAYPAL_AUCTION','paypal_auction');
+
+  // define the database table names used in the Affiliate Contribution
+  define('TABLE_AFFILIATE', 'affiliate_affiliate');
+  define('TABLE_AFFILIATE_SALES', 'affiliate_sales');
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/addressbook.func.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/addressbook.func.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/addressbook.func.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: addressbook.func.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+////
+// Returns the address_format_id for the given country
+// TABLES: countries;
+  function tep_get_address_format_id($country_id) {
+    $address_format_query = tep_db_query("select address_format_id as format_id from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'");
+    if (tep_db_num_rows($address_format_query)) {
+      $address_format = tep_db_fetch_array($address_format_query);
+      return $address_format['format_id'];
+    } else {
+      return '1';
+    }
+  }
+
+////
+// Return a formatted address
+// TABLES: customers, address_book
+  function tep_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") {
+    $address_query = tep_db_query("select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$address_id . "'");
+    $address = tep_db_fetch_array($address_query);
+
+    $format_id = tep_get_address_format_id($address['country_id']);
+
+    return tep_address_format($format_id, $address, $html, $boln, $eoln);
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/general.func.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/general.func.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/general.func.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: general.func.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  function paypal_include_lng($base_dir, $lng_dir, $lng_file) {
+    if(file_exists($base_dir . $lng_dir . '/' . $lng_file)) {
+      include_once($base_dir . $lng_dir . '/' . $lng_file);
+    } elseif (file_exists($base_dir . 'english/' . $lng_file)) {
+      include_once($base_dir . 'english/' . $lng_file);
+    }
+  }
+
+  function paypal_payment_status($order_id) {
+     include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.inc.php');
+     $paypal_payment_status_query = tep_db_query("select p.payment_status from " . TABLE_PAYPAL . " p left join " . TABLE_ORDERS . " o on p.paypal_id = o.payment_id where o.orders_id ='" . (int)$order_id . "'");
+     $paypal_payment_status = tep_db_fetch_array($paypal_payment_status_query);
+     //quick work around for unkown order status id
+     return $paypal_payment_status_value = (tep_not_null($paypal_payment_status['payment_status'])) ? $paypal_payment_status['payment_status'] : '';
+  }
+
+  function paypal_remove_order($order_id) {
+    include_once(DIR_FS_CATALOG_MODULES . 'payment/paypal/database_tables.inc.php');
+    $ipn_query = tep_db_query("select payment_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
+    if (tep_db_num_rows($ipn_query)) { // this is a ipn order (PayPal or StormPay)
+      $ipn_order = tep_db_fetch_array($ipn_query);
+      $paypal_id = $ipn_order['payment_id'];
+      $txn_query = tep_db_query("select txn_id from " . TABLE_PAYPAL . " where paypal_id ='" . (int)$paypal_id . "'");
+      $txn = tep_db_fetch_array($txn_query);
+      tep_db_query("delete from " . TABLE_PAYPAL . " where paypal_id = '" . (int)$paypal_id . "'");
+      tep_db_query("delete from " . TABLE_PAYPAL . " where parent_txn_id = '" . tep_db_input($txn['txn_id']) . "'");
+      if (defined('TABLE_PAYPAL_AUCTION')) tep_db_query("delete from " . TABLE_PAYPAL_AUCTION . " where paypal_id = '" . (int)$paypal_id . "'");
+
+    }
+    tep_db_query("delete from " . TABLE_ORDERS_SESSION_INFO . " where orders_id = '" . (int)$order_id . "'");
+  }
+
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/paypal.fnc.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/paypal.fnc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/functions/paypal.fnc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: paypal.fnc.php,v 2.6a 2004/07/14 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  function paypal_include_lng($base_dir, $lng_dir, $lng_file) {
+    if(file_exists($base_dir . $lng_dir . '/' . $lng_file)) {
+      include_once($base_dir . $lng_dir . '/' . $lng_file);
+    } else {
+      include_once($base_dir . 'english/' . $lng_file);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/PayPal-ContinueCheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/PayPal-ContinueCheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/PayPal-no-account-Click-Here.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/PayPal-no-account-Click-Here.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/act_accept.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/act_accept.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/act_deny.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/act_deny.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/amex.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/amex.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/bulb.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/bulb.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/contents.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/contents.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/discover.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/discover.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/hdr_ipn_240x120.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/hdr_ipn_240x120.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/hdr_ppGlobev4_160x76.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/hdr_ppGlobev4_160x76.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/help.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/icon_error_40x40.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/icon_error_40x40.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/mastercard.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/mastercard.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/oscommerce.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/oscommerce.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/paypal_intl.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/paypal_intl.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/paypal_logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/paypal_logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/period_ani.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/period_ani.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/pixel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/pixel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/scr_symQuestion.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/scr_symQuestion.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/top.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/visa.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/includes/modules/payment/paypal/images/visa.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/english/ipn.lng.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/english/ipn.lng.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/english/ipn.lng.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: ipn.lng.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('EMAIL_SEPARATOR', "------------------------------------------------------");
+
+  define('UNKNOWN_TXN_TYPE', 'Unknown Transaction Type');
+  define('UNKNOWN_TXN_TYPE_MSG', 'An unknown transaction (%s) occurred from ' . $_SERVER['REMOTE_ADDR'] . "\nAre you running any tests?");
+
+  define('UNKNOWN_POST', 'Unknown Post');
+  define('UNKNOWN_POST_MSG', "An unknown POST from %s was received.\nAre you running any tests?");
+
+  define('CONNECTION_TYPE', 'Connection Type');
+  define('CONNECTION_TYPE_MSG', "curl: %s transport: %s domain: %s port: %s ");
+
+
+  define('PAYPAL_RESPONSE', 'PayPal Response');
+  define('PAYPAL_RESPONSE_MSG', "%s");
+
+  define('EMAIL_RECEIVER', 'Email and Business ID config');
+  define('EMAIL_RECEIVER_MSG', "Store Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n".EMAIL_SEPARATOR."\nPayPal Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s");
+  define('EMAIL_RECEIVER_ERROR_MSG', "Store Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n".EMAIL_SEPARATOR."\nPayPal Configuration Settings\nPrimary PayPal Email Address: %s\nBusiness ID: %s\n\nPayPal Transaction ID: %s");
+
+  define('TXN_DUPLICATE', 'Duplicate Transaction');
+  define('TXN_DUPLICATE_MSG', "A duplicate IPN transaction (%s) has been received.\nPlease check your PayPal Account");
+
+  define('IPN_TXN_INSERT', 'IPN INSERTED');
+  define('IPN_TXN_INSERT_MSG', "IPN %s has been inserted");
+
+  define('CART_TEST', 'Cart Test');
+  define('CART_TEST_MSG', "Store (converted) order total: %s %s\nPayPal MC Total: %s %s");
+  define('CART_TEST_ERR_MSG', "Invalid Cart Test\n".CART_TEST_MSG);
+
+  define('CHECK_TXN_SIGNATURE', 'Validate '.IPN_PAYMENT_MODULE_NAME.' Transaction Signature');
+  define('CHECK_TXN_SIGNATURE_MSG', "Incorrect Signature\nPayPal: %s\nosC: %s");
+
+  define('CHECK_TOTAL', 'Validate Total Transaction Amount');
+  define('CHECK_TOTAL_MSG', "Incorrect Total\nPayPal: %s\nSession: %s");
+
+  define('DEBUG', IPN_PAYMENT_MODULE_NAME.' Debug Email Notification');
+  define('DEBUG_MSG', "%s");
+
+  define('PAYMENT_SEND_MONEY_DESCRIPTION', 'Money Received');
+  define('PAYMENT_SEND_MONEY_DESCRIPTION_MSG', "You have received a payment of %s %s \n".EMAIL_SEPARATOR."\nThis payment was sent by someone from the PayPal website, using the Send Money tab");
+
+  define('PAYPAL_AUCTION','Ebay Auction');
+  define('PAYPAL_AUCTION_MSG','You have received an Ebay/PayPal Auction Instant Payment Notification, please login to your osCommerce Administration for further details.');
+
+  define('TEST_COMPLETE', 'Test Complete');
+  define('TEST_INCOMPLETE', 'Invalid Test');
+  define('TEST_INCOMPLETE_MSG', "An error has occured, mostly likely because the Custom field in the IPN Test Panel did not have a valid transaction id.\n");
+
+  define('HTTP_ERROR', 'HTTP Error');
+  define('HTTP_ERROR_MSG', "An HTTP Error occured during authentication\n".EMAIL_SEPARATOR."\ncurl: %s transport: %s domain: %s port: %s");
+
+  define('IPN_EMAIL', 'Attention!');
+  define('IPN_EMAIL_MSG', "This is email has NOT been sent by PayPal.\n\nYou have received this email via the osCommerce ".IPN_PAYMENT_MODULE_NAME." Contribution\n\nTo discontinue receiving this notice disable 'Debug Email Notifications' in your osCommerce PayPal configuration panel.");
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/english.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/english.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/languages/english.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: english.php,v 1.114 2003/07/09 18:13:39 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// look in your $PATH_LOCALE/locale directory for available locales
+// or type locale -a on the server.
+// Examples:
+// on RedHat try 'en_US'
+// on FreeBSD try 'en_US.ISO_8859-1'
+// on Windows try 'en', or 'English'
+ at setlocale(LC_TIME, 'en_US.ISO_8859-1');
+
+define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()
+define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
+define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
+define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
+
+////
+// Return date in raw format
+// $date should be in format mm/dd/yyyy
+// raw date is in format YYYYMMDD, or DDMMYYYY
+function tep_date_raw($date, $reverse = false) {
+  if ($reverse) {
+    return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
+  } else {
+    return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
+  }
+}
+
+// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
+define('LANGUAGE_CURRENCY', 'USD');
+
+// Global entries for the <html> tag
+define('HTML_PARAMS','dir="LTR" lang="en"');
+
+// charset for web pages and emails
+define('CHARSET', 'iso-8859-1');
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/css/general.css
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/css/general.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/css/general.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,138 @@
+/* Tag modifiers */
+  BODY                     {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; color: #000000;}
+  LI                       {line-height: 120%;}
+  A                        {color: #0033cc;}
+  P, DIV                   {border: 0px; margin: 0px; padding: 0px;}
+  P.box                    {border: solid #aaaaaa 1px; padding: 3px;}
+  B                        {font-weight: 700;}
+  FORM                     {margin: 0px;}
+  SELECT                   {font-size: 13px;}
+  INPUT                    {font-size: 13px;}
+  BR.h5                    {font-size: 5px; line-height: 5px;}
+  BR.h6                    {font-size: 6px; line-height: 6px;}
+  BR.h8                    {font-size: 8px; line-height: 8px;}
+  BR.h10                   {font-size: 10px; line-height: 10px;}
+  BR.h12                   {font-size: 12px; line-height: 12px;}
+  BR.text_spacer           {font-size: 20px; line-height: 20px;}
+  BR.field_spacer          {font-size: 28px; line-height: 28px;}
+  BR.field_spacer_opt      {font-size: 35px; line-height: 35px;}
+  BR.ir_spacer             {font-size: 20px; line-height: 20px;}
+  BLOCKQUOTE.ir            {margin: 0px 0px 5px 10px;}
+  UL.irlist                {margin: 0px 5px 0px 15px;}
+  OL.irolist               {margin: 0px 5px 0px 35px;}
+  hr.dotted                {width: 100%; margin-top: 5; margin-bottom: 5; border-left: #fff; border-right: #fff; border-top: #fff; border-bottom: 2px dotted #aaa;}
+  hr.solid                 {width: 100%; margin-top: 5; margin-bottom: 5; border-left: #fff; border-right: #fff; border-top: #fff; border-bottom: 2px solid #999;}
+
+/* Image modifiers */
+  IMG                      {border: 0px;}   /* only works in ie, ns6, but hey, it helps */
+  IMG.left                 {float: left;}
+  IMG.right                {float: right;}
+
+/* Really big fonts */
+  .ppbigtext              {font-size: 17px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400;}
+  .ppbigtextbold          {font-size: 17px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700;}
+  .ppheading              {font-size: 17px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; color: #003366;}
+
+/* Pretty big fonts */
+  .ppmediumtext           {font-size: 15px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400;}
+  .ppsubheading           {font-size: 15px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; color: #003366;}
+
+/* Regular fonts */
+  .pptext, .maincenter, .maintd, td    {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400;}
+  .pptextbluelink         {color: #0033CC; font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; text-decoration: underline;}
+  .pptextbold             {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700;}
+  .ppnote                 {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; color: #999999;}
+  .pperror                {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; color: #ff0000;}
+  .pperrorbold            {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; color: #ff0000;}
+  .ppmessage              {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700;}
+
+/* Small fonts */
+  .ppsmalltext            {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400;}
+  .ppsmalltextbold        {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700;}
+  .ppsmallnote            {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; color: #999999;}
+  .ppsmallerror           {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; color: #ff0000;}
+  .ppsmallerrorbold       {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; color: #ff0000;}
+  .pplabel                {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; padding: 1px 0 0 0;}
+  .pplabelerror           {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; padding: 1px 0 0 0; color: #ff0000;}
+  .pplabelgrey            {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; padding: 1px 0 0 0; color: #666666;}
+  .pplabelgreyerror       {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; padding: 1px 0 0 0; color: #ff0000;}
+  .ppfooter, .footer      {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400;}
+  .ppsmalltextboldwhite   {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; color: #ffffff;}
+
+/* Button modifiers */
+  .ppbutton               {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; border-style:outset; color:#000000;}
+  .ppbuttonhot            {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700; border-style:outset; color:#000000;}
+  .ppbuttonsmall          {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; border-style:outset; color:#000000;}
+  .ppbuttonverysmall      {font-size: 9px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; border-style:outset; color:#000000;}
+
+
+  .ppinlineoptional       {font-weight: 400;}
+  .ppinlinedisabled       {color: #999999;}
+  .ppinlinefootnote       {color: #999999;}
+  .ppinlineerror          {color: #ff0000;}
+  .ppinlineerrorbold      {font-weight: 700; color: #ff0000;}
+  .ppinlineyellowbg       {background-color: #ffffcc;}
+  .ppinlinewhitebg        {background-color: #ffffff;}
+  .ppinlinelightgreybg    {background-color: #e6e6e6;}
+  .ppinlinedarkgreybg     {background-color: #cccccc;}
+  .ppinlinedisabledgrey   {background-color: #e6e6e6; color: #666666;}
+  .ppinlinepaypalblue     {color: #336699;}
+  .ppinlinewhite          {color: #ffffff;}
+  .ppinlinereward         {color: #00aa00;}
+  .ppinlinegreen          {color: #00aa00;}
+  .ppinlinered            {color: #ff0000;}
+  .ppinlineblue           {color: #0000ff;}
+  .ppinlineorange         {color: #ff9900;}
+  .ppinlinegreyongrey     {color: #333333;}
+  .ppinlinemedgrey        {color: #999999;}
+  .ppinlinemoneygreen     {color: #336633;}
+
+/* Border for headers*/
+  .ppheaderborder           {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; background-color: #F9F9F9; border-color: #CCC; border-width: 1px 0px 1px 0px; border-style: solid; padding: 5px}
+  .ppborderline             {border-color: #CCC; border-width: 1px 0px 0px 0px; border-style: solid;}
+
+/* Dashboard styles */
+  .ppdashheader           {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700;}
+  .ppdashbody             {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400;}
+  .ppdashbodybold         {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 700;}
+  .ppdashhead td          {background-color: #ccddee; font-weight: 700;}
+
+
+/* Localizable Emphatic Elements */
+/* Combos are on their way -- ben */
+  /* In EN 100-199 are weights */
+  .ppem100       {font-weight: 100;}       /* super-skinny */
+  .ppem101       {font-weight: 200;}       /*              */
+  .ppem102       {font-weight: 300;}       /*              */
+  .ppem103       {font-weight: 400;}       /* normal       */
+  .ppem104       {font-weight: 500;}       /*              */
+  .ppem105       {font-weight: 600;}       /*              */
+  .ppem106       {font-weight: 700;}       /* bold         */
+  .ppem107       {font-weight: 800;}       /*              */
+  .ppem108       {font-weight: 900;}       /*              */
+
+  /* In EN 200-299 are font styles */
+  .ppem200       {font-style: normal;}     /* normal       */
+  .ppem201       {font-style: italic;}     /* italic       */
+  .ppem202       {font-style: oblique;}    /* better ital. */
+
+  /* In EN 300-399 are color/bgcolor varieties */
+  /* 300-329 greys  */
+  /* 330-349 reds   */
+  /* 350-369 greens */
+  /* 370-389 blues  */
+
+  .ppem301       {color: #000000;}         /* black        */
+  .ppem302       {color: #333333;}         /* dark grey    */
+  .ppem303       {color: #666666;}         /* dk/med grey  */
+  .ppem304       {color: #999999;}         /* lt/med grey  */
+  .ppem305       {color: #cccccc;}         /* lt grey      */
+  .ppem306       {color: #e6e6e6;}         /* pp grey 1    */
+  .ppem307       {color: #f6f6f6;}         /* pp grey 2    */
+  .ppem308       {color: #ffffff;}         /* white        */
+
+  .ppem330       {color: #ff0000;}         /* red          */
+
+  .ppem350       {color: #00ff00;}         /* green        */
+
+  .ppem370       {color: #0000ff;}         /* blue         */

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/css/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/css/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/css/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+body {margin-top: 8px; margin-left: 8px; margin-bottom: 8px; margin-right: 8px;}
+.pperrorbold {text-align: center; width: 100%;}
+.justify {text-align: justify;}
+.buttontd {text-align: right; padding-right: 10px;}
+
+.testpanelinfo td {padding-left:15px;}
+
+.testpanel td {padding-left:5px; font-weight: 700;}
+.testpanel td, .testpanelinfo td {font-size: 11px; font-family: verdana,arial,helvetica,sans-serif;}
+.testpanel table {width: 100%;}
+
+/* powered by button */
+.poweredByButton { border: 1px solid black; padding: 1px; margin: 1px; font-family: Verdana, Arial, sans-serif; font-size: 8px; text-transform: uppercase; background: #999; }
+.poweredByButton .poweredBy { color: black; background: white; padding: 1px 5px 1px 5px; font-size: 8px; }
+.poweredByButton .osCommerce { color: white; padding: 1px 5px 1px 5px; font-size: 8px; }
+a.poweredByButton:link, a.copyright:link { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; font-weight: normal; text-decoration: none; }
+a.poweredByButton:visited, a.copyright:visited { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; font-weight: normal; text-decoration: none; }
+a.poweredByButton:active, a.copyright:active { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; font-weight: normal; text-decoration: none; }
+a.poweredByButton:hover, a.copyright:hover { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; font-weight: normal; text-decoration: underline; }
+
+/* forms */
+CHECKBOX, INPUT, RADIO, SELECT, TEXTAREA, FILE { font-family: Verdana, Arial, sans-serif; font-size: 11px; font-weight: normal; }
+FORM { display: inline; }
+
+/* Content */
+  .main                    {width: 600px;}
+  td.maintd                {padding-left: 6px; padding-right: 6px;}
+/* Popup */
+  .popupmain               {width: 100%;}
+
+.ppem380 {color: #003366;}

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/default.tpl.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/default.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/default.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,39 @@
+<?php
+/*
+  $Id: default.tpl.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo $page->metaTitle; ?></title>
+<meta name="copyright" content="2004">
+<meta name="author" content="oscommerce&#064;devosc.com">
+<?php echo $page->importCSS() . $page->importJavaScript(); ?>
+</head>
+<body onLoad="<?php echo $page->onLoad; ?>">
+<table border="0" cellspacing="2" cellpadding="2" class="main" align="center" style="background: #ffffff url('<?php echo $page->baseURL.'images/logo.gif'; ?>') no-repeat top left;">
+  <tr style="height: 55px; vertical-align: bottom;">
+    <td class="ppheading" style="text-align: right;">&nbsp;<?php echo $page->pageTitle; ?>&nbsp;</td>
+  </tr>
+  <tr><td><hr class="solid"></td></tr>
+  <tr>
+    <td><?php require($page->contentFile); ?></td>
+  </tr>
+  <tr>
+    <td><?php echo $page->copyright(); ?></td>
+  </tr>
+</table>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/js/general.js
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/js/general.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/js/general.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,9 @@
+<!--
+function openWindow(url,name,args) {
+  if (url == null || url == '') exit;
+  if (name == null || name == '') name = 'popupWin';
+  if (args == null || args == '') args = 'scrollbars,resizable,toolbar,status,width=680,height=480,left=50,top=50';
+  popupWin = window.open(url,name,args);
+  popupWin.focus();
+}
+//-->

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/osC_Admin.tpl.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/osC_Admin.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/osC_Admin.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: osC_Admin.tpl.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
+<script type="text/javascript" src="includes/general.js"></script>
+<?php echo $page->importJavaScript(); ?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="<?php echo $page->onLoad; ?>">
+<!-- header //-->
+<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
+<!-- header_eof //-->
+
+<!-- body //-->
+<table border="0" width="100%" cellspacing="2" cellpadding="2">
+  <tr>
+    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<!-- body_text //-->
+    <td width="100%" valign="top"><?php require($page->contentFile); ?></td>
+<!-- body_text_eof //-->
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/osC_Catalog.tpl.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/osC_Catalog.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/osC_Catalog.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: osC_Catalog.tpl.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<meta name="copyright" content="2004">
+<meta name="author" content="oscommerce&#064;devosc.com">
+<?php echo $page->importCSS(); ?>
+</head>
+<body onLoad="<?php echo $page->onLoad; ?>">
+<table border="0" cellspacing="2" cellpadding="2" class="main" align="center" style="background: #ffffff;">
+  <tr>
+    <td><?php require($page->contentFile); ?></td>
+  </tr>
+  <tr><td><hr class="solid"></td></tr>
+  <tr>
+    <td class="buttontd"><form name="winClose"><input type="button" value="Close Window" onclick="window.close();return(false);" class="ppbuttonsmall"></form></td>
+  </tr>
+  <tr><td><br class="h10"></td></tr>
+</table>
+</body>
+</html>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/popup.tpl.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/popup.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal/templates/popup.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: popup.tpl.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+?>
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo $page->metaTitle; ?></title>
+<meta name="copyright" content="2004">
+<meta name="author" content="oscommerce&#064;devosc.com">
+<?php echo $page->importCSS() . $page->importJavaScript(); ?>
+</head>
+<body onLoad="<?php echo $page->onLoad; ?>">
+<table border="0" cellspacing="2" cellpadding="2" class="main" align="center" style="background: #ffffff url('<?php echo basename($PHP_SELF).'?action=logo'; ?>') no-repeat top left;">
+  <tr style="height: 55px; vertical-align: bottom;">
+    <td class="ppheading" style="text-align: right;">&nbsp;<?php echo $page->pageTitle; ?>&nbsp;</td>
+  </tr>
+  <tr><td><hr class="solid"></td></tr>
+  <tr>
+    <td><?php require($page->contentFile); ?></td>
+  </tr>
+  <tr><td><hr class="solid"></td></tr>
+  <tr>
+    <td class="buttontd"><form name="winClose"><input type="button" value="Close Window" onclick="window.close();return(false);" class="ppbuttonsmall"></form></td>
+  </tr>
+  <tr>
+    <td><?php echo $page->copyright(); ?></td>
+  </tr>
+</table>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,356 @@
+<?php
+/*
+  $Id: paypal.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  define('FILENAME_PAYPAL_INFO','popup_paypal.php');
+  define('FILENAME_IPN','ipn.php');
+
+  class paypal {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function paypal() {
+      global $order;
+      $this->code = 'paypal';
+      $this->codeTitle = 'PayPal';
+      $this->title = MODULE_PAYMENT_PAYPAL_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_PAYPAL_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_PAYPAL_STATUS == 'True') ? true : false);
+      if ((int)MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID;
+      }
+      if (is_object($order)) $this->update_status();
+      $this->form_paypal_url = 'https://' . MODULE_PAYMENT_PAYPAL_DOMAIN . '/cgi-bin/webscr';
+      $this->cc_explain_url = tep_href_link(FILENAME_PAYPAL_INFO, '', 'SSL');
+   }
+
+// catalog payment module class methods
+    function update_status() {
+      global $order;
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+      $img_visa = DIR_WS_MODULES .'payment/paypal/images/visa.gif';
+      $img_mc = DIR_WS_MODULES .'payment/paypal/images/mastercard.gif';
+      $img_discover = DIR_WS_MODULES .'payment/paypal/images/discover.gif';
+      $img_amex = DIR_WS_MODULES .'payment/paypal/images/amex.gif';
+      $img_paypal = DIR_WS_MODULES .'payment/paypal/images/paypal_intl.gif';
+      $jscript_url = '<a style="cursor: pointer; "' . " onclick=\"javascript:popup=window.open(\'" . $this->cc_explain_url . "\',\'popup\',\'scrollbars,resizable,width=625,height=600,left=50,top=50\'); popup.focus(); return false;\">";
+      $cc_explain = '<div style="A.hover{cursor:hand}">' . MODULE_PAYMENT_PAYPAL_CC_DESCRIPTION .'&nbsp;' .
+                    "<script>document.writeln('" . $jscript_url .
+                    MODULE_PAYMENT_PAYPAL_CC_URL_TEXT . "</a>');</script>" .
+                    '<noscript><a href="' . $this->cc_explain_url . '" target="_blank">' .
+                    MODULE_PAYMENT_PAYPAL_CC_URL_TEXT . '</noscript>' ."\n".'</div>';
+      $paypal_cc_txt = sprintf(MODULE_PAYMENT_PAYPAL_CC_TEXT,
+                              tep_image($img_visa,' Visa ','','','align="absmiddle"'),
+                              tep_image($img_mc,' MasterCard ','','','align="absmiddle"'),
+                              tep_image($img_discover,' Discover ','','','align="absmiddle"'),
+                              tep_image($img_amex,' American Express ','','','align="absmiddle"'),
+                              tep_image($img_paypal,' PayPal ','','','align="absmiddle"')
+                             );
+      $fields[] = array('title' => '', //MODULE_PAYMENT_PAYPAL_TEXT_TITLE,
+                        'field' => '<div><b>' . $paypal_cc_txt . '</b></div>' . $cc_explain );
+      return array('id' => $this->code,
+                   'module' => $this->title,
+                   'fields' => $fields);
+    }
+
+    function pre_confirmation_check() {
+      return false;
+    }
+
+    function confirmation() {
+      return false;
+    }
+
+    function currency() {
+      global $currency;
+      if(!isset($this->currency)) {
+        if (MODULE_PAYMENT_PAYPAL_CURRENCY == 'Selected Currency') {
+          $this->currency = $currency;
+        } else {
+          $this->currency = substr(MODULE_PAYMENT_PAYPAL_CURRENCY, 5);
+        }
+        if (!in_array($this->currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD', 'AUD'))) {
+          $this->currency = MODULE_PAYMENT_PAYPAL_DEFAULT_CURRENCY;
+        }
+      }
+      return $this->currency;
+    }
+
+    //Returns the gross total amount to compare with paypal.mc_gross
+    function grossPaymentAmount($my_currency) {
+      global $order, $currencies;
+      return number_format(($order->info['total']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+    }
+
+    function amount($my_currency) {
+      global $order, $currencies;
+      return number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
+    }
+
+    function process_button() {
+      return false;
+    }
+
+    function before_process() {
+      if(!class_exists('PayPal_osC')) include_once(DIR_WS_MODULES . 'payment/paypal/classes/osC/osC.class.php');
+      if (PayPal_osC::check_order_status()) {
+        tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'));
+      } else {
+        include(DIR_WS_MODULES . 'payment/paypal/catalog/checkout_process.inc.php');
+      }
+      exit;
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function output_error() {
+      return false;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPal Module', 'MODULE_PAYMENT_PAYPAL_STATUS', 'True', 'Do you want to accept PayPal payments?&nbsp;<a style=\"color: #0033cc;\" href=\"" . tep_href_link(FILENAME_PAYPAL, 'action=help', 'NONSSL') . "\" target=\"paypalHelp\">[Help]</a>', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('E-Mail Address', 'MODULE_PAYMENT_PAYPAL_ID','".STORE_OWNER_EMAIL_ADDRESS."', 'The e-mail address to use for the PayPal service', '6', '1', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Business ID', 'MODULE_PAYMENT_PAYPAL_BUSINESS_ID','".STORE_OWNER_EMAIL_ADDRESS."', 'Email address or account ID of the payment recipient', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Default Currency', 'MODULE_PAYMENT_PAYPAL_DEFAULT_CURRENCY', 'USD', 'The <b>default</b> currency to use for when the customer chooses to checkout via the store using a currency not supported by PayPal.<br />(This currency must exist in your store)', '6', '0', 'tep_cfg_select_option(array(\'USD\',\'CAD\',\'EUR\',\'GBP\',\'JPY\',\'AUD\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PAYPAL_CURRENCY', 'Selected Currency', 'The currency to use for credit card transactions', '6', '3', 'tep_cfg_select_option(array(\'Selected Currency\',\'Only USD\',\'Only CAD\',\'Only EUR\',\'Only GBP\',\'Only JPY\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPAL_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '4', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Pending Notification Status', 'MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID .  "', 'Set the Pending Notification status of orders made with this payment module to this value (\'Pending\' recommended)', '6', '5', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID . "', 'Set the status of orders made with this payment module to this value<br>(\'Processing\' recommended)', '6', '6', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set On Hold Order Status', 'MODULE_PAYMENT_PAYPAL_ORDER_ONHOLD_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID . "', 'Set the status of <b>On Hold</b> orders made with this payment module to this value', '6', '7', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Canceled Order Status', 'MODULE_PAYMENT_PAYPAL_ORDER_CANCELED_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID . "', 'Set the status of <b>Canceled</b> orders made with this payment module to this value', '6', '8', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Synchronize Invoice', 'MODULE_PAYMENT_PAYPAL_INVOICE_REQUIRED', 'False', 'Do you want to specify the order number as the PayPal invoice number?', '6', '9', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_SORT_ORDER', '100', 'Sort order of display. Lowest is displayed first.', '6', '10', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Refunded Order Status', 'MODULE_PAYMENT_PAYPAL_ORDER_REFUNDED_STATUS_ID', '" . DEFAULT_ORDERS_STATUS_ID . "', 'Set the status of <b>Refunded</b> orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Background Color', 'MODULE_PAYMENT_PAYPAL_CS', 'White', 'Select the background color of PayPal\'s payment pages.', '6', '11', 'tep_cfg_select_option(array(\'White\',\'Black\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Processing logo', 'MODULE_PAYMENT_PAYPAL_PROCESSING_LOGO', 'oscommerce.gif', 'The image file name to display the store\'s checkout process', '6', '12', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Store logo', 'MODULE_PAYMENT_PAYPAL_STORE_LOGO', '', 'The image file name for PayPal to display (leave empty if your store does not have SSL)', '6', '13', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayPal Page Style Name', 'MODULE_PAYMENT_PAYPAL_PAGE_STYLE', 'default', 'The name of the page style you have configured in your PayPal Account', '6', '14', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Include a note with payment', 'MODULE_PAYMENT_PAYPAL_NO_NOTE', 'No', 'Choose whether your customer should be prompted to include a note or not?', '6', '15', 'tep_cfg_select_option(array(\'Yes\',\'No\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Shopping Cart Method', 'MODULE_PAYMENT_PAYPAL_METHOD', 'Aggregate', 'What type of shopping cart do you want to use?', '6', '16', 'tep_cfg_select_option(array(\'Aggregate\',\'Itemized\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPal Shipping Address', 'MODULE_PAYMENT_PAYPAL_SHIPPING_ALLOWED', 'No', 'Allow the customer to choose their own PayPal shipping address?', '6', '17', 'tep_cfg_select_option(array(\'Yes\',\'No\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Email Notifications', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG', 'Yes', 'Enable debug email notifications', '6', '18', 'tep_cfg_select_option(array(\'Yes\',\'No\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Digest Key', 'MODULE_PAYMENT_PAYPAL_IPN_DIGEST_KEY', 'PayPal_Shopping_Cart_IPN', 'Key to use for the digest functionality', '6', '19', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Test Mode', 'MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE', 'Off', 'Set test mode <a style=\"color: #0033cc;\" href=\"" . tep_href_link(FILENAME_PAYPAL, 'action=itp') . "\" target=\"ipn\">[IPN Test Panel]</a>', '6', '20', 'tep_cfg_select_option(array(\'Off\',\'On\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Cart Test', 'MODULE_PAYMENT_PAYPAL_IPN_CART_TEST', 'On', 'Set cart test mode to verify the transaction amounts', '6', '21', 'tep_cfg_select_option(array(\'Off\',\'On\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Debug Email Notification Address', 'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL','".STORE_OWNER_EMAIL_ADDRESS."', 'The e-mail address to send <b>debug</b> notifications to', '6', '22', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('PayPal Domain', 'MODULE_PAYMENT_PAYPAL_DOMAIN', 'www.paypal.com', 'Select which PayPal domain to use<br>(for live production select www.paypal.com)', '6', '23', 'tep_cfg_select_option(array(\'www.paypal.com\',\'www.sandbox.paypal.com\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Return URL behavior', 'MODULE_PAYMENT_PAYPAL_RM', '1', 'How should the customer be sent back from PayPal to the specified URL?<br>0=No IPN, 1=GET, 2=POST', '6', '24', 'tep_cfg_select_option(array(\'0\',\'1\',\'2\'), ', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array(
+          'MODULE_PAYMENT_PAYPAL_STATUS',
+          'MODULE_PAYMENT_PAYPAL_ID',
+          'MODULE_PAYMENT_PAYPAL_BUSINESS_ID',
+          'MODULE_PAYMENT_PAYPAL_DEFAULT_CURRENCY',
+          'MODULE_PAYMENT_PAYPAL_CURRENCY',
+          'MODULE_PAYMENT_PAYPAL_ZONE',
+          'MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID',
+          'MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID',
+          'MODULE_PAYMENT_PAYPAL_ORDER_ONHOLD_STATUS_ID',
+          'MODULE_PAYMENT_PAYPAL_ORDER_REFUNDED_STATUS_ID',
+          'MODULE_PAYMENT_PAYPAL_ORDER_CANCELED_STATUS_ID',
+          'MODULE_PAYMENT_PAYPAL_INVOICE_REQUIRED',
+          'MODULE_PAYMENT_PAYPAL_SORT_ORDER',
+          'MODULE_PAYMENT_PAYPAL_CS',
+          'MODULE_PAYMENT_PAYPAL_PROCESSING_LOGO',
+          'MODULE_PAYMENT_PAYPAL_STORE_LOGO',
+          'MODULE_PAYMENT_PAYPAL_PAGE_STYLE',
+          'MODULE_PAYMENT_PAYPAL_NO_NOTE',
+          'MODULE_PAYMENT_PAYPAL_METHOD',
+          'MODULE_PAYMENT_PAYPAL_SHIPPING_ALLOWED',
+          'MODULE_PAYMENT_PAYPAL_IPN_DIGEST_KEY',
+          'MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE',
+          'MODULE_PAYMENT_PAYPAL_IPN_CART_TEST',
+          'MODULE_PAYMENT_PAYPAL_IPN_DEBUG',
+          'MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL',
+          'MODULE_PAYMENT_PAYPAL_DOMAIN',
+          'MODULE_PAYMENT_PAYPAL_RM');
+    }
+
+    function setTransactionID() {
+      global $order, $currencies;
+      $my_currency = $this->currency();
+      $trans_id = STORE_NAME . date('Ymdhis');
+      $this->digest = md5($trans_id . number_format($order->info['total'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency), '.', '') . MODULE_PAYMENT_PAYPAL_IPN_DIGEST_KEY);
+      return $this->digest;
+    }
+
+    function formFields($txn_sign = '', $payment_amount = '', $payment_currency = '', $payment_currency_value = '', $orders_id = '', $return_url = '', $cancel_url = '' ) {
+      global $order, $currencies;
+      $my_currency = (tep_not_null($payment_currency)) ? $payment_currency : $this->currency();
+      $my_currency_value = (tep_not_null($payment_currency_value)) ? $payment_currency_value : $currencies->get_value($my_currency);
+      $paypal_fields = tep_draw_hidden_field('cmd', '_ext-enter') . //allows the customer addr details to be passed
+      tep_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_BUSINESS_ID) ;
+      $paypal_fields .= tep_draw_hidden_field('currency_code', $my_currency);
+      if(tep_not_null(MODULE_PAYMENT_PAYPAL_STORE_LOGO)) $paypal_fields .= tep_draw_hidden_field('image_url', tep_href_link(DIR_WS_IMAGES.MODULE_PAYMENT_PAYPAL_STORE_LOGO, '', 'SSL'));
+      $return_href_link = tep_not_null($return_url) ? $return_url : tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=success', 'SSL');
+      $cancel_href_link = tep_not_null($cancel_url) ? $cancel_url : tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL');
+      $paypal_fields .= tep_draw_hidden_field('return', $return_href_link);
+      $paypal_fields .= tep_draw_hidden_field('cancel_return', $cancel_href_link) .
+      tep_draw_hidden_field('notify_url', tep_href_link(FILENAME_IPN, '', 'SSL',false));
+     if(MODULE_PAYMENT_PAYPAL_SHIPPING_ALLOWED == 'No' ) $paypal_fields .= tep_draw_hidden_field('no_shipping', '1' );
+      //$paypal_fields .= tep_draw_hidden_field('address_override', '1' );
+     if(MODULE_PAYMENT_PAYPAL_METHOD == 'Itemized') {
+        $paypal_fields .= tep_draw_hidden_field('upload', sizeof($order->products)) .
+        tep_draw_hidden_field('redirect_cmd', '_cart') .
+        tep_draw_hidden_field('handling_cart', number_format($order->info['shipping_cost'] * $my_currency_value, $currencies->get_decimal_places($my_currency)));
+        //Let PayPal Calculate the amount since we're essentially uploading a shopping cart
+        //tep_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $my_currency_value, $currencies->get_decimal_places($my_currency)));
+      } else {
+        $paypal_fields .= tep_draw_hidden_field('item_name', STORE_NAME) .
+        tep_draw_hidden_field('redirect_cmd', '_xclick');
+        $amount = tep_not_null($payment_amount) ? $payment_amount : $this->amount($my_currency);
+        $paypal_fields .= tep_draw_hidden_field('amount', $amount) .
+        tep_draw_hidden_field('shipping', number_format($order->info['shipping_cost'] * $my_currency_value, $currencies->get_decimal_places($my_currency)));
+      }
+
+      //See Manual: 0= No IPN, 1 = GET, 2 = POST
+      $paypal_fields .= tep_draw_hidden_field('rm', MODULE_PAYMENT_PAYPAL_RM);
+      $invoice_id = (tep_not_null($orders_id)) ? $orders_id : $this->orders_id;
+      $signature = (tep_not_null($txn_sign)) ? $txn_sign : $this->digest;
+      $paypal_fields .= tep_draw_hidden_field('custom', $signature);
+      if(MODULE_PAYMENT_PAYPAL_INVOICE_REQUIRED == 'True') $paypal_fields .= tep_draw_hidden_field('invoice', $invoice_id);
+      $paypal_fields .= $this->customerDetailsFields($order) .
+      //Customer comment field
+      $this->noteOptionFields(MODULE_PAYMENT_PAYPAL_NO_NOTE , MODULE_PAYMENT_PAYPAL_CUSTOMER_COMMENTS) .
+      //PayPal Background Color
+      tep_draw_hidden_field('cs',(MODULE_PAYMENT_PAYPAL_CS == 'White') ? '0' : '1') ;
+      if(tep_not_null(MODULE_PAYMENT_PAYPAL_PAGE_STYLE)) $paypal_fields .= tep_draw_hidden_field('page_style',MODULE_PAYMENT_PAYPAL_PAGE_STYLE);
+      if(MODULE_PAYMENT_PAYPAL_METHOD == 'Itemized') {
+        //Itemized Order Details
+        for ($i=0; $i<sizeof($order->products); $i++) {
+          $index = $i+1;
+          $paypal_fields .= tep_draw_hidden_field('item_name_'.$index, $order->products[$i]['name']).
+          tep_draw_hidden_field('item_number_'.$index, $order->products[$i]['model']).
+          tep_draw_hidden_field('quantity_'.$index, $order->products[$i]['qty']).
+          tep_draw_hidden_field('amount_'.$index, number_format($order->products[$i]['final_price']* $my_currency_value,2));
+          $tax = ($order->products[$i]['final_price'] * ($order->products[$i]['tax'] / 100)) * $my_currency_value;
+          $paypal_fields .= tep_draw_hidden_field('tax_'.$index, number_format($tax, 2));
+          //Customer Specified Product Options: PayPal Max = 2
+          if ($order->products[$i]['attributes']) {
+            for ($j=0, $n=sizeof($order->products[$i]['attributes']); $j<2; $j++) {
+              if($order->products[$i]['attributes'][$j]['option']){
+                $paypal_fields .= $this->optionSetFields($j,$index,$order->products[$i]['attributes'][$j]['option'],$order->products[$i]['attributes'][$j]['value']);
+              } else {
+                $paypal_fields .= $this->optionSetFields($j,$index);
+              }
+            }
+          } else {
+            for ($j=0; $j<2; $j++) {
+              $paypal_fields .= $this->optionSetFields($j,$index);
+            }
+          }
+        }
+      } else { //method 1
+        $item_number;
+        for ($i=0; $i<sizeof($order->products); $i++) {
+          $item_number .= ' '.$order->products[$i]['name'].' ,';
+        }
+        $item_number = substr_replace($item_number,'',-2);
+        $paypal_fields .= tep_draw_hidden_field('item_number', $item_number);
+      }
+      return $paypal_fields;
+    }
+
+    function customerDetailsFields(&$order) {
+      //Customer Details - for those who haven't signed up to PayPal
+      $paypal_fields = tep_draw_hidden_field('email', $order->customer['email_address']) .
+      tep_draw_hidden_field('first_name', $order->billing['firstname']) .
+      tep_draw_hidden_field('last_name', $order->billing['lastname']) .
+      tep_draw_hidden_field('address1', $order->billing['street_address']) .
+      tep_draw_hidden_field('address2', $order->billing['suburb']) .
+      tep_draw_hidden_field('city', $order->billing['city']) .
+      //tep_draw_hidden_field('state', tep_get_zone_code($order->billing['country']['id'],$order->billing['zone_id'],$order->billing['zone_id'])) .
+      tep_draw_hidden_field('state', $order->billing['state']) .
+      tep_draw_hidden_field('zip', $order->billing['postcode']);
+
+      //User Country Preference
+      //Note: Anguilla[AI], Dominican Republic[DO], The Netherlands[NL] have different codes to the iso codes in the osC db
+      $paypal_fields .= tep_draw_hidden_field('lc', $order->billing['country']['iso_code_2']);
+      //Telephone is problematic.
+      /*//OMITTED SINCE NOT SPECIFICALLY BILLING ADDRESS RELATED
+        $telephone = preg_replace('/\D/', '', $order->customer['telephone']);
+        $paypal_fields .= tep_draw_hidden_field('night_phone_a',substr($telephone,0,3));
+        $paypal_fields .= tep_draw_hidden_field('night_phone_b',substr($telephone,3,3));
+        $paypal_fields .= tep_draw_hidden_field('night_phone_c',substr($telephone,6,4));
+        $paypal_fields .= tep_draw_hidden_field('day_phone_a',substr($telephone,0,3));
+        $paypal_fields .= tep_draw_hidden_field('day_phone_b',substr($telephone,3,3));
+        $paypal_fields .= tep_draw_hidden_field('day_phone_c',substr($telephone,6,4));
+      */
+      return $paypal_fields;
+    }
+
+    function optionSetFields($sub_index,$index,$option=' ',$value=' ') {
+      return tep_draw_hidden_field('on'.$sub_index.'_'.$index,$option).
+        tep_draw_hidden_field('os'.$sub_index.'_'.$index,$value);
+    }
+
+    function noteOptionFields($option='No',$msg='Add Comments About Your Order') {
+      $option = ($option == 'Yes') ? '0': '1';
+      $no_note = tep_draw_hidden_field('no_note',$option);
+      if (!$option) return $no_note .= tep_draw_hidden_field('cn',$msg);
+      else return $no_note;
+    }
+
+    function sendMoneyFields(&$order, $orders_id) {
+      include_once(DIR_WS_MODULES . 'payment/paypal/database_tables.inc.php');
+      $orders_session_query = tep_db_query("select firstname, lastname, payment_amount, payment_currency, payment_currency_val, txn_signature from " . TABLE_ORDERS_SESSION_INFO . " where orders_id ='" . (int)$orders_id . "'");
+      $orders_session_info = tep_db_fetch_array($orders_session_query);
+      $order->billing['firstname'] = $orders_session_info['firstname'];
+      $order->billing['lastname'] = $orders_session_info['lastname'];
+      $return_href_link = tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id='.$orders_id, 'SSL');
+      $cancel_href_link = $return_href_link;
+      return $this->formFields($orders_session_info['txn_signature'], $orders_session_info['payment_amount'], $orders_session_info['payment_currency'], $orders_session_info['payment_currency_val'], $orders_id, $return_href_link, $cancel_href_link);
+    }
+  }//end class
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal_dp.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal_dp.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal_dp.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,472 @@
+<?php
+/*
+  paypal_dp.php, v 1.0 09/06/2005
+
+  Copyright (c) 2005 POSTOSC.COM
+
+  Released under the GNU General Public License
+
+  Absolutely no warranty. Use at your own risk.
+*/
+
+include_once(realpath(dirname(__FILE__) . '/../../../pear/configure.php'));
+  
+class paypal_dp {
+  var $code, $title, $description, $enabled;
+
+  function paypal_dp() {
+    global $order;
+
+    $this->code = 'paypal_dp';
+    $this->title = MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE;
+    $this->description = MODULE_PAYMENT_PAYPAL_DP_TEXT_DESCRIPTION;
+    $this->sort_order = MODULE_PAYMENT_PAYPAL_DP_SORT_ORDER;
+    $this->enabled = ((MODULE_PAYMENT_PAYPAL_DP_STATUS == 'True') ? true : false);
+
+    if((int)MODULE_PAYMENT_PAYPAL_DP_ORDER_STATUS_ID > 0) $this->order_status = MODULE_PAYMENT_PAYPAL_DP_ORDER_STATUS_ID;
+    if(is_object($order)) $this->update_status();
+  }
+
+  function update_status() {
+    global $order;
+
+    if(($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_DP_ZONE > 0)) {
+      $check_flag = false;
+      $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_DP_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+
+      while($check = tep_db_fetch_array($check_query)) {
+        if($check['zone_id'] < 1) {
+          $check_flag = true;
+          break;
+        } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+          $check_flag = true;
+          break;
+        }
+      }
+
+      if($check_flag == false) {
+        $this->enabled = false;
+      }
+    }
+  }
+
+    function javascript_validation() {
+    $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+      '    var paypal_cc_firstname = document.checkout_payment.paypal_cc_firstname.value;' . "\n" .
+      '    var paypal_cc_lastname = document.checkout_payment.paypal_cc_lastname.value;' . "\n" .
+      '    var paypal_cc_number = document.checkout_payment.paypal_cc_number.value;' . "\n" .
+      '    var paypal_cc_cvv2 = document.checkout_payment.paypal_cc_cvv2.value;' . "\n" .
+      '    if (paypal_cc_firstname == "" || paypal_cc_firstname.length < ' . ENTRY_FIRST_NAME_MIN_LENGTH . ') {' . "\n" .
+      '      error_message = error_message + "' . MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_FIRSTNAME . '";' . "\n" .
+      '      error = 1;' . "\n" .
+      '    }' . "\n" .
+      '    if (paypal_cc_lastname == "" || paypal_cc_lastname.length < ' . ENTRY_LAST_NAME_MIN_LENGTH . ') {' . "\n" .
+      '      error_message = error_message + "' . MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_LASTNAME . '";' . "\n" .
+      '      error = 1;' . "\n" .
+      '    }' . "\n" .
+      '    if (paypal_cc_number == "" || paypal_cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+      '      error_message = error_message + "' . MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_NUMBER . '";' . "\n" .
+      '      error = 1;' . "\n" .
+      '    }' . "\n" .
+      '    if (paypal_cc_cvv2.length > 4) {' . "\n" .
+      '      error_message = error_message + "' . MODULE_PAYMENT_PAYPAL_DP_TEXT_JS_CC_CVV2 . '";' . "\n" .
+      '      error = 1;' . "\n" .
+      '    }' . "\n" .
+      '  }' . "\n";
+
+    return $js;
+  }
+
+  function selection() {
+    global $order;
+
+    for($i = 1; $i < 13; $i++) {
+      $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+    }
+
+    $today = getdate();
+    
+    for($i = $today['year']; $i < $today['year'] + 10; $i++) {
+      $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+    }
+
+    $selection = array('id' => $this->code,
+                     'module' => MODULE_PAYMENT_PAYPAL_DP_IMAGE_DESCRIPTION,
+                     'fields' => array(array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_FIRSTNAME,
+                                             'field' => tep_draw_input_field('paypal_cc_firstname', $order->billing['firstname'])),
+                       array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_LASTNAME,
+                                             'field' => tep_draw_input_field('paypal_cc_lastname', $order->billing['lastname'])),
+                                       array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER,
+                                             'field' => tep_draw_input_field('paypal_cc_number')),
+                                       array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_CVV2,
+                                             'field' => tep_draw_input_field('paypal_cc_cvv2')),
+                       array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_EXPIRES,
+                                             'field' => tep_draw_pull_down_menu('paypal_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('paypal_cc_expires_year', $expires_year))));
+
+    return $selection;
+    }
+
+    function pre_confirmation_check() {
+    global $HTTP_POST_VARS, $order;
+
+    include(DIR_WS_CLASSES . 'cc_validation1.php');
+
+    $cc_validation = new cc_validation();
+    $result = $cc_validation->validate($HTTP_POST_VARS['paypal_cc_number'], $HTTP_POST_VARS['paypal_cc_expires_month'], $HTTP_POST_VARS['paypal_cc_expires_year']);
+
+    $error = '';
+    
+    switch($result) {
+      case -1:
+        $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+        break;
+      case -2:
+      case -3:
+      case -4:
+        $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+        break;
+      case false:
+        $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+        break;
+    }
+
+    if(($result == false) || ($result < 1)) {
+      $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['paypal_cc_owner']) . '&cc_expires_month=' . $HTTP_POST_VARS['paypal_cc_expires_month'] . '&cc_expires_year=' . $HTTP_POST_VARS['paypal_cc_expires_year'];
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+    }
+
+    switch($cc_validation->cc_type) {
+      case 'Master Card':
+        $this->cc_card_type = 'MasterCard';
+        break;
+      case 'Mastercard':
+        $this->cc_card_type = 'MasterCard';
+        break;
+      case 'American Express':
+        $this->cc_card_type = 'Amex';
+        break;
+      default:
+        $this->cc_card_type = $cc_validation->cc_type; // Visa, Discover
+        break;
+    }
+
+    $this->cc_card_number = $cc_validation->cc_number;
+    $this->cc_expires_month = $cc_validation->cc_expiry_month;
+    $this->cc_expires_year = $cc_validation->cc_expiry_year;
+    //$this->cc_cvv2 = $HTTP_POST_VARS['cc_cvv2'];
+
+  }
+
+    function confirmation() {
+    global $HTTP_POST_VARS;
+
+    $confirmation = array('title' => MODULE_PAYMENT_PAYPAL_DP_CLIENT_DESCRIPTION . ': ' . $this->cc_card_type,
+                        'fields' => array(array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_FIRSTNAME,
+                                                'field' => $HTTP_POST_VARS['paypal_cc_firstname']),
+                                  array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_LASTNAME,
+                                                'field' => $HTTP_POST_VARS['paypal_cc_lastname']),
+                        array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_NUMBER,
+                                                'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                          array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_CVV2,
+                                                'field' => $HTTP_POST_VARS['paypal_cc_cvv2']),
+                                          array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_EXPIRES,
+                                                'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['paypal_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['paypal_cc_expires_year'])))));
+
+    return $confirmation;
+    }
+
+    function process_button() {
+    global $HTTP_POST_VARS;
+    $process_button_string = tep_draw_hidden_field('paypal_cc_firstname', $HTTP_POST_VARS['paypal_cc_firstname']) .
+                 tep_draw_hidden_field('paypal_cc_lastname', $HTTP_POST_VARS['paypal_cc_lastname']) .
+                           tep_draw_hidden_field('paypal_cc_expires_month', $this->cc_expires_month) .
+                           tep_draw_hidden_field('paypal_cc_expires_year', $this->cc_expires_year) .
+                           tep_draw_hidden_field('paypal_cc_type', $this->cc_card_type) .
+                           tep_draw_hidden_field('paypal_cc_number', $this->cc_card_number) .
+                 tep_draw_hidden_field('paypal_cc_cvv2', $HTTP_POST_VARS['paypal_cc_cvv2']);
+
+    return $process_button_string;
+    }
+
+    function before_process() {
+    global $HTTP_POST_VARS, $order;
+
+    $order->info['cc_type'] = tep_db_input($HTTP_POST_VARS['paypal_cc_type']);
+    //bug fix module not saving whole credit card number 3/15/2006
+    $order->info['cc_number'] = (int)$HTTP_POST_VARS['paypal_cc_number'];
+    //$order->info['cc_number'] = substr($HTTP_POST_VARS['paypal_cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['paypal_cc_number']) - 8)) . substr($HTTP_POST_VARS['paypal_cc_number'], -4);
+    //end bug fix 3/15 /2006
+    $order->info['cc_owner'] = tep_db_input($HTTP_POST_VARS['paypal_cc_firstname']). ' ' .tep_db_input($HTTP_POST_VARS['paypal_cc_lastname']);
+    //bug fix from standard cre 6.2 paypal_dp.php 3/12/2006
+    //only expires year was being saved to the database
+    $order->info['cc_expires'] = (int)$HTTP_POST_VARS['paypal_cc_expires_month'] . (int)$HTTP_POST_VARS['paypal_cc_expires_year'] ;
+    //end bug fix 3/12/2006
+
+    $this->cc_middle = substr($HTTP_POST_VARS['paypal_cc_number'], 4, strlen($HTTP_POST_VARS['paypal_cc_number']) - 8);
+    $this->cc_expires_month = (int)$HTTP_POST_VARS['paypal_cc_expires_month'];
+    //bug fix from standard cre 6.2 paypal_dp.php 3/12/2006
+    //adding missing cc expires year and CVV number so they are available in
+    //the after_process function
+    $this->cc_expires_year = (int)$HTTP_POST_VARS['paypal_cc_expires_year'];
+    $this->cc_cvv = (int)$HTTP_POST_VARS['paypal_cc_cvv2'];
+    //end bug fix 3/12/2006
+
+    require_once('Services/PayPal.php');
+    require_once('Services/PayPal/Profile/Handler/Array.php');
+    require_once('Services/PayPal/Profile/API.php');
+    require_once('Log.php');
+
+    if(MODULE_PAYMENT_PAYPAL_DP_LOG_LEVEL == 'Debug')
+      $logLevel = PEAR_LOG_DEBUG;
+    elseif(MODULE_PAYMENT_PAYPAL_DP_LOG_LEVEL == 'Off')
+      $logLevel = PEAR_LOG_NONE;
+    else
+      $logLevel = PEAR_LOG_INFO;
+
+    $certfile = MODULE_PAYMENT_PAYPAL_DP_CERT_FILE;
+    $certpass = '';
+    $apiusername = MODULE_PAYMENT_PAYPAL_DP_USERNAME;
+    $apipassword = MODULE_PAYMENT_PAYPAL_DP_PASSWORD;
+    $subject = '';
+    $environment = MODULE_PAYMENT_PAYPAL_DP_GATEWAY_SERVER;
+
+    $handler =& ProfileHandler_Array::getInstance(array(
+      'username' => $apiusername,
+        'certificateFile' => $certfile,
+        'subject' => $subject,
+        'environment' => $environment));
+
+    $profile =& APIProfile::getInstance($apiusername, $handler);
+    $profile->setAPIPassword($apipassword);
+
+    $caller =& Services_PayPal::getCallerServices($profile, $logLevel, MODULE_PAYMENT_PAYPAL_DP_LOG_DIR);
+
+    if(Services_PayPal::isError($caller)) {
+      // print $caller->getMessage();
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_PAYPAL_DP_TEXT_PROCESS_ERROR), 'SSL', true, false));
+    }
+
+    $name =& Services_PayPal::getType('PersonNameType');
+    $name->setFirstName(tep_db_input($HTTP_POST_VARS['paypal_cc_firstname']));
+    $name->setLastName(tep_db_input($HTTP_POST_VARS['paypal_cc_lastname']));
+
+    if($order->billing['zone_id']) {
+      $zone_query = tep_db_query("select zone_code from ". TABLE_ZONES . " where zone_id = '".$order->billing['zone_id']."'");
+      $zone = tep_db_fetch_array($zone_query);
+      $state = $zone['zone_code'];
+    } else {
+      $state = $order->billing['state'];
+    }
+
+    $address =& Services_PayPal::getType('AddressType');
+    $address->setStreet1($order->billing['street_address']);
+    $address->setCityName($order->billing['city']);
+    $address->setStateOrProvince($state);
+    $address->setCountry($order->billing['country']['iso_code_2']);
+    $address->setPostalCode($order->billing['postcode']);
+
+    $payer =& Services_PayPal::getType('PayerInfoType');
+    $payer->setPayer($order->customer['email_address']);
+    //$payer->setPayerID($order->customer['email_address']);
+    //$payer->setPayerStatus('verified');
+    $payer->setPayerName($name);
+    //$payer->setPayerCountry($order->billing['country']['iso_code_2']);
+    $payer->setAddress($address);
+
+    $cc =& Services_PayPal::getType('CreditCardDetailsType');
+    $cc->setCreditCardType(tep_db_input($HTTP_POST_VARS['paypal_cc_type']));
+    $cc->setCreditCardNumber($HTTP_POST_VARS['paypal_cc_number']);
+    $cc->setExpMonth((int)$HTTP_POST_VARS['paypal_cc_expires_month']);
+    $cc->setExpYear((int)$HTTP_POST_VARS['paypal_cc_expires_year']);
+    $cc->setCVV2((int)$HTTP_POST_VARS['paypal_cc_cvv2']);
+    $cc->setCardOwner($payer);
+
+    $pdt =& Services_PayPal::getType('PaymentDetailsType');
+
+    $order_total =& Services_PayPal::getType('BasicAmountType');
+    $order_total->setval(number_format($order->info['total'], 2));
+    $order_total->setattr('currencyID', $order->info['currency']);
+    $pdt->setOrderTotal($order_total);
+
+    if($order->info['total'] == ($order->info['subtotal'] + $order->info['shipping_cost']+ $order->info['tax'])) {
+      $item_total =& Services_PayPal::getType('BasicAmountType');
+      $item_total->setval(number_format($order->info['subtotal'], 2));
+      $item_total->setattr('currencyID', $order->info['currency']);
+
+      $ship_total =& Services_PayPal::getType('BasicAmountType');
+      $ship_total->setval(number_format($order->info['shipping_cost'], 2));
+      $ship_total->setattr('currencyID', $order->info['currency']);
+
+      $tax_total =& Services_PayPal::getType('BasicAmountType');
+      $tax_total->setval(number_format($order->info['tax'], 2));
+      $tax_total->setattr('currencyID', $order->info['currency']);
+
+      $pdt->setItemTotal($item_total);
+      $pdt->setShippingTotal($ship_total);
+      //$pdt->setHandlingTotal($handling_total);
+      $pdt->setTaxTotal($tax_total);
+/*
+      $payment_item = array();
+      $item_tax = 0;
+      $item_amount = 0;
+
+      for($i = 0; $i < sizeof($order->products); $i++) {
+        $payment_item[$i] =& Services_PayPal::getType('PaymentDetailsItemType');
+        $payment_item[$i]->setName($order->products[$i]['name']);
+        $amount =& Services_PayPal::getType('BasicAmountType');
+        $amount->setval(number_format($order->products[$i]['final_price'], 2));
+        $amount->setattr('currencyID', $order->info['currency']);
+        $payment_item[$i]->setAmount($amount);
+        $payment_item[$i]->setNumber($order->products[$i]['id']);
+        $payment_item[$i]->setQuantity($order->products[$i]['qty']);
+        $tax =& Services_PayPal::getType('BasicAmountType');
+        $tax->setval(number_format($order->products[$i]['tax'], 2));
+        $tax->setattr('currencyID', $order->info['currency']);
+        $payment_item[$i]->setTax($tax);
+        //$payment_item[$i]->setSalesTax(number_format($order->products[$i]['tax'], 2));
+        $item_amount += $order->products[$i]['final_price'] * $order->products[$i]['qty'];
+        $item_tax += $order->products[$i]['tax'] * $order->products[$i]['qty'];
+      }
+
+      if($item_amount == $order->info['subtotal'] && $item_tax == $order->info['tax']) {
+        $pdt->setPaymentDetailsItem($payment_item);
+      }*/
+    }
+
+    if($order->delivery['zone_id']) {
+      $zone_query = tep_db_query("select zone_code from ". TABLE_ZONES . " where zone_id = '".$order->delivery['zone_id']."'");
+      $zone = tep_db_fetch_array($zone_query);
+      $ship2state = $zone['zone_code'];
+    } else {
+      $ship2state = $order->delivery['state'];
+    }
+
+    if(($order->delivery['firstname'] || $order->delivery['lastname']) &&
+      $order->delivery['street_address'] && $order->delivery['city'] &&
+      $order->delivery['country']['iso_code_2']) {
+      $ship2address =& Services_PayPal::getType('AddressType');
+      $ship2address->setName($order->delivery['firstname'].' '.$order->delivery['lastname']);
+      $ship2address->setStreet1($order->delivery['street_address']);
+      $ship2address->setCityName($order->delivery['city']);
+      $ship2address->setStateOrProvince($ship2state);
+      $ship2address->setCountry($order->delivery['country']['iso_code_2']);
+      $ship2address->setPostalCode($order->delivery['postcode']);
+
+      $pdt->setShipToAddress($ship2address);
+    }
+    
+    $pdt->setButtonSource(POSTOSC_PRODUCT_NAME);
+
+    $details =& Services_PayPal::getType('DoDirectPaymentRequestDetailsType');
+    $details->setPaymentAction(MODULE_PAYMENT_PAYPAL_DP_PAYMENT_ACTION);
+    $details->setPaymentDetails($pdt);
+    $details->setCreditCard($cc);
+    $details->setIPAddress(getenv('REMOTE_ADDR'));
+    $details->setMerchantSessionId(tep_session_id());
+
+    $ddp =& Services_PayPal::getType('DoDirectPaymentRequestType');
+    $ddp->setDoDirectPaymentRequestDetails($details);
+
+    $response = $caller->DoDirectPayment($ddp);
+
+    if(Services_PayPal::isError($response)) {
+      $msg           = $response->getErrors();
+      $shortMessage  = $msg->getShortMessage();
+      $longMessage   = $msg->getLongMessage();
+      $errorCode     = $msg->getErrorCode();
+      if (MODULE_PAYMENT_PAYPAL_DP_FAILURE_EMAIL == 'No') {
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode($shortMessage.' ('.$errorCode.')  - '.$longMessage), 'SSL', true, false));
+      } else {
+        //$this->order_status = MODULE_PAYMENT_PAYPAL_DP_FAILURE_STATUS;
+        //bug fix from standard cre 6.2 3/12/2006
+        //not sure if the other set order_status code above is needed. it does not seem to do anything
+        //so I have commented it out
+        $order->info['order_status'] = MODULE_PAYMENT_PAYPAL_DP_FAILURE_STATUS;
+        //end bug fix 3/12/2006
+      }
+    } elseif($response->getAck() != 'Success' && $response->getAck() != 'SuccessWithWarning') {
+      $msg           = $response->getErrors();
+      $shortMessage  = $msg->getShortMessage();
+      $longMessage   = $msg->getLongMessage();
+      $errorCode     = $msg->getErrorCode();
+      if (MODULE_PAYMENT_PAYPAL_DP_FAILURE_EMAIL == 'No') {
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode($shortMessage.' ('.$errorCode.')  - '.$longMessage), 'SSL', true, false));
+      } else {
+        //$this->order_status = MODULE_PAYMENT_PAYPAL_DP_FAILURE_STATUS;
+        //bug fix from standard cre 6.2 3/12/2006
+        //not sure if the other set order_status code above is needed. it does not seem to do anything
+        //so I have commented it out
+        $order->info['order_status'] = MODULE_PAYMENT_PAYPAL_DP_FAILURE_STATUS;
+        //end bug fix 3/12/2006
+      }
+    } else {
+      //$details = $response->getDoDirectPaymentResponseDetails();
+      $this->trans_id = $response->getTransactionID();
+      $this->avs = $response->getAVSCode();
+      $this->cvv2 = $response->getCVV2Code();
+    }
+    }
+
+    function after_process() {
+    global $insert_id;
+
+    if($this->trans_id) {
+      tep_db_query("update ".TABLE_ORDERS_STATUS_HISTORY. " set comments = concat(if(trim(comments) != '', concat(trim(comments), '\n'), ''), 'Transaction ID: ".$this->trans_id."\nPayment Type: credit card\nPayment Status: Completed\nAVS Code: ".$this->avs."\nCVV2 Code: ".$this->cvv2."') where orders_id = ".$insert_id);
+    } elseif (MODULE_PAYMENT_PAYPAL_DP_FAILURE_EMAIL == 'Yes') {
+      $email_order = "Order#: ".$insert_id."\n\r";
+      $email_order .= "Card Middile Number: ".$this->cc_middle."\n\r";
+      //bug fix from standard 6.2 paypal_db.php 3/12/2006
+      //adding expires year to manual processing e-mail
+      $email_order .= "Card Expires Month: ".$this->cc_expires_month . "/" . $this->cc_expires_year ."\n\r";
+      //note per Visa / MC rules you are not supposed to store the CVV number.
+      //Storing the number anywhere could result in loss of your ability to accept
+      //credit cards. Uncomment this line at your own risk.
+      $email_order .= "CVV: ".$this->cc_cvv;
+      //end bug fix 3/12/2006
+      tep_mail('', STORE_OWNER_EMAIL_ADDRESS, 'Order Failure', $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+    }
+  }
+
+    function get_error() {
+    global $HTTP_GET_VARS;
+
+    $error = array('title' => MODULE_PAYMENT_PAYPAL_DP_TEXT_ERROR,
+                 'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+    return $error;
+    }
+
+    function check() {
+    if(!isset($this->_check)) {
+      $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_DP_STATUS'");
+      $this->_check = tep_db_num_rows($check_query);
+    }
+    
+    return $this->_check;
+    }
+
+    function install() {
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPal Direct Payment Module', 'MODULE_PAYMENT_PAYPAL_DP_STATUS', 'True', 'Do you want to accept credit card payments through PayPal Direct Payment?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_DP_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '1' , now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPAL_DP_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPAL_DP_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value.', '6', '3', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Gateway Server', 'MODULE_PAYMENT_PAYPAL_DP_GATEWAY_SERVER', 'Sandbox', 'Use the testing (sandbox) or live gateway server for transactions?', '6', '4', 'tep_cfg_select_option(array(\'Sandbox\',\'Live\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Certificate File', 'MODULE_PAYMENT_PAYPAL_DP_CERT_FILE', '', 'Enter the absolute path of your API certificate file.', '6', '5', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Account Username', 'MODULE_PAYMENT_PAYPAL_DP_USERNAME', '', 'Enter your username for PayPal API account.', '6', '6', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Account Password', 'MODULE_PAYMENT_PAYPAL_DP_PASSWORD', '', 'Enter your password for PayPal API account.', '6', '7', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Payment Action', 'MODULE_PAYMENT_PAYPAL_DP_PAYMENT_ACTION', 'Sale', 'Sale or Authorization (Capture later)?', '6', '9',  'tep_cfg_select_option(array(\'Sale\', \'Authorization\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Manual Processing if Failed', 'MODULE_PAYMENT_PAYPAL_DP_FAILURE_EMAIL', 'Yes', 'Do you want to receive credit card information by email if failed?', '6', '10',  'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Order Status if Failed', 'MODULE_PAYMENT_PAYPAL_DP_FAILURE_STATUS', '1', 'Order status for manual processing.', '6', '11', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Log Level', 'MODULE_PAYMENT_PAYPAL_DP_LOG_LEVEL', 'Off', 'Do you want to turn on logging?', '6', '12', 'tep_cfg_select_option(array(\'Debug\', \'Normal\', \'Off\'), ',now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Log Directory', 'MODULE_PAYMENT_PAYPAL_DP_LOG_DIR', '', 'Enter the absolute path to your log directory. It must be writable.', '6', '13', now())");
+  }
+
+    function remove() {
+    tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+  }
+
+    function keys() {
+    return array('MODULE_PAYMENT_PAYPAL_DP_STATUS', 'MODULE_PAYMENT_PAYPAL_DP_ZONE', 'MODULE_PAYMENT_PAYPAL_DP_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_DP_SORT_ORDER', 'MODULE_PAYMENT_PAYPAL_DP_GATEWAY_SERVER', 'MODULE_PAYMENT_PAYPAL_DP_CERT_FILE', 'MODULE_PAYMENT_PAYPAL_DP_USERNAME', 'MODULE_PAYMENT_PAYPAL_DP_PASSWORD', 'MODULE_PAYMENT_PAYPAL_DP_LOG_LEVEL', 'MODULE_PAYMENT_PAYPAL_DP_LOG_DIR', 'MODULE_PAYMENT_PAYPAL_DP_PAYMENT_ACTION', 'MODULE_PAYMENT_PAYPAL_DP_FAILURE_EMAIL', 'MODULE_PAYMENT_PAYPAL_DP_FAILURE_STATUS');
+    }
+}
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/paypal_ec.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/paypal_ec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/paypal_ec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,396 @@
+<?php
+/*
+  paypal_ec.php, v 1.0 09/06/2005
+
+  Copyright (c) 2005 POSTOSC.COM
+
+  Released under the GNU General Public License
+  
+  Absolutely no warranty. Use at your own risk.
+*/
+
+include_once(realpath(dirname(__FILE__) . '/../../../pear/configure.php'));
+
+require_once('Services/PayPal.php');
+require_once('Services/PayPal/Profile/Handler/Array.php');
+require_once('Services/PayPal/Profile/API.php');
+require_once('Log.php');
+
+class paypal_ec {
+  var $code, $title, $description, $enabled, $paypal_url;
+
+  function paypal_ec() {
+    global $order;
+
+    $this->code = 'paypal_ec';
+    $this->title = MODULE_PAYMENT_PAYPAL_EC_TEXT_TITLE;
+    $this->description = MODULE_PAYMENT_PAYPAL_EC_TEXT_DESCRIPTION;
+    $this->sort_order = MODULE_PAYMENT_PAYPAL_EC_SORT_ORDER;
+    $this->enabled = ((MODULE_PAYMENT_PAYPAL_EC_STATUS == 'True') ? true : false);
+
+    if((int)MODULE_PAYMENT_PAYPAL_EC_ORDER_STATUS_ID > 0) $this->order_status = MODULE_PAYMENT_PAYPAL_EC_ORDER_STATUS_ID;
+    if(is_object($order)) $this->update_status();
+
+    if(MODULE_PAYMENT_PAYPAL_EC_GATEWAY_SERVER == 'Live') {
+      $this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';
+    } else {
+      $this->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
+    }
+    }
+    
+  function get_caller() {
+    $certfile = MODULE_PAYMENT_PAYPAL_EC_CERT_FILE;
+    $certpass = '';
+    $apiusername = MODULE_PAYMENT_PAYPAL_EC_USERNAME;
+    $apipassword = MODULE_PAYMENT_PAYPAL_EC_PASSWORD;
+    $subject = '';
+    $environment = MODULE_PAYMENT_PAYPAL_EC_GATEWAY_SERVER;
+
+    $handler =& ProfileHandler_Array::getInstance(array(
+      'username' => $apiusername,
+      'certificateFile' => $certfile,
+      'subject' => $subject,
+      'environment' => $environment));
+
+    $profile =& APIProfile::getInstance($apiusername, $handler);
+    $profile->setAPIPassword($apipassword);
+    $profile->setAPIPassword($apipassword);
+
+    if(MODULE_PAYMENT_PAYPAL_EC_LOG_LEVEL == 'Debug')
+      $logLevel = PEAR_LOG_DEBUG;
+    elseif(MODULE_PAYMENT_PAYPAL_EC_LOG_LEVEL == 'Off')
+      $logLevel = PEAR_LOG_NONE;
+    else
+      $logLevel = PEAR_LOG_INFO;
+
+    $caller =& Services_PayPal::getCallerServices($profile, $logLevel, MODULE_PAYMENT_PAYPAL_EC_LOG_DIR);
+
+    if(Services_PayPal::isError($caller)) {
+      //print "Could not create CallerServices instance: ". $caller->getMessage();
+      $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode(MODULE_PAYMENT_PAYPAL_EC_TEXT_PROCESS_ERROR);
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+    } else {
+      return $caller;
+    }
+  }
+  
+  function update_status() {
+    global $order;
+
+    if(($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_EC_ZONE > 0)) {
+      $check_flag = false;
+      $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_EC_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+
+      while($check = tep_db_fetch_array($check_query)) {
+          if($check['zone_id'] < 1) {
+          $check_flag = true;
+          break;
+          } elseif($check['zone_id'] == $order->billing['zone_id']) {
+          $check_flag = true;
+          break;
+          }
+      }
+
+      if($check_flag == false) {
+        $this->enabled = false;
+      }
+    }
+    }
+
+    function javascript_validation() {
+    return false;
+    }
+
+    function selection() {
+    return array('id' => $this->code,
+          'module' => MODULE_PAYMENT_PAYPAL_EC_IMAGE_DESCRIPTION);
+    }
+
+    function pre_confirmation_check() {
+    global $order, $languages_id, $paypal_token, $paypal_payer_id;
+    
+    $caller = $this->get_caller();
+
+    if(!tep_session_is_registered('paypal_token')) {
+      // redirect user to paypal site
+      $amount =& Services_PayPal::getType('BasicAmountType');
+      $amount->setval(number_format($order->info['total'], 2));
+      $amount->setattr('currencyID', $order->info['currency']); // only USD supported
+
+      $ecd =& Services_PayPal::getType('SetExpressCheckoutRequestDetailsType');
+      $ecd->setOrderTotal($amount);
+      $ecd->setReturnURL(tep_href_link('ext/modules/payment/paypal_wpp/ec.php', '', 'SSL'));
+      $ecd->setCancelURL(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
+      $ecd->setNoShipping(1); // don't display shipping address at paypal site so user can't change it
+
+      if(MODULE_PAYMENT_PAYPAL_EC_REQUIRE_CONFIRMED == 'Yes') {
+        $ecd->setReqConfirmShipping(1);
+      }
+
+      // display local page when user gets to paypal site
+      $language_code = "US";
+      $languages_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where languages_id = ".$languages_id);
+
+      if(tep_db_num_rows($languages_query) > 0) {
+        $languages = tep_db_fetch_array($languages_query);
+
+        switch ($languages['code']) {
+          case 'en':
+              // default
+              break;
+          case 'de':
+              $language_code = 'DE';
+              break;
+          case 'fr':
+              $language_code = 'FR';
+              break;
+          case 'it':
+              $language_code = 'IT';
+              break;
+          case 'ja':
+              $language_code = 'JP';
+              break;
+          default:
+            break;
+        }
+      }
+
+      $ecd->setLocaleCode($language_code);
+
+      if(MODULE_PAYMENT_PAYPAL_EC_PAGE_STYLE) {
+        $ecd->setPageStyle(MODULE_PAYMENT_PAYPAL_EC_PAGE_STYLE);
+      }
+/*
+      if(MODULE_PAYMENT_PAYPAL_EC_HEADER_IMAGE) {
+        $ecd->setcpp_header_image(urlencode(MODULE_PAYMENT_PAYPAL_EC_HEADER_IMAGE));
+      }
+
+      if(MODULE_PAYMENT_PAYPAL_EC_BORDER_COLOR) {
+        $ecd->setcpp_header_border_color(MODULE_PAYMENT_PAYPAL_EC_BORDER_COLOR);
+      }
+
+      if(MODULE_PAYMENT_PAYPAL_EC_BACK_COLOR) {
+        $ecd->setcpp_header_back_color(MODULE_PAYMENT_PAYPAL_EC_BACK_COLOR);
+      }
+
+      if(MODULE_PAYMENT_PAYPAL_EC_PAYFLOW_COLOR) {
+        $ecd->setcpp_payflow_color(MODULE_PAYMENT_PAYPAL_EC_PAYFLOW_COLOR);
+      }
+*/
+      $ecd->setBuyerEmail($order->customer['email_address']);
+
+      $ec =& Services_PayPal::getType('SetExpressCheckoutRequestType');
+      $ec->setSetExpressCheckoutRequestDetails($ecd);
+
+      $response = $caller->SetExpressCheckout($ec);
+
+      if(Services_PayPal::isError($response)  || ($response->getAck() != 'Success' && $response->getAck() != 'SuccessWithWarning')) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode(MODULE_PAYMENT_PAYPAL_EC_TEXT_PROCESS_ERROR);
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      } else {
+        $paypal_token = $response->getToken();
+        tep_redirect($this->paypal_url."?cmd=_express-checkout&token=".$paypal_token); // https response 302 "object moved" ?
+      }
+    } elseif(!tep_session_is_registered('paypal_payer_id')) {
+      // user comes back from paypal site
+      $ecd =& Services_PayPal::getType('GetExpressCheckoutDetailsRequestType');
+      $ecd->setToken($paypal_token);
+      $response = $caller->GetExpressCheckoutDetails($ecd);
+
+      if(Services_PayPal::isError($response)  || ($response->getAck() != 'Success' && $response->getAck() != 'SuccessWithWarning')) {
+        tep_session_unregister($paypal_token);
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode(MODULE_PAYMENT_PAYPAL_EC_TEXT_PROCESS_ERROR);
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      } else {
+        $details = $response->getGetExpressCheckoutDetailsResponseDetails();
+        $payer_info = $details->getPayerInfo();
+
+        if(!tep_session_is_registered('paypal_payer_id'))
+          tep_session_register('paypal_payer_id');
+
+        $paypal_payer_id = $payer_info->getPayerID();
+      }
+    }
+    }
+
+    function confirmation() {
+    $confirmation = array('title' => MODULE_PAYMENT_PAYPAL_EC_CLIENT_DESCRIPTION);
+    return $confirmation;
+    }
+
+    function process_button() {
+    return "";
+    }
+
+    function before_process() {
+    global $order, $paypal_token, $paypal_payer_id;
+    
+    $caller = $this->get_caller();
+
+    $pdt =& Services_PayPal::getType('PaymentDetailsType');
+    $order_total =& Services_PayPal::getType('BasicAmountType');
+    $order_total->setval(number_format($order->info['total'], 2));
+    $order_total->setattr('currencyID', $order->info['currency']);
+    $pdt->setOrderTotal($order_total);
+
+    if($order->info['total'] == ($order->info['subtotal'] + $order->info['shipping_cost']+ $order->info['tax'])) {
+      $item_total =& Services_PayPal::getType('BasicAmountType');
+      $item_total->setval(number_format($order->info['subtotal'], 2));
+      $item_total->setattr('currencyID', $order->info['currency']);
+
+      $ship_total =& Services_PayPal::getType('BasicAmountType');
+      $ship_total->setval(number_format($order->info['shipping_cost'], 2));
+      $ship_total->setattr('currencyID', $order->info['currency']);
+
+      $tax_total =& Services_PayPal::getType('BasicAmountType');
+      $tax_total->setval(number_format($order->info['tax'], 2));
+      $tax_total->setattr('currencyID', $order->info['currency']);
+
+      $pdt->setItemTotal($item_total);
+      $pdt->setShippingTotal($ship_total);
+      //$pdt->setHandlingTotal($handling_total);
+      $pdt->setTaxTotal($tax_total);
+/*
+      $payment_item = array();
+      $item_tax = 0;
+      $item_amount = 0;
+
+      for($i = 0; $i < sizeof($order->products); $i++) {
+        $payment_item[$i] =& Services_PayPal::getType('PaymentDetailsItemType');
+        $payment_item[$i]->setName($order->products[$i]['name']);
+        $amount =& Services_PayPal::getType('BasicAmountType');
+        $amount->setval(number_format($order->products[$i]['final_price'], 2));
+        $amount->setattr('currencyID', $order->info['currency']);
+        $payment_item[$i]->setAmount($amount);
+        $payment_item[$i]->setNumber($order->products[$i]['id']);
+        $payment_item[$i]->setQuantity($order->products[$i]['qty']);
+        $tax =& Services_PayPal::getType('BasicAmountType');
+        $tax->setval(number_format($order->products[$i]['tax'], 2));
+        $tax->setattr('currencyID', $order->info['currency']);
+        $payment_item[$i]->setTax($tax);
+        $item_amount += $order->products[$i]['final_price'] * $order->products[$i]['qty'];
+        $item_tax += $order->products[$i]['tax'] * $order->products[$i]['qty'];
+      }
+
+      if($item_amount == $order->info['subtotal'] && $item_tax == $order->info['tax']) {
+        $pdt->setPaymentDetailsItem($payment_item);
+      }*/
+    }
+    
+    if($order->delivery['zone_id']) {
+      $zone_query = tep_db_query("select zone_code from ". TABLE_ZONES . " where zone_id = '".$order->delivery['zone_id']."'");
+      $zone = tep_db_fetch_array($zone_query);
+      $ship2state = $zone['zone_code'];
+    } else {
+      $ship2state = $order->delivery['state'];
+    }
+
+    if(($order->delivery['firstname'] || $order->delivery['lastname']) &&
+      $order->delivery['street_address'] && $order->delivery['city'] &&
+      $order->delivery['country']['iso_code_2']) {
+      $ship2address =& Services_PayPal::getType('AddressType');
+      $ship2address->setName($order->delivery['firstname'].' '.$order->delivery['lastname']);
+      $ship2address->setStreet1($order->delivery['street_address']);
+      $ship2address->setCityName($order->delivery['city']);
+      $ship2address->setStateOrProvince($ship2state);
+      $ship2address->setCountry($order->delivery['country']['iso_code_2']);
+      $ship2address->setPostalCode($order->delivery['postcode']);
+
+      $pdt->setShipToAddress($ship2address);
+      }
+      
+    //$pdt->setNotifyURL(tep_href_link('ext/modules/payment/paypal_wpp/ec.php', '', 'SSL', false, false));
+
+    $pdt->setButtonSource(POSTOSC_PRODUCT_NAME);
+
+    $details =& Services_PayPal::getType('DoExpressCheckoutPaymentRequestDetailsType');
+    $details->setPaymentAction(MODULE_PAYMENT_PAYPAL_DP_PAYMENT_ACTION);
+    $details->setToken($paypal_token);
+    $details->setPayerID($paypal_payer_id);
+    $details->setPaymentDetails($pdt);
+
+    $ecprt =& Services_PayPal::getType('DoExpressCheckoutPaymentRequestType');
+    $ecprt->setDoExpressCheckoutPaymentRequestDetails($details);
+
+    $response = $caller->DoExpressCheckoutPayment($ecprt);
+
+    tep_session_unregister('paypal_token');
+    tep_session_unregister('paypal_payer_id');
+
+    if(Services_PayPal::isError($response)  || ($response->getAck() != 'Success' && $response->getAck() != 'SuccessWithWarning')) {
+      tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_PAYPAL_EC_TEXT_PROCESS_ERROR), 'SSL', true, false));
+    } else {
+      $details = $response->getDoExpressCheckoutPaymentResponseDetails();
+      $payment_info = $details->getPaymentInfo();
+      $this->trans_id = $payment_info->getTransactionID();
+      $this->payment_status = $payment_info->getPaymentStatus();
+      $this->payment_type = $payment_info->getPaymentType();
+
+      switch ($this->payment_status) {
+        case 'Completed': // default status
+          break;
+        case 'Pending':
+          // set order status to 'Pending'
+          $this->pending_reason = $payment_info->getPendingReason();
+          $order->info['order_status'] = 1;
+          break;
+        default:
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_PAYPAL_EC_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
+          break;
+      }
+    }
+    }
+
+    function after_process() {
+    global $insert_id;
+    tep_db_query("update ".TABLE_ORDERS_STATUS_HISTORY. " set comments = concat(if(trim(comments) != '', concat(trim(comments), '\n'), ''), 'Transaction ID: ".$this->trans_id."\nPayment Type: ".$this->payment_type."\nPayment Status: ".$this->payment_status.(isset($this->pending_reason) ? '\nPending Reason:'.$this->pending_reason : '')."') where orders_id = ". $insert_id);
+    }
+
+    function get_error() {
+    global $HTTP_GET_VARS;
+
+    $error = array('title' => MODULE_PAYMENT_PAYPAL_EC_TEXT_ERROR,
+                 'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+    return $error;
+    }
+
+    function check() {
+    if(!isset($this->_check)) {
+      $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_EC_STATUS'");
+      $this->_check = tep_db_num_rows($check_query);
+    }
+    
+    return $this->_check;
+    }
+
+    function install() {
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPal Express Checkout Module', 'MODULE_PAYMENT_PAYPAL_EC_STATUS', 'True', 'Do you want to accept credit/debit card payments through PayPal Express Checkout?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_EC_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '1' , now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPAL_EC_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPAL_EC_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value.', '6', '3', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Gateway Server', 'MODULE_PAYMENT_PAYPAL_EC_GATEWAY_SERVER', 'Sandbox', 'Use the testing (sandbox) or live gateway server for transactions?', '6', '4', 'tep_cfg_select_option(array(\'Sandbox\',\'Live\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Certificate File', 'MODULE_PAYMENT_PAYPAL_EC_CERT_FILE', '', 'Enter the absolute path of your API certificate file.', '6', '5', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Account Username', 'MODULE_PAYMENT_PAYPAL_EC_USERNAME', '', 'Enter your username for PayPal API account.', '6', '6', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('API Account Password', 'MODULE_PAYMENT_PAYPAL_EC_PASSWORD', '', 'Enter your password for PayPal API account.', '6', '7', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Payment Action', 'MODULE_PAYMENT_PAYPAL_EC_PAYMENT_ACTION', 'Sale', 'Sale, Order, or Authorization (Capture later)?', '6', '9',  'tep_cfg_select_option(array(\'Sale\', \'Order\', \'Authorization\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Require Confirmed Address', 'MODULE_PAYMENT_PAYPAL_EC_REQUIRE_CONFIRMED', 'No', 'Do you require that the customers shipping address on file with PayPal be a confirmed address?', '6', '10',  'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PayPal Page Style', 'MODULE_PAYMENT_PAYPAL_EC_PAGE_STYLE', '', 'Set the Custom Payment Page Style for payment pages.', '6', '11', now())");
+    //tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Header Image', 'MODULE_PAYMENT_PAYPAL_EC_HEADER_IMAGE', '', 'URL of the image you want to appear at the top left of the payment page.', '6', '12', now())");
+    //tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Header Border Color', 'MODULE_PAYMENT_PAYPAL_EC_BORDER_COLOR', '', 'Set the border color around the header of the payment page.', '6', '13', now())");
+    //tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Header Background Color', 'MODULE_PAYMENT_PAYPAL_EC_BACK_COLOR', '', 'Set the background color for the header of the payment page.', '6', '14', now())");
+    //tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Page Background Color', 'MODULE_PAYMENT_PAYPAL_EC_PAYFLOW_COLOR', '', 'Set the background color for the payment page.', '6', '15', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Log Level', 'MODULE_PAYMENT_PAYPAL_EC_LOG_LEVEL', 'Off', 'Do you want to turn on logging?', '6', '16', 'tep_cfg_select_option(array(\'Debug\', \'Normal\', \'Off\'), ',now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Log Directory', 'MODULE_PAYMENT_PAYPAL_EC_LOG_DIR', '', 'Enter the absolute path to your log directory. It must be writable.', '6', '17', now())");
+  }
+
+    function remove() {
+    tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+  }
+
+    function keys() {
+    return array('MODULE_PAYMENT_PAYPAL_EC_STATUS', 'MODULE_PAYMENT_PAYPAL_EC_ZONE', 'MODULE_PAYMENT_PAYPAL_EC_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPAL_EC_SORT_ORDER', 'MODULE_PAYMENT_PAYPAL_EC_GATEWAY_SERVER', 'MODULE_PAYMENT_PAYPAL_EC_CERT_FILE', 'MODULE_PAYMENT_PAYPAL_EC_USERNAME', 'MODULE_PAYMENT_PAYPAL_EC_PASSWORD', 'MODULE_PAYMENT_PAYPAL_EC_PAYMENT_ACTION', 'MODULE_PAYMENT_PAYPAL_EC_REQUIRE_CONFIRMED', 'MODULE_PAYMENT_PAYPAL_EC_PAGE_STYLE', //'MODULE_PAYMENT_PAYPAL_EC_HEADER_IMAGE', 'MODULE_PAYMENT_PAYPAL_EC_BORDER_COLOR', 'MODULE_PAYMENT_PAYPAL_EC_BACK_COLOR', 'MODULE_PAYMENT_PAYPAL_EC_PAYFLOW_COLOR',
+          'MODULE_PAYMENT_PAYPAL_EC_LOG_LEVEL', 'MODULE_PAYMENT_PAYPAL_EC_LOG_DIR');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/plugnpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/plugnpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/plugnpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,408 @@
+<?php
+/*
+  $Id: plugnpay.php,v 1.48 2003/04/10 21:42:30 project3000 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+
+  Last Updated: 10/25/04 
+*/
+
+  class plugnpay {
+    var $code, $title, $description, $enabled, $sort_order;
+    var $accepted_cc, $card_types, $allowed_types;
+
+// class constructor
+    function plugnpay() {
+      $this->code = 'plugnpay';
+      $this->title = MODULE_PAYMENT_PLUGNPAY_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_PLUGNPAY_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_PLUGNPAY_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_PLUGNPAY_STATUS == 'True') ? true : false);
+      $this->accepted_cc = MODULE_PAYMENT_PLUGNPAY_ACCEPTED_CC;
+
+      //array for credit card selection
+      $this->card_types = array('Amex' => MODULE_PAYMENT_PLUGNPAY_TEXT_AMEX,
+                                'Mastercard' => MODULE_PAYMENT_PLUGNPAY_TEXT_MASTERCARD,
+                                'Discover' => MODULE_PAYMENT_PLUGNPAY_TEXT_DISCOVER,
+                                'Visa' => MODULE_PAYMENT_PLUGNPAY_TEXT_VISA);
+        
+      $this->allowed_types = array();
+
+      // Credit card pulldown list
+      $cc_array = explode(', ', MODULE_PAYMENT_PLUGNPAY_ACCEPTED_CC);
+      while (list($key, $value) = each($cc_array)) {
+        $this->allowed_types[$value] = $this->card_types[$value];
+      }
+
+      // Processing via PlugnPay API 
+      $this->form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false);
+    }
+
+// class methods
+
+//concatenate to get CC images
+function get_cc_images() {
+  $cc_images = '';
+  reset($this->allowed_types);
+  while (list($key, $value) = each($this->allowed_types)) {
+    $cc_images .= tep_image(DIR_WS_ICONS . $key . '.gif', $value);
+  }
+  return $cc_images;
+}
+
+function javascript_validation() {
+#      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+#            '    var cc_owner = document.checkout_payment.plugnpay_cc_owner.value;' . "\n" .
+#            '    var cc_number = document.checkout_payment.plugnpay_cc_number.value;' . "\n" .
+#            '    var cc_cvv = document.checkout_payment.cvv.value;' . "\n" .
+#            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+#            '      error_message = error_message + "' . MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_OWNER . '";' . "\n" .
+#            '      error = 1;' . "\n" .
+#            '    }' . "\n" .
+#            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+#            '      error_message = error_message + "' . MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_NUMBER . '";' . "\n" .
+#            '      error = 1;' . "\n" .
+#            '    }' . "\n" .
+#            '    if (cc_cvv != "" && cc_cvv.length < "3") {' . "\n".
+#            '      error_message = error_message + "' . MODULE_PAYMENT_PLUGNPAY_TEXT_JS_CC_CVV . '";' . "\n" .
+#            '      error = 1;' . "\n" .
+#            '    }' . "\n" .
+#            '  }' . "\n";
+#
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+
+      reset($this->allowed_types);
+      while (list($key, $value) = each($this->allowed_types)) {
+        $card_menu[] = array('id' => $key, 'text' => $value);
+      }
+
+      if (MODULE_PAYMENT_PLUGNPAY_PAYMETHOD == 'onlinecheck') {
+        # set accttype menu
+        $accttype_menu[] = array('id' => 'checking', 'text' => 'checking');
+        $accttype_menu[] = array('id' => 'savings', 'text' => 'savings');
+
+        # set paytype menu
+        $paytype_menu[] = array('id' => 'credit_card', 'text' => 'Credit Card');
+        $paytype_menu[] = array('id' => 'echeck', 'text' => 'Electronic Check');
+      }
+
+      for ($i=1; $i<13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate(); 
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+      if ((MODULE_PAYMENT_PLUGNPAY_PAYMETHOD == 'onlinecheck') && (MODULE_PAYMENT_PLUGNPAY_CVV == 'no')) {
+  $selection = array('id' => $this->code,
+               'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images() . '&nbsp; or Electronic Check',
+               'fields' => array(
+                                             // credit & echeck selection
+                                             array('title' => '<b>Select Your Method Of Payment:</b>',
+                                 'field' => ''),
+                                             array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_PAYTYPE,
+                                 'field' => tep_draw_pull_down_menu('plugnpay_paytype', $paytype_menu)),
+                                             // credit card stuff here
+                                             array('title' => '&nbsp;<p><b>Credit Card Info:</b>',
+                                 'field' => ''),
+                                             array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_TYPE,
+                                 'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER,
+                                 'field' => tep_draw_input_field('plugnpay_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER,
+                                 'field' => tep_draw_input_field('plugnpay_cc_number')),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES,
+                                 'field' => tep_draw_pull_down_menu('plugnpay_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('plugnpay_cc_expires_year', $expires_year)),
+                                            // echeck stuff here
+                                             array('title' => '&nbsp;<p><b>Electronic Checking Info:</b>',
+                                 'field' => ''),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCTTYPE,
+                                 'field' => tep_draw_pull_down_menu('plugnpay_echeck_accttype', $accttype_menu)),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ROUTINGNUM,
+                                  'field' => tep_draw_input_field('plugnpay_echeck_routingnum','',"SIZE=12, MAXLENGTH=9")),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCOUNTNUM,
+                                 'field' => tep_draw_input_field('plugnpay_echeck_accountnum','',"SIZE=12")),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_CHECKNUM,
+                                 'field' => tep_draw_input_field('plugnpay_echeck_checknum','',"SIZE=6"))
+                                ));
+      }
+      else if ((MODULE_PAYMENT_PLUGNPAY_PAYMETHOD == 'onlinecheck') && (MODULE_PAYMENT_PLUGNPAY_CVV == 'yes')) {
+  $selection = array('id' => $this->code,
+               'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images() . '&nbsp; or Electronic Check',
+               'fields' => array(
+                                             // credit & echeck selection
+                                             array('title' => '<b>Select Your Method Of Payment:</b>',
+                                 'field' => ''),
+                                             array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_PAYTYPE,
+                                 'field' => tep_draw_pull_down_menu('plugnpay_paytype', $paytype_menu)),
+                                             // credit card stuff here
+                                             array('title' => '&nbsp;<p><b>Credit Card Info:</b>',
+                                 'field' => ''),
+                                             array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_TYPE,
+                                 'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER,
+                                 'field' => tep_draw_input_field('plugnpay_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER,
+                                 'field' => tep_draw_input_field('plugnpay_cc_number')),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES,
+                                 'field' => tep_draw_pull_down_menu('plugnpay_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('plugnpay_cc_expires_year', $expires_year)),
+                                             array('title' => 'CVV number ' . ' ' .'<a href="javascript:CVVPopUpWindow(\'' . tep_href_link('cvv.html') . '\')">' . '<u><i>' . '(' . MODULE_PAYMENT_PLUGNPAY_TEXT_CVV_LINK . ')' . '</i></u></a>',
+      'field' => tep_draw_input_field('cvv','',"SIZE=4, MAXLENGTH=4")),
+                                             // echeck stuff here
+                                             array('title' => '&nbsp;<p><b>Electronic Checking Info:</b>',
+                                 'field' => ''),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCTTYPE,
+                                 'field' => tep_draw_pull_down_menu('plugnpay_echeck_accttype', $accttype_menu)),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ROUTINGNUM,
+                                  'field' => tep_draw_input_field('plugnpay_echeck_routingnum','',"SIZE=12, MAXLENGTH=9")),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCOUNTNUM,
+                                 'field' => tep_draw_input_field('plugnpay_echeck_accountnum','',"SIZE=12")),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_CHECKNUM,
+                                 'field' => tep_draw_input_field('plugnpay_echeck_checknum','',"SIZE=6"))
+                                ));
+      }
+      else if (MODULE_PAYMENT_PLUGNPAY_CVV == 'no') {
+  $selection = array('id' => $this->code,
+               'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images(),
+               'fields' => array(array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_TYPE,
+                                 'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER,
+                                  'field' => tep_draw_input_field('plugnpay_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER,
+                                 'field' => tep_draw_input_field('plugnpay_cc_number')),
+                                 array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES,
+                                 'field' => tep_draw_pull_down_menu('plugnpay_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('plugnpay_cc_expires_year', $expires_year))
+                                            ));
+      }
+      else {
+        $selection = array('id' => $this->code,
+                           'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images(),
+                           'fields' => array(array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_TYPE,
+                                                   'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+                                             array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER,
+                                                   'field' => tep_draw_input_field('plugnpay_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+                                             array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER,
+                                                   'field' => tep_draw_input_field('plugnpay_cc_number')),
+                                             array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES,
+                                                   'field' => tep_draw_pull_down_menu('plugnpay_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('plugnpay_cc_expires_year', $expires_year)),
+                                             array('title' => 'CVV number ' . ' ' .'<a href="javascript:CVVPopUpWindow(\'' . tep_href_link('cvv.html') . '\')">' . '<u><i>' . '(' . MODULE_PAYMENT_PLUGNPAY_TEXT_CVV_LINK . ')' . '</i></u></a>',
+'field' => tep_draw_input_field('cvv','',"SIZE=4, MAXLENGTH=4"))
+                                            ));
+      }
+
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS, $cvv;
+
+      if ((MODULE_PAYMENT_PLUGNPAY_PAYMETHOD == 'onlinecheck') && ($HTTP_POST_VARS['plugnpay_paytype'] != 'credit_card')) {
+        $this->plugnpay_paytype = $HTTP_POST_VARS['plugnpay_paytype'];
+        $this->echeck_accttype = $HTTP_POST_VARS['plugnpay_echeck_accttype'];
+        $this->echeck_accountnum = $HTTP_POST_VARS['plugnpay_echeck_accountnum'];
+        $this->echeck_routingnum = $HTTP_POST_VARS['plugnpay_echeck_routingnum'];
+        $this->echeck_checknum = $HTTP_POST_VARS['plugnpay_echeck_checknum'];
+      }
+      else {
+        # Note: section assumes the payment method is credit card
+        include(DIR_WS_CLASSES . 'cc_validation.php');
+        $cc_validation = new cc_validation();
+        $result = $cc_validation->validate($HTTP_POST_VARS['plugnpay_cc_number'], $HTTP_POST_VARS['plugnpay_cc_expires_month'], $HTTP_POST_VARS['plugnpay_cc_expires_year'], $HTTP_POST_VARS['cvv'], $HTTP_POST_VARS['credit_card_type']);
+        $error = '';
+        switch ($result) {
+          case -1:
+            $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+            break;
+          case -2:
+          case -3:
+          case -4:
+            $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+            break;
+          case -5:
+            $error = TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH;
+            break;
+          case -6;
+            $error = TEXT_CCVAL_ERROR_CVV_LENGTH;
+            break; 
+          case false:
+            $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+            break;
+        }
+
+        if ( ($result == false) || ($result < 1) ) {
+          $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&plugnpay_cc_owner=' . urlencode($HTTP_POST_VARS['plugnpay_cc_owner']) . '&plugnpay_cc_expires_month=' . $HTTP_POST_VARS['plugnpay_cc_expires_month'] . '&plugnpay_cc_expires_year=' . $HTTP_POST_VARS['plugnpay_cc_expires_year'];
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+        }
+
+        $this->cc_card_type = $cc_validation->cc_type;
+        $this->cc_card_number = $cc_validation->cc_number;
+        $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+        $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+        $card_cvv = $HTTP_POST_VARS['cvv'];
+      }
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS, $card_cvv;
+
+      if ((MODULE_PAYMENT_PLUGNPAY_PAYMETHOD == 'onlinecheck') && ($this->plugnpay_paytype == 'echeck')) {
+        $confirmation = array('title' => $this->title . ': Electronic Check Payments',
+                              'fields' => array(array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCTTYPE,
+                                                      'field' => $this->echeck_accttype),
+                                                array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ROUTINGNUM,
+                                                      'field' => $this->echeck_routingnum),
+                                                array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_ACCOUNTNUM,
+                                                      'field' => $this->echeck_accountnum),
+                                                array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ECHECK_CHECKNUM,
+                                                      'field' => $this->echeck_checknum)
+                                                ));
+      }
+      else if (MODULE_PAYMENT_PLUGNPAY_CVV == 'no') {
+        $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                              'fields' => array(array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER,
+                                                      'field' => $HTTP_POST_VARS['plugnpay_cc_owner']),
+                                                array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER,
+                                                      'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                                array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES,
+                                                      'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['plugnpay_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['plugnpay_cc_expires_year'])))));
+      }  
+      else {
+        $card_cvv=$HTTP_POST_VARS['cvv'];
+        $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                              'fields' => array(array('title' => 'CVV number',
+                                                      'field' => $HTTP_POST_VARS['cvv']),
+                                                array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_OWNER,
+                                                      'field' => $HTTP_POST_VARS['plugnpay_cc_owner']),
+                                                array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_NUMBER,
+                                                      'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                                array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_CREDIT_CARD_EXPIRES,
+                                                      'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['plugnpay_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['plugnpay_cc_expires_year'])))));
+        $card_cvv=$HTTP_POST_VARS['cvv'];
+      }
+      return $confirmation;
+    }
+
+    function process_button() {
+      // Change made by using PlugnPay API Connection
+      $card_cvv=$HTTP_POST_VARS['cvv'];
+
+      $process_button_string = tep_draw_hidden_field('card_cvv', $HTTP_POST_VARS['cvv']) . 
+                               tep_draw_hidden_field('card_number', $this->cc_card_number) .
+                               tep_draw_hidden_field('card_exp', $this->cc_expiry_month . substr($this->cc_expiry_year, -2));
+
+      $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $response;
+      # Note: $response is an array that holds various pieces if cURL response info
+      #       $response[0] will hold the entire response string from the pnpremote.cgi script
+
+      ## Note: Enable this code to record the response string to a text file for debug purposes
+      if (MODULE_PAYMENT_PLUGNPAY_TESTMODE == 'Test And Debug') {
+        $filename = './plugnpay_debug.txt';
+        $fp = fopen($filename, "a");
+        $write = fputs($fp, "POSTAUTH: $response[0]\n\n");
+        fclose($fp);
+      }
+
+      # NOTE: windows server users, you must have 'register_globals' ON in your php.ini for parse_str to work correctly.
+      parse_str($response[0]);
+
+      if($FinalStatus == 'success') {
+        tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$insert_id . "'"); //Remove order
+        #tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('SUCCESSFUL - ORDER APPROVED'), 'SSL', true, false));  // uncomment this line for testing.
+      }
+      else if($FinalStatus == 'badcard') {
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('Your authorization was declined.  Please try another card.') . urlencode(" -- $MErrMsg"), 'SSL', true, false));
+      }
+      else if($FinalStatus == 'fraud') {
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('Your transaction was rejected.  Please contact the merchant for ordering assistance.') . urlencode(" -- $MErrMsg"), 'SSL', true, false));
+      }
+      else if($FinalStatus == 'problem') {
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an error processing your transaction.  Please contact the merchant for ordering assistance.') . urlencode(" -- $MErrMsg"), 'SSL', true, false));
+      }
+      else {
+        if ($response[0] == '') {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode("There was an unspecified error processing your transaction.<br>Received empty cURL response - check cURL connectivity to PnP server.") . urlencode(" -- $MErrMsg"), 'SSL', true, false));
+        }
+        else {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode("There was an unspecified error processing your transaction.") . urlencode(" -- $MErrMsg"), 'SSL', true, false));
+        }
+      }
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_PLUGNPAY_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PLUGNPAY_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PlugnPay Module', 'MODULE_PAYMENT_PLUGNPAY_STATUS', 'True', 'Do you want to accept payments through PlugnPay?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login Username', 'MODULE_PAYMENT_PLUGNPAY_LOGIN', 'Your Login Name', 'Enter your PlugnPay account username', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Publisher Email', 'MODULE_PAYMENT_PLUGNPAY_PUBLISHER_EMAIL', 'Enter Your Email Address', 'The email address you want PlugnPay conformations sent to', '6', '0', now())");
+  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('cURL Setup', 'MODULE_PAYMENT_PLUGNPAY_CURL', 'Not Compiled', 'Whether cURL is compiled into PHP or not.  Windows users, select not compiled.', '6', '0', 'tep_cfg_select_option(array(\'Not Compiled\', \'Compiled\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Path', 'MODULE_PAYMENT_PLUGNPAY_CURL_PATH', 'The Path To cURL', 'For Not Compiled mode only, input path to the cURL binary (i.e. c:/curl/curl)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_PLUGNPAY_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Test And Debug\', \'Production\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Require CVV', 'MODULE_PAYMENT_PLUGNPAY_CVV', 'yes', 'Ask For CVV information', '6', '0', 'tep_cfg_select_option(array(\'yes\', \'no\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Send 2-Letter State', 'MODULE_PAYMENT_PLUGNPAY_SEND_STATE_CODE', 'yes', 'Send PnP 2-Letter State Where Possible', '6', '0', 'tep_cfg_select_option(array(\'yes\', \'no\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Method', 'MODULE_PAYMENT_PLUGNPAY_PAYMETHOD', 'credit', 'Transaction method used for processing orders.<br><b>NOTE:</b> Selecting \'onlinecheck\' assumes you\'ll offer \'credit\' as well.', '6', '0', 'tep_cfg_select_option(array(\'credit\', \'onlinecheck\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_PLUGNPAY_CCMODE', 'authpostauth', 'Credit card processing mode', '6', '0', 'tep_cfg_select_option(array(\'authpostauth\', \'authonly\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order Of Display', 'MODULE_PAYMENT_PLUGNPAY_SORT_ORDER', '1', 'The order in which this payment type is dislayed. Lowest is displayed first.', '6', '0' , now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_PLUGNPAY_DONTSNDMAIL', 'yes', 'Should PlugnPay not email a receipt to the customer?', '6', '0', 'tep_cfg_select_option(array(\'yes\', \'no\'), ', now())");
+  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accepted Credit Cards', 'MODULE_PAYMENT_PLUGNPAY_ACCEPTED_CC', 'Mastercard, Visa', 'The credit cards you currently accept', '6', '0', '_selectStuff(array(\'Amex\',\'Discover\', \'Mastercard\', \'Visa\'), ', now())");
+    }
+
+    function remove() {
+      $keys = '';
+      $keys_array = $this->keys();
+      for ($i=0; $i<sizeof($keys_array); $i++) {
+        $keys .= "'" . $keys_array[$i] . "',";
+      }
+      $keys = substr($keys, 0, -1);
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_PLUGNPAY_STATUS', 'MODULE_PAYMENT_PLUGNPAY_LOGIN', 'MODULE_PAYMENT_PLUGNPAY_PUBLISHER_EMAIL', 'MODULE_PAYMENT_PLUGNPAY_CURL', 'MODULE_PAYMENT_PLUGNPAY_CURL_PATH', 'MODULE_PAYMENT_PLUGNPAY_TESTMODE', 'MODULE_PAYMENT_PLUGNPAY_CVV', 'MODULE_PAYMENT_PLUGNPAY_SEND_STATE_CODE', 'MODULE_PAYMENT_PLUGNPAY_PAYMETHOD', 'MODULE_PAYMENT_PLUGNPAY_CCMODE', 'MODULE_PAYMENT_PLUGNPAY_SORT_ORDER', 'MODULE_PAYMENT_PLUGNPAY_DONTSNDMAIL', 'MODULE_PAYMENT_PLUGNPAY_ACCEPTED_CC');
+    }
+  }
+
+// PlugnPay Consolidated Credit Card Checkbox Implementation
+// Code from UPS Choice v1.7
+function _selectStuff($select_array, $key_value, $key = '') {
+  for ($i=0; $i<(sizeof($select_array)); $i++) {
+    $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+    $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+    $key_values = explode(", ", $key_value);
+    if (in_array($select_array[$i], $key_values)) $string .= ' checked="checked"';
+    $string .= '> ' . $select_array[$i];
+  } 
+  return $string;
+}
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/pm2checkout.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/pm2checkout.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/pm2checkout.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,226 @@
+<?php
+/*
+  $Id: pm2checkout.php,v 1.1.1.1 2004/03/04 23:41:21 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class pm2checkout {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function pm2checkout() {
+      global $order;
+
+      $this->code = 'pm2checkout';
+      $this->title = MODULE_PAYMENT_2CHECKOUT_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_2CHECKOUT_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_2CHECKOUT_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_2CHECKOUT_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://www.2checkout.com/cgi-bin/Abuyers/purchase.2c';
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_2CHECKOUT_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_2CHECKOUT_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_number = document.checkout_payment.pm_2checkout_cc_number.value;' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_2CHECKOUT_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+
+      for ($i=1; $i < 13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+
+      $selection = array('id' => $this->code,
+                         'module' => $this->title,
+                         'fields' => array(array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_FIRST_NAME,
+                                                 'field' => tep_draw_input_field('pm_2checkout_cc_owner_firstname', $order->billing['firstname'])),
+                                           array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER_LAST_NAME,
+                                                 'field' => tep_draw_input_field('pm_2checkout_cc_owner_lastname', $order->billing['lastname'])),
+                                           array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_NUMBER,
+                                                 'field' => tep_draw_input_field('pm_2checkout_cc_number')),
+                                           array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_EXPIRES,
+                                                 'field' => tep_draw_pull_down_menu('pm_2checkout_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('pm_2checkout_cc_expires_year', $expires_year)),
+                                           array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER,
+                                                 'field' => tep_draw_input_field('pm_2checkout_cc_cvv', '', 'size="4" maxlength="4"') . '&nbsp;<small>' . MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION . '</small>')));
+
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+      include(DIR_WS_CLASSES . 'cc_validation1.php');
+
+      $cc_validation = new cc_validation();
+      $result = $cc_validation->validate($HTTP_POST_VARS['pm_2checkout_cc_number'], $HTTP_POST_VARS['pm_2checkout_cc_expires_month'], $HTTP_POST_VARS['pm_2checkout_cc_expires_year']);
+
+      $error = '';
+      switch ($result) {
+        case -1:
+          $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+          break;
+        case -2:
+        case -3:
+        case -4:
+          $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+          break;
+        case false:
+          $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+          break;
+      }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&pm_2checkout_cc_owner_firstname=' . urlencode($HTTP_POST_VARS['pm_2checkout_cc_owner_firstname']) . '&pm_2checkout_cc_owner_lastname=' . urlencode($HTTP_POST_VARS['pm_2checkout_cc_owner_lastname']) . '&pm_2checkout_cc_expires_month=' . $HTTP_POST_VARS['pm_2checkout_cc_expires_month'] . '&pm_2checkout_cc_expires_year=' . $HTTP_POST_VARS['pm_2checkout_cc_expires_year'];
+
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = $cc_validation->cc_type;
+      $this->cc_card_number = $cc_validation->cc_number;
+      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS;
+
+      $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['pm_2checkout_cc_owner_firstname'] . ' ' . $HTTP_POST_VARS['pm_2checkout_cc_owner_lastname']),
+                                              array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                              array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['pm_2checkout_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['pm_2checkout_cc_expires_year'])))));
+
+      return $confirmation;
+    }
+
+    function process_button() {
+      global $HTTP_POST_VARS, $order;
+
+      $process_button_string = tep_draw_hidden_field('x_login', MODULE_PAYMENT_2CHECKOUT_LOGIN) .
+                               tep_draw_hidden_field('x_amount', number_format($order->info['total'], 2)) .
+                               tep_draw_hidden_field('x_invoice_num', date('YmdHis')) .
+                               tep_draw_hidden_field('x_test_request', ((MODULE_PAYMENT_2CHECKOUT_TESTMODE == 'Test') ? 'Y' : 'N')) .
+                               tep_draw_hidden_field('x_card_num', $this->cc_card_number) .
+                               tep_draw_hidden_field('cvv', $HTTP_POST_VARS['pm_2checkout_cc_cvv']) .
+                               tep_draw_hidden_field('x_exp_date', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .
+                               tep_draw_hidden_field('x_first_name', $HTTP_POST_VARS['pm_2checkout_cc_owner_firstname']) .
+                               tep_draw_hidden_field('x_last_name', $HTTP_POST_VARS['pm_2checkout_cc_owner_lastname']) .
+                               tep_draw_hidden_field('x_address', $order->customer['street_address']) .
+                               tep_draw_hidden_field('x_city', $order->customer['city']) .
+                               tep_draw_hidden_field('x_state', $order->customer['state']) .
+                               tep_draw_hidden_field('x_zip', $order->customer['postcode']) .
+                               tep_draw_hidden_field('x_country', $order->customer['country']['title']) .
+                               tep_draw_hidden_field('x_email', $order->customer['email_address']) .
+                               tep_draw_hidden_field('x_phone', $order->customer['telephone']) .
+                               tep_draw_hidden_field('x_ship_to_first_name', $order->delivery['firstname']) .
+                               tep_draw_hidden_field('x_ship_to_last_name', $order->delivery['lastname']) .
+                               tep_draw_hidden_field('x_ship_to_address', $order->delivery['street_address']) .
+                               tep_draw_hidden_field('x_ship_to_city', $order->delivery['city']) .
+                               tep_draw_hidden_field('x_ship_to_state', $order->delivery['state']) .
+                               tep_draw_hidden_field('x_ship_to_zip', $order->delivery['postcode']) .
+                               tep_draw_hidden_field('x_ship_to_country', $order->delivery['country']['title']) .
+                               tep_draw_hidden_field('x_receipt_link_url', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .
+                               tep_draw_hidden_field('x_email_merchant', ((MODULE_PAYMENT_2CHECKOUT_EMAIL_MERCHANT == 'True') ? 'TRUE' : 'FALSE'));
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $HTTP_POST_VARS;
+
+      if ($HTTP_POST_VARS['x_response_code'] != '1') {
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR_MESSAGE), 'SSL', true, false));
+      }
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_2CHECKOUT_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable 2CheckOut Module', 'MODULE_PAYMENT_2CHECKOUT_STATUS', 'True', 'Do you want to accept 2CheckOut payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('2CheckOut Login/Store Number', 'MODULE_PAYMENT_2CHECKOUT_LOGIN', '18157', 'Login/Store Number used for the 2CheckOut service', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('2CheckOut Transaction Mode', 'MODULE_PAYMENT_2CHECKOUT_TESTMODE', 'Test', 'Transaction mode used for the 2Checkout service', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Production\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('2CheckOut Merchant Notifications', 'MODULE_PAYMENT_2CHECKOUT_EMAIL_MERCHANT', 'True', 'Should 2CheckOut e-mail a receipt to the store owner?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('2CheckOut Sort order of display.', 'MODULE_PAYMENT_2CHECKOUT_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('2CheckOut Payment Zone', 'MODULE_PAYMENT_2CHECKOUT_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('2CheckOut Set Order Status', 'MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_2CHECKOUT_STATUS', 'MODULE_PAYMENT_2CHECKOUT_LOGIN', 'MODULE_PAYMENT_2CHECKOUT_TESTMODE', 'MODULE_PAYMENT_2CHECKOUT_EMAIL_MERCHANT', 'MODULE_PAYMENT_2CHECKOUT_ZONE', 'MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID', 'MODULE_PAYMENT_2CHECKOUT_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/psigate.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/psigate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/psigate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,285 @@
+<?php
+/*
+  $Id: psigate.php,v 1.1.1.1 2004/03/04 23:41:21 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class psigate {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function psigate() {
+      global $order;
+
+      $this->code = 'psigate';
+      $this->title = MODULE_PAYMENT_PSIGATE_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_PSIGATE_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_PSIGATE_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_PSIGATE_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://order.psigate.com/psigate.asp';
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PSIGATE_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PSIGATE_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
+        $js = 'if (payment_value == "' . $this->code . '") {' . "\n" .
+              '  var psigate_cc_number = document.checkout_payment.psigate_cc_number.value;' . "\n" .
+              '  if (psigate_cc_number == "" || psigate_cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+              '    error_message = error_message + "' . MODULE_PAYMENT_PSIGATE_TEXT_JS_CC_NUMBER . '";' . "\n" .
+              '    error = 1;' . "\n" .
+              '  }' . "\n" .
+              '}' . "\n";
+
+        return $js;
+      } else {
+        return false;
+      }
+    }
+
+    function selection() {
+      global $order;
+
+      if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
+        for ($i=1; $i<13; $i++) {
+          $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+        }
+
+        $today = getdate();
+        for ($i=$today['year']; $i < $today['year']+10; $i++) {
+          $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+        }
+
+        $selection = array('id' => $this->code,
+                           'module' => $this->title,
+                           'fields' => array(array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER,
+                                                   'field' => $order->billing['firstname'] . ' ' . $order->billing['lastname']),
+                                             array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER,
+                                                   'field' => tep_draw_input_field('psigate_cc_number')),
+                                             array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES,
+                                                   'field' => tep_draw_pull_down_menu('psigate_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('psigate_cc_expires_year', $expires_year))));
+      } else {
+        $selection = array('id' => $this->code,
+                           'module' => $this->title);
+      }
+
+      return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS;
+
+      if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
+        include(DIR_WS_CLASSES . 'cc_validation1.php');
+
+        $cc_validation = new cc_validation();
+        $result = $cc_validation->validate($HTTP_POST_VARS['psigate_cc_number'], $HTTP_POST_VARS['psigate_cc_expires_month'], $HTTP_POST_VARS['psigate_cc_expires_year']);
+
+        $error = '';
+        switch ($result) {
+          case -1:
+            $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+            break;
+          case -2:
+          case -3:
+          case -4:
+            $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+            break;
+          case false:
+            $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+            break;
+        }
+
+        if ( ($result == false) || ($result < 1) ) {
+          $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&psigate_cc_owner=' . urlencode($HTTP_POST_VARS['psigate_cc_owner']) . '&psigate_cc_expires_month=' . $HTTP_POST_VARS['psigate_cc_expires_month'] . '&psigate_cc_expires_year=' . $HTTP_POST_VARS['psigate_cc_expires_year'];
+
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+        }
+
+        $this->cc_card_type = $cc_validation->cc_type;
+        $this->cc_card_number = $cc_validation->cc_number;
+        $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+        $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+      } else {
+        return false;
+      }
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS, $order;
+
+      if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
+        $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                              'fields' => array(array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER,
+                                                      'field' => $order->billing['firstname'] . ' ' . $order->billing['lastname']),
+                                                array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER,
+                                                      'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                                array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES,
+                                                      'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['psigate_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['psigate_cc_expires_year'])))));
+
+        return $confirmation;
+      } else {
+        return false;
+      }
+    }
+
+    function process_button() {
+      global $HTTP_SERVER_VARS, $order, $currencies;
+
+      switch (MODULE_PAYMENT_PSIGATE_TRANSACTION_MODE) {
+        case 'Always Good':
+          $transaction_mode = '1';
+          break;
+        case 'Always Duplicate':
+          $transaction_mode = '2';
+          break;
+        case 'Always Decline':
+          $transaction_mode = '3';
+          break;
+        case 'Production':
+        default:
+          $transaction_mode = '0';
+          break;
+      }
+
+      switch (MODULE_PAYMENT_PSIGATE_TRANSACTION_TYPE) {
+        case 'Sale':
+          $transaction_type = '0';
+          break;
+        case 'PostAuth':
+          $transaction_type = '2';
+          break;
+        case 'PreAuth':
+        default:
+          $transaction_type = '1';
+          break;
+      }
+
+      $process_button_string = tep_draw_hidden_field('MerchantID', MODULE_PAYMENT_PSIGATE_MERCHANT_ID) .
+                               tep_draw_hidden_field('FullTotal', number_format($order->info['total'] * $currencies->get_value(MODULE_PAYMENT_PSIGATE_CURRENCY), $currencies->currencies[MODULE_PAYMENT_PSIGATE_CURRENCY]['decimal_places'])) .
+                               tep_draw_hidden_field('ThanksURL', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true)) .
+                               tep_draw_hidden_field('NoThanksURL', tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'NONSSL', true)) .
+                               tep_draw_hidden_field('Bname', $order->billing['firstname'] . ' ' . $order->billing['lastname']) .
+                               tep_draw_hidden_field('Baddr1', $order->billing['street_address']) .
+                               tep_draw_hidden_field('Bcity', $order->billing['city']);
+
+      if ($order->billing['country']['iso_code_2'] == 'US') {
+        $billing_state_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_id = '" . (int)$order->billing['zone_id'] . "'");
+        $billing_state = tep_db_fetch_array($billing_state_query);
+
+        $process_button_string .= tep_draw_hidden_field('Bstate', $billing_state['zone_code']);
+      } else {
+        $process_button_string .= tep_draw_hidden_field('Bstate', $order->billing['state']);
+      }
+
+      $process_button_string .= tep_draw_hidden_field('Bzip', $order->billing['postcode']) .
+                                tep_draw_hidden_field('Bcountry', $order->billing['country']['iso_code_2']) .
+                                tep_draw_hidden_field('Phone', $order->customer['telephone']) .
+                                tep_draw_hidden_field('Email', $order->customer['email_address']) .
+                                tep_draw_hidden_field('Sname', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) .
+                                tep_draw_hidden_field('Saddr1', $order->delivery['street_address']) .
+                                tep_draw_hidden_field('Scity', $order->delivery['city']) .
+                                tep_draw_hidden_field('Sstate', $order->delivery['state']) .
+                                tep_draw_hidden_field('Szip', $order->delivery['postcode']) .
+                                tep_draw_hidden_field('Scountry', $order->delivery['country']['iso_code_2']) .
+                                tep_draw_hidden_field('ChargeType', $transaction_type) .
+                                tep_draw_hidden_field('Result', $transaction_mode) .
+                                tep_draw_hidden_field('IP', $HTTP_SERVER_VARS['REMOTE_ADDR']);
+
+      if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
+        $process_button_string .= tep_draw_hidden_field('CardNumber', $this->cc_card_number) .
+                                  tep_draw_hidden_field('ExpMonth', $this->cc_expiry_month) .
+                                  tep_draw_hidden_field('ExpYear', substr($this->cc_expiry_year, -2));
+      }
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      return false;
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      if (isset($HTTP_GET_VARS['ErrMsg']) && tep_not_null($HTTP_GET_VARS['ErrMsg'])) {
+        $error = stripslashes(urldecode($HTTP_GET_VARS['ErrMsg']));
+      } elseif (isset($HTTP_GET_VARS['Err']) && tep_not_null($HTTP_GET_VARS['Err'])) {
+        $error = stripslashes(urldecode($HTTP_GET_VARS['Err']));
+      } elseif (isset($HTTP_GET_VARS['error']) && tep_not_null($HTTP_GET_VARS['error'])) {
+        $error = stripslashes(urldecode($HTTP_GET_VARS['error']));
+      } else {
+        $error = MODULE_PAYMENT_PSIGATE_TEXT_ERROR_MESSAGE;
+      }
+
+      return array('title' => MODULE_PAYMENT_PSIGATE_TEXT_ERROR,
+                   'error' => $error);
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PSIGATE_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PSiGate Module', 'MODULE_PAYMENT_PSIGATE_STATUS', 'True', 'Do you want to accept PSiGate payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PSiGate Merchant ID', 'MODULE_PAYMENT_PSIGATE_MERCHANT_ID', 'teststorewithcard', 'Merchant ID used for the PSiGate service', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('PSiGate Transaction Mode', 'MODULE_PAYMENT_PSIGATE_TRANSACTION_MODE', 'Always Good', 'Transaction mode to use for the PSiGate service', '6', '3', 'tep_cfg_select_option(array(\'Production\', \'Always Good\', \'Always Duplicate\', \'Always Decline\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('PSiGate Transaction Type', 'MODULE_PAYMENT_PSIGATE_TRANSACTION_TYPE', 'PreAuth', 'Transaction type to use for the PSiGate service', '6', '4', 'tep_cfg_select_option(array(\'Sale\', \'PreAuth\', \'PostAuth\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('PSiGate Credit Card Collection', 'MODULE_PAYMENT_PSIGATE_INPUT_MODE', 'Local', 'Should the credit card details be collected locally or remotely at PSiGate?', '6', '5', 'tep_cfg_select_option(array(\'Local\', \'Remote\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('PSiGate Transaction Currency', 'MODULE_PAYMENT_PSIGATE_CURRENCY', 'USD', 'The currency to use for credit card transactions', '6', '6', 'tep_cfg_select_option(array(\'CAD\', \'USD\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('PSiGate Sort order of display.', 'MODULE_PAYMENT_PSIGATE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('PSiGate Payment Zone', 'MODULE_PAYMENT_PSIGATE_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('PSiGate Set Order Status', 'MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_PSIGATE_STATUS', 'MODULE_PAYMENT_PSIGATE_MERCHANT_ID', 'MODULE_PAYMENT_PSIGATE_TRANSACTION_MODE', 'MODULE_PAYMENT_PSIGATE_TRANSACTION_TYPE', 'MODULE_PAYMENT_PSIGATE_INPUT_MODE', 'MODULE_PAYMENT_PSIGATE_CURRENCY', 'MODULE_PAYMENT_PSIGATE_ZONE', 'MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID', 'MODULE_PAYMENT_PSIGATE_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/qchex.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/qchex.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/qchex.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,141 @@
+<?php
+/*
+  $Id: qchex.php,v 3.0 2003/11/10 2:21:32 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+   class qchex {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function qchex() {
+      global $order;
+
+      $this->code = 'qchex';
+      $this->title = MODULE_PAYMENT_QCHEX_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_QCHEX_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_QCHEX_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_QCHEX_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_QCHEX_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_QCHEX_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://www.qchex.com/pay.asp';
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_QCHEX_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_QCHEX_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+      return array('id' => $this->code,
+                   'module' => $this->title);
+    }
+
+    function pre_confirmation_check() {
+      return false;
+    }
+
+    function confirmation() {
+      return false;
+    }
+
+    function process_button() {
+      global $order, $currencies, $currency;
+
+      if (MODULE_PAYMENT_PAYPAL_CURRENCY == 'Selected Currency') {
+        $my_currency = 'USD';
+      } else {
+        $my_currency = substr(MODULE_PAYMENT_PAYPAL_CURRENCY, 5);
+      }
+      if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) {
+        $my_currency = 'USD';
+      }
+
+      $process_button_string = tep_draw_hidden_field('MerchantID', MODULE_PAYMENT_QCHEX_ID) .
+                               tep_draw_hidden_field('Memo', 'Online Purchase') .
+                               tep_draw_hidden_field('RefNo', ($order->info['order_id'] + 1)) .
+                               tep_draw_hidden_field('PayorName', $order->billing['firstname'] . ' ' . $order->billing['lastname']) .
+                               tep_draw_hidden_field('PayorEmail', $order->customer['email_address']) .
+                               tep_draw_hidden_field('Amount', number_format(($order->info['total']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) .
+                               tep_draw_hidden_field('ReturnTo', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'));
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      return false;
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function output_error() {
+      return false;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_QCHEX_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable QChex Module', 'MODULE_PAYMENT_QCHEX_STATUS', 'True', 'Do you want to accept QCHEX payments?', '6', '3', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('MerchantID', 'MODULE_PAYMENT_QCHEX_ID', '', 'Your QChex MerchantID', '6', '4', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_QCHEX_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_QCHEX_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_QCHEX_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+              $keys = '';
+              $keys_array = $this->keys();
+              for ($i=0; $i<sizeof($keys_array); $i++) {
+                $keys .= "'" . $keys_array[$i] . "',";
+              }
+              $keys = substr($keys, 0, -1);
+
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_QCHEX_STATUS', 'MODULE_PAYMENT_QCHEX_ID', 'MODULE_PAYMENT_QCHEX_ZONE', 'MODULE_PAYMENT_QCHEX_ORDER_STATUS_ID', 'MODULE_PAYMENT_QCHEX_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/quickcommerce.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/quickcommerce.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/quickcommerce.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,323 @@
+<?php
+/*
+  $Id: quickcommerce.php,v 1.4 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  This modules based on Quickcommerce Consolidated 1.7
+   Author: Austin Renfroe (Austin519), some code thanks to dreamscape
+  Email: Austin519 at aol.com
+
+*/
+
+ define('FILENAME_QUICKCOMMERCE_HELP', 'quickcom_help.php');
+
+  class quickcommerce {
+    var $code, $title, $description, $enabled, $sort_order;
+    var $accepted_cc, $card_types, $allowed_types;
+
+// class constructor
+  function quickcommerce() {
+    global $order;
+    $this->code = 'quickcommerce';
+    $this->title = MODULE_PAYMENT_QUICKCOMMERCE_TEXT_TITLE;
+    $this->description = MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DESCRIPTION;
+    $this->sort_order = MODULE_PAYMENT_QUICKCOMMERCE_SORT_ORDER;
+    $this->enabled = ((MODULE_PAYMENT_QUICKCOMMERCE_STATUS == 'True') ? true : false);
+    $this->accepted_cc = MODULE_PAYMENT_QUICKCOMMERCE_ACCEPTED_CC;
+
+    if ((int)MODULE_PAYMENT_QUICKCOMMERCE_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_QUICKCOMMERCE_ORDER_STATUS_ID;
+    }
+
+    if (is_object($order)) $this->update_status();
+
+    //array for credit card selection
+    $this->card_types = array('Amex' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_AMEX,
+        'Mastercard' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_MASTERCARD,
+        'Discover' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_DISCOVER,
+        'Visa' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_VISA);
+    $this->allowed_types = array();
+
+    // Credit card pulldown list
+    $cc_array = explode(', ', MODULE_PAYMENT_QUICKCOMMERCE_ACCEPTED_CC);
+    while (list($key, $value) = each($cc_array)) {
+      $this->allowed_types[$value] = $this->card_types[$value];
+    }
+
+    // Processing via Quickcommerce AIM
+    $this->form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false);
+  }
+
+// class methods
+  function update_status() {
+    global $order;
+    if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_QUICKCOMMERCE_ZONE > 0) ) {
+      $check_flag = false;
+      $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_QUICKCOMMERCE_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+      while ($check = tep_db_fetch_array($check_query)) {
+        if ($check['zone_id'] < 1) {
+          $check_flag = true;
+          break;
+        } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+          $check_flag = true;
+          break;
+        }
+      }
+      if ($check_flag == false) {
+        $this->enabled = false;
+      }
+    }
+  }
+
+
+//concatenate to get CC images
+function get_cc_images() {
+  $cc_images = '';
+  reset($this->allowed_types);
+  while (list($key, $value) = each($this->allowed_types)) {
+    $cc_images .= tep_image(DIR_WS_ICONS . $key . '.gif', $value);
+  }
+  return $cc_images;
+}
+
+function javascript_validation() {
+   if(MODULE_PAYMENT_QUICKCOMMERCE_CCV  == 'True' ) {
+      $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.quickcommerce_cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.quickcommerce_cc_number.value;' . "\n" .
+            '    var cc_cvv = document.checkout_payment.cvv.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+             '    if (cc_cvv != "" && cc_cvv.length < "3") {' . "\n".
+            '      error_message = error_message + "' . MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_CVV . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+          }else{
+    $js = '  if (payment_value == "' . $this->code . '") {' . "\n" .
+            '    var cc_owner = document.checkout_payment.quickcommerce_cc_owner.value;' . "\n" .
+            '    var cc_number = document.checkout_payment.quickcommerce_cc_number.value;' . "\n" .
+            '    var cc_cvv = document.checkout_payment.cvv.value;' . "\n" .
+            '    if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_OWNER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '    if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .
+            '      error_message = error_message + "' . MODULE_PAYMENT_QUICKCOMMERCE_TEXT_JS_CC_NUMBER . '";' . "\n" .
+            '      error = 1;' . "\n" .
+            '    }' . "\n" .
+            '  }' . "\n";
+    }
+
+      return $js;
+    }
+
+    function selection() {
+      global $order;
+  reset($this->allowed_types);
+  while (list($key, $value) = each($this->allowed_types)) {
+    $card_menu[] = array('id' => $key, 'text' => $value);
+  }
+
+      for ($i=1; $i<13; $i++) {
+        $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
+      }
+
+      $today = getdate();
+      for ($i=$today['year']; $i < $today['year']+10; $i++) {
+        $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
+      }
+if(MODULE_PAYMENT_QUICKCOMMERCE_CCV == 'True' ) {
+  $selection = array('id' => $this->code,
+    'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images(),
+    'fields' => array(array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_TYPE,
+      'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+    array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_OWNER,
+      'field' => tep_draw_input_field('quickcommerce_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+    array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_NUMBER,
+      'field' => tep_draw_input_field('quickcommerce_cc_number')),
+    array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_EXPIRES,
+      'field' => tep_draw_pull_down_menu('quickcommerce_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('quickcommerce_cc_expires_year', $expires_year)),
+      array('title' => 'CVV number ' . ' ' .'<a href="javascript:CVVPopUpWindow(\'' . tep_href_link('cvv.html') . '\')">' . '<u><i>' . '(' . MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CVV_LINK . ')' . '</i></u></a>',
+      'field' => tep_draw_input_field('cvv','',"SIZE=4, MAXLENGTH=4"))));
+ }else{
+$selection = array('id' => $this->code,
+    'module' => $this->title . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->get_cc_images(),
+    'fields' => array(array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_TYPE,
+      'field' => tep_draw_pull_down_menu('credit_card_type', $card_menu)),
+    array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_OWNER,
+      'field' => tep_draw_input_field('quickcommerce_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
+    array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_NUMBER,
+      'field' => tep_draw_input_field('quickcommerce_cc_number')),
+    array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_EXPIRES,
+      'field' => tep_draw_pull_down_menu('quickcommerce_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('quickcommerce_cc_expires_year', $expires_year))));
+ }
+     return $selection;
+    }
+
+    function pre_confirmation_check() {
+      global $HTTP_POST_VARS, $cvv;
+      include(DIR_WS_CLASSES . 'cc_validation.php');
+      $cc_validation = new cc_validation();
+  $result = $cc_validation->validate($HTTP_POST_VARS['quickcommerce_cc_number'], $HTTP_POST_VARS['quickcommerce_cc_expires_month'], $HTTP_POST_VARS['quickcommerce_cc_expires_year'], $HTTP_POST_VARS['cvv'], $HTTP_POST_VARS['credit_card_type']);
+      $error = '';
+  switch ($result) {
+    case -1:
+      $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
+      break;
+    case -2:
+    case -3:
+    case -4:
+      $error = TEXT_CCVAL_ERROR_INVALID_DATE;
+      break;
+    case -5:
+      $error = TEXT_CCVAL_ERROR_CARD_TYPE_MISMATCH;
+      break;
+    case -6;
+      $error = TEXT_CCVAL_ERROR_CVV_LENGTH;
+      break;
+    case false:
+      $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
+      break;
+  }
+
+      if ( ($result == false) || ($result < 1) ) {
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&quickcommerce_cc_owner=' . urlencode($HTTP_POST_VARS['quickcommerce_cc_owner']) . '&quickcommerce_cc_expires_month=' . $HTTP_POST_VARS['quickcommerce_cc_expires_month'] . '&quickcommerce_cc_expires_year=' . $HTTP_POST_VARS['quickcommerce_cc_expires_year'];
+        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
+      }
+
+      $this->cc_card_type = $cc_validation->cc_type;
+      $this->cc_card_number = $cc_validation->cc_number;
+      $this->cc_expiry_month = $cc_validation->cc_expiry_month;
+      $this->cc_expiry_year = $cc_validation->cc_expiry_year;
+      $x_Card_Code = $HTTP_POST_VARS['cvv'];
+    }
+
+    function confirmation() {
+      global $HTTP_POST_VARS, $x_Card_Code;
+       $x_Card_Code=$HTTP_POST_VARS['cvv'];
+       $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,
+                            'fields' => array(array('title' => 'CVV number',
+                                                    'field' => $HTTP_POST_VARS['cvv']),
+                                                    array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_OWNER,
+                                                    'field' => $HTTP_POST_VARS['quickcommerce_cc_owner']),
+                                              array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_NUMBER,
+                                                    'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
+                                              array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_CREDIT_CARD_EXPIRES,
+                                                    'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['quickcommerce_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['quickcommerce_cc_expires_year'])))));
+      $x_Card_Code=$HTTP_POST_VARS['cvv'];
+      return $confirmation;
+    }
+
+    function process_button() {
+     // Change made by using ADC Direct Connection
+
+      $process_button_string = tep_draw_hidden_field('x_Card_Code', $HTTP_POST_VARS['cvv']) .
+                               tep_draw_hidden_field('x_Card_Num', $this->cc_card_number) .
+                               tep_draw_hidden_field('x_Exp_Date', $this->cc_expiry_month . substr($this->cc_expiry_year, -2));
+
+      $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $response;
+
+      // Change made by using ADC Direct Connection
+      $response_vars = explode(',', $response[0]);
+      $x_response_code = $response_vars[0];
+      $x_response_subcode = $response_vars[1];
+      $x_response_reason_code = $response_vars[2];
+      $x_response_reason_text = $response_vars[3];
+
+      if ($x_response_code != '1') {
+        tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$insert_id . "'"); //Remove order
+        if($x_response_code == '') {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('The server cannot connect to Quickcommerce.  Please check your cURL and server settings.'), 'SSL', true, false));
+        } else if($x_response_code == '2') {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('Your credit card was declined ') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false));
+        } else if($x_response_code == '3') {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an error processing your credit card ') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false));
+        } else {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an unspecified error processing your credit card.'), 'SSL', true, false));
+        }
+      }
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      $error = array('title' => MODULE_PAYMENT_QUICKCOMMERCE_TEXT_ERROR,
+                     'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));
+      return $error;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_QUICKCOMMERCE_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order,  date_added) values ('Authorizenet - Setup Help', 'MODULE_PAYMENT_QUICKCOMMERCE_HELP', '<a style=\"color: #0033cc;\" href=\"" . tep_href_link(FILENAME_QUICKCOMMERCE_HELP, '', 'NONSSL') . "\" target=\"authnetHelp\"> [Setup Help]</a><br>', '<a style=\"color: #0033cc;\" href=\"" . tep_href_link(FILENAME_QUICKCOMMERCE_HELP, '', 'NONSSL') . "\" target=\"authnetHelp\"> [Setup Help]</a><br>', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Quickcommerce Module', 'MODULE_PAYMENT_QUICKCOMMERCE_STATUS', 'True', 'Do you want to accept payments through Quickcommerce?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login Username', 'MODULE_PAYMENT_QUICKCOMMERCE_LOGIN', 'Your Login Name', 'The login username used for the Quickcommerce service', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login Transaction Key', 'MODULE_PAYMENT_QUICKCOMMERCE_TRANSKEY', 'Your Transaction Key', 'The transaction key used for the Quickcommerce service', '6', '0', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('cURL Setup', 'MODULE_PAYMENT_QUICKCOMMERCE_CURL', 'Not Compiled', 'Whether cURL is compiled into PHP or not.  Windows users, select not compiled.', '6', '0', 'tep_cfg_select_option(array(\'Not Compiled\', \'Compiled\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Path', 'MODULE_PAYMENT_QUICKCOMMERCE_CURL_PATH', 'The Path To cURL', 'For Not Compiled mode only, input path to the cURL binary (i.e. c:/curl/curl)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Test And Debug\', \'Production\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Method', 'MODULE_PAYMENT_QUICKCOMMERCE_METHOD', 'Credit Card', 'Transaction method used for processing orders', '6', '0', 'tep_cfg_select_option(array(\'Credit Card\', \'eCheck\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Processing Mode', 'MODULE_PAYMENT_QUICKCOMMERCE_CCMODE', 'Authorize And Capture', 'Credit card processing mode', '6', '0', 'tep_cfg_select_option(array(\'Authorize And Capture\', \'Authorize Only\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order Of Display', 'MODULE_PAYMENT_QUICKCOMMERCE_SORT_ORDER', '200', 'The order in which this payment type is dislayed. Lowest is displayed first.', '6', '0' , now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_QUICKCOMMERCE_EMAIL_CUSTOMER', 'False', 'Should Authorize.Net e-mail a receipt to the customer?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Accepted Credit Cards', 'MODULE_PAYMENT_QUICKCOMMERCE_ACCEPTED_CC', 'Mastercard, Visa', 'The credit cards you currently accept', '6', '0', '_selectOptionsq(array(\'Amex\',\'Discover\', \'Mastercard\', \'Visa\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Authorizenet - Payment Zone', 'MODULE_PAYMENT_QUICKCOMMERCE_ZONE', '0', 'Authorizenet - If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CCV code', 'MODULE_PAYMENT_QUICKCOMMERCE_CCV', 'True', 'Do you want to enable ccv code checking?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Authorizenet - Set Order Status', 'MODULE_PAYMENT_QUICKCOMMERCE_ORDER_STATUS_ID', '0', 'Authorizenet - Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+   }
+
+    function remove() {
+      $keys = '';
+      $keys_array = $this->keys();
+      for ($i=0; $i<sizeof($keys_array); $i++) {
+        $keys .= "'" . $keys_array[$i] . "',";
+      }
+      $keys = substr($keys, 0, -1);
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_QUICKCOMMERCE_STATUS', 'MODULE_PAYMENT_QUICKCOMMERCE_LOGIN', 'MODULE_PAYMENT_QUICKCOMMERCE_TRANSKEY', 'MODULE_PAYMENT_QUICKCOMMERCE_CURL', 'MODULE_PAYMENT_QUICKCOMMERCE_CURL_PATH', 'MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE', 'MODULE_PAYMENT_QUICKCOMMERCE_METHOD', 'MODULE_PAYMENT_QUICKCOMMERCE_CCMODE', 'MODULE_PAYMENT_QUICKCOMMERCE_SORT_ORDER', 'MODULE_PAYMENT_QUICKCOMMERCE_EMAIL_CUSTOMER', 'MODULE_PAYMENT_QUICKCOMMERCE_ACCEPTED_CC', 'MODULE_PAYMENT_QUICKCOMMERCE_ZONE', 'MODULE_PAYMENT_QUICKCOMMERCE_ORDER_STATUS_ID', 'MODULE_PAYMENT_QUICKCOMMERCE_CCV','MODULE_PAYMENT_QUICKCOMMERCE_HELP');
+    }
+  }
+
+// Quickcommerce Consolidated Credit Card Checkbox Implementation
+// Code from UPS Choice v1.7 - Fritz Clapp (aka dreamscape, thanks Fritz!)
+function _selectOptionsq($select_array, $key_value, $key = '') {
+  for ($i=0; $i<(sizeof($select_array)); $i++) {
+    $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
+    $string .= '<br><input type="checkbox" name="' . $name . '" value="' . $select_array[$i] . '"';
+    $key_values = explode(", ", $key_value);
+    if (in_array($select_array[$i], $key_values)) $string .= ' checked="checked"';
+    $string .= '> ' . $select_array[$i];
+  }
+  return $string;
+}
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/secpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/secpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/secpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,188 @@
+<?php
+/*
+  $Id: secpay.php,v 1.1.1.1 2004/03/04 23:41:22 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class secpay {
+    var $code, $title, $description, $enabled;
+
+// class constructor
+    function secpay() {
+      global $order;
+
+      $this->code = 'secpay';
+      $this->title = MODULE_PAYMENT_SECPAY_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_SECPAY_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_SECPAY_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_SECPAY_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_SECPAY_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_SECPAY_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://www.secpay.com/java-bin/ValCard';
+    }
+
+// class methods
+    function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SECPAY_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_SECPAY_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+    function javascript_validation() {
+      return false;
+    }
+
+    function selection() {
+      return array('id' => $this->code,
+                   'module' => $this->title);
+    }
+
+    function pre_confirmation_check() {
+      return false;
+    }
+
+    function confirmation() {
+      return false;
+    }
+
+    function process_button() {
+      global $order, $currencies, $currency;
+
+      switch (MODULE_PAYMENT_SECPAY_CURRENCY) {
+        case 'Default Currency':
+          $sec_currency = DEFAULT_CURRENCY;
+          break;
+        case 'Any Currency':
+        default:
+          $sec_currency = $currency;
+          break;
+      }
+
+      switch (MODULE_PAYMENT_SECPAY_TEST_STATUS) {
+        case 'Always Fail':
+          $test_status = 'false';
+          break;
+        case 'Production':
+          $test_status = 'live';
+          break;
+        case 'Always Successful':
+        default:
+          $test_status = 'true';
+          break;
+      }
+
+      $process_button_string = tep_draw_hidden_field('merchant', MODULE_PAYMENT_SECPAY_MERCHANT_ID) .
+                               tep_draw_hidden_field('trans_id', STORE_NAME . date('Ymdhis')) .
+                               tep_draw_hidden_field('amount', number_format($order->info['total'] * $currencies->get_value($sec_currency), $currencies->currencies[$sec_currency]['decimal_places'], '.', '')) .
+                               tep_draw_hidden_field('bill_name', $order->billing['firstname'] . ' ' . $order->billing['lastname']) .
+                               tep_draw_hidden_field('bill_addr_1', $order->billing['street_address']) .
+                               tep_draw_hidden_field('bill_addr_2', $order->billing['suburb']) .
+                               tep_draw_hidden_field('bill_city', $order->billing['city']) .
+                               tep_draw_hidden_field('bill_state', $order->billing['state']) .
+                               tep_draw_hidden_field('bill_post_code', $order->billing['postcode']) .
+                               tep_draw_hidden_field('bill_country', $order->billing['country']['title']) .
+                               tep_draw_hidden_field('bill_tel', $order->customer['telephone']) .
+                               tep_draw_hidden_field('bill_email', $order->customer['email_address']) .
+                               tep_draw_hidden_field('ship_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) .
+                               tep_draw_hidden_field('ship_addr_1', $order->delivery['street_address']) .
+                               tep_draw_hidden_field('ship_addr_2', $order->delivery['suburb']) .
+                               tep_draw_hidden_field('ship_city', $order->delivery['city']) .
+                               tep_draw_hidden_field('ship_state', $order->delivery['state']) .
+                               tep_draw_hidden_field('ship_post_code', $order->delivery['postcode']) .
+                               tep_draw_hidden_field('ship_country', $order->delivery['country']['title']) .
+                               tep_draw_hidden_field('currency', $sec_currency) .
+                               tep_draw_hidden_field('callback', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false) . ';' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL', false)) .
+                               tep_draw_hidden_field(tep_session_name(), tep_session_id()) .
+                               tep_draw_hidden_field('options', 'test_status=' . $test_status . ',dups=false,cb_post=true,cb_flds=' . tep_session_name());
+
+      return $process_button_string;
+    }
+
+    function before_process() {
+      global $HTTP_POST_VARS;
+
+      if ($HTTP_POST_VARS['valid'] == 'true') {
+        if ($remote_host = getenv('REMOTE_HOST')) {
+          if ($remote_host != 'secpay.com') {
+            $remote_host = gethostbyaddr($remote_host);
+          }
+          if ($remote_host != 'secpay.com') {
+            tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false));
+          }
+        } else {
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false));
+        }
+      }
+    }
+
+    function after_process() {
+      return false;
+    }
+
+    function get_error() {
+      global $HTTP_GET_VARS;
+
+      if (isset($HTTP_GET_VARS['message']) && (strlen($HTTP_GET_VARS['message']) > 0)) {
+        $error = stripslashes(urldecode($HTTP_GET_VARS['message']));
+      } else {
+        $error = MODULE_PAYMENT_SECPAY_TEXT_ERROR_MESSAGE;
+      }
+
+      return array('title' => MODULE_PAYMENT_SECPAY_TEXT_ERROR,
+                   'error' => $error);
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_SECPAY_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable SECpay Module', 'MODULE_PAYMENT_SECPAY_STATUS', 'True', 'Do you want to accept SECPay payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('SECpay Merchant ID', 'MODULE_PAYMENT_SECPAY_MERCHANT_ID', 'secpay', 'Merchant ID to use for the SECPay service', '6', '2', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('SECpay Transaction Currency', 'MODULE_PAYMENT_SECPAY_CURRENCY', 'Any Currency', 'The currency to use for credit card transactions', '6', '3', 'tep_cfg_select_option(array(\'Any Currency\', \'Default Currency\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('SECpay Transaction Mode', 'MODULE_PAYMENT_SECPAY_TEST_STATUS', 'Always Successful', 'Transaction mode to use for the SECPay service', '6', '4', 'tep_cfg_select_option(array(\'Always Successful\', \'Always Fail\', \'Production\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('SECpay Sort order of display.', 'MODULE_PAYMENT_SECPAY_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('SECpay Payment Zone', 'MODULE_PAYMENT_SECPAY_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('SECpay Set Order Status', 'MODULE_PAYMENT_SECPAY_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_PAYMENT_SECPAY_STATUS', 'MODULE_PAYMENT_SECPAY_MERCHANT_ID', 'MODULE_PAYMENT_SECPAY_CURRENCY', 'MODULE_PAYMENT_SECPAY_TEST_STATUS', 'MODULE_PAYMENT_SECPAY_ZONE', 'MODULE_PAYMENT_SECPAY_ORDER_STATUS_ID', 'MODULE_PAYMENT_SECPAY_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/payment/worldpay.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/payment/worldpay.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/payment/worldpay.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,203 @@
+<?php
+/*
+  $Id: worldpay.php,v MS1a 2003/04/06 21:30
+  Author : Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.6
+
+  Revisions:
+  
+Paulz added minor changes to enable control of 'Payment Zone' added function update_status
+Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+        Now posting language code to WP, Redirect on failure now to Checkout Payment,
+Reduced re-direct time to 8 seconds, added MD5, made callback dynamic
+NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+Version 1.4 Removes boxes to prevent users from clicking away before update,
+Fixes currency for Yen,
+Redirects to Checkout_Process after 10 seconds or click by user
+Version 1.3 Fixes problem with Multi Currency
+Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+Version 1.1 Added Worldpay Pre-Authorisation ability
+Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+  class worldpay {
+    var $code, $title, $description, $enabled, $sort_order;
+
+// class constructor
+    function worldpay() {
+    global $order;
+      $this->code = 'worldpay';
+      $this->title = MODULE_PAYMENT_WORLDPAY_TEXT_TITLE;
+      $this->description = MODULE_PAYMENT_WORLDPAY_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_PAYMENT_WORLDPAY_SORT_ORDER;
+      $this->enabled = ((MODULE_PAYMENT_WORLDPAY_STATUS == 'True') ? true : false);
+
+      if ((int)MODULE_PAYMENT_WORLDPAY_ORDER_STATUS_ID > 0) {
+        $this->order_status = MODULE_PAYMENT_WORLDPAY_ORDER_STATUS_ID;
+      }
+
+      if (is_object($order)) $this->update_status();
+
+      $this->form_action_url = 'https://select.worldpay.com/wcc/purchase';
+
+      }
+
+      // class methods
+      function update_status() {
+      global $order;
+
+      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_WORLDPAY_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_WORLDPAY_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->billing['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+
+      }
+      }
+
+// class methods
+      function javascript_validation() {
+        return false;
+      }
+
+      function selection() {
+        return array('id' => $this->code,
+                     'module' => $this->title);
+      }
+
+      function pre_confirmation_check() {
+        return false;
+      }
+
+      function confirmation() {
+        return false;
+      }
+
+      function process_button() {
+// Ian-san: Need to declare language_id global here 6/4/2003:
+      global $HTTP_POST_VARS, $languages_id, $shipping_cost, $total_cost, $shipping_selected, $shipping_method, $currencies, $currency, $customer_id , $order;
+      $worldpay_url = tep_session_name() . '=' . tep_session_id();
+
+// Multi Currency - Graeme Conkie ver 1.3 - Set up variable
+// Added decimal point code - contributed by Ian Davidson (Feb 08,2003) - For Yen currency
+      $OrderAmt = number_format($order->info['total'] * $currencies->get_value($currency), $currencies->get_decimal_places($currency), '.', '') ;
+
+// Multi Currency - ver 1.3
+      $process_button_string =
+      tep_draw_hidden_field('instId', MODULE_PAYMENT_WORLDPAY_ID) .
+      tep_draw_hidden_field('currency', $currency) .
+      tep_draw_hidden_field('desc', 'Purchase from '.STORE_NAME) .
+
+// Send URL and session name - contributed by Nick Vermeulen 08 Feb, 2003
+      tep_draw_hidden_field('cartId', $worldpay_url ) .
+
+// Assign Multi Currency Variable to Amount
+      tep_draw_hidden_field('amount', $OrderAmt) ;
+
+// Pre Auth Mod 3/1/2002 - Graeme Conkie
+      if (MODULE_PAYMENT_WORLDPAY_USEPREAUTH == 'True') $process_button_string .= tep_draw_hidden_field('authMode', MODULE_PAYMENT_WORLDPAY_PREAUTH);
+
+// Ian-san: Create callback and language links here 6/4/2003:
+//      $callback_url = tep_href_link(FILENAME_WPCALLBACK);
+      $h_header = (ENABLE_SSL ? 'https://' : 'http://');
+      $callback_url = tep_href_link(FILENAME_WPCALLBACK, 'language=' . $language_code, (ENABLE_SSL ? 'SSL' : 'NONSSL'), true);
+      $worldpay_callback = explode($h_header, $callback_url);
+      $language_code_raw = tep_db_query("select code from " . TABLE_LANGUAGES . " where languages_id ='$languages_id'");
+      $language_code_array = tep_db_fetch_array($language_code_raw);
+      $language_code = $language_code_array['code'];
+
+      $address = htmlspecialchars($order->customer['street_address'] . "\n" . $order->customer['suburb'] . "\n" . $order->customer['city'] . "\n" . $order->customer['state'], ENT_QUOTES);
+      $process_button_string .=
+        tep_draw_hidden_field('testMode', MODULE_PAYMENT_WORLDPAY_MODE) .
+        tep_draw_hidden_field('name', $order->customer['firstname'] . ' ' . $order->customer['lastname']) .
+        tep_draw_hidden_field('address', $address) .
+        tep_draw_hidden_field('postcode', $order->customer['postcode']) .
+        tep_draw_hidden_field('country', $order->customer['country']['iso_code_2']) .
+        tep_draw_hidden_field('tel', $order->customer['telephone']) .
+        tep_draw_hidden_field('myvar', 'Y') .
+        tep_draw_hidden_field('fax', $order->customer['fax']) .
+        tep_draw_hidden_field('email', $order->customer['email_address']) .
+
+// Ian-san: Added dynamic callback and languages link here 6/4/2003:
+        tep_draw_hidden_field('lang', $language_code) .
+        tep_draw_hidden_field('MC_callback', $worldpay_callback[1]) .
+        tep_draw_hidden_field('MC_oscsid', $oscSid);
+
+// Ian-san: Added MD5 here 6/4/2003:
+      if (MODULE_PAYMENT_WORLDPAY_USEMD5 == '1') {
+        $md5_signature_fields = 'amount:language:email';
+        $md5_signature = MODULE_PAYMENT_WORLDPAY_MD5KEY . ':' . (number_format($order->info['total'] * $currencies->get_value($currency), $currencies->get_decimal_places($currency), '.', '')) . ':' . $language_code . ':' . $order->customer['email_address'];
+        $md5_signature_md5 = md5($md5_signature);
+
+        $process_button_string .= tep_draw_hidden_field('signatureFields', $md5_signature_fields ) .
+                                  tep_draw_hidden_field('signature',$md5_signature_md5);
+      }
+        return $process_button_string ;
+      }
+
+      function before_process() {
+        global $HTTP_POST_VARS;
+      }
+
+      function after_process() {
+        return false;
+      }
+
+      function output_error() {
+        return false;
+      }
+
+      function check() {
+        if (!isset($this->_check)) {
+          $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_WORLDPAY_STATUS'");
+          $this->_check = tep_db_num_rows($check_query);
+        }
+        return $this->_check;
+      }
+
+      function install() {
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable WorldPay Module', 'MODULE_PAYMENT_WORLDPAY_STATUS', 'True', 'Do you want to accept WorldPay payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Worldpay Installation ID', 'MODULE_PAYMENT_WORLDPAY_ID', '00000', 'Your WorldPay Select Junior ID', '6', '2', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Mode', 'MODULE_PAYMENT_WORLDPAY_MODE', '100', 'The mode you are working in (100 = Test Mode Accept, 101 = Test Mode Decline, 0 = Live', '6', '5', now())");
+
+// Ian-san: Added MD5 here 6/4/2003:
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Use MD5', 'MODULE_PAYMENT_WORLDPAY_USEMD5', '0', 'Use MD5 encyption for transactions? (1 = Yes, 0 = No)', '6', '4', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('MD5 secret key', 'MODULE_PAYMENT_WORLDPAY_MD5KEY', '', 'MD5 secret key. Must also be entered into Worldpay installation config', '6', '5', now())");
+
+// Pre Auth Mod - Graeme Conkie 13/1/2003
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_WORLDPAY_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Use Pre-Authorisation?', 'MODULE_PAYMENT_WORLDPAY_USEPREAUTH', 'False', 'Do you want to pre-authorise payments? Default=False. You need to request this from WorldPay before using it.', '6', '3', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_WORLDPAY_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Pre-Auth', 'MODULE_PAYMENT_WORLDPAY_PREAUTH', 'A', 'The mode you are working in (A = Pay Now, E = Pre Auth). Ignored if Use PreAuth is False.', '6', '4', now())");
+// Paulz zone control 04/04/2004        
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_WORLDPAY_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+// Ian-san: Added MD5 here 6/4/2003:
+        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_WORLDPAY_USEMD5'");
+        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_WORLDPAY_MD5KEY'");
+      }
+
+      function remove() {
+        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+      }
+
+      function keys() {
+        return array('MODULE_PAYMENT_WORLDPAY_STATUS', 'MODULE_PAYMENT_WORLDPAY_ID','MODULE_PAYMENT_WORLDPAY_MODE','MODULE_PAYMENT_WORLDPAY_USEPREAUTH','MODULE_PAYMENT_WORLDPAY_PREAUTH','MODULE_PAYMENT_WORLDPAY_ZONE','MODULE_PAYMENT_WORLDPAY_SORT_ORDER','MODULE_PAYMENT_WORLDPAY_ORDER_STATUS_ID');
+      }
+    }
+?>

Added: trunk/direct.openmoko.com/includes/modules/plugnpay_api.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/plugnpay_api.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/plugnpay_api.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,172 @@
+<?php
+/*
+  osCommerce 2.2 Open Source E-Commerce Solutions
+  PlugnPay API Connection
+
+  Last Update: 01/17/05 
+*/
+
+
+        # perform hack to discover the 2 letter state abrev, if necessary 
+        if (MODULE_PAYMENT_PLUGNPAY_SEND_STATE_CODE == 'yes') {
+          # lookup billing zone_code (AKA - 2 letter state abrev)
+          $zone_query1 = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_country_id = '" . (int)$order->billing['country']['id'] . "' and (zone_name like '" . tep_db_input($order->billing['state']) . "%' or zone_code like '%" . tep_db_input($order->billing['state']) . "%')");
+          if (tep_db_num_rows($zone_query1) == 1) {
+            $zone1 = tep_db_fetch_array($zone_query1);
+            $bill_state = $zone1['zone_code'];
+          }
+          else {
+            $bill_state = $order->billing['state'];
+          }
+
+          # lookup shipping zone_code (AKA - 2 letter state abrev)
+          $zone_query2 = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_country_id = '" . (int)$order->delivery['country']['id'] . "' and (zone_name like '" . tep_db_input($order->delivery['state']) . "%' or zone_code like '%" . tep_db_input($order->delivery['state']) . "%')");
+          if (tep_db_num_rows($zone_query2) == 1) {
+            $zone2 = tep_db_fetch_array($zone_query2);
+            $ship_state = $zone2['zone_code'];
+          }
+          else {
+            $ship_state = $order->delivery['state'];
+          }
+        }
+        else {
+          $bill_state = $order->billing['state'];
+          $ship_state = $order->delivery['state'];
+        }
+
+        # reset PnP tax total
+        $pnp_tax = 0;
+
+  unset($form_data);
+
+        # start building submit array
+  $form_data = array(
+          publisher_name => MODULE_PAYMENT_PLUGNPAY_LOGIN,
+          publisher_email => MODULE_PAYMENT_PLUGNPAY_PUBLISHER_EMAIL,
+          mode => 'auth',
+          convert => 'underscores',
+          easycart => '1',
+          shipinfo => '1',
+          client => 'osCommerce_API',
+          authtype => MODULE_PAYMENT_PLUGNPAY_CCMODE == 'Authorization Type' ? 'authonly' : 'authpostauth',
+          card_amount => number_format($order->info['total'], 2),
+          currency => "{$order->info['currency']}",
+          dontsndmail => MODULE_PAYMENT_PLUGNPAY_DONTSNDMAIL == 'yes' ? 'yes': 'no',
+          order_id => "$customer_id",
+          orderID => "$insert_id",
+          card_name => "{$order->billing['firstname']} {$order->billing['lastname']}",
+          card_company => "{$order->billing['company']}",
+          card_address1 => "{$order->billing['street_address']}",
+          card_city => "{$order->billing['city']}",
+          card_state => "$bill_state",
+          card_zip => "{$order->billing['postcode']}",
+          card_country => "{$order->billing['country']['title']}",
+          phone => "{$order->customer['telephone']}",
+          email => "{$order->customer['email_address']}",
+          shipname => "{$order->delivery['firstname']} {$order->delivery['lastname']}",
+          company => "{$order->delivery['company']}", 
+          address1 => "{$order->delivery['street_address']}",
+          city => "{$order->delivery['city']}",
+          state => "$ship_state",
+          zip => "{$order->delivery['postcode']}",
+          country => "{$order->delivery['country']['title']}",
+          ipaddress => "{$HTTP_SERVER_VARS['REMOTE_ADDR']}",
+          tep_session_name() => tep_session_id()
+        );
+
+        for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
+          $j = $i + 1;
+          $form_data["item$j"] = $order->products[$i]['model'];
+          $form_data["cost$j"] = $order->products[$i]['final_price'];
+          $form_data["quantity$j"] = $order->products[$i]['qty'];
+          $form_data["description$j"] = $order->products[$i]['name'];
+
+          $pnp_tax += ($order->products[$i]['final_price'] * $order->products[$i]['qty']) * ($order->products[$i]['tax'] / 100);
+        }
+
+        $form_data["shipping"] = $order->info['shipping_cost'];
+        $form_data["tax"] = $pnp_tax;
+
+
+        if ((MODULE_PAYMENT_PLUGNPAY_PAYMETHOD == "onlinecheck") && ($HTTP_POST_VARS['plugnpay_paytype'] == 'echeck')) {
+          // use electronic check info
+          $form_data['paymethod'] = 'onlinecheck';
+          $form_data['accttype'] = $this->echeck_accttype;
+          $form_data['accountnum'] = $this->echeck_accountnum;
+          $form_data['routingnum'] = $this->echeck_routingnum;
+          $form_data['checknum'] = $this->echeck_checknum;
+        }
+        else {
+          // or assume credit card info
+          $form_data['paymethod'] = 'credit';
+          $form_data['card_number'] = "$card_number";
+          $form_data['card_exp'] = "$card_exp";
+          if(MODULE_PAYMENT_PLUGNPAY_CVV == 'yes') {
+            $form_data['card_cvv'] = "$card_cvv";
+          }
+        }
+
+  if((MODULE_PAYMENT_PLUGNPAY_TESTMODE == 'Test') && (MODULE_PAYMENT_PLUGNPAY_TESTMODE == 'Test And Debug')) {
+          $form_data['mode'] = 'debug';
+  }
+
+  // concatenate order information variables to $data
+  while(list($key, $value) = each($form_data)) {
+          $data .= $key . '=' . urlencode(ereg_replace(',', '', $value)) . '&';
+  }
+  
+  // take the last & out for the string
+  $data = substr($data, 0, -1);
+
+  /* Debug code - will dump cURL data to a file when
+   * the admin module Transaction Mode is set to Test and Debug.
+   * The file is written into the root directory of the catalog
+   */
+        if (MODULE_PAYMENT_PLUGNPAY_TESTMODE == 'Test And Debug') {
+          $filename = './plugnpay_debug.txt';
+          $fp = fopen($filename, "a");
+          $write = fputs($fp, "PREAUTH: $data\n");
+          fclose($fp);
+        }
+        unset($response);
+
+/******************************************************************************************
+ * Post order info data to PlugnPay, make sure you have curl installed
+ *    Those with cURL not compiled into PHP (Windows users, some Linux users): 
+ *          Please type in your path in the admin module.  The code below will TRY to find
+ *          your cURL path for you (may not work under Windows) and if it finds it, will
+ *          default to that, but you should enter your cURL path in the admin module to be
+ *          sure.  You no longer need to edit the code manually in this file (that code thanks
+ *          to dreamscape).
+ *    Those with cURL compiled into PHP (some Linux users):
+ *          This should work without any editing if cURL is compiled into your PHP and you
+ *          have PHP configured to realize it (per the PHP guides).
+ ******************************************************************************************
+ */
+  if (MODULE_PAYMENT_PLUGNPAY_CURL == 'Not Compiled') {
+    if (function_exists('exec')) {
+      exec('which curl', $curl_output);
+      if ($curl_output) {
+        $curl_path = $curl_output[0];
+      }
+      else {
+        $curl_path = MODULE_PAYMENT_PLUGNPAY_CURL_PATH;
+      }
+    }
+    exec("$curl_path -d \"$data\" https://pay1.plugnpay.com/payment/pnpremote.cgi", $response);
+  }
+  else {
+    $url = "https://pay1.plugnpay.com/payment/pnpremote.cgi";
+    $ch = curl_init();
+    curl_setopt($ch, CURLOPT_URL, $url);
+    curl_setopt($ch, CURLOPT_VERBOSE, 0);
+    curl_setopt($ch, CURLOPT_POST, 1);
+    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);  //Windows 2003 Compatibility 
+    $authorize = curl_exec($ch);
+    curl_close($ch);
+    $response = split(",", $authorize);
+  }
+
+?>

Added: trunk/direct.openmoko.com/includes/modules/product_listing.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/product_listing.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/product_listing.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,234 @@
+<?php
+/*
+  $Id: product_listing.php,v 1.1.1.1 2004/03/04 23:41:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (strstr($PHP_SELF, FILENAME_SPECIALS)) {
+    $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SPECIAL_PRODUCTS, 'p.products_id');
+  }else{
+    $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
+  }
+
+  if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+  </tr>
+
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+
+</table>
+<?php
+  }
+if ($HTTP_GET_VARS['sort']) {
+$sort = $HTTP_GET_VARS['sort'];
+} else{
+$sort = 'PRODUCT_LIST_NAME';
+}
+  $list_box_contents = array();
+  
+
+  for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
+  if ($page_set == 'upcoming_products'){
+    switch ($column_list[$col]) {
+      case 'PRODUCT_LIST_MODEL':
+        $lc_text = TABLE_HEADING_MODEL;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $lc_text = TABLE_HEADING_PRODUCTS;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $lc_text = TABLE_HEADING_MANUFACTURER;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $lc_text = TABLE_HEADING_PRICE;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $lc_text = TABLE_HEADING_QUANTITY;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $lc_text = TABLE_HEADING_WEIGHT;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $lc_text = TABLE_HEADING_IMAGE;
+        $lc_align = 'center';
+        break;
+      case 'PRODUCT_LIST_BUY_NOW':
+        $lc_text = TABLE_HEADING_BUY_NOW;
+        $lc_align = 'center';
+        break;
+        case 'PRODUCT_LIST_DATE_EXPECTED':
+          $lc_text = TABLE_HEADING_DATE_EXPECTED;
+          $lc_align = 'center';
+        break;
+     } //end case
+    } else {
+    switch ($column_list[$col]) {
+      case 'PRODUCT_LIST_MODEL':
+        $lc_text = TABLE_HEADING_MODEL;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $lc_text = TABLE_HEADING_PRODUCTS;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $lc_text = TABLE_HEADING_MANUFACTURER;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $lc_text = TABLE_HEADING_PRICE;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $lc_text = TABLE_HEADING_QUANTITY;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $lc_text = TABLE_HEADING_WEIGHT;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $lc_text = TABLE_HEADING_IMAGE;
+        $lc_align = 'center';
+        break;
+      case 'PRODUCT_LIST_BUY_NOW':
+        $lc_text = TABLE_HEADING_BUY_NOW;
+        $lc_align = 'center';
+        break;
+    } //end case
+  } //end if
+    if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
+      $lc_text = tep_create_sort_heading($sort, $col+1, $lc_text);
+    }
+
+    $list_box_contents[0][] = array('align' => $lc_align,
+                                    'params' => 'class="productListing-heading"',
+                                    'text' => '&nbsp;' . $lc_text . '&nbsp;');
+  }
+
+  if ($listing_split->number_of_rows > 0) {
+    $rows = 0;
+    $listing_query = tep_db_query($listing_split->sql_query);
+    $no_of_listings = tep_db_num_rows($listing_query);
+    
+    while ($_listing = tep_db_fetch_array($listing_query)) {
+      $listing[] = $_listing;
+    }
+
+    for ($x = 0; $x < $no_of_listings; $x++) {
+      $rows++;
+      if (($rows/2) == floor($rows/2)) {
+        $list_box_contents[] = array('params' => 'class="productListing-even"');
+      } else {
+        $list_box_contents[] = array('params' => 'class="productListing-odd"');
+      }
+
+      $cur_row = sizeof($list_box_contents) - 1;
+
+      for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
+        $lc_align = '';
+
+        switch ($column_list[$col]) {
+          case 'PRODUCT_LIST_MODEL':
+            $lc_align = '';
+            $lc_text = '&nbsp;' . $listing[$x]['products_model'] . '&nbsp;';
+            break;
+          case 'PRODUCT_LIST_NAME':
+            $lc_align = '';
+            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&amp;products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
+            } else {
+              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&amp;' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>&nbsp;';
+            }
+            break;
+          case 'PRODUCT_LIST_MANUFACTURER':
+            $lc_align = '';
+            $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a>&nbsp;';
+            break;
+          case 'PRODUCT_LIST_PRICE':
+            $lc_align = 'right';
+            $pf->loadProduct($listing[$x]['products_id'],$languages_id);
+            $lc_text = $pf->getPriceStringShort();
+            break;
+          case 'PRODUCT_LIST_QUANTITY':
+            $lc_align = 'right';
+            $lc_text = '&nbsp;' . $listing[$x]['products_quantity'] . '&nbsp;';
+            break;
+          case 'PRODUCT_LIST_WEIGHT':
+            $lc_align = 'right';
+            $lc_text = '&nbsp;' . $listing[$x]['products_weight'] . '&nbsp;';
+            break;
+          case 'PRODUCT_LIST_IMAGE':
+            $lc_align = 'center';
+            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&amp;products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
+            } else {
+              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&amp;' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>&nbsp;';
+            }
+            break;
+            case 'PRODUCT_LIST_DATE_EXPECTED':
+              $duedate= str_replace("00:00:00", "" , $listing[$x]['products_date_available']);  
+                  $lc_align = 'center';
+                  $lc_text = '&nbsp;' .  $duedate . '&nbsp;';
+            break;
+            
+         //This change to the buy_now is backed out
+         // VJ product quantity begin
+          case 'PRODUCT_LIST_BUY_NOW':
+            $lc_align = 'center';
+            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+            break;
+          // VJ product quantity end
+          //end of the backout
+        }
+
+        $list_box_contents[$cur_row][] = array('align' => $lc_align,
+                                               'params' => 'class="productListing-data"',
+                                               'text'  => $lc_text);
+      }
+    }
+
+    new productListingBox($list_box_contents);
+  } else {
+    $list_box_contents = array();
+
+    $list_box_contents[0] = array('params' => 'class="productListing-odd"');
+    $list_box_contents[0][] = array('params' => 'class="productListing-data"',
+                                   'text' => TEXT_NO_PRODUCTS);
+
+    new productListingBox($list_box_contents);
+  }
+
+  if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+  </tr>
+</table>
+
+<?php
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/product_listing_col.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/product_listing_col.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/product_listing_col.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,134 @@
+<?php
+/*
+  $Id: product_listing_col.php,v 1.1.1.1 2004/03/04 23:41:11 ccwjr Exp $
+*/
+
+  if (strstr($PHP_SELF, FILENAME_SPECIALS)) {
+    $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SPECIAL_PRODUCTS, 'p.products_id');
+  }else{
+    $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
+  }
+
+  if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
+?>
+<!--product-listin-col -->
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+  </tr>
+</table>
+<?php
+  }
+  $list_box_contents = array();
+
+  if ($listing_split->number_of_rows > 0) {
+    $listing_query = tep_db_query($listing_split->sql_query);
+
+    $row = 0;
+    $column = 0;
+    $no_of_listings = tep_db_num_rows($listing_query);
+
+    while ($_listing = tep_db_fetch_array($listing_query)) {
+      $listing[] = $_listing;
+    }
+
+    for ($x = 0; $x < $no_of_listings; $x++) {
+      $rows++;
+      $product_contents = array();
+      for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
+        $lc_align = '';
+        switch ($column_list[$col]) {
+
+          case 'PRODUCT_LIST_MODEL':
+            $lc_align = '';
+            $lc_text = '&nbsp;' . $listing[$x]['products_model'] . '&nbsp;';
+            break;
+
+          case 'PRODUCT_LIST_NAME':
+            $lc_align = '';
+            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&amp;products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
+            } else {
+              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&amp;' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>&nbsp;';
+            }
+            break;
+
+          case 'PRODUCT_LIST_MANUFACTURER':
+            $lc_align = '';
+            $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a>&nbsp;';
+            break;
+            
+          case 'PRODUCT_LIST_PRICE':
+            $lc_align = 'right';
+            $pf->loadProduct($listing[$x]['products_id'],$languages_id);
+            $lc_text = $pf->getPriceStringShort();
+            break;
+
+          case 'PRODUCT_LIST_QUANTITY':
+            $lc_align = 'right';
+            $lc_text = '&nbsp;' . $listing[$x]['products_quantity'] . '&nbsp;';
+            break;
+
+          case 'PRODUCT_LIST_WEIGHT':
+            $lc_align = 'right';
+            $lc_text = '&nbsp;' . $listing[$x]['products_weight'] . '&nbsp;';
+            break;
+
+          case 'PRODUCT_LIST_IMAGE':
+            $lc_align = 'center';
+            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&amp;products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
+            } else {
+              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&amp;' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>&nbsp;';
+            }
+            break;
+            case 'PRODUCT_LIST_DATE_EXPECTED':
+           //  $duedate= date( "M, d, Y", $listing[$x]['products_date_available'])
+              $duedate= str_replace("00:00:00", "" , $listing[$x]['products_date_available']);  
+                  $lc_align = 'center';
+                  $lc_text = '&nbsp;' .  $duedate . '&nbsp;';
+            break;
+            
+          // This change to the buy_now is backed out
+          // VJ product quantity begin 
+
+          case 'PRODUCT_LIST_BUY_NOW':
+            $lc_align = 'center';
+            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&amp;products_id=' . $listing[$x]['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+            break;
+        }
+        $product_contents[] = $lc_text;
+      }
+
+      $lc_text = implode('<br>', $product_contents);
+      $list_box_contents[$row][$column] = array('align' => 'center',
+                                                'params' => 'class="productListing-data"',
+                                                'text'  => $lc_text);
+
+      $column ++;
+      if ($column >= COLUMN_COUNT) {
+        $row ++;
+        $column = 0;
+      }
+    }
+
+    new productListingBox($list_box_contents);
+  } else {
+    $list_box_contents = array();
+    $list_box_contents[0] = array('params' => 'class="productListing-odd"');
+    $list_box_contents[0][] = array('params' => 'class="productListing-data"',
+                                   'text' => TEXT_NO_PRODUCTS);
+    new productListingBox($list_box_contents);
+  }
+  if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+  </tr>
+</table>
+<?php
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/quickcommerce_direct.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/quickcommerce_direct.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/quickcommerce_direct.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,168 @@
+<?php
+/*
+  osCommerce 2.2 (Snapshot on November 10, 2002) Open Source E-Commerce Solutions
+    Based on: authorize.net Consolidated v1.5
+  Date: March 24, 2004
+  Added: Relay Response var, Test and Debug Mode, cURL var for admin module, cURL autofind, Windows 2003 Compatibility
+  Author: Austin Renfroe (Austin519), some code thanks to dreamscape
+  Email: Austin519 at aol.com
+*/
+
+  unset($form_data);
+  $xx = '';
+  for ($i=0; $i<sizeof($order->products); $i++) {
+    $xx .= $order->products[$i]['qty'] . '-' . ($order->products[$i]['name']) . '**';
+  }
+  //Austin519 - added transaction key, ccmode
+  $form_data = array(
+  x_Login => MODULE_PAYMENT_QUICKCOMMERCE_LOGIN,
+  x_Tran_Key => MODULE_PAYMENT_QUICKCOMMERCE_TRANSKEY,
+  x_Relay_Response => 'FALSE',
+  x_Delim_Data => 'TRUE',
+  x_Version => '3.1',
+  x_Type => MODULE_PAYMENT_QUICKCOMMERCE_CCMODE == 'Authorize Only' ? 'AUTH_ONLY' : 'AUTH_CAPTURE',
+  x_Method => MODULE_PAYMENT_QUICKCOMMERCE_METHOD == 'Credit Card' ? 'CC' : 'ECHECK',
+  x_Amount => number_format($order->info['total'], 2),
+  x_Currency_Code => "{$order->info['currency']}",
+  x_Email_Customer => MODULE_PAYMENT_QUICKCOMMERCE_EMAIL_CUSTOMER == 'True' ? 'TRUE': 'FALSE',
+  x_Email_Merchant => MODULE_PAYMENT_QUICKCOMMERCE_EMAIL_MERCHANT == 'True' ? 'TRUE': 'FALSE',
+  x_Cust_ID => "$customer_id",
+  x_Invoice_Num => "$insert_id",
+  x_First_Name => "{$order->billing['firstname']}",
+  x_Last_Name => "{$order->billing['lastname']}",
+  x_Company => "{$order->billing['company']}",
+  x_Address => "{$order->billing['street_address']}",
+  x_City => "{$order->billing['city']}",
+  x_State => "{$order->billing['state']}",
+  x_Zip => "{$order->billing['postcode']}",
+  x_Country => "{$order->billing['country']['title']}",
+  x_Phone => "{$order->customer['telephone']}",
+  x_Email => "{$order->customer['email_address']}",
+  x_Ship_To_First_Name => "{$order->delivery['firstname']}",
+  x_Ship_To_Last_Name => "{$order->delivery['lastname']}",
+  x_Ship_To_Company => "{$order->delivery['company']}",
+  x_Ship_To_Address => "{$order->delivery['street_address']}",
+  x_Ship_To_City => "{$order->delivery['city']}",
+  x_Ship_To_State => "{$order->delivery['state']}",
+  x_Ship_To_Zip => "{$order->delivery['postcode']}",
+  x_Ship_To_Country => "{$order->delivery['country']['title']}",
+  x_Customer_IP => "{$HTTP_SERVER_VARS['REMOTE_ADDR']}",
+  x_Description => "$xx",
+  tep_session_name() => tep_session_id());
+
+  if(MODULE_PAYMENT_QUICKCOMMERCE_METHOD == 'Credit Card') {
+    $form_data['x_Card_Num'] = "$x_Card_Num";
+    $form_data['x_Exp_Date'] = "$x_Exp_Date";
+
+  if(MODULE_PAYMENT_QUICKCOMMERCE_CCV == 'True' ) {
+    $form_data['x_Card_Code'] = "$x_Card_Code";
+    }
+  } else {
+    //E-check Information (Currently NOT IMPLEMENTED!)
+    $form_data['x_Recurring_Billing'] = '';
+    $form_data['x_Bank_Aba_Code'] = '';
+    $form_data['x_Bank_Acct_Num'] = '';
+    $form_data['x_Bank_Acct_Type'] = '';
+    $form_data['x_Bank_Name'] = '';
+    $form_data['x_Bank_Acct_Name'] = '';
+    $form_data['x_echeck_type'] = '';
+    $form_data['x_drivers_license_num'] = '';
+    $form_data['x_drivers_license_state'] = '';
+    $form_data['x_drivers_license_DOB'] = '';
+  }
+
+     if (($x_Card_Num == '4111111111111111') || ($x_Card_Num == '370000000000002') || ($x_Card_Num == '6011000000000012') || ($x_Card_Num == '5424000000000015') || ($x_Card_Num == '4007000000027')) {
+      $cardtestmode=1;
+    } else {
+      $cardtestmode=0;
+    }
+
+  if((MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE == 'Test') || (MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE == 'Test And Debug') || ($cardtestmode == '1')) {
+    $form_data['x_Test_Request'] = 'TRUE';
+  }
+
+  // concatenate order information variables to $data
+  while(list($key, $value) = each($form_data)) {
+    $data .= $key . '=' . urlencode(ereg_replace(',', '', $value)) . '&';
+  }
+
+  // take the last & out for the string
+  $data = substr($data, 0, -1);
+
+  /* Debug code - will dump cURL data to a file when
+   * the admin module Transaction Mode is set to Test and Debug.
+   * The file is written into the root directory of the catalog
+   */
+  if (MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE == 'Test And Debug') {
+    $filename = './temp/quickcommerce_debug.txt';
+    $fp = fopen($filename, "a");
+    $write = fputs($fp, $data);
+    fclose($fp);
+  }
+  unset($response);
+
+/******************************************************************************************
+ * Post order info data to Quickcommerce, make sure you have curl installed
+ *    Those with cURL not compiled into PHP (Windows users, some Linux users):
+ *          Please type in your path in the admin module.  The code below will TRY to find
+ *          your cURL path for you (may not work under Windows) and if it finds it, will
+ *          default to that, but you should enter your cURL path in the admin module to be
+ *          sure.  You no longer need to edit the code manually in this file (that code thanks
+ *          to dreamscape).
+ *    Those with cURL compiled into PHP (some Linux users):
+ *          This should work without any editing if cURL is compiled into your PHP and you
+ *          have PHP configured to realize it (per the PHP guides).
+ ******************************************************************************************
+ */
+  if (MODULE_PAYMENT_QUICKCOMMERCE_CURL == 'Not Compiled') {
+    if (function_exists('exec')) {
+      exec('which curl', $curl_output);
+      if ($curl_output) {
+        $curl_path = $curl_output[0];
+      }else {
+        $curl_path = MODULE_PAYMENT_QUICKCOMMERCE_CURL_PATH;
+      }
+    }
+    if (($x_Card_Num == '4111111111111111') || ($x_Card_Num == '370000000000002') || ($x_Card_Num == '6011000000000012') || ($x_Card_Num == '5424000000000015') || ($x_Card_Num == '4007000000027')) {
+      $cardtestmode=1;
+    } else {
+      $cardtestmode=0;
+    }
+    if((MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE == 'Test') || (MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE == 'Test And Debug') || ($cardtestmode == '1')) {
+      exec("$curl_path -d \"$data\" https://secure.quickcommerce.net/gateway/transact.dll", $response);
+    } else {
+      exec("$curl_path -d \"$data\" https://secure.quickcommerce.net/gateway/transact.dll", $response);
+    }
+
+  } else {
+    if((MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE == 'Test') || (MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE == 'Test And Debug') || ($cardtestmode == '1')) {
+      $url = "https://secure.quickcommerce.net/gateway/transact.dll";
+    } else {
+      $url = "https://secure.quickcommerce.net/gateway/transact.dll";
+    }
+    $agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)";
+    $ch = curl_init();
+    curl_setopt($ch, CURLOPT_URL,$url);
+    curl_setopt($ch, CURLOPT_VERBOSE, 1);
+    curl_setopt($ch, CURLOPT_POST, 1);
+    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+                curl_setopt($ch, CURLOPT_TIMEOUT, 120);
+                curl_setopt($ch, CURLOPT_USERAGENT, $agent);
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);  //Windows 2003 Compatibility
+    $authorize = curl_exec($ch);
+    curl_close($ch);
+    $response = explode(',', $authorize);
+  }
+
+
+  if (MODULE_PAYMENT_QUICKCOMMERCE_TESTMODE == 'Test And Debug') {
+          $filename2 = 'quickcommerce_debug.txt';
+          $authorize2=' :data String : ' . $data . '\n';
+          $response2 = ' :Response String : ' . $authorize . '\n';
+          $fp2 = fopen($filename2,"ab");
+          $write = fputs($fp2, $authorize2, strlen($authorize2));
+    $write = fputs($fp2, $response2, strlen($response2));
+          fclose($fp2);
+   }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/auspost.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/auspost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/auspost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: auspost.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class auspost {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function auspost() {
+      global $order;
+
+      $this->code = 'auspost';
+      $this->title = MODULE_SHIPPING_AUSPOST_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_AUSPOST_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_AUSPOST_SORT_ORDER;
+      $this->icon = DIR_WS_ICONS . 'auspost.gif';
+      $this->tax_class = MODULE_SHIPPING_AUSPOST_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_AUSPOST_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AUSPOST_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_AUSPOST_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order,  $cart, $shipping_weight, $shipping_num_boxes, $total_weight;
+
+      $frompcode = MODULE_SHIPPING_AUSPOST_SPCODE;
+      $topcode = $order->delivery['postcode'];
+      $sweight = $shipping_weight*1000;
+      $swidth = MODULE_SHIPPING_AUSPOST_SWIDTH;
+      $sheight = MODULE_SHIPPING_AUSPOST_SHEIGHT;
+      $slength = MODULE_SHIPPING_AUSPOST_SDEPTH;
+      $error = false;
+
+      $insurance_table = split("[:,]" , MODULE_SHIPPING_AUSPOST_INSURANCE);
+        for ($i = 0; $i < count($insurance_table); $i+=2) {
+          if ($cart->show_total() <= $insurance_table[$i]) {
+            $insurance = $insurance_table[$i+1];
+            $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE;
+            break;
+          }
+        }
+        $url = "http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$topcode&Country=AU&Weight=$sweight&Service_Type=STANDARD&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes";
+        $myfile = file($url);
+        foreach($myfile as $vals)
+        {
+                $bits = split("=", $vals);
+                $$bits[0] = $bits[1];
+        }
+
+      if ($charge <= 0) {
+        $error = true;
+      } else {
+
+    $handling = MODULE_SHIPPING_AUSPOST_HANDLING;
+        if ($handling >0) {
+          $handling_details = " $" . MODULE_SHIPPING_AUSPOST_HANDLING . " " .MODULE_SHIPPING_AUSPOST_TEXT_HANDLING;
+        } else {
+          $handling_details = "";
+      }
+
+        if ($insurance >0) {
+          $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE;
+        } else {
+          $insurance_details = "";
+      }
+
+          if ($insurance == 0 && $handling  == 0) {
+          $auspost_addons = "";
+          } else {
+          $auspost_addons = " (" . MODULE_SHIPPING_AUSPOST_TEXT_INCLUDE . $handling_details . $insurance_details . ") ";
+        }
+
+        $shipping_auspost_method = MODULE_SHIPPING_AUSPOST_TEXT_WAY. " <b>"  . $topcode . "</b> - " . $days . " " . MODULE_SHIPPING_AUSPOST_TEXT_SHIPPINGDAYS . "<br>" .$shipping_num_boxes . "&nbsp;" .MODULE_SHIPPING_AUSPOST_TEXT_BOXES  . " " . $total_weight . MODULE_SHIPPING_AUSPOST_TEXT_UNITS . $auspost_addons;
+        $shipping_auspost_cost = (($charge/1.1)* $shipping_num_boxes);
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_AUSPOST_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => $shipping_auspost_method,
+                                                     'cost' => ($shipping_auspost_cost + MODULE_SHIPPING_AUSPOST_HANDLING) + $insurance)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_AUSPOST_TEXT_ERROR;
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_AUSPOST_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable auspost', 'MODULE_SHIPPING_AUSPOST_STATUS', 'True', 'Do you want to offer auspost?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Insurance', 'MODULE_SHIPPING_AUSPOST_INSURANCE', '25:5.90', 'Insurance cost is based on the total cost of items. Example: 25:8.50,50:5.50,etc.. Up to $25 charge $8.50, from there to $50 charge $5.50, etc', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Dispatch Postcode', 'MODULE_SHIPPING_AUSPOST_SPCODE', '2000', 'Dispatch Postcode?', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_AUSPOST_HANDLING', '10', 'Handling Fee for this shipping method', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Height', 'MODULE_SHIPPING_AUSPOST_SHEIGHT', '100', 'Parcel Height (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Width', 'MODULE_SHIPPING_AUSPOST_SWIDTH', '100', 'Parcel Width (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Depth', 'MODULE_SHIPPING_AUSPOST_SDEPTH', '100', 'Parcel Depth (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_AUSPOST_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_AUSPOST_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");      
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_AUSPOST_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_AUSPOST_STATUS', 'MODULE_SHIPPING_AUSPOST_INSURANCE', 'MODULE_SHIPPING_AUSPOST_SPCODE', 'MODULE_SHIPPING_AUSPOST_HANDLING', 'MODULE_SHIPPING_AUSPOST_SHEIGHT', 'MODULE_SHIPPING_AUSPOST_SWIDTH', 'MODULE_SHIPPING_AUSPOST_SDEPTH', 'MODULE_SHIPPING_AUSPOST_ZONE', 'MODULE_SHIPPING_AUSPOST_TAX_CLASS', 'MODULE_SHIPPING_AUSPOST_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/auspostair.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/auspostair.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/auspostair.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+<?php
+/*
+  $Id: auspostair.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class auspostair {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function auspostair() {
+      global $order;
+
+      $this->code = 'auspostair';
+      $this->title = MODULE_SHIPPING_AUSPOSTAIR_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_AUSPOSTAIR_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_AUSPOSTAIR_SORT_ORDER;
+      $this->icon = DIR_WS_ICONS . 'auspost_air.gif';
+      $this->tax_class = MODULE_SHIPPING_AUSPOSTAIR_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_AUSPOSTAIR_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AUSPOSTAIR_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_AUSPOSTAIR_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order,  $cart, $shipping_weight, $shipping_num_boxes, $total_weight;
+
+      $frompcode = MODULE_SHIPPING_AUSPOSTAIR_SPCODE;
+      $topcode = $order->delivery['postcode'];
+      $dest_country=$order->delivery['country']['iso_code_2'];
+      $sweight = $shipping_weight*1000;
+      $swidth = MODULE_SHIPPING_AUSPOSTAIR_SWIDTH;
+      $sheight = MODULE_SHIPPING_AUSPOSTAIR_SHEIGHT;
+      $slength = MODULE_SHIPPING_AUSPOSTAIR_SDEPTH;
+      $error = false;
+
+      $insurance_table = split("[:,]" , MODULE_SHIPPING_AUSPOSTAIR_INSURANCE);
+        for ($i = 0; $i < count($insurance_table); $i+=2) {
+          if ($cart->show_total() <= $insurance_table[$i]) {
+            $insurance = $insurance_table[$i+1];
+            $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOSTAIR_TEXT_INSURANCE;
+            break;
+          }
+        }
+        $url = "http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$topcode&Country=$dest_country&Weight=$sweight&Service_Type=AIR&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes";
+        $myfile = file($url);
+        foreach($myfile as $vals)
+        {
+                $bits = split("=", $vals);
+                $$bits[0] = $bits[1];
+        }
+
+      if ($charge <= 0) {
+        $error = true;
+      } else {
+
+    $handling = MODULE_SHIPPING_AUSPOSTAIR_HANDLING;
+        if ($handling >0) {
+          $handling_details = " $" . MODULE_SHIPPING_AUSPOSTAIR_HANDLING . " " .MODULE_SHIPPING_AUSPOSTAIR_TEXT_HANDLING;
+        } else {
+          $handling_details = "";
+      }
+
+        if ($insurance >0) {
+          $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOSTAIR_TEXT_INSURANCE;
+        } else {
+          $insurance_details = "";
+      }
+
+          if ($insurance == 0 && $handling  == 0) {
+          $auspostair_addons = "";
+          } else {
+          $auspostair_addons = " (" . MODULE_SHIPPING_AUSPOSTAIR_TEXT_INCLUDE . $handling_details . $insurance_details . ") ";
+        }
+
+        $shipping_auspostair_method = MODULE_SHIPPING_AUSPOSTAIR_TEXT_WAY. " <b>"  . $topcode . "</b> - " . $days . " " . MODULE_SHIPPING_AUSPOSTAIR_TEXT_SHIPPINGDAYS . "<br>" .$shipping_num_boxes . "&nbsp;" .MODULE_SHIPPING_AUSPOSTAIR_TEXT_BOXES  . " " . $total_weight . MODULE_SHIPPING_AUSPOSTAIR_TEXT_UNITS . $auspostair_addons;
+        $shipping_auspostair_cost = (($charge/1.1)* $shipping_num_boxes);
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_AUSPOSTAIR_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => $shipping_auspostair_method,
+                                                     'cost' => ($shipping_auspostair_cost + MODULE_SHIPPING_AUSPOSTAIR_HANDLING) + $insurance)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_AUSPOSTAIR_TEXT_ERROR;
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_AUSPOSTAIR_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable auspostair', 'MODULE_SHIPPING_AUSPOSTAIR_STATUS', 'True', 'Do you want to offer auspostair?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Insurance', 'MODULE_SHIPPING_AUSPOSTAIR_INSURANCE', '25:5.90', 'Insurance cost is based on the total cost of items. Example: 25:8.50,50:5.50,etc.. Up to $25 charge $8.50, from there to $50 charge $5.50, etc', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Dispatch Postcode', 'MODULE_SHIPPING_AUSPOSTAIR_SPCODE', '2000', 'Dispatch Postcode?', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_AUSPOSTAIR_HANDLING', '10', 'Handling Fee for this shipping method', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Height', 'MODULE_SHIPPING_AUSPOSTAIR_SHEIGHT', '100', 'Parcel Height (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Width', 'MODULE_SHIPPING_AUSPOSTAIR_SWIDTH', '100', 'Parcel Width (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Depth', 'MODULE_SHIPPING_AUSPOSTAIR_SDEPTH', '100', 'Parcel Depth (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_AUSPOSTAIR_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_AUSPOSTAIR_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");      
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_AUSPOSTAIR_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_AUSPOSTAIR_STATUS', 'MODULE_SHIPPING_AUSPOSTAIR_INSURANCE', 'MODULE_SHIPPING_AUSPOSTAIR_SPCODE', 'MODULE_SHIPPING_AUSPOSTAIR_HANDLING', 'MODULE_SHIPPING_AUSPOSTAIR_SHEIGHT', 'MODULE_SHIPPING_AUSPOSTAIR_SWIDTH', 'MODULE_SHIPPING_AUSPOSTAIR_SDEPTH', 'MODULE_SHIPPING_AUSPOSTAIR_ZONE', 'MODULE_SHIPPING_AUSPOSTAIR_TAX_CLASS', 'MODULE_SHIPPING_AUSPOSTAIR_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/ausposteconomy.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/ausposteconomy.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/ausposteconomy.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+<?php
+/*
+  $Id: ausposteconomy.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class ausposteconomy {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function ausposteconomy() {
+      global $order;
+
+      $this->code = 'ausposteconomy';
+      $this->title = MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_AUSPOST_ECONOMY_SORT_ORDER;
+      $this->icon = DIR_WS_ICONS . 'auspost_economy.gif';
+      $this->tax_class = MODULE_SHIPPING_AUSPOST_ECONOMY_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_AUSPOST_ECONOMY_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AUSPOST_ECONOMY_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_AUSPOST_ECONOMY_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order,  $cart, $shipping_weight, $shipping_num_boxes, $total_weight;
+
+      $frompcode = MODULE_SHIPPING_AUSPOST_ECONOMY_SPCODE;
+      $topcode = $order->delivery['postcode'];
+      $dest_country=$order->delivery['country']['iso_code_2'];
+      $sweight = $shipping_weight*1000;
+      $swidth = MODULE_SHIPPING_AUSPOST_ECONOMY_SWIDTH;
+      $sheight = MODULE_SHIPPING_AUSPOST_ECONOMY_SHEIGHT;
+      $slength = MODULE_SHIPPING_AUSPOST_ECONOMY_SDEPTH;
+      $error = false;
+
+      $insurance_table = split("[:,]" , MODULE_SHIPPING_AUSPOST_ECONOMY_INSURANCE);
+        for ($i = 0; $i < count($insurance_table); $i+=2) {
+          if ($cart->show_total() <= $insurance_table[$i]) {
+            $insurance = $insurance_table[$i+1];
+            $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INSURANCE;
+            break;
+          }
+        }
+        $url = "http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$topcode&Country=$dest_country&Weight=$sweight&Service_Type=ECONOMY&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes";
+        $myfile = file($url);
+        foreach($myfile as $vals)
+        {
+                $bits = split("=", $vals);
+                $$bits[0] = $bits[1];
+        }
+
+      if ($charge <= 0) {
+        $error = true;
+      } else {
+
+    $handling = MODULE_SHIPPING_AUSPOST_ECONOMY_HANDLING;
+        if ($handling >0) {
+          $handling_details = " $" . MODULE_SHIPPING_AUSPOST_ECONOMY_HANDLING . " " .MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_HANDLING;
+        } else {
+          $handling_details = "";
+      }
+
+        if ($insurance >0) {
+          $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INSURANCE;
+        } else {
+          $insurance_details = "";
+      }
+
+          if ($insurance == 0 && $handling  == 0) {
+          $ausposteconomy_addons = "";
+          } else {
+          $ausposteconomy_addons = " (" . MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_INCLUDE . $handling_details . $insurance_details . ") ";
+        }
+
+        $shipping_ausposteconomy_method = MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_WAY. " <b>"  . $topcode . "</b> - " . $days . " " . MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_SHIPPINGDAYS . "<br>" .$shipping_num_boxes . "&nbsp;" .MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_BOXES  . " " . $total_weight . MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_UNITS . $ausposteconomy_addons;
+        $shipping_ausposteconomy_cost = (($charge/1.1)* $shipping_num_boxes);
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => $shipping_ausposteconomy_method,
+                                                     'cost' => ($shipping_ausposteconomy_cost + MODULE_SHIPPING_AUSPOST_ECONOMY_HANDLING) + $insurance)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_AUSPOST_ECONOMY_TEXT_ERROR;
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_AUSPOST_ECONOMY_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable ausposteconomy', 'MODULE_SHIPPING_AUSPOST_ECONOMY_STATUS', 'True', 'Do you want to offer ausposteconomy?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Insurance', 'MODULE_SHIPPING_AUSPOST_ECONOMY_INSURANCE', '25:5.90', 'Insurance cost is based on the total cost of items. Example: 25:8.50,50:5.50,etc.. Up to $25 charge $8.50, from there to $50 charge $5.50, etc', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Dispatch Postcode', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SPCODE', '2000', 'Dispatch Postcode?', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_AUSPOST_ECONOMY_HANDLING', '10', 'Handling Fee for this shipping method', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Height', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SHEIGHT', '100', 'Parcel Height (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Width', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SWIDTH', '100', 'Parcel Width (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Depth', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SDEPTH', '100', 'Parcel Depth (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_AUSPOST_ECONOMY_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_AUSPOST_ECONOMY_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");      
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_AUSPOST_ECONOMY_STATUS', 'MODULE_SHIPPING_AUSPOST_ECONOMY_INSURANCE', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SPCODE', 'MODULE_SHIPPING_AUSPOST_ECONOMY_HANDLING', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SHEIGHT', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SWIDTH', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SDEPTH', 'MODULE_SHIPPING_AUSPOST_ECONOMY_ZONE', 'MODULE_SHIPPING_AUSPOST_ECONOMY_TAX_CLASS', 'MODULE_SHIPPING_AUSPOST_ECONOMY_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/auspostexpress.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/auspostexpress.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/auspostexpress.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: auspostexpress.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class auspostexpress {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function auspostexpress() {
+      global $order;
+
+      $this->code = 'auspostexpress';
+      $this->title = MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_AUSPOST_EXPRESS_SORT_ORDER;
+      $this->icon = DIR_WS_ICONS . 'auspost_express.gif';
+      $this->tax_class = MODULE_SHIPPING_AUSPOST_EXPRESS_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_AUSPOST_EXPRESS_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AUSPOST_EXPRESS_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_AUSPOST_EXPRESS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order,  $cart, $shipping_weight, $shipping_num_boxes, $total_weight;
+
+      $frompcode = MODULE_SHIPPING_AUSPOST_EXPRESS_SPCODE;
+      $topcode = $order->delivery['postcode'];
+      $sweight = $shipping_weight*1000;
+      $swidth = MODULE_SHIPPING_AUSPOST_EXPRESS_SWIDTH;
+      $sheight = MODULE_SHIPPING_AUSPOST_EXPRESS_SHEIGHT;
+      $slength = MODULE_SHIPPING_AUSPOST_EXPRESS_SDEPTH;
+      $error = false;
+
+      $insurance_table = split("[:,]" , MODULE_SHIPPING_AUSPOST_EXPRESS_INSURANCE);
+        for ($i = 0; $i < count($insurance_table); $i+=2) {
+          if ($cart->show_total() <= $insurance_table[$i]) {
+            $insurance = $insurance_table[$i+1];
+            $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INSURANCE;
+            break;
+          }
+        }
+        $url = "http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$topcode&Country=AU&Weight=$sweight&Service_Type=EXPRESS&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes";
+        $myfile = file($url);
+        foreach($myfile as $vals)
+        {
+                $bits = split("=", $vals);
+                $$bits[0] = $bits[1];
+        }
+
+      if ($charge <= 0) {
+        $error = true;
+      } else {
+
+    $handling = MODULE_SHIPPING_AUSPOST_EXPRESS_HANDLING;
+        if ($handling >0) {
+          $handling_details = " $" . MODULE_SHIPPING_AUSPOST_EXPRESS_HANDLING . " " .MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_HANDLING;
+        } else {
+          $handling_details = "";
+      }
+
+        if ($insurance >0) {
+          $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INSURANCE;
+        } else {
+          $insurance_details = "";
+      }
+
+          if ($insurance == 0 && $handling  == 0) {
+          $auspostexpress_addons = "";
+          } else {
+          $auspostexpress_addons = " (" . MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_INCLUDE . $handling_details . $insurance_details . ") ";
+        }
+
+        $shipping_auspostexpress_method = MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_WAY. " <b>"  . $topcode . "</b> - " . $days . " " . MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_SHIPPINGDAYS . "<br>" .$shipping_num_boxes . "&nbsp;" .MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_BOXES  . " " . $total_weight . MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_UNITS . $auspostexpress_addons;
+        $shipping_auspostexpress_cost = (($charge/1.1)* $shipping_num_boxes);
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => $shipping_auspostexpress_method,
+                                                     'cost' => ($shipping_auspostexpress_cost + MODULE_SHIPPING_AUSPOST_EXPRESS_HANDLING) + $insurance)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_AUSPOST_EXPRESS_TEXT_ERROR;
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_AUSPOST_EXPRESS_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable auspostexpress', 'MODULE_SHIPPING_AUSPOST_EXPRESS_STATUS', 'True', 'Do you want to offer auspostexpress?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Insurance', 'MODULE_SHIPPING_AUSPOST_EXPRESS_INSURANCE', '25:5.90', 'Insurance cost is based on the total cost of items. Example: 25:8.50,50:5.50,etc.. Up to $25 charge $8.50, from there to $50 charge $5.50, etc', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Dispatch Postcode', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SPCODE', '2000', 'Dispatch Postcode?', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_AUSPOST_EXPRESS_HANDLING', '10', 'Handling Fee for this shipping method', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Height', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SHEIGHT', '100', 'Parcel Height (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Width', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SWIDTH', '100', 'Parcel Width (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Depth', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SDEPTH', '100', 'Parcel Depth (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_AUSPOST_EXPRESS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_AUSPOST_EXPRESS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");      
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_AUSPOST_EXPRESS_STATUS', 'MODULE_SHIPPING_AUSPOST_EXPRESS_INSURANCE', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SPCODE', 'MODULE_SHIPPING_AUSPOST_EXPRESS_HANDLING', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SHEIGHT', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SWIDTH', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SDEPTH', 'MODULE_SHIPPING_AUSPOST_EXPRESS_ZONE', 'MODULE_SHIPPING_AUSPOST_EXPRESS_TAX_CLASS', 'MODULE_SHIPPING_AUSPOST_EXPRESS_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/auspostsea.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/auspostsea.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/auspostsea.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+<?php
+/*
+  $Id: auspostsea.php,v 2.0.2 2003/10/15
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class auspostsea {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function auspostsea() {
+      global $order;
+
+      $this->code = 'auspostsea';
+      $this->title = MODULE_SHIPPING_AUSPOST_SEA_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_AUSPOST_SEA_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_AUSPOST_SEA_SORT_ORDER;
+      $this->icon = DIR_WS_ICONS . 'auspost_sea.gif';
+      $this->tax_class = MODULE_SHIPPING_AUSPOST_SEA_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_AUSPOST_SEA_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AUSPOST_SEA_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_AUSPOST_SEA_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order,  $cart, $shipping_weight, $shipping_num_boxes, $total_weight;
+
+      $frompcode = MODULE_SHIPPING_AUSPOST_SEA_SPCODE;
+      $topcode = $order->delivery['postcode'];
+      $dest_country=$order->delivery['country']['iso_code_2'];
+      $sweight = $shipping_weight*1000;
+      $swidth = MODULE_SHIPPING_AUSPOST_SEA_SWIDTH;
+      $sheight = MODULE_SHIPPING_AUSPOST_SEA_SHEIGHT;
+      $slength = MODULE_SHIPPING_AUSPOST_SEA_SDEPTH;
+      $error = false;
+
+      $insurance_table = split("[:,]" , MODULE_SHIPPING_AUSPOST_SEA_INSURANCE);
+        for ($i = 0; $i < count($insurance_table); $i+=2) {
+          if ($cart->show_total() <= $insurance_table[$i]) {
+            $insurance = $insurance_table[$i+1];
+            $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_SEA_TEXT_INSURANCE;
+            break;
+          }
+        }
+        $url = "http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$topcode&Country=$dest_country&Weight=$sweight&Service_Type=SEA&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes";
+        $myfile = file($url);
+        foreach($myfile as $vals)
+        {
+                $bits = split("=", $vals);
+                $$bits[0] = $bits[1];
+        }
+
+      if ($charge <= 0) {
+        $error = true;
+      } else {
+
+    $handling = MODULE_SHIPPING_AUSPOST_SEA_HANDLING;
+        if ($handling >0) {
+          $handling_details = " $" . MODULE_SHIPPING_AUSPOST_SEA_HANDLING . " " .MODULE_SHIPPING_AUSPOST_SEA_TEXT_HANDLING;
+        } else {
+          $handling_details = "";
+      }
+
+        if ($insurance >0) {
+          $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_SEA_TEXT_INSURANCE;
+        } else {
+          $insurance_details = "";
+      }
+
+          if ($insurance == 0 && $handling  == 0) {
+          $auspostsea_addons = "";
+          } else {
+          $auspostsea_addons = " (" . MODULE_SHIPPING_AUSPOST_SEA_TEXT_INCLUDE . $handling_details . $insurance_details . ") ";
+        }
+
+        $shipping_auspostsea_method = MODULE_SHIPPING_AUSPOST_SEA_TEXT_WAY. " <b>"  . $topcode . "</b> - " . $days . " " . MODULE_SHIPPING_AUSPOST_SEA_TEXT_SHIPPINGDAYS . "<br>" .$shipping_num_boxes . "&nbsp;" .MODULE_SHIPPING_AUSPOST_SEA_TEXT_BOXES  . " " . $total_weight . MODULE_SHIPPING_AUSPOST_SEA_TEXT_UNITS . $auspostsea_addons;
+        $shipping_auspostsea_cost = (($charge/1.1)* $shipping_num_boxes);
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_AUSPOST_SEA_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => $shipping_auspostsea_method,
+                                                     'cost' => ($shipping_auspostsea_cost + MODULE_SHIPPING_AUSPOST_SEA_HANDLING) + $insurance)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_AUSPOST_SEA_TEXT_ERROR;
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_AUSPOST_SEA_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable auspostsea', 'MODULE_SHIPPING_AUSPOST_SEA_STATUS', 'True', 'Do you want to offer auspostsea?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Insurance', 'MODULE_SHIPPING_AUSPOST_SEA_INSURANCE', '25:5.90', 'Insurance cost is based on the total cost of items. Example: 25:8.50,50:5.50,etc.. Up to $25 charge $8.50, from there to $50 charge $5.50, etc', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Dispatch Postcode', 'MODULE_SHIPPING_AUSPOST_SEA_SPCODE', '2000', 'Dispatch Postcode?', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_AUSPOST_SEA_HANDLING', '10', 'Handling Fee for this shipping method', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Height', 'MODULE_SHIPPING_AUSPOST_SEA_SHEIGHT', '100', 'Parcel Height (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Width', 'MODULE_SHIPPING_AUSPOST_SEA_SWIDTH', '100', 'Parcel Width (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Depth', 'MODULE_SHIPPING_AUSPOST_SEA_SDEPTH', '100', 'Parcel Depth (in mm)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_AUSPOST_SEA_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_AUSPOST_SEA_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");      
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_AUSPOST_SEA_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_AUSPOST_SEA_STATUS', 'MODULE_SHIPPING_AUSPOST_SEA_INSURANCE', 'MODULE_SHIPPING_AUSPOST_SEA_SPCODE', 'MODULE_SHIPPING_AUSPOST_SEA_HANDLING', 'MODULE_SHIPPING_AUSPOST_SEA_SHEIGHT', 'MODULE_SHIPPING_AUSPOST_SEA_SWIDTH', 'MODULE_SHIPPING_AUSPOST_SEA_SDEPTH', 'MODULE_SHIPPING_AUSPOST_SEA_ZONE', 'MODULE_SHIPPING_AUSPOST_SEA_TAX_CLASS', 'MODULE_SHIPPING_AUSPOST_SEA_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/bak/upsxml.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/bak/upsxml.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/bak/upsxml.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1189 @@
+<?php
+/*
+    $Id: upsxml.php,v 1.2.6 2007/02/02 JanZ Exp $
+
+    Original copyright (c) 2003 Torin Walker
+    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+    See the GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License along with this program;
+    If not, you may obtain one by writing to and requesting one from:
+    The Free Software Foundation, Inc.,
+    59 Temple Place, Suite 330,
+    Boston, MA 02111-1307 USA
+
+    Written by Torin Walker.
+    Some code/style borrowed from both Fritz Clapp's UPS Choice 1.7 Module,
+    and Kelvin, Kenneth, and Tom St.Croix's Canada Post 3.1 Module.
+    Insurance support by Joe McFrederick
+*/
+
+require ('includes/classes/xmldocument.php');
+// if using the optional dimensional support, set to 1, otherwise leave as 0
+// define('DIMENSIONS_SUPPORTED', 1);
+// obsolete: is set in admin now
+
+class upsxml {
+    var $code, $title, $description, $icon, $enabled, $types, $boxcount;
+
+    //***************
+    function upsxml() {
+        global $order;
+        $this->code = 'upsxml';
+        $this->title = MODULE_SHIPPING_UPSXML_RATES_TEXT_TITLE;
+        $this->description = MODULE_SHIPPING_UPSXML_RATES_TEXT_DESCRIPTION;
+        $this->sort_order = MODULE_SHIPPING_UPSXML_RATES_SORT_ORDER;
+        $this->icon = DIR_WS_ICONS . 'shipping_ups.gif';
+        $this->tax_class = MODULE_SHIPPING_UPSXML_RATES_TAX_CLASS;
+        $this->enabled = ((MODULE_SHIPPING_UPSXML_RATES_STATUS == 'True') ? true : false);
+        $this->access_key = MODULE_SHIPPING_UPSXML_RATES_ACCESS_KEY;
+        $this->access_username = MODULE_SHIPPING_UPSXML_RATES_USERNAME;
+        $this->access_password = MODULE_SHIPPING_UPSXML_RATES_PASSWORD;
+        $this->access_account_number = MODULE_SHIPPING_UPSXML_RATES_UPS_ACCOUNT_NUMBER;
+        $this->use_negotiated_rates = MODULE_SHIPPING_UPSXML_RATES_USE_NEGOTIATED_RATES;
+        $this->origin = MODULE_SHIPPING_UPSXML_RATES_ORIGIN;
+        $this->origin_city = MODULE_SHIPPING_UPSXML_RATES_CITY;
+        $this->origin_stateprov = MODULE_SHIPPING_UPSXML_RATES_STATEPROV;
+        $this->origin_country = MODULE_SHIPPING_UPSXML_RATES_COUNTRY;
+        $this->origin_postalcode = MODULE_SHIPPING_UPSXML_RATES_POSTALCODE;
+        $this->pickup_method = MODULE_SHIPPING_UPSXML_RATES_PICKUP_METHOD;
+        $this->package_type = MODULE_SHIPPING_UPSXML_RATES_PACKAGE_TYPE;
+        $this->unit_weight = MODULE_SHIPPING_UPSXML_RATES_UNIT_WEIGHT;
+        $this->unit_length = MODULE_SHIPPING_UPSXML_RATES_UNIT_LENGTH;
+        if (MODULE_SHIPPING_UPSXML_DIMENSIONS_SUPPORT == 'Ready-to-ship only') {
+          $this->dimensions_support = 1;
+        } elseif (MODULE_SHIPPING_UPSXML_DIMENSIONS_SUPPORT == 'With product dimensions') {
+          $this->dimensions_support = 2;
+        } else {
+          $this->dimensions_support = 0;
+        }
+        $this->email_errors = ((MODULE_SHIPPING_UPSXML_EMAIL_ERRORS == 'Yes') ? true : false);
+        $this->handling_type = MODULE_SHIPPING_UPSXML_HANDLING_TYPE;
+        $this->handling_fee = MODULE_SHIPPING_UPSXML_RATES_HANDLING;
+        $this->quote_type = MODULE_SHIPPING_UPSXML_RATES_QUOTE_TYPE;
+        $this->customer_classification = MODULE_SHIPPING_UPSXML_RATES_CUSTOMER_CLASSIFICATION_CODE;
+        $this->protocol = 'https';
+        $this->host = ((MODULE_SHIPPING_UPSXML_RATES_MODE == 'Test') ? 'wwwcie.ups.com' : 'www.ups.com');
+        $this->port = '443';
+        $this->path = '/ups.app/xml/Rate';
+        $this->transitpath = '/ups.app/xml/TimeInTransit';
+        $this->version = 'UPSXML Rate 1.0001';
+        $this->transitversion = 'UPSXML Time In Transit 1.0002';
+        $this->timeout = '60';
+        $this->xpci_version = '1.0001';
+        $this->transitxpci_version = '1.0002';
+        $this->items_qty = 0;
+        $this->timeintransit = '0';
+        $this->timeInTransitView = MODULE_SHIPPING_UPSXML_RATES_TIME_IN_TRANSIT_VIEW;
+        $this->weight_for_timeintransit = '0';
+        $now_unix_time = mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"));
+        $this->today_unix_time = $now_unix_time;
+        $this->today = date("Ymd");
+        // insurance addition.
+        if (MODULE_SHIPPING_UPSXML_INSURE == 'False')
+          { $this->pkgvalue = 100; }
+        if (MODULE_SHIPPING_UPSXML_INSURE == 'True')
+          { $this->pkgvalue = ceil($order->info['subtotal']); }
+        // end insurance addition
+        // to enable logging, create an empty "upsxml.log" file at the location you set below, give it write permissions (777) and uncomment the next line
+              $this->logfile = UPS_LOG_FILE;
+        
+        // to enable logging of just the errors, do as above but call the file upsxml_error.log
+              $this->ups_error_file = UPS_ERROR_FILE;
+        // when cURL is not compiled into PHP (Windows users, some Linux users)
+        // you can set the next variable to "1" and then exec(curl -d $xmlRequest, $xmlResponse)
+        // will be used
+        $this->use_exec = '0';
+
+        if (($this->enabled == true) && ((int)MODULE_SHIPPING_UPSXML_RATES_ZONE > 0)) {
+            $check_flag = false;
+            $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPSXML_RATES_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+            while ($check = tep_db_fetch_array($check_query)) {
+                if ($check['zone_id'] < 1) {
+                    $check_flag = true;
+                    break;
+                } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+                    $check_flag = true;
+                    break;
+                }
+            }
+            if ($check_flag == false) {
+                $this->enabled = false;
+            }
+        }
+
+        // Available pickup types - set in admin
+        $this->pickup_methods = array(
+            'Daily Pickup' => '01',
+            'Customer Counter' => '03',
+            'One Time Pickup' => '06',
+            'On Call Air Pickup' => '07',
+            'Suggested Retail Rates (UPS Store)' => '11',
+            'Letter Center' => '19',
+            'Air Service Center' => '20'
+        );
+
+        // Available package types
+        $this->package_types = array(
+            'UPS Letter' => '01',
+            'Package' => '02',
+            'UPS Tube' => '03',
+            'UPS Pak' => '04',
+            'UPS Express Box' => '21',
+            'UPS 25kg Box' => '24',
+            'UPS 10kg Box' => '25'
+        );
+
+        // Human-readable Service Code lookup table. The values returned by the Rates and Service "shop" method are numeric.
+        // Using these codes, and the administratively defined Origin, the proper human-readable service name is returned.
+        // Note: The origin specified in the admin configuration affects only the product name as displayed to the user.
+        $this->service_codes = array(
+            // US Origin
+            'US Origin' => array(
+                '01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_01,
+                '02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_02,
+                '03' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_03,
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_08,
+                '11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_11,
+                '12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_12,
+                '13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_13,
+                '14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_14,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_54,
+                '59' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_59,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_65
+            ),
+            // Canada Origin
+            'Canada Origin' => array(
+                '01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_01,
+                '02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_02,
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_08,
+                '11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_11,
+                '12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_12,
+                '13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_13,
+                '14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_14,
+                // service code 54 gone after January 2, 2007
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_65
+            ),
+            // European Union Origin
+            'European Union Origin' => array(
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_07,
+                '11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_11,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_65,
+                // next three services Poland domestic only (Stolica)
+                '82' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_82,
+                '83' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_83,
+                '84' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_84
+            ),
+            // Puerto Rico Origin
+            'Puerto Rico Origin' => array(
+                '01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_01,
+                '02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_02,
+                '03' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_03,
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_08,
+                '14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_14,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_65
+            ),
+            // Mexico Origin
+            'Mexico Origin' => array(
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_08,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_65
+            ),
+            // All other origins
+            'All other origins' => array(
+                // service code 7 seems to be gone after January 2, 2007
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_OTHER_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_OTHER_ORIGIN_08,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_OTHER_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_65
+            )
+        );
+    } // end function upsxml
+
+    // class methods
+    function quote($method = '') {
+        global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes, $total_weight, $boxcount, $cart;
+        // UPS purports that if the origin is left out, it defaults to the account's location. Yeah, right.
+        $state = $order->delivery['state'];
+        $zone_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_name = '" .  $order->delivery['state'] . "'");
+        if (tep_db_num_rows($zone_query)) {
+            $zone = tep_db_fetch_array($zone_query);
+            $state = $zone['zone_code'];
+        }
+        $this->_upsOrigin(MODULE_SHIPPING_UPSXML_RATES_CITY, MODULE_SHIPPING_UPSXML_RATES_STATEPROV, MODULE_SHIPPING_UPSXML_RATES_COUNTRY, MODULE_SHIPPING_UPSXML_RATES_POSTALCODE);
+        $this->_upsDest($order->delivery['city'], $state, $order->delivery['country']['iso_code_2'], $order->delivery['postcode']);
+        $productsArray = $cart->get_products();
+				if ($this->dimensions_support > 0) {
+					$productsArray = $this->more_dimensions_to_productsArray($productsArray);
+				}
+
+        if ($this->dimensions_support == '2') {
+            // sort $productsArray according to ready-to-ship (first) and not-ready-to-ship (last)
+            usort($productsArray, ready_to_shipCmp);
+            // Use packing algoritm to return the number of boxes we'll ship
+            $boxesToShip = $this->packProducts($productsArray);
+            // Quote for the number of boxes
+            for ($i = 0; $i < count($boxesToShip); $i++) {
+                $this->_addItem($boxesToShip[$i]['length'], $boxesToShip[$i]['width'], $boxesToShip[$i]['height'], $boxesToShip[$i]['current_weight'], $boxesToShip[$i]['price']);
+                $totalWeight += $boxesToShip[$i]['current_weight'];
+            }
+        } elseif ($this->dimensions_support == '1') {
+            $totalWeight = 0;
+            $total_non_ready_to_ship_weight = 0;
+						$total_non_ready_to_ship_value = 0;
+            // sort $productsArray according to ready-to-ship (first) and not-ready-to-ship (last)
+            usort($productsArray, ready_to_shipCmp);
+            $non_ready_to_shipArray = array();
+            // walk through the productsArray, separate the items ready-to-ship and add them to
+            // the items (boxes) list, add the weight to the totalWeight
+            // and add the other items to a separate array
+            for ($i = 0; $i < count($productsArray); $i++) {
+                if ($productsArray[$i]['ready_to_ship'] == '1') {
+                    for ($z = 0 ; $z < $productsArray[$i]['quantity']; $z++) {
+                        $this->_addItem($productsArray[$i]['length'], $productsArray[$i]['width'], $productsArray[$i]['height'], $productsArray[$i]['weight'], (MODULE_SHIPPING_UPSXML_INSURE == 'False' ? $this->pkgvalue : $productsArray[$i]['final_price']));
+                        $totalWeight += $productsArray[$i]['weight'];
+                    } // end for ($z = 0 ; $z < $productsArray[$i]['quantity']; $z++)
+                } // end if($productsArray['ready_to_ship'] == '1')
+                else {
+                    $non_ready_to_shipArray[] = $productsArray[$i];
+                }
+            } // end for ($i = 0; $i < count($productsArray); $i++)
+            // Ready_to_ship items out of the way, now assess remaining weight and remaining value of products
+
+            for ($x = 0 ; $x < count($non_ready_to_shipArray) ; $x++) {
+                $total_non_ready_to_ship_weight += ($non_ready_to_shipArray[$x]['weight'] * $non_ready_to_shipArray[$x]['quantity']);
+								$total_non_ready_to_ship_value += ($non_ready_to_shipArray[$x]['final_price'] * $non_ready_to_shipArray[$x]['quantity']);
+            } // end for ($x = 0 ; count($non_ready_to_shipArray) ; $x++)
+      
+            if (tep_not_null($non_ready_to_shipArray)) {
+                // adapted code from includes/classes/shipping.php
+                $shipping_non_ready_to_ship_boxes = 1;
+                $shipping_non_ready_to_ship_weight = $total_non_ready_to_ship_weight;
+                if (SHIPPING_BOX_WEIGHT >= $total_non_ready_to_ship_weight*SHIPPING_BOX_PADDING/100) {
+                  $total_non_ready_to_ship_weight = $total_non_ready_to_ship_weight+SHIPPING_BOX_WEIGHT;
+                } else {
+                  $total_non_ready_to_ship_weight += $total_non_ready_to_ship_weight*SHIPPING_BOX_PADDING/100;
+                }
+                if ($total_non_ready_to_ship_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes
+                    $shipping_non_ready_to_ship_boxes = ceil($total_non_ready_to_ship_weight/SHIPPING_MAX_WEIGHT);
+                    $shipping_non_ready_to_ship_weight = round($total_non_ready_to_ship_weight/$shipping_non_ready_to_ship_boxes,1);
+                }
+                // end adapted code from includes/classes/shipping.php
+                // weight and number of boxes of non-read-to-ship is determined, now add them to the items list
+                for ($y = 0; $y < $shipping_non_ready_to_ship_boxes ; $y++) {
+                    $this->_addItem(0, 0, 0, $shipping_non_ready_to_ship_weight, (MODULE_SHIPPING_UPSXML_INSURE == 'False' ? $this->pkgvalue : number_format(($total_non_ready_to_ship_value/$shipping_non_ready_to_ship_boxes), 2, '.', '')) );
+                    $totalWeight += $shipping_non_ready_to_ship_weight;
+                } // end for ($y = 0; $y < $shipping_non_ready_to_ship_boxes ; $y++)
+            } // end if (tep_not_null($non_ready_to_shipArray))
+        } else {
+            // The old method. Let osCommerce tell us how many boxes, plus the weight of each (or total? - might be sw/num boxes)
+            $this->items_qty = 0; //reset quantities
+						if (MODULE_SHIPPING_UPSXML_INSURE == 'False') {
+               for ($i = 0; $i < $shipping_num_boxes; $i++) {
+                  $this->_addItem(0, 0, 0, $shipping_weight, $this->pkgvalue);
+               }
+						} else {
+							// $this->pkgvalue has been set as order subtotal around line 86, it will cause overcharging
+							// of insurance if not divided by the number of boxes
+							 for ($i = 0; $i < $shipping_num_boxes; $i++) {
+                  $this->_addItem(0, 0, 0, $shipping_weight, number_format(($this->pkgvalue/$shipping_num_boxes), 2, '.', ''));
+               }
+						} // end if/else  (MODULE_SHIPPING_UPSXML_INSURE == 'False')
+        }
+
+        // BOF Time In Transit: comment out this section if you don't want/need to have
+        // expected delivery dates
+        if ($this->dimensions_support > 0) {
+            $this->weight_for_timeintransit = round($totalWeight,1);
+        } else {
+            $this->weight_for_timeintransit = round($shipping_num_boxes * $shipping_weight,1);
+        }
+        // Added to workaround time in transit error 270033 if total weight of packages is over 150lbs or 70kgs
+        if (($this->weight_for_timeintransit > 150) && ($this->unit_weight == "LBS")) {
+          $this->weight_for_timeintransit = 150;          
+        } else if (($this->weight_for_timeintransit > 70) && ($this->unit_weight == "KGS")) {
+          $this->weight_for_timeintransit = 70;          
+        }
+        // debug only:
+        /*  echo '<pre>Packages and variables:<br />';
+         print_r($this);
+         echo '<br />';
+         exit; */
+        $this->servicesTimeintransit = $this->_upsGetTimeServices();
+        if ($this->logfile) {
+            error_log("------------------------------------------\n", 3, $this->logfile);
+            error_log("Time in Transit: " . $this->timeintransit . "\n", 3, $this->logfile);
+        }
+        // EOF Time In Transit
+
+        $upsQuote = $this->_upsGetQuote();
+        if ((is_array($upsQuote)) && (sizeof($upsQuote) > 0)) {
+            if ($this->dimensions_support > 0) {
+                $this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $this->boxCount . ($this->boxCount > 1 ? ' pkg(s), ' : ' pkg, ') . round($totalWeight,0) . ' ' . strtolower($this->unit_weight) . ' total)');
+            } else {
+                $this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $shipping_num_boxes . ($this->boxCount > 1 ? ' pkg(s) x ' : ' pkg x ') . round($shipping_weight,0) . ' ' . strtolower($this->unit_weight) . ' total)');
+            }
+            $methods = array();
+            for ($i=0; $i < sizeof($upsQuote); $i++) {
+                list($type, $cost) = each($upsQuote[$i]);
+                // BOF limit choices, behaviour changed from versions < 1.2
+                if ($this->exclude_choices($type)) continue;
+                // EOF limit choices
+                if ( $method == '' || $method == $type ) {
+                    $_type = $type;
+
+                    if ($this->timeInTransitView == "Raw") {
+                      if (isset($this->servicesTimeintransit[$type])) {
+                        $_type = $_type . ", ".$this->servicesTimeintransit[$type]["date"];
+                      }        
+                    } else {
+                      if (isset($this->servicesTimeintransit[$type])) {
+                        $eta_array = explode("-", $this->servicesTimeintransit[$type]["date"]);
+                        $months = array (" ", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
+                        $eta_arrival_date = $months[(int)$eta_array[1]]." ".$eta_array[2].", ".$eta_array[0];
+                        $_type .= ", <acronym title='Estimated Delivery Date'>EDD</acronym>: ".$eta_arrival_date;
+                      }          
+                    }                    
+                    
+                    // changed to make handling percentage based
+                    if ($this->handling_type == "Percentage") {
+                        $methods[] = array('id' => $type, 'title' => $_type, 'cost' => ((($this->handling_fee * $cost)/100) + $cost));
+                    } else {
+                        $methods[] = array('id' => $type, 'title' => $_type, 'cost' => ($this->handling_fee + $cost));
+                    }
+                }
+            }
+            if ($this->tax_class > 0) {
+                $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+            }
+            $this->quotes['methods'] = $methods;
+        } else {
+            if ( $upsQuote != false ) {
+                $errmsg = $upsQuote;
+            } else {
+                $errmsg = MODULE_SHIPPING_UPSXML_RATES_TEXT_UNKNOWN_ERROR;
+            }
+            $errmsg .= '<br>' . MODULE_SHIPPING_UPSXML_RATES_TEXT_IF_YOU_PREFER . ' ' . STORE_NAME.' via <a href="mailto:'.STORE_OWNER_EMAIL_ADDRESS.'"><u>Email</U></a>.';
+            $this->quotes = array('module' => $this->title, 'error' => $errmsg);
+        }
+        if (tep_not_null($this->icon)) {
+            $this->quotes['icon'] = tep_image($this->icon, $this->title);
+        }
+        return $this->quotes;
+    }
+
+    //**************
+    function check() {
+        if (!isset($this->_check)) {
+            $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_UPSXML_RATES_STATUS'");
+            $this->_check = tep_db_num_rows($check_query);
+        }
+        return $this->_check;
+    }
+
+    //**************
+    function install() {
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable UPS Shipping', 'MODULE_SHIPPING_UPSXML_RATES_STATUS', 'True', 'Do you want to offer UPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Rates Access Key', 'MODULE_SHIPPING_UPSXML_RATES_ACCESS_KEY', '', 'Enter the XML rates access key assigned to you by UPS.', '6', '1', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Rates Username', 'MODULE_SHIPPING_UPSXML_RATES_USERNAME', '', 'Enter your UPS Services account username.', '6', '2', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Rates Password', 'MODULE_SHIPPING_UPSXML_RATES_PASSWORD', '', 'Enter your UPS Services account password.', '6', '3', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Pickup Method', 'MODULE_SHIPPING_UPSXML_RATES_PICKUP_METHOD', 'Daily Pickup', 'How do you give packages to UPS (only used when origin is US)?', '6', '4', 'tep_cfg_select_option(array(\'Daily Pickup\', \'Customer Counter\', \'One Time Pickup\', \'On Call Air Pickup\', \'Letter Center\', \'Air Service Center\', \'Suggested Retail Rates (UPS Store)\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Packaging Type', 'MODULE_SHIPPING_UPSXML_RATES_PACKAGE_TYPE', 'Package', 'What kind of packaging do you use?', '6', '5', 'tep_cfg_select_option(array(\'Package\', \'UPS Letter\', \'UPS Tube\', \'UPS Pak\', \'UPS Express Box\', \'UPS 25kg Box\', \'UPS 10kg box\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Classification Code', 'MODULE_SHIPPING_UPSXML_RATES_CUSTOMER_CLASSIFICATION_CODE', '01', '01 - If you are billing to a UPS account and have a daily UPS pickup, 03 - If you do not have a UPS account or you are billing to a UPS account but do not have a daily pickup, 04 - If you are shipping from a retail outlet (only used when origin is US)', '6', '6', 'tep_cfg_select_option(array(\'01\', \'03\', \'04\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Shipping Origin', 'MODULE_SHIPPING_UPSXML_RATES_ORIGIN', 'US Origin', 'What origin point should be used (this setting affects only what UPS product names are shown to the user)', '6', '7', 'tep_cfg_select_option(array(\'US Origin\', \'Canada Origin\', \'European Union Origin\', \'Puerto Rico Origin\', \'Mexico Origin\', \'All other origins\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Origin City', 'MODULE_SHIPPING_UPSXML_RATES_CITY', '', 'Enter the name of the origin city.', '6', '8', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Origin State/Province', 'MODULE_SHIPPING_UPSXML_RATES_STATEPROV', '', 'Enter the two-letter code for your origin state/province.', '6', '9', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Origin Country', 'MODULE_SHIPPING_UPSXML_RATES_COUNTRY', '', 'Enter the two-letter code for your origin country.', '6', '10', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Origin Zip/Postal Code', 'MODULE_SHIPPING_UPSXML_RATES_POSTALCODE', '', 'Enter your origin zip/postalcode.', '6', '11', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Test or Production Mode', 'MODULE_SHIPPING_UPSXML_RATES_MODE', 'Test', 'Use this module in Test or Production mode?', '6', '12', 'tep_cfg_select_option(array(\'Test\', \'Production\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Unit Weight', 'MODULE_SHIPPING_UPSXML_RATES_UNIT_WEIGHT', 'LBS', 'By what unit are your packages weighed?', '6', '13', 'tep_cfg_select_option(array(\'LBS\', \'KGS\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Unit Length', 'MODULE_SHIPPING_UPSXML_RATES_UNIT_LENGTH', 'IN', 'By what unit are your packages sized?', '6', '14', 'tep_cfg_select_option(array(\'IN\', \'CM\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Dimensions Support', 'MODULE_SHIPPING_UPSXML_DIMENSIONS_SUPPORT', 'No', 'Do you use the additional dimensions support (read dimensions.txt in the package)?', '6', '23', 'tep_cfg_select_option(array(\'No\', \'Ready-to-ship only\', \'With product dimensions\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Quote Type', 'MODULE_SHIPPING_UPSXML_RATES_QUOTE_TYPE', 'Commercial', 'Quote for Residential or Commercial Delivery', '6', '15', 'tep_cfg_select_option(array(\'Commercial\', \'Residential\'), ', now())");
+        // next two keys added to be able to use negotiated rates (available from UPS since about July 2006)
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Negotiated rates', 'MODULE_SHIPPING_UPSXML_RATES_USE_NEGOTIATED_RATES', 'False', 'Do you receive discounted rates from UPS and want to use these for shipping quotes? <b>Note:</b>  You need to enter your UPS account number below.', '6', '25', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Account Number', 'MODULE_SHIPPING_UPSXML_RATES_UPS_ACCOUNT_NUMBER', '', 'Enter your UPS Account number when you have and want to use negotiated rates.', '6', '26', now())");				
+        // added for handling type selection
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Type', 'MODULE_SHIPPING_UPSXML_HANDLING_TYPE', 'Flat Fee', 'Handling type for this shipping method.', '6', '16', 'tep_cfg_select_option(array(\'Flat Fee\', \'Percentage\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_UPSXML_RATES_HANDLING', '0', 'Handling fee for this shipping method.', '6', '16', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Currency Code', 'MODULE_SHIPPING_UPSXML_CURRENCY_CODE', '', 'Enter the 3 letter currency code for your country of origin. United States (USD)', '6', '2', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Insurance', 'MODULE_SHIPPING_UPSXML_INSURE', 'True', 'Do you want to insure packages shipped by UPS?', '6', '22', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_UPSXML_RATES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '17', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_UPSXML_RATES_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '18', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_UPSXML_RATES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '19', now())");
+        // add key for disallowed shipping methods
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Disallowed Shipping Methods', 'MODULE_SHIPPING_UPSXML_TYPES', '', 'Select the UPS services <span style=\'color: red; font-weight: bold\'>not</span> to be offered.', '6', '20', 'tep_cfg_select_multioption(array(\'Next Day Air\', \'2nd Day Air\', \'Ground\', \'Worldwide Express\', \'Worldwide Express Plus\', \'Worldwide Expedited\', \'Express\', \'Standard\', \'3 Day Select\', \'Next Day Air Saver\', \'Next Day Air Early A.M.\', \'Expedited\', \'2nd Day Air A.M.\', \'Saver\', \'Express Early A.M.\', \'Express Plus\'), ',  now())");
+        // add key for shipping delay
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('', 'Shipping Delay', 'SHIPPING_DAYS_DELAY', '1', 'How many days from when an order is placed to when you ship it (Decimals are allowed). Arrival date estimations are based on this value.', '6', '21', NULL, now(), NULL, NULL)");
+        // add key for enabling email error messages
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Email UPS errors', 'MODULE_SHIPPING_UPSXML_EMAIL_ERRORS', 'Yes', 'Do you want to receive UPS errors by email?', '6', '24', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now())");
+        // add key for time in transit view type
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Time in Transit View Type', 'MODULE_SHIPPING_UPSXML_RATES_TIME_IN_TRANSIT_VIEW', 'Raw', 'How the module should display the time in transit to the customer.', '6', '16', 'tep_cfg_select_option(array(\'Raw\', \'Detailed\'), ', now())");
+    }
+
+    //****************
+    function remove() {
+        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    //*************
+    function keys() {
+        // add MODULE_SHIPPING_UPSXML_TYPES to end of array for selectable shipping methods
+        return array('MODULE_SHIPPING_UPSXML_RATES_STATUS', 'MODULE_SHIPPING_UPSXML_RATES_ACCESS_KEY', 'MODULE_SHIPPING_UPSXML_RATES_USERNAME', 'MODULE_SHIPPING_UPSXML_RATES_PASSWORD', 'MODULE_SHIPPING_UPSXML_RATES_PICKUP_METHOD', 'MODULE_SHIPPING_UPSXML_RATES_PACKAGE_TYPE', 'MODULE_SHIPPING_UPSXML_RATES_CUSTOMER_CLASSIFICATION_CODE', 'MODULE_SHIPPING_UPSXML_RATES_ORIGIN', 'MODULE_SHIPPING_UPSXML_RATES_CITY', 'MODULE_SHIPPING_UPSXML_RATES_STATEPROV', 'MODULE_SHIPPING_UPSXML_RATES_COUNTRY', 'MODULE_SHIPPING_UPSXML_RATES_POSTALCODE', 'MODULE_SHIPPING_UPSXML_RATES_MODE', 'MODULE_SHIPPING_UPSXML_RATES_UNIT_WEIGHT', 'MODULE_SHIPPING_UPSXML_RATES_UNIT_LENGTH', 'MODULE_SHIPPING_UPSXML_DIMENSIONS_SUPPORT', 'MODULE_SHIPPING_UPSXML_RATES_QUOTE_TYPE', 'MODULE_SHIPPING_UPSXML_RATES_USE_NEGOTIATED_RATES', 'MODULE_SHIPPING_UPSXML_RATES_UPS_ACCOUNT_NUMBER', 'MODULE_SHIPPING_UPSXML_HANDLING_TYPE', 'MODULE_SHIPPING_UPSXML_RATES_HANDLING', 'MODULE_SHIPPING_UPSXML_INSURE', 'MODULE_SHIPPING_UPSXML_CURRENCY_CODE', 'MODULE_SHIPPING_UPSXML_RATES_TAX_CLASS', 'MODULE_SHIPPING_UPSXML_RATES_ZONE', 'MODULE_SHIPPING_UPSXML_RATES_SORT_ORDER', 'MODULE_SHIPPING_UPSXML_TYPES', 'SHIPPING_DAYS_DELAY', 'MODULE_SHIPPING_UPSXML_EMAIL_ERRORS', 'MODULE_SHIPPING_UPSXML_RATES_TIME_IN_TRANSIT_VIEW');
+    }
+
+    //***********************
+    function _upsProduct($prod){
+        $this->_upsProductCode = $prod;
+    }
+
+    //**********************************************
+    function _upsOrigin($city, $stateprov, $country, $postal){
+        $this->_upsOriginCity = $city;
+        $this->_upsOriginStateProv = $stateprov;
+        $this->_upsOriginCountryCode = $country;
+        $postal = str_replace(' ', '', $postal);
+        if ($country == 'US') {
+            $this->_upsOriginPostalCode = substr($postal, 0, 5);
+        } else {
+            $this->_upsOriginPostalCode = $postal;
+        }
+    }
+
+    //**********************************************
+    function _upsDest($city, $stateprov, $country, $postal) {
+        $this->_upsDestCity = $city;
+        $this->_upsDestStateProv = $stateprov;
+        $this->_upsDestCountryCode = $country;
+        $postal = str_replace(' ', '', $postal);
+        if ($country == 'US') {
+            $this->_upsDestPostalCode = substr($postal, 0, 5);
+        } else {
+            $this->_upsDestPostalCode = $postal;
+        }
+    }
+
+    //************************
+    function _upsAction($action) {
+        // rate - Single Quote; shop - All Available Quotes
+        $this->_upsActionCode = $action;
+    }
+
+    //********************************************
+		// default value of 100 added for insurance (100 shouldn't trigger costs for insurance)
+    function _addItem($length, $width, $height, $weight, $price = 0 ) {
+        // Add box or item to shipment list. Round weights to 1 decimal places.
+        if ((float)$weight < 1.0) {
+            $weight = 1;
+        } else {
+            $weight = round($weight, 1);
+        }
+        $index = $this->items_qty;
+        $this->item_length[$index] = ($length ? (string)$length : '0' );
+        $this->item_width[$index] = ($width ? (string)$width : '0' );
+        $this->item_height[$index] = ($height ? (string)$height : '0' );
+        $this->item_weight[$index] = ($weight ? (string)$weight : '0' );
+				$this->item_price[$index] = $price;
+        $this->items_qty++;
+    }
+
+    //********************
+    function getPackagesByVol() {
+        $packages = array();
+        $packages_query = tep_db_query("select *, (package_length * package_width * package_height) as volume from " . TABLE_PACKAGING . " order by volume;");
+				$counter = 0;
+        while ($package = tep_db_fetch_array($packages_query)) {
+            $packages[] = array(
+            'id' => $package['package_id'],
+            'name' => $package['package_name'],
+            'description' => $package['package_description'],
+            'length' => $package['package_length'],
+            'width' => $package['package_width'],
+            'height' => $package['package_height'],
+            'empty_weight' => $package['package_empty_weight'],
+            'max_weight' => $package['package_max_weight'],
+            'volume' => $package['volume']);
+// sort dimensions from low to high, used in the function fitsInBox
+            $dimensions = array($package['package_length'], $package['package_width'], $package['package_height']);
+            sort($dimensions);
+						foreach($dimensions as $key => $value) {
+							if ($key == 0 ) { $packages[$counter]['x'] = $value; }
+							if ($key == 1 ) { $packages[$counter]['y'] = $value; }
+							if ($key == 2 ) { $packages[$counter]['z'] = $value; }
+						}
+						$counter++;
+        }
+        return $packages;
+    }
+
+    //********************************
+    function packProducts($productsArray) {
+        $definedPackages = $this->getPackagesByVol();
+		/*		echo '<pre>';
+				print_r($definedPackages);
+				exit; */
+        $emptyBoxesArray = array();
+        for ($i = 0; $i < count($definedPackages); $i++) {
+            $definedBox = $definedPackages[$i];
+            $definedBox['remaining_volume'] = $definedBox['volume'];
+            $definedBox['current_weight'] = $definedBox['empty_weight'];
+            $emptyBoxesArray[] = $definedBox;
+        }
+          if (count($emptyBoxesArray) == 0) {
+             print("ERROR: No boxes to ship unpackaged product<br />\n");
+             break;
+          }
+
+        $packedBoxesArray = array();
+        $currentBox = NULL;
+        $index_of_largest_box = count($emptyBoxesArray)-1;
+        // Get the product array and expand multiple qty items.
+        $productsRemaining = array();
+        for ($i = 0; $i < count($productsArray); $i++) {
+            $product = $productsArray[$i];
+            // sanity checks on the product, should not be done for ready-to-ship times
+            if ($product['ready_to_ship'] == '0') {
+						  $product['ready_to_ship'] = '1';
+						  for ($x = 0; $x <= $index_of_largest_box; $x++) {
+							  if ($this->fitsInBox($product, $emptyBoxesArray[$x])) {
+                  $product['ready_to_ship'] = '0';
+                  $product['largest_box_it_will_fit'] = $x;
+                } 
+						  } // end for ($x = 0; $x <= $index_of_largest_box; $x++) 
+            } // end if ($product['ready_to_ship'] == '0')
+            
+            for ($j = 0; $j < $productsArray[$i]['quantity']; $j++) {
+                $productsRemaining[] = $product;
+            }
+        } // end for ($i = 0; $i < count($productsArray); $i++)
+        // make sure the products that did not fit the largest box and are now set as ready-to-ship
+        // are out of the way as soon as possible
+        usort($productsRemaining, ready_to_shipCmp);
+        // Worst case, you'll need as many boxes as products ordered.
+        while (count($productsRemaining)) {
+            // Immediately set aside products that are already packed and ready.
+            if ($productsRemaining[0]['ready_to_ship'] == '1') {
+                $packedBoxesArray[] = array (
+                'length' => $productsRemaining[0]['length'],
+                'width' => $productsRemaining[0]['width'],
+                'height' => $productsRemaining[0]['height'],
+                'current_weight' => $productsRemaining[0]['weight'],
+								'price' => $productsRemaining[0]['final_price']);
+                $productsRemaining = array_slice($productsRemaining, 1);
+                continue;
+            }
+            //Cycle through boxes, increasing box size if all doesn't fit.
+            for ($b = 0; $b < count($emptyBoxesArray) && tep_not_null($productsRemaining); $b++) {
+                $result = $this->fitProductsInBox($productsRemaining, $emptyBoxesArray[$b], $packedBoxesArray, $b, count($emptyBoxesArray) -1 );
+                $packedBoxesArray = $result['packed_boxes'];
+                $productsRemaining = $result['remaining'];
+            }
+        } // end while
+
+        return $packedBoxesArray;
+    }
+
+    //*****************************
+    function fitsInBox($product, $box) {
+        // in case by accident or by choice length, width or height is not set
+        // we will estimate it by using a set density and the product['weight'] variable
+        // will only be used in the check for whether it fits the largest box
+        // after that it will already be set, if product['weight'] is set at least
+				if ($product['x'] > $box['x'] || $product['y'] > $box['y'] || $product['z'] > $box['z']) {
+            return false;
+        } 
+
+        if ($product['volume'] <= $box['remaining_volume']) {
+            if ($box['max_weight'] == 0 || ($box['current_weight'] + $product['weight'] <= $box['max_weight'])) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    //***********************************
+    function putProductInBox($product, $box) {
+        $box['remaining_volume'] -= $product['volume'];
+        $box['products'][] = $product;
+        $box['current_weight'] += $product['weight'];
+				$box['price'] += $product['final_price'];
+        return $box;
+    } 
+    //*********************    
+    function fitProductsInBox($productsRemaining, $emptyBox, $packedBoxesArray, $box_no, $index_of_largest_box) { 
+        $currentBox = $emptyBox;
+        $productsRemainingSkipped = array();
+        $productsRemainingNotSkipped = array();
+        // keep apart products that will not fit this box anyway
+        for ($p = 0; $p < count($productsRemaining); $p++) {
+          if ($productsRemaining[$p]['largest_box_it_will_fit'] < $box_no) {
+            $productsRemainingSkipped[] = $productsRemaining[$p];
+          } else {
+            $productsRemainingNotSkipped[] = $productsRemaining[$p];
+          }
+        }
+        unset($productsRemaining);
+        $productsRemaining = $productsRemainingNotSkipped;
+        unset($productsRemainingNotSkipped);
+        if (count($productsRemaining) == 0) {
+          // products remaining are the ones that will not fit this box (productsRemaimingSkipped)
+            $result_array = array('remaining' => $productsRemainingSkipped, 'box_no' => $box_no, 'packed_boxes' => $packedBoxesArray);
+            return ($result_array);
+        }
+
+        //Try to fit each product that can fit in box
+        for ($p = 0; $p < count($productsRemaining); $p++) {
+            if ($this->fitsInBox($productsRemaining[$p], $currentBox)) {
+                //It fits. Put it in the box.
+                $currentBox = $this->putProductInBox($productsRemaining[$p], $currentBox);
+                if ($p == count($productsRemaining) - 1) {
+                    $packedBoxesArray[] = $currentBox;
+                    $productsRemaining = array_slice($productsRemaining, $p + 1);
+                    $productsRemaining = array_merge($productsRemaining, $productsRemainingSkipped);
+
+                    $result_array = array('remaining' => $productsRemaining, 'box_no' => $box_no, 'packed_boxes' => $packedBoxesArray);
+                    return ($result_array);
+                }
+            } else {
+                if ($box_no == $index_of_largest_box) {
+                    //We're at the largest box already, and it's full. Keep what we've packed so far and get another box.
+                    $packedBoxesArray[] = $currentBox;
+                    $productsRemaining = array_slice($productsRemaining, $p);
+                    $productsRemaining = array_merge($productsRemaining, $productsRemainingSkipped);
+                    $result_array = array('remaining' => $productsRemaining, 'box_no' => $box_no, 'packed_boxes' => $packedBoxesArray);
+                    return ($result_array);
+                }
+                // Not all of them fit. Stop packing remaining products and try next box.
+                $productsRemaining = array_merge($productsRemaining, $productsRemainingSkipped);
+                $result_array = array('remaining' => $productsRemaining, 'box_no' => $box_no, 'packed_boxes' => $packedBoxesArray);
+                return ($result_array);
+            } // end else
+        } // end for ($p = 0; $p < count($productsRemaining); $p++)
+    } // end function
+
+    //*********************
+    function _upsGetQuote() {
+
+        // Create the access request
+        $accessRequestHeader =
+        "<?xml version=\"1.0\"?>\n".
+        "<AccessRequest xml:lang=\"en-US\">\n".
+        "   <AccessLicenseNumber>". $this->access_key ."</AccessLicenseNumber>\n".
+        "   <UserId>". $this->access_username ."</UserId>\n".
+        "   <Password>". $this->access_password ."</Password>\n".
+        "</AccessRequest>\n";
+
+        $ratingServiceSelectionRequestHeader =
+        "<?xml version=\"1.0\"?>\n".
+        "<RatingServiceSelectionRequest xml:lang=\"en-US\">\n".
+        "   <Request>\n".
+        "       <TransactionReference>\n".
+        "           <CustomerContext>Rating and Service</CustomerContext>\n".
+        "           <XpciVersion>". $this->xpci_version ."</XpciVersion>\n".
+        "       </TransactionReference>\n".
+        "       <RequestAction>Rate</RequestAction>\n".
+        "       <RequestOption>shop</RequestOption>\n".
+        "   </Request>\n";
+        // according to UPS the CustomerClassification and PickupType containers should
+        // not be present when the origin country is non-US see:
+        // http://forums.oscommerce.com/index.php?s=&showtopic=49382&view=findpost&p=730947
+        if ($this->origin_country == 'US') {
+        $ratingServiceSelectionRequestHeader .=
+        "   <PickupType>\n".
+        "       <Code>". $this->pickup_methods[$this->pickup_method] ."</Code>\n".
+        "   </PickupType>\n";
+        "   <CustomerClassification>\n".
+        "       <Code>". $this->customer_classification ."</Code>\n".
+        "   </CustomerClassification>\n";
+        }
+        $ratingServiceSelectionRequestHeader .=
+        "   <Shipment>\n".
+        "       <Shipper>\n";
+        if ($this->use_negotiated_rates == 'True') {
+        $ratingServiceSelectionRequestHeader .=
+        "         <ShipperNumber>" . $this->access_account_number . "</ShipperNumber>\n";
+				}
+        $ratingServiceSelectionRequestHeader .=
+        "           <Address>\n".
+        "               <City>". $this->_upsOriginCity ."</City>\n".
+        "               <StateProvinceCode>". $this->_upsOriginStateProv ."</StateProvinceCode>\n".
+        "               <CountryCode>". $this->_upsOriginCountryCode ."</CountryCode>\n".
+        "               <PostalCode>". $this->_upsOriginPostalCode ."</PostalCode>\n".
+        "           </Address>\n".
+        "       </Shipper>\n".
+        "       <ShipTo>\n".
+        "           <Address>\n".
+        "               <City>". $this->_upsDestCity ."</City>\n".
+        "               <StateProvinceCode>". $this->_upsDestStateProv ."</StateProvinceCode>\n".
+        "               <CountryCode>". $this->_upsDestCountryCode ."</CountryCode>\n".
+        "               <PostalCode>". $this->_upsDestPostalCode ."</PostalCode>\n".
+        ($this->quote_type == "Residential" ? "<ResidentialAddressIndicator/>\n" : "") .
+        "           </Address>\n".
+        "       </ShipTo>\n";
+        for ($i = 0; $i < $this->items_qty; $i++) {
+
+            $ratingServiceSelectionRequestPackageContent .=
+            "       <Package>\n".
+            "           <PackagingType>\n".
+            "               <Code>". $this->package_types[$this->package_type] ."</Code>\n".
+            "           </PackagingType>\n";
+            if ($this->dimensions_support > 0 && ($this->item_length[$i] > 0 ) && ($this->item_width[$i] > 0 ) && ($this->item_height[$i] > 0)) {
+
+                $ratingServiceSelectionRequestPackageContent .=
+                "           <Dimensions>\n".
+                "               <UnitOfMeasurement>\n".
+                "                   <Code>". $this->unit_length ."</Code>\n".
+                "               </UnitOfMeasurement>\n".
+                "               <Length>". $this->item_length[$i] ."</Length>\n".
+                "               <Width>". $this->item_width[$i] ."</Width>\n".
+                "               <Height>". $this->item_height[$i] ."</Height>\n".
+                "           </Dimensions>\n";
+            }
+
+            $ratingServiceSelectionRequestPackageContent .=
+            "           <PackageWeight>\n".
+            "               <UnitOfMeasurement>\n".
+            "                   <Code>". $this->unit_weight ."</Code>\n".
+            "               </UnitOfMeasurement>\n".
+            "               <Weight>". $this->item_weight[$i] ."</Weight>\n".
+            "           </PackageWeight>\n".
+            "           <PackageServiceOptions>\n".
+            //"               <COD>\n".
+            //"                   <CODFundsCode>0</CODFundsCode>\n".
+            //"                   <CODCode>3</CODCode>\n".
+            //"                   <CODAmount>\n".
+            //"                       <CurrencyCode>USD</CurrencyCode>\n".
+            //"                       <MonetaryValue>1000</MonetaryValue>\n".
+            //"                   </CODAmount>\n".
+            //"               </COD>\n".
+            "               <InsuredValue>\n".
+            "                   <CurrencyCode>".MODULE_SHIPPING_UPSXML_CURRENCY_CODE."</CurrencyCode>\n".
+            "                   <MonetaryValue>".$this->item_price[$i]."</MonetaryValue>\n".
+            "               </InsuredValue>\n".
+            "           </PackageServiceOptions>\n".
+            "       </Package>\n";
+        }
+
+        $ratingServiceSelectionRequestFooter = '';
+        //"   <ShipmentServiceOptions/>\n".
+           if ($this->use_negotiated_rates == 'True') {
+        $ratingServiceSelectionRequestFooter .=
+            "       <RateInformation>\n".
+            "         <NegotiatedRatesIndicator/>\n".
+            "       </RateInformation>\n";
+           }
+        $ratingServiceSelectionRequestFooter .=
+        "   </Shipment>\n";
+        // according to UPS the CustomerClassification and PickupType containers should
+        // not be present when the origin country is non-US see:
+        // http://forums.oscommerce.com/index.php?s=&showtopic=49382&view=findpost&p=730947
+        if ($this->origin_country == 'US') {
+        $ratingServiceSelectionRequestFooter .=
+              "   <CustomerClassification>\n".
+              "       <Code>". $this->customer_classification ."</Code>\n".
+              "   </CustomerClassification>\n";
+        }
+        $ratingServiceSelectionRequestFooter .=
+        "</RatingServiceSelectionRequest>\n";
+
+        $xmlRequest = $accessRequestHeader .
+        $ratingServiceSelectionRequestHeader .
+        $ratingServiceSelectionRequestPackageContent .
+        $ratingServiceSelectionRequestFooter;
+
+        //post request $strXML;
+        $xmlResult = $this->_post($this->protocol, $this->host, $this->port, $this->path, $this->version, $this->timeout, $xmlRequest);
+        // BOF testing with a response from UPS saved as a text file
+        // needs commenting out the line above: $xmlResult = $this->_post($this->protocol, etcetera
+/*        $filename = '/Library/WebServer/Documents/nytest/includes/modules/shipping/example_response.xml';
+        $fp = fopen($filename, "r") or die("couldn't open file");
+        $xmlResult = "";
+        while (! feof($fp)) {
+          $xmlResult .= fgets($fp, 1024);
+        } 
+        // EOF testing with a text file */
+        return $this->_parseResult($xmlResult);
+    }
+
+    //******************************************************************
+    function _post($protocol, $host, $port, $path, $version, $timeout, $xmlRequest) {
+        $url = $protocol."://".$host.":".$port.$path;
+        if ($this->logfile) {
+            error_log("------------------------------------------\n", 3, $this->logfile);
+            error_log("DATE AND TIME: ".date('Y-m-d H:i:s')."\n", 3, $this->logfile);
+            error_log("UPS URL: " . $url . "\n", 3, $this->logfile);
+        }
+        if (function_exists('exec') && $this->use_exec == '1' ) {
+            exec('which curl', $curl_output);
+            if ($curl_output) {
+                $curl_path = $curl_output[0];
+            } else {
+                $curl_path = 'curl'; // change this if necessary
+            }
+            if ($this->logfile) {
+                error_log("UPS REQUEST using exec(): " . $xmlRequest . "\n", 3, $this->logfile);
+            }
+            // add option -k to the statement: $command = "".$curl_path." -k -d \"". etcetera if you get
+            // curl error 60: error setting certificate verify locations
+            // using addslashes was the only way to avoid UPS returning the 1001 error: The XML document is not well formed
+            $command = "".$curl_path." -d \"".addslashes($xmlRequest)."\" ".$url."";
+            exec($command, $xmlResponse);
+            if ( empty($xmlResponse) && $this->logfile) { // using exec no curl errors can be retrieved
+                error_log("Error from cURL using exec() since there is no \$xmlResponse\n", 3, $this->logfile);
+            }
+            if ($this->logfile) {
+                error_log("UPS RESPONSE using exec(): " . $xmlResponse[0] . "\n", 3, $this->logfile);
+            }
+        } elseif ($this->use_exec == '1') { // if NOT (function_exists('exec') && $this->use_exec == '1'
+            if ($this->logfile) {
+                error_log("Sorry, exec() cannot be called\n", 3, $this->logfile);
+            }
+        } else { // default behavior: cURL is assumed to be compiled in PHP
+            $ch = curl_init();
+            curl_setopt($ch, CURLOPT_URL, $url);
+            // uncomment the next line if you get curl error 60: error setting certificate verify locations
+            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+            // uncommenting the next line is most likely not necessary in case of error 60
+            // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+            curl_setopt($ch, CURLOPT_HEADER, 0);
+            curl_setopt($ch, CURLOPT_POST, 1);
+            curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
+            curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);
+
+            if ($this->logfile) {
+                error_log("UPS REQUEST: " . $xmlRequest . "\n", 3, $this->logfile);
+            }
+            $xmlResponse = curl_exec ($ch);
+            if (curl_errno($ch) && $this->logfile) {
+                $error_from_curl = sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch));
+                error_log("Error from cURL: " . $error_from_curl . "\n", 3, $this->logfile);
+            }
+            // send email if enabled in the admin section
+            if (curl_errno($ch) && $this->email_errors) {
+                $error_from_curl = sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch));
+                error_log("Error from cURL: " . $error_from_curl . " experienced by customer with id " . $_SESSION['customer_id'] . " on " . date('Y-m-d H:i:s'), 1, STORE_OWNER_EMAIL_ADDRESS);
+            }
+            // log errors to file ups_error.log when set
+            if (curl_errno($ch) && $this->ups_error_file) {
+                $error_from_curl = sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch));
+                error_log(date('Y-m-d H:i:s')."\tcURL\t" . $error_from_curl . "\t" . $_SESSION['customer_id']."\n", 3, $this->ups_error_file);    
+            }
+            if ($this->logfile) {
+                error_log("UPS RESPONSE: " . $xmlResponse . "\n", 3, $this->logfile);
+            }
+            curl_close ($ch);
+        }
+
+        if(!$xmlResponse || strstr(strtolower(substr($xmlResponse, 0, 120)), "bad request"))  {
+            /* Sometimes the UPS server responds with an HTML message (differing depending on whether the test server
+               or the production server is used) but both have in the title tag "Bad request".
+               Parsing this response will result in a fatal error:
+               Call to a member function on a non-object in /blabla/includes/classes/xmldocument.php on line 57
+               It only results in not showing Estimated Delivery Dates to the customer so avoiding the fatal error should do.
+            */
+            $xmlResponse = "<?xml version=\"1.0\"?>\n".
+            "<RatingServiceSelectionResponse>\n".
+            "   <Response>\n".
+            "       <TransactionReference>\n".
+            "           <CustomerContext>Rating and Service</CustomerContext>\n".
+            "           <XpciVersion>1.0001</XpciVersion>\n".
+            "       </TransactionReference>\n".
+            "       <ResponseStatusCode>0</ResponseStatusCode>\n".
+            "       <ResponseStatusDescription>". MODULE_SHIPPING_UPSXML_RATES_TEXT_COMM_UNKNOWN_ERROR ."</ResponseStatusDescription>\n".
+            "   </Response>\n".
+            "</RatingServiceSelectionResponse>\n";
+            return $xmlResponse;
+        }
+        if ($this->use_exec == '1') {
+            return $xmlResponse[0]; // $xmlResponse is an array in this case
+        } else {
+            return $xmlResponse;
+        }
+    }
+
+    //*****************************
+    function _parseResult($xmlResult) {
+        // Parse XML message returned by the UPS post server.
+        $doc = new XMLDocument();
+        $xp = new XMLParser();
+        $xp->setDocument($doc);
+        $xp->parse($xmlResult);
+        $doc = $xp->getDocument();
+        // Get version. Must be xpci version 1.0001 or this might not work.
+        $responseVersion = $doc->getValueByPath('RatingServiceSelectionResponse/Response/TransactionReference/XpciVersion');
+        if ($this->xpci_version != $responseVersion) {
+            $message = MODULE_SHIPPING_UPSXML_RATES_TEXT_COMM_VERSION_ERROR;
+            return $message;
+        }
+        // Get response code. 1 = SUCCESS, 0 = FAIL
+        $responseStatusCode = $doc->getValueByPath('RatingServiceSelectionResponse/Response/ResponseStatusCode');
+        if ($responseStatusCode != '1') {
+            $errorMsg = $doc->getValueByPath('RatingServiceSelectionResponse/Response/Error/ErrorCode');
+            $errorMsg .= ": ";
+            $errorMsg .= $doc->getValueByPath('RatingServiceSelectionResponse/Response/Error/ErrorDescription');
+            // send email if enabled in the admin section
+            if ($this->email_errors) {
+                error_log("UPSXML Rates Error: " . $errorMsg . " experienced by customer with id " . $_SESSION['customer_id'] . " on " . date('Y-m-d H:i:s'), 1, STORE_OWNER_EMAIL_ADDRESS);
+            }
+            // log errors to file ups_error.log when set
+            if ($this->ups_error_file) {
+                error_log(date('Y-m-d H:i:s')."\tRates\t" . $errorMsg . "\t" . $_SESSION['customer_id']."\n", 3, $this->ups_error_file);    
+            }
+                return $errorMsg;
+        }
+        $root = $doc->getRoot();
+        $ratedShipments = $root->getElementsByName("RatedShipment");
+        $aryProducts = false;
+        for ($i = 0; $i < count($ratedShipments); $i++) {
+            $serviceCode = $ratedShipments[$i]->getValueByPath("/Service/Code");
+						if ($this->use_negotiated_rates == 'True') {
+							$totalCharge = $ratedShipments[$i]->getValueByPath("/NegotiatedRates/NetSummaryCharges/GrandTotal/MonetaryValue");
+                if (!($serviceCode && $totalCharge)) {
+                continue;
+                }
+						} else {
+              $totalCharge = $ratedShipments[$i]->getValueByPath("/TotalCharges/MonetaryValue");
+                if (!($serviceCode && $totalCharge)) {
+                continue;
+                }
+						}
+            $ratedPackages = $ratedShipments[$i]->getElementsByName("RatedPackage");
+            $this->boxCount = count($ratedPackages);
+            $gdaysToDelivery = $ratedShipments[$i]->getValueByPath("/GuaranteedDaysToDelivery");
+            $scheduledTime = $ratedShipments[$i]->getValueByPath("/ScheduledDeliveryTime");
+            $title = '';
+            $title = $this->service_codes[$this->origin][$serviceCode];
+
+            /* we don't want to use this, it may conflict with time estimation
+                  if ($gdaysToDelivery) {
+                      $title .= ' (';
+                      $title .= $gdaysToDelivery . " Business Days";
+                      if ($scheduledTime) {
+                          $title .= ' @ ' . $scheduledTime;
+                      }
+                      $title .= ')';
+                  } elseif ($this->timeintransit > 0) {
+                      $title .= ' (';
+                      $title .= $this->timeintransit . " Business Days";
+                      $title .= ')';
+                  }
+            */
+            $aryProducts[$i] = array($title => $totalCharge);
+        }
+        return $aryProducts;
+    }
+
+    // BOF Time In Transit
+    
+    // GM 11-15-2004: renamed from _upsGetTime()
+
+    //********************
+    function _upsGetTimeServices() {
+
+        if (defined('SHIPPING_DAYS_DELAY')) {
+            $shipdate = date("Ymd", $this->today_unix_time + (86400*SHIPPING_DAYS_DELAY));
+            $day_of_the_week = date ("w", $this->today_unix_time + (86400*SHIPPING_DAYS_DELAY) ) ;
+            if ($day_of_the_week == "0" || $day_of_the_week == "7") { // order supposed to leave on Sunday
+                $shipdate = date("Ymd", $this->today_unix_time + (86400*SHIPPING_DAYS_DELAY) + 86400);
+            } elseif ($day_of_the_week == "6") { // order supposed to leave on Saturday
+                $shipdate = date("Ymd", $this->today_unix_time + (86400*SHIPPING_DAYS_DELAY) + 172800);
+            } 
+        } else {
+            $shipdate = $this->today;
+        }
+
+        // Create the access request
+        $accessRequestHeader =
+        "<?xml version=\"1.0\"?>\n".
+        "<AccessRequest xml:lang=\"en-US\">\n".
+        "   <AccessLicenseNumber>". $this->access_key ."</AccessLicenseNumber>\n".
+        "   <UserId>". $this->access_username ."</UserId>\n".
+        "   <Password>". $this->access_password ."</Password>\n".
+        "</AccessRequest>\n";
+
+        $timeintransitSelectionRequestHeader =
+        "<?xml version=\"1.0\"?>\n".
+        "<TimeInTransitRequest xml:lang=\"en-US\">\n".
+        "   <Request>\n".
+        "       <TransactionReference>\n".
+        "           <CustomerContext>Time in Transit</CustomerContext>\n".
+        "           <XpciVersion>". $this->transitxpci_version ."</XpciVersion>\n".
+        "       </TransactionReference>\n".
+        "       <RequestAction>TimeInTransit</RequestAction>\n".
+        "   </Request>\n".
+        "   <TransitFrom>\n".
+        "       <AddressArtifactFormat>\n".
+        "           <PoliticalDivision2>". $this->origin_city ."</PoliticalDivision2>\n".
+        "           <PoliticalDivision1>". $this->origin_stateprov ."</PoliticalDivision1>\n".
+        "           <CountryCode>". $this->_upsOriginCountryCode ."</CountryCode>\n".
+        "           <PostcodePrimaryLow>". $this->origin_postalcode ."</PostcodePrimaryLow>\n".
+        "       </AddressArtifactFormat>\n".
+        "   </TransitFrom>\n".
+        "   <TransitTo>\n".
+        "       <AddressArtifactFormat>\n".
+        "           <PoliticalDivision2>". $this->_upsDestCity ."</PoliticalDivision2>\n".
+        "           <PoliticalDivision1>". $this->_upsDestStateProv ."</PoliticalDivision1>\n".
+        "           <CountryCode>". $this->_upsDestCountryCode ."</CountryCode>\n".
+        "           <PostcodePrimaryLow>". $this->_upsDestPostalCode ."</PostcodePrimaryLow>\n".
+        "           <PostcodePrimaryHigh>". $this->_upsDestPostalCode ."</PostcodePrimaryHigh>\n".
+        "       </AddressArtifactFormat>\n".
+        "   </TransitTo>\n".
+        "   <ShipmentWeight>\n".
+        "       <UnitOfMeasurement>\n".
+        "           <Code>" . $this->unit_weight . "</Code>\n".
+        "       </UnitOfMeasurement>\n".
+        "       <Weight>" . $this->weight_for_timeintransit . "</Weight>\n".
+        "   </ShipmentWeight>\n".
+        "   <InvoiceLineTotal>\n".
+        "       <CurrencyCode>" . MODULE_SHIPPING_UPSXML_CURRENCY_CODE . "</CurrencyCode>\n".
+        "       <MonetaryValue>" . $this->pkgvalue . "</MonetaryValue>\n".
+        "   </InvoiceLineTotal>\n".
+        "   <PickupDate>" . $shipdate . "</PickupDate>\n".
+        "</TimeInTransitRequest>\n";
+
+        $xmlTransitRequest = $accessRequestHeader .
+        $timeintransitSelectionRequestHeader;
+
+        //post request $strXML;
+        $xmlTransitResult = $this->_post($this->protocol, $this->host, $this->port, $this->transitpath, $this->transitversion, $this->timeout, $xmlTransitRequest);
+        return $this->_transitparseResult($xmlTransitResult);
+    }
+
+    //***************************************
+    
+    // GM 11-15-2004: modified to return array with time for each service, as
+    //                opposed to single transit time for hardcoded "GND" code
+
+    function _transitparseResult($xmlTransitResult) {
+         $transitTime = array();
+
+        // Parse XML message returned by the UPS post server.
+        $doc = new XMLDocument();
+        $xp = new XMLParser();
+        $xp->setDocument($doc);
+        $xp->parse($xmlTransitResult);
+        $doc = $xp->getDocument();
+        // Get version. Must be xpci version 1.0001 or this might not work.
+        // 1.0001 and 1.0002 seem to be very similar, forget about this for the moment
+        /*        $responseVersion = $doc->getValueByPath('TimeInTransitResponse/Response/TransactionReference/XpciVersion');
+        if ($this->transitxpci_version != $responseVersion) {
+            $message = MODULE_SHIPPING_UPSXML_RATES_TEXT_COMM_VERSION_ERROR;
+            return $message;
+        } */
+        // Get response code. 1 = SUCCESS, 0 = FAIL
+        $responseStatusCode = $doc->getValueByPath('TimeInTransitResponse/Response/ResponseStatusCode');
+        if ($responseStatusCode != '1') {
+            $errorMsg = $doc->getValueByPath('TimeInTransitResponse/Response/Error/ErrorCode');
+            $errorMsg .= ": ";
+            $errorMsg .= $doc->getValueByPath('TimeInTransitResponse/Response/Error/ErrorDescription');
+            // send email if enabled in the admin section
+            if ($this->email_errors) {
+                error_log("UPSXML TimeInTransit Error: " . $errorMsg . " experienced by customer with id " . $_SESSION['customer_id'] . " on " . date('Y-m-d H:i:s'), 1, STORE_OWNER_EMAIL_ADDRESS);
+            }
+            // log errors to file ups_error.log when set
+            if ($this->ups_error_file) {
+                error_log(date('Y-m-d H:i:s')."\tTimeInTransit\t" . $errorMsg . "\t" . $_SESSION['customer_id'] ."\n", 3, $this->ups_error_file);    
+            }
+            return $errorMsg;
+        }
+        $root = $doc->getRoot();
+        $rootChildren = $root->getChildren();
+        for ($r = 0; $r < count($rootChildren); $r++) {
+            $elementName = $rootChildren[$r]->getName();
+            if ($elementName == "TransitResponse") {
+                $transitResponse = $root->getElementsByName("TransitResponse");
+                $serviceSummary = $transitResponse['0']->getElementsByName("ServiceSummary");
+                $this->numberServices = count($serviceSummary);
+                for ($s = 0; $s < $this->numberServices ; $s++) {
+                    // index by Desc because that's all we can relate back to the service with
+                    // (though it can probably return the code as well..)
+                    $serviceDesc = $serviceSummary[$s]->getValueByPath("Service/Description");
+                    $transitTime[$serviceDesc]["days"] = $serviceSummary[$s]->getValueByPath("EstimatedArrival/BusinessTransitDays");
+                    $transitTime[$serviceDesc]["date"] = $serviceSummary[$s]->getValueByPath("EstimatedArrival/Date");
+                    $transitTime[$serviceDesc]["guaranteed"] = $serviceSummary[$s]->getValueByPath("Guaranteed/Code");
+                }
+            }
+        }
+        if ($this->logfile) {
+            error_log("------------------------------------------\n", 3, $this->logfile);
+            foreach($transitTime as $desc => $time) {
+                error_log("Business Transit: " . $desc ." = ". $time["date"] . "\n", 3, $this->logfile);
+            }
+        }
+        return $transitTime;
+    }
+
+    //EOF Time In Transit
+ //  ***************************
+  function exclude_choices($type) {
+    // used for exclusion of UPS shipping options, disallowed types are read from db
+    $disallowed_types = explode(",", MODULE_SHIPPING_UPSXML_TYPES);
+    if (strstr($type, "UPS")) {
+        // this will chop off "UPS" from the beginning of the line - typically something like UPS Next Day Air (1 Business Days)
+        $type_minus_ups = explode("UPS", $type );
+        $type_root = trim($type_minus_ups[1]);
+    } // end if (strstr($type, "UPS"):
+    else { // service description does not contain UPS (unlikely)
+        $type_root = trim($type);
+    }
+    for ($za = 0; $za < count ($disallowed_types); $za++ ) {
+        if ($type_root == trim($disallowed_types[$za])) {
+            return true;
+            exit;
+        } // end if ($type_root == $disallowed_types[$za] ...
+    }
+    // if the type is not disallowed:
+    return false;
+  }
+
+  function more_dimensions_to_productsArray($productsArray) {
+	$counter = 0;
+	  foreach ($productsArray as $key => $product) {
+        // in case by accident or by choice length, width or height is not set
+        // we will estimate it by using a set density and the product['weight'] variable
+        // will only be used in the check for whether it fits the largest box
+        // after that it will already be set, if product['weight'] is set at least
+        if ($product['length'] == 0 || $product['width'] == 0 || $product['height'] == 0) {
+            $density = 0.7;
+            if ($this->unit_length == 'CM') {
+                $product['length']=$product['width']=$product['height']= round(10*(pow($product['weight']/$density, 1/3)),1);
+            } else {
+                // non-metric: inches and pounds
+                $product['length']=$product['width']=$product['height']= round(pow($product['weight']*27.67/$density, 1/3),1);
+            }
+        } // end if ($product['length'] == 0 || $product['width'] == 0 etc.
+				// sort dimensions from low to high, used in the function fitsInBox
+				   $dimensions = array($product['length'], $product['width'], $product['height']);
+            sort($dimensions);
+						foreach($dimensions as $key => $value) {
+							if ($key == 0 ) { $productsArray[$counter]['x'] = $value; }
+							if ($key == 1 ) { $productsArray[$counter]['y'] = $value; }
+							if ($key == 2 ) { $productsArray[$counter]['z'] = $value; }
+						}
+        $productsArray[$counter]['volume'] = $product['length'] * $product['width'] * $product['height'];
+				$counter++;
+	  } // end foreach ($productsArray as $key => $product)
+	
+	return($productsArray);
+  }
+
+} // end class upsxml
+// ******************************
+function ready_to_shipCmp( $a, $b) {
+    if ( $a['ready_to_ship'] == $b['ready_to_ship'] )
+    return 0;
+    if ( $a['ready_to_ship'] > $b['ready_to_ship'] )
+    return -1;
+    return 1;
+}
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/canadapost.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/canadapost.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/canadapost.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,326 @@
+<?php
+/*
+  $Id: canadapost.php,v 0.3 2003/05/25 hpdl Exp $
+
+  Before use this class, you should open a Canada  
+  Post Eparcel Account, and change the CPCIP to 
+  your ID. Visit www.canadapost.ca for detail. 
+   
+  XML connection method with Canada Post. 
+
+  This version only works with osCommerce MS1 version.
+   
+  Copyright (c) 2002,2003 Kelvin Zhang (kelvin at syngear.com) 
+  Modified by Kenneth Wang (kenneth at cqww.net), 2003.05.25
+
+  Released under the GNU General Public License 
+*/
+
+  class canadapost {
+    var $code, $title, $descrption, $icon, $enabled, $types;
+
+// class constructor
+    function canadapost() {
+      global $order;
+
+      $this->code = 'canadapost';
+      $this->title = MODULE_SHIPPING_CANADAPOST_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_CANADAPOST_TEXT_DESCRIPTION;
+      $this->icon = DIR_WS_ICONS . 'shipping_canadapost.gif';
+      $this->comments = '';
+      $this->sort_order = MODULE_SHIPPING_CANADAPOST_SORT_ORDER;
+      $this->tax_class = MODULE_SHIPPING_CANADAPOST_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_CANADAPOST_STATUS == 'True') ? true : false);
+      
+      $this->server = MODULE_SHIPPING_CANADAPOST_SERVERIP;
+      $this->port = MODULE_SHIPPING_CANADAPOST_SERVERPOST;
+      $this->language = MODULE_SHIPPING_CANADAPOST_LANGUAGE;
+      $this->CPCID = MODULE_SHIPPING_CANADAPOST_CPCID;
+      $this->turnaround_time = MODULE_SHIPPING_CANADAPOST_TIME;
+      $this->items_qty = 0;
+      $this->items_price = 0;
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_CANADAPOST_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_CANADAPOST_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes, $cart;
+
+      $country_name = tep_get_countries(STORE_COUNTRY, true);
+      $this->_canadapostOrigin(SHIPPING_ORIGIN_ZIP, $country_name['countries_iso_code_2']);
+      $this->_canadapostDest($order->delivery['city'], $order->delivery['state'], $order->delivery['country']['iso_code_2'], $order->delivery['postcode']);
+
+      $products_array = $cart->get_products();
+      for ($i=0; $i<count($products_array); $i++) 
+        $this->_addItem ($products_array[$i][quantity], $products_array[$i][final_price], $products_array[$i][weight], 
+              $this->default_length, $this->default_width, $this->default_height, $products_array[$i][name]);
+     
+      $canadapostQuote = $this->_canadapostGetQuote();
+      if ( (is_array($canadapostQuote)) && (sizeof($canadapostQuote) > 0) ) {
+        $this->quotes = array('id' => $this->code,
+                              'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'kgs)');
+
+        $methods = array();
+        for ($i=0; $i<sizeof($canadapostQuote); $i++) {
+          list($type, $cost) = each($canadapostQuote[$i]);
+
+    if ( $method == '' || $method == $type ) {
+            $methods[] = array('id' => $type,
+                             'title' => $type,
+                             'cost' => (SHIPPING_HANDLING + $cost) * $shipping_num_boxes);
+    }
+        }
+
+        $this->quotes['methods'] = $methods;
+      } else {
+        if ( $canadapostQuote != false ) {
+            $errmsg = $canadapostQuote;
+        } else {
+            $errmsg = 'An unknown error occured with the canadapost shipping calculations.';
+  }
+        $errmsg .= '<br>If you prefer to use canadapost as your shipping method, please contact the store owner.';
+        $this->quotes = array('module' => $this->title,
+                              'error' => $errmsg);
+                             
+      }
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+      if (tep_not_null($this->comments)) $this->quotes['comments'] = $this->comments;
+
+      return $this->quotes;
+    }
+    
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_CANADAPOST_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CanadaPost Shipping', 'MODULE_SHIPPING_CANADAPOST_STATUS', 'True', 'Do you want to offer Canada Post shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter CanadaPost Server IP', 'MODULE_SHIPPING_CANADAPOST_SERVERIP', '206.191.4.228', 'ip address of canada post server', '6', '11', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter CanadaPost Server Port', 'MODULE_SHIPPING_CANADAPOST_SERVERPOST', '30000', 'service port of canadapast server', '6', '12', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter Selected Language(optional)', 'MODULE_SHIPPING_CANADAPOST_LANGUAGE', 'en', 'canada posr support two languages. en: english fr: franch', '6', '13', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter Your CanadaPost Customer ID', 'MODULE_SHIPPING_CANADAPOST_CPCID', 'CPC_DEMO_XML', '(Canada Post Customer ID)Merchant Identification assigned by Canada Post', '6', '14', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter Turn Around Time(optional)', 'MODULE_SHIPPING_CANADAPOST_TIME', '8', 'Turn Around Time (hours)', '6', '15', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_CANADAPOST_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_CANADAPOST_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_CANADAPOST_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+  }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_CANADAPOST_STATUS', 'MODULE_SHIPPING_CANADAPOST_SERVERIP',
+                    'MODULE_SHIPPING_CANADAPOST_SERVERPOST', 'MODULE_SHIPPING_CANADAPOST_LANGUAGE',
+                    'MODULE_SHIPPING_CANADAPOST_CPCID', 'MODULE_SHIPPING_CANADAPOST_TIME',
+                    'MODULE_SHIPPING_CANADAPOST_TAX_CLASS', 'MODULE_SHIPPING_CANADAPOST_ZONE', 
+                    'MODULE_SHIPPING_CANADAPOST_SORT_ORDER');
+    }
+
+
+    function _canadapostOrigin($postal, $country){
+      $this->_canadapostOriginPostalCode = str_replace(' ', '', $postal);
+      $this->_canadapostOriginCountryCode = $country;
+    }
+
+
+    function _canadapostDest($dest_city,$dest_province,$dest_country,$dest_zip){
+      $this->dest_city = $dest_city;
+      $this->dest_province = $dest_province;
+      $this->dest_country = $dest_country;
+      $this->dest_zip = str_replace(' ', '', $dest_zip);
+    }
+
+
+    /*
+      Add items to parcel. If $readytoship=1, this item will be shipped in its oringinal box
+    */
+    function _addItem ($quantity, $rate, $weight, $length, $width, $height, $description, $readytoship=0) {
+      $index = $this->items_qty;
+      $this->item_quantity[$index] = (string)$quantity;
+      $this->item_weight[$index] = ( $weight ? (string)$weight : '0' );
+      $this->item_length[$index] = ( $length ? (string)$length : '0' );
+      $this->item_width[$index] = ( $width ? (string)$width : '0' );
+      $this->item_height[$index] = ( $height ? (string)$height : '0' );
+      $this->item_description[$index] = $description;
+      $this->item_readytoship[$index] = $readytoship;
+      $this->items_qty ++;
+      $this->items_price += $quantity * $rate;
+    }
+
+
+    /* 
+      using HTTP/POST send message to canada post server
+    */
+    function _sendToHost($host,$port,$method,$path,$data,$useragent=0) {
+  // Supply a default method of GET if the one passed was empty
+  if (empty($method))
+      $method = 'GET';
+  $method = strtoupper($method);
+  if ($method == 'GET')
+      $path .= '?' . $data;
+  $buf = "";
+  // try to connect to Canada Post server, for 2 second
+  $fp = @fsockopen($host, $port, &$errno, &$errstr, 2);
+  if ( $fp ) {
+    fputs($fp, "$method $path HTTP/1.1\n");
+    fputs($fp, "Host: $host\n");
+    fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
+    fputs($fp, "Content-length: " . strlen($data) . "\n");
+    if ($useragent)
+    fputs($fp, "User-Agent: u-feel.com / osCommerce\n");
+    fputs($fp, "Connection: close\n\n");
+    if ($method == 'POST')
+    fputs($fp, $data);
+
+    while (!feof($fp))
+    $buf .= fgets($fp,128);
+    fclose($fp);
+  } else {
+    $buf = '<?xml version="1.0" ?><eparcel><error><statusMessage>Cannot reach Canada Post Server. You may refresh this page (Press F5) to try again.</statusMessage></error></eparcel>'; 
+  }
+
+  return $buf;
+    }
+
+
+
+    /*
+      Get Canada Post shipping products that are available for current parcels
+      This function will return an array include all available products. e.g:
+        Array ( 
+          [0] => Array ( 
+            [name] => Priority Courier 
+            [rate] => 25.35 
+            [shippingDate] => 2002-08-26 
+            [deliveryDate] => 2002-08-27 
+            [deliveryDayOfWeek] => 3 
+            [nextDayAM] => true 
+            [packingID] => P_0 
+          ) 
+          [1] => Array ( 
+            [name] => Xpresspost 
+            [rate] => 14.36 
+            [shippingDate] => 2002-08-26 
+            [deliveryDate] => 2002-08-27 
+            [deliveryDayOfWeek] => 3 
+            [nextDayAM] => false 
+            [packingID] => P_0 
+          ) 
+          [2] => Array ( 
+            [name] => Regular 
+            [rate] => 12.36 
+            [shippingDate] => 2002-08-26 
+            [deliveryDate] => 2002-08-28 
+            [deliveryDayOfWeek] => 4 
+            [nextDayAM] => false 
+            [packingID] => P_0 
+          ) 
+        )
+      If the parcels can't be shipped or other error, this function will return 
+      error message. e.g: "The parcel is too large to delivery."
+    */ 
+    function _canadapostGetQuote() {
+  $strXML = "<?xml version=\"1.0\" ?>";
+
+  // set package configuration.
+  $strXML .= "<eparcel>\n";
+  $strXML .= "        <language>" . $this->language . "</language>\n";
+  $strXML .= "        <ratesAndServicesRequest>\n";
+  $strXML .= "                <merchantCPCID>" . $this->CPCID . "</merchantCPCID>\n";
+  $strXML .= "                <fromPostalCode>" . $this->_canadapostOriginPostalCode . "</fromPostalCode>\n";
+  $strXML .= "                <turnAroundTime>" . $this->turnaround_time . "</turnAroundTime>\n";
+  $strXML .= "                <itemsPrice>" . (string)$this->items_price . "</itemsPrice>\n";
+  
+  // add items information.
+  $strXML .= "            <lineItems>\n";
+  for ($i=0; $i < $this->items_qty; $i++) {
+          $this->item_description[$i] = str_replace("&", "and", $this->item_description[$i]);
+    $strXML .= "      <item>\n";
+    $strXML .= "                <quantity>" . $this->item_quantity[$i] . "</quantity>\n";
+    $strXML .= "                <weight>" . $this->item_weight[$i] . "</weight>\n";
+    $strXML .= "                <length>" . $this->item_length[$i] . "</length>\n";
+    $strXML .= "                <width>" . $this->item_width[$i] . "</width>\n";
+    $strXML .= "                <height>" . $this->item_height[$i] . "</height>\n";
+    $strXML .= "                <description>" . $this->item_description[$i] . "</description>\n";
+    if ($this->item_readytoship[$i]) $strXML .= "                <readyToShip/>\n";
+    $strXML .= "      </item>\n";
+  }
+  $strXML .= "           </lineItems>\n";
+  
+  // add destination information.
+  $strXML .= "               <city>" . $this->dest_city . "</city>\n";
+  $strXML .= "               <provOrState>" . $this->dest_province . "</provOrState>\n";
+  $strXML .= "               <country>" . $this->dest_country . "</country>\n";
+  $strXML .= "               <postalCode>" . $this->dest_zip . "</postalCode>\n";
+  $strXML .= "        </ratesAndServicesRequest>\n";
+  $strXML .= "</eparcel>\n";
+  
+  //print $strXML;
+  if ($resultXML = $this->_sendToHost($this->server,$this->port,'POST','',$strXML)) {
+        return $this->_parserResult($resultXML);
+  } else {
+      return false;
+  }
+    } 
+
+
+    /*
+      Parser XML message returned by canada post server.
+    */
+    function _parserResult($resultXML) {
+      $statusMessage = substr($resultXML, strpos($resultXML, "<statusMessage>")+strlen("<statusMessage>"), strpos($resultXML, "</statusMessage>")-strlen("<statusMessage>")-strpos($resultXML, "<statusMessage>"));
+      //print "message = $statusMessage";
+      if ($statusMessage == 'OK') {
+        $strProduct = substr($resultXML, strpos($resultXML, "<product id=")+strlen("<product id=>"), strpos($resultXML, "</product>")-strlen("<product id=>")-strpos($resultXML, "<product id="));
+        $index = 0;
+        $aryProducts = false;
+        while (strpos($resultXML, "</product>")) {
+          $name = substr($resultXML, strpos($resultXML, "<name>")+strlen("<name>"), strpos($resultXML, "</name>")-strlen("<name>")-strpos($resultXML, "<name>"));
+          $rate = substr($resultXML, strpos($resultXML, "<rate>")+strlen("<rate>"), strpos($resultXML, "</rate>")-strlen("<rate>")-strpos($resultXML, "<rate>"));
+          $shippingDate = substr($resultXML, strpos($resultXML, "<shippingDate>")+strlen("<shippingDate>"), strpos($resultXML, "</shippingDate>")-strlen("<shippingDate>")-strpos($resultXML, "<shippingDate>"));
+          $deliveryDate = substr($resultXML, strpos($resultXML, "<deliveryDate>")+strlen("<deliveryDate>"), strpos($resultXML, "</deliveryDate>")-strlen("<deliveryDate>")-strpos($resultXML, "<deliveryDate>"));
+          $deliveryDayOfWeek = substr($resultXML, strpos($resultXML, "<deliveryDayOfWeek>")+strlen("<deliveryDayOfWeek>"), strpos($resultXML, "</deliveryDayOfWeek>")-strlen("<deliveryDayOfWeek>")-strpos($resultXML, "<deliveryDayOfWeek>"));
+          $nextDayAM = substr($resultXML, strpos($resultXML, "<nextDayAM>")+strlen("<nextDayAM>"), strpos($resultXML, "</nextDayAM>")-strlen("<nextDayAM>")-strpos($resultXML, "<nextDayAM>"));
+          $packingID = substr($resultXML, strpos($resultXML, "<packingID>")+strlen("<packingID>"), strpos($resultXML, "</packingID>")-strlen("<packingID>")-strpos($resultXML, "<packingID>"));
+          $aryProducts[$index] = array( $name . ', ' . $deliveryDate => $rate);
+          $index++;
+          $resultXML = substr($resultXML, strpos($resultXML, "</product>") + strlen("</product>"));
+        }
+        return $aryProducts;
+      } else {
+        if (strpos($resultXML, "<error>")) return $statusMessage;
+        else return false;
+      }
+    }
+
+
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/fedex1.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/fedex1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/fedex1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,417 @@
+<?php
+/*
+  Version 2.03 for MS2 and earlier
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002, 2003 Steve Fatula of Fatula Consulting
+  compconsultant at yahoo.com
+
+  Released under the GNU General Public License
+*/
+
+
+  class fedex1 {
+    var $code, $title, $description, $sort_order, $icon, $tax_class, $enabled, $meter, $intl;
+
+// class constructor
+    function fedex1() {
+      $this->code = 'fedex1';
+      $this->title = MODULE_SHIPPING_FEDEX1_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_FEDEX1_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_FEDEX1_SORT_ORDER;
+      $this->icon = DIR_WS_ICONS . 'shipping_fedex.gif';
+      $this->tax_class = MODULE_SHIPPING_FEDEX1_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_FEDEX1_STATUS == 'True') ? true : false);
+      $this->meter = MODULE_SHIPPING_FEDEX1_METER;
+
+
+// You can comment out any methods you do not wish to quote by placing a // at the beginning of that line
+// If you comment out 92 in either domestic or international, be
+// sure and remove the trailing comma on the last non-commented line
+      $this->domestic_types = array(
+             '01' => 'Priority (by 10:30AM, later for rural)',
+             '03' => '2 Day Air',
+             '05' => 'Standard Overnight (by 3PM, later for rural)',
+             '06' => 'First Overnight', 
+             '20' => 'Express Saver (3 Day)',
+             '90' => 'Home Delivery',
+             '92' => 'Ground Service'
+             );
+
+      $this->international_types = array(
+             '01' => 'International Priority (1-3 Days)',
+             '03' => 'International Economy (4-5 Days)',
+             '06' => 'International First',
+             '90' => 'Home Delivery',
+             '92' => 'Ground Service'
+             );
+    }
+
+// class methods
+    function quote($method = '') {
+      global $shipping_weight, $shipping_num_boxes, $cart, $order;
+
+      if (tep_not_null($method)) {
+        $this->_setService($method);
+      }
+
+      if (MODULE_SHIPPING_FEDEX1_ENVELOPE == 'True') {
+        if ( ($shipping_weight <= .5 && MODULE_SHIPPING_FEDEX1_WEIGHT == 'LBS') ||
+             ($shipping_weight <= .2 && MODULE_SHIPPING_FEDEX1_WEIGHT == 'KGS')) {
+          $this->_setPackageType('06');
+        } else {
+          $this->_setPackageType('01');
+        }
+      } else {
+        $this->_setPackageType('01');
+      }
+
+      if ($this->packageType == '01' && $shipping_weight < 1) {
+        $this->_setWeight(1);
+      } else {
+        $this->_setWeight($shipping_weight);
+      }
+
+      $totals = $cart->show_total();
+      $this->_setInsuranceValue($totals / $shipping_num_boxes);
+
+      if (defined("SHIPPING_ORIGIN_COUNTRY")) {
+        $countries_array = tep_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
+        $this->country = $countries_array['countries_iso_code_2'];
+      } else {
+        $this->country = STORE_ORIGIN_COUNTRY;
+      }
+
+      $fedexQuote = $this->_getQuote();
+
+      if (is_array($fedexQuote)) {
+        if (isset($fedexQuote['error'])) {
+          $this->quotes = array('module' => $this->title,
+                                'error' => $fedexQuote['error']);
+        } else {
+          $this->quotes = array('id' => $this->code,
+                                'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . strtolower(MODULE_SHIPPING_FEDEX1_WEIGHT) . ')');
+
+          $methods = array();
+          foreach ($fedexQuote as $type => $cost) {
+            $skip = FALSE;
+            $this->surcharge = 0;
+            if ($this->intl === FALSE) {
+              if (strlen($type) > 2 && MODULE_SHIPPING_FEDEX1_TRANSIT == 'True') {
+                $service_descr = $this->domestic_types[substr($type,0,2)] . ' (' . substr($type,2,1) . ' days)';
+              } else {
+                $service_descr = $this->domestic_types[substr($type,0,2)];
+              }
+              switch (substr($type,0,2)) {
+                case 90:
+                  if ($order->delivery['company'] != '') {
+                    $skip = TRUE;
+                  }
+                  break;
+                case 92:
+                  if ($this->country == "CA") {
+                    if ($order->delivery['company'] == '') {
+                      $this->surcharge = MODULE_SHIPPING_FEDEX1_RESIDENTIAL;
+                    }
+                  } else {
+                    if ($order->delivery['company'] == '') {
+                      $skip = TRUE;
+                    }
+                  }
+                  break;
+                default:
+                  if ($this->country != "CA" && substr($type,0,2) < "90" && $order->delivery['company'] == '') {
+                    $this->surcharge = MODULE_SHIPPING_FEDEX1_RESIDENTIAL;
+                  }
+                  break;
+              }
+            } else {
+              if (strlen($type) > 2 && MODULE_SHIPPING_FEDEX1_TRANSIT == 'True') {
+                $service_descr = $this->international_types[substr($type,0,2)] . ' (' . substr($type,2,1) . ' days)';
+              } else {
+                $service_descr = $this->international_types[substr($type,0,2)];
+              }
+            }
+            if ($method) {
+              if (substr($type,0,2) != $method) $skip = TRUE;
+            }
+            if (!$skip) {
+              $methods[] = array('id' => substr($type,0,2),
+                                 'title' => $service_descr,
+                                 'cost' => (SHIPPING_HANDLING + MODULE_SHIPPING_FEDEX1_SURCHARGE + $this->surcharge + $cost) * $shipping_num_boxes);
+            }
+          }
+
+          $this->quotes['methods'] = $methods;
+
+          if ($this->tax_class > 0) {
+            $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+          }
+        }
+      } else {
+        $this->quotes = array('module' => $this->title,
+                              'error' => 'An error occured with the fedex shipping calculations.<br>Fedex may not deliver to your country, or your postal code may be wrong.');
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FEDEX1_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Fedex Shipping', 'MODULE_SHIPPING_FEDEX1_STATUS', 'True', 'Do you want to offer Fedex shipping?', '6', '10', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Transit Times', 'MODULE_SHIPPING_FEDEX1_TRANSIT', 'True', 'Do you want to show transit times for ground or home delivery rates?', '6', '10', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Fedex Account Number', 'MODULE_SHIPPING_FEDEX1_ACCOUNT', 'NONE', 'Enter the fedex Account Number assigned to you, required', '6', '11', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Your Fedex Meter ID', 'MODULE_SHIPPING_FEDEX1_METER', 'NONE', 'Enter the Fedex MeterID assigned to you, set to NONE to obtain a new meter number', '6', '12', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('cURL Path', 'MODULE_SHIPPING_FEDEX1_CURL', 'NONE', 'Enter the path to the cURL program, normally, leave this set to NONE to execute cURL using PHP', '6', '12', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_SHIPPING_FEDEX1_DEBUG', 'False', 'Turn on Debug', '6', '19', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Weight Units', 'MODULE_SHIPPING_FEDEX1_WEIGHT', 'LBS', 'Weight Units:', '6', '19', 'tep_cfg_select_option(array(\'LBS\', \'KGS\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('First line of street address', 'MODULE_SHIPPING_FEDEX1_ADDRESS_1', 'NONE', 'Enter the first line of your ship from street address, required', '6', '13', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Second line of street address', 'MODULE_SHIPPING_FEDEX1_ADDRESS_2', 'NONE', 'Enter the second line of your ship from street address, leave set to NONE if you do not need to specify a second line', '6', '14', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('City name', 'MODULE_SHIPPING_FEDEX1_CITY', 'NONE', 'Enter the city name for the ship from street address, required', '6', '15', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('State or Province name', 'MODULE_SHIPPING_FEDEX1_STATE', 'NONE', 'Enter the 2 letter state or province name for the ship from street address, required for Canada and US', '6', '16', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Postal code', 'MODULE_SHIPPING_FEDEX1_POSTAL', 'NONE', 'Enter the postal code for the ship from street address, required', '6', '17', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Phone number', 'MODULE_SHIPPING_FEDEX1_PHONE', 'NONE', 'Enter a contact phone number for your company, required', '6', '18', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Which server to use', 'MODULE_SHIPPING_FEDEX1_SERVER', 'production', 'You must have an account with Fedex', '6', '19', 'tep_cfg_select_option(array(\'test\', \'production\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Drop off type', 'MODULE_SHIPPING_FEDEX1_DROPOFF', '1', 'Dropoff type (1 = Regular pickup, 2 = request courier, 3 = drop box, 4 = drop at BSC, 5 = drop at station)?', '6', '20', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Fedex surcharge?', 'MODULE_SHIPPING_FEDEX1_SURCHARGE', '0', 'Surcharge amount to add to shipping charge?', '6', '21', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Residential surcharge?', 'MODULE_SHIPPING_FEDEX1_RESIDENTIAL', '0', 'Residential Surcharge (in addition to other surcharge) for Express packages within US, or ground packages within Canada?', '6', '21', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Insurance?', 'MODULE_SHIPPING_FEDEX1_INSURE', 'NONE', 'Insure packages over what dollar amount?', '6', '22', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Envelope Rates?', 'MODULE_SHIPPING_FEDEX1_ENVELOPE', 'False', 'Do you want to offer Fedex Envelope rates? All items under 1/2 LB (.23KG) will quote using the envelope rate if True.', '6', '10', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Sort rates: ', 'MODULE_SHIPPING_FEDEX1_WEIGHT_SORT', 'High to Low', 'Sort rates top to bottom: ', '6', '19', 'tep_cfg_select_option(array(\'High to Low\', \'Low to High\'), ', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Timeout in Seconds', 'MODULE_SHIPPING_FEDEX1_TIMEOUT', 'NONE', 'Enter the maximum time in seconds you would wait for a rate request from Fedex? Leave NONE for default timeout.', '6', '22', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FEDEX1_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '23', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FEDEX1_SORT_ORDER', '0', 'Sort order of display.', '6', '24', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_FEDEX1_STATUS', 'MODULE_SHIPPING_FEDEX1_ACCOUNT', 'MODULE_SHIPPING_FEDEX1_METER', 'MODULE_SHIPPING_FEDEX1_CURL', 'MODULE_SHIPPING_FEDEX1_DEBUG', 'MODULE_SHIPPING_FEDEX1_WEIGHT', 'MODULE_SHIPPING_FEDEX1_SERVER', 'MODULE_SHIPPING_FEDEX1_ADDRESS_1', 'MODULE_SHIPPING_FEDEX1_ADDRESS_2', 'MODULE_SHIPPING_FEDEX1_CITY', 'MODULE_SHIPPING_FEDEX1_STATE', 'MODULE_SHIPPING_FEDEX1_POSTAL', 'MODULE_SHIPPING_FEDEX1_PHONE', 'MODULE_SHIPPING_FEDEX1_DROPOFF', 'MODULE_SHIPPING_FEDEX1_TRANSIT', 'MODULE_SHIPPING_FEDEX1_SURCHARGE', 'MODULE_SHIPPING_FEDEX1_INSURE', 'MODULE_SHIPPING_FEDEX1_RESIDENTIAL', 'MODULE_SHIPPING_FEDEX1_ENVELOPE', 'MODULE_SHIPPING_FEDEX1_WEIGHT_SORT', 'MODULE_SHIPPING_FEDEX1_TIMEOUT', 'MODULE_SHIPPING_FEDEX1_TAX_CLASS','MODULE_SHIPPING_FEDEX1_SORT_ORDER');
+    }
+
+    function _setService($service) {
+      $this->service = $service;
+    }
+
+    function _setWeight($pounds) {
+      $this->pounds = sprintf("%01.1f", $pounds);
+    }
+
+    function _setPackageType($type) {
+      $this->packageType = $type;
+    }
+
+    function _setInsuranceValue($order_amount) {
+      if ($order_amount > MODULE_SHIPPING_FEDEX1_INSURE) {
+        $this->insurance = sprintf("%01.2f",$order_amount);
+      } else {
+        $this->insurance = 0;
+      }
+    }
+
+    function _AccessFedex($data) {
+
+      if (MODULE_SHIPPING_FEDEX1_SERVER == 'production') {
+        $this->server = 'gateway.fedex.com/GatewayDC';
+      } else {
+        $this->server = 'gatewaybeta.fedex.com/GatewayDC';
+      }
+      if (MODULE_SHIPPING_FEDEX1_CURL == "NONE") {
+        $ch = curl_init();
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        curl_setopt($ch, CURLOPT_URL, 'https://' . $this->server);
+        if (MODULE_SHIPPING_FEDEX1_TIMEOUT != 'NONE') curl_setopt($ch, CURLOPT_TIMEOUT, MODULE_SHIPPING_FEDEX1_TIMEOUT);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Referer: " . STORE_NAME,
+                                                   "Host: " . $this->server,
+                                                   "Accept: image/gif,image/jpeg,image/pjpeg,text/plain,text/html,*/*",
+                                                   "Pragma:",
+                                                   "Content-Type:image/gif"));
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+        $reply = curl_exec($ch);
+        curl_close ($ch);
+      } else {
+        $this->command_line = MODULE_SHIPPING_FEDEX1_CURL . " " . (MODULE_SHIPPING_FEDEX1_TIMEOUT == 'NONE' ? '' : '-m ' . MODULE_SHIPPING_FEDEX1_TIMEOUT) . " -s -e '" . STORE_NAME . "' --url https://" . $this->server . " -H 'Host: " . $this->server . "' -H 'Accept: image/gif,image/jpeg,image/pjpeg,text/plain,text/html,*/*' -H 'Pragma:' -H 'Content-Type:image/gif' -d '" . $data . "' 'https://" . $this->server . "'";
+        exec($this->command_line, $this->reply);
+        $reply = $this->reply[0];
+      }
+        return $reply;
+    }
+
+    function _getMeter() {
+      $data = '0,"211"'; // Transaction Code, required
+      $data .= '10,"' . MODULE_SHIPPING_FEDEX1_ACCOUNT . '"'; // Sender Fedex account number
+      $data .= '4003,"' . STORE_OWNER . '"'; // Subscriber contact name
+      $data .= '4007,"' . STORE_NAME . '"'; // Subscriber company name
+      $data .= '4008,"' . MODULE_SHIPPING_FEDEX1_ADDRESS_1 . '"'; // Subscriber Address line 1
+      if (MODULE_SHIPPING_FEDEX1_ADDRESS_2 != 'NONE') {
+        $data .= '4009,"' . MODULE_SHIPPING_FEDEX1_ADDRESS_2 . '"'; // Subscriber Address Line 2
+      }
+      $data .= '4011,"' . MODULE_SHIPPING_FEDEX1_CITY . '"'; // Subscriber City Name
+      if (MODULE_SHIPPING_FEDEX1_STATE != 'NONE') {
+        $data .= '4012,"' . MODULE_SHIPPING_FEDEX1_STATE . '"'; // Subscriber State code
+      }
+      $data .= '4013,"' . MODULE_SHIPPING_FEDEX1_POSTAL . '"'; // Subscriber Postal Code
+      $data .= '4014,"' . $this->country . '"'; // Subscriber Country Code
+      $data .= '4015,"' . MODULE_SHIPPING_FEDEX1_PHONE . '"'; // Subscriber phone number
+      $data .= '99,""'; // End of Record, required
+      if (MODULE_SHIPPING_FEDEX1_DEBUG == 'True') echo "Data sent to Fedex for Meter: " . $data . "<br>";
+      $fedexData = $this->_AccessFedex($data);
+      if (MODULE_SHIPPING_FEDEX1_DEBUG == 'True') echo "Data returned from Fedex for Meter: " . $fedexData . "<br>";
+      $meterStart = strpos($fedexData,'"498,"');
+
+      if ($meterStart === FALSE) {
+        if (strlen($fedexData) == 0) {
+          $this->error_message = 'No response to CURL from Fedex server, check CURL availability, or maybe timeout was set too low, or maybe the Fedex site is down';
+        } else {
+          $fedexData = $this->_ParseFedex($fedexData);
+          $this->error_message = 'No meter number was obtained, check configuration. Error ' . $fedexData['2'] . ' : ' . $fedexData['3'];
+        }
+        return false;
+      }
+    
+      $meterStart += 6;
+      $meterEnd = strpos($fedexData, '"', $meterStart);
+      $this->meter = substr($fedexData, $meterStart, $meterEnd - $meterStart);
+      $meter_sql = "UPDATE configuration SET configuration_value=\"" . $this->meter . "\" where configuration_key=\"MODULE_SHIPPING_FEDEX1_METER\"";
+      tep_db_query($meter_sql);
+
+      return true;
+    }
+
+    function _ParseFedex($data) {
+      $current = 0;
+      $length = strlen($data);
+      $resultArray = array();
+      while ($current < $length) {
+        $endpos = strpos($data, ',', $current);
+        if ($endpos === FALSE) { break; }
+        $index = substr($data, $current, $endpos - $current);
+        $current = $endpos + 2;
+        $endpos = strpos($data, '"', $current);
+        $resultArray[$index] = substr($data, $current, $endpos - $current);
+        $current = $endpos + 1;
+      }
+    return $resultArray;
+    }
+     
+    function _getQuote() {
+      global $order, $customer_id, $sendto;
+
+      if (MODULE_SHIPPING_FEDEX1_ACCOUNT == "NONE" || strlen(MODULE_SHIPPING_FEDEX1_ACCOUNT) == 0) {
+        return array('error' => 'You forgot to set up your Fedex account number, this can be set up in Admin -> Modules -> Shipping');
+      }
+      if (MODULE_SHIPPING_FEDEX1_ADDRESS_1 == "NONE" || strlen(MODULE_SHIPPING_FEDEX1_ADDRESS_1) == 0) {
+        return array('error' => 'You forgot to set up your ship from street address line 1, this can be set up in Admin -> Modules -> Shipping');
+      }
+      if (MODULE_SHIPPING_FEDEX1_CITY == "NONE" || strlen(MODULE_SHIPPING_FEDEX1_CITY) == 0) {
+        return array('error' => 'You forgot to set up your ship from City, this can be set up in Admin -> Modules -> Shipping');
+      }
+      if (MODULE_SHIPPING_FEDEX1_POSTAL == "NONE" || strlen(MODULE_SHIPPING_FEDEX1_POSTAL) == 0) {
+        return array('error' => 'You forgot to set up your ship from postal code, this can be set up in Admin -> Modules -> Shipping');
+      }
+      if (MODULE_SHIPPING_FEDEX1_PHONE == "NONE" || strlen(MODULE_SHIPPING_FEDEX1_PHONE) == 0) {
+        return array('error' => 'You forgot to set up your ship from phone number, this can be set up in Admin -> Modules -> Shipping');
+      }
+      if (MODULE_SHIPPING_FEDEX1_METER == "NONE") { 
+        if ($this->_getMeter() === false) return array('error' => $this->error_message);
+      }
+
+      $data = '0,"25"'; // TransactionCode
+      $data .= '10,"' . MODULE_SHIPPING_FEDEX1_ACCOUNT . '"'; // Sender fedex account number
+      $data .= '498,"' . $this->meter . '"'; // Meter number
+      $data .= '8,"' . MODULE_SHIPPING_FEDEX1_STATE . '"'; // Sender state code
+      $orig_zip = str_replace(array(' ', '-'), '', MODULE_SHIPPING_FEDEX1_POSTAL);
+      $data .= '9,"' . $orig_zip . '"'; // Origin postal code
+      $data .= '117,"' . $this->country . '"'; // Origin country
+      if ($order->delivery['country']['iso_code_2'] == "US" || $order->delivery['country']['iso_code_2'] == "CA" || $order->delivery['country']['iso_code_2'] == "PR") {
+        $dest_zip = str_replace(array(' ', '-'), '', $order->delivery['postcode']);
+        $data .= '17,"' . $dest_zip . '"'; // Recipient zip code
+        $data .= '16,"' . tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], '') . '"'; // Recipient state
+      }
+      $data .= '50,"' . $order->delivery['country']['iso_code_2'] . '"'; // Recipient country
+      $data .= '75,"' . MODULE_SHIPPING_FEDEX1_WEIGHT . '"'; // Weight units
+      if (MODULE_SHIPPING_FEDEX1_WEIGHT == "KGS") {
+        $data .= '1116,"C"'; // Dimension units
+      } else {
+        $data .= '1116,"I"'; // Dimension units
+      }
+      $data .= '1401,"' . $this->pounds . '"'; // Total weight
+      $data .= '1529,"1"'; // Quote discounted rates
+      if ($this->insurance > 0) {
+        $data .= '1415,"' . $this->insurance . '"'; // Insurance value
+        $data .= '68,"USD"'; // Insurance value currency
+      }
+      if ($order->delivery['company'] == '' && MODULE_SHIPPING_FEDEX1_RESIDENTIAL == 0) {
+        $data .= '440,"Y"'; // Residential address
+      }else {
+        $data .= '440,"N"'; // Business address, use if adding a residential surcharge
+      }
+      $data .= '1273,"' . $this->packageType . '"'; // Package type
+      $data .= '1333,"' . MODULE_SHIPPING_FEDEX1_DROPOFF . '"'; // Drop of drop off or pickup
+      $data .= '99,""'; // End of record
+      if (MODULE_SHIPPING_FEDEX1_DEBUG == 'True') echo "Data sent to Fedex for Rating: " . $data . "<br>";
+      $fedexData = $this->_AccessFedex($data);
+      if (MODULE_SHIPPING_FEDEX1_DEBUG == 'True') echo "Data returned from Fedex for Rating: " . $fedexData . "<br>";
+      if (strlen($fedexData) == 0) {
+        $this->error_message = 'No data returned from Fedex, perhaps the Fedex site is down';
+        return array('error' => $this->error_message);
+      }
+      $fedexData = $this->_ParseFedex($fedexData);
+      $i = 1;
+      if ($this->country == $order->delivery['country']['iso_code_2']) {
+        $this->intl = FALSE;
+      } else {
+        $this->intl = TRUE;
+      }
+      $rates = NULL;
+      while (isset($fedexData['1274-' . $i])) {
+        if ($this->intl) {
+          if (isset($this->international_types[$fedexData['1274-' . $i]])) {
+            if (isset($fedexData['3058-' . $i])) {
+              $rates[$fedexData['1274-' . $i] . $fedexData['3058-' . $i]] = $fedexData['1419-' . $i];
+            } else {
+              $rates[$fedexData['1274-' . $i]] = $fedexData['1419-' . $i];
+            }
+          }
+        } else {
+          if (isset($this->domestic_types[$fedexData['1274-' . $i]])) {
+            if (isset($fedexData['3058-' . $i])) {
+              $rates[$fedexData['1274-' . $i] . $fedexData['3058-' . $i]] = $fedexData['1419-' . $i];
+            } else {
+              $rates[$fedexData['1274-' . $i]] = $fedexData['1419-' . $i];
+            }
+          }
+        }
+        $i++;
+      }
+
+      if (is_array($rates)) {
+        if (MODULE_SHIPPING_FEDEX1_WEIGHT_SORT == 'Low to High') {
+          asort($rates);
+        } else {
+          arsort($rates);
+        }
+      } else {
+        $this->error_message = 'No Rates Returned, ' . $fedexData['2'] . ' : ' . $fedexData['3']; 
+        return array('error' => $this->error_message);
+      }
+
+      return ((sizeof($rates) > 0) ? $rates : false);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/flat.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/flat.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/flat.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,90 @@
+<?php
+/*
+  $Id: flat.php,v 1.1.1.1 2004/03/04 23:41:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class flat {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function flat() {
+      global $order;
+
+      $this->code = 'flat';
+      $this->title = MODULE_SHIPPING_FLAT_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_FLAT_SORT_ORDER;
+      $this->icon = '';
+      $this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order;
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
+                                                     'cost' => MODULE_SHIPPING_FLAT_COST)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FLAT_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Flat Shipping', 'MODULE_SHIPPING_FLAT_STATUS', 'True', 'Do you want to offer flat rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Flat Shipping Cost', 'MODULE_SHIPPING_FLAT_COST', '5.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Flat Tax Class', 'MODULE_SHIPPING_FLAT_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Flat Shipping Zone', 'MODULE_SHIPPING_FLAT_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Flat Sort Order', 'MODULE_SHIPPING_FLAT_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_FLAT_STATUS', 'MODULE_SHIPPING_FLAT_COST', 'MODULE_SHIPPING_FLAT_TAX_CLASS', 'MODULE_SHIPPING_FLAT_ZONE', 'MODULE_SHIPPING_FLAT_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/freeshipper.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/freeshipper.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/freeshipper.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,103 @@
+<?php
+/*
+  WebMakers.com Added: Free Payments and Shipping
+  Written by Linda McGrath osCOMMERCE at WebMakers.com
+  http://www.thewebmakerscorner.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class freeshipper {
+    var $code, $title, $description, $icon, $enabled;
+
+// BOF: WebMakers.com Added: Free Payments and Shipping
+// class constructor
+    function freeshipper() {
+      global $order, $cart;
+      $this->code = 'freeshipper';
+      $this->title = MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_FREESHIPPER_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_FREESHIPPER_SORT_ORDER;
+      $this->icon = DIR_WS_ICONS . 'shipping_free_shipper.jpg';
+      $this->tax_class = MODULE_SHIPPING_FREESHIPPER_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_FREESHIPPER_STATUS == 'True') ? true : false);
+
+// Only show if weight is 0
+//      if ( (!strstr($PHP_SELF,'modules.php')) || $cart->show_weight()==0) {
+        $this->enabled = MODULE_SHIPPING_FREESHIPPER_STATUS;
+        if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FREESHIPPER_ZONE > 0) ) {
+          $check_flag = false;
+          $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FREESHIPPER_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+          while ($check = tep_db_fetch_array($check_query)) {
+            if ($check['zone_id'] < 1) {
+              $check_flag = true;
+              break;
+            } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+              $check_flag = true;
+              break;
+            }
+          }
+
+          if ($check_flag == false) {
+            $this->enabled = false;
+          }
+        }
+//      }
+// EOF: WebMakers.com Added: Free Payments and Shipping
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order;
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => '<FONT COLOR=FF0000><B>' . MODULE_SHIPPING_FREESHIPPER_TEXT_WAY . '</B></FONT>',
+                                                     'cost' => SHIPPING_HANDLING + MODULE_SHIPPING_FREESHIPPER_COST)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FREESHIPPER_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enable Free Shipping', 'MODULE_SHIPPING_FREESHIPPER_STATUS', '1', 'Do you want to offer Free shipping?', '6', '5', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Free Shipping Cost', 'MODULE_SHIPPING_FREESHIPPER_COST', '0.00', 'What is the Shipping cost? The Handling fee will also be added.', '6', '6', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('FREESHIPPER Tax Class', 'MODULE_SHIPPING_FREESHIPPER_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('FREESHIPPER Shipping Zone', 'MODULE_SHIPPING_FREESHIPPER_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('FREESHIPPER Sort Order', 'MODULE_SHIPPING_FREESHIPPER_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+    }
+
+    function remove() {
+      $keys = '';
+      $keys_array = $this->keys();
+      for ($i=0; $i<sizeof($keys_array); $i++) {
+        $keys .= "'" . $keys_array[$i] . "',";
+      }
+      $keys = substr($keys, 0, -1);
+
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_FREESHIPPER_STATUS', 'MODULE_SHIPPING_FREESHIPPER_COST', 'MODULE_SHIPPING_FREESHIPPER_TAX_CLASS', 'MODULE_SHIPPING_FREESHIPPER_ZONE', 'MODULE_SHIPPING_FREESHIPPER_SORT_ORDER');
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/shipping/item.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/item.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/item.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,91 @@
+<?php
+/*
+  $Id: item.php,v 1.1.1.1 2004/03/04 23:41:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class item {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function item() {
+      global $order;
+
+      $this->code = 'item';
+      $this->title = MODULE_SHIPPING_ITEM_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_ITEM_SORT_ORDER;
+      $this->icon = '';
+      $this->tax_class = MODULE_SHIPPING_ITEM_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEM_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order, $total_count;
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,
+                                                     'cost' => (MODULE_SHIPPING_ITEM_COST * $total_count) + MODULE_SHIPPING_ITEM_HANDLING)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEM_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Item Shipping', 'MODULE_SHIPPING_ITEM_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Item Shipping Shipping Cost', 'MODULE_SHIPPING_ITEM_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Item Shipping Handling Fee', 'MODULE_SHIPPING_ITEM_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Item Shipping Tax Class', 'MODULE_SHIPPING_ITEM_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Item Shipping Shipping Zone', 'MODULE_SHIPPING_ITEM_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Item Shipping Sort Order', 'MODULE_SHIPPING_ITEM_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_ITEM_STATUS', 'MODULE_SHIPPING_ITEM_COST', 'MODULE_SHIPPING_ITEM_HANDLING', 'MODULE_SHIPPING_ITEM_TAX_CLASS', 'MODULE_SHIPPING_ITEM_ZONE', 'MODULE_SHIPPING_ITEM_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/percent.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/percent.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/percent.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,101 @@
+<?php
+/*
+  $Id: percent.php,v 1.1.1.1 2004/03/04 23:41:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001,2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+class percent {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function percent() {
+      global $order;
+
+      $this->code = 'percent';
+      $this->title = MODULE_SHIPPING_PERCENT_TEXT_TITLE_ADMIN;
+      $this->description = MODULE_SHIPPING_PERCENT_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_PERCENT_SORT_ORDER;
+      $this->icon = '';
+      $this->tax_class = MODULE_SHIPPING_PERCENT_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_PERCENT_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_PERCENT_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_PERCENT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order, $cart;
+    
+    if (MODULE_SHIPPING_PERCENT_STATUS == 'True') {
+        $order_total = $cart->show_total();
+      }
+    if ($order_total >= MODULE_SHIPPING_PERCENT_LESS_THEN) {
+      $shipping_percent = $order_total * MODULE_SHIPPING_PERCENT_RATE;
+    }
+    else {
+    $shipping_percent = MODULE_SHIPPING_PERCENT_FLAT_USE;
+    }
+    
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_PERCENT_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => MODULE_SHIPPING_PERCENT_TEXT_WAY,
+                                                     'cost' => $shipping_percent)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_PERCENT_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Percent Shipping', 'MODULE_SHIPPING_PERCENT_STATUS', 'True', 'Do you want to offer percent rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Percentage Rate', 'MODULE_SHIPPING_PERCENT_RATE', '.18', 'The Percentage Rate all .01 to .99 for all orders using this shipping method.', '6', '0', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Percentage A Flat Rate for orders under', 'MODULE_SHIPPING_PERCENT_LESS_THEN', '34.75', 'A Flat Rate for all orders that are under the amount shown.', '6', '0', now())");
+    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Percentage A Flat Rate of', 'MODULE_SHIPPING_PERCENT_FLAT_USE', '6.50', 'A Flat Rate used for all orders.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Percentage Tax Class', 'MODULE_SHIPPING_PERCENT_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Percentage Shipping Zone', 'MODULE_SHIPPING_PERCENT_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Percentage Sort Order', 'MODULE_SHIPPING_PERCENT_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_PERCENT_STATUS', 'MODULE_SHIPPING_PERCENT_RATE', 'MODULE_SHIPPING_PERCENT_LESS_THEN', 'MODULE_SHIPPING_PERCENT_FLAT_USE', 'MODULE_SHIPPING_PERCENT_TAX_CLASS', 'MODULE_SHIPPING_PERCENT_ZONE', 'MODULE_SHIPPING_PERCENT_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/reg.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/reg.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/reg.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,226 @@
+<?php
+/*
+
+  $Id: zones.php,v 1.20 2003/06/15 19:48:09 thomasamoulton Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  USAGE
+  By default, the module comes with support for 1 zone.  This can be
+  easily changed by editing the line below in the zones constructor 
+  that defines $this->num_zones.
+
+  Next, you will want to activate the module by going to the Admin screen,
+  clicking on Modules, then clicking on Shipping.  A list of all shipping
+  modules should appear.  Click on the green dot next to the one labeled 
+  zones.php.  A list of settings will appear to the right.  Click on the
+  Edit button. 
+
+  PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER 
+  SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a 
+  backup of your shipping settings somewhere at all times.
+
+  If you want an additional handling charge applied to orders that use this
+  method, set the Handling Fee field.
+
+  Next, you will need to define which countries are in each zone.  Determining
+  this might take some time and effort.  You should group a set of countries
+  that has similar shipping charges for the same weight.  For instance, when
+  shipping from the US, the countries of Japan, Australia, New Zealand, and 
+  Singapore have similar shipping rates.  As an example, one of my customers
+  is using this set of zones:
+    1: USA
+    2: Canada
+    3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland,
+       Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain,
+       Sweden, Switzerland, Finland, Portugal, Israel, Greece
+    4: Japan, Australia, New Zealand, Singapore
+    5: Taiwan, China, Hong Kong
+
+  When you enter these country lists, enter them into the Zone X Countries
+  fields, where "X" is the number of the zone.  They should be entered as
+  two character ISO country codes in all capital letters.  They should be
+  separated by commas with no spaces or other punctuation. For example:
+    1: US
+    2: CA
+    3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR
+    4: JP,AU,NZ,SG
+    5: TW,CN,HK
+
+  Now you need to set up the shipping rate tables for each zone.  Again,
+  some time and effort will go into setting the appropriate rates.  You
+  will define a set of weight ranges and the shipping price for each
+  range.  For instance, you might want an order than weighs more than 0
+  and less than or equal to 3 to cost 5.50 to ship to a certain zone.  
+  This would be defined by this:  3:5.5
+
+  You should combine a bunch of these rates together in a comma delimited
+  list and enter them into the "Zone X Shipping Table" fields where "X" 
+  is the zone number.  For example, this might be used for Zone 1:
+    1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
+    12:19.1,13:20.55,14:22,15:23.45
+
+  The above example includes weights over 0 and up to 15.  Note that
+  units are not specified in this explanation since they should be
+  specific to your locale.
+
+  CAVEATS
+  At this time, it does not deal with weights that are above the highest amount
+  defined.  This will probably be the next area to be improved with the
+  module.  For now, you could have one last very high range with a very
+  high shipping rate to discourage orders of that magnitude.  For 
+  instance:  999:1000
+
+  If you want to be able to ship to any country in the world, you will 
+  need to enter every country code into the Country fields. For most
+  shops, you will not want to enter every country.  This is often 
+  because of too much fraud from certain places. If a country is not
+  listed, then the module will add a $0.00 shipping charge and will
+  indicate that shipping is not available to that destination.  
+  PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!
+
+  It appears that the osC shipping system automatically rounds the 
+  shipping weight up to the nearest whole unit.  This makes it more
+  difficult to design precise shipping tables.  If you want to, you 
+  can hack the shipping.php file to get rid of the rounding.
+
+  Lastly, there is a limit of 255 characters on each of the Zone
+  Shipping Tables and Zone Countries. 
+
+*/
+
+  class reg {
+    var $code, $title, $description, $enabled, $num_zones;
+
+// class constructor
+    function reg() {
+      $this->code = 'reg';
+      $this->title = MODULE_SHIPPING_REG_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_REG_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_REG_SORT_ORDER;
+      $this->icon = '';
+      $this->tax_class = MODULE_SHIPPING_REG_TAX_CLASS;
+
+     $this->enabled = ((MODULE_SHIPPING_REG_STATUS == 'True') ? true : false);
+
+      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
+      $this->num_zones = 1;
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order, $shipping_weight, $shipping_num_boxes;
+
+      $dest_country = $order->delivery['country']['iso_code_2'];
+      $dest_zone = 0;
+      $error = false;
+
+      for ($i=1; $i<=$this->num_zones; $i++) {
+        $countries_table = constant('MODULE_SHIPPING_REG_COUNTRIES_' . $i);
+        $country_zones = split("[,]", $countries_table);
+
+          if (in_array($dest_country, $country_zones)) {
+          $dest_zone = $i;
+          break;
+
+
+        }
+      }
+
+      if ($dest_zone == 0) {
+        $error = true;
+      } else {
+        $shipping = -1;
+        $zones_cost = constant('MODULE_SHIPPING_REG_COST_' . $dest_zone);
+
+        $zones_table = split("[:,]" , $zones_cost);
+        $size = sizeof($zones_table);
+        for ($i=0; $i<$size; $i+=2) {
+      if ($shipping_weight <= $zones_table[$i]) {
+            $shipping = $zones_table[$i+1];
+            $shipping_method = 'Light, lower value deliveries';
+
+
+            break;
+          }
+        }
+
+        if ($shipping == -1)  {
+         $shipping_cost = 0;
+         $shipping_method = MODULE_SHIPPING_REG_UNDEFINED_RATE;
+$error = true;
+}
+
+if ($order->info['total'] > 28) {
+ $error = true;
+
+      } else {
+
+         $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_REG_HANDLING_' . $dest_zone);
+  
+      }
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_REG_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => $shipping_method,
+                                                     'cost' => $shipping_cost)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_REG_INVALID_ZONE;
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_REG_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_REG_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_REG_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_REG_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+      for ($i = 1; $i <= $this->num_zones; $i++) {
+        $default_countries = '';
+        if ($i == 1) {
+          $default_countries = 'US,CA';
+        }
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_REG_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_REG_COST_" . $i ."', '.25:1.66,.75:3.25,1:4.2,2:7.70
+', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_REG_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
+      }
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      $keys = array('MODULE_SHIPPING_REG_STATUS', 'MODULE_SHIPPING_REG_TAX_CLASS', 'MODULE_SHIPPING_REG_SORT_ORDER');
+
+      for ($i=1; $i<=$this->num_zones; $i++) {
+        $keys[] = 'MODULE_SHIPPING_REG_COUNTRIES_' . $i;
+        $keys[] = 'MODULE_SHIPPING_REG_COST_' . $i;
+        $keys[] = 'MODULE_SHIPPING_REG_HANDLING_' . $i;
+      }
+
+      return $keys;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/spec.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/spec.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/spec.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,240 @@
+<?php
+/*
+
+  $Id: zones.php,v 1.20 2003/06/15 19:48:09 thomasamoulton Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  USAGE
+  By default, the module comes with support for 1 zone.  This can be
+  easily changed by editing the line below in the zones constructor 
+  that defines $this->num_zones.
+
+  Next, you will want to activate the module by going to the Admin screen,
+  clicking on Modules, then clicking on Shipping.  A list of all shipping
+  modules should appear.  Click on the green dot next to the one labeled 
+  zones.php.  A list of settings will appear to the right.  Click on the
+  Edit button. 
+
+  PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER 
+  SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a 
+  backup of your shipping settings somewhere at all times.
+
+  If you want an additional handling charge applied to orders that use this
+  method, set the Handling Fee field.
+
+  Next, you will need to define which countries are in each zone.  Determining
+  this might take some time and effort.  You should group a set of countries
+  that has similar shipping charges for the same weight.  For instance, when
+  shipping from the US, the countries of Japan, Australia, New Zealand, and 
+  Singapore have similar shipping rates.  As an example, one of my customers
+  is using this set of zones:
+    1: USA
+    2: Canada
+    3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland,
+       Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain,
+       Sweden, Switzerland, Finland, Portugal, Israel, Greece
+    4: Japan, Australia, New Zealand, Singapore
+    5: Taiwan, China, Hong Kong
+
+  When you enter these country lists, enter them into the Zone X Countries
+  fields, where "X" is the number of the zone.  They should be entered as
+  two character ISO country codes in all capital letters.  They should be
+  separated by commas with no spaces or other punctuation. For example:
+    1: US
+    2: CA
+    3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR
+    4: JP,AU,NZ,SG
+    5: TW,CN,HK
+
+  Now you need to set up the shipping rate tables for each zone.  Again,
+  some time and effort will go into setting the appropriate rates.  You
+  will define a set of weight ranges and the shipping price for each
+  range.  For instance, you might want an order than weighs more than 0
+  and less than or equal to 3 to cost 5.50 to ship to a certain zone.  
+  This would be defined by this:  3:5.5
+
+  You should combine a bunch of these rates together in a comma delimited
+  list and enter them into the "Zone X Shipping Table" fields where "X" 
+  is the zone number.  For example, this might be used for Zone 1:
+    1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
+    12:19.1,13:20.55,14:22,15:23.45
+
+  The above example includes weights over 0 and up to 15.  Note that
+  units are not specified in this explanation since they should be
+  specific to your locale.
+
+  CAVEATS
+  At this time, it does not deal with weights that are above the highest amount
+  defined.  This will probably be the next area to be improved with the
+  module.  For now, you could have one last very high range with a very
+  high shipping rate to discourage orders of that magnitude.  For 
+  instance:  999:1000
+
+  If you want to be able to ship to any country in the world, you will 
+  need to enter every country code into the Country fields. For most
+  shops, you will not want to enter every country.  This is often 
+  because of too much fraud from certain places. If a country is not
+  listed, then the module will add a $0.00 shipping charge and will
+  indicate that shipping is not available to that destination.  
+  PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!
+
+  It appears that the osC shipping system automatically rounds the 
+  shipping weight up to the nearest whole unit.  This makes it more
+  difficult to design precise shipping tables.  If you want to, you 
+  can hack the shipping.php file to get rid of the rounding.
+
+  Lastly, there is a limit of 255 characters on each of the Zone
+  Shipping Tables and Zone Countries. 
+
+*/
+
+  class spec {
+    var $code, $title, $description, $enabled, $num_zones;
+
+// class constructor
+    function spec() {
+      $this->code = 'spec';
+      $this->title = MODULE_SHIPPING_SPEC_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_SPEC_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_SPEC_SORT_ORDER;
+      $this->icon = '';
+      $this->tax_class = MODULE_SHIPPING_SPEC_TAX_CLASS;
+
+     $this->enabled = ((MODULE_SHIPPING_SPEC_STATUS == 'True') ? true : false);
+
+      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
+      $this->num_zones = 1;
+    }
+
+
+// class methods
+    function quote($method = '') {
+      global $order, $shipping_weight, $shipping_num_boxes;
+
+      $dest_country = $order->delivery['country']['iso_code_2'];
+      $dest_zone = 0;
+      $error = false;
+
+      for ($i=1; $i<=$this->num_zones; $i++) {
+        $countries_table = constant('MODULE_SHIPPING_SPEC_COUNTRIES_' . $i);
+        $country_zones = split("[,]", $countries_table);
+
+          if (in_array($dest_country, $country_zones)) {
+          $dest_zone = $i;
+          break;
+
+
+        }
+      }
+
+// ADDITINAL INSURANCE CHARGES - EDIT WHEN THEY PUT THEM UP!!
+
+$ic = 0;
+ if ($order->info['total'] > 500) $ic = .5;
+ if ($order->info['total'] > 1000) $ic = 1.4;
+
+// END OF ADDITIONAL INSURANCE CHARGES 
+
+      if ($dest_zone == 0) {
+        $error = true;
+      } else {
+        $shipping = -1;
+        $zones_cost = constant('MODULE_SHIPPING_SPEC_COST_' . $dest_zone);
+
+        $zones_table = split("[:,]" , $zones_cost);
+        $size = sizeof($zones_table);
+        for ($i=0; $i<$size; $i+=2) {
+      if ($shipping_weight <= $zones_table[$i]) {
+            $shipping = $zones_table[$i+1];
+            $shipping_method = 'Urgent or higher value';
+
+
+            break;
+          }
+        }
+
+
+
+
+
+        if ($shipping == -1)  {
+         $shipping_cost = 0;
+         $shipping_method = MODULE_SHIPPING_SPEC_UNDEFINED_RATE;
+$error = true;
+}
+
+if ($order->info['total'] > 2400) {
+ $error = true;
+
+
+      } else {
+
+         $shipping_cost = ($shipping * $shipping_num_boxes) + $ic + constant('MODULE_SHIPPING_SPEC_HANDLING_' . $dest_zone);
+  
+      }
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_SPEC_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => $shipping_method,
+                                                     'cost' => $shipping_cost)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_SPEC_INVALID_ZONE;
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_SPEC_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_SPEC_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_SPEC_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_SPEC_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+      for ($i = 1; $i <= $this->num_zones; $i++) {
+        $default_countries = '';
+        if ($i == 1) {
+          $default_countries = 'US,CA';
+        }
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_SPEC_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_SPEC_COST_" . $i ."', '0.5:4.1,1:5.25,2:6.6,10:18.5
+', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_SPEC_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
+      }
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      $keys = array('MODULE_SHIPPING_SPEC_STATUS', 'MODULE_SHIPPING_SPEC_TAX_CLASS', 'MODULE_SHIPPING_SPEC_SORT_ORDER');
+
+      for ($i=1; $i<=$this->num_zones; $i++) {
+        $keys[] = 'MODULE_SHIPPING_SPEC_COUNTRIES_' . $i;
+        $keys[] = 'MODULE_SHIPPING_SPEC_COST_' . $i;
+        $keys[] = 'MODULE_SHIPPING_SPEC_HANDLING_' . $i;
+      }
+
+      return $keys;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/spu.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/spu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/spu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+<?php
+/*
+    $Id: spu.php,v 1.4 2002/11/10 14:29:56 mattice Exp $
+  CONTRIB is Store Pickup Shipping Module (http://www.oscommerce.com/community/contributions,164)
+  Based upon flat.php / spu.php by M. Halvorsen (http://www.arachnia-web.com)
+
+  Made to work with latest check-out procedure by Matthijs (Mattice)
+     >> e-mail:    mattice at xs4all.nl 
+     >> site:      http://www.matthijs.org
+ 
+  TO TRANSLATE IN GERMAN !!
+  
+osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+   CHANGES:
+   - formatted to work with latest checkout procedure
+   - removed icon references
+   - updated the db queries
+
+  
+*/
+
+  class spu {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function spu() {
+    global $order;
+  
+      $this->code = 'spu';
+      $this->title = MODULE_SHIPPING_SPU_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_SPU_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_SPU_SORT_ORDER;
+      $this->icon = '';
+      $this->enabled = ((MODULE_SHIPPING_SPU_STATUS == 'True') ? true : false);
+    
+    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_SPU_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_SPU_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+    }
+    
+    if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+  
+    function quote($method = '') {
+    global $order;
+    
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_SPU_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => MODULE_SHIPPING_SPU_TEXT_WAY,
+                                                     'cost' =>  MODULE_SHIPPING_SPU_COST)));
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_SPU_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Store Pick Up', 'MODULE_SHIPPING_SPU_STATUS', 'True', 'Do you want to offer Store Pickup?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Store Pickup Cost', 'MODULE_SHIPPING_SPU_COST', '0.00', 'What is the pickup cost? (The Handling fee will NOT be added.)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_SPU_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_SPU_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+    }
+
+
+    function remove() {
+      $keys = '';
+      $keys_array = $this->keys();
+      for ($i=0; $i<sizeof($keys_array); $i++) {
+        $keys .= "'" . $keys_array[$i] . "',";
+      }
+      $keys = substr($keys, 0, -1);
+
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_SPU_STATUS', 'MODULE_SHIPPING_SPU_COST', 'MODULE_SHIPPING_SPU_SORT_ORDER', 'MODULE_SHIPPING_SPU_ZONE');
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/shipping/stand.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/stand.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/stand.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,243 @@
+<?php
+/*
+
+  $Id: zones.php,v 1.20 2003/06/15 19:48:09 thomasamoulton Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  USAGE
+  By default, the module comes with support for 1 zone.  This can be
+  easily changed by editing the line below in the zones constructor
+  that defines $this->num_zones.
+
+  Next, you will want to activate the module by going to the Admin screen,
+  clicking on Modules, then clicking on Shipping.  A list of all shipping
+  modules should appear.  Click on the green dot next to the one labeled
+  zones.php.  A list of settings will appear to the right.  Click on the
+  Edit button.
+
+  PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER
+  SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a
+  backup of your shipping settings somewhere at all times.
+
+  If you want an additional handling charge applied to orders that use this
+  method, set the Handling Fee field.
+
+  Next, you will need to define which countries are in each zone.  Determining
+  this might take some time and effort.  You should group a set of countries
+  that has similar shipping charges for the same weight.  For instance, when
+  shipping from the US, the countries of Japan, Australia, New Zealand, and
+  Singapore have similar shipping rates.  As an example, one of my customers
+  is using this set of zones:
+    1: USA
+    2: Canada
+    3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland,
+       Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain,
+       Sweden, Switzerland, Finland, Portugal, Israel, Greece
+    4: Japan, Australia, New Zealand, Singapore
+    5: Taiwan, China, Hong Kong
+
+  When you enter these country lists, enter them into the Zone X Countries
+  fields, where "X" is the number of the zone.  They should be entered as
+  two character ISO country codes in all capital letters.  They should be
+  separated by commas with no spaces or other punctuation. For example:
+    1: US
+    2: CA
+    3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR
+    4: JP,AU,NZ,SG
+    5: TW,CN,HK
+
+  Now you need to set up the shipping rate tables for each zone.  Again,
+  some time and effort will go into setting the appropriate rates.  You
+  will define a set of weight ranges and the shipping price for each
+  range.  For instance, you might want an order than weighs more than 0
+  and less than or equal to 3 to cost 5.50 to ship to a certain zone.
+  This would be defined by this:  3:5.5
+
+  You should combine a bunch of these rates together in a comma delimited
+  list and enter them into the "Zone X Shipping Table" fields where "X"
+  is the zone number.  For example, this might be used for Zone 1:
+    1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
+    12:19.1,13:20.55,14:22,15:23.45
+
+  The above example includes weights over 0 and up to 15.  Note that
+  units are not specified in this explanation since they should be
+  specific to your locale.
+
+  CAVEATS
+  At this time, it does not deal with weights that are above the highest amount
+  defined.  This will probably be the next area to be improved with the
+  module.  For now, you could have one last very high range with a very
+  high shipping rate to discourage orders of that magnitude.  For
+  instance:  999:1000
+
+  If you want to be able to ship to any country in the world, you will
+  need to enter every country code into the Country fields. For most
+  shops, you will not want to enter every country.  This is often
+  because of too much fraud from certain places. If a country is not
+  listed, then the module will add a $0.00 shipping charge and will
+  indicate that shipping is not available to that destination.
+  PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!
+
+  It appears that the osC shipping system automatically rounds the
+  shipping weight up to the nearest whole unit.  This makes it more
+  difficult to design precise shipping tables.  If you want to, you
+  can hack the shipping.php file to get rid of the rounding.
+
+  Lastly, there is a limit of 255 characters on each of the Zone
+  Shipping Tables and Zone Countries.
+
+*/
+
+  class stand {
+    var $code, $title, $description, $enabled, $num_zones;
+
+// class constructor
+    function stand() {
+      $this->code = 'stand';
+      $this->title = MODULE_SHIPPING_STAND_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_STAND_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_STAND_SORT_ORDER;
+      $this->icon = '';
+      $this->tax_class = MODULE_SHIPPING_STAND_TAX_CLASS;
+
+     $this->enabled = ((MODULE_SHIPPING_STAND_STATUS == 'True') ? true : false);
+
+      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
+      $this->num_zones = 1;
+    }
+
+
+// class methods
+    function quote($method = '') {
+      global $order, $shipping_weight, $shipping_num_boxes;
+
+      $dest_country = $order->delivery['country']['iso_code_2'];
+      $dest_zone = 0;
+      $error = false;
+
+      for ($i=1; $i<=$this->num_zones; $i++) {
+        $countries_table = constant('MODULE_SHIPPING_STAND_COUNTRIES_' . $i);
+        $country_zones = split("[,]", $countries_table);
+
+          if (in_array($dest_country, $country_zones)) {
+          $dest_zone = $i;
+          break;
+
+
+        }
+      }
+
+// ADDITINAL INSURANCE CHARGES - EDIT WHEN THEY PUT THEM UP!!
+
+$ic = 0;
+ if ($order->info['total'] > 100) $ic = .5;
+ if ($order->info['total'] > 250) $ic = 1.15;
+ if ($order->info['total'] > 500) $ic = 2.25;
+
+// END OF INSURANCE CHARGES
+
+
+
+      if ($dest_zone == 0) {
+        $error = true;
+      } else {
+        $shipping = -1;
+        $zones_cost = constant('MODULE_SHIPPING_STAND_COST_' . $dest_zone);
+
+        $zones_table = split("[:,]" , $zones_cost);
+        $size = sizeof($zones_table);
+        for ($i=0; $i<$size; $i+=2) {
+      if ($shipping_weight <= $zones_table[$i]) {
+            $shipping = $zones_table[$i+1];
+            $shipping_method = 'Non-urgent deliveries';
+
+
+
+            break;
+          }
+        }
+
+
+
+
+
+        if ($shipping == -1)  {
+         $shipping_cost = 0;
+         $shipping_method = MODULE_SHIPPING_STAND_UNDEFINED_RATE;
+$error = true;
+}
+
+if ($order->info['total'] > 500) {
+ $error = true;
+
+
+      } else {
+
+         $shipping_cost = ($shipping * $shipping_num_boxes) + $ic + constant('MODULE_SHIPPING_STAND_HANDLING_' . $dest_zone);
+
+      }
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_STAND_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => $shipping_method,
+                                                     'cost' => $shipping_cost)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_STAND_INVALID_ZONE;
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_STAND_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_STAND_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_STAND_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_STAND_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+      for ($i = 1; $i <= $this->num_zones; $i++) {
+        $default_countries = '';
+        if ($i == 1) {
+          $default_countries = 'US,CA';
+        }
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_STAND_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_STAND_COST_" . $i ."', '1:3.50,2:4.80,4:7.2,6:7.9,8:9,10:9.65,20:11.25', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_STAND_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
+      }
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      $keys = array('MODULE_SHIPPING_STAND_STATUS', 'MODULE_SHIPPING_STAND_TAX_CLASS', 'MODULE_SHIPPING_STAND_SORT_ORDER');
+
+      for ($i=1; $i<=$this->num_zones; $i++) {
+        $keys[] = 'MODULE_SHIPPING_STAND_COUNTRIES_' . $i;
+        $keys[] = 'MODULE_SHIPPING_STAND_COST_' . $i;
+        $keys[] = 'MODULE_SHIPPING_STAND_HANDLING_' . $i;
+      }
+
+      return $keys;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/table.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,111 @@
+<?php
+/*
+  $Id: table.php,v 1.1.1.1 2004/03/04 23:41:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class table {
+    var $code, $title, $description, $icon, $enabled;
+
+// class constructor
+    function table() {
+      global $order;
+
+      $this->code = 'table';
+      $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
+      $this->icon = '';
+      $this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order, $cart, $shipping_weight, $shipping_num_boxes;
+
+      if (MODULE_SHIPPING_TABLE_MODE == 'price') {
+        $order_total = $cart->show_total();
+      } else {
+        $order_total = $shipping_weight;
+      }
+
+      $table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST);
+      $size = sizeof($table_cost);
+      for ($i=0, $n=$size; $i<$n; $i+=2) {
+        if ($order_total <= $table_cost[$i]) {
+          $shipping = $table_cost[$i+1];
+          break;
+        }
+      }
+
+      if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
+        $shipping = $shipping * $shipping_num_boxes;
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
+                                                     'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_TABLE_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_TABLE_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Table Method Shipping Table', 'MODULE_SHIPPING_TABLE_COST', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Table Method Handling Fee', 'MODULE_SHIPPING_TABLE_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Table Method Tax Class', 'MODULE_SHIPPING_TABLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Table Method Shipping Zone', 'MODULE_SHIPPING_TABLE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Table Method Sort Order', 'MODULE_SHIPPING_TABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_TABLE_STATUS', 'MODULE_SHIPPING_TABLE_COST', 'MODULE_SHIPPING_TABLE_MODE', 'MODULE_SHIPPING_TABLE_HANDLING', 'MODULE_SHIPPING_TABLE_TAX_CLASS', 'MODULE_SHIPPING_TABLE_ZONE', 'MODULE_SHIPPING_TABLE_SORT_ORDER');
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/ups.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/ups.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/ups.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,309 @@
+<?php
+/*
+$Id: ups.php,v 1.54 2003/04/08 23:23:42 dgw_ Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+/*
+revised by Fritz Clapp as UPS Choice 1.8 2003/08/02
+  filters service types to those selected in admin and saved in 
+  configuration table with key MODULE_SHIPPING_UPS_TYPES;
+  suggests STD service as default for Canada;
+  modified error message refers to failure to get quote;
+
+*/
+
+  class ups {
+    var $code, $title, $descrption, $icon, $enabled, $types;
+
+// class constructor
+    function ups() {
+      global $order;
+
+      $this->code = 'ups';
+      $this->title = MODULE_SHIPPING_UPS_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_UPS_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_UPS_SORT_ORDER;
+      $this->icon = DIR_WS_ICONS . 'shipping_ups.gif';
+	  $this->tax_class = MODULE_SHIPPING_UPS_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_UPS_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+
+      $this->types = array('1DM' => 'Next Day Air Early AM',
+                           '1DML' => 'Next Day Air Early AM Letter',
+                           '1DA' => 'Next Day Air',
+                           '1DAL' => 'Next Day Air Letter',
+                           '1DAPI' => 'Next Day Air Intra (Puerto Rico)',
+                           '1DP' => 'Next Day Air Saver',
+                           '1DPL' => 'Next Day Air Saver Letter',
+                           '2DM' => '2nd Day Air AM',
+                           '2DML' => '2nd Day Air AM Letter',
+                           '2DA' => '2nd Day Air',
+                           '2DAL' => '2nd Day Air Letter',
+                           '3DS' => '3 Day Select',
+                           'GND' => 'Ground',
+                           'GNDCOM' => 'Ground Commercial',
+                           'GNDRES' => 'Ground Residential',
+                           'STD' => 'Canada Standard',
+                           'XPR' => 'Worldwide Express',
+                           'XPRL' => 'worldwide Express Letter',
+                           'XDM' => 'Worldwide Express Plus',
+                           'XDML' => 'Worldwide Express Plus Letter',
+                           'XPD' => 'Worldwide Expedited');
+    }
+
+// class methods
+    function quote($method = '') {
+      global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes;
+
+      if ( (tep_not_null($method)) && (isset($this->types[$method])) ) {
+        $prod = $method;
+      } else if ($order->delivery['country']['iso_code_2'] == 'CA') {
+	    $prod = 'STD';
+      } else {
+        $prod = 'GNDRES';
+      }
+
+      if ($method) $this->_upsAction('3'); // return a single quote
+
+      $this->_upsProduct($prod);
+
+      $country_name = tep_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
+      $this->_upsOrigin(SHIPPING_ORIGIN_ZIP, $country_name['countries_iso_code_2']);
+      $this->_upsDest($order->delivery['postcode'], $order->delivery['country']['iso_code_2']);
+      $this->_upsRate(MODULE_SHIPPING_UPS_PICKUP);
+      $this->_upsContainer(MODULE_SHIPPING_UPS_PACKAGE);
+      $this->_upsWeight($shipping_weight);
+      $this->_upsRescom(MODULE_SHIPPING_UPS_RES);
+      $upsQuote = $this->_upsGetQuote();
+
+      if ( (is_array($upsQuote)) && (sizeof($upsQuote) > 0) ) {
+        $this->quotes = array('id' => $this->code,
+                              'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)');
+
+        $methods = array();
+		$allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES);
+		$std_rcd = false;
+        $qsize = sizeof($upsQuote);
+        for ($i=0; $i<$qsize; $i++) {
+          list($type, $cost) = each($upsQuote[$i]);
+		  if ($type=='STD') {
+			  if ($std_rcd) continue;
+			  else $std_rcd = true;
+			};
+		  if (!in_array($type, $allowed_methods)) continue;
+          $methods[] = array('id' => $type,
+                             'title' => $this->types[$type],
+                             'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
+        }
+
+        $this->quotes['methods'] = $methods;
+		if ($this->tax_class > 0) {
+          $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+        }
+      } else {
+        $this->quotes = array('module' => $this->title,
+                              'error' => 'We are unable to obtain a rate quote for UPS shipping.<br>Please contact the store if no other alternative is shown.');
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_UPS_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable UPS Shipping', 'MODULE_SHIPPING_UPS_STATUS', 'True', 'Do you want to offer UPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Pickup Method', 'MODULE_SHIPPING_UPS_PICKUP', 'CC', 'How do you give packages to UPS? CC - Customer Counter, RDP - Daily Pickup, OTP - One Time Pickup, LC - Letter Center, OCA - On Call Air', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Packaging?', 'MODULE_SHIPPING_UPS_PACKAGE', 'CP', 'CP - Your Packaging, ULE - UPS Letter, UT - UPS Tube, UBE - UPS Express Box', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Residential Delivery?', 'MODULE_SHIPPING_UPS_RES', 'RES', 'Quote for Residential (RES) or Commercial Delivery (COM)', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_UPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
+	  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_UPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_UPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_UPS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( 'Shipping Methods', 'MODULE_SHIPPING_UPS_TYPES', 'Nxt AM,Nxt AM Ltr,Nxt,Nxt Ltr,Nxt PR,Nxt Save,Nxt Save Ltr,2nd AM,2nd AM Ltr,2nd,2nd Ltr,3 Day Select,Ground,Canada,World Xp,World Xp Ltr, World Xp Plus,World Xp Plus Ltr,World Expedite', 'Select the USPS services to be offered.', '6', '13', 'tep_cfg_select_multioption(array(\'1DM\',\'1DML\', \'1DA\', \'1DAL\', \'1DAPI\', \'1DP\', \'1DPL\', \'2DM\', \'2DML\', \'2DA\', \'2DAL\', \'3DS\',\'GND\', \'STD\', \'XPR\', \'XPRL\', \'XDM\', \'XDML\', \'XPD\'), ', now() )");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_UPS_STATUS', 'MODULE_SHIPPING_UPS_PICKUP', 'MODULE_SHIPPING_UPS_PACKAGE', 'MODULE_SHIPPING_UPS_RES', 'MODULE_SHIPPING_UPS_HANDLING', 'MODULE_SHIPPING_UPS_TAX_CLASS', 'MODULE_SHIPPING_UPS_ZONE', 'MODULE_SHIPPING_UPS_SORT_ORDER', 'MODULE_SHIPPING_UPS_TYPES');
+    }
+
+    function _upsProduct($prod){
+      $this->_upsProductCode = $prod;
+    }
+
+    function _upsOrigin($postal, $country){
+      $this->_upsOriginPostalCode = $postal;
+      $this->_upsOriginCountryCode = $country;
+    }
+
+    function _upsDest($postal, $country){
+      $postal = str_replace(' ', '', $postal);
+
+      if ($country == 'US') {
+        $this->_upsDestPostalCode = substr($postal, 0, 5);
+      } else {
+        $this->_upsDestPostalCode = $postal;
+      }
+
+      $this->_upsDestCountryCode = $country;
+    }
+
+    function _upsRate($foo) {
+      switch ($foo) {
+        case 'RDP':
+          $this->_upsRateCode = 'Regular+Daily+Pickup';
+          break;
+        case 'OCA':
+          $this->_upsRateCode = 'On+Call+Air';
+          break;
+        case 'OTP':
+          $this->_upsRateCode = 'One+Time+Pickup';
+          break;
+        case 'LC':
+          $this->_upsRateCode = 'Letter+Center';
+          break;
+        case 'CC':
+          $this->_upsRateCode = 'Customer+Counter';
+          break;
+      }
+    }
+
+    function _upsContainer($foo) {
+      switch ($foo) {
+        case 'CP': // Customer Packaging
+          $this->_upsContainerCode = '00';
+          break;
+        case 'ULE': // UPS Letter Envelope
+          $this->_upsContainerCode = '01';
+          break;
+        case 'UT': // UPS Tube
+          $this->_upsContainerCode = '03';
+          break;
+        case 'UEB': // UPS Express Box
+          $this->_upsContainerCode = '21';
+          break;
+        case 'UW25': // UPS Worldwide 25 kilo
+          $this->_upsContainerCode = '24';
+          break;
+        case 'UW10': // UPS Worldwide 10 kilo
+          $this->_upsContainerCode = '25';
+          break;
+      }
+    }
+
+    function _upsWeight($foo) {
+      $this->_upsPackageWeight = $foo;
+    }
+
+    function _upsRescom($foo) {
+      switch ($foo) {
+        case 'RES': // Residential Address
+          $this->_upsResComCode = '1';
+          break;
+        case 'COM': // Commercial Address
+          $this->_upsResComCode = '2';
+          break;
+      }
+    }
+
+    function _upsAction($action) {
+      /* 3 - Single Quote
+         4 - All Available Quotes */
+
+      $this->_upsActionCode = $action;
+    }
+
+    function _upsGetQuote() {
+      if (!isset($this->_upsActionCode)) $this->_upsActionCode = '4';
+
+      $request = join('&', array('accept_UPS_license_agreement=yes',
+                                 '10_action=' . $this->_upsActionCode,
+                                 '13_product=' . $this->_upsProductCode,
+                                 '14_origCountry=' . $this->_upsOriginCountryCode,
+                                 '15_origPostal=' . $this->_upsOriginPostalCode,
+                                 '19_destPostal=' . $this->_upsDestPostalCode,
+                                 '22_destCountry=' . $this->_upsDestCountryCode,
+                                 '23_weight=' . $this->_upsPackageWeight,
+                                 '47_rate_chart=' . $this->_upsRateCode,
+                                 '48_container=' . $this->_upsContainerCode,
+                                 '49_residential=' . $this->_upsResComCode));
+      $http = new httpClient();
+      if ($http->Connect('www.ups.com', 80)) {
+        $http->addHeader('Host', 'www.ups.com');
+        $http->addHeader('User-Agent', 'osCommerce');
+        $http->addHeader('Connection', 'Close');
+
+        if ($http->Get('/using/services/rave/qcostcgi.cgi?' . $request)) $body = $http->getBody();
+
+        $http->Disconnect();
+      } else {
+        return 'error';
+      }
+/*
+    mail('you at yourdomain.com','UPS response',$body,'From: <you at yourdomain.com>');
+*/
+      $body_array = explode("\n", $body);
+
+      $returnval = array();
+      $errorret = 'error'; // only return error if NO rates returned
+
+      $n = sizeof($body_array);
+      for ($i=0; $i<$n; $i++) {
+        $result = explode('%', $body_array[$i]);
+        $errcode = substr($result[0], -1);
+        switch ($errcode) {
+          case 3:
+            if (is_array($returnval)) $returnval[] = array($result[1] => $result[8]);
+            break;
+          case 4:
+            if (is_array($returnval)) $returnval[] = array($result[1] => $result[8]);
+            break;
+          case 5:
+            $errorret = $result[1];
+            break;
+          case 6:
+            if (is_array($returnval)) $returnval[] = array($result[3] => $result[10]);
+            break;
+        }
+      }
+      if (empty($returnval)) $returnval = $errorret;
+
+      return $returnval;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/upsxml.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/upsxml.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/upsxml.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1220 @@
+<?php
+/*
+    $Id: upsxml.php,v 1.2.6 2007/02/02 JanZ Exp $
+
+    Original copyright (c) 2003 Torin Walker
+    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+    See the GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License along with this program;
+    If not, you may obtain one by writing to and requesting one from:
+    The Free Software Foundation, Inc.,
+    59 Temple Place, Suite 330,
+    Boston, MA 02111-1307 USA
+
+    Written by Torin Walker.
+    Some code/style borrowed from both Fritz Clapp's UPS Choice 1.7 Module,
+    and Kelvin, Kenneth, and Tom St.Croix's Canada Post 3.1 Module.
+    Insurance support by Joe McFrederick
+*/
+
+require ('includes/classes/xmldocument.php');
+// if using the optional dimensional support, set to 1, otherwise leave as 0
+// define('DIMENSIONS_SUPPORTED', 1);
+// obsolete: is set in admin now
+
+class upsxml {
+    var $code, $title, $description, $icon, $enabled, $types, $boxcount,$response_currency_code;
+
+    //***************
+    function upsxml() {
+        global $order;
+        $this->code = 'upsxml';
+        $this->title = MODULE_SHIPPING_UPSXML_RATES_TEXT_TITLE;
+        $this->description = MODULE_SHIPPING_UPSXML_RATES_TEXT_DESCRIPTION;
+        $this->sort_order = MODULE_SHIPPING_UPSXML_RATES_SORT_ORDER;
+        $this->icon = DIR_WS_ICONS . 'shipping_ups.gif';
+        $this->tax_class = MODULE_SHIPPING_UPSXML_RATES_TAX_CLASS;
+        $this->enabled = ((MODULE_SHIPPING_UPSXML_RATES_STATUS == 'True') ? true : false);
+        $this->access_key = MODULE_SHIPPING_UPSXML_RATES_ACCESS_KEY;
+        $this->access_username = MODULE_SHIPPING_UPSXML_RATES_USERNAME;
+        $this->access_password = MODULE_SHIPPING_UPSXML_RATES_PASSWORD;
+        $this->access_account_number = MODULE_SHIPPING_UPSXML_RATES_UPS_ACCOUNT_NUMBER;
+        $this->use_negotiated_rates = MODULE_SHIPPING_UPSXML_RATES_USE_NEGOTIATED_RATES;
+        $this->origin = MODULE_SHIPPING_UPSXML_RATES_ORIGIN;
+        $this->origin_city = MODULE_SHIPPING_UPSXML_RATES_CITY;
+        $this->origin_stateprov = MODULE_SHIPPING_UPSXML_RATES_STATEPROV;
+        $this->origin_country = MODULE_SHIPPING_UPSXML_RATES_COUNTRY;
+        $this->origin_postalcode = MODULE_SHIPPING_UPSXML_RATES_POSTALCODE;
+        $this->pickup_method = MODULE_SHIPPING_UPSXML_RATES_PICKUP_METHOD;
+        $this->package_type = MODULE_SHIPPING_UPSXML_RATES_PACKAGE_TYPE;
+        $this->unit_weight = MODULE_SHIPPING_UPSXML_RATES_UNIT_WEIGHT;
+        $this->unit_length = MODULE_SHIPPING_UPSXML_RATES_UNIT_LENGTH;
+        if (MODULE_SHIPPING_UPSXML_DIMENSIONS_SUPPORT == 'Ready-to-ship only') {
+          $this->dimensions_support = 1;
+        } elseif (MODULE_SHIPPING_UPSXML_DIMENSIONS_SUPPORT == 'With product dimensions') {
+          $this->dimensions_support = 2;
+        } else {
+          $this->dimensions_support = 0;
+        }
+        $this->email_errors = ((MODULE_SHIPPING_UPSXML_EMAIL_ERRORS == 'Yes') ? true : false);
+        $this->handling_type = MODULE_SHIPPING_UPSXML_HANDLING_TYPE;
+        $this->handling_fee = MODULE_SHIPPING_UPSXML_RATES_HANDLING;
+        $this->quote_type = MODULE_SHIPPING_UPSXML_RATES_QUOTE_TYPE;
+        $this->customer_classification = MODULE_SHIPPING_UPSXML_RATES_CUSTOMER_CLASSIFICATION_CODE;
+        $this->protocol = 'https';
+        $this->host = ((MODULE_SHIPPING_UPSXML_RATES_MODE == 'Test') ? 'wwwcie.ups.com' : 'www.ups.com');
+        $this->port = '443';
+        $this->path = '/ups.app/xml/Rate';
+        $this->transitpath = '/ups.app/xml/TimeInTransit';
+        $this->version = 'UPSXML Rate 1.0001';
+        $this->transitversion = 'UPSXML Time In Transit 1.0002';
+        $this->timeout = '60';
+        $this->xpci_version = '1.0001';
+        $this->transitxpci_version = '1.0002';
+        $this->items_qty = 0;
+        $this->timeintransit = '0';
+        $this->timeInTransitView = MODULE_SHIPPING_UPSXML_RATES_TIME_IN_TRANSIT_VIEW;
+        $this->weight_for_timeintransit = '0';
+        $now_unix_time = mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"));
+        $this->today_unix_time = $now_unix_time;
+        $this->today = date("Ymd");
+        // insurance addition.
+        if (MODULE_SHIPPING_UPSXML_INSURE == 'False')
+          { $this->pkgvalue = 100; }
+        if (MODULE_SHIPPING_UPSXML_INSURE == 'True')
+          { $this->pkgvalue = ceil($order->info['subtotal']); }
+        // end insurance addition
+        // to enable logging, create an empty "upsxml.log" file at the location you set below, give it write permissions (777) and uncomment the next line
+              $this->logfile = UPS_LOG_FILE;
+        
+        // to enable logging of just the errors, do as above but call the file upsxml_error.log
+              $this->ups_error_file = UPS_ERROR_FILE;
+        // when cURL is not compiled into PHP (Windows users, some Linux users)
+        // you can set the next variable to "1" and then exec(curl -d $xmlRequest, $xmlResponse)
+        // will be used
+        $this->use_exec = '0';
+
+        if (($this->enabled == true) && ((int)MODULE_SHIPPING_UPSXML_RATES_ZONE > 0)) {
+            $check_flag = false;
+            $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPSXML_RATES_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+            while ($check = tep_db_fetch_array($check_query)) {
+                if ($check['zone_id'] < 1) {
+                    $check_flag = true;
+                    break;
+                } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+                    $check_flag = true;
+                    break;
+                }
+            }
+            if ($check_flag == false) {
+                $this->enabled = false;
+            }
+        }
+
+        // Available pickup types - set in admin
+        $this->pickup_methods = array(
+            'Daily Pickup' => '01',
+            'Customer Counter' => '03',
+            'One Time Pickup' => '06',
+            'On Call Air Pickup' => '07',
+            'Suggested Retail Rates (UPS Store)' => '11',
+            'Letter Center' => '19',
+            'Air Service Center' => '20'
+        );
+
+        // Available package types
+        $this->package_types = array(
+            'UPS Letter' => '01',
+            'Package' => '02',
+            'UPS Tube' => '03',
+            'UPS Pak' => '04',
+            'UPS Express Box' => '21',
+            'UPS 25kg Box' => '24',
+            'UPS 10kg Box' => '25'
+        );
+
+        // Human-readable Service Code lookup table. The values returned by the Rates and Service "shop" method are numeric.
+        // Using these codes, and the administratively defined Origin, the proper human-readable service name is returned.
+        // Note: The origin specified in the admin configuration affects only the product name as displayed to the user.
+        $this->service_codes = array(
+            // US Origin
+            'US Origin' => array(
+                '01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_01,
+                '02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_02,
+                '03' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_03,
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_08,
+                '11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_11,
+                '12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_12,
+                '13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_13,
+                '14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_14,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_54,
+                '59' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_59,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_65
+            ),
+            // Canada Origin
+            'Canada Origin' => array(
+                '01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_01,
+                '02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_02,
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_08,
+                '11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_11,
+                '12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_12,
+                '13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_13,
+                '14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_14,
+                // service code 54 gone after January 2, 2007
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_CANADA_ORIGIN_65
+            ),
+            // European Union Origin
+            'European Union Origin' => array(
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_07,
+                '11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_11,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_65,
+                // next three services Poland domestic only (Stolica)
+                '82' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_82,
+                '83' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_83,
+                '84' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_EU_ORIGIN_84
+            ),
+            // Puerto Rico Origin
+            'Puerto Rico Origin' => array(
+                '01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_01,
+                '02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_02,
+                '03' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_03,
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_08,
+                '14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_14,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_65
+            ),
+            // Mexico Origin
+            'Mexico Origin' => array(
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_08,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_MEXICO_ORIGIN_65
+            ),
+            // All other origins
+            'All other origins' => array(
+                // service code 7 seems to be gone after January 2, 2007
+                '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_OTHER_ORIGIN_07,
+                '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_OTHER_ORIGIN_08,
+                '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_OTHER_ORIGIN_54,
+                '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_PR_ORIGIN_65
+            )
+        );
+    } // end function upsxml
+
+    // class methods
+    function quote($method = '') {
+        global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes, $total_weight, $boxcount, $cart;
+        // UPS purports that if the origin is left out, it defaults to the account's location. Yeah, right.
+        $state = $order->delivery['state'];
+        $zone_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_name = '" .  $order->delivery['state'] . "'");
+        if (tep_db_num_rows($zone_query)) {
+            $zone = tep_db_fetch_array($zone_query);
+            $state = $zone['zone_code'];
+        }
+        $this->_upsOrigin(MODULE_SHIPPING_UPSXML_RATES_CITY, MODULE_SHIPPING_UPSXML_RATES_STATEPROV, MODULE_SHIPPING_UPSXML_RATES_COUNTRY, MODULE_SHIPPING_UPSXML_RATES_POSTALCODE);
+        $this->_upsDest($order->delivery['city'], $state, $order->delivery['country']['iso_code_2'], $order->delivery['postcode']);
+        $productsArray = $cart->get_products();
+				if ($this->dimensions_support > 0) {
+					$productsArray = $this->more_dimensions_to_productsArray($productsArray);
+				}
+
+        if ($this->dimensions_support == '2') {
+            // sort $productsArray according to ready-to-ship (first) and not-ready-to-ship (last)
+            usort($productsArray, ready_to_shipCmp);
+            // Use packing algoritm to return the number of boxes we'll ship
+            $boxesToShip = $this->packProducts($productsArray);
+            // Quote for the number of boxes
+            for ($i = 0; $i < count($boxesToShip); $i++) {
+                $this->_addItem($boxesToShip[$i]['length'], $boxesToShip[$i]['width'], $boxesToShip[$i]['height'], $boxesToShip[$i]['current_weight'], $boxesToShip[$i]['price']);
+                $totalWeight += $boxesToShip[$i]['current_weight'];
+            }
+        } elseif ($this->dimensions_support == '1') {
+            $totalWeight = 0;
+            $total_non_ready_to_ship_weight = 0;
+						$total_non_ready_to_ship_value = 0;
+            // sort $productsArray according to ready-to-ship (first) and not-ready-to-ship (last)
+            usort($productsArray, ready_to_shipCmp);
+            $non_ready_to_shipArray = array();
+            // walk through the productsArray, separate the items ready-to-ship and add them to
+            // the items (boxes) list, add the weight to the totalWeight
+            // and add the other items to a separate array
+            for ($i = 0; $i < count($productsArray); $i++) {
+                if ($productsArray[$i]['ready_to_ship'] == '1') {
+                    for ($z = 0 ; $z < $productsArray[$i]['quantity']; $z++) {
+                        $this->_addItem($productsArray[$i]['length'], $productsArray[$i]['width'], $productsArray[$i]['height'], $productsArray[$i]['weight'], (MODULE_SHIPPING_UPSXML_INSURE == 'False' ? $this->pkgvalue : $productsArray[$i]['final_price']));
+                        $totalWeight += $productsArray[$i]['weight'];
+                    } // end for ($z = 0 ; $z < $productsArray[$i]['quantity']; $z++)
+                } // end if($productsArray['ready_to_ship'] == '1')
+                else {
+                    $non_ready_to_shipArray[] = $productsArray[$i];
+                }
+            } // end for ($i = 0; $i < count($productsArray); $i++)
+            // Ready_to_ship items out of the way, now assess remaining weight and remaining value of products
+
+            for ($x = 0 ; $x < count($non_ready_to_shipArray) ; $x++) {
+                $total_non_ready_to_ship_weight += ($non_ready_to_shipArray[$x]['weight'] * $non_ready_to_shipArray[$x]['quantity']);
+								$total_non_ready_to_ship_value += ($non_ready_to_shipArray[$x]['final_price'] * $non_ready_to_shipArray[$x]['quantity']);
+            } // end for ($x = 0 ; count($non_ready_to_shipArray) ; $x++)
+      
+            if (tep_not_null($non_ready_to_shipArray)) {
+                // adapted code from includes/classes/shipping.php
+                $shipping_non_ready_to_ship_boxes = 1;
+                $shipping_non_ready_to_ship_weight = $total_non_ready_to_ship_weight;
+                if (SHIPPING_BOX_WEIGHT >= $total_non_ready_to_ship_weight*SHIPPING_BOX_PADDING/100) {
+                  $total_non_ready_to_ship_weight = $total_non_ready_to_ship_weight+SHIPPING_BOX_WEIGHT;
+                } else {
+                  $total_non_ready_to_ship_weight += $total_non_ready_to_ship_weight*SHIPPING_BOX_PADDING/100;
+                }
+                if ($total_non_ready_to_ship_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes
+                    $shipping_non_ready_to_ship_boxes = ceil($total_non_ready_to_ship_weight/SHIPPING_MAX_WEIGHT);
+                    $shipping_non_ready_to_ship_weight = round($total_non_ready_to_ship_weight/$shipping_non_ready_to_ship_boxes,1);
+                }
+                // end adapted code from includes/classes/shipping.php
+                // weight and number of boxes of non-read-to-ship is determined, now add them to the items list
+                for ($y = 0; $y < $shipping_non_ready_to_ship_boxes ; $y++) {
+                    $this->_addItem(0, 0, 0, $shipping_non_ready_to_ship_weight, (MODULE_SHIPPING_UPSXML_INSURE == 'False' ? $this->pkgvalue : number_format(($total_non_ready_to_ship_value/$shipping_non_ready_to_ship_boxes), 2, '.', '')) );
+                    $totalWeight += $shipping_non_ready_to_ship_weight;
+                } // end for ($y = 0; $y < $shipping_non_ready_to_ship_boxes ; $y++)
+            } // end if (tep_not_null($non_ready_to_shipArray))
+        } else {
+            // The old method. Let osCommerce tell us how many boxes, plus the weight of each (or total? - might be sw/num boxes)
+            $this->items_qty = 0; //reset quantities
+						if (MODULE_SHIPPING_UPSXML_INSURE == 'False') {
+               for ($i = 0; $i < $shipping_num_boxes; $i++) {
+                  $this->_addItem(0, 0, 0, $shipping_weight, $this->pkgvalue);
+               }
+						} else {
+							// $this->pkgvalue has been set as order subtotal around line 86, it will cause overcharging
+							// of insurance if not divided by the number of boxes
+							 for ($i = 0; $i < $shipping_num_boxes; $i++) {
+                  $this->_addItem(0, 0, 0, $shipping_weight, number_format(($this->pkgvalue/$shipping_num_boxes), 2, '.', ''));
+               }
+						} // end if/else  (MODULE_SHIPPING_UPSXML_INSURE == 'False')
+        }
+
+        // BOF Time In Transit: comment out this section if you don't want/need to have
+        // expected delivery dates
+        if ($this->dimensions_support > 0) {
+            $this->weight_for_timeintransit = round($totalWeight,1);
+        } else {
+            $this->weight_for_timeintransit = round($shipping_num_boxes * $shipping_weight,1);
+        }
+        // Added to workaround time in transit error 270033 if total weight of packages is over 150lbs or 70kgs
+        if (($this->weight_for_timeintransit > 150) && ($this->unit_weight == "LBS")) {
+          $this->weight_for_timeintransit = 150;          
+        } else if (($this->weight_for_timeintransit > 70) && ($this->unit_weight == "KGS")) {
+          $this->weight_for_timeintransit = 70;          
+        }
+        // debug only:
+        /*  echo '<pre>Packages and variables:<br />';
+         print_r($this);
+         echo '<br />';
+         exit; */
+        $this->servicesTimeintransit = $this->_upsGetTimeServices();
+        if ($this->logfile) {
+            error_log("------------------------------------------\n", 3, $this->logfile);
+            error_log("Time in Transit: " . $this->timeintransit . "\n", 3, $this->logfile);
+        }
+        // EOF Time In Transit
+
+        $upsQuote = $this->_upsGetQuote();
+        
+        if ((is_array($upsQuote)) && (sizeof($upsQuote) > 0)) {
+            if ($this->dimensions_support > 0) {
+                $this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $this->boxCount . ($this->boxCount > 1 ? ' pkg(s), ' : ' pkg, ') . round($totalWeight,0) . ' ' . strtolower($this->unit_weight) . ' total)');
+            } else {
+                $this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $shipping_num_boxes . ($this->boxCount > 1 ? ' pkg(s) x ' : ' pkg x ') . round($shipping_weight,0) . ' ' . strtolower($this->unit_weight) . ' total)');
+            }
+            $methods = array();
+            for ($i=0; $i < sizeof($upsQuote); $i++) {
+                list($type, $cost) = each($upsQuote[$i]);
+                // BOF limit choices, behaviour changed from versions < 1.2
+                if ($this->exclude_choices($type)) continue;
+                // EOF limit choices
+                if ( $method == '' || $method == $type ) {
+                    $_type = $type;
+
+                    if ($this->timeInTransitView == "Raw") {
+                      if (isset($this->servicesTimeintransit[$type])) {                     	
+                        $_type = $_type . ", ".$this->servicesTimeintransit[$type]["date"];
+                      }        
+                    } else {
+                      if (isset($this->servicesTimeintransit[$type])) {
+                        $eta_array = explode("-", $this->servicesTimeintransit[$type]["date"]);
+                        $months = array (" ", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
+                        $eta_arrival_date = $months[(int)$eta_array[1]]." ".$eta_array[2].", ".$eta_array[0];
+                        $_type .= ", <acronym title='Estimated Delivery Date'>EDD</acronym>: ".$eta_arrival_date;
+                      }          
+                    }                    
+                    
+                    // changed to make handling percentage based
+                    if ($this->handling_type == "Percentage") {
+                        $methods[] = array('id' => $type, 'title' => $_type, 'cost' => ((($this->handling_fee * $cost)/100) + $cost));
+                    } else {
+                        $methods[] = array('id' => $type, 'title' => $_type, 'cost' => ($this->handling_fee + $cost));
+                    }
+                }
+            }
+            if ($this->tax_class > 0) {
+                $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+            }
+            $this->quotes['methods'] = $methods;
+        } else {
+            if ( $upsQuote != false ) {
+                $errmsg = $upsQuote;
+            } else {
+                $errmsg = MODULE_SHIPPING_UPSXML_RATES_TEXT_UNKNOWN_ERROR;
+            }
+            $errmsg .= '<br>' . MODULE_SHIPPING_UPSXML_RATES_TEXT_IF_YOU_PREFER . ' ' . STORE_NAME.' via <a href="mailto:'.STORE_OWNER_EMAIL_ADDRESS.'"><u>Email</U></a>.';
+            $this->quotes = array('module' => $this->title, 'error' => $errmsg);
+        }
+        if (tep_not_null($this->icon)) {
+            $this->quotes['icon'] = tep_image($this->icon, $this->title);
+        }
+        
+        return $this->quotes;
+    }
+
+    //**************
+    function check() {
+        if (!isset($this->_check)) {
+            $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_UPSXML_RATES_STATUS'");
+            $this->_check = tep_db_num_rows($check_query);
+        }
+        return $this->_check;
+    }
+
+    //**************
+    function install() {
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable UPS Shipping', 'MODULE_SHIPPING_UPSXML_RATES_STATUS', 'True', 'Do you want to offer UPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Rates Access Key', 'MODULE_SHIPPING_UPSXML_RATES_ACCESS_KEY', '', 'Enter the XML rates access key assigned to you by UPS.', '6', '1', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Rates Username', 'MODULE_SHIPPING_UPSXML_RATES_USERNAME', '', 'Enter your UPS Services account username.', '6', '2', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Rates Password', 'MODULE_SHIPPING_UPSXML_RATES_PASSWORD', '', 'Enter your UPS Services account password.', '6', '3', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Pickup Method', 'MODULE_SHIPPING_UPSXML_RATES_PICKUP_METHOD', 'Daily Pickup', 'How do you give packages to UPS (only used when origin is US)?', '6', '4', 'tep_cfg_select_option(array(\'Daily Pickup\', \'Customer Counter\', \'One Time Pickup\', \'On Call Air Pickup\', \'Letter Center\', \'Air Service Center\', \'Suggested Retail Rates (UPS Store)\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Packaging Type', 'MODULE_SHIPPING_UPSXML_RATES_PACKAGE_TYPE', 'Package', 'What kind of packaging do you use?', '6', '5', 'tep_cfg_select_option(array(\'Package\', \'UPS Letter\', \'UPS Tube\', \'UPS Pak\', \'UPS Express Box\', \'UPS 25kg Box\', \'UPS 10kg box\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Classification Code', 'MODULE_SHIPPING_UPSXML_RATES_CUSTOMER_CLASSIFICATION_CODE', '01', '01 - If you are billing to a UPS account and have a daily UPS pickup, 03 - If you do not have a UPS account or you are billing to a UPS account but do not have a daily pickup, 04 - If you are shipping from a retail outlet (only used when origin is US)', '6', '6', 'tep_cfg_select_option(array(\'01\', \'03\', \'04\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Shipping Origin', 'MODULE_SHIPPING_UPSXML_RATES_ORIGIN', 'US Origin', 'What origin point should be used (this setting affects only what UPS product names are shown to the user)', '6', '7', 'tep_cfg_select_option(array(\'US Origin\', \'Canada Origin\', \'European Union Origin\', \'Puerto Rico Origin\', \'Mexico Origin\', \'All other origins\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Origin City', 'MODULE_SHIPPING_UPSXML_RATES_CITY', '', 'Enter the name of the origin city.', '6', '8', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Origin State/Province', 'MODULE_SHIPPING_UPSXML_RATES_STATEPROV', '', 'Enter the two-letter code for your origin state/province.', '6', '9', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Origin Country', 'MODULE_SHIPPING_UPSXML_RATES_COUNTRY', '', 'Enter the two-letter code for your origin country.', '6', '10', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Origin Zip/Postal Code', 'MODULE_SHIPPING_UPSXML_RATES_POSTALCODE', '', 'Enter your origin zip/postalcode.', '6', '11', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Test or Production Mode', 'MODULE_SHIPPING_UPSXML_RATES_MODE', 'Test', 'Use this module in Test or Production mode?', '6', '12', 'tep_cfg_select_option(array(\'Test\', \'Production\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Unit Weight', 'MODULE_SHIPPING_UPSXML_RATES_UNIT_WEIGHT', 'LBS', 'By what unit are your packages weighed?', '6', '13', 'tep_cfg_select_option(array(\'LBS\', \'KGS\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Unit Length', 'MODULE_SHIPPING_UPSXML_RATES_UNIT_LENGTH', 'IN', 'By what unit are your packages sized?', '6', '14', 'tep_cfg_select_option(array(\'IN\', \'CM\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Dimensions Support', 'MODULE_SHIPPING_UPSXML_DIMENSIONS_SUPPORT', 'No', 'Do you use the additional dimensions support (read dimensions.txt in the package)?', '6', '23', 'tep_cfg_select_option(array(\'No\', \'Ready-to-ship only\', \'With product dimensions\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Quote Type', 'MODULE_SHIPPING_UPSXML_RATES_QUOTE_TYPE', 'Commercial', 'Quote for Residential or Commercial Delivery', '6', '15', 'tep_cfg_select_option(array(\'Commercial\', \'Residential\'), ', now())");
+        // next two keys added to be able to use negotiated rates (available from UPS since about July 2006)
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Negotiated rates', 'MODULE_SHIPPING_UPSXML_RATES_USE_NEGOTIATED_RATES', 'False', 'Do you receive discounted rates from UPS and want to use these for shipping quotes? <b>Note:</b>  You need to enter your UPS account number below.', '6', '25', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Account Number', 'MODULE_SHIPPING_UPSXML_RATES_UPS_ACCOUNT_NUMBER', '', 'Enter your UPS Account number when you have and want to use negotiated rates.', '6', '26', now())");				
+        // added for handling type selection
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Type', 'MODULE_SHIPPING_UPSXML_HANDLING_TYPE', 'Flat Fee', 'Handling type for this shipping method.', '6', '16', 'tep_cfg_select_option(array(\'Flat Fee\', \'Percentage\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_UPSXML_RATES_HANDLING', '0', 'Handling fee for this shipping method.', '6', '16', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Currency Code', 'MODULE_SHIPPING_UPSXML_CURRENCY_CODE', '', 'Enter the 3 letter currency code for your country of origin. United States (USD)', '6', '2', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Insurance', 'MODULE_SHIPPING_UPSXML_INSURE', 'True', 'Do you want to insure packages shipped by UPS?', '6', '22', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_UPSXML_RATES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '17', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_UPSXML_RATES_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '18', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_UPSXML_RATES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '19', now())");
+        // add key for disallowed shipping methods
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Disallowed Shipping Methods', 'MODULE_SHIPPING_UPSXML_TYPES', '', 'Select the UPS services <span style=\'color: red; font-weight: bold\'>not</span> to be offered.', '6', '20', 'tep_cfg_select_multioption(array(\'Next Day Air\', \'2nd Day Air\', \'Ground\', \'Worldwide Express\', \'Worldwide Express Plus\', \'Worldwide Expedited\', \'Express\', \'Standard\', \'3 Day Select\', \'Next Day Air Saver\', \'Next Day Air Early A.M.\', \'Expedited\', \'2nd Day Air A.M.\', \'Saver\', \'Express Early A.M.\', \'Express Plus\'), ',  now())");
+        // add key for shipping delay
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('', 'Shipping Delay', 'SHIPPING_DAYS_DELAY', '1', 'How many days from when an order is placed to when you ship it (Decimals are allowed). Arrival date estimations are based on this value.', '6', '21', NULL, now(), NULL, NULL)");
+        // add key for enabling email error messages
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Email UPS errors', 'MODULE_SHIPPING_UPSXML_EMAIL_ERRORS', 'Yes', 'Do you want to receive UPS errors by email?', '6', '24', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now())");
+        // add key for time in transit view type
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Time in Transit View Type', 'MODULE_SHIPPING_UPSXML_RATES_TIME_IN_TRANSIT_VIEW', 'Raw', 'How the module should display the time in transit to the customer.', '6', '16', 'tep_cfg_select_option(array(\'Raw\', \'Detailed\'), ', now())");
+    }
+
+    //****************
+    function remove() {
+        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    //*************
+    function keys() {
+        // add MODULE_SHIPPING_UPSXML_TYPES to end of array for selectable shipping methods
+        return array('MODULE_SHIPPING_UPSXML_RATES_STATUS', 'MODULE_SHIPPING_UPSXML_RATES_ACCESS_KEY', 'MODULE_SHIPPING_UPSXML_RATES_USERNAME', 'MODULE_SHIPPING_UPSXML_RATES_PASSWORD', 'MODULE_SHIPPING_UPSXML_RATES_PICKUP_METHOD', 'MODULE_SHIPPING_UPSXML_RATES_PACKAGE_TYPE', 'MODULE_SHIPPING_UPSXML_RATES_CUSTOMER_CLASSIFICATION_CODE', 'MODULE_SHIPPING_UPSXML_RATES_ORIGIN', 'MODULE_SHIPPING_UPSXML_RATES_CITY', 'MODULE_SHIPPING_UPSXML_RATES_STATEPROV', 'MODULE_SHIPPING_UPSXML_RATES_COUNTRY', 'MODULE_SHIPPING_UPSXML_RATES_POSTALCODE', 'MODULE_SHIPPING_UPSXML_RATES_MODE', 'MODULE_SHIPPING_UPSXML_RATES_UNIT_WEIGHT', 'MODULE_SHIPPING_UPSXML_RATES_UNIT_LENGTH', 'MODULE_SHIPPING_UPSXML_DIMENSIONS_SUPPORT', 'MODULE_SHIPPING_UPSXML_RATES_QUOTE_TYPE', 'MODULE_SHIPPING_UPSXML_RATES_USE_NEGOTIATED_RATES', 'MODULE_SHIPPING_UPSXML_RATES_UPS_ACCOUNT_NUMBER', 'MODULE_SHIPPING_UPSXML_HANDLING_TYPE', 'MODULE_SHIPPING_UPSXML_RATES_HANDLING', 'MODULE_SHIPPING_UPSXML_INSURE', 'MODULE_SHIPPING_UPSXML_CURRENCY_CODE', 'MODULE_SHIPPING_UPSXML_RATES_TAX_CLASS', 'MODULE_SHIPPING_UPSXML_RATES_ZONE', 'MODULE_SHIPPING_UPSXML_RATES_SORT_ORDER', 'MODULE_SHIPPING_UPSXML_TYPES', 'SHIPPING_DAYS_DELAY', 'MODULE_SHIPPING_UPSXML_EMAIL_ERRORS', 'MODULE_SHIPPING_UPSXML_RATES_TIME_IN_TRANSIT_VIEW');
+    }
+
+    //***********************
+    function _upsProduct($prod){
+        $this->_upsProductCode = $prod;
+    }
+
+    //**********************************************
+    function _upsOrigin($city, $stateprov, $country, $postal){
+        $this->_upsOriginCity = $city;
+        $this->_upsOriginStateProv = $stateprov;
+        $this->_upsOriginCountryCode = $country;
+        $postal = str_replace(' ', '', $postal);
+        if ($country == 'US') {
+            $this->_upsOriginPostalCode = substr($postal, 0, 5);
+        } else {
+            $this->_upsOriginPostalCode = $postal;
+        }
+    }
+
+    //**********************************************
+    function _upsDest($city, $stateprov, $country, $postal) {
+        $this->_upsDestCity = $city;
+        $this->_upsDestStateProv = $stateprov;
+        $this->_upsDestCountryCode = $country;
+        $postal = str_replace(' ', '', $postal);
+        if ($country == 'US') {
+            $this->_upsDestPostalCode = substr($postal, 0, 5);
+        } else {
+            $this->_upsDestPostalCode = $postal;
+        }
+    }
+
+    //************************
+    function _upsAction($action) {
+        // rate - Single Quote; shop - All Available Quotes
+        $this->_upsActionCode = $action;
+    }
+
+    //********************************************
+		// default value of 100 added for insurance (100 shouldn't trigger costs for insurance)
+    function _addItem($length, $width, $height, $weight, $price = 0 ) {
+        // Add box or item to shipment list. Round weights to 1 decimal places.
+        if ((float)$weight < 1.0) {
+            $weight = 1;
+        } else {
+            $weight = round($weight, 1);
+        }
+        $index = $this->items_qty;
+        $this->item_length[$index] = ($length ? (string)$length : '0' );
+        $this->item_width[$index] = ($width ? (string)$width : '0' );
+        $this->item_height[$index] = ($height ? (string)$height : '0' );
+        $this->item_weight[$index] = ($weight ? (string)$weight : '0' );
+				$this->item_price[$index] = $price;
+        $this->items_qty++;
+    }
+
+    //********************
+    function getPackagesByVol() {
+        $packages = array();
+        $packages_query = tep_db_query("select *, (package_length * package_width * package_height) as volume from " . TABLE_PACKAGING . " order by volume;");
+				$counter = 0;
+        while ($package = tep_db_fetch_array($packages_query)) {
+            $packages[] = array(
+            'id' => $package['package_id'],
+            'name' => $package['package_name'],
+            'description' => $package['package_description'],
+            'length' => $package['package_length'],
+            'width' => $package['package_width'],
+            'height' => $package['package_height'],
+            'empty_weight' => $package['package_empty_weight'],
+            'max_weight' => $package['package_max_weight'],
+            'volume' => $package['volume']);
+// sort dimensions from low to high, used in the function fitsInBox
+            $dimensions = array($package['package_length'], $package['package_width'], $package['package_height']);
+            sort($dimensions);
+						foreach($dimensions as $key => $value) {
+							if ($key == 0 ) { $packages[$counter]['x'] = $value; }
+							if ($key == 1 ) { $packages[$counter]['y'] = $value; }
+							if ($key == 2 ) { $packages[$counter]['z'] = $value; }
+						}
+						$counter++;
+        }
+        return $packages;
+    }
+
+    //********************************
+    function packProducts($productsArray) {
+        $definedPackages = $this->getPackagesByVol();
+		/*		echo '<pre>';
+				print_r($definedPackages);
+				exit; */
+        $emptyBoxesArray = array();
+        for ($i = 0; $i < count($definedPackages); $i++) {
+            $definedBox = $definedPackages[$i];
+            $definedBox['remaining_volume'] = $definedBox['volume'];
+            $definedBox['current_weight'] = $definedBox['empty_weight'];
+            $emptyBoxesArray[] = $definedBox;
+        }
+          if (count($emptyBoxesArray) == 0) {
+             print("ERROR: No boxes to ship unpackaged product<br />\n");
+             break;
+          }
+
+        $packedBoxesArray = array();
+        $currentBox = NULL;
+        $index_of_largest_box = count($emptyBoxesArray)-1;
+        // Get the product array and expand multiple qty items.
+        $productsRemaining = array();
+        for ($i = 0; $i < count($productsArray); $i++) {
+            $product = $productsArray[$i];
+            // sanity checks on the product, should not be done for ready-to-ship times
+            if ($product['ready_to_ship'] == '0') {
+						  $product['ready_to_ship'] = '1';
+						  for ($x = 0; $x <= $index_of_largest_box; $x++) {
+							  if ($this->fitsInBox($product, $emptyBoxesArray[$x])) {
+                  $product['ready_to_ship'] = '0';
+                  $product['largest_box_it_will_fit'] = $x;
+                } 
+						  } // end for ($x = 0; $x <= $index_of_largest_box; $x++) 
+            } // end if ($product['ready_to_ship'] == '0')
+            
+            for ($j = 0; $j < $productsArray[$i]['quantity']; $j++) {
+                $productsRemaining[] = $product;
+            }
+        } // end for ($i = 0; $i < count($productsArray); $i++)
+        // make sure the products that did not fit the largest box and are now set as ready-to-ship
+        // are out of the way as soon as possible
+        usort($productsRemaining, ready_to_shipCmp);
+        // Worst case, you'll need as many boxes as products ordered.
+        while (count($productsRemaining)) {
+            // Immediately set aside products that are already packed and ready.
+            if ($productsRemaining[0]['ready_to_ship'] == '1') {
+                $packedBoxesArray[] = array (
+                'length' => $productsRemaining[0]['length'],
+                'width' => $productsRemaining[0]['width'],
+                'height' => $productsRemaining[0]['height'],
+                'current_weight' => $productsRemaining[0]['weight'],
+								'price' => $productsRemaining[0]['final_price']);
+                $productsRemaining = array_slice($productsRemaining, 1);
+                continue;
+            }
+            //Cycle through boxes, increasing box size if all doesn't fit.
+            for ($b = 0; $b < count($emptyBoxesArray) && tep_not_null($productsRemaining); $b++) {
+                $result = $this->fitProductsInBox($productsRemaining, $emptyBoxesArray[$b], $packedBoxesArray, $b, count($emptyBoxesArray) -1 );
+                $packedBoxesArray = $result['packed_boxes'];
+                $productsRemaining = $result['remaining'];
+            }
+        } // end while
+
+        return $packedBoxesArray;
+    }
+
+    //*****************************
+    function fitsInBox($product, $box) {
+        // in case by accident or by choice length, width or height is not set
+        // we will estimate it by using a set density and the product['weight'] variable
+        // will only be used in the check for whether it fits the largest box
+        // after that it will already be set, if product['weight'] is set at least
+				if ($product['x'] > $box['x'] || $product['y'] > $box['y'] || $product['z'] > $box['z']) {
+            return false;
+        } 
+
+        if ($product['volume'] <= $box['remaining_volume']) {
+            if ($box['max_weight'] == 0 || ($box['current_weight'] + $product['weight'] <= $box['max_weight'])) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    //***********************************
+    function putProductInBox($product, $box) {
+        $box['remaining_volume'] -= $product['volume'];
+        $box['products'][] = $product;
+        $box['current_weight'] += $product['weight'];
+				$box['price'] += $product['final_price'];
+        return $box;
+    } 
+    //*********************    
+    function fitProductsInBox($productsRemaining, $emptyBox, $packedBoxesArray, $box_no, $index_of_largest_box) { 
+        $currentBox = $emptyBox;
+        $productsRemainingSkipped = array();
+        $productsRemainingNotSkipped = array();
+        // keep apart products that will not fit this box anyway
+        for ($p = 0; $p < count($productsRemaining); $p++) {
+          if ($productsRemaining[$p]['largest_box_it_will_fit'] < $box_no) {
+            $productsRemainingSkipped[] = $productsRemaining[$p];
+          } else {
+            $productsRemainingNotSkipped[] = $productsRemaining[$p];
+          }
+        }
+        unset($productsRemaining);
+        $productsRemaining = $productsRemainingNotSkipped;
+        unset($productsRemainingNotSkipped);
+        if (count($productsRemaining) == 0) {
+          // products remaining are the ones that will not fit this box (productsRemaimingSkipped)
+            $result_array = array('remaining' => $productsRemainingSkipped, 'box_no' => $box_no, 'packed_boxes' => $packedBoxesArray);
+            return ($result_array);
+        }
+
+        //Try to fit each product that can fit in box
+        for ($p = 0; $p < count($productsRemaining); $p++) {
+            if ($this->fitsInBox($productsRemaining[$p], $currentBox)) {
+                //It fits. Put it in the box.
+                $currentBox = $this->putProductInBox($productsRemaining[$p], $currentBox);
+                if ($p == count($productsRemaining) - 1) {
+                    $packedBoxesArray[] = $currentBox;
+                    $productsRemaining = array_slice($productsRemaining, $p + 1);
+                    $productsRemaining = array_merge($productsRemaining, $productsRemainingSkipped);
+
+                    $result_array = array('remaining' => $productsRemaining, 'box_no' => $box_no, 'packed_boxes' => $packedBoxesArray);
+                    return ($result_array);
+                }
+            } else {
+                if ($box_no == $index_of_largest_box) {
+                    //We're at the largest box already, and it's full. Keep what we've packed so far and get another box.
+                    $packedBoxesArray[] = $currentBox;
+                    $productsRemaining = array_slice($productsRemaining, $p);
+                    $productsRemaining = array_merge($productsRemaining, $productsRemainingSkipped);
+                    $result_array = array('remaining' => $productsRemaining, 'box_no' => $box_no, 'packed_boxes' => $packedBoxesArray);
+                    return ($result_array);
+                }
+                // Not all of them fit. Stop packing remaining products and try next box.
+                $productsRemaining = array_merge($productsRemaining, $productsRemainingSkipped);
+                $result_array = array('remaining' => $productsRemaining, 'box_no' => $box_no, 'packed_boxes' => $packedBoxesArray);
+                return ($result_array);
+            } // end else
+        } // end for ($p = 0; $p < count($productsRemaining); $p++)
+    } // end function
+
+    //*********************
+    function _upsGetQuote() {
+
+        // Create the access request
+        $accessRequestHeader =
+        "<?xml version=\"1.0\"?>\n".
+        "<AccessRequest xml:lang=\"en-US\">\n".
+        "   <AccessLicenseNumber>". $this->access_key ."</AccessLicenseNumber>\n".
+        "   <UserId>". $this->access_username ."</UserId>\n".
+        "   <Password>". $this->access_password ."</Password>\n".
+        "</AccessRequest>\n";
+
+        $ratingServiceSelectionRequestHeader =
+        "<?xml version=\"1.0\"?>\n".
+        "<RatingServiceSelectionRequest xml:lang=\"en-US\">\n".
+        "   <Request>\n".
+        "       <TransactionReference>\n".
+        "           <CustomerContext>Rating and Service</CustomerContext>\n".
+        "           <XpciVersion>". $this->xpci_version ."</XpciVersion>\n".
+        "       </TransactionReference>\n".
+        "       <RequestAction>Rate</RequestAction>\n".
+        "       <RequestOption>shop</RequestOption>\n".
+        "   </Request>\n";
+        // according to UPS the CustomerClassification and PickupType containers should
+        // not be present when the origin country is non-US see:
+        // http://forums.oscommerce.com/index.php?s=&showtopic=49382&view=findpost&p=730947
+        if ($this->origin_country == 'US') {
+        $ratingServiceSelectionRequestHeader .=
+        "   <PickupType>\n".
+        "       <Code>". $this->pickup_methods[$this->pickup_method] ."</Code>\n".
+        "   </PickupType>\n";
+        "   <CustomerClassification>\n".
+        "       <Code>". $this->customer_classification ."</Code>\n".
+        "   </CustomerClassification>\n";
+        }
+        $ratingServiceSelectionRequestHeader .=
+        "   <Shipment>\n".
+        "       <Shipper>\n";
+        if ($this->use_negotiated_rates == 'True') {
+        $ratingServiceSelectionRequestHeader .=
+        "         <ShipperNumber>" . $this->access_account_number . "</ShipperNumber>\n";
+				}
+        $ratingServiceSelectionRequestHeader .=
+        "           <Address>\n".
+        "               <City>". $this->_upsOriginCity ."</City>\n".
+        "               <StateProvinceCode>". $this->_upsOriginStateProv ."</StateProvinceCode>\n".
+        "               <CountryCode>". $this->_upsOriginCountryCode ."</CountryCode>\n".
+        "               <PostalCode>". $this->_upsOriginPostalCode ."</PostalCode>\n".
+        "           </Address>\n".
+        "       </Shipper>\n".
+        "       <ShipTo>\n".
+        "           <Address>\n".
+        "               <City>". $this->_upsDestCity ."</City>\n".
+        "               <StateProvinceCode>". $this->_upsDestStateProv ."</StateProvinceCode>\n".
+        "               <CountryCode>". $this->_upsDestCountryCode ."</CountryCode>\n".
+        "               <PostalCode>". $this->_upsDestPostalCode ."</PostalCode>\n".
+        ($this->quote_type == "Residential" ? "<ResidentialAddressIndicator/>\n" : "") .
+        "           </Address>\n".
+        "       </ShipTo>\n";
+        for ($i = 0; $i < $this->items_qty; $i++) {
+
+            $ratingServiceSelectionRequestPackageContent .=
+            "       <Package>\n".
+            "           <PackagingType>\n".
+            "               <Code>". $this->package_types[$this->package_type] ."</Code>\n".
+            "           </PackagingType>\n";
+            if ($this->dimensions_support > 0 && ($this->item_length[$i] > 0 ) && ($this->item_width[$i] > 0 ) && ($this->item_height[$i] > 0)) {
+
+                $ratingServiceSelectionRequestPackageContent .=
+                "           <Dimensions>\n".
+                "               <UnitOfMeasurement>\n".
+                "                   <Code>". $this->unit_length ."</Code>\n".
+                "               </UnitOfMeasurement>\n".
+                "               <Length>". $this->item_length[$i] ."</Length>\n".
+                "               <Width>". $this->item_width[$i] ."</Width>\n".
+                "               <Height>". $this->item_height[$i] ."</Height>\n".
+                "           </Dimensions>\n";
+            }
+
+            $ratingServiceSelectionRequestPackageContent .=
+            "           <PackageWeight>\n".
+            "               <UnitOfMeasurement>\n".
+            "                   <Code>". $this->unit_weight ."</Code>\n".
+            "               </UnitOfMeasurement>\n".
+            "               <Weight>". $this->item_weight[$i] ."</Weight>\n".
+            "           </PackageWeight>\n".
+            "           <PackageServiceOptions>\n".
+            //"               <COD>\n".
+            //"                   <CODFundsCode>0</CODFundsCode>\n".
+            //"                   <CODCode>3</CODCode>\n".
+            //"                   <CODAmount>\n".
+            //"                       <CurrencyCode>USD</CurrencyCode>\n".
+            //"                       <MonetaryValue>1000</MonetaryValue>\n".
+            //"                   </CODAmount>\n".
+            //"               </COD>\n".
+            "               <InsuredValue>\n".
+            "                   <CurrencyCode>".MODULE_SHIPPING_UPSXML_CURRENCY_CODE."</CurrencyCode>\n".
+            "                   <MonetaryValue>".$this->item_price[$i]."</MonetaryValue>\n".
+            "               </InsuredValue>\n".
+            "           </PackageServiceOptions>\n".
+            "       </Package>\n";
+        }
+
+        $ratingServiceSelectionRequestFooter = '';
+        //"   <ShipmentServiceOptions/>\n".
+           if ($this->use_negotiated_rates == 'True') {
+        $ratingServiceSelectionRequestFooter .=
+            "       <RateInformation>\n".
+            "         <NegotiatedRatesIndicator/>\n".
+            "       </RateInformation>\n";
+           }
+        $ratingServiceSelectionRequestFooter .=
+        "   </Shipment>\n";
+        // according to UPS the CustomerClassification and PickupType containers should
+        // not be present when the origin country is non-US see:
+        // http://forums.oscommerce.com/index.php?s=&showtopic=49382&view=findpost&p=730947
+        if ($this->origin_country == 'US') {
+        $ratingServiceSelectionRequestFooter .=
+              "   <CustomerClassification>\n".
+              "       <Code>". $this->customer_classification ."</Code>\n".
+              "   </CustomerClassification>\n";
+        }
+        $ratingServiceSelectionRequestFooter .=
+        "</RatingServiceSelectionRequest>\n";
+
+        $xmlRequest = $accessRequestHeader .
+        $ratingServiceSelectionRequestHeader .
+        $ratingServiceSelectionRequestPackageContent .
+        $ratingServiceSelectionRequestFooter;
+
+        //post request $strXML;
+        $xmlResult = $this->_post($this->protocol, $this->host, $this->port, $this->path, $this->version, $this->timeout, $xmlRequest);
+        // BOF testing with a response from UPS saved as a text file
+        // needs commenting out the line above: $xmlResult = $this->_post($this->protocol, etcetera
+/*        $filename = '/Library/WebServer/Documents/nytest/includes/modules/shipping/example_response.xml';
+        $fp = fopen($filename, "r") or die("couldn't open file");
+        $xmlResult = "";
+        while (! feof($fp)) {
+          $xmlResult .= fgets($fp, 1024);
+        } 
+        // EOF testing with a text file */
+        return $this->_parseResult($xmlResult);
+    }
+
+    //******************************************************************
+    function _post($protocol, $host, $port, $path, $version, $timeout, $xmlRequest) {
+        $url = $protocol."://".$host.":".$port.$path;
+        if ($this->logfile) {
+            error_log("------------------------------------------\n", 3, $this->logfile);
+            error_log("DATE AND TIME: ".date('Y-m-d H:i:s')."\n", 3, $this->logfile);
+            error_log("UPS URL: " . $url . "\n", 3, $this->logfile);
+        }
+        if (function_exists('exec') && $this->use_exec == '1' ) {
+            exec('which curl', $curl_output);
+            if ($curl_output) {
+                $curl_path = $curl_output[0];
+            } else {
+                $curl_path = 'curl'; // change this if necessary
+            }
+            if ($this->logfile) {
+                error_log("UPS REQUEST using exec(): " . $xmlRequest . "\n", 3, $this->logfile);
+            }
+            // add option -k to the statement: $command = "".$curl_path." -k -d \"". etcetera if you get
+            // curl error 60: error setting certificate verify locations
+            // using addslashes was the only way to avoid UPS returning the 1001 error: The XML document is not well formed
+            $command = "".$curl_path." -d \"".addslashes($xmlRequest)."\" ".$url."";
+            exec($command, $xmlResponse);
+            if ( empty($xmlResponse) && $this->logfile) { // using exec no curl errors can be retrieved
+                error_log("Error from cURL using exec() since there is no \$xmlResponse\n", 3, $this->logfile);
+            }
+            if ($this->logfile) {
+                error_log("UPS RESPONSE using exec(): " . $xmlResponse[0] . "\n", 3, $this->logfile);
+            }
+        } elseif ($this->use_exec == '1') { // if NOT (function_exists('exec') && $this->use_exec == '1'
+            if ($this->logfile) {
+                error_log("Sorry, exec() cannot be called\n", 3, $this->logfile);
+            }
+        } else { // default behavior: cURL is assumed to be compiled in PHP
+            $ch = curl_init();
+            curl_setopt($ch, CURLOPT_URL, $url);
+            // uncomment the next line if you get curl error 60: error setting certificate verify locations
+            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+            // uncommenting the next line is most likely not necessary in case of error 60
+            // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+            curl_setopt($ch, CURLOPT_HEADER, 0);
+            curl_setopt($ch, CURLOPT_POST, 1);
+            curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
+            curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);
+
+            if ($this->logfile) {
+                error_log("UPS REQUEST: " . $xmlRequest . "\n", 3, $this->logfile);
+            }
+            $xmlResponse = curl_exec ($ch);
+            if (curl_errno($ch) && $this->logfile) {
+                $error_from_curl = sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch));
+                error_log("Error from cURL: " . $error_from_curl . "\n", 3, $this->logfile);
+            }
+            // send email if enabled in the admin section
+            if (curl_errno($ch) && $this->email_errors) {
+                $error_from_curl = sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch));
+                error_log("Error from cURL: " . $error_from_curl . " experienced by customer with id " . $_SESSION['customer_id'] . " on " . date('Y-m-d H:i:s'), 1, STORE_OWNER_EMAIL_ADDRESS);
+            }
+            // log errors to file ups_error.log when set
+            if (curl_errno($ch) && $this->ups_error_file) {
+                $error_from_curl = sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch));
+                error_log(date('Y-m-d H:i:s')."\tcURL\t" . $error_from_curl . "\t" . $_SESSION['customer_id']."\n", 3, $this->ups_error_file);    
+            }
+            if ($this->logfile) {
+                error_log("UPS RESPONSE: " . $xmlResponse . "\n", 3, $this->logfile);
+            }
+            curl_close ($ch);
+        }
+
+        if(!$xmlResponse || strstr(strtolower(substr($xmlResponse, 0, 120)), "bad request"))  {
+            /* Sometimes the UPS server responds with an HTML message (differing depending on whether the test server
+               or the production server is used) but both have in the title tag "Bad request".
+               Parsing this response will result in a fatal error:
+               Call to a member function on a non-object in /blabla/includes/classes/xmldocument.php on line 57
+               It only results in not showing Estimated Delivery Dates to the customer so avoiding the fatal error should do.
+            */
+            $xmlResponse = "<?xml version=\"1.0\"?>\n".
+            "<RatingServiceSelectionResponse>\n".
+            "   <Response>\n".
+            "       <TransactionReference>\n".
+            "           <CustomerContext>Rating and Service</CustomerContext>\n".
+            "           <XpciVersion>1.0001</XpciVersion>\n".
+            "       </TransactionReference>\n".
+            "       <ResponseStatusCode>0</ResponseStatusCode>\n".
+            "       <ResponseStatusDescription>". MODULE_SHIPPING_UPSXML_RATES_TEXT_COMM_UNKNOWN_ERROR ."</ResponseStatusDescription>\n".
+            "   </Response>\n".
+            "</RatingServiceSelectionResponse>\n";
+            return $xmlResponse;
+        }
+        if ($this->use_exec == '1') {
+            return $xmlResponse[0]; // $xmlResponse is an array in this case
+        } else {
+            return $xmlResponse;
+        }
+    }
+
+    //*****************************
+    function _parseResult($xmlResult) {
+        // Parse XML message returned by the UPS post server.
+        $doc = new XMLDocument();
+        $xp = new XMLParser();
+        $xp->setDocument($doc);
+        $xp->parse($xmlResult);
+        $doc = $xp->getDocument();
+        // Get version. Must be xpci version 1.0001 or this might not work.
+        $responseVersion = $doc->getValueByPath('RatingServiceSelectionResponse/Response/TransactionReference/XpciVersion');
+        if ($this->xpci_version != $responseVersion) {
+            $message = MODULE_SHIPPING_UPSXML_RATES_TEXT_COMM_VERSION_ERROR;
+            return $message;
+        }
+        // Get response code. 1 = SUCCESS, 0 = FAIL
+        $responseStatusCode = $doc->getValueByPath('RatingServiceSelectionResponse/Response/ResponseStatusCode');
+
+        if ($responseStatusCode != '1') {
+            $errorMsg = $doc->getValueByPath('RatingServiceSelectionResponse/Response/Error/ErrorCode');
+            $errorMsg .= ": ";
+            $errorMsg .= $doc->getValueByPath('RatingServiceSelectionResponse/Response/Error/ErrorDescription');
+            // send email if enabled in the admin section
+            if ($this->email_errors) {
+                error_log("UPSXML Rates Error: " . $errorMsg . " experienced by customer with id " . $_SESSION['customer_id'] . " on " . date('Y-m-d H:i:s'), 1, STORE_OWNER_EMAIL_ADDRESS);
+            }
+            // log errors to file ups_error.log when set
+            if ($this->ups_error_file) {
+                error_log(date('Y-m-d H:i:s')."\tRates\t" . $errorMsg . "\t" . $_SESSION['customer_id']."\n", 3, $this->ups_error_file);    
+            }
+                return $errorMsg;
+        }
+        $root = $doc->getRoot();
+        $ratedShipments = $root->getElementsByName("RatedShipment");
+        $aryProducts = false;
+        for ($i = 0; $i < count($ratedShipments); $i++) {
+            $serviceCode = $ratedShipments[$i]->getValueByPath("/Service/Code");
+						if ($this->use_negotiated_rates == 'True') {
+							$totalCharge = $ratedShipments[$i]->getValueByPath("/NegotiatedRates/NetSummaryCharges/GrandTotal/MonetaryValue");
+							$currency = $ratedShipments[$i]->getValueByPath("/NegotiatedRates/NetSummaryCharges/GrandTotal/CurrencyCode");
+							             
+				              if ($currency != DEFAULT_CURRENCY) {
+					              $curobj = new currencies();
+					              if (!$mon_value = $curobj->get_value($currency)) {
+					              	$mon_value = 0;
+					              	$totalCharge = 'Conversion Error';
+					              } else {
+					              	$def_currency = new currencies();
+									$totalCharge = number_format($totalCharge / $mon_value,2,$def_currency->get_decimal_point(DEFAULT_CURRENCY),$def_currency->get_thousands_point(DEFAULT_CURRENCY));
+					              }
+				              }
+
+							
+                if (!($serviceCode && $totalCharge)) {
+                continue;
+                }
+						} else {
+							
+              $totalCharge = $ratedShipments[$i]->getValueByPath("/TotalCharges/MonetaryValue");
+              $currency = $ratedShipments[$i]->getValueByPath("/TotalCharges/CurrencyCode");              
+              
+              if ($currency != DEFAULT_CURRENCY) {
+	              $curobj = new currencies();
+	              if (!$mon_value = $curobj->get_value($currency)) {
+	              	$mon_value = 0;
+	              	$totalCharge = 'Conversion Error';
+	              } else {
+	              	$def_currency = new currencies();
+					$totalCharge = number_format($totalCharge / $mon_value,2,$def_currency->get_decimal_point(DEFAULT_CURRENCY),$def_currency->get_thousands_point(DEFAULT_CURRENCY));
+	              }
+              }
+
+                if (!($serviceCode && $totalCharge)) {
+                continue;
+                }
+						}
+            $ratedPackages = $ratedShipments[$i]->getElementsByName("RatedPackage");
+            $this->boxCount = count($ratedPackages);
+            $gdaysToDelivery = $ratedShipments[$i]->getValueByPath("/GuaranteedDaysToDelivery");
+            $scheduledTime = $ratedShipments[$i]->getValueByPath("/ScheduledDeliveryTime");
+            $title = '';
+            $title = $this->service_codes[$this->origin][$serviceCode];
+
+            /* we don't want to use this, it may conflict with time estimation
+                  if ($gdaysToDelivery) {
+                      $title .= ' (';
+                      $title .= $gdaysToDelivery . " Business Days";
+                      if ($scheduledTime) {
+                          $title .= ' @ ' . $scheduledTime;
+                      }
+                      $title .= ')';
+                  } elseif ($this->timeintransit > 0) {
+                      $title .= ' (';
+                      $title .= $this->timeintransit . " Business Days";
+                      $title .= ')';
+                  }
+            */
+            $aryProducts[$i] = array($title => $totalCharge);
+        }
+        return $aryProducts;
+    }
+
+    // BOF Time In Transit
+    
+    // GM 11-15-2004: renamed from _upsGetTime()
+
+    //********************
+    function _upsGetTimeServices() {
+
+        if (defined('SHIPPING_DAYS_DELAY')) {
+            $shipdate = date("Ymd", $this->today_unix_time + (86400*SHIPPING_DAYS_DELAY));
+            $day_of_the_week = date ("w", $this->today_unix_time + (86400*SHIPPING_DAYS_DELAY) ) ;
+            if ($day_of_the_week == "0" || $day_of_the_week == "7") { // order supposed to leave on Sunday
+                $shipdate = date("Ymd", $this->today_unix_time + (86400*SHIPPING_DAYS_DELAY) + 86400);
+            } elseif ($day_of_the_week == "6") { // order supposed to leave on Saturday
+                $shipdate = date("Ymd", $this->today_unix_time + (86400*SHIPPING_DAYS_DELAY) + 172800);
+            } 
+        } else {
+            $shipdate = $this->today;
+        }
+
+        // Create the access request
+        $accessRequestHeader =
+        "<?xml version=\"1.0\"?>\n".
+        "<AccessRequest xml:lang=\"en-US\">\n".
+        "   <AccessLicenseNumber>". $this->access_key ."</AccessLicenseNumber>\n".
+        "   <UserId>". $this->access_username ."</UserId>\n".
+        "   <Password>". $this->access_password ."</Password>\n".
+        "</AccessRequest>\n";
+
+        $timeintransitSelectionRequestHeader =
+        "<?xml version=\"1.0\"?>\n".
+        "<TimeInTransitRequest xml:lang=\"en-US\">\n".
+        "   <Request>\n".
+        "       <TransactionReference>\n".
+        "           <CustomerContext>Time in Transit</CustomerContext>\n".
+        "           <XpciVersion>". $this->transitxpci_version ."</XpciVersion>\n".
+        "       </TransactionReference>\n".
+        "       <RequestAction>TimeInTransit</RequestAction>\n".
+        "   </Request>\n".
+        "   <TransitFrom>\n".
+        "       <AddressArtifactFormat>\n".
+        "           <PoliticalDivision2>". $this->origin_city ."</PoliticalDivision2>\n".
+        "           <PoliticalDivision1>". $this->origin_stateprov ."</PoliticalDivision1>\n".
+        "           <CountryCode>". $this->_upsOriginCountryCode ."</CountryCode>\n".
+        "           <PostcodePrimaryLow>". $this->origin_postalcode ."</PostcodePrimaryLow>\n".
+        "       </AddressArtifactFormat>\n".
+        "   </TransitFrom>\n".
+        "   <TransitTo>\n".
+        "       <AddressArtifactFormat>\n".
+        "           <PoliticalDivision2>". $this->_upsDestCity ."</PoliticalDivision2>\n".
+        "           <PoliticalDivision1>". $this->_upsDestStateProv ."</PoliticalDivision1>\n".
+        "           <CountryCode>". $this->_upsDestCountryCode ."</CountryCode>\n".
+        "           <PostcodePrimaryLow>". $this->_upsDestPostalCode ."</PostcodePrimaryLow>\n".
+        "           <PostcodePrimaryHigh>". $this->_upsDestPostalCode ."</PostcodePrimaryHigh>\n".
+        "       </AddressArtifactFormat>\n".
+        "   </TransitTo>\n".
+        "   <ShipmentWeight>\n".
+        "       <UnitOfMeasurement>\n".
+        "           <Code>" . $this->unit_weight . "</Code>\n".
+        "       </UnitOfMeasurement>\n".
+        "       <Weight>" . $this->weight_for_timeintransit . "</Weight>\n".
+        "   </ShipmentWeight>\n".
+        "   <InvoiceLineTotal>\n".
+        "       <CurrencyCode>" . MODULE_SHIPPING_UPSXML_CURRENCY_CODE . "</CurrencyCode>\n".
+        "       <MonetaryValue>" . $this->pkgvalue . "</MonetaryValue>\n".
+        "   </InvoiceLineTotal>\n".
+        "   <PickupDate>" . $shipdate . "</PickupDate>\n".
+        "</TimeInTransitRequest>\n";
+
+        $xmlTransitRequest = $accessRequestHeader .
+        $timeintransitSelectionRequestHeader;
+
+        //post request $strXML;
+        $xmlTransitResult = $this->_post($this->protocol, $this->host, $this->port, $this->transitpath, $this->transitversion, $this->timeout, $xmlTransitRequest);
+        return $this->_transitparseResult($xmlTransitResult);
+    }
+
+    //***************************************
+    
+    // GM 11-15-2004: modified to return array with time for each service, as
+    //                opposed to single transit time for hardcoded "GND" code
+
+    function _transitparseResult($xmlTransitResult) {
+         $transitTime = array();
+
+        // Parse XML message returned by the UPS post server.
+        $doc = new XMLDocument();
+        $xp = new XMLParser();
+        $xp->setDocument($doc);
+        $xp->parse($xmlTransitResult);
+        $doc = $xp->getDocument();
+        // Get version. Must be xpci version 1.0001 or this might not work.
+        // 1.0001 and 1.0002 seem to be very similar, forget about this for the moment
+        /*        $responseVersion = $doc->getValueByPath('TimeInTransitResponse/Response/TransactionReference/XpciVersion');
+        if ($this->transitxpci_version != $responseVersion) {
+            $message = MODULE_SHIPPING_UPSXML_RATES_TEXT_COMM_VERSION_ERROR;
+            return $message;
+        } */
+        // Get response code. 1 = SUCCESS, 0 = FAIL
+        $responseStatusCode = $doc->getValueByPath('TimeInTransitResponse/Response/ResponseStatusCode');
+        if ($responseStatusCode != '1') {
+            $errorMsg = $doc->getValueByPath('TimeInTransitResponse/Response/Error/ErrorCode');
+            $errorMsg .= ": ";
+            $errorMsg .= $doc->getValueByPath('TimeInTransitResponse/Response/Error/ErrorDescription');
+            // send email if enabled in the admin section
+            if ($this->email_errors) {
+                error_log("UPSXML TimeInTransit Error: " . $errorMsg . " experienced by customer with id " . $_SESSION['customer_id'] . " on " . date('Y-m-d H:i:s'), 1, STORE_OWNER_EMAIL_ADDRESS);
+            }
+            // log errors to file ups_error.log when set
+            if ($this->ups_error_file) {
+                error_log(date('Y-m-d H:i:s')."\tTimeInTransit\t" . $errorMsg . "\t" . $_SESSION['customer_id'] ."\n", 3, $this->ups_error_file);    
+            }
+            return $errorMsg;
+        }
+        $root = $doc->getRoot();
+        $rootChildren = $root->getChildren();
+        for ($r = 0; $r < count($rootChildren); $r++) {
+            $elementName = $rootChildren[$r]->getName();
+            if ($elementName == "TransitResponse") {
+                $transitResponse = $root->getElementsByName("TransitResponse");
+                $serviceSummary = $transitResponse['0']->getElementsByName("ServiceSummary");
+                $this->numberServices = count($serviceSummary);
+                for ($s = 0; $s < $this->numberServices ; $s++) {
+                    // index by Desc because that's all we can relate back to the service with
+                    // (though it can probably return the code as well..)
+                    $serviceDesc = $serviceSummary[$s]->getValueByPath("Service/Description");
+                    $transitTime[$serviceDesc]["days"] = $serviceSummary[$s]->getValueByPath("EstimatedArrival/BusinessTransitDays");
+                    $transitTime[$serviceDesc]["date"] = $serviceSummary[$s]->getValueByPath("EstimatedArrival/Date");
+                    $transitTime[$serviceDesc]["guaranteed"] = $serviceSummary[$s]->getValueByPath("Guaranteed/Code");
+                }
+            }
+        }
+        if ($this->logfile) {
+            error_log("------------------------------------------\n", 3, $this->logfile);
+            foreach($transitTime as $desc => $time) {
+                error_log("Business Transit: " . $desc ." = ". $time["date"] . "\n", 3, $this->logfile);
+            }
+        }
+        return $transitTime;
+    }
+
+    //EOF Time In Transit
+ //  ***************************
+  function exclude_choices($type) {
+    // used for exclusion of UPS shipping options, disallowed types are read from db
+    $disallowed_types = explode(",", MODULE_SHIPPING_UPSXML_TYPES);
+    if (strstr($type, "UPS")) {
+        // this will chop off "UPS" from the beginning of the line - typically something like UPS Next Day Air (1 Business Days)
+        $type_minus_ups = explode("UPS", $type );
+        $type_root = trim($type_minus_ups[1]);
+    } // end if (strstr($type, "UPS"):
+    else { // service description does not contain UPS (unlikely)
+        $type_root = trim($type);
+    }
+    for ($za = 0; $za < count ($disallowed_types); $za++ ) {
+        if ($type_root == trim($disallowed_types[$za])) {
+            return true;
+            exit;
+        } // end if ($type_root == $disallowed_types[$za] ...
+    }
+    // if the type is not disallowed:
+    return false;
+  }
+
+  function more_dimensions_to_productsArray($productsArray) {
+	$counter = 0;
+	  foreach ($productsArray as $key => $product) {
+        // in case by accident or by choice length, width or height is not set
+        // we will estimate it by using a set density and the product['weight'] variable
+        // will only be used in the check for whether it fits the largest box
+        // after that it will already be set, if product['weight'] is set at least
+        if ($product['length'] == 0 || $product['width'] == 0 || $product['height'] == 0) {
+            $density = 0.7;
+            if ($this->unit_length == 'CM') {
+                $product['length']=$product['width']=$product['height']= round(10*(pow($product['weight']/$density, 1/3)),1);
+            } else {
+                // non-metric: inches and pounds
+                $product['length']=$product['width']=$product['height']= round(pow($product['weight']*27.67/$density, 1/3),1);
+            }
+        } // end if ($product['length'] == 0 || $product['width'] == 0 etc.
+				// sort dimensions from low to high, used in the function fitsInBox
+				   $dimensions = array($product['length'], $product['width'], $product['height']);
+            sort($dimensions);
+						foreach($dimensions as $key => $value) {
+							if ($key == 0 ) { $productsArray[$counter]['x'] = $value; }
+							if ($key == 1 ) { $productsArray[$counter]['y'] = $value; }
+							if ($key == 2 ) { $productsArray[$counter]['z'] = $value; }
+						}
+        $productsArray[$counter]['volume'] = $product['length'] * $product['width'] * $product['height'];
+				$counter++;
+	  } // end foreach ($productsArray as $key => $product)
+	
+	return($productsArray);
+  }
+
+} // end class upsxml
+// ******************************
+function ready_to_shipCmp( $a, $b) {
+    if ( $a['ready_to_ship'] == $b['ready_to_ship'] )
+    return 0;
+    if ( $a['ready_to_ship'] > $b['ready_to_ship'] )
+    return -1;
+    return 1;
+}
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/usps.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/usps.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/usps.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,636 @@
+<?php
+/*
+  $Id: usps.php,v 1.1.1.1 2004/03/04 23:41:25 ccwjr Exp $
+  ++++ modified as USPS Methods 2.6 11/02/03 by Brad Waite and Fritz Clapp ++++
+  ++++ incorporating USPS revisions to service names ++++
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class usps {
+    var $code, $title, $description, $icon, $enabled, $countries;
+
+// class constructor
+    function usps() {
+      global $order;
+
+      $this->code = 'usps';
+      $this->title = MODULE_SHIPPING_USPS_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_USPS_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_USPS_SORT_ORDER;
+      $this->icon = DIR_WS_ICONS . 'shipping_usps.gif';
+      $this->tax_class = MODULE_SHIPPING_USPS_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
+
+      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_USPS_ZONE > 0) ) {
+        $check_flag = false;
+        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
+        while ($check = tep_db_fetch_array($check_query)) {
+          if ($check['zone_id'] < 1) {
+            $check_flag = true;
+            break;
+          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
+            $check_flag = true;
+            break;
+          }
+        }
+
+        if ($check_flag == false) {
+          $this->enabled = false;
+        }
+      }
+
+      $this->types = array('Express' => 'EXPRESS',
+                           'First Class' => 'First-Class Mail',
+                           'Priority' => 'Priority',
+                           'Parcel' => 'Parcel');
+
+      $this->intl_types = array('GXG Document' => 'Global Express Guaranteed Document Service',
+                                'GXG Non-Document' => 'Global Express Guaranteed Non-Document Service',
+                                'Express' => 'Global Express Mail (EMS)',
+                                'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (Large)',
+                                'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (Small)',
+                                'Priority Var' => 'Global Priority Mail - Variable Weight Envelope (Single)',
+                                'Airmail Letter' => 'Airmail Letter post',
+                                'Airmail Parcel' => 'Airmail Parcel Post',
+                                'Surface Letter' => 'Economy (Surface) Letter post',
+                                'Surface Post' => 'Economy (Surface) Parcel Post');
+
+      $this->countries = $this->country_list();
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order, $shipping_weight, $shipping_num_boxes, $transittime;
+
+      if ( tep_not_null($method) && (isset($this->types[$method]) || in_array($method, $this->intl_types)) ) {
+        $this->_setService($method);
+      }
+
+      $this->_setMachinable('False');
+      $this->_setContainer('None');
+      $this->_setSize('REGULAR');
+
+// usps doesnt accept zero weight
+      $shipping_weight = ($shipping_weight < 0.1 ? 0.1 : $shipping_weight);
+      $shipping_pounds = floor ($shipping_weight);
+      $shipping_ounces = round(16 * ($shipping_weight - floor($shipping_weight)));
+      $this->_setWeight($shipping_pounds, $shipping_ounces);
+       
+      if (in_array('Display weight', explode(', ', MODULE_SHIPPING_USPS_OPTIONS))) {
+        $shiptitle = ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)';
+      } else {
+        $shiptitle = '';
+      }
+
+      $uspsQuote = $this->_getQuote();
+
+      if (is_array($uspsQuote)) {
+        if (isset($uspsQuote['error'])) {
+          $this->quotes = array('module' => $this->title,
+                                'error' => $uspsQuote['error']);
+        } else {
+          $this->quotes = array('id' => $this->code,
+                                'module' => $this->title . $shiptitle);
+
+          $methods = array();
+          $size = sizeof($uspsQuote);
+          for ($i=0; $i<$size; $i++) {
+            list($type, $cost) = each($uspsQuote[$i]);
+
+            $title = ((isset($this->types[$type])) ? $this->types[$type] : $type);
+            if(in_array('Display transit time', explode(', ', MODULE_SHIPPING_USPS_OPTIONS)))    $title .= $transittime[$type];
+
+            $methods[] = array('id' => $type,
+                               'title' => $title,
+                               'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
+          }
+
+          $this->quotes['methods'] = $methods;
+
+          if ($this->tax_class > 0) {
+            $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+          }
+        }
+      } else {
+        $this->quotes = array('module' => $this->title,
+                              'error' => MODULE_SHIPPING_USPS_TEXT_ERROR);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_USPS_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable USPS Shipping', 'MODULE_SHIPPING_USPS_STATUS', 'True', 'Do you want to offer USPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS User ID', 'MODULE_SHIPPING_USPS_USERID', 'NONE', 'Enter the USPS USERID assigned to you.', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_USPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS Password', 'MODULE_SHIPPING_USPS_PASSWORD', 'NONE', 'See USERID, above.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Which server to use', 'MODULE_SHIPPING_USPS_SERVER', 'production', 'An account at USPS is needed to use the Production server', '6', '0', 'tep_cfg_select_option(array(\'test\', \'production\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_USPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_USPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_USPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_USPS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Domestic Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES', 'Express, Priority, First Class, Parcel', 'Select the domestic services to be offered:', '6', '14', 'tep_cfg_select_multioption(array(\'Express\', \'Priority\', \'First Class\', \'Parcel\'), ',  now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . "  (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Int\'l Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES_INTL', 'GXG Document, GXG Non-Document, Express, Priority Lg, Priority Sm, Priority Var, Airmail Letter, Airmail Parcel, Surface Letter, Surface Post', 'Select the international services to be offered:', '6', '15', 'tep_cfg_select_multioption(array(\'GXG Document\', \'GXG Non-Document\', \'Express\', \'Priority Lg\', \'Priority Sm\', \'Priority Var\', \'Airmail Letter\', \'Airmail Parcel\', \'Surface Letter\', \'Surface Post\'), ',  now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('USPS Options', 'MODULE_SHIPPING_USPS_OPTIONS', 'Display weight, Display transit time', 'Select from the following the USPS options.', '6', '16', 'tep_cfg_select_multioption(array(\'Display weight\', \'Display transit time\'), ',  now())");
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_PASSWORD', 'MODULE_SHIPPING_USPS_SERVER', 'MODULE_SHIPPING_USPS_HANDLING', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER', 'MODULE_SHIPPING_USPS_OPTIONS', 'MODULE_SHIPPING_USPS_TYPES', 'MODULE_SHIPPING_USPS_TYPES_INTL');
+    }
+
+    function _setService($service) {
+      $this->service = $service;
+    }
+
+    function _setWeight($pounds, $ounces=0) {
+      $this->pounds = $pounds;
+      $this->ounces = $ounces;
+    }
+
+    function _setContainer($container) {
+      $this->container = $container;
+    }
+
+    function _setSize($size) {
+      $this->size = $size;
+    }
+
+    function _setMachinable($machinable) {
+      $this->machinable = $machinable;
+    }
+
+    function _getQuote() {
+      global $order, $transittime;
+
+      if(in_array('Display transit time', explode(', ', MODULE_SHIPPING_USPS_OPTIONS))) $transit = TRUE;
+
+      if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) {
+        $request  = '<RateRequest USERID="' . MODULE_SHIPPING_USPS_USERID . '" PASSWORD="' . MODULE_SHIPPING_USPS_PASSWORD . '">';
+        $services_count = 0;
+
+        if (isset($this->service)) {
+          $this->types = array($this->service => $this->types[$this->service]);
+        }
+
+        $dest_zip = str_replace(' ', '', $order->delivery['postcode']);
+        if ($order->delivery['country']['iso_code_2'] == 'US') $dest_zip = substr($dest_zip, 0, 5);
+
+        reset($this->types);
+        $allowed_types = explode(", ", MODULE_SHIPPING_USPS_TYPES);
+
+        while (list($key, $value) = each($this->types)) {
+
+    if ( !in_array($key, $allowed_types) ) continue;
+
+          $request .= '<Package ID="' . $services_count . '">' .
+                      '<Service>' . $key . '</Service>' .
+                      '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .
+                      '<ZipDestination>' . $dest_zip . '</ZipDestination>' .
+                      '<Pounds>' . $this->pounds . '</Pounds>' .
+                      '<Ounces>' . $this->ounces . '</Ounces>' .
+                      '<Container>' . $this->container . '</Container>' .
+                      '<Size>' . $this->size . '</Size>' .
+                      '<Machinable>' . $this->machinable . '</Machinable>' .
+                      '</Package>';
+
+          if($transit){
+            $transitreq  = 'USERID="' . MODULE_SHIPPING_USPS_USERID .
+                         '" PASSWORD="' . MODULE_SHIPPING_USPS_PASSWORD . '">' .
+                         '<OriginZip>' . STORE_ORIGIN_ZIP . '</OriginZip>' .
+                         '<DestinationZip>' . $dest_zip . '</DestinationZip>';
+
+            switch ($key) {
+              case 'Express':  $transreq[$key] = 'API=ExpressMail&XML=' .
+                               urlencode( '<ExpressMailRequest ' . $transitreq . '</ExpressMailRequest>');
+                               break;
+              case 'Priority': $transreq[$key] = 'API=PriorityMail&XML=' .
+                               urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');
+                               break;
+              case 'Parcel':   $transreq[$key] = 'API=StandardB&XML=' .
+                               urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');
+                               break;
+              default:         $transreq[$key] = '';
+                               break;
+            }
+          }
+
+          $services_count++;
+        }
+        $request .= '</RateRequest>';
+
+        $request = 'API=Rate&XML=' . urlencode($request);
+      } else {
+        $request  = '<IntlRateRequest USERID="' . MODULE_SHIPPING_USPS_USERID . '" PASSWORD="' . MODULE_SHIPPING_USPS_PASSWORD . '">' .
+                    '<Package ID="0">' .
+                    '<Pounds>' . $this->pounds . '</Pounds>' .
+                    '<Ounces>' . $this->ounces . '</Ounces>' .
+                    '<MailType>Package</MailType>' .
+                    '<Country>' . $this->countries[$order->delivery['country']['iso_code_2']] . '</Country>' .
+                    '</Package>' .
+                    '</IntlRateRequest>';
+
+        $request = 'API=IntlRate&XML=' . urlencode($request);
+      }
+
+      switch (MODULE_SHIPPING_USPS_SERVER) {
+        case 'production': $usps_server = 'production.shippingapis.com';
+                           $api_dll = 'shippingapi.dll';
+                           break;
+        case 'test':
+        default:           $usps_server = 'testing.shippingapis.com';
+                           $api_dll = 'ShippingAPITest.dll';
+                           break;
+      }
+
+      $body = '';
+
+      $http = new httpClient();
+      if ($http->Connect($usps_server, 80)) {
+        $http->addHeader('Host', $usps_server);
+        $http->addHeader('User-Agent', 'osCommerce');
+        $http->addHeader('Connection', 'Close');
+
+        if ($http->Get('/' . $api_dll . '?' . $request)) $body = $http->getBody();
+//  mail('you at yourdomain.com','USPS rate quote response',$body,'From: <you at yourdomain.com>');
+        if ($transit && is_array($transreq) && ($order->delivery['country']['id'] == STORE_COUNTRY)) {
+          while (list($key, $value) = each($transreq)) {
+            if ($http->Get('/' . $api_dll . '?' . $value)) $transresp[$key] = $http->getBody();
+          }
+        }
+
+        $http->Disconnect();
+
+      } else {
+        return false;
+      }
+
+      $response = array();
+      while (true) {
+        if ($start = strpos($body, '<Package ID=')) {
+          $body = substr($body, $start);
+          $end = strpos($body, '</Package>');
+          $response[] = substr($body, 0, $end+10);
+          $body = substr($body, $end+9);
+        } else {
+          break;
+        }
+      }
+
+      $rates = array();
+      if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) {
+        if (sizeof($response) == '1') {
+          if (ereg('<Error>', $response[0])) {
+            $number = ereg('<Number>(.*)</Number>', $response[0], $regs);
+            $number = $regs[1];
+            $description = ereg('<Description>(.*)</Description>', $response[0], $regs);
+            $description = $regs[1];
+
+            return array('error' => $number . ' - ' . $description);
+          }
+        }
+
+        $n = sizeof($response);
+        for ($i=0; $i<$n; $i++) {
+          if (strpos($response[$i], '<Postage>')) {
+            $service = ereg('<Service>(.*)</Service>', $response[$i], $regs);
+            $service = $regs[1];
+            $postage = ereg('<Postage>(.*)</Postage>', $response[$i], $regs);
+            $postage = $regs[1];
+
+            $rates[] = array($service => $postage);
+
+            if ($transit) {
+              switch ($service) {
+                case 'Express':     $time = ereg('<MonFriCommitment>(.*)</MonFriCommitment>', $transresp[$service], $tregs);
+                                    $time = $tregs[1];
+                                    if ($time == '' || $time == 'No Data') {
+                                      $time = '1 - 2 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
+                                    } else {
+                                      $time = 'Tomorrow by ' . $time;
+                                    }
+                                    break;
+                case 'Priority':    $time = ereg('<Days>(.*)</Days>', $transresp[$service], $tregs);
+                                    $time = $tregs[1];
+                                    if ($time == '' || $time == 'No Data') {
+                                      $time = '2 - 3 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
+                                    } elseif ($time == '1') {
+                                      $time .= ' ' . MODULE_SHIPPING_USPS_TEXT_DAY;
+                                    } else {
+                                      $time .= ' ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
+                                    }
+                                    break;
+                case 'Parcel':      $time = ereg('<Days>(.*)</Days>', $transresp[$service], $tregs);
+                                    $time = $tregs[1];
+                                    if ($time == '' || $time == 'No Data') {
+                                      $time = '4 - 7 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
+                                    } elseif ($time == '1') {
+                                      $time .= ' ' . MODULE_SHIPPING_USPS_TEXT_DAY;
+                                    } else {
+                                      $time .= ' ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
+                                    }
+                                    break;
+                case 'First Class': $time = '2 - 5 ' . MODULE_SHIPPING_USPS_TEXT_DAYS;
+                                    break;
+                default:            $time = '';
+                                    break;
+              }
+              if ($time != '') $transittime[$service] = ' (' . $time . ')';
+            }
+          }
+        }
+      } else {
+        if (ereg('<Error>', $response[0])) {
+          $number = ereg('<Number>(.*)</Number>', $response[0], $regs);
+          $number = $regs[1];
+          $description = ereg('<Description>(.*)</Description>', $response[0], $regs);
+          $description = $regs[1];
+
+          return array('error' => $number . ' - ' . $description);
+        } else {
+          $body = $response[0];
+          $services = array();
+          while (true) {
+            if ($start = strpos($body, '<Service ID=')) {
+              $body = substr($body, $start);
+              $end = strpos($body, '</Service>');
+              $services[] = substr($body, 0, $end+10);
+              $body = substr($body, $end+9);
+            } else {
+              break;
+            }
+          }
+          $allowed_types = array();
+          foreach( explode(", ", MODULE_SHIPPING_USPS_TYPES_INTL) as $value ) $allowed_types[$value] = $this->intl_types[$value];
+
+          $size = sizeof($services);
+          for ($i=0, $n=$size; $i<$n; $i++) {
+            if (strpos($services[$i], '<Postage>')) {
+              $service = ereg('<SvcDescription>(.*)</SvcDescription>', $services[$i], $regs);
+              $service = $regs[1];
+              $postage = ereg('<Postage>(.*)</Postage>', $services[$i], $regs);
+              $postage = $regs[1];
+              $time = ereg('<SvcCommitments>(.*)</SvcCommitments>', $services[$i], $tregs);
+              $time = $tregs[1];
+              $time = preg_replace('/Weeks$/', MODULE_SHIPPING_USPS_TEXT_WEEKS, $time);
+              $time = preg_replace('/Days$/', MODULE_SHIPPING_USPS_TEXT_DAYS, $time);
+              $time = preg_replace('/Day$/', MODULE_SHIPPING_USPS_TEXT_DAY, $time);
+
+              if( !in_array($service, $allowed_types) ) continue;
+              if (isset($this->service) && ($service != $this->service) ) {
+                continue;
+              }
+
+              $rates[] = array($service => $postage);
+        if ($time != '') $transittime[$service] = ' (' . $time . ')';
+            }
+          }
+        }
+      }
+
+      return ((sizeof($rates) > 0) ? $rates : false);
+    }
+
+    function country_list() {
+      $list = array('AF' => 'Afghanistan',
+                    'AL' => 'Albania',
+                    'DZ' => 'Algeria',
+                    'AD' => 'Andorra',
+                    'AO' => 'Angola',
+                    'AI' => 'Anguilla',
+                    'AG' => 'Antigua and Barbuda',
+                    'AR' => 'Argentina',
+                    'AM' => 'Armenia',
+                    'AW' => 'Aruba',
+                    'AU' => 'Australia',
+                    'AT' => 'Austria',
+                    'AZ' => 'Azerbaijan',
+                    'BS' => 'Bahamas',
+                    'BH' => 'Bahrain',
+                    'BD' => 'Bangladesh',
+                    'BB' => 'Barbados',
+                    'BY' => 'Belarus',
+                    'BE' => 'Belgium',
+                    'BZ' => 'Belize',
+                    'BJ' => 'Benin',
+                    'BM' => 'Bermuda',
+                    'BT' => 'Bhutan',
+                    'BO' => 'Bolivia',
+                    'BA' => 'Bosnia-Herzegovina',
+                    'BW' => 'Botswana',
+                    'BR' => 'Brazil',
+                    'VG' => 'British Virgin Islands',
+                    'BN' => 'Brunei Darussalam',
+                    'BG' => 'Bulgaria',
+                    'BF' => 'Burkina Faso',
+                    'MM' => 'Burma',
+                    'BI' => 'Burundi',
+                    'KH' => 'Cambodia',
+                    'CM' => 'Cameroon',
+                    'CA' => 'Canada',
+                    'CV' => 'Cape Verde',
+                    'KY' => 'Cayman Islands',
+                    'CF' => 'Central African Republic',
+                    'TD' => 'Chad',
+                    'CL' => 'Chile',
+                    'CN' => 'China',
+                    'CX' => 'Christmas Island (Australia)',
+                    'CC' => 'Cocos Island (Australia)',
+                    'CO' => 'Colombia',
+                    'KM' => 'Comoros',
+                    'CG' => 'Congo (Brazzaville),Republic of the',
+                    'ZR' => 'Congo, Democratic Republic of the',
+                    'CK' => 'Cook Islands (New Zealand)',
+                    'CR' => 'Costa Rica',
+                    'CI' => 'Cote d\'Ivoire (Ivory Coast)',
+                    'HR' => 'Croatia',
+                    'CU' => 'Cuba',
+                    'CY' => 'Cyprus',
+                    'CZ' => 'Czech Republic',
+                    'DK' => 'Denmark',
+                    'DJ' => 'Djibouti',
+                    'DM' => 'Dominica',
+                    'DO' => 'Dominican Republic',
+                    'TP' => 'East Timor (Indonesia)',
+                    'EC' => 'Ecuador',
+                    'EG' => 'Egypt',
+                    'SV' => 'El Salvador',
+                    'GQ' => 'Equatorial Guinea',
+                    'ER' => 'Eritrea',
+                    'EE' => 'Estonia',
+                    'ET' => 'Ethiopia',
+                    'FK' => 'Falkland Islands',
+                    'FO' => 'Faroe Islands',
+                    'FJ' => 'Fiji',
+                    'FI' => 'Finland',
+                    'FR' => 'France',
+                    'GF' => 'French Guiana',
+                    'PF' => 'French Polynesia',
+                    'GA' => 'Gabon',
+                    'GM' => 'Gambia',
+                    'GE' => 'Georgia, Republic of',
+                    'DE' => 'Germany',
+                    'GH' => 'Ghana',
+                    'GI' => 'Gibraltar',
+                    'GB' => 'Great Britain and Northern Ireland',
+                    'GR' => 'Greece',
+                    'GL' => 'Greenland',
+                    'GD' => 'Grenada',
+                    'GP' => 'Guadeloupe',
+                    'GT' => 'Guatemala',
+                    'GN' => 'Guinea',
+                    'GW' => 'Guinea-Bissau',
+                    'GY' => 'Guyana',
+                    'HT' => 'Haiti',
+                    'HN' => 'Honduras',
+                    'HK' => 'Hong Kong',
+                    'HU' => 'Hungary',
+                    'IS' => 'Iceland',
+                    'IN' => 'India',
+                    'ID' => 'Indonesia',
+                    'IR' => 'Iran',
+                    'IQ' => 'Iraq',
+                    'IE' => 'Ireland',
+                    'IL' => 'Israel',
+                    'IT' => 'Italy',
+                    'JM' => 'Jamaica',
+                    'JP' => 'Japan',
+                    'JO' => 'Jordan',
+                    'KZ' => 'Kazakhstan',
+                    'KE' => 'Kenya',
+                    'KI' => 'Kiribati',
+                    'KW' => 'Kuwait',
+                    'KG' => 'Kyrgyzstan',
+                    'LA' => 'Laos',
+                    'LV' => 'Latvia',
+                    'LB' => 'Lebanon',
+                    'LS' => 'Lesotho',
+                    'LR' => 'Liberia',
+                    'LY' => 'Libya',
+                    'LI' => 'Liechtenstein',
+                    'LT' => 'Lithuania',
+                    'LU' => 'Luxembourg',
+                    'MO' => 'Macao',
+                    'MK' => 'Macedonia, Republic of',
+                    'MG' => 'Madagascar',
+                    'MW' => 'Malawi',
+                    'MY' => 'Malaysia',
+                    'MV' => 'Maldives',
+                    'ML' => 'Mali',
+                    'MT' => 'Malta',
+                    'MQ' => 'Martinique',
+                    'MR' => 'Mauritania',
+                    'MU' => 'Mauritius',
+                    'YT' => 'Mayotte (France)',
+                    'MX' => 'Mexico',
+                    'MD' => 'Moldova',
+                    'MC' => 'Monaco (France)',
+                    'MN' => 'Mongolia',
+                    'MS' => 'Montserrat',
+                    'MA' => 'Morocco',
+                    'MZ' => 'Mozambique',
+                    'NA' => 'Namibia',
+                    'NR' => 'Nauru',
+                    'NP' => 'Nepal',
+                    'NL' => 'Netherlands',
+                    'AN' => 'Netherlands Antilles',
+                    'NC' => 'New Caledonia',
+                    'NZ' => 'New Zealand',
+                    'NI' => 'Nicaragua',
+                    'NE' => 'Niger',
+                    'NG' => 'Nigeria',
+                    'KP' => 'North Korea (Korea, Democratic People\'s Republic of)',
+                    'NO' => 'Norway',
+                    'OM' => 'Oman',
+                    'PK' => 'Pakistan',
+                    'PA' => 'Panama',
+                    'PG' => 'Papua New Guinea',
+                    'PY' => 'Paraguay',
+                    'PE' => 'Peru',
+                    'PH' => 'Philippines',
+                    'PN' => 'Pitcairn Island',
+                    'PL' => 'Poland',
+                    'PT' => 'Portugal',
+                    'QA' => 'Qatar',
+                    'RE' => 'Reunion',
+                    'RO' => 'Romania',
+                    'RU' => 'Russia',
+                    'RW' => 'Rwanda',
+                    'SH' => 'Saint Helena',
+                    'KN' => 'Saint Kitts (St. Christopher and Nevis)',
+                    'LC' => 'Saint Lucia',
+                    'PM' => 'Saint Pierre and Miquelon',
+                    'VC' => 'Saint Vincent and the Grenadines',
+                    'SM' => 'San Marino',
+                    'ST' => 'Sao Tome and Principe',
+                    'SA' => 'Saudi Arabia',
+                    'SN' => 'Senegal',
+                    'YU' => 'Serbia-Montenegro',
+                    'SC' => 'Seychelles',
+                    'SL' => 'Sierra Leone',
+                    'SG' => 'Singapore',
+                    'SK' => 'Slovak Republic',
+                    'SI' => 'Slovenia',
+                    'SB' => 'Solomon Islands',
+                    'SO' => 'Somalia',
+                    'ZA' => 'South Africa',
+                    'GS' => 'South Georgia (Falkland Islands)',
+                    'KR' => 'South Korea (Korea, Republic of)',
+                    'ES' => 'Spain',
+                    'LK' => 'Sri Lanka',
+                    'SD' => 'Sudan',
+                    'SR' => 'Suriname',
+                    'SZ' => 'Swaziland',
+                    'SE' => 'Sweden',
+                    'CH' => 'Switzerland',
+                    'SY' => 'Syrian Arab Republic',
+                    'TW' => 'Taiwan',
+                    'TJ' => 'Tajikistan',
+                    'TZ' => 'Tanzania',
+                    'TH' => 'Thailand',
+                    'TG' => 'Togo',
+                    'TK' => 'Tokelau (Union) Group (Western Samoa)',
+                    'TO' => 'Tonga',
+                    'TT' => 'Trinidad and Tobago',
+                    'TN' => 'Tunisia',
+                    'TR' => 'Turkey',
+                    'TM' => 'Turkmenistan',
+                    'TC' => 'Turks and Caicos Islands',
+                    'TV' => 'Tuvalu',
+                    'UG' => 'Uganda',
+                    'UA' => 'Ukraine',
+                    'AE' => 'United Arab Emirates',
+                    'UY' => 'Uruguay',
+                    'UZ' => 'Uzbekistan',
+                    'VU' => 'Vanuatu',
+                    'VA' => 'Vatican City',
+                    'VE' => 'Venezuela',
+                    'VN' => 'Vietnam',
+                    'WF' => 'Wallis and Futuna Islands',
+                    'WS' => 'Western Samoa',
+                    'YE' => 'Yemen',
+                    'ZM' => 'Zambia',
+                    'ZW' => 'Zimbabwe');
+
+      return $list;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/zones.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/zones.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/zones.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,247 @@
+<?php
+/*
+
+ $Id: zones.php,v 1.20 2003/06/15 19:48:09 thomasamoulton Exp $
+
+  Some changes to zonesworld for MS2
+  by Paul Mathot 2004/05/12
+  added: $shipping_num_boxes and shippingtax
+  it's a direct replacement for zones.php now
+  credits to the osCommerce team and elari
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2002-2003 elari for osCommerce
+
+ Released under the GNU General Public License
+
+ USAGE
+ By default, the module comes with support for 1 zone.  This can be
+ easily changed by editing the line below in the zones constructor
+ that defines $this->num_zones.
+
+ elari
+ i have made some change to this module, that come now with 3 default zone
+ 1 : NL can be changed for your country
+ 2 : AT,BE,GB,DE,FR,GL,IS,IE,IT,NO,DK,PL,ES,SE,CH,FI,PT,IL,GR   that are other European country except NL defined in zone 1
+ 3 : All Other World Country not defined.
+     If you define more zone, keep in mind that this is the lastest zone that will be used for country not listed
+
+
+ Next, you will want to activate the module by going to the Admin screen,
+ clicking on Modules, then clicking on Shipping.  A list of all shipping
+ modules should appear.  Click on the green dot next to the one labeled
+ zones.php.  A list of settings will appear to the right.  Click on the
+ Edit button.
+
+ PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER
+ SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a
+ backup of your shipping settings somewhere at all times.
+
+ If you want an additional handling charge applied to orders that use this
+ method, set the Handling Fee field.
+
+ Next, you will need to define which countries are in each zone.  Determining
+ this might take some time and effort.  You should group a set of countries
+ that has similar shipping charges for the same weight.  For instance, when
+ shipping from the US, the countries of Japan, Australia, New Zealand, and
+ Singapore have similar shipping rates.  As an example, one of my customers
+ is using this set of zones:
+   1: USA
+   2: Canada
+   3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland,
+      Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain,
+      Sweden, Switzerland, Finland, Portugal, Israel, Greece
+   4: Japan, Australia, New Zealand, Singapore
+   5: Taiwan, China, Hong Kong
+
+ When you enter these country lists, enter them into the Zone X Countries
+ fields, where "X" is the number of the zone.  They should be entered as
+ two character ISO country codes in all capital letters.  They should be
+ separated by commas with no spaces or other punctuation. For example:
+   1: US
+   2: CA
+   3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR
+   4: JP,AU,NZ,SG
+   5: TW,CN,HK
+
+ Now you need to set up the shipping rate tables for each zone.  Again,
+ some time and effort will go into setting the appropriate rates.  You
+ will define a set of weight ranges and the shipping price for each
+ range.  For instance, you might want an order than weighs more than 0
+ and less than or equal to 3 to cost 5.50 to ship to a certain zone.
+ This would be defined by this:  3:5.5
+
+ You should combine a bunch of these rates together in a comma delimited
+ list and enter them into the "Zone X Shipping Table" fields where "X"
+ is the zone number.  For example, this might be used for Zone 1:
+   1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
+   12:19.1,13:20.55,14:22,15:23.45
+
+ The above example includes weights over 0 and up to 15.  Note that
+ units are not specified in this explanation since they should be
+ specific to your locale.
+
+ CAVEATS
+ At this time, it does not deal with weights that are above the highest amount
+ defined.  This will probably be the next area to be improved with the
+ module.  For now, you could have one last very high range with a very
+ high shipping rate to discourage orders of that magnitude.  For
+ instance:  999:1000
+
+ If you want to be able to ship to any country in the world, you will
+ need to enter every country code into the Country fields. For most
+ shops, you will not want to enter every country.  This is often
+ because of too much fraud from certain places. If a country is not
+ listed, then the module will add a $0.00 shipping charge and will
+ indicate that shipping is not available to that destination.
+ PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!
+ elari : this has been changed, now the country not listed use the rate defined for
+ lastest zone
+
+ It appears that the osC shipping system automatically rounds the
+ shipping weight up to the nearest whole unit.  This makes it more
+ difficult to design precise shipping tables.  If you want to, you
+ can hack the shipping.php file to get rid of the rounding.
+
+ Lastly, there is a limit of 255 characters on each of the Zone
+ Shipping Tables and Zone Countries.
+
+*/
+
+ class zones {
+   var $code, $title, $description, $enabled, $num_zones;
+
+// class constructor
+   function zones() {
+     $this->code = 'zones';
+     $this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
+     $this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
+     $this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;
+     $this->icon = '';
+     $this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
+     $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
+
+     // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
+     $this->num_zones = 3;
+   }
+
+// class methods
+   function quote($method = '') {
+     global $order, $shipping_weight, $shipping_num_boxes;
+
+     $dest_country = $order->delivery['country']['iso_code_2'];
+     $dest_zone = 0;
+     $error = false;
+
+     for ($i=1; $i<=$this->num_zones; $i++) {
+       $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
+       $country_zones = split("[,]", $countries_table);
+       if (in_array($dest_country, $country_zones)) {
+         $dest_zone = $i;
+         break;
+       }
+     }
+
+     // elari - Added to select default country if not in listing
+     if ($dest_zone == 0) {
+       $dest_zone = $this->num_zones;    // the zone is the lastest zone avalaible
+     }
+     // elari - Added to select default country if not in listing
+     if ($dest_zone == 0) {
+       $error = true;      // this can no more achieve since by default the value is set to the max number of zones
+     } else {
+       $shipping = -1;
+       $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);
+
+       $zones_table = split("[:,]" , $zones_cost);
+       $size = sizeof($zones_table);
+       for ($i=0; $i<$size; $i+=2) {
+         if ($shipping_weight <= $zones_table[$i]) {
+           $shipping = $zones_table[$i+1];
+           $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $order->delivery['country']['title'] . ': ';
+           if ($shipping_num_boxes > 1) {
+             $shipping_method .= $shipping_num_boxes . 'x ';
+           }
+           $shipping_method .= $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS;
+           break;
+         }
+       }
+
+       if ($shipping == -1) {
+         $shipping_cost = 0;
+         $shipping_method = MODULE_SHIPPING_ZONES_UNDEFINED_RATE;
+       } else {
+         $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
+       }
+     }
+
+     $this->quotes = array('id' => $this->code,
+                           'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
+                           'methods' => array(array('id' => $this->code,
+                                                    'title' => $shipping_method,
+                                                    'cost' => $shipping_cost)));
+
+     if ($this->tax_class > 0) {
+       $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+     }
+
+     if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+     if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE;
+
+     return $this->quotes;
+   }
+
+   function check() {
+     if (!isset($this->_check)) {
+       $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_STATUS'");
+       $this->_check = tep_db_num_rows($check_query);
+     }
+     return $this->_check;
+   }
+
+   // elari - Added to select default country if not in listing
+   function install() {
+     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_ZONES_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ZONES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ZONES_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+     for ($i = 1; $i <= $this->num_zones; $i++) {
+        $default_countries = '';
+       if ($i == 1) {
+      $default_countries = 'NL';
+         $shipping_table = '5:5.00,7:10.00,99:100.00';
+       }
+       if ($i == 2) {
+         $default_countries = 'AT,BE,GB,DE,FR,GL,IS,IE,IT,NO,DK,PL,ES,SE,CH,FI,PT,IL,GR';
+         $shipping_table = '2:10.00,5:15.00,99:150.00';
+       }
+       if ($i == 3) {
+         $default_countries = 'All Others'; // this must be the lastest zone
+         $shipping_table = '2:500.00,5:500.00,99:500.00';
+       }
+       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");
+       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '" . $shipping_table . "', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");
+       tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_ZONES_HANDLING_" . $i ."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
+     }
+   }
+   // elari - Added to select default country if not in listing
+
+   function remove() {
+     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+   }
+
+   function keys() {
+     $keys = array('MODULE_SHIPPING_ZONES_STATUS', 'MODULE_SHIPPING_ZONES_TAX_CLASS', 'MODULE_SHIPPING_ZONES_SORT_ORDER');
+
+     for ($i=1; $i<=$this->num_zones; $i++) {
+       $keys[] = 'MODULE_SHIPPING_ZONES_COUNTRIES_' . $i;
+       $keys[] = 'MODULE_SHIPPING_ZONES_COST_' . $i;
+       $keys[] = 'MODULE_SHIPPING_ZONES_HANDLING_' . $i;
+     }
+
+     return $keys;
+   }
+ }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping/zones_single.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping/zones_single.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping/zones_single.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,211 @@
+<?php
+/*
+
+  $Id: zones.php,v 1.1.1.1 2004/03/04 23:41:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+  USAGE
+  By default, the module comes with support for 1 zone.  This can be
+  easily changed by editing the line below in the zones constructor
+  that defines $this->num_zones.
+
+  Next, you will want to activate the module by going to the Admin screen,
+  clicking on Modules, then clicking on Shipping.  A list of all shipping
+  modules should appear.  Click on the green dot next to the one labeled
+  zones.php.  A list of settings will appear to the right.  Click on the
+  Edit button.
+
+  PLEASE NOTE THAT YOU WILL LOSE YOUR CURRENT SHIPPING RATES AND OTHER
+  SETTINGS IF YOU TURN OFF THIS SHIPPING METHOD.  Make sure you keep a
+  backup of your shipping settings somewhere at all times.
+
+  If you want an additional handling charge applied to orders that use this
+  method, set the Handling Fee field.
+
+  Next, you will need to define which countries are in each zone.  Determining
+  this might take some time and effort.  You should group a set of countries
+  that has similar shipping charges for the same weight.  For instance, when
+  shipping from the US, the countries of Japan, Australia, New Zealand, and
+  Singapore have similar shipping rates.  As an example, one of my customers
+  is using this set of zones:
+    1: USA
+    2: Canada
+    3: Austria, Belgium, Great Britain, France, Germany, Greenland, Iceland,
+       Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain,
+       Sweden, Switzerland, Finland, Portugal, Israel, Greece
+    4: Japan, Australia, New Zealand, Singapore
+    5: Taiwan, China, Hong Kong
+
+  When you enter these country lists, enter them into the Zone X Countries
+  fields, where "X" is the number of the zone.  They should be entered as
+  two character ISO country codes in all capital letters.  They should be
+  separated by commas with no spaces or other punctuation. For example:
+    1: US
+    2: CA
+    3: AT,BE,GB,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR
+    4: JP,AU,NZ,SG
+    5: TW,CN,HK
+
+  Now you need to set up the shipping rate tables for each zone.  Again,
+  some time and effort will go into setting the appropriate rates.  You
+  will define a set of weight ranges and the shipping price for each
+  range.  For instance, you might want an order than weighs more than 0
+  and less than or equal to 3 to cost 5.50 to ship to a certain zone.
+  This would be defined by this:  3:5.5
+
+  You should combine a bunch of these rates together in a comma delimited
+  list and enter them into the "Zone X Shipping Table" fields where "X"
+  is the zone number.  For example, this might be used for Zone 1:
+    1:3.5,2:3.95,3:5.2,4:6.45,5:7.7,6:10.4,7:11.85, 8:13.3,9:14.75,10:16.2,11:17.65,
+    12:19.1,13:20.55,14:22,15:23.45
+
+  The above example includes weights over 0 and up to 15.  Note that
+  units are not specified in this explanation since they should be
+  specific to your locale.
+
+  CAVEATS
+  At this time, it does not deal with weights that are above the highest amount
+  defined.  This will probably be the next area to be improved with the
+  module.  For now, you could have one last very high range with a very
+  high shipping rate to discourage orders of that magnitude.  For
+  instance:  999:1000
+
+  If you want to be able to ship to any country in the world, you will
+  need to enter every country code into the Country fields. For most
+  shops, you will not want to enter every country.  This is often
+  because of too much fraud from certain places. If a country is not
+  listed, then the module will add a $0.00 shipping charge and will
+  indicate that shipping is not available to that destination.
+  PLEASE NOTE THAT THE ORDER CAN STILL BE COMPLETED AND PROCESSED!
+
+  It appears that the osC shipping system automatically rounds the
+  shipping weight up to the nearest whole unit.  This makes it more
+  difficult to design precise shipping tables.  If you want to, you
+  can hack the shipping.php file to get rid of the rounding.
+
+  Lastly, there is a limit of 255 characters on each of the Zone
+  Shipping Tables and Zone Countries.
+
+*/
+
+  class zones_single {
+    var $code, $title, $description, $enabled, $num_zones;
+
+// class constructor
+    function zones_single() {
+      $this->code = 'zones_single';
+      $this->title = MODULE_SHIPPING_ZONES_SINGLE_TEXT_TITLE;
+      $this->description = MODULE_SHIPPING_ZONES_SINGLE_TEXT_DESCRIPTION;
+      $this->sort_order = MODULE_SHIPPING_ZONES_SINGLE_SORT_ORDER;
+      $this->icon = '';
+      $this->tax_class = MODULE_SHIPPING_ZONES_SINGLE_TAX_CLASS;
+      $this->enabled = ((MODULE_SHIPPING_ZONES_SINGLE_STATUS == 'True') ? true : false);
+
+      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
+      $this->num_zones = 1;
+    }
+
+// class methods
+    function quote($method = '') {
+      global $order, $shipping_weight, $shipping_num_boxes;
+
+      $dest_country = $order->delivery['country']['iso_code_2'];
+      $dest_zone = 0;
+      $error = false;
+
+      for ($i=1; $i<=$this->num_zones; $i++) {
+        $countries_table = constant('MODULE_SHIPPING_ZONES_SINGLE_COUNTRIES_' . $i);
+        $country_zones = split("[,]", $countries_table);
+        if (in_array($dest_country, $country_zones)) {
+          $dest_zone = $i;
+          break;
+        }
+      }
+
+      if ($dest_zone == 0) {
+        $error = true;
+      } else {
+        $shipping = -1;
+        $zones_cost = constant('MODULE_SHIPPING_ZONES_SINGLE_COST_' . $dest_zone);
+
+        $zones_table = split("[:,]" , $zones_cost);
+        $size = sizeof($zones_table);
+        for ($i=0; $i<$size; $i+=2) {
+          if ($shipping_weight <= $zones_table[$i]) {
+            $shipping = $zones_table[$i+1];
+            $shipping_method = MODULE_SHIPPING_ZONES_SINGLE_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_SINGLE_TEXT_UNITS;
+            break;
+          }
+        }
+
+        if ($shipping == -1) {
+          $shipping_cost = 0;
+          $shipping_method = MODULE_SHIPPING_ZONES_SINGLE_UNDEFINED_RATE;
+        } else {
+          $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_ZONES_SINGLE_HANDLING_' . $dest_zone);
+        }
+      }
+
+      $this->quotes = array('id' => $this->code,
+                            'module' => MODULE_SHIPPING_ZONES_SINGLE_TEXT_TITLE,
+                            'methods' => array(array('id' => $this->code,
+                                                     'title' => $shipping_method,
+                                                     'cost' => $shipping_cost)));
+
+      if ($this->tax_class > 0) {
+        $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
+      }
+
+      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
+
+      if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_ZONES_SINGLE_INVALID_ZONE;
+
+      return $this->quotes;
+    }
+
+    function check() {
+      if (!isset($this->_check)) {
+        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_SINGLE_STATUS'");
+        $this->_check = tep_db_num_rows($check_query);
+      }
+      return $this->_check;
+    }
+
+    function install() {
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Zones Enable Zones Method', 'MODULE_SHIPPING_ZONES_SINGLE_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Zones Tax Class', 'MODULE_SHIPPING_ZONES_SINGLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
+      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zones Sort Order', 'MODULE_SHIPPING_ZONES_SINGLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
+      for ($i = 1; $i <= $this->num_zones; $i++) {
+        $default_countries = '';
+        if ($i == 1) {
+          $default_countries = 'US,CA';
+        }
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_SINGLE_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_SINGLE_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");
+        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_ZONES_SINGLE_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
+      }
+    }
+
+    function remove() {
+      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
+    }
+
+    function keys() {
+      $keys = array('MODULE_SHIPPING_ZONES_SINGLE_STATUS', 'MODULE_SHIPPING_ZONES_SINGLE_TAX_CLASS', 'MODULE_SHIPPING_ZONES_SINGLE_SORT_ORDER');
+
+      for ($i=1; $i<=$this->num_zones; $i++) {
+        $keys[] = 'MODULE_SHIPPING_ZONES_SINGLE_COUNTRIES_' . $i;
+        $keys[] = 'MODULE_SHIPPING_ZONES_SINGLE_COST_' . $i;
+        $keys[] = 'MODULE_SHIPPING_ZONES_SINGLE_HANDLING_' . $i;
+      }
+
+      return $keys;
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/modules/shipping_estimator.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/shipping_estimator.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/shipping_estimator.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,240 @@
+<?php
+/*
+  $Id: shipping_estimator.php,v 1.1.1.1 2004/03/04 23:41:12 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 Edwin Bekaert (edwin at ednique.com)
+
+  Customized by: Linda McGrath osCommerce at WebMakers.com
+  * This now handles Free Shipping for orders over $total as defined in the Admin
+  * This now shows Free Shipping on Virtual products
+  * Everything is contained in an infobox for easier placement.
+
+  Released under the GNU General Public License
+
+  http://forums.oscommerce.com/viewtopic.php?t=38411
+
+  http://www.oscommerce.com/community/contributions,1094
+*/
+?>
+<!-- shipping_estimator //-->
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
+          </tr>
+          <tr>
+            <td align="<?php echo (strstr($PHP_SELF,'shipping_estimator.php') ? 'right' : 'center'); ?>">
+              <table width="100%"><tr><td>
+
+<?php
+// Only do when something is in the cart
+if ($cart->count_contents() > 0) {
+
+// Could be placed in english.php
+// shopping cart quotes
+ 
+  // shipping cost
+  require('includes/classes/http_client.php'); // shipping in basket
+ require(DIR_WS_LANGUAGES . $language . '/modules/shipping_estimator.php');
+
+  if($cart->get_content_type() !== 'virtual') {
+    if (tep_session_is_registered('customer_id')) {
+      // user is logged in
+      if (isset($HTTP_POST_VARS['address_id'])){
+        // user changed address
+        $sendto = $HTTP_POST_VARS['address_id'];
+      }elseif (tep_session_is_registered('cart_address_id')){
+        // user once changed address
+        $sendto = $cart_address_id;
+      }else{
+        // first timer
+        $sendto = $customer_default_address_id;
+      }
+      // set session now
+      $cart_address_id = $sendto;
+      tep_session_register('cart_address_id');
+      // include the order class (uses the sendto !)
+      require(DIR_WS_CLASSES . 'order.php');
+      $order = new order;
+    }else{
+      // user not logged in !
+      if (isset($HTTP_POST_VARS['country_id'])){
+        // country is selected
+        $country_info = tep_get_countries($HTTP_POST_VARS['country_id'],true);
+        $order->delivery = array('postcode' => $HTTP_POST_VARS['zip_code'],
+                                 'country' => array('id' => $HTTP_POST_VARS['country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
+                                 'country_id' => $HTTP_POST_VARS['country_id'],
+                                 'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id']));
+        $cart_country_id = $HTTP_POST_VARS['country_id'];
+        tep_session_register('cart_country_id');
+        $cart_zip_code = $HTTP_POST_VARS['zip_code'];
+        tep_session_register('cart_zip_code');
+      }elseif (tep_session_is_registered('cart_country_id')){
+        // session is available
+        $country_info = tep_get_countries($cart_country_id,true);
+        $order->delivery = array('postcode' => $cart_zip_code,
+                                 'country' => array('id' => $cart_country_id, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
+                                 'country_id' => $cart_country_id,
+                                 'format_id' => tep_get_address_format_id($cart_country_id));
+      } else {
+        // first timer
+        $cart_country_id = STORE_COUNTRY;
+        tep_session_register('cart_country_id');
+// WebMakers.com Added: changes
+// changed from STORE_ORIGIN_ZIP to SHIPPING_ORIGIN_ZIP
+        $cart_zip_code = SHIPPING_ORIGIN_ZIP;
+        $country_info = tep_get_countries(STORE_COUNTRY,true);
+        tep_session_register('cart_zip_code');
+        $order->delivery = array('postcode' => SHIPPING_ORIGIN_ZIP,
+                                 'country' => array('id' => STORE_COUNTRY, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
+                                 'country_id' => STORE_COUNTRY,
+                                 'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id']));
+      }
+      // set the cost to be able to calvculate free shipping
+      $order->info = array('total' => $cart->show_total()); // TAX ????
+    }
+    // weight and count needed for shipping !
+    $total_weight = $cart->show_weight();
+    $total_count = $cart->count_contents();
+    require(DIR_WS_CLASSES . 'shipping.php');
+    $shipping_modules = new shipping;
+    $quotes = $shipping_modules->quote();
+    $cheapest = $shipping_modules->cheapest();
+    // set selections for displaying
+    $selected_country = $order->delivery['country']['id'];
+    $selected_zip = $order->delivery['postcode'];
+    $selected_address = $sendto;
+  }
+    // eo shipping cost
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => SHIPPING_OPTIONS);
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+// check free shipping based on order $total
+  if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
+    switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
+      case 'national':
+        if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
+      case 'international':
+        if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
+      case 'both':
+        $pass = true; break;
+      default:
+        $pass = false; break;
+    }
+    $free_shipping = false;
+    if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
+      $free_shipping = true;
+      include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
+    }
+  } else {
+    $free_shipping = false;
+  }
+// end free shipping based on order total
+//  $ShipTxt= tep_draw_form('estimator', tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'), 'post'); //'onSubmit="return check_form();"'
+  $ShipTxt= tep_draw_form('estimator', tep_href_link(basename($PHP_SELF), '', 'NONSSL'), 'post'); //'onSubmit="return check_form();"'
+  $ShipTxt.='<table>';
+  if(sizeof($quotes)) {
+    if (tep_session_is_registered('customer_id')) {
+      // logged in
+      $addresses_query = tep_db_query("select address_book_id, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
+      while ($addresses = tep_db_fetch_array($addresses_query)) {
+        $addresses_array[] = array('id' => $addresses['address_book_id'], 'text' => tep_address_format(tep_get_address_format_id($addresses['country_id']), $addresses, 0, ' ', ' '));
+      }
+      $ShipTxt.='<tr><td colspan="3" class="main">' . ($total_count == 1 ?  SHIPPING_METHOD_ITEM  :  SHIPPING_METHOD_ITEMS) . $total_count . '&nbsp;-&nbsp;' . SHIPPING_METHOD_WEIGHT . $total_weight . SHIPPING_METHOD_WEIGHT_UNIT . '</td></tr>';
+      $ShipTxt.='<tr><td colspan="3" class="main" nowrap>' .
+                SHIPPING_METHOD_ADDRESS .'&nbsp;'. tep_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="document.estimator.submit();return false;"').'</td></tr>';
+      $ShipTxt.='<tr valign="top"><td class="main">' . SHIPPING_METHOD_TO .'</td><td colspan="2" class="main">'. tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>') . '</td></tr>';
+    } else {
+      // not logged in
+   if (strstr($PHP_SELF,'shopping_cart.php')) {     
+      $SHIPPING_OPTIONS_LOGIN = SHIPPING_OPTIONS_LOGIN_A ;
+      }else{
+      $SHIPPING_OPTIONS_LOGIN = SHIPPING_OPTIONS_LOGIN_B ;
+      }
+      
+      $ShipTxt.=tep_output_warning($SHIPPING_OPTIONS_LOGIN);
+      $ShipTxt.='<tr><td colspan="3" class="main">' . ($total_count == 1 ?  SHIPPING_METHOD_ITEM :  SHIPPING_METHOD_ITEMS ) . $total_count . '&nbsp;-&nbsp;' . SHIPPING_METHOD_WEIGHT  . $total_weight . SHIPPING_METHOD_WEIGHT_UNIT . '</td></tr>';
+      $ShipTxt.='<tr><td colspan="3" class="main" nowrap>' .
+                ENTRY_COUNTRY .'&nbsp;'. tep_get_country_list('country_id', $selected_country,'style="width=200;"');
+      if(SHIPPING_METHOD_ZIP_REQUIRED == "true"){
+        $ShipTxt.='</td></tr>          <tr>
+            <td colspan="3" class="main" nowrap>' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td>
+          </tr><tr><td colspan="3" class="main" nowrap>'.ENTRY_POST_CODE .'&nbsp;'. tep_draw_input_field('zip_code', $selected_zip, 'size="10"');
+      }
+      $ShipTxt.='&nbsp;<a href="_" onclick="document.estimator.submit();return false;">' . SHIPPING_METHOD_RECALCULATE.'</a></td></tr>';
+    }
+    if ($free_shipping==1) {
+      // order $total is free
+      $ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
+      $ShipTxt.='<tr><td>&nbsp;</td><td class="main">' . sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . '</td><td>&nbsp;</td></tr>';
+    }else{
+      // shipping display
+      $ShipTxt.='<tr><td></td><td class="main" align="left"><b>' . SHIPPING_METHOD_TEXT . '</b></td><td class="main" align="center"><b>' . SHIPPING_METHOD_RATES . '</b></td></tr>';
+      $ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
+      for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
+        if(sizeof($quotes[$i]['methods'])==1){
+          // simple shipping method
+          $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][0]['id'];
+          $ShipTxt.= '<tr class="'.$extra.'">';
+          $ShipTxt.='<td class="main">'.$quotes[$i]['icon'].'&nbsp;</td>';
+          if($quotes[$i]['error']){
+            $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].'&nbsp;';
+            $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
+          }else{
+            if($cheapest['id'] == $thisquoteid){
+              $ShipTxt.='<td class="main"><b>'.$quotes[$i]['module'].'&nbsp;';
+              $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</b></td><td align="right" class="main"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'<b></td></tr>';
+            }else{
+              $ShipTxt.='<td class="main">'.$quotes[$i]['module'].'&nbsp;';
+              $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</td><td align="right" class="main">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'</td></tr>';
+            }
+          }
+        } else {
+          // shipping method with sub methods (multipickup)
+          for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
+            $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'];
+            $ShipTxt.= '<tr class="'.$extra.'">';
+            $ShipTxt.='<td class="main">'.$quotes[$i]['icon'].'&nbsp;</td>';
+            if($quotes[$i]['error']){
+              $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].'&nbsp;';
+              $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
+            }else{
+              if($cheapest['id'] == $thisquoteid){
+                $ShipTxt.='<td class="main"><b>'.$quotes[$i]['module'].'&nbsp;';
+                $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</b></td><td align="right" class="main"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</b></td></tr>';
+              }else{
+                $ShipTxt.='<td class="main">'.$quotes[$i]['module'].'&nbsp;';
+                $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</td><td align="right" class="main">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</td></tr>';
+              }
+            }
+          }
+        }
+      }
+    }
+  } else {
+    // virtual product/download
+    $ShipTxt.='<tr><td class="main">' . SHIPPING_METHOD_FREE_TEXT . ' ' . SHIPPING_METHOD_ALL_DOWNLOADS . '</td></tr>';
+  }
+
+  $ShipTxt.= '</table></form>';
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $ShipTxt);
+
+  new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+} // Only do when something is in the cart
+?>
+              </td></tr></table>
+            </td>
+          </tr>
+<!-- shipping_estimator_eof //-->

Added: trunk/direct.openmoko.com/includes/modules/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: upcoming_products.php,v 1.1.1.3 2004/04/07 23:42:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- upcoming_products mainpage_modules //-->
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_UPCOMING_PRODUCTS, strftime('%B')));
+
+  
+    $expected_query_raw= tep_db_query("select
+     p.products_id,
+     pd.products_name, 
+     p.products_image, 
+     products_date_available as date_expected 
+     from " . TABLE_PRODUCTS . " p, 
+          " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+    where 
+    to_days(products_date_available) >= to_days(now()) 
+    and p.products_id = pd.products_id 
+    and pd.language_id = '" . (int)$languages_id . "' 
+    order by rand()
+    limit " . MAX_DISPLAY_UPCOMING_PRODUCTS);
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($expected_query = tep_db_fetch_array($expected_query_raw)) {
+  
+    $num ++;
+      if ($num == 1) { 
+    new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
+      }
+  $pf->loadProduct($expected_query['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+    
+   $duedate= str_replace("00:00:00", "" , $expected_query['date_expected']);  
+   
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $expected_query['products_image'], $expected_query['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . $expected_query['products_name'] . '</a><br>' . $products_price_s . '<br>' . TABLE_HEADING_DATE_EXPECTED . '&nbsp;' . $duedate);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+if (TEMPLATE_INCLUDE_FOOTER =='true'){
+  $info_box_contents = array();
+if (MAIN_TABLE_BORDER == 'yes'){
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+  }
+ }
+?>
+<!--D upcoming_products_eof //-->

Added: trunk/direct.openmoko.com/includes/modules/wishlist/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/wishlist/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/wishlist/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: wishlist.php,v 1.1.1.1 2004/03/04 23:41:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+*/
+
+// retreive the wishlist
+
+  if (tep_session_is_registered('customer_id')) {
+
+$wishlist_query = tep_db_query("select * from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id");
+
+// if we have something in this clients list:
+
+?>
+<!-- customer_wishlist //-->
+<script type="text/javascript"><!--
+function popupWindowWishlist(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=425,height=475,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+<?php
+    $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CUSTOMER_WISHLIST . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_WISHLIST, '','NONSSL'));
+
+    $info_box_contents = array();
+
+  if (tep_db_num_rows($wishlist_query)) {
+  if (tep_db_num_rows($wishlist_query) < MAX_DISPLAY_WISHLIST_BOX) {
+    $product_ids = '';
+    while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+      $product_ids .= $wishlist['products_id'] . ',';
+    }
+    $product_ids = substr($product_ids, 0, -1);
+
+    $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+    $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . $languages_id . "' order by products_name");
+    while ($products = tep_db_fetch_array($products_query)) {
+      // change the cust_order into a buy_now action
+      $customer_wishlist_string .= '  <tr>' . "\n" .
+                                 '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a></td>' . "\n" .
+                 '    </tr>' . "\n" .
+                 '    <tr>' . "\n" .
+                                 '    <td class="infoBoxContents" align="center" valign="bottom"><b><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id'], 'NONSSL') . '">Move to Cart</a>&nbsp;|' . "\n" .
+                                 '    <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">Delete</a></b></td>' . "\n" .
+                                 '  </tr><tr><td class="infoBoxContents" valign="top">' . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td></tr>' . "\n";
+    }
+    } else {
+    $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+  $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . sprintf(TEXT_WISHLIST_COUNT, tep_db_num_rows($wishlist_query)) . '</td></tr>' . "\n";
+    }
+  } else {
+    $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+  $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . BOX_WISHLIST_EMPTY . '</td></tr>' . "\n";
+  }
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST, '','NONSSL') . '"><u>View ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a></td></tr>' . "\n";
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="javascript:popupWindowWishlist(\'' . tep_href_link('popup_' . FILENAME_WISHLIST_HELP, '','NONSSL') . '\')"><u>'. BOX_HEADING_CUSTOMER_WISHLIST . ' Help</u> [?]</a></td></tr>' . "\n"; // Popup link
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '','NONSSL') . '"><u>'. BOX_HEADING_CUSTOMER_WISHLIST . ' Help</u> [?]</a></td></tr>' . "\n"; // Normal link
+    $customer_wishlist_string .= '</table>';
+
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => $customer_wishlist_string);
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoBoxFooter($info_box_contents, true, true);
+}
+?>
+<!-- customer_wishlist_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/modules/wishlist/wishlist.php.txt
===================================================================
--- trunk/direct.openmoko.com/includes/modules/wishlist/wishlist.php.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/wishlist/wishlist.php.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,5 @@
+The way this file is now, there are 2 links to "wishlist help"
+
+The 1st is a pop-up window and the 2nd is a regular page.
+
+Try them and see which you like better and then comment out the link you do not want.  Line 60 is the popup link and line 61 is the regular link.

Added: trunk/direct.openmoko.com/includes/modules/xsell_products_buynow.php
===================================================================
--- trunk/direct.openmoko.com/includes/modules/xsell_products_buynow.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/modules/xsell_products_buynow.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+$Id: xsell_products.php, v1  2002/09/11
+
+osCommerce, Open Source E-Commerce Solutions
+<http://www.oscommerce.com>
+
+Copyright (c) 2002 osCommerce
+
+Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['products_id']) {
+$xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where xp.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_status = '1' order by xp.products_id asc limit " . MAX_DISPLAY_ALSO_PURCHASED);
+$num_products_xsell = tep_db_num_rows($xsell_query);
+if ($num_products_xsell >= MIN_DISPLAY_XSELL) {
+  require(DIR_WS_LANGUAGES . $language . '/modules/xsell_products.php');
+?>
+<!-- xsell_products //-->
+   <tr>
+            <td>
+
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS);
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $row = 0;
+      $col = 0;
+      $info_box_contents = array();
+      while ($xsell = tep_db_fetch_array($xsell_query)) {
+
+  $pf->loadProduct($xsell['products_id'],$languages_id);
+        $xsell_price = $pf->getPriceStringShort();
+
+        $info_box_contents[$row][$col] = array('align' => 'center',
+                                               'params' => 'class="smallText" width="33%" valign="top"',
+                                               'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_template_image_button('button_buy_now.gif', TEXT_BUY . $xsell['products_name'] . TEXT_NOW) .'</a>');
+        $col ++;
+        if ($col > 2) {
+          $col = 0;
+          $row ++;
+        }
+      }
+      
+// Modify to avoid display if no X-Sells Defined - courtesy Halbert DMG
+//  halbert mod - Don't show heading if no cross-sell items
+if (($num_products_xsell >= MIN_DISPLAY_XSELL) && ($num_products_xsell > 0)) { 
+      new contentBox($info_box_contents);
+if (MAIN_TABLE_BORDER == 'yes'){
+$info_box_contents = array();
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+}
+// added one brace for Halbert if statement DMG
+}
+?>
+           </td>
+          </tr>
+<!-- xsell_products_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/includes/nusoap.php
===================================================================
--- trunk/direct.openmoko.com/includes/nusoap.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/nusoap.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,7241 @@
+<?php
+
+/*
+$Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+
+NuSOAP - Web Services Toolkit for PHP
+
+Copyright (c) 2002 NuSphere Corporation
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+If you have any questions or comments, please email:
+
+Dietrich Ayala
+dietrich at ganx4.com
+http://dietrich.ganx4.com/nusoap
+
+NuSphere Corporation
+http://www.nusphere.com
+
+*/
+
+/* load classes
+
+// necessary classes
+require_once('class.soapclient.php');
+require_once('class.soap_val.php');
+require_once('class.soap_parser.php');
+require_once('class.soap_fault.php');
+
+// transport classes
+require_once('class.soap_transport_http.php');
+
+// optional add-on classes
+require_once('class.xmlschema.php');
+require_once('class.wsdl.php');
+
+// server class
+require_once('class.soap_server.php');*/
+
+// class variable emulation
+// cf. http://www.webkreator.com/php/techniques/php-static-class-variables.html
+$GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = 9;
+
+/**
+*
+* nusoap_base
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class nusoap_base {
+	/**
+	 * Identification for HTTP headers.
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $title = 'NuSOAP';
+	/**
+	 * Version for HTTP headers.
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $version = '0.7.2';
+	/**
+	 * CVS revision for HTTP headers.
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $revision = '$Revision: 1.94 $';
+    /**
+     * Current error string (manipulated by getError/setError)
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $error_str = '';
+    /**
+     * Current debug string (manipulated by debug/appendDebug/clearDebug/getDebug/getDebugAsXMLComment)
+	 *
+	 * @var string
+	 * @access private
+	 */
+    var $debug_str = '';
+    /**
+	 * toggles automatic encoding of special characters as entities
+	 * (should always be true, I think)
+	 *
+	 * @var boolean
+	 * @access private
+	 */
+	var $charencoding = true;
+	/**
+	 * the debug level for this instance
+	 *
+	 * @var	integer
+	 * @access private
+	 */
+	var $debugLevel;
+
+    /**
+	* set schema version
+	*
+	* @var      string
+	* @access   public
+	*/
+	var $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema';
+	
+    /**
+	* charset encoding for outgoing messages
+	*
+	* @var      string
+	* @access   public
+	*/
+    var $soap_defencoding = 'ISO-8859-1';
+	//var $soap_defencoding = 'UTF-8';
+
+	/**
+	* namespaces in an array of prefix => uri
+	*
+	* this is "seeded" by a set of constants, but it may be altered by code
+	*
+	* @var      array
+	* @access   public
+	*/
+	var $namespaces = array(
+		'SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/',
+		'xsd' => 'http://www.w3.org/2001/XMLSchema',
+		'xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
+		'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/'
+		);
+
+	/**
+	* namespaces used in the current context, e.g. during serialization
+	*
+	* @var      array
+	* @access   private
+	*/
+	var $usedNamespaces = array();
+
+	/**
+	* XML Schema types in an array of uri => (array of xml type => php type)
+	* is this legacy yet?
+	* no, this is used by the xmlschema class to verify type => namespace mappings.
+	* @var      array
+	* @access   public
+	*/
+	var $typemap = array(
+	'http://www.w3.org/2001/XMLSchema' => array(
+		'string'=>'string','boolean'=>'boolean','float'=>'double','double'=>'double','decimal'=>'double',
+		'duration'=>'','dateTime'=>'string','time'=>'string','date'=>'string','gYearMonth'=>'',
+		'gYear'=>'','gMonthDay'=>'','gDay'=>'','gMonth'=>'','hexBinary'=>'string','base64Binary'=>'string',
+		// abstract "any" types
+		'anyType'=>'string','anySimpleType'=>'string',
+		// derived datatypes
+		'normalizedString'=>'string','token'=>'string','language'=>'','NMTOKEN'=>'','NMTOKENS'=>'','Name'=>'','NCName'=>'','ID'=>'',
+		'IDREF'=>'','IDREFS'=>'','ENTITY'=>'','ENTITIES'=>'','integer'=>'integer','nonPositiveInteger'=>'integer',
+		'negativeInteger'=>'integer','long'=>'integer','int'=>'integer','short'=>'integer','byte'=>'integer','nonNegativeInteger'=>'integer',
+		'unsignedLong'=>'','unsignedInt'=>'','unsignedShort'=>'','unsignedByte'=>'','positiveInteger'=>''),
+	'http://www.w3.org/2000/10/XMLSchema' => array(
+		'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double',
+		'float'=>'double','dateTime'=>'string',
+		'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'),
+	'http://www.w3.org/1999/XMLSchema' => array(
+		'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double',
+		'float'=>'double','dateTime'=>'string',
+		'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'),
+	'http://soapinterop.org/xsd' => array('SOAPStruct'=>'struct'),
+	'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string','array'=>'array','Array'=>'array'),
+    'http://xml.apache.org/xml-soap' => array('Map')
+	);
+
+	/**
+	* XML entities to convert
+	*
+	* @var      array
+	* @access   public
+	* @deprecated
+	* @see	expandEntities
+	*/
+	var $xmlEntities = array('quot' => '"','amp' => '&',
+		'lt' => '<','gt' => '>','apos' => "'");
+
+	/**
+	* constructor
+	*
+	* @access	public
+	*/
+	function nusoap_base() {
+		$this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel;
+	}
+
+	/**
+	* gets the global debug level, which applies to future instances
+	*
+	* @return	integer	Debug level 0-9, where 0 turns off
+	* @access	public
+	*/
+	function getGlobalDebugLevel() {
+		return $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel;
+	}
+
+	/**
+	* sets the global debug level, which applies to future instances
+	*
+	* @param	int	$level	Debug level 0-9, where 0 turns off
+	* @access	public
+	*/
+	function setGlobalDebugLevel($level) {
+		$GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = $level;
+	}
+
+	/**
+	* gets the debug level for this instance
+	*
+	* @return	int	Debug level 0-9, where 0 turns off
+	* @access	public
+	*/
+	function getDebugLevel() {
+		return $this->debugLevel;
+	}
+
+	/**
+	* sets the debug level for this instance
+	*
+	* @param	int	$level	Debug level 0-9, where 0 turns off
+	* @access	public
+	*/
+	function setDebugLevel($level) {
+		$this->debugLevel = $level;
+	}
+
+	/**
+	* adds debug data to the instance debug string with formatting
+	*
+	* @param    string $string debug data
+	* @access   private
+	*/
+	function debug($string){
+		if ($this->debugLevel > 0) {
+			$this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n");
+		}
+	}
+
+	/**
+	* adds debug data to the instance debug string without formatting
+	*
+	* @param    string $string debug data
+	* @access   public
+	*/
+	function appendDebug($string){
+		if ($this->debugLevel > 0) {
+			// it would be nice to use a memory stream here to use
+			// memory more efficiently
+			$this->debug_str .= $string;
+		}
+	}
+
+	/**
+	* clears the current debug data for this instance
+	*
+	* @access   public
+	*/
+	function clearDebug() {
+		// it would be nice to use a memory stream here to use
+		// memory more efficiently
+		$this->debug_str = '';
+	}
+
+	/**
+	* gets the current debug data for this instance
+	*
+	* @return   debug data
+	* @access   public
+	*/
+	function &getDebug() {
+		// it would be nice to use a memory stream here to use
+		// memory more efficiently
+		return $this->debug_str;
+	}
+
+	/**
+	* gets the current debug data for this instance as an XML comment
+	* this may change the contents of the debug data
+	*
+	* @return   debug data as an XML comment
+	* @access   public
+	*/
+	function &getDebugAsXMLComment() {
+		// it would be nice to use a memory stream here to use
+		// memory more efficiently
+		while (strpos($this->debug_str, '--')) {
+			$this->debug_str = str_replace('--', '- -', $this->debug_str);
+		}
+    	return "<!--\n" . $this->debug_str . "\n-->";
+	}
+
+	/**
+	* expands entities, e.g. changes '<' to '&lt;'.
+	*
+	* @param	string	$val	The string in which to expand entities.
+	* @access	private
+	*/
+	function expandEntities($val) {
+		if ($this->charencoding) {
+	    	$val = str_replace('&', '&amp;', $val);
+	    	$val = str_replace("'", '&apos;', $val);
+	    	$val = str_replace('"', '&quot;', $val);
+	    	$val = str_replace('<', '&lt;', $val);
+	    	$val = str_replace('>', '&gt;', $val);
+	    }
+	    return $val;
+	}
+
+	/**
+	* returns error string if present
+	*
+	* @return   mixed error string or false
+	* @access   public
+	*/
+	function getError(){
+		if($this->error_str != ''){
+			return $this->error_str;
+		}
+		return false;
+	}
+
+	/**
+	* sets error string
+	*
+	* @return   boolean $string error string
+	* @access   private
+	*/
+	function setError($str){
+		$this->error_str = $str;
+	}
+
+	/**
+	* detect if array is a simple array or a struct (associative array)
+	*
+	* @param	mixed	$val	The PHP array
+	* @return	string	(arraySimple|arrayStruct)
+	* @access	private
+	*/
+	function isArraySimpleOrStruct($val) {
+        $keyList = array_keys($val);
+		foreach ($keyList as $keyListValue) {
+			if (!is_int($keyListValue)) {
+				return 'arrayStruct';
+			}
+		}
+		return 'arraySimple';
+	}
+
+	/**
+	* serializes PHP values in accordance w/ section 5. Type information is
+	* not serialized if $use == 'literal'.
+	*
+	* @param	mixed	$val	The value to serialize
+	* @param	string	$name	The name (local part) of the XML element
+	* @param	string	$type	The XML schema type (local part) for the element
+	* @param	string	$name_ns	The namespace for the name of the XML element
+	* @param	string	$type_ns	The namespace for the type of the element
+	* @param	array	$attributes	The attributes to serialize as name=>value pairs
+	* @param	string	$use	The WSDL "use" (encoded|literal)
+	* @return	string	The serialized element, possibly with child elements
+    * @access	public
+	*/
+	function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=false,$attributes=false,$use='encoded'){
+		$this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use");
+		$this->appendDebug('value=' . $this->varDump($val));
+		$this->appendDebug('attributes=' . $this->varDump($attributes));
+		
+    	if(is_object($val) && get_class($val) == 'soapval'){
+        	return $val->serialize($use);
+        }
+		// force valid name if necessary
+		if (is_numeric($name)) {
+			$name = '__numeric_' . $name;
+		} elseif (! $name) {
+			$name = 'noname';
+		}
+		// if name has ns, add ns prefix to name
+		$xmlns = '';
+        if($name_ns){
+			$prefix = 'nu'.rand(1000,9999);
+			$name = $prefix.':'.$name;
+			$xmlns .= " xmlns:$prefix=\"$name_ns\"";
+		}
+		// if type is prefixed, create type prefix
+		if($type_ns != '' && $type_ns == $this->namespaces['xsd']){
+			// need to fix this. shouldn't default to xsd if no ns specified
+		    // w/o checking against typemap
+			$type_prefix = 'xsd';
+		} elseif($type_ns){
+			$type_prefix = 'ns'.rand(1000,9999);
+			$xmlns .= " xmlns:$type_prefix=\"$type_ns\"";
+		}
+		// serialize attributes if present
+		$atts = '';
+		if($attributes){
+			foreach($attributes as $k => $v){
+				$atts .= " $k=\"".$this->expandEntities($v).'"';
+			}
+		}
+		// serialize null value
+		if (is_null($val)) {
+			if ($use == 'literal') {
+				// TODO: depends on minOccurs
+	        	return "<$name$xmlns $atts/>";
+        	} else {
+				if (isset($type) && isset($type_prefix)) {
+					$type_str = " xsi:type=\"$type_prefix:$type\"";
+				} else {
+					$type_str = '';
+				}
+	        	return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>";
+        	}
+		}
+        // serialize if an xsd built-in primitive type
+        if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){
+        	if (is_bool($val)) {
+        		if ($type == 'boolean') {
+	        		$val = $val ? 'true' : 'false';
+	        	} elseif (! $val) {
+	        		$val = 0;
+	        	}
+			} else if (is_string($val)) {
+				$val = $this->expandEntities($val);
+			}
+			if ($use == 'literal') {
+	        	return "<$name$xmlns $atts>$val</$name>";
+        	} else {
+	        	return "<$name$xmlns $atts xsi:type=\"xsd:$type\">$val</$name>";
+        	}
+        }
+		// detect type and serialize
+		$xml = '';
+		switch(true) {
+			case (is_bool($val) || $type == 'boolean'):
+        		if ($type == 'boolean') {
+	        		$val = $val ? 'true' : 'false';
+	        	} elseif (! $val) {
+	        		$val = 0;
+	        	}
+				if ($use == 'literal') {
+					$xml .= "<$name$xmlns $atts>$val</$name>";
+				} else {
+					$xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val</$name>";
+				}
+				break;
+			case (is_int($val) || is_long($val) || $type == 'int'):
+				if ($use == 'literal') {
+					$xml .= "<$name$xmlns $atts>$val</$name>";
+				} else {
+					$xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val</$name>";
+				}
+				break;
+			case (is_float($val)|| is_double($val) || $type == 'float'):
+				if ($use == 'literal') {
+					$xml .= "<$name$xmlns $atts>$val</$name>";
+				} else {
+					$xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val</$name>";
+				}
+				break;
+			case (is_string($val) || $type == 'string'):
+				$val = $this->expandEntities($val);
+				if ($use == 'literal') {
+					$xml .= "<$name$xmlns $atts>$val</$name>";
+				} else {
+					$xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val</$name>";
+				}
+				break;
+			case is_object($val):
+				if (! $name) {
+					$name = get_class($val);
+					$this->debug("In serialize_val, used class name $name as element name");
+				} else {
+					$this->debug("In serialize_val, do not override name $name for element name for class " . get_class($val));
+				}
+				foreach(get_object_vars($val) as $k => $v){
+					$pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use);
+				}
+				$xml .= '<'.$name.'>'.$pXml.'</'.$name.'>';
+				break;
+			break;
+			case (is_array($val) || $type):
+				// detect if struct or array
+				$valueType = $this->isArraySimpleOrStruct($val);
+                if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
+					$i = 0;
+					if(is_array($val) && count($val)> 0){
+						foreach($val as $v){
+	                    	if(is_object($v) && get_class($v) ==  'soapval'){
+								$tt_ns = $v->type_ns;
+								$tt = $v->type;
+							} elseif (is_array($v)) {
+								$tt = $this->isArraySimpleOrStruct($v);
+							} else {
+								$tt = gettype($v);
+	                        }
+							$array_types[$tt] = 1;
+							// TODO: for literal, the name should be $name
+							$xml .= $this->serialize_val($v,'item',false,false,false,false,$use);
+							++$i;
+						}
+						if(count($array_types) > 1){
+							$array_typename = 'xsd:anyType';
+						} elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) {
+							if ($tt == 'integer') {
+								$tt = 'int';
+							}
+							$array_typename = 'xsd:'.$tt;
+						} elseif(isset($tt) && $tt == 'arraySimple'){
+							$array_typename = 'SOAP-ENC:Array';
+						} elseif(isset($tt) && $tt == 'arrayStruct'){
+							$array_typename = 'unnamed_struct_use_soapval';
+						} else {
+							// if type is prefixed, create type prefix
+							if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){
+								 $array_typename = 'xsd:' . $tt;
+							} elseif ($tt_ns) {
+								$tt_prefix = 'ns' . rand(1000, 9999);
+								$array_typename = "$tt_prefix:$tt";
+								$xmlns .= " xmlns:$tt_prefix=\"$tt_ns\"";
+							} else {
+								$array_typename = $tt;
+							}
+						}
+						$array_type = $i;
+						if ($use == 'literal') {
+							$type_str = '';
+						} else if (isset($type) && isset($type_prefix)) {
+							$type_str = " xsi:type=\"$type_prefix:$type\"";
+						} else {
+							$type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\"";
+						}
+					// empty array
+					} else {
+						if ($use == 'literal') {
+							$type_str = '';
+						} else if (isset($type) && isset($type_prefix)) {
+							$type_str = " xsi:type=\"$type_prefix:$type\"";
+						} else {
+							$type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\"";
+						}
+					}
+					// TODO: for array in literal, there is no wrapper here
+					$xml = "<$name$xmlns$type_str$atts>".$xml."</$name>";
+				} else {
+					// got a struct
+					if(isset($type) && isset($type_prefix)){
+						$type_str = " xsi:type=\"$type_prefix:$type\"";
+					} else {
+						$type_str = '';
+					}
+					if ($use == 'literal') {
+						$xml .= "<$name$xmlns $atts>";
+					} else {
+						$xml .= "<$name$xmlns$type_str$atts>";
+					}
+					foreach($val as $k => $v){
+						// Apache Map
+						if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') {
+							$xml .= '<item>';
+							$xml .= $this->serialize_val($k,'key',false,false,false,false,$use);
+							$xml .= $this->serialize_val($v,'value',false,false,false,false,$use);
+							$xml .= '</item>';
+						} else {
+							$xml .= $this->serialize_val($v,$k,false,false,false,false,$use);
+						}
+					}
+					$xml .= "</$name>";
+				}
+				break;
+			default:
+				$xml .= 'not detected, got '.gettype($val).' for '.$val;
+				break;
+		}
+		return $xml;
+	}
+
+    /**
+    * serializes a message
+    *
+    * @param string $body the XML of the SOAP body
+    * @param mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers
+    * @param array $namespaces optional the namespaces used in generating the body and headers
+    * @param string $style optional (rpc|document)
+    * @param string $use optional (encoded|literal)
+    * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
+    * @return string the message
+    * @access public
+    */
+    function serializeEnvelope($body,$headers=false,$namespaces=array(),$style='rpc',$use='encoded',$encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'){
+    // TODO: add an option to automatically run utf8_encode on $body and $headers
+    // if $this->soap_defencoding is UTF-8.  Not doing this automatically allows
+    // one to send arbitrary UTF-8 characters, not just characters that map to ISO-8859-1
+
+	$this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle");
+	$this->debug("headers:");
+	$this->appendDebug($this->varDump($headers));
+	$this->debug("namespaces:");
+	$this->appendDebug($this->varDump($namespaces));
+
+	// serialize namespaces
+    $ns_string = '';
+	foreach(array_merge($this->namespaces,$namespaces) as $k => $v){
+		$ns_string .= " xmlns:$k=\"$v\"";
+	}
+	if($encodingStyle) {
+		$ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string";
+	}
+
+	// serialize headers
+	if($headers){
+		if (is_array($headers)) {
+			$xml = '';
+			foreach ($headers as $header) {
+				$xml .= $this->serialize_val($header, false, false, false, false, false, $use);
+			}
+			$headers = $xml;
+			$this->debug("In serializeEnvelope, serialzied array of headers to $headers");
+		}
+		$headers = "<SOAP-ENV:Header>".$headers."</SOAP-ENV:Header>";
+	}
+	// serialize envelope
+	return
+	'<?xml version="1.0" encoding="'.$this->soap_defencoding .'"?'.">".
+	'<SOAP-ENV:Envelope'.$ns_string.">".
+	$headers.
+	"<SOAP-ENV:Body>".
+		$body.
+	"</SOAP-ENV:Body>".
+	"</SOAP-ENV:Envelope>";
+    }
+
+	/**
+	 * formats a string to be inserted into an HTML stream
+	 *
+	 * @param string $str The string to format
+	 * @return string The formatted string
+	 * @access public
+	 * @deprecated
+	 */
+    function formatDump($str){
+		$str = htmlspecialchars($str);
+		return nl2br($str);
+    }
+
+	/**
+	* contracts (changes namespace to prefix) a qualified name
+	*
+	* @param    string $qname qname
+	* @return	string contracted qname
+	* @access   private
+	*/
+	function contractQname($qname){
+		// get element namespace
+		//$this->xdebug("Contract $qname");
+		if (strrpos($qname, ':')) {
+			// get unqualified name
+			$name = substr($qname, strrpos($qname, ':') + 1);
+			// get ns
+			$ns = substr($qname, 0, strrpos($qname, ':'));
+			$p = $this->getPrefixFromNamespace($ns);
+			if ($p) {
+				return $p . ':' . $name;
+			}
+			return $qname;
+		} else {
+			return $qname;
+		}
+	}
+
+	/**
+	* expands (changes prefix to namespace) a qualified name
+	*
+	* @param    string $string qname
+	* @return	string expanded qname
+	* @access   private
+	*/
+	function expandQname($qname){
+		// get element prefix
+		if(strpos($qname,':') && !ereg('^http://',$qname)){
+			// get unqualified name
+			$name = substr(strstr($qname,':'),1);
+			// get ns prefix
+			$prefix = substr($qname,0,strpos($qname,':'));
+			if(isset($this->namespaces[$prefix])){
+				return $this->namespaces[$prefix].':'.$name;
+			} else {
+				return $qname;
+			}
+		} else {
+			return $qname;
+		}
+	}
+
+    /**
+    * returns the local part of a prefixed string
+    * returns the original string, if not prefixed
+    *
+    * @param string $str The prefixed string
+    * @return string The local part
+    * @access public
+    */
+	function getLocalPart($str){
+		if($sstr = strrchr($str,':')){
+			// get unqualified name
+			return substr( $sstr, 1 );
+		} else {
+			return $str;
+		}
+	}
+
+	/**
+    * returns the prefix part of a prefixed string
+    * returns false, if not prefixed
+    *
+    * @param string $str The prefixed string
+    * @return mixed The prefix or false if there is no prefix
+    * @access public
+    */
+	function getPrefix($str){
+		if($pos = strrpos($str,':')){
+			// get prefix
+			return substr($str,0,$pos);
+		}
+		return false;
+	}
+
+	/**
+    * pass it a prefix, it returns a namespace
+    *
+    * @param string $prefix The prefix
+    * @return mixed The namespace, false if no namespace has the specified prefix
+    * @access public
+    */
+	function getNamespaceFromPrefix($prefix){
+		if (isset($this->namespaces[$prefix])) {
+			return $this->namespaces[$prefix];
+		}
+		//$this->setError("No namespace registered for prefix '$prefix'");
+		return false;
+	}
+
+	/**
+    * returns the prefix for a given namespace (or prefix)
+    * or false if no prefixes registered for the given namespace
+    *
+    * @param string $ns The namespace
+    * @return mixed The prefix, false if the namespace has no prefixes
+    * @access public
+    */
+	function getPrefixFromNamespace($ns) {
+		foreach ($this->namespaces as $p => $n) {
+			if ($ns == $n || $ns == $p) {
+			    $this->usedNamespaces[$p] = $n;
+				return $p;
+			}
+		}
+		return false;
+	}
+
+	/**
+    * returns the time in ODBC canonical form with microseconds
+    *
+    * @return string The time in ODBC canonical form with microseconds
+    * @access public
+    */
+	function getmicrotime() {
+		if (function_exists('gettimeofday')) {
+			$tod = gettimeofday();
+			$sec = $tod['sec'];
+			$usec = $tod['usec'];
+		} else {
+			$sec = time();
+			$usec = 0;
+		}
+		return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec);
+	}
+
+	/**
+	 * Returns a string with the output of var_dump
+	 *
+	 * @param mixed $data The variable to var_dump
+	 * @return string The output of var_dump
+	 * @access public
+	 */
+    function varDump($data) {
+		ob_start();
+		var_dump($data);
+		$ret_val = ob_get_contents();
+		ob_end_clean();
+		return $ret_val;
+	}
+}
+
+// XML Schema Datatype Helper Functions
+
+//xsd:dateTime helpers
+
+/**
+* convert unix timestamp to ISO 8601 compliant date string
+*
+* @param    string $timestamp Unix time stamp
+* @access   public
+*/
+function timestamp_to_iso8601($timestamp,$utc=true){
+	$datestr = date('Y-m-d\TH:i:sO',$timestamp);
+	if($utc){
+		$eregStr =
+		'([0-9]{4})-'.	// centuries & years CCYY-
+		'([0-9]{2})-'.	// months MM-
+		'([0-9]{2})'.	// days DD
+		'T'.			// separator T
+		'([0-9]{2}):'.	// hours hh:
+		'([0-9]{2}):'.	// minutes mm:
+		'([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss...
+		'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
+
+		if(ereg($eregStr,$datestr,$regs)){
+			return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
+		}
+		return false;
+	} else {
+		return $datestr;
+	}
+}
+
+/**
+* convert ISO 8601 compliant date string to unix timestamp
+*
+* @param    string $datestr ISO 8601 compliant date string
+* @access   public
+*/
+function iso8601_to_timestamp($datestr){
+	$eregStr =
+	'([0-9]{4})-'.	// centuries & years CCYY-
+	'([0-9]{2})-'.	// months MM-
+	'([0-9]{2})'.	// days DD
+	'T'.			// separator T
+	'([0-9]{2}):'.	// hours hh:
+	'([0-9]{2}):'.	// minutes mm:
+	'([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss...
+	'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
+	if(ereg($eregStr,$datestr,$regs)){
+		// not utc
+		if($regs[8] != 'Z'){
+			$op = substr($regs[8],0,1);
+			$h = substr($regs[8],1,2);
+			$m = substr($regs[8],strlen($regs[8])-2,2);
+			if($op == '-'){
+				$regs[4] = $regs[4] + $h;
+				$regs[5] = $regs[5] + $m;
+			} elseif($op == '+'){
+				$regs[4] = $regs[4] - $h;
+				$regs[5] = $regs[5] - $m;
+			}
+		}
+		return strtotime("$regs[1]-$regs[2]-$regs[3] $regs[4]:$regs[5]:$regs[6]Z");
+	} else {
+		return false;
+	}
+}
+
+/**
+* sleeps some number of microseconds
+*
+* @param    string $usec the number of microseconds to sleep
+* @access   public
+* @deprecated
+*/
+function usleepWindows($usec)
+{
+	$start = gettimeofday();
+	
+	do
+	{
+		$stop = gettimeofday();
+		$timePassed = 1000000 * ($stop['sec'] - $start['sec'])
+		+ $stop['usec'] - $start['usec'];
+	}
+	while ($timePassed < $usec);
+}
+
+?><?php
+
+
+
+/**
+* Contains information for a SOAP fault.
+* Mainly used for returning faults from deployed functions
+* in a server instance.
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access public
+*/
+class soap_fault extends nusoap_base {
+	/**
+	 * The fault code (client|server)
+	 * @var string
+	 * @access private
+	 */
+	var $faultcode;
+	/**
+	 * The fault actor
+	 * @var string
+	 * @access private
+	 */
+	var $faultactor;
+	/**
+	 * The fault string, a description of the fault
+	 * @var string
+	 * @access private
+	 */
+	var $faultstring;
+	/**
+	 * The fault detail, typically a string or array of string
+	 * @var mixed
+	 * @access private
+	 */
+	var $faultdetail;
+
+	/**
+	* constructor
+    *
+    * @param string $faultcode (client | server)
+    * @param string $faultactor only used when msg routed between multiple actors
+    * @param string $faultstring human readable error message
+    * @param mixed $faultdetail detail, typically a string or array of string
+	*/
+	function soap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
+		parent::nusoap_base();
+		$this->faultcode = $faultcode;
+		$this->faultactor = $faultactor;
+		$this->faultstring = $faultstring;
+		$this->faultdetail = $faultdetail;
+	}
+
+	/**
+	* serialize a fault
+	*
+	* @return	string	The serialization of the fault instance.
+	* @access   public
+	*/
+	function serialize(){
+		$ns_string = '';
+		foreach($this->namespaces as $k => $v){
+			$ns_string .= "\n  xmlns:$k=\"$v\"";
+		}
+		$return_msg =
+			'<?xml version="1.0" encoding="'.$this->soap_defencoding.'"?>'.
+			'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"'.$ns_string.">\n".
+				'<SOAP-ENV:Body>'.
+				'<SOAP-ENV:Fault>'.
+					$this->serialize_val($this->faultcode, 'faultcode').
+					$this->serialize_val($this->faultactor, 'faultactor').
+					$this->serialize_val($this->faultstring, 'faultstring').
+					$this->serialize_val($this->faultdetail, 'detail').
+				'</SOAP-ENV:Fault>'.
+				'</SOAP-ENV:Body>'.
+			'</SOAP-ENV:Envelope>';
+		return $return_msg;
+	}
+}
+
+
+
+?><?php
+
+
+
+/**
+* parses an XML Schema, allows access to it's data, other utility methods
+* no validation... yet.
+* very experimental and limited. As is discussed on XML-DEV, I'm one of the people
+* that just doesn't have time to read the spec(s) thoroughly, and just have a couple of trusty
+* tutorials I refer to :)
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class XMLSchema extends nusoap_base  {
+	
+	// files
+	var $schema = '';
+	var $xml = '';
+	// namespaces
+	var $enclosingNamespaces;
+	// schema info
+	var $schemaInfo = array();
+	var $schemaTargetNamespace = '';
+	// types, elements, attributes defined by the schema
+	var $attributes = array();
+	var $complexTypes = array();
+	var $complexTypeStack = array();
+	var $currentComplexType = null;
+	var $elements = array();
+	var $elementStack = array();
+	var $currentElement = null;
+	var $simpleTypes = array();
+	var $simpleTypeStack = array();
+	var $currentSimpleType = null;
+	// imports
+	var $imports = array();
+	// parser vars
+	var $parser;
+	var $position = 0;
+	var $depth = 0;
+	var $depth_array = array();
+	var $message = array();
+	var $defaultNamespace = array();
+    
+	/**
+	* constructor
+	*
+	* @param    string $schema schema document URI
+	* @param    string $xml xml document URI
+	* @param	string $namespaces namespaces defined in enclosing XML
+	* @access   public
+	*/
+	function XMLSchema($schema='',$xml='',$namespaces=array()){
+		parent::nusoap_base();
+		$this->debug('xmlschema class instantiated, inside constructor');
+		// files
+		$this->schema = $schema;
+		$this->xml = $xml;
+
+		// namespaces
+		$this->enclosingNamespaces = $namespaces;
+		$this->namespaces = array_merge($this->namespaces, $namespaces);
+
+		// parse schema file
+		if($schema != ''){
+			$this->debug('initial schema file: '.$schema);
+			$this->parseFile($schema, 'schema');
+		}
+
+		// parse xml file
+		if($xml != ''){
+			$this->debug('initial xml file: '.$xml);
+			$this->parseFile($xml, 'xml');
+		}
+
+	}
+
+    /**
+    * parse an XML file
+    *
+    * @param string $xml, path/URL to XML file
+    * @param string $type, (schema | xml)
+	* @return boolean
+    * @access public
+    */
+	function parseFile($xml,$type){
+		// parse xml file
+		if($xml != ""){
+			$xmlStr = @join("", at file($xml));
+			if($xmlStr == ""){
+				$msg = 'Error reading XML from '.$xml;
+				$this->setError($msg);
+				$this->debug($msg);
+			return false;
+			} else {
+				$this->debug("parsing $xml");
+				$this->parseString($xmlStr,$type);
+				$this->debug("done parsing $xml");
+			return true;
+			}
+		}
+		return false;
+	}
+
+	/**
+	* parse an XML string
+	*
+	* @param    string $xml path or URL
+    * @param string $type, (schema|xml)
+	* @access   private
+	*/
+	function parseString($xml,$type){
+		// parse xml string
+		if($xml != ""){
+
+	    	// Create an XML parser.
+	    	$this->parser = xml_parser_create();
+	    	// Set the options for parsing the XML data.
+	    	xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
+
+	    	// Set the object for the parser.
+	    	xml_set_object($this->parser, $this);
+
+	    	// Set the element handlers for the parser.
+			if($type == "schema"){
+		    	xml_set_element_handler($this->parser, 'schemaStartElement','schemaEndElement');
+		    	xml_set_character_data_handler($this->parser,'schemaCharacterData');
+			} elseif($type == "xml"){
+				xml_set_element_handler($this->parser, 'xmlStartElement','xmlEndElement');
+		    	xml_set_character_data_handler($this->parser,'xmlCharacterData');
+			}
+
+		    // Parse the XML file.
+		    if(!xml_parse($this->parser,$xml,true)){
+			// Display an error message.
+				$errstr = sprintf('XML error parsing XML schema on line %d: %s',
+				xml_get_current_line_number($this->parser),
+				xml_error_string(xml_get_error_code($this->parser))
+				);
+				$this->debug($errstr);
+				$this->debug("XML payload:\n" . $xml);
+				$this->setError($errstr);
+	    	}
+            
+			xml_parser_free($this->parser);
+		} else{
+			$this->debug('no xml passed to parseString()!!');
+			$this->setError('no xml passed to parseString()!!');
+		}
+	}
+
+	/**
+	* start-element handler
+	*
+	* @param    string $parser XML parser object
+	* @param    string $name element name
+	* @param    string $attrs associative array of attributes
+	* @access   private
+	*/
+	function schemaStartElement($parser, $name, $attrs) {
+		
+		// position in the total number of elements, starting from 0
+		$pos = $this->position++;
+		$depth = $this->depth++;
+		// set self as current value for this depth
+		$this->depth_array[$depth] = $pos;
+		$this->message[$pos] = array('cdata' => ''); 
+		if ($depth > 0) {
+			$this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]];
+		} else {
+			$this->defaultNamespace[$pos] = false;
+		}
+
+		// get element prefix
+		if($prefix = $this->getPrefix($name)){
+			// get unqualified name
+			$name = $this->getLocalPart($name);
+		} else {
+        	$prefix = '';
+        }
+		
+        // loop thru attributes, expanding, and registering namespace declarations
+        if(count($attrs) > 0){
+        	foreach($attrs as $k => $v){
+                // if ns declarations, add to class level array of valid namespaces
+				if(ereg("^xmlns",$k)){
+                	//$this->xdebug("$k: $v");
+                	//$this->xdebug('ns_prefix: '.$this->getPrefix($k));
+                	if($ns_prefix = substr(strrchr($k,':'),1)){
+                		//$this->xdebug("Add namespace[$ns_prefix] = $v");
+						$this->namespaces[$ns_prefix] = $v;
+					} else {
+						$this->defaultNamespace[$pos] = $v;
+						if (! $this->getPrefixFromNamespace($v)) {
+							$this->namespaces['ns'.(count($this->namespaces)+1)] = $v;
+						}
+					}
+					if($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema'){
+						$this->XMLSchemaVersion = $v;
+						$this->namespaces['xsi'] = $v.'-instance';
+					}
+				}
+        	}
+        	foreach($attrs as $k => $v){
+                // expand each attribute
+                $k = strpos($k,':') ? $this->expandQname($k) : $k;
+                $v = strpos($v,':') ? $this->expandQname($v) : $v;
+        		$eAttrs[$k] = $v;
+        	}
+        	$attrs = $eAttrs;
+        } else {
+        	$attrs = array();
+        }
+		// find status, register data
+		switch($name){
+			case 'all':			// (optional) compositor content for a complexType
+			case 'choice':
+			case 'group':
+			case 'sequence':
+				//$this->xdebug("compositor $name for currentComplexType: $this->currentComplexType and currentElement: $this->currentElement");
+				$this->complexTypes[$this->currentComplexType]['compositor'] = $name;
+				//if($name == 'all' || $name == 'sequence'){
+				//	$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
+				//}
+			break;
+			case 'attribute':	// complexType attribute
+            	//$this->xdebug("parsing attribute $attrs[name] $attrs[ref] of value: ".$attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']);
+            	$this->xdebug("parsing attribute:");
+            	$this->appendDebug($this->varDump($attrs));
+				if (!isset($attrs['form'])) {
+					$attrs['form'] = $this->schemaInfo['attributeFormDefault'];
+				}
+            	if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) {
+					$v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'];
+					if (!strpos($v, ':')) {
+						// no namespace in arrayType attribute value...
+						if ($this->defaultNamespace[$pos]) {
+							// ...so use the default
+							$attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'] = $this->defaultNamespace[$pos] . ':' . $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'];
+						}
+					}
+            	}
+                if(isset($attrs['name'])){
+					$this->attributes[$attrs['name']] = $attrs;
+					$aname = $attrs['name'];
+				} elseif(isset($attrs['ref']) && $attrs['ref'] == 'http://schemas.xmlsoap.org/soap/encoding/:arrayType'){
+					if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) {
+	                	$aname = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'];
+	                } else {
+	                	$aname = '';
+	                }
+				} elseif(isset($attrs['ref'])){
+					$aname = $attrs['ref'];
+                    $this->attributes[$attrs['ref']] = $attrs;
+				}
+                
+				if($this->currentComplexType){	// This should *always* be
+					$this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs;
+				}
+				// arrayType attribute
+				if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']) || $this->getLocalPart($aname) == 'arrayType'){
+					$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
+                	$prefix = $this->getPrefix($aname);
+					if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])){
+						$v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'];
+					} else {
+						$v = '';
+					}
+                    if(strpos($v,'[,]')){
+                        $this->complexTypes[$this->currentComplexType]['multidimensional'] = true;
+                    }
+                    $v = substr($v,0,strpos($v,'[')); // clip the []
+                    if(!strpos($v,':') && isset($this->typemap[$this->XMLSchemaVersion][$v])){
+                        $v = $this->XMLSchemaVersion.':'.$v;
+                    }
+                    $this->complexTypes[$this->currentComplexType]['arrayType'] = $v;
+				}
+			break;
+			case 'complexContent':	// (optional) content for a complexType
+			break;
+			case 'complexType':
+				array_push($this->complexTypeStack, $this->currentComplexType);
+				if(isset($attrs['name'])){
+					$this->xdebug('processing named complexType '.$attrs['name']);
+					//$this->currentElement = false;
+					$this->currentComplexType = $attrs['name'];
+					$this->complexTypes[$this->currentComplexType] = $attrs;
+					$this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
+					// This is for constructs like
+					//           <complexType name="ListOfString" base="soap:Array">
+					//                <sequence>
+					//                    <element name="string" type="xsd:string"
+					//                        minOccurs="0" maxOccurs="unbounded" />
+					//                </sequence>
+					//            </complexType>
+					if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
+						$this->xdebug('complexType is unusual array');
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
+					} else {
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
+					}
+				}else{
+					$this->xdebug('processing unnamed complexType for element '.$this->currentElement);
+					$this->currentComplexType = $this->currentElement . '_ContainedType';
+					//$this->currentElement = false;
+					$this->complexTypes[$this->currentComplexType] = $attrs;
+					$this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
+					// This is for constructs like
+					//           <complexType name="ListOfString" base="soap:Array">
+					//                <sequence>
+					//                    <element name="string" type="xsd:string"
+					//                        minOccurs="0" maxOccurs="unbounded" />
+					//                </sequence>
+					//            </complexType>
+					if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
+						$this->xdebug('complexType is unusual array');
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
+					} else {
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
+					}
+				}
+			break;
+			case 'element':
+				array_push($this->elementStack, $this->currentElement);
+				// elements defined as part of a complex type should
+				// not really be added to $this->elements, but for some
+				// reason, they are
+				if (!isset($attrs['form'])) {
+					$attrs['form'] = $this->schemaInfo['elementFormDefault'];
+				}
+				if(isset($attrs['type'])){
+					$this->xdebug("processing typed element ".$attrs['name']." of type ".$attrs['type']);
+					if (! $this->getPrefix($attrs['type'])) {
+						if ($this->defaultNamespace[$pos]) {
+							$attrs['type'] = $this->defaultNamespace[$pos] . ':' . $attrs['type'];
+							$this->xdebug('used default namespace to make type ' . $attrs['type']);
+						}
+					}
+					// This is for constructs like
+					//           <complexType name="ListOfString" base="soap:Array">
+					//                <sequence>
+					//                    <element name="string" type="xsd:string"
+					//                        minOccurs="0" maxOccurs="unbounded" />
+					//                </sequence>
+					//            </complexType>
+					if ($this->currentComplexType && $this->complexTypes[$this->currentComplexType]['phpType'] == 'array') {
+						$this->xdebug('arrayType for unusual array is ' . $attrs['type']);
+						$this->complexTypes[$this->currentComplexType]['arrayType'] = $attrs['type'];
+					}
+					$this->currentElement = $attrs['name'];
+					$this->elements[ $attrs['name'] ] = $attrs;
+					$this->elements[ $attrs['name'] ]['typeClass'] = 'element';
+					$ename = $attrs['name'];
+				} elseif(isset($attrs['ref'])){
+					$this->xdebug("processing element as ref to ".$attrs['ref']);
+					$this->currentElement = "ref to ".$attrs['ref'];
+					$ename = $this->getLocalPart($attrs['ref']);
+				} else {
+					$this->xdebug("processing untyped element ".$attrs['name']);
+					$this->currentElement = $attrs['name'];
+					$this->elements[ $attrs['name'] ] = $attrs;
+					$this->elements[ $attrs['name'] ]['typeClass'] = 'element';
+					$attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['name'] . '_ContainedType';
+					$this->elements[ $attrs['name'] ]['type'] = $attrs['type'];
+					$ename = $attrs['name'];
+				}
+				if(isset($ename) && $this->currentComplexType){
+					$this->complexTypes[$this->currentComplexType]['elements'][$ename] = $attrs;
+				}
+			break;
+			case 'enumeration':	//	restriction value list member
+				$this->xdebug('enumeration ' . $attrs['value']);
+				if ($this->currentSimpleType) {
+					$this->simpleTypes[$this->currentSimpleType]['enumeration'][] = $attrs['value'];
+				} elseif ($this->currentComplexType) {
+					$this->complexTypes[$this->currentComplexType]['enumeration'][] = $attrs['value'];
+				}
+			break;
+			case 'extension':	// simpleContent or complexContent type extension
+				$this->xdebug('extension ' . $attrs['base']);
+				if ($this->currentComplexType) {
+					$this->complexTypes[$this->currentComplexType]['extensionBase'] = $attrs['base'];
+				}
+			break;
+			case 'import':
+			    if (isset($attrs['schemaLocation'])) {
+					//$this->xdebug('import namespace ' . $attrs['namespace'] . ' from ' . $attrs['schemaLocation']);
+                    $this->imports[$attrs['namespace']][] = array('location' => $attrs['schemaLocation'], 'loaded' => false);
+				} else {
+					//$this->xdebug('import namespace ' . $attrs['namespace']);
+                    $this->imports[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
+					if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
+						$this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace'];
+					}
+				}
+			break;
+			case 'list':	// simpleType value list
+			break;
+			case 'restriction':	// simpleType, simpleContent or complexContent value restriction
+				$this->xdebug('restriction ' . $attrs['base']);
+				if($this->currentSimpleType){
+					$this->simpleTypes[$this->currentSimpleType]['type'] = $attrs['base'];
+				} elseif($this->currentComplexType){
+					$this->complexTypes[$this->currentComplexType]['restrictionBase'] = $attrs['base'];
+					if(strstr($attrs['base'],':') == ':Array'){
+						$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
+					}
+				}
+			break;
+			case 'schema':
+				$this->schemaInfo = $attrs;
+				$this->schemaInfo['schemaVersion'] = $this->getNamespaceFromPrefix($prefix);
+				if (isset($attrs['targetNamespace'])) {
+					$this->schemaTargetNamespace = $attrs['targetNamespace'];
+				}
+				if (!isset($attrs['elementFormDefault'])) {
+					$this->schemaInfo['elementFormDefault'] = 'unqualified';
+				}
+				if (!isset($attrs['attributeFormDefault'])) {
+					$this->schemaInfo['attributeFormDefault'] = 'unqualified';
+				}
+			break;
+			case 'simpleContent':	// (optional) content for a complexType
+			break;
+			case 'simpleType':
+				array_push($this->simpleTypeStack, $this->currentSimpleType);
+				if(isset($attrs['name'])){
+					$this->xdebug("processing simpleType for name " . $attrs['name']);
+					$this->currentSimpleType = $attrs['name'];
+					$this->simpleTypes[ $attrs['name'] ] = $attrs;
+					$this->simpleTypes[ $attrs['name'] ]['typeClass'] = 'simpleType';
+					$this->simpleTypes[ $attrs['name'] ]['phpType'] = 'scalar';
+				} else {
+					$this->xdebug('processing unnamed simpleType for element '.$this->currentElement);
+					$this->currentSimpleType = $this->currentElement . '_ContainedType';
+					//$this->currentElement = false;
+					$this->simpleTypes[$this->currentSimpleType] = $attrs;
+					$this->simpleTypes[$this->currentSimpleType]['phpType'] = 'scalar';
+				}
+			break;
+			case 'union':	// simpleType type list
+			break;
+			default:
+				//$this->xdebug("do not have anything to do for element $name");
+		}
+	}
+
+	/**
+	* end-element handler
+	*
+	* @param    string $parser XML parser object
+	* @param    string $name element name
+	* @access   private
+	*/
+	function schemaEndElement($parser, $name) {
+		// bring depth down a notch
+		$this->depth--;
+		// position of current element is equal to the last value left in depth_array for my depth
+		if(isset($this->depth_array[$this->depth])){
+        	$pos = $this->depth_array[$this->depth];
+        }
+		// get element prefix
+		if ($prefix = $this->getPrefix($name)){
+			// get unqualified name
+			$name = $this->getLocalPart($name);
+		} else {
+        	$prefix = '';
+        }
+		// move on...
+		if($name == 'complexType'){
+			$this->xdebug('done processing complexType ' . ($this->currentComplexType ? $this->currentComplexType : '(unknown)'));
+			$this->currentComplexType = array_pop($this->complexTypeStack);
+			//$this->currentElement = false;
+		}
+		if($name == 'element'){
+			$this->xdebug('done processing element ' . ($this->currentElement ? $this->currentElement : '(unknown)'));
+			$this->currentElement = array_pop($this->elementStack);
+		}
+		if($name == 'simpleType'){
+			$this->xdebug('done processing simpleType ' . ($this->currentSimpleType ? $this->currentSimpleType : '(unknown)'));
+			$this->currentSimpleType = array_pop($this->simpleTypeStack);
+		}
+	}
+
+	/**
+	* element content handler
+	*
+	* @param    string $parser XML parser object
+	* @param    string $data element content
+	* @access   private
+	*/
+	function schemaCharacterData($parser, $data){
+		$pos = $this->depth_array[$this->depth - 1];
+		$this->message[$pos]['cdata'] .= $data;
+	}
+
+	/**
+	* serialize the schema
+	*
+	* @access   public
+	*/
+	function serializeSchema(){
+
+		$schemaPrefix = $this->getPrefixFromNamespace($this->XMLSchemaVersion);
+		$xml = '';
+		// imports
+		if (sizeof($this->imports) > 0) {
+			foreach($this->imports as $ns => $list) {
+				foreach ($list as $ii) {
+					if ($ii['location'] != '') {
+						$xml .= " <$schemaPrefix:import location=\"" . $ii['location'] . '" namespace="' . $ns . "\" />\n";
+					} else {
+						$xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n";
+					}
+				}
+			} 
+		} 
+		// complex types
+		foreach($this->complexTypes as $typeName => $attrs){
+			$contentStr = '';
+			// serialize child elements
+			if(isset($attrs['elements']) && (count($attrs['elements']) > 0)){
+				foreach($attrs['elements'] as $element => $eParts){
+					if(isset($eParts['ref'])){
+						$contentStr .= "   <$schemaPrefix:element ref=\"$element\"/>\n";
+					} else {
+						$contentStr .= "   <$schemaPrefix:element name=\"$element\" type=\"" . $this->contractQName($eParts['type']) . "\"";
+						foreach ($eParts as $aName => $aValue) {
+							// handle, e.g., abstract, default, form, minOccurs, maxOccurs, nillable
+							if ($aName != 'name' && $aName != 'type') {
+								$contentStr .= " $aName=\"$aValue\"";
+							}
+						}
+						$contentStr .= "/>\n";
+					}
+				}
+				// compositor wraps elements
+				if (isset($attrs['compositor']) && ($attrs['compositor'] != '')) {
+					$contentStr = "  <$schemaPrefix:$attrs[compositor]>\n".$contentStr."  </$schemaPrefix:$attrs[compositor]>\n";
+				}
+			}
+			// attributes
+			if(isset($attrs['attrs']) && (count($attrs['attrs']) >= 1)){
+				foreach($attrs['attrs'] as $attr => $aParts){
+					$contentStr .= "    <$schemaPrefix:attribute";
+					foreach ($aParts as $a => $v) {
+						if ($a == 'ref' || $a == 'type') {
+							$contentStr .= " $a=\"".$this->contractQName($v).'"';
+						} elseif ($a == 'http://schemas.xmlsoap.org/wsdl/:arrayType') {
+							$this->usedNamespaces['wsdl'] = $this->namespaces['wsdl'];
+							$contentStr .= ' wsdl:arrayType="'.$this->contractQName($v).'"';
+						} else {
+							$contentStr .= " $a=\"$v\"";
+						}
+					}
+					$contentStr .= "/>\n";
+				}
+			}
+			// if restriction
+			if (isset($attrs['restrictionBase']) && $attrs['restrictionBase'] != ''){
+				$contentStr = "   <$schemaPrefix:restriction base=\"".$this->contractQName($attrs['restrictionBase'])."\">\n".$contentStr."   </$schemaPrefix:restriction>\n";
+				// complex or simple content
+				if ((isset($attrs['elements']) && count($attrs['elements']) > 0) || (isset($attrs['attrs']) && count($attrs['attrs']) > 0)){
+					$contentStr = "  <$schemaPrefix:complexContent>\n".$contentStr."  </$schemaPrefix:complexContent>\n";
+				}
+			}
+			// finalize complex type
+			if($contentStr != ''){
+				$contentStr = " <$schemaPrefix:complexType name=\"$typeName\">\n".$contentStr." </$schemaPrefix:complexType>\n";
+			} else {
+				$contentStr = " <$schemaPrefix:complexType name=\"$typeName\"/>\n";
+			}
+			$xml .= $contentStr;
+		}
+		// simple types
+		if(isset($this->simpleTypes) && count($this->simpleTypes) > 0){
+			foreach($this->simpleTypes as $typeName => $eParts){
+				$xml .= " <$schemaPrefix:simpleType name=\"$typeName\">\n  <$schemaPrefix:restriction base=\"".$this->contractQName($eParts['type'])."\"/>\n";
+				if (isset($eParts['enumeration'])) {
+					foreach ($eParts['enumeration'] as $e) {
+						$xml .= "  <$schemaPrefix:enumeration value=\"$e\"/>\n";
+					}
+				}
+				$xml .= " </$schemaPrefix:simpleType>";
+			}
+		}
+		// elements
+		if(isset($this->elements) && count($this->elements) > 0){
+			foreach($this->elements as $element => $eParts){
+				$xml .= " <$schemaPrefix:element name=\"$element\" type=\"".$this->contractQName($eParts['type'])."\"/>\n";
+			}
+		}
+		// attributes
+		if(isset($this->attributes) && count($this->attributes) > 0){
+			foreach($this->attributes as $attr => $aParts){
+				$xml .= " <$schemaPrefix:attribute name=\"$attr\" type=\"".$this->contractQName($aParts['type'])."\"\n/>";
+			}
+		}
+		// finish 'er up
+		$el = "<$schemaPrefix:schema targetNamespace=\"$this->schemaTargetNamespace\"\n";
+		foreach (array_diff($this->usedNamespaces, $this->enclosingNamespaces) as $nsp => $ns) {
+			$el .= " xmlns:$nsp=\"$ns\"\n";
+		}
+		$xml = $el . ">\n".$xml."</$schemaPrefix:schema>\n";
+		return $xml;
+	}
+
+	/**
+	* adds debug data to the clas level debug string
+	*
+	* @param    string $string debug data
+	* @access   private
+	*/
+	function xdebug($string){
+		$this->debug('<' . $this->schemaTargetNamespace . '> '.$string);
+	}
+
+    /**
+    * get the PHP type of a user defined type in the schema
+    * PHP type is kind of a misnomer since it actually returns 'struct' for assoc. arrays
+    * returns false if no type exists, or not w/ the given namespace
+    * else returns a string that is either a native php type, or 'struct'
+    *
+    * @param string $type, name of defined type
+    * @param string $ns, namespace of type
+    * @return mixed
+    * @access public
+    * @deprecated
+    */
+	function getPHPType($type,$ns){
+		if(isset($this->typemap[$ns][$type])){
+			//print "found type '$type' and ns $ns in typemap<br>";
+			return $this->typemap[$ns][$type];
+		} elseif(isset($this->complexTypes[$type])){
+			//print "getting type '$type' and ns $ns from complexTypes array<br>";
+			return $this->complexTypes[$type]['phpType'];
+		}
+		return false;
+	}
+
+	/**
+    * returns an associative array of information about a given type
+    * returns false if no type exists by the given name
+    *
+	*	For a complexType typeDef = array(
+	*	'restrictionBase' => '',
+	*	'phpType' => '',
+	*	'compositor' => '(sequence|all)',
+	*	'elements' => array(), // refs to elements array
+	*	'attrs' => array() // refs to attributes array
+	*	... and so on (see addComplexType)
+	*	)
+	*
+	*   For simpleType or element, the array has different keys.
+    *
+    * @param string
+    * @return mixed
+    * @access public
+    * @see addComplexType
+    * @see addSimpleType
+    * @see addElement
+    */
+	function getTypeDef($type){
+		//$this->debug("in getTypeDef for type $type");
+		if(isset($this->complexTypes[$type])){
+			$this->xdebug("in getTypeDef, found complexType $type");
+			return $this->complexTypes[$type];
+		} elseif(isset($this->simpleTypes[$type])){
+			$this->xdebug("in getTypeDef, found simpleType $type");
+			if (!isset($this->simpleTypes[$type]['phpType'])) {
+				// get info for type to tack onto the simple type
+				// TODO: can this ever really apply (i.e. what is a simpleType really?)
+				$uqType = substr($this->simpleTypes[$type]['type'], strrpos($this->simpleTypes[$type]['type'], ':') + 1);
+				$ns = substr($this->simpleTypes[$type]['type'], 0, strrpos($this->simpleTypes[$type]['type'], ':'));
+				$etype = $this->getTypeDef($uqType);
+				if ($etype) {
+					$this->xdebug("in getTypeDef, found type for simpleType $type:");
+					$this->xdebug($this->varDump($etype));
+					if (isset($etype['phpType'])) {
+						$this->simpleTypes[$type]['phpType'] = $etype['phpType'];
+					}
+					if (isset($etype['elements'])) {
+						$this->simpleTypes[$type]['elements'] = $etype['elements'];
+					}
+				}
+			}
+			return $this->simpleTypes[$type];
+		} elseif(isset($this->elements[$type])){
+			$this->xdebug("in getTypeDef, found element $type");
+			if (!isset($this->elements[$type]['phpType'])) {
+				// get info for type to tack onto the element
+				$uqType = substr($this->elements[$type]['type'], strrpos($this->elements[$type]['type'], ':') + 1);
+				$ns = substr($this->elements[$type]['type'], 0, strrpos($this->elements[$type]['type'], ':'));
+				$etype = $this->getTypeDef($uqType);
+				if ($etype) {
+					$this->xdebug("in getTypeDef, found type for element $type:");
+					$this->xdebug($this->varDump($etype));
+					if (isset($etype['phpType'])) {
+						$this->elements[$type]['phpType'] = $etype['phpType'];
+					}
+					if (isset($etype['elements'])) {
+						$this->elements[$type]['elements'] = $etype['elements'];
+					}
+				} elseif ($ns == 'http://www.w3.org/2001/XMLSchema') {
+					$this->xdebug("in getTypeDef, element $type is an XSD type");
+					$this->elements[$type]['phpType'] = 'scalar';
+				}
+			}
+			return $this->elements[$type];
+		} elseif(isset($this->attributes[$type])){
+			$this->xdebug("in getTypeDef, found attribute $type");
+			return $this->attributes[$type];
+		} elseif (ereg('_ContainedType$', $type)) {
+			$this->xdebug("in getTypeDef, have an untyped element $type");
+			$typeDef['typeClass'] = 'simpleType';
+			$typeDef['phpType'] = 'scalar';
+			$typeDef['type'] = 'http://www.w3.org/2001/XMLSchema:string';
+			return $typeDef;
+		}
+		$this->xdebug("in getTypeDef, did not find $type");
+		return false;
+	}
+
+	/**
+    * returns a sample serialization of a given type, or false if no type by the given name
+    *
+    * @param string $type, name of type
+    * @return mixed
+    * @access public
+    * @deprecated
+    */
+    function serializeTypeDef($type){
+    	//print "in sTD() for type $type<br>";
+	if($typeDef = $this->getTypeDef($type)){
+		$str .= '<'.$type;
+	    if(is_array($typeDef['attrs'])){
+		foreach($attrs as $attName => $data){
+		    $str .= " $attName=\"{type = ".$data['type']."}\"";
+		}
+	    }
+	    $str .= " xmlns=\"".$this->schema['targetNamespace']."\"";
+	    if(count($typeDef['elements']) > 0){
+		$str .= ">";
+		foreach($typeDef['elements'] as $element => $eData){
+		    $str .= $this->serializeTypeDef($element);
+		}
+		$str .= "</$type>";
+	    } elseif($typeDef['typeClass'] == 'element') {
+		$str .= "></$type>";
+	    } else {
+		$str .= "/>";
+	    }
+			return $str;
+	}
+    	return false;
+    }
+
+    /**
+    * returns HTML form elements that allow a user
+    * to enter values for creating an instance of the given type.
+    *
+    * @param string $name, name for type instance
+    * @param string $type, name of type
+    * @return string
+    * @access public
+    * @deprecated
+	*/
+	function typeToForm($name,$type){
+		// get typedef
+		if($typeDef = $this->getTypeDef($type)){
+			// if struct
+			if($typeDef['phpType'] == 'struct'){
+				$buffer .= '<table>';
+				foreach($typeDef['elements'] as $child => $childDef){
+					$buffer .= "
+					<tr><td align='right'>$childDef[name] (type: ".$this->getLocalPart($childDef['type'])."):</td>
+					<td><input type='text' name='parameters[".$name."][$childDef[name]]'></td></tr>";
+				}
+				$buffer .= '</table>';
+			// if array
+			} elseif($typeDef['phpType'] == 'array'){
+				$buffer .= '<table>';
+				for($i=0;$i < 3; $i++){
+					$buffer .= "
+					<tr><td align='right'>array item (type: $typeDef[arrayType]):</td>
+					<td><input type='text' name='parameters[".$name."][]'></td></tr>";
+				}
+				$buffer .= '</table>';
+			// if scalar
+			} else {
+				$buffer .= "<input type='text' name='parameters[$name]'>";
+			}
+		} else {
+			$buffer .= "<input type='text' name='parameters[$name]'>";
+		}
+		return $buffer;
+	}
+	
+	/**
+	* adds a complex type to the schema
+	* 
+	* example: array
+	* 
+	* addType(
+	* 	'ArrayOfstring',
+	* 	'complexType',
+	* 	'array',
+	* 	'',
+	* 	'SOAP-ENC:Array',
+	* 	array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'),
+	* 	'xsd:string'
+	* );
+	* 
+	* example: PHP associative array ( SOAP Struct )
+	* 
+	* addType(
+	* 	'SOAPStruct',
+	* 	'complexType',
+	* 	'struct',
+	* 	'all',
+	* 	array('myVar'=> array('name'=>'myVar','type'=>'string')
+	* );
+	* 
+	* @param name
+	* @param typeClass (complexType|simpleType|attribute)
+	* @param phpType: currently supported are array and struct (php assoc array)
+	* @param compositor (all|sequence|choice)
+	* @param restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
+	* @param elements = array ( name = array(name=>'',type=>'') )
+	* @param attrs = array(
+	* 	array(
+	*		'ref' => "http://schemas.xmlsoap.org/soap/encoding/:arrayType",
+	*		"http://schemas.xmlsoap.org/wsdl/:arrayType" => "string[]"
+	* 	)
+	* )
+	* @param arrayType: namespace:name (http://www.w3.org/2001/XMLSchema:string)
+	* @access public
+	* @see getTypeDef
+	*/
+	function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType=''){
+		$this->complexTypes[$name] = array(
+	    'name'		=> $name,
+	    'typeClass'	=> $typeClass,
+	    'phpType'	=> $phpType,
+		'compositor'=> $compositor,
+	    'restrictionBase' => $restrictionBase,
+		'elements'	=> $elements,
+	    'attrs'		=> $attrs,
+	    'arrayType'	=> $arrayType
+		);
+		
+		$this->xdebug("addComplexType $name:");
+		$this->appendDebug($this->varDump($this->complexTypes[$name]));
+	}
+	
+	/**
+	* adds a simple type to the schema
+	*
+	* @param string $name
+	* @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
+	* @param string $typeClass (should always be simpleType)
+	* @param string $phpType (should always be scalar)
+	* @param array $enumeration array of values
+	* @access public
+	* @see xmlschema
+	* @see getTypeDef
+	*/
+	function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) {
+		$this->simpleTypes[$name] = array(
+	    'name'			=> $name,
+	    'typeClass'		=> $typeClass,
+	    'phpType'		=> $phpType,
+	    'type'			=> $restrictionBase,
+	    'enumeration'	=> $enumeration
+		);
+		
+		$this->xdebug("addSimpleType $name:");
+		$this->appendDebug($this->varDump($this->simpleTypes[$name]));
+	}
+
+	/**
+	* adds an element to the schema
+	*
+	* @param array $attrs attributes that must include name and type
+	* @see xmlschema
+	* @access public
+	*/
+	function addElement($attrs) {
+		if (! $this->getPrefix($attrs['type'])) {
+			$attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type'];
+		}
+		$this->elements[ $attrs['name'] ] = $attrs;
+		$this->elements[ $attrs['name'] ]['typeClass'] = 'element';
+		
+		$this->xdebug("addElement " . $attrs['name']);
+		$this->appendDebug($this->varDump($this->elements[ $attrs['name'] ]));
+	}
+}
+
+
+
+?><?php
+
+
+
+/**
+* For creating serializable abstractions of native PHP types.  This class
+* allows element name/namespace, XSD type, and XML attributes to be
+* associated with a value.  This is extremely useful when WSDL is not
+* used, but is also useful when WSDL is used with polymorphic types, including
+* xsd:anyType and user-defined types.
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class soapval extends nusoap_base {
+	/**
+	 * The XML element name
+	 *
+	 * @var string
+	 * @access private
+	 */
+	var $name;
+	/**
+	 * The XML type name (string or false)
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $type;
+	/**
+	 * The PHP value
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $value;
+	/**
+	 * The XML element namespace (string or false)
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $element_ns;
+	/**
+	 * The XML type namespace (string or false)
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $type_ns;
+	/**
+	 * The XML element attributes (array or false)
+	 *
+	 * @var mixed
+	 * @access private
+	 */
+	var $attributes;
+
+	/**
+	* constructor
+	*
+	* @param    string $name optional name
+	* @param    mixed $type optional type name
+	* @param	mixed $value optional value
+	* @param	mixed $element_ns optional namespace of value
+	* @param	mixed $type_ns optional namespace of type
+	* @param	mixed $attributes associative array of attributes to add to element serialization
+	* @access   public
+	*/
+  	function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
+		parent::nusoap_base();
+		$this->name = $name;
+		$this->type = $type;
+		$this->value = $value;
+		$this->element_ns = $element_ns;
+		$this->type_ns = $type_ns;
+		$this->attributes = $attributes;
+    }
+
+	/**
+	* return serialized value
+	*
+	* @param	string $use The WSDL use value (encoded|literal)
+	* @return	string XML data
+	* @access   public
+	*/
+	function serialize($use='encoded') {
+		return $this->serialize_val($this->value,$this->name,$this->type,$this->element_ns,$this->type_ns,$this->attributes,$use);
+    }
+
+	/**
+	* decodes a soapval object into a PHP native type
+	*
+	* @return	mixed
+	* @access   public
+	*/
+	function decode(){
+		return $this->value;
+	}
+}
+
+
+
+?><?php
+
+
+
+/**
+* transport class for sending/receiving data via HTTP and HTTPS
+* NOTE: PHP must be compiled with the CURL extension for HTTPS support
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access public
+*/
+class soap_transport_http extends nusoap_base {
+
+	var $url = '';
+	var $uri = '';
+	var $digest_uri = '';
+	var $scheme = '';
+	var $host = '';
+	var $port = '';
+	var $path = '';
+	var $request_method = 'POST';
+	var $protocol_version = '1.0';
+	var $encoding = '';
+	var $outgoing_headers = array();
+	var $incoming_headers = array();
+	var $incoming_cookies = array();
+	var $outgoing_payload = '';
+	var $incoming_payload = '';
+	var $useSOAPAction = true;
+	var $persistentConnection = false;
+	var $ch = false;	// cURL handle
+	var $username = '';
+	var $password = '';
+	var $authtype = '';
+	var $digestRequest = array();
+	var $certRequest = array();	// keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional)
+								// cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem'
+								// sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem'
+								// sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem'
+								// passphrase: SSL key password/passphrase
+								// verifypeer: default is 1
+								// verifyhost: default is 1
+
+	/**
+	* constructor
+	*/
+	function soap_transport_http($url){
+		parent::nusoap_base();
+		$this->setURL($url);
+		ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+		$this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
+		$this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']);
+	}
+
+	function setURL($url) {
+		$this->url = $url;
+
+		$u = parse_url($url);
+		foreach($u as $k => $v){
+			$this->debug("$k = $v");
+			$this->$k = $v;
+		}
+		
+		// add any GET params to path
+		if(isset($u['query']) && $u['query'] != ''){
+            $this->path .= '?' . $u['query'];
+		}
+		
+		// set default port
+		if(!isset($u['port'])){
+			if($u['scheme'] == 'https'){
+				$this->port = 443;
+			} else {
+				$this->port = 80;
+			}
+		}
+		
+		$this->uri = $this->path;
+		$this->digest_uri = $this->uri;
+		
+		// build headers
+		if (!isset($u['port'])) {
+			$this->outgoing_headers['Host'] = $this->host;
+		} else {
+			$this->outgoing_headers['Host'] = $this->host.':'.$this->port;
+		}
+		$this->debug('set Host: ' . $this->outgoing_headers['Host']);
+
+		if (isset($u['user']) && $u['user'] != '') {
+			$this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : '');
+		}
+	}
+	
+	function connect($connection_timeout=0,$response_timeout=30){
+	  	// For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like
+	  	// "regular" socket.
+	  	// TODO: disabled for now because OpenSSL must be *compiled* in (not just
+	  	//       loaded), and until PHP5 stream_get_wrappers is not available.
+//	  	if ($this->scheme == 'https') {
+//		  	if (version_compare(phpversion(), '4.3.0') >= 0) {
+//		  		if (extension_loaded('openssl')) {
+//		  			$this->scheme = 'ssl';
+//		  			$this->debug('Using SSL over OpenSSL');
+//		  		}
+//		  	}
+//		}
+		$this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port");
+	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
+		// use persistent connection
+		if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){
+			if (!feof($this->fp)) {
+				$this->debug('Re-use persistent connection');
+				return true;
+			}
+			fclose($this->fp);
+			$this->debug('Closed persistent connection at EOF');
+		}
+
+		// munge host if using OpenSSL
+		if ($this->scheme == 'ssl') {
+			$host = 'ssl://' . $this->host;
+		} else {
+			$host = $this->host;
+		}
+		$this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout);
+
+		// open socket
+		if($connection_timeout > 0){
+			$this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout);
+		} else {
+			$this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str);
+		}
+		
+		// test pointer
+		if(!$this->fp) {
+			$msg = 'Couldn\'t open socket connection to server ' . $this->url;
+			if ($this->errno) {
+				$msg .= ', Error ('.$this->errno.'): '.$this->error_str;
+			} else {
+				$msg .= ' prior to connect().  This is often a problem looking up the host name.';
+			}
+			$this->debug($msg);
+			$this->setError($msg);
+			return false;
+		}
+		
+		// set response timeout
+		$this->debug('set response timeout to ' . $response_timeout);
+		socket_set_timeout( $this->fp, $response_timeout);
+
+		$this->debug('socket connected');
+		return true;
+	  } else if ($this->scheme == 'https') {
+		if (!extension_loaded('curl')) {
+			$this->setError('CURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS');
+			return false;
+		}
+		$this->debug('connect using https');
+		// init CURL
+		$this->ch = curl_init();
+		// set url
+		$hostURL = ($this->port != '') ? "https://$this->host:$this->port" : "https://$this->host";
+		// add path
+		$hostURL .= $this->path;
+		curl_setopt($this->ch, CURLOPT_URL, $hostURL);
+		// follow location headers (re-directs)
+		curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);
+		// ask for headers in the response output
+		curl_setopt($this->ch, CURLOPT_HEADER, 1);
+		// ask for the response output as the return value
+		curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
+		// encode
+		// We manage this ourselves through headers and encoding
+//		if(function_exists('gzuncompress')){
+//			curl_setopt($this->ch, CURLOPT_ENCODING, 'deflate');
+//		}
+		// persistent connection
+		if ($this->persistentConnection) {
+			// The way we send data, we cannot use persistent connections, since
+			// there will be some "junk" at the end of our request.
+			//curl_setopt($this->ch, CURL_HTTP_VERSION_1_1, true);
+			$this->persistentConnection = false;
+			$this->outgoing_headers['Connection'] = 'close';
+			$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
+		}
+		// set timeout
+		if ($connection_timeout != 0) {
+			curl_setopt($this->ch, CURLOPT_TIMEOUT, $connection_timeout);
+		}
+		// TODO: cURL has added a connection timeout separate from the response timeout
+		//if ($connection_timeout != 0) {
+		//	curl_setopt($this->ch, CURLOPT_CONNECTIONTIMEOUT, $connection_timeout);
+		//}
+		//if ($response_timeout != 0) {
+		//	curl_setopt($this->ch, CURLOPT_TIMEOUT, $response_timeout);
+		//}
+
+		// recent versions of cURL turn on peer/host checking by default,
+		// while PHP binaries are not compiled with a default location for the
+		// CA cert bundle, so disable peer/host checking.
+//curl_setopt($this->ch, CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt');		
+		curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
+		curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
+
+		// support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo)
+		if ($this->authtype == 'certificate') {
+			if (isset($this->certRequest['cainfofile'])) {
+				curl_setopt($this->ch, CURLOPT_CAINFO, $this->certRequest['cainfofile']);
+			}
+			if (isset($this->certRequest['verifypeer'])) {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']);
+			} else {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 1);
+			}
+			if (isset($this->certRequest['verifyhost'])) {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']);
+			} else {
+				curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 1);
+			}
+			if (isset($this->certRequest['sslcertfile'])) {
+				curl_setopt($this->ch, CURLOPT_SSLCERT, $this->certRequest['sslcertfile']);
+			}
+			if (isset($this->certRequest['sslkeyfile'])) {
+				curl_setopt($this->ch, CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']);
+			}
+			if (isset($this->certRequest['passphrase'])) {
+				curl_setopt($this->ch, CURLOPT_SSLKEYPASSWD , $this->certRequest['passphrase']);
+			}
+		}
+		$this->debug('cURL connection set up');
+		return true;
+	  } else {
+		$this->setError('Unknown scheme ' . $this->scheme);
+		$this->debug('Unknown scheme ' . $this->scheme);
+		return false;
+	  }
+	}
+	
+	/**
+	* send the SOAP message via HTTP
+	*
+	* @param    string $data message data
+	* @param    integer $timeout set connection timeout in seconds
+	* @param	integer $response_timeout set response timeout in seconds
+	* @param	array $cookies cookies to send
+	* @return	string data
+	* @access   public
+	*/
+	function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) {
+		
+		$this->debug('entered send() with data of length: '.strlen($data));
+
+		$this->tryagain = true;
+		$tries = 0;
+		while ($this->tryagain) {
+			$this->tryagain = false;
+			if ($tries++ < 2) {
+				// make connnection
+				if (!$this->connect($timeout, $response_timeout)){
+					return false;
+				}
+				
+				// send request
+				if (!$this->sendRequest($data, $cookies)){
+					return false;
+				}
+				
+				// get response
+				$respdata = $this->getResponse();
+			} else {
+				$this->setError('Too many tries to get an OK response');
+			}
+		}		
+		$this->debug('end of send()');
+		return $respdata;
+	}
+
+
+	/**
+	* send the SOAP message via HTTPS 1.0 using CURL
+	*
+	* @param    string $msg message data
+	* @param    integer $timeout set connection timeout in seconds
+	* @param	integer $response_timeout set response timeout in seconds
+	* @param	array $cookies cookies to send
+	* @return	string data
+	* @access   public
+	*/
+	function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) {
+		return $this->send($data, $timeout, $response_timeout, $cookies);
+	}
+	
+	/**
+	* if authenticating, set user credentials here
+	*
+	* @param    string $username
+	* @param    string $password
+	* @param	string $authtype (basic, digest, certificate)
+	* @param	array $digestRequest (keys must be nonce, nc, realm, qop)
+	* @param	array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)
+	* @access   public
+	*/
+	function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) {
+		$this->debug("Set credentials for authtype $authtype");
+		// cf. RFC 2617
+		if ($authtype == 'basic') {
+			$this->outgoing_headers['Authorization'] = 'Basic '.base64_encode(str_replace(':','',$username).':'.$password);
+		} elseif ($authtype == 'digest') {
+			if (isset($digestRequest['nonce'])) {
+				$digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1;
+				
+				// calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html)
+	
+				// A1 = unq(username-value) ":" unq(realm-value) ":" passwd
+				$A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password;
+	
+				// H(A1) = MD5(A1)
+				$HA1 = md5($A1);
+	
+				// A2 = Method ":" digest-uri-value
+				$A2 = 'POST:' . $this->digest_uri;
+	
+				// H(A2)
+				$HA2 =  md5($A2);
+	
+				// KD(secret, data) = H(concat(secret, ":", data))
+				// if qop == auth:
+				// request-digest  = <"> < KD ( H(A1),     unq(nonce-value)
+				//                              ":" nc-value
+				//                              ":" unq(cnonce-value)
+				//                              ":" unq(qop-value)
+				//                              ":" H(A2)
+				//                            ) <">
+				// if qop is missing,
+				// request-digest  = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <">
+	
+				$unhashedDigest = '';
+				$nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : '';
+				$cnonce = $nonce;
+				if ($digestRequest['qop'] != '') {
+					$unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2;
+				} else {
+					$unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2;
+				}
+	
+				$hashedDigest = md5($unhashedDigest);
+	
+				$this->outgoing_headers['Authorization'] = 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"';
+			}
+		} elseif ($authtype == 'certificate') {
+			$this->certRequest = $certRequest;
+		}
+		$this->username = $username;
+		$this->password = $password;
+		$this->authtype = $authtype;
+		$this->digestRequest = $digestRequest;
+		
+		if (isset($this->outgoing_headers['Authorization'])) {
+			$this->debug('set Authorization: ' . substr($this->outgoing_headers['Authorization'], 0, 12) . '...');
+		} else {
+			$this->debug('Authorization header not set');
+		}
+	}
+	
+	/**
+	* set the soapaction value
+	*
+	* @param    string $soapaction
+	* @access   public
+	*/
+	function setSOAPAction($soapaction) {
+		$this->outgoing_headers['SOAPAction'] = '"' . $soapaction . '"';
+		$this->debug('set SOAPAction: ' . $this->outgoing_headers['SOAPAction']);
+	}
+	
+	/**
+	* use http encoding
+	*
+	* @param    string $enc encoding style. supported values: gzip, deflate, or both
+	* @access   public
+	*/
+	function setEncoding($enc='gzip, deflate') {
+		if (function_exists('gzdeflate')) {
+			$this->protocol_version = '1.1';
+			$this->outgoing_headers['Accept-Encoding'] = $enc;
+			$this->debug('set Accept-Encoding: ' . $this->outgoing_headers['Accept-Encoding']);
+			if (!isset($this->outgoing_headers['Connection'])) {
+				$this->outgoing_headers['Connection'] = 'close';
+				$this->persistentConnection = false;
+				$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
+			}
+			set_magic_quotes_runtime(0);
+			// deprecated
+			$this->encoding = $enc;
+		}
+	}
+	
+	/**
+	* set proxy info here
+	*
+	* @param    string $proxyhost
+	* @param    string $proxyport
+	* @param	string $proxyusername
+	* @param	string $proxypassword
+	* @access   public
+	*/
+	function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') {
+		$this->uri = $this->url;
+		$this->host = $proxyhost;
+		$this->port = $proxyport;
+		if ($proxyusername != '' && $proxypassword != '') {
+			$this->outgoing_headers['Proxy-Authorization'] = ' Basic '.base64_encode($proxyusername.':'.$proxypassword);
+			$this->debug('set Proxy-Authorization: ' . $this->outgoing_headers['Proxy-Authorization']);
+		}
+	}
+	
+	/**
+	* decode a string that is encoded w/ "chunked' transfer encoding
+ 	* as defined in RFC2068 19.4.6
+	*
+	* @param    string $buffer
+	* @param    string $lb
+	* @returns	string
+	* @access   public
+	* @deprecated
+	*/
+	function decodeChunked($buffer, $lb){
+		// length := 0
+		$length = 0;
+		$new = '';
+		
+		// read chunk-size, chunk-extension (if any) and CRLF
+		// get the position of the linebreak
+		$chunkend = strpos($buffer, $lb);
+		if ($chunkend == FALSE) {
+			$this->debug('no linebreak found in decodeChunked');
+			return $new;
+		}
+		$temp = substr($buffer,0,$chunkend);
+		$chunk_size = hexdec( trim($temp) );
+		$chunkstart = $chunkend + strlen($lb);
+		// while (chunk-size > 0) {
+		while ($chunk_size > 0) {
+			$this->debug("chunkstart: $chunkstart chunk_size: $chunk_size");
+			$chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size);
+		  	
+			// Just in case we got a broken connection
+		  	if ($chunkend == FALSE) {
+		  	    $chunk = substr($buffer,$chunkstart);
+				// append chunk-data to entity-body
+		    	$new .= $chunk;
+		  	    $length += strlen($chunk);
+		  	    break;
+			}
+			
+		  	// read chunk-data and CRLF
+		  	$chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart);
+		  	// append chunk-data to entity-body
+		  	$new .= $chunk;
+		  	// length := length + chunk-size
+		  	$length += strlen($chunk);
+		  	// read chunk-size and CRLF
+		  	$chunkstart = $chunkend + strlen($lb);
+			
+		  	$chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb);
+			if ($chunkend == FALSE) {
+				break; //Just in case we got a broken connection
+			}
+			$temp = substr($buffer,$chunkstart,$chunkend-$chunkstart);
+			$chunk_size = hexdec( trim($temp) );
+			$chunkstart = $chunkend;
+		}
+		return $new;
+	}
+	
+	/*
+	 *	Writes payload, including HTTP headers, to $this->outgoing_payload.
+	 */
+	function buildPayload($data, $cookie_str = '') {
+		// add content-length header
+		$this->outgoing_headers['Content-Length'] = strlen($data);
+		$this->debug('set Content-Length: ' . $this->outgoing_headers['Content-Length']);
+
+		// start building outgoing payload:
+		$req = "$this->request_method $this->uri HTTP/$this->protocol_version";
+		$this->debug("HTTP request: $req");
+		$this->outgoing_payload = "$req\r\n";
+
+		// loop thru headers, serializing
+		foreach($this->outgoing_headers as $k => $v){
+			$hdr = $k.': '.$v;
+			$this->debug("HTTP header: $hdr");
+			$this->outgoing_payload .= "$hdr\r\n";
+		}
+
+		// add any cookies
+		if ($cookie_str != '') {
+			$hdr = 'Cookie: '.$cookie_str;
+			$this->debug("HTTP header: $hdr");
+			$this->outgoing_payload .= "$hdr\r\n";
+		}
+
+		// header/body separator
+		$this->outgoing_payload .= "\r\n";
+		
+		// add data
+		$this->outgoing_payload .= $data;
+	}
+
+	function sendRequest($data, $cookies = NULL) {
+		// build cookie string
+		$cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https')));
+
+		// build payload
+		$this->buildPayload($data, $cookie_str);
+
+	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
+		// send payload
+		if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) {
+			$this->setError('couldn\'t write message data to socket');
+			$this->debug('couldn\'t write message data to socket');
+			return false;
+		}
+		$this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload));
+		return true;
+	  } else if ($this->scheme == 'https') {
+		// set payload
+		// TODO: cURL does say this should only be the verb, and in fact it
+		// turns out that the URI and HTTP version are appended to this, which
+		// some servers refuse to work with
+		//curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $this->outgoing_payload);
+		foreach($this->outgoing_headers as $k => $v){
+			$curl_headers[] = "$k: $v";
+		}
+		if ($cookie_str != '') {
+			$curl_headers[] = 'Cookie: ' . $cookie_str;
+		}
+		curl_setopt($this->ch, CURLOPT_HTTPHEADER, $curl_headers);
+		if ($this->request_method == "POST") {
+	  		curl_setopt($this->ch, CURLOPT_POST, 1);
+	  		curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data);
+	  	} else {
+	  	}
+		$this->debug('set cURL payload');
+		return true;
+	  }
+	}
+
+	function getResponse(){
+		$this->incoming_payload = '';
+	    
+	  if ($this->scheme == 'http' || $this->scheme == 'ssl') {
+	    // loop until headers have been retrieved
+	    $data = '';
+	    while (!isset($lb)){
+
+			// We might EOF during header read.
+			if(feof($this->fp)) {
+				$this->incoming_payload = $data;
+				$this->debug('found no headers before EOF after length ' . strlen($data));
+				$this->debug("received before EOF:\n" . $data);
+				$this->setError('server failed to send headers');
+				return false;
+			}
+
+			$tmp = fgets($this->fp, 256);
+			$tmplen = strlen($tmp);
+			$this->debug("read line of $tmplen bytes: " . trim($tmp));
+
+			if ($tmplen == 0) {
+				$this->incoming_payload = $data;
+				$this->debug('socket read of headers timed out after length ' . strlen($data));
+				$this->debug("read before timeout: " . $data);
+				$this->setError('socket read of headers timed out');
+				return false;
+			}
+
+			$data .= $tmp;
+			$pos = strpos($data,"\r\n\r\n");
+			if($pos > 1){
+				$lb = "\r\n";
+			} else {
+				$pos = strpos($data,"\n\n");
+				if($pos > 1){
+					$lb = "\n";
+				}
+			}
+			// remove 100 header
+			if(isset($lb) && ereg('^HTTP/1.1 100',$data)){
+				unset($lb);
+				$data = '';
+			}//
+		}
+		// store header data
+		$this->incoming_payload .= $data;
+		$this->debug('found end of headers after length ' . strlen($data));
+		// process headers
+		$header_data = trim(substr($data,0,$pos));
+		$header_array = explode($lb,$header_data);
+		$this->incoming_headers = array();
+		$this->incoming_cookies = array();
+		foreach($header_array as $header_line){
+			$arr = explode(':',$header_line, 2);
+			if(count($arr) > 1){
+				$header_name = strtolower(trim($arr[0]));
+				$this->incoming_headers[$header_name] = trim($arr[1]);
+				if ($header_name == 'set-cookie') {
+					// TODO: allow multiple cookies from parseCookie
+					$cookie = $this->parseCookie(trim($arr[1]));
+					if ($cookie) {
+						$this->incoming_cookies[] = $cookie;
+						$this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
+					} else {
+						$this->debug('did not find cookie in ' . trim($arr[1]));
+					}
+    			}
+			} else if (isset($header_name)) {
+				// append continuation line to previous header
+				$this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
+			}
+		}
+		
+		// loop until msg has been received
+		if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') {
+			$content_length =  2147483647;	// ignore any content-length header
+			$chunked = true;
+			$this->debug("want to read chunked content");
+		} elseif (isset($this->incoming_headers['content-length'])) {
+			$content_length = $this->incoming_headers['content-length'];
+			$chunked = false;
+			$this->debug("want to read content of length $content_length");
+		} else {
+			$content_length =  2147483647;
+			$chunked = false;
+			$this->debug("want to read content to EOF");
+		}
+		$data = '';
+		do {
+			if ($chunked) {
+				$tmp = fgets($this->fp, 256);
+				$tmplen = strlen($tmp);
+				$this->debug("read chunk line of $tmplen bytes");
+				if ($tmplen == 0) {
+					$this->incoming_payload = $data;
+					$this->debug('socket read of chunk length timed out after length ' . strlen($data));
+					$this->debug("read before timeout:\n" . $data);
+					$this->setError('socket read of chunk length timed out');
+					return false;
+				}
+				$content_length = hexdec(trim($tmp));
+				$this->debug("chunk length $content_length");
+			}
+			$strlen = 0;
+		    while (($strlen < $content_length) && (!feof($this->fp))) {
+		    	$readlen = min(8192, $content_length - $strlen);
+				$tmp = fread($this->fp, $readlen);
+				$tmplen = strlen($tmp);
+				$this->debug("read buffer of $tmplen bytes");
+				if (($tmplen == 0) && (!feof($this->fp))) {
+					$this->incoming_payload = $data;
+					$this->debug('socket read of body timed out after length ' . strlen($data));
+					$this->debug("read before timeout:\n" . $data);
+					$this->setError('socket read of body timed out');
+					return false;
+				}
+				$strlen += $tmplen;
+				$data .= $tmp;
+			}
+			if ($chunked && ($content_length > 0)) {
+				$tmp = fgets($this->fp, 256);
+				$tmplen = strlen($tmp);
+				$this->debug("read chunk terminator of $tmplen bytes");
+				if ($tmplen == 0) {
+					$this->incoming_payload = $data;
+					$this->debug('socket read of chunk terminator timed out after length ' . strlen($data));
+					$this->debug("read before timeout:\n" . $data);
+					$this->setError('socket read of chunk terminator timed out');
+					return false;
+				}
+			}
+		} while ($chunked && ($content_length > 0) && (!feof($this->fp)));
+		if (feof($this->fp)) {
+			$this->debug('read to EOF');
+		}
+		$this->debug('read body of length ' . strlen($data));
+		$this->incoming_payload .= $data;
+		$this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server');
+		
+		// close filepointer
+		if(
+			(isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || 
+			(! $this->persistentConnection) || feof($this->fp)){
+			fclose($this->fp);
+			$this->fp = false;
+			$this->debug('closed socket');
+		}
+		
+		// connection was closed unexpectedly
+		if($this->incoming_payload == ''){
+			$this->setError('no response from server');
+			return false;
+		}
+		
+		// decode transfer-encoding
+//		if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){
+//			if(!$data = $this->decodeChunked($data, $lb)){
+//				$this->setError('Decoding of chunked data failed');
+//				return false;
+//			}
+			//print "<pre>\nde-chunked:\n---------------\n$data\n\n---------------\n</pre>";
+			// set decoded payload
+//			$this->incoming_payload = $header_data.$lb.$lb.$data;
+//		}
+	
+	  } else if ($this->scheme == 'https') {
+		// send and receive
+		$this->debug('send and receive with cURL');
+		$this->incoming_payload = curl_exec($this->ch);
+		$data = $this->incoming_payload;
+
+        $cErr = curl_error($this->ch);
+		if ($cErr != '') {
+        	$err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'<br>';
+        	// TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE
+			foreach(curl_getinfo($this->ch) as $k => $v){
+				$err .= "$k: $v<br>";
+			}
+			$this->debug($err);
+			$this->setError($err);
+			curl_close($this->ch);
+	    	return false;
+		} else {
+			//echo '<pre>';
+			//var_dump(curl_getinfo($this->ch));
+			//echo '</pre>';
+		}
+		// close curl
+		$this->debug('No cURL error, closing cURL');
+		curl_close($this->ch);
+		
+		// remove 100 header(s)
+		while (ereg('^HTTP/1.1 100',$data)) {
+			if ($pos = strpos($data,"\r\n\r\n")) {
+				$data = ltrim(substr($data,$pos));
+			} elseif($pos = strpos($data,"\n\n") ) {
+				$data = ltrim(substr($data,$pos));
+			}
+		}
+		
+		// separate content from HTTP headers
+		if ($pos = strpos($data,"\r\n\r\n")) {
+			$lb = "\r\n";
+		} elseif( $pos = strpos($data,"\n\n")) {
+			$lb = "\n";
+		} else {
+			$this->debug('no proper separation of headers and document');
+			$this->setError('no proper separation of headers and document');
+			return false;
+		}
+		$header_data = trim(substr($data,0,$pos));
+		$header_array = explode($lb,$header_data);
+		$data = ltrim(substr($data,$pos));
+		$this->debug('found proper separation of headers and document');
+		$this->debug('cleaned data, stringlen: '.strlen($data));
+		// clean headers
+		foreach ($header_array as $header_line) {
+			$arr = explode(':',$header_line,2);
+			if(count($arr) > 1){
+				$header_name = strtolower(trim($arr[0]));
+				$this->incoming_headers[$header_name] = trim($arr[1]);
+				if ($header_name == 'set-cookie') {
+					// TODO: allow multiple cookies from parseCookie
+					$cookie = $this->parseCookie(trim($arr[1]));
+					if ($cookie) {
+						$this->incoming_cookies[] = $cookie;
+						$this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
+					} else {
+						$this->debug('did not find cookie in ' . trim($arr[1]));
+					}
+    			}
+			} else if (isset($header_name)) {
+				// append continuation line to previous header
+				$this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
+			}
+		}
+	  }
+
+		$arr = explode(' ', $header_array[0], 3);
+		$http_version = $arr[0];
+		$http_status = intval($arr[1]);
+		$http_reason = count($arr) > 2 ? $arr[2] : '';
+
+ 		// see if we need to resend the request with http digest authentication
+ 		if (isset($this->incoming_headers['location']) && $http_status == 301) {
+ 			$this->debug("Got 301 $http_reason with Location: " . $this->incoming_headers['location']);
+ 			$this->setURL($this->incoming_headers['location']);
+			$this->tryagain = true;
+			return false;
+		}
+
+ 		// see if we need to resend the request with http digest authentication
+ 		if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) {
+ 			$this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']);
+ 			if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) {
+ 				$this->debug('Server wants digest authentication');
+ 				// remove "Digest " from our elements
+ 				$digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']);
+ 				
+ 				// parse elements into array
+ 				$digestElements = explode(',', $digestString);
+ 				foreach ($digestElements as $val) {
+ 					$tempElement = explode('=', trim($val), 2);
+ 					$digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]);
+ 				}
+
+				// should have (at least) qop, realm, nonce
+ 				if (isset($digestRequest['nonce'])) {
+ 					$this->setCredentials($this->username, $this->password, 'digest', $digestRequest);
+ 					$this->tryagain = true;
+ 					return false;
+ 				}
+ 			}
+			$this->debug('HTTP authentication failed');
+			$this->setError('HTTP authentication failed');
+			return false;
+ 		}
+		
+		if (
+			($http_status >= 300 && $http_status <= 307) ||
+			($http_status >= 400 && $http_status <= 417) ||
+			($http_status >= 501 && $http_status <= 505)
+		   ) {
+			$this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient->response has contents of the response)");
+			return false;
+		}
+
+		// decode content-encoding
+		if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){
+			if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){
+    			// if decoding works, use it. else assume data wasn't gzencoded
+    			if(function_exists('gzinflate')){
+					//$timer->setMarker('starting decoding of gzip/deflated content');
+					// IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress)
+					// this means there are no Zlib headers, although there should be
+					$this->debug('The gzinflate function exists');
+					$datalen = strlen($data);
+					if ($this->incoming_headers['content-encoding'] == 'deflate') {
+						if ($degzdata = @gzinflate($data)) {
+	    					$data = $degzdata;
+	    					$this->debug('The payload has been inflated to ' . strlen($data) . ' bytes');
+	    					if (strlen($data) < $datalen) {
+	    						// test for the case that the payload has been compressed twice
+		    					$this->debug('The inflated payload is smaller than the gzipped one; try again');
+								if ($degzdata = @gzinflate($data)) {
+			    					$data = $degzdata;
+			    					$this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes');
+								}
+	    					}
+	    				} else {
+	    					$this->debug('Error using gzinflate to inflate the payload');
+	    					$this->setError('Error using gzinflate to inflate the payload');
+	    				}
+					} elseif ($this->incoming_headers['content-encoding'] == 'gzip') {
+						if ($degzdata = @gzinflate(substr($data, 10))) {	// do our best
+							$data = $degzdata;
+	    					$this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes');
+	    					if (strlen($data) < $datalen) {
+	    						// test for the case that the payload has been compressed twice
+		    					$this->debug('The un-gzipped payload is smaller than the gzipped one; try again');
+								if ($degzdata = @gzinflate(substr($data, 10))) {
+			    					$data = $degzdata;
+			    					$this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes');
+								}
+	    					}
+	    				} else {
+	    					$this->debug('Error using gzinflate to un-gzip the payload');
+							$this->setError('Error using gzinflate to un-gzip the payload');
+	    				}
+					}
+					//$timer->setMarker('finished decoding of gzip/deflated content');
+					//print "<xmp>\nde-inflated:\n---------------\n$data\n-------------\n</xmp>";
+					// set decoded payload
+					$this->incoming_payload = $header_data.$lb.$lb.$data;
+    			} else {
+					$this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
+					$this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
+				}
+			} else {
+				$this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
+				$this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
+			}
+		} else {
+			$this->debug('No Content-Encoding header');
+		}
+		
+		if(strlen($data) == 0){
+			$this->debug('no data after headers!');
+			$this->setError('no data present after HTTP headers');
+			return false;
+		}
+		
+		return $data;
+	}
+
+	function setContentType($type, $charset = false) {
+		$this->outgoing_headers['Content-Type'] = $type . ($charset ? '; charset=' . $charset : '');
+		$this->debug('set Content-Type: ' . $this->outgoing_headers['Content-Type']);
+	}
+
+	function usePersistentConnection(){
+		if (isset($this->outgoing_headers['Accept-Encoding'])) {
+			return false;
+		}
+		$this->protocol_version = '1.1';
+		$this->persistentConnection = true;
+		$this->outgoing_headers['Connection'] = 'Keep-Alive';
+		$this->debug('set Connection: ' . $this->outgoing_headers['Connection']);
+		return true;
+	}
+
+	/**
+	 * parse an incoming Cookie into it's parts
+	 *
+	 * @param	string $cookie_str content of cookie
+	 * @return	array with data of that cookie
+	 * @access	private
+	 */
+	/*
+	 * TODO: allow a Set-Cookie string to be parsed into multiple cookies
+	 */
+	function parseCookie($cookie_str) {
+		$cookie_str = str_replace('; ', ';', $cookie_str) . ';';
+		$data = split(';', $cookie_str);
+		$value_str = $data[0];
+
+		$cookie_param = 'domain=';
+		$start = strpos($cookie_str, $cookie_param);
+		if ($start > 0) {
+			$domain = substr($cookie_str, $start + strlen($cookie_param));
+			$domain = substr($domain, 0, strpos($domain, ';'));
+		} else {
+			$domain = '';
+		}
+
+		$cookie_param = 'expires=';
+		$start = strpos($cookie_str, $cookie_param);
+		if ($start > 0) {
+			$expires = substr($cookie_str, $start + strlen($cookie_param));
+			$expires = substr($expires, 0, strpos($expires, ';'));
+		} else {
+			$expires = '';
+		}
+
+		$cookie_param = 'path=';
+		$start = strpos($cookie_str, $cookie_param);
+		if ( $start > 0 ) {
+			$path = substr($cookie_str, $start + strlen($cookie_param));
+			$path = substr($path, 0, strpos($path, ';'));
+		} else {
+			$path = '/';
+		}
+						
+		$cookie_param = ';secure;';
+		if (strpos($cookie_str, $cookie_param) !== FALSE) {
+			$secure = true;
+		} else {
+			$secure = false;
+		}
+
+		$sep_pos = strpos($value_str, '=');
+
+		if ($sep_pos) {
+			$name = substr($value_str, 0, $sep_pos);
+			$value = substr($value_str, $sep_pos + 1);
+			$cookie= array(	'name' => $name,
+			                'value' => $value,
+							'domain' => $domain,
+							'path' => $path,
+							'expires' => $expires,
+							'secure' => $secure
+							);		
+			return $cookie;
+		}
+		return false;
+	}
+  
+	/**
+	 * sort out cookies for the current request
+	 *
+	 * @param	array $cookies array with all cookies
+	 * @param	boolean $secure is the send-content secure or not?
+	 * @return	string for Cookie-HTTP-Header
+	 * @access	private
+	 */
+	function getCookiesForRequest($cookies, $secure=false) {
+		$cookie_str = '';
+		if ((! is_null($cookies)) && (is_array($cookies))) {
+			foreach ($cookies as $cookie) {
+				if (! is_array($cookie)) {
+					continue;
+				}
+	    		$this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']);
+				if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
+					if (strtotime($cookie['expires']) <= time()) {
+						$this->debug('cookie has expired');
+						continue;
+					}
+				}
+				if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) {
+					$domain = preg_quote($cookie['domain']);
+					if (! preg_match("'.*$domain$'i", $this->host)) {
+						$this->debug('cookie has different domain');
+						continue;
+					}
+				}
+				if ((isset($cookie['path'])) && (! empty($cookie['path']))) {
+					$path = preg_quote($cookie['path']);
+					if (! preg_match("'^$path.*'i", $this->path)) {
+						$this->debug('cookie is for a different path');
+						continue;
+					}
+				}
+				if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) {
+					$this->debug('cookie is secure, transport is not');
+					continue;
+				}
+				$cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; ';
+	    		$this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']);
+			}
+		}
+		return $cookie_str;
+  }
+}
+
+?><?php
+
+
+
+/**
+*
+* soap_server allows the user to create a SOAP server
+* that is capable of receiving messages and returning responses
+*
+* NOTE: WSDL functionality is experimental
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class soap_server extends nusoap_base {
+	/**
+	 * HTTP headers of request
+	 * @var array
+	 * @access private
+	 */
+	var $headers = array();
+	/**
+	 * HTTP request
+	 * @var string
+	 * @access private
+	 */
+	var $request = '';
+	/**
+	 * SOAP headers from request (incomplete namespace resolution; special characters not escaped) (text)
+	 * @var string
+	 * @access public
+	 */
+	var $requestHeaders = '';
+	/**
+	 * SOAP body request portion (incomplete namespace resolution; special characters not escaped) (text)
+	 * @var string
+	 * @access public
+	 */
+	var $document = '';
+	/**
+	 * SOAP payload for request (text)
+	 * @var string
+	 * @access public
+	 */
+	var $requestSOAP = '';
+	/**
+	 * requested method namespace URI
+	 * @var string
+	 * @access private
+	 */
+	var $methodURI = '';
+	/**
+	 * name of method requested
+	 * @var string
+	 * @access private
+	 */
+	var $methodname = '';
+	/**
+	 * method parameters from request
+	 * @var array
+	 * @access private
+	 */
+	var $methodparams = array();
+	/**
+	 * SOAP Action from request
+	 * @var string
+	 * @access private
+	 */
+	var $SOAPAction = '';
+	/**
+	 * character set encoding of incoming (request) messages
+	 * @var string
+	 * @access public
+	 */
+	var $xml_encoding = '';
+	/**
+	 * toggles whether the parser decodes element content w/ utf8_decode()
+	 * @var boolean
+	 * @access public
+	 */
+    var $decode_utf8 = true;
+
+	/**
+	 * HTTP headers of response
+	 * @var array
+	 * @access public
+	 */
+	var $outgoing_headers = array();
+	/**
+	 * HTTP response
+	 * @var string
+	 * @access private
+	 */
+	var $response = '';
+	/**
+	 * SOAP headers for response (text)
+	 * @var string
+	 * @access public
+	 */
+	var $responseHeaders = '';
+	/**
+	 * SOAP payload for response (text)
+	 * @var string
+	 * @access private
+	 */
+	var $responseSOAP = '';
+	/**
+	 * method return value to place in response
+	 * @var mixed
+	 * @access private
+	 */
+	var $methodreturn = false;
+	/**
+	 * whether $methodreturn is a string of literal XML
+	 * @var boolean
+	 * @access public
+	 */
+	var $methodreturnisliteralxml = false;
+	/**
+	 * SOAP fault for response (or false)
+	 * @var mixed
+	 * @access private
+	 */
+	var $fault = false;
+	/**
+	 * text indication of result (for debugging)
+	 * @var string
+	 * @access private
+	 */
+	var $result = 'successful';
+
+	/**
+	 * assoc array of operations => opData; operations are added by the register()
+	 * method or by parsing an external WSDL definition
+	 * @var array
+	 * @access private
+	 */
+	var $operations = array();
+	/**
+	 * wsdl instance (if one)
+	 * @var mixed
+	 * @access private
+	 */
+	var $wsdl = false;
+	/**
+	 * URL for WSDL (if one)
+	 * @var mixed
+	 * @access private
+	 */
+	var $externalWSDLURL = false;
+	/**
+	 * whether to append debug to response as XML comment
+	 * @var boolean
+	 * @access public
+	 */
+	var $debug_flag = false;
+
+
+	/**
+	* constructor
+    * the optional parameter is a path to a WSDL file that you'd like to bind the server instance to.
+	*
+    * @param mixed $wsdl file path or URL (string), or wsdl instance (object)
+	* @access   public
+	*/
+	function soap_server($wsdl=false){
+		parent::nusoap_base();
+		// turn on debugging?
+		global $debug;
+		global $HTTP_SERVER_VARS;
+
+		if (isset($_SERVER)) {
+			$this->debug("_SERVER is defined:");
+			$this->appendDebug($this->varDump($_SERVER));
+		} elseif (isset($HTTP_SERVER_VARS)) {
+			$this->debug("HTTP_SERVER_VARS is defined:");
+			$this->appendDebug($this->varDump($HTTP_SERVER_VARS));
+		} else {
+			$this->debug("Neither _SERVER nor HTTP_SERVER_VARS is defined.");
+		}
+
+		if (isset($debug)) {
+			$this->debug("In soap_server, set debug_flag=$debug based on global flag");
+			$this->debug_flag = $debug;
+		} elseif (isset($_SERVER['QUERY_STRING'])) {
+			$qs = explode('&', $_SERVER['QUERY_STRING']);
+			foreach ($qs as $v) {
+				if (substr($v, 0, 6) == 'debug=') {
+					$this->debug("In soap_server, set debug_flag=" . substr($v, 6) . " based on query string #1");
+					$this->debug_flag = substr($v, 6);
+				}
+			}
+		} elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
+			$qs = explode('&', $HTTP_SERVER_VARS['QUERY_STRING']);
+			foreach ($qs as $v) {
+				if (substr($v, 0, 6) == 'debug=') {
+					$this->debug("In soap_server, set debug_flag=" . substr($v, 6) . " based on query string #2");
+					$this->debug_flag = substr($v, 6);
+				}
+			}
+		}
+
+		// wsdl
+		if($wsdl){
+			$this->debug("In soap_server, WSDL is specified");
+			if (is_object($wsdl) && (get_class($wsdl) == 'wsdl')) {
+				$this->wsdl = $wsdl;
+				$this->externalWSDLURL = $this->wsdl->wsdl;
+				$this->debug('Use existing wsdl instance from ' . $this->externalWSDLURL);
+			} else {
+				$this->debug('Create wsdl from ' . $wsdl);
+				$this->wsdl = new wsdl($wsdl);
+				$this->externalWSDLURL = $wsdl;
+			}
+			$this->appendDebug($this->wsdl->getDebug());
+			$this->wsdl->clearDebug();
+			if($err = $this->wsdl->getError()){
+				die('WSDL ERROR: '.$err);
+			}
+		}
+	}
+
+	/**
+	* processes request and returns response
+	*
+	* @param    string $data usually is the value of $HTTP_RAW_POST_DATA
+	* @access   public
+	*/
+	function service($data){
+		global $HTTP_SERVER_VARS;
+
+		if (isset($_SERVER['QUERY_STRING'])) {
+			$qs = $_SERVER['QUERY_STRING'];
+		} elseif (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
+			$qs = $HTTP_SERVER_VARS['QUERY_STRING'];
+		} else {
+			$qs = '';
+		}
+		$this->debug("In service, query string=$qs");
+
+		if (ereg('wsdl', $qs) ){
+			$this->debug("In service, this is a request for WSDL");
+			if($this->externalWSDLURL){
+              if (strpos($this->externalWSDLURL,"://")!==false) { // assume URL
+				header('Location: '.$this->externalWSDLURL);
+              } else { // assume file
+                header("Content-Type: text/xml\r\n");
+                $fp = fopen($this->externalWSDLURL, 'r');
+                fpassthru($fp);
+              }
+			} elseif ($this->wsdl) {
+				header("Content-Type: text/xml; charset=ISO-8859-1\r\n");
+				print $this->wsdl->serialize($this->debug_flag);
+				if ($this->debug_flag) {
+					$this->debug('wsdl:');
+					$this->appendDebug($this->varDump($this->wsdl));
+					print $this->getDebugAsXMLComment();
+				}
+			} else {
+				header("Content-Type: text/html; charset=ISO-8859-1\r\n");
+				print "This service does not provide WSDL";
+			}
+		} elseif ($data == '' && $this->wsdl) {
+			$this->debug("In service, there is no data, so return Web description");
+			print $this->wsdl->webDescription();
+		} else {
+			$this->debug("In service, invoke the request");
+			$this->parse_request($data);
+			if (! $this->fault) {
+				$this->invoke_method();
+			}
+			if (! $this->fault) {
+				$this->serialize_return();
+			}
+			$this->send_response();
+		}
+	}
+
+	/**
+	* parses HTTP request headers.
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* headers
+	* request
+	* xml_encoding
+	* SOAPAction
+	*
+	* @access   private
+	*/
+	function parse_http_headers() {
+		global $HTTP_SERVER_VARS;
+
+		$this->request = '';
+		$this->SOAPAction = '';
+		if(function_exists('getallheaders')){
+			$this->debug("In parse_http_headers, use getallheaders");
+			$headers = getallheaders();
+			foreach($headers as $k=>$v){
+				$k = strtolower($k);
+				$this->headers[$k] = $v;
+				$this->request .= "$k: $v\r\n";
+				$this->debug("$k: $v");
+			}
+			// get SOAPAction header
+			if(isset($this->headers['soapaction'])){
+				$this->SOAPAction = str_replace('"','',$this->headers['soapaction']);
+			}
+			// get the character encoding of the incoming request
+			if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
+				$enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1));
+				if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+					$this->xml_encoding = strtoupper($enc);
+				} else {
+					$this->xml_encoding = 'US-ASCII';
+				}
+			} else {
+				// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+				$this->xml_encoding = 'ISO-8859-1';
+			}
+		} elseif(isset($_SERVER) && is_array($_SERVER)){
+			$this->debug("In parse_http_headers, use _SERVER");
+			foreach ($_SERVER as $k => $v) {
+				if (substr($k, 0, 5) == 'HTTP_') {
+					$k = str_replace(' ', '-', strtolower(str_replace('_', ' ', substr($k, 5)))); 	                                         $k = strtolower(substr($k, 5));
+				} else {
+					$k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k))); 	                                         $k = strtolower($k);
+				}
+				if ($k == 'soapaction') {
+					// get SOAPAction header
+					$k = 'SOAPAction';
+					$v = str_replace('"', '', $v);
+					$v = str_replace('\\', '', $v);
+					$this->SOAPAction = $v;
+				} else if ($k == 'content-type') {
+					// get the character encoding of the incoming request
+					if (strpos($v, '=')) {
+						$enc = substr(strstr($v, '='), 1);
+						$enc = str_replace('"', '', $enc);
+						$enc = str_replace('\\', '', $enc);
+						if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+							$this->xml_encoding = strtoupper($enc);
+						} else {
+							$this->xml_encoding = 'US-ASCII';
+						}
+					} else {
+						// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+						$this->xml_encoding = 'ISO-8859-1';
+					}
+				}
+				$this->headers[$k] = $v;
+				$this->request .= "$k: $v\r\n";
+				$this->debug("$k: $v");
+			}
+		} elseif (is_array($HTTP_SERVER_VARS)) {
+			$this->debug("In parse_http_headers, use HTTP_SERVER_VARS");
+			foreach ($HTTP_SERVER_VARS as $k => $v) {
+				if (substr($k, 0, 5) == 'HTTP_') {
+					$k = str_replace(' ', '-', strtolower(str_replace('_', ' ', substr($k, 5)))); 	                                         $k = strtolower(substr($k, 5));
+				} else {
+					$k = str_replace(' ', '-', strtolower(str_replace('_', ' ', $k))); 	                                         $k = strtolower($k);
+				}
+				if ($k == 'soapaction') {
+					// get SOAPAction header
+					$k = 'SOAPAction';
+					$v = str_replace('"', '', $v);
+					$v = str_replace('\\', '', $v);
+					$this->SOAPAction = $v;
+				} else if ($k == 'content-type') {
+					// get the character encoding of the incoming request
+					if (strpos($v, '=')) {
+						$enc = substr(strstr($v, '='), 1);
+						$enc = str_replace('"', '', $enc);
+						$enc = str_replace('\\', '', $enc);
+						if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+							$this->xml_encoding = strtoupper($enc);
+						} else {
+							$this->xml_encoding = 'US-ASCII';
+						}
+					} else {
+						// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+						$this->xml_encoding = 'ISO-8859-1';
+					}
+				}
+				$this->headers[$k] = $v;
+				$this->request .= "$k: $v\r\n";
+				$this->debug("$k: $v");
+			}
+		} else {
+			$this->debug("In parse_http_headers, HTTP headers not accessible");
+			$this->setError("HTTP headers not accessible");
+		}
+	}
+
+	/**
+	* parses a request
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* headers
+	* request
+	* xml_encoding
+	* SOAPAction
+	* request
+	* requestSOAP
+	* methodURI
+	* methodname
+	* methodparams
+	* requestHeaders
+	* document
+	*
+	* This sets the fault field on error
+	*
+	* @param    string $data XML string
+	* @access   private
+	*/
+	function parse_request($data='') {
+		$this->debug('entering parse_request()');
+		$this->parse_http_headers();
+		$this->debug('got character encoding: '.$this->xml_encoding);
+		// uncompress if necessary
+		if (isset($this->headers['content-encoding']) && $this->headers['content-encoding'] != '') {
+			$this->debug('got content encoding: ' . $this->headers['content-encoding']);
+			if ($this->headers['content-encoding'] == 'deflate' || $this->headers['content-encoding'] == 'gzip') {
+		    	// if decoding works, use it. else assume data wasn't gzencoded
+				if (function_exists('gzuncompress')) {
+					if ($this->headers['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) {
+						$data = $degzdata;
+					} elseif ($this->headers['content-encoding'] == 'gzip' && $degzdata = gzinflate(substr($data, 10))) {
+						$data = $degzdata;
+					} else {
+						$this->fault('Client', 'Errors occurred when trying to decode the data');
+						return;
+					}
+				} else {
+					$this->fault('Client', 'This Server does not support compressed data');
+					return;
+				}
+			}
+		}
+		$this->request .= "\r\n".$data;
+		$data = $this->parseRequest($this->headers, $data);
+		$this->requestSOAP = $data;
+		$this->debug('leaving parse_request');
+	}
+
+	/**
+	* invokes a PHP function for the requested SOAP method
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* methodreturn
+	*
+	* Note that the PHP function that is called may also set the following
+	* fields to affect the response sent to the client
+	*
+	* responseHeaders
+	* outgoing_headers
+	*
+	* This sets the fault field on error
+	*
+	* @access   private
+	*/
+	function invoke_method() {
+		$this->debug('in invoke_method, methodname=' . $this->methodname . ' methodURI=' . $this->methodURI . ' SOAPAction=' . $this->SOAPAction);
+
+		if ($this->wsdl) {
+			if ($this->opData = $this->wsdl->getOperationData($this->methodname)) {
+				$this->debug('in invoke_method, found WSDL operation=' . $this->methodname);
+				$this->appendDebug('opData=' . $this->varDump($this->opData));
+			} elseif ($this->opData = $this->wsdl->getOperationDataForSoapAction($this->SOAPAction)) {
+				// Note: hopefully this case will only be used for doc/lit, since rpc services should have wrapper element
+				$this->debug('in invoke_method, found WSDL soapAction=' . $this->SOAPAction . ' for operation=' . $this->opData['name']);
+				$this->appendDebug('opData=' . $this->varDump($this->opData));
+				$this->methodname = $this->opData['name'];
+			} else {
+				$this->debug('in invoke_method, no WSDL for operation=' . $this->methodname);
+				$this->fault('Client', "Operation '" . $this->methodname . "' is not defined in the WSDL for this service");
+				return;
+			}
+		} else {
+			$this->debug('in invoke_method, no WSDL to validate method');
+		}
+
+		// if a . is present in $this->methodname, we see if there is a class in scope,
+		// which could be referred to. We will also distinguish between two deliminators,
+		// to allow methods to be called a the class or an instance
+		$class = '';
+		$method = '';
+		if (strpos($this->methodname, '..') > 0) {
+			$delim = '..';
+		} else if (strpos($this->methodname, '.') > 0) {
+			$delim = '.';
+		} else {
+			$delim = '';
+		}
+
+		if (strlen($delim) > 0 && substr_count($this->methodname, $delim) == 1 &&
+			class_exists(substr($this->methodname, 0, strpos($this->methodname, $delim)))) {
+			// get the class and method name
+			$class = substr($this->methodname, 0, strpos($this->methodname, $delim));
+			$method = substr($this->methodname, strpos($this->methodname, $delim) + strlen($delim));
+			$this->debug("in invoke_method, class=$class method=$method delim=$delim");
+		}
+
+		// does method exist?
+		if ($class == '') {
+			if (!function_exists($this->methodname)) {
+				$this->debug("in invoke_method, function '$this->methodname' not found!");
+				$this->result = 'fault: method not found';
+				$this->fault('Client',"method '$this->methodname' not defined in service");
+				return;
+			}
+		} else {
+			$method_to_compare = (substr(phpversion(), 0, 2) == '4.') ? strtolower($method) : $method;
+			if (!in_array($method_to_compare, get_class_methods($class))) {
+				$this->debug("in invoke_method, method '$this->methodname' not found in class '$class'!");
+				$this->result = 'fault: method not found';
+				$this->fault('Client',"method '$this->methodname' not defined in service");
+				return;
+			}
+		}
+
+		// evaluate message, getting back parameters
+		// verify that request parameters match the method's signature
+		if(! $this->verify_method($this->methodname,$this->methodparams)){
+			// debug
+			$this->debug('ERROR: request not verified against method signature');
+			$this->result = 'fault: request failed validation against method signature';
+			// return fault
+			$this->fault('Client',"Operation '$this->methodname' not defined in service.");
+			return;
+		}
+
+		// if there are parameters to pass
+		$this->debug('in invoke_method, params:');
+		$this->appendDebug($this->varDump($this->methodparams));
+		$this->debug("in invoke_method, calling '$this->methodname'");
+		if (!function_exists('call_user_func_array')) {
+			if ($class == '') {
+				$this->debug('in invoke_method, calling function using eval()');
+				$funcCall = "\$this->methodreturn = $this->methodname(";
+			} else {
+				if ($delim == '..') {
+					$this->debug('in invoke_method, calling class method using eval()');
+					$funcCall = "\$this->methodreturn = ".$class."::".$method."(";
+				} else {
+					$this->debug('in invoke_method, calling instance method using eval()');
+					// generate unique instance name
+					$instname = "\$inst_".time();
+					$funcCall = $instname." = new ".$class."(); ";
+					$funcCall .= "\$this->methodreturn = ".$instname."->".$method."(";
+				}
+			}
+			if ($this->methodparams) {
+				foreach ($this->methodparams as $param) {
+					if (is_array($param)) {
+						$this->fault('Client', 'NuSOAP does not handle complexType parameters correctly when using eval; call_user_func_array must be available');
+						return;
+					}
+					$funcCall .= "\"$param\",";
+				}
+				$funcCall = substr($funcCall, 0, -1);
+			}
+			$funcCall .= ');';
+			$this->debug('in invoke_method, function call: '.$funcCall);
+			@eval($funcCall);
+		} else {
+			if ($class == '') {
+				$this->debug('in invoke_method, calling function using call_user_func_array()');
+				$call_arg = "$this->methodname";	// straight assignment changes $this->methodname to lower case after call_user_func_array()
+			} elseif ($delim == '..') {
+				$this->debug('in invoke_method, calling class method using call_user_func_array()');
+				$call_arg = array ($class, $method);
+			} else {
+				$this->debug('in invoke_method, calling instance method using call_user_func_array()');
+				$instance = new $class ();
+				$call_arg = array(&$instance, $method);
+			}
+			$this->methodreturn = call_user_func_array($call_arg, $this->methodparams);
+		}
+        $this->debug('in invoke_method, methodreturn:');
+        $this->appendDebug($this->varDump($this->methodreturn));
+		$this->debug("in invoke_method, called method $this->methodname, received $this->methodreturn of type ".gettype($this->methodreturn));
+	}
+
+	/**
+	* serializes the return value from a PHP function into a full SOAP Envelope
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* responseSOAP
+	*
+	* This sets the fault field on error
+	*
+	* @access   private
+	*/
+	function serialize_return() {
+		$this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
+		// if fault
+		if (isset($this->methodreturn) && (get_class($this->methodreturn) == 'soap_fault')) {
+			$this->debug('got a fault object from method');
+			$this->fault = $this->methodreturn;
+			return;
+		} elseif ($this->methodreturnisliteralxml) {
+			$return_val = $this->methodreturn;
+		// returned value(s)
+		} else {
+			$this->debug('got a(n) '.gettype($this->methodreturn).' from method');
+			$this->debug('serializing return value');
+			if($this->wsdl){
+				// weak attempt at supporting multiple output params
+				if(sizeof($this->opData['output']['parts']) > 1){
+			    	$opParams = $this->methodreturn;
+			    } else {
+			    	// TODO: is this really necessary?
+			    	$opParams = array($this->methodreturn);
+			    }
+			    $return_val = $this->wsdl->serializeRPCParameters($this->methodname,'output',$opParams);
+			    $this->appendDebug($this->wsdl->getDebug());
+			    $this->wsdl->clearDebug();
+				if($errstr = $this->wsdl->getError()){
+					$this->debug('got wsdl error: '.$errstr);
+					$this->fault('Server', 'unable to serialize result');
+					return;
+				}
+			} else {
+				if (isset($this->methodreturn)) {
+					$return_val = $this->serialize_val($this->methodreturn, 'return');
+				} else {
+					$return_val = '';
+					$this->debug('in absence of WSDL, assume void return for backward compatibility');
+				}
+			}
+		}
+		$this->debug('return value:');
+		$this->appendDebug($this->varDump($return_val));
+
+		$this->debug('serializing response');
+		if ($this->wsdl) {
+			$this->debug('have WSDL for serialization: style is ' . $this->opData['style']);
+			if ($this->opData['style'] == 'rpc') {
+				$this->debug('style is rpc for serialization: use is ' . $this->opData['output']['use']);
+				if ($this->opData['output']['use'] == 'literal') {
+					$payload = '<'.$this->methodname.'Response xmlns="'.$this->methodURI.'">'.$return_val.'</'.$this->methodname."Response>";
+				} else {
+					$payload = '<ns1:'.$this->methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'</ns1:'.$this->methodname."Response>";
+				}
+			} else {
+				$this->debug('style is not rpc for serialization: assume document');
+				$payload = $return_val;
+			}
+		} else {
+			$this->debug('do not have WSDL for serialization: assume rpc/encoded');
+			$payload = '<ns1:'.$this->methodname.'Response xmlns:ns1="'.$this->methodURI.'">'.$return_val.'</ns1:'.$this->methodname."Response>";
+		}
+		$this->result = 'successful';
+		if($this->wsdl){
+			//if($this->debug_flag){
+            	$this->appendDebug($this->wsdl->getDebug());
+            //	}
+			if (isset($opData['output']['encodingStyle'])) {
+				$encodingStyle = $opData['output']['encodingStyle'];
+			} else {
+				$encodingStyle = '';
+			}
+			// Added: In case we use a WSDL, return a serialized env. WITH the usedNamespaces.
+			$this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders,$this->wsdl->usedNamespaces,$this->opData['style'],$encodingStyle);
+		} else {
+			$this->responseSOAP = $this->serializeEnvelope($payload,$this->responseHeaders);
+		}
+		$this->debug("Leaving serialize_return");
+	}
+
+	/**
+	* sends an HTTP response
+	*
+	* The following fields are set by this function (when successful)
+	*
+	* outgoing_headers
+	* response
+	*
+	* @access   private
+	*/
+	function send_response() {
+		$this->debug('Enter send_response');
+		if ($this->fault) {
+			$payload = $this->fault->serialize();
+			$this->outgoing_headers[] = "HTTP/1.0 500 Internal Server Error";
+			$this->outgoing_headers[] = "Status: 500 Internal Server Error";
+		} else {
+			$payload = $this->responseSOAP;
+			// Some combinations of PHP+Web server allow the Status
+			// to come through as a header.  Since OK is the default
+			// just do nothing.
+			// $this->outgoing_headers[] = "HTTP/1.0 200 OK";
+			// $this->outgoing_headers[] = "Status: 200 OK";
+		}
+        // add debug data if in debug mode
+		if(isset($this->debug_flag) && $this->debug_flag){
+        	$payload .= $this->getDebugAsXMLComment();
+        }
+		$this->outgoing_headers[] = "Server: $this->title Server v$this->version";
+		ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+		$this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
+		// Let the Web server decide about this
+		//$this->outgoing_headers[] = "Connection: Close\r\n";
+		$payload = $this->getHTTPBody($payload);
+		$type = $this->getHTTPContentType();
+		$charset = $this->getHTTPContentTypeCharset();
+		$this->outgoing_headers[] = "Content-Type: $type" . ($charset ? '; charset=' . $charset : '');
+		//begin code to compress payload - by John
+		// NOTE: there is no way to know whether the Web server will also compress
+		// this data.
+		if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) {	
+			if (strstr($this->headers['accept-encoding'], 'gzip')) {
+				if (function_exists('gzencode')) {
+					if (isset($this->debug_flag) && $this->debug_flag) {
+						$payload .= "<!-- Content being gzipped -->";
+					}
+					$this->outgoing_headers[] = "Content-Encoding: gzip";
+					$payload = gzencode($payload);
+				} else {
+					if (isset($this->debug_flag) && $this->debug_flag) {
+						$payload .= "<!-- Content will not be gzipped: no gzencode -->";
+					}
+				}
+			} elseif (strstr($this->headers['accept-encoding'], 'deflate')) {
+				// Note: MSIE requires gzdeflate output (no Zlib header and checksum),
+				// instead of gzcompress output,
+				// which conflicts with HTTP 1.1 spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.5)
+				if (function_exists('gzdeflate')) {
+					if (isset($this->debug_flag) && $this->debug_flag) {
+						$payload .= "<!-- Content being deflated -->";
+					}
+					$this->outgoing_headers[] = "Content-Encoding: deflate";
+					$payload = gzdeflate($payload);
+				} else {
+					if (isset($this->debug_flag) && $this->debug_flag) {
+						$payload .= "<!-- Content will not be deflated: no gzcompress -->";
+					}
+				}
+			}
+		}
+		//end code
+		$this->outgoing_headers[] = "Content-Length: ".strlen($payload);
+		reset($this->outgoing_headers);
+		foreach($this->outgoing_headers as $hdr){
+			header($hdr, false);
+		}
+		print $payload;
+		$this->response = join("\r\n",$this->outgoing_headers)."\r\n\r\n".$payload;
+	}
+
+	/**
+	* takes the value that was created by parsing the request
+	* and compares to the method's signature, if available.
+	*
+	* @param	string	$operation	The operation to be invoked
+	* @param	array	$request	The array of parameter values
+	* @return	boolean	Whether the operation was found
+	* @access   private
+	*/
+	function verify_method($operation,$request){
+		if(isset($this->wsdl) && is_object($this->wsdl)){
+			if($this->wsdl->getOperationData($operation)){
+				return true;
+			}
+	    } elseif(isset($this->operations[$operation])){
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	* processes SOAP message received from client
+	*
+	* @param	array	$headers	The HTTP headers
+	* @param	string	$data		unprocessed request data from client
+	* @return	mixed	value of the message, decoded into a PHP type
+	* @access   private
+	*/
+    function parseRequest($headers, $data) {
+		$this->debug('Entering parseRequest() for data of length ' . strlen($data) . ' and type ' . $headers['content-type']);
+		if (!strstr($headers['content-type'], 'text/xml')) {
+			$this->setError('Request not of type text/xml');
+			return false;
+		}
+		if (strpos($headers['content-type'], '=')) {
+			$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
+			$this->debug('Got response encoding: ' . $enc);
+			if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+				$this->xml_encoding = strtoupper($enc);
+			} else {
+				$this->xml_encoding = 'US-ASCII';
+			}
+		} else {
+			// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+			$this->xml_encoding = 'ISO-8859-1';
+		}
+		$this->debug('Use encoding: ' . $this->xml_encoding . ' when creating soap_parser');
+		// parse response, get soap parser obj
+		$parser = new soap_parser($data,$this->xml_encoding,'',$this->decode_utf8);
+		// parser debug
+		$this->debug("parser debug: \n".$parser->getDebug());
+		// if fault occurred during message parsing
+		if($err = $parser->getError()){
+			$this->result = 'fault: error in msg parsing: '.$err;
+			$this->fault('Client',"error in msg parsing:\n".$err);
+		// else successfully parsed request into soapval object
+		} else {
+			// get/set methodname
+			$this->methodURI = $parser->root_struct_namespace;
+			$this->methodname = $parser->root_struct_name;
+			$this->debug('methodname: '.$this->methodname.' methodURI: '.$this->methodURI);
+			$this->debug('calling parser->get_response()');
+			$this->methodparams = $parser->get_response();
+			// get SOAP headers
+			$this->requestHeaders = $parser->getHeaders();
+            // add document for doclit support
+            $this->document = $parser->document;
+		}
+	 }
+
+	/**
+	* gets the HTTP body for the current response.
+	*
+	* @param string $soapmsg The SOAP payload
+	* @return string The HTTP body, which includes the SOAP payload
+	* @access private
+	*/
+	function getHTTPBody($soapmsg) {
+		return $soapmsg;
+	}
+	
+	/**
+	* gets the HTTP content type for the current response.
+	*
+	* Note: getHTTPBody must be called before this.
+	*
+	* @return string the HTTP content type for the current response.
+	* @access private
+	*/
+	function getHTTPContentType() {
+		return 'text/xml';
+	}
+	
+	/**
+	* gets the HTTP content type charset for the current response.
+	* returns false for non-text content types.
+	*
+	* Note: getHTTPBody must be called before this.
+	*
+	* @return string the HTTP content type charset for the current response.
+	* @access private
+	*/
+	function getHTTPContentTypeCharset() {
+		return $this->soap_defencoding;
+	}
+
+	/**
+	* add a method to the dispatch map (this has been replaced by the register method)
+	*
+	* @param    string $methodname
+	* @param    string $in array of input values
+	* @param    string $out array of output values
+	* @access   public
+	* @deprecated
+	*/
+	function add_to_map($methodname,$in,$out){
+			$this->operations[$methodname] = array('name' => $methodname,'in' => $in,'out' => $out);
+	}
+
+	/**
+	* register a service function with the server
+	*
+	* @param    string $name the name of the PHP function, class.method or class..method
+	* @param    array $in assoc array of input values: key = param name, value = param type
+	* @param    array $out assoc array of output values: key = param name, value = param type
+	* @param	mixed $namespace the element namespace for the method or false
+	* @param	mixed $soapaction the soapaction for the method or false
+	* @param	mixed $style optional (rpc|document) or false Note: when 'document' is specified, parameter and return wrappers are created for you automatically
+	* @param	mixed $use optional (encoded|literal) or false
+	* @param	string $documentation optional Description to include in WSDL
+	* @param	string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
+	* @access   public
+	*/
+	function register($name,$in=array(),$out=array(),$namespace=false,$soapaction=false,$style=false,$use=false,$documentation='',$encodingStyle=''){
+		global $HTTP_SERVER_VARS;
+
+		if($this->externalWSDLURL){
+			die('You cannot bind to an external WSDL file, and register methods outside of it! Please choose either WSDL or no WSDL.');
+		}
+		if (! $name) {
+			die('You must specify a name when you register an operation');
+		}
+		if (!is_array($in)) {
+			die('You must provide an array for operation inputs');
+		}
+		if (!is_array($out)) {
+			die('You must provide an array for operation outputs');
+		}
+		if(false == $namespace) {
+		}
+		if(false == $soapaction) {
+			if (isset($_SERVER)) {
+				$SERVER_NAME = $_SERVER['SERVER_NAME'];
+				$SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
+			} elseif (isset($HTTP_SERVER_VARS)) {
+				$SERVER_NAME = $HTTP_SERVER_VARS['SERVER_NAME'];
+				$SCRIPT_NAME = isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
+			} else {
+				$this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available");
+			}
+			$soapaction = "http://$SERVER_NAME$SCRIPT_NAME/$name";
+		}
+		if(false == $style) {
+			$style = "rpc";
+		}
+		if(false == $use) {
+			$use = "encoded";
+		}
+		if ($use == 'encoded' && $encodingStyle = '') {
+			$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+		}
+
+		$this->operations[$name] = array(
+	    'name' => $name,
+	    'in' => $in,
+	    'out' => $out,
+	    'namespace' => $namespace,
+	    'soapaction' => $soapaction,
+	    'style' => $style);
+        if($this->wsdl){
+        	$this->wsdl->addOperation($name,$in,$out,$namespace,$soapaction,$style,$use,$documentation,$encodingStyle);
+	    }
+		return true;
+	}
+
+	/**
+	* Specify a fault to be returned to the client.
+	* This also acts as a flag to the server that a fault has occured.
+	*
+	* @param	string $faultcode
+	* @param	string $faultstring
+	* @param	string $faultactor
+	* @param	string $faultdetail
+	* @access   public
+	*/
+	function fault($faultcode,$faultstring,$faultactor='',$faultdetail=''){
+		if ($faultdetail == '' && $this->debug_flag) {
+			$faultdetail = $this->getDebug();
+		}
+		$this->fault = new soap_fault($faultcode,$faultactor,$faultstring,$faultdetail);
+		$this->fault->soap_defencoding = $this->soap_defencoding;
+	}
+
+    /**
+    * Sets up wsdl object.
+    * Acts as a flag to enable internal WSDL generation
+    *
+    * @param string $serviceName, name of the service
+    * @param mixed $namespace optional 'tns' service namespace or false
+    * @param mixed $endpoint optional URL of service endpoint or false
+    * @param string $style optional (rpc|document) WSDL style (also specified by operation)
+    * @param string $transport optional SOAP transport
+    * @param mixed $schemaTargetNamespace optional 'types' targetNamespace for service schema or false
+    */
+    function configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http://schemas.xmlsoap.org/soap/http', $schemaTargetNamespace = false)
+    {
+    	global $HTTP_SERVER_VARS;
+
+		if (isset($_SERVER)) {
+			$SERVER_NAME = $_SERVER['SERVER_NAME'];
+			$SERVER_PORT = $_SERVER['SERVER_PORT'];
+			$SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
+			$HTTPS = $_SERVER['HTTPS'];
+		} elseif (isset($HTTP_SERVER_VARS)) {
+			$SERVER_NAME = $HTTP_SERVER_VARS['SERVER_NAME'];
+			$SERVER_PORT = $HTTP_SERVER_VARS['SERVER_PORT'];
+			$SCRIPT_NAME = isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
+			$HTTPS = $HTTP_SERVER_VARS['HTTPS'];
+		} else {
+			$this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available");
+		}
+		if ($SERVER_PORT == 80) {
+			$SERVER_PORT = '';
+		} else {
+			$SERVER_PORT = ':' . $SERVER_PORT;
+		}
+        if(false == $namespace) {
+            $namespace = "http://$SERVER_NAME/soap/$serviceName";
+        }
+        
+        if(false == $endpoint) {
+        	if ($HTTPS == '1' || $HTTPS == 'on') {
+        		$SCHEME = 'https';
+        	} else {
+        		$SCHEME = 'http';
+        	}
+            $endpoint = "$SCHEME://$SERVER_NAME$SERVER_PORT$SCRIPT_NAME";
+        }
+        
+        if(false == $schemaTargetNamespace) {
+            $schemaTargetNamespace = $namespace;
+        }
+        
+		$this->wsdl = new wsdl;
+		$this->wsdl->serviceName = $serviceName;
+        $this->wsdl->endpoint = $endpoint;
+		$this->wsdl->namespaces['tns'] = $namespace;
+		$this->wsdl->namespaces['soap'] = 'http://schemas.xmlsoap.org/wsdl/soap/';
+		$this->wsdl->namespaces['wsdl'] = 'http://schemas.xmlsoap.org/wsdl/';
+		if ($schemaTargetNamespace != $namespace) {
+			$this->wsdl->namespaces['types'] = $schemaTargetNamespace;
+		}
+        $this->wsdl->schemas[$schemaTargetNamespace][0] = new xmlschema('', '', $this->wsdl->namespaces);
+        $this->wsdl->schemas[$schemaTargetNamespace][0]->schemaTargetNamespace = $schemaTargetNamespace;
+        $this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/soap/encoding/'][0] = array('location' => '', 'loaded' => true);
+        $this->wsdl->schemas[$schemaTargetNamespace][0]->imports['http://schemas.xmlsoap.org/wsdl/'][0] = array('location' => '', 'loaded' => true);
+        $this->wsdl->bindings[$serviceName.'Binding'] = array(
+        	'name'=>$serviceName.'Binding',
+            'style'=>$style,
+            'transport'=>$transport,
+            'portType'=>$serviceName.'PortType');
+        $this->wsdl->ports[$serviceName.'Port'] = array(
+        	'binding'=>$serviceName.'Binding',
+            'location'=>$endpoint,
+            'bindingType'=>'http://schemas.xmlsoap.org/wsdl/soap/');
+    }
+}
+
+
+
+?><?php
+
+
+
+/**
+* parses a WSDL file, allows access to it's data, other utility methods
+* 
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access public 
+*/
+class wsdl extends nusoap_base {
+	// URL or filename of the root of this WSDL
+    var $wsdl; 
+    // define internal arrays of bindings, ports, operations, messages, etc.
+    var $schemas = array();
+    var $currentSchema;
+    var $message = array();
+    var $complexTypes = array();
+    var $messages = array();
+    var $currentMessage;
+    var $currentOperation;
+    var $portTypes = array();
+    var $currentPortType;
+    var $bindings = array();
+    var $currentBinding;
+    var $ports = array();
+    var $currentPort;
+    var $opData = array();
+    var $status = '';
+    var $documentation = false;
+    var $endpoint = ''; 
+    // array of wsdl docs to import
+    var $import = array(); 
+    // parser vars
+    var $parser;
+    var $position = 0;
+    var $depth = 0;
+    var $depth_array = array();
+	// for getting wsdl
+	var $proxyhost = '';
+    var $proxyport = '';
+	var $proxyusername = '';
+	var $proxypassword = '';
+	var $timeout = 0;
+	var $response_timeout = 30;
+
+    /**
+     * constructor
+     * 
+     * @param string $wsdl WSDL document URL
+	 * @param string $proxyhost
+	 * @param string $proxyport
+	 * @param string $proxyusername
+	 * @param string $proxypassword
+	 * @param integer $timeout set the connection timeout
+	 * @param integer $response_timeout set the response timeout
+     * @access public 
+     */
+    function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30){
+		parent::nusoap_base();
+        $this->wsdl = $wsdl;
+        $this->proxyhost = $proxyhost;
+        $this->proxyport = $proxyport;
+		$this->proxyusername = $proxyusername;
+		$this->proxypassword = $proxypassword;
+		$this->timeout = $timeout;
+		$this->response_timeout = $response_timeout;
+        
+        // parse wsdl file
+        if ($wsdl != "") {
+            $this->debug('initial wsdl URL: ' . $wsdl);
+            $this->parseWSDL($wsdl);
+        }
+        // imports
+        // TODO: handle imports more properly, grabbing them in-line and nesting them
+        	$imported_urls = array();
+        	$imported = 1;
+        	while ($imported > 0) {
+        		$imported = 0;
+        		// Schema imports
+        		foreach ($this->schemas as $ns => $list) {
+        			foreach ($list as $xs) {
+						$wsdlparts = parse_url($this->wsdl);	// this is bogusly simple!
+			            foreach ($xs->imports as $ns2 => $list2) {
+			                for ($ii = 0; $ii < count($list2); $ii++) {
+			                	if (! $list2[$ii]['loaded']) {
+			                		$this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true;
+			                		$url = $list2[$ii]['location'];
+									if ($url != '') {
+										$urlparts = parse_url($url);
+										if (!isset($urlparts['host'])) {
+											$url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' .$wsdlparts['port'] : '') .
+													substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
+										}
+										if (! in_array($url, $imported_urls)) {
+						                	$this->parseWSDL($url);
+					                		$imported++;
+					                		$imported_urls[] = $url;
+					                	}
+									} else {
+										$this->debug("Unexpected scenario: empty URL for unloaded import");
+									}
+								}
+							}
+			            } 
+        			}
+        		}
+        		// WSDL imports
+				$wsdlparts = parse_url($this->wsdl);	// this is bogusly simple!
+	            foreach ($this->import as $ns => $list) {
+	                for ($ii = 0; $ii < count($list); $ii++) {
+	                	if (! $list[$ii]['loaded']) {
+	                		$this->import[$ns][$ii]['loaded'] = true;
+	                		$url = $list[$ii]['location'];
+							if ($url != '') {
+								$urlparts = parse_url($url);
+								if (!isset($urlparts['host'])) {
+									$url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') .
+											substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
+								}
+								if (! in_array($url, $imported_urls)) {
+				                	$this->parseWSDL($url);
+			                		$imported++;
+			                		$imported_urls[] = $url;
+			                	}
+							} else {
+								$this->debug("Unexpected scenario: empty URL for unloaded import");
+							}
+						}
+					}
+	            } 
+			}
+        // add new data to operation data
+        foreach($this->bindings as $binding => $bindingData) {
+            if (isset($bindingData['operations']) && is_array($bindingData['operations'])) {
+                foreach($bindingData['operations'] as $operation => $data) {
+                    $this->debug('post-parse data gathering for ' . $operation);
+                    $this->bindings[$binding]['operations'][$operation]['input'] = 
+						isset($this->bindings[$binding]['operations'][$operation]['input']) ? 
+						array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) :
+						$this->portTypes[ $bindingData['portType'] ][$operation]['input'];
+                    $this->bindings[$binding]['operations'][$operation]['output'] = 
+						isset($this->bindings[$binding]['operations'][$operation]['output']) ?
+						array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) :
+						$this->portTypes[ $bindingData['portType'] ][$operation]['output'];
+                    if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ])){
+						$this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ];
+					}
+					if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ])){
+                   		$this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ];
+                    }
+					if (isset($bindingData['style'])) {
+                        $this->bindings[$binding]['operations'][$operation]['style'] = $bindingData['style'];
+                    }
+                    $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : '';
+                    $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : '';
+                    $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : '';
+                } 
+            } 
+        }
+    }
+
+    /**
+     * parses the wsdl document
+     * 
+     * @param string $wsdl path or URL
+     * @access private 
+     */
+    function parseWSDL($wsdl = '')
+    {
+        if ($wsdl == '') {
+            $this->debug('no wsdl passed to parseWSDL()!!');
+            $this->setError('no wsdl passed to parseWSDL()!!');
+            return false;
+        }
+        
+        // parse $wsdl for url format
+        $wsdl_props = parse_url($wsdl);
+
+        if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'http' || $wsdl_props['scheme'] == 'https')) {
+            $this->debug('getting WSDL http(s) URL ' . $wsdl);
+        	// get wsdl
+	        $tr = new soap_transport_http($wsdl);
+			$tr->request_method = 'GET';
+			$tr->useSOAPAction = false;
+			if($this->proxyhost && $this->proxyport){
+				$tr->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword);
+			}
+			$tr->setEncoding('gzip, deflate');
+			$wsdl_string = $tr->send('', $this->timeout, $this->response_timeout);
+			//$this->debug("WSDL request\n" . $tr->outgoing_payload);
+			//$this->debug("WSDL response\n" . $tr->incoming_payload);
+			$this->appendDebug($tr->getDebug());
+			// catch errors
+			if($err = $tr->getError() ){
+				$errstr = 'HTTP ERROR: '.$err;
+				$this->debug($errstr);
+	            $this->setError($errstr);
+				unset($tr);
+	            return false;
+			}
+			unset($tr);
+			$this->debug("got WSDL URL");
+        } else {
+            // $wsdl is not http(s), so treat it as a file URL or plain file path
+        	if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'file') && isset($wsdl_props['path'])) {
+        		$path = isset($wsdl_props['host']) ? ($wsdl_props['host'] . ':' . $wsdl_props['path']) : $wsdl_props['path'];
+        	} else {
+        		$path = $wsdl;
+        	}
+            $this->debug('getting WSDL file ' . $path);
+            if ($fp = @fopen($path, 'r')) {
+                $wsdl_string = '';
+                while ($data = fread($fp, 32768)) {
+                    $wsdl_string .= $data;
+                } 
+                fclose($fp);
+            } else {
+            	$errstr = "Bad path to WSDL file $path";
+            	$this->debug($errstr);
+                $this->setError($errstr);
+                return false;
+            } 
+        }
+        $this->debug('Parse WSDL');
+        // end new code added
+        // Create an XML parser.
+        $this->parser = xml_parser_create(); 
+        // Set the options for parsing the XML data.
+        // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
+        xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); 
+        // Set the object for the parser.
+        xml_set_object($this->parser, $this); 
+        // Set the element handlers for the parser.
+        xml_set_element_handler($this->parser, 'start_element', 'end_element');
+        xml_set_character_data_handler($this->parser, 'character_data');
+        // Parse the XML file.
+        if (!xml_parse($this->parser, $wsdl_string, true)) {
+            // Display an error message.
+            $errstr = sprintf(
+				'XML error parsing WSDL from %s on line %d: %s',
+				$wsdl,
+                xml_get_current_line_number($this->parser),
+                xml_error_string(xml_get_error_code($this->parser))
+                );
+            $this->debug($errstr);
+			$this->debug("XML payload:\n" . $wsdl_string);
+            $this->setError($errstr);
+            return false;
+        } 
+		// free the parser
+        xml_parser_free($this->parser);
+        $this->debug('Parsing WSDL done');
+		// catch wsdl parse errors
+		if($this->getError()){
+			return false;
+		}
+        return true;
+    } 
+
+    /**
+     * start-element handler
+     * 
+     * @param string $parser XML parser object
+     * @param string $name element name
+     * @param string $attrs associative array of attributes
+     * @access private 
+     */
+    function start_element($parser, $name, $attrs)
+    {
+        if ($this->status == 'schema') {
+            $this->currentSchema->schemaStartElement($parser, $name, $attrs);
+            $this->appendDebug($this->currentSchema->getDebug());
+            $this->currentSchema->clearDebug();
+        } elseif (ereg('schema$', $name)) {
+        	$this->debug('Parsing WSDL schema');
+            // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
+            $this->status = 'schema';
+            $this->currentSchema = new xmlschema('', '', $this->namespaces);
+            $this->currentSchema->schemaStartElement($parser, $name, $attrs);
+            $this->appendDebug($this->currentSchema->getDebug());
+            $this->currentSchema->clearDebug();
+        } else {
+            // position in the total number of elements, starting from 0
+            $pos = $this->position++;
+            $depth = $this->depth++; 
+            // set self as current value for this depth
+            $this->depth_array[$depth] = $pos;
+            $this->message[$pos] = array('cdata' => ''); 
+            // process attributes
+            if (count($attrs) > 0) {
+				// register namespace declarations
+                foreach($attrs as $k => $v) {
+                    if (ereg("^xmlns", $k)) {
+                        if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
+                            $this->namespaces[$ns_prefix] = $v;
+                        } else {
+                            $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v;
+                        } 
+                        if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') {
+                            $this->XMLSchemaVersion = $v;
+                            $this->namespaces['xsi'] = $v . '-instance';
+                        } 
+                    }
+                }
+                // expand each attribute prefix to its namespace
+                foreach($attrs as $k => $v) {
+                    $k = strpos($k, ':') ? $this->expandQname($k) : $k;
+                    if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') {
+                        $v = strpos($v, ':') ? $this->expandQname($v) : $v;
+                    } 
+                    $eAttrs[$k] = $v;
+                } 
+                $attrs = $eAttrs;
+            } else {
+                $attrs = array();
+            } 
+            // get element prefix, namespace and name
+            if (ereg(':', $name)) {
+                // get ns prefix
+                $prefix = substr($name, 0, strpos($name, ':')); 
+                // get ns
+                $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : ''; 
+                // get unqualified name
+                $name = substr(strstr($name, ':'), 1);
+            } 
+			// process attributes, expanding any prefixes to namespaces
+            // find status, register data
+            switch ($this->status) {
+                case 'message':
+                    if ($name == 'part') {
+			            if (isset($attrs['type'])) {
+		                    $this->debug("msg " . $this->currentMessage . ": found part $attrs[name]: " . implode(',', $attrs));
+		                    $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type'];
+            			} 
+			            if (isset($attrs['element'])) {
+		                    $this->debug("msg " . $this->currentMessage . ": found part $attrs[name]: " . implode(',', $attrs));
+			                $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'];
+			            } 
+        			} 
+        			break;
+			    case 'portType':
+			        switch ($name) {
+			            case 'operation':
+			                $this->currentPortOperation = $attrs['name'];
+			                $this->debug("portType $this->currentPortType operation: $this->currentPortOperation");
+			                if (isset($attrs['parameterOrder'])) {
+			                	$this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder'];
+			        		} 
+			        		break;
+					    case 'documentation':
+					        $this->documentation = true;
+					        break; 
+					    // merge input/output data
+					    default:
+					        $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : '';
+					        $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m;
+					        break;
+					} 
+			    	break;
+				case 'binding':
+				    switch ($name) {
+				        case 'binding': 
+				            // get ns prefix
+				            if (isset($attrs['style'])) {
+				            $this->bindings[$this->currentBinding]['prefix'] = $prefix;
+					    	} 
+					    	$this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs);
+					    	break;
+						case 'header':
+						    $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus]['headers'][] = $attrs;
+						    break;
+						case 'operation':
+						    if (isset($attrs['soapAction'])) {
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction'];
+						    } 
+						    if (isset($attrs['style'])) {
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style'];
+						    } 
+						    if (isset($attrs['name'])) {
+						        $this->currentOperation = $attrs['name'];
+						        $this->debug("current binding operation: $this->currentOperation");
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name'];
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding;
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : '';
+						    } 
+						    break;
+						case 'input':
+						    $this->opStatus = 'input';
+						    break;
+						case 'output':
+						    $this->opStatus = 'output';
+						    break;
+						case 'body':
+						    if (isset($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus])) {
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs);
+						    } else {
+						        $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs;
+						    } 
+						    break;
+					} 
+					break;
+				case 'service':
+					switch ($name) {
+					    case 'port':
+					        $this->currentPort = $attrs['name'];
+					        $this->debug('current port: ' . $this->currentPort);
+					        $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']);
+					
+					        break;
+					    case 'address':
+					        $this->ports[$this->currentPort]['location'] = $attrs['location'];
+					        $this->ports[$this->currentPort]['bindingType'] = $namespace;
+					        $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace;
+					        $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location'];
+					        break;
+					} 
+					break;
+			} 
+		// set status
+		switch ($name) {
+			case 'import':
+			    if (isset($attrs['location'])) {
+                    $this->import[$attrs['namespace']][] = array('location' => $attrs['location'], 'loaded' => false);
+                    $this->debug('parsing import ' . $attrs['namespace']. ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]).')');
+				} else {
+                    $this->import[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
+					if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
+						$this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace'];
+					}
+                    $this->debug('parsing import ' . $attrs['namespace']. ' - [no location] (' . count($this->import[$attrs['namespace']]).')');
+				}
+				break;
+			//wait for schema
+			//case 'types':
+			//	$this->status = 'schema';
+			//	break;
+			case 'message':
+				$this->status = 'message';
+				$this->messages[$attrs['name']] = array();
+				$this->currentMessage = $attrs['name'];
+				break;
+			case 'portType':
+				$this->status = 'portType';
+				$this->portTypes[$attrs['name']] = array();
+				$this->currentPortType = $attrs['name'];
+				break;
+			case "binding":
+				if (isset($attrs['name'])) {
+				// get binding name
+					if (strpos($attrs['name'], ':')) {
+			    		$this->currentBinding = $this->getLocalPart($attrs['name']);
+					} else {
+			    		$this->currentBinding = $attrs['name'];
+					} 
+					$this->status = 'binding';
+					$this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']);
+					$this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']);
+				} 
+				break;
+			case 'service':
+				$this->serviceName = $attrs['name'];
+				$this->status = 'service';
+				$this->debug('current service: ' . $this->serviceName);
+				break;
+			case 'definitions':
+				foreach ($attrs as $name => $value) {
+					$this->wsdl_info[$name] = $value;
+				} 
+				break;
+			} 
+		} 
+	} 
+
+	/**
+	* end-element handler
+	* 
+	* @param string $parser XML parser object
+	* @param string $name element name
+	* @access private 
+	*/
+	function end_element($parser, $name){ 
+		// unset schema status
+		if (/*ereg('types$', $name) ||*/ ereg('schema$', $name)) {
+			$this->status = "";
+            $this->appendDebug($this->currentSchema->getDebug());
+            $this->currentSchema->clearDebug();
+			$this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema;
+        	$this->debug('Parsing WSDL schema done');
+		} 
+		if ($this->status == 'schema') {
+			$this->currentSchema->schemaEndElement($parser, $name);
+		} else {
+			// bring depth down a notch
+			$this->depth--;
+		} 
+		// end documentation
+		if ($this->documentation) {
+			//TODO: track the node to which documentation should be assigned; it can be a part, message, etc.
+			//$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation;
+			$this->documentation = false;
+		} 
+	} 
+
+	/**
+	 * element content handler
+	 * 
+	 * @param string $parser XML parser object
+	 * @param string $data element content
+	 * @access private 
+	 */
+	function character_data($parser, $data)
+	{
+		$pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0;
+		if (isset($this->message[$pos]['cdata'])) {
+			$this->message[$pos]['cdata'] .= $data;
+		} 
+		if ($this->documentation) {
+			$this->documentation .= $data;
+		} 
+	} 
+	
+	function getBindingData($binding)
+	{
+		if (is_array($this->bindings[$binding])) {
+			return $this->bindings[$binding];
+		} 
+	}
+	
+	/**
+	 * returns an assoc array of operation names => operation data
+	 * 
+	 * @param string $bindingType eg: soap, smtp, dime (only soap is currently supported)
+	 * @return array 
+	 * @access public 
+	 */
+	function getOperations($bindingType = 'soap')
+	{
+		$ops = array();
+		if ($bindingType == 'soap') {
+			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
+		}
+		// loop thru ports
+		foreach($this->ports as $port => $portData) {
+			// binding type of port matches parameter
+			if ($portData['bindingType'] == $bindingType) {
+				//$this->debug("getOperations for port $port");
+				//$this->debug("port data: " . $this->varDump($portData));
+				//$this->debug("bindings: " . $this->varDump($this->bindings[ $portData['binding'] ]));
+				// merge bindings
+				if (isset($this->bindings[ $portData['binding'] ]['operations'])) {
+					$ops = array_merge ($ops, $this->bindings[ $portData['binding'] ]['operations']);
+				}
+			}
+		} 
+		return $ops;
+	} 
+	
+	/**
+	 * returns an associative array of data necessary for calling an operation
+	 * 
+	 * @param string $operation , name of operation
+	 * @param string $bindingType , type of binding eg: soap
+	 * @return array 
+	 * @access public 
+	 */
+	function getOperationData($operation, $bindingType = 'soap')
+	{
+		if ($bindingType == 'soap') {
+			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
+		}
+		// loop thru ports
+		foreach($this->ports as $port => $portData) {
+			// binding type of port matches parameter
+			if ($portData['bindingType'] == $bindingType) {
+				// get binding
+				//foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
+				foreach(array_keys($this->bindings[ $portData['binding'] ]['operations']) as $bOperation) {
+					// note that we could/should also check the namespace here
+					if ($operation == $bOperation) {
+						$opData = $this->bindings[ $portData['binding'] ]['operations'][$operation];
+					    return $opData;
+					} 
+				} 
+			}
+		} 
+	}
+	
+	/**
+	 * returns an associative array of data necessary for calling an operation
+	 * 
+	 * @param string $soapAction soapAction for operation
+	 * @param string $bindingType type of binding eg: soap
+	 * @return array 
+	 * @access public 
+	 */
+	function getOperationDataForSoapAction($soapAction, $bindingType = 'soap') {
+		if ($bindingType == 'soap') {
+			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/';
+		}
+		// loop thru ports
+		foreach($this->ports as $port => $portData) {
+			// binding type of port matches parameter
+			if ($portData['bindingType'] == $bindingType) {
+				// loop through operations for the binding
+				foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
+					if ($opData['soapAction'] == $soapAction) {
+					    return $opData;
+					} 
+				} 
+			}
+		} 
+	}
+	
+	/**
+    * returns an array of information about a given type
+    * returns false if no type exists by the given name
+    *
+	*	 typeDef = array(
+	*	 'elements' => array(), // refs to elements array
+	*	'restrictionBase' => '',
+	*	'phpType' => '',
+	*	'order' => '(sequence|all)',
+	*	'attrs' => array() // refs to attributes array
+	*	)
+    *
+    * @param $type string the type
+    * @param $ns string namespace (not prefix) of the type
+    * @return mixed
+    * @access public
+    * @see xmlschema
+    */
+	function getTypeDef($type, $ns) {
+		$this->debug("in getTypeDef: type=$type, ns=$ns");
+		if ((! $ns) && isset($this->namespaces['tns'])) {
+			$ns = $this->namespaces['tns'];
+			$this->debug("in getTypeDef: type namespace forced to $ns");
+		}
+		if (isset($this->schemas[$ns])) {
+			$this->debug("in getTypeDef: have schema for namespace $ns");
+			for ($i = 0; $i < count($this->schemas[$ns]); $i++) {
+				$xs = &$this->schemas[$ns][$i];
+				$t = $xs->getTypeDef($type);
+				$this->appendDebug($xs->getDebug());
+				$xs->clearDebug();
+				if ($t) {
+					if (!isset($t['phpType'])) {
+						// get info for type to tack onto the element
+						$uqType = substr($t['type'], strrpos($t['type'], ':') + 1);
+						$ns = substr($t['type'], 0, strrpos($t['type'], ':'));
+						$etype = $this->getTypeDef($uqType, $ns);
+						if ($etype) {
+							$this->debug("found type for [element] $type:");
+							$this->debug($this->varDump($etype));
+							if (isset($etype['phpType'])) {
+								$t['phpType'] = $etype['phpType'];
+							}
+							if (isset($etype['elements'])) {
+								$t['elements'] = $etype['elements'];
+							}
+							if (isset($etype['attrs'])) {
+								$t['attrs'] = $etype['attrs'];
+							}
+						}
+					}
+					return $t;
+				}
+			}
+		} else {
+			$this->debug("in getTypeDef: do not have schema for namespace $ns");
+		}
+		return false;
+	}
+
+    /**
+    * prints html description of services
+    *
+    * @access private
+    */
+    function webDescription(){
+    	global $HTTP_SERVER_VARS;
+
+		if (isset($_SERVER)) {
+			$PHP_SELF = $_SERVER['PHP_SELF'];
+		} elseif (isset($HTTP_SERVER_VARS)) {
+			$PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
+		} else {
+			$this->setError("Neither _SERVER nor HTTP_SERVER_VARS is available");
+		}
+
+		$b = '
+		<html><head><title>NuSOAP: '.$this->serviceName.'</title>
+		<style type="text/css">
+		    body    { font-family: arial; color: #000000; background-color: #ffffff; margin: 0px 0px 0px 0px; }
+		    p       { font-family: arial; color: #000000; margin-top: 0px; margin-bottom: 12px; }
+		    pre { background-color: silver; padding: 5px; font-family: Courier New; font-size: x-small; color: #000000;}
+		    ul      { margin-top: 10px; margin-left: 20px; }
+		    li      { list-style-type: none; margin-top: 10px; color: #000000; }
+		    .content{
+			margin-left: 0px; padding-bottom: 2em; }
+		    .nav {
+			padding-top: 10px; padding-bottom: 10px; padding-left: 15px; font-size: .70em;
+			margin-top: 10px; margin-left: 0px; color: #000000;
+			background-color: #ccccff; width: 20%; margin-left: 20px; margin-top: 20px; }
+		    .title {
+			font-family: arial; font-size: 26px; color: #ffffff;
+			background-color: #999999; width: 105%; margin-left: 0px;
+			padding-top: 10px; padding-bottom: 10px; padding-left: 15px;}
+		    .hidden {
+			position: absolute; visibility: hidden; z-index: 200; left: 250px; top: 100px;
+			font-family: arial; overflow: hidden; width: 600;
+			padding: 20px; font-size: 10px; background-color: #999999;
+			layer-background-color:#FFFFFF; }
+		    a,a:active  { color: charcoal; font-weight: bold; }
+		    a:visited   { color: #666666; font-weight: bold; }
+		    a:hover     { color: cc3300; font-weight: bold; }
+		</style>
+		<script language="JavaScript" type="text/javascript">
+		<!--
+		// POP-UP CAPTIONS...
+		function lib_bwcheck(){ //Browsercheck (needed)
+		    this.ver=navigator.appVersion
+		    this.agent=navigator.userAgent
+		    this.dom=document.getElementById?1:0
+		    this.opera5=this.agent.indexOf("Opera 5")>-1
+		    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
+		    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
+		    this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
+		    this.ie=this.ie4||this.ie5||this.ie6
+		    this.mac=this.agent.indexOf("Mac")>-1
+		    this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
+		    this.ns4=(document.layers && !this.dom)?1:0;
+		    this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
+		    return this
+		}
+		var bw = new lib_bwcheck()
+		//Makes crossbrowser object.
+		function makeObj(obj){
+		    this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
+		    if(!this.evnt) return false
+		    this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;
+		    this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;
+		    this.writeIt=b_writeIt;
+		    return this
+		}
+		// A unit of measure that will be added when setting the position of a layer.
+		//var px = bw.ns4||window.opera?"":"px";
+		function b_writeIt(text){
+		    if (bw.ns4){this.wref.write(text);this.wref.close()}
+		    else this.wref.innerHTML = text
+		}
+		//Shows the messages
+		var oDesc;
+		function popup(divid){
+		    if(oDesc = new makeObj(divid)){
+			oDesc.css.visibility = "visible"
+		    }
+		}
+		function popout(){ // Hides message
+		    if(oDesc) oDesc.css.visibility = "hidden"
+		}
+		//-->
+		</script>
+		</head>
+		<body>
+		<div class=content>
+			<br><br>
+			<div class=title>'.$this->serviceName.'</div>
+			<div class=nav>
+				<p>View the <a href="'.$PHP_SELF.'?wsdl">WSDL</a> for the service.
+				Click on an operation name to view it&apos;s details.</p>
+				<ul>';
+				foreach($this->getOperations() as $op => $data){
+				    $b .= "<li><a href='#' onclick=\"popout();popup('$op')\">$op</a></li>";
+				    // create hidden div
+				    $b .= "<div id='$op' class='hidden'>
+				    <a href='#' onclick='popout()'><font color='#ffffff'>Close</font></a><br><br>";
+				    foreach($data as $donnie => $marie){ // loop through opdata
+						if($donnie == 'input' || $donnie == 'output'){ // show input/output data
+						    $b .= "<font color='white'>".ucfirst($donnie).':</font><br>';
+						    foreach($marie as $captain => $tenille){ // loop through data
+								if($captain == 'parts'){ // loop thru parts
+								    $b .= "&nbsp;&nbsp;$captain:<br>";
+					                //if(is_array($tenille)){
+								    	foreach($tenille as $joanie => $chachi){
+											$b .= "&nbsp;&nbsp;&nbsp;&nbsp;$joanie: $chachi<br>";
+								    	}
+					        		//}
+								} else {
+								    $b .= "&nbsp;&nbsp;$captain: $tenille<br>";
+								}
+						    }
+						} else {
+						    $b .= "<font color='white'>".ucfirst($donnie).":</font> $marie<br>";
+						}
+				    }
+					$b .= '</div>';
+				}
+				$b .= '
+				<ul>
+			</div>
+		</div></body></html>';
+		return $b;
+    }
+
+	/**
+	* serialize the parsed wsdl
+	*
+	* @param mixed $debug whether to put debug=1 in endpoint URL
+	* @return string serialization of WSDL
+	* @access public 
+	*/
+	function serialize($debug = 0)
+	{
+		$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>';
+		$xml .= "\n<definitions";
+		foreach($this->namespaces as $k => $v) {
+			$xml .= " xmlns:$k=\"$v\"";
+		} 
+		// 10.9.02 - add poulter fix for wsdl and tns declarations
+		if (isset($this->namespaces['wsdl'])) {
+			$xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\"";
+		} 
+		if (isset($this->namespaces['tns'])) {
+			$xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\"";
+		} 
+		$xml .= '>'; 
+		// imports
+		if (sizeof($this->import) > 0) {
+			foreach($this->import as $ns => $list) {
+				foreach ($list as $ii) {
+					if ($ii['location'] != '') {
+						$xml .= '<import location="' . $ii['location'] . '" namespace="' . $ns . '" />';
+					} else {
+						$xml .= '<import namespace="' . $ns . '" />';
+					}
+				}
+			} 
+		} 
+		// types
+		if (count($this->schemas)>=1) {
+			$xml .= "\n<types>";
+			foreach ($this->schemas as $ns => $list) {
+				foreach ($list as $xs) {
+					$xml .= $xs->serializeSchema();
+				}
+			}
+			$xml .= '</types>';
+		} 
+		// messages
+		if (count($this->messages) >= 1) {
+			foreach($this->messages as $msgName => $msgParts) {
+				$xml .= "\n<message name=\"" . $msgName . '">';
+				if(is_array($msgParts)){
+					foreach($msgParts as $partName => $partType) {
+						// print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'<br>';
+						if (strpos($partType, ':')) {
+						    $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType));
+						} elseif (isset($this->typemap[$this->namespaces['xsd']][$partType])) {
+						    // print 'checking typemap: '.$this->XMLSchemaVersion.'<br>';
+						    $typePrefix = 'xsd';
+						} else {
+						    foreach($this->typemap as $ns => $types) {
+						        if (isset($types[$partType])) {
+						            $typePrefix = $this->getPrefixFromNamespace($ns);
+						        } 
+						    } 
+						    if (!isset($typePrefix)) {
+						        die("$partType has no namespace!");
+						    } 
+						}
+						$ns = $this->getNamespaceFromPrefix($typePrefix);
+						$typeDef = $this->getTypeDef($this->getLocalPart($partType), $ns);
+						if ($typeDef['typeClass'] == 'element') {
+							$elementortype = 'element';
+						} else {
+							$elementortype = 'type';
+						}
+						$xml .= '<part name="' . $partName . '" ' . $elementortype . '="' . $typePrefix . ':' . $this->getLocalPart($partType) . '" />';
+					}
+				}
+				$xml .= '</message>';
+			} 
+		} 
+		// bindings & porttypes
+		if (count($this->bindings) >= 1) {
+			$binding_xml = '';
+			$portType_xml = '';
+			foreach($this->bindings as $bindingName => $attrs) {
+				$binding_xml .= "\n<binding name=\"" . $bindingName . '" type="tns:' . $attrs['portType'] . '">';
+				$binding_xml .= '<soap:binding style="' . $attrs['style'] . '" transport="' . $attrs['transport'] . '"/>';
+				$portType_xml .= "\n<portType name=\"" . $attrs['portType'] . '">';
+				foreach($attrs['operations'] as $opName => $opParts) {
+					$binding_xml .= '<operation name="' . $opName . '">';
+					$binding_xml .= '<soap:operation soapAction="' . $opParts['soapAction'] . '" style="'. $opParts['style'] . '"/>';
+					if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') {
+						$enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
+					} else {
+						$enc_style = '';
+					}
+					$binding_xml .= '<input><soap:body use="' . $opParts['input']['use'] . '" namespace="' . $opParts['input']['namespace'] . '"' . $enc_style . '/></input>';
+					if (isset($opParts['output']['encodingStyle']) && $opParts['output']['encodingStyle'] != '') {
+						$enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"';
+					} else {
+						$enc_style = '';
+					}
+					$binding_xml .= '<output><soap:body use="' . $opParts['output']['use'] . '" namespace="' . $opParts['output']['namespace'] . '"' . $enc_style . '/></output>';
+					$binding_xml .= '</operation>';
+					$portType_xml .= '<operation name="' . $opParts['name'] . '"';
+					if (isset($opParts['parameterOrder'])) {
+					    $portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"';
+					} 
+					$portType_xml .= '>';
+					if(isset($opParts['documentation']) && $opParts['documentation'] != '') {
+						$portType_xml .= '<documentation>' . htmlspecialchars($opParts['documentation']) . '</documentation>';
+					}
+					$portType_xml .= '<input message="tns:' . $opParts['input']['message'] . '"/>';
+					$portType_xml .= '<output message="tns:' . $opParts['output']['message'] . '"/>';
+					$portType_xml .= '</operation>';
+				} 
+				$portType_xml .= '</portType>';
+				$binding_xml .= '</binding>';
+			} 
+			$xml .= $portType_xml . $binding_xml;
+		} 
+		// services
+		$xml .= "\n<service name=\"" . $this->serviceName . '">';
+		if (count($this->ports) >= 1) {
+			foreach($this->ports as $pName => $attrs) {
+				$xml .= '<port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">';
+				$xml .= '<soap:address location="' . $attrs['location'] . ($debug ? '?debug=1' : '') . '"/>';
+				$xml .= '</port>';
+			} 
+		} 
+		$xml .= '</service>';
+		return $xml . "\n</definitions>";
+	} 
+	
+	/**
+	 * serialize PHP values according to a WSDL message definition
+	 *
+	 * TODO
+	 * - multi-ref serialization
+	 * - validate PHP values against type definitions, return errors if invalid
+	 * 
+	 * @param string $operation operation name
+	 * @param string $direction (input|output)
+	 * @param mixed $parameters parameter value(s)
+	 * @return mixed parameters serialized as XML or false on error (e.g. operation not found)
+	 * @access public
+	 */
+	function serializeRPCParameters($operation, $direction, $parameters)
+	{
+		$this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); 
+		$this->appendDebug('parameters=' . $this->varDump($parameters));
+		
+		if ($direction != 'input' && $direction != 'output') {
+			$this->debug('The value of the \$direction argument needs to be either "input" or "output"');
+			$this->setError('The value of the \$direction argument needs to be either "input" or "output"');
+			return false;
+		} 
+		if (!$opData = $this->getOperationData($operation)) {
+			$this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
+			$this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
+			return false;
+		}
+		$this->debug('opData:');
+		$this->appendDebug($this->varDump($opData));
+
+		// Get encoding style for output and set to current
+		$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+		if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
+			$encodingStyle = $opData['output']['encodingStyle'];
+			$enc_style = $encodingStyle;
+		}
+
+		// set input params
+		$xml = '';
+		if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
+			
+			$use = $opData[$direction]['use'];
+			$this->debug('have ' . count($opData[$direction]['parts']) . ' part(s) to serialize');
+			if (is_array($parameters)) {
+				$parametersArrayType = $this->isArraySimpleOrStruct($parameters);
+				$this->debug('have ' . count($parameters) . ' parameter(s) provided as ' . $parametersArrayType . ' to serialize');
+				foreach($opData[$direction]['parts'] as $name => $type) {
+					$this->debug('serializing part "'.$name.'" of type "'.$type.'"');
+					// Track encoding style
+					if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
+						$encodingStyle = $opData[$direction]['encodingStyle'];			
+						$enc_style = $encodingStyle;
+					} else {
+						$enc_style = false;
+					}
+					// NOTE: add error handling here
+					// if serializeType returns false, then catch global error and fault
+					if ($parametersArrayType == 'arraySimple') {
+						$p = array_shift($parameters);
+						$this->debug('calling serializeType w/indexed param');
+						$xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
+					} elseif (isset($parameters[$name])) {
+						$this->debug('calling serializeType w/named param');
+						$xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
+					} else {
+						// TODO: only send nillable
+						$this->debug('calling serializeType w/null param');
+						$xml .= $this->serializeType($name, $type, null, $use, $enc_style);
+					}
+				}
+			} else {
+				$this->debug('no parameters passed.');
+			}
+		}
+		$this->debug("serializeRPCParameters returning: $xml");
+		return $xml;
+	} 
+	
+	/**
+	 * serialize a PHP value according to a WSDL message definition
+	 * 
+	 * TODO
+	 * - multi-ref serialization
+	 * - validate PHP values against type definitions, return errors if invalid
+	 * 
+	 * @param string $ type name
+	 * @param mixed $ param value
+	 * @return mixed new param or false if initial value didn't validate
+	 * @access public
+	 * @deprecated
+	 */
+	function serializeParameters($operation, $direction, $parameters)
+	{
+		$this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); 
+		$this->appendDebug('parameters=' . $this->varDump($parameters));
+		
+		if ($direction != 'input' && $direction != 'output') {
+			$this->debug('The value of the \$direction argument needs to be either "input" or "output"');
+			$this->setError('The value of the \$direction argument needs to be either "input" or "output"');
+			return false;
+		} 
+		if (!$opData = $this->getOperationData($operation)) {
+			$this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
+			$this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
+			return false;
+		}
+		$this->debug('opData:');
+		$this->appendDebug($this->varDump($opData));
+		
+		// Get encoding style for output and set to current
+		$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+		if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
+			$encodingStyle = $opData['output']['encodingStyle'];
+			$enc_style = $encodingStyle;
+		}
+		
+		// set input params
+		$xml = '';
+		if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) {
+			
+			$use = $opData[$direction]['use'];
+			$this->debug("use=$use");
+			$this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
+			if (is_array($parameters)) {
+				$parametersArrayType = $this->isArraySimpleOrStruct($parameters);
+				$this->debug('have ' . $parametersArrayType . ' parameters');
+				foreach($opData[$direction]['parts'] as $name => $type) {
+					$this->debug('serializing part "'.$name.'" of type "'.$type.'"');
+					// Track encoding style
+					if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
+						$encodingStyle = $opData[$direction]['encodingStyle'];			
+						$enc_style = $encodingStyle;
+					} else {
+						$enc_style = false;
+					}
+					// NOTE: add error handling here
+					// if serializeType returns false, then catch global error and fault
+					if ($parametersArrayType == 'arraySimple') {
+						$p = array_shift($parameters);
+						$this->debug('calling serializeType w/indexed param');
+						$xml .= $this->serializeType($name, $type, $p, $use, $enc_style);
+					} elseif (isset($parameters[$name])) {
+						$this->debug('calling serializeType w/named param');
+						$xml .= $this->serializeType($name, $type, $parameters[$name], $use, $enc_style);
+					} else {
+						// TODO: only send nillable
+						$this->debug('calling serializeType w/null param');
+						$xml .= $this->serializeType($name, $type, null, $use, $enc_style);
+					}
+				}
+			} else {
+				$this->debug('no parameters passed.');
+			}
+		}
+		$this->debug("serializeParameters returning: $xml");
+		return $xml;
+	} 
+	
+	/**
+	 * serializes a PHP value according a given type definition
+	 * 
+	 * @param string $name name of value (part or element)
+	 * @param string $type XML schema type of value (type or element)
+	 * @param mixed $value a native PHP value (parameter value)
+	 * @param string $use use for part (encoded|literal)
+	 * @param string $encodingStyle SOAP encoding style for the value (if different than the enclosing style)
+	 * @param boolean $unqualified a kludge for what should be XML namespace form handling
+	 * @return string value serialized as an XML string
+	 * @access private
+	 */
+	function serializeType($name, $type, $value, $use='encoded', $encodingStyle=false, $unqualified=false)
+	{
+		$this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified"));
+		$this->appendDebug("value=" . $this->varDump($value));
+		if($use == 'encoded' && $encodingStyle) {
+			$encodingStyle = ' SOAP-ENV:encodingStyle="' . $encodingStyle . '"';
+		}
+
+		// if a soapval has been supplied, let its type override the WSDL
+    	if (is_object($value) && get_class($value) == 'soapval') {
+    		if ($value->type_ns) {
+    			$type = $value->type_ns . ':' . $value->type;
+		    	$forceType = true;
+		    	$this->debug("in serializeType: soapval overrides type to $type");
+    		} elseif ($value->type) {
+	    		$type = $value->type;
+		    	$forceType = true;
+		    	$this->debug("in serializeType: soapval overrides type to $type");
+	    	} else {
+	    		$forceType = false;
+		    	$this->debug("in serializeType: soapval does not override type");
+	    	}
+	    	$attrs = $value->attributes;
+	    	$value = $value->value;
+	    	$this->debug("in serializeType: soapval overrides value to $value");
+	    	if ($attrs) {
+	    		if (!is_array($value)) {
+	    			$value['!'] = $value;
+	    		}
+	    		foreach ($attrs as $n => $v) {
+	    			$value['!' . $n] = $v;
+	    		}
+		    	$this->debug("in serializeType: soapval provides attributes");
+		    }
+        } else {
+        	$forceType = false;
+        }
+
+		$xml = '';
+		if (strpos($type, ':')) {
+			$uqType = substr($type, strrpos($type, ':') + 1);
+			$ns = substr($type, 0, strrpos($type, ':'));
+			$this->debug("in serializeType: got a prefixed type: $uqType, $ns");
+			if ($this->getNamespaceFromPrefix($ns)) {
+				$ns = $this->getNamespaceFromPrefix($ns);
+				$this->debug("in serializeType: expanded prefixed type: $uqType, $ns");
+			}
+
+			if($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/'){
+				$this->debug('in serializeType: type namespace indicates XML Schema or SOAP Encoding type');
+				if ($unqualified  && $use == 'literal') {
+					$elementNS = " xmlns=\"\"";
+				} else {
+					$elementNS = '';
+				}
+				if (is_null($value)) {
+					if ($use == 'literal') {
+						// TODO: depends on minOccurs
+						$xml = "<$name$elementNS/>";
+					} else {
+						// TODO: depends on nillable, which should be checked before calling this method
+						$xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
+					}
+					$this->debug("in serializeType: returning: $xml");
+					return $xml;
+				}
+		    	if ($uqType == 'boolean') {
+		    		if ((is_string($value) && $value == 'false') || (! $value)) {
+						$value = 'false';
+					} else {
+						$value = 'true';
+					}
+				} 
+				if ($uqType == 'string' && gettype($value) == 'string') {
+					$value = $this->expandEntities($value);
+				}
+				if (($uqType == 'long' || $uqType == 'unsignedLong') && gettype($value) == 'double') {
+					$value = sprintf("%.0lf", $value);
+				}
+				// it's a scalar
+				// TODO: what about null/nil values?
+				// check type isn't a custom type extending xmlschema namespace
+				if (!$this->getTypeDef($uqType, $ns)) {
+					if ($use == 'literal') {
+						if ($forceType) {
+							$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
+						} else {
+							$xml = "<$name$elementNS>$value</$name>";
+						}
+					} else {
+						$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
+					}
+					$this->debug("in serializeType: returning: $xml");
+					return $xml;
+				}
+				$this->debug('custom type extends XML Schema or SOAP Encoding namespace (yuck)');
+			} else if ($ns == 'http://xml.apache.org/xml-soap') {
+				$this->debug('in serializeType: appears to be Apache SOAP type');
+				if ($uqType == 'Map') {
+					$tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
+					if (! $tt_prefix) {
+						$this->debug('in serializeType: Add namespace for Apache SOAP type');
+						$tt_prefix = 'ns' . rand(1000, 9999);
+						$this->namespaces[$tt_prefix] = 'http://xml.apache.org/xml-soap';
+						// force this to be added to usedNamespaces
+						$tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
+					}
+					$contents = '';
+					foreach($value as $k => $v) {
+						$this->debug("serializing map element: key $k, value $v");
+						$contents .= '<item>';
+						$contents .= $this->serialize_val($k,'key',false,false,false,false,$use);
+						$contents .= $this->serialize_val($v,'value',false,false,false,false,$use);
+						$contents .= '</item>';
+					}
+					if ($use == 'literal') {
+						if ($forceType) {
+							$xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\">$contents</$name>";
+						} else {
+							$xml = "<$name>$contents</$name>";
+						}
+					} else {
+						$xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\"$encodingStyle>$contents</$name>";
+					}
+					$this->debug("in serializeType: returning: $xml");
+					return $xml;
+				}
+				$this->debug('in serializeType: Apache SOAP type, but only support Map');
+			}
+		} else {
+			// TODO: should the type be compared to types in XSD, and the namespace
+			// set to XSD if the type matches?
+			$this->debug("in serializeType: No namespace for type $type");
+			$ns = '';
+			$uqType = $type;
+		}
+		if(!$typeDef = $this->getTypeDef($uqType, $ns)){
+			$this->setError("$type ($uqType) is not a supported type.");
+			$this->debug("in serializeType: $type ($uqType) is not a supported type.");
+			return false;
+		} else {
+			$this->debug("in serializeType: found typeDef");
+			$this->appendDebug('typeDef=' . $this->varDump($typeDef));
+		}
+		$phpType = $typeDef['phpType'];
+		$this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); 
+		// if php type == struct, map value to the <all> element names
+		if ($phpType == 'struct') {
+			if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') {
+				$elementName = $uqType;
+				if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
+					$elementNS = " xmlns=\"$ns\"";
+				} else {
+					$elementNS = " xmlns=\"\"";
+				}
+			} else {
+				$elementName = $name;
+				if ($unqualified) {
+					$elementNS = " xmlns=\"\"";
+				} else {
+					$elementNS = '';
+				}
+			}
+			if (is_null($value)) {
+				if ($use == 'literal') {
+					// TODO: depends on minOccurs
+					$xml = "<$elementName$elementNS/>";
+				} else {
+					$xml = "<$elementName$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
+				}
+				$this->debug("in serializeType: returning: $xml");
+				return $xml;
+			}
+			if (is_object($value)) {
+				$value = get_object_vars($value);
+			}
+			if (is_array($value)) {
+				$elementAttrs = $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
+				if ($use == 'literal') {
+					if ($forceType) {
+						$xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">";
+					} else {
+						$xml = "<$elementName$elementNS$elementAttrs>";
+					}
+				} else {
+					$xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>";
+				}
+	
+				$xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle);
+				$xml .= "</$elementName>";
+			} else {
+				$this->debug("in serializeType: phpType is struct, but value is not an array");
+				$this->setError("phpType is struct, but value is not an array: see debug output for details");
+				$xml = '';
+			}
+		} elseif ($phpType == 'array') {
+			if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
+				$elementNS = " xmlns=\"$ns\"";
+			} else {
+				if ($unqualified) {
+					$elementNS = " xmlns=\"\"";
+				} else {
+					$elementNS = '';
+				}
+			}
+			if (is_null($value)) {
+				if ($use == 'literal') {
+					// TODO: depends on minOccurs
+					$xml = "<$name$elementNS/>";
+				} else {
+					$xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" .
+						$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
+						":Array\" " .
+						$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
+						':arrayType="' .
+						$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) .
+						':' .
+						$this->getLocalPart($typeDef['arrayType'])."[0]\"/>";
+				}
+				$this->debug("in serializeType: returning: $xml");
+				return $xml;
+			}
+			if (isset($typeDef['multidimensional'])) {
+				$nv = array();
+				foreach($value as $v) {
+					$cols = ',' . sizeof($v);
+					$nv = array_merge($nv, $v);
+				} 
+				$value = $nv;
+			} else {
+				$cols = '';
+			} 
+			if (is_array($value) && sizeof($value) >= 1) {
+				$rows = sizeof($value);
+				$contents = '';
+				foreach($value as $k => $v) {
+					$this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]");
+					//if (strpos($typeDef['arrayType'], ':') ) {
+					if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) {
+					    $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);
+					} else {
+					    $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use);
+					} 
+				}
+			} else {
+				$rows = 0;
+				$contents = null;
+			}
+			// TODO: for now, an empty value will be serialized as a zero element
+			// array.  Revisit this when coding the handling of null/nil values.
+			if ($use == 'literal') {
+				$xml = "<$name$elementNS>"
+					.$contents
+					."</$name>";
+			} else {
+				$xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/').':Array" '.
+					$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/')
+					.':arrayType="'
+					.$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType']))
+					.":".$this->getLocalPart($typeDef['arrayType'])."[$rows$cols]\">"
+					.$contents
+					."</$name>";
+			}
+		} elseif ($phpType == 'scalar') {
+			if (isset($typeDef['form']) && ($typeDef['form'] == 'qualified')) {
+				$elementNS = " xmlns=\"$ns\"";
+			} else {
+				if ($unqualified) {
+					$elementNS = " xmlns=\"\"";
+				} else {
+					$elementNS = '';
+				}
+			}
+			if ($use == 'literal') {
+				if ($forceType) {
+					$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
+				} else {
+					$xml = "<$name$elementNS>$value</$name>";
+				}
+			} else {
+				$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
+			}
+		}
+		$this->debug("in serializeType: returning: $xml");
+		return $xml;
+	}
+	
+	/**
+	 * serializes the attributes for a complexType
+	 *
+	 * @param array $typeDef our internal representation of an XML schema type (or element)
+	 * @param mixed $value a native PHP value (parameter value)
+	 * @param string $ns the namespace of the type
+	 * @param string $uqType the local part of the type
+	 * @return string value serialized as an XML string
+	 * @access private
+	 */
+	function serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType) {
+		$xml = '';
+		if (isset($typeDef['attrs']) && is_array($typeDef['attrs'])) {
+			$this->debug("serialize attributes for XML Schema type $ns:$uqType");
+			if (is_array($value)) {
+				$xvalue = $value;
+			} elseif (is_object($value)) {
+				$xvalue = get_object_vars($value);
+			} else {
+				$this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
+				$xvalue = array();
+			}
+			foreach ($typeDef['attrs'] as $aName => $attrs) {
+				if (isset($xvalue['!' . $aName])) {
+					$xname = '!' . $aName;
+					$this->debug("value provided for attribute $aName with key $xname");
+				} elseif (isset($xvalue[$aName])) {
+					$xname = $aName;
+					$this->debug("value provided for attribute $aName with key $xname");
+				} elseif (isset($attrs['default'])) {
+					$xname = '!' . $aName;
+					$xvalue[$xname] = $attrs['default'];
+					$this->debug('use default value of ' . $xvalue[$aName] . ' for attribute ' . $aName);
+				} else {
+					$xname = '';
+					$this->debug("no value provided for attribute $aName");
+				}
+				if ($xname) {
+					$xml .=  " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\"";
+				}
+			} 
+		} else {
+			$this->debug("no attributes to serialize for XML Schema type $ns:$uqType");
+		}
+		if (isset($typeDef['extensionBase'])) {
+			$ns = $this->getPrefix($typeDef['extensionBase']);
+			$uqType = $this->getLocalPart($typeDef['extensionBase']);
+			if ($this->getNamespaceFromPrefix($ns)) {
+				$ns = $this->getNamespaceFromPrefix($ns);
+			}
+			if ($typeDef = $this->getTypeDef($uqType, $ns)) {
+				$this->debug("serialize attributes for extension base $ns:$uqType");
+				$xml .= $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
+			} else {
+				$this->debug("extension base $ns:$uqType is not a supported type");
+			}
+		}
+		return $xml;
+	}
+
+	/**
+	 * serializes the elements for a complexType
+	 *
+	 * @param array $typeDef our internal representation of an XML schema type (or element)
+	 * @param mixed $value a native PHP value (parameter value)
+	 * @param string $ns the namespace of the type
+	 * @param string $uqType the local part of the type
+	 * @param string $use use for part (encoded|literal)
+	 * @param string $encodingStyle SOAP encoding style for the value (if different than the enclosing style)
+	 * @return string value serialized as an XML string
+	 * @access private
+	 */
+	function serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false) {
+		$xml = '';
+		if (isset($typeDef['elements']) && is_array($typeDef['elements'])) {
+			$this->debug("in serializeComplexTypeElements, serialize elements for XML Schema type $ns:$uqType");
+			if (is_array($value)) {
+				$xvalue = $value;
+			} elseif (is_object($value)) {
+				$xvalue = get_object_vars($value);
+			} else {
+				$this->debug("value is neither an array nor an object for XML Schema type $ns:$uqType");
+				$xvalue = array();
+			}
+			// toggle whether all elements are present - ideally should validate against schema
+			if (count($typeDef['elements']) != count($xvalue)){
+				$optionals = true;
+			}
+			foreach ($typeDef['elements'] as $eName => $attrs) {
+				if (!isset($xvalue[$eName])) {
+					if (isset($attrs['default'])) {
+						$xvalue[$eName] = $attrs['default'];
+						$this->debug('use default value of ' . $xvalue[$eName] . ' for element ' . $eName);
+					}
+				}
+				// if user took advantage of a minOccurs=0, then only serialize named parameters
+				if (isset($optionals)
+				    && (!isset($xvalue[$eName])) 
+					&& ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
+					){
+					if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') {
+						$this->debug("apparent error: no value provided for element $eName with minOccurs=" . $attrs['minOccurs']);
+					}
+					// do nothing
+					$this->debug("no value provided for complexType element $eName and element is not nillable, so serialize nothing");
+				} else {
+					// get value
+					if (isset($xvalue[$eName])) {
+					    $v = $xvalue[$eName];
+					} else {
+					    $v = null;
+					}
+					if (isset($attrs['form'])) {
+						$unqualified = ($attrs['form'] == 'unqualified');
+					} else {
+						$unqualified = false;
+					}
+					if (isset($attrs['maxOccurs']) && ($attrs['maxOccurs'] == 'unbounded' || $attrs['maxOccurs'] > 1) && isset($v) && is_array($v) && $this->isArraySimpleOrStruct($v) == 'arraySimple') {
+						$vv = $v;
+						foreach ($vv as $k => $v) {
+							if (isset($attrs['type']) || isset($attrs['ref'])) {
+								// serialize schema-defined type
+							    $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
+							} else {
+								// serialize generic type (can this ever really happen?)
+							    $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
+							    $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
+							}
+						}
+					} else {
+						if (isset($attrs['type']) || isset($attrs['ref'])) {
+							// serialize schema-defined type
+						    $xml .= $this->serializeType($eName, isset($attrs['type']) ? $attrs['type'] : $attrs['ref'], $v, $use, $encodingStyle, $unqualified);
+						} else {
+							// serialize generic type (can this ever really happen?)
+						    $this->debug("calling serialize_val() for $v, $eName, false, false, false, false, $use");
+						    $xml .= $this->serialize_val($v, $eName, false, false, false, false, $use);
+						}
+					}
+				}
+			} 
+		} else {
+			$this->debug("no elements to serialize for XML Schema type $ns:$uqType");
+		}
+		if (isset($typeDef['extensionBase'])) {
+			$ns = $this->getPrefix($typeDef['extensionBase']);
+			$uqType = $this->getLocalPart($typeDef['extensionBase']);
+			if ($this->getNamespaceFromPrefix($ns)) {
+				$ns = $this->getNamespaceFromPrefix($ns);
+			}
+			if ($typeDef = $this->getTypeDef($uqType, $ns)) {
+				$this->debug("serialize elements for extension base $ns:$uqType");
+				$xml .= $this->serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use, $encodingStyle);
+			} else {
+				$this->debug("extension base $ns:$uqType is not a supported type");
+			}
+		}
+		return $xml;
+	}
+
+	/**
+	* adds an XML Schema complex type to the WSDL types
+	*
+	* @param string	name
+	* @param string typeClass (complexType|simpleType|attribute)
+	* @param string phpType: currently supported are array and struct (php assoc array)
+	* @param string compositor (all|sequence|choice)
+	* @param string restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
+	* @param array elements = array ( name => array(name=>'',type=>'') )
+	* @param array attrs = 	array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]'))
+	* @param string arrayType: namespace:name (xsd:string)
+	* @see xmlschema
+	* @access public
+	*/
+	function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType='') {
+		if (count($elements) > 0) {
+	    	foreach($elements as $n => $e){
+	            // expand each element
+	            foreach ($e as $k => $v) {
+		            $k = strpos($k,':') ? $this->expandQname($k) : $k;
+		            $v = strpos($v,':') ? $this->expandQname($v) : $v;
+		            $ee[$k] = $v;
+		    	}
+	    		$eElements[$n] = $ee;
+	    	}
+	    	$elements = $eElements;
+		}
+		
+		if (count($attrs) > 0) {
+	    	foreach($attrs as $n => $a){
+	            // expand each attribute
+	            foreach ($a as $k => $v) {
+		            $k = strpos($k,':') ? $this->expandQname($k) : $k;
+		            $v = strpos($v,':') ? $this->expandQname($v) : $v;
+		            $aa[$k] = $v;
+		    	}
+	    		$eAttrs[$n] = $aa;
+	    	}
+	    	$attrs = $eAttrs;
+		}
+
+		$restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
+		$arrayType = strpos($arrayType,':') ? $this->expandQname($arrayType) : $arrayType;
+
+		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
+		$this->schemas[$typens][0]->addComplexType($name,$typeClass,$phpType,$compositor,$restrictionBase,$elements,$attrs,$arrayType);
+	}
+
+	/**
+	* adds an XML Schema simple type to the WSDL types
+	*
+	* @param string $name
+	* @param string $restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
+	* @param string $typeClass (should always be simpleType)
+	* @param string $phpType (should always be scalar)
+	* @param array $enumeration array of values
+	* @see xmlschema
+	* @access public
+	*/
+	function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) {
+		$restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
+
+		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
+		$this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType, $enumeration);
+	}
+
+	/**
+	* adds an element to the WSDL types
+	*
+	* @param array $attrs attributes that must include name and type
+	* @see xmlschema
+	* @access public
+	*/
+	function addElement($attrs) {
+		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
+		$this->schemas[$typens][0]->addElement($attrs);
+	}
+
+	/**
+	* register an operation with the server
+	* 
+	* @param string $name operation (method) name
+	* @param array $in assoc array of input values: key = param name, value = param type
+	* @param array $out assoc array of output values: key = param name, value = param type
+	* @param string $namespace optional The namespace for the operation
+	* @param string $soapaction optional The soapaction for the operation
+	* @param string $style (rpc|document) optional The style for the operation Note: when 'document' is specified, parameter and return wrappers are created for you automatically
+	* @param string $use (encoded|literal) optional The use for the parameters (cannot mix right now)
+	* @param string $documentation optional The description to include in the WSDL
+	* @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
+	* @access public 
+	*/
+	function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){
+		if ($use == 'encoded' && $encodingStyle == '') {
+			$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+		}
+
+		if ($style == 'document') {
+			$elements = array();
+			foreach ($in as $n => $t) {
+				$elements[$n] = array('name' => $n, 'type' => $t);
+			}
+			$this->addComplexType($name . 'RequestType', 'complexType', 'struct', 'all', '', $elements);
+			$this->addElement(array('name' => $name, 'type' => $name . 'RequestType'));
+			$in = array('parameters' => 'tns:' . $name);
+
+			$elements = array();
+			foreach ($out as $n => $t) {
+				$elements[$n] = array('name' => $n, 'type' => $t);
+			}
+			$this->addComplexType($name . 'ResponseType', 'complexType', 'struct', 'all', '', $elements);
+			$this->addElement(array('name' => $name . 'Response', 'type' => $name . 'ResponseType'));
+			$out = array('parameters' => 'tns:' . $name . 'Response');
+		}
+
+		// get binding
+		$this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] =
+		array(
+		'name' => $name,
+		'binding' => $this->serviceName . 'Binding',
+		'endpoint' => $this->endpoint,
+		'soapAction' => $soapaction,
+		'style' => $style,
+		'input' => array(
+			'use' => $use,
+			'namespace' => $namespace,
+			'encodingStyle' => $encodingStyle,
+			'message' => $name . 'Request',
+			'parts' => $in),
+		'output' => array(
+			'use' => $use,
+			'namespace' => $namespace,
+			'encodingStyle' => $encodingStyle,
+			'message' => $name . 'Response',
+			'parts' => $out),
+		'namespace' => $namespace,
+		'transport' => 'http://schemas.xmlsoap.org/soap/http',
+		'documentation' => $documentation); 
+		// add portTypes
+		// add messages
+		if($in)
+		{
+			foreach($in as $pName => $pType)
+			{
+				if(strpos($pType,':')) {
+					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
+				}
+				$this->messages[$name.'Request'][$pName] = $pType;
+			}
+		} else {
+            $this->messages[$name.'Request']= '0';
+        }
+		if($out)
+		{
+			foreach($out as $pName => $pType)
+			{
+				if(strpos($pType,':')) {
+					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
+				}
+				$this->messages[$name.'Response'][$pName] = $pType;
+			}
+		} else {
+            $this->messages[$name.'Response']= '0';
+        }
+		return true;
+	} 
+}
+?><?php
+
+
+
+/**
+*
+* soap_parser class parses SOAP XML messages into native PHP values
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class soap_parser extends nusoap_base {
+
+	var $xml = '';
+	var $xml_encoding = '';
+	var $method = '';
+	var $root_struct = '';
+	var $root_struct_name = '';
+	var $root_struct_namespace = '';
+	var $root_header = '';
+    var $document = '';			// incoming SOAP body (text)
+	// determines where in the message we are (envelope,header,body,method)
+	var $status = '';
+	var $position = 0;
+	var $depth = 0;
+	var $default_namespace = '';
+	var $namespaces = array();
+	var $message = array();
+    var $parent = '';
+	var $fault = false;
+	var $fault_code = '';
+	var $fault_str = '';
+	var $fault_detail = '';
+	var $depth_array = array();
+	var $debug_flag = true;
+	var $soapresponse = NULL;
+	var $responseHeaders = '';	// incoming SOAP headers (text)
+	var $body_position = 0;
+	// for multiref parsing:
+	// array of id => pos
+	var $ids = array();
+	// array of id => hrefs => pos
+	var $multirefs = array();
+	// toggle for auto-decoding element content
+	var $decode_utf8 = true;
+
+	/**
+	* constructor that actually does the parsing
+	*
+	* @param    string $xml SOAP message
+	* @param    string $encoding character encoding scheme of message
+	* @param    string $method method for which XML is parsed (unused?)
+	* @param    string $decode_utf8 whether to decode UTF-8 to ISO-8859-1
+	* @access   public
+	*/
+	function soap_parser($xml,$encoding='UTF-8',$method='',$decode_utf8=true){
+		parent::nusoap_base();
+		$this->xml = $xml;
+		$this->xml_encoding = $encoding;
+		$this->method = $method;
+		$this->decode_utf8 = $decode_utf8;
+
+		// Check whether content has been read.
+		if(!empty($xml)){
+			// Check XML encoding
+			$pos_xml = strpos($xml, '<?xml');
+			if ($pos_xml !== FALSE) {
+				$xml_decl = substr($xml, $pos_xml, strpos($xml, '?>', $pos_xml + 2) - $pos_xml + 1);
+				if (preg_match("/encoding=[\"']([^\"']*)[\"']/", $xml_decl, $res)) {
+					$xml_encoding = $res[1];
+					if (strtoupper($xml_encoding) != $encoding) {
+						$err = "Charset from HTTP Content-Type '" . $encoding . "' does not match encoding from XML declaration '" . $xml_encoding . "'";
+						$this->debug($err);
+						if ($encoding != 'ISO-8859-1' || strtoupper($xml_encoding) != 'UTF-8') {
+							$this->setError($err);
+							return;
+						}
+						// when HTTP says ISO-8859-1 (the default) and XML says UTF-8 (the typical), assume the other endpoint is just sloppy and proceed
+					} else {
+						$this->debug('Charset from HTTP Content-Type matches encoding from XML declaration');
+					}
+				} else {
+					$this->debug('No encoding specified in XML declaration');
+				}
+			} else {
+				$this->debug('No XML declaration');
+			}
+			$this->debug('Entering soap_parser(), length='.strlen($xml).', encoding='.$encoding);
+			// Create an XML parser - why not xml_parser_create_ns?
+			$this->parser = xml_parser_create($this->xml_encoding);
+			// Set the options for parsing the XML data.
+			//xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
+			xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
+			xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->xml_encoding);
+			// Set the object for the parser.
+			xml_set_object($this->parser, $this);
+			// Set the element handlers for the parser.
+			xml_set_element_handler($this->parser, 'start_element','end_element');
+			xml_set_character_data_handler($this->parser,'character_data');
+
+			// Parse the XML file.
+			if(!xml_parse($this->parser,$xml,true)){
+			    // Display an error message.
+			    $err = sprintf('XML error parsing SOAP payload on line %d: %s',
+			    xml_get_current_line_number($this->parser),
+			    xml_error_string(xml_get_error_code($this->parser)));
+				$this->debug($err);
+				$this->debug("XML payload:\n" . $xml);
+				$this->setError($err);
+			} else {
+				$this->debug('parsed successfully, found root struct: '.$this->root_struct.' of name '.$this->root_struct_name);
+				// get final value
+				$this->soapresponse = $this->message[$this->root_struct]['result'];
+				// get header value: no, because this is documented as XML string
+//				if($this->root_header != '' && isset($this->message[$this->root_header]['result'])){
+//					$this->responseHeaders = $this->message[$this->root_header]['result'];
+//				}
+				// resolve hrefs/ids
+				if(sizeof($this->multirefs) > 0){
+					foreach($this->multirefs as $id => $hrefs){
+						$this->debug('resolving multirefs for id: '.$id);
+						$idVal = $this->buildVal($this->ids[$id]);
+						if (is_array($idVal) && isset($idVal['!id'])) {
+							unset($idVal['!id']);
+						}
+						foreach($hrefs as $refPos => $ref){
+							$this->debug('resolving href at pos '.$refPos);
+							$this->multirefs[$id][$refPos] = $idVal;
+						}
+					}
+				}
+			}
+			xml_parser_free($this->parser);
+		} else {
+			$this->debug('xml was empty, didn\'t parse!');
+			$this->setError('xml was empty, didn\'t parse!');
+		}
+	}
+
+	/**
+	* start-element handler
+	*
+	* @param    resource $parser XML parser object
+	* @param    string $name element name
+	* @param    array $attrs associative array of attributes
+	* @access   private
+	*/
+	function start_element($parser, $name, $attrs) {
+		// position in a total number of elements, starting from 0
+		// update class level pos
+		$pos = $this->position++;
+		// and set mine
+		$this->message[$pos] = array('pos' => $pos,'children'=>'','cdata'=>'');
+		// depth = how many levels removed from root?
+		// set mine as current global depth and increment global depth value
+		$this->message[$pos]['depth'] = $this->depth++;
+
+		// else add self as child to whoever the current parent is
+		if($pos != 0){
+			$this->message[$this->parent]['children'] .= '|'.$pos;
+		}
+		// set my parent
+		$this->message[$pos]['parent'] = $this->parent;
+		// set self as current parent
+		$this->parent = $pos;
+		// set self as current value for this depth
+		$this->depth_array[$this->depth] = $pos;
+		// get element prefix
+		if(strpos($name,':')){
+			// get ns prefix
+			$prefix = substr($name,0,strpos($name,':'));
+			// get unqualified name
+			$name = substr(strstr($name,':'),1);
+		}
+		// set status
+		if($name == 'Envelope'){
+			$this->status = 'envelope';
+		} elseif($name == 'Header'){
+			$this->root_header = $pos;
+			$this->status = 'header';
+		} elseif($name == 'Body'){
+			$this->status = 'body';
+			$this->body_position = $pos;
+		// set method
+		} elseif($this->status == 'body' && $pos == ($this->body_position+1)){
+			$this->status = 'method';
+			$this->root_struct_name = $name;
+			$this->root_struct = $pos;
+			$this->message[$pos]['type'] = 'struct';
+			$this->debug("found root struct $this->root_struct_name, pos $this->root_struct");
+		}
+		// set my status
+		$this->message[$pos]['status'] = $this->status;
+		// set name
+		$this->message[$pos]['name'] = htmlspecialchars($name);
+		// set attrs
+		$this->message[$pos]['attrs'] = $attrs;
+
+		// loop through atts, logging ns and type declarations
+        $attstr = '';
+		foreach($attrs as $key => $value){
+        	$key_prefix = $this->getPrefix($key);
+			$key_localpart = $this->getLocalPart($key);
+			// if ns declarations, add to class level array of valid namespaces
+            if($key_prefix == 'xmlns'){
+				if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
+					$this->XMLSchemaVersion = $value;
+					$this->namespaces['xsd'] = $this->XMLSchemaVersion;
+					$this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
+				}
+                $this->namespaces[$key_localpart] = $value;
+				// set method namespace
+				if($name == $this->root_struct_name){
+					$this->methodNamespace = $value;
+				}
+			// if it's a type declaration, set type
+            } elseif($key_localpart == 'type'){
+            	$value_prefix = $this->getPrefix($value);
+                $value_localpart = $this->getLocalPart($value);
+				$this->message[$pos]['type'] = $value_localpart;
+				$this->message[$pos]['typePrefix'] = $value_prefix;
+                if(isset($this->namespaces[$value_prefix])){
+                	$this->message[$pos]['type_namespace'] = $this->namespaces[$value_prefix];
+                } else if(isset($attrs['xmlns:'.$value_prefix])) {
+					$this->message[$pos]['type_namespace'] = $attrs['xmlns:'.$value_prefix];
+                }
+				// should do something here with the namespace of specified type?
+			} elseif($key_localpart == 'arrayType'){
+				$this->message[$pos]['type'] = 'array';
+				/* do arrayType ereg here
+				[1]    arrayTypeValue    ::=    atype asize
+				[2]    atype    ::=    QName rank*
+				[3]    rank    ::=    '[' (',')* ']'
+				[4]    asize    ::=    '[' length~ ']'
+				[5]    length    ::=    nextDimension* Digit+
+				[6]    nextDimension    ::=    Digit+ ','
+				*/
+				$expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
+				if(ereg($expr,$value,$regs)){
+					$this->message[$pos]['typePrefix'] = $regs[1];
+					$this->message[$pos]['arrayTypePrefix'] = $regs[1];
+	                if (isset($this->namespaces[$regs[1]])) {
+	                	$this->message[$pos]['arrayTypeNamespace'] = $this->namespaces[$regs[1]];
+	                } else if (isset($attrs['xmlns:'.$regs[1]])) {
+						$this->message[$pos]['arrayTypeNamespace'] = $attrs['xmlns:'.$regs[1]];
+	                }
+					$this->message[$pos]['arrayType'] = $regs[2];
+					$this->message[$pos]['arraySize'] = $regs[3];
+					$this->message[$pos]['arrayCols'] = $regs[4];
+				}
+			// specifies nil value (or not)
+			} elseif ($key_localpart == 'nil'){
+				$this->message[$pos]['nil'] = ($value == 'true' || $value == '1');
+			// some other attribute
+			} elseif ($key != 'href' && $key != 'xmlns' && $key_localpart != 'encodingStyle' && $key_localpart != 'root') {
+				$this->message[$pos]['xattrs']['!' . $key] = $value;
+			}
+
+			if ($key == 'xmlns') {
+				$this->default_namespace = $value;
+			}
+			// log id
+			if($key == 'id'){
+				$this->ids[$value] = $pos;
+			}
+			// root
+			if($key_localpart == 'root' && $value == 1){
+				$this->status = 'method';
+				$this->root_struct_name = $name;
+				$this->root_struct = $pos;
+				$this->debug("found root struct $this->root_struct_name, pos $pos");
+			}
+            // for doclit
+            $attstr .= " $key=\"$value\"";
+		}
+        // get namespace - must be done after namespace atts are processed
+		if(isset($prefix)){
+			$this->message[$pos]['namespace'] = $this->namespaces[$prefix];
+			$this->default_namespace = $this->namespaces[$prefix];
+		} else {
+			$this->message[$pos]['namespace'] = $this->default_namespace;
+		}
+        if($this->status == 'header'){
+        	if ($this->root_header != $pos) {
+	        	$this->responseHeaders .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>";
+	        }
+        } elseif($this->root_struct_name != ''){
+        	$this->document .= "<" . (isset($prefix) ? $prefix . ':' : '') . "$name$attstr>";
+        }
+	}
+
+	/**
+	* end-element handler
+	*
+	* @param    resource $parser XML parser object
+	* @param    string $name element name
+	* @access   private
+	*/
+	function end_element($parser, $name) {
+		// position of current element is equal to the last value left in depth_array for my depth
+		$pos = $this->depth_array[$this->depth--];
+
+        // get element prefix
+		if(strpos($name,':')){
+			// get ns prefix
+			$prefix = substr($name,0,strpos($name,':'));
+			// get unqualified name
+			$name = substr(strstr($name,':'),1);
+		}
+		
+		// build to native type
+		if(isset($this->body_position) && $pos > $this->body_position){
+			// deal w/ multirefs
+			if(isset($this->message[$pos]['attrs']['href'])){
+				// get id
+				$id = substr($this->message[$pos]['attrs']['href'],1);
+				// add placeholder to href array
+				$this->multirefs[$id][$pos] = 'placeholder';
+				// add set a reference to it as the result value
+				$this->message[$pos]['result'] =& $this->multirefs[$id][$pos];
+            // build complexType values
+			} elseif($this->message[$pos]['children'] != ''){
+				// if result has already been generated (struct/array)
+				if(!isset($this->message[$pos]['result'])){
+					$this->message[$pos]['result'] = $this->buildVal($pos);
+				}
+			// build complexType values of attributes and possibly simpleContent
+			} elseif (isset($this->message[$pos]['xattrs'])) {
+				if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) {
+					$this->message[$pos]['xattrs']['!'] = null;
+				} elseif (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') {
+	            	if (isset($this->message[$pos]['type'])) {
+						$this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
+					} else {
+						$parent = $this->message[$pos]['parent'];
+						if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
+							$this->message[$pos]['xattrs']['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
+						} else {
+							$this->message[$pos]['xattrs']['!'] = $this->message[$pos]['cdata'];
+						}
+					}
+				}
+				$this->message[$pos]['result'] = $this->message[$pos]['xattrs'];
+			// set value of simpleType (or nil complexType)
+			} else {
+            	//$this->debug('adding data for scalar value '.$this->message[$pos]['name'].' of value '.$this->message[$pos]['cdata']);
+				if (isset($this->message[$pos]['nil']) && $this->message[$pos]['nil']) {
+					$this->message[$pos]['xattrs']['!'] = null;
+				} elseif (isset($this->message[$pos]['type'])) {
+					$this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
+				} else {
+					$parent = $this->message[$pos]['parent'];
+					if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
+						$this->message[$pos]['result'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
+					} else {
+						$this->message[$pos]['result'] = $this->message[$pos]['cdata'];
+					}
+				}
+
+				/* add value to parent's result, if parent is struct/array
+				$parent = $this->message[$pos]['parent'];
+				if($this->message[$parent]['type'] != 'map'){
+					if(strtolower($this->message[$parent]['type']) == 'array'){
+						$this->message[$parent]['result'][] = $this->message[$pos]['result'];
+					} else {
+						$this->message[$parent]['result'][$this->message[$pos]['name']] = $this->message[$pos]['result'];
+					}
+				}
+				*/
+			}
+		}
+		
+        // for doclit
+        if($this->status == 'header'){
+        	if ($this->root_header != $pos) {
+	        	$this->responseHeaders .= "</" . (isset($prefix) ? $prefix . ':' : '') . "$name>";
+	        }
+        } elseif($pos >= $this->root_struct){
+        	$this->document .= "</" . (isset($prefix) ? $prefix . ':' : '') . "$name>";
+        }
+		// switch status
+		if($pos == $this->root_struct){
+			$this->status = 'body';
+			$this->root_struct_namespace = $this->message[$pos]['namespace'];
+		} elseif($name == 'Body'){
+			$this->status = 'envelope';
+		 } elseif($name == 'Header'){
+			$this->status = 'envelope';
+		} elseif($name == 'Envelope'){
+			//
+		}
+		// set parent back to my parent
+		$this->parent = $this->message[$pos]['parent'];
+	}
+
+	/**
+	* element content handler
+	*
+	* @param    resource $parser XML parser object
+	* @param    string $data element content
+	* @access   private
+	*/
+	function character_data($parser, $data){
+		$pos = $this->depth_array[$this->depth];
+		if ($this->xml_encoding=='UTF-8'){
+			// TODO: add an option to disable this for folks who want
+			// raw UTF-8 that, e.g., might not map to iso-8859-1
+			// TODO: this can also be handled with xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, "ISO-8859-1");
+			if($this->decode_utf8){
+				$data = utf8_decode($data);
+			}
+		}
+        $this->message[$pos]['cdata'] .= $data;
+        // for doclit
+        if($this->status == 'header'){
+        	$this->responseHeaders .= $data;
+        } else {
+        	$this->document .= $data;
+        }
+	}
+
+	/**
+	* get the parsed message
+	*
+	* @return	mixed
+	* @access   public
+	*/
+	function get_response(){
+		return $this->soapresponse;
+	}
+
+	/**
+	* get the parsed headers
+	*
+	* @return	string XML or empty if no headers
+	* @access   public
+	*/
+	function getHeaders(){
+	    return $this->responseHeaders;
+	}
+
+	/**
+	* decodes simple types into PHP variables
+	*
+	* @param    string $value value to decode
+	* @param    string $type XML type to decode
+	* @param    string $typens XML type namespace to decode
+	* @return	mixed PHP value
+	* @access   private
+	*/
+	function decodeSimple($value, $type, $typens) {
+		// TODO: use the namespace!
+		if ((!isset($type)) || $type == 'string' || $type == 'long' || $type == 'unsignedLong') {
+			return (string) $value;
+		}
+		if ($type == 'int' || $type == 'integer' || $type == 'short' || $type == 'byte') {
+			return (int) $value;
+		}
+		if ($type == 'float' || $type == 'double' || $type == 'decimal') {
+			return (double) $value;
+		}
+		if ($type == 'boolean') {
+			if (strtolower($value) == 'false' || strtolower($value) == 'f') {
+				return false;
+			}
+			return (boolean) $value;
+		}
+		if ($type == 'base64' || $type == 'base64Binary') {
+			$this->debug('Decode base64 value');
+			return base64_decode($value);
+		}
+		// obscure numeric types
+		if ($type == 'nonPositiveInteger' || $type == 'negativeInteger'
+			|| $type == 'nonNegativeInteger' || $type == 'positiveInteger'
+			|| $type == 'unsignedInt'
+			|| $type == 'unsignedShort' || $type == 'unsignedByte') {
+			return (int) $value;
+		}
+		// bogus: parser treats array with no elements as a simple type
+		if ($type == 'array') {
+			return array();
+		}
+		// everything else
+		return (string) $value;
+	}
+
+	/**
+	* builds response structures for compound values (arrays/structs)
+	* and scalars
+	*
+	* @param    integer $pos position in node tree
+	* @return	mixed	PHP value
+	* @access   private
+	*/
+	function buildVal($pos){
+		if(!isset($this->message[$pos]['type'])){
+			$this->message[$pos]['type'] = '';
+		}
+		$this->debug('in buildVal() for '.$this->message[$pos]['name']."(pos $pos) of type ".$this->message[$pos]['type']);
+		// if there are children...
+		if($this->message[$pos]['children'] != ''){
+			$this->debug('in buildVal, there are children');
+			$children = explode('|',$this->message[$pos]['children']);
+			array_shift($children); // knock off empty
+			// md array
+			if(isset($this->message[$pos]['arrayCols']) && $this->message[$pos]['arrayCols'] != ''){
+            	$r=0; // rowcount
+            	$c=0; // colcount
+            	foreach($children as $child_pos){
+					$this->debug("in buildVal, got an MD array element: $r, $c");
+					$params[$r][] = $this->message[$child_pos]['result'];
+				    $c++;
+				    if($c == $this->message[$pos]['arrayCols']){
+				    	$c = 0;
+						$r++;
+				    }
+                }
+            // array
+			} elseif($this->message[$pos]['type'] == 'array' || $this->message[$pos]['type'] == 'Array'){
+                $this->debug('in buildVal, adding array '.$this->message[$pos]['name']);
+                foreach($children as $child_pos){
+                	$params[] = &$this->message[$child_pos]['result'];
+                }
+            // apache Map type: java hashtable
+            } elseif($this->message[$pos]['type'] == 'Map' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap'){
+                $this->debug('in buildVal, Java Map '.$this->message[$pos]['name']);
+                foreach($children as $child_pos){
+                	$kv = explode("|",$this->message[$child_pos]['children']);
+                   	$params[$this->message[$kv[1]]['result']] = &$this->message[$kv[2]]['result'];
+                }
+            // generic compound type
+            //} elseif($this->message[$pos]['type'] == 'SOAPStruct' || $this->message[$pos]['type'] == 'struct') {
+		    } else {
+	    		// Apache Vector type: treat as an array
+                $this->debug('in buildVal, adding Java Vector '.$this->message[$pos]['name']);
+				if ($this->message[$pos]['type'] == 'Vector' && $this->message[$pos]['type_namespace'] == 'http://xml.apache.org/xml-soap') {
+					$notstruct = 1;
+				} else {
+					$notstruct = 0;
+	            }
+            	//
+            	foreach($children as $child_pos){
+            		if($notstruct){
+            			$params[] = &$this->message[$child_pos]['result'];
+            		} else {
+            			if (isset($params[$this->message[$child_pos]['name']])) {
+            				// de-serialize repeated element name into an array
+            				if ((!is_array($params[$this->message[$child_pos]['name']])) || (!isset($params[$this->message[$child_pos]['name']][0]))) {
+            					$params[$this->message[$child_pos]['name']] = array($params[$this->message[$child_pos]['name']]);
+            				}
+            				$params[$this->message[$child_pos]['name']][] = &$this->message[$child_pos]['result'];
+            			} else {
+					    	$params[$this->message[$child_pos]['name']] = &$this->message[$child_pos]['result'];
+					    }
+                	}
+                }
+			}
+			if (isset($this->message[$pos]['xattrs'])) {
+                $this->debug('in buildVal, handling attributes');
+				foreach ($this->message[$pos]['xattrs'] as $n => $v) {
+					$params[$n] = $v;
+				}
+			}
+			// handle simpleContent
+			if (isset($this->message[$pos]['cdata']) && trim($this->message[$pos]['cdata']) != '') {
+                $this->debug('in buildVal, handling simpleContent');
+            	if (isset($this->message[$pos]['type'])) {
+					$params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
+				} else {
+					$parent = $this->message[$pos]['parent'];
+					if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
+						$params['!'] = $this->decodeSimple($this->message[$pos]['cdata'], $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
+					} else {
+						$params['!'] = $this->message[$pos]['cdata'];
+					}
+				}
+			}
+			return is_array($params) ? $params : array();
+		} else {
+        	$this->debug('in buildVal, no children, building scalar');
+			$cdata = isset($this->message[$pos]['cdata']) ? $this->message[$pos]['cdata'] : '';
+        	if (isset($this->message[$pos]['type'])) {
+				return $this->decodeSimple($cdata, $this->message[$pos]['type'], isset($this->message[$pos]['type_namespace']) ? $this->message[$pos]['type_namespace'] : '');
+			}
+			$parent = $this->message[$pos]['parent'];
+			if (isset($this->message[$parent]['type']) && ($this->message[$parent]['type'] == 'array') && isset($this->message[$parent]['arrayType'])) {
+				return $this->decodeSimple($cdata, $this->message[$parent]['arrayType'], isset($this->message[$parent]['arrayTypeNamespace']) ? $this->message[$parent]['arrayTypeNamespace'] : '');
+			}
+           	return $this->message[$pos]['cdata'];
+		}
+	}
+}
+
+
+
+?><?php
+
+
+
+/**
+*
+* soapclient higher level class for easy usage.
+*
+* usage:
+*
+* // instantiate client with server info
+* $soapclient = new soapclient( string path [ ,boolean wsdl] );
+*
+* // call method, get results
+* echo $soapclient->call( string methodname [ ,array parameters] );
+*
+* // bye bye client
+* unset($soapclient);
+*
+* @author   Dietrich Ayala <dietrich at ganx4.com>
+* @version  $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
+* @access   public
+*/
+class soapclient extends nusoap_base  {
+
+	var $username = '';
+	var $password = '';
+	var $authtype = '';
+	var $certRequest = array();
+	var $requestHeaders = false;	// SOAP headers in request (text)
+	var $responseHeaders = '';		// SOAP headers from response (incomplete namespace resolution) (text)
+	var $document = '';				// SOAP body response portion (incomplete namespace resolution) (text)
+	var $endpoint;
+	var $forceEndpoint = '';		// overrides WSDL endpoint
+    var $proxyhost = '';
+    var $proxyport = '';
+	var $proxyusername = '';
+	var $proxypassword = '';
+    var $xml_encoding = '';			// character set encoding of incoming (response) messages
+	var $http_encoding = false;
+	var $timeout = 0;				// HTTP connection timeout
+	var $response_timeout = 30;		// HTTP response timeout
+	var $endpointType = '';			// soap|wsdl, empty for WSDL initialization error
+	var $persistentConnection = false;
+	var $defaultRpcParams = false;	// This is no longer used
+	var $request = '';				// HTTP request
+	var $response = '';				// HTTP response
+	var $responseData = '';			// SOAP payload of response
+	var $cookies = array();			// Cookies from response or for request
+    var $decode_utf8 = true;		// toggles whether the parser decodes element content w/ utf8_decode()
+	var $operations = array();		// WSDL operations, empty for WSDL initialization error
+	
+	/*
+	 * fault related variables
+	 */
+	/**
+	 * @var      fault
+	 * @access   public
+	 */
+	var $fault;
+	/**
+	 * @var      faultcode
+	 * @access   public
+	 */
+	var $faultcode;
+	/**
+	 * @var      faultstring
+	 * @access   public
+	 */
+	var $faultstring;
+	/**
+	 * @var      faultdetail
+	 * @access   public
+	 */
+	var $faultdetail;
+
+	/**
+	* constructor
+	*
+	* @param    mixed $endpoint SOAP server or WSDL URL (string), or wsdl instance (object)
+	* @param    bool $wsdl optional, set to true if using WSDL
+	* @param	int $portName optional portName in WSDL document
+	* @param    string $proxyhost
+	* @param    string $proxyport
+	* @param	string $proxyusername
+	* @param	string $proxypassword
+	* @param	integer $timeout set the connection timeout
+	* @param	integer $response_timeout set the response timeout
+	* @access   public
+	*/
+	function soapclient($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30){
+		parent::nusoap_base();
+		$this->endpoint = $endpoint;
+		$this->proxyhost = $proxyhost;
+		$this->proxyport = $proxyport;
+		$this->proxyusername = $proxyusername;
+		$this->proxypassword = $proxypassword;
+		$this->timeout = $timeout;
+		$this->response_timeout = $response_timeout;
+
+		// make values
+		if($wsdl){
+			if (is_object($endpoint) && (get_class($endpoint) == 'wsdl')) {
+				$this->wsdl = $endpoint;
+				$this->endpoint = $this->wsdl->wsdl;
+				$this->wsdlFile = $this->endpoint;
+				$this->debug('existing wsdl instance created from ' . $this->endpoint);
+			} else {
+				$this->wsdlFile = $this->endpoint;
+				
+				// instantiate wsdl object and parse wsdl file
+				$this->debug('instantiating wsdl class with doc: '.$endpoint);
+				$this->wsdl =& new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout);
+			}
+			$this->appendDebug($this->wsdl->getDebug());
+			$this->wsdl->clearDebug();
+			// catch errors
+			if($errstr = $this->wsdl->getError()){
+				$this->debug('got wsdl error: '.$errstr);
+				$this->setError('wsdl error: '.$errstr);
+			} elseif($this->operations = $this->wsdl->getOperations()){
+				$this->debug( 'got '.count($this->operations).' operations from wsdl '.$this->wsdlFile);
+				$this->endpointType = 'wsdl';
+			} else {
+				$this->debug( 'getOperations returned false');
+				$this->setError('no operations defined in the WSDL document!');
+			}
+		} else {
+			$this->debug("instantiate SOAP with endpoint at $endpoint");
+			$this->endpointType = 'soap';
+		}
+	}
+
+	/**
+	* calls method, returns PHP native type
+	*
+	* @param    string $method SOAP server URL or path
+	* @param    mixed $params An array, associative or simple, of the parameters
+	*			              for the method call, or a string that is the XML
+	*			              for the call.  For rpc style, this call will
+	*			              wrap the XML in a tag named after the method, as
+	*			              well as the SOAP Envelope and Body.  For document
+	*			              style, this will only wrap with the Envelope and Body.
+	*			              IMPORTANT: when using an array with document style,
+	*			              in which case there
+	*                         is really one parameter, the root of the fragment
+	*                         used in the call, which encloses what programmers
+	*                         normally think of parameters.  A parameter array
+	*                         *must* include the wrapper.
+	* @param	string $namespace optional method namespace (WSDL can override)
+	* @param	string $soapAction optional SOAPAction value (WSDL can override)
+	* @param	mixed $headers optional string of XML with SOAP header content, or array of soapval objects for SOAP headers
+	* @param	boolean $rpcParams optional (no longer used)
+	* @param	string	$style optional (rpc|document) the style to use when serializing parameters (WSDL can override)
+	* @param	string	$use optional (encoded|literal) the use when serializing parameters (WSDL can override)
+	* @return	mixed	response from SOAP call
+	* @access   public
+	*/
+	function call($operation,$params=array(),$namespace='http://tempuri.org',$soapAction='',$headers=false,$rpcParams=null,$style='rpc',$use='encoded'){
+		$this->operation = $operation;
+		$this->fault = false;
+		$this->setError('');
+		$this->request = '';
+		$this->response = '';
+		$this->responseData = '';
+		$this->faultstring = '';
+		$this->faultcode = '';
+		$this->opData = array();
+		
+		$this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType");
+		$this->appendDebug('params=' . $this->varDump($params));
+		$this->appendDebug('headers=' . $this->varDump($headers));
+		if ($headers) {
+			$this->requestHeaders = $headers;
+		}
+		// serialize parameters
+		if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){
+			// use WSDL for operation
+			$this->opData = $opData;
+			$this->debug("found operation");
+			$this->appendDebug('opData=' . $this->varDump($opData));
+			if (isset($opData['soapAction'])) {
+				$soapAction = $opData['soapAction'];
+			}
+			if (! $this->forceEndpoint) {
+				$this->endpoint = $opData['endpoint'];
+			} else {
+				$this->endpoint = $this->forceEndpoint;
+			}
+			$namespace = isset($opData['input']['namespace']) ? $opData['input']['namespace'] :	$namespace;
+			$style = $opData['style'];
+			$use = $opData['input']['use'];
+			// add ns to ns array
+			if($namespace != '' && !isset($this->wsdl->namespaces[$namespace])){
+				$nsPrefix = 'ns' . rand(1000, 9999);
+				$this->wsdl->namespaces[$nsPrefix] = $namespace;
+			}
+            $nsPrefix = $this->wsdl->getPrefixFromNamespace($namespace);
+			// serialize payload
+			if (is_string($params)) {
+				$this->debug("serializing param string for WSDL operation $operation");
+				$payload = $params;
+			} elseif (is_array($params)) {
+				$this->debug("serializing param array for WSDL operation $operation");
+				$payload = $this->wsdl->serializeRPCParameters($operation,'input',$params);
+			} else {
+				$this->debug('params must be array or string');
+				$this->setError('params must be array or string');
+				return false;
+			}
+            $usedNamespaces = $this->wsdl->usedNamespaces;
+			if (isset($opData['input']['encodingStyle'])) {
+				$encodingStyle = $opData['input']['encodingStyle'];
+			} else {
+				$encodingStyle = '';
+			}
+			$this->appendDebug($this->wsdl->getDebug());
+			$this->wsdl->clearDebug();
+			if ($errstr = $this->wsdl->getError()) {
+				$this->debug('got wsdl error: '.$errstr);
+				$this->setError('wsdl error: '.$errstr);
+				return false;
+			}
+		} elseif($this->endpointType == 'wsdl') {
+			// operation not in WSDL
+			$this->appendDebug($this->wsdl->getDebug());
+			$this->wsdl->clearDebug();
+			$this->setError( 'operation '.$operation.' not present.');
+			$this->debug("operation '$operation' not present.");
+			return false;
+		} else {
+			// no WSDL
+			//$this->namespaces['ns1'] = $namespace;
+			$nsPrefix = 'ns' . rand(1000, 9999);
+			// serialize 
+			$payload = '';
+			if (is_string($params)) {
+				$this->debug("serializing param string for operation $operation");
+				$payload = $params;
+			} elseif (is_array($params)) {
+				$this->debug("serializing param array for operation $operation");
+				foreach($params as $k => $v){
+					$payload .= $this->serialize_val($v,$k,false,false,false,false,$use);
+				}
+			} else {
+				$this->debug('params must be array or string');
+				$this->setError('params must be array or string');
+				return false;
+			}
+			$usedNamespaces = array();
+			if ($use == 'encoded') {
+				$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
+			} else {
+				$encodingStyle = '';
+			}
+		}
+		// wrap RPC calls with method element
+		if ($style == 'rpc') {
+			if ($use == 'literal') {
+				$this->debug("wrapping RPC request with literal method element");
+				if ($namespace) {
+					$payload = "<$operation xmlns=\"$namespace\">" . $payload . "</$operation>";
+				} else {
+					$payload = "<$operation>" . $payload . "</$operation>";
+				}
+			} else {
+				$this->debug("wrapping RPC request with encoded method element");
+				if ($namespace) {
+					$payload = "<$nsPrefix:$operation xmlns:$nsPrefix=\"$namespace\">" .
+								$payload .
+								"</$nsPrefix:$operation>";
+				} else {
+					$payload = "<$operation>" .
+								$payload .
+								"</$operation>";
+				}
+			}
+		}
+		// serialize envelope
+		$soapmsg = $this->serializeEnvelope($payload,$this->requestHeaders,$usedNamespaces,$style,$use,$encodingStyle);
+		$this->debug("endpoint=$this->endpoint, soapAction=$soapAction, namespace=$namespace, style=$style, use=$use, encodingStyle=$encodingStyle");
+		$this->debug('SOAP message length=' . strlen($soapmsg) . ' contents (max 1000 bytes)=' . substr($soapmsg, 0, 1000));
+		// send
+		$return = $this->send($this->getHTTPBody($soapmsg),$soapAction,$this->timeout,$this->response_timeout);
+		if($errstr = $this->getError()){
+			$this->debug('Error: '.$errstr);
+			return false;
+		} else {
+			$this->return = $return;
+			$this->debug('sent message successfully and got a(n) '.gettype($return));
+           	$this->appendDebug('return=' . $this->varDump($return));
+			
+			// fault?
+			if(is_array($return) && isset($return['faultcode'])){
+				$this->debug('got fault');
+				$this->setError($return['faultcode'].': '.$return['faultstring']);
+				$this->fault = true;
+				foreach($return as $k => $v){
+					$this->$k = $v;
+					$this->debug("$k = $v<br>");
+				}
+				return $return;
+			} elseif ($style == 'document') {
+				// NOTE: if the response is defined to have multiple parts (i.e. unwrapped),
+				// we are only going to return the first part here...sorry about that
+				return $return;
+			} else {
+				// array of return values
+				if(is_array($return)){
+					// multiple 'out' parameters, which we return wrapped up
+					// in the array
+					if(sizeof($return) > 1){
+						return $return;
+					}
+					// single 'out' parameter (normally the return value)
+					$return = array_shift($return);
+					$this->debug('return shifted value: ');
+					$this->appendDebug($this->varDump($return));
+           			return $return;
+				// nothing returned (ie, echoVoid)
+				} else {
+					return "";
+				}
+			}
+		}
+	}
+
+	/**
+	* get available data pertaining to an operation
+	*
+	* @param    string $operation operation name
+	* @return	array array of data pertaining to the operation
+	* @access   public
+	*/
+	function getOperationData($operation){
+		if(isset($this->operations[$operation])){
+			return $this->operations[$operation];
+		}
+		$this->debug("No data for operation: $operation");
+	}
+
+    /**
+    * send the SOAP message
+    *
+    * Note: if the operation has multiple return values
+    * the return value of this method will be an array
+    * of those values.
+    *
+	* @param    string $msg a SOAPx4 soapmsg object
+	* @param    string $soapaction SOAPAction value
+	* @param    integer $timeout set connection timeout in seconds
+	* @param	integer $response_timeout set response timeout in seconds
+	* @return	mixed native PHP types.
+	* @access   private
+	*/
+	function send($msg, $soapaction = '', $timeout=0, $response_timeout=30) {
+		$this->checkCookies();
+		// detect transport
+		switch(true){
+			// http(s)
+			case ereg('^http',$this->endpoint):
+				$this->debug('transporting via HTTP');
+				if($this->persistentConnection == true && is_object($this->persistentConnection)){
+					$http =& $this->persistentConnection;
+				} else {
+					$http = new soap_transport_http($this->endpoint);
+					if ($this->persistentConnection) {
+						$http->usePersistentConnection();
+					}
+				}
+				$http->setContentType($this->getHTTPContentType(), $this->getHTTPContentTypeCharset());
+				$http->setSOAPAction($soapaction);
+				if($this->proxyhost && $this->proxyport){
+					$http->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword);
+				}
+                if($this->authtype != '') {
+					$http->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
+				}
+				if($this->http_encoding != ''){
+					$http->setEncoding($this->http_encoding);
+				}
+				$this->debug('sending message, length='.strlen($msg));
+				if(ereg('^http:',$this->endpoint)){
+				//if(strpos($this->endpoint,'http:')){
+					$this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies);
+				} elseif(ereg('^https',$this->endpoint)){
+				//} elseif(strpos($this->endpoint,'https:')){
+					//if(phpversion() == '4.3.0-dev'){
+						//$response = $http->send($msg,$timeout,$response_timeout);
+                   		//$this->request = $http->outgoing_payload;
+						//$this->response = $http->incoming_payload;
+					//} else
+					$this->responseData = $http->sendHTTPS($msg,$timeout,$response_timeout,$this->cookies);
+				} else {
+					$this->setError('no http/s in endpoint url');
+				}
+				$this->request = $http->outgoing_payload;
+				$this->response = $http->incoming_payload;
+				$this->appendDebug($http->getDebug());
+				$this->UpdateCookies($http->incoming_cookies);
+
+				// save transport object if using persistent connections
+				if ($this->persistentConnection) {
+					$http->clearDebug();
+					if (!is_object($this->persistentConnection)) {
+						$this->persistentConnection = $http;
+					}
+				}
+				
+				if($err = $http->getError()){
+					$this->setError('HTTP Error: '.$err);
+					return false;
+				} elseif($this->getError()){
+					return false;
+				} else {
+					$this->debug('got response, length='. strlen($this->responseData).' type='.$http->incoming_headers['content-type']);
+					return $this->parseResponse($http->incoming_headers, $this->responseData);
+				}
+			break;
+			default:
+				$this->setError('no transport found, or selected transport is not yet supported!');
+			return false;
+			break;
+		}
+	}
+
+	/**
+	* processes SOAP message returned from server
+	*
+	* @param	array	$headers	The HTTP headers
+	* @param	string	$data		unprocessed response data from server
+	* @return	mixed	value of the message, decoded into a PHP type
+	* @access   private
+	*/
+    function parseResponse($headers, $data) {
+		$this->debug('Entering parseResponse() for data of length ' . strlen($data) . ' and type ' . $headers['content-type']);
+		if (!strstr($headers['content-type'], 'text/xml')) {
+			$this->setError('Response not of type text/xml');
+			return false;
+		}
+		if (strpos($headers['content-type'], '=')) {
+			$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
+			$this->debug('Got response encoding: ' . $enc);
+			if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+				$this->xml_encoding = strtoupper($enc);
+			} else {
+				$this->xml_encoding = 'US-ASCII';
+			}
+		} else {
+			// should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
+			$this->xml_encoding = 'ISO-8859-1';
+		}
+		$this->debug('Use encoding: ' . $this->xml_encoding . ' when creating soap_parser');
+		$parser = new soap_parser($data,$this->xml_encoding,$this->operation,$this->decode_utf8);
+		// add parser debug data to our debug
+		$this->appendDebug($parser->getDebug());
+		// if parse errors
+		if($errstr = $parser->getError()){
+			$this->setError( $errstr);
+			// destroy the parser object
+			unset($parser);
+			return false;
+		} else {
+			// get SOAP headers
+			$this->responseHeaders = $parser->getHeaders();
+			// get decoded message
+			$return = $parser->get_response();
+            // add document for doclit support
+            $this->document = $parser->document;
+			// destroy the parser object
+			unset($parser);
+			// return decode message
+			return $return;
+		}
+	 }
+
+	/**
+	* sets the SOAP endpoint, which can override WSDL
+	*
+	* @param	$endpoint string The endpoint URL to use, or empty string or false to prevent override
+	* @access   public
+	*/
+	function setEndpoint($endpoint) {
+		$this->forceEndpoint = $endpoint;
+	}
+
+	/**
+	* set the SOAP headers
+	*
+	* @param	$headers mixed String of XML with SOAP header content, or array of soapval objects for SOAP headers
+	* @access   public
+	*/
+	function setHeaders($headers){
+		$this->requestHeaders = $headers;
+	}
+
+	/**
+	* get the SOAP response headers (namespace resolution incomplete)
+	*
+	* @return	string
+	* @access   public
+	*/
+	function getHeaders(){
+		return $this->responseHeaders;
+	}
+
+	/**
+	* set proxy info here
+	*
+	* @param    string $proxyhost
+	* @param    string $proxyport
+	* @param	string $proxyusername
+	* @param	string $proxypassword
+	* @access   public
+	*/
+	function setHTTPProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') {
+		$this->proxyhost = $proxyhost;
+		$this->proxyport = $proxyport;
+		$this->proxyusername = $proxyusername;
+		$this->proxypassword = $proxypassword;
+	}
+
+	/**
+	* if authenticating, set user credentials here
+	*
+	* @param    string $username
+	* @param    string $password
+	* @param	string $authtype (basic|digest|certificate)
+	* @param	array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs)
+	* @access   public
+	*/
+	function setCredentials($username, $password, $authtype = 'basic', $certRequest = array()) {
+		$this->username = $username;
+		$this->password = $password;
+		$this->authtype = $authtype;
+		$this->certRequest = $certRequest;
+	}
+	
+	/**
+	* use HTTP encoding
+	*
+	* @param    string $enc
+	* @access   public
+	*/
+	function setHTTPEncoding($enc='gzip, deflate'){
+		$this->http_encoding = $enc;
+	}
+	
+	/**
+	* use HTTP persistent connections if possible
+	*
+	* @access   public
+	*/
+	function useHTTPPersistentConnection(){
+		$this->persistentConnection = true;
+	}
+	
+	/**
+	* gets the default RPC parameter setting.
+	* If true, default is that call params are like RPC even for document style.
+	* Each call() can override this value.
+	*
+	* This is no longer used.
+	*
+	* @return boolean
+	* @access public
+	* @deprecated
+	*/
+	function getDefaultRpcParams() {
+		return $this->defaultRpcParams;
+	}
+
+	/**
+	* sets the default RPC parameter setting.
+	* If true, default is that call params are like RPC even for document style
+	* Each call() can override this value.
+	*
+	* This is no longer used.
+	*
+	* @param    boolean $rpcParams
+	* @access public
+	* @deprecated
+	*/
+	function setDefaultRpcParams($rpcParams) {
+		$this->defaultRpcParams = $rpcParams;
+	}
+	
+	/**
+	* dynamically creates an instance of a proxy class,
+	* allowing user to directly call methods from wsdl
+	*
+	* @return   object soap_proxy object
+	* @access   public
+	*/
+	function getProxy(){
+		$r = rand();
+		$evalStr = $this->_getProxyClassCode($r);
+		//$this->debug("proxy class: $evalStr";
+		// eval the class
+		eval($evalStr);
+		// instantiate proxy object
+		eval("\$proxy = new soap_proxy_$r('');");
+		// transfer current wsdl data to the proxy thereby avoiding parsing the wsdl twice
+		$proxy->endpointType = 'wsdl';
+		$proxy->wsdlFile = $this->wsdlFile;
+		$proxy->wsdl = $this->wsdl;
+		$proxy->operations = $this->operations;
+		$proxy->defaultRpcParams = $this->defaultRpcParams;
+		// transfer other state
+		$proxy->username = $this->username;
+		$proxy->password = $this->password;
+		$proxy->authtype = $this->authtype;
+		$proxy->proxyhost = $this->proxyhost;
+		$proxy->proxyport = $this->proxyport;
+		$proxy->proxyusername = $this->proxyusername;
+		$proxy->proxypassword = $this->proxypassword;
+		$proxy->timeout = $this->timeout;
+		$proxy->response_timeout = $this->response_timeout;
+		$proxy->http_encoding = $this->http_encoding;
+		$proxy->persistentConnection = $this->persistentConnection;
+		$proxy->requestHeaders = $this->requestHeaders;
+		$proxy->soap_defencoding = $this->soap_defencoding;
+		$proxy->endpoint = $this->endpoint;
+		$proxy->forceEndpoint = $this->forceEndpoint;
+		return $proxy;
+	}
+
+	/**
+	* dynamically creates proxy class code
+	*
+	* @return   string PHP/NuSOAP code for the proxy class
+	* @access   private
+	*/
+	function _getProxyClassCode($r) {
+		if ($this->endpointType != 'wsdl') {
+			$evalStr = 'A proxy can only be created for a WSDL client';
+			$this->setError($evalStr);
+			return $evalStr;
+		}
+		$evalStr = '';
+		foreach ($this->operations as $operation => $opData) {
+			if ($operation != '') {
+				// create param string and param comment string
+				if (sizeof($opData['input']['parts']) > 0) {
+					$paramStr = '';
+					$paramArrayStr = '';
+					$paramCommentStr = '';
+					foreach ($opData['input']['parts'] as $name => $type) {
+						$paramStr .= "\$$name, ";
+						$paramArrayStr .= "'$name' => \$$name, ";
+						$paramCommentStr .= "$type \$$name, ";
+					}
+					$paramStr = substr($paramStr, 0, strlen($paramStr)-2);
+					$paramArrayStr = substr($paramArrayStr, 0, strlen($paramArrayStr)-2);
+					$paramCommentStr = substr($paramCommentStr, 0, strlen($paramCommentStr)-2);
+				} else {
+					$paramStr = '';
+					$paramCommentStr = 'void';
+				}
+				$opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace'];
+				$evalStr .= "// $paramCommentStr
+	function " . str_replace('.', '__', $operation) . "($paramStr) {
+		\$params = array($paramArrayStr);
+		return \$this->call('$operation', \$params, '".$opData['namespace']."', '".(isset($opData['soapAction']) ? $opData['soapAction'] : '')."');
+	}
+	";
+				unset($paramStr);
+				unset($paramCommentStr);
+			}
+		}
+		$evalStr = 'class soap_proxy_'.$r.' extends soapclient {
+	'.$evalStr.'
+}';
+		return $evalStr;
+	}
+
+	/**
+	* dynamically creates proxy class code
+	*
+	* @return   string PHP/NuSOAP code for the proxy class
+	* @access   public
+	*/
+	function getProxyClassCode() {
+		$r = rand();
+		return $this->_getProxyClassCode($r);
+	}
+
+	/**
+	* gets the HTTP body for the current request.
+	*
+	* @param string $soapmsg The SOAP payload
+	* @return string The HTTP body, which includes the SOAP payload
+	* @access private
+	*/
+	function getHTTPBody($soapmsg) {
+		return $soapmsg;
+	}
+	
+	/**
+	* gets the HTTP content type for the current request.
+	*
+	* Note: getHTTPBody must be called before this.
+	*
+	* @return string the HTTP content type for the current request.
+	* @access private
+	*/
+	function getHTTPContentType() {
+		return 'text/xml';
+	}
+	
+	/**
+	* gets the HTTP content type charset for the current request.
+	* returns false for non-text content types.
+	*
+	* Note: getHTTPBody must be called before this.
+	*
+	* @return string the HTTP content type charset for the current request.
+	* @access private
+	*/
+	function getHTTPContentTypeCharset() {
+		return $this->soap_defencoding;
+	}
+
+	/*
+	* whether or not parser should decode utf8 element content
+    *
+    * @return   always returns true
+    * @access   public
+    */
+    function decodeUTF8($bool){
+		$this->decode_utf8 = $bool;
+		return true;
+    }
+
+	/**
+	 * adds a new Cookie into $this->cookies array
+	 *
+	 * @param	string $name Cookie Name
+	 * @param	string $value Cookie Value
+	 * @return	if cookie-set was successful returns true, else false
+	 * @access	public
+	 */
+	function setCookie($name, $value) {
+		if (strlen($name) == 0) {
+			return false;
+		}
+		$this->cookies[] = array('name' => $name, 'value' => $value);
+		return true;
+	}
+
+	/**
+	 * gets all Cookies
+	 *
+	 * @return   array with all internal cookies
+	 * @access   public
+	 */
+	function getCookies() {
+		return $this->cookies;
+	}
+
+	/**
+	 * checks all Cookies and delete those which are expired
+	 *
+	 * @return   always return true
+	 * @access   private
+	 */
+	function checkCookies() {
+		if (sizeof($this->cookies) == 0) {
+			return true;
+		}
+		$this->debug('checkCookie: check ' . sizeof($this->cookies) . ' cookies');
+		$curr_cookies = $this->cookies;
+		$this->cookies = array();
+		foreach ($curr_cookies as $cookie) {
+			if (! is_array($cookie)) {
+				$this->debug('Remove cookie that is not an array');
+				continue;
+			}
+			if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
+				if (strtotime($cookie['expires']) > time()) {
+					$this->cookies[] = $cookie;
+				} else {
+					$this->debug('Remove expired cookie ' . $cookie['name']);
+				}
+			} else {
+				$this->cookies[] = $cookie;
+			}
+		}
+		$this->debug('checkCookie: '.sizeof($this->cookies).' cookies left in array');
+		return true;
+	}
+
+	/**
+	 * updates the current cookies with a new set
+	 *
+	 * @param	array $cookies new cookies with which to update current ones
+	 * @return	always return true
+	 * @access	private
+	 */
+	function UpdateCookies($cookies) {
+		if (sizeof($this->cookies) == 0) {
+			// no existing cookies: take whatever is new
+			if (sizeof($cookies) > 0) {
+				$this->debug('Setting new cookie(s)');
+				$this->cookies = $cookies;
+			}
+			return true;
+		}
+		if (sizeof($cookies) == 0) {
+			// no new cookies: keep what we've got
+			return true;
+		}
+		// merge
+		foreach ($cookies as $newCookie) {
+			if (!is_array($newCookie)) {
+				continue;
+			}
+			if ((!isset($newCookie['name'])) || (!isset($newCookie['value']))) {
+				continue;
+			}
+			$newName = $newCookie['name'];
+
+			$found = false;
+			for ($i = 0; $i < count($this->cookies); $i++) {
+				$cookie = $this->cookies[$i];
+				if (!is_array($cookie)) {
+					continue;
+				}
+				if (!isset($cookie['name'])) {
+					continue;
+				}
+				if ($newName != $cookie['name']) {
+					continue;
+				}
+				$newDomain = isset($newCookie['domain']) ? $newCookie['domain'] : 'NODOMAIN';
+				$domain = isset($cookie['domain']) ? $cookie['domain'] : 'NODOMAIN';
+				if ($newDomain != $domain) {
+					continue;
+				}
+				$newPath = isset($newCookie['path']) ? $newCookie['path'] : 'NOPATH';
+				$path = isset($cookie['path']) ? $cookie['path'] : 'NOPATH';
+				if ($newPath != $path) {
+					continue;
+				}
+				$this->cookies[$i] = $newCookie;
+				$found = true;
+				$this->debug('Update cookie ' . $newName . '=' . $newCookie['value']);
+				break;
+			}
+			if (! $found) {
+				$this->debug('Add cookie ' . $newName . '=' . $newCookie['value']);
+				$this->cookies[] = $newCookie;
+			}
+		}
+		return true;
+	}
+}
+?>

Added: trunk/direct.openmoko.com/includes/redirect_login_to.php
===================================================================
--- trunk/direct.openmoko.com/includes/redirect_login_to.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/redirect_login_to.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,18 @@
+<?php
+/*
+  /includes/redirect_login_to.php
+
+  Shoppe Enhancement Controller - Copyright (c) 2003 WebMakers.com
+  Linda McGrath - osCommerce at WebMakers.com
+
+*/
+
+// WebMakers.com Added: Login redirect to last page
+  if (sizeof($navigation->snapshot) > 0) {
+    $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
+    $navigation->clear_snapshot();
+    $link = $origin_href;
+  } else {
+    $link = tep_href_link(FILENAME_DEFAULT);
+  }
+?>

Added: trunk/direct.openmoko.com/includes/search_in_header.php
===================================================================
--- trunk/direct.openmoko.com/includes/search_in_header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/search_in_header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  search_header.php
+
+
+
+*/
+?>
+<!-- search_header //-->
+        <table>
+          <tr>
+            <td align="center">
+<?php
+  $search_string = '';
+    $search_string .=   tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
+    $search_string .=   tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (100) . 'px"') . '&nbsp;'
+
+. tep_hide_session_id() . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH);
+    $search_string .= '</form>';
+echo $search_string;
+?>
+
+
+<?php
+/*
+  if (!is_object($lng)) {
+    include(DIR_WS_CLASSES . 'language.php');
+    $lng = new language;
+  }
+
+  if (getenv('HTTPS') == 'on') $connection = 'SSL';
+  else $connection = 'NONSSL';
+
+  $languages_string = '';
+  reset($lng->catalog_languages);
+  while (list($key, $value) = each($lng->catalog_languages)) {
+    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $connection) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
+  }
+
+echo $languages_string;
+*/
+?>
+            </td>
+          </tr>
+        </table>
+<!-- languages_header_eof //-->

Added: trunk/direct.openmoko.com/includes/spiders.txt
===================================================================
--- trunk/direct.openmoko.com/includes/spiders.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/spiders.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+$Id: spiders.txt,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+almaden.ibm.com
+appie 1.1
+architext
+ask jeeves
+asterias2.0
+augurfind
+baiduspider
+bannana_bot
+bdcindexer
+crawler
+crawler at fast
+docomo
+fast-webcrawler
+fluffy the spider
+frooglebot
+geobot
+googlebot
+poodle
+gulliver
+henrythemiragorobot
+ia_archiver
+infoseek
+kit_fireball
+lachesis
+lycos_spider
+mantraagent
+mercator
+moget/1.0
+muscatferret
+nationaldirectory-webspider
+naverrobot
+ncsa beta
+netresearchserver
+ng/1.0
+osis-project
+polybot
+pompos
+scooter
+seventwentyfour
+sidewinder
+sleek spider
+slurp/si
+slurp at inktomi.com
+steeler/1.3
+szukacz
+t-h-u-n-d-e-r-s-t-o-n-e
+teoma
+turnitinbot
+ultraseek
+vagabondo
+voilabot
+w3c_validator
+zao/0
+zyborg/1.0
+crawl
+slurp
+spider
+ebot
+obot
+abot
+dbot
+hbot
+nbot
+pbot
+rbot
+sbot
+ybot
+accoona
+appie
+architext
+aspseek
+asterias
+atlocal
+atomz
+augurfind
+bannana_bot
+booch
+docomo
+gazz
+goforit
+grub
+gulliver
+harvest
+holmes
+homer
+ia_archiver
+ichiro
+iconsurf
+iltrovatore
+indexer
+infoseek
+ivia
+java/
+jetbot
+kit_fireball
+knowledge
+lachesis
+larbin
+linkwalker
+lwp
+mantraagent
+mediapartners
+mercator
+mj12
+moget/
+msnbot
+multitext
+muscatferret
+myweb
+nameprotect
+ncsa beta
+netmechanic
+netresearchserver
+ng/
+npbot
+nutch
+objectssearch
+osis-project
+pear.
+pompos
+poppelsdorf
+rambler
+scooter
+scrubby
+seeker
+shopwiki
+sidewinder
+smartwit
+sohu
+spyder
+steeler/
+szukacz
+t-h-u-n-d-e-r-s-t-o-n-e
+/teoma
+tutorgig
+ultraseek
+vagabondo
+volcano
+voyager/
+w3c_validator
+webcheck
+websitepulse
+wget
+worldlight
+worm
+zao/
+xenu
+zippp
+zyborg

Added: trunk/direct.openmoko.com/includes/template_application_top.php
===================================================================
--- trunk/direct.openmoko.com/includes/template_application_top.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/template_application_top.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  $Id: template_application_top.php,v 1.1.1.1 2004/03/04 23:40:40 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+//Detect template Site template configuration
+
+//get customer selected template if there is a customer selected template
+  $customer_pref_template_query = tep_db_query("select  customers_selected_template as template_selected from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+  $cptemplate = tep_db_fetch_array($customer_pref_template_query);
+
+   if (tep_not_null($cptemplate['template_selected'])) {
+   //use customer selected template
+  define(TEMPLATE_NAME, $cptemplate['template_selected']);
+    }else if  (tep_not_null(DEFAULT_TEMPLATE)){
+    //use store default  
+  define(TEMPLATE_NAME, DEFAULT_TEMPLATE);  
+    } else {
+    //use default   
+    define(TEMPLATE_NAME, 'default');
+    }
+   
+    define(TEMPLATE_STYLE, DIR_WS_TEMPLATES . TEMPLATE_NAME . "/stylesheet.css");
+  
+    define(TEMPLATE_STYLE_ORIGINAL, DIR_WS_TEMPLATES . "/default/stylesheet.css");
+
+    //detect template version
+    if ( file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/template.php')) {
+  require(DIR_WS_INCLUDES . 'ATS_template_application_top.php');
+     } else {
+  require(DIR_WS_INCLUDES . 'CRE_template_application_top.php');    
+    }
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/includes/tld.txt
===================================================================
--- trunk/direct.openmoko.com/includes/tld.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/tld.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+# $Id: tld.txt,v 1.1.1.1 2004/03/04 23:40:40 ccwjr Exp $
+#
+# osCommerce, Open Source E-Commerce Solutions
+# http://www.oscommerce.com
+#
+# Copyright (c) 2003 osCommerce
+#
+# Released under the GNU General Public License
+#
+# Original 7 TLDs
+com     # all are eligible to register
+edu     # degree-granting educational institutions of higher education
+gov     # United States Government
+int     # organizations established by international treaties
+mil     # United States Military
+net     # all are eligible to register
+org     # noncommercial community, all are eligible to register
+
+# Recent additions
+aero    # members of the air-transport industry
+biz     # businesses
+coop    # cooperative associations
+info    # all are eligible to register
+museum  # museums
+name    # individuals
+pro     # credentialed professionals

Added: trunk/direct.openmoko.com/includes/version.php
===================================================================
--- trunk/direct.openmoko.com/includes/version.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/version.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,15 @@
+<?php
+/*
+  $Id: version.php,v 1.1.1.1 2004/10/44 23:40:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+// define the project version
+  define('PROJECT_VERSION', 'CRE Loaded v6.2');
+  define('PROJECT_PATCH', '08');
+?>

Added: trunk/direct.openmoko.com/includes/warnings.php
===================================================================
--- trunk/direct.openmoko.com/includes/warnings.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/includes/warnings.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+// give the visitors a message that the website will be down at ... time
+  if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'false') ) {
+       $messageStack->add('header', TEXT_BEFORE_DOWN_FOR_MAINTENANCE . PERIOD_BEFORE_DOWN_FOR_MAINTENANCE, 'warning');
+  }
+
+
+// this will let the admin know that the website is DOWN FOR MAINTENANCE to the public
+  if ( (DOWN_FOR_MAINTENANCE == 'true') && (EXCLUDE_ADMIN_IP_FOR_MAINTENANCE == getenv('REMOTE_ADDR')) ) {
+       $messageStack->add('header', TEXT_ADMIN_DOWN_FOR_MAINTENANCE, 'warning');
+  }
+
+
+  if ($messageStack->size('header') > 0) {
+    echo $messageStack->output('header');
+  }
+
+  if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr class="headerError">
+    <td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>
+  </tr>
+</table>
+<?php
+  }
+
+  if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr class="headerInfo">
+    <td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>
+  </tr>
+</table>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/index.php
===================================================================
--- trunk/direct.openmoko.com/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,311 @@
+<?php
+/*
+  $Id: index.php,v 1.2 2004/03/09 19:56:29 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// the following cPath references come from application_top.php
+  $category_depth = 'top';
+  if (isset($cPath) && tep_not_null($cPath)) {
+    $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
+    $cateqories_products = tep_db_fetch_array($categories_products_query);
+    if ($cateqories_products['total'] > 0) {
+      $category_depth = 'products'; // display products
+    } else {
+      $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
+      $category_parent = tep_db_fetch_array($category_parent_query);
+      if ($category_parent['total'] > 0) {
+        $category_depth = 'nested'; // navigate through the categories
+      } else {
+        $category_depth = 'products'; // category has no products, but display the 'no products' message
+      }
+    }
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
+
+  if ($category_depth == 'nested') {
+//Code change for Categories Description 1.5
+//    $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
+//Changed to the following
+    $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . $languages_id . "'");
+//End Categories Description 1.5
+
+    $category = tep_db_fetch_array($category_query);
+
+    $content = CONTENT_INDEX_NESTED;
+
+  } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
+// create column list
+    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
+                         'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
+                         'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
+                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
+                         'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
+                         'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
+                         'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
+                         'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
+
+    asort($define_list);
+
+    $column_list = array();
+    reset($define_list);
+    while (list($key, $value) = each($define_list)) {
+      if ($value > 0) $column_list[] = $key;
+    }
+// Eversun mod for sppc and qty price breaks
+   if(!tep_session_is_registered('sppc_customer_group_id')) {
+     $customer_group_id = '0';
+     } else {
+      $customer_group_id = $sppc_customer_group_id;
+   }
+   // this will build the table with specials prices for the retail group or update it if needed
+   // this function should have been added to includes/functions/database.php
+   if ($customer_group_id == '0') {
+     tep_db_check_age_specials_retail_table();
+   }
+   $status_product_prices_table = false;
+   $status_need_to_get_prices = false;
+
+   // find out if sorting by price has been requested
+   if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
+    $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+    if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
+      $status_need_to_get_prices = true;
+      }
+   }
+
+   if ($status_need_to_get_prices == true && $customer_group_id != '0') {
+     $product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;
+   // the table with product prices for a particular customer group is re-built only a number of times per hour
+   // (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)
+   // to trigger the update the next function is called (new function that should have been
+   // added to includes/functions/database.php)
+     tep_db_check_age_products_group_prices_cg_table($customer_group_id);
+     $status_product_prices_table = true;
+   } // end if ($status_need_to_get_prices == true && $customer_group_id != '0')
+// Eversun mod end for sppc and qty price breaks
+    $select_column_list = '';
+
+    for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+      switch ($column_list[$i]) {
+        case 'PRODUCT_LIST_MODEL':
+          $select_column_list .= 'p.products_model, ';
+          break;
+        case 'PRODUCT_LIST_NAME':
+          $select_column_list .= 'pd.products_name, ';
+          break;
+        case 'PRODUCT_LIST_MANUFACTURER':
+          $select_column_list .= 'm.manufacturers_name, ';
+          break;
+        case 'PRODUCT_LIST_QUANTITY':
+          $select_column_list .= 'p.products_quantity, ';
+          break;
+        case 'PRODUCT_LIST_IMAGE':
+          $select_column_list .= 'p.products_image, ';
+          break;
+        case 'PRODUCT_LIST_WEIGHT':
+          $select_column_list .= 'p.products_weight, ';
+          break;
+      }
+    }
+ // Get the category name and description
+    $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+
+// show the products of a specified manufacturer
+    if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+
+// We are asked to show only a specific category
+//Eversun mod for sppc and qty price breaks
+
+/*
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
+      } else {
+// We show them all
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+      }
+    } else {
+// show the products in a given categorie
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+// We are asked to show only specific catgeory
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
+      } else {
+// We show them all
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
+    */
+      
+    if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from " . TABLE_PRODUCTS . " p
+                      left join (" . $product_prices_table . " as tmp_pp using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
+    } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
+    } // end else { // either retail...
+    } else {
+// We show them all
+        if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m
+                      where p.products_status = '1'
+                        and pd.products_id = p.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+    } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m
+                      where p.products_status = '1'
+                        and pd.products_id = p.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+    } // end else { // either retail...
+    }
+  } else {
+// show the products in a given categorie
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+// We are asked to show only specific catgeory;
+        if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+        } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p 
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+        } // end else { // either retail...
+      } else {
+// We show them all
+        if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id))
+                      left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id,
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+        } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id))
+                      left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id,
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+    } // end else { // either retail...
+// Eversun mod for sppc and qty price breaks
+      }
+    }
+
+    if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    }
+    $listing_sql .= ' order by ';
+    switch ($sort_column) {
+      case 'PRODUCT_LIST_MODEL':
+        $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $listing_sql .= "pd.products_name";
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      }
+
+    $content = CONTENT_INDEX_PRODUCTS;
+
+  } else { // default page
+
+    $content = CONTENT_INDEX_DEFAULT;
+
+  }
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/info_shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/info_shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/info_shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+/*
+  $Id: info_shopping_cart.php,v 1.1.1.1 2004/03/04 23:37:59 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require("includes/application_top.php");
+
+  $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_INFO_SHOPPING_CART);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo TITLE; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<body>
+<p class="main"><b><?php echo HEADING_TITLE; ?></b><br><?php echo tep_draw_separator(); ?></p>
+<p class="main"><b><i><?php echo SUB_HEADING_TITLE_1; ?></i></b><br><?php echo SUB_HEADING_TEXT_1; ?></p>
+<p class="main"><b><i><?php echo SUB_HEADING_TITLE_2; ?></i></b><br><?php echo SUB_HEADING_TEXT_2; ?></p>
+<p class="main"><b><i><?php echo SUB_HEADING_TITLE_3; ?></i></b><br><?php echo SUB_HEADING_TEXT_3; ?></p>
+<p align="right" class="main"><a href="javascript:window.close();"><?php echo TEXT_CLOSE_WINDOW; ?></a></p>
+</body>
+</html>
+<?php
+  require("includes/counter.php");
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/information.php
===================================================================
--- trunk/direct.openmoko.com/information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+  /*
+  Module: Information Pages Unlimited
+        File date: 2003/03/03
+      Based on the FAQ script of adgrafics
+        Adjusted by Joeri Stegeman (joeri210 at yahoo.com), The Netherlands
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+  */
+
+  require('includes/application_top.php');
+
+  // Added for information pages
+ // if(!$HTTP_GET_VARS['info_id']) die("No page found.");
+  $info_id = $HTTP_GET_VARS['info_id'];
+
+  $sql=tep_db_query('SELECT * FROM '.TABLE_INFORMATION.' WHERE visible=\'1\' AND information_id=\''.(int)$info_id.'\'') or die(tep_db_error());
+  $row=tep_db_fetch_array($sql);
+  $INFO_TITLE = stripslashes($row['info_title']);
+  $INFO_DESCRIPTION = stripslashes($row['description']);
+
+  // Only replace cariage return by <BR> if NO HTML found in text
+  // Added as noticed by infopages module
+  if (!preg_match("/([\<])([^\>]{1,})*([\>])/i", $INFO_DESCRIPTION)) {
+    $INFO_DESCRIPTION = str_replace("\r\n", "<br>\r\n", $INFO_DESCRIPTION ); 
+  }
+
+  $breadcrumb->add($INFO_TITLE, tep_href_link(FILENAME_INFORMATION, 'info_id=' . $row['information_id'], 'NONSSL'));
+
+  $content = CONTENT_INFORMATION;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/ipn.php
===================================================================
--- trunk/direct.openmoko.com/ipn.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/ipn.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: ipn.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+/*
+  function debugWriteFile($str,$mode="a") {
+    $fp = @fopen("ipn.txt",$mode);  @flock($fp, LOCK_EX); @fwrite($fp,$str); @flock($fp, LOCK_UN); @fclose($fp);
+  }
+
+  $postString = ''; foreach($_POST as $key => $val) $postString .= $key.' = '.$val."\n";
+  if($postString != '') {
+    debugWriteFile($postString,"w+");
+  }
+*/
+
+  require_once('includes/modules/payment/paypal/application_top.inc.php');
+  require_once(DIR_WS_MODULES . 'payment/paypal/classes/IPN/IPN.class.php');
+  require_once(DIR_WS_MODULES . 'payment/paypal/classes/Debug/Debug.class.php');
+  require_once(DIR_WS_MODULES . 'payment/paypal/functions/general.func.php');
+
+  paypal_include_lng(DIR_WS_MODULES . 'payment/paypal/languages/', $language, 'ipn.lng.php');
+
+  $debug = new PayPal_Debug(MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL,MODULE_PAYMENT_PAYPAL_IPN_DEBUG);
+  $ipn = new PayPal_IPN($_POST);
+  $ipn->setTestMode(MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE);
+  unset($_POST);
+
+  //post back to PayPal system to validate
+  if(!$ipn->authenticate(MODULE_PAYMENT_PAYPAL_DOMAIN) && $ipn->testMode('Off')) $ipn->dienice('500');
+
+  //Check both the receiver_email and business ID fields match
+  if (!$ipn->validateReceiverEmail(MODULE_PAYMENT_PAYPAL_ID,MODULE_PAYMENT_PAYPAL_BUSINESS_ID)) $ipn->dienice('500');
+
+  if($ipn->uniqueTxnID() && $ipn->isReversal()) {
+
+    //parent_txn_id is the txn_id of the original transaction
+    $ipn_query = tep_db_query("select paypal_id from " . TABLE_PAYPAL . " where txn_id = '" . tep_db_input($ipn->key['parent_txn_id']) . "'");
+    if(tep_db_num_rows($ipn_query)) {
+      $ipn_query_result = tep_db_fetch_array($ipn_query);
+      $ipn->insert();
+      // update the order's status
+      switch ($ipn->reversalType()) {
+        case 'Canceled_Reversal':
+          $order_status = MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID;
+          break;
+        case 'Reversed':
+        case 'Refunded':
+          $order_status = MODULE_PAYMENT_PAYPAL_ORDER_CANCELED_STATUS_ID;
+          break;
+      }
+      $ipn->updateOrderStatus($ipn_query_result['paypal_id'],$order_status);
+    }
+
+  } elseif ($ipn->isCartPayment() && tep_not_null($PayPal_osC_Order->orderID)) {
+
+
+    //$currency = $PayPal_osC_Order->currency;
+
+    //actually not essential since 'orders_status_name' is not required
+    $languages_id = $PayPal_osC_Order->languageID;
+
+    include(DIR_WS_CLASSES . 'order.php');
+    $order = new order($PayPal_osC_Order->orderID);
+
+    //Check that txn_id has not been previously processed
+    if ($ipn->uniqueTxnID()) { //Payment is either Completed, Pending or Failed
+      $ipn->insert();
+
+      tep_db_query("update " . TABLE_ORDERS . " set payment_id = '" . (int)$ipn->ID() . "' where orders_id = '" . (int)$PayPal_osC_Order->orderID . "'");
+      tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$order->customer['id'] . "'");
+      tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$order->customer['id'] . "'");
+
+      switch ($ipn->paymentStatus()) {
+        case 'Completed':
+          if ($ipn->validPayment($PayPal_osC_Order->payment_amount,$PayPal_osC_Order->payment_currency)) {
+            include(DIR_WS_MODULES . 'payment/paypal/catalog/checkout_update.inc.php');
+          } else {
+            $ipn->updateOrderStatus($ipn->ID(),MODULE_PAYMENT_PAYPAL_ORDER_ONHOLD_STATUS_ID);
+          }
+          break;
+        case 'Failed':
+          $ipn->updateOrderStatus($ipn->ID(),MODULE_PAYMENT_PAYPAL_ORDER_CANCELED_STATUS_ID);
+          break;
+        case 'Pending':
+          //Assumed to do nothing since the order is initially in a Pending ORDER Status
+          break;
+      }//end switch
+
+    } else { // not a unique transaction => Pending Payment
+
+      $ipn_query = tep_db_query("select paypal_id, payment_status, pending_reason from " . TABLE_PAYPAL . " where txn_id = '" . tep_db_input($ipn->txnID()) . "' limit 0,1");
+      //Assumes there is only one previous IPN transaction
+      $ipn_query_result = tep_db_fetch_array($ipn_query);
+      if ($ipn_query_result['payment_status'] === 'Pending') {
+        $ipn->updateStatus($ipn_query_result['paypal_id'],$ipn_query_result['pending_reason']);
+        switch ($ipn->paymentStatus()) {
+          case 'Completed':
+           if ($ipn->validPayment($PayPal_osC_Order->payment_amount,$PayPal_osC_Order->payment_currency)) {
+            include(DIR_WS_MODULES . 'payment/paypal/catalog/checkout_update.inc.php');
+           } else {
+            $ipn->updateOrderStatus($ipn_query_result['paypal_id'],MODULE_PAYMENT_PAYPAL_ORDER_ONHOLD_STATUS_ID);
+           }
+           break;
+          case 'Denied':
+            $ipn->updateOrderStatus($ipn_query_result['paypal_id'],MODULE_PAYMENT_PAYPAL_ORDER_CANCELED_STATUS_ID);
+            break;
+        }//end switch
+      }//end if Pending Payment
+    }
+
+  } elseif ($ipn->isAuction()) {
+
+    if ($ipn->uniqueTxnID()) $ipn->insert();
+    if ($debug->enabled) $debug->add(PAYPAL_AUCTION,sprintf(PAYPAL_AUCTION_MSG));
+
+  } elseif ($ipn->txnType('send_money')) {
+
+    if ($ipn->uniqueTxnID()) $ipn->insert();
+    if ($debug->enabled) $debug->add(PAYMENT_SEND_MONEY_DESCRIPTION,sprintf(PAYMENT_SEND_MONEY_DESCRIPTION_MSG,number_format($ipn->key['mc_gross'],2),$ipn->key['mc_currency']));
+
+  } elseif ($debug->enabled && $ipn->testMode('On')) {
+    $debug->raiseError(TEST_INCOMPLETE,sprintf(TEST_INCOMPLETE_MSG),true);
+  }
+  if ($ipn->testMode('On') &&  $ipn->validDigest()) {
+    include(DIR_WS_MODULES . 'payment/paypal/classes/Page/Page.class.php');
+    $page = new PayPal_Page();
+    $page->setBaseDirectory(DIR_WS_MODULES . 'payment/paypal/');
+    $page->setBaseURL(DIR_WS_MODULES . 'payment/paypal/');
+    $page->includeLanguageFile('admin/languages','english','paypal.lng.php');
+    $page->setTitle(HEADING_ITP_RESULTS_TITLE);
+    $page->setContentFile(DIR_WS_MODULES . 'payment/paypal/admin/TestPanel/Results.inc.php');
+    $page->addCSS($page->baseURL . 'templates/css/general.css');
+    $page->addCSS($page->baseURL . 'templates/css/stylesheet.css');
+    $page->setTemplate('default');
+    include($page->template());
+  }
+  require(DIR_WS_MODULES . 'payment/paypal/application_bottom.inc.php');
+?>

Added: trunk/direct.openmoko.com/links.php
===================================================================
--- trunk/direct.openmoko.com/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: links.php,v 1.2 2004/03/12 19:28:57 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// define our link functions
+  require(DIR_WS_FUNCTIONS . 'links.php');
+
+// calculate link category path
+  if (isset($HTTP_GET_VARS['lPath'])) {
+    $lPath = $HTTP_GET_VARS['lPath'];
+    $current_category_id = $lPath;
+    $display_mode = 'links';
+  } elseif (isset($HTTP_GET_VARS['links_id'])) {
+    $lPath = tep_get_link_path($HTTP_GET_VARS['links_id']);
+  } else {
+    $lPath = '';
+    $display_mode = 'categories';
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LINKS);
+
+  // links breadcrumb
+  $link_categories_query = tep_db_query("select link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_id = '" . (int)$lPath . "' and language_id = '" . (int)$languages_id . "'");
+  $link_categories_value = tep_db_fetch_array($link_categories_query);
+
+  if ($display_mode == 'links') {
+    $breadcrumb->add(NAVBAR_TITLE, FILENAME_LINKS);
+    $breadcrumb->add($link_categories_value['link_categories_name'], FILENAME_LINKS . '?lPath=' . $lPath);
+  } else {
+    $breadcrumb->add(NAVBAR_TITLE, FILENAME_LINKS);
+  }
+
+
+  $content = CONTENT_LINKS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/links_submit.php
===================================================================
--- trunk/direct.openmoko.com/links_submit.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/links_submit.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+  $Id: links_submit.php,v 1.1.1.1 2004/03/04 23:38:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// needs to be included earlier to set the success message in the messageStack
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LINKS_SUBMIT);
+
+  $process = false;
+  if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
+    $process = true;
+
+    $links_title = tep_db_prepare_input($HTTP_POST_VARS['links_title']);
+    $links_url = tep_db_prepare_input($HTTP_POST_VARS['links_url']);
+    $links_category = tep_db_prepare_input($HTTP_POST_VARS['links_category']);
+    $links_description = tep_db_prepare_input($HTTP_POST_VARS['links_description']);
+    $links_image = tep_db_prepare_input($HTTP_POST_VARS['links_image']);
+    $links_contact_name = tep_db_prepare_input($HTTP_POST_VARS['links_contact_name']);
+    $links_contact_email = tep_db_prepare_input($HTTP_POST_VARS['links_contact_email']);
+    $links_reciprocal_url = tep_db_prepare_input($HTTP_POST_VARS['links_reciprocal_url']);
+
+    $error = false;
+
+    if (strlen($links_title) < ENTRY_LINKS_TITLE_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('submit_link', ENTRY_LINKS_TITLE_ERROR);
+    }
+
+    if (strlen($links_url) < ENTRY_LINKS_URL_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('submit_link', ENTRY_LINKS_URL_ERROR);
+    }
+
+    if (strlen($links_description) < ENTRY_LINKS_DESCRIPTION_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('submit_link', ENTRY_LINKS_DESCRIPTION_ERROR);
+    }
+
+    if (strlen($links_contact_name) < ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('submit_link', ENTRY_LINKS_CONTACT_NAME_ERROR);
+    }
+
+    if (strlen($links_contact_email) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('submit_link', ENTRY_EMAIL_ADDRESS_ERROR);
+    } elseif (tep_validate_email($links_contact_email) == false) {
+      $error = true;
+
+      $messageStack->add('submit_link', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
+    }
+
+    if (strlen($links_reciprocal_url) < ENTRY_LINKS_URL_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('submit_link', ENTRY_LINKS_RECIPROCAL_URL_ERROR);
+    }
+
+    if ($error == false) {
+      if($links_image == 'http://') {
+        $links_image = '';
+      }
+
+      // default values
+      $links_date_added = 'now()';
+      $links_status = '1'; // Pending approval
+      $links_rating = '0'; 
+
+      $sql_data_array = array('links_url' => $links_url,
+                              'links_image_url' => $links_image,
+                              'links_contact_name' => $links_contact_name,
+                              'links_contact_email' => $links_contact_email,
+                              'links_reciprocal_url' => $links_reciprocal_url, 
+                              'links_date_added' => $links_date_added, 
+                              'links_status' => $links_status, 
+                              'links_rating' => $links_rating);
+
+      tep_db_perform(TABLE_LINKS, $sql_data_array);
+
+      $links_id = tep_db_insert_id();
+
+      $categories_query = tep_db_query("select link_categories_id from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_name = '" . $links_category . "' and language_id = '" . (int)$languages_id . "'");
+
+      $categories = tep_db_fetch_array($categories_query);
+      $link_categories_id = $categories['link_categories_id'];
+
+      tep_db_query("insert into " . TABLE_LINKS_TO_LINK_CATEGORIES . " (links_id, link_categories_id) values ('" . (int)$links_id . "', '" . (int)$link_categories_id . "')");
+
+      $language_id = (int)$languages_id;
+
+      $sql_data_array = array('links_id' => $links_id, 
+                              'language_id' => $language_id, 
+                              'links_title' => $links_title,
+                              'links_description' => $links_description);
+
+      tep_db_perform(TABLE_LINKS_DESCRIPTION, $sql_data_array);
+
+// build the message content
+      $name = $links_contact_name;
+
+      $email_text = sprintf(EMAIL_GREET_NONE, $links_contact_name);
+
+      $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
+
+      tep_mail($name, $links_contact_email, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+
+      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_OWNER_SUBJECT, EMAIL_OWNER_TEXT, $name, $links_contact_email);
+
+      tep_redirect(tep_href_link(FILENAME_LINKS_SUBMIT_SUCCESS, '', 'SSL'));
+    }
+  }
+
+  // links breadcrumb
+  $breadcrumb->add(NAVBAR_TITLE_1, FILENAME_LINKS);
+
+  if (isset($HTTP_GET_VARS['lPath'])) {
+    $link_categories_query = tep_db_query("select link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_id = '" . (int)$HTTP_GET_VARS['lPath'] . "' and language_id = '" . (int)$languages_id . "'");
+    $link_categories_value = tep_db_fetch_array($link_categories_query);
+
+    $breadcrumb->add($link_categories_value['link_categories_name'], FILENAME_LINKS . '?lPath=' . $lPath);
+  } 
+
+  $breadcrumb->add(NAVBAR_TITLE_2);
+
+  $content = CONTENT_LINKS_SUBMIT;
+  $javascript = $content . '.js';
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/links_submit_success.php
===================================================================
--- trunk/direct.openmoko.com/links_submit_success.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/links_submit_success.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+  $Id: links_submit_success.php,v 1.1.1.1 2004/03/04 23:38:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LINKS_SUBMIT_SUCCESS);
+
+  // links breadcrumb
+  $breadcrumb->add(NAVBAR_TITLE_1, FILENAME_LINKS);
+  $breadcrumb->add(NAVBAR_TITLE_2);
+
+  if (sizeof($navigation->snapshot) > 0) {
+    $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
+    $navigation->clear_snapshot();
+  } else {
+    $origin_href = tep_href_link(FILENAME_DEFAULT);
+  }
+
+
+  $content = CONTENT_LINKS_SUBMIT_SUCCESS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/login.php
===================================================================
--- trunk/direct.openmoko.com/login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,162 @@
+<?php
+/*
+  $Id: login.php,v 1.1.1.1 2004/03/04 23:38:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)
+  if ($session_started == false) {
+    tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);
+
+  $error = false;
+
+if($HTTP_GET_VARS['login'] == 'fail') {
+$fail_reason = (!empty($HTTP_GET_VARS['reason'])) ? urldecode($HTTP_GET_VARS['reason']): TEXT_LOGIN_ERROR;
+$messageStack->add('login', $fail_reason);
+}
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
+    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
+    $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
+
+  if(ACCOUNT_EMAIL_CONFIRMATION=='true')
+  {
+    if (isset($HTTP_POST_VARS['pass'])){
+    $check_customer_query_val = tep_db_query("select customers_id, customers_group_id, customers_email_address, customers_default_address_id,customers_validation_code from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
+      $new_query_for_val = tep_db_fetch_array($check_customer_query_val);   
+    if ($new_query_for_val['customers_validation_code'] == $HTTP_POST_VARS['pass']) {
+      tep_db_query("update " . TABLE_CUSTOMERS . " set customers_validation = '1', customers_email_registered = '" . tep_db_input($email_address) . "' where customers_id = '" . $new_query_for_val['customers_id']  . "'");
+    }else{tep_redirect(tep_href_link('pw.php', 'verifyid=' . $new_query_for_val['customers_id'] . '&pass=' . $HTTP_POST_VARS['pass'], SSL));}
+    }
+  }
+    
+
+ $check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_group_id, customers_password, customers_email_address, customers_validation, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
+
+// Eversun end mod for sppc and qty price breaks
+    
+
+    if (!tep_db_num_rows($check_customer_query)) {
+      $error = true;
+    } else {
+      $check_customer = tep_db_fetch_array($check_customer_query);
+
+      // Check that password is good
+    if(ACCOUNT_EMAIL_CONFIRMATION=='true')
+    {$customers_validation=$check_customer['customers_validation'];}else{$customers_validation=1;}
+    
+       if ((!tep_validate_password($password, $check_customer['customers_password'])) ||  $customers_validation== '0') {
+        $error = true;
+    if ($customers_validation == '0') $setme = true;
+      } else {
+        if (SESSION_RECREATE == 'True') {
+          tep_session_recreate();
+        }
+// Eversun mod for sppc and qty price breaks
+// note that tax rates depend on your registered address!
+    if ($_GET['skip'] != 'true' && $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD ) {
+       $existing_customers_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
+    echo '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">';
+    print ("\n<html ");
+    echo HTML_PARAMS;
+    //print (">\n<head>\n<title>Choose a Customer Group</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=");
+    print (">\n<head>\n<title>".LOGIN_TITLE1."</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=");
+    echo CHARSET;
+    print ("\"\n<base href=\"");
+    echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG;
+    print ("\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\">\n");
+    echo '<body bgcolor="#ffffff" style="margin:0">';
+    print ("\n<table border=\"0\" width=\"100%\" height=\"100%\">\n<tr>\n<td style=\"vertical-align: middle\" align=\"middle\">\n");
+    echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process&skip=true', 'SSL'));
+    print ("\n<table border=\"0\" bgcolor=\"#f1f9fe\" cellspacing=\"10\" style=\"border: 1px solid #7b9ebd;\">\n<tr>\n<td class=\"main\">\n");
+      $index = 0;
+      while ($existing_customers =  tep_db_fetch_array($existing_customers_query)) {
+     $existing_customers_array[] = array("id" => $existing_customers['customers_group_id'], "text" => "&#160;".$existing_customers['customers_group_name']."&#160;");
+      ++$index;
+      }
+    //print ("<h1>Choose a Customer Group</h1>\n</td>\n</tr>\n<tr>\n<td align=\"center\">\n");
+    print ("<h1>".LOGIN_TITLE1."</h1>\n</td>\n</tr>\n<tr>\n<td align=\"center\">\n");
+    echo tep_draw_pull_down_menu('new_customers_group_id', $existing_customers_array, $check_customer['customers_group_id']);
+    print ("\n<tr>\n<td class=\"main\">&#160;<br />\n&#160;");
+    print ("<input type=\"hidden\" name=\"email_address\" value=\"".$_POST['email_address']."\">");
+    print ("<input type=\"hidden\" name=\"password\" value=\"".$_POST['password']."\">\n</td>\n</tr>\n<tr>\n<td align=\"right\">\n");
+    echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE);
+    print ("</td>\n</tr>\n</table>\n</form>\n</td>\n</tr>\n</table>\n</body>\n</html>\n");
+    exit;
+    }
+//Eversun mod for sppc and qty price breaks
+        $check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_customer['customers_id'] . "' and address_book_id = '" . (int)$check_customer['customers_default_address_id'] . "'");
+        $check_country = tep_db_fetch_array($check_country_query);
+
+        $customer_id = $check_customer['customers_id'];
+        $customer_default_address_id = $check_customer['customers_default_address_id'];
+        $customer_first_name = $check_customer['customers_firstname'];
+    // Eversun mod for sppc and qty price breaks
+    if ($_GET['skip'] == 'true' && $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD && isset($_POST['new_customers_group_id']))  {
+    $sppc_customer_group_id = $_POST['new_customers_group_id'] ;
+    $check_customer_group_tax = tep_db_query("select customers_group_show_tax, customers_group_tax_exempt from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id = '" .(int)$_POST['new_customers_group_id'] . "'");
+    } else {
+    $sppc_customer_group_id = $check_customer['customers_group_id'];
+    $check_customer_group_tax = tep_db_query("select customers_group_show_tax, customers_group_tax_exempt from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id = '" .(int)$check_customer['customers_group_id'] . "'");
+    }
+    $customer_group_tax = tep_db_fetch_array($check_customer_group_tax);
+    $sppc_customer_group_show_tax = (int)$customer_group_tax['customers_group_show_tax'];
+    $sppc_customer_group_tax_exempt = (int)$customer_group_tax['customers_group_tax_exempt'];
+// Eversun mod end for sppc and qty price breaks
+        $customer_country_id = $check_country['entry_country_id'];
+        $customer_zone_id = $check_country['entry_zone_id'];
+        tep_session_register('customer_id');
+        tep_session_register('customer_default_address_id');
+        tep_session_register('customer_first_name');
+    // Eversun mod for sppc and qty price breaks
+    tep_session_register('sppc_customer_group_id');
+    tep_session_register('sppc_customer_group_show_tax');
+    tep_session_register('sppc_customer_group_tax_exempt');
+// Eversun mod end  for sppc and qty price breaks
+        tep_session_register('customer_country_id');
+        tep_session_register('customer_zone_id');
+
+        tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");
+
+// restore cart contents
+        $cart->restore_contents();
+
+        if (sizeof($navigation->snapshot) > 0) {
+          $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
+          $navigation->clear_snapshot();
+          tep_redirect($origin_href);
+        } else {
+          tep_redirect(tep_href_link(FILENAME_DEFAULT, '', NONSSL));
+       }
+      }
+    }
+  }
+
+  if ($error == true) {
+if ($setme != ''){
+    $messageStack->add('login', TEXT_LOGIN_ERROR_VALIDATION);
+} else {
+    $messageStack->add('login', TEXT_LOGIN_ERROR);
+  }
+}
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+
+  $content = CONTENT_LOGIN;
+  $javascript = $content . '.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/logoff.php
===================================================================
--- trunk/direct.openmoko.com/logoff.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/logoff.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+  $Id: logoff.php,v 1.1.1.1 2004/03/04 23:38:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGOFF);
+
+  $breadcrumb->add(NAVBAR_TITLE);
+
+  tep_session_unregister('customer_id');
+  tep_session_unregister('customer_default_address_id');
+  tep_session_unregister('customer_first_name');
+  // Eversun mod for sppc and qty price breaks
+  tep_session_unregister('sppc_customer_group_id');
+  tep_session_unregister('sppc_customer_group_show_tax');
+  tep_session_unregister('sppc_customer_group_tax_exempt');
+// Eversun mod for sppc and qty price breaks
+  tep_session_unregister('customer_country_id');
+  tep_session_unregister('customer_zone_id');
+  tep_session_unregister('comments');
+//ICW - logout -> unregister GIFT VOUCHER sessions - Thanks Fredrik
+  tep_session_unregister('gv_id');
+  tep_session_unregister('cc_id');
+//ICW - logout -> unregister GIFT VOUCHER sessions  - Thanks Fredrik
+  $cart->reset();
+
+  $content = CONTENT_LOGOFF;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/pages.php
===================================================================
--- trunk/direct.openmoko.com/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: pages.php,v 1.2 2004/03/12 19:28:57 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  
+  Chain Reaction Works, Inc
+  
+  Copyright &copy; 2006 Chain Reaction Works, Inc
+  
+  Last Modified By : $Author$
+  Last Modified On : $Date$
+  
+  Latest Revision :  $Revision$
+  
+*/
+
+require('includes/application_top.php');
+
+$cID = 0;
+$pID = 0;
+$display_mode = '';
+
+if (isset($HTTP_GET_VARS['cID']) && tep_not_null($HTTP_GET_VARS['cID'])) {
+  $cID = (int)$HTTP_GET_VARS['cID'];
+  $display_mode = 'categories';
+}
+
+if (isset($HTTP_GET_VARS['pID']) && tep_not_null($HTTP_GET_VARS['pID'])) {
+  $pID = (int)$HTTP_GET_VARS['pID'];
+  $display_mode = 'pages';
+}
+
+require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PAGES);
+
+// pages breadcrumb
+$pages_categories_query = tep_db_query("select icd.categories_name from " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd, " . TABLE_PAGES_CATEGORIES . " ic where ic.categories_id = icd.categories_id and icd.categories_id = '" . (int)$cID . "' and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1'");
+$pages_categories_value = tep_db_fetch_array($pages_categories_query);
+
+if (($display_mode == 'pages') || ($display_mode == 'categories')) {
+  $breadcrumb->add(NAVBAR_TITLE, FILENAME_PAGES);
+
+  if (tep_not_null($pages_categories_value['categories_name'])) {
+    $breadcrumb->add($pages_categories_value['categories_name'], FILENAME_PAGES . '?cID=' . $cID);
+  }
+} else {
+  $breadcrumb->add(NAVBAR_TITLE, FILENAME_PAGES);
+}
+
+$content = CONTENT_PAGES;
+
+require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/password_forgotten.php
===================================================================
--- trunk/direct.openmoko.com/password_forgotten.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/password_forgotten.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  $Id: password_forgotten.php,v 1.1.1.1 2004/03/04 23:38:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PASSWORD_FORGOTTEN);
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
+    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
+
+    $check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_password, customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
+    if (tep_db_num_rows($check_customer_query)) {
+      $check_customer = tep_db_fetch_array($check_customer_query);
+
+      $new_password = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
+      $crypted_password = tep_encrypt_password($new_password);
+
+      tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_db_input($crypted_password) . "' where customers_id = '" . (int)$check_customer['customers_id'] . "'");
+
+      tep_mail($check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'], $email_address, EMAIL_PASSWORD_REMINDER_SUBJECT, sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
+
+      $messageStack->add_session('login', SUCCESS_PASSWORD_SENT, 'success');
+
+      tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+    } else {
+      $messageStack->add('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND);
+    }
+  }
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL'));
+
+  $content = CONTENT_PASSWORD_FORGOTTEN;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/paypal_notify.php
===================================================================
--- trunk/direct.openmoko.com/paypal_notify.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/paypal_notify.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,291 @@
+<?php
+/*
+  $Id: paypal_notify.php,v 1.1.1.1 2004/03/04 23:38:01 ccwjr Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Paypal IPN v0.981 for Milestone 2
+  Copyright (c) 2003 Pablo Pasqualino
+  pablo_osc at osmosisdc.com
+  http://www.osmosisdc.com
+
+  Released under the GNU General Public License
+*/
+
+  include('includes/application_top.php');
+  include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);
+
+// load paypal_ipn payment module
+  $payment = 'paypalipn';
+  require(DIR_WS_CLASSES . 'payment.php');
+  $payment_modules = new payment($payment);
+
+  if (phpversion() <= '4.0.6') {
+    $_POST = $HTTP_POST_VARS;
+  }
+
+  require(DIR_WS_CLASSES . 'order.php');
+  $order = new order((int)$_POST['item_number']);
+
+  $req = 'cmd=_notify-validate';
+
+  foreach ($_POST as $key => $value) {
+    $req .= '&' . $key . '=' . urlencode($value);
+    $$key = $value;
+  }
+
+  $response_verified = '';
+  $paypal_response = '';
+
+  if (MODULE_PAYMENT_PAYPALIPN_TEST_MODE=='True') {
+
+    if ($item_number) {
+      $paypal_response = $_POST[ipnstatus];
+
+//  echo 'TEST IPN Processed for order #'.$item_number;
+  echo PAYPAL_NOTIFY_IPN_TEST_1.$item_number;
+    } else {
+
+//  echo 'You need to specify an order #';
+  echo PAYPAL_NOTIFY_IPN_TEST_2;
+
+    };
+
+  } elseif (MODULE_PAYMENT_PAYPALIPN_CURL=='True') { // IF CURL IS ON, SEND DATA USING CURL (SECURE MODE, TO https://)
+
+    $ch = curl_init();
+    curl_setopt($ch, CURLOPT_URL,"https://www.paypal.com/cgi-bin/webscr");
+    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
+    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    curl_setopt($ch, CURLOPT_POST, 1);
+    curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
+    $paypal_response = curl_exec($ch);
+    curl_close ($ch);
+
+  } else { // ELSE, SEND IT WITH HEADERS (STANDARD MODE, TO http://)
+
+    $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
+    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
+    $header .= "Content-Length: " . strlen ($req) . "\r\n\r\n";
+    $fp = fsockopen ("www.paypal.com", 80, $errno, $errstr, 30);
+
+    fputs ($fp, $header . $req);
+    while (!feof($fp)) {
+      $paypal_response .= fgets($fp, 1024);
+    };
+
+    fclose ($fp);
+
+  };
+
+  if (ereg('VERIFIED',$paypal_response)) {
+    $response_verified = 1;
+    $ipn_result = 'VERIFIED';
+  } else if (ereg('INVALID',$paypal_response)) {
+    $response_invalid = 1;
+    $ipn_result = 'INVALID';
+  } else {
+    //echo 'Error: no valid $paypal_response received.';
+    echo PAYPAL_NOTIFY_RECEIVED_ERROR_1. $paypal_response .PAYPAL_NOTIFY_RECEIVED_ERROR_2;
+  };
+
+  if ($txn_id && ($response_verified==1 || $response_invalid==1)) {
+
+    $txn_check = tep_db_query("select txn_id from " . TABLE_PAYPALIPN_TXN . " where txn_id='$txn_id'");
+    if (tep_db_num_rows($txn_check)==0) { // If txn no previously registered, we should register it
+
+      $sql_data_array = array('txn_id' => $txn_id,
+                              'ipn_result' => $ipn_result,
+                              'receiver_email' => $receiver_email,
+                              'business' => $business,
+                              'item_name' => $item_name,
+                              'item_number' => $item_number,
+                              'quantity' => $quantity,
+                              'invoice' => $invoice,
+                              'custom' => $custom,
+                              'option_name1' => $option_name1,
+                              'option_selection1' => $option_selection1,
+                              'option_name2' => $option_name2,
+                              'option_selection2' => $option_selection2,
+                              'num_cart_items' => $num_cart_items,
+                              'payment_status' => $payment_status,
+                              'pending_reason' => $pending_reason,
+                              'payment_date' => $payment_date,
+                              'settle_amount' => $settle_amount,
+                              'settle_currency' => $settle_currency,
+                              'exchange_rate' => $exchange_rate,
+                              'payment_gross' => $payment_gross,
+                              'payment_fee' => $payment_fee,
+                              'mc_gross' => $mc_gross,
+                              'mc_fee' => $mc_fee,
+                              'mc_currency' => $mc_currency,
+                              'tax' => $tax,
+                              'txn_type' => $txn_type,
+                              'for_auction' => $for_auction,
+                              'memo' => $memo,
+                              'first_name' => $first_name,
+                              'last_name' => $last_name,
+                              'address_street' => $address_street,
+                              'address_city' => $address_city,
+                              'address_state' => $address_state,
+                              'address_zip' => $address_zip,
+                              'address_country' => $address_country,
+                              'address_status' => $address_status,
+                              'payer_email' => $payer_email,
+                              'payer_id' => $payer_id,
+                              'payer_status' => $payer_status,
+                              'payment_type' => $payment_type,
+                              'notify_version' => $notify_version,
+                              'verify_sign' => $verify_sign);
+
+      tep_db_perform(TABLE_PAYPALIPN_TXN,$sql_data_array);
+
+    } else { // else we update it to the new status
+
+      $sql_data_array = array('payment_status' => $payment_status,
+                              'pending_reason' => $pending_reason,
+                              'ipn_result' => $ipn_result,
+                              'payer_email' => $payer_email,
+                              'payer_id' => $payer_id,
+                              'payer_status' => $payer_status,
+                              'payment_type' => $payment_type);
+
+      tep_db_perform(TABLE_PAYPALIPN_TXN,$sql_data_array,'update','txn_id=\''.$txn_id.'\'');
+
+    };
+
+  };
+
+  if ($response_verified==1) {
+    if (strtolower($receiver_email)==strtolower(MODULE_PAYMENT_PAYPALIPN_ID) || strtolower($business)==strtolower(MODULE_PAYMENT_PAYPALIPN_ID)) {
+      if ($payment_status=='Completed') {
+        if (MODULE_PAYMENT_PAYPALIPN_UPDATE_STOCK_BEFORE_PAYMENT=='False') {
+          for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+// Stock Update - Joao Correia
+            if (STOCK_LIMITED == 'true') {
+              $downloadable_product = false;
+      if (DOWNLOAD_ENABLED == 'true') {
+        // see if this product actually has a downloadable file in the attributes
+        $download_check_query_raw = "SELECT products_quantity, pad.products_attributes_filename
+                            FROM " . TABLE_PRODUCTS . " p, 
+                            " . TABLE_PRODUCTS_ATTRIBUTES . " pa,
+                            " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
+                             WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'
+                             and p.products_id=pa.products_id
+                             and pad.products_attributes_id=pa.products_attributes_id ";
+                             
+        $download_check_query = tep_db_query($download_check_query_raw);
+        if (tep_db_num_rows($download_check_query) > 0) {
+          $downloadable_product = true;
+        }
+      }  // end of downloadable product check
+      if ( !$downloadable_product ) {
+        $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        $stock_values = tep_db_fetch_array($stock_query);
+        $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
+        tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
+          tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
+        }
+      }
+            }
+          }
+        }
+
+        if (is_numeric(MODULE_PAYMENT_PAYPALIPN_ORDER_STATUS_ID) && (MODULE_PAYMENT_PAYPALIPN_ORDER_STATUS_ID > 0) ) {
+          $order_status = MODULE_PAYMENT_PAYPALIPN_ORDER_STATUS_ID;
+        } else {
+          $order_status = DEFAULT_ORDERS_STATUS_ID;
+        };
+
+        $sql_data_array = array('orders_status' => $order_status);
+
+        tep_db_perform(TABLE_ORDERS,$sql_data_array,'update','orders_id='.$item_number);
+
+        $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
+        $sql_data_array = array('orders_id' => $item_number,
+                                'orders_status_id' => $order_status,
+                                'date_added' => 'now()',
+                                'customer_notified' => $customer_notification);
+        tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
+
+// lets start with the email confirmation
+        for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+          if (sizeof($order->products[$i]['attributes']) > 0) {
+            $attributes_exist = '1';
+            $products_ordered_attributes = "\n";
+            for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
+              $products_ordered_attributes .= '  '. $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
+              if ($order->products[$i]['attributes'][$j]['price'] != '0') $products_ordered_attributes .= ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')' . "\n";
+            }
+          }
+
+          $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
+          $products_ordered_attributes = '';
+        }
+
+        $email_order = STORE_NAME . "\n" .
+                       EMAIL_SEPARATOR . "\n" .
+                       EMAIL_TEXT_ORDER_NUMBER . ' ' . $item_number . "\n" .
+                       EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $item_number, 'SSL', false) . "\n" .
+                       EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
+        if ($order->info['comments']) {
+          $email_order .= tep_db_output($order->info['comments']) . "\n\n";
+        }
+        $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
+                        EMAIL_SEPARATOR . "\n" .
+                        $products_ordered .
+                        EMAIL_SEPARATOR . "\n";
+
+        for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
+          $email_order .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n";
+        }
+
+        if ($order->content_type != 'virtual') {
+          $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
+                          EMAIL_SEPARATOR . "\n";
+          if ($order->delivery['company']) { $email_order .= $order->delivery['company'] . "\n"; };
+          $email_order .= $order->delivery['name'] . "\n" .
+                          $order->delivery['street_address'] . "\n";
+          if ($order->delivery['suburb']) { $email_order .= $order->delivery['suburb'] . "\n"; };
+          $email_order .= $order->delivery['city'] . ', ' . $order->delivery['postcode'] . "\n";
+          if ($order->delivery['state']) { $email_order .= $order->delivery['state'] . ', '; };
+          $email_order .= $order->delivery['country'] . "\n";
+        }
+
+        $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
+                        EMAIL_SEPARATOR . "\n";
+          if ($order->billing['company']) { $email_order .= $order->billing['company'] . "\n"; };
+          $email_order .= $order->billing['name'] . "\n" .
+                          $order->billing['street_address'] . "\n";
+          if ($order->billing['suburb']) { $email_order .= $order->billing['suburb'] . "\n"; };
+          $email_order .= $order->billing['city'] . ', ' . $order->billing['postcode'] . "\n";
+          if ($order->billing['state']) { $email_order .= $order->billing['state'] . ', '; };
+          $email_order .= $order->billing['country'] . "\n\n";
+
+        if (is_object($$payment)) {
+          $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
+                          EMAIL_SEPARATOR . "\n";
+          $payment_class = $$payment;
+          $email_order .= $payment_class->title . "\n\n";
+          if ($payment_class->email_footer) {
+            $email_order .= $payment_class->email_footer . "\n\n";
+          }
+        }
+
+        tep_mail($order->customer['name'],$order->customer['email_address'], EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');
+
+        if (SEND_EXTRA_ORDER_EMAILS_TO != '') { // send emails to other people
+          tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT,  nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');
+        };
+
+        tep_db_query("delete from " .TABLE_CUSTOMERS_BASKET. " where customers_id=".$order->customer['id']);
+        tep_db_query("delete from " .TABLE_CUSTOMERS_BASKET_ATTRIBUTES. " where customers_id=".$order->customer['id']);
+
+      };
+
+    };
+
+  };
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/.htaccess
===================================================================
--- trunk/direct.openmoko.com/pear/.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+# This is used with Apache WebServers
+# The following blocks direct HTTP requests in this directory recursively
+#
+# For this to work, you must include the parameter 'Limit' to the AllowOverride configuration
+#
+# Example:
+#
+#<Directory "/usr/local/apache/htdocs">
+#  AllowOverride Limit
+#
+# 'All' with also work. (This configuration is in your apache/conf/httpd.conf file)
+#
+# This does not affect PHP include/require functions
+#
+# Example: http://server/catalog/includes/application_top.php will not work
+
+<Files *.php>
+Order Deny,Allow
+Deny from all
+</Files>

Added: trunk/direct.openmoko.com/pear/Auth/SASL/Anonymous.php
===================================================================
--- trunk/direct.openmoko.com/pear/Auth/SASL/Anonymous.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Auth/SASL/Anonymous.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+// +-----------------------------------------------------------------------+ 
+// | Copyright (c) 2002-2003 Richard Heyes                                 | 
+// | All rights reserved.                                                  | 
+// |                                                                       | 
+// | Redistribution and use in source and binary forms, with or without    | 
+// | modification, are permitted provided that the following conditions    | 
+// | are met:                                                              | 
+// |                                                                       | 
+// | o Redistributions of source code must retain the above copyright      | 
+// |   notice, this list of conditions and the following disclaimer.       | 
+// | o Redistributions in binary form must reproduce the above copyright   | 
+// |   notice, this list of conditions and the following disclaimer in the | 
+// |   documentation and/or other materials provided with the distribution.| 
+// | o The names of the authors may not be used to endorse or promote      | 
+// |   products derived from this software without specific prior written  | 
+// |   permission.                                                         | 
+// |                                                                       | 
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   | 
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     | 
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  | 
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      | 
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   | 
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  | 
+// |                                                                       | 
+// +-----------------------------------------------------------------------+ 
+// | Author: Richard Heyes <richard at php.net>                               | 
+// +-----------------------------------------------------------------------+ 
+// 
+// $Id: Anonymous.php,v 1.4 2003/02/21 16:07:17 mj Exp $
+
+/**
+* Implmentation of ANONYMOUS SASL mechanism
+*
+* @author  Richard Heyes <richard at php.net>
+* @access  public
+* @version 1.0
+* @package Auth_SASL
+*/
+
+require_once('Auth/SASL/Common.php');
+
+class Auth_SASL_Anonymous extends Auth_SASL_Common
+{
+    /**
+    * Not much to do here except return the token supplied.
+    * No encoding, hashing or encryption takes place for this
+    * mechanism, simply one of:
+    *  o An email address
+    *  o An opaque string not containing "@" that can be interpreted
+    *    by the sysadmin
+    *  o Nothing
+    *
+    * We could have some logic here for the second option, but this
+    * would by no means create something interpretable.
+    *
+    * @param  string $token Optional email address or string to provide
+    *                       as trace information.
+    * @return string        The unaltered input token
+    */
+    function getResponse($token = '')
+    {
+        return $token;
+    }
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Auth/SASL/Common.php
===================================================================
--- trunk/direct.openmoko.com/pear/Auth/SASL/Common.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Auth/SASL/Common.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+// +-----------------------------------------------------------------------+ 
+// | Copyright (c) 2002-2003 Richard Heyes                                 | 
+// | All rights reserved.                                                  | 
+// |                                                                       | 
+// | Redistribution and use in source and binary forms, with or without    | 
+// | modification, are permitted provided that the following conditions    | 
+// | are met:                                                              | 
+// |                                                                       | 
+// | o Redistributions of source code must retain the above copyright      | 
+// |   notice, this list of conditions and the following disclaimer.       | 
+// | o Redistributions in binary form must reproduce the above copyright   | 
+// |   notice, this list of conditions and the following disclaimer in the | 
+// |   documentation and/or other materials provided with the distribution.| 
+// | o The names of the authors may not be used to endorse or promote      | 
+// |   products derived from this software without specific prior written  | 
+// |   permission.                                                         | 
+// |                                                                       | 
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   | 
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     | 
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  | 
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      | 
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   | 
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  | 
+// |                                                                       | 
+// +-----------------------------------------------------------------------+ 
+// | Author: Richard Heyes <richard at php.net>                               | 
+// +-----------------------------------------------------------------------+ 
+// 
+// $Id: Common.php,v 1.6 2003/02/21 16:07:17 mj Exp $
+
+/**
+* Common functionality to SASL mechanisms
+*
+* @author  Richard Heyes <richard at php.net>
+* @access  public
+* @version 1.0
+* @package Auth_SASL
+*/
+
+class Auth_SASL_Common
+{
+    /**
+    * Function which implements HMAC MD5 digest
+    *
+    * @param  string $key  The secret key
+    * @param  string $data The data to protect
+    * @return string       The HMAC MD5 digest
+    */
+    function _HMAC_MD5($key, $data)
+    {
+        if (strlen($key) > 64) {
+            $key = pack('H32', md5($key));
+        }
+
+        if (strlen($key) < 64) {
+            $key = str_pad($key, 64, chr(0));
+        }
+
+        $k_ipad = substr($key, 0, 64) ^ str_repeat(chr(0x36), 64);
+        $k_opad = substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64);
+
+        $inner  = pack('H32', md5($k_ipad . $data));
+        $digest = md5($k_opad . $inner);
+
+        return $digest;
+    }
+}
+?>

Added: trunk/direct.openmoko.com/pear/Auth/SASL/CramMD5.php
===================================================================
--- trunk/direct.openmoko.com/pear/Auth/SASL/CramMD5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Auth/SASL/CramMD5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+// +-----------------------------------------------------------------------+ 
+// | Copyright (c) 2002-2003 Richard Heyes                                 | 
+// | All rights reserved.                                                  | 
+// |                                                                       | 
+// | Redistribution and use in source and binary forms, with or without    | 
+// | modification, are permitted provided that the following conditions    | 
+// | are met:                                                              | 
+// |                                                                       | 
+// | o Redistributions of source code must retain the above copyright      | 
+// |   notice, this list of conditions and the following disclaimer.       | 
+// | o Redistributions in binary form must reproduce the above copyright   | 
+// |   notice, this list of conditions and the following disclaimer in the | 
+// |   documentation and/or other materials provided with the distribution.| 
+// | o The names of the authors may not be used to endorse or promote      | 
+// |   products derived from this software without specific prior written  | 
+// |   permission.                                                         | 
+// |                                                                       | 
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   | 
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     | 
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  | 
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      | 
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   | 
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  | 
+// |                                                                       | 
+// +-----------------------------------------------------------------------+ 
+// | Author: Richard Heyes <richard at php.net>                               | 
+// +-----------------------------------------------------------------------+ 
+// 
+// $Id: CramMD5.php,v 1.4 2003/02/21 16:07:17 mj Exp $
+
+/**
+* Implmentation of CRAM-MD5 SASL mechanism
+*
+* @author  Richard Heyes <richard at php.net>
+* @access  public
+* @version 1.0
+* @package Auth_SASL
+*/
+
+require_once('Auth/SASL/Common.php');
+
+class Auth_SASL_CramMD5 extends Auth_SASL_Common
+{
+    /**
+    * Implements the CRAM-MD5 SASL mechanism
+    * This DOES NOT base64 encode the return value,
+    * you will need to do that yourself.
+    *
+    * @param string $user      Username
+    * @param string $pass      Password
+    * @param string $challenge The challenge supplied by the server.
+    *                          this should be already base64_decoded.
+    *
+    * @return string The string to pass back to the server, of the form
+    *                "<user> <digest>". This is NOT base64_encoded.
+    */
+    function getResponse($user, $pass, $challenge)
+    {
+        return $user . ' ' . $this->_HMAC_MD5($pass, $challenge);
+    }
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Auth/SASL/DigestMD5.php
===================================================================
--- trunk/direct.openmoko.com/pear/Auth/SASL/DigestMD5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Auth/SASL/DigestMD5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,194 @@
+<?php
+// +-----------------------------------------------------------------------+ 
+// | Copyright (c) 2002-2003 Richard Heyes                                 | 
+// | All rights reserved.                                                  | 
+// |                                                                       | 
+// | Redistribution and use in source and binary forms, with or without    | 
+// | modification, are permitted provided that the following conditions    | 
+// | are met:                                                              | 
+// |                                                                       | 
+// | o Redistributions of source code must retain the above copyright      | 
+// |   notice, this list of conditions and the following disclaimer.       | 
+// | o Redistributions in binary form must reproduce the above copyright   | 
+// |   notice, this list of conditions and the following disclaimer in the | 
+// |   documentation and/or other materials provided with the distribution.| 
+// | o The names of the authors may not be used to endorse or promote      | 
+// |   products derived from this software without specific prior written  | 
+// |   permission.                                                         | 
+// |                                                                       | 
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   | 
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     | 
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  | 
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      | 
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   | 
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  | 
+// |                                                                       | 
+// +-----------------------------------------------------------------------+ 
+// | Author: Richard Heyes <richard at php.net>                               | 
+// +-----------------------------------------------------------------------+ 
+// 
+// $Id: DigestMD5.php,v 1.6 2003/02/21 16:07:17 mj Exp $
+
+/**
+* Implmentation of DIGEST-MD5 SASL mechanism
+*
+* @author  Richard Heyes <richard at php.net>
+* @access  public
+* @version 1.0
+* @package Auth_SASL
+*/
+
+require_once('Auth/SASL/Common.php');
+
+class Auth_SASL_DigestMD5 extends Auth_SASL_Common
+{
+    /**
+    * Provides the (main) client response for DIGEST-MD5
+    * requires a few extra parameters than the other
+    * mechanisms, which are unavoidable.
+    * 
+    * @param  string $authcid   Authentication id (username)
+    * @param  string $pass      Password
+    * @param  string $challenge The digest challenge sent by the server
+    * @param  string $hostname  The hostname of the machine you're connecting to
+    * @param  string $service   The servicename (eg. imap, pop, acap etc)
+    * @param  string $authzid   Authorization id (username to proxy as)
+    * @return string            The digest response (NOT base64 encoded)
+    * @access public
+    */
+    function getResponse($authcid, $pass, $challenge, $hostname, $service, $authzid = '')
+    {
+        $challenge = $this->_parseChallenge($challenge);
+        $authzid_string = '';
+        if ($authzid != '') {
+            $authzid_string = ',authzid="' . $authzid . '"'; 
+        }
+
+        if (!empty($challenge)) {
+            $cnonce         = $this->_getCnonce();
+            $digest_uri     = sprintf('%s/%s', $service, $hostname);
+            $response_value = $this->_getResponseValue($authcid, $pass, $challenge['realm'], $challenge['nonce'], $cnonce, $digest_uri, $authzid);
+
+            return sprintf('username="%s",realm="%s"' . $authzid_string  . ',nonce="%s",cnonce="%s",nc="00000001",qop=auth,digest-uri="%s",response=%s,%d', $authcid, $challenge['realm'], $challenge['nonce'], $cnonce, $digest_uri, $response_value, $challenge['maxbuf']);
+        } else {
+            return PEAR::raiseError('Invalid digest challenge');
+        }
+    }
+    
+    /**
+    * Parses and verifies the digest challenge*
+    *
+    * @param  string $challenge The digest challenge
+    * @return array             The parsed challenge as an assoc
+    *                           array in the form "directive => value".
+    * @access private
+    */
+    function _parseChallenge($challenge)
+    {
+        $tokens = array();
+        while (preg_match('/^([a-z-]+)=("[^"]+(?<!\\\)"|[^,]+)/i', $challenge, $matches)) {
+
+            // Ignore these as per rfc2831
+            if ($matches[1] == 'opaque' OR $matches[1] == 'domain') {
+                $challenge = substr($challenge, strlen($matches[0]) + 1);
+                continue;
+            }
+
+            // Allowed multiple "realm" and "auth-param"
+            if (!empty($tokens[$matches[1]]) AND ($matches[1] == 'realm' OR $matches[1] == 'auth-param')) {
+                if (is_array($tokens[$matches[1]])) {
+                    $tokens[$matches[1]][] = preg_replace('/^"(.*)"$/', '\\1', $matches[2]);
+                } else {
+                    $tokens[$matches[1]] = array($tokens[$matches[1]], preg_replace('/^"(.*)"$/', '\\1', $matches[2]));
+                }
+
+            // Any other multiple instance = failure
+            } elseif (!empty($tokens[$matches[1]])) {
+                $tokens = array();
+                break;
+
+            } else {
+                $tokens[$matches[1]] = preg_replace('/^"(.*)"$/', '\\1', $matches[2]);
+            }
+
+            // Remove the just parsed directive from the challenge
+            $challenge = substr($challenge, strlen($matches[0]) + 1);
+        }
+
+        /**
+        * Defaults and required directives
+        */
+        // Realm
+        if (empty($tokens['realm'])) {
+            $uname = posix_uname();
+            $tokens['realm'] = $uname['nodename'];
+        }
+        
+        // Maxbuf
+        if (empty($tokens['maxbuf'])) {
+            $tokens['maxbuf'] = 65536;
+        }
+        
+        // Required: nonce, algorithm
+        if (empty($tokens['nonce']) OR empty($tokens['algorithm'])) {
+            return array();
+        }
+        
+        return $tokens;
+    }
+
+    /**
+    * Creates the response= part of the digest response
+    *
+    * @param  string $authcid    Authentication id (username)
+    * @param  string $pass       Password
+    * @param  string $realm      Realm as provided by the server
+    * @param  string $nonce      Nonce as provided by the server
+    * @param  string $cnonce     Client nonce
+    * @param  string $digest_uri The digest-uri= value part of the response
+    * @param  string $authzid    Authorization id
+    * @return string             The response= part of the digest response
+    * @access private
+    */    
+    function _getResponseValue($authcid, $pass, $realm, $nonce, $cnonce, $digest_uri, $authzid = '')
+    {
+        if ($authzid == '') {
+            $A1 = sprintf('%s:%s:%s', pack('H32', md5(sprintf('%s:%s:%s', $authcid, $realm, $pass))), $nonce, $cnonce);
+        } else {
+            $A1 = sprintf('%s:%s:%s:%s', pack('H32', md5(sprintf('%s:%s:%s', $authcid, $realm, $pass))), $nonce, $cnonce, $authzid);
+        }
+        $A2 = 'AUTHENTICATE:' . $digest_uri;
+        return md5(sprintf('%s:%s:00000001:%s:auth:%s', md5($A1), $nonce, $cnonce, md5($A2)));
+    }
+
+    /**
+    * Creates the client nonce for the response
+    *
+    * @return string  The cnonce value
+    * @access private
+    */
+    function _getCnonce()
+    {
+        if (file_exists('/dev/urandom')) {
+            return base64_encode(fread(fopen('/dev/urandom', 'r'), 32));
+
+        } elseif (file_exists('/dev/random')) {
+            return base64_encode(fread(fopen('/dev/random', 'r'), 32));
+
+        } else {
+            $str = '';
+            mt_srand((double)microtime()*10000000);
+            for ($i=0; $i<32; $i++) {
+                $str .= chr(mt_rand(0, 255));
+            }
+            
+            return base64_encode($str);
+        }
+    }
+}
+?>

Added: trunk/direct.openmoko.com/pear/Auth/SASL/Login.php
===================================================================
--- trunk/direct.openmoko.com/pear/Auth/SASL/Login.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Auth/SASL/Login.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+// +-----------------------------------------------------------------------+ 
+// | Copyright (c) 2002-2003 Richard Heyes                                 | 
+// | All rights reserved.                                                  | 
+// |                                                                       | 
+// | Redistribution and use in source and binary forms, with or without    | 
+// | modification, are permitted provided that the following conditions    | 
+// | are met:                                                              | 
+// |                                                                       | 
+// | o Redistributions of source code must retain the above copyright      | 
+// |   notice, this list of conditions and the following disclaimer.       | 
+// | o Redistributions in binary form must reproduce the above copyright   | 
+// |   notice, this list of conditions and the following disclaimer in the | 
+// |   documentation and/or other materials provided with the distribution.| 
+// | o The names of the authors may not be used to endorse or promote      | 
+// |   products derived from this software without specific prior written  | 
+// |   permission.                                                         | 
+// |                                                                       | 
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   | 
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     | 
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  | 
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      | 
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   | 
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  | 
+// |                                                                       | 
+// +-----------------------------------------------------------------------+ 
+// | Author: Richard Heyes <richard at php.net>                               | 
+// +-----------------------------------------------------------------------+ 
+// 
+// $Id: Login.php,v 1.4 2003/02/21 16:07:17 mj Exp $
+
+/**
+* This is technically not a SASL mechanism, however
+* it's used by Net_Sieve, Net_Cyrus and potentially
+* other protocols , so here is a good place to abstract
+* it.
+*
+* @author  Richard Heyes <richard at php.net>
+* @access  public
+* @version 1.0
+* @package Auth_SASL
+*/
+
+require_once('Auth/SASL/Common.php');
+
+class Auth_SASL_Login extends Auth_SASL_Common
+{
+    /**
+    * Pseudo SASL LOGIN mechanism
+    *
+    * @param  string $user Username
+    * @param  string $pass Password
+    * @return string       LOGIN string
+    */
+    function getResponse($user, $pass)
+    {
+        return sprintf('LOGIN %s %s', $user, $pass);
+    }
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Auth/SASL/Plain.php
===================================================================
--- trunk/direct.openmoko.com/pear/Auth/SASL/Plain.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Auth/SASL/Plain.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+// +-----------------------------------------------------------------------+ 
+// | Copyright (c) 2002-2003 Richard Heyes                                 | 
+// | All rights reserved.                                                  | 
+// |                                                                       | 
+// | Redistribution and use in source and binary forms, with or without    | 
+// | modification, are permitted provided that the following conditions    | 
+// | are met:                                                              | 
+// |                                                                       | 
+// | o Redistributions of source code must retain the above copyright      | 
+// |   notice, this list of conditions and the following disclaimer.       | 
+// | o Redistributions in binary form must reproduce the above copyright   | 
+// |   notice, this list of conditions and the following disclaimer in the | 
+// |   documentation and/or other materials provided with the distribution.| 
+// | o The names of the authors may not be used to endorse or promote      | 
+// |   products derived from this software without specific prior written  | 
+// |   permission.                                                         | 
+// |                                                                       | 
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   | 
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     | 
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  | 
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      | 
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   | 
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  | 
+// |                                                                       | 
+// +-----------------------------------------------------------------------+ 
+// | Author: Richard Heyes <richard at php.net>                               | 
+// +-----------------------------------------------------------------------+ 
+// 
+// $Id: Plain.php,v 1.5 2003/02/21 16:07:17 mj Exp $
+
+/**
+* Implmentation of PLAIN SASL mechanism
+*
+* @author  Richard Heyes <richard at php.net>
+* @access  public
+* @version 1.0
+* @package Auth_SASL
+*/
+
+require_once('Auth/SASL/Common.php');
+
+class Auth_SASL_Plain extends Auth_SASL_Common
+{
+    /**
+    * Returns PLAIN response
+    *
+    * @param  string $authcid   Authentication id (username)
+    * @param  string $pass      Password
+    * @param  string $authzid   Autorization id
+    * @return string            PLAIN Response
+    */
+    function getResponse($authcid, $pass, $authzid = '')
+    {
+        return $authzid . chr(0) . $authcid . chr(0) . $pass;
+    }
+}
+?>

Added: trunk/direct.openmoko.com/pear/Auth/SASL.php
===================================================================
--- trunk/direct.openmoko.com/pear/Auth/SASL.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Auth/SASL.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,98 @@
+<?php
+// +-----------------------------------------------------------------------+ 
+// | Copyright (c) 2002-2003 Richard Heyes                                 | 
+// | All rights reserved.                                                  | 
+// |                                                                       | 
+// | Redistribution and use in source and binary forms, with or without    | 
+// | modification, are permitted provided that the following conditions    | 
+// | are met:                                                              | 
+// |                                                                       | 
+// | o Redistributions of source code must retain the above copyright      | 
+// |   notice, this list of conditions and the following disclaimer.       | 
+// | o Redistributions in binary form must reproduce the above copyright   | 
+// |   notice, this list of conditions and the following disclaimer in the | 
+// |   documentation and/or other materials provided with the distribution.| 
+// | o The names of the authors may not be used to endorse or promote      | 
+// |   products derived from this software without specific prior written  | 
+// |   permission.                                                         | 
+// |                                                                       | 
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   | 
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     | 
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  | 
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      | 
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   | 
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  | 
+// |                                                                       | 
+// +-----------------------------------------------------------------------+ 
+// | Author: Richard Heyes <richard at php.net>                               | 
+// +-----------------------------------------------------------------------+ 
+// 
+// $Id: SASL.php,v 1.4 2003/02/21 16:07:17 mj Exp $
+
+/**
+* Client implementation of various SASL mechanisms 
+*
+* @author  Richard Heyes <richard at php.net>
+* @access  public
+* @version 1.0
+* @package Auth_SASL
+*/
+
+require_once('PEAR.php');
+
+class Auth_SASL
+{
+    /**
+    * Factory class. Returns an object of the request
+    * type.
+    *
+    * @param string $type One of: Anonymous
+    *                             Plain
+    *                             CramMD5
+    *                             DigestMD5
+    *                     Types are not case sensitive
+    */
+    function &factory($type)
+    {
+        switch (strtolower($type)) {
+            case 'anonymous':
+                $filename  = 'Auth/SASL/Anonymous.php';
+                $classname = 'Auth_SASL_Anonymous';
+                break;
+
+            case 'login':
+                $filename  = 'Auth/SASL/Login.php';
+                $classname = 'Auth_SASL_Login';
+                break;
+
+            case 'plain':
+                $filename  = 'Auth/SASL/Plain.php';
+                $classname = 'Auth_SASL_Plain';
+                break;
+
+            case 'crammd5':
+                $filename  = 'Auth/SASL/CramMD5.php';
+                $classname = 'Auth_SASL_CramMD5';
+                break;
+
+            case 'digestmd5':
+                $filename  = 'Auth/SASL/DigestMD5.php';
+                $classname = 'Auth_SASL_DigestMD5';
+                break;
+
+            default:
+                return PEAR::raiseError('Invalid SASL mechanism type');
+                break;
+        }
+
+        require_once($filename);
+        return new $classname();
+    }
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/DB/common.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/common.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/common.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,2157 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Contains the DB_common base class
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Tomas V.V. Cox <cox at idecnet.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: common.php,v 1.137 2005/04/07 14:27:35 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the PEAR class so it can be extended from
+ */
+require_once 'PEAR.php';
+
+/**
+ * DB_common is the base class from which each database driver class extends
+ *
+ * All common methods are declared here.  If a given DBMS driver contains
+ * a particular method, that method will overload the one here.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Tomas V.V. Cox <cox at idecnet.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_common extends PEAR
+{
+    // {{{ properties
+
+    /**
+     * The current default fetch mode
+     * @var integer
+     */
+    var $fetchmode = DB_FETCHMODE_ORDERED;
+
+    /**
+     * The name of the class into which results should be fetched when
+     * DB_FETCHMODE_OBJECT is in effect
+     *
+     * @var string
+     */
+    var $fetchmode_object_class = 'stdClass';
+
+    /**
+     * Was a connection present when the object was serialized()?
+     * @var bool
+     * @see DB_common::__sleep(), DB_common::__wake()
+     */
+    var $was_connected = null;
+
+    /**
+     * The most recently executed query
+     * @var string
+     */
+    var $last_query = '';
+
+    /**
+     * Run-time configuration options
+     *
+     * The 'optimize' option has been deprecated.  Use the 'portability'
+     * option instead.
+     *
+     * @var array
+     * @see DB_common::setOption()
+     */
+    var $options = array(
+        'result_buffering' => 500,
+        'persistent' => false,
+        'ssl' => false,
+        'debug' => 0,
+        'seqname_format' => '%s_seq',
+        'autofree' => false,
+        'portability' => DB_PORTABILITY_NONE,
+        'optimize' => 'performance',  // Deprecated.  Use 'portability'.
+    );
+
+    /**
+     * The parameters from the most recently executed query
+     * @var array
+     * @since Property available since Release 1.7.0
+     */
+    var $last_parameters = array();
+
+    /**
+     * The elements from each prepared statement
+     * @var array
+     */
+    var $prepare_tokens = array();
+
+    /**
+     * The data types of the various elements in each prepared statement
+     * @var array
+     */
+    var $prepare_types = array();
+
+    /**
+     * The prepared queries
+     * @var array
+     */
+    var $prepared_queries = array();
+
+
+    // }}}
+    // {{{ DB_common
+
+    /**
+     * This constructor calls <kbd>$this->PEAR('DB_Error')</kbd>
+     *
+     * @return void
+     */
+    function DB_common()
+    {
+        $this->PEAR('DB_Error');
+    }
+
+    // }}}
+    // {{{ __sleep()
+
+    /**
+     * Automatically indicates which properties should be saved
+     * when PHP's serialize() function is called
+     *
+     * @return array  the array of properties names that should be saved
+     */
+    function __sleep()
+    {
+        if ($this->connection) {
+            // Don't disconnect(), people use serialize() for many reasons
+            $this->was_connected = true;
+        } else {
+            $this->was_connected = false;
+        }
+        if (isset($this->autocommit)) {
+            return array('autocommit',
+                         'dbsyntax',
+                         'dsn',
+                         'features',
+                         'fetchmode',
+                         'fetchmode_object_class',
+                         'options',
+                         'was_connected',
+                   );
+        } else {
+            return array('dbsyntax',
+                         'dsn',
+                         'features',
+                         'fetchmode',
+                         'fetchmode_object_class',
+                         'options',
+                         'was_connected',
+                   );
+        }
+    }
+
+    // }}}
+    // {{{ __wakeup()
+
+    /**
+     * Automatically reconnects to the database when PHP's unserialize()
+     * function is called
+     *
+     * The reconnection attempt is only performed if the object was connected
+     * at the time PHP's serialize() function was run.
+     *
+     * @return void
+     */
+    function __wakeup()
+    {
+        if ($this->was_connected) {
+            $this->connect($this->dsn, $this->options);
+        }
+    }
+
+    // }}}
+    // {{{ __toString()
+
+    /**
+     * Automatic string conversion for PHP 5
+     *
+     * @return string  a string describing the current PEAR DB object
+     *
+     * @since Method available since Release 1.7.0
+     */
+    function __toString()
+    {
+        $info = strtolower(get_class($this));
+        $info .=  ': (phptype=' . $this->phptype .
+                  ', dbsyntax=' . $this->dbsyntax .
+                  ')';
+        if ($this->connection) {
+            $info .= ' [connected]';
+        }
+        return $info;
+    }
+
+    // }}}
+    // {{{ toString()
+
+    /**
+     * DEPRECATED:  String conversion method
+     *
+     * @return string  a string describing the current PEAR DB object
+     *
+     * @deprecated Method deprecated in Release 1.7.0
+     */
+    function toString()
+    {
+        return $this->__toString();
+    }
+
+    // }}}
+    // {{{ quoteString()
+
+    /**
+     * DEPRECATED: Quotes a string so it can be safely used within string
+     * delimiters in a query
+     *
+     * @param string $string  the string to be quoted
+     *
+     * @return string  the quoted string
+     *
+     * @see DB_common::quoteSmart(), DB_common::escapeSimple()
+     * @deprecated Method deprecated some time before Release 1.2
+     */
+    function quoteString($string)
+    {
+        $string = $this->quote($string);
+        if ($string{0} == "'") {
+            return substr($string, 1, -1);
+        }
+        return $string;
+    }
+
+    // }}}
+    // {{{ quote()
+
+    /**
+     * DEPRECATED: Quotes a string so it can be safely used in a query
+     *
+     * @param string $string  the string to quote
+     *
+     * @return string  the quoted string or the string <samp>NULL</samp>
+     *                  if the value submitted is <kbd>null</kbd>.
+     *
+     * @see DB_common::quoteSmart(), DB_common::escapeSimple()
+     * @deprecated Deprecated in release 1.6.0
+     */
+    function quote($string = null)
+    {
+        return ($string === null) ? 'NULL'
+                                  : "'" . str_replace("'", "''", $string) . "'";
+    }
+
+    // }}}
+    // {{{ quoteIdentifier()
+
+    /**
+     * Quotes a string so it can be safely used as a table or column name
+     *
+     * Delimiting style depends on which database driver is being used.
+     *
+     * NOTE: just because you CAN use delimited identifiers doesn't mean
+     * you SHOULD use them.  In general, they end up causing way more
+     * problems than they solve.
+     *
+     * Portability is broken by using the following characters inside
+     * delimited identifiers:
+     *   + backtick (<kbd>`</kbd>) -- due to MySQL
+     *   + double quote (<kbd>"</kbd>) -- due to Oracle
+     *   + brackets (<kbd>[</kbd> or <kbd>]</kbd>) -- due to Access
+     *
+     * Delimited identifiers are known to generally work correctly under
+     * the following drivers:
+     *   + mssql
+     *   + mysql
+     *   + mysqli
+     *   + oci8
+     *   + odbc(access)
+     *   + odbc(db2)
+     *   + pgsql
+     *   + sqlite
+     *   + sybase (must execute <kbd>set quoted_identifier on</kbd> sometime
+     *     prior to use)
+     *
+     * InterBase doesn't seem to be able to use delimited identifiers
+     * via PHP 4.  They work fine under PHP 5.
+     *
+     * @param string $str  the identifier name to be quoted
+     *
+     * @return string  the quoted identifier
+     *
+     * @since Method available since Release 1.6.0
+     */
+    function quoteIdentifier($str)
+    {
+        return '"' . str_replace('"', '""', $str) . '"';
+    }
+
+    // }}}
+    // {{{ quoteSmart()
+
+    /**
+     * Formats input so it can be safely used in a query
+     *
+     * The output depends on the PHP data type of input and the database
+     * type being used.
+     *
+     * @param mixed $in  the data to be formatted
+     *
+     * @return mixed  the formatted data.  The format depends on the input's
+     *                 PHP type:
+     * <ul>
+     *  <li>
+     *    <kbd>input</kbd> -> <samp>returns</samp>
+     *  </li>
+     *  <li>
+     *    <kbd>null</kbd> -> the string <samp>NULL</samp>
+     *  </li>
+     *  <li>
+     *    <kbd>integer</kbd> or <kbd>double</kbd> -> the unquoted number
+     *  </li>
+     *  <li>
+     *    <kbd>bool</kbd> -> output depends on the driver in use
+     *    Most drivers return integers: <samp>1</samp> if
+     *    <kbd>true</kbd> or <samp>0</samp> if
+     *    <kbd>false</kbd>.
+     *    Some return strings: <samp>TRUE</samp> if
+     *    <kbd>true</kbd> or <samp>FALSE</samp> if
+     *    <kbd>false</kbd>.
+     *    Finally one returns strings: <samp>T</samp> if
+     *    <kbd>true</kbd> or <samp>F</samp> if
+     *    <kbd>false</kbd>. Here is a list of each DBMS,
+     *    the values returned and the suggested column type:
+     *    <ul>
+     *      <li>
+     *        <kbd>dbase</kbd> -> <samp>T/F</samp>
+     *        (<kbd>Logical</kbd>)
+     *      </li>
+     *      <li>
+     *        <kbd>fbase</kbd> -> <samp>TRUE/FALSE</samp>
+     *        (<kbd>BOOLEAN</kbd>)
+     *      </li>
+     *      <li>
+     *        <kbd>ibase</kbd> -> <samp>1/0</samp>
+     *        (<kbd>SMALLINT</kbd>) [1]
+     *      </li>
+     *      <li>
+     *        <kbd>ifx</kbd> -> <samp>1/0</samp>
+     *        (<kbd>SMALLINT</kbd>) [1]
+     *      </li>
+     *      <li>
+     *        <kbd>msql</kbd> -> <samp>1/0</samp>
+     *        (<kbd>INTEGER</kbd>)
+     *      </li>
+     *      <li>
+     *        <kbd>mssql</kbd> -> <samp>1/0</samp>
+     *        (<kbd>BIT</kbd>)
+     *      </li>
+     *      <li>
+     *        <kbd>mysql</kbd> -> <samp>1/0</samp>
+     *        (<kbd>TINYINT(1)</kbd>)
+     *      </li>
+     *      <li>
+     *        <kbd>mysqli</kbd> -> <samp>1/0</samp>
+     *        (<kbd>TINYINT(1)</kbd>)
+     *      </li>
+     *      <li>
+     *        <kbd>oci8</kbd> -> <samp>1/0</samp>
+     *        (<kbd>NUMBER(1)</kbd>)
+     *      </li>
+     *      <li>
+     *        <kbd>odbc</kbd> -> <samp>1/0</samp>
+     *        (<kbd>SMALLINT</kbd>) [1]
+     *      </li>
+     *      <li>
+     *        <kbd>pgsql</kbd> -> <samp>TRUE/FALSE</samp>
+     *        (<kbd>BOOLEAN</kbd>)
+     *      </li>
+     *      <li>
+     *        <kbd>sqlite</kbd> -> <samp>1/0</samp>
+     *        (<kbd>INTEGER</kbd>)
+     *      </li>
+     *      <li>
+     *        <kbd>sybase</kbd> -> <samp>1/0</samp>
+     *        (<kbd>TINYINT(1)</kbd>)
+     *      </li>
+     *    </ul>
+     *    [1] Accommodate the lowest common denominator because not all
+     *    versions of have <kbd>BOOLEAN</kbd>.
+     *  </li>
+     *  <li>
+     *    other (including strings and numeric strings) ->
+     *    the data with single quotes escaped by preceeding
+     *    single quotes, backslashes are escaped by preceeding
+     *    backslashes, then the whole string is encapsulated
+     *    between single quotes
+     *  </li>
+     * </ul>
+     *
+     * @see DB_common::escapeSimple()
+     * @since Method available since Release 1.6.0
+     */
+    function quoteSmart($in)
+    {
+        if (is_int($in) || is_double($in)) {
+            return $in;
+        } elseif (is_bool($in)) {
+            return $in ? 1 : 0;
+        } elseif (is_null($in)) {
+            return 'NULL';
+        } else {
+            return "'" . $this->escapeSimple($in) . "'";
+        }
+    }
+
+    // }}}
+    // {{{ escapeSimple()
+
+    /**
+     * Escapes a string according to the current DBMS's standards
+     *
+     * In SQLite, this makes things safe for inserts/updates, but may
+     * cause problems when performing text comparisons against columns
+     * containing binary data. See the
+     * {@link http://php.net/sqlite_escape_string PHP manual} for more info.
+     *
+     * @param string $str  the string to be escaped
+     *
+     * @return string  the escaped string
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function escapeSimple($str)
+    {
+        return str_replace("'", "''", $str);
+    }
+
+    // }}}
+    // {{{ provides()
+
+    /**
+     * Tells whether the present driver supports a given feature
+     *
+     * @param string $feature  the feature you're curious about
+     *
+     * @return bool  whether this driver supports $feature
+     */
+    function provides($feature)
+    {
+        return $this->features[$feature];
+    }
+
+    // }}}
+    // {{{ setFetchMode()
+
+    /**
+     * Sets the fetch mode that should be used by default for query results
+     *
+     * @param integer $fetchmode    DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC
+     *                               or DB_FETCHMODE_OBJECT
+     * @param string $object_class  the class name of the object to be returned
+     *                               by the fetch methods when the
+     *                               DB_FETCHMODE_OBJECT mode is selected.
+     *                               If no class is specified by default a cast
+     *                               to object from the assoc array row will be
+     *                               done.  There is also the posibility to use
+     *                               and extend the 'DB_row' class.
+     *
+     * @see DB_FETCHMODE_ORDERED, DB_FETCHMODE_ASSOC, DB_FETCHMODE_OBJECT
+     */
+    function setFetchMode($fetchmode, $object_class = 'stdClass')
+    {
+        switch ($fetchmode) {
+            case DB_FETCHMODE_OBJECT:
+                $this->fetchmode_object_class = $object_class;
+            case DB_FETCHMODE_ORDERED:
+            case DB_FETCHMODE_ASSOC:
+                $this->fetchmode = $fetchmode;
+                break;
+            default:
+                return $this->raiseError('invalid fetchmode mode');
+        }
+    }
+
+    // }}}
+    // {{{ setOption()
+
+    /**
+     * Sets run-time configuration options for PEAR DB
+     *
+     * Options, their data types, default values and description:
+     * <ul>
+     * <li>
+     * <var>autofree</var> <kbd>boolean</kbd> = <samp>false</samp>
+     *      <br />should results be freed automatically when there are no
+     *            more rows?
+     * </li><li>
+     * <var>result_buffering</var> <kbd>integer</kbd> = <samp>500</samp>
+     *      <br />how many rows of the result set should be buffered?
+     *      <br />In mysql: mysql_unbuffered_query() is used instead of
+     *            mysql_query() if this value is 0.  (Release 1.7.0)
+     *      <br />In oci8: this value is passed to ocisetprefetch().
+     *            (Release 1.7.0)
+     * </li><li>
+     * <var>debug</var> <kbd>integer</kbd> = <samp>0</samp>
+     *      <br />debug level
+     * </li><li>
+     * <var>persistent</var> <kbd>boolean</kbd> = <samp>false</samp>
+     *      <br />should the connection be persistent?
+     * </li><li>
+     * <var>portability</var> <kbd>integer</kbd> = <samp>DB_PORTABILITY_NONE</samp>
+     *      <br />portability mode constant (see below)
+     * </li><li>
+     * <var>seqname_format</var> <kbd>string</kbd> = <samp>%s_seq</samp>
+     *      <br />the sprintf() format string used on sequence names.  This
+     *            format is applied to sequence names passed to
+     *            createSequence(), nextID() and dropSequence().
+     * </li><li>
+     * <var>ssl</var> <kbd>boolean</kbd> = <samp>false</samp>
+     *      <br />use ssl to connect?
+     * </li>
+     * </ul>
+     *
+     * -----------------------------------------
+     *
+     * PORTABILITY MODES
+     *
+     * These modes are bitwised, so they can be combined using <kbd>|</kbd>
+     * and removed using <kbd>^</kbd>.  See the examples section below on how
+     * to do this.
+     *
+     * <samp>DB_PORTABILITY_NONE</samp>
+     * turn off all portability features
+     *
+     * This mode gets automatically turned on if the deprecated
+     * <var>optimize</var> option gets set to <samp>performance</samp>.
+     *
+     *
+     * <samp>DB_PORTABILITY_LOWERCASE</samp>
+     * convert names of tables and fields to lower case when using
+     * <kbd>get*()</kbd>, <kbd>fetch*()</kbd> and <kbd>tableInfo()</kbd>
+     *
+     * This mode gets automatically turned on in the following databases
+     * if the deprecated option <var>optimize</var> gets set to
+     * <samp>portability</samp>:
+     * + oci8
+     *
+     *
+     * <samp>DB_PORTABILITY_RTRIM</samp>
+     * right trim the data output by <kbd>get*()</kbd> <kbd>fetch*()</kbd>
+     *
+     *
+     * <samp>DB_PORTABILITY_DELETE_COUNT</samp>
+     * force reporting the number of rows deleted
+     *
+     * Some DBMS's don't count the number of rows deleted when performing
+     * simple <kbd>DELETE FROM tablename</kbd> queries.  This portability
+     * mode tricks such DBMS's into telling the count by adding
+     * <samp>WHERE 1=1</samp> to the end of <kbd>DELETE</kbd> queries.
+     *
+     * This mode gets automatically turned on in the following databases
+     * if the deprecated option <var>optimize</var> gets set to
+     * <samp>portability</samp>:
+     * + fbsql
+     * + mysql
+     * + mysqli
+     * + sqlite
+     *
+     *
+     * <samp>DB_PORTABILITY_NUMROWS</samp>
+     * enable hack that makes <kbd>numRows()</kbd> work in Oracle
+     *
+     * This mode gets automatically turned on in the following databases
+     * if the deprecated option <var>optimize</var> gets set to
+     * <samp>portability</samp>:
+     * + oci8
+     *
+     *
+     * <samp>DB_PORTABILITY_ERRORS</samp>
+     * makes certain error messages in certain drivers compatible
+     * with those from other DBMS's
+     *
+     * + mysql, mysqli:  change unique/primary key constraints
+     *   DB_ERROR_ALREADY_EXISTS -> DB_ERROR_CONSTRAINT
+     *
+     * + odbc(access):  MS's ODBC driver reports 'no such field' as code
+     *   07001, which means 'too few parameters.'  When this option is on
+     *   that code gets mapped to DB_ERROR_NOSUCHFIELD.
+     *   DB_ERROR_MISMATCH -> DB_ERROR_NOSUCHFIELD
+     *
+     * <samp>DB_PORTABILITY_NULL_TO_EMPTY</samp>
+     * convert null values to empty strings in data output by get*() and
+     * fetch*().  Needed because Oracle considers empty strings to be null,
+     * while most other DBMS's know the difference between empty and null.
+     *
+     *
+     * <samp>DB_PORTABILITY_ALL</samp>
+     * turn on all portability features
+     *
+     * -----------------------------------------
+     *
+     * Example 1. Simple setOption() example
+     * <code>
+     * $db->setOption('autofree', true);
+     * </code>
+     *
+     * Example 2. Portability for lowercasing and trimming
+     * <code>
+     * $db->setOption('portability',
+     *                 DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_RTRIM);
+     * </code>
+     *
+     * Example 3. All portability options except trimming
+     * <code>
+     * $db->setOption('portability',
+     *                 DB_PORTABILITY_ALL ^ DB_PORTABILITY_RTRIM);
+     * </code>
+     *
+     * @param string $option option name
+     * @param mixed  $value value for the option
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::$options
+     */
+    function setOption($option, $value)
+    {
+        if (isset($this->options[$option])) {
+            $this->options[$option] = $value;
+
+            /*
+             * Backwards compatibility check for the deprecated 'optimize'
+             * option.  Done here in case settings change after connecting.
+             */
+            if ($option == 'optimize') {
+                if ($value == 'portability') {
+                    switch ($this->phptype) {
+                        case 'oci8':
+                            $this->options['portability'] =
+                                    DB_PORTABILITY_LOWERCASE |
+                                    DB_PORTABILITY_NUMROWS;
+                            break;
+                        case 'fbsql':
+                        case 'mysql':
+                        case 'mysqli':
+                        case 'sqlite':
+                            $this->options['portability'] =
+                                    DB_PORTABILITY_DELETE_COUNT;
+                            break;
+                    }
+                } else {
+                    $this->options['portability'] = DB_PORTABILITY_NONE;
+                }
+            }
+
+            return DB_OK;
+        }
+        return $this->raiseError("unknown option $option");
+    }
+
+    // }}}
+    // {{{ getOption()
+
+    /**
+     * Returns the value of an option
+     *
+     * @param string $option  the option name you're curious about
+     *
+     * @return mixed  the option's value
+     */
+    function getOption($option)
+    {
+        if (isset($this->options[$option])) {
+            return $this->options[$option];
+        }
+        return $this->raiseError("unknown option $option");
+    }
+
+    // }}}
+    // {{{ prepare()
+
+    /**
+     * Prepares a query for multiple execution with execute()
+     *
+     * Creates a query that can be run multiple times.  Each time it is run,
+     * the placeholders, if any, will be replaced by the contents of
+     * execute()'s $data argument.
+     *
+     * Three types of placeholders can be used:
+     *   + <kbd>?</kbd>  scalar value (i.e. strings, integers).  The system
+     *                   will automatically quote and escape the data.
+     *   + <kbd>!</kbd>  value is inserted 'as is'
+     *   + <kbd>&</kbd>  requires a file name.  The file's contents get
+     *                   inserted into the query (i.e. saving binary
+     *                   data in a db)
+     *
+     * Example 1.
+     * <code>
+     * $sth = $db->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)');
+     * $data = array(
+     *     "John's text",
+     *     "'it''s good'",
+     *     'filename.txt'
+     * );
+     * $res = $db->execute($sth, $data);
+     * </code>
+     *
+     * Use backslashes to escape placeholder characters if you don't want
+     * them to be interpreted as placeholders:
+     * <pre>
+     *    "UPDATE foo SET col=? WHERE col='over \& under'"
+     * </pre>
+     *
+     * With some database backends, this is emulated.
+     *
+     * {@internal ibase and oci8 have their own prepare() methods.}}
+     *
+     * @param string $query  the query to be prepared
+     *
+     * @return mixed  DB statement resource on success. A DB_Error object
+     *                 on failure.
+     *
+     * @see DB_common::execute()
+     */
+    function prepare($query)
+    {
+        $tokens   = preg_split('/((?<!\\\)[&?!])/', $query, -1,
+                               PREG_SPLIT_DELIM_CAPTURE);
+        $token     = 0;
+        $types     = array();
+        $newtokens = array();
+
+        foreach ($tokens as $val) {
+            switch ($val) {
+                case '?':
+                    $types[$token++] = DB_PARAM_SCALAR;
+                    break;
+                case '&':
+                    $types[$token++] = DB_PARAM_OPAQUE;
+                    break;
+                case '!':
+                    $types[$token++] = DB_PARAM_MISC;
+                    break;
+                default:
+                    $newtokens[] = preg_replace('/\\\([&?!])/', "\\1", $val);
+            }
+        }
+
+        $this->prepare_tokens[] = &$newtokens;
+        end($this->prepare_tokens);
+
+        $k = key($this->prepare_tokens);
+        $this->prepare_types[$k] = $types;
+        $this->prepared_queries[$k] = implode(' ', $newtokens);
+
+        return $k;
+    }
+
+    // }}}
+    // {{{ autoPrepare()
+
+    /**
+     * Automaticaly generates an insert or update query and pass it to prepare()
+     *
+     * @param string $table         the table name
+     * @param array  $table_fields  the array of field names
+     * @param int    $mode          a type of query to make:
+     *                               DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE
+     * @param string $where         for update queries: the WHERE clause to
+     *                               append to the SQL statement.  Don't
+     *                               include the "WHERE" keyword.
+     *
+     * @return resource  the query handle
+     *
+     * @uses DB_common::prepare(), DB_common::buildManipSQL()
+     */
+    function autoPrepare($table, $table_fields, $mode = DB_AUTOQUERY_INSERT,
+                         $where = false)
+    {
+        $query = $this->buildManipSQL($table, $table_fields, $mode, $where);
+        if (DB::isError($query)) {
+            return $query;
+        }
+        return $this->prepare($query);
+    }
+
+    // }}}
+    // {{{ autoExecute()
+
+    /**
+     * Automaticaly generates an insert or update query and call prepare()
+     * and execute() with it
+     *
+     * @param string $table         the table name
+     * @param array  $fields_values the associative array where $key is a
+     *                               field name and $value its value
+     * @param int    $mode          a type of query to make:
+     *                               DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE
+     * @param string $where         for update queries: the WHERE clause to
+     *                               append to the SQL statement.  Don't
+     *                               include the "WHERE" keyword.
+     *
+     * @return mixed  a new DB_result object for successful SELECT queries
+     *                 or DB_OK for successul data manipulation queries.
+     *                 A DB_Error object on failure.
+     *
+     * @uses DB_common::autoPrepare(), DB_common::execute()
+     */
+    function autoExecute($table, $fields_values, $mode = DB_AUTOQUERY_INSERT,
+                         $where = false)
+    {
+        $sth = $this->autoPrepare($table, array_keys($fields_values), $mode,
+                                  $where);
+        if (DB::isError($sth)) {
+            return $sth;
+        }
+        $ret =& $this->execute($sth, array_values($fields_values));
+        $this->freePrepared($sth);
+        return $ret;
+
+    }
+
+    // }}}
+    // {{{ buildManipSQL()
+
+    /**
+     * Produces an SQL query string for autoPrepare()
+     *
+     * Example:
+     * <pre>
+     * buildManipSQL('table_sql', array('field1', 'field2', 'field3'),
+     *               DB_AUTOQUERY_INSERT);
+     * </pre>
+     *
+     * That returns
+     * <samp>
+     * INSERT INTO table_sql (field1,field2,field3) VALUES (?,?,?)
+     * </samp>
+     *
+     * NOTES:
+     *   - This belongs more to a SQL Builder class, but this is a simple
+     *     facility.
+     *   - Be carefull! If you don't give a $where param with an UPDATE
+     *     query, all the records of the table will be updated!
+     *
+     * @param string $table         the table name
+     * @param array  $table_fields  the array of field names
+     * @param int    $mode          a type of query to make:
+     *                               DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE
+     * @param string $where         for update queries: the WHERE clause to
+     *                               append to the SQL statement.  Don't
+     *                               include the "WHERE" keyword.
+     *
+     * @return string  the sql query for autoPrepare()
+     */
+    function buildManipSQL($table, $table_fields, $mode, $where = false)
+    {
+        if (count($table_fields) == 0) {
+            return $this->raiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+        $first = true;
+        switch ($mode) {
+            case DB_AUTOQUERY_INSERT:
+                $values = '';
+                $names = '';
+                foreach ($table_fields as $value) {
+                    if ($first) {
+                        $first = false;
+                    } else {
+                        $names .= ',';
+                        $values .= ',';
+                    }
+                    $names .= $value;
+                    $values .= '?';
+                }
+                return "INSERT INTO $table ($names) VALUES ($values)";
+            case DB_AUTOQUERY_UPDATE:
+                $set = '';
+                foreach ($table_fields as $value) {
+                    if ($first) {
+                        $first = false;
+                    } else {
+                        $set .= ',';
+                    }
+                    $set .= "$value = ?";
+                }
+                $sql = "UPDATE $table SET $set";
+                if ($where) {
+                    $sql .= " WHERE $where";
+                }
+                return $sql;
+            default:
+                return $this->raiseError(DB_ERROR_SYNTAX);
+        }
+    }
+
+    // }}}
+    // {{{ execute()
+
+    /**
+     * Executes a DB statement prepared with prepare()
+     *
+     * Example 1.
+     * <code>
+     * $sth = $db->prepare('INSERT INTO tbl (a, b, c) VALUES (?, !, &)');
+     * $data = array(
+     *     "John's text",
+     *     "'it''s good'",
+     *     'filename.txt'
+     * );
+     * $res =& $db->execute($sth, $data);
+     * </code>
+     *
+     * @param resource $stmt  a DB statement resource returned from prepare()
+     * @param mixed    $data  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return mixed  a new DB_result object for successful SELECT queries
+     *                 or DB_OK for successul data manipulation queries.
+     *                 A DB_Error object on failure.
+     *
+     * {@internal ibase and oci8 have their own execute() methods.}}
+     *
+     * @see DB_common::prepare()
+     */
+    function &execute($stmt, $data = array())
+    {
+        $realquery = $this->executeEmulateQuery($stmt, $data);
+        if (DB::isError($realquery)) {
+            return $realquery;
+        }
+        $result = $this->simpleQuery($realquery);
+
+        if ($result === DB_OK || DB::isError($result)) {
+            return $result;
+        } else {
+            $tmp =& new DB_result($this, $result);
+            return $tmp;
+        }
+    }
+
+    // }}}
+    // {{{ executeEmulateQuery()
+
+    /**
+     * Emulates executing prepared statements if the DBMS not support them
+     *
+     * @param resource $stmt  a DB statement resource returned from execute()
+     * @param mixed    $data  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return mixed  a string containing the real query run when emulating
+     *                 prepare/execute.  A DB_Error object on failure.
+     *
+     * @access protected
+     * @see DB_common::execute()
+     */
+    function executeEmulateQuery($stmt, $data = array())
+    {
+        $stmt = (int)$stmt;
+        $data = (array)$data;
+        $this->last_parameters = $data;
+
+        if (count($this->prepare_types[$stmt]) != count($data)) {
+            $this->last_query = $this->prepared_queries[$stmt];
+            return $this->raiseError(DB_ERROR_MISMATCH);
+        }
+
+        $realquery = $this->prepare_tokens[$stmt][0];
+
+        $i = 0;
+        foreach ($data as $value) {
+            if ($this->prepare_types[$stmt][$i] == DB_PARAM_SCALAR) {
+                $realquery .= $this->quoteSmart($value);
+            } elseif ($this->prepare_types[$stmt][$i] == DB_PARAM_OPAQUE) {
+                $fp = @fopen($value, 'rb');
+                if (!$fp) {
+                    return $this->raiseError(DB_ERROR_ACCESS_VIOLATION);
+                }
+                $realquery .= $this->quoteSmart(fread($fp, filesize($value)));
+                fclose($fp);
+            } else {
+                $realquery .= $value;
+            }
+
+            $realquery .= $this->prepare_tokens[$stmt][++$i];
+        }
+
+        return $realquery;
+    }
+
+    // }}}
+    // {{{ executeMultiple()
+
+    /**
+     * Performs several execute() calls on the same statement handle
+     *
+     * $data must be an array indexed numerically
+     * from 0, one execute call is done for every "row" in the array.
+     *
+     * If an error occurs during execute(), executeMultiple() does not
+     * execute the unfinished rows, but rather returns that error.
+     *
+     * @param resource $stmt  query handle from prepare()
+     * @param array    $data  numeric array containing the
+     *                         data to insert into the query
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::prepare(), DB_common::execute()
+     */
+    function executeMultiple($stmt, $data)
+    {
+        foreach ($data as $value) {
+            $res =& $this->execute($stmt, $value);
+            if (DB::isError($res)) {
+                return $res;
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freePrepared()
+
+    /**
+     * Frees the internal resources associated with a prepared query
+     *
+     * @param resource $stmt           the prepared statement's PHP resource
+     * @param bool     $free_resource  should the PHP resource be freed too?
+     *                                  Use false if you need to get data
+     *                                  from the result set later.
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_common::prepare()
+     */
+    function freePrepared($stmt, $free_resource = true)
+    {
+        $stmt = (int)$stmt;
+        if (isset($this->prepare_tokens[$stmt])) {
+            unset($this->prepare_tokens[$stmt]);
+            unset($this->prepare_types[$stmt]);
+            unset($this->prepared_queries[$stmt]);
+            return true;
+        }
+        return false;
+    }
+
+    // }}}
+    // {{{ modifyQuery()
+
+    /**
+     * Changes a query string for various DBMS specific reasons
+     *
+     * It is defined here to ensure all drivers have this method available.
+     *
+     * @param string $query  the query string to modify
+     *
+     * @return string  the modified query string
+     *
+     * @access protected
+     * @see DB_mysql::modifyQuery(), DB_oci8::modifyQuery(),
+     *      DB_sqlite::modifyQuery()
+     */
+    function modifyQuery($query)
+    {
+        return $query;
+    }
+
+    // }}}
+    // {{{ modifyLimitQuery()
+
+    /**
+     * Adds LIMIT clauses to a query string according to current DBMS standards
+     *
+     * It is defined here to assure that all implementations
+     * have this method defined.
+     *
+     * @param string $query   the query to modify
+     * @param int    $from    the row to start to fetching (0 = the first row)
+     * @param int    $count   the numbers of rows to fetch
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return string  the query string with LIMIT clauses added
+     *
+     * @access protected
+     */
+    function modifyLimitQuery($query, $from, $count, $params = array())
+    {
+        return $query;
+    }
+
+    // }}}
+    // {{{ query()
+
+    /**
+     * Sends a query to the database server
+     *
+     * The query string can be either a normal statement to be sent directly
+     * to the server OR if <var>$params</var> are passed the query can have
+     * placeholders and it will be passed through prepare() and execute().
+     *
+     * @param string $query   the SQL query or the statement to prepare
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return mixed  a new DB_result object for successful SELECT queries
+     *                 or DB_OK for successul data manipulation queries.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_result, DB_common::prepare(), DB_common::execute()
+     */
+    function &query($query, $params = array())
+    {
+        if (sizeof($params) > 0) {
+            $sth = $this->prepare($query);
+            if (DB::isError($sth)) {
+                return $sth;
+            }
+            $ret =& $this->execute($sth, $params);
+            $this->freePrepared($sth, false);
+            return $ret;
+        } else {
+            $this->last_parameters = array();
+            $result = $this->simpleQuery($query);
+            if ($result === DB_OK || DB::isError($result)) {
+                return $result;
+            } else {
+                $tmp =& new DB_result($this, $result);
+                return $tmp;
+            }
+        }
+    }
+
+    // }}}
+    // {{{ limitQuery()
+
+    /**
+     * Generates and executes a LIMIT query
+     *
+     * @param string $query   the query
+     * @param intr   $from    the row to start to fetching (0 = the first row)
+     * @param int    $count   the numbers of rows to fetch
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return mixed  a new DB_result object for successful SELECT queries
+     *                 or DB_OK for successul data manipulation queries.
+     *                 A DB_Error object on failure.
+     */
+    function &limitQuery($query, $from, $count, $params = array())
+    {
+        $query = $this->modifyLimitQuery($query, $from, $count, $params);
+        if (DB::isError($query)){
+            return $query;
+        }
+        $result =& $this->query($query, $params);
+        if (is_a($result, 'DB_result')) {
+            $result->setOption('limit_from', $from);
+            $result->setOption('limit_count', $count);
+        }
+        return $result;
+    }
+
+    // }}}
+    // {{{ getOne()
+
+    /**
+     * Fetches the first column of the first row from a query result
+     *
+     * Takes care of doing the query and freeing the results when finished.
+     *
+     * @param string $query   the SQL query
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return mixed  the returned value of the query.
+     *                 A DB_Error object on failure.
+     */
+    function &getOne($query, $params = array())
+    {
+        $params = (array)$params;
+        // modifyLimitQuery() would be nice here, but it causes BC issues
+        if (sizeof($params) > 0) {
+            $sth = $this->prepare($query);
+            if (DB::isError($sth)) {
+                return $sth;
+            }
+            $res =& $this->execute($sth, $params);
+            $this->freePrepared($sth);
+        } else {
+            $res =& $this->query($query);
+        }
+
+        if (DB::isError($res)) {
+            return $res;
+        }
+
+        $err = $res->fetchInto($row, DB_FETCHMODE_ORDERED);
+        $res->free();
+
+        if ($err !== DB_OK) {
+            return $err;
+        }
+
+        return $row[0];
+    }
+
+    // }}}
+    // {{{ getRow()
+
+    /**
+     * Fetches the first row of data returned from a query result
+     *
+     * Takes care of doing the query and freeing the results when finished.
+     *
+     * @param string $query   the SQL query
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     * @param int $fetchmode  the fetch mode to use
+     *
+     * @return array  the first row of results as an array.
+     *                 A DB_Error object on failure.
+     */
+    function &getRow($query, $params = array(),
+                     $fetchmode = DB_FETCHMODE_DEFAULT)
+    {
+        // compat check, the params and fetchmode parameters used to
+        // have the opposite order
+        if (!is_array($params)) {
+            if (is_array($fetchmode)) {
+                if ($params === null) {
+                    $tmp = DB_FETCHMODE_DEFAULT;
+                } else {
+                    $tmp = $params;
+                }
+                $params = $fetchmode;
+                $fetchmode = $tmp;
+            } elseif ($params !== null) {
+                $fetchmode = $params;
+                $params = array();
+            }
+        }
+        // modifyLimitQuery() would be nice here, but it causes BC issues
+        if (sizeof($params) > 0) {
+            $sth = $this->prepare($query);
+            if (DB::isError($sth)) {
+                return $sth;
+            }
+            $res =& $this->execute($sth, $params);
+            $this->freePrepared($sth);
+        } else {
+            $res =& $this->query($query);
+        }
+
+        if (DB::isError($res)) {
+            return $res;
+        }
+
+        $err = $res->fetchInto($row, $fetchmode);
+
+        $res->free();
+
+        if ($err !== DB_OK) {
+            return $err;
+        }
+
+        return $row;
+    }
+
+    // }}}
+    // {{{ getCol()
+
+    /**
+     * Fetches a single column from a query result and returns it as an
+     * indexed array
+     *
+     * @param string $query   the SQL query
+     * @param mixed  $col     which column to return (integer [column number,
+     *                         starting at 0] or string [column name])
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return array  the results as an array.  A DB_Error object on failure.
+     *
+     * @see DB_common::query()
+     */
+    function &getCol($query, $col = 0, $params = array())
+    {
+        $params = (array)$params;
+        if (sizeof($params) > 0) {
+            $sth = $this->prepare($query);
+
+            if (DB::isError($sth)) {
+                return $sth;
+            }
+
+            $res =& $this->execute($sth, $params);
+            $this->freePrepared($sth);
+        } else {
+            $res =& $this->query($query);
+        }
+
+        if (DB::isError($res)) {
+            return $res;
+        }
+
+        $fetchmode = is_int($col) ? DB_FETCHMODE_ORDERED : DB_FETCHMODE_ASSOC;
+
+        if (!is_array($row = $res->fetchRow($fetchmode))) {
+            $ret = array();
+        } else {
+            if (!array_key_exists($col, $row)) {
+                $ret =& $this->raiseError(DB_ERROR_NOSUCHFIELD);
+            } else {
+                $ret = array($row[$col]);
+                while (is_array($row = $res->fetchRow($fetchmode))) {
+                    $ret[] = $row[$col];
+                }
+            }
+        }
+
+        $res->free();
+
+        if (DB::isError($row)) {
+            $ret = $row;
+        }
+
+        return $ret;
+    }
+
+    // }}}
+    // {{{ getAssoc()
+
+    /**
+     * Fetches an entire query result and returns it as an
+     * associative array using the first column as the key
+     *
+     * If the result set contains more than two columns, the value
+     * will be an array of the values from column 2-n.  If the result
+     * set contains only two columns, the returned value will be a
+     * scalar with the value of the second column (unless forced to an
+     * array with the $force_array parameter).  A DB error code is
+     * returned on errors.  If the result set contains fewer than two
+     * columns, a DB_ERROR_TRUNCATED error is returned.
+     *
+     * For example, if the table "mytable" contains:
+     *
+     * <pre>
+     *  ID      TEXT       DATE
+     * --------------------------------
+     *  1       'one'      944679408
+     *  2       'two'      944679408
+     *  3       'three'    944679408
+     * </pre>
+     *
+     * Then the call getAssoc('SELECT id,text FROM mytable') returns:
+     * <pre>
+     *   array(
+     *     '1' => 'one',
+     *     '2' => 'two',
+     *     '3' => 'three',
+     *   )
+     * </pre>
+     *
+     * ...while the call getAssoc('SELECT id,text,date FROM mytable') returns:
+     * <pre>
+     *   array(
+     *     '1' => array('one', '944679408'),
+     *     '2' => array('two', '944679408'),
+     *     '3' => array('three', '944679408')
+     *   )
+     * </pre>
+     *
+     * If the more than one row occurs with the same value in the
+     * first column, the last row overwrites all previous ones by
+     * default.  Use the $group parameter if you don't want to
+     * overwrite like this.  Example:
+     *
+     * <pre>
+     * getAssoc('SELECT category,id,name FROM mytable', false, null,
+     *          DB_FETCHMODE_ASSOC, true) returns:
+     *
+     *   array(
+     *     '1' => array(array('id' => '4', 'name' => 'number four'),
+     *                  array('id' => '6', 'name' => 'number six')
+     *            ),
+     *     '9' => array(array('id' => '4', 'name' => 'number four'),
+     *                  array('id' => '6', 'name' => 'number six')
+     *            )
+     *   )
+     * </pre>
+     *
+     * Keep in mind that database functions in PHP usually return string
+     * values for results regardless of the database's internal type.
+     *
+     * @param string $query        the SQL query
+     * @param bool   $force_array  used only when the query returns
+     *                              exactly two columns.  If true, the values
+     *                              of the returned array will be one-element
+     *                              arrays instead of scalars.
+     * @param mixed  $params       array, string or numeric data to be used in
+     *                              execution of the statement.  Quantity of
+     *                              items passed must match quantity of
+     *                              placeholders in query:  meaning 1
+     *                              placeholder for non-array parameters or
+     *                              1 placeholder per array element.
+     * @param int   $fetchmode     the fetch mode to use
+     * @param bool  $group         if true, the values of the returned array
+     *                              is wrapped in another array.  If the same
+     *                              key value (in the first column) repeats
+     *                              itself, the values will be appended to
+     *                              this array instead of overwriting the
+     *                              existing values.
+     *
+     * @return array  the associative array containing the query results.
+     *                A DB_Error object on failure.
+     */
+    function &getAssoc($query, $force_array = false, $params = array(),
+                       $fetchmode = DB_FETCHMODE_DEFAULT, $group = false)
+    {
+        $params = (array)$params;
+        if (sizeof($params) > 0) {
+            $sth = $this->prepare($query);
+
+            if (DB::isError($sth)) {
+                return $sth;
+            }
+
+            $res =& $this->execute($sth, $params);
+            $this->freePrepared($sth);
+        } else {
+            $res =& $this->query($query);
+        }
+
+        if (DB::isError($res)) {
+            return $res;
+        }
+        if ($fetchmode == DB_FETCHMODE_DEFAULT) {
+            $fetchmode = $this->fetchmode;
+        }
+        $cols = $res->numCols();
+
+        if ($cols < 2) {
+            $tmp =& $this->raiseError(DB_ERROR_TRUNCATED);
+            return $tmp;
+        }
+
+        $results = array();
+
+        if ($cols > 2 || $force_array) {
+            // return array values
+            // XXX this part can be optimized
+            if ($fetchmode == DB_FETCHMODE_ASSOC) {
+                while (is_array($row = $res->fetchRow(DB_FETCHMODE_ASSOC))) {
+                    reset($row);
+                    $key = current($row);
+                    unset($row[key($row)]);
+                    if ($group) {
+                        $results[$key][] = $row;
+                    } else {
+                        $results[$key] = $row;
+                    }
+                }
+            } elseif ($fetchmode == DB_FETCHMODE_OBJECT) {
+                while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
+                    $arr = get_object_vars($row);
+                    $key = current($arr);
+                    if ($group) {
+                        $results[$key][] = $row;
+                    } else {
+                        $results[$key] = $row;
+                    }
+                }
+            } else {
+                while (is_array($row = $res->fetchRow(DB_FETCHMODE_ORDERED))) {
+                    // we shift away the first element to get
+                    // indices running from 0 again
+                    $key = array_shift($row);
+                    if ($group) {
+                        $results[$key][] = $row;
+                    } else {
+                        $results[$key] = $row;
+                    }
+                }
+            }
+            if (DB::isError($row)) {
+                $results = $row;
+            }
+        } else {
+            // return scalar values
+            while (is_array($row = $res->fetchRow(DB_FETCHMODE_ORDERED))) {
+                if ($group) {
+                    $results[$row[0]][] = $row[1];
+                } else {
+                    $results[$row[0]] = $row[1];
+                }
+            }
+            if (DB::isError($row)) {
+                $results = $row;
+            }
+        }
+
+        $res->free();
+
+        return $results;
+    }
+
+    // }}}
+    // {{{ getAll()
+
+    /**
+     * Fetches all of the rows from a query result
+     *
+     * @param string $query      the SQL query
+     * @param mixed  $params     array, string or numeric data to be used in
+     *                            execution of the statement.  Quantity of
+     *                            items passed must match quantity of
+     *                            placeholders in query:  meaning 1
+     *                            placeholder for non-array parameters or
+     *                            1 placeholder per array element.
+     * @param int    $fetchmode  the fetch mode to use:
+     *                            + DB_FETCHMODE_ORDERED
+     *                            + DB_FETCHMODE_ASSOC
+     *                            + DB_FETCHMODE_ORDERED | DB_FETCHMODE_FLIPPED
+     *                            + DB_FETCHMODE_ASSOC | DB_FETCHMODE_FLIPPED
+     *
+     * @return array  the nested array.  A DB_Error object on failure.
+     */
+    function &getAll($query, $params = array(),
+                     $fetchmode = DB_FETCHMODE_DEFAULT)
+    {
+        // compat check, the params and fetchmode parameters used to
+        // have the opposite order
+        if (!is_array($params)) {
+            if (is_array($fetchmode)) {
+                if ($params === null) {
+                    $tmp = DB_FETCHMODE_DEFAULT;
+                } else {
+                    $tmp = $params;
+                }
+                $params = $fetchmode;
+                $fetchmode = $tmp;
+            } elseif ($params !== null) {
+                $fetchmode = $params;
+                $params = array();
+            }
+        }
+
+        if (sizeof($params) > 0) {
+            $sth = $this->prepare($query);
+
+            if (DB::isError($sth)) {
+                return $sth;
+            }
+
+            $res =& $this->execute($sth, $params);
+            $this->freePrepared($sth);
+        } else {
+            $res =& $this->query($query);
+        }
+
+        if ($res === DB_OK || DB::isError($res)) {
+            return $res;
+        }
+
+        $results = array();
+        while (DB_OK === $res->fetchInto($row, $fetchmode)) {
+            if ($fetchmode & DB_FETCHMODE_FLIPPED) {
+                foreach ($row as $key => $val) {
+                    $results[$key][] = $val;
+                }
+            } else {
+                $results[] = $row;
+            }
+        }
+
+        $res->free();
+
+        if (DB::isError($row)) {
+            $tmp =& $this->raiseError($row);
+            return $tmp;
+        }
+        return $results;
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = false)
+    {
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Determines the number of rows in a query result
+     *
+     * @param resource $result  the query result idenifier produced by PHP
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function numRows($result)
+    {
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ getSequenceName()
+
+    /**
+     * Generates the name used inside the database for a sequence
+     *
+     * The createSequence() docblock contains notes about storing sequence
+     * names.
+     *
+     * @param string $sqn  the sequence's public name
+     *
+     * @return string  the sequence's name in the backend
+     *
+     * @access protected
+     * @see DB_common::createSequence(), DB_common::dropSequence(),
+     *      DB_common::nextID(), DB_common::setOption()
+     */
+    function getSequenceName($sqn)
+    {
+        return sprintf($this->getOption('seqname_format'),
+                       preg_replace('/[^a-z0-9_.]/i', '_', $sqn));
+    }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::dropSequence(),
+     *      DB_common::getSequenceName()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ createSequence()
+
+    /**
+     * Creates a new sequence
+     *
+     * The name of a given sequence is determined by passing the string
+     * provided in the <var>$seq_name</var> argument through PHP's sprintf()
+     * function using the value from the <var>seqname_format</var> option as
+     * the sprintf()'s format argument.
+     *
+     * <var>seqname_format</var> is set via setOption().
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_common::nextID()
+     */
+    function createSequence($seq_name)
+    {
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_common::nextID()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ raiseError()
+
+    /**
+     * Communicates an error and invoke error callbacks, etc
+     *
+     * Basically a wrapper for PEAR::raiseError without the message string.
+     *
+     * @param mixed   integer error code, or a PEAR error object (all
+     *                 other parameters are ignored if this parameter is
+     *                 an object
+     * @param int     error mode, see PEAR_Error docs
+     * @param mixed   if error mode is PEAR_ERROR_TRIGGER, this is the
+     *                 error level (E_USER_NOTICE etc).  If error mode is
+     *                 PEAR_ERROR_CALLBACK, this is the callback function,
+     *                 either as a function name, or as an array of an
+     *                 object and method name.  For other error modes this
+     *                 parameter is ignored.
+     * @param string  extra debug information.  Defaults to the last
+     *                 query and native error code.
+     * @param mixed   native error code, integer or string depending the
+     *                 backend
+     *
+     * @return object  the PEAR_Error object
+     *
+     * @see PEAR_Error
+     */
+    function &raiseError($code = DB_ERROR, $mode = null, $options = null,
+                         $userinfo = null, $nativecode = null)
+    {
+        // The error is yet a DB error object
+        if (is_object($code)) {
+            // because we the static PEAR::raiseError, our global
+            // handler should be used if it is set
+            if ($mode === null && !empty($this->_default_error_mode)) {
+                $mode    = $this->_default_error_mode;
+                $options = $this->_default_error_options;
+            }
+            $tmp = PEAR::raiseError($code, null, $mode, $options,
+                                    null, null, true);
+            return $tmp;
+        }
+
+        if ($userinfo === null) {
+            $userinfo = $this->last_query;
+        }
+
+        if ($nativecode) {
+            $userinfo .= ' [nativecode=' . trim($nativecode) . ']';
+        } else {
+            $userinfo .= ' [DB Error: ' . DB::errorMessage($code) . ']';
+        }
+
+        $tmp = PEAR::raiseError(null, $code, $mode, $options, $userinfo,
+                                'DB_Error', true);
+        return $tmp;
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error code produced by the last query
+     *
+     * @return mixed  the DBMS' error code.  A DB_Error object on failure.
+     */
+    function errorNative()
+    {
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ errorCode()
+
+    /**
+     * Maps native error codes to DB's portable ones
+     *
+     * Uses the <var>$errorcode_map</var> property defined in each driver.
+     *
+     * @param string|int $nativecode  the error code returned by the DBMS
+     *
+     * @return int  the portable DB error code.  Return DB_ERROR if the
+     *               current driver doesn't have a mapping for the
+     *               $nativecode submitted.
+     */
+    function errorCode($nativecode)
+    {
+        if (isset($this->errorcode_map[$nativecode])) {
+            return $this->errorcode_map[$nativecode];
+        }
+        // Fall back to DB_ERROR if there was no mapping.
+        return DB_ERROR;
+    }
+
+    // }}}
+    // {{{ errorMessage()
+
+    /**
+     * Maps a DB error code to a textual message
+     *
+     * @param integer $dbcode  the DB error code
+     *
+     * @return string  the error message corresponding to the error code
+     *                  submitted.  FALSE if the error code is unknown.
+     *
+     * @see DB::errorMessage()
+     */
+    function errorMessage($dbcode)
+    {
+        return DB::errorMessage($this->errorcode_map[$dbcode]);
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * The format of the resulting array depends on which <var>$mode</var>
+     * you select.  The sample output below is based on this query:
+     * <pre>
+     *    SELECT tblFoo.fldID, tblFoo.fldPhone, tblBar.fldId
+     *    FROM tblFoo
+     *    JOIN tblBar ON tblFoo.fldId = tblBar.fldId
+     * </pre>
+     *
+     * <ul>
+     * <li>
+     *
+     * <kbd>null</kbd> (default)
+     *   <pre>
+     *   [0] => Array (
+     *       [table] => tblFoo
+     *       [name] => fldId
+     *       [type] => int
+     *       [len] => 11
+     *       [flags] => primary_key not_null
+     *   )
+     *   [1] => Array (
+     *       [table] => tblFoo
+     *       [name] => fldPhone
+     *       [type] => string
+     *       [len] => 20
+     *       [flags] =>
+     *   )
+     *   [2] => Array (
+     *       [table] => tblBar
+     *       [name] => fldId
+     *       [type] => int
+     *       [len] => 11
+     *       [flags] => primary_key not_null
+     *   )
+     *   </pre>
+     *
+     * </li><li>
+     *
+     * <kbd>DB_TABLEINFO_ORDER</kbd>
+     *
+     *   <p>In addition to the information found in the default output,
+     *   a notation of the number of columns is provided by the
+     *   <samp>num_fields</samp> element while the <samp>order</samp>
+     *   element provides an array with the column names as the keys and
+     *   their location index number (corresponding to the keys in the
+     *   the default output) as the values.</p>
+     *
+     *   <p>If a result set has identical field names, the last one is
+     *   used.</p>
+     *
+     *   <pre>
+     *   [num_fields] => 3
+     *   [order] => Array (
+     *       [fldId] => 2
+     *       [fldTrans] => 1
+     *   )
+     *   </pre>
+     *
+     * </li><li>
+     *
+     * <kbd>DB_TABLEINFO_ORDERTABLE</kbd>
+     *
+     *   <p>Similar to <kbd>DB_TABLEINFO_ORDER</kbd> but adds more
+     *   dimensions to the array in which the table names are keys and
+     *   the field names are sub-keys.  This is helpful for queries that
+     *   join tables which have identical field names.</p>
+     *
+     *   <pre>
+     *   [num_fields] => 3
+     *   [ordertable] => Array (
+     *       [tblFoo] => Array (
+     *           [fldId] => 0
+     *           [fldPhone] => 1
+     *       )
+     *       [tblBar] => Array (
+     *           [fldId] => 2
+     *       )
+     *   )
+     *   </pre>
+     *
+     * </li>
+     * </ul>
+     *
+     * The <samp>flags</samp> element contains a space separated list
+     * of extra information about the field.  This data is inconsistent
+     * between DBMS's due to the way each DBMS works.
+     *   + <samp>primary_key</samp>
+     *   + <samp>unique_key</samp>
+     *   + <samp>multiple_key</samp>
+     *   + <samp>not_null</samp>
+     *
+     * Most DBMS's only provide the <samp>table</samp> and <samp>flags</samp>
+     * elements if <var>$result</var> is a table name.  The following DBMS's
+     * provide full information from queries:
+     *   + fbsql
+     *   + mysql
+     *
+     * If the 'portability' option has <samp>DB_PORTABILITY_LOWERCASE</samp>
+     * turned on, the names of tables and fields will be lowercased.
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                string containing the name of a table.
+     *                                While this also accepts a query result
+     *                                resource identifier, this behavior is
+     *                                deprecated.
+     * @param int  $mode   either unused or one of the tableInfo modes:
+     *                     <kbd>DB_TABLEINFO_ORDERTABLE</kbd>,
+     *                     <kbd>DB_TABLEINFO_ORDER</kbd> or
+     *                     <kbd>DB_TABLEINFO_FULL</kbd> (which does both).
+     *                     These are bitwise, so the first two can be
+     *                     combined using <kbd>|</kbd>.
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::setOption()
+     */
+    function tableInfo($result, $mode = null)
+    {
+        /*
+         * If the DB_<driver> class has a tableInfo() method, that one
+         * overrides this one.  But, if the driver doesn't have one,
+         * this method runs and tells users about that fact.
+         */
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ getTables()
+
+    /**
+     * Lists the tables in the current database
+     *
+     * @return array  the list of tables.  A DB_Error object on failure.
+     *
+     * @deprecated Method deprecated some time before Release 1.2
+     */
+    function getTables()
+    {
+        return $this->getListOf('tables');
+    }
+
+    // }}}
+    // {{{ getListOf()
+
+    /**
+     * Lists internal database information
+     *
+     * @param string $type  type of information being sought.
+     *                       Common items being sought are:
+     *                       tables, databases, users, views, functions
+     *                       Each DBMS's has its own capabilities.
+     *
+     * @return array  an array listing the items sought.
+     *                 A DB DB_Error object on failure.
+     */
+    function getListOf($type)
+    {
+        $sql = $this->getSpecialQuery($type);
+        if ($sql === null) {
+            $this->last_query = '';
+            return $this->raiseError(DB_ERROR_UNSUPPORTED);
+        } elseif (is_int($sql) || DB::isError($sql)) {
+            // Previous error
+            return $this->raiseError($sql);
+        } elseif (is_array($sql)) {
+            // Already the result
+            return $sql;
+        }
+        // Launch this query
+        return $this->getCol($sql);
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        return $this->raiseError(DB_ERROR_UNSUPPORTED);
+    }
+
+    // }}}
+    // {{{ _rtrimArrayValues()
+
+    /**
+     * Right-trims all strings in an array
+     *
+     * @param array $array  the array to be trimmed (passed by reference)
+     *
+     * @return void
+     *
+     * @access protected
+     */
+    function _rtrimArrayValues(&$array)
+    {
+        foreach ($array as $key => $value) {
+            if (is_string($value)) {
+                $array[$key] = rtrim($value);
+            }
+        }
+    }
+
+    // }}}
+    // {{{ _convertNullArrayValuesToEmpty()
+
+    /**
+     * Converts all null values in an array to empty strings
+     *
+     * @param array  $array  the array to be de-nullified (passed by reference)
+     *
+     * @return void
+     *
+     * @access protected
+     */
+    function _convertNullArrayValuesToEmpty(&$array)
+    {
+        foreach ($array as $key => $value) {
+            if (is_null($value)) {
+                $array[$key] = '';
+            }
+        }
+    }
+
+    // }}}
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/dbase.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/dbase.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/dbase.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,510 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's dbase extension
+ * for interacting with dBase databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Tomas V.V. Cox <cox at idecnet.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: dbase.php,v 1.39 2005/02/19 23:25:25 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's dbase extension
+ * for interacting with dBase databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Tomas V.V. Cox <cox at idecnet.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_dbase extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'dbase';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'dbase';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => false,
+        'new_link'      => false,
+        'numrows'       => true,
+        'pconnect'      => false,
+        'prepare'       => false,
+        'ssl'           => false,
+        'transactions'  => false,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * A means of emulating result resources
+     * @var array
+     */
+    var $res_row = array();
+
+    /**
+     * The quantity of results so far
+     *
+     * For emulating result resources.
+     *
+     * @var integer
+     */
+    var $result = 0;
+
+    /**
+     * Maps dbase data type id's to human readable strings
+     *
+     * The human readable values are based on the output of PHP's
+     * dbase_get_header_info() function.
+     *
+     * @var array
+     * @since Property available since Release 1.7.0
+     */
+    var $types = array(
+        'C' => 'character',
+        'D' => 'date',
+        'L' => 'boolean',
+        'M' => 'memo',
+        'N' => 'number',
+    );
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_dbase()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database and create it if it doesn't exist
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * PEAR DB's dbase driver supports the following extra DSN options:
+     *   + mode    An integer specifying the read/write mode to use
+     *              (0 = read only, 1 = write only, 2 = read/write).
+     *              Available since PEAR DB 1.7.0.
+     *   + fields  An array of arrays that PHP's dbase_create() function needs
+     *              to create a new database.  This information is used if the
+     *              dBase file specified in the "database" segment of the DSN
+     *              does not exist.  For more info, see the PHP manual's
+     *              {@link http://php.net/dbase_create dbase_create()} page.
+     *              Available since PEAR DB 1.7.0.
+     *
+     * Example of how to connect and establish a new dBase file if necessary:
+     * <code>
+     * require_once 'DB.php';
+     *
+     * $dsn = array(
+     *     'phptype'  => 'dbase',
+     *     'database' => '/path/and/name/of/dbase/file',
+     *     'mode'     => 2,
+     *     'fields'   => array(
+     *         array('a', 'N', 5, 0),
+     *         array('b', 'C', 40),
+     *         array('c', 'C', 255),
+     *         array('d', 'C', 20),
+     *     ),
+     * );
+     * $options = array(
+     *     'debug'       => 2,
+     *     'portability' => DB_PORTABILITY_ALL,
+     * );
+     *
+     * $db =& DB::connect($dsn, $options);
+     * if (PEAR::isError($db)) {
+     *     die($db->getMessage());
+     * }
+     * </code>
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('dbase')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        /*
+         * Turn track_errors on for entire script since $php_errormsg
+         * is the only way to find errors from the dbase extension.
+         */
+        ini_set('track_errors', 1);
+        $php_errormsg = '';
+
+        if (!file_exists($dsn['database'])) {
+            $this->dsn['mode'] = 2;
+            if (empty($dsn['fields']) || !is_array($dsn['fields'])) {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null,
+                                         'the dbase file does not exist and '
+                                         . 'it could not be created because '
+                                         . 'the "fields" element of the DSN '
+                                         . 'is not properly set');
+            }
+            $this->connection = @dbase_create($dsn['database'],
+                                              $dsn['fields']);
+            if (!$this->connection) {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null,
+                                         'the dbase file does not exist and '
+                                         . 'the attempt to create it failed: '
+                                         . $php_errormsg);
+            }
+        } else {
+            if (!isset($this->dsn['mode'])) {
+                $this->dsn['mode'] = 0;
+            }
+            $this->connection = @dbase_open($dsn['database'],
+                                            $this->dsn['mode']);
+            if (!$this->connection) {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null,
+                                         $php_errormsg);
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @dbase_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ &query()
+
+    function &query($query = null)
+    {
+        // emulate result resources
+        $this->res_row[(int)$this->result] = 0;
+        $tmp =& new DB_result($this, $this->result++);
+        return $tmp;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum === null) {
+            $rownum = $this->res_row[(int)$result]++;
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            $arr = @dbase_get_record_with_names($this->connection, $rownum);
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @dbase_get_record($this->connection, $rownum);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($foo)
+    {
+        return @dbase_numfields($this->connection);
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($foo)
+    {
+        return @dbase_numrecords($this->connection);
+    }
+
+    // }}}
+    // {{{ quoteSmart()
+
+    /**
+     * Formats input so it can be safely used in a query
+     *
+     * @param mixed $in  the data to be formatted
+     *
+     * @return mixed  the formatted data.  The format depends on the input's
+     *                 PHP type:
+     *                 + null = the string <samp>NULL</samp>
+     *                 + boolean = <samp>T</samp> if true or
+     *                   <samp>F</samp> if false.  Use the <kbd>Logical</kbd>
+     *                   data type.
+     *                 + integer or double = the unquoted number
+     *                 + other (including strings and numeric strings) =
+     *                   the data with single quotes escaped by preceeding
+     *                   single quotes then the whole string is encapsulated
+     *                   between single quotes
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function quoteSmart($in)
+    {
+        if (is_int($in) || is_double($in)) {
+            return $in;
+        } elseif (is_bool($in)) {
+            return $in ? 'T' : 'F';
+        } elseif (is_null($in)) {
+            return 'NULL';
+        } else {
+            return "'" . $this->escapeSimple($in) . "'";
+        }
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about the current database
+     *
+     * @param mixed $result  THIS IS UNUSED IN DBASE.  The current database
+     *                       is examined regardless of what is provided here.
+     * @param int   $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     * @since Method available since Release 1.7.0
+     */
+    function tableInfo($result = null, $mode = null)
+    {
+        if (function_exists('dbase_get_header_info')) {
+            $id = @dbase_get_header_info($this->connection);
+            if (!$id && $php_errormsg) {
+                return $this->raiseError(DB_ERROR,
+                                         null, null, null,
+                                         $php_errormsg);
+            }
+        } else {
+            /*
+             * This segment for PHP 4 is loosely based on code by
+             * Hadi Rusiah <deegos at yahoo.com> in the comments on
+             * the dBase reference page in the PHP manual.
+             */
+            $db = @fopen($this->dsn['database'], 'r');
+            if (!$db) {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null,
+                                         $php_errormsg);
+            }
+
+            $id = array();
+            $i  = 0;
+
+            $line = fread($db, 32);
+            while (!feof($db)) {
+                $line = fread($db, 32);
+                if (substr($line, 0, 1) == chr(13)) {
+                    break;
+                } else {
+                    $pos = strpos(substr($line, 0, 10), chr(0));
+                    $pos = ($pos == 0 ? 10 : $pos);
+                    $id[$i] = array(
+                        'name'   => substr($line, 0, $pos),
+                        'type'   => $this->types[substr($line, 11, 1)],
+                        'length' => ord(substr($line, 16, 1)),
+                        'precision' => ord(substr($line, 17, 1)),
+                    );
+                }
+                $i++;
+            }
+
+            fclose($db);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $res   = array();
+        $count = count($id);
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $res[$i] = array(
+                'table' => $this->dsn['database'],
+                'name'  => $case_func($id[$i]['name']),
+                'type'  => $id[$i]['type'],
+                'len'   => $id[$i]['length'],
+                'flags' => ''
+            );
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        return $res;
+    }
+
+    // }}}
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/fbsql.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/fbsql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/fbsql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,770 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's fbsql extension
+ * for interacting with FrontBase databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Frank M. Kromann <frank at frontbase.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: fbsql.php,v 1.82 2005/03/04 23:12:36 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's fbsql extension
+ * for interacting with FrontBase databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Frank M. Kromann <frank at frontbase.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ * @since      Class functional since Release 1.7.0
+ */
+class DB_fbsql extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'fbsql';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'fbsql';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'alter',
+        'new_link'      => false,
+        'numrows'       => true,
+        'pconnect'      => true,
+        'prepare'       => false,
+        'ssl'           => false,
+        'transactions'  => true,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+         22 => DB_ERROR_SYNTAX,
+         85 => DB_ERROR_ALREADY_EXISTS,
+        108 => DB_ERROR_SYNTAX,
+        116 => DB_ERROR_NOSUCHTABLE,
+        124 => DB_ERROR_VALUE_COUNT_ON_ROW,
+        215 => DB_ERROR_NOSUCHFIELD,
+        217 => DB_ERROR_INVALID_NUMBER,
+        226 => DB_ERROR_NOSUCHFIELD,
+        231 => DB_ERROR_INVALID,
+        239 => DB_ERROR_TRUNCATED,
+        251 => DB_ERROR_SYNTAX,
+        266 => DB_ERROR_NOT_FOUND,
+        357 => DB_ERROR_CONSTRAINT_NOT_NULL,
+        358 => DB_ERROR_CONSTRAINT,
+        360 => DB_ERROR_CONSTRAINT,
+        361 => DB_ERROR_CONSTRAINT,
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_fbsql()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('fbsql')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        $params = array(
+            $dsn['hostspec'] ? $dsn['hostspec'] : 'localhost',
+            $dsn['username'] ? $dsn['username'] : null,
+            $dsn['password'] ? $dsn['password'] : null,
+        );
+
+        $connect_function = $persistent ? 'fbsql_pconnect' : 'fbsql_connect';
+
+        $ini = ini_get('track_errors');
+        $php_errormsg = '';
+        if ($ini) {
+            $this->connection = @call_user_func_array($connect_function,
+                                                      $params);
+        } else {
+            ini_set('track_errors', 1);
+            $this->connection = @call_user_func_array($connect_function,
+                                                      $params);
+            ini_set('track_errors', $ini);
+        }
+
+        if (!$this->connection) {
+            return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                     null, null, null,
+                                     $php_errormsg);
+        }
+
+        if ($dsn['database']) {
+            if (!@fbsql_select_db($dsn['database'], $this->connection)) {
+                return $this->fbsqlRaiseError();
+            }
+        }
+
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @fbsql_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $this->last_query = $query;
+        $query = $this->modifyQuery($query);
+        $result = @fbsql_query("$query;", $this->connection);
+        if (!$result) {
+            return $this->fbsqlRaiseError();
+        }
+        // Determine which queries that should return data, and which
+        // should return an error code only.
+        if (DB::isManip($query)) {
+            return DB_OK;
+        }
+        return $result;
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal fbsql result pointer to the next available result
+     *
+     * @param a valid fbsql result resource
+     *
+     * @access public
+     *
+     * @return true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return @fbsql_next_result($result);
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum !== null) {
+            if (!@fbsql_data_seek($result, $rownum)) {
+                return null;
+            }
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            $arr = @fbsql_fetch_array($result, FBSQL_ASSOC);
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @fbsql_fetch_row($result);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @fbsql_free_result($result);
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff=false)
+    {
+        if ($onoff) {
+            $this->query("SET COMMIT TRUE");
+        } else {
+            $this->query("SET COMMIT FALSE");
+        }
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        @fbsql_commit();
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        @fbsql_rollback();
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @fbsql_num_fields($result);
+        if (!$cols) {
+            return $this->fbsqlRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($result)
+    {
+        $rows = @fbsql_num_rows($result);
+        if ($rows === null) {
+            return $this->fbsqlRaiseError();
+        }
+        return $rows;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if (DB::isManip($this->last_query)) {
+            $result = @fbsql_affected_rows($this->connection);
+        } else {
+            $result = 0;
+        }
+        return $result;
+     }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_fbsql::createSequence(), DB_fbsql::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        do {
+            $repeat = 0;
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result = $this->query('SELECT UNIQUE FROM ' . $seqname);
+            $this->popErrorHandling();
+            if ($ondemand && DB::isError($result) &&
+                $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+                $repeat = 1;
+                $result = $this->createSequence($seq_name);
+                if (DB::isError($result)) {
+                    return $result;
+                }
+            } else {
+                $repeat = 0;
+            }
+        } while ($repeat);
+        if (DB::isError($result)) {
+            return $this->fbsqlRaiseError();
+        }
+        $result->fetchInto($tmp, DB_FETCHMODE_ORDERED);
+        return $tmp[0];
+    }
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_fbsql::nextID(), DB_fbsql::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $res = $this->query('CREATE TABLE ' . $seqname
+                            . ' (id INTEGER NOT NULL,'
+                            . ' PRIMARY KEY(id))');
+        if ($res) {
+            $res = $this->query('SET UNIQUE = 0 FOR ' . $seqname);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_fbsql::nextID(), DB_fbsql::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name)
+                            . ' RESTRICT');
+    }
+
+    // }}}
+    // {{{ modifyLimitQuery()
+
+    /**
+     * Adds LIMIT clauses to a query string according to current DBMS standards
+     *
+     * @param string $query   the query to modify
+     * @param int    $from    the row to start to fetching (0 = the first row)
+     * @param int    $count   the numbers of rows to fetch
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return string  the query string with LIMIT clauses added
+     *
+     * @access protected
+     */
+    function modifyLimitQuery($query, $from, $count, $params = array())
+    {
+        if (DB::isManip($query)) {
+            return preg_replace('/^([\s(])*SELECT/i',
+                                "\\1SELECT TOP($count)", $query);
+        } else {
+            return preg_replace('/([\s(])*SELECT/i',
+                                "\\1SELECT TOP($from, $count)", $query);
+        }
+    }
+
+    // }}}
+    // {{{ quoteSmart()
+
+    /**
+     * Formats input so it can be safely used in a query
+     *
+     * @param mixed $in  the data to be formatted
+     *
+     * @return mixed  the formatted data.  The format depends on the input's
+     *                 PHP type:
+     *                 + null = the string <samp>NULL</samp>
+     *                 + boolean = string <samp>TRUE</samp> or <samp>FALSE</samp>
+     *                 + integer or double = the unquoted number
+     *                 + other (including strings and numeric strings) =
+     *                   the data escaped according to FrontBase's settings
+     *                   then encapsulated between single quotes
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function quoteSmart($in)
+    {
+        if (is_int($in) || is_double($in)) {
+            return $in;
+        } elseif (is_bool($in)) {
+            return $in ? 'TRUE' : 'FALSE';
+        } elseif (is_null($in)) {
+            return 'NULL';
+        } else {
+            return "'" . $this->escapeSimple($in) . "'";
+        }
+    }
+
+    // }}}
+    // {{{ fbsqlRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_fbsql::errorNative(), DB_common::errorCode()
+     */
+    function fbsqlRaiseError($errno = null)
+    {
+        if ($errno === null) {
+            $errno = $this->errorCode(fbsql_errno($this->connection));
+        }
+        return $this->raiseError($errno, null, null, null,
+                                 @fbsql_error($this->connection));
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error code produced by the last query
+     *
+     * @return int  the DBMS' error code
+     */
+    function errorNative()
+    {
+        return @fbsql_errno($this->connection);
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $id = @fbsql_list_fields($this->dsn['database'],
+                                     $result, $this->connection);
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             * Deprecated.  Here for compatibility only.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_resource($id)) {
+            return $this->fbsqlRaiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = @fbsql_num_fields($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $res[$i] = array(
+                'table' => $case_func(@fbsql_field_table($id, $i)),
+                'name'  => $case_func(@fbsql_field_name($id, $i)),
+                'type'  => @fbsql_field_type($id, $i),
+                'len'   => @fbsql_field_len($id, $i),
+                'flags' => @fbsql_field_flags($id, $i),
+            );
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @fbsql_free_result($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'tables':
+                return 'SELECT "table_name" FROM information_schema.tables'
+                       . ' t0, information_schema.schemata t1'
+                       . ' WHERE t0.schema_pk=t1.schema_pk AND'
+                       . ' "table_type" = \'BASE TABLE\''
+                       . ' AND "schema_name" = current_schema';
+            case 'views':
+                return 'SELECT "table_name" FROM information_schema.tables'
+                       . ' t0, information_schema.schemata t1'
+                       . ' WHERE t0.schema_pk=t1.schema_pk AND'
+                       . ' "table_type" = \'VIEW\''
+                       . ' AND "schema_name" = current_schema';
+            case 'users':
+                return 'SELECT "user_name" from information_schema.users'; 
+            case 'functions':
+                return 'SELECT "routine_name" FROM'
+                       . ' information_schema.psm_routines'
+                       . ' t0, information_schema.schemata t1'
+                       . ' WHERE t0.schema_pk=t1.schema_pk'
+                       . ' AND "routine_kind"=\'FUNCTION\''
+                       . ' AND "schema_name" = current_schema';
+            case 'procedures':
+                return 'SELECT "routine_name" FROM'
+                       . ' information_schema.psm_routines'
+                       . ' t0, information_schema.schemata t1'
+                       . ' WHERE t0.schema_pk=t1.schema_pk'
+                       . ' AND "routine_kind"=\'PROCEDURE\''
+                       . ' AND "schema_name" = current_schema';
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/ibase.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/ibase.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/ibase.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1071 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's interbase extension
+ * for interacting with Interbase and Firebird databases
+ *
+ * While this class works with PHP 4, PHP's InterBase extension is
+ * unstable in PHP 4.  Use PHP 5.
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Sterling Hughes <sterling at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: ibase.php,v 1.109 2005/03/04 23:12:36 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's interbase extension
+ * for interacting with Interbase and Firebird databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * While this class works with PHP 4, PHP's InterBase extension is
+ * unstable in PHP 4.  Use PHP 5.
+ *
+ * NOTICE:  limitQuery() only works for Firebird.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Sterling Hughes <sterling at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ * @since      Class became stable in Release 1.7.0
+ */
+class DB_ibase extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'ibase';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'ibase';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * NOTE: only firebird supports limit.
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => false,
+        'new_link'      => false,
+        'numrows'       => 'emulate',
+        'pconnect'      => true,
+        'prepare'       => true,
+        'ssl'           => false,
+        'transactions'  => true,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+        -104 => DB_ERROR_SYNTAX,
+        -150 => DB_ERROR_ACCESS_VIOLATION,
+        -151 => DB_ERROR_ACCESS_VIOLATION,
+        -155 => DB_ERROR_NOSUCHTABLE,
+        -157 => DB_ERROR_NOSUCHFIELD,
+        -158 => DB_ERROR_VALUE_COUNT_ON_ROW,
+        -170 => DB_ERROR_MISMATCH,
+        -171 => DB_ERROR_MISMATCH,
+        -172 => DB_ERROR_INVALID,
+        // -204 =>  // Covers too many errors, need to use regex on msg
+        -205 => DB_ERROR_NOSUCHFIELD,
+        -206 => DB_ERROR_NOSUCHFIELD,
+        -208 => DB_ERROR_INVALID,
+        -219 => DB_ERROR_NOSUCHTABLE,
+        -297 => DB_ERROR_CONSTRAINT,
+        -303 => DB_ERROR_INVALID,
+        -413 => DB_ERROR_INVALID_NUMBER,
+        -530 => DB_ERROR_CONSTRAINT,
+        -551 => DB_ERROR_ACCESS_VIOLATION,
+        -552 => DB_ERROR_ACCESS_VIOLATION,
+        // -607 =>  // Covers too many errors, need to use regex on msg
+        -625 => DB_ERROR_CONSTRAINT_NOT_NULL,
+        -803 => DB_ERROR_CONSTRAINT,
+        -804 => DB_ERROR_VALUE_COUNT_ON_ROW,
+        -904 => DB_ERROR_CONNECT_FAILED,
+        -922 => DB_ERROR_NOSUCHDB,
+        -923 => DB_ERROR_CONNECT_FAILED,
+        -924 => DB_ERROR_CONNECT_FAILED
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * The number of rows affected by a data manipulation query
+     * @var integer
+     * @access private
+     */
+    var $affected = 0;
+
+    /**
+     * Should data manipulation queries be committed automatically?
+     * @var bool
+     * @access private
+     */
+    var $autocommit = true;
+
+    /**
+     * The prepared statement handle from the most recently executed statement
+     *
+     * {@internal  Mainly here because the InterBase/Firebird API is only
+     * able to retrieve data from result sets if the statemnt handle is
+     * still in scope.}}
+     *
+     * @var resource
+     */
+    var $last_stmt;
+
+    /**
+     * Is the given prepared statement a data manipulation query?
+     * @var array
+     * @access private
+     */
+    var $manip_query = array();
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_ibase()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * PEAR DB's ibase driver supports the following extra DSN options:
+     *   + buffers    The number of database buffers to allocate for the
+     *                 server-side cache.
+     *   + charset    The default character set for a database.
+     *   + dialect    The default SQL dialect for any statement
+     *                 executed within a connection.  Defaults to the
+     *                 highest one supported by client libraries.
+     *                 Functional only with InterBase 6 and up.
+     *   + role       Functional only with InterBase 5 and up.
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('interbase')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+        if ($this->dbsyntax == 'firebird') {
+            $this->features['limit'] = 'alter';
+        }
+
+        $params = array(
+            $dsn['hostspec']
+                    ? ($dsn['hostspec'] . ':' . $dsn['database'])
+                    : $dsn['database'],
+            $dsn['username'] ? $dsn['username'] : null,
+            $dsn['password'] ? $dsn['password'] : null,
+            isset($dsn['charset']) ? $dsn['charset'] : null,
+            isset($dsn['buffers']) ? $dsn['buffers'] : null,
+            isset($dsn['dialect']) ? $dsn['dialect'] : null,
+            isset($dsn['role'])    ? $dsn['role'] : null,
+        );
+
+        $connect_function = $persistent ? 'ibase_pconnect' : 'ibase_connect';
+
+        $this->connection = @call_user_func_array($connect_function, $params);
+        if (!$this->connection) {
+            return $this->ibaseRaiseError(DB_ERROR_CONNECT_FAILED);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @ibase_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $ismanip = DB::isManip($query);
+        $this->last_query = $query;
+        $query = $this->modifyQuery($query);
+        $result = @ibase_query($this->connection, $query);
+
+        if (!$result) {
+            return $this->ibaseRaiseError();
+        }
+        if ($this->autocommit && $ismanip) {
+            @ibase_commit($this->connection);
+        }
+        if ($ismanip) {
+            $this->affected = $result;
+            return DB_OK;
+        } else {
+            $this->affected = 0;
+            return $result;
+        }
+    }
+
+    // }}}
+    // {{{ modifyLimitQuery()
+
+    /**
+     * Adds LIMIT clauses to a query string according to current DBMS standards
+     *
+     * Only works with Firebird.
+     *
+     * @param string $query   the query to modify
+     * @param int    $from    the row to start to fetching (0 = the first row)
+     * @param int    $count   the numbers of rows to fetch
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return string  the query string with LIMIT clauses added
+     *
+     * @access protected
+     */
+    function modifyLimitQuery($query, $from, $count, $params = array())
+    {
+        if ($this->dsn['dbsyntax'] == 'firebird') {
+            $query = preg_replace('/^([\s(])*SELECT/i',
+                                  "SELECT FIRST $count SKIP $from", $query);
+        }
+        return $query;
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal ibase result pointer to the next available result
+     *
+     * @param a valid fbsql result resource
+     *
+     * @access public
+     *
+     * @return true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return false;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum !== null) {
+            return $this->ibaseRaiseError(DB_ERROR_NOT_CAPABLE);
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            if (function_exists('ibase_fetch_assoc')) {
+                $arr = @ibase_fetch_assoc($result);
+            } else {
+                $arr = get_object_vars(ibase_fetch_object($result));
+            }
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @ibase_fetch_row($result);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @ibase_free_result($result);
+    }
+
+    // }}}
+    // {{{ freeQuery()
+
+    function freeQuery($query)
+    {
+        @ibase_free_query($query);
+        return true;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if (is_integer($this->affected)) {
+            return $this->affected;
+        }
+        return $this->ibaseRaiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @ibase_num_fields($result);
+        if (!$cols) {
+            return $this->ibaseRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ prepare()
+
+    /**
+     * Prepares a query for multiple execution with execute().
+     *
+     * prepare() requires a generic query as string like <code>
+     *    INSERT INTO numbers VALUES (?, ?, ?)
+     * </code>.  The <kbd>?</kbd> characters are placeholders.
+     *
+     * Three types of placeholders can be used:
+     *   + <kbd>?</kbd>  a quoted scalar value, i.e. strings, integers
+     *   + <kbd>!</kbd>  value is inserted 'as is'
+     *   + <kbd>&</kbd>  requires a file name.  The file's contents get
+     *                     inserted into the query (i.e. saving binary
+     *                     data in a db)
+     *
+     * Use backslashes to escape placeholder characters if you don't want
+     * them to be interpreted as placeholders.  Example: <code>
+     *    "UPDATE foo SET col=? WHERE col='over \& under'"
+     * </code>
+     *
+     * @param string $query query to be prepared
+     * @return mixed DB statement resource on success. DB_Error on failure.
+     */
+    function prepare($query)
+    {
+        $tokens   = preg_split('/((?<!\\\)[&?!])/', $query, -1,
+                               PREG_SPLIT_DELIM_CAPTURE);
+        $token    = 0;
+        $types    = array();
+        $newquery = '';
+
+        foreach ($tokens as $key => $val) {
+            switch ($val) {
+                case '?':
+                    $types[$token++] = DB_PARAM_SCALAR;
+                    break;
+                case '&':
+                    $types[$token++] = DB_PARAM_OPAQUE;
+                    break;
+                case '!':
+                    $types[$token++] = DB_PARAM_MISC;
+                    break;
+                default:
+                    $tokens[$key] = preg_replace('/\\\([&?!])/', "\\1", $val);
+                    $newquery .= $tokens[$key] . '?';
+            }
+        }
+
+        $newquery = substr($newquery, 0, -1);
+        $this->last_query = $query;
+        $newquery = $this->modifyQuery($newquery);
+        $stmt = @ibase_prepare($this->connection, $newquery);
+        $this->prepare_types[(int)$stmt] = $types;
+        $this->manip_query[(int)$stmt]   = DB::isManip($query);
+        return $stmt;
+    }
+
+    // }}}
+    // {{{ execute()
+
+    /**
+     * Executes a DB statement prepared with prepare().
+     *
+     * @param resource  $stmt  a DB statement resource returned from prepare()
+     * @param mixed  $data  array, string or numeric data to be used in
+     *                      execution of the statement.  Quantity of items
+     *                      passed must match quantity of placeholders in
+     *                      query:  meaning 1 for non-array items or the
+     *                      quantity of elements in the array.
+     * @return object  a new DB_Result or a DB_Error when fail
+     * @see DB_ibase::prepare()
+     * @access public
+     */
+    function &execute($stmt, $data = array())
+    {
+        $data = (array)$data;
+        $this->last_parameters = $data;
+
+        $types =& $this->prepare_types[(int)$stmt];
+        if (count($types) != count($data)) {
+            $tmp =& $this->raiseError(DB_ERROR_MISMATCH);
+            return $tmp;
+        }
+
+        $i = 0;
+        foreach ($data as $key => $value) {
+            if ($types[$i] == DB_PARAM_MISC) {
+                /*
+                 * ibase doesn't seem to have the ability to pass a
+                 * parameter along unchanged, so strip off quotes from start
+                 * and end, plus turn two single quotes to one single quote,
+                 * in order to avoid the quotes getting escaped by
+                 * ibase and ending up in the database.
+                 */
+                $data[$key] = preg_replace("/^'(.*)'$/", "\\1", $data[$key]);
+                $data[$key] = str_replace("''", "'", $data[$key]);
+            } elseif ($types[$i] == DB_PARAM_OPAQUE) {
+                $fp = @fopen($data[$key], 'rb');
+                if (!$fp) {
+                    $tmp =& $this->raiseError(DB_ERROR_ACCESS_VIOLATION);
+                    return $tmp;
+                }
+                $data[$key] = fread($fp, filesize($data[$key]));
+                fclose($fp);
+            }
+            $i++;
+        }
+
+        array_unshift($data, $stmt);
+
+        $res = call_user_func_array('ibase_execute', $data);
+        if (!$res) {
+            $tmp =& $this->ibaseRaiseError();
+            return $tmp;
+        }
+        /* XXX need this?
+        if ($this->autocommit && $this->manip_query[(int)$stmt]) {
+            @ibase_commit($this->connection);
+        }*/
+        $this->last_stmt = $stmt;
+        if ($this->manip_query[(int)$stmt]) {
+            $tmp = DB_OK;
+        } else {
+            $tmp =& new DB_result($this, $res);
+        }
+        return $tmp;
+    }
+
+    /**
+     * Frees the internal resources associated with a prepared query
+     *
+     * @param resource $stmt           the prepared statement's PHP resource
+     * @param bool     $free_resource  should the PHP resource be freed too?
+     *                                  Use false if you need to get data
+     *                                  from the result set later.
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_ibase::prepare()
+     */
+    function freePrepared($stmt, $free_resource = true)
+    {
+        if (!is_resource($stmt)) {
+            return false;
+        }
+        if ($free_resource) {
+            @ibase_free_query($stmt);
+        }
+        unset($this->prepare_tokens[(int)$stmt]);
+        unset($this->prepare_types[(int)$stmt]);
+        unset($this->manip_query[(int)$stmt]);
+        return true;
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = false)
+    {
+        $this->autocommit = $onoff ? 1 : 0;
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        return @ibase_commit($this->connection);
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        return @ibase_rollback($this->connection);
+    }
+
+    // }}}
+    // {{{ transactionInit()
+
+    function transactionInit($trans_args = 0)
+    {
+        return $trans_args
+                ? @ibase_trans($trans_args, $this->connection)
+                : @ibase_trans();
+    }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_ibase::createSequence(), DB_ibase::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $sqn = strtoupper($this->getSequenceName($seq_name));
+        $repeat = 0;
+        do {
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result =& $this->query("SELECT GEN_ID(${sqn}, 1) "
+                                   . 'FROM RDB$GENERATORS '
+                                   . "WHERE RDB\$GENERATOR_NAME='${sqn}'");
+            $this->popErrorHandling();
+            if ($ondemand && DB::isError($result)) {
+                $repeat = 1;
+                $result = $this->createSequence($seq_name);
+                if (DB::isError($result)) {
+                    return $result;
+                }
+            } else {
+                $repeat = 0;
+            }
+        } while ($repeat);
+        if (DB::isError($result)) {
+            return $this->raiseError($result);
+        }
+        $arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
+        $result->free();
+        return $arr[0];
+    }
+
+    // }}}
+    // {{{ createSequence()
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_ibase::nextID(), DB_ibase::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        $sqn = strtoupper($this->getSequenceName($seq_name));
+        $this->pushErrorHandling(PEAR_ERROR_RETURN);
+        $result = $this->query("CREATE GENERATOR ${sqn}");
+        $this->popErrorHandling();
+
+        return $result;
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_ibase::nextID(), DB_ibase::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DELETE FROM RDB$GENERATORS '
+                            . "WHERE RDB\$GENERATOR_NAME='"
+                            . strtoupper($this->getSequenceName($seq_name))
+                            . "'");
+    }
+
+    // }}}
+    // {{{ _ibaseFieldFlags()
+
+    /**
+     * Get the column's flags
+     *
+     * Supports "primary_key", "unique_key", "not_null", "default",
+     * "computed" and "blob".
+     *
+     * @param string $field_name  the name of the field
+     * @param string $table_name  the name of the table
+     *
+     * @return string  the flags
+     *
+     * @access private
+     */
+    function _ibaseFieldFlags($field_name, $table_name)
+    {
+        $sql = 'SELECT R.RDB$CONSTRAINT_TYPE CTYPE'
+               .' FROM RDB$INDEX_SEGMENTS I'
+               .'  JOIN RDB$RELATION_CONSTRAINTS R ON I.RDB$INDEX_NAME=R.RDB$INDEX_NAME'
+               .' WHERE I.RDB$FIELD_NAME=\'' . $field_name . '\''
+               .'  AND UPPER(R.RDB$RELATION_NAME)=\'' . strtoupper($table_name) . '\'';
+
+        $result = @ibase_query($this->connection, $sql);
+        if (!$result) {
+            return $this->ibaseRaiseError();
+        }
+
+        $flags = '';
+        if ($obj = @ibase_fetch_object($result)) {
+            @ibase_free_result($result);
+            if (isset($obj->CTYPE)  && trim($obj->CTYPE) == 'PRIMARY KEY') {
+                $flags .= 'primary_key ';
+            }
+            if (isset($obj->CTYPE)  && trim($obj->CTYPE) == 'UNIQUE') {
+                $flags .= 'unique_key ';
+            }
+        }
+
+        $sql = 'SELECT R.RDB$NULL_FLAG AS NFLAG,'
+               .'  R.RDB$DEFAULT_SOURCE AS DSOURCE,'
+               .'  F.RDB$FIELD_TYPE AS FTYPE,'
+               .'  F.RDB$COMPUTED_SOURCE AS CSOURCE'
+               .' FROM RDB$RELATION_FIELDS R '
+               .'  JOIN RDB$FIELDS F ON R.RDB$FIELD_SOURCE=F.RDB$FIELD_NAME'
+               .' WHERE UPPER(R.RDB$RELATION_NAME)=\'' . strtoupper($table_name) . '\''
+               .'  AND R.RDB$FIELD_NAME=\'' . $field_name . '\'';
+
+        $result = @ibase_query($this->connection, $sql);
+        if (!$result) {
+            return $this->ibaseRaiseError();
+        }
+        if ($obj = @ibase_fetch_object($result)) {
+            @ibase_free_result($result);
+            if (isset($obj->NFLAG)) {
+                $flags .= 'not_null ';
+            }
+            if (isset($obj->DSOURCE)) {
+                $flags .= 'default ';
+            }
+            if (isset($obj->CSOURCE)) {
+                $flags .= 'computed ';
+            }
+            if (isset($obj->FTYPE)  && $obj->FTYPE == 261) {
+                $flags .= 'blob ';
+            }
+        }
+
+        return trim($flags);
+    }
+
+    // }}}
+    // {{{ ibaseRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_ibase::errorNative(), DB_ibase::errorCode()
+     */
+    function &ibaseRaiseError($errno = null)
+    {
+        if ($errno === null) {
+            $errno = $this->errorCode($this->errorNative());
+        }
+        $tmp =& $this->raiseError($errno, null, null, null, @ibase_errmsg());
+        return $tmp;
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error code produced by the last query
+     *
+     * @return int  the DBMS' error code.  NULL if there is no error code.
+     *
+     * @since Method available since Release 1.7.0
+     */
+    function errorNative()
+    {
+        if (function_exists('ibase_errcode')) {
+            return @ibase_errcode();
+        }
+        if (preg_match('/^Dynamic SQL Error SQL error code = ([0-9-]+)/i',
+                       @ibase_errmsg(), $m)) {
+            return (int)$m[1];
+        }
+        return null;
+    }
+
+    // }}}
+    // {{{ errorCode()
+
+    /**
+     * Maps native error codes to DB's portable ones
+     *
+     * @param int $nativecode  the error code returned by the DBMS
+     *
+     * @return int  the portable DB error code.  Return DB_ERROR if the
+     *               current driver doesn't have a mapping for the
+     *               $nativecode submitted.
+     *
+     * @since Method available since Release 1.7.0
+     */
+    function errorCode($nativecode = null)
+    {
+        if (isset($this->errorcode_map[$nativecode])) {
+            return $this->errorcode_map[$nativecode];
+        }
+
+        static $error_regexps;
+        if (!isset($error_regexps)) {
+            $error_regexps = array(
+                '/generator .* is not defined/'
+                    => DB_ERROR_SYNTAX,  // for compat. w ibase_errcode()
+                '/table.*(not exist|not found|unknown)/i'
+                    => DB_ERROR_NOSUCHTABLE,
+                '/table .* already exists/i'
+                    => DB_ERROR_ALREADY_EXISTS,
+                '/unsuccessful metadata update .* failed attempt to store duplicate value/i'
+                    => DB_ERROR_ALREADY_EXISTS,
+                '/unsuccessful metadata update .* not found/i'
+                    => DB_ERROR_NOT_FOUND,
+                '/validation error for column .* value "\*\*\* null/i'
+                    => DB_ERROR_CONSTRAINT_NOT_NULL,
+                '/violation of [\w ]+ constraint/i'
+                    => DB_ERROR_CONSTRAINT,
+                '/conversion error from string/i'
+                    => DB_ERROR_INVALID_NUMBER,
+                '/no permission for/i'
+                    => DB_ERROR_ACCESS_VIOLATION,
+                '/arithmetic exception, numeric overflow, or string truncation/i'
+                    => DB_ERROR_INVALID,
+            );
+        }
+
+        $errormsg = @ibase_errmsg();
+        foreach ($error_regexps as $regexp => $code) {
+            if (preg_match($regexp, $errormsg)) {
+                return $code;
+            }
+        }
+        return DB_ERROR;
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * NOTE: only supports 'table' and 'flags' if <var>$result</var>
+     * is a table name.
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $id = @ibase_query($this->connection,
+                               "SELECT * FROM $result WHERE 1=0");
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             * Deprecated.  Here for compatibility only.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_resource($id)) {
+            return $this->ibaseRaiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = @ibase_num_fields($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $info = @ibase_field_info($id, $i);
+            $res[$i] = array(
+                'table' => $got_string ? $case_func($result) : '',
+                'name'  => $case_func($info['name']),
+                'type'  => $info['type'],
+                'len'   => $info['length'],
+                'flags' => ($got_string)
+                            ? $this->_ibaseFieldFlags($info['name'], $result)
+                            : '',
+            );
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @ibase_free_result($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'tables':
+                return 'SELECT DISTINCT R.RDB$RELATION_NAME FROM '
+                       . 'RDB$RELATION_FIELDS R WHERE R.RDB$SYSTEM_FLAG=0';
+            case 'views':
+                return 'SELECT DISTINCT RDB$VIEW_NAME from RDB$VIEW_RELATIONS';
+            case 'users':
+                return 'SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES';
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/ifx.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/ifx.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/ifx.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,681 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's ifx extension
+ * for interacting with Informix databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Tomas V.V.Cox <cox at idecnet.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: ifx.php,v 1.70 2005/02/20 00:44:48 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's ifx extension
+ * for interacting with Informix databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * More info on Informix errors can be found at:
+ * http://www.informix.com/answers/english/ierrors.htm
+ *
+ * TODO:
+ *   - set needed env Informix vars on connect
+ *   - implement native prepare/execute
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Tomas V.V.Cox <cox at idecnet.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_ifx extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'ifx';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'ifx';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'emulate',
+        'new_link'      => false,
+        'numrows'       => 'emulate',
+        'pconnect'      => true,
+        'prepare'       => false,
+        'ssl'           => false,
+        'transactions'  => true,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+        '-201'    => DB_ERROR_SYNTAX,
+        '-206'    => DB_ERROR_NOSUCHTABLE,
+        '-217'    => DB_ERROR_NOSUCHFIELD,
+        '-236'    => DB_ERROR_VALUE_COUNT_ON_ROW,
+        '-239'    => DB_ERROR_CONSTRAINT,
+        '-253'    => DB_ERROR_SYNTAX,
+        '-292'    => DB_ERROR_CONSTRAINT_NOT_NULL,
+        '-310'    => DB_ERROR_ALREADY_EXISTS,
+        '-316'    => DB_ERROR_ALREADY_EXISTS,
+        '-319'    => DB_ERROR_NOT_FOUND,
+        '-329'    => DB_ERROR_NODBSELECTED,
+        '-346'    => DB_ERROR_CONSTRAINT,
+        '-386'    => DB_ERROR_CONSTRAINT_NOT_NULL,
+        '-391'    => DB_ERROR_CONSTRAINT_NOT_NULL,
+        '-554'    => DB_ERROR_SYNTAX,
+        '-691'    => DB_ERROR_CONSTRAINT,
+        '-692'    => DB_ERROR_CONSTRAINT,
+        '-703'    => DB_ERROR_CONSTRAINT_NOT_NULL,
+        '-1204'   => DB_ERROR_INVALID_DATE,
+        '-1205'   => DB_ERROR_INVALID_DATE,
+        '-1206'   => DB_ERROR_INVALID_DATE,
+        '-1209'   => DB_ERROR_INVALID_DATE,
+        '-1210'   => DB_ERROR_INVALID_DATE,
+        '-1212'   => DB_ERROR_INVALID_DATE,
+        '-1213'   => DB_ERROR_INVALID_NUMBER,
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * Should data manipulation queries be committed automatically?
+     * @var bool
+     * @access private
+     */
+    var $autocommit = true;
+
+    /**
+     * The quantity of transactions begun
+     *
+     * {@internal  While this is private, it can't actually be designated
+     * private in PHP 5 because it is directly accessed in the test suite.}}
+     *
+     * @var integer
+     * @access private
+     */
+    var $transaction_opcount = 0;
+
+    /**
+     * The number of rows affected by a data manipulation query
+     * @var integer
+     * @access private
+     */
+    var $affected = 0;
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_ifx()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('informix') &&
+            !PEAR::loadExtension('Informix'))
+        {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        $dbhost = $dsn['hostspec'] ? '@' . $dsn['hostspec'] : '';
+        $dbname = $dsn['database'] ? $dsn['database'] . $dbhost : '';
+        $user = $dsn['username'] ? $dsn['username'] : '';
+        $pw = $dsn['password'] ? $dsn['password'] : '';
+
+        $connect_function = $persistent ? 'ifx_pconnect' : 'ifx_connect';
+
+        $this->connection = @$connect_function($dbname, $user, $pw);
+        if (!is_resource($this->connection)) {
+            return $this->ifxRaiseError(DB_ERROR_CONNECT_FAILED);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @ifx_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $ismanip = DB::isManip($query);
+        $this->last_query = $query;
+        $this->affected   = null;
+        if (preg_match('/(SELECT)/i', $query)) {    //TESTME: Use !DB::isManip()?
+            // the scroll is needed for fetching absolute row numbers
+            // in a select query result
+            $result = @ifx_query($query, $this->connection, IFX_SCROLL);
+        } else {
+            if (!$this->autocommit && $ismanip) {
+                if ($this->transaction_opcount == 0) {
+                    $result = @ifx_query('BEGIN WORK', $this->connection);
+                    if (!$result) {
+                        return $this->ifxRaiseError();
+                    }
+                }
+                $this->transaction_opcount++;
+            }
+            $result = @ifx_query($query, $this->connection);
+        }
+        if (!$result) {
+            return $this->ifxRaiseError();
+        }
+        $this->affected = @ifx_affected_rows($result);
+        // Determine which queries should return data, and which
+        // should return an error code only.
+        if (preg_match('/(SELECT)/i', $query)) {
+            return $result;
+        }
+        // XXX Testme: free results inside a transaction
+        // may cause to stop it and commit the work?
+
+        // Result has to be freed even with a insert or update
+        @ifx_free_result($result);
+
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal ifx result pointer to the next available result
+     *
+     * @param a valid fbsql result resource
+     *
+     * @access public
+     *
+     * @return true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return false;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if (DB::isManip($this->last_query)) {
+            return $this->affected;
+        } else {
+            return 0;
+        }
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if (($rownum !== null) && ($rownum < 0)) {
+            return null;
+        }
+        if ($rownum === null) {
+            /*
+             * Even though fetch_row() should return the next row  if
+             * $rownum is null, it doesn't in all cases.  Bug 598.
+             */
+            $rownum = 'NEXT';
+        } else {
+            // Index starts at row 1, unlike most DBMS's starting at 0.
+            $rownum++;
+        }
+        if (!$arr = @ifx_fetch_row($result, $rownum)) {
+            return null;
+        }
+        if ($fetchmode !== DB_FETCHMODE_ASSOC) {
+            $i=0;
+            $order = array();
+            foreach ($arr as $val) {
+                $order[$i++] = $val;
+            }
+            $arr = $order;
+        } elseif ($fetchmode == DB_FETCHMODE_ASSOC &&
+                  $this->options['portability'] & DB_PORTABILITY_LOWERCASE)
+        {
+            $arr = array_change_key_case($arr, CASE_LOWER);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        if (!$cols = @ifx_num_fields($result)) {
+            return $this->ifxRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @ifx_free_result($result);
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = true)
+    {
+        // XXX if $this->transaction_opcount > 0, we should probably
+        // issue a warning here.
+        $this->autocommit = $onoff ? true : false;
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        if ($this->transaction_opcount > 0) {
+            $result = @ifx_query('COMMIT WORK', $this->connection);
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->ifxRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        if ($this->transaction_opcount > 0) {
+            $result = @ifx_query('ROLLBACK WORK', $this->connection);
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->ifxRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ ifxRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_ifx::errorNative(), DB_ifx::errorCode()
+     */
+    function ifxRaiseError($errno = null)
+    {
+        if ($errno === null) {
+            $errno = $this->errorCode(ifx_error());
+        }
+        return $this->raiseError($errno, null, null, null,
+                                 $this->errorNative());
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error code and message produced by the last query
+     *
+     * @return string  the DBMS' error code and message
+     */
+    function errorNative()
+    {
+        return @ifx_error() . ' ' . @ifx_errormsg();
+    }
+
+    // }}}
+    // {{{ errorCode()
+
+    /**
+     * Maps native error codes to DB's portable ones.
+     *
+     * Requires that the DB implementation's constructor fills
+     * in the <var>$errorcode_map</var> property.
+     *
+     * @param  string  $nativecode  error code returned by the database
+     * @return int a portable DB error code, or DB_ERROR if this DB
+     * implementation has no mapping for the given error code.
+     */
+    function errorCode($nativecode)
+    {
+        if (ereg('SQLCODE=(.*)]', $nativecode, $match)) {
+            $code = $match[1];
+            if (isset($this->errorcode_map[$code])) {
+                return $this->errorcode_map[$code];
+            }
+        }
+        return DB_ERROR;
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * NOTE: only supports 'table' if <var>$result</var> is a table name.
+     *
+     * If analyzing a query result and the result has duplicate field names,
+     * an error will be raised saying
+     * <samp>can't distinguish duplicate field names</samp>.
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     * @since Method available since Release 1.6.0
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $id = @ifx_query("SELECT * FROM $result WHERE 1=0",
+                             $this->connection);
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_resource($id)) {
+            return $this->ifxRaiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        $flds = @ifx_fieldproperties($id);
+        $count = @ifx_num_fields($id);
+
+        if (count($flds) != $count) {
+            return $this->raiseError("can't distinguish duplicate field names");
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $i   = 0;
+        $res = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        foreach ($flds as $key => $value) {
+            $props = explode(';', $value);
+            $res[$i] = array(
+                'table' => $got_string ? $case_func($result) : '',
+                'name'  => $case_func($key),
+                'type'  => $props[0],
+                'len'   => $props[1],
+                'flags' => $props[4] == 'N' ? 'not_null' : '',
+            );
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+            $i++;
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @ifx_free_result($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'tables':
+                return 'SELECT tabname FROM systables WHERE tabid >= 100';
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/msql.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/msql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/msql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,810 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's msql extension
+ * for interacting with Mini SQL databases
+ *
+ * PHP's mSQL extension did weird things with NULL values prior to PHP
+ * 4.3.11 and 5.0.4.  Make sure your version of PHP meets or exceeds
+ * those versions.
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: msql.php,v 1.57 2005/02/22 07:26:46 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's msql extension
+ * for interacting with Mini SQL databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * PHP's mSQL extension did weird things with NULL values prior to PHP
+ * 4.3.11 and 5.0.4.  Make sure your version of PHP meets or exceeds
+ * those versions.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ * @since      Class not functional until Release 1.7.0
+ */
+class DB_msql extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'msql';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'msql';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'emulate',
+        'new_link'      => false,
+        'numrows'       => true,
+        'pconnect'      => true,
+        'prepare'       => false,
+        'ssl'           => false,
+        'transactions'  => false,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * The query result resource created by PHP
+     *
+     * Used to make affectedRows() work.  Only contains the result for
+     * data manipulation queries.  Contains false for other queries.
+     *
+     * @var resource
+     * @access private
+     */
+    var $_result;
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_msql()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * Example of how to connect:
+     * <code>
+     * require_once 'DB.php';
+     * 
+     * // $dsn = 'msql://hostname/dbname';  // use a TCP connection
+     * $dsn = 'msql:///dbname';             // use a socket
+     * $options = array(
+     *     'portability' => DB_PORTABILITY_ALL,
+     * );
+     * 
+     * $db =& DB::connect($dsn, $options);
+     * if (PEAR::isError($db)) {
+     *     die($db->getMessage());
+     * }
+     * </code>
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('msql')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        $params = array();
+        if ($dsn['hostspec']) {
+            $params[] = $dsn['port']
+                        ? $dsn['hostspec'] . ',' . $dsn['port']
+                        : $dsn['hostspec'];
+        }
+
+        $connect_function = $persistent ? 'msql_pconnect' : 'msql_connect';
+
+        $ini = ini_get('track_errors');
+        $php_errormsg = '';
+        if ($ini) {
+            $this->connection = @call_user_func_array($connect_function,
+                                                      $params);
+        } else {
+            ini_set('track_errors', 1);
+            $this->connection = @call_user_func_array($connect_function,
+                                                      $params);
+            ini_set('track_errors', $ini);
+        }
+
+        if (!$this->connection) {
+            if (($err = @msql_error()) != '') {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null,
+                                         $err);
+            } else {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null,
+                                         $php_errormsg);
+            }
+        }
+
+        if (!@msql_select_db($dsn['database'], $this->connection)) {
+            return $this->msqlRaiseError();
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @msql_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $this->last_query = $query;
+        $query = $this->modifyQuery($query);
+        $result = @msql_query($query, $this->connection);
+        if (!$result) {
+            return $this->msqlRaiseError();
+        }
+        // Determine which queries that should return data, and which
+        // should return an error code only.
+        if (DB::isManip($query)) {
+            $this->_result = $result;
+            return DB_OK;
+        } else {
+            $this->_result = false;
+            return $result;
+        }
+    }
+
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal msql result pointer to the next available result
+     *
+     * @param a valid fbsql result resource
+     *
+     * @access public
+     *
+     * @return true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return false;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * PHP's mSQL extension did weird things with NULL values prior to PHP
+     * 4.3.11 and 5.0.4.  Make sure your version of PHP meets or exceeds
+     * those versions.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum !== null) {
+            if (!@msql_data_seek($result, $rownum)) {
+                return null;
+            }
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            $arr = @msql_fetch_array($result, MSQL_ASSOC);
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @msql_fetch_row($result);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @msql_free_result($result);
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @msql_num_fields($result);
+        if (!$cols) {
+            return $this->msqlRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($result)
+    {
+        $rows = @msql_num_rows($result);
+        if ($rows === false) {
+            return $this->msqlRaiseError();
+        }
+        return $rows;
+    }
+
+    // }}}
+    // {{{ affected()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if (!$this->_result) {
+            return 0;
+        }
+        return msql_affected_rows($this->_result);
+    }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_msql::createSequence(), DB_msql::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $repeat = false;
+        do {
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result =& $this->query("SELECT _seq FROM ${seqname}");
+            $this->popErrorHandling();
+            if ($ondemand && DB::isError($result) &&
+                $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+                $repeat = true;
+                $this->pushErrorHandling(PEAR_ERROR_RETURN);
+                $result = $this->createSequence($seq_name);
+                $this->popErrorHandling();
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+            } else {
+                $repeat = false;
+            }
+        } while ($repeat);
+        if (DB::isError($result)) {
+            return $this->raiseError($result);
+        }
+        $arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
+        $result->free();
+        return $arr[0];
+    }
+
+    // }}}
+    // {{{ createSequence()
+
+    /**
+     * Creates a new sequence
+     *
+     * Also creates a new table to associate the sequence with.  Uses
+     * a separate table to ensure portability with other drivers.
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_msql::nextID(), DB_msql::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $res = $this->query('CREATE TABLE ' . $seqname
+                            . ' (id INTEGER NOT NULL)');
+        if (DB::isError($res)) {
+            return $res;
+        }
+        $res = $this->query("CREATE SEQUENCE ON ${seqname}");
+        return $res;
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_msql::nextID(), DB_msql::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
+    }
+
+    // }}}
+    // {{{ quoteIdentifier()
+
+    /**
+     * mSQL does not support delimited identifiers
+     *
+     * @param string $str  the identifier name to be quoted
+     *
+     * @return object  a DB_Error object
+     *
+     * @see DB_common::quoteIdentifier()
+     * @since Method available since Release 1.7.0
+     */
+    function quoteIdentifier($str)
+    {
+        return $this->raiseError(DB_ERROR_UNSUPPORTED);
+    }
+
+    // }}}
+    // {{{ escapeSimple()
+
+    /**
+     * Escapes a string according to the current DBMS's standards
+     *
+     * @param string $str  the string to be escaped
+     *
+     * @return string  the escaped string
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.7.0
+     */
+    function escapeSimple($str)
+    {
+        return addslashes($str);
+    }
+
+    // }}}
+    // {{{ msqlRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_msql::errorNative(), DB_msql::errorCode()
+     */
+    function msqlRaiseError($errno = null)
+    {
+        $native = $this->errorNative();
+        if ($errno === null) {
+            $errno = $this->errorCode($native);
+        }
+        return $this->raiseError($errno, null, null, null, $native);
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error message produced by the last query
+     *
+     * @return string  the DBMS' error message
+     */
+    function errorNative()
+    {
+        return @msql_error();
+    }
+
+    // }}}
+    // {{{ errorCode()
+
+    /**
+     * Determines PEAR::DB error code from the database's text error message
+     *
+     * @param string $errormsg  the error message returned from the database
+     *
+     * @return integer  the error number from a DB_ERROR* constant
+     */
+    function errorCode($errormsg)
+    {
+        static $error_regexps;
+        if (!isset($error_regexps)) {
+            $error_regexps = array(
+                '/^Access to database denied/i'
+                    => DB_ERROR_ACCESS_VIOLATION,
+                '/^Bad index name/i'
+                    => DB_ERROR_ALREADY_EXISTS,
+                '/^Bad order field/i'
+                    => DB_ERROR_SYNTAX,
+                '/^Bad type for comparison/i'
+                    => DB_ERROR_SYNTAX,
+                '/^Can\'t perform LIKE on/i'
+                    => DB_ERROR_SYNTAX,
+                '/^Can\'t use TEXT fields in LIKE comparison/i'
+                    => DB_ERROR_SYNTAX,
+                '/^Couldn\'t create temporary table/i'
+                    => DB_ERROR_CANNOT_CREATE,
+                '/^Error creating table file/i'
+                    => DB_ERROR_CANNOT_CREATE,
+                '/^Field .* cannot be null$/i'
+                    => DB_ERROR_CONSTRAINT_NOT_NULL,
+                '/^Index (field|condition) .* cannot be null$/i'
+                    => DB_ERROR_SYNTAX,
+                '/^Invalid date format/i'
+                    => DB_ERROR_INVALID_DATE,
+                '/^Invalid time format/i'
+                    => DB_ERROR_INVALID,
+                '/^Literal value for .* is wrong type$/i'
+                    => DB_ERROR_INVALID_NUMBER,
+                '/^No Database Selected/i'
+                    => DB_ERROR_NODBSELECTED,
+                '/^No value specified for field/i'
+                    => DB_ERROR_VALUE_COUNT_ON_ROW,
+                '/^Non unique value for unique index/i'
+                    => DB_ERROR_CONSTRAINT,
+                '/^Out of memory for temporary table/i'
+                    => DB_ERROR_CANNOT_CREATE,
+                '/^Permission denied/i'
+                    => DB_ERROR_ACCESS_VIOLATION,
+                '/^Reference to un-selected table/i'
+                    => DB_ERROR_SYNTAX,
+                '/^syntax error/i'
+                    => DB_ERROR_SYNTAX,
+                '/^Table .* exists$/i'
+                    => DB_ERROR_ALREADY_EXISTS,
+                '/^Unknown database/i'
+                    => DB_ERROR_NOSUCHDB,
+                '/^Unknown field/i'
+                    => DB_ERROR_NOSUCHFIELD,
+                '/^Unknown (index|system variable)/i'
+                    => DB_ERROR_NOT_FOUND,
+                '/^Unknown table/i'
+                    => DB_ERROR_NOSUCHTABLE,
+                '/^Unqualified field/i'
+                    => DB_ERROR_SYNTAX,
+            );
+        }
+
+        foreach ($error_regexps as $regexp => $code) {
+            if (preg_match($regexp, $errormsg)) {
+                return $code;
+            }
+        }
+        return DB_ERROR;
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::setOption()
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $id = @msql_query("SELECT * FROM $result",
+                              $this->connection);
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             * Deprecated.  Here for compatibility only.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_resource($id)) {
+            return $this->raiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = @msql_num_fields($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $tmp = @msql_fetch_field($id);
+
+            $flags = '';
+            if ($tmp->not_null) {
+                $flags .= 'not_null ';
+            }
+            if ($tmp->unique) {
+                $flags .= 'unique_key ';
+            }
+            $flags = trim($flags);
+
+            $res[$i] = array(
+                'table' => $case_func($tmp->table),
+                'name'  => $case_func($tmp->name),
+                'type'  => $tmp->type,
+                'len'   => msql_field_len($id, $i),
+                'flags' => $flags,
+            );
+
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @msql_free_result($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtain a list of a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return array  the array containing the list of objects requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'databases':
+                $id = @msql_list_dbs($this->connection);
+                break;
+            case 'tables':
+                $id = @msql_list_tables($this->dsn['database'],
+                                        $this->connection);
+                break;
+            default:
+                return null;
+        }
+        if (!$id) {
+            return $this->msqlRaiseError();
+        }
+        $out = array();
+        while ($row = @msql_fetch_row($id)) {
+            $out[] = $row[0];
+        }
+        return $out;
+    }
+
+    // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/mssql.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/mssql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/mssql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,914 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's mssql extension
+ * for interacting with Microsoft SQL Server databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Sterling Hughes <sterling at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: mssql.php,v 1.83 2005/03/07 18:24:51 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's mssql extension
+ * for interacting with Microsoft SQL Server databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Sterling Hughes <sterling at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_mssql extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'mssql';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'mssql';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'emulate',
+        'new_link'      => false,
+        'numrows'       => true,
+        'pconnect'      => true,
+        'prepare'       => false,
+        'ssl'           => false,
+        'transactions'  => true,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    // XXX Add here error codes ie: 'S100E' => DB_ERROR_SYNTAX
+    var $errorcode_map = array(
+        110   => DB_ERROR_VALUE_COUNT_ON_ROW,
+        155   => DB_ERROR_NOSUCHFIELD,
+        170   => DB_ERROR_SYNTAX,
+        207   => DB_ERROR_NOSUCHFIELD,
+        208   => DB_ERROR_NOSUCHTABLE,
+        245   => DB_ERROR_INVALID_NUMBER,
+        515   => DB_ERROR_CONSTRAINT_NOT_NULL,
+        547   => DB_ERROR_CONSTRAINT,
+        1913  => DB_ERROR_ALREADY_EXISTS,
+        2627  => DB_ERROR_CONSTRAINT,
+        2714  => DB_ERROR_ALREADY_EXISTS,
+        3701  => DB_ERROR_NOSUCHTABLE,
+        8134  => DB_ERROR_DIVZERO,
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * Should data manipulation queries be committed automatically?
+     * @var bool
+     * @access private
+     */
+    var $autocommit = true;
+
+    /**
+     * The quantity of transactions begun
+     *
+     * {@internal  While this is private, it can't actually be designated
+     * private in PHP 5 because it is directly accessed in the test suite.}}
+     *
+     * @var integer
+     * @access private
+     */
+    var $transaction_opcount = 0;
+
+    /**
+     * The database specified in the DSN
+     *
+     * It's a fix to allow calls to different databases in the same script.
+     *
+     * @var string
+     * @access private
+     */
+    var $_db = null;
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_mssql()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('mssql') && !PEAR::loadExtension('sybase')
+            && !PEAR::loadExtension('sybase_ct'))
+        {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        $params = array(
+            $dsn['hostspec'] ? $dsn['hostspec'] : 'localhost',
+            $dsn['username'] ? $dsn['username'] : null,
+            $dsn['password'] ? $dsn['password'] : null,
+        );
+        if ($dsn['port']) {
+            $params[0] .= ((substr(PHP_OS, 0, 3) == 'WIN') ? ',' : ':')
+                        . $dsn['port'];
+        }
+
+        $connect_function = $persistent ? 'mssql_pconnect' : 'mssql_connect';
+
+        $this->connection = @call_user_func_array($connect_function, $params);
+
+        if (!$this->connection) {
+            return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                     null, null, null,
+                                     @mssql_get_last_message());
+        }
+        if ($dsn['database']) {
+            if (!@mssql_select_db($dsn['database'], $this->connection)) {
+                return $this->raiseError(DB_ERROR_NODBSELECTED,
+                                         null, null, null,
+                                         @mssql_get_last_message());
+            }
+            $this->_db = $dsn['database'];
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @mssql_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $ismanip = DB::isManip($query);
+        $this->last_query = $query;
+        if (!@mssql_select_db($this->_db, $this->connection)) {
+            return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
+        }
+        $query = $this->modifyQuery($query);
+        if (!$this->autocommit && $ismanip) {
+            if ($this->transaction_opcount == 0) {
+                $result = @mssql_query('BEGIN TRAN', $this->connection);
+                if (!$result) {
+                    return $this->mssqlRaiseError();
+                }
+            }
+            $this->transaction_opcount++;
+        }
+        $result = @mssql_query($query, $this->connection);
+        if (!$result) {
+            return $this->mssqlRaiseError();
+        }
+        // Determine which queries that should return data, and which
+        // should return an error code only.
+        return $ismanip ? DB_OK : $result;
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal mssql result pointer to the next available result
+     *
+     * @param a valid fbsql result resource
+     *
+     * @access public
+     *
+     * @return true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return @mssql_next_result($result);
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum !== null) {
+            if (!@mssql_data_seek($result, $rownum)) {
+                return null;
+            }
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            $arr = @mssql_fetch_array($result, MSSQL_ASSOC);
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @mssql_fetch_row($result);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @mssql_free_result($result);
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @mssql_num_fields($result);
+        if (!$cols) {
+            return $this->mssqlRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($result)
+    {
+        $rows = @mssql_num_rows($result);
+        if ($rows === false) {
+            return $this->mssqlRaiseError();
+        }
+        return $rows;
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = false)
+    {
+        // XXX if $this->transaction_opcount > 0, we should probably
+        // issue a warning here.
+        $this->autocommit = $onoff ? true : false;
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        if ($this->transaction_opcount > 0) {
+            if (!@mssql_select_db($this->_db, $this->connection)) {
+                return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
+            }
+            $result = @mssql_query('COMMIT TRAN', $this->connection);
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->mssqlRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        if ($this->transaction_opcount > 0) {
+            if (!@mssql_select_db($this->_db, $this->connection)) {
+                return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
+            }
+            $result = @mssql_query('ROLLBACK TRAN', $this->connection);
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->mssqlRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if (DB::isManip($this->last_query)) {
+            $res = @mssql_query('select @@rowcount', $this->connection);
+            if (!$res) {
+                return $this->mssqlRaiseError();
+            }
+            $ar = @mssql_fetch_row($res);
+            if (!$ar) {
+                $result = 0;
+            } else {
+                @mssql_free_result($res);
+                $result = $ar[0];
+            }
+        } else {
+            $result = 0;
+        }
+        return $result;
+    }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_mssql::createSequence(), DB_mssql::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        if (!@mssql_select_db($this->_db, $this->connection)) {
+            return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
+        }
+        $repeat = 0;
+        do {
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result = $this->query("INSERT INTO $seqname (vapor) VALUES (0)");
+            $this->popErrorHandling();
+            if ($ondemand && DB::isError($result) &&
+                ($result->getCode() == DB_ERROR || $result->getCode() == DB_ERROR_NOSUCHTABLE))
+            {
+                $repeat = 1;
+                $result = $this->createSequence($seq_name);
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+            } elseif (!DB::isError($result)) {
+                $result =& $this->query("SELECT @@IDENTITY FROM $seqname");
+                $repeat = 0;
+            } else {
+                $repeat = false;
+            }
+        } while ($repeat);
+        if (DB::isError($result)) {
+            return $this->raiseError($result);
+        }
+        $result = $result->fetchRow(DB_FETCHMODE_ORDERED);
+        return $result[0];
+    }
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_mssql::nextID(), DB_mssql::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        return $this->query('CREATE TABLE '
+                            . $this->getSequenceName($seq_name)
+                            . ' ([id] [int] IDENTITY (1, 1) NOT NULL,'
+                            . ' [vapor] [int] NULL)');
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_mssql::nextID(), DB_mssql::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
+    }
+
+    // }}}
+    // {{{ quoteIdentifier()
+
+    /**
+     * Quotes a string so it can be safely used as a table or column name
+     *
+     * @param string $str  identifier name to be quoted
+     *
+     * @return string  quoted identifier string
+     *
+     * @see DB_common::quoteIdentifier()
+     * @since Method available since Release 1.6.0
+     */
+    function quoteIdentifier($str)
+    {
+        return '[' . str_replace(']', ']]', $str) . ']';
+    }
+
+    // }}}
+    // {{{ mssqlRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_mssql::errorNative(), DB_mssql::errorCode()
+     */
+    function mssqlRaiseError($code = null)
+    {
+        $message = @mssql_get_last_message();
+        if (!$code) {
+            $code = $this->errorNative();
+        }
+        return $this->raiseError($this->errorCode($code, $message),
+                                 null, null, null, "$code - $message");
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error code produced by the last query
+     *
+     * @return int  the DBMS' error code
+     */
+    function errorNative()
+    {
+        $res = @mssql_query('select @@ERROR as ErrorCode', $this->connection);
+        if (!$res) {
+            return DB_ERROR;
+        }
+        $row = @mssql_fetch_row($res);
+        return $row[0];
+    }
+
+    // }}}
+    // {{{ errorCode()
+
+    /**
+     * Determines PEAR::DB error code from mssql's native codes.
+     *
+     * If <var>$nativecode</var> isn't known yet, it will be looked up.
+     *
+     * @param  mixed  $nativecode  mssql error code, if known
+     * @return integer  an error number from a DB error constant
+     * @see errorNative()
+     */
+    function errorCode($nativecode = null, $msg = '')
+    {
+        if (!$nativecode) {
+            $nativecode = $this->errorNative();
+        }
+        if (isset($this->errorcode_map[$nativecode])) {
+            if ($nativecode == 3701
+                && preg_match('/Cannot drop the index/i', $msg))
+            {
+                return DB_ERROR_NOT_FOUND;
+            }
+            return $this->errorcode_map[$nativecode];
+        } else {
+            return DB_ERROR;
+        }
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * NOTE: only supports 'table' and 'flags' if <var>$result</var>
+     * is a table name.
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            if (!@mssql_select_db($this->_db, $this->connection)) {
+                return $this->mssqlRaiseError(DB_ERROR_NODBSELECTED);
+            }
+            $id = @mssql_query("SELECT * FROM $result WHERE 1=0",
+                               $this->connection);
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             * Deprecated.  Here for compatibility only.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_resource($id)) {
+            return $this->mssqlRaiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = @mssql_num_fields($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $res[$i] = array(
+                'table' => $got_string ? $case_func($result) : '',
+                'name'  => $case_func(@mssql_field_name($id, $i)),
+                'type'  => @mssql_field_type($id, $i),
+                'len'   => @mssql_field_length($id, $i),
+                // We only support flags for table
+                'flags' => $got_string
+                           ? $this->_mssql_field_flags($result,
+                                                       @mssql_field_name($id, $i))
+                           : '',
+            );
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @mssql_free_result($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ _mssql_field_flags()
+
+    /**
+     * Get a column's flags
+     *
+     * Supports "not_null", "primary_key",
+     * "auto_increment" (mssql identity), "timestamp" (mssql timestamp),
+     * "unique_key" (mssql unique index, unique check or primary_key) and
+     * "multiple_key" (multikey index)
+     *
+     * mssql timestamp is NOT similar to the mysql timestamp so this is maybe
+     * not useful at all - is the behaviour of mysql_field_flags that primary
+     * keys are alway unique? is the interpretation of multiple_key correct?
+     *
+     * @param string $table   the table name
+     * @param string $column  the field name
+     *
+     * @return string  the flags
+     *
+     * @access private
+     * @author Joern Barthel <j_barthel at web.de>
+     */
+    function _mssql_field_flags($table, $column)
+    {
+        static $tableName = null;
+        static $flags = array();
+
+        if ($table != $tableName) {
+
+            $flags = array();
+            $tableName = $table;
+
+            // get unique and primary keys
+            $res = $this->getAll("EXEC SP_HELPINDEX[$table]", DB_FETCHMODE_ASSOC);
+
+            foreach ($res as $val) {
+                $keys = explode(', ', $val['index_keys']);
+
+                if (sizeof($keys) > 1) {
+                    foreach ($keys as $key) {
+                        $this->_add_flag($flags[$key], 'multiple_key');
+                    }
+                }
+
+                if (strpos($val['index_description'], 'primary key')) {
+                    foreach ($keys as $key) {
+                        $this->_add_flag($flags[$key], 'primary_key');
+                    }
+                } elseif (strpos($val['index_description'], 'unique')) {
+                    foreach ($keys as $key) {
+                        $this->_add_flag($flags[$key], 'unique_key');
+                    }
+                }
+            }
+
+            // get auto_increment, not_null and timestamp
+            $res = $this->getAll("EXEC SP_COLUMNS[$table]", DB_FETCHMODE_ASSOC);
+
+            foreach ($res as $val) {
+                $val = array_change_key_case($val, CASE_LOWER);
+                if ($val['nullable'] == '0') {
+                    $this->_add_flag($flags[$val['column_name']], 'not_null');
+                }
+                if (strpos($val['type_name'], 'identity')) {
+                    $this->_add_flag($flags[$val['column_name']], 'auto_increment');
+                }
+                if (strpos($val['type_name'], 'timestamp')) {
+                    $this->_add_flag($flags[$val['column_name']], 'timestamp');
+                }
+            }
+        }
+
+        if (array_key_exists($column, $flags)) {
+            return(implode(' ', $flags[$column]));
+        }
+        return '';
+    }
+
+    // }}}
+    // {{{ _add_flag()
+
+    /**
+     * Adds a string to the flags array if the flag is not yet in there
+     * - if there is no flag present the array is created
+     *
+     * @param array  &$array  the reference to the flag-array
+     * @param string $value   the flag value
+     *
+     * @return void
+     *
+     * @access private
+     * @author Joern Barthel <j_barthel at web.de>
+     */
+    function _add_flag(&$array, $value)
+    {
+        if (!is_array($array)) {
+            $array = array($value);
+        } elseif (!in_array($value, $array)) {
+            array_push($array, $value);
+        }
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'tables':
+                return "SELECT name FROM sysobjects WHERE type = 'U'"
+                       . ' ORDER BY name';
+            case 'views':
+                return "SELECT name FROM sysobjects WHERE type = 'V'";
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/mysql.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/mysql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/mysql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1034 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's mysql extension
+ * for interacting with MySQL databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: mysql.php,v 1.117 2005/03/29 15:03:26 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's mysql extension
+ * for interacting with MySQL databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_mysql extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'mysql';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'mysql';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'alter',
+        'new_link'      => '4.2.0',
+        'numrows'       => true,
+        'pconnect'      => true,
+        'prepare'       => false,
+        'ssl'           => false,
+        'transactions'  => true,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+        1004 => DB_ERROR_CANNOT_CREATE,
+        1005 => DB_ERROR_CANNOT_CREATE,
+        1006 => DB_ERROR_CANNOT_CREATE,
+        1007 => DB_ERROR_ALREADY_EXISTS,
+        1008 => DB_ERROR_CANNOT_DROP,
+        1022 => DB_ERROR_ALREADY_EXISTS,
+        1044 => DB_ERROR_ACCESS_VIOLATION,
+        1046 => DB_ERROR_NODBSELECTED,
+        1048 => DB_ERROR_CONSTRAINT,
+        1049 => DB_ERROR_NOSUCHDB,
+        1050 => DB_ERROR_ALREADY_EXISTS,
+        1051 => DB_ERROR_NOSUCHTABLE,
+        1054 => DB_ERROR_NOSUCHFIELD,
+        1061 => DB_ERROR_ALREADY_EXISTS,
+        1062 => DB_ERROR_ALREADY_EXISTS,
+        1064 => DB_ERROR_SYNTAX,
+        1091 => DB_ERROR_NOT_FOUND,
+        1100 => DB_ERROR_NOT_LOCKED,
+        1136 => DB_ERROR_VALUE_COUNT_ON_ROW,
+        1142 => DB_ERROR_ACCESS_VIOLATION,
+        1146 => DB_ERROR_NOSUCHTABLE,
+        1216 => DB_ERROR_CONSTRAINT,
+        1217 => DB_ERROR_CONSTRAINT,
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * Should data manipulation queries be committed automatically?
+     * @var bool
+     * @access private
+     */
+    var $autocommit = true;
+
+    /**
+     * The quantity of transactions begun
+     *
+     * {@internal  While this is private, it can't actually be designated
+     * private in PHP 5 because it is directly accessed in the test suite.}}
+     *
+     * @var integer
+     * @access private
+     */
+    var $transaction_opcount = 0;
+
+    /**
+     * The database specified in the DSN
+     *
+     * It's a fix to allow calls to different databases in the same script.
+     *
+     * @var string
+     * @access private
+     */
+    var $_db = '';
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_mysql()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * PEAR DB's mysql driver supports the following extra DSN options:
+     *   + new_link      If set to true, causes subsequent calls to connect()
+     *                    to return a new connection link instead of the
+     *                    existing one.  WARNING: this is not portable to
+     *                    other DBMS's. Available since PEAR DB 1.7.0.
+     *   + client_flags  Any combination of MYSQL_CLIENT_* constants.
+     *                    Only used if PHP is at version 4.3.0 or greater.
+     *                    Available since PEAR DB 1.7.0.
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('mysql')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        $params = array();
+        if ($dsn['protocol'] && $dsn['protocol'] == 'unix') {
+            $params[0] = ':' . $dsn['socket'];
+        } else {
+            $params[0] = $dsn['hostspec'] ? $dsn['hostspec']
+                         : 'localhost';
+            if ($dsn['port']) {
+                $params[0] .= ':' . $dsn['port'];
+            }
+        }
+        $params[] = $dsn['username'] ? $dsn['username'] : null;
+        $params[] = $dsn['password'] ? $dsn['password'] : null;
+
+        if (!$persistent) {
+            if (isset($dsn['new_link'])
+                && ($dsn['new_link'] == 'true' || $dsn['new_link'] === true))
+            {
+                $params[] = true;
+            } else {
+                $params[] = false;
+            }
+        }
+        if (version_compare(phpversion(), '4.3.0', '>=')) {
+            $params[] = isset($dsn['client_flags'])
+                        ? $dsn['client_flags'] : null;
+        }
+
+        $connect_function = $persistent ? 'mysql_pconnect' : 'mysql_connect';
+
+        $ini = ini_get('track_errors');
+        $php_errormsg = '';
+        if ($ini) {
+            $this->connection = @call_user_func_array($connect_function,
+                                                      $params);
+        } else {
+            ini_set('track_errors', 1);
+            $this->connection = @call_user_func_array($connect_function,
+                                                      $params);
+            ini_set('track_errors', $ini);
+        }
+
+        if (!$this->connection) {
+            if (($err = @mysql_error()) != '') {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null, 
+                                         $err);
+            } else {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null,
+                                         $php_errormsg);
+            }
+        }
+
+        if ($dsn['database']) {
+            if (!@mysql_select_db($dsn['database'], $this->connection)) {
+                return $this->mysqlRaiseError();
+            }
+            $this->_db = $dsn['database'];
+        }
+
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @mysql_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * Generally uses mysql_query().  If you want to use
+     * mysql_unbuffered_query() set the "result_buffering" option to 0 using
+     * setOptions().  This option was added in Release 1.7.0.
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $ismanip = DB::isManip($query);
+        $this->last_query = $query;
+        $query = $this->modifyQuery($query);
+        if ($this->_db) {
+            if (!@mysql_select_db($this->_db, $this->connection)) {
+                return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
+            }
+        }
+        if (!$this->autocommit && $ismanip) {
+            if ($this->transaction_opcount == 0) {
+                $result = @mysql_query('SET AUTOCOMMIT=0', $this->connection);
+                $result = @mysql_query('BEGIN', $this->connection);
+                if (!$result) {
+                    return $this->mysqlRaiseError();
+                }
+            }
+            $this->transaction_opcount++;
+        }
+        if (!$this->options['result_buffering']) {
+            $result = @mysql_unbuffered_query($query, $this->connection);
+        } else {
+            $result = @mysql_query($query, $this->connection);
+        }
+        if (!$result) {
+            return $this->mysqlRaiseError();
+        }
+        if (is_resource($result)) {
+            return $result;
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal mysql result pointer to the next available result
+     *
+     * This method has not been implemented yet.
+     *
+     * @param a valid sql result resource
+     *
+     * @return false
+     */
+    function nextResult($result)
+    {
+        return false;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum !== null) {
+            if (!@mysql_data_seek($result, $rownum)) {
+                return null;
+            }
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            $arr = @mysql_fetch_array($result, MYSQL_ASSOC);
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @mysql_fetch_row($result);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            /*
+             * Even though this DBMS already trims output, we do this because
+             * a field might have intentional whitespace at the end that
+             * gets removed by DB_PORTABILITY_RTRIM under another driver.
+             */
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @mysql_free_result($result);
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @mysql_num_fields($result);
+        if (!$cols) {
+            return $this->mysqlRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($result)
+    {
+        $rows = @mysql_num_rows($result);
+        if ($rows === null) {
+            return $this->mysqlRaiseError();
+        }
+        return $rows;
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = false)
+    {
+        // XXX if $this->transaction_opcount > 0, we should probably
+        // issue a warning here.
+        $this->autocommit = $onoff ? true : false;
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        if ($this->transaction_opcount > 0) {
+            if ($this->_db) {
+                if (!@mysql_select_db($this->_db, $this->connection)) {
+                    return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
+                }
+            }
+            $result = @mysql_query('COMMIT', $this->connection);
+            $result = @mysql_query('SET AUTOCOMMIT=1', $this->connection);
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->mysqlRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        if ($this->transaction_opcount > 0) {
+            if ($this->_db) {
+                if (!@mysql_select_db($this->_db, $this->connection)) {
+                    return $this->mysqlRaiseError(DB_ERROR_NODBSELECTED);
+                }
+            }
+            $result = @mysql_query('ROLLBACK', $this->connection);
+            $result = @mysql_query('SET AUTOCOMMIT=1', $this->connection);
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->mysqlRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if (DB::isManip($this->last_query)) {
+            return @mysql_affected_rows($this->connection);
+        } else {
+            return 0;
+        }
+     }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_mysql::createSequence(), DB_mysql::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        do {
+            $repeat = 0;
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result = $this->query("UPDATE ${seqname} ".
+                                   'SET id=LAST_INSERT_ID(id+1)');
+            $this->popErrorHandling();
+            if ($result === DB_OK) {
+                // COMMON CASE
+                $id = @mysql_insert_id($this->connection);
+                if ($id != 0) {
+                    return $id;
+                }
+                // EMPTY SEQ TABLE
+                // Sequence table must be empty for some reason, so fill
+                // it and return 1 and obtain a user-level lock
+                $result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+                if ($result == 0) {
+                    // Failed to get the lock
+                    return $this->mysqlRaiseError(DB_ERROR_NOT_LOCKED);
+                }
+
+                // add the default value
+                $result = $this->query("REPLACE INTO ${seqname} (id) VALUES (0)");
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+
+                // Release the lock
+                $result = $this->getOne('SELECT RELEASE_LOCK('
+                                        . "'${seqname}_lock')");
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+                // We know what the result will be, so no need to try again
+                return 1;
+
+            } elseif ($ondemand && DB::isError($result) &&
+                $result->getCode() == DB_ERROR_NOSUCHTABLE)
+            {
+                // ONDEMAND TABLE CREATION
+                $result = $this->createSequence($seq_name);
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                } else {
+                    $repeat = 1;
+                }
+
+            } elseif (DB::isError($result) &&
+                      $result->getCode() == DB_ERROR_ALREADY_EXISTS)
+            {
+                // BACKWARDS COMPAT
+                // see _BCsequence() comment
+                $result = $this->_BCsequence($seqname);
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+                $repeat = 1;
+            }
+        } while ($repeat);
+
+        return $this->raiseError($result);
+    }
+
+    // }}}
+    // {{{ createSequence()
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_mysql::nextID(), DB_mysql::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $res = $this->query('CREATE TABLE ' . $seqname
+                            . ' (id INTEGER UNSIGNED AUTO_INCREMENT NOT NULL,'
+                            . ' PRIMARY KEY(id))');
+        if (DB::isError($res)) {
+            return $res;
+        }
+        // insert yields value 1, nextId call will generate ID 2
+        $res = $this->query("INSERT INTO ${seqname} (id) VALUES (0)");
+        if (DB::isError($res)) {
+            return $res;
+        }
+        // so reset to zero
+        return $this->query("UPDATE ${seqname} SET id = 0");
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_mysql::nextID(), DB_mysql::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
+    }
+
+    // }}}
+    // {{{ _BCsequence()
+
+    /**
+     * Backwards compatibility with old sequence emulation implementation
+     * (clean up the dupes)
+     *
+     * @param string $seqname  the sequence name to clean up
+     *
+     * @return bool  true on success.  A DB_Error object on failure.
+     *
+     * @access private
+     */
+    function _BCsequence($seqname)
+    {
+        // Obtain a user-level lock... this will release any previous
+        // application locks, but unlike LOCK TABLES, it does not abort
+        // the current transaction and is much less frequently used.
+        $result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
+        if (DB::isError($result)) {
+            return $result;
+        }
+        if ($result == 0) {
+            // Failed to get the lock, can't do the conversion, bail
+            // with a DB_ERROR_NOT_LOCKED error
+            return $this->mysqlRaiseError(DB_ERROR_NOT_LOCKED);
+        }
+
+        $highest_id = $this->getOne("SELECT MAX(id) FROM ${seqname}");
+        if (DB::isError($highest_id)) {
+            return $highest_id;
+        }
+        // This should kill all rows except the highest
+        // We should probably do something if $highest_id isn't
+        // numeric, but I'm at a loss as how to handle that...
+        $result = $this->query('DELETE FROM ' . $seqname
+                               . " WHERE id <> $highest_id");
+        if (DB::isError($result)) {
+            return $result;
+        }
+
+        // If another thread has been waiting for this lock,
+        // it will go thru the above procedure, but will have no
+        // real effect
+        $result = $this->getOne("SELECT RELEASE_LOCK('${seqname}_lock')");
+        if (DB::isError($result)) {
+            return $result;
+        }
+        return true;
+    }
+
+    // }}}
+    // {{{ quoteIdentifier()
+
+    /**
+     * Quotes a string so it can be safely used as a table or column name
+     *
+     * MySQL can't handle the backtick character (<kbd>`</kbd>) in
+     * table or column names.
+     *
+     * @param string $str  identifier name to be quoted
+     *
+     * @return string  quoted identifier string
+     *
+     * @see DB_common::quoteIdentifier()
+     * @since Method available since Release 1.6.0
+     */
+    function quoteIdentifier($str)
+    {
+        return '`' . $str . '`';
+    }
+
+    // }}}
+    // {{{ quote()
+
+    /**
+     * @deprecated  Deprecated in release 1.6.0
+     */
+    function quote($str)
+    {
+        return $this->quoteSmart($str);
+    }
+
+    // }}}
+    // {{{ escapeSimple()
+
+    /**
+     * Escapes a string according to the current DBMS's standards
+     *
+     * @param string $str  the string to be escaped
+     *
+     * @return string  the escaped string
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function escapeSimple($str)
+    {
+        if (function_exists('mysql_real_escape_string')) {
+            return @mysql_real_escape_string($str, $this->connection);
+        } else {
+            return @mysql_escape_string($str);
+        }
+    }
+
+    // }}}
+    // {{{ modifyQuery()
+
+    /**
+     * Changes a query string for various DBMS specific reasons
+     *
+     * This little hack lets you know how many rows were deleted
+     * when running a "DELETE FROM table" query.  Only implemented
+     * if the DB_PORTABILITY_DELETE_COUNT portability option is on.
+     *
+     * @param string $query  the query string to modify
+     *
+     * @return string  the modified query string
+     *
+     * @access protected
+     * @see DB_common::setOption()
+     */
+    function modifyQuery($query)
+    {
+        if ($this->options['portability'] & DB_PORTABILITY_DELETE_COUNT) {
+            // "DELETE FROM table" gives 0 affected rows in MySQL.
+            // This little hack lets you know how many rows were deleted.
+            if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $query)) {
+                $query = preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/',
+                                      'DELETE FROM \1 WHERE 1=1', $query);
+            }
+        }
+        return $query;
+    }
+
+    // }}}
+    // {{{ modifyLimitQuery()
+
+    /**
+     * Adds LIMIT clauses to a query string according to current DBMS standards
+     *
+     * @param string $query   the query to modify
+     * @param int    $from    the row to start to fetching (0 = the first row)
+     * @param int    $count   the numbers of rows to fetch
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return string  the query string with LIMIT clauses added
+     *
+     * @access protected
+     */
+    function modifyLimitQuery($query, $from, $count, $params = array())
+    {
+        if (DB::isManip($query)) {
+            return $query . " LIMIT $count";
+        } else {
+            return $query . " LIMIT $from, $count";
+        }
+    }
+
+    // }}}
+    // {{{ mysqlRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_mysql::errorNative(), DB_common::errorCode()
+     */
+    function mysqlRaiseError($errno = null)
+    {
+        if ($errno === null) {
+            if ($this->options['portability'] & DB_PORTABILITY_ERRORS) {
+                $this->errorcode_map[1022] = DB_ERROR_CONSTRAINT;
+                $this->errorcode_map[1048] = DB_ERROR_CONSTRAINT_NOT_NULL;
+                $this->errorcode_map[1062] = DB_ERROR_CONSTRAINT;
+            } else {
+                // Doing this in case mode changes during runtime.
+                $this->errorcode_map[1022] = DB_ERROR_ALREADY_EXISTS;
+                $this->errorcode_map[1048] = DB_ERROR_CONSTRAINT;
+                $this->errorcode_map[1062] = DB_ERROR_ALREADY_EXISTS;
+            }
+            $errno = $this->errorCode(mysql_errno($this->connection));
+        }
+        return $this->raiseError($errno, null, null, null,
+                                 @mysql_errno($this->connection) . ' ** ' .
+                                 @mysql_error($this->connection));
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error code produced by the last query
+     *
+     * @return int  the DBMS' error code
+     */
+    function errorNative()
+    {
+        return @mysql_errno($this->connection);
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $id = @mysql_list_fields($this->dsn['database'],
+                                     $result, $this->connection);
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             * Deprecated.  Here for compatibility only.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_resource($id)) {
+            return $this->mysqlRaiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = @mysql_num_fields($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $res[$i] = array(
+                'table' => $case_func(@mysql_field_table($id, $i)),
+                'name'  => $case_func(@mysql_field_name($id, $i)),
+                'type'  => @mysql_field_type($id, $i),
+                'len'   => @mysql_field_len($id, $i),
+                'flags' => @mysql_field_flags($id, $i),
+            );
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @mysql_free_result($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'tables':
+                return 'SHOW TABLES';
+            case 'users':
+                return 'SELECT DISTINCT User FROM mysql.user';
+            case 'databases':
+                return 'SHOW DATABASES';
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/mysqli.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/mysqli.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/mysqli.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1076 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's mysqli extension
+ * for interacting with MySQL databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: mysqli.php,v 1.69 2005/03/04 23:12:36 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's mysqli extension
+ * for interacting with MySQL databases
+ *
+ * This is for MySQL versions 4.1 and above.  Requires PHP 5.
+ *
+ * Note that persistent connections no longer exist.
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ * @since      Class functional since Release 1.6.3
+ */
+class DB_mysqli extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'mysqli';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'mysqli';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'alter',
+        'new_link'      => false,
+        'numrows'       => true,
+        'pconnect'      => false,
+        'prepare'       => false,
+        'ssl'           => true,
+        'transactions'  => true,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+        1004 => DB_ERROR_CANNOT_CREATE,
+        1005 => DB_ERROR_CANNOT_CREATE,
+        1006 => DB_ERROR_CANNOT_CREATE,
+        1007 => DB_ERROR_ALREADY_EXISTS,
+        1008 => DB_ERROR_CANNOT_DROP,
+        1022 => DB_ERROR_ALREADY_EXISTS,
+        1044 => DB_ERROR_ACCESS_VIOLATION,
+        1046 => DB_ERROR_NODBSELECTED,
+        1048 => DB_ERROR_CONSTRAINT,
+        1049 => DB_ERROR_NOSUCHDB,
+        1050 => DB_ERROR_ALREADY_EXISTS,
+        1051 => DB_ERROR_NOSUCHTABLE,
+        1054 => DB_ERROR_NOSUCHFIELD,
+        1061 => DB_ERROR_ALREADY_EXISTS,
+        1062 => DB_ERROR_ALREADY_EXISTS,
+        1064 => DB_ERROR_SYNTAX,
+        1091 => DB_ERROR_NOT_FOUND,
+        1100 => DB_ERROR_NOT_LOCKED,
+        1136 => DB_ERROR_VALUE_COUNT_ON_ROW,
+        1142 => DB_ERROR_ACCESS_VIOLATION,
+        1146 => DB_ERROR_NOSUCHTABLE,
+        1216 => DB_ERROR_CONSTRAINT,
+        1217 => DB_ERROR_CONSTRAINT,
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * Should data manipulation queries be committed automatically?
+     * @var bool
+     * @access private
+     */
+    var $autocommit = true;
+
+    /**
+     * The quantity of transactions begun
+     *
+     * {@internal  While this is private, it can't actually be designated
+     * private in PHP 5 because it is directly accessed in the test suite.}}
+     *
+     * @var integer
+     * @access private
+     */
+    var $transaction_opcount = 0;
+
+    /**
+     * The database specified in the DSN
+     *
+     * It's a fix to allow calls to different databases in the same script.
+     *
+     * @var string
+     * @access private
+     */
+    var $_db = '';
+
+    /**
+     * Array for converting MYSQLI_*_FLAG constants to text values
+     * @var    array
+     * @access public
+     * @since  Property available since Release 1.6.5
+     */
+    var $mysqli_flags = array(
+        MYSQLI_NOT_NULL_FLAG        => 'not_null',
+        MYSQLI_PRI_KEY_FLAG         => 'primary_key',
+        MYSQLI_UNIQUE_KEY_FLAG      => 'unique_key',
+        MYSQLI_MULTIPLE_KEY_FLAG    => 'multiple_key',
+        MYSQLI_BLOB_FLAG            => 'blob',
+        MYSQLI_UNSIGNED_FLAG        => 'unsigned',
+        MYSQLI_ZEROFILL_FLAG        => 'zerofill',
+        MYSQLI_AUTO_INCREMENT_FLAG  => 'auto_increment',
+        MYSQLI_TIMESTAMP_FLAG       => 'timestamp',
+        MYSQLI_SET_FLAG             => 'set',
+        // MYSQLI_NUM_FLAG             => 'numeric',  // unnecessary
+        // MYSQLI_PART_KEY_FLAG        => 'multiple_key',  // duplicatvie
+        MYSQLI_GROUP_FLAG           => 'group_by'
+    );
+
+    /**
+     * Array for converting MYSQLI_TYPE_* constants to text values
+     * @var    array
+     * @access public
+     * @since  Property available since Release 1.6.5
+     */
+    var $mysqli_types = array(
+        MYSQLI_TYPE_DECIMAL     => 'decimal',
+        MYSQLI_TYPE_TINY        => 'tinyint',
+        MYSQLI_TYPE_SHORT       => 'int',
+        MYSQLI_TYPE_LONG        => 'int',
+        MYSQLI_TYPE_FLOAT       => 'float',
+        MYSQLI_TYPE_DOUBLE      => 'double',
+        // MYSQLI_TYPE_NULL        => 'DEFAULT NULL',  // let flags handle it
+        MYSQLI_TYPE_TIMESTAMP   => 'timestamp',
+        MYSQLI_TYPE_LONGLONG    => 'bigint',
+        MYSQLI_TYPE_INT24       => 'mediumint',
+        MYSQLI_TYPE_DATE        => 'date',
+        MYSQLI_TYPE_TIME        => 'time',
+        MYSQLI_TYPE_DATETIME    => 'datetime',
+        MYSQLI_TYPE_YEAR        => 'year',
+        MYSQLI_TYPE_NEWDATE     => 'date',
+        MYSQLI_TYPE_ENUM        => 'enum',
+        MYSQLI_TYPE_SET         => 'set',
+        MYSQLI_TYPE_TINY_BLOB   => 'tinyblob',
+        MYSQLI_TYPE_MEDIUM_BLOB => 'mediumblob',
+        MYSQLI_TYPE_LONG_BLOB   => 'longblob',
+        MYSQLI_TYPE_BLOB        => 'blob',
+        MYSQLI_TYPE_VAR_STRING  => 'varchar',
+        MYSQLI_TYPE_STRING      => 'char',
+        MYSQLI_TYPE_GEOMETRY    => 'geometry',
+    );
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_mysqli()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * PEAR DB's mysqli driver supports the following extra DSN options:
+     *   + When the 'ssl' $option passed to DB::connect() is true:
+     *     + key      The path to the key file.
+     *     + cert     The path to the certificate file.
+     *     + ca       The path to the certificate authority file.
+     *     + capath   The path to a directory that contains trusted SSL
+     *                 CA certificates in pem format.
+     *     + cipher   The list of allowable ciphers for SSL encryption.
+     *
+     * Example of how to connect using SSL:
+     * <code>
+     * require_once 'DB.php';
+     * 
+     * $dsn = array(
+     *     'phptype'  => 'mysqli',
+     *     'username' => 'someuser',
+     *     'password' => 'apasswd',
+     *     'hostspec' => 'localhost',
+     *     'database' => 'thedb',
+     *     'key'      => 'client-key.pem',
+     *     'cert'     => 'client-cert.pem',
+     *     'ca'       => 'cacert.pem',
+     *     'capath'   => '/path/to/ca/dir',
+     *     'cipher'   => 'AES',
+     * );
+     * 
+     * $options = array(
+     *     'ssl' => true,
+     * );
+     * 
+     * $db =& DB::connect($dsn, $options);
+     * if (PEAR::isError($db)) {
+     *     die($db->getMessage());
+     * }
+     * </code>
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('mysqli')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        $ini = ini_get('track_errors');
+        ini_set('track_errors', 1);
+        $php_errormsg = '';
+
+        if ($this->getOption('ssl') === true) {
+            $init = mysqli_init();
+            mysqli_ssl_set(
+                $init,
+                empty($dsn['key'])    ? null : $dsn['key'],
+                empty($dsn['cert'])   ? null : $dsn['cert'],
+                empty($dsn['ca'])     ? null : $dsn['ca'],
+                empty($dsn['capath']) ? null : $dsn['capath'],
+                empty($dsn['cipher']) ? null : $dsn['cipher']
+            );
+            if ($this->connection = @mysqli_real_connect(
+                    $init,
+                    $dsn['hostspec'],
+                    $dsn['username'],
+                    $dsn['password'],
+                    $dsn['database'],
+                    $dsn['port'],
+                    $dsn['socket']))
+            {
+                $this->connection = $init;
+            }
+        } else {
+            $this->connection = @mysqli_connect(
+                $dsn['hostspec'],
+                $dsn['username'],
+                $dsn['password'],
+                $dsn['database'],
+                $dsn['port'],
+                $dsn['socket']
+            );
+        }
+
+        ini_set('track_errors', $ini);
+
+        if (!$this->connection) {
+            if (($err = @mysqli_connect_error()) != '') {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null,
+                                         $err);
+            } else {
+                return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                         null, null, null,
+                                         $php_errormsg);
+            }
+        }
+
+        if ($dsn['database']) {
+            $this->_db = $dsn['database'];
+        }
+
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @mysqli_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $ismanip = DB::isManip($query);
+        $this->last_query = $query;
+        $query = $this->modifyQuery($query);
+        if ($this->_db) {
+            if (!@mysqli_select_db($this->connection, $this->_db)) {
+                return $this->mysqliRaiseError(DB_ERROR_NODBSELECTED);
+            }
+        }
+        if (!$this->autocommit && $ismanip) {
+            if ($this->transaction_opcount == 0) {
+                $result = @mysqli_query($this->connection, 'SET AUTOCOMMIT=0');
+                $result = @mysqli_query($this->connection, 'BEGIN');
+                if (!$result) {
+                    return $this->mysqliRaiseError();
+                }
+            }
+            $this->transaction_opcount++;
+        }
+        $result = @mysqli_query($this->connection, $query);
+        if (!$result) {
+            return $this->mysqliRaiseError();
+        }
+        if (is_object($result)) {
+            return $result;
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal mysql result pointer to the next available result.
+     *
+     * This method has not been implemented yet.
+     *
+     * @param resource $result a valid sql result resource
+     * @return false
+     * @access public
+     */
+    function nextResult($result)
+    {
+        return false;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum !== null) {
+            if (!@mysqli_data_seek($result, $rownum)) {
+                return null;
+            }
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            $arr = @mysqli_fetch_array($result, MYSQLI_ASSOC);
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @mysqli_fetch_row($result);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            /*
+             * Even though this DBMS already trims output, we do this because
+             * a field might have intentional whitespace at the end that
+             * gets removed by DB_PORTABILITY_RTRIM under another driver.
+             */
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @mysqli_free_result($result);
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @mysqli_num_fields($result);
+        if (!$cols) {
+            return $this->mysqliRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($result)
+    {
+        $rows = @mysqli_num_rows($result);
+        if ($rows === null) {
+            return $this->mysqliRaiseError();
+        }
+        return $rows;
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = false)
+    {
+        // XXX if $this->transaction_opcount > 0, we should probably
+        // issue a warning here.
+        $this->autocommit = $onoff ? true : false;
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        if ($this->transaction_opcount > 0) {
+            if ($this->_db) {
+                if (!@mysqli_select_db($this->connection, $this->_db)) {
+                    return $this->mysqliRaiseError(DB_ERROR_NODBSELECTED);
+                }
+            }
+            $result = @mysqli_query($this->connection, 'COMMIT');
+            $result = @mysqli_query($this->connection, 'SET AUTOCOMMIT=1');
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->mysqliRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        if ($this->transaction_opcount > 0) {
+            if ($this->_db) {
+                if (!@mysqli_select_db($this->connection, $this->_db)) {
+                    return $this->mysqliRaiseError(DB_ERROR_NODBSELECTED);
+                }
+            }
+            $result = @mysqli_query($this->connection, 'ROLLBACK');
+            $result = @mysqli_query($this->connection, 'SET AUTOCOMMIT=1');
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->mysqliRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if (DB::isManip($this->last_query)) {
+            return @mysqli_affected_rows($this->connection);
+        } else {
+            return 0;
+        }
+     }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_mysqli::createSequence(), DB_mysqli::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        do {
+            $repeat = 0;
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result = $this->query('UPDATE ' . $seqname
+                                   . ' SET id = LAST_INSERT_ID(id + 1)');
+            $this->popErrorHandling();
+            if ($result === DB_OK) {
+                // COMMON CASE
+                $id = @mysqli_insert_id($this->connection);
+                if ($id != 0) {
+                    return $id;
+                }
+
+                // EMPTY SEQ TABLE
+                // Sequence table must be empty for some reason,
+                // so fill it and return 1
+                // Obtain a user-level lock
+                $result = $this->getOne('SELECT GET_LOCK('
+                                        . "'${seqname}_lock', 10)");
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+                if ($result == 0) {
+                    return $this->mysqliRaiseError(DB_ERROR_NOT_LOCKED);
+                }
+
+                // add the default value
+                $result = $this->query('REPLACE INTO ' . $seqname
+                                       . ' (id) VALUES (0)');
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+
+                // Release the lock
+                $result = $this->getOne('SELECT RELEASE_LOCK('
+                                        . "'${seqname}_lock')");
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+                // We know what the result will be, so no need to try again
+                return 1;
+
+            } elseif ($ondemand && DB::isError($result) &&
+                $result->getCode() == DB_ERROR_NOSUCHTABLE)
+            {
+                // ONDEMAND TABLE CREATION
+                $result = $this->createSequence($seq_name);
+
+                // Since createSequence initializes the ID to be 1,
+                // we do not need to retrieve the ID again (or we will get 2)
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                } else {
+                    // First ID of a newly created sequence is 1
+                    return 1;
+                }
+
+            } elseif (DB::isError($result) &&
+                      $result->getCode() == DB_ERROR_ALREADY_EXISTS)
+            {
+                // BACKWARDS COMPAT
+                // see _BCsequence() comment
+                $result = $this->_BCsequence($seqname);
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+                $repeat = 1;
+            }
+        } while ($repeat);
+
+        return $this->raiseError($result);
+    }
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_mysqli::nextID(), DB_mysqli::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $res = $this->query('CREATE TABLE ' . $seqname
+                            . ' (id INTEGER UNSIGNED AUTO_INCREMENT NOT NULL,'
+                            . ' PRIMARY KEY(id))');
+        if (DB::isError($res)) {
+            return $res;
+        }
+        // insert yields value 1, nextId call will generate ID 2
+        return $this->query("INSERT INTO ${seqname} (id) VALUES (0)");
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_mysql::nextID(), DB_mysql::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
+    }
+
+    // }}}
+    // {{{ _BCsequence()
+
+    /**
+     * Backwards compatibility with old sequence emulation implementation
+     * (clean up the dupes)
+     *
+     * @param string $seqname  the sequence name to clean up
+     *
+     * @return bool  true on success.  A DB_Error object on failure.
+     *
+     * @access private
+     */
+    function _BCsequence($seqname)
+    {
+        // Obtain a user-level lock... this will release any previous
+        // application locks, but unlike LOCK TABLES, it does not abort
+        // the current transaction and is much less frequently used.
+        $result = $this->getOne("SELECT GET_LOCK('${seqname}_lock',10)");
+        if (DB::isError($result)) {
+            return $result;
+        }
+        if ($result == 0) {
+            // Failed to get the lock, can't do the conversion, bail
+            // with a DB_ERROR_NOT_LOCKED error
+            return $this->mysqliRaiseError(DB_ERROR_NOT_LOCKED);
+        }
+
+        $highest_id = $this->getOne("SELECT MAX(id) FROM ${seqname}");
+        if (DB::isError($highest_id)) {
+            return $highest_id;
+        }
+
+        // This should kill all rows except the highest
+        // We should probably do something if $highest_id isn't
+        // numeric, but I'm at a loss as how to handle that...
+        $result = $this->query('DELETE FROM ' . $seqname
+                               . " WHERE id <> $highest_id");
+        if (DB::isError($result)) {
+            return $result;
+        }
+
+        // If another thread has been waiting for this lock,
+        // it will go thru the above procedure, but will have no
+        // real effect
+        $result = $this->getOne("SELECT RELEASE_LOCK('${seqname}_lock')");
+        if (DB::isError($result)) {
+            return $result;
+        }
+        return true;
+    }
+
+    // }}}
+    // {{{ quoteIdentifier()
+
+    /**
+     * Quotes a string so it can be safely used as a table or column name
+     *
+     * MySQL can't handle the backtick character (<kbd>`</kbd>) in
+     * table or column names.
+     *
+     * @param string $str  identifier name to be quoted
+     *
+     * @return string  quoted identifier string
+     *
+     * @see DB_common::quoteIdentifier()
+     * @since Method available since Release 1.6.0
+     */
+    function quoteIdentifier($str)
+    {
+        return '`' . $str . '`';
+    }
+
+    // }}}
+    // {{{ escapeSimple()
+
+    /**
+     * Escapes a string according to the current DBMS's standards
+     *
+     * @param string $str  the string to be escaped
+     *
+     * @return string  the escaped string
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function escapeSimple($str)
+    {
+        return @mysqli_real_escape_string($this->connection, $str);
+    }
+
+    // }}}
+    // {{{ modifyLimitQuery()
+
+    /**
+     * Adds LIMIT clauses to a query string according to current DBMS standards
+     *
+     * @param string $query   the query to modify
+     * @param int    $from    the row to start to fetching (0 = the first row)
+     * @param int    $count   the numbers of rows to fetch
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return string  the query string with LIMIT clauses added
+     *
+     * @access protected
+     */
+    function modifyLimitQuery($query, $from, $count, $params = array())
+    {
+        if (DB::isManip($query)) {
+            return $query . " LIMIT $count";
+        } else {
+            return $query . " LIMIT $from, $count";
+        }
+    }
+
+    // }}}
+    // {{{ mysqliRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_mysqli::errorNative(), DB_common::errorCode()
+     */
+    function mysqliRaiseError($errno = null)
+    {
+        if ($errno === null) {
+            if ($this->options['portability'] & DB_PORTABILITY_ERRORS) {
+                $this->errorcode_map[1022] = DB_ERROR_CONSTRAINT;
+                $this->errorcode_map[1048] = DB_ERROR_CONSTRAINT_NOT_NULL;
+                $this->errorcode_map[1062] = DB_ERROR_CONSTRAINT;
+            } else {
+                // Doing this in case mode changes during runtime.
+                $this->errorcode_map[1022] = DB_ERROR_ALREADY_EXISTS;
+                $this->errorcode_map[1048] = DB_ERROR_CONSTRAINT;
+                $this->errorcode_map[1062] = DB_ERROR_ALREADY_EXISTS;
+            }
+            $errno = $this->errorCode(mysqli_errno($this->connection));
+        }
+        return $this->raiseError($errno, null, null, null,
+                                 @mysqli_errno($this->connection) . ' ** ' .
+                                 @mysqli_error($this->connection));
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error code produced by the last query
+     *
+     * @return int  the DBMS' error code
+     */
+    function errorNative()
+    {
+        return @mysqli_errno($this->connection);
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::setOption()
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $id = @mysqli_query($this->connection,
+                                "SELECT * FROM $result LIMIT 0");
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             * Deprecated.  Here for compatibility only.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_a($id, 'mysqli_result')) {
+            return $this->mysqliRaiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = @mysqli_num_fields($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $tmp = @mysqli_fetch_field($id);
+
+            $flags = '';
+            foreach ($this->mysqli_flags as $const => $means) {
+                if ($tmp->flags & $const) {
+                    $flags .= $means . ' ';
+                }
+            }
+            if ($tmp->def) {
+                $flags .= 'default_' . rawurlencode($tmp->def);
+            }
+            $flags = trim($flags);
+
+            $res[$i] = array(
+                'table' => $case_func($tmp->table),
+                'name'  => $case_func($tmp->name),
+                'type'  => isset($this->mysqli_types[$tmp->type])
+                                    ? $this->mysqli_types[$tmp->type]
+                                    : 'unknown',
+                'len'   => $tmp->max_length,
+                'flags' => $flags,
+            );
+
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @mysqli_free_result($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'tables':
+                return 'SHOW TABLES';
+            case 'users':
+                return 'SELECT DISTINCT User FROM mysql.user';
+            case 'databases':
+                return 'SHOW DATABASES';
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/oci8.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/oci8.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/oci8.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1117 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's oci8 extension
+ * for interacting with Oracle databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     James L. Pine <jlp at valinux.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: oci8.php,v 1.103 2005/04/11 15:10:22 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's oci8 extension
+ * for interacting with Oracle databases
+ *
+ * Definitely works with versions 8 and 9 of Oracle.
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * Be aware...  OCIError() only appears to return anything when given a
+ * statement, so functions return the generic DB_ERROR instead of more
+ * useful errors that have to do with feedback from the database.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     James L. Pine <jlp at valinux.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_oci8 extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'oci8';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'oci8';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'alter',
+        'new_link'      => '5.0.0',
+        'numrows'       => 'subquery',
+        'pconnect'      => true,
+        'prepare'       => true,
+        'ssl'           => false,
+        'transactions'  => true,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+        1    => DB_ERROR_CONSTRAINT,
+        900  => DB_ERROR_SYNTAX,
+        904  => DB_ERROR_NOSUCHFIELD,
+        913  => DB_ERROR_VALUE_COUNT_ON_ROW,
+        921  => DB_ERROR_SYNTAX,
+        923  => DB_ERROR_SYNTAX,
+        942  => DB_ERROR_NOSUCHTABLE,
+        955  => DB_ERROR_ALREADY_EXISTS,
+        1400 => DB_ERROR_CONSTRAINT_NOT_NULL,
+        1401 => DB_ERROR_INVALID,
+        1407 => DB_ERROR_CONSTRAINT_NOT_NULL,
+        1418 => DB_ERROR_NOT_FOUND,
+        1476 => DB_ERROR_DIVZERO,
+        1722 => DB_ERROR_INVALID_NUMBER,
+        2289 => DB_ERROR_NOSUCHTABLE,
+        2291 => DB_ERROR_CONSTRAINT,
+        2292 => DB_ERROR_CONSTRAINT,
+        2449 => DB_ERROR_CONSTRAINT,
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * Should data manipulation queries be committed automatically?
+     * @var bool
+     * @access private
+     */
+    var $autocommit = true;
+
+    /**
+     * Stores the $data passed to execute() in the oci8 driver
+     *
+     * Gets reset to array() when simpleQuery() is run.
+     *
+     * Needed in case user wants to call numRows() after prepare/execute
+     * was used.
+     *
+     * @var array
+     * @access private
+     */
+    var $_data = array();
+
+    /**
+     * The result or statement handle from the most recently executed query
+     * @var resource
+     */
+    var $last_stmt;
+
+    /**
+     * Is the given prepared statement a data manipulation query?
+     * @var array
+     * @access private
+     */
+    var $manip_query = array();
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_oci8()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * If PHP is at version 5.0.0 or greater:
+     *   + Generally, oci_connect() or oci_pconnect() are used.
+     *   + But if the new_link DSN option is set to true, oci_new_connect()
+     *     is used.
+     *
+     * When using PHP version 4.x, OCILogon() or OCIPLogon() are used.
+     *
+     * PEAR DB's oci8 driver supports the following extra DSN options:
+     *   + charset       The character set to be used on the connection.
+     *                    Only used if PHP is at version 5.0.0 or greater
+     *                    and the Oracle server is at 9.2 or greater.
+     *                    Available since PEAR DB 1.7.0.
+     *   + new_link      If set to true, causes subsequent calls to
+     *                    connect() to return a new connection link
+     *                    instead of the existing one.  WARNING: this is
+     *                    not portable to other DBMS's.
+     *                    Available since PEAR DB 1.7.0.
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('oci8')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        if (function_exists('oci_connect')) {
+            if (isset($dsn['new_link'])
+                && ($dsn['new_link'] == 'true' || $dsn['new_link'] === true))
+            {
+                $connect_function = 'oci_new_connect';
+            } else {
+                $connect_function = $persistent ? 'oci_pconnect'
+                                    : 'oci_connect';
+            }
+
+            // Backwards compatibility with DB < 1.7.0
+            if (empty($dsn['database']) && !empty($dsn['hostspec'])) {
+                $db = $dsn['hostspec'];
+            } else {
+                $db = $dsn['database'];
+            }
+
+            $char = empty($dsn['charset']) ? null : $dsn['charset'];
+            $this->connection = @$connect_function($dsn['username'],
+                                                   $dsn['password'],
+                                                   $db,
+                                                   $char);
+            $error = OCIError();
+            if (!empty($error) && $error['code'] == 12541) {
+                // Couldn't find TNS listener.  Try direct connection.
+                $this->connection = @$connect_function($dsn['username'],
+                                                       $dsn['password'],
+                                                       null,
+                                                       $char);
+            }
+        } else {
+            $connect_function = $persistent ? 'OCIPLogon' : 'OCILogon';
+            if ($dsn['hostspec']) {
+                $this->connection = @$connect_function($dsn['username'],
+                                                       $dsn['password'],
+                                                       $dsn['hostspec']);
+            } elseif ($dsn['username'] || $dsn['password']) {
+                $this->connection = @$connect_function($dsn['username'],
+                                                       $dsn['password']);
+            }
+        }
+
+        if (!$this->connection) {
+            $error = OCIError();
+            $error = (is_array($error)) ? $error['message'] : null;
+            return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                     null, null, null,
+                                     $error);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        if (function_exists('oci_close')) {
+            $ret = @oci_close($this->connection);
+        } else {
+            $ret = @OCILogOff($this->connection);
+        }
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * To determine how many rows of a result set get buffered using
+     * ocisetprefetch(), see the "result_buffering" option in setOptions().
+     * This option was added in Release 1.7.0.
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $this->_data = array();
+        $this->last_parameters = array();
+        $this->last_query = $query;
+        $query = $this->modifyQuery($query);
+        $result = @OCIParse($this->connection, $query);
+        if (!$result) {
+            return $this->oci8RaiseError();
+        }
+        if ($this->autocommit) {
+            $success = @OCIExecute($result,OCI_COMMIT_ON_SUCCESS);
+        } else {
+            $success = @OCIExecute($result,OCI_DEFAULT);
+        }
+        if (!$success) {
+            return $this->oci8RaiseError($result);
+        }
+        $this->last_stmt = $result;
+        if (DB::isManip($query)) {
+            return DB_OK;
+        } else {
+            @ocisetprefetch($result, $this->options['result_buffering']);
+            return $result;
+        }
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal oracle result pointer to the next available result
+     *
+     * @param a valid oci8 result resource
+     *
+     * @access public
+     *
+     * @return true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return false;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum !== null) {
+            return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            $moredata = @OCIFetchInto($result,$arr,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS);
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE &&
+                $moredata)
+            {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $moredata = OCIFetchInto($result,$arr,OCI_RETURN_NULLS+OCI_RETURN_LOBS);
+        }
+        if (!$moredata) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @OCIFreeStatement($result);
+    }
+
+    /**
+     * Frees the internal resources associated with a prepared query
+     *
+     * @param resource $stmt           the prepared statement's resource
+     * @param bool     $free_resource  should the PHP resource be freed too?
+     *                                  Use false if you need to get data
+     *                                  from the result set later.
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_oci8::prepare()
+     */
+    function freePrepared($stmt, $free_resource = true)
+    {
+        if (!is_resource($stmt)) {
+            return false;
+        }
+        if ($free_resource) {
+            @ocifreestatement($stmt);
+        }
+        if (isset($this->prepare_types[(int)$stmt])) {
+            unset($this->prepare_types[(int)$stmt]);
+            unset($this->manip_query[(int)$stmt]);
+        } else {
+            return false;
+        }
+        return true;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * Only works if the DB_PORTABILITY_NUMROWS portability option
+     * is turned on.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows(), DB_common::setOption()
+     */
+    function numRows($result)
+    {
+        // emulate numRows for Oracle.  yuck.
+        if ($this->options['portability'] & DB_PORTABILITY_NUMROWS &&
+            $result === $this->last_stmt)
+        {
+            $countquery = 'SELECT COUNT(*) FROM ('.$this->last_query.')';
+            $save_query = $this->last_query;
+            $save_stmt = $this->last_stmt;
+
+            if (count($this->_data)) {
+                $smt = $this->prepare('SELECT COUNT(*) FROM ('.$this->last_query.')');
+                $count = $this->execute($smt, $this->_data);
+            } else {
+                $count =& $this->query($countquery);
+            }
+
+            if (DB::isError($count) ||
+                DB::isError($row = $count->fetchRow(DB_FETCHMODE_ORDERED)))
+            {
+                $this->last_query = $save_query;
+                $this->last_stmt = $save_stmt;
+                return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+            }
+            return $row[0];
+        }
+        return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @OCINumCols($result);
+        if (!$cols) {
+            return $this->oci8RaiseError($result);
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ prepare()
+
+    /**
+     * Prepares a query for multiple execution with execute().
+     *
+     * With oci8, this is emulated.
+     *
+     * prepare() requires a generic query as string like <code>
+     *    INSERT INTO numbers VALUES (?, ?, ?)
+     * </code>.  The <kbd>?</kbd> characters are placeholders.
+     *
+     * Three types of placeholders can be used:
+     *   + <kbd>?</kbd>  a quoted scalar value, i.e. strings, integers
+     *   + <kbd>!</kbd>  value is inserted 'as is'
+     *   + <kbd>&</kbd>  requires a file name.  The file's contents get
+     *                     inserted into the query (i.e. saving binary
+     *                     data in a db)
+     *
+     * Use backslashes to escape placeholder characters if you don't want
+     * them to be interpreted as placeholders.  Example: <code>
+     *    "UPDATE foo SET col=? WHERE col='over \& under'"
+     * </code>
+     *
+     * @param string $query  the query to be prepared
+     *
+     * @return mixed  DB statement resource on success. DB_Error on failure.
+     *
+     * @see DB_oci8::execute()
+     */
+    function prepare($query)
+    {
+        $tokens   = preg_split('/((?<!\\\)[&?!])/', $query, -1,
+                               PREG_SPLIT_DELIM_CAPTURE);
+        $binds    = count($tokens) - 1;
+        $token    = 0;
+        $types    = array();
+        $newquery = '';
+
+        foreach ($tokens as $key => $val) {
+            switch ($val) {
+                case '?':
+                    $types[$token++] = DB_PARAM_SCALAR;
+                    unset($tokens[$key]);
+                    break;
+                case '&':
+                    $types[$token++] = DB_PARAM_OPAQUE;
+                    unset($tokens[$key]);
+                    break;
+                case '!':
+                    $types[$token++] = DB_PARAM_MISC;
+                    unset($tokens[$key]);
+                    break;
+                default:
+                    $tokens[$key] = preg_replace('/\\\([&?!])/', "\\1", $val);
+                    if ($key != $binds) {
+                        $newquery .= $tokens[$key] . ':bind' . $token;
+                    } else {
+                        $newquery .= $tokens[$key];
+                    }
+            }
+        }
+
+        $this->last_query = $query;
+        $newquery = $this->modifyQuery($newquery);
+        if (!$stmt = @OCIParse($this->connection, $newquery)) {
+            return $this->oci8RaiseError();
+        }
+        $this->prepare_types[(int)$stmt] = $types;
+        $this->manip_query[(int)$stmt] = DB::isManip($query);
+        return $stmt;
+    }
+
+    // }}}
+    // {{{ execute()
+
+    /**
+     * Executes a DB statement prepared with prepare().
+     *
+     * To determine how many rows of a result set get buffered using
+     * ocisetprefetch(), see the "result_buffering" option in setOptions().
+     * This option was added in Release 1.7.0.
+     *
+     * @param resource  $stmt  a DB statement resource returned from prepare()
+     * @param mixed  $data  array, string or numeric data to be used in
+     *                      execution of the statement.  Quantity of items
+     *                      passed must match quantity of placeholders in
+     *                      query:  meaning 1 for non-array items or the
+     *                      quantity of elements in the array.
+     *
+     * @return mixed  returns an oic8 result resource for successful SELECT
+     *                queries, DB_OK for other successful queries.
+     *                A DB error object is returned on failure.
+     *
+     * @see DB_oci8::prepare()
+     */
+    function &execute($stmt, $data = array())
+    {
+        $data = (array)$data;
+        $this->last_parameters = $data;
+        $this->_data = $data;
+
+        $types =& $this->prepare_types[(int)$stmt];
+        if (count($types) != count($data)) {
+            $tmp =& $this->raiseError(DB_ERROR_MISMATCH);
+            return $tmp;
+        }
+
+        $i = 0;
+        foreach ($data as $key => $value) {
+            if ($types[$i] == DB_PARAM_MISC) {
+                /*
+                 * Oracle doesn't seem to have the ability to pass a
+                 * parameter along unchanged, so strip off quotes from start
+                 * and end, plus turn two single quotes to one single quote,
+                 * in order to avoid the quotes getting escaped by
+                 * Oracle and ending up in the database.
+                 */
+                $data[$key] = preg_replace("/^'(.*)'$/", "\\1", $data[$key]);
+                $data[$key] = str_replace("''", "'", $data[$key]);
+            } elseif ($types[$i] == DB_PARAM_OPAQUE) {
+                $fp = @fopen($data[$key], 'rb');
+                if (!$fp) {
+                    $tmp =& $this->raiseError(DB_ERROR_ACCESS_VIOLATION);
+                    return $tmp;
+                }
+                $data[$key] = fread($fp, filesize($data[$key]));
+                fclose($fp);
+            }
+            if (!@OCIBindByName($stmt, ':bind' . $i, $data[$key], -1)) {
+                $tmp = $this->oci8RaiseError($stmt);
+                return $tmp;
+            }
+            $i++;
+        }
+        if ($this->autocommit) {
+            $success = @OCIExecute($stmt, OCI_COMMIT_ON_SUCCESS);
+        } else {
+            $success = @OCIExecute($stmt, OCI_DEFAULT);
+        }
+        if (!$success) {
+            $tmp = $this->oci8RaiseError($stmt);
+            return $tmp;
+        }
+        $this->last_stmt = $stmt;
+        if ($this->manip_query[(int)$stmt]) {
+            $tmp = DB_OK;
+        } else {
+            @ocisetprefetch($stmt, $this->options['result_buffering']);
+            $tmp =& new DB_result($this, $stmt);
+        }
+        return $tmp;
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = false)
+    {
+        $this->autocommit = (bool)$onoff;;
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        $result = @OCICommit($this->connection);
+        if (!$result) {
+            return $this->oci8RaiseError();
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        $result = @OCIRollback($this->connection);
+        if (!$result) {
+            return $this->oci8RaiseError();
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if ($this->last_stmt === false) {
+            return $this->oci8RaiseError();
+        }
+        $result = @OCIRowCount($this->last_stmt);
+        if ($result === false) {
+            return $this->oci8RaiseError($this->last_stmt);
+        }
+        return $result;
+    }
+
+    // }}}
+    // {{{ modifyQuery()
+
+    /**
+     * Changes a query string for various DBMS specific reasons
+     *
+     * "SELECT 2+2" must be "SELECT 2+2 FROM dual" in Oracle.
+     *
+     * @param string $query  the query string to modify
+     *
+     * @return string  the modified query string
+     *
+     * @access protected
+     */
+    function modifyQuery($query)
+    {
+        if (preg_match('/^\s*SELECT/i', $query) &&
+            !preg_match('/\sFROM\s/i', $query)) {
+            $query .= ' FROM dual';
+        }
+        return $query;
+    }
+
+    // }}}
+    // {{{ modifyLimitQuery()
+
+    /**
+     * Adds LIMIT clauses to a query string according to current DBMS standards
+     *
+     * @param string $query   the query to modify
+     * @param int    $from    the row to start to fetching (0 = the first row)
+     * @param int    $count   the numbers of rows to fetch
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return string  the query string with LIMIT clauses added
+     *
+     * @access protected
+     */
+    function modifyLimitQuery($query, $from, $count, $params = array())
+    {
+        // Let Oracle return the name of the columns instead of
+        // coding a "home" SQL parser
+
+        if (count($params)) {
+            $result = $this->prepare("SELECT * FROM ($query) "
+                                     . 'WHERE NULL = NULL');
+            $tmp =& $this->execute($result, $params);
+        } else {
+            $q_fields = "SELECT * FROM ($query) WHERE NULL = NULL";
+
+            if (!$result = @OCIParse($this->connection, $q_fields)) {
+                $this->last_query = $q_fields;
+                return $this->oci8RaiseError();
+            }
+            if (!@OCIExecute($result, OCI_DEFAULT)) {
+                $this->last_query = $q_fields;
+                return $this->oci8RaiseError($result);
+            }
+        }
+
+        $ncols = OCINumCols($result);
+        $cols  = array();
+        for ( $i = 1; $i <= $ncols; $i++ ) {
+            $cols[] = '"' . OCIColumnName($result, $i) . '"';
+        }
+        $fields = implode(', ', $cols);
+        // XXX Test that (tip by John Lim)
+        //if (preg_match('/^\s*SELECT\s+/is', $query, $match)) {
+        //    // Introduce the FIRST_ROWS Oracle query optimizer
+        //    $query = substr($query, strlen($match[0]), strlen($query));
+        //    $query = "SELECT /* +FIRST_ROWS */ " . $query;
+        //}
+
+        // Construct the query
+        // more at: http://marc.theaimsgroup.com/?l=php-db&m=99831958101212&w=2
+        // Perhaps this could be optimized with the use of Unions
+        $query = "SELECT $fields FROM".
+                 "  (SELECT rownum as linenum, $fields FROM".
+                 "      ($query)".
+                 '  WHERE rownum <= '. ($from + $count) .
+                 ') WHERE linenum >= ' . ++$from;
+        return $query;
+    }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_oci8::createSequence(), DB_oci8::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $repeat = 0;
+        do {
+            $this->expectError(DB_ERROR_NOSUCHTABLE);
+            $result =& $this->query("SELECT ${seqname}.nextval FROM dual");
+            $this->popExpect();
+            if ($ondemand && DB::isError($result) &&
+                $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+                $repeat = 1;
+                $result = $this->createSequence($seq_name);
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+            } else {
+                $repeat = 0;
+            }
+        } while ($repeat);
+        if (DB::isError($result)) {
+            return $this->raiseError($result);
+        }
+        $arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
+        return $arr[0];
+    }
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_oci8::nextID(), DB_oci8::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        return $this->query('CREATE SEQUENCE '
+                            . $this->getSequenceName($seq_name));
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_oci8::nextID(), DB_oci8::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP SEQUENCE '
+                            . $this->getSequenceName($seq_name));
+    }
+
+    // }}}
+    // {{{ oci8RaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_oci8::errorNative(), DB_oci8::errorCode()
+     */
+    function oci8RaiseError($errno = null)
+    {
+        if ($errno === null) {
+            $error = @OCIError($this->connection);
+            return $this->raiseError($this->errorCode($error['code']),
+                                     null, null, null, $error['message']);
+        } elseif (is_resource($errno)) {
+            $error = @OCIError($errno);
+            return $this->raiseError($this->errorCode($error['code']),
+                                     null, null, null, $error['message']);
+        }
+        return $this->raiseError($this->errorCode($errno));
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error code produced by the last query
+     *
+     * @return int  the DBMS' error code.  FALSE if the code could not be
+     *               determined
+     */
+    function errorNative()
+    {
+        if (is_resource($this->last_stmt)) {
+            $error = @OCIError($this->last_stmt);
+        } else {
+            $error = @OCIError($this->connection);
+        }
+        if (is_array($error)) {
+            return $error['code'];
+        }
+        return false;
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * NOTE: only supports 'table' and 'flags' if <var>$result</var>
+     * is a table name.
+     *
+     * NOTE: flags won't contain index information.
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $res = array();
+
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $result = strtoupper($result);
+            $q_fields = 'SELECT column_name, data_type, data_length, '
+                        . 'nullable '
+                        . 'FROM user_tab_columns '
+                        . "WHERE table_name='$result' ORDER BY column_id";
+
+            $this->last_query = $q_fields;
+
+            if (!$stmt = @OCIParse($this->connection, $q_fields)) {
+                return $this->oci8RaiseError(DB_ERROR_NEED_MORE_DATA);
+            }
+            if (!@OCIExecute($stmt, OCI_DEFAULT)) {
+                return $this->oci8RaiseError($stmt);
+            }
+
+            $i = 0;
+            while (@OCIFetch($stmt)) {
+                $res[$i] = array(
+                    'table' => $case_func($result),
+                    'name'  => $case_func(@OCIResult($stmt, 1)),
+                    'type'  => @OCIResult($stmt, 2),
+                    'len'   => @OCIResult($stmt, 3),
+                    'flags' => (@OCIResult($stmt, 4) == 'N') ? 'not_null' : '',
+                );
+                if ($mode & DB_TABLEINFO_ORDER) {
+                    $res['order'][$res[$i]['name']] = $i;
+                }
+                if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                    $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+                }
+                $i++;
+            }
+
+            if ($mode) {
+                $res['num_fields'] = $i;
+            }
+            @OCIFreeStatement($stmt);
+
+        } else {
+            if (isset($result->result)) {
+                /*
+                 * Probably received a result object.
+                 * Extract the result resource identifier.
+                 */
+                $result = $result->result;
+            }
+
+            $res = array();
+
+            if ($result === $this->last_stmt) {
+                $count = @OCINumCols($result);
+                if ($mode) {
+                    $res['num_fields'] = $count;
+                }
+                for ($i = 0; $i < $count; $i++) {
+                    $res[$i] = array(
+                        'table' => '',
+                        'name'  => $case_func(@OCIColumnName($result, $i+1)),
+                        'type'  => @OCIColumnType($result, $i+1),
+                        'len'   => @OCIColumnSize($result, $i+1),
+                        'flags' => '',
+                    );
+                    if ($mode & DB_TABLEINFO_ORDER) {
+                        $res['order'][$res[$i]['name']] = $i;
+                    }
+                    if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                        $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+                    }
+                }
+            } else {
+                return $this->raiseError(DB_ERROR_NOT_CAPABLE);
+            }
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'tables':
+                return 'SELECT table_name FROM user_tables';
+            case 'synonyms':
+                return 'SELECT synonym_name FROM user_synonyms';
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/odbc.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/odbc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/odbc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,883 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's odbc extension
+ * for interacting with databases via ODBC connections
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: odbc.php,v 1.78 2005/02/28 01:42:17 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's odbc extension
+ * for interacting with databases via ODBC connections
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * More info on ODBC errors could be found here:
+ * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_err_odbc_5stz.asp
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_odbc extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'odbc';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'sql92';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * NOTE: The feature set of the following drivers are different than
+     * the default:
+     *   + solid: 'transactions' = true
+     *   + navision: 'limit' = false
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'emulate',
+        'new_link'      => false,
+        'numrows'       => true,
+        'pconnect'      => true,
+        'prepare'       => false,
+        'ssl'           => false,
+        'transactions'  => false,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+        '01004' => DB_ERROR_TRUNCATED,
+        '07001' => DB_ERROR_MISMATCH,
+        '21S01' => DB_ERROR_VALUE_COUNT_ON_ROW,
+        '21S02' => DB_ERROR_MISMATCH,
+        '22001' => DB_ERROR_INVALID,
+        '22003' => DB_ERROR_INVALID_NUMBER,
+        '22005' => DB_ERROR_INVALID_NUMBER,
+        '22008' => DB_ERROR_INVALID_DATE,
+        '22012' => DB_ERROR_DIVZERO,
+        '23000' => DB_ERROR_CONSTRAINT,
+        '23502' => DB_ERROR_CONSTRAINT_NOT_NULL,
+        '23503' => DB_ERROR_CONSTRAINT,
+        '23504' => DB_ERROR_CONSTRAINT,
+        '23505' => DB_ERROR_CONSTRAINT,
+        '24000' => DB_ERROR_INVALID,
+        '34000' => DB_ERROR_INVALID,
+        '37000' => DB_ERROR_SYNTAX,
+        '42000' => DB_ERROR_SYNTAX,
+        '42601' => DB_ERROR_SYNTAX,
+        'IM001' => DB_ERROR_UNSUPPORTED,
+        'S0000' => DB_ERROR_NOSUCHTABLE,
+        'S0001' => DB_ERROR_ALREADY_EXISTS,
+        'S0002' => DB_ERROR_NOSUCHTABLE,
+        'S0011' => DB_ERROR_ALREADY_EXISTS,
+        'S0012' => DB_ERROR_NOT_FOUND,
+        'S0021' => DB_ERROR_ALREADY_EXISTS,
+        'S0022' => DB_ERROR_NOSUCHFIELD,
+        'S1009' => DB_ERROR_INVALID,
+        'S1090' => DB_ERROR_INVALID,
+        'S1C00' => DB_ERROR_NOT_CAPABLE,
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * The number of rows affected by a data manipulation query
+     * @var integer
+     * @access private
+     */
+    var $affected = 0;
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_odbc()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * PEAR DB's odbc driver supports the following extra DSN options:
+     *   + cursor  The type of cursor to be used for this connection.
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('odbc')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+        switch ($this->dbsyntax) {
+            case 'access':
+            case 'db2':
+            case 'solid':
+                $this->features['transactions'] = true;
+                break;
+            case 'navision':
+                $this->features['limit'] = false;
+        }
+
+        /*
+         * This is hear for backwards compatibility. Should have been using
+         * 'database' all along, but prior to 1.6.0RC3 'hostspec' was used.
+         */
+        if ($dsn['database']) {
+            $odbcdsn = $dsn['database'];
+        } elseif ($dsn['hostspec']) {
+            $odbcdsn = $dsn['hostspec'];
+        } else {
+            $odbcdsn = 'localhost';
+        }
+
+        $connect_function = $persistent ? 'odbc_pconnect' : 'odbc_connect';
+
+        if (empty($dsn['cursor'])) {
+            $this->connection = @$connect_function($odbcdsn, $dsn['username'],
+                                                   $dsn['password']);
+        } else {
+            $this->connection = @$connect_function($odbcdsn, $dsn['username'],
+                                                   $dsn['password'],
+                                                   $dsn['cursor']);
+        }
+
+        if (!is_resource($this->connection)) {
+            return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                     null, null, null,
+                                     $this->errorNative());
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $err = @odbc_close($this->connection);
+        $this->connection = null;
+        return $err;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $this->last_query = $query;
+        $query = $this->modifyQuery($query);
+        $result = @odbc_exec($this->connection, $query);
+        if (!$result) {
+            return $this->odbcRaiseError(); // XXX ERRORMSG
+        }
+        // Determine which queries that should return data, and which
+        // should return an error code only.
+        if (DB::isManip($query)) {
+            $this->affected = $result; // For affectedRows()
+            return DB_OK;
+        }
+        $this->affected = 0;
+        return $result;
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal odbc result pointer to the next available result
+     *
+     * @param a valid fbsql result resource
+     *
+     * @access public
+     *
+     * @return true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return @odbc_next_result($result);
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        $arr = array();
+        if ($rownum !== null) {
+            $rownum++; // ODBC first row is 1
+            if (version_compare(phpversion(), '4.2.0', 'ge')) {
+                $cols = @odbc_fetch_into($result, $arr, $rownum);
+            } else {
+                $cols = @odbc_fetch_into($result, $rownum, $arr);
+            }
+        } else {
+            $cols = @odbc_fetch_into($result, $arr);
+        }
+        if (!$cols) {
+            return null;
+        }
+        if ($fetchmode !== DB_FETCHMODE_ORDERED) {
+            for ($i = 0; $i < count($arr); $i++) {
+                $colName = @odbc_field_name($result, $i+1);
+                $a[$colName] = $arr[$i];
+            }
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+                $a = array_change_key_case($a, CASE_LOWER);
+            }
+            $arr = $a;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @odbc_free_result($result);
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @odbc_num_fields($result);
+        if (!$cols) {
+            return $this->odbcRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if (empty($this->affected)) {  // In case of SELECT stms
+            return 0;
+        }
+        $nrows = @odbc_num_rows($this->affected);
+        if ($nrows == -1) {
+            return $this->odbcRaiseError();
+        }
+        return $nrows;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * Not all ODBC drivers support this functionality.  If they don't
+     * a DB_Error object for DB_ERROR_UNSUPPORTED is returned.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($result)
+    {
+        $nrows = @odbc_num_rows($result);
+        if ($nrows == -1) {
+            return $this->odbcRaiseError(DB_ERROR_UNSUPPORTED);
+        }
+        if ($nrows === false) {
+            return $this->odbcRaiseError();
+        }
+        return $nrows;
+    }
+
+    // }}}
+    // {{{ quoteIdentifier()
+
+    /**
+     * Quotes a string so it can be safely used as a table or column name
+     *
+     * Use 'mssql' as the dbsyntax in the DB DSN only if you've unchecked
+     * "Use ANSI quoted identifiers" when setting up the ODBC data source.
+     *
+     * @param string $str  identifier name to be quoted
+     *
+     * @return string  quoted identifier string
+     *
+     * @see DB_common::quoteIdentifier()
+     * @since Method available since Release 1.6.0
+     */
+    function quoteIdentifier($str)
+    {
+        switch ($this->dsn['dbsyntax']) {
+            case 'access':
+                return '[' . $str . ']';
+            case 'mssql':
+            case 'sybase':
+                return '[' . str_replace(']', ']]', $str) . ']';
+            case 'mysql':
+            case 'mysqli':
+                return '`' . $str . '`';
+            default:
+                return '"' . str_replace('"', '""', $str) . '"';
+        }
+    }
+
+    // }}}
+    // {{{ quote()
+
+    /**
+     * @deprecated  Deprecated in release 1.6.0
+     * @internal
+     */
+    function quote($str)
+    {
+        return $this->quoteSmart($str);
+    }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_odbc::createSequence(), DB_odbc::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $repeat = 0;
+        do {
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result = $this->query("update ${seqname} set id = id + 1");
+            $this->popErrorHandling();
+            if ($ondemand && DB::isError($result) &&
+                $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+                $repeat = 1;
+                $this->pushErrorHandling(PEAR_ERROR_RETURN);
+                $result = $this->createSequence($seq_name);
+                $this->popErrorHandling();
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+                $result = $this->query("insert into ${seqname} (id) values(0)");
+            } else {
+                $repeat = 0;
+            }
+        } while ($repeat);
+
+        if (DB::isError($result)) {
+            return $this->raiseError($result);
+        }
+
+        $result = $this->query("select id from ${seqname}");
+        if (DB::isError($result)) {
+            return $result;
+        }
+
+        $row = $result->fetchRow(DB_FETCHMODE_ORDERED);
+        if (DB::isError($row || !$row)) {
+            return $row;
+        }
+
+        return $row[0];
+    }
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_odbc::nextID(), DB_odbc::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        return $this->query('CREATE TABLE '
+                            . $this->getSequenceName($seq_name)
+                            . ' (id integer NOT NULL,'
+                            . ' PRIMARY KEY(id))');
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_odbc::nextID(), DB_odbc::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = false)
+    {
+        if (!@odbc_autocommit($this->connection, $onoff)) {
+            return $this->odbcRaiseError();
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        if (!@odbc_commit($this->connection)) {
+            return $this->odbcRaiseError();
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        if (!@odbc_rollback($this->connection)) {
+            return $this->odbcRaiseError();
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ odbcRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_odbc::errorNative(), DB_common::errorCode()
+     */
+    function odbcRaiseError($errno = null)
+    {
+        if ($errno === null) {
+            switch ($this->dbsyntax) {
+                case 'access':
+                    if ($this->options['portability'] & DB_PORTABILITY_ERRORS) {
+                        $this->errorcode_map['07001'] = DB_ERROR_NOSUCHFIELD;
+                    } else {
+                        // Doing this in case mode changes during runtime.
+                        $this->errorcode_map['07001'] = DB_ERROR_MISMATCH;
+                    }
+
+                    $native_code = odbc_error($this->connection);
+
+                    // S1000 is for "General Error."  Let's be more specific.
+                    if ($native_code == 'S1000') {
+                        $errormsg = odbc_errormsg($this->connection);
+                        static $error_regexps;
+                        if (!isset($error_regexps)) {
+                            $error_regexps = array(
+                                '/includes related records.$/i'  => DB_ERROR_CONSTRAINT,
+                                '/cannot contain a Null value/i' => DB_ERROR_CONSTRAINT_NOT_NULL,
+                            );
+                        }
+                        foreach ($error_regexps as $regexp => $code) {
+                            if (preg_match($regexp, $errormsg)) {
+                                return $this->raiseError($code,
+                                        null, null, null,
+                                        $native_code . ' ' . $errormsg);
+                            }
+                        }
+                        $errno = DB_ERROR;
+                    } else {
+                        $errno = $this->errorCode($native_code);
+                    }
+                    break;
+                default:
+                    $errno = $this->errorCode(odbc_error($this->connection));
+            }
+        }
+        return $this->raiseError($errno, null, null, null,
+                                 $this->errorNative());
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error code and message produced by the last query
+     *
+     * @return string  the DBMS' error code and message
+     */
+    function errorNative()
+    {
+        if (!is_resource($this->connection)) {
+            return @odbc_error() . ' ' . @odbc_errormsg();
+        }
+        return @odbc_error($this->connection) . ' ' . @odbc_errormsg($this->connection);
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     * @since Method available since Release 1.7.0
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $id = @odbc_exec($this->connection, "SELECT * FROM $result");
+            if (!$id) {
+                return $this->odbcRaiseError();
+            }
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             * Deprecated.  Here for compatibility only.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_resource($id)) {
+            return $this->odbcRaiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = @odbc_num_fields($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $col = $i + 1;
+            $res[$i] = array(
+                'table' => $got_string ? $case_func($result) : '',
+                'name'  => $case_func(@odbc_field_name($id, $col)),
+                'type'  => @odbc_field_type($id, $col),
+                'len'   => @odbc_field_len($id, $col),
+                'flags' => '',
+            );
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @odbc_free_result($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * Thanks to symbol1 at gmail.com and Philippe.Jausions at 11abacus.com.
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the list of objects requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     * @since Method available since Release 1.7.0
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'databases':
+                if (!function_exists('odbc_data_source')) {
+                    return null;
+                }
+                $res = @odbc_data_source($this->connection, SQL_FETCH_FIRST);
+                if (is_array($res)) {
+                    $out = array($res['server']);
+                    while($res = @odbc_data_source($this->connection,
+                                                   SQL_FETCH_NEXT))
+                    {
+                        $out[] = $res['server'];
+                    }
+                    return $out;
+                } else {
+                    return $this->odbcRaiseError();
+                }
+                break;
+            case 'tables':
+            case 'schema.tables':
+                $keep = 'TABLE';
+                break;
+            case 'views':
+                $keep = 'VIEW';
+                break;
+            default:
+                return null;
+        }
+
+        /*
+         * Removing non-conforming items in the while loop rather than
+         * in the odbc_tables() call because some backends choke on this:
+         *     odbc_tables($this->connection, '', '', '', 'TABLE')
+         */
+        $res  = @odbc_tables($this->connection);
+        if (!$res) {
+            return $this->odbcRaiseError();
+        }
+        $out = array();
+        while ($row = odbc_fetch_array($res)) {
+            if ($row['TABLE_TYPE'] != $keep) {
+                continue;
+            }
+            if ($type == 'schema.tables') {
+                $out[] = $row['TABLE_SCHEM'] . '.' . $row['TABLE_NAME'];
+            } else {
+                $out[] = $row['TABLE_NAME'];
+            }
+        }
+        return $out;
+    }
+
+    // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/pgsql.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/pgsql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/pgsql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1097 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's pgsql extension
+ * for interacting with PostgreSQL databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Rui Hirokawa <hirokawa at php.net>
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: pgsql.php,v 1.126 2005/03/04 23:12:36 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's pgsql extension
+ * for interacting with PostgreSQL databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Rui Hirokawa <hirokawa at php.net>
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_pgsql extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'pgsql';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'pgsql';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'alter',
+        'new_link'      => '4.3.0',
+        'numrows'       => true,
+        'pconnect'      => true,
+        'prepare'       => false,
+        'ssl'           => true,
+        'transactions'  => true,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * Should data manipulation queries be committed automatically?
+     * @var bool
+     * @access private
+     */
+    var $autocommit = true;
+
+    /**
+     * The quantity of transactions begun
+     *
+     * {@internal  While this is private, it can't actually be designated
+     * private in PHP 5 because it is directly accessed in the test suite.}}
+     *
+     * @var integer
+     * @access private
+     */
+    var $transaction_opcount = 0;
+
+    /**
+     * The number of rows affected by a data manipulation query
+     * @var integer
+     */
+    var $affected = 0;
+
+    /**
+     * The current row being looked at in fetchInto()
+     * @var array
+     * @access private
+     */
+    var $row = array();
+
+    /**
+     * The number of rows in a given result set
+     * @var array
+     * @access private
+     */
+    var $_num_rows = array();
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_pgsql()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * PEAR DB's pgsql driver supports the following extra DSN options:
+     *   + connect_timeout  How many seconds to wait for a connection to
+     *                       be established.  Available since PEAR DB 1.7.0.
+     *   + new_link         If set to true, causes subsequent calls to
+     *                       connect() to return a new connection link
+     *                       instead of the existing one.  WARNING: this is
+     *                       not portable to other DBMS's.  Available only
+     *                       if PHP is >= 4.3.0 and PEAR DB is >= 1.7.0.
+     *   + options          Command line options to be sent to the server.
+     *                       Available since PEAR DB 1.6.4.
+     *   + service          Specifies a service name in pg_service.conf that
+     *                       holds additional connection parameters.
+     *                       Available since PEAR DB 1.7.0.
+     *   + sslmode          How should SSL be used when connecting?  Values:
+     *                       disable, allow, prefer or require.
+     *                       Available since PEAR DB 1.7.0.
+     *   + tty              This was used to specify where to send server
+     *                       debug output.  Available since PEAR DB 1.6.4.
+     *
+     * Example of connecting to a new link via a socket:
+     * <code>
+     * require_once 'DB.php';
+     * 
+     * $dsn = 'pgsql://user:pass@unix(/tmp)/dbname?new_link=true';
+     * $options = array(
+     *     'portability' => DB_PORTABILITY_ALL,
+     * );
+     * 
+     * $db =& DB::connect($dsn, $options);
+     * if (PEAR::isError($db)) {
+     *     die($db->getMessage());
+     * }
+     * </code>
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     *
+     * @link http://www.postgresql.org/docs/current/static/libpq.html#LIBPQ-CONNECT
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('pgsql')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        $protocol = $dsn['protocol'] ? $dsn['protocol'] : 'tcp';
+
+        $params = array('');
+        if ($protocol == 'tcp') {
+            if ($dsn['hostspec']) {
+                $params[0] .= 'host=' . $dsn['hostspec'];
+            }
+            if ($dsn['port']) {
+                $params[0] .= ' port=' . $dsn['port'];
+            }
+        } elseif ($protocol == 'unix') {
+            // Allow for pg socket in non-standard locations.
+            if ($dsn['socket']) {
+                $params[0] .= 'host=' . $dsn['socket'];
+            }
+            if ($dsn['port']) {
+                $params[0] .= ' port=' . $dsn['port'];
+            }
+        }
+        if ($dsn['database']) {
+            $params[0] .= ' dbname=\'' . addslashes($dsn['database']) . '\'';
+        }
+        if ($dsn['username']) {
+            $params[0] .= ' user=\'' . addslashes($dsn['username']) . '\'';
+        }
+        if ($dsn['password']) {
+            $params[0] .= ' password=\'' . addslashes($dsn['password']) . '\'';
+        }
+        if (!empty($dsn['options'])) {
+            $params[0] .= ' options=' . $dsn['options'];
+        }
+        if (!empty($dsn['tty'])) {
+            $params[0] .= ' tty=' . $dsn['tty'];
+        }
+        if (!empty($dsn['connect_timeout'])) {
+            $params[0] .= ' connect_timeout=' . $dsn['connect_timeout'];
+        }
+        if (!empty($dsn['sslmode'])) {
+            $params[0] .= ' sslmode=' . $dsn['sslmode'];
+        }
+        if (!empty($dsn['service'])) {
+            $params[0] .= ' service=' . $dsn['service'];
+        }
+
+        if (isset($dsn['new_link'])
+            && ($dsn['new_link'] == 'true' || $dsn['new_link'] === true))
+        {
+            if (version_compare(phpversion(), '4.3.0', '>=')) {
+                $params[] = PGSQL_CONNECT_FORCE_NEW;
+            }
+        }
+
+        $connect_function = $persistent ? 'pg_pconnect' : 'pg_connect';
+
+        $ini = ini_get('track_errors');
+        $php_errormsg = '';
+        if ($ini) {
+            $this->connection = @call_user_func_array($connect_function,
+                                                      $params);
+        } else {
+            ini_set('track_errors', 1);
+            $this->connection = @call_user_func_array($connect_function,
+                                                      $params);
+            ini_set('track_errors', $ini);
+        }
+
+        if (!$this->connection) {
+            return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                     null, null, null,
+                                     $php_errormsg);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @pg_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $ismanip = DB::isManip($query);
+        $this->last_query = $query;
+        $query = $this->modifyQuery($query);
+        if (!$this->autocommit && $ismanip) {
+            if ($this->transaction_opcount == 0) {
+                $result = @pg_exec($this->connection, 'begin;');
+                if (!$result) {
+                    return $this->pgsqlRaiseError();
+                }
+            }
+            $this->transaction_opcount++;
+        }
+        $result = @pg_exec($this->connection, $query);
+        if (!$result) {
+            return $this->pgsqlRaiseError();
+        }
+        // Determine which queries that should return data, and which
+        // should return an error code only.
+        if ($ismanip) {
+            $this->affected = @pg_affected_rows($result);
+            return DB_OK;
+        } elseif (preg_match('/^\s*\(*\s*(SELECT|EXPLAIN|SHOW)\s/si', $query)) {
+            /* PostgreSQL commands:
+               ABORT, ALTER, BEGIN, CLOSE, CLUSTER, COMMIT, COPY,
+               CREATE, DECLARE, DELETE, DROP TABLE, EXPLAIN, FETCH,
+               GRANT, INSERT, LISTEN, LOAD, LOCK, MOVE, NOTIFY, RESET,
+               REVOKE, ROLLBACK, SELECT, SELECT INTO, SET, SHOW,
+               UNLISTEN, UPDATE, VACUUM
+            */
+            $this->row[(int)$result] = 0; // reset the row counter.
+            $numrows = $this->numRows($result);
+            if (is_object($numrows)) {
+                return $numrows;
+            }
+            $this->_num_rows[(int)$result] = $numrows;
+            $this->affected = 0;
+            return $result;
+        } else {
+            $this->affected = 0;
+            return DB_OK;
+        }
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal pgsql result pointer to the next available result
+     *
+     * @param a valid fbsql result resource
+     *
+     * @access public
+     *
+     * @return true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return false;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        $result_int = (int)$result;
+        $rownum = ($rownum !== null) ? $rownum : $this->row[$result_int];
+        if ($rownum >= $this->_num_rows[$result_int]) {
+            return null;
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            $arr = @pg_fetch_array($result, $rownum, PGSQL_ASSOC);
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @pg_fetch_row($result, $rownum);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        $this->row[$result_int] = ++$rownum;
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        if (is_resource($result)) {
+            unset($this->row[(int)$result]);
+            unset($this->_num_rows[(int)$result]);
+            $this->affected = 0;
+            return @pg_freeresult($result);
+        }
+        return false;
+    }
+
+    // }}}
+    // {{{ quote()
+
+    /**
+     * @deprecated  Deprecated in release 1.6.0
+     * @internal
+     */
+    function quote($str)
+    {
+        return $this->quoteSmart($str);
+    }
+
+    // }}}
+    // {{{ quoteSmart()
+
+    /**
+     * Formats input so it can be safely used in a query
+     *
+     * @param mixed $in  the data to be formatted
+     *
+     * @return mixed  the formatted data.  The format depends on the input's
+     *                 PHP type:
+     *                 + null = the string <samp>NULL</samp>
+     *                 + boolean = string <samp>TRUE</samp> or <samp>FALSE</samp>
+     *                 + integer or double = the unquoted number
+     *                 + other (including strings and numeric strings) =
+     *                   the data escaped according to MySQL's settings
+     *                   then encapsulated between single quotes
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function quoteSmart($in)
+    {
+        if (is_int($in) || is_double($in)) {
+            return $in;
+        } elseif (is_bool($in)) {
+            return $in ? 'TRUE' : 'FALSE';
+        } elseif (is_null($in)) {
+            return 'NULL';
+        } else {
+            return "'" . $this->escapeSimple($in) . "'";
+        }
+    }
+
+    // }}}
+    // {{{ escapeSimple()
+
+    /**
+     * Escapes a string according to the current DBMS's standards
+     *
+     * {@internal PostgreSQL treats a backslash as an escape character,
+     * so they are escaped as well.
+     *
+     * Not using pg_escape_string() yet because it requires PostgreSQL
+     * to be at version 7.2 or greater.}}
+     *
+     * @param string $str  the string to be escaped
+     *
+     * @return string  the escaped string
+     *
+     * @see DB_common::quoteSmart()
+     * @since Method available since Release 1.6.0
+     */
+    function escapeSimple($str)
+    {
+        return str_replace("'", "''", str_replace('\\', '\\\\', $str));
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @pg_numfields($result);
+        if (!$cols) {
+            return $this->pgsqlRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($result)
+    {
+        $rows = @pg_numrows($result);
+        if ($rows === null) {
+            return $this->pgsqlRaiseError();
+        }
+        return $rows;
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = false)
+    {
+        // XXX if $this->transaction_opcount > 0, we should probably
+        // issue a warning here.
+        $this->autocommit = $onoff ? true : false;
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        if ($this->transaction_opcount > 0) {
+            // (disabled) hack to shut up error messages from libpq.a
+            //@fclose(@fopen("php://stderr", "w"));
+            $result = @pg_exec($this->connection, 'end;');
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->pgsqlRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        if ($this->transaction_opcount > 0) {
+            $result = @pg_exec($this->connection, 'abort;');
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->pgsqlRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        return $this->affected;
+    }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_pgsql::createSequence(), DB_pgsql::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $repeat = false;
+        do {
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result =& $this->query("SELECT NEXTVAL('${seqname}')");
+            $this->popErrorHandling();
+            if ($ondemand && DB::isError($result) &&
+                $result->getCode() == DB_ERROR_NOSUCHTABLE) {
+                $repeat = true;
+                $this->pushErrorHandling(PEAR_ERROR_RETURN);
+                $result = $this->createSequence($seq_name);
+                $this->popErrorHandling();
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+            } else {
+                $repeat = false;
+            }
+        } while ($repeat);
+        if (DB::isError($result)) {
+            return $this->raiseError($result);
+        }
+        $arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
+        $result->free();
+        return $arr[0];
+    }
+
+    // }}}
+    // {{{ createSequence()
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_pgsql::nextID(), DB_pgsql::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $result = $this->query("CREATE SEQUENCE ${seqname}");
+        return $result;
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_pgsql::nextID(), DB_pgsql::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP SEQUENCE '
+                            . $this->getSequenceName($seq_name));
+    }
+
+    // }}}
+    // {{{ modifyLimitQuery()
+
+    /**
+     * Adds LIMIT clauses to a query string according to current DBMS standards
+     *
+     * @param string $query   the query to modify
+     * @param int    $from    the row to start to fetching (0 = the first row)
+     * @param int    $count   the numbers of rows to fetch
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return string  the query string with LIMIT clauses added
+     *
+     * @access protected
+     */
+    function modifyLimitQuery($query, $from, $count, $params = array())
+    {
+        return "$query LIMIT $count OFFSET $from";
+    }
+
+    // }}}
+    // {{{ pgsqlRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_pgsql::errorNative(), DB_pgsql::errorCode()
+     */
+    function pgsqlRaiseError($errno = null)
+    {
+        $native = $this->errorNative();
+        if ($errno === null) {
+            $errno = $this->errorCode($native);
+        }
+        return $this->raiseError($errno, null, null, null, $native);
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error message produced by the last query
+     *
+     * {@internal Error messages are used instead of error codes 
+     * in order to support older versions of PostgreSQL.}}
+     *
+     * @return string  the DBMS' error message
+     */
+    function errorNative()
+    {
+        return @pg_errormessage($this->connection);
+    }
+
+    // }}}
+    // {{{ errorCode()
+
+    /**
+     * Determines PEAR::DB error code from the database's text error message.
+     *
+     * @param  string  $errormsg  error message returned from the database
+     * @return integer  an error number from a DB error constant
+     */
+    function errorCode($errormsg)
+    {
+        static $error_regexps;
+        if (!isset($error_regexps)) {
+            $error_regexps = array(
+                '/(relation|sequence|table).*does not exist|class .* not found/i'
+                    => DB_ERROR_NOSUCHTABLE,
+                '/index .* does not exist/'
+                    => DB_ERROR_NOT_FOUND,
+                '/column .* does not exist/i'
+                    => DB_ERROR_NOSUCHFIELD,
+                '/relation .* already exists/i'
+                    => DB_ERROR_ALREADY_EXISTS,
+                '/(divide|division) by zero$/i'
+                    => DB_ERROR_DIVZERO,
+                '/pg_atoi: error in .*: can\'t parse /i'
+                    => DB_ERROR_INVALID_NUMBER,
+                '/invalid input syntax for( type)? (integer|numeric)/i'
+                    => DB_ERROR_INVALID_NUMBER,
+                '/value .* is out of range for type \w*int/i'
+                    => DB_ERROR_INVALID_NUMBER,
+                '/integer out of range/i'
+                    => DB_ERROR_INVALID_NUMBER,
+                '/value too long for type character/i'
+                    => DB_ERROR_INVALID,
+                '/attribute .* not found|relation .* does not have attribute/i'
+                    => DB_ERROR_NOSUCHFIELD,
+                '/column .* specified in USING clause does not exist in (left|right) table/i'
+                    => DB_ERROR_NOSUCHFIELD,
+                '/parser: parse error at or near/i'
+                    => DB_ERROR_SYNTAX,
+                '/syntax error at/'
+                    => DB_ERROR_SYNTAX,
+                '/column reference .* is ambiguous/i'
+                    => DB_ERROR_SYNTAX,
+                '/permission denied/'
+                    => DB_ERROR_ACCESS_VIOLATION,
+                '/violates not-null constraint/'
+                    => DB_ERROR_CONSTRAINT_NOT_NULL,
+                '/violates [\w ]+ constraint/'
+                    => DB_ERROR_CONSTRAINT,
+                '/referential integrity violation/'
+                    => DB_ERROR_CONSTRAINT,
+                '/more expressions than target columns/i'
+                    => DB_ERROR_VALUE_COUNT_ON_ROW,
+            );
+        }
+        foreach ($error_regexps as $regexp => $code) {
+            if (preg_match($regexp, $errormsg)) {
+                return $code;
+            }
+        }
+        // Fall back to DB_ERROR if there was no mapping.
+        return DB_ERROR;
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * NOTE: only supports 'table' and 'flags' if <var>$result</var>
+     * is a table name.
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $id = @pg_exec($this->connection, "SELECT * FROM $result LIMIT 0");
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             * Deprecated.  Here for compatibility only.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_resource($id)) {
+            return $this->pgsqlRaiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = @pg_numfields($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $res[$i] = array(
+                'table' => $got_string ? $case_func($result) : '',
+                'name'  => $case_func(@pg_fieldname($id, $i)),
+                'type'  => @pg_fieldtype($id, $i),
+                'len'   => @pg_fieldsize($id, $i),
+                'flags' => $got_string
+                           ? $this->_pgFieldFlags($id, $i, $result)
+                           : '',
+            );
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @pg_freeresult($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ _pgFieldFlags()
+
+    /**
+     * Get a column's flags
+     *
+     * Supports "not_null", "default_value", "primary_key", "unique_key"
+     * and "multiple_key".  The default value is passed through
+     * rawurlencode() in case there are spaces in it.
+     *
+     * @param int $resource   the PostgreSQL result identifier
+     * @param int $num_field  the field number
+     *
+     * @return string  the flags
+     *
+     * @access private
+     */
+    function _pgFieldFlags($resource, $num_field, $table_name)
+    {
+        $field_name = @pg_fieldname($resource, $num_field);
+
+        $result = @pg_exec($this->connection, "SELECT f.attnotnull, f.atthasdef
+                                FROM pg_attribute f, pg_class tab, pg_type typ
+                                WHERE tab.relname = typ.typname
+                                AND typ.typrelid = f.attrelid
+                                AND f.attname = '$field_name'
+                                AND tab.relname = '$table_name'");
+        if (@pg_numrows($result) > 0) {
+            $row = @pg_fetch_row($result, 0);
+            $flags  = ($row[0] == 't') ? 'not_null ' : '';
+
+            if ($row[1] == 't') {
+                $result = @pg_exec($this->connection, "SELECT a.adsrc
+                                    FROM pg_attribute f, pg_class tab, pg_type typ, pg_attrdef a
+                                    WHERE tab.relname = typ.typname AND typ.typrelid = f.attrelid
+                                    AND f.attrelid = a.adrelid AND f.attname = '$field_name'
+                                    AND tab.relname = '$table_name' AND f.attnum = a.adnum");
+                $row = @pg_fetch_row($result, 0);
+                $num = preg_replace("/'(.*)'::\w+/", "\\1", $row[0]);
+                $flags .= 'default_' . rawurlencode($num) . ' ';
+            }
+        } else {
+            $flags = '';
+        }
+        $result = @pg_exec($this->connection, "SELECT i.indisunique, i.indisprimary, i.indkey
+                                FROM pg_attribute f, pg_class tab, pg_type typ, pg_index i
+                                WHERE tab.relname = typ.typname
+                                AND typ.typrelid = f.attrelid
+                                AND f.attrelid = i.indrelid
+                                AND f.attname = '$field_name'
+                                AND tab.relname = '$table_name'");
+        $count = @pg_numrows($result);
+
+        for ($i = 0; $i < $count ; $i++) {
+            $row = @pg_fetch_row($result, $i);
+            $keys = explode(' ', $row[2]);
+
+            if (in_array($num_field + 1, $keys)) {
+                $flags .= ($row[0] == 't' && $row[1] == 'f') ? 'unique_key ' : '';
+                $flags .= ($row[1] == 't') ? 'primary_key ' : '';
+                if (count($keys) > 1)
+                    $flags .= 'multiple_key ';
+            }
+        }
+
+        return trim($flags);
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'tables':
+                return 'SELECT c.relname AS "Name"'
+                        . ' FROM pg_class c, pg_user u'
+                        . ' WHERE c.relowner = u.usesysid'
+                        . " AND c.relkind = 'r'"
+                        . ' AND NOT EXISTS'
+                        . ' (SELECT 1 FROM pg_views'
+                        . '  WHERE viewname = c.relname)'
+                        . " AND c.relname !~ '^(pg_|sql_)'"
+                        . ' UNION'
+                        . ' SELECT c.relname AS "Name"'
+                        . ' FROM pg_class c'
+                        . " WHERE c.relkind = 'r'"
+                        . ' AND NOT EXISTS'
+                        . ' (SELECT 1 FROM pg_views'
+                        . '  WHERE viewname = c.relname)'
+                        . ' AND NOT EXISTS'
+                        . ' (SELECT 1 FROM pg_user'
+                        . '  WHERE usesysid = c.relowner)'
+                        . " AND c.relname !~ '^pg_'";
+            case 'schema.tables':
+                return "SELECT schemaname || '.' || tablename"
+                        . ' AS "Name"'
+                        . ' FROM pg_catalog.pg_tables'
+                        . ' WHERE schemaname NOT IN'
+                        . " ('pg_catalog', 'information_schema', 'pg_toast')";
+            case 'views':
+                // Table cols: viewname | viewowner | definition
+                return 'SELECT viewname from pg_views WHERE schemaname'
+                        . " NOT IN ('information_schema', 'pg_catalog')";
+            case 'users':
+                // cols: usename |usesysid|usecreatedb|usetrace|usesuper|usecatupd|passwd  |valuntil
+                return 'SELECT usename FROM pg_user';
+            case 'databases':
+                return 'SELECT datname FROM pg_database';
+            case 'functions':
+            case 'procedures':
+                return 'SELECT proname FROM pg_proc WHERE proowner <> 1';
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/sqlite.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/sqlite.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/sqlite.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,942 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's sqlite extension
+ * for interacting with SQLite databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Urs Gehrig <urs at circle.ch>
+ * @author     Mika Tuupola <tuupola at appelsiini.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 3.0
+ * @version    CVS: $Id: sqlite.php,v 1.109 2005/03/10 01:22:48 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's sqlite extension
+ * for interacting with SQLite databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * NOTICE:  This driver needs PHP's track_errors ini setting to be on.
+ * It is automatically turned on when connecting to the database.
+ * Make sure your scripts don't turn it off.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Urs Gehrig <urs at circle.ch>
+ * @author     Mika Tuupola <tuupola at appelsiini.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_sqlite extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'sqlite';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'sqlite';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'alter',
+        'new_link'      => false,
+        'numrows'       => true,
+        'pconnect'      => true,
+        'prepare'       => false,
+        'ssl'           => false,
+        'transactions'  => false,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     *
+     * {@internal  Error codes according to sqlite_exec.  See the online
+     * manual at http://sqlite.org/c_interface.html for info.
+     * This error handling based on sqlite_exec is not yet implemented.}}
+     *
+     * @var array
+     */
+    var $errorcode_map = array(
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * SQLite data types
+     *
+     * @link http://www.sqlite.org/datatypes.html
+     *
+     * @var array
+     */
+    var $keywords = array (
+        'BLOB'      => '',
+        'BOOLEAN'   => '',
+        'CHARACTER' => '',
+        'CLOB'      => '',
+        'FLOAT'     => '',
+        'INTEGER'   => '',
+        'KEY'       => '',
+        'NATIONAL'  => '',
+        'NUMERIC'   => '',
+        'NVARCHAR'  => '',
+        'PRIMARY'   => '',
+        'TEXT'      => '',
+        'TIMESTAMP' => '',
+        'UNIQUE'    => '',
+        'VARCHAR'   => '',
+        'VARYING'   => '',
+    );
+
+    /**
+     * The most recent error message from $php_errormsg
+     * @var string
+     * @access private
+     */
+    var $_lasterror = '';
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_sqlite()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * PEAR DB's sqlite driver supports the following extra DSN options:
+     *   + mode  The permissions for the database file, in four digit
+     *            chmod octal format (eg "0600").
+     *
+     * Example of connecting to a database in read-only mode:
+     * <code>
+     * require_once 'DB.php';
+     * 
+     * $dsn = 'sqlite:///path/and/name/of/db/file?mode=0400';
+     * $options = array(
+     *     'portability' => DB_PORTABILITY_ALL,
+     * );
+     * 
+     * $db =& DB::connect($dsn, $options);
+     * if (PEAR::isError($db)) {
+     *     die($db->getMessage());
+     * }
+     * </code>
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('sqlite')) {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        if ($dsn['database']) {
+            if (!file_exists($dsn['database'])) {
+                if (!touch($dsn['database'])) {
+                    return $this->sqliteRaiseError(DB_ERROR_NOT_FOUND);
+                }
+                if (!isset($dsn['mode']) ||
+                    !is_numeric($dsn['mode']))
+                {
+                    $mode = 0644;
+                } else {
+                    $mode = octdec($dsn['mode']);
+                }
+                if (!chmod($dsn['database'], $mode)) {
+                    return $this->sqliteRaiseError(DB_ERROR_NOT_FOUND);
+                }
+                if (!file_exists($dsn['database'])) {
+                    return $this->sqliteRaiseError(DB_ERROR_NOT_FOUND);
+                }
+            }
+            if (!is_file($dsn['database'])) {
+                return $this->sqliteRaiseError(DB_ERROR_INVALID);
+            }
+            if (!is_readable($dsn['database'])) {
+                return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION);
+            }
+        } else {
+            return $this->sqliteRaiseError(DB_ERROR_ACCESS_VIOLATION);
+        }
+
+        $connect_function = $persistent ? 'sqlite_popen' : 'sqlite_open';
+
+        // track_errors must remain on for simpleQuery()
+        ini_set('track_errors', 1);
+        $php_errormsg = '';
+
+        if (!$this->connection = @$connect_function($dsn['database'])) {
+            return $this->raiseError(DB_ERROR_NODBSELECTED,
+                                     null, null, null,
+                                     $php_errormsg);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @sqlite_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * NOTICE:  This method needs PHP's track_errors ini setting to be on.
+     * It is automatically turned on when connecting to the database.
+     * Make sure your scripts don't turn it off.
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $ismanip = DB::isManip($query);
+        $this->last_query = $query;
+        $query = $this->modifyQuery($query);
+
+        $php_errormsg = '';
+
+        $result = @sqlite_query($query, $this->connection);
+        $this->_lasterror = $php_errormsg ? $php_errormsg : '';
+
+        $this->result = $result;
+        if (!$this->result) {
+            return $this->sqliteRaiseError(null);
+        }
+
+        // sqlite_query() seems to allways return a resource
+        // so cant use that. Using $ismanip instead
+        if (!$ismanip) {
+            $numRows = $this->numRows($result);
+            if (is_object($numRows)) {
+                // we've got PEAR_Error
+                return $numRows;
+            }
+            return $result;
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal sqlite result pointer to the next available result
+     *
+     * @param resource $result  the valid sqlite result resource
+     *
+     * @return bool  true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return false;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum !== null) {
+            if (!@sqlite_seek($this->result, $rownum)) {
+                return null;
+            }
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            $arr = @sqlite_fetch_array($result, SQLITE_ASSOC);
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @sqlite_fetch_array($result, SQLITE_NUM);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            /*
+             * Even though this DBMS already trims output, we do this because
+             * a field might have intentional whitespace at the end that
+             * gets removed by DB_PORTABILITY_RTRIM under another driver.
+             */
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult(&$result)
+    {
+        // XXX No native free?
+        if (!is_resource($result)) {
+            return false;
+        }
+        $result = null;
+        return true;
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @sqlite_num_fields($result);
+        if (!$cols) {
+            return $this->sqliteRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($result)
+    {
+        $rows = @sqlite_num_rows($result);
+        if ($rows === null) {
+            return $this->sqliteRaiseError();
+        }
+        return $rows;
+    }
+
+    // }}}
+    // {{{ affected()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        return @sqlite_changes($this->connection);
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_sqlite::nextID(), DB_sqlite::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
+    }
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_sqlite::nextID(), DB_sqlite::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        $query   = 'CREATE TABLE ' . $seqname .
+                   ' (id INTEGER UNSIGNED PRIMARY KEY) ';
+        $result  = $this->query($query);
+        if (DB::isError($result)) {
+            return($result);
+        }
+        $query   = "CREATE TRIGGER ${seqname}_cleanup AFTER INSERT ON $seqname
+                    BEGIN
+                        DELETE FROM $seqname WHERE id<LAST_INSERT_ROWID();
+                    END ";
+        $result  = $this->query($query);
+        if (DB::isError($result)) {
+            return($result);
+        }
+    }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_sqlite::createSequence(), DB_sqlite::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+
+        do {
+            $repeat = 0;
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result = $this->query("INSERT INTO $seqname (id) VALUES (NULL)");
+            $this->popErrorHandling();
+            if ($result === DB_OK) {
+                $id = @sqlite_last_insert_rowid($this->connection);
+                if ($id != 0) {
+                    return $id;
+                }
+            } elseif ($ondemand && DB::isError($result) &&
+                      $result->getCode() == DB_ERROR_NOSUCHTABLE)
+            {
+                $result = $this->createSequence($seq_name);
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                } else {
+                    $repeat = 1;
+                }
+            }
+        } while ($repeat);
+
+        return $this->raiseError($result);
+    }
+
+    // }}}
+    // {{{ getDbFileStats()
+
+    /**
+     * Get the file stats for the current database
+     *
+     * Possible arguments are dev, ino, mode, nlink, uid, gid, rdev, size,
+     * atime, mtime, ctime, blksize, blocks or a numeric key between
+     * 0 and 12.
+     *
+     * @param string $arg  the array key for stats()
+     *
+     * @return mixed  an array on an unspecified key, integer on a passed
+     *                arg and false at a stats error
+     */
+    function getDbFileStats($arg = '')
+    {
+        $stats = stat($this->dsn['database']);
+        if ($stats == false) {
+            return false;
+        }
+        if (is_array($stats)) {
+            if (is_numeric($arg)) {
+                if (((int)$arg <= 12) & ((int)$arg >= 0)) {
+                    return false;
+                }
+                return $stats[$arg ];
+            }
+            if (array_key_exists(trim($arg), $stats)) {
+                return $stats[$arg ];
+            }
+        }
+        return $stats;
+    }
+
+    // }}}
+    // {{{ escapeSimple()
+
+    /**
+     * Escapes a string according to the current DBMS's standards
+     *
+     * In SQLite, this makes things safe for inserts/updates, but may
+     * cause problems when performing text comparisons against columns
+     * containing binary data. See the
+     * {@link http://php.net/sqlite_escape_string PHP manual} for more info.
+     *
+     * @param string $str  the string to be escaped
+     *
+     * @return string  the escaped string
+     *
+     * @since Method available since Release 1.6.1
+     * @see DB_common::escapeSimple()
+     */
+    function escapeSimple($str)
+    {
+        return @sqlite_escape_string($str);
+    }
+
+    // }}}
+    // {{{ modifyLimitQuery()
+
+    /**
+     * Adds LIMIT clauses to a query string according to current DBMS standards
+     *
+     * @param string $query   the query to modify
+     * @param int    $from    the row to start to fetching (0 = the first row)
+     * @param int    $count   the numbers of rows to fetch
+     * @param mixed  $params  array, string or numeric data to be used in
+     *                         execution of the statement.  Quantity of items
+     *                         passed must match quantity of placeholders in
+     *                         query:  meaning 1 placeholder for non-array
+     *                         parameters or 1 placeholder per array element.
+     *
+     * @return string  the query string with LIMIT clauses added
+     *
+     * @access protected
+     */
+    function modifyLimitQuery($query, $from, $count, $params = array())
+    {
+        return "$query LIMIT $count OFFSET $from";
+    }
+
+    // }}}
+    // {{{ modifyQuery()
+
+    /**
+     * Changes a query string for various DBMS specific reasons
+     *
+     * This little hack lets you know how many rows were deleted
+     * when running a "DELETE FROM table" query.  Only implemented
+     * if the DB_PORTABILITY_DELETE_COUNT portability option is on.
+     *
+     * @param string $query  the query string to modify
+     *
+     * @return string  the modified query string
+     *
+     * @access protected
+     * @see DB_common::setOption()
+     */
+    function modifyQuery($query)
+    {
+        if ($this->options['portability'] & DB_PORTABILITY_DELETE_COUNT) {
+            if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $query)) {
+                $query = preg_replace('/^\s*DELETE\s+FROM\s+(\S+)\s*$/',
+                                      'DELETE FROM \1 WHERE 1=1', $query);
+            }
+        }
+        return $query;
+    }
+
+    // }}}
+    // {{{ sqliteRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_sqlite::errorNative(), DB_sqlite::errorCode()
+     */
+    function sqliteRaiseError($errno = null)
+    {
+        $native = $this->errorNative();
+        if ($errno === null) {
+            $errno = $this->errorCode($native);
+        }
+
+        $errorcode = @sqlite_last_error($this->connection);
+        $userinfo = "$errorcode ** $this->last_query";
+
+        return $this->raiseError($errno, null, null, $userinfo, $native);
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error message produced by the last query
+     *
+     * {@internal This is used to retrieve more meaningfull error messages
+     * because sqlite_last_error() does not provide adequate info.}}
+     *
+     * @return string  the DBMS' error message
+     */
+    function errorNative()
+    {
+        return $this->_lasterror;
+    }
+
+    // }}}
+    // {{{ errorCode()
+
+    /**
+     * Determines PEAR::DB error code from the database's text error message
+     *
+     * @param string $errormsg  the error message returned from the database
+     *
+     * @return integer  the DB error number
+     */
+    function errorCode($errormsg)
+    {
+        static $error_regexps;
+        if (!isset($error_regexps)) {
+            $error_regexps = array(
+                '/^no such table:/' => DB_ERROR_NOSUCHTABLE,
+                '/^no such index:/' => DB_ERROR_NOT_FOUND,
+                '/^(table|index) .* already exists$/' => DB_ERROR_ALREADY_EXISTS,
+                '/PRIMARY KEY must be unique/i' => DB_ERROR_CONSTRAINT,
+                '/is not unique/' => DB_ERROR_CONSTRAINT,
+                '/columns .* are not unique/i' => DB_ERROR_CONSTRAINT,
+                '/uniqueness constraint failed/' => DB_ERROR_CONSTRAINT,
+                '/may not be NULL/' => DB_ERROR_CONSTRAINT_NOT_NULL,
+                '/^no such column:/' => DB_ERROR_NOSUCHFIELD,
+                '/column not present in both tables/i' => DB_ERROR_NOSUCHFIELD,
+                '/^near ".*": syntax error$/' => DB_ERROR_SYNTAX,
+                '/[0-9]+ values for [0-9]+ columns/i' => DB_ERROR_VALUE_COUNT_ON_ROW,
+            );
+        }
+        foreach ($error_regexps as $regexp => $code) {
+            if (preg_match($regexp, $errormsg)) {
+                return $code;
+            }
+        }
+        // Fall back to DB_ERROR if there was no mapping.
+        return DB_ERROR;
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table
+     *
+     * @param string         $result  a string containing the name of a table
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     * @since Method available since Release 1.7.0
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            $id = @sqlite_array_query($this->connection,
+                                      "PRAGMA table_info('$result');",
+                                      SQLITE_ASSOC);
+            $got_string = true;
+        } else {
+            $this->last_query = '';
+            return $this->raiseError(DB_ERROR_NOT_CAPABLE, null, null, null,
+                                     'This DBMS can not obtain tableInfo' .
+                                     ' from result sets');
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = count($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            if (strpos($id[$i]['type'], '(') !== false) {
+                $bits = explode('(', $id[$i]['type']);
+                $type = $bits[0];
+                $len  = rtrim($bits[1],')');
+            } else {
+                $type = $id[$i]['type'];
+                $len  = 0;
+            }
+
+            $flags = '';
+            if ($id[$i]['pk']) {
+                $flags .= 'primary_key ';
+            }
+            if ($id[$i]['notnull']) {
+                $flags .= 'not_null ';
+            }
+            if ($id[$i]['dflt_value'] !== null) {
+                $flags .= 'default_' . rawurlencode($id[$i]['dflt_value']);
+            }
+            $flags = trim($flags);
+
+            $res[$i] = array(
+                'table' => $case_func($result),
+                'name'  => $case_func($id[$i]['name']),
+                'type'  => $type,
+                'len'   => $len,
+                'flags' => $flags,
+            );
+
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        return $res;
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     * @param array  $args  SQLITE DRIVER ONLY: a private array of arguments
+     *                       used by the getSpecialQuery().  Do not use
+     *                       this directly.
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type, $args = array())
+    {
+        if (!is_array($args)) {
+            return $this->raiseError('no key specified', null, null, null,
+                                     'Argument has to be an array.');
+        }
+
+        switch ($type) {
+            case 'master':
+                return 'SELECT * FROM sqlite_master;';
+            case 'tables':
+                return "SELECT name FROM sqlite_master WHERE type='table' "
+                       . 'UNION ALL SELECT name FROM sqlite_temp_master '
+                       . "WHERE type='table' ORDER BY name;";
+            case 'schema':
+                return 'SELECT sql FROM (SELECT * FROM sqlite_master '
+                       . 'UNION ALL SELECT * FROM sqlite_temp_master) '
+                       . "WHERE type!='meta' "
+                       . 'ORDER BY tbl_name, type DESC, name;';
+            case 'schemax':
+            case 'schema_x':
+                /*
+                 * Use like:
+                 * $res = $db->query($db->getSpecialQuery('schema_x',
+                 *                   array('table' => 'table3')));
+                 */
+                return 'SELECT sql FROM (SELECT * FROM sqlite_master '
+                       . 'UNION ALL SELECT * FROM sqlite_temp_master) '
+                       . "WHERE tbl_name LIKE '{$args['table']}' "
+                       . "AND type!='meta' "
+                       . 'ORDER BY type DESC, name;';
+            case 'alter':
+                /*
+                 * SQLite does not support ALTER TABLE; this is a helper query
+                 * to handle this. 'table' represents the table name, 'rows'
+                 * the news rows to create, 'save' the row(s) to keep _with_
+                 * the data.
+                 *
+                 * Use like:
+                 * $args = array(
+                 *     'table' => $table,
+                 *     'rows'  => "id INTEGER PRIMARY KEY, firstname TEXT, surname TEXT, datetime TEXT",
+                 *     'save'  => "NULL, titel, content, datetime"
+                 * );
+                 * $res = $db->query( $db->getSpecialQuery('alter', $args));
+                 */
+                $rows = strtr($args['rows'], $this->keywords);
+
+                $q = array(
+                    'BEGIN TRANSACTION',
+                    "CREATE TEMPORARY TABLE {$args['table']}_backup ({$args['rows']})",
+                    "INSERT INTO {$args['table']}_backup SELECT {$args['save']} FROM {$args['table']}",
+                    "DROP TABLE {$args['table']}",
+                    "CREATE TABLE {$args['table']} ({$args['rows']})",
+                    "INSERT INTO {$args['table']} SELECT {$rows} FROM {$args['table']}_backup",
+                    "DROP TABLE {$args['table']}_backup",
+                    'COMMIT',
+                );
+
+                /*
+                 * This is a dirty hack, since the above query will not get
+                 * executed with a single query call so here the query method
+                 * will be called directly and return a select instead.
+                 */
+                foreach ($q as $query) {
+                    $this->query($query);
+                }
+                return "SELECT * FROM {$args['table']};";
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/storage.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/storage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/storage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,504 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Provides an object interface to a table row
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <stig at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: storage.php,v 1.21 2005/02/02 02:54:51 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB class so it can be extended from
+ */
+require_once 'DB.php';
+
+/**
+ * Provides an object interface to a table row
+ *
+ * It lets you add, delete and change rows using objects rather than SQL
+ * statements.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <stig at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_storage extends PEAR
+{
+    // {{{ properties
+
+    /** the name of the table (or view, if the backend database supports
+        updates in views) we hold data from */
+    var $_table = null;
+
+    /** which column(s) in the table contains primary keys, can be a
+        string for single-column primary keys, or an array of strings
+        for multiple-column primary keys */
+    var $_keycolumn = null;
+
+    /** DB connection handle used for all transactions */
+    var $_dbh = null;
+
+    /** an assoc with the names of database fields stored as properties
+        in this object */
+    var $_properties = array();
+
+    /** an assoc with the names of the properties in this object that
+        have been changed since they were fetched from the database */
+    var $_changes = array();
+
+    /** flag that decides if data in this object can be changed.
+        objects that don't have their table's key column in their
+        property lists will be flagged as read-only. */
+    var $_readonly = false;
+
+    /** function or method that implements a validator for fields that
+        are set, this validator function returns true if the field is
+        valid, false if not */
+    var $_validator = null;
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * Constructor
+     *
+     * @param $table string the name of the database table
+     *
+     * @param $keycolumn mixed string with name of key column, or array of
+     * strings if the table has a primary key of more than one column
+     *
+     * @param $dbh object database connection object
+     *
+     * @param $validator mixed function or method used to validate
+     * each new value, called with three parameters: the name of the
+     * field/column that is changing, a reference to the new value and
+     * a reference to this object
+     *
+     */
+    function DB_storage($table, $keycolumn, &$dbh, $validator = null)
+    {
+        $this->PEAR('DB_Error');
+        $this->_table = $table;
+        $this->_keycolumn = $keycolumn;
+        $this->_dbh = $dbh;
+        $this->_readonly = false;
+        $this->_validator = $validator;
+    }
+
+    // }}}
+    // {{{ _makeWhere()
+
+    /**
+     * Utility method to build a "WHERE" clause to locate ourselves in
+     * the table.
+     *
+     * XXX future improvement: use rowids?
+     *
+     * @access private
+     */
+    function _makeWhere($keyval = null)
+    {
+        if (is_array($this->_keycolumn)) {
+            if ($keyval === null) {
+                for ($i = 0; $i < sizeof($this->_keycolumn); $i++) {
+                    $keyval[] = $this->{$this->_keycolumn[$i]};
+                }
+            }
+            $whereclause = '';
+            for ($i = 0; $i < sizeof($this->_keycolumn); $i++) {
+                if ($i > 0) {
+                    $whereclause .= ' AND ';
+                }
+                $whereclause .= $this->_keycolumn[$i];
+                if (is_null($keyval[$i])) {
+                    // there's not much point in having a NULL key,
+                    // but we support it anyway
+                    $whereclause .= ' IS NULL';
+                } else {
+                    $whereclause .= ' = ' . $this->_dbh->quote($keyval[$i]);
+                }
+            }
+        } else {
+            if ($keyval === null) {
+                $keyval = @$this->{$this->_keycolumn};
+            }
+            $whereclause = $this->_keycolumn;
+            if (is_null($keyval)) {
+                // there's not much point in having a NULL key,
+                // but we support it anyway
+                $whereclause .= ' IS NULL';
+            } else {
+                $whereclause .= ' = ' . $this->_dbh->quote($keyval);
+            }
+        }
+        return $whereclause;
+    }
+
+    // }}}
+    // {{{ setup()
+
+    /**
+     * Method used to initialize a DB_storage object from the
+     * configured table.
+     *
+     * @param $keyval mixed the key[s] of the row to fetch (string or array)
+     *
+     * @return int DB_OK on success, a DB error if not
+     */
+    function setup($keyval)
+    {
+        $whereclause = $this->_makeWhere($keyval);
+        $query = 'SELECT * FROM ' . $this->_table . ' WHERE ' . $whereclause;
+        $sth = $this->_dbh->query($query);
+        if (DB::isError($sth)) {
+            return $sth;
+        }
+        $row = $sth->fetchRow(DB_FETCHMODE_ASSOC);
+        if (DB::isError($row)) {
+            return $row;
+        }
+        if (!$row) {
+            return $this->raiseError(null, DB_ERROR_NOT_FOUND, null, null,
+                                     $query, null, true);
+        }
+        foreach ($row as $key => $value) {
+            $this->_properties[$key] = true;
+            $this->$key = $value;
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ insert()
+
+    /**
+     * Create a new (empty) row in the configured table for this
+     * object.
+     */
+    function insert($newpk)
+    {
+        if (is_array($this->_keycolumn)) {
+            $primarykey = $this->_keycolumn;
+        } else {
+            $primarykey = array($this->_keycolumn);
+        }
+        settype($newpk, "array");
+        for ($i = 0; $i < sizeof($primarykey); $i++) {
+            $pkvals[] = $this->_dbh->quote($newpk[$i]);
+        }
+
+        $sth = $this->_dbh->query("INSERT INTO $this->_table (" .
+                                  implode(",", $primarykey) . ") VALUES(" .
+                                  implode(",", $pkvals) . ")");
+        if (DB::isError($sth)) {
+            return $sth;
+        }
+        if (sizeof($newpk) == 1) {
+            $newpk = $newpk[0];
+        }
+        $this->setup($newpk);
+    }
+
+    // }}}
+    // {{{ toString()
+
+    /**
+     * Output a simple description of this DB_storage object.
+     * @return string object description
+     */
+    function toString()
+    {
+        $info = strtolower(get_class($this));
+        $info .= " (table=";
+        $info .= $this->_table;
+        $info .= ", keycolumn=";
+        if (is_array($this->_keycolumn)) {
+            $info .= "(" . implode(",", $this->_keycolumn) . ")";
+        } else {
+            $info .= $this->_keycolumn;
+        }
+        $info .= ", dbh=";
+        if (is_object($this->_dbh)) {
+            $info .= $this->_dbh->toString();
+        } else {
+            $info .= "null";
+        }
+        $info .= ")";
+        if (sizeof($this->_properties)) {
+            $info .= " [loaded, key=";
+            $keyname = $this->_keycolumn;
+            if (is_array($keyname)) {
+                $info .= "(";
+                for ($i = 0; $i < sizeof($keyname); $i++) {
+                    if ($i > 0) {
+                        $info .= ",";
+                    }
+                    $info .= $this->$keyname[$i];
+                }
+                $info .= ")";
+            } else {
+                $info .= $this->$keyname;
+            }
+            $info .= "]";
+        }
+        if (sizeof($this->_changes)) {
+            $info .= " [modified]";
+        }
+        return $info;
+    }
+
+    // }}}
+    // {{{ dump()
+
+    /**
+     * Dump the contents of this object to "standard output".
+     */
+    function dump()
+    {
+        foreach ($this->_properties as $prop => $foo) {
+            print "$prop = ";
+            print htmlentities($this->$prop);
+            print "<br />\n";
+        }
+    }
+
+    // }}}
+    // {{{ &create()
+
+    /**
+     * Static method used to create new DB storage objects.
+     * @param $data assoc. array where the keys are the names
+     *              of properties/columns
+     * @return object a new instance of DB_storage or a subclass of it
+     */
+    function &create($table, &$data)
+    {
+        $classname = strtolower(get_class($this));
+        $obj =& new $classname($table);
+        foreach ($data as $name => $value) {
+            $obj->_properties[$name] = true;
+            $obj->$name = &$value;
+        }
+        return $obj;
+    }
+
+    // }}}
+    // {{{ loadFromQuery()
+
+    /**
+     * Loads data into this object from the given query.  If this
+     * object already contains table data, changes will be saved and
+     * the object re-initialized first.
+     *
+     * @param $query SQL query
+     *
+     * @param $params parameter list in case you want to use
+     * prepare/execute mode
+     *
+     * @return int DB_OK on success, DB_WARNING_READ_ONLY if the
+     * returned object is read-only (because the object's specified
+     * key column was not found among the columns returned by $query),
+     * or another DB error code in case of errors.
+     */
+// XXX commented out for now
+/*
+    function loadFromQuery($query, $params = null)
+    {
+        if (sizeof($this->_properties)) {
+            if (sizeof($this->_changes)) {
+                $this->store();
+                $this->_changes = array();
+            }
+            $this->_properties = array();
+        }
+        $rowdata = $this->_dbh->getRow($query, DB_FETCHMODE_ASSOC, $params);
+        if (DB::isError($rowdata)) {
+            return $rowdata;
+        }
+        reset($rowdata);
+        $found_keycolumn = false;
+        while (list($key, $value) = each($rowdata)) {
+            if ($key == $this->_keycolumn) {
+                $found_keycolumn = true;
+            }
+            $this->_properties[$key] = true;
+            $this->$key = &$value;
+            unset($value); // have to unset, or all properties will
+                           // refer to the same value
+        }
+        if (!$found_keycolumn) {
+            $this->_readonly = true;
+            return DB_WARNING_READ_ONLY;
+        }
+        return DB_OK;
+    }
+ */
+
+    // }}}
+    // {{{ set()
+
+    /**
+     * Modify an attriute value.
+     */
+    function set($property, $newvalue)
+    {
+        // only change if $property is known and object is not
+        // read-only
+        if ($this->_readonly) {
+            return $this->raiseError(null, DB_WARNING_READ_ONLY, null,
+                                     null, null, null, true);
+        }
+        if (@isset($this->_properties[$property])) {
+            if (empty($this->_validator)) {
+                $valid = true;
+            } else {
+                $valid = @call_user_func($this->_validator,
+                                         $this->_table,
+                                         $property,
+                                         $newvalue,
+                                         $this->$property,
+                                         $this);
+            }
+            if ($valid) {
+                $this->$property = $newvalue;
+                if (empty($this->_changes[$property])) {
+                    $this->_changes[$property] = 0;
+                } else {
+                    $this->_changes[$property]++;
+                }
+            } else {
+                return $this->raiseError(null, DB_ERROR_INVALID, null,
+                                         null, "invalid field: $property",
+                                         null, true);
+            }
+            return true;
+        }
+        return $this->raiseError(null, DB_ERROR_NOSUCHFIELD, null,
+                                 null, "unknown field: $property",
+                                 null, true);
+    }
+
+    // }}}
+    // {{{ &get()
+
+    /**
+     * Fetch an attribute value.
+     *
+     * @param string attribute name
+     *
+     * @return attribute contents, or null if the attribute name is
+     * unknown
+     */
+    function &get($property)
+    {
+        // only return if $property is known
+        if (isset($this->_properties[$property])) {
+            return $this->$property;
+        }
+        $tmp = null;
+        return $tmp;
+    }
+
+    // }}}
+    // {{{ _DB_storage()
+
+    /**
+     * Destructor, calls DB_storage::store() if there are changes
+     * that are to be kept.
+     */
+    function _DB_storage()
+    {
+        if (sizeof($this->_changes)) {
+            $this->store();
+        }
+        $this->_properties = array();
+        $this->_changes = array();
+        $this->_table = null;
+    }
+
+    // }}}
+    // {{{ store()
+
+    /**
+     * Stores changes to this object in the database.
+     *
+     * @return DB_OK or a DB error
+     */
+    function store()
+    {
+        foreach ($this->_changes as $name => $foo) {
+            $params[] = &$this->$name;
+            $vars[] = $name . ' = ?';
+        }
+        if ($vars) {
+            $query = 'UPDATE ' . $this->_table . ' SET ' .
+                implode(', ', $vars) . ' WHERE ' .
+                $this->_makeWhere();
+            $stmt = $this->_dbh->prepare($query);
+            $res = $this->_dbh->execute($stmt, $params);
+            if (DB::isError($res)) {
+                return $res;
+            }
+            $this->_changes = array();
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ remove()
+
+    /**
+     * Remove the row represented by this object from the database.
+     *
+     * @return mixed DB_OK or a DB error
+     */
+    function remove()
+    {
+        if ($this->_readonly) {
+            return $this->raiseError(null, DB_WARNING_READ_ONLY, null,
+                                     null, null, null, true);
+        }
+        $query = 'DELETE FROM ' . $this->_table .' WHERE '.
+            $this->_makeWhere();
+        $res = $this->_dbh->query($query);
+        if (DB::isError($res)) {
+            return $res;
+        }
+        foreach ($this->_properties as $prop => $foo) {
+            unset($this->$prop);
+        }
+        $this->_properties = array();
+        $this->_changes = array();
+        return DB_OK;
+    }
+
+    // }}}
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB/sybase.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB/sybase.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB/sybase.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,907 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * The PEAR DB driver for PHP's sybase extension
+ * for interacting with Sybase databases
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Sterling Hughes <sterling at php.net>
+ * @author     Antônio Carlos Venâncio Júnior <floripa at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: sybase.php,v 1.78 2005/02/20 00:44:48 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the DB_common class so it can be extended from
+ */
+require_once 'DB/common.php';
+
+/**
+ * The methods PEAR DB uses to interact with PHP's sybase extension
+ * for interacting with Sybase databases
+ *
+ * These methods overload the ones declared in DB_common.
+ *
+ * WARNING:  This driver may fail with multiple connections under the
+ * same user/pass/host and different databases.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Sterling Hughes <sterling at php.net>
+ * @author     Antônio Carlos Venâncio Júnior <floripa at php.net>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_sybase extends DB_common
+{
+    // {{{ properties
+
+    /**
+     * The DB driver type (mysql, oci8, odbc, etc.)
+     * @var string
+     */
+    var $phptype = 'sybase';
+
+    /**
+     * The database syntax variant to be used (db2, access, etc.), if any
+     * @var string
+     */
+    var $dbsyntax = 'sybase';
+
+    /**
+     * The capabilities of this DB implementation
+     *
+     * The 'new_link' element contains the PHP version that first provided
+     * new_link support for this DBMS.  Contains false if it's unsupported.
+     *
+     * Meaning of the 'limit' element:
+     *   + 'emulate' = emulate with fetch row by number
+     *   + 'alter'   = alter the query
+     *   + false     = skip rows
+     *
+     * @var array
+     */
+    var $features = array(
+        'limit'         => 'emulate',
+        'new_link'      => false,
+        'numrows'       => true,
+        'pconnect'      => true,
+        'prepare'       => false,
+        'ssl'           => false,
+        'transactions'  => true,
+    );
+
+    /**
+     * A mapping of native error codes to DB error codes
+     * @var array
+     */
+    var $errorcode_map = array(
+    );
+
+    /**
+     * The raw database connection created by PHP
+     * @var resource
+     */
+    var $connection;
+
+    /**
+     * The DSN information for connecting to a database
+     * @var array
+     */
+    var $dsn = array();
+
+
+    /**
+     * Should data manipulation queries be committed automatically?
+     * @var bool
+     * @access private
+     */
+    var $autocommit = true;
+
+    /**
+     * The quantity of transactions begun
+     *
+     * {@internal  While this is private, it can't actually be designated
+     * private in PHP 5 because it is directly accessed in the test suite.}}
+     *
+     * @var integer
+     * @access private
+     */
+    var $transaction_opcount = 0;
+
+    /**
+     * The database specified in the DSN
+     *
+     * It's a fix to allow calls to different databases in the same script.
+     *
+     * @var string
+     * @access private
+     */
+    var $_db = '';
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor calls <kbd>$this->DB_common()</kbd>
+     *
+     * @return void
+     */
+    function DB_sybase()
+    {
+        $this->DB_common();
+    }
+
+    // }}}
+    // {{{ connect()
+
+    /**
+     * Connect to the database server, log in and open the database
+     *
+     * Don't call this method directly.  Use DB::connect() instead.
+     *
+     * PEAR DB's sybase driver supports the following extra DSN options:
+     *   + appname       The application name to use on this connection.
+     *                   Available since PEAR DB 1.7.0.
+     *   + charset       The character set to use on this connection.
+     *                   Available since PEAR DB 1.7.0.
+     *
+     * @param array $dsn         the data source name
+     * @param bool  $persistent  should the connection be persistent?
+     *
+     * @return int  DB_OK on success. A DB_Error object on failure.
+     */
+    function connect($dsn, $persistent = false)
+    {
+        if (!PEAR::loadExtension('sybase') &&
+            !PEAR::loadExtension('sybase_ct'))
+        {
+            return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+        }
+
+        $this->dsn = $dsn;
+        if ($dsn['dbsyntax']) {
+            $this->dbsyntax = $dsn['dbsyntax'];
+        }
+
+        $dsn['hostspec'] = $dsn['hostspec'] ? $dsn['hostspec'] : 'localhost';
+        $dsn['password'] = !empty($dsn['password']) ? $dsn['password'] : false;
+        $dsn['charset'] = isset($dsn['charset']) ? $dsn['charset'] : false;
+        $dsn['appname'] = isset($dsn['appname']) ? $dsn['appname'] : false;
+
+        $connect_function = $persistent ? 'sybase_pconnect' : 'sybase_connect';
+
+        if ($dsn['username']) {
+            $this->connection = @$connect_function($dsn['hostspec'],
+                                                   $dsn['username'],
+                                                   $dsn['password'],
+                                                   $dsn['charset'],
+                                                   $dsn['appname']);
+        } else {
+            return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                     null, null, null,
+                                     'The DSN did not contain a username.');
+        }
+
+        if (!$this->connection) {
+            return $this->raiseError(DB_ERROR_CONNECT_FAILED,
+                                     null, null, null,
+                                     @sybase_get_last_message());
+        }
+
+        if ($dsn['database']) {
+            if (!@sybase_select_db($dsn['database'], $this->connection)) {
+                return $this->raiseError(DB_ERROR_NODBSELECTED,
+                                         null, null, null,
+                                         @sybase_get_last_message());
+            }
+            $this->_db = $dsn['database'];
+        }
+
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ disconnect()
+
+    /**
+     * Disconnects from the database server
+     *
+     * @return bool  TRUE on success, FALSE on failure
+     */
+    function disconnect()
+    {
+        $ret = @sybase_close($this->connection);
+        $this->connection = null;
+        return $ret;
+    }
+
+    // }}}
+    // {{{ simpleQuery()
+
+    /**
+     * Sends a query to the database server
+     *
+     * @param string  the SQL query string
+     *
+     * @return mixed  + a PHP result resrouce for successful SELECT queries
+     *                + the DB_OK constant for other successful queries
+     *                + a DB_Error object on failure
+     */
+    function simpleQuery($query)
+    {
+        $ismanip = DB::isManip($query);
+        $this->last_query = $query;
+        if (!@sybase_select_db($this->_db, $this->connection)) {
+            return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
+        }
+        $query = $this->modifyQuery($query);
+        if (!$this->autocommit && $ismanip) {
+            if ($this->transaction_opcount == 0) {
+                $result = @sybase_query('BEGIN TRANSACTION', $this->connection);
+                if (!$result) {
+                    return $this->sybaseRaiseError();
+                }
+            }
+            $this->transaction_opcount++;
+        }
+        $result = @sybase_query($query, $this->connection);
+        if (!$result) {
+            return $this->sybaseRaiseError();
+        }
+        if (is_resource($result)) {
+            return $result;
+        }
+        // Determine which queries that should return data, and which
+        // should return an error code only.
+        return $ismanip ? DB_OK : $result;
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Move the internal sybase result pointer to the next available result
+     *
+     * @param a valid sybase result resource
+     *
+     * @access public
+     *
+     * @return true if a result is available otherwise return false
+     */
+    function nextResult($result)
+    {
+        return false;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Places a row from the result set into the given array
+     *
+     * Formating of the array and the data therein are configurable.
+     * See DB_result::fetchInto() for more information.
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::fetchInto() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result    the query result resource
+     * @param array    $arr       the referenced array to put the data in
+     * @param int      $fetchmode how the resulting array should be indexed
+     * @param int      $rownum    the row number to fetch (0 = first row)
+     *
+     * @return mixed  DB_OK on success, NULL when the end of a result set is
+     *                 reached or on failure
+     *
+     * @see DB_result::fetchInto()
+     */
+    function fetchInto($result, &$arr, $fetchmode, $rownum = null)
+    {
+        if ($rownum !== null) {
+            if (!@sybase_data_seek($result, $rownum)) {
+                return null;
+            }
+        }
+        if ($fetchmode & DB_FETCHMODE_ASSOC) {
+            if (function_exists('sybase_fetch_assoc')) {
+                $arr = @sybase_fetch_assoc($result);
+            } else {
+                if ($arr = @sybase_fetch_array($result)) {
+                    foreach ($arr as $key => $value) {
+                        if (is_int($key)) {
+                            unset($arr[$key]);
+                        }
+                    }
+                }
+            }
+            if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
+                $arr = array_change_key_case($arr, CASE_LOWER);
+            }
+        } else {
+            $arr = @sybase_fetch_row($result);
+        }
+        if (!$arr) {
+            return null;
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
+            $this->_rtrimArrayValues($arr);
+        }
+        if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
+            $this->_convertNullArrayValuesToEmpty($arr);
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ freeResult()
+
+    /**
+     * Deletes the result set and frees the memory occupied by the result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::free() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return bool  TRUE on success, FALSE if $result is invalid
+     *
+     * @see DB_result::free()
+     */
+    function freeResult($result)
+    {
+        return @sybase_free_result($result);
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Gets the number of columns in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numCols() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     *
+     * @see DB_result::numCols()
+     */
+    function numCols($result)
+    {
+        $cols = @sybase_num_fields($result);
+        if (!$cols) {
+            return $this->sybaseRaiseError();
+        }
+        return $cols;
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Gets the number of rows in a result set
+     *
+     * This method is not meant to be called directly.  Use
+     * DB_result::numRows() instead.  It can't be declared "protected"
+     * because DB_result is a separate object.
+     *
+     * @param resource $result  PHP's query result resource
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     *
+     * @see DB_result::numRows()
+     */
+    function numRows($result)
+    {
+        $rows = @sybase_num_rows($result);
+        if ($rows === false) {
+            return $this->sybaseRaiseError();
+        }
+        return $rows;
+    }
+
+    // }}}
+    // {{{ affectedRows()
+
+    /**
+     * Determines the number of rows affected by a data maniuplation query
+     *
+     * 0 is returned for queries that don't manipulate data.
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function affectedRows()
+    {
+        if (DB::isManip($this->last_query)) {
+            $result = @sybase_affected_rows($this->connection);
+        } else {
+            $result = 0;
+        }
+        return $result;
+     }
+
+    // }}}
+    // {{{ nextId()
+
+    /**
+     * Returns the next free id in a sequence
+     *
+     * @param string  $seq_name  name of the sequence
+     * @param boolean $ondemand  when true, the seqence is automatically
+     *                            created if it does not exist
+     *
+     * @return int  the next id number in the sequence.
+     *               A DB_Error object on failure.
+     *
+     * @see DB_common::nextID(), DB_common::getSequenceName(),
+     *      DB_sybase::createSequence(), DB_sybase::dropSequence()
+     */
+    function nextId($seq_name, $ondemand = true)
+    {
+        $seqname = $this->getSequenceName($seq_name);
+        if (!@sybase_select_db($this->_db, $this->connection)) {
+            return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
+        }
+        $repeat = 0;
+        do {
+            $this->pushErrorHandling(PEAR_ERROR_RETURN);
+            $result = $this->query("INSERT INTO $seqname (vapor) VALUES (0)");
+            $this->popErrorHandling();
+            if ($ondemand && DB::isError($result) &&
+                ($result->getCode() == DB_ERROR || $result->getCode() == DB_ERROR_NOSUCHTABLE))
+            {
+                $repeat = 1;
+                $result = $this->createSequence($seq_name);
+                if (DB::isError($result)) {
+                    return $this->raiseError($result);
+                }
+            } elseif (!DB::isError($result)) {
+                $result =& $this->query("SELECT @@IDENTITY FROM $seqname");
+                $repeat = 0;
+            } else {
+                $repeat = false;
+            }
+        } while ($repeat);
+        if (DB::isError($result)) {
+            return $this->raiseError($result);
+        }
+        $result = $result->fetchRow(DB_FETCHMODE_ORDERED);
+        return $result[0];
+    }
+
+    /**
+     * Creates a new sequence
+     *
+     * @param string $seq_name  name of the new sequence
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::createSequence(), DB_common::getSequenceName(),
+     *      DB_sybase::nextID(), DB_sybase::dropSequence()
+     */
+    function createSequence($seq_name)
+    {
+        return $this->query('CREATE TABLE '
+                            . $this->getSequenceName($seq_name)
+                            . ' (id numeric(10, 0) IDENTITY NOT NULL,'
+                            . ' vapor int NULL)');
+    }
+
+    // }}}
+    // {{{ dropSequence()
+
+    /**
+     * Deletes a sequence
+     *
+     * @param string $seq_name  name of the sequence to be deleted
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     *
+     * @see DB_common::dropSequence(), DB_common::getSequenceName(),
+     *      DB_sybase::nextID(), DB_sybase::createSequence()
+     */
+    function dropSequence($seq_name)
+    {
+        return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
+    }
+
+    // }}}
+    // {{{ autoCommit()
+
+    /**
+     * Enables or disables automatic commits
+     *
+     * @param bool $onoff  true turns it on, false turns it off
+     *
+     * @return int  DB_OK on success.  A DB_Error object if the driver
+     *               doesn't support auto-committing transactions.
+     */
+    function autoCommit($onoff = false)
+    {
+        // XXX if $this->transaction_opcount > 0, we should probably
+        // issue a warning here.
+        $this->autocommit = $onoff ? true : false;
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ commit()
+
+    /**
+     * Commits the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function commit()
+    {
+        if ($this->transaction_opcount > 0) {
+            if (!@sybase_select_db($this->_db, $this->connection)) {
+                return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
+            }
+            $result = @sybase_query('COMMIT', $this->connection);
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->sybaseRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ rollback()
+
+    /**
+     * Reverts the current transaction
+     *
+     * @return int  DB_OK on success.  A DB_Error object on failure.
+     */
+    function rollback()
+    {
+        if ($this->transaction_opcount > 0) {
+            if (!@sybase_select_db($this->_db, $this->connection)) {
+                return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
+            }
+            $result = @sybase_query('ROLLBACK', $this->connection);
+            $this->transaction_opcount = 0;
+            if (!$result) {
+                return $this->sybaseRaiseError();
+            }
+        }
+        return DB_OK;
+    }
+
+    // }}}
+    // {{{ sybaseRaiseError()
+
+    /**
+     * Produces a DB_Error object regarding the current problem
+     *
+     * @param int $errno  if the error is being manually raised pass a
+     *                     DB_ERROR* constant here.  If this isn't passed
+     *                     the error information gathered from the DBMS.
+     *
+     * @return object  the DB_Error object
+     *
+     * @see DB_common::raiseError(),
+     *      DB_sybase::errorNative(), DB_sybase::errorCode()
+     */
+    function sybaseRaiseError($errno = null)
+    {
+        $native = $this->errorNative();
+        if ($errno === null) {
+            $errno = $this->errorCode($native);
+        }
+        return $this->raiseError($errno, null, null, null, $native);
+    }
+
+    // }}}
+    // {{{ errorNative()
+
+    /**
+     * Gets the DBMS' native error message produced by the last query
+     *
+     * @return string  the DBMS' error message
+     */
+    function errorNative()
+    {
+        return @sybase_get_last_message();
+    }
+
+    // }}}
+    // {{{ errorCode()
+
+    /**
+     * Determines PEAR::DB error code from the database's text error message.
+     *
+     * @param  string  $errormsg  error message returned from the database
+     * @return integer  an error number from a DB error constant
+     */
+    function errorCode($errormsg)
+    {
+        static $error_regexps;
+        if (!isset($error_regexps)) {
+            $error_regexps = array(
+                '/Incorrect syntax near/'
+                    => DB_ERROR_SYNTAX,
+                '/^Unclosed quote before the character string [\"\'].*[\"\']\./'
+                    => DB_ERROR_SYNTAX,
+                '/Implicit conversion (from datatype|of NUMERIC value)/i'
+                    => DB_ERROR_INVALID_NUMBER,
+                '/Cannot drop the table [\"\'].+[\"\'], because it doesn\'t exist in the system catalogs\./'
+                    => DB_ERROR_NOSUCHTABLE,
+                '/Only the owner of object [\"\'].+[\"\'] or a user with System Administrator \(SA\) role can run this command\./'
+                    => DB_ERROR_ACCESS_VIOLATION,
+                '/^.+ permission denied on object .+, database .+, owner .+/'
+                    => DB_ERROR_ACCESS_VIOLATION,
+                '/^.* permission denied, database .+, owner .+/'
+                    => DB_ERROR_ACCESS_VIOLATION,
+                '/[^.*] not found\./'
+                    => DB_ERROR_NOSUCHTABLE,
+                '/There is already an object named/'
+                    => DB_ERROR_ALREADY_EXISTS,
+                '/Invalid column name/'
+                    => DB_ERROR_NOSUCHFIELD,
+                '/does not allow null values/'
+                    => DB_ERROR_CONSTRAINT_NOT_NULL,
+                '/Command has been aborted/'
+                    => DB_ERROR_CONSTRAINT,
+                '/^Cannot drop the index .* because it doesn\'t exist/i'
+                    => DB_ERROR_NOT_FOUND,
+                '/^There is already an index/i'
+                    => DB_ERROR_ALREADY_EXISTS,
+                '/^There are fewer columns in the INSERT statement than values specified/i'
+                    => DB_ERROR_VALUE_COUNT_ON_ROW,
+            );
+        }
+
+        foreach ($error_regexps as $regexp => $code) {
+            if (preg_match($regexp, $errormsg)) {
+                return $code;
+            }
+        }
+        return DB_ERROR;
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * Returns information about a table or a result set
+     *
+     * NOTE: only supports 'table' and 'flags' if <var>$result</var>
+     * is a table name.
+     *
+     * @param object|string  $result  DB_result object from a query or a
+     *                                 string containing the name of a table.
+     *                                 While this also accepts a query result
+     *                                 resource identifier, this behavior is
+     *                                 deprecated.
+     * @param int            $mode    a valid tableInfo mode
+     *
+     * @return array  an associative array with the information requested.
+     *                 A DB_Error object on failure.
+     *
+     * @see DB_common::tableInfo()
+     * @since Method available since Release 1.6.0
+     */
+    function tableInfo($result, $mode = null)
+    {
+        if (is_string($result)) {
+            /*
+             * Probably received a table name.
+             * Create a result resource identifier.
+             */
+            if (!@sybase_select_db($this->_db, $this->connection)) {
+                return $this->sybaseRaiseError(DB_ERROR_NODBSELECTED);
+            }
+            $id = @sybase_query("SELECT * FROM $result WHERE 1=0",
+                                $this->connection);
+            $got_string = true;
+        } elseif (isset($result->result)) {
+            /*
+             * Probably received a result object.
+             * Extract the result resource identifier.
+             */
+            $id = $result->result;
+            $got_string = false;
+        } else {
+            /*
+             * Probably received a result resource identifier.
+             * Copy it.
+             * Deprecated.  Here for compatibility only.
+             */
+            $id = $result;
+            $got_string = false;
+        }
+
+        if (!is_resource($id)) {
+            return $this->sybaseRaiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+
+        if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
+            $case_func = 'strtolower';
+        } else {
+            $case_func = 'strval';
+        }
+
+        $count = @sybase_num_fields($id);
+        $res   = array();
+
+        if ($mode) {
+            $res['num_fields'] = $count;
+        }
+
+        for ($i = 0; $i < $count; $i++) {
+            $f = @sybase_fetch_field($id, $i);
+            // column_source is often blank
+            $res[$i] = array(
+                'table' => $got_string
+                           ? $case_func($result)
+                           : $case_func($f->column_source),
+                'name'  => $case_func($f->name),
+                'type'  => $f->type,
+                'len'   => $f->max_length,
+                'flags' => '',
+            );
+            if ($res[$i]['table']) {
+                $res[$i]['flags'] = $this->_sybase_field_flags(
+                        $res[$i]['table'], $res[$i]['name']);
+            }
+            if ($mode & DB_TABLEINFO_ORDER) {
+                $res['order'][$res[$i]['name']] = $i;
+            }
+            if ($mode & DB_TABLEINFO_ORDERTABLE) {
+                $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
+            }
+        }
+
+        // free the result only if we were called on a table
+        if ($got_string) {
+            @sybase_free_result($id);
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ _sybase_field_flags()
+
+    /**
+     * Get the flags for a field
+     *
+     * Currently supports:
+     *  + <samp>unique_key</samp>    (unique index, unique check or primary_key)
+     *  + <samp>multiple_key</samp>  (multi-key index)
+     *
+     * @param string  $table   the table name
+     * @param string  $column  the field name
+     *
+     * @return string  space delimited string of flags.  Empty string if none.
+     *
+     * @access private
+     */
+    function _sybase_field_flags($table, $column)
+    {
+        static $tableName = null;
+        static $flags = array();
+
+        if ($table != $tableName) {
+            $flags = array();
+            $tableName = $table;
+
+            // get unique/primary keys
+            $res = $this->getAll("sp_helpindex $table", DB_FETCHMODE_ASSOC);
+
+            if (!isset($res[0]['index_description'])) {
+                return '';
+            }
+
+            foreach ($res as $val) {
+                $keys = explode(', ', trim($val['index_keys']));
+
+                if (sizeof($keys) > 1) {
+                    foreach ($keys as $key) {
+                        $this->_add_flag($flags[$key], 'multiple_key');
+                    }
+                }
+
+                if (strpos($val['index_description'], 'unique')) {
+                    foreach ($keys as $key) {
+                        $this->_add_flag($flags[$key], 'unique_key');
+                    }
+                }
+            }
+
+        }
+
+        if (array_key_exists($column, $flags)) {
+            return(implode(' ', $flags[$column]));
+        }
+
+        return '';
+    }
+
+    // }}}
+    // {{{ _add_flag()
+
+    /**
+     * Adds a string to the flags array if the flag is not yet in there
+     * - if there is no flag present the array is created
+     *
+     * @param array  $array  reference of flags array to add a value to
+     * @param mixed  $value  value to add to the flag array
+     *
+     * @return void
+     *
+     * @access private
+     */
+    function _add_flag(&$array, $value)
+    {
+        if (!is_array($array)) {
+            $array = array($value);
+        } elseif (!in_array($value, $array)) {
+            array_push($array, $value);
+        }
+    }
+
+    // }}}
+    // {{{ getSpecialQuery()
+
+    /**
+     * Obtains the query string needed for listing a given type of objects
+     *
+     * @param string $type  the kind of objects you want to retrieve
+     *
+     * @return string  the SQL query string or null if the driver doesn't
+     *                  support the object type requested
+     *
+     * @access protected
+     * @see DB_common::getListOf()
+     */
+    function getSpecialQuery($type)
+    {
+        switch ($type) {
+            case 'tables':
+                return "SELECT name FROM sysobjects WHERE type = 'U'"
+                       . ' ORDER BY name';
+            case 'views':
+                return "SELECT name FROM sysobjects WHERE type = 'V'";
+            default:
+                return null;
+        }
+    }
+
+    // }}}
+
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/DB.php
===================================================================
--- trunk/direct.openmoko.com/pear/DB.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/DB.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1388 @@
+<?php
+
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Database independent query interface
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Tomas V.V.Cox <cox at idecnet.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: DB.php,v 1.80 2005/02/16 02:16:00 danielc Exp $
+ * @link       http://pear.php.net/package/DB
+ */
+
+/**
+ * Obtain the PEAR class so it can be extended from
+ */
+require_once 'PEAR.php';
+
+
+// {{{ constants
+// {{{ error codes
+
+/**#@+
+ * One of PEAR DB's portable error codes.
+ * @see DB_common::errorCode(), DB::errorMessage()
+ *
+ * {@internal If you add an error code here, make sure you also add a textual
+ * version of it in DB::errorMessage().}}
+ */
+
+/**
+ * The code returned by many methods upon success
+ */
+define('DB_OK', 1);
+
+/**
+ * Unkown error
+ */
+define('DB_ERROR', -1);
+
+/**
+ * Syntax error
+ */
+define('DB_ERROR_SYNTAX', -2);
+
+/**
+ * Tried to insert a duplicate value into a primary or unique index
+ */
+define('DB_ERROR_CONSTRAINT', -3);
+
+/**
+ * An identifier in the query refers to a non-existant object
+ */
+define('DB_ERROR_NOT_FOUND', -4);
+
+/**
+ * Tried to create a duplicate object
+ */
+define('DB_ERROR_ALREADY_EXISTS', -5);
+
+/**
+ * The current driver does not support the action you attempted
+ */
+define('DB_ERROR_UNSUPPORTED', -6);
+
+/**
+ * The number of parameters does not match the number of placeholders
+ */
+define('DB_ERROR_MISMATCH', -7);
+
+/**
+ * A literal submitted did not match the data type expected
+ */
+define('DB_ERROR_INVALID', -8);
+
+/**
+ * The current DBMS does not support the action you attempted
+ */
+define('DB_ERROR_NOT_CAPABLE', -9);
+
+/**
+ * A literal submitted was too long so the end of it was removed
+ */
+define('DB_ERROR_TRUNCATED', -10);
+
+/**
+ * A literal number submitted did not match the data type expected
+ */
+define('DB_ERROR_INVALID_NUMBER', -11);
+
+/**
+ * A literal date submitted did not match the data type expected
+ */
+define('DB_ERROR_INVALID_DATE', -12);
+
+/**
+ * Attempt to divide something by zero
+ */
+define('DB_ERROR_DIVZERO', -13);
+
+/**
+ * A database needs to be selected
+ */
+define('DB_ERROR_NODBSELECTED', -14);
+
+/**
+ * Could not create the object requested
+ */
+define('DB_ERROR_CANNOT_CREATE', -15);
+
+/**
+ * Could not drop the database requested because it does not exist
+ */
+define('DB_ERROR_CANNOT_DROP', -17);
+
+/**
+ * An identifier in the query refers to a non-existant table
+ */
+define('DB_ERROR_NOSUCHTABLE', -18);
+
+/**
+ * An identifier in the query refers to a non-existant column
+ */
+define('DB_ERROR_NOSUCHFIELD', -19);
+
+/**
+ * The data submitted to the method was inappropriate
+ */
+define('DB_ERROR_NEED_MORE_DATA', -20);
+
+/**
+ * The attempt to lock the table failed
+ */
+define('DB_ERROR_NOT_LOCKED', -21);
+
+/**
+ * The number of columns doesn't match the number of values
+ */
+define('DB_ERROR_VALUE_COUNT_ON_ROW', -22);
+
+/**
+ * The DSN submitted has problems
+ */
+define('DB_ERROR_INVALID_DSN', -23);
+
+/**
+ * Could not connect to the database
+ */
+define('DB_ERROR_CONNECT_FAILED', -24);
+
+/**
+ * The PHP extension needed for this DBMS could not be found
+ */
+define('DB_ERROR_EXTENSION_NOT_FOUND',-25);
+
+/**
+ * The present user has inadequate permissions to perform the task requestd
+ */
+define('DB_ERROR_ACCESS_VIOLATION', -26);
+
+/**
+ * The database requested does not exist
+ */
+define('DB_ERROR_NOSUCHDB', -27);
+
+/**
+ * Tried to insert a null value into a column that doesn't allow nulls
+ */
+define('DB_ERROR_CONSTRAINT_NOT_NULL',-29);
+/**#@-*/
+
+
+// }}}
+// {{{ prepared statement-related
+
+
+/**#@+
+ * Identifiers for the placeholders used in prepared statements.
+ * @see DB_common::prepare()
+ */
+
+/**
+ * Indicates a scalar (<kbd>?</kbd>) placeholder was used
+ *
+ * Quote and escape the value as necessary.
+ */
+define('DB_PARAM_SCALAR', 1);
+
+/**
+ * Indicates an opaque (<kbd>&</kbd>) placeholder was used
+ *
+ * The value presented is a file name.  Extract the contents of that file
+ * and place them in this column.
+ */
+define('DB_PARAM_OPAQUE', 2);
+
+/**
+ * Indicates a misc (<kbd>!</kbd>) placeholder was used
+ *
+ * The value should not be quoted or escaped.
+ */
+define('DB_PARAM_MISC',   3);
+/**#@-*/
+
+
+// }}}
+// {{{ binary data-related
+
+
+/**#@+
+ * The different ways of returning binary data from queries.
+ */
+
+/**
+ * Sends the fetched data straight through to output
+ */
+define('DB_BINMODE_PASSTHRU', 1);
+
+/**
+ * Lets you return data as usual
+ */
+define('DB_BINMODE_RETURN', 2);
+
+/**
+ * Converts the data to hex format before returning it
+ *
+ * For example the string "123" would become "313233".
+ */
+define('DB_BINMODE_CONVERT', 3);
+/**#@-*/
+
+
+// }}}
+// {{{ fetch modes
+
+
+/**#@+
+ * Fetch Modes.
+ * @see DB_common::setFetchMode()
+ */
+
+/**
+ * Indicates the current default fetch mode should be used
+ * @see DB_common::$fetchmode
+ */
+define('DB_FETCHMODE_DEFAULT', 0);
+
+/**
+ * Column data indexed by numbers, ordered from 0 and up
+ */
+define('DB_FETCHMODE_ORDERED', 1);
+
+/**
+ * Column data indexed by column names
+ */
+define('DB_FETCHMODE_ASSOC', 2);
+
+/**
+ * Column data as object properties
+ */
+define('DB_FETCHMODE_OBJECT', 3);
+
+/**
+ * For multi-dimensional results, make the column name the first level
+ * of the array and put the row number in the second level of the array
+ *
+ * This is flipped from the normal behavior, which puts the row numbers
+ * in the first level of the array and the column names in the second level.
+ */
+define('DB_FETCHMODE_FLIPPED', 4);
+/**#@-*/
+
+/**#@+
+ * Old fetch modes.  Left here for compatibility.
+ */
+define('DB_GETMODE_ORDERED', DB_FETCHMODE_ORDERED);
+define('DB_GETMODE_ASSOC',   DB_FETCHMODE_ASSOC);
+define('DB_GETMODE_FLIPPED', DB_FETCHMODE_FLIPPED);
+/**#@-*/
+
+
+// }}}
+// {{{ tableInfo() && autoPrepare()-related
+
+
+/**#@+
+ * The type of information to return from the tableInfo() method.
+ *
+ * Bitwised constants, so they can be combined using <kbd>|</kbd>
+ * and removed using <kbd>^</kbd>.
+ *
+ * @see DB_common::tableInfo()
+ *
+ * {@internal Since the TABLEINFO constants are bitwised, if more of them are
+ * added in the future, make sure to adjust DB_TABLEINFO_FULL accordingly.}}
+ */
+define('DB_TABLEINFO_ORDER', 1);
+define('DB_TABLEINFO_ORDERTABLE', 2);
+define('DB_TABLEINFO_FULL', 3);
+/**#@-*/
+
+
+/**#@+
+ * The type of query to create with the automatic query building methods.
+ * @see DB_common::autoPrepare(), DB_common::autoExecute()
+ */
+define('DB_AUTOQUERY_INSERT', 1);
+define('DB_AUTOQUERY_UPDATE', 2);
+/**#@-*/
+
+
+// }}}
+// {{{ portability modes
+
+
+/**#@+
+ * Portability Modes.
+ *
+ * Bitwised constants, so they can be combined using <kbd>|</kbd>
+ * and removed using <kbd>^</kbd>.
+ *
+ * @see DB_common::setOption()
+ *
+ * {@internal Since the PORTABILITY constants are bitwised, if more of them are
+ * added in the future, make sure to adjust DB_PORTABILITY_ALL accordingly.}}
+ */
+
+/**
+ * Turn off all portability features
+ */
+define('DB_PORTABILITY_NONE', 0);
+
+/**
+ * Convert names of tables and fields to lower case
+ * when using the get*(), fetch*() and tableInfo() methods
+ */
+define('DB_PORTABILITY_LOWERCASE', 1);
+
+/**
+ * Right trim the data output by get*() and fetch*()
+ */
+define('DB_PORTABILITY_RTRIM', 2);
+
+/**
+ * Force reporting the number of rows deleted
+ */
+define('DB_PORTABILITY_DELETE_COUNT', 4);
+
+/**
+ * Enable hack that makes numRows() work in Oracle
+ */
+define('DB_PORTABILITY_NUMROWS', 8);
+
+/**
+ * Makes certain error messages in certain drivers compatible
+ * with those from other DBMS's
+ *
+ * + mysql, mysqli:  change unique/primary key constraints
+ *   DB_ERROR_ALREADY_EXISTS -> DB_ERROR_CONSTRAINT
+ *
+ * + odbc(access):  MS's ODBC driver reports 'no such field' as code
+ *   07001, which means 'too few parameters.'  When this option is on
+ *   that code gets mapped to DB_ERROR_NOSUCHFIELD.
+ */
+define('DB_PORTABILITY_ERRORS', 16);
+
+/**
+ * Convert null values to empty strings in data output by
+ * get*() and fetch*()
+ */
+define('DB_PORTABILITY_NULL_TO_EMPTY', 32);
+
+/**
+ * Turn on all portability features
+ */
+define('DB_PORTABILITY_ALL', 63);
+/**#@-*/
+
+// }}}
+
+
+// }}}
+// {{{ class DB
+
+/**
+ * Database independent query interface
+ *
+ * The main "DB" class is simply a container class with some static
+ * methods for creating DB objects as well as some utility functions
+ * common to all parts of DB.
+ *
+ * The object model of DB is as follows (indentation means inheritance):
+ * <pre>
+ * DB           The main DB class.  This is simply a utility class
+ *              with some "static" methods for creating DB objects as
+ *              well as common utility functions for other DB classes.
+ *
+ * DB_common    The base for each DB implementation.  Provides default
+ * |            implementations (in OO lingo virtual methods) for
+ * |            the actual DB implementations as well as a bunch of
+ * |            query utility functions.
+ * |
+ * +-DB_mysql   The DB implementation for MySQL.  Inherits DB_common.
+ *              When calling DB::factory or DB::connect for MySQL
+ *              connections, the object returned is an instance of this
+ *              class.
+ * </pre>
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Tomas V.V.Cox <cox at idecnet.com>
+ * @author     Daniel Convissor <danielc at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB
+{
+    // {{{ &factory()
+
+    /**
+     * Create a new DB object for the specified database type but don't
+     * connect to the database
+     *
+     * @param string $type     the database type (eg "mysql")
+     * @param array  $options  an associative array of option names and values
+     *
+     * @return object  a new DB object.  A DB_Error object on failure.
+     *
+     * @see DB_common::setOption()
+     */
+    function &factory($type, $options = false)
+    {
+        if (!is_array($options)) {
+            $options = array('persistent' => $options);
+        }
+
+        if (isset($options['debug']) && $options['debug'] >= 2) {
+            // expose php errors with sufficient debug level
+            include_once "DB/{$type}.php";
+        } else {
+            @include_once "DB/{$type}.php";
+        }
+
+        $classname = "DB_${type}";
+
+        if (!class_exists($classname)) {
+            $tmp = PEAR::raiseError(null, DB_ERROR_NOT_FOUND, null, null,
+                                    "Unable to include the DB/{$type}.php"
+                                    . " file for '$dsn'",
+                                    'DB_Error', true);
+            return $tmp;
+        }
+
+        @$obj =& new $classname;
+
+        foreach ($options as $option => $value) {
+            $test = $obj->setOption($option, $value);
+            if (DB::isError($test)) {
+                return $test;
+            }
+        }
+
+        return $obj;
+    }
+
+    // }}}
+    // {{{ &connect()
+
+    /**
+     * Create a new DB object including a connection to the specified database
+     *
+     * Example 1.
+     * <code>
+     * require_once 'DB.php';
+     *
+     * $dsn = 'pgsql://user:password@host/database';
+     * $options = array(
+     *     'debug'       => 2,
+     *     'portability' => DB_PORTABILITY_ALL,
+     * );
+     *
+     * $db =& DB::connect($dsn, $options);
+     * if (PEAR::isError($db)) {
+     *     die($db->getMessage());
+     * }
+     * </code>
+     *
+     * @param mixed $dsn      the string "data source name" or array in the
+     *                         format returned by DB::parseDSN()
+     * @param array $options  an associative array of option names and values
+     *
+     * @return object  a new DB object.  A DB_Error object on failure.
+     *
+     * @uses DB_dbase::connect(), DB_fbsql::connect(), DB_ibase::connect(),
+     *       DB_ifx::connect(), DB_msql::connect(), DB_mssql::connect(),
+     *       DB_mysql::connect(), DB_mysqli::connect(), DB_oci8::connect(),
+     *       DB_odbc::connect(), DB_pgsql::connect(), DB_sqlite::connect(),
+     *       DB_sybase::connect()
+     *
+     * @uses DB::parseDSN(), DB_common::setOption(), PEAR::isError()
+     */
+    function &connect($dsn, $options = array())
+    {
+        $dsninfo = DB::parseDSN($dsn);
+        $type = $dsninfo['phptype'];
+
+        if (!is_array($options)) {
+            /*
+             * For backwards compatibility.  $options used to be boolean,
+             * indicating whether the connection should be persistent.
+             */
+            $options = array('persistent' => $options);
+        }
+
+        if (isset($options['debug']) && $options['debug'] >= 2) {
+            // expose php errors with sufficient debug level
+            include_once "DB/${type}.php";
+        } else {
+            @include_once "DB/${type}.php";
+        }
+
+        $classname = "DB_${type}";
+        if (!class_exists($classname)) {
+            $tmp = PEAR::raiseError(null, DB_ERROR_NOT_FOUND, null, null,
+                                    "Unable to include the DB/{$type}.php"
+                                    . " file for '$dsn'",
+                                    'DB_Error', true);
+            return $tmp;
+        }
+
+        @$obj =& new $classname;
+
+        foreach ($options as $option => $value) {
+            $test = $obj->setOption($option, $value);
+            if (DB::isError($test)) {
+                return $test;
+            }
+        }
+
+        $err = $obj->connect($dsninfo, $obj->getOption('persistent'));
+        if (DB::isError($err)) {
+            $err->addUserInfo($dsn);
+            return $err;
+        }
+
+        return $obj;
+    }
+
+    // }}}
+    // {{{ apiVersion()
+
+    /**
+     * Return the DB API version
+     *
+     * @return string  the DB API version number
+     */
+    function apiVersion()
+    {
+        return '@package_version@';
+    }
+
+    // }}}
+    // {{{ isError()
+
+    /**
+     * Determines if a variable is a DB_Error object
+     *
+     * @param mixed $value  the variable to check
+     *
+     * @return bool  whether $value is DB_Error object
+     */
+    function isError($value)
+    {
+        return is_a($value, 'DB_Error');
+    }
+
+    // }}}
+    // {{{ isConnection()
+
+    /**
+     * Determines if a value is a DB_<driver> object
+     *
+     * @param mixed $value  the value to test
+     *
+     * @return bool  whether $value is a DB_<driver> object
+     */
+    function isConnection($value)
+    {
+        return (is_object($value) &&
+                is_subclass_of($value, 'db_common') &&
+                method_exists($value, 'simpleQuery'));
+    }
+
+    // }}}
+    // {{{ isManip()
+
+    /**
+     * Tell whether a query is a data manipulation or data definition query
+     *
+     * Examples of data manipulation queries are INSERT, UPDATE and DELETE.
+     * Examples of data definition queries are CREATE, DROP, ALTER, GRANT,
+     * REVOKE.
+     *
+     * @param string $query  the query
+     *
+     * @return boolean  whether $query is a data manipulation query
+     */
+    function isManip($query)
+    {
+        $manips = 'INSERT|UPDATE|DELETE|REPLACE|'
+                . 'CREATE|DROP|'
+                . 'LOAD DATA|SELECT .* INTO|COPY|'
+                . 'ALTER|GRANT|REVOKE|'
+                . 'LOCK|UNLOCK';
+        if (preg_match('/^\s*"?(' . $manips . ')\s+/i', $query)) {
+            return true;
+        }
+        return false;
+    }
+
+    // }}}
+    // {{{ errorMessage()
+
+    /**
+     * Return a textual error message for a DB error code
+     *
+     * @param integer $value  the DB error code
+     *
+     * @return string  the error message or false if the error code was
+     *                  not recognized
+     */
+    function errorMessage($value)
+    {
+        static $errorMessages;
+        if (!isset($errorMessages)) {
+            $errorMessages = array(
+                DB_ERROR                    => 'unknown error',
+                DB_ERROR_ACCESS_VIOLATION   => 'insufficient permissions',
+                DB_ERROR_ALREADY_EXISTS     => 'already exists',
+                DB_ERROR_CANNOT_CREATE      => 'can not create',
+                DB_ERROR_CANNOT_DROP        => 'can not drop',
+                DB_ERROR_CONNECT_FAILED     => 'connect failed',
+                DB_ERROR_CONSTRAINT         => 'constraint violation',
+                DB_ERROR_CONSTRAINT_NOT_NULL=> 'null value violates not-null constraint',
+                DB_ERROR_DIVZERO            => 'division by zero',
+                DB_ERROR_EXTENSION_NOT_FOUND=> 'extension not found',
+                DB_ERROR_INVALID            => 'invalid',
+                DB_ERROR_INVALID_DATE       => 'invalid date or time',
+                DB_ERROR_INVALID_DSN        => 'invalid DSN',
+                DB_ERROR_INVALID_NUMBER     => 'invalid number',
+                DB_ERROR_MISMATCH           => 'mismatch',
+                DB_ERROR_NEED_MORE_DATA     => 'insufficient data supplied',
+                DB_ERROR_NODBSELECTED       => 'no database selected',
+                DB_ERROR_NOSUCHDB           => 'no such database',
+                DB_ERROR_NOSUCHFIELD        => 'no such field',
+                DB_ERROR_NOSUCHTABLE        => 'no such table',
+                DB_ERROR_NOT_CAPABLE        => 'DB backend not capable',
+                DB_ERROR_NOT_FOUND          => 'not found',
+                DB_ERROR_NOT_LOCKED         => 'not locked',
+                DB_ERROR_SYNTAX             => 'syntax error',
+                DB_ERROR_UNSUPPORTED        => 'not supported',
+                DB_ERROR_TRUNCATED          => 'truncated',
+                DB_ERROR_VALUE_COUNT_ON_ROW => 'value count on row',
+                DB_OK                       => 'no error',
+            );
+        }
+
+        if (DB::isError($value)) {
+            $value = $value->getCode();
+        }
+
+        return isset($errorMessages[$value]) ? $errorMessages[$value]
+                     : $errorMessages[DB_ERROR];
+    }
+
+    // }}}
+    // {{{ parseDSN()
+
+    /**
+     * Parse a data source name
+     *
+     * Additional keys can be added by appending a URI query string to the
+     * end of the DSN.
+     *
+     * The format of the supplied DSN is in its fullest form:
+     * <code>
+     *  phptype(dbsyntax)://username:password at protocol+hostspec/database?option=8&another=true
+     * </code>
+     *
+     * Most variations are allowed:
+     * <code>
+     *  phptype://username:password@protocol+hostspec:110//usr/db_file.db?mode=0644
+     *  phptype://username:password@hostspec/database_name
+     *  phptype://username:password@hostspec
+     *  phptype://username@hostspec
+     *  phptype://hostspec/database
+     *  phptype://hostspec
+     *  phptype(dbsyntax)
+     *  phptype
+     * </code>
+     *
+     * @param string $dsn Data Source Name to be parsed
+     *
+     * @return array an associative array with the following keys:
+     *  + phptype:  Database backend used in PHP (mysql, odbc etc.)
+     *  + dbsyntax: Database used with regards to SQL syntax etc.
+     *  + protocol: Communication protocol to use (tcp, unix etc.)
+     *  + hostspec: Host specification (hostname[:port])
+     *  + database: Database to use on the DBMS server
+     *  + username: User name for login
+     *  + password: Password for login
+     */
+    function parseDSN($dsn)
+    {
+        $parsed = array(
+            'phptype'  => false,
+            'dbsyntax' => false,
+            'username' => false,
+            'password' => false,
+            'protocol' => false,
+            'hostspec' => false,
+            'port'     => false,
+            'socket'   => false,
+            'database' => false,
+        );
+
+        if (is_array($dsn)) {
+            $dsn = array_merge($parsed, $dsn);
+            if (!$dsn['dbsyntax']) {
+                $dsn['dbsyntax'] = $dsn['phptype'];
+            }
+            return $dsn;
+        }
+
+        // Find phptype and dbsyntax
+        if (($pos = strpos($dsn, '://')) !== false) {
+            $str = substr($dsn, 0, $pos);
+            $dsn = substr($dsn, $pos + 3);
+        } else {
+            $str = $dsn;
+            $dsn = null;
+        }
+
+        // Get phptype and dbsyntax
+        // $str => phptype(dbsyntax)
+        if (preg_match('|^(.+?)\((.*?)\)$|', $str, $arr)) {
+            $parsed['phptype']  = $arr[1];
+            $parsed['dbsyntax'] = !$arr[2] ? $arr[1] : $arr[2];
+        } else {
+            $parsed['phptype']  = $str;
+            $parsed['dbsyntax'] = $str;
+        }
+
+        if (!count($dsn)) {
+            return $parsed;
+        }
+
+        // Get (if found): username and password
+        // $dsn => username:password at protocol+hostspec/database
+        if (($at = strrpos($dsn,'@')) !== false) {
+            $str = substr($dsn, 0, $at);
+            $dsn = substr($dsn, $at + 1);
+            if (($pos = strpos($str, ':')) !== false) {
+                $parsed['username'] = rawurldecode(substr($str, 0, $pos));
+                $parsed['password'] = rawurldecode(substr($str, $pos + 1));
+            } else {
+                $parsed['username'] = rawurldecode($str);
+            }
+        }
+
+        // Find protocol and hostspec
+
+        if (preg_match('|^([^(]+)\((.*?)\)/?(.*?)$|', $dsn, $match)) {
+            // $dsn => proto(proto_opts)/database
+            $proto       = $match[1];
+            $proto_opts  = $match[2] ? $match[2] : false;
+            $dsn         = $match[3];
+
+        } else {
+            // $dsn => protocol+hostspec/database (old format)
+            if (strpos($dsn, '+') !== false) {
+                list($proto, $dsn) = explode('+', $dsn, 2);
+            }
+            if (strpos($dsn, '/') !== false) {
+                list($proto_opts, $dsn) = explode('/', $dsn, 2);
+            } else {
+                $proto_opts = $dsn;
+                $dsn = null;
+            }
+        }
+
+        // process the different protocol options
+        $parsed['protocol'] = (!empty($proto)) ? $proto : 'tcp';
+        $proto_opts = rawurldecode($proto_opts);
+        if ($parsed['protocol'] == 'tcp') {
+            if (strpos($proto_opts, ':') !== false) {
+                list($parsed['hostspec'],
+                     $parsed['port']) = explode(':', $proto_opts);
+            } else {
+                $parsed['hostspec'] = $proto_opts;
+            }
+        } elseif ($parsed['protocol'] == 'unix') {
+            $parsed['socket'] = $proto_opts;
+        }
+
+        // Get dabase if any
+        // $dsn => database
+        if ($dsn) {
+            if (($pos = strpos($dsn, '?')) === false) {
+                // /database
+                $parsed['database'] = rawurldecode($dsn);
+            } else {
+                // /database?param1=value1&param2=value2
+                $parsed['database'] = rawurldecode(substr($dsn, 0, $pos));
+                $dsn = substr($dsn, $pos + 1);
+                if (strpos($dsn, '&') !== false) {
+                    $opts = explode('&', $dsn);
+                } else { // database?param1=value1
+                    $opts = array($dsn);
+                }
+                foreach ($opts as $opt) {
+                    list($key, $value) = explode('=', $opt);
+                    if (!isset($parsed[$key])) {
+                        // don't allow params overwrite
+                        $parsed[$key] = rawurldecode($value);
+                    }
+                }
+            }
+        }
+
+        return $parsed;
+    }
+
+    // }}}
+}
+
+// }}}
+// {{{ class DB_Error
+
+/**
+ * DB_Error implements a class for reporting portable database error
+ * messages
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_Error extends PEAR_Error
+{
+    // {{{ constructor
+
+    /**
+     * DB_Error constructor
+     *
+     * @param mixed $code       DB error code, or string with error message
+     * @param int   $mode       what "error mode" to operate in
+     * @param int   $level      what error level to use for $mode &
+     *                           PEAR_ERROR_TRIGGER
+     * @param mixed $debuginfo  additional debug info, such as the last query
+     *
+     * @see PEAR_Error
+     */
+    function DB_Error($code = DB_ERROR, $mode = PEAR_ERROR_RETURN,
+                      $level = E_USER_NOTICE, $debuginfo = null)
+    {
+        if (is_int($code)) {
+            $this->PEAR_Error('DB Error: ' . DB::errorMessage($code), $code,
+                              $mode, $level, $debuginfo);
+        } else {
+            $this->PEAR_Error("DB Error: $code", DB_ERROR,
+                              $mode, $level, $debuginfo);
+        }
+    }
+
+    // }}}
+}
+
+// }}}
+// {{{ class DB_result
+
+/**
+ * This class implements a wrapper for a DB result set
+ *
+ * A new instance of this class will be returned by the DB implementation
+ * after processing a query that returns data.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ */
+class DB_result
+{
+    // {{{ properties
+
+    /**
+     * Should results be freed automatically when there are no more rows?
+     * @var boolean
+     * @see DB_common::$options
+     */
+    var $autofree;
+
+    /**
+     * A reference to the DB_<driver> object
+     * @var object
+     */
+    var $dbh;
+
+    /**
+     * The current default fetch mode
+     * @var integer
+     * @see DB_common::$fetchmode
+     */
+    var $fetchmode;
+
+    /**
+     * The name of the class into which results should be fetched when
+     * DB_FETCHMODE_OBJECT is in effect
+     *
+     * @var string
+     * @see DB_common::$fetchmode_object_class
+     */
+    var $fetchmode_object_class;
+
+    /**
+     * The number of rows to fetch from a limit query
+     * @var integer
+     */
+    var $limit_count = null;
+
+    /**
+     * The row to start fetching from in limit queries
+     * @var integer
+     */
+    var $limit_from = null;
+
+    /**
+     * The execute parameters that created this result
+     * @var array
+     * @since Property available since Release 1.7.0
+     */
+    var $parameters;
+
+    /**
+     * The query string that created this result
+     *
+     * Copied here incase it changes in $dbh, which is referenced
+     *
+     * @var string
+     * @since Property available since Release 1.7.0
+     */
+    var $query;
+
+    /**
+     * The query result resource id created by PHP
+     * @var resource
+     */
+    var $result;
+
+    /**
+     * The present row being dealt with
+     * @var integer
+     */
+    var $row_counter = null;
+
+    /**
+     * The prepared statement resource id created by PHP in $dbh
+     *
+     * This resource is only available when the result set was created using
+     * a driver's native execute() method, not PEAR DB's emulated one.
+     *
+     * Copied here incase it changes in $dbh, which is referenced
+     *
+     * {@internal  Mainly here because the InterBase/Firebird API is only
+     * able to retrieve data from result sets if the statemnt handle is
+     * still in scope.}}
+     *
+     * @var resource
+     * @since Property available since Release 1.7.0
+     */
+    var $statement;
+
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * This constructor sets the object's properties
+     *
+     * @param object   &$dbh     the DB object reference
+     * @param resource $result   the result resource id
+     * @param array    $options  an associative array with result options
+     *
+     * @return void
+     */
+    function DB_result(&$dbh, $result, $options = array())
+    {
+        $this->autofree    = $dbh->options['autofree'];
+        $this->dbh         = &$dbh;
+        $this->fetchmode   = $dbh->fetchmode;
+        $this->fetchmode_object_class = $dbh->fetchmode_object_class;
+        $this->parameters  = $dbh->last_parameters;
+        $this->query       = $dbh->last_query;
+        $this->result      = $result;
+        $this->statement   = empty($dbh->last_stmt) ? null : $dbh->last_stmt;
+        foreach ($options as $key => $value) {
+            $this->setOption($key, $value);
+        }
+    }
+
+    /**
+     * Set options for the DB_result object
+     *
+     * @param string $key    the option to set
+     * @param mixed  $value  the value to set the option to
+     *
+     * @return void
+     */
+    function setOption($key, $value = null)
+    {
+        switch ($key) {
+            case 'limit_from':
+                $this->limit_from = $value;
+                break;
+            case 'limit_count':
+                $this->limit_count = $value;
+        }
+    }
+
+    // }}}
+    // {{{ fetchRow()
+
+    /**
+     * Fetch a row of data and return it by reference into an array
+     *
+     * The type of array returned can be controlled either by setting this
+     * method's <var>$fetchmode</var> parameter or by changing the default
+     * fetch mode setFetchMode() before calling this method.
+     *
+     * There are two options for standardizing the information returned
+     * from databases, ensuring their values are consistent when changing
+     * DBMS's.  These portability options can be turned on when creating a
+     * new DB object or by using setOption().
+     *
+     *   + <var>DB_PORTABILITY_LOWERCASE</var>
+     *     convert names of fields to lower case
+     *
+     *   + <var>DB_PORTABILITY_RTRIM</var>
+     *     right trim the data
+     *
+     * @param int $fetchmode  the constant indicating how to format the data
+     * @param int $rownum     the row number to fetch (index starts at 0)
+     *
+     * @return mixed  an array or object containing the row's data,
+     *                 NULL when the end of the result set is reached
+     *                 or a DB_Error object on failure.
+     *
+     * @see DB_common::setOption(), DB_common::setFetchMode()
+     */
+    function &fetchRow($fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
+    {
+        if ($fetchmode === DB_FETCHMODE_DEFAULT) {
+            $fetchmode = $this->fetchmode;
+        }
+        if ($fetchmode === DB_FETCHMODE_OBJECT) {
+            $fetchmode = DB_FETCHMODE_ASSOC;
+            $object_class = $this->fetchmode_object_class;
+        }
+        if ($this->limit_from !== null) {
+            if ($this->row_counter === null) {
+                $this->row_counter = $this->limit_from;
+                // Skip rows
+                if ($this->dbh->features['limit'] === false) {
+                    $i = 0;
+                    while ($i++ < $this->limit_from) {
+                        $this->dbh->fetchInto($this->result, $arr, $fetchmode);
+                    }
+                }
+            }
+            if ($this->row_counter >= ($this->limit_from + $this->limit_count))
+            {
+                if ($this->autofree) {
+                    $this->free();
+                }
+                $tmp = null;
+                return $tmp;
+            }
+            if ($this->dbh->features['limit'] === 'emulate') {
+                $rownum = $this->row_counter;
+            }
+            $this->row_counter++;
+        }
+        $res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
+        if ($res === DB_OK) {
+            if (isset($object_class)) {
+                // The default mode is specified in the
+                // DB_common::fetchmode_object_class property
+                if ($object_class == 'stdClass') {
+                    $arr = (object) $arr;
+                } else {
+                    $arr = &new $object_class($arr);
+                }
+            }
+            return $arr;
+        }
+        if ($res == null && $this->autofree) {
+            $this->free();
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ fetchInto()
+
+    /**
+     * Fetch a row of data into an array which is passed by reference
+     *
+     * The type of array returned can be controlled either by setting this
+     * method's <var>$fetchmode</var> parameter or by changing the default
+     * fetch mode setFetchMode() before calling this method.
+     *
+     * There are two options for standardizing the information returned
+     * from databases, ensuring their values are consistent when changing
+     * DBMS's.  These portability options can be turned on when creating a
+     * new DB object or by using setOption().
+     *
+     *   + <var>DB_PORTABILITY_LOWERCASE</var>
+     *     convert names of fields to lower case
+     *
+     *   + <var>DB_PORTABILITY_RTRIM</var>
+     *     right trim the data
+     *
+     * @param array &$arr       the variable where the data should be placed
+     * @param int   $fetchmode  the constant indicating how to format the data
+     * @param int   $rownum     the row number to fetch (index starts at 0)
+     *
+     * @return mixed  DB_OK if a row is processed, NULL when the end of the
+     *                 result set is reached or a DB_Error object on failure
+     *
+     * @see DB_common::setOption(), DB_common::setFetchMode()
+     */
+    function fetchInto(&$arr, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum = null)
+    {
+        if ($fetchmode === DB_FETCHMODE_DEFAULT) {
+            $fetchmode = $this->fetchmode;
+        }
+        if ($fetchmode === DB_FETCHMODE_OBJECT) {
+            $fetchmode = DB_FETCHMODE_ASSOC;
+            $object_class = $this->fetchmode_object_class;
+        }
+        if ($this->limit_from !== null) {
+            if ($this->row_counter === null) {
+                $this->row_counter = $this->limit_from;
+                // Skip rows
+                if ($this->dbh->features['limit'] === false) {
+                    $i = 0;
+                    while ($i++ < $this->limit_from) {
+                        $this->dbh->fetchInto($this->result, $arr, $fetchmode);
+                    }
+                }
+            }
+            if ($this->row_counter >= (
+                    $this->limit_from + $this->limit_count))
+            {
+                if ($this->autofree) {
+                    $this->free();
+                }
+                return null;
+            }
+            if ($this->dbh->features['limit'] === 'emulate') {
+                $rownum = $this->row_counter;
+            }
+
+            $this->row_counter++;
+        }
+        $res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
+        if ($res === DB_OK) {
+            if (isset($object_class)) {
+                // default mode specified in the
+                // DB_common::fetchmode_object_class property
+                if ($object_class == 'stdClass') {
+                    $arr = (object) $arr;
+                } else {
+                    $arr = new $object_class($arr);
+                }
+            }
+            return DB_OK;
+        }
+        if ($res == null && $this->autofree) {
+            $this->free();
+        }
+        return $res;
+    }
+
+    // }}}
+    // {{{ numCols()
+
+    /**
+     * Get the the number of columns in a result set
+     *
+     * @return int  the number of columns.  A DB_Error object on failure.
+     */
+    function numCols()
+    {
+        return $this->dbh->numCols($this->result);
+    }
+
+    // }}}
+    // {{{ numRows()
+
+    /**
+     * Get the number of rows in a result set
+     *
+     * @return int  the number of rows.  A DB_Error object on failure.
+     */
+    function numRows()
+    {
+        if ($this->dbh->features['numrows'] === 'emulate'
+            && $this->dbh->options['portability'] & DB_PORTABILITY_NUMROWS)
+        {
+            if ($this->dbh->features['prepare']) {
+                $res = $this->dbh->query($this->query, $this->parameters);
+            } else {
+                $res = $this->dbh->query($this->query);
+            }
+            if (DB::isError($res)) {
+                return $res;
+            }
+            $i = 0;
+            while ($res->fetchInto($tmp, DB_FETCHMODE_ORDERED)) {
+                $i++;
+            }
+            return $i;
+        } else {
+            return $this->dbh->numRows($this->result);
+        }
+    }
+
+    // }}}
+    // {{{ nextResult()
+
+    /**
+     * Get the next result if a batch of queries was executed
+     *
+     * @return bool  true if a new result is available or false if not
+     */
+    function nextResult()
+    {
+        return $this->dbh->nextResult($this->result);
+    }
+
+    // }}}
+    // {{{ free()
+
+    /**
+     * Frees the resources allocated for this result set
+     *
+     * @return bool  true on success.  A DB_Error object on failure.
+     */
+    function free()
+    {
+        $err = $this->dbh->freeResult($this->result);
+        if (DB::isError($err)) {
+            return $err;
+        }
+        $this->result = false;
+        $this->statement = false;
+        return true;
+    }
+
+    // }}}
+    // {{{ tableInfo()
+
+    /**
+     * @see DB_common::tableInfo()
+     * @deprecated Method deprecated some time before Release 1.2
+     */
+    function tableInfo($mode = null)
+    {
+        if (is_string($mode)) {
+            return $this->dbh->raiseError(DB_ERROR_NEED_MORE_DATA);
+        }
+        return $this->dbh->tableInfo($this, $mode);
+    }
+
+    // }}}
+    // {{{ getQuery()
+
+    /**
+     * Determine the query string that created this result
+     *
+     * @return string  the query string
+     *
+     * @since Method available since Release 1.7.0
+     */
+    function getQuery()
+    {
+        return $this->query;
+    }
+
+    // }}}
+    // {{{ getRowCounter()
+
+    /**
+     * Tells which row number is currently being processed
+     *
+     * @return integer  the current row being looked at.  Starts at 1.
+     */
+    function getRowCounter()
+    {
+        return $this->row_counter;
+    }
+
+    // }}}
+}
+
+// }}}
+// {{{ class DB_row
+
+/**
+ * PEAR DB Row Object
+ *
+ * The object contains a row of data from a result set.  Each column's data
+ * is placed in a property named for the column.
+ *
+ * @category   Database
+ * @package    DB
+ * @author     Stig Bakken <ssb at php.net>
+ * @copyright  1997-2005 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: @package_version@
+ * @link       http://pear.php.net/package/DB
+ * @see        DB_common::setFetchMode()
+ */
+class DB_row
+{
+    // {{{ constructor
+
+    /**
+     * The constructor places a row's data into properties of this object
+     *
+     * @param array  the array containing the row's data
+     *
+     * @return void
+     */
+    function DB_row(&$arr)
+    {
+        foreach ($arr as $key => $value) {
+            $this->$key = &$arr[$key];
+        }
+    }
+
+    // }}}
+}
+
+// }}}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+
+?>

Added: trunk/direct.openmoko.com/pear/HTTP/Request/Listener.php
===================================================================
--- trunk/direct.openmoko.com/pear/HTTP/Request/Listener.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/HTTP/Request/Listener.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Copyright (c) 2002-2003, Richard Heyes                                |
+// | All rights reserved.                                                  |
+// |                                                                       |
+// | Redistribution and use in source and binary forms, with or without    |
+// | modification, are permitted provided that the following conditions    |
+// | are met:                                                              |
+// |                                                                       |
+// | o Redistributions of source code must retain the above copyright      |
+// |   notice, this list of conditions and the following disclaimer.       |
+// | o Redistributions in binary form must reproduce the above copyright   |
+// |   notice, this list of conditions and the following disclaimer in the |
+// |   documentation and/or other materials provided with the distribution.|
+// | o The names of the authors may not be used to endorse or promote      |
+// |   products derived from this software without specific prior written  |
+// |   permission.                                                         |
+// |                                                                       |
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |
+// |                                                                       |
+// +-----------------------------------------------------------------------+
+// | Author: Alexey Borzov <avb at php.net>                                  |
+// +-----------------------------------------------------------------------+
+//
+// $Id: Listener.php,v 1.2 2003/10/26 10:28:29 avb Exp $
+//
+
+/**
+ * This class implements the Observer part of a Subject-Observer
+ * design pattern. It listens to the events sent by a 
+ * HTTP_Request or HTTP_Response instance.
+ *
+ * @package HTTP_Request
+ * @author  Alexey Borzov <avb at php.net>
+ * @version $Revision: 1.2 $
+ */
+class HTTP_Request_Listener 
+{
+   /**
+    * A listener's identifier
+    * @var string
+    */
+    var $_id;
+
+   /**
+    * Constructor, sets the object's identifier
+    *
+    * @access public
+    */
+    function HTTP_Request_Listener()
+    {
+        $this->_id = md5(uniqid('http_request_', 1));
+    }
+
+
+   /**
+    * Returns the listener's identifier
+    *
+    * @access public
+    * @return string
+    */
+    function getId()
+    {
+        return $this->_id;
+    }
+
+
+   /**
+    * This method is called when Listener is notified of an event
+    *
+    * @access   public
+    * @param    object  an object the listener is attached to
+    * @param    string  Event name
+    * @param    mixed   Additional data
+    * @abstract
+    */
+    function update(&$subject, $event, $data = null)
+    {
+        echo "Notified of event: '$event'\n";
+        if (null !== $data) {
+            echo "Additional data: ";
+            var_dump($data);
+        }
+    }
+}
+?>

Added: trunk/direct.openmoko.com/pear/HTTP/Request.php
===================================================================
--- trunk/direct.openmoko.com/pear/HTTP/Request.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/HTTP/Request.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1191 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Copyright (c) 2002-2003, Richard Heyes                                |
+// | All rights reserved.                                                  |
+// |                                                                       |
+// | Redistribution and use in source and binary forms, with or without    |
+// | modification, are permitted provided that the following conditions    |
+// | are met:                                                              |
+// |                                                                       |
+// | o Redistributions of source code must retain the above copyright      |
+// |   notice, this list of conditions and the following disclaimer.       |
+// | o Redistributions in binary form must reproduce the above copyright   |
+// |   notice, this list of conditions and the following disclaimer in the |
+// |   documentation and/or other materials provided with the distribution.|
+// | o The names of the authors may not be used to endorse or promote      |
+// |   products derived from this software without specific prior written  |
+// |   permission.                                                         |
+// |                                                                       |
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |
+// |                                                                       |
+// +-----------------------------------------------------------------------+
+// | Author: Richard Heyes <richard at phpguru.org>                           |
+// +-----------------------------------------------------------------------+
+//
+// $Id: Request.php,v 1.43 2005/11/06 18:29:14 avb Exp $
+//
+// HTTP_Request Class
+//
+// Simple example, (Fetches yahoo.com and displays it):
+//
+// $a = &new HTTP_Request('http://www.yahoo.com/');
+// $a->sendRequest();
+// echo $a->getResponseBody();
+//
+
+require_once 'PEAR.php';
+require_once 'Net/Socket.php';
+require_once 'Net/URL.php';
+
+define('HTTP_REQUEST_METHOD_GET',     'GET',     true);
+define('HTTP_REQUEST_METHOD_HEAD',    'HEAD',    true);
+define('HTTP_REQUEST_METHOD_POST',    'POST',    true);
+define('HTTP_REQUEST_METHOD_PUT',     'PUT',     true);
+define('HTTP_REQUEST_METHOD_DELETE',  'DELETE',  true);
+define('HTTP_REQUEST_METHOD_OPTIONS', 'OPTIONS', true);
+define('HTTP_REQUEST_METHOD_TRACE',   'TRACE',   true);
+
+define('HTTP_REQUEST_HTTP_VER_1_0', '1.0', true);
+define('HTTP_REQUEST_HTTP_VER_1_1', '1.1', true);
+
+class HTTP_Request {
+
+    /**
+    * Instance of Net_URL
+    * @var object Net_URL
+    */
+    var $_url;
+
+    /**
+    * Type of request
+    * @var string
+    */
+    var $_method;
+
+    /**
+    * HTTP Version
+    * @var string
+    */
+    var $_http;
+
+    /**
+    * Request headers
+    * @var array
+    */
+    var $_requestHeaders;
+
+    /**
+    * Basic Auth Username
+    * @var string
+    */
+    var $_user;
+    
+    /**
+    * Basic Auth Password
+    * @var string
+    */
+    var $_pass;
+
+    /**
+    * Socket object
+    * @var object Net_Socket
+    */
+    var $_sock;
+    
+    /**
+    * Proxy server
+    * @var string
+    */
+    var $_proxy_host;
+    
+    /**
+    * Proxy port
+    * @var integer
+    */
+    var $_proxy_port;
+    
+    /**
+    * Proxy username
+    * @var string
+    */
+    var $_proxy_user;
+    
+    /**
+    * Proxy password
+    * @var string
+    */
+    var $_proxy_pass;
+
+    /**
+    * Post data
+    * @var array
+    */
+    var $_postData;
+
+   /**
+    * Request body  
+    * @var string
+    */
+    var $_body;
+
+   /**
+    * A list of methods that MUST NOT have a request body, per RFC 2616
+    * @var array
+    */
+    var $_bodyDisallowed = array('TRACE');
+
+   /**
+    * Files to post 
+    * @var array
+    */
+    var $_postFiles = array();
+
+    /**
+    * Connection timeout.
+    * @var float
+    */
+    var $_timeout;
+    
+    /**
+    * HTTP_Response object
+    * @var object HTTP_Response
+    */
+    var $_response;
+    
+    /**
+    * Whether to allow redirects
+    * @var boolean
+    */
+    var $_allowRedirects;
+    
+    /**
+    * Maximum redirects allowed
+    * @var integer
+    */
+    var $_maxRedirects;
+    
+    /**
+    * Current number of redirects
+    * @var integer
+    */
+    var $_redirects;
+
+   /**
+    * Whether to append brackets [] to array variables
+    * @var bool
+    */
+    var $_useBrackets = true;
+
+   /**
+    * Attached listeners
+    * @var array
+    */
+    var $_listeners = array();
+
+   /**
+    * Whether to save response body in response object property  
+    * @var bool
+    */
+    var $_saveBody = true;
+
+   /**
+    * Timeout for reading from socket (array(seconds, microseconds))
+    * @var array
+    */
+    var $_readTimeout = null;
+
+   /**
+    * Options to pass to Net_Socket::connect. See stream_context_create
+    * @var array
+    */
+    var $_socketOptions = null;
+
+    /**
+    * Constructor
+    *
+    * Sets up the object
+    * @param    string  The url to fetch/access
+    * @param    array   Associative array of parameters which can have the following keys:
+    * <ul>
+    *   <li>method         - Method to use, GET, POST etc (string)</li>
+    *   <li>http           - HTTP Version to use, 1.0 or 1.1 (string)</li>
+    *   <li>user           - Basic Auth username (string)</li>
+    *   <li>pass           - Basic Auth password (string)</li>
+    *   <li>proxy_host     - Proxy server host (string)</li>
+    *   <li>proxy_port     - Proxy server port (integer)</li>
+    *   <li>proxy_user     - Proxy auth username (string)</li>
+    *   <li>proxy_pass     - Proxy auth password (string)</li>
+    *   <li>timeout        - Connection timeout in seconds (float)</li>
+    *   <li>allowRedirects - Whether to follow redirects or not (bool)</li>
+    *   <li>maxRedirects   - Max number of redirects to follow (integer)</li>
+    *   <li>useBrackets    - Whether to append [] to array variable names (bool)</li>
+    *   <li>saveBody       - Whether to save response body in response object property (bool)</li>
+    *   <li>readTimeout    - Timeout for reading / writing data over the socket (array (seconds, microseconds))</li>
+    *   <li>socketOptions  - Options to pass to Net_Socket object (array)</li>
+    * </ul>
+    * @access public
+    */
+    function HTTP_Request($url = '', $params = array())
+    {
+        $this->_sock           = &new Net_Socket();
+        $this->_method         =  HTTP_REQUEST_METHOD_GET;
+        $this->_http           =  HTTP_REQUEST_HTTP_VER_1_1;
+        $this->_requestHeaders = array();
+        $this->_postData       = array();
+        $this->_body           = null;
+
+        $this->_user = null;
+        $this->_pass = null;
+
+        $this->_proxy_host = null;
+        $this->_proxy_port = null;
+        $this->_proxy_user = null;
+        $this->_proxy_pass = null;
+
+        $this->_allowRedirects = false;
+        $this->_maxRedirects   = 3;
+        $this->_redirects      = 0;
+
+        $this->_timeout  = null;
+        $this->_response = null;
+
+        foreach ($params as $key => $value) {
+            $this->{'_' . $key} = $value;
+        }
+
+        if (!empty($url)) {
+            $this->setURL($url);
+        }
+
+        // Default useragent
+        $this->addHeader('User-Agent', 'PEAR HTTP_Request class ( http://pear.php.net/ )');
+
+        // Make sure keepalives dont knobble us
+        $this->addHeader('Connection', 'close');
+
+        // Basic authentication
+        if (!empty($this->_user)) {
+            $this->addHeader('Authorization', 'Basic ' . base64_encode($this->_user . ':' . $this->_pass));
+        }
+
+        // Use gzip encoding if possible
+        // Avoid gzip encoding if using multibyte functions (see #1781)
+        if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && extension_loaded('zlib') &&
+            0 == (2 & ini_get('mbstring.func_overload'))) {
+
+            $this->addHeader('Accept-Encoding', 'gzip');
+        }
+    }
+    
+    /**
+    * Generates a Host header for HTTP/1.1 requests
+    *
+    * @access private
+    * @return string
+    */
+    function _generateHostHeader()
+    {
+        if ($this->_url->port != 80 AND strcasecmp($this->_url->protocol, 'http') == 0) {
+            $host = $this->_url->host . ':' . $this->_url->port;
+
+        } elseif ($this->_url->port != 443 AND strcasecmp($this->_url->protocol, 'https') == 0) {
+            $host = $this->_url->host . ':' . $this->_url->port;
+
+        } elseif ($this->_url->port == 443 AND strcasecmp($this->_url->protocol, 'https') == 0 AND strpos($this->_url->url, ':443') !== false) {
+            $host = $this->_url->host . ':' . $this->_url->port;
+        
+        } else {
+            $host = $this->_url->host;
+        }
+
+        return $host;
+    }
+    
+    /**
+    * Resets the object to its initial state (DEPRECATED).
+    * Takes the same parameters as the constructor.
+    *
+    * @param  string $url    The url to be requested
+    * @param  array  $params Associative array of parameters
+    *                        (see constructor for details)
+    * @access public
+    * @deprecated deprecated since 1.2, call the constructor if this is necessary
+    */
+    function reset($url, $params = array())
+    {
+        $this->HTTP_Request($url, $params);
+    }
+
+    /**
+    * Sets the URL to be requested
+    *
+    * @param  string The url to be requested
+    * @access public
+    */
+    function setURL($url)
+    {
+        $this->_url = &new Net_URL($url, $this->_useBrackets);
+
+        if (!empty($this->_url->user) || !empty($this->_url->pass)) {
+            $this->setBasicAuth($this->_url->user, $this->_url->pass);
+        }
+
+        if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http) {
+            $this->addHeader('Host', $this->_generateHostHeader());
+        }
+    }
+    
+    /**
+    * Sets a proxy to be used
+    *
+    * @param string     Proxy host
+    * @param int        Proxy port
+    * @param string     Proxy username
+    * @param string     Proxy password
+    * @access public
+    */
+    function setProxy($host, $port = 8080, $user = null, $pass = null)
+    {
+        $this->_proxy_host = $host;
+        $this->_proxy_port = $port;
+        $this->_proxy_user = $user;
+        $this->_proxy_pass = $pass;
+
+        if (!empty($user)) {
+            $this->addHeader('Proxy-Authorization', 'Basic ' . base64_encode($user . ':' . $pass));
+        }
+    }
+
+    /**
+    * Sets basic authentication parameters
+    *
+    * @param string     Username
+    * @param string     Password
+    */
+    function setBasicAuth($user, $pass)
+    {
+        $this->_user = $user;
+        $this->_pass = $pass;
+
+        $this->addHeader('Authorization', 'Basic ' . base64_encode($user . ':' . $pass));
+    }
+
+    /**
+    * Sets the method to be used, GET, POST etc.
+    *
+    * @param string     Method to use. Use the defined constants for this
+    * @access public
+    */
+    function setMethod($method)
+    {
+        $this->_method = $method;
+    }
+
+    /**
+    * Sets the HTTP version to use, 1.0 or 1.1
+    *
+    * @param string     Version to use. Use the defined constants for this
+    * @access public
+    */
+    function setHttpVer($http)
+    {
+        $this->_http = $http;
+    }
+
+    /**
+    * Adds a request header
+    *
+    * @param string     Header name
+    * @param string     Header value
+    * @access public
+    */
+    function addHeader($name, $value)
+    {
+        $this->_requestHeaders[strtolower($name)] = $value;
+    }
+
+    /**
+    * Removes a request header
+    *
+    * @param string     Header name to remove
+    * @access public
+    */
+    function removeHeader($name)
+    {
+        if (isset($this->_requestHeaders[strtolower($name)])) {
+            unset($this->_requestHeaders[strtolower($name)]);
+        }
+    }
+
+    /**
+    * Adds a querystring parameter
+    *
+    * @param string     Querystring parameter name
+    * @param string     Querystring parameter value
+    * @param bool       Whether the value is already urlencoded or not, default = not
+    * @access public
+    */
+    function addQueryString($name, $value, $preencoded = false)
+    {
+        $this->_url->addQueryString($name, $value, $preencoded);
+    }    
+    
+    /**
+    * Sets the querystring to literally what you supply
+    *
+    * @param string     The querystring data. Should be of the format foo=bar&x=y etc
+    * @param bool       Whether data is already urlencoded or not, default = already encoded
+    * @access public
+    */
+    function addRawQueryString($querystring, $preencoded = true)
+    {
+        $this->_url->addRawQueryString($querystring, $preencoded);
+    }
+
+    /**
+    * Adds postdata items
+    *
+    * @param string     Post data name
+    * @param string     Post data value
+    * @param bool       Whether data is already urlencoded or not, default = not
+    * @access public
+    */
+    function addPostData($name, $value, $preencoded = false)
+    {
+        if ($preencoded) {
+            $this->_postData[$name] = $value;
+        } else {
+            $this->_postData[$name] = $this->_arrayMapRecursive('urlencode', $value);
+        }
+    }
+
+   /**
+    * Recursively applies the callback function to the value
+    * 
+    * @param    mixed   Callback function
+    * @param    mixed   Value to process
+    * @access   private
+    * @return   mixed   Processed value
+    */
+    function _arrayMapRecursive($callback, $value)
+    {
+        if (!is_array($value)) {
+            return call_user_func($callback, $value);
+        } else {
+            $map = array();
+            foreach ($value as $k => $v) {
+                $map[$k] = $this->_arrayMapRecursive($callback, $v);
+            }
+            return $map;
+        }
+    }
+
+   /**
+    * Adds a file to upload
+    * 
+    * This also changes content-type to 'multipart/form-data' for proper upload
+    * 
+    * @access public
+    * @param  string    name of file-upload field
+    * @param  mixed     file name(s)
+    * @param  mixed     content-type(s) of file(s) being uploaded
+    * @return bool      true on success
+    * @throws PEAR_Error
+    */
+    function addFile($inputName, $fileName, $contentType = 'application/octet-stream')
+    {
+        if (!is_array($fileName) && !is_readable($fileName)) {
+            return PEAR::raiseError("File '{$fileName}' is not readable");
+        } elseif (is_array($fileName)) {
+            foreach ($fileName as $name) {
+                if (!is_readable($name)) {
+                    return PEAR::raiseError("File '{$name}' is not readable");
+                }
+            }
+        }
+        $this->addHeader('Content-Type', 'multipart/form-data');
+        $this->_postFiles[$inputName] = array(
+            'name' => $fileName,
+            'type' => $contentType
+        );
+        return true;
+    }
+
+    /**
+    * Adds raw postdata (DEPRECATED)
+    *
+    * @param string     The data
+    * @param bool       Whether data is preencoded or not, default = already encoded
+    * @access public
+    * @deprecated       deprecated since 1.3.0, method addBody() should be used instead
+    */
+    function addRawPostData($postdata, $preencoded = true)
+    {
+        $this->_body = $preencoded ? $postdata : urlencode($postdata);
+    }
+
+   /**
+    * Sets the request body (for POST, PUT and similar requests)
+    *
+    * @param    string  Request body
+    * @access   public
+    */
+    function setBody($body)
+    {
+        $this->_body = $body;
+    }
+
+    /**
+    * Clears any postdata that has been added (DEPRECATED). 
+    * 
+    * Useful for multiple request scenarios.
+    *
+    * @access public
+    * @deprecated deprecated since 1.2
+    */
+    function clearPostData()
+    {
+        $this->_postData = null;
+    }
+
+    /**
+    * Appends a cookie to "Cookie:" header
+    * 
+    * @param string $name cookie name
+    * @param string $value cookie value
+    * @access public
+    */
+    function addCookie($name, $value)
+    {
+        $cookies = isset($this->_requestHeaders['cookie']) ? $this->_requestHeaders['cookie']. '; ' : '';
+        $this->addHeader('Cookie', $cookies . $name . '=' . $value);
+    }
+    
+    /**
+    * Clears any cookies that have been added (DEPRECATED). 
+    * 
+    * Useful for multiple request scenarios
+    *
+    * @access public
+    * @deprecated deprecated since 1.2
+    */
+    function clearCookies()
+    {
+        $this->removeHeader('Cookie');
+    }
+
+    /**
+    * Sends the request
+    *
+    * @access public
+    * @param  bool   Whether to store response body in Response object property,
+    *                set this to false if downloading a LARGE file and using a Listener
+    * @return mixed  PEAR error on error, true otherwise
+    */
+    function sendRequest($saveBody = true)
+    {
+        if (!is_a($this->_url, 'Net_URL')) {
+            return PEAR::raiseError('No URL given.');
+        }
+
+        $host = isset($this->_proxy_host) ? $this->_proxy_host : $this->_url->host;
+        $port = isset($this->_proxy_port) ? $this->_proxy_port : $this->_url->port;
+
+        // 4.3.0 supports SSL connections using OpenSSL. The function test determines
+        // we running on at least 4.3.0
+        if (strcasecmp($this->_url->protocol, 'https') == 0 AND function_exists('file_get_contents') AND extension_loaded('openssl')) {
+            if (isset($this->_proxy_host)) {
+                return PEAR::raiseError('HTTPS proxies are not supported.');
+            }
+            $host = 'ssl://' . $host;
+        }
+
+        // magic quotes may fuck up file uploads and chunked response processing
+        $magicQuotes = ini_get('magic_quotes_runtime');
+        ini_set('magic_quotes_runtime', false);
+
+        // If this is a second request, we may get away without
+        // re-connecting if they're on the same server
+        $err = $this->_sock->connect($host, $port, null, $this->_timeout, $this->_socketOptions);
+        PEAR::isError($err) or $err = $this->_sock->write($this->_buildRequest());
+
+        if (!PEAR::isError($err)) {
+            if (!empty($this->_readTimeout)) {
+                $this->_sock->setTimeout($this->_readTimeout[0], $this->_readTimeout[1]);
+            }
+
+            $this->_notify('sentRequest');
+
+            // Read the response
+            $this->_response = &new HTTP_Response($this->_sock, $this->_listeners);
+            $err = $this->_response->process($this->_saveBody && $saveBody);
+        }
+
+        ini_set('magic_quotes_runtime', $magicQuotes);
+
+        if (PEAR::isError($err)) {
+            return $err;
+        }
+
+
+        // Check for redirection
+        if (    $this->_allowRedirects
+            AND $this->_redirects <= $this->_maxRedirects
+            AND $this->getResponseCode() > 300
+            AND $this->getResponseCode() < 399
+            AND !empty($this->_response->_headers['location'])) {
+
+            
+            $redirect = $this->_response->_headers['location'];
+
+            // Absolute URL
+            if (preg_match('/^https?:\/\//i', $redirect)) {
+                $this->_url = &new Net_URL($redirect);
+                $this->addHeader('Host', $this->_generateHostHeader());
+            // Absolute path
+            } elseif ($redirect{0} == '/') {
+                $this->_url->path = $redirect;
+            
+            // Relative path
+            } elseif (substr($redirect, 0, 3) == '../' OR substr($redirect, 0, 2) == './') {
+                if (substr($this->_url->path, -1) == '/') {
+                    $redirect = $this->_url->path . $redirect;
+                } else {
+                    $redirect = dirname($this->_url->path) . '/' . $redirect;
+                }
+                $redirect = Net_URL::resolvePath($redirect);
+                $this->_url->path = $redirect;
+                
+            // Filename, no path
+            } else {
+                if (substr($this->_url->path, -1) == '/') {
+                    $redirect = $this->_url->path . $redirect;
+                } else {
+                    $redirect = dirname($this->_url->path) . '/' . $redirect;
+                }
+                $this->_url->path = $redirect;
+            }
+
+            $this->_redirects++;
+            return $this->sendRequest($saveBody);
+
+        // Too many redirects
+        } elseif ($this->_allowRedirects AND $this->_redirects > $this->_maxRedirects) {
+            return PEAR::raiseError('Too many redirects');
+        }
+
+        $this->_sock->disconnect();
+
+        return true;
+    }
+
+    /**
+    * Returns the response code
+    *
+    * @access public
+    * @return mixed     Response code, false if not set
+    */
+    function getResponseCode()
+    {
+        return isset($this->_response->_code) ? $this->_response->_code : false;
+    }
+
+    /**
+    * Returns either the named header or all if no name given
+    *
+    * @access public
+    * @param string     The header name to return, do not set to get all headers
+    * @return mixed     either the value of $headername (false if header is not present)
+    *                   or an array of all headers
+    */
+    function getResponseHeader($headername = null)
+    {
+        if (!isset($headername)) {
+            return isset($this->_response->_headers)? $this->_response->_headers: array();
+        } else {
+            $headername = strtolower($headername);
+            return isset($this->_response->_headers[$headername]) ? $this->_response->_headers[$headername] : false;
+        }
+    }
+
+    /**
+    * Returns the body of the response
+    *
+    * @access public
+    * @return mixed     response body, false if not set
+    */
+    function getResponseBody()
+    {
+        return isset($this->_response->_body) ? $this->_response->_body : false;
+    }
+
+    /**
+    * Returns cookies set in response
+    * 
+    * @access public
+    * @return mixed     array of response cookies, false if none are present
+    */
+    function getResponseCookies()
+    {
+        return isset($this->_response->_cookies) ? $this->_response->_cookies : false;
+    }
+
+    /**
+    * Builds the request string
+    *
+    * @access private
+    * @return string The request string
+    */
+    function _buildRequest()
+    {
+        $separator = ini_get('arg_separator.output');
+        ini_set('arg_separator.output', '&');
+        $querystring = ($querystring = $this->_url->getQueryString()) ? '?' . $querystring : '';
+        ini_set('arg_separator.output', $separator);
+
+        $host = isset($this->_proxy_host) ? $this->_url->protocol . '://' . $this->_url->host : '';
+        $port = (isset($this->_proxy_host) AND $this->_url->port != 80) ? ':' . $this->_url->port : '';
+        $path = (empty($this->_url->path)? '/': $this->_url->path) . $querystring;
+        $url  = $host . $port . $path;
+
+        $request = $this->_method . ' ' . $url . ' HTTP/' . $this->_http . "\r\n";
+
+        if (in_array($this->_method, $this->_bodyDisallowed) ||
+            (HTTP_REQUEST_METHOD_POST != $this->_method && empty($this->_body)) ||
+            (HTTP_REQUEST_METHOD_POST != $this->_method && empty($this->_postData) && empty($this->_postFiles))) {
+
+            $this->removeHeader('Content-Type');
+        } else {
+            if (empty($this->_requestHeaders['content-type'])) {
+                // Add default content-type
+                $this->addHeader('Content-Type', 'application/x-www-form-urlencoded');
+            } elseif ('multipart/form-data' == $this->_requestHeaders['content-type']) {
+                $boundary = 'HTTP_Request_' . md5(uniqid('request') . microtime());
+                $this->addHeader('Content-Type', 'multipart/form-data; boundary=' . $boundary);
+            }
+        }
+
+        // Request Headers
+        if (!empty($this->_requestHeaders)) {
+            foreach ($this->_requestHeaders as $name => $value) {
+                $canonicalName = implode('-', array_map('ucfirst', explode('-', $name)));
+                $request      .= $canonicalName . ': ' . $value . "\r\n";
+            }
+        }
+
+        // No post data or wrong method, so simply add a final CRLF
+        if (in_array($this->_method, $this->_bodyDisallowed) || 
+            (HTTP_REQUEST_METHOD_POST != $this->_method && empty($this->_body))) {
+
+            $request .= "\r\n";
+
+        // Post data if it's an array
+        } elseif (HTTP_REQUEST_METHOD_POST == $this->_method && 
+                  (!empty($this->_postData) || !empty($this->_postFiles))) {
+
+            // "normal" POST request
+            if (!isset($boundary)) {
+                $postdata = implode('&', array_map(
+                    create_function('$a', 'return $a[0] . \'=\' . $a[1];'), 
+                    $this->_flattenArray('', $this->_postData)
+                ));
+
+            // multipart request, probably with file uploads
+            } else {
+                $postdata = '';
+                if (!empty($this->_postData)) {
+                    $flatData = $this->_flattenArray('', $this->_postData);
+                    foreach ($flatData as $item) {
+                        $postdata .= '--' . $boundary . "\r\n";
+                        $postdata .= 'Content-Disposition: form-data; name="' . $item[0] . '"';
+                        $postdata .= "\r\n\r\n" . urldecode($item[1]) . "\r\n";
+                    }
+                }
+                foreach ($this->_postFiles as $name => $value) {
+                    if (is_array($value['name'])) {
+                        $varname       = $name . ($this->_useBrackets? '[]': '');
+                    } else {
+                        $varname       = $name;
+                        $value['name'] = array($value['name']);
+                    }
+                    foreach ($value['name'] as $key => $filename) {
+                        $fp   = fopen($filename, 'r');
+                        $data = fread($fp, filesize($filename));
+                        fclose($fp);
+                        $basename = basename($filename);
+                        $type     = is_array($value['type'])? @$value['type'][$key]: $value['type'];
+
+                        $postdata .= '--' . $boundary . "\r\n";
+                        $postdata .= 'Content-Disposition: form-data; name="' . $varname . '"; filename="' . $basename . '"';
+                        $postdata .= "\r\nContent-Type: " . $type;
+                        $postdata .= "\r\n\r\n" . $data . "\r\n";
+                    }
+                }
+                $postdata .= '--' . $boundary . "--\r\n";
+            }
+            $request .= 'Content-Length: ' . strlen($postdata) . "\r\n\r\n";
+            $request .= $postdata;
+
+        // Explicitly set request body
+        } elseif (!empty($this->_body)) {
+
+            $request .= 'Content-Length: ' . strlen($this->_body) . "\r\n\r\n";
+            $request .= $this->_body;
+        }
+        
+        return $request;
+    }
+
+   /**
+    * Helper function to change the (probably multidimensional) associative array
+    * into the simple one.
+    *
+    * @param    string  name for item
+    * @param    mixed   item's values
+    * @return   array   array with the following items: array('item name', 'item value');
+    */
+    function _flattenArray($name, $values)
+    {
+        if (!is_array($values)) {
+            return array(array($name, $values));
+        } else {
+            $ret = array();
+            foreach ($values as $k => $v) {
+                if (empty($name)) {
+                    $newName = $k;
+                } elseif ($this->_useBrackets) {
+                    $newName = $name . '[' . $k . ']';
+                } else {
+                    $newName = $name;
+                }
+                $ret = array_merge($ret, $this->_flattenArray($newName, $v));
+            }
+            return $ret;
+        }
+    }
+
+
+   /**
+    * Adds a Listener to the list of listeners that are notified of
+    * the object's events
+    * 
+    * @param    object   HTTP_Request_Listener instance to attach
+    * @return   boolean  whether the listener was successfully attached
+    * @access   public
+    */
+    function attach(&$listener)
+    {
+        if (!is_a($listener, 'HTTP_Request_Listener')) {
+            return false;
+        }
+        $this->_listeners[$listener->getId()] =& $listener;
+        return true;
+    }
+
+
+   /**
+    * Removes a Listener from the list of listeners 
+    * 
+    * @param    object   HTTP_Request_Listener instance to detach
+    * @return   boolean  whether the listener was successfully detached
+    * @access   public
+    */
+    function detach(&$listener)
+    {
+        if (!is_a($listener, 'HTTP_Request_Listener') || 
+            !isset($this->_listeners[$listener->getId()])) {
+            return false;
+        }
+        unset($this->_listeners[$listener->getId()]);
+        return true;
+    }
+
+
+   /**
+    * Notifies all registered listeners of an event.
+    * 
+    * Events sent by HTTP_Request object
+    * 'sentRequest': after the request was sent
+    * Events sent by HTTP_Response object
+    * 'gotHeaders': after receiving response headers (headers are passed in $data)
+    * 'tick': on receiving a part of response body (the part is passed in $data)
+    * 'gzTick': on receiving a gzip-encoded part of response body (ditto)
+    * 'gotBody': after receiving the response body (passes the decoded body in $data if it was gzipped)
+    * 
+    * @param    string  Event name
+    * @param    mixed   Additional data
+    * @access   private
+    */
+    function _notify($event, $data = null)
+    {
+        foreach (array_keys($this->_listeners) as $id) {
+            $this->_listeners[$id]->update($this, $event, $data);
+        }
+    }
+}
+
+
+/**
+* Response class to complement the Request class
+*/
+class HTTP_Response
+{
+    /**
+    * Socket object
+    * @var object
+    */
+    var $_sock;
+
+    /**
+    * Protocol
+    * @var string
+    */
+    var $_protocol;
+    
+    /**
+    * Return code
+    * @var string
+    */
+    var $_code;
+    
+    /**
+    * Response headers
+    * @var array
+    */
+    var $_headers;
+
+    /**
+    * Cookies set in response  
+    * @var array
+    */
+    var $_cookies;
+
+    /**
+    * Response body
+    * @var string
+    */
+    var $_body = '';
+
+   /**
+    * Used by _readChunked(): remaining length of the current chunk
+    * @var string
+    */
+    var $_chunkLength = 0;
+
+   /**
+    * Attached listeners
+    * @var array
+    */
+    var $_listeners = array();
+
+    /**
+    * Constructor
+    *
+    * @param  object Net_Socket     socket to read the response from
+    * @param  array                 listeners attached to request
+    * @return mixed PEAR Error on error, true otherwise
+    */
+    function HTTP_Response(&$sock, &$listeners)
+    {
+        $this->_sock      =& $sock;
+        $this->_listeners =& $listeners;
+    }
+
+
+   /**
+    * Processes a HTTP response
+    * 
+    * This extracts response code, headers, cookies and decodes body if it 
+    * was encoded in some way
+    *
+    * @access public
+    * @param  bool      Whether to store response body in object property, set
+    *                   this to false if downloading a LARGE file and using a Listener.
+    *                   This is assumed to be true if body is gzip-encoded.
+    * @throws PEAR_Error
+    * @return mixed     true on success, PEAR_Error in case of malformed response
+    */
+    function process($saveBody = true)
+    {
+        do {
+            $line = $this->_sock->readLine();
+            if (sscanf($line, 'HTTP/%s %s', $http_version, $returncode) != 2) {
+                return PEAR::raiseError('Malformed response.');
+            } else {
+                $this->_protocol = 'HTTP/' . $http_version;
+                $this->_code     = intval($returncode);
+            }
+            while ('' !== ($header = $this->_sock->readLine())) {
+                $this->_processHeader($header);
+            }
+        } while (100 == $this->_code);
+
+        $this->_notify('gotHeaders', $this->_headers);
+
+        // If response body is present, read it and decode
+        $chunked = isset($this->_headers['transfer-encoding']) && ('chunked' == $this->_headers['transfer-encoding']);
+        $gzipped = isset($this->_headers['content-encoding']) && ('gzip' == $this->_headers['content-encoding']);
+        $hasBody = false;
+        if (!isset($this->_headers['content-length']) || 0 != $this->_headers['content-length']) {
+            while (!$this->_sock->eof()) {
+                if ($chunked) {
+                    $data = $this->_readChunked();
+                } else {
+                    $data = $this->_sock->read(4096);
+                }
+                if ('' == $data) {
+                    break;
+                } else {
+                    $hasBody = true;
+                    if ($saveBody || $gzipped) {
+                        $this->_body .= $data;
+                    }
+                    $this->_notify($gzipped? 'gzTick': 'tick', $data);
+                }
+            }
+        }
+        if ($hasBody) {
+            // Uncompress the body if needed
+            if ($gzipped) {
+                $this->_body = gzinflate(substr($this->_body, 10));
+                $this->_notify('gotBody', $this->_body);
+            } else {
+                $this->_notify('gotBody');
+            }
+        }
+        return true;
+    }
+
+
+   /**
+    * Processes the response header
+    *
+    * @access private
+    * @param  string    HTTP header
+    */
+    function _processHeader($header)
+    {
+        list($headername, $headervalue) = explode(':', $header, 2);
+        $headername  = strtolower($headername);
+        $headervalue = ltrim($headervalue);
+        
+        if ('set-cookie' != $headername) {
+            if (isset($this->_headers[$headername])) {
+                $this->_headers[$headername] .= ',' . $headervalue;
+            } else {
+                $this->_headers[$headername]  = $headervalue;
+            }
+        } else {
+            $this->_parseCookie($headervalue);
+        }
+    }
+
+
+   /**
+    * Parse a Set-Cookie header to fill $_cookies array
+    *
+    * @access private
+    * @param  string    value of Set-Cookie header
+    */
+    function _parseCookie($headervalue)
+    {
+        $cookie = array(
+            'expires' => null,
+            'domain'  => null,
+            'path'    => null,
+            'secure'  => false
+        );
+
+        // Only a name=value pair
+        if (!strpos($headervalue, ';')) {
+            $pos = strpos($headervalue, '=');
+            $cookie['name']  = trim(substr($headervalue, 0, $pos));
+            $cookie['value'] = trim(substr($headervalue, $pos + 1));
+
+        // Some optional parameters are supplied
+        } else {
+            $elements = explode(';', $headervalue);
+            $pos = strpos($elements[0], '=');
+            $cookie['name']  = trim(substr($elements[0], 0, $pos));
+            $cookie['value'] = trim(substr($elements[0], $pos + 1));
+
+            for ($i = 1; $i < count($elements); $i++) {
+                if (false === strpos($elements[$i], '=')) {
+                    $elName  = trim($elements[$i]);
+                    $elValue = null;
+                } else {
+                    list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i]));
+                }
+                $elName = strtolower($elName);
+                if ('secure' == $elName) {
+                    $cookie['secure'] = true;
+                } elseif ('expires' == $elName) {
+                    $cookie['expires'] = str_replace('"', '', $elValue);
+                } elseif ('path' == $elName || 'domain' == $elName) {
+                    $cookie[$elName] = urldecode($elValue);
+                } else {
+                    $cookie[$elName] = $elValue;
+                }
+            }
+        }
+        $this->_cookies[] = $cookie;
+    }
+
+
+   /**
+    * Read a part of response body encoded with chunked Transfer-Encoding
+    * 
+    * @access private
+    * @return string
+    */
+    function _readChunked()
+    {
+        // at start of the next chunk?
+        if (0 == $this->_chunkLength) {
+            $line = $this->_sock->readLine();
+            if (preg_match('/^([0-9a-f]+)/i', $line, $matches)) {
+                $this->_chunkLength = hexdec($matches[1]); 
+                // Chunk with zero length indicates the end
+                if (0 == $this->_chunkLength) {
+                    $this->_sock->readLine(); // make this an eof()
+                    return '';
+                }
+            } else {
+                return '';
+            }
+        }
+        $data = $this->_sock->read($this->_chunkLength);
+        $this->_chunkLength -= strlen($data);
+        if (0 == $this->_chunkLength) {
+            $this->_sock->readLine(); // Trailing CRLF
+        }
+        return $data;
+    }
+
+
+   /**
+    * Notifies all registered listeners of an event.
+    * 
+    * @param    string  Event name
+    * @param    mixed   Additional data
+    * @access   private
+    * @see HTTP_Request::_notify()
+    */
+    function _notify($event, $data = null)
+    {
+        foreach (array_keys($this->_listeners) as $id) {
+            $this->_listeners[$id]->update($this, $event, $data);
+        }
+    }
+} // End class HTTP_Response
+?>

Added: trunk/direct.openmoko.com/pear/Log/composite.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/composite.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/composite.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,200 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/composite.php,v 1.26 2005/08/24 05:09:45 jon Exp $
+ * $Horde: horde/lib/Log/composite.php,v 1.2 2000/06/28 21:36:13 jon Exp $
+ *
+ * @version $Revision: 1.26 $
+ * @package Log
+ */
+
+/**
+ * The Log_composite:: class implements a Composite pattern which
+ * allows multiple Log implementations to receive the same events.
+ *
+ * @author  Chuck Hagenbuch <chuck at horde.org>
+ * @author  Jon Parise <jon at php.net>
+ *
+ * @since Horde 1.3
+ * @since Log 1.0
+ * @package Log
+ *
+ * @example composite.php   Using the composite handler.
+ */
+class Log_composite extends Log
+{
+    /**
+     * Array holding all of the Log instances to which log events should be
+     * sent.
+     *
+     * @var array
+     * @access private
+     */
+    var $_children = array();
+
+
+    /**
+     * Constructs a new composite Log object.
+     *
+     * @param boolean   $name       This parameter is ignored.
+     * @param boolean   $ident      This parameter is ignored.
+     * @param boolean   $conf       This parameter is ignored.
+     * @param boolean   $level      This parameter is ignored.
+     *
+     * @access public
+     */
+    function Log_composite($name, $ident = '', $conf = array(),
+                           $level = PEAR_LOG_DEBUG)
+    {
+        $this->_ident = $ident;
+    }
+
+    /**
+     * Opens the child connections.
+     *
+     * @access public
+     */
+    function open()
+    {
+        if (!$this->_opened) {
+            foreach ($this->_children as $id => $child) {
+                $this->_children[$id]->open();
+            }
+            $this->_opened = true;
+        }
+    }
+
+    /**
+     * Closes any child instances.
+     *
+     * @access public
+     */
+    function close()
+    {
+        if ($this->_opened) {
+            foreach ($this->_children as $id => $child) {
+                $this->_children[$id]->close();
+            }
+            $this->_opened = false;
+        }
+    }
+
+    /**
+     * Flushes all open child instances.
+     *
+     * @access public
+     * @since Log 1.8.2
+     */
+    function flush()
+    {
+        if ($this->_opened) {
+            foreach ($this->_children as $id => $child) {
+                $this->_children[$id]->flush();
+            }
+        }
+    }
+
+    /**
+     * Sends $message and $priority to each child of this composite.
+     *
+     * @param mixed     $message    String or object containing the message
+     *                              to log.
+     * @param string    $priority   (optional) The priority of the message.
+     *                              Valid values are: PEAR_LOG_EMERG,
+     *                              PEAR_LOG_ALERT, PEAR_LOG_CRIT,
+     *                              PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                              PEAR_LOG_NOTICE, PEAR_LOG_INFO, and
+     *                              PEAR_LOG_DEBUG.
+     *
+     * @return boolean  True if the entry is successfully logged.
+     *
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        foreach ($this->_children as $id => $child) {
+            $this->_children[$id]->log($message, $priority);
+        }
+
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+    /**
+     * Returns true if this is a composite.
+     *
+     * @return boolean  True if this is a composite class.
+     *
+     * @access public
+     */
+    function isComposite()
+    {
+        return true;
+    }
+
+    /**
+     * Sets this identification string for all of this composite's children.
+     *
+     * @param string    $ident      The new identification string.
+     *
+     * @access public
+     * @since  Log 1.6.7
+     */
+    function setIdent($ident)
+    {
+        /* Call our base class's setIdent() method. */
+        parent::setIdent($ident);
+
+        /* ... and then call setIdent() on all of our children. */
+        foreach ($this->_children as $id => $child) {
+            $this->_children[$id]->setIdent($ident);
+        }
+    }
+
+    /**
+     * Adds a Log instance to the list of children.
+     *
+     * @param object    $child      The Log instance to add.
+     *
+     * @return boolean  True if the Log instance was successfully added.
+     *
+     * @access public
+     */
+    function addChild(&$child)
+    {
+        /* Make sure this is a Log instance. */
+        if (!is_a($child, 'Log')) {
+            return false;
+        }
+
+        $this->_children[$child->_id] = &$child;
+
+        return true;
+    }
+
+    /**
+     * Removes a Log instance from the list of children.
+     *
+     * @param object    $child      The Log instance to remove.
+     *
+     * @return boolean  True if the Log instance was successfully removed.
+     *
+     * @access public
+     */
+    function removeChild($child)
+    {
+        if (!is_a($child, 'Log') || !isset($this->_children[$child->_id])) {
+            return false;
+        }
+
+        unset($this->_children[$child->_id]);
+
+        return true;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/console.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/console.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/console.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,190 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/console.php,v 1.22 2006/01/11 07:56:37 jon Exp $
+ *
+ * @version $Revision: 1.22 $
+ * @package Log
+ */
+
+/**
+ * The Log_console class is a concrete implementation of the Log::
+ * abstract class which writes message to the text console.
+ * 
+ * @author  Jon Parise <jon at php.net>
+ * @since   Log 1.1
+ * @package Log
+ *
+ * @example console.php     Using the console handler.
+ */
+class Log_console extends Log
+{
+    /**
+     * Handle to the current output stream.
+     * @var resource
+     * @access private
+     */
+    var $_stream = STDOUT;
+
+    /**
+     * Should the output be buffered or displayed immediately?
+     * @var string
+     * @access private
+     */
+    var $_buffering = false;
+
+    /**
+     * String holding the buffered output.
+     * @var string
+     * @access private
+     */
+    var $_buffer = '';
+
+    /**
+     * String containing the format of a log line.
+     * @var string
+     * @access private
+     */
+    var $_lineFormat = '%1$s %2$s [%3$s] %4$s';
+
+    /**
+     * String containing the timestamp format.  It will be passed directly to
+     * strftime().  Note that the timestamp string will generated using the
+     * current locale.
+     * @var string
+     * @access private
+     */
+    var $_timeFormat = '%b %d %H:%M:%S';
+
+    /**
+     * Constructs a new Log_console object.
+     * 
+     * @param string $name     Ignored.
+     * @param string $ident    The identity string.
+     * @param array  $conf     The configuration array.
+     * @param int    $level    Log messages up to and including this level.
+     * @access public
+     */
+    function Log_console($name, $ident = '', $conf = array(),
+                         $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+
+        if (!empty($conf['stream'])) {
+            $this->_stream = $conf['stream'];
+        }
+
+        if (isset($conf['buffering'])) {
+            $this->_buffering = $conf['buffering'];
+        }
+
+        if (!empty($conf['lineFormat'])) {
+            $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+                                             array_values($this->_formatMap),
+                                             $conf['lineFormat']);
+        }
+
+        if (!empty($conf['timeFormat'])) {
+            $this->_timeFormat = $conf['timeFormat'];
+        }
+
+        /*
+         * If output buffering has been requested, we need to register a
+         * shutdown function that will dump the buffer upon termination.
+         */
+        if ($this->_buffering) {
+            register_shutdown_function(array(&$this, '_Log_console'));
+        }
+    }
+
+    /**
+     * Destructor
+     */
+    function _Log_console()
+    {
+        $this->close();
+    }
+
+    /**
+     * Closes the output stream.
+     *
+     * This results in a call to flush().
+     *
+     * @access public
+     * @since Log 1.9.0
+     */
+    function close()
+    {
+        $this->flush();
+    }
+
+    /**
+     * Flushes all pending ("buffered") data to the output stream.
+     *
+     * @access public
+     * @since Log 1.8.2
+     */
+    function flush()
+    {
+        /*
+         * If output buffering is enabled, dump the contents of the buffer to
+         * the output stream.
+         */
+        if ($this->_buffering && (strlen($this->_buffer) > 0)) {
+            fwrite($this->_stream, $this->_buffer);
+            $this->_buffer = '';
+        }
+ 
+        return fflush($this->_stream);
+    }
+
+    /**
+     * Writes $message to the text console. Also, passes the message
+     * along to any Log_observer instances that are observing this Log.
+     * 
+     * @param mixed  $message    String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        /* Build the string containing the complete log line. */
+        $line = $this->_format($this->_lineFormat,
+                               strftime($this->_timeFormat),
+                               $priority, $message) . "\n";
+
+        /*
+         * If buffering is enabled, append this line to the output buffer.
+         * Otherwise, print the line to the output stream immediately.
+         */
+        if ($this->_buffering) {
+            $this->_buffer .= $line;
+        } else {
+            fwrite($this->_stream, $line);
+        }
+
+        /* Notify observers about this log message. */
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/daemon.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/daemon.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/daemon.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,230 @@
+<?php
+// $Id: daemon.php,v 1.2 2005/02/26 14:48:58 chagenbu Exp $
+
+/**
+ * The Log_daemon class is a concrete implementation of the Log::
+ * abstract class which sends messages to syslog daemon on UNIX-like machines.
+ * This class uses the syslog protocol: http://www.ietf.org/rfc/rfc3164.txt
+ *
+ * @author  Bart van der Schans <schans at dds.nl>
+ * @version $Revision: 1.2 $
+ * @package Log
+ */
+class Log_daemon extends Log
+{
+    /**
+     * Integer holding the log facility to use.
+     * @var string
+     */
+    var $_name = LOG_DAEMON;
+
+    /**
+     * Var holding the resource pointer to the socket
+     * @var resource
+     */
+    var $_socket;
+
+    /**
+     * The ip address or servername
+     * @see http://www.php.net/manual/en/transports.php
+     * @var string
+     */
+    var $_ip = '127.0.0.1';
+
+    /**
+     * Protocol to use (tcp, udp, etc.)
+     * @see http://www.php.net/manual/en/transports.php
+     * @var string
+     */
+    var $_proto = 'udp';
+
+    /**
+     * Port to connect to
+     * @var int
+     */
+    var $_port = 514;
+
+    /**
+     * Maximum message length in bytes
+     * @var int
+     */
+    var $_maxsize = 4096;
+
+    /**
+     * Socket timeout in seconds
+     * @var int
+     */
+    var $_timeout = 1;
+
+
+    /**
+     * Constructs a new syslog object.
+     *
+     * @param string $name     The syslog facility.
+     * @param string $ident    The identity string.
+     * @param array  $conf     The configuration array.
+     * @param int    $maxLevel Maximum level at which to log.
+     * @access public
+     */
+    function Log_daemon($name, $ident = '', $conf = array(),
+                        $level = PEAR_LOG_DEBUG)
+    {
+        /* Ensure we have a valid integer value for $name. */
+        if (empty($name) || !is_int($name)) {
+            $name = LOG_SYSLOG;
+        }
+
+        $this->_id = md5(microtime());
+        $this->_name = $name;
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+
+        if (isset($conf['ip'])) {
+            $this->_ip = $conf['ip'];
+        }
+        if (isset($conf['proto'])) {
+            $this->_proto = $conf['proto'];
+        }
+        if (isset($conf['port'])) {
+            $this->_port = $conf['port'];
+        }
+        if (isset($conf['maxsize'])) {
+            $this->_maxsize = $conf['maxsize'];
+        }
+        if (isset($conf['timeout'])) {
+            $this->_timeout = $conf['timeout'];
+        }
+        $this->_proto = $this->_proto . '://';
+
+        register_shutdown_function(array(&$this, '_Log_daemon'));
+    }
+
+    /**
+     * Destructor.
+     *
+     * @access private
+     */
+    function _Log_daemon()
+    {
+        $this->close();
+    }
+
+    /**
+     * Opens a connection to the system logger, if it has not already
+     * been opened.  This is implicitly called by log(), if necessary.
+     * @access public
+     */
+    function open()
+    {
+        if (!$this->_opened) {
+            $this->_opened = (bool)($this->_socket = @fsockopen(
+                                                $this->_proto . $this->_ip,
+                                                $this->_port,
+                                                $errno,
+                                                $errstr,
+                                                $this->_timeout));
+        }
+        return $this->_opened;
+    }
+
+    /**
+     * Closes the connection to the system logger, if it is open.
+     * @access public
+     */
+    function close()
+    {
+        if ($this->_opened) {
+            $this->_opened = false;
+            return fclose($this->_socket);
+        }
+        return true;
+    }
+
+    /**
+     * Sends $message to the currently open syslog connection.  Calls
+     * open() if necessary. Also passes the message along to any Log_observer
+     * instances that are observing this Log.
+     *
+     * @param string $message  The textual message to be logged.
+     * @param int $priority (optional) The priority of the message.  Valid
+     *                  values are: LOG_EMERG, LOG_ALERT, LOG_CRIT,
+     *                  LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO,
+     *                  and LOG_DEBUG.  The default is LOG_INFO.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* If the connection isn't open and can't be opened, return failure. */
+        if (!$this->_opened && !$this->open()) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        /* Set the facility level. */
+        $facility_level = intval($this->_name) +
+                          intval($this->_toSyslog($priority));
+
+        /* Prepend ident info. */
+        if (!empty($this->_ident)) {
+            $message = $this->_ident . ' ' . $message;
+        }
+
+        /* Check for message length. */
+        if (strlen($message) > $this->_maxsize) {
+            $message = substr($message, 0, ($this->_maxsize) - 10) . ' [...]';
+        }
+
+        /* Write to socket. */
+        fwrite($this->_socket, '<' . $facility_level . '>' . $message . "\n");
+
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+    }
+
+    /**
+     * Converts a PEAR_LOG_* constant into a syslog LOG_* constant.
+     *
+     * This function exists because, under Windows, not all of the LOG_*
+     * constants have unique values.  Instead, the PEAR_LOG_* were introduced
+     * for global use, with the conversion to the LOG_* constants kept local to
+     * to the syslog driver.
+     *
+     * @param int $priority     PEAR_LOG_* value to convert to LOG_* value.
+     *
+     * @return  The LOG_* representation of $priority.
+     *
+     * @access private
+     */
+    function _toSyslog($priority)
+    {
+        static $priorities = array(
+            PEAR_LOG_EMERG   => LOG_EMERG,
+            PEAR_LOG_ALERT   => LOG_ALERT,
+            PEAR_LOG_CRIT    => LOG_CRIT,
+            PEAR_LOG_ERR     => LOG_ERR,
+            PEAR_LOG_WARNING => LOG_WARNING,
+            PEAR_LOG_NOTICE  => LOG_NOTICE,
+            PEAR_LOG_INFO    => LOG_INFO,
+            PEAR_LOG_DEBUG   => LOG_DEBUG
+        );
+
+        /* If we're passed an unknown priority, default to LOG_INFO. */
+        if (!is_int($priority) || !in_array($priority, $priorities)) {
+            return LOG_INFO;
+        }
+
+        return $priorities[$priority];
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/display.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/display.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/display.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/display.php,v 1.8 2005/08/06 23:28:35 jon Exp $
+ *
+ * @version $Revision: 1.8 $
+ * @package Log
+ */
+
+/**
+ * The Log_display class is a concrete implementation of the Log::
+ * abstract class which writes message into browser in usual PHP maner.
+ * This may be useful because when you use PEAR::setErrorHandling in
+ * PEAR_ERROR_CALLBACK mode error messages are not displayed by
+ * PHP error handler.
+ *
+ * @author  Paul Yanchenko <pusher at inaco.ru>
+ * @since   Log 1.8.0
+ * @package Log
+ *
+ * @example display.php     Using the display handler.
+ */
+class Log_display extends Log
+{
+    /**
+     * String to output before an error message
+     * @var string
+     * @access private
+     */
+    var $_error_prepend = '';
+
+    /**
+     * String to output after an error message
+     * @var string
+     * @access private
+     */
+    var $_error_append = '';
+
+    /**
+     * String used to represent a line break.
+     * @var string
+     * @access private
+     */
+    var $_linebreak = "<br />\n";
+
+    /**
+     * Constructs a new Log_display object.
+     *
+     * @param string $name     Ignored.
+     * @param string $ident    The identity string.
+     * @param array  $conf     The configuration array.
+     * @param int    $level    Log messages up to and including this level.
+     * @access public
+     */
+    function Log_display($name = '', $ident = '', $conf = array(),
+                         $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+
+        if (isset($conf['error_prepend'])) {
+            $this->_error_prepend = $conf['error_prepend'];
+        } else {
+            $this->_error_prepend = ini_get('error_prepend_string');
+        }
+
+        if (isset($conf['error_append'])) {
+            $this->_error_append = $conf['error_append'];
+        } else {
+            $this->_error_append = ini_get('error_append_string');
+        }
+
+        if (isset($conf['linebreak'])) {
+            $this->_linebreak = $conf['linebreak'];
+        }
+    }
+
+    /**
+     * Writes $message to the text browser. Also, passes the message
+     * along to any Log_observer instances that are observing this Log.
+     *
+     * @param mixed  $message    String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        /* Build and output the complete log line. */
+        echo $this->_error_prepend .
+             '<b>' . ucfirst($this->priorityToString($priority)) . '</b>: '.
+             nl2br(htmlspecialchars($message)) .
+             $this->_error_append . $this->_linebreak;
+
+        /* Notify observers about this log message. */
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/error_log.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/error_log.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/error_log.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,103 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/error_log.php,v 1.7 2005/02/26 14:48:58 chagenbu Exp $
+ *
+ * @version $Revision: 1.7 $
+ * @package Log
+ */
+
+/**
+ * The Log_error_log class is a concrete implementation of the Log abstract
+ * class that logs messages using PHP's error_log() function.
+ *
+ * @author  Jon Parise <jon at php.net>
+ * @since   Log 1.7.0
+ * @package Log
+ *
+ * @example error_log.php   Using the error_log handler.
+ */
+class Log_error_log extends Log
+{
+    /**
+     * The error_log() log type.
+     * @var integer
+     * @access private
+     */
+    var $_type = PEAR_LOG_TYPE_SYSTEM;
+
+    /**
+     * The type-specific destination value.
+     * @var string
+     * @access private
+     */
+    var $_destination = '';
+
+    /**
+     * Additional headers to pass to the mail() function when the
+     * PEAR_LOG_TYPE_MAIL type is used.
+     * @var string
+     * @access private
+     */
+    var $_extra_headers = '';
+
+    /**
+     * Constructs a new Log_error_log object.
+     *
+     * @param string $name     Ignored.
+     * @param string $ident    The identity string.
+     * @param array  $conf     The configuration array.
+     * @param int    $level    Log messages up to and including this level.
+     * @access public
+     */
+    function Log_error_log($name, $ident = '', $conf = array(),
+                           $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_type = $name;
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+
+        if (!empty($conf['destination'])) {
+            $this->_destination = $conf['destination'];
+        }
+        if (!empty($conf['extra_headers'])) {
+            $this->_extra_headers = $conf['extra_headers'];
+        }
+    }
+
+    /**
+     * Logs $message using PHP's error_log() function.  The message is also
+     * passed along to any Log_observer instances that are observing this Log.
+     *
+     * @param mixed  $message   String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        $success = error_log($this->_ident . ': ' . $message, $this->_type,
+                             $this->_destination, $this->_extra_headers);
+
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return $success;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/file.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/file.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/file.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,312 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/file.php,v 1.45 2006/01/11 07:56:37 jon Exp $
+ *
+ * @version $Revision: 1.45 $
+ * @package Log
+ */
+
+/**
+ * The Log_file class is a concrete implementation of the Log abstract
+ * class that logs messages to a text file.
+ * 
+ * @author  Jon Parise <jon at php.net>
+ * @author  Roman Neuhauser <neuhauser at bellavista.cz>
+ * @since   Log 1.0
+ * @package Log
+ *
+ * @example file.php    Using the file handler.
+ */
+class Log_file extends Log
+{
+    /**
+     * String containing the name of the log file.
+     * @var string
+     * @access private
+     */
+    var $_filename = 'php.log';
+
+    /**
+     * Handle to the log file.
+     * @var resource
+     * @access private
+     */
+    var $_fp = false;
+
+    /**
+     * Should new log entries be append to an existing log file, or should the
+     * a new log file overwrite an existing one?
+     * @var boolean
+     * @access private
+     */
+    var $_append = true;
+
+    /**
+     * Should advisory file locking (i.e., flock()) be used?
+     * @var boolean
+     * @access private
+     */
+    var $_locking = false;
+
+    /**
+     * Integer (in octal) containing the log file's permissions mode.
+     * @var integer
+     * @access private
+     */
+    var $_mode = 0644;
+
+    /**
+     * Integer (in octal) specifying the file permission mode that will be
+     * used when creating directories that do not already exist.
+     * @var integer
+     * @access private
+     */
+    var $_dirmode = 0755;
+
+    /**
+     * String containing the format of a log line.
+     * @var string
+     * @access private
+     */
+    var $_lineFormat = '%1$s %2$s [%3$s] %4$s';
+
+    /**
+     * String containing the timestamp format.  It will be passed directly to
+     * strftime().  Note that the timestamp string will generated using the
+     * current locale.
+     * @var string
+     * @access private
+     */
+    var $_timeFormat = '%b %d %H:%M:%S';
+
+    /**
+     * String containing the end-on-line character sequence.
+     * @var string
+     * @access private
+     */
+    var $_eol = "\n";
+
+    /**
+     * Constructs a new Log_file object.
+     *
+     * @param string $name     Ignored.
+     * @param string $ident    The identity string.
+     * @param array  $conf     The configuration array.
+     * @param int    $level    Log messages up to and including this level.
+     * @access public
+     */
+    function Log_file($name, $ident = '', $conf = array(),
+                      $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_filename = $name;
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+
+        if (isset($conf['append'])) {
+            $this->_append = $conf['append'];
+        }
+
+        if (isset($conf['locking'])) {
+            $this->_locking = $conf['locking'];
+        }
+
+        if (!empty($conf['mode'])) {
+            if (is_string($conf['mode'])) {
+                $this->_mode = octdec($conf['mode']);
+            } else {
+                $this->_mode = $conf['mode'];
+            }
+        }
+
+        if (!empty($conf['dirmode'])) {
+            if (is_string($conf['dirmode'])) {
+                $this->_dirmode = octdec($conf['dirmode']);
+            } else {
+                $this->_dirmode = $conf['dirmode'];
+            }
+        }
+
+        if (!empty($conf['lineFormat'])) {
+            $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+                                             array_values($this->_formatMap),
+                                             $conf['lineFormat']);
+        }
+
+        if (!empty($conf['timeFormat'])) {
+            $this->_timeFormat = $conf['timeFormat'];
+        }
+
+        if (!empty($conf['eol'])) {
+            $this->_eol = $conf['eol'];
+        } else {
+            $this->_eol = (strstr(PHP_OS, 'WIN')) ? "\r\n" : "\n";
+        }
+
+        register_shutdown_function(array(&$this, '_Log_file'));
+    }
+
+    /**
+     * Destructor
+     */
+    function _Log_file()
+    {
+        if ($this->_opened) {
+            $this->close();
+        }
+    }
+
+    /**
+     * Creates the given directory path.  If the parent directories don't
+     * already exist, they will be created, too.
+     *
+     * This implementation is inspired by Python's os.makedirs function.
+     *
+     * @param   string  $path       The full directory path to create.
+     * @param   integer $mode       The permissions mode with which the
+     *                              directories will be created.
+     *
+     * @return  True if the full path is successfully created or already
+     *          exists.
+     *
+     * @access  private
+     */
+    function _mkpath($path, $mode = 0700)
+    {
+        /* Separate the last pathname component from the rest of the path. */
+        $head = dirname($path);
+        $tail = basename($path);
+
+        /* Make sure we've split the path into two complete components. */
+        if (empty($tail)) {
+            $head = dirname($path);
+            $tail = basename($path);
+        }
+
+        /* Recurse up the path if our current segment does not exist. */
+        if (!empty($head) && !empty($tail) && !is_dir($head)) {
+            $this->_mkpath($head, $mode);
+        }
+
+        /* Create this segment of the path. */
+        return @mkdir($head, $mode);
+    }
+
+    /**
+     * Opens the log file for output.  If the specified log file does not
+     * already exist, it will be created.  By default, new log entries are
+     * appended to the end of the log file.
+     *
+     * This is implicitly called by log(), if necessary.
+     *
+     * @access public
+     */
+    function open()
+    {
+        if (!$this->_opened) {
+            /* If the log file's directory doesn't exist, create it. */
+            if (!is_dir(dirname($this->_filename))) {
+                $this->_mkpath($this->_filename, $this->_dirmode);
+            }
+
+            /* Determine whether the log file needs to be created. */
+            $creating = !file_exists($this->_filename);
+
+            /* Obtain a handle to the log file. */
+            $this->_fp = fopen($this->_filename, ($this->_append) ? 'a' : 'w');
+
+            /* We consider the file "opened" if we have a valid file pointer. */
+            $this->_opened = ($this->_fp !== false);
+
+            /* Attempt to set the file's permissions if we just created it. */
+            if ($creating && $this->_opened) {
+                chmod($this->_filename, $this->_mode);
+            }
+        }
+
+        return $this->_opened;
+    }
+
+    /**
+     * Closes the log file if it is open.
+     *
+     * @access public
+     */
+    function close()
+    {
+        /* If the log file is open, close it. */
+        if ($this->_opened && fclose($this->_fp)) {
+            $this->_opened = false;
+        }
+
+        return ($this->_opened === false);
+    }
+
+    /**
+     * Flushes all pending data to the file handle.
+     *
+     * @access public
+     * @since Log 1.8.2
+     */
+    function flush()
+    {
+        return fflush($this->_fp);
+    }
+
+    /**
+     * Logs $message to the output window.  The message is also passed along
+     * to any Log_observer instances that are observing this Log.
+     *
+     * @param mixed  $message  String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* If the log file isn't already open, open it now. */
+        if (!$this->_opened && !$this->open()) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        /* Build the string containing the complete log line. */
+        $line = $this->_format($this->_lineFormat,
+                               strftime($this->_timeFormat),
+                               $priority, $message) . $this->_eol;
+
+        /* If locking is enabled, acquire an exclusive lock on the file. */
+        if ($this->_locking) {
+            flock($this->_fp, LOCK_EX);
+        }
+
+        /* Write the log line to the log file. */
+        $success = (fwrite($this->_fp, $line) !== false);
+
+        /* Unlock the file now that we're finished writing to it. */ 
+        if ($this->_locking) {
+            flock($this->_fp, LOCK_UN);
+        }
+
+        /* Notify observers about this log message. */
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return $success;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/mail.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/mail.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/mail.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,246 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/mail.php,v 1.24 2006/01/30 05:37:18 jon Exp $
+ *
+ * @version $Revision: 1.24 $
+ * @package Log
+ */
+
+/**
+ * The Log_mail class is a concrete implementation of the Log:: abstract class
+ * which sends log messages to a mailbox.
+ * The mail is actually sent when you close() the logger, or when the destructor
+ * is called (when the script is terminated).
+ *
+ * PLEASE NOTE that you must create a Log_mail object using =&, like this :
+ *  $logger =& Log::factory("mail", "recipient at example.com", ...)
+ *
+ * This is a PEAR requirement for destructors to work properly.
+ * See http://pear.php.net/manual/en/class.pear.php
+ *
+ * @author  Ronnie Garcia <ronnie at mk2.net>
+ * @author  Jon Parise <jon at php.net>
+ * @since   Log 1.3
+ * @package Log
+ *
+ * @example mail.php    Using the mail handler.
+ */
+class Log_mail extends Log
+{
+    /**
+     * String holding the recipient's email address.
+     * @var string
+     * @access private
+     */
+    var $_recipient = '';
+
+    /**
+     * String holding the sender's email address.
+     * @var string
+     * @access private
+     */
+    var $_from = '';
+
+    /**
+     * String holding the email's subject.
+     * @var string
+     * @access private
+     */
+    var $_subject = '[Log_mail] Log message';
+
+    /**
+     * String holding an optional preamble for the log messages.
+     * @var string
+     * @access private
+     */
+    var $_preamble = '';
+
+    /**
+     * String containing the format of a log line.
+     * @var string
+     * @access private
+     */
+    var $_lineFormat = '%1$s %2$s [%3$s] %4$s';
+
+    /**
+     * String containing the timestamp format.  It will be passed directly to
+     * strftime().  Note that the timestamp string will generated using the
+     * current locale.
+     * @var string
+     * @access private
+     */
+    var $_timeFormat = '%b %d %H:%M:%S';
+
+    /**
+     * String holding the mail message body.
+     * @var string
+     * @access private
+     */
+    var $_message = '';
+
+
+    /**
+     * Constructs a new Log_mail object.
+     *
+     * Here is how you can customize the mail driver with the conf[] hash :
+     *   $conf['from']    : the mail's "From" header line,
+     *   $conf['subject'] : the mail's "Subject" line.
+     *
+     * @param string $name      The filename of the logfile.
+     * @param string $ident     The identity string.
+     * @param array  $conf      The configuration array.
+     * @param int    $level     Log messages up to and including this level.
+     * @access public
+     */
+    function Log_mail($name, $ident = '', $conf = array(),
+                      $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_recipient = $name;
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+
+        if (!empty($conf['from'])) {
+            $this->_from = $conf['from'];
+        } else {
+            $this->_from = ini_get('sendmail_from');
+        }
+
+        if (!empty($conf['subject'])) {
+            $this->_subject = $conf['subject'];
+        }
+
+        if (!empty($conf['preamble'])) {
+            $this->_preamble = $conf['preamble'];
+        }
+
+        if (!empty($conf['lineFormat'])) {
+            $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+                                             array_values($this->_formatMap),
+                                             $conf['lineFormat']);
+        }
+
+        if (!empty($conf['timeFormat'])) {
+            $this->_timeFormat = $conf['timeFormat'];
+        }
+
+        /* register the destructor */
+        register_shutdown_function(array(&$this, '_Log_mail'));
+    }
+
+    /**
+     * Destructor. Calls close().
+     *
+     * @access private
+     */
+    function _Log_mail()
+    {
+        $this->close();
+    }
+
+    /**
+     * Starts a new mail message.
+     * This is implicitly called by log(), if necessary.
+     *
+     * @access public
+     */
+    function open()
+    {
+        if (!$this->_opened) {
+            if (!empty($this->_preamble)) {
+                $this->_message = $this->_preamble . "\r\n\r\n";
+            }
+            $this->_opened = true;
+        }
+
+        return $this->_opened;
+    }
+
+    /**
+     * Closes the message, if it is open, and sends the mail.
+     * This is implicitly called by the destructor, if necessary.
+     *
+     * @access public
+     */
+    function close()
+    {
+        if ($this->_opened) {
+            if (!empty($this->_message)) {
+                $headers = "From: $this->_from\r\n";
+                $headers .= "User-Agent: Log_mail";
+
+                if (mail($this->_recipient, $this->_subject, $this->_message,
+                         $headers) == false) {
+                    error_log("Log_mail: Failure executing mail()", 0);
+                    return false;
+                }
+
+                /* Clear the message string now that the email has been sent. */
+                $this->_message = '';
+            }
+            $this->_opened = false;
+        }
+
+        return ($this->_opened === false);
+    }
+
+    /**
+     * Flushes the log output by forcing the email message to be sent now.
+     * Events that are logged after flush() is called will be appended to a
+     * new email message.
+     *
+     * @access public
+     * @since Log 1.8.2
+     */
+    function flush()
+    {
+        /*
+         * It's sufficient to simply call close() to flush the output.
+         * The next call to log() will cause the handler to be reopened.
+         */
+        return $this->close();
+    }
+
+    /**
+     * Writes $message to the currently open mail message.
+     * Calls open(), if necessary.
+     *
+     * @param mixed  $message  String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* If the message isn't open and can't be opened, return failure. */
+        if (!$this->_opened && !$this->open()) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        /* Build the string containing the complete log line. */
+        $this->_message .= $this->_format($this->_lineFormat,
+                                          strftime($this->_timeFormat),
+                                          $priority, $message) . "\r\n";
+
+        /* Notify observers about this log message. */
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Log/mcal.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/mcal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/mcal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,170 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/mcal.php,v 1.18 2005/02/26 14:48:58 chagenbu Exp $
+ * $Horde: horde/lib/Log/mcal.php,v 1.2 2000/06/28 21:36:13 jon Exp $
+ *
+ * @version $Revision: 1.18 $
+ * @package Log
+ */
+
+/**
+ * The Log_mcal class is a concrete implementation of the Log::
+ * abstract class which sends messages to a local or remote calendar
+ * store accessed through MCAL.
+ *
+ * @author  Chuck Hagenbuch <chuck at horde.org>
+ * @since Horde 1.3
+ * @since Log 1.0
+ * @package Log
+ */
+class Log_mcal extends Log
+{
+    /**
+     * holding the calendar specification to connect to.
+     * @var string
+     * @access private
+     */
+    var $_calendar = '{localhost/mstore}';
+
+    /**
+     * holding the username to use.
+     * @var string
+     * @access private
+     */
+    var $_username = '';
+
+    /**
+     * holding the password to use.
+     * @var string
+     * @access private
+     */
+    var $_password = '';
+
+    /**
+     * holding the options to pass to the calendar stream.
+     * @var integer
+     * @access private
+     */
+    var $_options = 0;
+
+    /**
+     * ResourceID of the MCAL stream.
+     * @var string
+     * @access private
+     */
+    var $_stream = '';
+
+    /**
+     * Integer holding the log facility to use.
+     * @var string
+     * @access private
+     */
+    var $_name = LOG_SYSLOG;
+
+
+    /**
+     * Constructs a new Log_mcal object.
+     *
+     * @param string $name     The category to use for our events.
+     * @param string $ident    The identity string.
+     * @param array  $conf     The configuration array.
+     * @param int    $level    Log messages up to and including this level.
+     * @access public
+     */
+    function Log_mcal($name, $ident = '', $conf = array(),
+                      $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_name = $name;
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+        $this->_calendar = $conf['calendar'];
+        $this->_username = $conf['username'];
+        $this->_password = $conf['password'];
+        $this->_options = $conf['options'];
+    }
+
+    /**
+     * Opens a calendar stream, if it has not already been
+     * opened. This is implicitly called by log(), if necessary.
+     * @access public
+     */
+    function open()
+    {
+        if (!$this->_opened) {
+            $this->_stream = mcal_open($this->_calendar, $this->_username,
+                $this->_password, $this->_options);
+            $this->_opened = true;
+        }
+
+        return $this->_opened;
+    }
+
+    /**
+     * Closes the calendar stream, if it is open.
+     * @access public
+     */
+    function close()
+    {
+        if ($this->_opened) {
+            mcal_close($this->_stream);
+            $this->_opened = false;
+        }
+
+        return ($this->_opened === false);
+    }
+
+    /**
+     * Logs $message and associated information to the currently open
+     * calendar stream. Calls open() if necessary. Also passes the
+     * message along to any Log_observer instances that are observing
+     * this Log.
+     *
+     * @param mixed  $message  String or object containing the message to log.
+     * @param string $priority The priority of the message. Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* If the connection isn't open and can't be opened, return failure. */
+        if (!$this->_opened && !$this->open()) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        $date_str = date('Y:n:j:G:i:s');
+        $dates = explode(':', $date_str);
+
+        mcal_event_init($this->_stream);
+        mcal_event_set_title($this->_stream, $this->_ident);
+        mcal_event_set_category($this->_stream, $this->_name);
+        mcal_event_set_description($this->_stream, $message);
+        mcal_event_add_attribute($this->_stream, 'priority', $priority);
+        mcal_event_set_start($this->_stream, $dates[0], $dates[1], $dates[2],
+            $dates[3], $dates[4], $dates[5]);
+        mcal_event_set_end($this->_stream, $dates[0], $dates[1], $dates[2],
+            $dates[3], $dates[4], $dates[5]);
+        mcal_append_event($this->_stream);
+
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/mdb2.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/mdb2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/mdb2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,358 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/mdb2.php,v 1.5 2006/01/08 03:35:44 jon Exp $
+ *
+ * @version $Revision: 1.5 $
+ * @package Log
+ */
+
+/** PEAR's MDB2 package */
+require_once 'MDB2.php';
+MDB2::loadFile('Date');
+
+/**
+ * The Log_mdb2 class is a concrete implementation of the Log:: abstract class
+ * which sends messages to an SQL server.  Each entry occupies a separate row
+ * in the database.
+ *
+ * This implementation uses PEAR's MDB2 database abstraction layer.
+ *
+ * CREATE TABLE log_table (
+ *  id          INT NOT NULL,
+ *  logtime     TIMESTAMP NOT NULL,
+ *  ident       CHAR(16) NOT NULL,
+ *  priority    INT NOT NULL,
+ *  message     VARCHAR(200),
+ *  PRIMARY KEY (id)
+ * );
+ *
+ * @author  Lukas Smith <smith at backendmedia.com>
+ * @author  Jon Parise <jon at php.net>
+ * @since   Log 1.9.0
+ * @package Log
+ */
+class Log_mdb2 extends Log
+{
+    /**
+     * Variable containing the DSN information.
+     * @var mixed
+     * @access private
+     */
+    var $_dsn = '';
+
+    /**
+     * Array containing our set of DB configuration options.
+     * @var array
+     * @access private
+     */
+    var $_options = array('persistent' => true);
+
+    /**
+     * Object holding the database handle.
+     * @var object
+     * @access private
+     */
+    var $_db = null;
+
+    /**
+     * Resource holding the prepared statement handle.
+     * @var resource
+     * @access private
+     */
+    var $_statement = null;
+
+    /**
+     * Flag indicating that we're using an existing database connection.
+     * @var boolean
+     * @access private
+     */
+    var $_existingConnection = false;
+
+    /**
+     * String holding the database table to use.
+     * @var string
+     * @access private
+     */
+    var $_table = 'log_table';
+
+    /**
+     * String holding the name of the ID sequence.
+     * @var string
+     * @access private
+     */
+    var $_sequence = 'log_id';
+
+    /**
+     * Maximum length of the $ident string.  This corresponds to the size of
+     * the 'ident' column in the SQL table.
+     * @var integer
+     * @access private
+     */
+    var $_identLimit = 16;
+
+    /**
+     * Set of field types used in the database table.
+     * @var array
+     * @access private
+     */
+    var $_types = array(
+        'id'        => 'integer',
+        'logtime'   => 'timestamp',
+        'ident'     => 'text',
+        'priority'  => 'text',
+        'message'   => 'clob'
+    );
+
+    /**
+     * Constructs a new sql logging object.
+     *
+     * @param string $name         The target SQL table.
+     * @param string $ident        The identification field.
+     * @param array $conf          The connection configuration array.
+     * @param int $level           Log messages up to and including this level.
+     * @access public
+     */
+    function Log_mdb2($name, $ident = '', $conf = array(),
+                     $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_table = $name;
+        $this->_mask = Log::UPTO($level);
+
+        /* If an options array was provided, use it. */
+        if (isset($conf['options']) && is_array($conf['options'])) {
+            $this->_options = $conf['options'];
+        }
+
+        /* If a specific sequence name was provided, use it. */
+        if (!empty($conf['sequence'])) {
+            $this->_sequence = $conf['sequence'];
+        }
+
+        /* If a specific sequence name was provided, use it. */
+        if (isset($conf['identLimit'])) {
+            $this->_identLimit = $conf['identLimit'];
+        }
+
+        /* Now that the ident limit is confirmed, set the ident string. */
+        $this->setIdent($ident);
+
+        /* If an existing database connection was provided, use it. */
+        if (isset($conf['db'])) {
+            $this->_db = &$conf['db'];
+            $this->_existingConnection = true;
+            $this->_opened = true;
+        } elseif (isset($conf['singleton'])) {
+            $this->_db = &MDB2::singleton($conf['singleton'], $this->_options);
+            $this->_existingConnection = true;
+            $this->_opened = true;
+        } else {
+            $this->_dsn = $conf['dsn'];
+        }
+    }
+
+    /**
+     * Opens a connection to the database, if it has not already
+     * been opened. This is implicitly called by log(), if necessary.
+     *
+     * @return boolean   True on success, false on failure.
+     * @access public
+     */
+    function open()
+    {
+        if (!$this->_opened) {
+            /* Use the DSN and options to create a database connection. */
+            $this->_db = &MDB2::connect($this->_dsn, $this->_options);
+            if (PEAR::isError($this->_db)) {
+                return false;
+            }
+
+            /* Create a prepared statement for repeated use in log(). */
+            if (!$this->_prepareStatement()) {
+                return false;
+            }
+
+            /* We now consider out connection open. */
+            $this->_opened = true;
+        }
+
+        return $this->_opened;
+    }
+
+    /**
+     * Closes the connection to the database if it is still open and we were
+     * the ones that opened it.  It is the caller's responsible to close an
+     * existing connection that was passed to us via $conf['db'].
+     *
+     * @return boolean   True on success, false on failure.
+     * @access public
+     */
+    function close()
+    {
+        /* If we have a statement object, free it. */
+        if (is_object($this->_statement)) {
+            $this->_statement->free();
+            $this->_statement = null;
+        }
+
+        /* If we opened the database connection, disconnect it. */
+        if ($this->_opened && !$this->_existingConnection) {
+            $this->_opened = false;
+            return $this->_db->disconnect();
+        }
+
+        return ($this->_opened === false);
+    }
+
+    /**
+     * Sets this Log instance's identification string.  Note that this
+     * SQL-specific implementation will limit the length of the $ident string
+     * to sixteen (16) characters.
+     *
+     * @param string    $ident      The new identification string.
+     *
+     * @access  public
+     * @since   Log 1.8.5
+     */
+    function setIdent($ident)
+    {
+        $this->_ident = substr($ident, 0, $this->_identLimit);
+    }
+
+    /**
+     * Inserts $message to the currently open database.  Calls open(),
+     * if necessary.  Also passes the message along to any Log_observer
+     * instances that are observing this Log.
+     *
+     * @param mixed  $message  String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* If the connection isn't open and can't be opened, return failure. */
+        if (!$this->_opened && !$this->open()) {
+            return false;
+        }
+
+        /* If we don't already have a statement object, create one. */
+        if (!is_object($this->_statement) && !$this->_prepareStatement()) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        /* Build our set of values for this log entry. */
+        $values = array(
+            'id'       => $this->_db->nextId($this->_sequence),
+            'logtime'  => MDB2_Date::mdbNow(),
+            'ident'    => $this->_ident,
+            'priority' => $priority,
+            'message'  => $message
+        );
+
+        /* Execute the SQL query for this log entry insertion. */
+        $this->_db->expectError(MDB2_ERROR_NOSUCHTABLE);
+        $result = &$this->_statement->execute($values);
+        $this->_db->popExpect();
+
+        /* Attempt to handle any errors. */
+        if (PEAR::isError($result)) {
+            /* We can only handle MDB2_ERROR_NOSUCHTABLE errors. */
+            if ($result->getCode() != MDB2_ERROR_NOSUCHTABLE) {
+                return false;
+            }
+
+            /* Attempt to create the target table. */
+            if (!$this->_createTable()) {
+                return false;
+            }
+
+            /* Recreate our prepared statement resource. */
+            $this->_statement->free();
+            if (!$this->_prepareStatement()) {
+                return false;
+            }
+
+            /* Attempt to re-execute the insertion query. */
+            $result = $this->_statement->execute($values);
+            if (PEAR::isError($result)) {
+                return false;
+            }
+        }
+
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+    /**
+     * Create the log table in the database.
+     *
+     * @return boolean  True on success or false on failure.
+     * @access private
+     */
+    function _createTable()
+    {
+        $this->_db->loadModule('Manager', null, true);
+        $result = $this->_db->manager->createTable(
+            $this->_table,
+            array(
+                'id'        => array('type' => $this->_types['id']),
+                'logtime'   => array('type' => $this->_types['logtime']),
+                'ident'     => array('type' => $this->_types['ident']),
+                'priority'  => array('type' => $this->_types['priority']),
+                'message'   => array('type' => $this->_types['message'])
+            )
+        );
+        if (PEAR::isError($result)) {
+            return false;
+        }
+
+        $result = $this->_db->manager->createIndex(
+            $this->_table,
+            'unique_id',
+            array('fields' => array('id' => true), 'unique' => true)
+        );
+        if (PEAR::isError($result)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Prepare the SQL insertion statement.
+     *
+     * @return boolean  True if the statement was successfully created.
+     *
+     * @access  private
+     * @since   Log 1.9.0
+     */
+    function _prepareStatement()
+    {
+        $this->_statement = &$this->_db->prepare(
+                'INSERT INTO ' . $this->_table .
+                ' (id, logtime, ident, priority, message)' .
+                ' VALUES(:id, :logtime, :ident, :priority, :message)',
+                $this->_types, MDB2_PREPARE_MANIP);
+
+        /* Return success if we didn't generate an error. */
+        return (PEAR::isError($this->_statement) === false);
+    }
+}

Added: trunk/direct.openmoko.com/pear/Log/null.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/null.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/null.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/null.php,v 1.4 2005/02/26 14:48:58 chagenbu Exp $
+ *
+ * @version $Revision: 1.4 $
+ * @package Log
+ */
+
+/**
+ * The Log_null class is a concrete implementation of the Log:: abstract
+ * class.  It simply consumes log events.
+ *
+ * @author  Jon Parise <jon at php.net>
+ * @since   Log 1.8.2
+ * @package Log
+ *
+ * @example null.php    Using the null handler.
+ */
+class Log_null extends Log
+{
+    /**
+     * Constructs a new Log_null object.
+     *
+     * @param string $name     Ignored.
+     * @param string $ident    The identity string.
+     * @param array  $conf     The configuration array.
+     * @param int    $level    Log messages up to and including this level.
+     * @access public
+     */
+    function Log_null($name, $ident = '', $conf = array(),
+            $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+    }
+
+    /**
+     * Simply consumes the log event.  The message will still be passed
+     * along to any Log_observer instances that are observing this Log.
+     *
+     * @param mixed  $message    String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/observer.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/observer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/observer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,129 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/observer.php,v 1.18 2006/04/25 06:02:23 jon Exp $
+ * $Horde: horde/lib/Log/observer.php,v 1.5 2000/06/28 21:36:13 jon Exp $
+ *
+ * @version $Revision: 1.18 $
+ * @package Log
+ */
+
+/**
+ * The Log_observer:: class implements the Observer end of a Subject-Observer
+ * pattern for watching log activity and taking actions on exceptional events.
+ *
+ * @author  Chuck Hagenbuch <chuck at horde.org>
+ * @since   Horde 1.3
+ * @since   Log 1.0
+ * @package Log
+ *
+ * @example observer_mail.php   An example Log_observer implementation.
+ */
+class Log_observer
+{
+    /**
+     * Instance-specific unique identification number.
+     *
+     * @var integer
+     * @access private
+     */
+    var $_id = 0;
+
+    /**
+     * The minimum priority level of message that we want to hear about.
+     * PEAR_LOG_EMERG is the highest priority, so we will only hear messages
+     * with an integer priority value less than or equal to ours.  It defaults
+     * to PEAR_LOG_INFO, which listens to everything except PEAR_LOG_DEBUG.
+     *
+     * @var string
+     * @access private
+     */
+    var $_priority = PEAR_LOG_INFO;
+
+    /**
+     * Creates a new basic Log_observer instance.
+     *
+     * @param integer   $priority   The highest priority at which to receive
+     *                              log event notifications.
+     *
+     * @access public
+     */
+    function Log_observer($priority = PEAR_LOG_INFO)
+    {
+        $this->_id = md5(microtime());
+        $this->_priority = $priority;
+    }
+
+    /**
+     * Attempts to return a new concrete Log_observer instance of the requested
+     * type.
+     *
+     * @param string    $type       The type of concreate Log_observer subclass
+     *                              to return.
+     * @param integer   $priority   The highest priority at which to receive
+     *                              log event notifications.
+     * @param array     $conf       Optional associative array of additional
+     *                              configuration values.
+     *
+     * @return object               The newly created concrete Log_observer
+     *                              instance, or null on an error.
+     */
+    function &factory($type, $priority = PEAR_LOG_INFO, $conf = array())
+    {
+        $type = strtolower($type);
+        $class = 'Log_observer_' . $type;
+
+        /*
+         * If the desired class already exists (because the caller has supplied
+         * it from some custom location), simply instantiate and return a new
+         * instance.
+         */
+        if (class_exists($class)) {
+            $object = &new $class($priority, $conf);
+            return $object;
+        }
+
+        /* Support both the new-style and old-style file naming conventions. */
+        $newstyle = true;
+        $classfile = dirname(__FILE__) . '/observer_' . $type . '.php';
+
+        if (!file_exists($classfile)) {
+            $classfile = 'Log/' . $type . '.php';
+            $newstyle = false;
+        }
+
+        /*
+         * Attempt to include our version of the named class, but don't treat
+         * a failure as fatal.  The caller may have already included their own
+         * version of the named class.
+         */
+        @include_once $classfile;
+
+        /* If the class exists, return a new instance of it. */
+        if (class_exists($class)) {
+            /* Support both new-style and old-style construction. */
+            if ($newstyle) {
+                $object = &new $class($priority, $conf);
+            } else {
+                $object = &new $class($priority);
+            }
+            return $object;
+        }
+
+        $null = null;
+        return $null;
+    }
+
+    /**
+     * This is a stub method to make sure that Log_Observer classes do
+     * something when they are notified of a message.  The default behavior
+     * is to just print the message, which is obviously not desireable in
+     * practically any situation - which is why you need to override this
+     * method. :)
+     *
+     * @param array     $event      A hash describing the log event.
+     */
+    function notify($event)
+    {
+        print_r($event);
+    }
+}

Added: trunk/direct.openmoko.com/pear/Log/sql.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/sql.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/sql.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,294 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/sql.php,v 1.40 2006/01/03 04:12:45 jon Exp $
+ * $Horde: horde/lib/Log/sql.php,v 1.12 2000/08/16 20:27:34 chuck Exp $
+ *
+ * @version $Revision: 1.40 $
+ * @package Log
+ */
+
+/*
+ * We require the PEAR DB class.  This is generally defined in the DB.php file,
+ * but it's possible that the caller may have provided the DB class, or a
+ * compatible wrapper (such as the one shipped with MDB2), so we first check
+ * for an existing 'DB' class before including 'DB.php'.
+ */
+if (!class_exists('DB')) {
+    require_once 'DB.php';
+}
+
+/**
+ * The Log_sql class is a concrete implementation of the Log::
+ * abstract class which sends messages to an SQL server.  Each entry
+ * occupies a separate row in the database.
+ *
+ * This implementation uses PHP's PEAR database abstraction layer.
+ *
+ * CREATE TABLE log_table (
+ *  id          INT NOT NULL,
+ *  logtime     TIMESTAMP NOT NULL,
+ *  ident       CHAR(16) NOT NULL,
+ *  priority    INT NOT NULL,
+ *  message     VARCHAR(200),
+ *  PRIMARY KEY (id)
+ * );
+ *
+ * @author  Jon Parise <jon at php.net>
+ * @since   Horde 1.3
+ * @since   Log 1.0
+ * @package Log
+ *
+ * @example sql.php     Using the SQL handler.
+ */
+class Log_sql extends Log
+{
+    /**
+     * Variable containing the DSN information.
+     * @var mixed
+     * @access private
+     */
+    var $_dsn = '';
+
+    /**
+     * String containing the SQL insertion statement.
+     *
+     * @var string
+     * @access private
+     */
+    var $_sql = '';
+
+    /**
+     * Array containing our set of DB configuration options.
+     * @var array
+     * @access private
+     */
+    var $_options = array('persistent' => true);
+
+    /**
+     * Object holding the database handle.
+     * @var object
+     * @access private
+     */
+    var $_db = null;
+
+    /**
+     * Resource holding the prepared statement handle.
+     * @var resource
+     * @access private
+     */
+    var $_statement = null;
+
+    /**
+     * Flag indicating that we're using an existing database connection.
+     * @var boolean
+     * @access private
+     */
+    var $_existingConnection = false;
+
+    /**
+     * String holding the database table to use.
+     * @var string
+     * @access private
+     */
+    var $_table = 'log_table';
+
+    /**
+     * String holding the name of the ID sequence.
+     * @var string
+     * @access private
+     */
+    var $_sequence = 'log_id';
+
+    /**
+     * Maximum length of the $ident string.  This corresponds to the size of
+     * the 'ident' column in the SQL table.
+     * @var integer
+     * @access private
+     */
+    var $_identLimit = 16;
+
+
+    /**
+     * Constructs a new sql logging object.
+     *
+     * @param string $name         The target SQL table.
+     * @param string $ident        The identification field.
+     * @param array $conf          The connection configuration array.
+     * @param int $level           Log messages up to and including this level.
+     * @access public
+     */
+    function Log_sql($name, $ident = '', $conf = array(),
+                     $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_table = $name;
+        $this->_mask = Log::UPTO($level);
+
+        /* Now that we have a table name, assign our SQL statement. */
+        if (!empty($this->_sql)) {
+            $this->_sql = $conf['sql'];
+        } else {
+            $this->_sql = 'INSERT INTO ' . $this->_table .
+                          ' (id, logtime, ident, priority, message)' .
+                          ' VALUES(?, CURRENT_TIMESTAMP, ?, ?, ?)';
+        }
+
+        /* If an options array was provided, use it. */
+        if (isset($conf['options']) && is_array($conf['options'])) {
+            $this->_options = $conf['options'];
+        }
+
+        /* If a specific sequence name was provided, use it. */
+        if (!empty($conf['sequence'])) {
+            $this->_sequence = $conf['sequence'];
+        }
+
+        /* If a specific sequence name was provided, use it. */
+        if (isset($conf['identLimit'])) {
+            $this->_identLimit = $conf['identLimit'];
+        }
+
+        /* Now that the ident limit is confirmed, set the ident string. */
+        $this->setIdent($ident);
+
+        /* If an existing database connection was provided, use it. */
+        if (isset($conf['db'])) {
+            $this->_db = &$conf['db'];
+            $this->_existingConnection = true;
+            $this->_opened = true;
+        } else {
+            $this->_dsn = $conf['dsn'];
+        }
+    }
+
+    /**
+     * Opens a connection to the database, if it has not already
+     * been opened. This is implicitly called by log(), if necessary.
+     *
+     * @return boolean   True on success, false on failure.
+     * @access public
+     */
+    function open()
+    {
+        if (!$this->_opened) {
+            /* Use the DSN and options to create a database connection. */
+            $this->_db = &DB::connect($this->_dsn, $this->_options);
+            if (DB::isError($this->_db)) {
+                return false;
+            }
+
+            /* Create a prepared statement for repeated use in log(). */
+            if (!$this->_prepareStatement()) {
+                return false;
+            }
+
+            /* We now consider out connection open. */
+            $this->_opened = true;
+        }
+
+        return $this->_opened;
+    }
+
+    /**
+     * Closes the connection to the database if it is still open and we were
+     * the ones that opened it.  It is the caller's responsible to close an
+     * existing connection that was passed to us via $conf['db'].
+     *
+     * @return boolean   True on success, false on failure.
+     * @access public
+     */
+    function close()
+    {
+        if ($this->_opened && !$this->_existingConnection) {
+            $this->_opened = false;
+            $this->_db->freePrepared($this->_statement);
+            return $this->_db->disconnect();
+        }
+
+        return ($this->_opened === false);
+    }
+
+    /**
+     * Sets this Log instance's identification string.  Note that this
+     * SQL-specific implementation will limit the length of the $ident string
+     * to sixteen (16) characters.
+     *
+     * @param string    $ident      The new identification string.
+     *
+     * @access  public
+     * @since   Log 1.8.5
+     */
+    function setIdent($ident)
+    {
+        $this->_ident = substr($ident, 0, $this->_identLimit);
+    }
+
+    /**
+     * Inserts $message to the currently open database.  Calls open(),
+     * if necessary.  Also passes the message along to any Log_observer
+     * instances that are observing this Log.
+     *
+     * @param mixed  $message  String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* If the connection isn't open and can't be opened, return failure. */
+        if (!$this->_opened && !$this->open()) {
+            return false;
+        }
+
+        /* If we don't already have our statement object yet, create it. */
+        if (!is_object($this->_statement) && !$this->_prepareStatement()) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        /* Build our set of values for this log entry. */
+        $id = $this->_db->nextId($this->_sequence);
+        $values = array($id, $this->_ident, $priority, $message);
+
+        /* Execute the SQL query for this log entry insertion. */
+        $result =& $this->_db->execute($this->_statement, $values);
+        if (DB::isError($result)) {
+            return false;
+        }
+
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+    /**
+     * Prepare the SQL insertion statement.
+     *
+     * @return boolean  True if the statement was successfully created.
+     *
+     * @access  private
+     * @since   Log 1.9.1
+     */
+    function _prepareStatement()
+    {
+        $this->_statement = $this->_db->prepare($this->_sql);
+
+        /* Return success if we didn't generate an error. */
+        return (DB::isError($this->_statement) === false);
+    }
+}

Added: trunk/direct.openmoko.com/pear/Log/sqlite.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/sqlite.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/sqlite.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,225 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/sqlite.php,v 1.5 2005/12/05 05:38:31 jon Exp $
+ *
+ * @version $Revision: 1.5 $
+ * @package Log
+ */
+
+/**
+ * The Log_sqlite class is a concrete implementation of the Log::
+ * abstract class which sends messages to an Sqlite database.
+ * Each entry occupies a separate row in the database.
+ *
+ * This implementation uses PHP native Sqlite functions.
+ *
+ * CREATE TABLE log_table (
+ *  id          INTEGER PRIMARY KEY NOT NULL,
+ *  logtime     NOT NULL,
+ *  ident       CHAR(16) NOT NULL,
+ *  priority    INT NOT NULL,
+ *  message
+ * );
+ *
+ * @author  Bertrand Mansion <bmansion at mamasam.com>
+ * @author  Jon Parise <jon at php.net>
+ * @since   Log 1.8.3
+ * @package Log
+ *
+ * @example sqlite.php      Using the Sqlite handler.
+ */
+class Log_sqlite extends Log
+{
+    /**
+     * Array containing the connection defaults
+     * @var array
+     * @access private
+     */
+    var $_options = array('mode'       => 0666,
+                          'persistent' => false);
+
+    /**
+     * Object holding the database handle.
+     * @var object
+     * @access private
+     */
+    var $_db = null;
+
+    /**
+     * Flag indicating that we're using an existing database connection.
+     * @var boolean
+     * @access private
+     */
+    var $_existingConnection = false;
+
+    /**
+     * String holding the database table to use.
+     * @var string
+     * @access private
+     */
+    var $_table = 'log_table';
+
+
+    /**
+     * Constructs a new sql logging object.
+     *
+     * @param string $name         The target SQL table.
+     * @param string $ident        The identification field.
+     * @param mixed  $conf         Can be an array of configuration options used
+     *                             to open a new database connection
+     *                             or an already opened sqlite connection.
+     * @param int    $level        Log messages up to and including this level.
+     * @access public
+     */
+    function Log_sqlite($name, $ident = '', &$conf, $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_table = $name;
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+
+        if (is_array($conf)) {
+            foreach ($conf as $k => $opt) {
+                $this->_options[$k] = $opt;
+            }
+        } else {
+            // If an existing database connection was provided, use it.
+            $this->_db =& $conf;
+            $this->_existingConnection = true;
+        }
+    }
+
+    /**
+     * Opens a connection to the database, if it has not already
+     * been opened. This is implicitly called by log(), if necessary.
+     *
+     * @return boolean   True on success, false on failure.
+     * @access public
+     */
+    function open()
+    {
+        if (is_resource($this->_db)) {
+            $this->_opened = true;
+            return $this->_createTable();
+        } else {
+            /* Set the connection function based on the 'persistent' option. */
+            if (empty($this->_options['persistent'])) {
+                $connectFunction = 'sqlite_open';
+            } else {
+                $connectFunction = 'sqlite_popen';
+            }
+
+            /* Attempt to connect to the database. */
+            if ($this->_db = $connectFunction($this->_options['filename'],
+                                              (int)$this->_options['mode'],
+                                              $error)) {
+                $this->_opened = true;
+                return $this->_createTable();
+            }
+        }
+
+        return $this->_opened;
+    }
+
+    /**
+     * Closes the connection to the database if it is still open and we were
+     * the ones that opened it.  It is the caller's responsible to close an
+     * existing connection that was passed to us via $conf['db'].
+     *
+     * @return boolean   True on success, false on failure.
+     * @access public
+     */
+    function close()
+    {
+        /* We never close existing connections. */
+        if ($this->_existingConnection) {
+            return false;
+        }
+
+        if ($this->_opened) {
+            $this->_opened = false;
+            sqlite_close($this->_db);
+        }
+
+        return ($this->_opened === false);
+    }
+
+    /**
+     * Inserts $message to the currently open database.  Calls open(),
+     * if necessary.  Also passes the message along to any Log_observer
+     * instances that are observing this Log.
+     *
+     * @param mixed  $message  String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* If the connection isn't open and can't be opened, return failure. */
+        if (!$this->_opened && !$this->open()) {
+            return false;
+        }
+
+        // Extract the string representation of the message.
+        $message = $this->_extractMessage($message);
+
+        // Build the SQL query for this log entry insertion.
+        $q = sprintf('INSERT INTO [%s] (logtime, ident, priority, message) ' .
+                     "VALUES ('%s', '%s', %d, '%s')",
+                     $this->_table,
+                     strftime('%Y-%m-%d %H:%M:%S', time()),
+                     sqlite_escape_string($this->_ident),
+                     $priority,
+                     sqlite_escape_string($message));
+        if (!($res = @sqlite_unbuffered_query($this->_db, $q))) {
+            return false;
+        }
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+    /**
+     * Checks whether the log table exists and creates it if necessary.
+     *
+     * @return boolean  True on success or false on failure.
+     * @access private
+     */
+    function _createTable()
+    {
+        $q = "SELECT name FROM sqlite_master WHERE name='" . $this->_table .
+             "' AND type='table'";
+
+        $res = sqlite_query($this->_db, $q);
+
+        if (sqlite_num_rows($res) == 0) {
+            $q = 'CREATE TABLE [' . $this->_table . '] (' .
+                 'id INTEGER PRIMARY KEY NOT NULL, ' .
+                 'logtime NOT NULL, ' .
+                 'ident CHAR(16) NOT NULL, ' .
+                 'priority INT NOT NULL, ' .
+                 'message)';
+
+            if (!($res = sqlite_unbuffered_query($this->_db, $q))) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/syslog.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/syslog.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/syslog.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/syslog.php,v 1.23 2005/02/26 14:48:59 chagenbu Exp $
+ * $Horde: horde/lib/Log/syslog.php,v 1.6 2000/06/28 21:36:13 jon Exp $
+ *
+ * @version $Revision: 1.23 $
+ * @package Log
+ */
+
+/**
+ * The Log_syslog class is a concrete implementation of the Log::
+ * abstract class which sends messages to syslog on UNIX-like machines
+ * (PHP emulates this with the Event Log on Windows machines).
+ *
+ * @author  Chuck Hagenbuch <chuck at horde.org>
+ * @since   Horde 1.3
+ * @since   Log 1.0
+ * @package Log
+ *
+ * @example syslog.php      Using the syslog handler.
+ */
+class Log_syslog extends Log
+{
+    /**
+    * Integer holding the log facility to use.
+    * @var string
+    * @access private
+    */
+    var $_name = LOG_SYSLOG;
+
+    /**
+     * Constructs a new syslog object.
+     *
+     * @param string $name     The syslog facility.
+     * @param string $ident    The identity string.
+     * @param array  $conf     The configuration array.
+     * @param int    $level    Log messages up to and including this level.
+     * @access public
+     */
+    function Log_syslog($name, $ident = '', $conf = array(),
+                        $level = PEAR_LOG_DEBUG)
+    {
+        /* Ensure we have a valid integer value for $name. */
+        if (empty($name) || !is_int($name)) {
+            $name = LOG_SYSLOG;
+        }
+
+        $this->_id = md5(microtime());
+        $this->_name = $name;
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+    }
+
+    /**
+     * Opens a connection to the system logger, if it has not already
+     * been opened.  This is implicitly called by log(), if necessary.
+     * @access public
+     */
+    function open()
+    {
+        if (!$this->_opened) {
+            openlog($this->_ident, LOG_PID, $this->_name);
+            $this->_opened = true;
+        }
+
+        return $this->_opened;
+    }
+
+    /**
+     * Closes the connection to the system logger, if it is open.
+     * @access public
+     */
+    function close()
+    {
+        if ($this->_opened) {
+            closelog();
+            $this->_opened = false;
+        }
+
+        return ($this->_opened === false);
+    }
+
+    /**
+     * Sends $message to the currently open syslog connection.  Calls
+     * open() if necessary. Also passes the message along to any Log_observer
+     * instances that are observing this Log.
+     *
+     * @param mixed $message String or object containing the message to log.
+     * @param int $priority (optional) The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* If the connection isn't open and can't be opened, return failure. */
+        if (!$this->_opened && !$this->open()) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        if (!syslog($this->_toSyslog($priority), $message)) {
+            return false;
+        }
+
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+    /**
+     * Converts a PEAR_LOG_* constant into a syslog LOG_* constant.
+     *
+     * This function exists because, under Windows, not all of the LOG_*
+     * constants have unique values.  Instead, the PEAR_LOG_* were introduced
+     * for global use, with the conversion to the LOG_* constants kept local to
+     * to the syslog driver.
+     *
+     * @param int $priority     PEAR_LOG_* value to convert to LOG_* value.
+     *
+     * @return  The LOG_* representation of $priority.
+     *
+     * @access private
+     */
+    function _toSyslog($priority)
+    {
+        static $priorities = array(
+            PEAR_LOG_EMERG   => LOG_EMERG,
+            PEAR_LOG_ALERT   => LOG_ALERT,
+            PEAR_LOG_CRIT    => LOG_CRIT,
+            PEAR_LOG_ERR     => LOG_ERR,
+            PEAR_LOG_WARNING => LOG_WARNING,
+            PEAR_LOG_NOTICE  => LOG_NOTICE,
+            PEAR_LOG_INFO    => LOG_INFO,
+            PEAR_LOG_DEBUG   => LOG_DEBUG
+        );
+
+        /* If we're passed an unknown priority, default to LOG_INFO. */
+        if (!is_int($priority) || !in_array($priority, $priorities)) {
+            return LOG_INFO;
+        }
+
+        return $priorities[$priority];
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log/win.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log/win.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log/win.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,256 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log/win.php,v 1.18 2006/03/02 03:06:43 jon Exp $
+ *
+ * @version $Revision: 1.18 $
+ * @package Log
+ */
+
+/**
+ * The Log_win class is a concrete implementation of the Log abstract
+ * class that logs messages to a separate browser window.
+ *
+ * The concept for this log handler is based on part by Craig Davis' article
+ * entitled "JavaScript Power PHP Debugging:
+ *
+ *  http://www.zend.com/zend/tut/tutorial-DebugLib.php
+ *
+ * @author  Jon Parise <jon at php.net>
+ * @since   Log 1.7.0
+ * @package Log
+ *
+ * @example win.php     Using the window handler.
+ */
+class Log_win extends Log
+{
+    /**
+     * The name of the output window.
+     * @var string
+     * @access private
+     */
+    var $_name = 'LogWindow';
+
+    /**
+     * The title of the output window.
+     * @var string
+     * @access private
+     */
+    var $_title = 'Log Output Window';
+
+    /**
+     * Mapping of log priorities to colors.
+     * @var array
+     * @access private
+     */
+    var $_colors = array(
+                        PEAR_LOG_EMERG   => 'red',
+                        PEAR_LOG_ALERT   => 'orange',
+                        PEAR_LOG_CRIT    => 'yellow',
+                        PEAR_LOG_ERR     => 'green',
+                        PEAR_LOG_WARNING => 'blue',
+                        PEAR_LOG_NOTICE  => 'indigo',
+                        PEAR_LOG_INFO    => 'violet',
+                        PEAR_LOG_DEBUG   => 'black'
+                    );
+
+    /**
+     * String buffer that holds line that are pending output.
+     * @var array
+     * @access private
+     */
+    var $_buffer = array();
+
+    /**
+     * Constructs a new Log_win object.
+     *
+     * @param string $name     Ignored.
+     * @param string $ident    The identity string.
+     * @param array  $conf     The configuration array.
+     * @param int    $level    Log messages up to and including this level.
+     * @access public
+     */
+    function Log_win($name, $ident = '', $conf = array(),
+                          $level = PEAR_LOG_DEBUG)
+    {
+        $this->_id = md5(microtime());
+        $this->_name = $name;
+        $this->_ident = $ident;
+        $this->_mask = Log::UPTO($level);
+
+        if (isset($conf['title'])) {
+            $this->_title = $conf['title'];
+        }
+        if (isset($conf['colors']) && is_array($conf['colors'])) {
+            $this->_colors = $conf['colors'];
+        }
+
+        register_shutdown_function(array(&$this, '_Log_win'));
+    }
+
+    /**
+     * Destructor
+     */
+    function _Log_win()
+    {
+        if ($this->_opened || (count($this->_buffer) > 0)) {
+            $this->close();
+        }
+    }
+
+    /**
+     * The first time open() is called, it will open a new browser window and
+     * prepare it for output.
+     *
+     * This is implicitly called by log(), if necessary.
+     *
+     * @access public
+     */
+    function open()
+    {
+        if (!$this->_opened) {
+            $win = $this->_name;
+
+            if (!empty($this->_ident)) {
+                $identHeader = "$win.document.writeln('<th>Ident</th>')";
+            } else {
+                $identHeader = '';
+            }
+
+            echo <<< END_OF_SCRIPT
+<script language="JavaScript">
+$win = window.open('', '{$this->_name}', 'toolbar=no,scrollbars,width=600,height=400');
+$win.document.writeln('<html>');
+$win.document.writeln('<head>');
+$win.document.writeln('<title>{$this->_title}</title>');
+$win.document.writeln('<style type="text/css">');
+$win.document.writeln('body { font-family: monospace; font-size: 8pt; }');
+$win.document.writeln('td,th { font-size: 8pt; }');
+$win.document.writeln('td,th { border-bottom: #999999 solid 1px; }');
+$win.document.writeln('td,th { border-right: #999999 solid 1px; }');
+$win.document.writeln('tr { text-align: left; vertical-align: top; }');
+$win.document.writeln('</style>');
+$win.document.writeln('</head>');
+$win.document.writeln('<body>');
+$win.document.writeln('<table border="0" cellpadding="2" cellspacing="0">');
+$win.document.writeln('<tr><th>Time</th>');
+$identHeader
+$win.document.writeln('<th>Priority</th><th width="100%">Message</th></tr>');
+</script>
+END_OF_SCRIPT;
+            $this->_opened = true;
+        }
+
+        return $this->_opened;
+    }
+
+    /**
+     * Closes the output stream if it is open.  If there are still pending
+     * lines in the output buffer, the output window will be opened so that
+     * the buffer can be drained.
+     *
+     * @access public
+     */
+    function close()
+    {
+        /*
+         * If there are still lines waiting to be written, open the output
+         * window so that we can drain the buffer.
+         */
+        if (!$this->_opened && (count($this->_buffer) > 0)) {
+            $this->open();
+        }
+
+        if ($this->_opened) {
+            $this->_writeln('</table>');
+            $this->_writeln('</body></html>');
+            $this->_opened = false;
+        }
+
+        return ($this->_opened === false);
+    }
+
+    /**
+     * Writes a single line of text to the output window.
+     *
+     * @param string    $line   The line of text to write.
+     *
+     * @access private
+     */
+    function _writeln($line)
+    {
+        /* Add this line to our output buffer. */
+        $this->_buffer[] = $line;
+
+        /* Buffer the output until this page's headers have been sent. */
+        if (!headers_sent()) {
+            return;
+        }
+
+        /* If we haven't already opened the output window, do so now. */
+        if (!$this->_opened && !$this->open()) {
+            return false;
+        }
+
+        /* Drain the buffer to the output window. */
+        $win = $this->_name;
+        foreach ($this->_buffer as $line) {
+            echo "<script language='JavaScript'>\n";
+            echo "$win.document.writeln('" . addslashes($line) . "');\n";
+            echo "self.focus();\n";
+            echo "</script>\n";
+        }
+
+        /* Now that the buffer has been drained, clear it. */
+        $this->_buffer = array();
+    }
+
+    /**
+     * Logs $message to the output window.  The message is also passed along
+     * to any Log_observer instances that are observing this Log.
+     *
+     * @param mixed  $message  String or object containing the message to log.
+     * @param string $priority The priority of the message.  Valid
+     *                  values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+     *                  PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+     *                  PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+     * @return boolean  True on success or false on failure.
+     * @access public
+     */
+    function log($message, $priority = null)
+    {
+        /* If a priority hasn't been specified, use the default value. */
+        if ($priority === null) {
+            $priority = $this->_priority;
+        }
+
+        /* Abort early if the priority is above the maximum logging level. */
+        if (!$this->_isMasked($priority)) {
+            return false;
+        }
+
+        /* Extract the string representation of the message. */
+        $message = $this->_extractMessage($message);
+
+        list($usec, $sec) = explode(' ', microtime());
+
+        /* Build the output line that contains the log entry row. */
+        $line  = '<tr>';
+        $line .= sprintf('<td>%s.%s</td>',
+                         strftime('%T', $sec), substr($usec, 2, 2));
+        if (!empty($this->_ident)) {
+            $line .= '<td>' . $this->_ident . '</td>';
+        }
+        $line .= '<td>' . ucfirst($this->priorityToString($priority)) . '</td>';
+        $line .= sprintf('<td style="color: %s">%s</td>',
+                         $this->_colors[$priority],
+                         preg_replace('/\r\n|\n|\r/', '<br />', $message));
+        $line .= '</tr>';
+
+        $this->_writeln($line);
+
+        $this->_announce(array('priority' => $priority, 'message' => $message));
+
+        return true;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Log.php
===================================================================
--- trunk/direct.openmoko.com/pear/Log.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Log.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,816 @@
+<?php
+/**
+ * $Header: /repository/pear/Log/Log.php,v 1.59 2006/04/25 06:02:23 jon Exp $
+ * $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $
+ *
+ * @version $Revision: 1.59 $
+ * @package Log
+ */
+
+define('PEAR_LOG_EMERG',    0);     /** System is unusable */
+define('PEAR_LOG_ALERT',    1);     /** Immediate action required */
+define('PEAR_LOG_CRIT',     2);     /** Critical conditions */
+define('PEAR_LOG_ERR',      3);     /** Error conditions */
+define('PEAR_LOG_WARNING',  4);     /** Warning conditions */
+define('PEAR_LOG_NOTICE',   5);     /** Normal but significant */
+define('PEAR_LOG_INFO',     6);     /** Informational */
+define('PEAR_LOG_DEBUG',    7);     /** Debug-level messages */
+
+define('PEAR_LOG_ALL',      bindec('11111111'));  /** All messages */
+define('PEAR_LOG_NONE',     bindec('00000000'));  /** No message */
+
+/* Log types for PHP's native error_log() function. */
+define('PEAR_LOG_TYPE_SYSTEM',  0); /** Use PHP's system logger */
+define('PEAR_LOG_TYPE_MAIL',    1); /** Use PHP's mail() function */
+define('PEAR_LOG_TYPE_DEBUG',   2); /** Use PHP's debugging connection */
+define('PEAR_LOG_TYPE_FILE',    3); /** Append to a file */
+
+/**
+ * The Log:: class implements both an abstraction for various logging
+ * mechanisms and the Subject end of a Subject-Observer pattern.
+ *
+ * @author  Chuck Hagenbuch <chuck at horde.org>
+ * @author  Jon Parise <jon at php.net>
+ * @since   Horde 1.3
+ * @package Log
+ */
+class Log
+{
+    /**
+     * Indicates whether or not the log can been opened / connected.
+     *
+     * @var boolean
+     * @access private
+     */
+    var $_opened = false;
+
+    /**
+     * Instance-specific unique identification number.
+     *
+     * @var integer
+     * @access private
+     */
+    var $_id = 0;
+
+    /**
+     * The label that uniquely identifies this set of log messages.
+     *
+     * @var string
+     * @access private
+     */
+    var $_ident = '';
+
+    /**
+     * The default priority to use when logging an event.
+     *
+     * @var integer
+     * @access private
+     */
+    var $_priority = PEAR_LOG_INFO;
+
+    /**
+     * The bitmask of allowed log levels.
+     *
+     * @var integer
+     * @access private
+     */
+    var $_mask = PEAR_LOG_ALL;
+
+    /**
+     * Holds all Log_observer objects that wish to be notified of new messages.
+     *
+     * @var array
+     * @access private
+     */
+    var $_listeners = array();
+
+    /**
+     * Maps canonical format keys to position arguments for use in building
+     * "line format" strings.
+     *
+     * @var array
+     * @access private
+     */
+    var $_formatMap = array('%{timestamp}'  => '%1$s',
+                            '%{ident}'      => '%2$s',
+                            '%{priority}'   => '%3$s',
+                            '%{message}'    => '%4$s',
+                            '%{file}'       => '%5$s',
+                            '%{line}'       => '%6$s',
+                            '%{function}'   => '%7$s',
+                            '%\{'           => '%%{');
+
+
+    /**
+     * Attempts to return a concrete Log instance of type $handler.
+     *
+     * @param string $handler   The type of concrete Log subclass to return.
+     *                          Attempt to dynamically include the code for
+     *                          this subclass. Currently, valid values are
+     *                          'console', 'syslog', 'sql', 'file', and 'mcal'.
+     *
+     * @param string $name      The name of the actually log file, table, or
+     *                          other specific store to use. Defaults to an
+     *                          empty string, with which the subclass will
+     *                          attempt to do something intelligent.
+     *
+     * @param string $ident     The identity reported to the log system.
+     *
+     * @param array  $conf      A hash containing any additional configuration
+     *                          information that a subclass might need.
+     *
+     * @param int $level        Log messages up to and including this level.
+     *
+     * @return object Log       The newly created concrete Log instance, or
+     *                          null on an error.
+     * @access public
+     * @since Log 1.0
+     */
+    function &factory($handler, $name = '', $ident = '', $conf = array(),
+                      $level = PEAR_LOG_DEBUG)
+    {
+        $handler = strtolower($handler);
+        $class = 'Log_' . $handler;
+        $classfile = 'Log/' . $handler . '.php';
+
+        /*
+         * Attempt to include our version of the named class, but don't treat
+         * a failure as fatal.  The caller may have already included their own
+         * version of the named class.
+         */
+        if (!class_exists($class)) {
+            include_once $classfile;
+        }
+
+        /* If the class exists, return a new instance of it. */
+        if (class_exists($class)) {
+            $obj = &new $class($name, $ident, $conf, $level);
+            return $obj;
+        }
+
+        $null = null;
+        return $null;
+    }
+
+    /**
+     * Attempts to return a reference to a concrete Log instance of type
+     * $handler, only creating a new instance if no log instance with the same
+     * parameters currently exists.
+     *
+     * You should use this if there are multiple places you might create a
+     * logger, you don't want to create multiple loggers, and you don't want to
+     * check for the existance of one each time. The singleton pattern does all
+     * the checking work for you.
+     *
+     * <b>You MUST call this method with the $var = &Log::singleton() syntax.
+     * Without the ampersand (&) in front of the method name, you will not get
+     * a reference, you will get a copy.</b>
+     *
+     * @param string $handler   The type of concrete Log subclass to return.
+     *                          Attempt to dynamically include the code for
+     *                          this subclass. Currently, valid values are
+     *                          'console', 'syslog', 'sql', 'file', and 'mcal'.
+     *
+     * @param string $name      The name of the actually log file, table, or
+     *                          other specific store to use.  Defaults to an
+     *                          empty string, with which the subclass will
+     *                          attempt to do something intelligent.
+     *
+     * @param string $ident     The identity reported to the log system.
+     *
+     * @param array $conf       A hash containing any additional configuration
+     *                          information that a subclass might need.
+     *
+     * @param int $level        Log messages up to and including this level.
+     *
+     * @return object Log       The newly created concrete Log instance, or
+     *                          null on an error.
+     * @access public
+     * @since Log 1.0
+     */
+    function &singleton($handler, $name = '', $ident = '', $conf = array(),
+                        $level = PEAR_LOG_DEBUG)
+    {
+        static $instances;
+        if (!isset($instances)) $instances = array();
+
+        $signature = serialize(array($handler, $name, $ident, $conf, $level));
+        if (!isset($instances[$signature])) {
+            $instances[$signature] = &Log::factory($handler, $name, $ident,
+                                                   $conf, $level);
+        }
+
+        return $instances[$signature];
+    }
+
+    /**
+     * Abstract implementation of the open() method.
+     * @since Log 1.0
+     */
+    function open()
+    {
+        return false;
+    }
+
+    /**
+     * Abstract implementation of the close() method.
+     * @since Log 1.0
+     */
+    function close()
+    {
+        return false;
+    }
+
+    /**
+     * Abstract implementation of the flush() method.
+     * @since Log 1.8.2
+     */
+    function flush()
+    {
+        return false;
+    }
+
+    /**
+     * Abstract implementation of the log() method.
+     * @since Log 1.0
+     */
+    function log($message, $priority = null)
+    {
+        return false;
+    }
+
+    /**
+     * A convenience function for logging a emergency event.  It will log a
+     * message at the PEAR_LOG_EMERG log level.
+     *
+     * @param   mixed   $message    String or object containing the message
+     *                              to log.
+     *
+     * @return  boolean True if the message was successfully logged.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function emerg($message)
+    {
+        return $this->log($message, PEAR_LOG_EMERG);
+    }
+
+    /**
+     * A convenience function for logging an alert event.  It will log a
+     * message at the PEAR_LOG_ALERT log level.
+     *
+     * @param   mixed   $message    String or object containing the message
+     *                              to log.
+     *
+     * @return  boolean True if the message was successfully logged.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function alert($message)
+    {
+        return $this->log($message, PEAR_LOG_ALERT);
+    }
+
+    /**
+     * A convenience function for logging a critical event.  It will log a
+     * message at the PEAR_LOG_CRIT log level.
+     *
+     * @param   mixed   $message    String or object containing the message
+     *                              to log.
+     *
+     * @return  boolean True if the message was successfully logged.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function crit($message)
+    {
+        return $this->log($message, PEAR_LOG_CRIT);
+    }
+
+    /**
+     * A convenience function for logging a error event.  It will log a
+     * message at the PEAR_LOG_ERR log level.
+     *
+     * @param   mixed   $message    String or object containing the message
+     *                              to log.
+     *
+     * @return  boolean True if the message was successfully logged.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function err($message)
+    {
+        return $this->log($message, PEAR_LOG_ERR);
+    }
+
+    /**
+     * A convenience function for logging a warning event.  It will log a
+     * message at the PEAR_LOG_WARNING log level.
+     *
+     * @param   mixed   $message    String or object containing the message
+     *                              to log.
+     *
+     * @return  boolean True if the message was successfully logged.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function warning($message)
+    {
+        return $this->log($message, PEAR_LOG_WARNING);
+    }
+
+    /**
+     * A convenience function for logging a notice event.  It will log a
+     * message at the PEAR_LOG_NOTICE log level.
+     *
+     * @param   mixed   $message    String or object containing the message
+     *                              to log.
+     *
+     * @return  boolean True if the message was successfully logged.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function notice($message)
+    {
+        return $this->log($message, PEAR_LOG_NOTICE);
+    }
+
+    /**
+     * A convenience function for logging a information event.  It will log a
+     * message at the PEAR_LOG_INFO log level.
+     *
+     * @param   mixed   $message    String or object containing the message
+     *                              to log.
+     *
+     * @return  boolean True if the message was successfully logged.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function info($message)
+    {
+        return $this->log($message, PEAR_LOG_INFO);
+    }
+
+    /**
+     * A convenience function for logging a debug event.  It will log a
+     * message at the PEAR_LOG_DEBUG log level.
+     *
+     * @param   mixed   $message    String or object containing the message
+     *                              to log.
+     *
+     * @return  boolean True if the message was successfully logged.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function debug($message)
+    {
+        return $this->log($message, PEAR_LOG_DEBUG);
+    }
+
+    /**
+     * Returns the string representation of the message data.
+     *
+     * If $message is an object, _extractMessage() will attempt to extract
+     * the message text using a known method (such as a PEAR_Error object's
+     * getMessage() method).  If a known method, cannot be found, the
+     * serialized representation of the object will be returned.
+     *
+     * If the message data is already a string, it will be returned unchanged.
+     *
+     * @param  mixed $message   The original message data.  This may be a
+     *                          string or any object.
+     *
+     * @return string           The string representation of the message.
+     *
+     * @access private
+     */
+    function _extractMessage($message)
+    {
+        /*
+         * If we've been given an object, attempt to extract the message using
+         * a known method.  If we can't find such a method, default to the
+         * "human-readable" version of the object.
+         *
+         * We also use the human-readable format for arrays.
+         */
+        if (is_object($message)) {
+            if (method_exists($message, 'getmessage')) {
+                $message = $message->getMessage();
+            } else if (method_exists($message, 'tostring')) {
+                $message = $message->toString();
+            } else if (method_exists($message, '__tostring')) {
+                if (version_compare(PHP_VERSION, '5.0.0', 'ge')) {
+                    $message = (string)$message;
+                } else {
+                    $message = $message->__toString();
+                }
+            } else {
+                $message = print_r($message, true);
+            }
+        } else if (is_array($message)) {
+            if (isset($message['message'])) {
+                $message = $message['message'];
+            } else {
+                $message = print_r($message, true);
+            }
+        }
+
+        /* Otherwise, we assume the message is a string. */
+        return $message;
+    }
+
+    /**
+     * Using debug_backtrace(), returns the file, line, and enclosing function
+     * name of the source code context from which log() was invokved.
+     *
+     * @param   int     $depth  The initial number of frames we should step
+     *                          back into the trace.
+     *
+     * @return  array   Array containing three strings: the filename, the line,
+     *                  and the function name from which log() was called.
+     *
+     * @access  private
+     * @since   Log 1.9.4
+     */
+    function _getBacktraceVars($depth)
+    {
+        /* Start by generating a backtrace from the current call (here). */
+        $backtrace = debug_backtrace();
+
+        /*
+         * We're interested in the frame which invoked the log() function, so
+         * we need to walk back some number of frames into the backtrace.  The
+         * $depth parameter tells us where to start looking.   We go one step
+         * further back to find the name of the encapsulating function from
+         * which log() was called.
+         */
+        $file = @$backtrace[$depth]['file'];
+        $line = @$backtrace[$depth]['line'];
+        $func = @$backtrace[$depth + 1]['function'];
+
+        /*
+         * However, if log() was called from one of our "shortcut" functions,
+         * we're going to need to go back an additional step.
+         */
+        if (in_array($func, array('emerg', 'alert', 'crit', 'err', 'warning',
+                                  'notice', 'info', 'debug'))) {
+            $file = @$backtrace[$depth + 1]['file'];
+            $line = @$backtrace[$depth + 1]['line'];
+            $func = @$backtrace[$depth + 2]['function'];
+        }
+
+        /*
+         * If we couldn't extract a function name (perhaps because we were
+         * executed from the "main" context), provide a default value.
+         */
+        if (is_null($func)) {
+            $func = '(none)';
+        }
+
+        /* Return a 3-tuple containing (file, line, function). */
+        return array($file, $line, $func);
+    }
+
+    /**
+     * Produces a formatted log line based on a format string and a set of
+     * variables representing the current log record and state.
+     *
+     * @return  string  Formatted log string.
+     *
+     * @access  private
+     * @since   Log 1.9.4
+     */
+    function _format($format, $timestamp, $priority, $message)
+    {
+        /*
+         * If the format string references any of the backtrace-driven
+         * variables (%5, %6, %7), generate the backtrace and fetch them.
+         */
+        if (preg_match('/%[567]/', $format)) {
+            list($file, $line, $func) = $this->_getBacktraceVars(2);
+        }
+
+        /*
+         * Build the formatted string.  We use the sprintf() function's
+         * "argument swapping" capability to dynamically select and position
+         * the variables which will ultimately appear in the log string.
+         */
+        return sprintf($format,
+                       $timestamp,
+                       $this->_ident,
+                       $this->priorityToString($priority),
+                       $message,
+                       isset($file) ? $file : '',
+                       isset($line) ? $line : '',
+                       isset($func) ? $func : '');
+    }
+
+    /**
+     * Returns the string representation of a PEAR_LOG_* integer constant.
+     *
+     * @param int $priority     A PEAR_LOG_* integer constant.
+     *
+     * @return string           The string representation of $level.
+     *
+     * @since   Log 1.0
+     */
+    function priorityToString($priority)
+    {
+        $levels = array(
+            PEAR_LOG_EMERG   => 'emergency',
+            PEAR_LOG_ALERT   => 'alert',
+            PEAR_LOG_CRIT    => 'critical',
+            PEAR_LOG_ERR     => 'error',
+            PEAR_LOG_WARNING => 'warning',
+            PEAR_LOG_NOTICE  => 'notice',
+            PEAR_LOG_INFO    => 'info',
+            PEAR_LOG_DEBUG   => 'debug'
+        );
+
+        return $levels[$priority];
+    }
+
+    /**
+     * Returns the the PEAR_LOG_* integer constant for the given string
+     * representation of a priority name.  This function performs a
+     * case-insensitive search.
+     *
+     * @param string $name      String containing a priority name.
+     *
+     * @return string           The PEAR_LOG_* integer contstant corresponding
+     *                          the the specified priority name.
+     *
+     * @since   Log 1.9.0
+     */
+    function stringToPriority($name)
+    {
+        $levels = array(
+            'emergency' => PEAR_LOG_EMERG,
+            'alert'     => PEAR_LOG_ALERT,
+            'critical'  => PEAR_LOG_CRIT,
+            'error'     => PEAR_LOG_ERR,
+            'warning'   => PEAR_LOG_WARNING,
+            'notice'    => PEAR_LOG_NOTICE,
+            'info'      => PEAR_LOG_INFO,
+            'debug'     => PEAR_LOG_DEBUG
+        );
+
+        return $levels[strtolower($name)];
+    }
+
+    /**
+     * Calculate the log mask for the given priority.
+     *
+     * This method may be called statically.
+     *
+     * @param integer   $priority   The priority whose mask will be calculated.
+     *
+     * @return integer  The calculated log mask.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function MASK($priority)
+    {
+        return (1 << $priority);
+    }
+
+    /**
+     * Calculate the log mask for all priorities up to the given priority.
+     *
+     * This method may be called statically.
+     *
+     * @param integer   $priority   The maximum priority covered by this mask.
+     *
+     * @return integer  The resulting log mask.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     *
+     * @deprecated deprecated since Log 1.9.4; use Log::MAX() instead
+     */
+    function UPTO($priority)
+    {
+        return Log::MAX($priority);
+    }
+
+    /**
+     * Calculate the log mask for all priorities greater than or equal to the
+     * given priority.  In other words, $priority will be the lowest priority
+     * matched by the resulting mask.
+     *
+     * This method may be called statically.
+     *
+     * @param integer   $priority   The minimum priority covered by this mask.
+     *
+     * @return integer  The resulting log mask.
+     *
+     * @access  public
+     * @since   Log 1.9.4
+     */
+    function MIN($priority)
+    {
+        return PEAR_LOG_ALL ^ ((1 << $priority) - 1);
+    }
+
+    /**
+     * Calculate the log mask for all priorities less than or equal to the
+     * given priority.  In other words, $priority will be the highests priority
+     * matched by the resulting mask.
+     *
+     * This method may be called statically.
+     *
+     * @param integer   $priority   The maximum priority covered by this mask.
+     *
+     * @return integer  The resulting log mask.
+     *
+     * @access  public
+     * @since   Log 1.9.4
+     */
+    function MAX($priority)
+    {
+        return ((1 << ($priority + 1)) - 1);
+    }
+
+    /**
+     * Set and return the level mask for the current Log instance.
+     *
+     * @param integer $mask     A bitwise mask of log levels.
+     *
+     * @return integer          The current level mask.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function setMask($mask)
+    {
+        $this->_mask = $mask;
+
+        return $this->_mask;
+    }
+
+    /**
+     * Returns the current level mask.
+     *
+     * @return interger         The current level mask.
+     *
+     * @access  public
+     * @since   Log 1.7.0
+     */
+    function getMask()
+    {
+        return $this->_mask;
+    }
+
+    /**
+     * Check if the given priority is included in the current level mask.
+     *
+     * @param integer   $priority   The priority to check.
+     *
+     * @return boolean  True if the given priority is included in the current
+     *                  log mask.
+     *
+     * @access  private
+     * @since   Log 1.7.0
+     */
+    function _isMasked($priority)
+    {
+        return (Log::MASK($priority) & $this->_mask);
+    }
+
+    /**
+     * Returns the current default priority.
+     *
+     * @return integer  The current default priority.
+     *
+     * @access  public
+     * @since   Log 1.8.4
+     */
+    function getPriority()
+    {
+        return $this->_priority;
+    }
+
+    /**
+     * Sets the default priority to the specified value.
+     *
+     * @param   integer $priority   The new default priority.
+     *
+     * @access  public
+     * @since   Log 1.8.4
+     */
+    function setPriority($priority)
+    {
+        $this->_priority = $priority;
+    }
+
+    /**
+     * Adds a Log_observer instance to the list of observers that are listening
+     * for messages emitted by this Log instance.
+     *
+     * @param object    $observer   The Log_observer instance to attach as a
+     *                              listener.
+     *
+     * @param boolean   True if the observer is successfully attached.
+     *
+     * @access  public
+     * @since   Log 1.0
+     */
+    function attach(&$observer)
+    {
+        if (!is_a($observer, 'Log_observer')) {
+            return false;
+        }
+
+        $this->_listeners[$observer->_id] = &$observer;
+
+        return true;
+    }
+
+    /**
+     * Removes a Log_observer instance from the list of observers.
+     *
+     * @param object    $observer   The Log_observer instance to detach from
+     *                              the list of listeners.
+     *
+     * @param boolean   True if the observer is successfully detached.
+     *
+     * @access  public
+     * @since   Log 1.0
+     */
+    function detach($observer)
+    {
+        if (!is_a($observer, 'Log_observer') ||
+            !isset($this->_listeners[$observer->_id])) {
+            return false;
+        }
+
+        unset($this->_listeners[$observer->_id]);
+
+        return true;
+    }
+
+    /**
+     * Informs each registered observer instance that a new message has been
+     * logged.
+     *
+     * @param array     $event      A hash describing the log event.
+     *
+     * @access private
+     */
+    function _announce($event)
+    {
+        foreach ($this->_listeners as $id => $listener) {
+            if ($event['priority'] <= $this->_listeners[$id]->_priority) {
+                $this->_listeners[$id]->notify($event);
+            }
+        }
+    }
+
+    /**
+     * Indicates whether this is a composite class.
+     *
+     * @return boolean          True if this is a composite class.
+     *
+     * @access  public
+     * @since   Log 1.0
+     */
+    function isComposite()
+    {
+        return false;
+    }
+
+    /**
+     * Sets this Log instance's identification string.
+     *
+     * @param string    $ident      The new identification string.
+     *
+     * @access  public
+     * @since   Log 1.6.3
+     */
+    function setIdent($ident)
+    {
+        $this->_ident = $ident;
+    }
+
+    /**
+     * Returns the current identification string.
+     *
+     * @return string   The current Log instance's identification string.
+     *
+     * @access  public
+     * @since   Log 1.6.3
+     */
+    function getIdent()
+    {
+        return $this->_ident;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Mail/mime.php
===================================================================
--- trunk/direct.openmoko.com/pear/Mail/mime.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Mail/mime.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,713 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+// +-----------------------------------------------------------------------+
+// | Copyright (c) 2002-2003  Richard Heyes                                |
+// | Copyright (c) 2003-2005  The PHP Group                                |
+// | All rights reserved.                                                  |
+// |                                                                       |
+// | Redistribution and use in source and binary forms, with or without    |
+// | modification, are permitted provided that the following conditions    |
+// | are met:                                                              |
+// |                                                                       |
+// | o Redistributions of source code must retain the above copyright      |
+// |   notice, this list of conditions and the following disclaimer.       |
+// | o Redistributions in binary form must reproduce the above copyright   |
+// |   notice, this list of conditions and the following disclaimer in the |
+// |   documentation and/or other materials provided with the distribution.|
+// | o The names of the authors may not be used to endorse or promote      |
+// |   products derived from this software without specific prior written  |
+// |   permission.                                                         |
+// |                                                                       |
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |
+// |                                                                       |
+// +-----------------------------------------------------------------------+
+// | Author: Richard Heyes <richard at phpguru.org>                           |
+// |         Tomas V.V.Cox <cox at idecnet.com> (port to PEAR)                |
+// +-----------------------------------------------------------------------+
+//
+// $Id: mime.php,v 1.39 2005/06/13 21:24:16 cipri Exp $
+
+require_once('PEAR.php');
+require_once('Mail/mimePart.php');
+
+/**
+ * Mime mail composer class. Can handle: text and html bodies, embedded html
+ * images and attachments.
+ * Documentation and examples of this class are avaible here:
+ * http://pear.php.net/manual/
+ *
+ * @notes This class is based on HTML Mime Mail class from
+ *   Richard Heyes <richard at phpguru.org> which was based also
+ *   in the mime_mail.class by Tobias Ratschiller <tobias at dnet.it> and
+ *   Sascha Schumann <sascha at schumann.cx>
+ *
+ * @author   Richard Heyes <richard.heyes at heyes-computing.net>
+ * @author   Tomas V.V.Cox <cox at idecnet.com>
+ * @package  Mail
+ * @access   public
+ */
+class Mail_mime
+{
+    /**
+     * Contains the plain text part of the email
+     * @var string
+     */
+    var $_txtbody;
+    /**
+     * Contains the html part of the email
+     * @var string
+     */
+    var $_htmlbody;
+    /**
+     * contains the mime encoded text
+     * @var string
+     */
+    var $_mime;
+    /**
+     * contains the multipart content
+     * @var string
+     */
+    var $_multipart;
+    /**
+     * list of the attached images
+     * @var array
+     */
+    var $_html_images = array();
+    /**
+     * list of the attachements
+     * @var array
+     */
+    var $_parts = array();
+    /**
+     * Build parameters
+     * @var array
+     */
+    var $_build_params = array();
+    /**
+     * Headers for the mail
+     * @var array
+     */
+    var $_headers = array();
+    /**
+     * End Of Line sequence (for serialize)
+     * @var string
+     */
+    var $_eol;
+
+
+    /**
+     * Constructor function
+     *
+     * @access public
+     */
+    function Mail_mime($crlf = "\r\n")
+    {
+        $this->_setEOL($crlf);
+        $this->_build_params = array(
+                                     'text_encoding' => '7bit',
+                                     'html_encoding' => 'quoted-printable',
+                                     '7bit_wrap'     => 998,
+                                     'html_charset'  => 'ISO-8859-1',
+                                     'text_charset'  => 'ISO-8859-1',
+                                     'head_charset'  => 'ISO-8859-1'
+                                    );
+    }
+
+    /**
+     * Wakeup (unserialize) - re-sets EOL constant
+     *
+     * @access private
+     */
+    function __wakeup()
+    {
+        $this->_setEOL($this->_eol);
+    }
+
+    /**
+     * Accessor function to set the body text. Body text is used if
+     * it's not an html mail being sent or else is used to fill the
+     * text/plain part that emails clients who don't support
+     * html should show.
+     *
+     * @param  string  $data   Either a string or
+     *                         the file name with the contents
+     * @param  bool    $isfile If true the first param should be treated
+     *                         as a file name, else as a string (default)
+     * @param  bool    $append If true the text or file is appended to
+     *                         the existing body, else the old body is
+     *                         overwritten
+     * @return mixed   true on success or PEAR_Error object
+     * @access public
+     */
+    function setTXTBody($data, $isfile = false, $append = false)
+    {
+        if (!$isfile) {
+            if (!$append) {
+                $this->_txtbody = $data;
+            } else {
+                $this->_txtbody .= $data;
+            }
+        } else {
+            $cont = $this->_file2str($data);
+            if (PEAR::isError($cont)) {
+                return $cont;
+            }
+            if (!$append) {
+                $this->_txtbody = $cont;
+            } else {
+                $this->_txtbody .= $cont;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Adds a html part to the mail
+     *
+     * @param  string  $data   Either a string or the file name with the
+     *                         contents
+     * @param  bool    $isfile If true the first param should be treated
+     *                         as a file name, else as a string (default)
+     * @return mixed   true on success or PEAR_Error object
+     * @access public
+     */
+    function setHTMLBody($data, $isfile = false)
+    {
+        if (!$isfile) {
+            $this->_htmlbody = $data;
+        } else {
+            $cont = $this->_file2str($data);
+            if (PEAR::isError($cont)) {
+                return $cont;
+            }
+            $this->_htmlbody = $cont;
+        }
+
+        return true;
+    }
+
+    /**
+     * Adds an image to the list of embedded images.
+     *
+     * @param  string  $file       The image file name OR image data itself
+     * @param  string  $c_type     The content type
+     * @param  string  $name       The filename of the image.
+     *                             Only use if $file is the image data
+     * @param  bool    $isfilename Whether $file is a filename or not
+     *                             Defaults to true
+     * @return mixed   true on success or PEAR_Error object
+     * @access public
+     */
+    function addHTMLImage($file, $c_type='application/octet-stream',
+                          $name = '', $isfilename = true)
+    {
+        $filedata = ($isfilename === true) ? $this->_file2str($file)
+                                           : $file;
+        if ($isfilename === true) {
+            $filename = ($name == '' ? basename($file) : basename($name));
+        } else {
+            $filename = basename($name);
+        }
+        if (PEAR::isError($filedata)) {
+            return $filedata;
+        }
+        $this->_html_images[] = array(
+                                      'body'   => $filedata,
+                                      'name'   => $filename,
+                                      'c_type' => $c_type,
+                                      'cid'    => md5(uniqid(time()))
+                                     );
+        return true;
+    }
+
+    /**
+     * Adds a file to the list of attachments.
+     *
+     * @param  string  $file       The file name of the file to attach
+     *                             OR the file data itself
+     * @param  string  $c_type     The content type
+     * @param  string  $name       The filename of the attachment
+     *                             Only use if $file is the file data
+     * @param  bool    $isFilename Whether $file is a filename or not
+     *                             Defaults to true
+     * @return mixed true on success or PEAR_Error object
+     * @access public
+     */
+    function addAttachment($file, $c_type = 'application/octet-stream',
+                           $name = '', $isfilename = true,
+                           $encoding = 'base64')
+    {
+        $filedata = ($isfilename === true) ? $this->_file2str($file)
+                                           : $file;
+        if ($isfilename === true) {
+            // Force the name the user supplied, otherwise use $file
+            $filename = (!empty($name)) ? $name : $file;
+        } else {
+            $filename = $name;
+        }
+        if (empty($filename)) {
+            return PEAR::raiseError(
+              'The supplied filename for the attachment can\'t be empty'
+            );
+        }
+        $filename = basename($filename);
+        if (PEAR::isError($filedata)) {
+            return $filedata;
+        }
+
+        $this->_parts[] = array(
+                                'body'     => $filedata,
+                                'name'     => $filename,
+                                'c_type'   => $c_type,
+                                'encoding' => $encoding
+                               );
+        return true;
+    }
+
+    /**
+     * Get the contents of the given file name as string
+     *
+     * @param  string  $file_name  path of file to process
+     * @return string  contents of $file_name
+     * @access private
+     */
+    function &_file2str($file_name)
+    {
+        if (!is_readable($file_name)) {
+            return PEAR::raiseError('File is not readable ' . $file_name);
+        }
+        if (!$fd = fopen($file_name, 'rb')) {
+            return PEAR::raiseError('Could not open ' . $file_name);
+        }
+        $filesize = filesize($file_name);
+        if ($filesize == 0){
+            $cont =  "";
+        }else{
+            $cont = fread($fd, $filesize);
+        }
+        fclose($fd);
+        return $cont;
+    }
+
+    /**
+     * Adds a text subpart to the mimePart object and
+     * returns it during the build process.
+     *
+     * @param mixed    The object to add the part to, or
+     *                 null if a new object is to be created.
+     * @param string   The text to add.
+     * @return object  The text mimePart object
+     * @access private
+     */
+    function &_addTextPart(&$obj, $text)
+    {
+        $params['content_type'] = 'text/plain';
+        $params['encoding']     = $this->_build_params['text_encoding'];
+        $params['charset']      = $this->_build_params['text_charset'];
+        if (is_object($obj)) {
+            return $obj->addSubpart($text, $params);
+        } else {
+            return new Mail_mimePart($text, $params);
+        }
+    }
+
+    /**
+     * Adds a html subpart to the mimePart object and
+     * returns it during the build process.
+     *
+     * @param  mixed   The object to add the part to, or
+     *                 null if a new object is to be created.
+     * @return object  The html mimePart object
+     * @access private
+     */
+    function &_addHtmlPart(&$obj)
+    {
+        $params['content_type'] = 'text/html';
+        $params['encoding']     = $this->_build_params['html_encoding'];
+        $params['charset']      = $this->_build_params['html_charset'];
+        if (is_object($obj)) {
+            return $obj->addSubpart($this->_htmlbody, $params);
+        } else {
+            return new Mail_mimePart($this->_htmlbody, $params);
+        }
+    }
+
+    /**
+     * Creates a new mimePart object, using multipart/mixed as
+     * the initial content-type and returns it during the
+     * build process.
+     *
+     * @return object  The multipart/mixed mimePart object
+     * @access private
+     */
+    function &_addMixedPart()
+    {
+        $params['content_type'] = 'multipart/mixed';
+        return new Mail_mimePart('', $params);
+    }
+
+    /**
+     * Adds a multipart/alternative part to a mimePart
+     * object (or creates one), and returns it during
+     * the build process.
+     *
+     * @param  mixed   The object to add the part to, or
+     *                 null if a new object is to be created.
+     * @return object  The multipart/mixed mimePart object
+     * @access private
+     */
+    function &_addAlternativePart(&$obj)
+    {
+        $params['content_type'] = 'multipart/alternative';
+        if (is_object($obj)) {
+            return $obj->addSubpart('', $params);
+        } else {
+            return new Mail_mimePart('', $params);
+        }
+    }
+
+    /**
+     * Adds a multipart/related part to a mimePart
+     * object (or creates one), and returns it during
+     * the build process.
+     *
+     * @param mixed    The object to add the part to, or
+     *                 null if a new object is to be created
+     * @return object  The multipart/mixed mimePart object
+     * @access private
+     */
+    function &_addRelatedPart(&$obj)
+    {
+        $params['content_type'] = 'multipart/related';
+        if (is_object($obj)) {
+            return $obj->addSubpart('', $params);
+        } else {
+            return new Mail_mimePart('', $params);
+        }
+    }
+
+    /**
+     * Adds an html image subpart to a mimePart object
+     * and returns it during the build process.
+     *
+     * @param  object  The mimePart to add the image to
+     * @param  array   The image information
+     * @return object  The image mimePart object
+     * @access private
+     */
+    function &_addHtmlImagePart(&$obj, $value)
+    {
+        $params['content_type'] = $value['c_type'];
+        $params['encoding']     = 'base64';
+        $params['disposition']  = 'inline';
+        $params['dfilename']    = $value['name'];
+        $params['cid']          = $value['cid'];
+        $obj->addSubpart($value['body'], $params);
+    }
+
+    /**
+     * Adds an attachment subpart to a mimePart object
+     * and returns it during the build process.
+     *
+     * @param  object  The mimePart to add the image to
+     * @param  array   The attachment information
+     * @return object  The image mimePart object
+     * @access private
+     */
+    function &_addAttachmentPart(&$obj, $value)
+    {
+        $params['content_type'] = $value['c_type'];
+        $params['encoding']     = $value['encoding'];
+        $params['disposition']  = 'attachment';
+        $params['dfilename']    = $value['name'];
+        $obj->addSubpart($value['body'], $params);
+    }
+
+    /**
+     * Builds the multipart message from the list ($this->_parts) and
+     * returns the mime content.
+     *
+     * @param  array  Build parameters that change the way the email
+     *                is built. Should be associative. Can contain:
+     *                text_encoding  -  What encoding to use for plain text
+     *                                  Default is 7bit
+     *                html_encoding  -  What encoding to use for html
+     *                                  Default is quoted-printable
+     *                7bit_wrap      -  Number of characters before text is
+     *                                  wrapped in 7bit encoding
+     *                                  Default is 998
+     *                html_charset   -  The character set to use for html.
+     *                                  Default is iso-8859-1
+     *                text_charset   -  The character set to use for text.
+     *                                  Default is iso-8859-1
+     *                head_charset   -  The character set to use for headers.
+     *                                  Default is iso-8859-1
+     * @return string The mime content
+     * @access public
+     */
+    function &get($build_params = null)
+    {
+        if (isset($build_params)) {
+            while (list($key, $value) = each($build_params)) {
+                $this->_build_params[$key] = $value;
+            }
+        }
+
+        if (!empty($this->_html_images) AND isset($this->_htmlbody)) {
+            foreach ($this->_html_images as $value) {
+                $regex = '#(\s)((?i)src|background|href(?-i))\s*=\s*(["\']?)' . preg_quote($value['name'], '#') .
+                         '\3#';
+                $rep = '\1\2=\3cid:' . $value['cid'] .'\3';
+                $this->_htmlbody = preg_replace($regex, $rep,
+                                       $this->_htmlbody
+                                   );
+            }
+        }
+
+        $null        = null;
+        $attachments = !empty($this->_parts)                ? true : false;
+        $html_images = !empty($this->_html_images)          ? true : false;
+        $html        = !empty($this->_htmlbody)             ? true : false;
+        $text        = (!$html AND !empty($this->_txtbody)) ? true : false;
+
+        switch (true) {
+        case $text AND !$attachments:
+            $message =& $this->_addTextPart($null, $this->_txtbody);
+            break;
+
+        case !$text AND !$html AND $attachments:
+            $message =& $this->_addMixedPart();
+            for ($i = 0; $i < count($this->_parts); $i++) {
+                $this->_addAttachmentPart($message, $this->_parts[$i]);
+            }
+            break;
+
+        case $text AND $attachments:
+            $message =& $this->_addMixedPart();
+            $this->_addTextPart($message, $this->_txtbody);
+            for ($i = 0; $i < count($this->_parts); $i++) {
+                $this->_addAttachmentPart($message, $this->_parts[$i]);
+            }
+            break;
+
+        case $html AND !$attachments AND !$html_images:
+            if (isset($this->_txtbody)) {
+                $message =& $this->_addAlternativePart($null);
+                $this->_addTextPart($message, $this->_txtbody);
+                $this->_addHtmlPart($message);
+            } else {
+                $message =& $this->_addHtmlPart($null);
+            }
+            break;
+
+        case $html AND !$attachments AND $html_images:
+            if (isset($this->_txtbody)) {
+                $message =& $this->_addAlternativePart($null);
+                $this->_addTextPart($message, $this->_txtbody);
+                $related =& $this->_addRelatedPart($message);
+            } else {
+                $message =& $this->_addRelatedPart($null);
+                $related =& $message;
+            }
+            $this->_addHtmlPart($related);
+            for ($i = 0; $i < count($this->_html_images); $i++) {
+                $this->_addHtmlImagePart($related, $this->_html_images[$i]);
+            }
+            break;
+
+        case $html AND $attachments AND !$html_images:
+            $message =& $this->_addMixedPart();
+            if (isset($this->_txtbody)) {
+                $alt =& $this->_addAlternativePart($message);
+                $this->_addTextPart($alt, $this->_txtbody);
+                $this->_addHtmlPart($alt);
+            } else {
+                $this->_addHtmlPart($message);
+            }
+            for ($i = 0; $i < count($this->_parts); $i++) {
+                $this->_addAttachmentPart($message, $this->_parts[$i]);
+            }
+            break;
+
+        case $html AND $attachments AND $html_images:
+            $message =& $this->_addMixedPart();
+            if (isset($this->_txtbody)) {
+                $alt =& $this->_addAlternativePart($message);
+                $this->_addTextPart($alt, $this->_txtbody);
+                $rel =& $this->_addRelatedPart($alt);
+            } else {
+                $rel =& $this->_addRelatedPart($message);
+            }
+            $this->_addHtmlPart($rel);
+            for ($i = 0; $i < count($this->_html_images); $i++) {
+                $this->_addHtmlImagePart($rel, $this->_html_images[$i]);
+            }
+            for ($i = 0; $i < count($this->_parts); $i++) {
+                $this->_addAttachmentPart($message, $this->_parts[$i]);
+            }
+            break;
+
+        }
+
+        if (isset($message)) {
+            $output = $message->encode();
+            $this->_headers = array_merge($this->_headers,
+                                          $output['headers']);
+            return $output['body'];
+
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Returns an array with the headers needed to prepend to the email
+     * (MIME-Version and Content-Type). Format of argument is:
+     * $array['header-name'] = 'header-value';
+     *
+     * @param  array $xtra_headers Assoc array with any extra headers.
+     *                             Optional.
+     * @return array Assoc array with the mime headers
+     * @access public
+     */
+    function &headers($xtra_headers = null)
+    {
+        // Content-Type header should already be present,
+        // So just add mime version header
+        $headers['MIME-Version'] = '1.0';
+        if (isset($xtra_headers)) {
+            $headers = array_merge($headers, $xtra_headers);
+        }
+        $this->_headers = array_merge($headers, $this->_headers);
+
+        return $this->_encodeHeaders($this->_headers);
+    }
+
+    /**
+     * Get the text version of the headers
+     * (usefull if you want to use the PHP mail() function)
+     *
+     * @param  array   $xtra_headers Assoc array with any extra headers.
+     *                               Optional.
+     * @return string  Plain text headers
+     * @access public
+     */
+    function txtHeaders($xtra_headers = null)
+    {
+        $headers = $this->headers($xtra_headers);
+        $ret = '';
+        foreach ($headers as $key => $val) {
+            $ret .= "$key: $val" . MAIL_MIME_CRLF;
+        }
+        return $ret;
+    }
+
+    /**
+     * Sets the Subject header
+     *
+     * @param  string $subject String to set the subject to
+     * access  public
+     */
+    function setSubject($subject)
+    {
+        $this->_headers['Subject'] = $subject;
+    }
+
+    /**
+     * Set an email to the From (the sender) header
+     *
+     * @param  string $email The email direction to add
+     * @access public
+     */
+    function setFrom($email)
+    {
+        $this->_headers['From'] = $email;
+    }
+
+    /**
+     * Add an email to the Cc (carbon copy) header
+     * (multiple calls to this method are allowed)
+     *
+     * @param  string $email The email direction to add
+     * @access public
+     */
+    function addCc($email)
+    {
+        if (isset($this->_headers['Cc'])) {
+            $this->_headers['Cc'] .= ", $email";
+        } else {
+            $this->_headers['Cc'] = $email;
+        }
+    }
+
+    /**
+     * Add an email to the Bcc (blank carbon copy) header
+     * (multiple calls to this method are allowed)
+     *
+     * @param  string $email The email direction to add
+     * @access public
+     */
+    function addBcc($email)
+    {
+        if (isset($this->_headers['Bcc'])) {
+            $this->_headers['Bcc'] .= ", $email";
+        } else {
+            $this->_headers['Bcc'] = $email;
+        }
+    }
+
+    /**
+     * Encodes a header as per RFC2047
+     *
+     * @param  string  $input The header data to encode
+     * @return string  Encoded data
+     * @access private
+     */
+    function _encodeHeaders($input)
+    {
+        foreach ($input as $hdr_name => $hdr_value) {
+            preg_match_all('/(\w*[\x80-\xFF]+\w*)/', $hdr_value, $matches);
+            foreach ($matches[1] as $value) {
+                $replacement = preg_replace('/([\x80-\xFF])/e',
+                                            '"=" .
+                                            strtoupper(dechex(ord("\1")))',
+                                            $value);
+                $hdr_value = str_replace($value, '=?' .
+                                         $this->_build_params['head_charset'] .
+                                         '?Q?' . $replacement . '?=',
+                                         $hdr_value);
+            }
+            $input[$hdr_name] = $hdr_value;
+        }
+
+        return $input;
+    }
+
+    /**
+     * Set the object's end-of-line and define the constant if applicable
+     *
+     * @param string $eol End Of Line sequence
+     * @access private
+     */
+    function _setEOL($eol)
+    {
+        $this->_eol = $eol;
+        if (!defined('MAIL_MIME_CRLF')) {
+            define('MAIL_MIME_CRLF', $this->_eol, true);
+        }
+    }
+
+    
+
+} // End of class
+?>

Added: trunk/direct.openmoko.com/pear/Mail/mimeDecode.php
===================================================================
--- trunk/direct.openmoko.com/pear/Mail/mimeDecode.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Mail/mimeDecode.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,837 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+// +-----------------------------------------------------------------------+
+// | Copyright (c) 2002-2003  Richard Heyes                                |
+// | Copyright (c) 2003-2005  The PHP Group                                |
+// | All rights reserved.                                                  |
+// |                                                                       |
+// | Redistribution and use in source and binary forms, with or without    |
+// | modification, are permitted provided that the following conditions    |
+// | are met:                                                              |
+// |                                                                       |
+// | o Redistributions of source code must retain the above copyright      |
+// |   notice, this list of conditions and the following disclaimer.       |
+// | o Redistributions in binary form must reproduce the above copyright   |
+// |   notice, this list of conditions and the following disclaimer in the |
+// |   documentation and/or other materials provided with the distribution.|
+// | o The names of the authors may not be used to endorse or promote      |
+// |   products derived from this software without specific prior written  |
+// |   permission.                                                         |
+// |                                                                       |
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |
+// |                                                                       |
+// +-----------------------------------------------------------------------+
+// | Author: Richard Heyes <richard at phpguru.org>                           |
+// +-----------------------------------------------------------------------+
+
+require_once 'PEAR.php';
+
+/**
+*  +----------------------------- IMPORTANT ------------------------------+
+*  | Usage of this class compared to native php extensions such as        |
+*  | mailparse or imap, is slow and may be feature deficient. If available|
+*  | you are STRONGLY recommended to use the php extensions.              |
+*  +----------------------------------------------------------------------+
+*
+* Mime Decoding class
+*
+* This class will parse a raw mime email and return
+* the structure. Returned structure is similar to
+* that returned by imap_fetchstructure().
+*
+* USAGE: (assume $input is your raw email)
+*
+* $decode = new Mail_mimeDecode($input, "\r\n");
+* $structure = $decode->decode();
+* print_r($structure);
+*
+* Or statically:
+*
+* $params['input'] = $input;
+* $structure = Mail_mimeDecode::decode($params);
+* print_r($structure);
+*
+* TODO:
+*  o Implement multipart/appledouble
+*  o UTF8: ???
+
+    > 4. We have also found a solution for decoding the UTF-8 
+    > headers. Therefore I made the following function:
+    > 
+    > function decode_utf8($txt) {
+    > $trans=array("Å&#8216;"=>"õ","ű"=>"û","Ő"=>"Ã&#8226;","Å°"
+    =>"Ã&#8250;");
+    > $txt=strtr($txt,$trans);
+    > return(utf8_decode($txt));
+    > }
+    > 
+    > And I have inserted the following line to the class:
+    > 
+    > if (strtolower($charset)=="utf-8") $text=decode_utf8($text);
+    > 
+    > ... before the following one in the "_decodeHeader" function:
+    > 
+    > $input = str_replace($encoded, $text, $input);
+    > 
+    > This way from now on it can easily decode the UTF-8 headers too.
+
+*
+* @author  Richard Heyes <richard at phpguru.org>
+* @version $Revision: 1.46 $
+* @package Mail
+*/
+class Mail_mimeDecode extends PEAR
+{
+    /**
+     * The raw email to decode
+     * @var    string
+     */
+    var $_input;
+
+    /**
+     * The header part of the input
+     * @var    string
+     */
+    var $_header;
+
+    /**
+     * The body part of the input
+     * @var    string
+     */
+    var $_body;
+
+    /**
+     * If an error occurs, this is used to store the message
+     * @var    string
+     */
+    var $_error;
+
+    /**
+     * Flag to determine whether to include bodies in the
+     * returned object.
+     * @var    boolean
+     */
+    var $_include_bodies;
+
+    /**
+     * Flag to determine whether to decode bodies
+     * @var    boolean
+     */
+    var $_decode_bodies;
+
+    /**
+     * Flag to determine whether to decode headers
+     * @var    boolean
+     */
+    var $_decode_headers;
+
+    /**
+     * Constructor.
+     *
+     * Sets up the object, initialise the variables, and splits and
+     * stores the header and body of the input.
+     *
+     * @param string The input to decode
+     * @access public
+     */
+    function Mail_mimeDecode($input)
+    {
+        list($header, $body)   = $this->_splitBodyHeader($input);
+
+        $this->_input          = $input;
+        $this->_header         = $header;
+        $this->_body           = $body;
+        $this->_decode_bodies  = false;
+        $this->_include_bodies = true;
+    }
+
+    /**
+     * Begins the decoding process. If called statically
+     * it will create an object and call the decode() method
+     * of it.
+     *
+     * @param array An array of various parameters that determine
+     *              various things:
+     *              include_bodies - Whether to include the body in the returned
+     *                               object.
+     *              decode_bodies  - Whether to decode the bodies
+     *                               of the parts. (Transfer encoding)
+     *              decode_headers - Whether to decode headers
+     *              input          - If called statically, this will be treated
+     *                               as the input
+     * @return object Decoded results
+     * @access public
+     */
+    function decode($params = null)
+    {
+        // determine if this method has been called statically
+        $isStatic = !(isset($this) && get_class($this) == __CLASS__);
+
+        // Have we been called statically?
+  // If so, create an object and pass details to that.
+        if ($isStatic AND isset($params['input'])) {
+
+            $obj = new Mail_mimeDecode($params['input']);
+            $structure = $obj->decode($params);
+
+        // Called statically but no input
+        } elseif ($isStatic) {
+            return PEAR::raiseError('Called statically and no input given');
+
+        // Called via an object
+        } else {
+            $this->_include_bodies = isset($params['include_bodies']) ?
+                               $params['include_bodies'] : false;
+            $this->_decode_bodies  = isset($params['decode_bodies']) ?
+                               $params['decode_bodies']  : false;
+            $this->_decode_headers = isset($params['decode_headers']) ?
+                               $params['decode_headers'] : false;
+
+            $structure = $this->_decode($this->_header, $this->_body);
+            if ($structure === false) {
+                $structure = $this->raiseError($this->_error);
+            }
+        }
+
+        return $structure;
+    }
+
+    /**
+     * Performs the decoding. Decodes the body string passed to it
+     * If it finds certain content-types it will call itself in a
+     * recursive fashion
+     *
+     * @param string Header section
+     * @param string Body section
+     * @return object Results of decoding process
+     * @access private
+     */
+    function _decode($headers, $body, $default_ctype = 'text/plain')
+    {
+        $return = new stdClass;
+        $return->headers = array();
+        $headers = $this->_parseHeaders($headers);
+
+        foreach ($headers as $value) {
+            if (isset($return->headers[strtolower($value['name'])]) AND !is_array($return->headers[strtolower($value['name'])])) {
+                $return->headers[strtolower($value['name'])]   = array($return->headers[strtolower($value['name'])]);
+                $return->headers[strtolower($value['name'])][] = $value['value'];
+
+            } elseif (isset($return->headers[strtolower($value['name'])])) {
+                $return->headers[strtolower($value['name'])][] = $value['value'];
+
+            } else {
+                $return->headers[strtolower($value['name'])] = $value['value'];
+            }
+        }
+
+        reset($headers);
+        while (list($key, $value) = each($headers)) {
+            $headers[$key]['name'] = strtolower($headers[$key]['name']);
+            switch ($headers[$key]['name']) {
+
+                case 'content-type':
+                    $content_type = $this->_parseHeaderValue($headers[$key]['value']);
+
+                    if (preg_match('/([0-9a-z+.-]+)\/([0-9a-z+.-]+)/i', $content_type['value'], $regs)) {
+                        $return->ctype_primary   = $regs[1];
+                        $return->ctype_secondary = $regs[2];
+                    }
+
+                    if (isset($content_type['other'])) {
+                        while (list($p_name, $p_value) = each($content_type['other'])) {
+                            $return->ctype_parameters[$p_name] = $p_value;
+                        }
+                    }
+                    break;
+
+                case 'content-disposition':
+                    $content_disposition = $this->_parseHeaderValue($headers[$key]['value']);
+                    $return->disposition   = $content_disposition['value'];
+                    if (isset($content_disposition['other'])) {
+                        while (list($p_name, $p_value) = each($content_disposition['other'])) {
+                            $return->d_parameters[$p_name] = $p_value;
+                        }
+                    }
+                    break;
+
+                case 'content-transfer-encoding':
+                    $content_transfer_encoding = $this->_parseHeaderValue($headers[$key]['value']);
+                    break;
+            }
+        }
+
+        if (isset($content_type)) {
+            switch (strtolower($content_type['value'])) {
+                case 'text/plain':
+                    $encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
+                    $this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body) : null;
+                    break;
+
+                case 'text/html':
+                    $encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
+                    $this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body) : null;
+                    break;
+
+                case 'multipart/parallel':
+                case 'multipart/report': // RFC1892
+                case 'multipart/signed': // PGP
+                case 'multipart/digest':
+                case 'multipart/alternative':
+                case 'multipart/related':
+                case 'multipart/mixed':
+                    if(!isset($content_type['other']['boundary'])){
+                        $this->_error = 'No boundary found for ' . $content_type['value'] . ' part';
+                        return false;
+                    }
+
+                    $default_ctype = (strtolower($content_type['value']) === 'multipart/digest') ? 'message/rfc822' : 'text/plain';
+
+                    $parts = $this->_boundarySplit($body, $content_type['other']['boundary']);
+                    for ($i = 0; $i < count($parts); $i++) {
+                        list($part_header, $part_body) = $this->_splitBodyHeader($parts[$i]);
+                        $part = $this->_decode($part_header, $part_body, $default_ctype);
+                        if($part === false)
+                            $part = $this->raiseError($this->_error);
+                        $return->parts[] = $part;
+                    }
+                    break;
+
+                case 'message/rfc822':
+                    $obj = &new Mail_mimeDecode($body);
+                    $return->parts[] = $obj->decode(array('include_bodies' => $this->_include_bodies,
+                                                'decode_bodies'  => $this->_decode_bodies,
+                              'decode_headers' => $this->_decode_headers));
+                    unset($obj);
+                    break;
+
+                default:
+                    if(!isset($content_transfer_encoding['value']))
+                        $content_transfer_encoding['value'] = '7bit';
+                    $this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $content_transfer_encoding['value']) : $body) : null;
+                    break;
+            }
+
+        } else {
+            $ctype = explode('/', $default_ctype);
+            $return->ctype_primary   = $ctype[0];
+            $return->ctype_secondary = $ctype[1];
+            $this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body) : $body) : null;
+        }
+
+        return $return;
+    }
+
+    /**
+     * Given the output of the above function, this will return an
+     * array of references to the parts, indexed by mime number.
+     *
+     * @param  object $structure   The structure to go through
+     * @param  string $mime_number Internal use only.
+     * @return array               Mime numbers
+     */
+    function &getMimeNumbers(&$structure, $no_refs = false, $mime_number = '', $prepend = '')
+    {
+        $return = array();
+        if (!empty($structure->parts)) {
+            if ($mime_number != '') {
+                $structure->mime_id = $prepend . $mime_number;
+                $return[$prepend . $mime_number] = &$structure;
+            }
+            for ($i = 0; $i < count($structure->parts); $i++) {
+
+            
+                if (!empty($structure->headers['content-type']) AND substr(strtolower($structure->headers['content-type']), 0, 8) == 'message/') {
+                    $prepend      = $prepend . $mime_number . '.';
+                    $_mime_number = '';
+                } else {
+                    $_mime_number = ($mime_number == '' ? $i + 1 : sprintf('%s.%s', $mime_number, $i + 1));
+                }
+
+                $arr = &Mail_mimeDecode::getMimeNumbers($structure->parts[$i], $no_refs, $_mime_number, $prepend);
+                foreach ($arr as $key => $val) {
+                    $no_refs ? $return[$key] = '' : $return[$key] = &$arr[$key];
+                }
+            }
+        } else {
+            if ($mime_number == '') {
+                $mime_number = '1';
+            }
+            $structure->mime_id = $prepend . $mime_number;
+            $no_refs ? $return[$prepend . $mime_number] = '' : $return[$prepend . $mime_number] = &$structure;
+        }
+        
+        return $return;
+    }
+
+    /**
+     * Given a string containing a header and body
+     * section, this function will split them (at the first
+     * blank line) and return them.
+     *
+     * @param string Input to split apart
+     * @return array Contains header and body section
+     * @access private
+     */
+    function _splitBodyHeader($input)
+    {
+        if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $input, $match)) {
+            return array($match[1], $match[2]);
+        }
+        $this->_error = 'Could not split header and body';
+        return false;
+    }
+
+    /**
+     * Parse headers given in $input and return
+     * as assoc array.
+     *
+     * @param string Headers to parse
+     * @return array Contains parsed headers
+     * @access private
+     */
+    function _parseHeaders($input)
+    {
+
+        if ($input !== '') {
+            // Unfold the input
+            $input   = preg_replace("/\r?\n/", "\r\n", $input);
+            $input   = preg_replace("/\r\n(\t| )+/", ' ', $input);
+            $headers = explode("\r\n", trim($input));
+
+            foreach ($headers as $value) {
+                $hdr_name = substr($value, 0, $pos = strpos($value, ':'));
+                $hdr_value = substr($value, $pos+1);
+                if($hdr_value[0] == ' ')
+                    $hdr_value = substr($hdr_value, 1);
+
+                $return[] = array(
+                                  'name'  => $hdr_name,
+                                  'value' => $this->_decode_headers ? $this->_decodeHeader($hdr_value) : $hdr_value
+                                 );
+            }
+        } else {
+            $return = array();
+        }
+
+        return $return;
+    }
+
+    /**
+     * Function to parse a header value,
+     * extract first part, and any secondary
+     * parts (after ;) This function is not as
+     * robust as it could be. Eg. header comments
+     * in the wrong place will probably break it.
+     *
+     * @param string Header value to parse
+     * @return array Contains parsed result
+     * @access private
+     */
+    function _parseHeaderValue($input)
+    {
+
+        if (($pos = strpos($input, ';')) !== false) {
+
+            $return['value'] = trim(substr($input, 0, $pos));
+            $input = trim(substr($input, $pos+1));
+
+            if (strlen($input) > 0) {
+
+                // This splits on a semi-colon, if there's no preceeding backslash
+                // Now works with quoted values; had to glue the \; breaks in PHP
+                // the regex is already bordering on incomprehensible
+                $splitRegex = '/([^;\'"]*[\'"]([^\'"]*([^\'"]*)*)[\'"][^;\'"]*|([^;]+))(;|$)/';
+                preg_match_all($splitRegex, $input, $matches);
+                $parameters = array();
+                for ($i=0; $i<count($matches[0]); $i++) {
+                    $param = $matches[0][$i];
+                    while (substr($param, -2) == '\;') {
+                        $param .= $matches[0][++$i];
+                    }
+                    $parameters[] = $param;
+                }
+
+                for ($i = 0; $i < count($parameters); $i++) {
+                    $param_name  = trim(substr($parameters[$i], 0, $pos = strpos($parameters[$i], '=')), "'\";\t\\ ");
+                    $param_value = trim(str_replace('\;', ';', substr($parameters[$i], $pos + 1)), "'\";\t\\ ");
+                    if ($param_value[0] == '"') {
+                        $param_value = substr($param_value, 1, -1);
+                    }
+                    $return['other'][$param_name] = $param_value;
+                    $return['other'][strtolower($param_name)] = $param_value;
+                }
+            }
+        } else {
+            $return['value'] = trim($input);
+        }
+
+        return $return;
+    }
+
+    /**
+     * This function splits the input based
+     * on the given boundary
+     *
+     * @param string Input to parse
+     * @return array Contains array of resulting mime parts
+     * @access private
+     */
+    function _boundarySplit($input, $boundary)
+    {
+        $parts = array();
+
+        $bs_possible = substr($boundary, 2, -2);
+        $bs_check = '\"' . $bs_possible . '\"';
+
+        if ($boundary == $bs_check) {
+            $boundary = $bs_possible;
+        }
+
+        $tmp = explode('--' . $boundary, $input);
+
+        for ($i = 1; $i < count($tmp) - 1; $i++) {
+            $parts[] = $tmp[$i];
+        }
+
+        return $parts;
+    }
+
+    /**
+     * Given a header, this function will decode it
+     * according to RFC2047. Probably not *exactly*
+     * conformant, but it does pass all the given
+     * examples (in RFC2047).
+     *
+     * @param string Input header value to decode
+     * @return string Decoded header value
+     * @access private
+     */
+    function _decodeHeader($input)
+    {
+        // Remove white space between encoded-words
+        $input = preg_replace('/(=\?[^?]+\?(q|b)\?[^?]*\?=)(\s)+=\?/i', '\1=?', $input);
+
+        // For each encoded-word...
+        while (preg_match('/(=\?([^?]+)\?(q|b)\?([^?]*)\?=)/i', $input, $matches)) {
+
+            $encoded  = $matches[1];
+            $charset  = $matches[2];
+            $encoding = $matches[3];
+            $text     = $matches[4];
+
+            switch (strtolower($encoding)) {
+                case 'b':
+                    $text = base64_decode($text);
+                    break;
+
+                case 'q':
+                    $text = str_replace('_', ' ', $text);
+                    preg_match_all('/=([a-f0-9]{2})/i', $text, $matches);
+                    foreach($matches[1] as $value)
+                        $text = str_replace('='.$value, chr(hexdec($value)), $text);
+                    break;
+            }
+
+            $input = str_replace($encoded, $text, $input);
+        }
+
+        return $input;
+    }
+
+    /**
+     * Given a body string and an encoding type,
+     * this function will decode and return it.
+     *
+     * @param  string Input body to decode
+     * @param  string Encoding type to use.
+     * @return string Decoded body
+     * @access private
+     */
+    function _decodeBody($input, $encoding = '7bit')
+    {
+        switch (strtolower($encoding)) {
+            case '7bit':
+                return $input;
+                break;
+
+            case 'quoted-printable':
+                return $this->_quotedPrintableDecode($input);
+                break;
+
+            case 'base64':
+                return base64_decode($input);
+                break;
+
+            default:
+                return $input;
+        }
+    }
+
+    /**
+     * Given a quoted-printable string, this
+     * function will decode and return it.
+     *
+     * @param  string Input body to decode
+     * @return string Decoded body
+     * @access private
+     */
+    function _quotedPrintableDecode($input)
+    {
+        // Remove soft line breaks
+        $input = preg_replace("/=\r?\n/", '', $input);
+
+        // Replace encoded characters
+    $input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input);
+
+        return $input;
+    }
+
+    /**
+     * Checks the input for uuencoded files and returns
+     * an array of them. Can be called statically, eg:
+     *
+     * $files =& Mail_mimeDecode::uudecode($some_text);
+     *
+     * It will check for the begin 666 ... end syntax
+     * however and won't just blindly decode whatever you
+     * pass it.
+     *
+     * @param  string Input body to look for attahcments in
+     * @return array  Decoded bodies, filenames and permissions
+     * @access public
+     * @author Unknown
+     */
+    function &uudecode($input)
+    {
+        // Find all uuencoded sections
+        preg_match_all("/begin ([0-7]{3}) (.+)\r?\n(.+)\r?\nend/Us", $input, $matches);
+
+        for ($j = 0; $j < count($matches[3]); $j++) {
+
+            $str      = $matches[3][$j];
+            $filename = $matches[2][$j];
+            $fileperm = $matches[1][$j];
+
+            $file = '';
+            $str = preg_split("/\r?\n/", trim($str));
+            $strlen = count($str);
+
+            for ($i = 0; $i < $strlen; $i++) {
+                $pos = 1;
+                $d = 0;
+                $len=(int)(((ord(substr($str[$i],0,1)) -32) - ' ') & 077);
+
+                while (($d + 3 <= $len) AND ($pos + 4 <= strlen($str[$i]))) {
+                    $c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20);
+                    $c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20);
+                    $c2 = (ord(substr($str[$i],$pos+2,1)) ^ 0x20);
+                    $c3 = (ord(substr($str[$i],$pos+3,1)) ^ 0x20);
+                    $file .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4));
+
+                    $file .= chr(((($c1 - ' ') & 077) << 4) | ((($c2 - ' ') & 077) >> 2));
+
+                    $file .= chr(((($c2 - ' ') & 077) << 6) |  (($c3 - ' ') & 077));
+
+                    $pos += 4;
+                    $d += 3;
+                }
+
+                if (($d + 2 <= $len) && ($pos + 3 <= strlen($str[$i]))) {
+                    $c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20);
+                    $c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20);
+                    $c2 = (ord(substr($str[$i],$pos+2,1)) ^ 0x20);
+                    $file .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4));
+
+                    $file .= chr(((($c1 - ' ') & 077) << 4) | ((($c2 - ' ') & 077) >> 2));
+
+                    $pos += 3;
+                    $d += 2;
+                }
+
+                if (($d + 1 <= $len) && ($pos + 2 <= strlen($str[$i]))) {
+                    $c0 = (ord(substr($str[$i],$pos,1)) ^ 0x20);
+                    $c1 = (ord(substr($str[$i],$pos+1,1)) ^ 0x20);
+                    $file .= chr(((($c0 - ' ') & 077) << 2) | ((($c1 - ' ') & 077) >> 4));
+
+                }
+            }
+            $files[] = array('filename' => $filename, 'fileperm' => $fileperm, 'filedata' => $file);
+        }
+
+        return $files;
+    }
+
+    /**
+     * getSendArray() returns the arguments required for Mail::send()
+     * used to build the arguments for a mail::send() call 
+     *
+     * Usage:
+     * $mailtext = Full email (for example generated by a template)
+     * $decoder = new Mail_mimeDecode($mailtext);
+     * $parts =  $decoder->getSendArray();
+     * if (!PEAR::isError($parts) {
+     *     list($recipents,$headers,$body) = $parts;
+     *     $mail = Mail::factory('smtp');
+     *     $mail->send($recipents,$headers,$body);
+     * } else {
+     *     echo $parts->message;
+     * }
+     * @return mixed   array of recipeint, headers,body or Pear_Error
+     * @access public
+     * @author Alan Knowles <alan at akbkhome.com>
+     */
+    function getSendArray()
+    {
+        // prevent warning if this is not set
+        $this->_decode_headers = FALSE;
+        $headerlist =$this->_parseHeaders($this->_header);
+        $to = "";
+        if (!$headerlist) {
+            return $this->raiseError("Message did not contain headers");
+        }
+        foreach($headerlist as $item) {
+            $header[$item['name']] = $item['value'];
+            switch (strtolower($item['name'])) {
+                case "to":
+                case "cc":
+                case "bcc":
+                    $to = ",".$item['value'];
+                default:
+                   break;
+            }
+        }
+        if ($to == "") {
+            return $this->raiseError("Message did not contain any recipents");
+        }
+        $to = substr($to,1);
+        return array($to,$header,$this->_body);
+    } 
+
+    /**
+     * Returns a xml copy of the output of
+     * Mail_mimeDecode::decode. Pass the output in as the
+     * argument. This function can be called statically. Eg:
+     *
+     * $output = $obj->decode();
+     * $xml    = Mail_mimeDecode::getXML($output);
+     *
+     * The DTD used for this should have been in the package. Or
+     * alternatively you can get it from cvs, or here:
+     * http://www.phpguru.org/xmail/xmail.dtd.
+     *
+     * @param  object Input to convert to xml. This should be the
+     *                output of the Mail_mimeDecode::decode function
+     * @return string XML version of input
+     * @access public
+     */
+    function getXML($input)
+    {
+        $crlf    =  "\r\n";
+        $output  = '<?xml version=\'1.0\'?>' . $crlf .
+                   '<!DOCTYPE email SYSTEM "http://www.phpguru.org/xmail/xmail.dtd">' . $crlf .
+                   '<email>' . $crlf .
+                   Mail_mimeDecode::_getXML($input) .
+                   '</email>';
+
+        return $output;
+    }
+
+    /**
+     * Function that does the actual conversion to xml. Does a single
+     * mimepart at a time.
+     *
+     * @param  object  Input to convert to xml. This is a mimepart object.
+     *                 It may or may not contain subparts.
+     * @param  integer Number of tabs to indent
+     * @return string  XML version of input
+     * @access private
+     */
+    function _getXML($input, $indent = 1)
+    {
+        $htab    =  "\t";
+        $crlf    =  "\r\n";
+        $output  =  '';
+        $headers = @(array)$input->headers;
+
+        foreach ($headers as $hdr_name => $hdr_value) {
+
+            // Multiple headers with this name
+            if (is_array($headers[$hdr_name])) {
+                for ($i = 0; $i < count($hdr_value); $i++) {
+                    $output .= Mail_mimeDecode::_getXML_helper($hdr_name, $hdr_value[$i], $indent);
+                }
+
+            // Only one header of this sort
+            } else {
+                $output .= Mail_mimeDecode::_getXML_helper($hdr_name, $hdr_value, $indent);
+            }
+        }
+
+        if (!empty($input->parts)) {
+            for ($i = 0; $i < count($input->parts); $i++) {
+                $output .= $crlf . str_repeat($htab, $indent) . '<mimepart>' . $crlf .
+                           Mail_mimeDecode::_getXML($input->parts[$i], $indent+1) .
+                           str_repeat($htab, $indent) . '</mimepart>' . $crlf;
+            }
+        } elseif (isset($input->body)) {
+            $output .= $crlf . str_repeat($htab, $indent) . '<body><![CDATA[' .
+                       $input->body . ']]></body>' . $crlf;
+        }
+
+        return $output;
+    }
+
+    /**
+     * Helper function to _getXML(). Returns xml of a header.
+     *
+     * @param  string  Name of header
+     * @param  string  Value of header
+     * @param  integer Number of tabs to indent
+     * @return string  XML version of input
+     * @access private
+     */
+    function _getXML_helper($hdr_name, $hdr_value, $indent)
+    {
+        $htab   = "\t";
+        $crlf   = "\r\n";
+        $return = '';
+
+        $new_hdr_value = ($hdr_name != 'received') ? Mail_mimeDecode::_parseHeaderValue($hdr_value) : array('value' => $hdr_value);
+        $new_hdr_name  = str_replace(' ', '-', ucwords(str_replace('-', ' ', $hdr_name)));
+
+        // Sort out any parameters
+        if (!empty($new_hdr_value['other'])) {
+            foreach ($new_hdr_value['other'] as $paramname => $paramvalue) {
+                $params[] = str_repeat($htab, $indent) . $htab . '<parameter>' . $crlf .
+                            str_repeat($htab, $indent) . $htab . $htab . '<paramname>' . htmlspecialchars($paramname) . '</paramname>' . $crlf .
+                            str_repeat($htab, $indent) . $htab . $htab . '<paramvalue>' . htmlspecialchars($paramvalue) . '</paramvalue>' . $crlf .
+                            str_repeat($htab, $indent) . $htab . '</parameter>' . $crlf;
+            }
+
+            $params = implode('', $params);
+        } else {
+            $params = '';
+        }
+
+        $return = str_repeat($htab, $indent) . '<header>' . $crlf .
+                  str_repeat($htab, $indent) . $htab . '<headername>' . htmlspecialchars($new_hdr_name) . '</headername>' . $crlf .
+                  str_repeat($htab, $indent) . $htab . '<headervalue>' . htmlspecialchars($new_hdr_value['value']) . '</headervalue>' . $crlf .
+                  $params .
+                  str_repeat($htab, $indent) . '</header>' . $crlf;
+
+        return $return;
+    }
+
+} // End of class
+?>

Added: trunk/direct.openmoko.com/pear/Mail/mimePart.php
===================================================================
--- trunk/direct.openmoko.com/pear/Mail/mimePart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Mail/mimePart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,351 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Copyright (c) 2002-2003  Richard Heyes                                     |
+// | All rights reserved.                                                  |
+// |                                                                       |
+// | Redistribution and use in source and binary forms, with or without    |
+// | modification, are permitted provided that the following conditions    |
+// | are met:                                                              |
+// |                                                                       |
+// | o Redistributions of source code must retain the above copyright      |
+// |   notice, this list of conditions and the following disclaimer.       |
+// | o Redistributions in binary form must reproduce the above copyright   |
+// |   notice, this list of conditions and the following disclaimer in the |
+// |   documentation and/or other materials provided with the distribution.|
+// | o The names of the authors may not be used to endorse or promote      |
+// |   products derived from this software without specific prior written  |
+// |   permission.                                                         |
+// |                                                                       |
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |
+// |                                                                       |
+// +-----------------------------------------------------------------------+
+// | Author: Richard Heyes <richard at phpguru.org>                           |
+// +-----------------------------------------------------------------------+
+
+/**
+*
+*  Raw mime encoding class
+*
+* What is it?
+*   This class enables you to manipulate and build
+*   a mime email from the ground up.
+*
+* Why use this instead of mime.php?
+*   mime.php is a userfriendly api to this class for
+*   people who aren't interested in the internals of
+*   mime mail. This class however allows full control
+*   over the email.
+*
+* Eg.
+*
+* // Since multipart/mixed has no real body, (the body is
+* // the subpart), we set the body argument to blank.
+*
+* $params['content_type'] = 'multipart/mixed';
+* $email = new Mail_mimePart('', $params);
+*
+* // Here we add a text part to the multipart we have
+* // already. Assume $body contains plain text.
+*
+* $params['content_type'] = 'text/plain';
+* $params['encoding']     = '7bit';
+* $text = $email->addSubPart($body, $params);
+*
+* // Now add an attachment. Assume $attach is
+* the contents of the attachment
+*
+* $params['content_type'] = 'application/zip';
+* $params['encoding']     = 'base64';
+* $params['disposition']  = 'attachment';
+* $params['dfilename']    = 'example.zip';
+* $attach =& $email->addSubPart($body, $params);
+*
+* // Now build the email. Note that the encode
+* // function returns an associative array containing two
+* // elements, body and headers. You will need to add extra
+* // headers, (eg. Mime-Version) before sending.
+*
+* $email = $message->encode();
+* $email['headers'][] = 'Mime-Version: 1.0';
+*
+*
+* Further examples are available at http://www.phpguru.org
+*
+* TODO:
+*  - Set encode() to return the $obj->encoded if encode()
+*    has already been run. Unless a flag is passed to specifically
+*    re-build the message.
+*
+* @author  Richard Heyes <richard at phpguru.org>
+* @version $Revision: 1.13 $
+* @package Mail
+*/
+
+class Mail_mimePart {
+
+   /**
+    * The encoding type of this part
+    * @var string
+    */
+    var $_encoding;
+
+   /**
+    * An array of subparts
+    * @var array
+    */
+    var $_subparts;
+
+   /**
+    * The output of this part after being built
+    * @var string
+    */
+    var $_encoded;
+
+   /**
+    * Headers for this part
+    * @var array
+    */
+    var $_headers;
+
+   /**
+    * The body of this part (not encoded)
+    * @var string
+    */
+    var $_body;
+
+    /**
+     * Constructor.
+     *
+     * Sets up the object.
+     *
+     * @param $body   - The body of the mime part if any.
+     * @param $params - An associative array of parameters:
+     *                  content_type - The content type for this part eg multipart/mixed
+     *                  encoding     - The encoding to use, 7bit, 8bit, base64, or quoted-printable
+     *                  cid          - Content ID to apply
+     *                  disposition  - Content disposition, inline or attachment
+     *                  dfilename    - Optional filename parameter for content disposition
+     *                  description  - Content description
+     *                  charset      - Character set to use
+     * @access public
+     */
+    function Mail_mimePart($body = '', $params = array())
+    {
+        if (!defined('MAIL_MIMEPART_CRLF')) {
+            define('MAIL_MIMEPART_CRLF', defined('MAIL_MIME_CRLF') ? MAIL_MIME_CRLF : "\r\n", TRUE);
+        }
+
+        foreach ($params as $key => $value) {
+            switch ($key) {
+                case 'content_type':
+                    $headers['Content-Type'] = $value . (isset($charset) ? '; charset="' . $charset . '"' : '');
+                    break;
+
+                case 'encoding':
+                    $this->_encoding = $value;
+                    $headers['Content-Transfer-Encoding'] = $value;
+                    break;
+
+                case 'cid':
+                    $headers['Content-ID'] = '<' . $value . '>';
+                    break;
+
+                case 'disposition':
+                    $headers['Content-Disposition'] = $value . (isset($dfilename) ? '; filename="' . $dfilename . '"' : '');
+                    break;
+
+                case 'dfilename':
+                    if (isset($headers['Content-Disposition'])) {
+                        $headers['Content-Disposition'] .= '; filename="' . $value . '"';
+                    } else {
+                        $dfilename = $value;
+                    }
+                    break;
+
+                case 'description':
+                    $headers['Content-Description'] = $value;
+                    break;
+
+                case 'charset':
+                    if (isset($headers['Content-Type'])) {
+                        $headers['Content-Type'] .= '; charset="' . $value . '"';
+                    } else {
+                        $charset = $value;
+                    }
+                    break;
+            }
+        }
+
+        // Default content-type
+        if (!isset($headers['Content-Type'])) {
+            $headers['Content-Type'] = 'text/plain';
+        }
+
+        //Default encoding
+        if (!isset($this->_encoding)) {
+            $this->_encoding = '7bit';
+        }
+
+        // Assign stuff to member variables
+        $this->_encoded  = array();
+        $this->_headers  = $headers;
+        $this->_body     = $body;
+    }
+
+    /**
+     * encode()
+     *
+     * Encodes and returns the email. Also stores
+     * it in the encoded member variable
+     *
+     * @return An associative array containing two elements,
+     *         body and headers. The headers element is itself
+     *         an indexed array.
+     * @access public
+     */
+    function encode()
+    {
+        $encoded =& $this->_encoded;
+
+        if (!empty($this->_subparts)) {
+            srand((double)microtime()*1000000);
+            $boundary = '=_' . md5(rand() . microtime());
+            $this->_headers['Content-Type'] .= ';' . MAIL_MIMEPART_CRLF . "\t" . 'boundary="' . $boundary . '"';
+
+            // Add body parts to $subparts
+            for ($i = 0; $i < count($this->_subparts); $i++) {
+                $headers = array();
+                $tmp = $this->_subparts[$i]->encode();
+                foreach ($tmp['headers'] as $key => $value) {
+                    $headers[] = $key . ': ' . $value;
+                }
+                $subparts[] = implode(MAIL_MIMEPART_CRLF, $headers) . MAIL_MIMEPART_CRLF . MAIL_MIMEPART_CRLF . $tmp['body'];
+            }
+
+            $encoded['body'] = '--' . $boundary . MAIL_MIMEPART_CRLF .
+                               implode('--' . $boundary . MAIL_MIMEPART_CRLF, $subparts) .
+                               '--' . $boundary.'--' . MAIL_MIMEPART_CRLF;
+
+        } else {
+            $encoded['body'] = $this->_getEncodedData($this->_body, $this->_encoding) . MAIL_MIMEPART_CRLF;
+        }
+
+        // Add headers to $encoded
+        $encoded['headers'] =& $this->_headers;
+
+        return $encoded;
+    }
+
+    /**
+     * &addSubPart()
+     *
+     * Adds a subpart to current mime part and returns
+     * a reference to it
+     *
+     * @param $body   The body of the subpart, if any.
+     * @param $params The parameters for the subpart, same
+     *                as the $params argument for constructor.
+     * @return A reference to the part you just added. It is
+     *         crucial if using multipart/* in your subparts that
+     *         you use =& in your script when calling this function,
+     *         otherwise you will not be able to add further subparts.
+     * @access public
+     */
+    function &addSubPart($body, $params)
+    {
+        $this->_subparts[] = new Mail_mimePart($body, $params);
+        return $this->_subparts[count($this->_subparts) - 1];
+    }
+
+    /**
+     * _getEncodedData()
+     *
+     * Returns encoded data based upon encoding passed to it
+     *
+     * @param $data     The data to encode.
+     * @param $encoding The encoding type to use, 7bit, base64,
+     *                  or quoted-printable.
+     * @access private
+     */
+    function _getEncodedData($data, $encoding)
+    {
+        switch ($encoding) {
+            case '8bit':
+            case '7bit':
+                return $data;
+                break;
+
+            case 'quoted-printable':
+                return $this->_quotedPrintableEncode($data);
+                break;
+
+            case 'base64':
+                return rtrim(chunk_split(base64_encode($data), 76, MAIL_MIMEPART_CRLF));
+                break;
+
+            default:
+                return $data;
+        }
+    }
+
+    /**
+     * quoteadPrintableEncode()
+     *
+     * Encodes data to quoted-printable standard.
+     *
+     * @param $input    The data to encode
+     * @param $line_max Optional max line length. Should
+     *                  not be more than 76 chars
+     *
+     * @access private
+     */
+    function _quotedPrintableEncode($input , $line_max = 76)
+    {
+        $lines  = preg_split("/\r?\n/", $input);
+        $eol    = MAIL_MIMEPART_CRLF;
+        $escape = '=';
+        $output = '';
+
+        while(list(, $line) = each($lines)){
+
+            $linlen     = strlen($line);
+            $newline = '';
+
+            for ($i = 0; $i < $linlen; $i++) {
+                $char = substr($line, $i, 1);
+                $dec  = ord($char);
+
+                if (($dec == 32) AND ($i == ($linlen - 1))){    // convert space at eol only
+                    $char = '=20';
+
+                } elseif(($dec == 9) AND ($i == ($linlen - 1))) {  // convert tab at eol only
+                    $char = '=09';
+                } elseif($dec == 9) {
+                    ; // Do nothing if a tab.
+                } elseif(($dec == 61) OR ($dec < 32 ) OR ($dec > 126)) {
+                    $char = $escape . strtoupper(sprintf('%02s', dechex($dec)));
+                }
+
+                if ((strlen($newline) + strlen($char)) >= $line_max) {        // MAIL_MIMEPART_CRLF is not counted
+                    $output  .= $newline . $escape . $eol;                    // soft line break; " =\r\n" is okay
+                    $newline  = '';
+                }
+                $newline .= $char;
+            } // end of for
+            $output .= $newline . $eol;
+        }
+        $output = substr($output, 0, -1 * strlen($eol)); // Don't want last crlf
+        return $output;
+    }
+} // End of class
+?>

Added: trunk/direct.openmoko.com/pear/Mail/smtp.php
===================================================================
--- trunk/direct.openmoko.com/pear/Mail/smtp.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Mail/smtp.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,323 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Chuck Hagenbuch <chuck at horde.org>                           |
+// |          Jon Parise <jon at php.net>                                    |
+// +----------------------------------------------------------------------+
+
+/**
+ * SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
+ * @access public
+ * @package Mail
+ * @version $Revision: 1.25 $
+ */
+class Mail_smtp extends Mail {
+
+    /**
+     * SMTP connection object.
+     *
+     * @var object
+     * @access private
+     */
+    var $_smtp = null;
+
+    /**
+     * The SMTP host to connect to.
+     * @var string
+     */
+    var $host = 'localhost';
+
+    /**
+     * The port the SMTP server is on.
+     * @var integer
+     */
+    var $port = 25;
+
+    /**
+     * Should SMTP authentication be used?
+     *
+     * This value may be set to true, false or the name of a specific
+     * authentication method.
+     *
+     * If the value is set to true, the Net_SMTP package will attempt to use
+     * the best authentication method advertised by the remote SMTP server.
+     *
+     * @var mixed
+     */
+    var $auth = false;
+
+    /**
+     * The username to use if the SMTP server requires authentication.
+     * @var string
+     */
+    var $username = '';
+
+    /**
+     * The password to use if the SMTP server requires authentication.
+     * @var string
+     */
+    var $password = '';
+
+    /**
+     * Hostname or domain that will be sent to the remote SMTP server in the
+     * HELO / EHLO message.
+     *
+     * @var string
+     */
+    var $localhost = 'localhost';
+
+    /**
+     * SMTP connection timeout value.  NULL indicates no timeout.
+     *
+     * @var integer
+     */
+    var $timeout = null;
+
+    /**
+     * Whether to use VERP or not. If not a boolean, the string value
+     * will be used as the VERP separators.
+     *
+     * @var mixed boolean or string
+     */
+    var $verp = false;
+
+    /**
+     * Turn on Net_SMTP debugging?
+     *
+     * @var boolean $debug
+     */
+    var $debug = false;
+
+    /**
+     * Indicates whether or not the SMTP connection should persist over
+     * multiple calls to the send() method.
+     *
+     * @var boolean
+     */
+    var $persist = false;
+
+    /**
+     * Constructor.
+     *
+     * Instantiates a new Mail_smtp:: object based on the parameters
+     * passed in. It looks for the following parameters:
+     *     host        The server to connect to. Defaults to localhost.
+     *     port        The port to connect to. Defaults to 25.
+     *     auth        SMTP authentication.  Defaults to none.
+     *     username    The username to use for SMTP auth. No default.
+     *     password    The password to use for SMTP auth. No default.
+     *     localhost   The local hostname / domain. Defaults to localhost.
+     *     timeout     The SMTP connection timeout. Defaults to none.
+     *     verp        Whether to use VERP or not. Defaults to false.
+     *     debug       Activate SMTP debug mode? Defaults to false.
+     *     persist     Should the SMTP connection persist?
+     *
+     * If a parameter is present in the $params array, it replaces the
+     * default.
+     *
+     * @param array Hash containing any parameters different from the
+     *              defaults.
+     * @access public
+     */
+    function Mail_smtp($params)
+    {
+        if (isset($params['host'])) $this->host = $params['host'];
+        if (isset($params['port'])) $this->port = $params['port'];
+        if (isset($params['auth'])) $this->auth = $params['auth'];
+        if (isset($params['username'])) $this->username = $params['username'];
+        if (isset($params['password'])) $this->password = $params['password'];
+        if (isset($params['localhost'])) $this->localhost = $params['localhost'];
+        if (isset($params['timeout'])) $this->timeout = $params['timeout'];
+        if (isset($params['verp'])) $this->verp = $params['verp'];
+        if (isset($params['debug'])) $this->debug = (boolean)$params['debug'];
+        if (isset($params['persist'])) $this->persist = (boolean)$params['persist'];
+
+        register_shutdown_function(array(&$this, '_Mail_smtp'));
+    }
+
+    /**
+     * Destructor implementation to ensure that we disconnect from any
+     * potentially-alive persistent SMTP connections.
+     */
+    function _Mail_smtp()
+    {
+        $this->disconnect();
+    }
+
+    /**
+     * Implements Mail::send() function using SMTP.
+     *
+     * @param mixed $recipients Either a comma-seperated list of recipients
+     *              (RFC822 compliant), or an array of recipients,
+     *              each RFC822 valid. This may contain recipients not
+     *              specified in the headers, for Bcc:, resending
+     *              messages, etc.
+     *
+     * @param array $headers The array of headers to send with the mail, in an
+     *              associative array, where the array key is the
+     *              header name (e.g., 'Subject'), and the array value
+     *              is the header value (e.g., 'test'). The header
+     *              produced from those values would be 'Subject:
+     *              test'.
+     *
+     * @param string $body The full text of the message body, including any
+     *               Mime parts, etc.
+     *
+     * @return mixed Returns true on success, or a PEAR_Error
+     *               containing a descriptive error message on
+     *               failure.
+     * @access public
+     */
+    function send($recipients, $headers, $body)
+    {
+        include_once 'Net/SMTP.php';
+
+        /* If we don't already have an SMTP object, create one. */
+        if (is_object($this->_smtp) === false) {
+            $this->_smtp =& new Net_SMTP($this->host, $this->port,
+                                         $this->localhost);
+
+            /* If we still don't have an SMTP object at this point, fail. */
+            if (is_object($this->_smtp) === false) {
+                return PEAR::raiseError('Failed to create a Net_SMTP object');
+            }
+
+            /* Configure the SMTP connection. */
+            if ($this->debug) {
+                $this->_smtp->setDebug(true);
+            }
+
+            /* Attempt to connect to the configured SMTP server. */
+            if (PEAR::isError($res = $this->_smtp->connect($this->timeout))) {
+                $error = $this->_error('Failed to connect to ' .
+                                       $this->host . ':' . $this->port,
+                                       $res);
+                return PEAR::raiseError($error);
+            }
+
+            /* Attempt to authenticate if authentication has been enabled. */
+            if ($this->auth) {
+                $method = is_string($this->auth) ? $this->auth : '';
+
+                if (PEAR::isError($res = $this->_smtp->auth($this->username,
+                                                            $this->password,
+                                                            $method))) {
+                    $error = $this->_error("$method authentication failure",
+                                           $res);
+                    $this->_smtp->rset();
+                    return PEAR::raiseError($error);
+                }
+            }
+        }
+
+        $headerElements = $this->prepareHeaders($headers);
+        if (PEAR::isError($headerElements)) {
+            $this->_smtp->rset();
+            return $headerElements;
+        }
+        list($from, $textHeaders) = $headerElements;
+
+        /* Since few MTAs are going to allow this header to be forged
+         * unless it's in the MAIL FROM: exchange, we'll use
+         * Return-Path instead of From: if it's set. */
+        if (!empty($headers['Return-Path'])) {
+            $from = $headers['Return-Path'];
+        }
+
+        if (!isset($from)) {
+            $this->_smtp->rset();
+            return PEAR::raiseError('No From: address has been provided');
+        }
+
+        $args['verp'] = $this->verp;
+        if (PEAR::isError($res = $this->_smtp->mailFrom($from, $args))) {
+            $error = $this->_error("Failed to set sender: $from", $res);
+            $this->_smtp->rset();
+            return PEAR::raiseError($error);
+        }
+
+        $recipients = $this->parseRecipients($recipients);
+        if (PEAR::isError($recipients)) {
+            $this->_smtp->rset();
+            return $recipients;
+        }
+
+        foreach ($recipients as $recipient) {
+            if (PEAR::isError($res = $this->_smtp->rcptTo($recipient))) {
+                $error = $this->_error("Failed to add recipient: $recipient",
+                                       $res);
+                $this->_smtp->rset();
+                return PEAR::raiseError($error);
+            }
+        }
+
+        /* Send the message's headers and the body as SMTP data. */
+        if (PEAR::isError($res = $this->_smtp->data("$textHeaders\r\n$body"))) {
+            $error = $this->_error('Failed to send data', $res);
+            $this->_smtp->rset();
+            return PEAR::raiseError($error);
+        }
+
+        /* If persistent connections are disabled, destroy our SMTP object. */
+        if ($this->persist === false) {
+            $this->disconnect();
+        }
+
+        return true;
+    }
+
+    /**
+     * Disconnect and destroy the current SMTP connection.
+     *
+     * @return boolean True if the SMTP connection no longer exists.
+     *
+     * @since  1.1.9
+     * @access public
+     */
+    function disconnect()
+    {
+        /* If we have an SMTP object, disconnect and destroy it. */
+        if (is_object($this->_smtp) && $this->_smtp->disconnect()) {
+            $this->_smtp = null;
+        }
+
+        /* We are disconnected if we no longer have an SMTP object. */
+        return ($this->_smtp === null);
+    }
+
+    /**
+     * Build a standardized string describing the current SMTP error.
+     *
+     * @param string $text  Custom string describing the error context.
+     * @param object $error Reference to the current PEAR_Error object.
+     *
+     * @return string       A string describing the current SMTP error.
+     *
+     * @since  1.1.7
+     * @access private
+     */
+    function _error($text, &$error)
+    {
+        /* Split the SMTP response into a code and a response string. */
+        list($code, $response) = $this->_smtp->getResponse();
+
+        /* Build our standardized error string. */
+        $msg = $text;
+        $msg .= ' [SMTP: ' . $error->getMessage();
+        $msg .= " (code: $code, response: $response)]";
+
+        return $msg;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Net/DIME.php
===================================================================
--- trunk/direct.openmoko.com/pear/Net/DIME.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Net/DIME.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,629 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <shane at caraveo.com>                           |
+// |      Ralf Hofmann <ralf.hofmann at verdisoft.com>           |
+// +----------------------------------------------------------------------+
+//
+// $Id: DIME.php,v 1.5 2002/09/29 01:55:16 shane Exp $
+//
+
+require_once 'PEAR.php';
+/**
+ *
+ *  DIME Encoding/Decoding
+ *
+ * What is it?
+ *   This class enables you to manipulate and build
+ *   a DIME encapsulated message.
+ *
+ * http://www.ietf.org/internet-drafts/draft-nielsen-dime-02.txt
+ *
+ * 09/18/02 Ralf -  A huge number of changes to be compliant 
+ *          with the DIME Specification Release 17 June 2002
+ * 
+ * TODO: lots of stuff needs to be tested.
+ *           Definitily have to go through DIME spec and
+ *           make things work right, most importantly, sec 3.3
+ *           make examples, document
+ *
+ * see test/dime_mesage_test.php for example of usage
+ * 
+ * @author  Shane Caraveo <shane at caraveo.com>, 
+ *          Ralf Hofmann <ralf.hofmann at verdisoft.com>  
+ * @version $Revision: 1.5 $
+ * @package Net_DIME
+ */
+define('NET_DIME_TYPE_UNCHANGED',0x00);
+define('NET_DIME_TYPE_MEDIA',0x01);
+define('NET_DIME_TYPE_URI',0x02);
+define('NET_DIME_TYPE_UNKNOWN',0x03);
+define('NET_DIME_TYPE_NONE',0x04);
+
+define('NET_DIME_VERSION',0x0001);
+
+define('NET_DIME_RECORD_HEADER',12);
+
+define('NET_DIME_FLAGS', 0);
+define('NET_DIME_OPTS_LEN', 1);
+define('NET_DIME_ID_LEN', 2);
+define('NET_DIME_TYPE_LEN', 3);
+define('NET_DIME_DATA_LEN', 4);
+define('NET_DIME_OPTS', 5);
+define('NET_DIME_ID', 6);
+define('NET_DIME_TYPE', 7);
+define('NET_DIME_DATA', 8);
+
+class Net_DIME_Record extends PEAR
+{
+    // these are used to hold the padded length
+    var $OPTS_LENGTH = 0;
+    var $ID_LENGTH = 0;
+    var $TYPE_LENGTH = 0; 
+    var $DATA_LENGTH = 0;
+    var $_haveOpts = FALSE;
+    var $_haveID = FALSE;
+    var $_haveType = FALSE;
+    var $_haveData = FALSE;
+    var $debug = FALSE;
+    var $padstr = "\0";
+    /**
+     * Elements
+     * [NET_DIME_FLAGS],    16 bits: VERSION:MB:ME:CF:TYPE_T
+     * [NET_DIME_OPTS_LEN], 16 bits: OPTIONS_LENGTH
+     * [NET_DIME_ID_LEN],   16 bits: ID_LENGTH
+     * [NET_DIME_TYPE_LEN], 16 bits: TYPE_LENGTH
+     * [NET_DIME_DATA_LEN], 32 bits: DATA_LENGTH
+   * [NET_DIME_OPTS]             : OPTIONS
+   * [NET_DIME_ID]           : ID
+   * [NET_DIME_TYPE]             : TYPE
+   * [NET_DIME_DATA]             : DATA
+     */
+    var $Elements = array(NET_DIME_FLAGS => 0,  NET_DIME_OPTS_LEN => 0, 
+                        NET_DIME_ID_LEN => 0, NET_DIME_TYPE_LEN => 0, 
+                NET_DIME_DATA_LEN => 0,
+              NET_DIME_OPTS => '',
+              NET_DIME_ID => '',
+              NET_DIME_TYPE => '',
+              NET_DIME_DATA => '');
+    
+    function Net_DIME_Record($debug = FALSE)
+    {
+        $this->debug = $debug;
+        if ($debug) $this->padstr = '*';
+    }
+
+    function setMB()
+    {
+        $this->Elements[NET_DIME_FLAGS] |= 0x0400;
+    }
+
+    function setME()
+    {
+        $this->Elements[NET_DIME_FLAGS] |= 0x0200;
+    }
+
+    function setCF()
+    {
+        $this->Elements[NET_DIME_FLAGS] |= 0x0100;
+    }
+
+    function isChunk()
+    {
+        return $this->Elements[NET_DIME_FLAGS] & 0x0100;
+    }
+
+    function isEnd()
+    {
+        return $this->Elements[NET_DIME_FLAGS] & 0x0200;
+    }
+    
+    function isStart()
+    {
+        return $this->Elements[NET_DIME_FLAGS] & 0x0400;
+    }
+    
+    function getID()
+    {
+        return $this->Elements[NET_DIME_ID];
+    }
+
+    function getType()
+    {
+        return $this->Elements[NET_DIME_TYPE];
+    }
+
+    function getData()
+    {
+        return $this->Elements[NET_DIME_DATA];
+    }
+    
+    function getDataLength()
+    {
+        return $this->Elements[NET_DIME_DATA_LEN];
+    }
+    
+    function setType($typestring, $type=NET_DIME_TYPE_UNKNOWN)
+    {
+        $typelen = strlen($typestring) & 0xFFFF;
+        $type = $type << 4;
+        $this->Elements[NET_DIME_FLAGS] = ($this->Elements[NET_DIME_FLAGS] & 0xFF0F) | $type;
+        $this->Elements[NET_DIME_TYPE_LEN] = $typelen;
+        $this->TYPE_LENGTH = $this->_getPadLength($typelen);
+        $this->Elements[NET_DIME_TYPE] = $typestring;
+    }
+    
+    function generateID()
+    {
+        $id = md5(time());
+        $this->setID($id);
+        return $id;
+    }
+    
+    function setID($id)
+    {
+        $idlen = strlen($id) & 0xFFFF;
+        $this->Elements[NET_DIME_ID_LEN] = $idlen;
+        $this->ID_LENGTH = $this->_getPadLength($idlen);
+        $this->Elements[NET_DIME_ID] = $id;
+    }
+    
+    function setData($data, $size=0)
+    {
+        $datalen = $size?$size:strlen($data);
+        $this->Elements[NET_DIME_DATA_LEN] = $datalen;
+        $this->DATA_LENGTH = $this->_getPadLength($datalen);
+        $this->Elements[NET_DIME_DATA] = $data;
+    }
+    
+    function encode()
+    {
+    // insert version 
+      $this->Elements[NET_DIME_FLAGS] = ($this->Elements[NET_DIME_FLAGS] & 0x07FF) | (NET_DIME_VERSION << 11);
+
+        // the real dime encoding
+        $format =   '%c%c%c%c%c%c%c%c%c%c%c%c'.
+                    '%'.$this->OPTS_LENGTH.'s'.
+                    '%'.$this->ID_LENGTH.'s'.
+                    '%'.$this->TYPE_LENGTH.'s'.
+                    '%'.$this->DATA_LENGTH.'s';
+        return sprintf($format,
+                     ($this->Elements[NET_DIME_FLAGS]&0x0000FF00)>>8,
+                     ($this->Elements[NET_DIME_FLAGS]&0x000000FF),
+                     ($this->Elements[NET_DIME_OPTS_LEN]&0x0000FF00)>>8,
+                     ($this->Elements[NET_DIME_OPTS_LEN]&0x000000FF),
+                     ($this->Elements[NET_DIME_ID_LEN]&0x0000FF00)>>8,
+                     ($this->Elements[NET_DIME_ID_LEN]&0x000000FF),
+                     ($this->Elements[NET_DIME_TYPE_LEN]&0x0000FF00)>>8,
+                     ($this->Elements[NET_DIME_TYPE_LEN]&0x000000FF),
+                     ($this->Elements[NET_DIME_DATA_LEN]&0xFF000000)>>24,
+                     ($this->Elements[NET_DIME_DATA_LEN]&0x00FF0000)>>16,
+                     ($this->Elements[NET_DIME_DATA_LEN]&0x0000FF00)>>8,
+                     ($this->Elements[NET_DIME_DATA_LEN]&0x000000FF),
+                     str_pad($this->Elements[NET_DIME_OPTS], $this->OPTS_LENGTH, $this->padstr),
+                     str_pad($this->Elements[NET_DIME_ID], $this->ID_LENGTH, $this->padstr),
+                     str_pad($this->Elements[NET_DIME_TYPE], $this->TYPE_LENGTH, $this->padstr),
+                     str_pad($this->Elements[NET_DIME_DATA], $this->DATA_LENGTH, $this->padstr));
+    }
+    
+    function _getPadLength($len)
+    {
+        $pad = 0;
+        if ($len) {
+            $pad = $len % 4;
+            if ($pad) $pad = 4 - $pad;
+        }
+        return $len + $pad;
+    }
+    
+    function decode(&$data)
+    {
+        // REAL DIME decoding
+        $this->Elements[NET_DIME_FLAGS]    = (hexdec(bin2hex($data[0]))<<8) + hexdec(bin2hex($data[1]));
+        $this->Elements[NET_DIME_OPTS_LEN] = (hexdec(bin2hex($data[2]))<<8) + hexdec(bin2hex($data[3]));
+        $this->Elements[NET_DIME_ID_LEN]   = (hexdec(bin2hex($data[4]))<<8) + hexdec(bin2hex($data[5]));
+        $this->Elements[NET_DIME_TYPE_LEN] = (hexdec(bin2hex($data[6]))<<8) + hexdec(bin2hex($data[7]));
+        $this->Elements[NET_DIME_DATA_LEN] = (hexdec(bin2hex($data[8]))<<24) +
+                                 (hexdec(bin2hex($data[9]))<<16) +
+                                     (hexdec(bin2hex($data[10]))<<8) +
+                                      hexdec(bin2hex($data[11]));
+        $p = 12;
+    
+    $version = (($this->Elements[NET_DIME_FLAGS]>>11) & 0x001F);
+    
+    if ($version == NET_DIME_VERSION) 
+    {
+          $this->OPTS_LENGTH = $this->_getPadLength($this->Elements[NET_DIME_OPTS_LEN]);        
+          $this->ID_LENGTH = $this->_getPadLength($this->Elements[NET_DIME_ID_LEN]);
+          $this->TYPE_LENGTH = $this->_getPadLength($this->Elements[NET_DIME_TYPE_LEN]);
+          $this->DATA_LENGTH = $this->_getPadLength($this->Elements[NET_DIME_DATA_LEN]);
+                  
+          $datalen = strlen($data);
+          $this->Elements[NET_DIME_OPTS] = substr($data,$p,$this->Elements[NET_DIME_OPTS_LEN]);
+          $this->_haveOpts = (strlen($this->Elements[NET_DIME_OPTS]) == $this->Elements[NET_DIME_OPTS_LEN]);
+          if ($this->_haveOpts) {
+              $p += $this->OPTS_LENGTH;   
+            $this->Elements[NET_DIME_ID] = substr($data,$p,$this->Elements[NET_DIME_ID_LEN]);
+            $this->_haveID = (strlen($this->Elements[NET_DIME_ID]) == $this->Elements[NET_DIME_ID_LEN]);
+            if ($this->_haveID) {
+                $p += $this->ID_LENGTH;
+                $this->Elements[NET_DIME_TYPE] = substr($data,$p,$this->Elements[NET_DIME_TYPE_LEN]);
+                $this->_haveType = (strlen($this->Elements[NET_DIME_TYPE]) == $this->Elements[NET_DIME_TYPE_LEN]);
+                if ($this->_haveType) {
+                    $p += $this->TYPE_LENGTH;
+                    $this->Elements[NET_DIME_DATA] = substr($data,$p,$this->Elements[NET_DIME_DATA_LEN]);
+                    $this->_haveData = (strlen($this->Elements[NET_DIME_DATA]) == $this->Elements[NET_DIME_DATA_LEN]);
+                    if ($this->_haveData) {
+                        $p += $this->DATA_LENGTH;
+                    } else {
+                        $p += strlen($this->Elements[NET_DIME_DATA]);
+                    }
+                } else {
+                    $p += strlen($this->Elements[NET_DIME_TYPE]);
+          }
+            } else {
+                $p += strlen($this->Elements[NET_DIME_ID]);
+        }
+        } else {
+          $p += strlen($this->Elements[NET_DIME_OPTS]);         
+          }
+    }
+        return substr($data, $p);
+    }
+    
+    function addData(&$data)
+    {
+        $datalen = strlen($data);
+        $p = 0;
+        if (!$this->_haveOpts) {
+            $have = strlen($this->Elements[NET_DIME_OPTS]);
+            $this->Elements[NET_DIME_OPTS] .= substr($data,$p,$this->Elements[NET_DIME_OPTS_LEN]-$have);
+            $this->_haveOpts = (strlen($this->Elements[NET_DIME_OPTS]) == $this->Elements[DIME_OTPS_LEN]);
+            if (!$this->_haveOpts) return NULL;
+            $p += $this->OPTS_LENGTH-$have;
+        }
+        if (!$this->_haveID) {
+            $have = strlen($this->Elements[NET_DIME_ID]);
+            $this->Elements[NET_DIME_ID] .= substr($data,$p,$this->Elements[NET_DIME_ID_LEN]-$have);
+            $this->_haveID = (strlen($this->Elements[NET_DIME_ID]) == $this->Elements[NET_DIME_ID_LEN]);
+            if (!$this->_haveID) return NULL;
+            $p += $this->ID_LENGTH-$have;
+        }
+        if (!$this->_haveType && $p < $datalen) {
+            $have = strlen($this->Elements[NET_DIME_TYPE]);
+            $this->Elements[NET_DIME_TYPE] .= substr($data,$p,$this->Elements[NET_DIME_TYPE_LEN]-$have);
+            $this->_haveType = (strlen($this->Elements[NET_DIME_TYPE]) == $this->Elements[NET_DIME_TYPE_LEN]);
+            if (!$this->_haveType) return NULL;
+            $p += $this->TYPE_LENGTH-$have;
+        }
+        if (!$this->_haveData && $p < $datalen) {
+            $have = strlen($this->Elements[NET_DIME_DATA]);
+            $this->Elements[NET_DIME_DATA] .= substr($data,$p,$this->Elements[NET_DIME_DATA_LEN]-$have);
+            $this->_haveData = (strlen($this->Elements[NET_DIME_DATA]) == $this->Elements[NET_DIME_DATA_LEN]);
+            if (!$this->_haveData) return NULL;
+            $p += $this->DATA_LENGTH-$have;
+        }
+        return substr($data,$p);
+    }   
+}
+
+
+class Net_DIME_Message extends PEAR
+{
+
+    var $record_size = 4096;
+    #var $records =array();
+    var $parts = array();
+    var $currentPart = -1;
+    var $stream = NULL;
+    var $_currentRecord;
+    var $_proc = array();
+    var $type;
+    var $typestr;
+    var $mb = 1;
+    var $me = 0;
+    var $cf = 0;
+    var $id = NULL;
+    var $debug = FALSE;
+    /**
+     * constructor
+     *
+     * this currently takes a file pointer as provided
+     * by fopen
+     *
+     * TODO: integrate with the php streams stuff
+     */
+    function Net_DIME_Message($stream=NULL, $record_size = 4096, $debug = FALSE)
+    {
+        $this->stream = $stream;
+        $this->record_size = $record_size;
+        $this->debug = $debug;
+    }
+    
+    function _makeRecord(&$data, $typestr='', $id=NULL, $type=NET_DIME_TYPE_UNKNOWN)
+    {
+        $record = new Net_DIME_Record($this->debug);
+        if ($this->mb) {
+            $record->setMB();
+            // all subsequent records are not message begin!
+            $this->mb = 0; 
+        }
+        if ($this->me) $record->setME();
+        if ($this->cf) $record->setCF();
+        $record->setData($data);
+        $record->setType($typestr,$type);
+        if ($id) $record->setID($id);
+        #if ($this->debug) {
+        #    print str_replace('\0','*',$record->encode());
+        #}
+        return $record->encode();
+    }
+    
+    function startChunk(&$data, $typestr='', $id=NULL, $type=NET_DIME_TYPE_UNKNOWN)
+    {
+        $this->me = 0;
+        $this->cf = 1;
+        $this->type = $type;
+        $this->typestr = $typestr;
+        if ($id) {
+            $this->id = $id;
+        } else {
+            $this->id = md5(time());
+        }
+        return $this->_makeRecord($data, $this->typestr, $this->id, $this->type);
+    }
+
+    function doChunk(&$data)
+    {
+        $this->me = 0;
+        $this->cf = 1;
+        return $this->_makeRecord($data, NULL, NULL, NET_DIME_TYPE_UNCHANGED);
+    }
+
+    function endChunk()
+    {
+        $this->cf = 0;
+        $data = NULL;
+        $rec = $this->_makeRecord($data, NULL, NULL, NET_DIME_TYPE_UNCHANGED);
+        $this->id = 0;
+        $this->cf = 0;
+        $this->id = 0;
+        $this->type = NET_DIME_TYPE_UNKNOWN;
+        $this->typestr = NULL;
+        return $rec;
+    }
+    
+    function endMessage()
+    {
+        $this->me = 1;
+        $data = NULL;
+        $rec = $this->_makeRecord($data, NULL, NULL, NET_DIME_TYPE_NONE);
+        $this->me = 0;
+        $this->mb = 1;
+        $this->id = 0;
+        return $rec;
+    }
+    
+    /**
+     * sendRecord
+     *
+     * given a chunk of data, it creates DIME records
+     * and writes them to the stream
+     *
+     */
+    function sendData(&$data, $typestr='', $id=NULL, $type=NET_DIME_TYPE_UNKNOWN)
+    {
+        $len = strlen($data);
+        if ($len > $this->record_size) {
+            $chunk = substr($data, 0, $this->record_size);
+            $p = $this->record_size;
+            $rec = $this->startChunk($chunk,$typestr,$id,$type);
+            fwrite($this->stream, $rec);
+            while ($p < $len) {
+                $chunk = substr($data, $p, $this->record_size);
+                $p += $this->record_size;
+                $rec = $this->doChunk($chunk);
+                fwrite($this->stream, $rec);
+            }
+            $rec = $this->endChunk();
+            fwrite($this->stream, $rec);
+            return;
+        }
+        $rec = $this->_makeRecord($data, $typestr,$id,$type);
+        fwrite($this->stream, $rec);
+    }
+    
+    function sendEndMessage()
+    {
+        $rec = $this->endMessage();
+        fwrite($this->stream, $rec);
+    }
+    
+    /**
+     * sendFile
+     *
+     * given a filename, it reads the file,
+     * creates records and writes them to the stream
+     *
+     */
+    function sendFile($filename, $typestr='', $id=NULL, $type=NET_DIME_TYPE_UNKNOWN)
+    {
+        $f = fopen($filename, "rb");
+        if ($f) {
+            if ($data = fread($f, $this->record_size)) {
+                $this->startChunk($data,$typestr,$id,$type);
+            }
+            while ($data = fread($f, $this->record_size)) {
+                $this->doChunk($data,$typestr,$id,$type);
+            }
+            $this->endChunk();
+            fclose($f);
+        }
+    }
+
+    /**
+     * encodeData
+     *
+     * given data, encode it in DIME
+     *
+     */
+    function encodeData($data, $typestr='', $id=NULL, $type=NET_DIME_TYPE_UNKNOWN)
+    {
+        $len = strlen($data);
+        $resp = '';
+        if ($len > $this->record_size) {
+            $chunk = substr($data, 0, $this->record_size);
+            $p = $this->record_size;
+            $resp .= $this->startChunk($chunk,$typestr,$id,$type);
+            while ($p < $len) {
+                $chunk = substr($data, $p, $this->record_size);
+                $p += $this->record_size;
+                $resp .= $this->doChunk($chunk);
+            }
+            $resp .= $this->endChunk();
+        } else {
+            $resp .= $this->_makeRecord($data, $typestr,$id,$type);
+        }
+        return $resp;
+    }
+
+    /**
+     * sendFile
+     *
+     * given a filename, it reads the file,
+     * creates records and writes them to the stream
+     *
+     */
+    function encodeFile($filename, $typestr='', $id=NULL, $type=NET_DIME_TYPE_UNKNOWN)
+    {
+        $f = fopen($filename, "rb");
+        if ($f) {
+            if ($data = fread($f, $this->record_size)) {
+                $resp = $this->startChunk($data,$typestr,$id,$type);
+            }
+            while ($data = fread($f, $this->record_size)) {
+                $resp = $this->doChunk($data,$typestr,$id,$type);
+            }
+            $resp = $this->endChunk();
+            fclose($f);
+        }
+        return $resp;
+    }
+    
+    /**
+     * _processData
+     *
+     * creates Net_DIME_Records from provided data
+     *
+     */
+    function _processData(&$data)
+    {
+        $leftover = NULL;
+        if (!$this->_currentRecord) {
+            $this->_currentRecord = new Net_DIME_Record($this->debug);
+            $data = $this->_currentRecord->decode($data);
+        } else {
+            $data = $this->_currentRecord->addData($data);
+        }
+        
+        if ($this->_currentRecord->_haveData) {
+            if (count($this->parts)==0 && !$this->_currentRecord->isStart()) {
+                // raise an error!
+                return PEAR::raiseError('First Message is not a DIME begin record!');
+            }
+
+            if ($this->_currentRecord->isEnd() && $this->_currentRecord->getDataLength()==0) {
+                return NULL;
+            }
+            
+            if ($this->currentPart < 0 && !$this->_currentRecord->isChunk()) {
+                $this->parts[] = array();
+                $this->currentPart = count($this->parts)-1;
+                $this->parts[$this->currentPart]['id']   = $this->_currentRecord->getID();
+                $this->parts[$this->currentPart]['type'] = $this->_currentRecord->getType();
+                $this->parts[$this->currentPart]['data'] = $this->_currentRecord->getData();
+                $this->currentPart = -1;
+            } else {
+                if ($this->currentPart < 0) {
+                    $this->parts[] = array();
+                    $this->currentPart = count($this->parts)-1;
+                    $this->parts[$this->currentPart]['id']   = $this->_currentRecord->getID();
+                    $this->parts[$this->currentPart]['type'] = $this->_currentRecord->getType();
+                    $this->parts[$this->currentPart]['data'] = $this->_currentRecord->getData();
+                } else {
+                    $this->parts[$this->currentPart]['data'] .= $this->_currentRecord->getData();
+                    if (!$this->_currentRecord->isChunk()) {
+                        // we reached the end of the chunk
+                        $this->currentPart = -1;
+                    }
+                }
+            }
+            #$this->records[] = $this->_currentRecord;
+            if (!$this->_currentRecord->isEnd()) $this->_currentRecord = NULL;
+        }
+        return NULL;
+    }
+    
+    /**
+     * decodeData
+     *
+     * decodes a DIME encrypted string of data
+     *
+     */
+    function decodeData(&$data) {
+        while (strlen($data) >= NET_DIME_RECORD_HEADER) {
+            $err = $this->_processData($data);
+            if (PEAR::isError($err)) {
+                return $err;
+            }
+        }
+    }
+    
+    /**
+     * read
+     *
+     * reads the stream and creates
+     * an array of records
+     *
+     * it can accept the start of a previously read buffer
+     * this is usefull in situations where you need to read
+     * headers before discovering that the data is DIME encoded
+     * such as in the case of reading an HTTP response.
+     */
+    function read($buf=NULL)
+    {
+        while ($data = fread($this->stream, 8192)) {
+            if ($buf) {
+                $data = $buf.$data;
+                $buf = NULL;
+            }
+            if ($this->debug)
+                echo "read: ".strlen($data)." bytes\n";
+            $err = $this->decodeData($data);
+            if (PEAR::isError($err)) {
+                return $err;
+            }
+            
+            // store any leftover data to be used again
+            // should be < NET_DIME_RECORD_HEADER bytes
+            $buf = $data;
+        }
+        if (!$this->_currentRecord || !$this->_currentRecord->isEnd()) {
+            return PEAR::raiseError('reached stream end without end record');
+        }
+        return NULL;
+    }
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Net/SMTP.php
===================================================================
--- trunk/direct.openmoko.com/pear/Net/SMTP.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Net/SMTP.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1005 @@
+<?php
+/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Chuck Hagenbuch <chuck at horde.org>                           |
+// |          Jon Parise <jon at php.net>                                    |
+// |          Damian Alejandro Fernandez Sosa <damlists at cnba.uba.ar>      |
+// +----------------------------------------------------------------------+
+//
+// $Id: SMTP.php,v 1.55 2006/02/06 06:00:22 jon Exp $
+
+require_once 'PEAR.php';
+require_once 'Net/Socket.php';
+
+/**
+ * Provides an implementation of the SMTP protocol using PEAR's
+ * Net_Socket:: class.
+ *
+ * @package Net_SMTP
+ * @author  Chuck Hagenbuch <chuck at horde.org>
+ * @author  Jon Parise <jon at php.net>
+ * @author  Damian Alejandro Fernandez Sosa <damlists at cnba.uba.ar>
+ *
+ * @example basic.php   A basic implementation of the Net_SMTP package.
+ */
+class Net_SMTP
+{
+    /**
+     * The server to connect to.
+     * @var string
+     * @access public
+     */
+    var $host = 'localhost';
+
+    /**
+     * The port to connect to.
+     * @var int
+     * @access public
+     */
+    var $port = 25;
+
+    /**
+     * The value to give when sending EHLO or HELO.
+     * @var string
+     * @access public
+     */
+    var $localhost = 'localhost';
+
+    /**
+     * List of supported authentication methods, in preferential order.
+     * @var array
+     * @access public
+     */
+    var $auth_methods = array('DIGEST-MD5', 'CRAM-MD5', 'LOGIN', 'PLAIN');
+
+    /**
+     * Should debugging output be enabled?
+     * @var boolean
+     * @access private
+     */
+    var $_debug = false;
+
+    /**
+     * The socket resource being used to connect to the SMTP server.
+     * @var resource
+     * @access private
+     */
+    var $_socket = null;
+
+    /**
+     * The most recent server response code.
+     * @var int
+     * @access private
+     */
+    var $_code = -1;
+
+    /**
+     * The most recent server response arguments.
+     * @var array
+     * @access private
+     */
+    var $_arguments = array();
+
+    /**
+     * Stores detected features of the SMTP server.
+     * @var array
+     * @access private
+     */
+    var $_esmtp = array();
+
+    /**
+     * Instantiates a new Net_SMTP object, overriding any defaults
+     * with parameters that are passed in.
+     *
+     * If you have SSL support in PHP, you can connect to a server
+     * over SSL using an 'ssl://' prefix:
+     *
+     *   // 465 is a common smtps port.
+     *   $smtp = new Net_SMTP('ssl://mail.host.com', 465);
+     *   $smtp->connect();
+     *
+     * @param string  $host       The server to connect to.
+     * @param integer $port       The port to connect to.
+     * @param string  $localhost  The value to give when sending EHLO or HELO.
+     *
+     * @access  public
+     * @since   1.0
+     */
+    function Net_SMTP($host = null, $port = null, $localhost = null)
+    {
+        if (isset($host)) $this->host = $host;
+        if (isset($port)) $this->port = $port;
+        if (isset($localhost)) $this->localhost = $localhost;
+
+        $this->_socket = &new Net_Socket();
+
+        /*
+         * Include the Auth_SASL package.  If the package is not available,
+         * we disable the authentication methods that depend upon it.
+         */
+        if ((@include_once 'Auth/SASL.php') === false) {
+            $pos = array_search('DIGEST-MD5', $this->auth_methods);
+            unset($this->auth_methods[$pos]);
+            $pos = array_search('CRAM-MD5', $this->auth_methods);
+            unset($this->auth_methods[$pos]);
+        }
+    }
+
+    /**
+     * Set the value of the debugging flag.
+     *
+     * @param   boolean $debug      New value for the debugging flag.
+     *
+     * @access  public
+     * @since   1.1.0
+     */
+    function setDebug($debug)
+    {
+        $this->_debug = $debug;
+    }
+
+    /**
+     * Send the given string of data to the server.
+     *
+     * @param   string  $data       The string of data to send.
+     *
+     * @return  mixed   True on success or a PEAR_Error object on failure.
+     *
+     * @access  private
+     * @since   1.1.0
+     */
+    function _send($data)
+    {
+        if ($this->_debug) {
+            echo "DEBUG: Send: $data\n";
+        }
+
+        if (PEAR::isError($error = $this->_socket->write($data))) {
+            return PEAR::raiseError('Failed to write to socket: ' .
+                                    $error->getMessage());
+        }
+
+        return true;
+    }
+
+    /**
+     * Send a command to the server with an optional string of
+     * arguments.  A carriage return / linefeed (CRLF) sequence will
+     * be appended to each command string before it is sent to the
+     * SMTP server - an error will be thrown if the command string
+     * already contains any newline characters. Use _send() for
+     * commands that must contain newlines.
+     *
+     * @param   string  $command    The SMTP command to send to the server.
+     * @param   string  $args       A string of optional arguments to append
+     *                              to the command.
+     *
+     * @return  mixed   The result of the _send() call.
+     *
+     * @access  private
+     * @since   1.1.0
+     */
+    function _put($command, $args = '')
+    {
+        if (!empty($args)) {
+            $command .= ' ' . $args;
+        }
+
+        if (strcspn($command, "\r\n") !== strlen($command)) {
+            return PEAR::raiseError('Commands cannot contain newlines');
+        }
+
+        return $this->_send($command . "\r\n");
+    }
+
+    /**
+     * Read a reply from the SMTP server.  The reply consists of a response
+     * code and a response message.
+     *
+     * @param   mixed   $valid      The set of valid response codes.  These
+     *                              may be specified as an array of integer
+     *                              values or as a single integer value.
+     *
+     * @return  mixed   True if the server returned a valid response code or
+     *                  a PEAR_Error object is an error condition is reached.
+     *
+     * @access  private
+     * @since   1.1.0
+     *
+     * @see     getResponse
+     */
+    function _parseResponse($valid)
+    {
+        $this->_code = -1;
+        $this->_arguments = array();
+
+        while ($line = $this->_socket->readLine()) {
+            if ($this->_debug) {
+                echo "DEBUG: Recv: $line\n";
+            }
+
+            /* If we receive an empty line, the connection has been closed. */
+            if (empty($line)) {
+                $this->disconnect();
+                return PEAR::raiseError('Connection was unexpectedly closed');
+            }
+
+            /* Read the code and store the rest in the arguments array. */
+            $code = substr($line, 0, 3);
+            $this->_arguments[] = trim(substr($line, 4));
+
+            /* Check the syntax of the response code. */
+            if (is_numeric($code)) {
+                $this->_code = (int)$code;
+            } else {
+                $this->_code = -1;
+                break;
+            }
+
+            /* If this is not a multiline response, we're done. */
+            if (substr($line, 3, 1) != '-') {
+                break;
+            }
+        }
+
+        /* Compare the server's response code with the valid code. */
+        if (is_int($valid) && ($this->_code === $valid)) {
+            return true;
+        }
+
+        /* If we were given an array of valid response codes, check each one. */
+        if (is_array($valid)) {
+            foreach ($valid as $valid_code) {
+                if ($this->_code === $valid_code) {
+                    return true;
+                }
+            }
+        }
+
+        return PEAR::raiseError('Invalid response code received from server');
+    }
+
+    /**
+     * Return a 2-tuple containing the last response from the SMTP server.
+     *
+     * @return  array   A two-element array: the first element contains the
+     *                  response code as an integer and the second element
+     *                  contains the response's arguments as a string.
+     *
+     * @access  public
+     * @since   1.1.0
+     */
+    function getResponse()
+    {
+        return array($this->_code, join("\n", $this->_arguments));
+    }
+
+    /**
+     * Attempt to connect to the SMTP server.
+     *
+     * @param   int     $timeout    The timeout value (in seconds) for the
+     *                              socket connection.
+     * @param   bool    $persistent Should a persistent socket connection
+     *                              be used?
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.0
+     */
+    function connect($timeout = null, $persistent = false)
+    {
+        $result = $this->_socket->connect($this->host, $this->port,
+                                          $persistent, $timeout);
+        if (PEAR::isError($result)) {
+            return PEAR::raiseError('Failed to connect socket: ' .
+                                    $result->getMessage());
+        }
+
+        if (PEAR::isError($error = $this->_parseResponse(220))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_negotiate())) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Attempt to disconnect from the SMTP server.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.0
+     */
+    function disconnect()
+    {
+        if (PEAR::isError($error = $this->_put('QUIT'))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(221))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_socket->disconnect())) {
+            return PEAR::raiseError('Failed to disconnect socket: ' .
+                                    $error->getMessage());
+        }
+
+        return true;
+    }
+
+    /**
+     * Attempt to send the EHLO command and obtain a list of ESMTP
+     * extensions available, and failing that just send HELO.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     *
+     * @access private
+     * @since  1.1.0
+     */
+    function _negotiate()
+    {
+        if (PEAR::isError($error = $this->_put('EHLO', $this->localhost))) {
+            return $error;
+        }
+
+        if (PEAR::isError($this->_parseResponse(250))) {
+            /* If we receive a 503 response, we're already authenticated. */
+            if ($this->_code === 503) {
+                return true;
+            }
+
+            /* If the EHLO failed, try the simpler HELO command. */
+            if (PEAR::isError($error = $this->_put('HELO', $this->localhost))) {
+                return $error;
+            }
+            if (PEAR::isError($this->_parseResponse(250))) {
+                return PEAR::raiseError('HELO was not accepted: ', $this->_code);
+            }
+
+            return true;
+        }
+
+        foreach ($this->_arguments as $argument) {
+            $verb = strtok($argument, ' ');
+            $arguments = substr($argument, strlen($verb) + 1,
+                                strlen($argument) - strlen($verb) - 1);
+            $this->_esmtp[$verb] = $arguments;
+        }
+
+        return true;
+    }
+
+    /**
+     * Returns the name of the best authentication method that the server
+     * has advertised.
+     *
+     * @return mixed    Returns a string containing the name of the best
+     *                  supported authentication method or a PEAR_Error object
+     *                  if a failure condition is encountered.
+     * @access private
+     * @since  1.1.0
+     */
+    function _getBestAuthMethod()
+    {
+        $available_methods = explode(' ', $this->_esmtp['AUTH']);
+
+        foreach ($this->auth_methods as $method) {
+            if (in_array($method, $available_methods)) {
+                return $method;
+            }
+        }
+
+        return PEAR::raiseError('No supported authentication methods');
+    }
+
+    /**
+     * Attempt to do SMTP authentication.
+     *
+     * @param string The userid to authenticate as.
+     * @param string The password to authenticate with.
+     * @param string The requested authentication method.  If none is
+     *               specified, the best supported method will be used.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.0
+     */
+    function auth($uid, $pwd , $method = '')
+    {
+        if (empty($this->_esmtp['AUTH'])) {
+            return PEAR::raiseError('SMTP server does no support authentication');
+        }
+
+        /* If no method has been specified, get the name of the best
+         * supported method advertised by the SMTP server. */
+        if (empty($method)) {
+            if (PEAR::isError($method = $this->_getBestAuthMethod())) {
+                /* Return the PEAR_Error object from _getBestAuthMethod(). */
+                return $method;
+            }
+        } else {
+            $method = strtoupper($method);
+            if (!in_array($method, $this->auth_methods)) {
+                return PEAR::raiseError("$method is not a supported authentication method");
+            }
+        }
+
+        switch ($method) {
+            case 'DIGEST-MD5':
+                $result = $this->_authDigest_MD5($uid, $pwd);
+                break;
+            case 'CRAM-MD5':
+                $result = $this->_authCRAM_MD5($uid, $pwd);
+                break;
+            case 'LOGIN':
+                $result = $this->_authLogin($uid, $pwd);
+                break;
+            case 'PLAIN':
+                $result = $this->_authPlain($uid, $pwd);
+                break;
+            default:
+                $result = PEAR::raiseError("$method is not a supported authentication method");
+                break;
+        }
+
+        /* If an error was encountered, return the PEAR_Error object. */
+        if (PEAR::isError($result)) {
+            return $result;
+        }
+
+        return true;
+    }
+
+    /**
+     * Authenticates the user using the DIGEST-MD5 method.
+     *
+     * @param string The userid to authenticate as.
+     * @param string The password to authenticate with.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access private
+     * @since  1.1.0
+     */
+    function _authDigest_MD5($uid, $pwd)
+    {
+        if (PEAR::isError($error = $this->_put('AUTH', 'DIGEST-MD5'))) {
+            return $error;
+        }
+        /* 334: Continue authentication request */
+        if (PEAR::isError($error = $this->_parseResponse(334))) {
+            /* 503: Error: already authenticated */
+            if ($this->_code === 503) {
+                return true;
+            }
+            return $error;
+        }
+
+        $challenge = base64_decode($this->_arguments[0]);
+        $digest = &Auth_SASL::factory('digestmd5');
+        $auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge,
+                                                       $this->host, "smtp"));
+
+        if (PEAR::isError($error = $this->_put($auth_str))) {
+            return $error;
+        }
+        /* 334: Continue authentication request */
+        if (PEAR::isError($error = $this->_parseResponse(334))) {
+            return $error;
+        }
+
+        /* We don't use the protocol's third step because SMTP doesn't
+         * allow subsequent authentication, so we just silently ignore
+         * it. */
+        if (PEAR::isError($error = $this->_put(' '))) {
+            return $error;
+        }
+        /* 235: Authentication successful */
+        if (PEAR::isError($error = $this->_parseResponse(235))) {
+            return $error;
+        }
+    }
+
+    /**
+     * Authenticates the user using the CRAM-MD5 method.
+     *
+     * @param string The userid to authenticate as.
+     * @param string The password to authenticate with.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access private
+     * @since  1.1.0
+     */
+    function _authCRAM_MD5($uid, $pwd)
+    {
+        if (PEAR::isError($error = $this->_put('AUTH', 'CRAM-MD5'))) {
+            return $error;
+        }
+        /* 334: Continue authentication request */
+        if (PEAR::isError($error = $this->_parseResponse(334))) {
+            /* 503: Error: already authenticated */
+            if ($this->_code === 503) {
+                return true;
+            }
+            return $error;
+        }
+
+        $challenge = base64_decode($this->_arguments[0]);
+        $cram = &Auth_SASL::factory('crammd5');
+        $auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge));
+
+        if (PEAR::isError($error = $this->_put($auth_str))) {
+            return $error;
+        }
+
+        /* 235: Authentication successful */
+        if (PEAR::isError($error = $this->_parseResponse(235))) {
+            return $error;
+        }
+    }
+
+    /**
+     * Authenticates the user using the LOGIN method.
+     *
+     * @param string The userid to authenticate as.
+     * @param string The password to authenticate with.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access private
+     * @since  1.1.0
+     */
+    function _authLogin($uid, $pwd)
+    {
+        if (PEAR::isError($error = $this->_put('AUTH', 'LOGIN'))) {
+            return $error;
+        }
+        /* 334: Continue authentication request */
+        if (PEAR::isError($error = $this->_parseResponse(334))) {
+            /* 503: Error: already authenticated */
+            if ($this->_code === 503) {
+                return true;
+            }
+            return $error;
+        }
+
+        if (PEAR::isError($error = $this->_put(base64_encode($uid)))) {
+            return $error;
+        }
+        /* 334: Continue authentication request */
+        if (PEAR::isError($error = $this->_parseResponse(334))) {
+            return $error;
+        }
+
+        if (PEAR::isError($error = $this->_put(base64_encode($pwd)))) {
+            return $error;
+        }
+
+        /* 235: Authentication successful */
+        if (PEAR::isError($error = $this->_parseResponse(235))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Authenticates the user using the PLAIN method.
+     *
+     * @param string The userid to authenticate as.
+     * @param string The password to authenticate with.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access private
+     * @since  1.1.0
+     */
+    function _authPlain($uid, $pwd)
+    {
+        if (PEAR::isError($error = $this->_put('AUTH', 'PLAIN'))) {
+            return $error;
+        }
+        /* 334: Continue authentication request */
+        if (PEAR::isError($error = $this->_parseResponse(334))) {
+            /* 503: Error: already authenticated */
+            if ($this->_code === 503) {
+                return true;
+            }
+            return $error;
+        }
+
+        $auth_str = base64_encode(chr(0) . $uid . chr(0) . $pwd);
+
+        if (PEAR::isError($error = $this->_put($auth_str))) {
+            return $error;
+        }
+
+        /* 235: Authentication successful */
+        if (PEAR::isError($error = $this->_parseResponse(235))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Send the HELO command.
+     *
+     * @param string The domain name to say we are.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.0
+     */
+    function helo($domain)
+    {
+        if (PEAR::isError($error = $this->_put('HELO', $domain))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(250))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Send the MAIL FROM: command.
+     *
+     * @param string $sender    The sender (reverse path) to set.
+     * @param string $params    String containing additional MAIL parameters,
+     *                          such as the NOTIFY flags defined by RFC 1891
+     *                          or the VERP protocol.
+     *
+     *                          If $params is an array, only the 'verp' option
+     *                          is supported.  If 'verp' is true, the XVERP
+     *                          parameter is appended to the MAIL command.  If
+     *                          the 'verp' value is a string, the full
+     *                          XVERP=value parameter is appended.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.0
+     */
+    function mailFrom($sender, $params = null)
+    {
+        $args = "FROM:<$sender>";
+
+        /* Support the deprecated array form of $params. */
+        if (is_array($params) && isset($params['verp'])) {
+            /* XVERP */
+            if ($params['verp'] === true) {
+                $args .= ' XVERP';
+
+            /* XVERP=something */
+            } elseif (trim($params['verp'])) {
+                $args .= ' XVERP=' . $params['verp'];
+            }
+        } elseif (is_string($params)) {
+            $args .= ' ' . $params;
+        }
+
+        if (PEAR::isError($error = $this->_put('MAIL', $args))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(250))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Send the RCPT TO: command.
+     *
+     * @param string $recipient The recipient (forward path) to add.
+     * @param string $params    String containing additional RCPT parameters,
+     *                          such as the NOTIFY flags defined by RFC 1891.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     *
+     * @access public
+     * @since  1.0
+     */
+    function rcptTo($recipient, $params = null)
+    {
+        $args = "TO:<$recipient>";
+        if (is_string($params)) {
+            $args .= ' ' . $params;
+        }
+
+        if (PEAR::isError($error = $this->_put('RCPT', $args))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(array(250, 251)))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Quote the data so that it meets SMTP standards.
+     *
+     * This is provided as a separate public function to facilitate
+     * easier overloading for the cases where it is desirable to
+     * customize the quoting behavior.
+     *
+     * @param string $data  The message text to quote. The string must be passed
+     *                      by reference, and the text will be modified in place.
+     *
+     * @access public
+     * @since  1.2
+     */
+    function quotedata(&$data)
+    {
+        /* Change Unix (\n) and Mac (\r) linefeeds into
+         * Internet-standard CRLF (\r\n) linefeeds. */
+        $data = preg_replace(array('/(?<!\r)\n/','/\r(?!\n)/'), "\r\n", $data);
+
+        /* Because a single leading period (.) signifies an end to the
+         * data, legitimate leading periods need to be "doubled"
+         * (e.g. '..'). */
+        $data = str_replace("\n.", "\n..", $data);
+    }
+
+    /**
+     * Send the DATA command.
+     *
+     * @param string $data  The message body to send.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.0
+     */
+    function data($data)
+    {
+        /* RFC 1870, section 3, subsection 3 states "a value of zero
+         * indicates that no fixed maximum message size is in force".
+         * Furthermore, it says that if "the parameter is omitted no
+         * information is conveyed about the server's fixed maximum
+         * message size". */
+        if (isset($this->_esmtp['SIZE']) && ($this->_esmtp['SIZE'] > 0)) {
+            if (strlen($data) >= $this->_esmtp['SIZE']) {
+                $this->disconnect();
+                return PEAR::raiseError('Message size excedes the server limit');
+            }
+        }
+
+        /* Quote the data based on the SMTP standards. */
+        $this->quotedata($data);
+
+        if (PEAR::isError($error = $this->_put('DATA'))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(354))) {
+            return $error;
+        }
+
+        if (PEAR::isError($result = $this->_send($data . "\r\n.\r\n"))) {
+            return $result;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(250))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Send the SEND FROM: command.
+     *
+     * @param string The reverse path to send.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.2.6
+     */
+    function sendFrom($path)
+    {
+        if (PEAR::isError($error = $this->_put('SEND', "FROM:<$path>"))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(250))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Backwards-compatibility wrapper for sendFrom().
+     *
+     * @param string The reverse path to send.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     *
+     * @access      public
+     * @since       1.0
+     * @deprecated  1.2.6
+     */
+    function send_from($path)
+    {
+        return sendFrom($path);
+    }
+
+    /**
+     * Send the SOML FROM: command.
+     *
+     * @param string The reverse path to send.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.2.6
+     */
+    function somlFrom($path)
+    {
+        if (PEAR::isError($error = $this->_put('SOML', "FROM:<$path>"))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(250))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Backwards-compatibility wrapper for somlFrom().
+     *
+     * @param string The reverse path to send.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     *
+     * @access      public
+     * @since       1.0
+     * @deprecated  1.2.6
+     */
+    function soml_from($path)
+    {
+        return somlFrom($path);
+    }
+
+    /**
+     * Send the SAML FROM: command.
+     *
+     * @param string The reverse path to send.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.2.6
+     */
+    function samlFrom($path)
+    {
+        if (PEAR::isError($error = $this->_put('SAML', "FROM:<$path>"))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(250))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Backwards-compatibility wrapper for samlFrom().
+     *
+     * @param string The reverse path to send.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     *
+     * @access      public
+     * @since       1.0
+     * @deprecated  1.2.6
+     */
+    function saml_from($path)
+    {
+        return samlFrom($path);
+    }
+
+    /**
+     * Send the RSET command.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.0
+     */
+    function rset()
+    {
+        if (PEAR::isError($error = $this->_put('RSET'))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(250))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Send the VRFY command.
+     *
+     * @param string The string to verify
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.0
+     */
+    function vrfy($string)
+    {
+        /* Note: 251 is also a valid response code */
+        if (PEAR::isError($error = $this->_put('VRFY', $string))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(array(250, 252)))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Send the NOOP command.
+     *
+     * @return mixed Returns a PEAR_Error with an error message on any
+     *               kind of failure, or true on success.
+     * @access public
+     * @since  1.0
+     */
+    function noop()
+    {
+        if (PEAR::isError($error = $this->_put('NOOP'))) {
+            return $error;
+        }
+        if (PEAR::isError($error = $this->_parseResponse(250))) {
+            return $error;
+        }
+
+        return true;
+    }
+
+    /**
+     * Backwards-compatibility method.  identifySender()'s functionality is
+     * now handled internally.
+     *
+     * @return  boolean     This method always return true.
+     *
+     * @access  public
+     * @since   1.0
+     */
+    function identifySender()
+    {
+        return true;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Net/Socket.php
===================================================================
--- trunk/direct.openmoko.com/pear/Net/Socket.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Net/Socket.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,528 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.0 of the PHP license,       |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Stig Bakken <ssb at php.net>                                   |
+// |          Chuck Hagenbuch <chuck at horde.org>                           |
+// +----------------------------------------------------------------------+
+//
+// $Id: Socket.php,v 1.24 2005/02/03 20:40:16 chagenbu Exp $
+
+require_once 'PEAR.php';
+
+define('NET_SOCKET_READ',  1);
+define('NET_SOCKET_WRITE', 2);
+define('NET_SOCKET_ERROR', 3);
+
+/**
+ * Generalized Socket class.
+ *
+ * @version 1.1
+ * @author Stig Bakken <ssb at php.net>
+ * @author Chuck Hagenbuch <chuck at horde.org>
+ */
+class Net_Socket extends PEAR {
+
+    /**
+     * Socket file pointer.
+     * @var resource $fp
+     */
+    var $fp = null;
+
+    /**
+     * Whether the socket is blocking. Defaults to true.
+     * @var boolean $blocking
+     */
+    var $blocking = true;
+
+    /**
+     * Whether the socket is persistent. Defaults to false.
+     * @var boolean $persistent
+     */
+    var $persistent = false;
+
+    /**
+     * The IP address to connect to.
+     * @var string $addr
+     */
+    var $addr = '';
+
+    /**
+     * The port number to connect to.
+     * @var integer $port
+     */
+    var $port = 0;
+
+    /**
+     * Number of seconds to wait on socket connections before assuming
+     * there's no more data. Defaults to no timeout.
+     * @var integer $timeout
+     */
+    var $timeout = false;
+
+    /**
+     * Number of bytes to read at a time in readLine() and
+     * readAll(). Defaults to 2048.
+     * @var integer $lineLength
+     */
+    var $lineLength = 2048;
+
+    /**
+     * Connect to the specified port. If called when the socket is
+     * already connected, it disconnects and connects again.
+     *
+     * @param string  $addr        IP address or host name.
+     * @param integer $port        TCP port number.
+     * @param boolean $persistent  (optional) Whether the connection is
+     *                             persistent (kept open between requests
+     *                             by the web server).
+     * @param integer $timeout     (optional) How long to wait for data.
+     * @param array   $options     See options for stream_context_create.
+     *
+     * @access public
+     *
+     * @return boolean | PEAR_Error  True on success or a PEAR_Error on failure.
+     */
+    function connect($addr, $port = 0, $persistent = null, $timeout = null, $options = null)
+    {
+        if (is_resource($this->fp)) {
+            @fclose($this->fp);
+            $this->fp = null;
+        }
+
+        if (!$addr) {
+            return $this->raiseError('$addr cannot be empty');
+        } elseif (strspn($addr, '.0123456789') == strlen($addr) ||
+                  strstr($addr, '/') !== false) {
+            $this->addr = $addr;
+        } else {
+            $this->addr = @gethostbyname($addr);
+        }
+
+        $this->port = $port % 65536;
+
+        if ($persistent !== null) {
+            $this->persistent = $persistent;
+        }
+
+        if ($timeout !== null) {
+            $this->timeout = $timeout;
+        }
+
+        $openfunc = $this->persistent ? 'pfsockopen' : 'fsockopen';
+        $errno = 0;
+        $errstr = '';
+        if ($options && function_exists('stream_context_create')) {
+            if ($this->timeout) {
+                $timeout = $this->timeout;
+            } else {
+                $timeout = 0;
+            }
+            $context = stream_context_create($options);
+            $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $timeout, $context);
+        } else {
+            if ($this->timeout) {
+                $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $this->timeout);
+            } else {
+                $fp = @$openfunc($this->addr, $this->port, $errno, $errstr);
+            }
+        }
+
+        if (!$fp) {
+            return $this->raiseError($errstr, $errno);
+        }
+
+        $this->fp = $fp;
+
+        return $this->setBlocking($this->blocking);
+    }
+
+    /**
+     * Disconnects from the peer, closes the socket.
+     *
+     * @access public
+     * @return mixed true on success or an error object otherwise
+     */
+    function disconnect()
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        @fclose($this->fp);
+        $this->fp = null;
+        return true;
+    }
+
+    /**
+     * Find out if the socket is in blocking mode.
+     *
+     * @access public
+     * @return boolean  The current blocking mode.
+     */
+    function isBlocking()
+    {
+        return $this->blocking;
+    }
+
+    /**
+     * Sets whether the socket connection should be blocking or
+     * not. A read call to a non-blocking socket will return immediately
+     * if there is no data available, whereas it will block until there
+     * is data for blocking sockets.
+     *
+     * @param boolean $mode  True for blocking sockets, false for nonblocking.
+     * @access public
+     * @return mixed true on success or an error object otherwise
+     */
+    function setBlocking($mode)
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        $this->blocking = $mode;
+        socket_set_blocking($this->fp, $this->blocking);
+        return true;
+    }
+
+    /**
+     * Sets the timeout value on socket descriptor,
+     * expressed in the sum of seconds and microseconds
+     *
+     * @param integer $seconds  Seconds.
+     * @param integer $microseconds  Microseconds.
+     * @access public
+     * @return mixed true on success or an error object otherwise
+     */
+    function setTimeout($seconds, $microseconds)
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        return socket_set_timeout($this->fp, $seconds, $microseconds);
+    }
+
+    /**
+     * Returns information about an existing socket resource.
+     * Currently returns four entries in the result array:
+     *
+     * <p>
+     * timed_out (bool) - The socket timed out waiting for data<br>
+     * blocked (bool) - The socket was blocked<br>
+     * eof (bool) - Indicates EOF event<br>
+     * unread_bytes (int) - Number of bytes left in the socket buffer<br>
+     * </p>
+     *
+     * @access public
+     * @return mixed Array containing information about existing socket resource or an error object otherwise
+     */
+    function getStatus()
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        return socket_get_status($this->fp);
+    }
+
+    /**
+     * Get a specified line of data
+     *
+     * @access public
+     * @return $size bytes of data from the socket, or a PEAR_Error if
+     *         not connected.
+     */
+    function gets($size)
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        return @fgets($this->fp, $size);
+    }
+
+    /**
+     * Read a specified amount of data. This is guaranteed to return,
+     * and has the added benefit of getting everything in one fread()
+     * chunk; if you know the size of the data you're getting
+     * beforehand, this is definitely the way to go.
+     *
+     * @param integer $size  The number of bytes to read from the socket.
+     * @access public
+     * @return $size bytes of data from the socket, or a PEAR_Error if
+     *         not connected.
+     */
+    function read($size)
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        return @fread($this->fp, $size);
+    }
+
+    /**
+     * Write a specified amount of data.
+     *
+     * @param string  $data       Data to write.
+     * @param integer $blocksize  Amount of data to write at once.
+     *                            NULL means all at once.
+     *
+     * @access public
+     * @return mixed true on success or an error object otherwise
+     */
+    function write($data, $blocksize = null)
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        if (is_null($blocksize) && !OS_WINDOWS) {
+            return fwrite($this->fp, $data);
+        } else {
+            if (is_null($blocksize)) {
+                $blocksize = 1024;
+            }
+
+            $pos = 0;
+            $size = strlen($data);
+            while ($pos < $size) {
+                $written = @fwrite($this->fp, substr($data, $pos, $blocksize));
+                if ($written === false) {
+                    return false;
+                }
+                $pos += $written;
+            }
+
+            return $pos;
+        }
+    }
+
+    /**
+     * Write a line of data to the socket, followed by a trailing "\r\n".
+     *
+     * @access public
+     * @return mixed fputs result, or an error
+     */
+    function writeLine($data)
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        return fwrite($this->fp, $data . "\r\n");
+    }
+
+    /**
+     * Tests for end-of-file on a socket descriptor.
+     *
+     * @access public
+     * @return bool
+     */
+    function eof()
+    {
+        return (is_resource($this->fp) && feof($this->fp));
+    }
+
+    /**
+     * Reads a byte of data
+     *
+     * @access public
+     * @return 1 byte of data from the socket, or a PEAR_Error if
+     *         not connected.
+     */
+    function readByte()
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        return ord(@fread($this->fp, 1));
+    }
+
+    /**
+     * Reads a word of data
+     *
+     * @access public
+     * @return 1 word of data from the socket, or a PEAR_Error if
+     *         not connected.
+     */
+    function readWord()
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        $buf = @fread($this->fp, 2);
+        return (ord($buf[0]) + (ord($buf[1]) << 8));
+    }
+
+    /**
+     * Reads an int of data
+     *
+     * @access public
+     * @return integer  1 int of data from the socket, or a PEAR_Error if
+     *                  not connected.
+     */
+    function readInt()
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        $buf = @fread($this->fp, 4);
+        return (ord($buf[0]) + (ord($buf[1]) << 8) +
+                (ord($buf[2]) << 16) + (ord($buf[3]) << 24));
+    }
+
+    /**
+     * Reads a zero-terminated string of data
+     *
+     * @access public
+     * @return string, or a PEAR_Error if
+     *         not connected.
+     */
+    function readString()
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        $string = '';
+        while (($char = @fread($this->fp, 1)) != "\x00")  {
+            $string .= $char;
+        }
+        return $string;
+    }
+
+    /**
+     * Reads an IP Address and returns it in a dot formated string
+     *
+     * @access public
+     * @return Dot formated string, or a PEAR_Error if
+     *         not connected.
+     */
+    function readIPAddress()
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        $buf = @fread($this->fp, 4);
+        return sprintf("%s.%s.%s.%s", ord($buf[0]), ord($buf[1]),
+                       ord($buf[2]), ord($buf[3]));
+    }
+
+    /**
+     * Read until either the end of the socket or a newline, whichever
+     * comes first. Strips the trailing newline from the returned data.
+     *
+     * @access public
+     * @return All available data up to a newline, without that
+     *         newline, or until the end of the socket, or a PEAR_Error if
+     *         not connected.
+     */
+    function readLine()
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        $line = '';
+        $timeout = time() + $this->timeout;
+        while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) {
+            $line .= @fgets($this->fp, $this->lineLength);
+            if (substr($line, -1) == "\n") {
+                return rtrim($line, "\r\n");
+            }
+        }
+        return $line;
+    }
+
+    /**
+     * Read until the socket closes, or until there is no more data in
+     * the inner PHP buffer. If the inner buffer is empty, in blocking
+     * mode we wait for at least 1 byte of data. Therefore, in
+     * blocking mode, if there is no data at all to be read, this
+     * function will never exit (unless the socket is closed on the
+     * remote end).
+     *
+     * @access public
+     *
+     * @return string  All data until the socket closes, or a PEAR_Error if
+     *                 not connected.
+     */
+    function readAll()
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        $data = '';
+        while (!feof($this->fp)) {
+            $data .= @fread($this->fp, $this->lineLength);
+        }
+        return $data;
+    }
+
+    /**
+     * Runs the equivalent of the select() system call on the socket
+     * with a timeout specified by tv_sec and tv_usec.
+     *
+     * @param integer $state    Which of read/write/error to check for.
+     * @param integer $tv_sec   Number of seconds for timeout.
+     * @param integer $tv_usec  Number of microseconds for timeout.
+     *
+     * @access public
+     * @return False if select fails, integer describing which of read/write/error
+     *         are ready, or PEAR_Error if not connected.
+     */
+    function select($state, $tv_sec, $tv_usec = 0)
+    {
+        if (!is_resource($this->fp)) {
+            return $this->raiseError('not connected');
+        }
+
+        $read = null;
+        $write = null;
+        $except = null;
+        if ($state & NET_SOCKET_READ) {
+            $read[] = $this->fp;
+        }
+        if ($state & NET_SOCKET_WRITE) {
+            $write[] = $this->fp;
+        }
+        if ($state & NET_SOCKET_ERROR) {
+            $except[] = $this->fp;
+        }
+        if (false === ($sr = stream_select($read, $write, $except, $tv_sec, $tv_usec))) {
+            return false;
+        }
+
+        $result = 0;
+        if (count($read)) {
+            $result |= NET_SOCKET_READ;
+        }
+        if (count($write)) {
+            $result |= NET_SOCKET_WRITE;
+        }
+        if (count($except)) {
+            $result |= NET_SOCKET_ERROR;
+        }
+        return $result;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Net/URL.php
===================================================================
--- trunk/direct.openmoko.com/pear/Net/URL.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Net/URL.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,410 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Copyright (c) 2002-2004, Richard Heyes                                |
+// | All rights reserved.                                                  |
+// |                                                                       |
+// | Redistribution and use in source and binary forms, with or without    |
+// | modification, are permitted provided that the following conditions    |
+// | are met:                                                              |
+// |                                                                       |
+// | o Redistributions of source code must retain the above copyright      |
+// |   notice, this list of conditions and the following disclaimer.       |
+// | o Redistributions in binary form must reproduce the above copyright   |
+// |   notice, this list of conditions and the following disclaimer in the |
+// |   documentation and/or other materials provided with the distribution.|
+// | o The names of the authors may not be used to endorse or promote      |
+// |   products derived from this software without specific prior written  |
+// |   permission.                                                         |
+// |                                                                       |
+// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |
+// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |
+// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
+// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |
+// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
+// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |
+// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
+// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
+// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |
+// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
+// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |
+// |                                                                       |
+// +-----------------------------------------------------------------------+
+// | Author: Richard Heyes <richard at php net>                            |
+// +-----------------------------------------------------------------------+
+//
+// $Id: URL.php,v 1.36 2004/06/19 18:58:50 richard Exp $
+//
+// Net_URL Class
+
+class Net_URL
+{
+    /**
+    * Full url
+    * @var string
+    */
+    var $url;
+
+    /**
+    * Protocol
+    * @var string
+    */
+    var $protocol;
+
+    /**
+    * Username
+    * @var string
+    */
+    var $username;
+
+    /**
+    * Password
+    * @var string
+    */
+    var $password;
+
+    /**
+    * Host
+    * @var string
+    */
+    var $host;
+
+    /**
+    * Port
+    * @var integer
+    */
+    var $port;
+
+    /**
+    * Path
+    * @var string
+    */
+    var $path;
+
+    /**
+    * Query string
+    * @var array
+    */
+    var $querystring;
+
+    /**
+    * Anchor
+    * @var string
+    */
+    var $anchor;
+
+    /**
+    * Whether to use []
+    * @var bool
+    */
+    var $useBrackets;
+
+    /**
+    * PHP4 Constructor
+    *
+    * @see __construct()
+    */
+    function Net_URL($url = null, $useBrackets = true)
+    {
+        $this->__construct($url, $useBrackets);
+    }
+
+    /**
+    * PHP5 Constructor
+    *
+    * Parses the given url and stores the various parts
+    * Defaults are used in certain cases
+    *
+    * @param string $url         Optional URL
+    * @param bool   $useBrackets Whether to use square brackets when
+    *                            multiple querystrings with the same name
+    *                            exist
+    */
+    function __construct($url = null, $useBrackets = true)
+    {
+        $HTTP_SERVER_VARS  = !empty($_SERVER) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+
+        $this->useBrackets = $useBrackets;
+        $this->url         = $url;
+        $this->user        = '';
+        $this->pass        = '';
+        $this->host        = '';
+        $this->port        = 80;
+        $this->path        = '';
+        $this->querystring = array();
+        $this->anchor      = '';
+
+        // Only use defaults if not an absolute URL given
+        if (!preg_match('/^[a-z0-9]+:\/\//i', $url)) {
+
+            $this->protocol    = (@$HTTP_SERVER_VARS['HTTPS'] == 'on' ? 'https' : 'http');
+
+            /**
+            * Figure out host/port
+            */
+            if (!empty($HTTP_SERVER_VARS['HTTP_HOST']) AND preg_match('/^(.*)(:([0-9]+))?$/U', $HTTP_SERVER_VARS['HTTP_HOST'], $matches)) {
+                $host = $matches[1];
+                if (!empty($matches[3])) {
+                    $port = $matches[3];
+                } else {
+                    $port = $this->getStandardPort($this->protocol);
+                }
+            }
+
+            $this->user        = '';
+            $this->pass        = '';
+            $this->host        = !empty($host) ? $host : (isset($HTTP_SERVER_VARS['SERVER_NAME']) ? $HTTP_SERVER_VARS['SERVER_NAME'] : 'localhost');
+            $this->port        = !empty($port) ? $port : (isset($HTTP_SERVER_VARS['SERVER_PORT']) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $this->getStandardPort($this->protocol));
+            $this->path        = !empty($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : '/';
+            $this->querystring = isset($HTTP_SERVER_VARS['QUERY_STRING']) ? $this->_parseRawQuerystring($HTTP_SERVER_VARS['QUERY_STRING']) : null;
+            $this->anchor      = '';
+        }
+
+        // Parse the url and store the various parts
+        if (!empty($url)) {
+            $urlinfo = parse_url($url);
+
+            // Default querystring
+            $this->querystring = array();
+
+            foreach ($urlinfo as $key => $value) {
+                switch ($key) {
+                    case 'scheme':
+                        $this->protocol = $value;
+                        $this->port     = $this->getStandardPort($value);
+                        break;
+
+                    case 'user':
+                    case 'pass':
+                    case 'host':
+                    case 'port':
+                        $this->$key = $value;
+                        break;
+
+                    case 'path':
+                        if ($value{0} == '/') {
+                            $this->path = $value;
+                        } else {
+                            $path = dirname($this->path) == DIRECTORY_SEPARATOR ? '' : dirname($this->path);
+                            $this->path = sprintf('%s/%s', $path, $value);
+                        }
+                        break;
+
+                    case 'query':
+                        $this->querystring = $this->_parseRawQueryString($value);
+                        break;
+
+                    case 'fragment':
+                        $this->anchor = $value;
+                        break;
+                }
+            }
+        }
+    }
+
+    /**
+    * Returns full url
+    *
+    * @return string Full url
+    * @access public
+    */
+    function getURL()
+    {
+        $querystring = $this->getQueryString();
+
+        $this->url = $this->protocol . '://'
+                   . $this->user . (!empty($this->pass) ? ':' : '')
+                   . $this->pass . (!empty($this->user) ? '@' : '')
+                   . $this->host . ($this->port == $this->getStandardPort($this->protocol) ? '' : ':' . $this->port)
+                   . $this->path
+                   . (!empty($querystring) ? '?' . $querystring : '')
+                   . (!empty($this->anchor) ? '#' . $this->anchor : '');
+
+        return $this->url;
+    }
+
+    /**
+    * Adds a querystring item
+    *
+    * @param  string $name       Name of item
+    * @param  string $value      Value of item
+    * @param  bool   $preencoded Whether value is urlencoded or not, default = not
+    * @access public
+    */
+    function addQueryString($name, $value, $preencoded = false)
+    {
+        if ($preencoded) {
+            $this->querystring[$name] = $value;
+        } else {
+            $this->querystring[$name] = is_array($value) ? array_map('rawurlencode', $value): rawurlencode($value);
+        }
+    }
+
+    /**
+    * Removes a querystring item
+    *
+    * @param  string $name Name of item
+    * @access public
+    */
+    function removeQueryString($name)
+    {
+        if (isset($this->querystring[$name])) {
+            unset($this->querystring[$name]);
+        }
+    }
+
+    /**
+    * Sets the querystring to literally what you supply
+    *
+    * @param  string $querystring The querystring data. Should be of the format foo=bar&x=y etc
+    * @access public
+    */
+    function addRawQueryString($querystring)
+    {
+        $this->querystring = $this->_parseRawQueryString($querystring);
+    }
+
+    /**
+    * Returns flat querystring
+    *
+    * @return string Querystring
+    * @access public
+    */
+    function getQueryString()
+    {
+        if (!empty($this->querystring)) {
+            foreach ($this->querystring as $name => $value) {
+                if (is_array($value)) {
+                    foreach ($value as $k => $v) {
+                        $querystring[] = $this->useBrackets ? sprintf('%s[%s]=%s', $name, $k, $v) : ($name . '=' . $v);
+                    }
+                } elseif (!is_null($value)) {
+                    $querystring[] = $name . '=' . $value;
+                } else {
+                    $querystring[] = $name;
+                }
+            }
+            $querystring = implode(ini_get('arg_separator.output'), $querystring);
+        } else {
+            $querystring = '';
+        }
+
+        return $querystring;
+    }
+
+    /**
+    * Parses raw querystring and returns an array of it
+    *
+    * @param  string  $querystring The querystring to parse
+    * @return array                An array of the querystring data
+    * @access private
+    */
+    function _parseRawQuerystring($querystring)
+    {
+        $parts  = preg_split('/[' . preg_quote(ini_get('arg_separator.input'), '/') . ']/', $querystring, -1, PREG_SPLIT_NO_EMPTY);
+        $return = array();
+
+        foreach ($parts as $part) {
+            if (strpos($part, '=') !== false) {
+                $value = substr($part, strpos($part, '=') + 1);
+                $key   = substr($part, 0, strpos($part, '='));
+            } else {
+                $value = null;
+                $key   = $part;
+            }
+            if (substr($key, -2) == '[]') {
+                $key = substr($key, 0, -2);
+                if (@!is_array($return[$key])) {
+                    $return[$key]   = array();
+                    $return[$key][] = $value;
+                } else {
+                    $return[$key][] = $value;
+                }
+            } elseif (!$this->useBrackets AND !empty($return[$key])) {
+                $return[$key]   = (array)$return[$key];
+                $return[$key][] = $value;
+            } else {
+                $return[$key] = $value;
+            }
+        }
+
+        return $return;
+    }
+
+    /**
+    * Resolves //, ../ and ./ from a path and returns
+    * the result. Eg:
+    *
+    * /foo/bar/../boo.php    => /foo/boo.php
+    * /foo/bar/../../boo.php => /boo.php
+    * /foo/bar/.././/boo.php => /foo/boo.php
+    *
+    * This method can also be called statically.
+    *
+    * @param  string $url URL path to resolve
+    * @return string      The result
+    */
+    function resolvePath($path)
+    {
+        $path = explode('/', str_replace('//', '/', $path));
+
+        for ($i=0; $i<count($path); $i++) {
+            if ($path[$i] == '.') {
+                unset($path[$i]);
+                $path = array_values($path);
+                $i--;
+
+            } elseif ($path[$i] == '..' AND ($i > 1 OR ($i == 1 AND $path[0] != '') ) ) {
+                unset($path[$i]);
+                unset($path[$i-1]);
+                $path = array_values($path);
+                $i -= 2;
+
+            } elseif ($path[$i] == '..' AND $i == 1 AND $path[0] == '') {
+                unset($path[$i]);
+                $path = array_values($path);
+                $i--;
+
+            } else {
+                continue;
+            }
+        }
+
+        return implode('/', $path);
+    }
+
+    /**
+    * Returns the standard port number for a protocol
+    *
+    * @param  string  $scheme The protocol to lookup
+    * @return integer         Port number or NULL if no scheme matches
+    *
+    * @author Philippe Jausions <Philippe.Jausions at 11abacus.com>
+    */
+    function getStandardPort($scheme)
+    {
+        switch (strtolower($scheme)) {
+            case 'http':    return 80;
+            case 'https':   return 443;
+            case 'ftp':     return 21;
+            case 'imap':    return 143;
+            case 'imaps':   return 993;
+            case 'pop3':    return 110;
+            case 'pop3s':   return 995;
+            default:        return null;
+       }
+    }
+
+    /**
+    * Forces the URL to a particular protocol
+    *
+    * @param string  $protocol Protocol to force the URL to
+    * @param integer $port     Optional port (standard port is used by default)
+    */
+    function setProtocol($protocol, $port = null)
+    {
+        $this->protocol = $protocol;
+        $this->port = is_null($port) ? $this->getStandardPort() : $port;
+    }
+
+}
+?>

Added: trunk/direct.openmoko.com/pear/PEAR.php
===================================================================
--- trunk/direct.openmoko.com/pear/PEAR.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/PEAR.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1101 @@
+<?php
+/**
+ * PEAR, the PHP Extension and Application Repository
+ *
+ * PEAR class and PEAR_Error class
+ *
+ * PHP versions 4 and 5
+ *
+ * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
+ * the PHP License and are unable to obtain it through the web, please
+ * send a note to license at php.net so we can mail you a copy immediately.
+ *
+ * @category   pear
+ * @package    PEAR
+ * @author     Sterling Hughes <sterling at php.net>
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Tomas V.V.Cox <cox at idecnet.com>
+ * @author     Greg Beaver <cellog at php.net>
+ * @copyright  1997-2006 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    CVS: $Id: PEAR.php,v 1.98 2006/01/23 05:38:05 cellog Exp $
+ * @link       http://pear.php.net/package/PEAR
+ * @since      File available since Release 0.1
+ */
+
+/**#@+
+ * ERROR constants
+ */
+define('PEAR_ERROR_RETURN',     1);
+define('PEAR_ERROR_PRINT',      2);
+define('PEAR_ERROR_TRIGGER',    4);
+define('PEAR_ERROR_DIE',        8);
+define('PEAR_ERROR_CALLBACK',  16);
+/**
+ * WARNING: obsolete
+ * @deprecated
+ */
+define('PEAR_ERROR_EXCEPTION', 32);
+/**#@-*/
+define('PEAR_ZE2', (function_exists('version_compare') &&
+                    version_compare(zend_version(), "2-dev", "ge")));
+
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    define('OS_WINDOWS', true);
+    define('OS_UNIX',    false);
+    define('PEAR_OS',    'Windows');
+} else {
+    define('OS_WINDOWS', false);
+    define('OS_UNIX',    true);
+    define('PEAR_OS',    'Unix'); // blatant assumption
+}
+
+// instant backwards compatibility
+if (!defined('PATH_SEPARATOR')) {
+    if (OS_WINDOWS) {
+        define('PATH_SEPARATOR', ';');
+    } else {
+        define('PATH_SEPARATOR', ':');
+    }
+}
+
+$GLOBALS['_PEAR_default_error_mode']     = PEAR_ERROR_RETURN;
+$GLOBALS['_PEAR_default_error_options']  = E_USER_NOTICE;
+$GLOBALS['_PEAR_destructor_object_list'] = array();
+$GLOBALS['_PEAR_shutdown_funcs']         = array();
+$GLOBALS['_PEAR_error_handler_stack']    = array();
+
+ at ini_set('track_errors', true);
+
+/**
+ * Base class for other PEAR classes.  Provides rudimentary
+ * emulation of destructors.
+ *
+ * If you want a destructor in your class, inherit PEAR and make a
+ * destructor method called _yourclassname (same name as the
+ * constructor, but with a "_" prefix).  Also, in your constructor you
+ * have to call the PEAR constructor: $this->PEAR();.
+ * The destructor method will be called without parameters.  Note that
+ * at in some SAPI implementations (such as Apache), any output during
+ * the request shutdown (in which destructors are called) seems to be
+ * discarded.  If you need to get any debug information from your
+ * destructor, use error_log(), syslog() or something similar.
+ *
+ * IMPORTANT! To use the emulated destructors you need to create the
+ * objects by reference: $obj =& new PEAR_child;
+ *
+ * @category   pear
+ * @package    PEAR
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Tomas V.V. Cox <cox at idecnet.com>
+ * @author     Greg Beaver <cellog at php.net>
+ * @copyright  1997-2006 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: 1.4.9
+ * @link       http://pear.php.net/package/PEAR
+ * @see        PEAR_Error
+ * @since      Class available since PHP 4.0.2
+ * @link        http://pear.php.net/manual/en/core.pear.php#core.pear.pear
+ */
+class PEAR
+{
+    // {{{ properties
+
+    /**
+     * Whether to enable internal debug messages.
+     *
+     * @var     bool
+     * @access  private
+     */
+    var $_debug = false;
+
+    /**
+     * Default error mode for this object.
+     *
+     * @var     int
+     * @access  private
+     */
+    var $_default_error_mode = null;
+
+    /**
+     * Default error options used for this object when error mode
+     * is PEAR_ERROR_TRIGGER.
+     *
+     * @var     int
+     * @access  private
+     */
+    var $_default_error_options = null;
+
+    /**
+     * Default error handler (callback) for this object, if error mode is
+     * PEAR_ERROR_CALLBACK.
+     *
+     * @var     string
+     * @access  private
+     */
+    var $_default_error_handler = '';
+
+    /**
+     * Which class to use for error objects.
+     *
+     * @var     string
+     * @access  private
+     */
+    var $_error_class = 'PEAR_Error';
+
+    /**
+     * An array of expected errors.
+     *
+     * @var     array
+     * @access  private
+     */
+    var $_expected_errors = array();
+
+    // }}}
+
+    // {{{ constructor
+
+    /**
+     * Constructor.  Registers this object in
+     * $_PEAR_destructor_object_list for destructor emulation if a
+     * destructor object exists.
+     *
+     * @param string $error_class  (optional) which class to use for
+     *        error objects, defaults to PEAR_Error.
+     * @access public
+     * @return void
+     */
+    function PEAR($error_class = null)
+    {
+        $classname = strtolower(get_class($this));
+        if ($this->_debug) {
+            print "PEAR constructor called, class=$classname\n";
+        }
+        if ($error_class !== null) {
+            $this->_error_class = $error_class;
+        }
+        while ($classname && strcasecmp($classname, "pear")) {
+            $destructor = "_$classname";
+            if (method_exists($this, $destructor)) {
+                global $_PEAR_destructor_object_list;
+                $_PEAR_destructor_object_list[] = &$this;
+                if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
+                    register_shutdown_function("_PEAR_call_destructors");
+                    $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
+                }
+                break;
+            } else {
+                $classname = get_parent_class($classname);
+            }
+        }
+    }
+
+    // }}}
+    // {{{ destructor
+
+    /**
+     * Destructor (the emulated type of...).  Does nothing right now,
+     * but is included for forward compatibility, so subclass
+     * destructors should always call it.
+     *
+     * See the note in the class desciption about output from
+     * destructors.
+     *
+     * @access public
+     * @return void
+     */
+    function _PEAR() {
+        if ($this->_debug) {
+            printf("PEAR destructor called, class=%s\n", strtolower(get_class($this)));
+        }
+    }
+
+    // }}}
+    // {{{ getStaticProperty()
+
+    /**
+    * If you have a class that's mostly/entirely static, and you need static
+    * properties, you can use this method to simulate them. Eg. in your method(s)
+    * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');
+    * You MUST use a reference, or they will not persist!
+    *
+    * @access public
+    * @param  string $class  The calling classname, to prevent clashes
+    * @param  string $var    The variable to retrieve.
+    * @return mixed   A reference to the variable. If not set it will be
+    *                 auto initialised to NULL.
+    */
+    function &getStaticProperty($class, $var)
+    {
+        static $properties;
+        return $properties[$class][$var];
+    }
+
+    // }}}
+    // {{{ registerShutdownFunc()
+
+    /**
+    * Use this function to register a shutdown method for static
+    * classes.
+    *
+    * @access public
+    * @param  mixed $func  The function name (or array of class/method) to call
+    * @param  mixed $args  The arguments to pass to the function
+    * @return void
+    */
+    function registerShutdownFunc($func, $args = array())
+    {
+        // if we are called statically, there is a potential
+        // that no shutdown func is registered.  Bug #6445
+        if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
+            register_shutdown_function("_PEAR_call_destructors");
+            $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
+        }
+        $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
+    }
+
+    // }}}
+    // {{{ isError()
+
+    /**
+     * Tell whether a value is a PEAR error.
+     *
+     * @param   mixed $data   the value to test
+     * @param   int   $code   if $data is an error object, return true
+     *                        only if $code is a string and
+     *                        $obj->getMessage() == $code or
+     *                        $code is an integer and $obj->getCode() == $code
+     * @access  public
+     * @return  bool    true if parameter is an error
+     */
+    function isError($data, $code = null)
+    {
+        if (is_a($data, 'PEAR_Error')) {
+            if (is_null($code)) {
+                return true;
+            } elseif (is_string($code)) {
+                return $data->getMessage() == $code;
+            } else {
+                return $data->getCode() == $code;
+            }
+        }
+        return false;
+    }
+
+    // }}}
+    // {{{ setErrorHandling()
+
+    /**
+     * Sets how errors generated by this object should be handled.
+     * Can be invoked both in objects and statically.  If called
+     * statically, setErrorHandling sets the default behaviour for all
+     * PEAR objects.  If called in an object, setErrorHandling sets
+     * the default behaviour for that object.
+     *
+     * @param int $mode
+     *        One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
+     *        PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
+     *        PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION.
+     *
+     * @param mixed $options
+     *        When $mode is PEAR_ERROR_TRIGGER, this is the error level (one
+     *        of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
+     *
+     *        When $mode is PEAR_ERROR_CALLBACK, this parameter is expected
+     *        to be the callback function or method.  A callback
+     *        function is a string with the name of the function, a
+     *        callback method is an array of two elements: the element
+     *        at index 0 is the object, and the element at index 1 is
+     *        the name of the method to call in the object.
+     *
+     *        When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is
+     *        a printf format string used when printing the error
+     *        message.
+     *
+     * @access public
+     * @return void
+     * @see PEAR_ERROR_RETURN
+     * @see PEAR_ERROR_PRINT
+     * @see PEAR_ERROR_TRIGGER
+     * @see PEAR_ERROR_DIE
+     * @see PEAR_ERROR_CALLBACK
+     * @see PEAR_ERROR_EXCEPTION
+     *
+     * @since PHP 4.0.5
+     */
+
+    function setErrorHandling($mode = null, $options = null)
+    {
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $setmode     = &$this->_default_error_mode;
+            $setoptions  = &$this->_default_error_options;
+        } else {
+            $setmode     = &$GLOBALS['_PEAR_default_error_mode'];
+            $setoptions  = &$GLOBALS['_PEAR_default_error_options'];
+        }
+
+        switch ($mode) {
+            case PEAR_ERROR_EXCEPTION:
+            case PEAR_ERROR_RETURN:
+            case PEAR_ERROR_PRINT:
+            case PEAR_ERROR_TRIGGER:
+            case PEAR_ERROR_DIE:
+            case null:
+                $setmode = $mode;
+                $setoptions = $options;
+                break;
+
+            case PEAR_ERROR_CALLBACK:
+                $setmode = $mode;
+                // class/object method callback
+                if (is_callable($options)) {
+                    $setoptions = $options;
+                } else {
+                    trigger_error("invalid error callback", E_USER_WARNING);
+                }
+                break;
+
+            default:
+                trigger_error("invalid error mode", E_USER_WARNING);
+                break;
+        }
+    }
+
+    // }}}
+    // {{{ expectError()
+
+    /**
+     * This method is used to tell which errors you expect to get.
+     * Expected errors are always returned with error mode
+     * PEAR_ERROR_RETURN.  Expected error codes are stored in a stack,
+     * and this method pushes a new element onto it.  The list of
+     * expected errors are in effect until they are popped off the
+     * stack with the popExpect() method.
+     *
+     * Note that this method can not be called statically
+     *
+     * @param mixed $code a single error code or an array of error codes to expect
+     *
+     * @return int     the new depth of the "expected errors" stack
+     * @access public
+     */
+    function expectError($code = '*')
+    {
+        if (is_array($code)) {
+            array_push($this->_expected_errors, $code);
+        } else {
+            array_push($this->_expected_errors, array($code));
+        }
+        return sizeof($this->_expected_errors);
+    }
+
+    // }}}
+    // {{{ popExpect()
+
+    /**
+     * This method pops one element off the expected error codes
+     * stack.
+     *
+     * @return array   the list of error codes that were popped
+     */
+    function popExpect()
+    {
+        return array_pop($this->_expected_errors);
+    }
+
+    // }}}
+    // {{{ _checkDelExpect()
+
+    /**
+     * This method checks unsets an error code if available
+     *
+     * @param mixed error code
+     * @return bool true if the error code was unset, false otherwise
+     * @access private
+     * @since PHP 4.3.0
+     */
+    function _checkDelExpect($error_code)
+    {
+        $deleted = false;
+
+        foreach ($this->_expected_errors AS $key => $error_array) {
+            if (in_array($error_code, $error_array)) {
+                unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);
+                $deleted = true;
+            }
+
+            // clean up empty arrays
+            if (0 == count($this->_expected_errors[$key])) {
+                unset($this->_expected_errors[$key]);
+            }
+        }
+        return $deleted;
+    }
+
+    // }}}
+    // {{{ delExpect()
+
+    /**
+     * This method deletes all occurences of the specified element from
+     * the expected error codes stack.
+     *
+     * @param  mixed $error_code error code that should be deleted
+     * @return mixed list of error codes that were deleted or error
+     * @access public
+     * @since PHP 4.3.0
+     */
+    function delExpect($error_code)
+    {
+        $deleted = false;
+
+        if ((is_array($error_code) && (0 != count($error_code)))) {
+            // $error_code is a non-empty array here;
+            // we walk through it trying to unset all
+            // values
+            foreach($error_code as $key => $error) {
+                if ($this->_checkDelExpect($error)) {
+                    $deleted =  true;
+                } else {
+                    $deleted = false;
+                }
+            }
+            return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
+        } elseif (!empty($error_code)) {
+            // $error_code comes alone, trying to unset it
+            if ($this->_checkDelExpect($error_code)) {
+                return true;
+            } else {
+                return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
+            }
+        } else {
+            // $error_code is empty
+            return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
+        }
+    }
+
+    // }}}
+    // {{{ raiseError()
+
+    /**
+     * This method is a wrapper that returns an instance of the
+     * configured error class with this object's default error
+     * handling applied.  If the $mode and $options parameters are not
+     * specified, the object's defaults are used.
+     *
+     * @param mixed $message a text error message or a PEAR error object
+     *
+     * @param int $code      a numeric error code (it is up to your class
+     *                  to define these if you want to use codes)
+     *
+     * @param int $mode      One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
+     *                  PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
+     *                  PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION.
+     *
+     * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter
+     *                  specifies the PHP-internal error level (one of
+     *                  E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
+     *                  If $mode is PEAR_ERROR_CALLBACK, this
+     *                  parameter specifies the callback function or
+     *                  method.  In other error modes this parameter
+     *                  is ignored.
+     *
+     * @param string $userinfo If you need to pass along for example debug
+     *                  information, this parameter is meant for that.
+     *
+     * @param string $error_class The returned error object will be
+     *                  instantiated from this class, if specified.
+     *
+     * @param bool $skipmsg If true, raiseError will only pass error codes,
+     *                  the error message parameter will be dropped.
+     *
+     * @access public
+     * @return object   a PEAR error object
+     * @see PEAR::setErrorHandling
+     * @since PHP 4.0.5
+     */
+    function &raiseError($message = null,
+                         $code = null,
+                         $mode = null,
+                         $options = null,
+                         $userinfo = null,
+                         $error_class = null,
+                         $skipmsg = false)
+    {
+        // The error is yet a PEAR error object
+        if (is_object($message)) {
+            $code        = $message->getCode();
+            $userinfo    = $message->getUserInfo();
+            $error_class = $message->getType();
+            $message->error_message_prefix = '';
+            $message     = $message->getMessage();
+        }
+
+        if (isset($this) && isset($this->_expected_errors) && sizeof($this->_expected_errors) > 0 && sizeof($exp = end($this->_expected_errors))) {
+            if ($exp[0] == "*" ||
+                (is_int(reset($exp)) && in_array($code, $exp)) ||
+                (is_string(reset($exp)) && in_array($message, $exp))) {
+                $mode = PEAR_ERROR_RETURN;
+            }
+        }
+        // No mode given, try global ones
+        if ($mode === null) {
+            // Class error handler
+            if (isset($this) && isset($this->_default_error_mode)) {
+                $mode    = $this->_default_error_mode;
+                $options = $this->_default_error_options;
+            // Global error handler
+            } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) {
+                $mode    = $GLOBALS['_PEAR_default_error_mode'];
+                $options = $GLOBALS['_PEAR_default_error_options'];
+            }
+        }
+
+        if ($error_class !== null) {
+            $ec = $error_class;
+        } elseif (isset($this) && isset($this->_error_class)) {
+            $ec = $this->_error_class;
+        } else {
+            $ec = 'PEAR_Error';
+        }
+        if ($skipmsg) {
+            $a = &new $ec($code, $mode, $options, $userinfo);
+            return $a;
+        } else {
+            $a = &new $ec($message, $code, $mode, $options, $userinfo);
+            return $a;
+        }
+    }
+
+    // }}}
+    // {{{ throwError()
+
+    /**
+     * Simpler form of raiseError with fewer options.  In most cases
+     * message, code and userinfo are enough.
+     *
+     * @param string $message
+     *
+     */
+    function &throwError($message = null,
+                         $code = null,
+                         $userinfo = null)
+    {
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $a = &$this->raiseError($message, $code, null, null, $userinfo);
+            return $a;
+        } else {
+            $a = &PEAR::raiseError($message, $code, null, null, $userinfo);
+            return $a;
+        }
+    }
+
+    // }}}
+    function staticPushErrorHandling($mode, $options = null)
+    {
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
+        $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
+        $def_options = &$GLOBALS['_PEAR_default_error_options'];
+        $stack[] = array($def_mode, $def_options);
+        switch ($mode) {
+            case PEAR_ERROR_EXCEPTION:
+            case PEAR_ERROR_RETURN:
+            case PEAR_ERROR_PRINT:
+            case PEAR_ERROR_TRIGGER:
+            case PEAR_ERROR_DIE:
+            case null:
+                $def_mode = $mode;
+                $def_options = $options;
+                break;
+
+            case PEAR_ERROR_CALLBACK:
+                $def_mode = $mode;
+                // class/object method callback
+                if (is_callable($options)) {
+                    $def_options = $options;
+                } else {
+                    trigger_error("invalid error callback", E_USER_WARNING);
+                }
+                break;
+
+            default:
+                trigger_error("invalid error mode", E_USER_WARNING);
+                break;
+        }
+        $stack[] = array($mode, $options);
+        return true;
+    }
+
+    function staticPopErrorHandling()
+    {
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
+        $setmode     = &$GLOBALS['_PEAR_default_error_mode'];
+        $setoptions  = &$GLOBALS['_PEAR_default_error_options'];
+        array_pop($stack);
+        list($mode, $options) = $stack[sizeof($stack) - 1];
+        array_pop($stack);
+        switch ($mode) {
+            case PEAR_ERROR_EXCEPTION:
+            case PEAR_ERROR_RETURN:
+            case PEAR_ERROR_PRINT:
+            case PEAR_ERROR_TRIGGER:
+            case PEAR_ERROR_DIE:
+            case null:
+                $setmode = $mode;
+                $setoptions = $options;
+                break;
+
+            case PEAR_ERROR_CALLBACK:
+                $setmode = $mode;
+                // class/object method callback
+                if (is_callable($options)) {
+                    $setoptions = $options;
+                } else {
+                    trigger_error("invalid error callback", E_USER_WARNING);
+                }
+                break;
+
+            default:
+                trigger_error("invalid error mode", E_USER_WARNING);
+                break;
+        }
+        return true;
+    }
+
+    // {{{ pushErrorHandling()
+
+    /**
+     * Push a new error handler on top of the error handler options stack. With this
+     * you can easily override the actual error handler for some code and restore
+     * it later with popErrorHandling.
+     *
+     * @param mixed $mode (same as setErrorHandling)
+     * @param mixed $options (same as setErrorHandling)
+     *
+     * @return bool Always true
+     *
+     * @see PEAR::setErrorHandling
+     */
+    function pushErrorHandling($mode, $options = null)
+    {
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $def_mode    = &$this->_default_error_mode;
+            $def_options = &$this->_default_error_options;
+        } else {
+            $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
+            $def_options = &$GLOBALS['_PEAR_default_error_options'];
+        }
+        $stack[] = array($def_mode, $def_options);
+
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $this->setErrorHandling($mode, $options);
+        } else {
+            PEAR::setErrorHandling($mode, $options);
+        }
+        $stack[] = array($mode, $options);
+        return true;
+    }
+
+    // }}}
+    // {{{ popErrorHandling()
+
+    /**
+    * Pop the last error handler used
+    *
+    * @return bool Always true
+    *
+    * @see PEAR::pushErrorHandling
+    */
+    function popErrorHandling()
+    {
+        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
+        array_pop($stack);
+        list($mode, $options) = $stack[sizeof($stack) - 1];
+        array_pop($stack);
+        if (isset($this) && is_a($this, 'PEAR')) {
+            $this->setErrorHandling($mode, $options);
+        } else {
+            PEAR::setErrorHandling($mode, $options);
+        }
+        return true;
+    }
+
+    // }}}
+    // {{{ loadExtension()
+
+    /**
+    * OS independant PHP extension load. Remember to take care
+    * on the correct extension name for case sensitive OSes.
+    *
+    * @param string $ext The extension name
+    * @return bool Success or not on the dl() call
+    */
+    function loadExtension($ext)
+    {
+        if (!extension_loaded($ext)) {
+            // if either returns true dl() will produce a FATAL error, stop that
+            if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {
+                return false;
+            }
+            if (OS_WINDOWS) {
+                $suffix = '.dll';
+            } elseif (PHP_OS == 'HP-UX') {
+                $suffix = '.sl';
+            } elseif (PHP_OS == 'AIX') {
+                $suffix = '.a';
+            } elseif (PHP_OS == 'OSX') {
+                $suffix = '.bundle';
+            } else {
+                $suffix = '.so';
+            }
+            return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
+        }
+        return true;
+    }
+
+    // }}}
+}
+
+// {{{ _PEAR_call_destructors()
+
+function _PEAR_call_destructors()
+{
+    global $_PEAR_destructor_object_list;
+    if (is_array($_PEAR_destructor_object_list) &&
+        sizeof($_PEAR_destructor_object_list))
+    {
+        reset($_PEAR_destructor_object_list);
+        if (@PEAR::getStaticProperty('PEAR', 'destructlifo')) {
+            $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
+        }
+        while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
+            $classname = get_class($objref);
+            while ($classname) {
+                $destructor = "_$classname";
+                if (method_exists($objref, $destructor)) {
+                    $objref->$destructor();
+                    break;
+                } else {
+                    $classname = get_parent_class($classname);
+                }
+            }
+        }
+        // Empty the object list to ensure that destructors are
+        // not called more than once.
+        $_PEAR_destructor_object_list = array();
+    }
+
+    // Now call the shutdown functions
+    if (is_array($GLOBALS['_PEAR_shutdown_funcs']) AND !empty($GLOBALS['_PEAR_shutdown_funcs'])) {
+        foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) {
+            call_user_func_array($value[0], $value[1]);
+        }
+    }
+}
+
+// }}}
+/**
+ * Standard PEAR error class for PHP 4
+ *
+ * This class is supserseded by {@link PEAR_Exception} in PHP 5
+ *
+ * @category   pear
+ * @package    PEAR
+ * @author     Stig Bakken <ssb at php.net>
+ * @author     Tomas V.V. Cox <cox at idecnet.com>
+ * @author     Gregory Beaver <cellog at php.net>
+ * @copyright  1997-2006 The PHP Group
+ * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
+ * @version    Release: 1.4.9
+ * @link       http://pear.php.net/manual/en/core.pear.pear-error.php
+ * @see        PEAR::raiseError(), PEAR::throwError()
+ * @since      Class available since PHP 4.0.2
+ */
+class PEAR_Error
+{
+    // {{{ properties
+
+    var $error_message_prefix = '';
+    var $mode                 = PEAR_ERROR_RETURN;
+    var $level                = E_USER_NOTICE;
+    var $code                 = -1;
+    var $message              = '';
+    var $userinfo             = '';
+    var $backtrace            = null;
+
+    // }}}
+    // {{{ constructor
+
+    /**
+     * PEAR_Error constructor
+     *
+     * @param string $message  message
+     *
+     * @param int $code     (optional) error code
+     *
+     * @param int $mode     (optional) error mode, one of: PEAR_ERROR_RETURN,
+     * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER,
+     * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION
+     *
+     * @param mixed $options   (optional) error level, _OR_ in the case of
+     * PEAR_ERROR_CALLBACK, the callback function or object/method
+     * tuple.
+     *
+     * @param string $userinfo (optional) additional user/debug info
+     *
+     * @access public
+     *
+     */
+    function PEAR_Error($message = 'unknown error', $code = null,
+                        $mode = null, $options = null, $userinfo = null)
+    {
+        if ($mode === null) {
+            $mode = PEAR_ERROR_RETURN;
+        }
+        $this->message   = $message;
+        $this->code      = $code;
+        $this->mode      = $mode;
+        $this->userinfo  = $userinfo;
+        if (function_exists("debug_backtrace")) {
+            if (@!PEAR::getStaticProperty('PEAR_Error', 'skiptrace')) {
+                $this->backtrace = debug_backtrace();
+            }
+        }
+        if ($mode & PEAR_ERROR_CALLBACK) {
+            $this->level = E_USER_NOTICE;
+            $this->callback = $options;
+        } else {
+            if ($options === null) {
+                $options = E_USER_NOTICE;
+            }
+            $this->level = $options;
+            $this->callback = null;
+        }
+        if ($this->mode & PEAR_ERROR_PRINT) {
+            if (is_null($options) || is_int($options)) {
+                $format = "%s";
+            } else {
+                $format = $options;
+            }
+            printf($format, $this->getMessage());
+        }
+        if ($this->mode & PEAR_ERROR_TRIGGER) {
+            trigger_error($this->getMessage(), $this->level);
+        }
+        if ($this->mode & PEAR_ERROR_DIE) {
+            $msg = $this->getMessage();
+            if (is_null($options) || is_int($options)) {
+                $format = "%s";
+                if (substr($msg, -1) != "\n") {
+                    $msg .= "\n";
+                }
+            } else {
+                $format = $options;
+            }
+            die(sprintf($format, $msg));
+        }
+        if ($this->mode & PEAR_ERROR_CALLBACK) {
+            if (is_callable($this->callback)) {
+                call_user_func($this->callback, $this);
+            }
+        }
+        if ($this->mode & PEAR_ERROR_EXCEPTION) {
+            trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
+            eval('$e = new Exception($this->message, $this->code);throw($e);');
+        }
+    }
+
+    // }}}
+    // {{{ getMode()
+
+    /**
+     * Get the error mode from an error object.
+     *
+     * @return int error mode
+     * @access public
+     */
+    function getMode() {
+        return $this->mode;
+    }
+
+    // }}}
+    // {{{ getCallback()
+
+    /**
+     * Get the callback function/method from an error object.
+     *
+     * @return mixed callback function or object/method array
+     * @access public
+     */
+    function getCallback() {
+        return $this->callback;
+    }
+
+    // }}}
+    // {{{ getMessage()
+
+
+    /**
+     * Get the error message from an error object.
+     *
+     * @return  string  full error message
+     * @access public
+     */
+    function getMessage()
+    {
+        return ($this->error_message_prefix . $this->message);
+    }
+
+
+    // }}}
+    // {{{ getCode()
+
+    /**
+     * Get error code from an error object
+     *
+     * @return int error code
+     * @access public
+     */
+     function getCode()
+     {
+        return $this->code;
+     }
+
+    // }}}
+    // {{{ getType()
+
+    /**
+     * Get the name of this error/exception.
+     *
+     * @return string error/exception name (type)
+     * @access public
+     */
+    function getType()
+    {
+        return get_class($this);
+    }
+
+    // }}}
+    // {{{ getUserInfo()
+
+    /**
+     * Get additional user-supplied information.
+     *
+     * @return string user-supplied information
+     * @access public
+     */
+    function getUserInfo()
+    {
+        return $this->userinfo;
+    }
+
+    // }}}
+    // {{{ getDebugInfo()
+
+    /**
+     * Get additional debug information supplied by the application.
+     *
+     * @return string debug information
+     * @access public
+     */
+    function getDebugInfo()
+    {
+        return $this->getUserInfo();
+    }
+
+    // }}}
+    // {{{ getBacktrace()
+
+    /**
+     * Get the call backtrace from where the error was generated.
+     * Supported with PHP 4.3.0 or newer.
+     *
+     * @param int $frame (optional) what frame to fetch
+     * @return array Backtrace, or NULL if not available.
+     * @access public
+     */
+    function getBacktrace($frame = null)
+    {
+        if (defined('PEAR_IGNORE_BACKTRACE')) {
+            return null;
+        }
+        if ($frame === null) {
+            return $this->backtrace;
+        }
+        return $this->backtrace[$frame];
+    }
+
+    // }}}
+    // {{{ addUserInfo()
+
+    function addUserInfo($info)
+    {
+        if (empty($this->userinfo)) {
+            $this->userinfo = $info;
+        } else {
+            $this->userinfo .= " ** $info";
+        }
+    }
+
+    // }}}
+    // {{{ toString()
+
+    /**
+     * Make a string representation of this object.
+     *
+     * @return string a string with an object summary
+     * @access public
+     */
+    function toString() {
+        $modes = array();
+        $levels = array(E_USER_NOTICE  => 'notice',
+                        E_USER_WARNING => 'warning',
+                        E_USER_ERROR   => 'error');
+        if ($this->mode & PEAR_ERROR_CALLBACK) {
+            if (is_array($this->callback)) {
+                $callback = (is_object($this->callback[0]) ?
+                    strtolower(get_class($this->callback[0])) :
+                    $this->callback[0]) . '::' .
+                    $this->callback[1];
+            } else {
+                $callback = $this->callback;
+            }
+            return sprintf('[%s: message="%s" code=%d mode=callback '.
+                           'callback=%s prefix="%s" info="%s"]',
+                           strtolower(get_class($this)), $this->message, $this->code,
+                           $callback, $this->error_message_prefix,
+                           $this->userinfo);
+        }
+        if ($this->mode & PEAR_ERROR_PRINT) {
+            $modes[] = 'print';
+        }
+        if ($this->mode & PEAR_ERROR_TRIGGER) {
+            $modes[] = 'trigger';
+        }
+        if ($this->mode & PEAR_ERROR_DIE) {
+            $modes[] = 'die';
+        }
+        if ($this->mode & PEAR_ERROR_RETURN) {
+            $modes[] = 'return';
+        }
+        return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
+                       'prefix="%s" info="%s"]',
+                       strtolower(get_class($this)), $this->message, $this->code,
+                       implode("|", $modes), $levels[$this->level],
+                       $this->error_message_prefix,
+                       $this->userinfo);
+    }
+
+    // }}}
+}
+
+/*
+ * Local Variables:
+ * mode: php
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+?>

Added: trunk/direct.openmoko.com/pear/Services/PayPal/CallerServices.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/CallerServices.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/CallerServices.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,864 @@
+<?php
+/**
+ * File containing the API calling code. Partially generated from the
+ * WSDL - CallerServices.php.in contains the base file with a
+ * placeholder for generated functions and the WSDL version.
+ *
+ * @package Services_PayPal
+ */
+
+/**
+ * Load files we depend on.
+ */
+require_once 'Services/PayPal.php';
+require_once 'Services/PayPal/SOAP/Client.php';
+require_once 'Services/PayPal/Type/XSDType.php';
+require_once 'Log.php';
+
+/**
+ * The WSDL version the SDK is built against.
+ */
+define('PAYPAL_WSDL_VERSION', 2);
+
+/**
+ * Interface class that wraps all WSDL ports into a unified API for
+ * the user. Also handles PayPal-specific details like type handling,
+ * error handling, etc.
+ *
+ * $Id: CallerServices.php.in,v 1.22 2005/06/23 17:03:21 chagenbuch Exp $
+ *
+ * @package Services_PayPal
+ */
+class CallerServices extends SOAP_Client
+{
+    /**
+     * The profile to use in API calls.
+     *
+     * @access protected
+     *
+     * @var APIProfile $_profile
+     */
+    var $_profile;
+
+    /**
+     * The portType/environment -> endpoint map.
+     *
+     * @access protected
+     *
+     * @var array $_endpointMap
+     */
+    var $_endpointMap;
+
+    /**
+     * What level should we log at? Valid levels are:
+     *   PEAR_LOG_ERR   - Log only severe errors.
+     *   PEAR_LOG_INFO  - (default) Date/time of operation, operation name, elapsed time, success or failure indication.
+     *   PEAR_LOG_DEBUG - Full text of SOAP requests and responses and other debugging messages.
+     *
+     * See the PayPal SDK User Guide for more details on these log
+     * levels.
+     *
+     * @access protected
+     *
+     * @var integer $_logLevel
+     */
+    var $_logLevel = PEAR_LOG_INFO;
+
+    /**
+     * If we're logging, what directory should we create log files in?
+     * Note that a log name coincides with a symlink, logging will
+     * *not* be done to avoid security problems. File names are
+     * <DateStamp>.PayPal.log.
+     *
+     * @access protected
+     *
+     * @var string $_logFile
+     */
+    var $_logDir = '/tmp';
+
+    /**
+     * The PEAR Log object we use for logging.
+     *
+     * @access protected
+     *
+     * @var Log $_logger
+     */
+    var $_logger;
+
+    /**
+     * Construct a new CallerServices object.
+     *
+     * @param APIProfile $profile  The profile with the username, password,
+     *                             and any other information necessary to use
+     *                             the SDK.
+     */
+    function CallerServices($profile, $logLevel = PEAR_LOG_INFO, $logDir = '')
+    {
+        // Initialize the SOAP Client.
+        parent::SOAP_Client(null);
+
+        // Store the API profile.
+        $this->setAPIProfile($profile);
+
+        // SSL CA certificate.
+        $this->setOpt('curl', CURLOPT_CAINFO, dirname(__FILE__) . '/cert/api_cert_chain.crt');
+
+        // Set options from the profile.
+        $this->setOpt('curl', CURLOPT_SSLCERT, $profile->getCertificateFile());
+        if ($profile->getCertificatePassword()) {
+            $this->setOpt('curl', CURLOPT_SSLCERTPASSWD, $profile->getCertificatePassword());
+        }
+        $this->setOpt('trace', 1);
+
+        // Load the endpoint map.
+        include 'Services/PayPal/wsdl/paypal-endpoints.php';
+        $this->_endpointMap = $PayPalEndpoints;
+
+        $this->_logLevel = $logLevel;
+
+        if($logDir) $this->_logDir = $logDir;
+    
+        // Load SDK settings.
+        if (@include 'Services/PayPal/conf/paypal-sdk.php') {
+            if (isset($__PP_CONFIG['log_level'])) {
+                $this->_logLevel = $__PP_CONFIG['log_level'];
+            }
+            if (isset($__PP_CONFIG['log_dir'])) {
+                $this->_logDir = $__PP_CONFIG['log_dir'];
+            }
+        }
+    }
+
+    /**
+     * Sets the WSDL endpoint based on $portType and on the environment
+     * set in the user's profile.
+     *
+     * @param string $portType  The portType the current operation is part of.
+     * @param string $version   The WSDL version being used.
+     *
+     * @return boolean | PayPal_Error  An error if mapping can't be done, else true.
+     */
+    function setEndpoint($portType, $version)
+    {
+        $version = (float)$version;
+
+        foreach ($this->_endpointMap as $range) {
+            if ($version >= $range['min'] &&
+                $version <= $range['max'] &&
+                isset($range['environments'][$this->_profile->getEnvironment()][$portType])) {
+                $this->_endpoint = $range['environments'][$this->_profile->getEnvironment()][$portType];
+                return true;
+            }
+        }
+
+        return Services_PayPal::raiseError("Invalid version/environment/portType combination.");
+    }
+
+    /**
+     * Take the decoded array from SOAP_Client::__call() and turn it
+     * into an object of the appropriate AbstractResponseType
+     * subclass.
+     *
+     * @param array $values  The decoded SOAP response.
+     * @param string $type   The type of the response object.
+     *
+     * @return AbstractResponseType  The response object.
+     */
+    function &getResponseObject($values, $type)
+    {
+        // Check for SOAP Faults.
+        if (Services_PayPal::isError($values)) {
+            return $values;
+        }
+
+        // Check for already translated objects.
+        if (is_object($values) && strtolower(get_class($values)) != 'xsdtype') {
+            return $values;
+        }
+
+        $object =& Services_PayPal::getType($type);
+        if (Services_PayPal::isError($object)) {
+            return $values;
+        }
+
+        foreach ($values as $name => $value) {
+            if (method_exists($object, 'set' . $name)) {
+                if (is_object($value)) {
+                    if (strtolower(get_class($value)) == 'xsdtype') {
+                        $value =& $this->getResponseObject((array)$value, $object->_elements[$name]['type']);
+                    }
+                } elseif (is_array($value)) {
+                    $values = $value;
+                    $value = array();
+                    foreach ($values as $v) {
+                        $value[] =& $this->getResponseObject($v, $object->_elements[$name]['type']);
+                    }
+                }
+                call_user_func(array(&$object, 'set' . $name), $value);
+            }
+        }
+
+        return $object;
+    }
+
+    /**
+     * Use a given profile.
+     *
+     * @param APIProfile $profile  The profile with the username, password,
+     *                             and any other information necessary to use
+     *                             the SDK.
+     */
+    function setAPIProfile(&$profile)
+    {
+        $this->_profile = &$profile;
+    }
+
+    /**
+     * Get the current profile.
+     *
+     * @return APIProfile  The current profile.
+     */
+    function &getAPIProfile()
+    {
+        return $this->_profile;
+    }
+
+    /**
+     * Gets the PEAR Log object to use.
+     *
+     * @return Log  A Log object, either provided by the user or
+     *              created by this function.
+     */
+    function &getLogger()
+    {
+        if (!$this->_logger) {
+            $file = $this->_logDir . '/' . date('Ymd') . '.PayPal.log';
+            if (is_link($file) || (file_exists($file) && !is_writable($file))) {
+                // Don't overwrite symlinks.
+                return Services_PayPal::raiseError('bad logfile');
+            }
+
+            $this->_logger = &Log::singleton('file', $file, $this->_profile->getAPIUsername(), array('append' => true));
+        }
+
+        return $this->_logger;
+    }
+
+    /**
+     * Sets a custom PEAR Log object to use in logging.
+     *
+     * @param Log  A PEAR Log instance.
+     */
+    function setLogger(&$logger)
+    {
+        if (is_a($logger, 'Log')) {
+            $this->_logger =& $logger;
+        }
+    }
+
+    /**
+     * Override SOAP_Client::call() to always add our security header
+     * first.
+     */
+    function &call($method, &$params, $namespace = false, $soapAction = false)
+    {
+        // Create the security header.
+        $this->addHeader($rc = new SOAP_Header('RequesterCredentials', 'struct', array(
+            new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Credentials', 'struct',
+                           array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Username', '', $this->_profile->getAPIUsername()),
+                                 new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Password', '', $this->_profile->getAPIPassword()),
+                                 new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Subject', '', $this->_profile->getSubject())),
+                           array('xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'))),
+            1, array('xmlns' => 'urn:ebay:api:PayPalAPI')));
+
+        return parent::call($method, $params, $namespace, $soapAction);
+    }
+
+    /**
+     * Override some of the default SOAP:: package _decode behavior to
+     * handle simpleTypes and complexTypes with simpleContent.
+     */
+    function &_decode(&$soapval)
+    {
+        if (count($soapval->attributes)) {
+            $attributes = $soapval->attributes;
+        }
+
+        $object =& Services_PayPal::getType($soapval->type);
+        if (Services_PayPal::isError($object)) {
+            return parent::_decode($soapval);
+        }
+
+        $this->_type_translation[$soapval->type] = $soapval->type;
+
+        $result =& parent::_decode($soapval);
+        if (!is_a($result, 'XSDType') && is_a($object, 'XSDSimpleType')) {
+            $object->setval($result);
+            if (isset($attributes)) {
+                foreach ($attributes as $aname => $attribute) {
+                    $object->setattr($aname, $attribute);
+                }
+            }
+            $result =& $object;
+        }
+
+        return $result;
+    }
+
+    /**
+     * Log the current transaction depending on the current log level.
+     *
+     * @access protected
+     *
+     * @param string $operation  The operation called.
+     * @param integer $elapsed   Microseconds taken.
+     * @param object $response   The response object.
+     */
+    function _logTransaction($operation, $elapsed, $response)
+    {
+        $logger =& $this->getLogger();
+        if (Services_PayPal::isError($logger)) {
+            return $logger;
+        }
+
+        switch ($this->_logLevel) {
+        case PEAR_LOG_DEBUG:
+            $logger->log('Request XML: ' . $this->_sanitizeLog($this->__last_request), PEAR_LOG_DEBUG);
+            $logger->log('Response XML: ' . $this->_sanitizeLog($this->__last_response), PEAR_LOG_DEBUG);
+
+        case PEAR_LOG_INFO:
+            $ack = is_object($response) && method_exists($response, 'getAck') ? ', Ack: ' . $response->getAck() : '';
+            $logger->log($operation . ', Elapsed: ' . $elapsed . 'ms' . $ack, PEAR_LOG_INFO);
+
+        case PEAR_LOG_ERR:
+            if (Services_PayPal::isError($response)) {
+                $logger->log($response, PEAR_LOG_ERR);
+            }
+        }
+    }
+
+    /**
+     * Strip sensitive information (API passwords and credit card
+     * numbers) from raw XML requests/responses.
+     *
+     * @access protected
+     *
+     * @param string $xml  The XML to sanitize.
+     *
+     * @return string  The sanitized XML.
+     */
+    function _sanitizeLog($xml)
+    {
+        return preg_replace(array('/<(.*?Password.*?)>(.*?)<\/(.*?Password)>/i',
+                                  '/<(.*?CreditCard.*?)>(.*?)<\/(.*?CreditCard)>/i'),
+                            '<\1>***</\3>',
+                            $xml);
+    }
+
+    /**
+     * Return the current time including microseconds.
+     *
+     * @access protected
+     *
+     * @return integer  Current time with microseconds.
+     */
+    function _getMicroseconds()
+    {
+        list($ms, $s) = explode(' ', microtime());
+        return floor($ms * 1000) + 1000 * $s;
+    }
+
+    /**
+     * Return the difference between now and $start in microseconds.
+     *
+     * @access protected
+     *
+     * @param integer $start  Start time including microseconds.
+     *
+     * @return integer  Number of microseconds elapsed since $start
+     */
+    function _getElapsed($start)
+    {
+        return $this->_getMicroseconds() - $start;
+    }
+
+    function &RefundTransaction($RefundTransactionReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($RefundTransactionReq, 'XSDType')) {
+            $RefundTransactionReq->setVersion(PAYPAL_WSDL_VERSION);
+            $RefundTransactionReq = $RefundTransactionReq->getSoapValue('RefundTransactionRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPI', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('RefundTransaction', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // RefundTransactionReq is a ComplexType, refer to the WSDL for more info.
+        $RefundTransactionReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $RefundTransactionReq =& new SOAP_Value('RefundTransactionReq', false, $RefundTransactionReq, $RefundTransactionReq_attr);
+        $result = $this->call('RefundTransaction',
+                              $v = array("RefundTransactionReq" => $RefundTransactionReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'RefundTransactionResponseType');
+        $this->_logTransaction('RefundTransaction', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &GetTransactionDetails($GetTransactionDetailsReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($GetTransactionDetailsReq, 'XSDType')) {
+            $GetTransactionDetailsReq->setVersion(PAYPAL_WSDL_VERSION);
+            $GetTransactionDetailsReq = $GetTransactionDetailsReq->getSoapValue('GetTransactionDetailsRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPI', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('GetTransactionDetails', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // GetTransactionDetailsReq is a ComplexType, refer to the WSDL for more info.
+        $GetTransactionDetailsReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $GetTransactionDetailsReq =& new SOAP_Value('GetTransactionDetailsReq', false, $GetTransactionDetailsReq, $GetTransactionDetailsReq_attr);
+        $result = $this->call('GetTransactionDetails',
+                              $v = array("GetTransactionDetailsReq" => $GetTransactionDetailsReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'GetTransactionDetailsResponseType');
+        $this->_logTransaction('GetTransactionDetails', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &BillUser($BillUserReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($BillUserReq, 'XSDType')) {
+            $BillUserReq->setVersion(PAYPAL_WSDL_VERSION);
+            $BillUserReq = $BillUserReq->getSoapValue('BillUserRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPI', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('BillUser', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // BillUserReq is a ComplexType, refer to the WSDL for more info.
+        $BillUserReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $BillUserReq =& new SOAP_Value('BillUserReq', false, $BillUserReq, $BillUserReq_attr);
+        $result = $this->call('BillUser',
+                              $v = array("BillUserReq" => $BillUserReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'BillUserResponseType');
+        $this->_logTransaction('BillUser', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &TransactionSearch($TransactionSearchReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($TransactionSearchReq, 'XSDType')) {
+            $TransactionSearchReq->setVersion(PAYPAL_WSDL_VERSION);
+            $TransactionSearchReq = $TransactionSearchReq->getSoapValue('TransactionSearchRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPI', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('TransactionSearch', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // TransactionSearchReq is a ComplexType, refer to the WSDL for more info.
+        $TransactionSearchReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $TransactionSearchReq =& new SOAP_Value('TransactionSearchReq', false, $TransactionSearchReq, $TransactionSearchReq_attr);
+        $result = $this->call('TransactionSearch',
+                              $v = array("TransactionSearchReq" => $TransactionSearchReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'TransactionSearchResponseType');
+        $this->_logTransaction('TransactionSearch', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &MassPay($MassPayReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($MassPayReq, 'XSDType')) {
+            $MassPayReq->setVersion(PAYPAL_WSDL_VERSION);
+            $MassPayReq = $MassPayReq->getSoapValue('MassPayRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPI', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('MassPay', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // MassPayReq is a ComplexType, refer to the WSDL for more info.
+        $MassPayReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $MassPayReq =& new SOAP_Value('MassPayReq', false, $MassPayReq, $MassPayReq_attr);
+        $result = $this->call('MassPay',
+                              $v = array("MassPayReq" => $MassPayReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'MassPayResponseType');
+        $this->_logTransaction('MassPay', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &BillAgreementUpdate($BillAgreementUpdateReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($BillAgreementUpdateReq, 'XSDType')) {
+            $BillAgreementUpdateReq->setVersion(PAYPAL_WSDL_VERSION);
+            $BillAgreementUpdateReq = $BillAgreementUpdateReq->getSoapValue('BAUpdateRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPI', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('BillAgreementUpdate', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // BillAgreementUpdateReq is a ComplexType, refer to the WSDL for more info.
+        $BillAgreementUpdateReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $BillAgreementUpdateReq =& new SOAP_Value('BillAgreementUpdateReq', false, $BillAgreementUpdateReq, $BillAgreementUpdateReq_attr);
+        $result = $this->call('BillAgreementUpdate',
+                              $v = array("BillAgreementUpdateReq" => $BillAgreementUpdateReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'BAUpdateResponseType');
+        $this->_logTransaction('BillAgreementUpdate', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &AddressVerify($AddressVerifyReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($AddressVerifyReq, 'XSDType')) {
+            $AddressVerifyReq->setVersion(PAYPAL_WSDL_VERSION);
+            $AddressVerifyReq = $AddressVerifyReq->getSoapValue('AddressVerifyRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPI', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('AddressVerify', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // AddressVerifyReq is a ComplexType, refer to the WSDL for more info.
+        $AddressVerifyReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $AddressVerifyReq =& new SOAP_Value('AddressVerifyReq', false, $AddressVerifyReq, $AddressVerifyReq_attr);
+        $result = $this->call('AddressVerify',
+                              $v = array("AddressVerifyReq" => $AddressVerifyReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'AddressVerifyResponseType');
+        $this->_logTransaction('AddressVerify', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &DoExpressCheckoutPayment($DoExpressCheckoutPaymentReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($DoExpressCheckoutPaymentReq, 'XSDType')) {
+            $DoExpressCheckoutPaymentReq->setVersion(PAYPAL_WSDL_VERSION);
+            $DoExpressCheckoutPaymentReq = $DoExpressCheckoutPaymentReq->getSoapValue('DoExpressCheckoutPaymentRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPIAA', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('DoExpressCheckoutPayment', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // DoExpressCheckoutPaymentReq is a ComplexType, refer to the WSDL for more info.
+        $DoExpressCheckoutPaymentReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $DoExpressCheckoutPaymentReq =& new SOAP_Value('DoExpressCheckoutPaymentReq', false, $DoExpressCheckoutPaymentReq, $DoExpressCheckoutPaymentReq_attr);
+        $result = $this->call('DoExpressCheckoutPayment',
+                              $v = array("DoExpressCheckoutPaymentReq" => $DoExpressCheckoutPaymentReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'DoExpressCheckoutPaymentResponseType');
+        $this->_logTransaction('DoExpressCheckoutPayment', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &SetExpressCheckout($SetExpressCheckoutReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($SetExpressCheckoutReq, 'XSDType')) {
+            $SetExpressCheckoutReq->setVersion(PAYPAL_WSDL_VERSION);
+            $SetExpressCheckoutReq = $SetExpressCheckoutReq->getSoapValue('SetExpressCheckoutRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPIAA', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('SetExpressCheckout', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // SetExpressCheckoutReq is a ComplexType, refer to the WSDL for more info.
+        $SetExpressCheckoutReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $SetExpressCheckoutReq =& new SOAP_Value('SetExpressCheckoutReq', false, $SetExpressCheckoutReq, $SetExpressCheckoutReq_attr);
+        $result = $this->call('SetExpressCheckout',
+                              $v = array("SetExpressCheckoutReq" => $SetExpressCheckoutReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'SetExpressCheckoutResponseType');
+        $this->_logTransaction('SetExpressCheckout', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &GetExpressCheckoutDetails($GetExpressCheckoutDetailsReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($GetExpressCheckoutDetailsReq, 'XSDType')) {
+            $GetExpressCheckoutDetailsReq->setVersion(PAYPAL_WSDL_VERSION);
+            $GetExpressCheckoutDetailsReq = $GetExpressCheckoutDetailsReq->getSoapValue('GetExpressCheckoutDetailsRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPIAA', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('GetExpressCheckoutDetails', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // GetExpressCheckoutDetailsReq is a ComplexType, refer to the WSDL for more info.
+        $GetExpressCheckoutDetailsReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $GetExpressCheckoutDetailsReq =& new SOAP_Value('GetExpressCheckoutDetailsReq', false, $GetExpressCheckoutDetailsReq, $GetExpressCheckoutDetailsReq_attr);
+        $result = $this->call('GetExpressCheckoutDetails',
+                              $v = array("GetExpressCheckoutDetailsReq" => $GetExpressCheckoutDetailsReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'GetExpressCheckoutDetailsResponseType');
+        $this->_logTransaction('GetExpressCheckoutDetails', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &DoDirectPayment($DoDirectPaymentReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($DoDirectPaymentReq, 'XSDType')) {
+            $DoDirectPaymentReq->setVersion(PAYPAL_WSDL_VERSION);
+            $DoDirectPaymentReq = $DoDirectPaymentReq->getSoapValue('DoDirectPaymentRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPIAA', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('DoDirectPayment', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // DoDirectPaymentReq is a ComplexType, refer to the WSDL for more info.
+        $DoDirectPaymentReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $DoDirectPaymentReq =& new SOAP_Value('DoDirectPaymentReq', false, $DoDirectPaymentReq, $DoDirectPaymentReq_attr);
+        $result = $this->call('DoDirectPayment',
+                              $v = array("DoDirectPaymentReq" => $DoDirectPaymentReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'DoDirectPaymentResponseType');
+        $this->_logTransaction('DoDirectPayment', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &DoCapture($DoCaptureReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($DoCaptureReq, 'XSDType')) {
+            $DoCaptureReq->setVersion(PAYPAL_WSDL_VERSION);
+            $DoCaptureReq = $DoCaptureReq->getSoapValue('DoCaptureRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPIAA', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('DoCapture', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // DoCaptureReq is a ComplexType, refer to the WSDL for more info.
+        $DoCaptureReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $DoCaptureReq =& new SOAP_Value('DoCaptureReq', false, $DoCaptureReq, $DoCaptureReq_attr);
+        $result = $this->call('DoCapture',
+                              $v = array("DoCaptureReq" => $DoCaptureReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'DoCaptureResponseType');
+        $this->_logTransaction('DoCapture', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &DoReauthorization($DoReauthorizationReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($DoReauthorizationReq, 'XSDType')) {
+            $DoReauthorizationReq->setVersion(PAYPAL_WSDL_VERSION);
+            $DoReauthorizationReq = $DoReauthorizationReq->getSoapValue('DoReauthorizationRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPIAA', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('DoReauthorization', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // DoReauthorizationReq is a ComplexType, refer to the WSDL for more info.
+        $DoReauthorizationReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $DoReauthorizationReq =& new SOAP_Value('DoReauthorizationReq', false, $DoReauthorizationReq, $DoReauthorizationReq_attr);
+        $result = $this->call('DoReauthorization',
+                              $v = array("DoReauthorizationReq" => $DoReauthorizationReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'DoReauthorizationResponseType');
+        $this->_logTransaction('DoReauthorization', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &DoVoid($DoVoidReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($DoVoidReq, 'XSDType')) {
+            $DoVoidReq->setVersion(PAYPAL_WSDL_VERSION);
+            $DoVoidReq = $DoVoidReq->getSoapValue('DoVoidRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPIAA', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('DoVoid', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // DoVoidReq is a ComplexType, refer to the WSDL for more info.
+        $DoVoidReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $DoVoidReq =& new SOAP_Value('DoVoidReq', false, $DoVoidReq, $DoVoidReq_attr);
+        $result = $this->call('DoVoid',
+                              $v = array("DoVoidReq" => $DoVoidReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'DoVoidResponseType');
+        $this->_logTransaction('DoVoid', $this->_getElapsed($start), $response);
+        return $response;
+    }
+
+    function &DoAuthorization($DoAuthorizationReq)
+    {
+        $start = $this->_getMicroseconds();
+
+        // Handle type objects.
+        if (is_a($DoAuthorizationReq, 'XSDType')) {
+            $DoAuthorizationReq->setVersion(PAYPAL_WSDL_VERSION);
+            $DoAuthorizationReq = $DoAuthorizationReq->getSoapValue('DoAuthorizationRequest', 'urn:ebay:api:PayPalAPI');
+        }
+
+        // Make sure we can find a valid WSDL endpoint for this method.
+        $res = $this->setEndpoint('PayPalAPIAA', PAYPAL_WSDL_VERSION);
+        if (Services_PayPal::isError($res)) {
+            $this->_logTransaction('DoAuthorization', $this->_getElapsed($start), $res);
+            return $res;
+        }
+
+        // DoAuthorizationReq is a ComplexType, refer to the WSDL for more info.
+        $DoAuthorizationReq_attr['xmlns'] = 'urn:ebay:api:PayPalAPI';
+        $DoAuthorizationReq =& new SOAP_Value('DoAuthorizationReq', false, $DoAuthorizationReq, $DoAuthorizationReq_attr);
+        $result = $this->call('DoAuthorization',
+                              $v = array("DoAuthorizationReq" => $DoAuthorizationReq),
+                              array('namespace' => 'urn:ebay:api:PayPalAPI',
+                                    'soapaction' => '',
+                                    'style' => 'document',
+                                    'use' => 'literal'));
+
+        $response = $this->getResponseObject($result, 'DoAuthorizationResponseType');
+        $this->_logTransaction('DoAuthorization', $this->_getElapsed($start), $response);
+        return $response;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/CallerServices.php.in
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/CallerServices.php.in	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/CallerServices.php.in	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,382 @@
+<?php
+/**
+ * File containing the API calling code. Partially generated from the
+ * WSDL - CallerServices.php.in contains the base file with a
+ * placeholder for generated functions and the WSDL version.
+ *
+ * @package Services_PayPal
+ */
+
+/**
+ * Load files we depend on.
+ */
+require_once 'Services/PayPal.php';
+require_once 'Services/PayPal/SOAP/Client.php';
+require_once 'Services/PayPal/Type/XSDType.php';
+require_once 'Log.php';
+
+/**
+ * The WSDL version the SDK is built against.
+ */
+define('PAYPAL_WSDL_VERSION', @@WSDL_VERSION@@);
+
+/**
+ * Interface class that wraps all WSDL ports into a unified API for
+ * the user. Also handles PayPal-specific details like type handling,
+ * error handling, etc.
+ *
+ * $Id: CallerServices.php.in,v 1.22 2005/06/23 17:03:21 chagenbuch Exp $
+ *
+ * @package Services_PayPal
+ */
+class CallerServices extends SOAP_Client
+{
+    /**
+     * The profile to use in API calls.
+     *
+     * @access protected
+     *
+     * @var APIProfile $_profile
+     */
+    var $_profile;
+
+    /**
+     * The portType/environment -> endpoint map.
+     *
+     * @access protected
+     *
+     * @var array $_endpointMap
+     */
+    var $_endpointMap;
+
+    /**
+     * What level should we log at? Valid levels are:
+     *   PEAR_LOG_ERR   - Log only severe errors.
+     *   PEAR_LOG_INFO  - (default) Date/time of operation, operation name, elapsed time, success or failure indication.
+     *   PEAR_LOG_DEBUG - Full text of SOAP requests and responses and other debugging messages.
+     *
+     * See the PayPal SDK User Guide for more details on these log
+     * levels.
+     *
+     * @access protected
+     *
+     * @var integer $_logLevel
+     */
+    var $_logLevel = PEAR_LOG_INFO;
+
+    /**
+     * If we're logging, what directory should we create log files in?
+     * Note that a log name coincides with a symlink, logging will
+     * *not* be done to avoid security problems. File names are
+     * <DateStamp>.PayPal.log.
+     *
+     * @access protected
+     *
+     * @var string $_logFile
+     */
+    var $_logDir = '/tmp';
+
+    /**
+     * The PEAR Log object we use for logging.
+     *
+     * @access protected
+     *
+     * @var Log $_logger
+     */
+    var $_logger;
+
+    /**
+     * Construct a new CallerServices object.
+     *
+     * @param APIProfile $profile  The profile with the username, password,
+     *                             and any other information necessary to use
+     *                             the SDK.
+     */
+    function CallerServices($profile)
+    {
+        // Initialize the SOAP Client.
+        parent::SOAP_Client(null);
+
+        // Store the API profile.
+        $this->setAPIProfile($profile);
+
+        // SSL CA certificate.
+        $this->setOpt('curl', CURLOPT_CAINFO, dirname(__FILE__) . '/cert/api_cert_chain.crt');
+
+        // Set options from the profile.
+        $this->setOpt('curl', CURLOPT_SSLCERT, $profile->getCertificateFile());
+        if ($profile->getCertificatePassword()) {
+            $this->setOpt('curl', CURLOPT_SSLCERTPASSWD, $profile->getCertificatePassword());
+        }
+        $this->setOpt('trace', 1);
+
+        // Load the endpoint map.
+        include 'Services/PayPal/wsdl/paypal-endpoints.php';
+        $this->_endpointMap = $PayPalEndpoints;
+
+        // Load SDK settings.
+        if (@include 'Services/PayPal/conf/paypal-sdk.php') {
+            if (isset($__PP_CONFIG['log_level'])) {
+                $this->_logLevel = $__PP_CONFIG['log_level'];
+            }
+            if (isset($__PP_CONFIG['log_dir'])) {
+                $this->_logDir = $__PP_CONFIG['log_dir'];
+            }
+        }
+    }
+
+    /**
+     * Sets the WSDL endpoint based on $portType and on the environment
+     * set in the user's profile.
+     *
+     * @param string $portType  The portType the current operation is part of.
+     * @param string $version   The WSDL version being used.
+     *
+     * @return boolean | PayPal_Error  An error if mapping can't be done, else true.
+     */
+    function setEndpoint($portType, $version)
+    {
+        $version = (float)$version;
+
+        foreach ($this->_endpointMap as $range) {
+            if ($version >= $range['min'] &&
+                $version <= $range['max'] &&
+                isset($range['environments'][$this->_profile->getEnvironment()][$portType])) {
+                $this->_endpoint = $range['environments'][$this->_profile->getEnvironment()][$portType];
+                return true;
+            }
+        }
+
+        return Services_PayPal::raiseError("Invalid version/environment/portType combination.");
+    }
+
+    /**
+     * Take the decoded array from SOAP_Client::__call() and turn it
+     * into an object of the appropriate AbstractResponseType
+     * subclass.
+     *
+     * @param array $values  The decoded SOAP response.
+     * @param string $type   The type of the response object.
+     *
+     * @return AbstractResponseType  The response object.
+     */
+    function &getResponseObject($values, $type)
+    {
+        // Check for SOAP Faults.
+        if (Services_PayPal::isError($values)) {
+            return $values;
+        }
+
+        // Check for already translated objects.
+        if (is_object($values) && strtolower(get_class($values)) != 'xsdtype') {
+            return $values;
+        }
+
+        $object =& Services_PayPal::getType($type);
+        if (Services_PayPal::isError($object)) {
+            return $values;
+        }
+
+        foreach ($values as $name => $value) {
+            if (method_exists($object, 'set' . $name)) {
+                if (is_object($value)) {
+                    if (strtolower(get_class($value)) == 'xsdtype') {
+                        $value =& $this->getResponseObject((array)$value, $object->_elements[$name]['type']);
+                    }
+                } elseif (is_array($value)) {
+                    $values = $value;
+                    $value = array();
+                    foreach ($values as $v) {
+                        $value[] =& $this->getResponseObject($v, $object->_elements[$name]['type']);
+                    }
+                }
+                call_user_func(array(&$object, 'set' . $name), $value);
+            }
+        }
+
+        return $object;
+    }
+
+    /**
+     * Use a given profile.
+     *
+     * @param APIProfile $profile  The profile with the username, password,
+     *                             and any other information necessary to use
+     *                             the SDK.
+     */
+    function setAPIProfile(&$profile)
+    {
+        $this->_profile = &$profile;
+    }
+
+    /**
+     * Get the current profile.
+     *
+     * @return APIProfile  The current profile.
+     */
+    function &getAPIProfile()
+    {
+        return $this->_profile;
+    }
+
+    /**
+     * Gets the PEAR Log object to use.
+     *
+     * @return Log  A Log object, either provided by the user or
+     *              created by this function.
+     */
+    function &getLogger()
+    {
+        if (!$this->_logger) {
+            $file = $this->_logDir . '/' . date('Ymd') . '.PayPal.log';
+            if (is_link($file) || (file_exists($file) && !is_writable($file))) {
+                // Don't overwrite symlinks.
+                return Services_PayPal::raiseError('bad logfile');
+            }
+
+            $this->_logger = &Log::singleton('file', $file, $this->_profile->getAPIUsername(), array('append' => true));
+        }
+
+        return $this->_logger;
+    }
+
+    /**
+     * Sets a custom PEAR Log object to use in logging.
+     *
+     * @param Log  A PEAR Log instance.
+     */
+    function setLogger(&$logger)
+    {
+        if (is_a($logger, 'Log')) {
+            $this->_logger =& $logger;
+        }
+    }
+
+    /**
+     * Override SOAP_Client::call() to always add our security header
+     * first.
+     */
+    function &call($method, &$params, $namespace = false, $soapAction = false)
+    {
+        // Create the security header.
+        $this->addHeader($rc = new SOAP_Header('RequesterCredentials', 'struct', array(
+            new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Credentials', 'struct',
+                           array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Username', '', $this->_profile->getAPIUsername()),
+                                 new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Password', '', $this->_profile->getAPIPassword()),
+                                 new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Subject', '', $this->_profile->getSubject())),
+                           array('xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'))),
+            1, array('xmlns' => 'urn:ebay:api:PayPalAPI')));
+
+        return parent::call($method, $params, $namespace, $soapAction);
+    }
+
+    /**
+     * Override some of the default SOAP:: package _decode behavior to
+     * handle simpleTypes and complexTypes with simpleContent.
+     */
+    function &_decode(&$soapval)
+    {
+        if (count($soapval->attributes)) {
+            $attributes = $soapval->attributes;
+        }
+
+        $object =& Services_PayPal::getType($soapval->type);
+        if (Services_PayPal::isError($object)) {
+            return parent::_decode($soapval);
+        }
+
+        $this->_type_translation[$soapval->type] = $soapval->type;
+
+        $result =& parent::_decode($soapval);
+        if (!is_a($result, 'XSDType') && is_a($object, 'XSDSimpleType')) {
+            $object->setval($result);
+            if (isset($attributes)) {
+                foreach ($attributes as $aname => $attribute) {
+                    $object->setattr($aname, $attribute);
+                }
+            }
+            $result =& $object;
+        }
+
+        return $result;
+    }
+
+    /**
+     * Log the current transaction depending on the current log level.
+     *
+     * @access protected
+     *
+     * @param string $operation  The operation called.
+     * @param integer $elapsed   Microseconds taken.
+     * @param object $response   The response object.
+     */
+    function _logTransaction($operation, $elapsed, $response)
+    {
+        $logger =& $this->getLogger();
+        if (Services_PayPal::isError($logger)) {
+            return $logger;
+        }
+
+        switch ($this->_logLevel) {
+        case PEAR_LOG_DEBUG:
+            $logger->log('Request XML: ' . $this->_sanitizeLog($this->__last_request), PEAR_LOG_DEBUG);
+            $logger->log('Response XML: ' . $this->_sanitizeLog($this->__last_response), PEAR_LOG_DEBUG);
+
+        case PEAR_LOG_INFO:
+            $ack = is_object($response) && method_exists($response, 'getAck') ? ', Ack: ' . $response->getAck() : '';
+            $logger->log($operation . ', Elapsed: ' . $elapsed . 'ms' . $ack, PEAR_LOG_INFO);
+
+        case PEAR_LOG_ERR:
+            if (Services_PayPal::isError($response)) {
+                $logger->log($response, PEAR_LOG_ERR);
+            }
+        }
+    }
+
+    /**
+     * Strip sensitive information (API passwords and credit card
+     * numbers) from raw XML requests/responses.
+     *
+     * @access protected
+     *
+     * @param string $xml  The XML to sanitize.
+     *
+     * @return string  The sanitized XML.
+     */
+    function _sanitizeLog($xml)
+    {
+        return preg_replace(array('/<(.*?Password.*?)>(.*?)<\/(.*?Password)>/i',
+                                  '/<(.*?CreditCard.*?)>(.*?)<\/(.*?CreditCard)>/i'),
+                            '<\1>***</\3>',
+                            $xml);
+    }
+
+    /**
+     * Return the current time including microseconds.
+     *
+     * @access protected
+     *
+     * @return integer  Current time with microseconds.
+     */
+    function _getMicroseconds()
+    {
+        list($ms, $s) = explode(' ', microtime());
+        return floor($ms * 1000) + 1000 * $s;
+    }
+
+    /**
+     * Return the difference between now and $start in microseconds.
+     *
+     * @access protected
+     *
+     * @param integer $start  Start time including microseconds.
+     *
+     * @return integer  Number of microseconds elapsed since $start
+     */
+    function _getElapsed($start)
+    {
+        return $this->_getMicroseconds() - $start;
+    }
+
+    @@GENERATED_FUNCTIONS@@
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/EWPServices.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/EWPServices.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/EWPServices.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,174 @@
+<?php
+/**
+ * File containing the encryption services code.
+ *
+ * @package Services_PayPal
+ */
+
+/**
+ * Load files we depend on.
+ */
+require_once 'Services/PayPal.php';
+
+/**
+ * API for doing PayPal encryption services.
+ *
+ * @package Services_PayPal
+ */
+class EWPServices
+{
+    /**
+     * The profile to use for encryption.
+     *
+     * @access protected
+     *
+     * @var EWPProfile $_profile
+     */
+    var $_profile;
+
+    /**
+     * Construct a new EWP services object.
+     *
+     * @param EWPProfile $profile  The profile with the username, password,
+     *                             and any other information necessary to use
+     *                             the SDK.
+     */
+    function EWPServices($profile)
+    {
+        $this->setEWPProfile($profile);
+    }
+
+    /**
+     * Use a given profile.
+     *
+     * @param EWPProfile $profile  The profile with the username, password,
+     *                             and any other information necessary to use
+     *                             the SDK.
+     */
+    function setEWPProfile($profile)
+    {
+        $this->_profile = $profile;
+    }
+
+    /**
+     * Get the current profile.
+     *
+     * @return EWPProfile  The current profile.
+     */
+    function getEWPProfile()
+    {
+        return $this->_profile;
+    }
+
+    /**
+     * Creates a new encrypted button HTML block
+     *
+     * @param array The button parameters as key/value pairs
+     * @return mixed A string of HTML or a Paypal error object on failure
+     */
+    function encryptButton($buttonParams)
+    {
+        if (!is_object($this->_profile)) {
+            return Services_PayPal::raiseError("No Profile is set, cannot encrypt");
+        }
+
+        $res = $this->_profile->validate();
+        if (Services_PayPal::isError($res)) {
+            return $res;
+        }
+
+        $merchant_cert = 'file://' . $this->_profile->getCertificateFile();
+        $merchant_key = 'file://' . $this->_profile->getPrivateKeyFile();
+        $enc_cert = 'file://' . $this->getPayPalCertificateFile($this->_profile->getEnvironment());
+
+        $tmpin_file  = tempnam('/tmp', 'paypal_');
+        $tmpout_file = tempnam('/tmp', 'paypal_');
+        $tmpfinal_file = tempnam('/tmp', 'paypal_');
+
+        $rawdata = array();
+        $buttonParams['cert_id'] = $this->_profile->getCertificateId();
+        foreach ($buttonParams as $name => $value) {
+            $rawdata[] = "$name=$value";
+        }
+        $rawdata = implode("\n", $rawdata);
+
+        $fp = fopen($tmpin_file, 'w');
+        if (!$fp) {
+            return Services_PayPal::raiseError("Could not open temporary file '$tmpin_file')");
+        }
+        fwrite($fp, $rawdata);
+        fclose($fp);
+
+        if (!@openssl_pkcs7_sign($tmpin_file, $tmpout_file, $merchant_cert,
+                                 array($merchant_key, $this->_profile->getPrivateKeyPassword()),
+                                 array(), PKCS7_BINARY)) {
+            return Services_PayPal::raiseError("Could not sign encrypted data: " . openssl_error_string());
+        }
+
+        $data = file_get_contents($tmpout_file);
+        $data = explode("\n\n", $data);
+        $data = $data[1];
+        $data = base64_decode($data);
+        $fp = fopen($tmpout_file, 'w');
+        if (!$fp) {
+            return Services_PayPal::raiseError("Could not open temporary file '$tmpin_file')");
+        }
+        fwrite($fp, $data);
+        fclose($fp);
+
+        if (!@openssl_pkcs7_encrypt($tmpout_file, $tmpfinal_file, $enc_cert, array(), PKCS7_BINARY)) {
+            return Services_PayPal::raiseError("Could not encrypt data:" . openssl_error_string());
+        }
+
+        $encdata = @file_get_contents($tmpfinal_file, false);
+        if (!$encdata) {
+            return Services_PayPal::raiseError("Encryption and signature of data failed.");
+        }
+
+        $encdata = explode("\n\n", $encdata);
+        $encdata = trim(str_replace("\n", '', $encdata[1]));
+        $encdata = "-----BEGIN PKCS7-----$encdata-----END PKCS7-----";
+
+        @unlink($tmpfinal_file);
+        @unlink($tmpin_file);
+        @unlink($tmpout_file);
+
+        $action = $this->_profile->getUrl();
+        $buttonimgurl = $this->_profile->getButtonImage();
+
+        $retval = <<< PPHTML
+<FORM ACTION="$action" METHOD="post">
+<INPUT TYPE="hidden" NAME="cmd" VALUE="_s-xclick">
+<INPUT TYPE="hidden" NAME="encrypted" VALUE="$encdata">
+<INPUT TYPE="image" SRC="$buttonimgurl" BORDER="0" NAME="submit" ALT="Make Payments with PayPal -- it's fast, free and secure!">
+</FORM>
+PPHTML;
+        return $retval;
+    }
+
+    /**
+     * Returns the PayPal public certificate filename.
+     *
+     * @param string The environment to get the certificate for.
+     * @return mixed The path and file of the certificate file, or a PayPal error object on failure.
+     */
+    function getPayPalCertificateFile($environment)
+    {
+        $package_root = Services_PayPal::getPackageRoot();
+        $cert = $package_root . '/cert/' . strtolower($environment) . '.paypal.com.pem';
+
+        if (@include "$package_root/conf/paypal-sdk.php") {
+            if (isset($__PP_CONFIG['paypal_cert_file']) &&
+                !empty($__PP_CONFIG['paypal_cert_file'])) {
+                $cert =  $__PP_CONFIG['paypal_cert_file'][$environment];
+            }
+        }
+
+        if (!file_exists($cert)) {
+            return Services_PayPal::raiseError("Could not file Paypal public Certificate file '$cert'");
+        }
+
+        return $cert;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Error.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Error.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Error.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/**
+ * @package Services_PayPal
+ *
+ * $Id: Error.php,v 1.18 2005/06/23 17:03:21 chagenbuch Exp $
+ */
+
+/**
+ * Load parent class.
+ */
+require_once 'PEAR.php';
+
+/**
+ * A standard PayPal Error object
+ *
+ * @package  Services_PayPal
+ */
+class PayPal_Error extends PEAR_Error {
+
+  /**
+   * Standard error constructor
+   *
+     * @param string The error message
+     * @param int An optional integer error code
+   */
+  function PayPal_Error($message, $errorcode = null)
+  {
+    parent::PEAR_error($message, $errorcode);
+  }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Profile/API.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Profile/API.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Profile/API.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,234 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Include parent and package classes.
+ */
+require_once 'Services/PayPal.php';
+require_once 'Services/PayPal/Profile.php';
+
+/**
+ * Stores API Profile information used for performing transactions on the PayPal API
+ *
+ * @package Services_PayPal
+ */
+class APIProfile extends Profile
+{
+    /**
+     * The API username to make API calls with. Must be a valid PayPal
+     * API account (not a paypal.com account or developer.paypal.com
+     * account).
+     *
+     * @access private
+     */
+    var $_username;
+
+    /**
+     * The API password to use. This must be set before making any API
+     * calls; it is not stored by the ProfileHandler backend.
+     *
+     * @see setAPIPassword()
+     *
+     * @access private
+     */
+    var $_password;
+
+    /**
+     * The location of the user's private certificate. This should be
+     * a .pem file.
+     *
+     * @access private
+     */
+    var $_certificateFile;
+
+    /**
+     * The password, if any, on the user's private certificate. This
+     * must be set before making any API calls; it is not stored by
+     * the ProfileHandler backend.
+     *
+     * @see setCertificatePassword()
+     *
+     * @access private
+     */
+    var $_certificatePassword;
+
+    /**
+     * Subject to be used when making API calls. This is for making
+     * calls on behalf of another PayPal user with your own API
+     * account.
+     *
+     * @access private
+     */
+    var $_subject;
+
+    /**
+     * Constructor
+     *
+     * @param string         $id       A unique id for the profile.
+     * @param ProfileHandler $handler  A handler object where the profile is stored.
+     *
+     */
+    function APIProfile($id, &$handler)
+    {
+        parent::Profile($id, $handler);
+    }
+
+    /**
+     * Validates the profile data currently loaded before use.
+     *
+     * @return mixed true if the data is valid, or a PayPal_Error object on failure.
+     */
+    function validate()
+    {
+        if (empty($this->_username) ||
+            empty($this->_password) ||
+            empty($this->_certificateFile) ||
+            empty($this->_environment)) {
+            return Services_PayPal::raiseError("API Username, Password, Certificate File and Environment must all be set");
+        }
+
+        if (!file_exists($this->_certificateFile)) {
+            return Services_PayPal::raiseError("Could not find certificate file '{$this->_certificateFile}'");
+        }
+
+        if (!in_array(strtolower($this->_environment), $this->_validEnvironments, true)) {
+            return Services_PayPal::raiseError("Environment '{$this->_environment}' is not a valid environment.");
+        }
+
+        return true;
+    }
+
+    /**
+     * Sets the API username for the profile.
+     *
+     * @param string The API username.
+     */
+    function setAPIUsername($username)
+    {
+        $this->_username = $username;
+    }
+
+    /**
+     * Returns the API username for the profile.
+     *
+     * @return string The API username.
+     */
+    function getAPIUsername()
+    {
+        return $this->_username;
+    }
+
+    /**
+     * Sets the API password for the profile.
+     *
+     * @param string The password for the profile.
+     */
+    function setAPIPassword($password)
+    {
+        $this->_password = $password;
+    }
+
+    /**
+     * Get the API password for the profile.
+     *
+     * @return string The password for the profile.
+     */
+    function getAPIPassword()
+    {
+        return $this->_password;
+    }
+
+    /**
+     * Get the Certificate file associated with the profile.
+     *
+     * @return string The certificate file associated with the profile.
+     */
+    function getCertificateFile()
+    {
+        return $this->_certificateFile;
+    }
+
+    /**
+     * Set the certificate file associated with the profile.
+     *
+     * @param string The certificate file associated with the profile.
+     */
+    function setCertificateFile($filename)
+    {
+        $this->_certificateFile = $filename;
+    }
+
+    /**
+     * Set the certificate password.
+     *
+     * @param string The certificate password.
+     */
+    function setCertificatePassword($password)
+    {
+        $this->_certificatePassword = $password;
+    }
+
+    /**
+     * Get the certificate password.
+     *
+     * @return string  The certificate password.
+     */
+    function getCertificatePassword()
+    {
+        return $this->_certificatePassword;
+    }
+
+    /**
+     * Set the subject associated with the profile.
+     *
+     * @param string The subject of the profile.
+     */
+    function setSubject($subject)
+    {
+        $this->_subject = $subject;
+    }
+
+    /**
+     * Get the subject of the associated profile.
+     *
+     * @return string The subject associated with the profile.
+     */
+    function getSubject()
+    {
+        return $this->_subject;
+    }
+
+    /**
+     * Returns an array of member variables names which should be
+     * included when storing the profile.
+     *
+     * @return array An array of member variable names which should be included.
+     * @access protected
+     */
+    function _getSerializeList()
+    {
+        return array('username', 'certificateFile',
+                     'subject', 'environment');
+    }
+
+    function getInstance($id, &$handler)
+    {
+        $classname = __CLASS__;
+        $inst = &new $classname($id, $handler);
+
+        $result = $inst->_load();
+        if (Services_PayPal::isError($result)) {
+            return $result;
+        }
+
+        $result = $inst->loadEnvironments();
+        if (Services_PayPal::isError($result)) {
+            return $result;
+        }
+
+        return $inst;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Profile/EWP.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Profile/EWP.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Profile/EWP.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,264 @@
+<?php
+/**
+ * @package Services_PayPal
+ *
+ * $Id: EWP.php,v 1.20 2005/06/23 17:03:21 chagenbuch Exp $
+ */
+
+/**
+ * Include parent and package classes.
+ */
+require_once 'Services/PayPal.php';
+require_once 'Services/PayPal/Profile.php';
+require_once 'Services/PayPal/EWPServices.php';
+
+/**
+ * Stores EWP Profile information used for encrypting buttons and PayPal forms.
+ *
+ * @package Services_PayPal
+ */
+class EWPProfile extends Profile
+{
+    /**
+     * The private Key file
+     *
+     * @access private
+     */
+    var $_privateKeyFile;
+
+    /**
+     * The password on the private key.
+     *
+     * @access private
+     */
+    var $_privateKeyPassword;
+
+    /**
+     * The URL to the button image
+     *
+     * @access private
+     */
+    var $_buttonImageURL;
+
+    /**
+     * The URL the button posts to
+     *
+     * @access private
+     */
+    var $_buttonURL;
+
+    /**
+     * The PayPal-assigned id of the certificate.
+     *
+     * @access private
+     */
+    var $_certificateId;
+
+    /**
+     * The location of the .pem certificate file.
+     *
+     * @access private
+     */
+    var $_certificateFile;
+
+    /**
+     * Class constructor
+     *
+     * @param ProfileHandler &$handler  A handler where the profile should be stored.
+     */
+    function EWPProfile($id, &$handler)
+    {
+        parent::Profile($id, $handler);
+    }
+
+    /**
+     * Validates the profile data currently loaded before use.
+     *
+     * @return mixed true if the data is valid, or a PayPal_Error object on failure.
+     */
+    function validate()
+    {
+        if (empty($this->_certificateFile)) {
+            return Services_PayPal::raiseError("Certificate File must be set!");
+        }
+        if (empty($this->_certificateId)) {
+            return Services_PayPal::raiseError("Certificate ID must be set.");
+        }
+        if (empty($this->_environment)) {
+            return Services_PayPal::raiseError("Environment must be set.");
+        }
+        if (!file_exists($this->_certificateFile)) {
+            return Services_PayPal::raiseError("Could not find certificate file '{$this->_certificateFile}'");
+        }
+        if (!in_array(strtolower($this->_environment), $this->_validEnvironments, true)) {
+            return Services_PayPal::raiseError("Environment '{$this->_environment}' is not a valid environment.");
+        }
+
+        return true;
+    }
+
+    /**
+     * Get the merchant certificate id associated with the profile
+     *
+     * @return string The certificate id associated with the profile
+     */
+    function getCertificateId()
+    {
+        return $this->_certificateId;
+    }
+
+    /**
+     * Set the merchant certificate id associated with the profile
+     *
+     * @param string The certificate id associated with the profile
+     */
+    function setCertificateId($filename)
+    {
+        $this->_certificateId = $filename;
+    }
+
+    /**
+     * Get the merchant certificate file associated with the profile
+     *
+     * @return string The certificate file associated with the profile
+     */
+    function getCertificateFile()
+    {
+        return $this->_certificateFile;
+    }
+
+    /**
+     * Set the merchant certificate file associated with the profile
+     *
+     * @param string The certificate file associated with the profile
+     */
+    function setCertificateFile($filename)
+    {
+        if (!file_exists($filename)) {
+            return Services_PayPal::raiseError("The private key '$filename' does not exist");
+        }
+
+        $this->_certificateFile = $filename;
+    }
+
+    /**
+     * Returns the URL where the button image is
+     *
+     * @return string The URL to the button image
+     */
+    function getButtonImage()
+    {
+        return $this->_buttonImageURL;
+    }
+
+    /**
+     * Set the URL where the button image is
+     *
+     * @param string The URL to the button image
+     */
+    function setButtonImage($url)
+    {
+        $this->_buttonImageURL = $url;
+    }
+
+    /**
+     * Returns the URL where the button will post to
+     *
+     * @return string The URL where the button will post to
+     */
+    function getUrl()
+    {
+        return $this->_buttonURL;
+    }
+
+    /**
+     * Sets the URL where the button will post to
+     *
+     * @param string The URL where the button should post to
+     */
+    function setUrl($url)
+    {
+        $this->_buttonURL = $url;
+    }
+
+    /**
+     * Set the Merchant private key file
+     *
+     * @param string The Merchant Private Key File
+     * @return mixed True on success, a PayPal error object on faliure
+     */
+    function setPrivateKeyFile($filename)
+    {
+        if (!file_exists($filename)) {
+            return Services_PayPal::raiseError("The private key '$filename' does not exist");
+        }
+
+        $this->_privateKeyFile = $filename;
+
+        return true;
+    }
+
+    /**
+     * Get the merchant private key file associated with the profile
+     *
+     * @return string The merchant private key file associated with the profile
+     */
+    function getPrivateKeyFile()
+    {
+        return $this->_privateKeyFile;
+    }
+
+    /**
+     * Set the merchant private key password
+     *
+     * @param string The private key password
+     */
+    function setPrivateKeyPassword($password)
+    {
+        $this->_privateKeyPassword = $password;
+    }
+
+    /**
+     * Get the merchant private key password
+     *
+     * @return string  The private key password.
+     */
+    function getPrivateKeyPassword()
+    {
+        return $this->_privateKeyPassword;
+    }
+
+    /**
+     * Returns an array of member variables names which should be included
+     * when storing the profile.
+     *
+     * @return array An array of member variable names which should be included
+     * @access protected
+     */
+    function _getSerializeList()
+    {
+        return array('environment', 'certificateId', 'certificateFile', 'privateKeyFile', 'buttonImageURL', 'buttonURL');
+    }
+
+    /**
+     * Factory for creating instances of the EWPProfile. Used when
+     * providing an existing Profile ID to load from
+     *
+     * @param string The Profile ID of this instance
+     * @param object A valid Profile Handler instance
+     * @return object A new instance of EWPProfile for the given ID or a PayPal error object on failure
+     */
+    function getInstance($id, &$handler)
+    {
+        $classname = __CLASS__;
+        $inst = new $classname($id, $handler);
+        $result = $inst->_load();
+
+        if (Services_PayPal::isError($result)) {
+            return $result;
+        }
+
+        return $inst;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler/Array.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler/Array.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler/Array.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Include parent and package classes.
+ */
+require_once 'Services/PayPal.php';
+require_once 'Services/PayPal/Profile/Handler.php';
+
+/**
+ * Array handler class for hardcoding a PayPal profile.
+ *
+ * @package Services_PayPal
+ */
+class ProfileHandler_Array extends ProfileHandler
+{
+    function ProfileHandler_Array($parameters)
+    {
+        parent::ProfileHandler($parameters);
+    }
+
+    function loadProfile($id)
+    {
+        return $this->_params;
+    }
+
+    function saveProfile($data)
+    {
+        $this->_params = $data;
+        return 'default';
+    }
+
+    function deleteProfile($id)
+    {
+        $this->_params = null;
+    }
+
+    function getParamInfo()
+    {
+        return null;
+    }
+
+    function listProfiles()
+    {
+        return array('default');
+    }
+
+    function &getInstance($params)
+    {
+        $classname = __CLASS__;
+        return $inst =& new $classname($params);
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler/File.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler/File.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler/File.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Include parent and package classes.
+ */
+require_once 'Services/PayPal.php';
+require_once 'Services/PayPal/Profile/Handler.php';
+
+/**
+ * File handler class for storing PayPal profiles
+ *
+ * @package Services_PayPal
+ */
+class ProfileHandler_File extends ProfileHandler
+{
+    function ProfileHandler_File($parameters)
+    {
+        parent::ProfileHandler($parameters);
+    }
+
+    function _getFilename($id)
+    {
+        return "{$this->_params['path']}/$id.ppd";
+
+    }
+
+    function listProfiles()
+    {
+        $validate = $this->validateParams();
+
+        if (Services_PayPal::isError($validate)) {
+            return $retval;
+        }
+
+        $filemask = $this->_getFilename("*");
+
+        $profile_files = glob($filemask);
+        
+        $retval = array();
+        
+        foreach ($profile_files as $pf) {
+            $filename = basename($pf);
+            $retval[] = substr($filename, 0, strpos($filename, '.'));
+        }
+
+        return $retval;
+    }
+
+    function loadProfile($id)
+    {
+        $retval = $this->validateParams();
+
+        if (Services_PayPal::isError($retval)) {
+            return $retval;
+        }
+
+        $open_file = $this->_getFileName($id);
+
+        if (!file_exists($open_file)) {
+            return Services_PayPal::raiseError("Profile '$id' cannot be loaded, does not exist.");
+        }
+
+        $data = file_get_contents($open_file, false);
+
+        $retval = @unserialize($data);
+
+        if (!is_array($retval)) {
+            return Services_PayPal::raiseError("Unserialization of data failed.");
+        }
+
+        return $retval;
+    }
+
+    function saveProfile($data, $id = null)
+    {
+        $retval = $this->validateParams();
+        if (Services_PayPal::isError($retval)) {
+            return $retval;
+        }
+
+        $id = (is_null($id)) ? $this->generateID() : $id;
+
+        $write_file = $this->_getFileName($id);
+
+        $fr = @fopen($write_file, 'w', false);
+
+        if (!$fr) {
+            return Services_PayPal::raiseError("Could not open file '$write_file' for writing.");
+        }
+
+        $serialized = serialize($data);
+        fputs($fr, $serialized);
+        fclose($fr);
+
+        return $id;
+    }
+
+    function deleteProfile($id)
+    {
+        $retval = $this->validateParams();
+
+        if (Services_PayPal::isError($retval)) {
+            return $retval;
+        }
+
+        $delete_file = $this->_getFileName($id);
+
+        if (!@unlink($delete_file)) {
+            return Services_PayPal::raiseError("Could not delete the Profile file '$delete_file'");
+        }
+
+        return true;
+    }
+
+    function getParamInfo()
+    {
+        return array('path' => array('desc' => 'Profile Save Path',
+                                     'type' => 'string'));
+    }
+
+    function validateParams()
+    {
+        if (!isset($this->_params['path'])) {
+            return Services_PayPal::raiseError("You must provide the 'path' parameter for this handler");
+        }
+
+        if (file_exists($this->_params['path']) &&
+            is_dir($this->_params['path'])) {
+            return true;
+        }
+
+        return false;
+    }
+
+    function &getInstance($params)
+    {
+        $classname = __CLASS__;
+        return $inst =& new $classname($params);
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Profile/Handler.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Include SDK base class.
+ */
+require_once 'Services/PayPal.php';
+
+/**
+ * The base class for all Profile handlers
+ *
+ * @package Services_PayPal
+ * @abstract
+ */
+class ProfileHandler
+{
+    var $_params;
+
+    function ProfileHandler($parameters)
+    {
+        $this->_params = $parameters;
+    }
+
+    function listProfiles()
+    {
+        return Services_PayPal::raiseError("Cannot call this method from the base ProfileHandler class");
+    }
+
+    function loadProfile($id)
+    {
+        return Services_PayPal::raiseError("Cannot call this method from the base ProfileHandler class");
+    }
+
+    function saveProfile($data)
+    {
+        return Services_PayPal::raiseError("Cannot call this method from the base ProfileHandler class");
+    }
+
+    function getParamInfo()
+    {
+        return null;
+    }
+
+    function deleteProfile($id)
+    {
+        return Services_PayPal::raiseError("Cannot call this method from the base ProfileHandler class");
+    }
+
+    function generateID()
+    {
+        return md5(uniqid(mt_rand(), true));
+    }
+
+    function validateParams()
+    {
+        return true;
+    }
+
+    function &getInstance($params)
+    {
+        return Services_PayPal::raiseError("Cannot call this method from the base ProfileHandler class");
+    }
+
+    function initialize()
+    {
+        return true;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Profile.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Profile.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Profile.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,220 @@
+<?php
+/**
+ * @package Services_PayPal
+ *
+ * $Id: Profile.php,v 1.20 2005/06/23 17:03:21 chagenbuch Exp $
+ */
+
+/**
+ * Base package class.
+ */
+require_once 'Services/PayPal.php';
+require_once 'Services/PayPal/SDK/Generator.php';
+
+/**
+ * Base class for PayPal Profiles, managaes interaction with handlers, etc.
+ *
+ * @package Services_PayPal
+ * @abstract
+ */
+class Profile
+{
+    /**
+     * Which environment should API calls be made against?
+     *
+     * @see $_validEnvironments
+     *
+     * @access protected
+     */
+    var $_environment;
+
+    /**
+     * The list of valid environments that API calls can be executed
+     * against.
+     *
+     * @access protected
+     */
+    var $_validEnvironments = array();
+
+    /**
+     * The ProfileHandler instance associated with this Profile.
+     *
+     * @access protected
+     */
+    var $_handler;
+    var $_handler_id;
+
+    /**
+     * Base constructor which creates a default handler if none was
+     * provided.
+     *
+     * @param string The name of the profile
+     * @param object An optional handler to store the profile in
+     */
+    function Profile($id, &$handler)
+    {
+        $this->_handler =& $handler;
+        $this->_handler_id = $id;
+    }
+
+    /**
+     * Loads the profile data from the defined handler.
+     *
+     * @return mixed true on success or a PayPal_Error object on failure
+     * @final
+     * @access private
+     */
+    function _load()
+    {
+        $loaded_data = $this->_handler->loadProfile($this->_handler_id);
+        $expected_keys = $this->_getSerializeList();
+
+        if (!is_a($this->_handler, 'ProfileHandler_Array')) {
+            $expected_keys[] = 'classname';
+        }
+
+        if (Services_PayPal::isError($loaded_data)) {
+            foreach ($expected_keys as $key) {
+                $ikey = "_$key";
+                $this->$ikey = null;
+            }
+
+            return Services_PayPal::raiseError("Could not load data for non-existant profile '{$this->_handler_id}'");
+        }
+
+        $expected_keys = array_flip($expected_keys);
+        foreach ($loaded_data as $key => $value) {
+            $ikey = "_$key";
+            $this->$ikey = $value;
+            unset($expected_keys[$key]);
+        }
+
+        if (!empty($expected_keys)) {
+            $key_list = implode(', ', array_flip($expected_keys));
+            return Services_PayPal::raiseError("The following values were expected but not found in the profile data: $key_list");
+        }
+
+        return $this->loadEnvironments();
+    }
+
+    function getID()
+    {
+        return $this->_handler_id;
+    }
+
+    function getInstance($id, &$handler)
+    {
+        return Services_PayPal::raiseError("Cannot return an instance of the base Profile class");
+    }
+
+    /**
+     * Loads the environment names from the endpoint map.
+     *
+     * @return mixed True on success or a PayPal error object on failure
+     */
+    function loadEnvironments()
+    {
+        $version = Services_PayPal::getWSDLVersion();
+        $endpoints = Services_PayPal::getEndpoints();
+        if (Services_PayPal::isError($endpoints)) {
+            return $endpoints;
+        }
+
+        foreach ($endpoints as $range) {
+            if ($version >= $range['min'] &&
+                $version <= $range['max']) {
+                foreach (array_keys($range['environments']) as $environment) {
+                    $this->_validEnvironments[] = strtolower($environment);
+                }
+                return true;
+            }
+        }
+
+        return Services_PayPal::raiseError("Could not find any endpoint mappings for WSDL version '$version'");
+    }
+
+    /**
+     * Saves the profile data to the defined handler.
+     *
+     * @return mixed true on success or a PayPal_Error object on failure
+     * @final
+     */
+    function save()
+    {
+        $values = $this->_getSerializeList();
+        foreach ($values as $value) {
+            $ivalue = "_$value";
+            if (isset($this->$ivalue)) {
+                $data[$value] = $this->$ivalue;
+            } else {
+                $data[$value] = null;
+            }
+        }
+
+        $data['classname'] = get_class($this);
+
+        return $this->_handler->saveProfile($data, $this->_handler_id);
+    }
+
+    /**
+     * Returns an array of member variables names which should be
+     * included when storing the profile.
+     *
+     * @return array An array of member variable names which should be included
+     * @access protected
+     */
+    function _getSerializeList()
+    {
+        return array();
+    }
+
+    /**
+     * Set the environment associated with this profile.
+     *
+     * @param string True on success, a Paypal error object on failure
+     */
+    function setEnvironment($environment)
+    {
+        $environment = strtolower($environment);
+
+        $envs = $this->getValidEnvironments();
+        if (Services_PayPal::isError($envs)) {
+            return $envs;
+        }
+
+        if (in_array($environment, $envs)) {
+            $this->_environment = $environment;
+            return true;
+        }
+
+        return Services_PayPal::raiseError("Invalid Environment Specified");
+    }
+
+    /**
+     * Get the environment associated with the profile.
+     *
+     * @return string The environment associated with the profile.
+     */
+    function getEnvironment()
+    {
+        return strtolower($this->_environment);
+    }
+
+    /**
+     * Returns an array of valid Environments
+     *
+     * @return array An array of valid environment names
+     */
+    function getValidEnvironments()
+    {
+        if (empty($this->_validEnvironments)) {
+            $res = $this->loadEnvironments();
+            if (Services_PayPal::isError($res)) {
+                return $res;
+            }
+        }
+
+        return $this->_validEnvironments;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SDK/Generator.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SDK/Generator.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SDK/Generator.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,617 @@
+<?php
+/**
+ * Classes for use in generating the PayPal SDK.
+ *
+ * @package Services_PayPal
+ */
+
+/**
+ * Required classes.
+ */
+require_once 'Services/PayPal.php';
+require_once 'Services/PayPal/SOAP/WSDL.php';
+
+/**
+ * Tool class that handles the PayPal-extended WSDL parsing for
+ * generating functional and type classes.
+ *
+ * $Id: Generator.php,v 1.22 2005/06/23 17:03:21 chagenbuch Exp $
+ *
+ * @package Services_PayPal
+ */
+class PayPal_SDK_Generator extends SOAP_WSDL
+{
+    /**
+     * Unique list of types defined in the WSDL.
+     *
+     * @access protected
+     *
+     * @var array $_allTypes
+     */
+    var $_allTypes = array();
+
+    /**
+     * Constructor. Calls the parent SOAP_WSDL constructor to parse the WSDL.
+     *
+     * @param optional string $wsdl  The WSDL. Defaults to what's bundled
+     *                               with the SDK.
+     */
+    function PayPal_SDK_Generator($wsdl = null)
+    {
+        if (is_null($wsdl)) {
+            $wsdl = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'wsdl' . DIRECTORY_SEPARATOR . 'PayPalSvc.wsdl';
+        }
+
+        parent::SOAP_WSDL($wsdl, array(), WSDL_CACHE_USE, WSDL_CACHE_MAX_AGE, true);
+    }
+
+    /**
+     * Returns the version of the WSDL that this SDK is built against.
+     *
+     * @return float  The WSDL version.
+     */
+    function getWSDLVersion()
+    {
+        if (isset($this->definition['ns:version'])) {
+            return (float)$this->definition['ns:version'];
+        } else {
+            return (float)$this->definition['version'];
+        }
+    }
+
+    /**
+     * Builds the endpoint mapping file which is included in the SDK.
+     *
+     * @param optional string $endpointXmlFile  The endpoint map to use. Defaults
+     *                                          to the one bundled with the SDK.
+     *
+     * @return string  PHP code suitable for writing to a file.
+     */
+    function buildEndpointMap($endpointXmlFile = null)
+    {
+        if (is_null($endpointXmlFile)) {
+            $endpointXmlFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'wsdl' . DIRECTORY_SEPARATOR . 'paypal-endpoints.xml';
+        }
+
+        $xml = @file_get_contents($endpointXmlFile);
+        if (!$xml) {
+            return Services_PayPal::raiseError("Unable to load the endpoint XML");
+        }
+
+        $ep = &new PayPal_SDK_EndpointMappingParser();
+        $result = $ep->parse($xml);
+        if (!$result) {
+            return Services_PayPal::raiseError("Unable to parse the endpoint XML: $ep->error");
+        }
+
+        return "<?php\n/**\n * THIS MAPPING IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n" .
+            " * Generated on: " . strftime('%x %X') . "\n * @package Services_PayPal\n */\n" .
+            "\$PayPalEndpoints = " . var_export($ep->mapping, true) . ";\n";
+    }
+
+    /**
+     * Builds PHP class definitions for all of the complexTypes found
+     * in the WSDL.
+     *
+     * @return array  An array of class definitions.
+     */
+    function buildTypes()
+    {
+        // Make a hash of all type names so we can know what types are
+        // defined.
+        $this->_allTypes = array();
+        foreach ($this->complexTypes as $types) {
+            foreach ($types as $name => $type) {
+                $this->_allTypes[$name] = $name;
+            }
+        }
+
+        // Now generate the PHP code.
+        $classes = array();
+        foreach ($this->complexTypes as $types) {
+            foreach ($types as $name => $type) {
+                if (empty($name)) {
+                    continue;
+                }
+
+                $classes[$name] = $this->_buildType($name, $type);
+            }
+        }
+
+        return $classes;
+    }
+
+    /**
+     * Builds the dynamically generated portion of the CallerServices
+     * API.
+     *
+     * @return string  The dynamically generated API functions (PHP code).
+     */
+    function buildMethods()
+    {
+        $methods = '';
+        foreach (array_keys($this->services[$this->service]['ports']) as $key) {
+            $portcode = $this->generateProxyCode($this->services[$this->service]['ports'][$key]);
+            if (is_null($portcode)) {
+                return Services_PayPal::raiseError("Failed to generate code for port $key");
+            }
+            $methods .= $portcode;
+        }
+
+        return $methods;
+    }
+
+    /**
+     * List all of the methods in all portTypes.
+     *
+     * @return array  An array of method names.
+     */
+    function listMethods()
+    {
+        $methods = array();
+        foreach (array_keys($this->services[$this->service]['ports']) as $key) {
+            $primaryBinding = preg_replace("/^(.*:)/", '', $this->services[$this->service]['ports'][$key]['binding']);
+            $portType = preg_replace("/^(.*:)/", '', $this->bindings[$primaryBinding]['type']);
+
+            $methods = array_merge($methods, array_keys($this->portTypes[$portType]));
+        }
+
+        return $methods;
+    }
+
+    /**
+     * Describe all methods in all portTypes, including their request
+     * and return types.
+     *
+     * @return array  An array of method name => ('request' => 'type', 'response' => 'type')
+     */
+    function describeMethods()
+    {
+        $methods = array();
+
+        foreach (array_keys($this->services[$this->service]['ports']) as $key) {
+            $primaryBinding = preg_replace("/^(.*:)/", '', $this->services[$this->service]['ports'][$key]['binding']);
+            $portType = preg_replace("/^(.*:)/", '', $this->bindings[$primaryBinding]['type']);
+
+            foreach ($this->portTypes[$portType] as $method => $operation) {
+                $param = $this->messages[$operation['input']['message']];
+                $param = $param[key($param)];
+                $param = $this->elements[$param['namespace']][$param['type']];
+                $param = $param['elements'][key($param['elements'])];
+                if (isset($param['ref'])) {
+                    $q =& new QName($param['ref']);
+                    $param = $this->elements[$q->ns][$q->name]['type'];
+                } elseif (isset($param['type'])) {
+                    $param = $param['type'];
+                }
+
+                $result = $this->messages[$operation['output']['message']];
+                $result = $result[key($result)];
+                $result = $this->elements[$result['namespace']][$result['type']]['type'];
+
+                $methods[$method] = array('param' => $param,
+                                          'result' => $result);
+            }
+        }
+
+        return $methods;
+    }
+
+    /**
+     * Generates stub code from the WSDL that can be saved to a file
+     * or eval'd into existence. Overrides the SOAP_WSDL
+     * implementation to do PayPal-specific type and endpoint
+     * handling. Note that that means there are several assumptions
+     * specific to PayPal's services, such as that each method takes
+     * only one argument.
+     *
+     * @param string $port  The WSDL port we're currently generating.
+     *
+     * @return string  The methods for $port.
+     */
+    function generateProxyCode($port)
+    {
+        // Currently do not support HTTP ports.
+        if ($port['type'] != 'soap') {
+            return null;
+        }
+
+        // Get the binding, from that get the port type.
+        $primaryBinding = $port['binding'];
+        $primaryBinding = preg_replace("/^(.*:)/", '', $primaryBinding);
+        $portType = $this->bindings[$primaryBinding]['type'];
+        $portType = preg_replace("/^(.*:)/", '', $portType);
+        $style = $this->bindings[$primaryBinding]['style'];
+        $portName = preg_replace("/^(.*:)/", '', $port['name']);
+
+        $methods = '';
+
+        foreach ($this->portTypes[$portType] as $opname => $operation) {
+            $soapaction = isset($this->bindings[$primaryBinding]['operations'][$opname]['soapAction']) ?
+                $this->bindings[$primaryBinding]['operations'][$opname]['soapAction'] :
+                null;
+            if (isset($this->bindings[$primaryBinding]['operations'][$opname]['style'])) {
+                $opstyle = $this->bindings[$primaryBinding]['operations'][$opname]['style'];
+            } else {
+                $opstyle = $style;
+            }
+            $use = $this->bindings[$primaryBinding]['operations'][$opname]['input']['use'];
+            if ($use == 'encoded') {
+                $namespace = $this->bindings[$primaryBinding]['operations'][$opname]['input']['namespace'];
+            } else {
+                $bindingType = $this->bindings[$primaryBinding]['type'];
+                $ns = $this->portTypes[$bindingType][$opname]['input']['namespace'];
+                $namespace = $this->namespaces[$ns];
+            }
+
+            $args = '';
+            $argarray = '';
+            $comments = '';
+            $wrappers = '';
+
+            foreach ($operation['input'] as $argname => $argtype) {
+                if ($argname == 'message') {
+                    foreach ($this->messages[$argtype] as $_argname => $_argtype) {
+                        $comments = '';
+                        if ($opstyle == 'document' && $use == 'literal' &&
+                            $_argtype['name'] == 'parameters') {
+                            // The type or element referred to is used
+                            // for parameters.
+                            $elattrs = null;
+                            $element = $_argtype['element'];
+                            $el = $this->elements[$_argtype['namespace']][$_argtype['type']];
+
+                            if ($el['complex']) {
+                                $namespace = $this->namespaces[$_argtype['namespace']];
+                                // Need to wrap the parameters in a
+                                // SOAP_Value.
+                            }
+                            if (isset($el['elements'])) {
+                                foreach ($el['elements'] as $elname => $elattrs) {
+                                    // Is the element a complex type?
+                                    if (isset($this->complexTypes[$elattrs['namespace']][$elname])) {
+                                        $comments .= $this->_complexTypeArg($args, $argarray, $_argtype, $_argname);
+                                    } else {
+                                        $this->_addArg($args, $argarray, $elname);
+                                    }
+                                }
+                            }
+                            if ($el['complex'] && $argarray) {
+                                $wrapname = '{' . $this->namespaces[$_argtype['namespace']].'}' . $el['name'];
+                                $comments .= "        \${$el['name']} =& new SOAP_Value('$wrapname', false, \$v = array($argarray));\n";
+                                $argarray = "'{$el['name']}' => \${$el['name']}";
+                            }
+                        } else {
+                            if (isset($_argtype['element'])) {
+                                // Element argument.
+                                $comments = $this->_elementArg($args, $argarray, $_argtype, $_argtype['type']);
+                                $el = $this->elements[$_argtype['namespace']][$_argtype['type']];
+                                $firstargname = array_shift(array_keys($el['elements']));
+                            } else {
+                                // Complex type argument.
+                                $comments = $this->_complexTypeArg($args, $argarray, $_argtype, $_argname);
+                            }
+                        }
+                    }
+                }
+            }
+
+            // Validate entries.
+            if (!$this->_validateString($opname)) {
+                return null;
+            }
+            if (!$this->_validateString($namespace)) {
+                return null;
+            }
+            if (!(is_null($soapaction) || $this->_validateString($soapaction))) {
+                return null;
+            }
+
+            if ($argarray) {
+                $argarray = "array($argarray)";
+            } else {
+                $argarray = 'null';
+            }
+
+            // Include method documentation if we have it.
+            if (isset($operation['documentation'])) {
+                $operation['documentation'] = preg_replace('/\s+/', ' ', $operation['documentation']);
+                $methods .= "    /**\n     * " . wordwrap($operation['documentation'], 80, "\n     * ") . "\n     */\n";
+            }
+
+            $methods .= "    function &$opname($args)\n    {\n" .
+                "        \$start = \$this->_getMicroseconds();\n\n" .
+                "        // Handle type objects.\n" .
+                "        if (is_a($args, 'XSDType')) {\n" .
+                "            {$args}->setVersion(PAYPAL_WSDL_VERSION);\n" .
+                "            $args = {$args}->getSoapValue('$firstargname', '$namespace');\n" .
+                "        }\n\n" .
+                "        // Make sure we can find a valid WSDL endpoint for this method.\n" .
+                "        \$res = \$this->setEndpoint('$portName', PAYPAL_WSDL_VERSION);\n" .
+                "        if (Services_PayPal::isError(\$res)) {\n" .
+                "            \$this->_logTransaction('$opname', \$this->_getElapsed(\$start), \$res);\n" .
+                "            return \$res;\n" .
+                "        }\n\n" .
+                "$comments$wrappers" .
+                "        \$result = \$this->call('$opname',\n" .
+                "                              \$v = $argarray,\n" .
+                "                              array('namespace' => '$namespace',\n" .
+                "                                    'soapaction' => '$soapaction',\n" .
+                "                                    'style' => '$opstyle',\n" .
+                "                                    'use' => '$use'" .
+                ($this->trace?"\n,                                    'trace' => 1" : '') . "));\n\n" .
+                "        \$response = \$this->getResponseObject(\$result, '{$this->elements[$operation['output']['namespace']][$operation['output']['message']]['type']}');\n" .
+                "        \$this->_logTransaction('$opname', \$this->_getElapsed(\$start), \$response);\n" .
+                "        return \$response;\n" .
+                "    }\n\n";
+        }
+
+        return $methods;
+    }
+
+    /**
+     * Makes a string safe for use as a PHP variable or function name.
+     *
+     * @access private
+     *
+     * @param string $name  The string to sanitize.
+     *
+     * @return string  The PHP-safe name.
+     */
+    function _phpName($name)
+    {
+        return preg_replace('/[ .\-\(\)]+/', '_', $name);
+    }
+
+    /**
+     * Generate a complete PHP class file for one WSDL type.
+     *
+     * @access private
+     *
+     * @param string $name  The name of the type.
+     * @param array  $type  A hash with the type's definition.
+     *
+     * @return string  A PHP class file.
+     */
+    function _buildType($name, $type)
+    {
+        $parentClass = 'XSDType';
+        if (!empty($type['extends'])) {
+            if (isset($this->_allTypes[$type['extends']])) {
+                $parentClass = $type['extends'];
+            } else {
+                // This is probably a complexType using simpleContent.
+                $parentClass = 'XSDSimpleType';
+            }
+        }
+        $parentClass = $this->_phpName($parentClass);
+        $name = $this->_phpName($name);
+
+        $namespace = isset($type['namespace']) ? (isset($this->namespaces[$type['namespace']]) ?
+                                                  $this->namespaces[$type['namespace']] : null) : null;
+
+        $vars = '';
+        $funcs = '';
+        $elements = array();
+        if (!empty($type['elements'])) {
+            foreach ($type['elements'] as $ename => $element) {
+                $ens = $namespace;
+                $ename = $this->_phpName($ename);
+                if (isset($element['ref'])) {
+                    $ref =& new QName($element['ref']);
+                    if (isset($this->elements[$ref->ns][$ref->name])) {
+                        $element = array_merge($this->elements[$ref->ns][$ref->name],
+                                               array('minOccurs' => isset($element['minOccurs']) ? $element['minOccurs'] : null));
+                        $ens = $this->namespaces[$ref->ns];
+                    }
+                }
+
+                $elements[$ename] = array(
+                    'required' => isset($element['minOccurs']) && $element['minOccurs'] == 0 ? false : true,
+                    'type' => isset($element['type']) ? $element['type'] : null,
+                    'namespace' => $ens,
+                    );
+
+                if (isset($element['documentation'])) {
+                    $vars.= "    /**\n     * " . wordwrap($element['documentation'], 80, "\n     * ") . "\n     */\n";
+                }
+                $vars .= "    var \$$ename;\n\n";
+                $funcs .= "    function get$ename()\n    {\n        return \$this->$ename;\n    }\n";
+                $funcs .= "    function set$ename(\$$ename, \$charset = 'iso-8859-1')\n    {\n        \$this->$ename = \$$ename;\n        \$this->_elements['$ename']['charset'] = \$charset;\n    }\n";
+            }
+        }
+
+        $attributes = array();
+        if (!empty($type['attribute'])) {
+            $attributes = $type['attribute'];
+        }
+
+        $const = "    function $name()\n    {\n";
+        $const .= "        parent::$parentClass();\n";
+        $const .= "        \$this->_namespace = " . var_export($namespace, true) . ";\n";
+        if (count($elements)) {
+            $const .= "        \$this->_elements = array_merge(\$this->_elements,\n            " .
+                str_replace("\n", "\n            ", var_export($elements, true)) . ");\n";
+        }
+        if (count($attributes)) {
+            $const .= "        \$this->_attributes = array_merge(\$this->_attributes,\n            " .
+                str_replace("\n", "\n            ", var_export($attributes, true)) . ");\n";
+        }
+        $const .= "    }\n";
+
+        $docs = $name;
+        if (isset($type['documentation'])) {
+            $docs .= "\n * \n * " . wordwrap($type['documentation'], 80, "\n * ");
+        }
+
+        return "<?php\n" .
+            "/**\n" .
+            " * @package Services_PayPal\n" .
+            " */\n\n" .
+            "/**\n" .
+            " * Make sure our parent class is defined.\n" .
+            " */\n" .
+            "require_once 'Services/PayPal/Type/$parentClass.php';\n\n" .
+            "/**\n" .
+            " * $docs\n" .
+            " *\n" .
+            " * @package Services_PayPal\n" .
+            " */\n" .
+            "class $name extends $parentClass\n{\n" . $vars . $const . "\n" . $funcs . "}\n";
+    }
+
+}
+
+/**
+ * Parser for the XML endpoints mapping file.
+ *
+ * @package Services_PayPal
+ */
+class PayPal_SDK_EndpointMappingParser
+{
+    /**
+     * XML parser resource.
+     * @var resource $parser
+     */
+    var $parser = null;
+
+    /**
+     * The array that all the parsed information gets dumped into.
+     * @var array $structure
+     */
+    var $mapping = array();
+
+    /**
+     * Pointer to current tree point.
+     * @var array $pointers
+     */
+    var $pointers = array();
+
+    /**
+     * Error string.
+     * @var string $error
+     */
+    var $error = '';
+
+    /**
+     * Actually do the parsing. Separated from the constructor just in
+     * case you want to set any other options on the parser, load
+     * initial data, whatever.
+     *
+     * @access protected
+     *
+     * @param $data  The XML data to parse as RSS.
+     */
+    function parse($data)
+    {
+        $this->_init();
+
+        // Sanity checks.
+        if (!$this->parser) {
+            $this->error = 'Could not find xml parser handle';
+            return false;
+        }
+
+        // Parse.
+        if (!@xml_parse($this->parser, $data)) {
+            $this->error = sprintf('XML error: %s at line %d', xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser));
+            return false;
+        }
+
+        // Clean up.
+        xml_parser_free($this->parser);
+
+        return true;
+    }
+
+    /**
+     * Start collecting data about a new element.
+     */
+    function startElement($parser, $name, $attribs)
+    {
+        $parts = explode(':', $name);
+        $tag = array_pop($parts);
+        $ns = implode(':', $parts);
+
+        switch ($tag) {
+        case 'endpoints':
+            $this->mapping = array();
+            $this->pointers = array();
+            break;
+
+        case 'wsdl':
+            $this->mapping[] = array('min' => $attribs['min-version'],
+                                     'max' => $attribs['max-version'],
+                                     'environments' => array());
+            $this->pointers[] =& $this->mapping[count($this->mapping) - 1]['environments'];
+            break;
+
+        case 'environment':
+            $this->pointers[count($this->pointers) - 1][strtolower($attribs['name'])] = array();
+            $this->pointers[] =& $this->pointers[count($this->pointers) - 1][strtolower($attribs['name'])];
+            break;
+
+        case 'port':
+            $this->pointers[] =& $this->pointers[count($this->pointers) - 1][$attribs['name']];
+            break;
+        }
+    }
+
+    /**
+     * Handle the ends of XML elements - wrap up whatever we've been
+     * putting together and store it for safekeeping.
+     */
+    function endElement($parser, $name)
+    {
+        $parts = explode(':', $name);
+        $tag = array_pop($parts);
+        $ns = implode(':', $parts);
+
+        switch ($tag) {
+        case 'endpoints':
+            unset($this->pointers);
+            break;
+
+        case 'wsdl':
+        case 'environment':
+        case 'port':
+            array_pop($this->pointers);
+            break;
+        }
+    }
+
+    /**
+     * The handler for character data encountered in the XML file.
+     */
+    function characterData($parser, $data)
+    {
+        if (preg_match('|\S|', $data)) {
+            $this->pointers[count($this->pointers) - 1] = trim($data);
+        }
+    }
+
+    /**
+     * Handles things that we don't recognize.
+     */
+    function defaultHandler($parser, $data)
+    {
+    }
+
+    /**
+     * Initialize the XML parser.
+     *
+     * @access private
+     */
+    function _init()
+    {
+        // Create the XML parser.
+        $this->parser = xml_parser_create();
+        xml_set_object($this->parser, $this);
+        xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false);
+        xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
+        xml_set_element_handler($this->parser, 'startElement', 'endElement');
+        xml_set_character_data_handler($this->parser, 'characterData');
+        xml_set_default_handler($this->parser, 'defaultHandler');
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SDK.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SDK.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SDK.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,121 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Include needed files.
+ */
+require_once 'Services/PayPal.php';
+require_once 'Services/PayPal/SDK/Generator.php';
+
+/**
+ * Base SDK maintenance class that provides methods for generating and updating
+ * the PayPal SDK.
+ *
+ * $Id: SDK.php,v 1.21 2005/06/23 17:03:21 chagenbuch Exp $
+ *
+ * @package Services_PayPal
+ */
+class PayPal_SDK
+{
+    /**
+     * The PayPal_SDK_Generator we use to make PHP code.
+     *
+     * @access private
+     */
+    var $_generator;
+
+    /**
+     * Constructor.
+     *
+     * @param optional string $wsdl  The WSDL. Defaults to what's bundled
+     *                               with the SDK.
+     */
+    function PayPal_SDK($wsdl = null)
+    {
+        $this->_generator =& new PayPal_SDK_Generator($wsdl);
+    }
+
+    /**
+     * Write the endpoint mapping file.
+     *
+     * @param string $endpointPhpFile  The full file path to write to.
+     * @param string $endpointXmlFile  (optional) The endpoint XML to use.
+     *                                 Defaults to the bundled version.
+     */
+    function writeEndpointMap($endpointPhpFile, $endpointXmlFile = null)
+    {
+        $phpcode = $this->_generator->buildEndpointMap($endpointXmlFile);
+        if (Services_PayPal::isError($phpcode)) {
+            return $phpcode;
+        }
+
+        $fp = fopen($endpointPhpFile, 'w');
+        if (!$fp) {
+            return Services_PayPal::raiseError("Unable to write $endpointPhpFile.");
+        }
+        if (!fwrite($fp, $phpcode)) {
+            return Services_PayPal::raiseError("Unable to write $endpointPhpFile.");
+        }
+        return fclose($fp);
+    }
+
+    /**
+     * Write the generated type class files.
+     *
+     * @param string $typesDir  The directory to write the .php files in.
+     */
+    function writeTypes($typesDir)
+    {
+        $types = $this->_generator->buildTypes();
+        if (Services_PayPal::isError($types)) {
+            return $types;
+        }
+
+        foreach ($types as $name => $phpcode) {
+            $file = $typesDir . DIRECTORY_SEPARATOR . $name . '.php';
+            $fp = fopen($file, 'w');
+            if (!$fp) {
+                return Services_PayPal::raiseError("Unable to write $file.");
+            }
+            if (!fwrite($fp, $phpcode)) {
+                return Services_PayPal::raiseError("Unable to write $file.");
+            }
+            fclose($fp);
+        }
+
+        return true;
+    }
+
+    /**
+     * Write a new CallerServices.php based on CallerServices.php.in
+     *
+     * @param string $phpFile  The full file path to write to.
+     */
+    function writeCallerServices($phpFile)
+    {
+        $methods = $this->_generator->buildMethods();
+        if (Services_PayPal::isError($methods)) {
+            return $methods;
+        }
+
+        $phpTemplate = file_get_contents(dirname(__FILE__) . '/CallerServices.php.in');
+        if (!$phpTemplate) {
+            return Services_PayPal::raiseError('Unable to read CallerServices template.');
+        }
+
+        $phpTemplate = str_replace('@@GENERATED_FUNCTIONS@@', trim($methods), $phpTemplate);
+        $phpTemplate = str_replace('@@WSDL_VERSION@@', $this->_generator->getWSDLVersion(), $phpTemplate);
+
+        $fp = fopen($phpFile, 'w');
+        if (!$fp) {
+            return Services_PayPal::raiseError("Unable to write $phpFile.");
+        }
+        if (!fwrite($fp, $phpTemplate)) {
+            return Services_PayPal::raiseError("Unable to write $phpFile.");
+        }
+        return fclose($fp);
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Base.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Base.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Base.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1181 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: Base.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+/*
+   SOAP_OBJECT_STRUCT makes pear::soap use objects for soap structures
+   rather than arrays.  This has been done to provide a closer match to php-soap.
+   If the old behaviour is needed, set to false.  The old behaviour is deprecated.
+*/
+$GLOBALS['SOAP_OBJECT_STRUCT'] = true;
+/*
+   SOAP_RAW_CONVERT makes pear::soap attempt to determine what SOAP type
+   a php string COULD be.  This may result in slightly better interoperability when
+   you are not using WSDL, and are being lazy and not using SOAP_Value to define
+   types for your values.
+*/
+$GLOBALS['SOAP_RAW_CONVERT'] = false;
+
+require_once 'PEAR.php';
+require_once 'Services/PayPal/SOAP/Type/dateTime.php';
+require_once 'Services/PayPal/SOAP/Type/hexBinary.php';
+
+// optional features
+$GLOBALS['SOAP_options'] = array();
+
+ at include_once 'Mail/mimePart.php';
+ at include_once 'Mail/mimeDecode.php';
+if (class_exists('Mail_mimePart')) {
+    $GLOBALS['SOAP_options']['Mime'] = 1;
+    define('MAIL_MIMEPART_CRLF', "\r\n");
+}
+
+ at include_once 'Net/DIME.php';
+if (class_exists('Net_DIME_Message')) {
+    $GLOBALS['SOAP_options']['DIME'] = 1;
+}
+
+/**
+ * Enable debugging informations?
+ *
+ * @name   $SOAP_DEBUG
+ * @global $GLOBALS['SOAP_DEBUG']
+ */
+$GLOBALS['SOAP_DEBUG'] = false;
+
+if (!function_exists('version_compare') ||
+    version_compare(phpversion(), '4.1', '<')) {
+    die("requires PHP 4.1 or higher\n");
+}
+if (version_compare(phpversion(), '4.1', '>=') &&
+    version_compare(phpversion(), '4.2', '<')) {
+    define('FLOAT', 'double');
+} else {
+    define('FLOAT', 'float');
+}
+
+if (!defined('INF')) {
+    define('INF', 1.8e307);
+}
+if (!defined('NAN')) {
+    define('NAN', 0.0);
+}
+
+define('SOAP_LIBRARY_VERSION', '0.8.0RC4');
+define('SOAP_LIBRARY_NAME',    'PEAR-SOAP 0.8.0RC4-devel');
+
+// set schema version
+define('SOAP_XML_SCHEMA_VERSION',   'http://www.w3.org/2001/XMLSchema');
+define('SOAP_XML_SCHEMA_INSTANCE',  'http://www.w3.org/2001/XMLSchema-instance');
+define('SOAP_XML_SCHEMA_1999',      'http://www.w3.org/1999/XMLSchema');
+define('SOAP_SCHEMA',               'http://schemas.xmlsoap.org/wsdl/soap/');
+define('SOAP_SCHEMA_ENCODING',      'http://schemas.xmlsoap.org/soap/encoding/');
+define('SOAP_ENVELOP',              'http://schemas.xmlsoap.org/soap/envelope/');
+
+define('SCHEMA_DISCO',              'http://schemas.xmlsoap.org/disco/');
+define('SCHEMA_DISCO_SCL',          'http://schemas.xmlsoap.org/disco/scl/');
+
+define('SCHEMA_SOAP',               'http://schemas.xmlsoap.org/wsdl/soap/');
+define('SCHEMA_SOAP_HTTP',          'http://schemas.xmlsoap.org/soap/http');
+define('SCHEMA_WSDL_HTTP',          'http://schemas.xmlsoap.org/wsdl/http/');
+define('SCHEMA_MIME',               'http://schemas.xmlsoap.org/wsdl/mime/');
+define('SCHEMA_WSDL',               'http://schemas.xmlsoap.org/wsdl/');
+define('SCHEMA_DIME',               'http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/');
+define('SCHEMA_CONTENT',            'http://schemas.xmlsoap.org/ws/2002/04/content-type/');
+define('SCHEMA_REF',                'http://schemas.xmlsoap.org/ws/2002/04/reference/');
+
+define('SOAP_DEFAULT_ENCODING',  'UTF-8');
+
+if (!function_exists('is_a'))
+{
+    function is_a(&$object, $class_name)
+    {
+        if (strtolower(get_class($object)) == $class_name) {
+            return true;
+        }
+        return is_subclass_of($object, $class_name);
+    }
+}
+
+if (!class_exists('stdClass')) {
+    /* PHP5 doesn't define this? */
+    class stdClass {
+        function __constructor() {}
+    };
+}
+
+class SOAP_Base_Object extends PEAR
+{
+    /**
+     * Store debugging information in $debug_data?
+     *
+     * @var  boolean if true debugging informations will be store in $debug_data
+     * @see  $debug_data, SOAP_Base
+     */
+    var $_debug_flag = false;
+
+    /**
+     * String containing debugging informations if $debug_flag is set to true
+     *
+     * @var      string  debugging informations - mostyl error messages
+     * @see      $debug_flag, SOAP_Base
+     * @access   public
+     */
+    var $_debug_data = '';
+
+    /**
+     * supported encodings, limited by XML extension
+     */
+    var $_encodings = array('ISO-8859-1', 'US-ASCII', 'UTF-8');
+
+    /**
+     * Fault code
+     *
+     * @var  string
+     */
+    var $_myfaultcode = '';
+
+    /**
+     * Recent PEAR error object
+     *
+     * @var  object  PEAR Error
+     */
+    var $fault = null;
+
+    /**
+     * Constructor
+     *
+     * @param    string  error code
+     * @see  $debug_data, _debug()
+     */
+    function SOAP_Base_Object($faultcode = 'Client')
+    {
+        $this->_myfaultcode = $faultcode;
+        $this->_debug_flag = $GLOBALS['SOAP_DEBUG'];
+        parent::PEAR('SOAP_Fault');
+    }
+
+    /**
+     * Raise a soap error
+     *
+     * Please referr to the SOAP definition for an impression of what a certain parameter
+     * stands for.
+     *
+     * Use $debug_flag to store errors to the member variable $debug_data
+     *
+     * @param    string  error message
+     * @param    string  detailed error message.
+     * @param    string  actor
+     * @param    mixed
+     * @param    mixed
+     * @param    mixed
+     * @param    boolean
+     * @see      $debug_flag, $debug_data
+     */
+    function &_raiseSoapFault($str, $detail = '', $actorURI = '', $code = null, $mode = null, $options = null, $skipmsg = false)
+    {
+        // Pass through previous faults.
+        $is_instance = isset($this);
+        if (is_object($str)) {
+            $fault =& $str;
+        } else {
+            if (!$code) {
+                $code = $is_instance?$this->_myfaultcode:'Client';
+            }
+            $fault =& new SOAP_Fault($str,
+                                     $code,
+                                     $actorURI,
+                                     $detail,
+                                     $mode,
+                                     $options);
+        }
+        if ($is_instance) {
+            $this->fault =& $fault;
+        }
+        return $fault;
+    }
+
+    function __isfault()
+    {
+        return $this->fault != null;
+    }
+
+    function &__getfault()
+    {
+        return $this->fault;
+    }
+
+    /**
+     * maintains a string of debug data.
+     *
+     * @param    debugging message - sometimes an error message
+     */
+    function _debug($string)
+    {
+        if ($this->_debug_flag) {
+            $this->_debug_data .= get_class($this) . ': ' . preg_replace("/>/", ">\r\n", $string) . "\n";
+        }
+    }
+
+}
+
+/**
+ * SOAP_Base
+ * Common base class of all Soap lclasses
+ *
+ * @access   public
+ * @package  SOAP::Client
+ * @author   Shane Caraveo <shane at php.net> Conversion to PEAR and updates
+ */
+class SOAP_Base extends SOAP_Base_Object
+{
+    var $_XMLSchema = array('http://www.w3.org/2001/XMLSchema', 'http://www.w3.org/1999/XMLSchema');
+    var $_XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema';
+
+    // load types into typemap array
+    var $_typemap = array(
+        'http://www.w3.org/2001/XMLSchema' => array(
+            'string' => 'string',
+            'boolean' => 'boolean',
+            'float' => FLOAT,
+            'double' => FLOAT,
+            'decimal' => FLOAT,
+            'duration' => 'integer',
+            'dateTime' => 'string',
+            'time' => 'string',
+            'date' => 'string',
+            'gYearMonth' => 'integer',
+            'gYear' => 'integer',
+            'gMonthDay' => 'integer',
+            'gDay' => 'integer',
+            'gMonth' => 'integer',
+            'hexBinary' => 'string',
+            'base64Binary' => 'string',
+            // derived datatypes
+            'normalizedString' => 'string',
+            'token' => 'string',
+            'language' => 'string',
+            'NMTOKEN' => 'string',
+            'NMTOKENS' => 'string',
+            'Name' => 'string',
+            'NCName' => 'string',
+            'ID' => 'string',
+            'IDREF' => 'string',
+            'IDREFS' => 'string',
+            'ENTITY' => 'string',
+            'ENTITIES' => 'string',
+            'integer' => 'integer',
+            'nonPositiveInteger' => 'integer',
+            'negativeInteger' => 'integer',
+            'long' => 'integer',
+            'int' => 'integer',
+            'short' => 'integer',
+            'byte' => 'string',
+            'nonNegativeInteger' => 'integer',
+            'unsignedLong' => 'integer',
+            'unsignedInt' => 'integer',
+            'unsignedShort' => 'integer',
+            'unsignedByte' => 'integer',
+            'positiveInteger'  => 'integer',
+            'anyType' => 'string',
+            'anyURI' => 'string',
+            'QName' => 'string'
+        ),
+        'http://www.w3.org/1999/XMLSchema' => array(
+            'i4' => 'integer',
+            'int' => 'integer',
+            'boolean' => 'boolean',
+            'string' => 'string',
+            'double' => FLOAT,
+            'float' => FLOAT,
+            'dateTime' => 'string',
+            'timeInstant' => 'string',
+            'base64Binary' => 'string',
+            'base64' => 'string',
+            'ur-type' => 'string'
+        ),
+        'http://schemas.xmlsoap.org/soap/encoding/' => array(
+            'base64' => 'string',
+            'array' => 'array',
+            'Array' => 'array',
+            'Struct' => 'array')
+        );
+
+    /**
+     * Default class name to use for decoded response objects.
+     */
+    var $_defaultObjectClassname = 'stdClass';
+
+    // Load namespace uris into an array of uri => prefix
+    var $_namespaces;
+    var $_namespace;
+
+    var $_xmlEntities = array('&' => '&amp;', '<' => '&lt;', '>' => '&gt;', "'" => '&apos;', '"' => '&quot;');
+
+    var $_doconversion = false;
+
+    var $__attachments = array();
+
+    var $_wsdl = null;
+
+    /**
+     * section5
+     *
+     * @var  boolean  defines if we use section 5 encoding, or false if this is literal
+     */
+    var $_section5 = true;
+
+    // handle type to class mapping
+    var $_auto_translation = false;
+    var $_type_translation = array();
+
+    /**
+     * Constructor
+     *
+     * @param    string  error code
+     * @see  $debug_data, _debug()
+     */
+    function SOAP_Base($faultcode = 'Client')
+    {
+        parent::SOAP_Base_Object($faultcode);
+        $this->_resetNamespaces();
+    }
+
+    function _resetNamespaces()
+    {
+        $this->_namespaces = array(
+            'http://schemas.xmlsoap.org/soap/envelope/' => 'SOAP-ENV',
+            'http://www.w3.org/2001/XMLSchema' => 'xsd',
+            'http://www.w3.org/2001/XMLSchema-instance' => 'xsi',
+            'http://schemas.xmlsoap.org/soap/encoding/' => 'SOAP-ENC');
+    }
+
+    /**
+     * _setSchemaVersion
+     *
+     * sets the schema version used in the soap message
+     *
+     * @param string (see globals.php)
+     *
+     * @access private
+     */
+    function _setSchemaVersion($schemaVersion)
+    {
+        if (!in_array($schemaVersion, $this->_XMLSchema)) {
+            return $this->_raiseSoapFault("unsuported XMLSchema $schemaVersion");
+        }
+        $this->_XMLSchemaVersion = $schemaVersion;
+        $tmpNS = array_flip($this->_namespaces);
+        $tmpNS['xsd'] = $this->_XMLSchemaVersion;
+        $tmpNS['xsi'] = $this->_XMLSchemaVersion. '-instance';
+        $this->_namespaces = array_flip($tmpNS);
+    }
+
+    function _getNamespacePrefix($ns)
+    {
+        if ($this->_namespace && $ns == $this->_namespace) {
+            return '';
+        }
+        if (isset($this->_namespaces[$ns])) {
+            return $this->_namespaces[$ns];
+        }
+        $prefix = 'ns' . count($this->_namespaces);
+        $this->_namespaces[$ns] = $prefix;
+        return $prefix;
+    }
+
+    function _getNamespaceForPrefix($prefix)
+    {
+        $flipped = array_flip($this->_namespaces);
+        if (isset($flipped[$prefix])) {
+            return $flipped[$prefix];
+        }
+        return null;
+    }
+
+    function _isSoapValue(&$value)
+    {
+        return is_object($value) && is_a($value, 'soap_value');
+    }
+
+    function _serializeValue(&$value, $name = '', $type = false, $elNamespace = null,
+                             $typeNamespace = null, $options = array(), $attributes = array(), $artype = '')
+    {
+        $namespaces = array();
+        $arrayType = $array_depth = $xmlout_value = null;
+        $typePrefix = $elPrefix = $xmlout_offset = $xmlout_arrayType = $xmlout_type = $xmlns = '';
+        $ptype = $array_type_ns = '';
+
+        if (!$name || is_numeric($name)) {
+            $name = 'item';
+        }
+
+        if ($this->_wsdl) {
+            list($ptype, $arrayType, $array_type_ns, $array_depth)
+                = $this->_wsdl->getSchemaType($type, $name, $typeNamespace);
+        }
+
+        if (!$arrayType) {
+            $arrayType = $artype;
+        }
+        if (!$ptype) {
+            $ptype = $this->_getType($value);
+        }
+        if (!$type) {
+            $type = $ptype;
+        }
+
+        if (strcasecmp($ptype, 'Struct') == 0 || strcasecmp($type, 'Struct') == 0) {
+            // struct
+            $vars = null;
+            if (is_object($value)) {
+                $vars = get_object_vars($value);
+            } else {
+                $vars = &$value;
+            }
+            if (is_array($vars)) {
+                foreach (array_keys($vars) as $k) {
+                    // Hide private vars.
+                    if ($k[0] == '_') continue;
+                    if (is_object($vars[$k])) {
+                        if (is_a($vars[$k], 'soap_value')) {
+                            $xmlout_value .= $vars[$k]->serialize($this);
+                        } else {
+                            // XXX get the members and serialize them instead
+                            // converting to an array is more overhead than we
+                            // should really do.
+                            $xmlout_value .= $this->_serializeValue(get_object_vars($vars[$k]), $k, false, $this->_section5 ? null : $elNamespace);
+                        }
+                    } else {
+                        $xmlout_value .= $this->_serializeValue($vars[$k], $k, false, $this->_section5 ? null : $elNamespace);
+                    }
+                }
+            }
+        } elseif (strcasecmp($ptype, 'Array') == 0 || strcasecmp($type, 'Array') == 0) {
+            // Array.
+            $typeNamespace = SOAP_SCHEMA_ENCODING;
+            $orig_type = $type;
+            $type = 'Array';
+            $numtypes = 0;
+            // XXX this will be slow on larger arrays. Basically, it
+            // flattens arrays to allow us to serialize
+            // multi-dimensional arrays. We only do this if arrayType
+            // is set, which will typically only happen if we are
+            // using WSDL
+            if (isset($options['flatten']) || ($arrayType && (strchr($arrayType, ',') || strstr($arrayType, '][')))) {
+                $numtypes = $this->_multiArrayType($value, $arrayType, $ar_size, $xmlout_value);
+            }
+
+            $array_type = $array_type_prefix = '';
+            if ($numtypes != 1) {
+                $arrayTypeQName =& new QName($arrayType);
+                $arrayType = $arrayTypeQName->name;
+                $array_types = array();
+                $array_val = null;
+
+                // Serialize each array element.
+                $ar_size = count($value);
+                foreach ($value as $array_val) {
+                    if ($this->_isSoapValue($array_val)) {
+                        $array_type = $array_val->type;
+                        $array_types[$array_type] = 1;
+                        $array_type_ns = $array_val->type_namespace;
+                        $xmlout_value .= $this->_serializeValue($array_val, $array_val->name, $array_type, $array_type_ns);
+                    } else {
+                        $array_type = $this->_getType($array_val);
+                        $array_types[$array_type] = 1;
+                        $xmlout_value .= $this->_serializeValue($array_val, 'item', $array_type, $this->_section5 ? null : $elNamespace);
+                    }
+                }
+
+                $xmlout_offset = " SOAP-ENC:offset=\"[0]\"";
+                if (!$arrayType) {
+                    $numtypes = count($array_types);
+                    if ($numtypes == 1) {
+                        $arrayType = $array_type;
+                    }
+                    // Using anyType is more interoperable.
+                    if ($array_type == 'Struct') {
+                        $array_type = '';
+                    } elseif ($array_type == 'Array') {
+                        $arrayType = 'anyType';
+                        $array_type_prefix = 'xsd';
+                    } else {
+                        if (!$arrayType) {
+                            $arrayType = $array_type;
+                        }
+                    }
+                }
+            }
+            if (!$arrayType || $numtypes > 1) {
+                $arrayType = 'xsd:anyType'; // should reference what schema we're using
+            } else {
+                if ($array_type_ns) {
+                    $array_type_prefix = $this->_getNamespacePrefix($array_type_ns);
+                } elseif (isset($this->_typemap[$this->_XMLSchemaVersion][$arrayType])) {
+                    $array_type_prefix = $this->_namespaces[$this->_XMLSchemaVersion];
+                }
+                if ($array_type_prefix)
+                    $arrayType = $array_type_prefix. ':' .$arrayType;
+            }
+
+            $xmlout_arrayType = " SOAP-ENC:arrayType=\"" . $arrayType;
+            if ($array_depth != null) {
+                for ($i = 0; $i < $array_depth; $i++) {
+                    $xmlout_arrayType .= '[]';
+                }
+            }
+            $xmlout_arrayType .= "[$ar_size]\"";
+        } elseif ($this->_isSoapValue($value)) {
+            $xmlout_value =& $value->serialize($this);
+        } elseif ($type == 'string') {
+            $xmlout_value = htmlspecialchars($value);
+        } elseif ($type == 'rawstring') {
+            $xmlout_value =& $value;
+        } elseif ($type == 'boolean') {
+            $xmlout_value = $value?'true':'false';
+        } else {
+            $xmlout_value =& $value;
+        }
+
+        // Add namespaces.
+        if ($elNamespace) {
+            $elPrefix = $this->_getNamespacePrefix($elNamespace);
+            if ($elPrefix) {
+                $xmlout_name = "$elPrefix:$name";
+            } else {
+                $xmlout_name = $name;
+            }
+        } else {
+            $xmlout_name = $name;
+        }
+
+        if ($typeNamespace) {
+            $typePrefix = $this->_getNamespacePrefix($typeNamespace);
+            if ($typePrefix) {
+                $xmlout_type = "$typePrefix:$type";
+            } else {
+                $xmlout_type = $type;
+            }
+        } elseif ($type && isset($this->_typemap[$this->_XMLSchemaVersion][$type])) {
+            $typePrefix = $this->_namespaces[$this->_XMLSchemaVersion];
+            if ($typePrefix) {
+                $xmlout_type = "$typePrefix:$type";
+            } else {
+                $xmlout_type = $type;
+            }
+        }
+
+        // Handle additional attributes.
+        $xml_attr = '';
+        if (count($attributes)) {
+            foreach ($attributes as $k => $v) {
+                $kqn =& new QName($k);
+                $vqn =& new QName($v);
+                $xml_attr .= ' ' . $kqn->fqn() . '="' . $vqn->fqn() . '"';
+            }
+        }
+
+        // Store the attachement for mime encoding.
+        if (isset($options['attachment'])) {
+            $this->__attachments[] = $options['attachment'];
+        }
+
+        if ($this->_section5) {
+            if ($xmlout_type) {
+                $xmlout_type = " xsi:type=\"$xmlout_type\"";
+            }
+            if (is_null($xmlout_value)) {
+                $xml = "\r\n<$xmlout_name$xmlout_type$xmlns$xmlout_arrayType$xml_attr xsi:nil=\"true\"/>";
+            } else {
+                $xml = "\r\n<$xmlout_name$xmlout_type$xmlns$xmlout_arrayType$xmlout_offset$xml_attr>" .
+                    $xmlout_value . "</$xmlout_name>";
+            }
+        } else {
+            if (is_null($xmlout_value)) {
+                $xml = "\r\n<$xmlout_name$xmlns$xml_attr/>";
+            } else {
+                $xml = "\r\n<$xmlout_name$xmlns$xml_attr>" .
+                    $xmlout_value . "</$xmlout_name>";
+            }
+        }
+
+        return $xml;
+    }
+
+    /**
+     * SOAP::Value::_getType
+     *
+     * Convert a php type to a soap type.
+     *
+     * @param string &$value  The value to inspect.
+     *
+     * @return string  Soap type.
+     *
+     * @access   private
+     */
+    function _getType(&$value)
+    {
+        global $SOAP_OBJECT_STRUCT, $SOAP_RAW_CONVERT;
+        $type = gettype($value);
+        switch ($type) {
+        case 'object':
+            if (is_a($value, 'soap_value')) {
+                $type = $value->type;
+            } else {
+                $type = 'Struct';
+            }
+            break;
+
+        case 'array':
+            // XXX hashes always get done as structs by pear::soap
+            if ($this->_isHash($value)) {
+                $type = 'Struct';
+            } else {
+                $ar_size = count($value);
+                reset($value);
+                $key1 = key($value);
+                if ($ar_size > 0 && is_a($key1, 'soap_value')) {
+                    // fixme for non-wsdl structs that are all the same type
+                    $key2 = key($value);
+                    if ($ar_size > 1 &&
+                        $this->_isSoapValue($key1) &&
+                        $this->_isSoapValue($key2) &&
+                        $key1->name != $key2->name) {
+                        // this is a struct, not an array
+                        $type = 'Struct';
+                    } else {
+                        $type = 'Array';
+                    }
+                } else {
+                    $type = 'Array';
+                }
+            }
+            break;
+
+        case 'integer':
+        case 'long':
+            $type = 'int';
+            break;
+
+        case 'boolean':
+            break;
+
+        case 'double':
+            $type = 'float'; // double is deprecated in 4.2 and later
+            break;
+
+        case 'null':
+            $type = '';
+            break;
+
+        case 'string':
+            if ($SOAP_RAW_CONVERT) {
+                if (is_numeric($value)) {
+                    if (strstr($value, '.')) {
+                        $type = 'float';
+                    } else {
+                        $type = 'int';
+                    }
+                } else {
+                    if (SOAP_Type_hexBinary::is_hexbin($value)) {
+                        $type = 'hexBinary';
+                    } else {
+                        if ($this->_isBase64($value)) {
+                            $type = 'base64Binary';
+                        } else {
+                            $dt =& new SOAP_Type_dateTime($value);
+                            if ($dt->toUnixtime() != -1) {
+                                $type = 'dateTime';
+                            }
+                        }
+                    }
+                }
+            }
+            break;
+
+        default:
+            break;
+        }
+
+        return $type;
+    }
+
+    function _multiArrayType(&$value, &$type, &$size, &$xml)
+    {
+        $sz = count($value);
+        if (is_array($value)) {
+            // Seems we have a multi dimensional array, figure it out
+            // if we do.
+            $c = count($value);
+            for ($i = 0; $i < $c; $i++) {
+                $this->_multiArrayType($value[$i], $type, $size, $xml);
+            }
+
+            if ($size) {
+                $size = $sz. ',' . $size;
+            } else {
+                $size = $sz;
+            }
+            return 1;
+        } else {
+            if (is_object($value)) {
+                $type = $value->type;
+                $xml .= $value->serialize($this);
+            } else {
+                $type = $this->_getType($value);
+                $xml .= $this->_serializeValue($value, 'item', $type);
+            }
+        }
+        $size = null;
+        return 1;
+    }
+
+    /**
+     *
+     * @param    string
+     * @return   boolean
+     */
+    function _isBase64(&$value)
+    {
+        $l = strlen($value);
+        if ($l) {
+            return $value[$l - 1] == '=' && preg_match("/[A-Za-z=\/\+]+/", $value);
+        }
+        return false;
+    }
+
+    /**
+     *
+     * @param    string
+     * @return   boolean
+     */
+    function _isBase64Type($type)
+    {
+        return $type == 'base64' || $type == 'base64Binary';
+    }
+
+    /**
+     *
+     * @param    mixed
+     * @return   boolean
+     */
+    function _isHash(&$a)
+    {
+        // XXX I really dislike having to loop through this in PHP
+        // code, really large arrays will be slow.  We need a C
+        // function to do this.
+        $names = array();
+        $it = 0;
+        foreach ($a as $k => $v) {
+            // Checking the type is faster than regexp.
+            $t = gettype($k);
+            if ($t != 'integer') {
+                return true;
+            } elseif ($this->_isSoapValue($v)) {
+                $names[$v->name] = 1;
+            }
+            // If someone has a large hash they should realy be
+            // defining the type.
+            if ($it++ > 10) {
+                return false;
+            }
+        }
+        return count($names)>1;
+    }
+
+    function &_un_htmlentities($string)
+    {
+        $trans_tbl = get_html_translation_table(HTML_ENTITIES);
+        $trans_tbl = array_flip($trans_tbl);
+        return strtr($string, $trans_tbl);
+    }
+
+    /**
+     *
+     * @param    mixed
+     */
+    function &_decode(&$soapval)
+    {
+        global $SOAP_OBJECT_STRUCT;
+        if (!$this->_isSoapValue($soapval)) {
+            return $soapval;
+        } elseif (is_array($soapval->value)) {
+            if ($SOAP_OBJECT_STRUCT && $soapval->type != 'Array') {
+                $classname = $this->_defaultObjectClassname;
+                if (isset($this->_type_translation[$soapval->tqn->fqn()])) {
+                    // This will force an error in php if the class
+                    // does not exist.
+                    $classname = $this->_type_translation[$soapval->tqn->fqn()];
+                } elseif (isset($this->_type_translation[$soapval->type])) {
+                    // This will force an error in php if the class
+                    // does not exist.
+                    $classname = $this->_type_translation[$soapval->type];
+                } elseif ($this->_auto_translation) {
+                    if (class_exists($soapval->type)) {
+                        $classname = $soapval->type;
+                    } elseif ($this->_wsdl) {
+                        $t = $this->_wsdl->getComplexTypeNameForElement($soapval->name, $soapval->namespace);
+                        if ($t && class_exists($t)) {
+                            $classname = $t;
+                        }
+                    }
+                }
+                $return =& new $classname;
+            } else {
+                $return = array();
+            }
+
+            $counter = 1;
+            $isstruct = !$SOAP_OBJECT_STRUCT || !is_array($return);
+            foreach ($soapval->value as $item) {
+                if (is_object($return)) {
+                    if ($this->_wsdl) {
+                        // Get this child's WSDL information.
+                        // /$soapval->ns/$soapval->type/$item->ns/$item->name
+                        $child_type = $this->_wsdl->getComplexTypeChildType(
+                                          $soapval->namespace,
+                                          $soapval->name,
+                                          $item->namespace,
+                                          $item->name);
+                        if ($child_type) {
+                            $item->type = $child_type;
+                        }
+                    }
+                    if (!$isstruct || $item->type == 'Array') {
+                        if (isset($return->{$item->name}) &&
+                            is_object($return->{$item->name})) {
+                            $return->{$item->name} =& $this->_decode($item);
+                        } elseif (isset($return->{$item->name}) &&
+                                  is_array($return->{$item->name})) {
+                            $return->{$item->name}[] =& $this->_decode($item);
+                        } elseif (is_array($return)) {
+                            $return[] =& $this->_decode($item);
+                        } else {
+                            $return->{$item->name} =& $this->_decode($item);
+                        }
+                    } elseif (isset($return->{$item->name})) {
+                        $isstruct = false;
+                        if (count(get_object_vars($return)) == 1) {
+                            $d =& $this->_decode($item);
+                            $return = array($return->{$item->name}, $d);
+                        } else {
+                            $d =& $this->_decode($item);
+                            $return->{$item->name} = array($return->{$item->name}, $d);
+                        }
+                    } else {
+                        $return->{$item->name} =& $this->_decode($item);
+                    }
+                    // Set the attributes as members in the class.
+                    if (method_exists($return, '__set_attribute')) {
+                        foreach ($soapval->attributes as $key => $value) {
+                            call_user_func_array(array(&$return, '__set_attribute'), array($key, $value));
+                        }
+                    }
+                } else {
+                    if ($soapval->arrayType && $this->_isSoapValue($item)) {
+                        if ($this->_isBase64Type($item->type) && !$this->_isBase64Type($soapval->arrayType)) {
+                            // Decode the value if we're losing the
+                            // base64 type information.
+                            $item->value = base64_decode($item->value);
+                        }
+                        $item->type = $soapval->arrayType;
+                    }
+                    if (!$isstruct) {
+                        $return[] =& $this->_decode($item);
+                    } elseif (isset($return[$item->name])) {
+                        $isstruct = false;
+                        $d =& $this->_decode($item);
+                        $return = array($return[$item->name], $d);
+                    } else {
+                        $return[$item->name] =& $this->_decode($item);
+                    }
+                }
+            }
+            return $return;
+        }
+
+        if ($soapval->type == 'boolean') {
+            if ($soapval->value != '0' && strcasecmp($soapval->value, 'false') != 0) {
+                $soapval->value = true;
+            } else {
+                $soapval->value = false;
+            }
+        } elseif ($soapval->type && isset($this->_typemap[SOAP_XML_SCHEMA_VERSION][$soapval->type])) {
+            // If we can, set variable type.
+            settype($soapval->value, $this->_typemap[SOAP_XML_SCHEMA_VERSION][$soapval->type]);
+        }
+
+        if ($this->_isBase64Type($soapval->type)) {
+            return base64_decode($soapval->value);
+        } else {
+            return $soapval->value;
+        }
+    }
+
+    /**
+     * Creates the soap envelope with the soap envelop data.
+     *
+     * @param string $payload       soap data (in xml)
+     * @return associative array (headers,body)
+     * @access private
+     */
+    function &_makeEnvelope(&$method, &$headers, $encoding = SOAP_DEFAULT_ENCODING, $options = array())
+    {
+        $smsg = $header_xml = $ns_string = '';
+
+        if ($headers) {
+            $c = count($headers);
+            for ($i = 0; $i < $c; $i++) {
+                $header_xml .= $headers[$i]->serialize($this);
+            }
+            $header_xml = "<SOAP-ENV:Header>\r\n$header_xml\r\n</SOAP-ENV:Header>\r\n";
+        }
+
+        if (!isset($options['input']) || $options['input'] == 'parse') {
+            if (is_array($method)) {
+                $c = count($method);
+                for ($i = 0; $i < $c; $i++) {
+                    $smsg .= $method[$i]->serialize($this);
+                }
+            } else {
+                $smsg =& $method->serialize($this);
+            }
+        } else {
+            $smsg =& $method;
+        }
+        $body = "<SOAP-ENV:Body>\r\n" . $smsg . "\r\n</SOAP-ENV:Body>\r\n";
+
+        foreach ($this->_namespaces as $k => $v) {
+            $ns_string .= " xmlns:$v=\"$k\"\r\n";
+        }
+        if ($this->_namespace) {
+            $ns_string .= " xmlns=\"{$this->_namespace}\"\r\n";
+        }
+
+        /* if use='literal', we do not put in the encodingStyle.  This is denoted by
+           $this->_section5 being false.
+           XXX use can be defined at a more granular level than we are dealing with
+           here, so this does not work for all services.
+        */
+        $xml = "<?xml version=\"1.0\" encoding=\"$encoding\"?>\r\n\r\n".
+            "<SOAP-ENV:Envelope $ns_string".
+            ($this->_section5 ? ' SOAP-ENV:encodingStyle="' . SOAP_SCHEMA_ENCODING . '"' : '').
+            ">\r\n".
+            "$header_xml$body</SOAP-ENV:Envelope>\r\n";
+
+        return $xml;
+    }
+
+    function &_makeMimeMessage(&$xml, $encoding = SOAP_DEFAULT_ENCODING)
+    {
+        global $SOAP_options;
+
+        if (!isset($SOAP_options['Mime'])) {
+            return $this->_raiseSoapFault('Mime is not installed');
+        }
+
+        // encode any attachments
+        // see http://www.w3.org/TR/SOAP-attachments
+        // now we have to mime encode the message
+        $params = array('content_type' => 'multipart/related; type=text/xml');
+        $msg =& new Mail_mimePart('', $params);
+        // add the xml part
+        $params['content_type'] = 'text/xml';
+        $params['charset'] = $encoding;
+        $params['encoding'] = 'base64';
+        $msg->addSubPart($xml, $params);
+
+        // add the attachements
+        $c = count($this->__attachments);
+        for ($i = 0; $i < $c; $i++) {
+            $attachment =& $this->__attachments[$i];
+            $msg->addSubPart($attachment['body'], $attachment);
+        }
+        return $msg->encode();
+    }
+
+    // XXX this needs to be used from the Transport system
+    function &_makeDIMEMessage(&$xml)
+    {
+        global $SOAP_options;
+
+        if (!isset($SOAP_options['DIME'])) {
+            return $this->_raiseSoapFault('DIME is not installed');
+        }
+
+        // encode any attachments
+        // see http://search.ietf.org/internet-drafts/draft-nielsen-dime-soap-00.txt
+        // now we have to DIME encode the message
+        $dime =& new Net_DIME_Message();
+        $msg =& $dime->encodeData($xml,SOAP_ENVELOP,null,NET_DIME_TYPE_URI);
+
+        // add the attachements
+        $c = count($this->__attachments);
+        for ($i = 0; $i < $c; $i++) {
+            $attachment =& $this->__attachments[$i];
+            $msg .= $dime->encodeData($attachment['body'], $attachment['content_type'], $attachment['cid'],NET_DIME_TYPE_MEDIA);
+        }
+        $msg .= $dime->endMessage();
+        return $msg;
+    }
+
+    function _decodeMimeMessage(&$data, &$headers, &$attachments)
+    {
+        global $SOAP_options;
+        if (!isset($SOAP_options['Mime'])) {
+            $this->_raiseSoapFault('Mime Unsupported, install PEAR::Mail::Mime', '', '', 'Server');
+            return;
+        }
+
+        $params['include_bodies'] = true;
+        $params['decode_bodies']  = true;
+        $params['decode_headers'] = true;
+
+        // XXX lame thing to have to do for decoding
+        $decoder =& new Mail_mimeDecode($data);
+        $structure = $decoder->decode($params);
+
+        if (isset($structure->body)) {
+            $data = $structure->body;
+            $headers = $structure->headers;
+            return;
+        } elseif (isset($structure->parts)) {
+            $data = $structure->parts[0]->body;
+            $headers = array_merge($structure->headers, $structure->parts[0]->headers);
+            if (count($structure->parts) > 1) {
+                $mime_parts = array_splice($structure->parts,1);
+                // prepare the parts for the soap parser
+
+                $c = count($mime_parts);
+                for ($i = 0; $i < $c; $i++) {
+                    $p =& $mime_parts[$i];
+                    if (isset($p->headers['content-location'])) {
+                        // XXX TODO: modify location per SwA note section 3
+                        // http://www.w3.org/TR/SOAP-attachments
+                        $attachments[$p->headers['content-location']] = $p->body;
+                    } else {
+                        $cid = 'cid:' . substr($p->headers['content-id'], 1, strlen($p->headers['content-id']) - 2);
+                        $attachments[$cid] = $p->body;
+                    }
+                }
+            }
+            return;
+        }
+        $this->_raiseSoapFault('Mime parsing error', '', '', 'Server');
+    }
+
+    function _decodeDIMEMessage(&$data, &$headers, &$attachments)
+    {
+        global $SOAP_options;
+        if (!isset($SOAP_options['DIME'])) {
+            $this->_raiseSoapFault('DIME Unsupported, install PEAR::Net::DIME', '', '', 'Server');
+            return;
+        }
+
+        // XXX this SHOULD be moved to the transport layer, e.g. PHP itself
+        // should handle parsing DIME ;)
+        $dime =& new Net_DIME_Message();
+        $err = $dime->decodeData($data);
+        if (PEAR::isError($err)) {
+            $this->_raiseSoapFault('Failed to decode the DIME message!', '', '', 'Server');
+            return;
+        }
+        if (strcasecmp($dime->parts[0]['type'], SOAP_ENVELOP) != 0) {
+            $this->_raiseSoapFault('DIME record 1 is not a SOAP envelop!', '', '', 'Server');
+            return;
+        }
+
+        $data = $dime->parts[0]['data'];
+        // fake it for now
+        $headers['content-type'] = 'text/xml';
+        $c = count($dime->parts);
+        for ($i = 0; $i < $c; $i++) {
+            $part =& $dime->parts[$i];
+            // XXX we need to handle URI's better.
+            $id = strncmp($part['id'], 'cid:', 4) ? 'cid:' . $part['id'] : $part['id'];
+            $attachments[$id] = $part['data'];
+        }
+    }
+
+    function __set_type_translation($type, $class = null)
+    {
+        $tq =& new QName($type);
+        if (!$class) {
+            $class = $tq->name;
+        }
+        $this->_type_translation[$type]=$class;
+    }
+
+}
+
+/**
+ * Class used to handle QNAME values in XML.
+ *
+ * @access   public
+ * @package  SOAP::Client
+ * @author   Shane Caraveo <shane at php.net> Conversion to PEAR and updates
+ */
+class QName
+{
+    var $name = '';
+    var $ns = '';
+    var $namespace='';
+
+    function QName($name, $namespace = '')
+    {
+        if ($name && $name[0] == '{') {
+            preg_match('/\{(.*?)\}(.*)/', $name, $m);
+            $this->name = $m[2];
+            $this->namespace = $m[1];
+        } elseif (substr_count($name, ':') == 1) {
+            $s = explode(':', $name);
+            $s = array_reverse($s);
+            $this->name = $s[0];
+            $this->ns = $s[1];
+            $this->namespace = $namespace;
+        } else {
+            $this->name = $name;
+            $this->namespace = $namespace;
+        }
+
+        // a little more magic than should be in a qname.
+        $p = strpos($this->name, '[');
+        if ($p) {
+            // XXX need to re-examine this logic later
+            // chop off []
+            $this->arraySize = explode(',', substr($this->name, $p + 1, strlen($this->name) - $p - 2));
+            $this->arrayInfo = substr($this->name, $p);
+            $this->name = substr($this->name, 0, $p);
+        }
+    }
+
+    function fqn()
+    {
+        if ($this->namespace) {
+            return '{' . $this->namespace . '}' . $this->name;
+        } elseif ($this->ns) {
+            return $this->ns . ':' . $this->name;
+        }
+        return $this->name;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Client.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Client.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Client.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,644 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: Client.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+require_once 'Services/PayPal/SOAP/Value.php';
+require_once 'Services/PayPal/SOAP/Base.php';
+require_once 'Services/PayPal/SOAP/Transport.php';
+require_once 'Services/PayPal/SOAP/WSDL.php';
+require_once 'Services/PayPal/SOAP/Fault.php';
+require_once 'Services/PayPal/SOAP/Parser.php';
+
+// Arnaud: the following code was taken from DataObject
+// and adapted to suit
+
+// this will be horrifically slow!!!!
+// NOTE: Overload SEGFAULTS ON PHP4 + Zend Optimizer
+// these two are BC/FC handlers for call in PHP4/5
+
+if (!class_exists('SOAP_Client_Overload')) {
+    if (substr(phpversion(), 0, 1) == 5) {
+        class SOAP_Client_Overload extends SOAP_Base
+        {
+            function __call($method, $args)
+            {
+                $return = null;
+                $this->_call($method, $args, $return);
+                return $return;
+            }
+        }
+    } else {
+        if (!function_exists('clone')) {
+            eval('function clone($t) { return $t; }');
+        }
+        eval('
+            class SOAP_Client_Overload extends SOAP_Base
+            {
+                function __call($method, $args, &$return)
+                {
+                    return $this->_call($method, $args, $return);
+                }
+            }');
+    }
+}
+
+/**
+ * SOAP Client Class
+ *
+ * This class is the main interface for making soap requests.
+ *
+ * basic usage:
+ *   $soapclient = new SOAP_Client( string path [ , boolean wsdl] );
+ *   echo $soapclient->call( string methodname [ , array parameters] );
+ *
+ * Originally based on SOAPx4 by Dietrich Ayala
+ * http://dietrich.ganx4.com/soapx4
+ *
+ * @access   public
+ * @package  SOAP::Client
+ * @author   Shane Caraveo <shane at php.net> Conversion to PEAR and updates
+ * @author   Stig Bakken <ssb at fast.no> Conversion to PEAR
+ * @author   Dietrich Ayala <dietrich at ganx4.com> Original Author
+ */
+class SOAP_Client extends SOAP_Client_Overload
+{
+    /**
+     * Communication endpoint.
+     *
+     * Currently the following transport formats are supported:
+     *  - HTTP
+     *  - SMTP
+     *
+     * Example endpoints:
+     *   http://www.example.com/soap/server.php
+     *   https://www.example.com/soap/server.php
+     *   mailto:soap at example.com
+     *
+     * @var  string
+     * @see  SOAP_Client()
+     */
+    var $_endpoint = '';
+
+    /**
+     * portname
+     *
+     * @var string contains the SOAP PORT name that is used by the client
+     */
+    var $_portName = '';
+
+    /**
+     * Endpoint type
+     *
+     * @var  string  e.g. wdsl
+     */
+    var $__endpointType = '';
+
+    /**
+     * wire
+     *
+     * @var  string  contains outoing and incoming data stream for debugging.
+     */
+    var $xml; // contains the received xml
+    var $wire;
+    var $__last_request = null;
+    var $__last_response = null;
+
+    /**
+     * Options
+     *
+     * @var array
+     */
+    var $__options = array('trace'=>0);
+
+    /**
+     * encoding
+     *
+     * @var  string  Contains the character encoding used for XML parser, etc.
+     */
+    var $_encoding = SOAP_DEFAULT_ENCODING;
+
+    /**
+     * headersOut
+     *
+     * @var  array  contains an array of SOAP_Headers that we are sending
+     */
+    var $headersOut = null;
+
+    /**
+     * headersOut
+     *
+     * @var  array  contains an array headers we recieved back in the response
+     */
+    var $headersIn = null;
+
+    /**
+     * __proxy_params
+     *
+     * @var  array  contains options for HTTP_Request class (see HTTP/Request.php)
+     */
+    var $__proxy_params = array();
+
+    var $_soap_transport = null;
+
+    /**
+     * SOAP_Client constructor
+     *
+     * @param string endpoint (URL)
+     * @param boolean wsdl (true if endpoint is a wsdl file)
+     * @param string portName
+     * @param array  contains options for HTTP_Request class (see HTTP/Request.php)
+     * @access public
+     */
+    function SOAP_Client($endpoint, $wsdl = false, $portName = false, $proxy_params=array())
+    {
+        parent::SOAP_Base('Client');
+        $this->_endpoint = $endpoint;
+        $this->_portName = $portName;
+        $this->__proxy_params = $proxy_params;
+
+        $wsdl = $wsdl ? $wsdl : strcasecmp('wsdl', substr($endpoint, strlen($endpoint) - 4)) == 0;
+
+        // make values
+        if ($wsdl) {
+            $this->__endpointType = 'wsdl';
+            // instantiate wsdl class
+            $this->_wsdl =& new SOAP_WSDL($this->_endpoint, $this->__proxy_params);
+            if ($this->_wsdl->fault) {
+                $this->_raiseSoapFault($this->_wsdl->fault);
+            }
+        }
+    }
+
+    function _reset()
+    {
+        $this->xml = null;
+        $this->wire = null;
+        $this->__last_request = null;
+        $this->__last_response = null;
+        $this->headersIn = null;
+        $this->headersOut = null;
+    }
+
+    /**
+     * setEncoding
+     *
+     * set the character encoding, limited to 'UTF-8', 'US_ASCII' and 'ISO-8859-1'
+     *
+     * @param string encoding
+     * @return mixed returns null or SOAP_Fault
+     * @access public
+     */
+    function setEncoding($encoding)
+    {
+        if (in_array($encoding, $this->_encodings)) {
+            $this->_encoding = $encoding;
+            return null;
+        }
+        return $this->_raiseSoapFault('Invalid Encoding');
+    }
+
+    /**
+     * addHeader
+     *
+     * To add headers to the envelop, you use this function, sending it a
+     * SOAP_Header class instance.
+     *
+     * @param SOAP_Header a soap value to send as a header
+     * @access public
+     */
+    function addHeader(&$soap_value)
+    {
+        # add a new header to the message
+        if (is_a($soap_value,'soap_header')) {
+            $this->headersOut[] =& $soap_value;
+        } else if (gettype($soap_value) == 'array') {
+            // name, value, namespace, mustunderstand, actor
+            $this->headersOut[] =& new SOAP_Header($soap_value[0], null, $soap_value[1], $soap_value[2], $soap_value[3]);;
+        } else {
+            $this->_raiseSoapFault("Don't understand the header info you provided.  Must be array or SOAP_Header.");
+        }
+    }
+
+    /**
+     * SOAP_Client::call
+     *
+     * the namespace parameter is overloaded to accept an array of
+     * options that can contain data necessary for various transports
+     * if it is used as an array, it MAY contain a namespace value and a
+     * soapaction value.  If it is overloaded, the soapaction parameter is
+     * ignored and MUST be placed in the options array.  This is done
+     * to provide backwards compatibility with current clients, but
+     * may be removed in the future.
+     *
+     * @param string method
+     * @param array  params
+     * @param array options (hash with namespace, soapaction, timeout, from, subject, etc.)
+     *
+     * The options parameter can have a variety of values added.  The currently supported
+     * values are:
+     *   namespace
+     *   soapaction
+     *   timeout (http socket timeout)
+     *   from (smtp)
+     *   transfer-encoding (smtp, sets the Content-Transfer-Encoding header)
+     *   subject (smtp, subject header)
+     *   headers (smtp, array-hash of extra smtp headers)
+     *
+     * @return array of results
+     * @access public
+     */
+    function &call($method, &$params, $namespace = false, $soapAction = false)
+    {
+        $this->headersIn = null;
+        $this->__last_request = null;
+        $this->__last_response = null;
+        $this->wire = null;
+        $this->xml = null;
+
+        $soap_data =& $this->__generate($method, $params, $namespace, $soapAction);
+        if (PEAR::isError($soap_data)) {
+            return $this->_raiseSoapFault($soap_data);
+        }
+
+        // __generate may have changed the endpoint if the wsdl has more
+        // than one service, so we need to see if we need to generate
+        // a new transport to hook to a different URI.  Since the transport
+        // protocol can also change, we need to get an entirely new object,
+        // though this could probably be optimized.
+        if (!$this->_soap_transport || $this->_endpoint != $this->_soap_transport->url) {
+            $this->_soap_transport =& SOAP_Transport::getTransport($this->_endpoint);
+            if (PEAR::isError($this->_soap_transport)) {
+                $fault =& $this->_soap_transport;
+                $this->_soap_transport = null;
+                return $this->_raiseSoapFault($fault);
+            }
+        }
+        $this->_soap_transport->encoding = $this->_encoding;
+
+        // Send the message.
+        $transport_options = array_merge_recursive($this->__proxy_params, $this->__options);
+        $this->xml =& $this->_soap_transport->send($soap_data, $transport_options);
+
+        // Save the wire information for debugging.
+        if ($this->__options['trace'] > 0) {
+            $this->__last_request =& $this->_soap_transport->outgoing_payload;
+            $this->__last_response =& $this->_soap_transport->incoming_payload;
+            $this->wire =& $this->__get_wire();
+        }
+        if ($this->_soap_transport->fault) {
+            return $this->_raiseSoapFault($this->xml);
+        }
+
+        $this->__attachments =& $this->_soap_transport->attachments;
+        $this->__result_encoding = $this->_soap_transport->result_encoding;
+
+        if (isset($this->__options['result']) && $this->__options['result'] != 'parse') {
+            return $this->xml;
+        }
+
+        return $this->__parse($this->xml, $this->__result_encoding, $this->__attachments);
+    }
+
+    /**
+     * Sets option to use with the transports layers.
+     *
+     * An example of such use is
+     * $soapclient->setOpt('curl', CURLOPT_VERBOSE, 1)
+     * to pass a specific option to when using an SSL connection.
+     *
+     * @access public
+     * @param  string  $category  category to which the option applies
+     * @param  string  $option    option name
+     * @param  string  $value     option value
+     * @return void
+     */
+    function setOpt($category, $option, $value = null)
+    {
+        if (!is_null($value)) {
+            if (!isset($this->__options[$category])) {
+                $this->__options[$category] = array();
+            }
+            $this->__options[$category][$option] = $value;
+        } else {
+            $this->__options[$category] = $option;
+        }
+    }
+
+    /**
+     * Overload extension support
+     * if the overload extension is loaded, you can call the client class
+     * with a soap method name
+     * $soap = new SOAP_Client(....);
+     * $value = $soap->getStockQuote('MSFT');
+     *
+     * @param string method
+     * @param array  args
+     * @param string retur_value
+     *
+     * @return boolean
+     * @access public
+     */
+    function _call($method, $args, &$return_value)
+    {
+        // XXX overloading lowercases the method name, we
+        // need to look into the wsdl and try to find
+        // the correct method name to get the correct
+        // case for the call.
+        if ($this->_wsdl) {
+            $this->_wsdl->matchMethod($method);
+        }
+
+        $return_value =& $this->call($method, $args);
+        return true;
+    }
+
+    function &__getlastrequest()
+    {
+        return $this->__last_request;
+    }
+
+    function &__getlastresponse()
+    {
+        return $this->__last_response;
+    }
+
+    function __use($use)
+    {
+        $this->__options['use'] = $use;
+    }
+
+    function __style($style)
+    {
+        $this->__options['style'] = $style;
+    }
+
+    function __trace($level)
+    {
+        $this->__options['trace'] = $level;
+    }
+
+    function &__generate($method, &$params, $namespace = false, $soapAction = false)
+    {
+        $this->fault = null;
+        $this->__options['input']='parse';
+        $this->__options['result']='parse';
+        $this->__options['parameters'] = false;
+        if ($params && gettype($params) != 'array') {
+            $params = array($params);
+        }
+        if (gettype($namespace) == 'array') {
+            foreach ($namespace as $optname => $opt) {
+                $this->__options[strtolower($optname)] = $opt;
+            }
+            if (isset($this->__options['namespace'])) {
+                $namespace = $this->__options['namespace'];
+            } else {
+                $namespace = false;
+            }
+        } else {
+            // we'll place soapaction into our array for usage in the transport
+            $this->__options['soapaction'] = $soapAction;
+            $this->__options['namespace'] = $namespace;
+        }
+
+        if ($this->__endpointType == 'wsdl') {
+            $this->_setSchemaVersion($this->_wsdl->xsd);
+            // get portName
+            if (!$this->_portName) {
+                $this->_portName = $this->_wsdl->getPortName($method);
+            }
+            if (PEAR::isError($this->_portName)) {
+                return $this->_raiseSoapFault($this->_portName);
+            }
+
+            // get endpoint
+            $this->_endpoint = $this->_wsdl->getEndpoint($this->_portName);
+            if (PEAR::isError($this->_endpoint)) {
+                return $this->_raiseSoapFault($this->_endpoint);
+            }
+
+            // get operation data
+            $opData = $this->_wsdl->getOperationData($this->_portName, $method);
+
+            if (PEAR::isError($opData)) {
+                return $this->_raiseSoapFault($opData);
+            }
+            $namespace = $opData['namespace'];
+            $this->__options['style'] = $opData['style'];
+            $this->__options['use'] = $opData['input']['use'];
+            $this->__options['soapaction'] = $opData['soapAction'];
+
+            // set input params
+            if ($this->__options['input'] == 'parse') {
+                $this->__options['parameters'] = $opData['parameters'];
+                $nparams = array();
+                if (isset($opData['input']['parts']) && count($opData['input']['parts']) > 0) {
+                    $i = 0;
+                    reset($params);
+                    foreach ($opData['input']['parts'] as $name => $part) {
+                        $xmlns = '';
+                        $attrs = array();
+                        // is the name actually a complex type?
+                        if (isset($part['element'])) {
+                            $xmlns = $this->_wsdl->namespaces[$part['namespace']];
+                            $part = $this->_wsdl->elements[$part['namespace']][$part['type']];
+                            $name = $part['name'];
+                        }
+                        if (array_key_exists($name, $params) ||
+                            $this->_wsdl->getDataHandler($name, $part['namespace'])) {
+                            $nparams[$name] =& $params[$name];
+                        } else {
+                            // we now force an associative array for
+                            // parameters if using wsdl.
+                            return $this->_raiseSoapFault("The named parameter $name is not in the call parameters.");
+                        }
+                        if (gettype($nparams[$name]) != 'object' ||
+                            !is_a($nparams[$name],'soap_value')) {
+                            // type is a qname likely, split it apart, and get the type namespace from wsdl
+                            $qname =& new QName($part['type']);
+                            if ($qname->ns) {
+                                $type_namespace = $this->_wsdl->namespaces[$qname->ns];
+                            } else if (isset($part['namespace'])) {
+                                $type_namespace = $this->_wsdl->namespaces[$part['namespace']];
+                            } else {
+                                $type_namespace = null;
+                            }
+                            $qname->namespace = $type_namespace;
+                            $type = $qname->name;
+                            $pqname = $name;
+                            if ($xmlns) {
+                                $pqname = '{' . $xmlns . '}' . $name;
+                            }
+                            $nparams[$name] =& new SOAP_Value($pqname, $qname->fqn(), $nparams[$name], $attrs);
+                        } else {
+                            // wsdl fixups to the soap value.
+                        }
+                    }
+                }
+                $params =& $nparams;
+                unset($nparams);
+            }
+        } else {
+            $this->_setSchemaVersion(SOAP_XML_SCHEMA_VERSION);
+        }
+
+        // serialize the message.
+        $this->_section5 = (isset($this->__options['use']) && $this->__options['use'] == 'literal');
+
+        if (!isset($this->__options['style']) || $this->__options['style'] == 'rpc') {
+            $this->__options['style'] = 'rpc';
+            $this->docparams = true;
+            $mqname =& new QName($method, $namespace);
+            $methodValue =& new SOAP_Value($mqname->fqn(), 'Struct', $params);
+            $soap_msg =& $this->_makeEnvelope($methodValue, $this->headersOut, $this->_encoding, $this->__options);
+        } else {
+            if (!$params) {
+                $mqname =& new QName($method, $namespace);
+                $mynull = null;
+                $params =& new SOAP_Value($mqname->fqn(), 'Struct', $mynull);
+            } elseif ($this->__options['input'] == 'parse') {
+                if (is_array($params)) {
+                    $nparams = array();
+                    $keys = array_keys($params);
+                    foreach ($keys as $k) {
+                        if (gettype($params[$k]) != 'object') {
+                            $nparams[] =& new SOAP_Value($k, false, $params[$k]);
+                        } else {
+                            $nparams[] =& $params[$k];
+                        }
+                    }
+                    $params =& $nparams;
+                }
+                if ($this->__options['parameters']) {
+                    $mqname =& new QName($method, $namespace);
+                    $params =& new SOAP_Value($mqname->fqn(), 'Struct', $params);
+                }
+            }
+            $soap_msg =& $this->_makeEnvelope($params, $this->headersOut, $this->_encoding, $this->__options);
+        }
+        unset($this->headersOut);
+
+        if (PEAR::isError($soap_msg)) {
+            return $this->_raiseSoapFault($soap_msg);
+        }
+
+        // handle Mime or DIME encoding
+        // XXX DIME Encoding should move to the transport, do it here for now
+        // and for ease of getting it done
+        if (count($this->__attachments)) {
+            if ((isset($this->__options['attachments']) && $this->__options['attachments'] == 'Mime') || isset($this->__options['Mime'])) {
+                $soap_msg =& $this->_makeMimeMessage($soap_msg, $this->_encoding);
+            } else {
+                // default is dime
+                $soap_msg =& $this->_makeDIMEMessage($soap_msg, $this->_encoding);
+                $this->__options['headers']['Content-Type'] = 'application/dime';
+            }
+            if (PEAR::isError($soap_msg)) {
+                return $this->_raiseSoapFault($soap_msg);
+            }
+        }
+
+        // instantiate client
+        if (is_array($soap_msg)) {
+            $soap_data =& $soap_msg['body'];
+            if (count($soap_msg['headers'])) {
+                if (isset($this->__options['headers'])) {
+                    $this->__options['headers'] = array_merge($this->__options['headers'], $soap_msg['headers']);
+                } else {
+                    $this->__options['headers'] = $soap_msg['headers'];
+                }
+            }
+        } else {
+            $soap_data =& $soap_msg;
+        }
+        return $soap_data;
+    }
+
+    function &__parse(&$response, $encoding, &$attachments)
+    {
+        // parse the response
+        $response =& new SOAP_Parser($response, $encoding, $attachments);
+        if ($response->fault) {
+            return $this->_raiseSoapFault($response->fault);
+        }
+        // return array of parameters
+        $return =& $response->getResponse();
+        $headers =& $response->getHeaders();
+        if ($headers) {
+            $this->headersIn =& $this->__decodeResponse($headers, false);
+        }
+        return $this->__decodeResponse($return);
+    }
+
+    function &__decodeResponse(&$response, $shift = true)
+    {
+        if (!$response) {
+            return null;
+        }
+        // Check for valid response.
+        if (PEAR::isError($response)) {
+            return $this->_raiseSoapFault($response);
+        } elseif (!is_a($response, 'soap_value')) {
+            return $this->_raiseSoapFault("didn't get SOAP_Value object back from client");
+        }
+
+        // Decode to native php datatype.
+        $returnArray =& $this->_decode($response);
+
+        // Fault?
+        if (PEAR::isError($returnArray)) {
+            return $this->_raiseSoapFault($returnArray);
+        }
+        if (is_object($returnArray) && strcasecmp(get_class($returnArray),'stdClass') == 0) {
+            $returnArray = get_object_vars($returnArray);
+        }
+        if (is_array($returnArray)) {
+            if (isset($returnArray['faultcode']) || isset($returnArray['SOAP-ENV:faultcode'])) {
+                $faultcode = $faultstring = $faultdetail = $faultactor = '';
+                foreach ($returnArray as $k => $v) {
+                    if (stristr($k, 'faultcode')) $faultcode = $v;
+                    if (stristr($k, 'faultstring')) $faultstring = $v;
+                    if (stristr($k, 'detail')) $faultdetail = $v;
+                    if (stristr($k, 'faultactor')) $faultactor = $v;
+                }
+                return $this->_raiseSoapFault($faultstring, $faultdetail, $faultactor, $faultcode);
+            }
+            // Return array of return values.
+            if ($shift && count($returnArray) == 1) {
+                return array_shift($returnArray);
+            }
+            return $returnArray;
+        }
+        return $returnArray;
+    }
+
+    function __get_wire()
+    {
+        if ($this->__options['trace'] > 0 && ($this->__last_request || $this->__last_response)) {
+            return "OUTGOING:\n\n".
+            $this->__last_request.
+            "\n\nINCOMING\n\n".
+            preg_replace("/></",">\r\n<", $this->__last_response);
+        }
+        return null;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Disco.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Disco.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Disco.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,364 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Author: Dmitri Vinogradov <dimitri at vinogradov.de>                    |
+// +----------------------------------------------------------------------+
+//
+// $Id: Disco.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+
+require_once 'Services/PayPal/SOAP/Base.php';
+
+class SOAP_DISCO_Server extends SOAP_Base_Object
+{
+    var $namespaces     = array(SCHEMA_WSDL => 'wsdl', SCHEMA_SOAP => 'soap');
+    var $import_ns      = array();
+    var $wsdl           = '';
+    var $disco          = '';
+    var $_wsdl          = array();
+    var $_disco         = array();
+    var $_service_name  = '';
+    var $_service_ns    = '';
+    var $_service_desc  = '';
+    var $_portname      = '';
+    var $_bindingname   = '';
+    var $soap_server    = NULL;
+
+
+    function SOAP_DISCO_Server($soap_server, $service_name, $service_desc = '', $import_ns = null)
+    {
+        parent::SOAP_Base_Object('Server');
+
+        if ( !is_object($soap_server)
+            || !get_class($soap_server) == 'soap_server') return;
+
+        $this->_service_name = $service_name;
+        $this->_service_ns = "urn:$service_name";
+        $this->_service_desc = $service_desc;
+        $this->import_ns = isset($import_ns) ? $import_ns : $this->import_ns;
+        $this->soap_server = $soap_server;
+        $this->host = isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:'localhost';
+    }
+
+    function getDISCO()
+    {
+        $this->_generate_DISCO();
+        return $this->disco;
+    }
+
+    function getWSDL()
+    {
+        $this->_generate_WSDL();
+        return $this->wsdl;
+    }
+
+    function _generate_DISCO()
+    {
+        # DISCO
+        $this->_disco['disco:discovery']['attr']['xmlns:disco'] = SCHEMA_DISCO;
+        $this->_disco['disco:discovery']['attr']['xmlns:scl'] = SCHEMA_DISCO_SCL;
+        $this->_disco['disco:discovery']['scl:contractRef']['attr']['ref'] =
+                                    (array_key_exists('HTTPS',$_SERVER) && $_SERVER['HTTPS']=='on')
+                                    ? 'https://' . $this->host . $_SERVER['PHP_SELF'] . '?wsdl'
+                                    : 'http://'  . $this->host . $_SERVER['PHP_SELF'] . '?wsdl';
+
+        # generate disco xml
+        $this->_generate_DISCO_XML($this->_disco);
+    }
+
+    function _generate_WSDL()
+    {
+        # WSDL
+        if (is_array($this->soap_server->_namespaces)) {
+            # need to get: typens, xsd & SOAP-ENC
+            $flipped = array_flip($this->soap_server->_namespaces);
+            $this->namespaces[$this->_service_ns] = 'tns';
+            $this->namespaces[$flipped['xsd']] = 'xsd';
+            $this->namespaces[$flipped['SOAP-ENC']] = 'SOAP-ENC';
+        }
+
+        # DEFINITIONS
+        $this->_wsdl['definitions']['attr']['name'] = $this->_service_name;
+        $this->_wsdl['definitions']['attr']['targetNamespace'] = $this->_service_ns;
+        foreach ($this->namespaces as $ns => $prefix) {
+            $this->_wsdl['definitions']['attr']['xmlns:' . $prefix] = $ns;
+        }
+        $this->_wsdl['definitions']['attr']['xmlns'] = SCHEMA_WSDL;
+
+        # import namespaces
+        # seems to not work yet: wsdl.exe fom .NET cant handle imported complete wsdl-definitions
+        #
+        if (count($this->import_ns)>0) {
+            $i = 0;
+            foreach ($this->import_ns as $_ns => $_location) {
+                $this->_wsdl['definitions']['import'][$i]['attr']['location'] = $_location;
+                $this->_wsdl['definitions']['import'][$i]['attr']['namespace'] = $_ns;
+                $i++;
+            }
+        }
+        $this->_wsdl['definitions']['types']['attr']['xmlns']='http://schemas.xmlsoap.org/wsdl/';
+        $this->_wsdl['definitions']['types']['schema']=array();
+        # PORTTYPE-NAME
+        $this->_portname = $this->_service_name . 'Port';
+        $this->_wsdl['definitions']['portType']['attr']['name'] = $this->_portname;
+
+        # BINDING-NAME
+        $this->_bindingname = $this->_service_name . 'Binding';
+        $this->_wsdl['definitions']['binding']['attr']['name'] = $this->_bindingname;
+        $this->_wsdl['definitions']['binding']['attr']['type'] = 'tns:' . $this->_portname;
+        $this->_wsdl['definitions']['binding']['soap:binding']['attr']['style'] = 'rpc';
+        $this->_wsdl['definitions']['binding']['soap:binding']['attr']['transport'] = SCHEMA_SOAP_HTTP;
+
+        # SERVICE
+        $this->_wsdl['definitions']['service']['attr']['name'] = $this->_service_name . 'Service';
+        $this->_wsdl['definitions']['service']['documentation']['attr'] = '';
+        $this->_wsdl['definitions']['service']['documentation'] = htmlentities($this->_service_desc);
+        $this->_wsdl['definitions']['service']['port']['attr']['name'] = $this->_portname;
+        $this->_wsdl['definitions']['service']['port']['attr']['binding'] = 'tns:' . $this->_bindingname;
+        $this->_wsdl['definitions']['service']['port']['soap:address']['attr']['location'] =
+                                    (array_key_exists('HTTPS',$_SERVER) && $_SERVER['HTTPS']=='on')
+                                    ? 'https://' . $this->host . $_SERVER['PHP_SELF']
+                                    : 'http://'  . $this->host . $_SERVER['PHP_SELF'];
+
+        #
+        $dispatch_keys = array_keys($this->soap_server->dispatch_objects);
+        $dc = count($dispatch_keys);
+        for ($di=0; $di < $dc; $di++) {
+            $namespace = $dispatch_keys[$di];
+            $namespace_objects =& $this->soap_server->dispatch_objects[$namespace];
+            $oc = count($namespace_objects);
+            for ($oi = 0; $oi < $oc; $oi++) {
+                $object = $namespace_objects[$oi];
+                # types definitions
+                $this->addSchemaFromMap($object->__typedef);
+                # MESSAGES
+                $this->addMethodsFromMap($object->__dispatch_map,$namespace,get_class($object));
+            }
+        }
+        if (isset($server->dispatch_map))
+            $this->addMethodsFromMap($server->dispatch_map,$namespace);
+
+
+        # generate wsdl
+        $this->_generate_WSDL_XML($this->_wsdl);
+    }
+
+    function &_getSchema($namespace) {
+        # SCHEMA
+        $c = count($this->_wsdl['definitions']['types']['schema']);
+        for($i = 0; $i < $c; $i++) {
+            if ($this->_wsdl['definitions']['types']['schema'][$i]['attr']['targetNamespace'] == $namespace)
+                return $this->_wsdl['definitions']['types']['schema'][$i];
+        }
+        # don't have this namespace
+        $schema = array();
+        $schema['attr'] = array();
+        $schema['complexType'] = array();
+        $schema['attr']['xmlns'] = array_search('xsd',$this->namespaces);
+        $schema['attr']['targetNamespace'] = $namespace;
+        $this->_wsdl['definitions']['types']['schema'][] =& $schema;
+        return $schema;
+    }
+
+    function addSchemaFromMap(&$map) {
+        if (!$map) return;
+        foreach ($map as $_type_name => $_type_def) {
+            list($typens,$type) = $this->_getTypeNs($_type_name);
+            if ($typens == 'xsd') {
+                // cannot add to xsd, lets use method_namespace
+                $typens = 'tns';
+            }
+            $schema =& $this->_getSchema(array_search($typens,$this->namespaces));
+            if (!$this->_ifComplexTypeExists($schema['complexType'], $type)) {
+                $ctype =& $schema['complexType'][];
+                $ctype['attr']['name'] = $type;
+                foreach ($_type_def as $_varname => $_vartype) {
+                    if (!is_int($_varname)) {
+                        list($_vartypens,$_vartype) = $this->_getTypeNs($_vartype);
+                        $ctype['all']['attr'] = '';
+                        $el =& $ctype['all']['element'][];
+                        $el['attr']['name'] = $_varname;
+                        $el['attr']['type'] = $_vartypens . ':' . $_vartype;
+                    } else {
+                        $ctype['complexContent']['attr'] = '';
+                        $ctype['complexContent']['restriction']['attr']['base'] = 'SOAP-ENC:Array';
+                        foreach ($_vartype as $array_var => $array_type) {
+                            list($_vartypens,$_vartype) = $this->_getTypeNs($array_type);
+                            $ctype['complexContent']['restriction']['attribute']['attr']['ref'] = 'SOAP-ENC:arrayType';
+                            $ctype['complexContent']['restriction']['attribute']['attr']['wsdl:arrayType'] = $_vartypens . ':' . $_vartype . '[]';
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    function addMethodsFromMap(&$map, $namespace, $classname = null)
+    {
+        if (!$map) {
+            return;
+        }
+
+        foreach ($map as $method_name => $method_types) {
+            if (array_key_exists('namespace',$method_types)) {
+                $method_namespace = $method_types['namespace'];
+            } else {
+                $method_namespace = $namespace;
+            }
+            # INPUT
+            if (isset($method_types['in']) && is_array($method_types['in'])) {
+                $input_message =& $this->_wsdl['definitions']['message'][];
+                $input_message['attr']['name'] = $method_name . 'Request';
+                foreach ($method_types['in'] as $name => $type) {
+                    list($typens,$type) = $this->_getTypeNs($type);
+                    $part =& $input_message['part'][];
+                    $part['attr']['name'] = $name;
+                    $part['attr']['type'] = $typens . ':' . $type;
+                }
+            }
+
+            # OUTPUT
+            if (isset($method_types['out']) && is_array($method_types['out'])) {
+                $output_message =& $this->_wsdl['definitions']['message'][];
+                $output_message['attr']['name'] = $method_name . 'Response';
+                foreach ($method_types['out'] as $name => $type) {
+                    list($typens,$type) = $this->_getTypeNs($type);
+                    $part =& $output_message['part'][];
+                    $part['attr']['name'] = $name;
+                    $part['attr']['type'] = $typens . ':' . $type;
+                }
+            }
+
+            # PORTTYPES
+            $operation =& $this->_wsdl['definitions']['portType']['operation'][];
+
+            $operation['attr']['name'] = $method_name;
+
+            # INPUT
+            $operation['input']['attr']['message'] = 'tns:'
+                            . $input_message['attr']['name'];
+
+            # OUTPUT
+            $operation['output']['attr']['message'] = 'tns:'
+                            . $output_message['attr']['name'];
+
+            # BINDING
+            $binding =& $this->_wsdl['definitions']['binding']['operation'][];
+            $binding['attr']['name'] = $method_name;
+            $action = $method_namespace . '#' . ($classname?$classname . '#':'') . $method_name;
+            $binding['soap:operation']['attr']['soapAction'] = $action;
+
+            # INPUT
+            $binding['input']['attr'] = '';
+            $binding['input']['soap:body']['attr']['use'] = 'encoded';
+            $binding['input']['soap:body']['attr']['namespace'] = $method_namespace;
+            $binding['input']['soap:body']['attr']['encodingStyle'] = SOAP_SCHEMA_ENCODING;
+
+            # OUTPUT
+            $binding['output']['attr'] = '';
+            $binding['output']['soap:body']['attr']['use'] = 'encoded';
+            $binding['output']['soap:body']['attr']['namespace'] = $method_namespace;
+            $binding['output']['soap:body']['attr']['encodingStyle'] = SOAP_SCHEMA_ENCODING;
+        }
+    }
+
+    function _generate_DISCO_XML($disco_array) {
+        $disco = '<?xml version="1.0"?>';
+        foreach ($disco_array as $key => $val) {
+            $disco .= $this->_arrayToNode($key,$val);
+        }
+        $this->disco = $disco;
+    }
+
+    function _generate_WSDL_XML($wsdl_array) {
+        $wsdl = '<?xml version="1.0"?>';
+        foreach ($wsdl_array as $key => $val) {
+            $wsdl .= $this->_arrayToNode($key,$val);
+        }
+        $this->wsdl = $wsdl;
+    }
+
+    function _arrayToNode($node_name = '', $array) {
+        $return = '';
+        if (is_array($array)) {
+            # we have a node if there's key 'attr'
+            if (array_key_exists('attr',$array)) {
+                $return .= "<$node_name";
+                if (is_array($array['attr'])) {
+                    foreach ($array['attr'] as $attr_name => $attr_value) {
+                        $return .= " $attr_name=\"$attr_value\"";
+                    }
+                }
+
+                # unset 'attr' and proceed other childs...
+                unset($array['attr']);
+
+                if (count($array) > 0) {
+                    $i = 0;
+                    foreach ($array as $child_node_name => $child_node_value) {
+                        $return .= $i == 0 ? ">\n" : '';
+                        $return .= $this->_arrayToNode($child_node_name,$child_node_value);
+                        $i++;
+                    }
+                    $return .= "</$node_name>\n";
+                } else {
+                    $return .= " />\n";
+                }
+            } else {
+                # we have no 'attr' key in array - so it's list of nodes with the same name ...
+                foreach ($array as $child_node_name => $child_node_value) {
+                    $return .= $this->_arrayToNode($node_name,$child_node_value);
+                }
+            }
+        } else {
+            # $array is not an array
+            if ($array !='') {
+                # and its not empty
+                $return .= "<$node_name>$array</$node_name>\n";
+            } else {
+                # and its empty...
+                $return .= "<$node_name />\n";
+            }
+        }
+        return $return;
+    }
+
+    function _getTypeNs($type) {
+        preg_match_all("'\{(.*)\}'sm",$type,$m);
+        if (isset($m[1][0]) && $m[1][0] != '') {
+            if (!array_key_exists($m[1][0],$this->namespaces)) {
+                $ns_pref = 'ns' . count($this->namespaces);
+                $this->namespaces[$m[1][0]] = $ns_pref;
+                $this->_wsdl['definitions']['attr']['xmlns:' . $ns_pref] = $m[1][0];
+            }
+            $typens = $this->namespaces[$m[1][0]];
+            $type = ereg_replace($m[0][0],'',$type);
+        } else {
+            $typens = 'xsd';
+        }
+        return array($typens,$type);
+    }
+
+    function _ifComplexTypeExists($typesArray, $type_name) {
+        if (is_array($typesArray)) {
+            foreach ($typesArray as $index => $type_data) {
+                if ($typesArray[$index]['attr']['name'] == $type_name) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Fault.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Fault.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Fault.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,132 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: Fault.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+require_once('PEAR.php');
+
+/**
+ * SOAP_Fault
+ * PEAR::Error wrapper used to match SOAP Faults to PEAR Errors
+ *
+ * @package  SOAP
+ * @access   public
+ * @author   Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more
+ * @author   Dietrich Ayala <dietrich at ganx4.com> Original Author
+ */
+class SOAP_Fault extends PEAR_Error
+{
+    
+    /**
+     * Constructor
+     * 
+     * @param    string  message string for fault
+     * @param    mixed   the faultcode
+     * @param    mixed   see PEAR::ERROR 
+     * @param    mixed   see PEAR::ERROR 
+     * @param    array   the userinfo array is used to pass in the
+     *                   SOAP actor and detail for the fault
+     */
+    function SOAP_Fault($faultstring = 'unknown error', $faultcode = 'Client', $faultactor=NULL, $detail=NULL, $mode = null, $options = null)
+    {
+        parent::PEAR_Error($faultstring, $faultcode, $mode, $options, $detail);
+        if ($faultactor) $this->error_message_prefix = $faultactor;
+    }
+    
+    /**
+     * message
+     *
+     * returns a SOAP_Message class that can be sent as a server response
+     *
+     * @return SOAP_Message 
+     * @access public
+     */
+    function message()
+    {
+        $msg =& new SOAP_Base();
+        $params = array();
+        $params[] =& new SOAP_Value('faultcode', 'QName', 'SOAP-ENV:'.$this->code);
+        $params[] =& new SOAP_Value('faultstring', 'string', $this->message);
+        $params[] =& new SOAP_Value('faultactor', 'anyURI', $this->error_message_prefix);
+        if (isset($this->backtrace)) {
+            $params[] =& new SOAP_Value('detail', 'string', $this->backtrace);
+        } else {
+            $params[] =& new SOAP_Value('detail', 'string', $this->userinfo);
+        }
+        
+        $methodValue =& new SOAP_Value('{'.SOAP_ENVELOP.'}Fault', 'Struct', $params);
+        $headers = NULL;
+        return $msg->_makeEnvelope($methodValue, $headers);
+    }
+    
+    /**
+     * getFault
+     *
+     * returns a simple native php array containing the fault data
+     *
+     * @return array 
+     * @access public
+     */
+    function getFault()
+    {
+        global $SOAP_OBJECT_STRUCT;
+        if ($SOAP_OBJECT_STRUCT) {
+            $fault =& new stdClass();
+            $fault->faultcode = $this->code;
+            $fault->faultstring = $this->message;
+            $fault->faultactor = $this->error_message_prefix;
+            $fault->detail = $this->userinfo;
+            return $fault;
+        }
+        return array(
+                'faultcode' => $this->code,
+                'faultstring' => $this->message,
+                'faultactor' => $this->error_message_prefix,
+                'detail' => $this->userinfo
+            );
+    }
+    
+    /**
+     * getActor
+     *
+     * returns the SOAP actor for the fault
+     *
+     * @return string 
+     * @access public
+     */
+    function getActor()
+    {
+        return $this->error_message_prefix;
+    }
+    
+    /**
+     * getDetail
+     *
+     * returns the fault detail
+     *
+     * @return string 
+     * @access public
+     */
+    function getDetail()
+    {
+        return $this->userinfo;
+    }
+    
+}
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Parser.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Parser.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Parser.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,515 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: Parser.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+require_once 'Services/PayPal/SOAP/Base.php';
+require_once 'Services/PayPal/SOAP/Value.php';
+
+/**
+ * SOAP Parser
+ *
+ * This class is used by SOAP::Message and SOAP::Server to parse soap
+ * packets. Originally based on SOAPx4 by Dietrich Ayala
+ * http://dietrich.ganx4.com/soapx4
+ *
+ * @access public
+ * @package SOAP::Parser
+ * @author Shane Caraveo <shane at php.net> Conversion to PEAR and updates
+ * @author Dietrich Ayala <dietrich at ganx4.com> Original Author
+ */
+class SOAP_Parser extends SOAP_Base
+{
+    var $status = '';
+    var $position = 0;
+    var $pos_stat = 0;
+    var $depth = 0;
+    var $default_namespace = '';
+    var $message = array();
+    var $depth_array = array();
+    var $previous_element = '';
+    var $soapresponse = null;
+    var $soapheaders = null;
+    var $parent = 0;
+    var $root_struct_name = array();
+    var $header_struct_name = array();
+    var $curent_root_struct_name = '';
+    var $entities = array ( '&' => '&amp;', '<' => '&lt;', '>' => '&gt;', "'" => '&apos;', '"' => '&quot;' );
+    var $root_struct = array();
+    var $header_struct = array();
+    var $curent_root_struct = 0;
+    var $references = array();
+    var $need_references = array();
+    var $XMLSchemaVersion;
+    var $bodyDepth; // used to handle non-root elements before root body element
+
+    /**
+     * SOAP_Parser constructor
+     *
+     * @param string xml content
+     * @param string xml character encoding, defaults to 'UTF-8'
+     */
+    function SOAP_Parser(&$xml, $encoding = SOAP_DEFAULT_ENCODING, $attachments = null)
+    {
+        parent::SOAP_Base('Parser');
+        $this->_setSchemaVersion(SOAP_XML_SCHEMA_VERSION);
+
+        $this->attachments = $attachments;
+
+        // Check the xml tag for encoding.
+        if (preg_match('/<\?xml[^>]+encoding\s*?=\s*?(\'([^\']*)\'|"([^"]*)")[^>]*?[\?]>/', $xml, $m)) {
+            $encoding = strtoupper($m[2] ? $m[2] : $m[3]);
+        }
+
+        // Determines where in the message we are
+        // (envelope,header,body,method). Check whether content has
+        // been read.
+        if (!empty($xml)) {
+            // Prepare the xml parser.
+            $parser = xml_parser_create($encoding);
+            xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
+            xml_set_object($parser, $this);
+            xml_set_element_handler($parser, 'startElement', 'endElement');
+            xml_set_character_data_handler($parser, 'characterData');
+
+            // Some lame soap implementations add null bytes at the
+            // end of the soap stream, and expat choaks on that.
+            if ($xml[strlen($xml) - 1] == 0) {
+                $xml = trim($xml);
+            }
+
+            // Parse the XML file.
+            if (!xml_parse($parser, $xml, true)) {
+                $err = sprintf('XML error on line %d col %d byte %d %s',
+                    xml_get_current_line_number($parser),
+                    xml_get_current_column_number($parser),
+                    xml_get_current_byte_index($parser),
+                    xml_error_string(xml_get_error_code($parser)));
+                $this->_raiseSoapFault($err,htmlspecialchars($xml));
+            }
+            xml_parser_free($parser);
+        }
+    }
+
+
+    /**
+     * domulti
+     * recurse to build a multi-dim array, used by buildResponse
+     *
+     * @access private
+     */
+    function domulti($d, &$ar, &$r, &$v, $ad=0)
+    {
+        if ($d) {
+            $this->domulti($d-1, $ar, $r[$ar[$ad]], $v, $ad+1);
+        } else {
+            $r = $v;
+        }
+    }
+
+    /**
+     * buildResponse
+     * loop through msg, building response structures
+     *
+     * @param int position
+     * @return SOAP_Value
+     * @access private
+     */
+    function &buildResponse($pos)
+    {
+        $response = null;
+
+        if (isset($this->message[$pos]['children'])) {
+            $children = explode('|', $this->message[$pos]['children']);
+
+            foreach ($children as $c => $child_pos) {
+                if ($this->message[$child_pos]['type'] != null) {
+                    $response[] =& $this->buildResponse($child_pos);
+                }
+            }
+            if (array_key_exists('arraySize', $this->message[$pos])) {
+                $ardepth = count($this->message[$pos]['arraySize']);
+                if ($ardepth > 1) {
+                    $ar = array_pad(array(), $ardepth, 0);
+                    if (array_key_exists('arrayOffset', $this->message[$pos])) {
+                        for ($i = 0; $i < $ardepth; $i++) {
+                            $ar[$i] += $this->message[$pos]['arrayOffset'][$i];
+                        }
+                    }
+                    $elc = count($response);
+                    for ($i = 0; $i < $elc; $i++) {
+                        // recurse to build a multi-dimensional array
+                        $this->domulti($ardepth, $ar, $newresp, $response[$i]);
+
+                        // increment our array pointers
+                        $ad = $ardepth - 1;
+                        $ar[$ad]++;
+                        while ($ad > 0 && $ar[$ad] >= $this->message[$pos]['arraySize'][$ad]) {
+                            $ar[$ad] = 0;
+                            $ad--;
+                            $ar[$ad]++;
+                        }
+                    }
+                    $response = $newresp;
+                } elseif (isset($this->message[$pos]['arrayOffset']) &&
+                          $this->message[$pos]['arrayOffset'][0] > 0) {
+                    // check for padding
+                    $pad = $this->message[$pos]['arrayOffset'][0] + count($response) * -1;
+                    $response = array_pad($response, $pad, null);
+                }
+            }
+        }
+
+        // Build attributes.
+        $attrs = array();
+        foreach ($this->message[$pos]['attrs'] as $atn => $atv) {
+            if (!strstr($atn, 'xmlns') &&
+                !strpos($atn, ':')) {
+                $attrs[$atn] = $atv;
+            }
+        }
+
+        // Add current node's value.
+        if ($response) {
+            $nqn =& new Qname($this->message[$pos]['name'], $this->message[$pos]['namespace']);
+            $tqn =& new Qname($this->message[$pos]['type'], $this->message[$pos]['type_namespace']);
+            $response =& new SOAP_Value($nqn->fqn(), $tqn->fqn(), $response, $attrs);
+            if (isset($this->message[$pos]['arrayType'])) {
+                $response->arrayType = $this->message[$pos]['arrayType'];
+            }
+        } else {
+            $nqn =& new Qname($this->message[$pos]['name'], $this->message[$pos]['namespace']);
+            $tqn =& new Qname($this->message[$pos]['type'], $this->message[$pos]['type_namespace']);
+            $response =& new SOAP_Value($nqn->fqn(), $tqn->fqn(), $this->message[$pos]['cdata'], $attrs);
+        }
+
+        // handle header attribute that we need
+        if (array_key_exists('actor', $this->message[$pos])) {
+            $response->actor = $this->message[$pos]['actor'];
+        }
+        if (array_key_exists('mustUnderstand', $this->message[$pos])) {
+            $response->mustunderstand = $this->message[$pos]['mustUnderstand'];
+        }
+        return $response;
+    }
+
+    /**
+     * startElement
+     * start-element handler used with xml parser
+     *
+     * @access private
+     */
+    function startElement($parser, $name, $attrs)
+    {
+        // position in a total number of elements, starting from 0
+        // update class level pos
+        $pos = $this->position++;
+
+        // and set mine
+        $this->message[$pos] = array();
+        $this->message[$pos]['type'] = '';
+        $this->message[$pos]['type_namespace'] = '';
+        $this->message[$pos]['cdata'] = '';
+        $this->message[$pos]['pos'] = $pos;
+        $this->message[$pos]['id'] = '';
+
+        // parent/child/depth determinations
+
+        // depth = how many levels removed from root?
+        // set mine as current global depth and increment global depth value
+        $this->message[$pos]['depth'] = $this->depth++;
+
+        // else add self as child to whoever the current parent is
+        if ($pos != 0) {
+            if (isset($this->message[$this->parent]['children']))
+                $this->message[$this->parent]['children'] .= "|$pos";
+            else
+                $this->message[$this->parent]['children'] = $pos;
+        }
+
+        // set my parent
+        $this->message[$pos]['parent'] = $this->parent;
+
+        // set self as current value for this depth
+        $this->depth_array[$this->depth] = $pos;
+        // set self as current parent
+        $this->parent = $pos;
+        $qname =& new QName($name);
+        // set status
+        if (strcasecmp('envelope', $qname->name) == 0) {
+            $this->status = 'envelope';
+        } elseif (strcasecmp('header', $qname->name) == 0) {
+            $this->status = 'header';
+            $this->header_struct_name[] = $this->curent_root_struct_name = $qname->name;
+            $this->header_struct[] = $this->curent_root_struct = $pos;
+            $this->message[$pos]['type'] = 'Struct';
+        } elseif (strcasecmp('body', $qname->name) == 0) {
+            $this->status = 'body';
+            $this->bodyDepth = $this->depth;
+
+        // Set method
+        } elseif ($this->status == 'body') {
+            // Is this element allowed to be a root?
+            // XXX this needs to be optimized, we loop through attrs twice now.
+            $can_root = $this->depth == $this->bodyDepth + 1;
+            if ($can_root) {
+                foreach ($attrs as $key => $value) {
+                    if (stristr($key, ':root') && !$value) {
+                        $can_root = FALSE;
+                    }
+                }
+            }
+
+            if ($can_root) {
+                $this->status = 'method';
+                $this->root_struct_name[] = $this->curent_root_struct_name = $qname->name;
+                $this->root_struct[] = $this->curent_root_struct = $pos;
+                $this->message[$pos]['type'] = 'Struct';
+            }
+        }
+
+        // Set my status.
+        $this->message[$pos]['status'] = $this->status;
+
+        // Set name.
+        $this->message[$pos]['name'] = htmlspecialchars($qname->name);
+
+        // Set attributes.
+        $this->message[$pos]['attrs'] = $attrs;
+
+        // Loop through attributes, logging ns and type declarations.
+        foreach ($attrs as $key => $value) {
+            // If ns declarations, add to class level array of valid
+            // namespaces.
+            $kqn =& new QName($key);
+            if ($kqn->ns == 'xmlns') {
+                $prefix = $kqn->name;
+
+                if (in_array($value, $this->_XMLSchema)) {
+                    $this->_setSchemaVersion($value);
+                }
+
+                $this->_namespaces[$value] = $prefix;
+
+            // Set method namespace.
+            } elseif ($key == 'xmlns') {
+                $qname->ns = $this->_getNamespacePrefix($value);
+                $qname->namespace = $value;
+            } elseif ($kqn->name == 'actor') {
+                $this->message[$pos]['actor'] = $value;
+            } elseif ($kqn->name == 'mustUnderstand') {
+                $this->message[$pos]['mustUnderstand'] = $value;
+
+            // If it's a type declaration, set type.
+            } elseif ($kqn->name == 'type') {
+                $vqn =& new QName($value);
+                $this->message[$pos]['type'] = $vqn->name;
+                $this->message[$pos]['type_namespace'] = $this->_getNamespaceForPrefix($vqn->ns);
+                // Should do something here with the namespace of
+                // specified type?
+
+            } elseif ($kqn->name == 'arrayType') {
+                $vqn =& new QName($value);
+                $this->message[$pos]['type'] = 'Array';
+                if (isset($vqn->arraySize)) {
+                    $this->message[$pos]['arraySize'] = $vqn->arraySize;
+                }
+                $this->message[$pos]['arrayType'] = $vqn->name;
+
+            } elseif ($kqn->name == 'offset') {
+                $this->message[$pos]['arrayOffset'] = split(',', substr($value, 1, strlen($value) - 2));
+
+            } elseif ($kqn->name == 'id') {
+                // Save id to reference array.
+                $this->references[$value] = $pos;
+                $this->message[$pos]['id'] = $value;
+
+            } elseif ($kqn->name == 'href') {
+                if ($value[0] == '#') {
+                    $ref = substr($value, 1);
+                    if (isset($this->references[$ref])) {
+                        // cdata, type, inval.
+                        $ref_pos = $this->references[$ref];
+                        $this->message[$pos]['children'] = &$this->message[$ref_pos]['children'];
+                        $this->message[$pos]['cdata'] = &$this->message[$ref_pos]['cdata'];
+                        $this->message[$pos]['type'] = &$this->message[$ref_pos]['type'];
+                        $this->message[$pos]['arraySize'] = &$this->message[$ref_pos]['arraySize'];
+                        $this->message[$pos]['arrayType'] = &$this->message[$ref_pos]['arrayType'];
+                    } else {
+                        // Reverse reference, store in 'need reference'.
+                        if (!isset($this->need_references[$ref])) {
+                            $this->need_references[$ref] = array();
+                        }
+                        $this->need_references[$ref][] = $pos;
+                    }
+                } elseif (isset($this->attachments[$value])) {
+                    $this->message[$pos]['cdata'] = $this->attachments[$value];
+                }
+            }
+        }
+        // See if namespace is defined in tag.
+        if (array_key_exists('xmlns:' . $qname->ns, $attrs)) {
+            $namespace = $attrs['xmlns:' . $qname->ns];
+        } elseif ($qname->ns && !$qname->namespace) {
+            $namespace = $this->_getNamespaceForPrefix($qname->ns);
+        } else {
+            // Get namespace.
+            $namespace = $qname->namespace ? $qname->namespace : $this->default_namespace;
+        }
+        $this->message[$pos]['namespace'] = $namespace;
+        $this->default_namespace = $namespace;
+    }
+
+    /**
+     * endElement
+     * end-element handler used with xml parser
+     *
+     * @access private
+     */
+    function endElement($parser, $name)
+    {
+        // Position of current element is equal to the last value left
+        // in depth_array for my depth.
+        $pos = $this->depth_array[$this->depth];
+
+        // Bring depth down a notch.
+        $this->depth--;
+        $qname =& new QName($name);
+
+        // Get type if not explicitly declared in an xsi:type attribute.
+        // XXX check on integrating wsdl validation here
+        if ($this->message[$pos]['type'] == '') {
+            if (isset($this->message[$pos]['children'])) {
+                /* this is slow, need to look at some faster method
+                $children = explode('|', $this->message[$pos]['children']);
+                if (count($children) > 2 &&
+                    $this->message[$children[1]]['name'] == $this->message[$children[2]]['name']) {
+                    $this->message[$pos]['type'] = 'Array';
+                } else {
+                    $this->message[$pos]['type'] = 'Struct';
+                }*/
+                $this->message[$pos]['type'] = 'Struct';
+            } else {
+                $parent = $this->message[$pos]['parent'];
+                if ($this->message[$parent]['type'] == 'Array' &&
+                  array_key_exists('arrayType', $this->message[$parent])) {
+                    $this->message[$pos]['type'] = $this->message[$parent]['arrayType'];
+                } else {
+                    $this->message[$pos]['type'] = 'string';
+                }
+            }
+        }
+
+        // If tag we are currently closing is the method wrapper.
+        if ($pos == $this->curent_root_struct) {
+            $this->status = 'body';
+        } elseif ($qname->name == 'Body' || $qname->name == 'Header') {
+            $this->status = 'envelope';
+        }
+
+        // Set parent back to my parent.
+        $this->parent = $this->message[$pos]['parent'];
+
+        // Handle any reverse references now.
+        $idref = $this->message[$pos]['id'];
+
+        if ($idref != '' && array_key_exists($idref, $this->need_references)) {
+            foreach ($this->need_references[$idref] as $ref_pos) {
+                // XXX is this stuff there already?
+                $this->message[$ref_pos]['children'] = &$this->message[$pos]['children'];
+                $this->message[$ref_pos]['cdata'] = &$this->message[$pos]['cdata'];
+                $this->message[$ref_pos]['type'] = &$this->message[$pos]['type'];
+                $this->message[$ref_pos]['arraySize'] = &$this->message[$pos]['arraySize'];
+                $this->message[$ref_pos]['arrayType'] = &$this->message[$pos]['arrayType'];
+            }
+        }
+    }
+
+    /**
+     * characterData
+     * element content handler used with xml parser
+     *
+     * @access private
+     */
+    function characterData($parser, $data)
+    {
+        $pos = $this->depth_array[$this->depth];
+        if (isset($this->message[$pos]['cdata'])) {
+            $this->message[$pos]['cdata'] .= $data;
+        } else {
+            $this->message[$pos]['cdata'] = $data;
+        }
+    }
+
+    /**
+     * getResponse
+     *
+     * returns an array of responses
+     * after parsing a soap message, use this to get the response
+     *
+     * @return   array
+     * @access public
+     */
+    function &getResponse()
+    {
+        if (isset($this->root_struct[0]) &&
+            $this->root_struct[0]) {
+            return $this->buildResponse($this->root_struct[0]);
+        }
+        return $this->_raiseSoapFault("couldn't build response");
+    }
+
+    /**
+     * getHeaders
+     *
+     * returns an array of header responses
+     * after parsing a soap message, use this to get the response
+     *
+     * @return   array
+     * @access public
+     */
+    function &getHeaders()
+    {
+        if (isset($this->header_struct[0]) &&
+            $this->header_struct[0]) {
+            return $this->buildResponse($this->header_struct[0]);
+        }
+
+        // We don't fault if there are no headers that can be handled
+        // by the app if necessary.
+        return null;
+    }
+
+    /**
+     * decodeEntities
+     *
+     * removes entities from text
+     *
+     * @param string
+     * @return   string
+     * @access private
+     */
+    function decodeEntities($text)
+    {
+        $trans_tbl = array_flip($this->entities);
+        return strtr($text, $trans_tbl);
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/Email.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/Email.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/Email.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,201 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// +----------------------------------------------------------------------+
+//
+// $Id: Email.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+require_once 'Services/PayPal/SOAP/Server.php';
+require_once 'Services/PayPal/SOAP/Client.php';
+require_once 'Services/PayPal/SOAP/Transport.php';
+require_once 'Mail/mimeDecode.php';
+
+/**
+ * SOAP Server Class that implements an email SOAP server.
+ * http://www.pocketsoap.com/specs/smtpbinding/
+ *
+ * This class overrides the default HTTP server, providing the ability to
+ * parse an email message and execute SOAP calls.  This class DOES NOT pop the
+ * message; the message, complete with headers, must be passed in as a
+ * parameter to the service function call.
+ *
+ * @access   public
+ * @package  SOAP
+ * @author   Shane Caraveo <shane at php.net>
+ */
+class SOAP_Server_Email extends SOAP_Server {
+
+    var $headers = array();
+
+    function SOAP_Server_Email($send_response = true)
+    {
+        parent::SOAP_Server();
+        $this->send_response = $send_response;
+    }
+
+    /**
+     * Removes HTTP headers from response.
+     *
+     * TODO: use PEAR email classes
+     *
+     * @return boolean
+     * @access private
+     */
+    function _parseEmail(&$data)
+    {
+        if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $data, $match)) {
+
+            if (preg_match_all('/^(.*?):\s+(.*)$/m', $match[1], $matches)) {
+                $hc = count($matches[0]);
+                for ($i = 0; $i < $hc; $i++) {
+                    $this->headers[strtolower($matches[1][$i])] = trim($matches[2][$i]);
+                }
+            }
+
+            if (!stristr($this->headers['content-type'], 'text/xml')) {
+                    $this->_raiseSoapFault('Invalid Content Type', '', '', 'Client');
+                    return false;
+            }
+
+            if (strcasecmp($this->headers['content-transfer-encoding'], 'base64')==0) {
+                /* Unfold lines. */
+                $enctext = preg_replace("/[\r|\n]/", '', $match[2]);
+                $data = base64_decode($enctext);
+            } else {
+                $data = $match[2];
+            }
+
+            /* If no content, return false. */
+            return strlen($this->request) > 0;
+        }
+
+        $this->_raiseSoapFault('Invalid Email Format', '', '', 'Client');
+
+        return false;
+    }
+
+    function client(&$data)
+    {
+        $attachments = array();
+
+        /* If neither matches, we'll just try it anyway. */
+        if (stristr($data, 'Content-Type: application/dime')) {
+            $this->_decodeDIMEMessage($data, $this->headers, $attachments);
+            $useEncoding = 'DIME';
+        } elseif (stristr($data, 'MIME-Version:')) {
+            /* This is a mime message, let's decode it. */
+            $this->_decodeMimeMessage($data, $this->headers, $attachments);
+            $useEncoding = 'Mime';
+        } else {
+            /* The old fallback, but decodeMimeMessage handles things fine. */
+            $this->_parseEmail($data);
+        }
+
+        /* Get the character encoding of the incoming request treat incoming
+         * data as UTF-8 if no encoding set. */
+        if (!$this->soapfault &&
+            !$this->_getContentEncoding($this->headers['content-type'])) {
+            $this->xml_encoding = SOAP_DEFAULT_ENCODING;
+            /* An encoding we don't understand, return a fault. */
+            $this->_raiseSoapFault('Unsupported encoding, use one of ISO-8859-1, US-ASCII, UTF-8', '', '', 'Server');
+        }
+
+        if ($this->soapfault) {
+            return $this->soapfault->getFault();
+        }
+
+        $client =& new SOAP_Client(null);
+
+        return $client->__parse($data, $this->xml_encoding, $this->attachments);
+    }
+
+    function service(&$data, $endpoint = '', $send_response = true,
+                     $dump = false)
+    {
+        $this->endpoint = $endpoint;
+        $attachments = array();
+        $headers = array();
+
+        /* If neither matches, we'll just try it anyway. */
+        if (stristr($data, 'Content-Type: application/dime')) {
+            $this->_decodeDIMEMessage($data, $this->headers, $attachments);
+            $useEncoding = 'DIME';
+        } elseif (stristr($data, 'MIME-Version:')) {
+            /* This is a mime message, let's decode it. */
+            $this->_decodeMimeMessage($data, $this->headers, $attachments);
+            $useEncoding = 'Mime';
+        } else {
+            /* The old fallback, but decodeMimeMessage handles things fine. */
+            $this->_parseEmail($data);
+        }
+
+        /* Get the character encoding of the incoming request treat incoming
+         * data as UTF-8 if no encoding set. */
+        if (!$response &&
+            !$this->_getContentEncoding($this->headers['content-type'])) {
+            $this->xml_encoding = SOAP_DEFAULT_ENCODING;
+            /* An encoding we don't understand, return a fault. */
+            $this->_raiseSoapFault('Unsupported encoding, use one of ISO-8859-1, US-ASCII, UTF-8', '', '', 'Server');
+            $response = $this->getFaultMessage();
+        }
+
+        if ($this->soapfault) {
+            $response = $this->soapfault->message();
+        } else {
+            $soap_msg = $this->parseRequest($data,$attachments);
+
+            /* Handle Mime or DIME encoding. */
+            /* TODO: DIME Encoding should move to the transport, do it here
+             * for now and for ease of getting it done. */
+            if (count($this->__attachments)) {
+                if ($useEncoding == 'Mime') {
+                    $soap_msg = $this->_makeMimeMessage($soap_msg);
+                } else {
+                    /* Default is DIME. */
+                    $soap_msg = $this->_makeDIMEMessage($soap_msg);
+                    $header['Content-Type'] = 'application/dime';
+                }
+                if (PEAR::isError($soap_msg)) {
+                    return $this->raiseSoapFault($soap_msg);
+                }
+            }
+
+            if (is_array($soap_msg)) {
+                $response = $soap_msg['body'];
+                if (count($soap_msg['headers'])) {
+                    $headers = $soap_msg['headers'];
+                }
+            } else {
+                $response = $soap_msg;
+            }
+        }
+
+        if ($this->send_response) {
+            if ($dump) {
+                print $response;
+            } else {
+                $from = array_key_exists('reply-to', $this->headers) ? $this->headers['reply-to'] : $this->headers['from'];
+
+                $soap_transport =& SOAP_Transport::getTransport('mailto:' . $from, $this->response_encoding);
+                $from = $this->endpoint ? $this->endpoint : $this->headers['to'];
+                $headers['In-Reply-To'] = $this->headers['message-id'];
+                $options = array('from' => $from, 'subject' => $this->headers['subject'], 'headers' => $headers);
+                $soap_transport->send($response, $options);
+            }
+        }
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/Email_Gateway.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/Email_Gateway.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/Email_Gateway.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,138 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// +----------------------------------------------------------------------+
+//
+// $Id: Email_Gateway.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+require_once 'Services/PayPal/SOAP/Server/Email.php';
+require_once 'Services/PayPal/SOAP/Transport.php';
+
+/**
+ * SOAP Server Class that implements an email SOAP server.
+ * http://www.pocketsoap.com/specs/smtpbinding/
+ *
+ * This class overrides the default HTTP server, providing the ability to
+ * parse an email message and execute soap calls.  This class DOES NOT pop the
+ * message; the message, complete with headers, must be passed in as a
+ * parameter to the service function call.
+ *
+ * This class calls a provided HTTP SOAP server, forwarding the email request,
+ * then sending the HTTP response out as an email.
+ *
+ * @access   public
+ * @package  SOAP
+ * @author   Shane Caraveo <shane at php.net>
+ */
+class SOAP_Server_Email_Gateway extends SOAP_Server_Email {
+
+    var $gateway = null;
+    var $dump = false;
+
+    function SOAP_Server_Email_Gateway($gateway = '', $send_response = true,
+                                       $dump = false)
+    {
+        parent::SOAP_Server();
+        $this->send_response = $send_response;
+        $this->gateway = $gateway;
+        $this->dump = $dump;
+    }
+
+    function service(&$data, $gateway = '', $endpoint = '',
+                     $send_response = true, $dump = false)
+    {
+        $this->endpoint = $endpoint;
+        $response = '';
+        $useEncoding = 'Mime';
+        $options = array();
+        if (!$gateway) {
+            $gateway = $this->gateway;
+        }
+
+        /* We have a full set of headers, need to find the first blank
+         * line. */
+        $this->_parseEmail($data);
+        if ($this->fault) {
+            $response = $this->fault->message();
+        }
+        if ($this->headers['content-type'] == 'application/dime')
+            $useEncoding = 'DIME';
+
+        /* Call the HTTP Server. */
+        if (!$response) {
+            $soap_transport =& SOAP_Transport::getTransport($gateway, $this->xml_encoding);
+            if ($soap_transport->fault) {
+                $response = $soap_transport->fault->message();
+            }
+        }
+
+        /* Send the message. */
+        if (!$response) {
+            $options['soapaction'] = $this->headers['soapaction'];
+            $options['headers']['Content-Type'] = $this->headers['content-type'];
+
+            $response = $soap_transport->send($data, $options);
+            if (isset($this->headers['mime-version']))
+                $options['headers']['MIME-Version'] = $this->headers['mime-version'];
+
+            if ($soap_transport->fault) {
+                $response = $soap_transport->fault->message();
+            } else {
+                foreach ($soap_transport->transport->attachments as $cid => $body) {
+                    $this->attachments[] = array('body' => $body, 'cid' => $cid, 'encoding' => 'base64');
+                }
+                if (count($this->__attachments)) {
+                    if ($useEncoding == 'Mime') {
+                        $soap_msg = $this->_makeMimeMessage($response);
+                        $options['headers']['MIME-Version'] = '1.0';
+                    } else {
+                        /* Default is DIME. */
+                        $soap_msg = $this->_makeDIMEMessage($response);
+                        $options['headers']['Content-Type'] = 'application/dime';
+                    }
+                    if (PEAR::isError($soap_msg)) {
+                        return $this->_raiseSoapFault($soap_msg);
+                    }
+                    if (is_array($soap_msg)) {
+                        $response = $soap_msg['body'];
+                        if (count($soap_msg['headers'])) {
+                            if (isset($options['headers'])) {
+                                $options['headers'] = array_merge($options['headers'], $soap_msg['headers']);
+                            } else {
+                                $options['headers'] = $soap_msg['headers'];
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        if ($this->send_response) {
+            if ($this->dump || $dump) {
+                print $response;
+            } else {
+                $from = array_key_exists('reply-to', $this->headers) ? $this->headers['reply-to'] : $this->headers['from'];
+
+                $soap_transport =& SOAP_Transport::getTransport('mailto:' . $from, $this->response_encoding);
+                $from = $this->endpoint ? $this->endpoint : $this->headers['to'];
+                $headers = array('In-Reply-To' => $this->headers['message-id']);
+                $options = array('from' => $from, 'subject'=> $this->headers['subject'], 'headers' => $headers);
+                $soap_transport->send($response, $options);
+            }
+        }
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/TCP.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/TCP.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server/TCP.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// +----------------------------------------------------------------------+
+//
+// $Id: TCP.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+require_once 'Services/PayPal/SOAP/Server.php';
+
+/**
+ * SOAP Server Class that implements a TCP SOAP Server.
+ * http://www.pocketsoap.com/specs/smtpbinding/
+ *
+ * This class overrides the default HTTP server, providing the ability to
+ * accept socket connections and execute SOAP calls.
+ *
+ * TODO:
+ *   use Net_Socket
+ *   implement some security scheme
+ *   implement support for attachments
+ *
+ * @access   public
+ * @package  SOAP
+ * @author   Shane Caraveo <shane at php.net>
+ */
+class SOAP_Server_TCP extends SOAP_Server {
+
+    var $headers = array();
+    var $localaddr;
+    var $port;
+    var $listen;
+    var $reuse;
+
+    function SOAP_Server_TCP($localaddr = '127.0.0.1', $port = 10000,
+                             $listen = 5, $reuse = true)
+    {
+        parent::SOAP_Server();
+        $this->localaddr = $localaddr;
+        $this->port = $port;
+        $this->listen = $listen;
+        $this->reuse = $reuse;
+    }
+
+    function run()
+    {
+        if (($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0) {
+            return $this->_raiseSoapFault('socket_create() failed. Reason: ' . socket_strerror($sock));
+        }
+        if ($this->reuse &&
+            !@socket_setopt($sock, SOL_SOCKET, SO_REUSEADDR, 1)) {
+            return $this->_raiseSoapFault('socket_setopt() failed. Reason: ' . socket_strerror(socket_last_error($sock)));
+        }
+        if (($ret = socket_bind($sock, $this->localaddr, $this->port)) < 0) {
+            return $this->_raiseSoapFault('socket_bind() failed. Reason: ' . socket_strerror($ret));
+        }
+        if (($ret = socket_listen($sock, $this->listen)) < 0) {
+            return $this->_raiseSoapFault('socket_listen() failed. Reason: ' . socket_strerror($ret));
+        }
+
+        while (true) {
+            $data = null;
+            if (($msgsock = socket_accept($sock)) < 0) {
+                $this->_raiseSoapFault('socket_accept() failed. Reason: ' . socket_strerror($msgsock));
+                break;
+            }
+            while ($buf = socket_read($msgsock, 8192)) {
+                if (!$buf = trim($buf)) {
+                    continue;
+                }
+                $data .= $buf;
+            }
+
+            if ($data) {
+                $response = $this->service($data);
+                /* Write to the socket. */
+                if (!socket_write($msgsock, $response, strlen($response))) {
+                    return $this->_raiseSoapFault('Error sending response data reason ' . socket_strerror());
+                }
+            }
+
+            socket_close ($msgsock);
+        }
+
+        socket_close ($sock);
+    }
+
+    function service(&$data)
+    {
+        /* TODO: we need to handle attachments somehow. */
+        return $this->parseRequest($data, $attachments);
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Server.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,764 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: Server.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+require_once 'Services/PayPal/SOAP/Base.php';
+require_once 'Services/PayPal/SOAP/Fault.php';
+require_once 'Services/PayPal/SOAP/Parser.php';
+require_once 'Services/PayPal/SOAP/Value.php';
+require_once 'Services/PayPal/SOAP/WSDL.php';
+
+$soap_server_fault = null;
+
+function SOAP_ServerErrorHandler($errno, $errmsg, $filename, $linenum, $vars)
+{
+    /* The error handler should ignore '0' errors, eg. hidden by @ - see the
+     * set_error_handler manual page. (thanks to Alan Knowles). */
+    if (!$errno || $errno == E_NOTICE) {
+        return;
+    }
+
+    /* Very strange behaviour with error handling if we =& here. */
+    $GLOBALS['soap_server_fault'] = new SOAP_Fault($errmsg, 'Server', 'PHP', "Errno: $errno\nFilename: $filename\nLineno: $linenum\n");
+}
+
+/**
+ * SOAP Server Class
+ *
+ * Originaly based on SOAPx4 by Dietrich Ayala
+ * http://dietrich.ganx4.com/soapx4
+ *
+ * @access   public
+ * @package  SOAP
+ * @author   Shane Caraveo <shane at php.net> Conversion to PEAR and updates
+ * @author   Dietrich Ayala <dietrich at ganx4.com> Original Author
+ */
+class SOAP_Server extends SOAP_Base
+{
+    /**
+     *
+     * @var array
+     */
+    var $dispatch_map = array(); // create empty dispatch map
+    var $dispatch_objects = array();
+    var $soapobject = null;
+    var $call_methodname = null;
+    var $callHandler = null;
+    var $callValidation = true;
+
+    /**
+     *
+     * @var string
+     */
+    var $headers = '';
+
+    /**
+     *
+     * @var string
+     */
+    var $request = '';
+
+    /**
+     *
+     * @var string  XML-Encoding
+     */
+    var $xml_encoding = SOAP_DEFAULT_ENCODING;
+    var $response_encoding = 'UTF-8';
+
+    var $result = 'successful'; // for logging interop results to db
+
+    var $endpoint = ''; // the uri to ME!
+
+    var $service = ''; //soapaction header
+    var $method_namespace = null;
+    var $__options = array('use' => 'encoded',
+                           'style' => 'rpc',
+                           'parameters' => 0);
+
+    function SOAP_Server($options = null)
+    {
+        ini_set('track_errors', 1);
+        parent::SOAP_Base('Server');
+
+        if (is_array($options)) {
+            if (isset($options['use'])) {
+                $this->__options['use'] = $options['use'];
+            }
+            if (isset($options['style'])) {
+                $this->__options['style'] = $options['style'];
+            }
+            if (isset($options['parameters'])) {
+                $this->__options['parameters'] = $options['parameters'];
+            }
+        }
+        // assume we encode with section 5
+        $this->_section5 = true;
+        if ($this->__options['use']=='literal') {
+            $this->_section5 = false;
+        }
+    }
+
+    function _getContentEncoding($content_type)
+    {
+        /* Get the character encoding of the incoming request treat incoming
+         * data as UTF-8 if no encoding set. */
+        $this->xml_encoding = 'UTF-8';
+        if (strpos($content_type, '=')) {
+            $enc = strtoupper(str_replace('"', '', substr(strstr($content_type, '='), 1)));
+            if (!in_array($enc, $this->_encodings)) {
+                return false;
+            }
+            $this->xml_encoding = $enc;
+        }
+
+        return true;
+    }
+
+
+    /**
+     * Parses request and posts response.
+     */
+    function service($data, $endpoint = '', $test = false)
+    {
+        $response = null;
+        $attachments = array();
+        $headers = array();
+        $useEncoding = 'DIME';
+
+        /* Figure out our endpoint. */
+        $this->endpoint = $endpoint;
+        if (!$test && !$this->endpoint) {
+            /* We'll try to build our endpoint. */
+            $this->endpoint = 'http://' . $_SERVER['SERVER_NAME'];
+            if ($_SERVER['SERVER_PORT']) {
+                $this->endpoint .= ':' . $_SERVER['SERVER_PORT'];
+            }
+            $this->endpoint .= $_SERVER['SCRIPT_NAME'];
+        }
+
+        /* Get the character encoding of the incoming request treat incoming
+         * data as UTF-8 if no encoding set. */
+        if (isset($_SERVER['CONTENT_TYPE'])) {
+            if (strcasecmp($_SERVER['CONTENT_TYPE'], 'application/dime') == 0) {
+                $this->_decodeDIMEMessage($data, $headers, $attachments);
+                $useEncoding = 'DIME';
+            } elseif (stristr($_SERVER['CONTENT_TYPE'], 'multipart/related')) {
+                /* This is a mime message, let's decode it. */
+                $data = 'Content-Type: ' .
+                    stripslashes($_SERVER['CONTENT_TYPE']) .
+                    "\r\n\r\n" . $data;
+                $this->_decodeMimeMessage($data, $headers, $attachments);
+                $useEncoding = 'Mime';
+            }
+            if (!isset($headers['content-type'])) {
+                $headers['content-type'] = stripslashes($_SERVER['CONTENT_TYPE']);
+            }
+            if (!$this->fault &&
+                !$this->_getContentEncoding($headers['content-type'])) {
+                $this->xml_encoding = SOAP_DEFAULT_ENCODING;
+                /* Found encoding we don't understand; return a fault. */
+                $this->_raiseSoapFault('Unsupported encoding, use one of ISO-8859-1, US-ASCII, UTF-8', '', '', 'Server');
+            }
+        }
+
+        /* If this is not a POST with Content-Type text/xml, try to return a
+         * WSDL file. */
+        if (!$this->fault && !$test &&
+            ($_SERVER['REQUEST_METHOD'] != 'POST' ||
+             strncmp($headers['content-type'], 'text/xml', 8) != 0)) {
+            /* This is not possibly a valid SOAP request, try to return a WSDL
+             * file. */
+            $this->_raiseSoapFault('Invalid SOAP request, must be POST with content-type: text/xml, got: ' . (isset($headers['content-type']) ? $headers['content-type'] : 'Nothing!'), '', '', 'Server');
+        }
+
+        if (!$this->fault) {
+            /* $response is a SOAP_Msg object. */
+            $soap_msg = $this->parseRequest($data, $attachments);
+
+            /* Handle Mime or DIME encoding. */
+            /* TODO: DIME decoding should move to the transport, do it here
+             * for now and for ease of getting it done. */
+            if (count($this->__attachments)) {
+                if ($useEncoding == 'Mime') {
+                    $soap_msg = $this->_makeMimeMessage($soap_msg);
+                } else {
+                    // default is dime
+                    $soap_msg = $this->_makeDIMEMessage($soap_msg);
+                    $header['Content-Type'] = 'application/dime';
+                }
+                if (PEAR::isError($soap_msg)) {
+                    return $this->raiseSoapFault($soap_msg);
+                }
+            }
+
+            if (is_array($soap_msg)) {
+                $response = $soap_msg['body'];
+                if (count($soap_msg['headers'])) {
+                    $header = $soap_msg['headers'];
+                }
+            } else {
+                $response = $soap_msg;
+            }
+        }
+
+        /* Make distinction between the different SAPIs, running PHP as CGI or
+         * as a module. */
+        if (stristr(php_sapi_name(), 'cgi') === 0) {
+            $hdrs_type = 'Status:';
+        } else {
+            $hdrs_type = 'HTTP/1.1';
+        }
+
+        if ($this->fault) {
+            $hdrs = "$hdrs_type 500 Soap Fault\r\n";
+            $response = $this->fault->message();
+        } else {
+           $hdrs = "$hdrs_type 200 OK\r\n";
+        }
+        header($hdrs);
+
+        $header['Server'] = SOAP_LIBRARY_NAME;
+        if (!isset($header['Content-Type'])) {
+            $header['Content-Type'] = 'text/xml; charset=' . $this->response_encoding;
+        }
+        $header['Content-Length'] = strlen($response);
+
+        reset($header);
+        foreach ($header as $k => $v) {
+            header("$k: $v");
+            $hdrs .= "$k: $v\r\n";
+        }
+
+        $this->response = $hdrs . "\r\n" . $response;
+        print $response;
+    }
+
+    function &callMethod($methodname, &$args) {
+        global $soap_server_fault;
+        $soap_server_fault = null;
+
+        if ($this->callHandler) {
+            return @call_user_func_array($this->callHandler, array($methodname, $args));
+        }
+
+        set_error_handler('SOAP_ServerErrorHandler');
+
+        if ($args) {
+            /* Call method with parameters. */
+            if (isset($this->soapobject) && is_object($this->soapobject)) {
+                $ret = @call_user_func_array(array(&$this->soapobject, $methodname), $args);
+            } else {
+                $ret = @call_user_func_array($methodname, $args);
+            }
+        } else {
+            /* Call method withour parameters. */
+            if (is_object($this->soapobject)) {
+                $ret = @call_user_func(array(&$this->soapobject, $methodname));
+            } else {
+                $ret = @call_user_func($methodname);
+            }
+        }
+
+        restore_error_handler();
+
+        return is_null($soap_server_fault) ? $ret : $soap_server_fault;
+    }
+
+    /**
+     * Creates SOAP_Value object with return values from method.
+     * Uses method signature to determine type.
+     */
+    function buildResult(&$method_response, &$return_type,
+                         $return_name = 'return', $namespace = '')
+    {
+        if (is_a($method_response, 'SOAP_Value')) {
+            $return_val = array($method_response);
+        } else {
+            if (is_array($return_type) && is_array($method_response)) {
+                $i = 0;
+
+                foreach ($return_type as $key => $type) {
+                    if (is_numeric($key)) {
+                        $key = 'item';
+                    }
+                    if (is_a($method_response[$i],'soap_value')) {
+                        $return_val[] = $method_response[$i++];
+                    } else {
+                        $qn =& new QName($key, $namespace);
+                        $return_val[] =& new SOAP_Value($qn->fqn(), $type, $method_response[$i++]);
+                    }
+                }
+            } else {
+                if (is_array($return_type)) {
+                    $keys = array_keys($return_type);
+                    if (!is_numeric($keys[0])) {
+                        $return_name = $keys[0];
+                    }
+                    $values = array_values($return_type);
+                    $return_type = $values[0];
+                }
+                $qn =& new QName($return_name, $namespace);
+                $return_val = array();
+                $return_val[] =& new SOAP_Value($qn->fqn(), $return_type, $method_response);
+            }
+        }
+        return $return_val;
+    }
+
+    function parseRequest($data = '', $attachments = null)
+    {
+        /* Parse response, get SOAP_Parser object. */
+        $parser =& new SOAP_Parser($data, $this->xml_encoding, $attachments);
+        /* If fault occurred during message parsing. */
+        if ($parser->fault) {
+            $this->fault = $parser->fault;
+            return null;
+        }
+
+        /* Handle message headers. */
+        $request_headers = $parser->getHeaders();
+        $header_results = array();
+
+        if ($request_headers) {
+            if (!is_a($request_headers, 'SOAP_Value')) {
+                $this->_raiseSoapFault('Parser did not return SOAP_Value object: ' . $request_headers, '', '', 'Server');
+                return null;
+            }
+            if ($request_headers->value) {
+                /* Handle headers now. */
+                foreach ($request_headers->value as $header_val) {
+                    $f_exists = $this->validateMethod($header_val->name, $header_val->namespace);
+
+                    /* TODO: this does not take into account message routing
+                     * yet. */
+                    $myactor = !$header_val->actor ||
+                        $header_val->actor == 'http://schemas.xmlsoap.org/soap/actor/next' ||
+                        $header_val->actor == $this->endpoint;
+
+                    if (!$f_exists && $header_val->mustunderstand && $myactor) {
+                        $this->_raiseSoapFault('I don\'t understand header ' . $header_val->name, '', '', 'MustUnderstand');
+                        return null;
+                    }
+
+                    /* We only handle the header if it's for us. */
+                    $isok = $f_exists && $myactor;
+
+                    if ($isok) {
+                        /* Call our header now! */
+                        $header_method = $header_val->name;
+                        $header_data = array($this->_decode($header_val));
+                        /* If there are parameters to pass. */
+                        $hr =& $this->callMethod($header_method, $header_data);
+                        /* If they return a fault, then it's all over! */
+                        if (PEAR::isError($hr)) {
+                            $this->_raiseSoapFault($hr);
+                            return null;
+                        }
+                        $header_results[] = array_shift($this->buildResult($hr, $this->return_type, $header_method, $header_val->namespace));
+                    }
+                }
+            }
+        }
+
+        /* Handle the method call. */
+        /* Evaluate message, getting back a SOAP_Value object. */
+        $this->call_methodname = $this->methodname = $parser->root_struct_name[0];
+
+        /* Figure out the method namespace. */
+        $this->method_namespace = $parser->message[$parser->root_struct[0]]['namespace'];
+
+        if ($this->_wsdl) {
+            $this->_setSchemaVersion($this->_wsdl->xsd);
+            $dataHandler = $this->_wsdl->getDataHandler($this->methodname, $this->method_namespace);
+            if ($dataHandler)
+                $this->call_methodname = $this->methodname = $dataHandler;
+
+            $this->_portName = $this->_wsdl->getPortName($this->methodname);
+            if (PEAR::isError($this->_portName)) {
+                return $this->_raiseSoapFault($this->_portName);
+            }
+            $opData = $this->_wsdl->getOperationData($this->_portName, $this->methodname);
+            if (PEAR::isError($opData)) {
+                return $this->_raiseSoapFault($opData);
+            }
+            $this->__options['style'] = $opData['style'];
+            $this->__options['use'] = $opData['output']['use'];
+            $this->__options['parameters'] = $opData['parameters'];
+        }
+
+        /* Does method exist? */
+        if (!$this->methodname ||
+            !$this->validateMethod($this->methodname, $this->method_namespace)) {
+            $this->_raiseSoapFault('method "' . $this->method_namespace . $this->methodname . '" not defined in service', '', '', 'Server');
+            return null;
+        }
+
+        if (!$request_val = $parser->getResponse()) {
+            return null;
+        }
+        if (!is_a($request_val, 'SOAP_Value')) {
+            $this->_raiseSoapFault('Parser did not return SOAP_Value object: ' . $request_val, '', '', 'Server');
+            return null;
+        }
+
+        /* Verify that SOAP_Value objects in request match the methods
+         * signature. */
+        if (!$this->verifyMethod($request_val)) {
+            /* verifyMethod() creates the fault. */
+            return null;
+        }
+
+        /* Need to set special error detection inside the value class to
+         * differentiate between no params passed, and an error decoding. */
+        $request_data = $this->__decodeRequest($request_val);
+        if (PEAR::isError($request_data)) {
+            return $this->_raiseSoapFault($request_data);
+        }
+        $method_response =& $this->callMethod($this->call_methodname, $request_data);
+
+        if (PEAR::isError($method_response)) {
+            $this->_raiseSoapFault($method_response);
+            return null;
+        }
+
+        if ($this->__options['parameters'] ||
+            !$method_response ||
+            $this->__options['style']=='rpc') {
+            /* Get the method result. */
+            if (is_null($method_response)) {
+                $return_val = null;
+            } else {
+                $return_val = $this->buildResult($method_response, $this->return_type);
+            }
+
+            $qn =& new QName($this->methodname . 'Response', $this->method_namespace);
+            $methodValue =& new SOAP_Value($qn->fqn(), 'Struct', $return_val);
+        } else {
+            $methodValue =& $method_response;
+        }
+        return $this->_makeEnvelope($methodValue, $header_results, $this->response_encoding);
+    }
+
+    function &__decodeRequest($request, $shift = false)
+    {
+        if (!$request) {
+            return null;
+        }
+
+        /* Check for valid response. */
+        if (PEAR::isError($request)) {
+            return $this->_raiseSoapFault($request);
+        } else if (!is_a($request, 'SOAP_Value')) {
+            return $this->_raiseSoapFault('Invalid data in server::__decodeRequest');
+        }
+
+        /* Decode to native php datatype. */
+        $requestArray = $this->_decode($request);
+        /* Fault? */
+        if (PEAR::isError($requestArray)) {
+            return $this->_raiseSoapFault($requestArray);
+        }
+        if (is_object($requestArray) &&
+            get_class($requestArray) == 'stdClass') {
+            $requestArray = get_object_vars($requestArray);
+        } elseif ($this->__options['style'] == 'document') {
+            $requestArray = array($requestArray);
+        }
+        if (is_array($requestArray)) {
+            if (isset($requestArray['faultcode']) ||
+                isset($requestArray['SOAP-ENV:faultcode'])) {
+                $faultcode = $faultstring = $faultdetail = $faultactor = '';
+                foreach ($requestArray as $k => $v) {
+                    if (stristr($k, 'faultcode')) {
+                        $faultcode = $v;
+                    }
+                    if (stristr($k, 'faultstring')) {
+                        $faultstring = $v;
+                    }
+                    if (stristr($k, 'detail')) {
+                        $faultdetail = $v;
+                    }
+                    if (stristr($k, 'faultactor')) {
+                        $faultactor = $v;
+                    }
+                }
+                return $this->_raiseSoapFault($faultstring, $faultdetail, $faultactor, $faultcode);
+            }
+            /* Return array of return values. */
+            if ($shift && count($requestArray) == 1) {
+                return array_shift($requestArray);
+            }
+            return $requestArray;
+        }
+        return $requestArray;
+    }
+
+    function verifyMethod($request)
+    {
+        if (!$this->callValidation) {
+            return true;
+        }
+
+        $params = $request->value;
+
+        /* Get the dispatch map if one exists. */
+        $map = null;
+        if (array_key_exists($this->methodname, $this->dispatch_map)) {
+            $map = $this->dispatch_map[$this->methodname];
+        } elseif (isset($this->soapobject)) {
+            if (method_exists($this->soapobject, '__dispatch')) {
+                $map = $this->soapobject->__dispatch($this->methodname);
+            } elseif (method_exists($this->soapobject, $this->methodname)) {
+                /* No map, all public functions are SOAP functions. */
+                return true;
+            }
+        }
+        if (!$map) {
+            $this->_raiseSoapFault('SOAP request specified an unhandled method "' . $this->methodname . '"', '', '', 'Client');
+            return false;
+        }
+
+        /* If we aliased the SOAP method name to a PHP function, change
+         * call_methodname so we do the right thing. */
+        if (array_key_exists('alias', $map) && !empty($map['alias'])) {
+            $this->call_methodname = $map['alias'];
+        }
+
+        /* If there are input parameters required. */
+        if ($sig = $map['in']) {
+            $this->input_value = count($sig);
+            $this->return_type = $this->getReturnType($map['out']);
+            if (is_array($params)) {
+                /* Validate the number of parameters. */
+                if (count($params) == count($sig)) {
+                    /* Make array of param types. */
+                    foreach ($params as $param) {
+                        $p[] = strtolower($param->type);
+                    }
+                    $sig_t = array_values($sig);
+                    /* Validate each param's type. */
+                    for ($i = 0; $i < count($p); $i++) {
+                        /* If SOAP types do not match, it's still fine if the
+                         * mapped php types match this allows using plain PHP
+                         * variables to work (i.e. stuff like Decimal would
+                         * fail otherwise). We consider this only error if the
+                         * types exist in our type maps, and they differ. */
+                        if (strcasecmp($sig_t[$i], $p[$i]) != 0 &&
+                            isset($this->_typemap[SOAP_XML_SCHEMA_VERSION][$sig_t[$i]]) &&
+                            strcasecmp($this->_typemap[SOAP_XML_SCHEMA_VERSION][$sig_t[$i]], $this->_typemap[SOAP_XML_SCHEMA_VERSION][$p[$i]]) != 0) {
+
+                            $param = $params[$i];
+                            $this->_raiseSoapFault("SOAP request contained mismatching parameters of name $param->name had type [{$p[$i]}], which did not match signature's type: [{$sig_t[$i]}], matched? " . (strcasecmp($sig_t[$i], $p[$i])), '', '', 'Client');
+                            return false;
+                        }
+                    }
+                    return true;
+                } else {
+                    /* Wrong number of params. */
+                    $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" required ' . count($sig) . ' and request provided ' . count($params), '', '', 'Client');
+                    return false;
+                }
+            } else {
+                /* No params. */
+                $this->_raiseSoapFault('SOAP request contained incorrect number of parameters. method "' . $this->methodname . '" requires ' . count($sig) . ' parameters, and request provided none.', '', '', 'Client');
+                return false;
+            }
+        }
+
+        /* We'll try it anyway. */
+        return true;
+    }
+
+    /**
+     * Returns string return type from dispatch map.
+     */
+    function getReturnType($returndata)
+    {
+        if (is_array($returndata)) {
+            if (count($returndata) > 1) {
+                return $returndata;
+            }
+            $type = array_shift($returndata);
+            return $type;
+        }
+        return false;
+    }
+
+    function validateMethod($methodname, $namespace = null)
+    {
+        unset($this->soapobject);
+
+        if (!$this->callValidation) {
+            return true;
+        }
+
+        /* No SOAP access to private functions. */
+        if ($methodname[0] == '_') {
+            return false;
+        }
+
+        /* if it's in our function list, ok */
+        if (array_key_exists($methodname, $this->dispatch_map) &&
+            (!$namespace ||
+             !array_key_exists('namespace', $this->dispatch_map[$methodname]) ||
+             $namespace == $this->dispatch_map[$methodname]['namespace'])) {
+            if (array_key_exists('namespace', $this->dispatch_map[$methodname]))
+                $this->method_namespace = $this->dispatch_map[$methodname]['namespace'];
+            return true;
+        }
+
+        /* if it's in an object, it's ok */
+        if (isset($this->dispatch_objects[$namespace])) {
+            $c = count($this->dispatch_objects[$namespace]);
+            for ($i = 0; $i < $c; $i++) {
+                $obj =& $this->dispatch_objects[$namespace][$i];
+                /* If we have a dispatch map, and the function is not in the
+                 * dispatch map, then it is not callable! */
+                if (method_exists($obj, '__dispatch')) {
+                    if ($obj->__dispatch($methodname)) {
+                        $this->method_namespace = $namespace;
+                        $this->soapobject =& $obj;
+                        return true;
+                    }
+                } elseif (method_exists($obj, $methodname)) {
+                    $this->method_namespace = $namespace;
+                    $this->soapobject =& $obj;
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    function addObjectMap(&$obj, $namespace = null, $service_name = 'Default',
+                          $service_desc = '')
+    {
+        if (!$namespace) {
+            if (isset($obj->namespace)) {
+                // XXX a bit of backwards compatibility
+                $namespace = $obj->namespace;
+            } else {
+                $this->_raiseSoapFault('No namespace provided for class!', '', '', 'Server');
+                return false;
+            }
+        }
+        if (!isset($this->dispatch_objects[$namespace])) {
+            $this->dispatch_objects[$namespace] = array();
+        }
+        $this->dispatch_objects[$namespace][] =& $obj;
+
+        // Create internal WSDL structures for object
+
+        // XXX Because some internal workings of PEAR::SOAP decide whether to
+        // do certain things by the presence or absence of _wsdl, we should
+        // only create a _wsdl structure if we know we can fill it; if
+        // __dispatch_map or __typedef for the object is missing, we should
+        // avoid creating it. Later, when we are using PHP 5 introspection, we
+        // will be able to make the data for all objects without any extra
+        // information from the developers, and this condition should be
+        // dropped.
+
+        // XXX Known issue: if imported WSDL (bindWSDL) or another WSDL source
+        // is used to add _wsdl structure information, then addObjectWSDL is
+        // used, there is a high possibility of _wsdl data corruption;
+        // therefore you should avoid using __dispatch_map/__typedef
+        // definitions AND other WSDL data sources in the same service. We
+        // exclude classes that don't have __typedefs to allow external WSDL
+        // files to be used with classes with no internal type definitions
+        // (the types are defined in the WSDL file). When addObjectWSDL is
+        // refactored to not cause corruption, this restriction can be
+        // relaxed.
+
+        // In summary, if you add an object with both a dispatch map and type
+        // definitions, then previous WSDL file operation and type definitions
+        // will be overwritten.
+        if (isset($obj->__dispatch_map) && isset($obj->__typedef)) {
+            $this->addObjectWSDL($obj, $namespace, $service_name, $service_desc);
+        }
+
+        return true;
+    }
+
+    /**
+     * Adds a method to the dispatch map.
+     */
+    function addToMap($methodname, $in, $out, $namespace = null, $alias = null)
+    {
+        if (!function_exists($methodname)) {
+            $this->_raiseSoapFault('Error mapping function', '', '', 'Server');
+            return false;
+        }
+
+        $this->dispatch_map[$methodname]['in'] = $in;
+        $this->dispatch_map[$methodname]['out'] = $out;
+        $this->dispatch_map[$methodname]['alias'] = $alias;
+        if ($namespace) {
+            $this->dispatch_map[$methodname]['namespace'] = $namespace;
+        }
+
+        return true;
+    }
+
+    function setCallHandler($callHandler, $validation = true)
+    {
+        $this->callHandler = $callHandler;
+        $this->callValidation = $validation;
+    }
+
+    /**
+     * @deprecated use bindWSDL from now on
+     */
+    function bind($wsdl_url)
+    {
+        $this->bindWSDL($wsdl_url);
+    }
+
+    /**
+     * @param  string a url to a WSDL resource
+     * @return void
+     */
+    function bindWSDL($wsdl_url)
+    {
+        /* Instantiate WSDL class. */
+        $this->_wsdl =& new SOAP_WSDL($wsdl_url);
+        if ($this->_wsdl->fault) {
+            $this->_raiseSoapFault($this->_wsdl->fault);
+        }
+    }
+
+    /**
+     * @return void
+     */
+    function addObjectWSDL(&$wsdl_obj, $targetNamespace, $service_name,
+                           $service_desc = '')
+    {
+        if (!isset($this->_wsdl)) {
+            $this->_wsdl =& new SOAP_WSDL;
+        }
+
+        $this->_wsdl->parseObject($wsdl_obj, $targetNamespace, $service_name, $service_desc);
+
+        if ($this->_wsdl->fault) {
+            $this->_raiseSoapFault($this->_wsdl->fault);
+        }
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/HTTP.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/HTTP.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/HTTP.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,616 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>                           |
+// +----------------------------------------------------------------------+
+//
+// $Id: HTTP.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+/**
+ * HTTP Transport class
+ *
+ * @package  SOAP
+ * @category Web_Services
+ */
+
+/**
+ * Needed Classes
+ */
+require_once 'Services/PayPal/SOAP/Base.php';
+
+/**
+ *  HTTP Transport for SOAP
+ *
+ * @access public
+ * @package SOAP::Transport::HTTP
+ * @author Shane Caraveo <shane at php.net>
+ */
+class SOAP_Transport_HTTP extends SOAP_Base
+{
+
+    /**
+     * Basic Auth string
+     *
+     * @var  array
+     */
+    var $headers = array();
+
+    /**
+     * Cookies
+     *
+     * @var array
+     */
+    var $cookies;
+
+    /**
+     *
+     * @var  int connection timeout in seconds - 0 = none
+     */
+    var $timeout = 30;
+
+    /**
+     * Array containing urlparts - parse_url()
+     *
+     * @var  mixed
+     */
+    var $urlparts = NULL;
+
+    /**
+     * Connection endpoint - URL
+     *
+     * @var  string
+     */
+    var $url = '';
+
+    /**
+     * Incoming payload
+     *
+     * @var  string
+     */
+    var $incoming_payload = '';
+
+    /**
+     * HTTP-Request User-Agent
+     *
+     * @var  string
+     */
+    var $_userAgent = SOAP_LIBRARY_NAME;
+
+    /**
+     * HTTP Encoding
+     *
+     * @var string
+     */
+    var $encoding = SOAP_DEFAULT_ENCODING;
+
+    /**
+     * HTTP-Response Content-Type encoding
+     *
+     * we assume UTF-8 if no encoding is set
+     * @var  string
+     */
+    var $result_encoding = 'UTF-8';
+
+    /**
+     * HTTP-Response Content-Type
+     */
+    var $result_content_type;
+
+    var $result_headers = array();
+
+    var $result_cookies = array();
+
+    /**
+     * SOAP_Transport_HTTP Constructor
+     *
+     * @param string $URL    http url to soap endpoint
+     *
+     * @access public
+     * @param  string $URI
+     * @param  string $encoding  encoding to use
+     */
+    function SOAP_Transport_HTTP($URL, $encoding = SOAP_DEFAULT_ENCODING)
+    {
+        parent::SOAP_Base('HTTP');
+        $this->urlparts = @parse_url($URL);
+        $this->url = $URL;
+        $this->encoding = $encoding;
+    }
+
+    /**
+     * send and receive soap data
+     *
+     * @param string outgoing post data
+     * @param array  options
+     *
+     * @return string|fault response
+     * @access public
+     */
+    function &send(&$msg, $options = null)
+    {
+        if (!$this->_validateUrl()) {
+            return $this->fault;
+        }
+
+        if (isset($options['timeout']))
+            $this->timeout = (int)$options['timeout'];
+
+        if (strcasecmp($this->urlparts['scheme'], 'HTTP') == 0) {
+            return $this->_sendHTTP($msg, $options);
+        } else if (strcasecmp($this->urlparts['scheme'], 'HTTPS') == 0) {
+            return $this->_sendHTTPS($msg, $options);
+        }
+
+        return $this->_raiseSoapFault('Invalid url scheme '.$this->url);
+    }
+
+    /**
+     * set data for http authentication
+     * creates Authorization header
+     *
+     * @param string $username   username
+     * @param string $password   response data, minus http headers
+     *
+     * @return none
+     * @access public
+     */
+    function setCredentials($username, $password)
+    {
+        $this->headers['Authorization'] = 'Basic ' . base64_encode($username . ':' . $password);
+    }
+
+    /**
+     * Add a cookie
+     *
+     * @access public
+     * @param  string  $name   cookie name
+     * @param  mixed   $value  cookie value
+     * @return void
+     */
+    function addCookie($name, $value)
+    {
+        $this->cookies[$name]=$value;
+    }
+
+    // private methods
+
+    /**
+     * Generates the correct headers for the cookies
+     *
+     * @access private
+     * @return void
+     */
+    function _genCookieHeader()
+    {
+        foreach ($this->cookies as $name=>$value) {
+            $cookies = (isset($cookies) ? $cookies. '; ' : '') .
+                        urlencode($name) . '=' . urlencode($value);
+        }
+        return $cookies;
+    }
+
+    /**
+     * validate url data passed to constructor
+     *
+     * @access private
+     * @return boolean
+     */
+    function _validateUrl()
+    {
+        if ( ! is_array($this->urlparts) ) {
+            $this->_raiseSoapFault("Unable to parse URL " . $this->url);
+            return false;
+        }
+        if (!isset($this->urlparts['host'])) {
+            $this->_raiseSoapFault("No host in URL " . $this->url);
+            return false;
+        }
+        if (!isset($this->urlparts['port'])) {
+
+            if (strcasecmp($this->urlparts['scheme'], 'HTTP') == 0)
+                $this->urlparts['port'] = 80;
+            else if (strcasecmp($this->urlparts['scheme'], 'HTTPS') == 0)
+                $this->urlparts['port'] = 443;
+
+        }
+        if (isset($this->urlparts['user'])) {
+            $this->setCredentials(urldecode($this->urlparts['user']),
+                                    urldecode($this->urlparts['pass']));
+        }
+        if (!isset($this->urlparts['path']) || !$this->urlparts['path'])
+            $this->urlparts['path'] = '/';
+        return true;
+    }
+
+    /**
+     * Finds out what is the encoding.
+     *
+     * Sets the object property accordingly.
+     *
+     * @access private
+     * @param  array $headers  headers
+     * @return void
+     */
+    function _parseEncoding($headers)
+    {
+        $h = stristr($headers, 'Content-Type');
+        preg_match_all('/^Content-Type:\s*(.*)$/im', $h, $ct, PREG_SET_ORDER);
+        $n = count($ct);
+        $ct = $ct[$n - 1];
+        $this->result_content_type = str_replace("\r", '', $ct[1]);
+        if (preg_match('/(.*?)(?:;\s?charset=)(.*)/i', $this->result_content_type, $m)) {
+            // strip the string of \r
+            $this->result_content_type = $m[1];
+            if (count($m) > 2) {
+                $enc = strtoupper(str_replace('"', '', $m[2]));
+                if (in_array($enc, $this->_encodings)) {
+                    $this->result_encoding = $enc;
+                }
+            }
+        }
+        // deal with broken servers that don't set content type on faults
+        if (!$this->result_content_type) $this->result_content_type = 'text/xml';
+    }
+
+    /**
+     * Parses the headers
+     *
+     * @param  array $headers the headers
+     * @return void
+     */
+    function _parseHeaders($headers)
+    {
+        /* largely borrowed from HTTP_Request */
+        $this->result_headers = array();
+        $headers = split("\r?\n", $headers);
+        foreach ($headers as $value) {
+            if (strpos($value,':') === false) {
+                $this->result_headers[0]=$value;
+                continue;
+            }
+            list($name,$value) = split(':',$value);
+            $headername = strtolower($name);
+            $headervalue = trim($value);
+            $this->result_headers[$headername]=$headervalue;
+
+            if ($headername == 'set-cookie') {
+                // Parse a SetCookie header to fill _cookies array
+                $cookie = array(
+                    'expires' => null,
+                    'domain'  => $this->urlparts['host'],
+                    'path'    => null,
+                    'secure'  => false
+                );
+
+                // Only a name=value pair
+                if (!strpos($headervalue, ';')) {
+                    list($cookie['name'], $cookie['value']) = array_map('trim', explode('=', $headervalue));
+                    $cookie['name']  = urldecode($cookie['name']);
+                    $cookie['value'] = urldecode($cookie['value']);
+
+                // Some optional parameters are supplied
+                } else {
+                    $elements = explode(';', $headervalue);
+                    list($cookie['name'], $cookie['value']) = array_map('trim', explode('=', $elements[0]));
+                    $cookie['name']  = urldecode($cookie['name']);
+                    $cookie['value'] = urldecode($cookie['value']);
+
+                    for ($i = 1; $i < count($elements);$i++) {
+                        list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i]));
+                        if ('secure' == $elName) {
+                            $cookie['secure'] = true;
+                        } elseif ('expires' == $elName) {
+                            $cookie['expires'] = str_replace('"', '', $elValue);
+                        } elseif ('path' == $elName OR 'domain' == $elName) {
+                            $cookie[$elName] = urldecode($elValue);
+                        } else {
+                            $cookie[$elName] = $elValue;
+                        }
+                    }
+                }
+                $this->result_cookies[] = $cookie;
+            }
+        }
+    }
+
+    /**
+     * Remove http headers from response
+     *
+     * @return boolean
+     * @access private
+     */
+    function _parseResponse()
+    {
+        if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $this->incoming_payload, $match)) {
+            #$this->response = preg_replace("/[\r|\n]/", '', $match[2]);
+            $this->response =& $match[2];
+            // find the response error, some servers response with 500 for soap faults
+            $this->_parseHeaders($match[1]);
+
+            list($protocol, $code, $msg) = sscanf($this->result_headers[0], '%s %s %s');
+            unset($this->result_headers[0]);
+
+            switch($code) {
+                case 100: // Continue
+                   $this->incoming_payload = $match[2];
+                   return $this->_parseResponse();
+                case 400:
+                    $this->_raiseSoapFault("HTTP Response $code Bad Request");
+                    return false;
+                    break;
+                case 401:
+                    $this->_raiseSoapFault("HTTP Response $code Authentication Failed");
+                    return false;
+                    break;
+                case 403:
+                    $this->_raiseSoapFault("HTTP Response $code Forbidden");
+                    return false;
+                    break;
+                case 404:
+                    $this->_raiseSoapFault("HTTP Response $code Not Found");
+                    return false;
+                    break;
+                case 407:
+                    $this->_raiseSoapFault("HTTP Response $code Proxy Authentication Required");
+                    return false;
+                    break;
+                case 408:
+                    $this->_raiseSoapFault("HTTP Response $code Request Timeout");
+                    return false;
+                    break;
+                case 410:
+                    $this->_raiseSoapFault("HTTP Response $code Gone");
+                    return false;
+                    break;
+                default:
+                    if ($code >= 400 && $code < 500) {
+                        $this->_raiseSoapFault("HTTP Response $code Not Found, Server message: $msg");
+                        return false;
+                    }
+            }
+
+            $this->_parseEncoding($match[1]);
+
+            if ($this->result_content_type == 'application/dime') {
+                // XXX quick hack insertion of DIME
+                if (PEAR::isError($this->_decodeDIMEMessage($this->response,$this->headers,$this->attachments))) {
+                    // _decodeDIMEMessage already raised $this->fault
+                    return false;
+                }
+                $this->result_content_type = $this->headers['content-type'];
+            } else if (stristr($this->result_content_type,'multipart/related')) {
+                $this->response = $this->incoming_payload;
+                if (PEAR::isError($this->_decodeMimeMessage($this->response,$this->headers,$this->attachments))) {
+                    // _decodeMimeMessage already raised $this->fault
+                    return false;
+                }
+            } else if ($this->result_content_type != 'text/xml') {
+                $this->_raiseSoapFault($this->response);
+                return false;
+            }
+            // if no content, return false
+            return strlen($this->response) > 0;
+        }
+        $this->_raiseSoapFault('Invalid HTTP Response');
+        return false;
+    }
+
+    /**
+     * Create http request, including headers, for outgoing request
+     *
+     * @param string   &$msg   outgoing SOAP package
+     * @param $options
+     * @return string outgoing_payload
+     * @access private
+     */
+    function &_getRequest(&$msg, $options)
+    {
+        $action = isset($options['soapaction'])?$options['soapaction']:'';
+        $fullpath = $this->urlparts['path'].
+                        (isset($this->urlparts['query'])?'?'.$this->urlparts['query']:'').
+                        (isset($this->urlparts['fragment'])?'#'.$this->urlparts['fragment']:'');
+
+        if (isset($options['proxy_host'])) {
+            $fullpath = 'http://' . $this->urlparts['host'] . ':' . $this->urlparts['port'] . $fullpath;
+        }
+
+        if (isset($options['proxy_user'])) {
+            $this->headers['Proxy-Authorization'] = 'Basic ' . base64_encode($options['proxy_user'].":".$options['proxy_pass']);
+        }
+
+        if (isset($options['user'])) {
+            $this->setCredentials($options['user'], $options['pass']);
+        }
+
+        $this->headers['User-Agent'] = $this->_userAgent;
+        $this->headers['Host'] = $this->urlparts['host'];
+        $this->headers['Content-Type'] = "text/xml; charset=$this->encoding";
+        $this->headers['Content-Length'] = strlen($msg);
+        $this->headers['SOAPAction'] = "\"$action\"";
+        if (isset($options['headers'])) {
+            $this->headers = array_merge($this->headers, $options['headers']);
+        }
+
+        $this->cookies = array();
+        if (!isset($options['nocookies']) || !$options['nocookies']) {
+            // add the cookies we got from the last request
+            if (isset($this->result_cookies)) {
+                foreach ($this->result_cookies as $cookie) {
+                    if ($cookie['domain'] == $this->urlparts['host'])
+                        $this->cookies[$cookie['name']]=$cookie['value'];
+                }
+            }
+        }
+        // add cookies the user wants to set
+        if (isset($options['cookies'])) {
+            foreach ($options['cookies'] as $cookie) {
+                if ($cookie['domain'] == $this->urlparts['host'])
+                    $this->cookies[$cookie['name']]=$cookie['value'];
+            }
+        }
+        if (count($this->cookies)) {
+            $this->headers['Cookie'] = $this->_genCookieHeader();
+        }
+        $headers = '';
+        foreach ($this->headers as $k => $v) {
+            $headers .= "$k: $v\r\n";
+        }
+        $this->outgoing_payload =
+                "POST $fullpath HTTP/1.0\r\n".
+                $headers."\r\n".
+                $msg;
+        return $this->outgoing_payload;
+    }
+
+    /**
+     * Send outgoing request, and read/parse response
+     *
+     * @param string  &$msg   outgoing SOAP package
+     * @param string  $action   SOAP Action
+     * @return string &$response   response data, minus http headers
+     * @access private
+     */
+    function &_sendHTTP(&$msg, $options)
+    {
+        $this->incoming_payload = '';
+        $this->_getRequest($msg, $options);
+        $host = $this->urlparts['host'];
+        $port = $this->urlparts['port'];
+        if (isset($options['proxy_host'])) {
+            $host = $options['proxy_host'];
+            $port = isset($options['proxy_port']) ? $options['proxy_port'] : 8080;
+        }
+        // send
+        if ($this->timeout > 0) {
+            $fp = @fsockopen($host, $port, $this->errno, $this->errmsg, $this->timeout);
+        } else {
+            $fp = @fsockopen($host, $port, $this->errno, $this->errmsg);
+        }
+        if (!$fp) {
+            return $this->_raiseSoapFault("Connect Error to $host:$port");
+        }
+        if ($this->timeout > 0) {
+            // some builds of php do not support this, silence
+            // the warning
+            @socket_set_timeout($fp, $this->timeout);
+        }
+        if (!fputs($fp, $this->outgoing_payload, strlen($this->outgoing_payload))) {
+            return $this->_raiseSoapFault("Error POSTing Data to $host");
+        }
+
+        // get reponse
+        // XXX time consumer
+        do {
+            $data = fread($fp, 4096);
+            $_tmp_status = socket_get_status($fp);
+            if ($_tmp_status['timed_out']) {
+                return $this->_raiseSoapFault("Timed out read from $host");
+            } else {
+                $this->incoming_payload .= $data;
+            }
+        } while (!$_tmp_status['eof']);
+
+        fclose($fp);
+
+        if (!$this->_parseResponse()) {
+            return $this->fault;
+        }
+        return $this->response;
+    }
+
+    /**
+     * Send outgoing request, and read/parse response, via HTTPS
+     *
+     * @param string  &$msg   outgoing SOAP package
+     * @param string  $action   SOAP Action
+     * @return string &$response   response data, minus http headers
+     * @access private
+     */
+    function &_sendHTTPS(&$msg, $options)
+    {
+        /* NOTE This function uses the CURL functions
+         *  Your php must be compiled with CURL
+         */
+        if (!extension_loaded('curl')) {
+            return $this->_raiseSoapFault('CURL Extension is required for HTTPS');
+        }
+
+        $ch = curl_init();
+
+        if (isset($options['proxy_host'])) {
+            // $options['http_proxy'] == 'hostname:port'
+            $host = $options['proxy_host'];
+            $port = isset($options['proxy_port']) ? $options['proxy_port'] : 8080;
+            curl_setopt($ch, CURLOPT_PROXY, $host . ":" . $port);
+        }
+
+        if (isset($options['proxy_user'])) {
+            // $options['http_proxy_userpw'] == 'username:password'
+            curl_setopt($ch, CURLOPT_PROXYUSERPWD, $options['proxy_user'] . ':' . $options['proxy_pass']);
+        }
+
+        if (isset($options['user'])) {
+            curl_setopt($ch, CURLOPT_USERPWD, $options['user'] . ':' . $options['pass']);
+        }
+
+        if (!isset($options['soapaction'])) {
+            $options['soapaction'] = '';
+        }
+        curl_setopt($ch, CURLOPT_HTTPHEADER ,    array('Content-Type: text/xml;charset=' . $this->encoding, 'SOAPAction: "'.$options['soapaction'].'"'));
+        curl_setopt($ch, CURLOPT_USERAGENT ,     $this->_userAgent);
+
+        if ($this->timeout) {
+            curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); //times out after 4s
+        }
+
+        curl_setopt($ch, CURLOPT_POSTFIELDS,       $msg);
+        curl_setopt($ch, CURLOPT_URL,              $this->url);
+        curl_setopt($ch, CURLOPT_POST,             1);
+        curl_setopt($ch, CURLOPT_FAILONERROR,      0);
+        curl_setopt($ch, CURLOPT_FOLLOWLOCATION,   1);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER,   1);
+        curl_setopt($ch, CURLOPT_HEADER,           1);
+        if (defined('CURLOPT_HTTP_VERSION')) {
+            curl_setopt($ch, CURLOPT_HTTP_VERSION, 1);
+        }
+
+        if (isset($options['curl'])) {
+            foreach ($options['curl'] as $key => $val) {
+                curl_setopt($ch, $key, $val);
+            }
+        }
+
+        // Save the outgoing XML. This doesn't quite match _sendHTTP
+        // as CURL generates the headers, but having the XML is
+        // usually the most important part for tracing/debugging.
+        $this->outgoing_payload = $msg;
+
+        $this->incoming_payload = curl_exec($ch);
+        if (!$this->incoming_payload) {
+            $m = 'curl_exec error ' . curl_errno($ch) . ' ' . curl_error($ch);
+            curl_close($ch);
+            return $this->_raiseSoapFault($m);
+        }
+        curl_close($ch);
+
+        if (!$this->_parseResponse()) {
+            return $this->fault;
+        }
+
+        return $this->response;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/SMTP.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/SMTP.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/SMTP.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,215 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>                           |
+// +----------------------------------------------------------------------+
+//
+// $Id: SMTP.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+// Status: rough draft, untested
+//
+// TODO:
+//  switch to pear mail stuff
+//  smtp authentication
+//  smtp ssl support
+//  ability to define smtp options (encoding, from, etc.)
+//
+
+require_once 'Services/PayPal/SOAP/Base.php';
+require_once 'Mail/smtp.php';
+
+/**
+ *  SMTP Transport for SOAP
+ *
+ * implements SOAP-SMTP as defined at
+ * http://www.pocketsoap.com/specs/smtpbinding/
+ *
+ * TODO: use PEAR smtp and Mime classes
+ *
+ * @access public
+ * @package SOAP::Transport::SMTP
+ * @author Shane Caraveo <shane at php.net>
+ */
+class SOAP_Transport_SMTP extends SOAP_Base
+{
+
+    var $credentials = '';
+    var $timeout = 4; // connect timeout
+    var $urlparts = NULL;
+    var $url = '';
+    var $incoming_payload = '';
+    var $_userAgent = SOAP_LIBRARY_NAME;
+    var $encoding = SOAP_DEFAULT_ENCODING;
+    var $host = '127.0.0.1';
+    var $port = 25;
+    var $auth = NULL;
+    /**
+    * SOAP_Transport_SMTP Constructor
+    *
+    * @param string $URL    mailto:address
+    *
+    * @access public
+    */
+    function SOAP_Transport_SMTP($URL, $encoding='US-ASCII')
+    {
+        parent::SOAP_Base('SMTP');
+        $this->encoding = $encoding;
+        $this->urlparts = @parse_url($URL);
+        $this->url = $URL;
+    }
+
+    /**
+    * send and receive soap data
+    *
+    * @param string &$msg       outgoing post data
+    * @param string $action      SOAP Action header data
+    * @param int $timeout  socket timeout, default 0 or off
+    *
+    * @return string &$response   response data, minus http headers
+    * @access public
+    */
+    function send(&$msg,  /*array*/ $options = NULL)
+    {
+        $this->incoming_payload = '';
+        $this->outgoing_payload = &$msg;
+        if (!$this->_validateUrl()) {
+            return $this->fault;
+        }
+        if (!$options || !array_key_exists('from',$options)) {
+            return $this->_raiseSoapFault("No FROM address to send message with");
+        }
+
+        if (isset($options['host'])) $this->host = $options['host'];
+        if (isset($options['port'])) $this->port = $options['port'];
+        if (isset($options['auth'])) $this->auth = $options['auth'];
+        if (isset($options['username'])) $this->username = $options['username'];
+        if (isset($options['password'])) $this->password = $options['password'];
+
+        $headers = array();
+        $headers['From'] = $options['from'];
+        $headers['X-Mailer'] = $this->_userAgent;
+        $headers['MIME-Version'] = '1.0';
+        $headers['Message-ID'] = md5(time()).'.soap@'.$this->host;
+        $headers['To'] = $this->urlparts['path'];
+        if (array_key_exists('soapaction', $options)) {
+            $headers['Soapaction'] = "\"{$options['soapaction']}\"";
+        }
+
+        if (isset($options['headers']))
+            $headers = array_merge($headers, $options['headers']);
+
+        // if the content type is already set, we assume that Mime encoding
+        // is already done
+        if (isset($headers['Content-Type'])) {
+            $out = $msg;
+        } else {
+            // do a simple inline Mime encoding
+            $headers['Content-Disposition'] = 'inline';
+            $headers['Content-Type'] = "text/xml; charset=\"$this->encoding\"";
+            if (array_key_exists('transfer-encoding', $options)) {
+                if (strcasecmp($options['transfer-encoding'],'quoted-printable')==0) {
+                    $headers['Content-Transfer-Encoding'] = $options['transfer-encoding'];
+                    $out = &$msg;
+                } else if (strcasecmp($options['transfer-encoding'],'base64')==0) {
+                    $headers['Content-Transfer-Encoding'] = 'base64';
+                    $out = chunk_split(base64_encode($msg),76,"\n");
+                } else {
+                    return $this->_raiseSoapFault("Invalid Transfer Encoding: {$options['transfer-encoding']}");
+                }
+            } else {
+                // default to base64
+                $headers['Content-Transfer-Encoding'] = 'base64';
+                $out = chunk_split(base64_encode($msg));
+            }
+        }
+
+        $headers['Subject'] = array_key_exists('subject', $options) ? $options['subject'] : 'SOAP Message';
+
+        foreach ($headers as $key => $value) {
+            $header_text .= "$key: $value\n";
+        }
+        $this->outgoing_payload = $header_text."\r\n".$this->outgoing_payload;
+        # we want to return a proper XML message
+
+        $mailer_params = array(
+            'host' => $this->host,
+            'port' => $this->port,
+            'username' => $this->username,
+            'password' => $this->password,
+            'auth' => $this->auth
+        );
+        $mailer =& new Mail_smtp($mailer_params);
+        $result = $mailer->send($this->urlparts['path'], $headers, $out);
+        #$result = mail($this->urlparts['path'], $headers['Subject'], $out, $header_text);
+
+        if (!PEAR::isError($result)) {
+            $val =& new SOAP_Value('Message-ID','string',$headers['Message-ID']);
+        } else {
+            $sval[] =& new SOAP_Value('faultcode','QName','SOAP-ENV:Client');
+            $sval[] =& new SOAP_Value('faultstring','string',"couldn't send SMTP message to {$this->urlparts['path']}");
+            $val =& new SOAP_Value('Fault','Struct',$sval);
+        }
+
+        $mqname =& new QName($method, $namespace);
+        $methodValue =& new SOAP_Value('Response', 'Struct', array($val));
+
+        $this->incoming_payload =& $this->_makeEnvelope($methodValue, $this->headers, $this->encoding);
+
+        return $this->incoming_payload;
+    }
+
+    /**
+    * set data for http authentication
+    * creates Authorization header
+    *
+    * @param string $username   username
+    * @param string $password   response data, minus http headers
+    *
+    * @return none
+    * @access public
+    */
+    function setCredentials($username, $password)
+    {
+        $this->username = $username;
+        $this->password = $password;
+    }
+
+    // private members
+
+    /**
+    * validate url data passed to constructor
+    *
+    * @return boolean
+    * @access private
+    */
+    function _validateUrl()
+    {
+        if ( ! is_array($this->urlparts) ) {
+            $this->_raiseSoapFault("Unable to parse URL $url");
+            return FALSE;
+        }
+        if (!isset($this->urlparts['scheme']) ||
+            strcasecmp($this->urlparts['scheme'], 'mailto') != 0) {
+                $this->_raiseSoapFault("Unable to parse URL $url");
+                return FALSE;
+        }
+        if (!isset($this->urlparts['path'])) {
+            $this->_raiseSoapFault("Unable to parse URL $url");
+            return FALSE;
+        }
+        return TRUE;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/TCP.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/TCP.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport/TCP.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Hanna <iordy_at_iordy_dot_com>                        |
+// +----------------------------------------------------------------------+
+//
+// $Id: TCP.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+require_once 'Services/PayPal/SOAP/Base.php';
+
+/**
+ *  TCP Transport for SOAP
+ *
+ * TODO:
+ *   use Net_Socket
+ *   implement some security scheme
+ *   implement support for attachments
+ *
+ *
+ * @access public
+ * @package SOAP::Transport::TCP
+ * @author Shane Hanna <iordy_at_iordy_dot_com>
+ */
+class SOAP_Transport_TCP extends SOAP_Base_Object
+{
+
+    var $headers = array();
+    var $urlparts = NULL;
+    var $url = '';
+    var $incoming_payload = '';
+    var $_userAgent = SOAP_LIBRARY_NAME;
+    var $encoding = SOAP_DEFAULT_ENCODING;
+    var $result_encoding = 'UTF-8';
+    var $result_content_type;
+
+    /**
+     * socket
+     */
+    var $socket = '';
+
+    /**
+     * SOAP_Transport_TCP Constructor
+     *
+     * @param string $URL    http url to soap endpoint
+     *
+     * @access public
+     */
+    function SOAP_Transport_TCP($URL, $encoding = SOAP_DEFAULT_ENCODING)
+    {
+        parent::SOAP_Base_Object('TCP');
+        $this->urlparts = @parse_url($URL);
+        $this->url = $URL;
+        $this->encoding = $encoding;
+    }
+
+    function _socket_ping()
+    {
+        // XXX how do we restart after socket_shutdown?
+        //if (!$this->socket) {
+            # create socket resource
+            $this->socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
+            if ($this->socket < 0) return 0;
+
+            # connect
+            $result = socket_connect($this->socket, $this->urlparts['host'], $this->urlparts['port']);
+            if ($result < 0) return 0;
+        //}
+        return 1;
+    }
+
+    /**
+     * send and receive soap data
+     *
+     * @param string &$msg       outgoing post data
+     * @param string $action      SOAP Action header data
+     *
+     * @return string|fault response
+     * @access public
+     */
+    function &send(&$msg, $options = NULL)
+    {
+        $this->incoming_payload = '';
+        $this->outgoing_payload = &$msg;
+        if (!$this->_validateUrl()) return $this->fault;
+
+        // check for TCP scheme
+        if (strcasecmp($this->urlparts['scheme'], 'TCP') == 0) {
+            // check connection
+            if (!$this->_socket_ping())
+                return $this->_raiseSoapFault('error on '.$this->url.' reason '.socket_strerror(socket_last_error($this->socket)));
+
+            // write to the socket
+            if (!@socket_write($this->socket, $this->outgoing_payload, strlen($this->outgoing_payload))) {
+                return $this->_raiseSoapFault('Error sending data to '.$this->url.' reason '.socket_strerror(socket_last_error($this->socket)));
+            }
+
+            // shutdown writing
+            if(!socket_shutdown($this->socket, 1))
+                return $this->_raiseSoapFault("can't change socket mode to read.");
+
+            // read everything we can.
+            while($buf = @socket_read($this->socket, 1024, PHP_BINARY_READ)) {
+                $this->incoming_payload .= $buf;
+            }
+
+            // return payload or die
+            if ($this->incoming_payload)
+                return $this->incoming_payload;
+
+            return $this->_raiseSoapFault("Error reveiving data from ".$this->url);
+        }
+
+        return $this->_raiseSoapFault('Invalid url scheme '.$this->url);
+    }
+
+    /**
+     * validate url data passed to constructor
+     *
+     * @return boolean
+     * @access private
+     */
+    function _validateUrl()
+    {
+        if ( ! is_array($this->urlparts) ) {
+            $this->_raiseSoapFault("Unable to parse URL $url");
+            return FALSE;
+        }
+        if (!isset($this->urlparts['host'])) {
+            $this->_raiseSoapFault("No host in URL $url");
+            return FALSE;
+        }
+        if (!isset($this->urlparts['path']) || !$this->urlparts['path'])
+            $this->urlparts['path'] = '/';
+        return TRUE;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Transport.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: Transport.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+
+require_once 'Services/PayPal/SOAP/Base.php';
+
+/**
+ * SOAP Transport Layer
+ *
+ * This layer can use different protocols dependant on the endpoint url provided
+ * no knowlege of the SOAP protocol is available at this level
+ * no knowlege of the transport protocols is available at this level
+ *
+ * @access   public
+ * @package  SOAP::Transport
+ * @author   Shane Caraveo <shane at php.net>
+ */
+class SOAP_Transport
+{
+    function &getTransport($url, $encoding = SOAP_DEFAULT_ENCODING)
+    {
+        $urlparts = @parse_url($url);
+
+        if (!$urlparts['scheme']) {
+            return SOAP_Base_Object::_raiseSoapFault("Invalid transport URI: $url");
+        }
+
+        if (strcasecmp($urlparts['scheme'], 'mailto') == 0) {
+            $transport_type = 'SMTP';
+        } elseif (strcasecmp($urlparts['scheme'], 'https') == 0) {
+            $transport_type = 'HTTP';
+        } else {
+            /* handle other transport types */
+            $transport_type = strtoupper($urlparts['scheme']);
+        }
+        $transport_include = 'Services/PayPal/SOAP/Transport/' . $transport_type . '.php';
+        $res = @include_once($transport_include);
+        if (!$res && !in_array($transport_include, get_included_files())) {
+            return SOAP_Base_Object::_raiseSoapFault("No Transport for {$urlparts['scheme']}");
+        }
+        $transport_class = "SOAP_Transport_$transport_type";
+        if (!class_exists($transport_class)) {
+            return SOAP_Base_Object::_raiseSoapFault("No Transport class $transport_class");
+        }
+        return $t =& new $transport_class($url, $encoding);
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/dateTime.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/dateTime.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/dateTime.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,154 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: dateTime.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+class SOAP_Type_dateTime
+{
+    var $ereg_iso8601 = '(-?[0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]*)?(Z|[+\-][0-9]{4}|[+\-][0-9]{2}:[0-9]{2})?';
+        #"(-?[0-9]{4})-".  // centuries & years CCYY-
+        #"([0-9]{2})-".  // months MM-
+        #"([0-9]{2})".    // days DD
+        #"T".                    // separator T
+        #"([0-9]{2}):".  // hours hh:
+        #"([0-9]{2}):".  // minutes mm:
+        #"([0-9]{2})(\.[0-9]*)?". // seconds ss.ss...
+        #"(Z|[+\-][0-9]{4}|[+\-][0-9]{2}:[0-9]{2})?"; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
+        # if no 8th reg (Z) assumes UTC
+    var $timestamp = -1;
+    
+    function SOAP_Type_dateTime($date = -1)
+    {
+        if ($date == -1) $date = time();
+
+        if (gettype($date) == 'integer') {
+            $this->timestamp = $date;
+        } else {
+            $this->timestamp = $this->toUnixtime($date);
+        }
+    }
+    
+    function toSOAP($date = NULL)
+    {
+        return $this->toUTC($date);
+    }
+    
+    function toString($timestamp = 0)
+    {
+        if (!$timestamp) $timestamp = $this->timestamp;
+        if ($timestamp < 0) return 0;
+
+        return date('Y-m-d\TH:i:sO',$timestamp);
+    }
+    
+    function _split($datestr)
+    {
+        if (!$datestr)
+            $datestr = $this->toString();
+        else if (gettype($datestr) == 'integer')
+            $datestr = $this->toString($datestr);
+            
+        if (ereg($this->ereg_iso8601,$datestr,$regs)) {
+            if ($regs[8] != '' && $regs[8] != 'Z') {
+                $op = substr($regs[8],0,1);
+                $h = substr($regs[8],1,2);
+                if (strstr($regs[8],':')) {
+                    $m = substr($regs[8],4,2);
+                } else {
+                    $m = substr($regs[8],3,2);
+                }
+                if ($op == '+') {
+                    $regs[4] = $regs[4] - $h;
+                    if ($regs[4] < 0) $regs[4] += 24;
+                    $regs[5] = $regs[5] - $m;
+                    if ($regs[5] < 0) $regs[5] += 60;
+                } else {
+                    $regs[4] = $regs[4] + $h;
+                    if ($regs[4] > 23) $regs[4] -= 24;
+                    $regs[5] = $regs[5] + $m;
+                    if ($regs[5] > 59) $regs[5] -= 60;
+                }
+            }
+            return $regs;
+        }
+        return FALSE;
+    }
+    
+    function toUTC($datestr = NULL)
+    {
+        $regs = $this->_split($datestr);
+
+        if ($regs) {
+            return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
+        }
+
+        return '';
+    }
+
+    function toUnixtime($datestr = NULL)
+    {
+        $regs = $this->_split($datestr);
+        if ($regs) {
+            return strtotime("$regs[1]-$regs[2]-$regs[3] $regs[4]:$regs[5]:$regs[6]Z");
+        }
+        return -1;
+    }
+
+    function compare($date1, $date2 = NULL)
+    {
+        if ($date2 === null) {
+            $date2 = $date1;
+            $date1 = $this->timestamp;
+        }
+        if (!is_numeric($date1))
+            $date1 = $this->toUnixtime($date1);
+        if (!is_numeric($date2))
+            $date2 = $this->toUnixtime($date2);
+        if ($date1 != -1 && $date2 != -1) return $date1 - $date2;
+        return -1;
+    }
+    
+    function _test($orig = '2001-04-25T09:31:41-0700')
+    {
+        $utc = $this->toUTC($orig);
+        $ts1 = $this->toUnixtime($orig);
+        $ts2 = $this->toUnixtime($utc);
+        $b1 = $this->toString($ts1);
+        $b2 = $this->toString($ts2);
+        print "orig: $orig\n";
+        print "orig toUTC: $utc\n";
+        print "orig ts: $ts1\n";
+        print "utc ts: $ts2\n";
+        print "orig ts back: $b1\n";
+        print "utc ts back: $b2\n";
+        if ($b1 != $orig || $b2 != $orig) {
+            echo "Error in iso8601 conversions\n";
+        } else {
+            echo "dateTime OK\n";
+        }
+    }
+}
+
+# these should all match
+#$d = new SOAP_Type_dateTime();
+#echo $d->compare("2001-04-25T20:31:41Z","2001-04-25T20:31:41Z")."\n";
+#echo $d->compare("2001-04-25T20:31:41Z","2001-04-25T12:31:41-0800")."\n";
+#echo $d->compare("2001-04-25T20:31:41Z","2001-04-25T12:31:41-08:00")."\n";
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/duration.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/duration.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/duration.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,165 @@
+<?php
+/*
+http://www.w3.org/TR/xmlschema-2/
+
+[Definition:]   duration represents a duration of time. The value space of
+duration is a six-dimensional space where the coordinates designate the
+Gregorian year, month, day, hour, minute, and second components
+defined in  5.5.3.2 of [ISO 8601], respectively. These components are
+ordered in their significance by their order of appearance i.e. as year,
+month, day, hour, minute, and second. 
+
+3.2.6.1 Lexical representation
+The lexical representation for duration is the [ISO 8601] extended
+format PnYn MnDTnH nMnS, where nY represents the number of
+years, nM the number of months, nD the number of days, 'T' is the
+date/time separator, nH the number of hours, nM the number of
+minutes and nS the number of seconds. The number of seconds
+can include decimal digits to arbitrary precision.
+
+The values of the Year, Month, Day, Hour and Minutes components
+are not restricted but allow an arbitrary integer. Similarly, the
+value of the Seconds component allows an arbitrary decimal.
+Thus, the lexical representation of duration does not follow the
+alternative format of  5.5.3.2.1 of [ISO 8601].
+
+An optional preceding minus sign ('-') is allowed, to indicate a
+negative duration. If the sign is omitted a positive duration is
+indicated. See also ISO 8601 Date and Time Formats (D). 
+
+For example, to indicate a duration of 1 year, 2 months, 3 days,
+10 hours, and 30 minutes, one would write: P1Y2M3DT10H30M.
+One could also indicate a duration of minus 120 days as: -P120D. 
+
+Reduced precision and truncated representations of this format
+are allowed provided they conform to the following: 
+
+If the number of years, months, days, hours, minutes, or seconds
+in any expression equals zero, the number and its corresponding
+designator *may* be omitted. However, at least one number and
+its designator *must* be present. 
+The seconds part *may* have a decimal fraction. 
+The designator 'T' shall be absent if all of the time items are absent.
+The designator 'P' must always be present. 
+For example, P1347Y, P1347M and P1Y2MT2H are all allowed; P0Y1347M
+and P0Y1347M0D are allowed. P-1347M is not allowed although -P1347M
+is allowed. P1Y2MT is not allowed. 
+
+*/
+
+/* this is only an aproximation of duration, more work still to do.
+   see above schema url for more info on duration
+   
+   TODO: figure out best aproximation for year and month conversion to seconds
+*/
+   
+$ereg_duration = '(-)?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?T?([0-9]+H)?([0-9]+M)?([0-9]+S)?';
+class SOAP_Type_duration
+{
+    // format PnYnMnDTnHnMnS
+    function unix_to_duration($seconds) {
+        return SOAP_Type_duration::getduration($seconds);
+    }
+    
+    function mod($a, $b, &$d, &$r) {
+        $d = floor( $a / $b );
+        $r = $a % $b;
+    }
+    
+    function getduration($seconds) {
+        $neg = '';
+        if ($seconds < 0) {
+            $neg = '-';
+            $seconds = $seconds * -1;
+        }
+        
+        $_mi = 60;
+        $_h = $_mi * 60;
+        $_d = $_h * 24;
+        // XXX how do we properly handle month and year values?
+        $_m = $_d * 30;
+        $_y = $_d * 365;
+
+        SOAP_Type_duration::mod($seconds, $_y, $y, $seconds);
+        SOAP_Type_duration::mod($seconds, $_m, $m, $seconds);
+        SOAP_Type_duration::mod($seconds, $_d, $d, $seconds);
+        SOAP_Type_duration::mod($seconds, $_h, $h, $seconds);
+        SOAP_Type_duration::mod($seconds, $_mi, $mi, $s);
+        
+        $duration = $neg.'P';
+        if ($y) $duration .= $y.'Y';
+        if ($m) $duration .= $m.'M';
+        if ($d) $duration .= $d.'D';
+        if ($h || $mi || $s) $duration .='T';
+        if ($h) $duration .= $h.'H';
+        if ($mi) $duration .= $mi.'M';
+        if ($s) $duration .= $s.'S';
+        if ($duration == 'P' || $duration == '-P') $duration = 'PT0S';
+        return $duration;
+    }
+    
+    function mkduration($n, $Y, $Mo, $D, $H, $Mi, $S) {
+        $_mi = 60;
+        $_h = $_mi * 60;
+        $_d = $_h * 24;
+        // XXX how do we properly handle month and year values?
+        $_m = $_d * 30;
+        $_y = $_d * 365;
+        
+        $sec = $Y * $_y + $Mo * $_m + $D * $_d + $H * $_h + $Mi * $_mi + $S;
+        if ($n == '-') $sec = $sec * -1;
+        return $sec;
+    }
+    
+    function duration_to_unix($duration) {
+        global $ereg_duration;
+        if (ereg($ereg_duration,$duration,$regs)) {
+            return SOAP_Type_duration::mkduration($regs[1], $regs[2], $regs[3], $regs[4], $regs[5], $regs[6], $regs[7]);
+        }
+        return FALSE;
+    }
+    
+    function is_duration($duration) {
+        global $ereg_duration;
+        return ereg($ereg_duration,$duration,$regs);
+    }
+    
+    function _test($time) {
+        if (SOAP_Type_duration::is_duration($time)) {
+            $t = SOAP_Type_duration::duration_to_unix($time);
+            echo "Duration: $time is ".$t." seconds\n";
+        } else {
+            $t = SOAP_Type_duration::unix_to_duration($time);
+            echo "Seconds: $time is ".$t." duration\n";
+        }
+        return $t;
+    }
+    
+    function add($d1, $d2) {
+        $s1 = SOAP_Type_duration::duration_to_unix($d1);
+        $s2 = SOAP_Type_duration::duration_to_unix($d2);
+        return SOAP_Type_duration::unix_to_duration($s1 + $s2);
+    }
+    
+    function subtract($d1, $d2) {
+        $s1 = SOAP_Type_duration::duration_to_unix($d1);
+        $s2 = SOAP_Type_duration::duration_to_unix($d2);
+        return SOAP_Type_duration::unix_to_duration($s1 - $s2);
+    }
+
+}
+
+/* tests */
+
+$t = SOAP_Type_duration::_test('P1Y2M3DT10H30M');
+SOAP_Type_duration::_test($t);
+$t = SOAP_Type_duration::_test('-P120D');
+SOAP_Type_duration::_test($t);
+
+// duration since 1970
+$t = SOAP_Type_duration::_test(time());
+SOAP_Type_duration::_test($t);
+
+print "Add should be PT0S: ".SOAP_Type_duration::add('-P120D','P4M')."\n";
+print "Subtract should be PT0S: ".SOAP_Type_duration::subtract('P120D','P4M')."\n";
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/hexBinary.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/hexBinary.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Type/hexBinary.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: hexBinary.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+class SOAP_Type_hexBinary
+{
+    function to_bin($value)
+    {
+        $len = strlen($value);
+        return pack('H' . $len, $value);
+    }
+    function to_hex($value)
+    {
+        return bin2hex($value);
+    }
+    function is_hexbin($value)
+    {
+        # first see if there are any invalid chars
+        $l = strlen($value);
+
+        if ($l < 1 || strspn($value, '0123456789ABCDEFabcdef') != $l) return FALSE;
+
+        $bin = SOAP_Type_hexBinary::to_bin($value);
+        $hex = SOAP_Type_hexBinary::to_hex($bin);
+        return strcasecmp($value, $hex) == 0;
+    }
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Value.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Value.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/Value.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,229 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: Value.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+require_once 'Services/PayPal/SOAP/Base.php';
+
+/**
+ * SOAP::Value
+ *
+ * This class converts values between PHP and SOAP.
+ *
+ * Originally based on SOAPx4 by Dietrich Ayala
+ * http://dietrich.ganx4.com/soapx4
+ *
+ * @access public
+ * @package SOAP::Client
+ * @author Shane Caraveo <shane at php.net> Conversion to PEAR and updates
+ * @author Dietrich Ayala <dietrich at ganx4.com> Original Author
+ */
+class SOAP_Value
+{
+    /**
+     *
+     *
+     * @var  string
+     */
+    var $value = null;
+
+    /**
+     *
+     * @var  string
+     */
+    var $name = '';
+
+    /**
+     *
+     * @var  string
+     */
+    var $type = '';
+
+    /**
+     * Namespace
+     *
+     * @var  string
+     */
+    var $namespace = '';
+    var $type_namespace = '';
+
+    var $attributes = array();
+
+    /**
+     *
+     * @var string
+     */
+    var $arrayType = '';
+
+    var $options = array();
+
+    var $nqn;
+    var $tqn;
+
+    /**
+     * Constructor.
+     *
+     * @param string $name        name of the soap-value {namespace}name
+     * @param mixed  $type        soap value {namespace}type, if not set an automatic
+     * @param mixed  $value       value to set
+     * @param array  $attributes  (optional) Attributes.
+     */
+    function SOAP_Value($name = '', $type = false, $value = null, $attributes = array())
+    {
+        // Detect type if not passed.
+        $this->nqn =& new QName($name);
+        $this->name = $this->nqn->name;
+        $this->namespace = $this->nqn->namespace;
+        $this->tqn =& new QName($type);
+        $this->type = $this->tqn->name;
+        $this->type_prefix = $this->tqn->ns;
+        $this->type_namespace = $this->tqn->namespace;
+        $this->value =& $value;
+        $this->attributes = $attributes;
+    }
+
+    /**
+     * Serialize.
+     *
+     * @param SOAP_Base &$serializer  A SOAP_Base instance or subclass to serialize with.
+     *
+     * @return string  XML representation of $this.
+     */
+    function &serialize(&$serializer)
+    {
+        return $serializer->_serializeValue($this->value, $this->name, $this->type, $this->namespace, $this->type_namespace, $this->options, $this->attributes, $this->arrayType);
+    }
+
+}
+
+/**
+ * SOAP::Header
+ *
+ * This class converts values between PHP and SOAP. It is a simple
+ * wrapper around SOAP_Value, adding support for SOAP actor and
+ * mustunderstand parameters.
+ *
+ * Originally based on SOAPx4 by Dietrich Ayala
+ * http://dietrich.ganx4.com/soapx4
+ *
+ * @access public
+ * @package SOAP::Header
+ * @author Shane Caraveo <shane at php.net> Conversion to PEAR and updates
+ * @author Dietrich Ayala <dietrich at ganx4.com> Original Author
+ */
+class SOAP_Header extends SOAP_Value
+{
+    /**
+     * Constructor
+     *
+     * @param string  $name            name of the soap-value {namespace}name
+     * @param mixed   $type            soap value {namespace}type, if not set an automatic
+     * @param mixed   $value           value to set
+     * @param integer $mustunderstand  Zero or one.
+     * @param mixed   $attributes      (optional) Attributes.
+     */
+    function SOAP_Header($name = '', $type, $value,
+                         $mustunderstand = 0,
+                         $attributes = array())
+    {
+        if (!is_array($attributes)) {
+            $actor = $attributes;
+            $attributes = array();
+        }
+
+        parent::SOAP_Value($name, $type, $value, $attributes);
+
+        if (isset($actor)) {
+            $this->attributes['SOAP-ENV:actor'] = $actor;
+        } elseif (!isset($this->attributes['SOAP-ENV:actor'])) {
+            $this->attributes['SOAP-ENV:actor'] = 'http://schemas.xmlsoap.org/soap/actor/next';
+        }
+        $this->attributes['SOAP-ENV:mustUnderstand'] = (int)$mustunderstand;
+    }
+
+}
+
+/**
+ * SOAP::Attachment
+ * this class converts values between PHP and SOAP
+ * it handles Mime attachements per W3C Note on Soap Attachements at
+ * http://www.w3.org/TR/SOAP-attachments
+ *
+ *
+ * @access public
+ * @package SOAP::Attachment
+ * @author Shane Caraveo <shane at php.net> Conversion to PEAR and updates
+ */
+class SOAP_Attachment extends SOAP_Value
+{
+    /**
+     * Constructor
+     *
+     * @param    string  name of the soap-value <value_name>
+     * @param    mixed   soap header value
+     * @param    string namespace
+     */
+    function SOAP_Attachment($name = '', $type = 'application/octet-stream',
+                             $filename, $file = null)
+    {
+        global $SOAP_options;
+        if (!isset($SOAP_options['Mime'])) {
+            return PEAR::raiseError('Mail_mime is not installed, unable to support SOAP Attachements');
+        }
+        parent::SOAP_Value($name, null, null);
+
+        $filedata = ($file === null) ? $this->_file2str($filename) : $file;
+        $filename = basename($filename);
+        if (PEAR::isError($filedata)) {
+            return $filedata;
+        }
+
+        $cid = md5(uniqid(time()));
+
+        $this->attributes['href'] = 'cid:'.$cid;
+
+        $this->options['attachment'] = array(
+                                'body'     => $filedata,
+                                'disposition'     => $filename,
+                                'content_type'   => $type,
+                                'encoding' => 'base64',
+                                'cid' => $cid
+                               );
+    }
+
+    /**
+     * Returns the contents of the given file name as string
+     * @param string $file_name
+     * @return string
+     * @acces private
+     */
+    function &_file2str($file_name)
+    {
+        if (!is_readable($file_name)) {
+            return PEAR::raiseError('File is not readable ' . $file_name);
+        }
+        if (!$fd = fopen($file_name, 'rb')) {
+            return PEAR::raiseError('Could not open ' . $file_name);
+        }
+        $cont = fread($fd, filesize($file_name));
+        fclose($fd);
+        return $cont;
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/WSDL.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/WSDL.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/SOAP/WSDL.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,2120 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2003 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Shane Caraveo <Shane at Caraveo.com>   Port to PEAR and more   |
+// | Authors: Dietrich Ayala <dietrich at ganx4.com> Original Author         |
+// +----------------------------------------------------------------------+
+//
+// $Id: WSDL.php,v 1.19 2005/06/23 17:03:21 chagenbuch Exp $
+//
+require_once 'Services/PayPal/SOAP/Base.php';
+require_once 'Services/PayPal/SOAP/Fault.php';
+require_once 'HTTP/Request.php';
+
+define('WSDL_CACHE_MAX_AGE', 43200);
+define('WSDL_CACHE_USE',     0); // set to zero to turn off caching
+
+/**
+ * This class parses WSDL files, and can be used by SOAP::Client to
+ * properly register soap values for services.
+ *
+ * Originally based on SOAPx4 by Dietrich Ayala
+ * http://dietrich.ganx4.com/soapx4
+ *
+ * TODO:
+ *   add wsdl caching
+ *   refactor namespace handling ($namespace/$ns)
+ *   implement IDL type syntax declaration so we can generate WSDL
+ *
+ * @access public
+ * @package SOAP::Client
+ * @author Shane Caraveo <shane at php.net> Conversion to PEAR and updates
+ * @author Dietrich Ayala <dietrich at ganx4.com> Original Author
+ */
+class SOAP_WSDL extends SOAP_Base
+{
+    var $tns = null;
+    var $definition = array();
+    var $namespaces = array();
+    var $ns = array();
+    var $xsd = SOAP_XML_SCHEMA_VERSION;
+    var $complexTypes = array();
+    var $elements = array();
+    var $messages = array();
+    var $portTypes = array();
+    var $bindings = array();
+    var $imports = array();
+    var $services = array();
+    var $service = '';
+    var $uri = '';
+    var $docs = false;
+
+    /**
+     * Proxy parameters
+     *
+     * @var array
+     */
+    var $proxy = null;
+
+    var $trace = 0;
+
+    /**
+     * Use WSDL cache
+     *
+     * @var boolean
+     */
+    var $cacheUse = null;
+
+    /**
+     * Cache max lifetime (in seconds)
+     *
+     * @var int
+     */
+    var $cacheMaxAge = null;
+
+    /**
+     * Class to use for WSDL parsing. Can be overridden for special
+     * cases, subclasses, etc.
+     * @var string $wsdlParserClass
+     */
+    var $wsdlParserClass = 'SOAP_WSDL_Parser';
+
+    /**
+     * SOAP_WSDL constructor.
+     *
+     * @param string  $wsdl_uri     URL to WSDL file.
+     * @param array   $proxy        Contains options for HTTP_Request class (see HTTP/Request.php).
+     * @param boolean $cacheUse     Use WSDL caching. Defaults to false.
+     * @param integer $cacheMaxAge  Cache max lifetime (in seconds).
+     * @param boolean $docs         Parse documentation in the WSDL? Defaults to false.
+     *
+     * @access public
+     */
+    function SOAP_WSDL($wsdl_uri    = false,
+                       $proxy       = array(),
+                       $cacheUse    = WSDL_CACHE_USE,
+                       $cacheMaxAge = WSDL_CACHE_MAX_AGE,
+                       $docs        = false)
+    {
+        parent::SOAP_Base('WSDL');
+        $this->uri         = $wsdl_uri;
+        $this->proxy       = $proxy;
+        $this->cacheUse    = $cacheUse;
+        $this->cacheMaxAge = $cacheMaxAge;
+        $this->docs        = $docs;
+
+        if ($wsdl_uri) {
+            $this->parseURL($wsdl_uri);
+            reset($this->services);
+            $this->service = key($this->services);
+        }
+    }
+
+    function set_service($service)
+    {
+        if (array_key_exists($service, $this->services)) {
+            $this->service = $service;
+        }
+    }
+
+    /**
+     * @deprecated use parseURL instead
+     */
+    function parse($wsdl_uri, $proxy = array())
+    {
+        $this->parseURL($wsdl_uri, $proxy);
+    }
+
+    /**
+     * Fill the WSDL array tree with data from a WSDL file
+     *
+     * @param  string
+     * @param  array  proxy related parameters
+     * @return void
+     */
+    function parseURL($wsdl_uri, $proxy = array())
+    {
+        $parser =& new $this->wsdlParserClass($wsdl_uri, $this, $this->docs);
+
+        if ($parser->fault) {
+            $this->_raiseSoapFault($parser->fault);
+        }
+    }
+
+    /**
+     * Fill the WSDL array tree with data from one or more PHP class objects
+     *
+     * @param  mixed  $wsdl_obj An object or array of objects to add to the internal WSDL tree
+     * @param  string  $service_name Name of the WSDL <service>
+     * @param  string  $service_desc Optional description of the WSDL <service>
+     * @return void
+     */
+    function parseObject(&$wsdl_obj, $targetNamespace, $service_name, $service_desc = '')
+    {
+        $parser =& new SOAP_WSDL_ObjectParser($wsdl_obj, $this, $targetNamespace, $service_name, $service_desc);
+
+         if ($parser->fault) {
+             $this->_raiseSoapFault($parser->fault);
+         }
+    }
+
+    function getEndpoint($portName)
+    {
+        return (isset($this->services[$this->service]['ports'][$portName]['address']['location']))
+                ? $this->services[$this->service]['ports'][$portName]['address']['location']
+                : $this->_raiseSoapFault("no endpoint for port for $portName", $this->uri);
+    }
+
+    function _getPortName($operation, $service)
+    {
+        if (isset($this->services[$service]['ports'])) {
+            foreach ($this->services[$service]['ports'] as $port => $portAttrs) {
+                $type = $this->services[$service]['ports'][$port]['type'];
+                if ($type == 'soap' &&
+                    isset($this->bindings[$portAttrs['binding']]['operations'][$operation])) {
+                    return $port;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * find the name of the first port that contains an operation of
+     * name $operation.  always returns a the soap portName.
+     */
+    function getPortName($operation, $service = null)
+    {
+        if (!$service) $service = $this->service;
+        if (isset($this->services[$service]['ports'])) {
+            $portName = $this->_getPortName($operation, $service);
+            if ($portName) return $portName;
+        }
+        // Try any service in the WSDL.
+        foreach ($this->services as $serviceName => $service) {
+            if (isset($this->services[$serviceName]['ports'])) {
+                $portName = $this->_getPortName($operation, $serviceName);
+                if ($portName) {
+                    $this->service = $serviceName;
+                    return $portName;
+                }
+            }
+        }
+        return $this->_raiseSoapFault("no operation $operation in wsdl", $this->uri);
+    }
+
+    function getOperationData($portName, $operation)
+    {
+        if (isset($this->services[$this->service]['ports'][$portName]['binding'])
+            && $binding = $this->services[$this->service]['ports'][$portName]['binding']) {
+            // get operation data from binding
+            if (is_array($this->bindings[$binding]['operations'][$operation])) {
+                $opData = $this->bindings[$binding]['operations'][$operation];
+            }
+            // get operation data from porttype
+            $portType = $this->bindings[$binding]['type'];
+            if (!$portType) {
+                return $this->_raiseSoapFault("no port type for binding $binding in wsdl " . $this->uri);
+            }
+            if (is_array($this->portTypes[$portType][$operation])) {
+                if (isset($this->portTypes[$portType][$operation]['parameterOrder']))
+                    $opData['parameterOrder'] = $this->portTypes[$portType][$operation]['parameterOrder'];
+                $opData['input'] = array_merge($opData['input'], $this->portTypes[$portType][$operation]['input']);
+                $opData['output'] = array_merge($opData['output'], $this->portTypes[$portType][$operation]['output']);
+            }
+            if (!$opData)
+                return $this->_raiseSoapFault("no operation $operation for port $portName, in wsdl", $this->uri);
+            $opData['parameters'] = false;
+            if (isset($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace']))
+                $opData['namespace'] = $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace'];
+            // message data from messages
+            $inputMsg = $opData['input']['message'];
+            if (is_array($this->messages[$inputMsg])) {
+                foreach ($this->messages[$inputMsg] as $pname => $pattrs) {
+                    if ($opData['style'] == 'document' && $opData['input']['use'] == 'literal'
+                        && $pname == 'parameters') {
+                        $opData['parameters'] = true;
+                        $opData['namespace'] = $this->namespaces[$pattrs['namespace']];
+                        $el = $this->elements[$pattrs['namespace']][$pattrs['type']];
+                        if (isset($el['elements'])) {
+                            foreach ($el['elements'] as $elname => $elattrs) {
+                                $opData['input']['parts'][$elname] = $elattrs;
+                            }
+                        }
+                    } else {
+                        $opData['input']['parts'][$pname] = $pattrs;
+                    }
+                }
+            }
+            $outputMsg = $opData['output']['message'];
+            if (is_array($this->messages[$outputMsg])) {
+                foreach ($this->messages[$outputMsg] as $pname => $pattrs) {
+                    if ($opData['style'] == 'document' && $opData['output']['use'] == 'literal'
+                        && $pname == 'parameters') {
+
+                        $el = $this->elements[$pattrs['namespace']][$pattrs['type']];
+                        if (isset($el['elements'])) {
+                            foreach ($el['elements'] as $elname => $elattrs) {
+                                $opData['output']['parts'][$elname] = $elattrs;
+                            }
+                        }
+                    } else {
+                        $opData['output']['parts'][$pname] = $pattrs;
+                    }
+                }
+            }
+            return $opData;
+        }
+        return $this->_raiseSoapFault("no binding for port $portName in wsdl", $this->uri);
+    }
+
+    function matchMethod(&$operation)
+    {
+        // Overloading lowercases function names :(
+        foreach ($this->services[$this->service]['ports'] as $port => $portAttrs) {
+            foreach (array_keys($this->bindings[$portAttrs['binding']]['operations']) as $op) {
+                if (strcasecmp($op, $operation) == 0) {
+                    $operation = $op;
+                }
+            }
+        }
+    }
+
+    /**
+     * getDataHandler
+     *
+     * Given a datatype, what function handles the processing?
+     * this is used for doc/literal requests where we receive
+     * a datatype, and we need to pass it to a method in out
+     * server class
+     *
+     * @param string datatype
+     * @param string namespace
+     * @returns string methodname
+     * @access public
+     */
+    function getDataHandler($datatype, $namespace)
+    {
+        // see if we have an element by this name
+        if (isset($this->namespaces[$namespace]))
+            $namespace = $this->namespaces[$namespace];
+        if (isset($this->ns[$namespace])) {
+            $nsp = $this->ns[$namespace];
+            //if (!isset($this->elements[$nsp]))
+            //    $nsp = $this->namespaces[$nsp];
+            if (isset($this->elements[$nsp][$datatype])) {
+                $checkmessages = array();
+                // find what messages use this datatype
+                foreach ($this->messages as $messagename => $message) {
+                    foreach ($message as $partname => $part) {
+                        if ($part['type'] == $datatype) {
+                            $checkmessages[] = $messagename;
+                            break;
+                        }
+                    }
+                }
+                // find the operation that uses this message
+                $dataHandler = null;
+                foreach($this->portTypes as $portname => $porttype) {
+                    foreach ($porttype as $opname => $opinfo) {
+                        foreach ($checkmessages as $messagename) {
+                            if ($opinfo['input']['message'] == $messagename) {
+                                return $opname;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    function getSoapAction($portName, $operation)
+    {
+        if (isset($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['soapAction']) &&
+            $soapAction = $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['soapAction']) {
+            return $soapAction;
+        }
+        return false;
+    }
+
+    function getNamespace($portName, $operation)
+    {
+        if (isset($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]) &&
+            isset($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace']) &&
+            $namespace = $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace']) {
+            return $namespace;
+        }
+        return false;
+    }
+
+    function getNamespaceAttributeName($namespace)
+    {
+        /* If it doesn't exist at first, flip the array and check
+         * again. */
+        if (empty($this->ns[$namespace])) {
+            $this->ns = array_flip($this->namespaces);
+        }
+        /* If it doesn't exist now, add it. */
+        if (empty($this->ns[$namespace])) {
+            return $this->addNamespace($namespace);
+        }
+
+        return $this->ns[$namespace];
+    }
+
+    function addNamespace($namespace)
+    {
+        if (!empty($this->ns[$namespace])) {
+            return $this->ns[$namespace];
+        }
+
+        $n = count($this->ns);
+        $attr = 'ns' . $n;
+        $this->namespaces['ns' . $n] = $namespace;
+        $this->ns[$namespace] = $attr;
+        return $attr;
+    }
+
+    function _validateString($string)
+    {
+        // XXX this should be done sooner or later
+        // return true;
+        return preg_match("/^[\w_:#\/]+$/", $string);
+    }
+
+    function _addArg(&$args, &$argarray, $argname)
+    {
+        if ($args) {
+            $args .= ', ';
+        }
+        $args .= "\$" . $argname;
+        if (!$this->_validateString($argname)) {
+            return null;
+        }
+        if ($argarray) {
+            $argarray .= ', ';
+        }
+        $argarray .= "\"$argname\" => \$" . $argname;
+    }
+
+    function _elementArg(&$args, &$argarray, &$_argtype, $_argname)
+    {
+        $comments = '';
+        $el = $this->elements[$_argtype['namespace']][$_argtype['type']];
+        $tns = isset($this->ns[$el['namespace']]) ? $this->ns[$el['namespace']] : $_argtype['namespace'];
+
+        if (!empty($el['complex']) || (isset($el['type']) && isset($this->complexTypes[$tns][$el['type']]))) {
+            // The element is a complex type.
+            $comments .= "        // {$_argtype['type']} is a ComplexType, refer to the WSDL for more info.\n";
+            $attrname = "{$_argtype['type']}_attr";
+            if (isset($el['type']) && isset($this->complexTypes[$tns][$el['type']]['attribute'])) {
+                $comments .= "        // {$_argtype['type']} may require attributes, refer to the WSDL for more info.\n";
+            }
+            $comments .= "        \${$attrname}['xmlns'] = '{$this->namespaces[$_argtype['namespace']]}';\n";
+            $comments .= "        \${$_argtype['type']} =& new SOAP_Value('{$_argtype['type']}', false, \${$_argtype['type']}, \$$attrname);\n";
+            $this->_addArg($args, $argarray, $_argtype['type']);
+            if (isset($el['type']) && isset($this->complexTypes[$tns][$el['type']]['attribute'])) {
+                if ($args) {
+                    $args .= ', ';
+                }
+                $args .= '$' . $attrname;
+            }
+        } elseif (isset($el['elements'])) {
+            foreach ($el['elements'] as $ename => $element) {
+                $comments .= "        \$$ename =& new SOAP_Value('{{$this->namespaces[$element['namespace']]}}$ename', '" .
+                    (isset($element['type']) ? $element['type'] : false) . "', \$$ename);\n";
+                $this->_addArg($args, $argarray, $ename);
+            }
+        } else {
+            $comments .= "        \$$_argname =& new SOAP_Value('{{$this->namespaces[$tns]}}$_argname', '{$el['type']}', \$$_argname);\n";
+            $this->_addArg($args, $argarray, $_argname);
+        }
+
+        return $comments;
+    }
+
+    function _complexTypeArg(&$args, &$argarray, &$_argtype, $_argname)
+    {
+        $comments = '';
+        if (isset($this->complexTypes[$_argtype['namespace']][$_argtype['type']])) {
+            $comments  = "        // $_argname is a ComplexType {$_argtype['type']},\n";
+            $comments .= "        // refer to wsdl for more info\n";
+            if (isset($this->complexTypes[$_argtype['namespace']][$_argtype['type']]['attribute'])) {
+                $comments .= "        // $_argname may require attributes, refer to wsdl for more info\n";
+            }
+            $wrapname = '{' . $this->namespaces[$_argtype['namespace']].'}' . $_argtype['type'];
+            $comments .= "        \$$_argname =& new SOAP_Value('$_argname', '$wrapname', \$$_argname);\n";
+        }
+
+        $this->_addArg($args, $argarray, $_argname);
+        return $comments;
+    }
+
+    /**
+     * Generates stub code from the WSDL that can be saved to a file
+     * or eval'd into existence.
+     */
+    function generateProxyCode($port = '', $classname='')
+    {
+        $multiport = count($this->services[$this->service]['ports']) > 1;
+        if (!$port) {
+            reset($this->services[$this->service]['ports']);
+            $port = current($this->services[$this->service]['ports']);
+        }
+        // XXX currently do not support HTTP ports
+        if ($port['type'] != 'soap') {
+            return null;
+        }
+
+        // XXX currentPort is BAD
+        $clienturl = $port['address']['location'];
+        if (!$classname) {
+            if ($multiport || $port) {
+                $classname = 'WebService_' . $this->service . '_' . $port['name'];
+            } else {
+                $classname = 'WebService_' . $this->service;
+            }
+            $classname = preg_replace('/[ .\-\(\)]+/', '_', $classname);
+        }
+
+        if (!$this->_validateString($classname)) {
+            return null;
+        }
+
+        if (is_array($this->proxy) && count($this->proxy)) {
+            $class = "class $classname extends SOAP_Client\n{\n" .
+            "    function $classname(\$path = \"$clienturl\")\n{\n" .
+            "        \$this->SOAP_Client(\$path, 0, 0,
+                    array(";
+
+            foreach ($this->proxy as $key => $val) {
+                if (is_array($val)) {
+                    $class .= "\"$key\" => array(";
+                    foreach ($val as $key2 => $val2) {
+                        $class .= "\"$key2\" => \"$val2\",";
+                    }
+                    $class .= ')';
+                } else {
+                    $class .= "\"$key\" => \"$val\",";
+                }
+            }
+            $class .= "));\n }\n";
+            $class = str_replace(',))', '))', $class);
+        } else {
+            $class = "class $classname extends SOAP_Client\n{\n" .
+            "    function $classname(\$path = \"$clienturl\")\n    {\n" .
+            "        \$this->SOAP_Client(\$path, 0);\n" .
+            "    }\n";
+        }
+
+        // get the binding, from that get the port type
+        $primaryBinding = $port['binding']; //$this->services[$this->service]['ports'][$port['name']]["binding"];
+        $primaryBinding = preg_replace("/^(.*:)/", '', $primaryBinding);
+        $portType = $this->bindings[$primaryBinding]['type'];
+        $portType = preg_replace("/^(.*:)/", '', $portType);
+        $style = $this->bindings[$primaryBinding]['style'];
+
+        // XXX currentPortType is BAD
+        foreach ($this->portTypes[$portType] as $opname => $operation) {
+            $soapaction = isset($this->bindings[$primaryBinding]['operations'][$opname]['soapAction']) ?
+                $this->bindings[$primaryBinding]['operations'][$opname]['soapAction'] :
+                null;
+            if (isset($this->bindings[$primaryBinding]['operations'][$opname]['style'])) {
+                $opstyle = $this->bindings[$primaryBinding]['operations'][$opname]['style'];
+            } else {
+                $opstyle = $style;
+            }
+            $use = $this->bindings[$primaryBinding]['operations'][$opname]['input']['use'];
+            if ($use == 'encoded') {
+                $namespace = $this->bindings[$primaryBinding]['operations'][$opname]['input']['namespace'];
+            } else {
+                $bindingType = $this->bindings[$primaryBinding]['type'];
+                $ns = $this->portTypes[$bindingType][$opname]['input']['namespace'];
+                $namespace = $this->namespaces[$ns];
+            }
+
+            $args = '';
+            $argarray = '';
+            $comments = '';
+            $wrappers = '';
+            foreach ($operation['input'] as $argname => $argtype) {
+                if ($argname == 'message') {
+                    foreach ($this->messages[$argtype] as $_argname => $_argtype) {
+                        if ($opstyle == 'document' && $use == 'literal' &&
+                            $_argtype['name'] == 'parameters') {
+                            // The type or element refered to is used
+                            // for parameters.
+                            $elattrs = null;
+                            $element = $_argtype['element'];
+                            $el = $this->elements[$_argtype['namespace']][$_argtype['type']];
+
+                            if ($el['complex']) {
+                                $namespace = $this->namespaces[$_argtype['namespace']];
+                                // XXX need to wrap the parameters in
+                                // a soap_value.
+                            }
+                            if (isset($el['elements'])) {
+                                foreach ($el['elements'] as $elname => $elattrs) {
+                                    // Is the element a complex type?
+                                    if (isset($this->complexTypes[$elattrs['namespace']][$elname])) {
+                                        $comments .= $this->_complexTypeArg($args, $argarray, $_argtype, $_argname);
+                                    } else {
+                                        $this->_addArg($args, $argarray, $elname);
+                                    }
+                                }
+                            }
+                            if ($el['complex'] && $argarray) {
+                                $wrapname = '{' . $this->namespaces[$_argtype['namespace']].'}' . $el['name'];
+                                $comments .= "        \${$el['name']} =& new SOAP_Value('$wrapname', false, \$v = array($argarray));\n";
+                                $argarray = "'{$el['name']}' => \${$el['name']}";
+                            }
+                        } else {
+                            if (isset($_argtype['element'])) {
+                                // Element argument.
+                                $comments .= $this->_elementArg($args, $argarray, $_argtype, $_argtype['type']);
+                            } else {
+                                // Complex type argument.
+                                $comments .= $this->_complexTypeArg($args, $argarray, $_argtype, $_argname);
+                            }
+                        }
+                    }
+                }
+            }
+
+            // Validate entries.
+
+            // Operation names are function names, so try to make sure
+            // it's legal. This could potentially cause collisions,
+            // but let's try to make everything callable and see how
+            // many problems that causes.
+            $opname_php = preg_replace('/[ .\-\(\)]+/', '_', $opname);
+            if (!$this->_validateString($opname_php)) {
+                return null;
+            }
+
+            if ($argarray) {
+                $argarray = "array($argarray)";
+            } else {
+                $argarray = 'null';
+            }
+
+            $class .= "    function &$opname_php($args)\n    {\n$comments$wrappers" .
+                "        return \$this->call('$opname',\n" .
+                "                           \$v = $argarray,\n" .
+                "                           array('namespace' => '$namespace',\n" .
+                "                                 'soapaction' => '$soapaction',\n" .
+                "                                 'style' => '$opstyle',\n" .
+                "                                 'use' => '$use'" .
+                ($this->trace?",\n                                 'trace' => 1" : '') . "));\n" .
+                "    }\n";
+        }
+
+        $class .= "}\n";
+        return $class;
+    }
+
+    function generateAllProxies()
+    {
+        $proxycode = '';
+        foreach (array_keys($this->services[$this->service]['ports']) as $key) {
+            $port =& $this->services[$this->service]['ports'][$key];
+            $proxycode .= $this->generateProxyCode($port);
+        }
+        return $proxycode;
+    }
+
+    function &getProxy($port = '', $name = '')
+    {
+        $multiport = count($this->services[$this->service]['ports']) > 1;
+
+        if (!$port) {
+            reset($this->services[$this->service]['ports']);
+            $port = current($this->services[$this->service]['ports']);
+        }
+
+        if ($multiport || $port) {
+            $classname = 'WebService_' . $this->service . '_' . $port['name'];
+        } else {
+            $classname = 'WebService_' . $this->service;
+        }
+
+        if ($name) {
+            $classname = $name . '_' . $classname;
+        }
+
+        $classname = preg_replace('/[ .\-\(\)]+/', '_', $classname);
+        if (!class_exists($classname)) {
+            $proxy = $this->generateProxyCode($port, $classname);
+            require_once 'Services/PayPal/SOAP/Client.php';
+            eval($proxy);
+        }
+
+        return new $classname;
+    }
+
+    function &_getComplexTypeForElement($name, $namespace)
+    {
+        $t = null;
+        if (isset($this->ns[$namespace]) &&
+            isset($this->elements[$this->ns[$namespace]][$name]['type'])) {
+
+            $type = $this->elements[$this->ns[$namespace]][$name]['type'];
+            $ns = $this->elements[$this->ns[$namespace]][$name]['namespace'];
+
+            if (isset($this->complexTypes[$ns][$type])) {
+                $t = $this->complexTypes[$ns][$type];
+            }
+        }
+        return $t;
+    }
+
+    function getComplexTypeNameForElement($name, $namespace)
+    {
+        $t = $this->_getComplexTypeForElement($name, $namespace);
+        if ($t) {
+            return $t['name'];
+        }
+        return null;
+    }
+
+    function getComplexTypeChildType($ns, $name, $child_ns, $child_name)
+    {
+        // is the type an element?
+        $t = $this->_getComplexTypeForElement($name, $ns);
+        if ($t) {
+            // no, get it from complex types directly
+            if (isset($t['elements'][$child_name]['type']))
+                return $t['elements'][$child_name]['type'];
+        }
+        return null;
+    }
+
+    function getSchemaType($type, $name, $type_namespace)
+    {
+        // see if it's a complex type so we can deal properly with
+        // SOAPENC:arrayType.
+        if ($name && $type) {
+            // XXX TODO:
+            // look up the name in the wsdl and validate the type.
+            foreach ($this->complexTypes as $ns => $types) {
+                if (array_key_exists($type, $types)) {
+                    if (array_key_exists('type', $types[$type])) {
+                        list($arraytype_ns, $arraytype, $array_depth) = isset($types[$type]['arrayType'])?
+                            $this->_getDeepestArrayType($types[$type]['namespace'], $types[$type]['arrayType'])
+                            : array($this->namespaces[$types[$type]['namespace']], null, 0);
+                        return array($types[$type]['type'], $arraytype, $arraytype_ns, $array_depth);
+                    }
+                    if (array_key_exists('arrayType', $types[$type])) {
+                        list($arraytype_ns, $arraytype, $array_depth) =
+                            $this->_getDeepestArrayType($types[$type]['namespace'], $types[$type]['arrayType']);
+                        return array('Array', $arraytype, $arraytype_ns, $array_depth);
+                    }
+                    if (array_key_exists('elements', $types[$type]) &&
+                        array_key_exists($name, $types[$type]['elements'])) {
+                        $type = $types[$type]['elements']['type'];
+                        return array($type, null, $this->namespaces[$types[$type]['namespace']], null);
+                    }
+                }
+            }
+        }
+        if ($type && $type_namespace) {
+            $arrayType = null;
+            // XXX TODO:
+            // this code currently handles only one way of encoding array types in wsdl
+            // need to do a generalized function to figure out complex types
+            $p = $this->ns[$type_namespace];
+            if ($p &&
+                array_key_exists($p, $this->complexTypes) &&
+                array_key_exists($type, $this->complexTypes[$p])) {
+                if ($arrayType = $this->complexTypes[$p][$type]['arrayType']) {
+                    $type = 'Array';
+                } elseif ($this->complexTypes[$p][$type]['order']=='sequence' &&
+                          array_key_exists('elements', $this->complexTypes[$p][$type])) {
+                    reset($this->complexTypes[$p][$type]['elements']);
+                    // assume an array
+                    if (count($this->complexTypes[$p][$type]['elements']) == 1) {
+                        $arg = current($this->complexTypes[$p][$type]['elements']);
+                        $arrayType = $arg['type'];
+                        $type = 'Array';
+                    } else {
+                        foreach ($this->complexTypes[$p][$type]['elements'] as $element) {
+                            if ($element['name'] == $type) {
+                                $arrayType = $element['type'];
+                                $type = $element['type'];
+                            }
+                        }
+                    }
+                } else {
+                    $type = 'Struct';
+                }
+                return array($type, $arrayType, $type_namespace, null);
+            }
+        }
+        return array(null, null, null, null);
+    }
+
+    /**
+     * Recurse through the WSDL structure looking for the innermost
+     * array type of multi-dimensional arrays.
+     *
+     * Takes a namespace prefix and a type, which can be in the form
+     * 'type' or 'type[]', and returns the full namespace URI, the
+     * type of the most deeply nested array type found, and the number
+     * of levels of nesting.
+     *
+     * @access private
+     * @return mixed array or nothing
+     */
+    function _getDeepestArrayType($nsPrefix, $arrayType)
+    {
+        static $trail = array();
+
+        $arrayType = ereg_replace('\[\]$', '', $arrayType);
+
+        // Protect against circular references
+        // XXX We really need to remove trail from this altogether (it's very inefficient and
+        // in the wrong place!) and put circular reference checking in when the WSDL info
+        // is generated in the first place
+        if (array_search($nsPrefix . ':' . $arrayType, $trail)) {
+            return array(null, null, -count($trail));
+        }
+
+        if (array_key_exists($nsPrefix, $this->complexTypes) &&
+            array_key_exists($arrayType, $this->complexTypes[$nsPrefix]) &&
+            array_key_exists('arrayType', $this->complexTypes[$nsPrefix][$arrayType])) {
+            $trail[] = $nsPrefix . ':' . $arrayType;
+            $result = $this->_getDeepestArrayType($this->complexTypes[$nsPrefix][$arrayType]['namespace'],
+                                                  $this->complexTypes[$nsPrefix][$arrayType]['arrayType']);
+            return array($result[0], $result[1], $result[2] + 1);
+        }
+        return array($this->namespaces[$nsPrefix], $arrayType, 0);
+    }
+
+}
+
+class SOAP_WSDL_Cache extends SOAP_Base
+{
+    // Cache settings
+
+    /**
+     * Use WSDL cache
+     *
+     * @var boolean
+     */
+    var $_cacheUse = null;
+
+    /**
+     * Cache max lifetime (in seconds)
+     *
+     * @var int
+     */
+    var $_cacheMaxAge = null;
+
+    /**
+     * SOAP_WSDL_Cache constructor
+     *
+     * @param  boolean use caching
+     * @param  int     cache max lifetime (in seconds)
+     * @access public
+     */
+    function SOAP_WSDL_Cache($cacheUse = WSDL_CACHE_USE,
+                             $cacheMaxAge = WSDL_CACHE_MAX_AGE)
+    {
+        parent::SOAP_Base('WSDLCACHE');
+        $this->_cacheUse = $cacheUse;
+        $this->_cacheMaxAge = $cacheMaxAge;
+    }
+
+    /**
+     * _cacheDir
+     * return the path to the cache, if it doesn't exist, make it
+     */
+    function _cacheDir()
+    {
+        $dir = getenv("WSDLCACHE");
+        if (!$dir) $dir = " ./wsdlcache";
+        @mkdir($dir, 0700);
+        return $dir;
+    }
+
+    /**
+     * Retrieves a file from cache if it exists, otherwise retreive from net,
+     * add to cache, and return from cache.
+     *
+     * @param  string   URL to WSDL
+     * @param  array    proxy parameters
+     * @param  int      expected MD5 of WSDL URL
+     * @access public
+     * @return string  data
+     */
+    function get($wsdl_fname, $proxy_params = array(), $cache = 0)
+    {
+        $cachename = $md5_wsdl = $file_data = '';
+        if ($this->_cacheUse) {
+            // Try to retrieve WSDL from cache
+            $cachename = SOAP_WSDL_Cache::_cacheDir() . '/' . md5($wsdl_fname). ' .wsdl';
+            if (file_exists($cachename)) {
+                $wf = fopen($cachename, 'rb');
+                if ($wf) {
+                    // Reading cached file
+                    $file_data = fread($wf, filesize($cachename));
+                    $md5_wsdl = md5($file_data);
+                    fclose($wf);
+                }
+                if ($cache) {
+                    if ($cache != $md5_wsdl) {
+                        return $this->_raiseSoapFault('WSDL Checksum error!', $wsdl_fname);
+                    }
+                } else {
+                    $fi = stat($cachename);
+                    $cache_mtime = $fi[8];
+                    //print cache_mtime, time()
+                    if ($cache_mtime + $this->_cacheMaxAge < time()) {
+                        // expired
+                        $md5_wsdl = ''; // refetch
+                    }
+                }
+            }
+        }
+
+        if (!$md5_wsdl) {
+            // Not cached or not using cache. Retrieve WSDL from URL
+
+            // is it a local file?
+            // this section should be replace by curl at some point
+            if (!preg_match('/^(https?|file):\/\//', $wsdl_fname)) {
+                if (!file_exists($wsdl_fname)) {
+                    return $this->_raiseSoapFault("Unable to read local WSDL $wsdl_fname", $wsdl_fname);
+                }
+                if (function_exists('file_get_contents')) {
+                    $file_data = file_get_contents($wsdl_fname);
+                } else {
+                    $file_data = implode('',file($wsdl_fname));
+                }
+            } else {
+                $uri = explode('?', $wsdl_fname);
+                $rq =& new HTTP_Request($uri[0], $proxy_params);
+                // the user agent HTTP_Request uses fouls things up
+                if (isset($uri[1])) {
+                    $rq->addRawQueryString($uri[1]);
+                }
+
+                if (isset($proxy_params['proxy_host']) &&
+                    isset($proxy_params['proxy_port']) &&
+                    isset($proxy_params['proxy_user']) &&
+                    isset($proxy_params['proxy_pass'])) {
+                    $rq->setProxy($proxy_params['proxy_host'], $proxy_params['proxy_port'],
+                                  $proxy_params['proxy_user'], $proxy_params['proxy_pass']);
+                } elseif (isset($proxy_params['proxy_host']) &&
+                          isset($proxy_params['proxy_port'])) {
+                    $rq->setProxy($proxy_params['proxy_host'], $proxy_params['proxy_port']);
+                }
+
+                $result = $rq->sendRequest();
+                if (PEAR::isError($result)) {
+                    return $this->_raiseSoapFault("Unable to retrieve WSDL $wsdl_fname," . $rq->getResponseCode(), $wsdl_fname);
+                }
+                $file_data = $rq->getResponseBody();
+                if (!$file_data) {
+                    return $this->_raiseSoapFault("Unable to retrieve WSDL $wsdl_fname, no http body", $wsdl_fname);
+                }
+            }
+
+            $md5_wsdl = md5($file_data);
+
+            if ($this->_cacheUse) {
+                $fp = fopen($cachename, "wb");
+                fwrite($fp, $file_data);
+                fclose($fp);
+            }
+        }
+        if ($this->_cacheUse && $cache && $cache != $md5_wsdl) {
+            return $this->_raiseSoapFault("WSDL Checksum error!", $wsdl_fname);
+        }
+        return $file_data;
+    }
+
+}
+
+class SOAP_WSDL_Parser extends SOAP_Base
+{
+
+    /**
+     * Define internal arrays of bindings, ports, operations,
+     * messages, etc.
+     */
+    var $currentMessage;
+    var $currentOperation;
+    var $currentPortType;
+    var $currentBinding;
+    var $currentPort;
+
+    /**
+     * Parser vars.
+     */
+    var $cache;
+
+    var $tns = null;
+    var $soapns = array('soap');
+    var $uri = '';
+    var $wsdl = null;
+
+    var $status = '';
+    var $element_stack = array();
+    var $parentElement = '';
+
+    var $schema = '';
+    var $schemaStatus = '';
+    var $schema_stack = array();
+    var $currentComplexType;
+    var $schema_element_stack = array();
+    var $currentElement;
+
+    /**
+     * constructor
+     */
+    function SOAP_WSDL_Parser($uri, &$wsdl, $docs = false)
+    {
+        parent::SOAP_Base('WSDLPARSER');
+        $this->cache =& new SOAP_WSDL_Cache($wsdl->cacheUse, $wsdl->cacheMaxAge);
+        $this->uri = $uri;
+        $this->wsdl = &$wsdl;
+        $this->docs = $docs;
+        $this->parse($uri);
+    }
+
+    function parse($uri)
+    {
+        // Check whether content has been read.
+        $fd = $this->cache->get($uri, $this->wsdl->proxy);
+        if (PEAR::isError($fd)) {
+            return $this->_raiseSoapFault($fd);
+        }
+
+        // Create an XML parser.
+        $parser = xml_parser_create();
+        xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
+        xml_set_object($parser, $this);
+        xml_set_element_handler($parser, 'startElement', 'endElement');
+        if ($this->docs) {
+            xml_set_character_data_handler($parser, 'characterData');
+        }
+
+        if (!xml_parse($parser, $fd, true)) {
+            $detail = sprintf('XML error on line %d: %s',
+                              xml_get_current_line_number($parser),
+                              xml_error_string(xml_get_error_code($parser)));
+            return $this->_raiseSoapFault("Unable to parse WSDL file $uri\n$detail");
+        }
+        xml_parser_free($parser);
+        return true;
+    }
+
+    /**
+     * start-element handler
+     */
+    function startElement($parser, $name, $attrs)
+    {
+        // Get element prefix.
+        $qname =& new QName($name);
+        if ($qname->ns) {
+            $ns = $qname->ns;
+            if ($ns && ((!$this->tns && strcasecmp($qname->name, 'definitions') == 0) || $ns == $this->tns)) {
+                $name = $qname->name;
+            }
+        }
+        $this->currentTag = $qname->name;
+        $this->parentElement = '';
+        $stack_size = count($this->element_stack);
+        if ($stack_size) {
+            $this->parentElement = $this->element_stack[$stack_size - 1];
+        }
+        $this->element_stack[] = $this->currentTag;
+
+        // Find status, register data.
+        switch ($this->status) {
+        case 'types':
+            // sect 2.2 wsdl:types
+            // children: xsd:schema
+            $parent_tag = '';
+            $stack_size = count($this->schema_stack);
+            if ($stack_size) {
+                $parent_tag = $this->schema_stack[$stack_size - 1];
+            }
+
+            switch ($qname->name) {
+            case 'schema':
+                // No parent should be in the stack.
+                if (!$parent_tag || $parent_tag == 'types') {
+                    if (array_key_exists('targetNamespace', $attrs)) {
+                        $this->schema = $this->wsdl->getNamespaceAttributeName($attrs['targetNamespace']);
+                    } else {
+                        $this->schema = $this->wsdl->getNamespaceAttributeName($this->wsdl->tns);
+                    }
+                    $this->wsdl->complexTypes[$this->schema] = array();
+                    $this->wsdl->elements[$this->schema] = array();
+                }
+                break;
+
+            case 'complexType':
+                if ($parent_tag == 'schema') {
+                    $this->currentComplexType = $attrs['name'];
+                    if (!isset($attrs['namespace'])) {
+                        $attrs['namespace'] = $this->schema;
+                    }
+                    $this->wsdl->complexTypes[$this->schema][$this->currentComplexType] = $attrs;
+                    if (array_key_exists('base', $attrs)) {
+                        $qn =& new QName($attrs['base']);
+                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = $qn->name;
+                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['namespace'] = $qn->ns;
+                    } else {
+                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct';
+                    }
+                    $this->schemaStatus = 'complexType';
+                } else {
+                    $this->wsdl->elements[$this->schema][$this->currentElement]['complex'] = true;
+                }
+                break;
+
+            case 'element':
+                if (isset($attrs['type'])) {
+                    $qn =& new QName($attrs['type']);
+                    $attrs['type'] = $qn->name;
+                    if ($qn->ns && array_key_exists($qn->ns, $this->wsdl->namespaces)) {
+                        $attrs['namespace'] = $qn->ns;
+                    }
+                }
+
+                $parentElement = '';
+                $stack_size = count($this->schema_element_stack);
+                if ($stack_size > 0) {
+                    $parentElement = $this->schema_element_stack[$stack_size - 1];
+                }
+
+                if (isset($attrs['ref'])) {
+                    $qn =& new QName($attrs['ref']);
+                    $this->currentElement = $qn->name;
+                } else {
+                    $this->currentElement = $attrs['name'];
+                }
+                $this->schema_element_stack[] = $this->currentElement;
+                if (!isset($attrs['namespace'])) {
+                    $attrs['namespace'] = $this->schema;
+                }
+
+                if ($parent_tag == 'schema') {
+                    $this->wsdl->elements[$this->schema][$this->currentElement] = $attrs;
+                    $this->wsdl->elements[$this->schema][$this->currentElement]['complex'] = false;
+                    $this->schemaStatus = 'element';
+                } elseif ($this->currentComplexType) {
+                    // we're inside a complexType
+                    if ((isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order']) &&
+                         $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] == 'sequence')
+                        && $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] == 'Array') {
+                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['arrayType'] = isset($attrs['type']) ? $attrs['type'] : null;
+                    }
+                    $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['elements'][$this->currentElement] = $attrs;
+                } else {
+                    $this->wsdl->elements[$this->schema][$parentElement]['elements'][$this->currentElement] = $attrs;
+                }
+                break;
+
+            case 'complexContent':
+            case 'simpleContent':
+                break;
+
+            case 'extension':
+            case 'restriction':
+                if ($this->schemaStatus == 'complexType') {
+                    if (!empty($attrs['base'])) {
+                        $qn =& new QName($attrs['base']);
+                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = $qn->name;
+
+                        // Types that extend from other types aren't
+                        // *of* those types. Reflect this by denoting
+                        // which type they extend. I'm leaving the
+                        // 'type' setting here since I'm not sure what
+                        // removing it might break at the moment.
+                        if ($qname->name == 'extension') {
+                            $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['extends'] = $qn->name;
+                        }
+                    } else {
+                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct';
+                    }
+                }
+                break;
+
+            case 'sequence':
+                if ($this->schemaStatus == 'complexType') {
+                    $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] = $qname->name;
+                    if (!isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'])) {
+                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Array';
+                    }
+                }
+                break;
+
+            case 'all':
+                $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] = $qname->name;
+                if (!isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'])) {
+                    $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct';
+                }
+                break;
+
+            case 'choice':
+                $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['order'] = $qname->name;
+                if (!isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'])) {
+                    $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Array';
+                }
+
+            case 'attribute':
+                if ($this->schemaStatus == 'complexType') {
+                    if (isset($attrs['name'])) {
+                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['attribute'][$attrs['name']] = $attrs;
+                    } else {
+                        if (isset($attrs['ref'])) {
+                            $q =& new QName($attrs['ref']);
+                            foreach ($attrs as $k => $v) {
+                                if ($k != 'ref' && strstr($k, $q->name)) {
+                                    $vq =& new QName($v);
+                                    if ($q->name == 'arrayType') {
+                                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType][$q->name] = $vq->name. $vq->arrayInfo;
+                                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Array';
+                                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['namespace'] = $vq->ns;
+                                    } else {
+                                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType][$q->name] = $vq->name;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                break;
+            }
+
+            $this->schema_stack[] = $qname->name;
+            break;
+
+        case 'message':
+            // sect 2.3 wsdl:message child wsdl:part
+            switch ($qname->name) {
+            case 'part':
+                $qn = null;
+                if (isset($attrs['type'])) {
+                    $qn =& new QName($attrs['type']);
+                } elseif (isset($attrs['element'])) {
+                    $qn =& new QName($attrs['element']);
+                }
+                if ($qn) {
+                    $attrs['type'] = $qn->name;
+                    $attrs['namespace'] = $qn->ns;
+                }
+                $this->wsdl->messages[$this->currentMessage][$attrs['name']] = $attrs;
+                // error in wsdl
+
+            case 'documentation':
+                break;
+
+            default:
+                break;
+            }
+            break;
+
+        case 'portType':
+            // sect 2.4
+            switch ($qname->name) {
+            case 'operation':
+                // attributes: name
+                // children: wsdl:input wsdl:output wsdl:fault
+                $this->currentOperation = $attrs['name'];
+                $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation] = $attrs;
+                break;
+
+            case 'input':
+            case 'output':
+            case 'fault':
+                // wsdl:input wsdl:output wsdl:fault
+                // attributes: name message parameterOrder(optional)
+                if ($this->currentOperation) {
+                    if (isset($this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name])) {
+                        $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name] = array_merge($this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name], $attrs);
+                    } else {
+                        $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name] = $attrs;
+                    }
+                    if (array_key_exists('message', $attrs)) {
+                        $qn =& new QName($attrs['message']);
+                        $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name]['message'] = $qn->name;
+                        $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation][$name]['namespace'] = $qn->ns;
+                    }
+                }
+                break;
+
+            case 'documentation':
+                break;
+
+            default:
+                break;
+            }
+            break;
+
+        case 'binding':
+            $ns = $qname->ns ? $this->wsdl->namespaces[$qname->ns] : SCHEMA_WSDL;
+            switch ($ns) {
+            case SCHEMA_SOAP:
+                // this deals with wsdl section 3 soap binding
+                switch ($qname->name) {
+                case 'binding':
+                    // sect 3.3
+                    // soap:binding, attributes: transport(required), style(optional, default = document)
+                    // if style is missing, it is assumed to be 'document'
+                    if (!isset($attrs['style'])) {
+                        $attrs['style'] = 'document';
+                    }
+                    $this->wsdl->bindings[$this->currentBinding] = array_merge($this->wsdl->bindings[$this->currentBinding], $attrs);
+                    break;
+
+                case 'operation':
+                    // sect 3.4
+                    // soap:operation, attributes: soapAction(required), style(optional, default = soap:binding:style)
+                    if (!isset($attrs['style'])) {
+                        $attrs['style'] = $this->wsdl->bindings[$this->currentBinding]['style'];
+                    }
+                    if (isset($this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation])) {
+                        $this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation] = array_merge($this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation], $attrs);
+                    } else {
+                        $this->wsdl->bindings[$this->currentBinding]['operations'][$this->currentOperation] = $attrs;
+                    }
+                    break;
+
+                case 'body':
+                    // sect 3.5
+                    // soap:body attributes:
+                    // part - optional.  listed parts must appear in body, missing means all parts appear in body
+                    // use - required. encoded|literal
+                    // encodingStyle - optional.  space seperated list of encodings (uri's)
+                    $this->wsdl->bindings[$this->currentBinding]
+                                    ['operations'][$this->currentOperation][$this->opStatus] = $attrs;
+                    break;
+
+                case 'fault':
+                    // sect 3.6
+                    // soap:fault attributes: name use  encodingStyle namespace
+                    $this->wsdl->bindings[$this->currentBinding]
+                                    ['operations'][$this->currentOperation][$this->opStatus] = $attrs;
+                    break;
+
+                case 'header':
+                    // sect 3.7
+                    // soap:header attributes: message part use encodingStyle namespace
+                    $this->wsdl->bindings[$this->currentBinding]
+                                    ['operations'][$this->currentOperation][$this->opStatus]['headers'][] = $attrs;
+                    break;
+
+                case 'headerfault':
+                    // sect 3.7
+                    // soap:header attributes: message part use encodingStyle namespace
+                    $header = count($this->wsdl->bindings[$this->currentBinding]
+                                    ['operations'][$this->currentOperation][$this->opStatus]['headers'])-1;
+                    $this->wsdl->bindings[$this->currentBinding]
+                                    ['operations'][$this->currentOperation][$this->opStatus]['headers'][$header]['fault'] = $attrs;
+                    break;
+
+                case 'documentation':
+                    break;
+
+                default:
+                    // error!  not a valid element inside binding
+                    break;
+                }
+                break;
+
+            case SCHEMA_WSDL:
+                // XXX verify correct namespace
+                // for now, default is the 'wsdl' namespace
+                // other possible namespaces include smtp, http, etc. for alternate bindings
+                switch ($qname->name) {
+                case 'operation':
+                    // sect 2.5
+                    // wsdl:operation attributes: name
+                    $this->currentOperation = $attrs['name'];
+                    break;
+
+                case 'output':
+                case 'input':
+                case 'fault':
+                    // sect 2.5
+                    // wsdl:input attributes: name
+                    $this->opStatus = $qname->name;
+                    break;
+
+                case 'documentation':
+                    break;
+
+                default:
+                    break;
+                }
+                break;
+
+            case SCHEMA_WSDL_HTTP:
+                switch ($qname->name) {
+                case 'binding':
+                    // sect 4.4
+                    // http:binding attributes: verb
+                    // parent: wsdl:binding
+                    $this->wsdl->bindings[$this->currentBinding] = array_merge($this->wsdl->bindings[$this->currentBinding], $attrs);
+                    break;
+
+                case 'operation':
+                    // sect 4.5
+                    // http:operation attributes: location
+                    // parent: wsdl:operation
+                    $this->wsdl->bindings[$this->currentBinding]['operations']
+                                                        [$this->currentOperation] = $attrs;
+                    break;
+
+                case 'urlEncoded':
+                    // sect 4.6
+                    // http:urlEncoded attributes: location
+                    // parent: wsdl:input wsdl:output etc.
+                    $this->wsdl->bindings[$this->currentBinding]['operations'][$this->opStatus]
+                                                        [$this->currentOperation]['uri'] = 'urlEncoded';
+                    break;
+
+                case 'urlReplacement':
+                    // sect 4.7
+                    // http:urlReplacement attributes: location
+                    // parent: wsdl:input wsdl:output etc.
+                    $this->wsdl->bindings[$this->currentBinding]['operations'][$this->opStatus]
+                                                        [$this->currentOperation]['uri'] = 'urlReplacement';
+                    break;
+
+                case 'documentation':
+                    break;
+
+                default:
+                    // error
+                    break;
+                }
+
+            case SCHEMA_MIME:
+                // sect 5
+                // all mime parts are children of wsdl:input, wsdl:output, etc.
+                // unsuported as of yet
+                switch ($qname->name) {
+                case 'content':
+                    // sect 5.3 mime:content
+                    // <mime:content part="nmtoken"? type="string"?/>
+                    // part attribute only required if content is child of multipart related,
+                    //        it contains the name of the part
+                    // type attribute contains the mime type
+                case 'multipartRelated':
+                    // sect 5.4 mime:multipartRelated
+                case 'part':
+                case 'mimeXml':
+                    // sect 5.6 mime:mimeXml
+                    // <mime:mimeXml part="nmtoken"?/>
+                    //
+                case 'documentation':
+                    break;
+
+                default:
+                    // error
+                    break;
+                }
+
+            case SCHEMA_DIME:
+                // DIME is defined in:
+                // http://gotdotnet.com/team/xml_wsspecs/dime/WSDL-Extension-for-DIME.htm
+                // all DIME parts are children of wsdl:input, wsdl:output, etc.
+                // unsuported as of yet
+                switch ($qname->name) {
+                case 'message':
+                    // sect 4.1 dime:message
+                    // appears in binding section
+                    $this->wsdl->bindings[$this->currentBinding]['dime'] = $attrs;
+                    break;
+
+                default:
+                    break;
+                }
+
+            default:
+                break;
+            }
+            break;
+
+        case 'service':
+            $ns = $qname->ns ? $this->wsdl->namespaces[$qname->ns] : SCHEMA_WSDL;
+
+            switch ($qname->name) {
+            case 'port':
+                // sect 2.6 wsdl:port attributes: name binding
+                $this->currentPort = $attrs['name'];
+                $this->wsdl->services[$this->currentService]['ports'][$this->currentPort] = $attrs;
+                // XXX hack to deal with binding namespaces
+                $qn =& new QName($attrs['binding']);
+                $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['binding'] = $qn->name;
+                $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['namespace'] = $qn->ns;
+                break;
+
+            case 'address':
+                $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['address'] = $attrs;
+                // what TYPE of port is it?  SOAP or HTTP?
+                $ns = $qname->ns ? $this->wsdl->namespaces[$qname->ns] : SCHEMA_WSDL;
+                switch ($ns) {
+                case SCHEMA_WSDL_HTTP:
+                    $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['type']='http';
+                    break;
+
+                case SCHEMA_SOAP:
+                    $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['type']='soap';
+                    break;
+
+                default:
+                    // Shouldn't happen, we'll assume SOAP.
+                    $this->wsdl->services[$this->currentService]['ports'][$this->currentPort]['type']='soap';
+                }
+
+                break;
+
+            case 'documentation':
+                break;
+
+            default:
+                break;
+            }
+        }
+
+        // Top level elements found under wsdl:definitions.
+        switch ($qname->name) {
+        case 'import':
+            // sect 2.1.1 wsdl:import attributes: namespace location
+            if ((isset($attrs['location']) || isset($attrs['schemaLocation'])) &&
+                !isset($this->wsdl->imports[$attrs['namespace']])) {
+                $uri = isset($attrs['location']) ? $attrs['location'] : $attrs['schemaLocation'];
+                $location = @parse_url($uri);
+                if (!isset($location['scheme'])) {
+                    $base = @parse_url($this->uri);
+                    $uri = $this->mergeUrl($base, $uri);
+                }
+
+                $this->wsdl->imports[$attrs['namespace']] = $attrs;
+                $import_parser_class = get_class($this);
+                $import_parser =& new $import_parser_class($uri, $this->wsdl, $this->docs);
+                if ($import_parser->fault) {
+                    unset($this->wsdl->imports[$attrs['namespace']]);
+                    return false;
+                }
+                $this->currentImport = $attrs['namespace'];
+            }
+            // Continue on to the 'types' case - lack of break; is
+            // intentional.
+
+        case 'types':
+            // sect 2.2 wsdl:types
+            $this->status = 'types';
+            break;
+
+        case 'schema':
+            // We can hit this at the top level if we've been asked to
+            // import an XSD file.
+            if (!empty($attrs['targetNamespace'])) {
+                $this->schema = $this->wsdl->getNamespaceAttributeName($attrs['targetNamespace']);
+            } else {
+                $this->schema = $this->wsdl->getNamespaceAttributeName($this->wsdl->tns);
+            }
+            $this->wsdl->complexTypes[$this->schema] = array();
+            $this->wsdl->elements[$this->schema] = array();
+            $this->schema_stack[] = $qname->name;
+            $this->status = 'types';
+            break;
+
+        case 'message':
+            // sect 2.3 wsdl:message attributes: name children:wsdl:part
+            $this->status = 'message';
+            if (isset($attrs['name'])) {
+                $this->currentMessage = $attrs['name'];
+                $this->wsdl->messages[$this->currentMessage] = array();
+            }
+            break;
+
+        case 'portType':
+            // sect 2.4 wsdl:portType
+            // attributes: name
+            // children: wsdl:operation
+            $this->status = 'portType';
+            $this->currentPortType = $attrs['name'];
+            $this->wsdl->portTypes[$this->currentPortType] = array();
+            break;
+
+        case 'binding':
+            // sect 2.5 wsdl:binding attributes: name type
+            // children: wsdl:operation soap:binding http:binding
+            if ($qname->ns && $qname->ns != $this->tns) {
+                break;
+            }
+            $this->status = 'binding';
+            $this->currentBinding = $attrs['name'];
+            $qn =& new QName($attrs['type']);
+            $this->wsdl->bindings[$this->currentBinding]['type'] = $qn->name;
+            $this->wsdl->bindings[$this->currentBinding]['namespace'] = $qn->ns;
+            break;
+
+        case 'service':
+            // sect 2.7 wsdl:service attributes: name children: ports
+            $this->currentService = $attrs['name'];
+            $this->wsdl->services[$this->currentService]['ports'] = array();
+            $this->status = 'service';
+            break;
+
+        case 'definitions':
+            // sec 2.1 wsdl:definitions
+            // attributes: name targetNamespace xmlns:*
+            // children: wsdl:import wsdl:types wsdl:message wsdl:portType wsdl:binding wsdl:service
+            $this->wsdl->definition = $attrs;
+            foreach ($attrs as $key => $value) {
+                if (strstr($key, 'xmlns:') !== false) {
+                    $qn =& new QName($key);
+                    // XXX need to refactor ns handling.
+                    $this->wsdl->namespaces[$qn->name] = $value;
+                    $this->wsdl->ns[$value] = $qn->name;
+                    if ($key == 'targetNamespace' ||
+                        strcasecmp($value,SOAP_SCHEMA) == 0) {
+                        $this->soapns[] = $qn->name;
+                    } else {
+                        if (in_array($value, $this->_XMLSchema)) {
+                            $this->wsdl->xsd = $value;
+                        }
+                    }
+                }
+            }
+            if (isset($ns) && $ns) {
+                $namespace = 'xmlns:' . $ns;
+                if (!$this->wsdl->definition[$namespace]) {
+                    return $this->_raiseSoapFault("parse error, no namespace for $namespace", $this->uri);
+                }
+                $this->tns = $ns;
+            }
+            break;
+        }
+    }
+
+    /**
+     * end-element handler.
+     */
+    function endElement($parser, $name)
+    {
+        $stacksize = count($this->element_stack);
+        if ($stacksize) {
+            if ($this->element_stack[$stacksize - 1] == 'definitions') {
+                $this->status = '';
+            }
+            array_pop($this->element_stack);
+        }
+
+        if (stristr($name, 'schema')) {
+            array_pop($this->schema_stack);
+            $this->schema = '';
+        }
+
+        if ($this->schema) {
+            array_pop($this->schema_stack);
+            if (count($this->schema_stack) <= 1) {
+                /* Correct the type for sequences with multiple
+                 * elements. */
+                if (isset($this->currentComplexType) && isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'])
+                    && $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] == 'Array'
+                    && array_key_exists('elements', $this->wsdl->complexTypes[$this->schema][$this->currentComplexType])
+                    && count($this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['elements']) > 1) {
+                        $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['type'] = 'Struct';
+                }
+            }
+            if (stristr($name, 'complexType')) {
+                $this->currentComplexType = '';
+                if (count($this->schema_element_stack)) {
+                    $this->currentElement = array_pop($this->schema_element_stack);
+                } else {
+                    $this->currentElement = '';
+                }
+            } elseif (stristr($name, 'element')) {
+                if (count($this->schema_element_stack)) {
+                    $this->currentElement = array_pop($this->schema_element_stack);
+                } else {
+                    $this->currentElement = '';
+                }
+            }
+        }
+    }
+
+    /**
+     * Element content handler.
+     */
+    function characterData($parser, $data)
+    {
+        // Store the documentation in the WSDL file.
+        if ($this->currentTag == 'documentation') {
+            $data = trim(preg_replace('/\s+/', ' ', $data));
+            if (!strlen($data)) {
+                return;
+            }
+
+            switch ($this->status) {
+            case 'service':
+                $ptr =& $this->wsdl->services[$this->currentService];
+                break;
+
+            case 'portType':
+                $ptr =& $this->wsdl->portTypes[$this->currentPortType][$this->currentOperation];
+                break;
+
+            case 'binding':
+                $ptr =& $this->wsdl->bindings[$this->currentBinding];
+                break;
+
+            case 'message':
+                $ptr =& $this->wsdl->messages[$this->currentMessage];
+                break;
+
+            case 'operation':
+                break;
+
+            case 'types':
+                if (isset($this->currentComplexType) &&
+                    isset($this->wsdl->complexTypes[$this->schema][$this->currentComplexType])) {
+                    if ($this->currentElement) {
+                        $ptr =& $this->wsdl->complexTypes[$this->schema][$this->currentComplexType]['elements'][$this->currentElement];
+                    } else {
+                        $ptr =& $this->wsdl->complexTypes[$this->schema][$this->currentComplexType];
+                    }
+                }
+                break;
+            }
+
+            if (isset($ptr)) {
+                if (!isset($ptr['documentation'])) {
+                    $ptr['documentation'] = '';
+                } else {
+                    $ptr['documentation'] .= ' ';
+                }
+                $ptr['documentation'] .= $data;
+            }
+        }
+    }
+
+    /**
+     * $parsed is an array returned by parse_url().
+     *
+     * @access private
+     */
+    function mergeUrl($parsed, $path)
+    {
+        if (!is_array($parsed)) {
+            return false;
+        }
+
+        $uri = '';
+        if (!empty($parsed['scheme'])) {
+            $sep = (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://');
+            $uri = $parsed['scheme'] . $sep;
+        }
+
+        if (isset($parsed['pass'])) {
+            $uri .= "$parsed[user]:$parsed[pass]@";
+        } elseif (isset($parsed['user'])) {
+            $uri .= "$parsed[user]@";
+        }
+
+        if (isset($parsed['host'])) {
+            $uri .= $parsed['host'];
+        }
+        if (isset($parsed['port'])) {
+            $uri .= ":$parsed[port]";
+        }
+        if ($path[0] != '/' && isset($parsed['path'])) {
+            if ($parsed['path'][strlen($parsed['path']) - 1] != '/') {
+                $path = dirname($parsed['path']) . '/' . $path;
+            } else {
+                $path = $parsed['path'] . $path;
+            }
+            $path = $this->_normalize($path);
+        }
+        $sep = $path[0] == '/' ? '' : '/';
+        $uri .= $sep . $path;
+
+        return $uri;
+    }
+
+    function _normalize($path_str)
+    {
+        $pwd = '';
+        $strArr = preg_split('/(\/)/', $path_str, -1, PREG_SPLIT_NO_EMPTY);
+        $pwdArr = '';
+        $j = 0;
+        for ($i = 0; $i < count($strArr); $i++) {
+            if ($strArr[$i] != ' ..') {
+                if ($strArr[$i] != ' .') {
+                    $pwdArr[$j] = $strArr[$i];
+                    $j++;
+                }
+            } else {
+                array_pop($pwdArr);
+                $j--;
+            }
+        }
+        $pStr = implode('/', $pwdArr);
+        $pwd = (strlen($pStr) > 0) ? ('/' . $pStr) : '/';
+        return $pwd;
+    }
+
+}
+
+/**
+ * Parses the types and methods used in web service objects into the internal
+ * data structures used by SOAP_WSDL.
+ *
+ * Assumes the SOAP_WSDL class is unpopulated to start with.
+ *
+ * @author Chris Coe <info at intelligentstreaming.com>
+ */
+class SOAP_WSDL_ObjectParser extends SOAP_Base
+{
+    /**
+     * Target namespace for the WSDL document will have the following
+     * prefix.
+     */
+    var $tnsPrefix = 'tns';
+
+    /**
+     * Reference to the SOAP_WSDL object to populate.
+     */
+    var $wsdl = null;
+
+    /** Constructor
+     *
+     * @param  $objects Reference to the object or array of objects to parse
+     * @param  $wsdl Reference to the SOAP_WSDL object to populate
+     * @param  $targetNamespace The target namespace of schema types etc.
+     * @param  $service_name Name of the WSDL <service>
+     * @param  $service_desc Optional description of the WSDL <service>
+     */
+    function SOAP_WSDL_ObjectParser(&$objects, &$wsdl, $targetNamespace, $service_name, $service_desc = '')
+    {
+        parent::SOAP_Base('WSDLOBJECTPARSER');
+
+        $this->wsdl = &$wsdl;
+
+        // Set up the SOAP_WSDL object
+        $this->_initialise($service_name);
+
+        // Parse each web service object
+        $wsdl_ref = (is_array($objects)? $objects : array(&$objects));
+
+        foreach ($wsdl_ref as $ref_item) {
+            if (!is_object($ref_item))
+                return $this->_raiseSoapFault('Invalid web service object passed to object parser', 'urn:' . get_class($object));
+
+            if ($this->_parse($ref_item, $targetNamespace, $service_name) != true)
+                break;
+        }
+
+        // Build bindings from abstract data.
+        if ($this->fault == null) {
+            $this->_generateBindingsAndServices($targetNamespace, $service_name, $service_desc);
+        }
+    }
+
+    /**
+     * Initialise the SOAP_WSDL tree (destructive).
+     *
+     * If the object has already been initialised, the only effect
+     * will be to change the tns namespace to the new service name.
+     *
+     * @param  $service_name Name of the WSDL <service>
+     * @access private
+     */
+    function _initialise($service_name)
+    {
+        // Set up the basic namespaces that all WSDL definitions use.
+        $this->wsdl->namespaces['wsdl'] = SCHEMA_WSDL;                                      // WSDL language
+        $this->wsdl->namespaces['soap'] = SCHEMA_SOAP;                                      // WSDL SOAP bindings
+        $this->wsdl->namespaces[$this->tnsPrefix] = 'urn:' . $service_name;                 // Target namespace
+        $this->wsdl->namespaces['xsd'] = array_search('xsd', $this->_namespaces);           // XML Schema
+        $this->wsdl->namespaces['SOAP-ENC'] = array_search('SOAP-ENC', $this->_namespaces); // SOAP types
+
+        // XXX Refactor $namespace/$ns for Shane :-)
+        unset($this->wsdl->ns['urn:' . $service_name]);
+        $this->wsdl->ns += array_flip($this->wsdl->namespaces);
+
+        // Imports are not implemented in WSDL generation from classes.
+        // *** <wsdl:import> ***
+    }
+
+    /**
+     * Parser - takes a single object to add to tree
+     * (non-destructive).
+     *
+     * @param  $object Reference to the object to parse
+     * @param  $service_name Name of the WSDL <service>
+    * @access private
+     */
+    function _parse(&$object, $schemaNamespace, $service_name)
+    {
+        // Create namespace prefix for the schema
+        // XXX not very elegant :-(
+
+        list($schPrefix, $foo) = $this->_getTypeNs('{' . $schemaNamespace.'}');
+        unset($foo);
+
+        // Parse all the types defined by the object in whatever
+        // schema language we are using (currently __typedef arrays)
+        // *** <wsdl:types> ***
+
+        foreach ($object->__typedef as $typeName => $typeValue) {
+            // Get/create namespace definition
+
+            list($nsPrefix, $typeName) = $this->_getTypeNs($typeName);
+
+            // Create type definition
+
+            $this->wsdl->complexTypes[$schPrefix][$typeName] = array('name' => $typeName);
+            $thisType =& $this->wsdl->complexTypes[$schPrefix][$typeName];
+
+            // According to Dmitri's documentation, __typedef comes in two
+            // flavors:
+            // Array = array(array("item" => "value"))
+            // Struct = array("item1" => "value1", "item2" => "value2", ...)
+
+            if (is_array($typeValue)) {
+                reset($typeValue);
+                if (is_array(current($typeValue)) && count($typeValue) == 1
+                    && count(current($typeValue)) == 1) {
+                    // It's an array
+
+                    $thisType['type'] = 'Array';
+                    reset(current($typeValue));
+                    list($nsPrefix, $typeName) = $this->_getTypeNs(current(current($typeValue)));
+                    $thisType['namespace'] = $nsPrefix;
+                    $thisType['arrayType'] = $typeName . '[]';
+                } elseif (!is_array(current($typeValue))) {
+                    // It's a struct
+
+                    $thisType['type'] = 'Struct';
+                    $thisType['order'] = 'all';
+                    $thisType['namespace'] = $nsPrefix;
+                    $thisType['elements'] = array();
+
+                    foreach ($typeValue as $elementName => $elementType) {
+                        list($nsPrefix, $typeName) = $this->_getTypeNs($elementType);
+                        $thisType['elements'][$elementName]['name'] = $elementName;
+                        $thisType['elements'][$elementName]['type'] = $typeName;
+                        $thisType['elements'][$elementName]['namespace'] = $nsPrefix;
+                    }
+                } else {
+                    // It's erroneous
+                    return $this->_raiseSoapFault("The type definition for $nsPrefix:$typeName is invalid.", 'urn:' . get_class($object));
+                }
+            } else {
+                // It's erroneous
+                return $this->_raiseSoapFault("The type definition for $nsPrefix:$typeName is invalid.", 'urn:' . get_class($object));
+            }
+        }
+
+        // Create an empty element array with the target namespace
+        // prefix, to match the results of WSDL parsing.
+
+        $this->wsdl->elements[$schPrefix] = array();
+
+        // Populate tree with message information
+        // *** <wsdl:message> ***
+
+        foreach ($object->__dispatch_map as $operationName => $messages) {
+            foreach ($messages as $messageType => $messageParts) {
+                unset($thisMessage);
+
+                switch ($messageType) {
+                case 'in':
+                    $this->wsdl->messages[$operationName . 'Request'] = array();
+                    $thisMessage =& $this->wsdl->messages[$operationName . 'Request'];
+                    break;
+
+                case 'out':
+                    $this->wsdl->messages[$operationName . 'Response'] = array();
+                    $thisMessage =& $this->wsdl->messages[$operationName . 'Response'];
+                    break;
+
+                case 'alias':
+                    // Do nothing
+                    break;
+
+                default:
+                    // Error condition
+                    break;
+                }
+
+                if (isset($thisMessage)) {
+                    foreach ($messageParts as $partName => $partType) {
+                        list ($nsPrefix, $typeName) = $this->_getTypeNs($partType);
+
+                        $thisMessage[$partName] = array(
+                            'name' => $partName,
+                            'type' => $typeName,
+                            'namespace' => $nsPrefix
+                            );
+                    }
+                }
+            }
+        }
+
+        // Populate tree with portType information
+        // XXX Current implementation only supports one portType that
+        // encompasses all of the operations available.
+        // *** <wsdl:portType> ***
+
+        if (!isset($this->wsdl->portTypes[$service_name . 'Port'])) {
+            $this->wsdl->portTypes[$service_name . 'Port'] = array();
+        }
+        $thisPortType =& $this->wsdl->portTypes[$service_name . 'Port'];
+
+        foreach ($object->__dispatch_map as $operationName => $messages) {
+            $thisPortType[$operationName] = array('name' => $operationName);
+
+            foreach ($messages as $messageType => $messageParts) {
+                switch ($messageType) {
+                case 'in':
+                    $thisPortType[$operationName]['input'] = array(
+                        'message' => $operationName . 'Request',
+                        'namespace' => $this->tnsPrefix);
+                    break;
+
+                case 'out':
+                    $thisPortType[$operationName]['output'] = array(
+                        'message' => $operationName . 'Response',
+                        'namespace' => $this->tnsPrefix);
+                    break;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Take all the abstract WSDL data and build concrete bindings and
+     * services (destructive).
+     *
+     * XXX Current implementation discards $service_desc.
+     *
+     * @param  $schemaNamespace Namespace for types etc.
+     * @param  $service_name Name of the WSDL <service>
+     * @param  $service_desc Optional description of the WSDL <service>
+     * @access private
+     */
+    function _generateBindingsAndServices($schemaNamespace, $service_name, $service_desc = '')
+    {
+        // Populate tree with bindings information
+        // XXX Current implementation only supports one binding that
+        // matches the single portType and all of its operations.
+        // XXX Is this the correct use of $schemaNamespace here?
+        // *** <wsdl:binding> ***
+
+        $this->wsdl->bindings[$service_name . 'Binding'] = array(
+                'type' => $service_name . 'Port',
+                'namespace' => $this->tnsPrefix,
+                'style' => 'rpc',
+                'transport' => SCHEMA_SOAP_HTTP,
+                'operations' => array());
+        $thisBinding =& $this->wsdl->bindings[$service_name . 'Binding'];
+
+        foreach ($this->wsdl->portTypes[$service_name . 'Port'] as $operationName => $operationData) {
+            $thisBinding['operations'][$operationName] = array(
+                'soapAction' => $schemaNamespace . '#' . $operationName,
+                'style' => $thisBinding['style']);
+
+            foreach (array('input', 'output') as $messageType)
+                if (isset($operationData[$messageType])) {
+                    $thisBinding['operations'][$operationName][$messageType] = array(
+                            'use' => 'encoded',
+                            'namespace' => $schemaNamespace,
+                            'encodingStyle' => SOAP_SCHEMA_ENCODING);
+                }
+        }
+
+        // Populate tree with service information
+        // XXX Current implementation supports one service which groups
+        // all of the ports together, one port per binding
+        // XXX What about https?
+        // *** <wsdl:service> ***
+
+        $this->wsdl->services[$service_name . 'Service'] = array('ports' => array());
+        $thisService =& $this->wsdl->services[$service_name . 'Service']['ports'];
+
+        foreach ($this->wsdl->bindings as $bindingName => $bindingData) {
+            $thisService[$bindingData['type']] = array(
+                    'name' => $bindingData['type'],
+                    'binding' => $bindingName,
+                    'namespace' => $this->tnsPrefix,
+                    'address' => array('location' =>
+                        'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] .
+                        (isset($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '')),
+                    'type' => 'soap');
+        }
+
+        // Set service
+        $this->wsdl->set_service($service_name . 'Service');
+        $this->wsdl->uri = $this->wsdl->namespaces[$this->tnsPrefix];
+
+        // Create WSDL definition
+        // *** <wsdl:definitions> ***
+
+        $this->wsdl->definition = array(
+                'name' => $service_name,
+                'targetNamespace' => $this->wsdl->namespaces[$this->tnsPrefix],
+                'xmlns' => SCHEMA_WSDL);
+
+        foreach ($this->wsdl->namespaces as $nsPrefix => $namespace) {
+            $this->wsdl->definition['xmlns:' . $nsPrefix] = $namespace;
+        }
+    }
+
+    /**
+     * This function is adapted from Dmitri V's implementation of
+     * DISCO/WSDL generation. It separates namespace from type name in
+     * a __typedef key and creates a new namespace entry in the WSDL
+     * structure if the namespace has not been used before. The
+     * namespace prefix and type name are returned. If no namespace is
+     * specified, xsd is assumed.
+     *
+     * We will not need this function anymore once __typedef is
+     * eliminated.
+     */
+    function _getTypeNs($type)
+    {
+        preg_match_all("'\{(.*)\}'sm", $type, $m);
+        if (isset($m[1][0]) && $m[1][0] != '') {
+            if (!array_key_exists($m[1][0], $this->wsdl->ns)) {
+                $ns_pref = 'ns' . count($this->wsdl->namespaces);
+                $this->wsdl->ns[$m[1][0]] = $ns_pref;
+                $this->wsdl->namespaces[$ns_pref] = $m[1][0];
+            }
+            $typens = $this->wsdl->ns[$m[1][0]];
+            $type = ereg_replace($m[0][0], '', $type);
+        } else {
+            $typens = 'xsd';
+        }
+
+        return array($typens, $type);
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AbstractRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AbstractRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AbstractRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,114 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * AbstractRequestType
+ * 
+ * Base type definition of request payload that can carry any type of payload
+ * content with optional versioning information and detail level requirements.
+ *
+ * @package Services_PayPal
+ */
+class AbstractRequestType extends XSDType
+{
+    /**
+     * This specifies the required detail level that is needed by a client application
+     * pertaining to a particular data component (e.g., Item, Transaction, etc.). The
+     * detail level is specified in the DetailLevelCodeType which has all the
+     * enumerated values of the detail level for each component.
+     */
+    var $DetailLevel;
+
+    /**
+     * This should be the standard RFC 3066 language identification tag, e.g., en_US.
+     */
+    var $ErrorLanguage;
+
+    /**
+     * The MessageID is used to correlate (i.e., reference) the response message to a
+     * specific request message.
+     */
+    var $MessageID;
+
+    /**
+     * This refers to the version of the request payload schema.
+     */
+    var $Version;
+
+    function AbstractRequestType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'DetailLevel' => 
+              array (
+                'required' => false,
+                'type' => 'DetailLevelCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ErrorLanguage' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MessageID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Version' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getDetailLevel()
+    {
+        return $this->DetailLevel;
+    }
+    function setDetailLevel($DetailLevel, $charset = 'iso-8859-1')
+    {
+        $this->DetailLevel = $DetailLevel;
+        $this->_elements['DetailLevel']['charset'] = $charset;
+    }
+    function getErrorLanguage()
+    {
+        return $this->ErrorLanguage;
+    }
+    function setErrorLanguage($ErrorLanguage, $charset = 'iso-8859-1')
+    {
+        $this->ErrorLanguage = $ErrorLanguage;
+        $this->_elements['ErrorLanguage']['charset'] = $charset;
+    }
+    function getMessageID()
+    {
+        return $this->MessageID;
+    }
+    function setMessageID($MessageID, $charset = 'iso-8859-1')
+    {
+        $this->MessageID = $MessageID;
+        $this->_elements['MessageID']['charset'] = $charset;
+    }
+    function getVersion()
+    {
+        return $this->Version;
+    }
+    function setVersion($Version, $charset = 'iso-8859-1')
+    {
+        $this->Version = $Version;
+        $this->_elements['Version']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AbstractResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AbstractResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AbstractResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * AbstractResponseType
+ * 
+ * Base type definition of a response payload that can carry any type of payload
+ * content with following optional elements: - timestamp of response message, -
+ * application level acknowledgement, and - application-level errors and warnings.
+ *
+ * @package Services_PayPal
+ */
+class AbstractResponseType extends XSDType
+{
+    /**
+     * This value represents the date and time (GMT) when the response was generated by
+     * a service provider (as a result of processing of a request).
+     */
+    var $Timestamp;
+
+    /**
+     * Application level acknowledgement code.
+     */
+    var $Ack;
+
+    /**
+     * CorrelationID may be used optionally with an application level acknowledgement.
+     */
+    var $CorrelationID;
+
+    var $Errors;
+
+    /**
+     * This refers to the version of the response payload schema.
+     */
+    var $Version;
+
+    /**
+     * This refers to the specific software build that was used in the deployment for
+     * processing the request and generating the response.
+     */
+    var $Build;
+
+    function AbstractResponseType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Timestamp' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Ack' => 
+              array (
+                'required' => true,
+                'type' => 'AckCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CorrelationID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Errors' => 
+              array (
+                'required' => false,
+                'type' => 'ErrorType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Version' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Build' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getTimestamp()
+    {
+        return $this->Timestamp;
+    }
+    function setTimestamp($Timestamp, $charset = 'iso-8859-1')
+    {
+        $this->Timestamp = $Timestamp;
+        $this->_elements['Timestamp']['charset'] = $charset;
+    }
+    function getAck()
+    {
+        return $this->Ack;
+    }
+    function setAck($Ack, $charset = 'iso-8859-1')
+    {
+        $this->Ack = $Ack;
+        $this->_elements['Ack']['charset'] = $charset;
+    }
+    function getCorrelationID()
+    {
+        return $this->CorrelationID;
+    }
+    function setCorrelationID($CorrelationID, $charset = 'iso-8859-1')
+    {
+        $this->CorrelationID = $CorrelationID;
+        $this->_elements['CorrelationID']['charset'] = $charset;
+    }
+    function getErrors()
+    {
+        return $this->Errors;
+    }
+    function setErrors($Errors, $charset = 'iso-8859-1')
+    {
+        $this->Errors = $Errors;
+        $this->_elements['Errors']['charset'] = $charset;
+    }
+    function getVersion()
+    {
+        return $this->Version;
+    }
+    function setVersion($Version, $charset = 'iso-8859-1')
+    {
+        $this->Version = $Version;
+        $this->_elements['Version']['charset'] = $charset;
+    }
+    function getBuild()
+    {
+        return $this->Build;
+    }
+    function setBuild($Build, $charset = 'iso-8859-1')
+    {
+        $this->Build = $Build;
+        $this->_elements['Build']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AccountEntryType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AccountEntryType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AccountEntryType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,189 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * AccountEntryType
+ *
+ * @package Services_PayPal
+ */
+class AccountEntryType extends XSDType
+{
+    /**
+     * Balance as of a given entry, can be 0.00.
+     */
+    var $Balance;
+
+    /**
+     * Credit Amount for a detail entry, can be 0.00.
+     */
+    var $Credit;
+
+    /**
+     * Date entry was posted, in GMT.
+     */
+    var $Date;
+
+    /**
+     * Debit Amount for this detail entry, can be 0.00.
+     */
+    var $Debit;
+
+    /**
+     * Item number if transaction is associated with an auction or 0 if no item is
+     * associated with an account entry.
+     */
+    var $ItemID;
+
+    /**
+     * Memo line for an account entry, can be empty string.
+     */
+    var $Memo;
+
+    /**
+     * eBay reference number for an account entry.
+     */
+    var $RefNumber;
+
+    /**
+     * Integer code for account details entry type. This element element specifies an
+     * index to a table of explanations for accounting charges.
+     */
+    var $AccountEntryDetailsType;
+
+    function AccountEntryType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Balance' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Credit' => 
+              array (
+                'required' => true,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Date' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Debit' => 
+              array (
+                'required' => true,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ItemID' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Memo' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'RefNumber' => 
+              array (
+                'required' => true,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AccountEntryDetailsType' => 
+              array (
+                'required' => true,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getBalance()
+    {
+        return $this->Balance;
+    }
+    function setBalance($Balance, $charset = 'iso-8859-1')
+    {
+        $this->Balance = $Balance;
+        $this->_elements['Balance']['charset'] = $charset;
+    }
+    function getCredit()
+    {
+        return $this->Credit;
+    }
+    function setCredit($Credit, $charset = 'iso-8859-1')
+    {
+        $this->Credit = $Credit;
+        $this->_elements['Credit']['charset'] = $charset;
+    }
+    function getDate()
+    {
+        return $this->Date;
+    }
+    function setDate($Date, $charset = 'iso-8859-1')
+    {
+        $this->Date = $Date;
+        $this->_elements['Date']['charset'] = $charset;
+    }
+    function getDebit()
+    {
+        return $this->Debit;
+    }
+    function setDebit($Debit, $charset = 'iso-8859-1')
+    {
+        $this->Debit = $Debit;
+        $this->_elements['Debit']['charset'] = $charset;
+    }
+    function getItemID()
+    {
+        return $this->ItemID;
+    }
+    function setItemID($ItemID, $charset = 'iso-8859-1')
+    {
+        $this->ItemID = $ItemID;
+        $this->_elements['ItemID']['charset'] = $charset;
+    }
+    function getMemo()
+    {
+        return $this->Memo;
+    }
+    function setMemo($Memo, $charset = 'iso-8859-1')
+    {
+        $this->Memo = $Memo;
+        $this->_elements['Memo']['charset'] = $charset;
+    }
+    function getRefNumber()
+    {
+        return $this->RefNumber;
+    }
+    function setRefNumber($RefNumber, $charset = 'iso-8859-1')
+    {
+        $this->RefNumber = $RefNumber;
+        $this->_elements['RefNumber']['charset'] = $charset;
+    }
+    function getAccountEntryDetailsType()
+    {
+        return $this->AccountEntryDetailsType;
+    }
+    function setAccountEntryDetailsType($AccountEntryDetailsType, $charset = 'iso-8859-1')
+    {
+        $this->AccountEntryDetailsType = $AccountEntryDetailsType;
+        $this->_elements['AccountEntryDetailsType']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AccountSummaryType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AccountSummaryType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AccountSummaryType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,379 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * AccountSummaryType
+ * 
+ * Includes account summary for the user.
+ *
+ * @package Services_PayPal
+ */
+class AccountSummaryType extends XSDType
+{
+    var $AccountState;
+
+    var $AdditionalAccount;
+
+    /**
+     * Number of additional accounts.
+     */
+    var $AdditionalAccountsCount;
+
+    /**
+     * Amount past due, 0.00 if not past due.
+     */
+    var $AmountPastDue;
+
+    /**
+     * First four digits (with remainder Xed-out). This may be an empty string
+     * depending upon the value of the payment type for the user account (e.g, if no
+     * debit-card specified).
+     */
+    var $BankAccountInfo;
+
+    /**
+     * Last time/day BankAccountInfo and/or BankRoutingInfo was modified, in GMT. This
+     * may be an empty string depending upon the value of the payment type for the user
+     * account (e.g, if no debit-card specified).
+     */
+    var $BankModifyDate;
+
+    /**
+     * Indicates the billing cycle in which eBay sends a billing invoice to the
+     * specified user. Possible values: 0 = On the last day of the month. 15 = On the
+     * 15th day of the month.
+     */
+    var $BillingCycleDate;
+
+    /**
+     * Expiration date for the credit card selected as payment method, in GMT. Empty
+     * string if no credit card is on file or if account is inactive -- even if there
+     * is a credit card on file.
+     */
+    var $CCExp;
+
+    /**
+     * Last four digits of user's credit card selected as payment type. Empty string if
+     * no credit is on file. This may be an empty string depending upon the value of
+     * the payment type for the user account (e.g, if no debit-card specified).
+     */
+    var $CCInfo;
+
+    /**
+     * Last date credit card or credit card expiration date was modified, in GMT. This
+     * may be an empty string depending upon the value of the payment type for the user
+     * account (e.g, Empty string if no credit card is on file.
+     */
+    var $CCModifyDate;
+
+    /**
+     * User's current balance. Can be 0.00, positive, or negative.
+     */
+    var $CurrentBalance;
+
+    /**
+     * Amount of last payment posted, 0.00 if no payments posted.
+     */
+    var $LastAmountPaid;
+
+    /**
+     * Amount of last invoice. 0.00 if account not yet invoiced.
+     */
+    var $LastInvoiceAmount;
+
+    /**
+     * Date of last invoice sent by eBay to the user, in GMT. Empty string if this
+     * account has not been invoiced yet.
+     */
+    var $LastInvoiceDate;
+
+    /**
+     * Date of last payment by specified user to eBay, in GMT. Empty string if no
+     * payments posted.
+     */
+    var $LastPaymentDate;
+
+    /**
+     * Indicates whether the account has past due amounts outstanding. Possible values:
+     * true = Account is past due. false = Account is current.
+     */
+    var $PastDue;
+
+    /**
+     * Indicates the method the specified user selected for paying eBay. The values for
+     * PaymentType vary for each SiteID.
+     */
+    var $PaymentMethod;
+
+    function AccountSummaryType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AccountState' => 
+              array (
+                'required' => false,
+                'type' => 'AccountStateCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AdditionalAccount' => 
+              array (
+                'required' => false,
+                'type' => 'AdditionalAccountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AdditionalAccountsCount' => 
+              array (
+                'required' => true,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AmountPastDue' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BankAccountInfo' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BankModifyDate' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BillingCycleDate' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CCExp' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CCInfo' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CCModifyDate' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CurrentBalance' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LastAmountPaid' => 
+              array (
+                'required' => true,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LastInvoiceAmount' => 
+              array (
+                'required' => true,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LastInvoiceDate' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LastPaymentDate' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PastDue' => 
+              array (
+                'required' => true,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentMethod' => 
+              array (
+                'required' => true,
+                'type' => 'SellerPaymentMethodCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAccountState()
+    {
+        return $this->AccountState;
+    }
+    function setAccountState($AccountState, $charset = 'iso-8859-1')
+    {
+        $this->AccountState = $AccountState;
+        $this->_elements['AccountState']['charset'] = $charset;
+    }
+    function getAdditionalAccount()
+    {
+        return $this->AdditionalAccount;
+    }
+    function setAdditionalAccount($AdditionalAccount, $charset = 'iso-8859-1')
+    {
+        $this->AdditionalAccount = $AdditionalAccount;
+        $this->_elements['AdditionalAccount']['charset'] = $charset;
+    }
+    function getAdditionalAccountsCount()
+    {
+        return $this->AdditionalAccountsCount;
+    }
+    function setAdditionalAccountsCount($AdditionalAccountsCount, $charset = 'iso-8859-1')
+    {
+        $this->AdditionalAccountsCount = $AdditionalAccountsCount;
+        $this->_elements['AdditionalAccountsCount']['charset'] = $charset;
+    }
+    function getAmountPastDue()
+    {
+        return $this->AmountPastDue;
+    }
+    function setAmountPastDue($AmountPastDue, $charset = 'iso-8859-1')
+    {
+        $this->AmountPastDue = $AmountPastDue;
+        $this->_elements['AmountPastDue']['charset'] = $charset;
+    }
+    function getBankAccountInfo()
+    {
+        return $this->BankAccountInfo;
+    }
+    function setBankAccountInfo($BankAccountInfo, $charset = 'iso-8859-1')
+    {
+        $this->BankAccountInfo = $BankAccountInfo;
+        $this->_elements['BankAccountInfo']['charset'] = $charset;
+    }
+    function getBankModifyDate()
+    {
+        return $this->BankModifyDate;
+    }
+    function setBankModifyDate($BankModifyDate, $charset = 'iso-8859-1')
+    {
+        $this->BankModifyDate = $BankModifyDate;
+        $this->_elements['BankModifyDate']['charset'] = $charset;
+    }
+    function getBillingCycleDate()
+    {
+        return $this->BillingCycleDate;
+    }
+    function setBillingCycleDate($BillingCycleDate, $charset = 'iso-8859-1')
+    {
+        $this->BillingCycleDate = $BillingCycleDate;
+        $this->_elements['BillingCycleDate']['charset'] = $charset;
+    }
+    function getCCExp()
+    {
+        return $this->CCExp;
+    }
+    function setCCExp($CCExp, $charset = 'iso-8859-1')
+    {
+        $this->CCExp = $CCExp;
+        $this->_elements['CCExp']['charset'] = $charset;
+    }
+    function getCCInfo()
+    {
+        return $this->CCInfo;
+    }
+    function setCCInfo($CCInfo, $charset = 'iso-8859-1')
+    {
+        $this->CCInfo = $CCInfo;
+        $this->_elements['CCInfo']['charset'] = $charset;
+    }
+    function getCCModifyDate()
+    {
+        return $this->CCModifyDate;
+    }
+    function setCCModifyDate($CCModifyDate, $charset = 'iso-8859-1')
+    {
+        $this->CCModifyDate = $CCModifyDate;
+        $this->_elements['CCModifyDate']['charset'] = $charset;
+    }
+    function getCurrentBalance()
+    {
+        return $this->CurrentBalance;
+    }
+    function setCurrentBalance($CurrentBalance, $charset = 'iso-8859-1')
+    {
+        $this->CurrentBalance = $CurrentBalance;
+        $this->_elements['CurrentBalance']['charset'] = $charset;
+    }
+    function getLastAmountPaid()
+    {
+        return $this->LastAmountPaid;
+    }
+    function setLastAmountPaid($LastAmountPaid, $charset = 'iso-8859-1')
+    {
+        $this->LastAmountPaid = $LastAmountPaid;
+        $this->_elements['LastAmountPaid']['charset'] = $charset;
+    }
+    function getLastInvoiceAmount()
+    {
+        return $this->LastInvoiceAmount;
+    }
+    function setLastInvoiceAmount($LastInvoiceAmount, $charset = 'iso-8859-1')
+    {
+        $this->LastInvoiceAmount = $LastInvoiceAmount;
+        $this->_elements['LastInvoiceAmount']['charset'] = $charset;
+    }
+    function getLastInvoiceDate()
+    {
+        return $this->LastInvoiceDate;
+    }
+    function setLastInvoiceDate($LastInvoiceDate, $charset = 'iso-8859-1')
+    {
+        $this->LastInvoiceDate = $LastInvoiceDate;
+        $this->_elements['LastInvoiceDate']['charset'] = $charset;
+    }
+    function getLastPaymentDate()
+    {
+        return $this->LastPaymentDate;
+    }
+    function setLastPaymentDate($LastPaymentDate, $charset = 'iso-8859-1')
+    {
+        $this->LastPaymentDate = $LastPaymentDate;
+        $this->_elements['LastPaymentDate']['charset'] = $charset;
+    }
+    function getPastDue()
+    {
+        return $this->PastDue;
+    }
+    function setPastDue($PastDue, $charset = 'iso-8859-1')
+    {
+        $this->PastDue = $PastDue;
+        $this->_elements['PastDue']['charset'] = $charset;
+    }
+    function getPaymentMethod()
+    {
+        return $this->PaymentMethod;
+    }
+    function setPaymentMethod($PaymentMethod, $charset = 'iso-8859-1')
+    {
+        $this->PaymentMethod = $PaymentMethod;
+        $this->_elements['PaymentMethod']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AdditionalAccountType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AdditionalAccountType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AdditionalAccountType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * AdditionalAccountType
+ * 
+ * The AdditionalAccount component represents historical data related to accounts
+ * that the user held with a country of residency other than the current one. eBay
+ * users can have one active account at a time. For users who change their country
+ * of residency and modify their eBay registration to reflect this change, the new
+ * country of residence becomes the currently active account. Any account
+ * associated with a previous country is treated as an additional account. Because
+ * the currency for these additional accounts are different than the active
+ * account, each additional account includes an indicator of the currency for that
+ * account. Users who never change their country of residence will not have any
+ * additional accounts.
+ *
+ * @package Services_PayPal
+ */
+class AdditionalAccountType extends XSDType
+{
+    var $Balance;
+
+    var $Currency;
+
+    var $AccountCode;
+
+    function AdditionalAccountType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Balance' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Currency' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AccountCode' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getBalance()
+    {
+        return $this->Balance;
+    }
+    function setBalance($Balance, $charset = 'iso-8859-1')
+    {
+        $this->Balance = $Balance;
+        $this->_elements['Balance']['charset'] = $charset;
+    }
+    function getCurrency()
+    {
+        return $this->Currency;
+    }
+    function setCurrency($Currency, $charset = 'iso-8859-1')
+    {
+        $this->Currency = $Currency;
+        $this->_elements['Currency']['charset'] = $charset;
+    }
+    function getAccountCode()
+    {
+        return $this->AccountCode;
+    }
+    function setAccountCode($AccountCode, $charset = 'iso-8859-1')
+    {
+        $this->AccountCode = $AccountCode;
+        $this->_elements['AccountCode']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,316 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * AddressType
+ *
+ * @package Services_PayPal
+ */
+class AddressType extends XSDType
+{
+    var $Name;
+
+    var $Street1;
+
+    var $Street2;
+
+    var $CityName;
+
+    var $StateOrProvince;
+
+    var $Country;
+
+    /**
+     * This element should only be used in response elements and typically should not
+     * be used in creating request messages which specify the name of a country using
+     * the Country element (which refers to a 2-letter country code).
+     */
+    var $CountryName;
+
+    var $Phone;
+
+    var $PostalCode;
+
+    var $AddressID;
+
+    var $AddressOwner;
+
+    var $ExternalAddressID;
+
+    /**
+     * Only applicable to SellerPaymentAddress today. Seller's international name that
+     * is associated with the payment address.
+     */
+    var $InternationalName;
+
+    /**
+     * Only applicable to SellerPaymentAddress today. International state and city for
+     * the seller's payment address.
+     */
+    var $InternationalStateAndCity;
+
+    /**
+     * Only applicable to SellerPaymentAddress today. Seller's international street
+     * address that is associated with the payment address.
+     */
+    var $InternationalStreet;
+
+    var $AddressStatus;
+
+    function AddressType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Name' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Street1' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Street2' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CityName' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'StateOrProvince' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Country' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CountryName' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Phone' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PostalCode' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AddressID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AddressOwner' => 
+              array (
+                'required' => false,
+                'type' => 'AddressOwnerCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ExternalAddressID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InternationalName' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InternationalStateAndCity' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InternationalStreet' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AddressStatus' => 
+              array (
+                'required' => false,
+                'type' => 'AddressStatusCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getName()
+    {
+        return $this->Name;
+    }
+    function setName($Name, $charset = 'iso-8859-1')
+    {
+        $this->Name = $Name;
+        $this->_elements['Name']['charset'] = $charset;
+    }
+    function getStreet1()
+    {
+        return $this->Street1;
+    }
+    function setStreet1($Street1, $charset = 'iso-8859-1')
+    {
+        $this->Street1 = $Street1;
+        $this->_elements['Street1']['charset'] = $charset;
+    }
+    function getStreet2()
+    {
+        return $this->Street2;
+    }
+    function setStreet2($Street2, $charset = 'iso-8859-1')
+    {
+        $this->Street2 = $Street2;
+        $this->_elements['Street2']['charset'] = $charset;
+    }
+    function getCityName()
+    {
+        return $this->CityName;
+    }
+    function setCityName($CityName, $charset = 'iso-8859-1')
+    {
+        $this->CityName = $CityName;
+        $this->_elements['CityName']['charset'] = $charset;
+    }
+    function getStateOrProvince()
+    {
+        return $this->StateOrProvince;
+    }
+    function setStateOrProvince($StateOrProvince, $charset = 'iso-8859-1')
+    {
+        $this->StateOrProvince = $StateOrProvince;
+        $this->_elements['StateOrProvince']['charset'] = $charset;
+    }
+    function getCountry()
+    {
+        return $this->Country;
+    }
+    function setCountry($Country, $charset = 'iso-8859-1')
+    {
+        $this->Country = $Country;
+        $this->_elements['Country']['charset'] = $charset;
+    }
+    function getCountryName()
+    {
+        return $this->CountryName;
+    }
+    function setCountryName($CountryName, $charset = 'iso-8859-1')
+    {
+        $this->CountryName = $CountryName;
+        $this->_elements['CountryName']['charset'] = $charset;
+    }
+    function getPhone()
+    {
+        return $this->Phone;
+    }
+    function setPhone($Phone, $charset = 'iso-8859-1')
+    {
+        $this->Phone = $Phone;
+        $this->_elements['Phone']['charset'] = $charset;
+    }
+    function getPostalCode()
+    {
+        return $this->PostalCode;
+    }
+    function setPostalCode($PostalCode, $charset = 'iso-8859-1')
+    {
+        $this->PostalCode = $PostalCode;
+        $this->_elements['PostalCode']['charset'] = $charset;
+    }
+    function getAddressID()
+    {
+        return $this->AddressID;
+    }
+    function setAddressID($AddressID, $charset = 'iso-8859-1')
+    {
+        $this->AddressID = $AddressID;
+        $this->_elements['AddressID']['charset'] = $charset;
+    }
+    function getAddressOwner()
+    {
+        return $this->AddressOwner;
+    }
+    function setAddressOwner($AddressOwner, $charset = 'iso-8859-1')
+    {
+        $this->AddressOwner = $AddressOwner;
+        $this->_elements['AddressOwner']['charset'] = $charset;
+    }
+    function getExternalAddressID()
+    {
+        return $this->ExternalAddressID;
+    }
+    function setExternalAddressID($ExternalAddressID, $charset = 'iso-8859-1')
+    {
+        $this->ExternalAddressID = $ExternalAddressID;
+        $this->_elements['ExternalAddressID']['charset'] = $charset;
+    }
+    function getInternationalName()
+    {
+        return $this->InternationalName;
+    }
+    function setInternationalName($InternationalName, $charset = 'iso-8859-1')
+    {
+        $this->InternationalName = $InternationalName;
+        $this->_elements['InternationalName']['charset'] = $charset;
+    }
+    function getInternationalStateAndCity()
+    {
+        return $this->InternationalStateAndCity;
+    }
+    function setInternationalStateAndCity($InternationalStateAndCity, $charset = 'iso-8859-1')
+    {
+        $this->InternationalStateAndCity = $InternationalStateAndCity;
+        $this->_elements['InternationalStateAndCity']['charset'] = $charset;
+    }
+    function getInternationalStreet()
+    {
+        return $this->InternationalStreet;
+    }
+    function setInternationalStreet($InternationalStreet, $charset = 'iso-8859-1')
+    {
+        $this->InternationalStreet = $InternationalStreet;
+        $this->_elements['InternationalStreet']['charset'] = $charset;
+    }
+    function getAddressStatus()
+    {
+        return $this->AddressStatus;
+    }
+    function setAddressStatus($AddressStatus, $charset = 'iso-8859-1')
+    {
+        $this->AddressStatus = $AddressStatus;
+        $this->_elements['AddressStatus']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressVerifyRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressVerifyRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressVerifyRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * AddressVerifyRequestType
+ *
+ * @package Services_PayPal
+ */
+class AddressVerifyRequestType extends AbstractRequestType
+{
+    var $Email;
+
+    var $Street;
+
+    var $Zip;
+
+    function AddressVerifyRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Email' => 
+              array (
+                'required' => true,
+                'type' => 'EmailAddressType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Street' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Zip' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getEmail()
+    {
+        return $this->Email;
+    }
+    function setEmail($Email, $charset = 'iso-8859-1')
+    {
+        $this->Email = $Email;
+        $this->_elements['Email']['charset'] = $charset;
+    }
+    function getStreet()
+    {
+        return $this->Street;
+    }
+    function setStreet($Street, $charset = 'iso-8859-1')
+    {
+        $this->Street = $Street;
+        $this->_elements['Street']['charset'] = $charset;
+    }
+    function getZip()
+    {
+        return $this->Zip;
+    }
+    function setZip($Zip, $charset = 'iso-8859-1')
+    {
+        $this->Zip = $Zip;
+        $this->_elements['Zip']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressVerifyResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressVerifyResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AddressVerifyResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,112 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * AddressVerifyResponseType
+ *
+ * @package Services_PayPal
+ */
+class AddressVerifyResponseType extends AbstractResponseType
+{
+    var $ConfirmationCode;
+
+    var $StreetMatch;
+
+    var $ZipMatch;
+
+    var $CountryCode;
+
+    var $PayPalToken;
+
+    function AddressVerifyResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ConfirmationCode' => 
+              array (
+                'required' => true,
+                'type' => 'AddressStatusCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'StreetMatch' => 
+              array (
+                'required' => true,
+                'type' => 'MatchStatusCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'ZipMatch' => 
+              array (
+                'required' => false,
+                'type' => 'MatchStatusCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'CountryCode' => 
+              array (
+                'required' => false,
+                'type' => 'CountryCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'PayPalToken' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getConfirmationCode()
+    {
+        return $this->ConfirmationCode;
+    }
+    function setConfirmationCode($ConfirmationCode, $charset = 'iso-8859-1')
+    {
+        $this->ConfirmationCode = $ConfirmationCode;
+        $this->_elements['ConfirmationCode']['charset'] = $charset;
+    }
+    function getStreetMatch()
+    {
+        return $this->StreetMatch;
+    }
+    function setStreetMatch($StreetMatch, $charset = 'iso-8859-1')
+    {
+        $this->StreetMatch = $StreetMatch;
+        $this->_elements['StreetMatch']['charset'] = $charset;
+    }
+    function getZipMatch()
+    {
+        return $this->ZipMatch;
+    }
+    function setZipMatch($ZipMatch, $charset = 'iso-8859-1')
+    {
+        $this->ZipMatch = $ZipMatch;
+        $this->_elements['ZipMatch']['charset'] = $charset;
+    }
+    function getCountryCode()
+    {
+        return $this->CountryCode;
+    }
+    function setCountryCode($CountryCode, $charset = 'iso-8859-1')
+    {
+        $this->CountryCode = $CountryCode;
+        $this->_elements['CountryCode']['charset'] = $charset;
+    }
+    function getPayPalToken()
+    {
+        return $this->PayPalToken;
+    }
+    function setPayPalToken($PayPalToken, $charset = 'iso-8859-1')
+    {
+        $this->PayPalToken = $PayPalToken;
+        $this->_elements['PayPalToken']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AmountType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AmountType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AmountType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDSimpleType.php';
+
+/**
+ * AmountType
+ *
+ * @package Services_PayPal
+ */
+class AmountType extends XSDSimpleType
+{
+    function AmountType()
+    {
+        parent::XSDSimpleType();
+        $this->_namespace = 'urn:ebay:apis:CoreComponentTypes';
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'currencyID' => 
+              array (
+                'name' => 'currencyID',
+                'type' => 'ebl:CurrencyCodeType',
+                'use' => 'required',
+              ),
+            ));
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AttributeSetType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AttributeSetType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AttributeSetType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * AttributeSetType
+ * 
+ * AttributeSet.
+ *
+ * @package Services_PayPal
+ */
+class AttributeSetType extends XSDType
+{
+    var $Attribute;
+
+    function AttributeSetType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Attribute' => 
+              array (
+                'required' => true,
+                'type' => 'AttributeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'AttributeSetID' => 
+              array (
+                'name' => 'AttributeSetID',
+                'type' => 'xs:string',
+              ),
+            ));
+    }
+
+    function getAttribute()
+    {
+        return $this->Attribute;
+    }
+    function setAttribute($Attribute, $charset = 'iso-8859-1')
+    {
+        $this->Attribute = $Attribute;
+        $this->_elements['Attribute']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AttributeType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AttributeType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AttributeType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * AttributeType
+ * 
+ * Specific physical attribute of an item.
+ *
+ * @package Services_PayPal
+ */
+class AttributeType extends XSDType
+{
+    /**
+     * ValueList of the Attribute being described by the AttributeID. Constant name of
+     * the attribute that identifies a physical attribute within a set of
+     * characteristics that describe something in a formalised way.
+     */
+    var $Value;
+
+    function AttributeType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Value' => 
+              array (
+                'required' => true,
+                'type' => 'ValType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'AttributeID' => 
+              array (
+                'name' => 'AttributeID',
+                'type' => 'xs:string',
+              ),
+            ));
+    }
+
+    function getValue()
+    {
+        return $this->Value;
+    }
+    function setValue($Value, $charset = 'iso-8859-1')
+    {
+        $this->Value = $Value;
+        $this->_elements['Value']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/AuctionInfoType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/AuctionInfoType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/AuctionInfoType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * AuctionInfoType
+ * 
+ * AuctionInfoType - Type declaration to be used by other schemas. Basic
+ * information about an auction.
+ *
+ * @package Services_PayPal
+ */
+class AuctionInfoType extends XSDType
+{
+    var $BuyerID;
+
+    var $ClosingDate;
+
+    function AuctionInfoType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'BuyerID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ClosingDate' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'multiItem' => 
+              array (
+                'name' => 'multiItem',
+                'type' => 'xs:string',
+                'use' => 'required',
+              ),
+            ));
+    }
+
+    function getBuyerID()
+    {
+        return $this->BuyerID;
+    }
+    function setBuyerID($BuyerID, $charset = 'iso-8859-1')
+    {
+        $this->BuyerID = $BuyerID;
+        $this->_elements['BuyerID']['charset'] = $charset;
+    }
+    function getClosingDate()
+    {
+        return $this->ClosingDate;
+    }
+    function setClosingDate($ClosingDate, $charset = 'iso-8859-1')
+    {
+        $this->ClosingDate = $ClosingDate;
+        $this->_elements['ClosingDate']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * BAUpdateRequestType
+ *
+ * @package Services_PayPal
+ */
+class BAUpdateRequestType extends AbstractRequestType
+{
+    var $MpID;
+
+    var $Custom;
+
+    var $Desc;
+
+    var $MpStatus;
+
+    function BAUpdateRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'MpID' => 
+              array (
+                'required' => true,
+                'type' => 'MerchantPullIDType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Custom' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Desc' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'MpStatus' => 
+              array (
+                'required' => false,
+                'type' => 'MerchantPullStatusCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getMpID()
+    {
+        return $this->MpID;
+    }
+    function setMpID($MpID, $charset = 'iso-8859-1')
+    {
+        $this->MpID = $MpID;
+        $this->_elements['MpID']['charset'] = $charset;
+    }
+    function getCustom()
+    {
+        return $this->Custom;
+    }
+    function setCustom($Custom, $charset = 'iso-8859-1')
+    {
+        $this->Custom = $Custom;
+        $this->_elements['Custom']['charset'] = $charset;
+    }
+    function getDesc()
+    {
+        return $this->Desc;
+    }
+    function setDesc($Desc, $charset = 'iso-8859-1')
+    {
+        $this->Desc = $Desc;
+        $this->_elements['Desc']['charset'] = $charset;
+    }
+    function getMpStatus()
+    {
+        return $this->MpStatus;
+    }
+    function setMpStatus($MpStatus, $charset = 'iso-8859-1')
+    {
+        $this->MpStatus = $MpStatus;
+        $this->_elements['MpStatus']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateResponseDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateResponseDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateResponseDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * BAUpdateResponseDetailsType
+ *
+ * @package Services_PayPal
+ */
+class BAUpdateResponseDetailsType extends XSDType
+{
+    var $MpID;
+
+    var $PayerInfo;
+
+    var $MerchantPullInfo;
+
+    function BAUpdateResponseDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'MpID' => 
+              array (
+                'required' => true,
+                'type' => 'MerchantPullIDType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerInfo' => 
+              array (
+                'required' => true,
+                'type' => 'PayerInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MerchantPullInfo' => 
+              array (
+                'required' => true,
+                'type' => 'MerchantPullInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getMpID()
+    {
+        return $this->MpID;
+    }
+    function setMpID($MpID, $charset = 'iso-8859-1')
+    {
+        $this->MpID = $MpID;
+        $this->_elements['MpID']['charset'] = $charset;
+    }
+    function getPayerInfo()
+    {
+        return $this->PayerInfo;
+    }
+    function setPayerInfo($PayerInfo, $charset = 'iso-8859-1')
+    {
+        $this->PayerInfo = $PayerInfo;
+        $this->_elements['PayerInfo']['charset'] = $charset;
+    }
+    function getMerchantPullInfo()
+    {
+        return $this->MerchantPullInfo;
+    }
+    function setMerchantPullInfo($MerchantPullInfo, $charset = 'iso-8859-1')
+    {
+        $this->MerchantPullInfo = $MerchantPullInfo;
+        $this->_elements['MerchantPullInfo']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/BAUpdateResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * BAUpdateResponseType
+ *
+ * @package Services_PayPal
+ */
+class BAUpdateResponseType extends AbstractResponseType
+{
+    var $BAUpdateResponseDetails;
+
+    function BAUpdateResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'BAUpdateResponseDetails' => 
+              array (
+                'required' => true,
+                'type' => 'BAUpdateResponseDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getBAUpdateResponseDetails()
+    {
+        return $this->BAUpdateResponseDetails;
+    }
+    function setBAUpdateResponseDetails($BAUpdateResponseDetails, $charset = 'iso-8859-1')
+    {
+        $this->BAUpdateResponseDetails = $BAUpdateResponseDetails;
+        $this->_elements['BAUpdateResponseDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/BasicAmountType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/BasicAmountType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/BasicAmountType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDSimpleType.php';
+
+/**
+ * BasicAmountType
+ *
+ * @package Services_PayPal
+ */
+class BasicAmountType extends XSDSimpleType
+{
+    function BasicAmountType()
+    {
+        parent::XSDSimpleType();
+        $this->_namespace = 'urn:ebay:apis:CoreComponentTypes';
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'currencyID' => 
+              array (
+                'name' => 'currencyID',
+                'type' => 'ebl:CurrencyCodeType',
+                'use' => 'required',
+              ),
+            ));
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/BillUserRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/BillUserRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/BillUserRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * BillUserRequestType
+ *
+ * @package Services_PayPal
+ */
+class BillUserRequestType extends AbstractRequestType
+{
+    var $MerchantPullPaymentDetails;
+
+    function BillUserRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'MerchantPullPaymentDetails' => 
+              array (
+                'required' => true,
+                'type' => 'MerchantPullPaymentType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getMerchantPullPaymentDetails()
+    {
+        return $this->MerchantPullPaymentDetails;
+    }
+    function setMerchantPullPaymentDetails($MerchantPullPaymentDetails, $charset = 'iso-8859-1')
+    {
+        $this->MerchantPullPaymentDetails = $MerchantPullPaymentDetails;
+        $this->_elements['MerchantPullPaymentDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/BillUserResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/BillUserResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/BillUserResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * BillUserResponseType
+ *
+ * @package Services_PayPal
+ */
+class BillUserResponseType extends AbstractResponseType
+{
+    var $BillUserResponseDetails;
+
+    function BillUserResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'BillUserResponseDetails' => 
+              array (
+                'required' => true,
+                'type' => 'MerchantPullPaymentResponseType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getBillUserResponseDetails()
+    {
+        return $this->BillUserResponseDetails;
+    }
+    function setBillUserResponseDetails($BillUserResponseDetails, $charset = 'iso-8859-1')
+    {
+        $this->BillUserResponseDetails = $BillUserResponseDetails;
+        $this->_elements['BillUserResponseDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/BuyerType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/BuyerType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/BuyerType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * BuyerType
+ * 
+ * Information about user used by buying applications
+ *
+ * @package Services_PayPal
+ */
+class BuyerType extends XSDType
+{
+    var $ShippingAddress;
+
+    function BuyerType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ShippingAddress' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getShippingAddress()
+    {
+        return $this->ShippingAddress;
+    }
+    function setShippingAddress($ShippingAddress, $charset = 'iso-8859-1')
+    {
+        $this->ShippingAddress = $ShippingAddress;
+        $this->_elements['ShippingAddress']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/CalculatedShippingRateType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/CalculatedShippingRateType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/CalculatedShippingRateType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,157 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * CalculatedShippingRateType
+ *
+ * @package Services_PayPal
+ */
+class CalculatedShippingRateType extends XSDType
+{
+    /**
+     * Potal/zip code from where package will be shipped.
+     */
+    var $OriginatingPostalCode;
+
+    /**
+     * Indicates an item that cannot go through the stamping machine at the shipping
+     * service office (a value of True) and requires special or fragile handling. Only
+     * returned if ShippingType = 2.
+     */
+    var $ShippingIrregular;
+
+    /**
+     * contains information about shipping fees per each shipping service chosen by the
+     * seller
+     */
+    var $CarrierDetails;
+
+    /**
+     * May need to be moved into details - wait for George! The size of the package to
+     * be shipped. Possible values are: None Letter Large envelope USPS flat rate
+     * envelope Package/thick envelope USPS large package/oversize 1 Very large
+     * package/oversize 2 UPS Letter
+     */
+    var $ShippingPackage;
+
+    /**
+     * Shipping weight unit of measure (major). If unit of weight is kilogram (i.e.,
+     * metric system) this would be the exact weight value in kilogram (i.e., complete
+     * decimal number, e.g., 2.23 kg). Only returned if ShippingType is 2.
+     */
+    var $WeightMajor;
+
+    /**
+     * Shipping weight unit of measure (minor). If unit of weight is in pounds and/or
+     * ounces, this would be the exact weight value in ounces (i.e., complete decimal
+     * number, e.g., 8.2 or 8.0 ounces). Only returned if ShippingType is 2.
+     */
+    var $WeightMinor;
+
+    function CalculatedShippingRateType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'OriginatingPostalCode' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingIrregular' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CarrierDetails' => 
+              array (
+                'required' => false,
+                'type' => 'ShippingCarrierDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingPackage' => 
+              array (
+                'required' => false,
+                'type' => 'ShippingPackageCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'WeightMajor' => 
+              array (
+                'required' => false,
+                'type' => 'MeasureType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'WeightMinor' => 
+              array (
+                'required' => false,
+                'type' => 'MeasureType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getOriginatingPostalCode()
+    {
+        return $this->OriginatingPostalCode;
+    }
+    function setOriginatingPostalCode($OriginatingPostalCode, $charset = 'iso-8859-1')
+    {
+        $this->OriginatingPostalCode = $OriginatingPostalCode;
+        $this->_elements['OriginatingPostalCode']['charset'] = $charset;
+    }
+    function getShippingIrregular()
+    {
+        return $this->ShippingIrregular;
+    }
+    function setShippingIrregular($ShippingIrregular, $charset = 'iso-8859-1')
+    {
+        $this->ShippingIrregular = $ShippingIrregular;
+        $this->_elements['ShippingIrregular']['charset'] = $charset;
+    }
+    function getCarrierDetails()
+    {
+        return $this->CarrierDetails;
+    }
+    function setCarrierDetails($CarrierDetails, $charset = 'iso-8859-1')
+    {
+        $this->CarrierDetails = $CarrierDetails;
+        $this->_elements['CarrierDetails']['charset'] = $charset;
+    }
+    function getShippingPackage()
+    {
+        return $this->ShippingPackage;
+    }
+    function setShippingPackage($ShippingPackage, $charset = 'iso-8859-1')
+    {
+        $this->ShippingPackage = $ShippingPackage;
+        $this->_elements['ShippingPackage']['charset'] = $charset;
+    }
+    function getWeightMajor()
+    {
+        return $this->WeightMajor;
+    }
+    function setWeightMajor($WeightMajor, $charset = 'iso-8859-1')
+    {
+        $this->WeightMajor = $WeightMajor;
+        $this->_elements['WeightMajor']['charset'] = $charset;
+    }
+    function getWeightMinor()
+    {
+        return $this->WeightMinor;
+    }
+    function setWeightMinor($WeightMinor, $charset = 'iso-8859-1')
+    {
+        $this->WeightMinor = $WeightMinor;
+        $this->_elements['WeightMinor']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/CategoryArrayType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/CategoryArrayType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/CategoryArrayType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * CategoryArrayType
+ *
+ * @package Services_PayPal
+ */
+class CategoryArrayType extends XSDType
+{
+    var $Category;
+
+    function CategoryArrayType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Category' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getCategory()
+    {
+        return $this->Category;
+    }
+    function setCategory($Category, $charset = 'iso-8859-1')
+    {
+        $this->Category = $Category;
+        $this->_elements['Category']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/CategoryType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/CategoryType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/CategoryType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,253 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * CategoryType
+ * 
+ * Container for data on the primary category of listing.
+ *
+ * @package Services_PayPal
+ */
+class CategoryType extends XSDType
+{
+    var $AutoPayEnabled;
+
+    var $B2BVATEnabled;
+
+    var $CatalogEnabled;
+
+    var $CategoryID;
+
+    var $CategoryLevel;
+
+    var $CategoryName;
+
+    var $CategoryParentID;
+
+    var $CategoryParentName;
+
+    /**
+     * CSIDList is not present if Attributes enabled.
+     */
+    var $CSIDList;
+
+    var $Expired;
+
+    var $IntlAutosFixedCat;
+
+    var $LeafCategory;
+
+    var $Virtual;
+
+    function CategoryType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AutoPayEnabled' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'B2BVATEnabled' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CatalogEnabled' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CategoryID' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CategoryLevel' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CategoryName' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CategoryParentID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CategoryParentName' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CSIDList' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Expired' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'IntlAutosFixedCat' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LeafCategory' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Virtual' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAutoPayEnabled()
+    {
+        return $this->AutoPayEnabled;
+    }
+    function setAutoPayEnabled($AutoPayEnabled, $charset = 'iso-8859-1')
+    {
+        $this->AutoPayEnabled = $AutoPayEnabled;
+        $this->_elements['AutoPayEnabled']['charset'] = $charset;
+    }
+    function getB2BVATEnabled()
+    {
+        return $this->B2BVATEnabled;
+    }
+    function setB2BVATEnabled($B2BVATEnabled, $charset = 'iso-8859-1')
+    {
+        $this->B2BVATEnabled = $B2BVATEnabled;
+        $this->_elements['B2BVATEnabled']['charset'] = $charset;
+    }
+    function getCatalogEnabled()
+    {
+        return $this->CatalogEnabled;
+    }
+    function setCatalogEnabled($CatalogEnabled, $charset = 'iso-8859-1')
+    {
+        $this->CatalogEnabled = $CatalogEnabled;
+        $this->_elements['CatalogEnabled']['charset'] = $charset;
+    }
+    function getCategoryID()
+    {
+        return $this->CategoryID;
+    }
+    function setCategoryID($CategoryID, $charset = 'iso-8859-1')
+    {
+        $this->CategoryID = $CategoryID;
+        $this->_elements['CategoryID']['charset'] = $charset;
+    }
+    function getCategoryLevel()
+    {
+        return $this->CategoryLevel;
+    }
+    function setCategoryLevel($CategoryLevel, $charset = 'iso-8859-1')
+    {
+        $this->CategoryLevel = $CategoryLevel;
+        $this->_elements['CategoryLevel']['charset'] = $charset;
+    }
+    function getCategoryName()
+    {
+        return $this->CategoryName;
+    }
+    function setCategoryName($CategoryName, $charset = 'iso-8859-1')
+    {
+        $this->CategoryName = $CategoryName;
+        $this->_elements['CategoryName']['charset'] = $charset;
+    }
+    function getCategoryParentID()
+    {
+        return $this->CategoryParentID;
+    }
+    function setCategoryParentID($CategoryParentID, $charset = 'iso-8859-1')
+    {
+        $this->CategoryParentID = $CategoryParentID;
+        $this->_elements['CategoryParentID']['charset'] = $charset;
+    }
+    function getCategoryParentName()
+    {
+        return $this->CategoryParentName;
+    }
+    function setCategoryParentName($CategoryParentName, $charset = 'iso-8859-1')
+    {
+        $this->CategoryParentName = $CategoryParentName;
+        $this->_elements['CategoryParentName']['charset'] = $charset;
+    }
+    function getCSIDList()
+    {
+        return $this->CSIDList;
+    }
+    function setCSIDList($CSIDList, $charset = 'iso-8859-1')
+    {
+        $this->CSIDList = $CSIDList;
+        $this->_elements['CSIDList']['charset'] = $charset;
+    }
+    function getExpired()
+    {
+        return $this->Expired;
+    }
+    function setExpired($Expired, $charset = 'iso-8859-1')
+    {
+        $this->Expired = $Expired;
+        $this->_elements['Expired']['charset'] = $charset;
+    }
+    function getIntlAutosFixedCat()
+    {
+        return $this->IntlAutosFixedCat;
+    }
+    function setIntlAutosFixedCat($IntlAutosFixedCat, $charset = 'iso-8859-1')
+    {
+        $this->IntlAutosFixedCat = $IntlAutosFixedCat;
+        $this->_elements['IntlAutosFixedCat']['charset'] = $charset;
+    }
+    function getLeafCategory()
+    {
+        return $this->LeafCategory;
+    }
+    function setLeafCategory($LeafCategory, $charset = 'iso-8859-1')
+    {
+        $this->LeafCategory = $LeafCategory;
+        $this->_elements['LeafCategory']['charset'] = $charset;
+    }
+    function getVirtual()
+    {
+        return $this->Virtual;
+    }
+    function setVirtual($Virtual, $charset = 'iso-8859-1')
+    {
+        $this->Virtual = $Virtual;
+        $this->_elements['Virtual']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/CharityType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/CharityType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/CharityType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * CharityType
+ * 
+ * Contains information about a Charity listing.in case of revision - all data can
+ * be min occur = 0
+ *
+ * @package Services_PayPal
+ */
+class CharityType extends XSDType
+{
+    var $CharityName;
+
+    var $CharityNumber;
+
+    var $DonationPercent;
+
+    function CharityType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'CharityName' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CharityNumber' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'DonationPercent' => 
+              array (
+                'required' => false,
+                'type' => 'float',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getCharityName()
+    {
+        return $this->CharityName;
+    }
+    function setCharityName($CharityName, $charset = 'iso-8859-1')
+    {
+        $this->CharityName = $CharityName;
+        $this->_elements['CharityName']['charset'] = $charset;
+    }
+    function getCharityNumber()
+    {
+        return $this->CharityNumber;
+    }
+    function setCharityNumber($CharityNumber, $charset = 'iso-8859-1')
+    {
+        $this->CharityNumber = $CharityNumber;
+        $this->_elements['CharityNumber']['charset'] = $charset;
+    }
+    function getDonationPercent()
+    {
+        return $this->DonationPercent;
+    }
+    function setDonationPercent($DonationPercent, $charset = 'iso-8859-1')
+    {
+        $this->DonationPercent = $DonationPercent;
+        $this->_elements['DonationPercent']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/CreditCardDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/CreditCardDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/CreditCardDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,132 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * CreditCardDetailsType
+ * 
+ * CreditCardDetailsType - Type declaration to be used by other schemas.
+ * Information about a Credit Card.
+ *
+ * @package Services_PayPal
+ */
+class CreditCardDetailsType extends XSDType
+{
+    var $CreditCardType;
+
+    var $CreditCardNumber;
+
+    var $ExpMonth;
+
+    var $ExpYear;
+
+    var $CardOwner;
+
+    var $CVV2;
+
+    function CreditCardDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'CreditCardType' => 
+              array (
+                'required' => true,
+                'type' => 'CreditCardTypeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CreditCardNumber' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ExpMonth' => 
+              array (
+                'required' => true,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ExpYear' => 
+              array (
+                'required' => true,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CardOwner' => 
+              array (
+                'required' => true,
+                'type' => 'PayerInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CVV2' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getCreditCardType()
+    {
+        return $this->CreditCardType;
+    }
+    function setCreditCardType($CreditCardType, $charset = 'iso-8859-1')
+    {
+        $this->CreditCardType = $CreditCardType;
+        $this->_elements['CreditCardType']['charset'] = $charset;
+    }
+    function getCreditCardNumber()
+    {
+        return $this->CreditCardNumber;
+    }
+    function setCreditCardNumber($CreditCardNumber, $charset = 'iso-8859-1')
+    {
+        $this->CreditCardNumber = $CreditCardNumber;
+        $this->_elements['CreditCardNumber']['charset'] = $charset;
+    }
+    function getExpMonth()
+    {
+        return $this->ExpMonth;
+    }
+    function setExpMonth($ExpMonth, $charset = 'iso-8859-1')
+    {
+        $this->ExpMonth = $ExpMonth;
+        $this->_elements['ExpMonth']['charset'] = $charset;
+    }
+    function getExpYear()
+    {
+        return $this->ExpYear;
+    }
+    function setExpYear($ExpYear, $charset = 'iso-8859-1')
+    {
+        $this->ExpYear = $ExpYear;
+        $this->_elements['ExpYear']['charset'] = $charset;
+    }
+    function getCardOwner()
+    {
+        return $this->CardOwner;
+    }
+    function setCardOwner($CardOwner, $charset = 'iso-8859-1')
+    {
+        $this->CardOwner = $CardOwner;
+        $this->_elements['CardOwner']['charset'] = $charset;
+    }
+    function getCVV2()
+    {
+        return $this->CVV2;
+    }
+    function setCVV2($CVV2, $charset = 'iso-8859-1')
+    {
+        $this->CVV2 = $CVV2;
+        $this->_elements['CVV2']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/CrossPromotionsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/CrossPromotionsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/CrossPromotionsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,182 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * CrossPromotionsType
+ * 
+ * Merchandizing info for an Item. This contains a list of crosssell or upsell
+ * items. PrimaryScheme, PromotionMethod,SellerId,ItemId, ShippingDiscount do not
+ * have be min occur 0
+ *
+ * @package Services_PayPal
+ */
+class CrossPromotionsType extends XSDType
+{
+    /**
+     * Item ID for the base item. Based on this item other items are promoted.
+     */
+    var $ItemID;
+
+    var $PrimaryScheme;
+
+    var $PromotionMethod;
+
+    /**
+     * Id of the Seller who is promoting this item.
+     */
+    var $SellerID;
+
+    /**
+     * Shipping Discount offered or not by the seller.
+     */
+    var $ShippingDiscount;
+
+    /**
+     * Key of the Seller who is promoting this item.
+     */
+    var $SellerKey;
+
+    /**
+     * Store Name for the seller.
+     */
+    var $StoreName;
+
+    var $PromotedItem;
+
+    function CrossPromotionsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ItemID' => 
+              array (
+                'required' => true,
+                'type' => 'ItemIDType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PrimaryScheme' => 
+              array (
+                'required' => true,
+                'type' => 'PromotionSchemeCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PromotionMethod' => 
+              array (
+                'required' => true,
+                'type' => 'PromotionMethodCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SellerID' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingDiscount' => 
+              array (
+                'required' => true,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SellerKey' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'StoreName' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PromotedItem' => 
+              array (
+                'required' => true,
+                'type' => 'PromotedItemType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getItemID()
+    {
+        return $this->ItemID;
+    }
+    function setItemID($ItemID, $charset = 'iso-8859-1')
+    {
+        $this->ItemID = $ItemID;
+        $this->_elements['ItemID']['charset'] = $charset;
+    }
+    function getPrimaryScheme()
+    {
+        return $this->PrimaryScheme;
+    }
+    function setPrimaryScheme($PrimaryScheme, $charset = 'iso-8859-1')
+    {
+        $this->PrimaryScheme = $PrimaryScheme;
+        $this->_elements['PrimaryScheme']['charset'] = $charset;
+    }
+    function getPromotionMethod()
+    {
+        return $this->PromotionMethod;
+    }
+    function setPromotionMethod($PromotionMethod, $charset = 'iso-8859-1')
+    {
+        $this->PromotionMethod = $PromotionMethod;
+        $this->_elements['PromotionMethod']['charset'] = $charset;
+    }
+    function getSellerID()
+    {
+        return $this->SellerID;
+    }
+    function setSellerID($SellerID, $charset = 'iso-8859-1')
+    {
+        $this->SellerID = $SellerID;
+        $this->_elements['SellerID']['charset'] = $charset;
+    }
+    function getShippingDiscount()
+    {
+        return $this->ShippingDiscount;
+    }
+    function setShippingDiscount($ShippingDiscount, $charset = 'iso-8859-1')
+    {
+        $this->ShippingDiscount = $ShippingDiscount;
+        $this->_elements['ShippingDiscount']['charset'] = $charset;
+    }
+    function getSellerKey()
+    {
+        return $this->SellerKey;
+    }
+    function setSellerKey($SellerKey, $charset = 'iso-8859-1')
+    {
+        $this->SellerKey = $SellerKey;
+        $this->_elements['SellerKey']['charset'] = $charset;
+    }
+    function getStoreName()
+    {
+        return $this->StoreName;
+    }
+    function setStoreName($StoreName, $charset = 'iso-8859-1')
+    {
+        $this->StoreName = $StoreName;
+        $this->_elements['StoreName']['charset'] = $charset;
+    }
+    function getPromotedItem()
+    {
+        return $this->PromotedItem;
+    }
+    function setPromotedItem($PromotedItem, $charset = 'iso-8859-1')
+    {
+        $this->PromotedItem = $PromotedItem;
+        $this->_elements['PromotedItem']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/CustomSecurityHeaderType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/CustomSecurityHeaderType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/CustomSecurityHeaderType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * CustomSecurityHeaderType
+ * 
+ * Custom Securiy Header.
+ *
+ * @package Services_PayPal
+ */
+class CustomSecurityHeaderType extends XSDType
+{
+    var $eBayAuthToken;
+
+    var $HardExpirationWarning;
+
+    var $Credentials;
+
+    function CustomSecurityHeaderType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'eBayAuthToken' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'HardExpirationWarning' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Credentials' => 
+              array (
+                'required' => false,
+                'type' => 'UserIdPasswordType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function geteBayAuthToken()
+    {
+        return $this->eBayAuthToken;
+    }
+    function seteBayAuthToken($eBayAuthToken, $charset = 'iso-8859-1')
+    {
+        $this->eBayAuthToken = $eBayAuthToken;
+        $this->_elements['eBayAuthToken']['charset'] = $charset;
+    }
+    function getHardExpirationWarning()
+    {
+        return $this->HardExpirationWarning;
+    }
+    function setHardExpirationWarning($HardExpirationWarning, $charset = 'iso-8859-1')
+    {
+        $this->HardExpirationWarning = $HardExpirationWarning;
+        $this->_elements['HardExpirationWarning']['charset'] = $charset;
+    }
+    function getCredentials()
+    {
+        return $this->Credentials;
+    }
+    function setCredentials($Credentials, $charset = 'iso-8859-1')
+    {
+        $this->Credentials = $Credentials;
+        $this->_elements['Credentials']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,112 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * DoCaptureRequestType
+ *
+ * @package Services_PayPal
+ */
+class DoCaptureRequestType extends AbstractRequestType
+{
+    var $AuthorizationID;
+
+    var $Amount;
+
+    var $CompleteType;
+
+    var $Note;
+
+    var $InvoiceID;
+
+    function DoCaptureRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AuthorizationID' => 
+              array (
+                'required' => true,
+                'type' => 'AuthorizationId',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Amount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'CompleteType' => 
+              array (
+                'required' => true,
+                'type' => 'CompleteCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Note' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'InvoiceID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getAuthorizationID()
+    {
+        return $this->AuthorizationID;
+    }
+    function setAuthorizationID($AuthorizationID, $charset = 'iso-8859-1')
+    {
+        $this->AuthorizationID = $AuthorizationID;
+        $this->_elements['AuthorizationID']['charset'] = $charset;
+    }
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+    function getCompleteType()
+    {
+        return $this->CompleteType;
+    }
+    function setCompleteType($CompleteType, $charset = 'iso-8859-1')
+    {
+        $this->CompleteType = $CompleteType;
+        $this->_elements['CompleteType']['charset'] = $charset;
+    }
+    function getNote()
+    {
+        return $this->Note;
+    }
+    function setNote($Note, $charset = 'iso-8859-1')
+    {
+        $this->Note = $Note;
+        $this->_elements['Note']['charset'] = $charset;
+    }
+    function getInvoiceID()
+    {
+        return $this->InvoiceID;
+    }
+    function setInvoiceID($InvoiceID, $charset = 'iso-8859-1')
+    {
+        $this->InvoiceID = $InvoiceID;
+        $this->_elements['InvoiceID']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureResponseDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureResponseDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureResponseDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * DoCaptureResponseDetailsType
+ *
+ * @package Services_PayPal
+ */
+class DoCaptureResponseDetailsType extends XSDType
+{
+    var $AuthorizationID;
+
+    var $PaymentInfo;
+
+    function DoCaptureResponseDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AuthorizationID' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentInfo' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAuthorizationID()
+    {
+        return $this->AuthorizationID;
+    }
+    function setAuthorizationID($AuthorizationID, $charset = 'iso-8859-1')
+    {
+        $this->AuthorizationID = $AuthorizationID;
+        $this->_elements['AuthorizationID']['charset'] = $charset;
+    }
+    function getPaymentInfo()
+    {
+        return $this->PaymentInfo;
+    }
+    function setPaymentInfo($PaymentInfo, $charset = 'iso-8859-1')
+    {
+        $this->PaymentInfo = $PaymentInfo;
+        $this->_elements['PaymentInfo']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoCaptureResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * DoCaptureResponseType
+ *
+ * @package Services_PayPal
+ */
+class DoCaptureResponseType extends AbstractResponseType
+{
+    var $DoCaptureResponseDetails;
+
+    function DoCaptureResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'DoCaptureResponseDetails' => 
+              array (
+                'required' => true,
+                'type' => 'DoCaptureResponseDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getDoCaptureResponseDetails()
+    {
+        return $this->DoCaptureResponseDetails;
+    }
+    function setDoCaptureResponseDetails($DoCaptureResponseDetails, $charset = 'iso-8859-1')
+    {
+        $this->DoCaptureResponseDetails = $DoCaptureResponseDetails;
+        $this->_elements['DoCaptureResponseDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentRequestDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentRequestDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentRequestDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,112 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * DoDirectPaymentRequestDetailsType
+ *
+ * @package Services_PayPal
+ */
+class DoDirectPaymentRequestDetailsType extends XSDType
+{
+    var $PaymentAction;
+
+    var $PaymentDetails;
+
+    var $CreditCard;
+
+    var $IPAddress;
+
+    var $MerchantSessionId;
+
+    function DoDirectPaymentRequestDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'PaymentAction' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentActionCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentDetails' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CreditCard' => 
+              array (
+                'required' => true,
+                'type' => 'CreditCardDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'IPAddress' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MerchantSessionId' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getPaymentAction()
+    {
+        return $this->PaymentAction;
+    }
+    function setPaymentAction($PaymentAction, $charset = 'iso-8859-1')
+    {
+        $this->PaymentAction = $PaymentAction;
+        $this->_elements['PaymentAction']['charset'] = $charset;
+    }
+    function getPaymentDetails()
+    {
+        return $this->PaymentDetails;
+    }
+    function setPaymentDetails($PaymentDetails, $charset = 'iso-8859-1')
+    {
+        $this->PaymentDetails = $PaymentDetails;
+        $this->_elements['PaymentDetails']['charset'] = $charset;
+    }
+    function getCreditCard()
+    {
+        return $this->CreditCard;
+    }
+    function setCreditCard($CreditCard, $charset = 'iso-8859-1')
+    {
+        $this->CreditCard = $CreditCard;
+        $this->_elements['CreditCard']['charset'] = $charset;
+    }
+    function getIPAddress()
+    {
+        return $this->IPAddress;
+    }
+    function setIPAddress($IPAddress, $charset = 'iso-8859-1')
+    {
+        $this->IPAddress = $IPAddress;
+        $this->_elements['IPAddress']['charset'] = $charset;
+    }
+    function getMerchantSessionId()
+    {
+        return $this->MerchantSessionId;
+    }
+    function setMerchantSessionId($MerchantSessionId, $charset = 'iso-8859-1')
+    {
+        $this->MerchantSessionId = $MerchantSessionId;
+        $this->_elements['MerchantSessionId']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * DoDirectPaymentRequestType
+ *
+ * @package Services_PayPal
+ */
+class DoDirectPaymentRequestType extends AbstractRequestType
+{
+    var $DoDirectPaymentRequestDetails;
+
+    function DoDirectPaymentRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'DoDirectPaymentRequestDetails' => 
+              array (
+                'required' => true,
+                'type' => 'DoDirectPaymentRequestDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getDoDirectPaymentRequestDetails()
+    {
+        return $this->DoDirectPaymentRequestDetails;
+    }
+    function setDoDirectPaymentRequestDetails($DoDirectPaymentRequestDetails, $charset = 'iso-8859-1')
+    {
+        $this->DoDirectPaymentRequestDetails = $DoDirectPaymentRequestDetails;
+        $this->_elements['DoDirectPaymentRequestDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoDirectPaymentResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * DoDirectPaymentResponseType
+ *
+ * @package Services_PayPal
+ */
+class DoDirectPaymentResponseType extends AbstractResponseType
+{
+    var $Amount;
+
+    var $AVSCode;
+
+    var $CVV2Code;
+
+    var $TransactionID;
+
+    function DoDirectPaymentResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Amount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'AVSCode' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'CVV2Code' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'TransactionID' => 
+              array (
+                'required' => true,
+                'type' => 'TransactionId',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+    function getAVSCode()
+    {
+        return $this->AVSCode;
+    }
+    function setAVSCode($AVSCode, $charset = 'iso-8859-1')
+    {
+        $this->AVSCode = $AVSCode;
+        $this->_elements['AVSCode']['charset'] = $charset;
+    }
+    function getCVV2Code()
+    {
+        return $this->CVV2Code;
+    }
+    function setCVV2Code($CVV2Code, $charset = 'iso-8859-1')
+    {
+        $this->CVV2Code = $CVV2Code;
+        $this->_elements['CVV2Code']['charset'] = $charset;
+    }
+    function getTransactionID()
+    {
+        return $this->TransactionID;
+    }
+    function setTransactionID($TransactionID, $charset = 'iso-8859-1')
+    {
+        $this->TransactionID = $TransactionID;
+        $this->_elements['TransactionID']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentRequestDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentRequestDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentRequestDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * DoExpressCheckoutPaymentRequestDetailsType
+ *
+ * @package Services_PayPal
+ */
+class DoExpressCheckoutPaymentRequestDetailsType extends XSDType
+{
+    var $PaymentAction;
+
+    var $Token;
+
+    var $PayerID;
+
+    var $PaymentDetails;
+
+    function DoExpressCheckoutPaymentRequestDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'PaymentAction' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentActionCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Token' => 
+              array (
+                'required' => true,
+                'type' => 'ExpressCheckoutTokenType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerID' => 
+              array (
+                'required' => true,
+                'type' => 'UserIDType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentDetails' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getPaymentAction()
+    {
+        return $this->PaymentAction;
+    }
+    function setPaymentAction($PaymentAction, $charset = 'iso-8859-1')
+    {
+        $this->PaymentAction = $PaymentAction;
+        $this->_elements['PaymentAction']['charset'] = $charset;
+    }
+    function getToken()
+    {
+        return $this->Token;
+    }
+    function setToken($Token, $charset = 'iso-8859-1')
+    {
+        $this->Token = $Token;
+        $this->_elements['Token']['charset'] = $charset;
+    }
+    function getPayerID()
+    {
+        return $this->PayerID;
+    }
+    function setPayerID($PayerID, $charset = 'iso-8859-1')
+    {
+        $this->PayerID = $PayerID;
+        $this->_elements['PayerID']['charset'] = $charset;
+    }
+    function getPaymentDetails()
+    {
+        return $this->PaymentDetails;
+    }
+    function setPaymentDetails($PaymentDetails, $charset = 'iso-8859-1')
+    {
+        $this->PaymentDetails = $PaymentDetails;
+        $this->_elements['PaymentDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * DoExpressCheckoutPaymentRequestType
+ *
+ * @package Services_PayPal
+ */
+class DoExpressCheckoutPaymentRequestType extends AbstractRequestType
+{
+    var $DoExpressCheckoutPaymentRequestDetails;
+
+    function DoExpressCheckoutPaymentRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'DoExpressCheckoutPaymentRequestDetails' => 
+              array (
+                'required' => true,
+                'type' => 'DoExpressCheckoutPaymentRequestDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getDoExpressCheckoutPaymentRequestDetails()
+    {
+        return $this->DoExpressCheckoutPaymentRequestDetails;
+    }
+    function setDoExpressCheckoutPaymentRequestDetails($DoExpressCheckoutPaymentRequestDetails, $charset = 'iso-8859-1')
+    {
+        $this->DoExpressCheckoutPaymentRequestDetails = $DoExpressCheckoutPaymentRequestDetails;
+        $this->_elements['DoExpressCheckoutPaymentRequestDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentResponseDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentResponseDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentResponseDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * DoExpressCheckoutPaymentResponseDetailsType
+ *
+ * @package Services_PayPal
+ */
+class DoExpressCheckoutPaymentResponseDetailsType extends XSDType
+{
+    var $Token;
+
+    var $PaymentInfo;
+
+    function DoExpressCheckoutPaymentResponseDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Token' => 
+              array (
+                'required' => true,
+                'type' => 'ExpressCheckoutTokenType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentInfo' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getToken()
+    {
+        return $this->Token;
+    }
+    function setToken($Token, $charset = 'iso-8859-1')
+    {
+        $this->Token = $Token;
+        $this->_elements['Token']['charset'] = $charset;
+    }
+    function getPaymentInfo()
+    {
+        return $this->PaymentInfo;
+    }
+    function setPaymentInfo($PaymentInfo, $charset = 'iso-8859-1')
+    {
+        $this->PaymentInfo = $PaymentInfo;
+        $this->_elements['PaymentInfo']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoExpressCheckoutPaymentResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * DoExpressCheckoutPaymentResponseType
+ *
+ * @package Services_PayPal
+ */
+class DoExpressCheckoutPaymentResponseType extends AbstractResponseType
+{
+    var $DoExpressCheckoutPaymentResponseDetails;
+
+    function DoExpressCheckoutPaymentResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'DoExpressCheckoutPaymentResponseDetails' => 
+              array (
+                'required' => true,
+                'type' => 'DoExpressCheckoutPaymentResponseDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getDoExpressCheckoutPaymentResponseDetails()
+    {
+        return $this->DoExpressCheckoutPaymentResponseDetails;
+    }
+    function setDoExpressCheckoutPaymentResponseDetails($DoExpressCheckoutPaymentResponseDetails, $charset = 'iso-8859-1')
+    {
+        $this->DoExpressCheckoutPaymentResponseDetails = $DoExpressCheckoutPaymentResponseDetails;
+        $this->_elements['DoExpressCheckoutPaymentResponseDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoReauthorizationRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoReauthorizationRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoReauthorizationRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * DoReauthorizationRequestType
+ *
+ * @package Services_PayPal
+ */
+class DoReauthorizationRequestType extends AbstractRequestType
+{
+    var $AuthorizationID;
+
+    var $Amount;
+
+    function DoReauthorizationRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AuthorizationID' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Amount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getAuthorizationID()
+    {
+        return $this->AuthorizationID;
+    }
+    function setAuthorizationID($AuthorizationID, $charset = 'iso-8859-1')
+    {
+        $this->AuthorizationID = $AuthorizationID;
+        $this->_elements['AuthorizationID']['charset'] = $charset;
+    }
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoReauthorizationResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoReauthorizationResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoReauthorizationResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * DoReauthorizationResponseType
+ *
+ * @package Services_PayPal
+ */
+class DoReauthorizationResponseType extends AbstractResponseType
+{
+    var $AuthorizationID;
+
+    function DoReauthorizationResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AuthorizationID' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getAuthorizationID()
+    {
+        return $this->AuthorizationID;
+    }
+    function setAuthorizationID($AuthorizationID, $charset = 'iso-8859-1')
+    {
+        $this->AuthorizationID = $AuthorizationID;
+        $this->_elements['AuthorizationID']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoVoidRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoVoidRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoVoidRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * DoVoidRequestType
+ *
+ * @package Services_PayPal
+ */
+class DoVoidRequestType extends AbstractRequestType
+{
+    var $AuthorizationID;
+
+    var $Note;
+
+    function DoVoidRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AuthorizationID' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Note' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getAuthorizationID()
+    {
+        return $this->AuthorizationID;
+    }
+    function setAuthorizationID($AuthorizationID, $charset = 'iso-8859-1')
+    {
+        $this->AuthorizationID = $AuthorizationID;
+        $this->_elements['AuthorizationID']['charset'] = $charset;
+    }
+    function getNote()
+    {
+        return $this->Note;
+    }
+    function setNote($Note, $charset = 'iso-8859-1')
+    {
+        $this->Note = $Note;
+        $this->_elements['Note']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoVoidResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoVoidResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/DoVoidResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * DoVoidResponseType
+ *
+ * @package Services_PayPal
+ */
+class DoVoidResponseType extends AbstractResponseType
+{
+    var $AuthorizationID;
+
+    function DoVoidResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AuthorizationID' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getAuthorizationID()
+    {
+        return $this->AuthorizationID;
+    }
+    function setAuthorizationID($AuthorizationID, $charset = 'iso-8859-1')
+    {
+        $this->AuthorizationID = $AuthorizationID;
+        $this->_elements['AuthorizationID']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ErrorParameterType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ErrorParameterType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ErrorParameterType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ErrorParameterType
+ *
+ * @package Services_PayPal
+ */
+class ErrorParameterType extends XSDType
+{
+    /**
+     * Value of the application-specific error parameter. Specifies
+     * application-specific error parameter name.
+     */
+    var $Value;
+
+    function ErrorParameterType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Value' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'ParamID' => 
+              array (
+                'name' => 'ParamID',
+                'type' => 'xs:string',
+              ),
+            ));
+    }
+
+    function getValue()
+    {
+        return $this->Value;
+    }
+    function setValue($Value, $charset = 'iso-8859-1')
+    {
+        $this->Value = $Value;
+        $this->_elements['Value']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ErrorType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ErrorType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ErrorType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ErrorType
+ *
+ * @package Services_PayPal
+ */
+class ErrorType extends XSDType
+{
+    var $ShortMessage;
+
+    var $LongMessage;
+
+    /**
+     * Error code can be used by a receiving application to debugging a response
+     * message. These codes will need to be uniquely defined for each application.
+     */
+    var $ErrorCode;
+
+    /**
+     * SeverityCode indicates whether the error is an application level error or if it
+     * is informational error, i.e., warning.
+     */
+    var $SeverityCode;
+
+    /**
+     * This optional element may carry additional application-specific error variables
+     * that indicate specific information about the error condition particularly in the
+     * cases where there are multiple instances of the ErrorType which require
+     * additional context.
+     */
+    var $ErrorParameters;
+
+    function ErrorType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ShortMessage' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LongMessage' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ErrorCode' => 
+              array (
+                'required' => true,
+                'type' => 'token',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SeverityCode' => 
+              array (
+                'required' => true,
+                'type' => 'SeverityCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ErrorParameters' => 
+              array (
+                'required' => false,
+                'type' => 'ErrorParameterType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getShortMessage()
+    {
+        return $this->ShortMessage;
+    }
+    function setShortMessage($ShortMessage, $charset = 'iso-8859-1')
+    {
+        $this->ShortMessage = $ShortMessage;
+        $this->_elements['ShortMessage']['charset'] = $charset;
+    }
+    function getLongMessage()
+    {
+        return $this->LongMessage;
+    }
+    function setLongMessage($LongMessage, $charset = 'iso-8859-1')
+    {
+        $this->LongMessage = $LongMessage;
+        $this->_elements['LongMessage']['charset'] = $charset;
+    }
+    function getErrorCode()
+    {
+        return $this->ErrorCode;
+    }
+    function setErrorCode($ErrorCode, $charset = 'iso-8859-1')
+    {
+        $this->ErrorCode = $ErrorCode;
+        $this->_elements['ErrorCode']['charset'] = $charset;
+    }
+    function getSeverityCode()
+    {
+        return $this->SeverityCode;
+    }
+    function setSeverityCode($SeverityCode, $charset = 'iso-8859-1')
+    {
+        $this->SeverityCode = $SeverityCode;
+        $this->_elements['SeverityCode']['charset'] = $charset;
+    }
+    function getErrorParameters()
+    {
+        return $this->ErrorParameters;
+    }
+    function setErrorParameters($ErrorParameters, $charset = 'iso-8859-1')
+    {
+        $this->ErrorParameters = $ErrorParameters;
+        $this->_elements['ErrorParameters']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/FaultDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/FaultDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/FaultDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * FaultDetailsType
+ *
+ * @package Services_PayPal
+ */
+class FaultDetailsType extends XSDType
+{
+    /**
+     * Error code can be used by a receiving application to debugging a SOAP response
+     * message that contain one or more SOAP Fault detail objects, i.e., fault detail
+     * sub-elements. These codes will need to be uniquely defined for each fault
+     * scenario.
+     */
+    var $ErrorCode;
+
+    /**
+     * Severity indicates whether the error is a serious fault or if it is
+     * informational error, i.e., warning.
+     */
+    var $Severity;
+
+    var $DetailedMessage;
+
+    function FaultDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ErrorCode' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Severity' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'DetailedMessage' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getErrorCode()
+    {
+        return $this->ErrorCode;
+    }
+    function setErrorCode($ErrorCode, $charset = 'iso-8859-1')
+    {
+        $this->ErrorCode = $ErrorCode;
+        $this->_elements['ErrorCode']['charset'] = $charset;
+    }
+    function getSeverity()
+    {
+        return $this->Severity;
+    }
+    function setSeverity($Severity, $charset = 'iso-8859-1')
+    {
+        $this->Severity = $Severity;
+        $this->_elements['Severity']['charset'] = $charset;
+    }
+    function getDetailedMessage()
+    {
+        return $this->DetailedMessage;
+    }
+    function setDetailedMessage($DetailedMessage, $charset = 'iso-8859-1')
+    {
+        $this->DetailedMessage = $DetailedMessage;
+        $this->_elements['DetailedMessage']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/FeeType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/FeeType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/FeeType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * FeeType
+ * 
+ * Definition of an eBay Fee type.
+ *
+ * @package Services_PayPal
+ */
+class FeeType extends XSDType
+{
+    var $Name;
+
+    var $Fee;
+
+    function FeeType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Name' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Fee' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getName()
+    {
+        return $this->Name;
+    }
+    function setName($Name, $charset = 'iso-8859-1')
+    {
+        $this->Name = $Name;
+        $this->_elements['Name']['charset'] = $charset;
+    }
+    function getFee()
+    {
+        return $this->Fee;
+    }
+    function setFee($Fee, $charset = 'iso-8859-1')
+    {
+        $this->Fee = $Fee;
+        $this->_elements['Fee']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/FeesType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/FeesType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/FeesType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * FeesType
+ * 
+ * Following are the current set of eBay fee types AuctionLengthFee BoldFee
+ * BuyItNowFee CategoryFeaturedFee FeaturedFee FeaturedGalleryFee
+ * FixedPriceDurationFee GalleryFee GiftIconFee HighLightFee InsertionFee
+ * ListingDesignerFee ListingFee PhotoDisplayFee PhotoFee ReserveFee SchedulingFee
+ * ThirtyDaysAucFee Instances of this type could hold one or more supported types
+ * of fee.
+ *
+ * @package Services_PayPal
+ */
+class FeesType extends XSDType
+{
+    var $Fee;
+
+    function FeesType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Fee' => 
+              array (
+                'required' => true,
+                'type' => 'FeeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getFee()
+    {
+        return $this->Fee;
+    }
+    function setFee($Fee, $charset = 'iso-8859-1')
+    {
+        $this->Fee = $Fee;
+        $this->_elements['Fee']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/FlatShippingRateType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/FlatShippingRateType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/FlatShippingRateType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,115 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * FlatShippingRateType
+ *
+ * @package Services_PayPal
+ */
+class FlatShippingRateType extends XSDType
+{
+    /**
+     * Any additional shipping costs for the item.
+     */
+    var $AdditionalShippingCosts;
+
+    var $FlatShippingHandlingCosts;
+
+    var $InsuranceFee;
+
+    var $InsuranceOption;
+
+    var $ShippingService;
+
+    function FlatShippingRateType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AdditionalShippingCosts' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'FlatShippingHandlingCosts' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InsuranceFee' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InsuranceOption' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingService' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAdditionalShippingCosts()
+    {
+        return $this->AdditionalShippingCosts;
+    }
+    function setAdditionalShippingCosts($AdditionalShippingCosts, $charset = 'iso-8859-1')
+    {
+        $this->AdditionalShippingCosts = $AdditionalShippingCosts;
+        $this->_elements['AdditionalShippingCosts']['charset'] = $charset;
+    }
+    function getFlatShippingHandlingCosts()
+    {
+        return $this->FlatShippingHandlingCosts;
+    }
+    function setFlatShippingHandlingCosts($FlatShippingHandlingCosts, $charset = 'iso-8859-1')
+    {
+        $this->FlatShippingHandlingCosts = $FlatShippingHandlingCosts;
+        $this->_elements['FlatShippingHandlingCosts']['charset'] = $charset;
+    }
+    function getInsuranceFee()
+    {
+        return $this->InsuranceFee;
+    }
+    function setInsuranceFee($InsuranceFee, $charset = 'iso-8859-1')
+    {
+        $this->InsuranceFee = $InsuranceFee;
+        $this->_elements['InsuranceFee']['charset'] = $charset;
+    }
+    function getInsuranceOption()
+    {
+        return $this->InsuranceOption;
+    }
+    function setInsuranceOption($InsuranceOption, $charset = 'iso-8859-1')
+    {
+        $this->InsuranceOption = $InsuranceOption;
+        $this->_elements['InsuranceOption']['charset'] = $charset;
+    }
+    function getShippingService()
+    {
+        return $this->ShippingService;
+    }
+    function setShippingService($ShippingService, $charset = 'iso-8859-1')
+    {
+        $this->ShippingService = $ShippingService;
+        $this->_elements['ShippingService']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * GetExpressCheckoutDetailsRequestType
+ *
+ * @package Services_PayPal
+ */
+class GetExpressCheckoutDetailsRequestType extends AbstractRequestType
+{
+    var $Token;
+
+    function GetExpressCheckoutDetailsRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Token' => 
+              array (
+                'required' => true,
+                'type' => 'ExpressCheckoutTokenType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getToken()
+    {
+        return $this->Token;
+    }
+    function setToken($Token, $charset = 'iso-8859-1')
+    {
+        $this->Token = $Token;
+        $this->_elements['Token']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsResponseDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsResponseDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsResponseDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,112 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * GetExpressCheckoutDetailsResponseDetailsType
+ *
+ * @package Services_PayPal
+ */
+class GetExpressCheckoutDetailsResponseDetailsType extends XSDType
+{
+    var $Token;
+
+    var $PayerInfo;
+
+    var $Custom;
+
+    var $InvoiceID;
+
+    var $ContactPhone;
+
+    function GetExpressCheckoutDetailsResponseDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Token' => 
+              array (
+                'required' => true,
+                'type' => 'ExpressCheckoutTokenType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerInfo' => 
+              array (
+                'required' => true,
+                'type' => 'PayerInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Custom' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InvoiceID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ContactPhone' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getToken()
+    {
+        return $this->Token;
+    }
+    function setToken($Token, $charset = 'iso-8859-1')
+    {
+        $this->Token = $Token;
+        $this->_elements['Token']['charset'] = $charset;
+    }
+    function getPayerInfo()
+    {
+        return $this->PayerInfo;
+    }
+    function setPayerInfo($PayerInfo, $charset = 'iso-8859-1')
+    {
+        $this->PayerInfo = $PayerInfo;
+        $this->_elements['PayerInfo']['charset'] = $charset;
+    }
+    function getCustom()
+    {
+        return $this->Custom;
+    }
+    function setCustom($Custom, $charset = 'iso-8859-1')
+    {
+        $this->Custom = $Custom;
+        $this->_elements['Custom']['charset'] = $charset;
+    }
+    function getInvoiceID()
+    {
+        return $this->InvoiceID;
+    }
+    function setInvoiceID($InvoiceID, $charset = 'iso-8859-1')
+    {
+        $this->InvoiceID = $InvoiceID;
+        $this->_elements['InvoiceID']['charset'] = $charset;
+    }
+    function getContactPhone()
+    {
+        return $this->ContactPhone;
+    }
+    function setContactPhone($ContactPhone, $charset = 'iso-8859-1')
+    {
+        $this->ContactPhone = $ContactPhone;
+        $this->_elements['ContactPhone']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetExpressCheckoutDetailsResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * GetExpressCheckoutDetailsResponseType
+ *
+ * @package Services_PayPal
+ */
+class GetExpressCheckoutDetailsResponseType extends AbstractResponseType
+{
+    var $GetExpressCheckoutDetailsResponseDetails;
+
+    function GetExpressCheckoutDetailsResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'GetExpressCheckoutDetailsResponseDetails' => 
+              array (
+                'required' => true,
+                'type' => 'GetExpressCheckoutDetailsResponseDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getGetExpressCheckoutDetailsResponseDetails()
+    {
+        return $this->GetExpressCheckoutDetailsResponseDetails;
+    }
+    function setGetExpressCheckoutDetailsResponseDetails($GetExpressCheckoutDetailsResponseDetails, $charset = 'iso-8859-1')
+    {
+        $this->GetExpressCheckoutDetailsResponseDetails = $GetExpressCheckoutDetailsResponseDetails;
+        $this->_elements['GetExpressCheckoutDetailsResponseDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetTransactionDetailsRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetTransactionDetailsRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetTransactionDetailsRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * GetTransactionDetailsRequestType
+ *
+ * @package Services_PayPal
+ */
+class GetTransactionDetailsRequestType extends AbstractRequestType
+{
+    var $TransactionID;
+
+    function GetTransactionDetailsRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'TransactionID' => 
+              array (
+                'required' => true,
+                'type' => 'TransactionId',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getTransactionID()
+    {
+        return $this->TransactionID;
+    }
+    function setTransactionID($TransactionID, $charset = 'iso-8859-1')
+    {
+        $this->TransactionID = $TransactionID;
+        $this->_elements['TransactionID']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetTransactionDetailsResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetTransactionDetailsResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/GetTransactionDetailsResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * GetTransactionDetailsResponseType
+ *
+ * @package Services_PayPal
+ */
+class GetTransactionDetailsResponseType extends AbstractResponseType
+{
+    var $PaymentTransactionDetails;
+
+    function GetTransactionDetailsResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'PaymentTransactionDetails' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentTransactionType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getPaymentTransactionDetails()
+    {
+        return $this->PaymentTransactionDetails;
+    }
+    function setPaymentTransactionDetails($PaymentTransactionDetails, $charset = 'iso-8859-1')
+    {
+        $this->PaymentTransactionDetails = $PaymentTransactionDetails;
+        $this->_elements['PaymentTransactionDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ItemArrayType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ItemArrayType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ItemArrayType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ItemArrayType
+ *
+ * @package Services_PayPal
+ */
+class ItemArrayType extends XSDType
+{
+    var $Item;
+
+    function ItemArrayType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Item' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getItem()
+    {
+        return $this->Item;
+    }
+    function setItem($Item, $charset = 'iso-8859-1')
+    {
+        $this->Item = $Item;
+        $this->_elements['Item']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ItemType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ItemType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ItemType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1078 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ItemType
+ *
+ * @package Services_PayPal
+ */
+class ItemType extends XSDType
+{
+    /**
+     * Returns custom, application-specific data associated with the item. The data in
+     * this field is stored with the item in the items table at eBay, but is not used
+     * in any way by eBay. Use ApplicationData to store such special information as a
+     * part or SKU number. Maximum 32 characters in length.
+     */
+    var $ApplicationData;
+
+    /**
+     * Carries one or more instances of the AttributeSet in a list.
+     */
+    var $ListOfAttributeSets;
+
+    /**
+     * If true (1), indicates that the seller requested immediate payment for the item.
+     * False (0) if immediate payment was not requested. (Does not indicate whether the
+     * item is still a candidate for puchase via immediate payment.) Only applicable
+     * for items listed on US and UK sites in categories that support immediate
+     * payment, when seller has a Premier or Business PayPal account.
+     */
+    var $AutoPay;
+
+    /**
+     * Indicates the status of the item's eligibility for the Buyer Protection Program.
+     * Possible values: ItemIneligible - Item is ineligible (e.g., category not
+     * applicable) ItemEligible - Item is eligible per standard criteria
+     * ItemMarkedIneligible - Item marked ineligible per special criteria (e.g.,
+     * seller's account closed) ItemMarkedIneligible - Item marked elegible per other
+     * criteria Applicable for items listed to the US site and for the Parts and
+     * Accessories category (6028) or Everything Else category (10368) (or their
+     * subcategories) on the eBay Motors site.
+     */
+    var $BuyerProtection;
+
+    /**
+     * Amount a Buyer would need to bid to take advantage of the Buy It Now feature.
+     * Not applicable to Fixed-Price items (Type = 7 or 9) or AdFormat-type listings.
+     * For Fixed-Price items, see StartPrice instead.
+     */
+    var $BuyItNowPrice;
+
+    /**
+     * Charity listing container.
+     */
+    var $Charity;
+
+    /**
+     * 2-letter ISO 3166 Country Code.
+     */
+    var $Country;
+
+    /**
+     * CrossPromotions container, if applicable shows promoted items
+     */
+    var $CrossPromotion;
+
+    /**
+     * 3-letter ISO Currency Code.
+     */
+    var $Currency;
+
+    /**
+     * Item Description.
+     */
+    var $Description;
+
+    /**
+     * Online Escrow paid for by buyer or seller. Cannot use with real estate auctions.
+     * Escrow is recommended for for transactions over $500. Escrow service, available
+     * via Escrow.com, protects both buyer and seller by acting as a trusted
+     * third-party during the transaction and managing the payment process from start
+     * to finish. Also, if escrow by seller option used, then for Motors, this means
+     * that Escrow will be negotiated at the end of the auction.
+     */
+    var $Escrow;
+
+    /**
+     * If set, a generic gift icon displays in the listing's Title. GiftIcon must be
+     * set to to be able to use GiftServices options (e.g., GiftExpressShipping,
+     * GiftShipToRecipient, or GiftWrap).
+     */
+    var $GiftIcon;
+
+    /**
+     * Gift service options offered by the seller of the listed item.
+     */
+    var $GiftServices;
+
+    /**
+     * Optional hit counter for the item's listing page. Possible values are:
+     * "NoHitCounter" "HonestyStyle" "GreenLED" "Hidden"
+     */
+    var $HitCounter;
+
+    /**
+     * The ID that uniquely identifies the item listing.
+     */
+    var $ItemID;
+
+    /**
+     * Includes listing details in terms of start and end time of listing (in GMT) as
+     * well as other details (e.g., orginal item for second chance, converted start
+     * price, etc.).
+     */
+    var $ListingDetails;
+
+    /**
+     * When an item is first listed (using AddItem), a Layout template or a Theme
+     * template (or both) can be assigned to the item. A Layout template is assigned to
+     * a new item by specifying the Layout template ID (in the AddItem input argument
+     * LayoutID). Similarly, a Theme template is assigned to the item using the ThemeID
+     * argument.
+     */
+    var $ListingDesigner;
+
+    /**
+     * Describes the number of days the auction will be active.
+     */
+    var $ListingDuration;
+
+    /**
+     * Describes the types of enhancment supported for the item's listing.
+     */
+    var $ListingEnhancement;
+
+    /**
+     * Describes the type of listing for the item a seller has chosen (e.g., Chinese,
+     * Dutch, FixedPrice, etc.).
+     */
+    var $ListingType;
+
+    /**
+     * Indicates the geographical location of the item.
+     */
+    var $Location;
+
+    /**
+     * Needed for add item only for partners.
+     */
+    var $PartnerCode;
+
+    /**
+     * Needed for add item only for partners.
+     */
+    var $PartnerName;
+
+    /**
+     * List of payment methods accepted by a seller from a buyer for a (checkout)
+     * transaction.
+     */
+    var $PaymentMethods;
+
+    /**
+     * Valid PayPal e-mail address if seller has chosen PayPal as a payment method for
+     * the listed item.
+     */
+    var $PayPalEmailAddress;
+
+    /**
+     * Container for data on the primary category of listing.
+     */
+    var $PrimaryCategory;
+
+    /**
+     * Private auction. Not applicable to Fixed Price items.
+     */
+    var $PrivateListing;
+
+    /**
+     * Number of items being sold in the auction.
+     */
+    var $Quantity;
+
+    /**
+     * Region where the item is listed. See Region Table for values. If the item is
+     * listed with a Region of 0 (zero), then this return field denotes no region
+     * association with the item, meaning that it is not listing the item regionally.
+     */
+    var $RegionID;
+
+    /**
+     * If true, creates a link from the old listing for the item to the new relist
+     * page, which accommodates users who might still look for the item under its old
+     * item ID. Also adds the relist ID to the old listing's record in the eBay
+     * database, which can be returned by calling GetItem for the old ItemId. If your
+     * application creates the listing page for the user, you need to add the relist
+     * link option to your application for your users.
+     */
+    var $RelistLink;
+
+    /**
+     * Indicates the reserve price for a reserve auction. Returned only if DetailLevel
+     * = 4. ReservePrice is only returned for auctions with a reserve price where the
+     * user calling GetItem is the item's seller. Returned as null for International
+     * Fixed Price items. For more information on reserve price auctions, see
+     * http://pages.ebay.com/help/basics/f-format.html#1.
+     */
+    var $ReservePrice;
+
+    /**
+     * Revise Status contains information about the item being revised.
+     */
+    var $ReviseStatus;
+
+    var $ScheduleTime;
+
+    /**
+     * Container for data on the secondary category of listing. Secondary category is
+     * optional.
+     */
+    var $SecondaryCategory;
+
+    /**
+     * Item picture information for pictures hosted at eBay site.
+     */
+    var $SiteHostedPicture;
+
+    /**
+     * Seller user.
+     */
+    var $Seller;
+
+    /**
+     * Container for for selling status information (e.g., BidCount, BidIncrement,
+     * HighBidder, MinimimumToBid, etc).
+     */
+    var $SellingStatus;
+
+    /**
+     * Specifies where the seller is willing to ship the item. Default "SiteOnly".
+     * Valid values are: SiteOnly (the default) WorldWide SitePlusRegions WillNotShip
+     * If SitePlusRegions is selected, then at least one regions argument
+     * (ShipToNorthAmerica, ShipToEurope, etc.) must also be set.
+     */
+    var $ShippingOption;
+
+    /**
+     * Contains the shipping payment related information for the listed item.
+     */
+    var $ShippingDetails;
+
+    /**
+     * Regions that seller will ship to.
+     */
+    var $ShippingRegions;
+
+    /**
+     * Describes who pays for the delivery of an item (e.g., buyer or seller).
+     */
+    var $ShippingTerms;
+
+    /**
+     * eBay site on which item is listed.
+     */
+    var $Site;
+
+    /**
+     * Starting price for the item. For Type=7 or Type=9 (Fixed Price) items, if the
+     * item price (MinimumBid) is revised, this field returns the new price.
+     */
+    var $StartPrice;
+
+    /**
+     * Storefront is shown for any item that belongs to an eBay Store owner, regardless
+     * of whether it is fixed price or auction type. Not returned for International
+     * Fixed Price items.
+     */
+    var $Storefront;
+
+    /**
+     * Subtitle to use in addition to the title. Provides more keywords when buyers
+     * search in titles and descriptions.
+     */
+    var $SubTitle;
+
+    /**
+     * Time until the the end of the listing (e.g., the amount of time left in an
+     * active auction).
+     */
+    var $TimeLeft;
+
+    /**
+     * Name of the item as it appears for auctions.
+     */
+    var $Title;
+
+    /**
+     * Universally unique constraint tag. The UUID is unique to a category.
+     */
+    var $UUID;
+
+    /**
+     * VAT info container.
+     */
+    var $VATDetails;
+
+    /**
+     * Item picture information for pictures hosted at vendor (i.e., remote) site.
+     */
+    var $VendorHostedPicture;
+
+    function ItemType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ApplicationData' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ListOfAttributeSets' => 
+              array (
+                'required' => false,
+                'type' => 'ListOfAttributeSetType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AutoPay' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BuyerProtection' => 
+              array (
+                'required' => false,
+                'type' => 'BuyerProtectionCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BuyItNowPrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Charity' => 
+              array (
+                'required' => false,
+                'type' => 'CharityType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Country' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CrossPromotion' => 
+              array (
+                'required' => false,
+                'type' => 'CrossPromotionsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Currency' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Description' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Escrow' => 
+              array (
+                'required' => false,
+                'type' => 'EscrowCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'GiftIcon' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'GiftServices' => 
+              array (
+                'required' => false,
+                'type' => 'GiftServicesCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'HitCounter' => 
+              array (
+                'required' => false,
+                'type' => 'HitCounterCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ItemID' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ListingDetails' => 
+              array (
+                'required' => false,
+                'type' => 'ListingDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ListingDesigner' => 
+              array (
+                'required' => false,
+                'type' => 'ListingDesignerType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ListingDuration' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ListingEnhancement' => 
+              array (
+                'required' => false,
+                'type' => 'ListingEnhancementsCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ListingType' => 
+              array (
+                'required' => false,
+                'type' => 'ListingTypeCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Location' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PartnerCode' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PartnerName' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentMethods' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayPalEmailAddress' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PrimaryCategory' => 
+              array (
+                'required' => false,
+                'type' => 'CategoryType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PrivateListing' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Quantity' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'RegionID' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'RelistLink' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReservePrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReviseStatus' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ScheduleTime' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SecondaryCategory' => 
+              array (
+                'required' => false,
+                'type' => 'CategoryType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SiteHostedPicture' => 
+              array (
+                'required' => false,
+                'type' => 'SiteHostedPictureType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Seller' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SellingStatus' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingOption' => 
+              array (
+                'required' => false,
+                'type' => 'ShippingOptionCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingDetails' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingRegions' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingTerms' => 
+              array (
+                'required' => false,
+                'type' => 'ShippingTermsCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Site' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'StartPrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Storefront' => 
+              array (
+                'required' => false,
+                'type' => 'StorefrontType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SubTitle' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'TimeLeft' => 
+              array (
+                'required' => false,
+                'type' => 'duration',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Title' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'UUID' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'VATDetails' => 
+              array (
+                'required' => false,
+                'type' => 'VATDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'VendorHostedPicture' => 
+              array (
+                'required' => false,
+                'type' => 'VendorHostedPictureType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getApplicationData()
+    {
+        return $this->ApplicationData;
+    }
+    function setApplicationData($ApplicationData, $charset = 'iso-8859-1')
+    {
+        $this->ApplicationData = $ApplicationData;
+        $this->_elements['ApplicationData']['charset'] = $charset;
+    }
+    function getListOfAttributeSets()
+    {
+        return $this->ListOfAttributeSets;
+    }
+    function setListOfAttributeSets($ListOfAttributeSets, $charset = 'iso-8859-1')
+    {
+        $this->ListOfAttributeSets = $ListOfAttributeSets;
+        $this->_elements['ListOfAttributeSets']['charset'] = $charset;
+    }
+    function getAutoPay()
+    {
+        return $this->AutoPay;
+    }
+    function setAutoPay($AutoPay, $charset = 'iso-8859-1')
+    {
+        $this->AutoPay = $AutoPay;
+        $this->_elements['AutoPay']['charset'] = $charset;
+    }
+    function getBuyerProtection()
+    {
+        return $this->BuyerProtection;
+    }
+    function setBuyerProtection($BuyerProtection, $charset = 'iso-8859-1')
+    {
+        $this->BuyerProtection = $BuyerProtection;
+        $this->_elements['BuyerProtection']['charset'] = $charset;
+    }
+    function getBuyItNowPrice()
+    {
+        return $this->BuyItNowPrice;
+    }
+    function setBuyItNowPrice($BuyItNowPrice, $charset = 'iso-8859-1')
+    {
+        $this->BuyItNowPrice = $BuyItNowPrice;
+        $this->_elements['BuyItNowPrice']['charset'] = $charset;
+    }
+    function getCharity()
+    {
+        return $this->Charity;
+    }
+    function setCharity($Charity, $charset = 'iso-8859-1')
+    {
+        $this->Charity = $Charity;
+        $this->_elements['Charity']['charset'] = $charset;
+    }
+    function getCountry()
+    {
+        return $this->Country;
+    }
+    function setCountry($Country, $charset = 'iso-8859-1')
+    {
+        $this->Country = $Country;
+        $this->_elements['Country']['charset'] = $charset;
+    }
+    function getCrossPromotion()
+    {
+        return $this->CrossPromotion;
+    }
+    function setCrossPromotion($CrossPromotion, $charset = 'iso-8859-1')
+    {
+        $this->CrossPromotion = $CrossPromotion;
+        $this->_elements['CrossPromotion']['charset'] = $charset;
+    }
+    function getCurrency()
+    {
+        return $this->Currency;
+    }
+    function setCurrency($Currency, $charset = 'iso-8859-1')
+    {
+        $this->Currency = $Currency;
+        $this->_elements['Currency']['charset'] = $charset;
+    }
+    function getDescription()
+    {
+        return $this->Description;
+    }
+    function setDescription($Description, $charset = 'iso-8859-1')
+    {
+        $this->Description = $Description;
+        $this->_elements['Description']['charset'] = $charset;
+    }
+    function getEscrow()
+    {
+        return $this->Escrow;
+    }
+    function setEscrow($Escrow, $charset = 'iso-8859-1')
+    {
+        $this->Escrow = $Escrow;
+        $this->_elements['Escrow']['charset'] = $charset;
+    }
+    function getGiftIcon()
+    {
+        return $this->GiftIcon;
+    }
+    function setGiftIcon($GiftIcon, $charset = 'iso-8859-1')
+    {
+        $this->GiftIcon = $GiftIcon;
+        $this->_elements['GiftIcon']['charset'] = $charset;
+    }
+    function getGiftServices()
+    {
+        return $this->GiftServices;
+    }
+    function setGiftServices($GiftServices, $charset = 'iso-8859-1')
+    {
+        $this->GiftServices = $GiftServices;
+        $this->_elements['GiftServices']['charset'] = $charset;
+    }
+    function getHitCounter()
+    {
+        return $this->HitCounter;
+    }
+    function setHitCounter($HitCounter, $charset = 'iso-8859-1')
+    {
+        $this->HitCounter = $HitCounter;
+        $this->_elements['HitCounter']['charset'] = $charset;
+    }
+    function getItemID()
+    {
+        return $this->ItemID;
+    }
+    function setItemID($ItemID, $charset = 'iso-8859-1')
+    {
+        $this->ItemID = $ItemID;
+        $this->_elements['ItemID']['charset'] = $charset;
+    }
+    function getListingDetails()
+    {
+        return $this->ListingDetails;
+    }
+    function setListingDetails($ListingDetails, $charset = 'iso-8859-1')
+    {
+        $this->ListingDetails = $ListingDetails;
+        $this->_elements['ListingDetails']['charset'] = $charset;
+    }
+    function getListingDesigner()
+    {
+        return $this->ListingDesigner;
+    }
+    function setListingDesigner($ListingDesigner, $charset = 'iso-8859-1')
+    {
+        $this->ListingDesigner = $ListingDesigner;
+        $this->_elements['ListingDesigner']['charset'] = $charset;
+    }
+    function getListingDuration()
+    {
+        return $this->ListingDuration;
+    }
+    function setListingDuration($ListingDuration, $charset = 'iso-8859-1')
+    {
+        $this->ListingDuration = $ListingDuration;
+        $this->_elements['ListingDuration']['charset'] = $charset;
+    }
+    function getListingEnhancement()
+    {
+        return $this->ListingEnhancement;
+    }
+    function setListingEnhancement($ListingEnhancement, $charset = 'iso-8859-1')
+    {
+        $this->ListingEnhancement = $ListingEnhancement;
+        $this->_elements['ListingEnhancement']['charset'] = $charset;
+    }
+    function getListingType()
+    {
+        return $this->ListingType;
+    }
+    function setListingType($ListingType, $charset = 'iso-8859-1')
+    {
+        $this->ListingType = $ListingType;
+        $this->_elements['ListingType']['charset'] = $charset;
+    }
+    function getLocation()
+    {
+        return $this->Location;
+    }
+    function setLocation($Location, $charset = 'iso-8859-1')
+    {
+        $this->Location = $Location;
+        $this->_elements['Location']['charset'] = $charset;
+    }
+    function getPartnerCode()
+    {
+        return $this->PartnerCode;
+    }
+    function setPartnerCode($PartnerCode, $charset = 'iso-8859-1')
+    {
+        $this->PartnerCode = $PartnerCode;
+        $this->_elements['PartnerCode']['charset'] = $charset;
+    }
+    function getPartnerName()
+    {
+        return $this->PartnerName;
+    }
+    function setPartnerName($PartnerName, $charset = 'iso-8859-1')
+    {
+        $this->PartnerName = $PartnerName;
+        $this->_elements['PartnerName']['charset'] = $charset;
+    }
+    function getPaymentMethods()
+    {
+        return $this->PaymentMethods;
+    }
+    function setPaymentMethods($PaymentMethods, $charset = 'iso-8859-1')
+    {
+        $this->PaymentMethods = $PaymentMethods;
+        $this->_elements['PaymentMethods']['charset'] = $charset;
+    }
+    function getPayPalEmailAddress()
+    {
+        return $this->PayPalEmailAddress;
+    }
+    function setPayPalEmailAddress($PayPalEmailAddress, $charset = 'iso-8859-1')
+    {
+        $this->PayPalEmailAddress = $PayPalEmailAddress;
+        $this->_elements['PayPalEmailAddress']['charset'] = $charset;
+    }
+    function getPrimaryCategory()
+    {
+        return $this->PrimaryCategory;
+    }
+    function setPrimaryCategory($PrimaryCategory, $charset = 'iso-8859-1')
+    {
+        $this->PrimaryCategory = $PrimaryCategory;
+        $this->_elements['PrimaryCategory']['charset'] = $charset;
+    }
+    function getPrivateListing()
+    {
+        return $this->PrivateListing;
+    }
+    function setPrivateListing($PrivateListing, $charset = 'iso-8859-1')
+    {
+        $this->PrivateListing = $PrivateListing;
+        $this->_elements['PrivateListing']['charset'] = $charset;
+    }
+    function getQuantity()
+    {
+        return $this->Quantity;
+    }
+    function setQuantity($Quantity, $charset = 'iso-8859-1')
+    {
+        $this->Quantity = $Quantity;
+        $this->_elements['Quantity']['charset'] = $charset;
+    }
+    function getRegionID()
+    {
+        return $this->RegionID;
+    }
+    function setRegionID($RegionID, $charset = 'iso-8859-1')
+    {
+        $this->RegionID = $RegionID;
+        $this->_elements['RegionID']['charset'] = $charset;
+    }
+    function getRelistLink()
+    {
+        return $this->RelistLink;
+    }
+    function setRelistLink($RelistLink, $charset = 'iso-8859-1')
+    {
+        $this->RelistLink = $RelistLink;
+        $this->_elements['RelistLink']['charset'] = $charset;
+    }
+    function getReservePrice()
+    {
+        return $this->ReservePrice;
+    }
+    function setReservePrice($ReservePrice, $charset = 'iso-8859-1')
+    {
+        $this->ReservePrice = $ReservePrice;
+        $this->_elements['ReservePrice']['charset'] = $charset;
+    }
+    function getReviseStatus()
+    {
+        return $this->ReviseStatus;
+    }
+    function setReviseStatus($ReviseStatus, $charset = 'iso-8859-1')
+    {
+        $this->ReviseStatus = $ReviseStatus;
+        $this->_elements['ReviseStatus']['charset'] = $charset;
+    }
+    function getScheduleTime()
+    {
+        return $this->ScheduleTime;
+    }
+    function setScheduleTime($ScheduleTime, $charset = 'iso-8859-1')
+    {
+        $this->ScheduleTime = $ScheduleTime;
+        $this->_elements['ScheduleTime']['charset'] = $charset;
+    }
+    function getSecondaryCategory()
+    {
+        return $this->SecondaryCategory;
+    }
+    function setSecondaryCategory($SecondaryCategory, $charset = 'iso-8859-1')
+    {
+        $this->SecondaryCategory = $SecondaryCategory;
+        $this->_elements['SecondaryCategory']['charset'] = $charset;
+    }
+    function getSiteHostedPicture()
+    {
+        return $this->SiteHostedPicture;
+    }
+    function setSiteHostedPicture($SiteHostedPicture, $charset = 'iso-8859-1')
+    {
+        $this->SiteHostedPicture = $SiteHostedPicture;
+        $this->_elements['SiteHostedPicture']['charset'] = $charset;
+    }
+    function getSeller()
+    {
+        return $this->Seller;
+    }
+    function setSeller($Seller, $charset = 'iso-8859-1')
+    {
+        $this->Seller = $Seller;
+        $this->_elements['Seller']['charset'] = $charset;
+    }
+    function getSellingStatus()
+    {
+        return $this->SellingStatus;
+    }
+    function setSellingStatus($SellingStatus, $charset = 'iso-8859-1')
+    {
+        $this->SellingStatus = $SellingStatus;
+        $this->_elements['SellingStatus']['charset'] = $charset;
+    }
+    function getShippingOption()
+    {
+        return $this->ShippingOption;
+    }
+    function setShippingOption($ShippingOption, $charset = 'iso-8859-1')
+    {
+        $this->ShippingOption = $ShippingOption;
+        $this->_elements['ShippingOption']['charset'] = $charset;
+    }
+    function getShippingDetails()
+    {
+        return $this->ShippingDetails;
+    }
+    function setShippingDetails($ShippingDetails, $charset = 'iso-8859-1')
+    {
+        $this->ShippingDetails = $ShippingDetails;
+        $this->_elements['ShippingDetails']['charset'] = $charset;
+    }
+    function getShippingRegions()
+    {
+        return $this->ShippingRegions;
+    }
+    function setShippingRegions($ShippingRegions, $charset = 'iso-8859-1')
+    {
+        $this->ShippingRegions = $ShippingRegions;
+        $this->_elements['ShippingRegions']['charset'] = $charset;
+    }
+    function getShippingTerms()
+    {
+        return $this->ShippingTerms;
+    }
+    function setShippingTerms($ShippingTerms, $charset = 'iso-8859-1')
+    {
+        $this->ShippingTerms = $ShippingTerms;
+        $this->_elements['ShippingTerms']['charset'] = $charset;
+    }
+    function getSite()
+    {
+        return $this->Site;
+    }
+    function setSite($Site, $charset = 'iso-8859-1')
+    {
+        $this->Site = $Site;
+        $this->_elements['Site']['charset'] = $charset;
+    }
+    function getStartPrice()
+    {
+        return $this->StartPrice;
+    }
+    function setStartPrice($StartPrice, $charset = 'iso-8859-1')
+    {
+        $this->StartPrice = $StartPrice;
+        $this->_elements['StartPrice']['charset'] = $charset;
+    }
+    function getStorefront()
+    {
+        return $this->Storefront;
+    }
+    function setStorefront($Storefront, $charset = 'iso-8859-1')
+    {
+        $this->Storefront = $Storefront;
+        $this->_elements['Storefront']['charset'] = $charset;
+    }
+    function getSubTitle()
+    {
+        return $this->SubTitle;
+    }
+    function setSubTitle($SubTitle, $charset = 'iso-8859-1')
+    {
+        $this->SubTitle = $SubTitle;
+        $this->_elements['SubTitle']['charset'] = $charset;
+    }
+    function getTimeLeft()
+    {
+        return $this->TimeLeft;
+    }
+    function setTimeLeft($TimeLeft, $charset = 'iso-8859-1')
+    {
+        $this->TimeLeft = $TimeLeft;
+        $this->_elements['TimeLeft']['charset'] = $charset;
+    }
+    function getTitle()
+    {
+        return $this->Title;
+    }
+    function setTitle($Title, $charset = 'iso-8859-1')
+    {
+        $this->Title = $Title;
+        $this->_elements['Title']['charset'] = $charset;
+    }
+    function getUUID()
+    {
+        return $this->UUID;
+    }
+    function setUUID($UUID, $charset = 'iso-8859-1')
+    {
+        $this->UUID = $UUID;
+        $this->_elements['UUID']['charset'] = $charset;
+    }
+    function getVATDetails()
+    {
+        return $this->VATDetails;
+    }
+    function setVATDetails($VATDetails, $charset = 'iso-8859-1')
+    {
+        $this->VATDetails = $VATDetails;
+        $this->_elements['VATDetails']['charset'] = $charset;
+    }
+    function getVendorHostedPicture()
+    {
+        return $this->VendorHostedPicture;
+    }
+    function setVendorHostedPicture($VendorHostedPicture, $charset = 'iso-8859-1')
+    {
+        $this->VendorHostedPicture = $VendorHostedPicture;
+        $this->_elements['VendorHostedPicture']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListOfAttributeSetType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListOfAttributeSetType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListOfAttributeSetType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ListOfAttributeSetType
+ *
+ * @package Services_PayPal
+ */
+class ListOfAttributeSetType extends XSDType
+{
+    var $AttributeSet;
+
+    function ListOfAttributeSetType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AttributeSet' => 
+              array (
+                'required' => true,
+                'type' => 'AttributeSetType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAttributeSet()
+    {
+        return $this->AttributeSet;
+    }
+    function setAttributeSet($AttributeSet, $charset = 'iso-8859-1')
+    {
+        $this->AttributeSet = $AttributeSet;
+        $this->_elements['AttributeSet']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListingDesignerType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListingDesignerType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListingDesignerType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,91 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ListingDesignerType
+ * 
+ * Identifies the Layout and the Theme template associated with the item. in case
+ * of revision - all data can be min occur = 0
+ *
+ * @package Services_PayPal
+ */
+class ListingDesignerType extends XSDType
+{
+    /**
+     * Identifies the Layout template associated with the item.
+     */
+    var $LayoutID;
+
+    /**
+     * A value of true for OptimalPictureSize indicates that the picture URL will be
+     * enlarged to fit description of the item.
+     */
+    var $OptimalPictureSize;
+
+    /**
+     * Identifies the Theme template associated with the item.
+     */
+    var $ThemeID;
+
+    function ListingDesignerType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'LayoutID' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'OptimalPictureSize' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ThemeID' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getLayoutID()
+    {
+        return $this->LayoutID;
+    }
+    function setLayoutID($LayoutID, $charset = 'iso-8859-1')
+    {
+        $this->LayoutID = $LayoutID;
+        $this->_elements['LayoutID']['charset'] = $charset;
+    }
+    function getOptimalPictureSize()
+    {
+        return $this->OptimalPictureSize;
+    }
+    function setOptimalPictureSize($OptimalPictureSize, $charset = 'iso-8859-1')
+    {
+        $this->OptimalPictureSize = $OptimalPictureSize;
+        $this->_elements['OptimalPictureSize']['charset'] = $charset;
+    }
+    function getThemeID()
+    {
+        return $this->ThemeID;
+    }
+    function setThemeID($ThemeID, $charset = 'iso-8859-1')
+    {
+        $this->ThemeID = $ThemeID;
+        $this->_elements['ThemeID']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListingDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListingDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ListingDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,283 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ListingDetailsType
+ * 
+ * Contains the listed item details which consists of following information: .
+ *
+ * @package Services_PayPal
+ */
+class ListingDetailsType extends XSDType
+{
+    var $Adult;
+
+    var $BindingAuction;
+
+    var $CheckoutEnabled;
+
+    /**
+     * Converted value of the BuyItNowPrice in the currency indicated by SiteCurrency.
+     * This value must be refreshed every 24 hours to pick up the current conversion
+     * rates.
+     */
+    var $ConvertedBuyItNowPrice;
+
+    /**
+     * Converted value of the StartPrice field in the currency indicated by
+     * SiteCurrency. This value must be refreshed every 24 hours to pick up the current
+     * conversion rates.
+     */
+    var $ConvertedStartPrice;
+
+    /**
+     * Indicates the converted reserve price for a reserve auction. Returned only if
+     * DetailLevel = 4. ReservePrice is only returned for auctions with a reserve price
+     * where the user calling GetItem is the item's seller. Returned as null for
+     * International Fixed Price items. For more information on reserve price auctions,
+     * see http://pages.ebay.com/help/basics/f-format.html#1.
+     */
+    var $ConvertedReservePrice;
+
+    var $HasReservePrice;
+
+    var $RegionName;
+
+    /**
+     * Indicates the new ItemID for a relisted item. When an item is relisted, the old
+     * (expired) listing is annotated with the new (relist) ItemID. This field only
+     * appears when the old listing is retrieved.
+     */
+    var $RelistedItemID;
+
+    /**
+     * The ItemID for the original listing (i.e., OriginalItemID specific to Second
+     * Chance Offer items).
+     */
+    var $SecondChanceOriginalItemID;
+
+    /**
+     * Time stamp for the start of the listing (in GMT). For regular items, StartTime
+     * is not sent in at listing time.
+     */
+    var $StartTime;
+
+    /**
+     * Time stamp for the end of the listing (in GMT).
+     */
+    var $EndTime;
+
+    var $ViewItemURL;
+
+    function ListingDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Adult' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BindingAuction' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CheckoutEnabled' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ConvertedBuyItNowPrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ConvertedStartPrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ConvertedReservePrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'HasReservePrice' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'RegionName' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'RelistedItemID' => 
+              array (
+                'required' => false,
+                'type' => 'ItemIDType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SecondChanceOriginalItemID' => 
+              array (
+                'required' => false,
+                'type' => 'ItemIDType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'StartTime' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'EndTime' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ViewItemURL' => 
+              array (
+                'required' => false,
+                'type' => 'anyURI',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAdult()
+    {
+        return $this->Adult;
+    }
+    function setAdult($Adult, $charset = 'iso-8859-1')
+    {
+        $this->Adult = $Adult;
+        $this->_elements['Adult']['charset'] = $charset;
+    }
+    function getBindingAuction()
+    {
+        return $this->BindingAuction;
+    }
+    function setBindingAuction($BindingAuction, $charset = 'iso-8859-1')
+    {
+        $this->BindingAuction = $BindingAuction;
+        $this->_elements['BindingAuction']['charset'] = $charset;
+    }
+    function getCheckoutEnabled()
+    {
+        return $this->CheckoutEnabled;
+    }
+    function setCheckoutEnabled($CheckoutEnabled, $charset = 'iso-8859-1')
+    {
+        $this->CheckoutEnabled = $CheckoutEnabled;
+        $this->_elements['CheckoutEnabled']['charset'] = $charset;
+    }
+    function getConvertedBuyItNowPrice()
+    {
+        return $this->ConvertedBuyItNowPrice;
+    }
+    function setConvertedBuyItNowPrice($ConvertedBuyItNowPrice, $charset = 'iso-8859-1')
+    {
+        $this->ConvertedBuyItNowPrice = $ConvertedBuyItNowPrice;
+        $this->_elements['ConvertedBuyItNowPrice']['charset'] = $charset;
+    }
+    function getConvertedStartPrice()
+    {
+        return $this->ConvertedStartPrice;
+    }
+    function setConvertedStartPrice($ConvertedStartPrice, $charset = 'iso-8859-1')
+    {
+        $this->ConvertedStartPrice = $ConvertedStartPrice;
+        $this->_elements['ConvertedStartPrice']['charset'] = $charset;
+    }
+    function getConvertedReservePrice()
+    {
+        return $this->ConvertedReservePrice;
+    }
+    function setConvertedReservePrice($ConvertedReservePrice, $charset = 'iso-8859-1')
+    {
+        $this->ConvertedReservePrice = $ConvertedReservePrice;
+        $this->_elements['ConvertedReservePrice']['charset'] = $charset;
+    }
+    function getHasReservePrice()
+    {
+        return $this->HasReservePrice;
+    }
+    function setHasReservePrice($HasReservePrice, $charset = 'iso-8859-1')
+    {
+        $this->HasReservePrice = $HasReservePrice;
+        $this->_elements['HasReservePrice']['charset'] = $charset;
+    }
+    function getRegionName()
+    {
+        return $this->RegionName;
+    }
+    function setRegionName($RegionName, $charset = 'iso-8859-1')
+    {
+        $this->RegionName = $RegionName;
+        $this->_elements['RegionName']['charset'] = $charset;
+    }
+    function getRelistedItemID()
+    {
+        return $this->RelistedItemID;
+    }
+    function setRelistedItemID($RelistedItemID, $charset = 'iso-8859-1')
+    {
+        $this->RelistedItemID = $RelistedItemID;
+        $this->_elements['RelistedItemID']['charset'] = $charset;
+    }
+    function getSecondChanceOriginalItemID()
+    {
+        return $this->SecondChanceOriginalItemID;
+    }
+    function setSecondChanceOriginalItemID($SecondChanceOriginalItemID, $charset = 'iso-8859-1')
+    {
+        $this->SecondChanceOriginalItemID = $SecondChanceOriginalItemID;
+        $this->_elements['SecondChanceOriginalItemID']['charset'] = $charset;
+    }
+    function getStartTime()
+    {
+        return $this->StartTime;
+    }
+    function setStartTime($StartTime, $charset = 'iso-8859-1')
+    {
+        $this->StartTime = $StartTime;
+        $this->_elements['StartTime']['charset'] = $charset;
+    }
+    function getEndTime()
+    {
+        return $this->EndTime;
+    }
+    function setEndTime($EndTime, $charset = 'iso-8859-1')
+    {
+        $this->EndTime = $EndTime;
+        $this->_elements['EndTime']['charset'] = $charset;
+    }
+    function getViewItemURL()
+    {
+        return $this->ViewItemURL;
+    }
+    function setViewItemURL($ViewItemURL, $charset = 'iso-8859-1')
+    {
+        $this->ViewItemURL = $ViewItemURL;
+        $this->_elements['ViewItemURL']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayRequestItemType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayRequestItemType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayRequestItemType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,98 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * MassPayRequestItemType
+ * 
+ * MassPayRequestItemType - Type declaration to be used by other schemas. Request
+ * data from the mass pay request
+ *
+ * @package Services_PayPal
+ */
+class MassPayRequestItemType extends XSDType
+{
+    var $ReceiverEmail;
+
+    var $Amount;
+
+    var $UniqueId;
+
+    var $Note;
+
+    function MassPayRequestItemType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ReceiverEmail' => 
+              array (
+                'required' => true,
+                'type' => 'EmailAddressType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Amount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'UniqueId' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Note' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getReceiverEmail()
+    {
+        return $this->ReceiverEmail;
+    }
+    function setReceiverEmail($ReceiverEmail, $charset = 'iso-8859-1')
+    {
+        $this->ReceiverEmail = $ReceiverEmail;
+        $this->_elements['ReceiverEmail']['charset'] = $charset;
+    }
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+    function getUniqueId()
+    {
+        return $this->UniqueId;
+    }
+    function setUniqueId($UniqueId, $charset = 'iso-8859-1')
+    {
+        $this->UniqueId = $UniqueId;
+        $this->_elements['UniqueId']['charset'] = $charset;
+    }
+    function getNote()
+    {
+        return $this->Note;
+    }
+    function setNote($Note, $charset = 'iso-8859-1')
+    {
+        $this->Note = $Note;
+        $this->_elements['Note']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * MassPayRequestType
+ *
+ * @package Services_PayPal
+ */
+class MassPayRequestType extends AbstractRequestType
+{
+    var $EmailSubject;
+
+    var $MassPayItem;
+
+    function MassPayRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'EmailSubject' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'MassPayItem' => 
+              array (
+                'required' => true,
+                'type' => 'MassPayRequestItemType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getEmailSubject()
+    {
+        return $this->EmailSubject;
+    }
+    function setEmailSubject($EmailSubject, $charset = 'iso-8859-1')
+    {
+        $this->EmailSubject = $EmailSubject;
+        $this->_elements['EmailSubject']['charset'] = $charset;
+    }
+    function getMassPayItem()
+    {
+        return $this->MassPayItem;
+    }
+    function setMassPayItem($MassPayItem, $charset = 'iso-8859-1')
+    {
+        $this->MassPayItem = $MassPayItem;
+        $this->_elements['MassPayItem']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/MassPayResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * MassPayResponseType
+ *
+ * @package Services_PayPal
+ */
+class MassPayResponseType extends AbstractResponseType
+{
+    function MassPayResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/MeasureType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/MeasureType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/MeasureType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDSimpleType.php';
+
+/**
+ * MeasureType
+ *
+ * @package Services_PayPal
+ */
+class MeasureType extends XSDSimpleType
+{
+    function MeasureType()
+    {
+        parent::XSDSimpleType();
+        $this->_namespace = 'urn:ebay:apis:CoreComponentTypes';
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'unit' => 
+              array (
+                'name' => 'unit',
+                'type' => 'xs:token',
+                'use' => 'required',
+              ),
+            ));
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullInfoType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullInfoType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullInfoType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * MerchantPullInfoType
+ * 
+ * MerchantPullInfoType - Type declaration to be used by other schemas. Information
+ * about the merchant pull.
+ *
+ * @package Services_PayPal
+ */
+class MerchantPullInfoType extends XSDType
+{
+    var $MpStatus;
+
+    var $MpMax;
+
+    var $MpCustom;
+
+    var $Desc;
+
+    var $Invoice;
+
+    var $Custom;
+
+    var $PaymentSourceID;
+
+    function MerchantPullInfoType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'MpStatus' => 
+              array (
+                'required' => true,
+                'type' => 'MerchantPullStatusCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MpMax' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MpCustom' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Desc' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Invoice' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Custom' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentSourceID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getMpStatus()
+    {
+        return $this->MpStatus;
+    }
+    function setMpStatus($MpStatus, $charset = 'iso-8859-1')
+    {
+        $this->MpStatus = $MpStatus;
+        $this->_elements['MpStatus']['charset'] = $charset;
+    }
+    function getMpMax()
+    {
+        return $this->MpMax;
+    }
+    function setMpMax($MpMax, $charset = 'iso-8859-1')
+    {
+        $this->MpMax = $MpMax;
+        $this->_elements['MpMax']['charset'] = $charset;
+    }
+    function getMpCustom()
+    {
+        return $this->MpCustom;
+    }
+    function setMpCustom($MpCustom, $charset = 'iso-8859-1')
+    {
+        $this->MpCustom = $MpCustom;
+        $this->_elements['MpCustom']['charset'] = $charset;
+    }
+    function getDesc()
+    {
+        return $this->Desc;
+    }
+    function setDesc($Desc, $charset = 'iso-8859-1')
+    {
+        $this->Desc = $Desc;
+        $this->_elements['Desc']['charset'] = $charset;
+    }
+    function getInvoice()
+    {
+        return $this->Invoice;
+    }
+    function setInvoice($Invoice, $charset = 'iso-8859-1')
+    {
+        $this->Invoice = $Invoice;
+        $this->_elements['Invoice']['charset'] = $charset;
+    }
+    function getCustom()
+    {
+        return $this->Custom;
+    }
+    function setCustom($Custom, $charset = 'iso-8859-1')
+    {
+        $this->Custom = $Custom;
+        $this->_elements['Custom']['charset'] = $charset;
+    }
+    function getPaymentSourceID()
+    {
+        return $this->PaymentSourceID;
+    }
+    function setPaymentSourceID($PaymentSourceID, $charset = 'iso-8859-1')
+    {
+        $this->PaymentSourceID = $PaymentSourceID;
+        $this->_elements['PaymentSourceID']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullPaymentResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullPaymentResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullPaymentResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * MerchantPullPaymentResponseType
+ * 
+ * MerchantPullPaymentResponseType - Type declaration to be used by other schemas.
+ * Response data from the merchant pull.
+ *
+ * @package Services_PayPal
+ */
+class MerchantPullPaymentResponseType extends XSDType
+{
+    var $PayerInfo;
+
+    var $PaymentInfo;
+
+    var $MerchantPullInfo;
+
+    function MerchantPullPaymentResponseType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'PayerInfo' => 
+              array (
+                'required' => true,
+                'type' => 'PayerInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentInfo' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MerchantPullInfo' => 
+              array (
+                'required' => true,
+                'type' => 'MerchantPullInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getPayerInfo()
+    {
+        return $this->PayerInfo;
+    }
+    function setPayerInfo($PayerInfo, $charset = 'iso-8859-1')
+    {
+        $this->PayerInfo = $PayerInfo;
+        $this->_elements['PayerInfo']['charset'] = $charset;
+    }
+    function getPaymentInfo()
+    {
+        return $this->PaymentInfo;
+    }
+    function setPaymentInfo($PaymentInfo, $charset = 'iso-8859-1')
+    {
+        $this->PaymentInfo = $PaymentInfo;
+        $this->_elements['PaymentInfo']['charset'] = $charset;
+    }
+    function getMerchantPullInfo()
+    {
+        return $this->MerchantPullInfo;
+    }
+    function setMerchantPullInfo($MerchantPullInfo, $charset = 'iso-8859-1')
+    {
+        $this->MerchantPullInfo = $MerchantPullInfo;
+        $this->_elements['MerchantPullInfo']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullPaymentType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullPaymentType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/MerchantPullPaymentType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,251 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * MerchantPullPaymentType
+ * 
+ * MerchantPullPayment - Type declaration to be used by other schemas. Parameters
+ * to make initiate a pull payment
+ *
+ * @package Services_PayPal
+ */
+class MerchantPullPaymentType extends XSDType
+{
+    var $Amount;
+
+    var $MpID;
+
+    var $PaymentType;
+
+    var $Memo;
+
+    var $EmailSubject;
+
+    var $Tax;
+
+    var $Shipping;
+
+    var $Handling;
+
+    var $ItemName;
+
+    var $ItemNumber;
+
+    var $Invoice;
+
+    var $Custom;
+
+    var $ButtonSource;
+
+    function MerchantPullPaymentType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Amount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MpID' => 
+              array (
+                'required' => true,
+                'type' => 'MerchantPullIDType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentType' => 
+              array (
+                'required' => false,
+                'type' => 'MerchantPullPaymentCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Memo' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'EmailSubject' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Tax' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Shipping' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Handling' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ItemName' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ItemNumber' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Invoice' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Custom' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ButtonSource' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+    function getMpID()
+    {
+        return $this->MpID;
+    }
+    function setMpID($MpID, $charset = 'iso-8859-1')
+    {
+        $this->MpID = $MpID;
+        $this->_elements['MpID']['charset'] = $charset;
+    }
+    function getPaymentType()
+    {
+        return $this->PaymentType;
+    }
+    function setPaymentType($PaymentType, $charset = 'iso-8859-1')
+    {
+        $this->PaymentType = $PaymentType;
+        $this->_elements['PaymentType']['charset'] = $charset;
+    }
+    function getMemo()
+    {
+        return $this->Memo;
+    }
+    function setMemo($Memo, $charset = 'iso-8859-1')
+    {
+        $this->Memo = $Memo;
+        $this->_elements['Memo']['charset'] = $charset;
+    }
+    function getEmailSubject()
+    {
+        return $this->EmailSubject;
+    }
+    function setEmailSubject($EmailSubject, $charset = 'iso-8859-1')
+    {
+        $this->EmailSubject = $EmailSubject;
+        $this->_elements['EmailSubject']['charset'] = $charset;
+    }
+    function getTax()
+    {
+        return $this->Tax;
+    }
+    function setTax($Tax, $charset = 'iso-8859-1')
+    {
+        $this->Tax = $Tax;
+        $this->_elements['Tax']['charset'] = $charset;
+    }
+    function getShipping()
+    {
+        return $this->Shipping;
+    }
+    function setShipping($Shipping, $charset = 'iso-8859-1')
+    {
+        $this->Shipping = $Shipping;
+        $this->_elements['Shipping']['charset'] = $charset;
+    }
+    function getHandling()
+    {
+        return $this->Handling;
+    }
+    function setHandling($Handling, $charset = 'iso-8859-1')
+    {
+        $this->Handling = $Handling;
+        $this->_elements['Handling']['charset'] = $charset;
+    }
+    function getItemName()
+    {
+        return $this->ItemName;
+    }
+    function setItemName($ItemName, $charset = 'iso-8859-1')
+    {
+        $this->ItemName = $ItemName;
+        $this->_elements['ItemName']['charset'] = $charset;
+    }
+    function getItemNumber()
+    {
+        return $this->ItemNumber;
+    }
+    function setItemNumber($ItemNumber, $charset = 'iso-8859-1')
+    {
+        $this->ItemNumber = $ItemNumber;
+        $this->_elements['ItemNumber']['charset'] = $charset;
+    }
+    function getInvoice()
+    {
+        return $this->Invoice;
+    }
+    function setInvoice($Invoice, $charset = 'iso-8859-1')
+    {
+        $this->Invoice = $Invoice;
+        $this->_elements['Invoice']['charset'] = $charset;
+    }
+    function getCustom()
+    {
+        return $this->Custom;
+    }
+    function setCustom($Custom, $charset = 'iso-8859-1')
+    {
+        $this->Custom = $Custom;
+        $this->_elements['Custom']['charset'] = $charset;
+    }
+    function getButtonSource()
+    {
+        return $this->ButtonSource;
+    }
+    function setButtonSource($ButtonSource, $charset = 'iso-8859-1')
+    {
+        $this->ButtonSource = $ButtonSource;
+        $this->_elements['ButtonSource']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ModifiedFieldType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ModifiedFieldType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ModifiedFieldType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ModifiedFieldType
+ *
+ * @package Services_PayPal
+ */
+class ModifiedFieldType extends XSDType
+{
+    var $Field;
+
+    var $ModifyType;
+
+    function ModifiedFieldType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Field' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ModifyType' => 
+              array (
+                'required' => false,
+                'type' => 'ModifyCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getField()
+    {
+        return $this->Field;
+    }
+    function setField($Field, $charset = 'iso-8859-1')
+    {
+        $this->Field = $Field;
+        $this->_elements['Field']['charset'] = $charset;
+    }
+    function getModifyType()
+    {
+        return $this->ModifyType;
+    }
+    function setModifyType($ModifyType, $charset = 'iso-8859-1')
+    {
+        $this->ModifyType = $ModifyType;
+        $this->_elements['ModifyType']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/OptionType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/OptionType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/OptionType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * OptionType
+ * 
+ * OptionType - Type declaration to be used by other schemas. PayPal item options
+ * for shopping cart.
+ *
+ * @package Services_PayPal
+ */
+class OptionType extends XSDType
+{
+    function OptionType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'name' => 
+              array (
+                'name' => 'name',
+                'type' => 'xs:string',
+                'use' => 'required',
+              ),
+              'value' => 
+              array (
+                'name' => 'value',
+                'type' => 'xs:string',
+                'use' => 'required',
+              ),
+            ));
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaginationResultType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaginationResultType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaginationResultType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaginationResultType
+ *
+ * @package Services_PayPal
+ */
+class PaginationResultType extends XSDType
+{
+    var $TotalNumberOfPages;
+
+    var $TotalNumberOfEntries;
+
+    function PaginationResultType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'TotalNumberOfPages' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'TotalNumberOfEntries' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getTotalNumberOfPages()
+    {
+        return $this->TotalNumberOfPages;
+    }
+    function setTotalNumberOfPages($TotalNumberOfPages, $charset = 'iso-8859-1')
+    {
+        $this->TotalNumberOfPages = $TotalNumberOfPages;
+        $this->_elements['TotalNumberOfPages']['charset'] = $charset;
+    }
+    function getTotalNumberOfEntries()
+    {
+        return $this->TotalNumberOfEntries;
+    }
+    function setTotalNumberOfEntries($TotalNumberOfEntries, $charset = 'iso-8859-1')
+    {
+        $this->TotalNumberOfEntries = $TotalNumberOfEntries;
+        $this->_elements['TotalNumberOfEntries']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaginationType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaginationType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaginationType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaginationType
+ *
+ * @package Services_PayPal
+ */
+class PaginationType extends XSDType
+{
+    var $EntriesPerPage;
+
+    var $PageNumber;
+
+    function PaginationType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'EntriesPerPage' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PageNumber' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getEntriesPerPage()
+    {
+        return $this->EntriesPerPage;
+    }
+    function setEntriesPerPage($EntriesPerPage, $charset = 'iso-8859-1')
+    {
+        $this->EntriesPerPage = $EntriesPerPage;
+        $this->_elements['EntriesPerPage']['charset'] = $charset;
+    }
+    function getPageNumber()
+    {
+        return $this->PageNumber;
+    }
+    function setPageNumber($PageNumber, $charset = 'iso-8859-1')
+    {
+        $this->PageNumber = $PageNumber;
+        $this->_elements['PageNumber']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PayerInfoType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PayerInfoType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PayerInfoType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,148 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PayerInfoType
+ * 
+ * PayerInfoType - Type declaration to be used by other schemas. Payer information
+ *
+ * @package Services_PayPal
+ */
+class PayerInfoType extends XSDType
+{
+    var $Payer;
+
+    var $PayerID;
+
+    var $PayerStatus;
+
+    var $PayerName;
+
+    var $PayerCountry;
+
+    var $PayerBusiness;
+
+    var $Address;
+
+    function PayerInfoType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Payer' => 
+              array (
+                'required' => true,
+                'type' => 'EmailAddressType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerID' => 
+              array (
+                'required' => true,
+                'type' => 'UserIDType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerStatus' => 
+              array (
+                'required' => true,
+                'type' => 'PayPalUserStatusCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerName' => 
+              array (
+                'required' => true,
+                'type' => 'PersonNameType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerCountry' => 
+              array (
+                'required' => true,
+                'type' => 'CountryCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerBusiness' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Address' => 
+              array (
+                'required' => false,
+                'type' => 'AddressType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getPayer()
+    {
+        return $this->Payer;
+    }
+    function setPayer($Payer, $charset = 'iso-8859-1')
+    {
+        $this->Payer = $Payer;
+        $this->_elements['Payer']['charset'] = $charset;
+    }
+    function getPayerID()
+    {
+        return $this->PayerID;
+    }
+    function setPayerID($PayerID, $charset = 'iso-8859-1')
+    {
+        $this->PayerID = $PayerID;
+        $this->_elements['PayerID']['charset'] = $charset;
+    }
+    function getPayerStatus()
+    {
+        return $this->PayerStatus;
+    }
+    function setPayerStatus($PayerStatus, $charset = 'iso-8859-1')
+    {
+        $this->PayerStatus = $PayerStatus;
+        $this->_elements['PayerStatus']['charset'] = $charset;
+    }
+    function getPayerName()
+    {
+        return $this->PayerName;
+    }
+    function setPayerName($PayerName, $charset = 'iso-8859-1')
+    {
+        $this->PayerName = $PayerName;
+        $this->_elements['PayerName']['charset'] = $charset;
+    }
+    function getPayerCountry()
+    {
+        return $this->PayerCountry;
+    }
+    function setPayerCountry($PayerCountry, $charset = 'iso-8859-1')
+    {
+        $this->PayerCountry = $PayerCountry;
+        $this->_elements['PayerCountry']['charset'] = $charset;
+    }
+    function getPayerBusiness()
+    {
+        return $this->PayerBusiness;
+    }
+    function setPayerBusiness($PayerBusiness, $charset = 'iso-8859-1')
+    {
+        $this->PayerBusiness = $PayerBusiness;
+        $this->_elements['PayerBusiness']['charset'] = $charset;
+    }
+    function getAddress()
+    {
+        return $this->Address;
+    }
+    function setAddress($Address, $charset = 'iso-8859-1')
+    {
+        $this->Address = $Address;
+        $this->_elements['Address']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentDetailsItemType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentDetailsItemType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentDetailsItemType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,115 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaymentDetailsItemType
+ * 
+ * PaymentDetailsItemType - Type declaration to be used by other schemas.
+ * Information about a Payment Item.
+ *
+ * @package Services_PayPal
+ */
+class PaymentDetailsItemType extends XSDType
+{
+    var $Name;
+
+    var $Number;
+
+    var $Quantity;
+
+    var $Tax;
+
+    var $Amount;
+
+    function PaymentDetailsItemType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Name' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Number' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Quantity' => 
+              array (
+                'required' => false,
+                'type' => 'integer',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Tax' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Amount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getName()
+    {
+        return $this->Name;
+    }
+    function setName($Name, $charset = 'iso-8859-1')
+    {
+        $this->Name = $Name;
+        $this->_elements['Name']['charset'] = $charset;
+    }
+    function getNumber()
+    {
+        return $this->Number;
+    }
+    function setNumber($Number, $charset = 'iso-8859-1')
+    {
+        $this->Number = $Number;
+        $this->_elements['Number']['charset'] = $charset;
+    }
+    function getQuantity()
+    {
+        return $this->Quantity;
+    }
+    function setQuantity($Quantity, $charset = 'iso-8859-1')
+    {
+        $this->Quantity = $Quantity;
+        $this->_elements['Quantity']['charset'] = $charset;
+    }
+    function getTax()
+    {
+        return $this->Tax;
+    }
+    function setTax($Tax, $charset = 'iso-8859-1')
+    {
+        $this->Tax = $Tax;
+        $this->_elements['Tax']['charset'] = $charset;
+    }
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,234 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaymentDetailsType
+ * 
+ * PaymentDetailsType - Type declaration to be used by other schemas. Information
+ * about a payment. Used by DCC and Express Checkout.
+ *
+ * @package Services_PayPal
+ */
+class PaymentDetailsType extends XSDType
+{
+    var $OrderTotal;
+
+    var $ItemTotal;
+
+    var $ShippingTotal;
+
+    var $HandlingTotal;
+
+    var $TaxTotal;
+
+    var $OrderDescription;
+
+    var $Custom;
+
+    var $InvoiceID;
+
+    var $ButtonSource;
+
+    var $NotifyURL;
+
+    var $ShipToAddress;
+
+    var $PaymentDetailsItem;
+
+    function PaymentDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'OrderTotal' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ItemTotal' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingTotal' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'HandlingTotal' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'TaxTotal' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'OrderDescription' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Custom' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InvoiceID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ButtonSource' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'NotifyURL' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShipToAddress' => 
+              array (
+                'required' => false,
+                'type' => 'AddressType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentDetailsItem' => 
+              array (
+                'required' => false,
+                'type' => 'PaymentDetailsItemType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getOrderTotal()
+    {
+        return $this->OrderTotal;
+    }
+    function setOrderTotal($OrderTotal, $charset = 'iso-8859-1')
+    {
+        $this->OrderTotal = $OrderTotal;
+        $this->_elements['OrderTotal']['charset'] = $charset;
+    }
+    function getItemTotal()
+    {
+        return $this->ItemTotal;
+    }
+    function setItemTotal($ItemTotal, $charset = 'iso-8859-1')
+    {
+        $this->ItemTotal = $ItemTotal;
+        $this->_elements['ItemTotal']['charset'] = $charset;
+    }
+    function getShippingTotal()
+    {
+        return $this->ShippingTotal;
+    }
+    function setShippingTotal($ShippingTotal, $charset = 'iso-8859-1')
+    {
+        $this->ShippingTotal = $ShippingTotal;
+        $this->_elements['ShippingTotal']['charset'] = $charset;
+    }
+    function getHandlingTotal()
+    {
+        return $this->HandlingTotal;
+    }
+    function setHandlingTotal($HandlingTotal, $charset = 'iso-8859-1')
+    {
+        $this->HandlingTotal = $HandlingTotal;
+        $this->_elements['HandlingTotal']['charset'] = $charset;
+    }
+    function getTaxTotal()
+    {
+        return $this->TaxTotal;
+    }
+    function setTaxTotal($TaxTotal, $charset = 'iso-8859-1')
+    {
+        $this->TaxTotal = $TaxTotal;
+        $this->_elements['TaxTotal']['charset'] = $charset;
+    }
+    function getOrderDescription()
+    {
+        return $this->OrderDescription;
+    }
+    function setOrderDescription($OrderDescription, $charset = 'iso-8859-1')
+    {
+        $this->OrderDescription = $OrderDescription;
+        $this->_elements['OrderDescription']['charset'] = $charset;
+    }
+    function getCustom()
+    {
+        return $this->Custom;
+    }
+    function setCustom($Custom, $charset = 'iso-8859-1')
+    {
+        $this->Custom = $Custom;
+        $this->_elements['Custom']['charset'] = $charset;
+    }
+    function getInvoiceID()
+    {
+        return $this->InvoiceID;
+    }
+    function setInvoiceID($InvoiceID, $charset = 'iso-8859-1')
+    {
+        $this->InvoiceID = $InvoiceID;
+        $this->_elements['InvoiceID']['charset'] = $charset;
+    }
+    function getButtonSource()
+    {
+        return $this->ButtonSource;
+    }
+    function setButtonSource($ButtonSource, $charset = 'iso-8859-1')
+    {
+        $this->ButtonSource = $ButtonSource;
+        $this->_elements['ButtonSource']['charset'] = $charset;
+    }
+    function getNotifyURL()
+    {
+        return $this->NotifyURL;
+    }
+    function setNotifyURL($NotifyURL, $charset = 'iso-8859-1')
+    {
+        $this->NotifyURL = $NotifyURL;
+        $this->_elements['NotifyURL']['charset'] = $charset;
+    }
+    function getShipToAddress()
+    {
+        return $this->ShipToAddress;
+    }
+    function setShipToAddress($ShipToAddress, $charset = 'iso-8859-1')
+    {
+        $this->ShipToAddress = $ShipToAddress;
+        $this->_elements['ShipToAddress']['charset'] = $charset;
+    }
+    function getPaymentDetailsItem()
+    {
+        return $this->PaymentDetailsItem;
+    }
+    function setPaymentDetailsItem($PaymentDetailsItem, $charset = 'iso-8859-1')
+    {
+        $this->PaymentDetailsItem = $PaymentDetailsItem;
+        $this->_elements['PaymentDetailsItem']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentInfoType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentInfoType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentInfoType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,268 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaymentInfoType
+ * 
+ * PaymentInfoType - Type declaration to be used by other schemas. Payment
+ * information.
+ *
+ * @package Services_PayPal
+ */
+class PaymentInfoType extends XSDType
+{
+    var $TransactionID;
+
+    var $ParentTransactionID;
+
+    var $ReceiptID;
+
+    var $TransactionType;
+
+    var $PaymentType;
+
+    var $PaymentDate;
+
+    var $GrossAmount;
+
+    var $FeeAmount;
+
+    var $SettleAmount;
+
+    var $TaxAmount;
+
+    var $ExchangeRate;
+
+    var $PaymentStatus;
+
+    var $PendingReason;
+
+    var $ReasonCode;
+
+    function PaymentInfoType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'TransactionID' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ParentTransactionID' => 
+              array (
+                'required' => false,
+                'type' => 'TransactionId',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReceiptID' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'TransactionType' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentTransactionCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentType' => 
+              array (
+                'required' => false,
+                'type' => 'PaymentCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentDate' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'GrossAmount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'FeeAmount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SettleAmount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'TaxAmount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ExchangeRate' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentStatus' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentStatusCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PendingReason' => 
+              array (
+                'required' => false,
+                'type' => 'PendingStatusCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReasonCode' => 
+              array (
+                'required' => false,
+                'type' => 'ReversalReasonCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getTransactionID()
+    {
+        return $this->TransactionID;
+    }
+    function setTransactionID($TransactionID, $charset = 'iso-8859-1')
+    {
+        $this->TransactionID = $TransactionID;
+        $this->_elements['TransactionID']['charset'] = $charset;
+    }
+    function getParentTransactionID()
+    {
+        return $this->ParentTransactionID;
+    }
+    function setParentTransactionID($ParentTransactionID, $charset = 'iso-8859-1')
+    {
+        $this->ParentTransactionID = $ParentTransactionID;
+        $this->_elements['ParentTransactionID']['charset'] = $charset;
+    }
+    function getReceiptID()
+    {
+        return $this->ReceiptID;
+    }
+    function setReceiptID($ReceiptID, $charset = 'iso-8859-1')
+    {
+        $this->ReceiptID = $ReceiptID;
+        $this->_elements['ReceiptID']['charset'] = $charset;
+    }
+    function getTransactionType()
+    {
+        return $this->TransactionType;
+    }
+    function setTransactionType($TransactionType, $charset = 'iso-8859-1')
+    {
+        $this->TransactionType = $TransactionType;
+        $this->_elements['TransactionType']['charset'] = $charset;
+    }
+    function getPaymentType()
+    {
+        return $this->PaymentType;
+    }
+    function setPaymentType($PaymentType, $charset = 'iso-8859-1')
+    {
+        $this->PaymentType = $PaymentType;
+        $this->_elements['PaymentType']['charset'] = $charset;
+    }
+    function getPaymentDate()
+    {
+        return $this->PaymentDate;
+    }
+    function setPaymentDate($PaymentDate, $charset = 'iso-8859-1')
+    {
+        $this->PaymentDate = $PaymentDate;
+        $this->_elements['PaymentDate']['charset'] = $charset;
+    }
+    function getGrossAmount()
+    {
+        return $this->GrossAmount;
+    }
+    function setGrossAmount($GrossAmount, $charset = 'iso-8859-1')
+    {
+        $this->GrossAmount = $GrossAmount;
+        $this->_elements['GrossAmount']['charset'] = $charset;
+    }
+    function getFeeAmount()
+    {
+        return $this->FeeAmount;
+    }
+    function setFeeAmount($FeeAmount, $charset = 'iso-8859-1')
+    {
+        $this->FeeAmount = $FeeAmount;
+        $this->_elements['FeeAmount']['charset'] = $charset;
+    }
+    function getSettleAmount()
+    {
+        return $this->SettleAmount;
+    }
+    function setSettleAmount($SettleAmount, $charset = 'iso-8859-1')
+    {
+        $this->SettleAmount = $SettleAmount;
+        $this->_elements['SettleAmount']['charset'] = $charset;
+    }
+    function getTaxAmount()
+    {
+        return $this->TaxAmount;
+    }
+    function setTaxAmount($TaxAmount, $charset = 'iso-8859-1')
+    {
+        $this->TaxAmount = $TaxAmount;
+        $this->_elements['TaxAmount']['charset'] = $charset;
+    }
+    function getExchangeRate()
+    {
+        return $this->ExchangeRate;
+    }
+    function setExchangeRate($ExchangeRate, $charset = 'iso-8859-1')
+    {
+        $this->ExchangeRate = $ExchangeRate;
+        $this->_elements['ExchangeRate']['charset'] = $charset;
+    }
+    function getPaymentStatus()
+    {
+        return $this->PaymentStatus;
+    }
+    function setPaymentStatus($PaymentStatus, $charset = 'iso-8859-1')
+    {
+        $this->PaymentStatus = $PaymentStatus;
+        $this->_elements['PaymentStatus']['charset'] = $charset;
+    }
+    function getPendingReason()
+    {
+        return $this->PendingReason;
+    }
+    function setPendingReason($PendingReason, $charset = 'iso-8859-1')
+    {
+        $this->PendingReason = $PendingReason;
+        $this->_elements['PendingReason']['charset'] = $charset;
+    }
+    function getReasonCode()
+    {
+        return $this->ReasonCode;
+    }
+    function setReasonCode($ReasonCode, $charset = 'iso-8859-1')
+    {
+        $this->ReasonCode = $ReasonCode;
+        $this->_elements['ReasonCode']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentItemInfoType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentItemInfoType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentItemInfoType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaymentItemInfoType
+ * 
+ * PaymentItemInfoType - Type declaration to be used by other schemas. Information
+ * about a PayPal item.
+ *
+ * @package Services_PayPal
+ */
+class PaymentItemInfoType extends XSDType
+{
+    var $InvoiceID;
+
+    var $Custom;
+
+    var $Memo;
+
+    var $SalesTax;
+
+    var $PaymentItem;
+
+    var $Subscription;
+
+    var $Auction;
+
+    function PaymentItemInfoType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'InvoiceID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Custom' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Memo' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SalesTax' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentItem' => 
+              array (
+                'required' => false,
+                'type' => 'PaymentItemType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Subscription' => 
+              array (
+                'required' => false,
+                'type' => 'SubscriptionInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Auction' => 
+              array (
+                'required' => false,
+                'type' => 'AuctionInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getInvoiceID()
+    {
+        return $this->InvoiceID;
+    }
+    function setInvoiceID($InvoiceID, $charset = 'iso-8859-1')
+    {
+        $this->InvoiceID = $InvoiceID;
+        $this->_elements['InvoiceID']['charset'] = $charset;
+    }
+    function getCustom()
+    {
+        return $this->Custom;
+    }
+    function setCustom($Custom, $charset = 'iso-8859-1')
+    {
+        $this->Custom = $Custom;
+        $this->_elements['Custom']['charset'] = $charset;
+    }
+    function getMemo()
+    {
+        return $this->Memo;
+    }
+    function setMemo($Memo, $charset = 'iso-8859-1')
+    {
+        $this->Memo = $Memo;
+        $this->_elements['Memo']['charset'] = $charset;
+    }
+    function getSalesTax()
+    {
+        return $this->SalesTax;
+    }
+    function setSalesTax($SalesTax, $charset = 'iso-8859-1')
+    {
+        $this->SalesTax = $SalesTax;
+        $this->_elements['SalesTax']['charset'] = $charset;
+    }
+    function getPaymentItem()
+    {
+        return $this->PaymentItem;
+    }
+    function setPaymentItem($PaymentItem, $charset = 'iso-8859-1')
+    {
+        $this->PaymentItem = $PaymentItem;
+        $this->_elements['PaymentItem']['charset'] = $charset;
+    }
+    function getSubscription()
+    {
+        return $this->Subscription;
+    }
+    function setSubscription($Subscription, $charset = 'iso-8859-1')
+    {
+        $this->Subscription = $Subscription;
+        $this->_elements['Subscription']['charset'] = $charset;
+    }
+    function getAuction()
+    {
+        return $this->Auction;
+    }
+    function setAuction($Auction, $charset = 'iso-8859-1')
+    {
+        $this->Auction = $Auction;
+        $this->_elements['Auction']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentItemType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentItemType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentItemType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,132 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaymentItemType
+ * 
+ * PaymentItemType - Type declaration to be used by other schemas. Information
+ * about a Payment Item.
+ *
+ * @package Services_PayPal
+ */
+class PaymentItemType extends XSDType
+{
+    var $Name;
+
+    var $Number;
+
+    var $Quantity;
+
+    var $SalesTax;
+
+    var $Amount;
+
+    var $Options;
+
+    function PaymentItemType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Name' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Number' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Quantity' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SalesTax' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Amount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Options' => 
+              array (
+                'required' => false,
+                'type' => 'OptionType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getName()
+    {
+        return $this->Name;
+    }
+    function setName($Name, $charset = 'iso-8859-1')
+    {
+        $this->Name = $Name;
+        $this->_elements['Name']['charset'] = $charset;
+    }
+    function getNumber()
+    {
+        return $this->Number;
+    }
+    function setNumber($Number, $charset = 'iso-8859-1')
+    {
+        $this->Number = $Number;
+        $this->_elements['Number']['charset'] = $charset;
+    }
+    function getQuantity()
+    {
+        return $this->Quantity;
+    }
+    function setQuantity($Quantity, $charset = 'iso-8859-1')
+    {
+        $this->Quantity = $Quantity;
+        $this->_elements['Quantity']['charset'] = $charset;
+    }
+    function getSalesTax()
+    {
+        return $this->SalesTax;
+    }
+    function setSalesTax($SalesTax, $charset = 'iso-8859-1')
+    {
+        $this->SalesTax = $SalesTax;
+        $this->_elements['SalesTax']['charset'] = $charset;
+    }
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+    function getOptions()
+    {
+        return $this->Options;
+    }
+    function setOptions($Options, $charset = 'iso-8859-1')
+    {
+        $this->Options = $Options;
+        $this->_elements['Options']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentMeansType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentMeansType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentMeansType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaymentMeansType
+ *
+ * @package Services_PayPal
+ */
+class PaymentMeansType extends XSDType
+{
+    var $TypeCodeID;
+
+    function PaymentMeansType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'TypeCodeID' => 
+              array (
+                'required' => true,
+                'type' => 'SellerPaymentMethodCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getTypeCodeID()
+    {
+        return $this->TypeCodeID;
+    }
+    function setTypeCodeID($TypeCodeID, $charset = 'iso-8859-1')
+    {
+        $this->TypeCodeID = $TypeCodeID;
+        $this->_elements['TypeCodeID']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentTransactionSearchResultType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentTransactionSearchResultType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentTransactionSearchResultType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,200 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaymentTransactionSearchResultType
+ * 
+ * PaymentTransactionSearchResultType - Type declaration to be used by other
+ * schemas. Results from a PaymentTransaction search
+ *
+ * @package Services_PayPal
+ */
+class PaymentTransactionSearchResultType extends XSDType
+{
+    var $Timestamp;
+
+    var $Timezone;
+
+    var $Type;
+
+    var $Payer;
+
+    var $PayerDisplayName;
+
+    var $TransactionID;
+
+    var $Status;
+
+    var $GrossAmount;
+
+    var $FeeAmount;
+
+    var $NetAmount;
+
+    function PaymentTransactionSearchResultType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Timestamp' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Timezone' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Type' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Payer' => 
+              array (
+                'required' => true,
+                'type' => 'EmailAddressType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerDisplayName' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'TransactionID' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Status' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'GrossAmount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'FeeAmount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'NetAmount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getTimestamp()
+    {
+        return $this->Timestamp;
+    }
+    function setTimestamp($Timestamp, $charset = 'iso-8859-1')
+    {
+        $this->Timestamp = $Timestamp;
+        $this->_elements['Timestamp']['charset'] = $charset;
+    }
+    function getTimezone()
+    {
+        return $this->Timezone;
+    }
+    function setTimezone($Timezone, $charset = 'iso-8859-1')
+    {
+        $this->Timezone = $Timezone;
+        $this->_elements['Timezone']['charset'] = $charset;
+    }
+    function getType()
+    {
+        return $this->Type;
+    }
+    function setType($Type, $charset = 'iso-8859-1')
+    {
+        $this->Type = $Type;
+        $this->_elements['Type']['charset'] = $charset;
+    }
+    function getPayer()
+    {
+        return $this->Payer;
+    }
+    function setPayer($Payer, $charset = 'iso-8859-1')
+    {
+        $this->Payer = $Payer;
+        $this->_elements['Payer']['charset'] = $charset;
+    }
+    function getPayerDisplayName()
+    {
+        return $this->PayerDisplayName;
+    }
+    function setPayerDisplayName($PayerDisplayName, $charset = 'iso-8859-1')
+    {
+        $this->PayerDisplayName = $PayerDisplayName;
+        $this->_elements['PayerDisplayName']['charset'] = $charset;
+    }
+    function getTransactionID()
+    {
+        return $this->TransactionID;
+    }
+    function setTransactionID($TransactionID, $charset = 'iso-8859-1')
+    {
+        $this->TransactionID = $TransactionID;
+        $this->_elements['TransactionID']['charset'] = $charset;
+    }
+    function getStatus()
+    {
+        return $this->Status;
+    }
+    function setStatus($Status, $charset = 'iso-8859-1')
+    {
+        $this->Status = $Status;
+        $this->_elements['Status']['charset'] = $charset;
+    }
+    function getGrossAmount()
+    {
+        return $this->GrossAmount;
+    }
+    function setGrossAmount($GrossAmount, $charset = 'iso-8859-1')
+    {
+        $this->GrossAmount = $GrossAmount;
+        $this->_elements['GrossAmount']['charset'] = $charset;
+    }
+    function getFeeAmount()
+    {
+        return $this->FeeAmount;
+    }
+    function setFeeAmount($FeeAmount, $charset = 'iso-8859-1')
+    {
+        $this->FeeAmount = $FeeAmount;
+        $this->_elements['FeeAmount']['charset'] = $charset;
+    }
+    function getNetAmount()
+    {
+        return $this->NetAmount;
+    }
+    function setNetAmount($NetAmount, $charset = 'iso-8859-1')
+    {
+        $this->NetAmount = $NetAmount;
+        $this->_elements['NetAmount']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentTransactionType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentTransactionType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentTransactionType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,98 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaymentTransactionType
+ * 
+ * PaymentTransactionType - Type declaration to be used by other schemas.
+ * Information about a PayPal payment from the seller side
+ *
+ * @package Services_PayPal
+ */
+class PaymentTransactionType extends XSDType
+{
+    var $ReceiverInfo;
+
+    var $PayerInfo;
+
+    var $PaymentInfo;
+
+    var $PaymentItemInfo;
+
+    function PaymentTransactionType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ReceiverInfo' => 
+              array (
+                'required' => true,
+                'type' => 'ReceiverInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PayerInfo' => 
+              array (
+                'required' => true,
+                'type' => 'PayerInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentInfo' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentItemInfo' => 
+              array (
+                'required' => false,
+                'type' => 'PaymentItemInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getReceiverInfo()
+    {
+        return $this->ReceiverInfo;
+    }
+    function setReceiverInfo($ReceiverInfo, $charset = 'iso-8859-1')
+    {
+        $this->ReceiverInfo = $ReceiverInfo;
+        $this->_elements['ReceiverInfo']['charset'] = $charset;
+    }
+    function getPayerInfo()
+    {
+        return $this->PayerInfo;
+    }
+    function setPayerInfo($PayerInfo, $charset = 'iso-8859-1')
+    {
+        $this->PayerInfo = $PayerInfo;
+        $this->_elements['PayerInfo']['charset'] = $charset;
+    }
+    function getPaymentInfo()
+    {
+        return $this->PaymentInfo;
+    }
+    function setPaymentInfo($PaymentInfo, $charset = 'iso-8859-1')
+    {
+        $this->PaymentInfo = $PaymentInfo;
+        $this->_elements['PaymentInfo']['charset'] = $charset;
+    }
+    function getPaymentItemInfo()
+    {
+        return $this->PaymentItemInfo;
+    }
+    function setPaymentItemInfo($PaymentItemInfo, $charset = 'iso-8859-1')
+    {
+        $this->PaymentItemInfo = $PaymentItemInfo;
+        $this->_elements['PaymentItemInfo']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PaymentType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PaymentType
+ *
+ * @package Services_PayPal
+ */
+class PaymentType extends XSDType
+{
+    var $PaymentMeans;
+
+    function PaymentType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'PaymentMeans' => 
+              array (
+                'required' => true,
+                'type' => 'PaymentMeansType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getPaymentMeans()
+    {
+        return $this->PaymentMeans;
+    }
+    function setPaymentMeans($PaymentMeans, $charset = 'iso-8859-1')
+    {
+        $this->PaymentMeans = $PaymentMeans;
+        $this->_elements['PaymentMeans']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PersonNameType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PersonNameType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PersonNameType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,112 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PersonNameType
+ *
+ * @package Services_PayPal
+ */
+class PersonNameType extends XSDType
+{
+    var $Salutation;
+
+    var $FirstName;
+
+    var $MiddleName;
+
+    var $LastName;
+
+    var $Suffix;
+
+    function PersonNameType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Salutation' => 
+              array (
+                'required' => false,
+                'type' => 'SalutationType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'FirstName' => 
+              array (
+                'required' => false,
+                'type' => 'NameType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MiddleName' => 
+              array (
+                'required' => false,
+                'type' => 'NameType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LastName' => 
+              array (
+                'required' => false,
+                'type' => 'NameType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Suffix' => 
+              array (
+                'required' => false,
+                'type' => 'SuffixType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getSalutation()
+    {
+        return $this->Salutation;
+    }
+    function setSalutation($Salutation, $charset = 'iso-8859-1')
+    {
+        $this->Salutation = $Salutation;
+        $this->_elements['Salutation']['charset'] = $charset;
+    }
+    function getFirstName()
+    {
+        return $this->FirstName;
+    }
+    function setFirstName($FirstName, $charset = 'iso-8859-1')
+    {
+        $this->FirstName = $FirstName;
+        $this->_elements['FirstName']['charset'] = $charset;
+    }
+    function getMiddleName()
+    {
+        return $this->MiddleName;
+    }
+    function setMiddleName($MiddleName, $charset = 'iso-8859-1')
+    {
+        $this->MiddleName = $MiddleName;
+        $this->_elements['MiddleName']['charset'] = $charset;
+    }
+    function getLastName()
+    {
+        return $this->LastName;
+    }
+    function setLastName($LastName, $charset = 'iso-8859-1')
+    {
+        $this->LastName = $LastName;
+        $this->_elements['LastName']['charset'] = $charset;
+    }
+    function getSuffix()
+    {
+        return $this->Suffix;
+    }
+    function setSuffix($Suffix, $charset = 'iso-8859-1')
+    {
+        $this->Suffix = $Suffix;
+        $this->_elements['Suffix']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/PromotedItemType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/PromotedItemType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/PromotedItemType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,185 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * PromotedItemType
+ * 
+ * Merchandizing info for an Item. This contains a list of crosssell or upsell
+ * items.
+ *
+ * @package Services_PayPal
+ */
+class PromotedItemType extends XSDType
+{
+    /**
+     * Item ID for the base item. Based on this item other items are promoted. it is
+     * teh only tag that would show up in all calls that use promoted item type. some
+     * are not in soap yet, such as get and ser promotion rules
+     */
+    var $ItemID;
+
+    /**
+     * URL for the picture of the promoted item.
+     */
+    var $PictureURL;
+
+    /**
+     * Where to display in the list of items.currentl y even forget and set does not
+     * have to be minoccur =0 but if we ever were to do revise promotion tems, it can
+     * be omitted
+     */
+    var $position;
+
+    /**
+     * Promotion Price. Price at which the buyer can buy the item now.
+     */
+    var $PromotionPrice;
+
+    var $PromotionPriceType;
+
+    var $SelectionType;
+
+    /**
+     * Item Title for the promoted item.
+     */
+    var $Title;
+
+    var $ListingType;
+
+    function PromotedItemType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ItemID' => 
+              array (
+                'required' => true,
+                'type' => 'ItemIDType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PictureURL' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'position' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PromotionPrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PromotionPriceType' => 
+              array (
+                'required' => false,
+                'type' => 'PromotionItemPriceTypeCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SelectionType' => 
+              array (
+                'required' => false,
+                'type' => 'PromotionItemSelectionCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Title' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ListingType' => 
+              array (
+                'required' => false,
+                'type' => 'ListingTypeCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getItemID()
+    {
+        return $this->ItemID;
+    }
+    function setItemID($ItemID, $charset = 'iso-8859-1')
+    {
+        $this->ItemID = $ItemID;
+        $this->_elements['ItemID']['charset'] = $charset;
+    }
+    function getPictureURL()
+    {
+        return $this->PictureURL;
+    }
+    function setPictureURL($PictureURL, $charset = 'iso-8859-1')
+    {
+        $this->PictureURL = $PictureURL;
+        $this->_elements['PictureURL']['charset'] = $charset;
+    }
+    function getposition()
+    {
+        return $this->position;
+    }
+    function setposition($position, $charset = 'iso-8859-1')
+    {
+        $this->position = $position;
+        $this->_elements['position']['charset'] = $charset;
+    }
+    function getPromotionPrice()
+    {
+        return $this->PromotionPrice;
+    }
+    function setPromotionPrice($PromotionPrice, $charset = 'iso-8859-1')
+    {
+        $this->PromotionPrice = $PromotionPrice;
+        $this->_elements['PromotionPrice']['charset'] = $charset;
+    }
+    function getPromotionPriceType()
+    {
+        return $this->PromotionPriceType;
+    }
+    function setPromotionPriceType($PromotionPriceType, $charset = 'iso-8859-1')
+    {
+        $this->PromotionPriceType = $PromotionPriceType;
+        $this->_elements['PromotionPriceType']['charset'] = $charset;
+    }
+    function getSelectionType()
+    {
+        return $this->SelectionType;
+    }
+    function setSelectionType($SelectionType, $charset = 'iso-8859-1')
+    {
+        $this->SelectionType = $SelectionType;
+        $this->_elements['SelectionType']['charset'] = $charset;
+    }
+    function getTitle()
+    {
+        return $this->Title;
+    }
+    function setTitle($Title, $charset = 'iso-8859-1')
+    {
+        $this->Title = $Title;
+        $this->_elements['Title']['charset'] = $charset;
+    }
+    function getListingType()
+    {
+        return $this->ListingType;
+    }
+    function setListingType($ListingType, $charset = 'iso-8859-1')
+    {
+        $this->ListingType = $ListingType;
+        $this->_elements['ListingType']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/QuantityType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/QuantityType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/QuantityType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDSimpleType.php';
+
+/**
+ * QuantityType
+ *
+ * @package Services_PayPal
+ */
+class QuantityType extends XSDSimpleType
+{
+    function QuantityType()
+    {
+        parent::XSDSimpleType();
+        $this->_namespace = 'urn:ebay:apis:CoreComponentTypes';
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'unit' => 
+              array (
+                'name' => 'unit',
+                'type' => 'xs:token',
+                'use' => 'optional',
+              ),
+            ));
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ReceiverInfoType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ReceiverInfoType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ReceiverInfoType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ReceiverInfoType
+ * 
+ * ReceiverInfoType - Type declaration to be used by other schemas. Receiver
+ * information.
+ *
+ * @package Services_PayPal
+ */
+class ReceiverInfoType extends XSDType
+{
+    var $Business;
+
+    var $Receiver;
+
+    var $ReceiverID;
+
+    function ReceiverInfoType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Business' => 
+              array (
+                'required' => true,
+                'type' => 'EmailAddressType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Receiver' => 
+              array (
+                'required' => true,
+                'type' => 'EmailAddressType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReceiverID' => 
+              array (
+                'required' => true,
+                'type' => 'UserIDType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getBusiness()
+    {
+        return $this->Business;
+    }
+    function setBusiness($Business, $charset = 'iso-8859-1')
+    {
+        $this->Business = $Business;
+        $this->_elements['Business']['charset'] = $charset;
+    }
+    function getReceiver()
+    {
+        return $this->Receiver;
+    }
+    function setReceiver($Receiver, $charset = 'iso-8859-1')
+    {
+        $this->Receiver = $Receiver;
+        $this->_elements['Receiver']['charset'] = $charset;
+    }
+    function getReceiverID()
+    {
+        return $this->ReceiverID;
+    }
+    function setReceiverID($ReceiverID, $charset = 'iso-8859-1')
+    {
+        $this->ReceiverID = $ReceiverID;
+        $this->_elements['ReceiverID']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/RefundTransactionRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/RefundTransactionRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/RefundTransactionRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * RefundTransactionRequestType
+ *
+ * @package Services_PayPal
+ */
+class RefundTransactionRequestType extends AbstractRequestType
+{
+    var $TransactionID;
+
+    var $RefundType;
+
+    var $Amount;
+
+    var $Memo;
+
+    function RefundTransactionRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'TransactionID' => 
+              array (
+                'required' => true,
+                'type' => 'TransactionId',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'RefundType' => 
+              array (
+                'required' => false,
+                'type' => 'RefundPurposeTypeCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Amount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Memo' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getTransactionID()
+    {
+        return $this->TransactionID;
+    }
+    function setTransactionID($TransactionID, $charset = 'iso-8859-1')
+    {
+        $this->TransactionID = $TransactionID;
+        $this->_elements['TransactionID']['charset'] = $charset;
+    }
+    function getRefundType()
+    {
+        return $this->RefundType;
+    }
+    function setRefundType($RefundType, $charset = 'iso-8859-1')
+    {
+        $this->RefundType = $RefundType;
+        $this->_elements['RefundType']['charset'] = $charset;
+    }
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+    function getMemo()
+    {
+        return $this->Memo;
+    }
+    function setMemo($Memo, $charset = 'iso-8859-1')
+    {
+        $this->Memo = $Memo;
+        $this->_elements['Memo']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/RefundTransactionResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/RefundTransactionResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/RefundTransactionResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * RefundTransactionResponseType
+ *
+ * @package Services_PayPal
+ */
+class RefundTransactionResponseType extends AbstractResponseType
+{
+    var $RefundTransactionID;
+
+    var $NetRefundAmount;
+
+    var $FeeRefundAmount;
+
+    var $GrossRefundAmount;
+
+    function RefundTransactionResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'RefundTransactionID' => 
+              array (
+                'required' => false,
+                'type' => 'TransactionId',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'NetRefundAmount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'FeeRefundAmount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'GrossRefundAmount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getRefundTransactionID()
+    {
+        return $this->RefundTransactionID;
+    }
+    function setRefundTransactionID($RefundTransactionID, $charset = 'iso-8859-1')
+    {
+        $this->RefundTransactionID = $RefundTransactionID;
+        $this->_elements['RefundTransactionID']['charset'] = $charset;
+    }
+    function getNetRefundAmount()
+    {
+        return $this->NetRefundAmount;
+    }
+    function setNetRefundAmount($NetRefundAmount, $charset = 'iso-8859-1')
+    {
+        $this->NetRefundAmount = $NetRefundAmount;
+        $this->_elements['NetRefundAmount']['charset'] = $charset;
+    }
+    function getFeeRefundAmount()
+    {
+        return $this->FeeRefundAmount;
+    }
+    function setFeeRefundAmount($FeeRefundAmount, $charset = 'iso-8859-1')
+    {
+        $this->FeeRefundAmount = $FeeRefundAmount;
+        $this->_elements['FeeRefundAmount']['charset'] = $charset;
+    }
+    function getGrossRefundAmount()
+    {
+        return $this->GrossRefundAmount;
+    }
+    function setGrossRefundAmount($GrossRefundAmount, $charset = 'iso-8859-1')
+    {
+        $this->GrossRefundAmount = $GrossRefundAmount;
+        $this->_elements['GrossRefundAmount']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ReviseStatusType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ReviseStatusType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ReviseStatusType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,136 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ReviseStatusType
+ * 
+ * Contains the revise status information details (e.g., item properties
+ * information). ths node contains system set data only - always output and always
+ * all data. no minccurs needed, except for motors specific data, since it wil lnot
+ * be retruned for non motors items
+ *
+ * @package Services_PayPal
+ */
+class ReviseStatusType extends XSDType
+{
+    /**
+     * Indicates whether the item was revised since the auction started.
+     */
+    var $ItemRevised;
+
+    /**
+     * If true, indicates that a Buy It Now Price was added for the item. Only returned
+     * for Motors items.
+     */
+    var $BuyItNowAdded;
+
+    /**
+     * Replaces BinLowered as of API version 305. If true, indicates that the Buy It
+     * Now Price was lowered for the item. Only returned for Motors items.
+     */
+    var $BuyItNowLowered;
+
+    /**
+     * If true, indicates that the Reserve Price was lowered for the item. Only
+     * returned for Motors items.
+     */
+    var $ReserveLowered;
+
+    /**
+     * If true, indicates that the Reserve Price was removed from the item. Only
+     * returned for eBay Motors items.
+     */
+    var $ReserveRemoved;
+
+    function ReviseStatusType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ItemRevised' => 
+              array (
+                'required' => true,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BuyItNowAdded' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BuyItNowLowered' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReserveLowered' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReserveRemoved' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getItemRevised()
+    {
+        return $this->ItemRevised;
+    }
+    function setItemRevised($ItemRevised, $charset = 'iso-8859-1')
+    {
+        $this->ItemRevised = $ItemRevised;
+        $this->_elements['ItemRevised']['charset'] = $charset;
+    }
+    function getBuyItNowAdded()
+    {
+        return $this->BuyItNowAdded;
+    }
+    function setBuyItNowAdded($BuyItNowAdded, $charset = 'iso-8859-1')
+    {
+        $this->BuyItNowAdded = $BuyItNowAdded;
+        $this->_elements['BuyItNowAdded']['charset'] = $charset;
+    }
+    function getBuyItNowLowered()
+    {
+        return $this->BuyItNowLowered;
+    }
+    function setBuyItNowLowered($BuyItNowLowered, $charset = 'iso-8859-1')
+    {
+        $this->BuyItNowLowered = $BuyItNowLowered;
+        $this->_elements['BuyItNowLowered']['charset'] = $charset;
+    }
+    function getReserveLowered()
+    {
+        return $this->ReserveLowered;
+    }
+    function setReserveLowered($ReserveLowered, $charset = 'iso-8859-1')
+    {
+        $this->ReserveLowered = $ReserveLowered;
+        $this->_elements['ReserveLowered']['charset'] = $charset;
+    }
+    function getReserveRemoved()
+    {
+        return $this->ReserveRemoved;
+    }
+    function setReserveRemoved($ReserveRemoved, $charset = 'iso-8859-1')
+    {
+        $this->ReserveRemoved = $ReserveRemoved;
+        $this->_elements['ReserveRemoved']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SalesTaxType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SalesTaxType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SalesTaxType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,90 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * SalesTaxType
+ *
+ * @package Services_PayPal
+ */
+class SalesTaxType extends XSDType
+{
+    /**
+     * Amount of the sales tax to be collected for the transaction. Sales tax is only
+     * for US.
+     */
+    var $SalesTaxPercent;
+
+    /**
+     * Sales tax for the transaction, expressed as a percentage. Should be empty for
+     * items listed on international sites (hence, this is US-only element).
+     */
+    var $SalesTaxState;
+
+    /**
+     * Indicates whether shipping is included in the tax. Applicable if ShippingType =
+     * 1 or 2. This element is used for US-only.
+     */
+    var $ShippingIncludedInTax;
+
+    function SalesTaxType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'SalesTaxPercent' => 
+              array (
+                'required' => false,
+                'type' => 'float',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SalesTaxState' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingIncludedInTax' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getSalesTaxPercent()
+    {
+        return $this->SalesTaxPercent;
+    }
+    function setSalesTaxPercent($SalesTaxPercent, $charset = 'iso-8859-1')
+    {
+        $this->SalesTaxPercent = $SalesTaxPercent;
+        $this->_elements['SalesTaxPercent']['charset'] = $charset;
+    }
+    function getSalesTaxState()
+    {
+        return $this->SalesTaxState;
+    }
+    function setSalesTaxState($SalesTaxState, $charset = 'iso-8859-1')
+    {
+        $this->SalesTaxState = $SalesTaxState;
+        $this->_elements['SalesTaxState']['charset'] = $charset;
+    }
+    function getShippingIncludedInTax()
+    {
+        return $this->ShippingIncludedInTax;
+    }
+    function setShippingIncludedInTax($ShippingIncludedInTax, $charset = 'iso-8859-1')
+    {
+        $this->ShippingIncludedInTax = $ShippingIncludedInTax;
+        $this->_elements['ShippingIncludedInTax']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SchedulingInfoType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SchedulingInfoType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SchedulingInfoType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,82 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * SchedulingInfoType
+ * 
+ * Contains information for Scheduling limits for the user. All dtails must be
+ * present,unless we will have revise call one day, just in case we might let's
+ * make min occur = 0
+ *
+ * @package Services_PayPal
+ */
+class SchedulingInfoType extends XSDType
+{
+    var $MaxScheduledMinutes;
+
+    var $MinScheduledMinutes;
+
+    var $MaxScheduledItems;
+
+    function SchedulingInfoType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'MaxScheduledMinutes' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MinScheduledMinutes' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MaxScheduledItems' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getMaxScheduledMinutes()
+    {
+        return $this->MaxScheduledMinutes;
+    }
+    function setMaxScheduledMinutes($MaxScheduledMinutes, $charset = 'iso-8859-1')
+    {
+        $this->MaxScheduledMinutes = $MaxScheduledMinutes;
+        $this->_elements['MaxScheduledMinutes']['charset'] = $charset;
+    }
+    function getMinScheduledMinutes()
+    {
+        return $this->MinScheduledMinutes;
+    }
+    function setMinScheduledMinutes($MinScheduledMinutes, $charset = 'iso-8859-1')
+    {
+        $this->MinScheduledMinutes = $MinScheduledMinutes;
+        $this->_elements['MinScheduledMinutes']['charset'] = $charset;
+    }
+    function getMaxScheduledItems()
+    {
+        return $this->MaxScheduledItems;
+    }
+    function setMaxScheduledItems($MaxScheduledItems, $charset = 'iso-8859-1')
+    {
+        $this->MaxScheduledItems = $MaxScheduledItems;
+        $this->_elements['MaxScheduledItems']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SellerType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SellerType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SellerType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,257 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * SellerType
+ * 
+ * Information about user used by selling applications there are number of required
+ * elements - they will always show up for seller node there is not such a call to
+ * do revise seller info. only added minoccur=0 to elements that will not show up
+ * in every type of request/responce
+ *
+ * @package Services_PayPal
+ */
+class SellerType extends XSDType
+{
+    var $AllowPaymentEdit;
+
+    var $BillingCurrency;
+
+    var $CheckoutEnabled;
+
+    var $CIPBankAccountStored;
+
+    var $GoodStanding;
+
+    var $LiveAuctionAuthorized;
+
+    /**
+     * Indicates whether the user has elected to participate as a seller in the
+     * Merchandising Manager feature.
+     */
+    var $MerchandizingPref;
+
+    var $QualifiesForB2BVAT;
+
+    var $SellerLevel;
+
+    var $SellerPaymentAddress;
+
+    var $SchedulingInfo;
+
+    var $StoreOwner;
+
+    var $StoreURL;
+
+    function SellerType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AllowPaymentEdit' => 
+              array (
+                'required' => true,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BillingCurrency' => 
+              array (
+                'required' => false,
+                'type' => 'CurrencyCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CheckoutEnabled' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CIPBankAccountStored' => 
+              array (
+                'required' => true,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'GoodStanding' => 
+              array (
+                'required' => true,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LiveAuctionAuthorized' => 
+              array (
+                'required' => true,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MerchandizingPref' => 
+              array (
+                'required' => true,
+                'type' => 'MerchandizingPrefCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'QualifiesForB2BVAT' => 
+              array (
+                'required' => true,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SellerLevel' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SellerPaymentAddress' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SchedulingInfo' => 
+              array (
+                'required' => false,
+                'type' => 'SchedulingInfoType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'StoreOwner' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'StoreURL' => 
+              array (
+                'required' => false,
+                'type' => 'anyURI',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAllowPaymentEdit()
+    {
+        return $this->AllowPaymentEdit;
+    }
+    function setAllowPaymentEdit($AllowPaymentEdit, $charset = 'iso-8859-1')
+    {
+        $this->AllowPaymentEdit = $AllowPaymentEdit;
+        $this->_elements['AllowPaymentEdit']['charset'] = $charset;
+    }
+    function getBillingCurrency()
+    {
+        return $this->BillingCurrency;
+    }
+    function setBillingCurrency($BillingCurrency, $charset = 'iso-8859-1')
+    {
+        $this->BillingCurrency = $BillingCurrency;
+        $this->_elements['BillingCurrency']['charset'] = $charset;
+    }
+    function getCheckoutEnabled()
+    {
+        return $this->CheckoutEnabled;
+    }
+    function setCheckoutEnabled($CheckoutEnabled, $charset = 'iso-8859-1')
+    {
+        $this->CheckoutEnabled = $CheckoutEnabled;
+        $this->_elements['CheckoutEnabled']['charset'] = $charset;
+    }
+    function getCIPBankAccountStored()
+    {
+        return $this->CIPBankAccountStored;
+    }
+    function setCIPBankAccountStored($CIPBankAccountStored, $charset = 'iso-8859-1')
+    {
+        $this->CIPBankAccountStored = $CIPBankAccountStored;
+        $this->_elements['CIPBankAccountStored']['charset'] = $charset;
+    }
+    function getGoodStanding()
+    {
+        return $this->GoodStanding;
+    }
+    function setGoodStanding($GoodStanding, $charset = 'iso-8859-1')
+    {
+        $this->GoodStanding = $GoodStanding;
+        $this->_elements['GoodStanding']['charset'] = $charset;
+    }
+    function getLiveAuctionAuthorized()
+    {
+        return $this->LiveAuctionAuthorized;
+    }
+    function setLiveAuctionAuthorized($LiveAuctionAuthorized, $charset = 'iso-8859-1')
+    {
+        $this->LiveAuctionAuthorized = $LiveAuctionAuthorized;
+        $this->_elements['LiveAuctionAuthorized']['charset'] = $charset;
+    }
+    function getMerchandizingPref()
+    {
+        return $this->MerchandizingPref;
+    }
+    function setMerchandizingPref($MerchandizingPref, $charset = 'iso-8859-1')
+    {
+        $this->MerchandizingPref = $MerchandizingPref;
+        $this->_elements['MerchandizingPref']['charset'] = $charset;
+    }
+    function getQualifiesForB2BVAT()
+    {
+        return $this->QualifiesForB2BVAT;
+    }
+    function setQualifiesForB2BVAT($QualifiesForB2BVAT, $charset = 'iso-8859-1')
+    {
+        $this->QualifiesForB2BVAT = $QualifiesForB2BVAT;
+        $this->_elements['QualifiesForB2BVAT']['charset'] = $charset;
+    }
+    function getSellerLevel()
+    {
+        return $this->SellerLevel;
+    }
+    function setSellerLevel($SellerLevel, $charset = 'iso-8859-1')
+    {
+        $this->SellerLevel = $SellerLevel;
+        $this->_elements['SellerLevel']['charset'] = $charset;
+    }
+    function getSellerPaymentAddress()
+    {
+        return $this->SellerPaymentAddress;
+    }
+    function setSellerPaymentAddress($SellerPaymentAddress, $charset = 'iso-8859-1')
+    {
+        $this->SellerPaymentAddress = $SellerPaymentAddress;
+        $this->_elements['SellerPaymentAddress']['charset'] = $charset;
+    }
+    function getSchedulingInfo()
+    {
+        return $this->SchedulingInfo;
+    }
+    function setSchedulingInfo($SchedulingInfo, $charset = 'iso-8859-1')
+    {
+        $this->SchedulingInfo = $SchedulingInfo;
+        $this->_elements['SchedulingInfo']['charset'] = $charset;
+    }
+    function getStoreOwner()
+    {
+        return $this->StoreOwner;
+    }
+    function setStoreOwner($StoreOwner, $charset = 'iso-8859-1')
+    {
+        $this->StoreOwner = $StoreOwner;
+        $this->_elements['StoreOwner']['charset'] = $charset;
+    }
+    function getStoreURL()
+    {
+        return $this->StoreURL;
+    }
+    function setStoreURL($StoreURL, $charset = 'iso-8859-1')
+    {
+        $this->StoreURL = $StoreURL;
+        $this->_elements['StoreURL']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SellingStatusType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SellingStatusType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SellingStatusType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,242 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * SellingStatusType
+ * 
+ * Contains the listed items price details which consists of following information:
+ * BuyItNowPrice, ConvertedBuyItNowPrice, ConvertedPrice, ConvertedStartPrice,
+ * CurrentPrice, MinimumToBid, ReservePrice, and StartPrice. need to take in
+ * account get seller events when defining minoccurs = 0
+ *
+ * @package Services_PayPal
+ */
+class SellingStatusType extends XSDType
+{
+    /**
+     * Number of bids placed so far against the item. Not returned for International
+     * Fixed Price items.
+     */
+    var $BidCount;
+
+    /**
+     * Smallest amount a bid must be above the current high bid. Not returned
+     * International Fixed Price items.
+     */
+    var $BidIncrement;
+
+    /**
+     * Converted current price of listed item.
+     */
+    var $ConvertedCurrentPrice;
+
+    /**
+     * For auction-format listings, current minimum asking price or the current highest
+     * bid for the item if bids have been placed. Shows minimum bid if no bids have
+     * been placed against the item. This field does not reflect the actual current
+     * price of the item if it's a Type=7 or Type=9 (Fixed Price) item and the price
+     * has been revised. (See StartPrice for revised asking price.)
+     */
+    var $CurrentPrice;
+
+    /**
+     * Contains one User node representing the current high bidder. GetItem returns a
+     * high bidder for auctions that have ended and have a winning bidder. For Fixed
+     * Price listings, in-progress auctions, or auction items that received no bids,
+     * GetItem returns a HighBidder node with empty tags.
+     */
+    var $HighBidder;
+
+    /**
+     * Applicable to ad-format items only. Indicates how many leads to potential buyers
+     * are associated with this item. For other item types (other than ad-format
+     * items), returns a value of 0 (zero).
+     */
+    var $LeadCount;
+
+    /**
+     * Minimum acceptable bid for the item. Not returned for International Fixed Price
+     * items.
+     */
+    var $MinimumToBid;
+
+    /**
+     * Number of items purchased so far. (Subtract from the value returned in the
+     * Quantity field to calculate the number of items remaining.)
+     */
+    var $QuantitySold;
+
+    /**
+     * Returns true if the reserve price was met or no reserve price was specified.
+     */
+    var $ReserveMet;
+
+    var $SecondChanceEligible;
+
+    function SellingStatusType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'BidCount' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BidIncrement' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ConvertedCurrentPrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CurrentPrice' => 
+              array (
+                'required' => true,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'HighBidder' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LeadCount' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MinimumToBid' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'QuantitySold' => 
+              array (
+                'required' => true,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReserveMet' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SecondChanceEligible' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getBidCount()
+    {
+        return $this->BidCount;
+    }
+    function setBidCount($BidCount, $charset = 'iso-8859-1')
+    {
+        $this->BidCount = $BidCount;
+        $this->_elements['BidCount']['charset'] = $charset;
+    }
+    function getBidIncrement()
+    {
+        return $this->BidIncrement;
+    }
+    function setBidIncrement($BidIncrement, $charset = 'iso-8859-1')
+    {
+        $this->BidIncrement = $BidIncrement;
+        $this->_elements['BidIncrement']['charset'] = $charset;
+    }
+    function getConvertedCurrentPrice()
+    {
+        return $this->ConvertedCurrentPrice;
+    }
+    function setConvertedCurrentPrice($ConvertedCurrentPrice, $charset = 'iso-8859-1')
+    {
+        $this->ConvertedCurrentPrice = $ConvertedCurrentPrice;
+        $this->_elements['ConvertedCurrentPrice']['charset'] = $charset;
+    }
+    function getCurrentPrice()
+    {
+        return $this->CurrentPrice;
+    }
+    function setCurrentPrice($CurrentPrice, $charset = 'iso-8859-1')
+    {
+        $this->CurrentPrice = $CurrentPrice;
+        $this->_elements['CurrentPrice']['charset'] = $charset;
+    }
+    function getHighBidder()
+    {
+        return $this->HighBidder;
+    }
+    function setHighBidder($HighBidder, $charset = 'iso-8859-1')
+    {
+        $this->HighBidder = $HighBidder;
+        $this->_elements['HighBidder']['charset'] = $charset;
+    }
+    function getLeadCount()
+    {
+        return $this->LeadCount;
+    }
+    function setLeadCount($LeadCount, $charset = 'iso-8859-1')
+    {
+        $this->LeadCount = $LeadCount;
+        $this->_elements['LeadCount']['charset'] = $charset;
+    }
+    function getMinimumToBid()
+    {
+        return $this->MinimumToBid;
+    }
+    function setMinimumToBid($MinimumToBid, $charset = 'iso-8859-1')
+    {
+        $this->MinimumToBid = $MinimumToBid;
+        $this->_elements['MinimumToBid']['charset'] = $charset;
+    }
+    function getQuantitySold()
+    {
+        return $this->QuantitySold;
+    }
+    function setQuantitySold($QuantitySold, $charset = 'iso-8859-1')
+    {
+        $this->QuantitySold = $QuantitySold;
+        $this->_elements['QuantitySold']['charset'] = $charset;
+    }
+    function getReserveMet()
+    {
+        return $this->ReserveMet;
+    }
+    function setReserveMet($ReserveMet, $charset = 'iso-8859-1')
+    {
+        $this->ReserveMet = $ReserveMet;
+        $this->_elements['ReserveMet']['charset'] = $charset;
+    }
+    function getSecondChanceEligible()
+    {
+        return $this->SecondChanceEligible;
+    }
+    function setSecondChanceEligible($SecondChanceEligible, $charset = 'iso-8859-1')
+    {
+        $this->SecondChanceEligible = $SecondChanceEligible;
+        $this->_elements['SecondChanceEligible']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutRequestDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutRequestDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutRequestDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,367 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * SetExpressCheckoutRequestDetailsType
+ *
+ * @package Services_PayPal
+ */
+class SetExpressCheckoutRequestDetailsType extends XSDType
+{
+    var $OrderTotal;
+
+    var $ReturnURL;
+
+    var $CancelURL;
+
+    var $Token;
+
+    var $MaxAmount;
+
+    var $OrderDescription;
+
+    var $Custom;
+
+    var $InvoiceID;
+
+    var $ReqConfirmShipping;
+
+    var $NoShipping;
+
+    var $AddressOverride;
+
+    var $LocaleCode;
+
+    var $PageStyle;
+
+    var $cpp_header_image;
+
+    var $cpp_header_border_color;
+
+    var $cpp_header_back_color;
+
+    var $cpp_payflow_color;
+
+    var $Address;
+
+    var $PaymentAction;
+
+    var $BuyerEmail;
+
+    function SetExpressCheckoutRequestDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'OrderTotal' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReturnURL' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CancelURL' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Token' => 
+              array (
+                'required' => false,
+                'type' => 'ExpressCheckoutTokenType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'MaxAmount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'OrderDescription' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Custom' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InvoiceID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ReqConfirmShipping' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'NoShipping' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AddressOverride' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LocaleCode' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PageStyle' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'cpp_header_image' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'cpp_header_border_color' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'cpp_header_back_color' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'cpp_payflow_color' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Address' => 
+              array (
+                'required' => false,
+                'type' => 'AddressType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentAction' => 
+              array (
+                'required' => false,
+                'type' => 'PaymentActionCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BuyerEmail' => 
+              array (
+                'required' => false,
+                'type' => 'EmailAddressType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getOrderTotal()
+    {
+        return $this->OrderTotal;
+    }
+    function setOrderTotal($OrderTotal, $charset = 'iso-8859-1')
+    {
+        $this->OrderTotal = $OrderTotal;
+        $this->_elements['OrderTotal']['charset'] = $charset;
+    }
+    function getReturnURL()
+    {
+        return $this->ReturnURL;
+    }
+    function setReturnURL($ReturnURL, $charset = 'iso-8859-1')
+    {
+        $this->ReturnURL = $ReturnURL;
+        $this->_elements['ReturnURL']['charset'] = $charset;
+    }
+    function getCancelURL()
+    {
+        return $this->CancelURL;
+    }
+    function setCancelURL($CancelURL, $charset = 'iso-8859-1')
+    {
+        $this->CancelURL = $CancelURL;
+        $this->_elements['CancelURL']['charset'] = $charset;
+    }
+    function getToken()
+    {
+        return $this->Token;
+    }
+    function setToken($Token, $charset = 'iso-8859-1')
+    {
+        $this->Token = $Token;
+        $this->_elements['Token']['charset'] = $charset;
+    }
+    function getMaxAmount()
+    {
+        return $this->MaxAmount;
+    }
+    function setMaxAmount($MaxAmount, $charset = 'iso-8859-1')
+    {
+        $this->MaxAmount = $MaxAmount;
+        $this->_elements['MaxAmount']['charset'] = $charset;
+    }
+    function getOrderDescription()
+    {
+        return $this->OrderDescription;
+    }
+    function setOrderDescription($OrderDescription, $charset = 'iso-8859-1')
+    {
+        $this->OrderDescription = $OrderDescription;
+        $this->_elements['OrderDescription']['charset'] = $charset;
+    }
+    function getCustom()
+    {
+        return $this->Custom;
+    }
+    function setCustom($Custom, $charset = 'iso-8859-1')
+    {
+        $this->Custom = $Custom;
+        $this->_elements['Custom']['charset'] = $charset;
+    }
+    function getInvoiceID()
+    {
+        return $this->InvoiceID;
+    }
+    function setInvoiceID($InvoiceID, $charset = 'iso-8859-1')
+    {
+        $this->InvoiceID = $InvoiceID;
+        $this->_elements['InvoiceID']['charset'] = $charset;
+    }
+    function getReqConfirmShipping()
+    {
+        return $this->ReqConfirmShipping;
+    }
+    function setReqConfirmShipping($ReqConfirmShipping, $charset = 'iso-8859-1')
+    {
+        $this->ReqConfirmShipping = $ReqConfirmShipping;
+        $this->_elements['ReqConfirmShipping']['charset'] = $charset;
+    }
+    function getNoShipping()
+    {
+        return $this->NoShipping;
+    }
+    function setNoShipping($NoShipping, $charset = 'iso-8859-1')
+    {
+        $this->NoShipping = $NoShipping;
+        $this->_elements['NoShipping']['charset'] = $charset;
+    }
+    function getAddressOverride()
+    {
+        return $this->AddressOverride;
+    }
+    function setAddressOverride($AddressOverride, $charset = 'iso-8859-1')
+    {
+        $this->AddressOverride = $AddressOverride;
+        $this->_elements['AddressOverride']['charset'] = $charset;
+    }
+    function getLocaleCode()
+    {
+        return $this->LocaleCode;
+    }
+    function setLocaleCode($LocaleCode, $charset = 'iso-8859-1')
+    {
+        $this->LocaleCode = $LocaleCode;
+        $this->_elements['LocaleCode']['charset'] = $charset;
+    }
+    function getPageStyle()
+    {
+        return $this->PageStyle;
+    }
+    function setPageStyle($PageStyle, $charset = 'iso-8859-1')
+    {
+        $this->PageStyle = $PageStyle;
+        $this->_elements['PageStyle']['charset'] = $charset;
+    }
+    function getcpp_header_image()
+    {
+        return $this->cpp_header_image;
+    }
+    function setcpp_header_image($cpp_header_image, $charset = 'iso-8859-1')
+    {
+        $this->cpp_header_image = $cpp_header_image;
+        $this->_elements['cpp_header_image']['charset'] = $charset;
+    }
+    function getcpp_header_border_color()
+    {
+        return $this->cpp_header_border_color;
+    }
+    function setcpp_header_border_color($cpp_header_border_color, $charset = 'iso-8859-1')
+    {
+        $this->cpp_header_border_color = $cpp_header_border_color;
+        $this->_elements['cpp_header_border_color']['charset'] = $charset;
+    }
+    function getcpp_header_back_color()
+    {
+        return $this->cpp_header_back_color;
+    }
+    function setcpp_header_back_color($cpp_header_back_color, $charset = 'iso-8859-1')
+    {
+        $this->cpp_header_back_color = $cpp_header_back_color;
+        $this->_elements['cpp_header_back_color']['charset'] = $charset;
+    }
+    function getcpp_payflow_color()
+    {
+        return $this->cpp_payflow_color;
+    }
+    function setcpp_payflow_color($cpp_payflow_color, $charset = 'iso-8859-1')
+    {
+        $this->cpp_payflow_color = $cpp_payflow_color;
+        $this->_elements['cpp_payflow_color']['charset'] = $charset;
+    }
+    function getAddress()
+    {
+        return $this->Address;
+    }
+    function setAddress($Address, $charset = 'iso-8859-1')
+    {
+        $this->Address = $Address;
+        $this->_elements['Address']['charset'] = $charset;
+    }
+    function getPaymentAction()
+    {
+        return $this->PaymentAction;
+    }
+    function setPaymentAction($PaymentAction, $charset = 'iso-8859-1')
+    {
+        $this->PaymentAction = $PaymentAction;
+        $this->_elements['PaymentAction']['charset'] = $charset;
+    }
+    function getBuyerEmail()
+    {
+        return $this->BuyerEmail;
+    }
+    function setBuyerEmail($BuyerEmail, $charset = 'iso-8859-1')
+    {
+        $this->BuyerEmail = $BuyerEmail;
+        $this->_elements['BuyerEmail']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * SetExpressCheckoutRequestType
+ *
+ * @package Services_PayPal
+ */
+class SetExpressCheckoutRequestType extends AbstractRequestType
+{
+    var $SetExpressCheckoutRequestDetails;
+
+    function SetExpressCheckoutRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'SetExpressCheckoutRequestDetails' => 
+              array (
+                'required' => true,
+                'type' => 'SetExpressCheckoutRequestDetailsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getSetExpressCheckoutRequestDetails()
+    {
+        return $this->SetExpressCheckoutRequestDetails;
+    }
+    function setSetExpressCheckoutRequestDetails($SetExpressCheckoutRequestDetails, $charset = 'iso-8859-1')
+    {
+        $this->SetExpressCheckoutRequestDetails = $SetExpressCheckoutRequestDetails;
+        $this->_elements['SetExpressCheckoutRequestDetails']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SetExpressCheckoutResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * SetExpressCheckoutResponseType
+ *
+ * @package Services_PayPal
+ */
+class SetExpressCheckoutResponseType extends AbstractResponseType
+{
+    var $Token;
+
+    function SetExpressCheckoutResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Token' => 
+              array (
+                'required' => true,
+                'type' => 'ExpressCheckoutTokenType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getToken()
+    {
+        return $this->Token;
+    }
+    function setToken($Token, $charset = 'iso-8859-1')
+    {
+        $this->Token = $Token;
+        $this->_elements['Token']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ShippingCarrierDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ShippingCarrierDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ShippingCarrierDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ShippingCarrierDetailsType
+ *
+ * @package Services_PayPal
+ */
+class ShippingCarrierDetailsType extends XSDType
+{
+    /**
+     * Calculated cost of shipping, based on shipping parameters and selected shipping
+     * service. Only returned if ShippingType = 2 (i.e., calculated shipping rate).
+     */
+    var $CarrierShippingFee;
+
+    var $InsuranceFee;
+
+    var $InsuranceOption;
+
+    /**
+     * Optional fees a seller might assess for the shipping of the item.
+     */
+    var $PackagingHandlingCosts;
+
+    /**
+     * Describes any error message associated with the attempt to calculate shipping
+     * rates. If there was no error, returns "No Error" (without the quotation marks).
+     */
+    var $ShippingRateErrorMessage;
+
+    /**
+     * is unique identified of shipping carrier, without this element the whole node
+     * makes no sence
+     */
+    var $ShippingService;
+
+    function ShippingCarrierDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'CarrierShippingFee' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InsuranceFee' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InsuranceOption' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PackagingHandlingCosts' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingRateErrorMessage' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingService' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getCarrierShippingFee()
+    {
+        return $this->CarrierShippingFee;
+    }
+    function setCarrierShippingFee($CarrierShippingFee, $charset = 'iso-8859-1')
+    {
+        $this->CarrierShippingFee = $CarrierShippingFee;
+        $this->_elements['CarrierShippingFee']['charset'] = $charset;
+    }
+    function getInsuranceFee()
+    {
+        return $this->InsuranceFee;
+    }
+    function setInsuranceFee($InsuranceFee, $charset = 'iso-8859-1')
+    {
+        $this->InsuranceFee = $InsuranceFee;
+        $this->_elements['InsuranceFee']['charset'] = $charset;
+    }
+    function getInsuranceOption()
+    {
+        return $this->InsuranceOption;
+    }
+    function setInsuranceOption($InsuranceOption, $charset = 'iso-8859-1')
+    {
+        $this->InsuranceOption = $InsuranceOption;
+        $this->_elements['InsuranceOption']['charset'] = $charset;
+    }
+    function getPackagingHandlingCosts()
+    {
+        return $this->PackagingHandlingCosts;
+    }
+    function setPackagingHandlingCosts($PackagingHandlingCosts, $charset = 'iso-8859-1')
+    {
+        $this->PackagingHandlingCosts = $PackagingHandlingCosts;
+        $this->_elements['PackagingHandlingCosts']['charset'] = $charset;
+    }
+    function getShippingRateErrorMessage()
+    {
+        return $this->ShippingRateErrorMessage;
+    }
+    function setShippingRateErrorMessage($ShippingRateErrorMessage, $charset = 'iso-8859-1')
+    {
+        $this->ShippingRateErrorMessage = $ShippingRateErrorMessage;
+        $this->_elements['ShippingRateErrorMessage']['charset'] = $charset;
+    }
+    function getShippingService()
+    {
+        return $this->ShippingService;
+    }
+    function setShippingService($ShippingService, $charset = 'iso-8859-1')
+    {
+        $this->ShippingService = $ShippingService;
+        $this->_elements['ShippingService']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ShippingDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ShippingDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ShippingDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,213 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ShippingDetailsType
+ * 
+ * Specifies the shipping payment details.
+ *
+ * @package Services_PayPal
+ */
+class ShippingDetailsType extends XSDType
+{
+    /**
+     * Indicates whether the buyer edited the payment amount.
+     */
+    var $AllowPaymentEdit;
+
+    /**
+     * Calculated shipping rate details. If present, then the calculated shipping rate
+     * option was used.
+     */
+    var $CalculatedShippingRate;
+
+    /**
+     * Indicates whether the payment instructions are included (e.g., for updating the
+     * details of a transaction).
+     */
+    var $ChangePaymentInstructions;
+
+    /**
+     * Flat shipping rate details. If present, then the flat shipping rate option was
+     * used.
+     */
+    var $FlatShippingRate;
+
+    /**
+     * Total cost of insurance for the transaction.
+     */
+    var $InsuranceTotal;
+
+    /**
+     * Indicates whether buyer selected to have insurance.
+     */
+    var $InsuranceWanted;
+
+    /**
+     * Payment instuctions.
+     */
+    var $PaymentInstructions;
+
+    /**
+     * Sales tax details. Sales tax applicable for only US sites. For non-US sites this
+     * sub-element should not be used.
+     */
+    var $SalesTax;
+
+    /**
+     * Postal/Zip code from where the seller will ship the item.
+     */
+    var $SellerPostalCode;
+
+    function ShippingDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AllowPaymentEdit' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CalculatedShippingRate' => 
+              array (
+                'required' => false,
+                'type' => 'CalculatedShippingRateType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ChangePaymentInstructions' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'FlatShippingRate' => 
+              array (
+                'required' => false,
+                'type' => 'FlatShippingRateType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InsuranceTotal' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'InsuranceWanted' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentInstructions' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SalesTax' => 
+              array (
+                'required' => false,
+                'type' => 'SalesTaxType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SellerPostalCode' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAllowPaymentEdit()
+    {
+        return $this->AllowPaymentEdit;
+    }
+    function setAllowPaymentEdit($AllowPaymentEdit, $charset = 'iso-8859-1')
+    {
+        $this->AllowPaymentEdit = $AllowPaymentEdit;
+        $this->_elements['AllowPaymentEdit']['charset'] = $charset;
+    }
+    function getCalculatedShippingRate()
+    {
+        return $this->CalculatedShippingRate;
+    }
+    function setCalculatedShippingRate($CalculatedShippingRate, $charset = 'iso-8859-1')
+    {
+        $this->CalculatedShippingRate = $CalculatedShippingRate;
+        $this->_elements['CalculatedShippingRate']['charset'] = $charset;
+    }
+    function getChangePaymentInstructions()
+    {
+        return $this->ChangePaymentInstructions;
+    }
+    function setChangePaymentInstructions($ChangePaymentInstructions, $charset = 'iso-8859-1')
+    {
+        $this->ChangePaymentInstructions = $ChangePaymentInstructions;
+        $this->_elements['ChangePaymentInstructions']['charset'] = $charset;
+    }
+    function getFlatShippingRate()
+    {
+        return $this->FlatShippingRate;
+    }
+    function setFlatShippingRate($FlatShippingRate, $charset = 'iso-8859-1')
+    {
+        $this->FlatShippingRate = $FlatShippingRate;
+        $this->_elements['FlatShippingRate']['charset'] = $charset;
+    }
+    function getInsuranceTotal()
+    {
+        return $this->InsuranceTotal;
+    }
+    function setInsuranceTotal($InsuranceTotal, $charset = 'iso-8859-1')
+    {
+        $this->InsuranceTotal = $InsuranceTotal;
+        $this->_elements['InsuranceTotal']['charset'] = $charset;
+    }
+    function getInsuranceWanted()
+    {
+        return $this->InsuranceWanted;
+    }
+    function setInsuranceWanted($InsuranceWanted, $charset = 'iso-8859-1')
+    {
+        $this->InsuranceWanted = $InsuranceWanted;
+        $this->_elements['InsuranceWanted']['charset'] = $charset;
+    }
+    function getPaymentInstructions()
+    {
+        return $this->PaymentInstructions;
+    }
+    function setPaymentInstructions($PaymentInstructions, $charset = 'iso-8859-1')
+    {
+        $this->PaymentInstructions = $PaymentInstructions;
+        $this->_elements['PaymentInstructions']['charset'] = $charset;
+    }
+    function getSalesTax()
+    {
+        return $this->SalesTax;
+    }
+    function setSalesTax($SalesTax, $charset = 'iso-8859-1')
+    {
+        $this->SalesTax = $SalesTax;
+        $this->_elements['SalesTax']['charset'] = $charset;
+    }
+    function getSellerPostalCode()
+    {
+        return $this->SellerPostalCode;
+    }
+    function setSellerPostalCode($SellerPostalCode, $charset = 'iso-8859-1')
+    {
+        $this->SellerPostalCode = $SellerPostalCode;
+        $this->_elements['SellerPostalCode']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SiteHostedPictureType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SiteHostedPictureType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SiteHostedPictureType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,90 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * SiteHostedPictureType
+ *
+ * @package Services_PayPal
+ */
+class SiteHostedPictureType extends XSDType
+{
+    /**
+     * URLs for item picture that are stored/hosted at eBay site.
+     */
+    var $PictureURL;
+
+    /**
+     * Type of display for photos used for PhotoHosting slide show. Here are display
+     * options: None = No special Picture Services features. SlideShow = Slideshow of
+     * multiple pictures. SuperSize = Super-size format picture. PicturePack = Picture
+     * Pack. Default is 'None'.
+     */
+    var $PhotoDisplay;
+
+    /**
+     * This will be either "Featured" or "Gallery".
+     */
+    var $GalleryType;
+
+    function SiteHostedPictureType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'PictureURL' => 
+              array (
+                'required' => false,
+                'type' => 'anyURI',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PhotoDisplay' => 
+              array (
+                'required' => false,
+                'type' => 'PhotoDisplayCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'GalleryType' => 
+              array (
+                'required' => false,
+                'type' => 'GalleryTypeCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getPictureURL()
+    {
+        return $this->PictureURL;
+    }
+    function setPictureURL($PictureURL, $charset = 'iso-8859-1')
+    {
+        $this->PictureURL = $PictureURL;
+        $this->_elements['PictureURL']['charset'] = $charset;
+    }
+    function getPhotoDisplay()
+    {
+        return $this->PhotoDisplay;
+    }
+    function setPhotoDisplay($PhotoDisplay, $charset = 'iso-8859-1')
+    {
+        $this->PhotoDisplay = $PhotoDisplay;
+        $this->_elements['PhotoDisplay']['charset'] = $charset;
+    }
+    function getGalleryType()
+    {
+        return $this->GalleryType;
+    }
+    function setGalleryType($GalleryType, $charset = 'iso-8859-1')
+    {
+        $this->GalleryType = $GalleryType;
+        $this->_elements['GalleryType']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/StorefrontType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/StorefrontType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/StorefrontType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * StorefrontType
+ * 
+ * Contains the eBay Stores-specific item attributes department number and store
+ * location. StorefrontInfo is shown for any item that belongs to an eBay Store
+ * owner, regardless of whether it is fixed price or auction type. Returned as null
+ * for international fixed price items.
+ *
+ * @package Services_PayPal
+ */
+class StorefrontType extends XSDType
+{
+    /**
+     * assumed this type is specific to add/get/revise item, then each StorefrontType
+     * nust have category id, for store details this node makes no sense to use
+     */
+    var $StoreCategoryID;
+
+    /**
+     * in case or revise item for example - to change store category (department) you
+     * do not need to change store URL, so it will notbe in request
+     */
+    var $StoreURL;
+
+    function StorefrontType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'StoreCategoryID' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'StoreURL' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getStoreCategoryID()
+    {
+        return $this->StoreCategoryID;
+    }
+    function setStoreCategoryID($StoreCategoryID, $charset = 'iso-8859-1')
+    {
+        $this->StoreCategoryID = $StoreCategoryID;
+        $this->_elements['StoreCategoryID']['charset'] = $charset;
+    }
+    function getStoreURL()
+    {
+        return $this->StoreURL;
+    }
+    function setStoreURL($StoreURL, $charset = 'iso-8859-1')
+    {
+        $this->StoreURL = $StoreURL;
+        $this->_elements['StoreURL']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SubscriptionInfoType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SubscriptionInfoType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SubscriptionInfoType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,181 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * SubscriptionInfoType
+ * 
+ * SubscriptionInfoType - Type declaration to be used by other schemas. Information
+ * about a PayPal Subscription.
+ *
+ * @package Services_PayPal
+ */
+class SubscriptionInfoType extends XSDType
+{
+    var $SubscriptionID;
+
+    var $SubscriptionDate;
+
+    var $EffectiveDate;
+
+    var $RetryTime;
+
+    var $Username;
+
+    var $Password;
+
+    var $Recurrences;
+
+    var $Terms;
+
+    function SubscriptionInfoType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'SubscriptionID' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SubscriptionDate' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'EffectiveDate' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'RetryTime' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Username' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Password' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Recurrences' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Terms' => 
+              array (
+                'required' => false,
+                'type' => 'SubscriptionTermsType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'reattempt' => 
+              array (
+                'name' => 'reattempt',
+                'type' => 'xs:string',
+                'use' => 'required',
+              ),
+              'recurring' => 
+              array (
+                'name' => 'recurring',
+                'type' => 'xs:string',
+                'use' => 'required',
+              ),
+            ));
+    }
+
+    function getSubscriptionID()
+    {
+        return $this->SubscriptionID;
+    }
+    function setSubscriptionID($SubscriptionID, $charset = 'iso-8859-1')
+    {
+        $this->SubscriptionID = $SubscriptionID;
+        $this->_elements['SubscriptionID']['charset'] = $charset;
+    }
+    function getSubscriptionDate()
+    {
+        return $this->SubscriptionDate;
+    }
+    function setSubscriptionDate($SubscriptionDate, $charset = 'iso-8859-1')
+    {
+        $this->SubscriptionDate = $SubscriptionDate;
+        $this->_elements['SubscriptionDate']['charset'] = $charset;
+    }
+    function getEffectiveDate()
+    {
+        return $this->EffectiveDate;
+    }
+    function setEffectiveDate($EffectiveDate, $charset = 'iso-8859-1')
+    {
+        $this->EffectiveDate = $EffectiveDate;
+        $this->_elements['EffectiveDate']['charset'] = $charset;
+    }
+    function getRetryTime()
+    {
+        return $this->RetryTime;
+    }
+    function setRetryTime($RetryTime, $charset = 'iso-8859-1')
+    {
+        $this->RetryTime = $RetryTime;
+        $this->_elements['RetryTime']['charset'] = $charset;
+    }
+    function getUsername()
+    {
+        return $this->Username;
+    }
+    function setUsername($Username, $charset = 'iso-8859-1')
+    {
+        $this->Username = $Username;
+        $this->_elements['Username']['charset'] = $charset;
+    }
+    function getPassword()
+    {
+        return $this->Password;
+    }
+    function setPassword($Password, $charset = 'iso-8859-1')
+    {
+        $this->Password = $Password;
+        $this->_elements['Password']['charset'] = $charset;
+    }
+    function getRecurrences()
+    {
+        return $this->Recurrences;
+    }
+    function setRecurrences($Recurrences, $charset = 'iso-8859-1')
+    {
+        $this->Recurrences = $Recurrences;
+        $this->_elements['Recurrences']['charset'] = $charset;
+    }
+    function getTerms()
+    {
+        return $this->Terms;
+    }
+    function setTerms($Terms, $charset = 'iso-8859-1')
+    {
+        $this->Terms = $Terms;
+        $this->_elements['Terms']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/SubscriptionTermsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/SubscriptionTermsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/SubscriptionTermsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * SubscriptionTermsType
+ * 
+ * SubscriptionTermsType - Type declaration to be used by other schemas. Terms of a
+ * PayPal subscription.
+ *
+ * @package Services_PayPal
+ */
+class SubscriptionTermsType extends XSDType
+{
+    var $Amount;
+
+    function SubscriptionTermsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Amount' => 
+              array (
+                'required' => true,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'period' => 
+              array (
+                'name' => 'period',
+                'type' => 'xs:string',
+                'use' => 'required',
+              ),
+            ));
+    }
+
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionSearchRequestType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionSearchRequestType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionSearchRequestType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,248 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractRequestType.php';
+
+/**
+ * TransactionSearchRequestType
+ *
+ * @package Services_PayPal
+ */
+class TransactionSearchRequestType extends AbstractRequestType
+{
+    var $StartDate;
+
+    var $EndDate;
+
+    var $Payer;
+
+    var $Receiver;
+
+    var $ReceiptID;
+
+    var $TransactionID;
+
+    var $PayerName;
+
+    var $AuctionItemNumber;
+
+    var $InvoiceID;
+
+    var $TransactionClass;
+
+    var $Amount;
+
+    var $CurrencyCode;
+
+    var $Status;
+
+    function TransactionSearchRequestType()
+    {
+        parent::AbstractRequestType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'StartDate' => 
+              array (
+                'required' => true,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'EndDate' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Payer' => 
+              array (
+                'required' => false,
+                'type' => 'EmailAddressType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Receiver' => 
+              array (
+                'required' => false,
+                'type' => 'EmailAddressType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'ReceiptID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'TransactionID' => 
+              array (
+                'required' => false,
+                'type' => 'TransactionId',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'PayerName' => 
+              array (
+                'required' => false,
+                'type' => 'PersonNameType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'AuctionItemNumber' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'InvoiceID' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'TransactionClass' => 
+              array (
+                'required' => false,
+                'type' => 'PaymentTransactionClassCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Amount' => 
+              array (
+                'required' => false,
+                'type' => 'BasicAmountType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'CurrencyCode' => 
+              array (
+                'required' => false,
+                'type' => 'CurrencyCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+              'Status' => 
+              array (
+                'required' => false,
+                'type' => 'PaymentTransactionStatusCodeType',
+                'namespace' => 'urn:ebay:api:PayPalAPI',
+              ),
+            ));
+    }
+
+    function getStartDate()
+    {
+        return $this->StartDate;
+    }
+    function setStartDate($StartDate, $charset = 'iso-8859-1')
+    {
+        $this->StartDate = $StartDate;
+        $this->_elements['StartDate']['charset'] = $charset;
+    }
+    function getEndDate()
+    {
+        return $this->EndDate;
+    }
+    function setEndDate($EndDate, $charset = 'iso-8859-1')
+    {
+        $this->EndDate = $EndDate;
+        $this->_elements['EndDate']['charset'] = $charset;
+    }
+    function getPayer()
+    {
+        return $this->Payer;
+    }
+    function setPayer($Payer, $charset = 'iso-8859-1')
+    {
+        $this->Payer = $Payer;
+        $this->_elements['Payer']['charset'] = $charset;
+    }
+    function getReceiver()
+    {
+        return $this->Receiver;
+    }
+    function setReceiver($Receiver, $charset = 'iso-8859-1')
+    {
+        $this->Receiver = $Receiver;
+        $this->_elements['Receiver']['charset'] = $charset;
+    }
+    function getReceiptID()
+    {
+        return $this->ReceiptID;
+    }
+    function setReceiptID($ReceiptID, $charset = 'iso-8859-1')
+    {
+        $this->ReceiptID = $ReceiptID;
+        $this->_elements['ReceiptID']['charset'] = $charset;
+    }
+    function getTransactionID()
+    {
+        return $this->TransactionID;
+    }
+    function setTransactionID($TransactionID, $charset = 'iso-8859-1')
+    {
+        $this->TransactionID = $TransactionID;
+        $this->_elements['TransactionID']['charset'] = $charset;
+    }
+    function getPayerName()
+    {
+        return $this->PayerName;
+    }
+    function setPayerName($PayerName, $charset = 'iso-8859-1')
+    {
+        $this->PayerName = $PayerName;
+        $this->_elements['PayerName']['charset'] = $charset;
+    }
+    function getAuctionItemNumber()
+    {
+        return $this->AuctionItemNumber;
+    }
+    function setAuctionItemNumber($AuctionItemNumber, $charset = 'iso-8859-1')
+    {
+        $this->AuctionItemNumber = $AuctionItemNumber;
+        $this->_elements['AuctionItemNumber']['charset'] = $charset;
+    }
+    function getInvoiceID()
+    {
+        return $this->InvoiceID;
+    }
+    function setInvoiceID($InvoiceID, $charset = 'iso-8859-1')
+    {
+        $this->InvoiceID = $InvoiceID;
+        $this->_elements['InvoiceID']['charset'] = $charset;
+    }
+    function getTransactionClass()
+    {
+        return $this->TransactionClass;
+    }
+    function setTransactionClass($TransactionClass, $charset = 'iso-8859-1')
+    {
+        $this->TransactionClass = $TransactionClass;
+        $this->_elements['TransactionClass']['charset'] = $charset;
+    }
+    function getAmount()
+    {
+        return $this->Amount;
+    }
+    function setAmount($Amount, $charset = 'iso-8859-1')
+    {
+        $this->Amount = $Amount;
+        $this->_elements['Amount']['charset'] = $charset;
+    }
+    function getCurrencyCode()
+    {
+        return $this->CurrencyCode;
+    }
+    function setCurrencyCode($CurrencyCode, $charset = 'iso-8859-1')
+    {
+        $this->CurrencyCode = $CurrencyCode;
+        $this->_elements['CurrencyCode']['charset'] = $charset;
+    }
+    function getStatus()
+    {
+        return $this->Status;
+    }
+    function setStatus($Status, $charset = 'iso-8859-1')
+    {
+        $this->Status = $Status;
+        $this->_elements['Status']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionSearchResponseType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionSearchResponseType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionSearchResponseType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/AbstractResponseType.php';
+
+/**
+ * TransactionSearchResponseType
+ *
+ * @package Services_PayPal
+ */
+class TransactionSearchResponseType extends AbstractResponseType
+{
+    var $PaymentTransactions;
+
+    function TransactionSearchResponseType()
+    {
+        parent::AbstractResponseType();
+        $this->_namespace = 'urn:ebay:api:PayPalAPI';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'PaymentTransactions' => 
+              array (
+                'required' => false,
+                'type' => 'PaymentTransactionSearchResultType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getPaymentTransactions()
+    {
+        return $this->PaymentTransactions;
+    }
+    function setPaymentTransactions($PaymentTransactions, $charset = 'iso-8859-1')
+    {
+        $this->PaymentTransactions = $PaymentTransactions;
+        $this->_elements['PaymentTransactions']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionStatusType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionStatusType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionStatusType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,135 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * TransactionStatusType
+ *
+ * @package Services_PayPal
+ */
+class TransactionStatusType extends XSDType
+{
+    /**
+     * Indicates the success or failure of an eBay Online Payment for the transaction.
+     * If the payment failed, the value returned indicates the reason for the failure.
+     * Possible values: 0 = No payment failure. 3 = Buyer's eCheck bounced. 4 = Buyer's
+     * credit card failed. 5 = Buyer failed payment as reported by seller. 7 = Payment
+     * from buyer to seller is in PayPal process, but has not yet been completed.
+     */
+    var $eBayPaymentStatus;
+
+    /**
+     * Indicates the current state of the checkout process for the transaction.
+     * Possible values: 0 = Checkout complete. 1 = Checkout incomplete. No details
+     * specified. 2 = Buyer requests total. 3 = Seller responded to buyer's request.
+     */
+    var $IncompleteState;
+
+    /**
+     * Indicates last date and time checkout status or incomplete state was updated (in
+     * GMT).
+     */
+    var $LastTimeModified;
+
+    /**
+     * Payment method used by the buyer. (See BuyerPaymentCodeList/Type).
+     */
+    var $PaymentMethodUsed;
+
+    /**
+     * Indicates whether the transaction process complete or incomplete. Possible
+     * values: 1 = Incomplete 2 = Complete
+     */
+    var $StatusIs;
+
+    function TransactionStatusType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'eBayPaymentStatus' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'IncompleteState' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'LastTimeModified' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'PaymentMethodUsed' => 
+              array (
+                'required' => false,
+                'type' => 'BuyerPaymentMethodCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'StatusIs' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function geteBayPaymentStatus()
+    {
+        return $this->eBayPaymentStatus;
+    }
+    function seteBayPaymentStatus($eBayPaymentStatus, $charset = 'iso-8859-1')
+    {
+        $this->eBayPaymentStatus = $eBayPaymentStatus;
+        $this->_elements['eBayPaymentStatus']['charset'] = $charset;
+    }
+    function getIncompleteState()
+    {
+        return $this->IncompleteState;
+    }
+    function setIncompleteState($IncompleteState, $charset = 'iso-8859-1')
+    {
+        $this->IncompleteState = $IncompleteState;
+        $this->_elements['IncompleteState']['charset'] = $charset;
+    }
+    function getLastTimeModified()
+    {
+        return $this->LastTimeModified;
+    }
+    function setLastTimeModified($LastTimeModified, $charset = 'iso-8859-1')
+    {
+        $this->LastTimeModified = $LastTimeModified;
+        $this->_elements['LastTimeModified']['charset'] = $charset;
+    }
+    function getPaymentMethodUsed()
+    {
+        return $this->PaymentMethodUsed;
+    }
+    function setPaymentMethodUsed($PaymentMethodUsed, $charset = 'iso-8859-1')
+    {
+        $this->PaymentMethodUsed = $PaymentMethodUsed;
+        $this->_elements['PaymentMethodUsed']['charset'] = $charset;
+    }
+    function getStatusIs()
+    {
+        return $this->StatusIs;
+    }
+    function setStatusIs($StatusIs, $charset = 'iso-8859-1')
+    {
+        $this->StatusIs = $StatusIs;
+        $this->_elements['StatusIs']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,353 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * TransactionType
+ * 
+ * Contains information about a single transaction. A transaction contains
+ * information about the sale of a particular item. The system creates a
+ * transaction when a buyer has made a purchase (Fixed Price items) or is the
+ * winning bidder (BIN and auction items). A listing can be associated with one or
+ * more transactions in these cases: Multi-Item Fixed Price Listings Dutch Auction
+ * Listings A listing is associated with a single transaction in these cases:
+ * Single-Item Fixed Price Listings Single-Item Auction Listings
+ *
+ * @package Services_PayPal
+ */
+class TransactionType extends XSDType
+{
+    /**
+     * The amount the buyer paid for the item or agreed to pay, depending on how far
+     * into the checkout process the item is. If the seller allowed the buyer to change
+     * the item total, the buyer is able to change the total until the time that the
+     * transaction's status moves to Complete. Determine whether the buyer changed the
+     * amount by calling GetSellerTransactions or GetSellerTransactions and comparing
+     * the AmountPaid value to what the seller expected. For Motors items, AmountPaid
+     * is the amount paid by the buyer for the deposit.
+     */
+    var $AmountPaid;
+
+    /**
+     * Container for buyer data.
+     */
+    var $Buyer;
+
+    /**
+     * Includes shipping payment data.
+     */
+    var $ShippingDetails;
+
+    /**
+     * Value returned in the Transaction/AmountPaid element, converted to the currency
+     * indicated by SiteCurrency.
+     */
+    var $ConvertedAmountPaid;
+
+    /**
+     * Value returned in the Transaction/TransactionPrice element, converted to the
+     * currency indicated by SiteCurrency.
+     */
+    var $ConvertedTransactionPrice;
+
+    /**
+     * For fixed-price, Stores, and BIN items indicates when the purchase (or BIN)
+     * occurred. For all other item types indicates when the transaction was created
+     * (the time when checkout was initiated).
+     */
+    var $CreatedDate;
+
+    /**
+     * Deposit type for Motors items. If item is not a Motors item, then returns a
+     * DepositType of None. Possible values: None Other Method Fast Deposit
+     */
+    var $DepositType;
+
+    /**
+     * Item info associated with the transaction.
+     */
+    var $Item;
+
+    /**
+     * Contains the number of individual items the buyer purchased in the transaction.
+     */
+    var $QuantityPurchased;
+
+    /**
+     * Shipping cost totals shown to user (for both flat and calculated rates).
+     */
+    var $ShippingHandlingTotal;
+
+    /**
+     * Container node for transaction status data.
+     */
+    var $Status;
+
+    /**
+     * Unique identifier for a transaction. Returns 0 when Type=1 (Chinese auction).
+     * Typically, an ItemID and a TransactionID uniquely identify a checkout
+     * transaction.
+     */
+    var $TransactionID;
+
+    /**
+     * Unique identifier for an authorization.
+     */
+    var $AuthorizationID;
+
+    /**
+     * Price of the item, before shipping and sales tax. For Motors, TransactionPrice
+     * is the deposit amount.
+     */
+    var $TransactionPrice;
+
+    /**
+     * VAT rate for the item, if the item price includes the VAT rate. Specify the
+     * VATPercent if you want include the net price in addition to the gross price in
+     * the listing. VAT rates vary depending on the item and on the user's country of
+     * residence; therefore a business seller is responsible for entering the correct
+     * VAT rate (it will not be calculated by eBay).
+     */
+    var $VATPercent;
+
+    function TransactionType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AmountPaid' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Buyer' => 
+              array (
+                'required' => false,
+                'type' => 'UserType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingDetails' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ConvertedAmountPaid' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ConvertedTransactionPrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'CreatedDate' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'DepositType' => 
+              array (
+                'required' => false,
+                'type' => 'DepositTypeCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Item' => 
+              array (
+                'required' => false,
+                'type' => 'ItemType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'QuantityPurchased' => 
+              array (
+                'required' => false,
+                'type' => 'int',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'ShippingHandlingTotal' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Status' => 
+              array (
+                'required' => false,
+                'type' => 'TransactionStatusType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'TransactionID' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AuthorizationID' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'TransactionPrice' => 
+              array (
+                'required' => false,
+                'type' => 'AmountType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'VATPercent' => 
+              array (
+                'required' => false,
+                'type' => 'decimal',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAmountPaid()
+    {
+        return $this->AmountPaid;
+    }
+    function setAmountPaid($AmountPaid, $charset = 'iso-8859-1')
+    {
+        $this->AmountPaid = $AmountPaid;
+        $this->_elements['AmountPaid']['charset'] = $charset;
+    }
+    function getBuyer()
+    {
+        return $this->Buyer;
+    }
+    function setBuyer($Buyer, $charset = 'iso-8859-1')
+    {
+        $this->Buyer = $Buyer;
+        $this->_elements['Buyer']['charset'] = $charset;
+    }
+    function getShippingDetails()
+    {
+        return $this->ShippingDetails;
+    }
+    function setShippingDetails($ShippingDetails, $charset = 'iso-8859-1')
+    {
+        $this->ShippingDetails = $ShippingDetails;
+        $this->_elements['ShippingDetails']['charset'] = $charset;
+    }
+    function getConvertedAmountPaid()
+    {
+        return $this->ConvertedAmountPaid;
+    }
+    function setConvertedAmountPaid($ConvertedAmountPaid, $charset = 'iso-8859-1')
+    {
+        $this->ConvertedAmountPaid = $ConvertedAmountPaid;
+        $this->_elements['ConvertedAmountPaid']['charset'] = $charset;
+    }
+    function getConvertedTransactionPrice()
+    {
+        return $this->ConvertedTransactionPrice;
+    }
+    function setConvertedTransactionPrice($ConvertedTransactionPrice, $charset = 'iso-8859-1')
+    {
+        $this->ConvertedTransactionPrice = $ConvertedTransactionPrice;
+        $this->_elements['ConvertedTransactionPrice']['charset'] = $charset;
+    }
+    function getCreatedDate()
+    {
+        return $this->CreatedDate;
+    }
+    function setCreatedDate($CreatedDate, $charset = 'iso-8859-1')
+    {
+        $this->CreatedDate = $CreatedDate;
+        $this->_elements['CreatedDate']['charset'] = $charset;
+    }
+    function getDepositType()
+    {
+        return $this->DepositType;
+    }
+    function setDepositType($DepositType, $charset = 'iso-8859-1')
+    {
+        $this->DepositType = $DepositType;
+        $this->_elements['DepositType']['charset'] = $charset;
+    }
+    function getItem()
+    {
+        return $this->Item;
+    }
+    function setItem($Item, $charset = 'iso-8859-1')
+    {
+        $this->Item = $Item;
+        $this->_elements['Item']['charset'] = $charset;
+    }
+    function getQuantityPurchased()
+    {
+        return $this->QuantityPurchased;
+    }
+    function setQuantityPurchased($QuantityPurchased, $charset = 'iso-8859-1')
+    {
+        $this->QuantityPurchased = $QuantityPurchased;
+        $this->_elements['QuantityPurchased']['charset'] = $charset;
+    }
+    function getShippingHandlingTotal()
+    {
+        return $this->ShippingHandlingTotal;
+    }
+    function setShippingHandlingTotal($ShippingHandlingTotal, $charset = 'iso-8859-1')
+    {
+        $this->ShippingHandlingTotal = $ShippingHandlingTotal;
+        $this->_elements['ShippingHandlingTotal']['charset'] = $charset;
+    }
+    function getStatus()
+    {
+        return $this->Status;
+    }
+    function setStatus($Status, $charset = 'iso-8859-1')
+    {
+        $this->Status = $Status;
+        $this->_elements['Status']['charset'] = $charset;
+    }
+    function getTransactionID()
+    {
+        return $this->TransactionID;
+    }
+    function setTransactionID($TransactionID, $charset = 'iso-8859-1')
+    {
+        $this->TransactionID = $TransactionID;
+        $this->_elements['TransactionID']['charset'] = $charset;
+    }
+    function getAuthorizationID()
+    {
+        return $this->AuthorizationID;
+    }
+    function setAuthorizationID($AuthorizationID, $charset = 'iso-8859-1')
+    {
+        $this->AuthorizationID = $AuthorizationID;
+        $this->_elements['AuthorizationID']['charset'] = $charset;
+    }
+    function getTransactionPrice()
+    {
+        return $this->TransactionPrice;
+    }
+    function setTransactionPrice($TransactionPrice, $charset = 'iso-8859-1')
+    {
+        $this->TransactionPrice = $TransactionPrice;
+        $this->_elements['TransactionPrice']['charset'] = $charset;
+    }
+    function getVATPercent()
+    {
+        return $this->VATPercent;
+    }
+    function setVATPercent($VATPercent, $charset = 'iso-8859-1')
+    {
+        $this->VATPercent = $VATPercent;
+        $this->_elements['VATPercent']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/TransactionsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * TransactionsType
+ * 
+ * Contains information about multiple individual transations.
+ *
+ * @package Services_PayPal
+ */
+class TransactionsType extends XSDType
+{
+    var $Transaction;
+
+    function TransactionsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'Transaction' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getTransaction()
+    {
+        return $this->Transaction;
+    }
+    function setTransaction($Transaction, $charset = 'iso-8859-1')
+    {
+        $this->Transaction = $Transaction;
+        $this->_elements['Transaction']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/UserIdPasswordType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/UserIdPasswordType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/UserIdPasswordType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,142 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * UserIdPasswordType
+ *
+ * @package Services_PayPal
+ */
+class UserIdPasswordType extends XSDType
+{
+    var $AppId;
+
+    var $DevId;
+
+    var $AuthCert;
+
+    /**
+     * The username is the identifier for an account.
+     */
+    var $Username;
+
+    /**
+     * Password contains the current password associated with the username.
+     */
+    var $Password;
+
+    /**
+     * This field identifies an account (e.g., payment) on whose behalf the operation
+     * is being performed. For instance one account holder may delegate the abililty to
+     * perform certain operations to another account holder. This delegation is done
+     * through a separate mechanism. If the base username has not been authorized by
+     * the subject the request will be rejected.
+     */
+    var $Subject;
+
+    function UserIdPasswordType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AppId' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'DevId' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'AuthCert' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Username' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Password' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Subject' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAppId()
+    {
+        return $this->AppId;
+    }
+    function setAppId($AppId, $charset = 'iso-8859-1')
+    {
+        $this->AppId = $AppId;
+        $this->_elements['AppId']['charset'] = $charset;
+    }
+    function getDevId()
+    {
+        return $this->DevId;
+    }
+    function setDevId($DevId, $charset = 'iso-8859-1')
+    {
+        $this->DevId = $DevId;
+        $this->_elements['DevId']['charset'] = $charset;
+    }
+    function getAuthCert()
+    {
+        return $this->AuthCert;
+    }
+    function setAuthCert($AuthCert, $charset = 'iso-8859-1')
+    {
+        $this->AuthCert = $AuthCert;
+        $this->_elements['AuthCert']['charset'] = $charset;
+    }
+    function getUsername()
+    {
+        return $this->Username;
+    }
+    function setUsername($Username, $charset = 'iso-8859-1')
+    {
+        $this->Username = $Username;
+        $this->_elements['Username']['charset'] = $charset;
+    }
+    function getPassword()
+    {
+        return $this->Password;
+    }
+    function setPassword($Password, $charset = 'iso-8859-1')
+    {
+        $this->Password = $Password;
+        $this->_elements['Password']['charset'] = $charset;
+    }
+    function getSubject()
+    {
+        return $this->Subject;
+    }
+    function setSubject($Subject, $charset = 'iso-8859-1')
+    {
+        $this->Subject = $Subject;
+        $this->_elements['Subject']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/UserType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/UserType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/UserType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,351 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * UserType
+ *
+ * @package Services_PayPal
+ */
+class UserType extends XSDType
+{
+    var $AboutMePage;
+
+    var $EAISToken;
+
+    var $Email;
+
+    /**
+     * Feedback scores are a quantitative expression of the desirability of dealing
+     * with that person as a Buyer or a Seller in auction transactions. Each auction
+     * transaction can result in one feedback entry for a given user (the Buyer can
+     * leave one feedback about the Seller and the Seller can leave one feedback about
+     * the Buyer). That one feedback can be positive, negative, or neutral. The
+     * aggregated feedback counts for a particular user represent that user's overall
+     * feedback score (referred to as a "feedback rating" on the eBay site). This
+     * rating is commonly expressed as the eBay Feedback score for the user.
+     */
+    var $FeedbackScore;
+
+    var $FeedbackPrivate;
+
+    var $FeedbackRatingStar;
+
+    var $IDVerified;
+
+    var $NewUser;
+
+    var $RegistrationAddress;
+
+    var $RegistrationDate;
+
+    var $Site;
+
+    var $Status;
+
+    var $UserID;
+
+    var $UserIDChanged;
+
+    var $UserIDLastChanged;
+
+    /**
+     * If present, indicates whether or not the user is subject to VAT. Users who have
+     * registered with eBay as VAT-exempt are not subject to VAT. See Value-Added Tax
+     * (VAT). Not returned for users whose country of residence is outside the EU.
+     * Possible values for the user's status: 2 = Residence in an EU country but user
+     * registered as VAT-exempt 3 = Residence in an EU country and user not registered
+     * as VAT-exempt
+     */
+    var $VATStatus;
+
+    var $BuyerInfo;
+
+    var $SellerInfo;
+
+    function UserType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'AboutMePage' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'EAISToken' => 
+              array (
+                'required' => false,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Email' => 
+              array (
+                'required' => true,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'FeedbackScore' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'FeedbackPrivate' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'FeedbackRatingStar' => 
+              array (
+                'required' => false,
+                'type' => 'FeedbackRatingStarCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'IDVerified' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'NewUser' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'RegistrationAddress' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'RegistrationDate' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Site' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'Status' => 
+              array (
+                'required' => false,
+                'type' => 'UserStatusCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'UserID' => 
+              array (
+                'required' => false,
+                'type' => NULL,
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'UserIDChanged' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'UserIDLastChanged' => 
+              array (
+                'required' => false,
+                'type' => 'dateTime',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'VATStatus' => 
+              array (
+                'required' => false,
+                'type' => 'VATStatusCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'BuyerInfo' => 
+              array (
+                'required' => false,
+                'type' => 'BuyerType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'SellerInfo' => 
+              array (
+                'required' => false,
+                'type' => 'SellerType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getAboutMePage()
+    {
+        return $this->AboutMePage;
+    }
+    function setAboutMePage($AboutMePage, $charset = 'iso-8859-1')
+    {
+        $this->AboutMePage = $AboutMePage;
+        $this->_elements['AboutMePage']['charset'] = $charset;
+    }
+    function getEAISToken()
+    {
+        return $this->EAISToken;
+    }
+    function setEAISToken($EAISToken, $charset = 'iso-8859-1')
+    {
+        $this->EAISToken = $EAISToken;
+        $this->_elements['EAISToken']['charset'] = $charset;
+    }
+    function getEmail()
+    {
+        return $this->Email;
+    }
+    function setEmail($Email, $charset = 'iso-8859-1')
+    {
+        $this->Email = $Email;
+        $this->_elements['Email']['charset'] = $charset;
+    }
+    function getFeedbackScore()
+    {
+        return $this->FeedbackScore;
+    }
+    function setFeedbackScore($FeedbackScore, $charset = 'iso-8859-1')
+    {
+        $this->FeedbackScore = $FeedbackScore;
+        $this->_elements['FeedbackScore']['charset'] = $charset;
+    }
+    function getFeedbackPrivate()
+    {
+        return $this->FeedbackPrivate;
+    }
+    function setFeedbackPrivate($FeedbackPrivate, $charset = 'iso-8859-1')
+    {
+        $this->FeedbackPrivate = $FeedbackPrivate;
+        $this->_elements['FeedbackPrivate']['charset'] = $charset;
+    }
+    function getFeedbackRatingStar()
+    {
+        return $this->FeedbackRatingStar;
+    }
+    function setFeedbackRatingStar($FeedbackRatingStar, $charset = 'iso-8859-1')
+    {
+        $this->FeedbackRatingStar = $FeedbackRatingStar;
+        $this->_elements['FeedbackRatingStar']['charset'] = $charset;
+    }
+    function getIDVerified()
+    {
+        return $this->IDVerified;
+    }
+    function setIDVerified($IDVerified, $charset = 'iso-8859-1')
+    {
+        $this->IDVerified = $IDVerified;
+        $this->_elements['IDVerified']['charset'] = $charset;
+    }
+    function getNewUser()
+    {
+        return $this->NewUser;
+    }
+    function setNewUser($NewUser, $charset = 'iso-8859-1')
+    {
+        $this->NewUser = $NewUser;
+        $this->_elements['NewUser']['charset'] = $charset;
+    }
+    function getRegistrationAddress()
+    {
+        return $this->RegistrationAddress;
+    }
+    function setRegistrationAddress($RegistrationAddress, $charset = 'iso-8859-1')
+    {
+        $this->RegistrationAddress = $RegistrationAddress;
+        $this->_elements['RegistrationAddress']['charset'] = $charset;
+    }
+    function getRegistrationDate()
+    {
+        return $this->RegistrationDate;
+    }
+    function setRegistrationDate($RegistrationDate, $charset = 'iso-8859-1')
+    {
+        $this->RegistrationDate = $RegistrationDate;
+        $this->_elements['RegistrationDate']['charset'] = $charset;
+    }
+    function getSite()
+    {
+        return $this->Site;
+    }
+    function setSite($Site, $charset = 'iso-8859-1')
+    {
+        $this->Site = $Site;
+        $this->_elements['Site']['charset'] = $charset;
+    }
+    function getStatus()
+    {
+        return $this->Status;
+    }
+    function setStatus($Status, $charset = 'iso-8859-1')
+    {
+        $this->Status = $Status;
+        $this->_elements['Status']['charset'] = $charset;
+    }
+    function getUserID()
+    {
+        return $this->UserID;
+    }
+    function setUserID($UserID, $charset = 'iso-8859-1')
+    {
+        $this->UserID = $UserID;
+        $this->_elements['UserID']['charset'] = $charset;
+    }
+    function getUserIDChanged()
+    {
+        return $this->UserIDChanged;
+    }
+    function setUserIDChanged($UserIDChanged, $charset = 'iso-8859-1')
+    {
+        $this->UserIDChanged = $UserIDChanged;
+        $this->_elements['UserIDChanged']['charset'] = $charset;
+    }
+    function getUserIDLastChanged()
+    {
+        return $this->UserIDLastChanged;
+    }
+    function setUserIDLastChanged($UserIDLastChanged, $charset = 'iso-8859-1')
+    {
+        $this->UserIDLastChanged = $UserIDLastChanged;
+        $this->_elements['UserIDLastChanged']['charset'] = $charset;
+    }
+    function getVATStatus()
+    {
+        return $this->VATStatus;
+    }
+    function setVATStatus($VATStatus, $charset = 'iso-8859-1')
+    {
+        $this->VATStatus = $VATStatus;
+        $this->_elements['VATStatus']['charset'] = $charset;
+    }
+    function getBuyerInfo()
+    {
+        return $this->BuyerInfo;
+    }
+    function setBuyerInfo($BuyerInfo, $charset = 'iso-8859-1')
+    {
+        $this->BuyerInfo = $BuyerInfo;
+        $this->_elements['BuyerInfo']['charset'] = $charset;
+    }
+    function getSellerInfo()
+    {
+        return $this->SellerInfo;
+    }
+    function setSellerInfo($SellerInfo, $charset = 'iso-8859-1')
+    {
+        $this->SellerInfo = $SellerInfo;
+        $this->_elements['SellerInfo']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/VATDetailsType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/VATDetailsType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/VATDetailsType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,82 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * VATDetailsType
+ * 
+ * Contains information required To list a business item. BusinessSeller - only for
+ * add item, the RestrictedToBusiness and VATPercent for both get and add, for
+ * revise all must be optional
+ *
+ * @package Services_PayPal
+ */
+class VATDetailsType extends XSDType
+{
+    var $BusinessSeller;
+
+    var $RestrictedToBusiness;
+
+    var $VATPercent;
+
+    function VATDetailsType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'BusinessSeller' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'RestrictedToBusiness' => 
+              array (
+                'required' => false,
+                'type' => 'boolean',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'VATPercent' => 
+              array (
+                'required' => false,
+                'type' => 'float',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getBusinessSeller()
+    {
+        return $this->BusinessSeller;
+    }
+    function setBusinessSeller($BusinessSeller, $charset = 'iso-8859-1')
+    {
+        $this->BusinessSeller = $BusinessSeller;
+        $this->_elements['BusinessSeller']['charset'] = $charset;
+    }
+    function getRestrictedToBusiness()
+    {
+        return $this->RestrictedToBusiness;
+    }
+    function setRestrictedToBusiness($RestrictedToBusiness, $charset = 'iso-8859-1')
+    {
+        $this->RestrictedToBusiness = $RestrictedToBusiness;
+        $this->_elements['RestrictedToBusiness']['charset'] = $charset;
+    }
+    function getVATPercent()
+    {
+        return $this->VATPercent;
+    }
+    function setVATPercent($VATPercent, $charset = 'iso-8859-1')
+    {
+        $this->VATPercent = $VATPercent;
+        $this->_elements['VATPercent']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/ValType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/ValType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/ValType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * ValType
+ *
+ * @package Services_PayPal
+ */
+class ValType extends XSDType
+{
+    var $ValueLiteral;
+
+    function ValType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'ValueLiteral' => 
+              array (
+                'required' => true,
+                'type' => 'string',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+        $this->_attributes = array_merge($this->_attributes,
+            array (
+              'ValueID' => 
+              array (
+                'name' => 'ValueID',
+                'type' => 'xs:string',
+                'use' => 'optional',
+              ),
+            ));
+    }
+
+    function getValueLiteral()
+    {
+        return $this->ValueLiteral;
+    }
+    function setValueLiteral($ValueLiteral, $charset = 'iso-8859-1')
+    {
+        $this->ValueLiteral = $ValueLiteral;
+        $this->_elements['ValueLiteral']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/VendorHostedPictureType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/VendorHostedPictureType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/VendorHostedPictureType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<?php
+/**
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * VendorHostedPictureType
+ *
+ * @package Services_PayPal
+ */
+class VendorHostedPictureType extends XSDType
+{
+    /**
+     * URLs for item picture that are stored/hosted at eBay site.
+     */
+    var $PictureURL;
+
+    /**
+     * URL for a picture for the gallery. If the GalleryFeatured argument is true, a
+     * value must be supplied for either the GalleryURL or the PictureURL argument. In
+     * either case: (a) If a URL is provided for only PictureURL, it is used as the
+     * Gallery thumbnail. (b) If a URL is provided for both GalleryURL and PictureURL,
+     * then the picture indicated in GalleryURL is used as the thumbnail. The image
+     * used for the Gallery thumbnail (specified in the GalleryURL or PictureURL
+     * argument) must be in one of the graphics formats JPEG, BMP, TIF, or GIF.
+     */
+    var $GalleryURL;
+
+    /**
+     * This will be either "Featured" or "Gallery".
+     */
+    var $GalleryType;
+
+    function VendorHostedPictureType()
+    {
+        parent::XSDType();
+        $this->_namespace = 'urn:ebay:apis:eBLBaseComponents';
+        $this->_elements = array_merge($this->_elements,
+            array (
+              'PictureURL' => 
+              array (
+                'required' => false,
+                'type' => 'anyURI',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'GalleryURL' => 
+              array (
+                'required' => false,
+                'type' => 'anyURI',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+              'GalleryType' => 
+              array (
+                'required' => false,
+                'type' => 'GalleryTypeCodeType',
+                'namespace' => 'urn:ebay:apis:eBLBaseComponents',
+              ),
+            ));
+    }
+
+    function getPictureURL()
+    {
+        return $this->PictureURL;
+    }
+    function setPictureURL($PictureURL, $charset = 'iso-8859-1')
+    {
+        $this->PictureURL = $PictureURL;
+        $this->_elements['PictureURL']['charset'] = $charset;
+    }
+    function getGalleryURL()
+    {
+        return $this->GalleryURL;
+    }
+    function setGalleryURL($GalleryURL, $charset = 'iso-8859-1')
+    {
+        $this->GalleryURL = $GalleryURL;
+        $this->_elements['GalleryURL']['charset'] = $charset;
+    }
+    function getGalleryType()
+    {
+        return $this->GalleryType;
+    }
+    function setGalleryType($GalleryType, $charset = 'iso-8859-1')
+    {
+        $this->GalleryType = $GalleryType;
+        $this->_elements['GalleryType']['charset'] = $charset;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/XSDSimpleType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/XSDSimpleType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/XSDSimpleType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<?php
+/**
+ * This is one of two base Type files that are not automatically
+ * generated from the WSDL.
+ *
+ * @package Services_PayPal
+ */
+
+/**
+ * Make sure our parent class is defined.
+ */
+require_once 'Services/PayPal/Type/XSDType.php';
+
+/**
+ * Base Type classs that allows for conversion of types into
+ * SOAP_Value objects.
+ *
+ * @package Services_PayPal
+ */
+class XSDSimpleType extends XSDType
+{
+    /**
+     * The simple value of this type.
+     *
+     * @access protected
+     *
+     * @var mixed $_value
+     */
+    var $_value;
+
+    /**
+     * The charset of this type's value.
+     *
+     * @access protected
+     *
+     * @var string $_charset
+     */
+    var $_charset = 'iso-8859-1';
+
+    /**
+     * Constructor.
+     */
+    function XSDSimpleType($value = null, $attributes = array())
+    {
+        $this->_value = $value;
+        $this->_attributeValues = $attributes;
+    }
+
+    /**
+     * Turn this type into a SOAP_Value object useable with
+     * SOAP_Client.
+     *
+     * @param string $name  The name to use for the value.
+     *
+     * @return SOAP_Value  A SOAP_Value object representing this type instance.
+     */
+    function &getSoapValue($name)
+    {
+        include_once 'Services/PayPal/SOAP/Value.php';
+
+        $value = $this->_value;
+        if (is_string($value) && $this->_charset = 'iso-8859-1' &&
+            (utf8_encode(utf8_decode($value)) != $value)) {
+            $value = utf8_encode($value);
+        }
+        if (count($this->_attributeValues)) {
+            return $v =& new SOAP_Value($name, '', $value, $this->_attributeValues);
+        } else {
+            return $v =& new SOAP_Value($name, '', $value);
+        }
+    }
+
+    /**
+     * Set the value of this simple object.
+     */
+    function setval($value, $charset = 'iso-8859-1')
+    {
+        $this->_value = $value;
+        $this->_charset = $charset;
+    }
+
+    /**
+     * Get the value of this simple object.
+     */
+    function getval()
+    {
+        return $this->_value;
+    }
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/Type/XSDType.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/Type/XSDType.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/Type/XSDType.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,155 @@
+<?php
+/**
+ * This is one of two base Type files that are not automatically
+ * generated from the WSDL.
+ *
+ * @package Services_PayPal
+ */
+
+/**
+ * Base Type classs that allows for conversion of types into
+ * SOAP_Value objects.
+ *
+ * @package Services_PayPal
+ */
+class XSDType
+{
+    /**
+     * Information about all of the member variables of this type.
+     *
+     * @access protected
+     *
+     * @var array $_elements
+     */
+    var $_elements = array();
+
+    /**
+     * Information about all of the attributes of this type.
+     *
+     * @access protected
+     *
+     * @var array $_attributes
+     */
+    var $_attributes = array();
+
+    /**
+     * Actual values of any attributes for this type.
+     *
+     * @access protected
+     *
+     * @var array $_attributeValues
+     */
+    var $_attributeValues = array();
+
+    /**
+     * What namespace is this type in?
+     *
+     * @access protected
+     *
+     * @var string $_namespace
+     */
+    var $_namespace;
+
+    /**
+     * Constructor. Base class constructor is empty.
+     */
+    function XSDType()
+    {
+    }
+
+    /**
+     * Turn this type into a SOAP_Value object useable with
+     * SOAP_Client.
+     *
+     * @param string $name  The name to use for the value.
+     * @param string $ns    The namespace of the parent value.
+     *
+     * @return SOAP_Value  A SOAP_Value object representing this type instance.
+     */
+    function &getSoapValue($name, $ns = null)
+    {
+        include_once 'Services/PayPal/SOAP/Value.php';
+
+        $elements = array();
+        foreach ($this->_elements as $ename => $element) {
+            $value = $this->$ename;
+
+            // Values that are null and not required can be omitted
+            // from the serialized XML (and thus the SOAP_Value
+            // object) entirely.
+            if (is_null($value) && !$element['required']) {
+                continue;
+            }
+
+            // Append namespace prefixes if this element came from a
+            // namespace different from the base type's namespace.
+            if (!empty($element['namespace']) && $element['namespace'] != $this->_namespace) {
+                $ename = '{' . $element['namespace'] . '}' . $ename;
+            }
+
+            if (is_a($value, 'XSDType')) {
+                $elements[] =& $value->getSoapValue($ename, $this->_namespace);
+            } elseif(is_array($value)) {
+                for($i = 0; $i < count($value); $i++) {
+          if (is_a($value[$i], 'XSDType')) {
+              $elements[] =& $value[$i]->getSoapValue($ename, $this->_namespace);
+          } else {
+              if (is_string($value[$i]) && $element['charset'] == 'iso-8859-1' &&
+                  (utf8_encode(utf8_decode($value[$i])) != $value[$i])) {
+                  $value[$i] = utf8_encode($value[$i]);
+              }
+              $elements[] =& new SOAP_Value($ename, $element['type'], $value[$i]);
+          }
+                }
+            } else {
+                if (is_string($value) && $element['charset'] == 'iso-8859-1' &&
+                    (utf8_encode(utf8_decode($value)) != $value)) {
+                    $value = utf8_encode($value);
+                }
+                $elements[] =& new SOAP_Value($ename, $element['type'], $value);
+            }
+        }
+
+        if (count($elements) == 1) {
+            $elements = array_shift($elements);
+        }
+
+        if (!is_null($ns) && $ns != $this->_namespace) {
+            $this->_attributeValues['xmlns'] = $this->_namespace;
+        }
+
+        if (count($this->_attributeValues)) {
+            return $v =& new SOAP_Value($name, '', $elements, $this->_attributeValues);
+        } else {
+            return $v =& new SOAP_Value($name, '', $elements);
+        }
+    }
+
+    /**
+     * Set the value of an attribute on this object.
+     */
+    function setattr($attribute, $value)
+    {
+        $this->_attributeValues[$attribute] = $value;
+    }
+
+    /**
+     * Get the value of an attribute on this object.
+     */
+    function getattr($attribute)
+    {
+        return isset($this->_attributeValues[$attribute]) ?
+            $this->_attributeValues[$attribute] :
+            null;
+    }
+
+    /**
+     * Callback for SOAP_Base::_decode() to set attributes during
+     * response decoding.
+     */
+    function __set_attribute($key, $value)
+    {
+        return $this->setattr($key, $value);
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/Services/PayPal/build/README
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/build/README	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/build/README	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,2 @@
+This directory is used by the SDK for building new versions and for
+storing builds for rollback.

Added: trunk/direct.openmoko.com/pear/Services/PayPal/cert/api_cert_chain.crt
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/cert/api_cert_chain.crt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/cert/api_cert_chain.crt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+-----BEGIN CERTIFICATE-----
+MIIDgzCCAuygAwIBAgIQJUuKhThCzONY+MXdriJupDANBgkqhkiG9w0BAQUFADBf
+MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xNzA1BgNVBAsT
+LkNsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw
+HhcNOTcwNDE3MDAwMDAwWhcNMTExMDI0MjM1OTU5WjCBujEfMB0GA1UEChMWVmVy
+aVNpZ24gVHJ1c3QgTmV0d29yazEXMBUGA1UECxMOVmVyaVNpZ24sIEluYy4xMzAx
+BgNVBAsTKlZlcmlTaWduIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gQ2xhc3Mg
+MzFJMEcGA1UECxNAd3d3LnZlcmlzaWduLmNvbS9DUFMgSW5jb3JwLmJ5IFJlZi4g
+TElBQklMSVRZIExURC4oYyk5NyBWZXJpU2lnbjCBnzANBgkqhkiG9w0BAQEFAAOB
+jQAwgYkCgYEA2IKA6NYZAn0fhRg5JaJlK+G/1AXTvOY2O6rwTGxbtueqPHNFVbLx
+veqXQu2aNAoV1Klc9UAl3dkHwTKydWzEyruj/lYncUOqY/UwPpMo5frxCTvzt01O
+OfdcSVq4wR3Tsor+cDCVQsv+K1GLWjw6+SJPkLICp1OcTzTnqwSye28CAwEAAaOB
+4zCB4DAPBgNVHRMECDAGAQH/AgEAMEQGA1UdIAQ9MDswOQYLYIZIAYb4RQEHAQEw
+KjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQUzA0BgNV
+HSUELTArBggrBgEFBQcDAQYIKwYBBQUHAwIGCWCGSAGG+EIEAQYKYIZIAYb4RQEI
+ATALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEGMDEGA1UdHwQqMCgwJqAk
+oCKGIGh0dHA6Ly9jcmwudmVyaXNpZ24uY29tL3BjYTMuY3JsMA0GCSqGSIb3DQEB
+BQUAA4GBAAgB7ORolANC8XPxI6I63unx2sZUxCM+hurPajozq+qcBBQHNgYL+Yhv
+1RPuKSvD5HKNRO3RrCAJLeH24RkFOLA9D59/+J4C3IYChmFOJl9en5IeDCSk9dBw
+E88mw0M9SR2egi5SX7w+xmYpAY5Okiy8RnUDgqxz6dl+C2fvVFIa
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
+A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
+cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
+MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
+BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
+YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
+BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
+I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
+CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
+lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
+AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
+-----END CERTIFICATE-----

Added: trunk/direct.openmoko.com/pear/Services/PayPal/cert/live.paypal.com.pem
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/cert/live.paypal.com.pem	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/cert/live.paypal.com.pem	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMx
+CzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQ
+YXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9h
+cGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1
+WhcNMzUwMjEzMTAxMzE1WjCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYw
+FAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEG
+A1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0B
+CQEWDXJlQHBheXBhbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMFH
+Tt38RMxLXJyO2SmS+Ndl72T7oKJ4u4uw+6awntALWh03PewmIJuzbALScsTS4sZo
+S1fKciBGoh11gIfHzylvkdNe/hJl66/RGqrj5rFb08sAABNTzDTiqqNpJeBsYs/c
+2aiGozptX2RlnBktH+SUNpAajW724Nv2Wvhif6sFAgMBAAGjge4wgeswHQYDVR0O
+BBYEFJaffLvGbxe9WT9S1wob7BDWZJRrMIG7BgNVHSMEgbMwgbCAFJaffLvGbxe9
+WT9S1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0Ex
+FjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMw
+EQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3
+DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEB
+BQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE
+4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwY
+RiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmH
+-----END CERTIFICATE-----

Added: trunk/direct.openmoko.com/pear/Services/PayPal/cert/sandbox.paypal.com.pem
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/cert/sandbox.paypal.com.pem	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/cert/sandbox.paypal.com.pem	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDoTCCAwqgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBmDELMAkGA1UEBhMCVVMx
+EzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBKb3NlMRUwEwYDVQQK
+EwxQYXlQYWwsIEluYy4xFjAUBgNVBAsUDXNhbmRib3hfY2VydHMxFDASBgNVBAMU
+C3NhbmRib3hfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0
+MDQxOTA3MDI1NFoXDTM1MDQxOTA3MDI1NFowgZgxCzAJBgNVBAYTAlVTMRMwEQYD
+VQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhTYW4gSm9zZTEVMBMGA1UEChMMUGF5
+UGFsLCBJbmMuMRYwFAYDVQQLFA1zYW5kYm94X2NlcnRzMRQwEgYDVQQDFAtzYW5k
+Ym94X2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG
+9w0BAQEFAAOBjQAwgYkCgYEAt5bjv/0N0qN3TiBL+1+L/EjpO1jeqPaJC1fDi+cC
+6t6tTbQ55Od4poT8xjSzNH5S48iHdZh0C7EqfE1MPCc2coJqCSpDqxmOrO+9QXsj
+HWAnx6sb6foHHpsPm7WgQyUmDsNwTWT3OGR398ERmBzzcoL5owf3zBSpRP0NlTWo
+nPMCAwEAAaOB+DCB9TAdBgNVHQ4EFgQUgy4i2asqiC1rp5Ms81Dx8nfVqdIwgcUG
+A1UdIwSBvTCBuoAUgy4i2asqiC1rp5Ms81Dx8nfVqdKhgZ6kgZswgZgxCzAJBgNV
+BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhTYW4gSm9zZTEV
+MBMGA1UEChMMUGF5UGFsLCBJbmMuMRYwFAYDVQQLFA1zYW5kYm94X2NlcnRzMRQw
+EgYDVQQDFAtzYW5kYm94X2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNv
+bYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAFc288DYGX+GX2+W
+P/dwdXwficf+rlG+0V9GBPJZYKZJQ069W/ZRkUuWFQ+Opd2yhPpneGezmw3aU222
+CGrdKhOrBJRRcpoO3FjHHmXWkqgbQqDWdG7S+/l8n1QfDPp+jpULOrcnGEUY41Im
+jZJTylbJQ1b5PBBjGiP0PpK48cdF
+-----END CERTIFICATE-----

Added: trunk/direct.openmoko.com/pear/Services/PayPal/conf/paypal-sdk.php.dist
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/conf/paypal-sdk.php.dist	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/conf/paypal-sdk.php.dist	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Example PayPal SDK configuration file.
+ */
+
+/**
+ * What level should we log at? Valid levels are:
+ *   PEAR_LOG_ERR   - Log only severe errors.
+ *   PEAR_LOG_INFO  - (default) Date/time of operation, operation name, elapsed time, success or failure indication.
+ *   PEAR_LOG_DEBUG - Full text of SOAP requests and responses and other debugging messages.
+ *
+ * See the PayPal SDK User Guide for more details on these log levels.
+ */
+
+$__PP_CONFIG['log_level'] = PEAR_LOG_INFO; 
+
+/**
+ * If we're logging, what directory should we create log files in?
+ * Note that a log name coincides with a symlink, logging will *not*
+ * be done to avoid security problems. File names are
+ * <DateStamp>.PayPal.log.
+ */
+
+$__PP_CONFIG['log_dir'] = '/tmp';
+
+/**
+ * The path where custom profile storage handlers are located.
+ * 
+ * IMPORTANT: Custom handler classes must be named ProfileHandler_<Handler Name>
+ * and be stored in the file <Handler Name>.php within this directory
+ */
+$__PP_CONFIG['custom_handler_dir'] = array('/path/to/custom/handlers');
+
+/**
+ * Where Profile certificates will be stored. Must be writable by the 
+ * web server.
+ */
+$__PP_CONFIG['profile_cert_dir'] = '/tmp';
+
+/**
+ * The Location of the public Paypal certificate file
+ */
+$__PP_CONFIG['paypal_cert_file']['Live'] = '/path/to/cert/Livefile.crt';
+$__PP_CONFIG['paypal_cert_file']['Sandbox'] = '/path/to/cert/Sandboxfile.crt';
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/CoreComponentTypes.xsd
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/CoreComponentTypes.xsd	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/CoreComponentTypes.xsd	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:apis:CoreComponentTypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ebay:apis:CoreComponentTypes" elementFormDefault="qualified" attributeFormDefault="unqualified">
+<xs:import namespace="urn:ebay:apis:eBLBaseComponents" schemaLocation="eBLBaseComponents.xsd"/>
+  <!-- Definition of AmountType -->
+  <xs:complexType name="AmountType">
+    <xs:simpleContent>
+      <xs:extension base="xs:double">
+        <xs:attribute name="currencyID" type="ebl:CurrencyCodeType" use="required"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  <xs:complexType name="BasicAmountType">
+    <xs:simpleContent>
+      <xs:extension base="xs:string">
+        <xs:attribute name="currencyID" type="ebl:CurrencyCodeType" use="required"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  <!-- Definition of MeasureType -->
+  <xs:complexType name="MeasureType">
+    <xs:simpleContent>
+      <xs:extension base="xs:double">
+        <xs:attribute name="unit" type="xs:token" use="required"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  <!-- Definition of QuantityType -->
+  <xs:complexType name="QuantityType">
+    <xs:simpleContent>
+      <xs:extension base="xs:double">
+        <xs:attribute name="unit" type="xs:token" use="optional"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  <!-- Definition of UUIDType (as a simpleType)-->
+  <xs:simpleType name="UUIDType">
+    <xs:annotation>
+      <xs:documentation>
+          Specifies a universally unique identifier. The UUID can 
+          only contain digits from 0-9 and letters from A-F. The 
+          UUID must be 32 characters long.  For example, 
+          1FB02B2-9D27-3acb-ABA2-9D539C374228       
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:length value="36"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:schema>

Added: trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/PayPalSvc.wsdl
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/PayPalSvc.wsdl	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/PayPalSvc.wsdl	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,804 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions ns:version="2.00" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:cc="urn:ebay:apis:CoreComponentTypes" targetNamespace="urn:ebay:api:PayPalAPI">
+  <wsdl:types>
+    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ebay:api:PayPalAPI" elementFormDefault="qualified" attributeFormDefault="unqualified">
+      <import namespace="urn:ebay:apis:CoreComponentTypes" schemaLocation="CoreComponentTypes.xsd"/>
+      <import namespace="urn:ebay:apis:eBLBaseComponents" schemaLocation="eBLBaseComponents.xsd"/>
+      <!-- Custom Security header element-->
+      <xs:element name="RequesterCredentials" type="ebl:CustomSecurityHeaderType"/>
+      <!-- API Request/Responses -->
+      <xs:element name="RefundTransactionRequest" type="ns:RefundTransactionRequestType"/>
+      <xs:element name="RefundTransactionResponse" type="ns:RefundTransactionResponseType"/>
+      <xs:element name="RefundTransactionReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:RefundTransactionRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="RefundTransactionRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="TransactionID" type="ebl:TransactionId"/>
+              <xs:element name="RefundType" type="ebl:RefundPurposeTypeCodeType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="Amount" type="cc:BasicAmountType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="Memo" type="xs:string" minOccurs="0" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="RefundTransactionResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <sequence>
+              <element name="RefundTransactionID" type="ebl:TransactionId"  minOccurs="0" maxOccurs="1" nillable="true"/>
+              <element name="NetRefundAmount"     type="cc:BasicAmountType" minOccurs="0" maxOccurs="1"/>
+              <element name="FeeRefundAmount"     type="cc:BasicAmountType" minOccurs="0" maxOccurs="1"/>
+              <element name="GrossRefundAmount"   type="cc:BasicAmountType" minOccurs="0" maxOccurs="1"/>
+            </sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="GetTransactionDetailsRequest" type="ns:GetTransactionDetailsRequestType"/>
+      <xs:element name="GetTransactionDetailsResponse" type="ns:GetTransactionDetailsResponseType"/>
+      <xs:element name="GetTransactionDetailsReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:GetTransactionDetailsRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="GetTransactionDetailsRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="TransactionID" type="ebl:TransactionId"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="GetTransactionDetailsResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element ref="ebl:PaymentTransactionDetails"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="BillUserRequest" type="ns:BillUserRequestType"/>
+      <xs:element name="BillUserResponse" type="ns:BillUserResponseType"/>
+      <xs:element name="BillUserReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:BillUserRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="BillUserRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element ref="ebl:MerchantPullPaymentDetails"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="BillUserResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element ref="ebl:BillUserResponseDetails"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="TransactionSearchRequest" type="ns:TransactionSearchRequestType"/>
+      <xs:element name="TransactionSearchResponse" type="ns:TransactionSearchResponseType"/>
+      <xs:element name="TransactionSearchReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:TransactionSearchRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="TransactionSearchRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="StartDate" type="xs:dateTime" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="EndDate" type="xs:dateTime" minOccurs="0"/>
+              <xs:element name="Payer" type="ebl:EmailAddressType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="Receiver" type="ebl:EmailAddressType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="ReceiptID" type="xs:string" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="TransactionID" type="ebl:TransactionId" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="PayerName" type="ebl:PersonNameType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="AuctionItemNumber" type="xs:string" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="InvoiceID" type="xs:string" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="TransactionClass" type="ebl:PaymentTransactionClassCodeType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="Amount" type="cc:BasicAmountType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="CurrencyCode" type="ebl:CurrencyCodeType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="Status" type="ebl:PaymentTransactionStatusCodeType" minOccurs="0" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="TransactionSearchResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element ref="ebl:PaymentTransactions" minOccurs="0" maxOccurs="unbounded"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="MassPayRequest" type="ns:MassPayRequestType"/>
+      <xs:element name="MassPayResponse" type="ns:MassPayResponseType"/>
+      <xs:element name="MassPayReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:MassPayRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="MassPayRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="EmailSubject" type="xs:string" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="MassPayItem" type="ns:MassPayRequestItemType" minOccurs="1" maxOccurs="250"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="MassPayResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+        </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="MassPayRequestItemType">
+        <xs:annotation>
+          <xs:documentation>
+          MassPayRequestItemType - Type declaration to be used by other schemas.
+          Request data from the mass pay request 
+        </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+          <xs:element name="ReceiverEmail" type="ebl:EmailAddressType" minOccurs="1" maxOccurs="1"/>
+          <xs:element name="Amount" type="cc:BasicAmountType" minOccurs="1" maxOccurs="1"/>
+          <xs:element name="UniqueId" type="xs:string" minOccurs="0" maxOccurs="1"/>
+          <xs:element name="Note" type="xs:string" minOccurs="0" maxOccurs="1"/>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:element name="BAUpdateRequest" type="ns:BAUpdateRequestType"/>
+      <xs:element name="BAUpdateResponse" type="ns:BAUpdateResponseType"/>
+      <xs:element name="BillAgreementUpdateReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:BAUpdateRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="BAUpdateRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="MpID" type="ebl:MerchantPullIDType" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="Custom" type="xs:string" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="Desc" type="xs:string" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="MpStatus" type="ebl:MerchantPullStatusCodeType" minOccurs="0" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="BAUpdateResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element ref="ebl:BAUpdateResponseDetails"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="AddressVerifyRequest" type="ns:AddressVerifyRequestType"/>
+      <xs:element name="AddressVerifyResponse" type="ns:AddressVerifyResponseType"/>
+      <xs:element name="AddressVerifyReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:AddressVerifyRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="AddressVerifyRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="Email" type="ebl:EmailAddressType" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="Street" type="xs:string" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="Zip" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="AddressVerifyResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element name="ConfirmationCode" type="ebl:AddressStatusCodeType" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="StreetMatch" type="ebl:MatchStatusCodeType" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="ZipMatch" type="ebl:MatchStatusCodeType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="CountryCode" type="ebl:CountryCodeType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="PayPalToken" type="xs:string" minOccurs="0" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="SetExpressCheckoutRequest" type="ns:SetExpressCheckoutRequestType"/>
+      <xs:element name="SetExpressCheckoutResponse" type="ns:SetExpressCheckoutResponseType"/>
+      <xs:element name="SetExpressCheckoutReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:SetExpressCheckoutRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="SetExpressCheckoutRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element ref="ebl:SetExpressCheckoutRequestDetails" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="SetExpressCheckoutResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element name="Token" type="ebl:ExpressCheckoutTokenType" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="GetExpressCheckoutDetailsRequest" type="ns:GetExpressCheckoutDetailsRequestType"/>
+      <xs:element name="GetExpressCheckoutDetailsResponse" type="ns:GetExpressCheckoutDetailsResponseType"/>
+      <xs:element name="GetExpressCheckoutDetailsReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:GetExpressCheckoutDetailsRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="GetExpressCheckoutDetailsRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="Token" type="ebl:ExpressCheckoutTokenType" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="GetExpressCheckoutDetailsResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element ref="ebl:GetExpressCheckoutDetailsResponseDetails" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="DoExpressCheckoutPaymentRequest" type="ns:DoExpressCheckoutPaymentRequestType"/>
+      <xs:element name="DoExpressCheckoutPaymentResponse" type="ns:DoExpressCheckoutPaymentResponseType"/>
+      <xs:element name="DoExpressCheckoutPaymentReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:DoExpressCheckoutPaymentRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="DoExpressCheckoutPaymentRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element ref="ebl:DoExpressCheckoutPaymentRequestDetails" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="DoExpressCheckoutPaymentResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element ref="ebl:DoExpressCheckoutPaymentResponseDetails" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="DoDirectPaymentRequest" type="ns:DoDirectPaymentRequestType"/>
+      <xs:element name="DoDirectPaymentResponse" type="ns:DoDirectPaymentResponseType"/>
+      <xs:element name="DoDirectPaymentReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:DoDirectPaymentRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="DoDirectPaymentRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element ref="ebl:DoDirectPaymentRequestDetails" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="DoDirectPaymentResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element name="Amount" type="cc:BasicAmountType" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="AVSCode" type="xs:string" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="CVV2Code" type="xs:string" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="TransactionID" type="ebl:TransactionId" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="DoCaptureRequest" type="ns:DoCaptureRequestType"/>
+      <xs:element name="DoCaptureResponse" type="ns:DoCaptureResponseType"/>
+      <xs:element name="DoCaptureReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:DoCaptureRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="DoCaptureRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="AuthorizationID" type="ebl:AuthorizationId" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="Amount" type="cc:BasicAmountType" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="CompleteType" type="ebl:CompleteCodeType" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="Note" type="xs:string" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="InvoiceID" type="xs:string" minOccurs="0" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="DoCaptureResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element ref="ebl:DoCaptureResponseDetails" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="DoReauthorizationRequest" type="ns:DoReauthorizationRequestType"/>
+      <xs:element name="DoReauthorizationResponse" type="ns:DoReauthorizationResponseType"/>
+      <xs:element name="DoReauthorizationReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:DoReauthorizationRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="DoReauthorizationRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="AuthorizationID" type="xs:string" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="Amount" type="cc:BasicAmountType" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="DoReauthorizationResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element name="AuthorizationID" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="DoVoidRequest" type="ns:DoVoidRequestType"/>
+      <xs:element name="DoVoidResponse" type="ns:DoVoidResponseType"/>
+      <xs:element name="DoVoidReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:DoVoidRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="DoVoidRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="AuthorizationID" type="xs:string" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="Note" type="xs:string" minOccurs="0" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="DoVoidResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element name="AuthorizationID" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:element name="DoAuthorizationRequest" type="ns:DoAuthorizationRequestType"/>
+      <xs:element name="DoAuthorizationResponse" type="ns:DoAuthorizationResponseType"/>
+      <xs:element name="DoAuthorizationReq">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns:DoAuthorizationRequest"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:complexType name="DoAuthorizationRequestType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractRequestType">
+            <xs:sequence>
+              <xs:element name="TransactionID" type="xs:string" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="TransactionEntity" type="ebl:TransactionEntityType" minOccurs="0" maxOccurs="1"/>
+              <xs:element name="Amount" type="cc:BasicAmountType" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+      <xs:complexType name="DoAuthorizationResponseType">
+        <xs:complexContent>
+          <xs:extension base="ebl:AbstractResponseType">
+            <xs:sequence>
+              <xs:element name="TransactionID" type="xs:string" minOccurs="1" maxOccurs="1"/>
+              <xs:element name="Amount" type="cc:BasicAmountType" minOccurs="1" maxOccurs="1"/>
+            </xs:sequence>
+          </xs:extension>
+        </xs:complexContent>
+      </xs:complexType>
+    </schema>
+  </wsdl:types>
+  <wsdl:message name="RequesterCredentials">
+    <wsdl:part name="RequesterCredentials" element="ns:RequesterCredentials"/>
+  </wsdl:message>
+  <wsdl:message name="RefundTransactionRequest">
+    <wsdl:part name="RefundTransactionRequest" element="ns:RefundTransactionReq"/>
+  </wsdl:message>
+  <wsdl:message name="RefundTransactionResponse">
+    <wsdl:part name="RefundTransactionResponse" element="ns:RefundTransactionResponse"/>
+  </wsdl:message>
+  <wsdl:message name="GetTransactionDetailsRequest">
+    <wsdl:part name="GetTransactionDetailsRequest" element="ns:GetTransactionDetailsReq"/>
+  </wsdl:message>
+  <wsdl:message name="GetTransactionDetailsResponse">
+    <wsdl:part name="GetTransactionDetailsResponse" element="ns:GetTransactionDetailsResponse"/>
+  </wsdl:message>
+  <wsdl:message name="BillUserRequest">
+    <wsdl:part name="BillUserRequest" element="ns:BillUserReq"/>
+  </wsdl:message>
+  <wsdl:message name="BillUserResponse">
+    <wsdl:part name="BillUserResponse" element="ns:BillUserResponse"/>
+  </wsdl:message>
+  <wsdl:message name="TransactionSearchRequest">
+    <wsdl:part name="TransactionSearchRequest" element="ns:TransactionSearchReq"/>
+  </wsdl:message>
+  <wsdl:message name="TransactionSearchResponse">
+    <wsdl:part name="TransactionSearchResponse" element="ns:TransactionSearchResponse"/>
+  </wsdl:message>
+  <wsdl:message name="MassPayRequest">
+    <wsdl:part name="MassPayRequest" element="ns:MassPayReq"/>
+  </wsdl:message>
+  <wsdl:message name="MassPayResponse">
+    <wsdl:part name="MassPayResponse" element="ns:MassPayResponse"/>
+  </wsdl:message>
+  <wsdl:message name="BillAgreementUpdateRequest">
+    <wsdl:part name="BillAgreementUpdateRequest" element="ns:BillAgreementUpdateReq"/>
+  </wsdl:message>
+  <wsdl:message name="BAUpdateResponse">
+    <wsdl:part name="body" element="ns:BAUpdateResponse"/>
+  </wsdl:message>
+  <wsdl:message name="AddressVerifyRequest">
+    <wsdl:part name="AddressVerifyRequest" element="ns:AddressVerifyReq"/>
+  </wsdl:message>
+  <wsdl:message name="AddressVerifyResponse">
+    <wsdl:part name="AddressVerifyResponse" element="ns:AddressVerifyResponse"/>
+  </wsdl:message>
+  <wsdl:message name="DoExpressCheckoutPaymentRequest">
+    <wsdl:part name="DoExpressCheckoutPaymentRequest" element="ns:DoExpressCheckoutPaymentReq"/>
+  </wsdl:message>
+  <wsdl:message name="DoExpressCheckoutPaymentResponse">
+    <wsdl:part name="DoExpressCheckoutPaymentResponse" element="ns:DoExpressCheckoutPaymentResponse"/>
+  </wsdl:message>
+  <wsdl:message name="SetExpressCheckoutRequest">
+    <wsdl:part name="SetExpressCheckoutRequest" element="ns:SetExpressCheckoutReq"/>
+  </wsdl:message>
+  <wsdl:message name="SetExpressCheckoutResponse">
+    <wsdl:part name="SetExpressCheckoutResponse" element="ns:SetExpressCheckoutResponse"/>
+  </wsdl:message>
+  <wsdl:message name="GetExpressCheckoutDetailsRequest">
+    <wsdl:part name="GetExpressCheckoutDetailsRequest" element="ns:GetExpressCheckoutDetailsReq"/>
+  </wsdl:message>
+  <wsdl:message name="GetExpressCheckoutDetailsResponse">
+    <wsdl:part name="GetExpressCheckoutDetailsResponse" element="ns:GetExpressCheckoutDetailsResponse"/>
+  </wsdl:message> 
+  <wsdl:message name="DoDirectPaymentRequest">
+    <wsdl:part name="DoDirectPaymentRequest" element="ns:DoDirectPaymentReq"/>
+  </wsdl:message>
+  <wsdl:message name="DoDirectPaymentResponse">
+    <wsdl:part name="DoDirectPaymentResponse" element="ns:DoDirectPaymentResponse"/>
+  </wsdl:message>
+  <wsdl:message name="DoCaptureRequest">
+    <wsdl:part name="DoCaptureRequest" element="ns:DoCaptureReq"/>
+  </wsdl:message>
+  <wsdl:message name="DoCaptureResponse">
+    <wsdl:part name="DoCaptureResponse" element="ns:DoCaptureResponse"/>
+  </wsdl:message>
+  <wsdl:message name="DoReauthorizationRequest">
+    <wsdl:part name="DoReauthorizationRequest" element="ns:DoReauthorizationReq"/>
+  </wsdl:message>
+  <wsdl:message name="DoReauthorizationResponse">
+    <wsdl:part name="DoReauthorizationResponse" element="ns:DoReauthorizationResponse"/>
+  </wsdl:message>
+  <wsdl:message name="DoVoidRequest">
+    <wsdl:part name="DoVoidRequest" element="ns:DoVoidReq"/>
+  </wsdl:message>
+  <wsdl:message name="DoVoidResponse">
+    <wsdl:part name="DoVoidResponse" element="ns:DoVoidResponse"/>
+  </wsdl:message>
+  <wsdl:message name="DoAuthorizationRequest">
+    <wsdl:part name="DoAuthorizationRequest" element="ns:DoAuthorizationReq"/>
+  </wsdl:message>
+  <wsdl:message name="DoAuthorizationResponse">
+    <wsdl:part name="DoAuthorizationResponse" element="ns:DoAuthorizationResponse"/>
+  </wsdl:message>
+  <wsdl:portType name="PayPalAPIInterface">
+    <wsdl:operation name="RefundTransaction">
+      <wsdl:input message="ns:RefundTransactionRequest"/>
+      <wsdl:output message="ns:RefundTransactionResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="GetTransactionDetails">
+      <wsdl:input message="ns:GetTransactionDetailsRequest"/>
+      <wsdl:output message="ns:GetTransactionDetailsResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="BillUser">
+      <wsdl:input message="ns:BillUserRequest"/>
+      <wsdl:output message="ns:BillUserResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="TransactionSearch">
+      <wsdl:input message="ns:TransactionSearchRequest"/>
+      <wsdl:output message="ns:TransactionSearchResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="MassPay">
+      <wsdl:input message="ns:MassPayRequest"/>
+      <wsdl:output message="ns:MassPayResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="BillAgreementUpdate">
+      <wsdl:input message="ns:BillAgreementUpdateRequest"/>
+      <wsdl:output message="ns:BAUpdateResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="AddressVerify">
+      <wsdl:input message="ns:AddressVerifyRequest"/>
+      <wsdl:output message="ns:AddressVerifyResponse"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:portType name="PayPalAPIAAInterface">
+    <wsdl:operation name="DoExpressCheckoutPayment">
+      <wsdl:input message="ns:DoExpressCheckoutPaymentRequest"/>
+      <wsdl:output message="ns:DoExpressCheckoutPaymentResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="SetExpressCheckout">
+      <wsdl:input message="ns:SetExpressCheckoutRequest"/>
+      <wsdl:output message="ns:SetExpressCheckoutResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="GetExpressCheckoutDetails">
+      <wsdl:input message="ns:GetExpressCheckoutDetailsRequest"/>
+      <wsdl:output message="ns:GetExpressCheckoutDetailsResponse"/>
+    </wsdl:operation>
+      <wsdl:operation name="DoDirectPayment">
+      <wsdl:input message="ns:DoDirectPaymentRequest"/>
+      <wsdl:output message="ns:DoDirectPaymentResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="DoCapture">
+      <wsdl:input message="ns:DoCaptureRequest"/>
+      <wsdl:output message="ns:DoCaptureResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="DoReauthorization">
+      <wsdl:input message="ns:DoReauthorizationRequest"/>
+      <wsdl:output message="ns:DoReauthorizationResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="DoVoid">
+      <wsdl:input message="ns:DoVoidRequest"/>
+      <wsdl:output message="ns:DoVoidResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="DoAuthorization">
+      <wsdl:input message="ns:DoAuthorizationRequest"/>
+      <wsdl:output message="ns:DoAuthorizationResponse"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="PayPalAPISoapBinding" type="ns:PayPalAPIInterface">
+    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="RefundTransaction">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="GetTransactionDetails">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="BillUser">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="TransactionSearch">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="MassPay">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="BillAgreementUpdate">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="AddressVerify">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:binding name="PayPalAPIAASoapBinding" type="ns:PayPalAPIAAInterface">
+    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="DoExpressCheckoutPayment">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="SetExpressCheckout">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="GetExpressCheckoutDetails">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="DoDirectPayment">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="DoCapture">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="DoReauthorization">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="DoVoid">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>   
+    <wsdl:operation name="DoAuthorization">
+      <wsdlsoap:operation/>
+      <wsdl:input>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <wsdlsoap:header message="ns:RequesterCredentials" part="RequesterCredentials" use="literal"/>
+        <wsdlsoap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="PayPalAPIInterfaceService">
+    <wsdl:port name="PayPalAPI" binding="ns:PayPalAPISoapBinding">
+      <wsdlsoap:address location="https://api.sandbox.paypal.com/2.0/"/>
+    </wsdl:port>
+    <wsdl:port name="PayPalAPIAA" binding="ns:PayPalAPIAASoapBinding">
+      <wsdlsoap:address location="https://api-aa.sandbox.paypal.com/2.0/"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Added: trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/eBLBaseComponents.xsd
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/eBLBaseComponents.xsd	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/eBLBaseComponents.xsd	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,6057 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:ns="urn:ebay:apis:eBLBaseComponents" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ebay:apis:eBLBaseComponents" elementFormDefault="qualified" attributeFormDefault="unqualified">
+  <import namespace="urn:ebay:apis:CoreComponentTypes" schemaLocation="CoreComponentTypes.xsd"/>
+<!--  
+
+##### from file AccountStateCodeList.xsd #####
+
+-->
+  <simpleType name="AccountStateCodeType">
+    <annotation>
+      <documentation>
+           AccountStateCodeType - Type declaration to be used by other schema.
+           These are the possible codes to describe the state of an account of an 
+           eBay user.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Active">
+        <annotation>
+          <documentation>
+                Amex          
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Pending">
+        <annotation>
+          <documentation>
+               Visa
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Inactive">
+        <annotation>
+          <documentation>
+              Mastercard
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file AckCodeList.xsd #####
+
+-->
+  <simpleType name="AckCodeType">
+    <annotation>
+      <documentation>
+         AckCodeType - Type declaration to be used by other schema.
+         This code identifies the acknowledgement code types that 
+         could be used to communicate the status of processing a 
+         (request) message to an application. This code would be used 
+         as part of a response message that contains an application 
+         level acknowledgement element.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Success">
+        <annotation>
+          <documentation>
+             Request processing succeeded.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Failure">
+        <annotation>
+          <documentation> 
+             Request processing failed.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Warning">
+        <annotation>
+          <documentation>
+               Request processing completed with warning information
+               being included in the response message.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="SuccessWithWarning">
+        <annotation>
+          <documentation>
+               Request processing completed successful with some
+               with some warning information that could be useful for
+               the requesting application to process and/or record.
+           </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="FailureWithWarning">
+        <annotation>
+          <documentation>
+               Request processing failed with some error and warnining
+               information that requesting application should process to
+               determine cause(s) of failure.
+           </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file AddressOwnerCodeList.xsd #####
+
+-->
+  <simpleType name="AddressOwnerCodeType">
+    <annotation>
+      <documentation>
+         AddressOwnerCodeType - Type declaration to be used by other schema.
+         This code identifies the AddressOwner code types which indicates
+         who owns the user'a address.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="PayPal">
+        <annotation>
+          <documentation>
+             PayPal owns address.
+              </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="eBay">
+        <annotation>
+          <documentation> 
+             eBay owns address.                   
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file AuctionTypeCodeList.xsd #####
+
+-->
+  <simpleType name="AuctionTypeCodeType">
+    <annotation>
+      <documentation>
+           AuctionTypeCodeType - Type declaration to be used 
+           by other schema's. This includes codes indicating the
+           type of auction for the listed item.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Unknown">
+        <annotation>
+          <documentation>
+                Unknown auction type
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Chinese">
+        <annotation>
+          <documentation>
+               Chinese auction
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Dutch">
+        <annotation>
+          <documentation>
+               Dutch auction
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Live">
+        <annotation>
+          <documentation>
+               Live Auctions-type auction           
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Ad type">
+        <annotation>
+          <documentation>
+               Ad type auction
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Stores Fixed-price">
+        <annotation>
+          <documentation>
+               Stores Fixed-price auction (US only)
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Personal Offer">
+        <annotation>
+          <documentation>
+               Personal Offer auction 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Fixed Price Item">
+        <annotation>
+          <documentation>
+               Fixed Price item ("BIN only").
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file BalanceCodeList.xsd #####
+
+-->
+  <simpleType name="BalanceCodeType">
+    <annotation>
+      <documentation>
+         BalanceCodeType - Type declaration to be used by other schema.
+         This code identifies the types of balances in an account, e.g., a PayPal 
+         account.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Other">
+        <annotation>
+          <documentation>Custom Code</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file BuyerPaymentMethodCodeList.xsd #####
+
+-->
+  <simpleType name="BuyerPaymentMethodCodeType">
+    <annotation>
+      <documentation>
+           BuyerPaymentMethodCodeType - Type declaration to be used 
+           by other schema. The includes the codes for payment methods 
+           used by buyers to pay sellers.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None">
+        <annotation>
+          <documentation>
+                No payment method specified
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="MOCC">
+        <annotation>
+          <documentation>
+              Money order/cashiers check
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="AmEx">
+        <annotation>
+          <documentation>
+              American Express
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="PaymentSeeDescription">
+        <annotation>
+          <documentation>
+              Payment See Description
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CCAccepted">
+        <annotation>
+          <documentation>
+              American Express
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="PersonalCheck">
+        <annotation>
+          <documentation>
+              Personal check
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="COD">
+        <annotation>
+          <documentation>
+               COD
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="VisaMC">
+        <annotation>
+          <documentation>
+              Visa/Mastercard
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Other">
+        <annotation>
+          <documentation>
+              Other forms of payment.
+              Some custom method is accepted by seller 
+              as payment method in the transaction. For 
+              Motors vehicle items, this field refers to the 
+              Deposit payment method.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="PayPal">
+        <annotation>
+          <documentation>
+              PayPal
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Discover">
+        <annotation>
+          <documentation>
+              Discover
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CashOnPickup">
+        <annotation>
+          <documentation>
+                Payment on delivery acceptable payment term. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="MoneyXferAccepted">
+        <annotation>
+          <documentation>
+                Direct transfer of money acceptable payment term. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="MoneyXferAcceptedinCheckout">
+        <annotation>
+          <documentation>
+                If the seller has bank account information on file, 
+                and MoneyXferAcceptedinCheckout = true, then 
+                the bank account information will be displayed in 
+                Checkout. Applicable to German site only.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="OtherOnlinePayments">
+        <annotation>
+          <documentation>
+                Online Escrow paid for by seller. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file BuyerProtectionCodeList.xsd #####
+
+-->
+  <simpleType name="BuyerProtectionCodeType">
+    <annotation>
+      <documentation>
+           BuyerProtectionCodeType - Type declaration to be used by other schema.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="ItemIneligible">
+        <annotation>
+          <documentation>
+                Item is ineligible (e.g., category not applicable).
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ItemEligible">
+        <annotation>
+          <documentation>
+                 Item is eligible per standard criteria. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ItemMarkedIneligible">
+        <annotation>
+          <documentation>
+               Item marked ineligible per special criteria (e.g., seller's account closed).
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ItemMarkedEligible">
+        <annotation>
+          <documentation>
+              Item marked eligible per other criteria.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file CheckoutStatusCodeList.xsd #####
+
+-->
+  <simpleType name="CheckoutStatusCodeType">
+    <annotation>
+      <documentation>
+           CheckoutStatusCodeType - Type declaration to be used by other schema.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="CheckoutComplete">
+        <annotation>
+          <documentation>
+                Checkout complete.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CheckoutIncomplete">
+        <annotation>
+          <documentation>
+                Checkout incomplete. No details specified.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="BuyerRequestsTotal">
+        <annotation>
+          <documentation>
+               Buyer requests total.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="SellerResponded">
+        <annotation>
+          <documentation>
+              Seller responded to buyer's request. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file CountryCodeList.xsd #####
+
+-->
+  <simpleType name="CountryCodeType">
+    <annotation>
+      <documentation>
+        CountryCodeType - Type declaration to be used by other schema.
+        This code list module defines the enumerated types
+         of standard 2-letter ISO 3166 country codes. This codelist
+         contains some additional country code not defined in
+         the ISO 3166 country code set. 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="AF"/>
+      <enumeration value="AL"/>
+      <enumeration value="DZ"/>
+      <enumeration value="AS"/>
+      <enumeration value="AD"/>
+      <enumeration value="AO"/>
+      <enumeration value="AI"/>
+      <enumeration value="AQ"/>
+      <enumeration value="AG"/>
+      <enumeration value="AR"/>
+      <enumeration value="AM"/>
+      <enumeration value="AW"/>
+      <enumeration value="AU"/>
+      <enumeration value="AT"/>
+      <enumeration value="AZ"/>
+      <enumeration value="BS"/>
+      <enumeration value="BH"/>
+      <enumeration value="BD"/>
+      <enumeration value="BB"/>
+      <enumeration value="BY"/>
+      <enumeration value="BE"/>
+      <enumeration value="BZ"/>
+      <enumeration value="BJ"/>
+      <enumeration value="BM"/>
+      <enumeration value="BT"/>
+      <enumeration value="BO"/>
+      <enumeration value="BA"/>
+      <enumeration value="BW"/>
+      <enumeration value="BV"/>
+      <enumeration value="BR"/>
+      <enumeration value="IO"/>
+      <enumeration value="BN"/>
+      <enumeration value="BG"/>
+      <enumeration value="BF"/>
+      <enumeration value="BI"/>
+      <enumeration value="KH"/>
+      <enumeration value="CM"/>
+      <enumeration value="CA"/>
+      <enumeration value="CV"/>
+      <enumeration value="KY"/>
+      <enumeration value="CF"/>
+      <enumeration value="TD"/>
+      <enumeration value="CL"/>
+      <enumeration value="CN"/>
+      <enumeration value="CX"/>
+      <enumeration value="CC"/>
+      <enumeration value="CO"/>
+      <enumeration value="KM"/>
+      <enumeration value="CG"/>
+      <enumeration value="CD"/>
+      <enumeration value="CK"/>
+      <enumeration value="CR"/>
+      <enumeration value="CI"/>
+      <enumeration value="HR"/>
+      <enumeration value="CU"/>
+      <enumeration value="CY"/>
+      <enumeration value="CZ"/>
+      <enumeration value="DK"/>
+      <enumeration value="DJ"/>
+      <enumeration value="DM"/>
+      <enumeration value="DO"/>
+      <enumeration value="TP"/>
+      <enumeration value="EC"/>
+      <enumeration value="EG"/>
+      <enumeration value="SV"/>
+      <enumeration value="GQ"/>
+      <enumeration value="ER"/>
+      <enumeration value="EE"/>
+      <enumeration value="ET"/>
+      <enumeration value="FK"/>
+      <enumeration value="FO"/>
+      <enumeration value="FJ"/>
+      <enumeration value="FI"/>
+      <enumeration value="FR"/>
+      <enumeration value="GF"/>
+      <enumeration value="PF"/>
+      <enumeration value="TF"/>
+      <enumeration value="GA"/>
+      <enumeration value="GM"/>
+      <enumeration value="GE"/>
+      <enumeration value="DE"/>
+      <enumeration value="GH"/>
+      <enumeration value="GI"/>
+      <enumeration value="GR"/>
+      <enumeration value="GL"/>
+      <enumeration value="GD"/>
+      <enumeration value="GP"/>
+      <enumeration value="GU"/>
+      <enumeration value="GT"/>
+      <enumeration value="GN"/>
+      <enumeration value="GW"/>
+      <enumeration value="GY"/>
+      <enumeration value="HT"/>
+      <enumeration value="HM"/>
+      <enumeration value="VA"/>
+      <enumeration value="HN"/>
+      <enumeration value="HK"/>
+      <enumeration value="HU"/>
+      <enumeration value="IS"/>
+      <enumeration value="IN"/>
+      <enumeration value="ID"/>
+      <enumeration value="IR"/>
+      <enumeration value="IQ"/>
+      <enumeration value="IE"/>
+      <enumeration value="IL"/>
+      <enumeration value="IT"/>
+      <enumeration value="JM"/>
+      <enumeration value="JP"/>
+      <enumeration value="JO"/>
+      <enumeration value="KZ"/>
+      <enumeration value="KE"/>
+      <enumeration value="KI"/>
+      <enumeration value="KP"/>
+      <enumeration value="KR"/>
+      <enumeration value="KW"/>
+      <enumeration value="KG"/>
+      <enumeration value="LA"/>
+      <enumeration value="LV"/>
+      <enumeration value="LB"/>
+      <enumeration value="LS"/>
+      <enumeration value="LR"/>
+      <enumeration value="LY"/>
+      <enumeration value="LI"/>
+      <enumeration value="LT"/>
+      <enumeration value="LU"/>
+      <enumeration value="MO"/>
+      <enumeration value="MK"/>
+      <enumeration value="MG"/>
+      <enumeration value="MW"/>
+      <enumeration value="MY"/>
+      <enumeration value="MV"/>
+      <enumeration value="ML"/>
+      <enumeration value="MT"/>
+      <enumeration value="MH"/>
+      <enumeration value="MQ"/>
+      <enumeration value="MR"/>
+      <enumeration value="MU"/>
+      <enumeration value="YT"/>
+      <enumeration value="MX"/>
+      <enumeration value="FM"/>
+      <enumeration value="MD"/>
+      <enumeration value="MC"/>
+      <enumeration value="MN"/>
+      <enumeration value="MS"/>
+      <enumeration value="MA"/>
+      <enumeration value="MZ"/>
+      <enumeration value="MM"/>
+      <enumeration value="NA"/>
+      <enumeration value="NR"/>
+      <enumeration value="NP"/>
+      <enumeration value="NL"/>
+      <enumeration value="AN"/>
+      <enumeration value="NC"/>
+      <enumeration value="NZ"/>
+      <enumeration value="NI"/>
+      <enumeration value="NE"/>
+      <enumeration value="NG"/>
+      <enumeration value="NU"/>
+      <enumeration value="NF"/>
+      <enumeration value="MP"/>
+      <enumeration value="NO"/>
+      <enumeration value="OM"/>
+      <enumeration value="PK"/>
+      <enumeration value="PW"/>
+      <enumeration value="PS"/>
+      <enumeration value="PA"/>
+      <enumeration value="PG"/>
+      <enumeration value="PY"/>
+      <enumeration value="PE"/>
+      <enumeration value="PH"/>
+      <enumeration value="PN"/>
+      <enumeration value="PL"/>
+      <enumeration value="PT"/>
+      <enumeration value="PR"/>
+      <enumeration value="QA"/>
+      <enumeration value="RE"/>
+      <enumeration value="RO"/>
+      <enumeration value="RU"/>
+      <enumeration value="RW"/>
+      <enumeration value="SH"/>
+      <enumeration value="KN"/>
+      <enumeration value="LC"/>
+      <enumeration value="PM"/>
+      <enumeration value="VC"/>
+      <enumeration value="WS"/>
+      <enumeration value="SM"/>
+      <enumeration value="ST"/>
+      <enumeration value="SA"/>
+      <enumeration value="SN"/>
+      <enumeration value="SC"/>
+      <enumeration value="SL"/>
+      <enumeration value="SG"/>
+      <enumeration value="SK"/>
+      <enumeration value="SI"/>
+      <enumeration value="SB"/>
+      <enumeration value="SO"/>
+      <enumeration value="ZA"/>
+      <enumeration value="GS"/>
+      <enumeration value="ES"/>
+      <enumeration value="LK"/>
+      <enumeration value="SD"/>
+      <enumeration value="SR"/>
+      <enumeration value="SJ"/>
+      <enumeration value="SZ"/>
+      <enumeration value="SE"/>
+      <enumeration value="CH"/>
+      <enumeration value="SY"/>
+      <enumeration value="TW"/>
+      <enumeration value="TJ"/>
+      <enumeration value="TZ"/>
+      <enumeration value="TH"/>
+      <enumeration value="TG"/>
+      <enumeration value="TK"/>
+      <enumeration value="TO"/>
+      <enumeration value="TT"/>
+      <enumeration value="TN"/>
+      <enumeration value="TR"/>
+      <enumeration value="TM"/>
+      <enumeration value="TC"/>
+      <enumeration value="TV"/>
+      <enumeration value="UG"/>
+      <enumeration value="UA"/>
+      <enumeration value="AE"/>
+      <enumeration value="GB"/>
+      <enumeration value="US"/>
+      <enumeration value="UM"/>
+      <enumeration value="UY"/>
+      <enumeration value="UZ"/>
+      <enumeration value="VU"/>
+      <enumeration value="VE"/>
+      <enumeration value="VN"/>
+      <enumeration value="VG"/>
+      <enumeration value="VI"/>
+      <enumeration value="WF"/>
+      <enumeration value="EH"/>
+      <enumeration value="YE"/>
+      <enumeration value="YU"/>
+      <enumeration value="ZM"/>
+      <enumeration value="ZW"/>
+      <enumeration value="AA">
+        <annotation>
+          <documentation>
+                    NOTE: APO/FPO was defined in eBay list previously 
+                    but they are not defined in ISO 3166. This country 
+                    will remain on eBay country code list for backward 
+                    compatibility.
+                 </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="QM">
+        <annotation>
+          <documentation>
+                    NOTE: Guernsey was defined in eBay list previously 
+                    but they are not defined in ISO 3166. This country 
+                    will remain on eBay country list for backward 
+                    compatibility.
+                 </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="QN">
+        <annotation>
+          <documentation>
+                     NOTE: Jan Mayen was defined in eBay list previously 
+                     but they are not defined in ISO 3166. This country 
+                     will remain on eBay country list for backward 
+                     compatibility.
+                 </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="QO">
+        <annotation>
+          <documentation>
+                     NOTE: Jersey was defined in eBay list previously 
+                     but they are not defined in ISO 3166. This country 
+                     will remain on eBay country list for backward 
+                     compatibility.
+                 </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="QP">
+        <annotation>
+          <documentation>
+                     NOTE: Tahiti was defined in eBay list previously 
+                     but they are not defined in ISO 3166. This country 
+                     will remain on eBay country list for backward 
+                     compatibility.
+                 </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file CurrencyCodeList.xsd #####
+
+-->
+  <simpleType name="CurrencyCodeType">
+    <annotation>
+      <documentation>
+          This code list module defines the enumerated types
+          of standard 3-letter ISO 4217 currency codes. 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="AFA"/>
+      <enumeration value="ALL"/>
+      <enumeration value="DZD"/>
+      <enumeration value="ADP"/>
+      <enumeration value="AOA"/>
+      <enumeration value="ARS"/>
+      <enumeration value="AMD"/>
+      <enumeration value="AWG"/>
+      <enumeration value="AZM"/>
+      <enumeration value="BSD"/>
+      <enumeration value="BHD"/>
+      <enumeration value="BDT"/>
+      <enumeration value="BBD"/>
+      <enumeration value="BYR"/>
+      <enumeration value="BZD"/>
+      <enumeration value="BMD"/>
+      <enumeration value="BTN"/>
+      <enumeration value="INR"/>
+      <enumeration value="BOV"/>
+      <enumeration value="BOB"/>
+      <enumeration value="BAM"/>
+      <enumeration value="BWP"/>
+      <enumeration value="BRL"/>
+      <enumeration value="BND"/>
+      <enumeration value="BGL"/>
+      <enumeration value="BGN"/>
+      <enumeration value="BIF"/>
+      <enumeration value="KHR"/>
+      <enumeration value="CAD"/>
+      <enumeration value="CVE"/>
+      <enumeration value="KYD"/>
+      <enumeration value="XAF"/>
+      <enumeration value="CLF"/>
+      <enumeration value="CLP"/>
+      <enumeration value="CNY"/>
+      <enumeration value="COP"/>
+      <enumeration value="KMF"/>
+      <enumeration value="CDF"/>
+      <enumeration value="CRC"/>
+      <enumeration value="HRK"/>
+      <enumeration value="CUP"/>
+      <enumeration value="CYP"/>
+      <enumeration value="CZK"/>
+      <enumeration value="DKK"/>
+      <enumeration value="DJF"/>
+      <enumeration value="DOP"/>
+      <enumeration value="TPE"/>
+      <enumeration value="ECV"/>
+      <enumeration value="ECS"/>
+      <enumeration value="EGP"/>
+      <enumeration value="SVC"/>
+      <enumeration value="ERN"/>
+      <enumeration value="EEK"/>
+      <enumeration value="ETB"/>
+      <enumeration value="FKP"/>
+      <enumeration value="FJD"/>
+      <enumeration value="GMD"/>
+      <enumeration value="GEL"/>
+      <enumeration value="GHC"/>
+      <enumeration value="GIP"/>
+      <enumeration value="GTQ"/>
+      <enumeration value="GNF"/>
+      <enumeration value="GWP"/>
+      <enumeration value="GYD"/>
+      <enumeration value="HTG"/>
+      <enumeration value="HNL"/>
+      <enumeration value="HKD"/>
+      <enumeration value="HUF"/>
+      <enumeration value="ISK"/>
+      <enumeration value="IDR"/>
+      <enumeration value="IRR"/>
+      <enumeration value="IQD"/>
+      <enumeration value="ILS"/>
+      <enumeration value="JMD"/>
+      <enumeration value="JPY"/>
+      <enumeration value="JOD"/>
+      <enumeration value="KZT"/>
+      <enumeration value="KES"/>
+      <enumeration value="AUD"/>
+      <enumeration value="KPW"/>
+      <enumeration value="KRW"/>
+      <enumeration value="KWD"/>
+      <enumeration value="KGS"/>
+      <enumeration value="LAK"/>
+      <enumeration value="LVL"/>
+      <enumeration value="LBP"/>
+      <enumeration value="LSL"/>
+      <enumeration value="LRD"/>
+      <enumeration value="LYD"/>
+      <enumeration value="CHF"/>
+      <enumeration value="LTL"/>
+      <enumeration value="MOP"/>
+      <enumeration value="MKD"/>
+      <enumeration value="MGF"/>
+      <enumeration value="MWK"/>
+      <enumeration value="MYR"/>
+      <enumeration value="MVR"/>
+      <enumeration value="MTL"/>
+      <enumeration value="EUR"/>
+      <enumeration value="MRO"/>
+      <enumeration value="MUR"/>
+      <enumeration value="MXN"/>
+      <enumeration value="MXV"/>
+      <enumeration value="MDL"/>
+      <enumeration value="MNT"/>
+      <enumeration value="XCD"/>
+      <enumeration value="MZM"/>
+      <enumeration value="MMK"/>
+      <enumeration value="ZAR"/>
+      <enumeration value="NAD"/>
+      <enumeration value="NPR"/>
+      <enumeration value="ANG"/>
+      <enumeration value="XPF"/>
+      <enumeration value="NZD"/>
+      <enumeration value="NIO"/>
+      <enumeration value="NGN"/>
+      <enumeration value="NOK"/>
+      <enumeration value="OMR"/>
+      <enumeration value="PKR"/>
+      <enumeration value="PAB"/>
+      <enumeration value="PGK"/>
+      <enumeration value="PYG"/>
+      <enumeration value="PEN"/>
+      <enumeration value="PHP"/>
+      <enumeration value="PLN"/>
+      <enumeration value="USD"/>
+      <enumeration value="QAR"/>
+      <enumeration value="ROL"/>
+      <enumeration value="RUB"/>
+      <enumeration value="RUR"/>
+      <enumeration value="RWF"/>
+      <enumeration value="SHP"/>
+      <enumeration value="WST"/>
+      <enumeration value="STD"/>
+      <enumeration value="SAR"/>
+      <enumeration value="SCR"/>
+      <enumeration value="SLL"/>
+      <enumeration value="SGD"/>
+      <enumeration value="SKK"/>
+      <enumeration value="SIT"/>
+      <enumeration value="SBD"/>
+      <enumeration value="SOS"/>
+      <enumeration value="LKR"/>
+      <enumeration value="SDD"/>
+      <enumeration value="SRG"/>
+      <enumeration value="SZL"/>
+      <enumeration value="SEK"/>
+      <enumeration value="SYP"/>
+      <enumeration value="TWD"/>
+      <enumeration value="TJS"/>
+      <enumeration value="TZS"/>
+      <enumeration value="THB"/>
+      <enumeration value="XOF"/>
+      <enumeration value="TOP"/>
+      <enumeration value="TTD"/>
+      <enumeration value="TND"/>
+      <enumeration value="TRL"/>
+      <enumeration value="TMM"/>
+      <enumeration value="UGX"/>
+      <enumeration value="UAH"/>
+      <enumeration value="AED"/>
+      <enumeration value="GBP"/>
+      <enumeration value="USS"/>
+      <enumeration value="USN"/>
+      <enumeration value="UYU"/>
+      <enumeration value="UZS"/>
+      <enumeration value="VUV"/>
+      <enumeration value="VEB"/>
+      <enumeration value="VND"/>
+      <enumeration value="MAD"/>
+      <enumeration value="YER"/>
+      <enumeration value="YUM"/>
+      <enumeration value="ZMK"/>
+      <enumeration value="ZWD"/>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file DepositTypeCodeList.xsd #####
+
+-->
+  <simpleType name="DepositTypeCodeType">
+    <annotation>
+      <documentation>
+         DepositTypeCodeType - Type declaration to be used by other schema's.
+         This code identifies the DepositType codes used to specify deposit
+         types for Motors items. If the ietm listed is not a Motors item, then always
+         return DepositType value to be "None".
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None">
+        <annotation>
+          <documentation>None</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="OtherMethod">
+        <annotation>
+          <documentation>
+             Other Method
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="FastDeposit">
+        <annotation>
+          <documentation> 
+             Fast Deposit.                                      </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file DetailLevelCodeList.xsd #####
+
+-->
+  <simpleType name="DetailLevelCodeType">
+    <annotation>
+      <documentation>
+           DetailLevelCodeType - Type declaration to be used by other schema.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="ReturnAll">
+        <annotation>
+          <documentation>
+                Return in response message all detail levels.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ItemReturnDescription">
+        <annotation>
+          <documentation>
+                Return item description. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ItemReturnAttributes">
+        <annotation>
+          <documentation>
+              Return attributes as part of the item.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file eBLBaseComponents-version0.94.xsd #####
+
+-->
+  <annotation>
+    <documentation>
+      This file defines re-useable base and aggregate components of the 
+      eBay Business Lanaguage (eBL) that would be used to compose 
+      message payloads for eBay APIs.
+    </documentation>
+  </annotation>
+  <simpleType name="ItemIDType">
+    <annotation>
+      <documentation>
+          Represents the unique identifier for an item. To be used to specify the
+          elements that represents an ItemID.
+      </documentation>
+    </annotation>
+    <restriction base="xs:string"/>
+  </simpleType>
+  <complexType name="AccountEntryType">
+    <sequence>
+      <element ref="ns:Balance">
+        <annotation>
+          <documentation>
+                Balance as of a given entry, can be 0.00.
+             </documentation>
+        </annotation>
+      </element>
+      <element name="Credit" type="cc:AmountType">
+        <annotation>
+          <documentation>
+                Credit Amount for a detail entry, can be 0.00. 
+             </documentation>
+        </annotation>
+      </element>
+      <element name="Date" type="xs:dateTime">
+        <annotation>
+          <documentation>
+                 Date entry was posted, in GMT. 
+             </documentation>
+        </annotation>
+      </element>
+      <element name="Debit" type="cc:AmountType">
+        <annotation>
+          <documentation>
+                 Debit Amount for this detail entry, can be 0.00.      
+             </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:ItemID">
+        <annotation>
+          <documentation>
+                 Item number if transaction is associated with an auction or 0 
+                 if no item is associated with an account entry.      
+             </documentation>
+        </annotation>
+      </element>
+      <element name="Memo" type="xs:string">
+        <annotation>
+          <documentation>
+                 Memo line for an account entry, can be empty string.
+             </documentation>
+        </annotation>
+      </element>
+      <element name="RefNumber" type="xs:int">
+        <annotation>
+          <documentation>
+                 eBay reference number for an account entry.    
+             </documentation>
+        </annotation>
+      </element>
+      <element name="AccountEntryDetailsType" type="xs:int">
+        <annotation>
+          <documentation>
+                 Integer code for account details entry type. This element
+                 element specifies an index to a table of explanations for 
+                 accounting charges. 
+             </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="AdditionalAccountType">
+    <annotation>
+      <documentation>
+            The AdditionalAccount component represents historical data related to 
+            accounts that the user held with a country of residency other than 
+            the current one. eBay users can have one active account at a time. 
+            For users who change their country of residency and modify their 
+            eBay registration to reflect this change, the new country of residence 
+            becomes the currently active account. Any account associated with 
+            a previous country is treated as an additional account. Because the 
+            currency for these additional accounts are different than the active 
+            account, each additional account includes an indicator of the currency 
+            for that account. Users who never change their country of residence 
+            will not have any additional accounts.
+          </documentation>
+    </annotation>
+    <sequence>
+      <element ref="ns:Balance"/>
+      <element ref="ns:Currency"/>
+      <element ref="ns:AccountCode"/>
+    </sequence>
+  </complexType>
+  <complexType name="PromotedItemType">
+    <annotation>
+      <documentation>
+        Merchandizing info for an Item. This contains a list of crosssell
+        or upsell items.
+          </documentation>
+    </annotation>
+    <sequence>
+      <element name="ItemID" type="ns:ItemIDType">
+        <annotation>
+          <documentation> 
+            Item ID for the base item. Based on this item other items are 
+            promoted. it is teh only tag that would show up in all calls that use promoted item type. 
+            some are not in soap yet, such as get and ser promotion rules
+                  </documentation>
+        </annotation>
+      </element>
+      <element name="PictureURL" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+                      URL for the picture of the promoted item.           
+                    </documentation>
+        </annotation>
+      </element>
+      <element name="position" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation>
+                      Where to display in the list of items.currentl y even forget and set does not have to be minoccur =0 
+                      but if we ever were to do revise promotion tems, it can be omitted
+                    </documentation>
+        </annotation>
+      </element>
+      <element name="PromotionPrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+            Promotion Price. Price at which the buyer can buy the item now.
+                    </documentation>
+        </annotation>
+      </element>
+      <element name="PromotionPriceType" type="ns:PromotionItemPriceTypeCodeType" minOccurs="0"/>
+      <element name="SelectionType" type="ns:PromotionItemSelectionCodeType" minOccurs="0"/>
+      <element name="Title" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+                      Item Title for the promoted item.           
+                    </documentation>
+        </annotation>
+      </element>
+      <element name="ListingType" type="ns:ListingTypeCodeType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="CrossPromotionsType">
+    <annotation>
+      <documentation>
+        Merchandizing info for an Item. This contains a list of crosssell
+        or upsell items.
+        PrimaryScheme, PromotionMethod,SellerId,ItemId, ShippingDiscount
+        do not have be min occur 0
+          </documentation>
+    </annotation>
+    <sequence>
+      <element name="ItemID" type="ns:ItemIDType">
+        <annotation>
+          <documentation> 
+            Item ID for the base item. Based on this item other items are 
+            promoted.
+                  </documentation>
+        </annotation>
+      </element>
+      <element name="PrimaryScheme" type="ns:PromotionSchemeCodeType"/>
+      <element name="PromotionMethod" type="ns:PromotionMethodCodeType"/>
+      <element name="SellerID" type="xs:string">
+        <annotation>
+          <documentation>
+                      Id of the Seller who is promoting this item.           
+                    </documentation>
+        </annotation>
+      </element>
+      <element name="ShippingDiscount" type="xs:boolean">
+        <annotation>
+          <documentation>
+                      Shipping Discount offered or not by the seller.
+                    </documentation>
+        </annotation>
+      </element>
+      <element name="SellerKey" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+                      Key of the Seller who is promoting this item.           
+                    </documentation>
+        </annotation>
+      </element>
+      <element name="StoreName" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+                      Store Name for the seller.
+                    </documentation>
+        </annotation>
+      </element>
+      <element name="PromotedItem" type="ns:PromotedItemType" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+  <complexType name="AccountSummaryType" mixed="true">
+    <annotation>
+      <documentation>
+                     Includes account summary for the user. 
+             </documentation>
+    </annotation>
+    <choice minOccurs="0" maxOccurs="unbounded">
+      <element name="AccountState" type="ns:AccountStateCodeType" minOccurs="0"/>
+      <element name="AdditionalAccount" type="ns:AdditionalAccountType" minOccurs="0" maxOccurs="unbounded"/>
+      <element name="AdditionalAccountsCount" type="xs:int">
+        <annotation>
+          <documentation>
+                                     Number of additional accounts.
+                            </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:AmountPastDue" minOccurs="0">
+        <annotation>
+          <documentation>
+                                Amount past due, 0.00 if not past due. 
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="BankAccountInfo" type="xs:string">
+        <annotation>
+          <documentation>
+                                First four digits (with remainder Xed-out). This may be an empty 
+                                string depending upon the value of the payment type for the 
+                                user account (e.g, if no debit-card specified).
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="BankModifyDate" type="xs:dateTime">
+        <annotation>
+          <documentation>
+                                Last time/day BankAccountInfo and/or BankRoutingInfo was 
+                                modified, in GMT. This may be an empty string depending 
+                                upon the value of the payment type for the user account 
+                                (e.g, if no debit-card specified).
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="BillingCycleDate" type="xs:dateTime">
+        <annotation>
+          <documentation>
+                                Indicates the billing cycle in which eBay sends a billing 
+                                invoice to the specified user. Possible values:
+                0 = On the last day of the month.
+                15 = On the 15th day of the month. 
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="CCExp" type="xs:dateTime">
+        <annotation>
+          <documentation>
+                                Expiration date for the credit card selected as payment method, 
+                                in GMT. Empty string if no credit card is on file or if account is
+                                inactive -- even if there is a credit card on file.
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="CCInfo" type="xs:string">
+        <annotation>
+          <documentation>
+                                Last four digits of user's credit card selected as payment
+                                type. Empty string if no credit is on file. This may be an empty 
+                                string depending upon the value of the payment type for the 
+                                user account (e.g, if no debit-card specified).
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="CCModifyDate" type="xs:dateTime">
+        <annotation>
+          <documentation>
+                                Last date credit card or credit card expiration date was 
+                                modified, in GMT. This may be an empty string depending 
+                                upon the value of the payment type for the user account 
+                                (e.g, Empty string if no credit card is on file.
+                           </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:CurrentBalance">
+        <annotation>
+          <documentation>
+                                User's current balance. Can be 0.00, positive, or negative. 
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="LastAmountPaid" type="cc:AmountType">
+        <annotation>
+          <documentation>
+                                Amount of last payment posted, 0.00 if no payments posted. 
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="LastInvoiceAmount" type="cc:AmountType">
+        <annotation>
+          <documentation>
+                                Amount of last invoice. 0.00 if account not yet invoiced. 
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="LastInvoiceDate" type="xs:dateTime">
+        <annotation>
+          <documentation>
+                                Date of last invoice sent by eBay to the user, in GMT. 
+                                Empty string if this account has not been invoiced yet. 
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="LastPaymentDate" type="xs:dateTime">
+        <annotation>
+          <documentation>
+                                Date of last payment by specified user to eBay, in GMT. 
+                                Empty string if no payments posted. 
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="PastDue" type="xs:boolean">
+        <annotation>
+          <documentation>
+                                Indicates whether the account has past due amounts 
+                                outstanding. Possible values:
+                true = Account is past due.
+                false = Account is current. 
+                           </documentation>
+        </annotation>
+      </element>
+      <element name="PaymentMethod" type="ns:SellerPaymentMethodCodeType">
+        <annotation>
+          <documentation>
+                               Indicates the method the specified user selected for paying 
+                               eBay. The values for PaymentType vary for each SiteID. 
+                           </documentation>
+        </annotation>
+      </element>
+    </choice>
+  </complexType>
+  <complexType name="BuyerType">
+    <annotation>
+      <documentation>
+        Information about user used by buying applications
+          </documentation>
+    </annotation>
+    <sequence>
+      <element ref="ns:ShippingAddress" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="SellerType">
+    <annotation>
+      <documentation>
+        Information about user used by selling applications
+        there are number of required elements - they will always show up for seller node
+        there is not such a call to do revise seller info. only added minoccur=0 to elements that will not show up in every 
+        type of request/responce
+          </documentation>
+    </annotation>
+    <sequence>
+      <element name="AllowPaymentEdit" type="xs:boolean"/>
+      <element name="BillingCurrency" type="ns:CurrencyCodeType" minOccurs="0"/>
+      <element ref="ns:CheckoutEnabled"/>
+      <element name="CIPBankAccountStored" type="xs:boolean"/>
+      <element name="GoodStanding" type="xs:boolean"/>
+      <element name="LiveAuctionAuthorized" type="xs:boolean"/>
+      <element name="MerchandizingPref" type="ns:MerchandizingPrefCodeType">
+        <annotation>
+          <documentation>
+                          Indicates whether the user has elected to participate 
+                          as a seller in the Merchandising Manager feature. 
+                        </documentation>
+        </annotation>
+      </element>
+      <element name="QualifiesForB2BVAT" type="xs:boolean"/>
+      <element ref="ns:SellerLevel"/>
+      <element ref="ns:SellerPaymentAddress" minOccurs="0"/>
+      <element name="SchedulingInfo" type="ns:SchedulingInfoType" minOccurs="0"/>
+      <element ref="ns:StoreOwner"/>
+      <element name="StoreURL" type="xs:anyURI" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="FeeType">
+    <annotation>
+      <documentation>
+           Definition of an eBay Fee type.
+                   </documentation>
+    </annotation>
+    <sequence>
+      <element name="Name" type="xs:string" minOccurs="0"/>
+      <element name="Fee" type="cc:AmountType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="FeesType">
+    <annotation>
+      <documentation>
+            Following are the current set of eBay fee types
+          AuctionLengthFee
+          BoldFee
+          BuyItNowFee
+          CategoryFeaturedFee
+          FeaturedFee
+          FeaturedGalleryFee
+          FixedPriceDurationFee
+          GalleryFee
+          GiftIconFee
+          HighLightFee
+          InsertionFee
+          ListingDesignerFee
+          ListingFee
+          PhotoDisplayFee
+          PhotoFee
+          ReserveFee
+          SchedulingFee
+          ThirtyDaysAucFee
+        Instances of this type could hold one or more supported types of fee.
+                   </documentation>
+    </annotation>
+    <sequence>
+      <element name="Fee" type="ns:FeeType" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+  <complexType name="ShippingCarrierDetailsType">
+    <sequence>
+      <element name="CarrierShippingFee" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Calculated cost of shipping, based on shipping parameters and 
+                                    selected shipping service. Only returned if ShippingType = 2
+                                    (i.e., calculated shipping rate).
+                              </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:InsuranceFee" minOccurs="0"/>
+      <element ref="ns:InsuranceOption" minOccurs="0"/>
+      <element name="PackagingHandlingCosts" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                  Optional fees a seller might assess for the shipping of the item. 
+                            </documentation>
+        </annotation>
+      </element>
+      <element name="ShippingRateErrorMessage" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                  Describes any error message associated with the attempt 
+                                   to calculate shipping rates. If there was no error, returns 
+                                  "No Error" (without the quotation marks).
+                           </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:ShippingService">
+        <annotation>
+          <documentation> 
+                                is unique identified of shipping carrier, without this element the whole node makes no sence
+                           </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="CalculatedShippingRateType">
+    <sequence>
+      <element name="OriginatingPostalCode" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Potal/zip code from where package will be shipped.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ShippingIrregular" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                  Indicates an item that cannot go through the stamping machine 
+                                  at the shipping service office (a value of True) and requires 
+                                  special or fragile handling. Only returned if ShippingType = 2. 
+                                 </documentation>
+        </annotation>
+      </element>
+      <element name="CarrierDetails" type="ns:ShippingCarrierDetailsType" minOccurs="0" maxOccurs="unbounded">
+        <annotation>
+          <documentation> 
+                                 contains information about shipping fees per each shipping service chosen by the seller
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ShippingPackage" type="ns:ShippingPackageCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                  May need to be moved into details - wait for George! The size of the package to be shipped. Possible values are:
+                None
+                Letter
+                Large envelope
+                USPS flat rate envelope
+              Package/thick envelope
+                USPS large package/oversize 1
+                Very large package/oversize 2
+                UPS Letter
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="WeightMajor" type="cc:MeasureType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                  Shipping weight unit of measure (major). If unit of weight is kilogram 
+                                  (i.e., metric system) this would be the exact weight value in kilogram 
+                                  (i.e., complete decimal number, e.g., 2.23 kg). Only returned if 
+                                  ShippingType is 2. 
+                               </documentation>
+        </annotation>
+      </element>
+      <element name="WeightMinor" type="cc:MeasureType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                  Shipping weight unit of measure (minor). If unit of weight is  in pounds and/or
+                                  ounces, this would be the exact weight value in ounces (i.e., complete 
+                                  decimal number, e.g., 8.2 or 8.0 ounces). Only returned if ShippingType is 2. 
+                               </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="FlatShippingRateType">
+    <sequence>
+      <element name="AdditionalShippingCosts" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                     Any additional shipping costs for the item. 
+                                 </documentation>
+        </annotation>
+      </element>
+      <element name="FlatShippingHandlingCosts" type="cc:AmountType" minOccurs="0"/>
+      <element ref="ns:InsuranceFee" minOccurs="0"/>
+      <element ref="ns:InsuranceOption" minOccurs="0"/>
+      <element ref="ns:ShippingService" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="SalesTaxType">
+    <sequence>
+      <element name="SalesTaxPercent" type="xs:float" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                   Amount of the sales tax to be collected for the transaction. 
+                                   Sales tax is only for US. 
+                             </documentation>
+        </annotation>
+      </element>
+      <element name="SalesTaxState" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Sales tax for the transaction, expressed as a percentage. Should 
+                                    be empty for items listed on international sites (hence, this is 
+                                    US-only element).
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ShippingIncludedInTax" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                   Indicates whether shipping is included in the tax. Applicable if 
+                                   ShippingType = 1 or 2. This element is used for US-only.
+                             </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="ShippingDetailsType">
+    <annotation>
+      <documentation> 
+                       Specifies the shipping payment details.
+                   </documentation>
+    </annotation>
+    <sequence>
+      <element name="AllowPaymentEdit" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                  Indicates whether the buyer edited the payment amount. 
+                            </documentation>
+        </annotation>
+      </element>
+      <element name="CalculatedShippingRate" type="ns:CalculatedShippingRateType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Calculated shipping rate details.  If present, then the calculated shipping rate option was used. 
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ChangePaymentInstructions" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                  Indicates whether the payment instructions are included (e.g., for updating the
+                                  details of a transaction).
+                            </documentation>
+        </annotation>
+      </element>
+      <element name="FlatShippingRate" type="ns:FlatShippingRateType" minOccurs="0" maxOccurs="unbounded">
+        <annotation>
+          <documentation> 
+                                    Flat shipping rate details. If present, then the flat shipping rate option was used. 
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="InsuranceTotal" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Total cost of insurance for the transaction.
+                               </documentation>
+        </annotation>
+      </element>
+      <element name="InsuranceWanted" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Indicates whether buyer selected to have insurance. 
+                               </documentation>
+        </annotation>
+      </element>
+      <element name="PaymentInstructions" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Payment instuctions.   
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="SalesTax" type="ns:SalesTaxType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Sales tax details. Sales tax applicable for only US sites.
+                                    For non-US sites this sub-element should not be used.
+                                 </documentation>
+        </annotation>
+      </element>
+      <element name="SellerPostalCode" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Postal/Zip code from where the seller will ship the item.
+                                 </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="SiteHostedPictureType">
+    <sequence>
+      <element name="PictureURL" type="xs:anyURI" minOccurs="0" maxOccurs="6">
+        <annotation>
+          <documentation> 
+                                    URLs for item picture that are stored/hosted at eBay site.
+                             </documentation>
+        </annotation>
+      </element>
+      <element name="PhotoDisplay" type="ns:PhotoDisplayCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                         Type of display for photos used for PhotoHosting slide show. 
+                         Here are display options:
+                  None = No special Picture Services features.
+                  SlideShow = Slideshow of multiple pictures.
+                  SuperSize = Super-size format picture.
+                  PicturePack = Picture Pack.
+                            Default is 'None'. 
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="GalleryType" type="ns:GalleryTypeCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        This will be either "Featured" or "Gallery".
+                                </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="VendorHostedPictureType">
+    <sequence>
+      <element name="PictureURL" type="xs:anyURI" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    URLs for item picture that are stored/hosted at eBay site.
+                             </documentation>
+        </annotation>
+      </element>
+      <element name="GalleryURL" type="xs:anyURI" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      URL for a picture for the gallery. If the GalleryFeatured 
+                      argument is true, a value must be supplied for either 
+                      the GalleryURL or the PictureURL argument. 
+            In either case:
+              (a) If a URL is provided for only PictureURL, it is used 
+              as the Gallery thumbnail. 
+              (b) If a URL is provided for both GalleryURL and 
+              PictureURL, then the picture indicated in GalleryURL 
+              is used as the thumbnail. 
+            The image used for the Gallery thumbnail (specified 
+            in the GalleryURL or PictureURL argument) must be 
+            in one of the graphics formats JPEG, BMP, TIF, or GIF. 
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="GalleryType" type="ns:GalleryTypeCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        This will be either "Featured" or "Gallery".
+                                </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="ValType">
+    <sequence>
+      <element name="ValueLiteral" type="xs:string"/>
+    </sequence>
+    <attribute name="ValueID" type="xs:string" use="optional"/>
+  </complexType>
+  <complexType name="AttributeType">
+    <annotation>
+      <documentation> 
+          Specific physical attribute of an item.
+                 </documentation>
+    </annotation>
+    <sequence>
+      <element name="Value" type="ns:ValType" maxOccurs="unbounded">
+        <annotation>
+          <documentation>
+           ValueList of the Attribute being described by the AttributeID.
+             </documentation>
+        </annotation>
+      </element>
+    </sequence>
+    <attribute name="AttributeID" type="xs:string">
+      <annotation>
+        <documentation>
+          Constant name of the attribute that identifies a 
+              physical attribute within a set of characteristics 
+              that describe something in a formalised way. 
+             </documentation>
+      </annotation>
+    </attribute>
+  </complexType>
+  <complexType name="AttributeSetType">
+    <annotation>
+      <documentation> 
+      AttributeSet.
+               </documentation>
+    </annotation>
+    <sequence>
+      <element name="Attribute" type="ns:AttributeType" maxOccurs="unbounded"/>
+    </sequence>
+    <attribute name="AttributeSetID" type="xs:string"/>
+  </complexType>
+  <complexType name="ListOfAttributeSetType">
+    <sequence>
+      <element name="AttributeSet" type="ns:AttributeSetType" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+  <complexType name="CategoryType">
+    <annotation>
+      <documentation>
+        Container for data on the primary category of listing.
+             </documentation>
+    </annotation>
+    <sequence>
+      <element name="AutoPayEnabled" type="xs:boolean" minOccurs="0"/>
+      <element name="B2BVATEnabled" type="xs:boolean" minOccurs="0"/>
+      <element name="CatalogEnabled" type="xs:boolean" minOccurs="0"/>
+      <element name="CategoryID" type="xs:string"/>
+      <element name="CategoryLevel" type="xs:int" minOccurs="0"/>
+      <element name="CategoryName" type="xs:string" minOccurs="0"/>
+      <element name="CategoryParentID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+      <element name="CategoryParentName" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+      <element name="CSIDList" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+        <annotation>
+          <documentation>
+            CSIDList is not present if Attributes enabled.
+                 </documentation>
+        </annotation>
+      </element>
+      <element name="Expired" type="xs:boolean" minOccurs="0"/>
+      <element name="IntlAutosFixedCat" type="xs:boolean" minOccurs="0"/>
+      <element name="LeafCategory" type="xs:boolean" minOccurs="0"/>
+      <element name="Virtual" type="xs:boolean" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="StorefrontType">
+    <annotation>
+      <documentation> 
+            Contains the eBay Stores-specific item attributes 
+            department number and store location. StorefrontInfo 
+            is shown for any item that belongs to an eBay Store 
+            owner, regardless of whether it is fixed price or 
+            auction type. Returned as null for international 
+            fixed price items.
+          </documentation>
+    </annotation>
+    <sequence>
+      <element ref="ns:StoreCategoryID">
+        <annotation>
+          <documentation> 
+                  assumed this type is specific to add/get/revise item, then each StorefrontType nust have category id, for store details this node makes no sense to use
+                </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:StoreURL" minOccurs="0">
+        <annotation>
+          <documentation> 
+                  in case or revise item for example - to change store category (department) you do not need to change store URL, so it will notbe in request
+                </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="ListingDesignerType">
+    <annotation>
+      <documentation> 
+          Identifies the Layout and the Theme template 
+            associated with the item. in case of revision - all data can be min occur = 0
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="LayoutID" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+                  Identifies the Layout template associated with the item.
+            </documentation>
+        </annotation>
+      </element>
+      <element name="OptimalPictureSize" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation>
+            A value of true for OptimalPictureSize indicates that the picture 
+            URL will be enlarged to fit description of the item.
+          </documentation>
+        </annotation>
+      </element>
+      <element name="ThemeID" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+                  Identifies the Theme template associated with the item.
+          </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="CharityType">
+    <annotation>
+      <documentation> 
+                       Contains information about a Charity listing.in case of revision - all data can be min occur = 0
+                   </documentation>
+    </annotation>
+    <sequence>
+      <element name="CharityName" type="xs:string" minOccurs="0"/>
+      <element name="CharityNumber" type="xs:int" minOccurs="0"/>
+      <element name="DonationPercent" type="xs:float" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="SellingStatusType">
+    <annotation>
+      <documentation> 
+      Contains the listed items price details which consists of
+      following information: BuyItNowPrice, ConvertedBuyItNowPrice,
+      ConvertedPrice, ConvertedStartPrice, CurrentPrice, MinimumToBid, 
+      ReservePrice, and StartPrice.  need to take in account get seller events when defining minoccurs = 0       
+                </documentation>
+    </annotation>
+    <sequence>
+      <element name="BidCount" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+                     Number of bids placed so far against the item. Not
+                     returned for International Fixed Price items.
+                          </documentation>
+        </annotation>
+      </element>
+      <element name="BidIncrement" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                     Smallest amount a bid must be above the current high 
+                     bid. Not returned International Fixed Price items.
+                          </documentation>
+        </annotation>
+      </element>
+      <element name="ConvertedCurrentPrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+             Converted current price of listed item.
+                                 </documentation>
+        </annotation>
+      </element>
+      <element name="CurrentPrice" type="cc:AmountType">
+        <annotation>
+          <documentation> 
+          For auction-format listings, current minimum asking price 
+          or the current highest bid for the item if bids have been 
+          placed. Shows minimum bid if no bids have been placed 
+          against the item. This field does not reflect the actual current 
+          price of the item if it's a Type=7 or Type=9 (Fixed Price) 
+          item and the price has been revised. (See StartPrice for 
+          revised asking price.) 
+                              </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:HighBidder" minOccurs="0">
+        <annotation>
+          <documentation> 
+                       Contains one User node representing the current high 
+                       bidder. GetItem returns a high bidder for auctions that have 
+                       ended and have a winning bidder. For Fixed Price listings, 
+                       in-progress auctions, or auction items that received no 
+                       bids, GetItem returns a HighBidder node with empty tags. 
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="LeadCount" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        Applicable to ad-format items only. Indicates how many 
+                        leads to potential buyers are associated with this item. 
+                        For other item types (other than ad-format items), returns
+                        a value of 0 (zero).
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="MinimumToBid" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        Minimum acceptable bid for the item. Not returned for 
+                        International Fixed Price items.     
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="QuantitySold" type="xs:int">
+        <annotation>
+          <documentation> 
+               Number of items purchased so far. (Subtract from the value
+               returned in the Quantity field to calculate the number of items
+               remaining.)
+          </documentation>
+        </annotation>
+      </element>
+      <element name="ReserveMet" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation>
+            Returns true if the reserve price was met or no reserve
+            price was specified.  
+          </documentation>
+        </annotation>
+      </element>
+      <element name="SecondChanceEligible" type="xs:boolean" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="ReviseStatusType">
+    <annotation>
+      <documentation> 
+      Contains the revise status information details (e.g., item properties 
+      information). ths node contains system set data only - always output and always all data. no minccurs needed,
+      except for motors specific data, since it wil lnot be retruned for non motors items
+                </documentation>
+    </annotation>
+    <sequence>
+      <element name="ItemRevised" type="xs:boolean">
+        <annotation>
+          <documentation> 
+                      Indicates whether the item was revised since the auction started. 
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="BuyItNowAdded" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      If true, indicates that a Buy It Now Price was added for
+                      the item. Only returned for Motors items.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="BuyItNowLowered" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Replaces BinLowered as of API version 305. If true,
+                      indicates that the Buy It Now Price was lowered for the
+                      item. Only returned for Motors items. 
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ReserveLowered" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation>
+                        If true, indicates that the Reserve Price was lowered for
+                        the item. Only returned for Motors items.
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="ReserveRemoved" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        If true, indicates that the Reserve Price was removed
+                        from the item. Only returned for eBay Motors items.
+                              </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="ListingDetailsType">
+    <annotation>
+      <documentation> 
+      Contains the listed item details which consists of following information: .         
+                </documentation>
+    </annotation>
+    <sequence>
+      <element name="Adult" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation>
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="BindingAuction" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation>
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="CheckoutEnabled" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation>
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ConvertedBuyItNowPrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                     Converted value of the BuyItNowPrice in the currency 
+                     indicated by SiteCurrency. This value must be refreshed 
+                     every 24 hours to pick up the current conversion rates.
+                          </documentation>
+        </annotation>
+      </element>
+      <element name="ConvertedStartPrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                     Converted value of the StartPrice field in the currency 
+                     indicated by SiteCurrency. This value must be refreshed 
+                     every 24 hours to pick up the current conversion rates.
+                               </documentation>
+        </annotation>
+      </element>
+      <element name="ConvertedReservePrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation>
+           Indicates the converted reserve price for a reserve auction. Returned 
+           only if DetailLevel = 4. ReservePrice is only returned for auctions with 
+           a reserve price where the user calling GetItem is the item's seller. 
+           Returned as null for International Fixed Price items. For more information 
+           on reserve price auctions, see http://pages.ebay.com/help/basics/f-format.html#1. 
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="HasReservePrice" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation>
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="RegionName" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="RelistedItemID" type="ns:ItemIDType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Indicates the new ItemID for a relisted item. When an item is 
+                      relisted, the old (expired) listing is annotated with the new 
+                      (relist) ItemID. This field only appears when the old listing is 
+                      retrieved.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="SecondChanceOriginalItemID" type="ns:ItemIDType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                     The ItemID for the original listing (i.e., OriginalItemID specific 
+                     to Second Chance Offer items). 
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="StartTime" type="xs:dateTime" minOccurs="0">
+        <annotation>
+          <documentation> 
+                    Time stamp for the start of the listing (in GMT). For regular items, 
+                    StartTime is not sent in at listing time.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="EndTime" type="xs:dateTime" minOccurs="0">
+        <annotation>
+          <documentation> 
+                    Time stamp for the end of the listing (in GMT).
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ViewItemURL" type="xs:anyURI" minOccurs="0">
+        <annotation>
+          <documentation>
+                              </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="ItemType">
+    <sequence>
+      <element name="ApplicationData" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Returns custom, application-specific data associated 
+                      with the item. The data in this field is stored with the item 
+                      in the items table at eBay, but is not used in any way by 
+                      eBay. Use ApplicationData to store such special information 
+                      as a part or SKU number. Maximum 32 characters in length.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ListOfAttributeSets" type="ns:ListOfAttributeSetType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Carries one or more instances of the AttributeSet in a list.
+                                 </documentation>
+        </annotation>
+      </element>
+      <element name="AutoPay" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      If true (1), indicates that the seller requested immediate 
+                      payment for the item. False (0) if immediate payment was 
+                      not requested. (Does not indicate whether the item is 
+                      still a candidate for puchase via immediate payment.) 
+                      Only applicable for items listed on US and UK sites in 
+                      categories that support immediate payment, when seller 
+                      has a Premier or Business PayPal account.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="BuyerProtection" type="ns:BuyerProtectionCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Indicates the status of the item's eligibility for the Buyer 
+                      Protection Program. Possible values:
+                  ItemIneligible - Item is ineligible (e.g., category not applicable)
+                  ItemEligible - Item is eligible per standard criteria 
+                  ItemMarkedIneligible - Item marked ineligible per special criteria (e.g., seller's account closed)
+                  ItemMarkedIneligible - Item marked elegible per other criteria
+            Applicable for items listed to the US site and for the Parts 
+            and Accessories category (6028) or Everything Else category 
+            (10368) (or their subcategories) on the eBay Motors site.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="BuyItNowPrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Amount a Buyer would need to bid to take advantage 
+                      of the Buy It Now feature. Not applicable to Fixed-Price 
+                      items (Type = 7 or 9) or AdFormat-type listings. For 
+                      Fixed-Price items, see StartPrice instead. 
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="Charity" type="ns:CharityType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Charity listing container. 
+                                 </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:Country" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      2-letter ISO 3166 Country Code.   
+                               </documentation>
+        </annotation>
+      </element>
+      <element name="CrossPromotion" type="ns:CrossPromotionsType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      CrossPromotions container, if applicable shows promoted items
+                                 </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:Currency" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        3-letter ISO Currency Code.
+                                 </documentation>
+        </annotation>
+      </element>
+      <element name="Description" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Item Description.
+                             </documentation>
+        </annotation>
+      </element>
+      <element name="Escrow" type="ns:EscrowCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Online Escrow paid for by buyer or seller. Cannot use 
+                      with real estate auctions. Escrow is recommended for 
+                      for transactions over $500. Escrow service, 
+                      available via Escrow.com, protects both buyer and 
+                      seller by acting as a trusted third-party during the 
+                      transaction and managing the payment process
+                      from start to finish. Also, if escrow by seller option used,
+                      then for Motors, this means that Escrow will be 
+                      negotiated at the end of the auction.
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="GiftIcon" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      If set, a generic gift icon displays in the listing's 
+                      Title. GiftIcon must be set to to be able to use 
+                      GiftServices options (e.g., GiftExpressShipping, 
+                      GiftShipToRecipient, or GiftWrap).
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="GiftServices" type="ns:GiftServicesCodeType" minOccurs="0" maxOccurs="unbounded">
+        <annotation>
+          <documentation> 
+                      Gift service options offered by the seller of 
+                      the listed item.    
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="HitCounter" type="ns:HitCounterCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Optional hit counter for the item's listing page. Possible 
+                      values are:
+                        "NoHitCounter"  
+              "HonestyStyle"  
+              "GreenLED"  
+              "Hidden"  
+                              </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:ItemID" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        The ID that uniquely identifies the item listing.
+                                 </documentation>
+        </annotation>
+      </element>
+      <element name="ListingDetails" type="ns:ListingDetailsType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Includes listing details in terms of start and 
+                      end time of listing (in GMT) as well as other 
+                      details (e.g., orginal item for second chance,
+                      converted start price, etc.).
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="ListingDesigner" type="ns:ListingDesignerType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      When an item is first listed (using AddItem), a Layout template 
+                      or a Theme template (or both) can be assigned to the item. 
+                      A Layout template is assigned to a new item by specifying 
+                      the Layout template ID (in the AddItem input argument 
+                      LayoutID). Similarly, a Theme template is assigned to the 
+                      item using the ThemeID argument.      
+                              </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:ListingDuration" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Describes the number of days the auction will be active.      
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ListingEnhancement" type="ns:ListingEnhancementsCodeType" minOccurs="0" maxOccurs="unbounded">
+        <annotation>
+          <documentation> 
+                      Describes the types of enhancment supported
+                      for the item's listing.   
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="ListingType" type="ns:ListingTypeCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Describes the type of listing for the item a seller 
+                      has chosen (e.g., Chinese, Dutch, FixedPrice, etc.).    
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="Location" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Indicates the geographical location of the item.    
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="PartnerCode" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                          Needed for add item only for partners.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="PartnerName" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                          Needed for add item only for partners.
+                              </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:PaymentMethods" minOccurs="0" maxOccurs="unbounded">
+        <annotation>
+          <documentation> 
+                      List of payment methods accepted by a seller from a buyer for 
+                      a (checkout) transaction.
+                                 </documentation>
+        </annotation>
+      </element>
+      <element name="PayPalEmailAddress" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        Valid PayPal e-mail address if seller has chosen PayPal 
+                        as a payment method for the listed item.
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="PrimaryCategory" type="ns:CategoryType" minOccurs="0">
+        <annotation>
+          <documentation>
+                      Container for data on the primary category of listing. 
+                </documentation>
+        </annotation>
+      </element>
+      <element name="PrivateListing" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                          Private auction. Not applicable to Fixed Price items.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="Quantity" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        Number of items being sold in the auction.
+                                </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:RegionID" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Region where the item is listed. See Region Table for values. 
+                      If the item is listed with a Region of 0 (zero), then this return 
+                      field denotes no region association with the item, meaning 
+                      that it is not listing the item regionally.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="RelistLink" type="xs:boolean" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      If true, creates a link from the old listing for the item to the new 
+                      relist page, which accommodates users who might still look for 
+                      the item under its old item ID. Also adds the relist ID to the old 
+                      listing's record in the eBay database, which can be returned by 
+                      calling GetItem for the old ItemId. If your application creates the 
+                      listing page for the user, you need to add the relist link option to 
+                      your application for your users.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ReservePrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation>
+            Indicates the reserve price for a reserve auction. Returned 
+            only if DetailLevel = 4. ReservePrice is only returned for 
+            auctions with a reserve price where the user calling GetItem 
+            is the item's seller. Returned as null for International Fixed 
+            Price items. For more information on reserve price auctions, 
+            see http://pages.ebay.com/help/basics/f-format.html#1. 
+                              </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:ReviseStatus" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        Revise Status contains information about the item being
+                        revised.
+                             </documentation>
+        </annotation>
+      </element>
+      <element name="ScheduleTime" type="xs:dateTime" minOccurs="0"/>
+      <element name="SecondaryCategory" type="ns:CategoryType" minOccurs="0">
+        <annotation>
+          <documentation>
+                      Container for data on the secondary category of listing. 
+                      Secondary category is optional.
+                  </documentation>
+        </annotation>
+      </element>
+      <element name="SiteHostedPicture" type="ns:SiteHostedPictureType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                          Item picture information for pictures hosted at eBay site.
+                              </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:Seller" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Seller user.     
+                              </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:SellingStatus" minOccurs="0">
+        <annotation>
+          <documentation>
+                      Container for for selling status information (e.g., BidCount,
+                      BidIncrement, HighBidder, MinimimumToBid, etc).
+                </documentation>
+        </annotation>
+      </element>
+      <element name="ShippingOption" type="ns:ShippingOptionCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Specifies where the seller is willing to ship the item. 
+                        Default "SiteOnly". Valid values are: 
+                        SiteOnly (the default)
+                  WorldWide
+                  SitePlusRegions
+                   WillNotShip
+            If SitePlusRegions is selected, then at least one 
+            regions argument (ShipToNorthAmerica, ShipToEurope, 
+            etc.) must also be set.
+                             </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:ShippingDetails" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                    Contains the shipping payment related information for the 
+                                    listed item.
+                            </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:ShippingRegions" minOccurs="0" maxOccurs="unbounded">
+        <annotation>
+          <documentation> 
+                      Regions that seller will ship to.     
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="ShippingTerms" type="ns:ShippingTermsCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        Describes who pays for the delivery of an item (e.g., buyer 
+                      or seller). 
+                                </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:Site" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        eBay site on which item is listed.
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="StartPrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Starting price for the item. For Type=7 or Type=9 (Fixed Price) 
+                      items, if the item price (MinimumBid) is revised, this field 
+                      returns the new price. 
+                             </documentation>
+        </annotation>
+      </element>
+      <element name="Storefront" type="ns:StorefrontType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Storefront is shown for any item that 
+                      belongs to an eBay Store owner, regardless of 
+                      whether it is fixed price or auction type.  Not 
+                      returned for International Fixed Price items.     
+                              </documentation>
+        </annotation>
+      </element>
+      <element name="SubTitle" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                       Subtitle to use in addition to the title. Provides more keywords when buyers search in titles and descriptions.
+                               </documentation>
+        </annotation>
+      </element>
+      <element name="TimeLeft" type="xs:duration" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Time until the the end of the listing (e.g., the amount of time left 
+                      in an active auction).
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="Title" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                       Name of the item as it appears for auctions. 
+                               </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:UUID" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Universally unique constraint tag. The UUID is unique to a category.
+                                </documentation>
+        </annotation>
+      </element>
+      <element name="VATDetails" type="ns:VATDetailsType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      VAT info container. 
+                                 </documentation>
+        </annotation>
+      </element>
+      <element name="VendorHostedPicture" type="ns:VendorHostedPictureType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                          Item picture information for pictures hosted at vendor (i.e., remote) site.
+                              </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="TransactionsType">
+    <annotation>
+      <documentation> 
+                       Contains information about multiple individual transations.
+                   </documentation>
+    </annotation>
+    <sequence>
+      <element ref="ns:Transaction" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+  <complexType name="TransactionType">
+    <annotation>
+      <documentation> 
+                       Contains information about a single transaction. A transaction contains information 
+                       about the sale of a particular item. The system creates a transaction when a buyer 
+                       has made a purchase (Fixed Price items) or is the winning bidder (BIN and auction 
+                       items). A listing can be associated with one or more transactions in these cases:
+                            Multi-Item Fixed Price Listings
+                            Dutch Auction Listings
+                      A listing is associated with a single transaction in these cases:
+                            Single-Item Fixed Price Listings
+                            Single-Item Auction Listings
+                   </documentation>
+    </annotation>
+    <sequence>
+      <element ref="ns:AmountPaid" minOccurs="0">
+        <annotation>
+          <documentation> 
+            The amount the buyer paid for the item or agreed to pay, 
+            depending on how far into the checkout process the item is. 
+            If the seller allowed the buyer to change the item total, the buyer 
+            is able to change the total until the time that the transaction's 
+            status moves to Complete. Determine whether the buyer 
+            changed the amount by calling GetSellerTransactions or 
+            GetSellerTransactions and comparing the AmountPaid value 
+            to what the seller expected. For Motors items, AmountPaid is 
+            the amount paid by the buyer for the deposit.
+          </documentation>
+        </annotation>
+      </element>
+      <element name="Buyer" type="ns:UserType" minOccurs="0">
+        <annotation>
+          <documentation> 
+            Container for buyer data. 
+          </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:ShippingDetails" minOccurs="0">
+        <annotation>
+          <documentation>
+            Includes shipping payment data.  
+          </documentation>
+        </annotation>
+      </element>
+      <element name="ConvertedAmountPaid" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                  Value returned in the Transaction/AmountPaid element, converted 
+                  to the currency indicated by SiteCurrency.
+              </documentation>
+        </annotation>
+      </element>
+      <element name="ConvertedTransactionPrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                  Value returned in the Transaction/TransactionPrice element, 
+                  converted to the currency indicated by SiteCurrency.
+              </documentation>
+        </annotation>
+      </element>
+      <element name="CreatedDate" type="xs:dateTime" minOccurs="0">
+        <annotation>
+          <documentation> 
+                  For fixed-price, Stores, and BIN items indicates when the 
+                  purchase (or BIN) occurred. For all other item types indicates 
+                  when the transaction was created (the time when checkout 
+                  was initiated).
+              </documentation>
+        </annotation>
+      </element>
+      <element name="DepositType" type="ns:DepositTypeCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                          Deposit type for Motors items. If item is not a Motors item, 
+                          then returns a DepositType of None. Possible values:
+                  None
+                  Other Method
+                  Fast Deposit
+              </documentation>
+        </annotation>
+      </element>
+      <element name="Item" type="ns:ItemType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                        Item info associated with the transaction. 
+          </documentation>
+        </annotation>
+      </element>
+      <element name="QuantityPurchased" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+                         Contains the number of individual items the buyer purchased in 
+                         the transaction. 
+          </documentation>
+        </annotation>
+      </element>
+      <element name="ShippingHandlingTotal" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                          Shipping cost totals shown to user (for both flat and calculated 
+                          rates).   
+          </documentation>
+        </annotation>
+      </element>
+      <element name="Status" type="ns:TransactionStatusType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                          Container node for transaction status data.         
+          </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:TransactionID" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      Unique identifier for a transaction. Returns 0 when Type=1 
+                      (Chinese auction). Typically, an ItemID and a TransactionID 
+                      uniquely identify a checkout  transaction.
+          </documentation>
+        </annotation>
+      </element>
+      <element ref="ns:AuthorizationID" minOccurs="1">
+        <annotation>
+          <documentation> 
+                      Unique identifier for an authorization.
+                                  </documentation>
+        </annotation>
+      </element>
+      <element name="TransactionPrice" type="cc:AmountType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                          Price of the item, before shipping and sales tax. For Motors, 
+                          TransactionPrice is the deposit amount.
+                      </documentation>
+        </annotation>
+      </element>
+      <element name="VATPercent" type="xs:decimal" minOccurs="0">
+        <annotation>
+          <documentation> 
+                      VAT rate for the item, if the item price includes the VAT rate. 
+                      Specify the VATPercent if you want include the net price in 
+                      addition to the gross price in the listing. VAT rates vary 
+                      depending on the item and on the user's country of residence; 
+                      therefore a business seller is responsible for entering the 
+                      correct VAT rate (it will not be calculated by eBay).
+                                </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <simpleType name="UserIDType">
+    <restriction base="xs:string">
+      <length value="127"/>
+    </restriction>
+  </simpleType>
+  <complexType name="PaymentMeansType">
+    <sequence>
+      <element name="TypeCodeID" type="ns:SellerPaymentMethodCodeType"/>
+    </sequence>
+  </complexType>
+  <complexType name="PaymentType">
+    <sequence>
+      <element name="PaymentMeans" type="ns:PaymentMeansType"/>
+    </sequence>
+  </complexType>
+  <complexType name="TransactionStatusType">
+    <sequence>
+      <element name="eBayPaymentStatus" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+            Indicates the success or failure of an eBay Online Payment for 
+            the transaction. If the payment failed, the value returned indicates 
+            the reason for the failure. Possible values:
+                  0 = No payment failure.
+                  3 = Buyer's eCheck bounced.
+                  4 = Buyer's credit card failed.
+                  5 = Buyer failed payment as reported by seller.
+                  7 = Payment from buyer to seller is in PayPal process, but has not yet been completed.
+          </documentation>
+        </annotation>
+      </element>
+      <element name="IncompleteState" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+                            Indicates the current state of the checkout process for the transaction. Possible values:
+                0 = Checkout complete.
+                1 = Checkout incomplete. No details specified.
+                2 = Buyer requests total.
+                3 = Seller responded to buyer's request.
+                        </documentation>
+        </annotation>
+      </element>
+      <element name="LastTimeModified" type="xs:dateTime" minOccurs="0">
+        <annotation>
+          <documentation> 
+                            Indicates last date and time checkout status or incomplete state was updated 
+                            (in GMT). 
+                        </documentation>
+        </annotation>
+      </element>
+      <element name="PaymentMethodUsed" type="ns:BuyerPaymentMethodCodeType" minOccurs="0">
+        <annotation>
+          <documentation> 
+                            Payment method used by the buyer. (See BuyerPaymentCodeList/Type).
+                        </documentation>
+        </annotation>
+      </element>
+      <element name="StatusIs" type="xs:int" minOccurs="0">
+        <annotation>
+          <documentation> 
+                            Indicates whether the transaction process complete or incomplete. 
+                            Possible values:
+                  1 = Incomplete
+                  2 = Complete
+                        </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="UserType">
+    <sequence>
+      <element name="AboutMePage" type="xs:boolean" minOccurs="0"/>
+      <element name="EAISToken" type="xs:string" minOccurs="0"/>
+      <element ref="ns:Email"/>
+      <element ref="ns:FeedbackScore" minOccurs="0">
+        <annotation>
+          <documentation>
+            Feedback scores are a quantitative expression of the desirability of dealing 
+            with that person as a Buyer or a Seller in auction transactions. Each 
+            auction transaction can result in one feedback entry for a given user 
+            (the Buyer can leave one feedback about the Seller and the Seller can leave 
+            one feedback about the Buyer). That one feedback can be positive, negative, 
+            or neutral. The aggregated feedback counts for a particular user represent 
+            that user's overall feedback score (referred to as a "feedback rating" on the 
+            eBay site). This rating is commonly expressed as the eBay Feedback score
+            for the user. 
+             </documentation>
+        </annotation>
+      </element>
+      <element name="FeedbackPrivate" type="xs:boolean" minOccurs="0"/>
+      <element name="FeedbackRatingStar" type="ns:FeedbackRatingStarCodeType" minOccurs="0"/>
+      <element name="IDVerified" type="xs:boolean" minOccurs="0"/>
+      <element name="NewUser" type="xs:boolean" minOccurs="0"/>
+      <element ref="ns:RegistrationAddress" minOccurs="0"/>
+      <element name="RegistrationDate" type="xs:dateTime" minOccurs="0"/>
+      <element ref="ns:Site" minOccurs="0"/>
+      <element name="Status" type="ns:UserStatusCodeType" minOccurs="0"/>
+      <element ref="ns:UserID" minOccurs="0"/>
+      <element name="UserIDChanged" type="xs:boolean" minOccurs="0"/>
+      <element name="UserIDLastChanged" type="xs:dateTime" minOccurs="0"/>
+      <element name="VATStatus" type="ns:VATStatusCodeType" minOccurs="0">
+        <annotation>
+          <documentation>
+                    If present, indicates whether or not the user is subject to VAT. 
+                    Users who have registered with eBay as VAT-exempt are not 
+                    subject to VAT. See Value-Added Tax (VAT). Not returned for 
+                    users whose country of residence is outside the EU. 
+                    Possible values for the user's status:
+                2 = Residence in an EU country but user registered as VAT-exempt
+                3 = Residence in an EU country and user not registered as VAT-exempt 
+                          </documentation>
+        </annotation>
+      </element>
+      <element name="BuyerInfo" type="ns:BuyerType" minOccurs="0"/>
+      <element name="SellerInfo" type="ns:SellerType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="VATDetailsType">
+    <annotation>
+      <documentation> 
+                       Contains information required To list a business item.
+                       BusinessSeller - only for add item, the RestrictedToBusiness and VATPercent for both get and add,
+                       for revise all must be optional
+                   </documentation>
+    </annotation>
+    <sequence>
+      <element name="BusinessSeller" type="xs:boolean" minOccurs="0"/>
+      <element name="RestrictedToBusiness" type="xs:boolean" minOccurs="0"/>
+      <element name="VATPercent" type="xs:float" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="SchedulingInfoType">
+    <annotation>
+      <documentation> 
+                       Contains information for Scheduling limits for the user. All dtails must be present,unless we will have revise call one day,
+                       just in case we might let's make min occur = 0
+                   </documentation>
+    </annotation>
+    <sequence>
+      <element name="MaxScheduledMinutes" type="xs:int" minOccurs="0"/>
+      <element name="MinScheduledMinutes" type="xs:int" minOccurs="0"/>
+      <element name="MaxScheduledItems" type="xs:int" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <element name="AccountCode" type="xs:string"/>
+  <element name="AccountSummary" type="ns:AccountSummaryType"/>
+  <element name="AmountPaid" type="cc:AmountType"/>
+  <element name="AmountPastDue" type="cc:AmountType"/>
+  <element name="Balance" type="cc:AmountType"/>
+  <element name="Buyer" type="ns:UserType"/>
+  <element name="Category" type="ns:CategoryType"/>
+  <element name="CheckoutEnabled" type="xs:boolean"/>
+  <element name="CurrentBalance" type="cc:AmountType"/>
+  <element name="FeedbackScore" type="xs:int"/>
+  <element name="Fees" type="ns:FeesType"/>
+  <element name="HighBidder" type="ns:UserType"/>
+  <element name="InsuranceFee" type="cc:AmountType">
+    <annotation>
+      <documentation> 
+                        Amount of insurance. Applicable if ShippingType is
+                        Flat shipping rate orCalculated shipping rate. 
+                    </documentation>
+    </annotation>
+  </element>
+  <element name="InsuranceOption" type="ns:InsuranceOptionCodeType">
+    <annotation>
+      <documentation> 
+                                    Indicates whether insurance fee is required. Possible values:
+              Insurance not offered.
+                  Insurance optional.
+                  Insurance required. 
+                  Insurance included in Shipping and Handling costs.
+               Applicable if ShippingType is Flat shipping rate or 
+               Calculated shipping rate. 
+                              </documentation>
+    </annotation>
+  </element>
+  <element name="Item" type="ns:ItemType"/>
+  <element name="ItemID" type="ns:ItemIDType"/>
+  <element name="ListingDuration" type="ns:ListingDurationCodeType"/>
+  <element name="PaymentMeans" type="ns:PaymentMeansType"/>
+  <element name="PaymentMethods" type="ns:BuyerPaymentMethodCodeType"/>
+  <element name="PaymentType" type="ns:PaymentType"/>
+  <element name="Region" type="xs:string"/>
+  <element name="RegionID" type="xs:string"/>
+  <element name="RegistrationAddress" type="ns:AddressType"/>
+  <element name="ReviseStatus" type="ns:ReviseStatusType"/>
+  <element name="Seller" type="ns:UserType"/>
+  <element name="SellerLevel" type="ns:SellerLevelCodeType"/>
+  <element name="SellingStatus" type="ns:SellingStatusType"/>
+  <element name="ShippingService" type="ns:ShippingServiceCodeType">
+    <annotation>
+      <documentation> 
+                                  Shipping carrier for the item. Possible values are:
+                 UPS Ground
+                 UPS 3rd Day
+                 UPS 2nd Day
+                 UPS Next Day
+                 USPS Priority
+                 USPS Parcel
+                 USPS Media
+                 USPS First Class 
+                            </documentation>
+    </annotation>
+  </element>
+  <element name="Site" type="ns:SiteCodeType"/>
+  <element name="StoreCategoryID" type="xs:int">
+    <annotation>
+      <documentation> 
+            Custom categories for subdividing the items 
+            within an eBay Store. Store owners can create 
+            up to 12 custom categories for their stores. 
+            (One Store category cannot be customized 
+            and retains the value of "Other") If specified, 
+            must be number between 0 and 12.
+              0=Not an eBay Store item
+              1=Other
+              2=Category 1
+              3=Category 2
+              ...
+              11=Category 10
+              12=Category 11
+        Returned as null for international fixed priced 
+        item.
+                   </documentation>
+    </annotation>
+  </element>
+  <element name="StoreOwner" type="xs:boolean"/>
+  <element name="StoreURL" type="xs:anyURI">
+    <annotation>
+      <documentation> 
+            URL pointing to the seller's eBay Store page. 
+            Returned as null for International Fixed Price items. 
+            This URL follows the format below, where "####" 
+            is replaced by the seller's eBay Stores ID (that 
+            uniquely identifies the eBay Store).
+              http://www.ebaystores.com/id=####
+                   </documentation>
+    </annotation>
+  </element>
+  <complexType name="ItemArrayType">
+    <sequence>
+      <element ref="ns:Item" minOccurs="0" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+  <element name="ItemArray" type="ns:ItemArrayType"/>
+  <complexType name="CategoryArrayType">
+    <sequence>
+      <element ref="ns:Category" minOccurs="0" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+  <element name="CategoryArray" type="ns:CategoryArrayType"/>
+  <complexType name="PaginationType">
+    <sequence>
+      <element name="EntriesPerPage" type="xs:int" minOccurs="0"/>
+      <element name="PageNumber" type="xs:int" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="ModifiedFieldType">
+    <sequence>
+      <element name="Field" type="xs:string" minOccurs="0"/>
+      <element name="ModifyType" type="ns:ModifyCodeType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="PaginationResultType">
+    <sequence>
+      <element name="TotalNumberOfPages" type="xs:int" minOccurs="0"/>
+      <element name="TotalNumberOfEntries" type="xs:int" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <element name="Pagination" type="ns:PaginationType"/>
+  <element name="PaginationResult" type="ns:PaginationResultType"/>
+  <element name="ShippingAddress" type="ns:AddressType"/>
+  <element name="SellerPaymentAddress" type="ns:AddressType"/>
+  <element name="ShippingRegions" type="ns:ShippingRegionCodeType"/>
+  <element name="ShippingDetails" type="ns:ShippingDetailsType"/>
+  <element name="ShippingTerm" type="ns:ShippingTermsCodeType"/>
+  <element name="Transaction" type="ns:TransactionType"/>
+  <element name="Transactions" type="ns:TransactionsType"/>
+  <element name="TransactionID" type="xs:string"/>
+  <element name="AuthorizationID" type="xs:string"/>
+  <element name="UserID" type="ns:UserIDType"/>
+  <element name="User" type="ns:UserType"/>
+<!--  
+
+##### from file eBLCodeLists.xsd #####
+
+-->
+  <annotation>
+    <documentation xml:lang="en">
+            Inclusion of all supported eBay Business Language (eBL) Code Lists.            
+         </documentation>
+  </annotation>
+<!--  
+
+##### from file eBLSharedComponents.xsd #####
+
+-->
+  <annotation>
+    <documentation>
+      This schema definition file contains specification for:
+      1) eBay Business Langauge (eBL) Abstract Request and Response Message
+          which will be used to construct payloads for various applications;
+      2) Re-useable error components of the eBL that would be used to communicate 
+          application-level error messages back to the client application. These application 
+          error messages may be due to a problem detected while processing the 
+          request message.
+      3) Other utility components needed by various eBay buying, selling, and payment
+          applications, e.g., address type and element.
+    </documentation>
+  </annotation>
+  <complexType name="ErrorParameterType">
+    <sequence>
+      <element name="Value" type="xs:string">
+        <annotation>
+          <documentation>
+                        Value of the application-specific error parameter.
+                        </documentation>
+        </annotation>
+      </element>
+    </sequence>
+    <attribute name="ParamID" type="xs:string">
+      <annotation>
+        <documentation>
+                 Specifies application-specific error parameter name.
+                 </documentation>
+      </annotation>
+    </attribute>
+  </complexType>
+  <complexType name="ErrorType">
+    <sequence>
+      <element name="ShortMessage" type="xs:string"/>
+      <element name="LongMessage" type="xs:string" minOccurs="0"/>
+      <element name="ErrorCode" type="xs:token">
+        <annotation>
+          <documentation>
+              Error code can be used by a receiving application to debugging a response 
+              message. These codes will need to be uniquely defined for each application. 
+             </documentation>
+        </annotation>
+      </element>
+      <element name="SeverityCode" type="ns:SeverityCodeType">
+        <annotation>
+          <documentation>
+                       SeverityCode indicates whether the error is an application
+                       level error or if it is informational error, i.e., warning.
+                       </documentation>
+        </annotation>
+      </element>
+      <element name="ErrorParameters" type="ns:ErrorParameterType" minOccurs="0" maxOccurs="unbounded">
+        <annotation>
+          <documentation>
+                       This optional element may carry additional application-specific error variables 
+                       that indicate specific information about the error condition particularly in the 
+                       cases where there are multiple instances of the ErrorType which require 
+                       additional context.
+                       </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+  <complexType name="FaultDetailsType">
+    <sequence>
+      <element name="ErrorCode" type="xs:string">
+        <annotation>
+          <documentation>
+              Error code can be used by a receiving application to debugging a SOAP response 
+              message that contain one or more SOAP Fault detail objects, i.e., fault detail sub-elements. 
+              These codes will need to be uniquely defined for each fault scenario.
+             </documentation>
+        </annotation>
+      </element>
+      <element name="Severity" type="xs:string">
+        <annotation>
+          <documentation>
+                       Severity indicates whether the error is a serious fault
+                       or if it is informational error, i.e., warning.
+                       </documentation>
+        </annotation>
+      </element>
+      <element name="DetailedMessage" type="xs:string" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="AbstractRequestType" abstract="true">
+    <annotation>
+      <documentation> 
+                       Base type definition of request payload that can carry any type 
+                       of payload content with optional versioning information and detail level
+                       requirements.
+                   </documentation>
+    </annotation>
+    <sequence>
+      <element name="DetailLevel" type="ns:DetailLevelCodeType" minOccurs="0" maxOccurs="unbounded">
+        <annotation>
+          <documentation> 
+                                 This specifies the required detail level that is needed by a client application pertaining to
+                                 a particular data component (e.g., Item, Transaction, etc.). The detail level is specified in
+                                 the DetailLevelCodeType which has all the enumerated values of the detail level for 
+                                 each component.  
+                            </documentation>
+        </annotation>
+      </element>
+      <element name="ErrorLanguage" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                 This should be the standard RFC 3066 language identification tag, e.g., en_US.
+                            </documentation>
+        </annotation>
+      </element>
+      <element name="MessageID" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                 The MessageID is used to correlate (i.e., reference) the response message  
+                                 to a specific request message.
+                            </documentation>
+        </annotation>
+      </element>
+      <element name="Version" type="xs:string">
+        <annotation>
+          <documentation> 
+                               This refers to the version of the request payload schema.
+                           </documentation>
+        </annotation>
+      </element>
+      <any processContents="lax" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="AbstractResponseType" abstract="true">
+    <annotation>
+      <documentation> 
+                    Base type definition of a response payload that can carry any 
+                    type of payload content with following optional elements:
+                      - timestamp of response message, 
+                      - application level acknowledgement, and 
+                      - application-level errors and warnings.
+                    </documentation>
+    </annotation>
+    <sequence>
+      <element name="Timestamp" type="xs:dateTime" minOccurs="0">
+        <annotation>
+          <documentation> 
+                  This value represents the date and time (GMT) when the response 
+                  was generated by a service provider (as a result of processing 
+                  of a request). 
+                            </documentation>
+        </annotation>
+      </element>
+      <element name="Ack" type="ns:AckCodeType">
+        <annotation>
+          <documentation> 
+                                   Application level acknowledgement code.
+                               </documentation>
+        </annotation>
+      </element>
+      <element name="CorrelationID" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                                   CorrelationID may be used optionally with an application 
+                                   level acknowledgement.
+                               </documentation>
+        </annotation>
+      </element>
+      <element name="Errors" type="ns:ErrorType" minOccurs="0" maxOccurs="unbounded"/>
+      <element name="Version" type="xs:string">
+        <annotation>
+          <documentation> 
+                                 This refers to the version of the response payload schema.
+                             </documentation>
+        </annotation>
+      </element>
+      <element name="Build" type="xs:string">
+        <annotation>
+          <documentation> 
+                               This refers to the specific software build that was used in the deployment 
+                               for processing the request and generating the response.
+                             </documentation>
+        </annotation>
+      </element>
+      <any processContents="lax" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="AddressType">
+    <sequence>
+      <element name="Name" type="xs:string" minOccurs="0"/>
+      <element name="Street1" type="xs:string" minOccurs="0"/>
+      <element name="Street2" type="xs:string" minOccurs="0"/>
+      <element name="CityName" type="xs:string" minOccurs="0"/>
+      <element name="StateOrProvince" type="xs:string" minOccurs="0"/>
+      <element ref="ns:Country" minOccurs="0"/>
+      <element ref="ns:CountryName" minOccurs="0">
+        <annotation>
+          <documentation> 
+                 This element should only be used in response elements and typically
+                 should not be used in creating request messages which specify the 
+                 name of a country using the Country element (which refers to a
+                 2-letter country code).      
+          </documentation>
+        </annotation>
+      </element>
+      <element name="Phone" type="xs:string" minOccurs="0"/>
+      <element name="PostalCode" type="xs:string" minOccurs="0"/>
+      <element name="AddressID" type="xs:string" minOccurs="0"/>
+      <element name="AddressOwner" type="ns:AddressOwnerCodeType" minOccurs="0"/>
+      <element name="ExternalAddressID" type="xs:string" minOccurs="0"/>
+      <element name="InternationalName" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                 Only applicable to SellerPaymentAddress today. Seller's international name that is associated with the payment address. 
+          </documentation>
+        </annotation>
+      </element>
+      <element name="InternationalStateAndCity" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                 Only applicable to SellerPaymentAddress today. International state and city for the seller's payment address. 
+          </documentation>
+        </annotation>
+      </element>
+      <element name="InternationalStreet" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation> 
+                 Only applicable to SellerPaymentAddress today. Seller's international street address that is associated with the payment address.
+          </documentation>
+        </annotation>
+      </element>
+      <element name="AddressStatus" type="ns:AddressStatusCodeType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <element name="Country" type="ns:CountryCodeType"/>
+  <element name="CountryName" type="xs:string"/>
+  <element name="Currency" type="ns:CurrencyCodeType"/>
+  <element name="Email" type="xs:string"/>
+  <element name="StateOrProvince" type="xs:string"/>
+  <element name="UUID" type="cc:UUIDType"/>
+<!--  
+
+##### from file EscrowCodeList.xsd #####
+
+-->
+  <simpleType name="EscrowCodeType">
+    <annotation>
+      <documentation>
+           EscrowCodeType - Type declaration to be used by other schema.
+           These are the possible codes to describe Escrow options. 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="ByBuyer">
+        <annotation>
+          <documentation>
+                By Buyer
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="BySeller">
+        <annotation>
+          <documentation>
+               By Seller.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="None">
+        <annotation>
+          <documentation>
+               None.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file FeedbackRatingStarCodeList.xsd #####
+
+-->
+  <simpleType name="FeedbackRatingStarCodeType">
+    <annotation>
+      <documentation>
+           FeedbackRatingStarCodeType - Type declaration to be used by other schema.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None">
+        <annotation>
+          <documentation>
+            No graphic displayed
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Yellow">
+        <annotation>
+          <documentation>
+            Yellow Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Turquoise">
+        <annotation>
+          <documentation>
+            Turquoise Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Purple">
+        <annotation>
+          <documentation>
+            Purple Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Red">
+        <annotation>
+          <documentation>
+            Red Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Green">
+        <annotation>
+          <documentation>
+            Green Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="YellowShooting">
+        <annotation>
+          <documentation>
+            Yellow Shooting Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="TurquoiseShooting">
+        <annotation>
+          <documentation>
+            Turquoise Shooting Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="PurpleShooting">
+        <annotation>
+          <documentation>
+            Purple Shooting Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="RedShooting">
+        <annotation>
+          <documentation>
+            Red Shooting Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Blue">
+        <annotation>
+          <documentation>
+            Blue Star
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file GalleryTypeCodeList.xsd #####
+
+-->
+  <simpleType name="GalleryTypeCodeType">
+    <annotation>
+      <documentation>
+           GalleryTypeCodeType - Type declaration to be used by other schema.
+           Specifies the codes for various properties of an item. 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Featured">
+        <annotation>
+          <documentation>
+               Indicates whether it is a featured item. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Gallery">
+        <annotation>
+          <documentation>
+               Include in the gallery. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file GeneralPaymentMethodCodeList.xsd #####
+
+-->
+  <simpleType name="GeneralPaymentMethodCodeType">
+    <annotation>
+      <documentation>
+           GeneralPaymentMethodCodeType - Type declaration to be used 
+           by other schema. This code identifies the general types of payment means, 
+           e.g., used by payment service provider applications.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Other">
+        <annotation>
+          <documentation>Custom Code</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Echeck">
+        <annotation>
+          <documentation>Electronic check.</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ACH">
+        <annotation>
+          <documentation> ACH.</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Creditcard">
+        <annotation>
+          <documentation>
+               Credit-card.
+           </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="PayPalBalance">
+        <annotation>
+          <documentation>
+               Pay balance.
+           </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file GiftServicesCodeList.xsd #####
+
+-->
+  <simpleType name="GiftServicesCodeType">
+    <annotation>
+      <documentation>
+           GiftServicesCodeType - Type declaration to be used by other schema's.
+           Specifies the codes for the various Gift Services offered by sellers. If 
+           any of the Gift Services are offered by the seller, the generic gift icon 
+           should be used to display the item:
+              http://pics.ebay.com/aw/pics/gift/gift.gif 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="GiftExpressShipping">
+        <annotation>
+          <documentation>
+                indicates that the seller is offering to ship the item via 
+                an express shipping method as described in the item 
+                description. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="GiftShipToRecipient">
+        <annotation>
+          <documentation>
+                indicates that the seller is offering to ship to the gift recipient, 
+                not the buyer, when payment clears.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="GiftWrap">
+        <annotation>
+          <documentation>
+               indicates that the seller is offering to wrap the item (and 
+               optionally include a card) as described in the item 
+               description.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file HitCounterCodeList.xsd #####
+
+-->
+  <simpleType name="HitCounterCodeType">
+    <annotation>
+      <documentation>
+         HitCounterCodeType - Type declaration to be used by other schema.
+         This code identifies the HitCounter codes used to specify whether 
+         a hit counter is used for the item's listing page and, if so, what type.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="NoHitCounter">
+        <annotation>
+          <documentation>No hit counter</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="HonestyStyle">
+        <annotation>
+          <documentation>
+             Honesty Style Hit Counter
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="GreenLED">
+        <annotation>
+          <documentation> 
+             Green LED counter.                                 </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Hidden">
+        <annotation>
+          <documentation>
+               Hidden counter.
+           </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file InsuranceOptionCodeList.xsd #####
+
+-->
+  <simpleType name="InsuranceOptionCodeType">
+    <annotation>
+      <documentation>
+           InsuranceOptionCodeType - Type declaration to be used by other schema.
+           These are the possible codes to describe insurance option as part of shipping
+           service.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Optional">
+        <annotation>
+          <documentation>
+                Insurance optional.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Required">
+        <annotation>
+          <documentation>
+               Insurance required. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="NotOffered">
+        <annotation>
+          <documentation>
+               Insurance not offered.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="IncludedInShippingHandling">
+        <annotation>
+          <documentation>
+               Insurance included in Shipping and Handling costs.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file ListingDurationCodeList.xsd #####
+
+-->
+  <simpleType name="ListingDurationCodeType">
+    <annotation>
+      <documentation>
+           ListingDurationCodeType - Type declaration to be used by other schema.
+           These are the possible codes to describe the number of days the 
+           auction will be active. Must be one of the values 3, 5, 7, or 10 
+           for auction and basic Fixed-Price (Type 9) listings. Must be 30, 
+           60, 90, 120, or GTC for Stores Fixed-Price (Type 7) listings. 
+           Specify GTC for the Good 'Til Cancel feature (eBay Stores 
+           items only).
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Days_1">
+        <annotation>
+          <documentation>
+                1 Day
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Days_3">
+        <annotation>
+          <documentation>
+                3 Days
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Days_5">
+        <annotation>
+          <documentation>
+               5 Days
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Days_7">
+        <annotation>
+          <documentation>
+              7 Days
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Days_10">
+        <annotation>
+          <documentation>
+              10 Days
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Days_30">
+        <annotation>
+          <documentation>
+              30 Days
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Days_60">
+        <annotation>
+          <documentation>
+                60 Days
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Days_90">
+        <annotation>
+          <documentation>
+              90 Days
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Days_120">
+        <annotation>
+          <documentation>
+              120 Days
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="GTC">
+        <annotation>
+          <documentation>
+              GTC
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file ListingEnhancementsCodeList.xsd #####
+
+-->
+  <simpleType name="ListingEnhancementsCodeType">
+    <annotation>
+      <documentation>
+           ListingEnhancementsCodeType - Type declaration to be used by other schema.
+           Specifies the codes for various properties of an item. 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Border">
+        <annotation>
+          <documentation>
+                Indicates whether an item will be displayed with a  border 
+                that will go around the item (e.g., for category-based search 
+                result page or store search that brings up multiple items) 
+                to differentiate it from the rest of list.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="BoldTitle">
+        <annotation>
+          <documentation>
+               Indicates whether the bolding option was used. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Featured">
+        <annotation>
+          <documentation>
+               Indicates whether it is a featured item. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Highlight">
+        <annotation>
+          <documentation>
+                Indicates item's listing is highlighted. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="HomePageFeatured">
+        <annotation>
+          <documentation>
+                Indicates item's listing is home page featured. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <annotation>
+    <documentation>eBay Listing Enhancements Codes</documentation>
+  </annotation>
+  <annotation>
+    <documentation>Code List Agency - eBay, Inc.</documentation>
+  </annotation>
+  <annotation>
+    <documentation>Code List Version - 1.0</documentation>
+  </annotation>
+<!--  
+
+##### from file ListingTypeCodeList.xsd #####
+
+-->
+  <simpleType name="ListingTypeCodeType">
+    <annotation>
+      <documentation>
+           ListingTypeCodeType - Type declaration to be used 
+           by other schema. This includes codes indicating the
+           type of auction for the listed item.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Unknown">
+        <annotation>
+          <documentation>
+                Unknown Listing Type
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Chinese">
+        <annotation>
+          <documentation>
+               Chinese auction
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Dutch">
+        <annotation>
+          <documentation>
+               Dutch auction
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Live">
+        <annotation>
+          <documentation>
+               Live Auctions-type auction
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="AdType">
+        <annotation>
+          <documentation>
+               Ad type auction
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="StoresFixedPrice">
+        <annotation>
+          <documentation>
+               Stores Fixed-price auction (US only)
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="PersonalOffer">
+        <annotation>
+          <documentation>
+               Personal Offer auction 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="FixedPriceItem">
+        <annotation>
+          <documentation>
+               Fixed Price item ("BIN only").
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file MerchandizingPrefCodeList.xsd #####
+
+-->
+  <simpleType name="MerchandizingPrefCodeType">
+    <annotation>
+      <documentation>
+           MerchandizingPrefCodeType - Type declaration to be used by other schema.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="OptIn">
+        <annotation>
+          <documentation>
+            OptIn
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="OptOut">
+        <annotation>
+          <documentation>
+            OptOut
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file ModifyCodeList.xsd #####
+
+-->
+  <simpleType name="ModifyCodeType">
+    <annotation>
+      <documentation>
+         ModifyCodeType - Type declaration to be used by other schema.
+         This code identifies the types of modification you can make on an object.
+         account.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Dropped">
+        <annotation>
+          <documentation>Indicate filed is to be dropped.</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Modify">
+        <annotation>
+          <documentation>Indicate filed is to be modified.</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file PhotoDisplayCodeList.xsd #####
+
+-->
+  <simpleType name="PhotoDisplayCodeType">
+    <annotation>
+      <documentation>
+           PhotoDisplayCodeType - Type declaration to be used by other schema.
+           These are types of display for photos used for PhotoHosting slide show. 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None">
+        <annotation>
+          <documentation>
+                  No special Picture Services features.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="SlideShow">
+        <annotation>
+          <documentation>
+                Slideshow of multiple pictures.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="SuperSize">
+        <annotation>
+          <documentation>
+               Super-size format picture.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="PicturePack">
+        <annotation>
+          <documentation>
+              Picture Pack. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file PromotionItemPriceTypeCodeList.xsd #####
+
+-->
+  <simpleType name="PromotionItemPriceTypeCodeType">
+    <annotation>
+      <documentation>
+        Cross Promotion Method.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="AuctionPrice">
+        <annotation>
+          <documentation>
+                Auction Item
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="BuyItNowPrice">
+        <annotation>
+          <documentation>
+              Buy It Now
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved. Do not use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file PromotionItemSelectionCodeList.xsd #####
+
+-->
+  <simpleType name="PromotionItemSelectionCodeType">
+    <annotation>
+      <documentation>
+        Cross Promotion Method.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Manual">
+        <annotation>
+          <documentation>
+                Manual Selection
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Automatic">
+        <annotation>
+          <documentation>
+              Automatic Selection
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved. Do not use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file PromotionMethodCodeList.xsd #####
+
+-->
+  <simpleType name="PromotionMethodCodeType">
+    <annotation>
+      <documentation>
+        Cross Promotion Method.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="CrossSell">
+        <annotation>
+          <documentation>
+                Cross Sell
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="UpSell">
+        <annotation>
+          <documentation>
+              Up Sell
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved. Do not use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file PromotionSchemeCodeList.xsd #####
+
+-->
+  <simpleType name="PromotionSchemeCodeType">
+    <annotation>
+      <documentation>
+        Cross Promotion Context Promotion Scheme.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="ItemToItem">
+        <annotation>
+          <documentation>
+                Item to Item Promotional Scheme
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ItemToStoreCat">
+        <annotation>
+          <documentation>
+              Item to Item Store Scheme
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="StoreToStoreCat">
+        <annotation>
+          <documentation>
+              Store to Store Scheme
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved. Do not use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file PurchasePurposeTypeCodeList.xsd #####
+
+-->
+  <simpleType name="PurchasePurposeTypeCodeType">
+    <annotation>
+      <documentation>
+         PurchasePurposeTypeCodeType - Type declaration to be used by other 
+         schema. This code identifies the purpose of purchases, e.g.,  
+         by a PayPal application.                
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Other">
+        <annotation>
+          <documentation>Custom Code</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="BuyNowItem">
+        <annotation>
+          <documentation/>
+        </annotation>
+      </enumeration>
+      <enumeration value="ShoppingCart">
+        <annotation>
+          <documentation/>
+        </annotation>
+      </enumeration>
+      <enumeration value="AuctionItem">
+        <annotation>
+          <documentation/>
+        </annotation>
+      </enumeration>
+      <enumeration value="GiftCertificates">
+        <annotation>
+          <documentation/>
+        </annotation>
+      </enumeration>
+      <enumeration value="Subscription">
+        <annotation>
+          <documentation/>
+        </annotation>
+      </enumeration>
+      <enumeration value="Donation">
+        <annotation>
+          <documentation/>
+        </annotation>
+      </enumeration>
+      <enumeration value="eBayBilling">
+        <annotation>
+          <documentation/>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file SellerLevelCodeList.xsd #####
+
+-->
+  <simpleType name="SellerLevelCodeType">
+    <annotation>
+      <documentation>
+           SellerLevelCodeType - Type declaration to be used by other schema.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Bronze">
+        <annotation>
+          <documentation>
+            Bronze
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Silver">
+        <annotation>
+          <documentation>
+            Silver
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Gold">
+        <annotation>
+          <documentation>
+            Gold
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Platinum">
+        <annotation>
+          <documentation>
+            Platinum
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Titanium">
+        <annotation>
+          <documentation>
+            Titanium
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="None">
+        <annotation>
+          <documentation>
+            None
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file SellerPaymentMethodCodeList.xsd #####
+
+-->
+  <simpleType name="SellerPaymentMethodCodeType">
+    <annotation>
+      <documentation>
+           SellerPaymentMethodCodeType - Type declaration to be used by other schema.
+           These are payment methods that sellers can use to pay eBay.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Other">
+        <annotation>
+          <documentation>
+                No payment method specified - some other payment method.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Amex">
+        <annotation>
+          <documentation>
+                Amex
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Visa">
+        <annotation>
+          <documentation>
+               Visa
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Mastercard">
+        <annotation>
+          <documentation>
+              Mastercard
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Discover">
+        <annotation>
+          <documentation>
+              Discover
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="JCB">
+        <annotation>
+          <documentation>
+               JCB
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Diners">
+        <annotation>
+          <documentation>
+               Diners
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file SeverityCodeList.xsd #####
+
+-->
+  <simpleType name="SeverityCodeType">
+    <annotation>
+      <documentation>
+         SeverityCodeType - Type declaration to be used by other schema.
+         This code identifies the Severity code types in terms of whether
+         there is an API-level error or warning that needs to be communicated
+         to the client.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Warning">
+        <annotation>
+          <documentation>
+             Warning or informational error.
+              </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Error">
+        <annotation>
+          <documentation> 
+             Application-level error.                   
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file ShippingOptionCodeList.xsd #####
+
+-->
+  <simpleType name="ShippingOptionCodeType">
+    <annotation>
+      <documentation>
+           ShippingOptionCodeType - Type declaration to be used by other schema.
+           These are the possible codes to describe shipping options in terms
+           of where the seller is willing to ship the item. 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="SiteOnly">
+        <annotation>
+          <documentation>
+                Site only.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="WorldWide">
+        <annotation>
+          <documentation>
+               WorldWide.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="SitePlusRegions">
+        <annotation>
+          <documentation>
+               SitePlusRegions.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="WillNotShip">
+        <annotation>
+          <documentation>
+               WillNotShip.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file ShippingPackageCodeList.xsd #####
+
+-->
+  <simpleType name="ShippingPackageCodeType">
+    <annotation>
+      <documentation>
+           ShippingPackageCodeType - Type declaration to be used by other schema.
+           These are the possible codes to describe shipping package options.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None">
+        <annotation>
+          <documentation>
+                None.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Letter">
+        <annotation>
+          <documentation>
+               Letter.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="LargeEnvelope">
+        <annotation>
+          <documentation>
+               LargeEnvelope
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="USPSLargePack">
+        <annotation>
+          <documentation>
+               USPS Large Package/Oversize 1
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="VeryLargePack">
+        <annotation>
+          <documentation>
+               Very Large Package/Oversize 2
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="UPSLetter">
+        <annotation>
+          <documentation>
+               UPS Letter
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="USPSFlatRateEnvelope">
+        <annotation>
+          <documentation>
+               USPS Flat Rate Envelope
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="PackageThickEnvelope">
+        <annotation>
+          <documentation>
+                Package/thick envelope
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file ShippingRatesTypeCodeList.xsd #####
+
+-->
+  <simpleType name="ShippingRatesTypeCodeType">
+    <annotation>
+      <documentation>
+           ShippingRatesTypeCodeType - Type declaration to be used 
+           by other schema. The includes the codes for shipping types
+           supported by sellers to transport items sold to buyers.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Flat">
+        <annotation>
+          <documentation>
+                Flat shipping rate.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Calculated">
+        <annotation>
+          <documentation>
+              Calculated shipping rate.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file ShippingRegionCodeList.xsd #####
+
+-->
+  <simpleType name="ShippingRegionCodeType">
+    <annotation>
+      <documentation>
+           ShippingRegion CodeType - Type declaration to be used by other schema.
+           This code list module defines the enumerated types of regions for 
+           shipping items (i.e., a seller may support shipment of an item). 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Africa">
+        <annotation>
+          <documentation>
+            Africa
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Asia">
+        <annotation>
+          <documentation>
+            Asia
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Caribbean">
+        <annotation>
+          <documentation>
+            Carribbean
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Europe">
+        <annotation>
+          <documentation>
+            Europe
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="LatinAmerica">
+        <annotation>
+          <documentation>
+            LatinAmerica
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="MiddleEast">
+        <annotation>
+          <documentation>
+            MiddleEast
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="NorthAmerica">
+        <annotation>
+          <documentation>
+            NorthAmerica
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Oceania">
+        <annotation>
+          <documentation>
+            Oceania (i.e., Pacific region other than Asia)
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="SouthAmerica">
+        <annotation>
+          <documentation>
+            SouthAmerica
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file ShippingServiceCodeList.xsd #####
+
+-->
+  <simpleType name="ShippingServiceCodeType">
+    <annotation>
+      <documentation>
+           ShippingServiceCodeType - Type declaration to be used by other schema.
+           These are the possible codes to describe insurance option as part of shipping
+           service.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="UPSGround">
+        <annotation>
+          <documentation>
+                UPS Ground
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="UPS3rdDay">
+        <annotation>
+          <documentation>
+               UPS 3rd Day
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="UPS2ndDay">
+        <annotation>
+          <documentation>
+               UPS 2nd Day
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="UPSNextDay">
+        <annotation>
+          <documentation>
+               UPS Next Day.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="USPSPriority">
+        <annotation>
+          <documentation>
+               USPS Priority.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="USPSParcel">
+        <annotation>
+          <documentation>
+               USPS Parcel.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="USPSMedia">
+        <annotation>
+          <documentation>
+               USPS Media.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="USPSFirstClass">
+        <annotation>
+          <documentation>
+               USPS First Class
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ShippingMethodStandard">
+        <annotation>
+          <documentation>
+                ShippingMethodStandard - used by merchant tool only
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ShippingMethodExpress">
+        <annotation>
+          <documentation>
+              ShippingMethodExpress- used by merchant tool only
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ShippingMethodNextDay">
+        <annotation>
+          <documentation>
+                ShippingMethodNextDay- used by merchant tool only
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="USPSExpressMail">
+        <annotation>
+          <documentation>
+                USPS Express Mail
+        </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="USPSGround">
+        <annotation>
+          <documentation>
+                USPS Ground
+      </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file ShippingTermsCodeList.xsd #####
+
+-->
+  <simpleType name="ShippingTermsCodeType">
+    <annotation>
+      <documentation>
+           ShippingTermsCodeType - Type declaration to be used by other schema's.
+           Shipping terms code describes who pays for the shipping of an item.
+           These are the standard shipping terms, i.e.,  terms of delivery of an item. 
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="SellerPays">
+        <annotation>
+          <documentation>
+                Seller pays all shipping costs. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="BuyerPays">
+        <annotation>
+          <documentation>
+                Buyer pays all shipping costs. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file SiteCodeList.xsd #####
+
+-->
+  <simpleType name="SiteCodeType">
+    <annotation>
+      <documentation>
+           SiteCodeType - Type declaration to be used by other schema.
+           These are site codes that buyers and sellers can use to identify 
+           their sites.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="US">
+        <annotation>
+          <documentation>
+            USA
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Canada">
+        <annotation>
+          <documentation>
+            Canada
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="UK">
+        <annotation>
+          <documentation>
+            United Kingdom
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Australia">
+        <annotation>
+          <documentation>
+            Australia
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Austria">
+        <annotation>
+          <documentation>
+            Austria
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Belgium_French">
+        <annotation>
+          <documentation>
+            Belgium (French)
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="France">
+        <annotation>
+          <documentation>
+            France
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Germany">
+        <annotation>
+          <documentation>
+            Germany
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Italy">
+        <annotation>
+          <documentation>
+            Italy
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Belgium_Dutch">
+        <annotation>
+          <documentation>
+            Belgium (Dutch)
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Netherlands">
+        <annotation>
+          <documentation>
+            Netherlands
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Spain">
+        <annotation>
+          <documentation>
+            Spain
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Switzerland">
+        <annotation>
+          <documentation>
+            Switzerland
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Taiwan">
+        <annotation>
+          <documentation>
+            Taiwan
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="eBayMotors">
+        <annotation>
+          <documentation>
+            eBay Motors
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="HongKong">
+        <annotation>
+          <documentation>
+            Hong Kong
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Singapore">
+        <annotation>
+          <documentation>
+            Singapore
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file UnitCodeList.xsd #####
+
+-->
+  <simpleType name="UnitCodeType">
+    <annotation>
+      <documentation>
+           UnitCodeType - Type declaration to be used by other schema.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="kg">
+        <annotation>
+          <documentation>
+                Kilogram.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="lbs">
+        <annotation>
+          <documentation>
+                Pounds.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="oz">
+        <annotation>
+          <documentation>
+               Ounces           
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="cm">
+        <annotation>
+          <documentation>
+              Centimeter. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="inches">
+        <annotation>
+          <documentation>
+              Inches. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="ft">
+        <annotation>
+          <documentation>
+              Feet.
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file UserStatusCodeList.xsd #####
+
+-->
+  <simpleType name="UserStatusCodeType">
+    <annotation>
+      <documentation>
+           UserStatusCodeType - Type declaration to be used by other schema.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Unknown">
+        <annotation>
+          <documentation>
+                 User properties have never been set. 
+                 This value should seldom, if ever, be returned 
+                 and typically represents a problem. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Suspended">
+        <annotation>
+          <documentation>
+                User has been suspended from selling and buying, 
+                such as for violations of eBay terms or agreement. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Confirmed">
+        <annotation>
+          <documentation>
+               User has completed online registration and has 
+               properly responded to confirmation email. Most 
+               users should fall in this category. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Unconfirmed">
+        <annotation>
+          <documentation>
+                User has completed online registration, but 
+                has either not responded to confirmation email 
+                or has not yet been sent the confirmation email. . 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Ghost">
+        <annotation>
+          <documentation>
+                Registered users of AuctionWeb (pre-eBay) 
+                who never re-registered on eBay.  
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="InMaintenance">
+        <annotation>
+          <documentation>
+                Temporary user record state indicating the 
+                record is in the process of being changed by 
+                eBay. Query user information again to get new 
+                status.   
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Deleted">
+        <annotation>
+          <documentation>
+                Records for the specified user have been deleted.  
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CreditCardVerify">
+        <annotation>
+          <documentation>
+                User has completed registration and confirmation, 
+                but is pending a verification of credit card information. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="AccountOnHold">
+        <annotation>
+          <documentation>
+                User's account is on hold, such as for non-payment 
+                of amounts due eBay. User cannot sell or buy items.   
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Merged">
+        <annotation>
+          <documentation>
+                  User record has been merged with another account 
+                  record for the same user. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="RegistrationCodeMailOut">
+        <annotation>
+          <documentation>
+                User has completed online registration and has 
+                been sent the confirmation email, but has not yet 
+                responded to the confirmation email. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="TermPending">
+        <annotation>
+          <documentation>
+                  User has been scheduled for account closure 
+                  (typically when a user has requested to have 
+                  their account closed.) A user in this state should 
+                  not be considered an active user. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="UnconfirmedHalfOptIn">
+        <annotation>
+          <documentation>
+                  User has completed the registration for 
+                  Half.com and opted to automatically also be 
+                  registered with eBay, but the registration 
+                  confirmation is still pending. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CreditCardVerifyHalfOptIn">
+        <annotation>
+          <documentation>
+                  User has completed the registration for 
+                  Half.com and opted to automatically also be 
+                  registered with eBay, but the verification of 
+                  credit card information is still pending. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="UnconfirmedPassport">
+        <annotation>
+          <documentation>
+                  Passport User. User has completed the registration process, but the registration confirmation is still pending. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CreditCardVerifyPassport">
+        <annotation>
+          <documentation>
+                 Passport User Requiring Credit Card Verification. User has completed the registration process with credit card verification, but the registration confirmation is still pending. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="UnconfirmedExpress">
+        <annotation>
+          <documentation>
+                 Half.com User. User has completed the registration for Half.com and opted to automatically also be registered with eBay, but the registration confirmation is still pending. 
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!--  
+
+##### from file VATStatusCodeList.xsd #####
+
+-->
+  <simpleType name="VATStatusCodeType">
+    <annotation>
+      <documentation>
+           VATStatusCodeType - Type declaration to be used by other schema.   
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="NoVATTax">
+        <annotation>
+          <documentation>
+            No VAT Tax
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="VATTax">
+        <annotation>
+          <documentation>
+            VAT Tax
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="VATExempt">
+        <annotation>
+          <documentation>
+            VAT Exempt
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="CustomCode">
+        <annotation>
+          <documentation>
+              Reserved for internal or future use.
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name="CreditCardTypeType">
+    <annotation>
+      <documentation>
+        Type declaration to be used by other schemas.
+        This is the credit card type
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Visa"/>
+      <enumeration value="MasterCard"/>
+      <enumeration value="Discover"/>
+      <enumeration value="Amex"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="NameType">
+    <restriction base="xs:string">
+      <length value="25"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="SalutationType">
+    <restriction base="xs:string">
+      <length value="20"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="SuffixType">
+    <restriction base="xs:string">
+      <length value="12"/>
+    </restriction>
+  </simpleType>
+  <complexType name="PersonNameType">
+    <sequence>
+      <element name="Salutation" type="ns:SalutationType" minOccurs="0"/>
+      <element name="FirstName" type="ns:NameType" minOccurs="0"/>
+      <element name="MiddleName" type="ns:NameType" minOccurs="0"/>
+      <element name="LastName" type="ns:NameType" minOccurs="0"/>
+      <element name="Suffix" type="ns:SuffixType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <simpleType name="TransactionId">
+    <annotation>
+      <documentation>
+        TransactionId - Type for a PayPal Transaction ID.
+      </documentation>
+    </annotation>
+    <restriction base="xs:string"/>
+  </simpleType>
+  <simpleType name="AuthorizationId">
+    <annotation>
+      <documentation>
+        AuthorizationId - Type for a PayPal Authorization ID.
+      </documentation>
+    </annotation>
+    <restriction base="xs:string"/>
+  </simpleType>
+  <!-- put this in eBLPaymentPP -->
+  <element name="RefundType" type="ns:RefundPurposeTypeCodeType"/>
+  <simpleType name="RefundPurposeTypeCodeType">
+    <annotation>
+      <documentation>
+        RefundPurposeTypeCodeType - Type declaration to be used by other 
+        schema. This code identifies the types of refund transactions 
+        supported.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Other">
+        <annotation>
+          <documentation>Custom Code</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Full">
+        <annotation>
+          <documentation>Full Refund</documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value="Partial">
+        <annotation>
+          <documentation>Partial Refund</documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+<!-- new eBL types -->
+  <simpleType name="MerchantPullIDType">
+    <restriction base="xs:string"/>
+  </simpleType>
+  <simpleType name="EmailAddressType">
+    <restriction base="xs:string"/>
+  </simpleType>
+  <simpleType name="ExpressCheckoutTokenType">
+    <restriction base="xs:string"/>
+  </simpleType>
+<!-- For China Postbacks --> 
+
+  <xs:simpleType name="PaymentNotificationServiceCodeType">
+    <xs:annotation>
+      <xs:documentation>
+        PaymentNotificationService - Type declaration to be used by other schemas.
+        For SetPaymentStatus API, this value should always be eBayCN.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="eBayCN"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="OrderID">
+    <xs:restriction base="xs:string" />
+  </xs:simpleType>
+
+  <xs:simpleType name="BankIDCodeType">
+    <xs:annotation>
+      <xs:documentation>
+        BankID - Type declaration to be used by other schemas.
+        The various banks supported for China postbacks.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="CMB"/>
+      <xs:enumeration value="ICBC"/>
+      <xs:enumeration value="CCB"/>
+      <xs:enumeration value="ChinaPay"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="PaymentStatusIDCodeType">
+    <xs:annotation>
+      <xs:documentation>
+        PaymentStatus - Type declaration to be used by other schemas.
+        The payment statuses supported for China postbacks.
+        0 - None
+        1 - Success
+        2 - Pending or Suspicious
+        3 - Failure
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:integer">
+      <xs:minInclusive value="0"/>
+      <xs:maxInclusive value="3"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <!-- eBLPaymentsPP in the reusable section -->
+
+  <element name="ReceiptID" type="xs:string"/>
+  <element name="SubscriptionID" type="xs:string"/>
+  <element name="PaymentTransactions" type="ns:PaymentTransactionSearchResultType"/>
+  <element name="PaymentTransactionDetails" type="ns:PaymentTransactionType"/>
+  <element name="MerchantPullPaymentDetails" type="ns:MerchantPullPaymentType"/>
+  <element name="BillUserResponseDetails" type="ns:MerchantPullPaymentResponseType"/>
+  <element name="BAUpdateResponseDetails" type="ns:BAUpdateResponseDetailsType"/>
+  <element name="SetExpressCheckoutRequestDetails" type="ns:SetExpressCheckoutRequestDetailsType"/>
+  <element name="GetExpressCheckoutDetailsResponseDetails" type="ns:GetExpressCheckoutDetailsResponseDetailsType"/>
+  <element name="DoExpressCheckoutPaymentResponseDetails" type="ns:DoExpressCheckoutPaymentResponseDetailsType"/>
+  <element name="DoExpressCheckoutPaymentRequestDetails" type="ns:DoExpressCheckoutPaymentRequestDetailsType"/>
+  <element name="DoCaptureResponseDetails" type="ns:DoCaptureResponseDetailsType"/>
+  <element name="DoDirectPaymentRequestDetails" type="ns:DoDirectPaymentRequestDetailsType"/>
+
+  <complexType name="SetExpressCheckoutRequestDetailsType">
+    <sequence>
+      <element name="OrderTotal" type="cc:BasicAmountType" minOccurs="1" maxOccurs="1"/>
+      <element name="ReturnURL" type="xs:string" minOccurs="1" maxOccurs="1" />
+      <element name="CancelURL" type="xs:string" minOccurs="1" maxOccurs="1" />
+      <element name="Token" type="ns:ExpressCheckoutTokenType" minOccurs="0" maxOccurs="1"/>
+      <element name="MaxAmount" type="cc:BasicAmountType" minOccurs="0" maxOccurs="1"/>
+      <element name="OrderDescription" type="xs:string" minOccurs="0" maxOccurs="1"/>
+      <element name="Custom" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="InvoiceID" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="ReqConfirmShipping" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="NoShipping" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="AddressOverride" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="LocaleCode" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="PageStyle" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="cpp-header-image" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="cpp-header-border-color" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="cpp-header-back-color" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="cpp-payflow-color" type="xs:string" minOccurs="0" maxOccurs="1" />
+      <element name="Address" type="ns:AddressType" minOccurs="0" maxOccurs="1"/>
+      <element name="PaymentAction" type="ns:PaymentActionCodeType" minOccurs="0" maxOccurs="1"/>
+      <element name="BuyerEmail" type="ns:EmailAddressType" minOccurs="0" maxOccurs="1"/>
+    </sequence>
+  </complexType>
+  <complexType name="GetExpressCheckoutDetailsResponseDetailsType">
+    <sequence>
+      <element name="Token" type="ns:ExpressCheckoutTokenType" minOccurs="1" maxOccurs="1"/>
+      <element name="PayerInfo" type="ns:PayerInfoType" minOccurs="1" maxOccurs="1"/>
+      <element name="Custom" type="xs:string" minOccurs="0" maxOccurs="1"/>
+      <element name="InvoiceID" type="xs:string" minOccurs="0" maxOccurs="1"/>
+      <element name="ContactPhone" type="xs:string" minOccurs="0" maxOccurs="1"/>
+    </sequence>
+  </complexType>
+  <complexType name="DoExpressCheckoutPaymentRequestDetailsType">
+    <sequence>
+      <element name="PaymentAction" type="ns:PaymentActionCodeType" minOccurs="1" maxOccurs="1"/>
+      <element name="Token" type="ns:ExpressCheckoutTokenType" minOccurs="1" maxOccurs="1"/>
+      <element name="PayerID" type="ns:UserIDType" minOccurs="1" maxOccurs="1"/>
+      <element name="PaymentDetails" type="ns:PaymentDetailsType" minOccurs="1" maxOccurs="1"/>
+    </sequence>
+  </complexType>
+  <complexType name="DoExpressCheckoutPaymentResponseDetailsType">
+    <sequence>
+      <element name="Token" type="ns:ExpressCheckoutTokenType" minOccurs="1" maxOccurs="1"/>
+      <element name="PaymentInfo" type="ns:PaymentInfoType" minOccurs="1" maxOccurs="1"/>
+    </sequence>
+  </complexType>
+  <complexType name="DoCaptureResponseDetailsType">
+    <sequence>
+      <element ref="ns:AuthorizationID"/>
+      <element name="PaymentInfo" type="ns:PaymentInfoType" minOccurs="1" maxOccurs="1"/>
+    </sequence>
+  </complexType>
+  <complexType name="DoDirectPaymentRequestDetailsType">
+    <sequence>
+      <element name="PaymentAction" type="ns:PaymentActionCodeType" minOccurs="1" maxOccurs="1"/>
+      <element name="PaymentDetails" type="ns:PaymentDetailsType" minOccurs="1" maxOccurs="1"/>
+      <element name="CreditCard" type="ns:CreditCardDetailsType" minOccurs="1" maxOccurs="1"/>
+      <element name="IPAddress" type="xs:string" minOccurs="1" maxOccurs="1"/>
+      <element name="MerchantSessionId" type="xs:string" minOccurs="0" maxOccurs="1"/>
+    </sequence>
+  </complexType>
+  <complexType name="BAUpdateResponseDetailsType">
+    <sequence>
+      <element name="MpID" type="ns:MerchantPullIDType"/>
+      <element name="PayerInfo" type="ns:PayerInfoType"/>
+      <element name="MerchantPullInfo" type="ns:MerchantPullInfoType"/>
+    </sequence>
+  </complexType>
+  <complexType name="MerchantPullPaymentResponseType">
+    <annotation>
+      <documentation>
+        MerchantPullPaymentResponseType - Type declaration to be used by other schemas.
+        Response data from the merchant pull.
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="PayerInfo" type="ns:PayerInfoType"/>
+      <element name="PaymentInfo" type="ns:PaymentInfoType"/>
+      <element name="MerchantPullInfo" type="ns:MerchantPullInfoType"/>
+    </sequence>
+  </complexType>
+  <complexType name="MerchantPullInfoType">
+    <annotation>
+      <documentation>
+        MerchantPullInfoType - Type declaration to be used by other schemas.
+        Information about the merchant pull.
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="MpStatus" type="ns:MerchantPullStatusCodeType"/>
+      <element name="MpMax" type="cc:BasicAmountType"/>
+      <element name="MpCustom" type="xs:string" minOccurs="0"/>
+      <element name="Desc" type="xs:string" minOccurs="0"/>
+      <element name="Invoice" type="xs:string" minOccurs="0"/>
+      <element name="Custom" type="xs:string" minOccurs="0"/>
+      <element name="PaymentSourceID" type="xs:string" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="PaymentTransactionSearchResultType">
+    <annotation>
+      <documentation>
+        PaymentTransactionSearchResultType - Type declaration to be used by other schemas.
+        Results from a PaymentTransaction search
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="Timestamp" type="xs:dateTime"/>
+      <element name="Timezone" type="xs:string"/>
+      <element name="Type" type="xs:string"/>
+      <element name="Payer" type="ns:EmailAddressType"/>
+      <element name="PayerDisplayName" type="xs:string"/>
+      <element ref="ns:TransactionID"/>
+      <element name="Status" type="xs:string"/>
+      <element name="GrossAmount" type="cc:BasicAmountType"/>
+      <element name="FeeAmount" type="cc:BasicAmountType"/>
+      <element name="NetAmount" type="cc:BasicAmountType"/>
+    </sequence>
+  </complexType>
+  <complexType name="MerchantPullPaymentType">
+    <annotation>
+      <documentation>
+        MerchantPullPayment - Type declaration to be used by other schemas.
+        Parameters to make initiate a pull payment
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="Amount" type="cc:BasicAmountType"/>
+      <element name="MpID" type="ns:MerchantPullIDType"/>
+      <element name="PaymentType" type="ns:MerchantPullPaymentCodeType" minOccurs="0"/>
+      <element name="Memo" type="xs:string" minOccurs="0"/>
+      <element name="EmailSubject" type="xs:string" minOccurs="0"/>
+      <element name="Tax" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="Shipping" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="Handling" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="ItemName" type="xs:string" minOccurs="0"/>
+      <element name="ItemNumber" type="xs:string" minOccurs="0"/>
+      <element name="Invoice" type="xs:string" minOccurs="0"/>
+      <element name="Custom" type="xs:string" minOccurs="0"/>
+      <element name="ButtonSource" type="xs:string" minOccurs="0"/>
+    </sequence>
+<!-- annnotate item name and number -->
+  </complexType>
+  <complexType name="PaymentTransactionType">
+    <annotation>
+      <documentation>
+        PaymentTransactionType - Type declaration to be used by other schemas.
+        Information about a PayPal payment from the seller side
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="ReceiverInfo" type="ns:ReceiverInfoType"/>
+      <element name="PayerInfo" type="ns:PayerInfoType"/>
+      <element name="PaymentInfo" type="ns:PaymentInfoType"/>
+      <element name="PaymentItemInfo" type="ns:PaymentItemInfoType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="ReceiverInfoType">
+    <annotation>
+      <documentation>
+        ReceiverInfoType - Type declaration to be used by other schemas.
+        Receiver information.
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="Business" type="ns:EmailAddressType"/>
+      <element name="Receiver" type="ns:EmailAddressType"/>
+      <element name="ReceiverID" type="ns:UserIDType"/>
+    </sequence>
+  </complexType>
+  <complexType name="PayerInfoType">
+    <annotation>
+      <documentation>
+        PayerInfoType - Type declaration to be used by other schemas.
+        Payer information
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="Payer" type="ns:EmailAddressType"/>
+      <element name="PayerID" type="ns:UserIDType"/>
+      <element name="PayerStatus" type="ns:PayPalUserStatusCodeType"/>
+      <element name="PayerName" type="ns:PersonNameType"/>
+      <element name="PayerCountry" type="ns:CountryCodeType"/>
+      <element name="PayerBusiness" type="xs:string" minOccurs="0"/>
+      <element name="Address" type="ns:AddressType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="PaymentInfoType">
+    <annotation>
+      <documentation>
+        PaymentInfoType - Type declaration to be used by other schemas.
+        Payment information.
+      </documentation>
+    </annotation>
+    <sequence>
+      <element ref="ns:TransactionID"/>
+      <element name="ParentTransactionID" type="ns:TransactionId" minOccurs="0"/>
+      <element ref="ns:ReceiptID" minOccurs="0"/>
+      <element name="TransactionType" type="ns:PaymentTransactionCodeType"/>
+      <element name="PaymentType" type="ns:PaymentCodeType" minOccurs="0"/>
+      <element name="PaymentDate" type="xs:dateTime"/>
+      <element name="GrossAmount" type="cc:BasicAmountType"/>
+      <element name="FeeAmount" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="SettleAmount" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="TaxAmount" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="ExchangeRate" type="xs:string" minOccurs="0"/>
+      <element name="PaymentStatus" type="ns:PaymentStatusCodeType"/>
+      <element name="PendingReason" type="ns:PendingStatusCodeType" minOccurs="0"/>
+      <element name="ReasonCode" type="ns:ReversalReasonCodeType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="SubscriptionTermsType">
+    <annotation>
+      <documentation>
+        SubscriptionTermsType - Type declaration to be used by other schemas.
+        Terms of a PayPal subscription.
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="Amount" type="cc:BasicAmountType"/>
+    </sequence>
+    <attribute name="period" type="xs:string" use="required"/>
+  </complexType>
+  <complexType name="SubscriptionInfoType">
+    <annotation>
+      <documentation>
+        SubscriptionInfoType - Type declaration to be used by other schemas.
+        Information about a PayPal Subscription.
+      </documentation>
+    </annotation>
+    <sequence>
+      <element ref="ns:SubscriptionID"/>
+      <element name="SubscriptionDate" type="xs:dateTime" minOccurs="0"/>
+      <element name="EffectiveDate" type="xs:dateTime" minOccurs="0"/>
+      <element name="RetryTime" type="xs:dateTime" minOccurs="0"/>
+      <element name="Username" type="xs:string" minOccurs="0"/>
+      <element name="Password" type="xs:string" minOccurs="0"/>
+      <element name="Recurrences" type="xs:string" minOccurs="0"/>
+      <element name="Terms" type="ns:SubscriptionTermsType" minOccurs="0" maxOccurs="unbounded"/>
+    </sequence>
+    <attribute name="reattempt" type="xs:string" use="required"/>
+    <attribute name="recurring" type="xs:string" use="required"/>
+  </complexType>
+  <complexType name="AuctionInfoType">
+    <annotation>
+      <documentation>
+        AuctionInfoType - Type declaration to be used by other schemas.
+        Basic information about an auction.
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="BuyerID" type="xs:string" minOccurs="0"/>
+      <element name="ClosingDate" type="xs:dateTime" minOccurs="0"/>
+    </sequence>
+    <attribute name="multiItem" type="xs:string" use="required"/>
+  </complexType>
+  <complexType name="OptionType">
+    <annotation>
+      <documentation>
+        OptionType - Type declaration to be used by other schemas.
+        PayPal item options for shopping cart.
+      </documentation>
+<!-- add more documentation here -->
+    </annotation>
+    <sequence/>
+    <attribute name="name" type="xs:string" use="required"/>
+    <attribute name="value" type="xs:string" use="required"/>
+  </complexType>
+  <complexType name="PaymentDetailsItemType">
+    <annotation>
+      <documentation>
+        PaymentDetailsItemType - Type declaration to be used by other schemas.
+        Information about a Payment Item.
+      </documentation>
+<!-- add more documentation here -->
+    </annotation>
+    <sequence>
+      <element name="Name" type="xs:string" minOccurs="0"/>
+      <element name="Number" type="xs:string" minOccurs="0"/>
+      <element name="Quantity" type="xs:integer" minOccurs="0"/>
+      <element name="Tax" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="Amount" type="cc:BasicAmountType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="PaymentItemType">
+    <annotation>
+      <documentation>
+        PaymentItemType - Type declaration to be used by other schemas.
+        Information about a Payment Item.
+      </documentation>
+<!-- add more documentation here -->
+    </annotation>
+    <sequence>
+      <element name="Name" type="xs:string" minOccurs="0"/>
+      <element name="Number" type="xs:string" minOccurs="0"/>
+      <element name="Quantity" type="xs:string" minOccurs="0"/>
+      <element name="SalesTax" type="xs:string" minOccurs="0"/>
+      <element name="Amount" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="Options" type="ns:OptionType" minOccurs="0" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+  <complexType name="PaymentItemInfoType">
+    <annotation>
+      <documentation>
+        PaymentItemInfoType - Type declaration to be used by other schemas.
+        Information about a PayPal item.
+      </documentation>
+    </annotation>
+    <sequence>
+      <element name="InvoiceID" type="xs:string" minOccurs="0"/>
+      <element name="Custom" type="xs:string" minOccurs="0"/>
+      <element name="Memo" type="xs:string" minOccurs="0"/>
+      <element name="SalesTax" type="xs:string" minOccurs="0"/>
+      <element name="PaymentItem" type="ns:PaymentItemType" minOccurs="0" maxOccurs="unbounded"/>
+      <element name="Subscription" type="ns:SubscriptionInfoType" minOccurs="0"/>
+      <element name="Auction" type="ns:AuctionInfoType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="PaymentDetailsType">
+    <annotation>
+      <documentation>
+        PaymentDetailsType - Type declaration to be used by other schemas.
+        Information about a payment.  Used by DCC and Express Checkout.
+      </documentation>
+      <!-- add more documentation here -->
+    </annotation>
+    <sequence>
+      <element name="OrderTotal" type="cc:BasicAmountType"/>
+      <element name="ItemTotal" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="ShippingTotal" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="HandlingTotal" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="TaxTotal" type="cc:BasicAmountType" minOccurs="0"/>
+      <element name="OrderDescription" type="xs:string" minOccurs="0"/>
+      <element name="Custom" type="xs:string" minOccurs="0"/>
+      <element name="InvoiceID" type="xs:string" minOccurs="0"/>
+      <element name="ButtonSource" type="xs:string" minOccurs="0"/>
+      <element name="NotifyURL" type="xs:string" minOccurs="0"/>
+      <element name="ShipToAddress" type="ns:AddressType" minOccurs="0"/>
+      <element name="PaymentDetailsItem" type="ns:PaymentDetailsItemType" minOccurs="0" maxOccurs="unbounded"/>
+    </sequence>
+  </complexType>
+  <complexType name="CreditCardDetailsType">
+    <annotation>
+      <documentation>
+        CreditCardDetailsType - Type declaration to be used by other schemas.
+        Information about a Credit Card.
+      </documentation>
+      <!-- add more documentation here -->
+    </annotation>
+    <sequence>
+      <element name="CreditCardType" type="ns:CreditCardTypeType"/>
+      <element name="CreditCardNumber" type="xs:string"/>
+      <element name="ExpMonth" type="xs:int"/>
+      <element name="ExpYear" type="xs:int"/>
+      <element name="CardOwner" type="ns:PayerInfoType"/>
+      <element name="CVV2" type="xs:string" minOccurs="0"/>
+    </sequence>
+  </complexType>
+<!-- new CodeTypes -->
+  <simpleType name="PaymentTransactionCodeType">
+    <annotation>
+      <documentation>
+        PaymentTransactionCodeType - Type declaration to be used by other schemas.
+        This is the type of a PayPal of which matches the output from IPN
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="none"/>
+      <enumeration value="web-accept"/>
+      <enumeration value="cart"/>
+      <enumeration value="send-money"/>
+      <enumeration value="subscr-failed"/>
+      <enumeration value="subscr-cancel"/>
+      <enumeration value="subscr-payment"/>
+      <enumeration value="subscr-signup"/>
+      <enumeration value="subscr-eot"/>
+      <enumeration value="subscr-modify"/>
+      <enumeration value="mercht-pmt"/>
+      <enumeration value="mass-pay"/>
+      <enumeration value="virtual-terminal"/>
+      <enumeration value="express-checkout"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="PaymentStatusCodeType">
+    <annotation>
+      <documentation>
+        PaymentStatusCodeType - Type declaration to be used by other schemas.
+        This is the status of a PayPal Payment which matches the output from IPN
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None"/>
+      <enumeration value="Completed"/>
+      <enumeration value="Failed"/>
+      <enumeration value="Pending"/>
+      <enumeration value="Denied"/>
+      <enumeration value="Refunded"/>
+      <enumeration value="Reversed"/>
+      <enumeration value="Canceled-Reversal"/>
+      <enumeration value="Processed"/>
+      <enumeration value="Partially-Refunded"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="AddressStatusCodeType">
+    <annotation>
+      <documentation>
+        AddressStatusCodeType - Type declaration to be used by other schemas.
+        This is the PayPal address status
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None"/>
+      <enumeration value="Confirmed"/>
+      <enumeration value="Unconfirmed"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="PaymentActionCodeType">
+    <annotation>
+      <documentation>
+        PaymentDetailsCodeType - Type declaration to be used by other schemas.
+        This is the PayPal payment details type (used by DCC and Express Checkout)
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None"/>
+      <enumeration value="Authorization"/>
+      <enumeration value="Sale"/>
+      <enumeration value="Order"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="PendingStatusCodeType">
+    <annotation>
+      <documentation>
+        PendingStatusCodeType - Type declaration to be used by other schemas.
+        The pending status for a PayPal Payment transaction which matches the output from IPN
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="none"/>
+      <enumeration value="echeck"/>
+      <enumeration value="intl"/>
+      <enumeration value="verify"/>
+      <enumeration value="address"/>
+      <enumeration value="unilateral"/>
+      <enumeration value="other"/>
+      <enumeration value="upgrade"/>
+      <enumeration value="multi-currency"/>
+      <enumeration value="authorization"/>
+      <enumeration value="order"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="ReversalReasonCodeType">
+    <annotation>
+      <documentation>
+        ReversalReasonCodeType - Type declaration to be used by other schemas.
+        Reason for a reversal on a PayPal transaction which matches the output from IPN
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="none"/>
+      <enumeration value="chargeback"/>
+      <enumeration value="guarantee"/>
+      <enumeration value="buyer-complaint"/>
+      <enumeration value="refund"/>
+      <enumeration value="other"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="PaymentCodeType">
+    <annotation>
+      <documentation>
+        PaymentCodeType - Type declaration to be used by other schemas.
+        This is the type of PayPal payment which matches the output from IPN.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="none"/>
+      <enumeration value="echeck"/>
+      <enumeration value="instant"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="PayPalUserStatusCodeType">
+    <annotation>
+      <documentation>
+        PayPalUserStatusCodeType - Type declaration to be used by other schemas.
+        PayPal status of a user Address
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="verified"/>
+      <enumeration value="unverified"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="MerchantPullPaymentCodeType">
+    <annotation>
+      <documentation>
+        MerchantPullPaymentCodeType - Type declaration to be used by other schemas.
+        Type of Payment to be initiated by the merchant
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Any"/>
+      <enumeration value="InstantOnly"/>
+      <enumeration value="EcheckOnly"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="MerchantPullStatusCodeType">
+    <annotation>
+      <documentation>
+        MerchantPullStatusCodeType - Type declaration to be used by other schemas.
+        Status of the merchant pull
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Active"/>
+      <enumeration value="Canceled"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="PaymentTransactionStatusCodeType">
+    <annotation>
+      <documentation>
+        PaymentTransactionStatusCodeType - Type declaration to be used by other schemas.
+        The status of the PayPal payment.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="Pending"/>
+      <enumeration value="Processing"/>
+      <enumeration value="Success"/>
+      <enumeration value="Denied"/>
+      <enumeration value="Reversed"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="PaymentTransactionClassCodeType">
+    <annotation>
+      <documentation>
+        PaymentTransactionClassCodeType - Type declaration to be used by other schemas.
+        The Type of PayPal payment.
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="All"/>
+      <enumeration value="Sent"/>
+      <enumeration value="Received"/>
+      <enumeration value="MassPay"/>
+      <enumeration value="MoneyRequest"/>
+      <enumeration value="FundsAdded"/>
+      <enumeration value="FundsWithdrawn"/>
+      <enumeration value="PayPalDebitCard"/>
+      <enumeration value="Referral"/>
+      <enumeration value="Fee"/>
+      <enumeration value="Subscription"/>
+      <enumeration value="Dividend"/>
+      <enumeration value="Billpay"/>
+      <enumeration value="Refund"/>
+      <enumeration value="CurrencyConversions"/>
+      <enumeration value="BalanceTransfer"/>
+      <enumeration value="Reversal"/>
+      <enumeration value="Shipping"/>
+      <enumeration value="BalanceAffecting"/>
+      <enumeration value="ECheck"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="MatchStatusCodeType">
+    <annotation>
+      <documentation>
+        MatchStatusCodeType - Type declaration to be used by other schemas.
+        This is the PayPal (street/zip) match code
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None"/>
+      <enumeration value="Matched"/>
+      <enumeration value="Unmatched"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="CompleteCodeType">
+    <annotation>
+      <documentation>
+        CompleteCodeType - Type declaration to be used by other schemas.
+        This is the PayPal DoCapture CompleteType code
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="NotComplete"/>
+      <enumeration value="Complete"/>
+    </restriction>
+  </simpleType>
+  <simpleType name="TransactionEntityType">
+    <annotation>
+      <documentation>
+        TransactionEntityType - Type declaration to be used by other schemas.
+        This is the PayPal DoAuthorization TransactionEntityType code
+      </documentation>
+    </annotation>
+    <restriction base="xs:token">
+      <enumeration value="None"/>
+      <enumeration value="Auth"/>
+      <enumeration value="Reauth"/>
+      <enumeration value="Order"/>
+      <enumeration value="Payment"/>
+    </restriction>
+  </simpleType>
+  <!-- Custom Security Header -->
+  <complexType name="CustomSecurityHeaderType">
+    <annotation>
+      <documentation>
+                Custom Securiy Header.
+            </documentation>
+    </annotation>
+    <sequence>
+      <element name="eBayAuthToken" type="xs:string" minOccurs="0"/>
+      <element name="HardExpirationWarning" type="xs:string" minOccurs="0"/>
+      <element name="Credentials" type="ns:UserIdPasswordType" minOccurs="0"/>
+    </sequence>
+  </complexType>
+  <complexType name="UserIdPasswordType">
+    <sequence>
+      <element name="AppId" type="xs:string" minOccurs="0"/>
+      <element name="DevId" type="xs:string" minOccurs="0"/>
+      <element name="AuthCert" type="xs:string" minOccurs="0"/>
+      <element name="Username" type="xs:string">
+        <annotation>
+          <documentation>
+            The username is the identifier for an account.
+          </documentation>
+        </annotation>
+      </element>
+      <element name="Password" type="xs:string">
+        <annotation>
+          <documentation>
+            Password contains the current password associated with the username.  
+          </documentation>
+        </annotation>
+      </element>
+      <element name="Subject" type="xs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+                This field identifies an account (e.g., payment) on whose behalf the operation is being performed. 
+                 For instance one account holder may delegate the abililty to perform certain operations 
+                 to another account holder.  This delegation is done through a separate mechanism.  
+                 If the base username has not been authorized by the subject the request will be rejected.
+            </documentation>
+        </annotation>
+      </element>
+    </sequence>
+  </complexType>
+</schema>

Added: trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/paypal-endpoints.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/paypal-endpoints.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/paypal-endpoints.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/**
+ * THIS MAPPING IS AUTOMATICALLY GENERATED. DO NOT EDIT.
+ * Generated on: 07/27/05 14:22:13
+ * @package Services_PayPal
+ */
+$PayPalEndpoints = array (
+  0 => 
+  array (
+    'min' => '1.00',
+    'max' => '2.00',
+    'environments' => 
+    array (
+      'live' => 
+      array (
+        'PayPalAPI' => 'https://api.paypal.com/2.0/',
+        'PayPalAPIAA' => 'https://api-aa.paypal.com/2.0/',
+      ),
+      'sandbox' => 
+      array (
+        'PayPalAPI' => 'https://api.sandbox.paypal.com/2.0/',
+        'PayPalAPIAA' => 'https://api-aa.sandbox.paypal.com/2.0/',
+      ),
+      'beta-sandbox' => 
+      array (
+        'PayPalAPI' => 'https://api.beta-sandbox.paypal.com/2.0/',
+        'PayPalAPIAA' => 'https://api-aa.beta-sandbox.paypal.com/2.0/',
+      ),
+    ),
+  ),
+);

Added: trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/paypal-endpoints.xml
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/paypal-endpoints.xml	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal/wsdl/paypal-endpoints.xml	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<paypal:endpoints xmlns:paypal="http://www.paypal.com/wsdl/">
+  <paypal:wsdl min-version="1.00" max-version="2.00">
+    <paypal:environment name="live">
+      <paypal:port name="PayPalAPI">https://api.paypal.com/2.0/</paypal:port>
+      <paypal:port name="PayPalAPIAA">https://api-aa.paypal.com/2.0/</paypal:port>
+    </paypal:environment>
+    <paypal:environment name="sandbox">
+      <paypal:port name="PayPalAPI">https://api.sandbox.paypal.com/2.0/</paypal:port>
+      <paypal:port name="PayPalAPIAA">https://api-aa.sandbox.paypal.com/2.0/</paypal:port>
+    </paypal:environment>
+    <paypal:environment name="beta-sandbox">
+      <paypal:port name="PayPalAPI">https://api.beta-sandbox.paypal.com/2.0/</paypal:port>
+      <paypal:port name="PayPalAPIAA">https://api-aa.beta-sandbox.paypal.com/2.0/</paypal:port>
+    </paypal:environment>
+  </paypal:wsdl>
+</paypal:endpoints>

Added: trunk/direct.openmoko.com/pear/Services/PayPal.php
===================================================================
--- trunk/direct.openmoko.com/pear/Services/PayPal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/Services/PayPal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,207 @@
+<?php
+/**
+ * Base PayPal SDK file.
+ *
+ * @package Services_PayPal
+ */
+
+/**
+ * Include our error class and the PEAR base class.
+ */
+require_once 'PEAR.php';
+require_once 'Services/PayPal/Error.php';
+require_once 'Services/PayPal/SDK/Generator.php';
+
+/**
+ * End point for users to access the PayPal API, provides utility
+ * methods used internally as well as factory methods.
+ *
+ * $Id: PayPal.php,v 1.20 2005/06/23 17:03:18 chagenbuch Exp $
+ *
+ * @static
+ * @package Services_PayPal
+ */
+class Services_PayPal extends PEAR
+{
+    /**
+     * Raise an error when one occurs
+     *
+     * @static
+     */
+    function raiseError($message, $code = null)
+    {
+        return parent::raiseError($message, $code, null, null, null, 'PayPal_Error');
+    }
+
+    /**
+     * Try to instantiate the class for $type. Looks inside the Type/
+     * directory containing all generated types. Allows for run-time
+     * loading of needed types.
+     *
+     * @param string $type  The name of the type (eg. AbstractRequestType).
+     *
+     * @return mixed XSDType | PayPal_Error  Either an instance of $type or an error.
+     *
+     * @static
+     */
+    function &getType($type)
+    {
+        $type = basename($type);
+        @include_once 'Services/PayPal/Type/' . $type . '.php';
+        if (!class_exists($type)) {
+            return Services_PayPal::raiseError("Type $type is not defined");
+        }
+
+        return $t =& new $type();
+    }
+
+    /**
+     * Load a CallerServices object for making API calls.
+     *
+     * @param APIProfile $profile  The profile with the username, password,
+     *                             and any other information necessary to use
+     *                             CallerServices.
+     *
+     * @return CallerServices  A PayPal API caller object.
+     *
+     * @static
+     */
+    function &getCallerServices($profile, $logLevel = 0, $logDir = '')
+    {
+        if (!defined('CURLOPT_SSLCERT')) {
+            return Services_PayPal::raiseError("The PayPal SDK requires curl with SSL support");
+        }
+
+        if (!is_a($profile, 'APIProfile')) {
+            return Services_PayPal::raiseError("You must provide a valid APIProfile");
+        }
+
+        $result = $profile->validate();
+        if (Services_PayPal::isError($result)) {
+            return $result;
+        }
+
+        include_once 'Services/PayPal/CallerServices.php';
+        return $c =& new CallerServices($profile, $logLevel, $logDir);
+    }
+
+    /**
+     * Load an EWPServices object for performing encryption
+     * operations.
+     *
+     * @param EWPProfile $profile  The profile with the username, password,
+     *                             and any other information necessary to use
+     *                             EWPServices.
+     *
+     * @return EWPServices  A PayPal EWP services object.
+     *
+     * @static
+     */
+    function &getEWPServices($profile)
+    {
+        if (!is_a($profile, 'EWPProfile')) {
+            return parent::raiseError("You must provide a valid EWPProfile");
+        }
+
+        $result = $profile->validate();
+        if (Services_PayPal::isError($result)) {
+            return $result;
+        }
+
+        include_once 'Services/PayPal/EWPServices.php';
+        return $c =& new EWPServices($profile);
+    }
+
+    /**
+     * Returns the package root directory.
+     *
+     * @return string  The path where the package is installed.
+     *
+     * @static
+     */
+    function getPackageRoot()
+    {
+        return dirname(__FILE__) . '/PayPal';
+    }
+
+    /**
+     * Returns the SDK version.
+     *
+     * @return string  The SDK version.
+     *
+     * @static
+     */
+    function getPackageVersion()
+    {
+        return '0.0.1';
+    }
+
+    /**
+     * Returns the version of the WSDL that this SDK is built against.
+     *
+     * @return float  The WSDL version.
+     *
+     * @static
+     */
+    function getWSDLVersion()
+    {
+        include_once 'Services/PayPal/CallerServices.php';
+        return PAYPAL_WSDL_VERSION;
+    }
+
+    /**
+     * Returns the endpoint map.
+     *
+     * @return mixed The Paypal endpoint map or a Paypal error object on failure
+     * @static
+     */
+    function getEndpoints()
+    {
+        $package_root = Services_PayPal::getPackageRoot();
+        $file = "$package_root/wsdl/paypal-endpoints.php";
+        if (@include $file) {
+            if (!isset($PayPalEndpoints)) {
+                return Services_PayPal::raiseError("Endpoint map file found, but no data was found.");
+            }
+
+            return $PayPalEndpoints;
+        }
+
+        return Services_PayPal::raiseError("Could not load endpoint mapping from '$file', please rebuild SDK.");
+    }
+
+    /**
+     * Get information describing all types provided by the SDK.
+     * @static
+     */
+    function getTypeList()
+    {
+        $root_dir = Services_PayPal::getPackageRoot();
+        $types = "$root_dir/Type/*.php";
+
+        $files = glob($types);
+
+        if (count($files) < 2) {
+            return Services_PayPal::raiseError("Types not found in package! (Looked for '$types')");
+        }
+
+        $retval = array();
+
+        foreach ($files as $type_files) {
+            $retval[] = basename(substr($type_files, 0, strpos($type_files, '.')));
+        }
+
+        return $retval;
+    }
+
+    /**
+     * Get information describing what methods are available.
+     * @static
+     */
+    function getCallerServicesIntrospection()
+    {
+        $inst =& new PayPal_SDK_Generator();
+        return $inst->describeMethods();
+    }
+
+}

Added: trunk/direct.openmoko.com/pear/configure.php
===================================================================
--- trunk/direct.openmoko.com/pear/configure.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pear/configure.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php 
+/*
+  configure.php, v 1.0 09/06/2005
+
+  Copyright (c) 2005 POSTOSC.COM
+
+  Released under the GNU General Public License
+
+  Absolutely no warranty. Use at your own risk.
+*/
+
+$include_path = ini_get('include_path'); 
+$paths = explode(PATH_SEPARATOR, $include_path); 
+$pear_path = dirname(__FILE__);
+
+if(!in_array($pear_path, $paths)) {
+  ini_set('include_path', $pear_path . PATH_SEPARATOR . $include_path);
+}
+
+?>

Added: trunk/direct.openmoko.com/popup_affiliate_help.php
===================================================================
--- trunk/direct.openmoko.com/popup_affiliate_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/popup_affiliate_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,94 @@
+<?php
+/*
+  $Id: popup_affiliate_help.php,v 1.1.1.1 2004/03/04 23:38:01 ccwjr Exp $
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (in_array('remove_current_page',get_class_methods($navigation)) ) $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_POPUP_AFFILIATE_HELP);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo STORE_NAME; ?></title>
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . HEADING_SUMMARY_HELP . '<font color="' . $font_color . '">');
+
+  new infoBoxHeading($info_box_contents, false, false);
+  $info_box_contents = array();
+    switch ($HTTP_GET_VARS['action']) {
+
+      case '1':
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_IMPRESSIONS_HELP);
+      break;
+
+      case '2':
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_VISITS_HELP);
+      break;
+
+      case '3':
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_TRANSACTIONS_HELP);
+      break;
+
+      case '4':
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_CONVERSION_HELP);
+      break;
+
+      case '5':
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_AMOUNT_HELP);
+      break;
+
+      case '6':
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_AVERAGE_HELP);
+      break;
+
+      case '7':
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_COMMISSION_RATE_HELP);
+      break;
+
+      case '8':
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_COMMISSION_HELP);
+      break;
+    }
+  new infoBox($info_box_contents);
+ $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoBoxFooter($info_box_contents, false, false);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/popup_coupon_help.php
===================================================================
--- trunk/direct.openmoko.com/popup_coupon_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/popup_coupon_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+<?php
+/*
+  $Id: popup_coupon_help.php,v 1.1.1.1 2004/03/04 23:38:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_POPUP_COUPON_HELP);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo STORE_NAME; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+// v5.13: security flaw fixed in query
+  $coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_id = '" . intval($HTTP_GET_VARS['cID']) . "'");
+  $coupon = tep_db_fetch_array($coupon_query);
+  $coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . (int)$HTTP_GET_VARS['cID'] . "' and language_id = '" . (int)$languages_id . "'");
+  $coupon_desc = tep_db_fetch_array($coupon_desc_query);
+  $text_coupon_help = TEXT_COUPON_HELP_HEADER;
+  $text_coupon_help .= sprintf(TEXT_COUPON_HELP_NAME, $coupon_desc['coupon_name']);
+  if (tep_not_null($coupon_desc['coupon_description'])) $text_coupon_help .= sprintf(TEXT_COUPON_HELP_DESC, $coupon_desc['coupon_description']);
+  $coupon_amount = $coupon['coupon_amount'];
+  switch ($coupon['coupon_type']) {
+    case 'F':
+    $text_coupon_help .= sprintf(TEXT_COUPON_HELP_FIXED, $currencies->format($coupon['coupon_amount']));
+    break;
+    case 'P':
+    $text_coupon_help .= sprintf(TEXT_COUPON_HELP_FIXED, number_format($coupon['coupon_amount'],2). '%');
+    break;
+    case 'S':
+    $text_coupon_help .= TEXT_COUPON_HELP_FREESHIP;
+    break;
+    default:
+  }
+  if ($coupon['coupon_minimum_order'] > 0 ) $text_coupon_help .= sprintf(TEXT_COUPON_HELP_MINORDER, $currencies->format($coupon['coupon_minimum_order']));
+  $text_coupon_help .= sprintf(TEXT_COUPON_HELP_DATE, tep_date_short($coupon['coupon_start_date']),tep_date_short($coupon['coupon_expire_date']));
+  $text_coupon_help .= '<b>' . TEXT_COUPON_HELP_RESTRICT . '</b>';
+  $text_coupon_help .= '<br><br>' .  TEXT_COUPON_HELP_CATEGORIES;
+  $coupon_get=tep_db_query("select restrict_to_categories from " . TABLE_COUPONS . " where coupon_id='".(int)$HTTP_GET_VARS['cID']."'");
+  $get_result=tep_db_fetch_array($coupon_get);
+
+  $cat_ids = split("[,]", $get_result['restrict_to_categories']);
+  for ($i = 0; $i < count($cat_ids); $i++) {
+    $result = tep_db_query("SELECT * FROM categories, categories_description WHERE categories.categories_id = categories_description.categories_id and categories_description.language_id = '" . (int)$languages_id . "' and categories.categories_id='" . $cat_ids[$i] . "'");
+    if ($row = tep_db_fetch_array($result)) {
+    $cats .= '<br>' . $row["categories_name"];
+    }
+  }
+  if ($cats=='') $cats = '<br>'.TEXT_NONE;
+  $text_coupon_help .= $cats;
+  $text_coupon_help .= '<br><br>' .  TEXT_COUPON_HELP_PRODUCTS;
+  $coupon_get=tep_db_query("select restrict_to_products from " . TABLE_COUPONS . "  where coupon_id='".(int)$HTTP_GET_VARS['cID']."'");
+  $get_result=tep_db_fetch_array($coupon_get);
+
+  $pr_ids = split("[,]", $get_result['restrict_to_products']);
+  for ($i = 0; $i < count($pr_ids); $i++) {
+    $result = tep_db_query("SELECT * FROM products, products_description WHERE products.products_id = products_description.products_id and products_description.language_id = '" . (int)$languages_id . "'and products.products_id = '" . $pr_ids[$i] . "'");
+    if ($row = tep_db_fetch_array($result)) {
+      $prods .= '<br>' . $row["products_name"];
+    }
+  }
+  if ($prods=='') $prods = '<br>'.TEXT_NONE;
+  $text_coupon_help .= $prods;
+
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => '<font color="' . $font_color . '">' . HEADING_COUPON_HELP . '<font color="' . $font_color . '">');
+
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $text_coupon_help);
+
+  new infoBox($info_box_contents);
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+    new infoBoxFooter($info_box_contents, false, false);
+
+
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/popup_cvs_help.php
===================================================================
--- trunk/direct.openmoko.com/popup_cvs_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/popup_cvs_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+// this file was created by Clifton Murphy <blue_glowstick at yahoo.com>
+// using code supplied in a previous release by Thomas Nordstrom <t_nordstrom at yahoo.com>
+// I take no credit for any of this work. I simply fixed this file and 
+// recompiled the distribution zip file with the fixes to prevent parse errors.
+/*
+  $Id: cvs_help.php,v 1.3 2004/02/4 07:28:00 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+  require('includes/application_top.php');
+
+  $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CVS_HELP);
+?>
+

Added: trunk/direct.openmoko.com/popup_image.php
===================================================================
--- trunk/direct.openmoko.com/popup_image.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/popup_image.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: popup_image.php,v 1.1.1.1 2004/03/04 23:38:01 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_POPUP_IMAGE);
+
+  $navigation->remove_current_page();
+
+  $products_query = tep_db_query("select p.products_image, p.products_image_lrg, p.products_image_xl_1, p.products_image_xl_2, p.products_image_xl_3, p.products_image_xl_4, p.products_image_xl_5, p.products_image_xl_6, pd.products_name from " . TABLE_PRODUCTS . " p,  " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
+  $products = tep_db_fetch_array($products_query);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo $products['products_name']; ?></title>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<script type="text/javascript"><!--
+var i=0;
+var s=0;
+function resize() {
+   if (navigator.appName == 'Netscape') i=40;
+     if (window.navigator.userAgent.indexOf("SV1") != -1) s=20; //This browser is Internet Explorer in SP2.
+      if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i+s);
+      self.focus();
+    if (document.images[0]) {
+    imgHeight = document.images[0].height+120-i;
+    imgWidth = document.images[0].width+30;
+    var height = screen.height;
+    var width = screen.width;
+    var leftpos = width / 2 - imgWidth / 2;
+    var toppos = height / 2 - imgHeight / 2; 
+    window.moveTo(leftpos, toppos);  
+    window.resizeTo(imgWidth, imgHeight);
+  }
+}
+//--></script>
+</head>
+<body onload="resize();">
+<a href="javascript:;" onclick="javascript:top.window.close();"> 
+<?php
+           if (($HTTP_GET_VARS['image'] ==0) && ($products['products_image_lrg'] != '')) {
+     echo tep_image(DIR_WS_IMAGES . $products['products_image_lrg'], $products['products_name']);
+     } elseif ($HTTP_GET_VARS['image'] ==1) {
+     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_1'], $products['products_name']);
+     } elseif ($HTTP_GET_VARS['image'] ==2) {
+     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_2'], $products['products_name']);
+     } elseif ($HTTP_GET_VARS['image'] ==3) {
+     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_3'], $products['products_name']);
+     } elseif ($HTTP_GET_VARS['image'] ==4) {
+     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_4'], $products['products_name']);
+     } elseif ($HTTP_GET_VARS['image'] ==5) {
+     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_5'], $products['products_name']);
+     } elseif ($HTTP_GET_VARS['image'] ==6) {
+     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_6'], $products['products_name']);
+     } else
+     echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']);
+     ?>
+     <?php echo  TEXT_CLOSE_WINDOW ;?>
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/popup_links_help.php
===================================================================
--- trunk/direct.openmoko.com/popup_links_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/popup_links_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: popup_links_help.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LINKS_SUBMIT);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo STORE_NAME; ?></title>
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' =>  '<font color="' . $font_color . '">' . HEADING_LINKS_HELP . '<font color="' . $font_color . '">');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_LINKS_HELP);
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+    new infoBoxFooter($info_box_contents, false, false);
+
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/popup_paypal.php
===================================================================
--- trunk/direct.openmoko.com/popup_paypal.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/popup_paypal.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: popup_paypal.php,v 2.8 2004/09/11 devosc Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  DevosC, Developing open source Code
+  http://www.devosc.com
+
+  Copyright (c) 2003 osCommerce
+  Copyright (c) 2004 DevosC.com
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/modules/payment/paypal/classes/Page/Page.class.php');
+  $page = new PayPal_Page();
+  $page->setBaseDirectory('includes/modules/payment/paypal/');
+
+  $action = (isset($HTTP_GET_VARS['action'])) ? $HTTP_GET_VARS['action'] : '';
+
+  switch($action) {
+    case 'css':
+      header("Content-Type: text/css");
+      echo $page->getCSS($HTTP_GET_VARS['id']);
+      exit;
+      break;
+  }
+
+  require("includes/application_top.php");
+
+  $navigation->remove_current_page();
+
+  $page->setBaseURL(DIR_WS_MODULES . 'payment/paypal/');
+  $page->addCSS('popup_paypal.php?action=css&id=general');
+  $page->addCSS('popup_paypal.php?action=css&id=stylesheet');
+
+  switch($action) {
+    default:
+      $page->setContentLangaugeFile($page->baseDirectory.'catalog/languages',$language,'info_cc.inc.php');
+      $page->setTemplate('osC_Catalog');
+      break;
+  }
+  require($page->template());
+  require("includes/counter.php");
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/popup_search_help.php
===================================================================
--- trunk/direct.openmoko.com/popup_search_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/popup_search_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: popup_search_help.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo STORE_NAME; ?></title>
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' =>  '<font color="' . $font_color . '">' . HEADING_SEARCH_HELP . '<font color="' . $font_color . '">');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_SEARCH_HELP);
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+    new infoBoxFooter($info_box_contents, false, false);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php
+ require('includes/application_bottom.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/popup_wishlist_help.php
===================================================================
--- trunk/direct.openmoko.com/popup_wishlist_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/popup_wishlist_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+/*
+  $Id: popup_wishlist_help.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WISHLIST_HELP);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo STORE_NAME; ?></title>
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+</head>
+<style type="text/css"><!--
+BODY { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; }
+//--></style>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . HEADING_TITLE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_INFORMATION
+                              );
+  new infoBox($info_box_contents);
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+    new infoBoxFooter($info_box_contents, false, false);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php
+ require('includes/application_bottom.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/print.css
===================================================================
--- trunk/direct.openmoko.com/print.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/print.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+/*
+  $Id: print.css,v 1.3 2003 
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Released under the GNU General Public License
+*/
+
+/* links */
+a:link { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #FF9900; font-weight: normal; }
+a:hover { font-family: Verdana, Arial, sans-serif; font-size: 12px; color: #0000ff; font-weight: bold; }
+
+/* page */
+body { background-color: #ffffff; color: #000000; margin: 0px; }
+.pageHeading { font-family: Verdana, Arial, sans-serif; font-size: 14px; color: #727272; font-weight: bold; }
+
+/* data table */
+.dataTableHeadingRow { background-color: #C9C9C9; }
+.dataTableHeadingContent { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; font-weight: bold; }
+.dataTableRow { background-color: #F0F1F1; }
+.dataTableRowSelected { background-color: #DEE4E8; }
+.dataTableRowOver { background-color: #FFFFFF; }
+.dataTableContent { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; }
+
+/* attributes */
+.attributes-odd { background-color: #f4f7fd; }
+.attributes-even { background-color: #ffffff; }
+
+/* miscellaneous */
+.specialPrice { color: #ff0000; }
+.oldPrice { text-decoration: line-through; }
+.fieldRequired { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ff0000; }
+.smallText { font-family: Verdana, Arial, sans-serif; font-size: 10px; }
+.main { font-family: Verdana, Arial, sans-serif; font-size: 12px; }
+.titleHeading {font-family: Verdana, Arial, sans-serif; font-size: 18px; color: #727272; font-weight: bold;
+}

Added: trunk/direct.openmoko.com/printorder.php
===================================================================
--- trunk/direct.openmoko.com/printorder.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/printorder.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,199 @@
+<?php
+/*
+  $Id: printorder.php,v 1.1 2003/01 xaglo
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ORDERS_PRINTABLE);
+  
+  // get the order so we know what we are working with
+  require(DIR_WS_CLASSES . 'order.php');
+  $order = new order((int)$_GET['order_id']);
+  
+  $authorized = false;
+  if ( tep_session_is_registered('noaccount') && $order->customer['id'] == 0 ){
+    $authorized = true;
+  } else if ( $_SESSION['customer_id'] == $order->customer['id'] ){
+    $authorized = true;
+  } else if ( $_SESSION['customer_id'] == '' ){
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  if ( $authorized ) {
+    $payment_info_query = tep_db_query("select payment_info from " . TABLE_ORDERS . " where orders_id = '". (int)$_GET['order_id'] . "'");
+    $payment_info = tep_db_fetch_array($payment_info_query);
+    $payment_info = $payment_info['payment_info'];
+  }
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo STORE_NAME . ' - ' . TITLE_PRINT_ORDER . ' #' . (int)$_GET['order_id']; ?></title>
+<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="print.css">
+</head>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+
+
+<!-- body_text //-->
+<table width="600" border="0" align="center" cellpadding="2" cellspacing="0">
+  <tr>
+    <td align="center" class="main"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="5">
+      <tr>
+        <td valign="top" align="left" class="main"><script type="text/javascript">
+  if (window.print) {
+    document.write('<a href="javascript:;" onClick="javascript:window.print()" onMouseOut=document.imprim.src="<?php echo (DIR_WS_IMAGES . 'printimage.gif'); ?>" onMouseOver=document.imprim.src="<?php echo (DIR_WS_IMAGES . 'printimage_over.gif'); ?>"><img src="<?php echo (DIR_WS_IMAGES . 'printimage.gif'); ?>" width="43" height="28" align="absbottom" border="0" name="imprim">' + '<?php echo IMAGE_BUTTON_PRINT; ?></a></center>');
+  }
+  else document.write ('<h2><?php echo IMAGE_BUTTON_PRINT; ?></h2>')
+        </script></td>
+        <td align="right" valign="bottom" class="main"><p align="right" class="main"><a href="javascript:window.close();"><img src='images/close_window.jpg' border=0></a></p></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr align="left">
+    <td class="titleHeading"><?php echo tep_draw_separator('pixel_trans.gif', '1', '25'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" align="center" width="75%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . STORE_LOGO, STORE_NAME); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2" align="center" class="titleHeading"><b><?php echo TITLE_PRINT_ORDER . ' #' . (int)$_GET['order_id']; ?></b></td>
+          </tr>
+          <tr align="left">
+            <td colspan="2" class="titleHeading"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+if ( $authorized ) {
+?>
+  <tr>
+    <td align="left" class="main"><table width="100%" border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="main"><?php echo '<b>' . ENTRY_PAYMENT_METHOD . '</b> ' . $order->info['payment_method']; ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo $payment_info; ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td class="main"><?php echo '<b>' . ENTRY_DATE_PURCHASED . '</b> ' . $order->info['date_purchased']; ?></td>
+  </tr>
+  <tr>
+    <td align="center"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor=#000000>
+          <tr>
+            <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '&nbsp;', '<br>'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+        <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor=#000000>
+          <tr>
+            <td align="center" valign="top"><table align="center" width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr class="dataTableHeadingRow">
+                <td class="dataTableHeadingContent"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
+              </tr>
+              <tr class="dataTableRow">
+                <td class="dataTableContent"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '&nbsp;', '<br>'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="1" bgcolor=#000000>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr class="dataTableHeadingRow">
+            <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
+            <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>
+            <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>
+          </tr>
+        <?php
+    for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
+      echo '      <tr class="dataTableRow">' . "\n" .
+           '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
+           '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'] . '<br>';
+
+    if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
+      for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+        echo '<nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i><br></small></nobr>';
+      }
+    }
+
+      echo '        </td>' . "\n" .
+           '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";
+      echo '        <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .
+           '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
+           '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
+           '        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
+      echo '      </tr>' . "\n";
+    }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td align="right" colspan="7"><table border="0" cellspacing="0" cellpadding="2">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <?php
+  for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
+    echo '          <tr>' . "\n" .
+         '            <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .
+         '            <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .
+         '          </tr>' . "\n";
+  }
+?>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+<?php
+} else {
+?>
+  <tr>
+    <td align="left" class="main"><?php echo ENTRY_ACCESS_ERROR; ?></td>
+  </tr>
+<?php
+}
+?>
+</table>
+<!-- body_text_eof //-->
+</body>
+</html>
+<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/product_info.php
===================================================================
--- trunk/direct.openmoko.com/product_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/product_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: product_info.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
+
+  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
+  $product_check = tep_db_fetch_array($product_check_query);
+
+//check if product is really a subproduct
+  $product_sub_product_query = tep_db_query("select products_parent_id from " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+  while ($product_sub_product = tep_db_fetch_array($product_sub_product_query)){
+  $product_sub_check = $product_sub_product['products_parent_id'];
+  }
+
+  if ($product_sub_check > 0){
+   tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_sub_check,'SSL'));
+  }
+//check to see if products have sub_products
+$product_has_sub = '0';
+$sub_products_sql1 = tep_db_query("select p.products_id, p.products_price, p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_parent_id = " . (int)$HTTP_GET_VARS['products_id'] . " and p.products_quantity > '0' and p.products_id = pd.products_id and pd.language_id = " . (int)$languages_id);
+if (tep_db_num_rows($sub_products_sql1) > 0) {
+$product_has_sub = '1';
+}else{
+$product_has_sub = '0';
+}
+
+  $content = CONTENT_PRODUCT_INFO;
+  $javascript = 'popup_window.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/product_info_configureable.php
===================================================================
--- trunk/direct.openmoko.com/product_info_configureable.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/product_info_configureable.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: product_info.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
+
+  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
+  $product_check = tep_db_fetch_array($product_check_query);
+
+//check if product is really a subproduct
+  $product_sub_product_query = tep_db_query("select products_parent_id from " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+  while ($product_sub_product = tep_db_fetch_array($product_sub_product_query)){
+  $product_sub_check = $product_sub_product['products_parent_id'];
+  }
+
+  if ($product_sub_check > 0){
+   tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_sub_check));
+  }
+//check to see if products have sub_products
+$product_has_sub = '0';
+$sub_products_sql1 = tep_db_query("select p.products_id, p.products_price, p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_parent_id = " . (int)$HTTP_GET_VARS['products_id'] . " and p.products_quantity > '0' and p.products_id = pd.products_id and pd.language_id = " . (int)$languages_id);
+if (tep_db_num_rows($sub_products_sql1) > 0) {
+$product_has_sub = '1';
+}else{
+$product_has_sub = '0';
+}
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
+// EOF MaxiDVD: Modified For Ultimate Images Pack!
+    $product_info = tep_db_fetch_array($product_info_query);
+
+    tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
+
+    if (tep_not_null($product_info['products_model'])) {
+      $products_name = $product_info['products_name'] . '&nbsp;<span class="smallText">[' . $product_info['products_model'] . ']</span>';
+    } else {
+      $products_name = $product_info['products_name'];
+    }
+  
+   // Extra Products Fields are checked and presented
+    // START: Extra Fields Contribution  DMG
+    $extra_fields_query = tep_db_query("SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
+                                        FROM ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf,
+                                             ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
+                                        WHERE ptf.products_id='".(int)$HTTP_GET_VARS['products_id']."' 
+                                          and ptf.products_extra_fields_value <> ''
+                                          and ptf.products_extra_fields_id = pef.products_extra_fields_id
+                                          and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
+                                        ORDER BY products_extra_fields_order");
+
+
+  $content = CONTENT_PRODUCT_INFO;
+  $javascript = 'popup_window.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/product_reviews.php
===================================================================
--- trunk/direct.openmoko.com/product_reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/product_reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: product_reviews.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
+  if (!tep_db_num_rows($product_info_query)) {
+    tep_redirect(tep_href_link(FILENAME_REVIEWS));
+  } else {
+    $product_info = tep_db_fetch_array($product_info_query);
+  }
+// Eversun mod for sppc and qty price breaks
+// global variable (session) $sppc_customer_group_id -> local variable customer_group_id
+
+  if(!tep_session_is_registered('sppc_customer_group_id')) {
+  $customer_group_id = '0';
+  } else {
+   $customer_group_id = $sppc_customer_group_id;
+  }
+
+     if ($customer_group_id !='0') {
+  $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_group_id =  '" . $customer_group_id . "'");
+    if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
+      $product_info['products_price'] = $customer_group_price['customers_group_price'];
+    }
+     }
+// Eversun mod for sppc and qty price breaks
+  if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
+    $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
+  } else {
+    $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
+  }
+
+  if (tep_not_null($product_info['products_model'])) {
+    $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
+  } else {
+    $products_name = $product_info['products_name'];
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()));
+
+  $content = CONTENT_PRODUCT_REVIEWS;
+  $javascript = 'popup_window.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/product_reviews_info.php
===================================================================
--- trunk/direct.openmoko.com/product_reviews_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/product_reviews_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+  $Id: product_reviews_info.php,v 1.2 2004/03/05 00:36:41 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+ // Eversun mod for sppc and qty price breaks
+// global variable (session) $sppc_customer_group_id -> local variable customer_group_id
+
+  if(!tep_session_is_registered('sppc_customer_group_id')) {
+  $customer_group_id = '0';
+  } else {
+   $customer_group_id = $sppc_customer_group_id;
+  }
+// Eversun mod end for sppc and qty price breaks
+
+  if (isset($HTTP_GET_VARS['reviews_id']) && tep_not_null($HTTP_GET_VARS['reviews_id']) && isset($HTTP_GET_VARS['products_id']) && tep_not_null($HTTP_GET_VARS['products_id'])) {
+    $review_check_query = tep_db_query("select count(*) as total from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "' and r.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "'");
+    $review_check = tep_db_fetch_array($review_check_query);
+    
+    if ($review_check['total'] < 1) {
+      tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('reviews_id'))));
+    }
+  } else {
+    tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('reviews_id'))));
+  }
+
+  tep_db_query("update " . TABLE_REVIEWS . " set reviews_read = reviews_read+1 where reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "'");
+
+  $review_query = tep_db_query("select rd.reviews_text, r.reviews_rating, r.reviews_id, r.customers_name, r.date_added, r.reviews_read, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where r.reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.products_id = p.products_id and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '". (int)$languages_id . "'");
+  $reviews_info = tep_db_fetch_array($review_query);
+// Eversun mod for sppc and qty price breaks
+  if(!tep_session_is_registered('sppc_customer_group_id')) {
+  $customer_group_id = '0';
+  } else {
+   $customer_group_id = $sppc_customer_group_id;
+  }
+
+     if ($customer_group_id !='0') {
+  $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $review['products_id'] . "' and customers_group_id =  '" . $customer_group_id . "'");
+    if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
+      $review['products_price'] = $customer_group_price['customers_group_price'];
+    }
+     }
+// Eversun end mod for sppc and qty price breaks
+  if ($new_price = tep_get_products_special_price($reviews_info['products_id'])) {
+    $products_price = '<s>' . $currencies->display_price($reviews_info['products_price'], tep_get_tax_rate($reviews_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($reviews_info['products_tax_class_id'])) . '</span>';
+  } else {
+    $products_price = $currencies->display_price($reviews_info['products_price'], tep_get_tax_rate($reviews_info['products_tax_class_id']));
+  }
+
+  if (tep_not_null($reviews_info['products_model'])) {
+    $products_name = $reviews_info['products_name'] . '<br><span class="smallText">[' . $reviews_info['products_model'] . ']</span>';
+  } else {
+    $products_name = $reviews_info['products_name'];
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS_INFO);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()));
+
+  $content = CONTENT_PRODUCT_REVIEWS_INFO;
+  $javascript = 'popup_window.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/product_reviews_write.php
===================================================================
--- trunk/direct.openmoko.com/product_reviews_write.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/product_reviews_write.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+<?php
+/*
+  $Id: product_reviews_write.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+
+  $product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
+  if (!tep_db_num_rows($product_info_query)) {
+    tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('action'))));
+  } else {
+    $product_info = tep_db_fetch_array($product_info_query);
+  }
+
+  $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+  $customer = tep_db_fetch_array($customer_query);
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
+    $rating = tep_db_prepare_input($HTTP_POST_VARS['rating']);
+    $review = tep_db_prepare_input($HTTP_POST_VARS['review']);
+
+    $error = false;
+    if (strlen($review) < REVIEW_TEXT_MIN_LENGTH) {
+      $error = true;
+
+      $messageStack->add('review', JS_REVIEW_TEXT);
+    }
+
+    if (($rating < 1) || ($rating > 5)) {
+      $error = true;
+
+      $messageStack->add('review', JS_REVIEW_RATING);
+    }
+
+    if ($error == false) {
+      tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int)$HTTP_GET_VARS['products_id'] . "', '" . (int)$customer_id . "', '" . tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']) . "', '" . tep_db_input($rating) . "', now())");
+      $insert_id = tep_db_insert_id();
+
+      tep_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($review) . "')");
+
+      tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('action'))));
+    }
+  }
+// Eversun mod for sppc and qty price breaks
+  if(!tep_session_is_registered('sppc_customer_group_id')) {
+  $customer_group_id = '0';
+  } else {
+   $customer_group_id = $sppc_customer_group_id;
+  }
+
+     if ($customer_group_id !='0') {
+  $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_group_id =  '" . $customer_group_id . "'");
+    if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
+      $product_info['products_price'] = $customer_group_price['customers_group_price'];
+    }
+     }
+// Eversun mod for sppc and qty price breaks
+  if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
+    $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
+  } else {
+    $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
+  }
+
+  if (tep_not_null($product_info['products_model'])) {
+    $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
+  } else {
+    $products_name = $product_info['products_name'];
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS_WRITE);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()));
+
+  $content = CONTENT_PRODUCT_REVIEWS_WRITE;
+  $javascript = $content . '.js';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/products_new.php
===================================================================
--- trunk/direct.openmoko.com/products_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/products_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,144 @@
+<?php
+/*
+  $Id: products_new.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+
+this file gets all the reaw data needed by product_listing and product_listing_column to build
+the display
+  
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);
+    // Eversun mod for sppc and qty price breaks
+       if(!tep_session_is_registered('sppc_customer_group_id')) {
+         $customer_group_id = 'G';
+         } else {
+          $customer_group_id = $sppc_customer_group_id;
+       }
+
+    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
+                         'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
+                         'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
+                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
+                         'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
+                         'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
+                         'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
+                         'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
+
+    asort($define_list);
+
+    $column_list = array();
+    reset($define_list);
+    while (list($key, $value) = each($define_list)) {
+      if ($value > 0) $column_list[] = $key;
+    }
+
+       // find out if sorting by price has been requested
+       if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
+        $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+        if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
+          $status_need_to_get_prices = true;
+          }
+       }
+ if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    }
+
+        $select_column_list = '';
+    
+    $listing_sql .= ' order by ';    
+        for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+          switch ($column_list[$i]) {
+            case 'PRODUCT_LIST_MODEL':
+              $select_column_list .= 'p.products_model, ';
+              break;
+            case 'PRODUCT_LIST_NAME':
+              $select_column_list .= 'pd.products_name, ';
+              break;
+            case 'PRODUCT_LIST_MANUFACTURER':
+              $select_column_list .= 'm.manufacturers_name, ';
+              break;
+            case 'PRODUCT_LIST_QUANTITY':
+              $select_column_list .= 'p.products_quantity, ';
+              break;
+            case 'PRODUCT_LIST_IMAGE':
+              $select_column_list .= 'p.products_image, ';
+              break;
+            case 'PRODUCT_LIST_WEIGHT':
+              $select_column_list .= 'p.products_weight, ';
+              break;
+             }
+    }
+   
+    // We show them all
+   // either retail or no need to get correct special prices
+          $listing_sql = "select distinct " . $select_column_list . "  
+                          p.products_id,
+                          p.products_price as final_price,
+                          p.products_tax_class_id,
+                          p.products_image 
+                        from (" . TABLE_PRODUCTS . " p 
+                        left join " . TABLE_SPECIALS . " s using(products_id)),
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd
+                         where 
+                         p.products_status = '1' 
+                         and pd.products_id = p.products_id
+                         and pd.language_id = '" . (int)$languages_id . "' 
+                         and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added";  
+ 
+//   }     
+ if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+   //   $sort = ;
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    
+    $listing_sql .= ' order by ';
+    switch ($sort_column) {
+      case 'PRODUCT_LIST_MODEL':
+        $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $listing_sql .= "pd.products_name";
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      }
+   }
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));
+
+  $content = CONTENT_PRODUCTS_NEW;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/pub/.htaccess
===================================================================
--- trunk/direct.openmoko.com/pub/.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pub/.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,2 @@
+  Options +FollowSymLinks -Indexes
+

Added: trunk/direct.openmoko.com/pw.php
===================================================================
--- trunk/direct.openmoko.com/pw.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/pw.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,311 @@
+<?php
+/*
+  $Id: index.php,v 1.2 2004/03/09 19:56:29 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// the following cPath references come from application_top.php
+  $category_depth = 'top';
+  if (isset($cPath) && tep_not_null($cPath)) {
+    $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
+    $cateqories_products = tep_db_fetch_array($categories_products_query);
+    if ($cateqories_products['total'] > 0) {
+      $category_depth = 'products'; // display products
+    } else {
+      $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
+      $category_parent = tep_db_fetch_array($category_parent_query);
+      if ($category_parent['total'] > 0) {
+        $category_depth = 'nested'; // navigate through the categories
+      } else {
+        $category_depth = 'products'; // category has no products, but display the 'no products' message
+      }
+    }
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PW);
+
+  if ($category_depth == 'nested') {
+//Code change for Categories Description 1.5
+//    $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
+//Changed to the following
+    $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
+//End Categories Description 1.5
+
+    $category = tep_db_fetch_array($category_query);
+
+    $content = CONTENT_INDEX_NESTED;
+
+  } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
+// create column list
+    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
+                         'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
+                         'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
+                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
+                         'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
+                         'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
+                         'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
+                         'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
+
+    asort($define_list);
+
+    $column_list = array();
+    reset($define_list);
+    while (list($key, $value) = each($define_list)) {
+      if ($value > 0) $column_list[] = $key;
+    }
+// Eversun mod for sppc and qty price breaks
+   if(!tep_session_is_registered('sppc_customer_group_id')) {
+     $customer_group_id = '0';
+     } else {
+      $customer_group_id = $sppc_customer_group_id;
+   }
+   // this will build the table with specials prices for the retail group or update it if needed
+   // this function should have been added to includes/functions/database.php
+   if ($customer_group_id == '0') {
+     tep_db_check_age_specials_retail_table();
+   }
+   $status_product_prices_table = false;
+   $status_need_to_get_prices = false;
+
+   // find out if sorting by price has been requested
+   if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
+    $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+    if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
+      $status_need_to_get_prices = true;
+      }
+   }
+
+   if ($status_need_to_get_prices == true && $customer_group_id != '0') {
+     $product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;
+   // the table with product prices for a particular customer group is re-built only a number of times per hour
+   // (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)
+   // to trigger the update the next function is called (new function that should have been
+   // added to includes/functions/database.php)
+     tep_db_check_age_products_group_prices_cg_table($customer_group_id);
+     $status_product_prices_table = true;
+   } // end if ($status_need_to_get_prices == true && $customer_group_id != '0')
+// Eversun mod end for sppc and qty price breaks
+    $select_column_list = '';
+
+    for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+      switch ($column_list[$i]) {
+        case 'PRODUCT_LIST_MODEL':
+          $select_column_list .= 'p.products_model, ';
+          break;
+        case 'PRODUCT_LIST_NAME':
+          $select_column_list .= 'pd.products_name, ';
+          break;
+        case 'PRODUCT_LIST_MANUFACTURER':
+          $select_column_list .= 'm.manufacturers_name, ';
+          break;
+        case 'PRODUCT_LIST_QUANTITY':
+          $select_column_list .= 'p.products_quantity, ';
+          break;
+        case 'PRODUCT_LIST_IMAGE':
+          $select_column_list .= 'p.products_image, ';
+          break;
+        case 'PRODUCT_LIST_WEIGHT':
+          $select_column_list .= 'p.products_weight, ';
+          break;
+      }
+    }
+ // Get the category name and description
+    $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+
+// show the products of a specified manufacturer
+    if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+
+// We are asked to show only a specific category
+//Eversun mod for sppc and qty price breaks
+
+/*
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
+      } else {
+// We show them all
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+      }
+    } else {
+// show the products in a given categorie
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+// We are asked to show only specific catgeory
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
+      } else {
+// We show them all
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
+    */
+      
+    if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
+    } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
+    } // end else { // either retail...
+    } else {
+// We show them all
+        if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m
+                      where p.products_status = '1'
+                        and pd.products_id = p.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+    } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m
+                      where p.products_status = '1'
+                        and pd.products_id = p.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+    } // end else { // either retail...
+    }
+  } else {
+// show the products in a given categorie
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+// We are asked to show only specific catgeory;
+        if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+        } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p 
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+        } // end else { // either retail...
+      } else {
+// We show them all
+        if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id))
+                      left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id,
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+        } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id))
+                      left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id,
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+    } // end else { // either retail...
+// Eversun mod for sppc and qty price breaks
+      }
+    }
+
+    if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    }
+    $listing_sql .= ' order by ';
+    switch ($sort_column) {
+      case 'PRODUCT_LIST_MODEL':
+        $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $listing_sql .= "pd.products_name";
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      }
+
+    $content = CONTENT_INDEX_PRODUCTS;
+
+  } else { // default page
+
+    $content = CONTENT_PW;
+
+  }
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/redirect.php
===================================================================
--- trunk/direct.openmoko.com/redirect.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/redirect.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,79 @@
+<?php
+/*
+  $Id: redirect.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  switch ($HTTP_GET_VARS['action']) {
+    case 'banner':
+      $banner_query = tep_db_query("select banners_url from " . TABLE_BANNERS . " where banners_id = '" . (int)$HTTP_GET_VARS['goto'] . "'");
+      if (tep_db_num_rows($banner_query)) {
+        $banner = tep_db_fetch_array($banner_query);
+        tep_update_banner_click_count($HTTP_GET_VARS['goto']);
+
+        tep_redirect($banner['banners_url']);
+      }
+      break;
+
+    case 'url':
+      if (isset($HTTP_GET_VARS['goto']) && tep_not_null($HTTP_GET_VARS['goto'])) {
+        $check_query = tep_db_query("select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_url = '" . tep_db_input($HTTP_GET_VARS['goto']) . "' limit 1");
+        if (tep_db_num_rows($check_query)) {
+        tep_redirect('http://' . $HTTP_GET_VARS['goto']);
+        }
+      }
+      break;
+
+    case 'manufacturer':
+      if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
+        $manufacturer_query = tep_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int)$languages_id . "'");
+        if (tep_db_num_rows($manufacturer_query)) {
+// url exists in selected language
+          $manufacturer = tep_db_fetch_array($manufacturer_query);
+
+          if (tep_not_null($manufacturer['manufacturers_url'])) {
+            tep_db_query("update " . TABLE_MANUFACTURERS_INFO . " set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int)$languages_id . "'");
+
+            tep_redirect($manufacturer['manufacturers_url']);
+          }
+        } else {
+// no url exists for the selected language, lets use the default language then
+          $manufacturer_query = tep_db_query("select mi.languages_id, mi.manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " mi, " . TABLE_LANGUAGES . " l where mi.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and mi.languages_id = l.languages_id and l.code = '" . DEFAULT_LANGUAGE . "'");
+          if (tep_db_num_rows($manufacturer_query)) {
+            $manufacturer = tep_db_fetch_array($manufacturer_query);
+
+            if (tep_not_null($manufacturer['manufacturers_url'])) {
+              tep_db_query("update " . TABLE_MANUFACTURERS_INFO . " set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int)$manufacturer['languages_id'] . "'");
+
+              tep_redirect($manufacturer['manufacturers_url']);
+            }
+          }
+        }
+      }
+      break;
+
+// VJ Links Manager v1.00 begin
+    case 'links':
+      require(DIR_WS_FUNCTIONS . 'links.php');
+
+      $links_query = tep_db_query("select links_url from " . TABLE_LINKS . " where links_id = '" . (int)$HTTP_GET_VARS['goto'] . "'");
+      if (tep_db_num_rows($links_query)) {
+        $link = tep_db_fetch_array($links_query);
+        tep_update_links_click_count($HTTP_GET_VARS['goto']);
+
+        tep_redirect($link['links_url']);
+      }
+      break;
+// VJ Links Manager v1.00 end
+  }
+
+  tep_redirect(tep_href_link(FILENAME_DEFAULT));
+?>

Added: trunk/direct.openmoko.com/reviews.php
===================================================================
--- trunk/direct.openmoko.com/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_REVIEWS);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_REVIEWS));
+
+  $content = CONTENT_REVIEWS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/robots.txt
===================================================================
--- trunk/direct.openmoko.com/robots.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/robots.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,91 @@
+# CRELoaded Generated Robots.txt
+# Robot Exclusion File -- robots.txt
+# Author:  CRELoaded Team 
+# Last Updated : May 11th 2005
+#enhancements by Ted C
+
+User-Agent: *
+Disallow: /admin/
+Disallow: /download/
+Disallow: /includes/
+Disallow: /temp/
+Disallow: /debug/
+Disallow: /tmp/
+Disallow: /pub/
+Disallow: /templates/
+Disallow: /urchin/
+
+#User-agent: *
+#*Disallow: crawlers.looksmart.com
+
+#Block All Images
+#Disallow: *.gif
+#Disallow: *.jpg
+#Disallow: /*.gif$
+#Disallow: /*.jpg$
+#
+#To block main page due to size from bots
+# Disallow: /index.php
+#
+#To shut down site completely from bots use either
+# Disallow: /
+#
+#If you had search engine friendly URLs on and want to clean them out of the bots
+#Disallow: /default.php/cPath/
+#
+#
+#Block out directories bots don't need to go to
+Disallow: /admin/
+Disallow: /download/
+Disallow: /font/
+Disallow: /includes/
+Disallow: /install/
+Disallow: /tmp/
+Disallow: /templates/
+
+#
+#Block out things that are secure or login oriented
+Disallow: /address_book_process.php
+Disallow: /account.php
+Disallow: /account_edit.php
+Disallow: /account_edit_process.php
+Disallow: /account_history.php
+Disallow: /account_history_info.php
+Disallow: /address_book.php
+Disallow: /checkout_process.php
+Disallow: /advanced_search.php
+Disallow: /advanced_search_result.php
+Disallow: /checkout_address.php
+Disallow: /checkout_confirmation.php
+Disallow: /checkout_payment.php
+Disallow: /checkout_success.php
+Disallow: /conditions.php
+Disallow: /contact_us.php
+Disallow: /create_account.php
+Disallow: /create_account_process.php
+Disallow: /create_account_success.php
+Disallow: /info_shopping_cart.php
+Disallow: /login.php
+Disallow: /logoff.php
+Disallow: /password_forgotten.php
+Disallow: /popup_image.php
+Disallow: /popup_search_help.php
+Disallow: /privacy.php
+Disallow: /product_notifications.php
+Disallow: /product_reviews.php
+Disallow: /product_reviews_info.php
+Disallow: /product_reviews_write.php
+Disallow: /redirect.php
+Disallow: /reviews.php
+Disallow: /shipping.php
+Disallow: /shopping_cart.php
+Disallow: /tell_a_friend.php
+Disallow: /cookie_usage.php
+
+# IF YOU DO NOT WISH TO HAVE THE GOOGLE IMAGE BOT SCAN YOUR DOMAIN FOR IMAGES
+# THEN YOU CAN INCLUDE THE FOLLOWING IN YOUR ROBOTS FILE.
+# I FOUND THAT MY BANDWIDTH USAGE DROPPED BY A MASSIVE AMOUNT AFTER I GOT RID
+# OF THE GOOGLE IMAGE BOT. ALL I HAD WAS IMAGE HUNTERS STEALING PRODUCT SHOTS
+# AND NOT EVEN BROWSING THE SITE.
+#User-agent: Googlebot-Image
+#Disallow: /

Added: trunk/direct.openmoko.com/rss.php
===================================================================
--- trunk/direct.openmoko.com/rss.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/rss.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+/*
+  $Id$
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+  Copyright (c) 2003 Rodolphe Quiedeville <rodolphe at quiedeville.org>
+
+  Author : Rodolphe Quiedeville <rodolphe at quiedeville.org>
+
+  Released under the GNU General Public License
+
+  Usage : call /catalog/rss.php?box=BOX_NAME
+  If no BOX_NAME specified we use whats_new by default
+
+  Remember to define in configure.php :
+
+  define('DIR_WS_RSS', DIR_WS_INCLUDES . 'rss/');
+
+
+  TODO : set channel description correctly
+*/
+
+//header("Content-type: text/plain");
+
+//require('includes/application_top.php');
+
+print '<?xml version="1.0" encoding="iso-8859-1"?>' . "\n";
+print '<rss version="0.91">' . "\n";
+print '  <channel>' . "\n";
+print "    <title>".$latest_news['newsdesk_article_name'] ."</title>\n";
+print "    <source></source>\n";
+print "    <link>".'<a href="http://www.yourdomain.com/">RSS Newsfeeds</a>'."</link>\n";
+print "    <language>en-uk</language>\n\n";
+
+
+require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
+
+if (!strlen($box))
+{
+  $box = "newsdesk_latest";
+}
+
+$file = DIR_WS_RSS . $box . '.php';
+
+if (file_exists($file))
+{
+  require($file); 
+}
+print "  </channel>\n";
+print "</rss>\n";
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/shipping_estimator_popup.php
===================================================================
--- trunk/direct.openmoko.com/shipping_estimator_popup.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/shipping_estimator_popup.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+
+  Shipping Estimator Popup
+
+  Shoppe Enhancement Controller - Copyright (c) 2003 WebMakers.com
+  Linda McGrath - osCommerce at WebMakers.com
+
+*/
+
+  require("includes/application_top.php");
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART);
+
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<title><?php echo SHIPPING_ESTIMATOR_TITLE; ?></title>
+<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<?php  include(DIR_WS_JAVASCRIPT . 'popup_window_shipping.js'); ?>
+</head>
+<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
+
+     <table bgcolor="#FFFFFF" border="0" width="100%" height="100%" cellspacing="3" cellpadding="3" align="center" valign="middle">
+      <tr>
+        <td><?php require(DIR_WS_MODULES . 'shipping_estimator.php'); ?></td>
+      </tr>
+
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+
+      <tr>
+        <td align="center">
+          <table align="right" border="1" cellpadding="6" cellspacing="3">
+            <tr>
+              <td class="ShoppingCartShipping_main"><a href="javascript:window.close()"> <!-- Close Window --><?php echo TEXT_CLOSE_WINDOW;?></a></td>
+            </tr>
+          </table>
+        </td>
+      </tr>
+    </table>
+
+</body>
+</html>

Added: trunk/direct.openmoko.com/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.1.1.1 2004/03/04 23:38:03 ccwjr Exp $
+  
+  Contribution edit by David van der Wel
+  http//www.xlwel.nl
+  
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOP_BY_PRICE, '', 'NONSSL'));
+
+
+
+  $content = CONTENT_SHOP_BY_PRICE;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.1.1.1 2004/03/04 23:38:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+  Shoppe Enhancement Controller - Copyright (c) 2003 WebMakers.com
+  Linda McGrath - osCommerce at WebMakers.com
+*/
+
+  require("includes/application_top.php");
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART));
+// BOF: WebMakers.com Added: Attributes Sorter and Copier and Quantity Controller
+// Validate Cart for checkout
+  $valid_to_checkout= true;
+  $cart->get_products(true);
+  if (!$valid_to_checkout) {
+//    $messageStack->add_session('header', 'Please update your order ...', 'error');
+//    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
+  }
+// EOF: WebMakers.com Added: Attributes Sorter and Copier and Quantity Controller
+
+  $content = CONTENT_SHOPPING_CART;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/specials.php
===================================================================
--- trunk/direct.openmoko.com/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,134 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SPECIALS);
+
+    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
+                         'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
+                         'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
+                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
+                         'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
+                         'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
+                         'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
+                         'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
+
+    asort($define_list);
+
+    $column_list = array();
+    reset($define_list);
+    while (list($key, $value) = each($define_list)) {
+      if ($value > 0) $column_list[] = $key;
+    }
+
+       // find out if sorting by price has been requested
+       if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
+        $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+        if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
+          $status_need_to_get_prices = true;
+          }
+       }
+ if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    }
+
+        $select_column_list = '';
+    
+    $listing_sql .= ' order by ';    
+        for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+          switch ($column_list[$i]) {
+            case 'PRODUCT_LIST_MODEL':
+              $select_column_list .= 'p.products_model, ';
+              break;
+            case 'PRODUCT_LIST_NAME':
+              $select_column_list .= 'pd.products_name, ';
+              break;
+            case 'PRODUCT_LIST_MANUFACTURER':
+              $select_column_list .= 'm.manufacturers_name, ';
+              break;
+            case 'PRODUCT_LIST_QUANTITY':
+              $select_column_list .= 'p.products_quantity, ';
+              break;
+            case 'PRODUCT_LIST_IMAGE':
+              $select_column_list .= 'p.products_image, ';
+              break;
+            case 'PRODUCT_LIST_WEIGHT':
+              $select_column_list .= 'p.products_weight, ';
+              break;
+             }
+    }
+   
+    // We show them all
+   // either retail or no need to get correct special prices
+          $listing_sql = "select distinct " . $select_column_list . "  
+                          p.products_id,
+                          p.products_price,
+                          p.products_tax_class_id,
+                          p.products_image, 
+                          IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, 
+        IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                        from " . TABLE_PRODUCTS . " p, 
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_SPECIALS . " s 
+                        where 
+                         p.products_status = '1' 
+                         and s.products_id = p.products_id 
+                         and pd.products_id = p.products_id
+                         and pd.language_id = '" . $languages_id . "' 
+                         and s.status = '1'";
+                          
+ if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+   //   $sort = ;
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    
+    $listing_sql .= ' order by ';
+    switch ($sort_column) {
+      case 'PRODUCT_LIST_MODEL':
+        $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $listing_sql .= "pd.products_name";
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      }
+   }
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SPECIALS));
+
+  $content = CONTENT_SPECIALS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/ssl_check.php
===================================================================
--- trunk/direct.openmoko.com/ssl_check.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/ssl_check.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+<?php
+/*
+  $Id: ssl_check.php,v 1.1.1.1 2004/03/04 23:38:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SSL_CHECK);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SSL_CHECK));
+
+  $content = CONTENT_SSL_CHECK;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/style.css
===================================================================
--- trunk/direct.openmoko.com/style.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/style.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,323 @@
+html,body {
+	margin: 0px;
+	padding: 0px;
+	background: #FFF;
+}
+
+body {
+	font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 0.75em;
+	color: #333;
+}
+
+h1 {
+	font-size: 1.9em;
+}
+
+h2 {
+	font-size: 1.4em;
+}
+
+h3 {
+	font-size: 1.1em
+}
+
+a {
+	color: #333333;
+	text-decoration: none;
+}
+
+a:hover {
+	color: #FF6600;
+}
+
+img {
+	border: none;
+}
+
+ul {
+	margin: 0 0 0 0.5em;
+	padding: 0 0 0 0;
+	list-style: none;
+}
+
+ul li {
+	background: url(images/list_bullet.png) no-repeat 0 0.5em;
+	padding-left: 0.7em;
+	margin-bottom: 0.4em;
+}
+
+#wrapper {
+	width: 950px;
+	margin: 0px auto;
+}
+
+#header {
+	height: 90px;
+	position: relative;
+}
+
+#site_logo {
+	position: absolute;
+	top: 29px;
+	left: 10px;
+}
+
+/**************/
+/* NAVIGATION */
+/**************/
+
+#main_navigation {
+	float: right;
+	position: absolute;
+	top: 38px;
+	right: 5px;
+}
+
+#main_navigation ul {
+	list-style: none;
+	margin: 0;
+	padding: 0;
+}
+
+#main_navigation ul li {
+	display: inline;
+	margin: 0;
+	padding: 0;
+	background: none;
+}
+
+
+
+#main_navigation a {
+	float: left;
+	display: block;
+	height: 11px;
+	background-position: 50% 0%;
+	background-repeat:no-repeat;
+}
+
+#main_navigation a:hover {
+	background-position: 50% 100%;
+}
+
+#main_navigation a span{
+	display: none;
+}
+
+#main_navigation .selected {
+	background-position: 50% 100%;
+}
+
+
+.nav_home {
+	background-image:url(images/navigation/home.png);
+	width: 58px;
+}
+
+.nav_about {
+	background-image:url(images/navigation/about.png);
+	width: 64px;
+}
+
+.nav_products {
+	background-image:url(images/navigation/products.png);
+	width: 86px;
+}
+
+.nav_developers {
+	background-image:url(images/navigation/developers.png);
+	width: 98px;
+}
+
+.nav_network {
+	background-image:url(images/navigation/network.png);
+	width: 83px;
+}
+
+.nav_press {
+	background-image:url(images/navigation/press.png);
+	width: 58px;
+}
+
+.nav_careers {
+	background-image:url(images/navigation/careers.png);
+	width: 76px;
+}
+
+.nav_contact {
+	background-image:url(images/navigation/contact.png);
+	width: 79px;
+}
+
+/****************/
+/* MIDDLE BLOCK */
+/****************/
+
+#middleblock {
+	background: #080808 url(images/middleblock_tile.png) repeat-x 0% 0%;
+	position: relative;
+	border-bottom: 1px solid #CCCCCC;
+}
+
+#middleblock_inner {
+	background:url(images/middleblock_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_inner2 {
+	background:url(images/middleblock_right.png) no-repeat 100% 0%;
+	min-height: 300px;
+}
+
+#middleblock_container {
+	min-height: 300px;
+}
+
+#middleblock_tabs {
+	margin: 0px;
+	padding: 0px;
+	list-style: none;
+	font-size: 1.1em;
+	display: block;
+
+	position: relative;
+	top: 1px;
+	
+	margin-left: 348px;
+}
+
+#middleblock_tabs li {	
+	display: inline;
+	margin: 0;
+	padding: 0;
+	background: none;
+}
+
+#middleblock_tabs li a {
+	float: left;
+	display: block;
+	font-weight: bold;
+	color: white;
+	text-decoration: none;
+	margin-right: 5px;
+}
+
+#middleblock_tabs li a span {
+	display: block;
+	padding: 0.5em 0.8em 0.5em 0.9em;
+}
+
+#middleblock_tabs li a:hover {
+	color: #FF6600;
+	background:#FFF url(images/middleblock_tabs_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_tabs li a:hover span {
+	background:url(images/middleblock_tabs_right.png) no-repeat 100% 0%;
+}
+
+#middleblock_tabs li .selected {
+	color: #FF6600;
+	background:#FFF url(images/middleblock_tabs_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_tabs li .selected span {
+	background:url(images/middleblock_tabs_right.png) no-repeat 100% 0%;
+}
+
+.main_container {
+	padding-top: 40px;
+	padding-bottom: 40px;
+}
+
+.clear {
+	clear: both;
+}
+
+
+#left_column {
+	width: 303px;
+	padding-left: 45px;
+	float: left;
+}
+
+#left_column h3 {
+	margin: 0 0 1.1em 0;
+	padding: 0;
+}
+
+#right_column {
+	margin-left: 350px;
+}
+
+#footer {	
+	text-align: center;
+	background: #FAFAFA;
+	border-top: 1px solid #CCC;
+	padding: 5em 0 4em 0;
+	margin: 0 0 20px 0;
+	font-size: 0.9em;
+	color: #666666;
+}
+
+#secundary_navigation {
+	margin: 0;
+	padding: 0 0 2em 0;
+	text-transform: uppercase;
+	margin: 0 auto;
+}
+
+#secundary_navigation li {
+	background: none;
+	padding: 0;
+	display: inline;
+	margin: 0 1em;
+}
+
+#secundary_navigation .selected {
+	font-weight: bold;
+	color: #FF6600;
+}
+
+
+
+/***********/
+/* CONTENT */
+/***********/
+
+.content {
+	line-height: 1.5em;
+	padding-bottom: 20px;
+}
+
+.content p {
+	margin: 0;
+	padding: 0.6em 0;
+}
+
+.content ul,
+.content ol {
+	padding: 0.9em 0 0.8em 2em;
+}
+
+.content blockquote {
+	margin: 0;
+	padding: 0.6em 0 0.6em 2em;
+	color: #999;
+}
+
+.content h2 {
+	margin: 0;
+	padding: 0 0 0.5em 0;
+}
+
+.content .title_container {
+	border-bottom: 1px solid #CCCCCC;
+	margin: 0 0 0.7em 0;
+}
+
+.content img {
+	border-right: 1px solid #CCCCCC;
+	float: left;
+	margin: 0 1em 1em 0;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,136 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:38:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_TELL_A_FRIEND);
+  
+//check for valid product
+   $valid_product = "false";
+
+  $tell_products_id = $HTTP_GET_VARS['products_id'];
+
+  if (!tep_session_is_registered('customer_id') && (ALLOW_GUEST_TO_TELL_A_FRIEND == 'false')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  } elseif (tep_session_is_registered('customer_id')) {
+    $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+    $account = tep_db_fetch_array($account_query);
+    $from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
+    $from_email_address = $account['customers_email_address'];
+  }
+
+$product_info_query = tep_db_query("select pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
+    if (tep_db_num_rows($product_info_query)) {
+      $valid_product = "true";
+      $product_info = tep_db_fetch_array($product_info_query);
+    } else{
+     $valid_product = "false";
+  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $tell_products_id));
+   }
+
+//VISUAL VERIFY CODE start  
+  $vccCheckOk="True"; 
+    $code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . tep_session_id() . "'");
+    $code_array = tep_db_fetch_array($code_query);
+    $code = $code_array['code'];
+
+    tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . tep_session_id() . "'"); //remove the visual verify code associated with this session to clean database and ensure new results
+
+    $user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
+    if (!(strcasecmp($user_entered_code, $code) == 0)) {    //make the check case insensitive
+        $error = true;
+        
+    if(($HTTP_GET_VARS['action'] == 'process'))
+    {
+      $messageStack->add('friend', VISUAL_VERIFY_CODE_ENTRY_ERROR);
+    }
+    
+    $vccCheckOk="False";    
+    }
+    
+ 
+if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && $vccCheckOk=="True") 
+  {   
+    $error = "false";
+    $_POST['to_email_address'] = preg_replace( "/\n/", " ", $_POST['to_email_address'] );
+    $_POST['to_name'] = preg_replace( "/\n/", " ", $_POST['to_name'] );
+    $_POST['to_email_address'] = preg_replace( "/\r/", " ", $_POST['to_email_address'] );
+    $_POST['to_name'] = preg_replace( "/\r/", " ", $_POST['to_name'] );
+    $_POST['to_email_address'] = str_replace("Content-Type:","",$_POST['to_email_address']);
+    $_POST['to_name'] = str_replace("Content-Type:","",$_POST['to_name']);
+    
+    $to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']);
+    $to_name = tep_db_prepare_input($HTTP_POST_VARS['to_name']);
+    $from_email_address = tep_db_prepare_input($HTTP_POST_VARS['from_email_address']);
+    $from_name = tep_db_prepare_input($HTTP_POST_VARS['from_name']);
+    $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
+    
+       if (empty($from_name)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_FROM_NAME);
+        }
+
+        if (!tep_validate_email($from_email_address)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_FROM_ADDRESS);
+        }
+    
+        if (empty($to_name)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_TO_NAME);
+        }
+    
+        if (!tep_validate_email($to_email_address)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_TO_ADDRESS);
+        }
+
+  $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
+  $email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $product_info['products_name'], STORE_NAME) . "\n\n";
+      if (tep_not_null($message)) {
+         $email_body .= $message . "\n\n";
+        }
+     if (TELL_PRODUCT_EMAIL_USE_HTML == "false") {
+            $email_body .= TEXT_EMAIL_LINK_TEXT . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?products_id='.$tell_products_id .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?products_id='. $tell_products_id . '</a>' . "\n\n";
+      $email_body .= TEXT_EMAIL_SIGNATURE. STORE_NAME . "\n" . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . '</a>';
+ 
+    }else{ 
+            $email_body .= TEXT_EMAIL_LINK . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?products_id='.$tell_products_id .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?products_id='. $tell_products_id . '</a>' . "\n\n";
+      $email_body .= TEXT_EMAIL_SIGNATURE. STORE_NAME . "\n" . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . '</a>';
+      
+                }
+                
+      $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
+      
+          if (TELL_PRODUCT_EMAIL_USE_HTML == "false") {
+              $mimemessage->add_text($email_body);
+           } else {
+              $mimemessage->add_html($email_body);
+           }                
+  
+            $mimemessage->build_message();
+            $mimemessage->send($to_name, $to_email_address, $from_name, $from_email_address, $email_subject);
+
+      $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info['products_name'], tep_output_string_protected($to_name)), 'success');
+      tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $tell_products_id));
+
+
+}         
+
+    $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $tell_products_id));
+
+  $content = CONTENT_TELL_A_FRIEND;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/tell_a_friend_article.php
===================================================================
--- trunk/direct.openmoko.com/tell_a_friend_article.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/tell_a_friend_article.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,136 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:38:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_TELL_A_FRIEND_ARTICLE);
+  
+//check for valid product
+   $valid_article = "false";
+
+  $tell_articles_id = $HTTP_GET_VARS['articles_id'];
+
+  if (!tep_session_is_registered('customer_id') && (ALLOW_GUEST_TO_TELL_A_FRIEND == 'false')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  } elseif (tep_session_is_registered('customer_id')) {
+    $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+    $account = tep_db_fetch_array($account_query);
+    $from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
+    $from_email_address = $account['customers_email_address'];
+  }
+
+    $article_info_query = tep_db_query("select pd.articles_name from " . TABLE_ARTICLES . " p, " . TABLE_ARTICLES_DESCRIPTION . " pd where p.articles_status = '1' and p.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and p.articles_id = pd.articles_id and pd.language_id = '" . (int)$languages_id . "'");
+    if (tep_db_num_rows($article_info_query)) {
+      $valid_article = "true";
+      $article_info = tep_db_fetch_array($article_info_query);
+    } else {
+     $valid_article = "false";
+ //    tep_redirect(tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $tell_articles_id));
+    }
+
+//VISUAL VERIFY CODE start  
+  $vccCheckOk="True"; 
+    $code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . tep_session_id() . "'");
+    $code_array = tep_db_fetch_array($code_query);
+    $code = $code_array['code'];
+
+    tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . tep_session_id() . "'"); //remove the visual verify code associated with this session to clean database and ensure new results
+
+    $user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
+    if (!(strcasecmp($user_entered_code, $code) == 0)) {    //make the check case insensitive
+        $error = true;
+        
+    if(($HTTP_GET_VARS['action'] == 'process'))
+    {
+      $messageStack->add('friend', VISUAL_VERIFY_CODE_ENTRY_ERROR);
+    }
+    
+    $vccCheckOk="False";    
+    }
+    
+ 
+if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && $vccCheckOk=="True") 
+  {   
+    $error = "false";
+    $_POST['to_email_address'] = preg_replace( "/\n/", " ", $_POST['to_email_address'] );
+    $_POST['to_name'] = preg_replace( "/\n/", " ", $_POST['to_name'] );
+    $_POST['to_email_address'] = preg_replace( "/\r/", " ", $_POST['to_email_address'] );
+    $_POST['to_name'] = preg_replace( "/\r/", " ", $_POST['to_name'] );
+    $_POST['to_email_address'] = str_replace("Content-Type:","",$_POST['to_email_address']);
+    $_POST['to_name'] = str_replace("Content-Type:","",$_POST['to_name']);
+    
+    $to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']);
+    $to_name = tep_db_prepare_input($HTTP_POST_VARS['to_name']);
+    $from_email_address = tep_db_prepare_input($HTTP_POST_VARS['from_email_address']);
+    $from_name = tep_db_prepare_input($HTTP_POST_VARS['from_name']);
+    $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
+    
+       if (empty($from_name)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_FROM_NAME);
+        }
+
+        if (!tep_validate_email($from_email_address)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_FROM_ADDRESS);
+        }
+    
+        if (empty($to_name)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_TO_NAME);
+        }
+    
+        if (!tep_validate_email($to_email_address)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_TO_ADDRESS);
+        }
+
+          $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
+          $email_body_article = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $article_info['articles_name'], STORE_NAME) . "\n\n";
+          if (tep_not_null($message)) {
+            $email_body_article .= $message . "\n\n";
+          }
+     if (TELL_ARTICLE_EMAIL_USE_HTML == 'false') {
+            $email_body_article .= TEXT_EMAIL_LINK_TEXT . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG . FILENAME_ARTICLE_INFO . '?articles_id='.$tell_articles_id .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . FILENAME_ARTICLE_INFO . '?articles_id='. $tell_articles_id . '</a>' . "\n\n";
+      $email_body_article .= TEXT_EMAIL_SIGNATURE. STORE_NAME . "\n" . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . '</a>';
+ 
+    }else{ 
+            $email_body_article .= TEXT_EMAIL_LINK . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG . FILENAME_ARTICLE_INFO . '?articles_id='.$tell_articles_id .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . FILENAME_ARTICLE_INFO . '?articles_id='. $tell_articles_id . '</a>' . "\n\n";
+      $email_body_article .= TEXT_EMAIL_SIGNATURE. STORE_NAME . "\n" . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . '</a>';
+      
+                }
+                
+         $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
+  
+ 
+          if (TELL_ARTICLE_EMAIL_USE_HTML == 'false') {
+              $mimemessage->add_text($email_body_article);
+           } else {
+              $mimemessage->add_html($email_body_article);
+           }                
+  
+            $mimemessage->build_message();
+            $mimemessage->send($to_name, $to_email_address, $from_name, $from_email_address, $email_subject);
+
+  $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $article_info['articles_name'], tep_output_string_protected($to_name)), 'success');  
+    tep_redirect(tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $tell_articles_id));
+ 
+}         
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_TELL_A_FRIEND_ARTICLE, 'articles_id=' . $tell_articles_id));
+
+  $content = CONTENT_TELL_A_FRIEND_ARTICLE;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/temp/.htaccess
===================================================================
--- trunk/direct.openmoko.com/temp/.htaccess	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/temp/.htaccess	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+# $Id: .htaccess,v 1.1.1.1 2004/03/04 23:40:35 ccwjr Exp $
+#
+# This is used with Apache WebServers
+# The following blocks direct HTTP requests in this directory recursively
+#
+# For this to work, you must include the parameter 'Limit' to the AllowOverride configuration
+#
+# Example:
+#
+#<Directory "/usr/local/apache/htdocs">
+#  AllowOverride Limit
+#
+# 'All' with also work. (This configuration is in your apache/conf/httpd.conf file)
+#
+# This does not affect PHP include/require functions
+#
+# Example: http://server/catalog/includes/application_top.php will not work
+
+<Files *.php>
+Order Deny,Allow
+Deny from all
+</Files>

Added: trunk/direct.openmoko.com/temp/delete_me_for_zip_only.txt
===================================================================

Added: trunk/direct.openmoko.com/templates/E-vector/E-vector.sql
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/E-vector.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/E-vector.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#000000');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "Evector.gif", template_cellpadding_main ="0", template_cellpadding_sub= "10", template_cellpadding_left= "5", template_cellpadding_right= "0", site_width= "776", include_column_left= "yes", include_column_right= "yes", box_width_left= "165",box_width_right= "140", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no",show_header_link_buttons="yes", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width= "5", side_box_right_width= "5" WHERE template_id="#tID#"
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/affiliate.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 - 2003 osCommerce
+   
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3386 $
+
+  Released under the GNU General Public License
+*/
+?>          
+<!-- d_affiliate_system //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_AFFILIATE . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (tep_session_is_registered('affiliate_id')) {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . BOX_AFFILIATE_SUMMARY . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, '', 'SSL'). '">' . BOX_AFFILIATE_NEWS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL'). '">' . BOX_AFFILIATE_ACCOUNT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'). '">' . BOX_AFFILIATE_PAYMENT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'). '">' . BOX_AFFILIATE_CLICKRATE . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'). '">' . BOX_AFFILIATE_SALES . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS). '">' . BOX_AFFILIATE_BANNERS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_FAQ). '">' . BOX_AFFILIATE_FAQ . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_LOGOUT). '">' . BOX_AFFILIATE_LOGOUT . '</a>');
+  } else {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_INFO). '">' . BOX_AFFILIATE_INFO . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . BOX_AFFILIATE_LOGIN . '</a>');
+  }
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- affiliate_system_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/articles.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,227 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_topic($counter) {
+    global $tree, $topics_string, $tPath_array;
+
+    for ($i=0; $i<$tree[$counter]['level']; $i++) {
+      $topics_string .= "&nbsp;&nbsp;";
+    }
+
+    $topics_string .= '<a href="';
+
+    if ($tree[$counter]['parent'] == 0) {
+      $tPath_new = 'tPath=' . $counter;
+    } else {
+      $tPath_new = 'tPath=' . $tree[$counter]['path'];
+    }
+
+    $topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '<b>';
+    }
+
+// display topic name
+    $topics_string .= $tree[$counter]['name'];
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '</b>';
+    }
+
+    if (tep_has_topic_subtopics($counter)) {
+      $topics_string .= ' -&gt;';
+    }
+
+    $topics_string .= '</a>';
+
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_in_topic = tep_count_articles_in_topic($counter);
+      if ($articles_in_topic > 0) {
+        $topics_string .= '&nbsp;(' . $articles_in_topic . ')';
+      }
+    }
+
+    $topics_string .= '<br>';
+
+    if ($tree[$counter]['next_id'] != false) {
+      tep_show_topic($tree[$counter]['next_id']);
+    }
+  }
+?>
+<!-- d-Articles //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_ARTICLES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $topics_string = '';
+  $tree = array();
+
+  $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '0' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+  while ($topics = tep_db_fetch_array($topics_query))  {
+    $tree[$topics['topics_id']] = array('name' => $topics['topics_name'],
+                                        'parent' => $topics['parent_id'],
+                                        'level' => 0,
+                                        'path' => $topics['topics_id'],
+                                        'next_id' => false);
+
+    if (isset($parent_id)) {
+      $tree[$parent_id]['next_id'] = $topics['topics_id'];
+    }
+
+    $parent_id = $topics['topics_id'];
+
+    if (!isset($first_topic_element)) {
+      $first_topic_element = $topics['topics_id'];
+    }
+  }
+
+  //------------------------
+  if (tep_not_null($tPath)) {
+    $new_path = '';
+    reset($tPath_array);
+    while (list($key, $value) = each($tPath_array)) {
+      unset($parent_id);
+      unset($first_id);
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$value . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+      if (tep_db_num_rows($topics_query)) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($topics_query)) {
+          $tree[$row['topics_id']] = array('name' => $row['topics_name'],
+                                           'parent' => $row['parent_id'],
+                                           'level' => $key+1,
+                                           'path' => $new_path . '_' . $row['topics_id'],
+                                           'next_id' => false);
+
+          if (isset($parent_id)) {
+            $tree[$parent_id]['next_id'] = $row['topics_id'];
+          }
+
+          $parent_id = $row['topics_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['topics_id'];
+          }
+
+          $last_id = $row['topics_id'];
+        }
+        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
+        $tree[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_topic($first_topic_element);
+
+  $info_box_contents = array();
+  $new_articles_string = '';
+  $all_articles_string = '';
+
+  if (DISPLAY_NEW_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_new_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and(a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = ad.articles_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a2t.topics_id = td.topics_id 
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'
+                                            and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY)");
+      $articles_new_count = ' (' . tep_db_num_rows($articles_new_query) . ')';
+    } else {
+      $articles_new_count = '';
+    }
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string = '<b>';
+    }
+
+    $new_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES_NEW, '', 'NONSSL') . '">' . BOX_NEW_ARTICLES . '</a>';
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string .= '</b>';
+    }
+
+    $new_articles_string .= $articles_new_count . '<br>';
+
+  }
+
+  if (DISPLAY_ALL_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_all_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a.articles_id = ad.articles_id
+                                            and a2t.topics_id = td.topics_id
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'");
+      $articles_all_count = ' (' . tep_db_num_rows($articles_all_query) . ')';
+    } else {
+      $articles_all_count = '';
+    }
+
+    if ($topic_depth == 'top') {
+      $all_articles_string = '<b>';
+    }
+
+    $all_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES, '', 'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a>';
+
+    if ($topic_depth == 'top') {
+      $all_articles_string .= '</b>';
+    }
+
+    $all_articles_string .= $articles_all_count . '<br>';
+
+  }
+
+  $info_box_contents[] = array('text' => $new_articles_string . $all_articles_string . $topics_string);
+
+  new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!-- d-articles_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/asearch.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/asearch.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/asearch.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: asearch.php
+  searches articles using article_manager
+  by AlDaffodil (aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- article search //-->
+          <tr>
+            <td>
+<?php
+ //if (ALLOW_QUICK_SEARCH_DESCRIPTION == 'true') {
+  //  $param = '<input type="hidden" name="search_in_description" value="1">';
+ //  } else {
+      $param = '';
+// }
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_ASEARCH . '</font>');
+     new infoBoxHeading($info_box_contents, false, false);
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find_article" method="get" action="' . tep_href_link(FILENAME_ARTICLE_SEARCH, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . $param . '<input type="text" name="akeywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["akeywords"])) . '">' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><input type="checkbox" name="description">' . BOX_ASEARCH_TEXT . '<br>');
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- article_search //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/authors.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name");
+  if ($number_of_author_rows = tep_db_num_rows($authors_query)) {
+?>
+<!-- authors //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_AUTHORS . '</font>');
+
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_author_rows <= MAX_DISPLAY_AUTHORS_IN_A_LIST) {
+// Display a list
+      $authors_list = '';
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        if (isset($HTTP_GET_VARS['authors_id']) && ($HTTP_GET_VARS['authors_id'] == $authors['authors_id'])) $authors_name = '<b>' . $authors_name .'</b>';
+        $authors_list .= '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $authors['authors_id']) . '">' . $authors_name . '</a><br>';
+      }
+
+      $authors_list = substr($authors_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $authors_list);
+    } else {
+// Display a drop-down
+      $authors_array = array();
+      if (MAX_AUTHORS_LIST < 2) {
+        $authors_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        $authors_array[] = array('id' => $authors['authors_id'],
+                                       'text' => $authors_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('authors', tep_href_link(FILENAME_ARTICLES, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('authors_id', $authors_array, (isset($HTTP_GET_VARS['authors_id']) ? $HTTP_GET_VARS['authors_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_AUTHORS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- authors_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/best_sellers.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/best_sellers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/best_sellers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: best_sellers.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($current_category_id) && ($current_category_id > 0)) {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  } else {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  }
+
+  if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
+?>
+<!-- best_sellers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_BESTSELLERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $rows = 0;
+    $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
+      $rows++;
+      $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
+    }
+    $bestsellers_list .= '</table>';
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => $bestsellers_list);
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- best_sellers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/boxad.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/boxad.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/boxad.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: boxad.php, v 1.1 2002/03/21 by aubrey at mycon.co.za
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+*/
+?>
+<!-- banner-ad-in-a-box //-->
+<?php
+  if ($banner = tep_banner_exists('dynamic', BOX_AD_BANNER_TYPE)) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+<!-- banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/calendar.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<?php
+/*
+$ID
+  ~ events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it 
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2442 $
+
+*/
+
+
+?>
+<!-- events_calendar //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CALENDER . '</font>');
+    new infoBoxHeading($info_box_contents, false, false,tep_href_link(FILENAME_EVENTS_CALENDER));
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'center',
+                                'text' => '<iframe name="calendar" id="calendar" align="center" marginwidth="0" marginheight="0" ' .
+                                          'src=' . FILENAME_EVENTS_CALENDAR_CONTENT . '?_month=' . $_month .'&amp;_year='. $_year .' frameborder=0 height=220 width=162 scrolling=no> '.IFRAME_ERROR.'</iframe> ');
+   
+ 
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- events_calendar //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/card1.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/card1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/card1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+*/
+?>
+<!-- Card Info Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CARD1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+//                               'text'  => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .
+//elari chanegd to provide a link to your payment acount
+                               'text'  => tep_image(DIR_WS_IMAGES . 'cards/logo-xclick_paypal.gif' , BOX_INFORMATION_CARD).
+                               '<br>' . tep_image(DIR_WS_IMAGES . 'cards/cards2.gif', BOX_INFORMATION_CARD) . '<br>'
+                               );
+
+new infoBox($info_box_contents);
+?>
+</td></tr>
+<!-- card_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,165 @@
+<?php
+/*
+  $Id: categories.php,v 1.1.1.1 2004/03/04 23:42:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3380 $
+
+  Released under the GNU General Public License
+*/
+$count=0;
+
+ function tep_show_category($counter,$count) {
+    global $foo, $categories_string, $id;
+
+$count++;
+    if ($count != 1) {
+$image=2;
+$HEIGHT = 20;
+     }else{
+$image=1;
+$HEIGHT = 21;
+}
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+
+    $categories_string .= '<tr><td>';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+    
+    $categories_string .= '<a class="navBlue" href="';
+
+}else{
+    $categories_string .= '&nbsp;';
+if ($foo[$counter]['parent'] != 0) {
+      $class="subnavBlue";
+   } else {
+  $class="navGrey";
+}
+
+if ($foo[$counter]['parent'] != 0) {
+      $categories_string .= '&nbsp;';
+   } else {
+         ;
+}
+    $categories_string .= '<a class="' . $class . '" href="';
+
+}
+
+    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string .= '">';
+// display category name
+      $categories_string .= $foo[$counter]['name'];
+    $categories_string .= '</a>';
+//    $categories_string .= '</td></tr>' ;
+
+
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category($foo[$counter]['next_id'],$count);
+    }
+
+  }
+?>
+<!-- categories //-->
+                  <tr>
+                    <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => '<font color="' . $font_color . '">' .BOX_HEADING_CATEGORIES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+$categories_string = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      $new_path .= $value;
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      while ($row = tep_db_fetch_array($categories_query)) {
+        $foo[$row['categories_id']] = array(
+                                            'name' => $row['categories_name'],
+                                            'parent' => $row['parent_id'],
+                                            'level' => $key+1,
+                                            'path' => $new_path . '_' . $row['categories_id'],
+                                            'next_id' => false
+                                           );
+
+        if (isset($prev_id)) {
+          $foo[$prev_id]['next_id'] = $row['categories_id'];
+        }
+
+        $prev_id = $row['categories_id'];
+
+        if (!isset($first_id)) {
+          $first_id = $row['categories_id'];
+        }
+
+        $last_id = $row['categories_id'];
+      }
+      if ($category_check != 0) {
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+      }
+
+      $new_path .= '_';
+    }
+  }
+
+  tep_show_category($first_element,$count);
+
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text'  => $categories_string
+                              );
+new infobox($info_box_contents);
+
+?>
+                    </td>
+                  </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/categories1.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/categories1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/categories1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- categories1 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(),
+                               'align' => 'left',
+                               'text'  => tep_draw_pull_down_menu('cPath', tep_get_categories(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"')
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- categories1_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/categories2.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/categories2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/categories2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,173 @@
+<?php
+/*
+  $Id: categories2.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+  Released under the GNU General Public License
+*/
+
+//###############################################
+if ( (USE_CACHE == 'true') && !defined('SID')) {
+    echo tep_cache_categories_box();
+  } else {
+//###############################################
+
+
+  function tep_show_category2($counter) {
+    global $foo, $categories_string2, $id;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      $categories_string2 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string2 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string2 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string2 .= '">';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '<b>';
+    }
+
+// display category name
+    $categories_string2 .= $foo[$counter]['name'];
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '</b>';
+    }
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string2 .= '-&gt;';
+    }
+
+    $categories_string2 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string2 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string2 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category2($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories 2 //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES2 . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+
+  $categories_string2 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_category2($first_element);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string2
+                              );
+  new infoBox($info_box_contents);
+
+$info_box_contents = array();
+
+?>
+            </td>
+          </tr>
+<!--############################################### //-->
+<?php
+}
+?>
+<!--############################################## //-->
+<!--categories2_eof //-->
+

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/categories3.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/categories3.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/categories3.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+/*
+  $Id: categories3.php,v 1.1 2004/04/05
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004osCommerce
+
+  Released under the GNU General Public License
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+*/
+
+// Categories_tree written by Gideon Romm from Symbio Technologies, LLC
+
+function tep_show_category3($cid, $cpath, $COLLAPSABLE) {
+  global $categories_string3, $languages_id, $HTTP_GET_VARS;
+  global $level;
+  $selectedPath = array();
+
+// Get all of the categories on this level
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }
+    $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;
+
+// Add category link to $categories_string3
+    for ($a=1; $a<$level{$categories['categories_id']}; $a++) {
+      $categories_string3 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string3 .= '<a href="';
+
+    $cPath_new = $cpath;
+    if ($level{$categories['parent_id']} > 0) {
+      $cPath_new .= "_";
+    }
+    $cPath_new .= $categories['categories_id'];
+
+    $cPath_new_text = "cPath=" . $cPath_new;
+
+    $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
+    $categories_string3 .= '">';
+
+    if ($HTTP_GET_VARS['cPath']) {
+      $selectedPath = split("_", $HTTP_GET_VARS['cPath']);
+    }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '<b>'; }
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '<u>'; }
+
+    $categories_string3 .= $categories['categories_name'];
+    if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string3 .= ' ->'; }
+
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '</u>'; }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '</b>'; }
+
+    $categories_string3 .= '</a>';
+
+    if (SHOW_COUNTS) {
+      $products_in_category = tep_count_products_in_category($categories['categories_id']);
+      if ($products_in_category > 0) {
+        $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string3 .= '<br>';
+
+
+// If I have subcategories, get them and show them
+    if (tep_has_category_subcategories($categories['categories_id'])) {
+
+      if ($COLLAPSABLE) {
+        if (in_array($categories['categories_id'], $selectedPath)) {
+          tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE);
+        }
+      }
+      else { tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE); }
+
+    }
+
+  }
+
+}
+?>
+
+
+<!--categories 3 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES3 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string3 = '';
+
+// tep_show_category3(<top category_id>, <top cpath>, <1=Collapsable tree, 0=static--show all>)
+  tep_show_category3(0,'',0);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string3
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!--categories_eof 3 //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/categories4.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/categories4.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/categories4.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,188 @@
+<?php
+/*
+  $Id: categories4.php,v 1.0
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_category4($counter) {
+    global $foo, $categories_string4, $id, $aa;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      if ($a == $foo[$counter]['level']-1)
+      {
+    $categories_string4 .= "<font color='#ff0000'>|__</font>";
+      } else
+        {
+        $categories_string4 .= "<b><font color='#ff0000'>&nbsp;&nbsp;&nbsp;&nbsp;</font></b>";
+        }
+
+    }
+    if ($foo[$counter]['level'] == 0)
+  {
+    if ($aa == 1)
+    {
+    $categories_string4 .= "<hr>";
+      }
+    else
+    {$aa=1;}
+
+  }
+
+
+    $categories_string4 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string4 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string4 .= '">';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $categories_string4 .= '<b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= "<b><font color='#ff0000'>";
+    }
+
+// display category name
+    $categories_string4 .= $foo[$counter]['name'];
+
+      if ($foo[$counter]['parent'] == 0) {
+       $categories_string4 .= '</b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= '</font></b>';
+    }
+
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string4 .= '<b>-&gt; </b>';
+    }
+
+    $categories_string4 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string4 .= '&nbsp;(' . $products_in_category . ')';
+      }    }
+
+    $categories_string4 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category4($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories 4//-->
+          <tr>
+            <td>
+<?php
+  $aa = 0;
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES4 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string4 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+   tep_show_category4($first_element);
+
+ //coment out the below line if you do not want to havw an all products list
+    $categories_string4 .= "<hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODS) . '"><b>' . BOX_INFORMATION_ALLPRODS . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODCATS) . '"><b>' . ALL_PRODUCTS_LINK . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODMANF) . '"><b>' . ALL_PRODUCTS_MANF . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br>\n";
+
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                'text'  => $categories_string4
+                               );
+   new infoBox($info_box_contents);
+?>
+
+        </td>
+          </tr>
+<!--categories_eof 4//-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/categories5.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/categories5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/categories5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: all_categories.php,v 1.6 2002/04/22 20:34:00 clescuyer Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Goélette
+  Christian Lescuyer <cl at goelette.net>
+  http://www.goelette.net/
+  http://oscommerce.goelette.net/
+
+  History: 1.1 Creation
+           1.2 Modified query for compatibility with older databases
+           1.3 Query in 1.2 was wrong for older databases
+           1.4 SHOW_COUNTS test corrected
+           1.5 Added COMPACT_CATEGORIES option to display all sub-categories on one line
+           1.6 Removed COMPACT_CATEGORIES option
+               Corrected the cpath generation
+               Bold categories "path" to selected category, an idea from Peter Fürsicht
+           1.7 Cleaned the way in which the categories are displayed - bold for the path,
+               ">" to indicate the current category, removed link to current category,
+               only indent subcategories (top level are flush left)
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3433 $
+
+  Released under the GNU General Public License
+
+*/
+
+// Keep out parts category
+    $excluded_parts_category_id = 28;
+
+
+// Preorder tree traversal
+  function preorder($cid, $level5, $foo5, $cpath) {
+    global $categories_string5, $HTTP_GET_VARS;
+
+    if ($cid != 0) {
+  // 1.7 Get the current path info
+      $category_path = explode('_',$HTTP_GET_VARS['cPath']);
+      $in_path = in_array($cid, $category_path);
+      $this_category = array_pop($category_path);
+
+      for ($i=0; $i<$level5; $i++)
+      // 1.7 only indent subcategories (top level are flush left)
+        if ($i>0) {
+          $categories_string5 .=  '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
+        }
+        // 1.7 indicate the current category
+        if ($this_category == $cid) {
+          $categories_string5 .=  '> ';
+        }
+
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '">';
+        }
+  // 1.6 Are we on the "path" to selected category? If yes, use <b>
+        if ($in_path) {
+          $categories_string5 .=  '<b>';
+        }
+        $categories_string5 .=  $foo5[$cid]['name'];
+        if ($in_path)
+          $categories_string5 .=  '</b>';
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '</a>';
+        }
+    // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+          if (SHOW_COUNTS == 'true') {
+            $products_in_category = tep_count_products_in_category($cid);
+            if ($products_in_category > 0) {
+              $categories_string5 .= '&nbsp;(' . $products_in_category . ')';
+            }
+          }
+        $categories_string5 .= '<br>' ."\n";
+      }
+
+// Traverse category tree
+      foreach ($foo5 as $key => $value) {
+        if ($foo5[$key]['parent'] == $cid) {
+  //        print "$key, $level5, $cid, $cpath<br>";
+          preorder($key, $level5+1, $foo5, ($level5 != 0 ? $cpath . $cid . '_' : ''));
+        }
+      }
+  }
+
+?>
+<!--  categories 5//-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES5 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+
+//////////
+// Get categories list
+//////////
+// 1.2 Test for presence of status field for compatibility with older versions
+  $status = tep_db_num_rows(tep_db_query('describe categories status'));
+  $query5 = "select 
+    c.categories_id, 
+    cd.categories_name, 
+    c.categories_image,
+    c.parent_id from 
+    " . TABLE_CATEGORIES . " c,
+    " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+    where 
+    c.parent_id = '0' 
+   and c.categories_id = cd.categories_id 
+   and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+ 
+
+  $categories_query5 = tep_db_query($query5);
+
+// Stuff in an array
+  while ($categories5 = tep_db_fetch_array($categories_query5))  {
+    $foo5[$categories5['categories_id']] = array('name' => $categories5['categories_name'], 'parent' => $categories5['parent_id']);
+  }
+
+// Initiate tree traverse
+  $categories_string5 = '';
+  preorder(0, 0, $foo5, '');
+
+//////////
+// Display box contents
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => $categories_string5);
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- categories5_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/currencies.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($currencies) && is_object($currencies)) {
+?>
+<!-- currencies //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CURRENCIES . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    reset($currencies->currencies);
+    $currencies_array = array();
+    while (list($key, $value) = each($currencies->currencies)) {
+      $currencies_array[] = array('id' => $key, 'text' => $value['title']);
+    }
+
+    $hidden_get_variables = '';
+    reset($HTTP_GET_VARS);
+    while (list($key, $value) = each($HTTP_GET_VARS)) {
+      if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
+        $hidden_get_variables .= tep_draw_hidden_field($key, $value);
+      }
+    }
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
+                                 'align' => 'center',
+                                 'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- currencies_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/customer_gv.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/customer_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/customer_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: customer_gv.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2441 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- Tell Customer he has a gift voucher-->
+<?php
+  if ($customer_id) {
+    $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$customer_id."'");
+    if ($gv_result=tep_db_fetch_array($gv_query)) $customer_gv_amount=$gv_result['amount'];
+  }
+if ($customer_gv_amount>0) {
+?>
+          <tr>
+            <td>
+<?php
+ $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_GIFT_VOUCHER . '</font>'
+                               );
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<div align="center">'.GIFT_VOUCHER_ACCOUNT_BALANCE_1.$currencies->format($customer_gv_amount).GIFT_VOUCHER_ACCOUNT_BALANCE_2.'<a href="'.tep_href_link(FILENAME_GV_SEND).'">'.GIFT_VOUCHER_ACCOUNT_BALANCE_3.'</a>'
+                              );
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- Tell Customer he has a gift voucher_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/donate.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/donate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/donate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: donate.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2440 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- whats_new //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DONATE  . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+$info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
+              <input type="hidden" name="cmd" value="_xclick">
+              <input type="hidden" name="business" value="donations at creloaded.com">
+              <input type="hidden" name="no_note" value="1">
+              <input type="hidden" name="currency_code" value="USD">
+              <input type="hidden" name="tax" value="0">
+              <input type="image" src="images/x-click_butcc_donate.gif" name="submit"  alt="'.DONATE_BUTTON_IMAGE_ALT.'">
+            </form>');
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/downloads.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/downloads.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/downloads.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,125 @@
+<?php
+/*
+  $Id: downloads.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3002 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- downloads //-->
+<?php
+  // modification of the logic to prevent the queries if there is no customer id
+  if ( $customer_id != '' ) {
+  if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+// Get last order id for checkout_success
+    $orders_query_raw = "SELECT orders_id FROM " . TABLE_ORDERS . " WHERE customers_id = '" . $customer_id . "' ORDER BY orders_id DESC LIMIT 1";
+    $orders_query = tep_db_query($orders_query_raw);
+    $orders_values = tep_db_fetch_array($orders_query);
+    $last_order = $orders_values['orders_id'];
+  } else {
+    $last_order = (int)$HTTP_GET_VARS['order_id'];
+  }
+
+// Now get all downloadable products in that order
+  $downloads_query_raw = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays
+                          FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
+                          WHERE customers_id = '" . $customer_id . "'
+                          AND o.orders_id = '" . $last_order . "'
+                          AND op.orders_id = '" . $last_order . "'
+                          AND opd.orders_products_id=op.orders_products_id
+                          AND opd.orders_products_filename<>''";
+  $downloads_query = tep_db_query($downloads_query_raw);
+
+// Don't display if there is no downloadable product
+  if (tep_db_num_rows($downloads_query) > 0) {
+     require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_DOWNLOADBOX);
+          ECHO '<tr><td>' ;
+          $info_box_contents = array();
+          $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DOWNLOADS . '</font>');
+          new infoBoxHeading($info_box_contents, false, false);
+
+           $info_box_contents = array();
+ ?>
+<!-- list of products -->
+<?php
+    while ($downloads_values = tep_db_fetch_array($downloads_query)) {
+?>
+
+<!-- left box -->
+<?php
+// MySQL 3.22 does not have INTERVAL
+      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads_values['date_purchased_day']);
+      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads_values['download_maxdays'], $dt_year);
+        $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
+
+// The link will appear only if:
+// - Download remaining count is > 0, AND
+// - The file is present in the DOWNLOAD directory, AND EITHER
+// - No expiry date is enforced (maxdays == 0), OR
+// - The expiry date is not reached
+      if (($downloads_values['download_count'] > 0) &&
+          (file_exists(DIR_FS_DOWNLOAD . $downloads_values['orders_products_filename'])) &&
+          (($downloads_values['download_maxdays'] == 0) ||
+           ($download_timestamp > time()))) {
+
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_FILE . '<br><br><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads_values['orders_products_download_id']) . '">' . $downloads_values['products_name'] . '</a>'
+                                          );
+ new infoBox($info_box_contents);
+      } else {
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => $downloads_values['products_name']
+                                          );
+ new infoBox($info_box_contents);
+
+      }
+?>
+<!-- right box -->
+<?php
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_DATE . '<br>' .  tep_date_long($download_expiry)
+                                          );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => $downloads_values['download_count'] . '  ' .  TEXT_HEADING_DOWNLOAD_COUNT
+                                        );
+  new infoBox($info_box_contents);
+ }
+
+if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => TEXT_FOOTER_DOWNLOAD . '<br><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . TEXT_DOWNLOAD_MY_ACCOUNT . '</a>'
+                                        );
+  new infoBox($info_box_contents);
+
+   }
+?>
+     </td>
+   </tr>
+<?php
+  }
+  }
+?>
+<!-- downloads_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/example.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/example.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/example.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1601 $
+
+*/
+?>
+<!-- Example_infobox Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_EXAMPLE . '</font>'
+                 // Change BOX_HEADING_EXAMPLE to your name, which you can find it easily.
+                 //and use the same in Infobox Admin to configure infobox.
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                // add infobox content below.
+                //'text'  => 'Your Content here'
+                'text'  => TEXT_YOUR_CONTENT_HERE
+                               );
+
+new infoBox($info_box_contents);
+
+?>
+</td></tr>
+<!-- Example_infobox_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/faq.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: faq.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$faq_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_FAQ_CATEGORIES . " ic, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// faq outside categories
+$faq_query = tep_db_query("select ip.faq_id, ip.question from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '0' and ip.language = '" . (int)$languages_id . "' and ip.visible = '1' order by ip.v_order, ip.question");
+
+if ((tep_db_num_rows($faq_categories_query) > 0) || (tep_db_num_rows($faq_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FAQ . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $faq_string = '';
+  while ($faq_categories = tep_db_fetch_array($faq_categories_query)) {
+    $id_string = 'cID=' . $faq_categories['categories_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($faq = tep_db_fetch_array($faq_query)) {
+    $id_string = 'fID=' . $faq['faq_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq['question'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $faq_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,83 @@
+<?php
+/*
+  $Id: featured.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3380 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- featured //-->
+<?php
+
+
+  $random_product_side = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(), featured_date_added DESC limit " . MAX_RANDOM_SELECT_SPECIALS);
+
+$random_product_side_row = tep_db_num_rows($random_product_side);
+   if ($random_product_side_row > 0){
+?>
+          <tr>
+            <td>
+<?php
+while ($featured_random_product21 = tep_db_fetch_array($random_product_side)){
+
+$featured_product21_id = $featured_random_product21['products_id'];
+$featured_product21_image = tep_get_products_image($featured_random_product21['products_id']);
+$featured_product21_name = tep_get_products_name($featured_random_product21['products_id']);
+
+  $pf->loadProduct($featured_random_product21['products_id'],$languages_id);
+        $featured_price1 = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FEATURED . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents,  false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+            'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $featured_product21_image, $featured_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id, 'NONSSL') . '">' . $featured_product21_name . '</a><br>' . $featured_price1 );
+
+
+
+   new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  
+ }
+?>
+<!-- featured_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/googlead.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/googlead.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/googlead.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: googlead.php, v 1.1 2004/05/30 Tom O'Neill (zip1)
+
+  Released under the GNU General Public License
+ based on banner in a box by aubrey at mycon.co.za
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+
+*/
+?>
+<!-- google-banner-ad-in-a-box //-->
+<?php
+  if (!(getenv('HTTPS')=='on')){
+  if ($banner = tep_banner_exists('dynamic', 'googlebox')) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_GOOGLE_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+  }
+?>
+<!-- google-banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/information_table.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/information_table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/information_table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: information.php,v 1.1.1.1 2003/09/18 19:05:51 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2857 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- information //-->
+          <tr>
+            <td>
+<?php
+require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_INFORMATIONBOX);
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_INFORMATION_TABLE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  // Retrieve information from Info table
+   $informationString = "";
+
+ // joles
+   $sql_query = tep_db_query("SELECT information_id, languages_id, info_title FROM " . TABLE_INFORMATION . " WHERE visible= '1' and languages_id ='" . (int)$languages_id . "' ORDER BY v_order");
+   while ($row = tep_db_fetch_array($sql_query)){
+   $informationString .= '<a href="' . tep_href_link(FILENAME_INFORMATION,  'info_id=' . $row['information_id'] ) . '">' . $row['info_title'] . '</a><br>';
+   }
+
+   $info_box_contents = array();
+
+if (tep_session_is_registered('customer_id')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+
+ } else if ((tep_session_is_registered('customer_id')) && (MODULE_ORDER_TOTAL_GV_STATUS == 'true')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+} else {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+}
+
+  new $infobox_template($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- information_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/languages.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2437 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- languages //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LANGUAGES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+    include(DIR_WS_CLASSES . FILENAME_LANGUAGE);
+    $lng = new language;
+  }
+
+  $languages_string = '';
+  reset($lng->catalog_languages);
+  while (list($key, $value) = each($lng->catalog_languages)) {
+    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text' => $languages_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- languages_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/links.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: links.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1980 $
+
+
+  Released under the GNU General Public License
+*/
+
+
+// check for link categoris to determine if there is anything to display
+  $link_categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");
+  $number_of_categories = tep_db_num_rows($link_categories_query);
+
+  if ($number_of_categories > 0) {
+?>
+          <tr>
+            <td>
+<!--D links -->            
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LINKS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_LINKS));
+
+    $informationString = '';
+    while($row = tep_db_fetch_array($link_categories_query)) {
+      $lPath_new = 'lPath=' . $row['link_categories_id'];
+      $informationString .= '<a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">' . $row['link_categories_name'] . '</a><br>';
+    }
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => $informationString
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,143 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3380 $
+
+
+  Released under the GNU General Public License
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  loginbox.php -   Version 1.0
+  This puts a login request in a box with a login button.
+  If already logged in, will not show anything.
+
+  Modified to utilize SSL to bypass Security Alert
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_LOGINBOX);
+
+// WebMakers.com Added: Do not show if on login or create account
+if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') )  {
+?>
+<!-- loginbox //-->
+<?php
+
+    if (!tep_session_is_registered('customer_id')) {
+?>
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $loginboxcontent = "
+       <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "\">
+            <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
+               <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_EMAIL . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_PASSWORD . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"password\" name=\"password\" maxlength=\"40\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+        <tr>
+            <td align=\"center\">
+      " . tep_draw_separator('pixel_trans.gif', '100%', '5') . "
+      </td>
+            </tr>
+              <tr>
+                <td class=\"infoboxContents\" align=\"center\">
+                  " . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "
+                </td>
+              </tr>
+             </table>
+           </form> 
+              ";
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $loginboxcontent
+                                );
+new infoBox($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<?php
+  } else {
+  // If you want to display anything when the user IS logged in, put it
+  // in here...  Possibly a "You are logged in as :" box or something.
+
+
+  }
+?>
+<!-- loginbox_eof //-->
+<?php
+// WebMakers.com Added: My Account Info Box
+} else {
+  if (tep_session_is_registered('customer_id')) {
+?>
+
+<!-- my_account_info //-->
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>'
+                              );
+new $infobox_template($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<!-- my_account_info_eof //-->
+
+<?php
+  }
+}
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/manufacturer_info.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/manufacturer_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/manufacturer_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: manufacturer_info.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- manufacturer_info //-->
+<?php
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id, m.manufacturers_id as manf_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from  " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and m.manufacturers_id = p.manufacturers_id and mi.manufacturers_id = m.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'");
+//    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id from  " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+
+   while ($manufacturer = tep_db_fetch_array($manufacturer_query)) {;
+?>
+<!-- manufacturer_info //-->
+          <tr>
+            <td>
+          
+<?php
+// echo 'prod-id' . (int)$HTTP_GET_VARS['products_id'] . 'manid' . $manufacturer['manufacturers_id'];
+      $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURER_INFO . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+      if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';
+      if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';
+      $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manf_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . ' ' . $manufacturer['manufacturers_name'] . '</a></td></tr>' .
+                                   '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturer_info_string);
+
+      new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- manufacturer_info_eof //-->
+          <?php
+       }
+      }
+?>
+<!-- manufacturer_info_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+
+  Released under the GNU General Public License
+*/
+
+  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+  if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
+?>
+<!-- manufacturers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
+// Display a list
+      $manufacturers_list = '';
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
+        $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
+      }
+
+      $manufacturers_list = substr($manufacturers_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturers_list);
+    } else {
+// Display a drop-down
+      $manufacturers_array = array();
+      if (MAX_MANUFACTURERS_LIST < 2) {
+        $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
+                                       'text' => $manufacturers_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- manufacturers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+/*
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+// VJ navmenu begin
+define('TABLE_NAVMENU_CATEGORIES', 'navmenu_categories');
+define('TABLE_NAVMENU_CATEGORIES_DESCRIPTION', 'navmenu_categories_description');
+define('TABLE_NAVMENU_LINKS', 'navmenu_links');
+define('TABLE_NAVMENU_LINKS_DESCRIPTION', 'navmenu_links_description');
+define('TABLE_NAVMENU_LINKS_TO_CATEGORIES', 'navmenu_links_to_categories');
+// VJ navmenu end
+
+function tep_nm_get_navmenu_list($pid = 0, $list_string = '', $style_id = '') {
+  global $languages_id;
+
+  $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name
+                                    from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                         " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd
+                                    where c.nmc_parent_id = '" . (int)$pid . "'
+                                      and cd.nmc_id = c.nmc_id
+                                      and cd.language_id = '" . (int)$languages_id . "'
+                                    order by c.nmc_sort_order, cd.nmc_name");
+
+  $links_query = tep_db_query("select l.nml_id, l.nml_url, ld.nml_name
+                               from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                    " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c,
+                                    " . TABLE_NAVMENU_LINKS . " l,
+                                    " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld
+                               where c.nmc_id = '" . (int)$pid . "'
+                                 and c.nmc_id = l2c.nmc_id
+                                 and l2c.nml_id = l.nml_id
+                                 and ld.nml_id = l.nml_id
+                                 and ld.language_id = '" . (int)$languages_id . "'
+                               order by l.nml_sort_order, ld.nml_name");
+  
+  if ((tep_db_num_rows($categories_query) > 0) || (tep_db_num_rows($links_query) > 0)) {
+    if (empty($list_string)) {
+      $list_string .= '<ul id="' . $style_id . '">' . "\n";
+    } else {
+      $list_string .= '<ul>' . "\n";
+    }
+
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $list_string .= '<li><a href="#">' . $categories['nmc_name'] . '</a>';
+
+      $list_string = tep_nm_get_navmenu_list((int)$categories['nmc_id'], $list_string);
+
+      $list_string .= '</li>' . "\n";
+    } 
+
+    while ($links = tep_db_fetch_array($links_query)) {
+      $list_string .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $links['nml_url'], 'NONSSL') . '">' . $links['nml_name'] . '</li>' . "\n";
+    } 
+
+    $list_string .= '</ul>' . "\n";
+  }
+
+  return $list_string;
+}
+?>
+<!-- navmenu //-->
+<script type="text/javascript"><!--
+sfHover = function() {
+   var sfEls = document.getElementById("navMenu").getElementsByTagName("LI");
+   for (var i=0; i<sfEls.length; i++) {
+     sfEls[i].onmouseover=function() {
+       this.className+=" sfhover";
+     }
+     sfEls[i].onmouseout=function() {
+       this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
+     }
+   }
+}
+if (window.attachEvent) window.attachEvent("onload", sfHover);
+//--></script>
+                  <tr>
+                    <td>
+                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
+                      <tr>
+                        <td width="100%">
+<?php
+$info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NAVMENU . '</font>');
+new infoBoxHeading($info_box_contents, false, false);
+
+$menu_string = tep_nm_get_navmenu_list(0, '', 'navMenu');
+
+// VJ debug
+//print_r($menu_string);
+
+$info_box_contents = array(array('text' =>  $menu_string));
+
+new infoBox($info_box_contents);
+?>
+                        </td>
+                      </tr>
+                    </table>
+                    </td>
+                  </tr>
+<!--D information_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/order_history.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/order_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/order_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: order_history.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1182 $
+
+
+  Released under the GNU General Public License
+*/
+
+  if (tep_session_is_registered('customer_id')) {
+// retreive the last x products purchased
+    $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
+    if (tep_db_num_rows($orders_query)) {
+?>
+<!-- customer_orders //-->
+          <tr>
+            <td>
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CUSTOMER_ORDERS . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $product_ids = '';
+      while ($orders = tep_db_fetch_array($orders_query)) {
+        $product_ids .= (int)$orders['products_id'] . ',';
+      }
+      $product_ids = substr($product_ids, 0, -1);
+
+      $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+      $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+        // changes the cust_order into a buy_now action
+        $customer_orders_string .= '  <tr>' .
+                                   '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
+                                   '    <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
+                                   '  </tr>';
+      }
+      $customer_orders_string .= '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $customer_orders_string);
+
+      new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- customer_orders_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/pages.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: pages.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$pages_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_PAGES_CATEGORIES . " ic, " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// pages outside categories
+$pages_query = tep_db_query("select ip.pages_id, ipd.pages_title
+                             from " . TABLE_PAGES . " ip
+                             left join " . TABLE_PAGES_TO_CATEGORIES . " ip2c on (ip2c.pages_id = ip.pages_id and ip2c.categories_id = '0'),
+                                  " . TABLE_PAGES_DESCRIPTION . " ipd
+                             where ip.pages_status = '1'
+                               and ipd.pages_id = ip.pages_id
+                               and ipd.language_id = '" . (int)$languages_id . "'
+                             order by ip.pages_sort_order, ipd.pages_title");
+
+if ((tep_db_num_rows($pages_categories_query) > 0) || (tep_db_num_rows($pages_query) > 0)) {
+?>
+          <tr>
+            <td>
+<!-- d page -->  
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_PAGES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $pages_string = '';
+  while ($pages_categories = tep_db_fetch_array($pages_categories_query)) {
+    $id_string = 'cID=' . $pages_categories['categories_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($pages = tep_db_fetch_array($pages_query)) {
+    $id_string = 'pID=' . $pages['pages_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages['pages_title'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $pages_string);
+
+  new infoBox($info_box_contents);
+?>
+    <!-- d page EOF -->  
+       </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/product_notifications.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/product_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/product_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: product_notifications.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2746 $
+
+
+  Released under the GNU General Public License
+*/
+if (isset($HTTP_POST_VARS['products_id']) && tep_not_null($HTTP_POST_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+  } elseif (isset($HTTP_GET_VARS['products_id']) && tep_not_null($HTTP_GET_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_GET_VARS['products_id']);
+  } 
+  if ( (isset($HTTP_GET_VARS['products_id'])) || (isset($HTTP_POST_VARS['products_id'])) ) {
+?>
+<!-- notifications //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NOTIFICATIONS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
+
+    if (tep_session_is_registered('customer_id')) {
+      $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      $notification_exists = (($check['count'] > 0) ? true : false);
+    } else {
+      $notification_exists = false;
+    }
+
+    $info_box_contents = array();
+    if ($notification_exists == true) {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    } else {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- notifications_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/reviews.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- reviews //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_REVIEWS . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_REVIEWS));
+
+  $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'";
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $random_select .= " and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'";
+  }
+  $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
+  $random_product = tep_random_select($random_select);
+
+  $info_box_contents = array();
+
+  if ($random_product) {
+// display random review box
+    $review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'");
+    $review = tep_db_fetch_array($review_query);
+
+    $review = tep_break_string(tep_output_string_protected($review['reviews_text']), 15, '-<br>');
+
+    $info_box_contents[] = array('text' => '<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div>');
+  } elseif (isset($HTTP_GET_VARS['products_id'])) {
+// display 'write a review' box
+    $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . BOX_REVIEWS_WRITE_REVIEW .'</a></td></tr></table>');
+  } else {
+// display 'no reviews' box
+    $info_box_contents[] = array('text' => BOX_REVIEWS_NO_REVIEWS);
+  }
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- reviews_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/search.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: search.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3380 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" ') . '&nbsp;' . tep_hide_session_id() . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');
+
+  new infoBox($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/search1.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/search1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/search1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: search1.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3380 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH1 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find1" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px">&nbsp;' . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br>'
+                              );
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- shop by price //-->
+<?php
+if (MODULE_SHOPBYPRICE_RANGES > 0) {
+?>
+          <tr>
+            <td>
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOP_BY_PRICE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $sbp_array = unserialize(MODULE_SHOPBYPRICE_RANGE);
+
+  $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=0', 'NONSSL') . '">' . TEXT_INFO_UNDER . $currencies->format($sbp_array[0]) . '</a><br>');
+  for ($i=1, $ii=count($sbp_array); $i < $ii; $i++) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . TEXT_INFO_FROM . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_TO . $currencies->format($sbp_array[$i]) . '</a><br>');
+  }
+  if (MODULE_SHOPBYPRICE_OVER == True) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_ABOVE . '</a><br>');
+  }
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- shop_by_price //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,130 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- shopping_cart //-->
+<script type="text/javascript"><!--
+function couponpopupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOPPING_CART . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));
+
+  $cart_contents_string = '';
+  if ($cart->count_contents() > 0) {
+    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+  $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
+    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
+  if ((int)$products_parent_id['products_parent_id'] != 0) {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '">';
+  } else {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+  }
+
+//      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+      $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        tep_session_unregister('new_products_id_in_cart');
+      }
+    }
+    $cart_contents_string .= '</table>';
+  } else {
+    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $cart_contents_string);
+
+  if ($cart->count_contents() > 0) {
+    // WebMakers.com Added: Shoppe Enhancement Controller
+    // check for free order
+    $final_total=$cart->show_total();
+    if ($final_total==0) {
+      $final_total='Free';
+    } else {
+      $final_total=$currencies->format($cart->show_total());
+    }
+    $info_box_contents[] = array('text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'right',
+                                 'text' => $final_total);
+  }
+// ICW ADDED FOR CREDIT CLASS GV
+  if (tep_session_is_registered('customer_id')) {
+    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $gv_result = tep_db_fetch_array($gv_query);
+    if ($gv_result['amount'] > 0 ) {
+      $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');
+    }
+  }
+  if (tep_session_is_registered('gv_id')) {
+    $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
+    $coupon = tep_db_fetch_array($gv_query);
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');
+
+  }
+  if (tep_session_is_registered('cc_id') && $cc_id) {
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');
+
+  }
+
+// ADDED FOR CREDIT CLASS GV END ADDITTION
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- shopping_cart_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3380 $
+
+
+  Released under the GNU General Public License
+*/
+
+   $random_product25 = tep_db_query("select distinct
+   p.products_id, 
+   pd.products_name, 
+   p.products_tax_class_id, 
+   p.products_image, 
+   s.specials_new_products_price 
+   from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+    " . TABLE_SPECIALS . " s 
+   where 
+   p.products_status = '1' 
+   and p.products_id = s.products_id 
+   and pd.products_id = s.products_id 
+   and pd.language_id = '" . (int)$languages_id . "' 
+   and s.status = '1' 
+   order by rand(), s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
+ 
+  
+  $random_product24_side_row = tep_db_num_rows($random_product25);
+     if ($random_product24_side_row > 0){
+
+?>
+<!-- d specials //-->
+          <tr>
+            <td>
+<?php
+
+while ($product_specials22 = tep_db_fetch_array($random_product25)){
+  $product_specials22_id = $product_specials22['products_id'];
+  $product_specials22_image = tep_get_products_image($product_specials22['products_id']);
+  $product_specials22_name = tep_get_products_name($product_specials22['products_id']);
+
+  $pf->loadProduct($product_specials22['products_id'],$languages_id);
+        $special_random_price = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SPECIALS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price);
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- specials_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['products_id']) {
+?>
+<!-- tell_a_friend //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TELL_A_FRIEND . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('tell_a_friend', tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('to_email_address', '', 'size="10"') . '&nbsp;' . tep_template_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id() . '<br>' . BOX_TELL_A_FRIEND_TEXT);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- tell_a_friend_eof //-->
+
+<?php } ?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/theme_select.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/theme_select.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/theme_select.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: theme_select.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1785 $
+
+
+  Released under the GNU General Public License
+*/
+    if (tep_session_is_registered('customer_id')) {
+
+  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
+
+?>
+<!-- theme //-->
+         <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TEMPLATE_SELECT . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $template_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " where active = '1' order by template_name");
+
+ 
+// Display a drop-down
+    $select_box = '<select name="template" onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%">';
+    if (MAX_THEME_LIST < 2) {
+      $select_box .= '<option value="">' . PULL_DOWN_DEFAULT . '</option>';
+    }
+    while ($template_values = tep_db_fetch_array($template_query)) {
+      $select_box .= '<option value="' . $template_values['template_name'] . '"';
+      if ($HTTP_GET_VARS['template_id'] == $template_values['template_id']) $select_box .= ' SELECTED';
+      $select_box .= '>' . substr($template_values['template_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
+    }
+    $select_box .= "</select>";
+    $select_box .= tep_hide_session_id();
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form'  => '<form name="template" method="post" action="' . tep_href_link(FILENAME_DEFAULT, '&action=update_template', 'NONSSL') . '">',
+                                 'align' => 'left',
+                                 'text'  => $select_box);
+
+   new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}}
+?>
+<!-- template_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/whats_new.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/whats_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/whats_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: whats_new.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3380 $
+
+
+  Released under the GNU General Public License
+*/
+  $random_product27 = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+      order by rand(), products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
+ 
+$random_product27_side_row = tep_db_num_rows($random_product27);
+   if ($random_product27_side_row > 0){
+
+  ?>
+<!--D whats_new //-->
+ <tr>
+            <td>
+<?php      
+    
+while ($whatsnew_product21 = tep_db_fetch_array($random_product27)){
+  $whatsnew_product21_id = $whatsnew_product21['products_id'];
+  $whatsnew_product21_image = tep_get_products_image($whatsnew_product21['products_id']);
+  $whatsnew_product21_name = tep_get_products_name($whatsnew_product21['products_id']);
+
+  $pf->loadProduct($whatsnew_product21['products_id'],$languages_id);
+         $whats_new_price = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHATS_NEW . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',           
+         'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $whatsnew_product21_image, $whatsnew_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . $whatsnew_product21_name . '</a><br>' . $whats_new_price .'<br />');
+//Eversun mod for sppc and qty price breaks
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!--D whats_new_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<?php
+/*
+  $Id: whos_online.php, v 1.0 2001/12/05 by mattice at xs4all.nl
+
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2435 $
+
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official TEP distribution
+  but an add-on contributed to the TEP community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_WHOS_ONLINEBOX);
+?>
+
+
+<!-- whos_online //-->
+          <tr>
+            <td>
+<?php
+
+// Set expiration time, default is 900 secs (15 mins)
+  $xx_mins_ago = (time() - 900);
+
+  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
+
+  $whos_online_query = tep_db_query("select customer_id from " . TABLE_WHOS_ONLINE);
+  while ($whos_online = tep_db_fetch_array($whos_online_query)) {
+                        if (!$whos_online['customer_id'] == 0) $n_members++;
+                        if ($whos_online['customer_id'] == 0) $n_guests++;
+
+  $user_total = sprintf(tep_db_num_rows($whos_online_query));                                                                }
+
+  if ($user_total == 1) {
+    $there_is_are = BOX_WHOS_ONLINE_THEREIS . '&nbsp;';
+  } else {
+    $there_is_are = BOX_WHOS_ONLINE_THEREARE . '&nbsp;';
+  }
+
+  if ($n_guests == 1) {
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUEST;
+  }else{
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUESTS;
+  }
+
+  if ($n_members == 1) {
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBER;
+  }else{
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBERS;
+  }
+
+
+  if (($n_guests >= 1) && ($n_members >= 1)) $word_and = '&nbsp;' . BOX_WHOS_ONLINE_AND . '&nbsp;<br>';
+
+      $textstring = $there_is_are;
+        if ($n_guests >= 1) $textstring .= $n_guests . $word_guest;
+
+      $textstring .= $word_and;
+        if ($n_members >= 1) $textstring .= $n_members . $word_member;
+
+      $textstring .= '&nbsp;online.';
+
+
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHOS_ONLINE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>  $textstring
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whos_online_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/boxes/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+  $Id: wishlist.php,v 2.2 2004/09/12 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2546 $
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- wishlist //-->
+<?php
+if (basename($PHP_SELF) != FILENAME_WISHLIST_SEND){
+if (basename($PHP_SELF) != FILENAME_WISHLIST)   {
+?> 
+          <tr>
+            <td>
+<?php
+  // retreive the wishlist
+  if (tep_session_is_registered('customer_id')) {
+    $wishlist_query_raw = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 order by products_name";  
+    $wishlist_query = tep_db_query($wishlist_query_raw);
+
+    // if we have something in this clients list:
+    ?>
+    <!-- customer_wishlist //-->
+    <script type="text/javascript"><!--
+    function popupWindowWishlist(url) {
+      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=425,height=475,screenX=150,screenY=150,top=150,left=150')
+    }
+    //--></script>
+    <?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WISHLIST . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_WISHLIST, '','NONSSL'));
+    
+    $info_box_contents = array();
+    
+    if (tep_db_num_rows($wishlist_query)) {
+      if (tep_db_num_rows($wishlist_query) < MAX_DISPLAY_WISHLIST_BOX) {
+
+        $product_ids = '';
+        while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+          $product_ids .= $wishlist['products_id'] . ',';
+         }
+        $product_ids = substr($product_ids, 0, -1);        
+       
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        //  $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . $product_ids . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $customer_wishlist_string .= '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a></td>' . "\n" .
+                                                  '</tr>' . "\n" .
+                                                  '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents" align="center" valign="bottom"><b><a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_MOVE_TO_CART . '</a>&nbsp;|' . "\n" .
+                                                  '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b>' . "\n" .  tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td>' .
+                                                  '</td></tr>' . "\n";
+        }
+      } else {
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . sprintf(TEXT_WISHLIST_COUNT, tep_db_num_rows($wishlist_query)) . '</td></tr>' . "\n";
+      }
+    } else {
+      $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+      $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . BOX_WISHLIST_EMPTY . '</td></tr>' . "\n";
+    }
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a></td></tr>' . "\n";
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST_HELP . '</u> [?]</a></td></tr>' . "\n"; // Normal link
+    $customer_wishlist_string .= '</table>';
+
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => $customer_wishlist_string);
+
+    new infoBox($info_box_contents);
+  }
+?>
+            </td>
+          </tr>
+          <?php
+    }}
+?><!-- wishlist_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/E-vector/boxes.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/boxes.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/boxes.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,243 @@
+<?php
+/*
+  $Id: boxes.tpl.php,v 1.1.1.1 2003/09/18 19:06:13 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBox {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBox($contents, $direct_output = false) {
+      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
+      $tableBox_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
+        $tableBox_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
+        $tableBox_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
+              $tableBox_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
+              $tableBox_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox_string .= '    <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
+        }
+
+        $tableBox_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
+      }
+
+      $tableBox_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox_string;
+
+      return $tableBox_string;
+    }
+  }
+
+class categoriesBox extends tableBox {
+function categoriesBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->categoriesBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $this->tableBox($info_box_contents, true);
+    }
+
+function categoriesBoxContents($contents) {
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $info_box_contents = array();
+      for ($i=0; $i<sizeof($contents); $i++) {
+        $info_box_contents[] = array(array('align' => 'center', 'params' => 'class="noclass"', 'text' => $contents[$i]['text']));
+      }
+      return $this->tableBox($info_box_contents);
+    }
+}
+
+  class infoBox extends tableBox {
+    function infoBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function infoBoxContents($contents) {
+      $this->table_cellpadding = '3';
+      $this->table_parameters = 'class="infoBoxContents"';
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
+                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
+                                           'params' => 'class="boxText"',
+                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
+      }
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      return $this->tableBox($info_box_contents);
+    }
+  }
+
+  class infoBoxHeading extends tableBox {
+    function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+      } else {
+        $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => 'width="100%" height="14" class="infoBoxHeading"',
+                                         'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading" nowrap',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class infoboxFooter extends tableBox {
+    function infoboxFooter($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      } else {
+        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => ' class="infoBoxHeading"', 'text' => $left_corner),
+                                   array('params' => ' width="100%" ', 'text' => $contents[0]['text']),
+            array('params' => ' class="infoBoxHeading" nowrap', 'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class contentBox extends tableBox {
+    function contentBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function contentBoxContents($contents) {
+      $this->table_cellpadding = '4';
+      $this->table_parameters = 'class="infoBoxContents"';
+      return $this->tableBox($contents);
+    }
+  }
+
+  class contentBoxHeading extends tableBox {
+    function contentBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_width = '100%';
+      $this->table_cellpadding = '1';
+      
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/no_arrow_right.gif');
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_right.gif');
+      } else {
+         $right_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif') .$right_arrow ;
+
+      }
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => ' align="center" background="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif" width="100%"  class="infoBoxHeading"',
+                 'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class errorBox extends tableBox {
+    function errorBox($contents) {
+      $this->table_data_parameters = 'class="errorBox"';
+      $this->tableBox($contents, true);
+    }
+  }
+
+  class productListingBox extends tableBox {
+    function productListingBox($contents) {
+      $this->table_parameters = 'class="productListing"';
+      $this->tableBox($contents, true);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/doc/buttonspec.txt
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/doc/buttonspec.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/doc/buttonspec.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+Evector 2 Buttons
+This file is intended to help adding more buttons when they are needed.
+It putpose is to discribe how the button were made so that they
+can be duplicated in the future.
+
+Original Spec:
+   background color: R 17 G 24 B 41
+   Boarder color: Black
+   height: 18 Pixels
+   Font: Unkowen 
+---------------------------------------------------
+New
+Button Software: Deknop
+Formate: .gif
+LZW compression: Ulead photoimpact SE 4.2.
+
+ Background color: R 45 G 109 B 197
+   Boarder color:  R 0  G 0  B 128
+   height: 18 Pixels 
+   Width: variable
+Font: Arial
+Font style: Bold
+Font Size: 10 points
+Font color: R:0 G:0 B: 0 (white)

Added: trunk/direct.openmoko.com/templates/E-vector/doc/evector.btn
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/doc/evector.btn	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/doc/evector.btn	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+[dimensions]
+left=0
+top=5
+butwidth=112
+butheight=16
+bevelwidth=0
+borderwidth=1
+leftmar=0
+rightmar=0
+topmar=0
+halign=1
+valign=1
+butup=0
+glintens=100
+[Window]
+split1=217
+split2=235
+split3=127
+[colors]
+font=clWhite
+background=$00C08000
+canvas=$00848484
+uppercolor=$00804000
+downcolor=$00804000
+border=clNavy
+slower=clWhite
+supper=clWhite
+transcolor=5
+[font]
+name=Arial
+charset=0
+size=9
+bold=1
+italic=0
+underline=0
+style=0
+AntiAF=0
+[text]
+morecaptions=Create Account
+wordwrap=0
+prefix=button_
+suffix=
+usefix=1
+[gradient]
+use=0
+begincolor=$00FF8080
+endcolor=clWhite
+kind=4
+[gradientT]
+use=0
+endcolor=clWhite
+begincolor=clWhite
+kind=1
+[3d]
+style=0
+color=clWhite
+depth=8
+[shadow]
+color=clGray
+diam=2
+use=0
+xpos=3
+ypos=3
+[files]
+alfabet=0
+ufnamech=0
+ufname=printorder
+jpgcom=75
+saveIas=2
+LSI=C:\AppServ\www\loaded61b\templates\E-vector\images\buttons\english\button_createaccount.gif
+LSIS=
+[neo]
+mode=0
+cap=new
+bmpname=[none]
+usetrcolor=1
+trcolor=clOlive
+[trans]
+use=0
+pos=7
+[texture]
+usebt=0
+kindbt=2
+filebt=
+posx=0
+posy=0
+transby=1
+usete=0
+filete=
+inten=50
+[paths]
+use=0

Added: trunk/direct.openmoko.com/templates/E-vector/doc/readmetabs.txt
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/doc/readmetabs.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/doc/readmetabs.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+these are the original tabs for Evector_v2
+the can be cut and pasted to replace the ones installed now.
+set1
+
+<table WIDTH="<?php echo SITE_WIDTH;?>" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr>
+<td width="100%" background="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_11.gif"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_05.gif" WIDTH=261 HEIGHT=23 ALT=""></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_09.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="48"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_DEFAULT);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_06.gif" ALT="Homepage" WIDTH=48 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="54"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_PRODUCTS_NEW);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_08.gif" ALT="Our FAQ's" WIDTH=54 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="74"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_REVIEWS);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_10.gif" ALT="Reviews" WIDTH=74 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="24"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=24 HEIGHT=23 ALT=""></td>
+<td WIDTH="52"><a HREF="<?php echo tep_href_link(FILENAME_NEWSDESK_INDEX);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_12.gif" ALT="Latest news" WIDTH=52 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="94"><a HREF="#"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_14.gif" ALT="Downloads" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="77"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_CONTACT_US);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_16.gif" ALT="Contact Us" WIDTH=77 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+
+</tr>
+</table>
+
+
+set2
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/E-vector/extra_html_output.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/extra_html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/extra_html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+<?php
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_template_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_template_image_button($image, $alt = '', $parameters = '') {
+    global $language;
+
+    return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+  }
+
+
+  function table_image_border_top($left, $right,$header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" class="maintableBorder" cellspacing="0" cellpadding="0">
+  <tbody>
+
+<?php
+// BOF: WebMakers.com Added: Show Featured Products
+if ((SHOW_HEADING_TITLE_ORIGINAL!='yes') && (tep_not_null($header)) ) {
+?>
+
+    <tr>
+      <td main_table_heading>
+      <table width="100%" border="0" cellpadding="0" cellspacing="4">
+        <tbody>
+          <tr>
+            <td class="productlisting-heading"><?php echo $header;?></td></tr></tbody>
+      </table>
+      </td>
+    </tr>
+
+<?php
+}
+?>
+
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" class="maintableBackground" cellspacing="0" cellpadding="4">
+<?php
+}
+
+}
+  function table_image_border_bottom(){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      </table>
+      </td>
+    </tr>
+      </table>
+      </td>
+    </tr>
+  </tbody>
+</table>
+      </td>
+    </tr>
+      <!--Lango Added for Template MOD: EOF-->
+<?php
+}
+}
+?>

Added: trunk/direct.openmoko.com/templates/E-vector/header.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,135 @@
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+if (SITE_WIDTH!='100%') {
+?>
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <tbody>
+  <tr>
+    <td>
+    <table CELLSPACING="0" CELLPADDING="0" BORDER="0" width="<?php echo SITE_WIDTH; ?>" align="center">
+      <tbody>
+      <tr>
+        <td>
+        <table border="0" width="100%">
+          <tbody>
+          <tr>
+            <td>
+      <?php } ?>
+<table WIDTH="<?php echo SITE_WIDTH;?>" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr>
+<td style="background-image: url('<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_01ab.gif');background-repeat: repeat-x;"  WIDTH=279 HEIGHT=16>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+</td>
+<td style="background-image: url('<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_02.gif');background-repeat: repeat-x;">
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+</td>
+<tr>
+<td><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_01d.gif" WIDTH=279 ALT=""></td>
+<td>
+<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr>
+<td width="100%"> </td>
+</tr>
+<tr>
+<td> <table WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<tr>
+<td HEIGHT="60" ALIGN="center">
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+  if ($banner = tep_banner_exists('dynamic', '468x50')) {
+?>
+  <tr class="ShowCartDetails">
+    <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
+</tr>
+<?php
+ }
+?>
+<tr>
+ <td>
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" class="ShowCartDetails">
+<?php
+if (SHOW_CART_IN_HEADER =='yes'){
+ require(DIR_WS_INCLUDES . FILENAME_SEARCH_IN_HEADER); 
+  }?>
+  </td>
+    <td align="center" class="ShowCartDetails">
+<?php
+   if (SHOW_CART_IN_HEADER =='yes') {
+      echo  $cart->count_contents() . ($cart->count_contents() == "1" ? TEXT_CART_COUNT : TEXT_CART_COUNTS); ?> &nbsp;&nbsp; <?php echo $currencies->format($cart->show_total()); ?> &nbsp;&nbsp; <?php echo $cart->show_weight() . ($cart->show_weight() == "1" ? TEXT_CART_WEIGHT : TEXT_CART_WEIGHTS);?>&nbsp;&nbsp;&nbsp;
+<?php
+ }
+?>
+   </td>
+   </tr>
+   </table>
+   </td>
+  </tr>
+</table>
+
+</td>
+
+</tr>
+</table></td>
+<tr>
+<td width="100%"></td>
+</tr>
+</table></td>
+</tr>
+</table>
+<table WIDTH="<?php echo SITE_WIDTH;?>" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr>
+<td width="100%" style="background-image: url('<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_11.gif');background-repeat: repeat-x;"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_05.gif" WIDTH=261 HEIGHT=23 alt="<?php echo IMAGE_ALT;?>"></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_09.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="48"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_DEFAULT);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/home.gif" ALT="<?php echo ALT_HOMEPAGE;?>" WIDTH=48 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+
+ <?php
+      if (!tep_session_is_registered('noaccount')){// DDB - PWA - 040622 - no display of logoff for PWA customers
+         if (!tep_session_is_registered('customer_id')) {
+        echo ' <td WIDTH="94"><a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '"> <img SRC="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/login.gif" ALT="'.LOGIN_ALT.'" WIDTH=54 HEIGHT=23 BORDER="0"></a></td>';
+          } else {
+        echo '<td WIDTH="54"> <a class="headerNavigation" href="' . tep_href_link(FILENAME_ACCOUNT, "", "SSL") . '"><img SRC="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/my_account.gif" ALT="'.MYACCOUNT_ALT.'" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>';
+          }
+         }
+
+     if (tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers
+       {
+     if (!tep_session_is_registered('customer_id')) {
+        echo '<td WIDTH="54"> <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '"><img SRC="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/login.gif" ALT="'.LOGIN_ALT.'" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>';
+   }else{
+        echo '<td WIDTH="54"> <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '"><img SRC="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/logoff.gif" ALT="'.LOGOFF_ALT.'" WIDTH=54 HEIGHT=23 BORDER="0"></a></td>';
+      }
+      }
+       ?>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="93"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_SPECIALS);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/specials.gif" ALT="<?php echo SPECIALS_ALT;?>" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="94"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_PRODUCTS_NEW);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/whatsnew.gif" ALT="<?php echo WHATS_NEW_ALT;?>" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=24 HEIGHT=23 ALT=""></td>
+<td WIDTH="94"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'SSL');?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/contact_us.gif" ALT="<?php echo CONTACT_US_ALT;?>" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+</tr>
+</table>
+
+<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+
+<tr>
+<td WIDTH="218"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/under_header.gif" WIDTH="218" HEIGHT="48" alt="<?php echo IMAGE_ALT;?>"></td>
+<td WIDTH="50%" align="center">
+
+<?php  if (SHOW_LANGUAGES_IN_HEADER=='yes'){ ?>
+<td ALIGN="CENTER" WIDTH="<?php echo BOX_WIDTH_RIGHT; ?>">
+
+<?php
+ require(DIR_WS_INCLUDES . FILENAME_LANGUAGES_IN_HEADER); ?></td>
+<?php } ?>
+</tr>
+</table>
+
+<?php } ?>
+<!-- header_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/images/E-vector.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/E-vector.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/Evector.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/Evector.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_done.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_done.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_more_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_more_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/readme.txt
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+Yellow Buttons v1.0 for OSC 2.2 MS1
+
+Author: Jesse Rooney
+
+Released under the GNU General Public License
+
+Hosting & Design at http://www.resomedia.com
+
+
+Used in OSC 2.2 MS1
+
+Havent tested it with ms2 yet (post comments in the contrib forum if it works)
+
+
+
+************************
+
+INSTALL - Simple, but I will explain
+
+************************
+
+
+Unzip and upload to
+
+includes/languages/english/images/buttons
+
+
+**********************************************************************************************
+*osCommerce provides no warranty and is redistributable under the GNU General Public License *
+**********************************************************************************************

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/contact_us.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/contact_us.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_007.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_007.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_01a.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_01a.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_01ab.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_01ab.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_01d.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_01d.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_07.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_07.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_09.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_09.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_11.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_11.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_13.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_13.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_15.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_15.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/header_17.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/header_17.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/home.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/home.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/infobox/pixel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/infobox/pixel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/logoff.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/logoff.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/my_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/my_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/pixel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/pixel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/pointer_blue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/pointer_blue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/pointer_blue_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/pointer_blue_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/spacer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/spacer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/specials.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/specials.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/under_header.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/under_header.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/under_headerbg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/under_headerbg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/images/whatsnew.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/E-vector/images/whatsnew.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/E-vector/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,162 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body BGCOLOR=#FFFFFF >
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+<!-- warning_eof //-->
+<!-- header //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_HEADER); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_MAIN; ?>" class="centertable">
+  <tr>
+<?php
+if (DISPLAY_COLUMN_LEFT == 'yes')  {
+// WebMakers.com Added: Down for Maintenance
+// Hide column_left.php if not to show
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+?>
+
+<td WIDTH="3" bgcolor="#2D6DC5"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/spacer.gif" WIDTH="3" HEIGHT="1" alt="<?php echo IMAGE_ALT;?>"></td>
+
+
+    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top" class="column_left"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+
+<td WIDTH="3" bgcolor="#2D6DC5"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/spacer.gif" WIDTH="3" HEIGHT="1" alt="<?php echo IMAGE_ALT;?>"></td>
+<?php
+}
+}
+?>
+<!-- content //-->
+<td WIDTH="100%" ALIGN="CENTER" VALIGN="TOP">
+
+<?php
+ if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template))) {
+
+   require(DIR_WS_CONTENT . basename($content_template));
+  } else {
+   require(DIR_WS_CONTENT . $content . '.tpl.php');
+
+  }
+?>
+
+</td>
+<!-- content_eof //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide column_right.php if not to show
+
+if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+require(DIR_WS_INCLUDES . FILENAME_COUNTER); ?>
+<table BGCOLOR="#2D6EC5" WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr class="footer">
+    <td class="footer">&nbsp;&nbsp;<?php echo strftime(DATE_FORMAT_LONG); ?>&nbsp;&nbsp;</td>
+    <td align="right" class="footer">&nbsp;&nbsp;<?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>&nbsp;&nbsp;</td>
+  </tr>
+  </table>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<tr>
+<td BGCOLOR="#2D6EC5"><table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="6">
+<tr>
+  <td >
+<?php 
+//google banner ad
+if (!(getenv('HTTPS')=='on')){
+if (tep_banner_exists('dynamic','googlefoot') ) {
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', 'googlefoot'); ?></td>
+  </tr>
+</table>
+
+<?php
+  } }
+?>
+
+<?php 
+if ( tep_banner_exists('dynamic','468x50') ) { ?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', '468x50'); ?></td>
+  </tr>
+</table>
+
+<?php
+  }
+?>
+  </td>
+</tr>
+<tr>
+<td CLASS="footer" ALIGN="CENTER">
+<?php
+ echo FOOTER_TEXT_BODY
+?>
+</td>
+</tr>
+</table>
+<table WIDTH="<?php echo SITE_WIDTH;?>" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+<tr>
+<td ALIGN="RIGHT"style="background-image: url('<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_007.gif');background-repeat: repeat-y;"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_17.gif" WIDTH="150" HEIGHT="23" BORDER="0" alt="image" USEMAP="#Map"></td>
+</tr>
+</table>
+<map NAME="Map">
+<area SHAPE="RECT" COORDS="2,8,147,19" HREF="http://www.themelabs.com" TARGET="_blank">
+</map>
+<?php
+}
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+if (SITE_WIDTH != '100%') {
+?>
+         </td></tr></table>
+       </td></tr>
+     </table>
+   </td>
+  </tr>
+</table>
+<?php
+}
+// EOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+?>
+<!-- footer_eof //-->
+</body>
+</html>

Added: trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/default_specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/default_specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/default_specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: default_specials.php,v 2.1 2006/09/07 23:42:27 datazen Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- default_specials mainpage //-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
+  
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+  $random_specials = array();
+  $specials_array = array();
+  $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC");
+  while ($specials = tep_db_fetch_array($specials_query)) {
+    $random_specials[] .= $specials['products_id'];
+  }
+
+  $row = 0;
+  $col = 0;
+
+  if (sizeof($random_specials)!=0){
+    $max_displayed = (MAX_DISPLAY_SPECIAL_PRODUCTS > sizeof($random_specials)) ? sizeof($random_specials) : MAX_DISPLAY_SPECIAL_PRODUCTS;
+    $special_products = cre_random_array($random_specials, $max_displayed);
+    for($i=0; $i < $max_displayed; $i++) {
+      $product_array = array();
+      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price as special_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where  p.products_id = $special_products[$i] and  s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");
+      $product = tep_db_fetch_array($product_query);
+
+      $pf->loadProduct($product['products_id'],$languages_id);
+      $products_price_s = $pf->getPriceStringShort();
+
+      $buyitnow='<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+ 
+      $info_box_contents[$row][$col] = array('align' => 'center',
+                                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                                             'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $product['products_image'], $product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . $product['products_name'] . '</a><br>' . $products_price_s . '<br>'. $buyitnow);
+      $col ++;
+      if ($col > 2) {
+        $col = 0;
+        $row ++;
+      }
+    }
+  }else{
+      $info_box_contents[$row][$col] = array('align' => 'left',
+                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                             'text' => TEXT_NO_SPECIALS);
+  }
+  
+  new contentBox($info_box_contents);
+
+  $info_box_contents = array();
+  if (MAIN_TABLE_BORDER == 'yes'){
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                             );
+    new infoboxFooter($info_box_contents, true, true);
+  }
+?><!-- default_specials_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/example.html
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/example.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/example.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<table width="100%" border="0" bgcolor="FFA814" cellspacing="0" cellpadding="0">
+  <tr>
+    <td bgcolor="#CCCCCC">
+    <table width="100%" border="0" cellpadding="0" cellspacing="1">
+      <tr>
+        <td class="infoBoxHeading">
+        Example HTML Mainpage Module</td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+  <tr>
+    <td valign="top" width="100%">
+    <table width="100%" border="0" class="infobox" cellspacing="0" cellpadding="1">
+      <tr>
+        <td valign="top" width="100%">
+        <table width="100%" border="0" class="infoboxContents" cellspacing="0" cellpadding="0">
+      <!-- change from here to next-->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+          <tr>
+            <td align="center">
+            <img width="426" height="75" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr01.gif" border="0"></td>
+          </tr>
+          <tr>
+            <td valign="top" align="center">
+            <img valign="top" width="117" height="90" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr02.gif" border="0"></a><img width="117" height="90" valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr03.gif" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr04.gif" height="90" width="96" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr05.gif" width="96" height="90" border="0"></td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <!-- change from here to above-->
+        </table>
+        </td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Featured Products V1.1
+  Displays a list of featured products, selected from admin
+  For use as an Infobox instead of the "New Products" Infobox
+*/
+?>
+<!-- featured_products_mainpage //-->
+<?php
+ 
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+      $featured_products_2bb_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                              " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(),p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
+   
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($featured_products_2bb = tep_db_fetch_array($featured_products_2bb_query)) {
+
+    $num ++;
+  
+    if ($num == 1) {
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+    }    
+
+  $pf->loadProduct($featured_products_2bb['products_id'],$languages_id);
+        $products_price_2bb = $pf->getPriceStringShort();
+
+
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products_2bb['products_image'], $featured_products_2bb['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . $featured_products_2bb['products_name'] . '</a><br>' . $products_price_2bb);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+
+  }
+ 
+?>
+<!-- featured_products_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/main_categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/main_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/main_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,178 @@
+<?php
+/*
+  $Id: main_categories.php,v 1.0a 2002/08/01 10:37:00 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Barreto
+  Gustavo Barreto <gustavo at barreto.net>
+  http://www.barreto.net/
+
+  Based on: all_categories.php Ver. 1.6 by Christian Lescuyer
+
+  History: 1.0 Creation
+     1.0a Correction: Extra Carriage Returns
+     1.1  added parameters to change display options -- mdt
+
+  Released under the GNU General Public License
+
+*/
+
+//------------------------------------------------------------------------------------------------------
+// PARAMETERS
+//------------------------------------------------------------------------------------------------------
+
+$item_column_number = 3;    // range of 1 to 9
+$item_title_on_newline = true;  // true or false
+
+// for item and subcategory options, suugest that you just put in CSS code
+// you can also just define a class and then change it in a template addon like BTS
+$item_div_options = 'style="text-align:center;font-weight:bold;font-size:larger;margin-top:5px;"';
+$item_subcategories_options = '';
+
+//------------------------------------------------------------------------------------------------------
+// CODE - do not change below here
+//------------------------------------------------------------------------------------------------------
+
+// error checking on parameters
+if($item_column_number < 1)
+{
+  $item_column_number = 1;
+}
+if($item_column_number > 9)
+{
+  $item_column_number = 9;
+}
+if($item_title_on_newline)
+{
+  $item_separator = '<br>';
+} else {
+  $item_separator = '&nbsp;';
+}
+
+// preorder_mc tree traversal
+  function preorder_mc($cid_cat, $level_cat, $foo_cat, $cpath_cat)
+  {
+    global $categories_string_cat, $HTTP_GET_VARS;
+
+// Display link
+    if ($cid_cat != 0) {
+      for ($i=0; $i<$level_cat; $i++)
+        $categories_string_cat .=  '&nbsp;&nbsp;';
+      $categories_string_cat .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath
+=' . $cpath_cat . $cid_cat) . '">';
+// 1.6 Are we on the "path" to selected category?
+      $bold = strstr($HTTP_GET_VARS['cPath'], $cpath_cat . $cid_cat . '_') || $HTTP_GET_VARS['cPath'] == $cpath_cat . $cid_cat;
+// 1.6 If yes, use <b>
+      if ($bold)
+        $categories_string_cat .=  '<b>';
+      $categories_string_cat .=  $foo_cat[$cid_cat]['name'];
+      if ($bold)
+        $categories_string_cat .=  '</b>';
+      $categories_string_cat .=  '</a>';
+// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+      if (SHOW_COUNTS == 'true') {
+        $products_in_category = tep_count_products_in_category($cid_cat);
+        if ($products_in_category > 0) {
+          $categories_string_cat .= '&nbsp;(' . $products_in_category . ')';
+        }
+      }
+      $categories_string_cat .= '<br>';
+    }
+
+// Traverse category tree
+    if (is_array($foo_cat)) {
+      foreach ($foo_cat as $key => $value) {
+        if ($foo_cat[$key]['parent'] == $cid_cat) {
+          preorder_mc($key, $level_cat+1, $foo_cat, ($level_cat != 0 ? $cpath_cat . $cid_cat . '_' : ''));
+        }
+      }
+    }
+  }
+
+?>
+<!-- main_categories //-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES_MAIN_PAGE);
+  new infoBoxHeading($info_box_contents, true, true);
+
+
+//////////
+// Get categories list
+//////////
+
+$query_cat = "select 
+  c.categories_id, 
+  cd.categories_name, 
+  c.categories_image,
+  c.parent_id from 
+  " . TABLE_CATEGORIES . " c,
+  " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+  where 
+  c.parent_id = '0' 
+ and c.categories_id = cd.categories_id 
+ and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+
+  $categories_query_cat = tep_db_query($query_cat);
+
+
+// Initiate tree traverse
+$categories_string_cat = '';
+preorder_mc(0, 0, $foo_cat, '');
+
+//////////
+// Display box contents
+//////////
+
+$info_box_contents = array();
+
+$row = 0;
+$col = 0;
+while ($categories_cat = tep_db_fetch_array($categories_query_cat))
+{
+  if ($categories['parent_id'] == 0)
+    {
+      $cpath_cat_new = tep_get_path($categories_cat['categories_id']);
+      $text_subcategories = '';
+      $subcategories_query_cat = tep_db_query($query_cat);
+      while ($subcategories_cat = tep_db_fetch_array($subcategories_query_cat))
+      {
+        if ($subcategories_cat['parent_id'] == $categories_cat['categories_id'])
+      {
+                $cPath_new_sub = "cPath="  . $categories_cat['categories_id'] . "_" . $subcategories_cat['categories_id'];
+                $text_subcategories .= '• <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">';
+                $text_subcategories .= $subcategories_cat['categories_name'] . '</a>' . " ";
+
+          } // if ($subcategories['parent_id'] == $categories['categories_id'])
+
+      } // while ($subcategories = tep_db_fetch_array($subcategories_query))
+
+    $info_box_contents[$row][$col] = array('align' => 'left',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cpath_cat_new) . '">' . tep_image(DIR_WS_IMAGES . $categories_cat['categories_image'], $categories_cat['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories_cat['categories_name'] . '</a></DIV>');
+
+      // determine the column position to see if we need to go to a new row
+      $col ++;
+      if ($col > ($item_column_number - 1))
+      {
+          $col = 0;
+          $row ++;
+
+      } //if ($col > ($number_of_columns - 1))
+
+    } //if ($categories['parent_id'] == 0)
+
+} // while ($categories = tep_db_fetch_array($categories_query))
+
+//output the contents
+new contentBox($info_box_contents);
+?>
+<!-- main_categories_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+  to change the contents of this file edit
+  includes/languages/(language)/mainpage.php
+*/
+?>
+<!-- Main_page //-->
+
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, HEADING_TITLE);
+}
+// EOF: Lango Added for template MOD
+
+
+include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE);
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<!-- Main_page_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/new_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/new_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/new_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: new_products.php,v 1.1.1.1 2004/03/04 23:41:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- mainpages_modules.new_products.php//-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
+
+  
+      $new_products_query = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+       order by rand(), p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
+
+  
+
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($new_products = tep_db_fetch_array($new_products_query)) {
+  
+    $num ++;
+      if ($num == 1) { 
+  new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+      }
+
+  $pf->loadProduct($new_products['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+
+  
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $products_price_s);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+if($num) {
+  new contentBox($info_box_contents);
+}
+
+?>
+<!-- new_products_eof //-->

Added: trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/mainpage_modules/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/*
+  $Id: upcoming_products.php,v 1.1.1.3 2004/04/07 23:42:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- upcoming_products mainpage_modules //-->
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_UPCOMING_PRODUCTS, strftime('%B')));
+
+    $expected_query_raw= tep_db_query("select
+ p.products_id,
+ pd.products_name, 
+ p.products_image, 
+    products_date_available as date_expected 
+ from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+    where 
+    to_days(products_date_available) >= to_days(now()) 
+    and p.products_id = pd.products_id 
+    and pd.language_id = '" . (int)$languages_id . "' 
+    order by rand()
+    limit " . MAX_DISPLAY_UPCOMING_PRODUCTS);
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($expected_query = tep_db_fetch_array($expected_query_raw)) {
+  
+    $num ++;
+      if ($num == 1) { 
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
+      }
+  $pf->loadProduct($expected_query['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+    
+   $duedate= str_replace("00:00:00", "" , $expected_query['date_expected']);  
+   
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $expected_query['products_image'], $expected_query['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . $expected_query['products_name'] . '</a><br>' . $products_price_s . '<br>' . TABLE_HEADING_DATE_EXPECTED . '&nbsp;' . $duedate);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+
+  }
+?>
+<!-- upcoming_products_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/E-vector/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/E-vector/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/E-vector/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,746 @@
+/*
+
+  Copyright (c) 2003 The Theme Labs
+
+  Released under the GNU General Public License
+*/
+  .cat_description {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #800000;
+    background : inherit;
+    font-weight : bold;
+}
+ .boxText {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #800000;
+    background : inherit;
+}
+ .maintableBorder {
+    background-color : #ff9900;
+    color : inherit;
+}
+ .maintableBackground {
+    background-color : #ffffff;
+    color : inherit;
+}
+ .column_left {
+    background-color : #2d6dc5;
+    color : inherit;
+}
+ .centertable {
+    background-image : url('images/bg_cat4.gif');
+    background-repeat : repeat-x;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #cc0033;
+    background : #fbfcfd;
+}
+ .errorBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #ffb3b5;
+    font-weight : bold;
+    color : inherit;
+}
+ .stockWarning {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #cc0033;
+    background : inherit;
+}
+ .productsNotifications {
+    background : #f2fff7;
+    color : inherit;
+}
+ .orderEdit {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #70d250;
+    background : inherit;
+    text-decoration : underline;
+}
+ .navBlue {
+    color : #ff0000;
+    background : inherit;
+    font-size : 8pt;
+    font-family : Verdana, Arial, sans-serif;
+}
+ .subnavBlue {
+    color : #9966ff;
+    background : inherit;
+    font-size : 8pt;
+    font-family : Verdana, Arial, sans-serif;
+}
+ body {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    color : #444444;
+    background-color : #ffffff;
+}
+ A {
+    background : inherit;
+    color : #000000;
+    text-decoration : none;
+}
+ A:hover {
+    background : inherit;
+    color : #aabbdd;
+    text-decoration : underline;
+}
+ FORM {
+    display : inline;
+}
+ TR.header {
+    color : inherit;
+    background : #ffffff;
+}
+ TR.headerNavigation {
+    color : inherit;
+    background : #cccccc;
+}
+ TD.headerNavigation {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #cccccc;
+    color : #ffffff;
+    font-weight : bold;
+}
+ A.headerNavigation {
+    color : #ffffff;
+    background : inherit;
+}
+ a:hover.headerNavigation {
+    color : #ffffff;
+    background : inherit;
+}
+ TR.headerError {
+    color : inherit;
+    background : #ff0000;
+}
+ TD.headerError {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #ff0000;
+    color : #ffffff;
+    font-weight : bold;
+    text-align : center;
+}
+ TR.headerInfo {
+    background : #00ff00;
+    color : inherit;
+}
+ TD.headerInfo {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #00ff00;
+    color : #ffffff;
+    font-weight : bold;
+    text-align : center;
+}
+ TR.footer {
+    background : #cccccc;
+    color : inherit;
+}
+ TD.footer {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #2d6ec5;
+    color : #ffffff;
+    font-weight : bold;
+}
+ .templateinfobox {
+    background : #ffffff;
+    color : inherit;
+    font-family : Verdana, Helvetica, Arial, sans-serif;
+    font-size : 10px;
+}
+ .infoBox {
+    color : inherit;
+    background : #ff9900;
+}
+TD.infoBox, SPAN.infoBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #ff9900;
+    color : inherit;
+}
+ TD.infoBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #cccccc;
+    color : #ffffff;
+}
+ .infoBoxContents {
+    color : inherit;
+    background : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ TD.infoBoxFooter {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #cccccc;
+    color : #000000;
+}
+
+ TD.contentBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #534f4d;
+    background : inherit;
+    padding-top : 5px;
+}
+ .infoBoxContentsHeader {
+    background : #cccccc;
+    color : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ .infoBoxContentsCenter {
+    color : inherit;
+    background : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+    background-color : #cccccc;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ TD.infoBoxHeadingImage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-image : url(images/infobox/background.gif);
+    background-repeat : repeat-x;
+    background-position : left;
+    background-color : #cccccc;
+    color : #ffffff;
+}
+ TD.infoBoxFooterImage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #cccccc;
+    background-image : url(images/infobox/backgroundfb.gif);
+    background-repeat : repeat-x;
+    background-position : left;
+    color : #000000;
+}
+ .infoBoxNotice {
+    color : inherit;
+    background : #ff8e90;
+}
+ .infoBoxNoticeContents {
+    color : inherit;
+    background : #ffe6e6;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.main_table_heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #cccccc;
+    color : #000000;
+}
+ TD.main_table_heading_inner {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #ffffff;
+    color : #000000;
+}
+ 
+ TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+    background : #f8f8f9;
+    color : inherit;
+}
+ TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+    background : #f8f8f9;
+    color : inherit;
+}
+ TABLE.productListing {
+    border : 0;
+    border-style : solid;
+    border-color : #b6b7cb;
+    border-spacing : 1px;
+}
+ .productListing-heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #cccccc;
+    color : #000000;
+    font-weight : bold;
+}
+ .productListing-headingPrice {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #cccccc;
+    color : #996600;
+    font-weight : bold;
+}
+ TD.productListing-data {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ A.pageResults {
+    color : #0000ff;
+    background : inherit;
+}
+ a:hover.pageResults {
+    color : #0000ff;
+    background : #ffff33;
+}
+ TD.pageHeading, DIV.pageHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 20px;
+    font-weight : bold;
+    color : #9a9a9a;
+    background : inherit;
+}
+ TR.subBar {
+    background : #f4f7fd;
+    color : inherit;
+}
+ TD.subBar {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background : inherit;
+}
+ TD.main, P.main {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+    background : inherit;
+    color : inherit;
+}
+ TD.smallText, SPAN.smallText, P.smallText {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ TD.accountCategory {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 13px;
+    color : #aabbdd;
+    background : inherit;
+}
+ TD.fieldKey {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+ TD.fieldValue {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+}
+ TD.tableHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+ TD.category_desc {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+}
+ SPAN.newItemInCart {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #ff0000;
+    background : inherit;
+}
+ CHECKBOX, INPUT, RADIO, SELECT {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+}
+ TEXTAREA {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+}
+ SPAN.greetUser {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    color : #f0a480;
+    background : inherit;
+    font-weight : bold;
+}
+ TABLE.formArea {
+    color : inherit;
+    background : #f1f9fe;
+    border-color : #7b9ebd;
+    border-style : solid;
+    border-width : 1px;
+}
+ TD.formAreaTitle {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+ SPAN.markProductOutOfStock {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    color : #c76170;
+    background : inherit;
+    font-weight : bold;
+}
+ SPAN.productSpecialPrice {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ff0000;
+    background : inherit;
+}
+ SPAN.errorText {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ff0000;
+    background : inherit;
+}
+ .moduleRowOver {
+    background-color : #d7e9f7;
+    color : inherit;
+    cursor : pointer;
+}
+ .moduleRowSelected {
+    background-color : #e9f4fc;
+    color : inherit;
+}
+ .checkoutBarFrom, .checkoutBarTo {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #8c8c8c;
+    background : inherit;
+}
+ .checkoutBarCurrent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background : inherit;
+}
+ .messageBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ .messageStackError, .messageStackWarning {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-color : #ffb3b5;
+    color : inherit;
+}
+ .messageStackSuccess {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-color : #99ff00;
+    color : inherit;
+}
+ .inputRequirement {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #ff0000;
+    background : inherit;
+}
+ TABLE.linkListing {
+    border : 1px;
+    border-style : solid;
+    border-color : #b6b7cb;
+    border-spacing : 1px;
+}
+ .linkListing-heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #cccccc;
+    color : #ffffff;
+    text-align : center;
+}
+ TD.linkListing-data {
+    border-right : 1px solid #b6b7cb;
+    border-bottom : 1px solid #b6b7cb;
+    padding : 4px;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ TR.linkListing-odd {
+    background : #f8f8f9;
+    color : inherit;
+}
+ TR.linkListing-even {
+    background : #f5f5f5;
+    color : inherit;
+}
+ .content {
+    background : inherit;
+    color : #000000;
+    font-size : 10px;
+    font-family : Verdana, Arial, sans-serif;
+}
+ TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+    color : #bdcaf0;
+    background : inherit;
+}
+ TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+    background-image : url('images/button_blank_left.gif');
+}
+ TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+    background-image : url('images/button_blank_right.gif');
+}
+ TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+    background-image : url('images/button_blank_middle.gif');
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : inherit;
+    color : #000000;
+}
+ A.HeaderPageLinks {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #000000;
+    background : inherit;
+}
+ a:hover.HeaderPageLinks {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+    color : #00ff00;
+}
+ TD.cookieUsage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #000000;
+    color : #ffffff;
+}
+ .attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #808080;
+}
+ .TR.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #808080;
+}
+ .TD.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #c0c0c0;
+}
+ .storyboxtitle {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+ .storyboxtitle A:link {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+ .storyboxtitle A:active {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+ .storyboxtitle A:visited {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+ .storyboxtitle A:hover {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ffffff;
+    font-size : 10px;
+    font-weight : bold;
+    text-decoration : underline;
+    background : inherit;
+}
+ .yearHeader {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 14px;
+    font-weight : bold;
+    color : #000000;
+    background-color : #ffffff;
+}
+ .calendarMonth {
+    background-color : #cccccc;
+    color : inherit;
+    cursor : default;
+    width : 100%;
+}
+ .calendarHeader {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    font-weight : bold;
+    color : #000000;
+    background-color : #ffffff;
+    text-decoration : none;
+    height : 22px;
+}
+ .calendarToday {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #ffcf00;
+    padding-left : 3px;
+    text-decoration : none;
+    border : 1px solid #ffffff;
+    height : 22px;
+    width : 18px;
+}
+ .calendarWeekend {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #caeeff;
+    padding-left : 3px;
+    line-height : 14px;
+    text-decoration : none;
+    border : 1px solid #ffffff;
+    height : 22px;
+    width : 18px;
+}
+ .calendar {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #ffffff;
+    padding-left : 3px;
+    line-height : 14px;
+    text-decoration : none;
+    height : 22px;
+    width : 18px;
+}
+ .event {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    color : #000000;
+    background-color : #ffffff;
+    text-decoration : none;
+    border : 1px solid #e6e6e6;
+}
+ .empty {
+    background-color : #f0faff;
+    color : inherit;
+    line-height : 14px;
+    height : 22px;
+    width : 18px;
+}
+ .calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+ .calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+ .calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+ h4.infoTitle {
+    margin-top : 0;
+    margin-right : 0;
+    margin-left : 0;
+    margin-bottom : 0.2em;
+}
+ p.infoBlurb {
+    margin-top : 0;
+    margin-right : 0;
+    margin-left : 0;
+    margin-bottom : 2em;
+}
+ TD.productPriceInListing {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #d2e9fb;
+    color : inherit;
+}
+ TD.productPriceInBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #eeeeee;
+    color : inherit;
+}
+ TD.productPriceInProdInfo {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #ccffcc;
+    color : inherit;
+}
+ #navMenu {
+    clear : both;
+    height : 0.01%;
+    margin : 0;
+    padding : 0;
+    list-style : none;
+}
+ #navMenu ul {
+    float : left;
+    width : 150px;
+    margin : 0;
+    padding : 0;
+    list-style : none;
+}
+ #navMenu li {
+    position : relative;
+    float : left;
+    line-height : 24px;
+    margin-bottom : -1px;
+    width : 150px;
+}
+ #navMenu li ul {
+    position : absolute;
+    left : -999em;
+    margin-left : 150px;
+    margin-top : -26px;
+}
+ #navMenu li ul ul {
+    left : -999em;
+}
+ #navMenu li a {
+    width : 150px;
+    display : block;
+    color : #334;
+    font-weight : bold;
+    text-decoration : none;
+    background : #ffffff;
+    border : 1px solid #cce;
+    padding-left : 2px;
+}
+ #navMenu li a:hover {
+    color : #000000;
+    background : #aac;
+}
+ #navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+    left : -999em;
+}
+ #navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+    left : auto;
+}

Added: trunk/direct.openmoko.com/templates/Evector_ats/Evector_ats.sql
===================================================================
--- trunk/direct.openmoko.com/templates/Evector_ats/Evector_ats.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Evector_ats/Evector_ats.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#000000');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "Evector_ats.gif", template_cellpadding_main ="2", template_cellpadding_sub= "3", template_cellpadding_left= "2", template_cellpadding_right= "2", site_width= "776", include_column_left= "yes", include_column_right= "yes", box_width_left= "150", box_width_right= "150", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no", show_header_link_buttons="yes", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width="1", side_box_right_width="1" WHERE template_id="#tID#"
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Evector_ats/doc/buttonspec.txt
===================================================================
--- trunk/direct.openmoko.com/templates/Evector_ats/doc/buttonspec.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Evector_ats/doc/buttonspec.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+Evector 2 Buttons
+This file is intended to help adding more buttons when they are needed.
+It putpose is to discribe how the button were made so that they
+can be duplicated in the future.
+
+Original Spec:
+   background color: R 17 G 24 B 41
+   Boarder color: Black
+   height: 18 Pixels
+   Font: Unkowen 
+---------------------------------------------------
+New
+Button Software: Deknop
+Formate: .gif
+LZW compression: Ulead photoimpact SE 4.2.
+
+ Background color: R 45 G 109 B 197
+   Boarder color:  R 0  G 0  B 128
+   height: 18 Pixels 
+   Width: variable
+Font: Arial
+Font style: Bold
+Font Size: 10 points
+Font color: R:0 G:0 B: 0 (white)

Added: trunk/direct.openmoko.com/templates/Evector_ats/doc/evector.btn
===================================================================
--- trunk/direct.openmoko.com/templates/Evector_ats/doc/evector.btn	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Evector_ats/doc/evector.btn	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+[dimensions]
+left=0
+top=5
+butwidth=112
+butheight=16
+bevelwidth=0
+borderwidth=1
+leftmar=0
+rightmar=0
+topmar=0
+halign=1
+valign=1
+butup=0
+glintens=100
+[Window]
+split1=217
+split2=235
+split3=127
+[colors]
+font=clWhite
+background=$00C08000
+canvas=$00848484
+uppercolor=$00804000
+downcolor=$00804000
+border=clNavy
+slower=clWhite
+supper=clWhite
+transcolor=5
+[font]
+name=Arial
+charset=0
+size=9
+bold=1
+italic=0
+underline=0
+style=0
+AntiAF=0
+[text]
+morecaptions=Create Account
+wordwrap=0
+prefix=button_
+suffix=
+usefix=1
+[gradient]
+use=0
+begincolor=$00FF8080
+endcolor=clWhite
+kind=4
+[gradientT]
+use=0
+endcolor=clWhite
+begincolor=clWhite
+kind=1
+[3d]
+style=0
+color=clWhite
+depth=8
+[shadow]
+color=clGray
+diam=2
+use=0
+xpos=3
+ypos=3
+[files]
+alfabet=0
+ufnamech=0
+ufname=printorder
+jpgcom=75
+saveIas=2
+LSI=C:\AppServ\www\loaded61b\templates\E-vector\images\buttons\english\button_createaccount.gif
+LSIS=
+[neo]
+mode=0
+cap=new
+bmpname=[none]
+usetrcolor=1
+trcolor=clOlive
+[trans]
+use=0
+pos=7
+[texture]
+usebt=0
+kindbt=2
+filebt=
+posx=0
+posy=0
+transby=1
+usete=0
+filete=
+inten=50
+[paths]
+use=0

Added: trunk/direct.openmoko.com/templates/Evector_ats/doc/readmetabs.txt
===================================================================
--- trunk/direct.openmoko.com/templates/Evector_ats/doc/readmetabs.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Evector_ats/doc/readmetabs.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+these are the original tabs for Evector_v2
+the can be cut and pasted to replace the ones installed now.
+set1
+
+<table WIDTH="<?php echo SITE_WIDTH;?>" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr>
+<td width="100%" background="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_11.gif"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_05.gif" WIDTH=261 HEIGHT=23 ALT=""></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_09.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="48"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_DEFAULT);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_06.gif" ALT="Homepage" WIDTH=48 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="54"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_PRODUCTS_NEW);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_08.gif" ALT="Our FAQ's" WIDTH=54 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="74"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_REVIEWS);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_10.gif" ALT="Reviews" WIDTH=74 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="24"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=24 HEIGHT=23 ALT=""></td>
+<td WIDTH="52"><a HREF="<?php echo tep_href_link(FILENAME_NEWSDESK_INDEX);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_12.gif" ALT="Latest news" WIDTH=52 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="94"><a HREF="#"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_14.gif" ALT="Downloads" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="77"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_CONTACT_US);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_16.gif" ALT="Contact Us" WIDTH=77 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+
+</tr>
+</table>
+
+
+set2
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Evector_ats/header.php
===================================================================
--- trunk/direct.openmoko.com/templates/Evector_ats/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Evector_ats/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,135 @@
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+if (SITE_WIDTH!='100%') {
+?>
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <tbody>
+  <tr>
+    <td>
+    <table CELLSPACING="0" CELLPADDING="0" BORDER="0" width="<?php echo SITE_WIDTH; ?>" align="center">
+      <tbody>
+      <tr>
+        <td>
+        <table border="0" width="100%">
+          <tbody>
+          <tr>
+            <td>
+      <?php } ?>
+<table WIDTH="<?php echo SITE_WIDTH;?>" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr>
+<td style="background-image: url('<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_01ab.gif');background-repeat: repeat-x;"  WIDTH=279 HEIGHT=16>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+</td>
+<td style="background-image: url('<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_02.gif');background-repeat: repeat-x;">
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
+</td>
+<tr>
+<td><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_01d.gif" WIDTH=279 ALT=""></td>
+<td>
+<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr>
+<td width="100%"> </td>
+</tr>
+<tr>
+<td> <table WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+
+<tr>
+<td HEIGHT="60" ALIGN="center">
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+  if ($banner = tep_banner_exists('dynamic', '468x50')) {
+?>
+  <tr class="ShowCartDetails">
+    <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
+</tr>
+<?php
+ }
+?>
+<tr>
+ <td>
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" class="ShowCartDetails">
+<?php
+if (SHOW_CART_IN_HEADER =='yes'){
+ require(DIR_WS_INCLUDES . FILENAME_SEARCH_IN_HEADER); 
+  }?>
+  </td>
+    <td align="center" class="ShowCartDetails">
+<?php
+   if (SHOW_CART_IN_HEADER =='yes') {
+      echo  $cart->count_contents() . ($cart->count_contents() == "1" ? TEXT_CART_COUNT : TEXT_CART_COUNTS); ?> &nbsp;&nbsp; <?php echo $currencies->format($cart->show_total()); ?> &nbsp;&nbsp; <?php echo $cart->show_weight() . ($cart->show_weight() == "1" ? TEXT_CART_WEIGHT : TEXT_CART_WEIGHTS);?>&nbsp;&nbsp;&nbsp;
+<?php
+ }
+?>
+   </td>
+   </tr>
+   </table>
+   </td>
+  </tr>
+</table>
+
+</td>
+
+</tr>
+</table></td>
+<tr>
+<td width="100%"></td>
+</tr>
+</table></td>
+</tr>
+</table>
+<table WIDTH="<?php echo SITE_WIDTH;?>" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr>
+<td width="100%" style="background-image: url('<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_11.gif');background-repeat: repeat-x;"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_05.gif" WIDTH=261 HEIGHT=23 alt="<?php echo IMAGE_ALT;?>"></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_09.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="48"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_DEFAULT);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/home.gif" ALT="<?php echo ALT_HOMEPAGE;?>" WIDTH=48 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+
+ <?php
+      if (!tep_session_is_registered('noaccount')){// DDB - PWA - 040622 - no display of logoff for PWA customers
+         if (!tep_session_is_registered('customer_id')) {
+        echo ' <td WIDTH="94"><a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '"> <img SRC="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/login.gif" ALT="'.LOGIN_ALT.'" WIDTH=54 HEIGHT=23 BORDER="0"></a></td>';
+          } else {
+        echo '<td WIDTH="54"> <a class="headerNavigation" href="' . tep_href_link(FILENAME_ACCOUNT, "", "SSL") . '"><img SRC="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/my_account.gif" ALT="'.MYACCOUNT_ALT.'" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>';
+          }
+         }
+
+     if (tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers
+       {
+     if (!tep_session_is_registered('customer_id')) {
+        echo '<td WIDTH="54"> <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '"><img SRC="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/login.gif" ALT="'.LOGIN_ALT.'" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>';
+   }else{
+        echo '<td WIDTH="54"> <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '"><img SRC="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/logoff.gif" ALT="'.LOGOFF_ALT.'" WIDTH=54 HEIGHT=23 BORDER="0"></a></td>';
+      }
+      }
+       ?>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="93"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_SPECIALS);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/specials.gif" ALT="<?php echo SPECIALS_ALT;?>" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+<td WIDTH="94"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_PRODUCTS_NEW);?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/whatsnew.gif" ALT="<?php echo WHATS_NEW_ALT;?>" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=24 HEIGHT=23 ALT=""></td>
+<td WIDTH="94"><a class="headerNavigation" href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'SSL');?>"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/contact_us.gif" ALT="<?php echo CONTACT_US_ALT;?>" WIDTH=94 HEIGHT=23 BORDER="0"></a></td>
+<td WIDTH="20"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_07.gif" WIDTH=20 HEIGHT=23 ALT=""></td>
+</tr>
+</table>
+
+<table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+
+<tr>
+<td WIDTH="218"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/under_header.gif" WIDTH="218" HEIGHT="48" alt="<?php echo IMAGE_ALT;?>"></td>
+<td WIDTH="50%" align="center">
+
+<?php  if (SHOW_LANGUAGES_IN_HEADER=='yes'){ ?>
+<td ALIGN="CENTER" WIDTH="<?php echo BOX_WIDTH_RIGHT; ?>">
+
+<?php
+ require(DIR_WS_INCLUDES . FILENAME_LANGUAGES_IN_HEADER); ?></td>
+<?php } ?>
+</tr>
+</table>
+
+<?php } ?>
+<!-- header_eof //-->

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/Evector.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/Evector.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/Evector_ats.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/Evector_ats.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_done.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_done.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_more_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_more_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/readme.txt
===================================================================
--- trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/readme.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/readme.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,30 @@
+Yellow Buttons v1.0 for OSC 2.2 MS1
+
+Author: Jesse Rooney
+
+Released under the GNU General Public License
+
+Hosting & Design at http://www.resomedia.com
+
+
+Used in OSC 2.2 MS1
+
+Havent tested it with ms2 yet (post comments in the contrib forum if it works)
+
+
+
+************************
+
+INSTALL - Simple, but I will explain
+
+************************
+
+
+Unzip and upload to
+
+includes/languages/english/images/buttons
+
+
+**********************************************************************************************
+*osCommerce provides no warranty and is redistributable under the GNU General Public License *
+**********************************************************************************************

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/contact_us.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/contact_us.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_007.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_007.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_01a.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_01a.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_01ab.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_01ab.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_01d.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_01d.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_07.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_07.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_09.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_09.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_11.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_11.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_13.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_13.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_15.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_15.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/header_17.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/header_17.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/home.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/home.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/arrow_main.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/arrow_main.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background_box.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background_box.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background_main.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/background_main.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/backgroundfb.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/backgroundfb.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/bm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/bm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/bottom_center.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/bottom_center.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/box_bg_l.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/box_bg_l.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/box_bg_r.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/box_bg_r.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_left_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/no_arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/no_arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/pixel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/pixel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/q1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/q1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/q2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/q2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/r1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/r1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/r2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/infobox/r2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/logoff.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/logoff.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/my_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/my_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/pixel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/pixel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/pointer_blue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/pointer_blue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/pointer_blue_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/pointer_blue_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/spacer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/spacer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/specials.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/specials.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/under_header.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/under_header.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/under_headerbg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/under_headerbg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/images/whatsnew.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Evector_ats/images/whatsnew.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Evector_ats/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Evector_ats/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Evector_ats/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,162 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body BGCOLOR=#FFFFFF >
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+<!-- warning_eof //-->
+<!-- header //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_HEADER); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_MAIN; ?>" class="centertable">
+  <tr>
+<?php
+if (DISPLAY_COLUMN_LEFT == 'yes')  {
+// WebMakers.com Added: Down for Maintenance
+// Hide column_left.php if not to show
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+?>
+
+<td WIDTH="3" bgcolor="#2D6DC5"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/spacer.gif" WIDTH="3" HEIGHT="1" alt="<?php echo IMAGE_ALT;?>"></td>
+
+
+    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top" class="column_left"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+
+<td WIDTH="3" bgcolor="#2D6DC5"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/spacer.gif" WIDTH="3" HEIGHT="1" alt="<?php echo IMAGE_ALT;?>"></td>
+<?php
+}
+}
+?>
+<!-- content //-->
+<td WIDTH="100%" ALIGN="CENTER" VALIGN="TOP">
+
+<?php
+ if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template))) {
+
+   require(DIR_WS_CONTENT . basename($content_template));
+  } else {
+   require(DIR_WS_CONTENT . $content . '.tpl.php');
+
+  }
+?>
+
+</td>
+<!-- content_eof //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide column_right.php if not to show
+
+if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+require(DIR_WS_INCLUDES . FILENAME_COUNTER); ?>
+<table BGCOLOR="#2D6EC5" WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+<tr class="footer">
+    <td class="footer">&nbsp;&nbsp;<?php echo strftime(DATE_FORMAT_LONG); ?>&nbsp;&nbsp;</td>
+    <td align="right" class="footer">&nbsp;&nbsp;<?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>&nbsp;&nbsp;</td>
+  </tr>
+  </table>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<tr>
+<td BGCOLOR="#2D6EC5"><table WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="6">
+<tr>
+  <td >
+<?php 
+//google banner ad
+if (!(getenv('HTTPS')=='on')){
+if (tep_banner_exists('dynamic','googlefoot') ) {
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', 'googlefoot'); ?></td>
+  </tr>
+</table>
+
+<?php
+  } }
+?>
+
+<?php 
+if ( tep_banner_exists('dynamic','468x50') ) { ?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', '468x50'); ?></td>
+  </tr>
+</table>
+
+<?php
+  }
+?>
+  </td>
+</tr>
+<tr>
+<td CLASS="footer" ALIGN="CENTER">
+<?php
+ echo FOOTER_TEXT_BODY
+?>
+</td>
+</tr>
+</table>
+<table WIDTH="<?php echo SITE_WIDTH;?>" BORDER="0" CELLPADDING="0" CELLSPACING="0">
+<tr>
+<td ALIGN="RIGHT"style="background-image: url('<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_007.gif');background-repeat: repeat-y;"><img SRC="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_17.gif" WIDTH="150" HEIGHT="23" BORDER="0" alt="image" USEMAP="#Map"></td>
+</tr>
+</table>
+<map NAME="Map">
+<area SHAPE="RECT" COORDS="2,8,147,19" HREF="http://www.themelabs.com" TARGET="_blank">
+</map>
+<?php
+}
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+if (SITE_WIDTH != '100%') {
+?>
+         </td></tr></table>
+       </td></tr>
+     </table>
+   </td>
+  </tr>
+</table>
+<?php
+}
+// EOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+?>
+<!-- footer_eof //-->
+</body>
+</html>

Added: trunk/direct.openmoko.com/templates/Evector_ats/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/Evector_ats/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Evector_ats/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,746 @@
+/*
+
+  Copyright (c) 2003 The Theme Labs
+
+  Released under the GNU General Public License
+*/
+  .cat_description {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #800000;
+    background : inherit;
+    font-weight : bold;
+}
+ .boxText {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #800000;
+    background : inherit;
+}
+ .maintableBorder {
+    background-color : #ff9900;
+    color : inherit;
+}
+ .maintableBackground {
+    background-color : #ffffff;
+    color : inherit;
+}
+ .column_left {
+    background-color : #2d6dc5;
+    color : inherit;
+}
+ .centertable {
+    background-image : url('images/bg_cat4.gif');
+    background-repeat : repeat-x;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #cc0033;
+    background : #fbfcfd;
+}
+ .errorBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #ffb3b5;
+    font-weight : bold;
+    color : inherit;
+}
+ .stockWarning {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #cc0033;
+    background : inherit;
+}
+ .productsNotifications {
+    background : #f2fff7;
+    color : inherit;
+}
+ .orderEdit {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #70d250;
+    background : inherit;
+    text-decoration : underline;
+}
+ .navBlue {
+    color : #ff0000;
+    background : inherit;
+    font-size : 8pt;
+    font-family : Verdana, Arial, sans-serif;
+}
+ .subnavBlue {
+    color : #9966ff;
+    background : inherit;
+    font-size : 8pt;
+    font-family : Verdana, Arial, sans-serif;
+}
+ body {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    color : #444444;
+    background-color : #ffffff;
+}
+ A {
+    background : inherit;
+    color : #000000;
+    text-decoration : none;
+}
+ A:hover {
+    background : inherit;
+    color : #aabbdd;
+    text-decoration : underline;
+}
+ FORM {
+    display : inline;
+}
+ TR.header {
+    color : inherit;
+    background : #ffffff;
+}
+ TR.headerNavigation {
+    color : inherit;
+    background : #cccccc;
+}
+ TD.headerNavigation {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #cccccc;
+    color : #ffffff;
+    font-weight : bold;
+}
+ A.headerNavigation {
+    color : #ffffff;
+    background : inherit;
+}
+ a:hover.headerNavigation {
+    color : #ffffff;
+    background : inherit;
+}
+ TR.headerError {
+    color : inherit;
+    background : #ff0000;
+}
+ TD.headerError {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #ff0000;
+    color : #ffffff;
+    font-weight : bold;
+    text-align : center;
+}
+ TR.headerInfo {
+    background : #00ff00;
+    color : inherit;
+}
+ TD.headerInfo {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #00ff00;
+    color : #ffffff;
+    font-weight : bold;
+    text-align : center;
+}
+ TR.footer {
+    background : #cccccc;
+    color : inherit;
+}
+ TD.footer {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #2d6ec5;
+    color : #ffffff;
+    font-weight : bold;
+}
+ .templateinfobox {
+    background : #ffffff;
+    color : inherit;
+    font-family : Verdana, Helvetica, Arial, sans-serif;
+    font-size : 10px;
+}
+ .infoBox {
+    color : inherit;
+    background : #ff9900;
+}
+TD.infoBox, SPAN.infoBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #ff9900;
+    color : inherit;
+}
+ TD.infoBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #cccccc;
+    color : #ffffff;
+}
+ .infoBoxContents {
+    color : inherit;
+    background : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ TD.infoBoxFooter {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #cccccc;
+    color : #000000;
+}
+
+ TD.contentBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #534f4d;
+    background : inherit;
+    padding-top : 5px;
+}
+ .infoBoxContentsHeader {
+    background : #cccccc;
+    color : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ .infoBoxContentsCenter {
+    color : inherit;
+    background : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+    background-color : #cccccc;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ TD.infoBoxHeadingImage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-image : url(images/infobox/background.gif);
+    background-repeat : repeat-x;
+    background-position : left;
+    background-color : #cccccc;
+    color : #ffffff;
+}
+ TD.infoBoxFooterImage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #cccccc;
+    background-image : url(images/infobox/backgroundfb.gif);
+    background-repeat : repeat-x;
+    background-position : left;
+    color : #000000;
+}
+ .infoBoxNotice {
+    color : inherit;
+    background : #ff8e90;
+}
+ .infoBoxNoticeContents {
+    color : inherit;
+    background : #ffe6e6;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.main_table_heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #cccccc;
+    color : #000000;
+}
+ TD.main_table_heading_inner {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #ffffff;
+    color : #000000;
+}
+ 
+ TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+    background : #f8f8f9;
+    color : inherit;
+}
+ TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+    background : #f8f8f9;
+    color : inherit;
+}
+ TABLE.productListing {
+    border : 0;
+    border-style : solid;
+    border-color : #b6b7cb;
+    border-spacing : 1px;
+}
+ .productListing-heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #cccccc;
+    color : #000000;
+    font-weight : bold;
+}
+ .productListing-headingPrice {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #cccccc;
+    color : #996600;
+    font-weight : bold;
+}
+ TD.productListing-data {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ A.pageResults {
+    color : #0000ff;
+    background : inherit;
+}
+ a:hover.pageResults {
+    color : #0000ff;
+    background : #ffff33;
+}
+ TD.pageHeading, DIV.pageHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 20px;
+    font-weight : bold;
+    color : #9a9a9a;
+    background : inherit;
+}
+ TR.subBar {
+    background : #f4f7fd;
+    color : inherit;
+}
+ TD.subBar {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background : inherit;
+}
+ TD.main, P.main {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+    background : inherit;
+    color : inherit;
+}
+ TD.smallText, SPAN.smallText, P.smallText {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ TD.accountCategory {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 13px;
+    color : #aabbdd;
+    background : inherit;
+}
+ TD.fieldKey {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+ TD.fieldValue {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+}
+ TD.tableHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+ TD.category_desc {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+}
+ SPAN.newItemInCart {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #ff0000;
+    background : inherit;
+}
+ CHECKBOX, INPUT, RADIO, SELECT {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+}
+ TEXTAREA {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+}
+ SPAN.greetUser {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    color : #f0a480;
+    background : inherit;
+    font-weight : bold;
+}
+ TABLE.formArea {
+    color : inherit;
+    background : #f1f9fe;
+    border-color : #7b9ebd;
+    border-style : solid;
+    border-width : 1px;
+}
+ TD.formAreaTitle {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+ SPAN.markProductOutOfStock {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    color : #c76170;
+    background : inherit;
+    font-weight : bold;
+}
+ SPAN.productSpecialPrice {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ff0000;
+    background : inherit;
+}
+ SPAN.errorText {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ff0000;
+    background : inherit;
+}
+ .moduleRowOver {
+    background-color : #d7e9f7;
+    color : inherit;
+    cursor : pointer;
+}
+ .moduleRowSelected {
+    background-color : #e9f4fc;
+    color : inherit;
+}
+ .checkoutBarFrom, .checkoutBarTo {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #8c8c8c;
+    background : inherit;
+}
+ .checkoutBarCurrent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background : inherit;
+}
+ .messageBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ .messageStackError, .messageStackWarning {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-color : #ffb3b5;
+    color : inherit;
+}
+ .messageStackSuccess {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-color : #99ff00;
+    color : inherit;
+}
+ .inputRequirement {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #ff0000;
+    background : inherit;
+}
+ TABLE.linkListing {
+    border : 1px;
+    border-style : solid;
+    border-color : #b6b7cb;
+    border-spacing : 1px;
+}
+ .linkListing-heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #cccccc;
+    color : #ffffff;
+    text-align : center;
+}
+ TD.linkListing-data {
+    border-right : 1px solid #b6b7cb;
+    border-bottom : 1px solid #b6b7cb;
+    padding : 4px;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+ TR.linkListing-odd {
+    background : #f8f8f9;
+    color : inherit;
+}
+ TR.linkListing-even {
+    background : #f5f5f5;
+    color : inherit;
+}
+ .content {
+    background : inherit;
+    color : #000000;
+    font-size : 10px;
+    font-family : Verdana, Arial, sans-serif;
+}
+ TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+    color : #bdcaf0;
+    background : inherit;
+}
+ TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+    background-image : url('images/button_blank_left.gif');
+}
+ TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+    background-image : url('images/button_blank_right.gif');
+}
+ TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+    background-image : url('images/button_blank_middle.gif');
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : inherit;
+    color : #000000;
+}
+ A.HeaderPageLinks {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #000000;
+    background : inherit;
+}
+ a:hover.HeaderPageLinks {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+    color : #00ff00;
+}
+ TD.cookieUsage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #000000;
+    color : #ffffff;
+}
+ .attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #808080;
+}
+ .TR.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #808080;
+}
+ .TD.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #c0c0c0;
+}
+ .storyboxtitle {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+ .storyboxtitle A:link {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+ .storyboxtitle A:active {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+ .storyboxtitle A:visited {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+ .storyboxtitle A:hover {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ffffff;
+    font-size : 10px;
+    font-weight : bold;
+    text-decoration : underline;
+    background : inherit;
+}
+ .yearHeader {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 14px;
+    font-weight : bold;
+    color : #000000;
+    background-color : #ffffff;
+}
+ .calendarMonth {
+    background-color : #cccccc;
+    color : inherit;
+    cursor : default;
+    width : 100%;
+}
+ .calendarHeader {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    font-weight : bold;
+    color : #000000;
+    background-color : #ffffff;
+    text-decoration : none;
+    height : 22px;
+}
+ .calendarToday {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #ffcf00;
+    padding-left : 3px;
+    text-decoration : none;
+    border : 1px solid #ffffff;
+    height : 22px;
+    width : 18px;
+}
+ .calendarWeekend {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #caeeff;
+    padding-left : 3px;
+    line-height : 14px;
+    text-decoration : none;
+    border : 1px solid #ffffff;
+    height : 22px;
+    width : 18px;
+}
+ .calendar {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #ffffff;
+    padding-left : 3px;
+    line-height : 14px;
+    text-decoration : none;
+    height : 22px;
+    width : 18px;
+}
+ .event {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    color : #000000;
+    background-color : #ffffff;
+    text-decoration : none;
+    border : 1px solid #e6e6e6;
+}
+ .empty {
+    background-color : #f0faff;
+    color : inherit;
+    line-height : 14px;
+    height : 22px;
+    width : 18px;
+}
+ .calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+ .calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+ .calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+ h4.infoTitle {
+    margin-top : 0;
+    margin-right : 0;
+    margin-left : 0;
+    margin-bottom : 0.2em;
+}
+ p.infoBlurb {
+    margin-top : 0;
+    margin-right : 0;
+    margin-left : 0;
+    margin-bottom : 2em;
+}
+ TD.productPriceInListing {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #d2e9fb;
+    color : inherit;
+}
+ TD.productPriceInBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #eeeeee;
+    color : inherit;
+}
+ TD.productPriceInProdInfo {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #ccffcc;
+    color : inherit;
+}
+ #navMenu {
+    clear : both;
+    height : 0.01%;
+    margin : 0;
+    padding : 0;
+    list-style : none;
+}
+ #navMenu ul {
+    float : left;
+    width : 150px;
+    margin : 0;
+    padding : 0;
+    list-style : none;
+}
+ #navMenu li {
+    position : relative;
+    float : left;
+    line-height : 24px;
+    margin-bottom : -1px;
+    width : 150px;
+}
+ #navMenu li ul {
+    position : absolute;
+    left : -999em;
+    margin-left : 150px;
+    margin-top : -26px;
+}
+ #navMenu li ul ul {
+    left : -999em;
+}
+ #navMenu li a {
+    width : 150px;
+    display : block;
+    color : #334;
+    font-weight : bold;
+    text-decoration : none;
+    background : #ffffff;
+    border : 1px solid #cce;
+    padding-left : 2px;
+}
+ #navMenu li a:hover {
+    color : #000000;
+    background : #aac;
+}
+ #navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+    left : -999em;
+}
+ #navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+    left : auto;
+}

Added: trunk/direct.openmoko.com/templates/Evector_ats/template.php
===================================================================
--- trunk/direct.openmoko.com/templates/Evector_ats/template.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Evector_ats/template.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: original.php,
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 CRE Loaded
+
+  Released under the GNU General Public License
+*/
+define('TEMPLATE_NAME', 'Evector_ats');
+define('TEMPLATE_VERSION', '1.0');
+define('TEMPLATE_SYSTEM', 'ATS');
+define('TEMPLATE_AUTHOR', ' ');
+
+//used to get boxes from default
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_CATALOG . 'templates/default/boxes');
+define('DIR_FS_TEMPLATE_MAINPAGES', DIR_FS_CATALOG . 'templates/default/mainpage_modules/');
+
+define('TEMPLATE_IMAGE_DIRECTORY',DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images');
+define('DIR_WS_TEMPLATE_IMAGES', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/');
+
+//which files to use
+define('TEMPLATE_BOX_TPL', DIR_WS_TEMPLATES . '/default/boxes.tpl.php');
+define('TEMPLATE_HTML_OUT', DIR_WS_TEMPLATES  . '/default/extra_html_output.php' );
+
+
+//variables moved from box.tpl.php
+define('TEMPLATE_TABLE_BORDER', '0');
+define('TEMPLATE_TABLE_WIDTH', '100%');
+define('TEMPLATE_TABLE_CELLSPACING', '0');
+define('TEMPLATE_TABLE_CELLPADDIING', '0');
+define('TEMPLATE_TABLE_PARAMETERS', '');
+define('TEMPLATE_TABLE_ROW_PARAMETERS', '');
+define('TEMPLATE_TABLE_DATA_PARAMETERS', '');
+define('TEMPLATE_TABLE_CONTENT_CELLPADING', '0');
+define('TEMPLATE_TABLE_CENTER_CONTENT_CELLPADING', '6');
+
+//for sidebox footer dusplay these images 
+define('TEMPLATE_BOX_IMAGE_FOOTER_LEFT', 'true');
+define('TEMPLATE_BOX_IMAGE_FOOTER_RIGHT', 'true');
+define('TEMPLATE_BOX_IMAGE_FOOTER_RIGHT_ARROW', 'true');
+define('TEMPLATE_BOX_IMAGE_FOOTER_LEFTRIGHT', 'true');
+//for side header display these images
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFT', 'true');
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_RIGHT', 'true');
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFTRIGHT', 'true');
+
+//for content header
+define('TEMPLATE_IMAGE_BORDER_TOP_LEFT', 'false');
+define('TEMPLATE_IMAGE_BORDER_TOP_RIGHT', 'false');
+//include footer
+define('TEMPLATE_INCLUDE_FOOTER', 'true');
+//images to use or html
+
+define('TEMPLATE_BOX_IMAGE_TOP_TRANS', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/pixel_trans.gif');
+
+//box header images
+define('TEMPLATE_BOX_IMAGE_TOP_LEFT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_RIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_LEFTRIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_RIGHTARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_NOARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_BACKGROUND', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/pixel_trans.gif');
+
+//box footer images
+define('TEMPLATE_BOX_IMAGE_FOOT_LEFT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_RIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/backgroundfb.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_NOARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '');
+
+// box middles images
+define('TEMPLATE_BOX_MIDDLE_LEFT_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif');
+define('TEMPLATE_BOX_MIDDLE_MIDDLE_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background_box.gif');
+define('TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Helius/Helius.sql
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/Helius.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/Helius.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#0000FF');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "Helius.gif", template_cellpadding_main ="2", template_cellpadding_sub= "10", template_cellpadding_left= "3", template_cellpadding_right= "3", site_width= "776", include_column_left= "yes", include_column_right= "yes", box_width_left= "150", box_width_right= "150", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no", show_header_link_buttons="yes", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width="8", side_box_right_width="12" WHERE template_id="#tID#"
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Helius/boxes/affiliate.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: affiliate.php,v 1.1.1.1 2004/03/04 23:42:13 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 - 2003 osCommerce
+   
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3419 $
+
+  Released under the GNU General Public License
+*/
+?>          
+<!-- affiliate_system //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_AFFILIATE . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (tep_session_is_registered('affiliate_id')) {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . BOX_AFFILIATE_SUMMARY . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, '', 'SSL'). '">' . BOX_AFFILIATE_NEWS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL'). '">' . BOX_AFFILIATE_ACCOUNT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'). '">' . BOX_AFFILIATE_PAYMENT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'). '">' . BOX_AFFILIATE_CLICKRATE . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'). '">' . BOX_AFFILIATE_SALES . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS). '">' . BOX_AFFILIATE_BANNERS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_FAQ). '">' . BOX_AFFILIATE_FAQ . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_LOGOUT). '">' . BOX_AFFILIATE_LOGOUT . '</a>');
+  } else {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_INFO). '">' . BOX_AFFILIATE_INFO . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . BOX_AFFILIATE_LOGIN . '</a>');
+  }
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- affiliate_system_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/articles.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,226 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_topic($counter) {
+    global $tree, $topics_string, $tPath_array;
+
+    for ($i=0; $i<$tree[$counter]['level']; $i++) {
+      $topics_string .= "&nbsp;&nbsp;";
+    }
+
+    $topics_string .= '<a href="';
+
+    if ($tree[$counter]['parent'] == 0) {
+      $tPath_new = 'tPath=' . $counter;
+    } else {
+      $tPath_new = 'tPath=' . $tree[$counter]['path'];
+    }
+
+    $topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '<b>';
+    }
+
+// display topic name
+    $topics_string .= $tree[$counter]['name'];
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '</b>';
+    }
+
+    if (tep_has_topic_subtopics($counter)) {
+      $topics_string .= ' -&gt;';
+    }
+
+    $topics_string .= '</a>';
+
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_in_topic = tep_count_articles_in_topic($counter);
+      if ($articles_in_topic > 0) {
+        $topics_string .= '&nbsp;(' . $articles_in_topic . ')';
+      }
+    }
+
+    $topics_string .= '<br>';
+
+    if ($tree[$counter]['next_id'] != false) {
+      tep_show_topic($tree[$counter]['next_id']);
+    }
+  }
+?>
+<!-- topics //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_ARTICLES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $topics_string = '';
+  $tree = array();
+
+  $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '0' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+  while ($topics = tep_db_fetch_array($topics_query))  {
+    $tree[$topics['topics_id']] = array('name' => $topics['topics_name'],
+                                        'parent' => $topics['parent_id'],
+                                        'level' => 0,
+                                        'path' => $topics['topics_id'],
+                                        'next_id' => false);
+
+    if (isset($parent_id)) {
+      $tree[$parent_id]['next_id'] = $topics['topics_id'];
+    }
+
+    $parent_id = $topics['topics_id'];
+
+    if (!isset($first_topic_element)) {
+      $first_topic_element = $topics['topics_id'];
+    }
+  }
+
+  //------------------------
+  if (tep_not_null($tPath)) {
+    $new_path = '';
+    reset($tPath_array);
+    while (list($key, $value) = each($tPath_array)) {
+      unset($parent_id);
+      unset($first_id);
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$value . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+      if (tep_db_num_rows($topics_query)) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($topics_query)) {
+          $tree[$row['topics_id']] = array('name' => $row['topics_name'],
+                                           'parent' => $row['parent_id'],
+                                           'level' => $key+1,
+                                           'path' => $new_path . '_' . $row['topics_id'],
+                                           'next_id' => false);
+
+          if (isset($parent_id)) {
+            $tree[$parent_id]['next_id'] = $row['topics_id'];
+          }
+
+          $parent_id = $row['topics_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['topics_id'];
+          }
+
+          $last_id = $row['topics_id'];
+        }
+        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
+        $tree[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_topic($first_topic_element);
+
+  $info_box_contents = array();
+  $new_articles_string = '';
+  $all_articles_string = '';
+
+  if (DISPLAY_NEW_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_new_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and(a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = ad.articles_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a2t.topics_id = td.topics_id 
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'
+                                            and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY)");
+      $articles_new_count = ' (' . tep_db_num_rows($articles_new_query) . ')';
+    } else {
+      $articles_new_count = '';
+    }
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string = '<b>';
+    }
+
+    $new_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES_NEW, '', 'NONSSL') . '">' . BOX_NEW_ARTICLES . '</a>';
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string .= '</b>';
+    }
+
+    $new_articles_string .= $articles_new_count . '<br>';
+
+  }
+
+  if (DISPLAY_ALL_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_all_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a.articles_id = ad.articles_id
+                                            and a2t.topics_id = td.topics_id
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'");
+      $articles_all_count = ' (' . tep_db_num_rows($articles_all_query) . ')';
+    } else {
+      $articles_all_count = '';
+    }
+
+    if ($topic_depth == 'top') {
+      $all_articles_string = '<b>';
+    }
+
+    $all_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES, '', 'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a>';
+
+    if ($topic_depth == 'top') {
+      $all_articles_string .= '</b>';
+    }
+
+    $all_articles_string .= $articles_all_count . '<br>';
+
+  }
+
+  $info_box_contents[] = array('text' => $new_articles_string . $all_articles_string . $topics_string);
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- topics_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/asearch.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/asearch.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/asearch.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: asearch.php
+  searches articles using article_manager
+  by AlDaffodil (aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- article search //-->
+          <tr>
+            <td>
+<?php
+ //if (ALLOW_QUICK_SEARCH_DESCRIPTION == 'true') {
+  //  $param = '<input type="hidden" name="search_in_description" value="1">';
+ //  } else {
+      $param = '';
+// }
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_ASEARCH . '</font>');
+     new infoBoxHeading($info_box_contents, false, false);
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find_article" method="get" action="' . tep_href_link(FILENAME_ARTICLE_SEARCH, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . $param . '<input type="text" name="akeywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["akeywords"])) . '">' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><input type="checkbox" name="description">' . BOX_ASEARCH_TEXT . '<br>');
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- article_search //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/authors.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name");
+  if ($number_of_author_rows = tep_db_num_rows($authors_query)) {
+?>
+<!-- authors //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_AUTHORS . '</font>');
+
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_author_rows <= MAX_DISPLAY_AUTHORS_IN_A_LIST) {
+// Display a list
+      $authors_list = '';
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        if (isset($HTTP_GET_VARS['authors_id']) && ($HTTP_GET_VARS['authors_id'] == $authors['authors_id'])) $authors_name = '<b>' . $authors_name .'</b>';
+        $authors_list .= '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $authors['authors_id']) . '">' . $authors_name . '</a><br>';
+      }
+
+      $authors_list = substr($authors_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $authors_list);
+    } else {
+// Display a drop-down
+      $authors_array = array();
+      if (MAX_AUTHORS_LIST < 2) {
+        $authors_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        $authors_array[] = array('id' => $authors['authors_id'],
+                                       'text' => $authors_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('authors', tep_href_link(FILENAME_ARTICLES, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('authors_id', $authors_array, (isset($HTTP_GET_VARS['authors_id']) ? $HTTP_GET_VARS['authors_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_AUTHORS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- authors_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/best_sellers.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/best_sellers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/best_sellers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: best_sellers.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($current_category_id) && ($current_category_id > 0)) {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  } else {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  }
+
+  if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
+?>
+<!-- best_sellers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_BESTSELLERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $rows = 0;
+    $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
+      $rows++;
+      $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
+    }
+    $bestsellers_list .= '</table>';
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => $bestsellers_list);
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- best_sellers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/boxad.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/boxad.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/boxad.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,64 @@
+<?php
+/*
+  $Id: boxad.php, v 1.1 2002/03/21 by aubrey at mycon.co.za
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+*/
+?>
+<!-- banner-ad-in-a-box //-->
+<?php
+  if ($banner = tep_banner_exists('dynamic', BOX_AD_BANNER_TYPE)) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+    $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                            'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+<!-- banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/calendar.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+$ID
+  ~ events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it 
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3419 $
+
+*/
+
+
+?>
+<!-- events_calendar //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CALENDER . '</font>');
+    new infoBoxHeading($info_box_contents, false, false,tep_href_link(FILENAME_EVENTS_CALENDER));
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'center',
+                                'text' => '<iframe name="calendar" id="calendar" align="center" marginwidth="0" marginheight="0" ' .
+                                          'src='  . FILENAME_EVENTS_CALENDAR_CONTENT . '?_month=' . $_month .'&amp;_year='. $_year .' frameborder=0 height=220 width=162 scrolling=no> ' .IFRAME_ERROR.'</iframe> ');
+   
+ 
+    new infoBox($info_box_contents);
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left', 'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+      new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- events_calendar //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/card1.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/card1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/card1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1793 $
+
+*/
+?>
+<!-- Card Info Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CARD1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+//                               'text'  => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .
+//elari chanegd to provide a link to your payment acount
+                               'text'  => tep_image(DIR_WS_IMAGES . 'cards/logo-xclick_paypal.gif' , BOX_INFORMATION_CARD).
+                               '<br>' . tep_image(DIR_WS_IMAGES . 'cards/cards2.gif', BOX_INFORMATION_CARD) . '<br>'
+                               );
+
+new infoBox($info_box_contents);
+$info_box_contents = array();
+$info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+new infoboxFooter($info_box_contents, true, true);
+
+
+?>
+</td></tr>
+<!-- card_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,169 @@
+<?php
+/*
+  $Id: categories.php,v 1.1.1.1 2004/03/04 23:42:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3419 $
+
+  Released under the GNU General Public License
+*/
+$count=0;
+
+ function tep_show_category($counter,$count) {
+    global $foo, $categories_string, $id;
+
+$count++;
+    if ($count != 1) {
+$image=2;
+$HEIGHT = 20;
+     }else{
+$image=1;
+$HEIGHT = 21;
+}
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+
+    $categories_string .= '<tr><td>';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+    
+    $categories_string .= '<a class="navBlue" href="';
+
+}else{
+    $categories_string .= '&nbsp;';
+if ($foo[$counter]['parent'] != 0) {
+      $class="subnavBlue";
+   } else {
+  $class="navGrey";
+}
+
+if ($foo[$counter]['parent'] != 0) {
+      $categories_string .= '&nbsp;';
+   } else {
+         ;
+}
+    $categories_string .= '<a class="' . $class . '" href="';
+
+}
+
+    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string .= '">';
+// display category name
+      $categories_string .= $foo[$counter]['name'];
+    $categories_string .= '</a>';
+//    $categories_string .= '</td></tr>' ;
+
+
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category($foo[$counter]['next_id'],$count);
+    }
+
+  }
+?>
+<!-- categories //-->
+                  <tr>
+                    <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => '<font color="' . $font_color . '">' .BOX_HEADING_CATEGORIES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+$categories_string = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      $new_path .= $value;
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      while ($row = tep_db_fetch_array($categories_query)) {
+        $foo[$row['categories_id']] = array(
+                                            'name' => $row['categories_name'],
+                                            'parent' => $row['parent_id'],
+                                            'level' => $key+1,
+                                            'path' => $new_path . '_' . $row['categories_id'],
+                                            'next_id' => false
+                                           );
+
+        if (isset($prev_id)) {
+          $foo[$prev_id]['next_id'] = $row['categories_id'];
+        }
+
+        $prev_id = $row['categories_id'];
+
+        if (!isset($first_id)) {
+          $first_id = $row['categories_id'];
+        }
+
+        $last_id = $row['categories_id'];
+      }
+      if ($category_check != 0) {
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+      }
+
+      $new_path .= '_';
+    }
+  }
+
+  tep_show_category($first_element,$count);
+
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text'  => $categories_string
+                              );
+new $infobox_template($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+                    </td>
+                  </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/categories1.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/categories1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/categories1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- categories //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(),
+                               'align' => 'left',
+                               'text'  => tep_draw_pull_down_menu('cPath', tep_get_categories(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"')
+                              );
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/categories2.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/categories2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/categories2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,177 @@
+<?php
+/*
+  $Id: categories2.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+//###############################################
+if ( (USE_CACHE == 'true') && !defined('SID')) {
+    echo tep_cache_categories_box();
+  } else {
+//###############################################
+
+
+  function tep_show_category2($counter) {
+    global $foo, $categories_string2, $id;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      $categories_string2 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string2 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string2 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string2 .= '">';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '<b>';
+    }
+
+// display category name
+    $categories_string2 .= $foo[$counter]['name'];
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '</b>';
+    }
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string2 .= '-&gt;';
+    }
+
+    $categories_string2 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string2 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string2 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category2($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES2 . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+
+  $categories_string2 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_category2($first_element);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string2
+                              );
+  new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!--############################################### //-->
+<?php
+}
+?>
+<!--############################################## //-->
+<!-- categories_eof //-->
+

Added: trunk/direct.openmoko.com/templates/Helius/boxes/categories3.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/categories3.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/categories3.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,131 @@
+<?php
+/*
+  $Id: categories3.php,v 1.1 2004/04/05
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004osCommerce
+
+  Released under the GNU General Public License
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+*/
+
+// Categories_tree written by Gideon Romm from Symbio Technologies, LLC
+
+function tep_show_category3($cid, $cpath, $COLLAPSABLE) {
+  global $categories_string3, $languages_id, $HTTP_GET_VARS;
+  global $level;
+  $selectedPath = array();
+
+// Get all of the categories on this level
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }
+    $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;
+
+// Add category link to $categories_string3
+    for ($a=1; $a<$level{$categories['categories_id']}; $a++) {
+      $categories_string3 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string3 .= '<a href="';
+
+    $cPath_new = $cpath;
+    if ($level{$categories['parent_id']} > 0) {
+      $cPath_new .= "_";
+    }
+    $cPath_new .= $categories['categories_id'];
+
+    $cPath_new_text = "cPath=" . $cPath_new;
+
+    $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
+    $categories_string3 .= '">';
+
+    if ($HTTP_GET_VARS['cPath']) {
+      $selectedPath = split("_", $HTTP_GET_VARS['cPath']);
+    }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '<b>'; }
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '<u>'; }
+
+    $categories_string3 .= $categories['categories_name'];
+    if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string3 .= ' ->'; }
+
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '</u>'; }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '</b>'; }
+
+    $categories_string3 .= '</a>';
+
+    if (SHOW_COUNTS) {
+      $products_in_category = tep_count_products_in_category($categories['categories_id']);
+      if ($products_in_category > 0) {
+        $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string3 .= '<br>';
+
+
+// If I have subcategories, get them and show them
+    if (tep_has_category_subcategories($categories['categories_id'])) {
+
+      if ($COLLAPSABLE) {
+        if (in_array($categories['categories_id'], $selectedPath)) {
+          tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE);
+        }
+      }
+      else { tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE); }
+
+    }
+
+  }
+
+}
+?>
+
+
+<!-- categories //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES3 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string3 = '';
+
+// tep_show_category3(<top category_id>, <top cpath>, <1=Collapsable tree, 0=static--show all>)
+  tep_show_category3(0,'',0);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string3
+                              );
+  new infoBox($info_box_contents);
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/categories4.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/categories4.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/categories4.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,193 @@
+<?php
+/*
+  $Id: categories4.php,v 1.0
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1793 $
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_category4($counter) {
+    global $foo, $categories_string4, $id, $aa;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      if ($a == $foo[$counter]['level']-1)
+      {
+    $categories_string4 .= "<font color='#ff0000'>|__</font>";
+      } else
+        {
+        $categories_string4 .= "<b><font color='#ff0000'>&nbsp;&nbsp;&nbsp;&nbsp;</font></b>";
+        }
+
+    }
+    if ($foo[$counter]['level'] == 0)
+  {
+    if ($aa == 1)
+    {
+    $categories_string4 .= "<hr>";
+      }
+    else
+    {$aa=1;}
+
+  }
+
+
+    $categories_string4 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string4 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string4 .= '">';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $categories_string4 .= '<b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= "<b><font color='#ff0000'>";
+    }
+
+// display category name
+    $categories_string4 .= $foo[$counter]['name'];
+
+      if ($foo[$counter]['parent'] == 0) {
+       $categories_string4 .= '</b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= '</font></b>';
+    }
+
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string4 .= '<b>-&gt; </b>';
+    }
+
+    $categories_string4 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string4 .= '&nbsp;(' . $products_in_category . ')';
+      }    }
+
+    $categories_string4 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category4($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories //-->
+          <tr>
+            <td>
+<?php
+  $aa = 0;
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES4 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string4 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+   tep_show_category4($first_element);
+
+ //coment out the below line if you do not want to havw an all products list
+    $categories_string4 .= "<hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODS) . '"><b>' . BOX_INFORMATION_ALLPRODS . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODCATS) . '"><b>' . ALL_PRODUCTS_LINK . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODMANF) . '"><b>' . ALL_PRODUCTS_MANF . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br>\n";
+
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                'text'  => $categories_string4
+                               );
+   new infoBox($info_box_contents);
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+
+        </td>
+          </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/categories5.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/categories5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/categories5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,152 @@
+<?php
+/*
+  $Id: all_categories.php,v 1.6 2002/04/22 20:34:00 clescuyer Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Goélette
+  Christian Lescuyer <cl at goelette.net>
+  http://www.goelette.net/
+  http://oscommerce.goelette.net/
+
+  History: 1.1 Creation
+           1.2 Modified query for compatibility with older databases
+           1.3 Query in 1.2 was wrong for older databases
+           1.4 SHOW_COUNTS test corrected
+           1.5 Added COMPACT_CATEGORIES option to display all sub-categories on one line
+           1.6 Removed COMPACT_CATEGORIES option
+               Corrected the cpath generation
+               Bold categories "path" to selected category, an idea from Peter Fürsicht
+           1.7 Cleaned the way in which the categories are displayed - bold for the path,
+               ">" to indicate the current category, removed link to current category,
+               only indent subcategories (top level are flush left)
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1793 $
+
+  Released under the GNU General Public License
+
+*/
+
+// Keep out parts category
+    $excluded_parts_category_id = 28;
+
+
+// Preorder tree traversal
+  function preorder($cid, $level5, $foo5, $cpath) {
+    global $categories_string5, $HTTP_GET_VARS;
+
+    if ($cid != 0) {
+  // 1.7 Get the current path info
+      $category_path = explode('_',$HTTP_GET_VARS['cPath']);
+      $in_path = in_array($cid, $category_path);
+      $this_category = array_pop($category_path);
+
+      for ($i=0; $i<$level5; $i++)
+      // 1.7 only indent subcategories (top level are flush left)
+        if ($i>0) {
+          $categories_string5 .=  '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
+        }
+        // 1.7 indicate the current category
+        if ($this_category == $cid) {
+          $categories_string5 .=  '> ';
+        }
+
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '">';
+        }
+  // 1.6 Are we on the "path" to selected category? If yes, use <b>
+        if ($in_path) {
+          $categories_string5 .=  '<b>';
+        }
+        $categories_string5 .=  $foo5[$cid]['name'];
+        if ($in_path)
+          $categories_string5 .=  '</b>';
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '</a>';
+        }
+    // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+          if (SHOW_COUNTS == 'true') {
+            $products_in_category = tep_count_products_in_category($cid);
+            if ($products_in_category > 0) {
+              $categories_string5 .= '&nbsp;(' . $products_in_category . ')';
+            }
+          }
+        $categories_string5 .= '<br>' ."\n";
+      }
+
+// Traverse category tree
+      foreach ($foo5 as $key => $value) {
+        if ($foo5[$key]['parent'] == $cid) {
+  //        print "$key, $level5, $cid, $cpath<br>";
+          preorder($key, $level5+1, $foo5, ($level5 != 0 ? $cpath . $cid . '_' : ''));
+        }
+      }
+  }
+
+?>
+<!-- all_categories //-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES5);
+  new infoBoxHeading($info_box_contents, false, false);
+
+
+//////////
+// Get categories list
+//////////
+// 1.2 Test for presence of status field for compatibility with older versions
+  $status = tep_db_num_rows(tep_db_query('describe categories status'));
+
+  $query = "select c.categories_id, cd.categories_name, c.parent_id
+            from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
+            where c.categories_id = cd.categories_id";
+
+// 1.3 Can't have 'where' in an if statement!
+  if ($status >0)
+    $query.= " and c.status = '1'";
+  $query.= " and cd.language_id='" . $languages_id ."'
+            order by sort_order, cd.categories_name";
+
+  $categories_query = tep_db_query($query);
+
+// Stuff in an array
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo5[$categories['categories_id']] = array('name' => $categories['categories_name'], 'parent' => $categories['parent_id']);
+  }
+
+// Initiate tree traverse
+  $categories_string5 = '';
+  preorder(0, 0, $foo5, '');
+
+//////////
+// Display box contents
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => $categories_string5);
+ new infoBox($info_box_contents);
+  $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+    new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- all_categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/currencies.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1165 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($currencies) && is_object($currencies)) {
+?>
+<!-- currencies //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CURRENCIES . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    reset($currencies->currencies);
+    $currencies_array = array();
+    while (list($key, $value) = each($currencies->currencies)) {
+      $currencies_array[] = array('id' => $key, 'text' => $value['title']);
+    }
+
+    $hidden_get_variables = '';
+    reset($HTTP_GET_VARS);
+    while (list($key, $value) = each($HTTP_GET_VARS)) {
+      if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
+        $hidden_get_variables .= tep_draw_hidden_field($key, $value);
+      }
+    }
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
+                                 'align' => 'center',
+                                 'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());
+
+    new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- currencies_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/customer_gv.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/customer_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/customer_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: customer_gv.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2429 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- Tell Customer he has a gift voucher-->
+<?php
+  if ($customer_id) {
+    $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$customer_id."'");
+    if ($gv_result=tep_db_fetch_array($gv_query)) $customer_gv_amount=$gv_result['amount'];
+  }
+if ($customer_gv_amount>0) {
+?>
+          <tr>
+            <td>
+<?php
+ $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_GIFT_VOUCHER . '</font>'
+                               );
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<div align="center">'.GIFT_VOUCHER_ACCOUNT_BALANCE_1.$currencies->format($customer_gv_amount).GIFT_VOUCHER_ACCOUNT_BALANCE_2.'<a href="'.tep_href_link(FILENAME_GV_SEND).'">'.GIFT_VOUCHER_ACCOUNT_BALANCE_3.'</a>'
+                              );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoBoxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- Tell Customer he has a gift voucher_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/donate.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/donate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/donate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: donate.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2429 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- whats_new //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DONATE  . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+$info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
+              <input type="hidden" name="cmd" value="_xclick">
+              <input type="hidden" name="business" value="donations at creloaded.com">
+              <input type="hidden" name="no_note" value="1">
+              <input type="hidden" name="currency_code" value="USD">
+              <input type="hidden" name="tax" value="0">
+              <input type="image" src="images/x-click_butcc_donate.gif" name="submit"  alt="'.DONATE_BUTTON_IMAGE_ALT.'">
+            </form>');
+    new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/downloads.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/downloads.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/downloads.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,132 @@
+<?php
+/*
+  $Id: downloads.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3002 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- downloads //-->
+<?php
+  // modification of the logic to prevent the queries if there is no customer id
+  if ( $customer_id != '' ) {
+  if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+// Get last order id for checkout_success
+    $orders_query_raw = "SELECT orders_id FROM " . TABLE_ORDERS . " WHERE customers_id = '" . $customer_id . "' ORDER BY orders_id DESC LIMIT 1";
+    $orders_query = tep_db_query($orders_query_raw);
+    $orders_values = tep_db_fetch_array($orders_query);
+    $last_order = $orders_values['orders_id'];
+  } else {
+    $last_order = (int)$HTTP_GET_VARS['order_id'];
+  }
+
+// Now get all downloadable products in that order
+  $downloads_query_raw = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays
+                          FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
+                          WHERE customers_id = '" . $customer_id . "'
+                          AND o.orders_id = '" . $last_order . "'
+                          AND op.orders_id = '" . $last_order . "'
+                          AND opd.orders_products_id=op.orders_products_id
+                          AND opd.orders_products_filename<>''";
+  $downloads_query = tep_db_query($downloads_query_raw);
+
+// Don't display if there is no downloadable product
+  if (tep_db_num_rows($downloads_query) > 0) {
+     require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_DOWNLOADBOX);
+          ECHO '<tr><td>' ;
+          $info_box_contents = array();
+          $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DOWNLOADS . '</font>');
+          new infoBoxHeading($info_box_contents, false, false);
+
+           $info_box_contents = array();
+ ?>
+<!-- list of products -->
+<?php
+    while ($downloads_values = tep_db_fetch_array($downloads_query)) {
+?>
+
+<!-- left box -->
+<?php
+// MySQL 3.22 does not have INTERVAL
+      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads_values['date_purchased_day']);
+      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads_values['download_maxdays'], $dt_year);
+        $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
+
+// The link will appear only if:
+// - Download remaining count is > 0, AND
+// - The file is present in the DOWNLOAD directory, AND EITHER
+// - No expiry date is enforced (maxdays == 0), OR
+// - The expiry date is not reached
+      if (($downloads_values['download_count'] > 0) &&
+          (file_exists(DIR_FS_DOWNLOAD . $downloads_values['orders_products_filename'])) &&
+          (($downloads_values['download_maxdays'] == 0) ||
+           ($download_timestamp > time()))) {
+
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_FILE . '<br><br><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads_values['orders_products_download_id']) . '">' . $downloads_values['products_name'] . '</a>'
+                                          );
+ new infoBox($info_box_contents);
+      } else {
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => $downloads_values['products_name']
+                                          );
+ new infoBox($info_box_contents);
+
+      }
+?>
+<!-- right box -->
+<?php
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_DATE . '<br>' .  tep_date_long($download_expiry)
+                                          );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => $downloads_values['download_count'] . '  ' .  TEXT_HEADING_DOWNLOAD_COUNT
+                                        );
+  new infoBox($info_box_contents);
+ }
+
+if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => TEXT_FOOTER_DOWNLOAD . '<br><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . TEXT_DOWNLOAD_MY_ACCOUNT . '</a>'
+                                        );
+  new infoBox($info_box_contents);
+
+   }
+
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+   new infoboxFooter($info_box_contents, true, true);
+?>
+     </td>
+   </tr>
+<?php
+  }
+  }
+?>
+<!-- downloads_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/example.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/example.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/example.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1601 $
+
+*/
+?>
+<!-- Example_infobox Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_EXAMPLE . '</font>'
+                 // Change BOX_HEADING_EXAMPLE to your name, which you can find it easily.
+                 //and use the same in Infobox Admin to configure infobox.
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                // add infobox content below.
+                //'text'  => 'Your Content here'
+                'text'  => TEXT_YOUR_CONTENT_HERE
+                               );
+
+new infoBox($info_box_contents);
+
+$info_box_contents = array();
+$info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+new infoboxFooter($info_box_contents, true, true);
+?>
+</td></tr>
+<!-- Example_infobox_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/faq.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: faq.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$faq_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_FAQ_CATEGORIES . " ic, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// faq outside categories
+$faq_query = tep_db_query("select ip.faq_id, ip.question from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '0' and ip.language = '" . (int)$languages_id . "' and ip.visible = '1' order by ip.v_order, ip.question");
+
+if ((tep_db_num_rows($faq_categories_query) > 0) || (tep_db_num_rows($faq_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FAQ . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $faq_string = '';
+  while ($faq_categories = tep_db_fetch_array($faq_categories_query)) {
+    $id_string = 'cID=' . $faq_categories['categories_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($faq = tep_db_fetch_array($faq_query)) {
+    $id_string = 'fID=' . $faq['faq_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq['question'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $faq_string);
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+  $Id: featured.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- featured //-->
+<?php
+  if ($random_product = tep_random_select("select featured_id from  " . TABLE_FEATURED . " where status = '1' order by featured_date_added DESC limit " . MAX_RANDOM_SELECT_SPECIALS)) {
+
+
+//          $random_product_query21 = tep_db_query("select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s, " . TABLE_FEATURED . " f where f.featured_id ='" .  $random_product['featured_id'] . "' and f.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and m.manufacturers_id = p.manufacturers_id and p.products_id = s.products_id and p.products_status = '1'");
+//   $random_product21 = tep_db_query("select f.products_id, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s, " . TABLE_FEATURED . " f where f.featured_id ='" .  $random_product['featured_id'] . "' and f.products_id = p.products_id and f.status = '1' and p.products_status = '1' ");
+          $random_product_query21 = tep_db_query("select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_FEATURED . " f where f.featured_id ='" .  $random_product['featured_id'] . "' and f.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1'");
+
+while ($random_product21 = tep_db_fetch_array($random_product_query21)){
+$specials_new_products_price1 = tep_get_products_special_price($random_product21['products_id']);
+?>
+          <tr>
+            <td>
+<?php
+
+if ($specials_new_products_price1) {
+      $whats_new_price =  '<s>' . $currencies->display_price($random_product21['products_price'], tep_get_tax_rate($random_product21['products_tax_class_id'])) . '</s><br>';
+      $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($specials_new_products_price1, tep_get_tax_rate($random_product21['products_tax_class_id'])) . '</span>';
+    } else {
+      $whats_new_price =  $currencies->display_price($random_product21['products_price'], tep_get_tax_rate($random_product21['products_tax_class_id']));
+    }
+
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FEATURED . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents,  false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+            'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product21['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product21['products_image'], $random_product21['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product21['products_id'], 'NONSSL') . '">' . $random_product21['products_name'] . '</a><br>' . $whats_new_price
+                                );
+
+
+
+   new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<?php
+  }
+ }
+?>
+<!-- featured_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/googlead.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/googlead.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/googlead.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: googlead.php, v 1.1 2004/05/30 Tom O'Neill (zip1)
+
+
+  Released under the GNU General Public License
+ based on banner in a box by aubrey at mycon.co.za
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1793 $
+
+
+*/
+?>
+<!-- google-banner-ad-in-a-box //-->
+<?php
+  if (!(getenv('HTTPS')=='on')){
+  if ($banner = tep_banner_exists('dynamic', 'googlebox')) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_GOOGLE_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+       $info_box_contents = array();
+       $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                               );
+   new infoboxFooter($info_box_contents, true, true);
+?>
+
+
+
+            </td>
+          </tr>
+<?php
+  }
+  }
+?>
+<!-- google-banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/information_table.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/information_table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/information_table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: information.php,v 1.1.1.1 2003/09/18 19:05:51 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2857 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- information //-->
+          <tr>
+            <td>
+<?php
+require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_INFORMATIONBOX);
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_INFORMATION_TABLE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  // Retrieve information from Info table
+   $informationString = "";
+
+ // joles
+   $sql_query = tep_db_query("SELECT information_id, languages_id, info_title FROM " . TABLE_INFORMATION . " WHERE visible= '1' and languages_id ='" . (int)$languages_id . "' ORDER BY v_order");
+   while ($row = tep_db_fetch_array($sql_query)){
+   $informationString .= '<a href="' . tep_href_link(FILENAME_INFORMATION,  'info_id=' . $row['information_id'] ) . '">' . $row['info_title'] . '</a><br>';
+   }
+
+   $info_box_contents = array();
+
+if (tep_session_is_registered('customer_id')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+
+ } else if ((tep_session_is_registered('customer_id')) && (MODULE_ORDER_TOTAL_GV_STATUS == 'true')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+} else {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+}
+
+  new $infobox_template($info_box_contents);
+    $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+   new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/languages.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2429 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- languages //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LANGUAGES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+    include(DIR_WS_CLASSES . FILENAME_LANGUAGE);
+    $lng = new language;
+  }
+
+  $languages_string = '';
+  reset($lng->catalog_languages);
+  while (list($key, $value) = each($lng->catalog_languages)) {
+    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text' => $languages_string);
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+               'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- languages_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/links.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+  $Id: links.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1980 $
+
+
+  Released under the GNU General Public License
+*/
+
+
+// check for link categoris to determine if there is anything to display
+  $link_categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");
+  $number_of_categories = tep_db_num_rows($link_categories_query);
+
+  if ($number_of_categories > 0) {
+?>
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LINKS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_LINKS));
+
+    $informationString = '';
+    while($row = tep_db_fetch_array($link_categories_query)) {
+      $lPath_new = 'lPath=' . $row['link_categories_id'];
+      $informationString .= '<a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">' . $row['link_categories_name'] . '</a><br>';
+    }
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => $informationString
+                                );
+    new infoBox($info_box_contents);
+    $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+   new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,154 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3419 $
+
+
+  Released under the GNU General Public License
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  loginbox.php -   Version 1.0
+  This puts a login request in a box with a login button.
+  If already logged in, will not show anything.
+
+  Modified to utilize SSL to bypass Security Alert
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_LOGINBOX);
+
+// WebMakers.com Added: Do not show if on login or create account
+if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') )  {
+?>
+<!-- loginbox //-->
+<?php
+
+    if (!tep_session_is_registered('customer_id')) {
+?>
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $loginboxcontent = "
+       <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "\">
+            <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
+               <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_EMAIL . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_PASSWORD . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"password\" name=\"password\" maxlength=\"40\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+        <tr>
+            <td align=\"center\">
+      " . tep_draw_separator('pixel_trans.gif', '100%', '5') . "
+      </td>
+            </tr>
+              <tr>
+                <td class=\"infoboxContents\" align=\"center\">
+                  " . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "
+                </td>
+              </tr>
+             </table>
+           </form> 
+              ";
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $loginboxcontent
+                                );
+new infoBox($info_box_contents);
+
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<?php
+  } else {
+  // If you want to display anything when the user IS logged in, put it
+  // in here...  Possibly a "You are logged in as :" box or something.
+
+
+  }
+?>
+<!-- loginbox_eof //-->
+<?php
+// WebMakers.com Added: My Account Info Box
+} else {
+  if (tep_session_is_registered('customer_id')) {
+?>
+
+<!-- my_account_info //-->
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>'
+                              );
+new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                          'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- my_account_info_eof //-->
+
+<?php
+  }
+}
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/manufacturer_info.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/manufacturer_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/manufacturer_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: manufacturer_info.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- manufacturer_info //-->
+<?php
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id, m.manufacturers_id as manf_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from  " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and m.manufacturers_id = p.manufacturers_id and mi.manufacturers_id = m.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'");
+//    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id from  " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+
+   while ($manufacturer = tep_db_fetch_array($manufacturer_query)) {;
+?>
+<!-- manufacturer_info //-->
+          <tr>
+            <td>
+          
+<?php
+// echo 'prod-id' . (int)$HTTP_GET_VARS['products_id'] . 'manid' . $manufacturer['manufacturers_id'];
+      $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURER_INFO . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+      if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';
+      if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';
+      $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manf_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . ' ' . $manufacturer['manufacturers_name'] . '</a></td></tr>' .
+                                   '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturer_info_string);
+
+      new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- manufacturer_info_eof //-->
+          <?php
+       }
+      }
+?>
+<!-- manufacturer_info_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.1.1.1 2004/03/04 23:42:15 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+  if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
+?>
+<!-- manufacturers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
+// Display a list
+      $manufacturers_list = '';
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
+        $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
+      }
+
+      $manufacturers_list = substr($manufacturers_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturers_list);
+    } else {
+// Display a drop-down
+      $manufacturers_array = array();
+      if (MAX_MANUFACTURERS_LIST < 2) {
+        $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
+                                       'text' => $manufacturers_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- manufacturers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,119 @@
+<?php
+/*
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+// VJ navmenu begin
+define('TABLE_NAVMENU_CATEGORIES', 'navmenu_categories');
+define('TABLE_NAVMENU_CATEGORIES_DESCRIPTION', 'navmenu_categories_description');
+define('TABLE_NAVMENU_LINKS', 'navmenu_links');
+define('TABLE_NAVMENU_LINKS_DESCRIPTION', 'navmenu_links_description');
+define('TABLE_NAVMENU_LINKS_TO_CATEGORIES', 'navmenu_links_to_categories');
+// VJ navmenu end
+
+function tep_nm_get_navmenu_list($pid = 0, $list_string = '', $style_id = '') {
+  global $languages_id;
+
+  $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name
+                                    from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                         " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd
+                                    where c.nmc_parent_id = '" . (int)$pid . "'
+                                      and cd.nmc_id = c.nmc_id
+                                      and cd.language_id = '" . (int)$languages_id . "'
+                                    order by c.nmc_sort_order, cd.nmc_name");
+
+  $links_query = tep_db_query("select l.nml_id, l.nml_url, ld.nml_name
+                               from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                    " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c,
+                                    " . TABLE_NAVMENU_LINKS . " l,
+                                    " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld
+                               where c.nmc_id = '" . (int)$pid . "'
+                                 and c.nmc_id = l2c.nmc_id
+                                 and l2c.nml_id = l.nml_id
+                                 and ld.nml_id = l.nml_id
+                                 and ld.language_id = '" . (int)$languages_id . "'
+                               order by l.nml_sort_order, ld.nml_name");
+
+  if ((tep_db_num_rows($categories_query) > 0) || (tep_db_num_rows($links_query) > 0)) {
+    if (empty($list_string)) {
+      $list_string .= '<ul id="' . $style_id . '">' . "\n";
+    } else {
+      $list_string .= '<ul>' . "\n";
+    }
+
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $list_string .= '<li><a href="#">' . $categories['nmc_name'] . '</a>';
+
+      $list_string = tep_nm_get_navmenu_list((int)$categories['nmc_id'], $list_string);
+
+      $list_string .= '</li>' . "\n";
+    } 
+
+    while ($links = tep_db_fetch_array($links_query)) {
+      $list_string .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $links['nml_url'], 'NONSSL') . '">' . $links['nml_name'] . '</li>' . "\n";
+    } 
+
+    $list_string .= '</ul>' . "\n";
+  }
+
+  return $list_string;
+}
+?>
+<!-- navmenu //-->
+<script type="text/javascript"><!--
+sfHover = function() {
+   var sfEls = document.getElementById("navMenu").getElementsByTagName("LI");
+   for (var i=0; i<sfEls.length; i++) {
+     sfEls[i].onmouseover=function() {
+       this.className+=" sfhover";
+     }
+     sfEls[i].onmouseout=function() {
+       this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
+     }
+   }
+}
+if (window.attachEvent) window.attachEvent("onload", sfHover);
+//--></script>
+                  <tr>
+                    <td>
+                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
+                      <tr>
+                        <td width="100%">
+<?php
+$info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NAVMENU . '</font>');
+new infoBoxHeading($info_box_contents, false, false);
+
+$menu_string = tep_nm_get_navmenu_list(0, '', 'navMenu');
+
+// VJ debug
+//print_r($menu_string);
+
+$info_box_contents = array(array('text' =>  $menu_string));
+
+new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+                        </td>
+                      </tr>
+                    </table>
+                    </td>
+                  </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/order_history.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/order_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/order_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  $Id: order_history.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3442 $
+
+
+  Released under the GNU General Public License
+*/
+
+  if (tep_session_is_registered('customer_id')) {
+// retreive the last x products purchased
+    $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
+    if (tep_db_num_rows($orders_query)) {
+?>
+<!-- customer_orders //-->
+          <tr>
+            <td>
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CUSTOMER_ORDERS . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $product_ids = '';
+      while ($orders = tep_db_fetch_array($orders_query)) {
+        $product_ids .= (int)$orders['products_id'] . ',';
+      }
+      $product_ids = substr($product_ids, 0, -1);
+
+      $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+      $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+        // changes the cust_order into a buy_now action
+        $customer_orders_string .= '  <tr>' .
+                                   '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
+                                   '    <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
+                                   '  </tr>';
+      }
+      $customer_orders_string .= '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $customer_orders_string);
+
+      new infoBox($info_box_contents);
+        $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                     'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+         new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- customer_orders_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/pages.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+  $Id: pages.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$pages_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_PAGES_CATEGORIES . " ic, " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// pages outside categories
+$pages_query = tep_db_query("select ip.pages_id, ipd.pages_title
+                             from " . TABLE_PAGES . " ip
+                             left join " . TABLE_PAGES_TO_CATEGORIES . " ip2c on (ip2c.pages_id = ip.pages_id and ip2c.categories_id = '0'),
+                                  " . TABLE_PAGES_DESCRIPTION . " ipd
+                             where ip.pages_status = '1'
+                               and ipd.pages_id = ip.pages_id
+                               and ipd.language_id = '" . (int)$languages_id . "'
+                             order by ip.pages_sort_order, ipd.pages_title");
+
+if ((tep_db_num_rows($pages_categories_query) > 0) || (tep_db_num_rows($pages_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_PAGES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $pages_string = '';
+  while ($pages_categories = tep_db_fetch_array($pages_categories_query)) {
+    $id_string = 'cID=' . $pages_categories['categories_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($pages = tep_db_fetch_array($pages_query)) {
+    $id_string = 'pID=' . $pages['pages_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages['pages_title'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $pages_string);
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/product_notifications.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/product_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/product_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: product_notifications.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2746 $
+
+
+  Released under the GNU General Public License
+*/
+if (isset($HTTP_POST_VARS['products_id']) && tep_not_null($HTTP_POST_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+  } elseif (isset($HTTP_GET_VARS['products_id']) && tep_not_null($HTTP_GET_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_GET_VARS['products_id']);
+  } 
+  if ( (isset($HTTP_GET_VARS['products_id'])) || (isset($HTTP_POST_VARS['products_id'])) ) {
+?>
+<!-- notifications //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NOTIFICATIONS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
+
+    if (tep_session_is_registered('customer_id')) {
+      $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      $notification_exists = (($check['count'] > 0) ? true : false);
+    } else {
+      $notification_exists = false;
+    }
+
+    $info_box_contents = array();
+    if ($notification_exists == true) {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    } else {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    }
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- notifications_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/reviews.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1793 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- reviews //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_REVIEWS . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_REVIEWS));
+
+  $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'";
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $random_select .= " and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'";
+  }
+  $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
+  $random_product = tep_random_select($random_select);
+
+  $info_box_contents = array();
+
+  if ($random_product) {
+// display random review box
+    $review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'");
+    $review = tep_db_fetch_array($review_query);
+
+    $review = tep_break_string(tep_output_string_protected($review['reviews_text']), 15, '-<br>');
+
+    $info_box_contents[] = array('text' => '<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div>');
+  } elseif (isset($HTTP_GET_VARS['products_id'])) {
+// display 'write a review' box
+    $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . BOX_REVIEWS_WRITE_REVIEW .'</a></td></tr></table>');
+  } else {
+// display 'no reviews' box
+    $info_box_contents[] = array('text' => BOX_REVIEWS_NO_REVIEWS);
+  }
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- reviews_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/search.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: search.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3419 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" ') . '&nbsp;' . tep_hide_session_id() . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/search1.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/search1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/search1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: search1.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3419 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH1 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find1" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px">&nbsp;' . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br>'
+                              );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- shop by price //-->
+<?php
+if (MODULE_SHOPBYPRICE_RANGES > 0) {
+?>
+          <tr>
+            <td>
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOP_BY_PRICE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $sbp_array = unserialize(MODULE_SHOPBYPRICE_RANGE);
+
+  $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=0', 'NONSSL') . '">' . TEXT_INFO_UNDER . $currencies->format($sbp_array[0]) . '</a><br>');
+  for ($i=1, $ii=count($sbp_array); $i < $ii; $i++) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . TEXT_INFO_FROM . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_TO . $currencies->format($sbp_array[$i]) . '</a><br>');
+  }
+  if (MODULE_SHOPBYPRICE_OVER == True) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_ABOVE . '</a><br>');
+  }
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+    new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- shop_by_price //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Helius/boxes/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,135 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1793 $
+
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- shopping_cart //-->
+<script type="text/javascript"><!--
+function couponpopupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOPPING_CART . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));
+
+  $cart_contents_string = '';
+  if ($cart->count_contents() > 0) {
+    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+  $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
+    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
+  if ((int)$products_parent_id['products_parent_id'] != 0) {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '">';
+  } else {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+  }
+
+//      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+      $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        tep_session_unregister('new_products_id_in_cart');
+      }
+    }
+    $cart_contents_string .= '</table>';
+  } else {
+    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $cart_contents_string);
+
+  if ($cart->count_contents() > 0) {
+    // WebMakers.com Added: Shoppe Enhancement Controller
+    // check for free order
+    $final_total=$cart->show_total();
+    if ($final_total==0) {
+      $final_total='Free';
+    } else {
+      $final_total=$currencies->format($cart->show_total());
+    }
+    $info_box_contents[] = array('text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'right',
+                                 'text' => $final_total);
+  }
+// ICW ADDED FOR CREDIT CLASS GV
+  if (tep_session_is_registered('customer_id')) {
+    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $gv_result = tep_db_fetch_array($gv_query);
+    if ($gv_result['amount'] > 0 ) {
+      $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');
+    }
+  }
+  if (tep_session_is_registered('gv_id')) {
+    $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
+    $coupon = tep_db_fetch_array($gv_query);
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');
+
+  }
+  if (tep_session_is_registered('cc_id') && $cc_id) {
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');
+
+  }
+
+// ADDED FOR CREDIT CLASS GV END ADDITTION
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- shopping_cart_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3419 $
+
+
+  Released under the GNU General Public License
+*/
+
+   $random_product25 = tep_db_query("select distinct
+   p.products_id, 
+   pd.products_name, 
+   p.products_tax_class_id, 
+   p.products_image, 
+   s.specials_new_products_price 
+   from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+    " . TABLE_SPECIALS . " s 
+   where 
+   p.products_status = '1' 
+   and p.products_id = s.products_id 
+   and pd.products_id = s.products_id 
+   and pd.language_id = '" . (int)$languages_id . "' 
+   and s.status = '1' 
+   order by rand(), s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
+ 
+  
+  $random_product24_side_row = tep_db_num_rows($random_product25);
+     if ($random_product24_side_row > 0){
+
+?>
+<!-- d specials //-->
+          <tr>
+            <td>
+<?php
+
+while ($product_specials22 = tep_db_fetch_array($random_product25)){
+  $product_specials22_id = $product_specials22['products_id'];
+  $product_specials22_image = tep_get_products_image($product_specials22['products_id']);
+  $product_specials22_name = tep_get_products_name($product_specials22['products_id']);
+
+  $pf->loadProduct($product_specials22['products_id'],$languages_id);
+        $special_random_price = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SPECIALS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price);
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- specials_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['products_id']) {
+?>
+<!-- tell_a_friend //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TELL_A_FRIEND . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('tell_a_friend', tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('to_email_address', '', 'size="10"') . '&nbsp;' . tep_template_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id() . '<br>' . BOX_TELL_A_FRIEND_TEXT);
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- tell_a_friend_eof //-->
+
+<?php } ?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/theme_select.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/theme_select.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/theme_select.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+  $Id: theme_select.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+    if (tep_session_is_registered('customer_id')) {
+
+  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
+
+?>
+<!-- theme //-->
+         <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TEMPLATE_SELECT . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $template_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " where active = '1' order by template_name");
+
+ 
+// Display a drop-down
+    $select_box = '<select name="template" onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%">';
+    if (MAX_THEME_LIST < 2) {
+      $select_box .= '<option value="">' . PULL_DOWN_DEFAULT . '</option>';
+    }
+    while ($template_values = tep_db_fetch_array($template_query)) {
+      $select_box .= '<option value="' . $template_values['template_name'] . '"';
+      if ($HTTP_GET_VARS['template_id'] == $template_values['template_id']) $select_box .= ' SELECTED';
+      $select_box .= '>' . substr($template_values['template_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
+    }
+    $select_box .= "</select>";
+    $select_box .= tep_hide_session_id();
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form'  => '<form name="template" method="post" action="' . tep_href_link(FILENAME_DEFAULT, '&action=update_template', 'NONSSL') . '">',
+                                 'align' => 'left',
+                                 'text'  => $select_box);
+
+   new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}}
+?>
+<!-- template_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/whats_new.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/whats_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/whats_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,82 @@
+<?php
+/*
+  $Id: whats_new.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3419 $
+
+
+  Released under the GNU General Public License
+*/
+  $random_product27 = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+      order by rand(), products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
+ 
+$random_product27_side_row = tep_db_num_rows($random_product27);
+   if ($random_product27_side_row > 0){
+
+  ?>
+<!--D whats_new //-->
+ <tr>
+            <td>
+<?php      
+    
+while ($whatsnew_product21 = tep_db_fetch_array($random_product27)){
+  $whatsnew_product21_id = $whatsnew_product21['products_id'];
+  $whatsnew_product21_image = tep_get_products_image($whatsnew_product21['products_id']);
+  $whatsnew_product21_name = tep_get_products_name($whatsnew_product21['products_id']);
+
+  $pf->loadProduct($whatsnew_product21['products_id'],$languages_id);
+         $whats_new_price = $pf->getPriceStringShort();
+}
+// EOF Separate Pricing Per Customer
+//Eversun mod end for sppc and qty price breaks
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHATS_NEW . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',           
+         'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $whatsnew_product21_image, $whatsnew_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . $whatsnew_product21_name . '</a><br>' . $whats_new_price .'<br />');
+//Eversun mod for sppc and qty price breaks
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/boxes/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,99 @@
+<?php
+/*
+  $Id: whos_online.php, v 1.0 2001/12/05 by mattice at xs4all.nl
+
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3419 $
+
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official TEP distribution
+  but an add-on contributed to the TEP community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_WHOS_ONLINEBOX);
+?>
+
+
+<!-- whos_online //-->
+          <tr>
+            <td>
+<?php
+
+// Set expiration time, default is 900 secs (15 mins)
+  $xx_mins_ago = (time() - 900);
+
+  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
+
+  $whos_online_query = tep_db_query("select customer_id from " . TABLE_WHOS_ONLINE);
+  while ($whos_online = tep_db_fetch_array($whos_online_query)) {
+                        if (!$whos_online['customer_id'] == 0) $n_members++;
+                        if ($whos_online['customer_id'] == 0) $n_guests++;
+
+  $user_total = sprintf(tep_db_num_rows($whos_online_query));                                                                }
+
+  if ($user_total == 1) {
+    $there_is_are = BOX_WHOS_ONLINE_THEREIS . '&nbsp;';
+  } else {
+    $there_is_are = BOX_WHOS_ONLINE_THEREARE . '&nbsp;';
+  }
+
+  if ($n_guests == 1) {
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUEST;
+  }else{
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUESTS;
+  }
+
+  if ($n_members == 1) {
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBER;
+  }else{
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBERS;
+  }
+
+
+  if (($n_guests >= 1) && ($n_members >= 1)) $word_and = '&nbsp;' . BOX_WHOS_ONLINE_AND . '&nbsp;<br>';
+
+      $textstring = $there_is_are;
+        if ($n_guests >= 1) $textstring .= $n_guests . $word_guest;
+
+      $textstring .= $word_and;
+        if ($n_members >= 1) $textstring .= $n_members . $word_member;
+
+      $textstring .= '&nbsp;online.';
+
+
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHOS_ONLINE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>  $textstring
+                              );
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- whos_online_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/boxes/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,101 @@
+<?php
+/*
+  $Id: wishlist.php,v 2.2 2004/09/12 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3446 $
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- wishlist //-->
+<?php
+if (basename($PHP_SELF) != FILENAME_WISHLIST_SEND){
+if (basename($PHP_SELF) != FILENAME_WISHLIST)   {
+?> 
+          <tr>
+            <td>
+<?php
+  // retreive the wishlist
+  if (tep_session_is_registered('customer_id')) {
+    $wishlist_query_raw = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 order by products_name";  
+    $wishlist_query = tep_db_query($wishlist_query_raw);
+
+    // if we have something in this clients list:
+    ?>
+    <!-- customer_wishlist //-->
+    <script type="text/javascript"><!--
+    function popupWindowWishlist(url) {
+      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=425,height=475,screenX=150,screenY=150,top=150,left=150')
+    }
+    //--></script>
+    <?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WISHLIST . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_WISHLIST, '','NONSSL'));
+    
+    $info_box_contents = array();
+    
+    if (tep_db_num_rows($wishlist_query)) {
+      if (tep_db_num_rows($wishlist_query) < MAX_DISPLAY_WISHLIST_BOX) {
+
+        $product_ids = '';
+        while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+          $product_ids .= $wishlist['products_id'] . ',';
+         }
+        $product_ids = substr($product_ids, 0, -1);        
+       
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        //  $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . $product_ids . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $customer_wishlist_string .= '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a></td>' . "\n" .
+                                                  '</tr>' . "\n" .
+                                                  '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents" align="center" valign="bottom"><b><a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_MOVE_TO_CART . '</a>&nbsp;|' . "\n" .
+                                                  '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b>' . "\n" .  tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td>' .
+                                                  '</td></tr>' . "\n";
+        }
+      } else {
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . sprintf(TEXT_WISHLIST_COUNT, tep_db_num_rows($wishlist_query)) . '</td></tr>' . "\n";
+      }
+    } else {
+      $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+      $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . BOX_WISHLIST_EMPTY . '</td></tr>' . "\n";
+    }
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a></td></tr>' . "\n";
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST_HELP . '</u> [?]</a></td></tr>' . "\n"; // Normal link
+    $customer_wishlist_string .= '</table>';
+
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => $customer_wishlist_string);
+
+new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);   
+  }
+?>
+            </td>
+          </tr>
+          <?php
+    }}
+?><!-- wishlist_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Helius/boxes.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/boxes.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/boxes.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,275 @@
+<?php
+/*
+  $Id: boxes.tpl.php,v 1.1.1.1 2004/03/04 23:42:12 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBox {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBox($contents, $direct_output = false) {
+      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
+      $tableBox_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
+        $tableBox_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
+        $tableBox_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
+              $tableBox_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
+              $tableBox_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox_string .= '    <td align="left"  width="'.SIDE_BOX_LEFT_WIDTH.'" style="background-image: url(\'' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif\');background-repeat: repeat-y;"><img src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif" alt="'.BOX_ALT.'" width="'.SIDE_BOX_LEFT_WIDTH.'" height="1"></td>  <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox_string .= '>' . $contents[$i]['text'] . '</td><td width="'.SIDE_BOX_RIGHT_WIDTH.'" style="background-image: url(\'' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif\');background-repeat: repeat-y;"><img src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif" alt="'.BOX_ALT.'" width="'.SIDE_BOX_RIGHT_WIDTH.'" height="1"></td>' . "\n";
+        }
+
+        $tableBox_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
+      }
+
+      $tableBox_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox_string;
+
+      return $tableBox_string;
+    }
+  }
+
+class categoriesBox extends tableBox {
+function categoriesBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->categoriesBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $this->tableBox($info_box_contents, true);
+    }
+
+function categoriesBoxContents($contents) {
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $info_box_contents = array();
+      for ($i=0; $i<sizeof($contents); $i++) {
+        $info_box_contents[] = array(array('align' => 'center', 'params' => 'class="noclass"', 'text' => $contents[$i]['text']));
+      }
+      return $this->tableBox($info_box_contents);
+    }
+}
+
+  class infoBox extends tableBox {
+    function infoBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_parameters = 'class="templateinfoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function infoBoxContents($contents) {
+      $this->table_cellpadding = '2';
+      $this->table_parameters = 'class="templateinfobox"';
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
+                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
+                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
+      }
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      return $this->tableBox($info_box_contents);
+    }
+  }
+
+  class infoBoxHeading extends tableBox {
+    function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/no_arrow_right.gif');
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_right.gif');
+      } else {
+         $right_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif') .$right_arrow ;
+
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'class="infoBoxHeading"', 'text' => $left_corner),
+                                   array('params' => 'width="100%" class="infoBoxHeadingImage" align="center" ', 'text' => $contents[0]['text']),
+                                   array('params' => 'class="infoBoxHeading"', 'text' => $right_corner));
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+
+
+  class infoboxFooter extends tableBox {
+    function infoboxFooter($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_flip.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_flip.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+      } else {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+      }
+     
+     if ($contents[0]['text'] =='') {
+            $contents[0]['text'] = tep_draw_separator('pixel_trans.gif', '100%', '1');
+          }  
+     
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => ' class="infoBoxHeading"', 'text' => $left_corner),
+                                   array('params' => ' class="infoBoxFooterImage" width="100%" ', 'text' => $contents[0]['text']),
+           array('params' => ' class="infoBoxHeading" nowrap', 'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+
+  class contentBox extends tableBox {
+    function contentBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_parameters = 'class="templateinfoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function contentBoxContents($contents) {
+      $this->table_cellpadding = '2';
+      $this->table_parameters = 'class="templateinfobox"';
+      return $this->tableBox($contents);
+    }
+  }
+
+  class contentBoxHeading extends tableBox {
+    function contentBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+ 
+      $this->table_width = '100%';
+      $this->table_cellpadding = '0';
+      
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/no_arrow_right.gif');
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_right.gif');
+      } else {
+         $right_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif') .$right_arrow ;
+
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => ' align="center" style="background-image: url(' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif); background-repeat: repeat-x;" width="100%"  class="infoBoxContentsHeader"',
+                 'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class contentBoxFooter extends tableBox {
+    function contentBoxFooter($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_flip.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_flip.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+      } else {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' =>  'class="infoBoxfooter"','text' => $left_corner),
+                                   array('params' => 'background="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/backgroundfb.gif" width="100%" ', 'text' => $contents[0]['text']),
+            array('params' => ' nowrap', 'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class errorBox extends tableBox {
+    function errorBox($contents) {
+      $this->table_data_parameters = 'class="errorBox"';
+      $this->tableBox($contents, true);
+    }
+  }
+
+  class productListingBox extends tableBox {
+    function productListingBox($contents) {
+      $this->table_parameters = 'class="productListing"';
+      $this->tableBox($contents, true);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Helius/doc/buttonspec.txt
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/doc/buttonspec.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/doc/buttonspec.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+Helius and Pixame_v1 2 Buttons
+This file is intended to help adding more buttons when they are needed.
+It purpose is to discribe how the button were made so that they
+can be duplicated in the future.
+
+Original Spec:
+   Background color: R 0 G 0 B 0
+   Boarder color:  R 0  G 38  B 138
+   Drop shadow: R 153  G 153  B 153
+   height: 14 Pixels
+   Font: Unkowen 
+---------------------------------------------------
+New
+Button Software: Deknop
+Formate: .gif
+LZW compression: Ulead photoimpact SE 4.2.
+
+ Background color: R 0 G 0 B 0
+   Boarder color:  R 0  G 38  B 138
+   Drop shadow: R 153  G 153  B 153
+   height: 14 Pixels 
+   Width: variable
+Font: Arial
+Font style: Bold
+Font Size: 10 points
+Font color: R:0 G:38 B: 138 (white)

Added: trunk/direct.openmoko.com/templates/Helius/doc/helius.btn
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/doc/helius.btn	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/doc/helius.btn	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+[dimensions]
+left=16
+top=17
+butwidth=113
+butheight=17
+bevelwidth=1
+borderwidth=1
+leftmar=0
+rightmar=0
+topmar=0
+halign=1
+valign=1
+butup=3
+glintens=100
+[Window]
+split1=217
+split2=235
+split3=127
+[colors]
+font=$00804000
+background=clWhite
+canvas=clWhite
+uppercolor=$00804000
+downcolor=$00804000
+border=clBlue
+slower=$00804000
+supper=$00804000
+transcolor=5
+[font]
+name=Arial
+charset=0
+size=10
+bold=0
+italic=0
+underline=0
+style=0
+AntiAF=0
+[text]
+morecaptions=Create Account
+wordwrap=0
+prefix=button_
+suffix=
+usefix=1
+[gradient]
+use=0
+begincolor=$00FF8080
+endcolor=clWhite
+kind=4
+[gradientT]
+use=0
+endcolor=clYellow
+begincolor=$00804000
+kind=1
+[3d]
+style=0
+color=$00804000
+depth=8
+[shadow]
+color=clGray
+diam=2
+use=0
+xpos=3
+ypos=3
+[files]
+alfabet=0
+ufnamech=0
+ufname=printorder
+jpgcom=75
+saveIas=2
+LSI=C:\AppServ\www\loaded61b\templates\Helius\images\buttons\english\button_createaccount.gif
+LSIS=
+[neo]
+mode=0
+cap=new
+bmpname=[none]
+usetrcolor=1
+trcolor=clOlive
+[trans]
+use=0
+pos=7
+[texture]
+usebt=0
+kindbt=2
+filebt=
+posx=0
+posy=0
+transby=1
+usete=0
+filete=
+inten=50
+[paths]
+use=0

Added: trunk/direct.openmoko.com/templates/Helius/extra_html_output.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/extra_html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/extra_html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+<?php
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_template_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_template_image_button($image, $alt = '', $parameters = '') {
+    global $language;
+
+    return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+  }
+
+
+  function table_image_border_top($left, $right, $header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+        <tr>
+          <td>
+<?php
+  if ((SHOW_HEADING_TITLE_ORIGINAL =='yes') && (tep_not_null($header)) ) {
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                               'text' => $header );
+  }else{
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                               'text' => '&nbsp;' );
+  }
+  new contentBoxHeading($info_box_contents, $left, $right);
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0" class="templateinfoBox">
+            <tr>
+              <td align="left" width="<?php echo SIDE_BOX_LEFT_WIDTH; ?>" background="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif"';?>>
+              <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif', 'box_bg_l.gif.'); ?>
+              </td>
+              <td>
+              <table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
+                <tr>
+                  <td class="main">
+                  <table style="main_table_heading" border="0" cellspacing="0" cellpadding="2" align="right" width="100%" >
+                    <tr>
+                      <td>
+      <!--Lango Added for Template MOD: EOF-->
+<?php
+}
+}
+
+  function table_image_border_bottom(){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+         </td>
+                    </tr>
+                    <!--Lango Added for Template MOD: BOF-->
+                  </table>
+                  </td>
+                </tr>
+              </table>
+              </td>
+              <td align="right" width="<?php echo SIDE_BOX_RIGHT_WIDTH; ?>" background="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif"';?>>
+              <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif', 'box_bg_r.gif.'); ?>
+              </td>
+            </tr>
+          </table>
+<?php
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, false, false);
+?>
+     </td</tr>
+      <!--Lango Added for Template MOD: extrahtmloutput EOF-->
+<?php
+}
+}
+?>

Added: trunk/direct.openmoko.com/templates/Helius/images/Helius.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/Helius.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/button_blank_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/button_blank_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/button_blank_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/button_blank_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/button_blank_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/button_blank_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/7px.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/7px.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/arrow_main.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/arrow_main.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/background_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/background_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/background_box.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/background_box.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/background_box.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/background_box.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/background_main.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/background_main.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/backgroundfb.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/backgroundfb.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/bm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/bm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/bottom_center.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/bottom_center.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/box_bg_l.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/box_bg_l.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/box_bg_r.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/box_bg_r.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_left_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/no_arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/no_arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/q1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/q1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/q2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/q2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/r1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/r1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/infobox/r2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/infobox/r2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/logo2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/logo2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/logobk.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/logobk.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/images/topbg2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius/images/topbg2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,256 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body>
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+<!-- warning_eof //-->
+
+<!-- header //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+
+if (SITE_WIDTH!='100%') {
+?>
+    <table width="100%" cellpadding="10" cellspacing="0" border="0" BGCOLOR="#ffffff">
+      <tr><td>
+        <table CELLSPACING="2" CELLPADDING="4" BORDER="0" width="<?php echo SITE_WIDTH;?>" align="center" BGCOLOR="#FFFFFF">
+      <tr>
+        <td>
+        <table border="1" width="100%" style="border-color:#000000;  border-collapse: collapse" cellpadding="0" cellspacing="0">
+          <tr>
+            <td>
+
+<?php
+}
+?>
+            <table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr>
+        <td width="300" height="112" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/topbg2.gif)"><a href="index.php"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/logo.gif" border="0" alt="" width="400" height="112"></a></td>
+        <td width="376" height="112" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/logo2.gif)">
+
+<?php
+// show Cart Details
+ if (SHOW_CART_DETAILS_HEADER=='1') {
+?>
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+    <tr>
+      <td class="ShowCartDetails" align="right" height="30" valign="middle">
+        <?php echo '[ ' . $cart->count_contents() . ($cart->count_contents() == "1" ? " Item" : " Items "); ?> &nbsp;&nbsp; <?php echo $currencies->format($cart->show_total()); ?> &nbsp;&nbsp; <?php echo $cart->show_weight() . ($cart->show_weight() == "1" ? " lb" : " lbs ");?>&nbsp;]&nbsp;&nbsp;
+      </td>
+    </tr>
+  </table>
+<?php
+}
+?></td>
+  </tr>
+</table>
+<?php
+}
+?>
+<?php // BOF: WebMakers.com Added: Show Header Link Buttons
+ if (SHOW_HEADER_LINK_BUTTONS =='yes') {
+if (DOWN_FOR_MAINTENANCE =='false') {
+?>
+  <table border="0" width="100%" cellspacing="0" cellpadding="0" align="center" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/bg_cat4.gif);">
+    <tr><td>
+      <table border="0" cellspacing="0" cellpadding="0" align="center" class="HeaderBackground">
+
+        <tr>
+          <td height="28" width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_LINKS_DEFAULT . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td>
+          <td height="28" width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . HEADER_LINKS_WHATS_NEW . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td>
+          <td height="28" width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_SPECIALS) . '">' . HEADER_LINKS_SPECIALS . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td>
+          <td height="28" width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_REVIEWS) . '">' . HEADER_LINKS_REVIEWS . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td>
+
+
+ <?php
+      if (!tep_session_is_registered('noaccount')){// DDB - PWA - 040622 - no display of logoff for PWA customers
+         if (!tep_session_is_registered('customer_id')) {
+        echo ' <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN) . '">' . HEADER_LINKS_LOGIN . '</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>';
+
+         } else {
+         echo ' <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"> <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ACCOUNT) . '">' . HEADER_LINKS_ACCOUNT_INFO . '</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>';
+
+        }
+         }
+
+     if (tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers
+       {
+     if (!tep_session_is_registered('customer_id')) {
+        echo ' <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_LINKS_LOGIN . '</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>';
+   }else{
+        echo ' <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGOFFN, "", "SSL") . '">' . HEADER_LINKS_LOGOFF . '</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>';
+      }
+      }
+       ?>
+
+            <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ALL_PRODS) . '">' . HEADER_LINKS_PRODUCTS_ALL . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>
+
+        </tr>
+        <tr>
+          <td colspan="7"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
+        </tr>
+      </table>
+<?php
+ }
+}
+?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="<?php echo CELLPADDING_MAIN; ?>" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/bg_cat4.gif);">
+  <tr>
+<?php
+if (DISPLAY_COLUMN_LEFT == 'yes')  {
+// WebMakers.com Added: Down for Maintenance
+// Hide column_left.php if not to show
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+<!-- content //-->
+    <td width="100%" valign="top">
+<?php
+if (isset($content_template) && file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/'.  basename($content_template))) {
+    require(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/' . $content . '.tpl.php');
+  } else if (file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/' . $content . '.tpl.php')) {
+    require(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/'. $content . '.tpl.php');
+  }else if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template)) ){
+    require(DIR_WS_CONTENT . basename($content_template));
+  } else {
+    require(DIR_WS_CONTENT . $content . '.tpl.php');
+  }
+?>
+    </td>
+<!-- content_eof //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide column_right.php if not to show
+  //if (substr(basename($PHP_SELF), 0, 7) !='account') {
+if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+<?php
+//}
+}}
+?>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+require(DIR_WS_INCLUDES . FILENAME_COUNTER); ?>
+        <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
+      <tr valign="top">
+        <td><img src="templates/Helius/images/7px.gif" width="1" height="1" border="0" alt=""></td>
+</tr></table>
+<table width="100%" border="0" cellspacing="0" cellpadding="4">
+  <tr>
+    <td bgcolor="#6C88AC">
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" class="smallText">
+
+<?php 
+//google banner ad
+if (!(getenv('HTTPS')=='on')){
+if (tep_banner_exists('dynamic','googlefoot') ) {
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', 'googlefoot'); ?></td>
+  </tr>
+</table>
+<br>
+<?php
+  } }
+?>
+
+<?php 
+if ( tep_banner_exists('dynamic','468x50') ) { ?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', '468x50'); ?></td>
+  </tr>
+</table>
+
+<?php
+  }
+?>
+
+
+
+<?php
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default osCommerce-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+
+  echo FOOTER_TEXT_BODY
+?>
+    </td>
+  </tr>
+</table>
+<?php
+}
+
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+if (SITE_WIDTH!='100%') {
+?>      </table> </table>
+         </td></tr></table>
+       </td></tr>
+     </table>
+   </td>
+  </tr>
+</table>
+<?php
+}
+// EOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+?>
+<!-- footer_eof //-->
+</body>
+</html>

Added: trunk/direct.openmoko.com/templates/Helius/mainpage_modules/default_specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/mainpage_modules/default_specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/mainpage_modules/default_specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: default_specials.php,v 2.1 2006/09/07 23:42:27 datazen Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- default_specials mainpage //-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
+  
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+  $random_specials = array();
+  $specials_array = array();
+  $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC");
+  while ($specials = tep_db_fetch_array($specials_query)) {
+    $random_specials[] .= $specials['products_id'];
+  }
+
+  $row = 0;
+  $col = 0;
+
+  if (sizeof($random_specials)!=0){
+    $max_displayed = (MAX_DISPLAY_SPECIAL_PRODUCTS > sizeof($random_specials)) ? sizeof($random_specials) : MAX_DISPLAY_SPECIAL_PRODUCTS;
+    $special_products = cre_random_array($random_specials, $max_displayed);
+    for($i=0; $i < $max_displayed; $i++) {
+      $product_array = array();
+      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price as special_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where  p.products_id = $special_products[$i] and  s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");
+      $product = tep_db_fetch_array($product_query);
+
+      $pf->loadProduct($product['products_id'],$languages_id);
+      $products_price_s = $pf->getPriceStringShort();
+
+      $buyitnow='<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+ 
+      $info_box_contents[$row][$col] = array('align' => 'center',
+                                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                                             'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $product['products_image'], $product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . $product['products_name'] . '</a><br>' . $products_price_s . '<br>'. $buyitnow);
+      $col ++;
+      if ($col > 2) {
+        $col = 0;
+        $row ++;
+      }
+    }
+  }else{
+      $info_box_contents[$row][$col] = array('align' => 'left',
+                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                             'text' => TEXT_NO_SPECIALS);
+  }
+  
+  new contentBox($info_box_contents);
+
+  $info_box_contents = array();
+  if (MAIN_TABLE_BORDER == 'yes'){
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                             );
+    new infoboxFooter($info_box_contents, true, true);
+  }
+?><!-- default_specials_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Helius/mainpage_modules/example.html
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/mainpage_modules/example.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/mainpage_modules/example.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td class="infoBoxHeading">
+    <img src="templates/Helius/images/infobox/corner_left.gif" border="0" alt="image" width="36" height="28" ></td>
+    <td align="center" style="background-image: url(templates/Helius/images/infobox/background.gif); background-repeat: repeat-x;" width="100%" height="28" class="infoBoxHeading">
+    Example HTML Module</td>
+    <td class="infoBoxHeading">
+    <img src="templates/Helius/images/infobox/corner_right.gif" border="0" alt="image" width="14" ><img src="templates/Helius/images/infobox/no_arrow_right.gif" alt="image" width="21" ></td>
+  </tr>
+</table>
+<table border="0" width="100%" cellspacing="0" cellpadding="0" class="templateinfoBox">
+  <tr>
+    <td align="left" width="8" background="templates/Helius/images/infobox/box_bg_l.gif">
+    <img src="templates/Helius/images/infobox/box_bg_l.gif" width="8" height="1"></td>
+    <td>
+    <table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBoxContents">
+      <!-- change from here to next-->
+      <tr>
+        <td>
+        <img src="images/pixel_trans.gif" border="0" alt width="100%" height="10"></td>
+      </tr>
+      <tr>
+        <td align="center" valign="bottom">
+        <img width="426" height="75" src="templates/Helius/images/chr01.gif" border="0"></td>
+      </tr>
+      <tr>
+        <td valign="top" align="center">
+        <img valign="top" width="117" height="90" src="templates/Helius/images/chr02.gif" border="0"><img width="117" height="90" valign="top" src="templates/Helius/images/chr03.gif" border="0"><img valign="top" src="templates/Helius/images/chr04.gif" height="90" width="96" border="0"><img valign="top" src="templates/Helius/images/chr05.gif" width="96" height="90" border="0"></td>
+      </tr>
+      <tr>
+        <td>
+        <img src="images/pixel_trans.gif" border="0" alt width="100%" height="10"></td>
+      </tr>
+      <!-- change from here to above-->
+    </table>
+    </td>
+    <td width="12" background="templates/Helius/images/infobox/box_bg_r.gif">
+    <img src="templates/Helius/images/infobox/box_bg_r.gif" width="12" height="1"></td>
+  </tr>
+</table>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td class="infoBoxHeading">
+    <img src="templates/Helius/images/infobox/corner_left_flip.gif" border="0" alt width="40" height="9"></td>
+    <td background="templates/Helius/images/infobox/backgroundfb.gif" width="100%">
+    <img src="images/pixel_trans.gif" border="0" alt width="100%" height="1"></td>
+    <td class="infoBoxHeading" nowrap>
+    <img src="templates/Helius/images/infobox/corner_right_flip.gif" border="0" alt width="40" height="9"></td>
+  </tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Helius/mainpage_modules/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/mainpage_modules/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/mainpage_modules/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Featured Products V1.1
+  Displays a list of featured products, selected from admin
+  For use as an Infobox instead of the "New Products" Infobox
+*/
+?>
+<!-- featured_products_mainpage //-->
+<?php
+ 
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+      $featured_products_2bb_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                              " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(),p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
+   
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($featured_products_2bb = tep_db_fetch_array($featured_products_2bb_query)) {
+
+    $num ++;
+  
+    if ($num == 1) {
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+    }    
+
+  $pf->loadProduct($featured_products_2bb['products_id'],$languages_id);
+        $products_price_2bb = $pf->getPriceStringShort();
+
+
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products_2bb['products_image'], $featured_products_2bb['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . $featured_products_2bb['products_name'] . '</a><br>' . $products_price_2bb);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+  }
+ 
+?>
+<!-- featured_products_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/mainpage_modules/main_categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/mainpage_modules/main_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/mainpage_modules/main_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,184 @@
+<?php
+/*
+  $Id: main_categories.php,v 1.0a 2002/08/01 10:37:00 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Barreto
+  Gustavo Barreto <gustavo at barreto.net>
+  http://www.barreto.net/
+
+  Based on: all_categories.php Ver. 1.6 by Christian Lescuyer
+
+  History: 1.0 Creation
+     1.0a Correction: Extra Carriage Returns
+     1.1  added parameters to change display options -- mdt
+
+  Released under the GNU General Public License
+
+*/
+
+//------------------------------------------------------------------------------------------------------
+// PARAMETERS
+//------------------------------------------------------------------------------------------------------
+
+$item_column_number = 3;    // range of 1 to 9
+$item_title_on_newline = true;  // true or false
+
+// for item and subcategory options, suugest that you just put in CSS code
+// you can also just define a class and then change it in a template addon like BTS
+$item_div_options = 'style="text-align:center;font-weight:bold;font-size:larger;margin-top:5px;"';
+$item_subcategories_options = '';
+
+//------------------------------------------------------------------------------------------------------
+// CODE - do not change below here
+//------------------------------------------------------------------------------------------------------
+
+// error checking on parameters
+if($item_column_number < 1)
+{
+  $item_column_number = 1;
+}
+if($item_column_number > 9)
+{
+  $item_column_number = 9;
+}
+if($item_title_on_newline)
+{
+  $item_separator = '<br>';
+} else {
+  $item_separator = '&nbsp;';
+}
+
+// preorder_mc tree traversal
+  function preorder_mc($cid_cat, $level_cat, $foo_cat, $cpath_cat)
+  {
+    global $categories_string_cat, $HTTP_GET_VARS;
+
+// Display link
+    if ($cid_cat != 0) {
+      for ($i=0; $i<$level_cat; $i++)
+        $categories_string_cat .=  '&nbsp;&nbsp;';
+      $categories_string_cat .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath
+=' . $cpath_cat . $cid_cat) . '">';
+// 1.6 Are we on the "path" to selected category?
+      $bold = strstr($HTTP_GET_VARS['cPath'], $cpath_cat . $cid_cat . '_') || $HTTP_GET_VARS['cPath'] == $cpath_cat . $cid_cat;
+// 1.6 If yes, use <b>
+      if ($bold)
+        $categories_string_cat .=  '<b>';
+      $categories_string_cat .=  $foo_cat[$cid_cat]['name'];
+      if ($bold)
+        $categories_string_cat .=  '</b>';
+      $categories_string_cat .=  '</a>';
+// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+      if (SHOW_COUNTS == 'true') {
+        $products_in_category = tep_count_products_in_category($cid_cat);
+        if ($products_in_category > 0) {
+          $categories_string_cat .= '&nbsp;(' . $products_in_category . ')';
+        }
+      }
+      $categories_string_cat .= '<br>';
+    }
+
+// Traverse category tree
+    if (is_array($foo_cat)) {
+      foreach ($foo_cat as $key => $value) {
+        if ($foo_cat[$key]['parent'] == $cid_cat) {
+          preorder_mc($key, $level_cat+1, $foo_cat, ($level_cat != 0 ? $cpath_cat . $cid_cat . '_' : ''));
+        }
+      }
+    }
+  }
+
+?>
+<!-- main_categories //-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES_MAIN_PAGE);
+  new infoBoxHeading($info_box_contents, false, false);
+
+
+//////////
+// Get categories list
+//////////
+
+$query_cat = "select 
+  c.categories_id, 
+  cd.categories_name, 
+  c.categories_image,
+  c.parent_id from 
+  " . TABLE_CATEGORIES . " c,
+  " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+  where 
+  c.parent_id = '0' 
+ and c.categories_id = cd.categories_id 
+ and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+
+  $categories_query_cat = tep_db_query($query_cat);
+
+
+// Initiate tree traverse
+$categories_string_cat = '';
+preorder_mc(0, 0, $foo_cat, '');
+
+//////////
+// Display box contents
+//////////
+
+$info_box_contents = array();
+
+$row = 0;
+$col = 0;
+while ($categories_cat = tep_db_fetch_array($categories_query_cat))
+{
+  if ($categories['parent_id'] == 0)
+    {
+      $cpath_cat_new = tep_get_path($categories_cat['categories_id']);
+      $text_subcategories = '';
+      $subcategories_query_cat = tep_db_query($query_cat);
+      while ($subcategories_cat = tep_db_fetch_array($subcategories_query_cat))
+      {
+        if ($subcategories_cat['parent_id'] == $categories_cat['categories_id'])
+      {
+                $cPath_new_sub = "cPath="  . $categories_cat['categories_id'] . "_" . $subcategories_cat['categories_id'];
+                $text_subcategories .= '• <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">';
+                $text_subcategories .= $subcategories_cat['categories_name'] . '</a>' . " ";
+
+          } // if ($subcategories['parent_id'] == $categories['categories_id'])
+
+      } // while ($subcategories = tep_db_fetch_array($subcategories_query))
+
+    $info_box_contents[$row][$col] = array('align' => 'left',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cpath_cat_new) . '">' . tep_image(DIR_WS_IMAGES . $categories_cat['categories_image'], $categories_cat['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories_cat['categories_name'] . '</a></DIV>');
+
+      // determine the column position to see if we need to go to a new row
+      $col ++;
+      if ($col > ($item_column_number - 1))
+      {
+          $col = 0;
+          $row ++;
+
+      } //if ($col > ($number_of_columns - 1))
+
+    } //if ($categories['parent_id'] == 0)
+
+} // while ($categories = tep_db_fetch_array($categories_query))
+
+//output the contents
+new contentBox($info_box_contents);
+$info_box_contents = array();
+$info_box_contents[] = array('align' => 'left',
+                             'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+<!-- main_categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/mainpage_modules/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/mainpage_modules/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/mainpage_modules/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: mainpage.php,v 2.1 2004/04/07
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+  to change the contents of this file edit
+  includes/languages/(language)/mainpage.php
+*/
+?>
+<!-- mainpage //-->
+
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, HEADING_TITLE);
+}
+// EOF: Lango Added for template MOD
+
+
+include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE);
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<!-- Main_page eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/mainpage_modules/new_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/mainpage_modules/new_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/mainpage_modules/new_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- mainpages_modules.new_products.php//-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
+
+  
+      $new_products_query = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+       order by rand(), p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
+
+  
+
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($new_products = tep_db_fetch_array($new_products_query)) {
+  
+    $num ++;
+      if ($num == 1) { 
+  new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+      }
+
+  $pf->loadProduct($new_products['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+
+  
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $products_price_s);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+if($num) {
+  new contentBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+}
+
+?>
+<!-- new_products_eof //-->

Added: trunk/direct.openmoko.com/templates/Helius/mainpage_modules/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/mainpage_modules/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/mainpage_modules/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: upcoming_products.php,v 1.1.1.3 2004/04/07 23:42:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- upcoming_products mainpage_modules //-->
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_UPCOMING_PRODUCTS, strftime('%B')));
+
+    $expected_query_raw= tep_db_query("select
+ p.products_id,
+ pd.products_name, 
+ p.products_image, 
+    products_date_available as date_expected 
+ from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+    where 
+    to_days(products_date_available) >= to_days(now()) 
+    and p.products_id = pd.products_id 
+    and pd.language_id = '" . (int)$languages_id . "' 
+    order by rand()
+    limit " . MAX_DISPLAY_UPCOMING_PRODUCTS);
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($expected_query = tep_db_fetch_array($expected_query_raw)) {
+  
+    $num ++;
+      if ($num == 1) { 
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
+      }
+  $pf->loadProduct($expected_query['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+    
+   $duedate= str_replace("00:00:00", "" , $expected_query['date_expected']);  
+   
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $expected_query['products_image'], $expected_query['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . $expected_query['products_name'] . '</a><br>' . $products_price_s . '<br>' . TABLE_HEADING_DATE_EXPECTED . '&nbsp;' . $duedate);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+if($num) {
+new contentBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+}
+
+?>
+<!-- upcoming_products_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Helius/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/Helius/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,746 @@
+/*
+
+
+
+  Released under the GNU General Public License
+*/
+ .column_left {
+    background-color : #2d6dc5;
+    color : inherit;
+}
+.cat_description {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #800000;
+    background : inherit;
+    font-weight : bold;
+}
+.boxText {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+.maintableBackground {
+    background-color : #ffffff;
+    color : inherit;
+}
+.centerTable {
+    background-image : url('images/bg_cat4.gif');
+    background-repeat : repeat-x;
+    color : inherit;
+    border-left : 1px solid #798ccc;
+    border-right : 1px solid #798ccc;
+    background-color : #d2dbf5;
+}
+.errorBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : inherit;
+    background : #ffb3b5;
+    font-weight : bold;
+}
+.stockWarning {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #cc0033;
+    background : inherit;
+}
+.productsNotifications {
+    background : #f2fff7;
+    color : inherit;
+}
+.orderEdit {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #70d250;
+    background : inherit;
+    text-decoration : underline;
+}
+.navBlue {
+    color : #ff0000;
+    background : inherit;
+    font-size : 8pt;
+    font-family : Verdana, Arial, sans-serif;
+}
+.subnavBlue {
+    color : #9966ff;
+    background : inherit;
+    font-size : 8pt;
+    font-family : Verdana, Arial, sans-serif;
+}
+BODY {
+    background : #ffffff;
+    color : #000000;
+    margin : 0;
+}
+A {
+    color : #000000;
+    background : inherit;
+    text-decoration : none;
+}
+A:hover {
+    color : #aabbdd;
+    background : inherit;
+    text-decoration : underline;
+}
+FORM {
+    display : inline;
+}
+TR.header {
+    background : #ffffff;
+    color : inherit;
+}
+TR.headerNavigation {
+    background : #bbc3d3;
+    color : inherit;
+}
+TD.headerNavigation {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #bbc3d3;
+    color : #ffffff;
+    font-weight : bold;
+}
+A.headerNavigation {
+    color : #ffffff;
+    background : #bbc3d3;
+}
+a:hover.headerNavigation {
+    color : #ffffff;
+    background : #bbc3d3;
+}
+TR.headerError {
+    color : #bbc3d3;
+    background : #ff0000;
+}
+TD.headerError {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #ff0000;
+    color : #ffffff;
+    font-weight : bold;
+    text-align : center;
+}
+TR.headerInfo {
+    background : #00ff00;
+    color : #bbc3d3;
+}
+TD.headerInfo {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #00ff00;
+    color : #ffffff;
+    font-weight : bold;
+    text-align : center;
+}
+TR.footer {
+    background : #bbc3d3;
+    color : inherit;
+}
+TD.footer {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-image : url(images/links_middle.gif);
+    background-repeat : repeat-x;
+    background : #bbc3d3;
+    color : #ffffff;
+    font-weight : bold;
+}
+.templateinfobox { 
+    background : #fbfcfd url('images/infobox/background_box.gif') repeat-y left top;
+    color : inherit;
+    font-family : Verdana, Arial, sans-serif;
+  font-size:10px;
+}
+.infoBox {
+    color : inherit;
+    background : inherit;
+}
+TD.infoBox, SPAN.infoBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #ff9900;
+    color : inherit;
+}
+TD.infoBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #c8d0e0;
+    color : #000000;
+}
+.infoBoxContents {
+    color : inherit;
+    background : inherit;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+TD.infoBoxFooter {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #c8d0e0;
+    color : #ffffff;
+}
+
+TD.contentBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #534f4d;
+    background : inherit;
+    padding-top : 5px;
+} 
+ .infoBoxContentsHeader {
+    background : #c8d0e0;
+    color : #000000;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ .infoBoxContentsCenter {
+    color : inherit;
+    background : #c8d0e0;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+    background-color : #c8d0e0;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+TD.infoBoxHeadingImage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-image : url('images/infobox/background.gif');
+    background-repeat : repeat-x;
+    background-position : left;
+    background-color : #c8d0e0;
+    color : #000000;
+}
+TD.infoBoxFooterImage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #c8d0e0;
+    background-image : url(images/infobox/backgroundfb.gif);
+    background-repeat : repeat-x;
+    background-position : left;
+    color : #000000;
+}
+.infoBoxNotice {
+    color : #ffffff;
+    background : #ff8e90;
+}
+.infoBoxNoticeContents {
+    background : #c8d0e0;
+    color : #000000;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+TD.main_table_heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    border-width : thin;
+    border-color : #cccccc;
+    border-style : solid;
+    background : #c8d0e0;
+    color : #000000;
+}
+TD.main_table_heading_inner {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #c8d0e0;
+    color : #ffffff;
+}
+
+TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+    background : #f8f8f9;
+    color : inherit;
+}
+TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+    background : #f8f8f9;
+    color : inherit;
+}
+TABLE.productListing {
+    border : 1px;
+    border-style : solid;
+    border-color : #b6b7cb;
+    border-spacing : 1px;
+}
+.productListing-heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #b6b7cb;
+    color : #000000;
+    font-weight : bold;
+}
+.productlisting-headingPrice {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 20px;
+    background : #cccccc;
+    color : #9a9a9a;
+    font-weight : bold;
+}
+TD.productListing-data {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+A.pageResults {
+    color : #0000ff;
+    background : inherit;
+}
+a:hover.pageResults {
+    color : #0000ff;
+    background : #ffff33;
+}
+TD.pageHeading, DIV.pageHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 20px;
+    font-weight : bold;
+    color : #9a9a9a;
+    background : inherit;
+}
+TR.subBar {
+    background : #f4f7fd;
+    color : inherit;
+}
+TD.subBar {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background : inherit;
+}
+TD.main, P.main {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+    background : inherit;
+    color : inherit;
+}
+TD.smallText, SPAN.smallText, P.smallText {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+TD.accountCategory {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 13px;
+    color : #aabbdd;
+    background : inherit;
+}
+TD.fieldKey {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+TD.fieldValue {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+}
+TD.tableHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+TD.category_desc {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+}
+SPAN.newItemInCart {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #ff0000;
+    background : inherit;
+}
+CHECKBOX, INPUT, RADIO, SELECT {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+}
+TEXTAREA {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+}
+SPAN.greetUser {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    color : #f0a480;
+    background : inherit;
+    font-weight : bold;
+}
+TABLE.formArea {
+    color : #f4f7fd;
+    background : #f1f9fe;
+    border-color : #7b9ebd;
+    border-style : solid;
+    border-width : 1px;
+}
+TD.formAreaTitle {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+SPAN.markProductOutOfStock {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    color : #c76170;
+    background : inherit;
+    font-weight : bold;
+}
+SPAN.productSpecialPrice {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ff0000;
+    background : inherit;
+}
+SPAN.errorText {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ff0000;
+    background : inherit;
+}
+.moduleRowOver {
+    background-color : #d7e9f7;
+    color : inherit;
+    cursor : pointer;
+}
+.moduleRowSelected {
+    background-color : #e9f4fc;
+    color : inherit;
+}
+.checkoutBarFrom, .checkoutBarTo {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #8c8c8c;
+    background : inherit;
+}
+.checkoutBarCurrent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background : inherit;
+}
+.messageBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+.messageStackError, .messageStackWarning {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-color : #ffb3b5;
+    color : inherit;
+}
+.messageStackSuccess {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-color : #99ff00;
+    color : inherit;
+}
+.inputRequirement {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #ff0000;
+    background : inherit;
+}
+TABLE.linkListing {
+    border : 1px;
+    border-style : solid;
+    border-color : #b6b7cb;
+    border-spacing : 1px;
+}
+.linkListing-heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #b6b7cb;
+    color : #ffffff;
+    text-align : center;
+}
+TD.linkListing-data {
+    border-right : 1px solid #b6b7cb;
+    border-bottom : 1px solid #b6b7cb;
+    padding : 4px;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+TR.linkListing-odd {
+    background : #f8f8f9;
+    color : inherit;
+}
+TR.linkListing-even {
+    background : #f5f5f5;
+    color : inherit;
+}
+.content {
+    color : #000000;
+    background : inherit;
+    font-size : 10px;
+    font-family : Verdana, Arial, sans-serif;
+}
+TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+    color : #bdcaf0;
+    background : inherit;
+}
+TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+    background-image : url('images/button_blank_left.gif');
+}
+TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+    background-image : url('images/button_blank_right.gif');
+}
+TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+    background-image : url('images/button_blank_middle.gif');
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : inherit;
+    color : #000000;
+}
+A.HeaderPageLinks {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #000000;
+    background : inherit;
+}
+a:hover.HeaderPageLinks {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+    color : #00ff00;
+}
+TD.cookieUsage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #000000;
+    color : #ffffff;
+}
+.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #808080;
+}
+.TR.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #808080;
+}
+.TD.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #c0c0c0;
+}
+.storyboxtitle {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+.storyboxtitle A:link {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+.storyboxtitle A:active {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+.storyboxtitle A:visited {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+.storyboxtitle A:hover {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ffffff;
+    font-size : 10px;
+    font-weight : bold;
+    text-decoration : underline;
+    background : inherit;
+}
+.yearHeader {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 14px;
+    font-weight : bold;
+    color : #000000;
+    background-color : #ffffff;
+}
+.calendarMonth {
+    background-color : #cccccc;
+    color : inherit;
+    cursor : default;
+    width : 100%;
+}
+.calendarHeader {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    font-weight : bold;
+    color : #000000;
+    background-color : #ffffff;
+    text-decoration : none;
+    height : 22px;
+}
+.calendarToday {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #ffcf00;
+    padding-left : 3px;
+    text-decoration : none;
+    border : 1px solid #ffffff;
+    height : 22px;
+    width : 18px;
+}
+.calendarWeekend {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #caeeff;
+    padding-left : 3px;
+    line-height : 14px;
+    text-decoration : none;
+    border : 1px solid #ffffff;
+    height : 22px;
+    width : 18px;
+}
+.calendar {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #ffffff;
+    padding-left : 3px;
+    line-height : 14px;
+    text-decoration : none;
+    height : 22px;
+    width : 18px;
+}
+.event {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    color : #000000;
+    background-color : #ffffff;
+    text-decoration : none;
+    border : 1px solid #e6e6e6;
+}
+.empty {
+    background-color : #f0faff;
+    color : inherit;
+    line-height : 14px;
+    height : 22px;
+    width : 18px;
+}
+.calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+.calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+.calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+h4.infoTitle {
+    margin-top : 0;
+    margin-right : 0;
+    margin-left : 0;
+    margin-bottom : 0.2em;
+}
+p.infoBlurb {
+    margin-top : 0;
+    margin-right : 0;
+    margin-left : 0;
+    margin-bottom : 2em;
+}
+TD.productPriceInListing {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #d2e9fb;
+    color : inherit;
+}
+TD.productPriceInBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #eeeeee;
+    color : inherit;
+}
+TD.productPriceInProdInfo {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #ccffcc;
+    color : inherit;
+}
+#navMenu {
+    clear : both;
+    height : 0.01%;
+    margin : 0;
+    padding : 0;
+    list-style : none;
+}
+#navMenu ul {
+    float : left;
+    width : 150px;
+    margin : 0;
+    padding : 0;
+    list-style : none;
+}
+#navMenu li {
+    position : relative;
+    float : left;
+    line-height : 24px;
+    margin-bottom : -1px;
+    width : 150px;
+}
+#navMenu li ul {
+    position : absolute;
+    left : -999em;
+    margin-left : 150px;
+    margin-top : -26px;
+}
+#navMenu li ul ul {
+    left : -999em;
+}
+#navMenu li a {
+    width : 150px;
+    display : block;
+    color : #334;
+    font-weight : bold;
+    text-decoration : none;
+    background : #ffffff;
+    border : 1px solid #cce;
+    padding-left : 2px;
+}
+#navMenu li a:hover {
+    color : #000000;
+    background : #aac;
+}
+#navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+    left : -999em;
+}
+#navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+    left : auto;
+}

Added: trunk/direct.openmoko.com/templates/Helius1/Helius1.sql
===================================================================
--- trunk/direct.openmoko.com/templates/Helius1/Helius1.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius1/Helius1.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#0000FF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#0000FF');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "Helius.gif", template_cellpadding_main ="2", template_cellpadding_sub= "10", template_cellpadding_left= "3", template_cellpadding_right= "3", site_width= "776", include_column_left= "yes", include_column_right= "yes", box_width_left= "150", box_width_right= "150", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no", show_header_link_buttons="yes", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width="8", side_box_right_width="12" WHERE template_id="#tID#"
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Helius1/doc/buttonspec.txt
===================================================================
--- trunk/direct.openmoko.com/templates/Helius1/doc/buttonspec.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius1/doc/buttonspec.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+Helius and Pixame_v1 2 Buttons
+This file is intended to help adding more buttons when they are needed.
+It purpose is to discribe how the button were made so that they
+can be duplicated in the future.
+
+Original Spec:
+   Background color: R 0 G 0 B 0
+   Boarder color:  R 0  G 38  B 138
+   Drop shadow: R 153  G 153  B 153
+   height: 14 Pixels
+   Font: Unkowen 
+---------------------------------------------------
+New
+Button Software: Deknop
+Formate: .gif
+LZW compression: Ulead photoimpact SE 4.2.
+
+ Background color: R 0 G 0 B 0
+   Boarder color:  R 0  G 38  B 138
+   Drop shadow: R 153  G 153  B 153
+   height: 14 Pixels 
+   Width: variable
+Font: Arial
+Font style: Bold
+Font Size: 10 points
+Font color: R:0 G:38 B: 138 (white)

Added: trunk/direct.openmoko.com/templates/Helius1/doc/helius.btn
===================================================================
--- trunk/direct.openmoko.com/templates/Helius1/doc/helius.btn	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius1/doc/helius.btn	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+[dimensions]
+left=16
+top=17
+butwidth=113
+butheight=17
+bevelwidth=1
+borderwidth=1
+leftmar=0
+rightmar=0
+topmar=0
+halign=1
+valign=1
+butup=3
+glintens=100
+[Window]
+split1=217
+split2=235
+split3=127
+[colors]
+font=$00804000
+background=clWhite
+canvas=clWhite
+uppercolor=$00804000
+downcolor=$00804000
+border=clBlue
+slower=$00804000
+supper=$00804000
+transcolor=5
+[font]
+name=Arial
+charset=0
+size=10
+bold=0
+italic=0
+underline=0
+style=0
+AntiAF=0
+[text]
+morecaptions=Create Account
+wordwrap=0
+prefix=button_
+suffix=
+usefix=1
+[gradient]
+use=0
+begincolor=$00FF8080
+endcolor=clWhite
+kind=4
+[gradientT]
+use=0
+endcolor=clYellow
+begincolor=$00804000
+kind=1
+[3d]
+style=0
+color=$00804000
+depth=8
+[shadow]
+color=clGray
+diam=2
+use=0
+xpos=3
+ypos=3
+[files]
+alfabet=0
+ufnamech=0
+ufname=printorder
+jpgcom=75
+saveIas=2
+LSI=C:\AppServ\www\loaded61b\templates\Helius\images\buttons\english\button_createaccount.gif
+LSIS=
+[neo]
+mode=0
+cap=new
+bmpname=[none]
+usetrcolor=1
+trcolor=clOlive
+[trans]
+use=0
+pos=7
+[texture]
+usebt=0
+kindbt=2
+filebt=
+posx=0
+posy=0
+transby=1
+usete=0
+filete=
+inten=50
+[paths]
+use=0

Added: trunk/direct.openmoko.com/templates/Helius1/images/Helius.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/Helius.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/button_blank_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/button_blank_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/button_blank_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/button_blank_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/button_blank_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/button_blank_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/7px.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/7px.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/arrow_main.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/arrow_main.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_box.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_box.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_box.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_box.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_main.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/background_main.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/backgroundfb.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/backgroundfb.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/bm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/bm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/bottom_center.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/bottom_center.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/box_bg_l.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/box_bg_l.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/box_bg_r.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/box_bg_r.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_left_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/no_arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/no_arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/q1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/q1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/q2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/q2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/r1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/r1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/infobox/r2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/infobox/r2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/logo2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/logo2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/logobk.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/logobk.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/images/topbg2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Helius1/images/topbg2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Helius1/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius1/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius1/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,256 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body>
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+<!-- warning_eof //-->
+
+<!-- header //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+
+if (SITE_WIDTH!='100%') {
+?>
+    <table width="100%" cellpadding="10" cellspacing="0" border="0" BGCOLOR="#ffffff">
+      <tr><td>
+        <table CELLSPACING="2" CELLPADDING="4" BORDER="0" width="<?php echo SITE_WIDTH;?>" align="center" BGCOLOR="#FFFFFF">
+      <tr>
+        <td>
+        <table border="1" width="100%" style="border-color:#000000;  border-collapse: collapse" cellpadding="0" cellspacing="0">
+          <tr>
+            <td>
+
+<?php
+}
+?>
+            <table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr>
+        <td width="300" height="112" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/topbg2.gif)"><a href="index.php"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/logo.gif" border="0" alt="" width="400" height="112"></a></td>
+        <td width="376" height="112" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/logo2.gif)">
+
+<?php
+// show Cart Details
+ if (SHOW_CART_DETAILS_HEADER=='1') {
+?>
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+    <tr>
+      <td class="ShowCartDetails" align="right" height="30" valign="middle">
+        <?php echo '[ ' . $cart->count_contents() . ($cart->count_contents() == "1" ? " Item" : " Items "); ?> &nbsp;&nbsp; <?php echo $currencies->format($cart->show_total()); ?> &nbsp;&nbsp; <?php echo $cart->show_weight() . ($cart->show_weight() == "1" ? " lb" : " lbs ");?>&nbsp;]&nbsp;&nbsp;
+      </td>
+    </tr>
+  </table>
+<?php
+}
+?></td>
+  </tr>
+</table>
+<?php
+}
+?>
+<?php // BOF: WebMakers.com Added: Show Header Link Buttons
+ if (SHOW_HEADER_LINK_BUTTONS =='yes') {
+if (DOWN_FOR_MAINTENANCE =='false') {
+?>
+  <table border="0" width="100%" cellspacing="0" cellpadding="0" align="center" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/bg_cat4.gif);">
+    <tr><td>
+      <table border="0" cellspacing="0" cellpadding="0" align="center" class="HeaderBackground">
+
+        <tr>
+          <td height="28" width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_LINKS_DEFAULT . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td>
+          <td height="28" width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . HEADER_LINKS_WHATS_NEW . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td>
+          <td height="28" width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_SPECIALS) . '">' . HEADER_LINKS_SPECIALS . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td>
+          <td height="28" width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_REVIEWS) . '">' . HEADER_LINKS_REVIEWS . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td>
+
+
+ <?php
+      if (!tep_session_is_registered('noaccount')){// DDB - PWA - 040622 - no display of logoff for PWA customers
+         if (!tep_session_is_registered('customer_id')) {
+        echo ' <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN) . '">' . HEADER_LINKS_LOGIN . '</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>';
+
+         } else {
+         echo ' <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"> <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ACCOUNT) . '">' . HEADER_LINKS_ACCOUNT_INFO . '</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>';
+
+        }
+         }
+
+     if (tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers
+       {
+     if (!tep_session_is_registered('customer_id')) {
+        echo ' <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_LINKS_LOGIN . '</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>';
+   }else{
+        echo ' <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGOFFN, "", "SSL") . '">' . HEADER_LINKS_LOGOFF . '</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>';
+      }
+      }
+       ?>
+
+            <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><?php echo '<a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ALL_PRODS) . '">' . HEADER_LINKS_PRODUCTS_ALL . '</a>'; ?></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td>
+
+        </tr>
+        <tr>
+          <td colspan="7"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
+        </tr>
+      </table>
+<?php
+ }
+}
+?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="<?php echo CELLPADDING_MAIN; ?>" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/bg_cat4.gif);">
+  <tr>
+<?php
+if (DISPLAY_COLUMN_LEFT == 'yes')  {
+// WebMakers.com Added: Down for Maintenance
+// Hide column_left.php if not to show
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+<!-- content //-->
+    <td width="100%" valign="top">
+<?php
+if (isset($content_template) && file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/'.  basename($content_template))) {
+    require(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/' . $content . '.tpl.php');
+  } else if (file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/' . $content . '.tpl.php')) {
+    require(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/'. $content . '.tpl.php');
+  }else if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template)) ){
+    require(DIR_WS_CONTENT . basename($content_template));
+  } else {
+    require(DIR_WS_CONTENT . $content . '.tpl.php');
+  }
+?>
+    </td>
+<!-- content_eof //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide column_right.php if not to show
+  //if (substr(basename($PHP_SELF), 0, 7) !='account') {
+if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+<?php
+//}
+}}
+?>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+require(DIR_WS_INCLUDES . FILENAME_COUNTER); ?>
+        <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
+      <tr valign="top">
+        <td><img src="templates/Helius/images/7px.gif" width="1" height="1" border="0" alt=""></td>
+</tr></table>
+<table width="100%" border="0" cellspacing="0" cellpadding="4">
+  <tr>
+    <td bgcolor="#6C88AC">
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" class="smallText">
+
+<?php 
+//google banner ad
+if (!(getenv('HTTPS')=='on')){
+if (tep_banner_exists('dynamic','googlefoot') ) {
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', 'googlefoot'); ?></td>
+  </tr>
+</table>
+<br>
+<?php
+  } }
+?>
+
+<?php 
+if ( tep_banner_exists('dynamic','468x50') ) { ?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', '468x50'); ?></td>
+  </tr>
+</table>
+
+<?php
+  }
+?>
+
+
+
+<?php
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default osCommerce-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+
+  echo FOOTER_TEXT_BODY
+?>
+    </td>
+  </tr>
+</table>
+<?php
+}
+
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+if (SITE_WIDTH!='100%') {
+?>      </table> </table>
+         </td></tr></table>
+       </td></tr>
+     </table>
+   </td>
+  </tr>
+</table>
+<?php
+}
+// EOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+?>
+<!-- footer_eof //-->
+</body>
+</html>

Added: trunk/direct.openmoko.com/templates/Helius1/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/Helius1/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius1/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,742 @@
+/*
+
+
+
+  Released under the GNU General Public License
+*/
+ .column_left {
+    background-color : #2d6dc5;
+    color : inherit;
+}
+.cat_description {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #800000;
+    background : inherit;
+    font-weight : bold;
+}
+.boxText {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+.maintableBackground {
+    background-color : #ffffff;
+    color : inherit;
+}
+.centerTable {
+    background-image : url('images/bg_cat4.gif');
+    background-repeat : repeat-x;
+    color : inherit;
+    border-left : 1px solid #798ccc;
+    border-right : 1px solid #798ccc;
+    background-color : #d2dbf5;
+}
+.errorBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : inherit;
+    background : #ffb3b5;
+    font-weight : bold;
+}
+.stockWarning {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #cc0033;
+    background : inherit;
+}
+.productsNotifications {
+    background : #f2fff7;
+    color : inherit;
+}
+.orderEdit {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #70d250;
+    background : inherit;
+    text-decoration : underline;
+}
+.navBlue {
+    color : #ff0000;
+    background : inherit;
+    font-size : 8pt;
+    font-family : Verdana, Arial, sans-serif;
+}
+.subnavBlue {
+    color : #9966ff;
+    background : inherit;
+    font-size : 8pt;
+    font-family : Verdana, Arial, sans-serif;
+}
+BODY {
+    background : #ffffff;
+    color : #000000;
+    margin : 0;
+}
+A {
+    color : #000000;
+    background : inherit;
+    text-decoration : none;
+}
+A:hover {
+    color : #aabbdd;
+    background : inherit;
+    text-decoration : underline;
+}
+FORM {
+    display : inline;
+}
+TR.header {
+    background : #ffffff;
+    color : inherit;
+}
+TR.headerNavigation {
+    background : #bbc3d3;
+    color : inherit;
+}
+TD.headerNavigation {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #bbc3d3;
+    color : #ffffff;
+    font-weight : bold;
+}
+A.headerNavigation {
+    color : #ffffff;
+    background : #bbc3d3;
+}
+a:hover.headerNavigation {
+    color : #ffffff;
+    background : #bbc3d3;
+}
+TR.headerError {
+    color : #bbc3d3;
+    background : #ff0000;
+}
+TD.headerError {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #ff0000;
+    color : #ffffff;
+    font-weight : bold;
+    text-align : center;
+}
+TR.headerInfo {
+    background : #00ff00;
+    color : #bbc3d3;
+}
+TD.headerInfo {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #00ff00;
+    color : #ffffff;
+    font-weight : bold;
+    text-align : center;
+}
+TR.footer {
+    background : #bbc3d3;
+    color : inherit;
+}
+TD.footer {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-image : url(images/links_middle.gif);
+    background-repeat : repeat-x;
+    background : #bbc3d3;
+    color : #ffffff;
+    font-weight : bold;
+}
+.templateinfobox { 
+    background : #fbfcfd url('images/infobox/background_box.gif') repeat-y left top;
+    color : inherit;
+    font-family : Verdana, Arial, sans-serif;
+  font-size:10px;
+}
+.infoBox {
+    color : inherit;
+    background : #b6b7cb;
+}
+TD.infoBox, SPAN.infoBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #ff9900;
+    color : inherit;
+}
+TD.infoBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #c8d0e0;
+    color : #ffffff;
+}
+.infoBoxContents {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+TD.infoBoxFooter {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #c8d0e0;
+    color : #ffffff;
+}
+
+TD.contentBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #534f4d;
+    background : inherit;
+    padding-top : 5px;
+} 
+ .infoBoxContentsHeader {
+    background : #c8d0e0;
+    color : #000000;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ .infoBoxContentsCenter {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+    background-color : #c8d0e0;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+TD.infoBoxHeadingImage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-image : url('images/infobox/background.gif');
+    background-repeat : repeat-x;
+    background-position : left;
+    background-color : #c8d0e0;
+    color : #000000;
+}
+TD.infoBoxFooterImage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #c8d0e0;
+    background-image : url(images/infobox/backgroundfb.gif);
+    background-repeat : repeat-x;
+    background-position : left;
+    color : #000000;
+}
+.infoBoxNotice {
+    color : #ffffff;
+    background : #ff8e90;
+}
+.infoBoxNoticeContents {
+    background : #c8d0e0;
+    color : #000000;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+TD.main_table_heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    border-width : thin;
+    border-color : #cccccc;
+    border-style : solid;
+    background : #c8d0e0;
+    color : #000000;
+}
+TD.main_table_heading_inner {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #c8d0e0;
+    color : #ffffff;
+}
+
+TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+    background : #f8f8f9;
+    color : inherit;
+}
+TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+    background : #f8f8f9;
+    color : inherit;
+}
+TABLE.productListing {
+    border : 1px;
+    border-style : solid;
+    border-color : #b6b7cb;
+    border-spacing : 1px;
+}
+.productListing-heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #b6b7cb;
+    color : #000000;
+    font-weight : bold;
+}
+.productlisting-headingPrice {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 20px;
+    background : #cccccc;
+    color : #9a9a9a;
+    font-weight : bold;
+}
+TD.productListing-data {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+A.pageResults {
+    color : #0000ff;
+    background : inherit;
+}
+a:hover.pageResults {
+    color : #0000ff;
+    background : #ffff33;
+}
+TD.pageHeading, DIV.pageHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 20px;
+    font-weight : bold;
+    color : #9a9a9a;
+    background : inherit;
+}
+TR.subBar {
+    background : #f4f7fd;
+    color : inherit;
+}
+TD.subBar {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background : inherit;
+}
+TD.main, P.main {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+    background : inherit;
+    color : inherit;
+}
+TD.smallText, SPAN.smallText, P.smallText {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+TD.accountCategory {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 13px;
+    color : #aabbdd;
+    background : inherit;
+}
+TD.fieldKey {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+TD.fieldValue {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+}
+TD.tableHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+TD.category_desc {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+}
+SPAN.newItemInCart {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #ff0000;
+    background : inherit;
+}
+CHECKBOX, INPUT, RADIO, SELECT {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+}
+TEXTAREA {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+}
+SPAN.greetUser {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    color : #f0a480;
+    background : inherit;
+    font-weight : bold;
+}
+TABLE.formArea {
+    color : #f4f7fd;
+    background : #f1f9fe;
+    border-color : #7b9ebd;
+    border-style : solid;
+    border-width : 1px;
+}
+TD.formAreaTitle {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    font-weight : bold;
+}
+SPAN.markProductOutOfStock {
+    font-family : Tahoma, Verdana, Arial, sans-serif;
+    font-size : 12px;
+    color : #c76170;
+    background : inherit;
+    font-weight : bold;
+}
+SPAN.productSpecialPrice {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ff0000;
+    background : inherit;
+}
+SPAN.errorText {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ff0000;
+    background : inherit;
+}
+.moduleRowOver {
+    background-color : #d7e9f7;
+    color : inherit;
+    cursor : pointer;
+}
+.moduleRowSelected {
+    background-color : #e9f4fc;
+    color : inherit;
+}
+.checkoutBarFrom, .checkoutBarTo {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #8c8c8c;
+    background : inherit;
+}
+.checkoutBarCurrent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background : inherit;
+}
+.messageBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+.messageStackError, .messageStackWarning {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-color : #ffb3b5;
+    color : inherit;
+}
+.messageStackSuccess {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background-color : #99ff00;
+    color : inherit;
+}
+.inputRequirement {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #ff0000;
+    background : inherit;
+}
+TABLE.linkListing {
+    border : 1px;
+    border-style : solid;
+    border-color : #b6b7cb;
+    border-spacing : 1px;
+}
+.linkListing-heading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #b6b7cb;
+    color : #ffffff;
+    text-align : center;
+}
+TD.linkListing-data {
+    border-right : 1px solid #b6b7cb;
+    border-bottom : 1px solid #b6b7cb;
+    padding : 4px;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+TR.linkListing-odd {
+    background : #f8f8f9;
+    color : inherit;
+}
+TR.linkListing-even {
+    background : #f5f5f5;
+    color : inherit;
+}
+.content {
+    color : #000000;
+    background : inherit;
+    font-size : 10px;
+    font-family : Verdana, Arial, sans-serif;
+}
+TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    line-height : 1.5;
+    color : #bdcaf0;
+    background : inherit;
+}
+TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+    background-image : url('images/button_blank_left.gif');
+}
+TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+    background-image : url('images/button_blank_right.gif');
+}
+TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+    background-image : url('images/button_blank_middle.gif');
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : inherit;
+    color : #000000;
+}
+A.HeaderPageLinks {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #000000;
+    background : inherit;
+}
+a:hover.HeaderPageLinks {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+    color : #00ff00;
+}
+TD.cookieUsage {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background : #000000;
+    color : #ffffff;
+}
+.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #808080;
+}
+.TR.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #808080;
+}
+.TD.attributeBoxContent {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #c0c0c0;
+}
+.storyboxtitle {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+.storyboxtitle A:link {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+.storyboxtitle A:active {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+.storyboxtitle A:visited {
+    font-family : Verdana, Arial, sans-serif;
+    color : #000000;
+    font-size : 10px;
+    font-weight : bold;
+    background : inherit;
+}
+.storyboxtitle A:hover {
+    font-family : Verdana, Arial, sans-serif;
+    color : #ffffff;
+    font-size : 10px;
+    font-weight : bold;
+    text-decoration : underline;
+    background : inherit;
+}
+.yearHeader {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 14px;
+    font-weight : bold;
+    color : #000000;
+    background-color : #ffffff;
+}
+.calendarMonth {
+    background-color : #cccccc;
+    color : inherit;
+    cursor : default;
+    width : 100%;
+}
+.calendarHeader {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    font-weight : bold;
+    color : #000000;
+    background-color : #ffffff;
+    text-decoration : none;
+    height : 22px;
+}
+.calendarToday {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #ffcf00;
+    padding-left : 3px;
+    text-decoration : none;
+    border : 1px solid #ffffff;
+    height : 22px;
+    width : 18px;
+}
+.calendarWeekend {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #caeeff;
+    padding-left : 3px;
+    line-height : 14px;
+    text-decoration : none;
+    border : 1px solid #ffffff;
+    height : 22px;
+    width : 18px;
+}
+.calendar {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    color : #000000;
+    background-color : #ffffff;
+    padding-left : 3px;
+    line-height : 14px;
+    text-decoration : none;
+    height : 22px;
+    width : 18px;
+}
+.event {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 11px;
+    color : #000000;
+    background-color : #ffffff;
+    text-decoration : none;
+    border : 1px solid #e6e6e6;
+}
+.empty {
+    background-color : #f0faff;
+    color : inherit;
+    line-height : 14px;
+    height : 22px;
+    width : 18px;
+}
+.calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+.calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+.calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+    color : red;
+    text-decoration : underline;
+    background : inherit;
+}
+h4.infoTitle {
+    margin-top : 0;
+    margin-right : 0;
+    margin-left : 0;
+    margin-bottom : 0.2em;
+}
+p.infoBlurb {
+    margin-top : 0;
+    margin-right : 0;
+    margin-left : 0;
+    margin-bottom : 2em;
+}
+TD.productPriceInListing {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #d2e9fb;
+    color : inherit;
+}
+TD.productPriceInBox {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    background : #eeeeee;
+    color : inherit;
+}
+TD.productPriceInProdInfo {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 12px;
+    background : #ccffcc;
+    color : inherit;
+}
+#navMenu {
+    clear : both;
+    height : 0.01%;
+    margin : 0;
+    padding : 0;
+    list-style : none;
+}
+#navMenu ul {
+    float : left;
+    width : 150px;
+    margin : 0;
+    padding : 0;
+    list-style : none;
+}
+#navMenu li {
+    position : relative;
+    float : left;
+    line-height : 24px;
+    margin-bottom : -1px;
+    width : 150px;
+}
+#navMenu li ul {
+    position : absolute;
+    left : -999em;
+    margin-left : 150px;
+    margin-top : -26px;
+}
+#navMenu li ul ul {
+    left : -999em;
+}
+#navMenu li a {
+    width : 150px;
+    display : block;
+    color : #334;
+    font-weight : bold;
+    text-decoration : none;
+    background : #ffffff;
+    border : 1px solid #cce;
+    padding-left : 2px;
+}
+#navMenu li a:hover {
+    color : #000000;
+    background : #aac;
+}
+#navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+    left : -999em;
+}
+#navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+    left : auto;
+}

Added: trunk/direct.openmoko.com/templates/Helius1/template.php
===================================================================
--- trunk/direct.openmoko.com/templates/Helius1/template.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Helius1/template.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,79 @@
+<?php
+/*
+  $Id: original.php,
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 CRE Loaded
+
+  Released under the GNU General Public License
+*/
+define('TEMPLATE_NAME', 'Helius1');
+define('TEMPLATE_VERSION', '1.0');
+define('TEMPLATE_SYSTEM', 'ATS');
+define('TEMPLATE_AUTHOR', '');
+
+//used to get boxes from default
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_CATALOG . 'templates/default/boxes');
+define('DIR_FS_TEMPLATE_MAINPAGES', DIR_FS_CATALOG . 'templates/default/mainpage_modules/');
+
+//which files to use
+define('TEMPLATE_BOX_TPL', DIR_WS_TEMPLATES . '/default/boxes.tpl.php');
+define('TEMPLATE_HTML_OUT', DIR_WS_TEMPLATES . '/default/extra_html_output.php' );
+
+define('DIR_WS_TEMPLATE_IMAGES', 'templates/Helius1/images/');
+define('TEMPLATE_IMAGE_DIRECTORY',DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images');
+
+//variables moved from box.tpl.php
+define('TEMPLATE_TABLE_BORDER', '0');
+define('TEMPLATE_TABLE_WIDTH', '100%');
+define('TEMPLATE_TABLE_CELLSPACING', '0');
+define('TEMPLATE_TABLE_CELLPADDIING', '0');
+define('TEMPLATE_TABLE_PARAMETERS', '');
+define('TEMPLATE_TABLE_ROW_PARAMETERS', '');
+define('TEMPLATE_TABLE_DATA_PARAMETERS', '');
+define('TEMPLATE_TABLE_CONTENT_CELLPADING', '2');
+define('TEMPLATE_TABLE_CENTER_CONTENT_CELLPADING', '4');
+
+//for sidebox footer
+define('TEMPLATE_BOX_IMAGE_FOOTER_LEFT', 'true');
+define('TEMPLATE_BOX_IMAGE_FOOTER_RIGHT', 'true');
+define('TEMPLATE_BOX_IMAGE_FOOTER_RIGHT_ARROW', 'true');
+define('TEMPLATE_BOX_IMAGE_FOOTER_LEFTRIGHT', 'true');
+//for side header
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFT', 'true');
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_RIGHT', 'true');
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFTRIGHT', 'true');
+
+//for content header
+define('TEMPLATE_IMAGE_BORDER_TOP_LEFT', 'true');
+define('TEMPLATE_IMAGE_BORDER_TOP_RIGHT', 'true');
+//include footer
+define('TEMPLATE_INCLUDE_FOOTER', 'true');
+//images to use or html
+
+define('TEMPLATE_BOX_IMAGE_TOP_TRANS', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/pixel_trans.gif');
+
+//box header images
+define('TEMPLATE_BOX_IMAGE_TOP_LEFT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_RIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_LEFTRIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_RIGHTARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_NOARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/no_arrow_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_BACKGROUND', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif');
+
+//box footer images
+define('TEMPLATE_BOX_IMAGE_FOOT_LEFT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_RIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/backgroundfb.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_NOARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip');
+define('TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '');
+
+// box middles images
+define('TEMPLATE_BOX_MIDDLE_LEFT_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif');
+define('TEMPLATE_BOX_MIDDLE_MIDDLE_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background_box.gif');
+define('TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/OpenMoko.sql
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/OpenMoko.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/OpenMoko.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#FFFFFF');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "OpenMoko.gif", template_cellpadding_main ="3", template_cellpadding_sub= "8", template_cellpadding_left= "3", template_cellpadding_right= "3", site_width= "100%", include_column_left= "yes", include_column_right= "yes", box_width_left= "130", box_width_right= "130", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no", show_header_link_buttons="yes", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width= "1", side_box_right_width= "1"  WHERE template_id="#tID#"

Added: trunk/direct.openmoko.com/templates/OpenMoko/account.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/account.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/account.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,181 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  if ($messageStack->size('account') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('account'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+
+  if (tep_count_customer_orders() > 0) {
+?>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main my_account_title"><b><?php echo OVERVIEW_TITLE; ?></b></td>
+            <td class="main my_account_title">&nbsp;&nbsp;<?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '"><u>' . OVERVIEW_SHOW_ALL_ORDERS . '</u></a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+    $orders_query = tep_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id desc limit 3");
+    while ($orders = tep_db_fetch_array($orders_query)) {
+      if (tep_not_null($orders['delivery_name'])) {
+        $order_name = $orders['delivery_name'];
+        $order_country = $orders['delivery_country'];
+      } else {
+        $order_name = $orders['billing_name'];
+        $order_country = $orders['billing_country'];
+      }
+?>
+                  <tr class="moduleRow moduleRowSpacing" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL'); ?>'">
+                    <td class="main" width="80"><?php echo tep_date_short($orders['date_purchased']); ?></td>
+                    <td class="main"><?php echo '#' . $orders['orders_id']; ?></td>
+                    <td class="main"><?php echo tep_output_string_protected($order_name) . ', ' . $order_country; ?></td>
+                    <td class="main"><?php echo $orders['orders_status_name']; ?></td>
+                    <td class="main" align="right"><span class="price"><?php echo $orders['order_total']; ?></span>&nbsp;
+                    <?php echo '<a class="orders_view_button" href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL') . '">' . tep_template_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main my_account_title"><b><?php echo MY_ACCOUNT_TITLE; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox my_account_links">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td colspan="4">
+                	<ul>
+	                    <li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . MY_ACCOUNT_INFORMATION . '</a>'; ?></li>
+	                    <li><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . MY_ACCOUNT_ADDRESS_BOOK . '</a>'; ?></li>
+	                    <li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">' . MY_ACCOUNT_PASSWORD . '</a>'; ?></li>
+	                </ul>
+                </td>
+                <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main my_account_title"><b><?php echo MY_ORDERS_TITLE; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox my_account_links">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td colspan="4">
+                 	<ul>
+                    	<li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . MY_ORDERS_VIEW . '</a>'; ?></li>
+                    </ul>
+                </td>
+                <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main my_account_title"><b><?php echo EMAIL_NOTIFICATIONS_TITLE; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox my_account_links">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td colspan="4">
+                	<ul>
+						<li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '">' . EMAIL_NOTIFICATIONS_NEWSLETTERS . '</a>'; ?></li>
+                    	<li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . EMAIL_NOTIFICATIONS_PRODUCTS . '</a>'; ?></li>
+                    </ul>
+                </td>
+                <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/OpenMoko/account_edit.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/account_edit.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/account_edit.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,136 @@
+    <?php echo tep_draw_form('account_edit', tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'onSubmit="return check_form(account_edit);"') . tep_draw_hidden_field('action', 'process'); ?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if ($messageStack->size('account_edit') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('account_edit'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td>
+            	<div class="my_account_title"><b><?php echo MY_ACCOUNT_TITLE; ?></b></div>
+			</td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="2" cellpadding="2" class="form_table">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    if (isset($gender)) {
+      $male = ($gender == 'm') ? true : false;
+    } else {
+      $male = ($account['customers_gender'] == 'm') ? true : false;
+    }
+    $female = !$male;
+?>
+                  <tr>
+                    <td class="main simple_first_row"><?php echo ENTRY_GENDER; ?></td>
+                    <td class="main"><?php echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
+                  </tr>
+<?php
+  }
+?>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('firstname', $account['customers_firstname']) . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('lastname', $account['customers_lastname']) . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
+                  </tr>
+<?php
+  if (ACCOUNT_DOB == 'true') {
+?>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('dob', tep_date_short($account['customers_dob'])) . '&nbsp;' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td>
+                  </tr>
+<?php
+  }
+?>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('email_address', $account['customers_email_address']) . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('telephone', $account['customers_telephone']) . '&nbsp;' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('fax', $account['customers_fax']) . '&nbsp;' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                </table>
+                	<div class="requiredWarning"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
+                </td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="cartoptions">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/OpenMoko/account_history.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/account_history.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/account_history.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,134 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+<?php
+  $orders_total = tep_count_customer_orders();
+
+  if ($orders_total > 0) {
+    $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id DESC";
+    $history_split = new splitPageResults($history_query_raw, MAX_DISPLAY_ORDER_HISTORY);
+    $history_query = tep_db_query($history_split->sql_query);
+
+    while ($history = tep_db_fetch_array($history_query)) {
+      $products_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$history['orders_id'] . "'");
+      $products = tep_db_fetch_array($products_query);
+
+      if (tep_not_null($history['delivery_name'])) {
+        $order_type = TEXT_ORDER_SHIPPED_TO;
+        $order_name = $history['delivery_name'];
+      } else {
+        $order_type = TEXT_ORDER_BILLED_TO;
+        $order_name = $history['billing_name'];
+      }
+?>
+          <table border="0" width="100%" cellspacing="0" cellpadding="2">
+            <tr class="moduleRow">
+              <td class="main"><?php echo '<b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id']; ?></td>
+              <td class="main" align="right"><?php echo '<b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name']; ?></td>
+            </tr>
+          </table>
+          <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+            <tr class="infoBoxContents">
+              <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
+                <tr>
+                  <td class="main" width="50%" valign="top"><?php echo '<b>' . TEXT_ORDER_DATE . '</b> ' . tep_date_long($history['date_purchased']) . '<br><b>' . $order_type . '</b> ' . tep_output_string_protected($order_name); ?></td>
+                  <td class="main" width="30%" valign="top"><?php echo '<b>' . TEXT_ORDER_PRODUCTS . '</b> ' . $products['count'] . '<br><b>' . TEXT_ORDER_COST . '</b> <span class="price"> ' . strip_tags($history['order_total']); ?></span></td>
+                  <td class="main" width="20%"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&amp;' : '') . 'order_id=' . $history['orders_id'], 'SSL') . '">' . tep_template_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
+                </tr>
+              </table></td>
+            </tr>
+          </table>
+          <table border="0" width="100%" cellspacing="0" cellpadding="2">
+            <tr>
+              <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            </tr>
+          </table>
+<?php
+    }
+  } else {
+?>
+          <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+            <tr class="infoBoxContents">
+              <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
+                <tr>
+                  <td class="main"><?php echo TEXT_NO_PURCHASES; ?></td>
+                </tr>
+              </table></td>
+            </tr>
+          </table>
+<?php
+  }
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  if ($orders_total > 0) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText" valign="top"><?php echo $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
+            <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="cartoptions">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                </td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/OpenMoko/account_history_info.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/account_history_info.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/account_history_info.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,215 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2" style="background: #F1f1f1; padding: 8px;">
+          <tr>
+            <td class="main" colspan="2" style="font-size: 13px;"><b><?php echo sprintf(HEADING_ORDER_NUMBER, $HTTP_GET_VARS['order_id']) . ' <small>(' . $order->info['orders_status'] . ')</small>'; ?></b></td>
+          </tr>
+          <tr>
+            <td class="smallText"><?php echo HEADING_ORDER_DATE . ' ' . tep_date_long($order->info['date_purchased']); ?></td>
+            <td class="smallText" align="right" style="font-size: 13px;"><b><?php echo HEADING_ORDER_TOTAL . '</b> <span class="price">' . $order->info['total']; ?></span></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+<?php
+  if ($order->delivery != false) {
+?>
+            <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main bulleted"><b><?php echo HEADING_DELIVERY_ADDRESS; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main idented"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>
+              </tr>
+<?php
+    if (tep_not_null($order->info['shipping_method'])) {
+?>
+              <tr>
+                <td class="main bulleted"><b><?php echo HEADING_SHIPPING_METHOD; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main idented"><?php echo $order->info['shipping_method']; ?></td>
+              </tr>
+<?php
+    }
+?>
+            </table></td>
+<?php
+  }
+?>
+            <td width="<?php echo (($order->delivery != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (sizeof($order->info['tax_groups']) > 1) {
+?>
+                  <tr>
+                    <td class="main" colspan="2"><b><?php echo HEADING_PRODUCTS; ?></b></td>
+                    <td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td>
+                    <td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
+                  </tr>
+<?php
+  } else {
+?>
+                  <tr>
+                    <td class="main" colspan="2"><b><?php echo HEADING_PRODUCTS; ?></b></td>
+                    <td class="main" align="right"><b><?php echo HEADING_PRODUCTS_BASE_PRICE; ?></b></td>
+                    <td class="main" align="right"><b><?php echo HEADING_PRODUCTS_FINAL_PRICE; ?></b></td>
+                  </tr>
+<?php
+  }
+
+  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+    echo '          <tr>' . "\n" .
+         '            <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
+         '            <td class="main" valign="top" style="padding-bottom: 10px;">' . $order->products[$i]['name'] ; 
+    echo '<br><b>' . HEADING_OPTIONS  . '</b></small>';
+
+//attibute_query 
+//check for attibutes:
+
+          $attributes_check_query = tep_db_query("select *
+            from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "
+           where 
+           orders_id = '" .$order_id . "' and
+           orders_products_id = '" . $order->products[$i]['orders_products_id'] . "' ");
+ if (tep_db_num_rows($attributes_check_query)) {
+      while ($attributes = tep_db_fetch_array($attributes_check_query)) {
+          echo '<br><small><i> *' . $attributes['products_options'] . ' : ' . $attributes['products_options_values'] . '</i></small>';
+          echo '<br><small> ' . $attributes['price_prefix'] . ' ' . $currencies->display_price($attributes['options_values_price'], tep_get_tax_rate($products[$i]['tax_class_id']), 1) . '</small>';
+
+        }
+      }
+
+    echo '</td>' . "\n";
+ echo '</td><td class="main" valign="top" align="right">' .  $currencies->display_price($order->products[$i]['price'], tep_get_tax_rate($products[$i]['tax_class_id']), 1) . '</td>' . "\n";
+    if (sizeof($order->info['tax_groups']) > 1) {
+      echo '            <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
+    }
+
+    echo '            <td class="main" align="right" valign="top">' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
+         '          </tr>' . "\n";
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+
+      <tr style="display:none">
+        <td class="main"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main bulleted"><b><?php echo HEADING_BILLING_ADDRESS; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main idented"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td>
+              </tr>
+		      <tr>
+		        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+		      </tr>
+              <tr>
+                <td class="main bulleted spaced"><b><?php echo HEADING_PAYMENT_METHOD; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main idented"><?php echo $order->info['payment_method']; ?></td>
+              </tr>
+            </table></td>
+            <td width="70%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" style="border-top: 1px solid #ccc;padding-top: 10px">
+<?php
+  for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
+    echo '              <tr>' . "\n" .
+         '                <td class="main" align="right" width="100%">' . $order->totals[$i]['title'] . '</td>' . "\n" .
+         '                <td class="main" align="right">' . $order->totals[$i]['text'] . '</td>' . "\n" .
+         '              </tr>' . "\n";
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main underlined"><b><?php echo HEADING_ORDER_HISTORY; ?></b></td>
+      </tr>
+      <tr>
+        <td colspan="2"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");
+  while ($statuses = tep_db_fetch_array($statuses_query)) {
+    echo '              <tr>' . "\n" .
+         '                <td class="main" valign="top" width="70">' . tep_date_short($statuses['date_added']) . '</td>' . "\n" .
+         '                <td class="main" valign="top" width="170">' . $statuses['orders_status_name'] . '</td>' . "\n" .
+         '                <td class="main" valign="top">' . (empty($statuses['comments']) ? '&nbsp;' : nl2br(tep_output_string_protected($statuses['comments']))) . '</td>' . "\n" .
+         '              </tr>' . "\n";
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  //if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php');
+  if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . FILENAME_DOWNLOADS);
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td align="right" class="main"><?php echo '<a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_ORDERS_PRINTABLE) . '?' . (tep_get_all_get_params(array('order_id')) . 'order_id=' . (int)$HTTP_GET_VARS['order_id']) . '\')">' . tep_template_image_button('button_printorder.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?></td>
+        <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, tep_get_all_get_params(array('order_id')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></div>
+                    <?php require(DIR_WS_MODULES . 'payment/paypal/catalog/order_send_money.inc.php'); ?>
+                </td>
+<?php /* end PayPal_Shopping_Cart_IPN */ ?>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+      </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/OpenMoko/account_newsletters.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/account_newsletters.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/account_newsletters.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,82 @@
+    <?php echo tep_draw_form('account_newsletter', tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+       <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr class="moduleRow noborder" onclick="checkBox('newsletter_general')">
+                    <td class="main"><?php echo tep_draw_checkbox_field('newsletter_general', '1', (($newsletter['customers_newsletter'] == '1') ? true : false), 'onclick="checkBox(\'newsletter_general\')"'); ?></td>
+                    <td class="main"><b><?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER; ?></b></td>
+                  </tr>
+                  <tr>
+                    <td class="main">&nbsp;</td>
+                    <td><table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main" style="font-size: 11px;"><?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER_DESCRIPTION; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/OpenMoko/account_notifications.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/account_notifications.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/account_notifications.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,156 @@
+    <?php echo tep_draw_form('account_notifications', tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="main"><b><?php echo MY_NOTIFICATIONS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo MY_NOTIFICATIONS_DESCRIPTION; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo GLOBAL_NOTIFICATIONS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr class="moduleRow noborder" onclick="checkBox('product_global')">
+                    <td class="main" width="30"><?php echo tep_draw_checkbox_field('product_global', '1', (($global['global_product_notifications'] == '1') ? true : false), 'onclick="checkBox(\'product_global\')"'); ?></td>
+                    <td class="main"><b><?php echo GLOBAL_NOTIFICATIONS_TITLE; ?></b></td>
+                  </tr>
+                  <tr>
+                    <td width="30">&nbsp;</td>
+                    <td class="main"><?php echo GLOBAL_NOTIFICATIONS_DESCRIPTION; ?></td>
+                  </tr>
+                </table></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if ($global['global_product_notifications'] != '1') {
+?>
+      <tr>
+        <td class="main"><b><?php echo NOTIFICATIONS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+    $products_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'");
+    $products_check = tep_db_fetch_array($products_check_query);
+    if ($products_check['total'] > 0) {
+?>
+                  <tr>
+                    <td class="main" colspan="2"><?php echo NOTIFICATIONS_DESCRIPTION; ?></td>
+                  </tr>
+<?php
+      $counter = 0;
+      $products_query = tep_db_query("select pd.products_id, pd.products_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where pn.customers_id = '" . (int)$customer_id . "' and pn.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+?>
+                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('products[<?php echo $counter; ?>]')">
+                    <td class="main" width="30"><?php echo tep_draw_checkbox_field('products[' . $counter . ']', $products['products_id'], true, 'onclick="checkBox(\'products[' . $counter . ']\')"'); ?></td>
+                    <td class="main"><b><?php echo $products['products_name']; ?></b></td>
+                  </tr>
+<?php
+        $counter++;
+      }
+    } else {
+?>
+                  <tr>
+                    <td class="main"><?php echo NOTIFICATIONS_NON_EXISTING; ?></td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/OpenMoko/account_password.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/account_password.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/account_password.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,98 @@
+    <?php echo tep_draw_form('account_password', tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL'), 'post', 'onSubmit="return check_form(account_password);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if ($messageStack->size('account_password') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('account_password'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td>
+        <table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="2" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo ENTRY_PASSWORD_CURRENT; ?></td>
+                    <td class="main"><?php echo tep_draw_password_field('password_current') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_CURRENT_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CURRENT_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_PASSWORD_NEW; ?></td>
+                    <td class="main"><?php echo tep_draw_password_field('password_new') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_NEW_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_NEW_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+                    <td class="main"><?php echo tep_draw_password_field('password_confirmation') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr><td colspan="2"><div class="requiredWarning"><?php echo FORM_REQUIRED_INFORMATION; ?></div></td></tr>
+                  
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="cartoptions">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/address_book.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/address_book.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/address_book.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,150 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_address_book.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if ($messageStack->size('addressbook') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('addressbook'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td class="main"><b><?php echo PRIMARY_ADDRESS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td>
+            
+            
+            
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+
+                <td class="main" width="50%" valign="top"><?php echo PRIMARY_ADDRESS_DESCRIPTION; ?></td>
+                
+                
+                <td align="right" width="50%" valign="top">
+                <div class="primary_address">
+                	<span class="title"><?php echo PRIMARY_ADDRESS_TITLE; ?></span>
+	                <span class="data"><?php echo tep_address_label($customer_id, $customer_default_address_id, true, ' ', '<br>'); ?></span>
+            	</div>                
+                </td>
+              </tr>
+            </table>
+
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo ADDRESS_BOOK_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' order by firstname, lastname");
+  while ($addresses = tep_db_fetch_array($addresses_query)) {
+    $format_id = tep_get_address_format_id($addresses['country_id']);
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr class="moduleRow">
+                    <td class="main"><b><?php echo tep_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?></b><?php if ($addresses['address_book_id'] == $customer_default_address_id) echo '&nbsp;<small><i>' . PRIMARY_ADDRESS . '</i></small>'; ?></td>
+                    <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL') . '">' . tep_template_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $addresses['address_book_id'], 'SSL') . '">' . tep_template_image_button('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main single_address"><?php echo tep_address_format($format_id, $addresses, true, ' ', '<br>'); ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="cartoptions">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+<?php
+  if (tep_count_customer_address_book_entries() < MAX_ADDRESS_BOOK_ENTRIES) {
+?>
+                <td class="smallText" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'SSL') . '">' . tep_template_image_button('button_add_address.gif', IMAGE_BUTTON_ADD_ADDRESS) . '</a>'; ?></td>
+<?php
+  }
+?>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td class="smallText requiredWarning"><?php echo sprintf(TEXT_MAXIMUM_ENTRIES, MAX_ADDRESS_BOOK_ENTRIES); ?></td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/address_book_process.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/address_book_process.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/address_book_process.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,148 @@
+    <?php if (!isset($HTTP_GET_VARS['delete'])) echo tep_draw_form('addressbook', tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, (isset($HTTP_GET_VARS['edit']) ? 'edit=' . $HTTP_GET_VARS['edit'] : ''), 'SSL'), 'post', 'onSubmit="return check_form(addressbook);"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+        	<div class="pageHeading"><?php if (isset($HTTP_GET_VARS['edit'])) { echo HEADING_TITLE_MODIFY_ENTRY; } elseif (isset($HTTP_GET_VARS['delete'])) { echo HEADING_TITLE_DELETE_ENTRY; } else { echo HEADING_TITLE_ADD_ENTRY; } ?></div>
+		</td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+//if (isset($HTTP_GET_VARS['edit'])) { $header_text = HEADING_TITLE_MODIFY_ENTRY; } elseif (isset($HTTP_GET_VARS['delete'])) { $header_text = HEADING_TITLE_DELETE_ENTRY; } else { $header_text = HEADING_TITLE_ADD_ENTRY; }
+}
+// EOF: Lango Added for template MOD
+?>
+
+
+<?php
+  if ($messageStack->size('addressbook') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('addressbook'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}
+// BOF: Lango Added for template MOD
+// EOF: Lango Added for template MOD
+
+  if (isset($HTTP_GET_VARS['delete'])) {
+?>
+      <tr>
+        <td class="main"><b><?php echo DELETE_ADDRESS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td>
+
+                <td class="main" width="50%" valign="top"><?php echo DELETE_ADDRESS_DESCRIPTION; ?></td>
+                <td align="right" width="50%" valign="top">
+                <div class="primary_address">
+                	<span class="title"><?php echo SELECTED_ADDRESS; ?></span>
+	                <span class="data"><?php echo tep_address_label($customer_id, $HTTP_GET_VARS['delete'], true, ' ', '<br>'); ?></span>
+            	</div> 
+               
+                </td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="cartoptions">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'] . '&amp;action=deleteconfirm', 'SSL') . '">' . tep_template_image_button('button_delete.gif', IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><?php //echo DIR_WS_MODULES . FILENAME_ADDRESS_BOOK_DETAILS; include(DIR_WS_MODULES . FILENAME_ADDRESS_BOOK_DETAILS); 
+			include(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/modules/' . FILENAME_ADDRESS_BOOK_DETAILS);
+		?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="cartoptions">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_draw_hidden_field('action', 'update') . tep_draw_hidden_field('edit', $HTTP_GET_VARS['edit']) . tep_template_image_submit('button_update.gif', IMAGE_BUTTON_UPDATE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+    } else {
+      if (sizeof($navigation->snapshot) > 0) {
+        $back_link = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
+      } else {
+        $back_link = tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL');
+      }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="cartoptions">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . $back_link . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_draw_hidden_field('action', 'process') . tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+    }
+  }
+?>
+    </table><?php if (!isset($HTTP_GET_VARS['delete'])) echo '</form>'; ?>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/affiliate.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 - 2003 osCommerce
+   
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3386 $
+
+  Released under the GNU General Public License
+*/
+?>          
+<!-- affiliate_system //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_AFFILIATE . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (tep_session_is_registered('affiliate_id')) {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . BOX_AFFILIATE_SUMMARY . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, '', 'SSL'). '">' . BOX_AFFILIATE_NEWS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL'). '">' . BOX_AFFILIATE_ACCOUNT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'). '">' . BOX_AFFILIATE_PAYMENT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'). '">' . BOX_AFFILIATE_CLICKRATE . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'). '">' . BOX_AFFILIATE_SALES . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS). '">' . BOX_AFFILIATE_BANNERS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_FAQ). '">' . BOX_AFFILIATE_FAQ . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_LOGOUT). '">' . BOX_AFFILIATE_LOGOUT . '</a>');
+  } else {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_INFO). '">' . BOX_AFFILIATE_INFO . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . BOX_AFFILIATE_LOGIN . '</a>');
+  }
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- affiliate_system_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/articles.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,220 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2249 $
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_topic($counter) {
+    global $tree, $topics_string, $tPath_array;
+
+    for ($i=0; $i<$tree[$counter]['level']; $i++) {
+      $topics_string .= "&nbsp;&nbsp;";
+    }
+
+    $topics_string .= '<a href="';
+
+    if ($tree[$counter]['parent'] == 0) {
+      $tPath_new = 'tPath=' . $counter;
+    } else {
+      $tPath_new = 'tPath=' . $tree[$counter]['path'];
+    }
+
+    $topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '<b>';
+    }
+
+// display topic name
+    $topics_string .= $tree[$counter]['name'];
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '</b>';
+    }
+
+    if (tep_has_topic_subtopics($counter)) {
+      $topics_string .= ' -&gt;';
+    }
+
+    $topics_string .= '</a>';
+
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_in_topic = tep_count_articles_in_topic($counter);
+      if ($articles_in_topic > 0) {
+        $topics_string .= '&nbsp;(' . $articles_in_topic . ')';
+      }
+    }
+
+    $topics_string .= '<br>';
+
+    if ($tree[$counter]['next_id'] != false) {
+      tep_show_topic($tree[$counter]['next_id']);
+    }
+  }
+?>
+<!-- topics //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_ARTICLES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $topics_string = '';
+  $tree = array();
+
+  $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '0' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+  while ($topics = tep_db_fetch_array($topics_query))  {
+    $tree[$topics['topics_id']] = array('name' => $topics['topics_name'],
+                                        'parent' => $topics['parent_id'],
+                                        'level' => 0,
+                                        'path' => $topics['topics_id'],
+                                        'next_id' => false);
+
+    if (isset($parent_id)) {
+      $tree[$parent_id]['next_id'] = $topics['topics_id'];
+    }
+
+    $parent_id = $topics['topics_id'];
+
+    if (!isset($first_topic_element)) {
+      $first_topic_element = $topics['topics_id'];
+    }
+  }
+
+  //------------------------
+  if (tep_not_null($tPath)) {
+    $new_path = '';
+    reset($tPath_array);
+    while (list($key, $value) = each($tPath_array)) {
+      unset($parent_id);
+      unset($first_id);
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$value . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+      if (tep_db_num_rows($topics_query)) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($topics_query)) {
+          $tree[$row['topics_id']] = array('name' => $row['topics_name'],
+                                           'parent' => $row['parent_id'],
+                                           'level' => $key+1,
+                                           'path' => $new_path . '_' . $row['topics_id'],
+                                           'next_id' => false);
+
+          if (isset($parent_id)) {
+            $tree[$parent_id]['next_id'] = $row['topics_id'];
+          }
+
+          $parent_id = $row['topics_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['topics_id'];
+          }
+
+          $last_id = $row['topics_id'];
+        }
+        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
+        $tree[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_topic($first_topic_element);
+
+  $info_box_contents = array();
+  $new_articles_string = '';
+  $all_articles_string = '';
+
+  if (DISPLAY_NEW_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_new_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and(a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = ad.articles_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a2t.topics_id = td.topics_id 
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'
+                                            and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY)");
+      $articles_new_count = ' (' . tep_db_num_rows($articles_new_query) . ')';
+    } else {
+      $articles_new_count = '';
+    }
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string = '<b>';
+    }
+
+    $new_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES_NEW, '', 'NONSSL') . '">' . BOX_NEW_ARTICLES . '</a>';
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string .= '</b>';
+    }
+
+    $new_articles_string .= $articles_new_count . '<br>';
+
+  }
+
+  if (DISPLAY_ALL_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_all_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a.articles_id = ad.articles_id
+                                            and a2t.topics_id = td.topics_id
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'");
+      $articles_all_count = ' (' . tep_db_num_rows($articles_all_query) . ')';
+    } else {
+      $articles_all_count = '';
+    }
+
+    if ($topic_depth == 'top') {
+      $all_articles_string = '<b>';
+    }
+
+    $all_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES, '', 'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a>';
+
+    if ($topic_depth == 'top') {
+      $all_articles_string .= '</b>';
+    }
+
+    $all_articles_string .= $articles_all_count . '<br>';
+
+  }
+
+  $info_box_contents[] = array('text' => $new_articles_string . $all_articles_string . $topics_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- topics_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/asearch.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/asearch.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/asearch.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: asearch.php
+  searches articles using article_manager
+  by AlDaffodil (aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- article search //-->
+          <tr>
+            <td>
+<?php
+ //if (ALLOW_QUICK_SEARCH_DESCRIPTION == 'true') {
+  //  $param = '<input type="hidden" name="search_in_description" value="1">';
+ //  } else {
+      $param = '';
+// }
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_ASEARCH . '</font>');
+     new infoBoxHeading($info_box_contents, false, false);
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find_article" method="get" action="' . tep_href_link(FILENAME_ARTICLE_SEARCH, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . $param . '<input type="text" name="akeywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["akeywords"])) . '">' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><input type="checkbox" name="description">' . BOX_ASEARCH_TEXT . '<br>');
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- article_search //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/authors.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name");
+  if ($number_of_author_rows = tep_db_num_rows($authors_query)) {
+?>
+<!-- authors //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_AUTHORS . '</font>');
+
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_author_rows <= MAX_DISPLAY_AUTHORS_IN_A_LIST) {
+// Display a list
+      $authors_list = '';
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        if (isset($HTTP_GET_VARS['authors_id']) && ($HTTP_GET_VARS['authors_id'] == $authors['authors_id'])) $authors_name = '<b>' . $authors_name .'</b>';
+        $authors_list .= '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $authors['authors_id']) . '">' . $authors_name . '</a><br>';
+      }
+
+      $authors_list = substr($authors_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $authors_list);
+    } else {
+// Display a drop-down
+      $authors_array = array();
+      if (MAX_AUTHORS_LIST < 2) {
+        $authors_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        $authors_array[] = array('id' => $authors['authors_id'],
+                                       'text' => $authors_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('authors', tep_href_link(FILENAME_ARTICLES, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('authors_id', $authors_array, (isset($HTTP_GET_VARS['authors_id']) ? $HTTP_GET_VARS['authors_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_AUTHORS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- authors_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/best_sellers.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/best_sellers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/best_sellers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: best_sellers.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($current_category_id) && ($current_category_id > 0)) {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  } else {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  }
+
+  if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
+?>
+<!-- best_sellers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_BESTSELLERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $rows = 0;
+    $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
+      $rows++;
+      $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
+    }
+    $bestsellers_list .= '</table>';
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => $bestsellers_list);
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- best_sellers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/boxad.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/boxad.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/boxad.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: boxad.php, v 1.1 2002/03/21 by aubrey at mycon.co.za
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+*/
+?>
+<!-- banner-ad-in-a-box //-->
+<?php
+  if ($banner = tep_banner_exists('dynamic', BOX_AD_BANNER_TYPE)) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+<!-- banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/calendar.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+$ID
+  ~ events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it 
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2426 $
+
+*/
+
+
+?>
+<!-- events_calendar //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CALENDER . '</font>');
+    new infoBoxHeading($info_box_contents, false, false,tep_href_link(FILENAME_EVENTS_CALENDER));
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'center',
+                                'text' => '<iframe name="calendar" id="calendar" align="center" marginwidth="0" marginheight="0" ' .
+                                          'src='  . FILENAME_EVENTS_CALENDAR_CONTENT . '?_month=' . $_month .'&amp;_year='. $_year .' frameborder=0 height=220 width=162 scrolling=no> ' .IFRAME_ERROR.'</iframe> ');
+   
+ 
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- events_calendar //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/card1.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/card1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/card1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1609 $
+
+*/
+?>
+<!-- Card Info Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CARD1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+//                               'text'  => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .
+//elari chanegd to provide a link to your payment acount
+                               'text'  => tep_image(DIR_WS_IMAGES . 'cards/logo-xclick_paypal.gif' , BOX_INFORMATION_CARD).
+                               '<br>' . tep_image(DIR_WS_IMAGES . 'cards/cards2.gif', BOX_INFORMATION_CARD) . '<br>'
+                               );
+
+new infoBox($info_box_contents);
+?>
+</td></tr>
+<!-- card_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,165 @@
+<?php
+/*
+  $Id: categories.php,v 1.1.1.1 2004/03/04 23:42:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3432 $
+
+  Released under the GNU General Public License
+*/
+$count=0;
+
+ function tep_show_category($counter,$count) {
+    global $foo, $categories_string, $id;
+
+$count++;
+    if ($count != 1) {
+$image=2;
+$HEIGHT = 20;
+     }else{
+$image=1;
+$HEIGHT = 21;
+}
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+
+    $categories_string .= '<tr><td>';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+    
+    $categories_string .= '<a class="navBlue" href="';
+
+}else{
+    $categories_string .= '&nbsp;';
+if ($foo[$counter]['parent'] != 0) {
+      $class="subnavBlue";
+   } else {
+  $class="navGrey";
+}
+
+if ($foo[$counter]['parent'] != 0) {
+      $categories_string .= '&nbsp;';
+   } else {
+         ;
+}
+    $categories_string .= '<a class="' . $class . '" href="';
+
+}
+
+    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string .= '">';
+// display category name
+      $categories_string .= $foo[$counter]['name'];
+    $categories_string .= '</a>';
+//    $categories_string .= '</td></tr>' ;
+
+
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category($foo[$counter]['next_id'],$count);
+    }
+
+  }
+?>
+<!-- categories //-->
+                  <tr>
+                    <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => '<font color="' . $font_color . '">' .BOX_HEADING_CATEGORIES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+$categories_string = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      $new_path .= $value;
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      while ($row = tep_db_fetch_array($categories_query)) {
+        $foo[$row['categories_id']] = array(
+                                            'name' => $row['categories_name'],
+                                            'parent' => $row['parent_id'],
+                                            'level' => $key+1,
+                                            'path' => $new_path . '_' . $row['categories_id'],
+                                            'next_id' => false
+                                           );
+
+        if (isset($prev_id)) {
+          $foo[$prev_id]['next_id'] = $row['categories_id'];
+        }
+
+        $prev_id = $row['categories_id'];
+
+        if (!isset($first_id)) {
+          $first_id = $row['categories_id'];
+        }
+
+        $last_id = $row['categories_id'];
+      }
+      if ($category_check != 0) {
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+      }
+
+      $new_path .= '_';
+    }
+  }
+
+  tep_show_category($first_element,$count);
+
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text'  => $categories_string
+                              );
+new infobox($info_box_contents);
+
+?>
+                    </td>
+                  </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories1.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- categories1 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(),
+                               'align' => 'left',
+                               'text'  => tep_draw_pull_down_menu('cPath', tep_get_categories(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"')
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- categories1_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories2.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,173 @@
+<?php
+/*
+  $Id: categories2.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+
+//###############################################
+if ( (USE_CACHE == 'true') && !defined('SID')) {
+    echo tep_cache_categories_box();
+  } else {
+//###############################################
+
+
+  function tep_show_category2($counter) {
+    global $foo, $categories_string2, $id;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      $categories_string2 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string2 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string2 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string2 .= '">';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '<b>';
+    }
+
+// display category name
+    $categories_string2 .= $foo[$counter]['name'];
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '</b>';
+    }
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string2 .= '-&gt;';
+    }
+
+    $categories_string2 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string2 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string2 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category2($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories 2 //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES2 . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+
+  $categories_string2 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_category2($first_element);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string2
+                              );
+  new infoBox($info_box_contents);
+
+$info_box_contents = array();
+
+?>
+            </td>
+          </tr>
+<!--############################################### //-->
+<?php
+}
+?>
+<!--############################################## //-->
+<!--categories2_eof //-->
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories3.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories3.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories3.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+/*
+  $Id: categories3.php,v 1.1 2004/04/05
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004osCommerce
+
+  Released under the GNU General Public License
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+*/
+
+// Categories_tree written by Gideon Romm from Symbio Technologies, LLC
+
+function tep_show_category3($cid, $cpath, $COLLAPSABLE) {
+  global $categories_string3, $languages_id, $HTTP_GET_VARS;
+  global $level;
+  $selectedPath = array();
+
+// Get all of the categories on this level
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }
+    $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;
+
+// Add category link to $categories_string3
+    for ($a=1; $a<$level{$categories['categories_id']}; $a++) {
+      $categories_string3 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string3 .= '<a href="';
+
+    $cPath_new = $cpath;
+    if ($level{$categories['parent_id']} > 0) {
+      $cPath_new .= "_";
+    }
+    $cPath_new .= $categories['categories_id'];
+
+    $cPath_new_text = "cPath=" . $cPath_new;
+
+    $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
+    $categories_string3 .= '">';
+
+    if ($HTTP_GET_VARS['cPath']) {
+      $selectedPath = split("_", $HTTP_GET_VARS['cPath']);
+    }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '<b>'; }
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '<u>'; }
+
+    $categories_string3 .= $categories['categories_name'];
+    if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string3 .= ' ->'; }
+
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '</u>'; }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '</b>'; }
+
+    $categories_string3 .= '</a>';
+
+    if (SHOW_COUNTS) {
+      $products_in_category = tep_count_products_in_category($categories['categories_id']);
+      if ($products_in_category > 0) {
+        $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string3 .= '<br>';
+
+
+// If I have subcategories, get them and show them
+    if (tep_has_category_subcategories($categories['categories_id'])) {
+
+      if ($COLLAPSABLE) {
+        if (in_array($categories['categories_id'], $selectedPath)) {
+          tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE);
+        }
+      }
+      else { tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE); }
+
+    }
+
+  }
+
+}
+?>
+
+
+<!--categories 3 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES3 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string3 = '';
+
+// tep_show_category3(<top category_id>, <top cpath>, <1=Collapsable tree, 0=static--show all>)
+  tep_show_category3(0,'',0);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string3
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!--categories_eof 3 //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories4.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories4.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories4.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,188 @@
+<?php
+/*
+  $Id: categories4.php,v 1.0
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_category4($counter) {
+    global $foo, $categories_string4, $id, $aa;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      if ($a == $foo[$counter]['level']-1)
+      {
+    $categories_string4 .= "<font color='#ff0000'>|__</font>";
+      } else
+        {
+        $categories_string4 .= "<b><font color='#ff0000'>&nbsp;&nbsp;&nbsp;&nbsp;</font></b>";
+        }
+
+    }
+    if ($foo[$counter]['level'] == 0)
+  {
+    if ($aa == 1)
+    {
+    $categories_string4 .= "<hr>";
+      }
+    else
+    {$aa=1;}
+
+  }
+
+
+    $categories_string4 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string4 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string4 .= '">';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $categories_string4 .= '<b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= "<b><font color='#ff0000'>";
+    }
+
+// display category name
+    $categories_string4 .= $foo[$counter]['name'];
+
+      if ($foo[$counter]['parent'] == 0) {
+       $categories_string4 .= '</b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= '</font></b>';
+    }
+
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string4 .= '<b>-&gt; </b>';
+    }
+
+    $categories_string4 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string4 .= '&nbsp;(' . $products_in_category . ')';
+      }    }
+
+    $categories_string4 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category4($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories 4//-->
+          <tr>
+            <td>
+<?php
+  $aa = 0;
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES4 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string4 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+   tep_show_category4($first_element);
+
+ //coment out the below line if you do not want to havw an all products list
+    $categories_string4 .= "<hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODS) . '"><b>' . BOX_INFORMATION_ALLPRODS . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODCATS) . '"><b>' . ALL_PRODUCTS_LINK . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODMANF) . '"><b>' . ALL_PRODUCTS_MANF . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br>\n";
+
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                'text'  => $categories_string4
+                               );
+   new infoBox($info_box_contents);
+?>
+
+        </td>
+          </tr>
+<!--categories_eof 4//-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories5.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/categories5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: all_categories.php,v 1.6 2002/04/22 20:34:00 clescuyer Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Goélette
+  Christian Lescuyer <cl at goelette.net>
+  http://www.goelette.net/
+  http://oscommerce.goelette.net/
+
+  History: 1.1 Creation
+           1.2 Modified query for compatibility with older databases
+           1.3 Query in 1.2 was wrong for older databases
+           1.4 SHOW_COUNTS test corrected
+           1.5 Added COMPACT_CATEGORIES option to display all sub-categories on one line
+           1.6 Removed COMPACT_CATEGORIES option
+               Corrected the cpath generation
+               Bold categories "path" to selected category, an idea from Peter Fürsicht
+           1.7 Cleaned the way in which the categories are displayed - bold for the path,
+               ">" to indicate the current category, removed link to current category,
+               only indent subcategories (top level are flush left)
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+  Released under the GNU General Public License
+
+*/
+
+// Keep out parts category
+    $excluded_parts_category_id = 28;
+
+
+// Preorder tree traversal
+  function preorder($cid, $level5, $foo5, $cpath) {
+    global $categories_string5, $HTTP_GET_VARS;
+
+    if ($cid != 0) {
+  // 1.7 Get the current path info
+      $category_path = explode('_',$HTTP_GET_VARS['cPath']);
+      $in_path = in_array($cid, $category_path);
+      $this_category = array_pop($category_path);
+
+      for ($i=0; $i<$level5; $i++)
+      // 1.7 only indent subcategories (top level are flush left)
+        if ($i>0) {
+          $categories_string5 .=  '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
+        }
+        // 1.7 indicate the current category
+        if ($this_category == $cid) {
+          $categories_string5 .=  '> ';
+        }
+
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '">';
+        }
+  // 1.6 Are we on the "path" to selected category? If yes, use <b>
+        if ($in_path) {
+          $categories_string5 .=  '<b>';
+        }
+        $categories_string5 .=  $foo5[$cid]['name'];
+        if ($in_path)
+          $categories_string5 .=  '</b>';
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '</a>';
+        }
+    // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+          if (SHOW_COUNTS == 'true') {
+            $products_in_category = tep_count_products_in_category($cid);
+            if ($products_in_category > 0) {
+              $categories_string5 .= '&nbsp;(' . $products_in_category . ')';
+            }
+          }
+        $categories_string5 .= '<br>' ."\n";
+      }
+
+// Traverse category tree
+      foreach ($foo5 as $key => $value) {
+        if ($foo5[$key]['parent'] == $cid) {
+  //        print "$key, $level5, $cid, $cpath<br>";
+          preorder($key, $level5+1, $foo5, ($level5 != 0 ? $cpath . $cid . '_' : ''));
+        }
+      }
+  }
+
+?>
+<!--  categories 5//-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES5);
+  new infoBoxHeading($info_box_contents, false, false);
+
+
+//////////
+// Get categories list
+//////////
+// 1.2 Test for presence of status field for compatibility with older versions
+  $status = tep_db_num_rows(tep_db_query('describe categories status'));
+  $query5 = "select 
+    c.categories_id, 
+    cd.categories_name, 
+    c.categories_image,
+    c.parent_id from 
+    " . TABLE_CATEGORIES . " c,
+    " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+    where 
+    c.parent_id = '0' 
+   and c.categories_id = cd.categories_id 
+   and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+ 
+
+  $categories_query5 = tep_db_query($query5);
+
+// Stuff in an array
+  while ($categories5 = tep_db_fetch_array($categories_query5))  {
+    $foo5[$categories5['categories_id']] = array('name' => $categories5['categories_name'], 'parent' => $categories5['parent_id']);
+  }
+
+// Initiate tree traverse
+  $categories_string5 = '';
+  preorder(0, 0, $foo5, '');
+
+//////////
+// Display box contents
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => $categories_string5);
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- categories5_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/currencies.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($currencies) && is_object($currencies)) {
+?>
+<!-- currencies //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CURRENCIES . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    reset($currencies->currencies);
+    $currencies_array = array();
+    while (list($key, $value) = each($currencies->currencies)) {
+      $currencies_array[] = array('id' => $key, 'text' => $value['title']);
+    }
+
+    $hidden_get_variables = '';
+    reset($HTTP_GET_VARS);
+    while (list($key, $value) = each($HTTP_GET_VARS)) {
+      if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
+        $hidden_get_variables .= tep_draw_hidden_field($key, $value);
+      }
+    }
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
+                                 'align' => 'center',
+                                 'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- currencies_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/customer_gv.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/customer_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/customer_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: customer_gv.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- Tell Customer he has a gift voucher-->
+<?php
+  if ($customer_id) {
+    $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$customer_id."'");
+    if ($gv_result=tep_db_fetch_array($gv_query)) $customer_gv_amount=$gv_result['amount'];
+  }
+if ($customer_gv_amount>0) {
+?>
+          <tr>
+            <td>
+<?php
+  
+
+ $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_GIFT_VOUCHER . '</font>'
+                               );
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<div align="center">'.GIFT_VOUCHER_ACCOUNT_BALANCE_1.$currencies->format($customer_gv_amount).GIFT_VOUCHER_ACCOUNT_BALANCE_2.'<a href="'.tep_href_link(FILENAME_GV_SEND).'">'.GIFT_VOUCHER_ACCOUNT_BALANCE_3.'</a>'
+                              );
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- Tell Customer he has a gift voucher_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/donate.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/donate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/donate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: donate.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- whats_new //-->
+          <tr>
+            <td>
+<?php 
+  
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DONATE  . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+$info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
+              <input type="hidden" name="cmd" value="_xclick">
+              <input type="hidden" name="business" value="donations at creloaded.com">
+              <input type="hidden" name="no_note" value="1">
+              <input type="hidden" name="currency_code" value="USD">
+              <input type="hidden" name="tax" value="0">
+              <input type="image" src="images/x-click_butcc_donate.gif" name="submit"  alt="'.DONATE_BUTTON_IMAGE_ALT.'">
+            </form>');
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/downloads.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/downloads.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/downloads.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,127 @@
+<?php
+/*
+  $Id: downloads.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- downloads //-->
+<?php
+
+
+  // modification of the logic to prevent the queries if there is no customer id
+  if ( $customer_id != '' ) {
+  if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+// Get last order id for checkout_success
+    $orders_query_raw = "SELECT orders_id FROM " . TABLE_ORDERS . " WHERE customers_id = '" . $customer_id . "' ORDER BY orders_id DESC LIMIT 1";
+    $orders_query = tep_db_query($orders_query_raw);
+    $orders_values = tep_db_fetch_array($orders_query);
+    $last_order = $orders_values['orders_id'];
+  } else {
+    $last_order = (int)$HTTP_GET_VARS['order_id'];
+  }
+
+// Now get all downloadable products in that order
+  $downloads_query_raw = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays
+                          FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
+                          WHERE customers_id = '" . $customer_id . "'
+                          AND o.orders_id = '" . $last_order . "'
+                          AND op.orders_id = '" . $last_order . "'
+                          AND opd.orders_products_id=op.orders_products_id
+                          AND opd.orders_products_filename<>''";
+  $downloads_query = tep_db_query($downloads_query_raw);
+
+// Don't display if there is no downloadable product
+  if (tep_db_num_rows($downloads_query) > 0) {
+     require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_DOWNLOADBOX);
+          ECHO '<tr><td>' ;
+          $info_box_contents = array();
+          $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DOWNLOADS . '</font>');
+          new infoBoxHeading($info_box_contents, false, false);
+
+           $info_box_contents = array();
+ ?>
+<!-- list of products -->
+<?php
+    while ($downloads_values = tep_db_fetch_array($downloads_query)) {
+?>
+
+<!-- left box -->
+<?php
+// MySQL 3.22 does not have INTERVAL
+      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads_values['date_purchased_day']);
+      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads_values['download_maxdays'], $dt_year);
+        $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
+
+// The link will appear only if:
+// - Download remaining count is > 0, AND
+// - The file is present in the DOWNLOAD directory, AND EITHER
+// - No expiry date is enforced (maxdays == 0), OR
+// - The expiry date is not reached
+      if (($downloads_values['download_count'] > 0) &&
+          (file_exists(DIR_FS_DOWNLOAD . $downloads_values['orders_products_filename'])) &&
+          (($downloads_values['download_maxdays'] == 0) ||
+           ($download_timestamp > time()))) {
+
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_FILE . '<br><br><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads_values['orders_products_download_id']) . '">' . $downloads_values['products_name'] . '</a>'
+                                          );
+ new infoBox($info_box_contents);
+      } else {
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => $downloads_values['products_name']
+                                          );
+ new infoBox($info_box_contents);
+
+      }
+?>
+<!-- right box -->
+<?php
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_DATE . '<br>' .  tep_date_long($download_expiry)
+                                          );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => $downloads_values['download_count'] . '  ' .  TEXT_HEADING_DOWNLOAD_COUNT
+                                        );
+  new infoBox($info_box_contents);
+ }
+
+if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => TEXT_FOOTER_DOWNLOAD . '<br><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . TEXT_DOWNLOAD_MY_ACCOUNT . '</a>'
+                                        );
+  new infoBox($info_box_contents);
+
+   }
+?>
+     </td>
+   </tr>
+<?php
+  }
+  }
+?>
+<!-- downloads_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/example.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/example.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/example.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1601 $
+
+*/
+?>
+<!-- Example_infobox Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_EXAMPLE . '</font>'
+                 // Change BOX_HEADING_EXAMPLE to your name, which you can find it easily.
+                 //and use the same in Infobox Admin to configure infobox.
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                // add infobox content below.
+                'text'  => 'Your Content here'
+                               );
+
+new infoBox($info_box_contents);
+
+?>
+</td></tr>
+<!-- Example_infobox_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/faq.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: faq.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$faq_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_FAQ_CATEGORIES . " ic, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// faq outside categories
+$faq_query = tep_db_query("select ip.faq_id, ip.question from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '0' and ip.language = '" . (int)$languages_id . "' and ip.visible = '1' order by ip.v_order, ip.question");
+
+if ((tep_db_num_rows($faq_categories_query) > 0) || (tep_db_num_rows($faq_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FAQ . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $faq_string = '';
+  while ($faq_categories = tep_db_fetch_array($faq_categories_query)) {
+    $id_string = 'cID=' . $faq_categories['categories_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($faq = tep_db_fetch_array($faq_query)) {
+    $id_string = 'fID=' . $faq['faq_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq['question'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $faq_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,83 @@
+<?php
+/*
+  $Id: featured.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- featured //-->
+<?php
+
+
+  $random_product_side = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(), featured_date_added DESC limit " . MAX_RANDOM_SELECT_SPECIALS);
+
+$random_product_side_row = tep_db_num_rows($random_product_side);
+   if ($random_product_side_row > 0){
+?>
+          <tr>
+            <td>
+<?php
+while ($featured_random_product21 = tep_db_fetch_array($random_product_side)){
+
+$featured_product21_id = $featured_random_product21['products_id'];
+$featured_product21_image = tep_get_products_image($featured_random_product21['products_id']);
+$featured_product21_name = tep_get_products_name($featured_random_product21['products_id']);
+
+  $pf->loadProduct($featured_random_product21['products_id'],$languages_id);
+        $featured_price1 = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FEATURED . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents,  false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+            'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $featured_product21_image, $featured_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id, 'NONSSL') . '">' . $featured_product21_name . '</a><br>' . $featured_price1 );
+
+
+
+   new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  
+ }
+?>
+<!-- featured_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/googlead.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/googlead.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/googlead.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: googlead.php, v 1.1 2004/05/30 Tom O'Neill (zip1)
+
+  Released under the GNU General Public License
+ based on banner in a box by aubrey at mycon.co.za
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+*/
+?>
+<!-- google-banner-ad-in-a-box //-->
+<?php
+  if (!(getenv('HTTPS')=='on')){
+  if ($banner = tep_banner_exists('dynamic', 'googlebox')) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_GOOGLE_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+  }
+?>
+<!-- google-banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/information_table.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/information_table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/information_table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: information.php,v 1.1.1.1 2003/09/18 19:05:51 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2857 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- information //-->
+          <tr>
+            <td>
+<?php
+
+require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_INFORMATIONBOX);
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_INFORMATION_TABLE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  // Retrieve information from Info table
+   $informationString = "";
+
+ // joles
+   $sql_query = tep_db_query("SELECT information_id, languages_id, info_title FROM " . TABLE_INFORMATION . " WHERE visible= '1' and languages_id ='" . (int)$languages_id . "' ORDER BY v_order");
+   while ($row = tep_db_fetch_array($sql_query)){
+   $informationString .= '<a href="' . tep_href_link(FILENAME_INFORMATION,  'info_id=' . $row['information_id'] ) . '">' . $row['info_title'] . '</a><br>';
+   }
+
+   $info_box_contents = array();
+
+if (tep_session_is_registered('customer_id')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+
+ } else if ((tep_session_is_registered('customer_id')) && (MODULE_ORDER_TOTAL_GV_STATUS == 'true')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+} else {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+}
+
+  new $infobox_template($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/languages.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- languages //-->
+          <tr>
+            <td>
+<?php
+
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LANGUAGES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+    include(DIR_WS_CLASSES . FILENAME_LANGUAGE);
+    $lng = new language;
+  }
+
+  $languages_string = '';
+  reset($lng->catalog_languages);
+  while (list($key, $value) = each($lng->catalog_languages)) {
+    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text' => $languages_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- languages_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/links.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: links.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1980 $
+
+
+  Released under the GNU General Public License
+*/
+
+
+// check for link categoris to determine if there is anything to display
+  $link_categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");
+  $number_of_categories = tep_db_num_rows($link_categories_query);
+
+  if ($number_of_categories > 0) {
+?>
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LINKS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_LINKS));
+
+    $informationString = '';
+    while($row = tep_db_fetch_array($link_categories_query)) {
+      $lPath_new = 'lPath=' . $row['link_categories_id'];
+      $informationString .= '<a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">' . $row['link_categories_name'] . '</a><br>';
+    }
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => $informationString
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,136 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  loginbox.php -   Version 1.0
+  This puts a login request in a box with a login button.
+  If already logged in, will not show anything.
+
+  Modified to utilize SSL to bypass Security Alert
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_LOGINBOX);
+
+// WebMakers.com Added: Do not show if on login or create account
+if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') )  {
+?>
+<!-- loginbox //-->
+<?php
+
+    if (!tep_session_is_registered('customer_id')) {
+?>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<h2>' . BOX_HEADING_LOGIN . '</h2>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $loginboxcontent = "
+       <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "\">
+            <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
+               <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_EMAIL . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"20\" value=\"\" class=\"input_text\">
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_PASSWORD . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"password\" name=\"password\" maxlength=\"40\" size=\"20\" value=\"\" class=\"input_text\">
+                </td>
+              </tr>
+        <tr>
+            <td align=\"center\">
+      " . tep_draw_separator('pixel_trans.gif', '100%', '5') . "
+      </td>
+            </tr>
+              <tr>
+                <td class=\"infoboxContents\" align=\"center\">
+                  " . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "
+                </td>
+              </tr>
+             </table>
+           </form> 
+              ";
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $loginboxcontent
+                                );
+new infoBox($info_box_contents);
+
+?>
+
+<?php
+  } else {
+  // If you want to display anything when the user IS logged in, put it
+  // in here...  Possibly a "You are logged in as :" box or something.
+
+
+  }
+?>
+<!-- loginbox_eof //-->
+<?php
+// WebMakers.com Added: My Account Info Box
+} else {
+  if (tep_session_is_registered('customer_id')) {
+?>
+<!-- my_account_info //-->
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<h2>' . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT . '</h2>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<ul class="my_account_info">'.
+                                          '<li><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a></li>' .
+                                          '<li><a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a></li>' .
+                                          '<li><a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a></li>' .
+                                          '<li><a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a></li>' .
+                                          '<li><a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a></li>' .
+                                          '<li><a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a></li>'.
+                                          '</ul>'
+                              );
+   new infoBox($info_box_contents);
+
+?>
+<!-- my_account_info_eof //-->
+
+<?php
+  }
+}
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/manufacturer_info.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/manufacturer_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/manufacturer_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: manufacturer_info.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- manufacturer_info //-->
+<?php
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id, m.manufacturers_id as manf_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from  " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and m.manufacturers_id = p.manufacturers_id and mi.manufacturers_id = m.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'");
+//    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id from  " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+
+   while ($manufacturer = tep_db_fetch_array($manufacturer_query)) {;
+?>
+<!-- manufacturer_info //-->
+          <tr>
+            <td>
+          
+<?php
+// echo 'prod-id' . (int)$HTTP_GET_VARS['products_id'] . 'manid' . $manufacturer['manufacturers_id'];
+      $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURER_INFO . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+      if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';
+      if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';
+      $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manf_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . ' ' . $manufacturer['manufacturers_name'] . '</a></td></tr>' .
+                                   '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturer_info_string);
+
+      new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- manufacturer_info_eof //-->
+          <?php
+       }
+      }
+?>
+<!-- manufacturer_info_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+  if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
+?>
+<!-- manufacturers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
+// Display a list
+      $manufacturers_list = '';
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
+        $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
+      }
+
+      $manufacturers_list = substr($manufacturers_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturers_list);
+    } else {
+// Display a drop-down
+      $manufacturers_array = array();
+      if (MAX_MANUFACTURERS_LIST < 2) {
+        $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
+                                       'text' => $manufacturers_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- manufacturers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+/*
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+// VJ navmenu begin
+define('TABLE_NAVMENU_CATEGORIES', 'navmenu_categories');
+define('TABLE_NAVMENU_CATEGORIES_DESCRIPTION', 'navmenu_categories_description');
+define('TABLE_NAVMENU_LINKS', 'navmenu_links');
+define('TABLE_NAVMENU_LINKS_DESCRIPTION', 'navmenu_links_description');
+define('TABLE_NAVMENU_LINKS_TO_CATEGORIES', 'navmenu_links_to_categories');
+// VJ navmenu end
+
+function tep_nm_get_navmenu_list($pid = 0, $list_string = '', $style_id = '') {
+  global $languages_id;
+
+  $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name
+                                    from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                         " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd
+                                    where c.nmc_parent_id = '" . (int)$pid . "'
+                                      and cd.nmc_id = c.nmc_id
+                                      and cd.language_id = '" . (int)$languages_id . "'
+                                    order by c.nmc_sort_order, cd.nmc_name");
+
+  $links_query = tep_db_query("select l.nml_id, l.nml_url, ld.nml_name
+                               from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                    " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c,
+                                    " . TABLE_NAVMENU_LINKS . " l,
+                                    " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld
+                               where c.nmc_id = '" . (int)$pid . "'
+                                 and c.nmc_id = l2c.nmc_id
+                                 and l2c.nml_id = l.nml_id
+                                 and ld.nml_id = l.nml_id
+                                 and ld.language_id = '" . (int)$languages_id . "'
+                               order by l.nml_sort_order, ld.nml_name");
+
+  if ((tep_db_num_rows($categories_query) > 0) || (tep_db_num_rows($links_query) > 0)) {
+    if (empty($list_string)) {
+      $list_string .= '<ul id="' . $style_id . '">' . "\n";
+    } else {
+      $list_string .= '<ul>' . "\n";
+    }
+
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $list_string .= '<li><a href="#">' . $categories['nmc_name'] . '</a>';
+
+      $list_string = tep_nm_get_navmenu_list((int)$categories['nmc_id'], $list_string);
+
+      $list_string .= '</li>' . "\n";
+    } 
+
+    while ($links = tep_db_fetch_array($links_query)) {
+      $list_string .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $links['nml_url'], 'NONSSL') . '">' . $links['nml_name'] . '</li>' . "\n";
+    } 
+
+    $list_string .= '</ul>' . "\n";
+  }
+
+  return $list_string;
+}
+?>
+<!-- navmenu //-->
+<script type="text/javascript"><!--
+sfHover = function() {
+   var sfEls = document.getElementById("navMenu").getElementsByTagName("LI");
+   for (var i=0; i<sfEls.length; i++) {
+     sfEls[i].onmouseover=function() {
+       this.className+=" sfhover";
+     }
+     sfEls[i].onmouseout=function() {
+       this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
+     }
+   }
+}
+if (window.attachEvent) window.attachEvent("onload", sfHover);
+//--></script>
+                  <tr>
+                    <td>
+                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
+                      <tr>
+                        <td width="100%">
+<?php
+$info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NAVMENU . '</font>');
+new infoBoxHeading($info_box_contents, false, false);
+
+$menu_string = tep_nm_get_navmenu_list(0, '', 'navMenu');
+
+// VJ debug
+//print_r($menu_string);
+
+$info_box_contents = array(array('text' =>  $menu_string));
+
+new infoBox($info_box_contents);
+?>
+                        </td>
+                      </tr>
+                    </table>
+                    </td>
+                  </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/order_history.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/order_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/order_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: order_history.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1182 $
+
+
+  Released under the GNU General Public License
+*/
+
+  if (tep_session_is_registered('customer_id')) {
+// retreive the last x products purchased
+    $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
+    if (tep_db_num_rows($orders_query)) {
+?>
+<!-- customer_orders //-->
+          <tr>
+            <td>
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CUSTOMER_ORDERS . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $product_ids = '';
+      while ($orders = tep_db_fetch_array($orders_query)) {
+        $product_ids .= (int)$orders['products_id'] . ',';
+      }
+      $product_ids = substr($product_ids, 0, -1);
+
+      $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+      $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+        // changes the cust_order into a buy_now action
+        $customer_orders_string .= '  <tr>' .
+                                   '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
+                                   '    <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
+                                   '  </tr>';
+      }
+      $customer_orders_string .= '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $customer_orders_string);
+
+      new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- customer_orders_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/pages.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: pages.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$pages_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_PAGES_CATEGORIES . " ic, " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// pages outside categories
+$pages_query = tep_db_query("select ip.pages_id, ipd.pages_title
+                             from " . TABLE_PAGES . " ip
+                             left join " . TABLE_PAGES_TO_CATEGORIES . " ip2c on (ip2c.pages_id = ip.pages_id and ip2c.categories_id = '0'),
+                                  " . TABLE_PAGES_DESCRIPTION . " ipd
+                             where ip.pages_status = '1'
+                               and ipd.pages_id = ip.pages_id
+                               and ipd.language_id = '" . (int)$languages_id . "'
+                             order by ip.pages_sort_order, ipd.pages_title");
+
+if ((tep_db_num_rows($pages_categories_query) > 0) || (tep_db_num_rows($pages_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_PAGES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $pages_string = '';
+  while ($pages_categories = tep_db_fetch_array($pages_categories_query)) {
+    $id_string = 'cID=' . $pages_categories['categories_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($pages = tep_db_fetch_array($pages_query)) {
+    $id_string = 'pID=' . $pages['pages_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages['pages_title'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $pages_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/product_notifications.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/product_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/product_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: product_notifications.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2746 $
+
+
+  Released under the GNU General Public License
+*/
+if (isset($HTTP_POST_VARS['products_id']) && tep_not_null($HTTP_POST_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+  } elseif (isset($HTTP_GET_VARS['products_id']) && tep_not_null($HTTP_GET_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_GET_VARS['products_id']);
+  } 
+  if ( (isset($HTTP_GET_VARS['products_id'])) || (isset($HTTP_POST_VARS['products_id'])) ) {
+?>
+<!-- notifications //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NOTIFICATIONS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
+
+    if (tep_session_is_registered('customer_id')) {
+      $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      $notification_exists = (($check['count'] > 0) ? true : false);
+    } else {
+      $notification_exists = false;
+    }
+
+    $info_box_contents = array();
+    if ($notification_exists == true) {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    } else {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- notifications_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/reviews.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1738 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- reviews //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_REVIEWS . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_REVIEWS));
+
+  $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'";
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $random_select .= " and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'";
+  }
+  $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
+  $random_product = tep_random_select($random_select);
+
+  $info_box_contents = array();
+
+  if ($random_product) {
+// display random review box
+    $review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'");
+    $review = tep_db_fetch_array($review_query);
+
+    $review = tep_break_string(tep_output_string_protected($review['reviews_text']), 15, '-<br>');
+
+    $info_box_contents[] = array('text' => '<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div>');
+  } elseif (isset($HTTP_GET_VARS['products_id'])) {
+// display 'write a review' box
+    $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . BOX_REVIEWS_WRITE_REVIEW .'</a></td></tr></table>');
+  } else {
+// display 'no reviews' box
+    $info_box_contents[] = array('text' => BOX_REVIEWS_NO_REVIEWS);
+  }
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- reviews_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/search.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: search.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" ') . '&nbsp;' . tep_hide_session_id() . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');
+
+  new infoBox($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/search1.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/search1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/search1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: search1.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH1 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find1" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px">&nbsp;' . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br>'
+                              );
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- shop by price //-->
+<?php
+if (MODULE_SHOPBYPRICE_RANGES > 0) {
+?>
+          <tr>
+            <td>
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOP_BY_PRICE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $sbp_array = unserialize(MODULE_SHOPBYPRICE_RANGE);
+
+  $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=0', 'NONSSL') . '">' . TEXT_INFO_UNDER . $currencies->format($sbp_array[0]) . '</a><br>');
+  for ($i=1, $ii=count($sbp_array); $i < $ii; $i++) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . TEXT_INFO_FROM . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_TO . $currencies->format($sbp_array[$i]) . '</a><br>');
+  }
+  if (MODULE_SHOPBYPRICE_OVER == True) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_ABOVE . '</a><br>');
+  }
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- shop_by_price //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1609 $
+
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- shopping_cart //-->
+<script type="text/javascript"><!--
+function couponpopupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<h2><a href="' . tep_href_link(FILENAME_SHOPPING_CART,'','SSL') . '">' . BOX_HEADING_SHOPPING_CART . '</a></h2>');
+  new infoBoxHeading($info_box_contents, false, false, false);
+
+  $cart_contents_string = '';
+  if ($cart->count_contents() > 0) {
+    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+  $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
+    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
+  if ((int)$products_parent_id['products_parent_id'] != 0) {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id'],'SSL') . '">';
+  } else {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'],'SSL') . '">';
+  }
+
+//      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+      $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        tep_session_unregister('new_products_id_in_cart');
+      }
+    }
+    $cart_contents_string .= '</table>';
+  } else {
+    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $cart_contents_string);
+
+  if ($cart->count_contents() > 0) {
+    // WebMakers.com Added: Shoppe Enhancement Controller
+    // check for free order
+    $final_total=$cart->show_total();
+    if ($final_total==0) {
+      $final_total='Free';
+    } else {
+      $final_total=$currencies->format($cart->show_total());
+    }
+    $info_box_contents[] = array('text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'right',
+                                 'text' => '<b>'.$final_total.'</b>');
+  }
+// ICW ADDED FOR CREDIT CLASS GV
+  if (tep_session_is_registered('customer_id')) {
+    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $gv_result = tep_db_fetch_array($gv_query);
+    if ($gv_result['amount'] > 0 ) {
+      $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');
+    }
+  }
+  if (tep_session_is_registered('gv_id')) {
+    $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
+    $coupon = tep_db_fetch_array($gv_query);
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');
+
+  }
+  if (tep_session_is_registered('cc_id') && $cc_id) {
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');
+
+  }
+
+// ADDED FOR CREDIT CLASS GV END ADDITTION
+  new infoBox($info_box_contents);
+?>
+
+<!-- shopping_cart_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+
+   $random_product25 = tep_db_query("select distinct
+   p.products_id, 
+   pd.products_name, 
+   p.products_tax_class_id, 
+   p.products_image, 
+   s.specials_new_products_price 
+   from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+    " . TABLE_SPECIALS . " s 
+   where 
+   p.products_status = '1' 
+   and p.products_id = s.products_id 
+   and pd.products_id = s.products_id 
+   and pd.language_id = '" . (int)$languages_id . "' 
+   and s.status = '1' 
+   order by rand(), s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
+ 
+  
+  $random_product24_side_row = tep_db_num_rows($random_product25);
+     if ($random_product24_side_row > 0){
+
+?>
+<!-- d specials //-->
+          <tr>
+            <td>
+<?php
+
+while ($product_specials22 = tep_db_fetch_array($random_product25)){
+  $product_specials22_id = $product_specials22['products_id'];
+  $product_specials22_image = tep_get_products_image($product_specials22['products_id']);
+  $product_specials22_name = tep_get_products_name($product_specials22['products_id']);
+
+  $pf->loadProduct($product_specials22['products_id'],$languages_id);
+        $special_random_price = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SPECIALS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price);
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- specials_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['products_id']) {
+?>
+<!-- tell_a_friend //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TELL_A_FRIEND . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('tell_a_friend', tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('to_email_address', '', 'size="10"') . '&nbsp;' . tep_template_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id() . '<br>' . BOX_TELL_A_FRIEND_TEXT);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- tell_a_friend_eof //-->
+
+<?php } ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/theme_select.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/theme_select.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/theme_select.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: theme_select.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+    if (tep_session_is_registered('customer_id')) {
+
+  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
+
+?>
+<!-- theme //-->
+         <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TEMPLATE_SELECT . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $template_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " where active = '1' order by template_name");
+
+ 
+// Display a drop-down
+    $select_box = '<select name="template" onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%">';
+    if (MAX_THEME_LIST < 2) {
+      $select_box .= '<option value="">' . PULL_DOWN_DEFAULT . '</option>';
+    }
+    while ($template_values = tep_db_fetch_array($template_query)) {
+      $select_box .= '<option value="' . $template_values['template_name'] . '"';
+      if ($HTTP_GET_VARS['template_id'] == $template_values['template_id']) $select_box .= ' SELECTED';
+      $select_box .= '>' . substr($template_values['template_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
+    }
+    $select_box .= "</select>";
+    $select_box .= tep_hide_session_id();
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form'  => '<form name="template" method="post" action="' . tep_href_link(FILENAME_DEFAULT, '&action=update_template', 'NONSSL') . '">',
+                                 'align' => 'left',
+                                 'text'  => $select_box);
+
+   new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}}
+?>
+<!-- template_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/whats_new.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/whats_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/whats_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+  $random_product27 = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+      order by rand(), products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
+ 
+$random_product27_side_row = tep_db_num_rows($random_product27);
+   if ($random_product27_side_row > 0){
+
+  ?>
+<!-- whats_new //-->
+ <tr>
+            <td>
+<?php      
+    
+while ($whatsnew_product21 = tep_db_fetch_array($random_product27)){
+  $whatsnew_product21_id = $whatsnew_product21['products_id'];
+  $whatsnew_product21_image = tep_get_products_image($whatsnew_product21['products_id']);
+  $whatsnew_product21_name = tep_get_products_name($whatsnew_product21['products_id']);
+
+  $pf->loadProduct($whatsnew_product21['products_id'],$languages_id);
+         $whats_new_price = $pf->getPriceStringShort();
+}
+// EOF Separate Pricing Per Customer
+//Eversun mod end for sppc and qty price breaks
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHATS_NEW . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',           
+         'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $whatsnew_product21_image, $whatsnew_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . $whatsnew_product21_name . '</a><br>' . $whats_new_price .'<br />');
+//Eversun mod for sppc and qty price breaks
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,94 @@
+<?php
+/*
+  $Id: whos_online.php, v 1.0 2001/12/05 by mattice at xs4all.nl
+
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official TEP distribution
+  but an add-on contributed to the TEP community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+*/
+
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_WHOS_ONLINEBOX);
+?>
+
+
+<!-- whos_online //-->
+          <tr>
+            <td>
+<?php
+
+// Set expiration time, default is 900 secs (15 mins)
+  $xx_mins_ago = (time() - 900);
+
+  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
+
+  $whos_online_query = tep_db_query("select customer_id from " . TABLE_WHOS_ONLINE);
+  while ($whos_online = tep_db_fetch_array($whos_online_query)) {
+                        if (!$whos_online['customer_id'] == 0) $n_members++;
+                        if ($whos_online['customer_id'] == 0) $n_guests++;
+
+  $user_total = sprintf(tep_db_num_rows($whos_online_query));                                                                }
+
+  if ($user_total == 1) {
+    $there_is_are = BOX_WHOS_ONLINE_THEREIS . '&nbsp;';
+  } else {
+    $there_is_are = BOX_WHOS_ONLINE_THEREARE . '&nbsp;';
+  }
+
+  if ($n_guests == 1) {
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUEST;
+  }else{
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUESTS;
+  }
+
+  if ($n_members == 1) {
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBER;
+  }else{
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBERS;
+  }
+
+
+  if (($n_guests >= 1) && ($n_members >= 1)) $word_and = '&nbsp;' . BOX_WHOS_ONLINE_AND . '&nbsp;<br>';
+
+      $textstring = $there_is_are;
+        if ($n_guests >= 1) $textstring .= $n_guests . $word_guest;
+
+      $textstring .= $word_and;
+        if ($n_members >= 1) $textstring .= $n_members . $word_member;
+
+      $textstring .= '&nbsp;online.';
+
+
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHOS_ONLINE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>  $textstring
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whos_online_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+  $Id: wishlist.php,v 2.2 2004/09/12 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2546 $
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- wishlist //-->
+<?php
+if (basename($PHP_SELF) != FILENAME_WISHLIST_SEND){
+if (basename($PHP_SELF) != FILENAME_WISHLIST)   {
+?> 
+          <tr>
+            <td>
+<?php
+  // retreive the wishlist
+  if (tep_session_is_registered('customer_id')) {
+    $wishlist_query_raw = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 order by products_name";  
+    $wishlist_query = tep_db_query($wishlist_query_raw);
+
+    // if we have something in this clients list:
+    ?>
+    <!-- customer_wishlist //-->
+    <script type="text/javascript"><!--
+    function popupWindowWishlist(url) {
+      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=425,height=475,screenX=150,screenY=150,top=150,left=150')
+    }
+    //--></script>
+    <?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WISHLIST . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_WISHLIST, '','NONSSL'));
+    
+    $info_box_contents = array();
+    
+    if (tep_db_num_rows($wishlist_query)) {
+      if (tep_db_num_rows($wishlist_query) < MAX_DISPLAY_WISHLIST_BOX) {
+
+        $product_ids = '';
+        while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+          $product_ids .= $wishlist['products_id'] . ',';
+         }
+        $product_ids = substr($product_ids, 0, -1);        
+       
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        //  $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . $product_ids . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $customer_wishlist_string .= '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a></td>' . "\n" .
+                                                  '</tr>' . "\n" .
+                                                  '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents" align="center" valign="bottom"><b><a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_MOVE_TO_CART . '</a>&nbsp;|' . "\n" .
+                                                  '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b>' . "\n" .  tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td>' .
+                                                  '</td></tr>' . "\n";
+        }
+      } else {
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . sprintf(TEXT_WISHLIST_COUNT, tep_db_num_rows($wishlist_query)) . '</td></tr>' . "\n";
+      }
+    } else {
+      $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+      $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . BOX_WISHLIST_EMPTY . '</td></tr>' . "\n";
+    }
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a></td></tr>' . "\n";
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST_HELP . '</u> [?]</a></td></tr>' . "\n"; // Normal link
+    $customer_wishlist_string .= '</table>';
+
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => $customer_wishlist_string);
+
+    new infoBox($info_box_contents);
+  }
+?>
+            </td>
+          </tr>
+          <?php
+    }}
+?><!-- wishlist_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/boxes.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/boxes.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/boxes.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,234 @@
+<?php
+/*
+  $Id: boxes.tpl.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBox {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBox($contents, $direct_output = false) {
+      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
+      $tableBox_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
+        $tableBox_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
+        $tableBox_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
+              $tableBox_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
+              $tableBox_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox_string .= '    <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
+        }
+
+        $tableBox_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
+      }
+
+      $tableBox_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox_string;
+
+      return $tableBox_string;
+    }
+  }
+
+class categoriesBox extends tableBox {
+function categoriesBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->categoriesBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $this->tableBox($info_box_contents, true);
+    }
+
+function categoriesBoxContents($contents) {
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $info_box_contents = array();
+      for ($i=0; $i<sizeof($contents); $i++) {
+        $info_box_contents[] = array(array('align' => 'center', 'params' => 'class="noclass"', 'text' => $contents[$i]['text']));
+      }
+      return $this->tableBox($info_box_contents);
+    }
+}
+
+  class infoBox extends tableBox {
+    function infoBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function infoBoxContents($contents) {
+      $this->table_cellpadding = '3';
+      $this->table_parameters = 'class="infoBoxContents"';
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
+                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
+                                           'params' => 'class="boxText"',
+                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
+      }
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      return $this->tableBox($info_box_contents);
+    }
+  }
+
+  class infoBoxHeading extends tableBox {
+    function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+
+
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+        $right_corner = $right_arrow;
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => 'width="100%" height="14" class="infoBoxHeading"',
+                                         'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading" nowrap',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class infoboxFooter extends tableBox {
+    function infoboxFooter($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      } else {
+        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => ' class="infoBoxHeading"', 'text' => $left_corner),
+                                   array('params' => ' width="100%" ', 'text' => $contents[0]['text']),
+            array('params' => ' class="infoBoxHeading" nowrap', 'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class contentBox extends tableBox {
+    function contentBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function contentBoxContents($contents) {
+      $this->table_cellpadding = '4';
+      $this->table_parameters = 'class="infoBoxContents"';
+      return $this->tableBox($contents);
+    }
+  }
+
+  class contentBoxHeading extends tableBox {
+    function contentBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_width = '100%';
+      $this->table_cellpadding = '0';
+      
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/no_arrow_right.gif');
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_right.gif');
+      } else {
+         $right_corner = $right_arrow ;
+
+      }
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => ' align="center" background="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif" width="100%"  class="infoBoxHeading"',
+                 'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class errorBox extends tableBox {
+    function errorBox($contents) {
+      $this->table_data_parameters = 'class="errorBox"';
+      $this->tableBox($contents, true);
+    }
+  }
+
+  class productListingBox extends tableBox {
+    function productListingBox($contents) {
+      $this->table_parameters = 'class="productListing"';
+      $this->tableBox($contents, true);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/checkout_confirmation.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/checkout_confirmation.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/checkout_confirmation.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,328 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_confirmation.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+     <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+ 
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+<?php
+  if ($sendto != false) {
+?>
+            <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo '<b>' . HEADING_DELIVERY_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>
+              </tr>
+<?php
+    if ($order->info['shipping_method']) {
+?>
+              <tr>
+                <td class="main"><?php echo '<b>' . HEADING_SHIPPING_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo $order->info['shipping_method']; ?></td>
+              </tr>
+<?php
+    }
+?>
+            </table></td>
+<?php
+  }
+?>
+            <td width="<?php echo (($sendto != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (sizeof($order->info['tax_groups']) > 1) {
+?>
+                  <tr>
+                    <td class="main " colspan="2"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+                    <td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td>
+                    <td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
+                  </tr>
+<?php
+  } else {
+?>
+                  <tr>
+                    <td class="main bulleted" colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+                  </tr>
+<?php
+  }
+
+  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+    echo '          <tr>' . "\n" .
+         '            <td class="main idented" align="right" valign="top" width="1">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
+         '            <td class="main" valign="top">' . $order->products[$i]['name'];
+
+    if (STOCK_CHECK == 'true') {
+      echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);
+    }
+
+    if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
+      for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+        echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . ' ' . $order->products[$i]['attributes'][$j]['prefix'] . ' ' . $currencies->display_price($order->products[$i]['attributes'][$j]['price'], tep_get_tax_rate($products[$i]['tax_class_id']), 1)  . '</i></small></nobr>';
+      }
+    }
+
+    echo '</td>' . "\n";
+
+    if (sizeof($order->info['tax_groups']) > 1) echo '            <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
+
+    echo '            <td class="main" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '</td>' . "\n" .
+         '          </tr>' . "\n";
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main bordered"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main bulleted"><?php echo '<b>' . HEADING_BILLING_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+              </tr>
+              <tr>
+                <td class="main idented"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td>
+              </tr>
+              <tr>
+                <td class="main bulleted" style="border-top: 15px solid white"><?php echo '<b>' . HEADING_PAYMENT_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+              </tr>
+              <tr>
+                <td class="main idented"><?php echo $order->info['payment_method']; ?></td>
+              </tr>
+            </table></td>
+            <td width="70%" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (MODULE_ORDER_TOTAL_INSTALLED) {
+    $order_total_modules->process();
+    echo $order_total_modules->output();
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+// BOF: Lango modified for print order mod
+  if (is_array($payment_modules->modules)) {
+    if ($confirmation = $payment_modules->confirmation()) {
+      $payment_info = $confirmation['title'];
+      if (!tep_session_is_registered('payment_info')) tep_session_register('payment_info');
+// EOF: Lango modified for print order mod
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main bordered"><b><?php echo HEADING_PAYMENT_INFORMATION; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main" colspan="4" style="padding-left: 16px"><?php echo $confirmation['title']; ?></td>
+              </tr>
+<?php
+      for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
+?>
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo $confirmation['fields'][$i]['title']; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo $confirmation['fields'][$i]['field']; ?></td>
+              </tr>
+<?php
+      }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+    }
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if (tep_not_null($order->info['comments'])) {
+?>
+      <tr>
+        <td class="main"><?php echo '<b>' . HEADING_ORDER_COMMENTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo nl2br(tep_output_string_protected($order->info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td>
+<?php
+  if (isset($$payment->form_action_url)) {
+    $form_action_url = $$payment->form_action_url;
+  } else {
+    $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
+  }
+
+if (ACCOUNT_CONDITIONS_REQUIRED == 'false' ){
+  echo tep_draw_form('checkout_confirmation', $form_action_url, 'post','');
+}else{
+  echo tep_draw_form('checkout_confirmation', $form_action_url, 'post','onsubmit="return checkCheckBox(this)"');
+}
+
+ if (is_array($payment_modules->modules)) {
+    echo $payment_modules->process_button();
+  }
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (ACCOUNT_CONDITIONS_REQUIRED == 'true') {
+?>
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" colspan="2"><?php echo CONDITION_AGREEMENT; ?> <input type="checkbox" value="0" name="agree"></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+}
+?>
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td class="main" align="right"><?php  echo tep_template_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . "\n";?>        
+        </td>       
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+        
+          <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+          
+                <td class="main">
+    <?php echo HEADING_IPRECORDED_1;
+    $ip_iprecorded = YOUR_IP_IPRECORDED;
+    $isp_iprecorded = YOUR_ISP_IPRECORDED;
+    $ip = $HTTP_SERVER_VARS["REMOTE_ADDR"];
+    $client = gethostbyaddr($HTTP_SERVER_VARS["REMOTE_ADDR"]);
+    $str = preg_split("/\./", $client);
+    $i = count($str);
+    $x = $i - 1;
+    $n = $i - 2;
+    $isp = $str[$n] . "." . $str[$x]; ?>
+    <?php echo "<div align=\"justify\"><font size=\".1\">$ip_iprecorded: $ip<br>$isp_iprecorded: $isp"; ?></div>
+    </td>
+    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+
+              </tr>
+        
+            </table></form>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td><?php echo tep_image(DIR_WS_TEMPLATE_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
+            <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_PAYMENT . '</a>'; ?></td>
+            <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/OpenMoko/checkout_payment.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/checkout_payment.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/checkout_payment.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,318 @@
+    <?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_payment.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+ 
+<?php
+  if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
+//echo 'x_Invoice_Num ' . $x_Invoice_Num;
+    $sql_data_array = array('orders_id' =>  $order_id1,
+                           'orders_status_id' => '0',
+                           'date_added' => 'now()',
+                           'customer_notified' => '0',
+                           'comments' => $HTTP_GET_VARS['error_message']);
+   tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
+  
+
+}
+  if (isset($_GET['payment_error'])) {
+  	$error = isset($_GET['error']) ? $_GET['error'] : 'Unknown validation error';
+?>
+      <tr>
+        <td class="headerError"><?php echo tep_output_string_protected($error) ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_BILLING_ADDRESS);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// BOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+                <td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_BILLING_DESTINATION; ?><br><br><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . tep_template_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td>
+                <td align="right" width="50%" valign="top">
+                
+                <div class="primary_address">
+                	<span class="title visible"><?php echo TITLE_BILLING_ADDRESS; ?></span>
+	                <span class="data"><?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?></span>
+            	</div>
+            	
+				</td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_PAYMENT_METHOD);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// BOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $selection = $payment_modules->selection();
+
+  if (sizeof($selection) > 1) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main checkout_shipping_method_header" width="70%" valign="top"><b><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></b></td>
+                <td class="main checkout_shipping_method_header" width="30%" valign="top" align="right"><b><?php echo TITLE_PLEASE_SELECT; ?></b></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+  } else {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+  }
+
+  $radio_buttons = 0;
+  for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="checkoutTable">
+<?php
+    if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {
+      echo '                  <tr id="defaultSelected" class="moduleRowSelected" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+    } else {
+      echo '                  <tr class="moduleRow" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+    }
+?>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td>
+                    <td class="main" align="right">
+<?php
+    if (sizeof($selection) > 1) {
+      echo tep_draw_radio_field('payment', $selection[$i]['id']);
+    } else {
+      echo tep_draw_hidden_field('payment', $selection[$i]['id']);
+    }
+?>
+                    </td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+    if (isset($selection[$i]['error'])) {
+?>
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="4"><?php echo $selection[$i]['error']; ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+    } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
+?>
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td colspan="4"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+      for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
+?>
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main ccards1"><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
+                        <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main ccards2"><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+<?php
+      }
+?>
+
+                    </table></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+    $radio_buttons++;
+  }
+?>
+<tr>
+					<td></td>
+					<td class="checkout_shipping_method_footer">&nbsp;</td>
+					<td class="checkout_shipping_method_footer">&nbsp;</td>
+					<td class=""></td>
+				</tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+	$something = str_replace('onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)"',"",$order_total_modules->credit_selection());
+
+
+  echo "<div class='supp'>".$something."</div>";
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_COMMENTS);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// BOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="checkout_textarea"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td class="main" align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td><?php echo tep_image(DIR_WS_TEMPLATE_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
+            <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/OpenMoko/checkout_shipping.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/checkout_shipping.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/checkout_shipping.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,302 @@
+    <?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_delivery.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_SHIPPING_ADDRESS);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+                <td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_DESTINATION . '<br><br><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . tep_template_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td>
+                <td align="right" width="50%" valign="top">
+	                <div class="primary_address">
+	                	<span class="title visible"><?php echo TITLE_SHIPPING_ADDRESS; ?></span>
+		                <span class="data"><?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br>'); ?></span>
+	            	</div>  
+				</td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if (tep_count_shipping_modules() > 0) {
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_SHIPPING_METHOD);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td>
+            
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+    if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) {
+?>
+              <tr>
+                <td class=""><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="checkout_shipping_method_header" width="70%" valign="top"><b><?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?></b></td>
+                <td class="checkout_shipping_method_header" width="30%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>'; ?></td>
+                <td class=""><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+    } elseif ($free_shipping == false) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+    }
+
+    if ($free_shipping == true) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td colspan="2" width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b>&nbsp;<?php echo $quotes[$i]['icon']; ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                  <tr id="defaultSelected" class="moduleRowSelected" onclick="selectRowEffect(this, 0)">
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+              </tr>
+<?php
+    } else {
+      $radio_buttons = 0;
+      for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td colspan="2">
+                <table border="0" width="100%" cellspacing="0" cellpadding="2" class="checkout_shipping_option">
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main bulleted" colspan="3"><b><?php echo $quotes[$i]['module']; ?></b>&nbsp;<?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+        if (isset($quotes[$i]['error'])) {
+?>
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main idented" colspan="3"><?php echo $quotes[$i]['error']; ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+        } else {
+          for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
+// set the radio button to be checked if it is the method chosen
+            $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);
+
+            if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
+              echo '                  <tr id="defaultSelected" class="moduleRowSelected" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+            } else {
+              echo '                  <tr class="moduleRow" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+            }
+?>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main idented" width="75%"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td>
+<?php
+            if ( ($n > 1) || ($n2 > 1) ) {
+?>
+                    <td class="main"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>
+                    <td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>
+<?php
+            } else {
+?>
+                    <td class="main" align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>
+<?php
+            }
+?>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+            $radio_buttons++;
+          }
+        }
+?>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+              </tr>
+<?php
+      }
+    }
+?>				<tr>
+					<td></td>
+					<td class="checkout_shipping_method_footer">&nbsp;</td>
+					<td class="checkout_shipping_method_footer">&nbsp;</td>
+					<td class=""></td>
+				</tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_COMMENTS);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="checkout_textarea"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td class="main" align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_image(DIR_WS_TEMPLATE_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/checkout_shipping_address.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/checkout_shipping_address.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/checkout_shipping_address.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,236 @@
+    <?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'), 'post', 'onSubmit="return check_form_optional(checkout_address);"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_delivery.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if ($messageStack->size('checkout_address') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('checkout_address'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+
+  if ($process == false) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main my_account_title"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_SHIPPING_DESTINATION; ?></td>
+                <td align="right" width="50%" valign="top">
+                
+                <div class="primary_address">
+                	<span class="title visible"><?php echo TITLE_SHIPPING_ADDRESS; ?></span>
+	                <span class="data"><?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br>'); ?></span>
+            	</div>
+                </td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+    if ($addresses_count > 1) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main my_account_title"><b><?php echo TABLE_HEADING_ADDRESS_BOOK_ENTRIES; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main checkout_shipping_method_header" width="80%" valign="top"><b><?php echo TEXT_SELECT_OTHER_SHIPPING_DESTINATION; ?></b></td>
+                <td class="main checkout_shipping_method_header" width="20%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>'; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+      $radio_buttons = 0;
+
+      $addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'");
+      while ($addresses = tep_db_fetch_array($addresses_query)) {
+        $format_id = tep_get_address_format_id($addresses['country_id']);
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+       if ($addresses['address_book_id'] == $sendto) {
+          echo '                  <tr id="defaultSelected" class="moduleRowSelected " onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+        } else {
+          echo '                  <tr class=""  onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+        }
+?>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main checkout_option bulleted" colspan="2" ><b><?php echo tep_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?></b></td>
+                    <td class="main checkout_option" align="right"><?php echo tep_draw_radio_field('address', $addresses['address_book_id'], ($addresses['address_book_id'] == $sendto)); ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td colspan="3"><table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td class="main idented"><?php echo tep_address_format($format_id, $addresses, true, ' ', ', '); ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+        $radio_buttons++;
+      }
+?>
+<tr>
+					<td></td>
+					<td class="checkout_shipping_method_footer_alt">&nbsp;</td>
+					<td class="checkout_shipping_method_footer_alt">&nbsp;</td>
+					<td class=""></td>
+				</tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    }
+  }
+
+  if ($addresses_count < MAX_ADDRESS_BOOK_ENTRIES) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main my_account_title"><b><?php echo TABLE_HEADING_NEW_SHIPPING_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="100%" valign="top"><?php echo TEXT_CREATE_NEW_SHIPPING_ADDRESS; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td><?php require(DIR_WS_MODULES . 'checkout_new_address.php'); ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td class="main" align="right"><?php echo tep_draw_hidden_field('action', 'submit') . tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($process == true) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_image(DIR_WS_TEMPLATE_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/checkout_success.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/checkout_success.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/checkout_success.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,79 @@
+<?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL')); ?>
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+  <?php
+  // BOF: Lango Added for template MOD
+  if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+    $header_text = '&nbsp;'
+    //EOF: Lango Added for template MOD
+    ?>
+    <tr>
+      <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+       </tr>
+      </table></td>
+    </tr>
+    <?php
+    // BOF: Lango Added for template MOD
+  }else{
+    $header_text = HEADING_TITLE;
+  }
+  // EOF: Lango Added for template MOD
+  ?>
+
+  <?php require('add_checkout_success.php'); //ICW CREDIT CLASS/GV SYSTEM ?>
+
+  <!-- checkout_success_modules - start -->
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <?php
+      if (MODULE_CHECKOUT_SUCCESS_INSTALLED) {
+        $checkout_success_modules->process();
+        echo $checkout_success_modules->output();
+      }
+      ?>
+    </table></td>
+  </tr>
+  <!-- checkout_success_modules - end -->
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr> 
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td align="left" class="main"><?php echo '<a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_ORDERS_PRINTABLE) . '?' . (tep_get_all_get_params(array('order_id')) . 'order_id=' . $HTTP_GET_VARS['order_id']) . '\')">' . tep_template_image_button('button_printorder.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?></td>
+        <td align="right" class="main"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+            <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+          </tr>
+        </table></td>
+        <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+        <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+        <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="50%"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
+        <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+        <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+        <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?>
+</table></form>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/column_right.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/column_right.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/column_right.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: column_right.php,v 1.1.1.1 2004/03/04 23:40:37 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  $column_query = tep_db_query('select infobox_id, display_in_column as cfgcol, infobox_file_name as cfgtitle, infobox_display as cfgvalue, infobox_define as cfgkey, box_template, box_heading_font_color from ' . TABLE_INFOBOX_CONFIGURATION . ' where template_id = ' . TEMPLATE_ID . ' and infobox_display = "yes" and display_in_column = "right" order by location');
+  while ($column = tep_db_fetch_array($column_query)) {
+
+if ( file_exists(DIR_FS_TEMPLATE_BOXES . '/boxes/' . $column['cfgtitle'])) {
+$box_heading = tep_get_box_heading($column['infobox_id'], $languages_id);
+
+define($column['cfgkey'], $box_heading);
+//$infobox_define = $box_heading;
+$infobox_template = $column['box_template'];
+$font_color = $column['box_heading_font_color'];
+$infobox_class = $column['box_template'];
+//cache control side box detect
+if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories1.php') ) {
+     echo tep_cache_categories_box();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories.php') ) {
+     echo tep_cache_categories_box();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories2.php') ) {
+     echo tep_cache_categories_box1();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories3.php') ) {
+     echo tep_cache_categories_box3();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories4.php') ) {
+     echo tep_cache_categories_box4();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories5.php') ) {
+     echo tep_cache_categories_box5();
+  } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'coolmenu.php') ) {
+     echo tep_cache_coolmenu();
+ } else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'manufacturers.php') ) {
+     echo tep_cache_manufacturers_box();
+ } else {
+require(DIR_FS_TEMPLATE_BOXES . '/' . $column['cfgtitle']);
+      }
+   // end cache control code   
+ }else{
+
+ 	echo '<div class="sidebox"><div class="inner"><div class="inner_2">';
+$box_heading = tep_get_box_heading($column['infobox_id'], $languages_id);
+//echo 'side ' . $column['infobox_id'] . $box_heading . $languages_id;
+define($column['cfgkey'],$box_heading);
+//$infobox_define = $box_heading;
+$infobox_template = $column['box_template'];
+$font_color = $column['box_heading_font_color'];
+$infobox_class = $column['box_template'];
+require(DIR_FS_TEMPLATE_BOXES . '/' . $column['cfgtitle']);
+	echo '</div></div></div>';
+
+}
+}
+?>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/create_account.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/create_account.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/create_account.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,320 @@
+    <?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return check_form(create_account);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="smallText somenote"><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if ($messageStack->size('create_account') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('create_account'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main my_account_title underlined"><b><?php echo CATEGORY_PERSONAL; ?></b>&nbsp;&nbsp;<small></small></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2" class="form_table">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+?>
+              <tr>
+                <td class="main simple_first_row"><?php echo ENTRY_GENDER; ?></td>
+                <td class="main"><?php echo tep_draw_radio_field('gender', 'm') . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f') . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('firstname') . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('lastname') . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  if (ACCOUNT_DOB == 'true') {
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('dob') . '&nbsp;' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('email_address') . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main my_account_title underlined"><b><?php echo CATEGORY_COMPANY; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2" class="form_table">
+              <tr>
+                <td class="main simple_first_row"><?php echo ENTRY_COMPANY; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('company') . '&nbsp;' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main my_account_title underlined"><b><?php echo CATEGORY_ADDRESS; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2" class="form_table">
+              <tr>
+                <td class="main simple_first_row"><?php echo ENTRY_STREET_ADDRESS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('street_address') . '&nbsp;' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_SUBURB; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('suburb') . '&nbsp;' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('postcode') . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_CITY; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('city') . '&nbsp;' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_STATE; ?></td>
+                <td class="main">
+<?php
+    if ($process == true) {
+      if ($entry_state_has_zones == true) {
+        $zones_array = array();
+        $zones_array[] = array('id' => '', 'text' => '');
+        $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
+        while ($zones_values = tep_db_fetch_array($zones_query)) {
+          $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+        }
+        echo tep_draw_pull_down_menu('state', $zones_array);
+      } else {
+        echo tep_draw_input_field('state');
+      }
+    } else {
+      echo tep_draw_input_field('state');
+    }
+
+    if (tep_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="inputRequirement">' . ENTRY_STATE_TEXT;
+?>
+                </td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td class="main simple_first_row"><?php echo ENTRY_COUNTRY; ?></td>
+                <td class="main"><?php echo tep_get_country_list('country') . '&nbsp;' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main my_account_title underlined"><b><?php echo CATEGORY_CONTACT; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2" class="form_table">
+              <tr>
+                <td class="main simple_first_row"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('telephone') . '&nbsp;' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('fax') . '&nbsp;' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main my_account_title underlined"><b><?php echo CATEGORY_OPTIONS; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main simple_first_row"><?php echo ENTRY_NEWSLETTER; ?></td>
+                <td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1', true) . '&nbsp;' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main my_account_title underlined"><b><?php echo CATEGORY_PASSWORD; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2"  class="form_table">
+              <tr>
+                <td class="main simple_first_row"><?php echo ENTRY_PASSWORD; ?></td>
+                <td class="main"><?php echo tep_draw_password_field('password') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+                <td class="main"><?php echo tep_draw_password_field('confirmation') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    
+ <!--  VISUAL VERIFY CODE start -->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main my_account_title underlined"><b><?php echo VISUAL_VERIFY_CODE_CATEGORY; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2" class="form_table">
+              <tr>
+                <td class="main simple_first_row"><?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('visual_verify_code') . '&nbsp;' . '<span class="inputRequirement">' . VISUAL_VERIFY_CODE_ENTRY_TEXT . '</span>'; ?></td>
+                <td class="main">
+                  <?php
+                      //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3
+                    $visual_verify_code = ""; 
+                    for ($i = 1; $i <= rand(3,6); $i++){
+                          $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1);
+                     }
+                     $vvcode_oscsid = tep_session_id($HTTP_GET_VARS[tep_session_name()]);
+                     tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'");
+                     $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code);
+                     tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array);
+                     $visual_verify_code = "";
+                     echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '"');
+                  ?>
+                </td>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_BOX_IDENTIFIER; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+      	<td><span class="inputRequirement"><?php echo FORM_REQUIRED_INFORMATION; ?></span></td>
+      </tr>
+
+<!--  VISUAL VERIFY CODE stop   -->
+
+    
+    
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/create_account_success.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/create_account_success.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/create_account_success.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="pageHeading" align="center"><?php echo HEADING_TITLE; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main">
+        <?php 
+        if(ACCOUNT_EMAIL_CONFIRMATION=='true')
+        {
+          echo TEXT_ACCOUNT_CREATED; 
+        }
+        else
+        {
+          echo TEXT_ACCOUNT_CREATED1; 
+        }
+        ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . $origin_href . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/extra_html_output.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/extra_html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/extra_html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_template_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_template_image_button($image, $alt = '', $parameters = '') {
+    global $language;
+
+    return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+  }
+
+
+  function table_image_border_top($left, $right,$header){
+  }
+  
+  function table_image_border_bottom(){
+  }
+
+
+  function table_image_main_border_top($left, $right, $header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                     <tr>
+                      <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                <tr>
+                                  <td><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td class="infoBoxHeading"><?php echo $header;?></td>
+                                      </tr>
+                                    </table></td>
+                                </tr>
+
+                              </table></td>
+                          </tr>
+
+      </table></td>
+  </tr>
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+                     <tr>
+                      <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                                <tr>
+                                  <td class="main_table_heading_inner"><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td>
+
+<?php
+}
+
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/extra_html_output.php.bak
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/extra_html_output.php.bak	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/extra_html_output.php.bak	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,115 @@
+<?php
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_template_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_template_image_button($image, $alt = '', $parameters = '') {
+    global $language;
+
+    return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+  }
+
+
+  function table_image_border_top($left, $right,$header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+                     <tr>
+                      <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                                <tr>
+                                  <td class="main_table_heading_inner"><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td>
+
+<?php
+}
+
+}
+  function table_image_border_bottom(){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+                                    </table></td>
+                                </tr>
+                              </table></td>
+                          </tr>
+      </table></td>
+  </tr>
+      </table></td>
+  </tr>
+      </table>
+      <!--Lango Added for Template MOD: EOF-->
+<?php
+}
+?>
+<?php
+}
+
+
+  function table_image_main_border_top($left, $right, $header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                     <tr>
+                      <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                <tr>
+                                  <td><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td class="infoBoxHeading"><?php echo $header;?></td>
+                                      </tr>
+                                    </table></td>
+                                </tr>
+
+                              </table></td>
+                          </tr>
+
+      </table></td>
+  </tr>
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+                     <tr>
+                      <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                                <tr>
+                                  <td class="main_table_heading_inner"><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td>
+
+<?php
+}
+
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/footer.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/footer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/footer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,94 @@
+<?php
+/*
+  $Id: footer.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+  require(DIR_WS_INCLUDES . FILENAME_COUNTER);
+?>
+<!--<table border="0" width="100%" cellspacing="0" cellpadding="1">
+  <tr class="footer">
+    <td class="footer">&nbsp;&nbsp;<?php echo strftime(DATE_FORMAT_LONG); ?>&nbsp;&nbsp;</td>
+    <td align="right" class="footer">&nbsp;&nbsp;<?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>&nbsp;&nbsp;</td>
+  </tr>
+</table>-->
+<?php
+
+$show_adsense = false;
+
+ if (!(getenv('HTTPS')=='on') && $show_adsense){
+//google banner ad
+if ($banner = tep_banner_exists('dynamic', 'googlefoot')) {
+?>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" class="smallText">
+
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
+  </tr>
+</table>
+
+    </td>
+  </tr>
+</table>
+
+<?php
+  }
+  }
+?>
+
+	<div id="footer">
+		<ul id="secundary_navigation">
+			<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/">Home</a></li>
+			<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/about">About</a></li>
+			<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/products">Products</a></li>
+			<li><a href="<?php echo 'https://'.OPENMOKO_SHOP_HOST.OPENMOKO_SHOP_WS_PATH; ?>/" class="selected">Shop</a></li>
+			<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/developers">Developers</a></li>
+			<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/press">Press</a></li>
+			<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/careers">Careers</a></li>
+			<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/contact">Contact</a></li>
+		</ul>
+		
+		Copyright &copy; 2006 Openmoko, Inc. All Rights Reserved
+		
+<?php
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default osCommerce-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+?>
+		<p class="oscommerce_copyright"><?php echo FOOTER_TEXT_BODY?></p>
+	</div>
+	</div>
+
+<?php
+}
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php?>
+<!-- footer_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/header.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+<?php
+/*
+  $Id: header.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('DIR_WS_TEMPLATE_IMAGES', 'templates/OpenMoko/images/');
+
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+?>
+	<div id="wrapper">
+
+	<div class="top_tabs_container">
+		<?php
+			if (tep_session_is_registered('customer_id')) {
+		?>
+	
+		<div class="toptab"><div class="inner">
+			<?php
+				echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">'.HEADER_TITLE_CART_CONTENTS.'</a>';
+				echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">'.HEADER_TITLE_CHECKOUT.'</a>';
+			?>
+		</div></div>
+		
+		<div class="toptab"><div class="inner">
+			<?php
+				define(FILENAME_WISHLIST_SCRIPT, dirname(FILENAME_CHECKOUT_SHIPPING).'/wishlist.php');
+				echo '<a href="' . tep_href_link(FILENAME_WISHLIST_SCRIPT, '', 'SSL') . '">'.BOX_HEADING_CUSTOMER_WISHLIST.'</a>';
+			?>
+		</div></div>
+		
+		<?php } ?>
+		
+		<div class="toptab"><div class="inner">
+		<?php
+		if (!tep_session_is_registered('noaccount')) {// DDB - PWA - 040622 - no display of logoff for PWA customers
+			if (!tep_session_is_registered('customer_id')) {
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_TITLE_LOGIN . '</a>';
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, "", "SSL") . '">' . HEADER_TITLE_CREATE_ACCOUNT . '</a>';
+			} else {
+				echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">'.HEADER_TITLE_MY_ACCOUNT.'</a>';
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_TITLE_LOGOFF . ' </a>';
+			}
+		}
+		
+		if (tep_session_is_registered('noaccount')) { // DDB - PWA - 040622 - no display of account for PWA customers
+			if (!tep_session_is_registered('customer_id')) {
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_TITLE_LOGIN . ' </a>';
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, "", "SSL") . '">' . HEADER_TITLE_CREATE_ACCOUNT . ' </a>';
+			}else{
+				echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">'.HEADER_TITLE_MY_ACCOUNT.'</a>';
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_TITLE_LOGOFF . ' </a>';
+			}
+		}
+		?>
+		</div></div>
+	</div>
+
+	<div id="header">
+		<a href="#" id="site_logo"><img src="http://<?php echo OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/images/openmoko_logo.png" alt="openmoko.com" /></a>
+		<div id="main_navigation">
+			<ul>
+				<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/" class="nav_home"><span>Home</span></a></li>
+				<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/about" class="nav_about"><span>About</span></a></li>
+				<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/products" class="nav_products"><span>Products</span></a></li>
+				<li><a href="<?php echo 'https://'.OPENMOKO_SHOP_HOST.OPENMOKO_SHOP_WS_PATH; ?>/" class="nav_shop selected"><span>Shop</span></a></li>
+				<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/developers" class="nav_developers"><span>Developers</span></a></li>
+				<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/press" class="nav_press"><span>Press</span></a></li>
+				<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/careers" class="nav_careers"><span>Careers</span></a></li>
+				<li><a href="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/contact" class="nav_contact"><span>Contact</span></a></li>
+			</ul>
+
+		</div>
+	</div>
+
+
+
+<?php
+}
+?>
+<!-- header_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/Original.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/Original.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/admin_logo_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/admin_logo_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/back_bullet.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/back_bullet.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/breadcrumbs_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/breadcrumbs_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/button_buy.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/button_buy.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/button_buy.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/button_buy.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/button_accessories.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/button_accessories.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/button_products.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/button_products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_red.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_red.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/espanol/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/french/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/buttons/german/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/checkout_bullet.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/checkout_bullet.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_decrease_font.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_decrease_font.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_first.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_first.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_last.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_last.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_next.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_next.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_previous.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/icons/icon_previous.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/label/neo1973_title.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/label/neo1973_title.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/label/search_openmoko.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/label/search_openmoko.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/label/search_openmoko_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/label/search_openmoko_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/list_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/list_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/logo-banner_02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/logo-banner_02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/logo-banner_03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/logo-banner_03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/logo-banner_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/logo-banner_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/main_category_accessories.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/main_category_accessories.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/main_category_phones.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/main_category_phones.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/network.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/network.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation_background.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/navigation_background.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/neo_advanced.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/neo_advanced.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/no_cammera.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/no_cammera.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/openmoko_logo.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/openmoko_logo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/original_background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/original_background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/oscommerce.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/oscommerce.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_bottom.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_bottom.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_h2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_h2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/sidebox_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_0.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_0.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_3.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_3.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_5.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/stars_5.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/toptab_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/toptab_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/images/toptab_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMoko/images/toptab_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMoko/index_default.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/index_default.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/index_default.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php 
+// added for show/hide customer greeting
+if (SHOW_CUSTOMER_GREETING=='yes') { 
+// added for show/hide customer greeting
+?>
+          
+          <tr>
+                        <td class="pageHeading">
+             <?php 
+               if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
+                 echo $category['categories_heading_title'];
+               } else {
+                 echo HEADING_TITLE;
+               }
+             ?>
+            </td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+            </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="main"><?php echo tep_customer_greeting(); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+
+// added for show/hide customer greeting
+}
+// added for show/hide customer greeting
+
+
+if (tep_not_null(INCLUDE_MODULE_ONE) AND ($always_null != null)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_ONE);
+echo '</td></tr>';
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_TWO)) {
+echo '          <tr>
+            <td class="main">';
+			include($modules_folder . INCLUDE_MODULE_TWO);
+echo '</td></tr>';
+
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_THREE)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_THREE);
+echo '</td></tr>';
+
+?>
+          <tr>
+            <td>3<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_FOUR)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_FOUR);
+echo '</td></tr>';
+
+?>
+          <tr>
+            <td>4<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_FIVE)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_FIVE);
+echo '</td></tr>';
+
+?>
+          <tr>
+            <td>5<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_SIX)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_SIX);
+echo '</td></tr>';
+}
+
+?>
+        </table></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/index_products.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/index_products.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/index_products.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,120 @@
+    <!-- bof content.index_products.tpl.php-->
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+                        <td class="pageHeading">
+             <?php
+    // Get the category name and description
+    $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . $languages_id . "'");
+    $category = tep_db_fetch_array($category_query);
+    $heading_text_box = $category['categories_name'];
+
+               if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
+                 echo $category['categories_heading_title'];
+               } else {
+                 echo HEADING_TITLE;
+                 $heading_text_box = $category['categories_name'];
+                 echo '<br>'  .  $heading_text_box;
+               }
+             ?>
+            </td>
+<?php
+// optional Product List Filter
+    if (PRODUCT_LIST_FILTER > 0) {
+      if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+        $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name
+                           from " . TABLE_PRODUCTS . " p,
+                                " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c,
+                                " . TABLE_CATEGORIES . " c,
+                                " . TABLE_CATEGORIES_DESCRIPTION . " cd
+                           where p2c.categories_id = c.categories_id
+                             and p.products_id = p2c.products_id
+                             and cd.categories_id = c.categories_id
+                             and cd.language_id = '" . (int)$languages_id . "'
+                             and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                             and p.products_status = '1'
+                           order by cd.categories_name";
+      } else {
+        $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
+      }
+      $filterlist_query = tep_db_query($filterlist_sql);
+      if (tep_db_num_rows($filterlist_query) > 1) {
+        echo '            <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . '&nbsp;';
+        if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+          echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
+          $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
+        } else {
+          echo tep_draw_hidden_field('cPath', $cPath);
+          $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
+        }
+        echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
+        while ($filterlist = tep_db_fetch_array($filterlist_query)) {
+          $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
+        }
+        echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
+        echo '</form></td>' . "\n";
+      }
+    }
+
+// Get the right image for the top-right
+    $image = DIR_WS_IMAGES . 'table_background_list.gif';
+    if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+       $manufactures_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
+       $manufactures = tep_db_fetch_array($manufactures_query);
+       $heading_text_box =  $manufactures['manufacturers_name'];
+      $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
+      $image = tep_db_fetch_array($image);
+      $image = $image['manufacturers_image'];
+    } elseif ($current_category_id) {
+      $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
+      $image = tep_db_fetch_array($image);
+      $image = $image['categories_image'];
+    }
+?>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+    <?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description'])) ) { ?>
+    <tr>
+            <td align="left" colspan="2" class="category_desc"><?php echo $category['categories_description']; ?></td>
+    </tr>
+    <?php } ?>
+        </table></td>
+      </tr>
+      <!--manufacture list in index product.php-->
+<?php
+// BOF: Lango Added for template index_products .tpl MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+  $heading_text = $heading_text_box ;
+table_image_border_top(false, false, $heading_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+        <?php 
+  //Product Listing Fix - Begin
+  //decide which product listing to use
+   if (PRODUCT_LIST_CONTENT_LISTING == 'column'){
+  $listing_method = FILENAME_PRODUCT_LISTING_COL;
+  } else {
+  $listing_method = FILENAME_PRODUCT_LISTING;
+  }
+  //Then show product listing
+  
+  include(dirname(__FILE__) .'/modules/'. $listing_method); 
+  //include(DIR_WS_MODULES . $listing_method); 
+ 
+  
+  //Product Listing Fix - End
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template content indexproducts.tlpMOD
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/OpenMoko/login.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/login.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/login.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+    <?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); ?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+
+
+<?php
+  if ($messageStack->size('login') > 0) {
+?>
+      <tr>
+        <td ><?php echo $messageStack->output('login'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+
+  if ($cart->count_contents() > 0) {
+?>
+      <tr>
+        <td class="smallText"><?php echo TEXT_VISITORS_CART; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<tr><td>
+<?php
+if (PWA_ON == 'false') {
+require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/' . FILENAME_PWA_ACC_LOGIN);
+} else {
+require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/' . FILENAME_PWA_PWA_LOGIN);
+}
+?>
+</td></tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/login_acc.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/login_acc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/login_acc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,128 @@
+<?php
+//BOF: MaxiDVD Returning Customer Info SECTION
+//===========================================================
+$returning_customer_title = HEADING_RETURNING_CUSTOMER; // DDB - 040620 - PWA - change TEXT by HEADING
+if ($setme != '')
+{
+$returning_customer_info = "
+<!--Confirm Block-->
+<td width=\"50%\" height=\"100%\" valign=\"top\"><table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"1\" cellpadding=\"2\" class=\"infoBox\">
+<tr class=\"infoBoxContents\">
+<td>
+<table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\" colspan=\"2\">".TEXT_YOU_HAVE_TO_VALIDATE."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\"><b>". ENTRY_EMAIL_ADDRESS."</b></td>
+   <td class=\"main\">". tep_draw_input_field('email_address')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\"><b>". ENTRY_VALIDATION_CODE."</b></td>
+   <td class=\"main\">".tep_draw_input_field('pass').tep_draw_input_field('password',$HTTP_POST_VARS['password'],'','hidden')."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"smallText\" colspan=\"2\">". '<a href="' . tep_href_link('validate_new.php', '', 'SSL') . '">' . TEXT_NEW_VALIDATION_CODE . '</a>'."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">". tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
+     <tr>
+       <td width=\"10\">". tep_draw_separator('pixel_trans.gif', '10', '1')."</td>
+       <td align=\"right\">".tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE)."</td>
+       <td width=\"10\">".tep_draw_separator('pixel_trans.gif', '10', '1')."</td>
+     </tr>
+</table>
+        </table></td>
+      </tr>
+    </table></form></td>
+
+<!--Confirm Block END-->
+";  
+
+}else 
+{
+$returning_customer_info = "
+<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"2\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  
+  <tr>
+    <td class=\"main login_col1\">" . ENTRY_EMAIL_ADDRESS . "</td>
+    <td class='total_input'>" . tep_draw_input_field('email_address') . "</td>
+  </tr>
+  
+  <tr>
+    <td class=\"main\">" . ENTRY_PASSWORD . "</td>
+  	<td class='total_input'>" . tep_draw_password_field('password') . "</td>
+  </tr>
+  
+  <tr>
+  	<td colspan='2' style='text-align:right; padding-top: 10px;'>".
+	tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN)  . '<a style="display:block; margin-top: 10px" href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">'  . TEXT_PASSWORD_FORGOTTEN . '</a>'
+  	."</td>
+  </tr>
+</table>
+";
+}
+
+//===========================================================
+$create_account_title = HEADING_NEW_CUSTOMER;
+$create_account_info = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\"  width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . TEXT_NEW_CUSTOMER_INTRODUCTION . "</td>
+  </tr>
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  <tr>
+    <td width=\"33%\" class=\"main\"></td>
+    <td width=\"33%\"></td>
+    <td width=\"34%\" rowspan=\"3\" align=\"center\">" . '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a>' . "<br><br></td>
+  </tr>
+</table>";
+//===========================================================
+?>
+
+<table width="100%" cellpadding="5" cellspacing="0" border="0">
+    <tr>
+     <td class="main" width=48% valign="top" align="center">
+     
+     <table width="100%">
+     	<tr>
+     		<td class="my_account_title bordered"><?php echo $returning_customer_title ?></td>
+     	</tr>
+     	<tr>
+     		<td style="line-height: 140%; padding-top: 10px;" class="form_table">
+     			<?php echo $returning_customer_info ?>
+     		</td>
+     	</tr>
+     </table>
+  </td>
+  <td>&nbsp;</td>
+  <td width="48%" valign="top">
+     <table width="100%">
+     	<tr>
+     		<td class="my_account_title bordered"><?php echo $create_account_title ?></td>
+     	</tr>
+     	<tr>
+     		<td style="line-height: 140%; padding-top: 10px;">
+     			<?php echo $create_account_info ?>
+     		</td>
+     	</tr>
+     </table>
+  </td>
+ </tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/login_pwa.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/login_pwa.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/login_pwa.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,211 @@
+<?php
+//BOF: MaxiDVD Returning Customer Info SECTION
+//===========================================================
+$returning_customer_title = HEADING_RETURNING_CUSTOMER; // DDB - 040620 - PWA - change TEXT by HEADING
+if ($setme != '')
+{
+$returning_customer_info = "
+<!--Confirm Block-->
+<td width=\"50%\" height=\"100%\" valign=\"top\"><table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"1\" cellpadding=\"2\" class=\"infoBox\">
+<tr class=\"infoBoxContents\">
+<td>
+<table border=\"0\" width=\"100%\" height=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\" colspan=\"2\">".TEXT_YOU_HAVE_TO_VALIDATE."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\"><b>". ENTRY_EMAIL_ADDRESS."</b></td>
+   <td class=\"main\">". tep_draw_input_field('email_address')."</td>
+ </tr>
+ <tr>
+   <td class=\"main\"><b>". ENTRY_VALIDATION_CODE."</b></td>
+   <td class=\"main\">".tep_draw_input_field('pass').tep_draw_input_field('password',$HTTP_POST_VARS['password'],'','hidden')."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">".tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td class=\"smallText\" colspan=\"2\">". '<a href="' . tep_href_link('validate_new.php', '', 'SSL') . '">' . TEXT_NEW_VALIDATION_CODE . '</a>'."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\">". tep_draw_separator('pixel_trans.gif', '100%', '10')."</td>
+ </tr>
+ <tr>
+   <td colspan=\"2\"><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
+     <tr>
+       <td width=\"10\">". tep_draw_separator('pixel_trans.gif', '10', '1')."</td>
+       <td align=\"right\">".tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE)."</td>
+       <td width=\"10\">".tep_draw_separator('pixel_trans.gif', '10', '1')."</td>
+     </tr>
+</table>
+        </table></td>
+      </tr>
+    </table></form></td>
+
+<!--Confirm Block END-->
+";  
+
+}else 
+{
+$returning_customer_info = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . TEXT_RETURNING_CUSTOMER . "</td>
+  </tr>
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  <tr>
+    <td class=\"main\">
+
+<table width=\"70%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\">
+  <tr>
+    <td class=\"main\">" . ENTRY_EMAIL_ADDRESS . "</td>
+    <td>" . tep_draw_input_field('email_address') . "</td>
+  </tr>
+  <tr>
+    <td class=\"main\">" . ENTRY_PASSWORD . "<br><br></td>
+        <td>" . tep_draw_password_field('password') . "<br><br></td>
+  </tr>
+</table>
+<table width=\"30%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"right\">
+  <tr>
+        <td align=\"center\" class=\"smalltext\">" . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "<br><br>" . '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>' . "<br><br></td>
+  </tr>
+</table>
+</td>
+  </tr>
+</table>
+";
+}
+//===========================================================
+?>
+<!-- login_pwa -->
+
+    <tr>
+     <td class="main" width=100% valign="top" align="center">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $returning_customer_title );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $returning_customer_info);
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+  </td>
+ </tr>
+
+<?php
+//EOF: MaxiDVD Returning Customer Info SECTION
+//===========================================================
+
+
+
+
+
+//MaxiDVD New Account Sign Up SECTION
+//===========================================================
+$create_account_title = HEADING_NEW_CUSTOMER;
+$create_account_info = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . TEXT_NEW_CUSTOMER . '<br><br>' . TEXT_NEW_CUSTOMER_INTRODUCTION . "</td>
+  </tr>
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  <tr>
+    <td width=\"33%\" class=\"main\"></td>
+    <td width=\"33%\"></td>
+    <td width=\"34%\" rowspan=\"3\" align=\"center\">" . '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_create_account.gif', IMAGE_BUTTON_CREATE_ACCOUNT) . '</a>' . "<br><br></td>
+  </tr>
+</table>";
+//===========================================================
+?>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?>
+    <tr>
+     <td class="main" width=100% valign="top" align="center">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $create_account_title );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $create_account_info);
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+  </td>
+  </tr>
+
+<?php
+//EOF: MaxiDVD New Account Sign Up SECTION
+//===========================================================
+
+
+
+
+
+//BOF: MaxiDVD Purchase With-Out An Account SECTION
+//===========================================================
+$pwa_checkout_title = HEADING_CHECKOUT;
+$pwa_checkout_info = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" id=\"AutoNumber1\">
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . TEXT_CHECKOUT_INTRODUCTION . "</td>
+  </tr>
+  <tr>
+    <td width=\"100%\" class=\"main\" colspan=\"3\">" . tep_draw_separator('pixel_trans.gif', '100%', '10') . "</td>
+  </tr>
+  <tr>
+    <td width=\"33%\" class=\"main\"></td>
+    <td width=\"33%\"></td>
+    <td width=\"34%\" rowspan=\"3\" align=\"center\">" . '<a href="' . tep_href_link(FILENAME_CHECKOUT, '', 'SSL') . '">' . tep_template_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>' . "<br><br></td>
+  </tr>
+</table>";
+//===========================================================
+?>
+<?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?>
+
+    <tr>
+     <td class="main" width=100% valign="top" align="center">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $pwa_checkout_title );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $pwa_checkout_info);
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+  </td>
+  </tr>
+
+  <?php
+//EOF: MaxiDVD Purchase With-Out An Account SECTION
+//===========================================================
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,114 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+
+
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body>
+
+<!-- header //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_HEADER); ?>
+<!-- header_eof //-->
+
+<div class="left_container">
+	<div class="sidebox"><div class="inner"><div class="inner_2">
+		<form id="searchform" method="get" action="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/">
+			<label>Search openmoko</label>
+			<input type="hidden" name="s" value="search" />
+			<input type="text" class="input_text" name="q" />
+
+			<input type="image" class="input_submit" src="<?php echo PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH; ?>/images/button_go.png" alt="GO"/>
+		</form>
+	</div></div></div>
+	
+	<?php
+	if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+	if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+	?>
+		<?php //require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+		<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/' . FILENAME_COLUMN_RIGHT); ?>
+	<?php
+	}
+	}
+	?>
+</div>
+
+
+<div class="right_container">
+<?php
+
+$show_breadcrumb = false;
+
+if ($show_breadcrumb) { ?>
+
+		<div class="shop_breadcrumb">
+			<?php echo $breadcrumb->trail(' <img src="'.DIR_WS_TEMPLATES . TEMPLATE_NAME.'/images/list_bullet.png" alt=">" class="breadcrumb_arrow" /> '); ?>
+		</div>
+		
+<?php } ?>
+		
+		<!-- warnings //-->
+		<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+		<!-- warning_eof //-->
+
+		
+		<!-- body //-->
+		<table border="0" width="100%" cellspacing="3" cellpadding="<?php echo CELLPADDING_MAIN; ?>">
+		  <tr>
+		<?php
+		if (DISPLAY_COLUMN_LEFT == 'yes')  {
+		// WebMakers.com Added: Down for Maintenance
+		// Hide column_left.php if not to show
+		if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+		?>
+		    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+		<!-- left_navigation //-->
+		<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+		<!-- left_navigation_eof //-->
+		    </table></td>
+		<?php
+		}
+		}
+		?>
+		<!-- content //-->
+		    <td width="100%" valign="top">
+		<?php
+		if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template))) {
+		    require(DIR_WS_CONTENT . basename($content_template));
+		  } else {
+		  	if (!is_file(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'. $content . '.tpl.php')){
+		  		require(DIR_WS_CONTENT . $content . '.tpl.php');
+		  		echo $content . '.tpl.php';
+		  	} else {
+		  		require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'. $content . '.tpl.php');	
+		  	}
+/*		  	die(DIR_WS_CONTENT . $content . '.tpl.php');
+		    require(DIR_WS_CONTENT . $content . '.tpl.php');*/
+		  }
+		?>
+		    </td>
+		<!-- content_eof //-->
+		  </tr>
+		</table>
+		<!-- body_eof //-->
+</div>
+
+<div class="clear"></div>
+<!-- footer //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_FOOTER); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>

Added: trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/default_specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/default_specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/default_specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: default_specials.php,v 2.1 2006/09/07 23:42:27 datazen Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- default_specials mainpage //-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
+  
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+  $random_specials = array();
+  $specials_array = array();
+  $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC");
+  while ($specials = tep_db_fetch_array($specials_query)) {
+    $random_specials[] .= $specials['products_id'];
+  }
+
+  $row = 0;
+  $col = 0;
+
+  if (sizeof($random_specials)!=0){
+    $max_displayed = (MAX_DISPLAY_SPECIAL_PRODUCTS > sizeof($random_specials)) ? sizeof($random_specials) : MAX_DISPLAY_SPECIAL_PRODUCTS;
+    $special_products = cre_random_array($random_specials, $max_displayed);
+    for($i=0; $i < $max_displayed; $i++) {
+      $product_array = array();
+      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price as special_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where  p.products_id = $special_products[$i] and  s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");
+      $product = tep_db_fetch_array($product_query);
+
+      $pf->loadProduct($product['products_id'],$languages_id);
+      $products_price_s = $pf->getPriceStringShort();
+
+      $buyitnow='<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+ 
+      $info_box_contents[$row][$col] = array('align' => 'center',
+                                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                                             'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $product['products_image'], $product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . $product['products_name'] . '</a><br>' . $products_price_s . '<br>'. $buyitnow);
+      $col ++;
+      if ($col > 2) {
+        $col = 0;
+        $row ++;
+      }
+    }
+  }else{
+      $info_box_contents[$row][$col] = array('align' => 'left',
+                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                             'text' => TEXT_NO_SPECIALS);
+  }
+  
+  new contentBox($info_box_contents);
+
+  $info_box_contents = array();
+  if (MAIN_TABLE_BORDER == 'yes'){
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                             );
+    new infoboxFooter($info_box_contents, true, true);
+  }
+?><!-- default_specials_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/example.html
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/example.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/example.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<table width="100%" border="0" bgcolor="FFA814" cellspacing="0" cellpadding="0">
+  <tr>
+    <td bgcolor="#CCCCCC">
+    <table width="100%" border="0" cellpadding="0" cellspacing="1">
+      <tr>
+        <td class="infoBoxHeading">
+        Example HTML Mainpage Module</td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+  <tr>
+    <td valign="top" width="100%">
+    <table width="100%" border="0" class="infobox" cellspacing="0" cellpadding="1">
+      <tr>
+        <td valign="top" width="100%">
+        <table width="100%" border="0" class="infoboxContents" cellspacing="0" cellpadding="0">
+      <!-- change from here to next-->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+          <tr>
+            <td align="center">
+            <img width="426" height="75" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr01.gif" border="0"></td>
+          </tr>
+          <tr>
+            <td valign="top" align="center">
+            <img valign="top" width="117" height="90" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr02.gif" border="0"></a><img width="117" height="90" valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr03.gif" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr04.gif" height="90" width="96" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr05.gif" width="96" height="90" border="0"></td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <!-- change from here to above-->
+        </table>
+        </td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Featured Products V1.1
+  Displays a list of featured products, selected from admin
+  For use as an Infobox instead of the "New Products" Infobox
+*/
+?>
+<!-- featured_products_mainpage //-->
+<?php
+ 
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+      $featured_products_2bb_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                              " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(),p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
+   
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($featured_products_2bb = tep_db_fetch_array($featured_products_2bb_query)) {
+
+    $num ++;
+  
+    if ($num == 1) {
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+    }    
+
+  $pf->loadProduct($featured_products_2bb['products_id'],$languages_id);
+        $products_price_2bb = $pf->getPriceStringShort();
+
+
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products_2bb['products_image'], $featured_products_2bb['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . $featured_products_2bb['products_name'] . '</a><br>' . $products_price_2bb);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+
+  }
+ 
+?>
+<!-- featured_products_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/main_categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/main_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/main_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,211 @@
+<?php
+/*
+  $Id: main_categories.php,v 1.0a 2002/08/01 10:37:00 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Barreto
+  Gustavo Barreto <gustavo at barreto.net>
+  http://www.barreto.net/
+
+  Based on: all_categories.php Ver. 1.6 by Christian Lescuyer
+
+  History: 1.0 Creation
+     1.0a Correction: Extra Carriage Returns
+     1.1  added parameters to change display options -- mdt
+
+  Released under the GNU General Public License
+
+*/
+
+//------------------------------------------------------------------------------------------------------
+// PARAMETERS
+//------------------------------------------------------------------------------------------------------
+
+$item_column_number = 3;    // range of 1 to 9
+$item_title_on_newline = true;  // true or false
+
+// for item and subcategory options, suugest that you just put in CSS code
+// you can also just define a class and then change it in a template addon like BTS
+$item_div_options = 'style="text-align:center;font-weight:bold;font-size:larger;margin-top:5px;"';
+$item_subcategories_options = '';
+
+//------------------------------------------------------------------------------------------------------
+// CODE - do not change below here
+//------------------------------------------------------------------------------------------------------
+
+// error checking on parameters
+if($item_column_number < 1)
+{
+  $item_column_number = 1;
+}
+if($item_column_number > 9)
+{
+  $item_column_number = 9;
+}
+if($item_title_on_newline)
+{
+  $item_separator = '<br>';
+} else {
+  $item_separator = '&nbsp;';
+}
+
+// preorder_mc tree traversal
+  function preorder_mc($cid_cat, $level_cat, $foo_cat, $cpath_cat)
+  {
+    global $categories_string_cat, $HTTP_GET_VARS;
+
+// Display link
+    if ($cid_cat != 0) {
+      for ($i=0; $i<$level_cat; $i++)
+        $categories_string_cat .=  '&nbsp;&nbsp;';
+      $categories_string_cat .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath
+=' . $cpath_cat . $cid_cat) . '">';
+// 1.6 Are we on the "path" to selected category?
+      $bold = strstr($HTTP_GET_VARS['cPath'], $cpath_cat . $cid_cat . '_') || $HTTP_GET_VARS['cPath'] == $cpath_cat . $cid_cat;
+// 1.6 If yes, use <b>
+      if ($bold)
+        $categories_string_cat .=  '<b>';
+      $categories_string_cat .=  $foo_cat[$cid_cat]['name'];
+      if ($bold)
+        $categories_string_cat .=  '</b>';
+      $categories_string_cat .=  '</a>';
+// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+      if (SHOW_COUNTS == 'true') {
+        $products_in_category = tep_count_products_in_category($cid_cat);
+        if ($products_in_category > 0) {
+          $categories_string_cat .= '&nbsp;(' . $products_in_category . ')';
+        }
+      }
+      $categories_string_cat .= '<br>';
+    }
+
+// Traverse category tree
+    if (is_array($foo_cat)) {
+      foreach ($foo_cat as $key => $value) {
+        if ($foo_cat[$key]['parent'] == $cid_cat) {
+          preorder_mc($key, $level_cat+1, $foo_cat, ($level_cat != 0 ? $cpath_cat . $cid_cat . '_' : ''));
+        }
+      }
+    }
+  }
+
+?>
+<!-- main_categories //-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES_MAIN_PAGE);
+  //new infoBoxHeading($info_box_contents, true, true);
+
+
+//////////
+// Get categories list
+//////////
+
+$query_cat = "select 
+  c.categories_id, 
+  cd.categories_name, 
+  c.categories_image,
+  cd.categories_description,
+  c.parent_id from 
+  " . TABLE_CATEGORIES . " c,
+  " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+  where 
+  c.parent_id = '0' 
+ and c.categories_id = cd.categories_id 
+ and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+
+  $categories_query_cat = tep_db_query($query_cat);
+
+
+// Initiate tree traverse
+$categories_string_cat = '';
+preorder_mc(0, 0, $foo_cat, '');
+
+//////////
+// Display box contents
+//////////
+
+$info_box_contents = array();
+
+$row = 0;
+$col = 0;
+while ($categories_cat = tep_db_fetch_array($categories_query_cat))
+{
+  if ($categories['parent_id'] == 0)
+    {
+      $cpath_cat_new = tep_get_path($categories_cat['categories_id']);
+      $text_subcategories = '';
+      $subcategories_query_cat = tep_db_query($query_cat);
+      while ($subcategories_cat = tep_db_fetch_array($subcategories_query_cat))
+      {
+        if ($subcategories_cat['parent_id'] == $categories_cat['categories_id'])
+      {
+                $cPath_new_sub = "cPath="  . $categories_cat['categories_id'] . "_" . $subcategories_cat['categories_id'];
+                $text_subcategories .= '� <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">';
+                $text_subcategories .= $subcategories_cat['categories_name'] . '</a>' . " ";
+
+          } // if ($subcategories['parent_id'] == $categories['categories_id'])
+
+      } // while ($subcategories = tep_db_fetch_array($subcategories_query))
+
+      $print_categories[] = '<div class="main_category main_category_'.strtolower($categories_cat['categories_id']).'">
+      							<h3><a href="'.tep_href_link(FILENAME_DEFAULT, $cpath_cat_new).'">'.$categories_cat['categories_name'].'</a></h3>
+      							<div class="main_categories_description">
+      								'.$categories_cat['categories_description'].'
+      							</div>
+      							
+      							<a class="img_button button_'.strtolower($categories_cat['categories_id']).'" href="'.tep_href_link(FILENAME_DEFAULT, $cpath_cat_new).'"><span>'.$categories_cat['categories_name'].'</span></a>
+      						</div>';
+      
+      // determine the column position to see if we need to go to a new row
+      $col ++;
+      if ($col > ($item_column_number - 1))
+      {
+          $col = 0;
+          $row ++;
+
+      } //if ($col > ($number_of_columns - 1))
+
+    } //if ($categories['parent_id'] == 0)
+
+} // while ($categories = tep_db_fetch_array($categories_query))
+
+//output the contents
+//new contentBox($info_box_contents);
+
+foreach ($print_categories as $print_category) {
+	//echo $print_category;
+}
+
+// this is static page for now
+
+?>
+
+<div class="shop_home">
+	<h3 class="shop_home_h3"><a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO,'products_id=43','SSL'); ?>">Neo Base</a></h3>
+	<h3 class="shop_home_h3"><a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO,'products_id=44','SSL'); ?>">Neo Advanced</a></h3>
+	
+	<div class="shop_home_column">
+		<p class="main_categories_description">The Neo1973 is the world's first completely open, Linux-based mobile phone. Designed with elongated oval lines and smooth rounded edges, the sleek exterior, and ergonomic feel fit the Neo1973 into the palm of your hand.</p>
+		<a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO,'products_id=43','SSL'); ?>" class="button_buy_it_now img_button"><span>Buy it now</span></a>
+	</div>
+
+	<div class="shop_home_column shop_home_column_right">
+		<p class="main_categories_description">The Hacker's Lunch Box is a heavy duty, mysterious black box that houses the OpenMoko development board. The Lunch Box is padded to protect your Neo1973, development board, and accessories for hackers in transport.</p>	
+		<a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO,'products_id=44','SSL'); ?>" class="button_buy_it_now img_button"><span>Buy it now</span></a>
+	</div>
+</div>
+
+
+
+
+
+<!-- main_categories_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,35 @@
+<?php
+/*
+  $Id: mainpage.php,v 2.1 2004/04/07
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+  to change the contents of this file edit
+  includes/languages/(language)/mainpage.php
+*/
+?>
+<!-- Main_page //-->
+
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, HEADING_TITLE);
+}
+// EOF: Lango Added for template MOD
+
+include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE);
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<!-- Main_page_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/new_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/new_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/new_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,69 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- mainpages_modules.new_products.php//-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
+
+  
+      $new_products_query = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+       order by rand(), p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
+
+  
+
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($new_products = tep_db_fetch_array($new_products_query)) {
+  
+    $num ++;
+      if ($num == 1) { 
+  new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+      }
+
+  $pf->loadProduct($new_products['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+
+  
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $products_price_s);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+if($num) {
+  new contentBox($info_box_contents);
+}
+
+?>
+<!-- new_products_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/mainpage_modules/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/*
+  $Id: upcoming_products.php,v 1.1.1.3 2004/04/07 23:42:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- upcoming_products mainpage_modules //-->
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_UPCOMING_PRODUCTS, strftime('%B')));
+
+    $expected_query_raw= tep_db_query("select
+ p.products_id,
+ pd.products_name, 
+ p.products_image, 
+    products_date_available as date_expected 
+ from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+    where 
+    to_days(products_date_available) >= to_days(now()) 
+    and p.products_id = pd.products_id 
+    and pd.language_id = '" . (int)$languages_id . "' 
+    order by rand()
+    limit " . MAX_DISPLAY_UPCOMING_PRODUCTS);
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($expected_query = tep_db_fetch_array($expected_query_raw)) {
+  
+    $num ++;
+      if ($num == 1) { 
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
+      }
+  $pf->loadProduct($expected_query['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+    
+   $duedate= str_replace("00:00:00", "" , $expected_query['date_expected']);  
+   
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $expected_query['products_image'], $expected_query['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . $expected_query['products_name'] . '</a><br>' . $products_price_s . '<br>' . TABLE_HEADING_DATE_EXPECTED . '&nbsp;' . $duedate);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+
+  }
+?>
+<!-- upcoming_products_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/modules/address_book_details.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/modules/address_book_details.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/modules/address_book_details.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,128 @@
+<?php
+/*
+  $Id: address_book_details.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (!isset($process)) $process = false;
+?><table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+      <tr class="infoBoxContents">
+        <td><table border="0" cellspacing="2" cellpadding="2" class="form_table">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    if (isset($gender)) {
+      $male = ($gender == 'm') ? true : false;
+    } else {
+      $male = ($entry['entry_gender'] == 'm') ? true : false;
+    }
+    $female = !$male;
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_GENDER; ?></td>
+            <td class="main"><?php echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main simple_first_row"><?php echo ENTRY_FIRST_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('firstname', $entry['entry_firstname']) . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('lastname', $entry['entry_lastname']) . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_COMPANY; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('company', $entry['entry_company']) . '&nbsp;' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('street_address', $entry['entry_street_address']) . '&nbsp;' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_SUBURB; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('suburb', $entry['entry_suburb']) . '&nbsp;' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('postcode', $entry['entry_postcode']) . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_CITY; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('city', $entry['entry_city']) . '&nbsp;' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_STATE; ?></td>
+            <td class="main">
+<?php
+    if ($process == true) {
+      if ($entry_state_has_zones == true) {
+        $zones_array = array();
+        $zones_array[] = array('id' => '', 'text' => '');
+        $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
+        while ($zones_values = tep_db_fetch_array($zones_query)) {
+          $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+        }
+        echo tep_draw_pull_down_menu('state', $zones_array);
+      } else {
+        echo tep_draw_input_field('state');
+      }
+    } else {
+      echo tep_draw_input_field('state', tep_get_zone_name($entry['entry_country_id'], $entry['entry_zone_id'], $entry['entry_state']));
+    }
+
+    if (tep_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="inputRequirement">' . ENTRY_STATE_TEXT;
+?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
+            <td class="main"><?php echo tep_get_country_list('country', $entry['entry_country_id']) . '&nbsp;' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
+          </tr>
+<?php
+
+  if ((isset($_GET['edit']) && ($customer_default_address_id != $_GET['edit'])) || (isset($_GET['edit']) == false) ) {
+?>
+          <tr>
+            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2" class="main"><?php echo tep_draw_checkbox_field('primary', 'on', false, 'id="primary"') . ' ' . SET_AS_PRIMARY; ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+          	<td><div class="requiredWarning"><?php echo FORM_REQUIRED_INFORMATION; ?></div></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/templates/OpenMoko/modules/product_listing.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/modules/product_listing.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/modules/product_listing.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,234 @@
+<?php
+/*
+  $Id: product_listing.php,v 1.1.1.1 2004/03/04 23:41:11 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  if (strstr($PHP_SELF, FILENAME_SPECIALS)) {
+    $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SPECIAL_PRODUCTS, 'p.products_id');
+  }else{
+    $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
+  }
+
+  if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+  </tr>
+
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+
+</table>
+<?php
+  }
+if ($HTTP_GET_VARS['sort']) {
+$sort = $HTTP_GET_VARS['sort'];
+} else{
+$sort = 'PRODUCT_LIST_NAME';
+}
+  $list_box_contents = array();
+  
+
+  for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
+  if ($page_set == 'upcoming_products'){
+    switch ($column_list[$col]) {
+      case 'PRODUCT_LIST_MODEL':
+        $lc_text = TABLE_HEADING_MODEL;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $lc_text = TABLE_HEADING_PRODUCTS;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $lc_text = TABLE_HEADING_MANUFACTURER;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $lc_text = TABLE_HEADING_PRICE;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $lc_text = TABLE_HEADING_QUANTITY;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $lc_text = TABLE_HEADING_WEIGHT;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $lc_text = TABLE_HEADING_IMAGE;
+        $lc_align = 'center';
+        break;
+      case 'PRODUCT_LIST_BUY_NOW':
+        $lc_text = TABLE_HEADING_BUY_NOW;
+        $lc_align = 'center';
+        break;
+        case 'PRODUCT_LIST_DATE_EXPECTED':
+          $lc_text = TABLE_HEADING_DATE_EXPECTED;
+          $lc_align = 'center';
+        break;
+     } //end case
+    } else {
+    switch ($column_list[$col]) {
+      case 'PRODUCT_LIST_MODEL':
+        $lc_text = TABLE_HEADING_MODEL;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $lc_text = TABLE_HEADING_PRODUCTS;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $lc_text = TABLE_HEADING_MANUFACTURER;
+        $lc_align = '';
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $lc_text = TABLE_HEADING_PRICE;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $lc_text = TABLE_HEADING_QUANTITY;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $lc_text = TABLE_HEADING_WEIGHT;
+        $lc_align = 'right';
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $lc_text = TABLE_HEADING_IMAGE;
+        $lc_align = 'center';
+        break;
+      case 'PRODUCT_LIST_BUY_NOW':
+        $lc_text = TABLE_HEADING_BUY_NOW;
+        $lc_align = 'center';
+        break;
+    } //end case
+  } //end if
+    if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
+      $lc_text = tep_create_sort_heading($sort, $col+1, $lc_text);
+    }
+
+    $list_box_contents[0][] = array('align' => $lc_align,
+                                    'params' => 'class="productListing-heading"',
+                                    'text' => '&nbsp;' . $lc_text . '&nbsp;');
+  }
+
+  if ($listing_split->number_of_rows > 0) {
+    $rows = 0;
+    $listing_query = tep_db_query($listing_split->sql_query);
+    $no_of_listings = tep_db_num_rows($listing_query);
+    
+    while ($_listing = tep_db_fetch_array($listing_query)) {
+      $listing[] = $_listing;
+    }
+
+    for ($x = 0; $x < $no_of_listings; $x++) {
+      $rows++;
+      if (($rows/2) == floor($rows/2)) {
+        $list_box_contents[] = array('params' => 'class="productListing-even"');
+      } else {
+        $list_box_contents[] = array('params' => 'class="productListing-odd"');
+      }
+
+      $cur_row = sizeof($list_box_contents) - 1;
+
+      for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
+        $lc_align = '';
+
+        switch ($column_list[$col]) {
+          case 'PRODUCT_LIST_MODEL':
+            $lc_align = '';
+            $lc_text = '&nbsp;' . $listing[$x]['products_model'] . '&nbsp;';
+            break;
+          case 'PRODUCT_LIST_NAME':
+            $lc_align = '';
+            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&amp;products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . $listing[$x]['products_name'] . '</a>';
+            } else {
+              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&amp;' : '') . 'products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . $listing[$x]['products_name'] . '</a>&nbsp;';
+            }
+            break;
+          case 'PRODUCT_LIST_MANUFACTURER':
+            $lc_align = '';
+            $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id'], 'SSL') . '">' . $listing[$x]['manufacturers_name'] . '</a>&nbsp;';
+            break;
+          case 'PRODUCT_LIST_PRICE':
+            $lc_align = 'right';
+            $pf->loadProduct($listing[$x]['products_id'],$languages_id);
+            $lc_text = $pf->getPriceStringShort();
+            break;
+          case 'PRODUCT_LIST_QUANTITY':
+            $lc_align = 'right';
+            $lc_text = '&nbsp;' . $listing[$x]['products_quantity'] . '&nbsp;';
+            break;
+          case 'PRODUCT_LIST_WEIGHT':
+            $lc_align = 'right';
+            $lc_text = '&nbsp;' . $listing[$x]['products_weight'] . '&nbsp;';
+            break;
+          case 'PRODUCT_LIST_IMAGE':
+            $lc_align = 'center';
+            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&amp;products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
+            } else {
+              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&amp;' : '') . 'products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>&nbsp;';
+            }
+            break;
+            case 'PRODUCT_LIST_DATE_EXPECTED':
+              $duedate= str_replace("00:00:00", "" , $listing[$x]['products_date_available']);  
+                  $lc_align = 'center';
+                  $lc_text = '&nbsp;' .  $duedate . '&nbsp;';
+            break;
+            
+         //This change to the buy_now is backed out
+         // VJ product quantity begin
+          case 'PRODUCT_LIST_BUY_NOW':
+            $lc_align = 'center';
+            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+            break;
+          // VJ product quantity end
+          //end of the backout
+        }
+
+        $list_box_contents[$cur_row][] = array('align' => $lc_align,
+                                               'params' => 'class="productListing-data"',
+                                               'text'  => $lc_text);
+      }
+    }
+
+    new productListingBox($list_box_contents);
+  } else {
+    $list_box_contents = array();
+
+    $list_box_contents[0] = array('params' => 'class="productListing-odd"');
+    $list_box_contents[0][] = array('params' => 'class="productListing-data"',
+                                   'text' => TEXT_NO_PRODUCTS);
+
+    new productListingBox($list_box_contents);
+  }
+
+  if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+  </tr>
+</table>
+
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/modules/product_listing_col.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/modules/product_listing_col.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/modules/product_listing_col.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,215 @@
+<?php
+/*
+  $Id: product_listing_col.php,v 1.1.1.1 2004/03/04 23:41:11 ccwjr Exp $
+*/
+
+  if (strstr($PHP_SELF, FILENAME_SPECIALS)) {
+    $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SPECIAL_PRODUCTS, 'p.products_id');
+  }else{
+    $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
+  }
+
+  if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
+?>
+<!--product-listin-col -->
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+    <td class="smallText" align="right">
+    	<?php //echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); var_dump($listing_split);?>
+    	<?php
+    		$current_page = $listing_split->current_page_number;
+    		$total_pages = $listing_split->number_of_pages;
+    		
+    		$page = $current_page -1;
+    		
+    		$getcpath = isset($_GET['cPath']) ? $_GET['cPath'] : 0;
+    		
+    		$base_url = '?cPath='.$getcpath.'&amp;page=';
+    		
+			echo "<div class='pagination'>";
+    		
+			if ($current_page !=1) {
+				echo "<a href='".$base_url."1' class='pag_first'>First</a>";
+				echo "<a href='$base_url".($current_page-1)."' class='pag_previous'>Previous</a>";
+			} else {
+				echo "<a href='##' class='pag_first disabled'>First</a>";
+				echo "<a href='##' class='pag_previous disabled'>Previous</a>";
+			}
+			for ($x=1;$x<($total_pages+1);$x++) {
+				echo "<a href='$base_url".($x)."'";
+				if (($x-1)==$page) echo " class='selected'";
+				echo">$x</a>";
+			};
+			
+			if ($current_page != $total_pages) {
+				echo "<a href='$base_url".($current_page+1)."' class='pag_next'>Next</a>";
+				echo "<a href='$base_url".($total_pages)."' class='pag_last'>Last</a>";
+			} else {
+				echo "<a href='##' class='pag_next disabled'>Next</a>";
+				echo "<a href='##' class='pag_last disabled'>Last</a>";
+			}
+			
+			echo "</div>";
+		?>
+    </td>
+  </tr>
+</table>
+<?php
+  }
+  $list_box_contents = array();
+
+  if ($listing_split->number_of_rows > 0) {
+    $listing_query = tep_db_query($listing_split->sql_query);
+
+    $row = 0;
+    $column = 0;
+    $no_of_listings = tep_db_num_rows($listing_query);
+
+    while ($_listing = tep_db_fetch_array($listing_query)) {
+      $listing[] = $_listing;
+    }
+
+    for ($x = 0; $x < $no_of_listings; $x++) {
+      $rows++;
+      $product_contents = array();
+      for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
+        $lc_align = '';
+        switch ($column_list[$col]) {
+
+          case 'PRODUCT_LIST_MODEL':
+            $lc_align = '';
+            $lc_text = '&nbsp;' . $listing[$x]['products_model'] . '&nbsp;';
+            break;
+
+          case 'PRODUCT_LIST_NAME':
+            $lc_align = '';
+            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&amp;products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . $listing[$x]['products_name'] . '</a>';
+            } else {
+              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&amp;' : '') . 'products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . $listing[$x]['products_name'] . '</a>&nbsp;';
+            }
+            break;
+
+          case 'PRODUCT_LIST_MANUFACTURER':
+            $lc_align = '';
+            $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id'], 'SSL') . '">' . $listing[$x]['manufacturers_name'] . '</a>&nbsp;';
+            break;
+            
+          case 'PRODUCT_LIST_PRICE':
+            $lc_align = 'right';
+            $pf->loadProduct($listing[$x]['products_id'],$languages_id);
+            $lc_text = $pf->getPriceStringShort();
+            break;
+
+          case 'PRODUCT_LIST_QUANTITY':
+            $lc_align = 'right';
+            $lc_text = '&nbsp;' . $listing[$x]['products_quantity'] . '&nbsp;';
+            break;
+
+          case 'PRODUCT_LIST_WEIGHT':
+            $lc_align = 'right';
+            $lc_text = '&nbsp;' . $listing[$x]['products_weight'] . '&nbsp;';
+            break;
+
+          case 'PRODUCT_LIST_IMAGE':
+            $lc_align = 'center';
+            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&amp;products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
+            } else {
+              $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&amp;' : '') . 'products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>&nbsp;';
+            }
+            break;
+            case 'PRODUCT_LIST_DATE_EXPECTED':
+           //  $duedate= date( "M, d, Y", $listing[$x]['products_date_available'])
+              $duedate= str_replace("00:00:00", "" , $listing[$x]['products_date_available']);  
+                  $lc_align = 'center';
+                  $lc_text = '&nbsp;' .  $duedate . '&nbsp;';
+            break;
+            
+          // This change to the buy_now is backed out
+          // VJ product quantity begin 
+
+          case 'PRODUCT_LIST_BUY_NOW':
+            $lc_align = 'center';
+            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&amp;products_id=' . $listing[$x]['products_id'], 'SSL') . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+            break;
+        }
+        $product_contents[] = $lc_text;
+      }
+      
+/*      var_dump($product_contents);*/
+		
+      for ($cntr=0;$cntr<count($product_contents);$cntr++) {
+      	$product_contents[$cntr] = str_replace("&nbsp;",'',$product_contents[$cntr]);
+      }
+      
+     
+      $lc_text = '<table class="product_list_table_'.($column+1).'">';
+      $lc_text.= '<tr>';
+      $lc_text.= '<td class="product_list_col1">'.$product_contents[0].'</td>';
+      $lc_text.= '<td class="product_list_col2"><span class="plist_name">'.$product_contents[1].'</span><span class="plist_price">'.$product_contents[2].'</span><span class="plist_button">'.$product_contents[3].'</span></td></tr></table>';
+      
+      //$lc_text = implode('<br>', $product_contents);
+      
+      $list_box_contents[$row][$column] = array('align' => 'center',
+                                                'params' => 'class="productListing-data"',
+                                                'text'  => $lc_text);
+
+      $column ++;
+      if ($column >= COLUMN_COUNT) {
+        $row ++;
+        $column = 0;
+      }
+    }
+
+    new productListingBox($list_box_contents);
+  } else {
+    $list_box_contents = array();
+    $list_box_contents[0] = array('params' => 'class="productListing-odd"');
+    $list_box_contents[0][] = array('params' => 'class="productListing-data"',
+                                   'text' => TEXT_NO_PRODUCTS);
+    new productListingBox($list_box_contents);
+  }
+  if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="2" class="bottom_pagination_table">
+  <tr>
+    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
+    <td class="smallText" align="right">
+    	<?php   		
+    		$getcpath = isset($_GET['cPath']) ? $_GET['cPath'] : 0;
+    		
+    		$base_url = '?cPath='.$getcpath.'&amp;page=';
+    		
+			echo "<div class='pagination'>";
+    		
+			if ($current_page !=1) {
+				echo "<a href='".$base_url."1' class='pag_first'>First</a>";
+				echo "<a href='$base_url".($current_page-1)."' class='pag_previous'>Previous</a>";
+			} else {
+				echo "<a href='##' class='pag_first disabled'>First</a>";
+				echo "<a href='##' class='pag_previous disabled'>Previous</a>";
+			}
+			for ($x=1;$x<($total_pages+1);$x++) {
+				echo "<a href='$base_url".($x)."'";
+				if (($x-1)==$page) echo " class='selected'";
+				echo">$x</a>";
+			};
+			
+			if ($current_page != $total_pages) {
+				echo "<a href='$base_url".($current_page+1)."' class='pag_next'>Next</a>";
+				echo "<a href='$base_url".($total_pages)."' class='pag_last'>Last</a>";
+			} else {
+				echo "<a href='##' class='pag_next disabled'>Next</a>";
+				echo "<a href='##' class='pag_last disabled'>Last</a>";
+			}
+			
+			echo "</div>";
+		?>
+    </td>
+  </tr>
+</table>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMoko/modules/shipping_estimator.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/modules/shipping_estimator.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/modules/shipping_estimator.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,241 @@
+<?php
+/*
+  $Id: shipping_estimator.php,v 1.1.1.1 2004/03/04 23:41:12 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 Edwin Bekaert (edwin at ednique.com)
+
+  Customized by: Linda McGrath osCommerce at WebMakers.com
+  * This now handles Free Shipping for orders over $total as defined in the Admin
+  * This now shows Free Shipping on Virtual products
+  * Everything is contained in an infobox for easier placement.
+
+  Released under the GNU General Public License
+
+  http://forums.oscommerce.com/viewtopic.php?t=38411
+
+  http://www.oscommerce.com/community/contributions,1094
+*/
+?>
+<!-- shipping_estimator //-->
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
+          </tr>
+          <tr>
+            <td align="<?php echo (strstr($PHP_SELF,'shipping_estimator.php') ? 'right' : 'center'); ?>">
+              <table width="100%" class="cart_shipping_estimator"><tr><td>
+
+<?php
+// Only do when something is in the cart
+if ($cart->count_contents() > 0) {
+
+// Could be placed in english.php
+// shopping cart quotes
+ 
+  // shipping cost
+  require('includes/classes/http_client.php'); // shipping in basket
+ require(DIR_WS_LANGUAGES . $language . '/modules/shipping_estimator.php');
+
+  if($cart->get_content_type() !== 'virtual') {
+    if (tep_session_is_registered('customer_id')) {
+      // user is logged in
+      if (isset($HTTP_POST_VARS['address_id'])){
+        // user changed address
+        $sendto = $HTTP_POST_VARS['address_id'];
+      }elseif (tep_session_is_registered('cart_address_id')){
+        // user once changed address
+        $sendto = $cart_address_id;
+      }else{
+        // first timer
+        $sendto = $customer_default_address_id;
+      }
+      // set session now
+      $cart_address_id = $sendto;
+      tep_session_register('cart_address_id');
+      // include the order class (uses the sendto !)
+      require(DIR_WS_CLASSES . 'order.php');
+      $order = new order;
+    }else{
+      // user not logged in !
+      if (isset($HTTP_POST_VARS['country_id'])){
+        // country is selected
+        $country_info = tep_get_countries($HTTP_POST_VARS['country_id'],true);
+        $order->delivery = array('postcode' => $HTTP_POST_VARS['zip_code'],
+                                 'country' => array('id' => $HTTP_POST_VARS['country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
+                                 'country_id' => $HTTP_POST_VARS['country_id'],
+                                 'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id']));
+        $cart_country_id = $HTTP_POST_VARS['country_id'];
+        tep_session_register('cart_country_id');
+        $cart_zip_code = $HTTP_POST_VARS['zip_code'];
+        tep_session_register('cart_zip_code');
+      }elseif (tep_session_is_registered('cart_country_id')){
+        // session is available
+        $country_info = tep_get_countries($cart_country_id,true);
+        $order->delivery = array('postcode' => $cart_zip_code,
+                                 'country' => array('id' => $cart_country_id, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
+                                 'country_id' => $cart_country_id,
+                                 'format_id' => tep_get_address_format_id($cart_country_id));
+      } else {
+        // first timer
+        $cart_country_id = STORE_COUNTRY;
+        tep_session_register('cart_country_id');
+// WebMakers.com Added: changes
+// changed from STORE_ORIGIN_ZIP to SHIPPING_ORIGIN_ZIP
+        $cart_zip_code = SHIPPING_ORIGIN_ZIP;
+        $country_info = tep_get_countries(STORE_COUNTRY,true);
+        tep_session_register('cart_zip_code');
+        $order->delivery = array('postcode' => SHIPPING_ORIGIN_ZIP,
+                                 'country' => array('id' => STORE_COUNTRY, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
+                                 'country_id' => STORE_COUNTRY,
+                                 'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id']));
+      }
+      // set the cost to be able to calvculate free shipping
+      $order->info = array('total' => $cart->show_total()); // TAX ????
+    }
+    // weight and count needed for shipping !
+    $total_weight = $cart->show_weight();
+    $total_count = $cart->count_contents();
+    require(DIR_WS_CLASSES . 'shipping.php');
+    $shipping_modules = new shipping;
+    $quotes = $shipping_modules->quote();
+    $cheapest = $shipping_modules->cheapest();
+    // set selections for displaying
+    $selected_country = $order->delivery['country']['id'];
+    $selected_zip = $order->delivery['postcode'];
+    $selected_address = $sendto;
+  }
+    // eo shipping cost
+
+  //$info_box_contents = array();
+  //$info_box_contents[] = array('text' => SHIPPING_OPTIONS, 'class="estimator_title"');
+  echo "<div class='estimator_title'>".SHIPPING_OPTIONS."</div>";
+
+  //new infoBoxHeading($info_box_contents, false, false);
+
+// check free shipping based on order $total
+  if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
+    switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
+      case 'national':
+        if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
+      case 'international':
+        if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
+      case 'both':
+        $pass = true; break;
+      default:
+        $pass = false; break;
+    }
+    $free_shipping = false;
+    if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
+      $free_shipping = true;
+      include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
+    }
+  } else {
+    $free_shipping = false;
+  }
+// end free shipping based on order total
+//  $ShipTxt= tep_draw_form('estimator', tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'), 'post'); //'onSubmit="return check_form();"'
+  $ShipTxt= tep_draw_form('estimator', tep_href_link(basename($PHP_SELF), '', 'SSL'), 'post'); //'onSubmit="return check_form();"'
+  $ShipTxt.='<table width="100%">';
+  if(sizeof($quotes)) {
+    if (tep_session_is_registered('customer_id')) {
+      // logged in
+      $addresses_query = tep_db_query("select address_book_id, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
+      while ($addresses = tep_db_fetch_array($addresses_query)) {
+        $addresses_array[] = array('id' => $addresses['address_book_id'], 'text' => tep_address_format(tep_get_address_format_id($addresses['country_id']), $addresses, 0, ' ', ' '));
+      }
+      $ShipTxt.='<tr><td colspan="3" class="main">' . ($total_count == 1 ?  SHIPPING_METHOD_ITEM  :  SHIPPING_METHOD_ITEMS) . $total_count . '&nbsp;-&nbsp;' . SHIPPING_METHOD_WEIGHT . $total_weight . SHIPPING_METHOD_WEIGHT_UNIT . '</td></tr>';
+      $ShipTxt.='<tr><td colspan="3" class="main" nowrap>' .
+                SHIPPING_METHOD_ADDRESS .'&nbsp;'. tep_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="document.estimator.submit();return false;"').'</td></tr>';
+      $ShipTxt.='<tr valign="top"><td class="main">' . SHIPPING_METHOD_TO .'</td><td colspan="2" class="main">'. tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>') . '</td></tr>';
+    } else {
+      // not logged in
+   if (strstr($PHP_SELF,'shopping_cart.php')) {     
+      $SHIPPING_OPTIONS_LOGIN = SHIPPING_OPTIONS_LOGIN_A ;
+      }else{
+      $SHIPPING_OPTIONS_LOGIN = SHIPPING_OPTIONS_LOGIN_B ;
+      }
+      
+      $ShipTxt.=tep_output_warning($SHIPPING_OPTIONS_LOGIN);
+      $ShipTxt.='<tr><td colspan="3" class="main">' . ($total_count == 1 ?  SHIPPING_METHOD_ITEM :  SHIPPING_METHOD_ITEMS ) . $total_count . '&nbsp;-&nbsp;' . SHIPPING_METHOD_WEIGHT  . $total_weight . SHIPPING_METHOD_WEIGHT_UNIT . '</td></tr>';
+      $ShipTxt.='<tr><td colspan="3" class="main" nowrap>' .
+                ENTRY_COUNTRY .'&nbsp;'. tep_get_country_list('country_id', $selected_country,'style="width=200;"');
+      if(SHIPPING_METHOD_ZIP_REQUIRED == "true"){
+        $ShipTxt.='</td></tr>          <tr>
+            <td colspan="3" class="main" nowrap>' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td>
+          </tr><tr><td colspan="3" class="main" nowrap>'.ENTRY_POST_CODE .'&nbsp;'. tep_draw_input_field('zip_code', $selected_zip, 'size="10"');
+      }
+      $ShipTxt.='&nbsp;<a href="_" onclick="document.estimator.submit();return false;">' . SHIPPING_METHOD_RECALCULATE.'</a></td></tr>';
+    }
+    if ($free_shipping==1) {
+      // order $total is free
+      $ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
+      $ShipTxt.='<tr><td>&nbsp;</td><td class="main">' . sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . '</td><td>&nbsp;</td></tr>';
+    }else{
+      // shipping display
+      $ShipTxt.='<tr><td class="main" align="left" colspan="2" style="padding-top: 10px"><b>' . SHIPPING_METHOD_TEXT . '</b></td><td class="main" align="right" style="padding-top: 10px"><b style="display:none">' . SHIPPING_METHOD_RATES . '</b></td></tr>';
+      $ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
+      for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
+        if(sizeof($quotes[$i]['methods'])==1){
+          // simple shipping method
+          $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][0]['id'];
+          $ShipTxt.= '<tr class="'.$extra.'">';
+          //$ShipTxt.='<td class="main">'.$quotes[$i]['icon'].'&nbsp;</td>';
+          if($quotes[$i]['error']){
+            $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].'&nbsp;';
+            $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
+          }else{
+            if($cheapest['id'] == $thisquoteid){
+              $ShipTxt.='<td class="main"><b>'.$quotes[$i]['module'].'&nbsp;';
+              $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</b></td><td align="right" class="main"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'<b></td></tr>';
+            }else{
+              $ShipTxt.='<td class="main">'.$quotes[$i]['module'].'&nbsp;';
+              $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</td><td align="right" class="main">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'</td></tr>';
+            }
+          }
+        } else {
+          // shipping method with sub methods (multipickup)
+          for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
+            $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'];
+            $ShipTxt.= '<tr class="'.$extra.'">';
+            $ShipTxt.='<td class="main">'.$quotes[$i]['icon'].'&nbsp;</td>';
+            if($quotes[$i]['error']){
+              $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].'&nbsp;';
+              $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
+            }else{
+              if($cheapest['id'] == $thisquoteid){
+                $ShipTxt.='<td class="main"><b>'.$quotes[$i]['module'].'&nbsp;';
+                $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</b></td><td align="right" class="main"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</b></td></tr>';
+              }else{
+                $ShipTxt.='<td class="main">'.$quotes[$i]['module'].'&nbsp;';
+                $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</td><td align="right" class="main">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</td></tr>';
+              }
+            }
+          }
+        }
+      }
+    }
+  } else {
+    // virtual product/download
+    $ShipTxt.='<tr><td class="main">' . SHIPPING_METHOD_FREE_TEXT . ' ' . SHIPPING_METHOD_ALL_DOWNLOADS . '</td></tr>';
+  }
+
+  $ShipTxt.= '</table></form>';
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $ShipTxt);
+
+  new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+} // Only do when something is in the cart
+?>
+              </td></tr></table>
+            </td>
+          </tr>
+<!-- shipping_estimator_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMoko/product_info.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/product_info.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/product_info.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,473 @@
+    <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php  
+if ($product_check['total'] < 1) {
+?>
+      <tr>
+        <td><?php  new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'SSL') . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+} else {
+	// BOF MaxiDVD: Modified For Ultimate Images Pack!
+	$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
+	// EOF MaxiDVD: Modified For Ultimate Images Pack!
+	$product_info = tep_db_fetch_array($product_info_query);
+
+	tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
+
+	if (tep_not_null($product_info['products_model'])) {
+		$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
+	} else {
+		$products_name = $product_info['products_name'];
+	}
+	if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
+		$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
+	} else {
+		$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
+	}
+
+	// BOF: WebMakers.com Added: Show Featured Products
+	if (SHOW_HEADING_TITLE_ORIGINAL=='yes') {
+		$header_text = '&nbsp;';
+?>
+      <tr>
+        <td>
+        <table border="0" width="100%" cellspacing="0" cellpadding="0" class="productTableTitle" >
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
+            <td class="pageHeading" align="right" valign="top"><?php 
+
+            if ($product_has_sub > '0'){
+            }else{
+            	echo $products_price;
+            }
+             ?>
+             </td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+	} else {
+  ?>
+  </tr><tr>
+  <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr> <td class="infoBoxContents"><?php echo  $products_name ;?>  </td>
+  <td align="right" class="infoBoxContents"><nobr><?php echo $products_price ;?></nobr>
+  </td></td></tr></table><td>
+  <?php
+	}
+
+	// BOF: Lango Added for template MOD
+	if (MAIN_TABLE_BORDER == 'yes'){
+		table_image_border_top(false, false, $header_text);
+	} else {
+		echo $header_text ;
+	}
+	// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="main"><table width="100%" border="0" cellspacing="0" cellpadding="2" class="productTableBody">
+          <tr>
+            <td class="main productContainer" valign="top">
+            <!-- product container -->
+              <h2 class="productName"><?php echo $products_name; ?></h2>
+              <?php echo stripslashes($product_info['products_description']); ?>
+              <div class="productPrice">Total: <span><?php 
+
+            if ($product_has_sub > '0'){
+            }else{
+            	echo $products_price;
+            }
+             ?></span></div>
+            </td>
+<?php
+if (tep_not_null($product_info['products_image'])) {
+?>
+            <td align="right" class="smallText" valign="top">
+              <table border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td>
+
+<!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //-->
+<?php
+if ($product_info['products_image_med']!='') {
+	$new_image = $product_info['products_image_med'];
+	$image_width = MEDIUM_IMAGE_WIDTH;
+	$image_height = MEDIUM_IMAGE_HEIGHT;
+} else {
+	$new_image = $product_info['products_image'];
+	$image_width = SMALL_IMAGE_WIDTH;
+	$image_height = SMALL_IMAGE_HEIGHT;
+}
+echo tep_javascript_image(DIR_WS_IMAGES . $new_image, 'product' . $product_info['products_id'], addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"', 'true');
+?>
+<!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! //-->
+<!-- // BEGIN  Affiliate program mods for 2.5a upgrade DMG  -->
+            <br><br>
+<?php
+//affiliate build a link begin
+/*  if (tep_session_is_registered('affiliate_id')) {
+echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD, 'individual_banner_id=' . $product_info['products_id'], 'SSL') .'" target="_self">' . tep_image('includes/languages/english/images/buttons/button_affiliate_build_a_link.gif', 'Make a link') . ' </a>'; ?><?php
+}*/
+
+if (tep_session_is_registered('affiliate_id')) {
+	echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD, 'individual_banner_id=' . $product_info['products_id'], 'SSL') .'" target="_self">' . tep_image('includes/languages/english/images/buttons/button_affiliate_build_a_link.gif', LINK_ALT) . ' </a>'; ?><?php
+}
+//affiliate build a link begin
+?>
+<!-- // EOF Affiliate program 2.5a upgrade mods DMG -->
+                  </td>
+                </tr>
+              </table>
+            </td>
+<?php
+}
+?>
+          </tr>
+          <tr>
+            <td colspan="2">
+<?php
+$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' ");
+$products_attributes = tep_db_fetch_array($products_attributes_query);
+if ($products_attributes['total'] > 0) {
+?>
+              <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                <tr>
+                  <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
+                </tr>
+<?php
+$products_options_query = tep_db_query("select pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, po.options_type, po.options_length, pot.products_options_name, pot.products_options_instruct from
+           " . TABLE_PRODUCTS_ATTRIBUTES  . " AS pa, 
+           " . TABLE_PRODUCTS_OPTIONS  . " AS po,
+           " . TABLE_PRODUCTS_OPTIONS_TEXT  . " AS pot
+           where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'
+             and pa.options_id = po.products_options_id
+             and po.products_options_id = pot.products_options_text_id and pot.language_id = '" . (int)$languages_id . "'
+           order by pa.products_options_sort_order
+           ");
+
+// Store the information from the tables in arrays for easy of processing
+$options = array();
+$options_values = array();
+while ($po = tep_db_fetch_array($products_options_query)) {
+	//  we need to find the values name
+	if ( $po['options_type'] != 1  && $po['options_type'] != 4 ) {
+		$options_values_query = tep_db_query("select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id ='". $po['options_values_id'] . "' and language_id = '" . (int)$languages_id . "'");
+		$ov = tep_db_fetch_array($options_values_query);
+	} else {
+		$ov['products_options_values_name'] = '';
+	}
+	$options[$po['options_id']] = array('name' => $po['products_options_name'], 'type' => $po['options_type'], 'length' => $po['options_length'], 'instructions' => $po['products_options_instruct']);
+	$options_values[$po['options_id']][$po['options_values_id']] =  array('name' => stripslashes($ov['products_options_values_name']), 'price' => $po['options_values_price'], 'prefix' => $po['price_prefix']);
+}
+
+foreach ($options as $oID => $op_data) {
+	switch ($op_data['type']) {
+
+		case 1:
+			$maxlength = ( $op_data['length'] > 0 ? ' maxlength="' . $op_data['length'] . '"' : '' );
+			$tmp_html = '<input type="text" name="id[' . $oID . '][t]"' . $maxlength . ' />';
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+              break;
+
+		case 4:
+			$text_area_array = explode(';',$op_data['length']);
+			$cols = $text_area_array[0];
+			if ( $cols == '' ) $cols = '100%';
+			$rows = $text_area_array[1];
+			$tmp_html = '<textarea name="id[' . $oID . '][t]" rows="'.$rows.'" cols="'.$cols.'" wrap="virtual"></textarea>';
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main" align="center"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+              break;
+
+		case 2:
+			$tmp_html = '';
+			foreach ( $options_values[$oID] as $vID => $ov_data ) {
+				if ( (float)$ov_data['price'] == 0 ) {
+					$price = '&nbsp;';
+				} else {
+					$price = '(&nbsp;' . $ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate) . '&nbsp;)';
+				}
+				$tmp_html .= '<input type="radio" name="id[' . $oID . ']" value="' . $vID . '">' . $ov_data['name'] . '&nbsp;' . $price . '<br />';
+			} // End of the for loop on the option value
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+              break;
+
+		case 3:
+			$tmp_html = '';
+			$i = 0;
+			foreach ( $options_values[$oID] as $vID => $ov_data ) {
+				if ( (float)$ov_data['price'] == 0 ) {
+					$price = '&nbsp;';
+				} else {
+					$price = '(&nbsp;'.$ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate).'&nbsp;)';
+				}
+				$tmp_html .= '<input type="checkbox" name="id[' . $oID . '][c][' . $i . ']" value="' . $vID . '">' . $ov_data['name'] . '&nbsp;' . $price . '<br />';
+				$i++;
+			}
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+              break;
+
+		case 0:
+			$tmp_html = '<select name="id[' . $oID . ']">';
+			foreach ( $options_values[$oID] as $vID => $ov_data ) {
+				if ( (float)$ov_data['price'] == 0 ) {
+					$price = '&nbsp;';
+				} else {
+					$price = '(&nbsp; '.$ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate).'&nbsp;)';
+				}
+				$tmp_html .= '<option value="' . $vID . '">' . $ov_data['name'] . '&nbsp;' . $price .'</option>';
+			} // End of the for loop on the option values
+			$tmp_html .= '</select>';
+?>
+            <tr>
+              <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+              <td class="main"><?php echo $tmp_html;  ?></td>
+            </tr>
+<?php
+break;
+	}  //end of switch
+} //end of while
+?>
+              </table>    
+<?php
+} // end of ($products_attributes['total'] > 0)
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') { include(DIR_WS_MODULES . 'additional_images.php'); }
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+ ?>
+<?php
+$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+$reviews = tep_db_fetch_array($reviews_query);
+if ($reviews['count'] > 0) {
+?>
+      <tr>
+        <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
+      </tr>
+<?php
+}
+// Extra Products Fields are checked and presented
+// START: Extra Fields Contribution  DMG
+$extra_fields_query = tep_db_query("SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
+                                        FROM ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf,
+                                             ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
+                                        WHERE ptf.products_id='".(int)$HTTP_GET_VARS['products_id']."' 
+                                          and ptf.products_extra_fields_value <> ''
+                                          and ptf.products_extra_fields_id = pef.products_extra_fields_id
+                                          and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
+                                        ORDER BY products_extra_fields_order");
+if ( tep_db_num_rows($extra_fields_query) > 0 ) {
+?>
+      <tr>
+        <td class="main"><table border="0" cellspacing="1" cellpadding="2">
+<?php
+while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
+	if (! $extra_fields['status'])  // show only enabled extra field
+	continue;
+?>
+          <tr>
+            <td class="main" valign="top"><b><?php echo $extra_fields['name']; ?>:&nbsp;</b></td>
+            <td class="main" valign="top"><?php echo $extra_fields['value']; ?></td>
+          </tr>
+<?php
+}
+?>
+        </table></td>
+      </tr>
+<?php
+}
+// END: Extra Fields Contribution
+if (tep_not_null($product_info['products_url'])) {
+?>
+      <tr>
+        <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&amp;goto=' . urlencode($product_info['products_url']), 'SSL', true, false)); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}
+
+if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
+?>
+      <tr>
+        <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
+      </tr>
+<?php
+} else {
+?>
+      <tr style="display:none">
+        <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
+      </tr>
+  <?php
+}
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+	table_image_border_bottom(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+// get sort order
+
+$csort_order = tep_db_fetch_array(tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'CATEGORIES_SORT_ORDER'"));
+
+$select_order_by = '';
+switch ($csort_order['configuration_value']) {
+	case 'PRODUCT_LIST_MODEL':
+		$select_order_by .= 'p.products_model';
+		break;
+	case 'PRODUCT_LIST_NAME':
+		$select_order_by .= 'pd.products_name';
+		break;
+		//commented out - do subproducts have different manufacturers?
+		//      case 'PRODUCT_LIST_MANUFACTURER':
+		//          $select_order_by .= 'm.manufacturers_name, ';
+		//          break;
+	case 'PRODUCT_LIST_PRICE':
+		$select_order_by .= 'p.products_price';
+		break;
+	default:
+		$select_order_by .= 'p.products_model';
+		break;
+}
+
+$sub_products_sql = tep_db_query("select p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_parent_id = " . (int)$HTTP_GET_VARS['products_id'] . " ".$allowcriteria." and p.products_id = pd.products_id and pd.language_id = " . (int)$languages_id . " order by " . $select_order_by);
+
+if (tep_db_num_rows($sub_products_sql) > 0) {
+	// BOF: Lango Added for template MOD
+	if (MAIN_TABLE_BORDER == 'yes'){
+		table_image_border_top(false, false, $header_text);
+	}
+	// EOF: Lango Added for template MOD
+  ?>
+  <tr>
+    <td><table border="0" cellpadding="0" cellspacing="2" width="100%" align="center">
+      <tr>
+        <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <?php
+      while ($sub_products = tep_db_fetch_array($sub_products_sql)) {
+      	$subname = substr( $sub_products['products_name'], strlen( $product_info['products_name'] . ' - ' ));
+      	if ($new_sub_price = tep_get_products_special_price($sub_products['products_id'])) {
+      		$sub_products_price = '<s>' . $currencies->display_price($sub_products['products_price'], tep_get_tax_rate($sub_products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_sub_price, tep_get_tax_rate($sub_products['products_tax_class_id'])) . '</span>';
+      	} else {
+      		$sub_products_price = $currencies->display_price($sub_products['products_price'], tep_get_tax_rate($sub_products['products_tax_class_id']));
+      	}
+          ?>
+          <tr align="center">
+            <td class="productListing-data"><?php if ($sub_products['products_image']) echo tep_image(DIR_WS_IMAGES . $sub_products['products_image'], $subname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT,'vspace="2" hspace="2"'); ?></td>
+            <td class="productListing-data"><b><?php echo $subname; ?></b>&nbsp;[<?php echo $sub_products['products_model']; ?>]</td>
+            <td class="productListing-data"><?php echo $sub_products_price; ?></td>
+            <td class="productListing-data">Quantity : <?php echo tep_draw_input_field('sub_products_qty[]', '0', 'size="5"') . tep_draw_hidden_field('sub_products_id[]', $sub_products['products_id']);;?></td>
+        </tr>
+        <?php
+      }
+      ?>
+    </table></td>
+  </tr>
+  <?php  
+  // BOF: Lango Added for template MOD
+  if (MAIN_TABLE_BORDER == 'yes'){
+  	table_image_border_bottom();
+  }
+  // EOF: Lango Added for template MOD
+}
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td>
+            	<table border="0" width="100%" cellspacing="0" cellpadding="2" class="productTablePurchase">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(), 'SSL') . '">' . tep_template_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS,'align="absmiddle"') . '</a>'; ?></td>
+                <!-- Begin Wishlist Code -->
+                <?php 
+                if (DESIGN_BUTTON_WISHLIST == 'true') {
+                	echo '<td align="right" class="main" valign="middle">';
+                	if( (!tep_session_is_registered('customer_id')) || (!tep_session_is_registered('SESSION_WISHLIST')) ){
+                		$SESSION_WISHLIST = $product_info['products_id'];
+                		tep_session_register('SESSION_WISHLIST');
+                	}
+                	echo '<a href="javascript:document.cart_quantity.action=\'' . tep_href_link(FILENAME_PRODUCT_INFO, 'action=add_wishlist', 'SSL') . '\'; document.cart_quantity.submit();">' . tep_template_image_button('button_add_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST,'align="absmiddle"') . '</a>' ;
+                	echo '</td>';
+                }
+                ?>
+                <!-- End Wishlist Code -->
+                   <td class="main" align="right" valign="middle">
+                <?php
+                if (tep_db_num_rows($sub_products_sql) ==0) {
+                	echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', '1', 'size="6" class="quantity_input"');
+                }
+                echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_template_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absmiddle"');
+                ?>
+              </form></td>
+              <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+            </tr>
+            </table>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+if ( (USE_CACHE == 'true') && !SID) {
+	echo tep_cache_also_purchased(3600);
+	include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
+} else {
+	include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS_BUYNOW);
+	echo tep_draw_separator('pixel_trans.gif', '100%', '10');
+	include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
+
+}
+}
+?>
+       </td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/product_reviews.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/product_reviews.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/product_reviews.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,164 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;' ;
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
+            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = $products_name . '&nbsp;&nbsp;&nbsp;&nbsp;' . $products_price;
+}
+?>
+
+<?php
+  $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 400) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id desc";
+  $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
+
+  if ($reviews_split->number_of_rows > 0) {
+    if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
+?>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                    <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+    }
+    $reviews_query = tep_db_query($reviews_split->sql_query);
+    while ($reviews = tep_db_fetch_array($reviews_query)) {
+?>
+         <tr>
+            <td>
+				<div class="reviewRating"><?php echo sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])); ?></div>
+            	<div class="reviewTitle"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&amp;reviews_id=' . $reviews['reviews_id'], 'SSL') . '"><b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</b></a>'; ?></div>
+            	<div class="reviewExcerpt">
+            		<?php echo tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br>') . ((strlen($reviews['reviews_text']) >= 100) ? '...' : ''); ?>
+            	</div>
+				<div class="reviewAdded"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])); ?></div>
+            </td>
+          </tr>
+<?php } ?>
+
+<?php
+  } else {
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+              <tr>
+                <td align="center" class="infoboxContents"><?php echo TEXT_NO_REVIEWS; ?></td>
+              </tr>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  }
+  if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                    <td align="right" class="smallText">
+                    	<?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?>
+                    </td>
+                  </tr>
+                </table></td>
+              </tr>
+              
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              
+              <tr>
+	            <td class="review_product_box">
+	            <table style="margin: auto">
+	            	<tr>
+	            		<td style="text-align: right; padding-right: 40px;">
+	<?php
+	  if (tep_not_null($product_info['products_image'])) {
+	  	echo '<a onclick="popupWindow(\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'], 'SSL') . '\'); return false" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image'], '', 'SSL') . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>';
+	  }
+	?>
+	            		</td>
+	            		<td>
+	<?php
+			
+			echo '<div class="review_addtocart"><a class="review_addtocart" href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now', '', 'SSL') . '">' . tep_template_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></div>';
+	
+	//wishlist button
+	  $wishlist_id_query = tep_db_query('select products_id as wPID from ' . TABLE_WISHLIST . ' where products_id= ' . $product_info['products_id'] . ' and customers_id = ' . (int)$customer_id . ' order by products_name');
+	  $wishlist_Pid = tep_db_fetch_array($wishlist_id_query);
+	
+	echo '<div class="review_addtocart"><form name="wishlist_quantity" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_wishlist', 'SSL') . '">';
+	echo '                    <input type="hidden" name="products_id" value="' . $product_info['products_id'] . '">
+	                          <input type="hidden" name="products_model" value="' . $product_info['products_model'] . '">
+	                          <input type="hidden" name="products_name" value="' . $product_info['products_name'] . '">
+	                          <input type="hidden" name="products_price" value="' . $product_info['products_price'] . '">
+	                          <input type="hidden" name="final_price" value="' . $product_info['final_price'] . '">
+	                          <input type="hidden" name="products_tax" value="' . $product_info['products_tax'] . '">';
+	
+	if ( (!tep_not_null($wishlist_Pid[wPID])) && (tep_session_is_registered('customer_id')) )  echo tep_template_image_submit('button_add_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST);
+	echo  '
+	                        </form></div>';
+	?>
+	            		</td>
+	            	</tr>
+	            </table>
+	            </td>
+              </tr>
+              
+
+              <tr>
+                <td><?php //echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(), 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                        <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params(), 'SSL') . '">' . tep_template_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                     </table></td>
+                  </tr>
+                 </table></td>
+              </tr>
+   </table>

Added: trunk/direct.openmoko.com/templates/OpenMoko/product_reviews_info.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/product_reviews_info.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/product_reviews_info.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,121 @@
+<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product', 'SSL')); ?>
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
+            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = $products_name . '&nbsp;&nbsp;&nbsp;&nbsp;' . $products_price;
+}
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" style="margin-right: 15px;">
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main review_header"><?php echo '<b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews_info['customers_name'])) . '</b>'; ?></td>
+                    <td class="smallText review_header review_header_date" align="right"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews_info['date_added'])); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td valign="top" class="main reviewMain"><?php echo tep_break_string(nl2br(tep_output_string_protected($reviews_info['reviews_text'])), 60, '-<br>') . '<br><br><b>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews_info['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews_info['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews_info['reviews_rating'])).'</b>'; ?></td>
+                        <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+                </table>
+                </td>
+              </tr>
+              
+              
+            </table></td>
+            
+          
+            <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" align="right" valign="top"><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td align="center" class="smallText">
+                <?php
+                  if (tep_not_null($reviews_info['products_image'])) {
+                  ?>
+                    <script language="javascript"><!--
+                      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $reviews_info['products_id'], 'SSL') . '\\\')">' . tep_image(DIR_WS_IMAGES . $reviews_info['products_image'], addslashes($reviews_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
+                    //--></script>
+                    <noscript>
+                      <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $reviews_info['products_image'], '', 'SSL') . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $reviews_info['products_image'], $reviews_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
+                    </noscript>
+                  <?php
+                  }
+                  echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now', 'SSL') . '">' . tep_template_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>';
+                  // Begin Wishlist Code 
+                  if (DESIGN_BUTTON_WISHLIST == 'true') {                   
+                    if( (!tep_session_is_registered('customer_id')) || (!tep_session_is_registered('SESSION_WISHLIST')) ){
+                      $SESSION_WISHLIST = $reviews_info['products_id'];
+                      tep_session_register('SESSION_WISHLIST');
+                    }
+                    echo '<p><a href="javascript:document.cart_quantity.action=\'' . tep_href_link(basename(FILENAME_PRODUCT_INFO), 'action=add_wishlist', 'SSL') . '\'; document.cart_quantity.submit();">' . tep_template_image_button('button_add_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST,'align="absmiddle"') . '</a>' ;
+                  }         
+                  // End Wishlist Code
+                  echo  '</form></p>';
+                ?>
+                </td>
+              </tr>
+              
+            </table>
+          </td>
+        </table></td>
+      </tr>
+      
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo '<a href="javascript:history.go(-1)">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                        <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params(array('reviews_id')), 'SSL') . '">' . tep_template_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/OpenMoko/shopping_cart.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/shopping_cart.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/shopping_cart.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,383 @@
+    <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_cart.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text =  HEADING_TITLE;
+}
+?>
+
+<?php 
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+?>
+<?php
+  if ($cart->count_contents() > 0) {
+?>
+      <tr>
+        <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[0][] = array('align' => 'center',
+                                    'params' => 'class="productListing-heading"',
+                                    'text' => TABLE_HEADING_REMOVE);
+
+    $info_box_contents[0][] = array('params' => 'class="productListing-heading"',
+                                    'text' => TABLE_HEADING_PRODUCTS);
+
+    $info_box_contents[0][] = array('align' => 'center',
+                                    'params' => 'class="productListing-heading"',
+                                    'text' => TABLE_HEADING_QUANTITY);
+
+    $info_box_contents[0][] = array('align' => 'right',
+                                    'params' => 'class="productListing-heading"',
+                                    'text' => TABLE_HEADING_TOTAL);
+
+    $any_out_of_stock = 0;
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+// Push all attributes information in an array
+      if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
+        while (list($option, $value) = each($products[$i]['attributes'])) {
+          /*  replace the atrribute handling
+          echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
+  
+          $attributes_query = tep_db_query("select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
+            from " . TABLE_PRODUCTS_OPTIONS . " popt,
+            " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
+            " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,
+            " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
+            where 
+            pa.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+            and pa.options_id = '" . (int)$option . "' 
+            and pa.options_values_id = '" . $value . "'
+            and poval.products_options_values_id = pa.options_values_id
+            and poptt.products_options_text_id = pa.options_id
+            and poptt.language_id = '" . (int)$languages_id . "'
+            and poval.language_id = '" . (int)$languages_id . "'");
+            
+            
+            $attributes_values = tep_db_fetch_array($attributes_query);
+
+
+          $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
+          $products[$i][$option]['options_values_id'] = $value;
+          $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
+          $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
+          $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
+          */
+          
+          if ( ! is_array($value) ) {
+            $attributes = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, ov.products_options_values_name, op.options_values_price, op.price_prefix
+                                        from " . TABLE_PRODUCTS_ATTRIBUTES . " op,   
+                                             " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov, 
+                                             " . TABLE_PRODUCTS_OPTIONS . " o,
+                                             " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot 
+                                        where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                          and op.options_values_id = '" . $value . "'
+                                          and op.options_id = '" . $option . "'
+                                          and ov.products_options_values_id = op.options_values_id
+                                          and ov.language_id = '" . (int)$languages_id . "'
+                                          and o.products_options_id = op.options_id
+                                          and ot.products_options_text_id = o.products_options_id
+                                          and ot.language_id = '" . (int)$languages_id . "'
+                                       ");
+            $attributes_values = tep_db_fetch_array($attributes);
+          
+            $products[$i][$option][$value]['products_options_name'] = $attributes_values['products_options_name'];
+            $products[$i][$option][$value]['options_values_id'] = $value;
+            $products[$i][$option][$value]['products_options_values_name'] = $attributes_values['products_options_values_name'];
+            $products[$i][$option][$value]['options_values_price'] = $attributes_values['options_values_price'];
+            $products[$i][$option][$value]['price_prefix'] = $attributes_values['price_prefix'];
+            
+          } elseif ( isset($value['c'] ) ) {
+            foreach ($value['c'] as $v) {
+                $attributes = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, ov.products_options_values_name, op.options_values_price, op.price_prefix
+                                            from " . TABLE_PRODUCTS_ATTRIBUTES . " op,   
+                                                 " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov, 
+                                                 " . TABLE_PRODUCTS_OPTIONS . " o,
+                                                 " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot 
+                                            where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                              and op.options_values_id = '" . $v . "'
+                                              and op.options_id = '" . $option . "'
+                                              and ov.products_options_values_id = op.options_values_id
+                                              and ov.language_id = '" . (int)$languages_id . "'
+                                              and o.products_options_id = op.options_id
+                                              and ot.products_options_text_id = o.products_options_id
+                                              and ot.language_id = '" . (int)$languages_id . "'
+                                           ");
+              $attributes_values = tep_db_fetch_array($attributes);
+          
+              $products[$i][$option][$v]['products_options_name'] = $attributes_values['products_options_name'];
+              $products[$i][$option][$v]['options_values_id'] = $v;
+              $products[$i][$option][$v]['products_options_values_name'] = $attributes_values['products_options_values_name'];
+              $products[$i][$option][$v]['options_values_price'] = $attributes_values['options_values_price'];
+              $products[$i][$option][$v]['price_prefix'] = $attributes_values['price_prefix'];
+            }
+            
+          } elseif ( isset($value['t'] ) ) {
+            $attributes = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, op.options_values_price, op.price_prefix
+                                        from " . TABLE_PRODUCTS_ATTRIBUTES . " op,   
+                                             " . TABLE_PRODUCTS_OPTIONS . " o,
+                                             " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot
+                                        where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                          and op.options_id = '" . $option . "'
+                                          and o.products_options_id = op.options_id
+                                          and ot.products_options_text_id = o.products_options_id
+                                          and ot.language_id = '" . (int)$languages_id . "'
+                                       ");
+            $attributes_values = tep_db_fetch_array($attributes);
+          
+            $products[$i][$option]['t']['products_options_name'] = $attributes_values['products_options_name'];
+            $products[$i][$option]['t']['options_values_id'] = '0';
+            $products[$i][$option]['t']['products_options_values_name'] = $value['t'];
+            $products[$i][$option]['t']['options_values_price'] = $attributes_values['options_values_price'];
+            $products[$i][$option]['t']['price_prefix'] = $attributes_values['price_prefix'];
+            
+          }
+
+        }
+      }
+    }
+
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      if (($i/2) == floor($i/2)) {
+        $info_box_contents[] = array('params' => 'class="productListing-even"');
+      } else {
+        $info_box_contents[] = array('params' => 'class="productListing-odd"');
+      }
+
+      $cur_row = sizeof($info_box_contents) - 1;
+
+      $info_box_contents[$cur_row][] = array('align' => 'center',
+                                             'params' => 'class="productListing-data cart_delete_col" valign="top"',
+                                             'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+    $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
+    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
+    if ((int)$products_parent_id['products_parent_id'] != 0) {
+    echo DIR_WS_IMAGES . $products[$i]['image'].'aaaaaaaaaaaa';
+    $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
+                       '  <tr>' .
+                       '    <td class="productListing-data cartlisting cartimage" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
+                       '    <td class="productListing-data cartlisting" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id'], 'SSL') . '"><b>' . $products[$i]['name'] . '</b></a>';
+    } else {
+    	
+    list($iwidth) = getimagesize(DIR_WS_IMAGES . $products[$i]['image']);
+    
+    if ($iwidth > 145) { 
+    	$tmp_w = 145;
+    	$tmp_h = '';
+    }
+    else {
+    	$tmp_w = SMALL_IMAGE_WIDTH;
+    	$tmp_h = SMALL_IMAGE_HEIGHT;
+    }
+    
+    $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
+                       '  <tr>' .
+                       '    <td class="productListing-data cartlisting cartimage" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], $tmp_w, $tmp_h) . '</a></td>' .
+                       '    <td class="productListing-data cartlisting" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'], 'SSL') . '"><b>' . $products[$i]['name'] . '</b></a>';
+    }
+/*
+      $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
+                       '  <tr>' .
+                       '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
+                       '    <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'], 'SSL') . '"><b>' . $products[$i]['name'] . '</b></a>';
+*/
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+/*
+      $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
+                       '  <tr>' .
+                       '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'], 'SSL') . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
+                       '    <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'], 'SSL') . '"><b>' . $products[$i]['name'] . '</b></a>';
+*/
+      if (STOCK_CHECK == 'true') {
+        $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
+        if (tep_not_null($stock_check)) {
+          $any_out_of_stock = 1;
+
+          $products_name .= $stock_check;
+        }
+      }
+
+      if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
+        reset($products[$i]['attributes']);
+        while (list($option, $value) = each($products[$i]['attributes'])) {
+// BOM - Options Catagories
+//          $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
+          if ( !is_array($value) ) {
+            $products_name .= '<br><small><i> - ' . $products[$i][$option][$value]['products_options_name'] . ' ' . $products[$i][$option][$value]['products_options_values_name'] . '</i></small>';
+          } else {
+            if ( isset($value['c']) ) {
+              foreach ( $value['c'] as $v ) {
+                $products_name .= '<br><small><i> - ' . $products[$i][$option][$v]['products_options_name'] . ' ' . $products[$i][$option][$v]['products_options_values_name'] . '</i></small>';
+              }
+            } elseif ( isset($value['t']) ) {
+                $products_name .= '<br><small><i> - ' . $products[$i][$option]['t']['products_options_name'] . ' ' . $value['t'] . '</i></small>';
+            }
+          }
+// EOM - Options Catagories
+        }
+      }
+
+      $products_name .= '    </td>' .
+                        '  </tr>' .
+                        '</table>';
+
+      $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',
+                                             'text' => $products_name);
+
+      $info_box_contents[$cur_row][] = array('align' => 'center',
+                                             'params' => 'class="productListing-data" valign="top"',
+                                             'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));
+
+      $info_box_contents[$cur_row][] = array('align' => 'right',
+                                             'params' => 'class="productListing-data cart_price" valign="top"',
+                                             'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
+    }
+
+    new productListingBox($info_box_contents);
+?>
+        </td>
+      </tr>
+      <tr>
+        <td align="right" class="main carttotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <span><?php echo $currencies->format($cart->show_total()); ?></span></td>
+      </tr>
+<?php
+    if ($any_out_of_stock == 1) {
+      if (STOCK_ALLOW_CHECKOUT == 'true') {
+?>
+      <tr>
+        <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td>
+      </tr>
+<?php
+      } else {
+?>
+      <tr>
+        <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
+      </tr>
+<?php
+      }
+    }
+?>
+<?php 
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="cartoptions">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo tep_template_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td>
+<?php
+if (RETURN_CART == L){
+   $back = sizeof($navigation->path)-2;
+    if (isset($navigation->path[$back])) {
+    $nav_link = '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>' ;
+        }
+ } else if (RETURN_CART == C){
+   $products = $cart->get_products();
+   $products = array_reverse($products);
+    $cat = tep_get_product_path($products[0]['id']) ;
+    $cat1= 'cPath=' . $cat;
+         if ($products == '') {
+            $back = sizeof($navigation->path)-2;
+             if (isset($navigation->path[$back])) {
+             $nav_link = '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>' ;
+         }
+        }else{
+    $nav_link = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cat1, 'SSL') . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'  ;
+     }
+   } else if (RETURN_CART == P){ 
+   $products = $cart->get_products();
+   $products = array_reverse($products);
+     if ($products == '') {
+        $back = sizeof($navigation->path)-2;
+         if (isset($navigation->path[$back])) {
+         $nav_link = '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>' ;
+     }
+    }else{
+    $nav_link = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[0]['id'], 'SSL') . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'  ;
+    }
+   }
+    ?>
+    
+                <td class="main"><?php echo $nav_link; ?></td>
+<?php
+   // }
+?>
+                <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_template_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></form>
+  </td>
+      </tr>
+<?php
+// WebMakers.com Added: Shipping Estimator
+  if (SHOW_SHIPPING_ESTIMATOR=='true') {
+  // always show shipping table
+?>
+      <tr>
+        <td><?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/modules/'. FILENAME_SHIPPING_ESTIMATOR); ?></td>
+      </tr>
+<?php
+  } 
+?>
+<?php
+  } else {
+?>
+      <tr>
+        <td align="center" class="main"><?php echo TEXT_CART_EMPTY; ?></td>
+      </tr>
+<?php 
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'SSL') . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/OpenMoko/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1258 @@
+html,body {
+	margin: 0px;
+	padding: 0px;
+	background: #FFF;
+}
+
+body {
+	font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Tahoma, Arial, Helvetica, sans-serif !important;
+	font-size: 1em;
+	color: #333;
+	text-align: center;
+}
+
+table {
+	font-size: 12px;
+}
+
+h1 {
+	font-size: 1.9em;
+}
+
+h2 {
+	font-size: 1.4em;
+}
+
+h3 {
+	font-size: 1.1em
+}
+
+a {
+	color: #FF6600;
+	text-decoration: none;
+}
+
+a:hover {
+	color: #FF6600;
+	text-decoration: underline;
+}
+
+img {
+	border: none;
+}
+
+ul {
+	margin: 1 0 0 1.5em;
+	padding: 0 0 0 0;
+	list-style: none;
+}
+
+ul li {
+	background: url(images/list_bullet.png) no-repeat 0 0.5em;
+	padding-left: 0.7em;
+	margin-bottom: 0.1em;
+}
+
+#wrapper {
+	width: 950px;
+	margin: 0px auto;
+	position:relative;
+	text-align: left;
+}
+
+#header {
+	height: 121px;
+	position: relative;
+	background:url(images/navigation_background.png) no-repeat 0 0;
+	margin-bottom: 10px;
+}
+
+#site_logo {
+	position: absolute;
+	top: 41px;
+	left: 25px;
+}
+
+/**************/
+/* NAVIGATION */
+/**************/
+
+#main_navigation {
+	float: right;
+	position: absolute;
+	top: 42px;
+	right: 15px;
+}
+
+#main_navigation ul {
+	list-style: none;
+	margin: 0;
+	padding: 0;
+}
+
+#main_navigation ul li {
+	display: inline;
+	margin: 0;
+	padding: 0;
+	background: none;
+}
+
+
+
+#main_navigation a {
+	float: left;
+	display: block;
+	height: 11px;
+	background-position: 50% 0%;
+	background-repeat:no-repeat;
+	margin-left: 10px;
+}
+
+#main_navigation a:hover {
+	background-position: 50% 100%;
+}
+
+#main_navigation a span{
+	display: none;
+}
+
+#main_navigation .selected {
+	background-position: 50% 100%;
+}
+
+
+.nav_home {
+	background-image:url(images/navigation/home.png);
+	width: 58px;
+}
+
+.nav_about {
+	background-image:url(images/navigation/about.png);
+	width: 64px;
+}
+
+.nav_products {
+	background-image:url(images/navigation/products.png);
+	width: 86px;
+}
+
+.nav_developers {
+	background-image:url(images/navigation/developers.png);
+	width: 98px;
+}
+
+.nav_network {
+	background-image:url(images/navigation/network.png);
+	width: 83px;
+}
+
+.nav_press {
+	background-image:url(images/navigation/press.png);
+	width: 58px;
+}
+
+.nav_careers {
+	background-image:url(images/navigation/careers.png);
+	width: 76px;
+}
+
+.nav_contact {
+	background-image:url(images/navigation/contact.png);
+	width: 79px;
+}
+
+.nav_shop {
+	background-image:url(images/navigation/shop.png);
+	width: 55px;
+}
+
+/****************/
+/* MIDDLE BLOCK */
+/****************/
+
+#middleblock {
+	background: #080808 url(images/middleblock_tile.png) repeat-x 0% 0%;
+	position: relative;
+	border-bottom: 1px solid #CCCCCC;
+}
+
+#middleblock_inner {
+	background:url(images/middleblock_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_inner2 {
+	background:url(images/middleblock_right.png) no-repeat 100% 0%;
+	min-height: 300px;
+}
+
+#middleblock_container {
+	min-height: 300px;
+}
+
+#middleblock_tabs {
+	margin: 0px;
+	padding: 0px;
+	list-style: none;
+	font-size: 1.1em;
+	display: block;
+
+	position: relative;
+	top: 1px;
+	
+	margin-left: 348px;
+}
+
+#middleblock_tabs li {	
+	display: inline;
+	margin: 0;
+	padding: 0;
+	background: none;
+}
+
+#middleblock_tabs li a {
+	float: left;
+	display: block;
+	font-weight: bold;
+	color: white;
+	text-decoration: none;
+	margin-right: 5px;
+}
+
+#middleblock_tabs li a span {
+	display: block;
+	padding: 0.5em 0.8em 0.5em 0.9em;
+}
+
+#middleblock_tabs li a:hover {
+	color: #FF6600;
+	background:#FFF url(images/middleblock_tabs_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_tabs li a:hover span {
+	background:url(images/middleblock_tabs_right.png) no-repeat 100% 0%;
+}
+
+#middleblock_tabs li .selected {
+	color: #FF6600;
+	background:#FFF url(images/middleblock_tabs_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_tabs li .selected span {
+	background:url(images/middleblock_tabs_right.png) no-repeat 100% 0%;
+}
+
+.main_container {
+	padding-top: 40px;
+	padding-bottom: 40px;
+}
+
+.clear {
+	clear: both;
+}
+
+
+#left_column {
+	width: 303px;
+	padding-left: 45px;
+	float: left;
+}
+
+#left_column h3 {
+	margin: 0 0 1.1em 0;
+	padding: 0;
+}
+
+#right_column {
+	margin-left: 350px;
+}
+
+#footer {	
+	text-align: center;
+	background: #FAFAFA;
+	border-top: 1px solid #CCC;
+	padding: 5em 0 4em 0;
+	margin: 0 0 20px 0;
+	font-size: 0.8em;
+	color: #666666;
+}
+
+* html #footer {
+	font-size: 0.7em;
+}
+
+
+#footer a {
+	color: #333;
+}
+
+#footer a:hover {
+	text-decoration: none;
+	color: #FF6600;
+}
+
+#secundary_navigation {
+	margin: 0;
+	padding: 0 0 2em 0;
+	text-transform: uppercase;
+	margin: 0 auto;
+}
+
+#secundary_navigation li {
+	background: none;
+	padding: 0;
+	display: inline;
+	margin: 0 1em;
+}
+
+#secundary_navigation .selected {
+	font-weight: bold;
+	color: #FF6600;
+}
+
+
+
+/***********/
+/* CONTENT */
+/***********/
+
+.content {
+	line-height: 1.5em;
+	padding-bottom: 20px;
+}
+
+.content p {
+	margin: 0;
+	padding: 0.6em 0;
+}
+
+.content ul,
+.content ol {
+	padding: 0.9em 0 0.8em 2em;
+}
+
+.content blockquote {
+	margin: 0;
+	padding: 0.6em 0 0.6em 2em;
+	color: #999;
+}
+
+.content h2 {
+	margin: 0;
+	padding: 0 0 0.5em 0;
+}
+
+.content .title_container {
+	border-bottom: 1px solid #CCCCCC;
+	margin: 0 0 0.7em 0;
+}
+
+.content img {
+	border-right: 1px solid #CCCCCC;
+	float: left;
+	margin: 0 1em 1em 0;
+}
+
+.toptab {
+	background: #333 url(images/toptab_left.png) no-repeat 0 100%;
+	float: right;
+	font-size:0.76em;
+	color: #999999;
+	margin-left: 7px;
+	position: relative;
+	z-index: 100;
+}
+
+.toptab .inner {
+	background:url(images/toptab_right.png) no-repeat 100% 100%;
+	padding: 2px 5px 2px 15px;
+	position: relative;
+}
+
+.toptab a {
+	color: #999;
+	margin-right: 10px;
+}
+
+.toptab a:hover {
+	color: #FF6600 !important;
+	text-decoration: none;
+}
+
+
+.buton_decrease_font{
+	display: block;
+	width: 11px;
+	height: 8px;
+	background:url(images/icons/icon_decrease_font.png) no-repeat 0% 0%;
+}
+
+.buton_decrease_font:hover{
+	background-position:0% 100%;
+}
+
+.buton_decrease_font span {
+	display: none;
+}
+
+.decrease_font,
+.increase_font {
+	font-weight: bold;
+	color: #666 !important;
+	font-size: 0.8em;
+	margin-left: 5px;
+}
+
+.top_tabs_container {
+	position: absolute;
+	top: 0px;
+	z-index: 10000;
+	padding-right: 20px;
+}
+
+* html .top_tabs_container {
+	font-size: 0.9em;
+}
+
+.oscommerce_copyright br {
+	display: none;
+}
+
+.oscommerce_copyright font {
+	color: #666;
+}
+
+.oscommerce_copyright a {
+	margin-right: 3px;
+}
+
+.left_container {
+	width: 200px;
+	float: left;
+	padding-top: 28px;
+	padding-left: 15px;
+}
+
+.sidebox {
+	width: 189px;
+	margin: 0 0 30px 0;
+	background:url(images/sidebox_tile.png) repeat-y 0 0;
+}
+
+.sidebox .inner {
+	background:url(images/sidebox_top.png) no-repeat 0 0;
+}
+
+.sidebox .inner_2 {
+	background:url(images/sidebox_bottom.png) no-repeat 0 100%;
+	padding: 7px;
+}
+
+.sidebox .input_text {
+	width: 145px;
+	margin-bottom: 10px;
+}
+
+.sidebox form {
+	margin-left: 8px;
+}
+
+.sidebox h2 {
+	margin: 0px;
+	padding: 5px 0px 0px 10px;
+	font-size: 13px;
+}
+
+.sidebox h2 a {
+	background: url(images/sidebox_h2.gif) no-repeat 0 4px;
+	padding-left: 15px;
+}
+
+.sidebox table,
+.sidebox table tr,
+.sidebox table td {
+	border-color: #CCCCCC !important;
+}
+
+.sidebox a {
+	color: #FF6600;
+}
+
+.sidebox a:hover {
+	text-decoration: underline;
+}
+
+#searchform {
+	position: relative;
+	margin: 0;
+	padding: 24px 0 1px 0;
+	background:url(images/label/search_openmoko_gray.png) no-repeat 0 8px;
+}
+
+#searchform label {
+	display: none;
+}
+
+#searchform .input_text {
+	width: 135px;
+	margin-bottom: 0px;
+}
+
+#searchform .input_submit {
+	position: absolute;
+	left: 142px;
+	top: 20px;
+}
+
+
+.side_banner {
+	margin: 0 0 30px 0;
+	display:block;
+	width: auto;
+}
+
+.banner_images {
+	position: absolute;
+	left: 86px;
+	top: 50px;
+	width: auto;
+	overflow:visible;
+}
+
+.banner_images div {
+	position: relative;
+}
+
+.right_container {
+	width: 726px;
+	margin: 0 0 0 auto;
+	font-size: 0.8em !important;
+}
+
+.my_account_info {
+	list-style:none;
+	margin: 0px 0px 0px 9px;
+	padding: 0px;
+}
+
+.my_account_info li {
+	
+}
+
+.my_account_info li a {
+	color: #FF6600;
+}
+
+.my_account_info li a:hover {
+	text-decoration: underline;
+}
+
+.main_table_heading_inner {
+	background: #f1f1f1;
+}
+
+.pageHeading {
+	font-size: 1.4em;
+	font-weight: bold;
+	padding-bottom: 3px;
+	border-bottom: 1px solid #ccc;
+}
+
+.shop_breadcrumb {
+	display: block;
+	width: 699px;
+	height: 17px;
+	/*background: url(images/breadcrumbs_back.gif) no-repeat 0 0;*/
+	background: url(images/sidebox_h2.gif) no-repeat 13px 1px;
+	margin-left: 0px;
+	border-bottom: #eee;
+	margin-bottom: 5px;
+
+	padding: 0px 0px 0px 27px;
+}
+
+.sh_right_block {
+	width: 696px;
+}
+
+.product_list_table_1 {
+	border-right: 1px solid #ccc;
+}
+.product_list_table_1,
+.product_list_table_2,
+.product_list_table_3,
+.product_list_table_4 {
+	width: 340px;
+	height: 130px;
+}
+
+.plist_name {
+	display: block;
+	background: url(images/sidebox_h2.gif) no-repeat 0 3px;
+	font-weight: bold;
+	padding: 0px 0px 0px 14px;
+}
+
+.plist_name a {
+	color: #FF6600;
+}
+
+.plist_name a:hover {
+	text-decoration: underline;
+}
+
+.plist_price {
+	display: block;
+	font-weight: bold;
+	padding: 7px 0px 7px 14px;
+}
+
+.plist_button {
+	margin-left: 14px;
+}
+
+.product_list_col1 {
+	width: 150px;
+	text-align: center;
+	vertical-algin: center;
+}
+
+.product_list_col2 {
+	vertical-algin: center;
+}
+
+.productListing-data {
+	border-top: 1px solid #ccc;
+	padding-bottom: 10px;
+	padding-top: 10px;
+	text-align: left;
+}
+
+.category_desc {
+	display: none;
+}
+
+.breadcrumb_arrow {
+	position: relative;
+	top: -1px;
+}
+
+.pagination {
+	/*border-top: 1px solid #CCCCCC;
+	padding-top: 10px;
+	text-align: center;
+	font-size: 0.9em;*/
+	font-size: 11px;
+	padding: 10px 5px 10px;
+}
+
+.pagination .selected {
+	color: #FF6600;
+}
+
+.pagination a {
+	color: #444;
+	margin-right: 5px;
+	padding-bottom: 2px;
+}
+
+.pagination a:hover {
+	color: #FF6600;
+	text-decoration: none;
+}
+
+.pag_first {
+	background:url(images/icons/icon_first.png) no-repeat 0 2px;
+	padding-left: 14px;
+	margin-right: 20px !important;
+}
+
+.pag_previous {
+	background:url(images/icons/icon_previous.png) no-repeat 0 2px;
+	padding-left: 14px;
+	margin-right: 20px !important;
+}
+
+
+.pag_next {
+	background:url(images/icons/icon_next.png) no-repeat right 2px;
+	padding-right: 14px;
+	margin-left: 15px !important;
+}
+
+.pag_last {
+	background:url(images/icons/icon_last.png) no-repeat right 2px;
+	padding-right: 14px;
+	margin-left: 20px !important;
+}
+
+.pagination .disabled {
+	color: #aaa !important;
+}
+
+.pagination .disabled:hover {
+	color: #aaa !important;
+} 
+
+.bottom_pagination_table {
+	border-top: 1px solid #ccc;
+
+}
+
+.main_category {
+	position: relative;
+}
+
+.main_category h3 a,
+.shop_home_column a {
+	font-size: 17px;
+	color: #FF6600;
+}
+
+.shop_home_h3 {
+	font-size: 17px;
+	color: #FF6600;
+	width: 308px;
+	border-bottom: 1px solid #CCC;
+	float: left;
+	padding: 0px 20px 10px;
+}
+
+* html .shop_home_h3 {
+	width: 348px;
+	margin-bottom: 15px;
+}
+
+.main_category h3 a:hover {
+	text-decoration: underline;
+}
+
+.main_categories_description {
+	margin-top: 340px;
+	color: #666666;
+	font-weight: bold;
+	font-size: 13px;
+}
+
+.shop_home_column .main_categories_description {
+	margin-top: 310px;
+	font-weight: normal;
+	font-size: 14px;
+}
+
+.main_categories_description b,
+.main_categories_description strong {
+	color: #333;
+	font-size: 14px;
+	display: block;
+	padding-bottom: 5px;
+}
+
+
+.main_category_25 {
+	width: 325px;
+	height: 602px;
+	background: url(images/main_category_accessories.png) no-repeat 50% 50px;
+	float: left;
+	margin-left: 20px;
+}
+
+.main_category_24 {
+	width: 325px;
+	height: 602px;
+	background: url(images/main_category_phones.png) no-repeat 45% 50px;
+	border-right: 1px solid #CCC;
+	padding-right: 10px;
+	float: left;
+}
+
+.shop_home_column {
+	width: 308px;
+	height: 482px;
+	background: url(images/main_category_phones.png) no-repeat 45% 10px;
+	border-right: 1px solid #CCC;
+	padding-right: 10px;
+	float: left;
+	padding: 0px 20px;
+}
+
+.shop_home_column_right {
+	border-right: 0px;
+	background: url(images/neo_advanced.png) no-repeat 55% 10px;
+}
+
+* html .shop_home_column {
+	width: 348px;
+}
+
+.button_buy_it_now {
+	background:url(images/button_buy.png) no-repeat 0 0;
+	height: 20px;
+	width: 65px;
+	margin-top: 20px;
+}
+
+
+.button_24 {
+	display:block;
+	width: 79px;
+	height: 22px;
+	background: url(images/buttons/button_products.png) no-repeat 0 0;
+	margin-top: 25px;
+}
+
+.button_25 {
+	display:block;
+	width: 95px;
+	height: 22px;
+	background: url(images/buttons/button_accessories.png) no-repeat 0 0;
+	margin-top: 25px;
+}
+
+.img_button {
+	display: block;
+	background-position: left top;
+}
+
+.img_button:hover {
+	background-position: left bottom;
+}
+
+
+.img_button span {
+	display:none;
+}
+
+.productTableTitle {
+	display: none;
+}
+
+.productTableBody {
+	line-height: 160%;
+}
+
+.productTablePurchase {
+	border-top: 1px solid #ccc;
+	padding: 20px 0px 0px;
+}
+
+.quantity_input {
+	margin: 0px 8px 0px 8px;
+	position: relative;
+	top: 2px;
+}
+
+.productName {
+	font-size: 1.5em;
+}
+
+.productPrice {
+	border-top: 1px solid #e6e6e6;
+	margin-top: 15px;
+	padding-top: 10px;
+	font-size: 14px;
+	font-weight: bold;
+}
+
+.productPrice span {
+	color: #FF6600;
+}
+
+.back_to_parent {
+	padding: 10px 0px 0px 0px;
+
+}
+
+.productContainer {
+	width: 380px !important;
+}
+
+.cartlisting {
+	margin: 0px;
+	border: 0px;
+	padding: 0px;
+}
+
+.cartlisting a {
+	background: url(images/sidebox_h2.gif) no-repeat 0px 3px;
+	padding-left: 14px;
+}
+
+.cartimage {
+	width: 160px;	
+	text-align: center;
+}
+
+.cartimage a {
+	background: none;
+	padding: 0px;
+}
+
+.cart_delete_col {
+	width: 20px !important;
+	text-align: center;
+}
+
+.cart_price {
+/*	color: #FF6600;*/
+	text-align: right;
+}
+
+.carttotal {
+	border-top: 3px double #ccc;
+	font-weight: bold;
+}
+
+.carttotal span {
+	color: #FF6600;
+}
+
+.stockWarning {
+	text-align: left;
+	font-size: 0.9em;
+	color: #666666;
+}
+
+.cartoptions {
+	border-top: 1px solid #ccc;
+	padding-top: 20px;
+}
+
+.cart_shipping_estimator {
+	border: 1px solid #ccc;
+	background: #FAFAFA;
+	padding: 10px 0px 0px 10px
+}
+
+.estimator_title {
+	border-bottom: 1px solid #ccc;
+	padding: 0px 0px 5px 0px;
+	margin-right: 8px;
+	font-weight: bold;
+	font-size: 1.1em;
+}
+
+.my_account_title {
+	font-size: 1.2em;
+	/*border-bottom: 1px solid #ccc;*/
+	padding: 0px 0px 3px 0px;
+	font-weight: bold;
+}
+
+.my_account_links {
+	margin-left: 0px;
+	margin-top: -10px;
+}
+
+.my_account_links ul li {
+	margin-bottom: 4px;
+}
+
+.requiredWarning {
+	text-align: left;
+	font-size: 0.9em;
+	color: #666666;
+	margin-top: 15px;
+}
+
+.form_table td {
+	padding-bottom: 7px;
+}
+
+.simple_first_row {
+	width: 200px;
+}
+
+.primary_address {
+	border: 1px solid #ccc;
+	background: #FAFAFA;
+	width: 250px;
+	padding: 8px 15px;
+	text-align: left;
+	position: relative;
+	top: -15px;
+}
+
+.primary_address span.title {
+	display:block;
+	border-bottom: 1px solid #ccc;
+	font-weight: bold;
+	padding: 0px 0px 4px 0px;
+	display:none;
+	margin-bottom: 5px;
+}
+
+.visible {
+	display: block !important;
+}
+
+.primary_address span.data {
+	display: block;
+	margin-top: 0px;
+	padding-left: 8px;
+	line-height: 140%;
+}
+
+.moduleRow td {
+	border-bottom: 1px solid #eee !important;
+}
+
+.single_address {
+	padding-bottom: 20px;
+}
+
+.inputRequirement {
+	color: #FF0000;
+	font-weight: bold;
+	font-size: 11px;
+}
+
+.price {
+	color: #FF6600;
+	font-weight: bold;
+}
+
+.orders_view_button {
+	position: relative;
+	top: 4px;
+}
+
+.moduleRowSpacing td {
+	padding: 5px 0px;
+}
+
+.underlined {
+	border-bottom: 1px solid #ddd;
+}
+
+.bulleted {
+	background: url(images/list_bullet.png) no-repeat 0 8px;
+	padding-left: 7px;
+}
+
+.idented {
+	padding-left: 7px;
+}
+
+.noborder {
+	border: 0px !important;
+}
+
+.noborder td {
+	border: 0px !important;
+}
+
+.checkout_shipping_method_header {
+	/*border-bottom: 3px double #bbb;*/
+	border-bottom: 1px solid #bbb;
+	padding-bottom: 5px;
+}
+
+.checkout_shipping_method_footer {
+	border-top: 1px solid #bbb;
+}
+
+.checkout_shipping_method_footer_alt {
+	border-bottom: 1px solid #bbb;
+}
+
+.checkout_shipping_option {
+	margin-bottom: 10px;
+	margin-top: 5px;
+	padding-bottom: 8px;
+	/*border-bottom: 1px solid #ddd;*/
+}
+
+.checkout_textarea {
+	text-align: center;
+}
+
+
+.checkout_textarea textarea {
+	width: 90%;
+	margin: 0px auto;
+}
+
+.checkoutBarTo,
+.checkoutBarCurrent {
+	padding-top: 5px;
+}
+
+.checkoutBarCurrent {
+	font-weight: bold;
+}
+
+.checkout_option {
+	border-top: 15px solid white;
+}
+
+.checkoutTable .moduleRow td {
+	border-bottom: 1px solid #ddd;
+	padding: 5px 0px 3px 0px;
+	border-top: 20px solid white;
+	background: #FAFAFA;
+}
+
+.checkoutTable .moduleRowSelected td {
+	border-bottom: 1px solid #bbb;
+	padding: 5px 0px 3px 0px;
+	border-top: 20px solid white;
+	background: #EEE;
+}
+
+.descc .main {
+	font-size: 10px;
+}
+
+.supp .main {
+	font-size: 1.2em;
+	/*border-bottom: 1px solid #ccc;*/
+	padding: 0px 0px 3px 0px;
+	font-weight: bold;
+}
+
+.ccards1 {
+	width: 50% !important;
+}
+
+.ccards2 {
+	width: 50% !important;
+	padding-bottom: 8px;
+}
+
+.ccards2 td {
+	
+}
+
+.bordered {
+	border-bottom: 1px solid #ccc;
+}
+
+.bordered1 {
+	border-bottom: 1px solid #e2e2e2;
+}
+
+
+.bordered2 {
+	border-top: 1px solid #e2e2e2;
+}
+
+td.headerError {
+	border: 1px solid #AB0000;
+	background: #FFCFCF;
+	line-height: 150%;
+	padding: 10px 20px;
+	color: #AB0000;
+	margin-bottom: 10px;
+}
+
+tr.headerError {
+	padding: 10px;
+	
+}
+
+.reviewTitle {
+	border-bottom: 1px solid #ccc;
+	margin-bottom: 5px;
+	font-size: 1.1em;
+	padding-bottom: 2px;
+}
+
+.reviewRating {
+	float: right;
+	font-size: 0.9em;
+	padding-bottom: 2px
+}
+
+.reviewRating img {
+	position: relative;
+	top: 2px;
+}
+
+.reviewAdded {
+	margin-top: 8px;
+	color: #999;
+	font-size: 0.9em;
+	margin-bottom: 20px;
+}
+
+.review_product_box {
+	text-align: center;
+	border: 1px solid #ccc;
+	background: #FAFAFA;
+	padding: 10px 40px;
+}
+
+.review_addtocart {
+	margin-top: 20px;
+}
+
+.reviewExcerpt {
+	line-height: 145%;
+}
+
+.reviewMain {
+	line-height: 145%;
+}
+
+.review_header {
+	/*border-bottom: 1px solid #ccc;*/
+	padding-bottom: 4px;
+}
+
+.review_header_date {
+	font-size: 0.9em;
+}
+
+.somenote {
+	border: 1px solid #ccc;
+	background: #FAFAFA;
+	padding: 10px 15px;
+}
+
+.login_col1 {
+	/*width: 140px;*/
+}
+
+.total_input input {
+	width: 100%;
+}
+
+.alt_pag {
+	font-size: 0.9em;
+}
+
+.send_to_friend_form {
+	padding-top: 8px;
+}
+
+.send_to_friend_form .label {
+	display:block;
+	padding-bottom: 5px;
+}
+
+.send_to_friend_form .input_text {
+	width: 75%;
+}
+
+.send_to_friend_form .submit {
+	position: relative;
+	top: 4px;
+	margin-left: 2px;
+}
+
+.send_to_friend_text textarea{
+	width: 100%;
+	margin-top: 10px;
+}
+
+.send_to_friend_links br {
+	display: none;
+}
+
+.send_to_friend_links a {
+	margin-left: 10px;
+	margin-top: 5px;
+	display:block;
+	background: url(images/list_bullet.png) no-repeat 0px 5px;
+	padding-left: 7px;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMoko/stylesheet.css.bak
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/stylesheet.css.bak	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/stylesheet.css.bak	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,727 @@
+/*
+  $Id: stylesheet.css,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  .cat_description {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #800000;
+     background : inherit;
+     font-weight : bold;
+      }
+ .boxText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .centerTable {
+     background-image : url('images/bg_cat4.gif');
+     background-repeat : repeat-x;
+     background : #fbfcfd;
+     color : inherit;
+      }
+ .errorBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : inherit;
+     background : #ffb3b5;
+     font-weight : bold;
+      }
+ .stockWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #cc0033;
+     background : inherit;
+      }
+ .productsNotifications {
+     background : #f2fff7;
+     color : inherit;
+      }
+ .orderEdit {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #70d250;
+     background : inherit;
+     text-decoration : underline;
+      }
+ .navBlue {
+     color : #ff0000;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ .subnavBlue {
+     color : #9966ff;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ BODY {
+     background : #ffffff;
+     color : #000000;
+     margin : 0;
+      }
+ A {
+     color : #000000;
+     background : inherit;
+     text-decoration : none;
+      }
+ A:hover {
+     color : #aabbdd;
+     background : inherit;
+     text-decoration : underline;
+      }
+ FORM {
+     display : inline;
+      }
+ TR.header {
+     background : #ffffff;
+     color : inherit;
+      }
+ TR.headerNavigation {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.headerNavigation {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ A.headerNavigation {
+     color : #ffffff;
+     background : #bbc3d3;
+      }
+ a:hover.headerNavigation {
+     color : #ffffff;
+     background : #bbc3d3;
+      }
+ TR.headerError {
+     background : #ff0000;
+     color : #bbc3d3;
+      }
+ TD.headerError {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ff0000;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ TR.headerInfo {
+     background : #00ff00;
+     color : #bbc3d3;
+      }
+ TD.headerInfo {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #00ff00;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ TR.footer {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.footer {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ .templateinfobox {
+     background : #f8f8f9;
+     color : inherit;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+      }
+ .infoBox {
+     background : #b6b7cb;
+     color : #000000;
+      }
+ TD.infoBox, SPAN.infoBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.infoBoxHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bbc3d3;
+     color : #ffffff;
+      }
+
+ .infoBoxContents {
+     background : #f8f8f9;
+     color : #000000;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.infoBoxFooter {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #cccccc;
+    color : #000000;
+}
+
+ TD.contentBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #534f4d;
+     background : #bbc3d3;
+    padding-top : 5px;
+}
+ .infoBoxContentsHeader {
+     background : #bbc3d3;
+    color : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ .infoBoxContentsCenter {
+    color : inherit;
+     background : #f8f8f9;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+     background : #bbc3d3;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+ TD.infoBoxHeadingImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-position : left;
+     background-color : #bbc3d3;
+     color : #000000;
+      }
+ TD.infoBoxFooterImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 1px;
+     font-weight : bold;
+     background-color : #bbc3d3;
+     color : #000000;
+      }
+ .infoBoxNotice {
+     background : #ff8e90;
+     color : #ffffff;
+      }
+ .infoBoxNoticeContents {
+     background : #ffe6e6;
+     color : #ffffff;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.main_table_heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #cccccc;
+     color : #000000;
+      }
+ TD.main_table_heading_inner {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #ffffff;
+     color : #000000;
+      }
+ TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TABLE.productListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .productListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #b6b7cb;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ .productlisting-headingPrice {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     background : #cccccc;
+     color : #9a9a9a;
+     font-weight : bold;
+      }
+ TD.productListing-data {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ A.pageResults {
+     color : #0000ff;
+     background : inherit;
+      }
+ a:hover.pageResults {
+     color : #0000ff;
+     background : #ffff33;
+      }
+ TD.pageHeading, DIV.pageHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     font-weight : bold;
+     color : #9a9a9a;
+     background : inherit;
+      }
+ TR.subBar {
+     background : #f4f7fd;
+     color : inherit;
+      }
+ TD.subBar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ TD.main, P.main {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #000000;
+     background : inherit;
+      }
+ TD.smallText, SPAN.smallText, P.smallText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.accountCategory {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 13px;
+     color : #aabbdd;
+     background : inherit;
+      }
+ TD.fieldKey {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.fieldValue {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+      }
+ TD.tableHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.category_desc {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+      }
+ SPAN.newItemInCart {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ CHECKBOX, INPUT, RADIO, SELECT {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ TEXTAREA {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ SPAN.greetUser {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #f0a480;
+     background : inherit;
+     font-weight : bold;
+      }
+ TABLE.formArea {
+     background : #f1f9fe;
+     color : #f4f7fd;
+     border-color : #7b9ebd;
+     border-style : solid;
+     border-width : 1px;
+      }
+ TD.formAreaTitle {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ SPAN.markProductOutOfStock {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #c76170;
+     background : inherit;
+     font-weight : bold;
+      }
+ SPAN.productSpecialPrice {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ SPAN.errorText {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ .moduleRowOver {
+     background-color : #d7e9f7;
+     color : inherit;
+     cursor : pointer;
+      }
+ .moduleRowSelected {
+     background-color : #e9f4fc;
+     color : inherit;
+      }
+ .checkoutBarFrom, .checkoutBarTo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #8c8c8c;
+     background : inherit;
+      }
+ .checkoutBarCurrent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ .messageBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .messageStackError, .messageStackWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #ffb3b5;
+     color : inherit;
+      }
+ .messageStackSuccess {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #99ff00;
+     color : inherit;
+      }
+ .inputRequirement {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ TABLE.linkListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .linkListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #b6b7cb;
+     color : #ffffff;
+     text-align : center;
+      }
+ TD.linkListing-data {
+     border-right : 1px solid #b6b7cb;
+     border-bottom : 1px solid #b6b7cb;
+     padding : 4px;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TR.linkListing-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.linkListing-even {
+     background : #f5f5f5;
+     color : inherit;
+      }
+ .content {
+     color : #000000;
+     background : inherit;
+     font-size : 10px;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #bdcaf0;
+     background : inherit;
+      }
+ TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+     background-image : url('images/button_blank_left.gif');
+      }
+ TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+     background-image : url('images/button_blank_right.gif');
+      }
+ TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+     background-image : url('images/button_blank_middle.gif');
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-color : inherit;
+     color : #000000;
+      }
+ A.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     color : #000000;
+     background : inherit;
+      }
+ a:hover.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+     color : #00ff00;
+      }
+ TD.cookieUsage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #000000;
+     color : #ffffff;
+      }
+ .attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TR.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TD.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #c0c0c0;
+      }
+ .storyboxtitle {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:link {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:active {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:visited {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:hover {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ffffff;
+     font-size : 10px;
+     font-weight : bold;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .yearHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 14px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+      }
+ .calendarMonth {
+     background-color : #cccccc;
+     color : inherit;
+     cursor : default;
+     width : 100%;
+      }
+ .calendarHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     height : 22px;
+      }
+ .calendarToday {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffcf00;
+     padding-left : 3px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendarWeekend {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #caeeff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffffff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     height : 22px;
+     width : 18px;
+      }
+ .event {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     border : 1px solid #e6e6e6;
+      }
+ .empty {
+     background-color : #f0faff;
+     color : inherit;
+     line-height : 14px;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ h4.infoTitle {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 0.2em;
+      }
+ p.infoBlurb {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 2em;
+      }
+ TD.productPriceInListing {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #d2e9fb;
+     color : inherit;
+      }
+ TD.productPriceInBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #eeeeee;
+     color : inherit;
+      }
+ TD.productPriceInProdInfo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ccffcc;
+     color : inherit;
+      }
+ #navMenu {
+     clear : both;
+     height : 0.01%;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu ul {
+     float : left;
+     width : 150px;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu li {
+     position : relative;
+     float : left;
+     line-height : 24px;
+     margin-bottom : -1px;
+     width : 150px;
+      }
+ #navMenu li ul {
+     position : absolute;
+     left : -999em;
+     margin-left : 150px;
+     margin-top : -26px;
+      }
+ #navMenu li ul ul {
+     left : -999em;
+      }
+ #navMenu li a {
+     width : 150px;
+     display : block;
+     color : #334;
+     font-weight : bold;
+     text-decoration : none;
+     background : #ffffff;
+     border : 1px solid #cce;
+     padding-left : 2px;
+      }
+ #navMenu li a:hover {
+     color : #000000;
+     background : #aac;
+      }
+ #navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+     left : -999em;
+      }
+ #navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+     left : auto;
+      }

Added: trunk/direct.openmoko.com/templates/OpenMoko/wishlist.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/wishlist.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/wishlist.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,246 @@
+<!-- wishlist.tpl.php //start -->
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+  $header_text = '&nbsp;'
+  //EOF: Lango Added for template MOD
+  ?>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+        </tr>
+      </table></td>
+  </tr>
+	<tr>
+		<td><?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '100%', '5'); ?></td>
+	</tr>
+  <?php
+  // BOF: Lango Added for template MOD
+}else{
+  $header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <?php
+      // BOF: Lango Added for template MOD
+      if (MAIN_TABLE_BORDER == 'yes'){
+        table_image_border_top(false, false, $header_text);
+      }
+      // EOF: Lango Added for template MOD
+      ?> 
+      <td width="100%" valign="top" align="center"><table border="0" width="100%" cellspacing="0" cellpadding="0">   
+        <!-- wishlist content //start -->
+        <?php
+        $wishlist_sql = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 order by products_name";      
+        $wishlist_split = new splitPageResults($wishlist_sql, MAX_DISPLAY_WISHLIST_PRODUCTS);
+        $wishlist_query = tep_db_query($wishlist_split->sql_query);
+
+        $info_box_contents = array();
+        if (tep_db_num_rows($wishlist_query)) {
+          $product_ids = '';
+          while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+            $product_ids .= $wishlist['products_id'] . ',';
+          }
+          $product_ids = substr($product_ids, 0, -1);
+        
+          $products_query = tep_db_query("select pd.products_id, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+           
+          if ( ($wishlist_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
+          ?>
+
+            <tr>
+              <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="alt_pag">
+                <tr>
+                  <td class="smallText bordered1"  style="padding-bottom: 15px"><?php echo $wishlist_split->display_count(TEXT_DISPLAY_NUMBER_OF_WISHLIST); ?></td>
+                  <td class="smallText bordered1" align="right"  style="padding-bottom: 15px"><?php echo TEXT_RESULT_PAGE . ' ' . $wishlist_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+                </tr>
+              </table></td>
+            </tr>
+          <?php
+          }
+          ?>  
+          <tr>
+            <td colspan="4">
+              <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                <tr>
+                  <td colspan="4"width="100%" valign="top">
+                    <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_del_products_wishlist', 'SSL')); ?>
+                  </td>
+                </tr>
+              <tr>
+                  <?php
+                  $col = 0;
+                  while ($products = tep_db_fetch_array($products_query)) {
+                    $col++;
+                    ?>
+                    <td><table class="linkListing bordered1" width="100%" border="0" cellspacing="0" cellpadding="6">
+                      <tr>
+                        <td width="20%" valign="top" align="center" class="smallText">
+                          <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&amp;products_id=' . $products['products_id'], 'SSL'); ?>"><?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></a>
+                        </td>
+                        <td valign="top" align="left" class="smallText">
+                          <b>
+                          	<div style="padding-bottom: 4px;">
+                          	<a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&amp;products_id=' . $products['products_id'], 'SSL'); ?>"><?php echo $products['products_name']; ?></a></b>
+                          	</div>
+                          <?php
+                          // Begin Wish List Code w/Attributes
+                          $attributes_addon_price = 0;
+                          
+                          // Now get and populate product attributes
+                          if ($customer_id > 0) {
+                            $wishlist_products_attributes_query = tep_db_query("select products_options_id as po, products_options_value_id as pov from " . TABLE_WISHLIST_ATTRIBUTES . " where customers_id='" . $customer_id . "' and products_id = '" . $products['products_id'] . "'");
+                            while ($wishlist_products_attributes = tep_db_fetch_array($wishlist_products_attributes_query)) {
+                              // We now populate $id[] hidden form field with product attributes
+                              echo tep_draw_hidden_field('id['.$products['products_id'].']['.$wishlist_products_attributes['po'].']', $wishlist_products_attributes['pov']);
+                              // And Output the appropriate attribute name
+                              $attributes = tep_db_query("select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
+                                from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,  " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
+                                where pa.products_id = '" . $products['products_id'] . "'
+                                and pa.options_id = '" . $wishlist_products_attributes['po'] . "'
+                                and pa.options_id = popt.products_options_id
+                                and pa.options_values_id = '" . $wishlist_products_attributes['pov'] . "'
+                                and pa.options_values_id = poval.products_options_values_id
+                                and poptt.products_options_text_id = popt.products_options_id
+                                and poptt.language_id = '" . $languages_id . "'
+                                and poval.language_id = '" . $languages_id . "'");
+                              $attributes_values = tep_db_fetch_array($attributes);
+                              if ($attributes_values['price_prefix'] == '+')
+                                 { $attributes_addon_price += $attributes_values['options_values_price']; }
+                              else if ($attributes_values['price_prefix'] == '-')
+                                 { $attributes_addon_price -= $attributes_values['options_values_price']; }
+                                 echo '<br><small><i>' . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'] . '</i></small>';
+                            } // end while attributes for product
+                               
+                            if ($new_price = tep_get_products_special_price($products['products_id'])) {
+                              $products_price = '<s>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>';
+                            } else {
+                              $products_price = $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id']));
+                            }
+                          } 
+                          echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5').'<br>';
+                          echo BOX_TEXT_PRICE . '&nbsp;' . $products_price. '<br>';
+                          // End Wish List Code w/Attributes
+                          ?>
+                          <br>
+                          <!-- move/delete checkboxes_start -->
+                          <table class="productListing" border="0" width="96%" cellspacing="0" cellpadding="0">
+                            <tr>
+                              <td align="left">
+                                <table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">          
+                                  <tr>
+                                    <td class="main" align="left" width="90"><b><?php echo BOX_TEXT_MOVE_TO_CART ?></b></td>
+                                    <td class="main" align="left"><?php echo  tep_draw_checkbox_field('add_wishprod[]',$products['products_id']); ?></td>
+                                    <td class="main" align="right"><?php echo BOX_TEXT_DELETE; ?>&nbsp;&nbsp;</td>
+                                    <td class="main" align="left"><?php echo tep_draw_checkbox_field('del_wishprod[]',$products['products_id']); ?></td>
+                                  </tr>
+                                </table>
+                              </td>
+                            </tr>
+                          </table>
+                          <?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5'); ?>
+                        </td> 
+                      </tr>
+                    </table></td>
+                    <!-- move/delete checkboxes_end -->
+                    <?php
+                      if ( ($col / 1) == floor($col / 1) ) {
+                      // if ((($col / MAX_DISPLAY_WISHLIST_COLS) == floor($col / MAX_DISPLAY_WISHLIST_COLS))) {
+                      ?>
+                        </tr>
+<!--                        <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>-->
+                        <tr>
+                      <?php
+                      }
+                  } //end while
+                  ?>
+                </tr>
+              </table>
+             </td>
+          </tr>
+			<?php
+              if ( ($wishlist_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
+              ?>
+              <tr>
+              <table border="0" width="100%" cellspacing="0" cellpadding="2" class="alt_pag" >
+                <tr>
+                  <td class="smallText" style="padding-top: 15px;"><?php echo $wishlist_split->display_count(TEXT_DISPLAY_NUMBER_OF_WISHLIST); ?></td>
+                  <td align="right" class="smallText"  style="padding-top: 15px;"><?php echo TEXT_RESULT_PAGE . ' ' . $wishlist_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+                </tr>
+              </table></td>
+              </tr>
+              <?php
+              }
+              ?>        
+          
+          <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '40'); ?></td></tr>
+          <tr>
+            <td class="main" colspan="2">
+              <table border="0" width="100%" cellspacing="0" cellpadding="0" class="cartoptions">
+                <tr>
+                  <td class="main" width="33%" align="left"><a href="<?php echo tep_href_link(FILENAME_DEFAULT, '', 'SSL'); ?>"><?php echo tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING); ?></a></td>
+                  <td class="main" width="33%" align="center"><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'); ?>"><?php echo tep_template_image_button('button_view_cart.gif', IMAGE_BUTTON_IN_CART); ?></a></td>
+                  <td class="main" width="33%" align="right"><?php echo tep_template_image_submit('button_update.gif', IMAGE_BUTTON_UPDATE); ?></td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+          
+          </form>
+          <tr>
+            <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '40'); ?></td>
+          </tr>
+           <tr>
+            <td colspan="4" align="center">
+			<!-- tell_a_friend //-->
+			
+			<table width="50%">
+			<tr>
+				<td class="review_product_box">
+			<form method="get" action="<?php echo FILENAME_WISHLIST_SEND; ?>" name="tell_a_friend" style="text-align: left;">
+            <?php
+            	echo "<div class='estimator_title'>".BOX_TEXT_SEND."</div>";
+            	echo tep_draw_hidden_field('products_ids', $HTTP_GET_VARS['products_ids']) . tep_hide_session_id();
+            	echo "<div class='send_to_friend_form'><span class='label'>Friends email address:</span><input type='text' size='20' name='send_to' class='input_text' /> <span class='submit'>".tep_template_image_submit('button_tell_a_friend.gif', BOX_TEXT_SEND)."</span></div>";
+                         
+              // tell_a_friend_eof 
+            ?>
+            </form>
+            	</td>
+            </tr>
+            </table>
+            
+            <?php 
+            } else { // Nothing in the customers wishlist
+            ?>
+              <tr>
+                <td>
+                  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                     <tr>
+                        <td class="main"><?php echo BOX_TEXT_NO_ITEMS;?></td>
+                     </tr>
+                   </table>
+            <?php
+             }
+            ?>
+            <!-- customer_wishlist_eof //-->
+            </td>
+        </tr>
+      </table></td>
+      <?php
+      // BOF: Lango Added for template MOD
+      if (MAIN_TABLE_BORDER == 'yes'){
+        table_image_border_bottom();
+      }
+      // EOF: Lango Added for template MOD
+      ?>
+    </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/templates/OpenMoko/wishlist_email.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMoko/wishlist_email.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMoko/wishlist_email.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,201 @@
+<?php
+         echo tep_draw_form('email_wish', tep_href_link(FILENAME_WISHLIST_SEND, 'action=process&products_id=' . $HTTP_GET_VARS['products_id'], 'SSL')) . tep_draw_hidden_field('products_name', $product_info['products_name']);
+?>
+
+  <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php 
+
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+  if ($messageStack->size('friend') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('friend'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main my_account_title bordered1"><b><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></b></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="0" cellpadding="2" class="form_table">
+                  <tr>
+                    <td class="main simple_first_row"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
+                    <td class="main"><?php echo $from_name . tep_draw_hidden_field('from_name', $from_name); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
+                    <td class="main"><?php echo $from_email_address . tep_draw_hidden_field('from_email_address', $from_email_address); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
+          </tr>
+          <tr>
+            <td class="main my_account_title bordered1"><b><?php echo FORM_TITLE_FRIEND_DETAILS; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="0" cellpadding="2" class="form_table">
+                  <tr>
+                    <td class="main simple_first_row"><?php echo FORM_FIELD_FRIEND_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('to_name') . '&nbsp;<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_FRIEND_EMAIL; ?></td>
+                    <td class="main">
+                    	<input type="text" name="to_email_address" value="<?php echo isset($_GET['send_to']) ? $_GET['send_to'] : null; ?>"/>&nbsp;<span class="inputRequirement"><?php echo ENTRY_EMAIL_ADDRESS_TEXT; ?></span>
+                   	</td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
+          </tr>
+      
+      <!--
+  VISUAL VERIFY CODE start -->
+      <tr>
+        <td class="main my_account_title bordered1"><b><?php echo VISUAL_VERIFY_CODE_CATEGORY; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2" class="form_table">
+              <tr>
+                <td class="main simple_first_row"><?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('visual_verify_code') . '&nbsp;' . '<span class="inputRequirement">' . VISUAL_VERIFY_CODE_ENTRY_TEXT . '</span>'; ?></td>
+
+                <td class="main">
+                  <?php
+                      //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3
+                    $visual_verify_code = ""; 
+                    for ($i = 1; $i <= rand(3,6); $i++){
+                          $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1);
+                     }
+                     $vvcode_oscsid = tep_session_id($HTTP_GET_VARS[tep_session_name()]);
+                     tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'");
+                     $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code);
+                     tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array);
+                     $visual_verify_code = "";
+                     echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '"');
+                  ?>
+                </td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
+      </tr>
+<!--
+  VISUAL VERIFY CODE stop   -->
+      
+          <tr>
+            <td class="main my_account_title bordered1"><b><?php echo FORM_FIELD_PRODUCTS; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents send_to_friend_links">
+                <td><?php echo $wishliststring ; ?></td>
+              </tr>
+            </table></td>
+          </tr>     
+      
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
+          </tr>
+          <tr>
+            <td class="main my_account_title bordered1"><b><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents send_to_friend_text">
+                <td><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+      	<td class="inputRequirement"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox cartoptions">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+<?php if ($valid_product == "true") {
+?>
+             <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+
+<?php
+}
+?>                
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/OpenMoko.sql
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/OpenMoko.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/OpenMoko.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#FFFFFF');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "OpenMoko.gif", template_cellpadding_main ="3", template_cellpadding_sub= "8", template_cellpadding_left= "3", template_cellpadding_right= "3", site_width= "100%", include_column_left= "yes", include_column_right= "yes", box_width_left= "130", box_width_right= "130", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no", show_header_link_buttons="yes", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width= "1", side_box_right_width= "1"  WHERE template_id="#tID#"

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/affiliate.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 - 2003 osCommerce
+   
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3386 $
+
+  Released under the GNU General Public License
+*/
+?>          
+<!-- affiliate_system //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_AFFILIATE . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (tep_session_is_registered('affiliate_id')) {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . BOX_AFFILIATE_SUMMARY . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, '', 'SSL'). '">' . BOX_AFFILIATE_NEWS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL'). '">' . BOX_AFFILIATE_ACCOUNT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'). '">' . BOX_AFFILIATE_PAYMENT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'). '">' . BOX_AFFILIATE_CLICKRATE . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'). '">' . BOX_AFFILIATE_SALES . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS). '">' . BOX_AFFILIATE_BANNERS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_FAQ). '">' . BOX_AFFILIATE_FAQ . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_LOGOUT). '">' . BOX_AFFILIATE_LOGOUT . '</a>');
+  } else {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_INFO). '">' . BOX_AFFILIATE_INFO . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . BOX_AFFILIATE_LOGIN . '</a>');
+  }
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- affiliate_system_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/articles.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,220 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2249 $
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_topic($counter) {
+    global $tree, $topics_string, $tPath_array;
+
+    for ($i=0; $i<$tree[$counter]['level']; $i++) {
+      $topics_string .= "&nbsp;&nbsp;";
+    }
+
+    $topics_string .= '<a href="';
+
+    if ($tree[$counter]['parent'] == 0) {
+      $tPath_new = 'tPath=' . $counter;
+    } else {
+      $tPath_new = 'tPath=' . $tree[$counter]['path'];
+    }
+
+    $topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '<b>';
+    }
+
+// display topic name
+    $topics_string .= $tree[$counter]['name'];
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '</b>';
+    }
+
+    if (tep_has_topic_subtopics($counter)) {
+      $topics_string .= ' -&gt;';
+    }
+
+    $topics_string .= '</a>';
+
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_in_topic = tep_count_articles_in_topic($counter);
+      if ($articles_in_topic > 0) {
+        $topics_string .= '&nbsp;(' . $articles_in_topic . ')';
+      }
+    }
+
+    $topics_string .= '<br>';
+
+    if ($tree[$counter]['next_id'] != false) {
+      tep_show_topic($tree[$counter]['next_id']);
+    }
+  }
+?>
+<!-- topics //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_ARTICLES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $topics_string = '';
+  $tree = array();
+
+  $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '0' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+  while ($topics = tep_db_fetch_array($topics_query))  {
+    $tree[$topics['topics_id']] = array('name' => $topics['topics_name'],
+                                        'parent' => $topics['parent_id'],
+                                        'level' => 0,
+                                        'path' => $topics['topics_id'],
+                                        'next_id' => false);
+
+    if (isset($parent_id)) {
+      $tree[$parent_id]['next_id'] = $topics['topics_id'];
+    }
+
+    $parent_id = $topics['topics_id'];
+
+    if (!isset($first_topic_element)) {
+      $first_topic_element = $topics['topics_id'];
+    }
+  }
+
+  //------------------------
+  if (tep_not_null($tPath)) {
+    $new_path = '';
+    reset($tPath_array);
+    while (list($key, $value) = each($tPath_array)) {
+      unset($parent_id);
+      unset($first_id);
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$value . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+      if (tep_db_num_rows($topics_query)) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($topics_query)) {
+          $tree[$row['topics_id']] = array('name' => $row['topics_name'],
+                                           'parent' => $row['parent_id'],
+                                           'level' => $key+1,
+                                           'path' => $new_path . '_' . $row['topics_id'],
+                                           'next_id' => false);
+
+          if (isset($parent_id)) {
+            $tree[$parent_id]['next_id'] = $row['topics_id'];
+          }
+
+          $parent_id = $row['topics_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['topics_id'];
+          }
+
+          $last_id = $row['topics_id'];
+        }
+        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
+        $tree[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_topic($first_topic_element);
+
+  $info_box_contents = array();
+  $new_articles_string = '';
+  $all_articles_string = '';
+
+  if (DISPLAY_NEW_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_new_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and(a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = ad.articles_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a2t.topics_id = td.topics_id 
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'
+                                            and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY)");
+      $articles_new_count = ' (' . tep_db_num_rows($articles_new_query) . ')';
+    } else {
+      $articles_new_count = '';
+    }
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string = '<b>';
+    }
+
+    $new_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES_NEW, '', 'NONSSL') . '">' . BOX_NEW_ARTICLES . '</a>';
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string .= '</b>';
+    }
+
+    $new_articles_string .= $articles_new_count . '<br>';
+
+  }
+
+  if (DISPLAY_ALL_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_all_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a.articles_id = ad.articles_id
+                                            and a2t.topics_id = td.topics_id
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'");
+      $articles_all_count = ' (' . tep_db_num_rows($articles_all_query) . ')';
+    } else {
+      $articles_all_count = '';
+    }
+
+    if ($topic_depth == 'top') {
+      $all_articles_string = '<b>';
+    }
+
+    $all_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES, '', 'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a>';
+
+    if ($topic_depth == 'top') {
+      $all_articles_string .= '</b>';
+    }
+
+    $all_articles_string .= $articles_all_count . '<br>';
+
+  }
+
+  $info_box_contents[] = array('text' => $new_articles_string . $all_articles_string . $topics_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- topics_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/asearch.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/asearch.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/asearch.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: asearch.php
+  searches articles using article_manager
+  by AlDaffodil (aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- article search //-->
+          <tr>
+            <td>
+<?php
+ //if (ALLOW_QUICK_SEARCH_DESCRIPTION == 'true') {
+  //  $param = '<input type="hidden" name="search_in_description" value="1">';
+ //  } else {
+      $param = '';
+// }
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_ASEARCH . '</font>');
+     new infoBoxHeading($info_box_contents, false, false);
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find_article" method="get" action="' . tep_href_link(FILENAME_ARTICLE_SEARCH, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . $param . '<input type="text" name="akeywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["akeywords"])) . '">' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><input type="checkbox" name="description">' . BOX_ASEARCH_TEXT . '<br>');
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- article_search //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/authors.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name");
+  if ($number_of_author_rows = tep_db_num_rows($authors_query)) {
+?>
+<!-- authors //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_AUTHORS . '</font>');
+
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_author_rows <= MAX_DISPLAY_AUTHORS_IN_A_LIST) {
+// Display a list
+      $authors_list = '';
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        if (isset($HTTP_GET_VARS['authors_id']) && ($HTTP_GET_VARS['authors_id'] == $authors['authors_id'])) $authors_name = '<b>' . $authors_name .'</b>';
+        $authors_list .= '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $authors['authors_id']) . '">' . $authors_name . '</a><br>';
+      }
+
+      $authors_list = substr($authors_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $authors_list);
+    } else {
+// Display a drop-down
+      $authors_array = array();
+      if (MAX_AUTHORS_LIST < 2) {
+        $authors_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        $authors_array[] = array('id' => $authors['authors_id'],
+                                       'text' => $authors_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('authors', tep_href_link(FILENAME_ARTICLES, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('authors_id', $authors_array, (isset($HTTP_GET_VARS['authors_id']) ? $HTTP_GET_VARS['authors_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_AUTHORS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- authors_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/best_sellers.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/best_sellers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/best_sellers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: best_sellers.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($current_category_id) && ($current_category_id > 0)) {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  } else {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  }
+
+  if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
+?>
+<!-- best_sellers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_BESTSELLERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $rows = 0;
+    $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
+      $rows++;
+      $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
+    }
+    $bestsellers_list .= '</table>';
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => $bestsellers_list);
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- best_sellers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/boxad.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/boxad.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/boxad.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: boxad.php, v 1.1 2002/03/21 by aubrey at mycon.co.za
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+*/
+?>
+<!-- banner-ad-in-a-box //-->
+<?php
+  if ($banner = tep_banner_exists('dynamic', BOX_AD_BANNER_TYPE)) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+<!-- banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/calendar.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+$ID
+  ~ events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it 
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2426 $
+
+*/
+
+
+?>
+<!-- events_calendar //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CALENDER . '</font>');
+    new infoBoxHeading($info_box_contents, false, false,tep_href_link(FILENAME_EVENTS_CALENDER));
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'center',
+                                'text' => '<iframe name="calendar" id="calendar" align="center" marginwidth="0" marginheight="0" ' .
+                                          'src='  . FILENAME_EVENTS_CALENDAR_CONTENT . '?_month=' . $_month .'&amp;_year='. $_year .' frameborder=0 height=220 width=162 scrolling=no> ' .IFRAME_ERROR.'</iframe> ');
+   
+ 
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- events_calendar //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/card1.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/card1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/card1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1609 $
+
+*/
+?>
+<!-- Card Info Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CARD1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+//                               'text'  => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .
+//elari chanegd to provide a link to your payment acount
+                               'text'  => tep_image(DIR_WS_IMAGES . 'cards/logo-xclick_paypal.gif' , BOX_INFORMATION_CARD).
+                               '<br>' . tep_image(DIR_WS_IMAGES . 'cards/cards2.gif', BOX_INFORMATION_CARD) . '<br>'
+                               );
+
+new infoBox($info_box_contents);
+?>
+</td></tr>
+<!-- card_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,165 @@
+<?php
+/*
+  $Id: categories.php,v 1.1.1.1 2004/03/04 23:42:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3432 $
+
+  Released under the GNU General Public License
+*/
+$count=0;
+
+ function tep_show_category($counter,$count) {
+    global $foo, $categories_string, $id;
+
+$count++;
+    if ($count != 1) {
+$image=2;
+$HEIGHT = 20;
+     }else{
+$image=1;
+$HEIGHT = 21;
+}
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+
+    $categories_string .= '<tr><td>';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+    
+    $categories_string .= '<a class="navBlue" href="';
+
+}else{
+    $categories_string .= '&nbsp;';
+if ($foo[$counter]['parent'] != 0) {
+      $class="subnavBlue";
+   } else {
+  $class="navGrey";
+}
+
+if ($foo[$counter]['parent'] != 0) {
+      $categories_string .= '&nbsp;';
+   } else {
+         ;
+}
+    $categories_string .= '<a class="' . $class . '" href="';
+
+}
+
+    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string .= '">';
+// display category name
+      $categories_string .= $foo[$counter]['name'];
+    $categories_string .= '</a>';
+//    $categories_string .= '</td></tr>' ;
+
+
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category($foo[$counter]['next_id'],$count);
+    }
+
+  }
+?>
+<!-- categories //-->
+                  <tr>
+                    <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => '<font color="' . $font_color . '">' .BOX_HEADING_CATEGORIES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+$categories_string = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      $new_path .= $value;
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      while ($row = tep_db_fetch_array($categories_query)) {
+        $foo[$row['categories_id']] = array(
+                                            'name' => $row['categories_name'],
+                                            'parent' => $row['parent_id'],
+                                            'level' => $key+1,
+                                            'path' => $new_path . '_' . $row['categories_id'],
+                                            'next_id' => false
+                                           );
+
+        if (isset($prev_id)) {
+          $foo[$prev_id]['next_id'] = $row['categories_id'];
+        }
+
+        $prev_id = $row['categories_id'];
+
+        if (!isset($first_id)) {
+          $first_id = $row['categories_id'];
+        }
+
+        $last_id = $row['categories_id'];
+      }
+      if ($category_check != 0) {
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+      }
+
+      $new_path .= '_';
+    }
+  }
+
+  tep_show_category($first_element,$count);
+
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text'  => $categories_string
+                              );
+new infobox($info_box_contents);
+
+?>
+                    </td>
+                  </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories1.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- categories1 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(),
+                               'align' => 'left',
+                               'text'  => tep_draw_pull_down_menu('cPath', tep_get_categories(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"')
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- categories1_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories2.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,173 @@
+<?php
+/*
+  $Id: categories2.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+
+//###############################################
+if ( (USE_CACHE == 'true') && !defined('SID')) {
+    echo tep_cache_categories_box();
+  } else {
+//###############################################
+
+
+  function tep_show_category2($counter) {
+    global $foo, $categories_string2, $id;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      $categories_string2 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string2 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string2 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string2 .= '">';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '<b>';
+    }
+
+// display category name
+    $categories_string2 .= $foo[$counter]['name'];
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '</b>';
+    }
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string2 .= '-&gt;';
+    }
+
+    $categories_string2 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string2 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string2 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category2($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories 2 //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES2 . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+
+  $categories_string2 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_category2($first_element);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string2
+                              );
+  new infoBox($info_box_contents);
+
+$info_box_contents = array();
+
+?>
+            </td>
+          </tr>
+<!--############################################### //-->
+<?php
+}
+?>
+<!--############################################## //-->
+<!--categories2_eof //-->
+

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories3.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories3.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories3.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+/*
+  $Id: categories3.php,v 1.1 2004/04/05
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004osCommerce
+
+  Released under the GNU General Public License
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+*/
+
+// Categories_tree written by Gideon Romm from Symbio Technologies, LLC
+
+function tep_show_category3($cid, $cpath, $COLLAPSABLE) {
+  global $categories_string3, $languages_id, $HTTP_GET_VARS;
+  global $level;
+  $selectedPath = array();
+
+// Get all of the categories on this level
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }
+    $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;
+
+// Add category link to $categories_string3
+    for ($a=1; $a<$level{$categories['categories_id']}; $a++) {
+      $categories_string3 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string3 .= '<a href="';
+
+    $cPath_new = $cpath;
+    if ($level{$categories['parent_id']} > 0) {
+      $cPath_new .= "_";
+    }
+    $cPath_new .= $categories['categories_id'];
+
+    $cPath_new_text = "cPath=" . $cPath_new;
+
+    $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
+    $categories_string3 .= '">';
+
+    if ($HTTP_GET_VARS['cPath']) {
+      $selectedPath = split("_", $HTTP_GET_VARS['cPath']);
+    }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '<b>'; }
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '<u>'; }
+
+    $categories_string3 .= $categories['categories_name'];
+    if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string3 .= ' ->'; }
+
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '</u>'; }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '</b>'; }
+
+    $categories_string3 .= '</a>';
+
+    if (SHOW_COUNTS) {
+      $products_in_category = tep_count_products_in_category($categories['categories_id']);
+      if ($products_in_category > 0) {
+        $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string3 .= '<br>';
+
+
+// If I have subcategories, get them and show them
+    if (tep_has_category_subcategories($categories['categories_id'])) {
+
+      if ($COLLAPSABLE) {
+        if (in_array($categories['categories_id'], $selectedPath)) {
+          tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE);
+        }
+      }
+      else { tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE); }
+
+    }
+
+  }
+
+}
+?>
+
+
+<!--categories 3 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES3 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string3 = '';
+
+// tep_show_category3(<top category_id>, <top cpath>, <1=Collapsable tree, 0=static--show all>)
+  tep_show_category3(0,'',0);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string3
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!--categories_eof 3 //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories4.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories4.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories4.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,188 @@
+<?php
+/*
+  $Id: categories4.php,v 1.0
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_category4($counter) {
+    global $foo, $categories_string4, $id, $aa;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      if ($a == $foo[$counter]['level']-1)
+      {
+    $categories_string4 .= "<font color='#ff0000'>|__</font>";
+      } else
+        {
+        $categories_string4 .= "<b><font color='#ff0000'>&nbsp;&nbsp;&nbsp;&nbsp;</font></b>";
+        }
+
+    }
+    if ($foo[$counter]['level'] == 0)
+  {
+    if ($aa == 1)
+    {
+    $categories_string4 .= "<hr>";
+      }
+    else
+    {$aa=1;}
+
+  }
+
+
+    $categories_string4 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string4 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string4 .= '">';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $categories_string4 .= '<b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= "<b><font color='#ff0000'>";
+    }
+
+// display category name
+    $categories_string4 .= $foo[$counter]['name'];
+
+      if ($foo[$counter]['parent'] == 0) {
+       $categories_string4 .= '</b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= '</font></b>';
+    }
+
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string4 .= '<b>-&gt; </b>';
+    }
+
+    $categories_string4 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string4 .= '&nbsp;(' . $products_in_category . ')';
+      }    }
+
+    $categories_string4 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category4($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories 4//-->
+          <tr>
+            <td>
+<?php
+  $aa = 0;
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES4 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string4 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+   tep_show_category4($first_element);
+
+ //coment out the below line if you do not want to havw an all products list
+    $categories_string4 .= "<hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODS) . '"><b>' . BOX_INFORMATION_ALLPRODS . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODCATS) . '"><b>' . ALL_PRODUCTS_LINK . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODMANF) . '"><b>' . ALL_PRODUCTS_MANF . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br>\n";
+
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                'text'  => $categories_string4
+                               );
+   new infoBox($info_box_contents);
+?>
+
+        </td>
+          </tr>
+<!--categories_eof 4//-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories5.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/categories5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: all_categories.php,v 1.6 2002/04/22 20:34:00 clescuyer Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Goélette
+  Christian Lescuyer <cl at goelette.net>
+  http://www.goelette.net/
+  http://oscommerce.goelette.net/
+
+  History: 1.1 Creation
+           1.2 Modified query for compatibility with older databases
+           1.3 Query in 1.2 was wrong for older databases
+           1.4 SHOW_COUNTS test corrected
+           1.5 Added COMPACT_CATEGORIES option to display all sub-categories on one line
+           1.6 Removed COMPACT_CATEGORIES option
+               Corrected the cpath generation
+               Bold categories "path" to selected category, an idea from Peter Fürsicht
+           1.7 Cleaned the way in which the categories are displayed - bold for the path,
+               ">" to indicate the current category, removed link to current category,
+               only indent subcategories (top level are flush left)
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+  Released under the GNU General Public License
+
+*/
+
+// Keep out parts category
+    $excluded_parts_category_id = 28;
+
+
+// Preorder tree traversal
+  function preorder($cid, $level5, $foo5, $cpath) {
+    global $categories_string5, $HTTP_GET_VARS;
+
+    if ($cid != 0) {
+  // 1.7 Get the current path info
+      $category_path = explode('_',$HTTP_GET_VARS['cPath']);
+      $in_path = in_array($cid, $category_path);
+      $this_category = array_pop($category_path);
+
+      for ($i=0; $i<$level5; $i++)
+      // 1.7 only indent subcategories (top level are flush left)
+        if ($i>0) {
+          $categories_string5 .=  '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
+        }
+        // 1.7 indicate the current category
+        if ($this_category == $cid) {
+          $categories_string5 .=  '> ';
+        }
+
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '">';
+        }
+  // 1.6 Are we on the "path" to selected category? If yes, use <b>
+        if ($in_path) {
+          $categories_string5 .=  '<b>';
+        }
+        $categories_string5 .=  $foo5[$cid]['name'];
+        if ($in_path)
+          $categories_string5 .=  '</b>';
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '</a>';
+        }
+    // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+          if (SHOW_COUNTS == 'true') {
+            $products_in_category = tep_count_products_in_category($cid);
+            if ($products_in_category > 0) {
+              $categories_string5 .= '&nbsp;(' . $products_in_category . ')';
+            }
+          }
+        $categories_string5 .= '<br>' ."\n";
+      }
+
+// Traverse category tree
+      foreach ($foo5 as $key => $value) {
+        if ($foo5[$key]['parent'] == $cid) {
+  //        print "$key, $level5, $cid, $cpath<br>";
+          preorder($key, $level5+1, $foo5, ($level5 != 0 ? $cpath . $cid . '_' : ''));
+        }
+      }
+  }
+
+?>
+<!--  categories 5//-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES5);
+  new infoBoxHeading($info_box_contents, false, false);
+
+
+//////////
+// Get categories list
+//////////
+// 1.2 Test for presence of status field for compatibility with older versions
+  $status = tep_db_num_rows(tep_db_query('describe categories status'));
+  $query5 = "select 
+    c.categories_id, 
+    cd.categories_name, 
+    c.categories_image,
+    c.parent_id from 
+    " . TABLE_CATEGORIES . " c,
+    " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+    where 
+    c.parent_id = '0' 
+   and c.categories_id = cd.categories_id 
+   and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+ 
+
+  $categories_query5 = tep_db_query($query5);
+
+// Stuff in an array
+  while ($categories5 = tep_db_fetch_array($categories_query5))  {
+    $foo5[$categories5['categories_id']] = array('name' => $categories5['categories_name'], 'parent' => $categories5['parent_id']);
+  }
+
+// Initiate tree traverse
+  $categories_string5 = '';
+  preorder(0, 0, $foo5, '');
+
+//////////
+// Display box contents
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => $categories_string5);
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- categories5_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/currencies.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($currencies) && is_object($currencies)) {
+?>
+<!-- currencies //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CURRENCIES . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    reset($currencies->currencies);
+    $currencies_array = array();
+    while (list($key, $value) = each($currencies->currencies)) {
+      $currencies_array[] = array('id' => $key, 'text' => $value['title']);
+    }
+
+    $hidden_get_variables = '';
+    reset($HTTP_GET_VARS);
+    while (list($key, $value) = each($HTTP_GET_VARS)) {
+      if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
+        $hidden_get_variables .= tep_draw_hidden_field($key, $value);
+      }
+    }
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
+                                 'align' => 'center',
+                                 'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- currencies_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/customer_gv.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/customer_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/customer_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: customer_gv.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- Tell Customer he has a gift voucher-->
+<?php
+  if ($customer_id) {
+    $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$customer_id."'");
+    if ($gv_result=tep_db_fetch_array($gv_query)) $customer_gv_amount=$gv_result['amount'];
+  }
+if ($customer_gv_amount>0) {
+?>
+          <tr>
+            <td>
+<?php
+  
+
+ $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_GIFT_VOUCHER . '</font>'
+                               );
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<div align="center">'.GIFT_VOUCHER_ACCOUNT_BALANCE_1.$currencies->format($customer_gv_amount).GIFT_VOUCHER_ACCOUNT_BALANCE_2.'<a href="'.tep_href_link(FILENAME_GV_SEND).'">'.GIFT_VOUCHER_ACCOUNT_BALANCE_3.'</a>'
+                              );
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- Tell Customer he has a gift voucher_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/donate.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/donate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/donate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: donate.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- whats_new //-->
+          <tr>
+            <td>
+<?php 
+  
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DONATE  . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+$info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
+              <input type="hidden" name="cmd" value="_xclick">
+              <input type="hidden" name="business" value="donations at creloaded.com">
+              <input type="hidden" name="no_note" value="1">
+              <input type="hidden" name="currency_code" value="USD">
+              <input type="hidden" name="tax" value="0">
+              <input type="image" src="images/x-click_butcc_donate.gif" name="submit"  alt="'.DONATE_BUTTON_IMAGE_ALT.'">
+            </form>');
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/downloads.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/downloads.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/downloads.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,127 @@
+<?php
+/*
+  $Id: downloads.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- downloads //-->
+<?php
+
+
+  // modification of the logic to prevent the queries if there is no customer id
+  if ( $customer_id != '' ) {
+  if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+// Get last order id for checkout_success
+    $orders_query_raw = "SELECT orders_id FROM " . TABLE_ORDERS . " WHERE customers_id = '" . $customer_id . "' ORDER BY orders_id DESC LIMIT 1";
+    $orders_query = tep_db_query($orders_query_raw);
+    $orders_values = tep_db_fetch_array($orders_query);
+    $last_order = $orders_values['orders_id'];
+  } else {
+    $last_order = (int)$HTTP_GET_VARS['order_id'];
+  }
+
+// Now get all downloadable products in that order
+  $downloads_query_raw = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays
+                          FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
+                          WHERE customers_id = '" . $customer_id . "'
+                          AND o.orders_id = '" . $last_order . "'
+                          AND op.orders_id = '" . $last_order . "'
+                          AND opd.orders_products_id=op.orders_products_id
+                          AND opd.orders_products_filename<>''";
+  $downloads_query = tep_db_query($downloads_query_raw);
+
+// Don't display if there is no downloadable product
+  if (tep_db_num_rows($downloads_query) > 0) {
+     require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_DOWNLOADBOX);
+          ECHO '<tr><td>' ;
+          $info_box_contents = array();
+          $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DOWNLOADS . '</font>');
+          new infoBoxHeading($info_box_contents, false, false);
+
+           $info_box_contents = array();
+ ?>
+<!-- list of products -->
+<?php
+    while ($downloads_values = tep_db_fetch_array($downloads_query)) {
+?>
+
+<!-- left box -->
+<?php
+// MySQL 3.22 does not have INTERVAL
+      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads_values['date_purchased_day']);
+      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads_values['download_maxdays'], $dt_year);
+        $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
+
+// The link will appear only if:
+// - Download remaining count is > 0, AND
+// - The file is present in the DOWNLOAD directory, AND EITHER
+// - No expiry date is enforced (maxdays == 0), OR
+// - The expiry date is not reached
+      if (($downloads_values['download_count'] > 0) &&
+          (file_exists(DIR_FS_DOWNLOAD . $downloads_values['orders_products_filename'])) &&
+          (($downloads_values['download_maxdays'] == 0) ||
+           ($download_timestamp > time()))) {
+
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_FILE . '<br><br><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads_values['orders_products_download_id']) . '">' . $downloads_values['products_name'] . '</a>'
+                                          );
+ new infoBox($info_box_contents);
+      } else {
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => $downloads_values['products_name']
+                                          );
+ new infoBox($info_box_contents);
+
+      }
+?>
+<!-- right box -->
+<?php
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_DATE . '<br>' .  tep_date_long($download_expiry)
+                                          );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => $downloads_values['download_count'] . '  ' .  TEXT_HEADING_DOWNLOAD_COUNT
+                                        );
+  new infoBox($info_box_contents);
+ }
+
+if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => TEXT_FOOTER_DOWNLOAD . '<br><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . TEXT_DOWNLOAD_MY_ACCOUNT . '</a>'
+                                        );
+  new infoBox($info_box_contents);
+
+   }
+?>
+     </td>
+   </tr>
+<?php
+  }
+  }
+?>
+<!-- downloads_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/example.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/example.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/example.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1601 $
+
+*/
+?>
+<!-- Example_infobox Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_EXAMPLE . '</font>'
+                 // Change BOX_HEADING_EXAMPLE to your name, which you can find it easily.
+                 //and use the same in Infobox Admin to configure infobox.
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                // add infobox content below.
+                'text'  => 'Your Content here'
+                               );
+
+new infoBox($info_box_contents);
+
+?>
+</td></tr>
+<!-- Example_infobox_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/faq.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: faq.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$faq_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_FAQ_CATEGORIES . " ic, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// faq outside categories
+$faq_query = tep_db_query("select ip.faq_id, ip.question from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '0' and ip.language = '" . (int)$languages_id . "' and ip.visible = '1' order by ip.v_order, ip.question");
+
+if ((tep_db_num_rows($faq_categories_query) > 0) || (tep_db_num_rows($faq_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FAQ . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $faq_string = '';
+  while ($faq_categories = tep_db_fetch_array($faq_categories_query)) {
+    $id_string = 'cID=' . $faq_categories['categories_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($faq = tep_db_fetch_array($faq_query)) {
+    $id_string = 'fID=' . $faq['faq_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq['question'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $faq_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,83 @@
+<?php
+/*
+  $Id: featured.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- featured //-->
+<?php
+
+
+  $random_product_side = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(), featured_date_added DESC limit " . MAX_RANDOM_SELECT_SPECIALS);
+
+$random_product_side_row = tep_db_num_rows($random_product_side);
+   if ($random_product_side_row > 0){
+?>
+          <tr>
+            <td>
+<?php
+while ($featured_random_product21 = tep_db_fetch_array($random_product_side)){
+
+$featured_product21_id = $featured_random_product21['products_id'];
+$featured_product21_image = tep_get_products_image($featured_random_product21['products_id']);
+$featured_product21_name = tep_get_products_name($featured_random_product21['products_id']);
+
+  $pf->loadProduct($featured_random_product21['products_id'],$languages_id);
+        $featured_price1 = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FEATURED . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents,  false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+            'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $featured_product21_image, $featured_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id, 'NONSSL') . '">' . $featured_product21_name . '</a><br>' . $featured_price1 );
+
+
+
+   new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  
+ }
+?>
+<!-- featured_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/googlead.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/googlead.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/googlead.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: googlead.php, v 1.1 2004/05/30 Tom O'Neill (zip1)
+
+  Released under the GNU General Public License
+ based on banner in a box by aubrey at mycon.co.za
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+*/
+?>
+<!-- google-banner-ad-in-a-box //-->
+<?php
+  if (!(getenv('HTTPS')=='on')){
+  if ($banner = tep_banner_exists('dynamic', 'googlebox')) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_GOOGLE_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+  }
+?>
+<!-- google-banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/information_table.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/information_table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/information_table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: information.php,v 1.1.1.1 2003/09/18 19:05:51 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2857 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- information //-->
+          <tr>
+            <td>
+<?php
+
+require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_INFORMATIONBOX);
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_INFORMATION_TABLE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  // Retrieve information from Info table
+   $informationString = "";
+
+ // joles
+   $sql_query = tep_db_query("SELECT information_id, languages_id, info_title FROM " . TABLE_INFORMATION . " WHERE visible= '1' and languages_id ='" . (int)$languages_id . "' ORDER BY v_order");
+   while ($row = tep_db_fetch_array($sql_query)){
+   $informationString .= '<a href="' . tep_href_link(FILENAME_INFORMATION,  'info_id=' . $row['information_id'] ) . '">' . $row['info_title'] . '</a><br>';
+   }
+
+   $info_box_contents = array();
+
+if (tep_session_is_registered('customer_id')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+
+ } else if ((tep_session_is_registered('customer_id')) && (MODULE_ORDER_TOTAL_GV_STATUS == 'true')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+} else {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+}
+
+  new $infobox_template($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/languages.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- languages //-->
+          <tr>
+            <td>
+<?php
+
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LANGUAGES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+    include(DIR_WS_CLASSES . FILENAME_LANGUAGE);
+    $lng = new language;
+  }
+
+  $languages_string = '';
+  reset($lng->catalog_languages);
+  while (list($key, $value) = each($lng->catalog_languages)) {
+    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text' => $languages_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- languages_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/links.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: links.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1980 $
+
+
+  Released under the GNU General Public License
+*/
+
+
+// check for link categoris to determine if there is anything to display
+  $link_categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");
+  $number_of_categories = tep_db_num_rows($link_categories_query);
+
+  if ($number_of_categories > 0) {
+?>
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LINKS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_LINKS));
+
+    $informationString = '';
+    while($row = tep_db_fetch_array($link_categories_query)) {
+      $lPath_new = 'lPath=' . $row['link_categories_id'];
+      $informationString .= '<a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">' . $row['link_categories_name'] . '</a><br>';
+    }
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => $informationString
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,143 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  loginbox.php -   Version 1.0
+  This puts a login request in a box with a login button.
+  If already logged in, will not show anything.
+
+  Modified to utilize SSL to bypass Security Alert
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_LOGINBOX);
+
+// WebMakers.com Added: Do not show if on login or create account
+if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') )  {
+?>
+<!-- loginbox //-->
+<?php
+
+    if (!tep_session_is_registered('customer_id')) {
+?>
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $loginboxcontent = "
+       <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "\">
+            <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
+               <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_EMAIL . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_PASSWORD . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"password\" name=\"password\" maxlength=\"40\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+        <tr>
+            <td align=\"center\">
+      " . tep_draw_separator('pixel_trans.gif', '100%', '5') . "
+      </td>
+            </tr>
+              <tr>
+                <td class=\"infoboxContents\" align=\"center\">
+                  " . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "
+                </td>
+              </tr>
+             </table>
+           </form> 
+              ";
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $loginboxcontent
+                                );
+new infoBox($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<?php
+  } else {
+  // If you want to display anything when the user IS logged in, put it
+  // in here...  Possibly a "You are logged in as :" box or something.
+
+
+  }
+?>
+<!-- loginbox_eof //-->
+<?php
+// WebMakers.com Added: My Account Info Box
+} else {
+  if (tep_session_is_registered('customer_id')) {
+?>
+
+<!-- my_account_info //-->
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>'
+                              );
+   new infoBox($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<!-- my_account_info_eof //-->
+
+<?php
+  }
+}
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/manufacturer_info.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/manufacturer_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/manufacturer_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: manufacturer_info.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- manufacturer_info //-->
+<?php
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id, m.manufacturers_id as manf_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from  " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and m.manufacturers_id = p.manufacturers_id and mi.manufacturers_id = m.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'");
+//    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id from  " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+
+   while ($manufacturer = tep_db_fetch_array($manufacturer_query)) {;
+?>
+<!-- manufacturer_info //-->
+          <tr>
+            <td>
+          
+<?php
+// echo 'prod-id' . (int)$HTTP_GET_VARS['products_id'] . 'manid' . $manufacturer['manufacturers_id'];
+      $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURER_INFO . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+      if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';
+      if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';
+      $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manf_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . ' ' . $manufacturer['manufacturers_name'] . '</a></td></tr>' .
+                                   '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturer_info_string);
+
+      new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- manufacturer_info_eof //-->
+          <?php
+       }
+      }
+?>
+<!-- manufacturer_info_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+  if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
+?>
+<!-- manufacturers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
+// Display a list
+      $manufacturers_list = '';
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
+        $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
+      }
+
+      $manufacturers_list = substr($manufacturers_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturers_list);
+    } else {
+// Display a drop-down
+      $manufacturers_array = array();
+      if (MAX_MANUFACTURERS_LIST < 2) {
+        $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
+                                       'text' => $manufacturers_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- manufacturers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+/*
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+// VJ navmenu begin
+define('TABLE_NAVMENU_CATEGORIES', 'navmenu_categories');
+define('TABLE_NAVMENU_CATEGORIES_DESCRIPTION', 'navmenu_categories_description');
+define('TABLE_NAVMENU_LINKS', 'navmenu_links');
+define('TABLE_NAVMENU_LINKS_DESCRIPTION', 'navmenu_links_description');
+define('TABLE_NAVMENU_LINKS_TO_CATEGORIES', 'navmenu_links_to_categories');
+// VJ navmenu end
+
+function tep_nm_get_navmenu_list($pid = 0, $list_string = '', $style_id = '') {
+  global $languages_id;
+
+  $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name
+                                    from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                         " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd
+                                    where c.nmc_parent_id = '" . (int)$pid . "'
+                                      and cd.nmc_id = c.nmc_id
+                                      and cd.language_id = '" . (int)$languages_id . "'
+                                    order by c.nmc_sort_order, cd.nmc_name");
+
+  $links_query = tep_db_query("select l.nml_id, l.nml_url, ld.nml_name
+                               from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                    " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c,
+                                    " . TABLE_NAVMENU_LINKS . " l,
+                                    " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld
+                               where c.nmc_id = '" . (int)$pid . "'
+                                 and c.nmc_id = l2c.nmc_id
+                                 and l2c.nml_id = l.nml_id
+                                 and ld.nml_id = l.nml_id
+                                 and ld.language_id = '" . (int)$languages_id . "'
+                               order by l.nml_sort_order, ld.nml_name");
+
+  if ((tep_db_num_rows($categories_query) > 0) || (tep_db_num_rows($links_query) > 0)) {
+    if (empty($list_string)) {
+      $list_string .= '<ul id="' . $style_id . '">' . "\n";
+    } else {
+      $list_string .= '<ul>' . "\n";
+    }
+
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $list_string .= '<li><a href="#">' . $categories['nmc_name'] . '</a>';
+
+      $list_string = tep_nm_get_navmenu_list((int)$categories['nmc_id'], $list_string);
+
+      $list_string .= '</li>' . "\n";
+    } 
+
+    while ($links = tep_db_fetch_array($links_query)) {
+      $list_string .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $links['nml_url'], 'NONSSL') . '">' . $links['nml_name'] . '</li>' . "\n";
+    } 
+
+    $list_string .= '</ul>' . "\n";
+  }
+
+  return $list_string;
+}
+?>
+<!-- navmenu //-->
+<script type="text/javascript"><!--
+sfHover = function() {
+   var sfEls = document.getElementById("navMenu").getElementsByTagName("LI");
+   for (var i=0; i<sfEls.length; i++) {
+     sfEls[i].onmouseover=function() {
+       this.className+=" sfhover";
+     }
+     sfEls[i].onmouseout=function() {
+       this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
+     }
+   }
+}
+if (window.attachEvent) window.attachEvent("onload", sfHover);
+//--></script>
+                  <tr>
+                    <td>
+                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
+                      <tr>
+                        <td width="100%">
+<?php
+$info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NAVMENU . '</font>');
+new infoBoxHeading($info_box_contents, false, false);
+
+$menu_string = tep_nm_get_navmenu_list(0, '', 'navMenu');
+
+// VJ debug
+//print_r($menu_string);
+
+$info_box_contents = array(array('text' =>  $menu_string));
+
+new infoBox($info_box_contents);
+?>
+                        </td>
+                      </tr>
+                    </table>
+                    </td>
+                  </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/order_history.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/order_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/order_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: order_history.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1182 $
+
+
+  Released under the GNU General Public License
+*/
+
+  if (tep_session_is_registered('customer_id')) {
+// retreive the last x products purchased
+    $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
+    if (tep_db_num_rows($orders_query)) {
+?>
+<!-- customer_orders //-->
+          <tr>
+            <td>
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CUSTOMER_ORDERS . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $product_ids = '';
+      while ($orders = tep_db_fetch_array($orders_query)) {
+        $product_ids .= (int)$orders['products_id'] . ',';
+      }
+      $product_ids = substr($product_ids, 0, -1);
+
+      $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+      $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+        // changes the cust_order into a buy_now action
+        $customer_orders_string .= '  <tr>' .
+                                   '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
+                                   '    <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
+                                   '  </tr>';
+      }
+      $customer_orders_string .= '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $customer_orders_string);
+
+      new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- customer_orders_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/pages.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: pages.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$pages_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_PAGES_CATEGORIES . " ic, " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// pages outside categories
+$pages_query = tep_db_query("select ip.pages_id, ipd.pages_title
+                             from " . TABLE_PAGES . " ip
+                             left join " . TABLE_PAGES_TO_CATEGORIES . " ip2c on (ip2c.pages_id = ip.pages_id and ip2c.categories_id = '0'),
+                                  " . TABLE_PAGES_DESCRIPTION . " ipd
+                             where ip.pages_status = '1'
+                               and ipd.pages_id = ip.pages_id
+                               and ipd.language_id = '" . (int)$languages_id . "'
+                             order by ip.pages_sort_order, ipd.pages_title");
+
+if ((tep_db_num_rows($pages_categories_query) > 0) || (tep_db_num_rows($pages_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_PAGES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $pages_string = '';
+  while ($pages_categories = tep_db_fetch_array($pages_categories_query)) {
+    $id_string = 'cID=' . $pages_categories['categories_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($pages = tep_db_fetch_array($pages_query)) {
+    $id_string = 'pID=' . $pages['pages_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages['pages_title'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $pages_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/product_notifications.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/product_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/product_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: product_notifications.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2746 $
+
+
+  Released under the GNU General Public License
+*/
+if (isset($HTTP_POST_VARS['products_id']) && tep_not_null($HTTP_POST_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+  } elseif (isset($HTTP_GET_VARS['products_id']) && tep_not_null($HTTP_GET_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_GET_VARS['products_id']);
+  } 
+  if ( (isset($HTTP_GET_VARS['products_id'])) || (isset($HTTP_POST_VARS['products_id'])) ) {
+?>
+<!-- notifications //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NOTIFICATIONS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
+
+    if (tep_session_is_registered('customer_id')) {
+      $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      $notification_exists = (($check['count'] > 0) ? true : false);
+    } else {
+      $notification_exists = false;
+    }
+
+    $info_box_contents = array();
+    if ($notification_exists == true) {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    } else {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- notifications_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/reviews.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1738 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- reviews //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_REVIEWS . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_REVIEWS));
+
+  $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'";
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $random_select .= " and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'";
+  }
+  $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
+  $random_product = tep_random_select($random_select);
+
+  $info_box_contents = array();
+
+  if ($random_product) {
+// display random review box
+    $review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'");
+    $review = tep_db_fetch_array($review_query);
+
+    $review = tep_break_string(tep_output_string_protected($review['reviews_text']), 15, '-<br>');
+
+    $info_box_contents[] = array('text' => '<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div>');
+  } elseif (isset($HTTP_GET_VARS['products_id'])) {
+// display 'write a review' box
+    $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . BOX_REVIEWS_WRITE_REVIEW .'</a></td></tr></table>');
+  } else {
+// display 'no reviews' box
+    $info_box_contents[] = array('text' => BOX_REVIEWS_NO_REVIEWS);
+  }
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- reviews_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/search.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: search.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" ') . '&nbsp;' . tep_hide_session_id() . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');
+
+  new infoBox($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/search1.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/search1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/search1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: search1.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH1 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find1" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px">&nbsp;' . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br>'
+                              );
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- shop by price //-->
+<?php
+if (MODULE_SHOPBYPRICE_RANGES > 0) {
+?>
+          <tr>
+            <td>
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOP_BY_PRICE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $sbp_array = unserialize(MODULE_SHOPBYPRICE_RANGE);
+
+  $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=0', 'NONSSL') . '">' . TEXT_INFO_UNDER . $currencies->format($sbp_array[0]) . '</a><br>');
+  for ($i=1, $ii=count($sbp_array); $i < $ii; $i++) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . TEXT_INFO_FROM . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_TO . $currencies->format($sbp_array[$i]) . '</a><br>');
+  }
+  if (MODULE_SHOPBYPRICE_OVER == True) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_ABOVE . '</a><br>');
+  }
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- shop_by_price //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,130 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1609 $
+
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- shopping_cart //-->
+<script type="text/javascript"><!--
+function couponpopupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOPPING_CART . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));
+
+  $cart_contents_string = '';
+  if ($cart->count_contents() > 0) {
+    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+  $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
+    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
+  if ((int)$products_parent_id['products_parent_id'] != 0) {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '">';
+  } else {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+  }
+
+//      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+      $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        tep_session_unregister('new_products_id_in_cart');
+      }
+    }
+    $cart_contents_string .= '</table>';
+  } else {
+    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $cart_contents_string);
+
+  if ($cart->count_contents() > 0) {
+    // WebMakers.com Added: Shoppe Enhancement Controller
+    // check for free order
+    $final_total=$cart->show_total();
+    if ($final_total==0) {
+      $final_total='Free';
+    } else {
+      $final_total=$currencies->format($cart->show_total());
+    }
+    $info_box_contents[] = array('text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'right',
+                                 'text' => $final_total);
+  }
+// ICW ADDED FOR CREDIT CLASS GV
+  if (tep_session_is_registered('customer_id')) {
+    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $gv_result = tep_db_fetch_array($gv_query);
+    if ($gv_result['amount'] > 0 ) {
+      $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');
+    }
+  }
+  if (tep_session_is_registered('gv_id')) {
+    $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
+    $coupon = tep_db_fetch_array($gv_query);
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');
+
+  }
+  if (tep_session_is_registered('cc_id') && $cc_id) {
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');
+
+  }
+
+// ADDED FOR CREDIT CLASS GV END ADDITTION
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- shopping_cart_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+
+   $random_product25 = tep_db_query("select distinct
+   p.products_id, 
+   pd.products_name, 
+   p.products_tax_class_id, 
+   p.products_image, 
+   s.specials_new_products_price 
+   from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+    " . TABLE_SPECIALS . " s 
+   where 
+   p.products_status = '1' 
+   and p.products_id = s.products_id 
+   and pd.products_id = s.products_id 
+   and pd.language_id = '" . (int)$languages_id . "' 
+   and s.status = '1' 
+   order by rand(), s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
+ 
+  
+  $random_product24_side_row = tep_db_num_rows($random_product25);
+     if ($random_product24_side_row > 0){
+
+?>
+<!-- d specials //-->
+          <tr>
+            <td>
+<?php
+
+while ($product_specials22 = tep_db_fetch_array($random_product25)){
+  $product_specials22_id = $product_specials22['products_id'];
+  $product_specials22_image = tep_get_products_image($product_specials22['products_id']);
+  $product_specials22_name = tep_get_products_name($product_specials22['products_id']);
+
+  $pf->loadProduct($product_specials22['products_id'],$languages_id);
+        $special_random_price = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SPECIALS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price);
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- specials_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['products_id']) {
+?>
+<!-- tell_a_friend //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TELL_A_FRIEND . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('tell_a_friend', tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('to_email_address', '', 'size="10"') . '&nbsp;' . tep_template_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id() . '<br>' . BOX_TELL_A_FRIEND_TEXT);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- tell_a_friend_eof //-->
+
+<?php } ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/theme_select.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/theme_select.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/theme_select.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: theme_select.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+    if (tep_session_is_registered('customer_id')) {
+
+  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
+
+?>
+<!-- theme //-->
+         <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TEMPLATE_SELECT . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $template_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " where active = '1' order by template_name");
+
+ 
+// Display a drop-down
+    $select_box = '<select name="template" onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%">';
+    if (MAX_THEME_LIST < 2) {
+      $select_box .= '<option value="">' . PULL_DOWN_DEFAULT . '</option>';
+    }
+    while ($template_values = tep_db_fetch_array($template_query)) {
+      $select_box .= '<option value="' . $template_values['template_name'] . '"';
+      if ($HTTP_GET_VARS['template_id'] == $template_values['template_id']) $select_box .= ' SELECTED';
+      $select_box .= '>' . substr($template_values['template_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
+    }
+    $select_box .= "</select>";
+    $select_box .= tep_hide_session_id();
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form'  => '<form name="template" method="post" action="' . tep_href_link(FILENAME_DEFAULT, '&action=update_template', 'NONSSL') . '">',
+                                 'align' => 'left',
+                                 'text'  => $select_box);
+
+   new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}}
+?>
+<!-- template_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/whats_new.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/whats_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/whats_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+  $random_product27 = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+      order by rand(), products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
+ 
+$random_product27_side_row = tep_db_num_rows($random_product27);
+   if ($random_product27_side_row > 0){
+
+  ?>
+<!-- whats_new //-->
+ <tr>
+            <td>
+<?php      
+    
+while ($whatsnew_product21 = tep_db_fetch_array($random_product27)){
+  $whatsnew_product21_id = $whatsnew_product21['products_id'];
+  $whatsnew_product21_image = tep_get_products_image($whatsnew_product21['products_id']);
+  $whatsnew_product21_name = tep_get_products_name($whatsnew_product21['products_id']);
+
+  $pf->loadProduct($whatsnew_product21['products_id'],$languages_id);
+         $whats_new_price = $pf->getPriceStringShort();
+}
+// EOF Separate Pricing Per Customer
+//Eversun mod end for sppc and qty price breaks
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHATS_NEW . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',           
+         'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $whatsnew_product21_image, $whatsnew_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . $whatsnew_product21_name . '</a><br>' . $whats_new_price .'<br />');
+//Eversun mod for sppc and qty price breaks
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,94 @@
+<?php
+/*
+  $Id: whos_online.php, v 1.0 2001/12/05 by mattice at xs4all.nl
+
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official TEP distribution
+  but an add-on contributed to the TEP community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+*/
+
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_WHOS_ONLINEBOX);
+?>
+
+
+<!-- whos_online //-->
+          <tr>
+            <td>
+<?php
+
+// Set expiration time, default is 900 secs (15 mins)
+  $xx_mins_ago = (time() - 900);
+
+  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
+
+  $whos_online_query = tep_db_query("select customer_id from " . TABLE_WHOS_ONLINE);
+  while ($whos_online = tep_db_fetch_array($whos_online_query)) {
+                        if (!$whos_online['customer_id'] == 0) $n_members++;
+                        if ($whos_online['customer_id'] == 0) $n_guests++;
+
+  $user_total = sprintf(tep_db_num_rows($whos_online_query));                                                                }
+
+  if ($user_total == 1) {
+    $there_is_are = BOX_WHOS_ONLINE_THEREIS . '&nbsp;';
+  } else {
+    $there_is_are = BOX_WHOS_ONLINE_THEREARE . '&nbsp;';
+  }
+
+  if ($n_guests == 1) {
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUEST;
+  }else{
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUESTS;
+  }
+
+  if ($n_members == 1) {
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBER;
+  }else{
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBERS;
+  }
+
+
+  if (($n_guests >= 1) && ($n_members >= 1)) $word_and = '&nbsp;' . BOX_WHOS_ONLINE_AND . '&nbsp;<br>';
+
+      $textstring = $there_is_are;
+        if ($n_guests >= 1) $textstring .= $n_guests . $word_guest;
+
+      $textstring .= $word_and;
+        if ($n_members >= 1) $textstring .= $n_members . $word_member;
+
+      $textstring .= '&nbsp;online.';
+
+
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHOS_ONLINE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>  $textstring
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whos_online_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+  $Id: wishlist.php,v 2.2 2004/09/12 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2546 $
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- wishlist //-->
+<?php
+if (basename($PHP_SELF) != FILENAME_WISHLIST_SEND){
+if (basename($PHP_SELF) != FILENAME_WISHLIST)   {
+?> 
+          <tr>
+            <td>
+<?php
+  // retreive the wishlist
+  if (tep_session_is_registered('customer_id')) {
+    $wishlist_query_raw = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 order by products_name";  
+    $wishlist_query = tep_db_query($wishlist_query_raw);
+
+    // if we have something in this clients list:
+    ?>
+    <!-- customer_wishlist //-->
+    <script type="text/javascript"><!--
+    function popupWindowWishlist(url) {
+      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=425,height=475,screenX=150,screenY=150,top=150,left=150')
+    }
+    //--></script>
+    <?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WISHLIST . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_WISHLIST, '','NONSSL'));
+    
+    $info_box_contents = array();
+    
+    if (tep_db_num_rows($wishlist_query)) {
+      if (tep_db_num_rows($wishlist_query) < MAX_DISPLAY_WISHLIST_BOX) {
+
+        $product_ids = '';
+        while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+          $product_ids .= $wishlist['products_id'] . ',';
+         }
+        $product_ids = substr($product_ids, 0, -1);        
+       
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        //  $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . $product_ids . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $customer_wishlist_string .= '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a></td>' . "\n" .
+                                                  '</tr>' . "\n" .
+                                                  '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents" align="center" valign="bottom"><b><a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_MOVE_TO_CART . '</a>&nbsp;|' . "\n" .
+                                                  '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b>' . "\n" .  tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td>' .
+                                                  '</td></tr>' . "\n";
+        }
+      } else {
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . sprintf(TEXT_WISHLIST_COUNT, tep_db_num_rows($wishlist_query)) . '</td></tr>' . "\n";
+      }
+    } else {
+      $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+      $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . BOX_WISHLIST_EMPTY . '</td></tr>' . "\n";
+    }
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a></td></tr>' . "\n";
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST_HELP . '</u> [?]</a></td></tr>' . "\n"; // Normal link
+    $customer_wishlist_string .= '</table>';
+
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => $customer_wishlist_string);
+
+    new infoBox($info_box_contents);
+  }
+?>
+            </td>
+          </tr>
+          <?php
+    }}
+?><!-- wishlist_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/boxes.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,243 @@
+<?php
+/*
+  $Id: boxes.tpl.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBox {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBox($contents, $direct_output = false) {
+      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
+      $tableBox_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
+        $tableBox_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
+        $tableBox_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
+              $tableBox_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
+              $tableBox_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox_string .= '    <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
+        }
+
+        $tableBox_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
+      }
+
+      $tableBox_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox_string;
+
+      return $tableBox_string;
+    }
+  }
+
+class categoriesBox extends tableBox {
+function categoriesBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->categoriesBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $this->tableBox($info_box_contents, true);
+    }
+
+function categoriesBoxContents($contents) {
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $info_box_contents = array();
+      for ($i=0; $i<sizeof($contents); $i++) {
+        $info_box_contents[] = array(array('align' => 'center', 'params' => 'class="noclass"', 'text' => $contents[$i]['text']));
+      }
+      return $this->tableBox($info_box_contents);
+    }
+}
+
+  class infoBox extends tableBox {
+    function infoBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function infoBoxContents($contents) {
+      $this->table_cellpadding = '3';
+      $this->table_parameters = 'class="infoBoxContents"';
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
+                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
+                                           'params' => 'class="boxText"',
+                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
+      }
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      return $this->tableBox($info_box_contents);
+    }
+  }
+
+  class infoBoxHeading extends tableBox {
+    function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+      } else {
+        $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => 'width="100%" height="14" class="infoBoxHeading"',
+                                         'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading" nowrap',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class infoboxFooter extends tableBox {
+    function infoboxFooter($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      } else {
+        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => ' class="infoBoxHeading"', 'text' => $left_corner),
+                                   array('params' => ' width="100%" ', 'text' => $contents[0]['text']),
+            array('params' => ' class="infoBoxHeading" nowrap', 'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class contentBox extends tableBox {
+    function contentBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function contentBoxContents($contents) {
+      $this->table_cellpadding = '4';
+      $this->table_parameters = 'class="infoBoxContents"';
+      return $this->tableBox($contents);
+    }
+  }
+
+  class contentBoxHeading extends tableBox {
+    function contentBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_width = '100%';
+      $this->table_cellpadding = '0';
+      
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/no_arrow_right.gif');
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_right.gif');
+      } else {
+         $right_corner = $right_arrow ;
+
+      }
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => ' align="center" background="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif" width="100%"  class="infoBoxHeading"',
+                 'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class errorBox extends tableBox {
+    function errorBox($contents) {
+      $this->table_data_parameters = 'class="errorBox"';
+      $this->tableBox($contents, true);
+    }
+  }
+
+  class productListingBox extends tableBox {
+    function productListingBox($contents) {
+      $this->table_parameters = 'class="productListing"';
+      $this->tableBox($contents, true);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/extra_html_output.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/extra_html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/extra_html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_template_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_template_image_button($image, $alt = '', $parameters = '') {
+    global $language;
+
+    return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+  }
+
+
+  function table_image_border_top($left, $right,$header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+                     <tr>
+                      <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                                <tr>
+                                  <td class="main_table_heading_inner"><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td>
+
+<?php
+}
+
+}
+  function table_image_border_bottom(){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+                                    </table></td>
+                                </tr>
+                              </table></td>
+                          </tr>
+      </table></td>
+  </tr>
+      </table></td>
+  </tr>
+      </table>
+      <!--Lango Added for Template MOD: EOF-->
+<?php
+}
+}
+
+
+  function table_image_main_border_top($left, $right, $header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                     <tr>
+                      <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                <tr>
+                                  <td><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td class="infoBoxHeading"><?php echo $header;?></td>
+                                      </tr>
+                                    </table></td>
+                                </tr>
+
+                              </table></td>
+                          </tr>
+
+      </table></td>
+  </tr>
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+                     <tr>
+                      <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                                <tr>
+                                  <td class="main_table_heading_inner"><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td>
+
+<?php
+}
+
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/footer.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/footer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/footer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,91 @@
+<?php
+/*
+  $Id: footer.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+  require(DIR_WS_INCLUDES . FILENAME_COUNTER);
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="1">
+  <tr class="footer">
+    <td class="footer">&nbsp;&nbsp;<?php echo strftime(DATE_FORMAT_LONG); ?>&nbsp;&nbsp;</td>
+    <td align="right" class="footer">&nbsp;&nbsp;<?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>&nbsp;&nbsp;</td>
+  </tr>
+</table>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" class="smallText">
+<?php
+
+ if (!(getenv('HTTPS')=='on')){
+//google banner ad
+if ($banner = tep_banner_exists('dynamic', 'googlefoot')) {
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
+  </tr>
+</table>
+<?php
+  }
+  }
+?>
+    </td>
+  </tr>
+</table>
+
+	<div id="footer">
+		<ul id="secundary_navigation">
+			<li><a href="http://38one.servehttp.com/openmoko/">Home</a></li>
+
+			<li><a href="http://38one.servehttp.com/openmoko/about">About</a></li>
+			<li><a href="http://38one.servehttp.com/openmoko/products" class="selected">Products</a></li>
+			<li><a href="http://38one.servehttp.com/openmoko/developers">Developers</a></li>
+			<li><a href="#">Network</a></li>
+			<li><a href="http://38one.servehttp.com/openmoko/press">Press</a></li>
+			<li><a href="http://38one.servehttp.com/openmoko/careers">Careers</a></li>
+
+			<li><a href="http://38one.servehttp.com/openmoko/contact">Contact</a></li>
+		</ul>
+		
+		Copyright &copy; 2006 Openmoko, Inc. All Rights Reserved
+		
+<?php
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default osCommerce-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+?>
+		<p class="oscommerce_copyright"><?php echo FOOTER_TEXT_BODY?></p>
+	</div>
+	</div>
+
+<?php
+}
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php?>
+<!-- footer_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/header.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: header.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('DIR_WS_TEMPLATE_IMAGES', 'templates/OpenMoko/images/');
+
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+?>
+	<div id="wrapper">
+
+	<div class="top_tabs_container">
+		<div class="toptab"><div class="inner">
+			<?php
+				echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">'.HEADER_TITLE_MY_ACCOUNT.'</a>';
+				echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">'.HEADER_TITLE_CART_CONTENTS.'</a>';
+				echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">'.HEADER_TITLE_CHECKOUT.'</a>'
+			?>
+		</div></div>
+		
+		<div class="toptab"><div class="inner">
+		<?php
+		if (!tep_session_is_registered('noaccount')) {// DDB - PWA - 040622 - no display of logoff for PWA customers
+			if (!tep_session_is_registered('customer_id')) {
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_TITLE_LOGIN . '</a>';
+			} else {
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_TITLE_LOGOFF . ' </a>';
+			}
+		}
+		
+		if (tep_session_is_registered('noaccount')) { // DDB - PWA - 040622 - no display of account for PWA customers
+			if (!tep_session_is_registered('customer_id')) {
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_TITLE_LOGIN . ' </a>';
+			}else{
+				echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_TITLE_LOGOFF . ' </a>';
+			}
+		}
+		?>
+		</div></div>
+	</div>
+
+	<div id="header">
+		<a href="#" id="site_logo"><img src="http://38one.servehttp.com/openmoko/images/openmoko_logo.png" alt="openmoko.com" /></a>
+		<div id="main_navigation">
+			<ul>
+				<li><a href="http://38one.servehttp.com/openmoko/" class="nav_home"><span>Home</span></a></li>
+				<li><a href="http://38one.servehttp.com/openmoko/about" class="nav_about"><span>About</span></a></li>
+				<li><a href="http://38one.servehttp.com/openmoko/products" class="nav_products selected"><span>Products</span></a></li>
+				<li><a href="http://38one.servehttp.com/openmoko/developers" class="nav_developers"><span>Developers</span></a></li>
+				<li><a href="#" class="nav_network"><span>Network</span></a></li>
+				<li><a href="http://38one.servehttp.com/openmoko/press" class="nav_press"><span>Press</span></a></li>
+				<li><a href="http://38one.servehttp.com/openmoko/careers" class="nav_careers"><span>Careers</span></a></li>
+				<li><a href="http://38one.servehttp.com/openmoko/contact" class="nav_contact"><span>Contact</span></a></li>
+			</ul>
+
+		</div>
+	</div>
+
+	<div class="shop_breadcrumb">
+		<?php echo $breadcrumb->trail(' &raquo; '); ?>
+	</div>
+
+<?php
+}
+?>
+<!-- header_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/Original.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/Original.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/admin_logo_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/admin_logo_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/espanol/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/french/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/buttons/german/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/neo1973_title.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/neo1973_title.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/search_openmoko.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/search_openmoko.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/search_openmoko_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/label/search_openmoko_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/logo-banner_02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/logo-banner_02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/logo-banner_03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/logo-banner_03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/logo-banner_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/logo-banner_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/network.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/network.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/navigation/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/openmoko_logo.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/openmoko_logo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/original_background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/original_background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/oscommerce.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/oscommerce.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/sidebox_bottom.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/sidebox_bottom.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/sidebox_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/sidebox_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/sidebox_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/sidebox_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/toptab_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/toptab_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/toptab_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/OpenMokoBackup/images/toptab_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,102 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+
+
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body>
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+<!-- warning_eof //-->
+
+<!-- header //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_HEADER); ?>
+<!-- header_eof //-->
+
+<div class="left_container">
+	<div class="sidebox"><div class="inner"><div class="inner_2">
+		<form id="searchform" method="get" action="http://38one.servehttp.com/openmoko/">
+			<label>Search openmoko</label>
+			<input type="hidden" name="s" value="search" />
+			<input type="text" class="input_text" name="q" />
+
+			<input type="image" class="input_submit" src="http://38one.servehttp.com/openmoko/images/button_go.png" alt="GO"/>
+		</form>
+	</div></div></div>
+	
+	<a href="#" class="side_banner"><img src="http://38one.servehttp.com/openmoko/images/__sample_banner_1.png" alt="baner" /></a>
+	
+	<a href="#" class="side_banner"><img src="http://38one.servehttp.com/openmoko/images/__sample_banner_2.png" alt="baner" /></a>
+</div>
+
+
+<div class="right_container">
+		<!-- body //-->
+		<table border="0" width="100%" cellspacing="3" cellpadding="<?php echo CELLPADDING_MAIN; ?>">
+		  <tr>
+		<?php
+		if (DISPLAY_COLUMN_LEFT == 'yes')  {
+		// WebMakers.com Added: Down for Maintenance
+		// Hide column_left.php if not to show
+		if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+		?>
+		    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+		<!-- left_navigation //-->
+		<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+		<!-- left_navigation_eof //-->
+		    </table></td>
+		<?php
+		}
+		}
+		?>
+		<!-- content //-->
+		    <td width="100%" valign="top">
+		<?php
+		if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template))) {
+		    require(DIR_WS_CONTENT . basename($content_template));
+		  } else {
+		    require(DIR_WS_CONTENT . $content . '.tpl.php');
+		  }
+		?>
+		    </td>
+		<!-- content_eof //-->
+		<?php
+		// WebMakers.com Added: Down for Maintenance
+		// Hide column_right.php if not to show
+		
+		
+		if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+		if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+		?>
+		    <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>">
+		<!-- right_navigation //-->
+		<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+		<!-- right_navigation_eof //-->
+		    </table></td>
+		<?php
+		}
+		}
+		?>
+		  </tr>
+		</table>
+		<!-- body_eof //-->
+</div>
+
+<!-- footer //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_FOOTER); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/default_specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/default_specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/default_specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: default_specials.php,v 2.1 2006/09/07 23:42:27 datazen Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- default_specials mainpage //-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
+  
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+  $random_specials = array();
+  $specials_array = array();
+  $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC");
+  while ($specials = tep_db_fetch_array($specials_query)) {
+    $random_specials[] .= $specials['products_id'];
+  }
+
+  $row = 0;
+  $col = 0;
+
+  if (sizeof($random_specials)!=0){
+    $max_displayed = (MAX_DISPLAY_SPECIAL_PRODUCTS > sizeof($random_specials)) ? sizeof($random_specials) : MAX_DISPLAY_SPECIAL_PRODUCTS;
+    $special_products = cre_random_array($random_specials, $max_displayed);
+    for($i=0; $i < $max_displayed; $i++) {
+      $product_array = array();
+      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price as special_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where  p.products_id = $special_products[$i] and  s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");
+      $product = tep_db_fetch_array($product_query);
+
+      $pf->loadProduct($product['products_id'],$languages_id);
+      $products_price_s = $pf->getPriceStringShort();
+
+      $buyitnow='<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+ 
+      $info_box_contents[$row][$col] = array('align' => 'center',
+                                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                                             'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $product['products_image'], $product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . $product['products_name'] . '</a><br>' . $products_price_s . '<br>'. $buyitnow);
+      $col ++;
+      if ($col > 2) {
+        $col = 0;
+        $row ++;
+      }
+    }
+  }else{
+      $info_box_contents[$row][$col] = array('align' => 'left',
+                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                             'text' => TEXT_NO_SPECIALS);
+  }
+  
+  new contentBox($info_box_contents);
+
+  $info_box_contents = array();
+  if (MAIN_TABLE_BORDER == 'yes'){
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                             );
+    new infoboxFooter($info_box_contents, true, true);
+  }
+?><!-- default_specials_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/example.html
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/example.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/example.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<table width="100%" border="0" bgcolor="FFA814" cellspacing="0" cellpadding="0">
+  <tr>
+    <td bgcolor="#CCCCCC">
+    <table width="100%" border="0" cellpadding="0" cellspacing="1">
+      <tr>
+        <td class="infoBoxHeading">
+        Example HTML Mainpage Module</td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+  <tr>
+    <td valign="top" width="100%">
+    <table width="100%" border="0" class="infobox" cellspacing="0" cellpadding="1">
+      <tr>
+        <td valign="top" width="100%">
+        <table width="100%" border="0" class="infoboxContents" cellspacing="0" cellpadding="0">
+      <!-- change from here to next-->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+          <tr>
+            <td align="center">
+            <img width="426" height="75" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr01.gif" border="0"></td>
+          </tr>
+          <tr>
+            <td valign="top" align="center">
+            <img valign="top" width="117" height="90" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr02.gif" border="0"></a><img width="117" height="90" valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr03.gif" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr04.gif" height="90" width="96" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr05.gif" width="96" height="90" border="0"></td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <!-- change from here to above-->
+        </table>
+        </td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Featured Products V1.1
+  Displays a list of featured products, selected from admin
+  For use as an Infobox instead of the "New Products" Infobox
+*/
+?>
+<!-- featured_products_mainpage //-->
+<?php
+ 
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+      $featured_products_2bb_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                              " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(),p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
+   
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($featured_products_2bb = tep_db_fetch_array($featured_products_2bb_query)) {
+
+    $num ++;
+  
+    if ($num == 1) {
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+    }    
+
+  $pf->loadProduct($featured_products_2bb['products_id'],$languages_id);
+        $products_price_2bb = $pf->getPriceStringShort();
+
+
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products_2bb['products_image'], $featured_products_2bb['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . $featured_products_2bb['products_name'] . '</a><br>' . $products_price_2bb);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+
+  }
+ 
+?>
+<!-- featured_products_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/main_categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/main_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/main_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,178 @@
+<?php
+/*
+  $Id: main_categories.php,v 1.0a 2002/08/01 10:37:00 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Barreto
+  Gustavo Barreto <gustavo at barreto.net>
+  http://www.barreto.net/
+
+  Based on: all_categories.php Ver. 1.6 by Christian Lescuyer
+
+  History: 1.0 Creation
+     1.0a Correction: Extra Carriage Returns
+     1.1  added parameters to change display options -- mdt
+
+  Released under the GNU General Public License
+
+*/
+
+//------------------------------------------------------------------------------------------------------
+// PARAMETERS
+//------------------------------------------------------------------------------------------------------
+
+$item_column_number = 3;    // range of 1 to 9
+$item_title_on_newline = true;  // true or false
+
+// for item and subcategory options, suugest that you just put in CSS code
+// you can also just define a class and then change it in a template addon like BTS
+$item_div_options = 'style="text-align:center;font-weight:bold;font-size:larger;margin-top:5px;"';
+$item_subcategories_options = '';
+
+//------------------------------------------------------------------------------------------------------
+// CODE - do not change below here
+//------------------------------------------------------------------------------------------------------
+
+// error checking on parameters
+if($item_column_number < 1)
+{
+  $item_column_number = 1;
+}
+if($item_column_number > 9)
+{
+  $item_column_number = 9;
+}
+if($item_title_on_newline)
+{
+  $item_separator = '<br>';
+} else {
+  $item_separator = '&nbsp;';
+}
+
+// preorder_mc tree traversal
+  function preorder_mc($cid_cat, $level_cat, $foo_cat, $cpath_cat)
+  {
+    global $categories_string_cat, $HTTP_GET_VARS;
+
+// Display link
+    if ($cid_cat != 0) {
+      for ($i=0; $i<$level_cat; $i++)
+        $categories_string_cat .=  '&nbsp;&nbsp;';
+      $categories_string_cat .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath
+=' . $cpath_cat . $cid_cat) . '">';
+// 1.6 Are we on the "path" to selected category?
+      $bold = strstr($HTTP_GET_VARS['cPath'], $cpath_cat . $cid_cat . '_') || $HTTP_GET_VARS['cPath'] == $cpath_cat . $cid_cat;
+// 1.6 If yes, use <b>
+      if ($bold)
+        $categories_string_cat .=  '<b>';
+      $categories_string_cat .=  $foo_cat[$cid_cat]['name'];
+      if ($bold)
+        $categories_string_cat .=  '</b>';
+      $categories_string_cat .=  '</a>';
+// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+      if (SHOW_COUNTS == 'true') {
+        $products_in_category = tep_count_products_in_category($cid_cat);
+        if ($products_in_category > 0) {
+          $categories_string_cat .= '&nbsp;(' . $products_in_category . ')';
+        }
+      }
+      $categories_string_cat .= '<br>';
+    }
+
+// Traverse category tree
+    if (is_array($foo_cat)) {
+      foreach ($foo_cat as $key => $value) {
+        if ($foo_cat[$key]['parent'] == $cid_cat) {
+          preorder_mc($key, $level_cat+1, $foo_cat, ($level_cat != 0 ? $cpath_cat . $cid_cat . '_' : ''));
+        }
+      }
+    }
+  }
+
+?>
+<!-- main_categories //-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES_MAIN_PAGE);
+  new infoBoxHeading($info_box_contents, true, true);
+
+
+//////////
+// Get categories list
+//////////
+
+$query_cat = "select 
+  c.categories_id, 
+  cd.categories_name, 
+  c.categories_image,
+  c.parent_id from 
+  " . TABLE_CATEGORIES . " c,
+  " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+  where 
+  c.parent_id = '0' 
+ and c.categories_id = cd.categories_id 
+ and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+
+  $categories_query_cat = tep_db_query($query_cat);
+
+
+// Initiate tree traverse
+$categories_string_cat = '';
+preorder_mc(0, 0, $foo_cat, '');
+
+//////////
+// Display box contents
+//////////
+
+$info_box_contents = array();
+
+$row = 0;
+$col = 0;
+while ($categories_cat = tep_db_fetch_array($categories_query_cat))
+{
+  if ($categories['parent_id'] == 0)
+    {
+      $cpath_cat_new = tep_get_path($categories_cat['categories_id']);
+      $text_subcategories = '';
+      $subcategories_query_cat = tep_db_query($query_cat);
+      while ($subcategories_cat = tep_db_fetch_array($subcategories_query_cat))
+      {
+        if ($subcategories_cat['parent_id'] == $categories_cat['categories_id'])
+      {
+                $cPath_new_sub = "cPath="  . $categories_cat['categories_id'] . "_" . $subcategories_cat['categories_id'];
+                $text_subcategories .= '• <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">';
+                $text_subcategories .= $subcategories_cat['categories_name'] . '</a>' . " ";
+
+          } // if ($subcategories['parent_id'] == $categories['categories_id'])
+
+      } // while ($subcategories = tep_db_fetch_array($subcategories_query))
+
+    $info_box_contents[$row][$col] = array('align' => 'left',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cpath_cat_new) . '">' . tep_image(DIR_WS_IMAGES . $categories_cat['categories_image'], $categories_cat['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories_cat['categories_name'] . '</a></DIV>');
+
+      // determine the column position to see if we need to go to a new row
+      $col ++;
+      if ($col > ($item_column_number - 1))
+      {
+          $col = 0;
+          $row ++;
+
+      } //if ($col > ($number_of_columns - 1))
+
+    } //if ($categories['parent_id'] == 0)
+
+} // while ($categories = tep_db_fetch_array($categories_query))
+
+//output the contents
+new contentBox($info_box_contents);
+?>
+<!-- main_categories_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: mainpage.php,v 2.1 2004/04/07
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+  to change the contents of this file edit
+  includes/languages/(language)/mainpage.php
+*/
+?>
+<!-- Main_page //-->
+
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, HEADING_TITLE);
+}
+// EOF: Lango Added for template MOD
+
+
+include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE);
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<!-- Main_page_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/new_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/new_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/new_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,69 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- mainpages_modules.new_products.php//-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
+
+  
+      $new_products_query = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+       order by rand(), p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
+
+  
+
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($new_products = tep_db_fetch_array($new_products_query)) {
+  
+    $num ++;
+      if ($num == 1) { 
+  new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+      }
+
+  $pf->loadProduct($new_products['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+
+  
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $products_price_s);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+if($num) {
+  new contentBox($info_box_contents);
+}
+
+?>
+<!-- new_products_eof //-->

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/mainpage_modules/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/*
+  $Id: upcoming_products.php,v 1.1.1.3 2004/04/07 23:42:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- upcoming_products mainpage_modules //-->
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_UPCOMING_PRODUCTS, strftime('%B')));
+
+    $expected_query_raw= tep_db_query("select
+ p.products_id,
+ pd.products_name, 
+ p.products_image, 
+    products_date_available as date_expected 
+ from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+    where 
+    to_days(products_date_available) >= to_days(now()) 
+    and p.products_id = pd.products_id 
+    and pd.language_id = '" . (int)$languages_id . "' 
+    order by rand()
+    limit " . MAX_DISPLAY_UPCOMING_PRODUCTS);
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($expected_query = tep_db_fetch_array($expected_query_raw)) {
+  
+    $num ++;
+      if ($num == 1) { 
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
+      }
+  $pf->loadProduct($expected_query['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+    
+   $duedate= str_replace("00:00:00", "" , $expected_query['date_expected']);  
+   
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $expected_query['products_image'], $expected_query['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . $expected_query['products_name'] . '</a><br>' . $products_price_s . '<br>' . TABLE_HEADING_DATE_EXPECTED . '&nbsp;' . $duedate);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+
+  }
+?>
+<!-- upcoming_products_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,459 @@
+html,body {
+	margin: 0px;
+	padding: 0px;
+	background: #FFF;
+}
+
+body {
+	font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 0.85em;
+	color: #333;
+}
+
+h1 {
+	font-size: 1.9em;
+}
+
+h2 {
+	font-size: 1.4em;
+}
+
+h3 {
+	font-size: 1.1em
+}
+
+a {
+	color: #333333;
+	text-decoration: none;
+}
+
+a:hover {
+	color: #FF6600;
+}
+
+img {
+	border: none;
+}
+
+ul {
+	margin: 0 0 0 0.5em;
+	padding: 0 0 0 0;
+	list-style: none;
+}
+
+ul li {
+	background: url(images/list_bullet.png) no-repeat 0 0.5em;
+	padding-left: 0.7em;
+	margin-bottom: 0.4em;
+}
+
+#wrapper {
+	width: 950px;
+	margin: 0px auto;
+	position:relative;
+}
+
+#header {
+	height: 90px;
+	position: relative;
+}
+
+#site_logo {
+	position: absolute;
+	top: 29px;
+	left: 10px;
+}
+
+/**************/
+/* NAVIGATION */
+/**************/
+
+#main_navigation {
+	float: right;
+	position: absolute;
+	top: 38px;
+	right: 5px;
+}
+
+#main_navigation ul {
+	list-style: none;
+	margin: 0;
+	padding: 0;
+}
+
+#main_navigation ul li {
+	display: inline;
+	margin: 0;
+	padding: 0;
+	background: none;
+}
+
+
+
+#main_navigation a {
+	float: left;
+	display: block;
+	height: 11px;
+	background-position: 50% 0%;
+	background-repeat:no-repeat;
+}
+
+#main_navigation a:hover {
+	background-position: 50% 100%;
+}
+
+#main_navigation a span{
+	display: none;
+}
+
+#main_navigation .selected {
+	background-position: 50% 100%;
+}
+
+
+.nav_home {
+	background-image:url(images/navigation/home.png);
+	width: 58px;
+}
+
+.nav_about {
+	background-image:url(images/navigation/about.png);
+	width: 64px;
+}
+
+.nav_products {
+	background-image:url(images/navigation/products.png);
+	width: 86px;
+}
+
+.nav_developers {
+	background-image:url(images/navigation/developers.png);
+	width: 98px;
+}
+
+.nav_network {
+	background-image:url(images/navigation/network.png);
+	width: 83px;
+}
+
+.nav_press {
+	background-image:url(images/navigation/press.png);
+	width: 58px;
+}
+
+.nav_careers {
+	background-image:url(images/navigation/careers.png);
+	width: 76px;
+}
+
+.nav_contact {
+	background-image:url(images/navigation/contact.png);
+	width: 79px;
+}
+
+/****************/
+/* MIDDLE BLOCK */
+/****************/
+
+#middleblock {
+	background: #080808 url(images/middleblock_tile.png) repeat-x 0% 0%;
+	position: relative;
+	border-bottom: 1px solid #CCCCCC;
+}
+
+#middleblock_inner {
+	background:url(images/middleblock_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_inner2 {
+	background:url(images/middleblock_right.png) no-repeat 100% 0%;
+	min-height: 300px;
+}
+
+#middleblock_container {
+	min-height: 300px;
+}
+
+#middleblock_tabs {
+	margin: 0px;
+	padding: 0px;
+	list-style: none;
+	font-size: 1.1em;
+	display: block;
+
+	position: relative;
+	top: 1px;
+	
+	margin-left: 348px;
+}
+
+#middleblock_tabs li {	
+	display: inline;
+	margin: 0;
+	padding: 0;
+	background: none;
+}
+
+#middleblock_tabs li a {
+	float: left;
+	display: block;
+	font-weight: bold;
+	color: white;
+	text-decoration: none;
+	margin-right: 5px;
+}
+
+#middleblock_tabs li a span {
+	display: block;
+	padding: 0.5em 0.8em 0.5em 0.9em;
+}
+
+#middleblock_tabs li a:hover {
+	color: #FF6600;
+	background:#FFF url(images/middleblock_tabs_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_tabs li a:hover span {
+	background:url(images/middleblock_tabs_right.png) no-repeat 100% 0%;
+}
+
+#middleblock_tabs li .selected {
+	color: #FF6600;
+	background:#FFF url(images/middleblock_tabs_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_tabs li .selected span {
+	background:url(images/middleblock_tabs_right.png) no-repeat 100% 0%;
+}
+
+.main_container {
+	padding-top: 40px;
+	padding-bottom: 40px;
+}
+
+.clear {
+	clear: both;
+}
+
+
+#left_column {
+	width: 303px;
+	padding-left: 45px;
+	float: left;
+}
+
+#left_column h3 {
+	margin: 0 0 1.1em 0;
+	padding: 0;
+}
+
+#right_column {
+	margin-left: 350px;
+}
+
+#footer {	
+	text-align: center;
+	background: #FAFAFA;
+	border-top: 1px solid #CCC;
+	padding: 5em 0 4em 0;
+	margin: 0 0 20px 0;
+	font-size: 0.9em;
+	color: #666666;
+}
+
+#secundary_navigation {
+	margin: 0;
+	padding: 0 0 2em 0;
+	text-transform: uppercase;
+	margin: 0 auto;
+}
+
+#secundary_navigation li {
+	background: none;
+	padding: 0;
+	display: inline;
+	margin: 0 1em;
+}
+
+#secundary_navigation .selected {
+	font-weight: bold;
+	color: #FF6600;
+}
+
+
+
+/***********/
+/* CONTENT */
+/***********/
+
+.content {
+	line-height: 1.5em;
+	padding-bottom: 20px;
+}
+
+.content p {
+	margin: 0;
+	padding: 0.6em 0;
+}
+
+.content ul,
+.content ol {
+	padding: 0.9em 0 0.8em 2em;
+}
+
+.content blockquote {
+	margin: 0;
+	padding: 0.6em 0 0.6em 2em;
+	color: #999;
+}
+
+.content h2 {
+	margin: 0;
+	padding: 0 0 0.5em 0;
+}
+
+.content .title_container {
+	border-bottom: 1px solid #CCCCCC;
+	margin: 0 0 0.7em 0;
+}
+
+.content img {
+	border-right: 1px solid #CCCCCC;
+	float: left;
+	margin: 0 1em 1em 0;
+}
+
+.toptab {
+	background: #F0F0F0 url(images/toptab_left.png) no-repeat 0 100%;
+	float: right;
+	font-size:0.9em;
+	color: #999999;
+	margin-left: 15px;
+	position: relative;
+	z-index: 100;
+}
+
+.toptab .inner {
+	background:url(images/toptab_right.png) no-repeat 100% 100%;
+	padding: 2px 5px 2px 15px;
+	position: relative;
+}
+
+.toptab a {
+	color: #999;
+	margin-right: 10px;
+}
+
+.toptab a:hover {
+	color: #FF6600 !important;
+	text-decoration: none;
+}
+
+
+.buton_decrease_font{
+	display: block;
+	width: 11px;
+	height: 8px;
+	background:url(images/icons/icon_decrease_font.png) no-repeat 0% 0%;
+}
+
+.buton_decrease_font:hover{
+	background-position:0% 100%;
+}
+
+.buton_decrease_font span {
+	display: none;
+}
+
+.decrease_font,
+.increase_font {
+	font-weight: bold;
+	color: #666 !important;
+	font-size: 0.8em;
+	margin-left: 5px;
+}
+
+.top_tabs_container {
+	position: absolute;
+	top: 0px;
+}
+
+.oscommerce_copyright br {
+	display: none;
+}
+
+.oscommerce_copyright font {
+	color: #666;
+}
+
+.oscommerce_copyright a {
+	margin-right: 3px;
+}
+
+.left_container {
+	width: 200px;
+	float: left;
+	padding-top: 15px;
+	padding-left: 15px;
+}
+
+.sidebox {
+	width: 189px;
+	margin: 0 0 30px 0;
+	background:url(images/sidebox_tile.png) repeat-y 0 0;
+}
+
+.sidebox .inner {
+	background:url(images/sidebox_top.png) no-repeat 0 0;
+}
+
+.sidebox .inner_2 {
+	background:url(images/sidebox_bottom.png) no-repeat 0 100%;
+	padding: 7px;
+}
+
+#searchform {
+	position: relative;
+	margin: 0;
+	padding: 24px 0 1px 0;
+	background:url(images/label/search_openmoko_gray.png) no-repeat 0 8px;
+}
+
+#searchform label {
+	display: none;
+}
+
+#searchform .input_text {
+	width: 135px;
+}
+
+#searchform .input_submit {
+	position: absolute;
+	left: 142px;
+	top: 20px;
+}
+
+
+.side_banner {
+	margin: 0 0 30px 0;
+	display:block;
+	width: auto;
+}
+
+.banner_images {
+	position: absolute;
+	left: 86px;
+	top: 50px;
+	width: auto;
+	overflow:visible;
+}
+
+.banner_images div {
+	position: relative;
+}
+
+.right_container {
+	width: 706px;
+	margin: 0 0 0 auto;
+	background: #eee;
+}
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/OpenMokoBackup/stylesheet.css.bak
===================================================================
--- trunk/direct.openmoko.com/templates/OpenMokoBackup/stylesheet.css.bak	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/OpenMokoBackup/stylesheet.css.bak	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,727 @@
+/*
+  $Id: stylesheet.css,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  .cat_description {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #800000;
+     background : inherit;
+     font-weight : bold;
+      }
+ .boxText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .centerTable {
+     background-image : url('images/bg_cat4.gif');
+     background-repeat : repeat-x;
+     background : #fbfcfd;
+     color : inherit;
+      }
+ .errorBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : inherit;
+     background : #ffb3b5;
+     font-weight : bold;
+      }
+ .stockWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #cc0033;
+     background : inherit;
+      }
+ .productsNotifications {
+     background : #f2fff7;
+     color : inherit;
+      }
+ .orderEdit {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #70d250;
+     background : inherit;
+     text-decoration : underline;
+      }
+ .navBlue {
+     color : #ff0000;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ .subnavBlue {
+     color : #9966ff;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ BODY {
+     background : #ffffff;
+     color : #000000;
+     margin : 0;
+      }
+ A {
+     color : #000000;
+     background : inherit;
+     text-decoration : none;
+      }
+ A:hover {
+     color : #aabbdd;
+     background : inherit;
+     text-decoration : underline;
+      }
+ FORM {
+     display : inline;
+      }
+ TR.header {
+     background : #ffffff;
+     color : inherit;
+      }
+ TR.headerNavigation {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.headerNavigation {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ A.headerNavigation {
+     color : #ffffff;
+     background : #bbc3d3;
+      }
+ a:hover.headerNavigation {
+     color : #ffffff;
+     background : #bbc3d3;
+      }
+ TR.headerError {
+     background : #ff0000;
+     color : #bbc3d3;
+      }
+ TD.headerError {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ff0000;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ TR.headerInfo {
+     background : #00ff00;
+     color : #bbc3d3;
+      }
+ TD.headerInfo {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #00ff00;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ TR.footer {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.footer {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ .templateinfobox {
+     background : #f8f8f9;
+     color : inherit;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+      }
+ .infoBox {
+     background : #b6b7cb;
+     color : #000000;
+      }
+ TD.infoBox, SPAN.infoBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.infoBoxHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bbc3d3;
+     color : #ffffff;
+      }
+
+ .infoBoxContents {
+     background : #f8f8f9;
+     color : #000000;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.infoBoxFooter {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #cccccc;
+    color : #000000;
+}
+
+ TD.contentBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #534f4d;
+     background : #bbc3d3;
+    padding-top : 5px;
+}
+ .infoBoxContentsHeader {
+     background : #bbc3d3;
+    color : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ .infoBoxContentsCenter {
+    color : inherit;
+     background : #f8f8f9;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+     background : #bbc3d3;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+ TD.infoBoxHeadingImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-position : left;
+     background-color : #bbc3d3;
+     color : #000000;
+      }
+ TD.infoBoxFooterImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 1px;
+     font-weight : bold;
+     background-color : #bbc3d3;
+     color : #000000;
+      }
+ .infoBoxNotice {
+     background : #ff8e90;
+     color : #ffffff;
+      }
+ .infoBoxNoticeContents {
+     background : #ffe6e6;
+     color : #ffffff;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.main_table_heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #cccccc;
+     color : #000000;
+      }
+ TD.main_table_heading_inner {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #ffffff;
+     color : #000000;
+      }
+ TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TABLE.productListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .productListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #b6b7cb;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ .productlisting-headingPrice {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     background : #cccccc;
+     color : #9a9a9a;
+     font-weight : bold;
+      }
+ TD.productListing-data {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ A.pageResults {
+     color : #0000ff;
+     background : inherit;
+      }
+ a:hover.pageResults {
+     color : #0000ff;
+     background : #ffff33;
+      }
+ TD.pageHeading, DIV.pageHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     font-weight : bold;
+     color : #9a9a9a;
+     background : inherit;
+      }
+ TR.subBar {
+     background : #f4f7fd;
+     color : inherit;
+      }
+ TD.subBar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ TD.main, P.main {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #000000;
+     background : inherit;
+      }
+ TD.smallText, SPAN.smallText, P.smallText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.accountCategory {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 13px;
+     color : #aabbdd;
+     background : inherit;
+      }
+ TD.fieldKey {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.fieldValue {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+      }
+ TD.tableHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.category_desc {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+      }
+ SPAN.newItemInCart {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ CHECKBOX, INPUT, RADIO, SELECT {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ TEXTAREA {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ SPAN.greetUser {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #f0a480;
+     background : inherit;
+     font-weight : bold;
+      }
+ TABLE.formArea {
+     background : #f1f9fe;
+     color : #f4f7fd;
+     border-color : #7b9ebd;
+     border-style : solid;
+     border-width : 1px;
+      }
+ TD.formAreaTitle {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ SPAN.markProductOutOfStock {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #c76170;
+     background : inherit;
+     font-weight : bold;
+      }
+ SPAN.productSpecialPrice {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ SPAN.errorText {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ .moduleRowOver {
+     background-color : #d7e9f7;
+     color : inherit;
+     cursor : pointer;
+      }
+ .moduleRowSelected {
+     background-color : #e9f4fc;
+     color : inherit;
+      }
+ .checkoutBarFrom, .checkoutBarTo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #8c8c8c;
+     background : inherit;
+      }
+ .checkoutBarCurrent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ .messageBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .messageStackError, .messageStackWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #ffb3b5;
+     color : inherit;
+      }
+ .messageStackSuccess {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #99ff00;
+     color : inherit;
+      }
+ .inputRequirement {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ TABLE.linkListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .linkListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #b6b7cb;
+     color : #ffffff;
+     text-align : center;
+      }
+ TD.linkListing-data {
+     border-right : 1px solid #b6b7cb;
+     border-bottom : 1px solid #b6b7cb;
+     padding : 4px;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TR.linkListing-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.linkListing-even {
+     background : #f5f5f5;
+     color : inherit;
+      }
+ .content {
+     color : #000000;
+     background : inherit;
+     font-size : 10px;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #bdcaf0;
+     background : inherit;
+      }
+ TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+     background-image : url('images/button_blank_left.gif');
+      }
+ TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+     background-image : url('images/button_blank_right.gif');
+      }
+ TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+     background-image : url('images/button_blank_middle.gif');
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-color : inherit;
+     color : #000000;
+      }
+ A.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     color : #000000;
+     background : inherit;
+      }
+ a:hover.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+     color : #00ff00;
+      }
+ TD.cookieUsage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #000000;
+     color : #ffffff;
+      }
+ .attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TR.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TD.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #c0c0c0;
+      }
+ .storyboxtitle {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:link {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:active {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:visited {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:hover {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ffffff;
+     font-size : 10px;
+     font-weight : bold;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .yearHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 14px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+      }
+ .calendarMonth {
+     background-color : #cccccc;
+     color : inherit;
+     cursor : default;
+     width : 100%;
+      }
+ .calendarHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     height : 22px;
+      }
+ .calendarToday {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffcf00;
+     padding-left : 3px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendarWeekend {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #caeeff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffffff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     height : 22px;
+     width : 18px;
+      }
+ .event {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     border : 1px solid #e6e6e6;
+      }
+ .empty {
+     background-color : #f0faff;
+     color : inherit;
+     line-height : 14px;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ h4.infoTitle {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 0.2em;
+      }
+ p.infoBlurb {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 2em;
+      }
+ TD.productPriceInListing {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #d2e9fb;
+     color : inherit;
+      }
+ TD.productPriceInBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #eeeeee;
+     color : inherit;
+      }
+ TD.productPriceInProdInfo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ccffcc;
+     color : inherit;
+      }
+ #navMenu {
+     clear : both;
+     height : 0.01%;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu ul {
+     float : left;
+     width : 150px;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu li {
+     position : relative;
+     float : left;
+     line-height : 24px;
+     margin-bottom : -1px;
+     width : 150px;
+      }
+ #navMenu li ul {
+     position : absolute;
+     left : -999em;
+     margin-left : 150px;
+     margin-top : -26px;
+      }
+ #navMenu li ul ul {
+     left : -999em;
+      }
+ #navMenu li a {
+     width : 150px;
+     display : block;
+     color : #334;
+     font-weight : bold;
+     text-decoration : none;
+     background : #ffffff;
+     border : 1px solid #cce;
+     padding-left : 2px;
+      }
+ #navMenu li a:hover {
+     color : #000000;
+     background : #aac;
+      }
+ #navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+     left : -999em;
+      }
+ #navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+     left : auto;
+      }

Added: trunk/direct.openmoko.com/templates/Original/Original.sql
===================================================================
--- trunk/direct.openmoko.com/templates/Original/Original.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/Original.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#FFFFFF');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "Original.gif", template_cellpadding_main ="3", template_cellpadding_sub= "8", template_cellpadding_left= "3", template_cellpadding_right= "3", site_width= "100%", include_column_left= "yes", include_column_right= "yes", box_width_left= "130", box_width_right= "130", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no", show_header_link_buttons="yes", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width= "1", side_box_right_width= "1"  WHERE template_id="#tID#"
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/boxes/affiliate.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: affiliate.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 - 2003 osCommerce
+   
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3386 $
+
+  Released under the GNU General Public License
+*/
+?>          
+<!-- affiliate_system //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_AFFILIATE . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (tep_session_is_registered('affiliate_id')) {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . BOX_AFFILIATE_SUMMARY . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, '', 'SSL'). '">' . BOX_AFFILIATE_NEWS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL'). '">' . BOX_AFFILIATE_ACCOUNT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'). '">' . BOX_AFFILIATE_PAYMENT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'). '">' . BOX_AFFILIATE_CLICKRATE . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'). '">' . BOX_AFFILIATE_SALES . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS). '">' . BOX_AFFILIATE_BANNERS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_FAQ). '">' . BOX_AFFILIATE_FAQ . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_LOGOUT). '">' . BOX_AFFILIATE_LOGOUT . '</a>');
+  } else {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_INFO). '">' . BOX_AFFILIATE_INFO . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . BOX_AFFILIATE_LOGIN . '</a>');
+  }
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- affiliate_system_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/boxes/articles.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,220 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2249 $
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_topic($counter) {
+    global $tree, $topics_string, $tPath_array;
+
+    for ($i=0; $i<$tree[$counter]['level']; $i++) {
+      $topics_string .= "&nbsp;&nbsp;";
+    }
+
+    $topics_string .= '<a href="';
+
+    if ($tree[$counter]['parent'] == 0) {
+      $tPath_new = 'tPath=' . $counter;
+    } else {
+      $tPath_new = 'tPath=' . $tree[$counter]['path'];
+    }
+
+    $topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '<b>';
+    }
+
+// display topic name
+    $topics_string .= $tree[$counter]['name'];
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '</b>';
+    }
+
+    if (tep_has_topic_subtopics($counter)) {
+      $topics_string .= ' -&gt;';
+    }
+
+    $topics_string .= '</a>';
+
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_in_topic = tep_count_articles_in_topic($counter);
+      if ($articles_in_topic > 0) {
+        $topics_string .= '&nbsp;(' . $articles_in_topic . ')';
+      }
+    }
+
+    $topics_string .= '<br>';
+
+    if ($tree[$counter]['next_id'] != false) {
+      tep_show_topic($tree[$counter]['next_id']);
+    }
+  }
+?>
+<!-- topics //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_ARTICLES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $topics_string = '';
+  $tree = array();
+
+  $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '0' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+  while ($topics = tep_db_fetch_array($topics_query))  {
+    $tree[$topics['topics_id']] = array('name' => $topics['topics_name'],
+                                        'parent' => $topics['parent_id'],
+                                        'level' => 0,
+                                        'path' => $topics['topics_id'],
+                                        'next_id' => false);
+
+    if (isset($parent_id)) {
+      $tree[$parent_id]['next_id'] = $topics['topics_id'];
+    }
+
+    $parent_id = $topics['topics_id'];
+
+    if (!isset($first_topic_element)) {
+      $first_topic_element = $topics['topics_id'];
+    }
+  }
+
+  //------------------------
+  if (tep_not_null($tPath)) {
+    $new_path = '';
+    reset($tPath_array);
+    while (list($key, $value) = each($tPath_array)) {
+      unset($parent_id);
+      unset($first_id);
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$value . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+      if (tep_db_num_rows($topics_query)) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($topics_query)) {
+          $tree[$row['topics_id']] = array('name' => $row['topics_name'],
+                                           'parent' => $row['parent_id'],
+                                           'level' => $key+1,
+                                           'path' => $new_path . '_' . $row['topics_id'],
+                                           'next_id' => false);
+
+          if (isset($parent_id)) {
+            $tree[$parent_id]['next_id'] = $row['topics_id'];
+          }
+
+          $parent_id = $row['topics_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['topics_id'];
+          }
+
+          $last_id = $row['topics_id'];
+        }
+        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
+        $tree[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_topic($first_topic_element);
+
+  $info_box_contents = array();
+  $new_articles_string = '';
+  $all_articles_string = '';
+
+  if (DISPLAY_NEW_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_new_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and(a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = ad.articles_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a2t.topics_id = td.topics_id 
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'
+                                            and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY)");
+      $articles_new_count = ' (' . tep_db_num_rows($articles_new_query) . ')';
+    } else {
+      $articles_new_count = '';
+    }
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string = '<b>';
+    }
+
+    $new_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES_NEW, '', 'NONSSL') . '">' . BOX_NEW_ARTICLES . '</a>';
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string .= '</b>';
+    }
+
+    $new_articles_string .= $articles_new_count . '<br>';
+
+  }
+
+  if (DISPLAY_ALL_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_all_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a.articles_id = ad.articles_id
+                                            and a2t.topics_id = td.topics_id
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'");
+      $articles_all_count = ' (' . tep_db_num_rows($articles_all_query) . ')';
+    } else {
+      $articles_all_count = '';
+    }
+
+    if ($topic_depth == 'top') {
+      $all_articles_string = '<b>';
+    }
+
+    $all_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES, '', 'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a>';
+
+    if ($topic_depth == 'top') {
+      $all_articles_string .= '</b>';
+    }
+
+    $all_articles_string .= $articles_all_count . '<br>';
+
+  }
+
+  $info_box_contents[] = array('text' => $new_articles_string . $all_articles_string . $topics_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- topics_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/asearch.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/asearch.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/asearch.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: asearch.php
+  searches articles using article_manager
+  by AlDaffodil (aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- article search //-->
+          <tr>
+            <td>
+<?php
+ //if (ALLOW_QUICK_SEARCH_DESCRIPTION == 'true') {
+  //  $param = '<input type="hidden" name="search_in_description" value="1">';
+ //  } else {
+      $param = '';
+// }
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_ASEARCH . '</font>');
+     new infoBoxHeading($info_box_contents, false, false);
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find_article" method="get" action="' . tep_href_link(FILENAME_ARTICLE_SEARCH, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . $param . '<input type="text" name="akeywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["akeywords"])) . '">' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><input type="checkbox" name="description">' . BOX_ASEARCH_TEXT . '<br>');
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- article_search //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/authors.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name");
+  if ($number_of_author_rows = tep_db_num_rows($authors_query)) {
+?>
+<!-- authors //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_AUTHORS . '</font>');
+
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_author_rows <= MAX_DISPLAY_AUTHORS_IN_A_LIST) {
+// Display a list
+      $authors_list = '';
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        if (isset($HTTP_GET_VARS['authors_id']) && ($HTTP_GET_VARS['authors_id'] == $authors['authors_id'])) $authors_name = '<b>' . $authors_name .'</b>';
+        $authors_list .= '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $authors['authors_id']) . '">' . $authors_name . '</a><br>';
+      }
+
+      $authors_list = substr($authors_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $authors_list);
+    } else {
+// Display a drop-down
+      $authors_array = array();
+      if (MAX_AUTHORS_LIST < 2) {
+        $authors_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        $authors_array[] = array('id' => $authors['authors_id'],
+                                       'text' => $authors_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('authors', tep_href_link(FILENAME_ARTICLES, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('authors_id', $authors_array, (isset($HTTP_GET_VARS['authors_id']) ? $HTTP_GET_VARS['authors_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_AUTHORS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- authors_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/best_sellers.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/best_sellers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/best_sellers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: best_sellers.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($current_category_id) && ($current_category_id > 0)) {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  } else {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  }
+
+  if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
+?>
+<!-- best_sellers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_BESTSELLERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $rows = 0;
+    $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
+      $rows++;
+      $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
+    }
+    $bestsellers_list .= '</table>';
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => $bestsellers_list);
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- best_sellers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/boxad.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/boxad.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/boxad.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: boxad.php, v 1.1 2002/03/21 by aubrey at mycon.co.za
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+*/
+?>
+<!-- banner-ad-in-a-box //-->
+<?php
+  if ($banner = tep_banner_exists('dynamic', BOX_AD_BANNER_TYPE)) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+<!-- banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/calendar.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+$ID
+  ~ events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it 
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2426 $
+
+*/
+
+
+?>
+<!-- events_calendar //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CALENDER . '</font>');
+    new infoBoxHeading($info_box_contents, false, false,tep_href_link(FILENAME_EVENTS_CALENDER));
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'center',
+                                'text' => '<iframe name="calendar" id="calendar" align="center" marginwidth="0" marginheight="0" ' .
+                                          'src='  . FILENAME_EVENTS_CALENDAR_CONTENT . '?_month=' . $_month .'&amp;_year='. $_year .' frameborder=0 height=220 width=162 scrolling=no> ' .IFRAME_ERROR.'</iframe> ');
+   
+ 
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- events_calendar //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/card1.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/card1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/card1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1609 $
+
+*/
+?>
+<!-- Card Info Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CARD1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+//                               'text'  => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .
+//elari chanegd to provide a link to your payment acount
+                               'text'  => tep_image(DIR_WS_IMAGES . 'cards/logo-xclick_paypal.gif' , BOX_INFORMATION_CARD).
+                               '<br>' . tep_image(DIR_WS_IMAGES . 'cards/cards2.gif', BOX_INFORMATION_CARD) . '<br>'
+                               );
+
+new infoBox($info_box_contents);
+?>
+</td></tr>
+<!-- card_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,165 @@
+<?php
+/*
+  $Id: categories.php,v 1.1.1.1 2004/03/04 23:42:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3432 $
+
+  Released under the GNU General Public License
+*/
+$count=0;
+
+ function tep_show_category($counter,$count) {
+    global $foo, $categories_string, $id;
+
+$count++;
+    if ($count != 1) {
+$image=2;
+$HEIGHT = 20;
+     }else{
+$image=1;
+$HEIGHT = 21;
+}
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+
+    $categories_string .= '<tr><td>';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+    
+    $categories_string .= '<a class="navBlue" href="';
+
+}else{
+    $categories_string .= '&nbsp;';
+if ($foo[$counter]['parent'] != 0) {
+      $class="subnavBlue";
+   } else {
+  $class="navGrey";
+}
+
+if ($foo[$counter]['parent'] != 0) {
+      $categories_string .= '&nbsp;';
+   } else {
+         ;
+}
+    $categories_string .= '<a class="' . $class . '" href="';
+
+}
+
+    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string .= '">';
+// display category name
+      $categories_string .= $foo[$counter]['name'];
+    $categories_string .= '</a>';
+//    $categories_string .= '</td></tr>' ;
+
+
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category($foo[$counter]['next_id'],$count);
+    }
+
+  }
+?>
+<!-- categories //-->
+                  <tr>
+                    <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => '<font color="' . $font_color . '">' .BOX_HEADING_CATEGORIES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+$categories_string = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      $new_path .= $value;
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      while ($row = tep_db_fetch_array($categories_query)) {
+        $foo[$row['categories_id']] = array(
+                                            'name' => $row['categories_name'],
+                                            'parent' => $row['parent_id'],
+                                            'level' => $key+1,
+                                            'path' => $new_path . '_' . $row['categories_id'],
+                                            'next_id' => false
+                                           );
+
+        if (isset($prev_id)) {
+          $foo[$prev_id]['next_id'] = $row['categories_id'];
+        }
+
+        $prev_id = $row['categories_id'];
+
+        if (!isset($first_id)) {
+          $first_id = $row['categories_id'];
+        }
+
+        $last_id = $row['categories_id'];
+      }
+      if ($category_check != 0) {
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+      }
+
+      $new_path .= '_';
+    }
+  }
+
+  tep_show_category($first_element,$count);
+
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text'  => $categories_string
+                              );
+new infobox($info_box_contents);
+
+?>
+                    </td>
+                  </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/categories1.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/categories1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/categories1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- categories1 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(),
+                               'align' => 'left',
+                               'text'  => tep_draw_pull_down_menu('cPath', tep_get_categories(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"')
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- categories1_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/categories2.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/categories2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/categories2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,173 @@
+<?php
+/*
+  $Id: categories2.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+
+//###############################################
+if ( (USE_CACHE == 'true') && !defined('SID')) {
+    echo tep_cache_categories_box();
+  } else {
+//###############################################
+
+
+  function tep_show_category2($counter) {
+    global $foo, $categories_string2, $id;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      $categories_string2 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string2 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string2 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string2 .= '">';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '<b>';
+    }
+
+// display category name
+    $categories_string2 .= $foo[$counter]['name'];
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '</b>';
+    }
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string2 .= '-&gt;';
+    }
+
+    $categories_string2 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string2 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string2 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category2($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories 2 //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES2 . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+
+  $categories_string2 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_category2($first_element);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string2
+                              );
+  new infoBox($info_box_contents);
+
+$info_box_contents = array();
+
+?>
+            </td>
+          </tr>
+<!--############################################### //-->
+<?php
+}
+?>
+<!--############################################## //-->
+<!--categories2_eof //-->
+

Added: trunk/direct.openmoko.com/templates/Original/boxes/categories3.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/categories3.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/categories3.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+/*
+  $Id: categories3.php,v 1.1 2004/04/05
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004osCommerce
+
+  Released under the GNU General Public License
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+*/
+
+// Categories_tree written by Gideon Romm from Symbio Technologies, LLC
+
+function tep_show_category3($cid, $cpath, $COLLAPSABLE) {
+  global $categories_string3, $languages_id, $HTTP_GET_VARS;
+  global $level;
+  $selectedPath = array();
+
+// Get all of the categories on this level
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }
+    $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;
+
+// Add category link to $categories_string3
+    for ($a=1; $a<$level{$categories['categories_id']}; $a++) {
+      $categories_string3 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string3 .= '<a href="';
+
+    $cPath_new = $cpath;
+    if ($level{$categories['parent_id']} > 0) {
+      $cPath_new .= "_";
+    }
+    $cPath_new .= $categories['categories_id'];
+
+    $cPath_new_text = "cPath=" . $cPath_new;
+
+    $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
+    $categories_string3 .= '">';
+
+    if ($HTTP_GET_VARS['cPath']) {
+      $selectedPath = split("_", $HTTP_GET_VARS['cPath']);
+    }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '<b>'; }
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '<u>'; }
+
+    $categories_string3 .= $categories['categories_name'];
+    if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string3 .= ' ->'; }
+
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '</u>'; }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '</b>'; }
+
+    $categories_string3 .= '</a>';
+
+    if (SHOW_COUNTS) {
+      $products_in_category = tep_count_products_in_category($categories['categories_id']);
+      if ($products_in_category > 0) {
+        $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string3 .= '<br>';
+
+
+// If I have subcategories, get them and show them
+    if (tep_has_category_subcategories($categories['categories_id'])) {
+
+      if ($COLLAPSABLE) {
+        if (in_array($categories['categories_id'], $selectedPath)) {
+          tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE);
+        }
+      }
+      else { tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE); }
+
+    }
+
+  }
+
+}
+?>
+
+
+<!--categories 3 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES3 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string3 = '';
+
+// tep_show_category3(<top category_id>, <top cpath>, <1=Collapsable tree, 0=static--show all>)
+  tep_show_category3(0,'',0);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string3
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!--categories_eof 3 //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/categories4.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/categories4.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/categories4.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,188 @@
+<?php
+/*
+  $Id: categories4.php,v 1.0
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2097 $
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_category4($counter) {
+    global $foo, $categories_string4, $id, $aa;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      if ($a == $foo[$counter]['level']-1)
+      {
+    $categories_string4 .= "<font color='#ff0000'>|__</font>";
+      } else
+        {
+        $categories_string4 .= "<b><font color='#ff0000'>&nbsp;&nbsp;&nbsp;&nbsp;</font></b>";
+        }
+
+    }
+    if ($foo[$counter]['level'] == 0)
+  {
+    if ($aa == 1)
+    {
+    $categories_string4 .= "<hr>";
+      }
+    else
+    {$aa=1;}
+
+  }
+
+
+    $categories_string4 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string4 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string4 .= '">';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $categories_string4 .= '<b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= "<b><font color='#ff0000'>";
+    }
+
+// display category name
+    $categories_string4 .= $foo[$counter]['name'];
+
+      if ($foo[$counter]['parent'] == 0) {
+       $categories_string4 .= '</b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= '</font></b>';
+    }
+
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string4 .= '<b>-&gt; </b>';
+    }
+
+    $categories_string4 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string4 .= '&nbsp;(' . $products_in_category . ')';
+      }    }
+
+    $categories_string4 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category4($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories 4//-->
+          <tr>
+            <td>
+<?php
+  $aa = 0;
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES4 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string4 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+   tep_show_category4($first_element);
+
+ //coment out the below line if you do not want to havw an all products list
+    $categories_string4 .= "<hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODS) . '"><b>' . BOX_INFORMATION_ALLPRODS . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODCATS) . '"><b>' . ALL_PRODUCTS_LINK . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODMANF) . '"><b>' . ALL_PRODUCTS_MANF . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br>\n";
+
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                'text'  => $categories_string4
+                               );
+   new infoBox($info_box_contents);
+?>
+
+        </td>
+          </tr>
+<!--categories_eof 4//-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/categories5.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/categories5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/categories5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+<?php
+/*
+  $Id: all_categories.php,v 1.6 2002/04/22 20:34:00 clescuyer Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Goélette
+  Christian Lescuyer <cl at goelette.net>
+  http://www.goelette.net/
+  http://oscommerce.goelette.net/
+
+  History: 1.1 Creation
+           1.2 Modified query for compatibility with older databases
+           1.3 Query in 1.2 was wrong for older databases
+           1.4 SHOW_COUNTS test corrected
+           1.5 Added COMPACT_CATEGORIES option to display all sub-categories on one line
+           1.6 Removed COMPACT_CATEGORIES option
+               Corrected the cpath generation
+               Bold categories "path" to selected category, an idea from Peter Fürsicht
+           1.7 Cleaned the way in which the categories are displayed - bold for the path,
+               ">" to indicate the current category, removed link to current category,
+               only indent subcategories (top level are flush left)
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+  Released under the GNU General Public License
+
+*/
+
+// Keep out parts category
+    $excluded_parts_category_id = 28;
+
+
+// Preorder tree traversal
+  function preorder($cid, $level5, $foo5, $cpath) {
+    global $categories_string5, $HTTP_GET_VARS;
+
+    if ($cid != 0) {
+  // 1.7 Get the current path info
+      $category_path = explode('_',$HTTP_GET_VARS['cPath']);
+      $in_path = in_array($cid, $category_path);
+      $this_category = array_pop($category_path);
+
+      for ($i=0; $i<$level5; $i++)
+      // 1.7 only indent subcategories (top level are flush left)
+        if ($i>0) {
+          $categories_string5 .=  '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
+        }
+        // 1.7 indicate the current category
+        if ($this_category == $cid) {
+          $categories_string5 .=  '> ';
+        }
+
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '">';
+        }
+  // 1.6 Are we on the "path" to selected category? If yes, use <b>
+        if ($in_path) {
+          $categories_string5 .=  '<b>';
+        }
+        $categories_string5 .=  $foo5[$cid]['name'];
+        if ($in_path)
+          $categories_string5 .=  '</b>';
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '</a>';
+        }
+    // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+          if (SHOW_COUNTS == 'true') {
+            $products_in_category = tep_count_products_in_category($cid);
+            if ($products_in_category > 0) {
+              $categories_string5 .= '&nbsp;(' . $products_in_category . ')';
+            }
+          }
+        $categories_string5 .= '<br>' ."\n";
+      }
+
+// Traverse category tree
+      foreach ($foo5 as $key => $value) {
+        if ($foo5[$key]['parent'] == $cid) {
+  //        print "$key, $level5, $cid, $cpath<br>";
+          preorder($key, $level5+1, $foo5, ($level5 != 0 ? $cpath . $cid . '_' : ''));
+        }
+      }
+  }
+
+?>
+<!--  categories 5//-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES5);
+  new infoBoxHeading($info_box_contents, false, false);
+
+
+//////////
+// Get categories list
+//////////
+// 1.2 Test for presence of status field for compatibility with older versions
+  $status = tep_db_num_rows(tep_db_query('describe categories status'));
+  $query5 = "select 
+    c.categories_id, 
+    cd.categories_name, 
+    c.categories_image,
+    c.parent_id from 
+    " . TABLE_CATEGORIES . " c,
+    " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+    where 
+    c.parent_id = '0' 
+   and c.categories_id = cd.categories_id 
+   and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+ 
+
+  $categories_query5 = tep_db_query($query5);
+
+// Stuff in an array
+  while ($categories5 = tep_db_fetch_array($categories_query5))  {
+    $foo5[$categories5['categories_id']] = array('name' => $categories5['categories_name'], 'parent' => $categories5['parent_id']);
+  }
+
+// Initiate tree traverse
+  $categories_string5 = '';
+  preorder(0, 0, $foo5, '');
+
+//////////
+// Display box contents
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => $categories_string5);
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- categories5_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/currencies.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($currencies) && is_object($currencies)) {
+?>
+<!-- currencies //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CURRENCIES . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    reset($currencies->currencies);
+    $currencies_array = array();
+    while (list($key, $value) = each($currencies->currencies)) {
+      $currencies_array[] = array('id' => $key, 'text' => $value['title']);
+    }
+
+    $hidden_get_variables = '';
+    reset($HTTP_GET_VARS);
+    while (list($key, $value) = each($HTTP_GET_VARS)) {
+      if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
+        $hidden_get_variables .= tep_draw_hidden_field($key, $value);
+      }
+    }
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
+                                 'align' => 'center',
+                                 'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- currencies_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/customer_gv.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/customer_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/customer_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,55 @@
+<?php
+/*
+  $Id: customer_gv.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- Tell Customer he has a gift voucher-->
+<?php
+  if ($customer_id) {
+    $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$customer_id."'");
+    if ($gv_result=tep_db_fetch_array($gv_query)) $customer_gv_amount=$gv_result['amount'];
+  }
+if ($customer_gv_amount>0) {
+?>
+          <tr>
+            <td>
+<?php
+  
+
+ $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_GIFT_VOUCHER . '</font>'
+                               );
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<div align="center">'.GIFT_VOUCHER_ACCOUNT_BALANCE_1.$currencies->format($customer_gv_amount).GIFT_VOUCHER_ACCOUNT_BALANCE_2.'<a href="'.tep_href_link(FILENAME_GV_SEND).'">'.GIFT_VOUCHER_ACCOUNT_BALANCE_3.'</a>'
+                              );
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- Tell Customer he has a gift voucher_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/donate.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/donate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/donate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: donate.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- whats_new //-->
+          <tr>
+            <td>
+<?php 
+  
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DONATE  . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+$info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
+              <input type="hidden" name="cmd" value="_xclick">
+              <input type="hidden" name="business" value="donations at creloaded.com">
+              <input type="hidden" name="no_note" value="1">
+              <input type="hidden" name="currency_code" value="USD">
+              <input type="hidden" name="tax" value="0">
+              <input type="image" src="images/x-click_butcc_donate.gif" name="submit"  alt="'.DONATE_BUTTON_IMAGE_ALT.'">
+            </form>');
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/downloads.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/downloads.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/downloads.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,127 @@
+<?php
+/*
+  $Id: downloads.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- downloads //-->
+<?php
+
+
+  // modification of the logic to prevent the queries if there is no customer id
+  if ( $customer_id != '' ) {
+  if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+// Get last order id for checkout_success
+    $orders_query_raw = "SELECT orders_id FROM " . TABLE_ORDERS . " WHERE customers_id = '" . $customer_id . "' ORDER BY orders_id DESC LIMIT 1";
+    $orders_query = tep_db_query($orders_query_raw);
+    $orders_values = tep_db_fetch_array($orders_query);
+    $last_order = $orders_values['orders_id'];
+  } else {
+    $last_order = (int)$HTTP_GET_VARS['order_id'];
+  }
+
+// Now get all downloadable products in that order
+  $downloads_query_raw = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays
+                          FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
+                          WHERE customers_id = '" . $customer_id . "'
+                          AND o.orders_id = '" . $last_order . "'
+                          AND op.orders_id = '" . $last_order . "'
+                          AND opd.orders_products_id=op.orders_products_id
+                          AND opd.orders_products_filename<>''";
+  $downloads_query = tep_db_query($downloads_query_raw);
+
+// Don't display if there is no downloadable product
+  if (tep_db_num_rows($downloads_query) > 0) {
+     require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_DOWNLOADBOX);
+          ECHO '<tr><td>' ;
+          $info_box_contents = array();
+          $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DOWNLOADS . '</font>');
+          new infoBoxHeading($info_box_contents, false, false);
+
+           $info_box_contents = array();
+ ?>
+<!-- list of products -->
+<?php
+    while ($downloads_values = tep_db_fetch_array($downloads_query)) {
+?>
+
+<!-- left box -->
+<?php
+// MySQL 3.22 does not have INTERVAL
+      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads_values['date_purchased_day']);
+      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads_values['download_maxdays'], $dt_year);
+        $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
+
+// The link will appear only if:
+// - Download remaining count is > 0, AND
+// - The file is present in the DOWNLOAD directory, AND EITHER
+// - No expiry date is enforced (maxdays == 0), OR
+// - The expiry date is not reached
+      if (($downloads_values['download_count'] > 0) &&
+          (file_exists(DIR_FS_DOWNLOAD . $downloads_values['orders_products_filename'])) &&
+          (($downloads_values['download_maxdays'] == 0) ||
+           ($download_timestamp > time()))) {
+
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_FILE . '<br><br><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads_values['orders_products_download_id']) . '">' . $downloads_values['products_name'] . '</a>'
+                                          );
+ new infoBox($info_box_contents);
+      } else {
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => $downloads_values['products_name']
+                                          );
+ new infoBox($info_box_contents);
+
+      }
+?>
+<!-- right box -->
+<?php
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_DATE . '<br>' .  tep_date_long($download_expiry)
+                                          );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => $downloads_values['download_count'] . '  ' .  TEXT_HEADING_DOWNLOAD_COUNT
+                                        );
+  new infoBox($info_box_contents);
+ }
+
+if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => TEXT_FOOTER_DOWNLOAD . '<br><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . TEXT_DOWNLOAD_MY_ACCOUNT . '</a>'
+                                        );
+  new infoBox($info_box_contents);
+
+   }
+?>
+     </td>
+   </tr>
+<?php
+  }
+  }
+?>
+<!-- downloads_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/example.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/example.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/example.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1601 $
+
+*/
+?>
+<!-- Example_infobox Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_EXAMPLE . '</font>'
+                 // Change BOX_HEADING_EXAMPLE to your name, which you can find it easily.
+                 //and use the same in Infobox Admin to configure infobox.
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                // add infobox content below.
+                'text'  => 'Your Content here'
+                               );
+
+new infoBox($info_box_contents);
+
+?>
+</td></tr>
+<!-- Example_infobox_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/faq.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<?php
+/*
+  $Id: faq.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$faq_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_FAQ_CATEGORIES . " ic, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// faq outside categories
+$faq_query = tep_db_query("select ip.faq_id, ip.question from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '0' and ip.language = '" . (int)$languages_id . "' and ip.visible = '1' order by ip.v_order, ip.question");
+
+if ((tep_db_num_rows($faq_categories_query) > 0) || (tep_db_num_rows($faq_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FAQ . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $faq_string = '';
+  while ($faq_categories = tep_db_fetch_array($faq_categories_query)) {
+    $id_string = 'cID=' . $faq_categories['categories_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($faq = tep_db_fetch_array($faq_query)) {
+    $id_string = 'fID=' . $faq['faq_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq['question'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $faq_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,83 @@
+<?php
+/*
+  $Id: featured.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- featured //-->
+<?php
+
+
+  $random_product_side = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(), featured_date_added DESC limit " . MAX_RANDOM_SELECT_SPECIALS);
+
+$random_product_side_row = tep_db_num_rows($random_product_side);
+   if ($random_product_side_row > 0){
+?>
+          <tr>
+            <td>
+<?php
+while ($featured_random_product21 = tep_db_fetch_array($random_product_side)){
+
+$featured_product21_id = $featured_random_product21['products_id'];
+$featured_product21_image = tep_get_products_image($featured_random_product21['products_id']);
+$featured_product21_name = tep_get_products_name($featured_random_product21['products_id']);
+
+  $pf->loadProduct($featured_random_product21['products_id'],$languages_id);
+        $featured_price1 = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FEATURED . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents,  false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+            'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $featured_product21_image, $featured_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id, 'NONSSL') . '">' . $featured_product21_name . '</a><br>' . $featured_price1 );
+
+
+
+   new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  
+ }
+?>
+<!-- featured_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/googlead.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/googlead.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/googlead.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: googlead.php, v 1.1 2004/05/30 Tom O'Neill (zip1)
+
+  Released under the GNU General Public License
+ based on banner in a box by aubrey at mycon.co.za
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+*/
+?>
+<!-- google-banner-ad-in-a-box //-->
+<?php
+  if (!(getenv('HTTPS')=='on')){
+  if ($banner = tep_banner_exists('dynamic', 'googlebox')) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_GOOGLE_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+  }
+?>
+<!-- google-banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/information_table.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/information_table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/information_table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: information.php,v 1.1.1.1 2003/09/18 19:05:51 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2857 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- information //-->
+          <tr>
+            <td>
+<?php
+
+require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_INFORMATIONBOX);
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_INFORMATION_TABLE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  // Retrieve information from Info table
+   $informationString = "";
+
+ // joles
+   $sql_query = tep_db_query("SELECT information_id, languages_id, info_title FROM " . TABLE_INFORMATION . " WHERE visible= '1' and languages_id ='" . (int)$languages_id . "' ORDER BY v_order");
+   while ($row = tep_db_fetch_array($sql_query)){
+   $informationString .= '<a href="' . tep_href_link(FILENAME_INFORMATION,  'info_id=' . $row['information_id'] ) . '">' . $row['info_title'] . '</a><br>';
+   }
+
+   $info_box_contents = array();
+
+if (tep_session_is_registered('customer_id')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+
+ } else if ((tep_session_is_registered('customer_id')) && (MODULE_ORDER_TOTAL_GV_STATUS == 'true')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+} else {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+}
+
+  new $infobox_template($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/languages.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- languages //-->
+          <tr>
+            <td>
+<?php
+
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LANGUAGES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+    include(DIR_WS_CLASSES . FILENAME_LANGUAGE);
+    $lng = new language;
+  }
+
+  $languages_string = '';
+  reset($lng->catalog_languages);
+  while (list($key, $value) = each($lng->catalog_languages)) {
+    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text' => $languages_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- languages_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/links.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+/*
+  $Id: links.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1980 $
+
+
+  Released under the GNU General Public License
+*/
+
+
+// check for link categoris to determine if there is anything to display
+  $link_categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");
+  $number_of_categories = tep_db_num_rows($link_categories_query);
+
+  if ($number_of_categories > 0) {
+?>
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LINKS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_LINKS));
+
+    $informationString = '';
+    while($row = tep_db_fetch_array($link_categories_query)) {
+      $lPath_new = 'lPath=' . $row['link_categories_id'];
+      $informationString .= '<a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">' . $row['link_categories_name'] . '</a><br>';
+    }
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => $informationString
+                                );
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,143 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  loginbox.php -   Version 1.0
+  This puts a login request in a box with a login button.
+  If already logged in, will not show anything.
+
+  Modified to utilize SSL to bypass Security Alert
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_LOGINBOX);
+
+// WebMakers.com Added: Do not show if on login or create account
+if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') )  {
+?>
+<!-- loginbox //-->
+<?php
+
+    if (!tep_session_is_registered('customer_id')) {
+?>
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $loginboxcontent = "
+       <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "\">
+            <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
+               <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_EMAIL . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_PASSWORD . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"password\" name=\"password\" maxlength=\"40\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+        <tr>
+            <td align=\"center\">
+      " . tep_draw_separator('pixel_trans.gif', '100%', '5') . "
+      </td>
+            </tr>
+              <tr>
+                <td class=\"infoboxContents\" align=\"center\">
+                  " . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "
+                </td>
+              </tr>
+             </table>
+           </form> 
+              ";
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $loginboxcontent
+                                );
+new infoBox($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<?php
+  } else {
+  // If you want to display anything when the user IS logged in, put it
+  // in here...  Possibly a "You are logged in as :" box or something.
+
+
+  }
+?>
+<!-- loginbox_eof //-->
+<?php
+// WebMakers.com Added: My Account Info Box
+} else {
+  if (tep_session_is_registered('customer_id')) {
+?>
+
+<!-- my_account_info //-->
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>'
+                              );
+   new infoBox($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<!-- my_account_info_eof //-->
+
+<?php
+  }
+}
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/manufacturer_info.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/manufacturer_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/manufacturer_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: manufacturer_info.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- manufacturer_info //-->
+<?php
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id, m.manufacturers_id as manf_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from  " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and m.manufacturers_id = p.manufacturers_id and mi.manufacturers_id = m.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'");
+//    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id from  " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+
+   while ($manufacturer = tep_db_fetch_array($manufacturer_query)) {;
+?>
+<!-- manufacturer_info //-->
+          <tr>
+            <td>
+          
+<?php
+// echo 'prod-id' . (int)$HTTP_GET_VARS['products_id'] . 'manid' . $manufacturer['manufacturers_id'];
+      $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURER_INFO . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+      if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';
+      if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';
+      $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manf_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . ' ' . $manufacturer['manufacturers_name'] . '</a></td></tr>' .
+                                   '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturer_info_string);
+
+      new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- manufacturer_info_eof //-->
+          <?php
+       }
+      }
+?>
+<!-- manufacturer_info_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/boxes/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+  if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
+?>
+<!-- manufacturers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
+// Display a list
+      $manufacturers_list = '';
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
+        $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
+      }
+
+      $manufacturers_list = substr($manufacturers_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturers_list);
+    } else {
+// Display a drop-down
+      $manufacturers_array = array();
+      if (MAX_MANUFACTURERS_LIST < 2) {
+        $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
+                                       'text' => $manufacturers_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- manufacturers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+/*
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+// VJ navmenu begin
+define('TABLE_NAVMENU_CATEGORIES', 'navmenu_categories');
+define('TABLE_NAVMENU_CATEGORIES_DESCRIPTION', 'navmenu_categories_description');
+define('TABLE_NAVMENU_LINKS', 'navmenu_links');
+define('TABLE_NAVMENU_LINKS_DESCRIPTION', 'navmenu_links_description');
+define('TABLE_NAVMENU_LINKS_TO_CATEGORIES', 'navmenu_links_to_categories');
+// VJ navmenu end
+
+function tep_nm_get_navmenu_list($pid = 0, $list_string = '', $style_id = '') {
+  global $languages_id;
+
+  $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name
+                                    from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                         " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd
+                                    where c.nmc_parent_id = '" . (int)$pid . "'
+                                      and cd.nmc_id = c.nmc_id
+                                      and cd.language_id = '" . (int)$languages_id . "'
+                                    order by c.nmc_sort_order, cd.nmc_name");
+
+  $links_query = tep_db_query("select l.nml_id, l.nml_url, ld.nml_name
+                               from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                    " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c,
+                                    " . TABLE_NAVMENU_LINKS . " l,
+                                    " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld
+                               where c.nmc_id = '" . (int)$pid . "'
+                                 and c.nmc_id = l2c.nmc_id
+                                 and l2c.nml_id = l.nml_id
+                                 and ld.nml_id = l.nml_id
+                                 and ld.language_id = '" . (int)$languages_id . "'
+                               order by l.nml_sort_order, ld.nml_name");
+
+  if ((tep_db_num_rows($categories_query) > 0) || (tep_db_num_rows($links_query) > 0)) {
+    if (empty($list_string)) {
+      $list_string .= '<ul id="' . $style_id . '">' . "\n";
+    } else {
+      $list_string .= '<ul>' . "\n";
+    }
+
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $list_string .= '<li><a href="#">' . $categories['nmc_name'] . '</a>';
+
+      $list_string = tep_nm_get_navmenu_list((int)$categories['nmc_id'], $list_string);
+
+      $list_string .= '</li>' . "\n";
+    } 
+
+    while ($links = tep_db_fetch_array($links_query)) {
+      $list_string .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $links['nml_url'], 'NONSSL') . '">' . $links['nml_name'] . '</li>' . "\n";
+    } 
+
+    $list_string .= '</ul>' . "\n";
+  }
+
+  return $list_string;
+}
+?>
+<!-- navmenu //-->
+<script type="text/javascript"><!--
+sfHover = function() {
+   var sfEls = document.getElementById("navMenu").getElementsByTagName("LI");
+   for (var i=0; i<sfEls.length; i++) {
+     sfEls[i].onmouseover=function() {
+       this.className+=" sfhover";
+     }
+     sfEls[i].onmouseout=function() {
+       this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
+     }
+   }
+}
+if (window.attachEvent) window.attachEvent("onload", sfHover);
+//--></script>
+                  <tr>
+                    <td>
+                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
+                      <tr>
+                        <td width="100%">
+<?php
+$info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NAVMENU . '</font>');
+new infoBoxHeading($info_box_contents, false, false);
+
+$menu_string = tep_nm_get_navmenu_list(0, '', 'navMenu');
+
+// VJ debug
+//print_r($menu_string);
+
+$info_box_contents = array(array('text' =>  $menu_string));
+
+new infoBox($info_box_contents);
+?>
+                        </td>
+                      </tr>
+                    </table>
+                    </td>
+                  </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/order_history.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/order_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/order_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: order_history.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1182 $
+
+
+  Released under the GNU General Public License
+*/
+
+  if (tep_session_is_registered('customer_id')) {
+// retreive the last x products purchased
+    $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
+    if (tep_db_num_rows($orders_query)) {
+?>
+<!-- customer_orders //-->
+          <tr>
+            <td>
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CUSTOMER_ORDERS . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $product_ids = '';
+      while ($orders = tep_db_fetch_array($orders_query)) {
+        $product_ids .= (int)$orders['products_id'] . ',';
+      }
+      $product_ids = substr($product_ids, 0, -1);
+
+      $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+      $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+        // changes the cust_order into a buy_now action
+        $customer_orders_string .= '  <tr>' .
+                                   '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
+                                   '    <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
+                                   '  </tr>';
+      }
+      $customer_orders_string .= '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $customer_orders_string);
+
+      new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- customer_orders_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/pages.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: pages.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$pages_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_PAGES_CATEGORIES . " ic, " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// pages outside categories
+$pages_query = tep_db_query("select ip.pages_id, ipd.pages_title
+                             from " . TABLE_PAGES . " ip
+                             left join " . TABLE_PAGES_TO_CATEGORIES . " ip2c on (ip2c.pages_id = ip.pages_id and ip2c.categories_id = '0'),
+                                  " . TABLE_PAGES_DESCRIPTION . " ipd
+                             where ip.pages_status = '1'
+                               and ipd.pages_id = ip.pages_id
+                               and ipd.language_id = '" . (int)$languages_id . "'
+                             order by ip.pages_sort_order, ipd.pages_title");
+
+if ((tep_db_num_rows($pages_categories_query) > 0) || (tep_db_num_rows($pages_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_PAGES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $pages_string = '';
+  while ($pages_categories = tep_db_fetch_array($pages_categories_query)) {
+    $id_string = 'cID=' . $pages_categories['categories_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($pages = tep_db_fetch_array($pages_query)) {
+    $id_string = 'pID=' . $pages['pages_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages['pages_title'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $pages_string);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/product_notifications.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/product_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/product_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: product_notifications.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2746 $
+
+
+  Released under the GNU General Public License
+*/
+if (isset($HTTP_POST_VARS['products_id']) && tep_not_null($HTTP_POST_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+  } elseif (isset($HTTP_GET_VARS['products_id']) && tep_not_null($HTTP_GET_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_GET_VARS['products_id']);
+  } 
+  if ( (isset($HTTP_GET_VARS['products_id'])) || (isset($HTTP_POST_VARS['products_id'])) ) {
+?>
+<!-- notifications //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NOTIFICATIONS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
+
+    if (tep_session_is_registered('customer_id')) {
+      $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      $notification_exists = (($check['count'] > 0) ? true : false);
+    } else {
+      $notification_exists = false;
+    }
+
+    $info_box_contents = array();
+    if ($notification_exists == true) {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    } else {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    }
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- notifications_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/reviews.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1738 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- reviews //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_REVIEWS . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_REVIEWS));
+
+  $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'";
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $random_select .= " and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'";
+  }
+  $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
+  $random_product = tep_random_select($random_select);
+
+  $info_box_contents = array();
+
+  if ($random_product) {
+// display random review box
+    $review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'");
+    $review = tep_db_fetch_array($review_query);
+
+    $review = tep_break_string(tep_output_string_protected($review['reviews_text']), 15, '-<br>');
+
+    $info_box_contents[] = array('text' => '<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div>');
+  } elseif (isset($HTTP_GET_VARS['products_id'])) {
+// display 'write a review' box
+    $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . BOX_REVIEWS_WRITE_REVIEW .'</a></td></tr></table>');
+  } else {
+// display 'no reviews' box
+    $info_box_contents[] = array('text' => BOX_REVIEWS_NO_REVIEWS);
+  }
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- reviews_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/search.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: search.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" ') . '&nbsp;' . tep_hide_session_id() . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');
+
+  new infoBox($info_box_contents);
+
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/search1.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/search1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/search1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,43 @@
+<?php
+/*
+  $Id: search1.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH1 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find1" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px">&nbsp;' . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br>'
+                              );
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- shop by price //-->
+<?php
+if (MODULE_SHOPBYPRICE_RANGES > 0) {
+?>
+          <tr>
+            <td>
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOP_BY_PRICE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $sbp_array = unserialize(MODULE_SHOPBYPRICE_RANGE);
+
+  $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=0', 'NONSSL') . '">' . TEXT_INFO_UNDER . $currencies->format($sbp_array[0]) . '</a><br>');
+  for ($i=1, $ii=count($sbp_array); $i < $ii; $i++) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . TEXT_INFO_FROM . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_TO . $currencies->format($sbp_array[$i]) . '</a><br>');
+  }
+  if (MODULE_SHOPBYPRICE_OVER == True) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_ABOVE . '</a><br>');
+  }
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- shop_by_price //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/boxes/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,130 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1609 $
+
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- shopping_cart //-->
+<script type="text/javascript"><!--
+function couponpopupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOPPING_CART . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));
+
+  $cart_contents_string = '';
+  if ($cart->count_contents() > 0) {
+    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+  $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
+    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
+  if ((int)$products_parent_id['products_parent_id'] != 0) {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '">';
+  } else {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+  }
+
+//      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+      $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        tep_session_unregister('new_products_id_in_cart');
+      }
+    }
+    $cart_contents_string .= '</table>';
+  } else {
+    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $cart_contents_string);
+
+  if ($cart->count_contents() > 0) {
+    // WebMakers.com Added: Shoppe Enhancement Controller
+    // check for free order
+    $final_total=$cart->show_total();
+    if ($final_total==0) {
+      $final_total='Free';
+    } else {
+      $final_total=$currencies->format($cart->show_total());
+    }
+    $info_box_contents[] = array('text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'right',
+                                 'text' => $final_total);
+  }
+// ICW ADDED FOR CREDIT CLASS GV
+  if (tep_session_is_registered('customer_id')) {
+    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $gv_result = tep_db_fetch_array($gv_query);
+    if ($gv_result['amount'] > 0 ) {
+      $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');
+    }
+  }
+  if (tep_session_is_registered('gv_id')) {
+    $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
+    $coupon = tep_db_fetch_array($gv_query);
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');
+
+  }
+  if (tep_session_is_registered('cc_id') && $cc_id) {
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');
+
+  }
+
+// ADDED FOR CREDIT CLASS GV END ADDITTION
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- shopping_cart_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+
+   $random_product25 = tep_db_query("select distinct
+   p.products_id, 
+   pd.products_name, 
+   p.products_tax_class_id, 
+   p.products_image, 
+   s.specials_new_products_price 
+   from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+    " . TABLE_SPECIALS . " s 
+   where 
+   p.products_status = '1' 
+   and p.products_id = s.products_id 
+   and pd.products_id = s.products_id 
+   and pd.language_id = '" . (int)$languages_id . "' 
+   and s.status = '1' 
+   order by rand(), s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
+ 
+  
+  $random_product24_side_row = tep_db_num_rows($random_product25);
+     if ($random_product24_side_row > 0){
+
+?>
+<!-- d specials //-->
+          <tr>
+            <td>
+<?php
+
+while ($product_specials22 = tep_db_fetch_array($random_product25)){
+  $product_specials22_id = $product_specials22['products_id'];
+  $product_specials22_image = tep_get_products_image($product_specials22['products_id']);
+  $product_specials22_name = tep_get_products_name($product_specials22['products_id']);
+
+  $pf->loadProduct($product_specials22['products_id'],$languages_id);
+        $special_random_price = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SPECIALS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price);
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- specials_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['products_id']) {
+?>
+<!-- tell_a_friend //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TELL_A_FRIEND . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('tell_a_friend', tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('to_email_address', '', 'size="10"') . '&nbsp;' . tep_template_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id() . '<br>' . BOX_TELL_A_FRIEND_TEXT);
+
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- tell_a_friend_eof //-->
+
+<?php } ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/boxes/theme_select.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/theme_select.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/theme_select.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: theme_select.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+    if (tep_session_is_registered('customer_id')) {
+
+  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
+
+?>
+<!-- theme //-->
+         <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TEMPLATE_SELECT . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $template_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " where active = '1' order by template_name");
+
+ 
+// Display a drop-down
+    $select_box = '<select name="template" onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%">';
+    if (MAX_THEME_LIST < 2) {
+      $select_box .= '<option value="">' . PULL_DOWN_DEFAULT . '</option>';
+    }
+    while ($template_values = tep_db_fetch_array($template_query)) {
+      $select_box .= '<option value="' . $template_values['template_name'] . '"';
+      if ($HTTP_GET_VARS['template_id'] == $template_values['template_id']) $select_box .= ' SELECTED';
+      $select_box .= '>' . substr($template_values['template_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
+    }
+    $select_box .= "</select>";
+    $select_box .= tep_hide_session_id();
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form'  => '<form name="template" method="post" action="' . tep_href_link(FILENAME_DEFAULT, '&action=update_template', 'NONSSL') . '">',
+                                 'align' => 'left',
+                                 'text'  => $select_box);
+
+   new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<?php
+}}
+?>
+<!-- template_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/whats_new.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/whats_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/whats_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3421 $
+
+
+  Released under the GNU General Public License
+*/
+  $random_product27 = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+      order by rand(), products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
+ 
+$random_product27_side_row = tep_db_num_rows($random_product27);
+   if ($random_product27_side_row > 0){
+
+  ?>
+<!-- whats_new //-->
+ <tr>
+            <td>
+<?php      
+    
+while ($whatsnew_product21 = tep_db_fetch_array($random_product27)){
+  $whatsnew_product21_id = $whatsnew_product21['products_id'];
+  $whatsnew_product21_image = tep_get_products_image($whatsnew_product21['products_id']);
+  $whatsnew_product21_name = tep_get_products_name($whatsnew_product21['products_id']);
+
+  $pf->loadProduct($whatsnew_product21['products_id'],$languages_id);
+         $whats_new_price = $pf->getPriceStringShort();
+}
+// EOF Separate Pricing Per Customer
+//Eversun mod end for sppc and qty price breaks
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHATS_NEW . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',           
+         'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $whatsnew_product21_image, $whatsnew_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . $whatsnew_product21_name . '</a><br>' . $whats_new_price .'<br />');
+//Eversun mod for sppc and qty price breaks
+
+    new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/boxes/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,94 @@
+<?php
+/*
+  $Id: whos_online.php, v 1.0 2001/12/05 by mattice at xs4all.nl
+
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2427 $
+
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official TEP distribution
+  but an add-on contributed to the TEP community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+*/
+
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_WHOS_ONLINEBOX);
+?>
+
+
+<!-- whos_online //-->
+          <tr>
+            <td>
+<?php
+
+// Set expiration time, default is 900 secs (15 mins)
+  $xx_mins_ago = (time() - 900);
+
+  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
+
+  $whos_online_query = tep_db_query("select customer_id from " . TABLE_WHOS_ONLINE);
+  while ($whos_online = tep_db_fetch_array($whos_online_query)) {
+                        if (!$whos_online['customer_id'] == 0) $n_members++;
+                        if ($whos_online['customer_id'] == 0) $n_guests++;
+
+  $user_total = sprintf(tep_db_num_rows($whos_online_query));                                                                }
+
+  if ($user_total == 1) {
+    $there_is_are = BOX_WHOS_ONLINE_THEREIS . '&nbsp;';
+  } else {
+    $there_is_are = BOX_WHOS_ONLINE_THEREARE . '&nbsp;';
+  }
+
+  if ($n_guests == 1) {
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUEST;
+  }else{
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUESTS;
+  }
+
+  if ($n_members == 1) {
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBER;
+  }else{
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBERS;
+  }
+
+
+  if (($n_guests >= 1) && ($n_members >= 1)) $word_and = '&nbsp;' . BOX_WHOS_ONLINE_AND . '&nbsp;<br>';
+
+      $textstring = $there_is_are;
+        if ($n_guests >= 1) $textstring .= $n_guests . $word_guest;
+
+      $textstring .= $word_and;
+        if ($n_members >= 1) $textstring .= $n_members . $word_member;
+
+      $textstring .= '&nbsp;online.';
+
+
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHOS_ONLINE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>  $textstring
+                              );
+  new infoBox($info_box_contents);
+?>
+            </td>
+          </tr>
+<!-- whos_online_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/boxes/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,96 @@
+<?php
+/*
+  $Id: wishlist.php,v 2.2 2004/09/12 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2546 $
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- wishlist //-->
+<?php
+if (basename($PHP_SELF) != FILENAME_WISHLIST_SEND){
+if (basename($PHP_SELF) != FILENAME_WISHLIST)   {
+?> 
+          <tr>
+            <td>
+<?php
+  // retreive the wishlist
+  if (tep_session_is_registered('customer_id')) {
+    $wishlist_query_raw = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 order by products_name";  
+    $wishlist_query = tep_db_query($wishlist_query_raw);
+
+    // if we have something in this clients list:
+    ?>
+    <!-- customer_wishlist //-->
+    <script type="text/javascript"><!--
+    function popupWindowWishlist(url) {
+      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=425,height=475,screenX=150,screenY=150,top=150,left=150')
+    }
+    //--></script>
+    <?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WISHLIST . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_WISHLIST, '','NONSSL'));
+    
+    $info_box_contents = array();
+    
+    if (tep_db_num_rows($wishlist_query)) {
+      if (tep_db_num_rows($wishlist_query) < MAX_DISPLAY_WISHLIST_BOX) {
+
+        $product_ids = '';
+        while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+          $product_ids .= $wishlist['products_id'] . ',';
+         }
+        $product_ids = substr($product_ids, 0, -1);        
+       
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        //  $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . $product_ids . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $customer_wishlist_string .= '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a></td>' . "\n" .
+                                                  '</tr>' . "\n" .
+                                                  '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents" align="center" valign="bottom"><b><a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_MOVE_TO_CART . '</a>&nbsp;|' . "\n" .
+                                                  '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b>' . "\n" .  tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td>' .
+                                                  '</td></tr>' . "\n";
+        }
+      } else {
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . sprintf(TEXT_WISHLIST_COUNT, tep_db_num_rows($wishlist_query)) . '</td></tr>' . "\n";
+      }
+    } else {
+      $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+      $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . BOX_WISHLIST_EMPTY . '</td></tr>' . "\n";
+    }
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a></td></tr>' . "\n";
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST_HELP . '</u> [?]</a></td></tr>' . "\n"; // Normal link
+    $customer_wishlist_string .= '</table>';
+
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => $customer_wishlist_string);
+
+    new infoBox($info_box_contents);
+  }
+?>
+            </td>
+          </tr>
+          <?php
+    }}
+?><!-- wishlist_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/boxes.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/boxes.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/boxes.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,243 @@
+<?php
+/*
+  $Id: boxes.tpl.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBox {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBox($contents, $direct_output = false) {
+      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
+      $tableBox_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
+        $tableBox_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
+        $tableBox_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
+              $tableBox_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
+              $tableBox_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox_string .= '    <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
+        }
+
+        $tableBox_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
+      }
+
+      $tableBox_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox_string;
+
+      return $tableBox_string;
+    }
+  }
+
+class categoriesBox extends tableBox {
+function categoriesBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->categoriesBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $this->tableBox($info_box_contents, true);
+    }
+
+function categoriesBoxContents($contents) {
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $info_box_contents = array();
+      for ($i=0; $i<sizeof($contents); $i++) {
+        $info_box_contents[] = array(array('align' => 'center', 'params' => 'class="noclass"', 'text' => $contents[$i]['text']));
+      }
+      return $this->tableBox($info_box_contents);
+    }
+}
+
+  class infoBox extends tableBox {
+    function infoBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function infoBoxContents($contents) {
+      $this->table_cellpadding = '3';
+      $this->table_parameters = 'class="infoBoxContents"';
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
+                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
+                                           'params' => 'class="boxText"',
+                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
+      }
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      return $this->tableBox($info_box_contents);
+    }
+  }
+
+  class infoBoxHeading extends tableBox {
+    function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+      } else {
+        $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => 'width="100%" height="14" class="infoBoxHeading"',
+                                         'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading" nowrap',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class infoboxFooter extends tableBox {
+    function infoboxFooter($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      } else {
+        $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES. 'pixel_trans.gif');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => ' class="infoBoxHeading"', 'text' => $left_corner),
+                                   array('params' => ' width="100%" ', 'text' => $contents[0]['text']),
+            array('params' => ' class="infoBoxHeading" nowrap', 'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class contentBox extends tableBox {
+    function contentBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
+      $this->table_cellpadding = '1';
+      $this->table_parameters = 'class="infoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function contentBoxContents($contents) {
+      $this->table_cellpadding = '4';
+      $this->table_parameters = 'class="infoBoxContents"';
+      return $this->tableBox($contents);
+    }
+  }
+
+  class contentBoxHeading extends tableBox {
+    function contentBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_width = '100%';
+      $this->table_cellpadding = '0';
+      
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/no_arrow_right.gif');
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_right.gif');
+      } else {
+         $right_corner = $right_arrow ;
+
+      }
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => ' align="center" background="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif" width="100%"  class="infoBoxHeading"',
+                 'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class errorBox extends tableBox {
+    function errorBox($contents) {
+      $this->table_data_parameters = 'class="errorBox"';
+      $this->tableBox($contents, true);
+    }
+  }
+
+  class productListingBox extends tableBox {
+    function productListingBox($contents) {
+      $this->table_parameters = 'class="productListing"';
+      $this->tableBox($contents, true);
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Original/extra_html_output.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/extra_html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/extra_html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,113 @@
+<?php
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_template_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_template_image_button($image, $alt = '', $parameters = '') {
+    global $language;
+
+    return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+  }
+
+
+  function table_image_border_top($left, $right,$header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+                     <tr>
+                      <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                                <tr>
+                                  <td class="main_table_heading_inner"><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td>
+
+<?php
+}
+
+}
+  function table_image_border_bottom(){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+                                    </table></td>
+                                </tr>
+                              </table></td>
+                          </tr>
+      </table></td>
+  </tr>
+      </table></td>
+  </tr>
+      </table>
+      <!--Lango Added for Template MOD: EOF-->
+<?php
+}
+}
+
+
+  function table_image_main_border_top($left, $right, $header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                     <tr>
+                      <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                <tr>
+                                  <td><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td class="infoBoxHeading"><?php echo $header;?></td>
+                                      </tr>
+                                    </table></td>
+                                </tr>
+
+                              </table></td>
+                          </tr>
+
+      </table></td>
+  </tr>
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+                     <tr>
+                      <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                                <tr>
+                                  <td class="main_table_heading_inner"><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td>
+
+<?php
+}
+
+}
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/footer.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/footer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/footer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,87 @@
+<?php
+/*
+  $Id: footer.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+  require(DIR_WS_INCLUDES . FILENAME_COUNTER);
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="1">
+  <tr class="footer">
+    <td class="footer">&nbsp;&nbsp;<?php echo strftime(DATE_FORMAT_LONG); ?>&nbsp;&nbsp;</td>
+    <td align="right" class="footer">&nbsp;&nbsp;<?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>&nbsp;&nbsp;</td>
+  </tr>
+</table>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" class="smallText">
+<?php
+
+ if (!(getenv('HTTPS')=='on')){
+//google banner ad
+if ($banner = tep_banner_exists('dynamic', 'googlefoot')) {
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
+  </tr>
+</table>
+<?php
+  }
+  }
+?>
+
+<?php
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default osCommerce-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+
+  echo FOOTER_TEXT_BODY
+?>
+
+    </td>
+  </tr>
+</table>
+<?php
+}
+
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+if (SITE_WIDTH!='100%') {
+?>
+         </td></tr></table>
+       </td></tr>
+     </table>
+   </td>
+  </tr>
+</table>
+<?php
+}
+// EOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+?>
+<!-- footer_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/header.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: header.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+define('DIR_WS_TEMPLATE_IMAGES', 'templates/Original/images/');
+
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+
+if (SITE_WIDTH!='100%') {
+?>
+    <table width="100%" cellpadding="10" cellspacing="0" border="0">
+      <tr><td>
+        <table BORDERCOLORLIGHT="2F4F2F" CELLSPACING="2" CELLPADDING="4" BORDER="2" width="<?php echo SITE_WIDTH;?>" align="center" BGCOLOR="FFFFFF">
+          <tr><td BORDERCOLOR="FF0000">
+            <table border="0" width="100%"><tr><td>
+<?php
+}
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr class="header">
+    <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_TEMPLATE_IMAGES . 'openmoko_logo.png', 'Store Logo') . '</a>'; ?></td>
+    <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>&nbsp;&nbsp;</td>
+  </tr>
+</table>
+<table border="0" width="100%" cellspacing="0" cellpadding="1">
+  <tr class="headerNavigation">
+    <td class="headerNavigation">&nbsp;&nbsp;<?php echo $breadcrumb->trail(' &raquo; '); ?></td>
+    <td align="right" class="headerNavigation">
+    <?php
+      if (!tep_session_is_registered('noaccount')){// DDB - PWA - 040622 - no display of logoff for PWA customers
+         if (!tep_session_is_registered('customer_id')) {
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_TITLE_LOGIN . '</a>&nbsp;|&nbsp;';
+          } else {
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_ACCOUNT, "", "SSL") . '">' . HEADER_TITLE_MY_ACCOUNT . ' </a> &nbsp;|&nbsp;';
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_TITLE_LOGOFF . ' </a> &nbsp;|&nbsp;';
+          }
+         }
+
+     if (tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers
+       {
+     if (!tep_session_is_registered('customer_id')) {
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_TITLE_LOGIN . ' </a> &nbsp;|&nbsp;';
+   }else{
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_TITLE_LOGOFF . ' </a> &nbsp;|&nbsp;';
+      }
+      }
+       ?>
+
+
+    <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>
+      &nbsp;|&nbsp; <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?>&nbsp;|&nbsp;</a></td>
+
+  </tr>
+</table>
+
+<?php
+}
+?>
+<!-- header_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/images/Original.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/Original.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/admin_logo_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/admin_logo_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/espanol/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/french/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/french/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/buttons/german/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/buttons/german/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/logo-banner_02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/logo-banner_02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/logo-banner_03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/logo-banner_03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/logo-banner_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/logo-banner_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/openmoko_logo.png
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/openmoko_logo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/original_background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/original_background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/images/oscommerce.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original/images/oscommerce.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body>
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+<!-- warning_eof //-->
+
+<!-- header //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_HEADER); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="<?php echo CELLPADDING_MAIN; ?>">
+  <tr>
+<?php
+if (DISPLAY_COLUMN_LEFT == 'yes')  {
+// WebMakers.com Added: Down for Maintenance
+// Hide column_left.php if not to show
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+<!-- content //-->
+    <td width="100%" valign="top">
+<?php
+if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template))) {
+    require(DIR_WS_CONTENT . basename($content_template));
+  } else {
+    require(DIR_WS_CONTENT . $content . '.tpl.php');
+  }
+?>
+    </td>
+<!-- content_eof //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide column_right.php if not to show
+
+
+if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_FOOTER); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>

Added: trunk/direct.openmoko.com/templates/Original/mainpage_modules/default_specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/mainpage_modules/default_specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/mainpage_modules/default_specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: default_specials.php,v 2.1 2006/09/07 23:42:27 datazen Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- default_specials mainpage //-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
+  
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+  $random_specials = array();
+  $specials_array = array();
+  $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC");
+  while ($specials = tep_db_fetch_array($specials_query)) {
+    $random_specials[] .= $specials['products_id'];
+  }
+
+  $row = 0;
+  $col = 0;
+
+  if (sizeof($random_specials)!=0){
+    $max_displayed = (MAX_DISPLAY_SPECIAL_PRODUCTS > sizeof($random_specials)) ? sizeof($random_specials) : MAX_DISPLAY_SPECIAL_PRODUCTS;
+    $special_products = cre_random_array($random_specials, $max_displayed);
+    for($i=0; $i < $max_displayed; $i++) {
+      $product_array = array();
+      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price as special_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where  p.products_id = $special_products[$i] and  s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");
+      $product = tep_db_fetch_array($product_query);
+
+      $pf->loadProduct($product['products_id'],$languages_id);
+      $products_price_s = $pf->getPriceStringShort();
+
+      $buyitnow='<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+ 
+      $info_box_contents[$row][$col] = array('align' => 'center',
+                                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                                             'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $product['products_image'], $product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . $product['products_name'] . '</a><br>' . $products_price_s . '<br>'. $buyitnow);
+      $col ++;
+      if ($col > 2) {
+        $col = 0;
+        $row ++;
+      }
+    }
+  }else{
+      $info_box_contents[$row][$col] = array('align' => 'left',
+                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                             'text' => TEXT_NO_SPECIALS);
+  }
+  
+  new contentBox($info_box_contents);
+
+  $info_box_contents = array();
+  if (MAIN_TABLE_BORDER == 'yes'){
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                             );
+    new infoboxFooter($info_box_contents, true, true);
+  }
+?><!-- default_specials_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/mainpage_modules/example.html
===================================================================
--- trunk/direct.openmoko.com/templates/Original/mainpage_modules/example.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/mainpage_modules/example.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<table width="100%" border="0" bgcolor="FFA814" cellspacing="0" cellpadding="0">
+  <tr>
+    <td bgcolor="#CCCCCC">
+    <table width="100%" border="0" cellpadding="0" cellspacing="1">
+      <tr>
+        <td class="infoBoxHeading">
+        Example HTML Mainpage Module</td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+  <tr>
+    <td valign="top" width="100%">
+    <table width="100%" border="0" class="infobox" cellspacing="0" cellpadding="1">
+      <tr>
+        <td valign="top" width="100%">
+        <table width="100%" border="0" class="infoboxContents" cellspacing="0" cellpadding="0">
+      <!-- change from here to next-->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+          <tr>
+            <td align="center">
+            <img width="426" height="75" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr01.gif" border="0"></td>
+          </tr>
+          <tr>
+            <td valign="top" align="center">
+            <img valign="top" width="117" height="90" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr02.gif" border="0"></a><img width="117" height="90" valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr03.gif" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr04.gif" height="90" width="96" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr05.gif" width="96" height="90" border="0"></td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <!-- change from here to above-->
+        </table>
+        </td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/mainpage_modules/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/mainpage_modules/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/mainpage_modules/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,70 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Featured Products V1.1
+  Displays a list of featured products, selected from admin
+  For use as an Infobox instead of the "New Products" Infobox
+*/
+?>
+<!-- featured_products_mainpage //-->
+<?php
+ 
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+      $featured_products_2bb_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                              " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(),p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
+   
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($featured_products_2bb = tep_db_fetch_array($featured_products_2bb_query)) {
+
+    $num ++;
+  
+    if ($num == 1) {
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+    }    
+
+  $pf->loadProduct($featured_products_2bb['products_id'],$languages_id);
+        $products_price_2bb = $pf->getPriceStringShort();
+
+
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products_2bb['products_image'], $featured_products_2bb['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . $featured_products_2bb['products_name'] . '</a><br>' . $products_price_2bb);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+
+  }
+ 
+?>
+<!-- featured_products_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/mainpage_modules/main_categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/mainpage_modules/main_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/mainpage_modules/main_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,178 @@
+<?php
+/*
+  $Id: main_categories.php,v 1.0a 2002/08/01 10:37:00 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Barreto
+  Gustavo Barreto <gustavo at barreto.net>
+  http://www.barreto.net/
+
+  Based on: all_categories.php Ver. 1.6 by Christian Lescuyer
+
+  History: 1.0 Creation
+     1.0a Correction: Extra Carriage Returns
+     1.1  added parameters to change display options -- mdt
+
+  Released under the GNU General Public License
+
+*/
+
+//------------------------------------------------------------------------------------------------------
+// PARAMETERS
+//------------------------------------------------------------------------------------------------------
+
+$item_column_number = 3;    // range of 1 to 9
+$item_title_on_newline = true;  // true or false
+
+// for item and subcategory options, suugest that you just put in CSS code
+// you can also just define a class and then change it in a template addon like BTS
+$item_div_options = 'style="text-align:center;font-weight:bold;font-size:larger;margin-top:5px;"';
+$item_subcategories_options = '';
+
+//------------------------------------------------------------------------------------------------------
+// CODE - do not change below here
+//------------------------------------------------------------------------------------------------------
+
+// error checking on parameters
+if($item_column_number < 1)
+{
+  $item_column_number = 1;
+}
+if($item_column_number > 9)
+{
+  $item_column_number = 9;
+}
+if($item_title_on_newline)
+{
+  $item_separator = '<br>';
+} else {
+  $item_separator = '&nbsp;';
+}
+
+// preorder_mc tree traversal
+  function preorder_mc($cid_cat, $level_cat, $foo_cat, $cpath_cat)
+  {
+    global $categories_string_cat, $HTTP_GET_VARS;
+
+// Display link
+    if ($cid_cat != 0) {
+      for ($i=0; $i<$level_cat; $i++)
+        $categories_string_cat .=  '&nbsp;&nbsp;';
+      $categories_string_cat .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath
+=' . $cpath_cat . $cid_cat) . '">';
+// 1.6 Are we on the "path" to selected category?
+      $bold = strstr($HTTP_GET_VARS['cPath'], $cpath_cat . $cid_cat . '_') || $HTTP_GET_VARS['cPath'] == $cpath_cat . $cid_cat;
+// 1.6 If yes, use <b>
+      if ($bold)
+        $categories_string_cat .=  '<b>';
+      $categories_string_cat .=  $foo_cat[$cid_cat]['name'];
+      if ($bold)
+        $categories_string_cat .=  '</b>';
+      $categories_string_cat .=  '</a>';
+// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+      if (SHOW_COUNTS == 'true') {
+        $products_in_category = tep_count_products_in_category($cid_cat);
+        if ($products_in_category > 0) {
+          $categories_string_cat .= '&nbsp;(' . $products_in_category . ')';
+        }
+      }
+      $categories_string_cat .= '<br>';
+    }
+
+// Traverse category tree
+    if (is_array($foo_cat)) {
+      foreach ($foo_cat as $key => $value) {
+        if ($foo_cat[$key]['parent'] == $cid_cat) {
+          preorder_mc($key, $level_cat+1, $foo_cat, ($level_cat != 0 ? $cpath_cat . $cid_cat . '_' : ''));
+        }
+      }
+    }
+  }
+
+?>
+<!-- main_categories //-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES_MAIN_PAGE);
+  new infoBoxHeading($info_box_contents, true, true);
+
+
+//////////
+// Get categories list
+//////////
+
+$query_cat = "select 
+  c.categories_id, 
+  cd.categories_name, 
+  c.categories_image,
+  c.parent_id from 
+  " . TABLE_CATEGORIES . " c,
+  " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+  where 
+  c.parent_id = '0' 
+ and c.categories_id = cd.categories_id 
+ and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+
+  $categories_query_cat = tep_db_query($query_cat);
+
+
+// Initiate tree traverse
+$categories_string_cat = '';
+preorder_mc(0, 0, $foo_cat, '');
+
+//////////
+// Display box contents
+//////////
+
+$info_box_contents = array();
+
+$row = 0;
+$col = 0;
+while ($categories_cat = tep_db_fetch_array($categories_query_cat))
+{
+  if ($categories['parent_id'] == 0)
+    {
+      $cpath_cat_new = tep_get_path($categories_cat['categories_id']);
+      $text_subcategories = '';
+      $subcategories_query_cat = tep_db_query($query_cat);
+      while ($subcategories_cat = tep_db_fetch_array($subcategories_query_cat))
+      {
+        if ($subcategories_cat['parent_id'] == $categories_cat['categories_id'])
+      {
+                $cPath_new_sub = "cPath="  . $categories_cat['categories_id'] . "_" . $subcategories_cat['categories_id'];
+                $text_subcategories .= '• <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">';
+                $text_subcategories .= $subcategories_cat['categories_name'] . '</a>' . " ";
+
+          } // if ($subcategories['parent_id'] == $categories['categories_id'])
+
+      } // while ($subcategories = tep_db_fetch_array($subcategories_query))
+
+    $info_box_contents[$row][$col] = array('align' => 'left',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cpath_cat_new) . '">' . tep_image(DIR_WS_IMAGES . $categories_cat['categories_image'], $categories_cat['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories_cat['categories_name'] . '</a></DIV>');
+
+      // determine the column position to see if we need to go to a new row
+      $col ++;
+      if ($col > ($item_column_number - 1))
+      {
+          $col = 0;
+          $row ++;
+
+      } //if ($col > ($number_of_columns - 1))
+
+    } //if ($categories['parent_id'] == 0)
+
+} // while ($categories = tep_db_fetch_array($categories_query))
+
+//output the contents
+new contentBox($info_box_contents);
+?>
+<!-- main_categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/mainpage_modules/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/mainpage_modules/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/mainpage_modules/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: mainpage.php,v 2.1 2004/04/07
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+  to change the contents of this file edit
+  includes/languages/(language)/mainpage.php
+*/
+?>
+<!-- Main_page //-->
+
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, HEADING_TITLE);
+}
+// EOF: Lango Added for template MOD
+
+
+include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE);
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<!-- Main_page_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/mainpage_modules/new_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/mainpage_modules/new_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/mainpage_modules/new_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,69 @@
+<?php
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- mainpages_modules.new_products.php//-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
+
+  
+      $new_products_query = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+       order by rand(), p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
+
+  
+
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($new_products = tep_db_fetch_array($new_products_query)) {
+  
+    $num ++;
+      if ($num == 1) { 
+  new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+      }
+
+  $pf->loadProduct($new_products['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+
+  
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $products_price_s);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+if($num) {
+  new contentBox($info_box_contents);
+}
+
+?>
+<!-- new_products_eof //-->

Added: trunk/direct.openmoko.com/templates/Original/mainpage_modules/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original/mainpage_modules/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/mainpage_modules/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/*
+  $Id: upcoming_products.php,v 1.1.1.3 2004/04/07 23:42:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- upcoming_products mainpage_modules //-->
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_UPCOMING_PRODUCTS, strftime('%B')));
+
+    $expected_query_raw= tep_db_query("select
+ p.products_id,
+ pd.products_name, 
+ p.products_image, 
+    products_date_available as date_expected 
+ from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+    where 
+    to_days(products_date_available) >= to_days(now()) 
+    and p.products_id = pd.products_id 
+    and pd.language_id = '" . (int)$languages_id . "' 
+    order by rand()
+    limit " . MAX_DISPLAY_UPCOMING_PRODUCTS);
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($expected_query = tep_db_fetch_array($expected_query_raw)) {
+  
+    $num ++;
+      if ($num == 1) { 
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
+      }
+  $pf->loadProduct($expected_query['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+    
+   $duedate= str_replace("00:00:00", "" , $expected_query['date_expected']);  
+   
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $expected_query['products_image'], $expected_query['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . $expected_query['products_name'] . '</a><br>' . $products_price_s . '<br>' . TABLE_HEADING_DATE_EXPECTED . '&nbsp;' . $duedate);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+
+  }
+?>
+<!-- upcoming_products_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/Original/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,727 @@
+/*
+  $Id: stylesheet.css,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  .cat_description {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #800000;
+     background : inherit;
+     font-weight : bold;
+      }
+ .boxText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .centerTable {
+     background-image : url('images/bg_cat4.gif');
+     background-repeat : repeat-x;
+     background : #fbfcfd;
+     color : inherit;
+      }
+ .errorBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : inherit;
+     background : #ffb3b5;
+     font-weight : bold;
+      }
+ .stockWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #cc0033;
+     background : inherit;
+      }
+ .productsNotifications {
+     background : #f2fff7;
+     color : inherit;
+      }
+ .orderEdit {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #70d250;
+     background : inherit;
+     text-decoration : underline;
+      }
+ .navBlue {
+     color : #ff0000;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ .subnavBlue {
+     color : #9966ff;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ BODY {
+     background : #ffffff;
+     color : #000000;
+     margin : 0;
+      }
+ A {
+     color : #000000;
+     background : inherit;
+     text-decoration : none;
+      }
+ A:hover {
+     color : #aabbdd;
+     background : inherit;
+     text-decoration : underline;
+      }
+ FORM {
+     display : inline;
+      }
+ TR.header {
+     background : #ffffff;
+     color : inherit;
+      }
+ TR.headerNavigation {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.headerNavigation {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ A.headerNavigation {
+     color : #ffffff;
+     background : #bbc3d3;
+      }
+ a:hover.headerNavigation {
+     color : #ffffff;
+     background : #bbc3d3;
+      }
+ TR.headerError {
+     background : #ff0000;
+     color : #bbc3d3;
+      }
+ TD.headerError {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ff0000;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ TR.headerInfo {
+     background : #00ff00;
+     color : #bbc3d3;
+      }
+ TD.headerInfo {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #00ff00;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ TR.footer {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.footer {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ .templateinfobox {
+     background : #f8f8f9;
+     color : inherit;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+      }
+ .infoBox {
+     background : #b6b7cb;
+     color : #000000;
+      }
+ TD.infoBox, SPAN.infoBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.infoBoxHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bbc3d3;
+     color : #ffffff;
+      }
+
+ .infoBoxContents {
+     background : #f8f8f9;
+     color : #000000;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.infoBoxFooter {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #cccccc;
+    color : #000000;
+}
+
+ TD.contentBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #534f4d;
+     background : #bbc3d3;
+    padding-top : 5px;
+}
+ .infoBoxContentsHeader {
+     background : #bbc3d3;
+    color : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ .infoBoxContentsCenter {
+    color : inherit;
+     background : #f8f8f9;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+     background : #bbc3d3;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+ TD.infoBoxHeadingImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-position : left;
+     background-color : #bbc3d3;
+     color : #000000;
+      }
+ TD.infoBoxFooterImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 1px;
+     font-weight : bold;
+     background-color : #bbc3d3;
+     color : #000000;
+      }
+ .infoBoxNotice {
+     background : #ff8e90;
+     color : #ffffff;
+      }
+ .infoBoxNoticeContents {
+     background : #ffe6e6;
+     color : #ffffff;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.main_table_heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #cccccc;
+     color : #000000;
+      }
+ TD.main_table_heading_inner {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #ffffff;
+     color : #000000;
+      }
+ TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TABLE.productListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .productListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #b6b7cb;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ .productlisting-headingPrice {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     background : #cccccc;
+     color : #9a9a9a;
+     font-weight : bold;
+      }
+ TD.productListing-data {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ A.pageResults {
+     color : #0000ff;
+     background : inherit;
+      }
+ a:hover.pageResults {
+     color : #0000ff;
+     background : #ffff33;
+      }
+ TD.pageHeading, DIV.pageHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     font-weight : bold;
+     color : #9a9a9a;
+     background : inherit;
+      }
+ TR.subBar {
+     background : #f4f7fd;
+     color : inherit;
+      }
+ TD.subBar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ TD.main, P.main {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #000000;
+     background : inherit;
+      }
+ TD.smallText, SPAN.smallText, P.smallText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.accountCategory {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 13px;
+     color : #aabbdd;
+     background : inherit;
+      }
+ TD.fieldKey {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.fieldValue {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+      }
+ TD.tableHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.category_desc {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+      }
+ SPAN.newItemInCart {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ CHECKBOX, INPUT, RADIO, SELECT {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ TEXTAREA {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ SPAN.greetUser {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #f0a480;
+     background : inherit;
+     font-weight : bold;
+      }
+ TABLE.formArea {
+     background : #f1f9fe;
+     color : #f4f7fd;
+     border-color : #7b9ebd;
+     border-style : solid;
+     border-width : 1px;
+      }
+ TD.formAreaTitle {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ SPAN.markProductOutOfStock {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #c76170;
+     background : inherit;
+     font-weight : bold;
+      }
+ SPAN.productSpecialPrice {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ SPAN.errorText {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ .moduleRowOver {
+     background-color : #d7e9f7;
+     color : inherit;
+     cursor : pointer;
+      }
+ .moduleRowSelected {
+     background-color : #e9f4fc;
+     color : inherit;
+      }
+ .checkoutBarFrom, .checkoutBarTo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #8c8c8c;
+     background : inherit;
+      }
+ .checkoutBarCurrent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ .messageBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .messageStackError, .messageStackWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #ffb3b5;
+     color : inherit;
+      }
+ .messageStackSuccess {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #99ff00;
+     color : inherit;
+      }
+ .inputRequirement {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ TABLE.linkListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .linkListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #b6b7cb;
+     color : #ffffff;
+     text-align : center;
+      }
+ TD.linkListing-data {
+     border-right : 1px solid #b6b7cb;
+     border-bottom : 1px solid #b6b7cb;
+     padding : 4px;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TR.linkListing-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.linkListing-even {
+     background : #f5f5f5;
+     color : inherit;
+      }
+ .content {
+     color : #000000;
+     background : inherit;
+     font-size : 10px;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #bdcaf0;
+     background : inherit;
+      }
+ TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+     background-image : url('images/button_blank_left.gif');
+      }
+ TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+     background-image : url('images/button_blank_right.gif');
+      }
+ TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+     background-image : url('images/button_blank_middle.gif');
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-color : inherit;
+     color : #000000;
+      }
+ A.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     color : #000000;
+     background : inherit;
+      }
+ a:hover.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+     color : #00ff00;
+      }
+ TD.cookieUsage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #000000;
+     color : #ffffff;
+      }
+ .attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TR.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TD.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #c0c0c0;
+      }
+ .storyboxtitle {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:link {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:active {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:visited {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:hover {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ffffff;
+     font-size : 10px;
+     font-weight : bold;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .yearHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 14px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+      }
+ .calendarMonth {
+     background-color : #cccccc;
+     color : inherit;
+     cursor : default;
+     width : 100%;
+      }
+ .calendarHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     height : 22px;
+      }
+ .calendarToday {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffcf00;
+     padding-left : 3px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendarWeekend {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #caeeff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffffff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     height : 22px;
+     width : 18px;
+      }
+ .event {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     border : 1px solid #e6e6e6;
+      }
+ .empty {
+     background-color : #f0faff;
+     color : inherit;
+     line-height : 14px;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ h4.infoTitle {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 0.2em;
+      }
+ p.infoBlurb {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 2em;
+      }
+ TD.productPriceInListing {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #d2e9fb;
+     color : inherit;
+      }
+ TD.productPriceInBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #eeeeee;
+     color : inherit;
+      }
+ TD.productPriceInProdInfo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ccffcc;
+     color : inherit;
+      }
+ #navMenu {
+     clear : both;
+     height : 0.01%;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu ul {
+     float : left;
+     width : 150px;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu li {
+     position : relative;
+     float : left;
+     line-height : 24px;
+     margin-bottom : -1px;
+     width : 150px;
+      }
+ #navMenu li ul {
+     position : absolute;
+     left : -999em;
+     margin-left : 150px;
+     margin-top : -26px;
+      }
+ #navMenu li ul ul {
+     left : -999em;
+      }
+ #navMenu li a {
+     width : 150px;
+     display : block;
+     color : #334;
+     font-weight : bold;
+     text-decoration : none;
+     background : #ffffff;
+     border : 1px solid #cce;
+     padding-left : 2px;
+      }
+ #navMenu li a:hover {
+     color : #000000;
+     background : #aac;
+      }
+ #navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+     left : -999em;
+      }
+ #navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+     left : auto;
+      }

Added: trunk/direct.openmoko.com/templates/Original1/Original1.sql
===================================================================
--- trunk/direct.openmoko.com/templates/Original1/Original1.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original1/Original1.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#FFFFFF');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#FFFFFF');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "Original.gif", template_cellpadding_main ="3", template_cellpadding_sub= "8", template_cellpadding_left= "3", template_cellpadding_right= "3", site_width= "100%", include_column_left= "yes", include_column_right= "yes", box_width_left= "130", box_width_right= "130", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no", show_header_link_buttons="yes", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width= "1", side_box_right_width= "1"  WHERE template_id="#tID#"
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original1/footer.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original1/footer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original1/footer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+<?php
+/*
+  $Id: footer.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+  require(DIR_WS_INCLUDES . FILENAME_COUNTER);
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="1">
+  <tr class="footer">
+    <td class="footer">&nbsp;&nbsp;<?php echo strftime(DATE_FORMAT_LONG); ?>&nbsp;&nbsp;</td>
+    <td align="right" class="footer">&nbsp;&nbsp;<?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>&nbsp;&nbsp;</td>
+  </tr>
+</table>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center" class="smallText">
+<?php
+
+ if (!(getenv('HTTPS')=='on')){
+//google banner ad
+if ($banner = tep_banner_exists('dynamic', 'googlefoot')) {
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
+  </tr>
+</table>
+<?php
+  }
+  }
+?>
+
+<?php
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default osCommerce-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+
+  echo FOOTER_TEXT_BODY
+?>
+
+    </td>
+  </tr>
+</table>
+<?php
+}
+
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+if (SITE_WIDTH!='100%') {
+?>
+         </td></tr></table>
+       </td></tr>
+     </table>
+   </td>
+  </tr>
+</table>
+<?php
+}
+// EOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+?>
+<!-- footer_eof //-->

Added: trunk/direct.openmoko.com/templates/Original1/header.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original1/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original1/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: header.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+
+if (SITE_WIDTH!='100%') {
+?>
+    <table width="100%" cellpadding="10" cellspacing="0" border="0">
+      <tr><td>
+        <table BORDERCOLORLIGHT="2F4F2F" CELLSPACING="2" CELLPADDING="4" BORDER="2" width="<?php echo SITE_WIDTH;?>" align="center" BGCOLOR="FFFFFF">
+          <tr><td BORDERCOLOR="FF0000">
+            <table border="0" width="100%"><tr><td>
+<?php
+}
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr class="header">
+    <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_TEMPLATE_IMAGES . 'logo.gif', 'Store Logo') . '</a>'; ?></td>
+    <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>&nbsp;&nbsp;</td>
+  </tr>
+</table>
+<table border="0" width="100%" cellspacing="0" cellpadding="1">
+  <tr class="headerNavigation">
+    <td class="headerNavigation">&nbsp;&nbsp;<?php echo $breadcrumb->trail(' &raquo; '); ?></td>
+    <td align="right" class="headerNavigation">
+
+    <?php
+      if (!tep_session_is_registered('noaccount')){// DDB - PWA - 040622 - no display of logoff for PWA customers
+         if (!tep_session_is_registered('customer_id')) {
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_TITLE_LOGIN . '</a>&nbsp;|&nbsp;';
+          } else {
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_ACCOUNT, "", "SSL") . '">' . HEADER_TITLE_MY_ACCOUNT . ' </a> &nbsp;|&nbsp;';
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_TITLE_LOGOFF . ' </a> &nbsp;|&nbsp;';
+          }
+         }
+
+     if (tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers
+       {
+     if (!tep_session_is_registered('customer_id')) {
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_TITLE_LOGIN . ' </a> &nbsp;|&nbsp;';
+   }else{
+        echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_TITLE_LOGOFF . ' </a> &nbsp;|&nbsp;';
+      }
+      }
+       ?>
+
+
+    <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>
+      &nbsp;|&nbsp; <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?>&nbsp;|&nbsp;</a></td>
+
+  </tr>
+</table>
+
+<?php
+}
+?>
+<!-- header_eof //-->

Added: trunk/direct.openmoko.com/templates/Original1/images/Original.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/Original.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/admin_logo_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/admin_logo_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/espanol/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/french/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_download.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_download.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/buttons/german/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/arrow_main.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/arrow_main.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/background_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/background_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/background_box.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/background_box.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/background_main.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/background_main.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/backgroundfb.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/backgroundfb.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/bm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/bm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/bottom_center.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/bottom_center.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/box_bg_l.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/box_bg_l.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/box_bg_r.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/box_bg_r.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_left_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_left_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/corner_right_left_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/no_arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/no_arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/q1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/q1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/q2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/q2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/r1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/r1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/infobox/r2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/infobox/r2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/logo-banner_02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/logo-banner_02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/logo-banner_03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/logo-banner_03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/logo-banner_bg.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/logo-banner_bg.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/original_background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/original_background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/images/oscommerce.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Original1/images/oscommerce.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Original1/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original1/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original1/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body>
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+<!-- warning_eof //-->
+
+<!-- header //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_HEADER); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="3" cellpadding="<?php echo CELLPADDING_MAIN; ?>">
+  <tr>
+<?php
+if (DISPLAY_COLUMN_LEFT == 'yes')  {
+// WebMakers.com Added: Down for Maintenance
+// Hide column_left.php if not to show
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+<!-- content //-->
+    <td width="100%" valign="top">
+<?php
+if (isset($content_template) && file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/'.  basename($content_template))) {
+    require(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/' . $content . '.tpl.php');
+  } else if (file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/' . $content . '.tpl.php')) {
+    require(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/'. $content . '.tpl.php');
+  }else if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template)) ){
+    require(DIR_WS_CONTENT . basename($content_template));
+  } else {
+    require(DIR_WS_CONTENT . $content . '.tpl.php');
+  }
+?>
+    </td>
+<!-- content_eof //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide column_right.php if not to show
+
+
+if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_FOOTER); ?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Original1/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/Original1/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original1/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,727 @@
+/*
+  $Id: stylesheet.css,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  .cat_description {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #800000;
+     background : inherit;
+     font-weight : bold;
+      }
+ .boxText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .centerTable {
+     background-image : url('images/bg_cat4.gif');
+     background-repeat : repeat-x;
+     background : #fbfcfd;
+     color : inherit;
+      }
+ .errorBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : inherit;
+     background : #ffb3b5;
+     font-weight : bold;
+      }
+ .stockWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #cc0033;
+     background : inherit;
+      }
+ .productsNotifications {
+     background : #f2fff7;
+     color : inherit;
+      }
+ .orderEdit {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #70d250;
+     background : inherit;
+     text-decoration : underline;
+      }
+ .navBlue {
+     color : #ff0000;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ .subnavBlue {
+     color : #9966ff;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ BODY {
+     background : #ffffff;
+     color : #000000;
+     margin : 0;
+      }
+ A {
+     color : #000000;
+     background : inherit;
+     text-decoration : none;
+      }
+ A:hover {
+     color : #aabbdd;
+     background : inherit;
+     text-decoration : underline;
+      }
+ FORM {
+     display : inline;
+      }
+ TR.header {
+     background : #ffffff;
+     color : inherit;
+      }
+ TR.headerNavigation {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.headerNavigation {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ A.headerNavigation {
+     color : #ffffff;
+     background : #bbc3d3;
+      }
+ a:hover.headerNavigation {
+     color : #ffffff;
+     background : #bbc3d3;
+      }
+ TR.headerError {
+     background : #ff0000;
+     color : #bbc3d3;
+      }
+ TD.headerError {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ff0000;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ TR.headerInfo {
+     background : #00ff00;
+     color : #bbc3d3;
+      }
+ TD.headerInfo {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #00ff00;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ TR.footer {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.footer {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ .templateinfobox {
+     background : #f8f8f9;
+     color : inherit;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+      }
+ .infoBox {
+     background : #b6b7cb;
+     color : #000000;
+      }
+ TD.infoBox, SPAN.infoBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.infoBoxHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bbc3d3;
+     color : #ffffff;
+      }
+
+ .infoBoxContents {
+     background : #f8f8f9;
+     color : #000000;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.infoBoxFooter {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    background-color : #cccccc;
+    color : #000000;
+}
+
+ TD.contentBoxHeading {
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+    color : #534f4d;
+     background : #bbc3d3;
+    padding-top : 5px;
+}
+ .infoBoxContentsHeader {
+     background : #bbc3d3;
+    color : #ffffff;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ .infoBoxContentsCenter {
+    color : inherit;
+     background : #f8f8f9;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+     background : #bbc3d3;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+ TD.infoBoxHeadingImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-position : left;
+     background-color : #bbc3d3;
+     color : #000000;
+      }
+ TD.infoBoxFooterImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 1px;
+     font-weight : bold;
+     background-color : #bbc3d3;
+     color : #000000;
+      }
+ .infoBoxNotice {
+     background : #ff8e90;
+     color : #ffffff;
+      }
+ .infoBoxNoticeContents {
+     background : #ffe6e6;
+     color : #ffffff;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.main_table_heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #cccccc;
+     color : #000000;
+      }
+ TD.main_table_heading_inner {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #ffffff;
+     color : #000000;
+      }
+ TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TABLE.productListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .productListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #b6b7cb;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ .productlisting-headingPrice {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     background : #cccccc;
+     color : #9a9a9a;
+     font-weight : bold;
+      }
+ TD.productListing-data {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ A.pageResults {
+     color : #0000ff;
+     background : inherit;
+      }
+ a:hover.pageResults {
+     color : #0000ff;
+     background : #ffff33;
+      }
+ TD.pageHeading, DIV.pageHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     font-weight : bold;
+     color : #9a9a9a;
+     background : inherit;
+      }
+ TR.subBar {
+     background : #f4f7fd;
+     color : inherit;
+      }
+ TD.subBar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ TD.main, P.main {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #000000;
+     background : inherit;
+      }
+ TD.smallText, SPAN.smallText, P.smallText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.accountCategory {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 13px;
+     color : #aabbdd;
+     background : inherit;
+      }
+ TD.fieldKey {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.fieldValue {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+      }
+ TD.tableHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.category_desc {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+      }
+ SPAN.newItemInCart {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ CHECKBOX, INPUT, RADIO, SELECT {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ TEXTAREA {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ SPAN.greetUser {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #f0a480;
+     background : inherit;
+     font-weight : bold;
+      }
+ TABLE.formArea {
+     background : #f1f9fe;
+     color : #f4f7fd;
+     border-color : #7b9ebd;
+     border-style : solid;
+     border-width : 1px;
+      }
+ TD.formAreaTitle {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ SPAN.markProductOutOfStock {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #c76170;
+     background : inherit;
+     font-weight : bold;
+      }
+ SPAN.productSpecialPrice {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ SPAN.errorText {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ .moduleRowOver {
+     background-color : #d7e9f7;
+     color : inherit;
+     cursor : pointer;
+      }
+ .moduleRowSelected {
+     background-color : #e9f4fc;
+     color : inherit;
+      }
+ .checkoutBarFrom, .checkoutBarTo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #8c8c8c;
+     background : inherit;
+      }
+ .checkoutBarCurrent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ .messageBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .messageStackError, .messageStackWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #ffb3b5;
+     color : inherit;
+      }
+ .messageStackSuccess {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #99ff00;
+     color : inherit;
+      }
+ .inputRequirement {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ TABLE.linkListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .linkListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #b6b7cb;
+     color : #ffffff;
+     text-align : center;
+      }
+ TD.linkListing-data {
+     border-right : 1px solid #b6b7cb;
+     border-bottom : 1px solid #b6b7cb;
+     padding : 4px;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TR.linkListing-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.linkListing-even {
+     background : #f5f5f5;
+     color : inherit;
+      }
+ .content {
+     color : #000000;
+     background : inherit;
+     font-size : 10px;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #bdcaf0;
+     background : inherit;
+      }
+ TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+     background-image : url('images/button_blank_left.gif');
+      }
+ TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+     background-image : url('images/button_blank_right.gif');
+      }
+ TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+     background-image : url('images/button_blank_middle.gif');
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-color : inherit;
+     color : #000000;
+      }
+ A.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     color : #000000;
+     background : inherit;
+      }
+ a:hover.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+     color : #00ff00;
+      }
+ TD.cookieUsage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #000000;
+     color : #ffffff;
+      }
+ .attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TR.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TD.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #c0c0c0;
+      }
+ .storyboxtitle {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:link {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:active {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:visited {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:hover {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ffffff;
+     font-size : 10px;
+     font-weight : bold;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .yearHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 14px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+      }
+ .calendarMonth {
+     background-color : #cccccc;
+     color : inherit;
+     cursor : default;
+     width : 100%;
+      }
+ .calendarHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     height : 22px;
+      }
+ .calendarToday {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffcf00;
+     padding-left : 3px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendarWeekend {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #caeeff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffffff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     height : 22px;
+     width : 18px;
+      }
+ .event {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     border : 1px solid #e6e6e6;
+      }
+ .empty {
+     background-color : #f0faff;
+     color : inherit;
+     line-height : 14px;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ h4.infoTitle {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 0.2em;
+      }
+ p.infoBlurb {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 2em;
+      }
+ TD.productPriceInListing {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #d2e9fb;
+     color : inherit;
+      }
+ TD.productPriceInBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #eeeeee;
+     color : inherit;
+      }
+ TD.productPriceInProdInfo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ccffcc;
+     color : inherit;
+      }
+ #navMenu {
+     clear : both;
+     height : 0.01%;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu ul {
+     float : left;
+     width : 150px;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu li {
+     position : relative;
+     float : left;
+     line-height : 24px;
+     margin-bottom : -1px;
+     width : 150px;
+      }
+ #navMenu li ul {
+     position : absolute;
+     left : -999em;
+     margin-left : 150px;
+     margin-top : -26px;
+      }
+ #navMenu li ul ul {
+     left : -999em;
+      }
+ #navMenu li a {
+     width : 150px;
+     display : block;
+     color : #334;
+     font-weight : bold;
+     text-decoration : none;
+     background : #ffffff;
+     border : 1px solid #cce;
+     padding-left : 2px;
+      }
+ #navMenu li a:hover {
+     color : #000000;
+     background : #aac;
+      }
+ #navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+     left : -999em;
+      }
+ #navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+     left : auto;
+      }

Added: trunk/direct.openmoko.com/templates/Original1/template.php
===================================================================
--- trunk/direct.openmoko.com/templates/Original1/template.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Original1/template.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+/*
+  $Id: original.php,
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 CRE Loaded
+
+  Released under the GNU General Public License
+*/
+define('TEMPLATE_NAME', 'Original1');
+define('TEMPLATE_VERSION', '1.0');
+define('TEMPLATE_SYSTEM', 'ATS');
+define('TEMPLATE_AUTHOR', ' ');
+
+//used to get boxes from default
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_CATALOG . 'templates/default/boxes');
+define('DIR_FS_TEMPLATE_MAINPAGES', DIR_FS_CATALOG . 'templates/default/mainpage_modules/');
+
+define('DIR_WS_TEMPLATE_IMAGES', 'templates/Original1/images/');
+//which files to use
+define('TEMPLATE_BOX_TPL', DIR_WS_TEMPLATES . '/default/boxes.tpl.php');
+define('TEMPLATE_HTML_OUT', DIR_WS_TEMPLATES  . '/default/extra_html_output.php' );
+
+
+//variables moved from box.tpl.php
+define('TEMPLATE_TABLE_BORDER', '0');
+define('TEMPLATE_TABLE_WIDTH', '100%');
+define('TEMPLATE_TABLE_CELLSPACING', '0');
+define('TEMPLATE_TABLE_CELLPADDIING', '0');
+define('TEMPLATE_TABLE_PARAMETERS', '');
+define('TEMPLATE_TABLE_ROW_PARAMETERS', '');
+define('TEMPLATE_TABLE_DATA_PARAMETERS', '');
+define('TEMPLATE_TABLE_CONTENT_CELLPADING', '6');
+define('TEMPLATE_TABLE_CENTER_CONTENT_CELLPADING', '4');
+
+//for sidebox footer display these images 
+define('TEMPLATE_BOX_IMAGE_FOOTER_LEFT', 'false');
+define('TEMPLATE_BOX_IMAGE_FOOTER_RIGHT', 'false');
+define('TEMPLATE_BOX_IMAGE_FOOTER_RIGHT_ARROW', 'false');
+define('TEMPLATE_BOX_IMAGE_FOOTER_LEFTRIGHT', 'true');
+//for side header display these images
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFT', 'false');
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_RIGHT', 'false');
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFTRIGHT', 'true');
+
+//for content header
+define('TEMPLATE_IMAGE_BORDER_TOP_LEFT', 'false');
+define('TEMPLATE_IMAGE_BORDER_TOP_RIGHT', 'false');
+//include footer
+define('TEMPLATE_INCLUDE_FOOTER', 'true');
+//images to use or html
+
+define('TEMPLATE_BOX_IMAGE_TOP_TRANS', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/pixel_trans.gif');
+
+//box header images
+define('TEMPLATE_BOX_IMAGE_TOP_LEFT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_RIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_LEFTRIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_RIGHTARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_NOARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/no_arrow_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_BACKGROUND', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif');
+
+//box footer images
+define('TEMPLATE_BOX_IMAGE_FOOT_LEFT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_RIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/backgroundfb.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_NOARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '');
+
+// box middles images
+define('TEMPLATE_BOX_MIDDLE_LEFT_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif');
+define('TEMPLATE_BOX_MIDDLE_MIDDLE_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background_box.gif');
+define('TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/Pixame_v1.sql
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/Pixame_v1.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/Pixame_v1.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#000000');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "Pixame_v1.gif", template_cellpadding_main ="3", template_cellpadding_sub= "8", template_cellpadding_left= "5", template_cellpadding_right= "5", site_width= "776", include_column_left= "yes", include_column_right= "yes", box_width_left= "155", box_width_right= "155", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no", show_header_link_buttons="no", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width="5", side_box_right_width="5" WHERE template_id="#tID#"
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/affiliate.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: affiliate.php,v 1.1.1.1 2004/03/04 23:42:13 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 - 2003 osCommerce
+   
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3423 $
+
+  Released under the GNU General Public License
+*/
+?>          
+<!-- affiliate_system //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_AFFILIATE . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (tep_session_is_registered('affiliate_id')) {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . BOX_AFFILIATE_SUMMARY . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, '', 'SSL'). '">' . BOX_AFFILIATE_NEWS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL'). '">' . BOX_AFFILIATE_ACCOUNT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'). '">' . BOX_AFFILIATE_PAYMENT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'). '">' . BOX_AFFILIATE_CLICKRATE . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'). '">' . BOX_AFFILIATE_SALES . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS). '">' . BOX_AFFILIATE_BANNERS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_FAQ). '">' . BOX_AFFILIATE_FAQ . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_LOGOUT). '">' . BOX_AFFILIATE_LOGOUT . '</a>');
+  } else {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_INFO). '">' . BOX_AFFILIATE_INFO . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . BOX_AFFILIATE_LOGIN . '</a>');
+  }
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- affiliate_system_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/articles.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,226 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_topic($counter) {
+    global $tree, $topics_string, $tPath_array;
+
+    for ($i=0; $i<$tree[$counter]['level']; $i++) {
+      $topics_string .= "&nbsp;&nbsp;";
+    }
+
+    $topics_string .= '<a href="';
+
+    if ($tree[$counter]['parent'] == 0) {
+      $tPath_new = 'tPath=' . $counter;
+    } else {
+      $tPath_new = 'tPath=' . $tree[$counter]['path'];
+    }
+
+    $topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '<b>';
+    }
+
+// display topic name
+    $topics_string .= $tree[$counter]['name'];
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '</b>';
+    }
+
+    if (tep_has_topic_subtopics($counter)) {
+      $topics_string .= ' -&gt;';
+    }
+
+    $topics_string .= '</a>';
+
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_in_topic = tep_count_articles_in_topic($counter);
+      if ($articles_in_topic > 0) {
+        $topics_string .= '&nbsp;(' . $articles_in_topic . ')';
+      }
+    }
+
+    $topics_string .= '<br>';
+
+    if ($tree[$counter]['next_id'] != false) {
+      tep_show_topic($tree[$counter]['next_id']);
+    }
+  }
+?>
+<!-- topics //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_ARTICLES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $topics_string = '';
+  $tree = array();
+
+  $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '0' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+  while ($topics = tep_db_fetch_array($topics_query))  {
+    $tree[$topics['topics_id']] = array('name' => $topics['topics_name'],
+                                        'parent' => $topics['parent_id'],
+                                        'level' => 0,
+                                        'path' => $topics['topics_id'],
+                                        'next_id' => false);
+
+    if (isset($parent_id)) {
+      $tree[$parent_id]['next_id'] = $topics['topics_id'];
+    }
+
+    $parent_id = $topics['topics_id'];
+
+    if (!isset($first_topic_element)) {
+      $first_topic_element = $topics['topics_id'];
+    }
+  }
+
+  //------------------------
+  if (tep_not_null($tPath)) {
+    $new_path = '';
+    reset($tPath_array);
+    while (list($key, $value) = each($tPath_array)) {
+      unset($parent_id);
+      unset($first_id);
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$value . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+      if (tep_db_num_rows($topics_query)) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($topics_query)) {
+          $tree[$row['topics_id']] = array('name' => $row['topics_name'],
+                                           'parent' => $row['parent_id'],
+                                           'level' => $key+1,
+                                           'path' => $new_path . '_' . $row['topics_id'],
+                                           'next_id' => false);
+
+          if (isset($parent_id)) {
+            $tree[$parent_id]['next_id'] = $row['topics_id'];
+          }
+
+          $parent_id = $row['topics_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['topics_id'];
+          }
+
+          $last_id = $row['topics_id'];
+        }
+        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
+        $tree[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_topic($first_topic_element);
+
+  $info_box_contents = array();
+  $new_articles_string = '';
+  $all_articles_string = '';
+
+  if (DISPLAY_NEW_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_new_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and(a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = ad.articles_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a2t.topics_id = td.topics_id 
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'
+                                            and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY)");
+      $articles_new_count = ' (' . tep_db_num_rows($articles_new_query) . ')';
+    } else {
+      $articles_new_count = '';
+    }
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string = '<b>';
+    }
+
+    $new_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES_NEW, '', 'NONSSL') . '">' . BOX_NEW_ARTICLES . '</a>';
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string .= '</b>';
+    }
+
+    $new_articles_string .= $articles_new_count . '<br>';
+
+  }
+
+  if (DISPLAY_ALL_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_all_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a.articles_id = ad.articles_id
+                                            and a2t.topics_id = td.topics_id
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'");
+      $articles_all_count = ' (' . tep_db_num_rows($articles_all_query) . ')';
+    } else {
+      $articles_all_count = '';
+    }
+
+    if ($topic_depth == 'top') {
+      $all_articles_string = '<b>';
+    }
+
+    $all_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES, '', 'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a>';
+
+    if ($topic_depth == 'top') {
+      $all_articles_string .= '</b>';
+    }
+
+    $all_articles_string .= $articles_all_count . '<br>';
+
+  }
+
+  $info_box_contents[] = array('text' => $new_articles_string . $all_articles_string . $topics_string);
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- topics_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/asearch.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/asearch.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/asearch.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php
+/*
+  $Id: asearch.php
+  searches articles using article_manager
+  by AlDaffodil (aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- article search //-->
+          <tr>
+            <td>
+<?php
+ //if (ALLOW_QUICK_SEARCH_DESCRIPTION == 'true') {
+  //  $param = '<input type="hidden" name="search_in_description" value="1">';
+ //  } else {
+      $param = '';
+// }
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_ASEARCH . '</font>');
+     new infoBoxHeading($info_box_contents, false, false);
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find_article" method="get" action="' . tep_href_link(FILENAME_ARTICLE_SEARCH, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . $param . '<input type="text" name="akeywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["akeywords"])) . '">' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><input type="checkbox" name="description">' . BOX_ASEARCH_TEXT . '<br>');
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- article_search //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/authors.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name");
+  if ($number_of_author_rows = tep_db_num_rows($authors_query)) {
+?>
+<!-- authors //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_AUTHORS . '</font>');
+
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_author_rows <= MAX_DISPLAY_AUTHORS_IN_A_LIST) {
+// Display a list
+      $authors_list = '';
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        if (isset($HTTP_GET_VARS['authors_id']) && ($HTTP_GET_VARS['authors_id'] == $authors['authors_id'])) $authors_name = '<b>' . $authors_name .'</b>';
+        $authors_list .= '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $authors['authors_id']) . '">' . $authors_name . '</a><br>';
+      }
+
+      $authors_list = substr($authors_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $authors_list);
+    } else {
+// Display a drop-down
+      $authors_array = array();
+      if (MAX_AUTHORS_LIST < 2) {
+        $authors_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        $authors_array[] = array('id' => $authors['authors_id'],
+                                       'text' => $authors_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('authors', tep_href_link(FILENAME_ARTICLES, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('authors_id', $authors_array, (isset($HTTP_GET_VARS['authors_id']) ? $HTTP_GET_VARS['authors_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_AUTHORS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- authors_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/best_sellers.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/best_sellers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/best_sellers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: best_sellers.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($current_category_id) && ($current_category_id > 0)) {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  } else {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  }
+
+  if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
+?>
+<!-- best_sellers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_BESTSELLERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $rows = 0;
+    $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
+      $rows++;
+      $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
+    }
+    $bestsellers_list .= '</table>';
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => $bestsellers_list);
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- best_sellers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/boxad.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/boxad.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/boxad.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,64 @@
+<?php
+/*
+  $Id: boxad.php, v 1.1 2002/03/21 by aubrey at mycon.co.za
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+*/
+?>
+<!-- banner-ad-in-a-box //-->
+<?php
+  if ($banner = tep_banner_exists('dynamic', BOX_AD_BANNER_TYPE)) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+    $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                            'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+<!-- banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/calendar.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+$ID
+  ~ events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it 
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3423 $
+
+*/
+
+
+?>
+<!-- events_calendar //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CALENDER . '</font>');
+    new infoBoxHeading($info_box_contents, false, false,tep_href_link(FILENAME_EVENTS_CALENDER));
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'center',
+                                'text' => '<iframe name="calendar" id="calendar" align="center" marginwidth="0" marginheight="0" ' .
+                                          'src='  . FILENAME_EVENTS_CALENDAR_CONTENT . '?_month=' . $_month .'&amp;_year='. $_year .' frameborder=0 height=220 width=162 scrolling=no> ' .IFRAME_ERROR.'</iframe> ');
+   
+ 
+    new infoBox($info_box_contents);
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left', 'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+      new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- events_calendar //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/card1.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/card1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/card1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1799 $
+
+*/
+?>
+<!-- Card Info Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CARD1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+//                               'text'  => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .
+//elari chanegd to provide a link to your payment acount
+                               'text'  => tep_image(DIR_WS_IMAGES . 'cards/logo-xclick_paypal.gif' , BOX_INFORMATION_CARD).
+                               '<br>' . tep_image(DIR_WS_IMAGES . 'cards/cards2.gif', BOX_INFORMATION_CARD) . '<br>'
+                               );
+
+new infoBox($info_box_contents);
+$info_box_contents = array();
+$info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+new infoboxFooter($info_box_contents, true, true);
+
+
+?>
+</td></tr>
+<!-- card_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,169 @@
+<?php
+/*
+  $Id: categories.php,v 1.1.1.1 2004/03/04 23:42:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1799 $
+
+  Released under the GNU General Public License
+*/
+$count=0;
+
+ function tep_show_category($counter,$count) {
+    global $foo, $categories_string, $id;
+
+$count++;
+    if ($count != 1) {
+$image=2;
+$HEIGHT = 20;
+     }else{
+$image=1;
+$HEIGHT = 21;
+}
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+
+    $categories_string .= '<tr><td>';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+    
+    $categories_string .= '<a class="navBlue" href="';
+
+}else{
+    $categories_string .= '&nbsp;';
+if ($foo[$counter]['parent'] != 0) {
+      $class="subnavBlue";
+   } else {
+  $class="navGrey";
+}
+
+if ($foo[$counter]['parent'] != 0) {
+      $categories_string .= '&nbsp;';
+   } else {
+         ;
+}
+    $categories_string .= '<a class="' . $class . '" href="';
+
+}
+
+    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string .= '">';
+// display category name
+      $categories_string .= $foo[$counter]['name'];
+    $categories_string .= '</a>';
+    $categories_string .= '</td></tr>' ;
+
+
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category($foo[$counter]['next_id'],$count);
+    }
+
+  }
+?>
+<!-- categories //-->
+                  <tr>
+                    <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => '<font color="' . $font_color . '">' .BOX_HEADING_CATEGORIES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+$categories_string = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      $new_path .= $value;
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      while ($row = tep_db_fetch_array($categories_query)) {
+        $foo[$row['categories_id']] = array(
+                                            'name' => $row['categories_name'],
+                                            'parent' => $row['parent_id'],
+                                            'level' => $key+1,
+                                            'path' => $new_path . '_' . $row['categories_id'],
+                                            'next_id' => false
+                                           );
+
+        if (isset($prev_id)) {
+          $foo[$prev_id]['next_id'] = $row['categories_id'];
+        }
+
+        $prev_id = $row['categories_id'];
+
+        if (!isset($first_id)) {
+          $first_id = $row['categories_id'];
+        }
+
+        $last_id = $row['categories_id'];
+      }
+      if ($category_check != 0) {
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+      }
+
+      $new_path .= '_';
+    }
+  }
+
+  tep_show_category($first_element,$count);
+
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text'  => $categories_string
+                              );
+new $infobox_template($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+                    </td>
+                  </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories1.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- categories //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(),
+                               'align' => 'left',
+                               'text'  => tep_draw_pull_down_menu('cPath', tep_get_categories(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"')
+                              );
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories2.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,177 @@
+<?php
+/*
+  $Id: categories2.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+  Released under the GNU General Public License
+*/
+
+//###############################################
+if ( (USE_CACHE == 'true') && !defined('SID')) {
+    echo tep_cache_categories_box();
+  } else {
+//###############################################
+
+
+  function tep_show_category2($counter) {
+    global $foo, $categories_string2, $id;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      $categories_string2 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string2 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string2 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string2 .= '">';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '<b>';
+    }
+
+// display category name
+    $categories_string2 .= $foo[$counter]['name'];
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '</b>';
+    }
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string2 .= '-&gt;';
+    }
+
+    $categories_string2 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string2 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string2 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category2($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES2 . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+
+  $categories_string2 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_category2($first_element);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string2
+                              );
+  new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!--############################################### //-->
+<?php
+}
+?>
+<!--############################################## //-->
+<!-- categories_eof //-->
+

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories3.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories3.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories3.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,131 @@
+<?php
+/*
+  $Id: categories3.php,v 1.1 2004/04/05
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004osCommerce
+
+  Released under the GNU General Public License
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+*/
+
+// Categories_tree written by Gideon Romm from Symbio Technologies, LLC
+
+function tep_show_category3($cid, $cpath, $COLLAPSABLE) {
+  global $categories_string3, $languages_id, $HTTP_GET_VARS;
+  global $level;
+  $selectedPath = array();
+
+// Get all of the categories on this level
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }
+    $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;
+
+// Add category link to $categories_string3
+    for ($a=1; $a<$level{$categories['categories_id']}; $a++) {
+      $categories_string3 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string3 .= '<a href="';
+
+    $cPath_new = $cpath;
+    if ($level{$categories['parent_id']} > 0) {
+      $cPath_new .= "_";
+    }
+    $cPath_new .= $categories['categories_id'];
+
+    $cPath_new_text = "cPath=" . $cPath_new;
+
+    $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
+    $categories_string3 .= '">';
+
+    if ($HTTP_GET_VARS['cPath']) {
+      $selectedPath = split("_", $HTTP_GET_VARS['cPath']);
+    }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '<b>'; }
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '<u>'; }
+
+    $categories_string3 .= $categories['categories_name'];
+    if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string3 .= ' ->'; }
+
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '</u>'; }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '</b>'; }
+
+    $categories_string3 .= '</a>';
+
+    if (SHOW_COUNTS) {
+      $products_in_category = tep_count_products_in_category($categories['categories_id']);
+      if ($products_in_category > 0) {
+        $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string3 .= '<br>';
+
+
+// If I have subcategories, get them and show them
+    if (tep_has_category_subcategories($categories['categories_id'])) {
+
+      if ($COLLAPSABLE) {
+        if (in_array($categories['categories_id'], $selectedPath)) {
+          tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE);
+        }
+      }
+      else { tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE); }
+
+    }
+
+  }
+
+}
+?>
+
+
+<!-- categories //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES3 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string3 = '';
+
+// tep_show_category3(<top category_id>, <top cpath>, <1=Collapsable tree, 0=static--show all>)
+  tep_show_category3(0,'',0);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string3
+                              );
+  new infoBox($info_box_contents);
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories4.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories4.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories4.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,193 @@
+<?php
+/*
+  $Id: categories4.php,v 1.0
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1799 $
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_category4($counter) {
+    global $foo, $categories_string4, $id, $aa;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      if ($a == $foo[$counter]['level']-1)
+      {
+    $categories_string4 .= "<font color='#ff0000'>|__</font>";
+      } else
+        {
+        $categories_string4 .= "<b><font color='#ff0000'>&nbsp;&nbsp;&nbsp;&nbsp;</font></b>";
+        }
+
+    }
+    if ($foo[$counter]['level'] == 0)
+  {
+    if ($aa == 1)
+    {
+    $categories_string4 .= "<hr>";
+      }
+    else
+    {$aa=1;}
+
+  }
+
+
+    $categories_string4 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string4 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string4 .= '">';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $categories_string4 .= '<b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= "<b><font color='#ff0000'>";
+    }
+
+// display category name
+    $categories_string4 .= $foo[$counter]['name'];
+
+      if ($foo[$counter]['parent'] == 0) {
+       $categories_string4 .= '</b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= '</font></b>';
+    }
+
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string4 .= '<b>-&gt; </b>';
+    }
+
+    $categories_string4 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string4 .= '&nbsp;(' . $products_in_category . ')';
+      }    }
+
+    $categories_string4 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category4($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- categories //-->
+          <tr>
+            <td>
+<?php
+  $aa = 0;
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES4 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $categories_string4 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+   tep_show_category4($first_element);
+
+ //coment out the below line if you do not want to havw an all products list
+    $categories_string4 .= "<hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODS) . '"><b>' . BOX_INFORMATION_ALLPRODS . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODCATS) . '"><b>' . ALL_PRODUCTS_LINK . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODMANF) . '"><b>' . ALL_PRODUCTS_MANF . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br>\n";
+
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                'text'  => $categories_string4
+                               );
+   new infoBox($info_box_contents);
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+
+        </td>
+          </tr>
+<!-- categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories5.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/categories5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,152 @@
+<?php
+/*
+  $Id: all_categories.php,v 1.6 2002/04/22 20:34:00 clescuyer Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Goélette
+  Christian Lescuyer <cl at goelette.net>
+  http://www.goelette.net/
+  http://oscommerce.goelette.net/
+
+  History: 1.1 Creation
+           1.2 Modified query for compatibility with older databases
+           1.3 Query in 1.2 was wrong for older databases
+           1.4 SHOW_COUNTS test corrected
+           1.5 Added COMPACT_CATEGORIES option to display all sub-categories on one line
+           1.6 Removed COMPACT_CATEGORIES option
+               Corrected the cpath generation
+               Bold categories "path" to selected category, an idea from Peter Fürsicht
+           1.7 Cleaned the way in which the categories are displayed - bold for the path,
+               ">" to indicate the current category, removed link to current category,
+               only indent subcategories (top level are flush left)
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1799 $
+
+  Released under the GNU General Public License
+
+*/
+
+// Keep out parts category
+    $excluded_parts_category_id = 28;
+
+
+// Preorder tree traversal
+  function preorder($cid, $level5, $foo5, $cpath) {
+    global $categories_string5, $HTTP_GET_VARS;
+
+    if ($cid != 0) {
+  // 1.7 Get the current path info
+      $category_path = explode('_',$HTTP_GET_VARS['cPath']);
+      $in_path = in_array($cid, $category_path);
+      $this_category = array_pop($category_path);
+
+      for ($i=0; $i<$level5; $i++)
+      // 1.7 only indent subcategories (top level are flush left)
+        if ($i>0) {
+          $categories_string5 .=  '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
+        }
+        // 1.7 indicate the current category
+        if ($this_category == $cid) {
+          $categories_string5 .=  '> ';
+        }
+
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '">';
+        }
+  // 1.6 Are we on the "path" to selected category? If yes, use <b>
+        if ($in_path) {
+          $categories_string5 .=  '<b>';
+        }
+        $categories_string5 .=  $foo5[$cid]['name'];
+        if ($in_path)
+          $categories_string5 .=  '</b>';
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '</a>';
+        }
+    // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+          if (SHOW_COUNTS == 'true') {
+            $products_in_category = tep_count_products_in_category($cid);
+            if ($products_in_category > 0) {
+              $categories_string5 .= '&nbsp;(' . $products_in_category . ')';
+            }
+          }
+        $categories_string5 .= '<br>' ."\n";
+      }
+
+// Traverse category tree
+      foreach ($foo5 as $key => $value) {
+        if ($foo5[$key]['parent'] == $cid) {
+  //        print "$key, $level5, $cid, $cpath<br>";
+          preorder($key, $level5+1, $foo5, ($level5 != 0 ? $cpath . $cid . '_' : ''));
+        }
+      }
+  }
+
+?>
+<!-- all_categories //-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES5);
+  new infoBoxHeading($info_box_contents, false, false);
+
+
+//////////
+// Get categories list
+//////////
+// 1.2 Test for presence of status field for compatibility with older versions
+  $status = tep_db_num_rows(tep_db_query('describe categories status'));
+
+  $query = "select c.categories_id, cd.categories_name, c.parent_id
+            from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
+            where c.categories_id = cd.categories_id";
+
+// 1.3 Can't have 'where' in an if statement!
+  if ($status >0)
+    $query.= " and c.status = '1'";
+  $query.= " and cd.language_id='" . $languages_id ."'
+            order by sort_order, cd.categories_name";
+
+  $categories_query = tep_db_query($query);
+
+// Stuff in an array
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo5[$categories['categories_id']] = array('name' => $categories['categories_name'], 'parent' => $categories['parent_id']);
+  }
+
+// Initiate tree traverse
+  $categories_string5 = '';
+  preorder(0, 0, $foo5, '');
+
+//////////
+// Display box contents
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => $categories_string5);
+ new infoBox($info_box_contents);
+  $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+    new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- all_categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/currencies.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1165 $
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($currencies) && is_object($currencies)) {
+?>
+<!-- currencies //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CURRENCIES . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    reset($currencies->currencies);
+    $currencies_array = array();
+    while (list($key, $value) = each($currencies->currencies)) {
+      $currencies_array[] = array('id' => $key, 'text' => $value['title']);
+    }
+
+    $hidden_get_variables = '';
+    reset($HTTP_GET_VARS);
+    while (list($key, $value) = each($HTTP_GET_VARS)) {
+      if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
+        $hidden_get_variables .= tep_draw_hidden_field($key, $value);
+      }
+    }
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
+                                 'align' => 'center',
+                                 'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());
+
+    new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- currencies_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/customer_gv.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/customer_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/customer_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: customer_gv.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2428 $
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- Tell Customer he has a gift voucher-->
+<?php
+  if ($customer_id) {
+    $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$customer_id."'");
+    if ($gv_result=tep_db_fetch_array($gv_query)) $customer_gv_amount=$gv_result['amount'];
+  }
+if ($customer_gv_amount>0) {
+?>
+          <tr>
+            <td>
+<?php
+  
+ $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_GIFT_VOUCHER . '</font>'
+                               );
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<div align="center">'.GIFT_VOUCHER_ACCOUNT_BALANCE_1.$currencies->format($customer_gv_amount).GIFT_VOUCHER_ACCOUNT_BALANCE_2.'<a href="'.tep_href_link(FILENAME_GV_SEND).'">'.GIFT_VOUCHER_ACCOUNT_BALANCE_3.'</a>'
+                              );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoBoxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- Tell Customer he has a gift voucher_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/donate.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/donate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/donate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+/*
+  $Id: donate.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2428 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- whats_new //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DONATE  . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+$info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
+              <input type="hidden" name="cmd" value="_xclick">
+              <input type="hidden" name="business" value="donations at creloaded.com">
+              <input type="hidden" name="no_note" value="1">
+              <input type="hidden" name="currency_code" value="USD">
+              <input type="hidden" name="tax" value="0">
+              <input type="image" src="images/x-click_butcc_donate.gif" name="submit"  alt="'.DONATE_BUTTON_IMAGE_ALT.'">
+            </form>');
+    new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/downloads.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/downloads.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/downloads.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,132 @@
+<?php
+/*
+  $Id: downloads.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3002 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- downloads //-->
+<?php
+  // modification of the logic to prevent the queries if there is no customer id
+  if ( $customer_id != '' ) {
+  if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+// Get last order id for checkout_success
+    $orders_query_raw = "SELECT orders_id FROM " . TABLE_ORDERS . " WHERE customers_id = '" . $customer_id . "' ORDER BY orders_id DESC LIMIT 1";
+    $orders_query = tep_db_query($orders_query_raw);
+    $orders_values = tep_db_fetch_array($orders_query);
+    $last_order = $orders_values['orders_id'];
+  } else {
+    $last_order = (int)$HTTP_GET_VARS['order_id'];
+  }
+
+// Now get all downloadable products in that order
+  $downloads_query_raw = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays
+                          FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
+                          WHERE customers_id = '" . $customer_id . "'
+                          AND o.orders_id = '" . $last_order . "'
+                          AND op.orders_id = '" . $last_order . "'
+                          AND opd.orders_products_id=op.orders_products_id
+                          AND opd.orders_products_filename<>''";
+  $downloads_query = tep_db_query($downloads_query_raw);
+
+// Don't display if there is no downloadable product
+  if (tep_db_num_rows($downloads_query) > 0) {
+     require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_DOWNLOADBOX);
+          ECHO '<tr><td>' ;
+          $info_box_contents = array();
+          $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DOWNLOADS . '</font>');
+          new infoBoxHeading($info_box_contents, false, false);
+
+           $info_box_contents = array();
+ ?>
+<!-- list of products -->
+<?php
+    while ($downloads_values = tep_db_fetch_array($downloads_query)) {
+?>
+
+<!-- left box -->
+<?php
+// MySQL 3.22 does not have INTERVAL
+      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads_values['date_purchased_day']);
+      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads_values['download_maxdays'], $dt_year);
+        $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
+
+// The link will appear only if:
+// - Download remaining count is > 0, AND
+// - The file is present in the DOWNLOAD directory, AND EITHER
+// - No expiry date is enforced (maxdays == 0), OR
+// - The expiry date is not reached
+      if (($downloads_values['download_count'] > 0) &&
+          (file_exists(DIR_FS_DOWNLOAD . $downloads_values['orders_products_filename'])) &&
+          (($downloads_values['download_maxdays'] == 0) ||
+           ($download_timestamp > time()))) {
+
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_FILE . '<br><br><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads_values['orders_products_download_id']) . '">' . $downloads_values['products_name'] . '</a>'
+                                          );
+ new infoBox($info_box_contents);
+      } else {
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => $downloads_values['products_name']
+                                          );
+ new infoBox($info_box_contents);
+
+      }
+?>
+<!-- right box -->
+<?php
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_DATE . '<br>' .  tep_date_long($download_expiry)
+                                          );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => $downloads_values['download_count'] . '  ' .  TEXT_HEADING_DOWNLOAD_COUNT
+                                        );
+  new infoBox($info_box_contents);
+ }
+
+if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => TEXT_FOOTER_DOWNLOAD . '<br><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . TEXT_DOWNLOAD_MY_ACCOUNT . '</a>'
+                                        );
+  new infoBox($info_box_contents);
+
+   }
+
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+   new infoboxFooter($info_box_contents, true, true);
+?>
+     </td>
+   </tr>
+<?php
+  }
+  }
+?>
+<!-- downloads_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/example.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/example.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/example.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1601 $
+
+*/
+?>
+<!-- Example_infobox Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_EXAMPLE . '</font>'
+                 // Change BOX_HEADING_EXAMPLE to your name, which you can find it easily.
+                 //and use the same in Infobox Admin to configure infobox.
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                // add infobox content below.
+                //'text'  => 'Your Content here'
+                'text'  => TEXT_YOUR_CONTENT_HERE
+                               );
+
+new infoBox($info_box_contents);
+
+$info_box_contents = array();
+$info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+new infoboxFooter($info_box_contents, true, true);
+?>
+</td></tr>
+<!-- Example_infobox_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/faq.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: faq.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$faq_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_FAQ_CATEGORIES . " ic, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// faq outside categories
+$faq_query = tep_db_query("select ip.faq_id, ip.question from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '0' and ip.language = '" . (int)$languages_id . "' and ip.visible = '1' order by ip.v_order, ip.question");
+
+if ((tep_db_num_rows($faq_categories_query) > 0) || (tep_db_num_rows($faq_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FAQ . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $faq_string = '';
+  while ($faq_categories = tep_db_fetch_array($faq_categories_query)) {
+    $id_string = 'cID=' . $faq_categories['categories_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($faq = tep_db_fetch_array($faq_query)) {
+    $id_string = 'fID=' . $faq['faq_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq['question'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $faq_string);
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+  $Id: featured.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- featured //-->
+<?php
+  if ($random_product = tep_random_select("select featured_id from  " . TABLE_FEATURED . " where status = '1' order by featured_date_added DESC limit " . MAX_RANDOM_SELECT_SPECIALS)) {
+
+
+//          $random_product_query21 = tep_db_query("select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s, " . TABLE_FEATURED . " f where f.featured_id ='" .  $random_product['featured_id'] . "' and f.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and m.manufacturers_id = p.manufacturers_id and p.products_id = s.products_id and p.products_status = '1'");
+//   $random_product21 = tep_db_query("select f.products_id, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s, " . TABLE_FEATURED . " f where f.featured_id ='" .  $random_product['featured_id'] . "' and f.products_id = p.products_id and f.status = '1' and p.products_status = '1' ");
+          $random_product_query21 = tep_db_query("select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_FEATURED . " f where f.featured_id ='" .  $random_product['featured_id'] . "' and f.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1'");
+
+while ($random_product21 = tep_db_fetch_array($random_product_query21)){
+$specials_new_products_price1 = tep_get_products_special_price($random_product21['products_id']);
+?>
+          <tr>
+            <td>
+<?php
+
+if ($specials_new_products_price1) {
+      $whats_new_price =  '<s>' . $currencies->display_price($random_product21['products_price'], tep_get_tax_rate($random_product21['products_tax_class_id'])) . '</s><br>';
+      $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($specials_new_products_price1, tep_get_tax_rate($random_product21['products_tax_class_id'])) . '</span>';
+    } else {
+      $whats_new_price =  $currencies->display_price($random_product21['products_price'], tep_get_tax_rate($random_product21['products_tax_class_id']));
+    }
+
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FEATURED . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents,  false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+            'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product21['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product21['products_image'], $random_product21['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product21['products_id'], 'NONSSL') . '">' . $random_product21['products_name'] . '</a><br>' . $whats_new_price
+                                );
+
+
+
+   new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<?php
+  }
+ }
+?>
+<!-- featured_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/googlead.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/googlead.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/googlead.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: googlead.php, v 1.1 2004/05/30 Tom O'Neill (zip1)
+
+
+  Released under the GNU General Public License
+ based on banner in a box by aubrey at mycon.co.za
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1799 $
+
+
+*/
+?>
+<!-- google-banner-ad-in-a-box //-->
+<?php
+  if (!(getenv('HTTPS')=='on')){
+  if ($banner = tep_banner_exists('dynamic', 'googlebox')) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_GOOGLE_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+       $info_box_contents = array();
+       $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                               );
+   new infoboxFooter($info_box_contents, true, true);
+?>
+
+
+
+            </td>
+          </tr>
+<?php
+  }
+  }
+?>
+<!-- google-banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/information_table.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/information_table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/information_table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: information.php,v 1.1.1.1 2003/09/18 19:05:51 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2857 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- information //-->
+          <tr>
+            <td>
+<?php
+
+require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_INFORMATIONBOX);
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_INFORMATION_TABLE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  // Retrieve information from Info table
+   $informationString = "";
+
+ // joles
+   $sql_query = tep_db_query("SELECT information_id, languages_id, info_title FROM " . TABLE_INFORMATION . " WHERE visible= '1' and languages_id ='" . (int)$languages_id . "' ORDER BY v_order");
+   while ($row = tep_db_fetch_array($sql_query)){
+   $informationString .= '<a href="' . tep_href_link(FILENAME_INFORMATION,  'info_id=' . $row['information_id'] ) . '">' . $row['info_title'] . '</a><br>';
+   }
+
+   $info_box_contents = array();
+
+if (tep_session_is_registered('customer_id')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+
+ } else if ((tep_session_is_registered('customer_id')) && (MODULE_ORDER_TOTAL_GV_STATUS == 'true')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+} else {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+}
+
+  new $infobox_template($info_box_contents);
+    $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+   new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/languages.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2428 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- languages //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LANGUAGES . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+    include(DIR_WS_CLASSES . FILENAME_LANGUAGE);
+    $lng = new language;
+  }
+
+  $languages_string = '';
+  reset($lng->catalog_languages);
+  while (list($key, $value) = each($lng->catalog_languages)) {
+    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text' => $languages_string);
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+               'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- languages_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/links.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+  $Id: links.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1980 $
+
+
+  Released under the GNU General Public License
+*/
+
+
+// check for link categoris to determine if there is anything to display
+  $link_categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");
+  $number_of_categories = tep_db_num_rows($link_categories_query);
+
+  if ($number_of_categories > 0) {
+?>
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LINKS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_LINKS));
+
+    $informationString = '';
+    while($row = tep_db_fetch_array($link_categories_query)) {
+      $lPath_new = 'lPath=' . $row['link_categories_id'];
+      $informationString .= '<a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">' . $row['link_categories_name'] . '</a><br>';
+    }
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => $informationString
+                                );
+    new infoBox($info_box_contents);
+    $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+   new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,154 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3423 $
+
+
+  Released under the GNU General Public License
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  loginbox.php -   Version 1.0
+  This puts a login request in a box with a login button.
+  If already logged in, will not show anything.
+
+  Modified to utilize SSL to bypass Security Alert
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_LOGINBOX);
+
+// WebMakers.com Added: Do not show if on login or create account
+if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') )  {
+?>
+<!-- loginbox //-->
+<?php
+
+    if (!tep_session_is_registered('customer_id')) {
+?>
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    $loginboxcontent = "
+       <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "\">
+            <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
+               <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_EMAIL . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_PASSWORD . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"password\" name=\"password\" maxlength=\"40\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+        <tr>
+            <td align=\"center\">
+      " . tep_draw_separator('pixel_trans.gif', '100%', '5') . "
+      </td>
+            </tr>
+              <tr>
+                <td class=\"infoboxContents\" align=\"center\">
+                  " . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "
+                </td>
+              </tr>
+             </table>
+           </form> 
+              ";
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $loginboxcontent
+                                );
+new infoBox($info_box_contents);
+
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<?php
+  } else {
+  // If you want to display anything when the user IS logged in, put it
+  // in here...  Possibly a "You are logged in as :" box or something.
+
+
+  }
+?>
+<!-- loginbox_eof //-->
+<?php
+// WebMakers.com Added: My Account Info Box
+} else {
+  if (tep_session_is_registered('customer_id')) {
+?>
+
+<!-- my_account_info //-->
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>'
+                              );
+new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                          'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- my_account_info_eof //-->
+
+<?php
+  }
+}
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/manufacturer_info.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/manufacturer_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/manufacturer_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: manufacturer_info.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- manufacturer_info //-->
+<?php
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id, m.manufacturers_id as manf_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from  " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and m.manufacturers_id = p.manufacturers_id and mi.manufacturers_id = m.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'");
+//    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id from  " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+
+   while ($manufacturer = tep_db_fetch_array($manufacturer_query)) {;
+?>
+<!-- manufacturer_info //-->
+          <tr>
+            <td>
+          
+<?php
+// echo 'prod-id' . (int)$HTTP_GET_VARS['products_id'] . 'manid' . $manufacturer['manufacturers_id'];
+      $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURER_INFO . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+      if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';
+      if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';
+      $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manf_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . ' ' . $manufacturer['manufacturers_name'] . '</a></td></tr>' .
+                                   '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturer_info_string);
+
+      new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- manufacturer_info_eof //-->
+          <?php
+       }
+      }
+?>
+<!-- manufacturer_info_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.1.1.1 2004/03/04 23:42:15 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+  if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
+?>
+<!-- manufacturers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURERS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false);
+
+    if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
+// Display a list
+      $manufacturers_list = '';
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
+        $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
+      }
+
+      $manufacturers_list = substr($manufacturers_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturers_list);
+    } else {
+// Display a drop-down
+      $manufacturers_array = array();
+      if (MAX_MANUFACTURERS_LIST < 2) {
+        $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
+                                       'text' => $manufacturers_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- manufacturers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,119 @@
+<?php
+/*
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+// VJ navmenu begin
+define('TABLE_NAVMENU_CATEGORIES', 'navmenu_categories');
+define('TABLE_NAVMENU_CATEGORIES_DESCRIPTION', 'navmenu_categories_description');
+define('TABLE_NAVMENU_LINKS', 'navmenu_links');
+define('TABLE_NAVMENU_LINKS_DESCRIPTION', 'navmenu_links_description');
+define('TABLE_NAVMENU_LINKS_TO_CATEGORIES', 'navmenu_links_to_categories');
+// VJ navmenu end
+
+function tep_nm_get_navmenu_list($pid = 0, $list_string = '', $style_id = '') {
+  global $languages_id;
+
+  $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name
+                                    from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                         " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd
+                                    where c.nmc_parent_id = '" . (int)$pid . "'
+                                      and cd.nmc_id = c.nmc_id
+                                      and cd.language_id = '" . (int)$languages_id . "'
+                                    order by c.nmc_sort_order, cd.nmc_name");
+
+  $links_query = tep_db_query("select l.nml_id, l.nml_url, ld.nml_name
+                               from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                    " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c,
+                                    " . TABLE_NAVMENU_LINKS . " l,
+                                    " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld
+                               where c.nmc_id = '" . (int)$pid . "'
+                                 and c.nmc_id = l2c.nmc_id
+                                 and l2c.nml_id = l.nml_id
+                                 and ld.nml_id = l.nml_id
+                                 and ld.language_id = '" . (int)$languages_id . "'
+                               order by l.nml_sort_order, ld.nml_name");
+
+  if ((tep_db_num_rows($categories_query) > 0) || (tep_db_num_rows($links_query) > 0)) {
+    if (empty($list_string)) {
+      $list_string .= '<ul id="' . $style_id . '">' . "\n";
+    } else {
+      $list_string .= '<ul>' . "\n";
+    }
+
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $list_string .= '<li><a href="#">' . $categories['nmc_name'] . '</a>';
+
+      $list_string = tep_nm_get_navmenu_list((int)$categories['nmc_id'], $list_string);
+
+      $list_string .= '</li>' . "\n";
+    } 
+
+    while ($links = tep_db_fetch_array($links_query)) {
+      $list_string .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $links['nml_url'], 'NONSSL') . '">' . $links['nml_name'] . '</li>' . "\n";
+    } 
+
+    $list_string .= '</ul>' . "\n";
+  }
+
+  return $list_string;
+}
+?>
+<!-- navmenu //-->
+<script type="text/javascript"><!--
+sfHover = function() {
+   var sfEls = document.getElementById("navMenu").getElementsByTagName("LI");
+   for (var i=0; i<sfEls.length; i++) {
+     sfEls[i].onmouseover=function() {
+       this.className+=" sfhover";
+     }
+     sfEls[i].onmouseout=function() {
+       this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
+     }
+   }
+}
+if (window.attachEvent) window.attachEvent("onload", sfHover);
+//--></script>
+                  <tr>
+                    <td>
+                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
+                      <tr>
+                        <td width="100%">
+<?php
+$info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NAVMENU . '</font>');
+new infoBoxHeading($info_box_contents, false, false);
+
+$menu_string = tep_nm_get_navmenu_list(0, '', 'navMenu');
+
+// VJ debug
+//print_r($menu_string);
+
+$info_box_contents = array(array('text' =>  $menu_string));
+
+new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+                        </td>
+                      </tr>
+                    </table>
+                    </td>
+                  </tr>
+<!-- information_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/order_history.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/order_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/order_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: order_history.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3464 $
+
+
+  Released under the GNU General Public License
+*/
+
+  if (tep_session_is_registered('customer_id')) {
+// retreive the last x products purchased
+    $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
+    if (tep_db_num_rows($orders_query)) {
+?>
+<!-- customer_orders //-->
+          <tr>
+            <td>
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CUSTOMER_ORDERS . '</font>');
+      new infoBoxHeading($info_box_contents, false, false);
+
+      $product_ids = '';
+      while ($orders = tep_db_fetch_array($orders_query)) {
+        $product_ids .= (int)$orders['products_id'] . ',';
+      }
+      $product_ids = substr($product_ids, 0, -1);
+
+      $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+      $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+        // changes the cust_order into a buy_now action
+        $customer_orders_string .= '  <tr>' .
+                                   '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
+                                   '    <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
+                                   '  </tr>';
+      }
+      $customer_orders_string .= '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $customer_orders_string);
+
+      new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- customer_orders_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/pages.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+  $Id: pages.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$pages_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_PAGES_CATEGORIES . " ic, " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// pages outside categories
+$pages_query = tep_db_query("select ip.pages_id, ipd.pages_title
+                             from " . TABLE_PAGES . " ip
+                             left join " . TABLE_PAGES_TO_CATEGORIES . " ip2c on (ip2c.pages_id = ip.pages_id and ip2c.categories_id = '0'),
+                                  " . TABLE_PAGES_DESCRIPTION . " ipd
+                             where ip.pages_status = '1'
+                               and ipd.pages_id = ip.pages_id
+                               and ipd.language_id = '" . (int)$languages_id . "'
+                             order by ip.pages_sort_order, ipd.pages_title");
+
+if ((tep_db_num_rows($pages_categories_query) > 0) || (tep_db_num_rows($pages_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_PAGES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $pages_string = '';
+  while ($pages_categories = tep_db_fetch_array($pages_categories_query)) {
+    $id_string = 'cID=' . $pages_categories['categories_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($pages = tep_db_fetch_array($pages_query)) {
+    $id_string = 'pID=' . $pages['pages_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages['pages_title'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $pages_string);
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/product_notifications.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/product_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/product_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: product_notifications.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2746 $
+
+
+  Released under the GNU General Public License
+*/
+if (isset($HTTP_POST_VARS['products_id']) && tep_not_null($HTTP_POST_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+  } elseif (isset($HTTP_GET_VARS['products_id']) && tep_not_null($HTTP_GET_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_GET_VARS['products_id']);
+  } 
+  if ( (isset($HTTP_GET_VARS['products_id'])) || (isset($HTTP_POST_VARS['products_id'])) ) {
+?>
+<!-- notifications //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NOTIFICATIONS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
+
+    if (tep_session_is_registered('customer_id')) {
+      $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      $notification_exists = (($check['count'] > 0) ? true : false);
+    } else {
+      $notification_exists = false;
+    }
+
+    $info_box_contents = array();
+    if ($notification_exists == true) {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    } else {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    }
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- notifications_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/reviews.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,67 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1799 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- reviews //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_REVIEWS . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_REVIEWS));
+
+  $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'";
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $random_select .= " and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'";
+  }
+  $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
+  $random_product = tep_random_select($random_select);
+
+  $info_box_contents = array();
+
+  if ($random_product) {
+// display random review box
+    $review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'");
+    $review = tep_db_fetch_array($review_query);
+
+    $review = tep_break_string(tep_output_string_protected($review['reviews_text']), 15, '-<br>');
+
+    $info_box_contents[] = array('text' => '<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div>');
+  } elseif (isset($HTTP_GET_VARS['products_id'])) {
+// display 'write a review' box
+    $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . BOX_REVIEWS_WRITE_REVIEW .'</a></td></tr></table>');
+  } else {
+// display 'no reviews' box
+    $info_box_contents[] = array('text' => BOX_REVIEWS_NO_REVIEWS);
+  }
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- reviews_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/search.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,46 @@
+<?php
+/*
+  $Id: search.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3423 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" ') . '&nbsp;' . tep_hide_session_id() . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/search1.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/search1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/search1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+<?php
+/*
+  $Id: search1.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3423 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH1 . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find1" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px">&nbsp;' . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br>'
+                              );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- search_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,63 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- shop by price //-->
+<?php
+if (MODULE_SHOPBYPRICE_RANGES > 0) {
+?>
+          <tr>
+            <td>
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOP_BY_PRICE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $sbp_array = unserialize(MODULE_SHOPBYPRICE_RANGE);
+
+  $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=0', 'NONSSL') . '">' . TEXT_INFO_UNDER . $currencies->format($sbp_array[0]) . '</a><br>');
+  for ($i=1, $ii=count($sbp_array); $i < $ii; $i++) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . TEXT_INFO_FROM . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_TO . $currencies->format($sbp_array[$i]) . '</a><br>');
+  }
+  if (MODULE_SHOPBYPRICE_OVER == True) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_ABOVE . '</a><br>');
+  }
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                  'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+    new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!-- shop_by_price //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,135 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1799 $
+
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- shopping_cart //-->
+<script type="text/javascript"><!--
+function couponpopupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOPPING_CART . '</font>');
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOPPING_CART));
+
+  $cart_contents_string = '';
+  if ($cart->count_contents() > 0) {
+    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+  $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
+    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
+  if ((int)$products_parent_id['products_parent_id'] != 0) {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '">';
+  } else {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+  }
+
+//      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+      $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        tep_session_unregister('new_products_id_in_cart');
+      }
+    }
+    $cart_contents_string .= '</table>';
+  } else {
+    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $cart_contents_string);
+
+  if ($cart->count_contents() > 0) {
+    // WebMakers.com Added: Shoppe Enhancement Controller
+    // check for free order
+    $final_total=$cart->show_total();
+    if ($final_total==0) {
+      $final_total='Free';
+    } else {
+      $final_total=$currencies->format($cart->show_total());
+    }
+    $info_box_contents[] = array('text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'right',
+                                 'text' => $final_total);
+  }
+// ICW ADDED FOR CREDIT CLASS GV
+  if (tep_session_is_registered('customer_id')) {
+    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $gv_result = tep_db_fetch_array($gv_query);
+    if ($gv_result['amount'] > 0 ) {
+      $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');
+    }
+  }
+  if (tep_session_is_registered('gv_id')) {
+    $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
+    $coupon = tep_db_fetch_array($gv_query);
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');
+
+  }
+  if (tep_session_is_registered('cc_id') && $cc_id) {
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');
+
+  }
+
+// ADDED FOR CREDIT CLASS GV END ADDITTION
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- shopping_cart_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3423 $
+
+
+  Released under the GNU General Public License
+*/
+
+   $random_product25 = tep_db_query("select distinct
+   p.products_id, 
+   pd.products_name, 
+   p.products_tax_class_id, 
+   p.products_image, 
+   s.specials_new_products_price 
+   from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+    " . TABLE_SPECIALS . " s 
+   where 
+   p.products_status = '1' 
+   and p.products_id = s.products_id 
+   and pd.products_id = s.products_id 
+   and pd.language_id = '" . (int)$languages_id . "' 
+   and s.status = '1' 
+   order by rand(), s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
+ 
+  
+  $random_product24_side_row = tep_db_num_rows($random_product25);
+     if ($random_product24_side_row > 0){
+
+?>
+<!-- d specials //-->
+          <tr>
+            <td>
+<?php
+
+while ($product_specials22 = tep_db_fetch_array($random_product25)){
+  $product_specials22_id = $product_specials22['products_id'];
+  $product_specials22_image = tep_get_products_image($product_specials22['products_id']);
+  $product_specials22_name = tep_get_products_name($product_specials22['products_id']);
+
+  $pf->loadProduct($product_specials22['products_id'],$languages_id);
+        $special_random_price = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SPECIALS . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price);
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- specials_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['products_id']) {
+?>
+<!-- tell_a_friend //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TELL_A_FRIEND . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('tell_a_friend', tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('to_email_address', '', 'size="10"') . '&nbsp;' . tep_template_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id() . '<br>' . BOX_TELL_A_FRIEND_TEXT);
+
+  new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+?>
+            </td>
+          </tr>
+<!-- tell_a_friend_eof //-->
+
+<?php } ?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/theme_select.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/theme_select.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/theme_select.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+  $Id: theme_select.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1075 $
+
+
+  Released under the GNU General Public License
+*/
+    if (tep_session_is_registered('customer_id')) {
+
+  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
+
+?>
+<!-- theme //-->
+         <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TEMPLATE_SELECT . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $template_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " where active = '1' order by template_name");
+
+ 
+// Display a drop-down
+    $select_box = '<select name="template" onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%">';
+    if (MAX_THEME_LIST < 2) {
+      $select_box .= '<option value="">' . PULL_DOWN_DEFAULT . '</option>';
+    }
+    while ($template_values = tep_db_fetch_array($template_query)) {
+      $select_box .= '<option value="' . $template_values['template_name'] . '"';
+      if ($HTTP_GET_VARS['template_id'] == $template_values['template_id']) $select_box .= ' SELECTED';
+      $select_box .= '>' . substr($template_values['template_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
+    }
+    $select_box .= "</select>";
+    $select_box .= tep_hide_session_id();
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form'  => '<form name="template" method="post" action="' . tep_href_link(FILENAME_DEFAULT, '&action=update_template', 'NONSSL') . '">',
+                                 'align' => 'left',
+                                 'text'  => $select_box);
+
+   new infoBox($info_box_contents);
+
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<?php
+}}
+?>
+<!-- template_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/whats_new.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/whats_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/whats_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,82 @@
+<?php
+/*
+  $Id: whats_new.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3423 $
+
+
+  Released under the GNU General Public License
+*/
+  $random_product27 = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+      order by rand(), products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
+ 
+$random_product27_side_row = tep_db_num_rows($random_product27);
+   if ($random_product27_side_row > 0){
+
+  ?>
+<!--D whats_new //-->
+ <tr>
+            <td>
+<?php      
+    
+while ($whatsnew_product21 = tep_db_fetch_array($random_product27)){
+  $whatsnew_product21_id = $whatsnew_product21['products_id'];
+  $whatsnew_product21_image = tep_get_products_image($whatsnew_product21['products_id']);
+  $whatsnew_product21_name = tep_get_products_name($whatsnew_product21['products_id']);
+
+  $pf->loadProduct($whatsnew_product21['products_id'],$languages_id);
+         $whats_new_price = $pf->getPriceStringShort();
+}
+// EOF Separate Pricing Per Customer
+//Eversun mod end for sppc and qty price breaks
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHATS_NEW . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',           
+         'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $whatsnew_product21_image, $whatsnew_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . $whatsnew_product21_name . '</a><br>' . $whats_new_price .'<br />');
+//Eversun mod for sppc and qty price breaks
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- whats_new_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,99 @@
+<?php
+/*
+  $Id: whos_online.php, v 1.0 2001/12/05 by mattice at xs4all.nl
+
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 2428 $
+
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official TEP distribution
+  but an add-on contributed to the TEP community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_WHOS_ONLINEBOX);
+?>
+
+
+<!-- whos_online //-->
+          <tr>
+            <td>
+<?php
+
+// Set expiration time, default is 900 secs (15 mins)
+  $xx_mins_ago = (time() - 900);
+
+  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
+
+  $whos_online_query = tep_db_query("select customer_id from " . TABLE_WHOS_ONLINE);
+  while ($whos_online = tep_db_fetch_array($whos_online_query)) {
+                        if (!$whos_online['customer_id'] == 0) $n_members++;
+                        if ($whos_online['customer_id'] == 0) $n_guests++;
+
+  $user_total = sprintf(tep_db_num_rows($whos_online_query));                                                                }
+
+  if ($user_total == 1) {
+    $there_is_are = BOX_WHOS_ONLINE_THEREIS . '&nbsp;';
+  } else {
+    $there_is_are = BOX_WHOS_ONLINE_THEREARE . '&nbsp;';
+  }
+
+  if ($n_guests == 1) {
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUEST;
+  }else{
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUESTS;
+  }
+
+  if ($n_members == 1) {
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBER;
+  }else{
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBERS;
+  }
+
+
+  if (($n_guests >= 1) && ($n_members >= 1)) $word_and = '&nbsp;' . BOX_WHOS_ONLINE_AND . '&nbsp;<br>';
+
+      $textstring = $there_is_are;
+        if ($n_guests >= 1) $textstring .= $n_guests . $word_guest;
+
+      $textstring .= $word_and;
+        if ($n_members >= 1) $textstring .= $n_members . $word_member;
+
+      $textstring .= '&nbsp;online.';
+
+
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHOS_ONLINE . '</font>');
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>  $textstring
+                              );
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+            </td>
+          </tr>
+<!-- whos_online_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,101 @@
+<?php
+/*
+  $Id: wishlist.php,v 2.2 2004/09/12 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 3464 $
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- wishlist //-->
+<?php
+if (basename($PHP_SELF) != FILENAME_WISHLIST_SEND){
+if (basename($PHP_SELF) != FILENAME_WISHLIST)   {
+?> 
+          <tr>
+            <td>
+<?php
+  // retreive the wishlist
+  if (tep_session_is_registered('customer_id')) {
+    $wishlist_query_raw = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 order by products_name";  
+    $wishlist_query = tep_db_query($wishlist_query_raw);
+
+    // if we have something in this clients list:
+    ?>
+    <!-- customer_wishlist //-->
+    <script type="text/javascript"><!--
+    function popupWindowWishlist(url) {
+      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=425,height=475,screenX=150,screenY=150,top=150,left=150')
+    }
+    //--></script>
+    <?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WISHLIST . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_WISHLIST, '','NONSSL'));
+    
+    $info_box_contents = array();
+    
+    if (tep_db_num_rows($wishlist_query)) {
+      if (tep_db_num_rows($wishlist_query) < MAX_DISPLAY_WISHLIST_BOX) {
+
+        $product_ids = '';
+        while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+          $product_ids .= $wishlist['products_id'] . ',';
+         }
+        $product_ids = substr($product_ids, 0, -1);        
+       
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        //  $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . $product_ids . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $customer_wishlist_string .= '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a></td>' . "\n" .
+                                                  '</tr>' . "\n" .
+                                                  '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents" align="center" valign="bottom"><b><a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_MOVE_TO_CART . '</a>&nbsp;|' . "\n" .
+                                                  '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b>' . "\n" .  tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td>' .
+                                                  '</td></tr>' . "\n";
+        }
+      } else {
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . sprintf(TEXT_WISHLIST_COUNT, tep_db_num_rows($wishlist_query)) . '</td></tr>' . "\n";
+      }
+    } else {
+      $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+      $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . BOX_WISHLIST_EMPTY . '</td></tr>' . "\n";
+    }
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a></td></tr>' . "\n";
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST_HELP . '</u> [?]</a></td></tr>' . "\n"; // Normal link
+    $customer_wishlist_string .= '</table>';
+
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => $customer_wishlist_string);
+
+    new infoBox($info_box_contents);
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+  }
+?>
+            </td>
+          </tr>
+          <?php
+    }}
+?><!-- wishlist_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/boxes.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/boxes.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/boxes.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,268 @@
+<?php
+/*
+  $Id: boxes.tpl.php,v 1.1.1.1 2004/03/04 23:42:35 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBox {
+    var $table_border = '0';
+    var $table_width = '100%';
+    var $table_cellspacing = '0';
+    var $table_cellpadding = '2';
+    var $table_parameters = '';
+    var $table_row_parameters = '';
+    var $table_data_parameters = '';
+
+// class constructor
+    function tableBox($contents, $direct_output = false) {
+      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
+      $tableBox_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
+        $tableBox_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
+        $tableBox_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
+              $tableBox_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
+              $tableBox_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+          $tableBox_string .= '    <td align="left"  width="'.SIDE_BOX_LEFT_WIDTH.'" " style="background-image: url(\'' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif\');background-repeat: repeat-y;"><img src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif" alt="'.BOX_ALT.'" width="'.SIDE_BOX_LEFT_WIDTH.'" height="1"></td>  <td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox_string .= '>' . $contents[$i]['text'] . '</td><td width="'.SIDE_BOX_RIGHT_WIDTH.'" style="background-image: url(\'' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif\');background-repeat: repeat-y;"><img src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif" alt="'.BOX_ALT.'" width="'.SIDE_BOX_RIGHT_WIDTH.'" height="1"></td>' . "\n";
+        }
+
+        $tableBox_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
+      }
+
+      $tableBox_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox_string;
+
+      return $tableBox_string;
+    }
+  }
+
+class categoriesBox extends tableBox {
+function categoriesBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->categoriesBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $this->tableBox($info_box_contents, true);
+    }
+
+function categoriesBoxContents($contents) {
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $info_box_contents = array();
+      for ($i=0; $i<sizeof($contents); $i++) {
+        $info_box_contents[] = array(array('align' => 'center', 'params' => 'class="noclass"', 'text' => $contents[$i]['text']));
+      }
+      return $this->tableBox($info_box_contents);
+    }
+}
+
+  class infoBox extends tableBox {
+    function infoBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_parameters = 'class="templateinfoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function infoBoxContents($contents) {
+      $this->table_cellpadding = '0';
+      $this->table_parameters = 'class="infoBoxContents"';
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
+                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
+                                           'params' => 'class="boxText"',
+                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
+      }
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      return $this->tableBox($info_box_contents);
+    }
+  }
+
+  class infoBoxHeading extends tableBox {
+    function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+
+      if ($left_corner == true) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      }
+      if ($right_arrow == true) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow =  tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+      }
+      if ($right_corner == true) {
+        $right_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+      } else {
+        $right_corner = $right_arrow;
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'class="infoBoxHeading"', 'text' => $left_corner),
+                                   array('params' => 'width="100%" class="infoBoxHeadingImage" align="center" valign="top"', 'text' => $contents[0]['text']),
+                                   array('params' => 'class="infoBoxHeading"', 'text' => $right_corner));
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+
+  class infoboxFooter extends tableBox {
+    function infoBoxFooter($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/infobox_footer_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/infobox_footer_left.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/infobox_footer_right.gif');
+      } else {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/infobox_footer_right.gif');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'class="infoBoxfooter"','text' => $left_corner),
+                                   array('params' => 'style="background-image: url(' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/infobox_footer_middle.gif); background-repeat: repeat-x;\" width="100%"', 'text' => $contents[0]['text']),
+           array('params' => ' nowrap', 'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+
+  class contentBox extends tableBox {
+    function contentBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_parameters = 'class="templateinfoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function contentBoxContents($contents) {
+      $this->table_cellpadding = '0';
+      $this->table_parameters = 'class="infoBoxContents"';
+      return $this->tableBox($contents);
+    }
+  }
+
+  class contentBoxHeading extends tableBox {
+    function contentBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+
+      if ($left_corner == true) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+      }
+      if ($right_arrow == true) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow =  tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+      }
+      if ($right_corner == true) {
+        $right_corner = '';
+      } else {
+        $right_corner = $right_arrow;
+
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14"',
+                                         'text' => $left_corner),
+  array('params' => 'align="center" valign="top" style="background-image: url(' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif); background-repeat: repeat-x;" width="100%"  class="infoBoxHeading"',
+  'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" nowrap',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class contentBoxFooter extends tableBox {
+    function contentBoxFooter($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
+      $this->table_cellpadding = '0';
+      if ($left_corner) {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/center_footer_left.gif');
+      } else {
+        $left_corner = tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/center_footer_left.gif');
+      }
+      if ($right_arrow) {
+        $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
+      } else {
+        $right_arrow = '';
+      }
+      if ($right_corner) {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/center_footer_right.gif');
+      } else {
+        $right_corner = $right_arrow . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/center_footer_right.gif');
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' =>  'class="infoBoxfooter"','text' => $left_corner),
+                                   array('params' => 'background="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/center_footer_middle.gif" width="100%" ', 'text' => $contents[0]['text']),
+            array('params' => ' nowrap', 'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class errorBox extends tableBoxMessagestack {
+    function errorBox($contents) {
+      $this->table_data_parameters = 'class="errorBox"';
+      $this->tableBoxmessagestack($contents, true);
+    }
+  }
+
+  class productListingBox extends tableBox {
+    function productListingBox($contents) {
+      $this->table_parameters = 'class="productListing"';
+      $this->tableBox($contents, true);
+    }
+  }
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/doc/buttonspec.txt
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/doc/buttonspec.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/doc/buttonspec.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+Helius and Pixame_v1 2 Buttons
+This file is intended to help adding more buttons when they are needed.
+It purpose is to discribe how the button were made so that they
+can be duplicated in the future.
+
+Original Spec:
+   Background color: R 0 G 0 B 0
+   Boarder color:  R 0  G 38  B 138
+   Drop shadow: R 153  G 153  B 153
+   height: 14 Pixels
+   Font: Unkowen 
+---------------------------------------------------
+New
+Button Software: Deknop
+Formate: .gif
+LZW compression: Ulead photoimpact SE 4.2.
+
+ Background color: R 0 G 0 B 0
+   Boarder color:  R 0  G 38  B 138
+   Drop shadow: R 153  G 153  B 153
+   height: 14 Pixels 
+   Width: variable
+Font: Arial
+Font style: Bold
+Font Size: 10 points
+Font color: R:0 G:38 B: 138 (white)

Added: trunk/direct.openmoko.com/templates/Pixame_v1/extra_html_output.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/extra_html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/extra_html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+<?php
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_template_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_template_image_button($image, $alt = '', $parameters = '') {
+    global $language;
+
+    return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+  }
+
+
+  function table_image_border_top($left, $right, $header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+        <tr>
+          <td>
+<?php
+  if ((SHOW_HEADING_TITLE_ORIGINAL =='yes') && (tep_not_null($header)) ) {
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                               'text' => $header );
+  }else{
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                               'text' => '&nbsp;' );
+  }
+  new contentBoxHeading($info_box_contents, $left, $right);
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0" class="templateinfoBox">
+            <tr>
+              <td align="left" width="<?php echo SIDE_BOX_LEFT_WIDTH; ?>" background="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif"';?>>
+              <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif', 'box_bg_l.gif.'); ?>
+              </td>
+              <td>
+              <table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
+                <tr>
+                  <td class="main">
+                  <table style="main_table_heading" border="0" cellspacing="0" cellpadding="2" align="right" width="100%">
+                    <tr>
+                      <td>
+      <!--Lango Added for Template MOD: EOF-->
+<?php
+}
+}
+
+  function table_image_border_bottom(){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+         </td>
+                    </tr>
+                    <!--Lango Added for Template MOD: BOF-->
+                  </table>
+                  </td>
+                </tr>
+              </table>
+              </td>
+              <td align="right" width="<?php echo SIDE_BOX_RIGHT_WIDTH; ?>" background="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif"';?>>
+              <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif', 'box_bg_r.gif.'); ?>
+              </td>
+            </tr>
+          </table>
+<?php
+$info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new contentBoxFooter($info_box_contents, true, true);
+?>
+     </td</tr>
+      <!--Lango Added for Template MOD: EOF-->
+<?php
+}
+}
+?>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/footer.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/footer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/footer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: footer.php,v 1.26 2003/02/10 22:30:54 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+  require(DIR_WS_INCLUDES . FILENAME_COUNTER);
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+  <td width="5"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_left.gif" width="5" height="25" alt="image"></td>
+     <td class="footer" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/links_middle.gif)"> &nbsp;&nbsp;<?php echo strftime(DATE_FORMAT_LONG); ?>&nbsp;&nbsp;</td>
+       <td class="footer" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/links_middle.gif)" align ="right">&nbsp;&nbsp;<?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>&nbsp;&nbsp;</td>
+  <td width="5"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_right.gif" width="5" height="25" alt="image"></td>
+  </tr>
+</table>
+<!-- footer_eof //-->
+<?php } ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/header.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+if (SITE_WIDTH!='100%') {
+?>
+<table width="<?php echo SITE_WIDTH; ?>" cellpadding="0" cellspacing="0" border="0" align="center">
+  <tbody>
+  <tr>
+    <td>
+    <table CELLSPACING="0" CELLPADDING="0" BORDER="0" width="<?php echo SITE_WIDTH; ?>" align="center">
+      <tbody>
+      <tr>
+        <td>
+        <table border="0" width="100%">
+          <tbody>
+          <tr>
+            <td>
+      <?php } ?>
+            <div align="center">
+              <br>
+              <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                <tbody>
+                <tr>
+                  <td width="500">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_title.gif" width="421" height="73" alt="<?php echo IMAGE_ALT;?>"></td>
+           <td style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/header_background.gif)" width="100%" height="73">
+      <?php if (SHOW_CART_IN_HEADER=='yes') { ?>
+                  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                    <tbody>
+                    <tr class="header">
+                      <td class="ShowCartDetails" align="right" height="30" valign="middle">
+                      <?php echo '<a class="ShowCartDetails" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/kart1.gif') . '</a>&nbsp;&nbsp;[ ' . $cart->count_contents() . ($cart->count_contents() == "1" ? " Item" : " Items "); ?> &nbsp;&nbsp; <?php echo $currencies->format($cart->show_total()); ?> &nbsp;&nbsp; <?php echo $cart->show_weight() . ($cart->show_weight() == "1" ? " lb" : " lbs ");?>&nbsp;] </td>
+                    </tr>
+                  </tbody>
+                  </table>
+<?php
+// Bof Shopping Cart Box Enhancement
+$showcheckoutbutton = 1; // set to 1: show checkout button (default); set to 0: never show checkout button
+$showhowmuchmore = 1;    // set to 1: show how much more to spend for free shipping (default); set to 0: don't show
+
+echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
+
+
+
+if (($showcheckoutbutton==1)&&($cart->count_contents() > 0)) {
+  echo '<tr><td align="center"><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_template_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a></td></tr>';
+}
+echo '</table>';
+
+// Eof Shopping Cart Box Enhancement
+
+
+      } ?>
+                  </td>
+                  <td>
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_right.gif" width="80" height="73" alt="<?php echo IMAGE_ALT;?>"></td>
+                </tr>
+              </tbody>
+              </table>
+              <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                <tbody>
+                <tr>
+                  <td width="345">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/slogan.gif" width="345" height="23" alt="<?php echo IMAGE_ALT;?>"></td>
+           <td width="100%" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/slogan_middle.gif)">
+                  </td>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt=<?php echo IMAGE_ALT;?>"></td>
+                </tr>
+              </tbody>
+              </table>
+               <table width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+                <tbody>
+                <tr>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="<?php echo IMAGE_ALT;?>"></td>
+                  <td width="33%" bgcolor="#D2DBF5"></td>
+                  <td width="77%" bgcolor="#D2DBF5" align="right">
+
+<?php
+// show languages in header
+  if (SHOW_LANGUAGES_IN_HEADER=='yes') require(DIR_WS_INCLUDES . 'languages_in_header.php'); ?></td>
+                  <td width="5" bgcolor="#D2DBF5">&#160;</td>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="<?php echo IMAGE_ALT;?>"></td>
+                </tr>
+              </tbody>
+              </table>
+<?php
+// show link buttons in header
+ if (SHOW_HEADER_LINK_BUTTONS=='yes')  include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/links.htm');
+?>
+              <table width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+                <tr>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="<?php echo IMAGE_ALT;?>"></td>
+                  <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                  <td bgcolor="#D2DBF5">&nbsp;</td>
+                  <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="<?php echo IMAGE_ALT;?>"></td>
+                </tr>
+              </table>
+            </div>
+
+<?php } ?>
+<!-- header_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/Pixame_v1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/Pixame_v1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/Pixel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/Pixel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/arrow.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/arrow.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/block_space_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/block_space_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/block_space_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/block_space_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_.psd
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_view_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_view_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/footer_left_b.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/footer_left_b.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/footer_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/footer_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/footer_right_b.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/footer_right_b.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/header_background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/header_background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/header_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/header_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/header_title.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/header_title.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/bar_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/bar_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/bar_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/bar_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/bar_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/bar_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/box_bg_l.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/box_bg_l.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/box_bg_r.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/box_bg_r.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/center_footer_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/center_footer_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/center_footer_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/center_footer_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/center_footer_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/center_footer_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/infobox_footer_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/infobox_footer_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/infobox_footer_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/infobox_footer_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/infobox_footer_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/infobox_footer_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/q1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/q1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/q2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/q2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/r1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/r1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/r2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/infobox/r2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/kart1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/kart1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/links_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/links_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/links_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/links_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/links_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/links_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/pointer_blue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/pointer_blue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/pointer_blue_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/pointer_blue_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/slogan.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/slogan.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/slogan_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/slogan_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/space_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/space_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/images/space_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1/images/space_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1/links.htm
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/links.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/links.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr>
+    <td width="5">
+    <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_left.gif" width="5" height="25" alt="image"></td>
+   <td style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/links_middle.gif)">
+      <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_LINKS_DEFAULT . '</a>';?>&nbsp;&nbsp;&nbsp;
+<?php
+      if (!tep_session_is_registered('noaccount')){// DDB - PWA - 040622 - no display of logoff for PWA customers
+         if (!tep_session_is_registered('customer_id')) {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_LINKS_LOGIN . '</a>&nbsp;&nbsp;&nbsp;';
+          } else {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ACCOUNT, "", "SSL") . '">' . HEADER_LINKS_ACCOUNT_INFO . '</a>&nbsp;&nbsp;&nbsp;';
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_LINKS_LOGOFF . '</a>&nbsp;&nbsp;&nbsp;';
+          }
+         }
+
+     if (tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers
+       {
+     if (!tep_session_is_registered('customer_id')) {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_LINKS_LOGIN . '</a>&nbsp;&nbsp;&nbsp;';
+   }else{
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_LINKS_LOGOFF . '</a>&nbsp;&nbsp;&nbsp;';
+      }
+      }
+
+   echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_SPECIALS) . '">' . HEADER_LINKS_SPECIALS . '</a>&nbsp;&nbsp;&nbsp;';
+     ?>
+    <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif\" alt=\"image\"') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . HEADER_LINKS_WHATS_NEW . '</a>';?>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8" alt="image">
+      <a class="HeaderPageLinks" href="#">MEMBERS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8" alt="image">
+      <a class="HeaderPageLinks" href="#">DOWNLOADS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8" alt="image">
+      <a class="HeaderPageLinks" href="#">LINKS</a>&nbsp;&nbsp;&nbsp;
+   <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif\" alt=\"image\"') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ALLPRODS) . '">' . HEADER_LINKS_PRODUCTS_ALL . '</a>';?>&nbsp;&nbsp;&nbsp;
+   <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif\" alt=\"image\"') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">CONTACT US</a>';?>
+      </td>
+    <td width="5">
+    <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_right.gif" width="5" height="25" alt="image"></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/links1.htm
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/links1.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/links1.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr>
+    <td width="5">
+    <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_left.gif" width="5" height="25"></td>
+    <td background="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_middle.gif">
+    <div align="center">
+      <font class="storyboxtitle">
+      <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_LINKS_DEFAULT . '</a>';?>&nbsp;&nbsp;&nbsp;
+      <?php if (!tep_session_is_registered('customer_id')) {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN) . '">' . HEADER_LINKS_LOGIN . '</a>&nbsp;&nbsp;&nbsp;';
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_SPECIALS) . '">' . HEADER_LINKS_SPECIALS . '</a>&nbsp;&nbsp;&nbsp;';
+      } else {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ACCOUNT) . '">' . HEADER_LINKS_ACCOUNT_INFO . '</a>&nbsp;&nbsp;&nbsp;';
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGOFF) . '">' . HEADER_LINKS_LOGOFF . '</a>&nbsp;&nbsp;&nbsp;';
+      }
+      ?>
+    <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . HEADER_LINKS_WHATS_NEW . '</a>';?>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8">
+      <a href="#">MEMBERS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8">
+      <a href="#">FORUMS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8">
+      <a href="#">DOWNLOADS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8">
+      <a href="#">LINKS</a>&nbsp;&nbsp;&nbsp;
+   <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ALLPRODS) . '">' . HEADER_LINKS_PRODUCTS_ALL . '</a>';?>&nbsp;&nbsp;&nbsp;
+   <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">CONTACT US</a>';?></font></div>
+     </font></div>
+    </td>
+    <td width="5">
+    <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_right.gif" width="5" height="25"></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/templates/Pixame_v1/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,198 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body>
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+<!-- warning_eof //-->
+<!-- header //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_HEADER); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_MAIN; ?>" class="centertable" bgcolor="#798CCC">
+  <tr>
+<?php
+if (DISPLAY_COLUMN_LEFT == 'yes')  {
+// WebMakers.com Added: Down for Maintenance
+// Hide column_left.php if not to show
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top" bgcolor="#D2DBF5"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+<!-- content //-->
+    <td width="100%" valign="top" bgcolor="#D2DBF5">
+<?php
+if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template))) {
+    require(DIR_WS_CONTENT . basename($content_template));
+  } else {
+    require(DIR_WS_CONTENT . $content . '.tpl.php');
+  }
+?>
+    </td>
+<!-- content_eof //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide column_right.php if not to show
+
+if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top" bgcolor="#D2DBF5"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+require(DIR_WS_INCLUDES . FILENAME_COUNTER); ?>
+            <table width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+              <tr>
+                <td width="1" bgcolor="#798CCC">
+                <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td bgcolor="#D2DBF5">&nbsp;</td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td width="1" bgcolor="#798CCC">
+                <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+              </tr>
+            </table>
+<?php    include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/'.FILENAME_LINKS_HTM);?>
+
+
+            <!-- footer //-->
+       <?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_FOOTER); ?>
+<!-- footer_eof //-->
+ <?php if (!(getenv('HTTPS')=='on')){
+  if (tep_banner_exists('dynamic','googlefoot') ) { ?>
+
+  <table bgcolor="#798CCC"width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+              <tr>
+                <td width="1" bgcolor="#798CCC"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td bgcolor="#D2DBF5">
+<?php 
+//google banner ad
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', 'googlefoot'); ?></td>
+  </tr>
+</table>
+
+                </td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td width="1" bgcolor="#798CCC"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+              </tr>
+            </table>
+ <?php
+  } }
+?>
+ <?php if (tep_banner_exists('dynamic', '468x50') ) { ?>
+
+  <table bgcolor="#798CCC"width="100%" style="height:20" border="0" cellpadding="0" cellspacing="0">
+              <tr>
+                <td width="1" bgcolor="#798CCC"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td bgcolor="#D2DBF5">
+<?php 
+//google banner ad
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic',  '468x50'); ?></td>
+  </tr>
+</table>
+
+                </td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td width="1" bgcolor="#798CCC"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+              </tr>
+            </table>
+ <?php
+  }
+?>
+ 
+           
+            <table width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+              <tr>
+                <td width="75" height="71">
+                <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/footer_left_b.gif" width="75" height="71" alt="image"></td>
+             <td width="100%" align="center" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/footer_middle.gif)" height="10" class="smallText">
+
+<?php
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default osCommerce-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+
+  echo FOOTER_TEXT_BODY
+?>
+                </td>
+                <td width="75" height="71">
+                <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/footer_right_b.gif" width="75" height="71" alt="image"></td>
+              </tr>
+            </table>
+<?php
+}
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+if (SITE_WIDTH!='100%') {
+?>
+         </td></tr></table>
+       </td></tr>
+     </table>
+   </td>
+  </tr>
+</table>
+<?php
+}
+// EOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/default_specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/default_specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/default_specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: default_specials.php,v 2.0 2003/06/13
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- default_specials //-->
+
+  <tr>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
+  
+  new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));
+
+  $random_specials = array();
+  $specials_array = array();
+  $specials_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC");
+  while ($specials = tep_db_fetch_array($specials_query)) {
+    $random_specials[] .= $specials['products_id'];
+  }
+
+  $row = 0;
+  $col = 0;
+
+  if (sizeof($random_specials)!=0){
+    $max_displayed = (MAX_DISPLAY_SPECIAL_PRODUCTS > sizeof($random_specials)) ? sizeof($random_specials) : MAX_DISPLAY_SPECIAL_PRODUCTS;
+    $special_products = cre_random_array($random_specials, $max_displayed);
+    for($i=0; $i < $max_displayed; $i++) {
+      $product_array = array();
+      $product_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price as special_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where  p.products_id = $special_products[$i] and  s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");
+      $product = tep_db_fetch_array($product_query);
+
+      $pf->loadProduct($product['products_id'],$languages_id);
+      $products_price_s = $pf->getPriceStringShort();
+
+      $buyitnow='<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+ 
+      $info_box_contents[$row][$col] = array('align' => 'center',
+                                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                                             'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $product['products_image'], $product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['products_id']) . '">' . $product['products_name'] . '</a><br>' . $products_price_s . '<br>'. $buyitnow);
+      $col ++;
+      if ($col > 2) {
+        $col = 0;
+        $row ++;
+      }
+    }
+  }else{
+      $info_box_contents[$row][$col] = array('align' => 'left',
+                                             'params' => 'class="smallText" width="33%" valign="top"',
+                                             'text' => TEXT_NO_SPECIALS);
+  }
+  
+  new contentBox($info_box_contents);
+
+  $info_box_contents = array();
+  if (MAIN_TABLE_BORDER == 'yes'){
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                             );
+    new infoboxFooter($info_box_contents, true, true);
+  }
+?><!-- default_specials_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/example.html
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/example.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/example.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td class="infoBoxHeading">
+    <img src="templates/Pixame_v1/images/infobox/corner_left.gif" border="0" alt width="23" height="43"></td>
+    <td valign="top" align="center" background="templates/Pixame_v1/images/infobox/background.gif" border="0" width="100%" height="43" class="infoBoxHeadingImage">
+    Example HTML Module</td>
+    <td class="infoBoxHeading" nowrap>
+    <img src="templates/Pixame_v1/images/infobox/corner_right.gif" border="0" alt width="23" height="43"></td>
+  </tr>
+</table>
+<table border="0" width="100%" cellspacing="0" cellpadding="0" class="templateinfoBox">
+  <tr>
+    <td align="left" width="5" background="templates/Pixame_v1/images/infobox/box_bg_l.gif">
+    <img src="templates/Pixame_v1/images/infobox/box_bg_l.gif" width="5" height="1"></td>
+    <td>
+    <table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBoxContents">
+      <!-- change from here to next-->
+      <tr>
+        <td>
+        <img src="images/pixel_trans.gif" border="0" alt width="100%" height="10"></td>
+      </tr>
+      <tr>
+        <td align="center" valign="bottom">
+        <img width="426" height="75" src="templates/Pixame_v1/images/chr01.gif" border="0"></td>
+      </tr>
+      <tr>
+        <td valign="top" align="center">
+        <img valign="top" width="117" height="90" src="templates/Pixame_v1/images/chr02.gif" border="0"><img width="117" height="90" valign="top" src="templates/Pixame_v1/images/chr03.gif" border="0"><img valign="top" src="templates/Pixame_v1/images/chr04.gif" height="90" width="96" border="0"><img valign="top" src="templates/Pixame_v1/images/chr05.gif" width="96" height="90" border="0"></td>
+      </tr>
+      <tr>
+        <td>
+        <img src="images/pixel_trans.gif" border="0" alt width="100%" height="10"></td>
+      </tr>
+      <!-- change from here to above-->
+    </table>
+    </td>
+    <td width="5" background="templates/Pixame_v1/images/infobox/box_bg_r.gif">
+    <img src="templates/Pixame_v1/images/infobox/box_bg_r.gif" width="5" height="1"></td>
+  </tr>
+</table>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td>
+    <img src="templates/Pixame_v1/images/infobox/infobox_footer_left.gif" border="0" alt width="22" height="24"></td>
+    <td background="templates/Pixame_v1/images/infobox/infobox_footer_middle.gif" width="100%">
+    <img src="images/pixel_trans.gif" border="0" alt width="100%" height="1"></td>
+    <td>
+    <img src="templates/Pixame_v1/images/infobox/infobox_footer_right.gif" border="0" alt width="22" height="24"></td>
+  </tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Featured Products V1.1
+  Displays a list of featured products, selected from admin
+  For use as an Infobox instead of the "New Products" Infobox
+*/
+?>
+<!-- featured_products_mainpage //-->
+<?php
+ 
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+      $featured_products_2bb_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                              " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(),p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
+   
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($featured_products_2bb = tep_db_fetch_array($featured_products_2bb_query)) {
+
+    $num ++;
+  
+    if ($num == 1) {
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+    }    
+
+  $pf->loadProduct($featured_products_2bb['products_id'],$languages_id);
+        $products_price_2bb = $pf->getPriceStringShort();
+
+
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products_2bb['products_image'], $featured_products_2bb['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . $featured_products_2bb['products_name'] . '</a><br>' . $products_price_2bb);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+  }
+ 
+?>
+<!-- featured_products_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/main_categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/main_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/main_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,184 @@
+<?php
+/*
+  $Id: main_categories.php,v 1.0a 2002/08/01 10:37:00 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Barreto
+  Gustavo Barreto <gustavo at barreto.net>
+  http://www.barreto.net/
+
+  Based on: all_categories.php Ver. 1.6 by Christian Lescuyer
+
+  History: 1.0 Creation
+     1.0a Correction: Extra Carriage Returns
+     1.1  added parameters to change display options -- mdt
+
+  Released under the GNU General Public License
+
+*/
+
+//------------------------------------------------------------------------------------------------------
+// PARAMETERS
+//------------------------------------------------------------------------------------------------------
+
+$item_column_number = 3;    // range of 1 to 9
+$item_title_on_newline = true;  // true or false
+
+// for item and subcategory options, suugest that you just put in CSS code
+// you can also just define a class and then change it in a template addon like BTS
+$item_div_options = 'style="text-align:center;font-weight:bold;font-size:larger;margin-top:5px;"';
+$item_subcategories_options = '';
+
+//------------------------------------------------------------------------------------------------------
+// CODE - do not change below here
+//------------------------------------------------------------------------------------------------------
+
+// error checking on parameters
+if($item_column_number < 1)
+{
+  $item_column_number = 1;
+}
+if($item_column_number > 9)
+{
+  $item_column_number = 9;
+}
+if($item_title_on_newline)
+{
+  $item_separator = '<br>';
+} else {
+  $item_separator = '&nbsp;';
+}
+
+// preorder_mc tree traversal
+  function preorder_mc($cid_cat, $level_cat, $foo_cat, $cpath_cat)
+  {
+    global $categories_string_cat, $HTTP_GET_VARS;
+
+// Display link
+    if ($cid_cat != 0) {
+      for ($i=0; $i<$level_cat; $i++)
+        $categories_string_cat .=  '&nbsp;&nbsp;';
+      $categories_string_cat .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath
+=' . $cpath_cat . $cid_cat) . '">';
+// 1.6 Are we on the "path" to selected category?
+      $bold = strstr($HTTP_GET_VARS['cPath'], $cpath_cat . $cid_cat . '_') || $HTTP_GET_VARS['cPath'] == $cpath_cat . $cid_cat;
+// 1.6 If yes, use <b>
+      if ($bold)
+        $categories_string_cat .=  '<b>';
+      $categories_string_cat .=  $foo_cat[$cid_cat]['name'];
+      if ($bold)
+        $categories_string_cat .=  '</b>';
+      $categories_string_cat .=  '</a>';
+// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+      if (SHOW_COUNTS == 'true') {
+        $products_in_category = tep_count_products_in_category($cid_cat);
+        if ($products_in_category > 0) {
+          $categories_string_cat .= '&nbsp;(' . $products_in_category . ')';
+        }
+      }
+      $categories_string_cat .= '<br>';
+    }
+
+// Traverse category tree
+    if (is_array($foo_cat)) {
+      foreach ($foo_cat as $key => $value) {
+        if ($foo_cat[$key]['parent'] == $cid_cat) {
+          preorder_mc($key, $level_cat+1, $foo_cat, ($level_cat != 0 ? $cpath_cat . $cid_cat . '_' : ''));
+        }
+      }
+    }
+  }
+
+?>
+<!-- main_categories //-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES_MAIN_PAGE);
+  new infoBoxHeading($info_box_contents, true, true);
+
+
+//////////
+// Get categories list
+//////////
+
+$query_cat = "select 
+  c.categories_id, 
+  cd.categories_name, 
+  c.categories_image,
+  c.parent_id from 
+  " . TABLE_CATEGORIES . " c,
+  " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+  where 
+  c.parent_id = '0' 
+ and c.categories_id = cd.categories_id 
+ and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+
+  $categories_query_cat = tep_db_query($query_cat);
+
+
+// Initiate tree traverse
+$categories_string_cat = '';
+preorder_mc(0, 0, $foo_cat, '');
+
+//////////
+// Display box contents
+//////////
+
+$info_box_contents = array();
+
+$row = 0;
+$col = 0;
+while ($categories_cat = tep_db_fetch_array($categories_query_cat))
+{
+  if ($categories['parent_id'] == 0)
+    {
+      $cpath_cat_new = tep_get_path($categories_cat['categories_id']);
+      $text_subcategories = '';
+      $subcategories_query_cat = tep_db_query($query_cat);
+      while ($subcategories_cat = tep_db_fetch_array($subcategories_query_cat))
+      {
+        if ($subcategories_cat['parent_id'] == $categories_cat['categories_id'])
+      {
+                $cPath_new_sub = "cPath="  . $categories_cat['categories_id'] . "_" . $subcategories_cat['categories_id'];
+                $text_subcategories .= '• <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">';
+                $text_subcategories .= $subcategories_cat['categories_name'] . '</a>' . " ";
+
+          } // if ($subcategories['parent_id'] == $categories['categories_id'])
+
+      } // while ($subcategories = tep_db_fetch_array($subcategories_query))
+
+    $info_box_contents[$row][$col] = array('align' => 'left',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cpath_cat_new) . '">' . tep_image(DIR_WS_IMAGES . $categories_cat['categories_image'], $categories_cat['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories_cat['categories_name'] . '</a></DIV>');
+
+      // determine the column position to see if we need to go to a new row
+      $col ++;
+      if ($col > ($item_column_number - 1))
+      {
+          $col = 0;
+          $row ++;
+
+      } //if ($col > ($number_of_columns - 1))
+
+    } //if ($categories['parent_id'] == 0)
+
+} // while ($categories = tep_db_fetch_array($categories_query))
+
+//output the contents
+new contentBox($info_box_contents);
+$info_box_contents = array();
+$info_box_contents[] = array('align' => 'left',
+                             'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+
+?>
+<!-- main_categories_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: mainpage.php,v 2.1 2004/04/07
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+  to change the contents of this file edit
+  includes/languages/(language)/mainpage.php
+*/
+?>
+<!-- mainpage //-->
+
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, HEADING_TITLE);
+}
+// EOF: Lango Added for template MOD
+
+
+include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE);
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<!-- Main_page eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/new_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/new_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/new_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,75 @@
+<?php
+/*
+  $Id: new_products.php,v 1.1.1.1 2004/03/04 23:41:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- mainpages_modules.new_products.php//-->
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
+
+  
+      $new_products_query = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+       order by rand(), p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
+
+  
+
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($new_products = tep_db_fetch_array($new_products_query)) {
+  
+    $num ++;
+      if ($num == 1) { 
+  new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));
+      }
+
+  $pf->loadProduct($new_products['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+
+  
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $products_price_s);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+if($num) {
+  new contentBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+}
+
+?>
+<!-- new_products_eof //-->

Added: trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/mainpage_modules/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: upcoming_products.php,v 1.1.1.3 2004/04/07 23:42:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- upcoming_products mainpage_modules //-->
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_UPCOMING_PRODUCTS, strftime('%B')));
+
+    $expected_query_raw= tep_db_query("select
+ p.products_id,
+ pd.products_name, 
+ p.products_image, 
+    products_date_available as date_expected 
+ from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+    where 
+    to_days(products_date_available) >= to_days(now()) 
+    and p.products_id = pd.products_id 
+    and pd.language_id = '" . (int)$languages_id . "' 
+    order by rand()
+    limit " . MAX_DISPLAY_UPCOMING_PRODUCTS);
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($expected_query = tep_db_fetch_array($expected_query_raw)) {
+  
+    $num ++;
+      if ($num == 1) { 
+    new contentBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
+      }
+  $pf->loadProduct($expected_query['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+    
+   $duedate= str_replace("00:00:00", "" , $expected_query['date_expected']);  
+   
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $expected_query['products_image'], $expected_query['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . $expected_query['products_name'] . '</a><br>' . $products_price_s . '<br>' . TABLE_HEADING_DATE_EXPECTED . '&nbsp;' . $duedate);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+if($num) {
+new contentBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents, true, true);
+}
+
+?>
+<!-- upcoming_products_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,755 @@
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  .cat_description {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #800000;
+     background : inherit;
+     font-weight : bold;
+      }
+ .boxText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #800000;
+     background : inherit;
+      }
+ .maintableBorder {
+     background-color : #ff9900;
+     color : inherit;
+      }
+ .maintableBackground {
+     background-color : #ffffff;
+     color : inherit;
+      }
+ .column_left {
+     background-color : #2d6dc5;
+     color : inherit;
+      }
+ .centertable {
+     border-left : 1px solid #798ccc;
+     background-image : url('images/bg_cat4.gif');
+     background-repeat : repeat-x;
+     font-family : Verdana, Arial, sans-serif;
+     border-right : 1px solid #798ccc;
+     color : #000000;
+     background-color : #d2dbf5;
+      }
+ .errorBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : inherit;
+     background : #ffb3b5;
+     font-weight : bold;
+      }
+ .stockWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #cc0033;
+     background : inherit;
+      }
+ .productsNotifications {
+     background : #f2fff7;
+     color : inherit;
+      }
+ .orderEdit {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #70d250;
+     background : inherit;
+     text-decoration : underline;
+      }
+ .navBlue {
+     color : #ff0000;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ .subnavBlue {
+     color : #9966ff;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ body {
+     background : #f5f7fc;
+     color : #000000;
+     margin : 0;
+      }
+ A {
+     background : inherit;
+     color : #000000;
+     text-decoration : none;
+      }
+ A:hover {
+     background : inherit;
+     color : #aabbdd;
+     text-decoration : underline;
+      }
+ FORM {
+     display : inline;
+      }
+ TR.header {
+     color : inherit;
+     background : #ffffff;
+      }
+ TR.headerNavigation {
+     color : inherit;
+     background : #bbc3d3;
+      }
+ TD.headerNavigation {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ A.headerNavigation {
+     color : #ffffff;
+     background : inherit;
+      }
+ a:hover.headerNavigation {
+     color : #ffffff;
+     background : inherit;
+      }
+ TR.headerError {
+     color : inherit;
+     background : #ff0000;
+      }
+ TD.headerError {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ff0000;
+     color : #ffffff;
+     font-weight : bold;
+     text-align : center;
+      }
+ TR.headerInfo {
+     background : #00ff00;
+     color : inherit;
+      }
+ TD.headerInfo {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #00ff00;
+     color : #ffffff;
+     font-weight : bold;
+     text-align : center;
+      }
+ TR.footer {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.footer {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-image : url(images/links_middle.gif);
+     background-repeat : repeat-x;
+     background : #2d6ec5;
+     color : #000000;
+     font-weight : bold;
+      }
+ .templateinfobox {
+     background : #E4EAFC;
+     color : inherit;
+     font-family : Verdana, Helvetica, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .infoBox {
+     color : inherit;
+     background : #E4EAFC;
+      }
+ TD.infoBox, SPAN.infoBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #E4EAFC;
+     color : inherit;
+      }
+ TD.infoBoxHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     text-align : center;
+     vertical-align : top;
+     background : inherit;
+     color : #000000;
+      }
+ .infoBoxContents {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.infoBoxFooter {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+     color : #ffffff;
+      }
+ TD.contentBoxHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     text-align : center;
+     color : #C8D0E0;
+     background : #E4EAFC;
+     padding-top : 5px;
+      }
+ .infoBoxContentsHeader {
+     color : inherit;
+     background : inherit;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     text-align : center;
+     vertical-align : top;
+      }
+
+ .infoBoxContentsCenter {
+    color : inherit;
+    background : #E4EAFC;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+    background-color : inherit;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ TD.infoBoxHeadingImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     text-align : center;
+     vertical-align : top;
+     background-image : url('images/infobox/background.gif');
+     background-repeat : repeat-x;
+     background-position : left;
+     background-color : #fbfcfd;
+     color : #000000;
+      }
+ TD.infoBoxFooterImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-color : #fbfcfd;
+     background-image : url(images/infobox/backgroundfb.gif);
+     background-repeat : repeat-x;
+     background-position : left;
+     color : #000000;
+      }
+ .infoBoxNotice {
+     color : inherit;
+     background : #ff8e90;
+      }
+ .infoBoxNoticeContents {
+     color : inherit;
+     background : #ffe6e6;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.main_table_heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     border-width : thin;
+     border-color : #cccccc;
+     border-style : solid;
+     background : #E4EAFC;
+     color : #000000;
+      }
+ TD.main_table_heading_inner {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #E4EAFC;
+     color : #000000;
+      }
+ TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TABLE.productListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .productListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #b6b7cb;
+     color : #000000;
+     font-weight : bold;
+      }
+ .productlisting-headingPrice {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     font-weight : bold;
+     color : #9a9a9a;
+     background : inherit;
+      }
+ TD.productListing-data {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ A.pageResults {
+     color : #0000ff;
+     background : inherit;
+      }
+ a:hover.pageResults {
+     color : #0000ff;
+     background : #ffff33;
+      }
+ TD.pageHeading, DIV.pageHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     font-weight : bold;
+     color : #9a9a9a;
+     background : inherit;
+      }
+ TR.subBar {
+     background : #f4f7fd;
+     color : inherit;
+      }
+ TD.subBar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ TD.main, P.main {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+      }
+ TD.smallText, SPAN.smallText, P.smallText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.accountCategory {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 13px;
+     color : #aabbdd;
+     background : inherit;
+      }
+ TD.fieldKey {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.fieldValue {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+      }
+ TD.tableHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.category_desc {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+      }
+ SPAN.newItemInCart {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ CHECKBOX, INPUT, RADIO, SELECT {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ TEXTAREA {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ SPAN.greetUser {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #f0a480;
+     background : inherit;
+     font-weight : bold;
+      }
+ TABLE.formArea {
+     color : inherit;
+     background : #f1f9fe;
+     border-color : #7b9ebd;
+     border-style : solid;
+     border-width : 1px;
+      }
+ TD.formAreaTitle {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ SPAN.markProductOutOfStock {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #c76170;
+     background : inherit;
+     font-weight : bold;
+      }
+ SPAN.productSpecialPrice {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ SPAN.errorText {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ .moduleRowOver {
+     background-color : #d7e9f7;
+     color : inherit;
+     cursor : pointer;
+      }
+ .moduleRowSelected {
+     background-color : #e9f4fc;
+     color : inherit;
+      }
+ .checkoutBarFrom, .checkoutBarTo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #8c8c8c;
+     background : inherit;
+      }
+ .checkoutBarCurrent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ .messageBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .messageStackError, .messageStackWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #ffb3b5;
+     color : inherit;
+      }
+ .messageStackSuccess {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #99ff00;
+     color : inherit;
+      }
+ .inputRequirement {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ TABLE.linkListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .linkListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bdcaf3;
+     color : #ffffff;
+     text-align : center;
+      }
+ TD.linkListing-data {
+     border-right : 1px solid #b6b7cb;
+     border-bottom : 1px solid #b6b7cb;
+     padding : 4px;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TR.linkListing-odd {
+     background : #f5f7fc;
+     color : inherit;
+      }
+ TR.linkListing-even {
+     background : #f5f5f5;
+     color : inherit;
+      }
+ .content {
+     background : inherit;
+     color : #000000;
+     font-size : 10px;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #bdcaf0;
+     background : inherit;
+      }
+ TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+     background-image : url('images/button_blank_left.gif');
+      }
+ TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+     background-image : url('images/button_blank_right.gif');
+      }
+ TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+     background-image : url('images/button_blank_middle.gif');
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-color : inherit;
+     color : #000000;
+      }
+ A.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     color : #000000;
+     background : inherit;
+      }
+ a:hover.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+     color : #00ff00;
+      }
+ TD.cookieUsage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #000000;
+     color : #ffffff;
+      }
+ .attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TR.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TD.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #c0c0c0;
+      }
+ .storyboxtitle {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:link {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:active {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:visited {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:hover {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ffffff;
+     font-size : 10px;
+     font-weight : bold;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .yearHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 14px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+      }
+ .calendarMonth {
+     background-color : #cccccc;
+     color : inherit;
+     cursor : default;
+     width : 100%;
+      }
+ .calendarHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     height : 22px;
+      }
+ .calendarToday {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffcf00;
+     padding-left : 3px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendarWeekend {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #caeeff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffffff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     height : 22px;
+     width : 18px;
+      }
+ .event {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     border : 1px solid #e6e6e6;
+      }
+ .empty {
+     background-color : #f0faff;
+     color : inherit;
+     line-height : 14px;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ h4.infoTitle {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 0.2em;
+      }
+ p.infoBlurb {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 2em;
+      }
+ TD.productPriceInListing {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #d2e9fb;
+     color : inherit;
+      }
+ TD.productPriceInBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #eeeeee;
+     color : inherit;
+      }
+ TD.productPriceInProdInfo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ccffcc;
+     color : inherit;
+      }
+ #navMenu {
+     clear : both;
+     height : 0.01%;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu ul {
+     float : left;
+     width : 150px;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu li {
+     position : relative;
+     float : left;
+     line-height : 24px;
+     margin-bottom : -1px;
+     width : 150px;
+      }
+ #navMenu li ul {
+     position : absolute;
+     left : -999em;
+     margin-left : 150px;
+     margin-top : -26px;
+      }
+ #navMenu li ul ul {
+     left : -999em;
+      }
+ #navMenu li a {
+     width : 150px;
+     display : block;
+     color : #334;
+     font-weight : bold;
+     text-decoration : none;
+     background : #ffffff;
+     border : 1px solid #cce;
+     padding-left : 2px;
+      }
+ #navMenu li a:hover {
+     color : #000000;
+     background : #aac;
+      }
+ #navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+     left : -999em;
+      }
+ #navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+     left : auto;
+      }

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/doc/buttonspec.txt
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1ats/doc/buttonspec.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1ats/doc/buttonspec.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,26 @@
+Helius and Pixame_v1 2 Buttons
+This file is intended to help adding more buttons when they are needed.
+It purpose is to discribe how the button were made so that they
+can be duplicated in the future.
+
+Original Spec:
+   Background color: R 0 G 0 B 0
+   Boarder color:  R 0  G 38  B 138
+   Drop shadow: R 153  G 153  B 153
+   height: 14 Pixels
+   Font: Unkowen 
+---------------------------------------------------
+New
+Button Software: Deknop
+Formate: .gif
+LZW compression: Ulead photoimpact SE 4.2.
+
+ Background color: R 0 G 0 B 0
+   Boarder color:  R 0  G 38  B 138
+   Drop shadow: R 153  G 153  B 153
+   height: 14 Pixels 
+   Width: variable
+Font: Arial
+Font style: Bold
+Font Size: 10 points
+Font color: R:0 G:38 B: 138 (white)

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/footer.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1ats/footer.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1ats/footer.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+  $Id: footer.php,v 1.26 2003/02/10 22:30:54 hpdl Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+
+
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+  require(DIR_WS_INCLUDES . FILENAME_COUNTER);
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+  <td width="5"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_left.gif" width="5" height="25" alt="image"></td>
+     <td class="footer" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/links_middle.gif)"> &nbsp;&nbsp;<?php echo strftime(DATE_FORMAT_LONG); ?>&nbsp;&nbsp;</td>
+       <td class="footer" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/links_middle.gif)" align ="right">&nbsp;&nbsp;<?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>&nbsp;&nbsp;</td>
+  <td width="5"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_right.gif" width="5" height="25" alt="image"></td>
+  </tr>
+</table>
+<!-- footer_eof //-->
+<?php } ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/header.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1ats/header.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1ats/header.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide header if not to show
+if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') {
+if (SITE_WIDTH!='100%') {
+?>
+<table width="<?php echo SITE_WIDTH; ?>" cellpadding="0" cellspacing="0" border="0" align="center">
+  <tbody>
+  <tr>
+    <td>
+    <table CELLSPACING="0" CELLPADDING="0" BORDER="0" width="<?php echo SITE_WIDTH; ?>" align="center">
+      <tbody>
+      <tr>
+        <td>
+        <table border="0" width="100%">
+          <tbody>
+          <tr>
+            <td>
+      <?php } ?>
+            <div align="center">
+              <br>
+              <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                <tbody>
+                <tr>
+                  <td width="500">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_title.gif" width="421" height="73" alt="<?php echo IMAGE_ALT;?>"></td>
+           <td style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/header_background.gif)" width="100%" height="73">
+      <?php if (SHOW_CART_IN_HEADER=='yes') { ?>
+                  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                    <tbody>
+                    <tr class="header">
+                      <td class="ShowCartDetails" align="right" height="30" valign="middle">
+                      <?php echo '<a class="ShowCartDetails" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/kart1.gif') . '</a>&nbsp;&nbsp;[ ' . $cart->count_contents() . ($cart->count_contents() == "1" ? " Item" : " Items "); ?> &nbsp;&nbsp; <?php echo $currencies->format($cart->show_total()); ?> &nbsp;&nbsp; <?php echo $cart->show_weight() . ($cart->show_weight() == "1" ? " lb" : " lbs ");?>&nbsp;] </td>
+                    </tr>
+                  </tbody>
+                  </table>
+<?php
+// Bof Shopping Cart Box Enhancement
+$showcheckoutbutton = 1; // set to 1: show checkout button (default); set to 0: never show checkout button
+$showhowmuchmore = 1;    // set to 1: show how much more to spend for free shipping (default); set to 0: don't show
+
+echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
+
+
+
+if (($showcheckoutbutton==1)&&($cart->count_contents() > 0)) {
+  echo '<tr><td align="center"><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_template_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a></td></tr>';
+}
+echo '</table>';
+
+// Eof Shopping Cart Box Enhancement
+
+
+      } ?>
+                  </td>
+                  <td>
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/header_right.gif" width="80" height="73" alt="<?php echo IMAGE_ALT;?>"></td>
+                </tr>
+              </tbody>
+              </table>
+              <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                <tbody>
+                <tr>
+                  <td width="345">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/slogan.gif" width="345" height="23" alt="<?php echo IMAGE_ALT;?>"></td>
+           <td width="100%" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/slogan_middle.gif)">
+                  </td>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt=<?php echo IMAGE_ALT;?>"></td>
+                </tr>
+              </tbody>
+              </table>
+               <table width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+                <tbody>
+                <tr>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="<?php echo IMAGE_ALT;?>"></td>
+                  <td width="33%" bgcolor="#D2DBF5"></td>
+                  <td width="77%" bgcolor="#D2DBF5" align="right">
+
+<?php
+// show languages in header
+  if (SHOW_LANGUAGES_IN_HEADER=='yes') require(DIR_WS_INCLUDES . 'languages_in_header.php'); ?></td>
+                  <td width="5" bgcolor="#D2DBF5">&#160;</td>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="<?php echo IMAGE_ALT;?>"></td>
+                </tr>
+              </tbody>
+              </table>
+<?php
+// show link buttons in header
+ if (SHOW_HEADER_LINK_BUTTONS=='yes')  include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/links.htm');
+?>
+              <table width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+                <tr>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="<?php echo IMAGE_ALT;?>"></td>
+                  <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                  <td bgcolor="#D2DBF5">&nbsp;</td>
+                  <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                  <td width="1" bgcolor="#798CCC">
+                  <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="<?php echo IMAGE_ALT;?>"></td>
+                </tr>
+              </table>
+            </div>
+
+<?php } ?>
+<!-- header_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/Pixame_v1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/Pixame_v1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/Pixel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/Pixel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/arrow.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/arrow.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/bg_cat4.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/bg_cat4.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/block_space_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/block_space_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/block_space_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/block_space_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_add_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_add_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_add_wishlist.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_add_wishlist.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_address_book.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_address_book.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_build_a_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_build_a_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_clickthroughs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_clickthroughs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_sales.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_affiliate_sales.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_back.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_back.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_banners.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_banners.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_buy_now.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_buy_now.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_change_address.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_change_address.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_checkout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_checkout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_confirm.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_confirm.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_confirm_order.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_confirm_order.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_continue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_continue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_continue_shopping.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_continue_shopping.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_create_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_create_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_edit_account.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_edit_account.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_history.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_history.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_in_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_in_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_login.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_login.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_ppcheckout.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_ppcheckout.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_printorder.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_printorder.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_quick_find.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_quick_find.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_redeem.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_redeem.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_remove_notifications.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_remove_notifications.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_reviews.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_reviews.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_search.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_search.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_send.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_send.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_shipping_options.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_shipping_options.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_submit_link.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_submit_link.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_tell_a_friend.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_tell_a_friend.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_update.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_update.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_update_cart.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_update_cart.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_write_review.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/button_write_review.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/image_enlarge.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/image_enlarge.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/small_delete.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/small_delete.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/small_edit.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/small_edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/small_view.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/buttons/english/small_view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/footer_left_b.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/footer_left_b.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/footer_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/footer_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/footer_right_b.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/footer_right_b.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/header_background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/header_background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/header_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/header_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/header_title.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/header_title.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/background.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/background.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/backgroundfb.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/backgroundfb.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bar_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bar_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bar_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bar_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bar_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bar_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bottom_center.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/bottom_center.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/box_bg_l.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/box_bg_l.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/box_bg_r.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/box_bg_r.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_left_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right_bot.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right_bot.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right_flip.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right_flip.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/corner_right_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/infobox_footer_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/infobox_footer_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/infobox_footer_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/infobox_footer_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/infobox_footer_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/infobox_footer_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/no_arrow_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/no_arrow_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/pixel.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/pixel.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/pixel_trans.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/pixel_trans.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/q1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/q1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/q2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/q2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/r1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/r1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/r2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/infobox/r2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/kart1.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/kart1.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/links_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/links_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/links_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/links_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/links_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/links_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/pointer_blue.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/pointer_blue.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/pointer_blue_light.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/pointer_blue_light.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/slogan.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/slogan.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/slogan_middle.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/slogan_middle.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/space_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/space_left.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/space_right.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/Pixame_v1ats/images/space_right.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/install.sql
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1ats/install.sql	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1ats/install.sql	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'card1.php', 'BOX_HEADING_CARD1', 'yes', 'right', 10, now(), now(), 'Cards We Accept', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'downloads.php', 'BOX_HEADING_DOWNLOADS', 'yes', 'right', 8, now(), now(), 'You Have a Download', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'donate.php', 'BOX_HEADING_DONATE', 'yes', 'right', 9, now(), now(), 'Donate', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'currencies.php', 'BOX_HEADING_CURRENCIES', 'yes', 'right', 7, now(), now(), 'Currencies', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'yes', 'right', 5, now(), now(), 'Order History', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'languages.php', 'BOX_HEADING_LANGUAGES', 'yes', 'right', 6, now(), now(), 'Languages', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'yes', 'right', 4, now(), now(), 'Best Sellers', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'customer_gv.php', 'BOX_HEADING_GIFT_VOUCHER', 'yes', 'right', 2, now(), now(), 'Gift Voucher', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'loginbox.php', 'BOX_HEADING_LOGIN', 'yes', 'right', 3, now(), now(), 'Your Account', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'yes', 'right', 1, now(), now(), 'Shopping Cart', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'googlead.php', 'BOX_GOOGLE_AD_BANNER_HEADING', 'yes', 'left', 22, now(), now(), 'Google Ad', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whos_online.php', 'BOX_HEADING_WHOS_ONLINE', 'yes', 'left', 21, now(), now(), 'Who''s Online', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'links.php', 'BOX_HEADING_LINKS', 'yes', 'left', 20, now(), now(), 'Links', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'featured.php', 'BOX_HEADING_FEATURED', 'yes', 'left', 18, now(), now(), 'Featured', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'affiliate.php', 'BOX_HEADING_AFFILIATE', 'yes', 'left', 19, now(), now(), 'Affiliate Info', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'shop_by_price.php', 'BOX_HEADING_SHOP_BY_PRICE', 'yes', 'left', 17, now(), now(), 'Shop by Price', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'yes', 'left', 16, now(), now(), 'Latest products', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'tell_a_friend.php', 'BOX_HEADING_TELL_A_FRIEND', 'yes', 'left', 15, now(), now(), 'Tell A Friend', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'product_notifications.php', 'BOX_HEADING_NOTIFICATIONS', 'yes', 'left', 14, now(), now(), 'Notifications', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'yes', 'left', 13, now(), now(), 'Manufacturers Info', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'yes', 'left', 12, now(), now(), 'Manufacturers', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search.php', 'BOX_HEADING_SEARCH', 'yes', 'left', 11, now(), now(), 'Quick Find', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'reviews.php', 'BOX_HEADING_REVIEWS', 'yes', 'left', 9, now(), now(), 'Reviews', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'specials.php', 'BOX_HEADING_SPECIALS', 'yes', 'left', 10, now(), now(), 'Specials', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'yes', 'left', 7, now(), now(), 'Select Template', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories3.php', 'BOX_HEADING_CATEGORIES3', 'no', 'left', 5, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories4.php', 'BOX_HEADING_CATEGORIES4', 'yes', 'left', 6, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories1.php', 'BOX_HEADING_CATEGORIES1', 'no', 'left', 3, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories2.php', 'BOX_HEADING_CATEGORIES2', 'no', 'left', 4, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories.php', 'BOX_HEADING_CATEGORIES', 'no', 'left', 2, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'articles.php', 'BOX_HEADING_ARTICLES', 'yes', 'left', 23, now(), now(), 'Articles', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'calendar.php', 'BOX_HEADING_CALENDER', 'yes', 'left', 24, now(), now(), 'Upcoming Events', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'categories5.php', 'BOX_HEADING_CATEGORIES5', 'no', 'left', 8, now(), now(), 'Categories', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'faq.php', 'BOX_HEADING_FAQ', 'yes', 'left', 26, now(), now(), 'Faq', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'information_table.php', 'BOX_HEADING_INFORMATION_TABLE', 'yes', 'left', 28, now(), now(), 'Information', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'authors.php', 'BOX_HEADING_AUTHORS', 'yes', 'left', 25, now(), now(), 'Authors', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'asearch.php', 'BOX_HEADING_ASEARCH', 'yes', 'left', 29, now(), now(), 'Article Search', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'wishlist.php', 'BOX_HEADING_WISHLIST', 'yes', 'right', 12, now(), now(), 'Wishlist', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'boxad.php', 'BOX_AD_BANNER_HEADING', 'yes', 'right', 13, now(), now(), 'Advertise', 'infobox', '#000000');
+INSERT INTO infobox_configuration VALUES ('#tID#', '', 'search1.php', 'BOX_HEADING_SEARCH1', 'yes', 'right', 11, now(), now(), 'Advance Search', 'infobox', '#000000');
+UPDATE template SET date_added= now(), last_modified= now(), template_image= "Pixame_v1.gif", template_cellpadding_main ="3", template_cellpadding_sub= "8", template_cellpadding_left= "5", template_cellpadding_right= "5", site_width= "776", include_column_left= "yes", include_column_right= "yes", box_width_left= "155", box_width_right= "155", main_table_border= "yes", active= "1", languages_in_header= "no", cart_in_header= "no", show_header_link_buttons="no", module_one= "mainpage.php", module_two= "featured.php", module_three= "", module_four= "", module_five= "", module_six= "", customer_greeting= "yes", side_box_left_width="5", side_box_right_width="5" WHERE template_id="#tID#"
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/links.htm
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1ats/links.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1ats/links.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,41 @@
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr>
+    <td width="5">
+    <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_left.gif" width="5" height="25" alt="image"></td>
+   <td style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/links_middle.gif)">
+      <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_LINKS_DEFAULT . '</a>';?>&nbsp;&nbsp;&nbsp;
+<?php
+      if (!tep_session_is_registered('noaccount')){// DDB - PWA - 040622 - no display of logoff for PWA customers
+         if (!tep_session_is_registered('customer_id')) {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_LINKS_LOGIN . '</a>&nbsp;&nbsp;&nbsp;';
+          } else {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ACCOUNT, "", "SSL") . '">' . HEADER_LINKS_ACCOUNT_INFO . '</a>&nbsp;&nbsp;&nbsp;';
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_LINKS_LOGOFF . '</a>&nbsp;&nbsp;&nbsp;';
+          }
+         }
+
+     if (tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers
+       {
+     if (!tep_session_is_registered('customer_id')) {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN, "", "SSL") . '">' . HEADER_LINKS_LOGIN . '</a>&nbsp;&nbsp;&nbsp;';
+   }else{
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_LINKS_LOGOFF . '</a>&nbsp;&nbsp;&nbsp;';
+      }
+      }
+
+   echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_SPECIALS) . '">' . HEADER_LINKS_SPECIALS . '</a>&nbsp;&nbsp;&nbsp;';
+     ?>
+    <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif\" alt=\"image\"') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . HEADER_LINKS_WHATS_NEW . '</a>';?>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8" alt="image">
+      <a class="HeaderPageLinks" href="#">MEMBERS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8" alt="image">
+      <a class="HeaderPageLinks" href="#">DOWNLOADS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8" alt="image">
+      <a class="HeaderPageLinks" href="#">LINKS</a>&nbsp;&nbsp;&nbsp;
+   <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif\" alt=\"image\"') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ALLPRODS) . '">' . HEADER_LINKS_PRODUCTS_ALL . '</a>';?>&nbsp;&nbsp;&nbsp;
+   <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif\" alt=\"image\"') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">CONTACT US</a>';?>
+      </td>
+    <td width="5">
+    <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_right.gif" width="5" height="25" alt="image"></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/links1.htm
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1ats/links1.htm	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1ats/links1.htm	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr>
+    <td width="5">
+    <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_left.gif" width="5" height="25"></td>
+    <td background="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_middle.gif">
+    <div align="center">
+      <font class="storyboxtitle">
+      <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_LINKS_DEFAULT . '</a>';?>&nbsp;&nbsp;&nbsp;
+      <?php if (!tep_session_is_registered('customer_id')) {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGIN) . '">' . HEADER_LINKS_LOGIN . '</a>&nbsp;&nbsp;&nbsp;';
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_SPECIALS) . '">' . HEADER_LINKS_SPECIALS . '</a>&nbsp;&nbsp;&nbsp;';
+      } else {
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ACCOUNT) . '">' . HEADER_LINKS_ACCOUNT_INFO . '</a>&nbsp;&nbsp;&nbsp;';
+    echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_LOGOFF) . '">' . HEADER_LINKS_LOGOFF . '</a>&nbsp;&nbsp;&nbsp;';
+      }
+      ?>
+    <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . HEADER_LINKS_WHATS_NEW . '</a>';?>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8">
+      <a href="#">MEMBERS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8">
+      <a href="#">FORUMS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8">
+      <a href="#">DOWNLOADS</a>&nbsp;&nbsp;&nbsp;
+      <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/arrow.gif" width="4" height="8">
+      <a href="#">LINKS</a>&nbsp;&nbsp;&nbsp;
+   <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a class="HeaderPageLinks" href="' . tep_href_link(FILENAME_ALLPRODS) . '">' . HEADER_LINKS_PRODUCTS_ALL . '</a>';?>&nbsp;&nbsp;&nbsp;
+   <?php echo tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/arrow.gif') . ' <a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">CONTACT US</a>';?></font></div>
+     </font></div>
+    </td>
+    <td width="5">
+    <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/links_right.gif" width="5" height="25"></td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/main_page.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1ats/main_page.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1ats/main_page.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,202 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<?php
+if ( file_exists(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS) ) {
+  require(DIR_WS_INCLUDES . FILENAME_HEADER_TAGS);
+} else {
+?>
+  <title><?php echo TITLE ?></title>
+<?php
+}
+?>
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_STYLE;?>">
+<?php if (isset($javascript) && file_exists(DIR_WS_JAVASCRIPT . basename($javascript))) { require(DIR_WS_JAVASCRIPT . basename($javascript)); } ?>
+</head>
+<body>
+<!-- warnings //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_WARNINGS); ?>
+<!-- warning_eof //-->
+<!-- header //-->
+<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_HEADER); ?>
+<!-- header_eof //-->
+<!-- body //-->
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_MAIN; ?>" class="centertable" bgcolor="#798CCC">
+  <tr>
+<?php
+if (DISPLAY_COLUMN_LEFT == 'yes')  {
+// WebMakers.com Added: Down for Maintenance
+// Hide column_left.php if not to show
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_LEFT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_LEFT; ?>" valign="top" bgcolor="#D2DBF5"><table border="0" width="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_LEFT; ?>">
+<!-- left_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_LEFT); ?>
+<!-- left_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+<!-- content //-->
+    <td width="100%" valign="top" bgcolor="#D2DBF5">
+<?php
+if (isset($content_template) && file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/'.  basename($content_template))) {
+    require(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/' . $content . '.tpl.php');
+  } else if (file_exists(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/' . $content . '.tpl.php')) {
+    require(DIR_WS_TEMPLATES . TEMPLATE_NAME.'/content/'. $content . '.tpl.php');
+  }else if (isset($content_template) && file_exists(DIR_WS_CONTENT . basename($content_template)) ){
+    require(DIR_WS_CONTENT . basename($content_template));
+  } else {
+    require(DIR_WS_CONTENT . $content . '.tpl.php');
+  }
+?>
+    </td>
+<!-- content_eof //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide column_right.php if not to show
+
+if (DISPLAY_COLUMN_RIGHT == 'yes')  {
+if (DOWN_FOR_MAINTENANCE =='false' || DOWN_FOR_MAINTENANCE_COLUMN_RIGHT_OFF =='false') {
+?>
+    <td width="<?php echo BOX_WIDTH_RIGHT; ?>" valign="top" bgcolor="#D2DBF5"><table border="0" width="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="<?php echo CELLPADDING_RIGHT; ?>">
+<!-- right_navigation //-->
+<?php require(DIR_WS_INCLUDES . FILENAME_COLUMN_RIGHT); ?>
+<!-- right_navigation_eof //-->
+    </table></td>
+<?php
+}
+}
+?>
+  </tr>
+</table>
+<!-- body_eof //-->
+
+<!-- footer //-->
+<?php
+// WebMakers.com Added: Down for Maintenance
+// Hide footer.php if not to show
+if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') {
+require(DIR_WS_INCLUDES . FILENAME_COUNTER); ?>
+            <table width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+              <tr>
+                <td width="1" bgcolor="#798CCC">
+                <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td bgcolor="#D2DBF5">&nbsp;</td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td width="1" bgcolor="#798CCC">
+                <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+              </tr>
+            </table>
+<?php    include(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/'.FILENAME_LINKS_HTM);?>
+
+
+            <!-- footer //-->
+       <?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/'.FILENAME_FOOTER); ?>
+<!-- footer_eof //-->
+ <?php if (!(getenv('HTTPS')=='on')){
+  if (tep_banner_exists('dynamic','googlefoot') ) { ?>
+
+  <table bgcolor="#798CCC"width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+              <tr>
+                <td width="1" bgcolor="#798CCC"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td bgcolor="#D2DBF5">
+<?php 
+//google banner ad
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic', 'googlefoot'); ?></td>
+  </tr>
+</table>
+
+                </td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td width="1" bgcolor="#798CCC"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+              </tr>
+            </table>
+ <?php
+  } }
+?>
+ <?php if (tep_banner_exists('dynamic', '468x50') ) { ?>
+
+  <table bgcolor="#798CCC"width="100%" style="height:20" border="0" cellpadding="0" cellspacing="0">
+              <tr>
+                <td width="1" bgcolor="#798CCC"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td bgcolor="#D2DBF5">
+<?php 
+//google banner ad
+?>
+<br>
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td align="center"><?php echo tep_display_banner('dynamic',  '468x50'); ?></td>
+  </tr>
+</table>
+
+                </td>
+                <td width="5" bgcolor="#D2DBF5">&nbsp;</td>
+                <td width="1" bgcolor="#798CCC"><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/Pixel.gif" width="1" height="1" alt="image"></td>
+              </tr>
+            </table>
+ <?php
+  }
+?>
+ 
+           
+            <table width="100%" style="height: 20" border="0" cellpadding="0" cellspacing="0">
+              <tr>
+                <td width="75" height="71">
+                <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/footer_left_b.gif" width="75" height="71" alt="image"></td>
+             <td width="100%" align="center" style="background-image: url(<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME ;?>/images/footer_middle.gif)" height="10" class="smallText">
+
+<?php
+/*
+  The following copyright announcement can only be
+  appropriately modified or removed if the layout of
+  the site theme has been modified to distinguish
+  itself from the default osCommerce-copyrighted
+  theme.
+
+  For more information please read the following
+  Frequently Asked Questions entry on the osCommerce
+  support site:
+
+  http://www.oscommerce.com/community.php/faq,26/q,50
+
+  Please leave this comment intact together with the
+  following copyright announcement.
+*/
+
+  echo FOOTER_TEXT_BODY
+?>
+                </td>
+                <td width="75" height="71">
+                <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/footer_right_b.gif" width="75" height="71" alt="image"></td>
+              </tr>
+            </table>
+<?php
+}
+// BOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+if (SITE_WIDTH!='100%') {
+?>
+         </td></tr></table>
+       </td></tr>
+     </table>
+   </td>
+  </tr>
+</table>
+<?php
+}
+// EOF: WebMakers.com Added: Center Shop Bottom of the tables are in footer.php
+?>
+<!-- footer_eof //-->
+<br>
+</body>
+</html>

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/stylesheet.css
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1ats/stylesheet.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1ats/stylesheet.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,755 @@
+/*
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  .cat_description {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #800000;
+     background : inherit;
+     font-weight : bold;
+      }
+ .boxText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #800000;
+     background : inherit;
+      }
+ .maintableBorder {
+     background-color : #ff9900;
+     color : inherit;
+      }
+ .maintableBackground {
+     background-color : #ffffff;
+     color : inherit;
+      }
+ .column_left {
+     background-color : #2d6dc5;
+     color : inherit;
+      }
+ .centertable {
+     border-left : 1px solid #798ccc;
+     background-image : url('images/bg_cat4.gif');
+     background-repeat : repeat-x;
+     font-family : Verdana, Arial, sans-serif;
+     border-right : 1px solid #798ccc;
+     color : #000000;
+     background-color : #d2dbf5;
+      }
+ .errorBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : inherit;
+     background : #ffb3b5;
+     font-weight : bold;
+      }
+ .stockWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #cc0033;
+     background : inherit;
+      }
+ .productsNotifications {
+     background : #f2fff7;
+     color : inherit;
+      }
+ .orderEdit {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #70d250;
+     background : inherit;
+     text-decoration : underline;
+      }
+ .navBlue {
+     color : #ff0000;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ .subnavBlue {
+     color : #9966ff;
+     background : inherit;
+     font-size : 8pt;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ body {
+     background : #f5f7fc;
+     color : #000000;
+     margin : 0;
+      }
+ A {
+     background : inherit;
+     color : #000000;
+     text-decoration : none;
+      }
+ A:hover {
+     background : inherit;
+     color : #aabbdd;
+     text-decoration : underline;
+      }
+ FORM {
+     display : inline;
+      }
+ TR.header {
+     color : inherit;
+     background : #ffffff;
+      }
+ TR.headerNavigation {
+     color : inherit;
+     background : #bbc3d3;
+      }
+ TD.headerNavigation {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #bbc3d3;
+     color : #ffffff;
+     font-weight : bold;
+      }
+ A.headerNavigation {
+     color : #ffffff;
+     background : inherit;
+      }
+ a:hover.headerNavigation {
+     color : #ffffff;
+     background : inherit;
+      }
+ TR.headerError {
+     color : inherit;
+     background : #ff0000;
+      }
+ TD.headerError {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ff0000;
+     color : #ffffff;
+     font-weight : bold;
+     text-align : center;
+      }
+ TR.headerInfo {
+     background : #00ff00;
+     color : inherit;
+      }
+ TD.headerInfo {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #00ff00;
+     color : #ffffff;
+     font-weight : bold;
+     text-align : center;
+      }
+ TR.footer {
+     background : #bbc3d3;
+     color : inherit;
+      }
+ TD.footer {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-image : url(images/links_middle.gif);
+     background-repeat : repeat-x;
+     background : #2d6ec5;
+     color : #000000;
+     font-weight : bold;
+      }
+ .templateinfobox {
+     background : #E4EAFC;
+     color : inherit;
+     font-family : Verdana, Helvetica, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .infoBox {
+     color : inherit;
+     background : #E4EAFC;
+      }
+ TD.infoBox, SPAN.infoBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #E4EAFC;
+     color : inherit;
+      }
+ TD.infoBoxHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     text-align : center;
+     vertical-align : top;
+     background : inherit;
+     color : #000000;
+      }
+ .infoBoxContents {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.infoBoxFooter {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+     color : #ffffff;
+      }
+ TD.contentBoxHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     text-align : center;
+     color : #C8D0E0;
+     background : #E4EAFC;
+     padding-top : 5px;
+      }
+ .infoBoxContentsHeader {
+     color : inherit;
+     background : inherit;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     text-align : center;
+     vertical-align : top;
+      }
+
+ .infoBoxContentsCenter {
+    color : inherit;
+    background : #E4EAFC;
+    font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+}
+
+ TD.infoBoxContentsfooter {
+    color : #000000;
+    background-color : inherit;
+     font-family : Verdana, Arial, sans-serif;
+    font-size : 10px;
+    font-weight : bold;
+}
+
+ TD.infoBoxHeadingImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     text-align : center;
+     vertical-align : top;
+     background-image : url('images/infobox/background.gif');
+     background-repeat : repeat-x;
+     background-position : left;
+     background-color : #fbfcfd;
+     color : #000000;
+      }
+ TD.infoBoxFooterImage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-color : #fbfcfd;
+     background-image : url(images/infobox/backgroundfb.gif);
+     background-repeat : repeat-x;
+     background-position : left;
+     color : #000000;
+      }
+ .infoBoxNotice {
+     color : inherit;
+     background : #ff8e90;
+      }
+ .infoBoxNoticeContents {
+     color : inherit;
+     background : #ffe6e6;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.main_table_heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     border-width : thin;
+     border-color : #cccccc;
+     border-style : solid;
+     background : #E4EAFC;
+     color : #000000;
+      }
+ TD.main_table_heading_inner {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #E4EAFC;
+     color : #000000;
+      }
+ TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
+     background : #f8f8f9;
+     color : inherit;
+      }
+ TABLE.productListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .productListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #b6b7cb;
+     color : #000000;
+     font-weight : bold;
+      }
+ .productlisting-headingPrice {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     font-weight : bold;
+     color : #9a9a9a;
+     background : inherit;
+      }
+ TD.productListing-data {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ A.pageResults {
+     color : #0000ff;
+     background : inherit;
+      }
+ a:hover.pageResults {
+     color : #0000ff;
+     background : #ffff33;
+      }
+ TD.pageHeading, DIV.pageHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 20px;
+     font-weight : bold;
+     color : #9a9a9a;
+     background : inherit;
+      }
+ TR.subBar {
+     background : #f4f7fd;
+     color : inherit;
+      }
+ TD.subBar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ TD.main, P.main {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+      }
+ TD.smallText, SPAN.smallText, P.smallText {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TD.accountCategory {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 13px;
+     color : #aabbdd;
+     background : inherit;
+      }
+ TD.fieldKey {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.fieldValue {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+      }
+ TD.tableHeading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ TD.category_desc {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+      }
+ SPAN.newItemInCart {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ CHECKBOX, INPUT, RADIO, SELECT {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ TEXTAREA {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+      }
+ SPAN.greetUser {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #f0a480;
+     background : inherit;
+     font-weight : bold;
+      }
+ TABLE.formArea {
+     color : inherit;
+     background : #f1f9fe;
+     border-color : #7b9ebd;
+     border-style : solid;
+     border-width : 1px;
+      }
+ TD.formAreaTitle {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     font-weight : bold;
+      }
+ SPAN.markProductOutOfStock {
+     font-family : Tahoma, Verdana, Arial, sans-serif;
+     font-size : 12px;
+     color : #c76170;
+     background : inherit;
+     font-weight : bold;
+      }
+ SPAN.productSpecialPrice {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ SPAN.errorText {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ff0000;
+     background : inherit;
+      }
+ .moduleRowOver {
+     background-color : #d7e9f7;
+     color : inherit;
+     cursor : pointer;
+      }
+ .moduleRowSelected {
+     background-color : #e9f4fc;
+     color : inherit;
+      }
+ .checkoutBarFrom, .checkoutBarTo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #8c8c8c;
+     background : inherit;
+      }
+ .checkoutBarCurrent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background : inherit;
+      }
+ .messageBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ .messageStackError, .messageStackWarning {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #ffb3b5;
+     color : inherit;
+      }
+ .messageStackSuccess {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background-color : #99ff00;
+     color : inherit;
+      }
+ .inputRequirement {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #ff0000;
+     background : inherit;
+      }
+ TABLE.linkListing {
+     border : 1px;
+     border-style : solid;
+     border-color : #b6b7cb;
+     border-spacing : 1px;
+      }
+ .linkListing-heading {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #bdcaf3;
+     color : #ffffff;
+     text-align : center;
+      }
+ TD.linkListing-data {
+     border-right : 1px solid #b6b7cb;
+     border-bottom : 1px solid #b6b7cb;
+     padding : 4px;
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+      }
+ TR.linkListing-odd {
+     background : #f5f7fc;
+     color : inherit;
+      }
+ TR.linkListing-even {
+     background : #f5f5f5;
+     color : inherit;
+      }
+ .content {
+     background : inherit;
+     color : #000000;
+     font-size : 10px;
+     font-family : Verdana, Arial, sans-serif;
+      }
+ TR.ShowCartDetails, TD.ShowCartDetails, P.ShowCartDetails {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     line-height : 1.5;
+     color : #bdcaf0;
+     background : inherit;
+      }
+ TR.HeaderPageLinksLeft, TD.HeaderPageLinksLeft, P.HeaderPageLinksLeft {
+     background-image : url('images/button_blank_left.gif');
+      }
+ TR.HeaderPageLinksRight, TD.HeaderPageLinksRight, P.HeaderPageLinksRight {
+     background-image : url('images/button_blank_right.gif');
+      }
+ TR.HeaderPageLinks, TD.HeaderPageLinks, P.HeaderPageLinks {
+     background-image : url('images/button_blank_middle.gif');
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background-color : inherit;
+     color : #000000;
+      }
+ A.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     color : #000000;
+     background : inherit;
+      }
+ a:hover.HeaderPageLinks {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+     color : #00ff00;
+      }
+ TD.cookieUsage {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     font-weight : bold;
+     background : #000000;
+     color : #ffffff;
+      }
+ .attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TR.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #808080;
+      }
+ .TD.attributeBoxContent {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #c0c0c0;
+      }
+ .storyboxtitle {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:link {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:active {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:visited {
+     font-family : Verdana, Arial, sans-serif;
+     color : #000000;
+     font-size : 10px;
+     font-weight : bold;
+     background : inherit;
+      }
+ .storyboxtitle A:hover {
+     font-family : Verdana, Arial, sans-serif;
+     color : #ffffff;
+     font-size : 10px;
+     font-weight : bold;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .yearHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 14px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+      }
+ .calendarMonth {
+     background-color : #cccccc;
+     color : inherit;
+     cursor : default;
+     width : 100%;
+      }
+ .calendarHeader {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     font-weight : bold;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     height : 22px;
+      }
+ .calendarToday {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffcf00;
+     padding-left : 3px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendarWeekend {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #caeeff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     border : 1px solid #ffffff;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     color : #000000;
+     background-color : #ffffff;
+     padding-left : 3px;
+     line-height : 14px;
+     text-decoration : none;
+     height : 22px;
+     width : 18px;
+      }
+ .event {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 11px;
+     color : #000000;
+     background-color : #ffffff;
+     text-decoration : none;
+     border : 1px solid #e6e6e6;
+      }
+ .empty {
+     background-color : #f0faff;
+     color : inherit;
+     line-height : 14px;
+     height : 22px;
+     width : 18px;
+      }
+ .calendar A:hover, .calendar A:link, .calendar A:visited, .calendar A:visited:hover, .yearHeader A:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarWeekend A:hover, .calendarWeekend A:link, .calendarWeekend A:visited, .calendarWeekend A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ .calendarToday A:hover, .calendarToday A:link, .calendarToday A:visited, .calendarToday A:visited:hover {
+     color : red;
+     text-decoration : underline;
+     background : inherit;
+      }
+ h4.infoTitle {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 0.2em;
+      }
+ p.infoBlurb {
+     margin-top : 0;
+     margin-right : 0;
+     margin-left : 0;
+     margin-bottom : 2em;
+      }
+ TD.productPriceInListing {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #d2e9fb;
+     color : inherit;
+      }
+ TD.productPriceInBox {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 10px;
+     background : #eeeeee;
+     color : inherit;
+      }
+ TD.productPriceInProdInfo {
+     font-family : Verdana, Arial, sans-serif;
+     font-size : 12px;
+     background : #ccffcc;
+     color : inherit;
+      }
+ #navMenu {
+     clear : both;
+     height : 0.01%;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu ul {
+     float : left;
+     width : 150px;
+     margin : 0;
+     padding : 0;
+     list-style : none;
+      }
+ #navMenu li {
+     position : relative;
+     float : left;
+     line-height : 24px;
+     margin-bottom : -1px;
+     width : 150px;
+      }
+ #navMenu li ul {
+     position : absolute;
+     left : -999em;
+     margin-left : 150px;
+     margin-top : -26px;
+      }
+ #navMenu li ul ul {
+     left : -999em;
+      }
+ #navMenu li a {
+     width : 150px;
+     display : block;
+     color : #334;
+     font-weight : bold;
+     text-decoration : none;
+     background : #ffffff;
+     border : 1px solid #cce;
+     padding-left : 2px;
+      }
+ #navMenu li a:hover {
+     color : #000000;
+     background : #aac;
+      }
+ #navMenu li:hover ul ul, #navMenu li:hover ul ul ul, #navMenu li.sfhover ul ul, #navMenu li.sfhover ul ul ul {
+     left : -999em;
+      }
+ #navMenu li:hover ul, #navMenu li li:hover ul, #navMenu li li li:hover ul, #navMenu li.sfhover ul, #navMenu li li.sfhover ul, #navMenu li li li.sfhover ul {
+     left : auto;
+      }

Added: trunk/direct.openmoko.com/templates/Pixame_v1ats/template.php
===================================================================
--- trunk/direct.openmoko.com/templates/Pixame_v1ats/template.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/Pixame_v1ats/template.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  $Id: original.php,
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2005 CRE Loaded
+
+  Released under the GNU General Public License
+*/
+define('TEMPLATE_NAME', 'Pixame_v1ats');
+define('TEMPLATE_VERSION', '1.0');
+define('TEMPLATE_SYSTEM', 'ATS');
+define('TEMPLATE_AUTHOR', '');
+
+//used to get boxes from default
+define('DIR_FS_TEMPLATE_BOXES', DIR_FS_CATALOG . 'templates/default/boxes');
+define('DIR_FS_TEMPLATE_MAINPAGES', DIR_FS_CATALOG . 'templates/default/mainpage_modules/');
+
+define('DIR_WS_TEMPLATE_IMAGES', 'templates/Pixame_v1ats/images/');
+//which files to use
+define('TEMPLATE_BOX_TPL', DIR_WS_TEMPLATES . '/default/boxes.tpl.php');
+define('TEMPLATE_HTML_OUT', DIR_WS_TEMPLATES . '/default/extra_html_output.php' );
+
+//variables moved from box.tpl.php
+define('TEMPLATE_TABLE_BORDER', '0');
+define('TEMPLATE_TABLE_WIDTH', '100%');
+define('TEMPLATE_TABLE_CELLSPACING', '0');
+define('TEMPLATE_TABLE_CELLPADDIING', '0');
+define('TEMPLATE_TABLE_PARAMETERS', '');
+define('TEMPLATE_TABLE_ROW_PARAMETERS', '');
+define('TEMPLATE_TABLE_DATA_PARAMETERS', '');
+define('TEMPLATE_TABLE_CONTENT_CELLPADING', '2');
+define('TEMPLATE_TABLE_CENTER_CONTENT_CELLPADING', '4');
+
+//for sidebox footer
+define('TEMPLATE_BOX_IMAGE_FOOTER_LEFT', 'true');
+define('TEMPLATE_BOX_IMAGE_FOOTER_RIGHT', 'true');
+define('TEMPLATE_BOX_IMAGE_FOOTER_RIGHT_ARROW', 'true');
+define('TEMPLATE_BOX_IMAGE_FOOTER_LEFTRIGHT', 'true');
+//for side header
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFT', 'true');
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_RIGHT', 'true');
+define('TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFTRIGHT', 'true');
+
+//for content header
+define('TEMPLATE_IMAGE_BORDER_TOP_LEFT', 'true');
+define('TEMPLATE_IMAGE_BORDER_TOP_RIGHT', 'true');
+//include footer
+define('TEMPLATE_INCLUDE_FOOTER', 'true');
+//images to use or html
+
+define('TEMPLATE_BOX_IMAGE_TOP_TRANS', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/pixel_trans.gif');
+
+//box header images
+define('TEMPLATE_BOX_IMAGE_TOP_LEFT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_RIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_LEFTRIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_RIGHTARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/arrow_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_NOARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/no_arrow_right.gif');
+define('TEMPLATE_BOX_IMAGE_TOP_BACKGROUND', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif');
+
+//box footer images
+define('TEMPLATE_BOX_IMAGE_FOOT_LEFT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_left_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_RIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_left.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/backgroundfb.gif');
+define('TEMPLATE_BOX_IMAGE_FOOT_NOARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/corner_right_flip.gif');
+define('TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW', DIR_WS_TEMPLATES . TEMPLATE_NAME . '');
+
+// box middles images
+define('TEMPLATE_BOX_MIDDLE_LEFT_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif');
+define('TEMPLATE_BOX_MIDDLE_MIDDLE_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background_box.gif');
+define('TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE', DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif');
+
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/Order_Info.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/Order_Info.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/Order_Info.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,87 @@
+<form name="account_edit" method="post" <?php echo 'action="' .
+tep_href_link('Order_Info_Process.php', '', 'SSL')
+. '"'; ?> onSubmit="return check_form(this);"><input type="hidden" name="action" value="process">
+ <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>"> 
+  <?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?> 
+  <tr> 
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 
+        <tr> 
+          <td class="pageHeading"><?php echo HEADING_TITLE_CHECKOUT; ?></td> 
+          <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> 
+        </tr> 
+      </table></td> 
+  </tr> 
+<!--   <tr> 
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 
+  </tr>  -->
+  <?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?> 
+  <tr> 
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> 
+        <?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?> 
+        <tr> 
+          <td class="main"><?php
+  if (sizeof($navigation->snapshot) > 0) {
+?>
+      <tr>
+        <td class="smallText"><br><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td>
+<?php
+  $email_address = tep_db_prepare_input($HTTP_GET_VARS['email_address']);
+  $account['entry_country_id'] = STORE_COUNTRY;
+
+//  require(DIR_WS_MODULES . 'Order_Info_Check.php');
+  require(DIR_WS_MODULES . FILENAME_ORDER_INFO_CHECK);
+?>
+        </td>
+      </tr>
+        <?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?> 
+      </table></td> 
+  </tr> 
+  <tr> 
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 
+  </tr> 
+  <tr> 
+    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> 
+        <tr class="infoBoxContents"> 
+          <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> 
+              <tr> 
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+              </tr> 
+            </table></td> 
+        </tr> 
+      </table></td> 
+  </tr> 
+</table></form>

Added: trunk/direct.openmoko.com/templates/content/Order_Info_Process.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/Order_Info_Process.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/Order_Info_Process.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php echo tep_draw_form('account_edit', tep_href_link(FILENAME_ORDER_INFO_PROCESS, '',
+'SSL'), 'post',
+'onSubmit="return check_form(this);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <!--tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr//-->
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><?php include(DIR_WS_MODULES . 'Order_Info_Check.php'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/account.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/account.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/account.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,198 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  if ($messageStack->size('account') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('account'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+
+  if (tep_count_customer_orders() > 0) {
+?>
+      <tr>
+        <td><table border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo OVERVIEW_TITLE; ?></b></td>
+            <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '"><u>' . OVERVIEW_SHOW_ALL_ORDERS . '</u></a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main" align="center" valign="top" width="130"><?php echo '<b>' . OVERVIEW_PREVIOUS_ORDERS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+    $orders_query = tep_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id desc limit 3");
+    while ($orders = tep_db_fetch_array($orders_query)) {
+      if (tep_not_null($orders['delivery_name'])) {
+        $order_name = $orders['delivery_name'];
+        $order_country = $orders['delivery_country'];
+      } else {
+        $order_name = $orders['billing_name'];
+        $order_country = $orders['billing_country'];
+      }
+?>
+                  <tr class="moduleRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL'); ?>'">
+                    <td class="main" width="80"><?php echo tep_date_short($orders['date_purchased']); ?></td>
+                    <td class="main"><?php echo '#' . $orders['orders_id']; ?></td>
+                    <td class="main"><?php echo tep_output_string_protected($order_name) . ', ' . $order_country; ?></td>
+                    <td class="main"><?php echo $orders['orders_status_name']; ?></td>
+                    <td class="main" align="right"><?php echo $orders['order_total']; ?><br>
+                    <?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL') . '">' . tep_template_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo MY_ACCOUNT_TITLE; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'account_personal.gif'); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . MY_ACCOUNT_INFORMATION . '</a>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . MY_ACCOUNT_ADDRESS_BOOK . '</a>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">' . MY_ACCOUNT_PASSWORD . '</a>'; ?></td>
+                  </tr>
+                </table></td>
+                <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo MY_ORDERS_TITLE; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'account_orders.gif'); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . MY_ORDERS_VIEW . '</a>'; ?></td>
+                  </tr>
+                </table></td>
+                <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo EMAIL_NOTIFICATIONS_TITLE; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'account_notifications.gif'); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '">' . EMAIL_NOTIFICATIONS_NEWSLETTERS . '</a>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . EMAIL_NOTIFICATIONS_PRODUCTS . '</a>'; ?></td>
+                  </tr>
+                </table></td>
+                <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/account_edit.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/account_edit.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/account_edit.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,137 @@
+    <?php echo tep_draw_form('account_edit', tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'onSubmit="return check_form(account_edit);"') . tep_draw_hidden_field('action', 'process'); ?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if ($messageStack->size('account_edit') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('account_edit'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo MY_ACCOUNT_TITLE; ?></b></td>
+                <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="2" cellpadding="2">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+    if (isset($gender)) {
+      $male = ($gender == 'm') ? true : false;
+    } else {
+      $male = ($account['customers_gender'] == 'm') ? true : false;
+    }
+    $female = !$male;
+?>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_GENDER; ?></td>
+                    <td class="main"><?php echo tep_draw_radio_field('gender', 'm', $male) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f', $female) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
+                  </tr>
+<?php
+  }
+?>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('firstname', $account['customers_firstname']) . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('lastname', $account['customers_lastname']) . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
+                  </tr>
+<?php
+  if (ACCOUNT_DOB == 'true') {
+?>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('dob', tep_date_short($account['customers_dob'])) . '&nbsp;' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td>
+                  </tr>
+<?php
+  }
+?>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('email_address', $account['customers_email_address']) . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('telephone', $account['customers_telephone']) . '&nbsp;' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('fax', $account['customers_fax']) . '&nbsp;' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/account_history.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/account_history.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/account_history.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,134 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+<?php
+  $orders_total = tep_count_customer_orders();
+
+  if ($orders_total > 0) {
+    $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id DESC";
+    $history_split = new splitPageResults($history_query_raw, MAX_DISPLAY_ORDER_HISTORY);
+    $history_query = tep_db_query($history_split->sql_query);
+
+    while ($history = tep_db_fetch_array($history_query)) {
+      $products_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$history['orders_id'] . "'");
+      $products = tep_db_fetch_array($products_query);
+
+      if (tep_not_null($history['delivery_name'])) {
+        $order_type = TEXT_ORDER_SHIPPED_TO;
+        $order_name = $history['delivery_name'];
+      } else {
+        $order_type = TEXT_ORDER_BILLED_TO;
+        $order_name = $history['billing_name'];
+      }
+?>
+          <table border="0" width="100%" cellspacing="0" cellpadding="2">
+            <tr>
+              <td class="main"><?php echo '<b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id']; ?></td>
+              <td class="main" align="right"><?php echo '<b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name']; ?></td>
+            </tr>
+          </table>
+          <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+            <tr class="infoBoxContents">
+              <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
+                <tr>
+                  <td class="main" width="50%" valign="top"><?php echo '<b>' . TEXT_ORDER_DATE . '</b> ' . tep_date_long($history['date_purchased']) . '<br><b>' . $order_type . '</b> ' . tep_output_string_protected($order_name); ?></td>
+                  <td class="main" width="30%" valign="top"><?php echo '<b>' . TEXT_ORDER_PRODUCTS . '</b> ' . $products['count'] . '<br><b>' . TEXT_ORDER_COST . '</b> ' . strip_tags($history['order_total']); ?></td>
+                  <td class="main" width="20%"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&amp;' : '') . 'order_id=' . $history['orders_id'], 'SSL') . '">' . tep_template_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
+                </tr>
+              </table></td>
+            </tr>
+          </table>
+          <table border="0" width="100%" cellspacing="0" cellpadding="2">
+            <tr>
+              <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            </tr>
+          </table>
+<?php
+    }
+  } else {
+?>
+          <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+            <tr class="infoBoxContents">
+              <td><table border="0" width="100%" cellspacing="2" cellpadding="4">
+                <tr>
+                  <td class="main"><?php echo TEXT_NO_PURCHASES; ?></td>
+                </tr>
+              </table></td>
+            </tr>
+          </table>
+<?php
+  }
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  if ($orders_total > 0) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText" valign="top"><?php echo $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
+            <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                </td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/account_history_info.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/account_history_info.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/account_history_info.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,230 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" colspan="2"><b><?php echo sprintf(HEADING_ORDER_NUMBER, $HTTP_GET_VARS['order_id']) . ' <small>(' . $order->info['orders_status'] . ')</small>'; ?></b></td>
+          </tr>
+          <tr>
+            <td class="smallText"><?php echo HEADING_ORDER_DATE . ' ' . tep_date_long($order->info['date_purchased']); ?></td>
+            <td class="smallText" align="right"><?php echo HEADING_ORDER_TOTAL . ' ' . $order->info['total']; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+<?php
+  if ($order->delivery != false) {
+?>
+            <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo HEADING_DELIVERY_ADDRESS; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>
+              </tr>
+<?php
+    if (tep_not_null($order->info['shipping_method'])) {
+?>
+              <tr>
+                <td class="main"><b><?php echo HEADING_SHIPPING_METHOD; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo $order->info['shipping_method']; ?></td>
+              </tr>
+<?php
+    }
+?>
+            </table></td>
+<?php
+  }
+?>
+            <td width="<?php echo (($order->delivery != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (sizeof($order->info['tax_groups']) > 1) {
+?>
+                  <tr>
+                    <td class="main" colspan="2"><b><?php echo HEADING_PRODUCTS; ?></b></td>
+                    <td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td>
+                    <td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
+                  </tr>
+<?php
+  } else {
+?>
+                  <tr>
+                    <td class="main" colspan="2"><b><?php echo HEADING_PRODUCTS; ?></b></td>
+                    <td class="main" align="right"><b><?php echo HEADING_PRODUCTS_BASE_PRICE; ?></b></td>
+                    <td class="main" align="right"><b><?php echo HEADING_PRODUCTS_FINAL_PRICE; ?></b></td>
+                  </tr>
+<?php
+  }
+
+  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+    echo '          <tr>' . "\n" .
+         '            <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
+         '            <td class="main" valign="top">' . $order->products[$i]['name'] ; 
+    echo '<br><b>' . HEADING_OPTIONS  . '</b></small>';
+
+//attibute_query 
+//check for attibutes:
+
+          $attributes_check_query = tep_db_query("select *
+            from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "
+           where 
+           orders_id = '" .$order_id . "' and
+           orders_products_id = '" . $order->products[$i]['orders_products_id'] . "' ");
+ if (tep_db_num_rows($attributes_check_query)) {
+      while ($attributes = tep_db_fetch_array($attributes_check_query)) {
+          echo '<br><small><i> *' . $attributes['products_options'] . ' : ' . $attributes['products_options_values'] . '</i></small>';
+          echo '<br><small> ' . $attributes['price_prefix'] . ' ' . $currencies->display_price($attributes['options_values_price'], tep_get_tax_rate($products[$i]['tax_class_id']), 1) . '</small>';
+
+        }
+      }
+
+    echo '</td>' . "\n";
+ echo '</td><td class="main" valign="top" align="right">' .  $currencies->display_price($order->products[$i]['price'], tep_get_tax_rate($products[$i]['tax_class_id']), 1) . '</td>' . "\n";
+    if (sizeof($order->info['tax_groups']) > 1) {
+      echo '            <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
+    }
+
+    echo '            <td class="main" align="right" valign="top">' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
+         '          </tr>' . "\n";
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo HEADING_BILLING_ADDRESS; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><b><?php echo HEADING_PAYMENT_METHOD; ?></b></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo $order->info['payment_method']; ?></td>
+              </tr>
+            </table></td>
+            <td width="70%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
+    echo '              <tr>' . "\n" .
+         '                <td class="main" align="right" width="100%">' . $order->totals[$i]['title'] . '</td>' . "\n" .
+         '                <td class="main" align="right">' . $order->totals[$i]['text'] . '</td>' . "\n" .
+         '              </tr>' . "\n";
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo HEADING_ORDER_HISTORY; ?></b></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td colspan="2"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");
+  while ($statuses = tep_db_fetch_array($statuses_query)) {
+    echo '              <tr>' . "\n" .
+         '                <td class="main" valign="top" width="70">' . tep_date_short($statuses['date_added']) . '</td>' . "\n" .
+         '                <td class="main" valign="top" width="170">' . $statuses['orders_status_name'] . '</td>' . "\n" .
+         '                <td class="main" valign="top">' . (empty($statuses['comments']) ? '&nbsp;' : nl2br(tep_output_string_protected($statuses['comments']))) . '</td>' . "\n" .
+         '              </tr>' . "\n";
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  //if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php');
+  if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . FILENAME_DOWNLOADS);
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td align="right" class="main"><?php echo '<a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_ORDERS_PRINTABLE) . '?' . (tep_get_all_get_params(array('order_id')) . 'order_id=' . (int)$HTTP_GET_VARS['order_id']) . '\')">' . tep_template_image_button('button_printorder.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?></td>
+        <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, tep_get_all_get_params(array('order_id')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></div>
+                    <?php require(DIR_WS_MODULES . 'payment/paypal/catalog/order_send_money.inc.php'); ?>
+                </td>
+<?php /* end PayPal_Shopping_Cart_IPN */ ?>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+      </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/account_newsletters.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/account_newsletters.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/account_newsletters.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+    <?php echo tep_draw_form('account_newsletter', tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="main"><b><?php echo MY_NEWSLETTERS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('newsletter_general')">
+                    <td class="main"><?php echo tep_draw_checkbox_field('newsletter_general', '1', (($newsletter['customers_newsletter'] == '1') ? true : false), 'onclick="checkBox(\'newsletter_general\')"'); ?></td>
+                    <td class="main"><b><?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER; ?></b></td>
+                  </tr>
+                  <tr>
+                    <td class="main">&nbsp;</td>
+                    <td><table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER_DESCRIPTION; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/account_notifications.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/account_notifications.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/account_notifications.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,156 @@
+    <?php echo tep_draw_form('account_notifications', tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="main"><b><?php echo MY_NOTIFICATIONS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo MY_NOTIFICATIONS_DESCRIPTION; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo GLOBAL_NOTIFICATIONS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('product_global')">
+                    <td class="main" width="30"><?php echo tep_draw_checkbox_field('product_global', '1', (($global['global_product_notifications'] == '1') ? true : false), 'onclick="checkBox(\'product_global\')"'); ?></td>
+                    <td class="main"><b><?php echo GLOBAL_NOTIFICATIONS_TITLE; ?></b></td>
+                  </tr>
+                  <tr>
+                    <td width="30">&nbsp;</td>
+                    <td class="main"><?php echo GLOBAL_NOTIFICATIONS_DESCRIPTION; ?></td>
+                  </tr>
+                </table></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if ($global['global_product_notifications'] != '1') {
+?>
+      <tr>
+        <td class="main"><b><?php echo NOTIFICATIONS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+    $products_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'");
+    $products_check = tep_db_fetch_array($products_check_query);
+    if ($products_check['total'] > 0) {
+?>
+                  <tr>
+                    <td class="main" colspan="2"><?php echo NOTIFICATIONS_DESCRIPTION; ?></td>
+                  </tr>
+<?php
+      $counter = 0;
+      $products_query = tep_db_query("select pd.products_id, pd.products_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where pn.customers_id = '" . (int)$customer_id . "' and pn.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+?>
+                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('products[<?php echo $counter; ?>]')">
+                    <td class="main" width="30"><?php echo tep_draw_checkbox_field('products[' . $counter . ']', $products['products_id'], true, 'onclick="checkBox(\'products[' . $counter . ']\')"'); ?></td>
+                    <td class="main"><b><?php echo $products['products_name']; ?></b></td>
+                  </tr>
+<?php
+        $counter++;
+      }
+    } else {
+?>
+                  <tr>
+                    <td class="main"><?php echo NOTIFICATIONS_NON_EXISTING; ?></td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/account_password.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/account_password.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/account_password.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+    <?php echo tep_draw_form('account_password', tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL'), 'post', 'onSubmit="return check_form(account_password);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if ($messageStack->size('account_password') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('account_password'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo MY_PASSWORD_TITLE; ?></b></td>
+                <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="2" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo ENTRY_PASSWORD_CURRENT; ?></td>
+                    <td class="main"><?php echo tep_draw_password_field('password_current') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_CURRENT_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CURRENT_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_PASSWORD_NEW; ?></td>
+                    <td class="main"><?php echo tep_draw_password_field('password_new') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_NEW_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_NEW_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+                    <td class="main"><?php echo tep_draw_password_field('password_confirmation') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/content/address_book.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/address_book.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/address_book.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,147 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_address_book.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if ($messageStack->size('addressbook') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('addressbook'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td class="main"><b><?php echo PRIMARY_ADDRESS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="50%" valign="top"><?php echo PRIMARY_ADDRESS_DESCRIPTION; ?></td>
+                <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main" align="center" valign="top"><b><?php echo PRIMARY_ADDRESS_TITLE; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" valign="top"><?php echo tep_address_label($customer_id, $customer_default_address_id, true, ' ', '<br>'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo ADDRESS_BOOK_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' order by firstname, lastname");
+  while ($addresses = tep_db_fetch_array($addresses_query)) {
+    $format_id = tep_get_address_format_id($addresses['country_id']);
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL'); ?>'">
+                    <td class="main"><b><?php echo tep_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?></b><?php if ($addresses['address_book_id'] == $customer_default_address_id) echo '&nbsp;<small><i>' . PRIMARY_ADDRESS . '</i></small>'; ?></td>
+                    <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL') . '">' . tep_template_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $addresses['address_book_id'], 'SSL') . '">' . tep_template_image_button('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo tep_address_format($format_id, $addresses, true, ' ', '<br>'); ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+<?php
+  if (tep_count_customer_address_book_entries() < MAX_ADDRESS_BOOK_ENTRIES) {
+?>
+                <td class="smallText" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'SSL') . '">' . tep_template_image_button('button_add_address.gif', IMAGE_BUTTON_ADD_ADDRESS) . '</a>'; ?></td>
+<?php
+  }
+?>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="smallText"><?php echo sprintf(TEXT_MAXIMUM_ENTRIES, MAX_ADDRESS_BOOK_ENTRIES); ?></td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/content/address_book_process.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/address_book_process.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/address_book_process.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,155 @@
+    <?php if (!isset($HTTP_GET_VARS['delete'])) echo tep_draw_form('addressbook', tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, (isset($HTTP_GET_VARS['edit']) ? 'edit=' . $HTTP_GET_VARS['edit'] : ''), 'SSL'), 'post', 'onSubmit="return check_form(addressbook);"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php if (isset($HTTP_GET_VARS['edit'])) { echo HEADING_TITLE_MODIFY_ENTRY; } elseif (isset($HTTP_GET_VARS['delete'])) { echo HEADING_TITLE_DELETE_ENTRY; } else { echo HEADING_TITLE_ADD_ENTRY; } ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_address_book.gif', (isset($HTTP_GET_VARS['edit']) ? HEADING_TITLE_MODIFY_ENTRY : HEADING_TITLE_ADD_ENTRY), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+if (isset($HTTP_GET_VARS['edit'])) { $header_text = HEADING_TITLE_MODIFY_ENTRY; } elseif (isset($HTTP_GET_VARS['delete'])) { $header_text = HEADING_TITLE_DELETE_ENTRY; } else { $header_text = HEADING_TITLE_ADD_ENTRY; }
+}
+// EOF: Lango Added for template MOD
+?>
+
+
+<?php
+  if ($messageStack->size('addressbook') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('addressbook'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+
+  if (isset($HTTP_GET_VARS['delete'])) {
+?>
+      <tr>
+        <td class="main"><b><?php echo DELETE_ADDRESS_TITLE; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="50%" valign="top"><?php echo DELETE_ADDRESS_DESCRIPTION; ?></td>
+                <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main" align="center" valign="top"><b><?php echo SELECTED_ADDRESS; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" valign="top"><?php echo tep_address_label($customer_id, $HTTP_GET_VARS['delete'], true, ' ', '<br>'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'] . '&amp;action=deleteconfirm', 'SSL') . '">' . tep_template_image_button('button_delete.gif', IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><?php include(DIR_WS_MODULES . FILENAME_ADDRESS_BOOK_DETAILS); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_draw_hidden_field('action', 'update') . tep_draw_hidden_field('edit', $HTTP_GET_VARS['edit']) . tep_template_image_submit('button_update.gif', IMAGE_BUTTON_UPDATE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+    } else {
+      if (sizeof($navigation->snapshot) > 0) {
+        $back_link = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
+      } else {
+        $back_link = tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL');
+      }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . $back_link . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_draw_hidden_field('action', 'process') . tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+    }
+  }
+?>
+    </table><?php if (!isset($HTTP_GET_VARS['delete'])) echo '</form>'; ?>
+

Added: trunk/direct.openmoko.com/templates/content/advanced_search.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/advanced_search.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/advanced_search.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,137 @@
+    <?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onSubmit="return check_form(this);"') . tep_hide_session_id(); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE_1; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_browse.gif', HEADING_TITLE_1, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = HEADING_TITLE_1;
+}
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  if ($messageStack->size('search') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('search'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+
+            <td width="100%" height="14" class="infoBoxHeading"><?php echo HEADING_SEARCH_CRITERIA; ?></td>
+
+          </tr>
+        </table>
+        <table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
+              <tr>
+                <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
+              </tr>
+              <tr>
+                <td class="boxText"><?php echo tep_draw_input_field('keywords', '', 'style="width: 100%"'); ?></td>
+              </tr>
+              <tr>
+                <td align="right" class="boxText"><?php echo tep_draw_checkbox_field('search_in_description', '1') . ' ' . TEXT_SEARCH_IN_DESCRIPTION; ?></td>
+              </tr>
+              <tr>
+                <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText"><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_SEARCH_HELP) . '\')">' . TEXT_SEARCH_HELP_LINK . '</a>'; ?></td>
+            <td class="smallText" align="right"><?php echo tep_template_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="fieldKey"><?php echo ENTRY_CATEGORIES; ?></td>
+                <td class="fieldValue"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)))); ?></td>
+              </tr>
+              <tr>
+                <td class="fieldKey">&nbsp;</td>
+                <td class="smallText"><?php echo tep_draw_checkbox_field('inc_subcat', '1', true) . ' ' . ENTRY_INCLUDE_SUBCATEGORIES; ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="fieldKey"><?php echo ENTRY_MANUFACTURERS; ?></td>
+                <td class="fieldValue"><?php echo tep_draw_pull_down_menu('manufacturers_id', tep_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)))); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="fieldKey"><?php echo ENTRY_PRICE_FROM; ?></td>
+                <td class="fieldValue"><?php echo tep_draw_input_field('pfrom'); ?></td>
+              </tr>
+              <tr>
+                <td class="fieldKey"><?php echo ENTRY_PRICE_TO; ?></td>
+                <td class="fieldValue"><?php echo tep_draw_input_field('pto'); ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="fieldKey"><?php echo ENTRY_DATE_FROM; ?></td>
+                <td class="fieldValue"><?php echo tep_draw_input_field('dfrom', DOB_FORMAT_STRING, 'onFocus="RemoveFormatString(this, \'' . DOB_FORMAT_STRING . '\')"'); ?></td>
+              </tr>
+              <tr>
+                <td class="fieldKey"><?php echo ENTRY_DATE_TO; ?></td>
+                <td class="fieldValue"><?php echo tep_draw_input_field('dto', DOB_FORMAT_STRING, 'onFocus="RemoveFormatString(this, \'' . DOB_FORMAT_STRING . '\')"'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/advanced_search_result.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/advanced_search_result.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/advanced_search_result.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,335 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE_2; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_browse.gif', HEADING_TITLE_2, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = HEADING_TITLE_2;
+}
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+<?php
+// create column list
+  $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
+                       'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
+                       'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
+                       'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
+                       'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
+                       'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
+                       'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
+                       'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
+
+  asort($define_list);
+
+  $column_list = array();
+  reset($define_list);
+  while (list($key, $value) = each($define_list)) {
+    if ($value > 0) $column_list[] = $key;
+  }
+
+// Eversun mod for sppp
+  if(!tep_session_is_registered('sppc_customer_group_id')) {
+    $customer_group_id = '0';
+  } else {
+    $customer_group_id = $sppc_customer_group_id;
+  }
+// Eversun mod end for sppp
+
+  $select_column_list = '';
+
+  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+    switch ($column_list[$i]) {
+      case 'PRODUCT_LIST_MODEL':
+        $select_column_list .= 'p.products_model, ';
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $select_column_list .= 'm.manufacturers_name, ';
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $select_column_list .= 'p.products_quantity, ';
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $select_column_list .= 'p.products_image, ';
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $select_column_list .= 'p.products_weight, ';
+        break;
+    }
+  }
+
+// Eversun mod for sppp
+/*
+  $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";
+
+  if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
+    $select_str .= ", SUM(tr.tax_rate) as tax_rate ";
+  }
+
+  $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";   */
+   $status_tmp_product_prices_table = false;
+   $status_need_to_get_prices = false;
+   // find out if sorting by price has been requested
+   if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) ){
+    $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+    if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
+      $status_need_to_get_prices = true;
+      }
+   }
+
+   if ((tep_not_null($pfrom) || tep_not_null($pto) || $status_need_to_get_prices == true) && $customer_group_id != '0') {
+   $product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;
+   // the table with product prices for a particular customer group is re-built only a number of times per hour
+   // (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)
+   // to trigger the update the next function is called (new function that should have been
+   // added to includes/functions/database.php)
+   tep_db_check_age_products_group_prices_cg_table($customer_group_id);
+   $status_tmp_product_prices_table = true;
+   } elseif ((tep_not_null($pfrom) || tep_not_null($pto) || $status_need_to_get_prices == true) && $customer_group_id == '0') {
+   // to be able to sort on retail prices we *need* to get the special prices instead of leaving them
+   // NULL and do product_listing the job of getting the special price
+   // first make sure that table exists and needs no updating
+   tep_db_check_age_specials_retail_table();
+   $status_tmp_special_prices_table = true;
+   } // end elseif ((tep_not_null($pfrom) || (tep_not_null($pfrom)) && ....
+
+   if ($status_tmp_product_prices_table == true) {
+   $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, tmp_pp.products_price, p.products_tax_class_id, if(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price ";
+   } elseif ($status_tmp_special_prices_table == true) {
+     // Eversun mod for SPPP Qty Price Break Enhancement
+//     $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, if(s.status, s.specials_new_products_price, p.products_price) as final_price ";
+//$select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, if(s.status, s.specials_new_products_price, p.products_price) as final_price ";
+   $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price9, p.products_price10, p.products_price11, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_price9_qty, p.products_price10_qty, p.products_price11_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";
+// Eversun mod end for SPPP Qty Price Break Enhancement
+     
+   } else {
+     // Eversun mod  for SPPP Qty Price Break Enhancement
+     //$select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, NULL as specials_new_products_price, NULL as final_price ";
+
+    $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price9, p.products_price10, p.products_price11, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_price9_qty, p.products_price10_qty, p.products_price11_qty, p.products_tax_class_id, NULL as specials_new_products_price, NULL as final_price ";
+    // Eversun mod end for SPPP Qty Price Break Enhancement
+   }
+   // next line original select query
+   // $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";
+
+
+  if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
+    $select_str .= ", SUM(tr.tax_rate) as tax_rate ";
+  }
+
+      if ($status_tmp_product_prices_table == true) {
+  $from_str = "from ( " . TABLE_PRODUCTS . " p
+               left join " . $product_prices_table . " as tmp_pp using(products_id) )
+               left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id ";
+      
+      } elseif ($status_tmp_special_prices_table == true) {
+  $from_str = "from ( " . TABLE_PRODUCTS . " p
+               left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) )
+               left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id ";
+      
+      } else {
+  $from_str = "from ( " . TABLE_PRODUCTS . " p
+               left join " . TABLE_SPECIALS . " s using(products_id) )
+               left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id ";
+      }
+// Eversun mod end for sppp
+
+  if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
+    if (!tep_session_is_registered('customer_country_id')) {
+      $customer_country_id = STORE_COUNTRY;
+      $customer_zone_id = STORE_ZONE;
+    }
+    $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
+  } else { 
+    $from_str .= " , ";
+  }
+  
+  // modified for mysql 5 support - add tables after the left join tables
+  $from_str .= TABLE_PRODUCTS_DESCRIPTION . " pd,
+               " . TABLE_CATEGORIES . " c,
+               " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ";
+  
+  $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";
+
+  if (isset($HTTP_GET_VARS['categories_id']) && tep_not_null($HTTP_GET_VARS['categories_id'])) {
+    if (isset($HTTP_GET_VARS['inc_subcat']) && ($HTTP_GET_VARS['inc_subcat'] == '1')) {
+      $subcategories_array = array();
+      tep_get_subcategories($subcategories_array, $HTTP_GET_VARS['categories_id']);
+
+      $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";
+
+      for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
+        $where_str .= " or p2c.categories_id = '" . (int)$subcategories_array[$i] . "'";
+      }
+
+      $where_str .= ")";
+    } else {
+      $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";
+    }
+  }
+
+  if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
+    $where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+  }
+
+  if (isset($search_keywords) && (sizeof($search_keywords) > 0)) {
+    $where_str .= " and (";
+    for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) {
+      switch ($search_keywords[$i]) {
+        case '(':
+        case ')':
+        case 'and':
+        case 'or':
+          $where_str .= " " . $search_keywords[$i] . " ";
+          break;
+        default:
+          $keyword = tep_db_prepare_input($search_keywords[$i]);
+          $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
+          if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
+          $where_str .= ')';
+          break;
+      }
+    }
+    $where_str .= " )";
+  }
+
+  if (tep_not_null($dfrom)) {
+    $where_str .= " and p.products_date_added >= '" . tep_date_raw($dfrom) . "'";
+  }
+
+  if (tep_not_null($dto)) {
+    $where_str .= " and p.products_date_added <= '" . tep_date_raw($dto) . "'";
+  }
+
+  if (tep_not_null($pfrom)) {
+    if ($currencies->is_set($currency)) {
+      $rate = $currencies->get_value($currency);
+
+      $pfrom = $pfrom / $rate;
+    }
+  }
+
+  if (tep_not_null($pto)) {
+    if (isset($rate)) {
+      $pto = $pto / $rate;
+    }
+  }
+
+// Eversun mod for sppp
+/*
+  if (DISPLAY_PRICE_WITH_TAX == 'true') {
+    if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
+    if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
+  } else {
+    if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) >= " . (double)$pfrom . ")";
+    if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) <= " . (double)$pto . ")";
+  }  */
+  if ($status_tmp_product_prices_table == true) {
+    if (DISPLAY_PRICE_WITH_TAX == 'true') {
+      if ($pfrom > 0) $where_str .= " and (IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
+      if ($pto > 0) $where_str .= " and (IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
+    } else {
+      if ($pfrom > 0) $where_str .= " and (IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) >= " . (double)$pfrom . ")";
+      if ($pto > 0) $where_str .= " and (IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) <= " . (double)$pto . ")";
+    }
+  } else { // $status_tmp_product_prices_table is not true: uses p.products_price instead of cg_products_price
+     // because in the where clause for the case $status_tmp_special_prices is true, the table
+     // specials_retail_prices is abbreviated with "s" also we can use the same code for "true" and for "false"
+  if (DISPLAY_PRICE_WITH_TAX == 'true') {
+      if ($pfrom > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
+      if ($pto > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
+    } else {
+      if ($pfrom > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) >= " . (double)$pfrom . ")";
+      if ($pto > 0) $where_str .= " and (IF(s.status AND s.customers_group_id = '" . $customer_group_id . "', s.specials_new_products_price, p.products_price) <= " . (double)$pto . ")";
+    }
+  }
+// Eversun mod end for sppp
+
+  if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
+    $where_str .= " group by p.products_id, tr.tax_priority";
+  }
+
+  if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+    for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+      if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
+        $HTTP_GET_VARS['sort'] = $i+1 . 'a';
+        $order_str = ' order by pd.products_name';
+        break;
+      }
+    }
+  } else {
+    $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+    $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    $order_str = ' order by ';
+    switch ($column_list[$sort_col-1]) {
+      case 'PRODUCT_LIST_MODEL':
+        $order_str .= "p.products_model " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $order_str .= "pd.products_name " . ($sort_order == 'd' ? "desc" : "");
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $order_str .= "m.manufacturers_name " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $order_str .= "p.products_quantity " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $order_str .= "pd.products_name";
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $order_str .= "p.products_weight " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $order_str .= "final_price " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
+        break;
+    }
+  }
+
+  $listing_sql = $select_str . $from_str . $where_str . $order_str;
+
+
+  require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
+
+
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(array('sort', 'page')), 'NONSSL', true, false) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/affiliate_affiliate.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_affiliate.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_affiliate.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,132 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td rowspan="2" class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_login.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+
+  if (isset($HTTP_GET_VARS['login']) && ($HTTP_GET_VARS['login'] == 'fail')) {
+    $info_message = TEXT_LOGIN_ERROR;
+  }
+
+  if (isset($info_message)) {
+?>
+
+      <tr>
+        <td class="smallText"><?php echo $info_message; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_form('login', tep_href_link(FILENAME_AFFILIATE, 'action=process', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="main" width="50%" valign="top"><b><?php echo HEADING_NEW_AFFILIATE; ?></b></td>
+            <td class="main" width="50%" valign="top"><b><?php echo HEADING_RETURNING_AFFILIATE; ?></b></td>
+          </tr>
+          <tr>
+            <td width="50%" height="100%" valign="top"><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="1" class="infoBox">
+              <tr>
+                <td><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2" class="infoBoxContents">
+                  <tr>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main" valign="top"><?php echo TEXT_NEW_AFFILIATE . '<br><br>' . TEXT_NEW_AFFILIATE_INTRODUCTION; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="smallText" colspan="2"><?php echo '<a  href="' . tep_href_link(FILENAME_AFFILIATE_TERMS, '', 'SSL') . '">' . TEXT_NEW_AFFILIATE_TERMS . '</a>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+            <td width="50%" height="100%" valign="top"><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="1" class="infoBox">
+              <tr>
+                <td><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2" class="infoBoxContents">
+                  <tr>
+                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main" colspan="2"><?php echo TEXT_RETURNING_AFFILIATE; ?></td>
+                  </tr>
+                  <tr>
+                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><b><?php echo TEXT_AFFILIATE_ID; ?></b></td>
+                    <td class="main"><?php echo tep_draw_input_field('affiliate_username'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><b><?php echo TEXT_AFFILIATE_PASSWORD; ?></b></td>
+                    <td class="main"><?php echo tep_draw_password_field('affiliate_password'); ?></td>
+                  </tr>
+                  <tr>
+                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="smallText" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_AFFILIATE_PASSWORD_FORGOTTEN . '</a>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="left" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SIGNUP, '', 'SSL') . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+            <td width="50%" align="right" valign="top"><?php echo tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN); ?></td>
+          </tr>
+                </table></td>
+              </tr>
+                </table></td>
+              </tr>
+        </table></form></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/affiliate_banners.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_banners.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_banners.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,132 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+          <tr>
+            <td class="main" <?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER . ' ' . $affiliate_banners['affiliate_banners_title']; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO . tep_draw_form('individual_banner', tep_href_link(FILENAME_AFFILIATE_BANNERS) ) . "\n" . tep_draw_input_field('individual_banner_id', '', 'size="5"') . "&nbsp;&nbsp;" . tep_template_image_submit('button_affiliate_build_a_link.gif', IMAGE_BUTTON_BUILD_A_LINK); ?></form></td>
+          </tr>
+<?php
+  if (tep_not_null($HTTP_POST_VARS['individual_banner_id']) || tep_not_null($HTTP_GET_VARS['individual_banner_id'])) {
+
+    if (tep_not_null($HTTP_POST_VARS['individual_banner_id'])) $individual_banner_id = (int)$HTTP_POST_VARS['individual_banner_id'];
+
+    if ($HTTP_GET_VARS['individual_banner_id']) $individual_banner_id = (int)$HTTP_GET_VARS['individual_banner_id'];
+    $affiliate_pbanners_values = tep_db_query("select p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $individual_banner_id . "' and pd.products_id = '" . $individual_banner_id . "' and p.products_status = '1' and pd.language_id = '" . $languages_id . "'");
+
+    while ($affiliate_pbanners = tep_db_fetch_array($affiliate_pbanners_values)) {
+      $product_image = $affiliate_pbanners['products_image'];
+      switch (AFFILIATE_KIND_OF_BANNERS) {
+        case 1:
+          $link = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&amp;products_id=' . $individual_banner_id . '&amp;affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . $product_image . '" border="0" alt="' . $affiliate_pbanners['products_name'] . '"></a>';
+          break;
+        case 2: // Link to Products
+          $link = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&amp;products_id=' . $individual_banner_id . '&amp;affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&amp;affiliate_pbanner_id=' . $individual_banner_id . '" border="0" alt="' . $affiliate_pbanners['products_name'] . '"></a>';
+          break;
+      }
+    }
+?>
+         <tr>
+            <td class="smallText" align="center"><br><?php echo $link; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td>
+          </tr>
+          <tr>
+            <td align="center"><?php echo tep_draw_textarea_field('affiliate_banner', 'soft', '60', '6', $link); ?></td>
+          </tr>
+<?php
+  }
+?>
+<?php
+  if (tep_db_num_rows($affiliate_banners_values)) {
+
+    while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_values)) {
+      $affiliate_products_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $affiliate_banners['affiliate_products_id'] . "' and language_id = '" . $languages_id . "'");
+      $affiliate_products = tep_db_fetch_array($affiliate_products_query);
+      $prod_id = $affiliate_banners['affiliate_products_id'];
+      $ban_id = $affiliate_banners['affiliate_banners_id'];
+      switch (AFFILIATE_KIND_OF_BANNERS) {
+        case 1: // Link to Products
+          if ($prod_id > 0) {
+            $link = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&amp;products_id=' . $prod_id . '&amp;affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
+          } else { // generic_link
+            $link = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&amp;affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
+          }
+          break;
+        case 2: // Link to Products
+          if ($prod_id > 0) {
+            $link = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&amp;products_id=' . $prod_id . '&amp;affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&amp;affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
+          } else { // generic_link
+            $link = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&amp;affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&amp;affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
+          }
+          break;
+      }
+
+?>
+    <tr>
+      <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_NAME . ' ' . $affiliate_banners['affiliate_banners_title']; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center"><br><?php echo $link; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td>
+          </tr>
+          <tr>
+            <td class="smallText" align="center"><?php echo tep_draw_textarea_field('affiliate_banner', 'soft', '60', '6', $link); ?></td>
+          </tr>
+
+     </table></td>
+          </tr>
+  <?php
+  }
+      }
+  ?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+
+        </table></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/affiliate_clicks.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_clicks.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_clicks.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,133 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+  $header_text = '&nbsp;'
+ //EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" colspan="4"><?php echo TEXT_AFFILIATE_HEADER . ' <b>' . $affiliate_clickthroughs_numrows; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="4">
+          <tr>
+            <td class="infoBoxHeading"><?php echo TABLE_HEADING_DATE; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_HELP_9) . '\')"> ' . TEXT_CLICKTHROUGH_HELP . '</a>'; ?></td>
+          <td class="infoBoxHeading"><?php echo TABLE_HEADING_CLICKED_PRODUCT; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_HELP_10) . '\')"> ' . TEXT_CLICKTHROUGH_HELP . '</a>'; ?></td>
+          <td class="infoBoxHeading"><?php echo TABLE_HEADING_REFFERED; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_AFFILIATE_HELP_11) . '\')"> ' . TEXT_CLICKTHROUGH_HELP . '</a>'; ?></td>
+          </tr>
+<?php
+  if ($affiliate_clickthroughs_split->number_of_rows > 0) {
+    $affiliate_clickthroughs_values = tep_db_query($affiliate_clickthroughs_split->sql_query);
+    $number_of_clickthroughs = '0';
+    while ($affiliate_clickthroughs = tep_db_fetch_array($affiliate_clickthroughs_values)) {
+      $number_of_clickthroughs++;
+
+      if (($number_of_clickthroughs / 2) == floor($number_of_clickthroughs / 2)) {
+        echo '          <tr class="productListing-even">';
+      } else {
+        echo '          <tr class="productListing-odd">';
+      }
+?>
+            <td class="smallText"><?php echo tep_date_short($affiliate_clickthroughs['affiliate_clientdate']); ?></td>
+<?php
+      if ($affiliate_clickthroughs['affiliate_products_id'] > 0) {
+        $link_to = '<a href="' . tep_href_link (FILENAME_PRODUCT_INFO, 'products_id=' . $affiliate_clickthroughs['affiliate_products_id']) . '" target="_blank">' . $affiliate_clickthroughs['products_name'] . '</a>';
+      } else {
+        $link_to = "Startpage";
+      }
+?>
+            <td class="smallText"><?php echo $link_to; ?></td>
+            <td class="smallText"><?php echo $affiliate_clickthroughs['affiliate_clientreferer']; ?></td>
+          </tr>
+          <tr>
+            <td colspan="4"><?php echo tep_draw_separator(); ?></td>
+          </tr>
+<?php
+    }
+  } else {
+?>
+          <tr class="productListing-odd">
+            <td colspan="4" class="smallText"><?php echo TEXT_NO_CLICKS; ?></td>
+          </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+<?php 
+  if ($affiliate_clickthroughs_split->number_of_rows > 0) {
+?>
+          <tr>
+            <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td class="smallText"><?php echo $affiliate_clickthroughs_split->display_count(TEXT_DISPLAY_NUMBER_OF_CLICKS); ?></td>
+                <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE; ?> <?php echo $affiliate_clickthroughs_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="left"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS, '') . '">' . tep_template_image_button('button_affiliate_banners.gif', IMAGE_BANNERS) . '</a></td><td align="right"> <a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '','SSL') . '">' . tep_template_image_button('button_affiliate_sales.gif', IMAGE_SALES) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </table></td>
+                </tr>
+              </table></td>
+            </tr>
+          </table></td>         
+        </tr>
+      </table></td>
+    </tr>
+  </table></td>
+<!-- content_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/affiliate_contact.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_contact.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_contact.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td align="right"><br><a href="<?php echo tep_href_link(FILENAME_AFFILIATE_SUMMARY); ?>"><?php echo tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  } else {
+?>
+      <tr>
+        <td><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_AFFILIATE_CONTACT, 'action=send', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="main"><?php echo ENTRY_NAME; ?><br><?php echo tep_draw_input_field('name', $affiliate['affiliate_firstname'] . ' ' . $affiliate['affiliate_lastname'], 'size=40'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_EMAIL; ?><br><?php echo tep_draw_input_field('email', $affiliate['affiliate_email_address'], 'size=40'); if ($error) echo ENTRY_EMAIL_ADDRESS_CHECK_ERROR; ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_ENQUIRY; ?></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, $HTTP_POST_VARS['enquiry']); ?></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="main" align="right"><br><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+          </tr>
+        </table></form></td>
+      </tr>
+<?php
+  }
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/affiliate_details.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_details.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_details.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,51 @@
+<?php echo tep_draw_form('affiliate_details', tep_href_link(FILENAME_AFFILIATE_DETAILS, '', 'SSL'), 'post', 'onSubmit="return check_form();"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+<?php
+ // require(DIR_WS_MODULES . 'affiliate_account_details.php');
+  require(DIR_WS_MODULES . FILENAME_AFFILIATE_ACCOUNT_DETAILS);
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td align="right" class="main"><br><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/affiliate_details_ok.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_details_ok.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_details_ok.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,61 @@
+<?php
+/*
+  $Id: affiliate_details_ok.php,v 2.00 2003/10/12
+
+  OSC-Affiliate
+
+  Contribution based on:
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 - 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+        <tr>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?> <?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+       
+          <td align="right" class="smallText"><br><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+        </tr>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/affiliate_logout.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_logout.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_logout.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+<?php
+  session_start();
+  $old_user = $affiliate_id;  // store  to test if they *were* logged in
+  $result = session_unregister("affiliate_id");
+
+//session_destroy();
+
+  if (!empty($old_user)) {
+    if ($result) { // if they were logged in and are not logged out 
+      echo '            <td class="main">' . TEXT_INFORMATION . '</td>';
+    } else { // they were logged in and could not be logged out
+      echo '            <td class="main">' . TEXT_INFORMATION_ERROR_1 . '</td>';
+    } 
+  } else { // if they weren't logged in but came to this page somehow
+    echo '            <td class="main">' . TEXT_INFORMATION_ERROR_2 . '</td>';
+  }
+?>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/affiliate_password_forgotten.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_password_forgotten.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_password_forgotten.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+         <tr>
+          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+            <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_password_forgotten.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_form('password_forgotten', tep_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTEN, 'action=process', 'SSL')); ?><br><table border="0" width="100%" cellspacing="0" cellpadding="3">
+          <tr>
+            <td align="right" class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+            <td class="main"><?php echo tep_draw_input_field('email_address', '', 'maxlength="96"'); ?></td>
+          </tr>
+          <tr>
+            <td colspan="2"><br><table border="0" cellpadding="0" cellspacing="0" width="100%">
+              <tr>
+                <td valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right" valign="top"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+<?php
+  if (isset($HTTP_GET_VARS['email']) && ($HTTP_GET_VARS['email'] == 'nonexistent')) {
+    echo '          <tr>' . "\n";
+    echo '            <td colspan="2" class="smallText">' .  TEXT_NO_EMAIL_ADDRESS_FOUND . '</td>' . "\n";
+    echo '          </tr>' . "\n";
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+        </table></form></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/affiliate_payment.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_payment.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_payment.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,121 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="main" colspan="4"><?php echo TEXT_AFFILIATE_HEADER . ' ' . tep_db_num_rows(tep_db_query($affiliate_payment_raw)); ?></td>
+          </tr>
+          <tr>
+            <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+  if ($affiliate_payment_split->number_of_rows > 0) {
+    $affiliate_payment_values = tep_db_query($affiliate_payment_split->sql_query);
+    $number_of_payment = 0;
+?>
+          <tr>
+            <td class="infoBoxHeading" align="right"><?php echo TABLE_HEADING_PAYMENT_ID; ?></td>
+            <td class="infoBoxHeading" align="center"><?php echo TABLE_HEADING_DATE; ?></td>
+            <td class="infoBoxHeading" align="right"><?php echo TABLE_HEADING_PAYMENT; ?></td>
+            <td class="infoBoxHeading" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+          </tr>
+<?php
+    while ($affiliate_payment = tep_db_fetch_array($affiliate_payment_values)) {
+      $number_of_payment++;
+
+      if (($number_of_payment / 2) == floor($number_of_payment / 2)) {
+        echo '          <tr class="productListing-even">';
+      } else {
+        echo '          <tr class="productListing-odd">';
+      }
+?>
+            <td class="smallText" align="right"><?php echo $affiliate_payment['affiliate_payment_id']; ?></td>
+            <td class="smallText" align="center"><?php echo tep_date_short($affiliate_payment['affiliate_payment_date']); ?></td>
+            <td class="smallText" align="right"><?php echo $currencies->display_price($affiliate_payment['affiliate_payment_total'], ''); ?></td>
+            <td class="smallText" align="right"><?php echo $affiliate_payment['affiliate_payment_status_name']; ?></td>
+          </tr>
+<?php
+    }
+  } else {
+?>
+          <tr class="productListing-odd">
+            <td colspan="4" class="main" align="center"><?php echo TEXT_NO_PAYMENTS; ?></td>
+          </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php 
+  if ($affiliate_payment_split->number_of_rows > 0) {
+?>    
+          <tr>
+            <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText"><?php echo $affiliate_payment_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAYMENTS); ?></td>
+                <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE; ?> <?php echo $affiliate_payment_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+<?php
+  }
+  $affiliate_payment_values = tep_db_query("select sum(affiliate_payment_total) as total from " . TABLE_AFFILIATE_PAYMENT . " where affiliate_id = '" . $affiliate_id . "'");
+  $affiliate_payment = tep_db_fetch_array($affiliate_payment_values);
+?>
+<?php 
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TEXT_INFORMATION_PAYMENT_TOTAL);
+}
+?>
+          <tr>
+            <td class="pageHeading" colspan="4" align="center"><?php echo $currencies->display_price($affiliate_payment['total'], ''); ?></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/affiliate_sales.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_sales.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_sales.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,118 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="main" colspan="5"><?php echo TEXT_AFFILIATE_HEADER . ' <b>' . tep_db_num_rows(tep_db_query($affiliate_sales_raw)) . '</b>'; ?></td>
+          </tr>
+          <tr>
+            <td colspan="5"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="infoBoxHeading" align="center"><?php echo TABLE_HEADING_DATE; ?></td>
+            <td class="infoBoxHeading" align="right"><?php echo TABLE_HEADING_VALUE; ?></td>
+            <td class="infoBoxHeading" align="right"><?php echo TABLE_HEADING_PERCENTAGE; ?></td>
+            <td class="infoBoxHeading" align="right"><?php echo TABLE_HEADING_SALES; ?></td>
+            <td class="infoBoxHeading" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
+          </tr>
+<?php
+  if ($affiliate_sales_split->number_of_rows > 0) {
+    $affiliate_sales_values = tep_db_query($affiliate_sales_split->sql_query);
+    $number_of_sales = 0;
+    $sum_of_earnings = 0;
+    while ($affiliate_sales = tep_db_fetch_array($affiliate_sales_values)) {
+      $number_of_sales++;
+      if ($affiliate_sales['orders_status_id'] >= AFFILIATE_PAYMENT_ORDER_MIN_STATUS) $sum_of_earnings += $affiliate_sales['affiliate_payment'];
+      if (($number_of_sales / 2) == floor($number_of_sales / 2)) {
+        echo '          <tr class="productListing-even">';
+      } else {
+        echo '          <tr class="productListing-odd">';
+      }
+?>
+            <td class="smallText" align="center"><?php echo tep_date_short($affiliate_sales['affiliate_date']); ?></td>
+            <td class="smallText" align="right"><?php echo $currencies->display_price($affiliate_sales['affiliate_value'], ''); ?></td>
+            <td class="smallText" align="right"><?php echo $affiliate_sales['affiliate_percent'] . " %"; ?></td>
+            <td class="smallText" align="right"><?php echo $currencies->display_price($affiliate_sales['affiliate_payment'], ''); ?></td>
+            <td class="smallText" align="right"><?php if ($affiliate_sales['orders_status']) echo $affiliate_sales['orders_status']; else echo TEXT_DELETED_ORDER_BY_ADMIN; ?></td>
+          </tr>
+<?php
+    }
+  } else {
+?>
+          <tr class="productListing-odd">
+            <td colspan="5" class="main" align="center"><?php echo TEXT_NO_SALES; ?></td>
+          </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php 
+  if ($affiliate_payment_split->number_of_rows > 0) {
+?>    
+          <tr>
+            <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText"><?php echo $affiliate_payment_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAYMENTS); ?></td>
+                <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE; ?> <?php echo $affiliate_payment_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+<?php
+  }
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TEXT_INFORMATION_SALES_TOTAL  . ' ' .  $currencies->display_price($sum_of_earnings,''));
+}
+?>
+          <tr>
+            <td class="main" colspan="5"><?php echo TEXT_INFORMATION_SALES_TOTAL . ' <b>' .  $currencies->display_price($sum_of_earnings,'') . '</b>' . TEXT_INFORMATION_SALES_TOTAL2 . '<br>'; ?></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </table></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/affiliate_signup.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_signup.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_signup.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php echo tep_draw_form('affiliate_signup',  tep_href_link(FILENAME_AFFILIATE_SIGNUP, '', 'SSL'), 'post') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+<?php
+  if (isset($HTTP_GET_VARS['affiliate_email_address'])) $a_email_address = tep_db_prepare_input($HTTP_GET_VARS['affiliate_email_address']);
+  $affiliate['affiliate_country_id'] = STORE_COUNTRY;
+
+  //require(DIR_WS_MODULES . 'affiliate_account_details.php');
+  require(DIR_WS_MODULES . FILENAME_AFFILIATE_ACCOUNT_DETAILS);
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td align="right" class="main"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+          </tr>
+                </table></td>
+              </tr>
+                </table></td>
+              </tr>
+
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/affiliate_signup_ok.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_signup_ok.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_signup_ok.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,13 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>
+            <td valign="top" class="main"><div align="center" class="pageHeading"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/affiliate_summary.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_summary.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_summary.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,116 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_GREETING . $affiliate['affiliate_firstname'] . ' ' . $affiliate['affiliate_lastname'] . '<br>' . TEXT_AFFILIATE_ID . $affiliate_id; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="infoboxheading"><?php echo TEXT_SUMMARY_TITLE; ?></td>
+              </tr>
+            </table></td>
+          </tr> 
+          <tr>
+            <td><table width="100%" border="0" cellpadding="4" cellspacing="2">
+              <center>
+                <tr>
+                  <td width="35%" align="right" class="boxtext"><?php echo TEXT_IMPRESSIONS; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_AFFILIATE_HELP,'action=1') . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="boxtext"><?php echo $affiliate_impressions; ?></td>
+                  <td width="35%" align="right" class="boxtext"><?php echo TEXT_VISITS; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_AFFILIATE_HELP,'action=2') . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="boxtext"><?php echo $affiliate_clickthroughs; ?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="boxtext"><?php echo TEXT_TRANSACTIONS; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_AFFILIATE_HELP,'action=3') . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="boxtext"><?php echo $affiliate_transactions; ?></td>
+                  <td width="35%" align="right" class="boxtext"><?php echo TEXT_CONVERSION; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_AFFILIATE_HELP,'action=4') . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="boxtext"><?php echo $affiliate_conversions;?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="boxtext"><?php echo TEXT_AMOUNT; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_AFFILIATE_HELP,'action=5') . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="boxtext"><?php echo $currencies->display_price($affiliate_amount, ''); ?></td>
+                  <td width="35%" align="right" class="boxtext"><?php echo TEXT_AVERAGE; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_AFFILIATE_HELP,'action=6') . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="boxtext"><?php echo $currencies->display_price($affiliate_average, ''); ?></td>
+                </tr>
+                <tr>
+                  <td width="35%" align="right" class="boxtext"><?php echo TEXT_COMMISSION_RATE; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_AFFILIATE_HELP,'action=7') . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="boxtext"><?php echo tep_round($affiliate_percent, 2). '%'; ?></td>
+                  <td width="35%" align="right" class="boxtext"><?php echo TEXT_COMMISSION; ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_AFFILIATE_HELP,'action=8') . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?></td>
+                  <td width="15%" class="boxtext"><?php echo $currencies->display_price($affiliate_commission, ''); ?></td>
+                </tr>
+                <tr>
+                  <td colspan="4"><?php echo tep_draw_separator(); ?></td>
+                </tr>
+                 <tr>
+                  <td align="center" class="boxtext" colspan="4"><b><?php echo TEXT_SUMMARY; ?><b></td>
+                </tr>
+                <tr>
+                  <td colspan="4"><?php echo tep_draw_separator(); ?></td>
+                </tr>
+              </center>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="left"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS, '') . '">' . tep_template_image_button('button_affiliate_banners.gif', IMAGE_BANNERS) . '</a></td><td align="center"> <a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '') . '">' . tep_template_image_button('button_affiliate_clickthroughs.gif', IMAGE_CLICKTHROUGHS) . '</a></td><td align="right"> <a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '','SSL') . '">' . tep_template_image_button('button_affiliate_sales.gif', IMAGE_SALES) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+        </table>

Added: trunk/direct.openmoko.com/templates/content/affiliate_terms.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/affiliate_terms.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/affiliate_terms.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_login.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table width="100%" border="0" cellspacing="0" cellpadding="1" class="infoBox">
+          <tr>
+            <td><table width="100%" border="0" cellspacing="0" cellpadding="4">
+              <tr>
+                <td class="infoBoxHeading"><?php echo HEADING_AFFILIATE_PROGRAM_TITLE; ?></td>
+              </tr>
+            </table>
+            <table width="100%" border="0" cellspacing="0" cellpadding="4" class="infoBoxContents">
+              <tr>
+                <td class="smallText"><?php echo TEXT_INFORMATION; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+            <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_SIGNUP, '', 'SSL') . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+            <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . tep_template_image_button('button_login.gif', IMAGE_BUTTON_LOGIN) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/all_prodcats.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/all_prodcats.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/all_prodcats.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,110 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+       </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table width="100%" cellspacing="0" cellpadding=0" border="0">
+        <tr class="productListing-heading">
+        <td align="left" class="productListing-heading"><?php echo HEADING_ALL_CATSUB; ?></td>
+       <td align="center" class="productListing-heading"><?php echo HEADING_ALL_PRODUCTS; ?></td>
+
+       </tr>
+<?php
+
+$language_code = (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) ? (int)$HTTP_GET_VARS['language'] : DEFAULT_LANGUAGE;
+
+$included_categories_query = tep_db_query("SELECT c.categories_id, c.parent_id, cd.categories_name FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id AND cd.language_id = FLOOR($languages_id)");
+
+$inc_cat = array();
+while ($included_categories = tep_db_fetch_array($included_categories_query)) {
+  $inc_cat[] = array (
+     'id' => $included_categories['categories_id'],
+     'parent' => $included_categories['parent_id'],
+     'name' => $included_categories['categories_name']);
+  }
+$cat_info = array();
+for ($i=0; $i<sizeof($inc_cat); $i++)
+  $cat_info[$inc_cat[$i]['id']] = array (
+    'parent'=> $inc_cat[$i]['parent'],
+    'name'  => $inc_cat[$i]['name'],
+    'path'  => $inc_cat[$i]['id'],
+    'link'  => '' );
+
+for ($i=0; $i<sizeof($inc_cat); $i++) {
+  $cat_id = $inc_cat[$i]['id'];
+  while ($cat_info[$cat_id]['parent'] != 0){
+    $cat_info[$inc_cat[$i]['id']]['path'] = $cat_info[$cat_id]['parent'] . '_' . $cat_info[$inc_cat[$i]['id']]['path'];
+    $cat_id = $cat_info[$cat_id]['parent'];
+    }
+  $link_array = split('_', $cat_info[$inc_cat[$i]['id']] ['path']);
+  for ($j=0; $j<sizeof($link_array); $j++) {
+    $cat_info[$inc_cat[$i]['id']]['link'] .= '&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cat_info[$link_array[$j]]['path']) . '"><nobr>' . $cat_info[$link_array[$j]]['name'] . '</nobr></a>&nbsp;&raquo;&nbsp;';
+    }
+  }
+
+$products_query = tep_db_query("SELECT p.products_id, pd.products_name, pc.categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc WHERE p.products_id = pd.products_id AND p.products_id = pc.products_id AND p.products_status = 1 AND pd.language_id = FLOOR($languages_id) ORDER BY pc.categories_id, pd.products_name");
+
+while($products = tep_db_fetch_array($products_query)) {
+  echo
+"          <tr>\n" .
+'           <td class="main">' . (($memory == $products['categories_id'])? '': $cat_info[$products['categories_id']]['link']) . "</td>\n" .
+'           <td class="main"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id'] . (($language_code == DEFAULT_LANGUAGE) ? '' : ('&amp;language=' . $language_code))) . '">' . $products['products_name'] . "</a></td>\n" .
+"          </tr>\n";
+  $memory = $products['categories_id'];
+  }
+
+?>
+            </td>
+          </tr>
+         </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/all_prodmanf.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/all_prodmanf.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/all_prodmanf.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,106 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+       </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table width="100%" cellspacing="0" cellpadding="0" border="0">
+        <tr class="productListing-heading">
+        <td align="left" class="productListing-heading"><?php echo HEADING_ALL_CATSUB; ?></td>
+       <td align="center" class="productListing-heading"><?php echo HEADING_ALL_PRODUCTS; ?></td>
+
+       </tr>
+<?php
+
+$language_code = (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) ? (int)$HTTP_GET_VARS['language'] : DEFAULT_LANGUAGE;
+
+$included_manufacturers_query = tep_db_query("SELECT m.manufacturers_id, mi.manufacturers_url, m.manufacturers_name FROM " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi WHERE m.manufacturers_id = mi.manufacturers_id AND mi.languages_id = FLOOR($languages_id) order by m.manufacturers_name");
+
+$inc_manf = array();
+while ($included_manufacturers = tep_db_fetch_array($included_manufacturers_query)) {
+  $inc_manf[] = array (
+     'id' => $included_manufacturers['manufacturers_id'],
+     'url' => $included_manufacturers['manufacturers_url'],
+     'name' => $included_manufacturers['manufacturers_name']);
+  }
+$manf_info = array();
+for ($i=0; $i<sizeof($inc_manf); $i++)
+  $manf_info[$inc_manf[$i]['id']] = array (
+    'name'  => $inc_manf[$i]['name'],
+    'path'  => $inc_manf[$i]['url'],
+    'link'  => '' );
+
+for ($i=0; $i<sizeof($inc_manf); $i++) {
+  $man_id = $inc_manf[$i]['id'];
+
+  $link_array = split('_', $manf_info[$inc_manf[$i]['id']] ['path']);
+  for ($j=0; $j<sizeof($link_array); $j++) {
+    $manf_info[$inc_manf[$i]['id']]['link'] .= '&nbsp;<a href="' . $manf_info[$inc_manf[$i]['id']] ['path'] . '"><nobr>' . $manf_info[$inc_manf[$i]['id']] ['name'] . '</nobr></a>&nbsp;&raquo;&nbsp;';
+    }
+  }
+
+$products_query = tep_db_query("SELECT p.products_id, pd.products_name, p.manufacturers_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.manufacturers_id = manufacturers_id AND p.products_id = pd.products_id AND p.products_status = 1 AND pd.language_id = FLOOR($languages_id) ORDER BY p.manufacturers_id, pd.products_name");
+
+while($products = tep_db_fetch_array($products_query)) {
+  echo
+"          <tr>\n" .
+'           <td class="main">' . (($memory == $products['manufacturers_id'])? '': $manf_info[$products['manufacturers_id']]['link']) . "</td>\n" .
+'           <td class="main"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id'] . (($language_code == DEFAULT_LANGUAGE) ? '' : ('&amp;language=' . $language_code))) . '">' . $products['products_name'] . "</a></td>\n" .
+"          </tr>\n";
+  $memory = $products['manufacturers_id'];
+  }
+
+?>
+            </td>
+          </tr>
+         </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/allprods.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/allprods.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/allprods.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,104 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// Set number of columns in listing
+define ('NR_COLUMNS', 2);?>
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+         <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+        <table border="0" width="100%" cellspacing="0" cellpadding="2">
+        <tr class="productListing-heading">
+        <td align="left" class="productListing-heading"><?php echo HEADING_TEXT_PRODUCT; ?></td>
+       <td align="center" class="productListing-heading"><?php echo HEADING_TEXT_MODEL; ?></td>
+       <td align="right" class="productListing-heading"><?php echo HEADING_TEXT_PRICE; ?>&nbsp;&nbsp;</td>
+       </tr>
+             <?php
+
+          $products_query = tep_db_query("SELECT p.products_id, p.products_model, p.products_price, p.products_tax_class_id, pd.products_name FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id = pd.products_id AND p.products_status = 1 AND pd.language_id = '" . (int)$languages_id . "' ORDER BY pd.products_name");
+            $rows = 0;     
+              while($products1 = tep_db_fetch_array($products_query)) {
+               $rows++;
+                      if (($rows/2) == floor($rows/2)) {
+                $row_col = '<tr class="productListing-even" >';
+                 } else {
+                 $row_col = '<tr class="productListing-odd" >';
+                 }
+                 
+                             $all_id       = $products1['products_id'] ;
+                             $all_name     = $products1['products_name'] ;
+                             $all_model    = $products1['products_model'] ;
+                             $all_price    = $products1['products_price'] ;
+                             $all_tax      = $products1['products_tax_class_id'] ;
+                             $this_url     = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $all_id, 'NONSSL');
+                             
+               echo $row_col ;
+               echo "<td class='productListing-data' align='left'><a href='$this_url'>$all_name</a></td>";
+               echo "<td class='productListing-data' align='center'><a href='$this_url'>$all_model</a></td>";
+               if  ( $all_special  = tep_get_products_special_price($all_id) )  {
+                  echo "<td class='productListing-data' align='right'><a href='$this_url'><span class='productSpecialPrice'>".$currencies->display_price($all_special, tep_get_tax_rate($all_tax ))."</span></a></td>";
+               }
+               else
+               {
+                  echo "<td class='productListing-data' align='right'><a href='$this_url'>".$currencies->display_price($all_price, tep_get_tax_rate($all_tax))."</a></td>";
+               }
+               echo "</tr>\n";
+            }
+
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+
+                <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+
+   </table>

Added: trunk/direct.openmoko.com/templates/content/article_info.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/article_info.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/article_info.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,191 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+  if ($article_check['total'] < 1) {
+?>
+     <tr>
+        <td><?php new infoBox(array(array('text' => HEADING_ARTICLE_NOT_FOUND))); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  } else {
+    $article_info_query = tep_db_query("select a.articles_id, a.articles_date_added, a.articles_date_available, a.authors_id, ad.articles_name, ad.articles_description, ad.articles_url, au.authors_name
+                                        from " . TABLE_ARTICLES . " a,
+                                             " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                             " . TABLE_AUTHORS . " au
+                                        where a.articles_status = '1'
+                                          and a.articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "'
+                                          and a.authors_id = au.authors_id
+                                          and ad.articles_id = a.articles_id
+                                          and ad.language_id = '" . (int)$languages_id . "'");
+    $article_info = tep_db_fetch_array($article_info_query);
+
+    tep_db_query("update " . TABLE_ARTICLES_DESCRIPTION . " set articles_viewed = articles_viewed+1 where articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and language_id = '" . (int)$languages_id . "'");
+
+    $articles_name = $article_info['articles_name'];
+    $articles_author_id = $article_info['authors_id'];
+    $articles_author = $article_info['authors_name'];
+ if (tep_not_null($articles_author)) $title_author = '<span class="smallText">' . TEXT_BY . '<a href="' . tep_href_link(FILENAME_ARTICLES,'authors_id=' . $articles_author_id) . '">' . $articles_author . '</a></span>';
+?>
+<?php
+// BOF: WebMakers.com Added: Show Featured Products
+if (SHOW_HEADING_TITLE_ORIGINAL=='yes') {
+$header_text = '&nbsp;';
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo $articles_name; ?></td>
+            <td class="pageHeading" align="right" valign="bottom"><?php echo $title_author; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text =  $articles_name .'&nbsp;&nbsp;' . $title_author;
+//if (tep_not_null($articles_author)) echo TEXT_BY . '<a href="' . tep_href_link(FILENAME_ARTICLES,'authors_id=' . $articles_author_id) . '">' . $articles_author . '</a>';
+}
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="main" valign="top">
+          <p><?php echo stripslashes($article_info['articles_description']); ?></p>
+        </td>
+      </tr>
+<?php
+    if (tep_not_null($article_info['articles_url'])) {
+?>
+      <tr>
+        <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&amp;goto=' . urlencode($article_info['articles_url']), 'NONSSL', true, false)); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    }
+
+    if ($article_info['articles_date_available'] > date('Y-m-d H:i:s')) {
+?>
+      <tr>
+        <td align="left" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($article_info['articles_date_available'])); ?></td>
+      </tr>
+<?php
+    } else {
+?>
+      <tr>
+        <td align="left" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($article_info['articles_date_added'])); ?></td>
+      </tr>
+<?php
+    }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  if (ENABLE_ARTICLE_REVIEWS == 'true') {
+    $reviews_query = tep_db_query("select count(*) as count from " . TABLE_ARTICLE_REVIEWS . " where articles_id = '" . (int)$HTTP_GET_VARS['articles_id'] . "' and approved = '1'");
+    $reviews = tep_db_fetch_array($reviews_query);
+?>
+      <tr>
+        <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
+      </tr>
+<?php
+    if ($reviews['count'] <= 0) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS_WRITE, tep_get_all_get_params()) . '">' . tep_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
+      </tr>
+<?php
+    } else {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS_WRITE, tep_get_all_get_params()) . '">' . tep_template_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a> '; ?>
+<?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params()) . '">' . tep_template_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
+      </tr>
+<?php
+    }
+  }
+?>
+      </tr></form>
+<!-- tell_a_friend //-->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+          <tr>
+            <td>
+<?php
+  if (ENABLE_TELL_A_FRIEND_ARTICLE == 'true') {
+    if (isset($HTTP_GET_VARS['articles_id'])) {
+      $info_box_contents1 = array();
+      $info_box_contents1[] = array('text' => BOX_TEXT_TELL_A_FRIEND);
+
+      new infoBoxHeading($info_box_contents1, false, false);
+
+      $info_box_contents1 = array();
+      $info_box_contents1[] = array('form' => tep_draw_form('tell_a_friend_article', tep_href_link(FILENAME_TELL_A_FRIEND_ARTICLE, '', 'NONSSL', false), 'get'),
+                                   'align' => 'left',
+                                   'text' => TEXT_TELL_A_FRIEND . '&nbsp;' . tep_draw_input_field('to_email_address', '', 'size="40" maxlength="40" style="width: ' . (BOX_WIDTH-30) . 'px"') . '&nbsp;' . tep_draw_hidden_field('articles_id', $HTTP_GET_VARS['articles_id']) . tep_hide_session_id() . tep_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) );
+
+      new infoBox($info_box_contents1);
+    }
+$info_box_contents1 = array();
+  $info_box_contents1[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+  new infoboxFooter($info_box_contents1, true, true);
+  }
+?>
+            </td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>          
+<!-- tell_a_friend_eof //-->
+      <tr>
+        <td>
+<?php
+//added for cross-sell
+   if ( (USE_CACHE == 'true') && !SID) {
+     include(DIR_WS_MODULES . FILENAME_ARTICLES_XSELL);
+   } else {
+     include(DIR_WS_MODULES . FILENAME_ARTICLES_XSELL);
+    }
+   }
+?>
+        </td>
+      </tr>
+    </table></td>
+<!-- body_text_eof //-->

Added: trunk/direct.openmoko.com/templates/content/article_reviews.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/article_reviews.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/article_reviews.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,149 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;' ;
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+              <td class="pageHeading" valign="top"><?php echo HEADING_TITLE . '\'' . $articles_name . '\''; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = HEADING_TITLE . '\'' . $articles_name . '\'';
+}
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.reviews_read, r.date_added, r.customers_name from " . TABLE_ARTICLE_REVIEWS . " r, " . TABLE_ARTICLE_REVIEWS_DESCRIPTION . " rd where r.articles_id = '" . (int)$article_info['articles_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.approved = '1' order by r.reviews_id desc";
+  $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
+
+  if ($reviews_split->number_of_rows > 0) {
+    if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
+?>
+                  <tr>
+                    <td>
+                      <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                        <tr>
+                          <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                          <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></td>
+                        </tr>
+                      </table>
+                    </td>
+                  </tr>
+<?php
+    }
+
+    $reviews_query = tep_db_query($reviews_split->sql_query);
+    while ($reviews = tep_db_fetch_array($reviews_query)) {
+?>
+                  <tr>
+                    <td>
+                      <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                        <tr>
+                          <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS_INFO, 'articles_id=' . $article_info['articles_id'] . '&amp;reviews_id=' . $reviews['reviews_id']) . '"><u><b><font color="Black">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</font></b></u></a> (' . TEXT_REVIEW_VIEWS . $reviews['reviews_read'] . ')'; ?></td>
+                          <td class="smallText" align="right"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])); ?></td>
+                        </tr>
+                      </table>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td>
+                      <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                        <tr class="infoBoxContents">
+                          <td>
+                            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                              <tr>
+                                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                                <td valign="top" class="main"><?php echo tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br>') . '<br>' . '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS_INFO, 'articles_id=' . $article_info['articles_id'] . '&amp;reviews_id=' . $reviews['reviews_id']) . '">' . TEXT_READ_REVIEW . '</a><br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>'; ?></td>
+                                <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                              </tr>
+                            </table>
+                          </td>
+                        </tr>
+                      </table>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                  </tr>
+<?php
+}
+  if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
+?>
+                  <tr>
+                    <td>
+                      <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                        <tr>
+                          <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                          <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></td>
+                        </tr>
+                      </table>
+                    </td>
+                  </tr>
+
+<?php
+  }
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+    } else {
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+                  <tr>
+                    <td><?php new infoBox(array(array('text' => TEXT_NO_ARTICLE_REVIEWS))); ?></td>
+                  </tr>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  }
+
+
+?>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                                <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_INFO, tep_get_all_get_params()) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                                <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS_WRITE, tep_get_all_get_params()) . '">' . tep_template_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                     </table></td>
+                  </tr>
+                 </table></td>
+              </tr>
+   </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/article_reviews_info.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/article_reviews_info.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/article_reviews_info.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,104 @@
+<?php
+/*
+  $Id: article_reviews_info.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+  Chain Reaction Works, Inc.
+  
+  Copyright &copy; 2005-2006
+  
+  Last Modified By : $Author$
+  Last Modified On : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- articles_reviews.tpl.php //-->
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo HEADING_TITLE . '\'' . $articles_name . '\''; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = HEADING_TITLE . '\'' . $articles_name . '\'';
+}
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo '<b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($review['customers_name'])) . '</b>'; ?></td>
+                    <td class="smallText" align="right"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($review['date_added'])); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td valign="top" class="main"><?php echo tep_break_string(nl2br(tep_output_string_protected($review['reviews_text'])), 60, '-<br>') . '<br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $review['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $review['reviews_rating'])) . '</i>'; ?></td>
+                        <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params(array('reviews_id'))) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                        <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS_WRITE, tep_get_all_get_params(array('reviews_id'))) . '">' . tep_template_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/content/article_reviews_write.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/article_reviews_write.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/article_reviews_write.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,99 @@
+<?php echo tep_draw_form('article_reviews_write', tep_href_link(FILENAME_ARTICLE_REVIEWS_WRITE, 'action=process&amp;articles_id=' . $HTTP_GET_VARS['articles_id']), 'post', 'onSubmit="return checkForm();"'); ?>
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo HEADING_TITLE . $articles_name . '\''; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text =  HEADING_TITLE . $articles_name . '\'';
+}
+?>
+
+<?php
+  if ($messageStack->size('review') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('review'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main" colspan="2"><?php echo '<b>' . SUB_TITLE_FROM . '</b> ' . tep_output_string_protected($customer['customers_firstname'] . ' ' . $customer['customers_lastname']); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><b><?php echo SUB_TITLE_REVIEW; ?></b></td>
+                <td align="right" class="main"><?php echo TEXT_APPROVAL_WARNING; ?></td>
+              </tr>
+              <tr>
+                <td colspan="2"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="2" cellpadding="2">
+                      <tr>
+                        <td class="main"><?php echo tep_draw_textarea_field('review', 'soft', 60, 15); ?></td>
+                      </tr>
+                      <tr>
+                        <td class="main"><?php echo '<b>' . SUB_TITLE_RATING . '</b> ' . TEXT_BAD . ' ' . tep_draw_radio_field('rating', '1') . ' ' . tep_draw_radio_field('rating', '2') . ' ' . tep_draw_radio_field('rating', '3') . ' ' . tep_draw_radio_field('rating', '4') . ' ' . tep_draw_radio_field('rating', '5') . ' ' . TEXT_GOOD; ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+      </table></td>
+           </tr>
+    </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_REVIEWS, tep_get_all_get_params(array('reviews_id', 'action'))) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                        <td class="main" align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/content/article_search.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/article_search.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/article_search.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,117 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE_2; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE_2;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="main"><?php
+  if ($akeywords == ""){
+?>  
+    <table>
+    <tr>
+      <td class="main"><?php echo ERROR_INPUT; ?></td>
+    </tr>
+  </table>
+<?php
+    } else {     
+  
+  if (isset($HTTP_GET_VARS['description'])) {
+    $search_query = tep_db_query("select ad.articles_name, a.articles_id, ad.articles_description from " . TABLE_ARTICLES_DESCRIPTION . " ad inner join " . TABLE_ARTICLES . " a on ad.articles_id = a.articles_id where a.articles_status = '1' and ad.language_id = '" . (int)$languages_id . "' and (ad.articles_name like '%" . $akeywords . "%' or ad.articles_description like '%" . $akeywords . "%' or ad.articles_head_desc_tag like '%" . $akeywords . "%' or ad.articles_head_keywords_tag like '%" . $akeywords . "%' or ad.articles_head_title_tag like '%" . $akeywords . "%') order by ad.articles_name ASC");
+  }  else {
+    $search_query = tep_db_query("select ad.articles_name, a.articles_id, ad.articles_description from " . TABLE_ARTICLES_DESCRIPTION . " ad inner join " . TABLE_ARTICLES . " a on ad.articles_id = a.articles_id where a.articles_status='1' and ad.language_id = '" . (int)$languages_id . "' and (ad.articles_name like '%" . $akeywords . "%' or ad.articles_head_desc_tag like '%" . $akeywords . "%' or ad.articles_head_keywords_tag like '%" . $akeywords . "%' or ad.articles_head_title_tag like '%" . $akeywords . "%') order by ad.articles_name ASC");
+  }    
+    $count=0;
+?>
+        <table>  
+      <tr>
+            <td width="50%" height="100%" valign="top"><table border="0" width="100%" height="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0">
+          <tr>
+                  <td valign="middle" align="center" width="33%"><b><?php echo TEXT_ARTICLE_NAME; ?></font></b></td>
+                  <td valign="middle" align="center"><b><?php echo TEXT_ARTICLE_EXCERPT; ?></font></b></td>
+                </tr>
+
+<?php   
+    while($results = tep_db_fetch_array($search_query)){
+    $article_ex = substr($results['articles_description'], 0, 500);
+    
+?>
+           <tr>
+            <td colspan="2"><hr color="#2E3E67" size="1"></td>
+           </tr>
+                 <tr>
+                   <td class = "main" valign="top" align="center"><a href="<?php echo FILENAME_ARTICLE_INFO; ?>?articles_id=<?php echo $results['articles_id'] ?>"><b><u><?php echo $results['articles_name'] ?></b></u></a></td>
+                   <td class = "smallText" valign = "top">
+           <!--Article Start-->
+           <?php echo strip_tags($article_ex)?> ...
+           <!--Article End-->
+           </td>
+               </tr>
+
+      
+<?php
+    $count++;
+  } 
+  if ($count == 0){
+?>  
+
+                  <tr>
+            <td colspan="2"><hr color="#2E3E67" size="1"></td>
+           </tr>
+           <tr>
+                <td class="main" colspan="2" align="center"><?php echo TEXT_NO_ARTICLES ?></td>
+               </tr>
+<?php 
+  }  
+?>
+                 </table></td>
+         </tr>
+        </table></td>
+    </tr>         
+  </table>        
+<?php
+  }
+?>
+       </td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </table></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/articles.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/articles.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/articles.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,476 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+  <?php
+  if ($topic_depth == 'nested') {
+    $topic_query = tep_db_query("select td.topics_name, td.topics_heading_title, td.topics_description from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.topics_id = '" . (int)$current_topic_id . "' and td.topics_id = '" . (int)$current_topic_id . "' and td.language_id = '" . (int)$languages_id . "'");
+    $topic = tep_db_fetch_array($topic_query);
+?>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td valign="top" class="pageHeading"><?php
+/* bof catdesc for bts1a, replacing "echo HEADING_TITLE;" by "topics_heading_title" */
+             if ( tep_not_null($topic['topics_heading_title']) ) {
+                 echo $topic['topics_heading_title'];
+               } else {
+                 echo HEADING_TITLE;
+               }
+/* eof catdesc for bts1a */ ?></td>
+          <td valign="top" class="pageHeading" align="right"></td>
+        </tr>
+        <?php if ( tep_not_null($topic['topics_description']) ) { ?>
+        <tr>
+          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+        </tr>
+        <tr>
+          <td align="left" colspan="2" class="main"><?php echo $topic['topics_description']; ?></td>
+        </tr>
+        <tr>
+          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+        </tr>
+        <?php } ?>
+      </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+        <tr>
+          <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <?php
+    if (isset($tPath) && strpos('_', $tPath)) {
+// check to see if there are deeper topics within the current topic
+      $topic_links = array_reverse($tPath_array);
+      for($i=0, $n=sizeof($topic_links); $i<$n; $i++) {
+        $topics_query = tep_db_query("select count(*) as total from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$topic_links[$i] . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "'");
+        $topics = tep_db_fetch_array($topics_query);
+        if ($topics['total'] < 1) {
+          // do nothing, go through the loop
+        } else {
+          $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$topic_links[$i] . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+          break; // we've found the deepest topic the customer is in
+        }
+      }
+    } else {
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$current_topic_id . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+    }
+
+// needed for the new articles module shown below
+    $new_articles_topic_id = $current_topic_id;
+?>
+              </tr>
+            </table></td>
+        </tr>
+        <tr>
+          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+        </tr>
+        <tr>
+          <td><?php /*include(DIR_WS_MODULES . FILENAME_NEW_ARTICLES); */ ?></td>
+        </tr>
+      </table></td>
+  </tr>
+</table>
+</td>
+<?php
+  } elseif ($topic_depth == 'articles' || isset($HTTP_GET_VARS['authors_id'])) {
+
+/* bof catdesc for bts1a */
+// Get the topic name and description from the database
+    $topic_query = tep_db_query("select td.topics_name, td.topics_heading_title, td.topics_description from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.topics_id = '" . (int)$current_topic_id . "' and td.topics_id = '" . (int)$current_topic_id . "' and td.language_id = '" . (int)$languages_id . "'");
+    $topic = tep_db_fetch_array($topic_query);
+/* bof catdesc for bts1a */
+
+// show the articles of a specified author
+    if (isset($HTTP_GET_VARS['authors_id'])) {
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+// We are asked to show only a specific topic
+        $listing_sql = "select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id
+                        from " . TABLE_ARTICLES . " a,
+                             " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                             " . TABLE_AUTHORS . " au,
+                             " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                             " . TABLE_TOPICS_DESCRIPTION . " td
+                        where a.articles_status = '1'
+                          and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                          and au.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "'
+                          and a.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "'
+                          and a.articles_id = a2t.articles_id
+                          and ad.articles_id = a2t.articles_id
+                          and a2t.topics_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                          and td.topics_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                          and ad.language_id = '" . (int)$languages_id . "'
+                          and td.language_id = '" . (int)$languages_id . "'
+                        order by a.articles_date_added desc, ad.articles_name";
+      } else {
+// We show them all
+        $listing_sql = "select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id
+                        from " . TABLE_ARTICLES . " a,
+                             " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                             " . TABLE_AUTHORS . " au,
+                             " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                             " . TABLE_TOPICS_DESCRIPTION . " td
+                        where a.articles_status = '1'
+                          and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                          and au.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "'
+                          and a.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "'
+                          and a.articles_id = a2t.articles_id
+                          and ad.articles_id = a2t.articles_id
+                          and a2t.topics_id = td.topics_id
+                          and ad.language_id = '" . (int)$languages_id . "'
+                          and td.language_id = '" . (int)$languages_id . "'
+                        order by a.articles_date_added desc, ad.articles_name";
+      }
+    } else {
+// show the articles in a given category
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+// We are asked to show only specific catgeory
+        $listing_sql = "select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id
+                        from " . TABLE_ARTICLES . " a,
+                             " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                             " . TABLE_AUTHORS . " au,
+                             " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                             " . TABLE_TOPICS_DESCRIPTION . " td
+                        where a.articles_status = '1'
+                          and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                          and au.authors_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                          and a.authors_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                          and a.articles_id = a2t.articles_id
+                          and ad.articles_id = a2t.articles_id
+                          and a2t.topics_id = '" . (int)$current_topic_id . "'
+                          and td.topics_id = '" . (int)$current_topic_id . "'
+                          and ad.language_id = '" . (int)$languages_id . "'
+                          and td.language_id = '" . (int)$languages_id . "'
+                        order by a.articles_date_added desc, ad.articles_name";
+      } else {
+// We show them all
+        $listing_sql = "select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id
+                        from " . TABLE_ARTICLES . " a,
+                             " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                             " . TABLE_AUTHORS . " au,
+                             " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                             " . TABLE_TOPICS_DESCRIPTION . " td
+                        where a.articles_status = '1'
+                          and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                          and a.authors_id = au.authors_id
+                          and a.articles_id = a2t.articles_id
+                          and ad.articles_id = a2t.articles_id
+                          and a2t.topics_id = '" . (int)$current_topic_id . "'
+                          and td.topics_id = '" . (int)$current_topic_id . "'
+                          and ad.language_id = '" . (int)$languages_id . "'
+                          and td.language_id = '" . (int)$languages_id . "'
+                        order by a.articles_date_added desc, ad.articles_name";
+      }
+    }
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+  <?php
+           /* bof catdesc for bts1a, replacing "echo HEADING_TITLE;" by "topics_heading_title" */
+               if ( tep_not_null($topic['topics_heading_title']) ) {
+                 $_heading_title = $topic['topics_heading_title'];
+               } else {
+                 $_heading_title =  HEADING_TITLE;
+               }
+
+             if (isset($HTTP_GET_VARS['authors_id'])) {
+               $author_query = tep_db_query("select au.authors_name, aui.authors_description, aui.authors_url from " . TABLE_AUTHORS . " au, " . TABLE_AUTHORS_INFO . " aui where au.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "' and au.authors_id = aui.authors_id and aui.languages_id = '" . (int)$languages_id . "'");
+               $authors = tep_db_fetch_array($author_query);
+               $author_name = $authors['authors_name'];
+               $authors_description = $authors['authors_description'];
+               $authors_url = $authors['authors_url'];
+
+               $_author_name =  TEXT_ARTICLES_BY . $author_name;
+             }
+
+           /* eof catdesc for bts1a */
+                  ?>
+  <?php
+// BOF: WebMakers.com Added: Show Featured Products
+if (SHOW_HEADING_TITLE_ORIGINAL=='yes') {
+$header_text = $_heading_title .'&nbsp;&nbsp;' . $_author_name;
+?>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td class="pageHeading" valign="top"><?php echo $_heading_title; ?></td>
+          <td class="pageHeading" align="right" valign="top"><?php echo $_author_name; ?></td>
+        </tr>
+      </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <?php
+}else{
+$header_text =  $_heading_title .'&nbsp;&nbsp;' . $_author_name;
+}
+?>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td valign="top" align="left" class="pageHeading"></td>
+          <?php
+// optional Article List Filter
+    if (ARTICLE_LIST_FILTER) {
+      if (isset($HTTP_GET_VARS['authors_id'])) {
+        $filterlist_sql = "select distinct t.topics_id as id, td.topics_name as name from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t, " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where a.articles_status = '1' and a.articles_id = a2t.articles_id and a2t.topics_id = t.topics_id and a2t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' and a.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "' order by td.topics_name";
+      } else {
+        $filterlist_sql= "select distinct au.authors_id as id, au.authors_name as name from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t, " . TABLE_AUTHORS . " au where a.articles_status = '1' and a.authors_id = au.authors_id and a.articles_id = a2t.articles_id and a2t.topics_id = '" . (int)$current_topic_id . "' order by au.authors_name";
+      }
+      $filterlist_query = tep_db_query($filterlist_sql);
+      if (tep_db_num_rows($filterlist_query) > 1) {
+        echo '<td align="right" class="main"><' . tep_draw_form('filter', FILENAME_ARTICLES, 'get') . TEXT_SHOW . '&nbsp;';
+        if (isset($HTTP_GET_VARS['authors_id'])) {
+          echo tep_draw_hidden_field('authors_id', $HTTP_GET_VARS['authors_id']);
+          $options = array(array('id' => '', 'text' => TEXT_ALL_TOPICS));
+        } else {
+          echo tep_draw_hidden_field('tPath', $tPath);
+          $options = array(array('id' => '', 'text' => TEXT_ALL_AUTHORS));
+        }
+        echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
+        while ($filterlist = tep_db_fetch_array($filterlist_query)) {
+          $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
+        }
+        echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
+        echo '</form></td>' . "\n";
+      }
+    }
+    ?>
+</table></td>
+</tr>
+
+<?php
+if ( tep_not_null($topic['topics_description']) ) {
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>     <tr><td>
+          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
+            <tr>
+              <td class="main"><?php echo $topic['topics_description']; ?></td>
+            </tr>
+            <?php if (tep_not_null($authors_description)) { ?>
+            <tr>
+              <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+            </tr>
+            <tr>
+              <td class="main" valign="top"><?php echo $authors_description; ?></td>
+            <tr>
+              <?php } ?>
+              <?php if (tep_not_null($authors_url)) { ?>
+            <tr>
+              <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            </tr>
+            <tr>
+              <td class="main" valign="top"><?php echo sprintf(TEXT_MORE_INFORMATION, $authors_url); ?></td>
+            </tr>
+            <?php } ?>
+            <tr>
+              <td>&nbsp;</td>
+            </tr>
+          </table> </td</tr>
+          <?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+
+}
+?>
+      
+  </tr>
+  <?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+  <tr>
+    <td class="main"><?php include(DIR_WS_MODULES . FILENAME_ARTICLE_LISTING); ?></td>
+  </tr>
+  <?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+</table>
+</td>
+<?php
+  } else { // default page
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+<tr>
+  <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+        <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_reviews_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+      </tr>
+    </table></td>
+</tr>
+<tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+</tr>
+<?php
+}else{
+$header_text =  HEADING_TITLE;
+}
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+// Kiran :: Upcoming articles query, moved from modules/articles_upcoming.php
+  $expected_query = tep_db_query("select a.articles_id, a.articles_date_added, a.articles_date_available as date_expected, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t, " . TABLE_TOPICS_DESCRIPTION . " td, " . TABLE_AUTHORS . " au, " . TABLE_ARTICLES_DESCRIPTION . " ad where to_days(a.articles_date_available) > to_days(now()) and a.articles_id = a2t.articles_id and a2t.topics_id = td.topics_id and a.authors_id = au.authors_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' order by date_expected limit " . MAX_DISPLAY_UPCOMING_ARTICLES);
+  if (tep_db_num_rows($expected_query) > 0) {
+?>
+<tr>
+  <td><?php include(DIR_WS_MODULES . FILENAME_ARTICLES_UPCOMING); ?></td>
+</tr>
+<tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+</tr>
+<?php 
+} 
+// Kiran :: Upcoming articles query, moved from modules/articles_upcoming.php
+?>
+<tr>
+  <td class="pageHeading"><?php echo '<b>' . TEXT_CURRENT_ARTICLES . '</b>'; ?></td>
+</tr>
+<?php
+  $articles_all_array = array();
+  $articles_all_query_raw = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name
+                             from " . TABLE_ARTICLES . " a,
+                                  " . TABLE_AUTHORS . " au,
+                                  " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                  " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                  " . TABLE_TOPICS_DESCRIPTION . " td
+                             where a.articles_status = '1'
+                               and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                               and a.authors_id = au.authors_id
+                               and a.articles_id = a2t.articles_id
+                               and a.articles_id = ad.articles_id
+                               and a2t.topics_id = td.topics_id 
+                               and ad.language_id = '" . (int)$languages_id . "'
+                               and td.language_id = '" . (int)$languages_id . "'
+                            order by a.articles_date_added desc, ad.articles_name";
+
+  $articles_all_split = new splitPageResults($articles_all_query_raw, MAX_ARTICLES_PER_PAGE);
+  if (($articles_all_split->number_of_rows > 0) && ((ARTICLE_PREV_NEXT_BAR_LOCATION == 'top') || (ARTICLE_PREV_NEXT_BAR_LOCATION == 'both'))) {
+?>
+<tr>
+  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="smallText"><?php echo $articles_all_split->display_count(TEXT_DISPLAY_NUMBER_OF_ARTICLES); ?></td>
+        <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $articles_all_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+      </tr>
+    </table></td>
+</tr>
+<tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+</tr>
+<?php
+  }
+?>
+<tr>
+  <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <?php
+  if ($articles_all_split->number_of_rows > 0) {
+    $articles_all_query = tep_db_query($articles_all_split->sql_query);
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <?php
+    while ($articles_all = tep_db_fetch_array($articles_all_query)) {
+?>
+      <tr>
+        <td valign="top" class="main" width="75%"><?php
+  echo '<a href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $articles_all['articles_id']) . '"><b>' . $articles_all['articles_name'] . '</b></a> ';
+  if (DISPLAY_AUTHOR_ARTICLE_LISTING == 'true' && tep_not_null($articles_all['authors_name'])) {
+   echo TEXT_BY . ' ' . '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $articles_all['authors_id']) . '"> ' . $articles_all['authors_name'] . '</a>';
+  }
+?>
+        </td>
+        <?php
+      if (DISPLAY_TOPIC_ARTICLE_LISTING == 'true' && tep_not_null($articles_all['topics_name'])) {
+?>
+        <td valign="top" class="main" width="25%" nowrap><?php echo TEXT_TOPIC . '&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $articles_all['topics_id']) . '">' . $articles_all['topics_name'] . '</a>'; ?></td>
+        <?php
+      }
+?>
+      </tr>
+      <?php
+      if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true') {
+?>
+      <tr>
+        <td class="main" style="padding-left:15px"><?php echo clean_html_comments(substr($articles_all['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_all['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>
+      </tr>
+      <?php
+      }
+      if (DISPLAY_DATE_ADDED_ARTICLE_LISTING == 'true') {
+?>
+      <tr>
+        <td class="smalltext" style="padding-left:15px"><?php echo TEXT_DATE_ADDED . ' ' . tep_date_long($articles_all['articles_date_added']); ?></td>
+      </tr>
+      <?php
+      }
+      if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true' || DISPLAY_DATE_ADDED_ARTICLE_LISTING) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <?php
+ }
+    } // End of listing loop
+  } else {
+?>
+      <tr>
+        <td class="main"><?php echo TEXT_NO_ARTICLES; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+    </table></td>
+</tr>
+<?php
+  if (($articles_all_split->number_of_rows > 0) && ((ARTICLE_PREV_NEXT_BAR_LOCATION == 'bottom') || (ARTICLE_PREV_NEXT_BAR_LOCATION == 'both'))) {
+?>
+<tr>
+  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+        <td class="smallText"><?php echo $articles_all_split->display_count(TEXT_DISPLAY_NUMBER_OF_ARTICLES); ?></td>
+        <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $articles_all_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+      </tr>
+    </table></td>
+</tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+</table>
+<?php } ?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/articles_new.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/articles_new.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/articles_new.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,160 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: WebMakers.com Added: Show Featured Products
+if (SHOW_HEADING_TITLE_ORIGINAL=='yes') {
+$header_text = '&nbsp;';
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text =  HEADING_TITLE;
+}
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="main">
+
+<?php
+  $articles_new_array = array();
+  $articles_new_query_raw = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name
+                             from " . TABLE_ARTICLES . " a,
+                                  " . TABLE_AUTHORS . " au,
+                                  " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                  " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                  " . TABLE_TOPICS_DESCRIPTION . " td
+                             where a.articles_status = '1'
+                               and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                               and a.authors_id = au.authors_id
+                               and a.articles_id = a2t.articles_id
+                               and a.articles_id = ad.articles_id
+                               and a2t.topics_id = td.topics_id
+                               and ad.language_id = '" . (int)$languages_id . "'
+                               and td.language_id = '" . (int)$languages_id . "'
+                               and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY)
+                             order by a.articles_date_added desc, ad.articles_name";
+
+  $articles_new_split = new splitPageResults($articles_new_query_raw, MAX_NEW_ARTICLES_PER_PAGE);
+  if (($articles_new_split->number_of_rows > 0) && ((ARTICLE_PREV_NEXT_BAR_LOCATION == 'top') || (ARTICLE_PREV_NEXT_BAR_LOCATION == 'both'))) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText"><?php echo $articles_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_ARTICLES_NEW); ?></td>
+            <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $articles_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php
+  if ($articles_new_split->number_of_rows > 0) {
+    $articles_new_query = tep_db_query($articles_new_split->sql_query);
+?>
+      <tr>
+        <td class="main"><?php echo sprintf(TEXT_NEW_ARTICLES, NEW_ARTICLES_DAYS_DISPLAY); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    while ($articles_new = tep_db_fetch_array($articles_new_query)) {
+?>
+          <tr>
+            <td valign="top" class="main" width="75%">
+<?php
+  echo '<a href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $articles_new['articles_id']) . '"><b>' . $articles_new['articles_name'] . '</b></a> ';
+  if (DISPLAY_AUTHOR_ARTICLE_LISTING == 'true' && tep_not_null($articles_new['authors_name'])) {
+   echo TEXT_BY . ' ' . '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $articles_new['authors_id']) . '"> ' . $articles_new['authors_name'] . '</a>';
+  }
+?>
+            </td>
+<?php
+      if (DISPLAY_TOPIC_ARTICLE_LISTING == 'true' && tep_not_null($articles_new['topics_name'])) {
+?>
+            <td valign="top" class="main" width="25%" nowrap><?php echo TEXT_TOPIC . '&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $articles_new['topics_id']) . '">' . $articles_new['topics_name'] . '</a>'; ?></td>
+<?php
+      }
+?>
+          </tr>
+<?php
+      if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true') {
+?>
+          <tr>
+            <td class="main" style="padding-left:15px"><?php echo clean_html_comments(substr($articles_new['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_new['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>
+          </tr>
+<?php
+      }
+      if (DISPLAY_DATE_ADDED_ARTICLE_LISTING == 'true') {
+?>
+          <tr>
+            <td class="smalltext" style="padding-left:15px"><?php echo TEXT_DATE_ADDED . ' ' . tep_date_long($articles_new['articles_date_added']); ?></td>
+          </tr>
+<?php
+      }
+      if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true' || DISPLAY_DATE_ADDED_ARTICLE_LISTING) {
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+ }
+    } // End of listing loop
+  } else {
+?>
+          <tr>
+            <td class="main"><?php echo sprintf(TEXT_NO_NEW_ARTICLES, NEW_ARTICLES_DAYS_DISPLAY); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+  }
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if (($articles_new_split->number_of_rows > 0) && ((ARTICLE_PREV_NEXT_BAR_LOCATION == 'bottom') || (ARTICLE_PREV_NEXT_BAR_LOCATION == 'both'))) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText"><?php echo $articles_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_ARTICLES_NEW); ?></td>
+            <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $articles_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+    </table></td>

Added: trunk/direct.openmoko.com/templates/content/checkout_confirmation.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/checkout_confirmation.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/checkout_confirmation.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,334 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_confirmation.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+     <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+ 
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+<?php
+  if ($sendto != false) {
+?>
+            <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo '<b>' . HEADING_DELIVERY_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>
+              </tr>
+<?php
+    if ($order->info['shipping_method']) {
+?>
+              <tr>
+                <td class="main"><?php echo '<b>' . HEADING_SHIPPING_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo $order->info['shipping_method']; ?></td>
+              </tr>
+<?php
+    }
+?>
+            </table></td>
+<?php
+  }
+?>
+            <td width="<?php echo (($sendto != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (sizeof($order->info['tax_groups']) > 1) {
+?>
+                  <tr>
+                    <td class="main" colspan="2"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+                    <td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td>
+                    <td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
+                  </tr>
+<?php
+  } else {
+?>
+                  <tr>
+                    <td class="main" colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+                  </tr>
+<?php
+  }
+
+  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+    echo '          <tr>' . "\n" .
+         '            <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
+         '            <td class="main" valign="top">' . $order->products[$i]['name'];
+
+    if (STOCK_CHECK == 'true') {
+      echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);
+    }
+
+    if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
+      for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+        echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . ' ' . $order->products[$i]['attributes'][$j]['prefix'] . ' ' . $currencies->display_price($order->products[$i]['attributes'][$j]['price'], tep_get_tax_rate($products[$i]['tax_class_id']), 1)  . '</i></small></nobr>';
+      }
+    }
+
+    echo '</td>' . "\n";
+
+    if (sizeof($order->info['tax_groups']) > 1) echo '            <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
+
+    echo '            <td class="main" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '</td>' . "\n" .
+         '          </tr>' . "\n";
+  }
+?>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo '<b>' . HEADING_BILLING_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo '<b>' . HEADING_PAYMENT_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo $order->info['payment_method']; ?></td>
+              </tr>
+            </table></td>
+            <td width="70%" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (MODULE_ORDER_TOTAL_INSTALLED) {
+    $order_total_modules->process();
+    echo $order_total_modules->output();
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+// BOF: Lango modified for print order mod
+  if (is_array($payment_modules->modules)) {
+    if ($confirmation = $payment_modules->confirmation()) {
+      $payment_info = $confirmation['title'];
+      if (!tep_session_is_registered('payment_info')) tep_session_register('payment_info');
+// EOF: Lango modified for print order mod
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo HEADING_PAYMENT_INFORMATION; ?></b></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main" colspan="4"><?php echo $confirmation['title']; ?></td>
+              </tr>
+<?php
+      for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
+?>
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo $confirmation['fields'][$i]['title']; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo $confirmation['fields'][$i]['field']; ?></td>
+              </tr>
+<?php
+      }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+    }
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if (tep_not_null($order->info['comments'])) {
+?>
+      <tr>
+        <td class="main"><?php echo '<b>' . HEADING_ORDER_COMMENTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo nl2br(tep_output_string_protected($order->info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td>
+<?php
+  if (isset($$payment->form_action_url)) {
+    $form_action_url = $$payment->form_action_url;
+  } else {
+    $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
+  }
+
+if (ACCOUNT_CONDITIONS_REQUIRED == 'false' ){
+  echo tep_draw_form('checkout_confirmation', $form_action_url, 'post','');
+}else{
+  echo tep_draw_form('checkout_confirmation', $form_action_url, 'post','onsubmit="return checkCheckBox(this)"');
+}
+
+ if (is_array($payment_modules->modules)) {
+    echo $payment_modules->process_button();
+  }
+?>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  if (ACCOUNT_CONDITIONS_REQUIRED == 'true') {
+?>
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" colspan="2"><?php echo CONDITION_AGREEMENT; ?> <input type="checkbox" value="0" name="agree"></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+}
+?>
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td class="main" align="right"><?php  echo tep_template_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . "\n";?>        
+        </td>       
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+        
+          <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+          
+                <td class="main">
+    <?php echo HEADING_IPRECORDED_1;
+    $ip_iprecorded = YOUR_IP_IPRECORDED;
+    $isp_iprecorded = YOUR_ISP_IPRECORDED;
+    $ip = $HTTP_SERVER_VARS["REMOTE_ADDR"];
+    $client = gethostbyaddr($HTTP_SERVER_VARS["REMOTE_ADDR"]);
+    $str = preg_split("/\./", $client);
+    $i = count($str);
+    $x = $i - 1;
+    $n = $i - 2;
+    $isp = $str[$n] . "." . $str[$x]; ?>
+    <?php echo "<div align=\"justify\"><font size=\".1\">$ip_iprecorded: $ip<br>$isp_iprecorded: $isp"; ?></div>
+    </td>
+    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+
+              </tr>
+        
+            </table></form>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
+            <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_PAYMENT . '</a>'; ?></td>
+            <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/checkout_payment.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/checkout_payment.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/checkout_payment.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,324 @@
+    <?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_payment.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+ 
+<?php
+  if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
+//echo 'x_Invoice_Num ' . $x_Invoice_Num;
+    $sql_data_array = array('orders_id' =>  $order_id1,
+                           'orders_status_id' => '0',
+                           'date_added' => 'now()',
+                           'customer_notified' => '0',
+                           'comments' => $HTTP_GET_VARS['error_message']);
+   tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
+  
+
+}
+  if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">
+          <tr class="infoBoxNoticeContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_BILLING_ADDRESS);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// BOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+                <td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_BILLING_DESTINATION; ?><br><br><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . tep_template_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td>
+                <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main" align="center" valign="top"><b><?php echo TITLE_BILLING_ADDRESS; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+                    <td class="main" valign="top"><?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_PAYMENT_METHOD);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// BOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $selection = $payment_modules->selection();
+
+  if (sizeof($selection) > 1) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="50%" valign="top"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></td>
+                <td class="main" width="50%" valign="top" align="right"><b><?php echo TITLE_PLEASE_SELECT; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+  } else {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+  }
+
+  $radio_buttons = 0;
+  for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+    if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {
+      echo '                  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+    } else {
+      echo '                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+    }
+?>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td>
+                    <td class="main" align="right">
+<?php
+    if (sizeof($selection) > 1) {
+      echo tep_draw_radio_field('payment', $selection[$i]['id']);
+    } else {
+      echo tep_draw_hidden_field('payment', $selection[$i]['id']);
+    }
+?>
+                    </td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+    if (isset($selection[$i]['error'])) {
+?>
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="4"><?php echo $selection[$i]['error']; ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+    } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
+?>
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td colspan="4"><table border="0" cellspacing="0" cellpadding="2">
+<?php
+      for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
+?>
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
+                        <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+<?php
+      }
+?>
+                    </table></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+    }
+?>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+    $radio_buttons++;
+  }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  echo $order_total_modules->credit_selection();//ICW ADDED FOR CREDIT CLASS SYSTEM 
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_COMMENTS);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// BOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td class="main" align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
+            <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/checkout_payment_address.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/checkout_payment_address.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/checkout_payment_address.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,256 @@
+    <?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'), 'post', 'onSubmit="return check_form_optional(checkout_address);"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_payment.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  if ($messageStack->size('checkout_address') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('checkout_address'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+
+  if ($process == false) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_PAYMENT_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_PAYMENT_DESTINATION; ?></td>
+                <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main" align="center" valign="top"><?php echo '<b>' . TITLE_PAYMENT_ADDRESS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" valign="top"><?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    if ($addresses_count > 1) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_ADDRESS_BOOK_ENTRIES; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="50%" valign="top"><?php echo TEXT_SELECT_OTHER_PAYMENT_DESTINATION; ?></td>
+                <td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+      $radio_buttons = 0;
+
+      $addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
+      while ($addresses = tep_db_fetch_array($addresses_query)) {
+        $format_id = tep_get_address_format_id($addresses['country_id']);
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+       if ($addresses['address_book_id'] == $billto) {
+          echo '                  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+        } else {
+          echo '                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+        }
+?>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="2"><b><?php echo $addresses['firstname'] . ' ' . $addresses['lastname']; ?></b></td>
+                    <td class="main" align="right"><?php echo tep_draw_radio_field('address', $addresses['address_book_id'], ($addresses['address_book_id'] == $billto)); ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td colspan="3"><table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo tep_address_format($format_id, $addresses, true, ' ', ', '); ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+        $radio_buttons++;
+      }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    }
+  }
+
+  if ($addresses_count < MAX_ADDRESS_BOOK_ENTRIES) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_NEW_PAYMENT_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="100%" valign="top"><?php echo TEXT_CREATE_NEW_PAYMENT_ADDRESS; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td><?php require(DIR_WS_MODULES . 'checkout_new_address.php'); ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td class="main" align="right"><?php echo tep_draw_hidden_field('action', 'submit') . tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($process == true) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
+            <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/checkout_shipping.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/checkout_shipping.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/checkout_shipping.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,296 @@
+    <?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_delivery.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_SHIPPING_ADDRESS);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+                <td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_DESTINATION . '<br><br><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . tep_template_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td>
+                <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main" align="center" valign="top"><?php echo '<b>' . TITLE_SHIPPING_ADDRESS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+                    <td class="main" valign="top"><?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br>'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if (tep_count_shipping_modules() > 0) {
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_SHIPPING_METHOD);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+    if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?></td>
+                <td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+    } elseif ($free_shipping == false) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+    }
+
+    if ($free_shipping == true) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td colspan="2" width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b>&nbsp;<?php echo $quotes[$i]['icon']; ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+              </tr>
+<?php
+    } else {
+      $radio_buttons = 0;
+      for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="3"><b><?php echo $quotes[$i]['module']; ?></b>&nbsp;<?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+        if (isset($quotes[$i]['error'])) {
+?>
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="3"><?php echo $quotes[$i]['error']; ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+        } else {
+          for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
+// set the radio button to be checked if it is the method chosen
+            $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);
+
+            if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
+              echo '                  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+            } else {
+              echo '                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+            }
+?>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" width="75%"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td>
+<?php
+            if ( ($n > 1) || ($n2 > 1) ) {
+?>
+                    <td class="main"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>
+                    <td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>
+<?php
+            } else {
+?>
+                    <td class="main" align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>
+<?php
+            }
+?>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+<?php
+            $radio_buttons++;
+          }
+        }
+?>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
+              </tr>
+<?php
+      }
+    }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, TABLE_HEADING_COMMENTS);
+}else{
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td class="main" align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/content/checkout_shipping_address.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/checkout_shipping_address.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/checkout_shipping_address.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,237 @@
+    <?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'), 'post', 'onSubmit="return check_form_optional(checkout_address);"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_delivery.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if ($messageStack->size('checkout_address') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('checkout_address'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+
+  if ($process == false) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_SHIPPING_DESTINATION; ?></td>
+                <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main" align="center" valign="top"><?php echo '<b>' . TITLE_SHIPPING_ADDRESS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" valign="top"><?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br>'); ?></td>
+                    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    if ($addresses_count > 1) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_ADDRESS_BOOK_ENTRIES; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="50%" valign="top"><?php echo TEXT_SELECT_OTHER_SHIPPING_DESTINATION; ?></td>
+                <td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+      $radio_buttons = 0;
+
+      $addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'");
+      while ($addresses = tep_db_fetch_array($addresses_query)) {
+        $format_id = tep_get_address_format_id($addresses['country_id']);
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+       if ($addresses['address_book_id'] == $sendto) {
+          echo '                  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+        } else {
+          echo '                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
+        }
+?>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" colspan="2"><b><?php echo tep_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?></b></td>
+                    <td class="main" align="right"><?php echo tep_draw_radio_field('address', $addresses['address_book_id'], ($addresses['address_book_id'] == $sendto)); ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td colspan="3"><table border="0" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo tep_address_format($format_id, $addresses, true, ' ', ', '); ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+<?php
+        $radio_buttons++;
+      }
+?>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    }
+  }
+
+  if ($addresses_count < MAX_ADDRESS_BOOK_ENTRIES) {
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo TABLE_HEADING_NEW_SHIPPING_ADDRESS; ?></b></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" width="100%" valign="top"><?php echo TEXT_CREATE_NEW_SHIPPING_ADDRESS; ?></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td><?php require(DIR_WS_MODULES . 'checkout_new_address.php'); ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td class="main" align="right"><?php echo tep_draw_hidden_field('action', 'submit') . tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if ($process == true) {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+            <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/content/checkout_success.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/checkout_success.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/checkout_success.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,79 @@
+<?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL')); ?>
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+  <?php
+  // BOF: Lango Added for template MOD
+  if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+    $header_text = '&nbsp;'
+    //EOF: Lango Added for template MOD
+    ?>
+    <tr>
+      <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+       </tr>
+      </table></td>
+    </tr>
+    <?php
+    // BOF: Lango Added for template MOD
+  }else{
+    $header_text = HEADING_TITLE;
+  }
+  // EOF: Lango Added for template MOD
+  ?>
+
+  <?php require('add_checkout_success.php'); //ICW CREDIT CLASS/GV SYSTEM ?>
+
+  <!-- checkout_success_modules - start -->
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <?php
+      if (MODULE_CHECKOUT_SUCCESS_INSTALLED) {
+        $checkout_success_modules->process();
+        echo $checkout_success_modules->output();
+      }
+      ?>
+    </table></td>
+  </tr>
+  <!-- checkout_success_modules - end -->
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr> 
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td align="left" class="main"><?php echo '<a href="javascript:popupWindow(\'' .  (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_ORDERS_PRINTABLE) . '?' . (tep_get_all_get_params(array('order_id')) . 'order_id=' . $HTTP_GET_VARS['order_id']) . '\')">' . tep_template_image_button('button_printorder.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?></td>
+        <td align="right" class="main"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+            <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+          </tr>
+        </table></td>
+        <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+        <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+        <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+            <td width="50%"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
+        <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+        <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+        <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?>
+</table></form>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/contact_us.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/contact_us.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/contact_us.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,246 @@
+    <?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  if ($messageStack->size('contact') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('contact'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+
+  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
+?>
+       <tr>
+        <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+  } else {
+?>
+      <!-- tr>
+        <td class="main"><?php echo TEXT_CONTACT_INFO; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr -->
+
+      <tr>
+        <td class="main"><?php echo TEXT_BODY; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+
+<!-- VJ enhancement begin -->
+              <tr>
+                <td class="main" width="20%"><?php echo ENTRY_COMPANY; ?></td>
+                <td class="main" width="80%"><?php echo tep_draw_input_field('company'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_NAME; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('name'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_EMAIL; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('email'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('telephone'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('street'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_CITY; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('city'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_STATE; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('state'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('postcode'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
+                <td class="main"><?php echo tep_get_country_list('country'); ?></td>
+              </tr>
+
+              <tr>
+                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+
+<?php
+    $topic_array = array();
+    $topic_array = array(array('id' => ENTRY_TOPIC_1, 'text' => ENTRY_TOPIC_1), 
+                         array('id' => ENTRY_TOPIC_2, 'text' => ENTRY_TOPIC_2), 
+                         array('id' => ENTRY_TOPIC_3, 'text' => ENTRY_TOPIC_3),
+                         array('id' => ENTRY_TOPIC_4, 'text' => ENTRY_TOPIC_4)
+                         );
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_TOPIC; ?></td>
+                <td class="main"><?php echo tep_draw_pull_down_menu('topic', $topic_array); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_SUBJECT; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('subject', '', 'size = "60"'); ?></td>
+              </tr>
+              <tr>
+                <td class="main" valign="top"><?php echo ENTRY_ENQUIRY; ?></td>
+                <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td>
+              </tr>
+
+              <tr>
+                <td class="main"><?php echo ENTRY_URGENT; ?></td>
+                <td class="main"><?php echo tep_draw_checkbox_field('urgent'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_SELF; ?></td>
+                <td class="main"><?php echo tep_draw_checkbox_field('self'); ?></td>
+              </tr>
+<!-- VJ enhancement end -->
+
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+
+        <!--
+  VISUAL VERIFY CODE start -->
+      <tr>
+        <td class="main"><b><?php echo VISUAL_VERIFY_CODE_CATEGORY; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('visual_verify_code') . '&nbsp;' . '<span class="inputRequirement">' . VISUAL_VERIFY_CODE_ENTRY_TEXT . '</span>'; ?></td>
+
+                <td class="main">
+                  <?php
+                      //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3
+                    $visual_verify_code = ""; 
+                    for ($i = 1; $i <= rand(3,6); $i++){
+                          $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1);
+                     }
+                     $vvcode_oscsid = tep_session_id($HTTP_GET_VARS[tep_session_name()]);
+                     tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'");
+                     $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code);
+                     tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array);
+                     $visual_verify_code = "";
+                     echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '">');
+                  ?>
+                </td>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_BOX_IDENTIFIER; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<!--
+  VISUAL VERIFY CODE stop   --> 
+    
+    
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/content/cookie_usage.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/cookie_usage.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/cookie_usage.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="main"><table border="0" width="50%" cellspacing="0" cellpadding="2" align="right">
+<?php table_image_border_top(false, false, BOX_INFORMATION_HEADING);?>
+
+          <tr>
+            <td class="main"><?php echo BOX_INFORMATION; ?></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </table><?php echo TEXT_INFORMATION; ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/content/create_account.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/create_account.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/create_account.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,320 @@
+    <?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return check_form(create_account);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="smallText"><br><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if ($messageStack->size('create_account') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('create_account'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo CATEGORY_PERSONAL; ?></b></td>
+           <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+<?php
+  if (ACCOUNT_GENDER == 'true') {
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_GENDER; ?></td>
+                <td class="main"><?php echo tep_draw_radio_field('gender', 'm') . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f') . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('firstname') . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('lastname') . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  if (ACCOUNT_DOB == 'true') {
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('dob') . '&nbsp;' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('email_address') . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  if (ACCOUNT_COMPANY == 'true') {
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo CATEGORY_COMPANY; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo ENTRY_COMPANY; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('company') . '&nbsp;' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo CATEGORY_ADDRESS; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('street_address') . '&nbsp;' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  if (ACCOUNT_SUBURB == 'true') {
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_SUBURB; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('suburb') . '&nbsp;' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('postcode') . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_CITY; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('city') . '&nbsp;' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  if (ACCOUNT_STATE == 'true') {
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_STATE; ?></td>
+                <td class="main">
+<?php
+    if ($process == true) {
+      if ($entry_state_has_zones == true) {
+        $zones_array = array();
+        $zones_array[] = array('id' => '', 'text' => '');
+        $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
+        while ($zones_values = tep_db_fetch_array($zones_query)) {
+          $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
+        }
+        echo tep_draw_pull_down_menu('state', $zones_array);
+      } else {
+        echo tep_draw_input_field('state');
+      }
+    } else {
+      echo tep_draw_input_field('state');
+    }
+
+    if (tep_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="inputRequirement">' . ENTRY_STATE_TEXT;
+?>
+                </td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
+                <td class="main"><?php echo tep_get_country_list('country') . '&nbsp;' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo CATEGORY_CONTACT; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('telephone') . '&nbsp;' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('fax') . '&nbsp;' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo CATEGORY_OPTIONS; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
+                <td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1', true) . '&nbsp;' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo CATEGORY_PASSWORD; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo ENTRY_PASSWORD; ?></td>
+                <td class="main"><?php echo tep_draw_password_field('password') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
+                <td class="main"><?php echo tep_draw_password_field('confirmation') . '&nbsp;' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    
+ <!--  VISUAL VERIFY CODE start -->
+      <tr>
+        <td class="main"><b><?php echo VISUAL_VERIFY_CODE_CATEGORY; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('visual_verify_code') . '&nbsp;' . '<span class="inputRequirement">' . VISUAL_VERIFY_CODE_ENTRY_TEXT . '</span>'; ?></td>
+                <td class="main">
+                  <?php
+                      //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3
+                    $visual_verify_code = ""; 
+                    for ($i = 1; $i <= rand(3,6); $i++){
+                          $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1);
+                     }
+                     $vvcode_oscsid = tep_session_id($HTTP_GET_VARS[tep_session_name()]);
+                     tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'");
+                     $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code);
+                     tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array);
+                     $visual_verify_code = "";
+                     echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '"');
+                  ?>
+                </td>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_BOX_IDENTIFIER; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<!--  VISUAL VERIFY CODE stop   -->
+
+    
+    
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/content/create_account_success.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/create_account_success.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/create_account_success.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="pageHeading" align="center"><?php echo HEADING_TITLE; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main">
+        <?php 
+        if(ACCOUNT_EMAIL_CONFIRMATION=='true')
+        {
+          echo TEXT_ACCOUNT_CREATED; 
+        }
+        else
+        {
+          echo TEXT_ACCOUNT_CREATED1; 
+        }
+        ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . $origin_href . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/content/down_for_maintenance.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/down_for_maintenance.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/down_for_maintenance.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+           <td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'down_for_maintenance.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="main"><?php echo DOWN_FOR_MAINTENANCE_TEXT_INFORMATION; ?></td>
+          </tr>
+    <?php if (DISPLAY_MAINTENANCE_TIME == 'true') { ?>
+          <tr>
+            <td class="main"><?php echo TEXT_MAINTENANCE_ON_AT_TIME . TEXT_DATE_TIME; ?></td>
+          </tr>
+     <?php
+      } 
+      if (DISPLAY_MAINTENANCE_PERIOD == 'true') { ?>
+      <tr>
+            <td class="main"><?php echo TEXT_MAINTENANCE_PERIOD . TEXT_MAINTENANCE_PERIOD_TIME; ?></td>
+          </tr>
+      <?php } ?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </table></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><br><?php echo DOWN_FOR_MAINTENANCE_STATUS_TEXT . '<br><br>' . '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+      </tr>
+      <tr>
+       <td>&nbsp;</td>
+     </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/events_calendar.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/events_calendar.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/events_calendar.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,364 @@
+<?php
+/*
+  $Id: events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it Exp $
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+*/
+?>
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+      <td>
+        <table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table>
+    
+    </td>
+      </tr>
+      
+    <tr>
+      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else
+{
+  $header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+
+
+<?php 
+echo tep_draw_form('goto_event', FILENAME_EVENTS_CALENDAR, 'get');
+$ev_query = tep_db_query("select *, DAYOFMONTH(start_date) AS day, MONTH(start_date) AS month, YEAR(start_date) AS year from ". TABLE_EVENTS_CALENDAR ." where start_date > '". date('Y-m-d H:i:s') ."' and language_id = '". $languages_id ."' order by start_date");
+if(tep_db_num_rows($ev_query) > 0){
+    $event_array[]  = array('id' => '', 'text' => 'Select Event');
+while ($q_events = tep_db_fetch_array($ev_query)){
+    $year = $q_events['year'];
+    $month = $q_events['month'];
+    $day = $q_events['day'];
+    $event_array[] = array('id' => $q_events['event_id'] .'-'. $month .'-'. $year, 'text' => $cal->monthNames[$month - 1] .' '. $day .' -> '.$q_events['title']);
+  }
+echo TEXT_SELECT_EVENT .'&nbsp;'. tep_draw_pull_down_menu('select_event', $event_array, NULL, 'onChange="(this.value != \'\') ? this.form.submit() : \'\' " ;', $required = false);
+}
+echo '</form>';
+?>
+
+<?php
+if(isset($single_event) || $HTTP_GET_VARS['select_event'])
+{
+  $events_query = tep_db_query("select *,  DAYOFMONTH(start_date) AS event from ". TABLE_EVENTS_CALENDAR ." where event_id = '". $select_event ."' and language_id = '". $languages_id ."'");
+
+    while ($events = tep_db_fetch_array($events_query))
+  {
+          list ($year, $month, $day) = split ('[/.-]', $events['start_date']);
+          $date_start = date("F d, Y", mktime(0,0,0,$month,$day,$year));
+          echo '<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr>';
+          echo '<td class="main">' . $date_start . '</td>';
+          echo '</tr></table><br>';
+
+          list ($year, $month, $day) = split ('[/.-]', $events['start_date']);
+          $date_start = date("F j, Y", mktime(0,0,0,$month,$day,$year));
+          if($events['end_date'])
+      {
+              list ($year_end, $month_end, $day_end) = split ('[/.-]', $events['end_date']);
+              $date_end = date("F j, Y", mktime(0,0,0,$month_end,$day_end,$year_end));
+          }
+          $event_array = array('id' => $events['event_id'],
+                               'title' => $events['title'],
+                               'image' => $events['event_image'],
+                               'description' => $events['description'],
+                               'first_day' => $date_start,
+                               'last_day' => $date_end,
+                               'OSC_link' => $events['OSC_link'],
+                               'link' => $events['link']);
+          $clsp = 2;
+          echo '<table border="0" width="100%" cellspacing="0" cellpadding="4" class="event">'.
+               '<tr>'.
+               '<td width="100%" bgcolor="#D9DEE6" class="main" style="border-bottom: 1px solid #D9DEE6" nowrap>'. TEXT_EVENT_TITLE .'&nbsp;&nbsp;'. $event_array['title'] .'</td>';
+          if($event_array['last_day'])
+      {
+            echo '<td bgcolor="#D9DEE6" align="center" nowrap><div class="event" style="border: 1px inset #F2F4F7">&nbsp;&nbsp;'. TEXT_EVENT_START_DATE .'&nbsp;&nbsp;'. $event_array['first_day'] .'&nbsp;&nbsp;</div></td><td bgcolor="#D9DEE6" align="center" nowrap><div class="event" style="border: 1px inset #F2F4F7">&nbsp;&nbsp;'. TEXT_EVENT_END_DATE .'&nbsp;&nbsp;'. $event_array['last_day'] .'&nbsp;&nbsp;</div></td>';
+            $clsp++;
+        }
+            echo '</tr>'.
+               '<tr><td colspan="'. $clsp . '" class="main">'. TEXT_EVENT_DESCRIPTION .'<br>';
+               
+           if ($event_array['image'])
+      {
+                 echo'<table border="0" cellspacing="0" cellpadding="0" align="right"><tr>'.
+                  '<td class="main">'. tep_image(DIR_WS_IMAGES .'events_images/' . $event_array['image'], $event_array['title'], '', '', 'align="right" hspace="5" vspace="5"') .'</td>'.
+                  '</tr></table>';
+            }
+                      
+          echo stripslashes($event_array['description']) .'</td></tr>';
+                      
+          if($event_array['OSC_link'])
+      {
+              echo '<tr>'.
+               '<td colspan="'. $clsp . '"  bgcolor="#F5F5F5" align="left" class="main">'. TEXT_EVENT_OSC_LINK .'&nbsp;&nbsp;' . $event_array['OSC_link'] . $event_array['title'] .'</td></tr>';
+          }
+          if($event_array['link']){
+          echo '<tr>'.
+               '<td colspan="'. $clsp . '"  bgcolor="#F5F5F5" align="left" class="main">'. TEXT_EVENT_LINK .'&nbsp;&nbsp;<a href="http://'. $event_array['link'] .'" target="_blank">'. $event_array['link'] .'</a></td></tr>';
+          }
+          echo '</table><br>';
+    
+    } 
+
+    $other_events_query = tep_db_query("select *, DAYOFMONTH(start_date) AS event from ". TABLE_EVENTS_CALENDAR ." where DAYOFMONTH(start_date) = '". $day ."' and MONTH(start_date) = '". $month ."' and YEAR(start_date) = '". $year ."' and language_id = '". $languages_id ."' and event_id != '". $select_event ."'order by start_date");
+    if (tep_db_num_rows($other_events_query) > 0) 
+    {
+
+          echo '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="event"><tr>'.
+               '<td class="main" colspan="2"><b>'. TEXT_OTHER_EVENTS .'</b></td>'.
+               '</tr>';
+
+          while ($other_events = tep_db_fetch_array($other_events_query)){
+                 $event_array = array('id' => $other_events['event_id'],
+                                      'event' => $other_events['event'],
+                                      'title' => $other_events['title']);
+
+          echo '<tr><td align="center" width="24" class="main" nowrap><b>'. $i .'</b></td><td width="100%" class="main"><a href="'. FILENAME_EVENTS_CALENDAR . '?select_event='. $event_array['id'] .'">'. $event_array['title'] .'</a></td></tr>';
+          $i++;
+          }
+
+    echo '</table>';
+    }
+
+}
+elseif($HTTP_GET_VARS['year_view'] == 1){
+          echo '<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr>';
+          echo '<td>'. $cal->getYearView($year_) .'</td>';
+          echo '</tr></table>';
+}
+elseif($HTTP_GET_VARS['_day'])
+{
+  $events_query_raw = "select *, DAYOFMONTH(start_date) AS event from ". TABLE_EVENTS_CALENDAR ." where DAYOFMONTH(start_date) = '". $_day ."' and MONTH(start_date) = '". $_month ."' and YEAR(start_date) = '". $_year ."' and language_id = '". $languages_id ."' order by start_date";
+  $events_split = new splitPageResults($events_query_raw, MAX_DISPLAY_NUMBER_EVENTS, 'DAYOFMONTH(start_date)');
+  $events_query = tep_db_query($events_query_raw);
+
+    if (($events_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) 
+  {
+?>
+      <tr>
+        <td>
+          <table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText"><?php echo $events_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAGES .' : '. $date); ?></td>
+            <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $events_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table>
+       </td>
+      </tr>
+
+<?php
+}
+  
+    $row = 0;
+    $events_query = tep_db_query($events_split->sql_query);
+
+    while ($events = tep_db_fetch_array($events_query))
+  {
+          $row++;
+          list ($year, $month, $day) = split ('[/.-]', $events['start_date']);
+          $date = date("F j, Y", mktime(0,0,0,$month,$day,$year));
+          $event_array = array('id' => $events['event_id'],
+                            'event' => $events['event'],
+                            'title' => $events['title'],
+                            'link' => $events['link'],
+                            'date' => $date );
+          $clsp = 2;
+          echo '<table border="0" width="100%" cellspacing="0" cellpadding="4" class="event">'.
+               '<tr>'.
+               '<td align="center" width="20" bgcolor="#F5F5F5" class="main" nowrap><b>'. $i .'</b></td><td width="100%" bgcolor="#D9DEE6" class="main" nowrap>'. TEXT_EVENT_DATE .'&nbsp;&nbsp;<a href="'. $cal->getDbLink($event_array['event'], $month_, $year_) .'">'. $event_array['date'] .'</a></td>';
+               if($event_array['link']){
+               echo '<td width="100%" bgcolor="#D9DEE6" class="main" nowrap>'. TEXT_EVENT_LINK .'&nbsp;&nbsp;<a href="http://'. $event_array['link'] .'" target="_blank">'. $event_array['link'] .'</a></td>';
+               $clsp++;
+               }
+             echo '</tr><tr>'.
+               '<td colspan="3" class="main">'. TEXT_EVENT_TITLE .'<br>'. $event_array['title'] .'&nbsp;&nbsp;<a href="'. FILENAME_EVENTS_CALENDAR . '?select_event='. $event_array['id'] .'">'. TEXT_EVENT_MORE .'</a></td>'.
+               '</tr></table>'.
+               tep_draw_separator('pixel_trans.gif', '100%', '4');
+               $i++;
+      }
+     
+   if (($events_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) 
+   {
+?>  
+        <tr>
+          <td>
+          <table border="0" width="100%" cellspacing="0" cellpadding="2">
+            <tr>
+              <td class="smallText"><?php echo $events_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAGES .' : '. $date); ?></td>
+              <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $events_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+            </tr>
+          </table>
+          </td>
+        </tr>
+<?php 
+   }
+}
+elseif($HTTP_GET_VARS['view'] == 'all_events'){
+$events_query_raw = "select *, DAYOFMONTH(start_date) AS event from ". TABLE_EVENTS_CALENDAR ." where start_date > '". date('Y-m-d H:i:s') ."' and language_id = '". $languages_id ."' order by start_date";
+//." where start_date > '". date('Y-m-d H:i:s') ."' and language_id = '". $languages_id ."' order by start_date";
+$events_split = new splitPageResults($events_query_raw, MAX_DISPLAY_NUMBER_EVENTS, 'DAYOFMONTH(start_date)');
+$events_query = tep_db_query($events_query_raw);
+
+      if (($events_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
+?>
+      <table>
+      <tr>
+        <td>
+          <table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText"><?php echo $events_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAGES); ?></td>
+            <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $events_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table>
+       </td>
+      </tr>
+    </table>
+
+<?php
+ }
+    $row = 0;
+    $events_query = tep_db_query($events_split->sql_query);
+
+    while ($events = tep_db_fetch_array($events_query)){
+          $row++;
+          list ($year, $month, $day) = split ('[/.-]', $events['start_date']);
+          $date = date("F j, Y", mktime(0,0,0,$month,$day,$year));
+          $event_array = array('id' => $events['event_id'],
+                            'event' => $events['event'],
+                            'title' => $events['title'],
+                            'link' => $events['link'],
+                            'date' => $date );
+          $clsp = 2;
+          echo '<table border="0" width="100%" cellspacing="0" cellpadding="4" class="event">'.
+               '<tr>'.
+               '<td align="center" width="20" bgcolor="#F5F5F5" class="main" nowrap><b>'. $i .'</b></td><td width="100%" bgcolor="#D9DEE6" class="main" nowrap>'. TEXT_EVENT_DATE .'&nbsp;&nbsp;<a href="'. $cal->getDbLink($event_array['event'], $month_, $year_) .'">'. $event_array['date'] .'</a></td>';
+               if($event_array['link']){
+               echo '<td width="100%" bgcolor="#D9DEE6" class="main" nowrap>'. TEXT_EVENT_LINK .'&nbsp;&nbsp;<a href="http://'. $event_array['link'] .'" target="_blank">'. $event_array['link'] .'</a></td>';
+               $clsp++;
+               }
+          echo '</tr><tr>'.
+               '<td colspan="3" class="main">'. TEXT_EVENT_TITLE .'<br>'. $event_array['title'] .'&nbsp;&nbsp;<a href="'. FILENAME_EVENTS_CALENDAR . '?select_event='. $event_array['id'] .'">'. TEXT_EVENT_MORE .'</a></td>'.
+               '</tr></table>'.
+               tep_draw_separator('pixel_trans.gif', '100%', '4');
+               $i++;
+          }
+       if (($events_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
+?>
+     
+      <table>
+    <tr>
+        <td>
+          <table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText"><?php echo $events_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAGES); ?></td>
+            <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $events_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table>
+        </td>
+      </tr>
+     </table>
+
+<?php
+  }
+}
+else
+{
+  $events_query_raw = "select *, DAYOFMONTH(start_date) AS event from ". TABLE_EVENTS_CALENDAR ." where MONTH(start_date) = '". $month_ ."' and YEAR(start_date) = '". $year_ ."' and language_id = '". $languages_id ."'  order by start_date";
+  $events_split = new splitPageResults($events_query_raw, MAX_DISPLAY_NUMBER_EVENTS, 'DAYOFMONTH(start_date)');
+  $months = $cal->monthNames[$month_ - 1];
+
+  echo '<table border="0" width="100%" cellspacing="0" cellpadding="2">'.
+       '<tr><td colspan="3" class="main">' . $months .', '. $year_ .'</td>'.
+       '</tr></table>';
+
+  if (($events_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
+?>      
+      <table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="smallText"><?php echo $events_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAGES .' : '. $months); ?></td>
+            <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $events_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+          </tr>
+        </table>
+<?php
+  }    
+  
+  $row = 0;
+    $events_query = tep_db_query($events_split->sql_query);
+
+    while ($events = tep_db_fetch_array($events_query))
+  {
+            $row++;
+            list ($year, $month, $day) = split ('[/.-]', $events['start_date']);
+            $date = date("F j, Y", mktime(0,0,0,$month,$day,$year));
+          
+            $event_array = array('id' => $events['event_id'],
+                               'event' => $events['event'],
+                               'title' => $events['title'],
+                               'link' => $events['link'],
+                               'date' => $date );
+            $clsp = 2;
+            echo '<table border="0" width="100%" cellspacing="0" cellpadding="4" class="event">'.
+                 '<tr>'.
+                 '<td align="center" width="20" bgcolor="#F5F5F5" class="main" nowrap><b>'. $i .'</b></td><td width="100%" bgcolor="#D9DEE6" class="main" nowrap>'. TEXT_EVENT_DATE .'&nbsp;&nbsp;<a href="'. $cal->getDbLink($event_array['event'], $month_, $year_) .'">'. $event_array['date'] .'</a></td>';
+                 if($event_array['link']){
+                 echo '<td width="100%" bgcolor="#D9DEE6" class="main" nowrap>'. TEXT_EVENT_LINK .'&nbsp;&nbsp;<a href="http://'. $event_array['link'] .'" target="_blank">'. $event_array['link'] .'</a></td>';
+                 $clsp++;
+                 }
+            echo '</tr><tr>'.
+                 '<td colspan="3" class="main">'. TEXT_EVENT_TITLE .'<br>'. $event_array['title'] .'&nbsp;&nbsp;<a href="'. FILENAME_EVENTS_CALENDAR . '?select_event='. $event_array['id'] .'">'. TEXT_EVENT_MORE .'</a></td>'.
+                 '</tr></table>'.
+                 tep_draw_separator('pixel_trans.gif', '100%', '4');
+            $i++;
+     }
+
+   if (($events_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
+?>
+          <table border="0" width="100%" cellspacing="0" cellpadding="2">
+            <tr>
+              <td class="smallText"><?php echo $events_split->display_count(TEXT_DISPLAY_NUMBER_OF_PAGES .' : '. $months); ?></td>
+              <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $events_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+            </tr>
+          </table>
+<?php
+   }
+     
+}
+?>
+
+<!-- body_text_eof //-->
+
+
+<?php 
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+  
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/faq.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/faq.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/faq.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,81 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+if ($display_mode == 'faq') {
+  $faq_category_query = tep_db_query("select icd.categories_name from " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd, " . TABLE_FAQ_CATEGORIES . " ic where ic.categories_id = icd.categories_id and icd.categories_id = '" . (int)$cID . "' and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1'");
+  
+  $faq_category = tep_db_fetch_array($faq_category_query);
+?>
+  <tr>
+    <td class="pageHeading"><?php echo $faq_category['categories_name']; ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main">
+<?php
+  $toc_query = tep_db_query("select ip.faq_id, ip.question from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '" . (int)$cID . "' and ip.language = '" . $language . "' and ip.visible = '1' order by ip.v_order, ip.question");
+  echo '<ol>';
+  while ($toc = tep_db_fetch_array($toc_query)) {
+    echo '<li>' . '<a href="' . tep_href_link(FILENAME_FAQ, 'cID=' . (int)$cID) . '#' . $toc['faq_id'] . '"><b>' . $toc['question'] . '</b></a>' . '</li>';
+  }
+  echo '</ol>';
+
+  echo '<hr>';
+
+  $faq_query = tep_db_query("select ip.faq_id, ip.question, ip.answer from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '" . (int)$cID . "' and ip.language = '" . $language . "' and ip.visible = '1' order by ip.v_order, ip.question");
+
+  echo '<ol>';
+  while ($faq = tep_db_fetch_array($faq_query)) {
+    echo  '<li><b><span id="' . $faq['faq_id'] . '">' . $faq['question'] . '</span></b><br>';
+
+    echo $faq['answer'] . '<br><br>' . '<a href="javascript:scroll(0,0);" target="_self">' . FAQ_BACK_TO_TOP . '</a><br><br>';
+  }
+  echo '</ol>';
+?>
+            </td>
+          </tr>
+        </table>
+        </td>
+      </tr>
+
+
+<?php
+} else {
+?>
+  <tr>
+    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr>
+     <td class="main">
+<?php
+  $faq_categories_query = tep_db_query("select ic.categories_id, icd.categories_name, icd.categories_description from " . TABLE_FAQ_CATEGORIES . " ic, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd  where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1'");
+
+  // faq outside categories
+  $faq_query = tep_db_query("select ip.faq_id, ip.question, ip.answer from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '0' and ip.language = '" . (int)$languages_id . "' and ip.visible = '1' order by ip.v_order, ip.question");
+
+  if ((tep_db_num_rows($faq_categories_query) > 0) || (tep_db_num_rows($faq_query) > 0)) {
+    while ($faq_categories = tep_db_fetch_array($faq_categories_query)) {
+      echo '<h4 class="faqTitle">' . '<a href="' . tep_href_link(FILENAME_FAQ, 'cID=' . (int)$faq_categories['categories_id']) . '">' . $faq_categories['categories_name'] . '</a>' . '</h4>' . "\n";
+      echo '<p class="faqBlurb">' . $faq_categories['categories_description'] . '</p>' . "\n\n";
+    }
+
+    while ($faq = tep_db_fetch_array($faq_query)) {
+      echo '<h4 class="faqTitle">' . '<a href="' . tep_href_link(FILENAME_FAQ, 'pID=' . (int)$faq['faq_id']) . '">' . $faq['question'] . '</a>' . '</h4>' . "\n";
+      echo '<p class="faqBlurb">' . $faq['answer'] . '</p>' . "\n\n";
+    }
+  } else {
+    echo '<p>' . TEXT_NO_CATEGORIES . '</p>' . "\n\n";
+  }
+?>
+    </td>
+  </tr>
+<?php
+}
+?>
+</table>

Added: trunk/direct.openmoko.com/templates/content/featured_products.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/featured_products.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/featured_products.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php // echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+   // queries now in the root featured_products.php
+
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+
+
+?>
+   <tr>
+        <td>
+        <?php 
+   
+  //decide which product listing to use
+   if (PRODUCT_LIST_CONTENT_LISTING == 'column'){
+  $listing_method = FILENAME_PRODUCT_LISTING_COL;
+  } else {
+  $listing_method = FILENAME_PRODUCT_LISTING;
+  }
+  //Then show product listing
+  include(DIR_WS_MODULES . $listing_method); 
+   
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </td>
+      </tr>
+<?php
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/gv_faq.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/gv_faq.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/gv_faq.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo SUB_HEADING_TITLE; ?></b></td>
+      </tr>
+      <tr>
+       <td class="main"><?php echo SUB_HEADING_TEXT; ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/gv_redeem.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/gv_redeem.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/gv_redeem.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,48 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+<?php
+// if we get here then either the url gv_no was not set or it was invalid
+// so output a message.
+  $message = sprintf(TEXT_VALID_GV, $currencies->format($coupon['coupon_amount']));
+  if ($error) {
+    $message = TEXT_INVALID_GV;
+  }
+?>
+          <tr>
+            <td class="main"><?php echo $message; ?></td>
+          </tr>
+          <tr>
+            <td align="right"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/gv_send.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/gv_send.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/gv_send.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,104 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  if ($HTTP_GET_VARS['action'] == 'process') {
+?>
+      <tr>
+        <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?><br><br><?php echo 'gv '.$id1; ?></td>
+      </tr>
+      <tr>
+        <td align="right"><br><a href="<?php echo tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
+      </tr>
+<?php
+  }  
+  if ($HTTP_GET_VARS['action'] == 'send' && !$error) {
+    // validate entries
+      $gv_amount = (double) $gv_amount;
+      $gv_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
+      $gv_result = tep_db_fetch_array($gv_query);
+      $send_name = $gv_result['customers_firstname'] . ' ' . $gv_result['customers_lastname'];
+?>
+      <tr>
+        <td><form action="<?php echo tep_href_link(FILENAME_GV_SEND, 'action=process', 'NONSSL'); ?>" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo sprintf(MAIN_MESSAGE, $currencies->format($HTTP_POST_VARS['amount']), $HTTP_POST_VARS['to_name'], $HTTP_POST_VARS['email'], $HTTP_POST_VARS['to_name'], $currencies->format($HTTP_POST_VARS['amount']), $send_name); ?></td>
+          </tr>
+<?php
+      if ($HTTP_POST_VARS['message']) {
+?>
+           <tr>
+            <td class="main"><?php echo sprintf(PERSONAL_MESSAGE, $gv_result['customers_firstname']); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo stripslashes($HTTP_POST_VARS['message']); ?></td>
+          </tr>
+<?php
+      }
+
+      echo tep_draw_hidden_field('send_name', $send_name) . tep_draw_hidden_field('to_name', stripslashes($HTTP_POST_VARS['to_name'])) . tep_draw_hidden_field('email', $HTTP_POST_VARS['email']) . tep_draw_hidden_field('amount', $gv_amount) . tep_draw_hidden_field('message', stripslashes($HTTP_POST_VARS['message']));
+?>
+          <tr>
+            <td class="main"><?php echo tep_template_image_submit('button_back.gif', IMAGE_BUTTON_BACK, 'name=back') . '</a>'; ?></td>
+            <td align="right"><br><?php echo tep_template_image_submit('button_send.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+          </tr>
+        </table></form></td>
+      </tr>
+<?php
+  } elseif ($HTTP_GET_VARS['action']=='' || $error) {
+?>
+      <tr>
+        <td class="main"><?php echo HEADING_TEXT; ?></td>
+      </tr>
+      <tr>
+        <td><form action="<?php echo tep_href_link(FILENAME_GV_SEND, 'action=send', 'NONSSL'); ?>" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><?php echo ENTRY_NAME; ?><br><?php echo tep_draw_input_field('to_name', stripslashes($HTTP_POST_VARS['to_name']));?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_EMAIL; ?><br><?php echo tep_draw_input_field('email', $HTTP_POST_VARS['email']); if ($error) echo $error_email; ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_AMOUNT; ?><br><?php echo tep_draw_input_field('amount', $HTTP_POST_VARS['amount'], '', '', false); if ($error) echo $error_amount; ?></td>
+          </tr>
+          <tr>
+            <td class="main"><?php echo ENTRY_MESSAGE; ?><br><?php echo tep_draw_textarea_field('message', 'soft', 50, 15, stripslashes($HTTP_POST_VARS['message'])); ?></td>
+          </tr>
+        </table>
+        <table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+<?php
+    $back = sizeof($navigation->path)-2;
+?>
+            <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+            <td class="main" align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+          </tr>
+        </table></form></td>
+      </tr>
+<?php
+  }
+?>
+    </table></td>

Added: trunk/direct.openmoko.com/templates/content/index_default.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/index_default.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/index_default.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+<?php 
+// added for show/hide customer greeting
+if (SHOW_CUSTOMER_GREETING=='yes') { 
+// added for show/hide customer greeting
+?>
+          
+          <tr>
+                        <td class="pageHeading">
+             <?php 
+               if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
+                 echo $category['categories_heading_title'];
+               } else {
+                 echo HEADING_TITLE;
+               }
+             ?>
+            </td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+            </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="main"><?php echo tep_customer_greeting(); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+
+// added for show/hide customer greeting
+}
+// added for show/hide customer greeting
+
+
+if (tep_not_null(INCLUDE_MODULE_ONE)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_ONE);
+echo '</td></tr>';
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_TWO)) {
+echo '          <tr>
+            <td class="main">';
+include($modules_folder . INCLUDE_MODULE_TWO);
+echo '</td></tr>';
+
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_THREE)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_THREE);
+echo '</td></tr>';
+
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_FOUR)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_FOUR);
+echo '</td></tr>';
+
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_FIVE)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_FIVE);
+echo '</td></tr>';
+
+?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+}
+if (tep_not_null(INCLUDE_MODULE_SIX)) {
+echo '<tr><td>';
+include($modules_folder . INCLUDE_MODULE_SIX);
+echo '</td></tr>';
+}
+
+?>
+        </table></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/index_nested.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/index_nested.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/index_nested.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,90 @@
+  <!-- Bof content.index_nested.tpl.php-->
+   <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+                        <td class="pageHeading">
+             <?php
+               if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
+                 echo $category['categories_heading_title'];
+               } else {
+                 echo HEADING_TITLE;
+               }
+             ?>
+            </td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+    <?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description'])) ) { ?>
+    <tr>
+            <td align="left" colspan="2" class="category_desc"><?php echo $category['categories_description']; ?></td>
+    </tr>
+    <?php } ?>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+<?php
+    if (isset($cPath) && strpos('_', $cPath)) {
+// check to see if there are deeper categories within the current category
+      $category_links = array_reverse($cPath_array);
+      for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
+        $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
+        $categories = tep_db_fetch_array($categories_query);
+        if ($categories['total'] < 1) {
+          // do nothing, go through the loop
+        } else {
+          $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
+          break; // we've found the deepest category the customer is in
+        }
+      }
+    } else {
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
+    }
+
+    $number_of_categories = tep_db_num_rows($categories_query);
+
+    $rows = 0;
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $rows++;
+      $cPath_new = tep_get_path($categories['categories_id']);
+      $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
+      echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
+      if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
+        echo '              </tr>' . "\n";
+        echo '              <tr>' . "\n";
+      }
+    }
+
+// needed for the new products module shown below
+    $new_products_category_id = $current_category_id;
+?>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td><?php
+           if ((INCLUDE_MODULE_ONE == new_products.php) ||
+               (INCLUDE_MODULE_TWO == new_products.php) ||
+               (INCLUDE_MODULE_THREE == new_products.php) ||
+               (INCLUDE_MODULE_FOUR == new_products.php) ||
+               (INCLUDE_MODULE_FIVE == new_products.php) ||
+                (INCLUDE_MODULE_SIX == new_products.php) ) { 
+            include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); 
+            }?></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+<?php
+//}
+ ?>
+ <!-- Eof content.index_nested.tpl.php-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/index_products.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/index_products.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/index_products.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,119 @@
+    <!-- bof content.index_products.tpl.php-->
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+                        <td class="pageHeading">
+             <?php
+    // Get the category name and description
+    $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . $languages_id . "'");
+    $category = tep_db_fetch_array($category_query);
+    $heading_text_box = $category['categories_name'];
+
+               if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
+                 echo $category['categories_heading_title'];
+               } else {
+                 echo HEADING_TITLE;
+                 $heading_text_box = $category['categories_name'];
+                 echo '<br>'  .  $heading_text_box;
+               }
+             ?>
+            </td>
+<?php
+// optional Product List Filter
+    if (PRODUCT_LIST_FILTER > 0) {
+      if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+        $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name
+                           from " . TABLE_PRODUCTS . " p,
+                                " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c,
+                                " . TABLE_CATEGORIES . " c,
+                                " . TABLE_CATEGORIES_DESCRIPTION . " cd
+                           where p2c.categories_id = c.categories_id
+                             and p.products_id = p2c.products_id
+                             and cd.categories_id = c.categories_id
+                             and cd.language_id = '" . (int)$languages_id . "'
+                             and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                             and p.products_status = '1'
+                           order by cd.categories_name";
+      } else {
+        $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
+      }
+      $filterlist_query = tep_db_query($filterlist_sql);
+      if (tep_db_num_rows($filterlist_query) > 1) {
+        echo '            <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . '&nbsp;';
+        if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+          echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
+          $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
+        } else {
+          echo tep_draw_hidden_field('cPath', $cPath);
+          $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
+        }
+        echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
+        while ($filterlist = tep_db_fetch_array($filterlist_query)) {
+          $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
+        }
+        echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
+        echo '</form></td>' . "\n";
+      }
+    }
+
+// Get the right image for the top-right
+    $image = DIR_WS_IMAGES . 'table_background_list.gif';
+    if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+       $manufactures_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
+       $manufactures = tep_db_fetch_array($manufactures_query);
+       $heading_text_box =  $manufactures['manufacturers_name'];
+      $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
+      $image = tep_db_fetch_array($image);
+      $image = $image['manufacturers_image'];
+    } elseif ($current_category_id) {
+      $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
+      $image = tep_db_fetch_array($image);
+      $image = $image['categories_image'];
+    }
+?>
+            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+    <?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description'])) ) { ?>
+    <tr>
+            <td align="left" colspan="2" class="category_desc"><?php echo $category['categories_description']; ?></td>
+    </tr>
+    <?php } ?>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <!--manufacture list in index product.php-->
+<?php
+// BOF: Lango Added for template index_products .tpl MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+  $heading_text = $heading_text_box ;
+table_image_border_top(false, false, $heading_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+        <?php 
+  //Product Listing Fix - Begin
+  //decide which product listing to use
+   if (PRODUCT_LIST_CONTENT_LISTING == 'column'){
+  $listing_method = FILENAME_PRODUCT_LISTING_COL;
+  } else {
+  $listing_method = FILENAME_PRODUCT_LISTING;
+  }
+  //Then show product listing
+  include(DIR_WS_MODULES . $listing_method); 
+  //Product Listing Fix - End
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template content indexproducts.tlpMOD
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/information.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/information.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/information.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,76 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo $INFO_TITLE; ?></td>
+            <td align="right">
+        <?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?>
+      </td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = $INFO_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+if(!$HTTP_GET_VARS['info_id']) {
+// joles
+$sql_query = tep_db_query("SELECT information_id,languages_id, info_title FROM " . TABLE_INFORMATION . " WHERE visible= '1' and languages_id ='" . (int)$languages_id . "' ORDER BY v_order");
+while ($row = tep_db_fetch_array($sql_query)){
+$informationString_Page .= '<a href="' . tep_href_link (FILENAME_INFORMATION, 'info_id=' . $row['information_id'] ) . '">' . $row['info_title'] . '</a><br>';
+}
+echo $informationString_Page;
+}
+?>
+          <tr>
+            <td class="main"><?php echo $INFO_DESCRIPTION; ?></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/links.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/links.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/links.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,256 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+
+<?php
+  if ($display_mode == 'categories') {
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+  <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+
+  <tr>
+
+<?php
+    $categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name, lcd.link_categories_description, lc.link_categories_image from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");
+
+    $number_of_categories = tep_db_num_rows($categories_query);
+
+    if ($number_of_categories > 0) {
+      $rows = 0;
+      while ($categories = tep_db_fetch_array($categories_query)) {
+        $rows++;
+        $lPath_new = 'lPath=' . $categories['link_categories_id'];
+        $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
+
+        echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">';
+
+        if (tep_not_null($categories['link_categories_image'])) {
+          echo tep_links_image(DIR_WS_IMAGES . $categories['link_categories_image'], $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>';
+        } else {
+          echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT, 'style="border: 3px double black"') . '<br>';
+        }
+
+        echo '<br><b><u>' . $categories['link_categories_name'] . '</b></u></a><br><br>' . $categories['link_categories_description'] . '</td>' . "\n";
+        if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
+          echo '              </tr>' . "\n";
+          echo '              <tr>' . "\n";
+        }
+      }
+             echo '              </tr>' . "\n";
+    } else {
+?>             <tr>
+                <td><?php new infoBox(array(array('text' => TEXT_NO_CATEGORIES))); ?></td>
+               </tr>
+<?php
+    }
+?>
+</table>
+</td>
+</tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_LINKS_SUBMIT, tep_get_all_get_params()) . '">' . tep_template_image_button('button_submit_link.gif', IMAGE_BUTTON_SUBMIT_LINK) . '</a>'; ?></td>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+</tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <!--endcategorieslinks-->
+<?php
+  } elseif ($display_mode == 'links') {
+// create column list
+    $define_list = array('LINK_LIST_TITLE' => LINK_LIST_TITLE,
+                         'LINK_LIST_URL' => LINK_LIST_URL,
+                         'LINK_LIST_IMAGE' => LINK_LIST_IMAGE,
+                         'LINK_LIST_DESCRIPTION' => LINK_LIST_DESCRIPTION,
+                         'LINK_LIST_COUNT' => LINK_LIST_COUNT);
+
+    asort($define_list);
+
+    $column_list = array();
+    reset($define_list);
+    while (list($key, $value) = each($define_list)) {
+      if ($value > 0) $column_list[] = $key;
+    }
+
+    $select_column_list = '';
+
+    for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+      switch ($column_list[$i]) {
+        case 'LINK_LIST_TITLE':
+          $select_column_list .= 'ld.links_title, ';
+          break;
+        case 'LINK_LIST_URL':
+          $select_column_list .= 'l.links_url, ';
+          break;
+        case 'LINK_LIST_IMAGE':
+          $select_column_list .= 'l.links_image_url, ';
+          break;
+        case 'LINK_LIST_DESCRIPTION':
+          $select_column_list .= 'ld.links_description, ';
+          break;
+        case 'LINK_LIST_COUNT':
+          $select_column_list .= 'l.links_clicked, ';
+          break;
+      }
+    }
+
+// show the links in a given category
+// We show them all
+    $listing_sql = "select " . $select_column_list . " l.links_id from " . TABLE_LINKS_DESCRIPTION . " ld, " . TABLE_LINKS . " l, " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2lc where l.links_status = '2' and l.links_id = l2lc.links_id and ld.links_id = l2lc.links_id and ld.language_id = '" . (int)$languages_id . "' and l2lc.link_categories_id = '" . (int)$current_category_id . "'";
+
+    if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+        if ($column_list[$i] == 'LINK_LIST_TITLE') {
+          $HTTP_GET_VARS['sort'] = $i+1 . 'a';
+          $listing_sql .= " order by ld.links_title";
+          break;
+        }
+      }
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+      $listing_sql .= ' order by ';
+      switch ($column_list[$sort_col-1]) {
+        case 'LINK_LIST_TITLE':
+          $listing_sql .= "ld.links_title " . ($sort_order == 'd' ? 'desc' : '');
+          break;
+        case 'LINK_LIST_URL':
+          $listing_sql .= "l.links_url " . ($sort_order == 'd' ? 'desc' : '') . ", ld.links_title";
+          break;
+        case 'LINK_LIST_IMAGE':
+          $listing_sql .= "ld.links_title";
+          break;
+        case 'LINK_LIST_DESCRIPTION':
+          $listing_sql .= "ld.links_description " . ($sort_order == 'd' ? 'desc' : '') . ", ld.links_title";
+          break;
+        case 'LINK_LIST_COUNT':
+          $listing_sql .= "l.links_clicked " . ($sort_order == 'd' ? 'desc' : '') . ", ld.links_title";
+          break;
+      }
+    }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+                        <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+    <td class="pageHeading" align="right">
+<?php
+// Get the right image for the top-right ;-)
+    $image = 'table_background_list.gif';
+    if ($current_category_id) {
+      $image_query = tep_db_query("select link_categories_image from " . TABLE_LINK_CATEGORIES . " where link_categories_id = '" . (int)$current_category_id . "'");
+      $image_value = tep_db_fetch_array($image_query);
+
+      if (tep_not_null($image_value['link_categories_image'])) {
+        $image = $image_value['link_categories_image'];
+      }
+    }
+?>
+            <td align="right"><?php echo tep_links_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+  <?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><?php include(DIR_WS_MODULES . FILENAME_LINK_LISTING); ?></td>
+      </tr>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_LINKS_SUBMIT, tep_get_all_get_params()) . '">' . tep_template_image_button('button_submit_link.gif', IMAGE_BUTTON_SUBMIT_LINK) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+</table>

Added: trunk/direct.openmoko.com/templates/content/links_submit.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/links_submit.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/links_submit.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,162 @@
+<?php echo tep_draw_form('submit_link', tep_href_link(FILENAME_LINKS_SUBMIT, '', 'SSL'), 'post', 'onSubmit="return check_form(submit_link);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="smallText"><br><?php echo TEXT_MAIN; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  if ($messageStack->size('submit_link') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('submit_link'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main"><b><?php echo CATEGORY_WEBSITE; ?></b></td>
+           <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="60%" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main" width="25%"><?php echo ENTRY_LINKS_TITLE; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('links_title') . '&nbsp;' . (tep_not_null(ENTRY_LINKS_TITLE_TEXT) ? '<span class="inputRequirement">' . ENTRY_LINKS_TITLE_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_LINKS_URL; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('links_url', 'http://') . '&nbsp;' . (tep_not_null(ENTRY_LINKS_URL_TEXT) ? '<span class="inputRequirement">' . ENTRY_LINKS_URL_TEXT . '</span>': ''); ?></td>
+              </tr>
+<?php
+  //link category drop-down list
+  $categories_array = array();
+  $categories_query = tep_db_query("select lcd.link_categories_id, lcd.link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lcd.language_id = '" . (int)$languages_id . "'order by lcd.link_categories_name");
+  while ($categories_values = tep_db_fetch_array($categories_query)) {
+    $categories_array[] = array('id' => $categories_values['link_categories_name'], 'text' => $categories_values['link_categories_name']);
+  }
+
+  if (isset($HTTP_GET_VARS['lPath'])) {
+    $current_categories_id = $HTTP_GET_VARS['lPath'];
+
+    $current_categories_query = tep_db_query("select link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_id ='" . (int)$current_categories_id . "' and language_id ='" . (int)$languages_id . "'");
+    if ($categories = tep_db_fetch_array($current_categories_query)) {
+      $default_category = $categories['link_categories_name'];
+    } else {
+      $default_category = '';
+    }
+  }
+?>
+              <tr>
+                <td class="main"><?php echo ENTRY_LINKS_CATEGORY; ?></td>
+                <td class="main">
+<?php
+    echo tep_draw_pull_down_menu('links_category', $categories_array, $default_category);
+
+    if (tep_not_null(ENTRY_LINKS_CATEGORY_TEXT)) echo '&nbsp;<span class="inputRequirement">' . ENTRY_LINKS_CATEGORY_TEXT;
+?>
+                </td>
+              </tr>
+              <tr>
+                <td class="main" valign="top"><?php echo ENTRY_LINKS_DESCRIPTION; ?></td>
+                <td class="main"><?php echo tep_draw_textarea_field('links_description', 'hard', 20, 5) . '&nbsp;' . (tep_not_null(ENTRY_LINKS_DESCRIPTION_TEXT) ? '<span class="inputRequirement">' . ENTRY_LINKS_DESCRIPTION_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_LINKS_IMAGE; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('links_image', 'http://') . '&nbsp;' . (tep_not_null(ENTRY_LINKS_IMAGE_TEXT) ? '<span class="inputRequirement">' . ENTRY_LINKS_IMAGE_TEXT . '</span>': ''); ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_LINKS_HELP) . '\')">' . TEXT_LINKS_HELP_LINK . '</a>'; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo CATEGORY_CONTACT; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table width="60%" border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main" width="25%"><?php echo ENTRY_LINKS_CONTACT_NAME; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('links_contact_name') . '&nbsp;' . (tep_not_null(ENTRY_LINKS_CONTACT_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LINKS_CONTACT_NAME_TEXT . '</span>': ''); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('links_contact_email') . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td class="main"><b><?php echo CATEGORY_RECIPROCAL; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table width="60%" border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main" width="25%"><?php echo ENTRY_LINKS_RECIPROCAL_URL; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('links_reciprocal_url', 'http://') . '&nbsp;' . (tep_not_null(ENTRY_LINKS_RECIPROCAL_URL_TEXT) ? '<span class="inputRequirement">' . ENTRY_LINKS_RECIPROCAL_URL_TEXT . '</span>': ''); ?><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_LINKS_HELP) . '\')">' . TEXT_LINKS_HELP_LINK . '</a>'; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/links_submit_success.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/links_submit_success.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/links_submit_success.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="pageHeading" align="center"><?php echo HEADING_TITLE; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_LINK_SUBMITTED; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . $origin_href . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/login.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/login.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/login.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+    <?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); ?>
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+
+
+<?php
+  if ($messageStack->size('login') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('login'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+
+  if ($cart->count_contents() > 0) {
+?>
+      <tr>
+        <td class="smallText"><?php echo TEXT_VISITORS_CART; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+if (PWA_ON == 'false') {
+require(DIR_WS_INCLUDES . FILENAME_PWA_ACC_LOGIN);
+} else {
+require(DIR_WS_INCLUDES . FILENAME_PWA_PWA_LOGIN);
+}
+?>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/content/logoff.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/logoff.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/logoff.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,36 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="pageHeading" align="center"><?php echo HEADING_TITLE; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo TEXT_MAIN; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/pages.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/pages.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/pages.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+if ($display_mode == 'categories') {
+  $pages_category_query = tep_db_query("select icd.categories_name from " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd, " . TABLE_PAGES_CATEGORIES . " ic where ic.categories_id = icd.categories_id and icd.categories_id = '" . (int)$cID . "' and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1'");
+  
+  $pages_category = tep_db_fetch_array($pages_category_query);
+?>
+  <tr>
+    <td class="pageHeading"><?php echo $pages_category['categories_name']; ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr>
+     <td class="main">
+<?php
+  $pages_query = tep_db_query("select ip.pages_id, ipd.pages_title, ipd.pages_blurb
+                               from " . TABLE_PAGES . " ip,
+                                    " . TABLE_PAGES_DESCRIPTION . " ipd,
+                                    " . TABLE_PAGES_TO_CATEGORIES . " ip2c
+                               where ip.pages_status = '1'
+                                 and ipd.pages_id = ip.pages_id
+                                 and ip.pages_id = ip2c.pages_id
+                                 and ip2c.categories_id = '" . (int)$cID . "'
+                                 and ipd.language_id = '" . (int)$languages_id . "'
+                              ");
+
+  if (tep_db_num_rows($pages_query) > 0) {
+    while ($pages = tep_db_fetch_array($pages_query)) {
+      echo '<h4 class="pagesTitle">' . '<a href="' . tep_href_link(FILENAME_PAGES, 'cID=' . (int)$cID . '&amp;pID=' . (int)$pages['pages_id']) . '">' . $pages['pages_title'] . '</a>' . '</h4>' . "\n";
+      echo '<p class="pagesBlurb">' . $pages['pages_blurb'] . '</p>' . "\n\n";
+    }
+  } else {
+    echo '<p>' . TEXT_NO_PAGES . '</p>' . "\n\n";
+  }
+?>
+    </td>
+  </tr>
+<?php
+} elseif ($display_mode == 'pages') {
+  $pages_page_query = tep_db_query("select ipd.pages_id, ipd.pages_title, ipd.pages_body from " . TABLE_PAGES_DESCRIPTION . " ipd, " . TABLE_PAGES . " ip where ip.pages_id = ipd.pages_id and ipd.pages_id = '" . (int)$pID . "' and ipd.language_id = '" . (int)$languages_id . "' and ip.pages_status = '1'");
+
+  if ($pages_page = tep_db_fetch_array($pages_page_query)) {
+?>
+  <tr>
+    <td class="pageHeading"><?php echo $pages_page['pages_title']; ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr>
+     <td class="main"><?php echo $pages_page['pages_body']; ?></td>
+  </tr>
+<?php
+  }
+} else {
+?>
+  <tr>
+    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr>
+     <td class="main">
+<?php
+  $pages_categories_query = tep_db_query("select ic.categories_id, icd.categories_name, icd.categories_description from " . TABLE_PAGES_CATEGORIES . " ic, " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd  where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1'");
+
+  // pages outside categories
+  $pages_query = tep_db_query("select ip.pages_id, ipd.pages_title, ipd.pages_blurb
+                               from " . TABLE_PAGES . " ip,
+                                    " . TABLE_PAGES_DESCRIPTION . " ipd,
+                                    " . TABLE_PAGES_TO_CATEGORIES . " ip2c
+                               where ip.pages_status = '1'
+                                 and ipd.pages_id = ip.pages_id
+                                 and ip2c.pages_id = ip.pages_id
+                                 and ip2c.categories_id = '0'
+                                 and ipd.language_id = '" . (int)$languages_id . "'
+                               order by ip.pages_sort_order, ipd.pages_title");
+
+  if ((tep_db_num_rows($pages_categories_query) > 0) || (tep_db_num_rows($pages_query) > 0)) {
+    while ($pages_categories = tep_db_fetch_array($pages_categories_query)) {
+      echo '<h4 class="pagesTitle">' . '<a href="' . tep_href_link(FILENAME_PAGES, 'cID=' . (int)$pages_categories['categories_id']) . '">' . $pages_categories['categories_name'] . '</a>' . '</h4>' . "\n";
+      echo '<p class="pagesBlurb">' . $pages_categories['categories_description'] . '</p>' . "\n\n";
+    }
+
+    while ($pages = tep_db_fetch_array($pages_query)) {
+      echo '<h4 class="pagesTitle">' . '<a href="' . tep_href_link(FILENAME_PAGES, 'pID=' . (int)$pages['pages_id']) . '">' . $pages['pages_title'] . '</a>' . '</h4>' . "\n";
+      echo '<p class="pagesBlurb">' . $pages['pages_blurb'] . '</p>' . "\n\n";
+    }
+  } else {
+    echo '<p>' . TEXT_NO_CATEGORIES . '</p>' . "\n\n";
+  }
+?>
+    </td>
+  </tr>
+<?php
+}
+?>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/password_forgotten.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/password_forgotten.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/password_forgotten.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,93 @@
+    <?php echo tep_draw_form('password_forgotten', tep_href_link(FILENAME_PASSWORD_FORGOTTEN, 'action=process', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_password_forgotten.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+  if ($messageStack->size('password_forgotten') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('password_forgotten'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" height="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main" colspan="2"><?php echo TEXT_MAIN; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo '<b>' . ENTRY_EMAIL_ADDRESS . '</b> ' . tep_draw_input_field('email_address'); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/content/popup_image.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/popup_image.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/popup_image.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<div align="center">
+<a href="javascript:;" onclick="javascript:top.window.close();">
+<?php
+$thumb_len = ((MAIN_THUMB_IN_SUBDIR == 'true') ? strlen(IN_IMAGE_THUMBS) : 0);
+$thumbs = ((MAIN_THUMB_IN_SUBDIR == 'true') ? IN_IMAGE_THUMBS : '');
+$image_base = substr($products['products_image'], $thumb_len, -4);
+$image_ext = '.' . BIG_IMAGE_TYPE;
+$image_path = DIR_WS_IMAGES . IN_IMAGE_BIGIMAGES;
+$image_addon = (($_GET['pic']) ? MORE_PICS_EXT . $_GET['pic'] : BIG_PIC_EXT);
+
+/* 
+   if the big image isn't shown unkomment the next line, and check the path:
+   maybe you have to remove '/'. or adjust the path, depends on your configuration
+*/
+// echo DIR_FS_CATALOG . $image_path . $image_base . $image_addon . $image_ext . '<br>';
+ if (is_file(DIR_FS_CATALOG . $image_path . $image_base . $image_addon . $image_ext)) {
+  $image = $image_path . $image_base . $image_addon . $image_ext;
+  } else {
+  $image = (($_GET['pic']) ? DIR_WS_IMAGES . IN_IMAGE_THUMBS . $image_base . $image_addon . $image_ext : DIR_WS_IMAGES . $thumbs . $image_base . $image_ext);
+  }
+
+  echo tep_image($image, $products_values['products_name'], '', '', 'lowsrc="images/pixel_trans.gif"');
+?>
+</a>
+</div>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/popup_links_help.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/popup_links_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/popup_links_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+<?php
+/*
+  $Id: popup_links_help.php,v 1.1.1.1 2004/03/04 23:42:00 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  $navigation->remove_current_page();
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LINKS_SUBMIT);
+?>
+<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo HTML_PARAMS; ?>>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
+<title><?php echo TITLE; ?></title>
+<link rel="stylesheet" type="text/css" href="stylesheet.css">
+</head>
+<body marginwidth="10" marginheight="10" topmargin="10" bottommargin="10" leftmargin="10" rightmargin="10">
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => HEADING_LINKS_HELP);
+
+  new infoBoxHeading($info_box_contents, true, true);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TEXT_LINKS_HELP);
+
+  new infoBox($info_box_contents);
+?>
+
+<p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>
+
+</body>
+</html>
+<?php require('includes/application_bottom.php'); ?>

Added: trunk/direct.openmoko.com/templates/content/popup_search_help.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/popup_search_help.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/popup_search_help.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,57 @@
+<table border="0" width="100%" cellspacing="3" cellpadding="<?php echo CELLPADDING_MAIN; ?>">
+
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;' ;
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo HEADING_SEARCH_HELP; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+
+<?php
+}else{
+$header_text = HEADING_SEARCH_HELP;
+}
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+     <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+      <tr>
+    <td><img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
+  </tr>
+  <tr>
+    <td class="smallText"><?php echo TEXT_SEARCH_HELP; ?></td>
+  </tr>
+
+  </table>
+      </td>
+        </tr>
+<tr>
+  <td>
+<p class="smallText" align="right"><a href="javascript:window.close()"><?php echo TEXT_CLOSE_WINDOW; ?></a></p>
+  </td>
+ </tr>
+ <tr>
+  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+</tr>
+    <?php
+    // BOF: Lango Added for template MOD
+    if (MAIN_TABLE_BORDER == 'yes'){
+    table_image_border_bottom();
+    }
+    // EOF: Lango Added for template MOD
+
+?>
+

Added: trunk/direct.openmoko.com/templates/content/product_info.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/product_info.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/product_info.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,476 @@
+    <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php  
+  if ($product_check['total'] < 1) {
+?>
+      <tr>
+        <td><?php  new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  } else {
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
+// EOF MaxiDVD: Modified For Ultimate Images Pack!
+    $product_info = tep_db_fetch_array($product_info_query);
+
+    tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
+
+    if (tep_not_null($product_info['products_model'])) {
+      $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
+    } else {
+      $products_name = $product_info['products_name'];
+    }
+     if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
+      $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
+    } else {
+      $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
+    }
+
+// BOF: WebMakers.com Added: Show Featured Products
+if (SHOW_HEADING_TITLE_ORIGINAL=='yes') {
+$header_text = '&nbsp;';
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
+            <td class="pageHeading" align="right" valign="top"><?php 
+
+         if ($product_has_sub > '0'){
+             }else{
+             echo $products_price; 
+             }
+             ?>
+             </td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+} else {
+  ?>
+  </tr><tr>
+  <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr> <td class="infoBoxContents"><?php echo  $products_name ;?>  </td>
+  <td align="right" class="infoBoxContents"><nobr><?php echo $products_price ;?></nobr>
+  </td></td></tr></table><td>
+  <?php
+}
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+  table_image_border_top(false, false, $header_text);
+} else {
+echo $header_text ;
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td class="main"><table width="100%" border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td class="main" valign="top">
+              <p><?php echo stripslashes($product_info['products_description']); ?></p>
+            </td>
+<?php
+    if (tep_not_null($product_info['products_image'])) {
+?>
+            <td align="right" class="smallText" valign="top">
+              <table border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td>
+
+<!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //-->
+<?php
+      if ($product_info['products_image_med']!='') {
+        $new_image = $product_info['products_image_med'];
+        $image_width = MEDIUM_IMAGE_WIDTH;
+        $image_height = MEDIUM_IMAGE_HEIGHT;
+      } else {
+        $new_image = $product_info['products_image'];
+        $image_width = SMALL_IMAGE_WIDTH;
+        $image_height = SMALL_IMAGE_HEIGHT;
+      }
+      echo tep_javascript_image(DIR_WS_IMAGES . $new_image, 'product' . $product_info['products_id'], addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"', 'true');
+?>
+<!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! //-->
+<!-- // BEGIN  Affiliate program mods for 2.5a upgrade DMG  -->
+            <br><br>
+<?php
+      //affiliate build a link begin
+    /*  if (tep_session_is_registered('affiliate_id')) {
+        echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD, 'individual_banner_id=' . $product_info['products_id']) .'" target="_self">' . tep_image('includes/languages/english/images/buttons/button_affiliate_build_a_link.gif', 'Make a link') . ' </a>'; ?><?php
+      }*/
+
+     if (tep_session_is_registered('affiliate_id')) {
+        echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD, 'individual_banner_id=' . $product_info['products_id']) .'" target="_self">' . tep_image('includes/languages/english/images/buttons/button_affiliate_build_a_link.gif', LINK_ALT) . ' </a>'; ?><?php
+      }
+      //affiliate build a link begin
+?>
+<!-- // EOF Affiliate program 2.5a upgrade mods DMG -->
+                  </td>
+                </tr>
+              </table>
+            </td>
+<?php
+    }
+?>
+          </tr>
+          <tr>
+            <td colspan="2">
+<?php
+    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' ");
+    $products_attributes = tep_db_fetch_array($products_attributes_query);
+    if ($products_attributes['total'] > 0) {
+?>
+              <table width="100%" border="0" cellspacing="0" cellpadding="2">
+                <tr>
+                  <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
+                </tr>
+<?php
+      $products_options_query = tep_db_query("select pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, po.options_type, po.options_length, pot.products_options_name, pot.products_options_instruct from
+           " . TABLE_PRODUCTS_ATTRIBUTES  . " AS pa, 
+           " . TABLE_PRODUCTS_OPTIONS  . " AS po,
+           " . TABLE_PRODUCTS_OPTIONS_TEXT  . " AS pot
+           where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'
+             and pa.options_id = po.products_options_id
+             and po.products_options_id = pot.products_options_text_id and pot.language_id = '" . (int)$languages_id . "'
+           order by pa.products_options_sort_order
+           ");
+      
+      // Store the information from the tables in arrays for easy of processing
+      $options = array();
+      $options_values = array();
+      while ($po = tep_db_fetch_array($products_options_query)) {
+        //  we need to find the values name 
+        if ( $po['options_type'] != 1  && $po['options_type'] != 4 ) {
+          $options_values_query = tep_db_query("select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id ='". $po['options_values_id'] . "' and language_id = '" . (int)$languages_id . "'");
+          $ov = tep_db_fetch_array($options_values_query);
+        } else {
+          $ov['products_options_values_name'] = '';
+        }
+        $options[$po['options_id']] = array('name' => $po['products_options_name'], 'type' => $po['options_type'], 'length' => $po['options_length'], 'instructions' => $po['products_options_instruct']);
+        $options_values[$po['options_id']][$po['options_values_id']] =  array('name' => stripslashes($ov['products_options_values_name']), 'price' => $po['options_values_price'], 'prefix' => $po['price_prefix']);
+      }
+      
+      foreach ($options as $oID => $op_data) {
+        switch ($op_data['type']) {
+            
+          case 1:
+            $maxlength = ( $op_data['length'] > 0 ? ' maxlength="' . $op_data['length'] . '"' : '' );
+            $tmp_html = '<input type="text" name="id[' . $oID . '][t]"' . $maxlength . ' />'; 
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+            break;
+      
+          case 4:
+            $text_area_array = explode(';',$op_data['length']);
+            $cols = $text_area_array[0];
+            if ( $cols == '' ) $cols = '100%';
+            $rows = $text_area_array[1];
+            $tmp_html = '<textarea name="id[' . $oID . '][t]" rows="'.$rows.'" cols="'.$cols.'" wrap="virtual"></textarea>'; 
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main" align="center"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+            break;
+      
+          case 2:
+            $tmp_html = '';
+            foreach ( $options_values[$oID] as $vID => $ov_data ) {
+              if ( (float)$ov_data['price'] == 0 ) {
+                  $price = '&nbsp;';
+              } else {
+                  $price = '(&nbsp;' . $ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate) . '&nbsp;)';
+              }
+              $tmp_html .= '<input type="radio" name="id[' . $oID . ']" value="' . $vID . '">' . $ov_data['name'] . '&nbsp;' . $price . '<br />';
+            } // End of the for loop on the option value
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+            break;
+          
+          case 3:
+            $tmp_html = '';
+            $i = 0;
+            foreach ( $options_values[$oID] as $vID => $ov_data ) {
+              if ( (float)$ov_data['price'] == 0 ) {
+                $price = '&nbsp;';
+              } else {
+                $price = '(&nbsp;'.$ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate).'&nbsp;)';
+              }
+              $tmp_html .= '<input type="checkbox" name="id[' . $oID . '][c][' . $i . ']" value="' . $vID . '">' . $ov_data['name'] . '&nbsp;' . $price . '<br />';
+              $i++;
+            }
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+            break;
+            
+          case 0:
+            $tmp_html = '<select name="id[' . $oID . ']">';
+            foreach ( $options_values[$oID] as $vID => $ov_data ) {
+              if ( (float)$ov_data['price'] == 0 ) {
+                $price = '&nbsp;';
+              } else {
+                $price = '(&nbsp; '.$ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate).'&nbsp;)';
+              }
+              $tmp_html .= '<option value="' . $vID . '">' . $ov_data['name'] . '&nbsp;' . $price .'</option>';
+            } // End of the for loop on the option values
+            $tmp_html .= '</select>';
+?>
+            <tr>
+              <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+              <td class="main"><?php echo $tmp_html;  ?></td>
+            </tr>
+<?php
+            break;
+        }  //end of switch
+      } //end of while
+?>
+              </table>    
+<?php
+    } // end of ($products_attributes['total'] > 0)
+?>
+            </td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+ if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') { include(DIR_WS_MODULES . 'additional_images.php'); }
+// BOF MaxiDVD: Modified For Ultimate Images Pack!
+ ?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+    $reviews = tep_db_fetch_array($reviews_query);
+    if ($reviews['count'] > 0) {
+?>
+      <tr>
+        <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    }
+    // Extra Products Fields are checked and presented
+    // START: Extra Fields Contribution  DMG
+    $extra_fields_query = tep_db_query("SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
+                                        FROM ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf,
+                                             ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
+                                        WHERE ptf.products_id='".(int)$HTTP_GET_VARS['products_id']."' 
+                                          and ptf.products_extra_fields_value <> ''
+                                          and ptf.products_extra_fields_id = pef.products_extra_fields_id
+                                          and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
+                                        ORDER BY products_extra_fields_order");
+    if ( tep_db_num_rows($extra_fields_query) > 0 ) {
+?>
+      <tr>
+        <td class="main"><table border="0" cellspacing="1" cellpadding="2">
+<?php
+      while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
+        if (! $extra_fields['status'])  // show only enabled extra field
+          continue;
+?>
+          <tr>
+            <td class="main" valign="top"><b><?php echo $extra_fields['name']; ?>:&nbsp;</b></td>
+            <td class="main" valign="top"><?php echo $extra_fields['value']; ?></td>
+          </tr>
+<?php
+      }
+?>
+        </table></td>
+      </tr>
+<?php
+    }
+    // END: Extra Fields Contribution
+    if (tep_not_null($product_info['products_url'])) {
+?>
+      <tr>
+        <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&amp;goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+    }
+
+    if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
+?>
+      <tr>
+        <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
+      </tr>
+<?php
+    } else {
+?>
+      <tr>
+        <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
+      </tr>
+  <?php
+    }
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+  table_image_border_bottom(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+  // get sort order
+  
+  $csort_order = tep_db_fetch_array(tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'CATEGORIES_SORT_ORDER'"));
+  
+  $select_order_by = '';
+    switch ($csort_order['configuration_value']) {
+      case 'PRODUCT_LIST_MODEL':
+        $select_order_by .= 'p.products_model';
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $select_order_by .= 'pd.products_name';
+        break;
+//commented out - do subproducts have different manufacturers?
+//      case 'PRODUCT_LIST_MANUFACTURER':
+//          $select_order_by .= 'm.manufacturers_name, ';
+//          break;
+      case 'PRODUCT_LIST_PRICE':
+        $select_order_by .= 'p.products_price';
+        break;
+     default:
+        $select_order_by .= 'p.products_model';
+        break;
+    }
+
+   $sub_products_sql = tep_db_query("select p.products_id, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_parent_id = " . (int)$HTTP_GET_VARS['products_id'] . " ".$allowcriteria." and p.products_id = pd.products_id and pd.language_id = " . (int)$languages_id . " order by " . $select_order_by);
+
+if (tep_db_num_rows($sub_products_sql) > 0) {
+  // BOF: Lango Added for template MOD
+  if (MAIN_TABLE_BORDER == 'yes'){
+    table_image_border_top(false, false, $header_text);
+  }
+  // EOF: Lango Added for template MOD
+  ?>
+  <tr>
+    <td><table border="0" cellpadding="0" cellspacing="2" width="100%" align="center">
+      <tr>
+        <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <?php
+        while ($sub_products = tep_db_fetch_array($sub_products_sql)) {
+          $subname = substr( $sub_products['products_name'], strlen( $product_info['products_name'] . ' - ' ));
+          if ($new_sub_price = tep_get_products_special_price($sub_products['products_id'])) {
+            $sub_products_price = '<s>' . $currencies->display_price($sub_products['products_price'], tep_get_tax_rate($sub_products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_sub_price, tep_get_tax_rate($sub_products['products_tax_class_id'])) . '</span>';
+          } else {
+            $sub_products_price = $currencies->display_price($sub_products['products_price'], tep_get_tax_rate($sub_products['products_tax_class_id']));
+          }
+          ?>
+          <tr align="center">
+            <td class="productListing-data"><?php if ($sub_products['products_image']) echo tep_image(DIR_WS_IMAGES . $sub_products['products_image'], $subname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT,'vspace="2" hspace="2"'); ?></td>
+            <td class="productListing-data"><b><?php echo $subname; ?></b>&nbsp;[<?php echo $sub_products['products_model']; ?>]</td>
+            <td class="productListing-data"><?php echo $sub_products_price; ?></td>
+            <td class="productListing-data">Quantity : <?php echo tep_draw_input_field('sub_products_qty[]', '0', 'size="5"') . tep_draw_hidden_field('sub_products_id[]', $sub_products['products_id']);;?></td>
+        </tr>
+        <?php
+        }
+      ?>
+      <tr>
+        <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+    </table></td>
+  </tr>
+  <?php  
+  // BOF: Lango Added for template MOD
+  if (MAIN_TABLE_BORDER == 'yes'){
+    table_image_border_bottom();
+  }
+  // EOF: Lango Added for template MOD
+}
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_template_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS,'align="absmiddle"') . '</a>'; ?></td>
+                <!-- Begin Wishlist Code -->
+                <?php 
+                  if (DESIGN_BUTTON_WISHLIST == 'true') {
+                    echo '<td align="right" class="main" valign="middle">';
+                    if( (!tep_session_is_registered('customer_id')) || (!tep_session_is_registered('SESSION_WISHLIST')) ){
+                      $SESSION_WISHLIST = $product_info['products_id'];
+                      tep_session_register('SESSION_WISHLIST');
+                    }
+                    echo '<a href="javascript:document.cart_quantity.action=\'' . tep_href_link(FILENAME_PRODUCT_INFO, 'action=add_wishlist') . '\'; document.cart_quantity.submit();">' . tep_template_image_button('button_add_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST,'align="absmiddle"') . '</a>' ;
+                    echo '</td>';
+                  } 
+                ?>
+                <!-- End Wishlist Code -->
+                   <td class="main" align="right" valign="middle">
+                <?php
+                if (tep_db_num_rows($sub_products_sql) ==0) {
+                      echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', '1', 'size="6"');     
+               }
+               echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_template_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absmiddle"'); 
+                ?>
+              </form></td>
+              <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+            </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+   if ( (USE_CACHE == 'true') && !SID) {
+    echo tep_cache_also_purchased(3600);
+     include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
+    } else {
+     include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS_BUYNOW);
+        echo tep_draw_separator('pixel_trans.gif', '100%', '10');
+  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
+
+    }
+   }
+?>
+       </td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/content/product_reviews.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/product_reviews.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/product_reviews.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,184 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;' ;
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
+            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = $products_name . '&nbsp;&nbsp;&nbsp;&nbsp;' . $products_price;
+}
+?>
+
+<?php
+  $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id desc";
+  $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
+
+  if ($reviews_split->number_of_rows > 0) {
+    if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
+?>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                    <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+    }
+    $reviews_query = tep_db_query($reviews_split->sql_query);
+    while ($reviews = tep_db_fetch_array($reviews_query)) {
+?>
+         <tr>
+            <td> <?php //echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&amp;reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</b></u></a>'; ?></td>
+                    <td class="smallText" align="right"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td valign="top" class="main"><?php echo tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br>') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>'; ?></td>
+                        <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </td>
+          </tr>
+<?php } ?>
+
+       <tr>
+         <td><table>
+             <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" align="right" valign="top">
+              <table border="0" cellspacing="0" cellpadding="2">
+<?php
+  if (tep_not_null($product_info['products_image'])) {
+?>
+ <td class="smallText">
+
+<script language="javascript"><!--
+document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
+//--></script>
+<noscript>
+<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
+</noscript>
+
+<?php
+  }
+
+//wishlist button
+  $wishlist_id_query = tep_db_query('select products_id as wPID from ' . TABLE_WISHLIST . ' where products_id= ' . $product_info['products_id'] . ' and customers_id = ' . (int)$customer_id . ' order by products_name');
+  $wishlist_Pid = tep_db_fetch_array($wishlist_id_query);
+
+  echo '<td><p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_template_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>';
+echo '<form name="wishlist_quantity" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_wishlist', 'NONSSL') . '">';
+echo '                    <input type="hidden" name="products_id" value="' . $product_info['products_id'] . '">
+                          <input type="hidden" name="products_model" value="' . $product_info['products_model'] . '">
+                          <input type="hidden" name="products_name" value="' . $product_info['products_name'] . '">
+                          <input type="hidden" name="products_price" value="' . $product_info['products_price'] . '">
+                          <input type="hidden" name="final_price" value="' . $product_info['final_price'] . '">
+                          <input type="hidden" name="products_tax" value="' . $product_info['products_tax'] . '">';
+
+if ( (!tep_not_null($wishlist_Pid[wPID])) && (tep_session_is_registered('customer_id')) )  echo tep_template_image_submit('button_add_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST);
+echo  '
+                        </form>
+</p></td>';
+?>                </td></table>
+                 </td>
+             </table></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+
+?>
+<?php
+  } else {
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+              <tr>
+                <td align="center" class="infoboxContents"><?php echo TEXT_NO_REVIEWS; ?></td>
+              </tr>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<?php
+  }
+  if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
+?>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                    <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+
+              <tr>
+                <td><?php //echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+<?php
+  }
+?>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params()) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                        <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()) . '">' . tep_template_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                     </table></td>
+                  </tr>
+                 </table></td>
+              </tr>
+   </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/product_reviews_info.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/product_reviews_info.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/product_reviews_info.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,115 @@
+<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
+            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = $products_name . '&nbsp;&nbsp;&nbsp;&nbsp;' . $products_price;
+}
+?>
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo '<b>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews_info['customers_name'])) . '</b>'; ?></td>
+                    <td class="smallText" align="right"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews_info['date_added'])); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td valign="top" class="main"><?php echo tep_break_string(nl2br(tep_output_string_protected($reviews_info['reviews_text'])), 60, '-<br>') . '<br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews_info['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews_info['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews_info['reviews_rating'])) . '</i>'; ?></td>
+                        <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo '<a href="javascript:history.go(-1)">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                        <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params(array('reviews_id'))) . '">' . tep_template_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a>'; ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+            <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" align="right" valign="top"><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td align="center" class="smallText">
+                <?php
+                  if (tep_not_null($reviews_info['products_image'])) {
+                  ?>
+                    <script language="javascript"><!--
+                      document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $reviews_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $reviews_info['products_image'], addslashes($reviews_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
+                    //--></script>
+                    <noscript>
+                      <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $reviews_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $reviews_info['products_image'], $reviews_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
+                    </noscript>
+                  <?php
+                  }
+                  echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_template_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>';
+                  // Begin Wishlist Code 
+                  if (DESIGN_BUTTON_WISHLIST == 'true') {                   
+                    if( (!tep_session_is_registered('customer_id')) || (!tep_session_is_registered('SESSION_WISHLIST')) ){
+                      $SESSION_WISHLIST = $reviews_info['products_id'];
+                      tep_session_register('SESSION_WISHLIST');
+                    }
+                    echo '<p><a href="javascript:document.cart_quantity.action=\'' . tep_href_link(basename(FILENAME_PRODUCT_INFO), 'action=add_wishlist') . '\'; document.cart_quantity.submit();">' . tep_template_image_button('button_add_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST,'align="absmiddle"') . '</a>' ;
+                  }         
+                  // End Wishlist Code
+                  echo  '</form></p>';
+                ?>
+                </td>
+              </tr>
+            </table>
+          </td>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+    </table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/product_reviews_write.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/product_reviews_write.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/product_reviews_write.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,121 @@
+    <?php echo tep_draw_form('product_reviews_write', tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'action=process&amp;products_id=' . $HTTP_GET_VARS['products_id']), 'post', 'onSubmit="return checkForm();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
+            <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text =  $products_name . '<br>' . $products_price;
+}
+?>
+
+<?php
+  if ($messageStack->size('review') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('review'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
+          <tr>
+            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo '<b>' . SUB_TITLE_FROM . '</b> ' . tep_output_string_protected($customer['customers_firstname'] . ' ' . $customer['customers_lastname']); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><b><?php echo SUB_TITLE_REVIEW; ?></b></td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="2" cellpadding="2">
+                      <tr>
+                        <td class="main"><?php echo tep_draw_textarea_field('review', 'soft', 60, 15); ?></td>
+                      </tr>
+                      <tr>
+                        <td class="smallText" align="right"><?php echo TEXT_NO_HTML; ?></td>
+                      </tr>
+                      <tr>
+                        <td class="main"><?php echo '<b>' . SUB_TITLE_RATING . '</b> ' . TEXT_BAD . ' ' . tep_draw_radio_field('rating', '1') . ' ' . tep_draw_radio_field('rating', '2') . ' ' . tep_draw_radio_field('rating', '3') . ' ' . tep_draw_radio_field('rating', '4') . ' ' . tep_draw_radio_field('rating', '5') . ' ' . TEXT_GOOD; ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+            <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" align="right" valign="top"><table border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td align="center" class="smallText">
+<?php
+  if (tep_not_null($product_info['products_image'])) {
+?>
+<script language="javascript"><!--
+document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
+//--></script>
+<noscript>
+<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
+</noscript>
+<?php
+  }
+
+  echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_template_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
+?>
+                </td>
+              </tr>
+            </table>
+          </td>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+                  <tr class="infoBoxContents">
+                    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                      <tr>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                        <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('reviews_id', 'action'))) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                        <td class="main" align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                        <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                      </tr>
+                    </table></td>
+                  </tr>
+                </table></td>
+              </tr>
+
+    </table></form>
+

Added: trunk/direct.openmoko.com/templates/content/products_new.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/products_new.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/products_new.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text =  HEADING_TITLE;
+}
+?>
+<?php
+   // queries now in the root new_products.php
+
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+
+
+?>
+   <tr>
+        <td>
+        <?php 
+   
+  //decide which product listing to use
+   if (PRODUCT_LIST_CONTENT_LISTING == 'column'){
+  $listing_method = FILENAME_PRODUCT_LISTING_COL;
+  } else {
+  $listing_method = FILENAME_PRODUCT_LISTING;
+  }
+  //Then show product listing
+  include(DIR_WS_MODULES . $listing_method); 
+   
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </td>
+      </tr>
+<?php
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/pw.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/pw.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/pw.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,84 @@
+<!-- body_text //-->
+
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+<tr>
+<td class="pageHeading"><?php echo HEADIN_TITLE; ?></td>
+<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+</tr>
+<tr>
+<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+</tr>
+</table>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+<?php
+if (($HTTP_GET_VARS['pass'] != '') && ($HTTP_GET_VARS['verifyid'] != '')){
+$select = tep_db_query("SELECT * from " . TABLE_CUSTOMERS . " where customers_id =  " . (int)$HTTP_GET_VARS['verifyid'] . "");
+$start = tep_db_fetch_array($select);
+if ($start['customers_validation_code'] == $HTTP_GET_VARS['pass']) {
+if ($start['customers_validation'] == '1'){
+?>            <td class="main"><?php echo TEXT_YOUR_ACCOUNT_ALREADY_EXIST . '<br>'; ?></td>
+<?php
+}else{
+tep_db_query("update " . TABLE_CUSTOMERS . " set customers_validation = '1', customers_email_registered = '" . $start['customers_email_address'] . "' where customers_id = '" . (int)$HTTP_GET_VARS['verifyid'] . "'");
+
+if (LOGIN_AFTER_VALIDATE == 'true'){
+    $customer_id = $start['customers_id'];
+    $customer_default_address_id = $start['customers_default_address_id'];
+    $customer_first_name = $start['customers_firstname'];
+    $customer_country_id = $start['entry_country_id'];
+    $customer_zone_id = $start['entry_zone_id'];
+    tep_session_register('customer_id');
+    tep_session_register('customer_default_address_id');
+    tep_session_register('customer_first_name');
+    tep_session_register('customer_country_id');
+    tep_session_register('customer_zone_id');
+
+        tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");
+        $cart->restore_contents();
+    }
+?>
+<td class="main"><?php echo TEXT_ACCOUNT_CREATED . '<br>'; ?></td>
+         </tr>
+          <tr>
+            <td><?php 
+    }
+  } else {
+  ?>
+  <td class="main"><?php echo TEXT_ACCOUNT_CREATED_FAIL . '<br>'; ?></td>
+         </tr>
+          <tr>
+            <td>
+      <?php
+      }
+  } else {
+  ?>
+  <td class="main"><?php echo TEXT_ACCOUNT_CREATED_FAIL2 . '<br>'; ?></td>
+         </tr>
+          <tr>
+            <td>
+  <?php 
+  
+  }
+  echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+
+          </tr>
+        </table>
+
+<!-- body_text_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/reviews.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/reviews.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/reviews.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,118 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_reviews_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text =  HEADING_TITLE;
+}
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+  $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id DESC";
+  $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
+
+  if ($reviews_split->number_of_rows > 0) {
+    if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
+?>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+    }
+ table_image_border_top(false, false, $header_text);
+    $reviews_query = tep_db_query($reviews_split->sql_query);
+    while ($reviews = tep_db_fetch_array($reviews_query)) {
+?>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&amp;reviews_id=' . $reviews['reviews_id']) . '"><u><b>' . $reviews['products_name'] . '</b></u></a> <span class="smallText">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</span>'; ?></td>
+                <td class="smallText" align="right"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                    <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" align="center" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews['products_id'] . '&amp;reviews_id=' . $reviews['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $reviews['products_image'], $reviews['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
+                    <td valign="top" class="main"><?php echo tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br>') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>'; ?></td>
+                    <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+
+<?php
+    }
+?>
+<?php
+  } else {
+ table_image_border_top(false, false, HEADING_TITLE);
+?>
+          <tr>
+            <td><?php new infoBox(array(array('text' => TEXT_NO_REVIEWS))); ?></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+  }
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+
+  if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
+?>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="smallText"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></td>
+                <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+<?php
+  }
+?>
+        </table></td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/content/shop_by_price.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/shop_by_price.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/shop_by_price.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td>
+<?php
+  // MELTUS - this is the section of interest
+  // create column list
+  $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
+                       'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
+                       'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
+                       'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
+                       'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
+                       'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
+                       'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
+                       'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
+  asort($define_list);
+
+  $column_list = array();
+  reset($define_list);
+  while (list($column, $value) = each($define_list)) {
+    if ($value) $column_list[] = $column;
+  }
+
+  $select_column_list = '';
+
+  for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
+    if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_NAME') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) {
+      continue;
+    }
+  }
+
+  $sbp_sql_range = '';
+  if (MODULE_SHOPBYPRICE_RANGES > 0  && $_GET['range'] <= MODULE_SHOPBYPRICE_RANGES) {
+    $sbp_array = unserialize(MODULE_SHOPBYPRICE_RANGE);
+    $i = $_GET['range'];
+
+   if ((is_numeric($sbp_array[$i])) || (is_numeric($sbp_array[$i-1]))){
+
+      if ($i == MODULE_SHOPBYPRICE_RANGES) {
+          $sbp_sql_range = ' and p.products_price >= ' . $sbp_array[$i-1] . ' ';
+          } elseif ($i == 0) {
+       $sbp_sql_range = ' and p.products_price < ' . $sbp_array[$i] . ' ';
+          } else {
+        $sbp_sql_range = ' and (p.products_price >= ' . $sbp_array[$i-1] . ' and p.products_price < ' . $sbp_array[$i] . ') ';
+    }
+    }
+  }
+
+  $listing_sql = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name
+                  from " . TABLE_PRODUCTS . " p
+                  left join " . TABLE_SPECIALS . " s using(products_id) 
+                  left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id,
+                       " . TABLE_PRODUCTS_DESCRIPTION . " pd
+                  where p.products_status = '1' " . $sbp_sql_range . "
+                    and p.products_id = pd.products_id
+                    and pd.language_id = '" . $languages_id . "'
+                  order by p.products_price, pd.products_name";
+
+include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/shopping_cart.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/shopping_cart.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/shopping_cart.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,376 @@
+    <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_cart.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text =  HEADING_TITLE;
+}
+?>
+
+<?php 
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+?>
+<?php
+  if ($cart->count_contents() > 0) {
+?>
+      <tr>
+        <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[0][] = array('align' => 'center',
+                                    'params' => 'class="productListing-heading"',
+                                    'text' => TABLE_HEADING_REMOVE);
+
+    $info_box_contents[0][] = array('params' => 'class="productListing-heading"',
+                                    'text' => TABLE_HEADING_PRODUCTS);
+
+    $info_box_contents[0][] = array('align' => 'center',
+                                    'params' => 'class="productListing-heading"',
+                                    'text' => TABLE_HEADING_QUANTITY);
+
+    $info_box_contents[0][] = array('align' => 'right',
+                                    'params' => 'class="productListing-heading"',
+                                    'text' => TABLE_HEADING_TOTAL);
+
+    $any_out_of_stock = 0;
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+// Push all attributes information in an array
+      if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
+        while (list($option, $value) = each($products[$i]['attributes'])) {
+          /*  replace the atrribute handling
+          echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
+  
+          $attributes_query = tep_db_query("select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
+            from " . TABLE_PRODUCTS_OPTIONS . " popt,
+            " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
+            " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,
+            " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
+            where 
+            pa.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+            and pa.options_id = '" . (int)$option . "' 
+            and pa.options_values_id = '" . $value . "'
+            and poval.products_options_values_id = pa.options_values_id
+            and poptt.products_options_text_id = pa.options_id
+            and poptt.language_id = '" . (int)$languages_id . "'
+            and poval.language_id = '" . (int)$languages_id . "'");
+            
+            
+            $attributes_values = tep_db_fetch_array($attributes_query);
+
+
+          $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
+          $products[$i][$option]['options_values_id'] = $value;
+          $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
+          $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
+          $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
+          */
+          
+          if ( ! is_array($value) ) {
+            $attributes = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, ov.products_options_values_name, op.options_values_price, op.price_prefix
+                                        from " . TABLE_PRODUCTS_ATTRIBUTES . " op,   
+                                             " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov, 
+                                             " . TABLE_PRODUCTS_OPTIONS . " o,
+                                             " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot 
+                                        where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                          and op.options_values_id = '" . $value . "'
+                                          and op.options_id = '" . $option . "'
+                                          and ov.products_options_values_id = op.options_values_id
+                                          and ov.language_id = '" . (int)$languages_id . "'
+                                          and o.products_options_id = op.options_id
+                                          and ot.products_options_text_id = o.products_options_id
+                                          and ot.language_id = '" . (int)$languages_id . "'
+                                       ");
+            $attributes_values = tep_db_fetch_array($attributes);
+          
+            $products[$i][$option][$value]['products_options_name'] = $attributes_values['products_options_name'];
+            $products[$i][$option][$value]['options_values_id'] = $value;
+            $products[$i][$option][$value]['products_options_values_name'] = $attributes_values['products_options_values_name'];
+            $products[$i][$option][$value]['options_values_price'] = $attributes_values['options_values_price'];
+            $products[$i][$option][$value]['price_prefix'] = $attributes_values['price_prefix'];
+            
+          } elseif ( isset($value['c'] ) ) {
+            foreach ($value['c'] as $v) {
+                $attributes = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, ov.products_options_values_name, op.options_values_price, op.price_prefix
+                                            from " . TABLE_PRODUCTS_ATTRIBUTES . " op,   
+                                                 " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov, 
+                                                 " . TABLE_PRODUCTS_OPTIONS . " o,
+                                                 " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot 
+                                            where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                              and op.options_values_id = '" . $v . "'
+                                              and op.options_id = '" . $option . "'
+                                              and ov.products_options_values_id = op.options_values_id
+                                              and ov.language_id = '" . (int)$languages_id . "'
+                                              and o.products_options_id = op.options_id
+                                              and ot.products_options_text_id = o.products_options_id
+                                              and ot.language_id = '" . (int)$languages_id . "'
+                                           ");
+              $attributes_values = tep_db_fetch_array($attributes);
+          
+              $products[$i][$option][$v]['products_options_name'] = $attributes_values['products_options_name'];
+              $products[$i][$option][$v]['options_values_id'] = $v;
+              $products[$i][$option][$v]['products_options_values_name'] = $attributes_values['products_options_values_name'];
+              $products[$i][$option][$v]['options_values_price'] = $attributes_values['options_values_price'];
+              $products[$i][$option][$v]['price_prefix'] = $attributes_values['price_prefix'];
+            }
+            
+          } elseif ( isset($value['t'] ) ) {
+            $attributes = tep_db_query("select op.options_id, ot.products_options_name, o.options_type, op.options_values_price, op.price_prefix
+                                        from " . TABLE_PRODUCTS_ATTRIBUTES . " op,   
+                                             " . TABLE_PRODUCTS_OPTIONS . " o,
+                                             " . TABLE_PRODUCTS_OPTIONS_TEXT . " ot
+                                        where op.products_id = '" . tep_get_prid($products[$i]['id']) . "'
+                                          and op.options_id = '" . $option . "'
+                                          and o.products_options_id = op.options_id
+                                          and ot.products_options_text_id = o.products_options_id
+                                          and ot.language_id = '" . (int)$languages_id . "'
+                                       ");
+            $attributes_values = tep_db_fetch_array($attributes);
+          
+            $products[$i][$option]['t']['products_options_name'] = $attributes_values['products_options_name'];
+            $products[$i][$option]['t']['options_values_id'] = '0';
+            $products[$i][$option]['t']['products_options_values_name'] = $value['t'];
+            $products[$i][$option]['t']['options_values_price'] = $attributes_values['options_values_price'];
+            $products[$i][$option]['t']['price_prefix'] = $attributes_values['price_prefix'];
+            
+          }
+
+        }
+      }
+    }
+
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      if (($i/2) == floor($i/2)) {
+        $info_box_contents[] = array('params' => 'class="productListing-even"');
+      } else {
+        $info_box_contents[] = array('params' => 'class="productListing-odd"');
+      }
+
+      $cur_row = sizeof($info_box_contents) - 1;
+
+      $info_box_contents[$cur_row][] = array('align' => 'center',
+                                             'params' => 'class="productListing-data" valign="top"',
+                                             'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+    $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
+    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
+    if ((int)$products_parent_id['products_parent_id'] != 0) {
+    $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
+                       '  <tr>' .
+                       '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
+                       '    <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '"><b>' . $products[$i]['name'] . '</b></a>';
+    } else {
+    $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
+                       '  <tr>' .
+                       '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
+                       '    <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';
+    }
+/*
+      $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
+                       '  <tr>' .
+                       '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
+                       '    <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';
+*/
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+/*
+      $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
+                       '  <tr>' .
+                       '    <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
+                       '    <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';
+*/
+      if (STOCK_CHECK == 'true') {
+        $stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
+        if (tep_not_null($stock_check)) {
+          $any_out_of_stock = 1;
+
+          $products_name .= $stock_check;
+        }
+      }
+
+      if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
+        reset($products[$i]['attributes']);
+        while (list($option, $value) = each($products[$i]['attributes'])) {
+// BOM - Options Catagories
+//          $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
+          if ( !is_array($value) ) {
+            $products_name .= '<br><small><i> - ' . $products[$i][$option][$value]['products_options_name'] . ' ' . $products[$i][$option][$value]['products_options_values_name'] . '</i></small>';
+          } else {
+            if ( isset($value['c']) ) {
+              foreach ( $value['c'] as $v ) {
+                $products_name .= '<br><small><i> - ' . $products[$i][$option][$v]['products_options_name'] . ' ' . $products[$i][$option][$v]['products_options_values_name'] . '</i></small>';
+              }
+            } elseif ( isset($value['t']) ) {
+                $products_name .= '<br><small><i> - ' . $products[$i][$option]['t']['products_options_name'] . ' ' . $value['t'] . '</i></small>';
+            }
+          }
+// EOM - Options Catagories
+        }
+      }
+
+      $products_name .= '    </td>' .
+                        '  </tr>' .
+                        '</table>';
+
+      $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',
+                                             'text' => $products_name);
+
+      $info_box_contents[$cur_row][] = array('align' => 'center',
+                                             'params' => 'class="productListing-data" valign="top"',
+                                             'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));
+
+      $info_box_contents[$cur_row][] = array('align' => 'right',
+                                             'params' => 'class="productListing-data" valign="top"',
+                                             'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
+    }
+
+    new productListingBox($info_box_contents);
+?>
+        </td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td>
+      </tr>
+<?php
+    if ($any_out_of_stock == 1) {
+      if (STOCK_ALLOW_CHECKOUT == 'true') {
+?>
+      <tr>
+        <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td>
+      </tr>
+<?php
+      } else {
+?>
+      <tr>
+        <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
+      </tr>
+<?php
+      }
+    }
+?>
+<?php 
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><?php echo tep_template_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td>
+<?php
+if (RETURN_CART == L){
+   $back = sizeof($navigation->path)-2;
+    if (isset($navigation->path[$back])) {
+    $nav_link = '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>' ;
+        }
+ } else if (RETURN_CART == C){
+   $products = $cart->get_products();
+   $products = array_reverse($products);
+    $cat = tep_get_product_path($products[0]['id']) ;
+    $cat1= 'cPath=' . $cat;
+         if ($products == '') {
+            $back = sizeof($navigation->path)-2;
+             if (isset($navigation->path[$back])) {
+             $nav_link = '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>' ;
+         }
+        }else{
+    $nav_link = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cat1) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'  ;
+     }
+   } else if (RETURN_CART == P){ 
+   $products = $cart->get_products();
+   $products = array_reverse($products);
+     if ($products == '') {
+        $back = sizeof($navigation->path)-2;
+         if (isset($navigation->path[$back])) {
+         $nav_link = '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>' ;
+     }
+    }else{
+    $nav_link = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[0]['id']) . '">' . tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'  ;
+    }
+   }
+    ?>
+    
+                <td class="main"><?php echo $nav_link; ?></td>
+<?php
+   // }
+?>
+                <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_template_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></form>
+  </td>
+      </tr>
+<?php
+// WebMakers.com Added: Shipping Estimator
+  if (SHOW_SHIPPING_ESTIMATOR=='true') {
+  // always show shipping table
+?>
+      <tr>
+        <td><?php require($additional_module_folder . FILENAME_SHIPPING_ESTIMATOR); ?></td>
+      </tr>
+<?php
+  } 
+?>
+<?php
+  } else {
+?>
+      <tr>
+        <td align="center" class="main"><?php echo TEXT_CART_EMPTY; ?></td>
+      </tr>
+<?php 
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+  }
+?>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/content/specials.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/specials.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/specials.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = HEADING_TITLE;
+}
+?>
+<?php
+   // queries now in the root specials.php
+
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+
+
+?>
+   <tr>
+        <td>
+        <?php 
+   
+  //decide which product listing to use
+   if (PRODUCT_LIST_CONTENT_LISTING == 'column'){
+  $listing_method = FILENAME_PRODUCT_LISTING_COL;
+  } else {
+  $listing_method = FILENAME_PRODUCT_LISTING;
+  }
+  //Then show product listing
+  include(DIR_WS_MODULES . $listing_method); 
+   
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </td>
+      </tr>
+<?php
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/ssl_check.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/ssl_check.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/ssl_check.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,44 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td class="main"><table border="0" width="40%" cellspacing="0" cellpadding="0" align="right">
+          <tr>
+            <td><?php new InfoBoxHeading(array(array('text' => BOX_INFORMATION_HEADING))); ?></td>
+          </tr>
+          <tr>
+            <td><?php new infoBox(array(array('text' => BOX_INFORMATION))); ?></td>
+          </tr>
+        </table><?php echo TEXT_INFORMATION; ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_LOGIN) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/content/static.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/static.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/static.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+?>
+          <tr>
+            <td class="main"><?php echo TEXT_INFORMATION; ?></td>
+          </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table>
+

Added: trunk/direct.openmoko.com/templates/content/tell_a_friend.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/tell_a_friend.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/tell_a_friend.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,185 @@
+<?php
+  echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&amp;products_id=' . $HTTP_GET_VARS['products_id'])); 
+?>
+  <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php 
+
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo sprintf(HEADING_TITLE, $product_info['products_name']); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.gif', sprintf(HEADING_TITLE, $product_info['products_name']), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = sprintf(HEADING_TITLE, $product_info['products_name']);
+}
+// EOF: Lango Added for template MOD
+
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+  if ($messageStack->size('friend') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('friend'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></b></td>
+                <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('from_name'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('from_email_address'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo FORM_TITLE_FRIEND_DETAILS; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_FRIEND_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('to_name') . '&nbsp;<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_FRIEND_EMAIL; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('to_email_address') . '&nbsp;<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>'; ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+      
+      
+      <!--
+  VISUAL VERIFY CODE start -->
+      <tr>
+        <td class="main"><b><?php echo VISUAL_VERIFY_CODE_CATEGORY; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('visual_verify_code') . '&nbsp;' . '<span class="inputRequirement">' . VISUAL_VERIFY_CODE_ENTRY_TEXT . '</span>'; ?></td>
+
+                <td class="main">
+                  <?php
+                      //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3
+                    $visual_verify_code = ""; 
+                    for ($i = 1; $i <= rand(3,6); $i++){
+                          $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1);
+                     }
+                     $vvcode_oscsid = tep_session_id($HTTP_GET_VARS[tep_session_name()]);
+                     tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'");
+                     $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code);
+                     tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array);
+                     $visual_verify_code = "";
+                     echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '"');
+                  ?>
+                </td>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_BOX_IDENTIFIER; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<!--
+  VISUAL VERIFY CODE stop   -->
+      
+      
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+<?php if ($valid_product == "true") {
+?>
+             <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+
+<?php
+}
+?>                
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/tell_a_friend_article.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/tell_a_friend_article.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/tell_a_friend_article.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,185 @@
+<?php
+  echo tep_draw_form('email_friend_article', tep_href_link(FILENAME_TELL_A_FRIEND_ARTICLE, 'action=process&amp;articles_id=' . $HTTP_GET_VARS['articles_id'])); 
+?>
+  <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php 
+
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+           <td class="pageHeading"><?php echo sprintf(HEADING_TITLE, $article_info['articles_name']); ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.gif', sprintf(HEADING_TITLE, $product_info['products_name']), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = sprintf(HEADING_TITLE, $article_info['articles_name']);
+}
+// EOF: Lango Added for template MOD
+
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+  if ($messageStack->size('friend') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('friend'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></b></td>
+                <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('from_name'); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('from_email_address'); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo FORM_TITLE_FRIEND_DETAILS; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_FRIEND_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('to_name') . '&nbsp;<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_FRIEND_EMAIL; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('to_email_address') . '&nbsp;<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>'; ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+      
+      
+      <!--
+  VISUAL VERIFY CODE start -->
+      <tr>
+        <td class="main"><b><?php echo VISUAL_VERIFY_CODE_CATEGORY; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('visual_verify_code') . '&nbsp;' . '<span class="inputRequirement">' . VISUAL_VERIFY_CODE_ENTRY_TEXT . '</span>'; ?></td>
+
+                <td class="main">
+                  <?php
+                      //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3
+                    $visual_verify_code = ""; 
+                    for ($i = 1; $i <= rand(3,6); $i++){
+                          $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1);
+                     }
+                     $vvcode_oscsid = tep_session_id($HTTP_GET_VARS[tep_session_name()]);
+                     tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'");
+                     $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code);
+                     tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array);
+                     $visual_verify_code = "";
+                     echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '"');
+                  ?>
+                </td>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_BOX_IDENTIFIER; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<!--
+  VISUAL VERIFY CODE stop   -->
+      
+      
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+<?php if ($valid_article == "true") {
+?>
+             <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $HTTP_GET_VARS['articles_id']) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+
+<?php
+}
+?>                
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/upcoming_products.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/upcoming_products.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/upcoming_products.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+    <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+}else{
+$header_text = HEADING_TITLE;
+}
+?>
+
+<?php
+   // queries now in the root upcoming_products.php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+
+
+?>
+   <tr>
+        <td>
+        <?php 
+   
+  //decide which product listing to use
+   if (PRODUCT_LIST_CONTENT_LISTING == 'column'){
+  $listing_method = FILENAME_PRODUCT_LISTING_COL;
+  } else {
+  $listing_method = FILENAME_PRODUCT_LISTING;
+  }
+  //Then show product listing
+  include(DIR_WS_MODULES . $listing_method); 
+   
+?>
+        </td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+        </td>
+      </tr>
+<?php
+?>
+    </table>

Added: trunk/direct.openmoko.com/templates/content/validate_new.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/validate_new.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/validate_new.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,139 @@
+<?php
+$verifycodesent="";
+if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) 
+{
+    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);    
+  $check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_password, customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
+    if (tep_db_num_rows($check_customer_query)) 
+  {
+        $check_customer = tep_db_fetch_array($check_customer_query);
+      $pw="ABCDEFGHJKMNOPQRSTUVWXYZabcdefghjkmnopqrstuvwxyz0123456789";
+      srand((double)microtime()*1000000);
+      for ($i=1;$i<=5;$i++)
+      { 
+        $Pass .= $pw{rand(0,strlen($pw)-1)};
+      }
+     $pw1="ABCDEFGHJKMNOPQRSTUVWXYZabcdefghjkmnopqrstuvwxyz0123456789";
+     srand((double)microtime()*1000000);
+     for ($i=1;$i<=5;$i++)
+     { 
+      $Pass_neu .= $pw1{rand(0,strlen($pw1)-1)};
+     }
+
+    tep_db_query('update customers set customers_validation_code = "' . $Pass . $Pass_neu . '" where customers_id = "' .  (int)$check_customer['customers_id'] . '"');
+      tep_mail($check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'], $email_address, EMAIL_PASSWORD_REMINDER_SUBJECT, sprintf(EMAIL_PASSWORD_REMINDER_BODY, $Pass . $Pass_neu) . sprintf(EMAIL_PASSWORD_REMINDER_BODY2, '<a href="' . tep_href_link('pw.php', 'action=reg&amp;pass=' . $Pass . $Pass_neu . '&amp;id=' . (int)$check_customer['customers_id'], 'SSL', false) . '">' . tep_href_link('pw.php', 'action=reg&amp;pass=' . $Pass . $Pass_neu . '&amp;verifyid=' . (int)$check_customer['customers_id'], 'SSL', false) . '</a>'), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);  
+      $verifycodesent="success";
+  } 
+  else 
+  {
+       $messageStack->add('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND);
+  }
+}
+
+  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_VALIDATE_NEW, '', 'SSL')); 
+ 
+?>
+
+<?php if($verifycodesent != 'success'){?>
+<!-- body_text //-->
+  <?php echo tep_draw_form('password_forgotten', tep_href_link(FILENAME_VALIDATE_NEW, 'action=process', 'SSL')); ?>
+  <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+  <tr>
+  <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+  <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_login.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+    </tr>
+  
+  <?php
+  if ($messageStack->size('password_forgotten') > 0) {
+  ?>
+      <tr>
+        <td><?php echo $messageStack->output('password_forgotten'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+    
+  <?php
+    }
+  ?>
+
+  
+  <tr>
+        <td><table border="0" width="100%" height="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main" colspan="2"><?php echo TEXT_MAIN; ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+              <tr>
+                <td class="main"><?php echo '<b>' . ENTRY_EMAIL_ADDRESS . '</b> ' . tep_draw_input_field('email_address'); ?></td>
+              </tr>
+              <tr>
+                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+ 
+   <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+ 
+  </table>
+  </form>
+
+<?php }else{?>
+
+  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+  <tr>
+  <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+  <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_login.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+    </tr>
+   <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class='main'><?php echo SUCCESS_REGISTRATION_CODE_SENT.'<br><br><a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>               
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+  </table>
+<?php }?>
+
+<!-- body_text_eof //-->

Added: trunk/direct.openmoko.com/templates/content/wishlist.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/wishlist.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/wishlist.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,238 @@
+<!-- wishlist.tpl.php //start -->
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+  $header_text = '&nbsp;'
+  //EOF: Lango Added for template MOD
+  ?>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_wishlist.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+        </tr>
+      </table></td>
+  </tr>
+  <?php
+  // BOF: Lango Added for template MOD
+}else{
+  $header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+?>
+  <tr>
+    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+      <?php
+      // BOF: Lango Added for template MOD
+      if (MAIN_TABLE_BORDER == 'yes'){
+        table_image_border_top(false, false, $header_text);
+      }
+      // EOF: Lango Added for template MOD
+      ?> 
+      <td width="100%" valign="top" align="center"><table border="0" width="100%" cellspacing="0" cellpadding="0">   
+        <!-- wishlist content //start -->
+        <?php
+        $wishlist_sql = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 order by products_name";      
+        $wishlist_split = new splitPageResults($wishlist_sql, MAX_DISPLAY_WISHLIST_PRODUCTS);
+        $wishlist_query = tep_db_query($wishlist_split->sql_query);
+
+        $info_box_contents = array();
+        if (tep_db_num_rows($wishlist_query)) {
+          $product_ids = '';
+          while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+            $product_ids .= $wishlist['products_id'] . ',';
+          }
+          $product_ids = substr($product_ids, 0, -1);
+        
+          $products_query = tep_db_query("select pd.products_id, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+           
+          if ( ($wishlist_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
+          ?>
+            <tr>
+              <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+                <tr>
+                  <td class="smallText"><?php echo $wishlist_split->display_count(TEXT_DISPLAY_NUMBER_OF_WISHLIST); ?></td>
+                  <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $wishlist_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+                </tr>
+                <tr>
+                  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+                </tr>
+              </table></td>
+            </tr>
+          <?php
+          }
+          ?>  
+          <tr>
+            <td colspan="4">
+              <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                <tr>
+                  <td colspan="4"width="100%" valign="top">
+                    <?php // echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_WISHLIST)) . tep_draw_hidden_field('wishlist_action', 'add_delete_products_wishlist'); 
+                    echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_del_products_wishlist')); ?>
+                  </td>
+                </tr>
+              <tr>
+                  <?php
+                  $col = 0;
+                  while ($products = tep_db_fetch_array($products_query)) {
+                    $col++;
+                    ?>
+                    <td><table class="linkListing" width="100%" border="0" cellspacing="0" cellpadding="6">
+                      <tr>
+                        <td width="20%" valign="top" align="center" class="smallText">
+                          <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&amp;products_id=' . $products['products_id'], 'NONSSL'); ?>"><?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?></a>
+                        </td>
+                        <td valign="top" align="left" class="smallText">
+                          <b><a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&amp;products_id=' . $products['products_id'], 'NONSSL'); ?>"><?php echo $products['products_name']; ?></a></b>
+                          <?php
+                          // Begin Wish List Code w/Attributes
+                          $attributes_addon_price = 0;
+                          
+                          // Now get and populate product attributes
+                          if ($customer_id > 0) {
+                            $wishlist_products_attributes_query = tep_db_query("select products_options_id as po, products_options_value_id as pov from " . TABLE_WISHLIST_ATTRIBUTES . " where customers_id='" . $customer_id . "' and products_id = '" . $products['products_id'] . "'");
+                            while ($wishlist_products_attributes = tep_db_fetch_array($wishlist_products_attributes_query)) {
+                              // We now populate $id[] hidden form field with product attributes
+                              echo tep_draw_hidden_field('id['.$products['products_id'].']['.$wishlist_products_attributes['po'].']', $wishlist_products_attributes['pov']);
+                              // And Output the appropriate attribute name
+                              $attributes = tep_db_query("select poptt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
+                                from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_TEXT . " poptt,  " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
+                                where pa.products_id = '" . $products['products_id'] . "'
+                                and pa.options_id = '" . $wishlist_products_attributes['po'] . "'
+                                and pa.options_id = popt.products_options_id
+                                and pa.options_values_id = '" . $wishlist_products_attributes['pov'] . "'
+                                and pa.options_values_id = poval.products_options_values_id
+                                and poptt.products_options_text_id = popt.products_options_id
+                                and poptt.language_id = '" . $languages_id . "'
+                                and poval.language_id = '" . $languages_id . "'");
+                              $attributes_values = tep_db_fetch_array($attributes);
+                              if ($attributes_values['price_prefix'] == '+')
+                                 { $attributes_addon_price += $attributes_values['options_values_price']; }
+                              else if ($attributes_values['price_prefix'] == '-')
+                                 { $attributes_addon_price -= $attributes_values['options_values_price']; }
+                                 echo '<br><small><i>' . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'] . '</i></small>';
+                            } // end while attributes for product
+                               
+                            if ($new_price = tep_get_products_special_price($products['products_id'])) {
+                              $products_price = '<s>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</span>';
+                            } else {
+                              $products_price = $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id']));
+                            }
+                          } 
+                          echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5').'<br>';
+                          echo BOX_TEXT_PRICE . '&nbsp;' . $products_price. '<br>';
+                          // End Wish List Code w/Attributes
+                          ?>
+                          <br>
+                          <!-- move/delete checkboxes_start -->
+                          <table class="productListing" border="0" width="96%" cellspacing="0" cellpadding="0">
+                            <tr>
+                              <td align="left">
+                                <table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">          
+                                  <tr>
+                                    <td class="main" align="right" width="110"><font color="BD1415"><b><?php echo BOX_TEXT_MOVE_TO_CART ?></b></font>&nbsp;&nbsp;</td>
+                                    <td class="main" align="left"><?php echo  tep_draw_checkbox_field('add_wishprod[]',$products['products_id']); ?></td>
+                                    <td class="main" align="right"><?php echo BOX_TEXT_DELETE; ?>&nbsp;&nbsp;</td>
+                                    <td class="main" align="left"><?php echo tep_draw_checkbox_field('del_wishprod[]',$products['products_id']); ?></td>
+                                  </tr>
+                                </table>
+                              </td>
+                            </tr>
+                          </table>
+                          <?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5'); ?>
+                        </td> 
+                      </tr>
+                    </table></td>
+                    <!-- move/delete checkboxes_end -->
+                    <?php
+                      if ( ($col / 1) == floor($col / 1) ) {
+                      // if ((($col / MAX_DISPLAY_WISHLIST_COLS) == floor($col / MAX_DISPLAY_WISHLIST_COLS))) {
+                      ?>
+                        </tr>
+                        <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>
+                        <tr>
+                      <?php
+                      }
+                  } //end while
+                  ?>
+                </tr>
+                <tr>
+                  <td colspan="4"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
+                </tr>
+              </table>
+             </td>
+          </tr>
+          <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>
+          <tr>
+            <td class="main" colspan="2">
+              <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td class="main" width="33%" align="left"><a href="<?php echo tep_href_link(FILENAME_DEFAULT); ?>"><?php echo tep_template_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING); ?></a></td>
+                  <td class="main" width="33%" align="center"><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><?php echo tep_template_image_button('button_view_cart.gif', IMAGE_BUTTON_IN_CART); ?></a></td>
+                  <td class="main" width="33%" align="right"><?php echo tep_template_image_submit('button_update.gif', IMAGE_BUTTON_UPDATE); ?></td>
+                </tr>
+              </table>
+            </form></td>
+          </tr>
+          <tr>
+            <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+           <tr>
+            <td colspan="4">
+              <!-- tell_a_friend //-->
+              <?php
+              $info_box_contents = array();
+              $info_box_contents[] = array('text' => BOX_HEADING_SEND_WISHLIST);
+               
+              new infoBoxHeading($info_box_contents, false, false);
+                
+              $info_box_contents = array();
+              $info_box_contents[] = array('form' => tep_draw_form('tell_a_friend', tep_href_link(FILENAME_WISHLIST_SEND, '', 'NONSSL', false), 'get'),
+                                                        'align' => 'center',
+                                                        'text' => tep_draw_input_field('send_to', '', 'size="20"') . '&nbsp;' . tep_template_image_submit('button_tell_a_friend.gif', BOX_TEXT_SEND) . tep_draw_hidden_field('products_ids', $HTTP_GET_VARS['products_ids']) . tep_hide_session_id() . '<br>' . BOX_TEXT_SEND);
+              new infoBox($info_box_contents);
+              ?>
+              <!-- tell_a_friend_eof //-->
+              <?php
+              if ( ($wishlist_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
+              ?>
+              <table border="0" width="100%" cellspacing="0" cellpadding="2">
+                <tr>
+                  <td class="smallText"><?php echo $wishlist_split->display_count(TEXT_DISPLAY_NUMBER_OF_WISHLIST); ?></td>
+                  <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $wishlist_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
+                </tr>
+              </table></td>
+              </tr>
+              <?php
+              }
+            
+            } else { // Nothing in the customers wishlist
+            ?>
+              <tr>
+                <td>
+                  <table border="0" width="100%" cellspacing="0" cellpadding="0">
+                     <tr>
+                        <td class="main"><?php echo BOX_TEXT_NO_ITEMS;?></td>
+                     </tr>
+                   </table>
+            <?php
+             }
+            ?>
+            <!-- customer_wishlist_eof //-->
+            </td>
+        </tr>
+      </table></td>
+      <?php
+      // BOF: Lango Added for template MOD
+      if (MAIN_TABLE_BORDER == 'yes'){
+        table_image_border_bottom();
+      }
+      // EOF: Lango Added for template MOD
+      ?>
+    </table></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+</table>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/content/wishlist_email.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/wishlist_email.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/wishlist_email.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,196 @@
+<?php
+         echo tep_draw_form('email_wish', tep_href_link(FILENAME_WISHLIST_SEND, 'action=process&products_id=' . $HTTP_GET_VARS['products_id'])) . tep_draw_hidden_field('products_name', $product_info['products_name']);
+?>
+
+  <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php 
+
+// BOF: Lango Added for template MOD
+if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+$header_text = '&nbsp;'
+//EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
+          <tr>
+            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+            <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+}else{
+$header_text = HEADING_TITLE;
+}
+// EOF: Lango Added for template MOD
+
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, $header_text);
+}
+// EOF: Lango Added for template MOD
+  if ($messageStack->size('friend') > 0) {
+?>
+      <tr>
+        <td><?php echo $messageStack->output('friend'); ?></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<?php
+  }
+?>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+          <tr>
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main"><b><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></b></td>
+                <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
+                    <td class="main"><?php echo $from_name . tep_draw_hidden_field('from_name', $from_name); ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
+                    <td class="main"><?php echo $from_email_address . tep_draw_hidden_field('from_email_address', $from_email_address); ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo FORM_TITLE_FRIEND_DETAILS; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><table border="0" cellspacing="0" cellpadding="2">
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_FRIEND_NAME; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('to_name') . '&nbsp;<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>'; ?></td>
+                  </tr>
+                  <tr>
+                    <td class="main"><?php echo FORM_FIELD_FRIEND_EMAIL; ?></td>
+                    <td class="main"><?php echo tep_draw_input_field('to_email_address') . '&nbsp;<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>'; ?></td>
+                  </tr>
+                </table></td>
+              </tr>
+            </table></td>
+          </tr>
+      
+      
+      <!--
+  VISUAL VERIFY CODE start -->
+      <tr>
+        <td class="main"><b><?php echo VISUAL_VERIFY_CODE_CATEGORY; ?></b></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" cellspacing="2" cellpadding="2">
+              <tr>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?></td>
+                <td class="main"><?php echo tep_draw_input_field('visual_verify_code') . '&nbsp;' . '<span class="inputRequirement">' . VISUAL_VERIFY_CODE_ENTRY_TEXT . '</span>'; ?></td>
+
+                <td class="main">
+                  <?php
+                      //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3
+                    $visual_verify_code = ""; 
+                    for ($i = 1; $i <= rand(3,6); $i++){
+                          $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1);
+                     }
+                     $vvcode_oscsid = tep_session_id($HTTP_GET_VARS[tep_session_name()]);
+                     tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'");
+                     $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code);
+                     tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array);
+                     $visual_verify_code = "";
+                     echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '"');
+                  ?>
+                </td>
+                <td class="main"><?php echo VISUAL_VERIFY_CODE_BOX_IDENTIFIER; ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+<!--
+  VISUAL VERIFY CODE stop   -->
+      
+          <tr>
+            <td class="main"><b><?php echo FORM_FIELD_PRODUCTS; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><?php echo $wishliststring ; ?></td>
+              </tr>
+            </table></td>
+          </tr>     
+      
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+          <tr>
+            <td class="main"><b><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></b></td>
+          </tr>
+          <tr>
+            <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+              <tr class="infoBoxContents">
+                <td><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <tr>
+        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+          <tr class="infoBoxContents">
+            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+<?php if ($valid_product == "true") {
+?>
+             <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_template_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
+
+<?php
+}
+?>                
+                <td align="right"><?php echo tep_template_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+          </tr>
+        </table></td>
+      </tr>
+    </table></form>

Added: trunk/direct.openmoko.com/templates/content/wpcallback.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/content/wpcallback.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/content/wpcallback.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,148 @@
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
+<?php
+if (isset($HTTP_POST_VARS['transStatus']) && $HTTP_POST_VARS['transStatus'] == "Y") {  // Success 
+  $url = tep_href_link(FILENAME_CHECKOUT_PROCESS, $HTTP_POST_VARS['cartId'], 'SSL');
+  echo "<meta http-equiv='Refresh' content='2; Url=\"$url\"'>";
+  if (SHOW_HEADING_TITLE_ORIGINAL == 'yes') {
+    $header_text = '&nbsp;';
+    ?>
+    <tr>
+      <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+          <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_payment.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
+        </tr>
+      </table></td>
+    </tr>
+    <tr>
+      <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+    </tr>
+    <?php
+  } else {
+    $header_text = HEADING_TITLE;
+  }
+  if (MAIN_TABLE_BORDER == 'yes') {
+ //   table_image_border_top(false, false, $header_text);
+  }
+  ?>
+  <tr>
+    <td class="pageHeading" width="100%" colspan="2" align="center"><?php echo WP_TEXT_SUCCESS; ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '50'); ?></td>
+  </tr>
+  <tr>
+    <td align="center" colspan="2">
+      <table border="2" bordercolor="#FF0000" width="80%" cellspacing="0" cellpadding="2">
+        <tr>
+          <td class="main" align="center"><p><?php echo WP_TEXT_HEADING; ?></p><p><?php echo '<WPDISPLAY ITEM=banner>'; ?></p></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '50'); ?></td>
+  </tr>
+  <tr>
+    <td class="pageHeading" width="100%" colspan="2" align="center"><h3><?php echo WP_TEXT_SUCCESS_WAIT; ?></h3></td>
+  </tr>
+  <tr align="right">
+    <td><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '50'); ?></td>
+  </tr>
+  <?php // Failure
+} else {
+  $url = tep_href_link(FILENAME_CHECKOUT_PAYMENT, $$HTTP_POST_VARS['cartId'], 'SSL');
+  echo "<meta http-equiv='Refresh' content='2; Url=\"$url\"'>";
+  ?>
+  <tr>
+    <td class="pageHeading" width="100%" colspan="2" align="center"><?php echo WP_TEXT_FAILURE; ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '50'); ?></td>
+  </tr>
+  <tr>
+    <td align="center" colspan="2">
+      <table border="2" bordercolor="#FF0000" width="80%" cellspacing="0" cellpadding="2">
+        <tr>
+          <td class="main" align="center"><p><?php echo WP_TEXT_HEADING; ?></p><p><?php echo '<WPDISPLAY ITEM=banner>'; ?></p></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <?php
+  if (MAIN_TABLE_BORDER == 'yes') {
+//    table_image_border_bottom();
+  }
+  ?>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr>
+    <td>
+      <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+        <tr class="infoBoxContents">
+          <td>
+            <table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
+                <td><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', false) . '">' . tep_template_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <tr>
+    <td>
+      <table border="0" width="100%" cellspacing="0" cellpadding="0">
+        <tr>
+          <td width="25%">
+            <table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table>
+          </td>
+          <td width="25%">
+            <table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+              </tr>
+            </table>
+          </td>
+          <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+          <td width="25%">
+            <table border="0" width="100%" cellspacing="0" cellpadding="0">
+              <tr>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+                <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+        <tr>
+          <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
+          <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
+          <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+          <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  <?php
+}
+?>
+</table>

Added: trunk/direct.openmoko.com/templates/default/boxes/affiliate.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/affiliate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/affiliate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: affiliate.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $
+  OSC-Affiliate
+  Contribution based on:
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2002 - 2003 osCommerce
+   
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>          
+<!-- d_affiliate_system //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_AFFILIATE . '</font>');
+
+  new infoBoxHeading($info_box_contents);
+
+  if (tep_session_is_registered('affiliate_id')) {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . BOX_AFFILIATE_SUMMARY . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL'). '">' . BOX_AFFILIATE_ACCOUNT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'). '">' . BOX_AFFILIATE_PAYMENT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'). '">' . BOX_AFFILIATE_CLICKRATE . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'). '">' . BOX_AFFILIATE_SALES . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS). '">' . BOX_AFFILIATE_BANNERS . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT). '">' . BOX_AFFILIATE_CONTACT . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_FAQ). '">' . BOX_AFFILIATE_FAQ . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE_LOGOUT). '">' . BOX_AFFILIATE_LOGOUT . '</a>');
+  } else {
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE_INFO). '">' . BOX_AFFILIATE_INFO . '</a><br>' .
+                                           '<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . BOX_AFFILIATE_LOGIN . '</a>');
+  }
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!-- affiliate_system_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/boxes/articles.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,227 @@
+<?php
+/*
+  $Id: articles.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_topic($counter) {
+    global $tree, $topics_string, $tPath_array;
+
+    for ($i=0; $i<$tree[$counter]['level']; $i++) {
+      $topics_string .= "&nbsp;&nbsp;";
+    }
+
+    $topics_string .= '<a href="';
+
+    if ($tree[$counter]['parent'] == 0) {
+      $tPath_new = 'tPath=' . $counter;
+    } else {
+      $tPath_new = 'tPath=' . $tree[$counter]['path'];
+    }
+
+    $topics_string .= tep_href_link(FILENAME_ARTICLES, $tPath_new) . '">';
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '<b>';
+    }
+
+// display topic name
+    $topics_string .= $tree[$counter]['name'];
+
+    if (isset($tPath_array) && in_array($counter, $tPath_array)) {
+      $topics_string .= '</b>';
+    }
+
+    if (tep_has_topic_subtopics($counter)) {
+      $topics_string .= ' -&gt;';
+    }
+
+    $topics_string .= '</a>';
+
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_in_topic = tep_count_articles_in_topic($counter);
+      if ($articles_in_topic > 0) {
+        $topics_string .= '&nbsp;(' . $articles_in_topic . ')';
+      }
+    }
+
+    $topics_string .= '<br>';
+
+    if ($tree[$counter]['next_id'] != false) {
+      tep_show_topic($tree[$counter]['next_id']);
+    }
+  }
+?>
+<!-- d-Articles //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_ARTICLES . '</font>');
+
+  new infoBoxHeading($info_box_contents);
+
+  $topics_string = '';
+  $tree = array();
+
+  $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '0' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+  while ($topics = tep_db_fetch_array($topics_query))  {
+    $tree[$topics['topics_id']] = array('name' => $topics['topics_name'],
+                                        'parent' => $topics['parent_id'],
+                                        'level' => 0,
+                                        'path' => $topics['topics_id'],
+                                        'next_id' => false);
+
+    if (isset($parent_id)) {
+      $tree[$parent_id]['next_id'] = $topics['topics_id'];
+    }
+
+    $parent_id = $topics['topics_id'];
+
+    if (!isset($first_topic_element)) {
+      $first_topic_element = $topics['topics_id'];
+    }
+  }
+
+  //------------------------
+  if (tep_not_null($tPath)) {
+    $new_path = '';
+    reset($tPath_array);
+    while (list($key, $value) = each($tPath_array)) {
+      unset($parent_id);
+      unset($first_id);
+      $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td where t.parent_id = '" . (int)$value . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
+      if (tep_db_num_rows($topics_query)) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($topics_query)) {
+          $tree[$row['topics_id']] = array('name' => $row['topics_name'],
+                                           'parent' => $row['parent_id'],
+                                           'level' => $key+1,
+                                           'path' => $new_path . '_' . $row['topics_id'],
+                                           'next_id' => false);
+
+          if (isset($parent_id)) {
+            $tree[$parent_id]['next_id'] = $row['topics_id'];
+          }
+
+          $parent_id = $row['topics_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['topics_id'];
+          }
+
+          $last_id = $row['topics_id'];
+        }
+        $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
+        $tree[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_topic($first_topic_element);
+
+  $info_box_contents = array();
+  $new_articles_string = '';
+  $all_articles_string = '';
+
+  if (DISPLAY_NEW_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_new_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and(a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = ad.articles_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a2t.topics_id = td.topics_id 
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'
+                                            and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY)");
+      $articles_new_count = ' (' . tep_db_num_rows($articles_new_query) . ')';
+    } else {
+      $articles_new_count = '';
+    }
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string = '<b>';
+    }
+
+    $new_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES_NEW, '', 'NONSSL') . '">' . BOX_NEW_ARTICLES . '</a>';
+
+    if (strstr($_SERVER['PHP_SELF'], CONTENT_ARTICLES_NEW . '.php') or strstr($PHP_SELF,FILENAME_ARTICLES_NEW)) {
+      $new_articles_string .= '</b>';
+    }
+
+    $new_articles_string .= $articles_new_count . '<br>';
+
+  }
+
+  if (DISPLAY_ALL_ARTICLES=='true') {
+    if (SHOW_ARTICLE_COUNTS == 'true') {
+      $articles_all_query = tep_db_query("select a.articles_id
+                                          from " . TABLE_ARTICLES . " a,
+                                               " . TABLE_AUTHORS . " au,
+                                               " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                                               " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                                               " . TABLE_TOPICS_DESCRIPTION . " td
+                                          where a.articles_status = '1'
+                                            and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                                            and a.authors_id = au.authors_id
+                                            and a.articles_id = a2t.articles_id
+                                            and a.articles_id = ad.articles_id
+                                            and a2t.topics_id = td.topics_id
+                                            and ad.language_id = '" . (int)$languages_id . "'
+                                            and td.language_id = '" . (int)$languages_id . "'");
+      $articles_all_count = ' (' . tep_db_num_rows($articles_all_query) . ')';
+    } else {
+      $articles_all_count = '';
+    }
+
+    if ($topic_depth == 'top') {
+      $all_articles_string = '<b>';
+    }
+
+    $all_articles_string .= '<a href="' . tep_href_link(FILENAME_ARTICLES, '', 'NONSSL') . '">' . BOX_ALL_ARTICLES . '</a>';
+
+    if ($topic_depth == 'top') {
+      $all_articles_string .= '</b>';
+    }
+
+    $all_articles_string .= $articles_all_count . '<br>';
+
+  }
+
+  $info_box_contents[] = array('text' => $new_articles_string . $all_articles_string . $topics_string);
+
+  new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!-- d-articles_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/asearch.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/asearch.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/asearch.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: asearch.php
+  searches articles using article_manager
+  by AlDaffodil (aldaffodil at hotmail.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- article search //-->
+          <tr>
+            <td>
+<?php
+ //if (ALLOW_QUICK_SEARCH_DESCRIPTION == 'true') {
+  //  $param = '<input type="hidden" name="search_in_description" value="1">';
+ //  } else {
+      $param = '';
+// }
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_ASEARCH . '</font>');
+     new infoBoxHeading($info_box_contents);
+
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find_article" method="get" action="' . tep_href_link(FILENAME_ARTICLE_SEARCH, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . $param . '<input type="text" name="akeywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["akeywords"])) . '">' . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><input type="checkbox" name="description">' . BOX_ASEARCH_TEXT . '<br>');
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!-- article_search //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/authors.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/authors.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/authors.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,78 @@
+<?php
+/*
+  $Id: authors.php, v1.0 2003/12/04 12:00:00 ra Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  $authors_query = tep_db_query("select authors_id, authors_name from " . TABLE_AUTHORS . " order by authors_name");
+  if ($number_of_author_rows = tep_db_num_rows($authors_query)) {
+?>
+<!-- authors //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' =>'<font color="' . $font_color . '">' . BOX_HEADING_AUTHORS . '</font>');
+
+    new infoBoxHeading($info_box_contents);
+
+    if ($number_of_author_rows <= MAX_DISPLAY_AUTHORS_IN_A_LIST) {
+// Display a list
+      $authors_list = '';
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        if (isset($HTTP_GET_VARS['authors_id']) && ($HTTP_GET_VARS['authors_id'] == $authors['authors_id'])) $authors_name = '<b>' . $authors_name .'</b>';
+        $authors_list .= '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $authors['authors_id']) . '">' . $authors_name . '</a><br>';
+      }
+
+      $authors_list = substr($authors_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $authors_list);
+    } else {
+// Display a drop-down
+      $authors_array = array();
+      if (MAX_AUTHORS_LIST < 2) {
+        $authors_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($authors = tep_db_fetch_array($authors_query)) {
+        $authors_name = ((strlen($authors['authors_name']) > MAX_DISPLAY_AUTHOR_NAME_LEN) ? substr($authors['authors_name'], 0, MAX_DISPLAY_AUTHOR_NAME_LEN) . '..' : $authors['authors_name']);
+        $authors_array[] = array('id' => $authors['authors_id'],
+                                       'text' => $authors_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('authors', tep_href_link(FILENAME_ARTICLES, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('authors_id', $authors_array, (isset($HTTP_GET_VARS['authors_id']) ? $HTTP_GET_VARS['authors_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_AUTHORS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!-- authors_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/best_sellers.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/best_sellers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/best_sellers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,62 @@
+<?php
+/*
+  $Id: best_sellers.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($current_category_id) && ($current_category_id > 0)) {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  } else {
+    $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
+  }
+
+  if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
+?>
+<!-- best_sellers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_BESTSELLERS . '</font>');
+    new infoBoxHeading($info_box_contents);
+
+    $rows = 0;
+    $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
+      $rows++;
+      $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
+    }
+    $bestsellers_list .= '</table>';
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => $bestsellers_list);
+
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D best_sellers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/boxad.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/boxad.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/boxad.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: boxad.php, v 1.1 2002/03/21 by aubrey at mycon.co.za
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+*/
+?>
+<!-- D banner-ad-in-a-box //-->
+<?php
+  if ($banner = tep_banner_exists('dynamic', BOX_AD_BANNER_TYPE)) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<?php
+  }
+?>
+<!-- D banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/calendar.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/calendar.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/calendar.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+$ID
+  ~ events_calendar v2.00 2003/06/16 18:09:20 ip chilipepper.it 
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+  Copyright (c) 2003 osCommerce
+  Released under the GNU General Public License
+
+   CRE Loaded , Open Source E-Commerce Solutions
+   http://www.creloaded.com
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+*/
+
+
+?>
+<!-- D events_calendar //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CALENDER . '</font>');
+    new infoBoxHeading($info_box_contents,tep_href_link(FILENAME_EVENTS_CALENDER));
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'center',
+                                'text' => '<iframe name="calendar" id="calendar" align="center" marginwidth="0" marginheight="0" ' .
+                                          'src='  . FILENAME_EVENTS_CALENDAR_CONTENT . '?_month=' . $_month .'&amp;_year='. $_year .' frameborder=0 height=220 width=162 scrolling=no> ' .IFRAME_ERROR.'</iframe> ');
+   
+ 
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+
+?>
+            </td>
+          </tr>
+<!-- D events_calendar //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/card1.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/card1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/card1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+*/
+?>
+<!-- d Card Info Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CARD1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+//                               'text'  => tep_image(DIR_WS_IMAGES . '/cards/cards.gif') .
+//elari chanegd to provide a link to your payment acount
+                               'text'  => tep_image(DIR_WS_IMAGES . 'cards/logo-xclick_paypal.gif' , BOX_INFORMATION_CARD).
+                               '<br>' . tep_image(DIR_WS_IMAGES . 'cards/cards2.gif', BOX_INFORMATION_CARD) . '<br>'
+                               );
+
+new infoBox($info_box_contents);
+ if (TEMPLATE_INCLUDE_FOOTER =='true'){
+     $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+ new infoboxFooter($info_box_contents, '' );
+ }
+?>
+</td></tr>
+<!-- d card_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,171 @@
+<?php
+/*
+  $Id: categories.php,v 1.1.1.1 2004/03/04 23:42:13 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+$count=0;
+
+ function tep_show_category($counter,$count) {
+    global $foo, $categories_string, $id;
+
+$count++;
+    if ($count != 1) {
+$image=2;
+$HEIGHT = 20;
+     }else{
+$image=1;
+$HEIGHT = 21;
+}
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+
+$categories_string .= '<tr><td ';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+    $categories_string .= 'width="100%"  height="' .$HEIGHT . '" style= "background-image: url(' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/r' .$image.'.gif); padding-left:39px; padding-right:5px;">';
+    $categories_string .= '<a class="navBlue" href="';
+
+}else{
+    $categories_string .= 'width="100%"  height="' .$HEIGHT . '" style= "background-image: url(' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/q' .$image.'.gif); padding-left:39px; padding-right:5px;">';
+
+  if ($foo[$counter]['parent'] != 0) {
+       $class="subnavBlue";
+     } else {
+    $class="navGrey";
+}
+    $categories_string .= '<a class="' . $class . '" href="';
+
+}
+
+    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string .= '">';
+// display category name
+      $categories_string .= $foo[$counter]['name'];
+    $categories_string .= '</a>';
+    
+    
+ //   $categories_string .= '</td></tr>';
+
+
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category($foo[$counter]['next_id'],$count);
+    }
+
+  }
+?>
+<!-- D categories //-->
+
+<tr>
+ <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => '<font color="' . $font_color . '">' .BOX_HEADING_CATEGORIES . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+$categories_string = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      $new_path .= $value;
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      while ($row = tep_db_fetch_array($categories_query)) {
+        $foo[$row['categories_id']] = array(
+                                            'name' => $row['categories_name'],
+                                            'parent' => $row['parent_id'],
+                                            'level' => $key+1,
+                                            'path' => $new_path . '_' . $row['categories_id'],
+                                            'next_id' => false
+                                           );
+
+        if (isset($prev_id)) {
+          $foo[$prev_id]['next_id'] = $row['categories_id'];
+        }
+
+        $prev_id = $row['categories_id'];
+
+        if (!isset($first_id)) {
+          $first_id = $row['categories_id'];
+        }
+
+        $last_id = $row['categories_id'];
+      }
+      if ($category_check != 0) {
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+      }
+
+      $new_path .= '_';
+    }
+  }
+
+  tep_show_category($first_element,$count);
+
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text'  => $categories_string
+                              );
+new infobox($info_box_contents);
+
+ if (TEMPLATE_INCLUDE_FOOTER =='true'){
+     $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+ new infoboxFooter($info_box_contents);
+ }
+
+?>
+                    </td>
+                  </tr>
+ <!-- D categories_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/categories1.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/categories1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/categories1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,47 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- D categories1 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES1 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => '<form action="' . tep_href_link(FILENAME_DEFAULT) . '" method="get">' . tep_hide_session_id(),
+                               'align' => 'left',
+                               'text'  => tep_draw_pull_down_menu('cPath', tep_get_categories(array(array('id' => '', 'text' => PULL_DOWN_DEFAULT))), $cPath, 'onchange="this.form.submit();"')
+                              );
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!-- D categories_eof 1 //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/categories2.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/categories2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/categories2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,179 @@
+<?php
+/*
+  $Id: categories2.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+//###############################################
+if ( (USE_CACHE == 'true') && !defined('SID')) {
+    echo tep_cache_categories_box();
+  } else {
+//###############################################
+
+
+  function tep_show_category2($counter) {
+    global $foo, $categories_string2, $id;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      $categories_string2 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string2 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string2 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string2 .= '">';
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '<b>';
+    }
+
+// display category name
+    $categories_string2 .= $foo[$counter]['name'];
+
+    if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string2 .= '</b>';
+    }
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string2 .= '-&gt;';
+    }
+
+    $categories_string2 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string2 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string2 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category2($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- D categories 2 //-->
+          <tr>
+            <td>
+<?php
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                  'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES2 . '</font>');
+    new infoBoxHeading($info_box_contents);
+
+
+  $categories_string2 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+  tep_show_category2($first_element);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string2
+                              );
+  new infoBox($info_box_contents);
+
+ if (TEMPLATE_INCLUDE_FOOTER =='true'){
+     $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+ new infoboxFooter($info_box_contents);
+ }
+
+?>
+            </td>
+          </tr>
+<!--############################################### //-->
+<?php
+}
+?>
+<!--############################################## //-->
+<!-- D categories2_eof //-->
+

Added: trunk/direct.openmoko.com/templates/default/boxes/categories3.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/categories3.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/categories3.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,133 @@
+<?php
+/*
+  $Id: categories3.php,v 1.1 2004/04/05
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004osCommerce
+
+  Released under the GNU General Public License
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+*/
+
+// Categories_tree written by Gideon Romm from Symbio Technologies, LLC
+
+function tep_show_category3($cid, $cpath, $COLLAPSABLE) {
+  global $categories_string3, $languages_id, $HTTP_GET_VARS;
+  global $level;
+  $selectedPath = array();
+
+// Get all of the categories on this level
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    if ($level{$categories['parent_id']} == "") { $level{$categories['parent_id']} = 0; }
+    $level{$categories['categories_id']} = $level{$categories['parent_id']} + 1;
+
+// Add category link to $categories_string3
+    for ($a=1; $a<$level{$categories['categories_id']}; $a++) {
+      $categories_string3 .= "&nbsp;&nbsp;";
+    }
+
+    $categories_string3 .= '<a href="';
+
+    $cPath_new = $cpath;
+    if ($level{$categories['parent_id']} > 0) {
+      $cPath_new .= "_";
+    }
+    $cPath_new .= $categories['categories_id'];
+
+    $cPath_new_text = "cPath=" . $cPath_new;
+
+    $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
+    $categories_string3 .= '">';
+
+    if ($HTTP_GET_VARS['cPath']) {
+      $selectedPath = split("_", $HTTP_GET_VARS['cPath']);
+    }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '<b>'; }
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '<u>'; }
+
+    $categories_string3 .= $categories['categories_name'];
+    if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string3 .= ' ->'; }
+
+
+    if ($level{$categories['categories_id']} == 1) { $categories_string3 .= '</u>'; }
+
+    if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '</b>'; }
+
+    $categories_string3 .= '</a>';
+
+    if (SHOW_COUNTS) {
+      $products_in_category = tep_count_products_in_category($categories['categories_id']);
+      if ($products_in_category > 0) {
+        $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
+      }
+    }
+
+    $categories_string3 .= '<br>';
+
+
+// If I have subcategories, get them and show them
+    if (tep_has_category_subcategories($categories['categories_id'])) {
+
+      if ($COLLAPSABLE) {
+        if (in_array($categories['categories_id'], $selectedPath)) {
+          tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE);
+        }
+      }
+      else { tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE); }
+
+    }
+
+  }
+
+}
+?>
+
+
+<!--D categories 3 //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES3 . '</font>'
+                              );
+  new infoBoxHeading($info_box_contents);
+
+  $categories_string3 = '';
+
+// tep_show_category3(<top category_id>, <top cpath>, <1=Collapsable tree, 0=static--show all>)
+  tep_show_category3(0,'',0);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => $categories_string3
+                              );
+  new infoBox($info_box_contents);
+  if (TEMPLATE_INCLUDE_FOOTER =='true'){
+     $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+ new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D categories_eof 3 //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/categories4.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/categories4.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/categories4.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,195 @@
+<?php
+/*
+  $Id: categories4.php,v 1.0
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  function tep_show_category4($counter) {
+    global $foo, $categories_string4, $id, $aa;
+
+    for ($a=0; $a<$foo[$counter]['level']; $a++) {
+      if ($a == $foo[$counter]['level']-1)
+      {
+    $categories_string4 .= "<font color='#ff0000'>|__</font>";
+      } else
+        {
+        $categories_string4 .= "<b><font color='#ff0000'>&nbsp;&nbsp;&nbsp;&nbsp;</font></b>";
+        }
+
+    }
+    if ($foo[$counter]['level'] == 0)
+  {
+    if ($aa == 1)
+    {
+    $categories_string4 .= "<hr>";
+      }
+    else
+    {$aa=1;}
+
+  }
+
+
+    $categories_string4 .= '<a href="';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $cPath_new = 'cPath=' . $counter;
+    } else {
+      $cPath_new = 'cPath=' . $foo[$counter]['path'];
+    }
+
+    $categories_string4 .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
+    $categories_string4 .= '">';
+
+    if ($foo[$counter]['parent'] == 0) {
+      $categories_string4 .= '<b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= "<b><font color='#ff0000'>";
+    }
+
+// display category name
+    $categories_string4 .= $foo[$counter]['name'];
+
+      if ($foo[$counter]['parent'] == 0) {
+       $categories_string4 .= '</b>';
+    } else if ( ($id) && (in_array($counter, $id)) ) {
+      $categories_string4 .= '</font></b>';
+    }
+
+
+    if (tep_has_category_subcategories($counter)) {
+      $categories_string4 .= '<b>-&gt; </b>';
+    }
+
+    $categories_string4 .= '</a>';
+
+    if (SHOW_COUNTS == 'true') {
+      $products_in_category = tep_count_products_in_category($counter);
+      if ($products_in_category > 0) {
+        $categories_string4 .= '&nbsp;(' . $products_in_category . ')';
+      }    }
+
+    $categories_string4 .= '<br>';
+
+    if ($foo[$counter]['next_id']) {
+      tep_show_category4($foo[$counter]['next_id']);
+    }
+  }
+?>
+<!-- D categories 4//-->
+          <tr>
+            <td>
+<?php
+  $aa = 0;
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CATEGORIES4 . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+  $categories_string4 = '';
+
+  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+  while ($categories = tep_db_fetch_array($categories_query))  {
+    $foo[$categories['categories_id']] = array(
+                                        'name' => $categories['categories_name'],
+                                        'parent' => $categories['parent_id'],
+                                        'level' => 0,
+                                        'path' => $categories['categories_id'],
+                                        'next_id' => false
+                                       );
+
+    if (isset($prev_id)) {
+      $foo[$prev_id]['next_id'] = $categories['categories_id'];
+    }
+
+    $prev_id = $categories['categories_id'];
+
+    if (!isset($first_element)) {
+      $first_element = $categories['categories_id'];
+    }
+  }
+
+  //------------------------
+  if ($cPath) {
+    $new_path = '';
+    $id = split('_', $cPath);
+    reset($id);
+    while (list($key, $value) = each($id)) {
+      unset($prev_id);
+      unset($first_id);
+      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
+      $category_check = tep_db_num_rows($categories_query);
+      if ($category_check > 0) {
+        $new_path .= $value;
+        while ($row = tep_db_fetch_array($categories_query)) {
+          $foo[$row['categories_id']] = array(
+                                              'name' => $row['categories_name'],
+                                              'parent' => $row['parent_id'],
+                                              'level' => $key+1,
+                                              'path' => $new_path . '_' . $row['categories_id'],
+                                              'next_id' => false
+                                             );
+
+          if (isset($prev_id)) {
+            $foo[$prev_id]['next_id'] = $row['categories_id'];
+          }
+
+          $prev_id = $row['categories_id'];
+
+          if (!isset($first_id)) {
+            $first_id = $row['categories_id'];
+          }
+
+          $last_id = $row['categories_id'];
+        }
+        $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
+        $foo[$value]['next_id'] = $first_id;
+        $new_path .= '_';
+      } else {
+        break;
+      }
+    }
+  }
+   tep_show_category4($first_element);
+
+ //coment out the below line if you do not want to havw an all products list
+    $categories_string4 .= "<hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODS) . '"><b>' . BOX_INFORMATION_ALLPRODS . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODCATS) . '"><b>' . ALL_PRODUCTS_LINK . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br><hr>\n";
+ $categories_string4 .= '<a href="' . tep_href_link(FILENAME_ALL_PRODMANF) . '"><b>' . ALL_PRODUCTS_MANF . "</b></a>\n";
+    $categories_string4 .= "-&gt;<br>\n";
+
+
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                'text'  => $categories_string4
+                               );
+   new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+
+        </td>
+          </tr>
+<!--D categories_eof 4//-->

Added: trunk/direct.openmoko.com/templates/default/boxes/categories5.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/categories5.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/categories5.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,157 @@
+<?php
+/*
+  $Id: all_categories.php,v 1.6 2002/04/22 20:34:00 clescuyer Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Goélette
+  Christian Lescuyer <cl at goelette.net>
+  http://www.goelette.net/
+  http://oscommerce.goelette.net/
+
+  History: 1.1 Creation
+           1.2 Modified query for compatibility with older databases
+           1.3 Query in 1.2 was wrong for older databases
+           1.4 SHOW_COUNTS test corrected
+           1.5 Added COMPACT_CATEGORIES option to display all sub-categories on one line
+           1.6 Removed COMPACT_CATEGORIES option
+               Corrected the cpath generation
+               Bold categories "path" to selected category, an idea from Peter Fürsicht
+           1.7 Cleaned the way in which the categories are displayed - bold for the path,
+               ">" to indicate the current category, removed link to current category,
+               only indent subcategories (top level are flush left)
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+
+*/
+
+// Keep out parts category
+    $excluded_parts_category_id = 28;
+
+
+// Preorder tree traversal
+  function preorder($cid, $level5, $foo5, $cpath) {
+    global $categories_string5, $HTTP_GET_VARS;
+
+    if ($cid != 0) {
+  // 1.7 Get the current path info
+      $category_path = explode('_',$HTTP_GET_VARS['cPath']);
+      $in_path = in_array($cid, $category_path);
+      $this_category = array_pop($category_path);
+
+      for ($i=0; $i<$level5; $i++)
+      // 1.7 only indent subcategories (top level are flush left)
+        if ($i>0) {
+          $categories_string5 .=  '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
+        }
+        // 1.7 indicate the current category
+        if ($this_category == $cid) {
+          $categories_string5 .=  '> ';
+        }
+
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '">';
+        }
+  // 1.6 Are we on the "path" to selected category? If yes, use <b>
+        if ($in_path) {
+          $categories_string5 .=  '<b>';
+        }
+        $categories_string5 .=  $foo5[$cid]['name'];
+        if ($in_path)
+          $categories_string5 .=  '</b>';
+        // 1.7  don't link the current category
+        if ($this_category != $cid) {
+          $categories_string5 .= '</a>';
+        }
+    // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+          if (SHOW_COUNTS == 'true') {
+            $products_in_category = tep_count_products_in_category($cid);
+            if ($products_in_category > 0) {
+              $categories_string5 .= '&nbsp;(' . $products_in_category . ')';
+            }
+          }
+        $categories_string5 .= '<br>' ."\n";
+      }
+
+// Traverse category tree
+      foreach ($foo5 as $key => $value) {
+        if ($foo5[$key]['parent'] == $cid) {
+  //        print "$key, $level5, $cid, $cpath<br>";
+          preorder($key, $level5+1, $foo5, ($level5 != 0 ? $cpath . $cid . '_' : ''));
+        }
+      }
+  }
+
+?>
+<!-- D categories 5//-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES5);
+  new infoBoxHeading($info_box_contents);
+
+
+//////////
+// Get categories list
+//////////
+// 1.2 Test for presence of status field for compatibility with older versions
+  $status = tep_db_num_rows(tep_db_query('describe categories status'));
+  
+  $query5 = "select 
+    c.categories_id, 
+    cd.categories_name, 
+    c.categories_image,
+    c.parent_id from 
+    " . TABLE_CATEGORIES . " c,
+    " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+    where 
+    c.parent_id = '0' 
+   and c.categories_id = cd.categories_id 
+   and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+ 
+
+  $categories_query5 = tep_db_query($query5);
+
+// Stuff in an array
+  while ($categories5 = tep_db_fetch_array($categories_query5))  {
+    $foo5[$categories5['categories_id']] = array('name' => $categories5['categories_name'], 'parent' => $categories5['parent_id']);
+  }
+
+// Initiate tree traverse
+  $categories_string5 = '';
+  preorder(0, 0, $foo5, '');
+
+//////////
+// Display box contents
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => $categories_string5);
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D categories5_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/currencies.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/currencies.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/currencies.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: currencies.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+
+  if (isset($currencies) && is_object($currencies)) {
+?>
+<!-- D currencies //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CURRENCIES . '</font>');
+    new infoBoxHeading($info_box_contents);
+
+    reset($currencies->currencies);
+    $currencies_array = array();
+    while (list($key, $value) = each($currencies->currencies)) {
+      $currencies_array[] = array('id' => $key, 'text' => $value['title']);
+    }
+
+    $hidden_get_variables = '';
+    reset($HTTP_GET_VARS);
+    while (list($key, $value) = each($HTTP_GET_VARS)) {
+      if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
+        $hidden_get_variables .= tep_draw_hidden_field($key, $value);
+      }
+    }
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
+                                 'align' => 'center',
+                                 'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());
+
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D  currencies_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/customer_gv.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/customer_gv.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/customer_gv.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<?php
+/*
+  $Id: customer_gv.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- D Tell Customer he has a gift voucher-->
+<?php
+  if ($customer_id) {
+    $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$customer_id."'");
+    if ($gv_result=tep_db_fetch_array($gv_query)) $customer_gv_amount=$gv_result['amount'];
+  }
+if ($customer_gv_amount>0) {
+?>
+          <tr>
+            <td>
+<?php
+ $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_GIFT_VOUCHER . '</font>'
+                               );
+
+  new infoBoxHeading($info_box_contents);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<div align="center">'.GIFT_VOUCHER_ACCOUNT_BALANCE_1.$currencies->format($customer_gv_amount).GIFT_VOUCHER_ACCOUNT_BALANCE_2.'<a href="'.tep_href_link(FILENAME_GV_SEND).'">'.GIFT_VOUCHER_ACCOUNT_BALANCE_3.'</a>'
+                              );
+
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!--D Tell Customer he has a gift voucher_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/donate.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/donate.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/donate.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  $Id: donate.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+  Released under the GNU General Public License
+*/
+?>
+<!--D Donate //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DONATE  . '</font>');
+    new infoBoxHeading($info_box_contents);
+$info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
+              <input type="hidden" name="cmd" value="_xclick">
+              <input type="hidden" name="business" value="donations at creloaded.com">
+              <input type="hidden" name="no_note" value="1">
+              <input type="hidden" name="currency_code" value="USD">
+              <input type="hidden" name="tax" value="0">
+              <input type="image" src="images/x-click_butcc_donate.gif" name="submit"  alt="'.DONATE_BUTTON_IMAGE_ALT.'">
+            </form>');
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D Donate_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/downloads.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/downloads.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/downloads.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,146 @@
+<?php
+/*
+  $Id: downloads.php,v 1.1.1.1 2003/09/18 19:05:49 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- D downloads //-->
+<?php
+  // modification of the logic to prevent the queries if there is no customer id
+  if ( $customer_id != '' ) {
+  if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+// Get last order id for checkout_success
+    $orders_query_raw = "SELECT orders_id FROM " . TABLE_ORDERS . " WHERE customers_id = '" . $customer_id . "' ORDER BY orders_id DESC LIMIT 1";
+    $orders_query = tep_db_query($orders_query_raw);
+    $orders_values = tep_db_fetch_array($orders_query);
+    $last_order = $orders_values['orders_id'];
+  } else {
+    $last_order = (int)$HTTP_GET_VARS['order_id'];
+  }
+
+// Now get all downloadable products in that order
+  $downloads_query_raw = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays
+                          FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
+                          WHERE customers_id = '" . $customer_id . "'
+                          AND o.orders_id = '" . $last_order . "'
+                          AND op.orders_id = '" . $last_order . "'
+                          AND opd.orders_products_id=op.orders_products_id
+                          AND opd.orders_products_filename<>''";
+  $downloads_query = tep_db_query($downloads_query_raw);
+
+// Don't display if there is no downloadable product
+  if (tep_db_num_rows($downloads_query) > 0) {
+     require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_DOWNLOADBOX);
+          ECHO '<tr><td>' ;
+          $info_box_contents = array();
+          $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_DOWNLOADS . '</font>');
+          new infoBoxHeading($info_box_contents);
+
+           $info_box_contents = array();
+ ?>
+<!-- list of products -->
+<?php
+    while ($downloads_values = tep_db_fetch_array($downloads_query)) {
+?>
+
+<!-- left box -->
+<?php
+// MySQL 3.22 does not have INTERVAL
+      list($dt_year, $dt_month, $dt_day) = explode('-', $downloads_values['date_purchased_day']);
+      $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads_values['download_maxdays'], $dt_year);
+        $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
+
+// The link will appear only if:
+// - Download remaining count is > 0, AND
+// - The file is present in the DOWNLOAD directory, AND EITHER
+// - No expiry date is enforced (maxdays == 0), OR
+// - The expiry date is not reached
+      if (($downloads_values['download_count'] > 0) &&
+          (file_exists(DIR_FS_DOWNLOAD . $downloads_values['orders_products_filename'])) &&
+          (($downloads_values['download_maxdays'] == 0) ||
+           ($download_timestamp > time()))) {
+
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_FILE . '<br><br><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads_values['orders_products_download_id']) . '">' . $downloads_values['products_name'] . '</a>'
+                                          );
+ new infoBox($info_box_contents);
+      } else {
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => $downloads_values['products_name']
+                                          );
+ new infoBox($info_box_contents);
+  if (TEMPLATE_INCLUDE_FOOTER =='true'){
+      $info_box_contents = array();
+       $info_box_contents[] = array('align' => 'left',
+                                     'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                   );
+  new infoboxFooter($info_box_contents);
+ }
+
+      }
+?>
+<!-- right box -->
+<?php
+ $info_box_contents = array();
+ $info_box_contents[] = array('align' => 'left',
+                               'text'  => TEXT_HEADING_DOWNLOAD_DATE . '<br>' .  tep_date_long($download_expiry)
+                                          );
+
+  new infoBox($info_box_contents);
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => $downloads_values['download_count'] . '  ' .  TEXT_HEADING_DOWNLOAD_COUNT
+                                        );
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+    }
+ }
+
+if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                             'text'  => TEXT_FOOTER_DOWNLOAD . '<br><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . TEXT_DOWNLOAD_MY_ACCOUNT . '</a>'
+                                        );
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+
+   }
+?>
+     </td>
+   </tr>
+<?php
+  }
+  }
+?>
+<!--D downloads_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/example.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/example.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/example.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,53 @@
+<?php
+/*
+  Card Infobox, v 1.0 2002/12/04 by Kevin Park
+
+  osCommerce
+  http://www.oscommerce.com/
+
+  Copyright (c) 2000,2001 osCommerce
+
+  Released under the GNU General Public License
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1601 $
+
+*/
+?>
+<!-- Example_infobox Box //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_EXAMPLE . '</font>'
+                 // Change BOX_HEADING_EXAMPLE to your name, which you can find it easily.
+                 //and use the same in Infobox Admin to configure infobox.
+                              );
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                // add infobox content below.
+                'text'  => 'Your Content here'
+                               );
+
+new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+</td></tr>
+<!-- Example_infobox_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/faq.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: faq.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$faq_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_FAQ_CATEGORIES . " ic, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// faq outside categories
+$faq_query = tep_db_query("select ip.faq_id, ip.question from " . TABLE_FAQ . " ip left join " . TABLE_FAQ_TO_CATEGORIES . " ip2c on ip2c.faq_id = ip.faq_id where ip2c.categories_id = '0' and ip.language = '" . (int)$languages_id . "' and ip.visible = '1' order by ip.v_order, ip.question");
+
+if ((tep_db_num_rows($faq_categories_query) > 0) || (tep_db_num_rows($faq_query) > 0)) {
+?>
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FAQ . '</font>');
+
+  new infoBoxHeading($info_box_contents);
+
+  $faq_string = '';
+  while ($faq_categories = tep_db_fetch_array($faq_categories_query)) {
+    $id_string = 'cID=' . $faq_categories['categories_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($faq = tep_db_fetch_array($faq_query)) {
+    $id_string = 'fID=' . $faq['faq_id'];
+    $faq_string .= '<a href="' . tep_href_link(FILENAME_FAQ, $id_string) . '">' . $faq['question'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $faq_string);
+
+  new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+<?php
+/*
+  $Id: featured.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!--D featured //-->
+<?php
+  $random_product_side = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added,
+                          p.products_image 
+                          from " . TABLE_PRODUCTS . " p, 
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                        " . TABLE_FEATURED . " f
+                                 where
+                                   p.products_status = '1'
+                                   and f.status = '1'
+                                   and p.products_id = f.products_id
+                                   and pd.products_id = f.products_id
+                                   and pd.language_id = '" . $languages_id . "'
+                                   order by rand(), featured_date_added DESC limit " . MAX_RANDOM_SELECT_SPECIALS);
+
+$random_product_side_row = tep_db_num_rows($random_product_side);
+   if ($random_product_side_row > 0){
+?>
+          <tr>
+            <td>
+<?php
+while ($featured_random_product21 = tep_db_fetch_array($random_product_side)){
+
+$featured_product21_id = $featured_random_product21['products_id'];
+$featured_product21_image = tep_get_products_image($featured_random_product21['products_id']);
+$featured_product21_name = tep_get_products_name($featured_random_product21['products_id']);
+
+  $pf->loadProduct($featured_random_product21['products_id'],$languages_id);
+        $featured_price1 = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FEATURED . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents, tep_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+            'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $featured_product21_image, $featured_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_product21_id, 'NONSSL') . '">' . $featured_product21_name . '</a><br>' . $featured_price1 );
+
+
+
+   new infoBox($info_box_contents);
+    if (TEMPLATE_INCLUDE_FOOTER =='true'){
+        $info_box_contents = array();
+         $info_box_contents[] = array('align' => 'left',
+                                       'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                     );
+    new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<?php
+  
+ }
+?>
+<!--D specials_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/googlead.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/googlead.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/googlead.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,64 @@
+<?php
+/*
+  $Id: googlead.php, v 1.1 2004/05/30 Tom O'Neill (zip1)
+
+  Released under the GNU General Public License
+ based on banner in a box by aubrey at mycon.co.za
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+*/
+?>
+<!--D google-banner-ad-in-a-box //-->
+<?php
+  if (!(getenv('HTTPS')=='on')){
+  if ($banner = tep_banner_exists('dynamic', 'googlebox')) {
+?>
+          <tr>
+            <td>
+
+<?php
+    $bannerstring = tep_display_banner('static', $banner);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_GOOGLE_AD_BANNER_HEADING . '</font>'
+                                );
+    new infoBoxHeading($info_box_contents);
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $bannerstring
+                                );
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<?php
+  }
+  }
+?>
+<!--D google-banner-ad-in-a-box_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/information_table.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/information_table.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/information_table.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: information.php,v 1.1.1.1 2003/09/18 19:05:51 wilt Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!--D information //-->
+          <tr>
+            <td>
+<?php
+require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_INFORMATIONBOX);
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_INFORMATION_TABLE . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+  // Retrieve information from Info table
+   $informationString = "";
+
+ // joles
+   $sql_query = tep_db_query("SELECT information_id, languages_id, info_title FROM " . TABLE_INFORMATION . " WHERE visible= '1' and languages_id ='" . (int)$languages_id . "' ORDER BY v_order");
+   while ($row = tep_db_fetch_array($sql_query)){
+   $informationString .= '<a href="' . tep_href_link(FILENAME_INFORMATION,  'info_id=' . $row['information_id'] ) . '">' . $row['info_title'] . '</a><br>';
+   }
+
+   $info_box_contents = array();
+
+if (tep_session_is_registered('customer_id')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+
+ } else if ((tep_session_is_registered('customer_id')) && (MODULE_ORDER_TOTAL_GV_STATUS == 'true')) {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+} else {
+   $info_box_contents[] = array('text' =>  $informationString .
+                                          '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LINKS) . '"> ' . BOX_INFORMATION_LINKS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'SSL') . '">' . BOX_INFORMATION_CONTACT . '</a>');
+}
+
+  new $infobox_template($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D information_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/boxes/languages.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/languages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/languages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,58 @@
+<?php
+/*
+  $Id: languages.php,v 1.1.1.1 2004/03/04 23:42:25 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!--D languages //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LANGUAGES . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+  if (!isset($lng) || (isset($lng) && !is_object($lng))) {
+    include(DIR_WS_CLASSES . FILENAME_LANGUAGE);
+    $lng = new language;
+  }
+
+  $languages_string = '';
+  reset($lng->catalog_languages);
+  while (list($key, $value) = each($lng->catalog_languages)) {
+    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'center',
+                               'text' => $languages_string);
+
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D languages_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/links.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/links.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/links.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,65 @@
+<?php
+/*
+  $Id: links.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+
+// check for link categoris to determine if there is anything to display
+  $link_categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int)$languages_id . "' order by lcd.link_categories_name");
+  $number_of_categories = tep_db_num_rows($link_categories_query);
+
+  if ($number_of_categories > 0) {
+?>
+          <tr>
+            <td>
+<!--D links -->            
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LINKS . '</font>');
+    new infoBoxHeading($info_box_contents, tep_href_link(FILENAME_LINKS));
+
+    $informationString = '';
+    while($row = tep_db_fetch_array($link_categories_query)) {
+      $lPath_new = 'lPath=' . $row['link_categories_id'];
+      $informationString .= '<a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">' . $row['link_categories_name'] . '</a><br>';
+    }
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'left',
+                                 'text'  => $informationString
+                                );
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+<!--D links -->  
+            </td>
+          </tr>
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/loginbox.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/loginbox.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/loginbox.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,156 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official osC distribution
+  but an add-on contributed to the osC community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+  loginbox.php -   Version 1.0
+  This puts a login request in a box with a login button.
+  If already logged in, will not show anything.
+
+  Modified to utilize SSL to bypass Security Alert
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_LOGINBOX);
+
+// WebMakers.com Added: Do not show if on login or create account
+if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') )  {
+?>
+<!--D loginbox //-->
+<?php
+
+    if (!tep_session_is_registered('customer_id')) {
+?>
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN . '</font>');
+    new infoBoxHeading($info_box_contents);
+
+    $loginboxcontent = "
+       <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "\">
+            <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
+               <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_EMAIL . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  " . BOX_LOGINBOX_PASSWORD . "
+                </td>
+              </tr>
+              <tr>
+                <td align=\"left\" class=\"infoboxContents\">
+                  <input type=\"password\" name=\"password\" maxlength=\"40\" size=\"20\" value=\"\">
+                </td>
+              </tr>
+        <tr>
+            <td align=\"center\">
+      " . tep_draw_separator('pixel_trans.gif', '100%', '5') . "
+      </td>
+            </tr>
+              <tr>
+                <td class=\"infoboxContents\" align=\"center\">
+                  " . tep_template_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "
+                </td>
+              </tr>
+             </table>
+           </form> 
+              ";
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text'  => $loginboxcontent
+                                );
+   new infoBox($info_box_contents);
+    if (TEMPLATE_INCLUDE_FOOTER =='true'){
+        $info_box_contents = array();
+         $info_box_contents[] = array('align' => 'left',
+                                       'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                     );
+    new infoboxFooter($info_box_contents);
+}
+?>
+            </td>
+          </tr>
+<?php
+  } else {
+  // If you want to display anything when the user IS logged in, put it
+  // in here...  Possibly a "You are logged in as :" box or something.
+
+
+  }
+?>
+<!--D loginbox_eof //-->
+<?php
+// WebMakers.com Added: My Account Info Box
+} else {
+  if (tep_session_is_registered('customer_id')) {
+?>
+
+<!--D my_account_info //-->
+          <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT . '</font>');
+    new infoBoxHeading($info_box_contents);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .
+                                          '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>'
+                              );
+   new infoBox($info_box_contents);
+ if (TEMPLATE_INCLUDE_FOOTER =='true'){
+     $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+ new infoboxFooter($info_box_contents);
+ }
+
+?>
+            </td>
+          </tr>
+<!--D my_account_info_eof //-->
+
+<?php
+  }
+}
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/manufacturer_info.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/manufacturer_info.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/manufacturer_info.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,66 @@
+<?php
+/*
+  $Id: manufacturer_info.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!--D manufacturer_info //-->
+<?php
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id, m.manufacturers_id as manf_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from  " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and m.manufacturers_id = p.manufacturers_id and mi.manufacturers_id = m.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'");
+//    $manufacturer_query = tep_db_query("select p.products_id, p.manufacturers_id from  " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+
+   while ($manufacturer = tep_db_fetch_array($manufacturer_query)) {;
+?>
+<!--D manufacturer_info //-->
+          <tr>
+            <td>
+          
+<?php
+      $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURER_INFO . '</font>');
+      new infoBoxHeading($info_box_contents);
+
+      $manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+      if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';
+      if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';
+      $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">-&nbsp;</td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manf_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . ' ' . $manufacturer['manufacturers_name'] . '</a></td></tr>' .
+                                   '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturer_info_string);
+
+      new infoBox($info_box_contents);
+       if (TEMPLATE_INCLUDE_FOOTER =='true'){
+           $info_box_contents = array();
+            $info_box_contents[] = array('align' => 'left',
+                                          'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                        );
+       new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D manufacturer_info_eof //-->
+<?php
+    }
+  }
+?>
+<!-- manufacturer_info_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/manufacturers.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/manufacturers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/manufacturers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: manufacturers.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
+  if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
+?>
+<!--D manufacturers //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_MANUFACTURERS . '</font>');
+    new infoBoxHeading($info_box_contents);
+
+    if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
+// Display a list
+      $manufacturers_list = '';
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
+        $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
+      }
+
+      $manufacturers_list = substr($manufacturers_list, 0, -4);
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $manufacturers_list);
+    } else {
+// Display a drop-down
+      $manufacturers_array = array();
+      if (MAX_MANUFACTURERS_LIST < 2) {
+        $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
+      }
+
+      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
+        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
+        $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
+                                       'text' => $manufacturers_name);
+      }
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
+                                   'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
+    }
+
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D manufacturers_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/navmenu.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/navmenu.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/navmenu.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,120 @@
+<?php
+/*
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+ Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+// VJ navmenu begin
+define('TABLE_NAVMENU_CATEGORIES', 'navmenu_categories');
+define('TABLE_NAVMENU_CATEGORIES_DESCRIPTION', 'navmenu_categories_description');
+define('TABLE_NAVMENU_LINKS', 'navmenu_links');
+define('TABLE_NAVMENU_LINKS_DESCRIPTION', 'navmenu_links_description');
+define('TABLE_NAVMENU_LINKS_TO_CATEGORIES', 'navmenu_links_to_categories');
+// VJ navmenu end
+
+function tep_nm_get_navmenu_list($pid = 0, $list_string = '', $style_id = '') {
+  global $languages_id;
+
+  $categories_query = tep_db_query("select c.nmc_id, cd.nmc_name
+                                    from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                         " . TABLE_NAVMENU_CATEGORIES_DESCRIPTION . " cd
+                                    where c.nmc_parent_id = '" . (int)$pid . "'
+                                      and cd.nmc_id = c.nmc_id
+                                      and cd.language_id = '" . (int)$languages_id . "'
+                                    order by c.nmc_sort_order, cd.nmc_name");
+
+  $links_query = tep_db_query("select l.nml_id, l.nml_url, ld.nml_name
+                               from " . TABLE_NAVMENU_CATEGORIES . " c,
+                                    " . TABLE_NAVMENU_LINKS_TO_CATEGORIES . " l2c,
+                                    " . TABLE_NAVMENU_LINKS . " l,
+                                    " . TABLE_NAVMENU_LINKS_DESCRIPTION . " ld
+                               where c.nmc_id = '" . (int)$pid . "'
+                                 and c.nmc_id = l2c.nmc_id
+                                 and l2c.nml_id = l.nml_id
+                                 and ld.nml_id = l.nml_id
+                                 and ld.language_id = '" . (int)$languages_id . "'
+                               order by l.nml_sort_order, ld.nml_name");
+
+  if ((tep_db_num_rows($categories_query) > 0) || (tep_db_num_rows($links_query) > 0)) {
+    if (empty($list_string)) {
+      $list_string .= '<ul id="' . $style_id . '">' . "\n";
+    } else {
+      $list_string .= '<ul>' . "\n";
+    }
+
+    while ($categories = tep_db_fetch_array($categories_query)) {
+      $list_string .= '<li><a href="#">' . $categories['nmc_name'] . '</a>';
+
+      $list_string = tep_nm_get_navmenu_list((int)$categories['nmc_id'], $list_string);
+
+      $list_string .= '</li>' . "\n";
+    } 
+
+    while ($links = tep_db_fetch_array($links_query)) {
+      $list_string .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $links['nml_url'], 'NONSSL') . '">' . $links['nml_name'] . '</li>' . "\n";
+    } 
+
+    $list_string .= '</ul>' . "\n";
+  }
+
+  return $list_string;
+}
+?>
+<!-- navmenu //-->
+<script type="text/javascript"><!--
+sfHover = function() {
+   var sfEls = document.getElementById("navMenu").getElementsByTagName("LI");
+   for (var i=0; i<sfEls.length; i++) {
+     sfEls[i].onmouseover=function() {
+       this.className+=" sfhover";
+     }
+     sfEls[i].onmouseout=function() {
+       this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
+     }
+   }
+}
+if (window.attachEvent) window.attachEvent("onload", sfHover);
+//--></script>
+                  <tr>
+                    <td>
+                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
+                      <tr>
+                        <td width="100%">
+<?php
+$info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NAVMENU . '</font>');
+new infoBoxHeading($info_box_contents, false, false);
+
+$menu_string = tep_nm_get_navmenu_list(0, '', 'navMenu');
+
+// VJ debug
+//print_r($menu_string);
+
+$info_box_contents = array(array('text' =>  $menu_string));
+
+new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+                        </td>
+                      </tr>
+                    </table>
+                    </td>
+                  </tr>
+<!--D information_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/order_history.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/order_history.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/order_history.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+  $Id: order_history.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 887 $
+
+
+  Released under the GNU General Public License
+*/
+
+  if (tep_session_is_registered('customer_id')) {
+// retreive the last x products purchased
+    $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
+    if (tep_db_num_rows($orders_query)) {
+?>
+<!-- customer_orders //-->
+          <tr>
+            <td>
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_CUSTOMER_ORDERS . '</font>');
+      new infoBoxHeading($info_box_contents);
+
+      $product_ids = '';
+      while ($orders = tep_db_fetch_array($orders_query)) {
+        $product_ids .= (int)$orders['products_id'] . ',';
+      }
+      $product_ids = substr($product_ids, 0, -1);
+
+      $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
+      $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
+      while ($products = tep_db_fetch_array($products_query)) {
+        // changes the cust_order into a buy_now action
+        $customer_orders_string .= '  <tr>' .
+                                   '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' .
+                                   '    <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' .
+                                   '  </tr>';
+      }
+      $customer_orders_string .= '</table>';
+
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $customer_orders_string);
+
+      new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!-- customer_orders_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/pages.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/pages.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/pages.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,76 @@
+<?php
+/*
+  $Id: pages.php,v 1.1 2004/03/05 01:39:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+$pages_categories_query = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_PAGES_CATEGORIES . " ic, " . TABLE_PAGES_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by ic.categories_sort_order, icd.categories_name");
+
+// pages outside categories
+$pages_query = tep_db_query("select ip.pages_id, ipd.pages_title
+                             from " . TABLE_PAGES . " ip
+                             left join " . TABLE_PAGES_TO_CATEGORIES . " ip2c on (ip2c.pages_id = ip.pages_id and ip2c.categories_id = '0'),
+                                  " . TABLE_PAGES_DESCRIPTION . " ipd
+                             where ip.pages_status = '1'
+                               and ipd.pages_id = ip.pages_id
+                               and ipd.language_id = '" . (int)$languages_id . "'
+                             order by ip.pages_sort_order, ipd.pages_title");
+
+if ((tep_db_num_rows($pages_categories_query) > 0) || (tep_db_num_rows($pages_query) > 0)) {
+?>
+          <tr>
+            <td>
+<!-- d page -->  
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_PAGES . '</font>');
+
+  new infoBoxHeading($info_box_contents, false, false);
+
+  $pages_string = '';
+  while ($pages_categories = tep_db_fetch_array($pages_categories_query)) {
+    $id_string = 'cID=' . $pages_categories['categories_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages_categories['categories_name'] . '</a><br>';
+  }
+
+  while ($pages = tep_db_fetch_array($pages_query)) {
+    $id_string = 'pID=' . $pages['pages_id'];
+    $pages_string .= '<a href="' . tep_href_link(FILENAME_PAGES, $id_string) . '">' . $pages['pages_title'] . '</a><br>';
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => $pages_string);
+
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+ 
+?>
+    <!-- d page EOF -->  
+       </td>
+          </tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/product_notifications.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/product_notifications.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/product_notifications.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: product_notifications.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+if (isset($HTTP_POST_VARS['products_id']) && tep_not_null($HTTP_POST_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
+  } elseif (isset($HTTP_GET_VARS['products_id']) && tep_not_null($HTTP_GET_VARS['products_id'])) {
+    $products_id = tep_db_prepare_input($HTTP_GET_VARS['products_id']);
+  } 
+  if ( (isset($HTTP_GET_VARS['products_id'])) || (isset($HTTP_POST_VARS['products_id'])) ) {
+?>
+<!--D notifications //-->
+          <tr>
+            <td>
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_NOTIFICATIONS . '</font>');
+    new infoBoxHeading($info_box_contents, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
+
+    if (tep_session_is_registered('customer_id')) {
+      $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'");
+      $check = tep_db_fetch_array($check_query);
+
+      $notification_exists = (($check['count'] > 0) ? true : false);
+    } else {
+      $notification_exists = false;
+    }
+
+    $info_box_contents = array();
+    if ($notification_exists == true) {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    } else {
+      $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table>');
+    }
+
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D notifications_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/reviews.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/reviews.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/reviews.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,68 @@
+<?php
+/*
+  $Id: reviews.php,v 1.1.1.1 2004/03/04 23:42:26 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!--D reviews //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_REVIEWS . '</font>');
+  new infoBoxHeading($info_box_contents, tep_href_link(FILENAME_REVIEWS));
+
+  $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'";
+  if (isset($HTTP_GET_VARS['products_id'])) {
+    $random_select .= " and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'";
+  }
+  $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
+  $random_product = tep_random_select($random_select);
+
+  $info_box_contents = array();
+
+  if ($random_product) {
+// display random review box
+    $review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'");
+    $review = tep_db_fetch_array($review_query);
+
+    $review = tep_break_string(tep_output_string_protected($review['reviews_text']), 15, '-<br>');
+
+    $info_box_contents[] = array('text' => '<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div>');
+  } elseif (isset($HTTP_GET_VARS['products_id'])) {
+// display 'write a review' box
+    $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . BOX_REVIEWS_WRITE_REVIEW .'</a></td></tr></table>');
+  } else {
+// display 'no reviews' box
+    $info_box_contents[] = array('text' => BOX_REVIEWS_NO_REVIEWS);
+  }
+
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D reviews_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/search.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,49 @@
+<?php
+/*
+  $Id: search.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!--D search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" ') . '&nbsp;' . tep_hide_session_id() . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');
+
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+
+?>
+            </td>
+          </tr>
+<!--D search_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/search1.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/search1.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/search1.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+  $Id: search1.php,v 1.1.1.1 2004/03/04 23:42:16 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!--D search //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SEARCH1 . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+  $hide = tep_hide_session_id();
+  $info_box_contents = array();
+  $info_box_contents[] = array('form'  => '<form name="quick_find1" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',
+                               'align' => 'center',
+                               'text'  => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px">&nbsp;' . tep_template_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br>'
+                              );
+
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D search_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/shop_by_price.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/shop_by_price.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/shop_by_price.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,64 @@
+<?php
+/*
+  $Id: shop_by_price.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  Contribution by Meltus
+  http://www.highbarn-consulting.com
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+?>
+<!--D shop by price //-->
+<?php
+if (MODULE_SHOPBYPRICE_RANGES > 0) {
+?>
+          <tr>
+            <td>
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOP_BY_PRICE . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+  $info_box_contents = array();
+  $sbp_array = unserialize(MODULE_SHOPBYPRICE_RANGE);
+
+  $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=0', 'NONSSL') . '">' . TEXT_INFO_UNDER . $currencies->format($sbp_array[0]) . '</a><br>');
+  for ($i=1, $ii=count($sbp_array); $i < $ii; $i++) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . TEXT_INFO_FROM . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_TO . $currencies->format($sbp_array[$i]) . '</a><br>');
+  }
+  if (MODULE_SHOPBYPRICE_OVER == True) {
+    $info_box_contents[] = array('text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $i, 'NONSSL') . '">' . $currencies->format($sbp_array[$i-1]) . TEXT_INFO_ABOVE . '</a><br>');
+  }
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<?php
+}
+?>
+<!--D shop_by_price //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/boxes/shopping_cart.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/shopping_cart.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/shopping_cart.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,137 @@
+<?php
+/*
+  $Id: shopping_cart.php,v 1.2 2004/03/09 17:56:06 ccwjr Exp $
+
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!--D shopping_cart //-->
+<script type="text/javascript"><!--
+function couponpopupWindow(url) {
+  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
+}
+//--></script>
+
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SHOPPING_CART . '</font>');
+  new infoBoxHeading($info_box_contents, tep_href_link(FILENAME_SHOPPING_CART));
+
+  $cart_contents_string = '';
+  if ($cart->count_contents() > 0) {
+    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';
+    $products = $cart->get_products();
+    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+      $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+// MOD begin of sub product
+
+  $db_sql = "select products_parent_id from " . TABLE_PRODUCTS . " where products_id = " . (int)$products[$i]['id'];
+    $products_parent_id = tep_db_fetch_array(tep_db_query($db_sql));
+  if ((int)$products_parent_id['products_parent_id'] != 0) {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_parent_id['products_parent_id']) . '">';
+  } else {
+    $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+  }
+
+//      $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
+
+// MOD end of sub product
+///////////////////////////////////////////////////////////////////////////////////////////////////////
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        $cart_contents_string .= '<span class="newItemInCart">';
+      } else {
+        $cart_contents_string .= '<span class="infoBoxContents">';
+      }
+
+      $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';
+
+      if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {
+        tep_session_unregister('new_products_id_in_cart');
+      }
+    }
+    $cart_contents_string .= '</table>';
+  } else {
+    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
+  }
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => $cart_contents_string);
+
+  if ($cart->count_contents() > 0) {
+    // WebMakers.com Added: Shoppe Enhancement Controller
+    // check for free order
+    $final_total=$cart->show_total();
+    if ($final_total==0) {
+      $final_total='Free';
+    } else {
+      $final_total=$currencies->format($cart->show_total());
+    }
+    $info_box_contents[] = array('text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'right',
+                                 'text' => $final_total);
+  }
+// ICW ADDED FOR CREDIT CLASS GV
+  if (tep_session_is_registered('customer_id')) {
+    $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
+    $gv_result = tep_db_fetch_array($gv_query);
+    if ($gv_result['amount'] > 0 ) {
+      $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');
+      $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');
+    }
+  }
+  if (tep_session_is_registered('gv_id')) {
+    $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
+    $coupon = tep_db_fetch_array($gv_query);
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');
+
+  }
+  if (tep_session_is_registered('cc_id') && $cc_id) {
+    $info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
+    $info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');
+
+  }
+
+// ADDED FOR CREDIT CLASS GV END ADDITTION
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D shopping_cart_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,85 @@
+<?php
+/*
+  $Id: specials.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+
+   $random_product25 = tep_db_query("select distinct
+   p.products_id, 
+   pd.products_name, 
+   p.products_tax_class_id, 
+   p.products_image, 
+   p.products_price,
+   s.specials_new_products_price 
+   from " . TABLE_PRODUCTS . " p, 
+    " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+    " . TABLE_SPECIALS . " s 
+   where 
+   p.products_status = '1' 
+   and p.products_id = s.products_id 
+   and pd.products_id = s.products_id 
+   and pd.language_id = '" . (int)$languages_id . "' 
+   and s.status = '1' 
+   order by rand(), s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
+ 
+  
+  $random_product24_side_row = tep_db_num_rows($random_product25);
+     if ($random_product24_side_row > 0){
+
+// EOF Separate Price per Customer
+//Eversun mod end for sppc and qty price breaks
+?>
+<!-- d specials //-->
+          <tr>
+            <td>
+<?php
+
+while ($product_specials22 = tep_db_fetch_array($random_product25)){
+  $product_specials22_id = $product_specials22['products_id'];
+  $product_specials22_image = tep_get_products_image($product_specials22['products_id']);
+  $product_specials22_name = tep_get_products_name($product_specials22['products_id']);
+
+  $pf->loadProduct($product_specials22['products_id'],$languages_id);
+        $special_random_price = $pf->getPriceStringShort();
+}
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_SPECIALS . '</font>');
+    new infoBoxHeading($info_box_contents, tep_href_link(FILENAME_SPECIALS));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',
+                                 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price);
+
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!-- d specials_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/tell_a_friend.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/tell_a_friend.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/tell_a_friend.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,52 @@
+<?php
+/*
+  $Id: tell_a_friend.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+if ($HTTP_GET_VARS['products_id']) {
+?>
+<!--D tell_a_friend //-->
+          <tr>
+            <td>
+<?php
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TELL_A_FRIEND . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('form' => tep_draw_form('tell_a_friend', tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get'),
+                               'align' => 'center',
+                               'text' => tep_draw_input_field('to_email_address', '', 'size="10"') . '&nbsp;' . tep_template_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id() . '<br>' . BOX_TELL_A_FRIEND_TEXT);
+
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D tell_a_friend_eof //-->
+
+<?php } ?>

Added: trunk/direct.openmoko.com/templates/default/boxes/theme_select.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/theme_select.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/theme_select.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<?php
+/*
+  $Id: theme_select.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2001 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+    if (tep_session_is_registered('customer_id')) {
+
+  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
+
+?>
+<!--D theme //-->
+         <tr>
+            <td>
+<?php
+
+  $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_TEMPLATE_SELECT . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+  $template_query = tep_db_query("select template_id, template_name from " . TABLE_TEMPLATE . " where active = '1' order by template_name");
+
+ 
+// Display a drop-down
+    $select_box = '<select name="template" onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%">';
+    if (MAX_THEME_LIST < 2) {
+      $select_box .= '<option value="">' . PULL_DOWN_DEFAULT . '</option>';
+    }
+    while ($template_values = tep_db_fetch_array($template_query)) {
+      $select_box .= '<option value="' . $template_values['template_name'] . '"';
+      if ($HTTP_GET_VARS['template_id'] == $template_values['template_id']) $select_box .= ' SELECTED';
+      $select_box .= '>' . substr($template_values['template_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
+    }
+    $select_box .= "</select>";
+    $select_box .= tep_hide_session_id();
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('form'  => '<form name="template" method="post" action="' . tep_href_link(FILENAME_DEFAULT, '&action=update_template', 'NONSSL') . '">',
+                                 'align' => 'left',
+                                 'text'  => $select_box);
+
+   new infoBox($info_box_contents);
+    if (TEMPLATE_INCLUDE_FOOTER =='true'){
+        $info_box_contents = array();
+         $info_box_contents[] = array('align' => 'left',
+                                       'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                     );
+    new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<?php
+}}
+?>
+<!--D template_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/whats_new.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/whats_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/whats_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,85 @@
+<?php
+/*
+  $Id: whats_new.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+*/
+
+  $random_product27 = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_image, 
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                           p.products_image 
+                          from (" . TABLE_PRODUCTS . " p 
+      left join " . TABLE_SPECIALS . " s using(products_id)),
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+      where 
+       p.products_status = '1' 
+       and pd.products_id = p.products_id
+       and pd.language_id = '" . $languages_id . "' 
+       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+      order by rand(), products_date_added desc limit " . MAX_RANDOM_SELECT_NEW);
+ 
+$random_product27_side_row = tep_db_num_rows($random_product27);
+   if ($random_product27_side_row > 0){
+
+  ?>
+<!--D whats_new //-->
+ <tr>
+            <td>
+<?php      
+    
+while ($whatsnew_product21 = tep_db_fetch_array($random_product27)){
+  $whatsnew_product21_id = $whatsnew_product21['products_id'];
+  $whatsnew_product21_image = tep_get_products_image($whatsnew_product21['products_id']);
+  $whatsnew_product21_name = tep_get_products_name($whatsnew_product21['products_id']);
+
+  $pf->loadProduct($whatsnew_product21['products_id'],$languages_id);
+         $whats_new_price = $pf->getPriceStringShort();
+}
+// EOF Separate Pricing Per Customer
+//Eversun mod end for sppc and qty price breaks
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHATS_NEW . '</font>');
+    new infoBoxHeading($info_box_contents, tep_href_link(FILENAME_PRODUCTS_NEW));
+
+    $info_box_contents = array();
+    $info_box_contents[] = array('align' => 'center',           
+         'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . tep_image(DIR_WS_IMAGES . $whatsnew_product21_image, $whatsnew_product21_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whatsnew_product21_id) . '">' . $whatsnew_product21_name . '</a><br>' . $whats_new_price .'<br />');
+//Eversun mod for sppc and qty price breaks
+
+    new infoBox($info_box_contents);
+     if (TEMPLATE_INCLUDE_FOOTER =='true'){
+         $info_box_contents = array();
+          $info_box_contents[] = array('align' => 'left',
+                                        'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                      );
+     new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D whats_new_eof //-->
+<?php
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/boxes/whos_online.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/whos_online.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/whos_online.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,100 @@
+<?php
+/*
+  $Id: whos_online.php, v 1.0 2001/12/05 by mattice at xs4all.nl
+
+
+  Copyright (c) 2000,2001 The Exchange Project
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision:$
+
+
+  Released under the GNU General Public License
+
+
+  IMPORTANT NOTE:
+
+  This script is not part of the official TEP distribution
+  but an add-on contributed to the TEP community. Please
+  read the README and  INSTALL documents that are provided
+  with this file for further information and installation notes.
+
+*/
+ require(DIR_WS_LANGUAGES . $language . '/'.FILENAME_WHOS_ONLINEBOX);
+?>
+
+
+<!--D whos_online //-->
+          <tr>
+            <td>
+<?php
+
+// Set expiration time, default is 900 secs (15 mins)
+  $xx_mins_ago = (time() - 900);
+
+  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
+
+  $whos_online_query = tep_db_query("select customer_id from " . TABLE_WHOS_ONLINE);
+  while ($whos_online = tep_db_fetch_array($whos_online_query)) {
+                        if (!$whos_online['customer_id'] == 0) $n_members++;
+                        if ($whos_online['customer_id'] == 0) $n_guests++;
+
+  $user_total = sprintf(tep_db_num_rows($whos_online_query));                                                                }
+
+  if ($user_total == 1) {
+    $there_is_are = BOX_WHOS_ONLINE_THEREIS . '&nbsp;';
+  } else {
+    $there_is_are = BOX_WHOS_ONLINE_THEREARE . '&nbsp;';
+  }
+
+  if ($n_guests == 1) {
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUEST;
+  }else{
+    $word_guest = '&nbsp;' . BOX_WHOS_ONLINE_GUESTS;
+  }
+
+  if ($n_members == 1) {
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBER;
+  }else{
+    $word_member = '&nbsp;' . BOX_WHOS_ONLINE_MEMBERS;
+  }
+
+
+  if (($n_guests >= 1) && ($n_members >= 1)) $word_and = '&nbsp;' . BOX_WHOS_ONLINE_AND . '&nbsp;<br>';
+
+      $textstring = $there_is_are;
+        if ($n_guests >= 1) $textstring .= $n_guests . $word_guest;
+
+      $textstring .= $word_and;
+        if ($n_members >= 1) $textstring .= $n_members . $word_member;
+
+      $textstring .= '&nbsp;online.';
+
+
+  $info_box_contents = array();
+$info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WHOS_ONLINE . '</font>');
+  new infoBoxHeading($info_box_contents);
+
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                               'text'  =>  $textstring
+                              );
+  new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }
+?>
+            </td>
+          </tr>
+<!--D whos_online_eof //-->

Added: trunk/direct.openmoko.com/templates/default/boxes/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,102 @@
+<?php
+/*
+  $Id: wishlist.php,v 2.2 2004/09/12 23:42:27 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+
+  CRE Loaded , Open Source E-Commerce Solutions
+  http://www.creloaded.com
+ 
+  Chain Reaction Works, Inc
+  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
+  
+  Last Modified by $Author$
+  Last Modifed on : $Date$
+  Latest Revision : $Revision: 1609 $
+
+  Released under the GNU General Public License
+
+*/
+?>
+<!-- wishlist //-->
+<?php
+if (basename($PHP_SELF) != FILENAME_WISHLIST_SEND){
+if (basename($PHP_SELF) != FILENAME_WISHLIST)   {
+?> 
+          <tr>
+            <td>
+<?php
+  // retreive the wishlist
+  if (tep_session_is_registered('customer_id')) {
+    $wishlist_query_raw = "select * from " . TABLE_WISHLIST . " where customers_id = '" . $customer_id . "' and products_id > 0 order by products_name";  
+    $wishlist_query = tep_db_query($wishlist_query_raw);
+
+    // if we have something in this clients list:
+    ?>
+    <!-- customer_wishlist //-->
+    <script type="text/javascript"><!--
+    function popupWindowWishlist(url) {
+      window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=425,height=475,screenX=150,screenY=150,top=150,left=150')
+    }
+    //--></script>
+    <?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text'  => '<font color="' . $font_color . '">' . BOX_HEADING_WISHLIST . '</font>');
+    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_WISHLIST, '','NONSSL'));
+    
+    $info_box_contents = array();
+    
+    if (tep_db_num_rows($wishlist_query)) {
+      if (tep_db_num_rows($wishlist_query) < MAX_DISPLAY_WISHLIST_BOX) {
+
+        $product_ids = '';
+        while ($wishlist = tep_db_fetch_array($wishlist_query)) {
+          $product_ids .= $wishlist['products_id'] . ',';
+         }
+        $product_ids = substr($product_ids, 0, -1);        
+       
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        //  $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . $product_ids . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        $products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id in (" . $product_ids . ") and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
+        while ($products = tep_db_fetch_array($products_query)) {
+          $customer_wishlist_string .= '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a></td>' . "\n" .
+                                                  '</tr>' . "\n" .
+                                                  '<tr>' . "\n" .
+                                                  '<td class="infoBoxContents" align="center" valign="bottom"><b><a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_MOVE_TO_CART . '</a>&nbsp;|' . "\n" .
+                                                  '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">' . BOX_TEXT_DELETE . '</a></b>' . "\n" .  tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td>' .
+                                                  '</td></tr>' . "\n";
+        }
+      } else {
+        $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+        $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . sprintf(TEXT_WISHLIST_COUNT, tep_db_num_rows($wishlist_query)) . '</td></tr>' . "\n";
+      }
+    } else {
+      $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
+      $customer_wishlist_string .= '<tr><td class="infoBoxContents">' . BOX_WISHLIST_EMPTY . '</td></tr>' . "\n";
+    }
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a></td></tr>' . "\n";
+    $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '','NONSSL') . '"><u> ' . BOX_HEADING_CUSTOMER_WISHLIST_HELP . '</u> [?]</a></td></tr>' . "\n"; // Normal link
+    $customer_wishlist_string .= '</table>';
+
+    $info_box_contents[] = array('align' => 'left',
+                                              'text'  => $customer_wishlist_string);
+
+    new infoBox($info_box_contents);
+   if (TEMPLATE_INCLUDE_FOOTER =='true'){
+       $info_box_contents = array();
+        $info_box_contents[] = array('align' => 'left',
+                                      'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                    );
+   new infoboxFooter($info_box_contents);
+ }}
+?>
+            </td>
+          </tr>
+          <?php
+    }}
+?><!-- wishlist_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/boxes.tpl.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/boxes.tpl.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/boxes.tpl.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,413 @@
+<?php
+/*
+  $Id: boxes.tpl.php,v 1.6
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  class tableBox {
+
+var     $table_border, $table_width, $table_cellspacing, $table_cellpadding, $table_parameters;
+var     $table_row_parameters, $table_data_parameters;
+var     $footer_image_left_corner, $footer_image_right_corner, $footer_image_right_arrow;
+
+
+// class constructor
+    function tableBox($contents, $direct_output = false) {
+ 
+    $this->table_border = TEMPLATE_TABLE_BORDER;
+    $this->table_width = TEMPLATE_TABLE_WIDTH;
+    $this->table_cellspacing = TEMPLATE_TABLE_CELLSPACING;
+ //   $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;
+    //$this->table_parameters = TEMPLATE_TABLE_PARAMETERS;
+    $this->table_row_parameters = TEMPLATE_TABLE_ROW_PARAMETERS;
+    $this->table_data_parameters = TEMPLATE_TABLE_DATA_PARAMETERS;
+    $this->table_content_cellpadding = TEMPLATE_TABLE_CONTENT_CELLPADING;
+    
+    
+    $this->footer_image_left_corner = TEMPLATE_BOX_IMAGE_FOOTER_LEFT;
+    $this->footer_image_right_corner = TEMPLATE_BOX_IMAGE_FOOTER_RIGHT;
+    $this->footer_image_right_arrow = TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW;
+    
+    
+      $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
+      if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
+      $tableBox_string .= '>' . "\n";
+
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
+        $tableBox_string .= '  <tr';
+        if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
+        if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
+        $tableBox_string .= '>' . "\n";
+
+        if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
+          for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
+            if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
+              $tableBox_string .= '    <td';
+              if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
+              if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
+                $tableBox_string .= ' ' . $contents[$i][$x]['params'];
+              } elseif (tep_not_null($this->table_data_parameters)) {
+                $tableBox_string .= ' ' . $this->table_data_parameters;
+              }
+              $tableBox_string .= '>';
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
+              $tableBox_string .= $contents[$i][$x]['text'];
+              if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
+              $tableBox_string .= '</td>' . "\n";
+            }
+          }
+        } else {
+  if (TEMPLATE_BOX_MIDDLE_LEFT_IMAGE !== '') {
+          $tableBox_string .= '<td align="left"  width="'.SIDE_BOX_LEFT_WIDTH.'" style="background-image: url(\'' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif\');background-repeat: repeat-y;"><img src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif" alt="box" width="'.SIDE_BOX_LEFT_WIDTH.'" height="1"></td>';
+  }
+      $tableBox_string .= '<td';
+          if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
+          if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
+            $tableBox_string .= ' ' . $contents[$i]['params'];
+          } elseif (tep_not_null($this->table_data_parameters)) {
+            $tableBox_string .= ' ' . $this->table_data_parameters;
+          }
+          $tableBox_string .= '>' . $contents[$i]['text'] . '</td>';
+  if (TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE !== '') {
+          $tableBox_string .= '<td width="'.SIDE_BOX_RIGHT_WIDTH.'" style="background-image: url(\'' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif\');background-repeat: repeat-y;"><img src="' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif" alt="'.BOX_ALT.'" width="'.SIDE_BOX_RIGHT_WIDTH.'" height="1"></td>' . "\n";
+  }
+        }
+
+        $tableBox_string .= '  </tr>' . "\n";
+        if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
+      }
+
+      $tableBox_string .= '</table>' . "\n";
+
+      if ($direct_output == true) echo $tableBox_string;
+
+      return $tableBox_string;
+    }
+  }
+
+class categoriesBox extends tableBox {
+function categoriesBox($contents) {
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->categoriesBoxContents($contents));
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $this->tableBox($info_box_contents, true);
+    }
+
+function categoriesBoxContents($contents) {
+      $this->table_cellpadding = '0';
+      $this->table_class = 'noclass';
+      $info_box_contents = array();
+      for ($i=0; $i<sizeof($contents); $i++) {
+        $info_box_contents[] = array(array('align' => 'center', 'params' => 'class="noclass"', 'text' => $contents[$i]['text']));
+      }
+      return $this->tableBox($info_box_contents);
+    }
+}
+
+  class infoBox extends tableBox {
+    function infoBox($contents) {
+    //setting defined in template.php
+        $this->table_border = TEMPLATE_TABLE_BORDER;
+        $this->table_width = TEMPLATE_TABLE_WIDTH;
+        $this->table_cellspacing = TEMPLATE_TABLE_CELLSPACING;
+        $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;
+        $this->table_parameters = TEMPLATE_TABLE_PARAMETERS;
+        $this->table_data_parameters = TEMPLATE_TABLE_DATA_PARAMETERS;
+        
+     
+      //  images for header
+        
+        $this->footer_image_left_corner = TEMPLATE_BOX_IMAGE_FOOTER_LEFT;
+        $this->footer_image_right_corner = TEMPLATE_BOX_IMAGE_FOOTER_RIGHT;
+        $this->footer_image_leftright = TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT;
+        $this->footer_image_right_arrow = TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW;
+        $this->footer_image_background = TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND;
+    
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
+      $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;
+      $this->table_parameters = 'class="templateinfoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function infoBoxContents($contents) {
+      $this->table_cellpadding = TEMPLATE_TABLE_CONTENT_CELLPADING;
+      $this->table_parameters = 'class="infoBoxContents"';
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
+        $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
+                                           'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
+                                           'params' => 'class="boxText"',
+                                           'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
+      }
+      $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
+      return $this->tableBox($info_box_contents);
+    }
+  }
+
+  class infoBoxHeading extends tableBox {
+    function infoBoxHeading($contents, $right_link = '') {
+       $this->table_width = TEMPLATE_TABLE_WIDTH;
+       $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;
+
+      if (TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFT == 'true') {
+        $left_corner = tep_image(TEMPLATE_BOX_IMAGE_TOP_LEFT);
+      } else {
+        $left_corner = tep_image(TEMPLATE_BOX_IMAGE_TOP_LEFTRIGHT);
+      }
+
+      if (TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFTRIGHT == 'true') {
+            if (tep_not_null($right_link)) {
+               $right_arrow = '<a href="' . $right_link . '">' . tep_image(TEMPLATE_BOX_IMAGE_TOP_RIGHTARROW, ICON_ARROW_RIGHT) . '</a>';
+            } else {
+               $right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);
+            }
+      } else {
+              $right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);
+      }
+      
+      if (TEMPLATE_BOX_IMAGE_BORDER_TOP_RIGHT == 'true') {
+        $right_corner = tep_image(TEMPLATE_BOX_IMAGE_TOP_RIGHT);
+      } else {
+         $right_corner = tep_image(TEMPLATE_BOX_IMAGE_TOP_LEFTRIGHT);
+      }
+ 
+     if (tep_not_null($right_link) ){
+           $left_corner = $left_corner;
+           $right_corner = $right_arrow;
+      }else{
+            $left_corner = $left_corner;
+            $right_corner = $right_corner;
+      }
+ 
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
+                                         'text' => $left_corner),
+                                   array('params' => 'width="100%" height="14" class="infoBoxHeadingImage"',
+                                         'text' => $contents[0]['text'] ),
+                                   array('params' => 'height="14" class="infoBoxHeading" nowrap',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class infoboxFooter extends tableBox {
+// var $footer_left_corner, $footer_right_corner, $footer_right_arrow;
+   
+    function infoboxFooter($contents) {
+          $this->table_width = TEMPLATE_TABLE_WIDTH;
+          $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;
+         $this->table_cellpadding = '0';
+       
+            $this->footer_left_corner = TEMPLATE_BOX_IMAGE_FOOTER_LEFT;
+            $this->footer_right_corner = TEMPLATE_BOX_IMAGE_FOOTER_RIGHT;
+            $this->footer_right_arrow = TEMPLATE_BOX_IMAGE_FOOTER_RIGHT_ARROW;
+
+
+      if (TEMPLATE_BOX_IMAGE_FOOTER_LEFT == 'true') {
+        $left_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_LEFT);
+      } else {
+        $left_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT);
+      }
+
+      if (TEMPLATE_BOX_IMAGE_FOOTER_LEFTRIGHT == 'true') {
+            if (tep_not_null($right_link)) {
+               $right_arrow = '<a href="' . $right_link . '">' . tep_image(TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW, ICON_ARROW_RIGHT) . '</a>';
+            } else {
+               $right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);
+            }
+      } else {
+              $right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);
+      }
+      
+      if (TEMPLATE_BOX_IMAGE_FOOTER_RIGHT == 'true') {
+        $right_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_RIGHT);
+      } else {
+         $right_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT);
+      }
+ 
+     if (tep_not_null($right_link) ){
+           $left_corner = $left_corner;
+           $right_corner = $right_arrow;
+      }else{
+            $left_corner = $left_corner;
+            $right_corner = $right_corner;
+      }
+ 
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'class="infoBoxFooter"',
+                                         'text' => $left_corner),
+                                   array('params' => ' align="center" style="background-image: url(' . TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND .'); background-repeat: repeat-x;" width="100%"  class="infoBoxHeading"',
+                 'text' => $contents[0]['text']),
+                                   array('params' => 'class="infoBoxFooter"',
+                                         'text' => $right_corner));
+$this->tableBox($info_box_contents, true);
+
+    }
+  }
+
+  class contentBox extends tableBox {
+  
+    function contentBox($contents) {
+            $this->table_border = TEMPLATE_TABLE_BORDER;
+            $this->table_width = TEMPLATE_TABLE_WIDTH;
+            $this->table_cellspacing = TEMPLATE_TABLE_CELLSPACING;
+            $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;
+            $this->table_parameters = TEMPLATE_TABLE_PARAMETERS;
+            $this->table_data_parameters = TEMPLATE_TABLE_DATA_PARAMETERS;
+            
+         
+          
+            $this->footer_image_left_corner = TEMPLATE_BOX_IMAGE_FOOTER_LEFT;
+            $this->footer_image_right_corner = TEMPLATE_BOX_IMAGE_FOOTER_RIGHT;
+            $this->footer_image_leftright = TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT;
+            $this->footer_image_right_arrow = TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW;
+            $this->footer_image_background = TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND;
+     
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
+      $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;
+      $this->table_parameters = 'class="templateinfoBox"';
+      $this->tableBox($info_box_contents, true);
+    }
+
+    function contentBoxContents($contents) {
+      $this->table_cellpadding = TEMPLATE_TABLE_CENTER_CONTENT_CELLPADING;
+      $this->table_parameters = 'class="infoBoxContentsCenter"';
+      return $this->tableBox($contents);
+    }
+  }
+
+  class contentBoxHeading extends tableBox {
+  
+    function contentBoxHeading($contents, $right_link) {
+      $this->table_width = TEMPLATE_TABLE_WIDTH;
+      $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;
+
+
+     $this->table_cellpadding = '0';
+
+      if (TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFT == 'true') {
+        $left_corner = tep_image(TEMPLATE_BOX_IMAGE_TOP_LEFT);
+      } else {
+        $left_corner = tep_image(TEMPLATE_BOX_IMAGE_TOP_LEFTRIGHT);
+      }
+
+      if (TEMPLATE_BOX_IMAGE_BORDER_TOP_LEFTRIGHT == 'true') {
+            if (tep_not_null($right_link)) {
+               $right_arrow = '<a href="' . $right_link . '">' . tep_image(TEMPLATE_BOX_IMAGE_TOP_RIGHTARROW, ICON_ARROW_RIGHT) . '</a>';
+            } else {
+               $right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);
+            }
+      } else {
+              $right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);
+      }
+      
+      if (TEMPLATE_BOX_IMAGE_BORDER_TOP_RIGHT == 'true') {
+        $right_corner = tep_image(TEMPLATE_BOX_IMAGE_TOP_RIGHT);
+      } else {
+         $right_corner = tep_image(TEMPLATE_BOX_IMAGE_TOP_LEFTRIGHT);
+      }
+ 
+     if (tep_not_null($right_link) ){
+           $left_corner = $left_corner;
+           $right_corner = $right_arrow;
+      }else{
+            $left_corner = $left_corner;
+            $right_corner = $right_corner;
+      }
+ 
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxContentsHeader"',
+                                         'text' => $left_corner),
+                                   array('params' => ' align="center" style="background-image: url(' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/background.gif); background-repeat: repeat-x;" width="100%"  class="infoBoxContentsHeader"',
+                 'text' => $contents[0]['text']),
+                                   array('params' => 'height="14" class="infoBoxContentsHeader"',
+                                         'text' => $right_corner));
+
+      $this->tableBox($info_box_contents, true);
+    }
+  }
+
+  class contentBoxFooter extends tableBox {
+//  var $footer_image_left_corner, $footer_image_right_corner, $footer_image_right_arrow;
+  
+    function contentBoxFooter($contents, $right_link='') {
+          $this->table_width = TEMPLATE_TABLE_WIDTH;
+          $this->table_cellpadding = TEMPLATE_TABLE_CELLPADDIING;
+         $this->table_cellpadding = '0';
+       
+            $this->footer_left_corner = TEMPLATE_BOX_IMAGE_FOOTER_LEFT;
+            $this->footer_right_corner = TEMPLATE_BOX_IMAGE_FOOTER_RIGHT;
+            $this->footer_right_arrow = TEMPLATE_BOX_IMAGE_FOOTER_RIGHT_ARROW;
+
+
+      if (TEMPLATE_BOX_IMAGE_FOOTER_LEFT == 'true') {
+        $left_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_LEFT);
+      } else {
+        $left_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT);
+      }
+
+      if (TEMPLATE_BOX_IMAGE_FOOTER_LEFTRIGHT == 'true') {
+            if (tep_not_null($right_link)) {
+               $right_arrow = '<a href="' . $right_link . '">' . tep_image(TEMPLATE_BOX_IMAGE_FOOTER_IMAGE_RIGHT_ARROW, ICON_ARROW_RIGHT) . '</a>';
+            } else {
+               $right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);
+            }
+      } else {
+              $right_arrow = tep_image(TEMPLATE_BOX_IMAGE_TOP_NOARROW);
+      }
+      
+      if (TEMPLATE_BOX_IMAGE_FOOTER_RIGHT == 'true') {
+        $right_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_RIGHT);
+      } else {
+         $right_corner = tep_image(TEMPLATE_BOX_IMAGE_FOOT_LEFTRIGHT);
+      }
+ 
+     if (tep_not_null($right_link) ){
+           $left_corner = $left_corner;
+           $right_corner = $right_arrow;
+      }else{
+            $left_corner = $left_corner;
+            $right_corner = $right_corner;
+      }
+ 
+      $info_box_contents = array();
+      $info_box_contents[] = array(array('params' => 'class="infoBoxContentsfooter"',
+                                         'text' => $left_corner),
+                                   array('params' => ' align="center" style="background-image: url(' . TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND .'); background-repeat: repeat-x;" width="100%"  class="infoBoxContentsfooter"',
+                 'text' => $contents[0]['text']),
+                                   array('params' => 'class="infoBoxContentsfooter"',
+                                         'text' => $right_corner));
+$this->tableBox($info_box_contents, true);
+
+
+    }
+  }
+
+
+  class errorBox extends tableBox {
+    function errorBox($contents) {
+      $this->table_data_parameters = 'class="errorBox"';
+      $this->tableBox($contents, true);
+    }
+  }
+
+  class productListingBox extends tableBox {
+    function productListingBox($contents) {
+      $this->table_parameters = 'class="productListing"';
+      $this->tableBox($contents, true);
+    }
+  }
+
+?>

Added: trunk/direct.openmoko.com/templates/default/extra_html_output.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/extra_html_output.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/extra_html_output.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,193 @@
+<?php
+
+////
+// The HTML form submit button wrapper function
+// Outputs a button in the selected language
+  function tep_template_image_submit($image, $alt = '', $parameters = '') {
+    global $language;
+
+    $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
+
+    if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
+
+    if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
+
+    $image_submit .= '>';
+
+    return $image_submit;
+  }
+
+////
+// Output a function button in the selected language
+  function tep_template_image_button($image, $alt = '', $parameters = '') {
+    global $language;
+
+    return tep_image(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/buttons/' . $language . '/' .  $image, $alt, '', '', $parameters);
+  }
+
+
+  function table_image_border_top($left, $right,$header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+                     <tr>
+                      <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                                <tr>
+                                  <td class="main_table_heading_inner"><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td>
+
+<?php
+}
+
+}
+  function table_image_border_bottom(){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+                                    </table></td>
+                                </tr>
+                              </table></td>
+                          </tr>
+      </table></td>
+  </tr>
+      </table></td>
+  </tr>
+      </table>
+      <!--Lango Added for Template MOD: EOF-->
+<?php
+}
+}
+
+
+  function table_image_main_border_top($left, $right, $header){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                     <tr>
+                      <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                                <tr>
+                                  <td><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td class="infoBoxHeading"><?php echo $header;?></td>
+                                      </tr>
+                                    </table></td>
+                                </tr>
+
+                              </table></td>
+                          </tr>
+
+      </table></td>
+  </tr>
+  <tr>
+<td valign="top" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+
+                     <tr>
+                      <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                          <tr>
+
+                            <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
+                                <tr>
+                                  <td class="main_table_heading_inner"><table width="100%" border="0" cellspacing="0" cellpadding="4">
+                                      <tr>
+                                        <td>
+
+<?php
+}
+
+}
+
+
+  function table_image_main_border_bottom(){
+if (MAIN_TABLE_BORDER == 'yes'){
+?>
+         </table></td>
+        </tr>
+         </table></td>
+        </tr>
+      </table></td>
+  </tr>
+      </table></td>
+  </tr>
+      </table>
+      <!--Lango Added for Template MOD: EOF-->
+<?php
+}
+}
+
+
+// this function is used to product a header for module sused as center content.
+//it is used with the function table_center_module_footer
+  function table_center_module_header($header1){
+?>
+      <!--Lango Added for Template MOD: BOF-->
+  <tr><td>    
+<?php
+echo '<table border="' . tep_output_string(TEMPLATE_TABLE_BORDER) . '" width="' . tep_output_string(TEMPLATE_TABLE_WIDTH) . '" cellspacing="' . tep_output_string(TEMPLATE_TABLE_CELLSPACING) . '" cellpadding="' . tep_output_string(TEMPLATE_TABLE_CELLPADDIING) . '">';
+
+?>
+
+  <tr>
+    <td height="14" class="infoBoxHeading"><?php echo tep_image(TEMPLATE_BOX_IMAGE_TOP_LEFT,  'image', '', '', 'border=\"0\"');?></td>
+    <td width="100%" align ="center" height="14" class="infoBoxHeadingImage"><?php echo $header1 ;?></td>
+    <td height="14" class="infoBoxHeading" nowrap><?php echo tep_image(TEMPLATE_BOX_IMAGE_TOP_RIGHT,  'image', '', '', 'border=\"0\"');?></td>
+  </tr>
+</table>
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo TEMPLATE_TABLE_CENTER_CONTENT_CELLPADING;?>" class="templateinfoBox">
+  <tr>
+<?php echo '<td align="left"  width="'. CELLPADDING_SUB .'" style="background-image: url(\'' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_l.gif\');background-repeat: repeat-y; background-width: ' . CELLPADDING_SUB . ';"></td>  <td';
+ ?>
+ <table border="0" width="100%" cellspacing="0" cellpadding="' . TEMPLATE_TABLE_CENTER_CONTENT_CELLPADING . '" >
+   <tr>
+    <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
+  </tr>
+      <?php
+      //begin body
+      ?>
+<?php
+}
+
+
+function table_center_module_footer(){
+?>
+</table>
+</td>
+<?php echo '<td width="'.SIDE_BOX_RIGHT_WIDTH.'" style="background-image: url(\'' . DIR_WS_TEMPLATES . TEMPLATE_NAME . '/images/infobox/box_bg_r.gif\');background-repeat: repeat-y;"></td>' . "\n";
+  ?>
+  </tr>
+</table>
+<?php
+ //footer code
+ if (TEMPLATE_INCLUDE_FOOTER =='true'){
+ ?>
+ <table border="0" width="100%" cellspacing="0" cellpadding="0">
+   <tr>
+     <td class="infoBoxFooter"><img src="<?php echo TEMPLATE_BOX_IMAGE_FOOT_LEFT ;?>" border="0" alt=""></td>
+     <td  align="center" style="background-image: url(<?php echo TEMPLATE_BOX_IMAGE_FOOT_BACKGROUND ;?>); background-repeat: repeat-x; background-position: right;" width="100%"  class="infoBoxFooterImage"><img src="images/pixel_trans.gif" border="0" alt="image" width="100%" height="1"></td>
+     <td class="infoBoxFooter"><img src="<?php echo TEMPLATE_BOX_IMAGE_FOOT_RIGHT ;?>" border="0" alt="image" ></td>
+   </tr>
+</table>
+<?php
+} else{
+
+}
+
+
+ ?>
+ </td></tr>
+<?php
+}
+?>

Added: trunk/direct.openmoko.com/templates/default/images/chr01.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/default/images/chr01.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/default/images/chr02.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/default/images/chr02.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/default/images/chr03.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/default/images/chr03.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/default/images/chr04.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/default/images/chr04.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/default/images/chr05.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/default/images/chr05.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/default/images/logo.gif
===================================================================
(Binary files differ)


Property changes on: trunk/direct.openmoko.com/templates/default/images/logo.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/articles.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/articles.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/articles.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,143 @@
+<!-- articles //-->
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/article_mainpage.php');
+  
+        $listing_sql = "select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id
+                        from " . TABLE_ARTICLES . " a,
+                             " . TABLE_ARTICLES_DESCRIPTION . " ad,
+                             " . TABLE_AUTHORS . " au,
+                             " . TABLE_ARTICLES_TO_TOPICS . " a2t,
+                             " . TABLE_TOPICS_DESCRIPTION . " td
+                        where a.articles_status = '1'
+                          and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))
+                          and a.authors_id = au.authors_id
+                          and a.articles_id = a2t.articles_id
+                          and ad.articles_id = a2t.articles_id
+                          and td.topics_id = a2t.topics_id
+                          and ad.language_id = '" . (int)$languages_id . "'
+                          and td.language_id = '" . (int)$languages_id . "'
+                        order by rand(), a.articles_date_added desc, ad.articles_name limit " . MAX_DISPLAY_MODULES_ARTICLES ;
+
+$header_text =  TABLE_HEADING_NEW_ARTICLES;
+?>
+<tr>
+<td valign="top" width="100%">
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+
+<?php
+//header
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TABLE_HEADING_NEW_ARTICLES);
+
+  new contentBoxHeading($info_box_contents, '');
+
+?>
+
+    <table width="100%" border="0" cellspacing="0" cellpadding="0">
+       <tr>
+       <td cellpadding="0" align="left"  width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" height="1"></td>
+          <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+            <tr>
+              <td class ="templateinfobox"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                       <tr>
+                        <td class= "boxText">
+                         <table width="100%"  border="0" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB ;?>">
+  
+
+            <tr>
+              <td class="main"><?php echo $topic['topics_description']; ?></td>
+            </tr>
+            <?php if (tep_not_null($authors_description)) { ?>
+            <tr>
+              <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+            </tr>
+            <tr>
+              <td class="main" valign="top"><?php echo $authors_description; ?></td>
+            <tr>
+              <?php } ?>
+              <?php
+              if (tep_not_null($authors_url)) { 
+              ?>
+            <tr>
+              <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+            </tr>
+            <tr">
+              <td class="main" valign="top"><?php echo sprintf(TEXT_MORE_INFORMATION, $authors_url); ?></td>
+            </tr>
+            <?php }
+            ?>
+
+ 
+       </tr> 
+       <tr>
+         <td class="main"><?php echo TEXT_ARTICLES; ?></td>
+      </tr>
+
+<?php
+           $articles_listing_query = tep_db_query($listing_sql);
+    while ($articles_listing = tep_db_fetch_array($articles_listing_query)) {
+?>
+          <tr>
+            <td valign="top" class="main" width="75%">
+<?php
+  echo '<a href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $articles_listing['articles_id']) . '"><b>' . $articles_listing['articles_name'] . '</b></a> ';
+  if (DISPLAY_AUTHOR_ARTICLE_LISTING == 'true' && tep_not_null($articles_listing['authors_name'])) {
+   echo TEXT_BY . ' ' . '<a href="' . tep_href_link(FILENAME_ARTICLES, 'authors_id=' . $articles_listing['authors_id']) . '"> ' . $articles_listing['authors_name'] . '</a>';
+  }
+?>
+            </td>
+<?php
+   //   if (DISPLAY_TOPIC_ARTICLE_LISTING == 'true' && tep_not_null($articles_listing['topics_name'])) {
+?>
+            <td valign="top" class="main" width="25%" nowrap><?php echo TEXT_TOPIC . '&nbsp;<a href="' . tep_href_link(FILENAME_ARTICLES, 'tPath=' . $articles_listing['topics_id']) . '">' . $articles_listing['topics_name'] . '</a>'; ?></td>
+<?php
+   //   }
+?>
+          </tr>
+<?php
+   //   if (DISPLAY_ABSTRACT_ARTICLE_LISTING == 'true') {
+?>
+          <tr>
+            <td class="main" style="padding-left:15px"><?php echo clean_html_comments(substr($articles_listing['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_listing['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>
+          </tr>
+<?php
+   //   }
+      if (DISPLAY_DATE_ADDED_ARTICLE_LISTING == 'true') {
+?>
+          <tr>
+            <td class="smalltext" style="padding-left:15px"><?php echo TEXT_DATE_ADDED . ' ' . tep_date_long($articles_listing['articles_date_added']); ?></td>
+          </tr>
+
+<?php
+ }
+    } // End of listing loop
+ ?>
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+  
+                      </tr>
+                     </table></td>  
+                   </tr>
+               </table></td> 
+            </tr> 
+         </table></td> 
+  <td cellpadding="0" cellspacing="0" align="left" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" height="1"></td>
+      </tr>
+  </table></td>    
+  </tr>
+</table>
+
+<?php
+
+ if (TEMPLATE_INCLUDE_FOOTER =='true'){
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                 'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                               );
+  new contentBoxFooter($info_box_contents);
+}
+?>
+<!--articles_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/default_specials.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/default_specials.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/default_specials.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,74 @@
+<?php
+/*
+  $Id: default_specials.php,v 2.0 2003/06/13
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- D default_specials //-->
+<?php
+    $info_box_contents = array();
+    $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
+
+$new10 = tep_db_query("select distinct 
+ p.products_id,
+ pd.products_name, 
+ p.products_tax_class_id,
+ p.products_image 
+ from " . TABLE_PRODUCTS . " p, 
+ " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+ " . TABLE_SPECIALS . " s 
+ where 
+   p.products_status = '1' 
+   and p.products_id = s.products_id 
+   and pd.products_id = s.products_id 
+   and pd.language_id = '" . (int)$languages_id . "' 
+   and s.status = '1' 
+ order by rand(),  s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS);
+ 
+//Eversun mod end for sppc and qty price breaks
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+ while ($default_specials_1a = tep_db_fetch_array($new10)) {
+
+    $num ++;
+      if ($num == 1) {
+    new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_SPECIALS));
+       }
+
+
+  $pf->loadProduct($default_specials_1a['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+
+        $buyitnow='<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $default_specials_1a['products_id']) . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
+ 
+ $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials_1a['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $default_specials_1a['products_image'], $default_specials_1a['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials_1a['products_id']) . '">' . $default_specials_1a['products_name'] . '</a><br>' . $products_price_s . '<br>'. $buyitnow);
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+  
+if($num) {
+ new contentBox($info_box_contents);
+if (TEMPLATE_INCLUDE_FOOTER =='true'){
+     $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+ new contentBoxFooter($info_box_contents);
+ } }
+?>
+
+<!-- D default_specials_eof //-->

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/example.html
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/example.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/example.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<table width="100%" border="0" bgcolor="FFA814" cellspacing="0" cellpadding="0">
+  <tr>
+    <td bgcolor="#CCCCCC">
+    <table width="100%" border="0" cellpadding="0" cellspacing="1">
+      <tr>
+        <td class="infoBoxHeading">
+        Example HTML Mainpage Module</td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+  <tr>
+    <td valign="top" width="100%">
+    <table width="100%" border="0" class="infobox" cellspacing="0" cellpadding="1">
+      <tr>
+        <td valign="top" width="100%">
+        <table width="100%" border="0" class="infoboxContents" cellspacing="0" cellpadding="0">
+      <!-- change from here to next-->
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+          <tr>
+            <td align="center">
+            <img width="426" height="75" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr01.gif" border="0"></td>
+          </tr>
+          <tr>
+            <td valign="top" align="center">
+            <img valign="top" width="117" height="90" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr02.gif" border="0"></a><img width="117" height="90" valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr03.gif" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr04.gif" height="90" width="96" border="0"><img valign="top" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME;?>/images/chr05.gif" width="96" height="90" border="0"></td>
+          </tr>
+      <tr>
+        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+      </tr>
+      <!-- change from here to above-->
+        </table>
+        </td>
+      </tr>
+    </table>
+    </td>
+  </tr>
+</table>

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/faq.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/faq.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/faq.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,73 @@
+<?php
+  require(DIR_WS_LANGUAGES . $language . '/faq_mainpage.php');
+
+$faq_categories_query_1 = tep_db_query("select ic.categories_id, icd.categories_name from " . TABLE_FAQ_CATEGORIES . " ic, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " icd where icd.categories_id = ic.categories_id and icd.language_id = '" . (int)$languages_id . "' and ic.categories_status = '1' order by rand() limit " . MAX_DISPLAY_MODULES_FAQ_CATEGORY);
+?>
+<tr>
+<td valign="top" width="100%">
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+
+<?php
+//header
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => TABLE_HEADING_NEW_FAQ);
+
+  new contentBoxHeading($info_box_contents, '');
+
+?>
+
+    <table width="100%" border="0" cellspacing="0" cellpadding="0">
+       <tr>
+       <td cellpadding="0" align="left"  width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" height="1"></td>
+          <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+            <tr>
+              <td class ="templateinfobox"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                       <tr>
+                        <td class= "boxText">
+                         <table width="100%"  border="0" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB ;?>">
+  
+<?php
+echo '<tr><td class="main" valign="top">';
+  while ($faq_categories_1 = tep_db_fetch_array($faq_categories_query_1)) {
+   $faq_categories_1_id = $faq_categories_1['categories_id'];
+   echo '<a href="' . tep_href_link(FILENAME_FAQ, 'cID=' . $faq_categories_1['categories_id']) . '">' . $faq_categories_1['categories_name'] . '</a><br>';
+    
+  $faq_query_a = tep_db_query("select ip.faq_id, ip.question from " . TABLE_FAQ . " ip, " . TABLE_FAQ_TO_CATEGORIES . " ip2c where ip.faq_id = ip2c.faq_id and ip2c.categories_id = '" . $faq_categories_1_id . "' and ip.visible = '1' ");
+  while ($faq_a = tep_db_fetch_array($faq_query_a)) {
+    echo '<a href="' . tep_href_link(FILENAME_FAQ, 'fID=' . $faq_a['faq_id']) . '">' . $faq_a['question'] . '</a><br>';
+
+   }
+ } 
+echo '</td></tr>';  
+?>
+
+          <tr>
+            <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+          </tr>
+  
+                      </tr>
+                     </table></td>  
+                   </tr>
+               </table></td> 
+            </tr> 
+         </table></td> 
+  <td cellpadding="0" cellspacing="0" align="left" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" height="1"></td>
+      </tr>
+  </table></td>    
+  </tr>
+</table>
+
+<?php
+
+ if (TEMPLATE_INCLUDE_FOOTER =='true'){
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                 'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                               );
+  new contentBoxFooter($info_box_contents);
+}
+?>
+
+<!--faq mainpage //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/featured.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/featured.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/featured.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,77 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+
+  Featured Products V1.1
+  Displays a list of featured products, selected from admin
+  For use as an Infobox instead of the "New Products" Infobox
+*/
+?>
+<!-- D featured_products_mainpage //-->
+<?php
+ 
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+//Eversun mod for sppc and qty price breaks
+      $featured_products_2bb_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_image 
+         from (" . TABLE_PRODUCTS . " p 
+         left join " . TABLE_SPECIALS . " s using(products_id)),
+          " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+          " . TABLE_FEATURED . " f
+          where 
+          p.products_status = '1'
+          and f.status ='1'
+          and p.products_id = f.products_id
+                            and pd.products_id = p.products_id
+                            and pd.language_id = '" . $languages_id . "'
+                            order by rand(), p.products_date_added DESC, pd.products_name");
+   
+   $featured_products_2bb_check = tep_db_num_rows($featured_products_2bb_query);
+     if ($featured_products_2bb_check > 0){
+   
+ 
+ $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($featured_products_2bb = tep_db_fetch_array($featured_products_2bb_query)) {
+
+    $num ++;
+  
+    if ($num == 1) {
+    new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+    }    
+
+  $pf->loadProduct($featured_products_2bb['products_id'],$languages_id);
+        $products_price_2bb = $pf->getPriceStringShort();
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products_2bb['products_image'], $featured_products_2bb['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_2bb['products_id']) . '">' . $featured_products_2bb['products_name'] . '</a><br>' . $products_price_2bb);
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+      new contentBox($info_box_contents);
+if (TEMPLATE_INCLUDE_FOOTER =='true'){
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+ new contentBoxFooter($info_box_contents);
+ }
+} 
+?>
+<!-- featured_products_eof //-->

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/featured_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/featured_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/featured_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,124 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Featured Products Listing Module
+*/
+?>
+<!--D featured_prodcts-->
+<?php
+ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FEATURED_PRODUCTS);
+
+ $featured_products2_query = tep_db_query("select distinct
+                           p.products_image, 
+                           p.products_id,
+                           pd.products_name,
+         p.products_price as final_price,
+         p.products_date_added,
+         p.manufacturers_id
+         from " . TABLE_PRODUCTS . " p,
+          " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+          " . TABLE_FEATURED . " f
+          where 
+          p.products_status = '1'
+          and f.status ='1'
+          and p.products_id = f.products_id
+                            and pd.products_id = p.products_id
+                            and pd.language_id = '" . $languages_id . "'
+                                   order by rand(), p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
+   
+  $row = 0;
+  $col = 0;
+  $num = 0;
+   $featured_products2_check = tep_db_num_rows($featured_products2_query);
+     if ($featured_products2_check > 0){
+  
+  
+  while ($featured_products4 = tep_db_fetch_array($featured_products2_query)) {
+   $num ++;
+   $featured_products4_array[] = array('id' => $featured_products4['products_id'],
+                                  'name' => $featured_products4['products_name'],
+                                  'image' => $featured_products4['products_image'],
+                                  'price' => $featured_products4['products_price'],
+                                  'tax_class_id' => $featured_products4['products_tax_class_id'],
+                                  'date_added' => tep_date_long($featured_products4['products_date_added']),
+                                  'manufacturer' => tep_get_manufacturers_name($featured_products4['manufacturers_id'])   );
+  }
+  
+ // BOF: Lango Added for template MOD
+ 
+
+  
+    for($i=0; $i<sizeof($featured_products4_array); $i++) {
+  $pf->loadProduct($featured_products4_array[$i]['id'],$languages_id);
+        $products_price = $pf->getPriceStringShort();
+  // }
+
+$featured_string1a .= '  <tr>' .
+                   '    <td class= "boxText" width="100%" align="center" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products4_array[$i]['id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $featured_products4_array[$i]['image'], $featured_products4_array[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br>' .
+                   '    <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products4_array[$i]['id'], 'NONSSL') . '"><b><u>' . $featured_products4_array[$i]['name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . $featured_products4_array[$i]['date_added'] . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products4_array[$i]['manufacturer'] . '<br>' . TEXT_PRICE . ' ' . $products_price . '<br>' .
+                   '    <a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=buy_now&amp;products_id=' . $featured_products4_array[$i]['id'], 'NONSSL') . '">' . tep_template_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a></td>' .
+                   '  </tr>' ;
+
+    
+  }
+//build box  
+?>
+ <tr>
+<td valign="top" width="100%">
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+ <?php
+ 
+ 
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS);
+
+ new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_FEATURED_PRODUCTS));
+?>
+  
+    <table width="100%" border="0" cellspacing="0" cellpadding="0">
+       <tr>
+       <td cellpadding="0" align="left"  width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" height="1"></td>
+          <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+            <tr>
+              <td class ="templateinfobox"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                       <tr>
+                        <td class= "boxText">
+                         <table width="100%"  border="0" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB ;?>">
+      
+<?php       
+     echo $featured_string1a;
+  ?>            
+                       
+                       </tr>
+                     </table></td>  
+                   </tr>
+               </table></td> 
+            </tr> 
+         </table></td> 
+  <td cellpadding="0" cellspacing="0" align="left" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" height="1"></td>
+      </tr>
+  </table></td>    
+  </tr>
+</table>
+
+<?php 
+////// footer here  
+
+      new contentBox($info_box_contents1);
+if (TEMPLATE_INCLUDE_FOOTER =='true'){
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+ new contentBoxFooter($info_box_contents);
+ }
+} 
+?>

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/main_categories.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/main_categories.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/main_categories.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,187 @@
+<?php
+/*
+  $Id: main_categories.php,v 1.0a 2002/08/01 10:37:00 Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com/
+
+  Copyright (c) 2002 Barreto
+  Gustavo Barreto <gustavo at barreto.net>
+  http://www.barreto.net/
+
+  Based on: all_categories.php Ver. 1.6 by Christian Lescuyer
+
+  History: 1.0 Creation
+     1.0a Correction: Extra Carriage Returns
+     1.1  added parameters to change display options -- mdt
+
+  Released under the GNU General Public License
+
+*/
+
+//------------------------------------------------------------------------------------------------------
+// PARAMETERS
+//------------------------------------------------------------------------------------------------------
+
+$item_column_number = 3;    // range of 1 to 9
+$item_title_on_newline = true;  // true or false
+
+// for item and subcategory options, suugest that you just put in CSS code
+// you can also just define a class and then change it in a template addon like BTS
+$item_div_options = 'style="text-align:center;font-weight:bold;font-size:larger;margin-top:5px;"';
+$item_subcategories_options = '';
+
+//------------------------------------------------------------------------------------------------------
+// CODE - do not change below here
+//------------------------------------------------------------------------------------------------------
+
+// error checking on parameters
+if($item_column_number < 1)
+{
+  $item_column_number = 1;
+}
+if($item_column_number > 9)
+{
+  $item_column_number = 9;
+}
+if($item_title_on_newline)
+{
+  $item_separator = '<br>';
+} else {
+  $item_separator = '&nbsp;';
+}
+
+// preorder_mc tree traversal
+  function preorder_mc($cid_cat, $level_cat, $foo_cat, $cpath_cat)
+  {
+    global $categories_string_cat, $HTTP_GET_VARS;
+
+// Display link
+    if ($cid_cat != 0) {
+      for ($i=0; $i<$level_cat; $i++)
+        $categories_string_cat .=  '&nbsp;&nbsp;';
+      $categories_string_cat .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath
+=' . $cpath_cat . $cid_cat) . '">';
+// 1.6 Are we on the "path" to selected category?
+      $bold = strstr($HTTP_GET_VARS['cPath'], $cpath_cat . $cid_cat . '_') || $HTTP_GET_VARS['cPath'] == $cpath_cat . $cid_cat;
+// 1.6 If yes, use <b>
+      if ($bold)
+        $categories_string_cat .=  '<b>';
+      $categories_string_cat .=  $foo_cat[$cid_cat]['name'];
+      if ($bold)
+        $categories_string_cat .=  '</b>';
+      $categories_string_cat .=  '</a>';
+// 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
+      if (SHOW_COUNTS == 'true') {
+        $products_in_category = tep_count_products_in_category($cid_cat);
+        if ($products_in_category > 0) {
+          $categories_string_cat .= '&nbsp;(' . $products_in_category . ')';
+        }
+      }
+      $categories_string_cat .= '<br>';
+    }
+
+// Traverse category tree
+    if (is_array($foo_cat)) {
+      foreach ($foo_cat as $key => $value) {
+        if ($foo_cat[$key]['parent'] == $cid_cat) {
+          preorder_mc($key, $level_cat+1, $foo_cat, ($level_cat != 0 ? $cpath_cat . $cid_cat . '_' : ''));
+        }
+      }
+    }
+  }
+
+?>
+<!-- main_categories //-->
+          <tr>
+            <td>
+<?php
+//////////
+// Display box heading
+//////////
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left', 'text'  => BOX_HEADING_CATEGORIES_MAIN_PAGE);
+  new contentBoxHeading($info_box_contents, '');
+
+
+//////////
+// Get categories list
+//////////
+
+$query_cat = "select 
+  c.categories_id, 
+  cd.categories_name, 
+  c.categories_image,
+  c.parent_id from 
+  " . TABLE_CATEGORIES . " c,
+  " . TABLE_CATEGORIES_DESCRIPTION . " cd 
+  where 
+  c.parent_id = '0' 
+ and c.categories_id = cd.categories_id 
+ and cd.language_id='" . $languages_id ."' 
+ order by sort_order, cd.categories_name";
+
+  $categories_query_cat = tep_db_query($query_cat);
+
+
+// Initiate tree traverse
+$categories_string_cat = '';
+preorder_mc(0, 0, $foo_cat, '');
+
+//////////
+// Display box contents
+//////////
+
+$info_box_contents = array();
+
+$row = 0;
+$col = 0;
+while ($categories_cat = tep_db_fetch_array($categories_query_cat))
+{
+  if ($categories['parent_id'] == 0)
+    {
+      $cpath_cat_new = tep_get_path($categories_cat['categories_id']);
+      $text_subcategories = '';
+      $subcategories_query_cat = tep_db_query($query_cat);
+      while ($subcategories_cat = tep_db_fetch_array($subcategories_query_cat))
+      {
+        if ($subcategories_cat['parent_id'] == $categories_cat['categories_id'])
+      {
+                $cPath_new_sub = "cPath="  . $categories_cat['categories_id'] . "_" . $subcategories_cat['categories_id'];
+                $text_subcategories .= '• <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">';
+                $text_subcategories .= $subcategories_cat['categories_name'] . '</a>' . " ";
+
+          } // if ($subcategories['parent_id'] == $categories['categories_id'])
+
+      } // while ($subcategories = tep_db_fetch_array($subcategories_query))
+
+    $info_box_contents[$row][$col] = array('align' => 'left',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<div '. $item_div_options . '><a href="' . tep_href_link(FILENAME_DEFAULT, $cpath_cat_new) . '">' . tep_image(DIR_WS_IMAGES . $categories_cat['categories_image'], $categories_cat['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories_cat['categories_name'] . '</a></DIV>');
+
+      // determine the column position to see if we need to go to a new row
+      $col ++;
+      if ($col > ($item_column_number - 1))
+      {
+          $col = 0;
+          $row ++;
+
+      } //if ($col > ($number_of_columns - 1))
+
+    } //if ($categories['parent_id'] == 0)
+
+} // while ($categories = tep_db_fetch_array($categories_query))
+
+//output the contents
+new contentBox($info_box_contents);
+if (TEMPLATE_INCLUDE_FOOTER =='true'){
+     $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left',
+                                    'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                                  );
+ new contentBoxFooter($info_box_contents);
+ } 
+
+?>
+
+<!-- main_categories_eof //-->

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/mainpage.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/mainpage.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/mainpage.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,37 @@
+<?php
+/*
+  $Id: mainpage.php,v 2.1 2004/04/07
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+  to change the contents of this file edit
+  includes/languages/(language)/mainpage.php
+*/
+?>
+<!-- D Main_page //-->
+
+
+<?php
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_top(false, false, HEADING_TITLE);
+}
+// EOF: Lango Added for template MOD
+
+
+include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE);
+
+
+
+// BOF: Lango Added for template MOD
+if (MAIN_TABLE_BORDER == 'yes'){
+table_image_border_bottom();
+}
+// EOF: Lango Added for template MOD
+?>
+
+<!-- Main_page eof //-->

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/new_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/new_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/new_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<?php
+/*
+  $Id: new_products.php,v 1.1.1.1 2004/03/04 23:41:14 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- D mainpages_modules.new_products.php//-->
+<?php
+
+//Eversun mod for sppc and qty price breaks
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
+
+  
+      $new_products_query = tep_db_query("select distinct
+                          p.products_id,
+                          p.products_price, 
+                          p.manufacturers_id,
+                          pd.products_name,
+                          p.products_tax_class_id, 
+                          p.products_date_added, 
+                          p.products_image 
+                          from (" . TABLE_PRODUCTS . " p 
+                         left join " . TABLE_SPECIALS . " s using(products_id)),
+                        " . TABLE_PRODUCTS_DESCRIPTION . " pd
+                        where 
+                        p.products_status = '1' 
+                       and pd.products_id = p.products_id
+                       and pd.language_id = '" . $languages_id . "' 
+                       and DATE_SUB(CURDATE(),INTERVAL " .NEW_PRODUCT_INTERVAL ." DAY) <= p.products_date_added  
+                       order by rand(), p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
+
+  
+
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($new_products = tep_db_fetch_array($new_products_query)) {
+  
+    $num ++;
+      if ($num == 1) { 
+  new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_PRODUCTS_NEW));
+      }
+
+  $pf->loadProduct($new_products['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+
+  
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $products_price_s);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+if (TEMPLATE_INCLUDE_FOOTER =='true'){
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+ new contentBoxFooter($info_box_contents);
+
+  }
+ }
+?>
+<!-- D new_products_eof //-->

Added: trunk/direct.openmoko.com/templates/default/mainpage_modules/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/mainpage_modules/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/mainpage_modules/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,71 @@
+<?php
+/*
+  $Id: upcoming_products.php,v 1.1.1.3 2004/04/07 23:42:23 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2004 osCommerce
+
+  Released under the GNU General Public License
+*/
+?>
+<!-- upcoming_products mainpage_modules //-->
+<?php
+  $info_box_contents = array();
+    $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_UPCOMING_PRODUCTS, strftime('%B')));
+
+  
+    $expected_query_raw= tep_db_query("select
+     p.products_id,
+     pd.products_name, 
+     p.products_image, 
+     products_date_available as date_expected 
+     from " . TABLE_PRODUCTS . " p, 
+          " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+    where 
+    to_days(products_date_available) >= to_days(now()) 
+    and p.products_id = pd.products_id 
+    and pd.language_id = '" . (int)$languages_id . "' 
+    order by rand()
+    limit " . MAX_DISPLAY_UPCOMING_PRODUCTS);
+
+  $row = 0;
+  $col = 0;
+  $num = 0;
+  while ($expected_query = tep_db_fetch_array($expected_query_raw)) {
+  
+    $num ++;
+      if ($num == 1) { 
+    new contentBoxHeading($info_box_contents, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
+      }
+  $pf->loadProduct($expected_query['products_id'],$languages_id);
+        $products_price_s = $pf->getPriceStringShort();
+    
+   $duedate= str_replace("00:00:00", "" , $expected_query['date_expected']);  
+   
+    $info_box_contents[$row][$col] = array('align' => 'center',
+                                           'params' => 'class="smallText" width="33%" valign="top"',
+                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $expected_query['products_image'], $expected_query['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $expected_query['products_id']) . '">' . $expected_query['products_name'] . '</a><br>' . $products_price_s . '<br>' . TABLE_HEADING_DATE_EXPECTED . '&nbsp;' . $duedate);
+
+
+    $col ++;
+    if ($col > 2) {
+      $col = 0;
+      $row ++;
+    }
+  }
+
+  if($num) {
+      new contentBox($info_box_contents);
+if (TEMPLATE_INCLUDE_FOOTER =='true'){
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+ new contentBoxFooter($info_box_contents);
+
+  }
+ }
+?>
+<!--D upcoming_products_eof //-->
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/modules/additional_images.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/additional_images.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/additional_images.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,191 @@
+<!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //-->
+    <tr>
+      <td><table width="100%">
+       <tr>
+
+<?php
+    if (($product_info['products_image_sm_1'] != '') && ($product_info['products_image_xl_1'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_1'] != '') && ($product_info['products_image_sm_1'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=1') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_1']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_1'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_1'] == '') && ($product_info['products_image_xl_1'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_1'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+<?php
+    if (($product_info['products_image_sm_2'] != '') && ($product_info['products_image_xl_2'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_2'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_2'] != '') && ($product_info['products_image_sm_2'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=2') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_2'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_2']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_2'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_2'] == '') && ($product_info['products_image_xl_2'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_2'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+<?php
+    if (($product_info['products_image_sm_3'] != '') && ($product_info['products_image_xl_3'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_3'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_3'] != '') && ($product_info['products_image_sm_3'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=3') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_3'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_3']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_3'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_3'] == '') && ($product_info['products_image_xl_3'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_3'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+
+</tr>
+<tr>
+
+
+<?php
+    if (($product_info['products_image_sm_4'] != '') && ($product_info['products_image_xl_4'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_4'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_4'] != '') && ($product_info['products_image_sm_4'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=4') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_4'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_4']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_4'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_4'] == '') && ($product_info['products_image_xl_4'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_4'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+
+<?php
+    if (($product_info['products_image_sm_5'] != '') && ($product_info['products_image_xl_5'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_5'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_5'] != '') && ($product_info['products_image_sm_5'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=5') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_5'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_5']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_5'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_5'] == '') && ($product_info['products_image_xl_5'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_5'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+
+<?php
+    if (($product_info['products_image_sm_6'] != '') && ($product_info['products_image_xl_6'] == '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_6'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    } elseif
+       (($product_info['products_image_sm_6'] != '') && ($product_info['products_image_sm_6'] != '')) {
+?>
+     <td align="center" class="smallText">
+      <script type="text/javascript"><!--
+         document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&image=6') . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_6'], addslashes($product_info['products_name']), ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
+//--></script>
+         <noscript>
+           <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_sm_6']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_sm_6'], $product_info['products_name'], ULT_THUMB_IMAGE_WIDTH, ULT_THUMB_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '<br>' . tep_template_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
+          </noscript>
+      </td>
+<?php
+    } elseif
+      (($products_info['products_image_sm_6'] == '') && ($product_info['products_image_xl_6'] != '')) {
+?>
+     <td align="center" class="smallText">
+           <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image_xl_6'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="1" vspace="1"'); ?>
+      </td>
+<?php
+    }
+?>
+
+
+     </tr>
+        </table></td>
+     </tr>
+<!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //-->

Added: trunk/direct.openmoko.com/templates/default/modules/also_purchased_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/also_purchased_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/also_purchased_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,89 @@
+<?php
+/*
+  $Id: also_purchased_products.php,v 1.2 2004/03/05 00:36:42 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+  if(!tep_session_is_registered('sppc_customer_group_id')) {
+
+  
+  if (isset($HTTP_GET_VARS['products_id'])) {
+   
+    $orders_query = tep_db_query("select 
+                              p.products_id,
+                              p.products_image, 
+                              p.products_price, 
+                              p.manufacturers_id,
+                              pd.products_name,
+                              p.products_tax_class_id, 
+                              p.products_date_added, 
+                           p.products_image 
+    from " . TABLE_ORDERS_PRODUCTS . " opa, 
+    " . TABLE_ORDERS_PRODUCTS . " opb, 
+    " . TABLE_ORDERS . " o, 
+    (" . TABLE_PRODUCTS . " p 
+      left join " . TABLE_SPECIALS . " s using(products_id)),
+      " . TABLE_PRODUCTS_DESCRIPTION . " pd
+    where 
+    opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' 
+    and opa.orders_id = opb.orders_id 
+    and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' 
+    and opb.products_id = p.products_id 
+    and opb.orders_id = o.orders_id 
+    and pd.products_id = p.products_id
+    and pd.language_id = '" . $languages_id . "' 
+    and p.products_status = '1' group by p.products_id
+    order by rand(), o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED);
+    
+    $num_products_ordered = tep_db_num_rows($orders_query);
+    
+    if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) {
+?>
+<!-- default also_purchased_products //-->
+          <tr>
+            <td>
+
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('text' => TEXT_ALSO_PURCHASED_PRODUCTS);
+
+      new contentBoxHeading($info_box_contents, '');
+
+      $row = 0;
+      $col = 0;
+      $info_box_contents = array();
+      while ($orders = tep_db_fetch_array($orders_query)) {
+        $orders['products_name'] = tep_get_products_name($orders['products_id']);
+        $info_box_contents[$row][$col] = array('align' => 'center',
+                                               'params' => 'class="navBbrown" width="33%" valign="top"',
+                                               'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $orders['products_image'], $orders['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a>');
+
+        $col ++;
+        if ($col > 2) {
+          $col = 0;
+          $row ++;
+        }
+      }
+
+      new contentBox($info_box_contents);
+if (TEMPLATE_INCLUDE_FOOTER =='true'){
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+ new contentBoxFooter($info_box_contents);
+
+}
+?>
+           </td>
+          </tr>
+<!-- also_purchased_products_eof //-->
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/modules/an_example.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/an_example.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/an_example.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<!-- specials //-->
+  <tr>
+    <td valign="top" width="100%" align="center">
+    <table border="0" cellspacing="0" cellpadding="2" height="160">
+      <tr>
+        <td width="45%"> 
+ <table border="0" cellspacing="0" cellpadding="0" width="100%"> 
+
+  <tr>
+    <td align="center"><img src="templates/example/images/sale2_button_198x134.gif" border="0" alt=""></td> 
+  </tr> 
+</table> 
+</td>
+<td width="10%">&nbsp;</td>
+<td width="45%"><table border="0" cellpadding="0" cellspacing="0" width="100%"> 
+  <tr>  
+    <td height="19" class="promo1title"><?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/featured.php');?>
+</td> 
+  </tr> 
+       </table></td>
+  </tr>
+</table>
+            </td>
+          </tr>
+<!-- specials_eof //--> 
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/modules/featured_products.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/featured_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/featured_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+  
+  Featured Products Listing Module
+*/
+  if (sizeof($featured_products_array) == '0') {
+?>
+  <tr>
+    <td class="main"><?php echo TEXT_NO_FEATURED_PRODUCTS; ?></td>
+  </tr>
+<?php
+  } else {
+    for($i=0; $i<sizeof($featured_products_array); $i++) {
+
+  $pf->loadProduct($featured_products_array[$i]['id'],$languages_id);
+        $products_price = $pf->getPriceStringShort();
+
+ ?>
+  <tr>
+    <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_array[$i]['id'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . $featured_products_array[$i]['image'], $featured_products_array[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
+    <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products_array[$i]['id'], 'NONSSL') . '"><b><u>' . $featured_products_array[$i]['name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . $featured_products_array[$i]['date_added'] . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products_array[$i]['manufacturer'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
+    <td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products_array[$i]['id'], 'NONSSL') . '">' . tep_template_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
+  </tr>
+<?php
+      if (($i+1) != sizeof($featured_products_array)) {
+?>
+  <tr>
+    <td colspan="3" class="main">&nbsp;</td>
+  </tr>
+<?php
+      }
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/templates/default/modules/product_attributes.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/product_attributes.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/product_attributes.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,133 @@
+<?php
+    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' ");
+    $products_attributes = tep_db_fetch_array($products_attributes_query);
+    if ($products_attributes['total'] > 0) {
+?>
+            <table width="100%" border="0" cellspacing="0" cellpadding="2">
+              <tr>
+                <td class="main" colspan="2"><strong><?php echo TEXT_PRODUCT_OPTIONS; ?></strong></td>
+              </tr>
+              <?php
+      $products_options_query = tep_db_query("select pa.options_id, pa.options_values_id, pa.options_values_price, pa.price_prefix, po.options_type, po.options_length, pot.products_options_name, pot.products_options_instruct from
+           " . TABLE_PRODUCTS_ATTRIBUTES  . " AS pa, 
+           " . TABLE_PRODUCTS_OPTIONS  . " AS po,
+           " . TABLE_PRODUCTS_OPTIONS_TEXT  . " AS pot
+           where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'
+             and pa.options_id = po.products_options_id
+             and po.products_options_id = pot.products_options_text_id and pot.language_id = '" . (int)$languages_id . "'
+           order by pa.products_options_sort_order
+           ");
+      
+      // Store the information from the tables in arrays for easy of processing
+      $options = array();
+      $options_values = array();
+      while ($po = tep_db_fetch_array($products_options_query)) {
+        //  we need to find the values name 
+        if ( $po['options_type'] != 1  && $po['options_type'] != 4 ) {
+          $ov['products_options_values_name'] = array();
+          $options_values_query = tep_db_query("select pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po where pov.products_options_values_id = pov2po.products_options_values_id and pov2po.products_options_id = '". $po['options_id'] . "' and pov.language_id = '" . (int)$languages_id . "'");
+          while ($ov_name = tep_db_fetch_array($options_values_query)) {
+            $ov['products_options_values_name'][] = stripslashes($ov_name['products_options_values_name']);
+          }
+        } else {
+          $ov['products_options_values_name'] = '';
+        }
+        $options[$po['options_id']] = array('name' => $po['products_options_name'], 'type' => $po['options_type'], 'length' => $po['options_length'], 'instructions' => $po['products_options_instruct']);
+        $options_values[$po['options_id']][$po['options_values_id']] =  array('name' => $ov['products_options_values_name'], 'price' => $po['options_values_price'], 'prefix' => $po['price_prefix']);
+      }
+      
+      foreach ($options as $oID => $op_data) {
+        switch ($op_data['type']) {
+            
+          case 1:
+            $maxlength = ( $op_data['length'] > 0 ? ' maxlength="' . $op_data['length'] . '"' : '' );
+            $tmp_html = '<input type="text" name="id[' . $oID . '][t]"' . $maxlength . ' />'; 
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+            break;
+      
+          case 4:
+            $text_area_array = explode(';',$op_data['length']);
+            $cols = $text_area_array[0];
+            if ( $cols == '' ) $cols = '100%';
+            $rows = $text_area_array[1];
+            $tmp_html = '<textarea name="id[' . $oID . '][t]" rows="'.$rows.'" cols="'.$cols.'" wrap="virtual"></textarea>'; 
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+            break;
+      
+          case 2:
+            $tmp_html = '';
+            $i = 0;
+            foreach ( $options_values[$oID] as $vID => $ov_data ) {
+              if ( (int)$ov_data['price'] == 0 ) {
+                  $price = '&nbsp;';
+              } else {
+                  $price = '(&nbsp;' . $ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate) . '&nbsp;)';
+              }
+              $tmp_html .= '<input type="radio" name="id[' . $oID . ']" value="' . $vID . '">' . $ov_data['name'][$i] . '&nbsp;' . $price . '<br />';
+              $i++;
+            } // End of the for loop on the option value
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+            break;
+          
+          case 3:
+            $tmp_html = '';
+            $i = 0;
+            foreach ( $options_values[$oID] as $vID => $ov_data ) {
+              if ( (int)$ov_data['price'] == 0 ) {
+                $price = '&nbsp;';
+              } else {
+                $price = '(&nbsp;'.$ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate).'&nbsp;)';
+              }
+              $tmp_html .= '<input type="checkbox" name="id[' . $oID . '][c][' . $i . ']" value="' . $vID . '">' . $ov_data['name'][$i] . '&nbsp;' . $price . '<br />';
+              $i++;
+            }
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+            break;
+            
+          case 0:
+            $tmp_html = '<select name="id[' . $oID . ']">';
+            $i = 0;
+            foreach ( $options_values[$oID] as $vID => $ov_data ) {
+              if ( (int)$ov_data['price'] == 0 ) {
+                $price = '&nbsp;';
+              } else {
+                $price = '(&nbsp; '.$ov_data['prefix'] . '&nbsp;' . $currencies->display_price($ov_data['price'], $tax_rate).'&nbsp;)';
+              }
+              $tmp_html .= '<option value="' . $vID . '">' . $ov_data['name'][$i] . '&nbsp;' . $price .'</option>';
+              $i++;
+            } // End of the for loop on the option values
+            $tmp_html .= '</select>';
+?>
+              <tr>
+                <td class="main"><?php echo $op_data['name'] . ':' . ($op_data['instructions'] != '' ? '<br /><span class="smallText">' . $op_data['instructions'] . '</span>' : '' ); ?></td>
+                <td class="main"><?php echo $tmp_html;  ?></td>
+              </tr>
+              <?php
+            break;
+        }  //end of switch
+      } //end of while
+?>
+            </table>
+            <?php
+    } // end of ($products_attributes['total'] > 0)
+?>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/modules/product_buttons.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/product_buttons.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/product_buttons.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,54 @@
+<?php
+//
+?>
+  <?php
+    $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
+    $reviews = tep_db_fetch_array($reviews_query);
+ if ($reviews['count'] > 0) {
+?>
+  <tr>
+    <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
+  <?php
+    }
+    ?>
+ <tr>
+    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
+        <tr class="infoBoxContents">
+          <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
+              <tr>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+                <td class="main" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_template_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS,'align="absmiddle"') . '</a>'; ?></td>
+                <!-- Begin Wishlist Code -->
+<?php 
+                  if (DESIGN_BUTTON_WISHLIST == 'true') {
+                    echo '<td align="right" class="main" valign="middle">';
+                    if( (!tep_session_is_registered('customer_id')) || (!tep_session_is_registered('SESSION_WISHLIST')) ){
+                      $SESSION_WISHLIST = $product_info['products_id'];
+                      tep_session_register('SESSION_WISHLIST');
+                      }
+                    echo '<a href="javascript:document.cart_quantity.action=\'' . tep_href_link(FILENAME_PRODUCT_INFO, 'action=add_wishlist') . '\'; document.cart_quantity.submit();">' . tep_template_image_button('button_add_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST,'align="absmiddle"') . '</a>' ;
+                    echo '</td>';
+                  } 
+?>
+   <!-- End Wishlist Code -->
+<?php 
+    // } 
+?>
+                <td class="main" align="right" valign="absmiddle"><table border="0" cellspacing="0" cellpadding="0" align="right">
+  <tr>
+  <?php if (tep_db_num_rows($sub_products_sql) ==0) {?>
+    <td class="main"><?php echo TEXT_ENTER_QUANTITY . ':&nbsp;&nbsp;';?></td>
+    <td class="main"><?php echo tep_draw_input_field('cart_quantity', '1', 'size="4"');?>&nbsp;&nbsp;</td>
+  <?php }?>
+    <td class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_template_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absmiddle"'); ?></td>
+  </tr>
+</table></form></td>
+                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+              </tr>
+            </table></td>
+        </tr>
+      </table></td>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/modules/product_discription.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/product_discription.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/product_discription.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,45 @@
+<?php 
+//product discription
+
+?>
+
+  <tr>
+    <td class="main"><table width="100%" border="0" cellspacing="0" cellpadding="2">
+        <tr>
+          <td class="main" valign="top">
+          <?php if (tep_not_null($product_info['products_image'])) { ?>
+          <table border="0" cellspacing="0" cellpadding="0" align="right">
+              <tr>
+                <td><!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //-->
+                  <?php
+      if ($product_info['products_image_med']!='') {
+        $new_image = $product_info['products_image_med'];
+        $image_width = MEDIUM_IMAGE_WIDTH;
+        $image_height = MEDIUM_IMAGE_HEIGHT;
+      } else {
+        $new_image = $product_info['products_image'];
+        $image_width = SMALL_IMAGE_WIDTH;
+        $image_height = SMALL_IMAGE_HEIGHT;
+      }
+      echo tep_javascript_image(DIR_WS_IMAGES . $new_image, 'product' . $product_info['products_id'], addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"', 'true');
+?>
+                  <!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! //-->
+                  <!-- // BEGIN  Affiliate program mods for 2.5a upgrade DMG  -->
+                  <?php
+      //affiliate build a link begin
+      if (tep_session_is_registered('affiliate_id')) {
+        echo '<br><br><a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD, 'individual_banner_id=' . $product_info['products_id']) .'" target="_self">' . tep_template_image_button('button_affiliate_build_a_link.gif', 'Make a link') . ' </a>'; ?>
+                  <?php
+      }
+      //affiliate build a link begin
+?>
+                  <!-- // EOF Affiliate program 2.5a upgrade mods DMG -->
+                </td>
+              </tr>
+            </table>
+          <?php    } ?>
+<p><?php echo stripslashes($product_info['products_description']); ?></p>
+
+         </td>
+        </tr>
+      </table></td>

Added: trunk/direct.openmoko.com/templates/default/modules/product_extra_feilds.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/product_extra_feilds.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/product_extra_feilds.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<?php
+
+//product ectra feilds
+?>
+<tr>
+    <td class="main"><table border="0" cellspacing="1" cellpadding="2">
+        <?php
+      while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
+        if (! $extra_fields['status'])  // show only enabled extra field
+          continue;
+?>
+        <tr>
+          <td class="main" valign="top"><b><?php echo $extra_fields['name']; ?>:&nbsp;</b></td>
+          <td class="main" valign="top"><?php echo $extra_fields['value']; ?></td>
+        </tr>
+        <?php
+      }
+?>
+      </table></td>
+  </tr>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/modules/products_more_information.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/products_more_information.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/products_more_information.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,10 @@
+<?php
+//more information
+?>
+
+  <tr>
+    <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&amp;goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
+  </tr>
+  <tr>
+    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
+  </tr>
\ No newline at end of file

Added: trunk/direct.openmoko.com/templates/default/modules/shipping_estimator.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/shipping_estimator.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/shipping_estimator.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,279 @@
+<?php
+/*
+  $Id: shipping_estimator.php,v 1.1.1.1 2004/03/04 23:41:12 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 Edwin Bekaert (edwin at ednique.com)
+
+  Customized by: Linda McGrath osCommerce at WebMakers.com
+  * This now handles Free Shipping for orders over $total as defined in the Admin
+  * This now shows Free Shipping on Virtual products
+  * Everything is contained in an infobox for easier placement.
+
+  Released under the GNU General Public License
+
+  http://forums.oscommerce.com/viewtopic.php?t=38411
+
+  http://www.oscommerce.com/community/contributions,1094
+*/
+?>
+<!-- shipping_estimator modules //-->
+<?php
+// Only do when something is in the cart
+if ($cart->count_contents() > 0) {
+
+// Could be placed in english.php
+// shopping cart quotes
+ 
+  // shipping cost
+  require('includes/classes/http_client.php'); // shipping in basket
+  require(DIR_WS_LANGUAGES . $language . '/modules/shipping_estimator.php');
+
+  if($cart->get_content_type() !== 'virtual') {
+    if (tep_session_is_registered('customer_id')) {
+      // user is logged in
+      if (isset($HTTP_POST_VARS['address_id'])){
+        // user changed address
+        $sendto = $HTTP_POST_VARS['address_id'];
+      }elseif (tep_session_is_registered('cart_address_id')){
+        // user once changed address
+        $sendto = $cart_address_id;
+      }else{
+        // first timer
+        $sendto = $customer_default_address_id;
+      }
+      // set session now
+      $cart_address_id = $sendto;
+      tep_session_register('cart_address_id');
+      // include the order class (uses the sendto !)
+      require(DIR_WS_CLASSES . 'order.php');
+      $order = new order;
+    }else{
+      // user not logged in !
+      if (isset($HTTP_POST_VARS['country_id'])){
+        // country is selected
+        $country_info = tep_get_countries($HTTP_POST_VARS['country_id'],true);
+        $order->delivery = array('postcode' => $HTTP_POST_VARS['zip_code'],
+                                 'country' => array('id' => $HTTP_POST_VARS['country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
+                                 'country_id' => $HTTP_POST_VARS['country_id'],
+                                 'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id']));
+        $cart_country_id = $HTTP_POST_VARS['country_id'];
+        tep_session_register('cart_country_id');
+        $cart_zip_code = $HTTP_POST_VARS['zip_code'];
+        tep_session_register('cart_zip_code');
+      }elseif (tep_session_is_registered('cart_country_id')){
+        // session is available
+        $country_info = tep_get_countries($cart_country_id,true);
+        $order->delivery = array('postcode' => $cart_zip_code,
+                                 'country' => array('id' => $cart_country_id, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
+                                 'country_id' => $cart_country_id,
+                                 'format_id' => tep_get_address_format_id($cart_country_id));
+      } else {
+        // first timer
+        $cart_country_id = STORE_COUNTRY;
+        tep_session_register('cart_country_id');
+// WebMakers.com Added: changes
+// changed from STORE_ORIGIN_ZIP to SHIPPING_ORIGIN_ZIP
+        $cart_zip_code = SHIPPING_ORIGIN_ZIP;
+        $country_info = tep_get_countries(STORE_COUNTRY,true);
+        tep_session_register('cart_zip_code');
+        $order->delivery = array('postcode' => SHIPPING_ORIGIN_ZIP,
+                                 'country' => array('id' => STORE_COUNTRY, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
+                                 'country_id' => STORE_COUNTRY,
+                                 'format_id' => tep_get_address_format_id($HTTP_POST_VARS['country_id']));
+      }
+      // set the cost to be able to calvculate free shipping
+      $order->info = array('total' => $cart->show_total()); // TAX ????
+    }
+    // weight and count needed for shipping !
+    $total_weight = $cart->show_weight();
+    $total_count = $cart->count_contents();
+    require(DIR_WS_CLASSES . 'shipping.php');
+    $shipping_modules = new shipping;
+    $quotes = $shipping_modules->quote();
+    $cheapest = $shipping_modules->cheapest();
+    // set selections for displaying
+    $selected_country = $order->delivery['country']['id'];
+    $selected_zip = $order->delivery['postcode'];
+    $selected_address = $sendto;
+  }
+    // eo shipping cost
+
+
+// check free shipping based on order $total
+  if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
+    switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
+      case 'national':
+        if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
+      case 'international':
+        if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
+      case 'both':
+        $pass = true; break;
+      default:
+        $pass = false; break;
+    }
+    $free_shipping = false;
+    if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
+      $free_shipping = true;
+      include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
+    }
+  } else {
+    $free_shipping = false;
+  }
+
+
+//begineoutput
+
+//  $ShipTxt.='<table border="0" width="100%" cellspacing="0" cellpadding="' . CELLPADDING_SUB . '">';
+  $ShipTxt= tep_draw_form('estimator', tep_href_link(basename($PHP_SELF), '', 'NONSSL'), 'post'); //'onSubmit="return check_form();"'
+
+
+  if(sizeof($quotes)) {
+    if (tep_session_is_registered('customer_id')) {
+      // logged in
+      $addresses_query = tep_db_query("select address_book_id, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
+      while ($addresses = tep_db_fetch_array($addresses_query)) {
+        $addresses_array[] = array('id' => $addresses['address_book_id'], 'text' => tep_address_format(tep_get_address_format_id($addresses['country_id']), $addresses, 0, ' ', ' '));
+      }
+      $ShipTxt.='<tr><td colspan="3" class="main">' . ($total_count == 1 ?  SHIPPING_METHOD_ITEM  :  SHIPPING_METHOD_ITEMS) . $total_count . '&nbsp;-&nbsp;' . SHIPPING_METHOD_WEIGHT . $total_weight . SHIPPING_METHOD_WEIGHT_UNIT . '</td></tr>';
+      $ShipTxt.='<tr><td colspan="3" class="main" nowrap>' .
+                SHIPPING_METHOD_ADDRESS .'&nbsp;'. tep_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="document.estimator.submit();return false;"').'</td></tr>';
+      $ShipTxt.='<tr valign="top"><td class="main">' . SHIPPING_METHOD_TO .'</td><td colspan="2" class="main">'. tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>') . '</td></tr>';
+    } else {
+      // not logged in change text output
+   if (strstr($PHP_SELF,'shopping_cart.php')) {     
+      $SHIPPING_OPTIONS_LOGIN = SHIPPING_OPTIONS_LOGIN_A ;
+      }else{
+      $SHIPPING_OPTIONS_LOGIN = SHIPPING_OPTIONS_LOGIN_B ;
+      }
+      
+      $ShipTxt.=tep_output_warning($SHIPPING_OPTIONS_LOGIN);
+      $ShipTxt.='<tr><td colspan="3" class="main">' . ($total_count == 1 ?  SHIPPING_METHOD_ITEM :  SHIPPING_METHOD_ITEMS ) . $total_count . '&nbsp;-&nbsp;' . SHIPPING_METHOD_WEIGHT  . $total_weight . SHIPPING_METHOD_WEIGHT_UNIT . '</td></tr>';
+      $ShipTxt.='<tr><td colspan="3" class="main" nowrap>' .
+                ENTRY_COUNTRY .'&nbsp;'. tep_get_country_list('country_id', $selected_country,'style="width=200;"');
+      if(SHIPPING_METHOD_ZIP_REQUIRED == "true"){
+        $ShipTxt.='</td></tr>          <tr>
+            <td colspan="3" class="main" nowrap>' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td>
+          </tr><tr><td colspan="3" class="main" nowrap>'.ENTRY_POST_CODE .'&nbsp;'. tep_draw_input_field('zip_code', $selected_zip, 'size="10"');
+      }
+      $ShipTxt.='&nbsp;<a href="_" onclick="document.estimator.submit();return false;">' . SHIPPING_METHOD_RECALCULATE.'</a></td></tr>';
+    }
+    if ($free_shipping==1) {
+      // order $total is free
+      $ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
+      $ShipTxt.='<tr><td>&nbsp;</td><td class="main">' . sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . '</td><td>&nbsp;</td></tr>';
+    }else{
+      // shipping display
+      $ShipTxt.='<tr><td></td><td class="main" align="left"><b>' . SHIPPING_METHOD_TEXT . '</b></td><td class="main" align="center"><b>' . SHIPPING_METHOD_RATES . '</b></td></tr>';
+      $ShipTxt.='<tr><td colspan="3" class="main">'.tep_draw_separator().'</td></tr>';
+      for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
+        if(sizeof($quotes[$i]['methods'])==1){
+          // simple shipping method
+          $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][0]['id'];
+          $ShipTxt.= '<tr class="'.$extra.'">';
+          $ShipTxt.='<td class="main">'.$quotes[$i]['icon'].'&nbsp;</td>';
+          if($quotes[$i]['error']){
+            $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].'&nbsp;';
+            $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
+          }else{
+            if($cheapest['id'] == $thisquoteid){
+              $ShipTxt.='<td class="main"><b>'.$quotes[$i]['module'].'&nbsp;';
+              $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</b></td><td align="right" class="main"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'<b></td></tr>';
+            }else{
+              $ShipTxt.='<td class="main">'.$quotes[$i]['module'].'&nbsp;';
+              $ShipTxt.= '('.$quotes[$i]['methods'][0]['title'].')</td><td align="right" class="main">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], $quotes[$i]['tax'])).'</td></tr>';
+            }
+          }
+        } else {
+          // shipping method with sub methods (multipickup)
+          for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
+            $thisquoteid = $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'];
+            $ShipTxt.= '<tr class="'.$extra.'">';
+            $ShipTxt.='<td class="main">'.$quotes[$i]['icon'].'&nbsp;</td>';
+            if($quotes[$i]['error']){
+              $ShipTxt.='<td colspan="2" class="main">'.$quotes[$i]['module'].'&nbsp;';
+              $ShipTxt.= '('.$quotes[$i]['error'].')</td></tr>';
+            }else{
+              if($cheapest['id'] == $thisquoteid){
+                $ShipTxt.='<td class="main"><b>'.$quotes[$i]['module'].'&nbsp;';
+                $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</b></td><td align="right" class="main"><b>'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</b></td></tr>';
+              }else{
+                $ShipTxt.='<td class="main">'.$quotes[$i]['module'].'&nbsp;';
+                $ShipTxt.= '('.$quotes[$i]['methods'][$j]['title'].')</td><td align="right" class="main">'.$currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])).'</td></tr>';
+              }
+            }
+          }
+        }
+      }
+    }
+  } else {
+    // virtual product/download
+    $ShipTxt.='<tr><td class="main">' . SHIPPING_METHOD_FREE_TEXT . ' ' . SHIPPING_METHOD_ALL_DOWNLOADS . '</td></tr>';
+  }
+  $ShipTxt.= '</td></tr>';
+  $ShipTxt.= '</form>';
+
+// build box
+
+
+
+
+?>
+<tr>
+<td valign="top" width="100%">
+<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
+
+<?php
+//header
+  $info_box_contents = array();
+  $info_box_contents[] = array('text' => SHIPPING_OPTIONS);
+
+  new contentBoxHeading($info_box_contents, '');
+
+?>
+
+    <table width="100%" border="0" cellspacing="0" cellpadding="0">
+       <tr>
+       <td cellpadding="0" align="left"  width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_LEFT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_LEFT_WIDTH ;?>" height="1"></td>
+          <td class="main_table_heading"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+            <tr>
+              <td class ="templateinfobox"><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                  <tr>
+                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
+                       <tr>
+                        <td class= "boxText">
+                         <table width="100%"  border="0" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB ;?>">
+      
+<?php       
+ echo $ShipTxt;     
+ ?>            
+                       </tr>
+                     </table></td>  
+                   </tr>
+               </table></td> 
+            </tr> 
+         </table></td> 
+  <td cellpadding="0" cellspacing="0" align="left" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" style="background-image: url('<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>');background-repeat: repeat-y;"><img src="<?php echo TEMPLATE_BOX_MIDDLE_RIGHT_IMAGE ;?>" alt="box" width="<?php echo SIDE_BOX_RIGHT_WIDTH ;?>" height="1"></td>
+      </tr>
+  </table></td>    
+  </tr>
+</table>
+
+<?php
+
+ if (TEMPLATE_INCLUDE_FOOTER =='true'){
+   $info_box_contents = array();
+   $info_box_contents[] = array('align' => 'left',
+                                 'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                               );
+  new contentBoxFooter($info_box_contents);
+}
+?>
+
+<?php
+} // Only do when something is in the cart
+?>
+
+<!-- shipping_estimator_eof //-->

Added: trunk/direct.openmoko.com/templates/default/modules/xsell_products_buynow.php
===================================================================
--- trunk/direct.openmoko.com/templates/default/modules/xsell_products_buynow.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/templates/default/modules/xsell_products_buynow.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,94 @@
+
+<?php
+/*
+$Id: xsell_products.php, v1  2002/09/11
+
+osCommerce, Open Source E-Commerce Solutions
+<http://www.oscommerce.com>
+
+Copyright (c) 2002 osCommerce
+
+Released under the GNU General Public License
+*/
+
+
+if ($HTTP_GET_VARS['products_id']) {
+
+$xsell_query = tep_db_query("select distinct 
+   p.products_id,
+   p.products_image, 
+   p.products_price, 
+   p.manufacturers_id,
+   pd.products_name,
+   p.products_tax_class_id,
+   p.products_date_added, 
+   p.products_image ,
+   xp.xsell_id
+   products_price 
+   from " . TABLE_PRODUCTS_XSELL . " xp,
+     " . TABLE_PRODUCTS . " p, 
+   " . TABLE_PRODUCTS_DESCRIPTION . " pd 
+where 
+xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' 
+and p.products_id = xp.xsell_id
+and pd.products_id = xp.xsell_id
+and pd.language_id = '" . $languages_id . "' 
+and p.products_status = '1' 
+order by rand(), xp.products_id asc limit " . MAX_DISPLAY_XSELL);
+
+
+$num_products_xsell = tep_db_num_rows($xsell_query);
+
+if ($num_products_xsell >= MIN_DISPLAY_XSELL) {
+  require(DIR_WS_LANGUAGES . $language . '/modules/xsell_products.php');
+?>
+<!-- xsell_products //-->
+   <tr>
+            <td>
+
+<?php
+      $info_box_contents = array();
+      $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS);
+       new  contentBoxHeading($info_box_contents,'');
+
+      $row = 0;
+      $col = 0;
+      $info_box_contents = array();
+      while ($xsell = tep_db_fetch_array($xsell_query)) {
+
+  $pf->loadProduct($xsell['products_id'],$languages_id);
+        $xsell_price = $pf->getPriceStringShort();
+  
+        $info_box_contents[$row][$col] = array('align' => 'center',
+                                               'params' => 'class="smallText" width="33%" valign="top"',
+                                               'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_template_image_button('button_buy_now.gif', TEXT_BUY . $xsell['products_name'] . TEXT_NOW) .'</a>');
+        $col ++;
+        if ($col > 2) {
+          $col = 0;
+          $row ++;
+        }
+      }
+      
+if (($num_products_xsell >= MIN_DISPLAY_XSELL) && ($num_products_xsell > 0)) { 
+      new contentBox($info_box_contents);
+if (TEMPLATE_INCLUDE_FOOTER =='true'){
+  $info_box_contents = array();
+  $info_box_contents[] = array('align' => 'left',
+                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
+                              );
+ new contentBoxFooter($info_box_contents);
+
+}
+}
+?>
+           </td>
+          </tr>
+<!-- xsell_products_eof //-->
+
+
+
+
+<?php
+    }
+  }
+?>

Added: trunk/direct.openmoko.com/tmp/delete_me_for_zip_only.txt
===================================================================

Added: trunk/direct.openmoko.com/upcoming_products.php
===================================================================
--- trunk/direct.openmoko.com/upcoming_products.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/upcoming_products.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,146 @@
+<?php
+/*
+  $Id: products_new.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_UPCOMING_PRODUCTS);
+    // Eversun mod for sppc and qty price breaks
+       if(!tep_session_is_registered('sppc_customer_group_id')) {
+         $customer_group_id = 'G';
+         } else {
+          $customer_group_id = $sppc_customer_group_id;
+       }
+
+    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
+                         'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
+                         'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
+                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
+                         'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
+                         'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
+                         'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
+                         'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW,
+                         'PRODUCT_LIST_DATE_EXPECTED' => PRODUCT_LIST_DATE_EXPECTED);
+
+    asort($define_list);
+    $page_set= 'upcoming_products';
+    $column_list = array();
+    reset($define_list);
+    while (list($key, $value) = each($define_list)) {
+      if ($value > 0) $column_list[] = $key;
+    }
+
+       // find out if sorting by price has been requested
+       if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
+        $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+        if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
+          $status_need_to_get_prices = true;
+          }
+       }
+ if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    }
+
+        $select_column_list = '';
+    
+    $listing_sql .= ' order by ';    
+        for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+          switch ($column_list[$i]) {
+            case 'PRODUCT_LIST_MODEL':
+              $select_column_list .= 'p.products_model, ';
+              break;
+            case 'PRODUCT_LIST_NAME':
+              $select_column_list .= 'pd.products_name, ';
+              break;
+            case 'PRODUCT_LIST_MANUFACTURER':
+              $select_column_list .= 'm.manufacturers_name, ';
+              break;
+            case 'PRODUCT_LIST_QUANTITY':
+              $select_column_list .= 'p.products_quantity, ';
+              break;
+            case 'PRODUCT_LIST_IMAGE':
+              $select_column_list .= 'p.products_image, ';
+              break;
+            case 'PRODUCT_LIST_WEIGHT':
+              $select_column_list .= 'p.products_weight, ';
+              break;
+           case 'PRODUCT_LIST_DATE_EXPECTED':
+        $select_column_list .= 'p.products_date_available, ';
+              break;
+             }
+    }
+   
+    // We show them all
+ // either retail or no need to get correct special prices
+          $listing_sql = "select distinct " . $select_column_list . "  
+                          p.products_id,
+                          p.products_price as final_price,
+                          p.products_tax_class_id,
+                          p.products_image 
+                        from (" . TABLE_PRODUCTS . " p 
+                        left join " . TABLE_SPECIALS . " s using(products_id)),
+                                  " . TABLE_PRODUCTS_DESCRIPTION . " pd
+                        where 
+                         p.products_status = '1' 
+                         and pd.products_id = p.products_id
+                         and pd.language_id = '" . (int)$languages_id . "' 
+                         and to_days(p.products_date_available) >= to_days(now()) ";  
+        
+ if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+   //   $sort = ;
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    
+    $listing_sql .= ' order by ';
+    switch ($sort_column) {
+      case 'PRODUCT_LIST_MODEL':
+        $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $listing_sql .= "pd.products_name";
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_DATE_EXPECTED':
+        $listing_sql .= "p.products_date_available " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;  
+      }
+   }
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_UPCOMING_PRODUCTS));
+
+  $content = CONTENT_UPCOMING_PRODUCTS;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/validate_new.php
===================================================================
--- trunk/direct.openmoko.com/validate_new.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/validate_new.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,311 @@
+<?php
+/*
+  $Id: index.php,v 1.2 2004/03/09 19:56:29 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+// the following cPath references come from application_top.php
+  $category_depth = 'top';
+  if (isset($cPath) && tep_not_null($cPath)) {
+    $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
+    $cateqories_products = tep_db_fetch_array($categories_products_query);
+    if ($cateqories_products['total'] > 0) {
+      $category_depth = 'products'; // display products
+    } else {
+      $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
+      $category_parent = tep_db_fetch_array($category_parent_query);
+      if ($category_parent['total'] > 0) {
+        $category_depth = 'nested'; // navigate through the categories
+      } else {
+        $category_depth = 'products'; // category has no products, but display the 'no products' message
+      }
+    }
+  }
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_VALIDATE_NEW);
+
+  if ($category_depth == 'nested') {
+//Code change for Categories Description 1.5
+//    $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
+//Changed to the following
+    $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
+//End Categories Description 1.5
+
+    $category = tep_db_fetch_array($category_query);
+
+    $content = CONTENT_INDEX_NESTED;
+
+  } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
+// create column list
+    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
+                         'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
+                         'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
+                         'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
+                         'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
+                         'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
+                         'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
+                         'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
+
+    asort($define_list);
+
+    $column_list = array();
+    reset($define_list);
+    while (list($key, $value) = each($define_list)) {
+      if ($value > 0) $column_list[] = $key;
+    }
+// Eversun mod for sppc and qty price breaks
+   if(!tep_session_is_registered('sppc_customer_group_id')) {
+     $customer_group_id = '0';
+     } else {
+      $customer_group_id = $sppc_customer_group_id;
+   }
+   // this will build the table with specials prices for the retail group or update it if needed
+   // this function should have been added to includes/functions/database.php
+   if ($customer_group_id == '0') {
+     tep_db_check_age_specials_retail_table();
+   }
+   $status_product_prices_table = false;
+   $status_need_to_get_prices = false;
+
+   // find out if sorting by price has been requested
+   if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
+    $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+    if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
+      $status_need_to_get_prices = true;
+      }
+   }
+
+   if ($status_need_to_get_prices == true && $customer_group_id != '0') {
+     $product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;
+   // the table with product prices for a particular customer group is re-built only a number of times per hour
+   // (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)
+   // to trigger the update the next function is called (new function that should have been
+   // added to includes/functions/database.php)
+     tep_db_check_age_products_group_prices_cg_table($customer_group_id);
+     $status_product_prices_table = true;
+   } // end if ($status_need_to_get_prices == true && $customer_group_id != '0')
+// Eversun mod end for sppc and qty price breaks
+    $select_column_list = '';
+
+    for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
+      switch ($column_list[$i]) {
+        case 'PRODUCT_LIST_MODEL':
+          $select_column_list .= 'p.products_model, ';
+          break;
+        case 'PRODUCT_LIST_NAME':
+          $select_column_list .= 'pd.products_name, ';
+          break;
+        case 'PRODUCT_LIST_MANUFACTURER':
+          $select_column_list .= 'm.manufacturers_name, ';
+          break;
+        case 'PRODUCT_LIST_QUANTITY':
+          $select_column_list .= 'p.products_quantity, ';
+          break;
+        case 'PRODUCT_LIST_IMAGE':
+          $select_column_list .= 'p.products_image, ';
+          break;
+        case 'PRODUCT_LIST_WEIGHT':
+          $select_column_list .= 'p.products_weight, ';
+          break;
+      }
+    }
+ // Get the category name and description
+    $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
+    $category = tep_db_fetch_array($category_query);
+
+
+// show the products of a specified manufacturer
+    if (isset($HTTP_GET_VARS['manufacturers_id'])) {
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+
+// We are asked to show only a specific category
+//Eversun mod for sppc and qty price breaks
+
+/*
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
+      } else {
+// We show them all
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+      }
+    } else {
+// show the products in a given categorie
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+// We are asked to show only specific catgeory
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
+      } else {
+// We show them all
+        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
+    */
+      
+    if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
+    } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
+    } // end else { // either retail...
+    } else {
+// We show them all
+        if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m
+                      where p.products_status = '1'
+                        and pd.products_id = p.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+    } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m
+                      where p.products_status = '1'
+                        and pd.products_id = p.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+    } // end else { // either retail...
+    }
+  } else {
+// show the products in a given categorie
+      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
+// We are asked to show only specific catgeory;
+        if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+        } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p 
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id)),
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_MANUFACTURERS . " m,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+        } // end else { // either retail...
+      } else {
+// We show them all
+        if ($status_product_prices_table == true) {
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . $product_prices_table . " as tmp_pp using(products_id))
+                      left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id,
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+        } else { // either retail or no need to get correct special prices
+      $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price
+                      from (" . TABLE_PRODUCTS . " p
+                      left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id))
+                      left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id,
+                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
+                           " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
+                      where p.products_status = '1'
+                        and p.products_id = p2c.products_id
+                        and pd.products_id = p2c.products_id
+                        and pd.language_id = '" . (int)$languages_id . "'
+                        and p2c.categories_id = '" . (int)$current_category_id . "'";
+    } // end else { // either retail...
+// Eversun mod for sppc and qty price breaks
+      }
+    }
+
+    if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+      $sort_column = CATEGORIES_SORT_ORDER;
+      $sort_order = 'a';
+    } else {
+      $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
+      $sort_column = $column_list[$sort_col-1];
+      $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    }
+    $listing_sql .= ' order by ';
+    switch ($sort_column) {
+      case 'PRODUCT_LIST_MODEL':
+        $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_NAME':
+        $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
+        break;
+      case 'PRODUCT_LIST_MANUFACTURER':
+        $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_QUANTITY':
+        $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_IMAGE':
+        $listing_sql .= "pd.products_name";
+        break;
+      case 'PRODUCT_LIST_WEIGHT':
+        $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      case 'PRODUCT_LIST_PRICE':
+        $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
+        break;
+      }
+
+    $content = CONTENT_INDEX_PRODUCTS;
+
+  } else { // default page
+
+    $content = CONTENT_VALIDATE_NEW;
+
+  }
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/vvc_display.php
===================================================================
--- trunk/direct.openmoko.com/vvc_display.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/vvc_display.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,29 @@
+<?php
+/*
+///////////////////////////////////////////////////
+  file: vvc_display.php,v 1.0 26SEP03
+
+Written for use with:
+  osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com
+Part of Contribution Named:
+  Visual Verify Code (VVC) by William L. Peer, Jr. (wpeer at forgepower.com) for www.onlyvotives.com
+
+[Modified By] [Date] [Mods Made]
+-------------------------------------------
+
+
+-------------------------------------------
+
+Released under the GNU General Public License
+Please retain all of this header information
+///////////////////////////////////////////////////
+*/
+require('includes/application_top.php');
+require(DIR_WS_FUNCTIONS . 'visual_verify_code.php');
+
+  $code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . tep_db_prepare_input($HTTP_GET_VARS['vvc']) . "'");
+  $code_array = tep_db_fetch_array($code_query);
+  $code = $code_array['code'];
+  vvcode_render_code($code);
+?>
+

Added: trunk/direct.openmoko.com/wishlist.php
===================================================================
--- trunk/direct.openmoko.com/wishlist.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/wishlist.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,50 @@
+<?php
+/*
+ // wishlist.php,v 2.0  2003/11/22 Jesse Labrocca
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2002 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  if (!tep_session_is_registered('customer_id')) {
+  $SESSION_WISHLIST = (int)$HTTP_POST_VARS['products_id'];
+  tep_session_register('SESSION_WISHLIST');
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  }
+  //ADDED FOR WHEN USERS ARE NOT LOGGED IN TO KEEP THE PRODUCT_ID
+
+  if(tep_session_is_registered('SESSION_WISHLIST')) {
+
+   // Queries below replace old product instead of adding to quantity.
+   tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $SESSION_WISHLIST . "' and customers_id = '" . (int)$customer_id . "'");
+   tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . (int)$customer_id . "', '" . $SESSION_WISHLIST . "', '" . tep_db_prepare_input($products_model) . "', '" . tep_db_prepare_input($products_name) . "', '" . tep_db_prepare_input($products_price) . "' )");
+   tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $SESSION_WISHLIST . "' and customers_id = '" . (int)$customer_id . "'");
+
+   // Read array of options and values for attributes in id[]
+    if (isset ($id)) {
+    foreach($id as $att_option=>$att_value) {
+    // Add to customers_wishlist_attributes table
+    tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . (int)$customer_id . "', '" . $SESSION_WISHLIST . "', '" . (int)$att_option . "', '" . (int)$att_value . "' )");
+    }
+   }
+  tep_session_unregister('SESSION_WISHLIST');
+  }
+
+  //END OF ADDITION
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WISHLIST);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_WISHLIST, '', 'NONSSL'));
+
+  $content = CONTENT_WISHLIST;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/wishlist_email.php
===================================================================
--- trunk/direct.openmoko.com/wishlist_email.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/wishlist_email.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,148 @@
+<?php
+/*
+ $Id: wishlist_email.php,v 2.0  2004/08/11
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WISHLIST_SEND);
+  require(DIR_WS_FUNCTIONS . 'visual_verify_code.php');
+
+//check for valid product
+   $valid_product = "false";
+
+  $wish_products_id = (int)$HTTP_GET_VARS['products_id'];
+  
+  
+  $wishlist_query_raw = "select tab2.products_id, tab1.products_name from " . TABLE_WISHLIST . " as tab2, " . TABLE_PRODUCTS_DESCRIPTION . " as tab1 WHERE tab2.customers_id='" . (int)$customer_id . "' and tab1.products_id = tab2.products_id and tab1.language_id = '" . (int)$languages_id . "' order by products_name";
+  $wishlist_query = tep_db_query($wishlist_query_raw);
+while ($resultarray=mysql_fetch_row($wishlist_query)) {
+$wishliststring .=" "."<a href=\"".HTTP_SERVER . DIR_WS_CATALOG ."product_info.php?products_id=".$resultarray[0] ."\">".$resultarray[1]."</a><br>"."";
+//$wishliststring .= $resultarray[1]."\n" . HTTP_SERVER . DIR_WS_CATALOG ."product_info.php?products_id=".$resultarray[0] . "\n\n";
+}
+
+
+  if (!tep_session_is_registered('customer_id') && (ALLOW_GUEST_TO_TELL_A_FRIEND == 'false')) {
+    $navigation->set_snapshot();
+    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
+  } elseif (tep_session_is_registered('customer_id')) {
+    $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
+    $account = tep_db_fetch_array($account_query);
+    $from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
+    $from_email_address = $account['customers_email_address'];
+  }
+
+$product_info_query = tep_db_query("select pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
+    if (tep_db_num_rows($product_info_query)) {
+      $valid_product = "true";
+      $product_info = tep_db_fetch_array($product_info_query);
+    } else{
+     $valid_product = "false";
+//  tep_redirect(tep_href_link(FILENAME_WISHLIST));
+   }
+
+//VISUAL VERIFY CODE start  
+  $vccCheckOk="True"; 
+    $code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . tep_session_id($HTTP_GET_VARS[tep_session_name()]) . "'");
+    $code_array = tep_db_fetch_array($code_query);
+    $code = $code_array['code'];
+
+    tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . tep_session_id($HTTP_GET_VARS[tep_session_name()]) . "'"); //remove the visual verify code associated with this session to clean database and ensure new results
+
+    $user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
+    if (!(strcasecmp($user_entered_code, $code) == 0)) {    //make the check case insensitive
+        $error = true;
+        
+    if(($HTTP_GET_VARS['action'] == 'process'))
+    {
+      $messageStack->add('friend', VISUAL_VERIFY_CODE_ENTRY_ERROR);
+    }
+    
+    $vccCheckOk="False";    
+    }
+    
+ 
+if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && $vccCheckOk=="True") 
+  {   
+    $error = "false";
+    $_POST['to_email_address'] = preg_replace( "/\n/", " ", $_POST['to_email_address'] );
+    $_POST['to_name'] = preg_replace( "/\n/", " ", $_POST['to_name'] );
+    $_POST['to_email_address'] = preg_replace( "/\r/", " ", $_POST['to_email_address'] );
+    $_POST['to_name'] = preg_replace( "/\r/", " ", $_POST['to_name'] );
+    $_POST['to_email_address'] = str_replace("Content-Type:","",$_POST['to_email_address']);
+    $_POST['to_name'] = str_replace("Content-Type:","",$_POST['to_name']);
+    
+    $to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']);
+    $to_name = tep_db_prepare_input($HTTP_POST_VARS['to_name']);
+    $from_email_address = tep_db_prepare_input($HTTP_POST_VARS['from_email_address']);
+    $from_name = tep_db_prepare_input($HTTP_POST_VARS['from_name']);
+    $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
+    
+       if (empty($from_name)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_FROM_NAME);
+        }
+
+        if (!tep_validate_email($from_email_address)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_FROM_ADDRESS);
+        }
+    
+        if (empty($to_name)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_TO_NAME);
+        }
+    
+        if (!tep_validate_email($to_email_address)) {
+          $error = "true";
+          $messageStack->add('friend', ERROR_TO_ADDRESS);
+        }
+
+  $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
+  $email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, STORE_NAME) . "\n\n";
+      if (tep_not_null($message)) {
+         $email_body .= $message . "\n\n";
+        }
+     if (WISH_EMAIL_USE_HTML == "false") {
+            $email_body .= TEXT_EMAIL_LINK_TEXT . FORM_FIELD_TEXT_AREA ;
+            $email_body .= $wishliststring ;
+      $email_body .= TEXT_EMAIL_SIGNATURE . STORE_NAME . "\n" . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . '</a>';
+ 
+    }else{ 
+            $email_body .= TEXT_EMAIL_LINK . FORM_FIELD_TEXT_AREA;
+            $email_body .= $wishliststring ;
+      $email_body .= TEXT_EMAIL_SIGNATURE. STORE_NAME . "\n" . '<a href="' . HTTP_SERVER  . DIR_WS_CATALOG .'">' .  HTTP_SERVER  . DIR_WS_CATALOG . '</a>';
+      
+                }
+                
+         $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
+  
+ 
+          if (WISH_EMAIL_USE_HTML == "false") {
+              $mimemessage->add_text($email_body);
+           } else {
+              $mimemessage->add_html($email_body);
+           }                
+  
+            $mimemessage->build_message();
+            $mimemessage->send($to_name, $to_email_address, $from_name, $from_email_address, $email_subject);
+
+      $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info['products_name'], tep_output_string_protected($to_name)), 'success');
+     tep_redirect(tep_href_link(FILENAME_WISHLIST));
+
+}         
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_WISHLIST_SEND, '', 'NONSSL'));
+
+$content = CONTENT_WISHLIST_SEND;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/wishlist_help.php
===================================================================
--- trunk/direct.openmoko.com/wishlist_help.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/wishlist_help.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,25 @@
+<?php
+/*
+  $Id: wishlist_help.php,v 1.1.1.1 2004/03/04 23:38:03 ccwjr Exp $
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003 osCommerce
+
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WISHLIST_HELP);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_WISHLIST_HELP, '', 'NONSSL'));
+
+  $content = CONTENT_WISHLIST_HELP;
+  $content_template = TEMPLATENAME_STATIC;
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/direct.openmoko.com/wpcallback.php
===================================================================
--- trunk/direct.openmoko.com/wpcallback.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/direct.openmoko.com/wpcallback.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+/*
+  $Id: wpcallback.php,v MS1a 2003/04/06 21:30
+  Author :  Graeme Conkie (graeme at conkie.net)
+  Title: WorldPay Payment Callback Module V4.0 Version 1.4
+
+  Revisions:
+  
+    Version 1.8 - cleaned up coding errors in wpcallback.php
+                - reduced "refresh" to 2 seconds (less chance of callback failing)
+                
+            Gary Burton - www.oscbooks.com
+            
+  Version MS1a Cleaned up code, moved static English to language file to allow for bi-lingual use,
+          Now posting language code to WP, Redirect on failure now to Checkout Payment,
+      Reduced re-direct time to 8 seconds, added MD5, made callback dynamic 
+      NOTE: YOU MUST CHANGE THE CALLBACK URL IN WP ADMIN TO <wpdisplay item="MC_callback">
+  Version 1.4 Removes boxes to prevent users from clicking away before update, 
+      Fixes currency for Yen, 
+      Redirects to Checkout_Process after 10 seconds or click by user
+  Version 1.3 Fixes problem with Multi Currency
+  Version 1.2 Added Sort Order and Default order status to work with snapshots after 14 Jan 2003
+  Version 1.1 Added Worldpay Pre-Authorisation ability
+  Version 1.0 Initial Payment Module
+
+  osCommerce, Open Source E-Commerce Solutions
+  http://www.oscommerce.com
+
+  Copyright (c) 2003
+  Released under the GNU General Public License
+*/
+
+  require('includes/application_top.php');
+
+  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WPCALLBACK);
+
+  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_WPCALLBACK, '', 'NONSSL'));
+  $content = 'wpcallback';
+
+  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);
+  require(DIR_WS_INCLUDES . 'application_bottom.php');
+?>

Added: trunk/www.openmoko.com/HISTORY.txt
===================================================================
--- trunk/www.openmoko.com/HISTORY.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/HISTORY.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,183 @@
+Changes since 4.0.3:
+
+* RSS 2.0 support
+* RSS and Atom feed fixes and improvements
+* Many improvements to admin interface XHTML markup and CSS
+* Many subtle improvements to the admin UI
+* Add automatical detection of and working with SSL
+* add nowidow-attribute to article tags 
+* Adapt navigation-elemts to the user's permissions 
+* Lots of textile improvements
+* Fixed sending Last-Modified header
+* Better indexing for faster article list queries
+* Update to tagbuilders
+* Show (source of) plugin-help before installation
+* Improvements in translations (and translateables) (thanks Skubidu and others)
+* New translations: Indonesian, Hebrew, Hungarian, Romanian
+* Improved handling of comma-separated values in tag attributes
+* article, article_custom tags: new 'sort' attribute
+* New conditional if_article_id
+* author, category, category1, category2 tags: can link to any section by name
+* Improved xhtml attributes on many tags (class, rel)
+* time and date tags: new attributes for overriding language, GMT
+* css, feed_link tags: easier generation of xhtml 'link' tags
+* New link tags: link_category, link_date, link_name, link_url
+* Navigation tag improvements (new attributes, improved xhtml output)
+* Warn if article or comment tags are used in the wrong context
+* Improved error checking, reporting and diagnostics
+* Stricter 404 checking (missing category, author, messy article ID)
+* Simplify and improve comment preview and input form tags
+* Improved article load/parse logic on individual article pages
+* Workaround some rare FCGI problems with HTTP headers
+* Fix some IIS clean URL issues
+* Improved multi-edit support on admin pages
+* Deprecate old-style PHP tags
+* Don't lose your place in admin lists when returning from an edit
+* Extra diagnostic info and pre-flight tests
+* Better time zone handling
+* Remember and automatically reuse thumbnail size settings
+* Textile: fix inline class/style/lang
+* Warn when article and comment tags are used in the wrong place
+* New "if_plugin" conditional checks for an active plugin, with optional version number
+* Fix an occasional time zone bug
+* Fix 404 errors on clean category URLs
+* Add backtrace list to error messages in Debug mode
+* Add limit attribute to search_result_excerpt tag
+* Add escape and default attributes to custom_field tag
+* fix image-upload for outdated gdlib-installations (wet)
+* fix label attribute breadcrumb function (richard)
+* add if_author, if_article_author (with attribute 'name') (mary)
+* allow multiple sections for if_article_section (like for if_section, if_category) (mary)
+* display link category's title, rather than name, in the links page. (mary)
+* extend article_image tag to optionally display the article image thumbnail. (mary)
+* Many minor bugfixes
+
+Changes since 4.0.2:
+
+* fixed 2 potential security holes(detected in internal code review).
+  Updade is recommended. 
+* Textile i18n improvements
+* Add a bulk Ban function for comments
+* Automatically hide comments when banning an IP
+* Fix comments "page by"
+* Fix double translated linebreaks in comments.
+* Fix nofollow in comments
+* Fix preview without textile in certain edge cases
+* Seperate hidden comments into unmoderated and spam
+* Add bulk changing of comment status (visible, moderated, spam)
+* Better error-handling in comments-form when critical fields are missing
+  New tag: <txp:comments_error /> (and conditional <txp:if_comments_error >)
+  Style-able error-message and form-elements via CSS (class=comments_warn).
+* Plugin-Authors: Add callbacks for future spam-plugins [comment.save, comment.form]
+* Plugin-Authors: Add getComment() and comment_evaluator for future spam-plugins
+* Plugin-Authors: Allow (optionally, transparently) for installing compressed plugins.
+* Plugin-Authors: Add window events using addEvent, to allow multiple events loading 
+                  at window.onload, useful for admin side plugins.
+* Improve mysql5-compatibility
+* Add comment edit link to notification emails
+* Make comment-time format customizable in tag (mary)
+* Add offset-attribute to file_download_list (mary)
+* Make older, newer and link_to_home work more consistantly with other nav-tags (mary)
+* Fix mailto: links
+* Fix tag trace output for enclosing tags
+* Update comment_count after import
+* Add extra info to the tag trace (SQL queries, conditional tag results, page template and form names)
+
+Changes since 4.0.1:
+
+* Fix a bug in 404 handling on some fastcgi servers
+* Fix a bug that prevented file_download_list from working properly
+* Fix a redirection bug in the comment form
+* Fix occasional category URL i18n problems
+* Remove extra trailing slash in some breadcrumb links
+* Make articles by author work properly
+* Make feed_link support section and category correctly
+* Add correct content-type to popup comments page
+* Fix an obscure feed caching bug
+* Fix a possible problem with circular dependencies when loading plugins
+* Fix timestamps in Atom feeds
+* Fix occasional Atom encoding issues
+* UI improvements when creating/copying/deleting styles
+* Improve performance of the language loader
+* Make date-based permlinks work properly in comment emails
+* Better handling of invalid login cookies
+* Use page templates for 404 (and other) error pages
+* Minor Atom validation improvements
+* Improved comment conditionals logic; txp:if_comments now means "if the current article has at least 1 comment"
+* Minor performance improvements
+* New txp:if_status and txp:page_url tags
+* Prevent config.php whitespace from breaking stylesheets
+* UI improvements to javascript toggles
+* Improved comment input form HTML markup
+* Improved txp:section and txp:category tags
+* New tags: txp:if_different, txp:if_first_article, txp:if_last_article
+* Localize the XML feed link title
+* Better encoding of article titles
+* Fix rare problems caused by magic_quotes_runtime
+* Improved file upload forms
+* New language: Latvian
+* Support section and category titles in txp:breadcrumb
+* Allow decimals=0 in txp:file_download_size tag
+* Minor diagnostic info changes
+* New labeltag attribute on most list tags
+* Restore use_textile preference
+* Minor HTML validation fixes
+* Developers: new safe_upsert() database function
+* Fall back to English if no language data is available
+* Support comma-separated names in txp:if_category and txp:if_section
+* Identify the offending tag when displaying error messages in templates and forms
+* Add include_default attribute to txp:section_list
+* Add support for changing status and section on multiple articles at once
+* Fix nested category titles in txp:breadcrumb
+* Improved comment message markup
+* Restore the comments_closed message
+* Better handling of per-article Use Textile selection
+* Add class attribute to comments_invite for css-classes 
+* Added 4 attributes to comments_invite: showcount, wraptag, textonly (just the invite-text)
+    and showalways (also display on individual article-pages). Example:
+    <comments_invite wraptag="p" showcount="0" textonly="1" showalways="1" />
+* Support c-style backslash sequences in tag attributes
+* Fix some rare bugs in feeds, admin list paging
+* Add a pageby attribute to txp:article, for multi-column lists
+* Fix txp:link_to_next/prev so they work at the top of a page
+* Minor speed improvements, new class and linkclass attributes for txp:breadcrumb tag
+* Added txp:comments_preview and txp:if_comments_preview tags. Example usage:
+	<txp:if_comments_preview>
+	 <div id="cpreview" style="background-color:#FF0"><b>Hello, the following is your preview</b>
+	   <txp:comments_preview /><txp:comments_form preview="1" />
+	 </div>
+	</txp:if_comments_preview>
+* Fixed unparsed excerpts in Feeds.
+* Textile: smarter handling of relative link and image paths
+* Textile: stop footnote links from clashing in article lists
+* Add fi_FI locale support
+
+Changes since 4.0:
+
+* fixed some serious security issues. Updates are strongly recommended.
+* fixed textile problems (missing block-elements in some cases; notextile; span-handling)
+* fixed updating of comment_count when deleting comments
+* fixed bug in atom feeds (multiple identical excerpts)
+* added new permission level (article.edit.own.published, allows you to edit own articles _after_ publishing)
+* added very basic 404 support (correct 404 Headers are sent)
+* added new languages (Íslenska, Suomi, ..(..), ..(..))
+* fixed bugs in articles by author (clean and messy urls)
+* fixed category_list to use clean urls when appropriate
+* fixed installation problems with certain db prefixes by limiting possible prefixes
+* fixed timezone issue with ymd permlinks
+* fixed GMT formatting of dates
+* fixed bugs with i18n-ascii.txt and added a few new items
+* added language overrides to dirifying url_titles
+* several improvements to url_titles (including not updating them until published)
+* several improvements to diagnostics
+* added style and class attributes to txp:permlink
+* fixed bugs with multibyte strings in some urls
+* added contextual information to page title on the admin side
+* fixed problems with larger file downloads
+* fixed file_download_link with multiple files
+* fixed logging of file downloads (only finished downloads are counted; aborts go to normal logs)
+* fixed problems with sending mail on some systems
+* improvements to older/newer tags
+* developers: added more consistent url generation via new pagelinkurl() function
+* developers: added callbacks to public side (for example to handle 404s)
+if_article_id 

Added: trunk/www.openmoko.com/README.txt
===================================================================
--- trunk/www.openmoko.com/README.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/README.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,33 @@
+Textpattern 4.0.3 - 29 Dec 2005
+Released under the Gnu General Public License
+
+== Installation ==
+
+* Extract the files to your site (in the web root, or choose a 
+  subdirectory). The top-level index.php should reside in this 
+  directory, as should the /textpattern/ directory.
+* Create, or establish the existence of, a working mysql database,
+  load /textpattern/setup/ (or /subpath/textpattern/setup/ )
+  in a browser, and follow the directions.
+
+== Upgrading ==
+
+* Simply replace the two files in your main installation directory 
+  (index.php and .htaccess) and everything in your /textpattern/ 
+  directory (except config.php) with the corresponding files in this
+  distribution.
+* When you login to the admin-side, the relevant upgrade script is 
+  run automatically. Please take a look into diagnostics to find out 
+  whether there are any errors and whether the correct version number 
+  is displayed.
+
+== Getting Started ==
+
+* FAQ is available at http://textpattern.com/faq
+* In-Depth Documentation and tag-index is available in the TextBook-Project
+  at http://textpattern.net
+* You can get support in our forums at http://forum.textpattern.com
+
+* IMPORTANT: Regularly check back at textpattern.com to see if updates are 
+  available. 4.0.x is in maintenance mode which means updates are as painless 
+  as possible, and often fix important bugs or security-related issues.
\ No newline at end of file

Added: trunk/www.openmoko.com/errors.txt
===================================================================

Added: trunk/www.openmoko.com/ie6fix.css
===================================================================
--- trunk/www.openmoko.com/ie6fix.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/ie6fix.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,86 @@
+#middleblock_container {
+	height: 380px;
+}
+
+#middleblock_tabs {
+	bottom: 89px;
+}
+
+#middleblock_tabs li a {
+	position: relative;
+}
+
+.banner_images {
+	width: 10px;
+}
+
+.shadow {
+	background-image: none;
+	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://38one.servehttp.com/openmoko/images/product_bottom_shadow.png',sizingMethod='scale');
+}
+
+.button_enlarge {
+	background: none;
+	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://38one.servehttp.com/openmoko/images/button_enlarge.png',sizingMethod='scale');
+	top: 50%;
+	cursor: pointer;
+}
+
+.content p,
+.content ul,
+.content ol {
+/*	font-size: 12px;*/
+}
+
+
+.banner_product_thumbs li {
+	background: none;
+}
+
+.accessories_container .column1 {
+	margin-left: 5px;
+}
+
+.accessory_container {
+	height: 150px;
+}
+
+.accessories_container .description {
+	height: 90px;
+}
+
+#accessories_tabs a {
+	position: relative;
+	bottom: 0px;
+}
+
+.accessory_block_alternative #article_description {
+	height: 200px;
+	overflow:visible;
+	margin-left: 200px !important;
+}
+
+.top_link_alt {
+	margin-top: 15px;
+}
+
+.accessories_listing .pagination {
+	top: -5px;
+}
+
+.single_accessory {
+	position: relative;
+	width: 155px;
+}
+
+.single_accessory_0 {
+	margin-left: 6px;
+}
+
+.home_quote {
+	left: -5px;
+}
+
+#home_banner h1{
+	/*top: 80px;*/
+}
\ No newline at end of file

Added: trunk/www.openmoko.com/images/__sample_accessory_1.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/__sample_accessory_1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/__sample_accessory_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/__sample_accessory_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/__sample_banner_1.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/__sample_banner_1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/__sample_banner_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/__sample_banner_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/__sample_headset.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/__sample_headset.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/__sample_accessory_1.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/__sample_accessory_1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/__sample_accessory_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/__sample_accessory_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/__sample_banner_1.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/__sample_banner_1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/__sample_banner_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/__sample_banner_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/__sample_headset.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/__sample_headset.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessories_back.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessories_back.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessories_back2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessories_back2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessories_tabs_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessories_tabs_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessories_tabs_left_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessories_tabs_left_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessories_tabs_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessories_tabs_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessories_tabs_right_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessories_tabs_right_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessory_featured_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessory_featured_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessory_featured_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessory_featured_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessory_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessory_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessory_tile_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessory_tile_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessory_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessory_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/accessory_top_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/accessory_top_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/article_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/article_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/article_bullet_hover.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/article_bullet_hover.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_about.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_about.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_accessories.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_accessories.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_careers.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_careers.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_contact.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_contact.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_details.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_details.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_developers.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_developers.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_featured_accessory.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_featured_accessory.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_featured_accessory.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_featured_accessory.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_press.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_press.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_products.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_products.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/banner_search.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/banner_search.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/blank.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/blank.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/bullet_back_to_accessories.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/bullet_back_to_accessories.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_add_to_cart.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_add_to_cart.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_add_to_cart_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_add_to_cart_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_add_to_cart_white.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_add_to_cart_white.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_all_accessories.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_all_accessories.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_all_accessories_whit.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_all_accessories_whit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_buy_it_now.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_buy_it_now.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_by_it_now.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_by_it_now.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_enlarge.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_enlarge.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_go.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_go.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_go_homepage.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_go_homepage.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_more_details.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_more_details.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_more_details_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_more_details_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_news_archive.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_news_archive.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_read_more.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_read_more.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_read_more_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_read_more_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/button_select.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/button_select.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/favicon.ico
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/favicon.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/home_background.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/home_background.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/home_banner.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/home_banner.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/home_quote.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/home_quote.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/icon_rss.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/icon_rss.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/icons/icon_decrease_font.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/icons/icon_decrease_font.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/icons/icon_first.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/icons/icon_first.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/icons/icon_last.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/icons/icon_last.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/icons/icon_next.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/icons/icon_next.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/icons/icon_previous.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/icons/icon_previous.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/label/neo1973_title.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/label/neo1973_title.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/label/search_openmoko.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/label/search_openmoko.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/label/search_openmoko_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/label/search_openmoko_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/link_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/link_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/list_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/list_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/middleblock_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/middleblock_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/middleblock_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/middleblock_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/middleblock_tabs_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/middleblock_tabs_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/middleblock_tabs_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/middleblock_tabs_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/middleblock_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/middleblock_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/accessories/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/accessories/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/accessories/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/accessories/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/accessories/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/accessories/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/accessories/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/accessories/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/accessories/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/accessories/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/accessories/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/accessories/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/accessories/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/accessories/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/accessories/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/accessories/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/default/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/default/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/default/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/default/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/default/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/default/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/default/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/default/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/default/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/default/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/default/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/default/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/default/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/default/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/default/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/default/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/phone/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/phone/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/phone/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/phone/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/phone/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/phone/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/phone/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/phone/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/phone/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/phone/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/phone/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/phone/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/phone/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/phone/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/phone/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/phone/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/products/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/products/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/products/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/products/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/products/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/products/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/products/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/products/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/products/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/products/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/products/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/products/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/products/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/products/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/products/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/products/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/semi/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/semi/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/semi/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/semi/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/semi/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/semi/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/semi/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/semi/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/semi/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/semi/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/semi/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/semi/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/semi/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/semi/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/semi/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/semi/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation_accessories.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation_accessories.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation_background.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation_background.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation_default.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation_default.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation_home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation_home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation_neo.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation_neo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/navigation_products.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/navigation_products.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/openmoko_logo.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/openmoko_logo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/openmoko_logo_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/openmoko_logo_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/orange_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/orange_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/phone_toptab_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/phone_toptab_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/phone_toptab_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/phone_toptab_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/product_bottom_shadow.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/product_bottom_shadow.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/product_bottom_shadow_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/product_bottom_shadow_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/accessories/a/14aaa.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/accessories/a/14aaa.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/accessories/a/5f234.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/accessories/a/5f234.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/accessories/a/7aaa.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/accessories/a/7aaa.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/accessories/a/dasd.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/accessories/a/dasd.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/accessories/car_kit.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/accessories/car_kit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/accessories/carrying_case.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/accessories/carrying_case.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/accessories/carrying_tape.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/accessories/carrying_tape.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/accessories/hackers_lunch_box.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/accessories/hackers_lunch_box.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/accessories/stylus.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/accessories/stylus.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/banner_neo.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/banner_neo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/banner_neo2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/banner_neo2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/banner_neo2_thumb.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/banner_neo2_thumb.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/banner_neo_thumb.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/banner_neo_thumb.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/featured.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/featured.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/hackers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/hackers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products/hackers_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products/hackers_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/products_page.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/products_page.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/sidebox_bottom.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/sidebox_bottom.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/sidebox_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/sidebox_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/sidebox_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/sidebox_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/titlebar_accessories.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/titlebar_accessories.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/titlebar_products.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/titlebar_products.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/top_link.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/top_link.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/toptab_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/toptab_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/a/toptab_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/a/toptab_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessories_back.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessories_back.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessories_back2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessories_back2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessories_tabs_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessories_tabs_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessories_tabs_left_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessories_tabs_left_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessories_tabs_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessories_tabs_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessories_tabs_right_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessories_tabs_right_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessory_featured_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessory_featured_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessory_featured_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessory_featured_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessory_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessory_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessory_tile_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessory_tile_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessory_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessory_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/accessory_top_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/accessory_top_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/article_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/article_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/article_bullet_hover.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/article_bullet_hover.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/__sample_accessory_1.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/__sample_accessory_1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/__sample_accessory_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/__sample_accessory_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/__sample_banner_1.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/__sample_banner_1.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/__sample_banner_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/__sample_banner_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/__sample_headset.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/__sample_headset.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessories_back.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessories_back.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessories_back2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessories_back2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessories_tabs_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessories_tabs_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessories_tabs_left_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessories_tabs_left_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessories_tabs_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessories_tabs_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessories_tabs_right_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessories_tabs_right_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessory_featured_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessory_featured_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessory_featured_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessory_featured_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessory_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessory_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessory_tile_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessory_tile_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessory_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessory_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/accessory_top_alt.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/accessory_top_alt.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/article_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/article_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/article_bullet_hover.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/article_bullet_hover.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_about.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_about.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_accessories.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_accessories.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_careers.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_careers.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_contact.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_contact.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_details.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_details.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_developers.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_developers.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_featured_accessory.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_featured_accessory.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_featured_accessory.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_featured_accessory.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_press.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_press.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_products.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_products.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/banner_search.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/banner_search.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/blank.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/blank.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/bullet_back_to_accessories.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/bullet_back_to_accessories.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_add_to_cart.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_add_to_cart.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_add_to_cart_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_add_to_cart_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_add_to_cart_white.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_add_to_cart_white.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_all_accessories.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_all_accessories.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_all_accessories_whit.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_all_accessories_whit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_buy_it_now.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_buy_it_now.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_by_it_now.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_by_it_now.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_enlarge.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_enlarge.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_go.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_go.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_go_homepage.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_go_homepage.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_more_details.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_more_details.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_more_details_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_more_details_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_news_archive.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_news_archive.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_read_more.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_read_more.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_read_more_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_read_more_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/button_select.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/button_select.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/favicon.ico
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/favicon.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/home_background.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/home_background.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/home_banner.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/home_banner.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/home_quote.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/home_quote.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/icon_rss.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/icon_rss.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/icons/icon_decrease_font.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/icons/icon_decrease_font.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/icons/icon_first.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/icons/icon_first.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/icons/icon_last.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/icons/icon_last.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/icons/icon_next.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/icons/icon_next.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/icons/icon_previous.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/icons/icon_previous.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/label/neo1973_title.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/label/neo1973_title.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/label/search_openmoko.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/label/search_openmoko.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/label/search_openmoko_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/label/search_openmoko_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/link_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/link_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/list_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/list_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/middleblock_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/middleblock_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/middleblock_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/middleblock_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/middleblock_tabs_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/middleblock_tabs_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/middleblock_tabs_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/middleblock_tabs_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/middleblock_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/middleblock_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/accessories/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/accessories/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/accessories/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/accessories/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/accessories/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/accessories/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/accessories/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/accessories/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/accessories/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/accessories/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/accessories/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/accessories/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/accessories/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/accessories/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/accessories/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/accessories/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/default/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/default/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/default/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/default/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/default/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/default/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/default/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/default/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/default/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/default/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/default/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/default/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/default/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/default/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/default/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/default/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/phone/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/phone/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/phone/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/phone/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/phone/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/phone/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/phone/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/phone/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/phone/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/phone/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/phone/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/phone/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/phone/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/phone/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/phone/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/phone/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/products/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/products/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/products/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/products/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/products/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/products/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/products/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/products/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/products/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/products/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/products/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/products/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/products/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/products/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/products/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/products/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/semi/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/semi/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/semi/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/semi/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/semi/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/semi/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/semi/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/semi/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/semi/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/semi/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/semi/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/semi/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/semi/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/semi/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/semi/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/semi/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation_accessories.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation_accessories.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation_background.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation_background.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation_default.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation_default.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation_home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation_home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation_neo.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation_neo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/navigation_products.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/navigation_products.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/openmoko_logo.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/openmoko_logo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/openmoko_logo_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/openmoko_logo_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/orange_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/orange_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/phone_toptab_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/phone_toptab_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/phone_toptab_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/phone_toptab_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/product_bottom_shadow.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/product_bottom_shadow.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/product_bottom_shadow_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/product_bottom_shadow_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/accessories/a/14aaa.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/accessories/a/14aaa.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/accessories/a/5f234.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/accessories/a/5f234.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/accessories/a/7aaa.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/accessories/a/7aaa.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/accessories/a/dasd.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/accessories/a/dasd.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/accessories/car_kit.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/accessories/car_kit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/accessories/carrying_case.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/accessories/carrying_case.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/accessories/carrying_tape.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/accessories/carrying_tape.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/accessories/hackers_lunch_box.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/accessories/hackers_lunch_box.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/accessories/stylus.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/accessories/stylus.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/banner_neo.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/banner_neo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/banner_neo2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/banner_neo2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/banner_neo2_thumb.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/banner_neo2_thumb.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/banner_neo_thumb.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/banner_neo_thumb.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/featured.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/featured.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/hackers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/hackers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products/hackers_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products/hackers_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/products_page.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/products_page.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/sidebox_bottom.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/sidebox_bottom.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/sidebox_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/sidebox_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/sidebox_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/sidebox_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/titlebar_accessories.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/titlebar_accessories.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/titlebar_products.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/titlebar_products.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/top_link.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/top_link.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/toptab_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/toptab_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bak/toptab_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bak/toptab_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_about.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_about.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_accessories.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_accessories.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_careers.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_careers.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_contact.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_contact.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_details.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_details.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_developers.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_developers.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_featured_accessory.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_featured_accessory.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_featured_accessory.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_featured_accessory.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_press.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_press.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_products.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_products.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/banner_search.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/banner_search.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/blank.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/blank.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/bullet_back_to_accessories.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/bullet_back_to_accessories.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_add_to_cart.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_add_to_cart.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_add_to_cart_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_add_to_cart_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_add_to_cart_white.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_add_to_cart_white.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_all_accessories.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_all_accessories.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_all_accessories_whit.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_all_accessories_whit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_buy_it_now.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_buy_it_now.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_by_it_now.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_by_it_now.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_enlarge.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_enlarge.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_go.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_go.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_go_homepage.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_go_homepage.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_more_details.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_more_details.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_more_details_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_more_details_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_news_archive.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_news_archive.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_read_more.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_read_more.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_read_more_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_read_more_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/button_select.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/button_select.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/contact_map.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/contact_map.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/favicon.ico
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/favicon.ico
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/home_background.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/home_background.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/home_banner.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/home_banner.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/home_quote.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/home_quote.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/icon_rss.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/icon_rss.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/icons/icon_decrease_font.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/icons/icon_decrease_font.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/icons/icon_first.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/icons/icon_first.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/icons/icon_last.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/icons/icon_last.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/icons/icon_next.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/icons/icon_next.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/icons/icon_previous.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/icons/icon_previous.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/label/neo1973_title.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/label/neo1973_title.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/label/search_openmoko.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/label/search_openmoko.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/label/search_openmoko_gray.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/label/search_openmoko_gray.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/link_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/link_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/list_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/list_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/middleblock_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/middleblock_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/middleblock_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/middleblock_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/middleblock_tabs_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/middleblock_tabs_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/middleblock_tabs_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/middleblock_tabs_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/middleblock_tile.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/middleblock_tile.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/middleblock_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/middleblock_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/accessories/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/accessories/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/accessories/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/accessories/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/accessories/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/accessories/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/accessories/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/accessories/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/accessories/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/accessories/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/accessories/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/accessories/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/accessories/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/accessories/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/accessories/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/accessories/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/default/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/default/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/default/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/default/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/default/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/default/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/default/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/default/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/default/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/default/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/default/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/default/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/default/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/default/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/default/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/default/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/phone/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/phone/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/phone/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/phone/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/phone/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/phone/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/phone/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/phone/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/phone/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/phone/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/phone/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/phone/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/phone/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/phone/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/phone/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/phone/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/products/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/products/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/products/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/products/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/products/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/products/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/products/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/products/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/products/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/products/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/products/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/products/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/products/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/products/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/products/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/products/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/semi/about.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/semi/about.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/semi/careers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/semi/careers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/semi/contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/semi/contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/semi/developers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/semi/developers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/semi/home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/semi/home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/semi/press.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/semi/press.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/semi/products.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/semi/products.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/semi/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/semi/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation/shop.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation/shop.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation_accessories.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation_accessories.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation_background.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation_background.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation_default.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation_default.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation_home.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation_home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation_neo.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation_neo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/navigation_products.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/navigation_products.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/openmoko_logo.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/openmoko_logo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/openmoko_logo_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/openmoko_logo_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/orange_bullet.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/orange_bullet.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/phone_toptab_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/phone_toptab_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/phone_toptab_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/phone_toptab_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/product_bottom_shadow.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/product_bottom_shadow.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/product_bottom_shadow_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/product_bottom_shadow_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/accessories/a/14aaa.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/accessories/a/14aaa.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/accessories/a/5f234.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/accessories/a/5f234.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/accessories/a/7aaa.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/accessories/a/7aaa.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/accessories/a/dasd.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/accessories/a/dasd.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/accessories/car_kit.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/accessories/car_kit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/accessories/carrying_case.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/accessories/carrying_case.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/accessories/carrying_tape.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/accessories/carrying_tape.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/accessories/hackers_lunch_box.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/accessories/hackers_lunch_box.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/accessories/stylus.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/accessories/stylus.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/banner_neo.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/banner_neo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/banner_neo2.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/banner_neo2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/banner_neo2_thumb.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/banner_neo2_thumb.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/banner_neo_thumb.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/banner_neo_thumb.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/featured.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/featured.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/hackers.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/hackers.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products/hackers_small.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products/hackers_small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/products_page.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/products_page.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/sidebox_bottom.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/sidebox_bottom.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/sidebox_tile.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/sidebox_tile.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/sidebox_top.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/sidebox_top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/thumb_background.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/thumb_background.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/titlebar_accessories.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/titlebar_accessories.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/titlebar_products.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/titlebar_products.jpg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/top_link.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/top_link.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/toptab_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/toptab_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/toptab_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/toptab_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/turn_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/turn_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/images/turn_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/images/turn_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/inc/about.html
===================================================================
--- trunk/www.openmoko.com/inc/about.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/about.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,59 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+
+	<txp:output_form form="moko_header" />
+		
+	<div class="left_container">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container">
+
+			<txp:php>
+				$default_document = 25;
+				
+				global $current_article_id;		
+				$current_article_id = $GLOBALS['thisarticle']['thisid'];
+				if (!$current_article_id) $current_article_id = $default_document;
+			</txp:php>
+
+			<ul class="article_list">
+				<txp:article_custom section="about" form="simple_links" />
+			</ul>
+				
+			<div class="content page_content" id="site_content">			
+				<txp:if_individual_article>
+					<txp:article form="simple_article" />
+				<txp:else />
+					<txp:article form="simple_article" id="25"/>
+				</txp:if_individual_article>
+				<a href="#" class="top_link"><span>top</span></a>
+			</div>	
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/accessory.html
===================================================================
--- trunk/www.openmoko.com/inc/accessory.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/accessory.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,250 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+
+	<txp:output_form form="moko_header" />
+		
+	<div class="left_container">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container">
+			<div class="accessory_block"><div class="inner">
+				<div id="article_description">
+					<h2><txp:title /></h2>
+					<div class="description">
+						<txp:body />
+					</div>
+					
+					<div class="accessory_image">
+						 <txp:php>		
+							global $thisarticle;
+							$article_image = trim($thisarticle['article_image']);
+							$article_images = explode(',',$article_image);
+							if (count($article_images)>1) {
+								$article_image = $article_images[1];
+							} else {
+								$article_image = $article_images[0];
+							}
+							
+							if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+								$rs = safe_row('*', 'txp_image', "id = $article_image limit 1");						
+								
+								if (strtolower($rs['ext']) == '.png') {
+									global $prefs;
+									
+									$filepath = "http://".$prefs['siteurl'].'/'.$prefs['img_dir'].'/';
+									$siteroot = "http://".$prefs['siteurl'].'/';
+	
+									$filename=$article_image.$rs['ext']; $width = $rs['w']; $height = $rs['h'];
+									$alt = isset($rs['alt']) ? $rs['alt'] : $rs['name'];
+									
+									echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\" />";
+								} else {
+									$image = image(array("id"=>$article_image));
+									echo $image;
+								}
+							} else {				
+								$image = image(array("id"=>$article_image));
+								echo $image;
+							}
+						</txp:php>
+					</div>
+					
+					<a href="#" class="button_by_it_now img_button"><span>By it now</span></a>
+				</div>
+				
+				<ul id="accessories_tabs">
+					<li><a href="#tab_main_article_0" onclick="return showTab('main',0)" id="tab_main_article_0_link" class="selected"><span>Standard Kit</span></a></li>
+					<li><a href="#tab_main_article_1" onclick="return showTab('main',1)" id="tab_main_article_1_link"><span>Pictures</span></a></li>
+					<li><a href="#tab_main_article_2" onclick="return showTab('main',2)" id="tab_main_article_2_link"><span>Screenshots</span></a></li>
+				</ul>
+				<div class="clear"></div>
+			</div></div>
+		
+		<div class="main_container tab_item" id="tab_main_article_0">
+			<div class="left_column accessories_left">
+				<h3>What's Included:</h3>
+				<ul>
+					<txp:php>
+						global $thisarticle;
+						global $current_article;
+						$current_article = $thisarticle['url_title'];
+						
+						$GLOBALS['pretext']['tab_counter']="standard_kit";
+						$GLOBALS['pretext']['article_counter']=0;
+						$GLOBALS['pretext']['current_category'] = $current_article.'_standard-kit';
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory_link',
+							"section" => 'products',
+							"category"=> $current_article
+						));
+						
+						echo $articles;
+					</txp:php>
+				
+				</ul>
+			</div>
+			
+			<div class="content right_column accessories_right" id="site_content">
+					<txp:php>
+						global $thisarticle;
+						$GLOBALS['pretext']['article_counter']=0;
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory',
+							"section" => 'products',
+							"category"=> $thisarticle['url_title']
+						));
+						
+						echo $articles;
+					</txp:php>
+					
+					<a href="#" class="top_link"><span>top</span></a>
+					
+					<script type="text/javascript">
+						_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+						showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+					</script>
+			</div>
+			
+			<div class="clear"></div>
+		</div>
+
+	<script type="text/javascript">
+		_pageTabs['main']=5;
+		showTab('main',0);
+	</script> 
+	
+		<div class="main_container tab_item" id="tab_main_article_1">
+			<div class="left_column accessories_left">
+				<h3>What's Included:</h3>
+				<ul>
+					<txp:php>
+						global $thisarticle;
+						global $current_article;
+						$current_article = $thisarticle['url_title'];
+						
+						$GLOBALS['pretext']['tab_counter']="pictures";
+						$GLOBALS['pretext']['article_counter']=0;
+						$GLOBALS['pretext']['current_category'] = $current_article.'_pictures';
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory_link',
+							"section" => 'products',
+							"category"=> $current_article
+						));
+						
+						echo $articles;
+					</txp:php>
+				
+				</ul>
+			</div>
+			
+			<div class="content right_column accessories_right">
+					<txp:php>
+						global $thisarticle;
+						$GLOBALS['pretext']['article_counter']=0;
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory',
+							"section" => 'products',
+							"category"=> $thisarticle['url_title']
+						));
+						
+						echo $articles;
+					</txp:php>
+			
+					<a href="#" class="top_link"><span>top</span></a>
+					
+					<script type="text/javascript">
+						_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+						showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+					</script>
+			</div>
+			
+			<div class="clear"></div>
+		</div>
+	
+		<div class="main_container tab_item" id="tab_main_article_2">
+			<div class="left_column accessories_left">
+				<h3>What's Included:</h3>
+				<ul>
+					<txp:php>
+						global $thisarticle;
+						global $current_article;
+						$current_article = $thisarticle['url_title'];
+						
+						$GLOBALS['pretext']['tab_counter']="screenshots";
+						$GLOBALS['pretext']['article_counter']=0;
+						$GLOBALS['pretext']['current_category'] = $current_article.'_screenshots';
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory_link',
+							"section" => 'products',
+							"category"=> $current_article
+						));
+						
+						echo $articles;
+					</txp:php>
+				
+				</ul>
+			</div>
+			
+			<div class="content right_column accessories_right">
+					<txp:php>
+						global $thisarticle;
+						$GLOBALS['pretext']['article_counter']=0;
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory',
+							"section" => 'products',
+							"category"=> $thisarticle['url_title']
+						));
+						
+						echo $articles;
+					</txp:php>
+			
+					<a href="#" class="top_link"><span>top</span></a>
+			
+					<script type="text/javascript">
+						_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+						showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+					</script>
+			</div>
+			
+			<div class="clear"></div>
+		</div>
+		
+		<div class="back_to_accessories_container">
+			<a href="<txp:link_to_home />products/accessories">Back to accessories</a>
+		</div>
+
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/accessory_alternative.html
===================================================================
--- trunk/www.openmoko.com/inc/accessory_alternative.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/accessory_alternative.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,250 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+
+	<txp:output_form form="moko_header" />
+		
+	<div class="left_container">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container">
+			<div class="accessory_block accessory_block_alternative"><div class="inner">
+				<div id="article_description">
+					<h2><txp:title /></h2>
+					<div class="description">
+						<txp:body />
+					</div>
+					
+					<div class="accessory_image">
+						 <txp:php>		
+							global $thisarticle;
+							$article_image = trim($thisarticle['article_image']);
+							$article_images = explode(',',$article_image);
+							if (count($article_images)>1) {
+								$article_image = $article_images[1];
+							} else {
+								$article_image = $article_images[0];
+							}
+							
+							if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+								$rs = safe_row('*', 'txp_image', "id = $article_image limit 1");						
+								
+								if (strtolower($rs['ext']) == '.png') {
+									global $prefs;
+									
+									$filepath = "http://".$prefs['siteurl'].'/'.$prefs['img_dir'].'/';
+									$siteroot = "http://".$prefs['siteurl'].'/';
+	
+									$filename=$article_image.$rs['ext']; $width = $rs['w']; $height = $rs['h'];
+									$alt = isset($rs['alt']) ? $rs['alt'] : $rs['name'];
+									
+									echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\" />";
+								} else {
+									$image = image(array("id"=>$article_image));
+									echo $image;
+								}
+							} else {				
+								$image = image(array("id"=>$article_image));
+								echo $image;
+							}
+						</txp:php>
+					</div>
+					
+					<a href="#" class="button_by_it_now img_button"><span>By it now</span></a>
+				</div>
+				
+				<ul id="accessories_tabs">
+					<li><a href="#tab_main_article_0" onclick="return showTab('main',0)" id="tab_main_article_0_link" class="selected"><span>Standard Kit</span></a></li>
+					<li><a href="#tab_main_article_1" onclick="return showTab('main',1)" id="tab_main_article_1_link"><span>Pictures</span></a></li>
+					<li><a href="#tab_main_article_2" onclick="return showTab('main',2)" id="tab_main_article_2_link"><span>Screenshots</span></a></li>
+				</ul>
+				<div class="clear"></div>
+			</div></div>
+		
+		<div class="main_container tab_item" id="tab_main_article_0">
+			<div class="left_column accessories_left">
+				<h3>What's Included:</h3>
+				<ul>
+					<txp:php>
+						global $thisarticle;
+						global $current_article;
+						$current_article = $thisarticle['url_title'];
+						
+						$GLOBALS['pretext']['tab_counter']="standard_kit";
+						$GLOBALS['pretext']['article_counter']=0;
+						$GLOBALS['pretext']['current_category'] = $current_article.'_standard-kit';
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory_link',
+							"section" => 'products',
+							"category"=> $current_article
+						));
+						
+						echo $articles;
+					</txp:php>
+				
+				</ul>
+			</div>
+			
+			<div class="content right_column accessories_right" id="site_content">
+					<txp:php>
+						global $thisarticle;
+						$GLOBALS['pretext']['article_counter']=0;
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory',
+							"section" => 'products',
+							"category"=> $thisarticle['url_title']
+						));
+						
+						echo $articles;
+					</txp:php>
+					
+					<a href="#" class="top_link"><span>top</span></a>
+			
+					<script type="text/javascript">
+						_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+						showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+					</script>
+			</div>
+			
+			<div class="clear"></div>
+		</div>
+
+	<script type="text/javascript">
+		_pageTabs['main']=5;
+		showTab('main',0);
+	</script> 
+	
+		<div class="main_container tab_item" id="tab_main_article_1">
+			<div class="left_column accessories_left">
+				<h3>What's Included:</h3>
+				<ul>
+					<txp:php>
+						global $thisarticle;
+						global $current_article;
+						$current_article = $thisarticle['url_title'];
+						
+						$GLOBALS['pretext']['tab_counter']="pictures";
+						$GLOBALS['pretext']['article_counter']=0;
+						$GLOBALS['pretext']['current_category'] = $current_article.'_pictures';
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory_link',
+							"section" => 'products',
+							"category"=> $current_article
+						));
+						
+						echo $articles;
+					</txp:php>
+				
+				</ul>
+			</div>
+			
+			<div class="content right_column accessories_right">
+					<txp:php>
+						global $thisarticle;
+						$GLOBALS['pretext']['article_counter']=0;
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory',
+							"section" => 'products',
+							"category"=> $thisarticle['url_title']
+						));
+						
+						echo $articles;
+					</txp:php>
+					
+					<a href="#" class="top_link"><span>top</span></a>
+			
+					<script type="text/javascript">
+						_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+						showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+					</script>
+			</div>
+			
+			<div class="clear"></div>
+		</div>
+	
+		<div class="main_container tab_item" id="tab_main_article_2">
+			<div class="left_column accessories_left">
+				<h3>What's Included:</h3>
+				<ul>
+					<txp:php>
+						global $thisarticle;
+						global $current_article;
+						$current_article = $thisarticle['url_title'];
+						
+						$GLOBALS['pretext']['tab_counter']="screenshots";
+						$GLOBALS['pretext']['article_counter']=0;
+						$GLOBALS['pretext']['current_category'] = $current_article.'_screenshots';
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory_link',
+							"section" => 'products',
+							"category"=> $current_article
+						));
+						
+						echo $articles;
+					</txp:php>
+				
+				</ul>
+			</div>
+			
+			<div class="content right_column accessories_right">
+					<txp:php>
+						global $thisarticle;
+						$GLOBALS['pretext']['article_counter']=0;
+						
+						$articles= article_custom (array(
+							"form" => 'moko_accessory',
+							"section" => 'products',
+							"category"=> $thisarticle['url_title']
+						));
+						
+						echo $articles;
+					</txp:php>
+					
+					<a href="#" class="top_link"><span>top</span></a>
+			
+					<script type="text/javascript">
+						_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+						showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+					</script>
+			</div>
+			
+			<div class="clear"></div>
+		</div>
+
+		<div class="back_to_accessories_container">
+			<a href="<txp:link_to_home />products/accessories">Back to accessories</a>
+		</div>
+
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/accessory_simple.html
===================================================================
--- trunk/www.openmoko.com/inc/accessory_simple.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/accessory_simple.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,88 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+
+	<txp:output_form form="moko_header" />
+		
+	<div class="left_container">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container">
+			<div class="accessory_block"><div class="inner">
+				<div id="article_description">
+					<h2><txp:title /></h2>
+					<div class="description">
+						<txp:body />
+					</div>
+					
+					<div class="accessory_image">
+						 <txp:php>		
+							global $thisarticle;
+							$article_image = trim($thisarticle['article_image']);
+							$article_images = explode(',',$article_image);
+							if (count($article_images)>1) {
+								$article_image = $article_images[1];
+							} else {
+								$article_image = $article_images[0];
+							}
+							
+							if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+								$rs = safe_row('*', 'txp_image', "id = $article_image limit 1");						
+								
+								if (strtolower($rs['ext']) == '.png') {
+									global $prefs;
+									
+									$filepath = "http://".$prefs['siteurl'].'/'.$prefs['img_dir'].'/';
+									$siteroot = "http://".$prefs['siteurl'].'/';
+	
+									$filename=$article_image.$rs['ext']; $width = $rs['w']; $height = $rs['h'];
+									$alt = isset($rs['alt']) ? $rs['alt'] : $rs['name'];
+									
+									echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\" />";
+								} else {
+									$image = image(array("id"=>$article_image));
+									echo $image;
+								}
+							} else {				
+								$image = image(array("id"=>$article_image));
+								echo $image;
+							}
+						</txp:php>
+					</div>
+					
+					<a href="#" class="button_by_it_now img_button"><span>By it now</span></a>
+				</div>
+			</div></div>
+			
+		<div class="back_to_accessories_container">
+			<a href="<txp:link_to_home />products/accessories">Back to accessories</a>
+		</div>
+
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/careers.html
===================================================================
--- trunk/www.openmoko.com/inc/careers.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/careers.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,72 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+
+	<txp:output_form form="moko_header" />
+	
+	<div class="left_container">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container">
+							
+			<div class="left_content">
+				<ul class="press_listing careers">
+				<txp:category_list parent="careers" exclude="careers" section="careers" break="li" active_class="selected"/>
+				</ul>
+			</div>
+			
+			<div class="content page_content" id="site_content">			
+				<txp:if_individual_article>
+					<txp:article form="simple_article" />
+					
+					<div class="career_apply">
+						<h3>Apply for this job:</h3>
+						<p>If you’re interested in this position at OpenMoko send us your resume at <a href="mailto:jobs at openmoko.com">jobs at openmoko.com</a></p>
+					</div>
+				<txp:else />				
+					<txp:if_category>	
+							<h2><txp:category title="true" /> Careers</h2>
+					<txp:else />
+						<h2>Latest Career Opportunities</h2>
+					</txp:if_category>
+				<div class="press_container">
+					<txp:php>if(!$_GET['year']) echo "<ul>\n";</txp:php>
+					<txp:if_category>
+						<txp:article form="careers_list"/>
+					<txp:else />
+						<txp:article_custom limit=10 form="careers_list" section="careers" />
+					</txp:if_category>
+					</ul>
+				</div>
+				</txp:if_individual_article>
+				
+				<a href="#" class="top_link"><span>top</span></a>
+			</div>	
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/contact.html
===================================================================
--- trunk/www.openmoko.com/inc/contact.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/contact.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,80 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+
+	<txp:output_form form="moko_header" />
+		
+	<div class="left_container">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container">
+			<div class="content" id="site_content">
+				<h2>Contact Us</h2>
+                
+                <div class="contact_single_block">
+                	<h3>General E-Mail</h3>
+                    <p class="contact_mails"><span>General information</span><a href="mailto:contact at openmoko.com">contact at openmoko.com</a></p>
+                    <p class="contact_mails"><span>Sales information</span><a href="mailto:sales at openmoko.com">sales at openmoko.com</a></p>
+                    <p class="contact_mails"><span>Investor relations</span><a href="mailto:investors at openmoko.com">investors at openmoko.com</a></p>
+                    <p class="contact_mails"><span>Employment</span><a href="mailto:jobs at openmoko.com">jobs at openmoko.com</a></p>
+                </div>
+                
+                <div class="contact_single_block">
+                	<div class="contact_column">
+                    	<txp:article_custom id="62" form="article_simple" />
+	                </div>
+                    
+                	<div class="contact_column">
+                    	<txp:article_custom id="61" form="article_simple" />
+                    </div>
+                    
+                    <div class="clear"></div>
+                </div>
+                
+                <div class="contact_single_block">
+	                <h3>Directions and Map</h3>
+                    <div class="contact_map_container">
+                    	<img src="<txp:link_to_home/>images/contact_map.png" alt="map" />
+                    </div>
+                    
+	               	<div class="contact_column">
+                    	<txp:article_custom id="60" form="article_body" />
+                    </div>
+                    
+	               	<div class="contact_column">
+                    	<txp:article_custom id="59" form="article_body" />
+                    </div>
+                    
+                    <div class="clear"></div>
+                </div>
+
+				<a href="#" class="top_link"><span>top</span></a>
+			</div>	
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/default.html
===================================================================
--- trunk/www.openmoko.com/inc/default.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/default.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,92 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+	<txp:output_form form="moko_html_header" />
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+<body>
+
+<div id="wrapper">
+	<txp:output_form form="moko_header" />
+	
+	<div id="site_content"></div>
+	<div id="home_banner">
+		<h1>OpenMoko:</h1>
+					
+		<ul class="home_tabs_links">
+			<li>OpenMoko:</li>
+			<txp:php>
+				$GLOBALS['pretext']['tab_counter']="standard_kit";
+				$GLOBALS['pretext']['article_counter']=0;
+			</txp:php>
+			<txp:article_custom form="js_tabs_links" category="homepage-tabs"/>
+		</ul>
+		
+		<div class="home_tabs">
+			<txp:php>
+			$GLOBALS['pretext']['article_counter']=0;
+			</txp:php>
+			<txp:article_custom form="js_tabs_alt" category="homepage-tabs"/>
+		</div>
+				
+		<script type="text/javascript">
+			_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+			showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+		</script>
+	</div>
+	
+	<div id="home_content">
+			<div class="column1">
+				<h2><span>Latest on OpenMoko</span></h2>
+				<a href="#" class="rss_icon_link"><span>RSS</span></a>
+				<ul class="press_list">
+					<txp:article_custom section="press" form="press_links" limit="5"/>
+				</ul>
+				<a href="<txp:link_to_home />press" class="button_news_archive img_button"><span>News Archive</span></a>
+			</div>
+	
+			<div class="column2">
+				<txp:php>
+					// Homepage quote article
+					include txpath.'/lib/classTextile.php';
+						
+					$product_id = 94;
+					global $hcq;
+					$hcq = safe_row('title,body,url_title,custom_1', 'textpattern', "id = $product_id limit 1");
+				</txp:php>
+			
+				<form id="home_searchform" method="get" action="<txp:link_to_home />">
+					<label>Search openmoko</label>
+					<input type="hidden" name="s" value="search" />
+					<input type="text" class="input_text" name="q" />
+					<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go_homepage.png" alt="GO"/>
+				</form>
+			
+				<div class="home_quote">
+					<txp:php>echo $GLOBALS['hcq']['body'];</txp:php>
+					<div class="author"><txp:php>echo $GLOBALS['hcq']['custom_1'];</txp:php></div>
+				</div>
+				
+				<txp:php>
+					// Homepage column article
+						
+					$product_id = 93;
+					global $hca;
+					$hca = safe_row('title,body,url_title', 'textpattern', "id = $product_id limit 1");
+				</txp:php>
+				
+				<h2><span><txp:php> $txtile = new Textile; echo $txtile->TextileThis($GLOBALS['hca']['title'],'',1);</txp:php></span></h2>
+				<txp:php> $txtile = new Textile; echo $txtile->TextileThis($GLOBALS['hca']['body']);</txp:php>
+				<a href="#" class="button_read_more button_read_more_gray"><span>Read More</span></a>
+			</div>
+	
+			<div class="clear"></div>
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/developers.html
===================================================================
--- trunk/www.openmoko.com/inc/developers.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/developers.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+</head>
+
+<body>
+
+<div id="wrapper">
+
+	<txp:output_form form="moko_header" />
+	
+	<div class="left_container">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container">
+
+			<txp:php>
+				$default_document = 37;
+				
+				global $current_article_id;		
+				$current_article_id = $GLOBALS['thisarticle']['thisid'];
+				if (!$current_article_id) $current_article_id = $default_document;
+			</txp:php>
+
+			<ul class="article_list">
+				<txp:article_custom section="developers" form="simple_links" />
+			</ul>
+				
+			<div class="content page_content" id="site_content">			
+				<txp:if_individual_article>
+					<txp:article form="simple_article" />
+				<txp:else />
+					<txp:article form="simple_article" id="37"/>
+				</txp:if_individual_article>
+				
+				<a href="#" class="top_link"><span>top</span></a>
+			</div>	
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/old_prod.html
===================================================================
--- trunk/www.openmoko.com/inc/old_prod.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/old_prod.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+<txp:if_individual_article>
+   <txp:php>
+      global $thisarticle;
+      if (($thisarticle['category1'] == 'accessories') or ($thisarticle['category2'] == 'accessories') or ($thisarticle['category1'] == 'featured') or ($thisarticle['category2'] == 'featured')) {
+        if (strtolower($thisarticle['custom2']) == 'alternative') {
+           include('inc/accessory_alternative.html');
+        } else if (strtolower($thisarticle['custom2']) == 'simple') {
+           include('inc/accessory_simple.html');
+        } else {
+           include('inc/accessory.html');
+        }
+      } else {
+        include('inc/product_'.$thisarticle['url_title'].'.html');
+      }
+   </txp:php>
+<txp:article form="nodisplay" />   
+<txp:else />
+   <txp:php>include('inc/products.html');</txp:php>
+</txp:if_individual_article>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/press.html
===================================================================
--- trunk/www.openmoko.com/inc/press.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/press.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,95 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+
+	<txp:output_form form="moko_header" />
+	
+	<div class="left_container">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container">					
+			<div class="left_content">
+			
+				<txp:if_individual_article>
+				
+				<txp:php>
+					global $thisarticle;
+					global $current_category;
+					global $current_year;
+					
+					$current_category = $thisarticle['category1'];
+					$current_year = date("Y",$thisarticle['posted']);
+				</txp:php>
+				
+				<ul class="press_listing">
+					<li class="press_category"><a href="<txp:link_to_home /><txp:s/>/?c=press_releases"<txp:php>global $pretext; if (($pretext['c']=='press_releases') and (!$_GET['year'])) echo ' class="selected"';</txp:php>>Press Releases</a></li>
+					<txp:article_custom limit=99999 form="press_years_alternate" category="press_releases"/>
+				</ul>
+				
+				<ul class="press_listing separated">
+					<li class="press_category"><a href="<txp:link_to_home /><txp:s/>/?c=media_coverage"<txp:php>global $pretext; if (($pretext['c']=='media_coverage') and (!$_GET['year'])) echo ' class="selected"';</txp:php>>Media Coverage</a></li>
+					<txp:article_custom limit=99999 form="press_years_alternate" category="media_coverage"/>
+				</ul>
+				<txp:else />
+				<ul class="press_listing">
+					<li class="press_category"><a href="<txp:link_to_home /><txp:s/>/?c=press_releases"<txp:php>global $pretext; if (($pretext['c']=='press_releases') and (!$_GET['year'])) echo ' class="selected"';</txp:php>>Press Releases</a></li>
+					<txp:article_custom limit=99999 form="press_years" category="press_releases"/>
+				</ul>
+				
+				<ul class="press_listing separated">
+					<li class="press_category"><a href="<txp:link_to_home /><txp:s/>/?c=media_coverage"<txp:php>global $pretext; if (($pretext['c']=='media_coverage') and (!$_GET['year'])) echo ' class="selected"';</txp:php>>Media Coverage</a></li>
+					<txp:article_custom limit=99999 form="press_years" category="media_coverage"/>
+				</ul>
+				</txp:if_individual_article>
+			</div>
+			
+			<div class="content page_content" id="site_content">			
+				<txp:if_individual_article>
+					<txp:article form="simple_article" />
+				<txp:else />				
+					<txp:if_category>			
+							<h2><txp:category title="true" /><txp:php>if($_GET['year']) echo " for year ".$_GET['year'];</txp:php></h2>
+					<txp:else />
+						<h2>Latest Press and Media Coverage Items</h2>
+					</txp:if_category>
+				<div class="press_container">
+					<txp:php>if(!$_GET['year']) echo "<ul>\n";</txp:php>
+					<txp:if_category>
+						<txp:article form="press_archive"/>
+					<txp:else />
+						<txp:article_custom limit=10 form="press_archive" section="press" />
+					</txp:if_category>
+					</ul>
+				</div>
+				</txp:if_individual_article>
+				
+				<a href="#" class="top_link"><span>top</span></a>
+			</div>	
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/product_accessories.html
===================================================================
--- trunk/www.openmoko.com/inc/product_accessories.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/product_accessories.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,192 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+	<txp:output_form form="moko_header" />
+	
+	<div id="featured_accessory">
+		<div id="article_description" class="featured_product">
+		<txp:php>				
+			global $featured;
+			
+			$product_id = 90;
+			$featured =  safe_row('title,body,url_title,excerpt,image', 'textpattern', "id = ".$product_id." limit 1");
+			
+			echo "<h2>".$featured['title']."</h2>";
+			echo "<div class='description'>".$featured['excerpt']."</div>";
+			echo "<a href='".link_to_home(array())."products/".$featured['url_title']."' class='button_more_details img_button'><span>More Details</span></a>";
+
+		</txp:php>
+		</div>
+		
+		<txp:php>
+			global $featured;
+			
+			if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+						$images = explode(",",trim($featured['image']));
+						$image_name = $images[0];
+						$rs = safe_row('*', 'txp_image', "id = $image_name");						
+						
+						if (strtolower($rs['ext']) == '.png') {
+							global $prefs;
+							
+							$filepath = "http://".$prefs['siteurl'].'/'.$prefs['img_dir'].'/';
+							$siteroot = "http://".$prefs['siteurl'].'/';
+
+							$filename=$image_name.$rs['ext']; $width = $rs['w']; $height = $rs['h'];
+							$alt = isset($rs['alt']) ? $rs['alt'] : $rs['name'];
+																
+							echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\"  class='featured_image' />";
+						} else {
+							$image = image(array("id" => $featured['image'],"class"=>"featured_image"));
+							echo $image;								}
+					} else {				
+						$image = image(array("id" => $featured['image'],"class"=>"featured_image"));
+						echo $image;
+					} 
+		</txp:php>
+	</div>
+	<div class="titlebar titlebar_accessories">
+		<h2>Accessories</h2>
+		<div class="pagination">
+			<txp:php>
+				global $pretext;
+				global $thispage;
+				global $prefs;		
+				global $page;
+				global $articles_per_page;
+				
+				$articles_per_page = 10;
+				
+				$page = isset($_GET['pg']) ? $_GET['pg'] : 0;					
+			
+				$base_url = "http://".$prefs['siteurl']."/products/accessories?pg=";
+				
+			
+				$total_pages = ceil(mem_article_count(array(
+					'section'=>'products',
+					'category'=>'accessories'
+				))/$articles_per_page);
+				
+				if ($page !=0) {
+					echo "<a href='".$base_url."0' class='pag_first'>First</a>";
+					echo "<a href='$base_url".($page-1)."' class='pag_previous'>Previous</a>";
+				} else {
+					echo "<a href='##' class='pag_first disabled'>First</a>";
+					echo "<a href='##' class='pag_previous disabled'>Previous</a>";
+				}
+				for ($x=1;$x<($total_pages+1);$x++) {
+					echo "<a href='$base_url".($x-1)."'";
+					if (($x-1)==$page) echo " class='selected'";
+					echo">$x</a>";
+				};
+				
+				if ($page != ($total_pages-1)) {
+					echo "<a href='$base_url".($page+1)."' class='pag_next'>Next</a>";
+					echo "<a href='$base_url".($total_pages-1)."' class='pag_last'>Last</a>";
+				} else {
+					echo "<a href='##' class='pag_next disabled'>Next</a>";
+					echo "<a href='##' class='pag_last disabled'>Last</a>";
+				}
+			</txp:php>
+		</div>
+	</div>
+	
+	<div class="left_container left_container_alternative">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container right_container_alternative">		
+			<div class="accessories_listing">		
+			<txp:php>
+				global $x;
+				global $y;
+				global $page;
+				global $articles_per_page;
+				
+				$x =0; $y=0;
+								
+				$articles = article_custom(array(
+					'section'=>'products',
+					'category'=>'accessories',
+					'form'=>'accessory_list',
+					'limit'=>$articles_per_page,
+					'offset'=>($page * $articles_per_page)
+				));
+				
+				echo $articles;
+								
+				if (($x % 2) !=0) {
+					echo '<div class="clear"></div>';
+					echo '</div></div>';
+					echo '</div>';
+				}
+			</txp:php>
+					<a href="#" class="top_link top_link_alt"><span>top</span></a>
+					<div class="pagination bottom_pagination">
+						<txp:php>
+							global $pretext;
+							global $thispage;
+							global $prefs;		
+							global $page;
+							global $articles_per_page;
+							
+							$page = isset($_GET['pg']) ? $_GET['pg'] : 0;					
+						
+							$base_url = "http://".$prefs['siteurl']."/products/accessories?pg=";
+							
+							$total_pages = ceil(mem_article_count(array(
+								'section'=>'products',
+								'category'=>'accessories'
+							))/$articles_per_page);
+							
+							if ($page !=0) {
+								echo "<a href='".$base_url."0' class='pag_first'>First</a>";
+								echo "<a href='$base_url".($page-1)."' class='pag_previous'>Previous</a>";
+							} else {
+								echo "<a href='##' class='pag_first disabled'>First</a>";
+								echo "<a href='##' class='pag_previous disabled'>Previous</a>";
+							}
+							for ($x=1;$x<($total_pages+1);$x++) {
+								echo "<a href='$base_url".($x-1)."'";
+								if (($x-1)==$page) echo " class='selected'";
+								echo">$x</a>";
+							};
+							
+							if ($page != ($total_pages-1)) {
+								echo "<a href='$base_url".($page+1)."' class='pag_next'>Next</a>";
+								echo "<a href='$base_url".($total_pages-1)."' class='pag_last'>Last</a>";
+							} else {
+								echo "<a href='##' class='pag_next disabled'>Next</a>";
+								echo "<a href='##' class='pag_last disabled'>Last</a>";
+							}
+						</txp:php>
+					</div>
+			</div>
+
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/product_hackers-lunch-box.html
===================================================================
--- trunk/www.openmoko.com/inc/product_hackers-lunch-box.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/product_hackers-lunch-box.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,276 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body id="product_neo1973">
+
+<div id="wrapper">
+	<txp:php>
+		global $logo_sufix; $logo_sufix = "_2";
+		global $url_title;
+		echo $GLOBALS['thisarticle']['url_title'];die();
+	</txp:php>
+	
+	<txp:output_form form="moko_header" />
+	
+	<div id="site_content"></div>
+	<div id="middleblock"><div id="middleblock_inner"><div id="middleblock_inner2">
+	
+		<div id="middleblock_container">
+			<div class="banner_images">
+				<div id="tab_big_image_article_0" class="tab_item" style="">
+					<a href="#" class="button_enlarge"><span>enlarge</span></a>
+					<txp:php>
+						$image_id="3";
+						
+						if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+							$rs = safe_row('*', 'txp_image', "id = $image_id limit 1");						
+							
+							if (strtolower($rs['ext']) == '.png') {
+								global $prefs;
+
+								$siteroot = link_to_home(array());								
+								$filepath = $siteroot.$prefs['img_dir'].'/';
+	
+								$filename=$image_id.$rs['ext']; $width = $rs['w']; $height = $rs['h'];
+								$alt = isset($rs['alt']) ? $rs['alt'] : $rs['name'];
+								
+								echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\" />";
+							} else {
+								$image = image(array("id"=>$image_id));
+								echo $image;
+							}
+						} else {				
+							$image = image(array("id"=>$image_id));
+							echo $image;
+						}
+					</txp:php>
+				</div>
+				<div id="tab_big_image_article_1" class="tab_item display_none">
+					<a href="#" class="button_enlarge"><span>enlarge</span></a>
+					<txp:php>
+						$image_id="4";
+						
+						if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+							$rs = safe_row('*', 'txp_image', "id = $image_id limit 1");						
+							
+							if (strtolower($rs['ext']) == '.png') {
+								global $prefs;
+
+								$siteroot = link_to_home(array());								
+								$filepath = $siteroot.$prefs['img_dir'].'/';
+	
+								$filename=$image_id.$rs['ext']; $width = $rs['w']; $height = $rs['h'];
+								$alt = isset($rs['alt']) ? $rs['alt'] : $rs['name'];
+								
+								echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\" />";
+							} else {
+								$image = image(array("id"=>$image_id));
+								echo $image;
+							}
+						} else {				
+							$image = image(array("id"=>$image_id));
+							echo $image;
+						}
+					</txp:php>
+
+				</div>
+				
+				<div class="shadow">&nbsp;</div>
+			</div>
+					
+			<script type="text/javascript">
+				_pageTabs['big_image']=2;
+				showTab('big_image',0);
+			</script>
+			<div class="banner_content">
+				<h1><span>Hacker's Lunch Box</span></h1>
+				<p>Hacker's Lunch Box is the world’s first completely open, Linux-based mobile phone. Designed with elongated oval lines and smooth rounded edges, the sleek exterior, and ergonomic feel fit the Neo1973 into the palm of your hand.</p>
+				
+				<div class="banner_details">
+					<div class="banner_left">
+						<h2>Colours</h2>
+						<ul class="banner_product_thumbs">
+							<li><a href="#" onclick="return showTab('big_image',0)"><txp:image id="5" /></a></li>
+							<li><a href="#" onclick="return showTab('big_image',1)"><txp:image id="6" /></a></li>
+						</ul>
+						<a href="#" class="button_buy_it_now img_button"><span>Bu It Now</span></a>
+					</div>
+					
+					<div class="banner_right">
+						<h2><a href="#">Accessories</a></h2>
+						<ul>
+							<li><a href="#">Car kit</a></li>
+							<li><a href="#">Hackers Lunch Box</a></li>
+							<li><a href="#">Carrying Case</a></li>
+							<li><a href="#">Stylus</a></li>
+						</ul>
+						
+						<a href="#" class="button_all_accessories"><span>All Accessories</span></a>
+					</div>
+					
+					<div class="clear"></div>
+				</div>
+			</div>
+		</div>
+	
+		<ul id="middleblock_tabs">
+			<li><a href="#tab_main_article_0" onclick="return showTab('main',0)" id="tab_main_article_0_link"><span>Standard Kit</span></a></li>
+			<li><a href="#tab_main_article_1" onclick="return showTab('main',1)" id="tab_main_article_1_link"><span>Pictures</span></a></li>
+			<li><a href="#tab_main_article_2" onclick="return showTab('main',2)" id="tab_main_article_2_link"><span>Screenshots</span></a></li>
+			<li><a href="#tab_main_article_3" onclick="return showTab('main',3)" id="tab_main_article_3_link"><span>Hardware</span></a></li>
+			<li><a href="#tab_main_article_4" onclick="return showTab('main',4)" id="tab_main_article_4_link"><span>Software</span></a></li>
+		</ul>
+		
+		<div class="clear"></div>
+	</div></div></div>
+
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="standard_kit";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_0">
+		<div class="left_column">
+			<h3>What's Included:</h3>
+			<ul>
+				<txp:article_custom form="moko_product_article_link" section="products" category="products-standard_kit"/>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+			<txp:article_custom form="moko_product_article" section="products" category="products-standard_kit"/>
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+
+<script type="text/javascript">
+_pageTabs['main']=5;
+showTab('main',0);
+</script>
+
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="pictures";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_1">
+		<div class="left_column">
+			<h3>Some Title:</h3>
+			<ul>
+				<txp:article_custom form="moko_product_article_link" section="products" category="products-pictures"/>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+			<txp:article_custom form="moko_product_article" section="products" category="products-pictures"/>
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+	
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="screenshots";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_2">
+		<div class="left_column">
+			<h3>Some Title:</h3>
+			<ul>
+				<txp:article_custom form="moko_product_article_link" section="products" category="products-screenshots"/>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+			<txp:article_custom form="moko_product_article" section="products" category="products-screenshots"/>
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+	
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="hardware";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_3">
+		<div class="left_column">
+			<h3>Some Title:</h3>
+			<ul>
+				<txp:article_custom form="moko_product_article_link" section="products" category="products-hardware"/>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+			<txp:article_custom form="moko_product_article" section="products" category="products-hardware"/>
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+	
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="software";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_4">
+		<div class="left_column">
+			<h3>Some Title:</h3>
+			<ul>
+				<txp:article_custom form="moko_product_article_link" section="products" category="products-software"/>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+			<txp:article_custom form="moko_product_article" section="products" category="products-software"/>
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+	
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/product_neo1973.html
===================================================================
--- trunk/www.openmoko.com/inc/product_neo1973.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/product_neo1973.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,152 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body id="product_neo1973">
+
+<div id="wrapper">
+	<txp:php>global $logo_sufix; $logo_sufix = "_2";</txp:php>
+	
+	<txp:php>
+		global $url_title; $url_title=$GLOBALS['thisarticle']['url_title'];
+		global $thisproductpage; $thisproductpage = link_to_home(array()).'products/'.$url_title.'/';
+		global $current_category; $current_category = isset($_GET['current_page']) ? $GLOBALS['url_title'].'-'.$_GET['current_page'] : $GLOBALS['url_title'].'-standard_kit';		
+		global $logo_sufix; $logo_sufix = "_2";
+	</txp:php>
+	
+	<txp:output_form form="moko_header" />
+	
+	<div id="site_content"></div>
+	<div id="middleblock"><div id="middleblock_inner"><div id="middleblock_inner2">
+	
+		<div id="middleblock_container">
+	
+			<txp:php>
+				// Product heading
+				include txpath.'/lib/classTextile.php';
+					
+				global $hcp;
+				global $big_images;
+				global $small_images;
+				
+				$hcp = safe_row('*', 'textpattern', "url_title = 'product_".$GLOBALS['url_title']."' limit 1");
+				
+				$images = $hcp['Image'];
+				$images = explode(',',$images);
+				
+				if (count($images)>0) {
+					for ($x=0;$x<count($images);$x++) {
+						if ($x%2 == 0) {
+							$big_images[]=$images[$x];
+						} else {
+							$small_images[]=$images[$x];
+						}
+					}
+				}
+				
+				//dmp($big_images);
+				//dmp($small_images);
+				//dmp($hcp);
+			</txp:php>
+		
+			<div class="banner_images">
+				<txp:php>
+					global $big_images;
+					if (count($big_images)>0) {
+						for ($x = 0; $x<count($big_images);$x++) {
+						
+							echo '<div id="tab_big_image_article_'.$x.'" class="tab_item" style="">';
+							echo '	<a href="#" class="button_enlarge"><span>enlarge</span></a>';
+							
+							if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+								$rs = safe_row('*', 'txp_image', "id = ".$big_images[$x]." limit 1");						
+								
+								if (strtolower($rs['ext']) == '.png') {
+									global $prefs;
+		
+									$siteroot = link_to_home(array());								
+									$filepath = $siteroot.$prefs['img_dir'].'/';
+		
+									$filename=$big_images[$x].$rs['ext']; $width = $rs['w']; $height = $rs['h'];
+									$alt = isset($rs['alt']) ? $rs['alt'] : $rs['name'];
+									
+									echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\" />";
+								} else {
+									$image = image(array("id"=>$big_images[$x]));
+									echo $image;
+								}
+							} else {				
+								$image = image(array("id"=>$big_images[$x]));
+								echo $image;
+							}					
+		
+							echo "</div>";									
+						}
+					}
+				</txp:php>
+				
+				<div class="shadow">&nbsp;</div>
+			</div>
+					
+			<script type="text/javascript">
+				_pageTabs['big_image']=2;
+				showTab('big_image',0);
+			</script>
+			
+			<div class="banner_content">		
+				<h1><span><txp:php>echo $GLOBALS['hcp']['Title'];</txp:php></span></h1>
+				<txp:php>echo $GLOBALS['hcp']['Body_html'];</txp:php>
+				
+				<div class="banner_details">
+					<div class="banner_left">
+						<h2>Colours available</h2>
+						<ul class="banner_product_thumbs">
+							<txp:php>
+								global $small_images;
+								if (count($small_images)>0) {
+									for ($x = 0; $x<count($small_images);$x++) {
+										//"return showTab('big_image',".$x.")
+										echo "<li><a href='#' onclick=\"return showTab('big_image',".$x.")\">".image(array("id"=>$small_images[$x]))."</a></li>";
+									}
+								}
+							</txp:php>
+						</ul>
+						<div class="clear"></div>
+						<a href="#" class="button_buy_it_now img_button"><span>Buy It Now</span></a>
+					</div>					
+				</div>
+			</div>
+		</div>
+	
+		<ul id="middleblock_tabs">
+			<li><a href="<txp:php>echo $GLOBALS['thisproductpage'];</txp:php>?current_page=standard_kit" 
+			<txp:php> if ($GLOBALS['current_category'] == ($GLOBALS['url_title'].'-standard_kit')) echo ' class="selected"';</txp:php>><span>Standard Kit</span></a></li>
+			<li><a href="<txp:php>echo $GLOBALS['thisproductpage'];</txp:php>?current_page=pictures" 
+			<txp:php> if ($GLOBALS['current_category'] == ($GLOBALS['url_title'].'-pictures')) echo ' class="selected"';</txp:php>><span>Pictures</span></a></li>
+			<li><a href="<txp:php>echo $GLOBALS['thisproductpage'];</txp:php>?current_page=screenshots"
+			<txp:php> if ($GLOBALS['current_category'] == ($GLOBALS['url_title'].'-screenshots')) echo ' class="selected"';</txp:php>><span>Screenshots</span></a></li>
+			<li><a href="<txp:php>echo $GLOBALS['thisproductpage'];</txp:php>?current_page=hardware"
+			<txp:php> if ($GLOBALS['current_category'] == ($GLOBALS['url_title'].'-hardware')) echo ' class="selected"';</txp:php>><span>Hardware</span></a></li>
+			<li><a href="<txp:php>echo $GLOBALS['thisproductpage'];</txp:php>?current_page=software"
+			<txp:php> if ($GLOBALS['current_category'] == ($GLOBALS['url_title'].'-software')) echo ' class="selected"';</txp:php>><span>Software</span></a></li>
+		</ul>
+		
+		<div class="clear"></div>
+	</div></div></div>
+
+	<txp:php>
+		$page_template = isset($_GET['current_page']) ? $_GET['current_page'] : 'standard_kit';
+		$page_template = 'ptemplate-'.$page_template;
+		
+		include('inc/'.$page_template.'.html');
+	</txp:php>
+	
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/product_neo1973.html.bak
===================================================================
--- trunk/www.openmoko.com/inc/product_neo1973.html.bak	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/product_neo1973.html.bak	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,344 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body id="product_neo1973">
+
+<div id="wrapper">
+	<txp:php>global $logo_sufix; $logo_sufix = "_2";</txp:php>
+	
+	<txp:php>
+		global $logo_sufix; $logo_sufix = "_2";
+		global $url_title; $url_title=$GLOBALS['thisarticle']['url_title'];
+	</txp:php>
+	
+	<txp:output_form form="moko_header" />
+	
+	<div id="site_content"></div>
+	<div id="middleblock"><div id="middleblock_inner"><div id="middleblock_inner2">
+	
+		<div id="middleblock_container">
+	
+			<txp:php>
+				// Product heading
+				include txpath.'/lib/classTextile.php';
+					
+				global $hcp;
+				global $big_images;
+				global $small_images;
+				
+				$hcp = safe_row('*', 'textpattern', "url_title = 'product_".$GLOBALS['url_title']."' limit 1");
+				
+				$images = $hcp['Image'];
+				$images = explode(',',$images);
+				
+				if (count($images)>0) {
+					for ($x=0;$x<count($images);$x++) {
+						if ($x%2 == 0) {
+							$big_images[]=$images[$x];
+						} else {
+							$small_images[]=$images[$x];
+						}
+					}
+				}
+				
+				//dmp($big_images);
+				//dmp($small_images);
+				//dmp($hcp);
+			</txp:php>
+		
+			<div class="banner_images">
+				<txp:php>
+					global $big_images;
+					if (count($big_images)>0) {
+						for ($x = 0; $x<count($big_images);$x++) {
+						
+							echo '<div id="tab_big_image_article_'.$x.'" class="tab_item" style="">';
+							echo '	<a href="#" class="button_enlarge"><span>enlarge</span></a>';
+							
+							if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+								$rs = safe_row('*', 'txp_image', "id = ".$big_images[$x]." limit 1");						
+								
+								if (strtolower($rs['ext']) == '.png') {
+									global $prefs;
+		
+									$siteroot = link_to_home(array());								
+									$filepath = $siteroot.$prefs['img_dir'].'/';
+		
+									$filename=$big_images[$x].$rs['ext']; $width = $rs['w']; $height = $rs['h'];
+									$alt = isset($rs['alt']) ? $rs['alt'] : $rs['name'];
+									
+									echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\" />";
+								} else {
+									$image = image(array("id"=>$big_images[$x]));
+									echo $image;
+								}
+							} else {				
+								$image = image(array("id"=>$big_images[$x]));
+								echo $image;
+							}					
+		
+							echo "</div>";									
+						}
+					}
+				</txp:php>
+				
+				<div class="shadow">&nbsp;</div>
+			</div>
+					
+			<script type="text/javascript">
+				_pageTabs['big_image']=2;
+				showTab('big_image',0);
+			</script>
+			
+			<div class="banner_content">		
+				<h1><span><txp:php>echo $GLOBALS['hcp']['Title'];</txp:php></span></h1>
+				<txp:php>echo $GLOBALS['hcp']['Body_html'];</txp:php>
+				
+				<div class="banner_details">
+					<div class="banner_left">
+						<h2>Colours available</h2>
+						<ul class="banner_product_thumbs">
+							<txp:php>
+								global $small_images;
+								if (count($small_images)>0) {
+									for ($x = 0; $x<count($small_images);$x++) {
+										//"return showTab('big_image',".$x.")
+										echo "<li><a href='#' onclick=\"return showTab('big_image',".$x.")\">".image(array("id"=>$small_images[$x]))."</a></li>";
+									}
+								}
+							</txp:php>
+						</ul>
+						<div class="clear"></div>
+						<a href="#" class="button_buy_it_now img_button"><span>Buy It Now</span></a>
+					</div>					
+				</div>
+			</div>
+		</div>
+	
+		<ul id="middleblock_tabs">
+			<li><a href="#tab_main_article_0" onclick="return showTab('main',0)" id="tab_main_article_0_link"><span>Standard Kit</span></a></li>
+			<li><a href="#tab_main_article_1" onclick="return showTab('main',1)" id="tab_main_article_1_link"><span>Pictures</span></a></li>
+			<li><a href="#tab_main_article_2" onclick="return showTab('main',2)" id="tab_main_article_2_link"><span>Screenshots</span></a></li>
+			<li><a href="#tab_main_article_3" onclick="return showTab('main',3)" id="tab_main_article_3_link"><span>Hardware</span></a></li>
+			<li><a href="#tab_main_article_4" onclick="return showTab('main',4)" id="tab_main_article_4_link"><span>Software</span></a></li>
+		</ul>
+		
+		<div class="clear"></div>
+	</div></div></div>
+
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="standard_kit";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_0">
+		<div class="left_column">
+			<h3>What's Included:</h3>
+			<ul>
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article_link",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-standard_kit'
+					));
+				</txp:php>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-standard_kit'
+					));
+				</txp:php>
+				
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+
+<script type="text/javascript">
+_pageTabs['main']=5;
+showTab('main',0);
+</script>
+
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="pictures";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_1">
+		<div class="left_column">
+			<h3>Some Title:</h3>
+			<ul>
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article_link",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-pictures'
+					));
+				</txp:php>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-pictures'
+					));
+				</txp:php>
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+	
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="screenshots";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_2">
+		<div class="left_column">
+			<h3>Some Title:</h3>
+			<ul>
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article_link",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-screenshots'
+					));
+				</txp:php>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-screenshots'
+					));
+				</txp:php>
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+	
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="hardware";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_3">
+		<div class="left_column">
+			<h3>Some Title:</h3>
+			<ul>
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article_link",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-hardware'
+					));
+				</txp:php>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-hardware'
+					));
+				</txp:php>
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+	
+<txp:php>
+$GLOBALS['pretext']['tab_counter']="software";
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+	<div class="main_container tab_item" id="tab_main_article_4">
+		<div class="left_column">
+			<h3>Some Title:</h3>
+			<ul>
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article_link",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-software'
+					));
+				</txp:php>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+<txp:php>
+$GLOBALS['pretext']['article_counter']=0;
+</txp:php>
+
+				<txp:php>
+					echo article_custom(array(
+						"form"=>"moko_product_article",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-software'
+					));
+				</txp:php>
+<script type="text/javascript">
+_pageTabs['<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>']=<txp:php>echo $GLOBALS['pretext']['article_counter'];</txp:php>;
+showTab('<txp:php>echo $GLOBALS['pretext']['tab_counter'];</txp:php>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+	
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/products.html
===================================================================
--- trunk/www.openmoko.com/inc/products.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/products.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,108 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+	<txp:output_form form="moko_header" />
+	<div id="products_page">
+			<txp:php>
+				$product_id = 63;
+				global $rs;
+				$rs = safe_row('title,body,url_title,image', 'textpattern', "id = $product_id limit 1");
+			</txp:php>
+		
+		<div class="single_product first_single_product">
+			<div class="image_container">
+			<txp:php>
+				global $rs;
+				
+				if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+					$images = explode(",",trim($rs['image']));
+					$image_name = $images[0];
+					$rst = safe_row('*', 'txp_image', "id = $image_name");						
+					
+					if (strtolower($rst['ext']) == '.png') {
+						global $prefs;
+						
+						$filepath = "http://".$prefs['siteurl'].'/'.$prefs['img_dir'].'/';
+						$siteroot = "http://".$prefs['siteurl'].'/';
+	
+						$filename=$image_name.$rst['ext']; $width = $rst['w']; $height = $rst['h'];
+						$alt = isset($rst['alt']) ? $rst['alt'] : $rst['name'];
+															
+						echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\"  />";
+					} else {
+						$image = image(array("id" => $rs['image']));
+						echo $image;								}
+				} else {				
+					$image = image(array("id" => $rs['image']));
+					echo $image;
+				}
+			</txp:php>
+			</div>
+			
+			<div class="article_description">
+			<txp:php>
+				global $rs;
+				echo "<h2><a href='".link_to_home(array())."products/neo1973'>".$rs['title']."</a></h2>";
+				echo "<div class='description'>".$rs['body']."</div>";
+			</txp:php>
+			</div>
+		</div>
+		
+			<txp:php>
+				$product_id = 95;
+				global $rs;
+				$rs = safe_row('title,body,url_title,image', 'textpattern', "id = $product_id limit 1");
+			</txp:php>
+		<div class="single_product second_single_product">
+			<div class="image_container">
+			<txp:php>
+				global $rs;
+				
+				if ((strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")) and (strpos($_SERVER['HTTP_USER_AGENT'],"MSIE 7")===false)) {
+					$images = explode(",",trim($rs['image']));
+					$image_name = $images[0];
+					$rst = safe_row('*', 'txp_image', "id = $image_name");						
+					
+					if (strtolower($rst['ext']) == '.png') {
+						global $prefs;
+						
+						$filepath = "http://".$prefs['siteurl'].'/'.$prefs['img_dir'].'/';
+						$siteroot = "http://".$prefs['siteurl'].'/';
+	
+						$filename=$image_name.$rst['ext']; $width = $rst['w']; $height = $rst['h'];
+						$alt = isset($rst['alt']) ? $rst['alt'] : $rst['name'];
+															
+						echo "<img src='".$siteroot."images/blank.gif' width='$width' height='$height'  alt='$alt' style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='".$filepath.$filename."', sizingMethod='scale')\"  />";
+					} else {
+						$image = image(array("id" => $rs['image']));
+						echo $image;								}
+				} else {				
+					$image = image(array("id" => $rs['image']));
+					echo $image;
+				}
+			</txp:php>
+			</div>
+			
+			<div class="article_description">
+			<txp:php>
+				global $rs;
+				echo "<h2><a href='".link_to_home(array())."products/hackers-lunch-box'>".$rs['title']."</a></h2>";
+				echo "<div class='description'>".$rs['body']."</div>";
+			</txp:php>
+			</div>
+		</div>
+	</div>
+	
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/ptemplate-screenshots.html
===================================================================
--- trunk/www.openmoko.com/inc/ptemplate-screenshots.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/ptemplate-screenshots.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,56 @@
+<?php
+
+	$scrimages = safe_rows('*', 'txp_image', "category = '".$GLOBALS['current_category']."'");
+	global $prefs;
+	$imgdir = link_to_home(array()).$prefs['img_dir'].'/';
+    
+      
+	echo "<script>";
+    echo "var images_dir = '".$imgdir."';";
+    for ($x=0; $x<count($scrimages);$x++) {
+		echo "screenshots_data[".$x."] = {'description':'".$scrimages[$x]['caption']."','title':'".$scrimages[$x]['alt']."','filename':'".$scrimages[$x]['id'].$scrimages[$x]['ext']."','width':'".$scrimages[$x]['w']."','height':'".$scrimages[$x]['h']."'};";
+    }
+	echo "</script>";    
+	
+?>
+
+<div class="screenshots_page">
+	<div class="title_container">
+		<h2>Screenshots</h2>
+	</div>
+
+	<div id="screenshot_caption">
+<?php
+	echo "<h3>".$scrimages[0]['alt']."</h3>";
+    echo $scrimages[0]['caption'];
+?>
+	</div>
+	
+	<div class="screenshots_right">
+		<div class="screenshot_image">
+		<?php
+			echo '<img src="'.$imgdir.$scrimages[0]['id'].$scrimages[0]['ext'].'" alt="'.$scrimages[0]['alt'].'" id="screenshot_image"/>';;
+		?>
+		</div>
+		
+		<div class="screenshot_thumbs">
+		
+<?php		
+	$x=0;
+	foreach ($scrimages as $screenshot) {
+    
+		echo '<div class="screenshot_thumb" onclick="setScreenshot('.$x.'); return false;">';
+		echo '<img src="'.$imgdir.$screenshot['id'].'t'.$screenshot['ext'].'" alt="'.$screenshot['alt'].'" />';
+		echo '</div>';
+        
+        $x++;
+	}
+
+?>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
+	
+	<div class="clear" style="height: 10px;"></div>
+</div>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/ptemplate-standard_kit.html
===================================================================
--- trunk/www.openmoko.com/inc/ptemplate-standard_kit.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/ptemplate-standard_kit.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,38 @@
+<?php
+	$GLOBALS['pretext']['tab_counter']="standard_kit";
+	$GLOBALS['pretext']['article_counter']=0;
+?>
+
+	<div class="main_container" id="tab_main_article_0">
+		<div class="left_column">
+			<h3>What's Included:</h3>
+			<ul>
+				<?php
+					echo article_custom(array(
+						"form"=>"moko_product_article_link",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-standard_kit'
+					));
+				?>
+			</ul>
+		</div>
+		
+		<div class="right_column">
+				<?php 
+					$GLOBALS['pretext']['article_counter']=0;
+
+					echo article_custom(array(
+						"form"=>"moko_product_article",
+						"section"=>"products",
+						"category"=>$GLOBALS['url_title'].'-standard_kit'
+					));
+				?>
+				
+<script type="text/javascript">
+_pageTabs['<?php echo $GLOBALS['pretext']['tab_counter'];?>']=<?php echo $GLOBALS['pretext']['article_counter'];?>;
+showTab('<?php echo $GLOBALS['pretext']['tab_counter']; ?>',0);
+</script>
+		</div>
+		
+		<div class="clear"></div>
+	</div>
\ No newline at end of file

Added: trunk/www.openmoko.com/inc/search.html
===================================================================
--- trunk/www.openmoko.com/inc/search.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/inc/search.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<txp:output_form form="moko_html_header" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
+
+<body>
+
+<div id="wrapper">
+	<txp:output_form form="moko_header" />
+	
+	<div class="left_container">
+		<div class="sidebox"><div class="inner"><div class="inner_2">
+			<form id="searchform" method="get" action="<txp:link_to_home />">
+				<label>Search openmoko</label>
+				<input type="hidden" name="s" value="search" />
+				<input type="text" class="input_text" name="q" />
+				<input type="image" class="input_submit" src="<txp:link_to_home />images/button_go.png" alt="GO"/>
+			</form>
+		</div></div></div>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_1.png" alt="baner" /></a>
+		
+		<a href="#" class="side_banner"><img src="<txp:link_to_home />images/__sample_banner_2.png" alt="baner" /></a>
+	</div>
+	
+	<div class="right_container">
+			<div class="banner_search">
+
+			</div>
+	
+			<div class="content">
+				<h2>Search results for: <span class="search_term"><txp:q /></span></h2>
+				<div class="press_container">
+					<ul>
+						<txp:article />
+					</ul>
+										
+					<div class="pagination">
+						<txp:php>
+							global $pretext;
+							global $thispage;
+							global $prefs;							
+						
+							$base_url = "http://".$prefs['siteurl']."/search/?q=".urlencode($pretext['q'])."&amp;pg=";
+							
+							$current_page = $thispage['pg'];
+							$total_pages = $thispage['numPages'];
+							
+							if ($current_page !=1) {
+								echo "<a href='".$base_url."1' class='pag_first'>First</a>";
+								echo "<a href='$base_url".($current_page-1)."' class='pag_previous'>Previous</a>";
+							} else {
+								echo "<a href='##' class='pag_first disabled'>First</a>";
+								echo "<a href='##' class='pag_previous disabled'>Previous</a>";
+							}
+							for ($x=1;$x<($total_pages+1);$x++) {
+								echo "<a href='$base_url$x'";
+								if ($x==$current_page) echo " class='selected'";
+								echo">$x</a>";
+							};
+							
+							if ($current_page != $total_pages) {
+								echo "<a href='$base_url".($current_page+1)."' class='pag_next'>Next</a>";
+								echo "<a href='$base_url".$total_pages."' class='pag_last'>Last</a>";
+							} else {
+								echo "<a href='##' class='pag_next disabled'>Next</a>";
+								echo "<a href='##' class='pag_last disabled'>Last</a>";
+							}
+						</txp:php>
+					</div>
+				</div>
+			</div>	
+	</div>
+	
+	<div class="clear" style="height:20px;"></div>
+	<txp:output_form form="moko_footer" />
+	
+</div>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/index.php
===================================================================
--- trunk/www.openmoko.com/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,40 @@
+<?php
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/index.php $
+$LastChangedRevision: 1925 $
+*/
+
+	// Make sure we display all errors that occur during initialization
+	error_reporting(E_ALL);
+	@ini_set("display_errors","1");
+
+	if (@ini_get('register_globals'))
+		foreach ( $_REQUEST as $name => $value )
+			unset($$name);
+	define("txpinterface", "public");
+
+	// NOTE: to use constants from our openmoko_common_cfg.php in config.php
+	// we have to make sure it gets loaded before config.php is used.
+	require_once '../openmoko_common_cfg.php';
+
+
+	// Use buffering to ensure bogus whitespace in config.php is ignored
+	ob_start(NULL, 2048);
+	$here = dirname(__FILE__);
+	include './textpattern/config.php';
+	ob_end_clean();
+
+	if (!isset($txpcfg['txpath']) )	{
+		$status = '503 Service Unavailable';
+		if (substr(php_sapi_name(), 0, 3) == 'cgi' and empty($_SERVER['FCGI_ROLE']) and empty($_ENV['FCGI_ROLE']))
+			header("Status: $status");
+		else
+			header("HTTP/1.1 $status");
+
+		$msg = 'config.php is missing or corrupt.  To install Textpattern, visit <a href="./textpattern/setup/">textpattern/setup/</a>';
+		exit ($msg);
+	}
+
+	include $txpcfg['txpath'].'/publish.php';
+	textpattern();
+?>

Added: trunk/www.openmoko.com/js/IEFixes.js
===================================================================
--- trunk/www.openmoko.com/js/IEFixes.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/js/IEFixes.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,178 @@
+// IE fixes javascript
+
+var isMSIE55 = (window.showModalDialog && window.clipboardData && window.createPopup);
+var doneIETransform;
+var doneIEAlphaFix;
+
+function getElementsByClassName(oElm, strTagName, strClassName){
+    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
+    var arrReturnElements = new Array();
+    strClassName = strClassName.replace(/\-/g, "\\-");
+    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
+    var oElement;
+    for(var i=0; i<arrElements.length; i++){
+        oElement = arrElements[i];      
+        if(oRegExp.test(oElement.className)){
+            arrReturnElements.push(oElement);
+        }   
+    }
+    return (arrReturnElements)
+}
+
+if (document.attachEvent)
+  document.attachEvent('onreadystatechange', hookit);
+
+function hookit() {
+//	alert('b');
+    if (!doneIETransform && document.getElementById && document.getElementById('bodyContent')) {
+        doneIETransform = true;
+        relativeforfloats();
+        fixalpha();
+    }
+	
+	fixalpha();
+}
+
+// png alpha transparency fixes
+function fixalpha() {
+    // bg
+    if (isMSIE55 && !doneIEAlphaFix)
+    {
+		
+		fix_elements = getElementsByClassName(body, "" , "fix_alpha");
+		
+		for (x = 0; x<fix_elements;x++) {
+			var logospan = logoa.appendChild(document.createElement('span'));
+			
+            logoa.style.backgroundImage = 'none';
+            logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl + ')';
+            logospan.style.height = '100%';
+            logospan.style.position = 'absolute';
+            logospan.style.width = logoa.currentStyle.width;
+            logospan.style.cursor = 'hand';
+            // Center image with hack for IE5.5
+            if (document.documentElement.dir == "rtl") 
+            {
+              logospan.style.right = '50%';
+              logospan.style.setExpression('marginRight', '"-" + (this.offsetWidth / 2) + "px"');
+            }
+            else
+            {
+              logospan.style.left = '50%';
+              logospan.style.setExpression('marginLeft', '"-" + (this.offsetWidth / 2) + "px"');
+            }
+            logospan.style.top = '50%';
+            logospan.style.setExpression('marginTop', '"-" + (this.offsetHeight / 2) + "px"');
+ 
+            var linkFix = logoa.appendChild(logoa.cloneNode());
+            linkFix.style.position = 'absolute';
+            linkFix.style.height = '100%';
+            linkFix.style.width = '100%';
+		}
+		
+/*        var plogo = document.getElementById('p-logo');
+        if (!plogo) return;
+
+        var logoa = plogo.getElementsByTagName('a')[0];
+        if (!logoa) return;
+
+        var bg = logoa.currentStyle.backgroundImage;
+        var imageUrl = bg.substring(5, bg.length-2);
+
+        doneIEAlphaFix = true;
+
+        if (imageUrl.substr(imageUrl.length-4).toLowerCase() == '.png') {
+            var logospan = logoa.appendChild(document.createElement('span'));
+           
+            logoa.style.backgroundImage = 'none';
+            logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl + ')';
+            logospan.style.height = '100%';
+            logospan.style.position = 'absolute';
+            logospan.style.width = logoa.currentStyle.width;
+            logospan.style.cursor = 'hand';
+            // Center image with hack for IE5.5
+            if (document.documentElement.dir == "rtl") 
+            {
+              logospan.style.right = '50%';
+              logospan.style.setExpression('marginRight', '"-" + (this.offsetWidth / 2) + "px"');
+            }
+            else
+            {
+              logospan.style.left = '50%';
+              logospan.style.setExpression('marginLeft', '"-" + (this.offsetWidth / 2) + "px"');
+            }
+            logospan.style.top = '50%';
+            logospan.style.setExpression('marginTop', '"-" + (this.offsetHeight / 2) + "px"');
+ 
+            var linkFix = logoa.appendChild(logoa.cloneNode());
+            linkFix.style.position = 'absolute';
+            linkFix.style.height = '100%';
+            linkFix.style.width = '100%';
+			*/
+        }
+    }
+}
+
+// fix ie6 disappering float bug
+function relativeforfloats() {
+    var bc = document.getElementById('bodyContent');
+    if (bc) {
+        var tables = bc.getElementsByTagName('table');
+        var divs = bc.getElementsByTagName('div');
+    }
+    setrelative(tables);
+    setrelative(divs);
+}
+function setrelative (nodes) {
+    var i = 0;
+    while (i < nodes.length) {
+        if(((nodes[i].style.float && nodes[i].style.float != ('none') ||
+        (nodes[i].align && nodes[i].align != ('none'))) &&
+        (!nodes[i].style.position || nodes[i].style.position != 'relative'))) 
+        {
+            nodes[i].style.position = 'relative';
+        }
+        i++;
+    }
+}
+
+
+// Expand links for printing
+
+String.prototype.hasClass = function(classWanted)
+{
+    var classArr = this.split(/\s/);
+    for (var i=0; i<classArr.length; i++)
+      if (classArr[i].toLowerCase() == classWanted.toLowerCase()) return true;
+    return false;
+}
+
+var expandedURLs;
+
+onbeforeprint = function() { 
+    expandedURLs = [];
+
+    var contentEl = document.getElementById("content");
+
+    if (contentEl)
+    {
+      var allLinks = contentEl.getElementsByTagName("a");
+
+      for (var i=0; i < allLinks.length; i++) {
+          if (allLinks[i].className.hasClass("external") && !allLinks[i].className.hasClass("free")) {
+              var expandedLink = document.createElement("span");
+              var expandedText = document.createTextNode(" (" + allLinks[i].href + ")");
+              expandedLink.appendChild(expandedText);
+              allLinks[i].parentNode.insertBefore(expandedLink, allLinks[i].nextSibling);
+              expandedURLs[i] = expandedLink;
+          }
+      }
+   }
+}
+
+onafterprint = function()
+{
+    for (var i=0; i < expandedURLs.length; i++)
+        if (expandedURLs[i])
+            expandedURLs[i].removeNode(true);
+}
\ No newline at end of file

Added: trunk/www.openmoko.com/js/screenshots.js
===================================================================
--- trunk/www.openmoko.com/js/screenshots.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/js/screenshots.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,12 @@
+var screenshots_data = new Array();
+
+function setScreenshot(screen_id) {
+	
+	description_block = document.getElementById('screenshot_caption');
+	screenshot = document.getElementById('screenshot_image');
+	
+	description_block.innerHTML = '<h3>'+screenshots_data[screen_id]['title']+'</h3>'+screenshots_data[screen_id]['description'];
+	screenshot.style.width = screenshots_data[screen_id]['width'] +"px";
+	screenshot.style.height = screenshots_data[screen_id]['height'] +"px";
+	screenshot.src = images_dir+screenshots_data[screen_id]['filename'];
+}
\ No newline at end of file

Added: trunk/www.openmoko.com/js/tabs.js
===================================================================
--- trunk/www.openmoko.com/js/tabs.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/js/tabs.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,24 @@
+var _pageTabs = new Array();
+
+var showTab = function (tab_group,tab_index) {
+	for (x=0; x<_pageTabs[tab_group]; x++) {
+		if (current_obj = document.getElementById('tab_'+tab_group+'_article_'+x)) {
+			if (x == tab_index) {
+				current_obj.style.display="block";
+			} else {
+				current_obj.style.display="none";
+			}
+		}
+		
+		if (current_obj_title = document.getElementById('tab_'+tab_group+'_article_'+x+'_link')) {
+			if (x == tab_index) {
+				current_obj_title.className="selected";
+			} else {
+				current_obj_title.className="";
+			}
+		}
+		
+	}
+	
+	return false;
+}
\ No newline at end of file

Added: trunk/www.openmoko.com/print.css
===================================================================
--- trunk/www.openmoko.com/print.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/print.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,2 @@
+/* CSS Document */
+

Added: trunk/www.openmoko.com/style.css
===================================================================
--- trunk/www.openmoko.com/style.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/style.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1817 @@
+html,body {
+	margin: 0px;
+	padding: 0px;
+	background: #FFF;
+}
+
+body {
+	font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 0.75em;
+	color: #333;
+}
+
+h1 {
+	font-size: 1.9em;
+}
+
+h2 {
+	font-size: 1.4em;
+}
+
+h3 {
+	font-size: 1.1em
+}
+
+a {
+	color: #FF6600;
+	text-decoration: none;
+}
+
+a:hover {
+	text-decoration: underline;
+}
+
+img {
+	border: none;
+}
+
+ul {
+	margin: 0 0 0 0.5em;
+	padding: 0 0 0 0;
+	list-style: none;
+}
+
+ul li {
+	background: url(images/list_bullet.png) no-repeat 0 0.5em;
+	padding-left: 0.7em;
+	margin-bottom: 0.4em;
+}
+
+
+input,textarea {
+	font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 0.9em;
+}
+
+#wrapper {
+	width: 950px;
+	margin: 0px auto;
+	position: relative;
+}
+
+#header {
+	height: 121px;
+	position: relative;
+	background:url(images/navigation_background.png) no-repeat 0 0;
+}
+
+#site_logo {
+	position: absolute;
+	top: 32px;
+	left: 25px;
+}
+
+/**************/
+/* NAVIGATION */
+/**************/
+
+#main_navigation {
+	float: right;
+	position: absolute;
+	top: 42px;
+	right: 15px;
+}
+
+#main_navigation ul {
+	list-style: none;
+	margin: 0;
+	padding: 0;
+}
+
+#main_navigation ul li {
+	display: inline;
+	margin: 0;
+	padding: 0;
+	background: none;
+}
+
+
+
+#main_navigation a {
+	float: left;
+	display: block;
+	height: 11px;
+	background-position: 50% 0%;
+	background-repeat:no-repeat;
+	margin-left: 10px;
+}
+
+#main_navigation a:hover {
+	background-position: 50% 100%;
+}
+
+#main_navigation a span{
+	display: none;
+}
+
+#main_navigation .selected {
+	background-position: 50% 100%;
+}
+
+
+.nav_home {
+	background-image:url(images/navigation/home.png);
+	width: 58px;
+}
+
+.nav_about {
+	background-image:url(images/navigation/about.png);
+	width: 64px;
+}
+
+.nav_products {
+	background-image:url(images/navigation/products.png);
+	width: 86px;
+}
+
+.nav_developers {
+	background-image:url(images/navigation/developers.png);
+	width: 98px;
+}
+
+.nav_network {
+	background-image:url(images/navigation/network.png);
+	width: 83px;
+}
+
+.nav_press {
+	background-image:url(images/navigation/press.png);
+	width: 58px;
+}
+
+.nav_careers {
+	background-image:url(images/navigation/careers.png);
+	width: 76px;
+}
+
+.nav_contact {
+	background-image:url(images/navigation/contact.png);
+	width: 79px;
+}
+
+.nav_shop {
+	background-image:url(images/navigation/shop.png);
+	width: 55px;
+}
+
+/****************/
+/* MIDDLE BLOCK */
+/****************/
+
+#middleblock {
+	background: #030303 url(images/middleblock_tile.jpg) repeat-x 0% 0%;
+	position: relative;
+	border-bottom: 1px solid #CCCCCC;
+}
+
+#middleblock_container {
+	min-height: 380px;
+}
+
+#middleblock_tabs {
+	margin: 0px;
+	padding: 0px;
+	list-style: none;
+	font-size: 1.1em;
+	display: block;
+
+	position: relative;
+	top: 1px;
+	
+	margin-left: 348px;
+}
+
+#middleblock_tabs li {	
+	display: inline;
+	margin: 0;
+	padding: 0;
+	background: none;
+}
+
+#middleblock_tabs li a {
+	float: left;
+	display: block;
+	font-weight: bold;
+	color: white;
+	text-decoration: none;
+	margin-right: 5px;
+}
+
+#middleblock_tabs li a span {
+	display: block;
+	padding: 0.5em 0.8em 0.5em 0.9em;
+}
+
+#middleblock_tabs li a:hover {
+	color: #FF6600;
+	background:#FFF url(images/middleblock_tabs_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_tabs li a:hover span {
+	background:url(images/middleblock_tabs_right.png) no-repeat 100% 0%;
+}
+
+#middleblock_tabs li .selected {
+	color: #FF6600;
+	background:#FFF url(images/middleblock_tabs_left.png) no-repeat 0% 0%;
+}
+
+#middleblock_tabs li .selected span {
+	background:url(images/middleblock_tabs_right.png) no-repeat 100% 0%;
+}
+
+.main_container {
+	padding-top: 40px;
+	padding-bottom: 40px;
+}
+
+.clear {
+	clear: both;
+}
+
+
+.left_column {
+	width: 303px;
+	padding-left: 45px;
+	float: left;
+}
+
+.left_column h3 {
+	margin: 0 0 1.1em 0;
+	padding: 0;
+}
+
+.left_column ul li a {
+	color: #333;
+}
+
+.left_column ul li a:hover {
+	color: #FF6600;
+}
+
+.left_column ul li .selected {
+	font-weight: bold;
+	color: #FF6600;
+}
+
+.right_column {
+	margin-left: 350px;
+}
+
+#footer {	
+	text-align: center;
+	background: #FAFAFA;
+	border-top: 1px solid #CCC;
+	padding: 5em 0 4em 0;
+	margin: 0 0 20px 0;
+	font-size: 0.9em;
+	color: #666666;
+}
+
+#secundary_navigation {
+	margin: 0;
+	padding: 0 0 2em 0;
+	text-transform: uppercase;
+	margin: 0 auto;
+}
+
+#secundary_navigation li {
+	background: none;
+	padding: 0;
+	display: inline;
+	margin: 0 1em;
+}
+
+#secundary_navigation .selected {
+	font-weight: bold;
+	color: #FF6600;
+}
+
+#secundary_navigation a {
+	color: #333333;
+	text-decoration: none;
+}
+
+#secundary_navigation a:hover {
+	color: #FF6600;
+}
+
+
+
+/***********/
+/* CONTENT */
+/***********/
+
+.content {
+	line-height: 1.5em;
+	padding-bottom: 20px;
+}
+
+.content p {
+	margin: 0;
+	padding: 0.6em 0;
+}
+
+.content ul,
+.content ol {
+	padding: 0.9em 0 0.8em 2em;
+}
+
+.content blockquote {
+	margin: 0;
+	padding: 0.6em 0 0.6em 2em;
+	color: #666666;
+}
+
+.content h2 {
+	margin: 0;
+	padding: 0 0 1em 0;
+}
+
+.content .title_container {
+	border-bottom: 1px solid #CCCCCC;
+	margin: 0 0 0.7em 0;
+}
+
+.content img {
+	border-right: 1px solid #CCCCCC;
+	float: left;
+	margin: 0 1em 1em 0;
+}
+
+#home_banner {
+	height: 390px;
+	width: 950px;
+	background: url(images/home_banner.jpg) no-repeat 0 0em;
+	position: relative;
+}
+
+#home_banner .button_read_more {
+/*	position: absolute;
+	left: 405px;
+	top: 298px;*/
+	
+	margin-top: 15px;
+}
+
+#home_content {
+	background:url(images/home_background.png) no-repeat 0 0em;
+	padding: 1px 0px 1px 0px;
+}
+
+#home_content .column1,
+#home_content .column2 {
+	width: 336px;
+	float: left;
+	margin-right: 5px;
+	padding: 0px 10px;
+	position: relative;
+}
+
+#home_content .column2 {
+	width: 554px;
+	line-height: 150%;
+	padding-left: 20px;
+}
+
+#home_content .column3 {
+	width: 207px;
+	float: left;
+	padding: 0px 10px;
+	position: relative;
+}
+
+#home_content .column1 h2,
+#home_content .column2 h2 {
+	margin: 0px 0px 20px 0px;
+	padding: 34px 0px 21px 0px;
+	display:block;
+	font-size: 17px;
+}
+
+#home_content .column1 h2 {
+	margin-left: 15px;
+}
+
+#home_content .img_button {
+	margin-top: 10px !important;
+	margin-left: 15px;
+}
+
+#home_banner h1{
+	position: absolute;
+	left: 405px;
+	top: 83px;
+	color: #FF6600;
+	font-size: 25px;
+	margin-top: 0px;
+	display:none;
+}
+
+.home_tabs_links {
+	list-style: none;
+	margin: 0;
+	padding: 0;
+	position: absolute;
+	left: 405px;
+	top: 85px;
+	font-size: 25px !important;
+	color: #FFF;
+	font-weight: bold;
+}
+
+.home_tabs_links li {
+	display: inline;
+	background:none;
+	padding: 0;
+	/*margin: 0 0.2em 0 0;*/
+}
+
+.home_tabs_links li a {
+	color: #FF6600;
+	font-weight:normal;
+}
+
+.home_tabs_links li a:hover {
+	color: #FFF;
+	text-decoration: none;
+}
+
+.home_tabs_links li .selected {
+	color: #FFF;
+}
+
+.home_tabs {
+	position: absolute;
+	left: 405px;
+	top: 135px;
+	width: 425px;
+	padding-top: 5px;
+	padding-right: 15px;
+	color:#FFF;
+	line-height:1.5em;
+}
+
+.home_tabs p {
+	margin: 0px;
+	padding: 7px 0px;
+}
+
+.rss_icon_link {
+	display: block !important;
+	width:35px;
+	height: 12px;
+	background:url(images/icon_rss.png) no-repeat 0 0;
+}
+
+.rss_icon_link span {
+	display: none;
+}
+
+#home_content .rss_icon_link {
+	position: absolute;
+	right: 10px;
+	top: 41px;
+}
+
+/********************/
+/* HOME SEARCH FORM */
+/********************/
+
+#home_searchform {
+	width: 230px;
+	height: 79px;
+	background: url(images/label/search_openmoko.png) no-repeat 10px 20px;
+	position: absolute;
+	right: 0px;
+	top: -3px;
+	
+}
+
+#home_searchform .input_text {
+	width: 165px;
+	padding: 2px 2px;
+	position: absolute;
+	top: 40px;
+	left: 10px;
+}
+
+#home_searchform label {
+	display: none;
+}
+
+#home_searchform .input_submit {
+	position: absolute;
+	top: 36px;
+	left: 185px;
+}
+
+/**********/
+/* INPUTS */
+/**********/
+
+.button_read_more {
+	display: block;
+	background:url(images/button_read_more.png) no-repeat 0 0;
+	width: 100px;
+	height: 22px;
+}
+
+.button_read_more_gray {
+	background:url(images/button_read_more_gray.png) no-repeat 0 0;
+}
+
+.button_read_more span {
+	display: none;
+}
+
+#home_content .button_read_more_gray {
+	margin: 20px 0px 10px 0px;
+}
+
+/*********/
+/* PRESS */
+/*********/
+
+.press_list {
+	position: relative;
+}
+
+.press_list li {
+	margin-bottom: 13px;
+	
+}
+
+.press_list a {
+	font-weight: bold;
+}
+
+.date_posted {
+	font-size: 0.9em;
+	color: #666666;
+}
+
+/*********/
+/* ABOUT */
+/*********/
+
+.left_container {
+	width: 200px;
+	float: left;
+	padding-top: 80px;
+	padding-left: 15px;
+}
+
+.right_container {
+	width: 706px;
+/*	margin: 0 0 0 29px;*/
+	float: right;
+	padding-top: 35px;
+}
+
+.page_content {
+	width: 530px;
+	margin: 0 0 0 auto;
+}
+
+
+.left_content {
+	width: 160px;
+	float:left;
+	margin-top: 45px;
+}
+
+.article_list {
+	width: 160px;
+	float:left;
+	margin-top: 45px;
+}
+
+.article_list li {
+	padding: 0px;
+	background: none;
+}
+
+.article_list a {
+	font-weight: bold;
+	color: #333;
+	background: url(images/article_bullet.png) no-repeat 0 0.2em;
+	padding: 0px 0px 0px 15px;
+}
+
+.article_list a:hover {
+	color: #FF6600;
+	background: url(images/article_bullet_hover.png) no-repeat 0 0.2em;
+}
+
+.article_list .selected {
+	color: #FF6600;
+	background: url(images/article_bullet_hover.png) no-repeat 0 0.2em;
+}
+
+.banner_about {
+	background:url(images/banner_about.jpg) no-repeat 0 0;
+	height: 150px;
+	margin-bottom: 35px;
+}
+
+.banner_contact {
+	background:url(images/banner_contact.jpg) no-repeat 0 0;
+	height: 150px;
+	margin-bottom: 35px;
+}
+
+.banner_developers {
+	background:url(images/banner_developers.jpg) no-repeat 0 0;
+	height: 150px;
+	margin-bottom: 35px;
+}
+
+.banner_press {
+	background:url(images/banner_press.jpg) no-repeat 0 0;
+	height: 150px;
+	margin-bottom: 35px;
+}
+
+.banner_careers {
+	background:url(images/banner_careers.jpg) no-repeat 0 0;
+	height: 150px;
+	margin-bottom: 35px;
+}
+
+.banner_search {
+	background:url(images/banner_search.jpg) no-repeat 0 0;
+	height: 150px;
+	margin-bottom: 35px;
+}
+
+
+.sidebox {
+	width: 189px;
+	margin: 0 0 30px 0;
+	background:url(images/sidebox_tile.png) repeat-y 0 0;
+}
+
+.sidebox .inner {
+	background:url(images/sidebox_top.png) no-repeat 0 0;
+}
+
+.sidebox .inner_2 {
+	background:url(images/sidebox_bottom.png) no-repeat 0 100%;
+	padding: 7px;
+}
+
+#searchform {
+	position: relative;
+	margin: 0;
+	padding: 24px 0 1px 0;
+	background:url(images/label/search_openmoko_gray.png) no-repeat 0 8px;
+}
+
+#searchform label {
+	display: none;
+}
+
+#searchform .input_text {
+	width: 135px;
+}
+
+#searchform .input_submit {
+	position: absolute;
+	left: 142px;
+	top: 20px;
+}
+
+
+.side_banner {
+	margin: 0 0 30px 0;
+	display:block;
+	width: auto;
+}
+
+.banner_images {
+	position: absolute;
+	left: 86px;
+	top: 20px;
+	width: auto;
+	overflow:visible;
+}
+
+.banner_images div {
+	position: relative;
+}
+
+.shadow {
+	width:146px;
+	height: 46px;
+	background:url(images/product_bottom_shadow.png) no-repeat 50% 100%;
+	margin: 0 auto;
+}
+
+.button_enlarge {
+	display:block;
+	width: 72px;
+	height: 32px;
+	background: url(images/button_enlarge.png) no-repeat 0 0;
+	
+	position: absolute;
+	right: -72px;
+	top: 60%;
+}
+
+.button_enlarge span {
+	display: none;
+}
+
+.banner_content {
+	padding-top: 35px;
+	margin: 0px 50px 50px 350px;
+}
+
+.banner_content h1 {
+	display: block;
+	margin: 0px 0px 0px 0px;
+	padding: 0px 0px 10px 0x;
+	font-size: 23px;
+	color: #FF6600;
+}
+
+.banner_content h1 span {
+	
+}
+
+.banner_content p {
+	color: #FFF;
+	line-height: 1.5em;
+}
+
+.banner_details {
+/*	background:url(images/banner_details.png) no-repeat 0 3.5em;*/
+	color: #FFF;
+	padding-top: 20px;
+}
+
+.banner_details h2 {
+	font-size: 1em;
+	margin: 0 0 2em 0;
+	padding: 0;
+}
+
+.banner_details h2 a {
+	background: url(images/link_bullet.png) no-repeat 0 0.25em;
+	padding: 0px 0px 0px 15px;
+}
+
+.banner_details ul li a {
+	color: #999999;
+}
+
+.banner_details ul li a:hover {
+	color: #ff6600;
+}
+
+.banner_left {
+/*	width: 245px;	
+	float: left;*/
+}
+
+.banner_left h2 {
+/*	background: #ddd;
+	width: 140px;*/
+	float: left;
+	padding-top: 8px;
+}
+
+.banner_right {
+	width: 245px;
+	float: left;
+}
+
+.button_all_accessories {
+	display: block;
+	background: url(images/button_all_accessories.png) no-repeat 0 0;
+	width: 125px;
+	height: 28px;
+	margin: 2em 0 0 0;
+}
+
+.button_all_accessories:hover {
+	background-position: 0 100%;
+}
+
+.button_all_accessories span {
+	display: none;
+}
+
+.button_all_accessories_white {
+	background:url(images/button_all_accessories_whit.png) no-repeat 0 0;
+}
+
+.button_add_to_cart {
+	display: block;
+	background: url(images/button_add_to_cart.png) no-repeat 0 0;
+	width: 106px;
+	height: 28px;
+	margin: 1em 0 0em 0;
+}
+
+.button_add_to_cart_white {
+	background: url(images/button_add_to_cart_white.png) no-repeat 0 0;
+}
+
+.button_add_to_cart_gray {
+	background-image: url(images/button_add_to_cart_gray.png);
+}
+
+.button_add_to_cart:hover {
+	background-position: 0 100%;
+}
+
+.button_add_to_cart span {
+	display: none;
+}
+
+
+.banner_product_thumbs {
+	margin: 0px 0px 0px 25px;
+	padding: 10px 0px 0px 25px;
+	height: 87px;
+	border-left: 1px solid #616161;
+	float:left;
+}
+
+.banner_product_thumbs li {
+	padding: 0 0 20px 0;
+	margin: 0 30px 0 0;
+	background: 0;
+	display: inline;
+	background:url(images/product_bottom_shadow_small.png) no-repeat 50% 100%
+}
+
+.press_listing {
+	margin: 0 0 30px 10px;
+	padding: 0;
+}
+
+.press_listing li {
+	margin-left:5px;
+	padding-left: 11px;
+	margin-bottom: 8px;
+}
+
+.press_listing li a {
+	color: #333;
+	font-weight: bold;
+}
+
+.press_listing .selected {
+	color: #FF6600;
+}
+
+.press_listing li a:hover {
+	color: #FF6600;
+}
+
+.careers li{
+	background: none;
+	padding: 0 !important;
+	margin-left:0px !important;
+}
+
+.careers li a {
+	background: url(images/article_bullet.png) no-repeat 0 0.2em;
+	padding: 0px 0px 0px 15px;
+	font-size: 1.2em;
+}
+
+.press_category {
+	background: none;
+	padding: 0 !important;
+	margin-left:0px !important;
+}
+
+.press_category a {
+	background: url(images/article_bullet.png) no-repeat 0 0.35em;
+	padding: 0px 0px 0px 15px;
+	font-size: 1.2em;
+}
+
+.press_container h3 {
+	font-size: 1.2em;
+	margin: 0 0 7px 0;
+	padding: 0;
+	color: #444;
+}
+
+.press_container {
+	padding-top: 10px;
+}
+
+.press_container ul {
+	margin: 0 0 0 0px;
+	padding: 0 0 25px 0;
+}
+
+.press_container ul li {
+	margin-bottom: 10px;
+}
+
+.press_container ul li a {
+	font-weight: bold;
+}
+
+.press_container .date {
+	font-size: 0.9em;
+	color: #666;
+}
+
+.career_apply {
+	border-top: 1px solid #CCCCCC;
+	background: #FAFAFA;
+	padding: 15px 25px 15px 25px;
+	margin: 10px 0px 0px 0px;
+}
+
+.career_apply h3 {
+	margin: 0px 0px 5px 0px;
+	padding: 0px;
+}
+
+.top_link {
+	height: 11px;
+	width: 100px;
+	display:block;
+	background:url(images/top_link.png) no-repeat top left;
+	margin-top: 20px;
+}
+
+.top_link_alt {
+	float: left;
+	margin-top: 15px;
+	margin-left: 5px;
+}
+
+.top_link:hover {
+	background-position: bottom left;
+}
+
+.top_link span {
+	display: none;
+}
+
+.top_link_container {
+	border-top: 1px solid #ccc;
+	padding-top: 5px;
+}
+
+.search_excerpt {
+	padding-left: 20px !important;
+	padding-bottom: 15px !important;
+	padding-top: 0px !important;
+}
+
+.search_excerpt strong {
+	background: #e6e6e6;
+}
+
+.display_none {
+	display: none;
+}
+
+.pagination {
+	border-top: 1px solid #CCCCCC;
+	padding-top: 10px;
+	text-align: center;
+	font-size: 0.9em;
+}
+
+.pagination .selected {
+	color: #FF6600 !important;
+}
+
+.pagination a {
+	color: #444;
+	margin-right: 5px;
+	padding-bottom: 2px;
+}
+
+.pagination a:hover {
+	color: #FF6600;
+	text-decoration: none;
+}
+
+.pag_first {
+	background:url(images/icons/icon_first.png) no-repeat 0 2px;
+	padding-left: 14px;
+	margin-right: 20px !important;
+}
+
+.pag_previous {
+	background:url(images/icons/icon_previous.png) no-repeat 0 2px;
+	padding-left: 14px;
+	margin-right: 20px !important;
+}
+
+
+.pag_next {
+	background:url(images/icons/icon_next.png) no-repeat right 2px;
+	padding-right: 14px;
+	margin-left: 15px !important;
+}
+
+.pag_last {
+	background:url(images/icons/icon_last.png) no-repeat right 2px;
+	padding-right: 14px;
+	margin-left: 20px !important;
+}
+
+.pagination .disabled {
+	color: #aaa !important;
+}
+
+.pagination .disabled:hover {
+	color: #aaa !important;
+}
+
+.search_term {
+	background: #E6E6E6;
+	padding: 0px 4px;
+}
+
+.toptab {
+	background: #333333 url(images/toptab_left.png) no-repeat 0 100%;
+	float: right;
+	font-size:0.9em;
+	color: #999999;
+	margin-left: 15px;
+	position: relative;
+	z-index: 100;
+}
+
+.toptab .inner {
+	background:url(images/toptab_right.png) no-repeat 100% 100%;
+	padding: 2px 15px;
+	position: relative;
+}
+
+.toptab a {
+	color: #999;
+}
+
+.toptab a:hover {
+	color: #FF6600 !important;
+	text-decoration: none;
+}
+
+
+.buton_decrease_font{
+	display: block;
+	width: 11px;
+	height: 8px;
+	background:url(images/icons/icon_decrease_font.png) no-repeat 0% 0%;
+}
+
+.buton_decrease_font:hover{
+	background-position:0% 100%;
+}
+
+.buton_decrease_font span {
+	display: none;
+}
+
+.decrease_font,
+.increase_font {
+	font-weight: bold;
+	color: #666 !important;
+	font-size: 0.8em;
+	margin-left: 5px;
+}
+
+.top_tabs_container {
+	position: absolute;
+	right: 0px;
+	top: 0px;
+	margin-right: 20px;
+	z-index: 100;
+}
+
+.product_page {
+	padding: 0px 0px 0px 0px;
+}
+
+.product_page h2 {
+	padding: 0px 0px 10px 15px;
+	margin: 0px 0px 0px 0px;
+	border-bottom: 1px solid #CCCCCC;
+}
+
+.accessories_container {
+	padding: 10px 0px 9px 0px;
+	border-bottom: 1px solid #CCCCCC;
+	position: relative;
+}
+
+.accessories_container .inner {
+	background: url(images/accessories_back.png) repeat-y center 0;
+	border-bottom: 1px solid white;
+}
+
+.accessories_container2 .inner {
+	background: url(images/accessories_back2.png) repeat-y center 0;
+	/*background: none;*/
+	border-bottom: 1px solid white;
+	margin-top: 10px;
+}
+
+.accessories_container_with_border {
+	margin-bottom: 10px;
+}
+
+.accessories_container .column1 {
+	width: 330px;
+	margin:0px 16px 0px 10px;
+	float: left;
+	padding: 5px 0px;
+	font-size: 0.95em;
+}
+
+.accessories_container .column2 {
+	width: 330px;
+	margin:0px 0px 0px 10px;
+	float: left;
+	padding: 5px 0px;
+	font-size: 0.95em;
+}
+
+.accessories_container .column3 {
+	width: 201px;
+	margin:0px 10px 0px 10px;
+	float: left;
+	padding: 5px 0px;
+}
+
+.accessories_container ul {
+	margin: 0 0 0 20px;
+	padding: 0;
+}
+
+.accessories_container ul a {
+	color: #333;
+}
+
+.accessories_container ul a:hover {
+	color: #FF6600;
+}
+
+.accessories_container .button_all_accessories {
+	margin-left: 15px;
+}
+
+.accessories_container h3 {
+	background:url(images/orange_bullet.png) no-repeat 0px 4px;
+	margin: 0px 0px 5px 0px;
+	padding: 0px 0px 0px 15px;
+	font-size: 1.2em;
+}
+
+.accessories_container h3.noimage {
+	background: none;
+}
+
+.accessory_container {
+	text-align: left;
+	padding-bottom: 10px;
+	min-height: 150px;
+	margin-left: 160px;
+}
+
+.accessory_image_container {
+	width: 150px;
+	text-align: center;
+	float: left;
+	padding-top: 30px;
+}
+
+.accessory_image_container img {
+	float: none;
+	margin: 0px;
+	border: none;
+}
+
+.single_accessory {
+	width: 156px;
+	float: left;
+	margin:0px 10px 0px 10px;
+	font-size: 0.95em;
+	padding-bottom: 10px;
+}
+
+.single_accessory h3 {
+	font-size: 1.1em;
+	display: block;
+	height: 2.9em;
+}
+
+.single_accessory .accessory_container {
+	margin-left: 0px;
+}
+
+a.single_image {
+	border-bottom: 1px solid #ccc;
+	text-align: center;
+	display: block;
+	padding-bottom: 10px;
+	padding-top: 10px;
+	min-height: 100px;
+}
+
+.single_image img {
+	margin: 0px;
+	padding: 0px;
+	border: 0px;
+	float: none;
+}
+
+.img_button {
+	display: block;
+	background-position: 0 0;
+	background-repeat: no-repeat;
+}
+
+.img_button:hover {
+	background-position: 0 100%;
+}
+
+.img_button span {
+	display: none;
+}
+
+.button_select {
+	background-image:url(images/button_select.png);
+	width: 66px;
+	height: 28px;
+}
+
+.accessories_container .description {
+	min-height: 90px;
+	padding-bottom: 10px;
+}
+
+#article_description .description {
+	padding-bottom: 15px;
+}
+
+.accessories_listing {
+	position: relative;
+	/*margin-top: 30px;*/
+}
+
+.accessories_listing .pagination {
+	position: absolute;
+	text-align: right;
+	right: 10px;
+	top: -8px;
+	border: none;
+}
+
+.accessories_listing .bottom_pagination {
+	position: static;
+	margin-top: 0px;
+	padding-top: 15px;
+	margin-right: 10px;
+}
+
+a.via {
+	font-size: 0.9em;
+	color: #555;
+	margin-right: 5px;
+}
+
+span.via {
+	font-size: 0.9em;
+	color: #555;
+	margin-right: 5px;
+	font-weight: bold;
+}
+
+.accessory_block {
+	background:url(images/accessory_tile.png) repeat-y 0 0;
+	margin: 0px 0px 5px 0px;
+}
+
+.accessory_block_alternative {
+	background: #333333 url(images/accessory_tile_alt.png) repeat-x 0 0;
+}
+
+.accessory_block .inner {
+	padding: 40px 0px 0em 0px;
+	background:url(images/accessory_top.png) no-repeat 0 0;
+	position: relative;
+	border-bottom: 1px solid #ccc;
+}
+
+.accessory_block_alternative .inner {
+	background-image:url(images/accessory_top_alt.png);
+}
+
+.accessories_left {
+	width: 205px;
+	float: left;
+}
+
+.accessories_right {
+	margin-left: 263px;
+}
+
+#article_description {
+	padding-left: 260px;
+	margin-right: 20px;
+	line-height: 1.5em;
+	padding-bottom: 35px;
+}
+
+.accessory_block_alternative #article_description {
+	min-height: 200px;
+}
+
+.accessory_block_alternative {
+	color: #FFF;
+}
+
+#article_description h2 {
+	font-size: 1.4em;
+	margin: 0;
+	padding: 0;
+	color: #FF6600;
+}
+
+
+#accessories_tabs {
+	margin: 0px 0px 0px 0px;
+	padding: 0px;
+	list-style: none;
+	font-size: 1.1em;
+	display: block;
+
+	position: relative;
+	top: 1px;
+	
+	margin-left: 260px;
+}
+
+#accessories_tabs li {	
+	display: inline;
+	margin: 0;
+	padding: 0;
+	background: none;
+}
+
+#accessories_tabs li a {
+	float: left;
+	display: block;
+	font-weight: bold;
+	color: #333333;
+	text-decoration: none;
+	margin-right: 5px;
+}
+
+.accessory_block_alternative #accessories_tabs li a {
+	color: #FFF;
+}
+
+#accessories_tabs li a span {
+	display: block;
+	padding: 0.5em 0.8em 0.5em 0.9em;
+}
+
+#accessories_tabs li a:hover {
+	color: #FF6600;
+	background:#FFF url(images/accessories_tabs_left.png) no-repeat 0% 0%;
+}
+
+.accessory_block_alternative #accessories_tabs li a:hover {
+	color: #FF6600 ;
+	background:#FFF url(images/accessories_tabs_left_alt.png) no-repeat 0% 0%;
+}
+
+#accessories_tabs li a:hover span {
+	background:url(images/accessories_tabs_right.png) no-repeat 100% 0%;
+}
+
+.accessory_block_alternative #accessories_tabs li a:hover span {
+	background:url(images/accessories_tabs_right_alt.png) no-repeat 100% 0%;
+}
+
+#accessories_tabs li .selected {
+	color: #FF6600 ;
+	background:#FFF url(images/accessories_tabs_left.png) no-repeat 0% 0%;
+}
+
+.accessory_block_alternative #accessories_tabs li .selected {
+	color: #FF6600 ;
+	background:#FFF url(images/accessories_tabs_left_alt.png) no-repeat 0% 0%;
+}
+
+#accessories_tabs li .selected span {
+	background:url(images/accessories_tabs_right.png) no-repeat 100% 0%;
+}
+
+.accessory_block_alternative #accessories_tabs li .selected span {
+	background:url(images/accessories_tabs_right_alt.png) no-repeat 100% 0%;
+}
+
+.accessory_image {
+	position: absolute;
+	left: 20px;
+	top: 20px;
+	width: 210px;
+	text-align: center;
+	padding: 20px 0px;
+}
+
+.accessory_block_alternative .accessory_image {
+	left: -20px;
+	top: -20px;
+	padding: 0px;
+}
+
+.button_by_it_now {
+	background:url(images/button_by_it_now.png) no-repeat 0 0;
+	width: 100px;
+	height: 22px;
+}
+
+.button_news_archive {
+	background:url(images/button_news_archive.png) no-repeat 0 0;
+	width: 100px;
+	height: 22px;
+}
+
+.button_more_details {
+	background:url(images/button_more_details.png) no-repeat 0 0;
+	width: 102px;
+	height: 22px;
+}
+
+.button_more_details_gray {
+	background:url(images/button_more_details_gray.png) no-repeat 0 0;
+	width: 85px;
+	height: 20px;
+}
+
+#featured_phone {
+	width: 950px;
+	height: 330px;
+	background:url(images/banner_products.jpg) no-repeat 0 0;
+	position: relative;
+}
+
+
+#featured_phone .image_container {
+	width: 370px;
+	position: absolute;
+	top: 30px;
+	left: 0px;
+	text-align: right;
+}
+
+.featured_product {
+	padding-top: 80px;
+	padding-left: 414px !important;
+}
+
+.featured_product h2 {
+	font-size: 1.7em !important;
+	margin-bottom: 15px !important;
+}
+
+.featured_product .description {
+	margin-right: 100px;
+	font-weight: bold;
+	color: #FFF;
+}
+
+#featured_accessory {
+	width: 950px;
+	background:url(images/banner_accessories.jpg) repeat-x 0 100%;
+	position: relative;
+	height: 234px;
+}
+
+.featured_image {
+	position: absolute;
+	bottom: 0px;
+	left: 120px;
+}
+
+#featured_accessory #article_description {
+	padding-top: 50px !important;
+	padding-bottom: 40px !important;
+}
+
+#featured_accessory #article_description .description {
+	color: #fff;
+}
+
+.back_to_accessories_container {
+	border-top: 1px solid #CCCCCC;
+	padding-top: 10px;
+	padding-left: 10px;
+	padding-bottom: 10px;
+
+}
+
+.back_to_accessories_container a {
+	background: url(images/bullet_back_to_accessories.png) no-repeat 0 2px;
+	padding: 0px 0px 0px 15px;
+}
+
+.button_buy_it_now {
+	background:url(images/button_buy_it_now.png) no-repeat 0 0;
+	height: 28px;
+	width: 106px;
+	
+	margin-top: 20px;
+}
+
+.separated {
+	margin-top: -20px;
+}
+
+.media_subtitle {
+	display: block;
+	font-size: 0.6em;
+	font-weight: normal;
+}
+
+.media_subtitle .via{
+	font-size: 1em;
+}
+
+.products_page_all_accessories {
+	float: right;
+	margin-top: 15px;
+}
+
+.titlebar {
+	height: 63px;
+	width: 950px;
+	position: relative;
+	border-bottom: 1px solid #CCCCCC;
+}
+
+.titlebar .pagination {
+	padding: 0px;
+	position: absolute;
+	right: 10px;
+	top: 35px;
+	border: 0px;
+}
+
+.titlebar h2 {
+	margin: 0px;
+	top: 15px;
+	position:absolute;
+	top: 30px;
+	left: 259px;
+	font-size: 1.4em;
+}
+
+.titlebar_accessories {
+	background: url(images/titlebar_accessories.jpg) no-repeat 0 0;
+}
+
+.titlebar_products {
+	background: url(images/titlebar_products.jpg) no-repeat 0 0;
+	border-bottom: 1px solid #999999;
+}
+
+
+.left_container_alternative {
+	padding-top: 27px;
+}
+
+.right_container_alternative {
+	padding-top: 0px;
+}
+
+.header_default { background-image: url(images/navigation_default.jpg) !important;}
+.header_default .nav_home { background-image:url(images/navigation/default/home.png) !important; }
+.header_default .nav_about { background-image:url(images/navigation/default/about.png) !important; }
+.header_default .nav_products { background-image:url(images/navigation/default/products.png) !important; }
+.header_default .nav_developers { background-image:url(images/navigation/default/developers.png) !important; }
+.header_default .nav_press { background-image:url(images/navigation/default/press.png) !important; }
+.header_default .nav_careers { background-image:url(images/navigation/default/careers.png) !important; }
+.header_default .nav_contact { background-image:url(images/navigation/default/contact.png) !important; }
+.header_default .nav_shop { background-image:url(images/navigation/default/shop.png) !important;}
+
+.header_products { background-image: url(images/navigation_products.jpg) !important;}
+.header_products .nav_home { background-image:url(images/navigation/products/home.png) !important; }
+.header_products .nav_about { background-image:url(images/navigation/products/about.png) !important; }
+.header_products .nav_products { background-image:url(images/navigation/products/products.png) !important; }
+.header_products .nav_developers { background-image:url(images/navigation/products/developers.png) !important; }
+.header_products .nav_press { background-image:url(images/navigation/products/press.png) !important; }
+.header_products .nav_careers { background-image:url(images/navigation/products/careers.png) !important; }
+.header_products .nav_contact { background-image:url(images/navigation/products/contact.png) !important; }
+.header_products .nav_shop { background-image:url(images/navigation/products/shop.png) !important;padding-left: 5px;}
+
+.header_accessories { background-image: url(images/navigation_accessories.jpg) !important;}
+.header_accessories .nav_home { background-image:url(images/navigation/accessories/home.png) !important; }
+.header_accessories .nav_about { background-image:url(images/navigation/accessories/about.png) !important; }
+.header_accessories .nav_products { background-image:url(images/navigation/accessories/products.png) !important; }
+.header_accessories .nav_developers { background-image:url(images/navigation/accessories/developers.png) !important; }
+.header_accessories .nav_press { background-image:url(images/navigation/accessories/press.png) !important; }
+.header_accessories .nav_careers { background-image:url(images/navigation/accessories/careers.png) !important; }
+.header_accessories .nav_contact { background-image:url(images/navigation/accessories/contact.png) !important; }
+.header_accessories .nav_shop { background-image:url(images/navigation/accessories/shop.png) !important;}
+
+
+#product_neo1973 #header { background-image: url(images/navigation_neo.png) !important; background: #1F1F1F !important;}
+#product_neo1973 .nav_home { background-image:url(images/navigation/phone/home.png) !important; }
+#product_neo1973 .nav_about { background-image:url(images/navigation/phone/about.png) !important; }
+#product_neo1973 .nav_products { background-image:url(images/navigation/phone/products.png) !important; }
+#product_neo1973 .nav_developers { background-image:url(images/navigation/phone/developers.png) !important; }
+#product_neo1973 .nav_press { background-image:url(images/navigation/phone/press.png) !important; }
+#product_neo1973 .nav_careers { background-image:url(images/navigation/phone/careers.png) !important; }
+#product_neo1973 .nav_contact { background-image:url(images/navigation/phone/contact.png) !important; }
+#product_neo1973 .nav_shop { background-image:url(images/navigation/phone/shop.png) !important;}
+#product_neo1973 .toptab { background: #424242 url(images/phone_toptab_left.png) no-repeat 0 100%;}
+#product_neo1973 .toptab .inner { background:url(images/phone_toptab_right.png) no-repeat 100% 100%; padding: 2px 15px; position: relative; }
+
+.home_quote {
+	width: 248px;
+	border-top: 1px solid #CCCCCC;
+	font-weight: bold;
+	font-size: 1.1em;
+	padding: 15px 20px;
+	background: #F0F1F2 url(images/home_quote.png) no-repeat left bottom;
+	float: right;
+	margin: 93px -10px 10px 10px;
+	position:relative;
+	left: 5px;
+}
+
+.home_quote .author {
+	font-weight: normal;
+	font-size: 0.9em;
+	border-top: 1px solid #ccc;
+	padding-top: 4px;
+	margin-top: 12px;
+}
+
+#products_page {
+	height: 551px;
+	background: url(images/products_page.jpg) no-repeat 0 0;
+}
+
+.single_product {
+	margin-top: 0px;
+	width: 430px;
+	height: 500px;
+}
+
+.first_single_product {
+	position: absolute;
+	left: 30px;
+}
+
+.second_single_product {
+	position: absolute;
+	left: 460px;
+}
+
+.single_product .image_container {
+	text-align: center;
+	height: 310px;
+}
+
+.single_product .article_description {
+	padding: 0px 30px;
+	color: #FFF;
+}
+
+.single_product .article_description h2 {
+	font-size: 20px;
+}
+
+.single_product .article_description h2 a:hover{
+	color: #FFF;
+	text-decoration: none;
+}
+
+.single_product .article_description .description{
+	font-size: 1.1em;
+	font-weight: normal;
+	line-height: 150%;
+	letter-spacing: 0.1em;
+}
+
+.contact_single_block {
+	border-bottom: 1px solid #cccccc;
+	padding-top: 10px;
+	padding-bottom: 10px;
+	margin-right: 10px;
+}
+
+.contact_single_block h3 {
+	margin-bottom: 8px;
+	margin-top: 0px;
+}
+
+.contact_single_block h4 {
+	font-size: 1em;
+	margin: 12px 0px 0px;
+	padding: 0px;
+}
+
+.contact_mails {
+	padding: 1px 0px !important;
+}
+
+.contact_mails span {
+	float: left;
+	display: block;
+	width: 120px;
+}
+
+.contact_mails a {
+	margin-left: 30px;
+}
+
+.contact_column {
+	width: 48%;
+	float: left;
+	padding-right: 10px;
+}
+
+.contact_map_container {
+	text-align: center;
+	background: #c0c0c0;
+	padding: 25px 0px 25px;
+	margin-bottom: 15px;
+}
+
+.contact_map_container img {
+	float: none !important;
+	border: none !important;
+	margin: 0px !important;
+}
+
+.contact_single_block img {
+	float: none !important;
+	border: none !important;
+	margin: 0px !important;
+}
+
+
+.screenshot_thumb {
+	width: 56px;
+	height: 80px;
+	background:url(images/thumb_background.png);
+	float: left;
+	text-align: center;
+	padding-top: 8px;
+	margin: 0px 12px 20px;
+	cursor: pointer;
+}
+
+#screenshot_caption {
+	width: 315px;
+	float: left;
+	padding-right: 20px;
+	line-height: 150%;
+}
+
+.screenshots_page .title_container {
+	border-bottom:1px solid #CCCCCC;
+	margin:0pt 0pt 0.7em;
+	padding-top: 1.5em;
+}
+
+.screenshots_right {
+	padding: 10px 0px 10px 20px;
+	float: left;
+	border-left: 1px solid #CCCCCC;
+	width: 590px;
+}
+
+.screenshot_image {
+	width: 325px;
+	overflow: hidden;
+	float: left;
+}
+
+.screenshot_thumbs {
+	float: left;
+	width: 255px;
+}
\ No newline at end of file

Added: trunk/www.openmoko.com/textpattern/checksums.txt
===================================================================
--- trunk/www.openmoko.com/textpattern/checksums.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/checksums.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+/include/txp_category.php: r1879 (aee777474b2f67ca07fc25756ba25c15)
+/include/txp_plugin.php: r1917 (74184c0d8ed8608f840707a255178617)
+/include/txp_auth.php: r1879 (b1dd4072b7daf4e997c6ff65ce3d1b2d)
+/include/txp_form.php: r1913 (16ec600b41438b4cca10d2c8a19b2db8)
+/include/txp_section.php: r1891 (2959593586ba3e97bc602f369c32e738)
+/include/txp_tag.php: r1915 (3b4a7f73d92f9bbbe09985c5aa830d29)
+/include/txp_list.php: r1892 (41f4d32fd070234b78f94adefebd5234)
+/include/txp_page.php: r1913 (34331a5468bbb18dd9f6a282f3aa11e8)
+/include/txp_discuss.php: r1909 (9b9ee934a30f52cd7a4d8cb45c8380ab)
+/include/txp_prefs.php: r1946 (05615b6275d8927a2a0d51918d70a896)
+/include/txp_log.php: r1919 (ed54d02e865319f2506c642a6bde768b)
+/include/txp_preview.php: r1238 (5a4ae3ff0d68f4cb573d6d62a00ce9e8)
+/include/txp_image.php: r1955 (20be975e67fa7c4aa9a1a3e51bfaf379)
+/include/txp_article.php: r1 (5de4788f6677ecc6db63a6de401904c3)
+/include/txp_css.php: r1897 (f5cf1c20badb96a063c7c180e9020359)
+/include/txp_admin.php: r1879 (d36dac010d21df7bcf9cf5e242b34d58)
+/include/txp_link.php: r1879 (0652287df8bb32c66cfa1b939402404a)
+/include/txp_diag.php: r1 (920572f26c34f4966c426ec3586bf245)
+/include/txp_file.php: r1895 (6ed67b094522e51b028dc88baa07444c)
+/include/txp_import.php: r1238 (634e75d1b61958875ff275e3130f23ad)
+/lib/admin_config.php: r1747 (1563fcbaffe25b3272b0d85ff9d5571d)
+/lib/txplib_misc.php: r1956 (182c50b86195f1abe9dbe15728df3cae)
+/lib/taglib.php: r1535 (04806ef864d5b0d2974e0e5f6397a2d7)
+/lib/txplib_head.php: r1887 (b110efd071e9a5bb395beea66ced128a)
+/lib/classTextile.php: r1943 (2c559991e34738eef1990dc079bd91c4)
+/lib/txplib_html.php: r1937 (c206ca9cb9a54a7a95f3355b77fd0fa2)
+/lib/txplib_db.php: r1879 (d68b6ea69950e405c4fec23b8641d9c2)
+/lib/IXRClass.php: r765 (cbe59b59246dce060a4b4a52b4d448d8)
+/lib/txplib_forms.php: r1887 (0049a228dc8eb346f8603478a7c1b2e2)
+/lib/class.thumb.php: r1955 (12961180eee3add5096e69e0a154284e)
+/lib/constants.php: r1955 (0e40251c717c52b2b7fe992b62a3e97a)
+/lib/txplib_update.php: r1239 (757f8189fcc53a795d7c807f17b2e788)
+/lib/txplib_wrapper.php: r1239 (584448787b4a3488200722672c0eee0d)
+/publish/taghandlers.php: r1949 (3fa1b9ded18e6074b2495a3f4e3c33b5)
+/publish/atom.php: r1864 (50602e2f1c443819a0a60f14f39d3093)
+/publish/log.php: r1637 (a4a772567079f18101a1752446f3f6d4)
+/publish/comment.php: r1951 (a3f803d744fea80808eb27a3f6b28674)
+/publish/search.php: r1748 (b0182abc287055fe0932c263b2a5266d)
+/publish/rss.php: r1864 (ae43eaa9ebe6b00e63810ae60ca7c6b6)
+/publish.php: r1945 (abff727405efc6c4ec8b1cb403290063)
+/index.php: r1 (c537f432e88b5ce3f32d99373b0db707)
+/css.php: r944 (763fa7658fc19ad23a5b2126fcdf366c)

Added: trunk/www.openmoko.com/textpattern/checksums.txt_orig
===================================================================
--- trunk/www.openmoko.com/textpattern/checksums.txt_orig	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/checksums.txt_orig	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+/include/txp_category.php: r1879 (aee777474b2f67ca07fc25756ba25c15)
+/include/txp_plugin.php: r1917 (74184c0d8ed8608f840707a255178617)
+/include/txp_auth.php: r1879 (b1dd4072b7daf4e997c6ff65ce3d1b2d)
+/include/txp_form.php: r1913 (16ec600b41438b4cca10d2c8a19b2db8)
+/include/txp_section.php: r1891 (2959593586ba3e97bc602f369c32e738)
+/include/txp_tag.php: r1915 (3b4a7f73d92f9bbbe09985c5aa830d29)
+/include/txp_list.php: r1892 (41f4d32fd070234b78f94adefebd5234)
+/include/txp_page.php: r1913 (34331a5468bbb18dd9f6a282f3aa11e8)
+/include/txp_discuss.php: r1909 (9b9ee934a30f52cd7a4d8cb45c8380ab)
+/include/txp_prefs.php: r1946 (05615b6275d8927a2a0d51918d70a896)
+/include/txp_log.php: r1919 (ed54d02e865319f2506c642a6bde768b)
+/include/txp_preview.php: r1238 (5a4ae3ff0d68f4cb573d6d62a00ce9e8)
+/include/txp_image.php: r1955 (20be975e67fa7c4aa9a1a3e51bfaf379)
+/include/txp_article.php: r1889 (7749f699c03d0c57e04fafe17dbfa94c)
+/include/txp_css.php: r1897 (f5cf1c20badb96a063c7c180e9020359)
+/include/txp_admin.php: r1879 (d36dac010d21df7bcf9cf5e242b34d58)
+/include/txp_link.php: r1879 (0652287df8bb32c66cfa1b939402404a)
+/include/txp_diag.php: r1902 (96697ade63048e517177f4129d47de76)
+/include/txp_file.php: r1895 (6ed67b094522e51b028dc88baa07444c)
+/include/txp_import.php: r1238 (634e75d1b61958875ff275e3130f23ad)
+/lib/admin_config.php: r1747 (1563fcbaffe25b3272b0d85ff9d5571d)
+/lib/txplib_misc.php: r1956 (182c50b86195f1abe9dbe15728df3cae)
+/lib/taglib.php: r1535 (04806ef864d5b0d2974e0e5f6397a2d7)
+/lib/txplib_head.php: r1887 (b110efd071e9a5bb395beea66ced128a)
+/lib/classTextile.php: r1943 (2c559991e34738eef1990dc079bd91c4)
+/lib/txplib_html.php: r1937 (c206ca9cb9a54a7a95f3355b77fd0fa2)
+/lib/txplib_db.php: r1879 (d68b6ea69950e405c4fec23b8641d9c2)
+/lib/IXRClass.php: r765 (cbe59b59246dce060a4b4a52b4d448d8)
+/lib/txplib_forms.php: r1887 (0049a228dc8eb346f8603478a7c1b2e2)
+/lib/class.thumb.php: r1955 (12961180eee3add5096e69e0a154284e)
+/lib/constants.php: r1955 (0e40251c717c52b2b7fe992b62a3e97a)
+/lib/txplib_update.php: r1239 (757f8189fcc53a795d7c807f17b2e788)
+/lib/txplib_wrapper.php: r1239 (584448787b4a3488200722672c0eee0d)
+/publish/taghandlers.php: r1949 (3fa1b9ded18e6074b2495a3f4e3c33b5)
+/publish/atom.php: r1864 (50602e2f1c443819a0a60f14f39d3093)
+/publish/log.php: r1637 (a4a772567079f18101a1752446f3f6d4)
+/publish/comment.php: r1951 (a3f803d744fea80808eb27a3f6b28674)
+/publish/search.php: r1748 (b0182abc287055fe0932c263b2a5266d)
+/publish/rss.php: r1864 (ae43eaa9ebe6b00e63810ae60ca7c6b6)
+/publish.php: r1945 (abff727405efc6c4ec8b1cb403290063)
+/index.php: r1948 (adf86f44861797f4969373c708ef48fb)
+/css.php: r944 (763fa7658fc19ad23a5b2126fcdf366c)

Added: trunk/www.openmoko.com/textpattern/config.php
===================================================================
--- trunk/www.openmoko.com/textpattern/config.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/config.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,9 @@
+<?php
+	$txpcfg['db'] = OPENMOKO_WEB_DB_NAME;
+	$txpcfg['user'] = OPENMOKO_WEB_DB_USER;
+	$txpcfg['pass'] = OPENMOKO_WEB_DB_PASSWD;
+	$txpcfg['host'] = OPENMOKO_WEB_DB_HOST;
+	$txpcfg['table_prefix'] = 'openmoko';
+	$txpcfg['txpath'] = OPENMOKO_WEB_FS_PATH.'/textpattern';
+	$txpcfg['dbcharset'] = 'utf8';
+?>
\ No newline at end of file

Added: trunk/www.openmoko.com/textpattern/css.php
===================================================================
--- trunk/www.openmoko.com/textpattern/css.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/css.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,23 @@
+<?php
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/css.php $
+$LastChangedRevision: 944 $
+*/
+
+if (@ini_get('register_globals'))
+	foreach ( $_REQUEST as $name => $value )
+		unset($$name);
+
+header('Content-type: text/css');
+
+ob_start(NULL, 2048);
+include './config.php';
+ob_end_clean();
+
+$nolog = 1;
+define("txpinterface", "css");
+include $txpcfg['txpath'].'/publish.php';
+$s = gps('s');
+$n = gps('n');
+output_css($s,$n);
+?>

Added: trunk/www.openmoko.com/textpattern/include/import/BloggerImportTemplate.txt
===================================================================
--- trunk/www.openmoko.com/textpattern/include/import/BloggerImportTemplate.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/import/BloggerImportTemplate.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,20 @@
+<Blogger>
+TITLE: <BlogItemTitle><BlogItemURL>\"></BlogItemURL><$BlogItemTitle$></BlogItemTitle>
+AUTHOR: <$BlogItemAuthorNickname$>
+DATE: <$BlogItemDateTime$>
+STATUS: Publish
+-----
+BODY:
+<$BlogItemBody$>
+<BlogItemCommentsEnabled>
+-----
+<BlogItemComments>
+COMMENT:
+AUTHOR: <$BlogCommentAuthor$>
+DATE: <$BlogCommentDateTime$>
+<$BlogCommentBody$>
+-----
+</BlogItemComments>
+</BlogItemCommentsEnabled>
+--------
+</Blogger>
\ No newline at end of file

Added: trunk/www.openmoko.com/textpattern/include/import/import_b2.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/import/import_b2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/import/import_b2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,159 @@
+<?php
+	//Absolutely untested. Any volunteer with a b2 db dump to collaborate?
+	
+	function doImportB2($b2dblogin, $b2db, $b2dbpass, $b2dbhost, $insert_into_section, $insert_with_status, $default_comment_invite)
+	{
+
+		global $txpcfg;
+		//Keep some response on some part
+		$results = array();	
+		
+		
+		// let's go - Dean says ;-).		
+		$b2link = mysql_connect($b2dbhost,$b2dblogin,$b2dbpass,true);
+		if(!$b2link){ 
+			return 'b2 database values don&#8217;t work. Go back, replace them and try again';
+		}				
+		mysql_select_db($b2db,$b2link);
+		$results[]='connected to b2 database. Importing Data';
+
+        // Copy & Paste your table-definitions from b2config.php
+        $tableposts = 'b2posts';
+        $tableusers = 'b2users';
+        $tablecategories = 'b2categories';
+        $tablecomments = 'b2comments';
+
+		
+		$a = mysql_query("
+			select 
+			".$tableposts.".ID as ID,
+			".$tableposts.".post_date as Posted, 
+			".$tableposts.".post_title as Title, 
+			".$tableposts.".post_content as Body, 
+			".$tablecategories.".cat_name as Category1, 
+			".$tableusers.".user_login as AuthorID 
+			from ".$tableposts." 
+			left join ".$tablecategories." on 
+				".$tablecategories.".cat_ID = ".$tableposts.".post_category 
+			left join ".$tableusers." on 
+				".$tableusers.".ID = ".$tableposts.".post_author
+            ORDER BY post_date DESC
+		",$b2link) or $results[]= mysql_error();
+		
+		while($b=mysql_fetch_array($a)) {
+			$articles[] = $b;
+		}
+	
+		$a = mysql_query("
+			select
+			".$tablecomments.".comment_ID as discussid, 
+			".$tablecomments.".comment_post_ID as parentid, 
+			".$tablecomments.".comment_author_IP as ip, 
+			".$tablecomments.".comment_author as name, 
+			".$tablecomments.".comment_author_email as email, 
+			".$tablecomments.".comment_author_url as web, 
+			".$tablecomments.".comment_content as message, 
+			".$tablecomments.".comment_date as posted
+			from ".$tablecomments."
+		",$b2link) or $results[]= mysql_error();
+	
+		
+	
+		while($b=mysql_fetch_assoc($a)){
+			$comments[] = $b;
+		}
+	
+		mysql_close($b2link);	
+		
+		//keep a handy copy of txpdb values, and do not alter Dean code
+		// for now! ;-)
+
+		$txpdb      = $txpcfg['db'];
+		$txpdblogin = $txpcfg['user'];
+		$txpdbpass  = $txpcfg['pass'];
+		$txpdbhost  = $txpcfg['host'];		
+	
+		//Yes, we have to make a new connection
+		//otherwise doArray complains
+		$DB = new DB; 
+		$txplink = &$DB->link;
+
+		mysql_select_db($txpdb,$txplink);
+	
+		include txpath.'/lib/classTextile.php';
+		
+		$textile = new Textile;
+	
+		if (!empty($articles)) {
+			foreach($articles as $a){	
+				if (is_callable('utf8_encode'))
+                {
+                    // Also fixing break-tags for users with b2s Auto-BR
+					$a['Body'] = utf8_encode(str_replace("<br />\n","\n",stripslashes($a['Body'])));
+					$a['Title'] = utf8_encode(stripslashes($a['Title']));
+            		$a['Title'] = $textile->TextileThis($a['Title'],'',1);
+                }
+                // b2 uses the magic word "<!--more-->" to generate excerpts
+                if (strpos($a['Body'],'<!--more-->')) 
+                {
+                    //Everything that is before "more" can be treated as the excerpt.
+                    $pos = strpos($a['Body'],'<!--more-->');
+                    $a['Excerpt'] = substr($a['Body'],0,$pos);
+                    $a['Excerpt_html'] = $textile->textileThis($a['Excerpt']);
+                    $a['Body'] = str_replace('<!--more-->','',$a['Body']);
+                }
+                else
+                {
+                    $a['Excerpt'] = '';
+                    $a['Excerpt_html'] = '';
+                }
+                $a['url_title'] = stripSpace($a['Title'],1);
+				$a['Body_html'] = $textile->textileThis($a['Body']);
+				extract(array_slash($a));
+				$q = mysql_query("
+					insert into `".PFX."textpattern` set 
+					ID        = '$ID',
+					Posted    = '$Posted',
+					Title     = '$Title',
+                    url_title = '$url_title',
+					Body      = '$Body',
+					Body_html = '$Body_html',
+					Excerpt   = '$Excerpt',
+					Excerpt_html = '$Excerpt_html',
+					Category1 = '$Category1',
+					AuthorID  = '$AuthorID',
+					Section   = '$insert_into_section',
+					AnnotateInvite = '$default_comment_invite',
+					uid='".md5(uniqid(rand(),true))."',
+					feed_time='".substr($Posted,0,10)."',
+					Status    = '$insert_with_status'
+				",$txplink) or $results[]= mysql_error();
+		
+				if (mysql_insert_id() ) {	
+					$results[]= 'inserted b2 entry '.$Title.
+						' into Textpattern as article '.$ID.'';
+				}
+			}
+		}
+	
+		if (!empty($comments)) {
+			foreach ($comments as $comment) {
+				extract(array_slash($comment));
+				if (is_callable('utf8_encode'))
+					$message = utf8_encode($message);
+				$message = nl2br($message);
+		
+				$q = mysql_query("insert into `".PFX."txp_discuss` values 
+					($discussid,$parentid,'$name','$email','$web','$ip','$posted','$message',1)",
+				$txplink) or $results[]= mysql_error($q);
+		
+				if(mysql_insert_id()) {
+					$results[]= 'inserted b2 comment <strong>'.$parentid
+						.'</strong> into txp_discuss';
+				} 
+			}
+		}
+		return join('<br />', $results);
+	}	
+		
+?>		

Added: trunk/www.openmoko.com/textpattern/include/import/import_blogger.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/import/import_blogger.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/import/import_blogger.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,164 @@
+<?php
+//Long live zem!
+
+//Time for 45KB: 0.9648-1.3698sec.
+function doImportBLOGGER($file, $section, $status, $invite) {
+
+	# Parse a file in the MT Import Format, as described here:
+	# http://www.movabletype.org/docs/mtimport.html
+	# This doesn't interpret the data at all, just parse it into
+	# a structure.
+
+	$fp = fopen($file, 'r');
+	if (!$fp)
+		return false;
+		
+	//Keep some response on some part
+	$results = array();
+	$multiline_type = '';
+	$multiline_data = '';
+	$state = 'metadata';
+	$item = array();
+
+	while (!feof($fp)) {
+		$line = rtrim(fgets($fp, 8192));
+
+		# The states suggested by the spec are inconsisent, but
+		# we'll do our best to fake it
+
+		if ($line == '--------') {
+			# End of an item, so we can process it
+			$results[]=import_blogger_item($item, $section, $status, $invite);
+			$item = array();
+			$state = 'metadata';
+		}
+		elseif ($line == '-----' and $state == 'metadata') {
+			$state = 'multiline';
+			$multiline_type = '';
+		}
+		elseif ($line == '-----' and $state == 'multiline') {
+			if (!empty($multiline_type))
+				$item[$multiline_type][] = $multiline_data;
+			$state = 'multiline';
+			$multiline_type = '';
+		}
+		elseif ($state == 'metadata') {
+			if (preg_match('/^([A-Z ]+):\s*(.*)$/', $line, $match))
+				$item[$match[1]] = $match[2];
+		}
+		elseif ($state == 'multiline' and empty($multiline_type)) {
+			if (preg_match('/^([A-Z ]+):\s*$/', $line, $match)) {
+				$multiline_type = $match[1];
+				$multiline_data = array();
+			}
+		}
+		elseif ($state == 'multiline') {
+			# Here's where things get hinky.  Rather than put the
+			# multiline metadata before the field name, it goes
+			# after, with no clear separation between metadata
+			# and data.  And either the metadata or data might be
+			# missing.
+
+			if (empty($multiline_data['content']) and preg_match('/^([A-Z ]+):\s*(.*)$/', $line, $match)) {
+				# Metadata within the multiline field
+				$multiline_data[$match[1]] = $match[2];
+			}
+			elseif (empty($multiline_data['content'])) {
+				$multiline_data['content'] = ($line . "\n");
+			}
+			else {
+				$multiline_data['content'] .= ($line . "\n");
+			}
+		}
+	}
+
+	# Catch the last item in the file, if it doesn't end with a separator
+	if (!empty($item))
+		$results[]= import_blogger_item($item, $section, $status, $invite, $blogid);
+
+	fclose($fp);
+	return join('<br />', $results);
+}
+//Some \n chars on empty fields should be removed from body_extended and excerpt
+//What about the new title_html field?
+
+//Fields that are on MT format, but have not sense for blogger are commented
+function import_blogger_item($item, $section, $status, $invite) {
+
+	# Untested import code follows
+
+	if (empty($item)) return;
+
+	include_once txpath.'/lib/classTextile.php';
+	$textile = new Textile();
+	
+	$title = $textile->TextileThis($item['TITLE'], 1);	
+	$url_title = stripSpace($title,1);
+
+	$body = $item['BODY'][0]['content'];
+	$body_html = $textile->textileThis($body, 1);
+
+	$date = strtotime($item['DATE']);
+	$date = date('Y-m-d H:i:s', $date);
+
+	if (isset($item['STATUS']))
+		$post_status = ($item['STATUS'] == 'Draft' ? 1 : 4);
+	else
+		$post_status = $status;
+
+	//Bogger can use special chars on author names. Strip them and check for realname
+	$authorid = safe_field('user_id', 'txp_users', "RealName = '".doSlash($item['AUTHOR'])."'");
+	if (!$authorid)
+//		$authorid = safe_field('user_id', 'txp_users', 'order by user_id asc limit 1');
+		//Add new authors
+		safe_insert('txp_users', "name='".doSlash(stripSpace($textile->TextileThis($item['AUTHOR'],1)))."', RealName='".doSlash($item['AUTHOR'])."'");
+
+		
+	if (!safe_field("ID", "textpattern", "Title = '".doSlash($title)."' AND Posted = '".doSlash($date)."'")) {
+		safe_insert('textpattern', 
+			"Posted='".doSlash($date)."',".
+			"LastMod='".doSlash($date)."',".
+			"AuthorID='".doSlash($item['AUTHOR'])."',".
+			"LastModID='".doSlash($item['AUTHOR'])."',".
+			"Title='".doSlash($title)."',".
+			"Body='".doSlash($body)."',".
+			"Body_html='".doSlash($body_html)."',".
+			"AnnotateInvite='".doSlash($invite)."',".
+			"Status='".doSlash($post_status)."',".
+			"Section='".doSlash($section)."',".
+			"uid='".md5(uniqid(rand(),true))."',".
+			"feed_time='".substr($date,0,10)."',".
+			"url_title='".doSlash($url_title)."'");
+			
+
+		$parentid = mysql_insert_id();
+	
+		if (!empty($item['COMMENT'])) {
+			foreach ($item['COMMENT'] as $comment) {
+				$comment_date = date('Y-m-d H:i:s', strtotime(@$comment['DATE']));
+				$comment_content = $textile->TextileThis(nl2br(@$comment['content']),1);
+				//Check for Comments authors
+				if (preg_match('/<a href="(.*)">(.*)<\/a>/', @$comment['AUTHOR'], $match)) {
+					@$comment['URL'] = $match[1];
+					@$comment['AUTHOR'] = $match[2];
+				}
+				if (!safe_field("discussid","txp_discuss","posted = '".doSlash($comment_date)."' AND message = '".doSlash($comment_content)."'")) {
+					safe_insert('txp_discuss', 
+						"parentid='".doSlash($parentid)."',".
+						//blogger places the link to user profile page as comment author
+						"name='".doSlash(strip_tags(@$comment['AUTHOR']))."',".
+//						"email='".doSlash(@$item['EMAIL'])."',".
+						"web='".doSlash(@$comment['URL'])."',".
+//						"ip='".doSlash(@$item['IP'])."',".
+						"posted='".doSlash($comment_date)."',".
+						"message='".doSlash($comment_content)."',".
+						"visible='1'");
+				}
+			}
+		}
+		return $title;
+	}
+	return $title.' already imported';
+}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/import/import_mt.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/import/import_mt.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/import/import_mt.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,170 @@
+<?php
+//Long live zem!
+
+//Time for 45KB: 0.9648-1.3698sec.
+//Time for 2.612KB: 30sec.
+function doImportMT($file, $section, $status, $invite) {
+
+	# Parse a file in the MT Import Format, as described here:
+	# http://www.movabletype.org/docs/mtimport.html
+	# This doesn't interpret the data at all, just parse it into
+	# a structure.
+
+	$fp = fopen($file, 'r');
+	if (!$fp)
+		return false;
+		
+	//Keep some response on some part
+	$results = array();	
+
+	$state = 'metadata';
+	$item = array();
+
+	while (!feof($fp)) {
+		$line = rtrim(fgets($fp, 8192));
+
+		# The states suggested by the spec are inconsisent, but
+		# we'll do our best to fake it
+
+		if ($line == '--------') {
+			# End of an item, so we can process it
+			$results[]=import_mt_item($item, $section, $status, $invite);
+			$item = array();
+			$state = 'metadata';
+		}
+		elseif ($line == '-----' and $state == 'metadata') {
+			$state = 'multiline';
+			$multiline_type = '';
+		}
+		elseif ($line == '-----' and $state == 'multiline') {
+			if (!empty($multiline_type))
+				$item[$multiline_type][] = $multiline_data;
+			$state = 'multiline';
+			$multiline_type = '';
+		}
+		elseif ($state == 'metadata') {
+			if (preg_match('/^([A-Z ]+):\s*(.*)$/', $line, $match))
+				$item[$match[1]] = $match[2];
+		}
+		elseif ($state == 'multiline' and empty($multiline_type)) {
+			if (preg_match('/^([A-Z ]+):\s*$/', $line, $match)) {
+				$multiline_type = $match[1];
+				$multiline_data = array();
+			}
+		}
+		elseif ($state == 'multiline') {
+			# Here's where things get hinky.  Rather than put the
+			# multiline metadata before the field name, it goes
+			# after, with no clear separation between metadata
+			# and data.  And either the metadata or data might be
+			# missing.
+
+			if (empty($multiline_data['content']) and preg_match('/^([A-Z ]+):\s*(.*)$/', $line, $match)) {
+				# Metadata within the multiline field
+				$multiline_data[$match[1]] = $match[2];
+			}
+			elseif (empty($multiline_data['content'])) {
+				$multiline_data['content'] = ($line . "\n");
+			}
+			else {
+				$multiline_data['content'] .= ($line . "\n");
+			}
+		}
+	}
+
+	# Catch the last item in the file, if it doesn't end with a separator
+	if (!empty($item))
+		$results[]= import_mt_item($item, $section, $status, $invite, $blogid);
+
+	fclose($fp);
+	return join('<br />', $results);
+}
+//Some \n chars on empty fields should be removed from body_extended and excerpt
+//What about the new title_html field?
+function import_mt_item($item, $section, $status, $invite) {
+
+	# Untested import code follows
+
+	if (empty($item)) return;
+
+	include_once txpath.'/lib/classTextile.php';
+	$textile = new Textile();
+
+
+	$title = $textile->TextileThis($item['TITLE'], 1);
+	//nice non-english permlinks	
+	$url_title = stripSpace($title,1);
+
+	$body = $item['BODY'][0]['content'] . (isset($item['EXTENDED_BODY']) ? "\n<!--more-->\n" . $item['EXTENDED_BODY'][0]['content'] : '');
+	$body_html = $textile->textileThis($body);
+
+	$excerpt = @$item['EXCERPT'][0]['content'];
+	$excerpt_html = $textile->textileThis($excerpt);
+
+	$date = strtotime($item['DATE']);
+	$date = date('Y-m-d H:i:s', $date);
+
+	if (isset($item['STATUS']))
+		$post_status = ($item['STATUS'] == 'Draft' ? 1 : 4);
+	else
+		$post_status = $status;
+
+	$category1 = @$item['PRIMARY CATEGORY'];
+	if ($category1 and !safe_field("name","txp_category","name = '$category1'"))
+			safe_insert('txp_category', "name='".doSlash($category1)."', type='article', parent='root'");
+
+	$keywords = @$item['KEYWORDS'][0]['content'];
+
+	$authorid = safe_field('user_id', 'txp_users', "name = '".doSlash($item['AUTHOR'])."'");
+	if (!$authorid)
+//		$authorid = safe_field('user_id', 'txp_users', 'order by user_id asc limit 1');
+		//Add new authors
+		safe_insert('txp_users', "name='".doSlash($item['AUTHOR'])."'");
+
+		
+	if (!safe_field("ID", "textpattern", "Title = '".doSlash($title)."' AND Posted = '".doSlash($date)."'")) {
+		safe_insert('textpattern', 
+			"Posted='".doSlash($date)."',".
+			"LastMod='".doSlash($date)."',".
+			"AuthorID='".doSlash($item['AUTHOR'])."',".
+			"LastModID='".doSlash($item['AUTHOR'])."',".
+			"Title='".doSlash($title)."',".
+			"Body='".doSlash($body)."',".
+			"Body_html='".doSlash($body_html)."',".
+			"Excerpt='".doSlash($excerpt)."',".
+			"Excerpt_html='".doSlash($excerpt_html)."',".
+			"Category1='".doSlash($category1)."',".
+			"AnnotateInvite='".doSlash($invite)."',".
+			"Status='".doSlash($post_status)."',".
+			"Section='".doSlash($section)."',".
+			"Keywords='".doSlash($keywords)."',".
+			"uid='".md5(uniqid(rand(),true))."',".
+			"feed_time='".substr($date,0,10)."',".
+			"url_title='".doSlash($url_title)."'");
+			
+
+		$parentid = mysql_insert_id();
+	
+		if (!empty($item['COMMENT'])) {
+			foreach ($item['COMMENT'] as $comment) {
+				$comment_date = date('Y-m-d H:i:s', strtotime(@$comment['DATE']));
+				$comment_content = $textile->TextileThis(nl2br(@$comment['content']),1);
+				if (!safe_field("discussid","txp_discuss","posted = '".doSlash($comment_date)."' AND message = '".doSlash($comment_content)."'")) {
+					safe_insert('txp_discuss', 
+						"parentid='".doSlash($parentid)."',".
+						"name='".doSlash(@$comment['AUTHOR'])."',".
+						"email='".doSlash(@$comment['EMAIL'])."',".
+						"web='".doSlash(@$comment['URL'])."',".
+						"ip='".doSlash(@$comment['IP'])."',".
+						"posted='".doSlash($comment_date)."',".
+						"message='".doSlash($comment_content)."',".
+						"visible='1'");
+				}
+			}
+		}
+		return $title;
+	}
+	return $title.' already imported';
+}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/import/import_mtdb.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/import/import_mtdb.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/import/import_mtdb.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,220 @@
+<?php
+
+// ----------------------------------------------------------------
+	function doImportMTDB($mt_dblogin, $mt_db, $mt_dbpass, $mt_dbhost, $blog_id, $insert_into_section, $insert_with_status, $default_comment_invite)
+	{
+		global $txpcfg;			
+		//Keep some response on some part
+		$results = array();
+		
+		//Avoid left joins
+		$authors_map = array();
+		$categories_map = array();
+		
+		// let's go - Dean says ;-).		
+		$mtlink = mysql_connect($mt_dbhost,$mt_dblogin,$mt_dbpass,true);
+		if(!$mtlink){ 
+				return 'mt database values don&#8217;t work. Please replace them and try again';
+		}				
+		mysql_select_db($mt_db,$mtlink);
+		$results[]= 'connected to mt database. Importing Data';
+		
+		sleep(2);
+		
+		$a = mysql_query("
+			select
+			author_id as user_id, 
+			author_nickname as name, 
+			author_name as RealName, 
+			author_email as email, 
+			author_password as pass
+			from mt_author 
+		",$mtlink);
+		
+		while($b = mysql_fetch_assoc($a)){
+			$authors[] = $b;
+		}
+		
+		$a = mysql_query("
+			select
+			mt_entry.entry_id as ID,			
+			mt_entry.entry_text as Body, 
+			mt_entry.entry_text_more as Body2, 
+			mt_entry.entry_title as Title, 
+			mt_entry.entry_excerpt as Excerpt,
+			mt_entry.entry_keywords as Keywords,
+			mt_entry.entry_created_on as Posted, 
+			mt_entry.entry_modified_on as LastMod,			
+			mt_entry.entry_author_id as AuthorID 
+			from mt_entry 
+			where entry_blog_id = '$blog_id'
+		",$mtlink);
+	
+		$results[]= mysql_error();
+	
+		while($b = mysql_fetch_assoc($a)){						
+			$cat = mysql_query("select placement_category_id as category_id from mt_placement where placement_entry_id='{$b['ID']}'");
+			while ($cat_id = mysql_fetch_row($cat)){
+				$categories[] = $cat_id[0];
+			}
+			
+			if (!empty($categories[0])) $b['Category1'] = $categories[0];
+			if (!empty($categories[1])) $b['Category2'] = $categories[1];
+			
+			unset($categories);
+			
+			//Trap comments for each article
+		    $comments = array();
+		    
+		    $q = "
+				select
+				mt_comment.comment_id as discussid,  
+				mt_comment.comment_ip as ip, 
+				mt_comment.comment_author as name, 
+				mt_comment.comment_email as email, 
+				mt_comment.comment_url as web, 
+				mt_comment.comment_text as message, 
+				mt_comment.comment_created_on as posted
+				from mt_comment where comment_blog_id = '$blog_id' AND comment_entry_id='{$b['ID']}'
+			";
+		    
+		    $c = mysql_query($q, $mtlink);
+		    
+		    while($d=mysql_fetch_assoc($c)){
+				$comments[] = $d;
+			}
+			//Attach comments to article
+			$b['comments'] = $comments;
+			unset($comments);
+
+			//Article finished
+			$articles[] = $b;
+		}		
+	
+
+		$a = mysql_query("
+			select category_id,category_label from mt_category where category_blog_id='{$blog_id}' 
+		",$mtlink);
+	
+		while($b=mysql_fetch_assoc($a)){
+			$categories_map[$b['category_id']] = $b['category_label'];
+		}		
+	
+		mysql_close($mtlink);
+	
+		//Yes, we have to make a new connection
+		//otherwise doArray complains
+		$DB = new DB; 
+
+		include txpath.'/lib/classTextile.php';
+		
+		$textile = new Textile;
+	
+		if (!empty($authors)) {
+			foreach($authors as $author) {
+				extract($author);
+				$name = (empty($name)) ? $RealName : $name;
+				
+				$authors_map[$user_id] = $name;
+				
+				$authorid = safe_field('user_id', 'txp_users', "name = '".doSlash($name)."'");
+				if (!$authorid){
+					//Add new authors		
+					$q = safe_insert("txp_users","
+						name     = '".doSlash($RealName)."',
+						email    = '".doSlash($email)."',
+						pass     = '".doSlash($pass)."',
+						RealName = '".doSlash($RealName)."',
+						privs='1'"
+					);
+			
+					if($q) {
+						$results[]= 'inserted '.$RealName.' into txp_users';
+					} else $results[]=mysql_error();
+				}
+			}
+		}
+
+		if (!empty($categories_map)) {
+
+			foreach ($categories_map as $category) {
+				$category = doSlash($category);
+				$rs = safe_row('id', 'txp_category', "name='$category' and type='article'");
+				if (!$rs){
+					$q = safe_insert("txp_category","name='$category',type='article',parent='root'");					
+
+					if($q) {
+						$results[]= 'inserted '.stripslashes($category).' into txp_category';
+					} else $results[]=mysql_error();
+				}
+						
+			}
+		}
+	
+		if (!empty($articles)) {
+			foreach ($articles as $article) {
+				extract($article);
+				$Body .= (trim($Body2)) ? "\n\n".$Body2 : '';
+			
+				$Body_html = $textile->textileThis($Body);
+				$Excerpt_html = $textile->textileThis($Excerpt);
+				$Title = $textile->textileThis($Title,1);
+
+				$Category1 = (!empty($Category1)) ? doSlash($Category1) : '';
+				
+				$AuthorID = (!empty($authors_map[$AuthorID])) ? doSlash($authors_map[$AuthorID]) : '';
+				
+				$insertID = safe_insert("textpattern","
+					ID        	   = '$ID',
+					Posted         = '$Posted',
+					LastMod        = '$LastMod',
+					Title          = '".doSlash($Title)."',
+					Body           = '".doSlash($Body)."',
+					Excerpt		   = '".doSlash($Excerpt)."',
+					Excerpt_html   = '".doSlash($Excerpt_html)."',
+					Keywords	   = '".doSlash($Keywords)."',
+					Body_html      = '".doSlash($Body_html)."',
+					AuthorID       = '$AuthorID',
+					Category1      = '$Category1',
+					AnnotateInvite = '".doSlash($default_comment_invite)."',
+					Section        = '".doSlash($insert_into_section)."',
+					uid            = '".md5(uniqid(rand(),true))."',
+					feed_time      = '".substr($Posted,0,10)."',
+					Status         = '$insert_with_status'
+				");
+		
+				if($insertID) {
+					$results[] = 'inserted MT entry '.strong($Title).
+						' into Textpattern as article '.strong($insertID).'';
+					
+					//Do coment for article
+					if (!empty($comments) && is_array($comments)) {
+						foreach ($comments as $comment) {
+							extract($comment);
+							$message = nl2br($message);
+					
+							$commentID = safe_insert("txp_discuss","
+								discussid = $discussid,
+								parentid  = $insertID,
+								name      = '".doSlash($name)."',
+								email     = '".doSlash($email)."',
+								web       = '".doSlash($web)."',
+								message   = '".doSlash($message)."',
+								ip        = '$ip',
+								posted    = '$posted',
+								visible   = 1"
+							);
+					
+							if($commentID) {
+								$results[] = 'inserted MT comment '.$commentID.
+									' for article '.$insertID.' into txp_discuss';
+							} else $results[]=mysql_error();
+						}
+					}
+				} else $results[] = mysql_error();
+			}
+		}		
+		return join('<br />', $results);
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/import/import_wp.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/import/import_wp.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/import/import_wp.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,208 @@
+<?php
+
+	function doImportWP($b2dblogin, $b2db, $b2dbpass, $b2dbhost, $wpdbprefix, $insert_into_section, $insert_with_status, $default_comment_invite)
+	{
+		global $txpcfg;
+		//Keep some response on some part
+		$results = array();	
+		
+		// let's go - Dean says ;-).		
+		$b2link = mysql_connect($b2dbhost,$b2dblogin,$b2dbpass,true);
+		if(!$b2link){ 
+			return 'wp database values don&#8217;t work. Go back, replace them and try again';
+		}				
+		mysql_select_db($b2db,$b2link);
+		$results[]= 'connected to wp database. Importing Data';
+		
+		    $a = mysql_query("
+		        select
+		        ".$wpdbprefix."posts.ID as ID,
+		        ".$wpdbprefix."posts.post_date as Posted,
+		        ".$wpdbprefix."posts.post_title as Title,
+		        ".$wpdbprefix."posts.post_content as Body,
+		        ".$wpdbprefix."users.user_login as AuthorID
+		        from ".$wpdbprefix."posts
+		        left join ".$wpdbprefix."users on
+		            ".$wpdbprefix."users.ID = ".$wpdbprefix."posts.post_author
+		    ",$b2link) or $results[]= mysql_error();
+		    
+		    
+		    while($b=mysql_fetch_array($a)) {
+		    	//Clean ugly wp slashes before to continue
+		    	$b = undoSlash(undoSlash($b));
+		    	
+		    	//Trap comments for each article
+		    	$comments = array();
+				$q= "
+			        select
+			        ".$wpdbprefix."comments.comment_author_IP as ip,
+			        ".$wpdbprefix."comments.comment_author as name,
+			        ".$wpdbprefix."comments.comment_author_email as email,
+			        ".$wpdbprefix."comments.comment_author_url as web,
+			        ".$wpdbprefix."comments.comment_content as message,
+			        ".$wpdbprefix."comments.comment_date as posted
+			        from ".$wpdbprefix."comments where comment_post_ID='".$b['ID']."'
+			    ";				
+				$c = mysql_query($q,$b2link) or $results[]= mysql_error();
+							
+			    while($d=mysql_fetch_assoc($c)){
+			        $d = undoSlash(undoSlash($d));
+			    	$comments[] = $d;
+			    }
+			    $b['comments'] = $comments;
+			    unset($comments);
+			    //Post categories now
+			    $q = "
+			      select
+			        ".$wpdbprefix."post2cat.category_id as catid,
+			        ".$wpdbprefix."categories.cat_name as catname,
+					".$wpdbprefix."categories.category_nicename as catnicename
+			        from ".$wpdbprefix."post2cat
+			        left join ".$wpdbprefix."categories on
+			          ".$wpdbprefix."categories.cat_ID = ".$wpdbprefix."post2cat.category_id where ".$wpdbprefix."post2cat.post_id='".$b['ID']."' limit 2        
+			        ";
+			    			    
+			    $e = mysql_query($q ,$b2link) or $results[]= mysql_error();			    
+			    
+			    while($f=mysql_fetch_array($e)) {
+			      $categories[] = $f;
+			    }
+			    
+			    $b['Category1'] = (!empty($categories[0]))?$categories[0]['catnicename']:'';
+			    $b['Category2'] = (!empty($categories[1]))?$categories[1]['catnicename']:'';			    
+			    
+			    unset($categories);
+			    
+			    $articles[] = $b;
+		    }
+		    
+		    $a = mysql_query("
+		      select
+		        ".$wpdbprefix."categories.cat_ID as catid,
+		        ".$wpdbprefix."categories.cat_name as catname,
+		        ".$wpdbprefix."categories.category_nicename as catnicename,
+		        ".$wpdbprefix."categories.category_parent as catparent
+		        from ".$wpdbprefix."categories
+		        ",$b2link) or $results[]= mysql_error();
+		    
+		    while($b=mysql_fetch_array($a)) {
+		      $cats[] = $b;
+		    }
+	
+		mysql_close($b2link);
+		
+				
+		//keep a handy copy of txpdb values, and do not alter Dean code
+		// for now! ;-)
+
+		$txpdb      = $txpcfg['db'];
+		$txpdblogin = $txpcfg['user'];
+		$txpdbpass  = $txpcfg['pass'];
+		$txpdbhost  = $txpcfg['host'];		
+	
+		//Yes, we have to make a new connection
+		//otherwise doArray complains
+		$DB = new DB; 
+		$txplink = &$DB->link;
+
+		mysql_select_db($txpdb,$txplink);
+	
+		include txpath.'/lib/classTextile.php';
+		
+		$textile = new Textile;
+	
+		   if (!empty($articles)) {
+			        foreach($articles as $a){
+			        	//Ugly, really ugly way to workaround the slashes WP gotcha
+			        	$a['Body'] = str_replace('<!--more-->','',$a['Body']);
+			            $a['Body_html'] = $textile->textileThis($a['Body']);
+			            extract($a);
+			            //can not use array slash due to way on which comments are selected
+			            $q = mysql_query("
+			                insert into `".PFX."textpattern` set
+			                Posted    = '".addslashes($Posted)."',
+			                Title     = '".addslashes($textile->TextileThis($Title,1))."',
+			                url_title = '".stripSpace($Title,1)."',
+			                Body      = '".addslashes($Body)."',
+			                Body_html = '".addslashes($Body_html)."',
+			                AuthorID  = '".addslashes($AuthorID)."',
+			                Category1 = '".addslashes($Category1)."',
+			                Category2 = '".addslashes($Category2)."',
+			                Section   = '$insert_into_section',
+			                uid='".md5(uniqid(rand(),true))."',
+							feed_time='".substr($Posted,0,10)."',
+			                AnnotateInvite = '$default_comment_invite',
+			                Status    = '$insert_with_status'
+			            ",$txplink) or $results[]= mysql_error();
+			    
+			            if ($insertID = mysql_insert_id() ) {    
+			                $results[]= 'inserted wp_ entry '.$Title.
+			                    ' into Textpattern as article '.$insertID.'';
+			                    
+			                if (!empty($comments)) {
+						        foreach ($comments as $comment) {
+							            extract(array_slash($comment));
+							            //The ugly workaroud again
+							            $message = nl2br($message);
+							    
+							            $r = mysql_query("insert into `".PFX."txp_discuss` set					
+							                parentid = '$insertID',
+							                name = '$name',
+							                email = '$email',
+							                web = '$web',
+							                ip = '$ip',
+							                posted = '$posted',
+							                message = '$message',
+							                visible = 1",$txplink) or $results[]= mysql_error();
+							    
+							            if($commentID = mysql_insert_id()) {
+							                $results[]='inserted wp_ comment <strong>'.$commentID
+							                    .'</strong> into txp_discuss';
+							            }
+						        }
+						    }
+			            }
+			            
+			            
+			        }
+			    }
+			
+			    
+			    
+			    if (!empty($cats)) {
+			    $right = 2;
+			    $left = 1;
+			        foreach ($cats as $cat) {
+			            extract(array_slash($cat));
+			            //Prevent repeated categories
+			            $rs = safe_row('id', 'txp_category', "name='$catnicename'");			            			            
+			            if (!$rs){
+			            	$left++;
+			            	$right++;
+				            $q = mysql_query("
+				            insert into `".PFX."txp_category` set
+				             name = '$catnicename',
+					         title = '$catname',
+				             type = 'article',
+				             parent = 'root',
+				             lft = '$left',
+				             rgt = '$right'",
+				            $txplink) or $results[]= mysql_error($q);
+				    
+				            if(mysql_insert_id()) {
+				                $results[]= 'inserted wp_ category <strong>'.$catname
+				                    .'</strong> into txp_category';
+				            }
+			            }
+			        }
+			    }			    			    
+		
+		return join('<br />', $results);
+	}
+
+	
+	function undoSlash($in)
+	{ 
+			return doArray($in,'stripslashes');		
+	}
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_admin.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_admin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_admin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,570 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_admin.php $
+$LastChangedRevision: 1879 $
+
+*/
+
+	if (!defined('txpinterface'))
+	{
+		die('txpinterface is undefined.');
+	}
+
+	$levels = array(
+		1 => gTxt('publisher'),
+		2 => gTxt('managing_editor'),
+		3 => gTxt('copy_editor'),
+		4 => gTxt('staff_writer'),
+		5 => gTxt('freelancer'),
+		6 => gTxt('designer'),
+		0 => gTxt('none')
+	);
+
+	if ($event == 'admin')
+	{
+		require_privs('admin');
+
+		$available_steps = array(
+			'admin',
+			'author_change_pass',
+			'author_delete',
+			'author_list',
+			'author_save',
+			'author_save_new',
+			'change_email',
+			'change_pass'
+		);
+
+		if (!$step or !in_array($step, $available_steps))
+		{
+			admin();
+		}
+
+		else
+		{
+			$step();
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function admin($message = '')
+	{
+		global $txp_user;
+
+		pagetop(gTxt('site_administration'), $message);
+
+		if (!is_callable('mail'))
+		{
+			echo tag(gTxt('warn_mail_unavailable'), 'p',' id="warning" ');
+		}
+
+		$email = fetch('email', 'txp_users', 'name', $txp_user);
+
+		echo new_pass_form().
+			change_email_form($email);
+
+		if (has_privs('admin.list'))
+		{
+			echo author_list();
+		}
+
+		if (has_privs('admin.edit'))
+		{
+			echo new_author_form().
+				reset_author_pass_form();
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function change_email()
+	{
+		global $txp_user;
+
+		require_privs('admin.edit');
+
+		$new_email = gps('new_email');
+
+		if (!is_valid_email($new_email))
+		{
+			admin(gTxt('email_required'));
+			return;
+		}
+
+		$rs = safe_update('txp_users', "email = '".doSlash($new_email)."'", "name = '".doSlash($txp_user)."'");
+
+		if ($rs)
+		{
+			admin(
+				gTxt('email_changed', array('{email}' => $new_email))
+			);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function author_save()
+	{
+		require_privs('admin.edit');
+
+		extract(doSlash(psa(array('privs', 'user_id', 'RealName', 'email'))));
+		$privs   = assert_int($privs);
+		$user_id = assert_int($user_id);
+
+		if (!is_valid_email($email))
+		{
+			admin(gTxt('email_required'));
+			return;
+		}
+
+		$rs = safe_update('txp_users', "
+			privs		 = $privs,
+			RealName = '$RealName',
+			email		 = '$email'",
+			"user_id = $user_id"
+		);
+
+		if ($rs)
+		{
+			admin(
+				gTxt('author_updated', array('{name}' => $RealName))
+			);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function change_pass()
+	{
+		global $txp_user;
+
+		extract(doSlash(psa(array('new_pass', 'mail_password'))));
+
+		if (empty($new_pass))
+		{
+			admin(gTxt('password_required'));
+			return;
+		}
+
+		$rs = safe_update('txp_users', "pass = password(lower('$new_pass'))", "name = '".doSlash($txp_user)."'");
+
+		if ($rs)
+		{
+			$message = gTxt('password_changed');
+
+			if ($mail_password)
+			{
+				$email = fetch('email', 'txp_users', 'name', $txp_user);
+
+				send_new_password($new_pass, $email, $txp_user);
+
+				$message .= sp.gTxt('and_mailed_to').sp.$email;
+			}
+
+			else
+			{
+				echo comment(mysql_error());
+			}
+
+			$message .= '.';
+
+			admin($message);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function author_save_new()
+	{
+		require_privs('admin.edit');
+
+		extract(doSlash(psa(array('privs', 'name', 'email', 'RealName'))));
+		$privs = assert_int($privs);
+
+		if ($name && is_valid_email($email))
+		{
+			$password = doSlash(generate_password(6));
+			$nonce = doSlash(md5(uniqid(rand(), true)));
+
+			$rs = safe_insert('txp_users', "
+				privs		 = $privs,
+				name		 = '$name',
+				email		 = '$email',
+				RealName = '$RealName',
+				pass		 =	password(lower('$password')),
+				nonce		 = '$nonce'
+			");
+
+			if ($rs)
+			{
+				send_password($RealName, $name, $email, $password);
+
+				admin(
+					gTxt('password_sent_to').sp.$email
+				);
+
+				return;
+			}
+		}
+
+		admin(gTxt('error_adding_new_author'));
+	}
+
+// -------------------------------------------------------------
+
+	function privs($priv = '')
+	{
+		global $levels;
+		return selectInput('privs', $levels, $priv);
+	}
+
+// -------------------------------------------------------------
+
+	function get_priv_level($priv)
+	{
+		global $levels;
+		return $levels[$priv];
+	}
+
+// -------------------------------------------------------------
+
+	function send_password($RealName, $name, $email, $password)
+	{
+		global $sitename;
+
+		require_privs('admin.edit');
+
+		$message = gTxt('greeting').' '.$RealName.','.
+
+			"\r\n"."\r\n".gTxt('you_have_been_registered').' '.$sitename.
+
+			"\r\n"."\r\n".gTxt('your_login_is').': '.$name.
+			"\r\n".gTxt('your_password_is').': '.$password.
+
+			"\r\n"."\r\n".gTxt('log_in_at').': '.hu.'textpattern/index.php';
+
+		return txpMail($email, "[$sitename] ".gTxt('your_login_info'), $message);
+	}
+
+// -------------------------------------------------------------
+
+	function send_new_password($password, $email, $name)
+	{
+		global $txp_user, $sitename;
+
+		if ( empty( $name)) $name = $txp_user;
+			
+		$message = gTxt('greeting').' '.$name.','.
+
+			"\r\n"."\r\n".gTxt('your_password_is').': '.$password.
+
+			"\r\n"."\r\n".gTxt('log_in_at').': '.hu.'textpattern/index.php';
+
+		return txpMail($email, "[$sitename] ".gTxt('your_new_password'), $message);
+	}
+
+// -------------------------------------------------------------
+
+	function generate_password($length = 10)
+	{
+		$pass = '';
+		$chars = '023456789bcdfghjkmnpqrstvwxyz';
+		$i = 0;
+
+		while ($i < $length)
+		{
+			$char = substr($chars, mt_rand(0, strlen($chars)-1), 1);
+
+			if (!strstr($pass, $char))
+			{
+				$pass .= $char;
+				$i++;
+			}
+		}
+
+		return $pass;
+	}
+
+// -------------------------------------------------------------
+
+	function new_pass_form()
+	{
+		return '<div style="margin-top: 3em auto auto auto; text-align: center;">'.
+		form(
+			tag(gTxt('change_password'), 'h3').
+
+			graf('<label for="new_pass">'.gTxt('new_password').'</label> '.
+				fInput('password', 'new_pass', '', 'edit', '', '', '20', '1', 'new_pass').
+				checkbox('mail_password', '1', true, '', 'mail_password').'<label for="mail_password">'.gTxt('mail_it').'</label> '.
+				fInput('submit', 'change_pass', gTxt('submit'), 'smallerbox').
+				eInput('admin').
+				sInput('change_pass')
+			,' style="text-align: center;"')
+		).'</div>';
+	}
+
+// -------------------------------------------------------------
+
+	function reset_author_pass_form()
+	{
+		global $txp_user;
+
+		$names = array();
+
+		$them = safe_rows_start('*', 'txp_users', "name != '".doSlash($txp_user)."'");
+
+		while ($a = nextRow($them))
+		{
+			extract($a);
+
+			$names[$name] = $RealName.' ('.$name.')';
+		}
+
+		if ($names)
+		{
+			return '<div style="margin: 3em auto auto auto; text-align: center;">'.
+			form(
+				tag(gTxt('reset_author_password'), 'h3').
+				graf(gTxt('a_new_password_will_be_mailed')).
+					graf(selectInput('name', $names, '', 1).
+					fInput('submit', 'author_change_pass', gTxt('submit'), 'smallerbox').
+					eInput('admin').
+					sInput('author_change_pass')
+				,' style="text-align: center;"')
+			).'</div>';
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function author_change_pass()
+	{
+		require_privs('admin.edit');
+
+		$name = ps('name');
+
+		$email = safe_field('email', 'txp_users', "name = '".doSlash($name)."'");
+		$new_pass = doSlash(generate_password(6));
+
+		$rs = safe_update('txp_users', "pass = password(lower('$new_pass'))", "name = '".doSlash($name)."'");
+
+		if ($rs)
+		{
+			if (send_new_password($new_pass, $email, $name))
+			{
+				admin(gTxt('password_sent_to').' '.$email);
+			}
+
+			else
+			{
+				admin(gTxt('could_not_mail').' '.$email);
+			}
+		}
+
+		else
+		{
+			admin(gTxt('could_not_update_author').' '.$name);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function change_email_form($email)
+	{
+		return '<div style="margin-top: 3em auto auto auto; text-align: center;">'.
+		form(
+			tag(gTxt('change_email_address'), 'h3').
+			graf('<label for="new_email">'.gTxt('new_email').'</label> '.
+				fInput('text', 'new_email', $email, 'edit', '', '', '20', '2', 'new_email').
+				fInput('submit', 'change_email', gTxt('submit'), 'smallerbox').
+				eInput('admin').
+				sInput('change_email')
+			,' style="text-align: center;"')
+		).'</div>';
+	}
+
+// -------------------------------------------------------------
+
+	function author_list()
+	{
+		global $txp_user;
+
+		echo n.n.hed(gTxt('authors'), 3,' style="text-align: center;"').
+
+			n.n.startTable('list').
+
+			n.tr(
+				n.hCell(gTxt('real_name')).
+				n.hCell(gTxt('login_name')).
+				n.hCell(gTxt('email')).
+				n.hCell(gTxt('privileges')).
+				n.hCell().
+				n.hCell()
+			);
+
+		$rs = safe_rows_start('*', 'txp_users', '1 = 1');
+
+		if ($rs)
+		{
+			if (has_privs('admin.edit'))
+			{
+				while ($a = nextRow($rs))
+				{
+					extract($a);
+
+					echo n.n.'<tr>'.
+
+						n.'<form method="post" action="index.php">'.
+
+						n.td(
+							fInput('text', 'RealName', $RealName, 'edit')
+						).
+
+						td($name).
+						td(
+							fInput('text', 'email', $email, 'edit')
+						);
+
+					if ($name != $txp_user)
+					{
+						echo td(
+							privs($privs).sp.popHelp('about_privileges')
+						);
+					}
+
+					else
+					{
+						echo td(
+							get_priv_level($privs).sp.popHelp('about_privileges').
+							hInput('privs', $privs)
+						);
+					}
+
+					echo td(
+						fInput('submit', 'save', gTxt('save'), 'smallerbox')
+					).
+
+					n.hInput('user_id', $user_id).
+					n.eInput('admin').
+					n.sInput('author_save').
+					n.'</form>';
+
+					if ($name != $txp_user)
+					{
+						echo td(
+							dLink('admin', 'author_delete', 'user_id', $user_id)
+						);
+					}
+
+					else
+					{
+						echo td();
+					}
+
+					echo n.'</tr>';
+				}
+			}
+
+			else
+			{
+				while ($a = nextRow($rs))
+				{
+					extract($a);
+
+					echo tr(
+						td($RealName).
+						td($name).
+						td('<a href="mailto:'.$email.'">'.$email.'</a>').
+						td(
+							get_priv_level($privs).sp.popHelp('about_privileges').
+							hInput('privs', $privs)
+						).
+						td().
+						td()
+					);
+				}
+			}
+
+			echo n.endTable();
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function author_delete()
+	{
+		require_privs('admin.edit');
+
+		$user_id = assert_int(ps('user_id'));
+
+		$name = fetch('Realname', 'txp_users', 'user_id', $user_id);
+
+		if ($name)
+		{
+			$rs = safe_delete('txp_users', "user_id = $user_id");
+
+			if ($rs)
+			{
+				admin(
+					gTxt('author_deleted', array('{name}' => $name))
+				);
+			}
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function new_author_form()
+	{
+		return form(
+			hed(gTxt('add_new_author'), 3,' style="margin-top: 2em; text-align: center;"').
+			graf(gTxt('a_message_will_be_sent_with_login'), ' style="text-align: center;"').
+
+			startTable('edit').
+			tr(
+				fLabelCell('real_name').
+				fInputCell('RealName')
+			).
+
+			tr(
+				fLabelCell('login_name').
+				fInputCell('name')
+			).
+
+			tr(
+				fLabelCell('email').
+				fInputCell('email')
+			).
+
+			tr(
+				fLabelCell('privileges').
+				td(
+					privs().sp.popHelp('about_privileges')
+				)
+			).
+
+			tr(
+				td().
+				td(
+					fInput('submit', '', gTxt('save'), 'publish').sp.popHelp('add_new_author')
+				)
+			).
+
+			endTable().
+
+			eInput('admin').
+			sInput('author_save_new')
+		);
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_article.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_article.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_article.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,983 @@
+<?php
+/*
+	This is Textpattern
+	Copyright 2005 by Dean Allen 
+ 	All rights reserved.
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_article.php $
+$LastChangedRevision: 1889 $
+
+*/
+
+if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+global $vars, $statuses;
+
+$vars = array(
+	'ID','Title','Title_html','Body','Body_html','Excerpt','textile_excerpt','Image',
+	'textile_body', 'Keywords','Status','Posted','Section','Category1','Category2',
+	'Annotate','AnnotateInvite','publish_now','reset_time','AuthorID','sPosted',
+	'LastModID','sLastMod','override_form','from_view','year','month','day','hour',
+	'minute','second','url_title','custom_1','custom_2','custom_3','custom_4','custom_5',
+	'custom_6','custom_7','custom_8','custom_9','custom_10'
+);
+
+$statuses = array(
+		1 => gTxt('draft'),
+		2 => gTxt('hidden'),
+		3 => gTxt('pending'),
+		4 => strong(gTxt('live')),
+		5 => gTxt('sticky'),
+);
+
+if (!empty($event) and $event == 'article') {
+	require_privs('article');
+
+
+	$save = gps('save');
+	if ($save) $step = 'save';
+
+	$publish = gps('publish');
+	if ($publish) $step = 'publish';
+
+		
+	switch(strtolower($step)) {
+		case "":         article_edit();    break;
+		case "create":   article_edit();    break;
+		case "publish":  article_post();    break;
+		case "edit":     article_edit();    break;
+		case "save":     article_save();    break;
+	}
+}
+
+//--------------------------------------------------------------
+
+	function article_post()
+	{
+		global $txp_user, $vars, $txpcfg, $prefs;		
+
+		extract($prefs);
+
+		$incoming = psa($vars);
+		$message='';
+
+		$incoming = textile_main_fields($incoming, $use_textile);
+
+		extract(doSlash($incoming));
+		extract(array_map('assert_int', psa(array( 'Status', 'textile_body', 'textile_excerpt'))));
+		$Annotate = ( ps( 'Annotate')) ? assert_int( ps( 'Annotate')) : 0;
+
+		if ($publish_now==1) {
+			$when = 'now()';
+		} else {
+			$when = strtotime($year.'-'.$month.'-'.$day.' '.$hour.':'.$minute.':'.$second)-tz_offset();
+			$when = "from_unixtime($when)";
+		}
+
+		if ($Title or $Body or $Excerpt) {
+			
+			if (!has_privs('article.publish') && $Status>=4) $Status = 3;
+			if (empty($url_title)) $url_title = stripSpace($Title_plain, 1);  	
+			if (!$Annotate) $Annotate = 0;
+
+			safe_insert(
+			   "textpattern",
+			   "Title           = '$Title',
+				Body            = '$Body',
+				Body_html       = '$Body_html',
+				Excerpt         = '$Excerpt',
+				Excerpt_html    = '$Excerpt_html',
+				Image           = '$Image',
+				Keywords        = '$Keywords',
+				Status          =  $Status,
+				Posted          =  $when,
+				LastMod         =  now(),
+				AuthorID        = '$txp_user',
+				Section         = '$Section',
+				Category1       = '$Category1',
+				Category2       = '$Category2',
+				textile_body    =  $textile_body,
+				textile_excerpt =  $textile_excerpt,
+				Annotate        =  $Annotate,
+				override_form   = '$override_form',
+				url_title       = '$url_title',
+				AnnotateInvite  = '$AnnotateInvite',
+				custom_1        = '$custom_1',
+				custom_2        = '$custom_2',
+				custom_3        = '$custom_3',
+				custom_4        = '$custom_4',
+				custom_5        = '$custom_5',
+				custom_6        = '$custom_6',
+				custom_7        = '$custom_7',
+				custom_8        = '$custom_8',
+				custom_9        = '$custom_9',
+				custom_10       = '$custom_10',
+				uid				= '".md5(uniqid(rand(),true))."',
+				feed_time		= now()"
+			);
+			
+			$GLOBALS['ID'] = mysql_insert_id();
+				
+			if ($Status>=4) {
+				
+				do_pings();
+				
+				update_lastmod();
+			}
+			article_edit(
+				get_status_message($Status).check_url_title($url_title)
+			);
+		} else article_edit();
+	}
+
+//--------------------------------------------------------------
+
+	function article_save()
+	{
+		global $txp_user, $vars, $txpcfg, $prefs;
+
+		extract($prefs);
+
+		$incoming = psa($vars);
+
+		$oldArticle = safe_row('Status, url_title, Title','textpattern','ID = '.(int)$incoming['ID']);
+
+		if (! (    ($oldArticle['Status'] >= 4 and has_privs('article.edit.published'))
+				or ($oldArticle['Status'] >= 4 and $incoming['AuthorID']==$txp_user and has_privs('article.edit.own.published'))
+		    	or ($oldArticle['Status'] < 4 and has_privs('article.edit'))
+				or ($oldArticle['Status'] < 4 and $incoming['AuthorID']==$txp_user and has_privs('article.edit.own'))))
+		{
+				// Not allowed, you silly rabbit, you shouldn't even be here. 
+				// Show default editing screen.
+			article_edit();
+			return;
+		}
+
+		$incoming = textile_main_fields($incoming, $use_textile);
+
+		extract(doSlash($incoming));
+		extract(array_map('assert_int', psa(array('ID', 'Status', 'textile_body', 'textile_excerpt'))));  
+		$Annotate = ( ps( 'Annotate')) ? assert_int( ps( 'Annotate')) : 0;
+
+		if (!has_privs('article.publish') && $Status>=4) $Status = 3;
+		
+		if($reset_time) {
+			$whenposted = "Posted=now()"; 
+		} else {
+			$when = strtotime($year.'-'.$month.'-'.$day.' '.$hour.':'.$minute.':'.$second)-tz_offset();
+			$when = "from_unixtime($when)";
+			$whenposted = "Posted=$when";
+		}
+
+		//Auto-Update custom-titles according to Title, as long as unpublished and NOT customized
+		if ( empty($url_title)
+			  || ( ($oldArticle['Status'] < 4) 
+					&& ($oldArticle['url_title'] == $url_title ) 
+					&& ($oldArticle['url_title'] == stripSpace($oldArticle['Title'],1))
+					&& ($oldArticle['Title'] != $Title)
+				 )
+		   )
+		{
+			$url_title = stripSpace($Title_plain, 1);
+		}
+		if (!$Annotate) $Annotate = 0;
+
+		safe_update("textpattern", 
+		   "Title           = '$Title',
+			Body            = '$Body',
+			Body_html       = '$Body_html',
+			Excerpt         = '$Excerpt',
+			Excerpt_html    = '$Excerpt_html',
+			Keywords        = '$Keywords',
+			Image           = '$Image',
+			Status          =  $Status,
+			LastMod         =  now(),
+			LastModID       = '$txp_user',
+			Section         = '$Section',
+			Category1       = '$Category1',
+			Category2       = '$Category2',
+			Annotate        =  $Annotate,
+			textile_body    =  $textile_body,
+			textile_excerpt =  $textile_excerpt,
+			override_form   = '$override_form',
+			url_title       = '$url_title',
+			AnnotateInvite  = '$AnnotateInvite',
+			custom_1        = '$custom_1',
+			custom_2        = '$custom_2',
+			custom_3        = '$custom_3',
+			custom_4        = '$custom_4',
+			custom_5        = '$custom_5',
+			custom_6        = '$custom_6',
+			custom_7        = '$custom_7',
+			custom_8        = '$custom_8',
+			custom_9        = '$custom_9',
+			custom_10       = '$custom_10',
+			$whenposted",
+			"ID = $ID"
+		);
+
+		if($Status >= 4) {
+			if ($oldArticle['Status'] < 4) {
+				do_pings();	
+			}
+			update_lastmod();
+		}
+		
+		article_edit(
+			get_status_message($Status).check_url_title($url_title)
+		);
+
+	}
+
+//--------------------------------------------------------------
+
+	function article_edit($message = '')
+	{
+		global $vars, $txp_user, $comments_disabled_after, $txpcfg, $prefs;
+
+		extract($prefs);
+
+		extract(gpsa(array('view','from_view','step')));
+		
+		if(!empty($GLOBALS['ID'])) { // newly-saved article
+			$ID = $GLOBALS['ID'];
+			$step = 'edit';
+		} else {  
+			$ID = gps('ID');
+		}
+		
+
+		include_once txpath.'/lib/classTextile.php';
+		$textile = new Textile();
+
+		if (!$view) $view = "text";
+		if (!$step) $step = "create";
+
+		if ($step == "edit" 
+			&& $view=="text" 
+			&& !empty($ID) 
+			&& $from_view != "preview" 
+			&& $from_view != 'html') {
+
+			$pull = true;          //-- it's an existing article - off we go to the db
+			$ID = assert_int($ID);
+
+			$rs = safe_row(
+				"*, unix_timestamp(Posted) as sPosted,
+				unix_timestamp(LastMod) as sLastMod",
+				"textpattern", 
+				"ID=$ID"
+			);
+
+			extract($rs);
+						
+			if ($AnnotateInvite!= $comments_default_invite) {
+				$AnnotateInvite = $AnnotateInvite;
+			} else {
+				$AnnotateInvite = $comments_default_invite;
+			}
+		} else {
+		
+			$pull = false;         //-- assume they came from post
+		
+			if (!$from_view or $from_view=='text') {
+				extract(gpsa($vars));
+			} elseif($from_view=='preview' or $from_view=='html') {
+					// coming from either html or preview
+				if (isset($_POST['store'])) {
+					$store = unserialize(base64_decode($_POST['store']));					
+					extract($store);
+				}
+			}
+			
+			foreach($vars as $var){
+				if(isset($$var)){
+					$store_out[$var] = $$var;		
+				}
+			}
+		}
+
+		$GLOBALS['step'] = $step;
+
+		if ($step == 'create')
+		{
+			$textile_body = $use_textile;
+			$textile_excerpt = $use_textile;
+		}
+
+		if ($step!='create') {
+
+			// Previous record?				
+			$prev_id = checkIfNeighbour('prev',$sPosted);
+			
+			// Next record?
+			$next_id = checkIfNeighbour('next',$sPosted);
+		}
+
+		$page_title = ($Title) ? $Title : gTxt('write');
+
+		pagetop($page_title, $message);
+
+		echo n.n.'<form name="article" method="post" action="index.php">';
+
+		if (!empty($store_out))
+		{
+			echo hInput('store', base64_encode(serialize($store_out)));
+		}
+
+		echo hInput('ID', $ID).
+			eInput('article').
+			sInput($step).
+			'<input type="hidden" name="view" />'.
+
+			startTable('edit').
+
+  		'<tr>'.n.
+				'<td id="article-col-1">';
+
+		if ($view == 'text')
+		{
+
+		//-- markup help --------------
+
+			echo side_help($textile_body, $textile_excerpt).
+
+			'<h3 class="plain"><a href="#advanced" onclick="toggleDisplay(\'advanced\'); return false;">'.gTxt('advanced_options').'</a></h3>',
+			'<div id="advanced">',
+
+			// markup selection
+				n.graf('<label for="markup-body">'.gTxt('article_markup').'</label>'.br.
+					pref_text('textile_body', $textile_body, 'markup-body')),
+
+				n.graf('<label for="markup-excerpt">'.gTxt('excerpt_markup').'</label>'.br.
+					pref_text('textile_excerpt', $textile_excerpt, 'markup-excerpt')),
+
+				// form override
+			($allow_form_override)
+			?	graf('<label for="override-form">'.gTxt('override_default_form').'</label>'.br.
+					form_pop($override_form, 'override-form').sp.popHelp('override_form'))
+			:	'',
+			
+				// custom fields, believe it or not
+			($custom_1_set)  ? custField(  1, $custom_1_set,  $custom_1 )    : '',
+			($custom_2_set)  ? custField(  2, $custom_2_set,  $custom_2 )    : '',
+			($custom_3_set)  ? custField(  3, $custom_3_set,  $custom_3 )    : '',
+			($custom_4_set)  ? custField(  4, $custom_4_set,  $custom_4 )    : '',
+			($custom_5_set)  ? custField(  5, $custom_5_set,  $custom_5 )    : '',
+			($custom_6_set)  ? custField(  6, $custom_6_set,  $custom_6 )    : '',
+			($custom_7_set)  ? custField(  7, $custom_7_set,  $custom_7 )    : '',
+			($custom_8_set)  ? custField(  8, $custom_8_set,  $custom_8 )    : '',
+			($custom_9_set)  ? custField(  9, $custom_9_set,  $custom_9 )    : '',
+			($custom_10_set) ? custField( 10, $custom_10_set, $custom_10 )   : '',
+
+			// keywords
+				n.graf('<label for="keywords">'.gTxt('keywords').'</label>'.sp.popHelp('keywords').br.
+					n.'<textarea id="keywords" name="Keywords" cols="18" rows="5">'.$Keywords.'</textarea>'),
+
+			// article image
+				n.graf('<label for="article-image">'.gTxt('article_image').'</label>'.sp.popHelp('article_image').br.
+					fInput('text', 'Image', $Image, 'edit', '', '', 22, '', 'article-image')),
+
+			// url title
+				n.graf('<label for="url-title">'.gTxt('url_title').'</label>'.sp.popHelp('url_title').br.
+					fInput('text', 'url_title', $url_title, 'edit', '', '', 22, '', 'url-title')),
+		
+			'</div>
+			
+			<h3 class="plain"><a href="#recent" onclick="toggleDisplay(\'recent\'); return false;">'.gTxt('recent_articles').'</a>'.'</h3>'.
+			'<div id="recent" style="display:none;">';
+			
+			$recents = safe_rows_start("Title, ID",'textpattern',"1=1 order by LastMod desc limit 10");
+			
+			if ($recents)
+			{
+				echo '<ul class="plain-list">';
+
+				while($recent = nextRow($recents))
+				{
+					if (!$recent['Title'])
+					{
+						$recent['Title'] = gTxt('untitled').sp.$recent['ID'];
+					}
+
+					echo n.t.'<li><a href="?event=article'.a.'step=edit'.a.'ID='.$recent['ID'].'">'.$recent['Title'].'</a></li>';
+				}
+
+				echo '</ul>';
+			}
+			
+			echo '</div>';
+		}
+
+		else
+		{
+			echo sp;
+		}
+
+  	echo '</td>'.n.'<td id="article-main">';
+
+	//-- title input -------------- 
+
+		if ($view == 'preview')
+		{
+			echo hed(gTxt('preview'), 2).graf($Title);
+		}
+
+		if ($view == 'html')
+		{
+			echo hed('XHTML',2).graf($Title);
+		}
+
+		if ($view == 'text')
+		{
+			echo '<p><input type="text" id="title" name="Title" value="'.cleanfInput($Title).'" class="edit" size="40" tabindex="1" />';
+
+			if ( ($Status == 4 or $Status == 5) and $step != 'create')
+			{
+				include_once txpath.'/publish/taghandlers.php';
+
+				echo sp.sp.'<a href="'.permlinkurl_id($ID).'">'.gTxt('view').'</a>';
+			}
+
+			echo '</p>';
+		}
+
+    if ($view == 'preview')
+    { 
+			if ($textile_body == USE_TEXTILE)
+			{
+				echo $textile->TextileThis($Body);
+			}
+
+			else if ($textile_body == CONVERT_LINEBREAKS)
+			{
+				echo nl2br($Body);
+			}
+
+			else if ($textile_body == LEAVE_TEXT_UNTOUCHED)
+			{
+				echo $Body;
+			}
+    }
+
+    elseif ($view == 'html')
+    {
+			if ($textile_body == USE_TEXTILE)
+			{
+				$bod = $textile->TextileThis($Body);
+			}
+
+			else if ($textile_body == CONVERT_LINEBREAKS)
+			{
+				$bod = nl2br($Body);
+			}
+
+			else if ($textile_body == LEAVE_TEXT_UNTOUCHED)
+			{
+				$bod = $Body;
+			}
+
+			echo tag(str_replace(array(n,t), array(br,sp.sp.sp.sp), htmlspecialchars($bod)), 'code');
+		}
+
+		else
+		{
+			echo n.graf('<textarea id="body" name="Body" cols="55" rows="31" tabindex="2">'.htmlspecialchars($Body).'</textarea>');
+		}
+
+	//-- excerpt --------------------
+
+		if ($articles_use_excerpts)
+		{
+			if ($view == 'text')
+			{
+				$Excerpt = str_replace('&amp;', '&', htmlspecialchars($Excerpt));
+
+				echo n.graf('<label for="excerpt">'.gTxt('excerpt').'</label>'.sp.popHelp('excerpt').br.
+					'<textarea id="excerpt" name="Excerpt" cols="55" rows="5" tabindex="3">'.$Excerpt.'</textarea>');
+			}
+
+			else
+			{
+				echo n.'<hr width="50%" />';
+
+				echo ($textile_excerpt == USE_TEXTILE)
+				?	($view=='preview')
+					?	graf($textile->textileThis($Excerpt))
+					:	tag(str_replace(array(n,t),
+							array(br,sp.sp.sp.sp),htmlspecialchars(
+								$textile->TextileThis($Excerpt))),'code')
+				:	graf($Excerpt);
+			}
+		}
+
+
+	//-- author --------------
+	
+		if ($view=="text" && $step != "create") {
+			echo '<p class="small">'.gTxt('posted_by').": $AuthorID &#183; ".safe_strftime('%d %b %Y &#183; %I:%M:%S %p',$sPosted);
+			if($sPosted != $sLastMod) {
+				echo br.gTxt('modified_by').": $LastModID &#183; ".safe_strftime('%d %b %Y &#183; %I:%M:%S %p',$sLastMod);
+			}
+				echo '</p>';
+			}
+
+	echo hInput('from_view',$view),
+	'</td>';
+	echo '<td id="article-tabs">';
+
+  	//-- layer tabs -------------------
+
+		echo ($use_textile == USE_TEXTILE || $textile_body == USE_TEXTILE)
+		?	graf(tab('text',$view).br.tab('html',$view).br.tab('preview',$view))
+		:	'&#160;';
+	echo '</td>';
+?>	
+<td id="article-col-2">
+<?php 
+
+		if ($view == 'text')
+		{
+			if ($step != 'create')
+			{
+				echo n.graf(href(gtxt('create_new'), 'index.php?event=article'));
+			}
+
+		//-- prev/next article links -- 
+
+			if ($step!='create' and ($prev_id or $next_id)) {
+				echo '<p>',
+				($prev_id)
+				?	prevnext_link('&#8249;'.gTxt('prev'),'article','edit',
+						$prev_id,gTxt('prev'))
+				:	'',
+				($next_id)
+				?	prevnext_link(gTxt('next').'&#8250;','article','edit',
+						$next_id,gTxt('next'))
+				:	'',
+				'</p>';
+			}
+
+		//-- status radios --------------
+
+			echo n.n.'<fieldset id="write-status">'.
+				n.'<legend>'.gTxt('status').'</legend>'.
+				n.status_radio($Status).
+				n.'</fieldset>';
+
+		//-- category selects -----------
+
+			echo n.n.'<fieldset id="write-sort">'.
+				n.'<legend>'.gTxt('sort_display').'</legend>'.
+
+				n.graf('<label for="category-1">'.gTxt('category1').'</label> '.
+					'<span class="small">['.eLink('category', '', '', '', gTxt('edit')).']</span>'.br.
+					n.category_popup('Category1', $Category1, 'category-1')).
+
+				n.graf('<label for="category-2">'.gTxt('category2').'</label>'.br.
+					n.category_popup('Category2', $Category2, 'category-2'));
+
+		//-- section select --------------
+
+			if(!$from_view && !$pull) $Section = getDefaultSection();
+
+			echo n.graf('<label for="section">'.gTxt('section').'</label> '.
+				'<span class="small">['.eLink('section', '', '', '', gTxt('edit')).']</span>'.br.
+				section_popup($Section, 'section')).
+
+				n.'</fieldset>'.
+
+		//-- "More" section
+				n.n.'<h3 class="plain"><a href="#more" onclick="toggleDisplay(\'more\'); return false;">'.gTxt('more').'</a></h3>',
+			'<div id="more" style="display: none;">';
+
+		//-- comments stuff --------------
+
+			if($step=="create") {
+				//Avoiding invite disappear when previewing
+				$AnnotateInvite = (!empty($store_out['AnnotateInvite']))? $store_out['AnnotateInvite'] : $comments_default_invite;
+				if ($comments_on_default==1) { $Annotate = 1; }
+			}
+
+			if ($use_comments == 1)
+			{
+				echo n.n.'<fieldset id="write-comments">'.
+					n.'<legend>'.gTxt('comments').'</legend>';
+
+				$comments_expired = false;
+
+				if ($step != 'create' && $comments_disabled_after)
+				{
+					$lifespan = $comments_disabled_after * 86400;
+					$time_since = time() - $sPosted;
+
+					if ($time_since > $lifespan)
+					{
+						$comments_expired = true;
+					}
+				}
+
+				if ($comments_expired)
+				{
+					echo n.n.graf(gTxt('expired'));
+				}
+
+				else
+				{
+					echo n.n.graf(
+						onoffRadio('Annotate', $Annotate)
+					).
+
+					n.n.graf(
+						'<label for="comment-invite">'.gTxt('comment_invitation').'</label>'.br.
+						fInput('text', 'AnnotateInvite', $AnnotateInvite, 'edit', '', '', '', '', 'comment-invite')
+					);
+				}
+
+				echo n.n.'</fieldset>';
+			}
+
+			if ($step == "create" and empty($GLOBALS['ID']))
+			{
+		//-- timestamp ------------------- 
+
+				//Avoiding modified date to disappear
+				$persist_timestamp = (!empty($store_out['year']))? 
+					mktime($store_out['hour'],$store_out['minute'], $store_out['second'], $store_out['month'], $store_out['day'], $store_out['year'])
+					: time();
+
+				echo n.n.'<fieldset id="write-timestamp">'.
+					n.'<legend>'.gTxt('timestamp').'</legend>'.
+
+					n.graf(checkbox('publish_now', '1', ($Status < 4), '', 'publish_now').'<label for="publish_now">'.gTxt('set_to_now').'</label>').
+
+					n.graf(gTxt('or_publish_at').sp.popHelp('timestamp')).
+
+					n.graf(gtxt('date').sp.
+						tsi('year', 'Y', $persist_timestamp).' / '.
+						tsi('month', 'm', $persist_timestamp).' / '.
+						tsi('day', 'd', $persist_timestamp)
+					).
+
+					n.graf(gTxt('time').sp.
+						tsi('hour', 'H', $persist_timestamp).' : '.
+						tsi('minute', 'i', $persist_timestamp).' : '.
+						tsi('second', 's', $persist_timestamp)
+					).
+
+				n.'</fieldset>'.
+
+				// end "More" section
+				n.n.'</div>';
+
+		//-- publish button --------------
+
+				echo
+				(has_privs('article.publish')) ?
+				fInput('submit','publish',gTxt('publish'),"publish", '', '', '', 4) :
+				fInput('submit','publish',gTxt('save'),"publish", '', '', '', 4);
+			}
+
+			else
+			{
+
+			//-- timestamp ------------------- 
+
+				echo n.n.'<fieldset id="write-timestamp">'.
+					n.'<legend>'.gTxt('timestamp').'</legend>'.
+
+					n.graf(checkbox('reset_time', '1', ($Status < 4), '', 'reset_time').'<label for="reset_time">'.gTxt('reset_time').'</label>').
+
+					n.graf(gTxt('published_at').sp.popHelp('timestamp')).
+
+					n.graf(gtxt('date').sp.
+						tsi('year', 'Y', $sPosted).' / '.
+						tsi('month', 'm', $sPosted).' / '.
+						tsi('day', 'd', $sPosted)
+					).
+
+					n.graf(gTxt('time').sp.
+						tsi('hour', 'H', $sPosted).' : ' .
+						tsi('minute', 'i', $sPosted).' : '.
+						tsi('second', 's', $sPosted)
+					).
+
+					n.hInput('sPosted', $sPosted),
+					n.hInput('sLastMod', $sLastMod),
+					n.hInput('AuthorID', $AuthorID),
+					n.hInput('LastModID', $LastModID),
+
+				n.'</fieldset>'.
+
+				// end "More" section
+				n.n.'</div>';
+
+		//-- save button --------------
+
+				if (   ($Status >= 4 and has_privs('article.edit.published'))
+					or ($Status >= 4 and $AuthorID==$txp_user and has_privs('article.edit.own.published'))
+				    or ($Status <  4 and has_privs('article.edit'))
+					or ($Status <  4 and $AuthorID==$txp_user and has_privs('article.edit.own')))
+					echo fInput('submit','save',gTxt('save'),"publish", '', '', '', 4);
+			}
+		}
+
+    echo '</td></tr></table></form>';
+	
+	}
+
+// -------------------------------------------------------------
+
+	function custField($num, $field, $content)
+	{
+		return n.n.graf('<label for="custom-'.$num.'">'.$field.'</label>'.br.
+			n.fInput('text', 'custom_'.$num, $content, 'edit', '', '', 22, '', 'custom-'.$num));
+	}
+
+// -------------------------------------------------------------
+	function checkIfNeighbour($whichway,$sPosted)
+	{
+		$sPosted = assert_int($sPosted);
+		$dir = ($whichway == 'prev') ? '<' : '>'; 
+		$ord = ($whichway == 'prev') ? 'desc' : 'asc'; 
+
+		return safe_field("ID", "textpattern", 
+			"Posted $dir from_unixtime($sPosted) order by Posted $ord limit 1");
+	}
+
+//--------------------------------------------------------------
+	function tsi($name,$datevar,$time,$tab='')
+	{
+		$size = ($name=='year') ? 4 : 2;
+
+		return n.'<input type="text" name="'.$name.'" value="'.
+			date($datevar,$time+tz_offset())
+		.'" size="'.$size.'" maxlength="'.$size.'" class="edit" tabindex="'.$tab.'" title="'.gTxt('article_'.$name).'" />';
+	}
+
+//--------------------------------------------------------------
+// remember to show markup help for both body and excerpt 
+// if they are different
+
+	function side_help($textile_body, $textile_excerpt)
+	{
+		if ($textile_body == USE_TEXTILE or $textile_excerpt == USE_TEXTILE)
+		{
+			return n.hed(
+				'<a href="#textile_help" onclick="toggleDisplay(\'textile_help\'); return false;">'.gTxt('textile_help').'</a>'
+			, 3, ' class="plain"').
+
+				n.'<div id="textile_help" style="display: none;">'.
+
+				n.'<ul class="plain-list small">'.
+					n.t.'<li>'.gTxt('header').': <strong>h<em>n</em>.</strong>'.sp.
+						popHelpSubtle('header', 400, 400).'</li>'.
+					n.t.'<li>'.gTxt('blockquote').': <strong>bq.</strong>'.sp.
+						popHelpSubtle('blockquote',400,400).'</li>'.
+					n.t.'<li>'.gTxt('numeric_list').': <strong>#</strong>'.sp.
+						popHelpSubtle('numeric', 400, 400).'</li>'.
+					n.t.'<li>'.gTxt('bulleted_list').': <strong>*</strong>'.sp.
+						popHelpSubtle('bulleted', 400, 400).'</li>'.
+				n.'</ul>'.
+
+				n.'<ul class="plain-list small">'.
+					n.t.'<li>'.'_<em>'.gTxt('emphasis').'</em>_'.sp.
+						popHelpSubtle('italic', 400, 400).'</li>'.
+					n.t.'<li>'.'*<strong>'.gTxt('strong').'</strong>*'.sp.
+						popHelpSubtle('bold', 400, 400).'</li>'.
+					n.t.'<li>'.'??<cite>'.gTxt('citation').'</cite>??'.sp.
+						popHelpSubtle('cite', 500, 300).'</li>'.
+					n.t.'<li>'.'-'.gTxt('deleted_text').'-'.sp.
+						popHelpSubtle('delete', 400, 300).'</li>'.
+					n.t.'<li>'.'+'.gTxt('inserted_text').'+'.sp.
+						popHelpSubtle('insert', 400, 300).'</li>'.
+					n.t.'<li>'.'^'.gTxt('superscript').'^'.sp.
+						popHelpSubtle('super', 400, 300).'</li>'.
+					n.t.'<li>'.'~'.gTxt('subscript').'~'.sp.
+						popHelpSubtle('subscript', 400, 400).'</li>'.
+				n.'</ul>'.
+
+				n.graf(
+					'"'.gTxt('linktext').'":url'.sp.popHelpSubtle('link', 400, 500)
+				, ' class="small"').
+
+				n.graf(
+					'!'.gTxt('imageurl').'!'.sp.popHelpSubtle('image', 500, 500)
+				, ' class="small"').
+
+				n.graf(
+					'<a href="http://textile.thresholdstate.com/" target="_blank">'.gTxt('More').'</a>').
+
+				n.'</div>';
+		}
+	}
+
+//--------------------------------------------------------------
+
+	function status_radio($Status)
+	{
+		global $statuses;
+
+		$Status = (!$Status) ? 4 : $Status;
+
+		foreach ($statuses as $a => $b)
+		{
+			$out[] = n.t.'<li>'.radio('Status', $a, ($Status == $a) ? 1 : 0, 'status-'.$a).
+				'<label for="status-'.$a.'">'.$b.'</label></li>';
+		}
+
+		return '<ul class="plain-list">'.join('', $out).n.'</ul>';
+	}
+
+//--------------------------------------------------------------
+
+	function category_popup($name, $val, $id)
+	{
+		$rs = getTree('root', 'article');
+
+		if ($rs)
+		{
+			return treeSelectInput($name,$rs,$val, $id);
+		}
+
+		return false;
+	}
+
+//--------------------------------------------------------------
+
+	function section_popup($Section, $id)
+	{
+		$rs = safe_column('name', 'txp_section', "name != 'default'");
+
+		if ($rs)
+		{
+			return selectInput('Section', $rs, $Section, false, '', $id);
+		}
+
+		return false;
+	}
+
+//--------------------------------------------------------------
+	function tab($tabevent,$view) 
+	{
+		$state = ($view==$tabevent) ? 'up' : 'down';
+		$img = 'txp_img/'.$tabevent.$state.'.gif';
+		$out = '<img src="'.$img.'"';
+		$out.=($tabevent!=$view) ? ' onclick="document.article.view.value=\''.$tabevent.'\'; document.article.submit(); return false;"' : "";
+		$out.= ' height="100" width="19" alt="" />';
+      	return $out;
+	}
+
+//--------------------------------------------------------------
+	function getDefaultSection() 
+	{
+		return safe_field("name", "txp_section","is_default=1");
+	}
+
+// -------------------------------------------------------------
+
+	function form_pop($form, $id)
+	{
+		$arr = array(' ');
+
+		$rs = safe_column('name', 'txp_form', "type = 'article' and name != 'default' order by name");
+
+		if ($rs)
+		{
+			return selectInput('override_form', $rs, $form, true, '', $id);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function check_url_title($url_title)
+	{
+		// Check for blank or previously used identical url-titles
+		if (strlen($url_title) === 0)
+		{
+			return gTxt('url_title_is_blank');
+		}
+
+		else
+		{
+			$url_title_count = safe_count('textpattern', "url_title = '$url_title'");
+
+			if ($url_title_count > 1)
+			{
+				return gTxt('url_title_is_multiple', array('{count}' => $url_title_count));
+			}
+		}
+
+		return '';
+	}
+// -------------------------------------------------------------
+	function get_status_message($Status)
+	{
+		switch ($Status){
+			case 3: return gTxt("article_saved_pending");
+			case 2: return gTxt("article_saved_hidden");
+			case 1: return gTxt("article_saved_draft");
+			default: return gTxt('article_posted');
+		}
+	}
+// -------------------------------------------------------------
+	function textile_main_fields($incoming, $use_textile)
+	{
+		global $txpcfg;
+		
+		include_once txpath.'/lib/classTextile.php';
+		$textile = new Textile();
+		
+		$incoming['Title_plain'] = $incoming['Title'];
+		
+		if ($incoming['textile_body'] == LEAVE_TEXT_UNTOUCHED) {
+		
+			$incoming['Body_html'] = trim($incoming['Body']);
+			
+		}elseif ($incoming['textile_body'] == USE_TEXTILE){
+		
+			$incoming['Body_html'] = $textile->TextileThis($incoming['Body']);
+			$incoming['Title'] = $textile->TextileThis($incoming['Title'],'',1);
+			
+		}elseif ($incoming['textile_body'] == CONVERT_LINEBREAKS){
+			
+			$incoming['Body_html'] = nl2br(trim($incoming['Body']));
+		}
+
+		if ($incoming['textile_excerpt'] == LEAVE_TEXT_UNTOUCHED) {
+		
+			$incoming['Excerpt_html'] = trim($incoming['Excerpt']);
+			
+		}elseif ($incoming['textile_excerpt'] == USE_TEXTILE){
+		
+			$incoming['Excerpt_html'] = $textile->TextileThis($incoming['Excerpt']);
+			
+		}elseif ($incoming['textile_excerpt'] == CONVERT_LINEBREAKS){
+			
+			$incoming['Excerpt_html'] = nl2br(trim($incoming['Excerpt']));
+		}
+		
+		return $incoming;
+	}
+// -------------------------------------------------------------
+
+	function do_pings()
+	{
+		global $txpcfg, $prefs;
+
+		include_once txpath.'/lib/IXRClass.php';
+		
+		if ($prefs['ping_textpattern_com']) {
+			$tx_client = new IXR_Client('http://textpattern.com/xmlrpc/');
+			$tx_client->query('ping.Textpattern', $prefs['sitename'], hu);
+		}
+
+		if ($prefs['ping_weblogsdotcom']==1) {
+			$wl_client = new IXR_Client('http://rpc.pingomatic.com/');
+			$wl_client->query('weblogUpdates.ping', $prefs['sitename'], hu);
+		}
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_article.php.bak
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_article.php.bak	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_article.php.bak	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,983 @@
+<?php
+/*
+	This is Textpattern
+	Copyright 2005 by Dean Allen 
+ 	All rights reserved.
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_article.php $
+$LastChangedRevision: 1889 $
+
+*/
+
+if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+global $vars, $statuses;
+
+$vars = array(
+	'ID','Title','Title_html','Body','Body_html','Excerpt','textile_excerpt','Image',
+	'textile_body', 'Keywords','Status','Posted','Section','Category1','Category2',
+	'Annotate','AnnotateInvite','publish_now','reset_time','AuthorID','sPosted',
+	'LastModID','sLastMod','override_form','from_view','year','month','day','hour',
+	'minute','second','url_title','custom_1','custom_2','custom_3','custom_4','custom_5',
+	'custom_6','custom_7','custom_8','custom_9','custom_10'
+);
+
+$statuses = array(
+		1 => gTxt('draft'),
+		2 => gTxt('hidden'),
+		3 => gTxt('pending'),
+		4 => strong(gTxt('live')),
+		5 => gTxt('sticky'),
+);
+
+if (!empty($event) and $event == 'article') {
+	require_privs('article');
+
+
+	$save = gps('save');
+	if ($save) $step = 'save';
+
+	$publish = gps('publish');
+	if ($publish) $step = 'publish';
+
+		
+	switch(strtolower($step)) {
+		case "":         article_edit();    break;
+		case "create":   article_edit();    break;
+		case "publish":  article_post();    break;
+		case "edit":     article_edit();    break;
+		case "save":     article_save();    break;
+	}
+}
+
+//--------------------------------------------------------------
+
+	function article_post()
+	{
+		global $txp_user, $vars, $txpcfg, $prefs;		
+
+		extract($prefs);
+
+		$incoming = psa($vars);
+		$message='';
+
+		$incoming = textile_main_fields($incoming, $use_textile);
+
+		extract(doSlash($incoming));
+		extract(array_map('assert_int', psa(array( 'Status', 'textile_body', 'textile_excerpt'))));
+		$Annotate = ( ps( 'Annotate')) ? assert_int( ps( 'Annotate')) : 0;
+
+		if ($publish_now==1) {
+			$when = 'now()';
+		} else {
+			$when = strtotime($year.'-'.$month.'-'.$day.' '.$hour.':'.$minute.':'.$second)-tz_offset();
+			$when = "from_unixtime($when)";
+		}
+
+		if ($Title or $Body or $Excerpt) {
+			
+			if (!has_privs('article.publish') && $Status>=4) $Status = 3;
+			if (empty($url_title)) $url_title = stripSpace($Title_plain, 1);  	
+			if (!$Annotate) $Annotate = 0;
+
+			safe_insert(
+			   "textpattern",
+			   "Title           = '$Title',
+				Body            = '$Body',
+				Body_html       = '$Body_html',
+				Excerpt         = '$Excerpt',
+				Excerpt_html    = '$Excerpt_html',
+				Image           = '$Image',
+				Keywords        = '$Keywords',
+				Status          =  $Status,
+				Posted          =  $when,
+				LastMod         =  now(),
+				AuthorID        = '$txp_user',
+				Section         = '$Section',
+				Category1       = '$Category1',
+				Category2       = '$Category2',
+				textile_body    =  $textile_body,
+				textile_excerpt =  $textile_excerpt,
+				Annotate        =  $Annotate,
+				override_form   = '$override_form',
+				url_title       = '$url_title',
+				AnnotateInvite  = '$AnnotateInvite',
+				custom_1        = '$custom_1',
+				custom_2        = '$custom_2',
+				custom_3        = '$custom_3',
+				custom_4        = '$custom_4',
+				custom_5        = '$custom_5',
+				custom_6        = '$custom_6',
+				custom_7        = '$custom_7',
+				custom_8        = '$custom_8',
+				custom_9        = '$custom_9',
+				custom_10       = '$custom_10',
+				uid				= '".md5(uniqid(rand(),true))."',
+				feed_time		= now()"
+			);
+			
+			$GLOBALS['ID'] = mysql_insert_id();
+				
+			if ($Status>=4) {
+				
+				do_pings();
+				
+				update_lastmod();
+			}
+			article_edit(
+				get_status_message($Status).check_url_title($url_title)
+			);
+		} else article_edit();
+	}
+
+//--------------------------------------------------------------
+
+	function article_save()
+	{
+		global $txp_user, $vars, $txpcfg, $prefs;
+
+		extract($prefs);
+
+		$incoming = psa($vars);
+
+		$oldArticle = safe_row('Status, url_title, Title','textpattern','ID = '.(int)$incoming['ID']);
+
+		if (! (    ($oldArticle['Status'] >= 4 and has_privs('article.edit.published'))
+				or ($oldArticle['Status'] >= 4 and $incoming['AuthorID']==$txp_user and has_privs('article.edit.own.published'))
+		    	or ($oldArticle['Status'] < 4 and has_privs('article.edit'))
+				or ($oldArticle['Status'] < 4 and $incoming['AuthorID']==$txp_user and has_privs('article.edit.own'))))
+		{
+				// Not allowed, you silly rabbit, you shouldn't even be here. 
+				// Show default editing screen.
+			article_edit();
+			return;
+		}
+
+		$incoming = textile_main_fields($incoming, $use_textile);
+
+		extract(doSlash($incoming));
+		extract(array_map('assert_int', psa(array('ID', 'Status', 'textile_body', 'textile_excerpt'))));  
+		$Annotate = ( ps( 'Annotate')) ? assert_int( ps( 'Annotate')) : 0;
+
+		if (!has_privs('article.publish') && $Status>=4) $Status = 3;
+		
+		if($reset_time) {
+			$whenposted = "Posted=now()"; 
+		} else {
+			$when = strtotime($year.'-'.$month.'-'.$day.' '.$hour.':'.$minute.':'.$second)-tz_offset();
+			$when = "from_unixtime($when)";
+			$whenposted = "Posted=$when";
+		}
+
+		//Auto-Update custom-titles according to Title, as long as unpublished and NOT customized
+		if ( empty($url_title)
+			  || ( ($oldArticle['Status'] < 4) 
+					&& ($oldArticle['url_title'] == $url_title ) 
+					&& ($oldArticle['url_title'] == stripSpace($oldArticle['Title'],1))
+					&& ($oldArticle['Title'] != $Title)
+				 )
+		   )
+		{
+			$url_title = stripSpace($Title_plain, 1);
+		}
+		if (!$Annotate) $Annotate = 0;
+
+		safe_update("textpattern", 
+		   "Title           = '$Title',
+			Body            = '$Body',
+			Body_html       = '$Body_html',
+			Excerpt         = '$Excerpt',
+			Excerpt_html    = '$Excerpt_html',
+			Keywords        = '$Keywords',
+			Image           = '$Image',
+			Status          =  $Status,
+			LastMod         =  now(),
+			LastModID       = '$txp_user',
+			Section         = '$Section',
+			Category1       = '$Category1',
+			Category2       = '$Category2',
+			Annotate        =  $Annotate,
+			textile_body    =  $textile_body,
+			textile_excerpt =  $textile_excerpt,
+			override_form   = '$override_form',
+			url_title       = '$url_title',
+			AnnotateInvite  = '$AnnotateInvite',
+			custom_1        = '$custom_1',
+			custom_2        = '$custom_2',
+			custom_3        = '$custom_3',
+			custom_4        = '$custom_4',
+			custom_5        = '$custom_5',
+			custom_6        = '$custom_6',
+			custom_7        = '$custom_7',
+			custom_8        = '$custom_8',
+			custom_9        = '$custom_9',
+			custom_10       = '$custom_10',
+			$whenposted",
+			"ID = $ID"
+		);
+
+		if($Status >= 4) {
+			if ($oldArticle['Status'] < 4) {
+				do_pings();	
+			}
+			update_lastmod();
+		}
+		
+		article_edit(
+			get_status_message($Status).check_url_title($url_title)
+		);
+
+	}
+
+//--------------------------------------------------------------
+
+	function article_edit($message = '')
+	{
+		global $vars, $txp_user, $comments_disabled_after, $txpcfg, $prefs;
+
+		extract($prefs);
+
+		extract(gpsa(array('view','from_view','step')));
+		
+		if(!empty($GLOBALS['ID'])) { // newly-saved article
+			$ID = $GLOBALS['ID'];
+			$step = 'edit';
+		} else {  
+			$ID = gps('ID');
+		}
+		
+
+		include_once txpath.'/lib/classTextile.php';
+		$textile = new Textile();
+
+		if (!$view) $view = "text";
+		if (!$step) $step = "create";
+
+		if ($step == "edit" 
+			&& $view=="text" 
+			&& !empty($ID) 
+			&& $from_view != "preview" 
+			&& $from_view != 'html') {
+
+			$pull = true;          //-- it's an existing article - off we go to the db
+			$ID = assert_int($ID);
+
+			$rs = safe_row(
+				"*, unix_timestamp(Posted) as sPosted,
+				unix_timestamp(LastMod) as sLastMod",
+				"textpattern", 
+				"ID=$ID"
+			);
+
+			extract($rs);
+						
+			if ($AnnotateInvite!= $comments_default_invite) {
+				$AnnotateInvite = $AnnotateInvite;
+			} else {
+				$AnnotateInvite = $comments_default_invite;
+			}
+		} else {
+		
+			$pull = false;         //-- assume they came from post
+		
+			if (!$from_view or $from_view=='text') {
+				extract(gpsa($vars));
+			} elseif($from_view=='preview' or $from_view=='html') {
+					// coming from either html or preview
+				if (isset($_POST['store'])) {
+					$store = unserialize(base64_decode($_POST['store']));					
+					extract($store);
+				}
+			}
+			
+			foreach($vars as $var){
+				if(isset($$var)){
+					$store_out[$var] = $$var;		
+				}
+			}
+		}
+
+		$GLOBALS['step'] = $step;
+
+		if ($step == 'create')
+		{
+			$textile_body = $use_textile;
+			$textile_excerpt = $use_textile;
+		}
+
+		if ($step!='create') {
+
+			// Previous record?				
+			$prev_id = checkIfNeighbour('prev',$sPosted);
+			
+			// Next record?
+			$next_id = checkIfNeighbour('next',$sPosted);
+		}
+
+		$page_title = ($Title) ? $Title : gTxt('write');
+
+		pagetop($page_title, $message);
+
+		echo n.n.'<form name="article" method="post" action="index.php">';
+
+		if (!empty($store_out))
+		{
+			echo hInput('store', base64_encode(serialize($store_out)));
+		}
+
+		echo hInput('ID', $ID).
+			eInput('article').
+			sInput($step).
+			'<input type="hidden" name="view" />'.
+
+			startTable('edit').
+
+  		'<tr>'.n.
+				'<td id="article-col-1">';
+
+		if ($view == 'text')
+		{
+
+		//-- markup help --------------
+
+			echo side_help($textile_body, $textile_excerpt).
+
+			'<h3 class="plain"><a href="#advanced" onclick="toggleDisplay(\'advanced\'); return false;">'.gTxt('advanced_options').'</a></h3>',
+			'<div id="advanced" style="display:none;">',
+
+			// markup selection
+				n.graf('<label for="markup-body">'.gTxt('article_markup').'</label>'.br.
+					pref_text('textile_body', $textile_body, 'markup-body')),
+
+				n.graf('<label for="markup-excerpt">'.gTxt('excerpt_markup').'</label>'.br.
+					pref_text('textile_excerpt', $textile_excerpt, 'markup-excerpt')),
+
+				// form override
+			($allow_form_override)
+			?	graf('<label for="override-form">'.gTxt('override_default_form').'</label>'.br.
+					form_pop($override_form, 'override-form').sp.popHelp('override_form'))
+			:	'',
+			
+				// custom fields, believe it or not
+			($custom_1_set)  ? custField(  1, $custom_1_set,  $custom_1 )    : '',
+			($custom_2_set)  ? custField(  2, $custom_2_set,  $custom_2 )    : '',
+			($custom_3_set)  ? custField(  3, $custom_3_set,  $custom_3 )    : '',
+			($custom_4_set)  ? custField(  4, $custom_4_set,  $custom_4 )    : '',
+			($custom_5_set)  ? custField(  5, $custom_5_set,  $custom_5 )    : '',
+			($custom_6_set)  ? custField(  6, $custom_6_set,  $custom_6 )    : '',
+			($custom_7_set)  ? custField(  7, $custom_7_set,  $custom_7 )    : '',
+			($custom_8_set)  ? custField(  8, $custom_8_set,  $custom_8 )    : '',
+			($custom_9_set)  ? custField(  9, $custom_9_set,  $custom_9 )    : '',
+			($custom_10_set) ? custField( 10, $custom_10_set, $custom_10 )   : '',
+
+			// keywords
+				n.graf('<label for="keywords">'.gTxt('keywords').'</label>'.sp.popHelp('keywords').br.
+					n.'<textarea id="keywords" name="Keywords" cols="18" rows="5">'.$Keywords.'</textarea>'),
+
+			// article image
+				n.graf('<label for="article-image">'.gTxt('article_image').'</label>'.sp.popHelp('article_image').br.
+					fInput('text', 'Image', $Image, 'edit', '', '', 22, '', 'article-image')),
+
+			// url title
+				n.graf('<label for="url-title">'.gTxt('url_title').'</label>'.sp.popHelp('url_title').br.
+					fInput('text', 'url_title', $url_title, 'edit', '', '', 22, '', 'url-title')),
+		
+			'</div>
+			
+			<h3 class="plain"><a href="#recent" onclick="toggleDisplay(\'recent\'); return false;">'.gTxt('recent_articles').'</a>'.'</h3>'.
+			'<div id="recent" style="display:none;">';
+			
+			$recents = safe_rows_start("Title, ID",'textpattern',"1=1 order by LastMod desc limit 10");
+			
+			if ($recents)
+			{
+				echo '<ul class="plain-list">';
+
+				while($recent = nextRow($recents))
+				{
+					if (!$recent['Title'])
+					{
+						$recent['Title'] = gTxt('untitled').sp.$recent['ID'];
+					}
+
+					echo n.t.'<li><a href="?event=article'.a.'step=edit'.a.'ID='.$recent['ID'].'">'.$recent['Title'].'</a></li>';
+				}
+
+				echo '</ul>';
+			}
+			
+			echo '</div>';
+		}
+
+		else
+		{
+			echo sp;
+		}
+
+  	echo '</td>'.n.'<td id="article-main">';
+
+	//-- title input -------------- 
+
+		if ($view == 'preview')
+		{
+			echo hed(gTxt('preview'), 2).graf($Title);
+		}
+
+		if ($view == 'html')
+		{
+			echo hed('XHTML',2).graf($Title);
+		}
+
+		if ($view == 'text')
+		{
+			echo '<p><input type="text" id="title" name="Title" value="'.cleanfInput($Title).'" class="edit" size="40" tabindex="1" />';
+
+			if ( ($Status == 4 or $Status == 5) and $step != 'create')
+			{
+				include_once txpath.'/publish/taghandlers.php';
+
+				echo sp.sp.'<a href="'.permlinkurl_id($ID).'">'.gTxt('view').'</a>';
+			}
+
+			echo '</p>';
+		}
+
+    if ($view == 'preview')
+    { 
+			if ($textile_body == USE_TEXTILE)
+			{
+				echo $textile->TextileThis($Body);
+			}
+
+			else if ($textile_body == CONVERT_LINEBREAKS)
+			{
+				echo nl2br($Body);
+			}
+
+			else if ($textile_body == LEAVE_TEXT_UNTOUCHED)
+			{
+				echo $Body;
+			}
+    }
+
+    elseif ($view == 'html')
+    {
+			if ($textile_body == USE_TEXTILE)
+			{
+				$bod = $textile->TextileThis($Body);
+			}
+
+			else if ($textile_body == CONVERT_LINEBREAKS)
+			{
+				$bod = nl2br($Body);
+			}
+
+			else if ($textile_body == LEAVE_TEXT_UNTOUCHED)
+			{
+				$bod = $Body;
+			}
+
+			echo tag(str_replace(array(n,t), array(br,sp.sp.sp.sp), htmlspecialchars($bod)), 'code');
+		}
+
+		else
+		{
+			echo n.graf('<textarea id="body" name="Body" cols="55" rows="31" tabindex="2">'.htmlspecialchars($Body).'</textarea>');
+		}
+
+	//-- excerpt --------------------
+
+		if ($articles_use_excerpts)
+		{
+			if ($view == 'text')
+			{
+				$Excerpt = str_replace('&amp;', '&', htmlspecialchars($Excerpt));
+
+				echo n.graf('<label for="excerpt">'.gTxt('excerpt').'</label>'.sp.popHelp('excerpt').br.
+					'<textarea id="excerpt" name="Excerpt" cols="55" rows="5" tabindex="3">'.$Excerpt.'</textarea>');
+			}
+
+			else
+			{
+				echo n.'<hr width="50%" />';
+
+				echo ($textile_excerpt == USE_TEXTILE)
+				?	($view=='preview')
+					?	graf($textile->textileThis($Excerpt))
+					:	tag(str_replace(array(n,t),
+							array(br,sp.sp.sp.sp),htmlspecialchars(
+								$textile->TextileThis($Excerpt))),'code')
+				:	graf($Excerpt);
+			}
+		}
+
+
+	//-- author --------------
+	
+		if ($view=="text" && $step != "create") {
+			echo '<p class="small">'.gTxt('posted_by').": $AuthorID &#183; ".safe_strftime('%d %b %Y &#183; %I:%M:%S %p',$sPosted);
+			if($sPosted != $sLastMod) {
+				echo br.gTxt('modified_by').": $LastModID &#183; ".safe_strftime('%d %b %Y &#183; %I:%M:%S %p',$sLastMod);
+			}
+				echo '</p>';
+			}
+
+	echo hInput('from_view',$view),
+	'</td>';
+	echo '<td id="article-tabs">';
+
+  	//-- layer tabs -------------------
+
+		echo ($use_textile == USE_TEXTILE || $textile_body == USE_TEXTILE)
+		?	graf(tab('text',$view).br.tab('html',$view).br.tab('preview',$view))
+		:	'&#160;';
+	echo '</td>';
+?>	
+<td id="article-col-2">
+<?php 
+
+		if ($view == 'text')
+		{
+			if ($step != 'create')
+			{
+				echo n.graf(href(gtxt('create_new'), 'index.php?event=article'));
+			}
+
+		//-- prev/next article links -- 
+
+			if ($step!='create' and ($prev_id or $next_id)) {
+				echo '<p>',
+				($prev_id)
+				?	prevnext_link('&#8249;'.gTxt('prev'),'article','edit',
+						$prev_id,gTxt('prev'))
+				:	'',
+				($next_id)
+				?	prevnext_link(gTxt('next').'&#8250;','article','edit',
+						$next_id,gTxt('next'))
+				:	'',
+				'</p>';
+			}
+
+		//-- status radios --------------
+
+			echo n.n.'<fieldset id="write-status">'.
+				n.'<legend>'.gTxt('status').'</legend>'.
+				n.status_radio($Status).
+				n.'</fieldset>';
+
+		//-- category selects -----------
+
+			echo n.n.'<fieldset id="write-sort">'.
+				n.'<legend>'.gTxt('sort_display').'</legend>'.
+
+				n.graf('<label for="category-1">'.gTxt('category1').'</label> '.
+					'<span class="small">['.eLink('category', '', '', '', gTxt('edit')).']</span>'.br.
+					n.category_popup('Category1', $Category1, 'category-1')).
+
+				n.graf('<label for="category-2">'.gTxt('category2').'</label>'.br.
+					n.category_popup('Category2', $Category2, 'category-2'));
+
+		//-- section select --------------
+
+			if(!$from_view && !$pull) $Section = getDefaultSection();
+
+			echo n.graf('<label for="section">'.gTxt('section').'</label> '.
+				'<span class="small">['.eLink('section', '', '', '', gTxt('edit')).']</span>'.br.
+				section_popup($Section, 'section')).
+
+				n.'</fieldset>'.
+
+		//-- "More" section
+				n.n.'<h3 class="plain"><a href="#more" onclick="toggleDisplay(\'more\'); return false;">'.gTxt('more').'</a></h3>',
+			'<div id="more" style="display: none;">';
+
+		//-- comments stuff --------------
+
+			if($step=="create") {
+				//Avoiding invite disappear when previewing
+				$AnnotateInvite = (!empty($store_out['AnnotateInvite']))? $store_out['AnnotateInvite'] : $comments_default_invite;
+				if ($comments_on_default==1) { $Annotate = 1; }
+			}
+
+			if ($use_comments == 1)
+			{
+				echo n.n.'<fieldset id="write-comments">'.
+					n.'<legend>'.gTxt('comments').'</legend>';
+
+				$comments_expired = false;
+
+				if ($step != 'create' && $comments_disabled_after)
+				{
+					$lifespan = $comments_disabled_after * 86400;
+					$time_since = time() - $sPosted;
+
+					if ($time_since > $lifespan)
+					{
+						$comments_expired = true;
+					}
+				}
+
+				if ($comments_expired)
+				{
+					echo n.n.graf(gTxt('expired'));
+				}
+
+				else
+				{
+					echo n.n.graf(
+						onoffRadio('Annotate', $Annotate)
+					).
+
+					n.n.graf(
+						'<label for="comment-invite">'.gTxt('comment_invitation').'</label>'.br.
+						fInput('text', 'AnnotateInvite', $AnnotateInvite, 'edit', '', '', '', '', 'comment-invite')
+					);
+				}
+
+				echo n.n.'</fieldset>';
+			}
+
+			if ($step == "create" and empty($GLOBALS['ID']))
+			{
+		//-- timestamp ------------------- 
+
+				//Avoiding modified date to disappear
+				$persist_timestamp = (!empty($store_out['year']))? 
+					mktime($store_out['hour'],$store_out['minute'], $store_out['second'], $store_out['month'], $store_out['day'], $store_out['year'])
+					: time();
+
+				echo n.n.'<fieldset id="write-timestamp">'.
+					n.'<legend>'.gTxt('timestamp').'</legend>'.
+
+					n.graf(checkbox('publish_now', '1', ($Status < 4), '', 'publish_now').'<label for="publish_now">'.gTxt('set_to_now').'</label>').
+
+					n.graf(gTxt('or_publish_at').sp.popHelp('timestamp')).
+
+					n.graf(gtxt('date').sp.
+						tsi('year', 'Y', $persist_timestamp).' / '.
+						tsi('month', 'm', $persist_timestamp).' / '.
+						tsi('day', 'd', $persist_timestamp)
+					).
+
+					n.graf(gTxt('time').sp.
+						tsi('hour', 'H', $persist_timestamp).' : '.
+						tsi('minute', 'i', $persist_timestamp).' : '.
+						tsi('second', 's', $persist_timestamp)
+					).
+
+				n.'</fieldset>'.
+
+				// end "More" section
+				n.n.'</div>';
+
+		//-- publish button --------------
+
+				echo
+				(has_privs('article.publish')) ?
+				fInput('submit','publish',gTxt('publish'),"publish", '', '', '', 4) :
+				fInput('submit','publish',gTxt('save'),"publish", '', '', '', 4);
+			}
+
+			else
+			{
+
+			//-- timestamp ------------------- 
+
+				echo n.n.'<fieldset id="write-timestamp">'.
+					n.'<legend>'.gTxt('timestamp').'</legend>'.
+
+					n.graf(checkbox('reset_time', '1', ($Status < 4), '', 'reset_time').'<label for="reset_time">'.gTxt('reset_time').'</label>').
+
+					n.graf(gTxt('published_at').sp.popHelp('timestamp')).
+
+					n.graf(gtxt('date').sp.
+						tsi('year', 'Y', $sPosted).' / '.
+						tsi('month', 'm', $sPosted).' / '.
+						tsi('day', 'd', $sPosted)
+					).
+
+					n.graf(gTxt('time').sp.
+						tsi('hour', 'H', $sPosted).' : ' .
+						tsi('minute', 'i', $sPosted).' : '.
+						tsi('second', 's', $sPosted)
+					).
+
+					n.hInput('sPosted', $sPosted),
+					n.hInput('sLastMod', $sLastMod),
+					n.hInput('AuthorID', $AuthorID),
+					n.hInput('LastModID', $LastModID),
+
+				n.'</fieldset>'.
+
+				// end "More" section
+				n.n.'</div>';
+
+		//-- save button --------------
+
+				if (   ($Status >= 4 and has_privs('article.edit.published'))
+					or ($Status >= 4 and $AuthorID==$txp_user and has_privs('article.edit.own.published'))
+				    or ($Status <  4 and has_privs('article.edit'))
+					or ($Status <  4 and $AuthorID==$txp_user and has_privs('article.edit.own')))
+					echo fInput('submit','save',gTxt('save'),"publish", '', '', '', 4);
+			}
+		}
+
+    echo '</td></tr></table></form>';
+	
+	}
+
+// -------------------------------------------------------------
+
+	function custField($num, $field, $content)
+	{
+		return n.n.graf('<label for="custom-'.$num.'">'.$field.'</label>'.br.
+			n.fInput('text', 'custom_'.$num, $content, 'edit', '', '', 22, '', 'custom-'.$num));
+	}
+
+// -------------------------------------------------------------
+	function checkIfNeighbour($whichway,$sPosted)
+	{
+		$sPosted = assert_int($sPosted);
+		$dir = ($whichway == 'prev') ? '<' : '>'; 
+		$ord = ($whichway == 'prev') ? 'desc' : 'asc'; 
+
+		return safe_field("ID", "textpattern", 
+			"Posted $dir from_unixtime($sPosted) order by Posted $ord limit 1");
+	}
+
+//--------------------------------------------------------------
+	function tsi($name,$datevar,$time,$tab='')
+	{
+		$size = ($name=='year') ? 4 : 2;
+
+		return n.'<input type="text" name="'.$name.'" value="'.
+			date($datevar,$time+tz_offset())
+		.'" size="'.$size.'" maxlength="'.$size.'" class="edit" tabindex="'.$tab.'" title="'.gTxt('article_'.$name).'" />';
+	}
+
+//--------------------------------------------------------------
+// remember to show markup help for both body and excerpt 
+// if they are different
+
+	function side_help($textile_body, $textile_excerpt)
+	{
+		if ($textile_body == USE_TEXTILE or $textile_excerpt == USE_TEXTILE)
+		{
+			return n.hed(
+				'<a href="#textile_help" onclick="toggleDisplay(\'textile_help\'); return false;">'.gTxt('textile_help').'</a>'
+			, 3, ' class="plain"').
+
+				n.'<div id="textile_help" style="display: none;">'.
+
+				n.'<ul class="plain-list small">'.
+					n.t.'<li>'.gTxt('header').': <strong>h<em>n</em>.</strong>'.sp.
+						popHelpSubtle('header', 400, 400).'</li>'.
+					n.t.'<li>'.gTxt('blockquote').': <strong>bq.</strong>'.sp.
+						popHelpSubtle('blockquote',400,400).'</li>'.
+					n.t.'<li>'.gTxt('numeric_list').': <strong>#</strong>'.sp.
+						popHelpSubtle('numeric', 400, 400).'</li>'.
+					n.t.'<li>'.gTxt('bulleted_list').': <strong>*</strong>'.sp.
+						popHelpSubtle('bulleted', 400, 400).'</li>'.
+				n.'</ul>'.
+
+				n.'<ul class="plain-list small">'.
+					n.t.'<li>'.'_<em>'.gTxt('emphasis').'</em>_'.sp.
+						popHelpSubtle('italic', 400, 400).'</li>'.
+					n.t.'<li>'.'*<strong>'.gTxt('strong').'</strong>*'.sp.
+						popHelpSubtle('bold', 400, 400).'</li>'.
+					n.t.'<li>'.'??<cite>'.gTxt('citation').'</cite>??'.sp.
+						popHelpSubtle('cite', 500, 300).'</li>'.
+					n.t.'<li>'.'-'.gTxt('deleted_text').'-'.sp.
+						popHelpSubtle('delete', 400, 300).'</li>'.
+					n.t.'<li>'.'+'.gTxt('inserted_text').'+'.sp.
+						popHelpSubtle('insert', 400, 300).'</li>'.
+					n.t.'<li>'.'^'.gTxt('superscript').'^'.sp.
+						popHelpSubtle('super', 400, 300).'</li>'.
+					n.t.'<li>'.'~'.gTxt('subscript').'~'.sp.
+						popHelpSubtle('subscript', 400, 400).'</li>'.
+				n.'</ul>'.
+
+				n.graf(
+					'"'.gTxt('linktext').'":url'.sp.popHelpSubtle('link', 400, 500)
+				, ' class="small"').
+
+				n.graf(
+					'!'.gTxt('imageurl').'!'.sp.popHelpSubtle('image', 500, 500)
+				, ' class="small"').
+
+				n.graf(
+					'<a href="http://textile.thresholdstate.com/" target="_blank">'.gTxt('More').'</a>').
+
+				n.'</div>';
+		}
+	}
+
+//--------------------------------------------------------------
+
+	function status_radio($Status)
+	{
+		global $statuses;
+
+		$Status = (!$Status) ? 4 : $Status;
+
+		foreach ($statuses as $a => $b)
+		{
+			$out[] = n.t.'<li>'.radio('Status', $a, ($Status == $a) ? 1 : 0, 'status-'.$a).
+				'<label for="status-'.$a.'">'.$b.'</label></li>';
+		}
+
+		return '<ul class="plain-list">'.join('', $out).n.'</ul>';
+	}
+
+//--------------------------------------------------------------
+
+	function category_popup($name, $val, $id)
+	{
+		$rs = getTree('root', 'article');
+
+		if ($rs)
+		{
+			return treeSelectInput($name,$rs,$val, $id);
+		}
+
+		return false;
+	}
+
+//--------------------------------------------------------------
+
+	function section_popup($Section, $id)
+	{
+		$rs = safe_column('name', 'txp_section', "name != 'default'");
+
+		if ($rs)
+		{
+			return selectInput('Section', $rs, $Section, false, '', $id);
+		}
+
+		return false;
+	}
+
+//--------------------------------------------------------------
+	function tab($tabevent,$view) 
+	{
+		$state = ($view==$tabevent) ? 'up' : 'down';
+		$img = 'txp_img/'.$tabevent.$state.'.gif';
+		$out = '<img src="'.$img.'"';
+		$out.=($tabevent!=$view) ? ' onclick="document.article.view.value=\''.$tabevent.'\'; document.article.submit(); return false;"' : "";
+		$out.= ' height="100" width="19" alt="" />';
+      	return $out;
+	}
+
+//--------------------------------------------------------------
+	function getDefaultSection() 
+	{
+		return safe_field("name", "txp_section","is_default=1");
+	}
+
+// -------------------------------------------------------------
+
+	function form_pop($form, $id)
+	{
+		$arr = array(' ');
+
+		$rs = safe_column('name', 'txp_form', "type = 'article' and name != 'default' order by name");
+
+		if ($rs)
+		{
+			return selectInput('override_form', $rs, $form, true, '', $id);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function check_url_title($url_title)
+	{
+		// Check for blank or previously used identical url-titles
+		if (strlen($url_title) === 0)
+		{
+			return gTxt('url_title_is_blank');
+		}
+
+		else
+		{
+			$url_title_count = safe_count('textpattern', "url_title = '$url_title'");
+
+			if ($url_title_count > 1)
+			{
+				return gTxt('url_title_is_multiple', array('{count}' => $url_title_count));
+			}
+		}
+
+		return '';
+	}
+// -------------------------------------------------------------
+	function get_status_message($Status)
+	{
+		switch ($Status){
+			case 3: return gTxt("article_saved_pending");
+			case 2: return gTxt("article_saved_hidden");
+			case 1: return gTxt("article_saved_draft");
+			default: return gTxt('article_posted');
+		}
+	}
+// -------------------------------------------------------------
+	function textile_main_fields($incoming, $use_textile)
+	{
+		global $txpcfg;
+		
+		include_once txpath.'/lib/classTextile.php';
+		$textile = new Textile();
+		
+		$incoming['Title_plain'] = $incoming['Title'];
+		
+		if ($incoming['textile_body'] == LEAVE_TEXT_UNTOUCHED) {
+		
+			$incoming['Body_html'] = trim($incoming['Body']);
+			
+		}elseif ($incoming['textile_body'] == USE_TEXTILE){
+		
+			$incoming['Body_html'] = $textile->TextileThis($incoming['Body']);
+			$incoming['Title'] = $textile->TextileThis($incoming['Title'],'',1);
+			
+		}elseif ($incoming['textile_body'] == CONVERT_LINEBREAKS){
+			
+			$incoming['Body_html'] = nl2br(trim($incoming['Body']));
+		}
+
+		if ($incoming['textile_excerpt'] == LEAVE_TEXT_UNTOUCHED) {
+		
+			$incoming['Excerpt_html'] = trim($incoming['Excerpt']);
+			
+		}elseif ($incoming['textile_excerpt'] == USE_TEXTILE){
+		
+			$incoming['Excerpt_html'] = $textile->TextileThis($incoming['Excerpt']);
+			
+		}elseif ($incoming['textile_excerpt'] == CONVERT_LINEBREAKS){
+			
+			$incoming['Excerpt_html'] = nl2br(trim($incoming['Excerpt']));
+		}
+		
+		return $incoming;
+	}
+// -------------------------------------------------------------
+
+	function do_pings()
+	{
+		global $txpcfg, $prefs;
+
+		include_once txpath.'/lib/IXRClass.php';
+		
+		if ($prefs['ping_textpattern_com']) {
+			$tx_client = new IXR_Client('http://textpattern.com/xmlrpc/');
+			$tx_client->query('ping.Textpattern', $prefs['sitename'], hu);
+		}
+
+		if ($prefs['ping_weblogsdotcom']==1) {
+			$wl_client = new IXR_Client('http://rpc.pingomatic.com/');
+			$wl_client->query('weblogUpdates.ping', $prefs['sitename'], hu);
+		}
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_auth.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_auth.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_auth.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,187 @@
+<?php
+
+/*
+This is Textpattern
+
+Copyright 2005 by Dean Allen
+www.textpattern.com
+All rights reserved
+
+Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_auth.php $
+$LastChangedRevision: 1879 $
+
+*/
+
+if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+function doAuth() {
+	global $txp_user;
+			
+	$txp_user = NULL;
+	
+	$message = doTxpValidate();
+	
+	if(!$txp_user) {
+		doLoginForm($message);
+	}
+
+	ob_start();
+}
+
+// -------------------------------------------------------------
+	function txp_validate($user,$password) {
+    	$safe_user = doSlash($user);
+    	$r = safe_field("name", 
+    		"txp_users", "name = '$safe_user'
+			and (pass = password(lower('".doSlash($password)."')) or pass = password('".doSlash($password)."')) and privs > 0");
+
+    	if ($r) {
+
+			// update the last access time
+			safe_update("txp_users", "last_access = now()", "name = '$safe_user'");
+			return true;
+
+    	} else { // try old_password mysql hash
+
+	       	$r_old = safe_field("name", 
+	    		"txp_users", "name = '$safe_user'
+				and (pass = old_password(lower('".doSlash($password)."')) or pass = old_password('".doSlash($password)."')) and privs > 0");
+			if ($r_old) {
+				safe_update("txp_users", "last_access = now()", "name = '$safe_user'");
+				return true;
+			}
+    	}
+		return false;
+	}
+	
+// -------------------------------------------------------------
+
+	function doLoginForm($message)
+	{
+		global $txpcfg;
+
+		include txpath.'/lib/txplib_head.php';
+
+		pagetop(gTxt('login'));
+
+		$stay = !(cs('txp_nostay') == 1);
+
+		echo form(
+			startTable('edit').
+				n.n.tr(
+					n.td().
+					td(graf($message))
+				).
+
+				n.n.tr(
+					n.fLabelCell('name', '', 'name').
+					n.fInputCell('p_userid', '', 1, '', '', 'name')
+				).
+
+				n.n.tr(
+					n.fLabelCell('password', '', 'password').
+					n.td(
+						fInput('password', 'p_password', '', 'edit', '', '', '', 2, 'password')
+					)
+				).
+
+				n.n.tr(
+					n.td().
+					td(
+						graf(checkbox('stay', 1, $stay, 3, 'stay').'<label for="stay">'.gTxt('stay_logged_in').'</label>'.
+							sp.popHelp('remember_login'))
+					)
+				).
+
+				n.n.tr(
+					n.td().
+					td(
+						fInput('submit', '', gTxt('log_in_button'), 'publish', '', '', '', 4)
+					)
+				).
+
+			endTable().
+
+			(gps('event') ? eInput(gps('event')) : '')
+			).
+
+		n.'</div>'.n.n.'</body>'.n.'</html>';
+
+		exit(0);
+	}
+
+// -------------------------------------------------------------
+	function doTxpValidate() 
+	{
+		global $logout,$txpcfg, $txp_user;
+		$p_userid = ps('p_userid');
+		$p_password = ps('p_password');
+		$logout = gps('logout');
+		$stay = ps('stay');
+		
+		if ($logout) {
+			setcookie('txp_login','',time()-3600);
+		}
+		if (!empty($_COOKIE['txp_login']) and !$logout) {	// cookie exists
+	
+			@list($c_userid,$cookie_hash) = split(',',cs('txp_login'));
+
+			$nonce = safe_field('nonce','txp_users',"name='".doSlash($c_userid)."'");
+
+			if ((md5($c_userid.$nonce) === $cookie_hash) && $nonce) {  // check nonce
+	
+				$txp_user = $c_userid;	// cookie is good, create $txp_user
+				return '';
+	
+			} else {
+					// something's gone wrong
+				$txp_user = '';
+				setcookie('txp_login','',time()-3600);
+				return gTxt('bad_cookie');
+			}
+			
+		} elseif ($p_userid and $p_password) {	// no cookie, but incoming login vars
+		
+				sleep(3); // should grind dictionary attacks to a halt
+	
+				if (txp_validate($p_userid,$p_password)) {
+
+					$nonce = safe_field('nonce','txp_users',"name='".doSlash($p_userid)."'");
+
+					if (!$nonce) {
+							define('TXP_UPDATE', 1);
+							include_once txpath.'/update/_update.php';
+							exit(graf('Please reload'));
+					}
+
+					if ($stay) {	// persistent cookie required
+
+						setcookie('txp_login',
+							$p_userid.','.md5($p_userid.$nonce),
+							time()+3600*24*365);	// expires in 1 year
+						if (cs('txp_nostay')) setcookie('txp_nostay','',time()-3600);
+
+	
+					} else {    // session-only cookie required
+	
+						setcookie('txp_login',$p_userid.','.md5($p_userid.$nonce));    			
+						setcookie('txp_nostay','1',
+							time()+3600*24*365);	// remember nostay for 1 year
+					}
+				
+					$txp_user = $p_userid;	// login is good, create $txp_user
+					return '';
+
+				} else {
+					$txp_user = '';
+					return gTxt('could_not_log_in');
+				}
+	
+		} else {
+			$txp_user = '';
+			return gTxt('login_to_textpattern');
+		}	
+	}
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_category.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_category.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_category.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,455 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance ofthe Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_category.php $
+$LastChangedRevision: 1879 $
+*/
+
+if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+if ($event == 'category') {
+	require_privs('category');	
+
+	if(!$step or !in_array($step, array(
+		'cat_category_list','cat_article_create','cat_image_create','cat_file_create','cat_link_create',
+		'cat_category_multiedit','cat_article_save','cat_image_save','cat_file_save','cat_link_save',
+		'cat_article_edit','cat_image_edit','cat_file_edit','cat_link_edit',		
+	))){
+		cat_category_list();
+	} else $step();
+}
+
+//-------------------------------------------------------------
+	function cat_category_list($message="")
+	{
+		pagetop(gTxt('categories'),$message);
+		$out = array('<table cellspacing="20" align="center">',
+		'<tr>',
+			tdtl(cat_article_list(),' class="categories"'),
+			tdtl(cat_link_list(),' class="categories"'),
+			tdtl(cat_image_list(),' class="categories"'),
+			tdtl(cat_file_list(),' class="categories"'),
+		'</tr>',
+		endTable());
+		echo join(n,$out);
+	}
+
+ 
+//-------------------------------------------------------------
+	function cat_article_list() 
+	{
+		return cat_event_category_list('article');
+	}
+
+//-------------------------------------------------------------
+	function cat_article_create()
+	{
+		return cat_event_category_create('article');
+	}
+
+//-------------------------------------------------------------
+	function cat_article_edit()
+	{
+		return cat_event_category_edit('article');
+	}
+
+//-------------------------------------------------------------
+	function cat_article_save()
+	{
+		return cat_event_category_save('article', 'textpattern');
+	}
+
+//--------------------------------------------------------------
+
+	function cat_parent_pop($name, $type, $id)
+	{
+		if ($id)
+		{
+			$id = assert_int($id);
+			list($lft, $rgt) = array_values(safe_row('lft, rgt', 'txp_category', 'id = '.$id));
+
+			$rs = getTree('root', $type, "lft not between $lft and $rgt");
+		}
+
+		else
+		{
+			$rs = getTree('root', $type);
+		}
+
+		if ($rs)
+		{
+			return treeSelectInput('parent', $rs, $name);
+		}
+
+		return gTxt('no_other_categories_exist');
+	}
+
+// -------------------------------------------------------------
+	function cat_link_list() 
+	{
+		return cat_event_category_list('link');
+	}
+
+//-------------------------------------------------------------
+	function cat_link_create()
+	{
+		return cat_event_category_create('link');
+	}
+
+//-------------------------------------------------------------
+	function cat_link_edit()
+	{
+		return cat_event_category_edit('link');
+	}
+
+//-------------------------------------------------------------
+	function cat_link_save()
+	{
+		return cat_event_category_save('link', 'txp_link');
+	}
+
+// -------------------------------------------------------------
+	function cat_image_list() 
+	{
+		return cat_event_category_list('image');
+	}
+
+//-------------------------------------------------------------
+	function cat_image_create()
+	{
+		return cat_event_category_create('image');
+	}
+
+//-------------------------------------------------------------
+	function cat_image_edit()
+	{
+		return cat_event_category_edit('image');
+	}
+
+//-------------------------------------------------------------
+	function cat_image_save()
+	{
+		return cat_event_category_save('image', 'txp_image');
+	}
+
+
+// -------------------------------------------------------------
+	function cat_article_multiedit_form($area, $array)
+	{
+		$methods = array('delete'=>gTxt('delete'));
+		if ($array) {
+		return
+		form(
+			join('',$array).
+			eInput('category').sInput('cat_category_multiedit').hInput('type',$area).
+			small(gTxt('with_selected')).sp.selectInput('edit_method',$methods,'',1).sp.
+			fInput('submit','',gTxt('go'),'smallerbox')
+			,'margin-top:1em',"verify('".gTxt('are_you_sure')."')"
+		);
+		} return;
+	}
+
+// -------------------------------------------------------------
+	function cat_category_multiedit()
+	{
+		$type = ps('type');
+		$method = ps('edit_method');
+		$things = ps('selected');
+		if ($things) {
+			foreach($things as $catid) {
+				$catid = assert_int($catid);
+				if ($method == 'delete') {
+					$catname = safe_field('name', 'txp_category', "id=$catid");
+					if (safe_delete('txp_category',"id=$catid")) {
+						if ($catname)
+							safe_update('txp_category', "parent='root'", "type='".doSlash($type)."' and parent='".doSlash($catname)."'");
+						$categories[] = $catid;
+					}
+				}
+			}
+			rebuild_tree('root', 1, $type);
+
+			$message = gTxt($type.'_categories_deleted', array('{list}' => join(', ',$categories)));
+
+			cat_category_list($message);
+		}
+	}
+
+//Refactoring: Functions are more or less the same for all event types
+// so, merge them. Addition of new event categories is easiest now.
+
+//-------------------------------------------------------------
+
+	function cat_event_category_list($event) 
+	{
+		$out = n.n.hed(gTxt($event.'_head').sp.popHelp($event.'_category'), 3).
+
+			form(
+				fInput('text', 'title', '', 'edit', '', '', 20).
+				fInput('submit', '', gTxt('Create'), 'smallerbox').
+				eInput('category').
+				sInput('cat_'.$event.'_create')
+			);
+
+		$rs = getTree('root', $event);
+
+		if ($rs)
+		{
+			$total_count = array();
+
+			if ($event == 'article')
+			{
+				$rs2 = safe_rows_start('Category1, count(*) as num', 'textpattern', "1 = 1 group by Category1");
+
+				while ($a = nextRow($rs2))
+				{
+					$name = $a['Category1'];
+					$num = $a['num'];
+
+					$total_count[$name] = $num;
+				}
+
+				$rs2 = safe_rows_start('Category2, count(*) as num', 'textpattern', "1 = 1 group by Category2");
+
+				while ($a = nextRow($rs2))
+				{
+					$name = $a['Category2'];
+					$num = $a['num'];
+
+					if (isset($total_count[$name]))
+					{
+						$total_count[$name] += $num;
+					}
+
+					else
+					{
+						$total_count[$name] = $num;
+					}
+				}
+			}
+
+			else
+			{
+				switch ($event)
+				{
+					case 'link':
+						$rs2 = safe_rows_start('category, count(*) as num', 'txp_link', "1 group by category");
+					break;
+
+					case 'image':
+						$rs2 = safe_rows_start('category, count(*) as num', 'txp_image', "1 group by category");
+					break;
+
+					case 'file':
+						$rs2 = safe_rows_start('category, count(*) as num', 'txp_file', "1 group by category");
+					break;
+				}
+
+				while ($a = nextRow($rs2))
+				{
+					$name = $a['category'];
+					$num = $a['num'];
+
+					$total_count[$name] = $num;
+				}
+			}
+
+			$items = array();
+
+			foreach ($rs as $a)
+			{
+				extract($a);
+
+				// format count
+				switch ($event)
+				{
+					case 'article':
+						$url = 'index.php?event=list'.a.'search_method=categories'.a.'crit='.$name;
+					break;
+	
+					case 'link':
+						$url = 'index.php?event=link'.a.'search_method=category'.a.'crit='.$name;
+					break;
+	
+					case 'image':
+						$url = 'index.php?event=image'.a.'search_method=category'.a.'crit='.$name;
+					break;
+	
+					case 'file':
+						$url = 'index.php?event=file'.a.'search_method=category'.a.'crit='.$name;
+					break;
+				}
+
+				$count = isset($total_count[$name]) ? '('.href($total_count[$name], $url).')' : '(0)';
+
+				$items[] = graf(
+					checkbox('selected[]', $id, 0).sp.str_repeat(sp.sp, $level * 2).
+					eLink('category', 'cat_'.$event.'_edit', 'id', $id, $title).sp.small($count)
+				);
+			}
+
+			if ($items)
+			{
+				$out .= cat_article_multiedit_form($event, $items);
+			}
+		}
+
+		else
+		{
+			$out .= graf(gTxt('no_categories_exist'));
+		}
+
+		return $out;
+	}
+
+//-------------------------------------------------------------
+
+	function cat_event_category_create($event)
+	{
+		global $txpcfg;
+
+		$title = ps('title');
+
+		$name = sanitizeForUrl($title);
+
+		if (!$name)
+		{
+			$message = gTxt($event.'_category_invalid', array('{name}' => $name));
+
+			return cat_category_list($message);
+		}
+
+		$exists = safe_field('name', 'txp_category', "name = '".doSlash($name)."' and type = '".doSlash($event)."'");
+
+		if ($exists)
+		{
+			$message = gTxt($event.'_category_already_exists', array('{name}' => $name));
+
+			return cat_category_list($message);
+		}
+
+		$q = safe_insert('txp_category', "name = '".doSlash($name)."', title = '".doSlash($title)."', type = '".doSlash($event)."', parent = 'root'");
+
+		if ($q)
+		{
+			rebuild_tree('root', 1, $event);
+
+			$message = gTxt($event.'_category_created', array('{name}' => $name));
+
+			cat_category_list($message);
+		}
+	}
+
+//-------------------------------------------------------------
+	function cat_event_category_edit($evname)
+	{
+		pagetop(gTxt('categories'));
+
+		$id     = assert_int(gps('id'));
+		$parent = doSlash(gps('parent'));
+
+		$row = safe_row("*", "txp_category", "id=$id");
+		if($row){
+			extract($row);
+			$out = stackRows(
+				fLabelCell($evname.'_category_name') . fInputCell('name', $name, 1, 20),
+				fLabelCell('parent') . td(cat_parent_pop($parent,$evname,$id)),
+				fLabelCell($evname.'_category_title') . fInputCell('title', $title, 1, 30),
+				hInput('id',$id),
+				tdcs(fInput('submit', '', gTxt('save_button'),'smallerbox'), 2)
+			);
+		}
+		$out.= eInput( 'category' ) . sInput( 'cat_'.$evname.'_save' ) . hInput( 'old_name',$name );
+		echo form( startTable( 'edit' ) . $out . endTable() );
+	}
+
+//-------------------------------------------------------------
+
+	function cat_event_category_save($event, $table_name)
+	{
+		global $txpcfg;
+
+		extract(doSlash(psa(array('id', 'name', 'old_name', 'parent', 'title'))));
+		$id = assert_int($id);
+
+		$name = sanitizeForUrl($name);
+
+		// make sure the name is valid
+		if (!$name)
+		{
+			$message = gTxt($event.'_category_invalid', array('{name}' => $name));
+
+			return cat_category_list($message);
+		}
+
+		// don't allow rename to clobber an existing category
+		$existing_id = safe_field('id', 'txp_category', "name = '$name' and type = '$event'");
+
+		if ($existing_id and $existing_id != $id)
+		{
+			$message = gTxt($event.'_category_already_exists', array('{name}' => $name));
+
+			return cat_category_list($message);
+		}
+
+		$parent = ($parent) ? $parent : 'root';
+
+		if (safe_update('txp_category', "name = '$name', parent = '$parent', title = '$title'", "id = $id"))
+		{
+			safe_update('txp_category', "parent = '$name'", "parent = '$old_name'");
+		}
+
+		rebuild_tree('root', 1, $event);
+
+		if ($event == 'article')
+		{
+			safe_update('textpattern', "Category1 = '$name'", "Category1 = '$old_name'");
+			safe_update('textpattern', "Category2 = '$name'", "Category2 = '$old_name'");
+		}
+
+		else
+		{
+			safe_update($table_name, "category = '$name'", "category = '$old_name'");
+		}
+
+		$message = gTxt($event.'_category_updated', array('{name}' => doStrip($name)));
+
+		cat_category_list($message);
+	}
+
+// --------------------------------------------------------------
+// Non image file upload. Have I mentioned how much I love this file refactoring?
+// -------------------------------------------------------------
+	function cat_file_list()
+	{
+		return cat_event_category_list('file');
+	}
+
+//-------------------------------------------------------------
+	function cat_file_create()
+	{
+		return cat_event_category_create('file');
+	}
+
+//-------------------------------------------------------------
+	function cat_file_edit()
+	{
+		return cat_event_category_edit('file');
+	}
+
+//-------------------------------------------------------------
+	function cat_file_save()
+	{
+		return cat_event_category_save('file','txp_file');
+	}
+	
+	
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_css.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_css.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_css.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,406 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_css.php $
+$LastChangedRevision: 1897 $
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	if ($event == 'css') {
+		require_privs('css');
+	
+		switch ($step) {
+			case '': css_edit(); break;
+			case 'css_edit_raw': css_edit();           break;
+			case 'css_edit_form': css_edit();          break;
+			case 'pour': css_edit();	               break;
+			case 'css_save': css_save();               break;
+			case 'css_copy': css_copy();               break;
+			case 'css_save_as': css_save_as();         break;
+			case 'css_save_posted': css_save_posted(); break;
+			case 'css_delete': css_delete();           break;
+			case 'css_edit': css_edit();               break;
+			case 'del_dec': css_edit();                break;
+			case 'add_dec': css_edit();                break;
+			case 'add_sel': css_edit();
+		}
+	}
+
+//-------------------------------------------------------------
+	function css_list($name) 
+	{	
+		$out[] = startTable('list','left');	
+		$rs = safe_rows_start("name as cssname","txp_css","1=1");
+		if ($rs) {
+			while ($a = nextRow($rs)) {
+				extract($a);
+				$namelink = ($name!=$cssname)
+				?	eLink('css','','name',$cssname,$cssname)
+				:	$cssname;
+				$deletelink = ($cssname!='default') ? 
+					dLink('css','css_delete','name',$cssname) : '';
+				$out[] = tr(td($namelink).td($deletelink));
+			}
+			$out[] =  endTable();
+			return join('',$out);
+		}
+	}
+
+//-------------------------------------------------------------
+	function css_edit($message='')
+	{
+		pagetop(gTxt("edit_css"),$message);
+		global $step,$prefs;
+		if (!$step or $step == 'css_save'){
+
+			if ($prefs['edit_raw_css_by_default']) {
+				css_edit_raw();
+			} else {
+				css_edit_form();
+			}	
+
+		} else {
+
+			if ($step=='css_edit_raw' or $step=='pour' or ($step=='css_delete' && $prefs['edit_raw_css_by_default'])) {
+				css_edit_raw();
+			} else {
+				css_edit_form();
+			}
+		}
+	}
+
+// -------------------------------------------------------------
+	function css_edit_form() 
+	{
+		global $step;
+		$name = (!gps('name') or $step=='css_delete') ? 'default' : gps('name');
+		if (gps('copy') && trim(preg_replace('/[<>&"\']/', '', gps('newname'))) )
+			$name = gps('newname');
+		$css = base64_decode(fetch("css",'txp_css','name',$name));
+		$css = parseCSS($css);
+		
+		$css = ($step == 'add_dec') ? add_declaration($css) : $css;
+		$css = ($step == 'del_dec') ? delete_declaration($css) : $css;
+		$css = ($step == 'add_sel') ? addSel($css) : $css;
+
+		$right = 
+		hed(gTxt('all_stylesheets'),2).
+		css_list($name);
+
+		$left = graf(gTxt('you_are_editing_css').br.strong($name)).
+			graf(eLink('css', 'css_edit_raw', 'name', $name, gTxt('edit_raw_css'))).
+			graf(sLink('css', 'pour', gTxt('bulkload_existing_css'))); 
+
+		$out[] = startTable('css-edit', '', '', 3);
+		
+		$out[] = 
+		tr(
+			td(strong(gTxt('css_selector'))).
+			td(strong(gTxt('css_property_value')))
+		);
+		
+		$i = -1;
+		foreach($css as $selector=>$propvals) {
+			$out[] = n.'<tr>'.n.
+				td(fInput('text',++$i,$selector,'css')
+				.' '.aLink('css','add_dec','selector',$selector,'name',$name)
+				,'', 'selector','s'.$i);
+			if(is_array($propvals))
+			{
+				$out[] = n.t.'<td class="selector2">';
+				$ii = -1;
+				foreach($propvals as $property=>$value)
+				{
+					$out[] = fInput('text',$i.'-'.++$ii.'p',$property,'css'). ' '
+					.fInput('text',$i.'-'.$ii.'v',ltrim($value),'css').' '
+					.dLink('css','del_dec','declaration',$i.'-'.$ii,'','name',$name,1).br;
+				}
+			$out[] = '</td>'.n.'</tr>';
+		 }
+		}
+		
+		$out[] = tr(tdcs(fInput('submit','',gTxt('save'),'publish'),2)).
+		endTable().eInput('css').sInput('css_save_posted').hInput('name',$name);
+		
+		echo 
+		startTable('edit').
+		tr(
+			tdtl(
+				$left
+			).
+			td(
+				form(
+					graf(
+						gTxt('add_new_selector').': '.sp.
+						fInput('text','selector','','css').sp.
+						fInput('submit','add_sel',gTxt('submit'),'smallerbox').
+						eInput('css') . sInput('add_sel') . hInput('name',$name)
+					)
+				).
+				form(join('',$out)).
+
+				form(
+					graf(
+						gTxt('copy_css_as').sp.fInput('text', 'newname', '', 'edit').sp.
+						fInput('submit', 'copy', gTxt('copy'), 'smallerbox').
+						eInput('css').
+						sInput('css_copy').
+						hInput('oldname', $name).
+						hInput('name', $name)
+					)
+				)
+			).
+			tdtl(
+				$right
+			)
+		).
+		endTable();
+	
+	}
+
+//-------------------------------------------------------------
+	function css_edit_raw() 
+	{
+		global $step;
+		$name = (!gps('name') or $step=='css_delete') ? 'default' : gps('name');
+		if (gps('copy') && trim(preg_replace('/[<>&"\']/', '', gps('newname'))) )
+			$name = gps('newname');
+
+		if ($step=='pour') 
+		{
+			$buttons = 
+			gTxt('name_for_this_style').': '
+			.fInput('text','newname','','edit','','',20).
+			hInput('savenew','savenew');
+			$thecss = '';
+
+		} else {
+			$buttons = '';
+			$thecss = base64_decode(fetch("css",'txp_css','name',$name));
+		}
+	
+		if ($step!='pour') {
+
+			$left = graf(gTxt('you_are_editing_css').br.strong($name)).
+				graf(eLink('css', 'css_edit_form', 'name', $name, gTxt('edit_css_in_form'))).
+				graf(sLink('css', 'pour', gTxt('bulkload_existing_css')));
+			
+			$copy = gTxt('copy_css_as').sp.fInput('text', 'newname', '', 'edit').sp.
+				fInput('submit', 'copy', gTxt('copy'), 'smallerbox');		
+		} else {
+			$left = '&nbsp;';
+			$copy = '';
+		}
+
+		$right = 
+		hed(gTxt('all_stylesheets'),2).
+		css_list($name);
+
+		echo 
+		startTable('edit').
+		tr(
+			tdtl(
+				$left
+			).
+			td(
+				form(
+					graf($buttons).
+					'<textarea id="css" class="code" name="css" cols="78" rows="32">'.$thecss.'</textarea>'.br.
+					fInput('submit','',gTxt('save'),'publish').
+					eInput('css').sInput('css_save').
+					hInput('name',$name)
+					.$copy
+				)
+			).
+			tdtl(
+				$right
+			)
+		).
+		endTable();
+		
+	}
+
+// -------------------------------------------------------------
+	function parseCSS($css) // parse raw css into a multidimensional array
+	{
+		$css = preg_replace("/\/\*.+\*\//Usi","",$css); // remove comments
+		$selectors = preg_replace('/\s+/',' ',strip_rn(explode("}",$css)));
+		foreach($selectors as $selector) { 
+			if(trim($selector)) {
+			list($keystr,$codestr) = explode("{",$selector);
+				if (trim($keystr)) {
+					$codes = explode(";",trim($codestr));
+					foreach ($codes as $code) {
+						if (trim($code)) {
+							list($property,$value) = explode(":",$code,2);
+							$out[trim($keystr)][trim($property)] = trim($value);
+						} 
+					}
+				}
+			}
+		}
+		return (isset($out)) ? $out : array();
+	}
+
+// -------------------------------------------------------------
+	function parsePostedCSS() //turn css info delivered by editor form into an array
+	{
+		$post = (MAGIC_QUOTES_GPC) ? doStrip($_POST) : $_POST;
+		foreach($post as $a=>$b){
+			if (preg_match("/^\d+$/",$a)) {
+				$selector = $b;
+			}
+			if (preg_match("/^\d+-\d+(?:p|v)$/",$a)) {
+				if(strstr($a,'p')) {
+					$property = $b;
+				} else {
+					if(trim($property) && trim($selector)) {
+						$out[$selector][$property] = $b;
+					}
+				}
+			}
+		}
+		return (isset($out)) ? $out : array();
+	}
+	
+// -------------------------------------------------------------
+
+	function css_copy()
+	{
+		extract(gpsa(array('oldname', 'newname')));
+
+		$css = doSlash(fetch('css', 'txp_css', 'name', $oldname));
+
+		$rs = safe_insert('txp_css', "css = '$css', name = '".doSlash($newname)."'");
+
+		css_edit(
+			gTxt('css_created', array('{name}' => $newname))
+		);
+	}
+
+// -------------------------------------------------------------
+
+	function css_save_posted() 
+	{
+		$name = gps('name');
+		$css  = parsePostedCSS();
+		$css  = doSlash(base64_encode(css_format($css)));
+
+		safe_update('txp_css', "css = '$css'", "name = '".doSlash($name)."'");
+
+		$message = gTxt('css_updated', array('{name}' => $name));
+
+		css_edit($message);
+	}
+
+//-------------------------------------------------------------
+
+	function css_save()
+	{
+		extract(gpsa(array('name','css','savenew','newname','copy')));
+		$css = doSlash(base64_encode($css));
+
+		if ($savenew or $copy)
+		{
+			$newname = doSlash(trim(preg_replace('/[<>&"\']/', '', gps('newname'))));
+
+			if ($newname and safe_field('name', 'txp_css', "name = '$newname'"))
+			{
+				$message = gTxt('css_already_exists', array('{name}' => $newname));
+			}
+			elseif ($newname) 
+			{
+				safe_insert('txp_css', "name = '".$newname."', css = '$css'");
+
+				$message = gTxt('css_created', array('{name}' => $newname));
+			}
+			else
+			{
+				$message = gTxt('css_name_required');
+			}
+
+			css_edit($message);
+		}
+
+		else
+		{
+			safe_update('txp_css', "css = '$css'", "name = '".doSlash($name)."'");
+
+			$message = gTxt('css_updated', array('{name}' => $name));
+
+			css_edit($message);
+		}
+	}
+
+// -------------------------------------------------------------
+	function css_format($css,$out='')
+	{
+		foreach ($css as $selector => $propvals) {
+			$out .= n.$selector.n.'{'.n;
+			foreach($propvals as $prop=>$val) {
+				$out .= t.$prop.': '.$val.';'.n;
+			}
+			$out .= '}'.n;
+		}
+		return trim($out);
+	}
+	
+// -------------------------------------------------------------
+	function addSel($css)
+	{
+		$selector = gps('selector');
+		$css[$selector][' '] = '';
+		return $css;
+	}
+
+// -------------------------------------------------------------
+	function add_declaration($css)
+	{
+		$selector = gps('selector');
+		$css[$selector][' '] = '';
+		return $css;
+	}
+
+// -------------------------------------------------------------
+	function delete_declaration($css) 
+	{
+		$thedec = gps('declaration');
+		$name = gps('name');
+		$i = 0;
+		foreach($css as $a=>$b) {
+			$cursel = $i++;
+			$ii = 0;		
+			foreach($b as $c=>$d) {
+				$curdec = $ii++;
+				if(($cursel.'-'.$curdec)!=$thedec) {
+					$out[$a][$c]=$d;
+				}
+			}
+ 		}
+		$css = base64_encode(css_format($out));
+		safe_update("txp_css", "css='".doSlash($css)."'", "name='".doSlash($name)."'");
+		return parseCSS(base64_decode(fetch('css','txp_css','name',$name)));
+	}
+
+//-------------------------------------------------------------
+	function css_delete()
+	{
+		$name = ps('name');
+
+		if ($name != 'default')
+		{
+			safe_delete('txp_css', "name = '".doSlash($name)."'");
+
+			css_edit(
+				gTxt('css_deleted', array('{name}' => $name))
+			);
+		}
+
+		else
+		{
+			echo gTxt('cannot_delete_default_css').'.';
+		}
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_diag.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_diag.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_diag.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,502 @@
+<?php
+
+/*
+	This is Textpattern
+ 
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_diag.php $
+$LastChangedRevision: 1902 $
+
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+//-------------------------------------------------------------
+
+	define("cs",': ');
+	define("ln",str_repeat('-', 24).n);
+
+	global $files;
+	
+	$files = array(
+		'/include/txp_category.php',
+		'/include/txp_plugin.php',
+		'/include/txp_auth.php',
+		'/include/txp_form.php',
+		'/include/txp_section.php',
+		'/include/txp_tag.php',
+		'/include/txp_list.php',
+		'/include/txp_page.php',
+		'/include/txp_discuss.php',
+		'/include/txp_prefs.php',
+		'/include/txp_log.php',
+		'/include/txp_preview.php',
+		'/include/txp_image.php',
+		'/include/txp_article.php',
+		'/include/txp_css.php',
+		'/include/txp_admin.php',
+		'/include/txp_link.php',
+		'/include/txp_diag.php',
+		'/include/txp_file.php',
+		'/include/txp_import.php',
+		'/lib/admin_config.php',
+		'/lib/txplib_misc.php',
+		'/lib/taglib.php',
+		'/lib/txplib_head.php',
+		'/lib/classTextile.php',
+		'/lib/txplib_html.php',
+		'/lib/txplib_db.php',
+		'/lib/IXRClass.php',
+		'/lib/txplib_forms.php',
+		'/lib/class.thumb.php',
+		'/lib/constants.php',
+		'/lib/txplib_update.php',
+		'/lib/txplib_wrapper.php',
+		'/publish/taghandlers.php',
+		'/publish/atom.php',
+		'/publish/log.php',
+		'/publish/comment.php',
+		'/publish/search.php',
+		'/publish/rss.php',
+		'/publish.php',
+		'/index.php',
+		'/css.php',
+	);
+
+	if ($event == 'diag') {
+		require_privs('diag');
+
+		$step = gps('step');
+		doDiagnostics();
+	}
+
+
+	function apache_module($m) {
+		$modules = apache_get_modules();
+		return in_array($m, $modules);
+	}
+
+	function test_tempdir($dir) {
+		$f = realpath(tempnam($dir, 'txp_'));
+		if (is_file($f)) {
+			@unlink($f);
+			return true;
+		}
+	}
+
+	function list_txp_tables() {
+		$table_names = array(PFX.'textpattern');
+		$rows = getRows("SHOW TABLES LIKE '".PFX."txp\_%'");
+		foreach ($rows as $row)
+			$table_names[] = array_shift($row);
+		return $table_names;
+	}
+
+	function check_tables($tables, $type='FAST', $warnings=0) {
+		$msgs = array();
+		foreach ($tables as $table) {
+			$rs = getRows("CHECK TABLE $table $type");
+			if ($rs) {
+				foreach ($rs as $r)
+					if ($r['Msg_type'] != 'status' and ($warnings or $r['Msg_type'] != 'warning'))
+						$msgs[] = $table.cs.$r['Msg_type'].cs.$r['Msg_text'];
+			}
+		}
+		return $msgs;
+	}
+
+	function doDiagnostics()
+	{
+		global $files, $txpcfg, $step;
+		extract(get_prefs());
+		
+	$urlparts = parse_url(hu);
+	$mydomain = $urlparts['host'];
+	$server_software = (@$_SERVER['SERVER_SOFTWARE'] || @$_SERVER['HTTP_HOST']) 
+						? ( (@$_SERVER['SERVER_SOFTWARE']) ?  @$_SERVER['SERVER_SOFTWARE'] :  $_SERVER['HTTP_HOST'] )
+						: '';
+	$is_apache = ($server_software and stristr($server_software, 'Apache')) 
+				   or (is_callable('apache_get_version'));
+	$real_doc_root = (isset($_SERVER['DOCUMENT_ROOT'])) ? realpath($_SERVER['DOCUMENT_ROOT']) : '';
+	
+	// ini_get() returns string values passed via php_value as a string, not boolean
+	$is_register_globals = ( (strcasecmp(ini_get('register_globals'),'on')===0) or (ini_get('register_globals')==='1'));
+
+	$fail = array(
+
+		'php_version_4_3_0_required' =>
+		(!is_callable('version_compare') or version_compare(PHP_VERSION, '4.3.0', '<'))
+		? gTxt('php_version_4_3_0_required')
+		: '',
+
+		'path_to_site_missing' =>
+		(!isset($path_to_site))
+		? gTxt('path_to_site_missing')
+		: '',
+
+		'dns_lookup_fails' =>	
+		(@gethostbyname($mydomain) == $mydomain)
+		?	gTxt('dns_lookup_fails').cs. $mydomain
+		:	'',
+
+		'path_to_site_inacc' =>
+		(!@is_dir($path_to_site))
+		?	gTxt('path_to_site_inacc').cs.$path_to_site
+		: 	'',
+
+		'site_trailing_slash' =>
+		(rtrim($siteurl, '/') != $siteurl)
+		?	gTxt('site_trailing_slash').cs.$path_to_site
+		:	'',
+
+		'index_inaccessible' =>
+		(!@is_file($path_to_site."/index.php") or !@is_readable($path_to_site."/index.php"))
+		?	"{$path_to_site}/index.php ".gTxt('is_inaccessible')
+		:	'',
+
+		'dir_not_writable' =>
+		trim(
+			((!@is_writable($path_to_site.'/'.$img_dir))
+			?	str_replace('{dirtype}', gTxt('img_dir'), gTxt('dir_not_writable')).": {$path_to_site}/{$img_dir}\r\n"
+			:	'').
+			((!@is_writable($file_base_path))
+			?	str_replace('{dirtype}', gTxt('file_base_path'), gTxt('dir_not_writable')).": {$file_base_path}\r\n"
+			:	'').
+			((!@is_writable($tempdir))
+			?	str_replace('{dirtype}', gTxt('tempdir'), gTxt('dir_not_writable')).": {$tempdir}\r\n"
+			:	'')),
+
+		'cleanurl_only_apache' =>
+		($permlink_mode != 'messy' and !$is_apache )
+		? gTxt('cleanurl_only_apache')
+		: '',
+
+//		'htaccess_missing' =>	
+//		($permlink_mode != 'messy' and !@is_readable($path_to_site.'/.htaccess'))
+//		?	gTxt('htaccess_missing')
+//		:	'',
+
+		'mod_rewrite_missing' =>
+		($permlink_mode != 'messy' and is_callable('apache_get_modules') and !apache_module('mod_rewrite'))
+		? gTxt('mod_rewrite_missing')
+		: '',
+
+		'file_uploads_disabled' =>
+		(!ini_get('file_uploads'))
+		?	gTxt('file_uploads_disabled')
+		:	'',
+
+		'setup_still_exists' =>
+		(@is_dir(txpath . DS. 'setup'))
+		?	txpath.DS."setup".DS.' '.gTxt('still_exists')
+		:	'',
+
+		'no_temp_dir' =>
+		(empty($tempdir))
+		? gTxt('no_temp_dir')
+		: '',
+
+		'warn_mail_unavailable' =>
+		(!is_callable('mail'))
+		? gTxt('warn_mail_unavailable')
+		: '',
+
+		'warn_register_globals_or_update' =>
+		( $is_register_globals && 
+		  (    version_compare(phpversion(),'4.4.0','<=') 
+			or ( version_compare(phpversion(),'5.0.0','>=') and version_compare(phpversion(),'5.0.5','<=') )
+		))
+		? gTxt('warn_register_globals_or_update')
+		: '',
+
+	);
+
+	if ($permlink_mode != 'messy') {
+		$rs = safe_column("name","txp_section", "1");
+		foreach ($rs as $name) {
+			if ($name and @file_exists($path_to_site.'/'.$name))
+				$fail['old_placeholder_exists'] = gTxt('old_placeholder').": {$path_to_site}/{$name}";
+		}
+	}
+
+	$missing = array();
+	foreach ($files as $f) {
+		if (!is_readable(txpath . $f))
+			$missing[] = txpath . $f;
+	}
+
+	if ($missing)
+		$fail['missing_files'] = gTxt('missing_files').cs.join(', ', $missing);
+
+
+	foreach ($fail as $k=>$v)
+		if (empty($v)) unset($fail[$k]);
+
+	# Find the highest revision number
+	$file_revs = array();
+	$rev = 0;
+	foreach ($files as $f) {
+		$lines = @file(txpath . $f);
+		if ($lines) {
+			foreach ($lines as $line) {
+				if (preg_match('/^\$'.'LastChangedRevision: (\w+) \$/', $line, $match)) {
+					$file_revs[$f] = $match[1];
+					if (intval($match[1]) > $rev)
+						$rev = intval($match[1]);
+				}
+			}
+		}
+	}
+
+	# Check revs & md5 against stable release, if possible
+	$dev_files = $old_files = $modified_files = array();
+	if ($cs = @file(txpath.'/checksums.txt')) {
+		foreach ($cs as $c) {
+			if (preg_match('@^(\S+): r?(\S+) \((.*)\)$@', trim($c), $m)) {
+				list(,$file,$r,$md5) = $m;
+				if (!empty($file_revs[$file]) and $r and $file_revs[$file] < $r) {
+					$old_files[] = $file;
+				}
+				elseif (!empty($file_revs[$file]) and $r and $file_revs[$file] > $r) {
+					$dev_files[] = $file;
+				}
+				elseif (@is_readable(txpath . $file) and ($sum=md5_file(txpath . $file)) != $md5) {
+					$modified_files[] = $file;
+				}
+			}
+		}
+	}
+
+	# files that haven't been updated
+	if ($old_files)
+		$fail['old_files'] = gTxt('old_files').cs.join(', '.n.t, $old_files);
+
+	# files that don't match their checksums
+	if ($modified_files)
+		$fail['modified_files'] = gTxt('modified_files').cs.join(', '.n.t, $modified_files);
+
+	# running development code in live mode is not recommended
+	if ($dev_files and $production_status == 'live')
+		$fail['dev_version_live'] = gTxt('dev_version_live').cs.join(', '.n.t, $dev_files);
+
+	# anything might break if arbitrary functions are disabled
+	if (ini_get('disable_functions')) {
+		$disabled_funcs = explode(',', ini_get('disable_functions'));
+		# commonly disabled functions taht we don't need
+		$disabled_funcs = array_diff($disabled_funcs, array(
+			'imagefilltoborder',
+			'exec',
+			'system',
+			'dl',
+			'passthru',
+			'chown',
+			'shell_exec',
+			'popen',
+			'proc_open',
+		));
+		if ($disabled_funcs)
+			$fail['some_php_functions_disabled'] = gTxt('some_php_functions_disabled').cs.ini_get('disable_functions');
+	}
+
+	# not sure about this one
+	#if (strncmp(php_sapi_name(), 'cgi', 3) == 0 and ini_get('cgi.rfc2616_headers'))
+	#	$fail['cgi_header_config'] = gTxt('cgi_header_config');
+
+	$guess_site_url = $_SERVER['HTTP_HOST'] . preg_replace('#[/\\\\]$#','',dirname(dirname($_SERVER['SCRIPT_NAME'])));
+	if ($siteurl and strip_prefix($siteurl, 'www.') != strip_prefix($guess_site_url, 'www.'))
+		$fail['site_url_mismatch'] = gTxt('site_url_mismatch').cs.$guess_site_url;
+		
+	# test clean URL server vars
+	if (hu) {
+		if (ini_get('allow_url_fopen') and ($permlink_mode != 'messy')) {
+			$s = md5(uniqid(rand(), true));
+			$pretext_data = @file(hu.$s.'/?txpcleantest=1');
+			if ($pretext_data) {
+				$pretext_req = trim(@$pretext_data[0]);
+				if ($pretext_req != '/'.$s.'/?txpcleantest=1')
+					$fail['clean_url_data_failed'] = gTxt('clean_url_data_failed').cs.htmlspecialchars($pretext_req);
+			}
+			else
+				$fail['clean_url_test_failed'] = gTxt('clean_url_test_failed');
+		}
+	}
+
+	if ($tables = list_txp_tables()) {
+		$table_errors = check_tables($tables);
+		if ($table_errors)
+			$fail['mysql_table_errors'] = gTxt('mysql_table_errors').cs.join(', '.n.t, $table_errors);
+	}
+
+	$active_plugins = array();
+	if ($rows = safe_rows('name, version, code_md5, md5(code) as md5', 'txp_plugin', 'status > 0')) {
+		foreach ($rows as $row) {
+			$n = $row['name'].'-'.$row['version'];
+			if (strtolower($row['md5']) != strtolower($row['code_md5']))
+				$n .= 'm';
+			$active_plugins[] = $n;
+		}
+	}
+
+	echo 
+	pagetop(gTxt('tab_diagnostics'),''),
+	startTable('list'),
+	tr(td(hed(gTxt('preflight_check'),1)));
+
+
+	if ($fail) {
+		foreach ($fail as $help => $message)
+			echo tr(tda(nl2br($message).sp.popHelp($help), ' class="not-ok"'));
+	}
+	else {
+		echo tr(tda(gTxt('all_checks_passed'), ' class="ok"'));
+	}
+
+	echo tr(td(hed(gTxt('diagnostic_info'),1)));
+
+
+	$fmt_date = '%Y-%m-%d %H:%M:%S';
+	
+	$out = array(
+		'<textarea cols="78" rows="18" readonly="readonly" style="width: 500px; height: 300px;">',
+
+		gTxt('txp_version').cs.txp_version.' ('.($rev ? 'r'.$rev : 'unknown revision').')'.n,
+
+		gTxt('last_update').cs.gmstrftime($fmt_date, $dbupdatetime).'/'.gmstrftime($fmt_date, @filemtime(txpath.'/update/_update.php')).n,
+
+		gTxt('document_root').cs.@$_SERVER['DOCUMENT_ROOT']. (($real_doc_root != @$_SERVER['DOCUMENT_ROOT']) ? ' ('.$real_doc_root.')' : '') .n,
+
+		'$path_to_site'.cs.$path_to_site.n,
+
+		gTxt('txp_path').cs.txpath.n,
+
+		gTxt('permlink_mode').cs.$permlink_mode.n,
+
+		(ini_get('open_basedir')) ? 'open_basedir: '.ini_get('open_basedir').n : '',
+
+		(ini_get('upload_tmp_dir')) ? 'upload_tmp_dir: '.ini_get('upload_tmp_dir').n : '',
+
+		gTxt('tempdir').cs.$tempdir.n,
+
+		gTxt('web_domain').cs.$siteurl.n,
+
+		(getenv('TZ')) ? 'TZ: '.getenv('TZ').n : '',
+
+		gTxt('php_version').cs.phpversion().n,
+
+		($is_register_globals) ? gTxt('register_globals').cs.$is_register_globals.n : '',
+
+		gTxt('server_time').cs.strftime('%Y-%m-%d %H:%M:%S').n,
+
+		'MySQL'.cs.mysql_get_server_info().n,
+
+		gTxt('locale').cs.$locale.n,
+
+		(isset($_SERVER['SERVER_SOFTWARE'])) ? gTxt('server').cs.$_SERVER['SERVER_SOFTWARE'].n : '',
+
+		(is_callable('apache_get_version')) ? gTxt('apache_version').cs.apache_get_version().n : '',
+
+		gTxt('php_sapi_mode').cs.php_sapi_name().n,
+
+		gTxt('rfc2616_headers').cs.ini_get('cgi.rfc2616_headers').n,
+
+		gTxt('os_version').cs.php_uname('s').' '.php_uname('r').n,
+
+		($active_plugins ? gTxt('active_plugins').cs.join(', ', $active_plugins).n : ''),
+
+		$fail
+		? n.gTxt('preflight_check').cs.n.ln.join("\n", $fail).n.ln
+		: '',
+
+		(is_readable($path_to_site.'/.htaccess'))
+		?	n.gTxt('htaccess_contents').cs.n.ln.htmlspecialchars(join('',file($path_to_site.'/.htaccess'))).n.ln
+		:	''
+	);
+
+	if ($step == 'high') {
+		$mysql_client_encoding = (is_callable('mysql_client_encoding')) ? mysql_client_encoding() : '-';
+		$out[] = n.'Charset (default/config)'.cs.$mysql_client_encoding.'/'.@$txpcfg['dbcharset'].n;
+
+		$result = safe_query("SHOW variables like 'character_se%'");
+		while ($row = mysql_fetch_row($result))
+		{
+			$out[] = $row[0].cs.$row[1].n;
+			if ($row[0] == 'character_set_connection') $conn_char = $row[1];
+		}
+
+		$table_names = array(PFX.'textpattern');
+		$result = safe_query("SHOW TABLES LIKE '".PFX."txp\_%'");
+		while ($row = mysql_fetch_row($result))
+		{
+			$table_names[] = $row[0];
+		}
+		$table_msg = array();
+		foreach ($table_names as $table)
+		{
+			$ctr = safe_query("SHOW CREATE TABLE ". $table."");
+			if (!$ctr)
+			{
+				unset($table_names[$table]);
+				continue;
+			}
+			$ctcharset = preg_replace('#^CREATE TABLE.*SET=([^ ]+)[^)]*$#is','\\1',mysql_result($ctr,0,'Create Table'));
+			if (isset($conn_char) && !stristr($ctcharset,'CREATE') && ($conn_char != $ctcharset))
+				$table_msg[] = "$table is $ctcharset";
+			$ctr = safe_query("CHECK TABLE ". $table);
+			if (in_array(mysql_result($ctr,0,'Msg_type'), array('error','warning')) )
+				$table_msg[] = $table .cs. mysql_result($ctr,0,'Msg_Text');
+		}
+		if ($table_msg == array())
+			$table_msg = (count($table_names) < 18) ?  array('-') : array('OK');
+		$out[] = count($table_names).' Tables'.cs. implode(', ',$table_msg).n;
+
+		$extns = get_loaded_extensions();
+		$extv = array();
+		foreach ($extns as $e) {
+			$extv[] = $e . (phpversion($e) ? '/' . phpversion($e) : '');
+		}
+		$out[] = n.gTxt('php_extensions').cs.join(', ', $extv).n;
+
+		if (is_callable('apache_get_modules'))
+			$out[] = n.gTxt('apache_modules').cs.join(', ', apache_get_modules()).n.n;
+			
+		if (@is_array($pretext_data)) {
+			$out[] = n.gTxt('pretext_data').cs.htmlspecialchars(join('', array_slice($pretext_data, 1, 20))).n.n;
+		}
+
+		foreach ($files as $f) {
+			$rev = '';
+			$checksum = '';
+
+			if (is_callable('md5_file')) {
+				$checksum = md5_file(txpath . $f);
+			}
+
+			if (isset($file_revs[$f]))
+				$rev = $file_revs[$f];
+
+			$out[] = "$f" .cs. ($rev ? "r".$rev : gTxt('unknown')).' ('.($checksum ? $checksum : gTxt('unknown')).')'.n;
+		}
+	}
+
+	$out[] = '</textarea>'.br;
+	
+	$dets = array('low'=>gTxt('low'),'high'=>gTxt('high'));
+	
+	$out[] = 
+		form(
+			eInput('diag').n.
+			gTxt('detail').cs.
+			selectInput('step', $dets, $step, 0, 1)
+		);
+
+	echo tr(td(join('',$out))),
+
+	endTable();
+	}
+	
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_discuss.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_discuss.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_discuss.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,651 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_discuss.php $
+$LastChangedRevision: 1909 $
+
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	if ($event == 'discuss') {
+		require_privs('discuss');
+
+		if(!$step or !in_array($step, array('discuss_delete','discuss_save','discuss_list','discuss_edit','ipban_add','discuss_multi_edit','ipban_list','ipban_unban','discuss_change_pageby'))){
+			discuss_list();
+		} else $step();
+	}
+
+//-------------------------------------------------------------
+	function discuss_save()
+	{
+		extract(doSlash(gpsa(array('email','name','web','message','ip'))));
+		extract(array_map('assert_int',gpsa(array('discussid','visible','parentid'))));
+		safe_update("txp_discuss",
+			"email   = '$email',
+			 name    = '$name',
+			 web     = '$web',
+			 message = '$message',
+			 visible = $visible",
+			"discussid = $discussid");
+		update_comments_count($parentid);
+		update_lastmod();
+
+		$message = gTxt('comment_updated', array('{id}' => $discussid));
+
+		discuss_list($message);
+	}
+
+//-------------------------------------------------------------
+
+	function short_preview($message)
+	{
+		$message = strip_tags($message);
+		$offset = min(150, strlen($message));
+
+		if (strpos($message, ' ', $offset) !== false)
+		{
+			$maxpos = strpos($message,' ',$offset);
+			$message = substr($message, 0, $maxpos).'&#8230;';
+		}
+
+		return $message;
+	}
+
+//-------------------------------------------------------------
+
+	function discuss_list($message = '')
+	{
+		pagetop(gTxt('list_discussions'), $message);
+
+		echo graf(
+			'<a href="index.php?event=discuss'.a.'step=ipban_list">'.gTxt('list_banned_ips').'</a>'
+		, ' style="text-align: center;"');
+
+		extract(get_prefs());
+
+		extract(gpsa(array('sort', 'dir', 'page', 'crit', 'search_method')));
+
+		$dir = ($dir == 'desc') ? 'desc' : 'asc';
+
+		switch ($sort)
+		{
+			case 'id':
+				$sort_sql = 'discussid '.$dir;
+			break;
+
+			case 'date':
+				$sort_sql = 'posted '.$dir;
+			break;
+
+			case 'ip':
+				$sort_sql = 'ip '.$dir.', posted asc';
+			break;
+
+			case 'name':
+				$sort_sql = 'name '.$dir.', posted asc';
+			break;
+
+			case 'email':
+				$sort_sql = 'email '.$dir.', posted asc';
+			break;
+
+			case 'website':
+				$sort_sql = 'web '.$dir.', posted asc';
+			break;
+
+			case 'message':
+				$sort_sql = 'message '.$dir.', posted asc';
+			break;
+
+			case 'parent':
+				$sort_sql = 'parentid '.$dir.', posted asc';
+			break;
+
+			default:
+				$dir = 'desc';
+				$sort_sql = 'posted '.$dir;
+			break;
+		}
+
+		$switch_dir = ($dir == 'desc') ? 'asc' : 'desc';
+
+		$criteria = 1;
+
+		if ($search_method and $crit)
+		{
+			$crit_escaped = doSlash($crit);
+
+			$critsql = array(
+				'id'			=> "discussid = '$crit_escaped'",
+				'parent'  => "parentid = '$crit_escaped'",
+				'name'		=> "name like '%$crit_escaped%'",
+				'message' => "message like '%$crit_escaped%'",
+				'email'		=> "email like '%$crit_escaped%'",
+				'website' => "web like '%$crit_escaped%'",
+				'ip'			=> "ip like %$crit_escaped%",
+			);
+
+			if (array_key_exists($search_method, $critsql))
+			{
+				$criteria = $critsql[$search_method];
+				$limit = 500;
+			}
+
+			else
+			{
+				$search_method = '';
+				$crit = '';
+			}
+		}
+
+		else
+		{
+			$search_method = '';
+			$crit = '';
+		}
+
+		$total = safe_count('txp_discuss', "$criteria");
+
+		if ($total < 1)
+		{
+			if ($criteria != 1)
+			{
+				echo n.discuss_search_form($crit, $search_method).
+					n.graf(gTxt('no_results_found'), ' style="text-align: center;"');
+			}
+
+			else
+			{
+				echo graf(gTxt('no_comments_recorded'), ' style="text-align: center;"');
+			}
+
+			return;
+		}
+
+		$limit = max(@$comment_list_pageby, 15);
+
+		list($page, $offset, $numPages) = pager($total, $limit, $page);
+
+		echo discuss_search_form($crit, $search_method);
+
+		$rs = safe_rows_start('*, unix_timestamp(posted) as uPosted', 'txp_discuss', 
+			"$criteria order by $sort_sql limit $offset, $limit");
+
+		if ($rs)
+		{
+			echo n.n.'<form name="longform" method="post" action="index.php" onsubmit="return verify(\''.gTxt('are_you_sure').'\')">'.
+
+				n.startTable('list','','','','90%').
+
+				n.n.tr(
+					column_head('ID', 'id', 'discuss', true, $switch_dir, $crit, $search_method).
+					column_head('date', 'date', 'discuss', true, $switch_dir, $crit, $search_method).
+					column_head('name', 'name', 'discuss', true, $switch_dir, $crit, $search_method).
+					column_head('message', 'message', 'discuss', true, $switch_dir, $crit, $search_method).
+					column_multi_head( array(
+						array ('value' => 'email', 'sort' => 'email', 'event' => 'discuss','is_link' => true,
+							    'dir' => $switch_dir, 'crit' => $crit, 'method' => $search_method),
+						array ('value' => 'website', 'sort' => 'website', 'event' => 'discuss','is_link' => true,
+							    'dir' => $switch_dir, 'crit' => $crit, 'method' => $search_method),
+						array ('value' => 'IP', 'sort' => 'ip', 'event' => 'discuss','is_link' => true,
+							    'dir' => $switch_dir, 'crit' => $crit, 'method' => $search_method)
+					), 'discuss_detail').
+					column_head('status', 'status', 'discuss', true, $switch_dir, $crit, $search_method, 'discuss_detail').
+					column_head('parent', 'parent', 'discuss', true, $switch_dir, $crit, $search_method).
+					hCell()
+				);
+
+			include_once txpath.'/publish/taghandlers.php';
+
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+				$parentid = assert_int($parentid);
+
+				$tq = safe_row('*, ID as thisid, unix_timestamp(Posted) as posted', 'textpattern', "ID = $parentid");
+
+				$edit_url = '?event=discuss'.a.'step=discuss_edit'.a.'discussid='.$discussid.a.'sort='.$sort.
+					a.'dir='.$dir.a.'page='.$page.a.'search_method='.$search_method.a.'crit='.$crit;
+
+				$dmessage = ($visible == SPAM) ? short_preview($message) : $message;
+
+				switch ($visible)
+				{
+					case VISIBLE:
+						$comment_status = gTxt('visible');
+						$row_class = 'visible';
+					break;
+
+					case SPAM:
+						$comment_status = gTxt('spam');
+						$row_class = 'spam';
+					break;
+
+					case MODERATE:
+						$comment_status = gTxt('unmoderated');
+						$row_class = 'moderate';
+					break;
+
+					default:
+					break;
+				}
+
+				if (empty($tq))
+				{
+					$parent = gTxt('article_deleted').' ('.$parentid.')';
+					$view = '';
+				}
+
+				else
+				{
+					$parent_title = empty($tq['Title']) ? '<em>'.gTxt('untitled').'</em>' : $tq['Title'];
+
+					$parent = href($parent_title, '?event=list'.a.'step=list'.a.'search_method=id'.a.'crit='.$tq['ID']);
+
+					$view = '';
+
+					if ($visible == VISIBLE and in_array($tq['Status'], array(4,5)))
+					{
+						$view = n.t.'<li><a href="'.permlinkurl($tq).'#c'.$discussid.'">'.gTxt('view').'</a></li>';
+					}
+				}
+
+				echo n.n.tr(
+
+					n.td('<a href="'.$edit_url.'">'.$discussid.'</a>'.
+						n.'<ul class="discuss_detail">'.
+						n.t.'<li><a href="'.$edit_url.'">'.gTxt('edit').'</a></li>'.
+						$view.
+						n.'</ul>'
+					, 50).
+
+					td(
+						safe_strftime('%d %b %Y %I:%M %p', $uPosted), 140
+					).
+
+					td($name, 75).
+
+					td(
+						short_preview($dmessage)
+					).
+
+					td("<ul><li>".soft_wrap($email, 30)."</li><li>".soft_wrap($web, 30)."</li><li>$ip</li></ul>", 100, 'discuss_detail').
+					td($comment_status, 75, 'discuss_detail').
+					td($parent, 75).
+
+					td(
+						fInput('checkbox', 'selected[]', $discussid)
+					, 20)
+
+				, ' class="'.$row_class.'"');
+			}
+
+			echo tr(
+				tda(
+					toggle_box('discuss_detail'),
+					' colspan="2" style="text-align: left; border: none;"'
+				).
+				tda(
+					select_buttons().
+					discuss_multiedit_form($page, $sort, $dir, $crit, $search_method)
+				, ' colspan="9" style="text-align: right; border: none;"')
+			).
+
+			endTable().
+			'</form>'.
+
+			nav_form('discuss', $page, $numPages, $sort, $dir, $crit, $search_method).
+
+			pageby_form('discuss', $comment_list_pageby);
+		}
+	}
+
+//-------------------------------------------------------------
+
+	function discuss_search_form($crit, $method)
+	{
+		$methods =	array(
+			'id'			=> gTxt('ID'),
+			'parent'  => gTxt('parent'),
+			'name'		=> gTxt('name'),
+			'message' => gTxt('message'),
+			'email'		=> gTxt('email'),
+			'website' => gTxt('website'),
+			'ip'			=> gTxt('IP')
+		);
+
+		return search_form('discuss', 'list', $crit, $methods, $method, 'message');
+	}
+
+//-------------------------------------------------------------
+
+	function discuss_edit()
+	{
+		pagetop(gTxt('edit_comment'));
+
+		extract(gpsa(array('discussid', 'sort', 'dir', 'page', 'crit', 'search_method')));
+
+		$discussid = assert_int($discussid);
+
+		$rs = safe_row('*, unix_timestamp(posted) as uPosted', 'txp_discuss', "discussid = $discussid");
+
+		if ($rs)
+		{
+			extract($rs);
+
+			$message = preg_replace(
+				array('/</', '/>/'), 
+				array('&lt;', '&gt;')
+			, $message);
+
+			if (fetch('ip', 'txp_discuss_ipban', 'ip', $ip))
+			{
+				$ban_step = 'ipban_unban';
+				$ban_text = gTxt('unban');
+			}
+
+			else
+			{
+				$ban_step = 'ipban_add';
+				$ban_text = gTxt('ban');
+			}
+
+			$ban_link = '[<a href="?event=discuss'.a.'step='.$ban_step.a.'ip='.$ip.
+				a.'name='.urlencode($name).a.'discussid='.$discussid.'">'.$ban_text.'</a>]';
+
+			echo form(
+				startTable('edit').
+				stackRows(
+
+					fLabelCell('name').
+					fInputCell('name', $name),
+
+					fLabelCell('IP').
+					td("$ip $ban_link"),
+
+					fLabelCell('email').
+					fInputCell('email', $email),
+
+					fLabelCell('website').
+					fInputCell('web', $web),
+
+					fLabelCell('date').
+					td(
+						safe_strftime('%d %b %Y %I:%M:%S %p', $uPosted)
+					),
+
+					tda(gTxt('message')).
+					td(
+						'<textarea name="message" cols="60" rows="15">'.$message.'</textarea>'
+					),
+
+					fLabelCell('status').
+					td(
+						selectInput('visible', array(
+							VISIBLE	 => gTxt('visible'),
+							SPAM		 => gTxt('spam'),
+							MODERATE => gTxt('unmoderated')
+						), $visible, false)
+					),
+
+					td().td(fInput('submit', 'step', gTxt('save'), 'publish')),
+
+					hInput('sort', $sort).
+					hInput('dir', $dir).
+					hInput('page', $page).
+					hInput('crit', $crit).
+					hInput('search_method', $search_method).
+
+					hInput('discussid', $discussid).
+					hInput('parentid', $parentid).
+					hInput('ip', $ip).
+
+					eInput('discuss').
+					sInput('discuss_save')
+				).
+
+				endTable()
+			);
+		}
+
+		else
+		{
+			echo graf(gTxt('comment_not_found'),' style="text-align: center;"');
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function ipban_add() 
+	{
+		extract(gpsa(array('ip', 'name', 'discussid')));
+		$discussid = assert_int($discussid);
+
+		if (!$ip)
+		{
+			return ipban_list(gTxt('cant_ban_blank_ip'));
+		}
+
+		$ban_exists = fetch('ip', 'txp_discuss_ipban', 'ip', $ip);
+
+		if ($ban_exists)
+		{
+			$message = gTxt('ip_already_banned', array('{ip}' => $ip));
+
+			return ipban_list($message);
+		}
+
+		$rs = safe_insert('txp_discuss_ipban', "
+			ip = '".doSlash($ip)."', 
+			name_used = '".doSlash($name)."', 
+			banned_on_message = $discussid, 
+			date_banned = now()
+		");
+
+		// hide all messages from that IP also
+		if ($rs)
+		{
+			safe_update('txp_discuss', "visible = ".SPAM, "ip = '".doSlash($ip)."'");
+
+			$message = gTxt('ip_banned', array('{ip}' => $ip));
+
+			return ipban_list($message);
+		}
+
+		ipban_list();
+	}
+
+// -------------------------------------------------------------
+
+	function ipban_unban()
+	{
+		$ip = doSlash(gps('ip'));
+
+		$rs = safe_delete('txp_discuss_ipban', "ip = '$ip'");
+
+		if ($rs)
+		{
+			$message = gTxt('ip_ban_removed', array('{ip}' => $ip));
+
+			ipban_list($message);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function ipban_list($message = '')
+	{
+		pageTop(gTxt('list_banned_ips'), $message);
+
+		$rs = safe_rows_start('*, unix_timestamp(date_banned) as uBanned', 'txp_discuss_ipban', 
+			"1 = 1 order by date_banned desc");
+
+		if ($rs and numRows($rs) > 0)
+		{
+			echo startTable('list').
+				tr(
+					hCell(gTxt('date_banned')).
+					hCell(gTxt('IP')).
+					hCell(gTxt('name_used')).
+					hCell(gTxt('banned_for')).
+					td()
+				);
+
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				echo tr(
+					td(
+						safe_strftime('%d %b %Y %I:%M %p', $uBanned)
+					, 100).
+
+					td(
+						$ip
+					, 100).
+
+					td(
+						$name_used
+					, 100).
+
+					td(
+						'<a href="?event=discuss'.a.'step=discuss_edit'.a.'discussid='.$banned_on_message.'">'.
+							$banned_on_message.'</a>'
+					, 100).
+
+					td(
+						'<a href="?event=discuss'.a.'step=ipban_unban'.a.'ip='.$ip.'">'.gTxt('unban').'</a>'
+					)
+				);
+			}
+
+			echo endTable();
+		}
+
+		else
+		{
+			echo graf(gTxt('no_ips_banned'),' style="text-align: center;"');
+		}
+	}
+
+// -------------------------------------------------------------
+	function discuss_change_pageby() 
+	{
+		event_change_pageby('comment');
+		discuss_list();
+	}
+
+// -------------------------------------------------------------
+
+	function discuss_multiedit_form($page, $sort, $dir, $crit, $search_method) 
+	{
+		$methods = array(
+			'visible'     => gTxt('show'),
+			'unmoderated' => gTxt('hide_unmoderated'),
+			'spam'        => gTxt('hide_spam'),
+			'ban'         => gTxt('ban_author'),
+			'delete'      => gTxt('delete'),
+		);
+
+		return event_multiedit_form('discuss', $methods, $page, $sort, $dir, $crit, $search_method);
+	}
+
+// -------------------------------------------------------------
+	function discuss_multi_edit() 
+	{
+		//FIXME, this method needs some refactoring
+		
+		$selected = ps('selected');
+		$method = ps('edit_method');
+		$done = array();
+		if ($selected) {
+			// Get all articles for which we have to update the count
+			foreach($selected as $id)
+				$ids[] = assert_int($id);
+			$parentids = safe_column("DISTINCT parentid","txp_discuss","discussid IN (".implode(',',$ids).")");
+
+			$rs = safe_rows_start('*', 'txp_discuss', "discussid IN (".implode(',',$ids).")");
+			while ($row = nextRow($rs)) {
+				extract($row);
+				$id = assert_int($discussid);
+				$parentids[] = $parentid;
+
+				if ($method == 'delete') {
+					// Delete and if succesful update commnet count 
+					if (safe_delete('txp_discuss', "discussid = $id"))
+						$done[] = $id;
+				}
+				elseif ($method == 'ban') {
+					// Ban the IP and hide all messages by that IP
+					if (!safe_field('ip', 'txp_discuss_ipban', "ip='".doSlash($ip)."'")) {
+						safe_insert("txp_discuss_ipban",
+							"ip = '".doSlash($ip)."',
+							name_used = '".doSlash($name)."',
+							banned_on_message = $id,
+							date_banned = now()
+						");
+						safe_update('txp_discuss',
+							"visible = ".SPAM,
+							"ip='".doSlash($ip)."'"
+						);
+					}
+					$done[] = $id;
+				}
+				elseif ($method == 'spam') {
+						if (safe_update('txp_discuss',
+							"visible = ".SPAM,
+							"discussid = $id"
+						))
+							$done[] = $id;
+				}
+				elseif ($method == 'unmoderated') {
+						if (safe_update('txp_discuss',
+							"visible = ".MODERATE,
+							"discussid = $id"
+						))
+							$done[] = $id;
+				}
+				elseif ($method == 'visible') {
+						if (safe_update('txp_discuss',
+							"visible = ".VISIBLE,
+							"discussid = $id"
+						))
+							$done[] = $id;
+				}
+				
+			}
+
+			$done = join(', ', $done);
+
+			if ($done)
+			{
+				// might as well clean up all comment counts while we're here.
+				clean_comment_counts($parentids);
+
+				$messages = array(
+					'delete'			=> gTxt('comments_deleted', array('{list}' => $done)),
+					'ban'					=> gTxt('ips_banned', array('{list}' => $done)),
+					'spam'				=> gTxt('comments_marked_spam', array('{list}' => $done)),
+					'unmoderated' => gTxt('comments_marked_unmoderated', array('{list}' => $done)),
+					'visible'			=> gTxt('comments_marked_visible', array('{list}' => $done))
+				);
+
+				update_lastmod();
+
+				return discuss_list($messages[$method]);
+			}
+		}
+
+		return discuss_list();
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_file.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_file.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_file.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,777 @@
+<?php
+/*
+            _______________________________________
+   ________|            Textpattern                |________
+   \       |          Mod File Upload              |       /
+    \      |   Michael Manfre (http://manfre.net)  |      /
+    /      |_______________________________________|      \
+   /___________)                               (___________\
+
+	Textpattern Copyright 2004 by Dean Allen. All rights reserved.
+	Use of this software denotes acceptance of the Textpattern license agreement 
+	
+	"Mod File Upload" Copyright 2004 by Michael Manfre. All rights reserved.
+	Use of this mod denotes acceptance of the Textpattern license agreement
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_file.php $
+$LastChangedRevision: 1895 $
+
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	$levels = array(
+		1 => gTxt('private'),
+		0 => gTxt('public')
+	);
+
+	if ($event == 'file') {
+		require_privs('file');		
+
+		if(!$step or !in_array($step, array('file_change_max_size','file_change_pageby','file_db_add','file_delete','file_edit','file_insert','file_list','file_replace','file_save','file_reset_count','file_create'))){
+			file_list();
+		} else $step();
+	}
+
+// -------------------------------------------------------------
+
+	function file_list($message = '') 
+	{
+		global $txpcfg, $extensions, $file_base_path;
+
+		pagetop(gTxt('file'), $message);
+
+		extract($txpcfg);
+		extract(get_prefs());
+
+		extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
+
+		if (!is_dir($file_base_path) or !is_writeable($file_base_path))
+		{
+			echo graf(
+				gTxt('file_dir_not_writeable', array('{filedir}' => $file_base_path))
+			, ' id="warning"');
+		}
+
+		else
+		{
+			$existing_files = get_filenames();
+
+			if (count($existing_files) > 0)
+			{
+				echo form(
+					eInput('file').
+					sInput('file_create').
+
+					graf(gTxt('existing_file').sp.selectInput('filename', $existing_files, '', 1).sp.
+						fInput('submit', '', gTxt('Create'), 'smallerbox'))
+
+				, 'text-align: center;');
+			}
+
+			echo file_upload_form(gTxt('upload_file'), 'upload', 'file_insert');
+		}
+
+		$dir = ($dir == 'desc') ? 'desc' : 'asc';
+
+		switch ($sort)
+		{
+			case 'id':
+				$sort_sql = 'id '.$dir;
+			break;
+
+			case 'filename':
+				$sort_sql = 'filename '.$dir;
+			break;
+
+			case 'description':
+				$sort_sql = 'description '.$dir.', filename desc';
+			break;
+
+			case 'category':
+				$sort_sql = 'category '.$dir.', filename desc';
+			break;
+
+			case 'downloads':
+				$sort_sql = 'downloads '.$dir.', filename desc';
+			break;
+
+			default:
+				$dir = 'desc';
+				$sort_sql = 'filename '.$dir;
+			break;
+		}
+
+		$switch_dir = ($dir == 'desc') ? 'asc' : 'desc';
+
+		$criteria = 1;
+
+		if ($search_method and $crit)
+		{
+			$crit_escaped = doSlash($crit);
+
+			$critsql = array(
+				'id'			    => "id = '$crit_escaped'",
+				'filename'    => "filename like '%$crit_escaped%'",
+				'description' => "description like '%$crit_escaped%'",
+				'category'    => "category like '%$crit_escaped%'"
+			);
+
+			if (array_key_exists($search_method, $critsql))
+			{
+				$criteria = $critsql[$search_method];
+				$limit = 500;
+			}
+
+			else
+			{
+				$search_method = '';
+				$crit = '';
+			}
+		}
+
+		else
+		{
+			$search_method = '';
+			$crit = '';
+		}
+
+		$total = safe_count('txp_file', "$criteria");
+
+		if ($total < 1)
+		{
+			if ($criteria != 1)
+			{
+				echo n.file_search_form($crit, $search_method).
+					n.graf(gTxt('no_results_found'), ' style="text-align: center;"');
+			}
+
+			else
+			{
+				echo n.graf(gTxt('no_files_recorded'), ' style="text-align: center;"');
+			}
+
+			return;
+		}
+
+		$limit = max(@$file_list_pageby, 15);
+
+		list($page, $offset, $numPages) = pager($total, $limit, $page);
+
+		echo file_search_form($crit, $search_method);
+
+		$rs = safe_rows_start('*', 'txp_file', "$criteria order by $sort_sql limit $offset, $limit");
+
+		if ($rs)
+		{
+			echo startTable('list').
+
+				tr(
+					column_head('ID', 'id', 'file', true, $switch_dir, $crit, $search_method).
+					td().
+					column_head('file_name', 'filename', 'file', true, $switch_dir, $crit, $search_method).
+					column_head('description', 'description', 'file', true, $switch_dir, $crit, $search_method).
+					column_head('file_category', 'category', 'file', true, $switch_dir, $crit, $search_method).
+					// column_head('permissions', 'permissions', 'file', true, $switch_dir, $crit, $search_method).
+					hCell(gTxt('tags')).
+					hCell(gTxt('status')).
+					column_head('downloads', 'downloads', 'file', true, $switch_dir, $crit, $search_method).
+					hCell()
+				);
+
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				$edit_url = '?event=file'.a.'step=file_edit'.a.'id='.$id.a.'sort='.$sort.
+					a.'dir='.$dir.a.'page='.$page.a.'search_method='.$search_method.a.'crit='.$crit;
+
+				$file_exists = file_exists(build_file_path($file_base_path, $filename));
+
+				$download_link = ($file_exists) ? '<li>'.make_download_link($id).'</li>' : '';
+
+				$category = ($category) ? '<span title="'.fetch_category_title($category, 'file').'">'.$category.'</span>' : '';
+
+				$tag_url = '?event=tag'.a.'tag_name=file_download_link'.a.'id='.$id.a.'description='.urlencode($description).
+					a.'filename='.urlencode($filename);
+
+				$status = '<span class="';
+				$status .= ($file_exists) ? 'ok' : 'not-ok';
+				$status .= '">';
+				$status .= ($file_exists) ? gTxt('file_status_ok') : gTxt('file_status_missing');
+				$status .= '</span>';
+
+				// does the downloads column exist?
+				if (!isset($downloads))
+				{
+					// nope, add it
+					safe_alter('txp_file', "ADD downloads INT DEFAULT '0' NOT NULL");
+					$downloads = 0;
+				}
+
+				elseif (empty($downloads))
+				{
+					$downloads = '0';
+				}
+
+				echo tr(
+
+					n.td($id).
+
+					td(
+						'<ul>'.
+						'<li>'.href(gTxt('edit'), $edit_url).'</li>'.
+						$download_link.
+						'</ul>'
+					, 65).
+
+					td(
+						href($filename, $edit_url)
+					, 125).
+
+					td($description, 150).
+					td($category, 90).
+
+					/*
+					td(
+						($permissions == '1') ? gTxt('private') : gTxt('public')
+					,80).
+					*/
+
+					td(
+						n.'<ul>'.
+						n.t.'<li><a target="_blank" href="'.$tag_url.a.'type=textile" onclick="popWin(this.href, 400, 250); return false;">Textile</a></li>'.
+						n.t.'<li><a target="_blank" href="'.$tag_url.a.'type=textpattern" onclick="popWin(this.href, 400, 250); return false;">Textpattern</a></li>'.
+						n.t.'<li><a target="_blank" href="'.$tag_url.a.'type=xhtml" onclick="popWin(this.href, 400, 250); return false;">XHTML</a></li>'.
+						n.'</ul>'
+					, 75).
+
+					td($status, 45).
+
+					td(
+						($downloads == '0' ? gTxt('none') : $downloads)
+					, 25).
+
+					td(
+						dLink('file', 'file_delete', 'id', $id)
+					, 10)
+				);
+			}
+
+			echo endTable().
+
+			nav_form('file', $page, $numPages, $sort, $dir, $crit, $search_method).
+
+			pageby_form('file', $file_list_pageby);
+		}
+	}
+	
+// -------------------------------------------------------------
+
+	function file_search_form($crit, $method)
+	{
+		$methods =	array(
+			'id'					=> gTxt('ID'),
+			'filename'		=> gTxt('file_name'),
+			'description' => gTxt('description'),
+			'category'		=> gTxt('file_category')
+		);
+
+		return search_form('file', 'file_list', $crit, $methods, $method, 'filename');
+	}
+
+// -------------------------------------------------------------
+
+	function file_edit($message = '', $id = '') 
+	{
+		global $txpcfg, $file_base_path, $levels, $path_from_root;
+
+		pagetop('file', $message);
+
+		extract(gpsa(array('name', 'category', 'permissions', 'description', 'sort', 'dir', 'page', 'crit', 'search_method')));
+
+		if (!$id)
+		{
+			$id = gps('id');
+		}
+		$id = assert_int($id);
+
+		$categories = getTree('root', 'file');
+
+		$rs = safe_row('*', 'txp_file', "id = $id");
+
+		if ($rs)
+		{
+			extract($rs);
+
+			if ($permissions=='') $permissions='-1';
+
+			$file_exists = file_exists(build_file_path($file_base_path,$filename));
+			
+			$existing_files = get_filenames();
+
+			$status = '<span class="';
+			$status .= ($file_exists) ? 'ok' : 'not-ok';
+			$status .= '">';
+			$status .= ($file_exists)?gTxt('file_status_ok'):gTxt('file_status_missing');
+			$status .= '</span>';
+
+			$downloadlink = ($file_exists)?make_download_link($id, $filename):$filename;
+			
+			$form = '';
+			
+			if ($file_exists) {
+				$form =	tr(
+							td(
+								form(
+									graf(gTxt('file_category').br.treeSelectInput('category',
+									 		$categories,$category)) .
+//									graf(gTxt('permissions').br.selectInput('perms',$levels,$permissions)).
+									graf(gTxt('description').br.text_area('description','100','400',$description)) .
+									graf(fInput('submit','',gTxt('save'))) .
+
+									eInput('file') .
+									sInput('file_save').
+
+									hInput('filename', $filename).
+									hInput('id', $id) .
+
+									hInput('sort', $sort).
+									hInput('dir', $dir).
+									hInput('page', $page).
+									hInput('crit', $crit).
+									hInput('search_method', $search_method)
+								)
+							)
+						);
+			} else {
+			
+				$form =	tr(
+							tda(
+								hed(gTxt('file_relink'),3).
+								file_upload_form(gTxt('upload_file'),'upload','file_replace',$id).
+								form(
+									graf(gTxt('existing_file').' '.
+									selectInput('filename',$existing_files,"",1).
+									fInput('submit','',gTxt('Save'),'smallerbox').
+
+									eInput('file').
+									sInput('file_save').
+
+									hInput('id',$id).
+									hInput('category',$category).
+									hInput('perms',($permissions=='-1') ? '' : $permissions).
+									hInput('description',$description).
+
+									hInput('sort', $sort).
+									hInput('dir', $dir).
+									hInput('page', $page).
+									hInput('crit', $crit).
+									hInput('search_method', $search_method)
+
+									)
+								),
+								' colspan="4" style="border:0"'
+							)
+						);
+			}
+			echo startTable('list'),
+			tr(
+				td(
+					graf(gTxt('file_status').br.$status) .
+					graf(gTxt('file_name').br.$downloadlink) .
+					graf(gTxt('file_download_count').br.(isset($downloads)?$downloads:0))					
+				)
+			),
+			$form,
+			endTable();
+		}
+	}
+
+// -------------------------------------------------------------
+	function file_db_add($filename,$category,$permissions,$description)
+	{
+		$rs = safe_insert("txp_file",
+			"filename = '$filename',
+			 category = '$category',
+			 permissions = '$permissions',
+			 description = '$description'
+		");
+		
+		if ($rs) {
+			$GLOBALS['ID'] = mysql_insert_id( );
+			return $GLOBALS['ID'];
+		}
+			
+		return false;
+	}	
+	
+// -------------------------------------------------------------
+	function file_create() 
+	{	
+		global $txpcfg,$extensions,$txp_user,$file_base_path;
+		extract($txpcfg);
+		extract(doSlash(gpsa(array('filename','category','permissions','description'))));
+
+		$id = file_db_add($filename,$category,$permissions,$description);
+		
+		if($id === false){
+			file_list(gTxt('file_upload_failed').' (db_add)');
+		} else {
+			$newpath = build_file_path($file_base_path,trim($filename));
+
+			if (is_file($newpath)) {
+				file_set_perm($newpath);
+				file_list(gTxt('linked_to_file').' '.$filename);
+			} else {
+				file_list(gTxt('file_not_found').' '.$filename);
+			}
+		}
+	}
+
+// -------------------------------------------------------------
+	function file_insert() 
+	{	
+		global $txpcfg,$extensions,$txp_user,$file_base_path,$file_max_upload_size;
+		extract($txpcfg);
+		extract(doSlash(gpsa(array('category','permissions','description'))));
+
+		$name = file_get_uploaded_name();
+		$file = file_get_uploaded();
+
+		if ($file === false) {
+			// could not get uploaded file
+			file_list(gTxt('file_upload_failed') ." $name - ".upload_get_errormsg(@$_FILES['file']['error']));
+			return;
+		}
+
+		if ($file_max_upload_size < filesize($file)) {
+			unlink($file);
+			file_list(gTxt('file_upload_failed') ." $name - ".upload_get_errormsg(UPLOAD_ERR_FORM_SIZE));
+			return;
+		}
+		
+		if (!is_file(build_file_path($file_base_path,$name))) {
+
+			$id = file_db_add($name,$category,$permissions,$description);
+			
+			if(!$id){
+				file_list(gTxt('file_upload_failed').' (db_add)');
+			} else {
+
+				$id = assert_int($id);
+				$newpath = build_file_path($file_base_path,trim($name));
+				
+				if(!shift_uploaded_file($file, $newpath)) {
+					safe_delete("txp_file","id = $id");
+					safe_alter("txp_file", "auto_increment=$id");
+					if ( isset( $GLOBALS['ID'])) unset( $GLOBALS['ID']);
+					file_list($newpath.' '.gTxt('upload_dir_perms'));
+					// clean up file
+				} else {
+					file_set_perm($newpath);
+
+					$message = gTxt('file_uploaded', array('{name}' => $name));
+
+					file_edit($message, $id);
+				}
+			}
+		}
+
+		else
+		{
+			$message = gTxt('file_already_exists', array('{name}' => $name));
+
+			file_list($message);
+		}
+	}
+
+// -------------------------------------------------------------
+	function file_replace() 
+	{	
+		global $txpcfg,$extensions,$txp_user,$file_base_path;
+		extract($txpcfg);
+		$id = assert_int(gps('id'));
+
+		$rs = safe_row('filename','txp_file',"id = $id");
+		
+		if (!$rs) {
+			file_list(messenger(gTxt('invalid_id'),$id,''));
+			return;
+		}
+		
+		extract($rs);
+		
+		$file = file_get_uploaded();
+		$name = file_get_uploaded_name();
+
+		if ($file === false) {
+			// could not get uploaded file
+			file_list(gTxt('file_upload_failed') ." $name ".upload_get_errormsg($_FILES['file']['error']));
+			return;
+		}
+
+		if (!$filename) {
+			file_list(gTxt('invalid_filename'));
+		} else {
+			$newpath = build_file_path($file_base_path,$filename);
+
+			if (is_file($newpath)) {
+				rename($newpath,$newpath.'.tmp');
+			}
+	
+			if(!shift_uploaded_file($file, $newpath)) {
+				safe_delete("txp_file","id = $id");
+
+				file_list($newpath.sp.gTxt('upload_dir_perms'));
+				// rename tmp back
+				rename($newpath.'.tmp',$newpath);
+				
+				// remove tmp upload
+				unlink($file);				
+			} else {
+				file_set_perm($newpath);
+
+				$message = gTxt('file_uploaded', array('{name}' => $name));
+
+				file_edit($message, $id);
+				// clean up old
+				if (is_file($newpath.'.tmp'))
+					unlink($newpath.'.tmp');
+			}
+		}
+	}
+
+
+// -------------------------------------------------------------
+	function file_reset_count() 
+	{
+		extract(doSlash(gpsa(array('id','filename','category','description'))));
+		
+		if ($id) {
+			$id = assert_int($id);
+			if (safe_update('txp_file','downloads = 0',"id = $id")) {
+				file_edit(gTxt('reset_file_count_success'),$id);
+			}
+		} else {
+			file_list(gTxt('reset_file_count_failure'));
+		}		
+	}
+
+// -------------------------------------------------------------
+
+	function file_save() 
+	{
+		global $file_base_path;
+
+		extract(doSlash(gpsa(array('id', 'filename', 'category', 'description'))));
+
+		$id = assert_int($id);
+
+		$permissions = gps('perms');
+		if (is_array($permissions)) {
+			asort($permissions);
+			$permissions = implode(",",$permissions);
+		}
+
+		$perms = doSlash($permissions);
+		
+		$old_filename = fetch('filename','txp_file','id',$id);
+		
+		if ($old_filename != false && strcmp($old_filename, $filename) != 0)
+		{
+			$old_path = build_file_path($file_base_path,$old_filename);
+			$new_path = build_file_path($file_base_path,$filename);
+
+			if (file_exists($old_path) && shift_uploaded_file($old_path, $new_path) === false)
+			{
+				$message = gTxt('file_cannot_rename', array('{name}' => $filename));
+
+				return file_list($message);
+			}
+
+			else
+			{
+				file_set_perm($new_path);
+			}
+		}
+
+		$rs = safe_update('txp_file', "
+			filename = '$filename',
+			category = '$category',
+			permissions = '$perms',
+			description = '$description'
+		", "id = $id");
+
+		if (!$rs)
+		{
+			// update failed, rollback name
+			if (shift_uploaded_file($new_path, $old_path) === false)
+			{
+				$message = gTxt('file_unsynchronized', array('{name}' => $filename));
+
+				return file_list($message);
+			}
+
+			else
+			{
+				$message = gTxt('file_not_updated', array('{name}' => $filename));
+
+				return file_list($message);
+			}
+		}
+
+		$message = gTxt('file_updated', array('{name}' => $filename));
+
+		file_list($message);
+	}
+
+// -------------------------------------------------------------
+
+	function file_delete()
+	{
+		global $txpcfg, $file_base_path;
+
+		extract($txpcfg);
+
+		$id = assert_int(ps('id'));
+
+		$rs = safe_row('*', 'txp_file', "id = $id");
+
+		if ($rs)
+		{
+			extract($rs);
+
+			$filepath = build_file_path($file_base_path, $filename);
+
+			$rsd = safe_delete('txp_file', "id = $id");
+			$ul = false;
+
+			if ($rsd && is_file($filepath))
+			{
+				$ul = unlink($filepath);
+			}
+
+			if ($rsd && $ul)
+			{
+				$message = gTxt('file_deleted', array('{name}' => $filename));
+
+				return file_list($message);
+			}
+
+			else
+			{
+				file_list(messenger(gTxt('file_delete_failed'), $filename, ''));
+			}
+		}
+
+		else
+		{
+			file_list(messenger(gTxt('file_not_found'), $filename, ''));
+		}
+	}
+
+// -------------------------------------------------------------
+	function file_get_uploaded_name()
+	{
+		return $_FILES['thefile']['name'];
+	}
+
+// -------------------------------------------------------------
+	function file_get_uploaded()
+	{
+		return get_uploaded_file($_FILES['thefile']['tmp_name']);		
+	}
+	
+// -------------------------------------------------------------
+	function file_set_perm($file)
+	{
+		return @chmod($file,0644);
+	}	
+
+// -------------------------------------------------------------
+	function file_upload_form($label,$pophelp,$step,$id='')
+	{
+		global $file_max_upload_size;
+		
+		if (!$file_max_upload_size || intval($file_max_upload_size)==0) $file_max_upload_size = 2*(1024*1024);
+		
+		$max_file_size = (intval($file_max_upload_size) == 0) ? '': intval($file_max_upload_size);
+			
+		return upload_form($label, $pophelp, $step, 'file', $id, $max_file_size);
+	}
+	
+// -------------------------------------------------------------
+	function file_change_pageby() 
+	{
+		event_change_pageby('file');
+		file_list();
+	}
+	
+// -------------------------------------------------------------
+	function file_change_max_size() 
+	{
+		// DEPRECATED function; removed old code
+		file_list();
+	}
+
+// -------------------------------------------------------------
+
+	function make_download_link($id, $label = '')
+	{
+		global $permlink_mode;
+
+		$label = ($label) ? $label : gTxt('download');
+
+		$url = ($permlink_mode == 'messy') ? 
+			hu.'index.php?s=file_download'.a.'id='.$id : 
+			hu.''.gTxt('file_download').'/'.$id;
+
+		return '<a href="'.$url.'">'.$label.'</a>';
+	}
+	
+// -------------------------------------------------------------
+	function get_filenames()
+	{
+		global $file_base_path;
+		
+		$dirlist = array();
+
+		if (!is_dir($file_base_path))
+			return $dirlist;		
+		
+		if (chdir($file_base_path)) {
+			if (function_exists('glob'))
+				$g_array = glob("*.*");
+			else {
+				$dh = opendir($file_base_path);
+				$g_array = array();
+				while (false !== ($filename = readdir($dh))) {
+					$g_array[] = $filename;
+				}
+				closedir($dh);
+				
+			}
+			
+			if ($g_array) {
+				foreach ($g_array as $filename) {
+					if (is_file($filename)) {
+						$dirlist[$filename] = $filename;
+					}
+				}
+			}
+		}
+
+		$files = array();
+		$rs = safe_rows("filename", "txp_file", "1=1");
+
+		if ($rs) {
+			foreach ($rs as $a) {
+				$files[$a['filename']] = $a['filename'];
+			}
+		}
+		
+		return array_diff($dirlist,$files);
+	}
+	
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_form.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_form.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_form.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,264 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_form.php $
+$LastChangedRevision: 1913 $
+
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	global $vars;
+	$vars = array('Form','type','name','savenew','oldname');
+	$essential_forms = array('comments','comments_display','comment_form','default','Links','files');
+
+	if ($event == 'form') {
+		require_privs('form');
+
+		if(!$step or !in_array($step, array('form_list','form_create','form_delete','form_edit','form_multi_edit','form_save'))){
+			form_edit();
+		} else $step();
+	}
+	
+// -------------------------------------------------------------
+	function form_list($curname)
+	{
+		global $step,$essential_forms;
+		$out[] = startTable('list');
+		$out[] = tr(tda(sLink('form','form_create',gTxt('create_new_form')),' colspan="3" style="height:30px"'));
+
+		$out[] = assHead('form','type','');
+		
+		$methods = array('delete'=>gTxt('delete'));
+
+
+		$rs = safe_rows_start("*", "txp_form", "1 order by type asc, name asc");
+
+		if ($rs) {
+			while ($a = nextRow($rs)){
+				extract($a);
+					$editlink = ($curname!=$name) 
+					?	eLink('form','form_edit','name',$name,$name)
+					:	htmlspecialchars($name);
+					$modbox = (!in_array($name, $essential_forms))
+					?	'<input type="checkbox" name="selected_forms[]" value="'.$name.'" />'
+					:	sp;
+				$out[] = tr(td($editlink).td(small($type)).td($modbox));
+			}
+
+			$out[] = endTable();
+			$out[] = eInput('form').sInput('form_multi_edit');
+			$out[] = graf(selectInput('edit_method',$methods,'',1).sp.gTxt('selected').sp.
+				fInput('submit','form_multi_edit',gTxt('go'),'smallerbox')
+				, ' align="right"');
+
+			return form( join('',$out),'',"verify('".gTxt('are_you_sure')."')" );
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function form_multi_edit()
+	{
+		global $essential_forms;
+
+		$method = ps('edit_method');
+		$forms = ps('selected_forms');
+
+		if (is_array($forms))
+		{
+			if ($method == 'delete')
+			{
+				foreach ($forms as $name)
+				{
+					if (!in_array($name, $essential_forms) && form_delete($name))
+					{
+						$deleted[] = $name;
+					}
+				}
+
+				$message = gTxt('forms_deleted', array('{list}' => join(', ', $deleted)));
+
+				form_edit($message);
+			}
+		}
+
+		else
+		{
+			form_edit();
+		}
+	}
+
+// -------------------------------------------------------------
+	function form_create() 
+	{
+		form_edit();
+	}
+
+// -------------------------------------------------------------
+	function form_edit($message='')
+	{
+		global $step,$essential_forms;
+		pagetop(gTxt('edit_forms'),$message);
+
+		extract(gpsa(array('Form','name','type')));
+		$name = trim(preg_replace('/[<>&"\']/', '', $name));
+
+		if ($step=='form_create') {
+			$inputs = fInput('submit','savenew',gTxt('save_new'),'publish').
+				eInput("form").sInput('form_save');
+		} else {
+			$name = (!$name or $step=='form_delete') ? 'default' : $name;
+			$rs = safe_row("*", "txp_form", "name='".doSlash($name)."'");
+//			if ($rs)
+ {
+				extract($rs);
+				$inputs = fInput('submit','save',gTxt('save'),'publish').
+					eInput("form").sInput('form_save').hInput('oldname',$name);
+			}
+		}
+
+		if (!in_array($name, $essential_forms))
+			$changename = graf(gTxt('form_name').br.fInput('text','name',$name,'edit','','',15));
+		else
+			$changename = graf(gTxt('form_name').br.tag($name, 'em').hInput('name',$name));
+
+		$out = 
+			startTable('edit').
+			tr(
+				tdtl(
+					hed(gTxt('tagbuilder'), 2).
+
+					hed('<a href="#article-tags" onclick="toggleDisplay(\'article-tags\'); return false;">'.gTxt('articles').'</a>'.
+						sp.popHelp('form_articles'), 3, ' class="plain"').
+						'<div id="article-tags">'.popTagLinks('article').'</div>'.
+
+					hed('<a href="#link-tags" onclick="toggleDisplay(\'link-tags\'); return false;">'.gTxt('links').'</a>'.
+						sp.popHelp('form_place_link'), 3, ' class="plain"').
+						'<div id="link-tags" style="display: none;">'.popTagLinks('link').'</div>'.
+
+					hed('<a href="#comment-tags" onclick="toggleDisplay(\'comment-tags\'); return false;">'.gTxt('comments').'</a>'.
+						sp.popHelp('form_comments'), 3, ' class="plain"').
+						'<div id="comment-tags" style="display: none;">'.popTagLinks('comment').'</div>'.
+
+					hed('<a href="#comment-detail-tags" onclick="toggleDisplay(\'comment-detail-tags\'); return false;">'.gTxt('comment_details').'</a>'.
+						sp.popHelp('form_comment_details'), 3, ' class="plain"').
+						'<div id="comment-detail-tags" style="display: none;">'.popTagLinks('comment_details').'</div>'.
+
+					hed('<a href="#comment-form-tags" onclick="toggleDisplay(\'comment-form-tags\'); return false;">'.gTxt('comment_form').'</a>'.
+						sp.popHelp('form_comment_form'), 3, ' class="plain"').
+						'<div id="comment-form-tags" style="display: none;">'.popTagLinks('comment_form').'</div>'.
+
+					hed('<a href="#search-result-tags" onclick="toggleDisplay(\'search-result-tags\'); return false;">'.gTxt('search_results_form').'</a>'.
+						sp.popHelp('form_search_results'), 3, ' class="plain"').
+						'<div id="search-result-tags" style="display: none;">'.popTagLinks('search_result').'</div>'.
+
+					hed('<a href="#file-tags" onclick="toggleDisplay(\'file-tags\'); return false;">'.gTxt('file_download_tags').'</a>'.
+						sp.popHelp('form_file_download_tags'), 3, ' class="plain"').
+						'<div id="file-tags" style="display: none;">'.popTagLinks('file_download').'</div>'
+				).
+				tdtl(
+					'<form action="index.php" method="post">'.
+						'<textarea id="form" class="code" name="Form" cols="60" rows="20">'.htmlspecialchars($Form).'</textarea>'.
+
+					$changename.
+
+					graf(gTxt('form_type').br.
+						formtypes($type)).
+					graf(gTxt('only_articles_can_be_previewed')).
+					fInput('submit','form_preview',gTxt('preview'),'smallbox').
+					graf($inputs).
+					'</form>'
+
+				).
+				tdtl(
+					form_list($name)
+				)
+			).endTable();
+			
+		echo $out;
+	}
+
+// -------------------------------------------------------------
+
+	function form_save()
+	{
+		global $vars, $step, $essential_forms;
+
+		extract(doSlash(gpsa($vars)));
+		$name = doSlash(trim(preg_replace('/[<>&"\']/', '', gps('name'))));
+
+		if (!$name)
+		{
+			$step = 'form_create';
+			$message = gTxt('form_name_invalid');
+
+			return form_edit($message);
+		}
+
+		if (!in_array($type, array('article','comment','link','misc','file')))
+		{
+			$step = 'form_create';
+			$message = gTxt('form_type_missing');
+
+			return form_edit($message);
+		}
+
+		if ($savenew)
+		{
+			$exists = safe_field('name', 'txp_form', "name = '$name'");
+
+			if ($exists)
+			{
+				$step = 'form_create';
+				$message = gTxt('form_already_exists', array('{name}' => $name));
+
+				return form_edit($message);
+			}
+
+			safe_insert('txp_form', "Form = '$Form', type = '$type', name = '$name'");
+
+			update_lastmod();
+
+			$message = gTxt('form_created', array('{name}' => $name));
+
+			return form_edit($message);
+		}
+
+		safe_update('txp_form', "Form = '$Form', type = '$type', name = '$name'", "name = '$oldname'");
+
+		update_lastmod();
+
+		$message = gTxt('form_updated', array('{name}' => $name));
+
+		form_edit($message);
+	}
+
+// -------------------------------------------------------------
+	function form_delete($name)
+	{
+		global $essential_forms;
+		if (in_array($name, $essential_forms)) return false;
+		$name = doSlash($name);
+		if (safe_delete("txp_form","name='$name'")) {
+			return true;
+		}
+		return false;
+	}
+	
+// -------------------------------------------------------------
+	function formTypes($type) 
+	{
+	 	$types = array(''=>'','article'=>'article','comment'=>'comment','link'=>'link','misc'=>'misc','file'=>'file'); 
+		return selectInput('type',$types,$type);
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_image.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_image.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_image.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,696 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_image.php $
+$LastChangedRevision: 1955 $
+
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	global $extensions;
+	$extensions = array(0,'.gif','.jpg','.png','.swf');
+	define("IMPATH",$path_to_site.'/'.$img_dir.'/');
+	include txpath.'/lib/class.thumb.php';
+
+	if ($event == 'image') {	
+		require_privs('image');		
+
+		if(!$step or !in_array($step, array('image_list','image_edit','image_insert','image_delete','image_replace','image_save','thumbnail_insert','image_change_pageby','thumbnail_create'
+		))){
+			image_list();
+		} else $step();
+	}
+
+// -------------------------------------------------------------
+
+	function image_list($message = '')
+	{
+		global $txpcfg, $extensions, $img_dir, $file_max_upload_size;
+
+		pagetop(gTxt('images'), $message);
+
+		extract($txpcfg);
+		extract(get_prefs());
+
+		extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
+
+		if (!is_dir(IMPATH) or !is_writeable(IMPATH))
+		{
+			echo graf(
+				gTxt('img_dir_not_writeable', array('{imgdir}' => IMPATH))
+			,' id="warning"');
+		}
+
+		else
+		{
+			echo upload_form(gTxt('upload_image'), 'upload', 'image_insert', 'image', '', $file_max_upload_size);
+		}
+
+		$dir = ($dir == 'desc') ? 'desc' : 'asc';
+
+		switch ($sort)
+		{
+			case 'id':
+				$sort_sql = 'id '.$dir;
+			break;
+
+			case 'name':
+				$sort_sql = 'name '.$dir;
+			break;
+
+			case 'thumbnail':
+				$sort_sql = 'thumbnail '.$dir.', id asc';
+			break;
+
+			case 'category':
+				$sort_sql = 'category '.$dir.', id asc';
+			break;
+
+			case 'date':
+				$sort_sql = 'date '.$dir.', id asc';
+			break;
+
+			case 'author':
+				$sort_sql = 'author '.$dir.', id asc';
+			break;
+
+			default:
+				$dir = 'desc';
+				$sort_sql = 'id '.$dir;
+			break;
+		}
+
+		$switch_dir = ($dir == 'desc') ? 'asc' : 'desc';
+
+		$criteria = 1;
+
+		if ($search_method and $crit)
+		{
+			$crit_escaped = doSlash($crit);
+
+			$critsql = array(
+				'id'			 => "id = '$crit_escaped'",
+				'name'		 => "name like '%$crit_escaped%'",
+				'category' => "category like '%$crit_escaped%'",
+				'author'	 => "author like '%$crit_escaped%'"
+			);
+
+			if (array_key_exists($search_method, $critsql))
+			{
+				$criteria = $critsql[$search_method];
+				$limit = 500;
+			}
+
+			else
+			{
+				$search_method = '';
+				$crit = '';
+			}
+		}
+
+		else
+		{
+			$search_method = '';
+			$crit = '';
+		}
+		$total = safe_count('txp_image', "$criteria");
+
+		if ($total < 1)
+		{
+			if ($criteria != 1)
+			{
+				echo n.image_search_form($crit, $search_method).
+					n.graf(gTxt('no_results_found'), ' style="text-align: center;"');
+			}
+
+			else
+			{
+				echo n.graf(gTxt('no_images_recorded'), ' style="text-align: center;"');
+			}
+
+			return;
+		}
+
+		$limit = max(@$image_list_pageby, 15);
+
+		list($page, $offset, $numPages) = pager($total, $limit, $page);
+
+		echo image_search_form($crit, $search_method);
+
+		$rs = safe_rows_start('*, unix_timestamp(date) as uDate', 'txp_image',
+			"$criteria order by $sort_sql limit $offset, $limit
+		");
+
+		if ($rs)
+		{
+			echo n.n.startTable('list').
+				n.tr(
+					column_head('ID', 'id', 'image', true, $switch_dir, $crit, $search_method).
+					hCell().
+					column_head('date', 'date', 'image', true, $switch_dir, $crit, $search_method).
+					column_head('name', 'name', 'image', true, $switch_dir, $crit, $search_method).
+					column_head('thumbnail', 'thumbnail', 'image', true, $switch_dir, $crit, $search_method).
+					hCell(gTxt('tags')).
+					column_head('image_category', 'category', 'image', true, $switch_dir, $crit, $search_method).
+					column_head('author', 'author', 'image', true, $switch_dir, $crit, $search_method).
+					hCell()
+				);
+
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				$edit_url = '?event=image'.a.'step=image_edit'.a.'id='.$id.a.'sort='.$sort.
+					a.'dir='.$dir.a.'page='.$page.a.'search_method='.$search_method.a.'crit='.$crit;
+
+				$name = empty($name) ? gTxt('unnamed') : $name;
+
+				$thumbnail = ($thumbnail) ?
+					'<img src="'.hu.$img_dir.'/'.$id.'t'.$ext.'" />' :
+					gTxt('no');
+
+				$tag_url = '?event=tag'.a.'tag_name=image'.a.'id='.$id.a.'ext='.$ext.
+					a.'w='.$w.a.'h='.$h.a.'alt='.urlencode($alt).a.'caption='.urlencode($caption);
+
+				$category = ($category) ? '<span title="'.fetch_category_title($category, 'image').'">'.$category.'</span>' : '';
+
+				echo n.n.tr(
+
+					n.td($id, 20).
+
+					td(
+						n.'<ul>'.
+						n.t.'<li>'.href(gTxt('edit'), $edit_url).'</li>'.
+						n.t.'<li><a href="'.hu.$img_dir.'/'.$id.$ext.'">'.gTxt('view').'</a></li>'.
+						n.'</ul>'
+					, 35).
+
+					td(
+						safe_strftime('%d %b %Y %I:%M %p', $uDate)
+					, 75).
+
+					td(
+						href($name, $edit_url)
+					, 75).
+
+					td($thumbnail, 75).
+
+					td(
+						'<ul>'.
+						'<li><a target="_blank" href="'.$tag_url.a.'type=textile" onclick="popWin(this.href); return false;">Textile</a></li>'.
+						'<li><a target="_blank" href="'.$tag_url.a.'type=textpattern" onclick="popWin(this.href); return false;">Textpattern</a></li>'.
+						'<li><a target="_blank" href="'.$tag_url.a.'type=xhtml" onclick="popWin(this.href); return false;">XHTML</a></li>'.
+						'</ul>'
+					, 85).
+
+					td($category, 75).
+
+					td(
+						'<span title="'.get_author_name($author).'">'.$author.'</span>'
+					, 75).
+
+					td(
+						dLink('image', 'image_delete', 'id', $id)
+					, 10)
+				);
+			}
+
+			echo endTable().
+
+			nav_form('image', $page, $numPages, $sort, $dir, $crit, $search_method).
+
+			pageby_form('image', $image_list_pageby);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function image_search_form($crit, $method)
+	{
+		$methods =	array(
+			'id'       => gTxt('ID'),
+			'name'     => gTxt('name'),
+			'category' => gTxt('image_category'),
+			'author'	 => gTxt('author')
+		);
+
+		return search_form('image', 'image_list', $crit, $methods, $method, 'name');
+	}
+
+// -------------------------------------------------------------
+	function image_edit($message='',$id='') 
+	{
+		if (!$id) $id = gps('id');
+		$id = assert_int($id);
+		global $txpcfg,$img_dir,$file_max_upload_size;
+
+		pagetop(gTxt('edit_image'),$message);
+
+		extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
+
+		$categories = getTree("root", "image");
+		
+		$rs = safe_row("*", "txp_image", "id = $id");
+		
+		if ($rs) {
+			extract($rs);
+			echo startTable('list'),
+			tr(
+				td(
+					'<img src="'.hu.$img_dir.
+						'/'.$id.$ext.'" height="'.$h.'" width="'.$w.'" alt="" />'.
+						br.upload_form(gTxt('replace_image'),'replace_image_form',
+							'image_replace','image',$id,$file_max_upload_size, 'image-replace', '')
+				)
+			),
+			tr(
+				td(
+					join('',
+						array(
+							($thumbnail)
+							?	'<img src="'.hu.$img_dir.
+								'/'.$id.'t'.$ext.'" alt="" />'.br
+							:	'',
+							upload_form(gTxt('upload_thumbnail'),'upload_thumbnail',
+								'thumbnail_insert','image',$id,$file_max_upload_size, 'upload-thumbnail', '')
+						)
+					)
+				)
+			),
+
+			(function_exists("imagecreatefromjpeg"))
+			?	thumb_ui( $id )
+			:	'',
+
+			tr(
+				td(
+					form(
+						graf('<label for="image-name">'.gTxt('image_name').'</label>'.br.
+							fInput('text', 'name', $name, 'edit', '', '', '', '', 'image-name')).
+
+						graf('<label for="image-category">'.gTxt('image_category').'</label>'.br.
+							treeSelectInput('category', $categories, $category, 'image-category')).
+
+						graf('<label for="alt-text">'.gTxt('alt_text').'</label>'.br.
+							fInput('text', 'alt', $alt, 'edit', '', '', 50, '', 'alt-text')).
+
+						graf('<label for="caption">'.gTxt('caption').'</label>'.br.
+							text_area('caption', '100', '400', $caption, 'caption')).
+
+						n.graf(fInput('submit', '', gTxt('save'), 'publish')).
+						n.hInput('id', $id).
+						n.eInput('image').
+						n.sInput('image_save').
+
+						n.hInput('sort', $sort).
+						n.hInput('dir', $dir).
+						n.hInput('page', $page).
+						n.hInput('search_method', $search_method).
+						n.hInput('crit', $crit)
+					)
+				)
+			),
+			endTable();
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function image_insert()
+	{
+		global $txpcfg, $extensions, $txp_user;
+
+		extract($txpcfg);
+
+		$meta = doSlash(gpsa(array('caption', 'alt', 'category')));
+
+		$img_result = image_data($_FILES['thefile'], $meta);
+
+		if (is_array($img_result))
+		{
+			list($message, $id) = $img_result;
+
+			return image_edit($message, $id);
+		}
+
+		else
+		{
+			return image_list($img_result);
+		}
+	}
+
+// -------------------------------------------------------------
+	function image_replace() 
+	{	
+		global $txpcfg,$extensions,$txp_user;
+		extract($txpcfg);
+		$id = gps('id');
+		
+		$img_result = image_data($_FILES['thefile'], '', $id);
+		
+
+		if(is_array($img_result))
+		{
+			list($message, $id) = $img_result;
+			return image_edit($message, $id);
+		}else{
+			return image_list($img_result);
+		}
+	}
+
+// -------------------------------------------------------------
+	function thumbnail_insert() 
+	{
+		global $txpcfg,$extensions,$txp_user,$img_dir,$path_to_site;
+		extract($txpcfg);
+		$id = assert_int(gps('id'));
+		
+		$file = $_FILES['thefile']['tmp_name'];
+		$name = $_FILES['thefile']['name'];
+
+		$file = get_uploaded_file($file);
+		
+		list(,,$extension) = getimagesize($file);
+	
+		if (($file !== false) && $extensions[$extension]) {
+			$ext = $extensions[$extension];
+
+				$newpath = IMPATH.$id.'t'.$ext;
+			
+			if(shift_uploaded_file($file, $newpath) == false) {
+				image_list($newpath.sp.gTxt('upload_dir_perms'));
+			} else {
+				chmod($newpath,0644);
+				safe_update("txp_image", "thumbnail = 1", "id = $id");
+
+				$message = gTxt('image_uploaded', array('{name}' => $name));
+
+				image_edit($message, $id);
+			}
+		} else {
+			if ($file === false)
+				image_list(upload_get_errormsg($_FILES['thefile']['error']));
+			else
+				image_list(gTxt('only_graphic_files_allowed'));
+		}
+	}
+
+
+// -------------------------------------------------------------
+	function image_save() 
+	{
+		extract(doSlash(gpsa(array('id','name','category','caption','alt'))));
+		$id = assert_int($id);
+		
+		safe_update(
+			"txp_image",
+			"name     = '$name',
+			category = '$category',
+			alt      = '$alt',
+			caption  = '$caption'",
+			"id = $id"
+		);
+
+		$message = gTxt('image_updated', array('{name}' => $name));
+
+		image_list($message);
+	}
+
+// -------------------------------------------------------------
+	function image_delete() 
+	{
+		global $txpcfg;
+		extract($txpcfg);
+		$id = assert_int(ps('id'));
+		
+		$rs = safe_row("*", "txp_image", "id = $id");
+		if ($rs) {
+			extract($rs);
+			$rsd = safe_delete("txp_image","id = $id");
+			$ul = unlink(IMPATH.$id.$ext) or exit(image_list());
+			if(is_file(IMPATH.$id.'t'.$ext)){
+				$ult = unlink(IMPATH.$id.'t'.$ext);
+			}
+
+			if ($rsd && $ul)
+			{
+				$message = gTxt('image_deleted', array('{name}' => $name));
+
+				image_list($message);
+			}
+		} else image_list();
+	}
+
+
+	
+// -------------------------------------------------------------
+	function image_change_pageby()
+	{
+		event_change_pageby('image');
+		image_list();
+	}
+
+// -------------------------------------------------------------
+	function thumb_ui($id)
+	{		
+		global $prefs, $sort, $dir, $page, $search_method, $crit;
+		extract($prefs);
+		return
+		tr(
+			td(
+				form(
+					graf(gTxt('create_thumbnail')) .
+					startTable('','left','',1) .
+						tr(
+							fLabelCell(gTxt('thumb_width'), '', 'width') . 
+							fInputCell('width', @$thumb_w, 1, 4, '', 'width').
+
+							fLabelCell(gTxt('thumb_height'), '', 'height') . 
+							fInputCell('height', @$thumb_h, 1, 4, '', 'height').
+
+							fLabelCell(gTxt('keep_square_pixels'), '', 'crop') . 
+							tda(checkbox('crop', 1, @$thumb_crop, '', 'crop'), ' class="noline"').
+
+							tda(
+								fInput('submit', '', gTxt('Create'), 'smallerbox')
+							, ' class="noline"')
+						).
+
+						n.hInput('id', $id).
+						n.eInput('image').
+						n.sInput('thumbnail_create').
+
+						n.hInput('sort', $sort).
+						n.hInput('dir', $dir).
+						n.hInput('page', $page).
+						n.hInput('search_method', $search_method).
+						n.hInput('crit', $crit).
+
+					endTable()
+				)
+			)
+		);
+	}
+
+// -------------------------------------------------------------
+
+	function thumbnail_create()
+	{
+		extract(doSlash(gpsa(array('id', 'width', 'height'))));
+
+		if (!is_numeric ($width) && !is_numeric($height))
+		{
+			image_edit(messenger('invalid_width_or_height', "($width)/($height)", ''), $id);
+			return;
+		}
+
+		$crop = gps('crop');
+
+		$t = new txp_thumb( $id );
+		$t->crop = ($crop == '1');
+		$t->hint = '0';
+
+		if (is_numeric($width))
+		{
+			$t->width = $width;
+		}
+
+		if (is_numeric($height))
+		{
+			$t->height = $height;
+		}
+
+		if ($t->write())
+		{
+			global $prefs;
+
+			$prefs['thumb_w'] = $width;
+			$prefs['thumb_h'] = $height;
+			$prefs['thumb_crop'] = $crop;
+
+			// hidden prefs
+			set_pref('thumb_w', $width, 'image',	2);
+			set_pref('thumb_h', $height, 'image',	 2);
+			set_pref('thumb_crop', $crop, 'image',	2);
+
+			$message = gTxt('thumbnail_saved', array('{id}' => $id));
+
+			image_edit($message, $id);
+		}
+
+		else
+		{
+			$message = gTxt('thumbnail_not_saved', array('{id}' => $id));
+
+			image_edit($message, $id);
+		}
+	}
+
+// -------------------------------------------------------------
+// Refactoring attempt, allowing other - plugin - functions to
+// upload images without the need for writting duplicated code.
+
+	function image_data($file , $meta = '', $id = '', $uploaded = true)
+	{
+		global $txpcfg, $extensions, $txp_user, $prefs, $file_max_upload_size;
+
+		extract($txpcfg);
+
+		$name = $file['name'];
+		$error = $file['error'];
+		$file = $file['tmp_name'];
+
+		if ($uploaded)
+		{
+			$file = get_uploaded_file($file);
+
+			if ($file_max_upload_size < filesize($file))
+			{
+				unlink($file);
+
+				return upload_get_errormsg(UPLOAD_ERR_FORM_SIZE);
+			}
+		}
+
+		list($w, $h, $extension) = getimagesize($file);
+
+		if (($file !== false) && @$extensions[$extension])
+		{
+			$ext = $extensions[$extension];
+
+			$name = doSlash(substr($name, 0, strrpos($name, '.')).$ext);
+
+			if ($meta == false)
+			{
+				$meta = array('category' => '', 'caption' => '', 'alt' => '');
+			}
+
+			extract($meta);
+
+			$q ="
+				name = '$name',
+				ext = '$ext',
+				w = $w,
+				h = $h,
+				alt = '$alt',
+				caption = '$caption',
+				category = '$category',
+				date = now(),
+				author = '$txp_user'
+			";
+
+			if (empty($id))
+			{
+				$rs = safe_insert('txp_image', $q);
+
+				$id = $GLOBALS['ID'] = mysql_insert_id();
+			}
+
+			else
+			{
+				$id = assert_int($id);
+
+				$rs = safe_update('txp_image', $q, "id = $id");
+			}
+
+			if (!$rs)
+			{
+				return gTxt('image_save_error');
+			}
+
+			else
+			{
+				$newpath = IMPATH.$id.$ext;
+
+				if (shift_uploaded_file($file, $newpath) == false)
+				{
+					$id = assert_int($id);
+
+					safe_delete('txp_image', "id = $id");
+
+					safe_alter('txp_image', "auto_increment = $id");
+
+					if (isset($GLOBALS['ID']))
+					{
+						unset( $GLOBALS['ID']);
+					}
+
+					return $newpath.sp.gTxt('upload_dir_perms');
+				}
+
+				else
+				{
+					@chmod($newpath, 0644);
+
+					// Auto-generate a thumbnail using the last settings
+					if (isset($prefs['thumb_w'], $prefs['thumb_h'], $prefs['thumb_crop']))
+					{
+						$t = new txp_thumb( $id );
+
+						$t->crop = ($prefs['thumb_crop'] == '1');
+						$t->hint = '0';
+
+						if (is_numeric($prefs['thumb_w']))
+						{
+							$t->width = $prefs['thumb_w'];
+						}
+
+						if (is_numeric($prefs['thumb_h']))
+						{
+							$t->height = $prefs['thumb_h'];
+						}
+
+						$t->write();
+					}
+
+					$message = gTxt('image_uploaded', array('{name}' => $name));
+
+					return array($message, $id);
+				}
+			}
+		}
+
+		else
+		{
+			if ($file === false)
+			{
+				return upload_get_errormsg($error);
+			}
+
+			else
+			{
+				return gTxt('only_graphic_files_allowed');
+			}
+		}
+	}
+
+?>
\ No newline at end of file

Added: trunk/www.openmoko.com/textpattern/include/txp_import.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_import.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_import.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,251 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_import.php $
+$LastChangedRevision: 1238 $
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	// TO-DO:
+	// * Improve performance of file imports
+	// * Test a php_ini format for blogger exports
+	// * Provide an Export option
+	// * Write best help
+	
+	//Keep error display until we add an error handler for this
+	error_reporting(E_ALL);
+  	@ini_set("display_errors","1");
+
+	require_privs('import');	
+ 	
+ 	$vars = array('import_tool', 'Section','type','comments_invite','blog_id','importdb','importdblogin','importdbpass','importdbhost','wpdbprefix');
+ 	
+ 	// Add new tools here.
+ 	// First: Array key must be the end of the import tool file name;
+ 	// that is import_[key].php.
+ 	// Then: Add the specific tool call on start_import switch statement
+ 	
+ 	$tools = array(
+				''=>'',
+ 				'mt'=>'Movable Type (File)',
+ 				'mtdb'=>'Movable Type (MySQL DB)', 
+				'blogger'=>'Blogger',
+				'b2' => 'b2', 
+				'wp'=>'WordPress'
+			);			
+ 	
+
+ 	if(!$step or !in_array($step, array('switch_tool','start_import'))){
+		switch_tool();
+	} else $step();
+ 
+// -------------------------------------------------------------
+// Select the tool we want to import from and provide required data 
+	function switch_tool(){
+			
+		global $vars,$step,$tools;
+		extract(gpsa($vars));
+		pagetop(gTxt('txp_import'), '');
+
+?>
+
+<script type="text/javascript">
+<!--//
+function showHideFields($sel)
+{
+	if(document.getElementById){
+		document.getElementById('mtblogid').style.display = ($sel=='mtdb') ? 'block': 'none';
+		document.getElementById('wponly').style.display =  ($sel=='wp') ? 'block': 'none';
+		document.getElementById('databased').style.display = ($sel=='wp' || $sel=='mtdb' || $sel=='b2')? 'block':'none';
+	}
+}
+//-->
+</script>
+
+<?php		
+		$content= startTable('edit'); 
+		$content.= tr(tdcs(hed(gTxt('txp_import'),3),2));		
+		//Select tool
+		$content.= tr(
+			fLabelCell ('select_tool','import').
+			td(
+				tag(type_options($tools),
+				 'select',
+				 " name=\"import_tool\" onchange=\"showHideFields(this.value);\"")
+			)
+		);
+		
+		
+		//Some data we collect
+		$content.= tr(
+			fLabelCell ('import_section','import_section').
+			td(import_section_popup(''))
+			);
+
+		$status_options = array(
+				4 => gTxt('live'),
+				1 => gTxt('draft'),
+				2 => gTxt('hidden'),
+				3 => gTxt('pending')
+			);
+
+		$content.= tr(
+			fLabelCell ('import_status','import_status').
+			td(type_select($status_options))
+		);
+
+		$content.= tr(
+			fLabelCell ('import_invite','import_invite').
+			td(fInput('text','comments_invite', gTxt('comments'),'edit'))
+		);			
+
+		//DataBase imports only
+
+		$databased = 
+		tr(tdcs(hed(gTxt('database_stuff'),3),2)).		
+		tr(
+			fLabelCell ('import_database','import_database').
+			td(fInput('text','importdb', '','edit'))
+		).
+		tr(
+			fLabelCell ('import_login','import_login').
+			td(fInput('text','importdblogin', '','edit'))
+		).		
+		tr(
+			fLabelCell ('import_password','import_password').
+			td(fInput('text','importdbpass', '','edit'))
+		).
+		tr(
+			fLabelCell ('import_host','import_host').
+			td(fInput('text','importdbhost', '','edit'))
+		);
+
+		//Ugly, but a way to present a clean screen with only required fields
+		//while we keep JavaScript code at minimum
+		$content.= tr(tda(tag($databased, 'table', ' id="databased" style="display: none; border: none;"'),' colspan="2"'));
+		//MT-DB Specific
+		$mtblogid = tr(
+			fLabelCell ('import_blogid','import_blogid').
+			td(fInput('text','blog_id','','edit'))
+		);
+		$content.= tr(tda(tag($mtblogid, 'table', ' id="mtblogid" style="display: none;  border: none;"'),' colspan="2"'));
+		//WordPress specific option
+		$wponly = tr(
+			fLabelCell ('import_wpprefix','import_wpprefix').
+			td(fInput('text','wpdbprefix', 'wp_','edit'))
+		);
+		$content.= tr(tda(tag($wponly, 'table', ' id="wponly" style="display: none;  border: none;"'),' colspan="2"'));
+				
+		$content.= endTable();
+		$content.= tag(fInput('submit','choose',gTxt('continue'),'publish'),'p',' style="text-align:center"');
+		$content.= sInput('start_import').eInput('import');
+		echo tag($content, 'form', ' id="import" action="index.php" method="post"');
+	}	
+	
+	
+// ------------------------------------------------------------
+//Pre import tasks, then call the import funtion
+	function start_import()
+	{	
+		global $vars;
+		extract(psa($vars));
+		
+		$insert_into_section = $Section;
+		$insert_with_status = $type;
+		$default_comment_invite = $comments_invite;
+		include_once txpath.'/include/import/import_'.$import_tool.'.php';
+		
+		$ini_time = ini_get('max_execution_time');
+		
+		@ini_set('max_execution_time', 300 + intval($ini_time) );
+		
+		switch ($import_tool)
+		{
+			case 'mtdb':
+				$out = doImportMTDB($importdblogin, $importdb, $importdbpass, $importdbhost, $blog_id, $insert_into_section, $insert_with_status, $default_comment_invite);
+				rebuild_tree('root',1,'article');
+			break;
+			case 'mt':
+				$file = check_import_file();
+				if (!empty($file)){
+					$out = doImportMT($file, $insert_into_section, $insert_with_status, $comments_invite);
+					//Rebuilding category tree
+					rebuild_tree('root',1,'article');
+				}else{
+					$out = 'Import file not found';
+				}
+			break;
+			case 'b2':
+				$out = doImportB2($importdblogin, $importdb, $importdbpass, $importdbhost, $insert_into_section, $insert_with_status, $default_comment_invite);
+			break;
+			case 'wp':
+				$out = doImportWP($importdblogin, $importdb, $importdbpass, $importdbhost, $wpdbprefix, $insert_into_section, $insert_with_status, $default_comment_invite);
+				rebuild_tree('root',1,'article');
+			break;
+			case 'blogger':
+				$file = check_import_file();
+				if (!empty($file)){
+					$out = doImportBLOGGER($file, $insert_into_section, $insert_with_status, $comments_invite);
+				}else{
+					$out = gTxt('import_file_not_found');
+				}
+			break;
+		}
+		
+		$out = tag('max_execution_time = '.ini_get('max_execution_time'),'p', ' style="color:red;"').$out;
+		pagetop(gTxt('txp_import'));
+		$content= startTable('list');
+		$content.= tr(tdcs(hed(gTxt('txp_import'),3),2));
+		$content.= tr(td($out));
+		$content.= endTable();
+		echo $content;
+
+		$rs = safe_rows_start('parentid, count(*) as thecount','txp_discuss','visible=1 group by parentid');  
+		if (mysql_num_rows($rs) > 0)
+        	while ($a = nextRow($rs))
+                safe_update('textpattern',"comments_count=".$a['thecount'],"ID=".$a['parentid']);  
+	}
+	
+	
+// -------------------------------------------------------------	
+//checks the existence of a file called import.txt on the import dir.
+// Used when importing from a file
+	function check_import_file()
+	{		
+		//Check here file size too. And explain how to split the file if
+		//size is too long and time_limit can not be altered
+		
+		$import_file = txpath.'/include/import/import.txt';
+		if (!is_file($import_file)) {
+			// trigger_error('Import file not found', E_USER_WARNING);
+			return '';
+		}
+		return $import_file;
+	}
+	
+// -------------------------------------------------------------
+// from Dean import
+// add slashes to $in, no matter if is a single
+
+	function array_slash($in)
+	{
+		return is_array($in) ? array_map('addslashes',$in) : addslashes($in); 
+	}	
+	
+
+// -----------------------------------------------------------------
+// Some cut and paste here
+//--------------------------------------------------------------
+// Display a popup of textpattern avaliable sections
+
+	function import_section_popup($Section)
+	{
+		$rs = safe_column("name", "txp_section", "name!='default'");
+		if ($rs) {
+			return selectInput("Section", $rs, $Section, 1);
+		}
+		return false;
+	}
+	
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_link.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_link.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_link.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,440 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_link.php $
+$LastChangedRevision: 1879 $
+
+*/
+
+	if (!defined('txpinterface'))
+	{
+		die('txpinterface is undefined.');
+	}
+
+	global $vars;
+
+	if ($event == 'link')
+	{	
+		require_privs('link');		
+
+		$vars = array('category', 'url', 'linkname', 'linksort', 'description', 'id');
+
+		$available_steps = array(
+			'link_list', 
+			'link_edit', 
+			'link_post', 
+			'link_save', 
+			'link_delete', 
+			'link_change_pageby', 
+			'link_multi_edit'
+		);
+
+		if (!$step or !function_exists($step) or !in_array($step, $available_steps))
+		{
+			link_edit();
+		}
+
+		else
+		{
+			$step();
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function link_list($message = '') 
+	{
+		global $step, $link_list_pageby;
+
+		extract(get_prefs());
+
+		extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
+
+		$dir = ($dir == 'desc') ? 'desc' : 'asc';
+
+		switch ($sort)
+		{
+			case 'id':
+				$sort_sql = 'id '.$dir;
+			break;
+
+			case 'name':
+				$sort_sql = 'linksort '.$dir.', id asc';
+			break;
+
+			case 'description':
+				$sort_sql = 'description '.$dir.', id asc';
+			break;
+
+			case 'category':
+				$sort_sql = 'category '.$dir.', id asc';
+			break;
+
+			case 'date':
+				$sort_sql = 'date '.$dir.', id asc';
+			break;
+
+			default:
+				$dir = 'asc';
+				$sort_sql = 'linksort asc';
+			break;
+		}
+
+		$switch_dir = ($dir == 'desc') ? 'asc' : 'desc';
+
+		$criteria = 1;
+
+		if ($search_method and $crit)
+		{
+			$crit_escaped = doSlash($crit);
+
+			$critsql = array(
+				'id'			     => "id = '$crit_escaped'",
+				'name'		     => "linkname like '%$crit_escaped%'",
+				'description'	 => "description like '%$crit_escaped%'",
+				'category'     => "category like '%$crit_escaped%'"
+			);
+
+			if (array_key_exists($search_method, $critsql))
+			{
+				$criteria = $critsql[$search_method];
+				$limit = 500;
+			}
+
+			else
+			{
+				$search_method = '';
+				$crit = '';
+			}
+		}
+
+		else
+		{
+			$search_method = '';
+			$crit = '';
+		}
+
+		$total = getCount('txp_link', $criteria);  
+
+		if ($total < 1)
+		{
+			if ($criteria != 1)
+			{
+				echo n.link_search_form($crit, $search_method).
+					n.graf(gTxt('no_results_found'), ' style="text-align: center;"');
+			}
+
+			else
+			{
+				echo n.graf(gTxt('no_links_recorded'), ' style="text-align: center;"');
+			}
+
+			return;
+		}
+
+		$limit = max(@$link_list_pageby, 15);
+
+		list($page, $offset, $numPages) = pager($total, $limit, $page);
+
+		echo link_search_form($crit, $search_method);
+
+		$rs = safe_rows_start('*, unix_timestamp(date) as uDate', 'txp_link', "$criteria order by $sort_sql limit $offset, $limit");
+
+		if ($rs)
+		{
+			echo n.n.'<form action="index.php" method="post" name="longform" onsubmit="return verify(\''.gTxt('are_you_sure').'\')">',
+
+				startTable('list').
+
+				n.tr(
+					column_head('ID', 'id', 'link', true, $switch_dir, $crit, $search_method).
+					hCell().
+					column_head('link_name', 'name', 'link', true, $switch_dir, $crit, $search_method).
+					column_head('description', 'description', 'link', true, $switch_dir, $crit, $search_method).
+					column_head('link_category', 'category', 'link', true, $switch_dir, $crit, $search_method).
+					column_head('date', 'date', 'link', true, $switch_dir, $crit, $search_method).
+					hCell()
+				);
+
+				while ($a = nextRow($rs))
+				{
+					extract($a);				
+
+					$edit_url = '?event=link'.a.'step=link_edit'.a.'id='.$id.a.'sort='.$sort.
+						a.'dir='.$dir.a.'page='.$page.a.'search_method='.$search_method.a.'crit='.$crit;
+
+					echo tr(
+
+						n.td($id, 20).
+
+						td(
+							n.'<ul>'.
+							n.t.'<li>'.href(gTxt('edit'), $edit_url).'</li>'.
+							n.t.'<li>'.href(gTxt('view'), $url).'</li>'.
+							n.'</ul>'
+						, 35).
+
+						td(
+							href($linkname, $edit_url)
+						, 125).
+
+						td(
+							$description
+						, 150).
+
+						td(
+							'<span title="'.fetch_category_title($category, 'link').'">'.$category.'</span>'
+						, 125).
+
+						td(
+							safe_strftime('%d %b %Y %I:%M %p', $uDate)
+						, 75).
+
+						td(
+							fInput('checkbox', 'selected[]', $id)
+						)
+					);
+				}
+
+			echo n.n.tr(
+				tda(
+					select_buttons().
+					link_multiedit_form($page, $sort, $dir, $crit, $search_method)
+				, ' colspan="7" style="text-align: right; border: none;"')
+			).
+
+			endTable().
+			'</form>'.
+
+			n.nav_form('link', $page, $numPages, $sort, $dir, $crit, $search_method).
+
+			pageby_form('link', $link_list_pageby);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function link_search_form($crit, $method)
+	{
+		$methods =	array(
+			'id'					=> gTxt('ID'),
+			'name'				=> gTxt('link_name'),
+			'description' => gTxt('description'),
+			'category'		=> gTxt('link_category')
+		);
+
+		return search_form('link', 'link_edit', $crit, $methods, $method, 'name');
+	}
+
+// -------------------------------------------------------------
+
+	function link_edit($message = '')
+	{
+		global $vars, $step;
+
+		pagetop(gTxt('edit_links'), $message);
+
+		extract(gpsa($vars));
+
+		if ($id && $step == 'link_edit')
+		{
+			$id = assert_int($id);
+			extract(safe_row('*', 'txp_link', "id = $id"));
+		}
+		
+		if ($step == 'link_save' or $step == 'link_post')
+		{
+			foreach ($vars as $var)
+			{
+				$$var = '';
+			}
+		}
+
+		echo form(
+
+			startTable('edit') .
+
+			tr(
+				fLabelCell('title', '', 'link-title').
+				fInputCell('linkname', $linkname, 1, 30, '', 'link-title')
+			).
+
+			tr(
+				fLabelCell('sort_value', '', 'link-sort').
+				fInputCell('linksort', $linksort, 2, 15, '', 'link-sort')
+			).
+
+			tr(
+				fLabelCell('url', 'link_url', 'link-url').
+				fInputCell('url', $url, 3, 30, '', 'link-url')
+			).
+
+			tr(
+				fLabelCell('link_category', 'link_category', 'link-category').
+
+				td(
+					linkcategory_popup($category).' ['.eLink('category', 'list', '', '', gTxt('edit')).']'
+				)
+			) .
+
+			tr(
+				tda(
+					'<label for="link-description">'.gTxt('description').'</label>'.sp.popHelp('link_description')
+				,' style="text-align: right; vertical-align: top;"').
+
+				td(
+					'<textarea id="link-description" name="description" cols="40" rows="7" tabindex="4">'.$description.'</textarea>'
+				)
+			).
+
+			tr(
+				td().
+				td(
+					fInput('submit', '', gTxt('save'), 'publish')
+				)
+			).
+
+			endTable().
+
+			eInput('link').
+			sInput( ($step == 'link_edit' ? 'link_save' : 'link_post') ).
+			hInput('id', $id).
+			hInput('search_method', gps('search_method')).
+			hInput('crit', gps('crit'))
+		, 'margin-bottom: 25px;');
+
+		echo link_list();
+	}
+
+//--------------------------------------------------------------
+
+	function linkcategory_popup($cat = '') 
+	{
+		return event_category_popup('link', $cat, 'link-category');		
+	}
+
+// -------------------------------------------------------------
+	function link_post()
+	{
+		global $txpcfg,$prefs,$vars;
+		$varray = gpsa($vars);
+
+		if($prefs['textile_links']) {
+
+			include_once txpath.'/lib/classTextile.php';
+			$textile = new Textile();
+		
+			$varray['linkname'] = $textile->TextileThis($varray['linkname'],'',1);
+			$varray['description'] = $textile->TextileThis($varray['description'],1);
+	
+		}
+	
+		extract(doSlash($varray));
+
+		if (!$linksort) $linksort = $linkname;
+
+		$q = safe_insert("txp_link",
+		   "category    = '$category',
+			date        = now(),
+			url         = '".trim($url)."',
+			linkname    = '$linkname',
+			linksort    = '$linksort',
+			description = '$description'"
+		);
+
+		$GLOBALS['ID'] = mysql_insert_id( );
+
+		if ($q)
+		{
+			//update lastmod due to link feeds
+			update_lastmod();
+
+			$message = gTxt('link_created', array('{name}' => $linkname));
+
+			link_edit($message);			
+		}
+	}
+
+// -------------------------------------------------------------
+	function link_save() 
+	{
+		global $txpcfg,$prefs,$vars;
+		$varray = gpsa($vars);
+
+		if($prefs['textile_links']) {
+
+			include_once txpath.'/lib/classTextile.php';
+			$textile = new Textile();
+			
+			$varray['linkname'] = $textile->TextileThis($varray['linkname'],'',1);
+			$varray['description'] = $textile->TextileThis($varray['description'],1);
+		
+		}
+		
+		extract(doSlash($varray));
+		
+		if (!$linksort) $linksort = $linkname;
+		$id = assert_int($id);
+
+		$rs = safe_update("txp_link",
+		   "category    = '$category',
+			url         = '".trim($url)."',
+			linkname    = '$linkname',
+			linksort    = '$linksort',
+			description = '$description'",
+		   "id = $id"
+		);
+
+		if ($rs)
+		{
+			update_lastmod();
+
+			$message = gTxt('link_updated', array('{name}' => doStrip($linkname)));
+
+			link_edit($message);
+		}
+	}
+
+// -------------------------------------------------------------
+	function link_change_pageby() 
+	{
+		event_change_pageby('link');
+		link_edit();
+	}
+
+// -------------------------------------------------------------
+
+	function link_multiedit_form($page, $sort, $dir, $crit, $search_method) 
+	{
+		$methods = array(
+			'delete' => gTxt('delete')
+		);
+
+		return event_multiedit_form('link', $methods, $page, $sort, $dir, $crit, $search_method);
+	}
+
+// -------------------------------------------------------------
+
+	function link_multi_edit() 
+	{
+		$deleted = event_multi_edit('txp_link', 'id');
+
+		if ($deleted)
+		{
+			$message = gTxt('links_deleted', array('{list}' => $deleted));
+
+			return link_edit($message);
+		}
+
+		return link_edit();
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_list.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_list.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_list.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,508 @@
+<?php
+/*
+	This is Textpattern
+	Copyright 2005 by Dean Allen 
+ 	All rights reserved.
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_list.php $
+$LastChangedRevision: 1892 $
+
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	global $statuses;
+	$statuses = array(
+		1 => gTxt('draft'),
+		2 => gTxt('hidden'),
+		3 => gTxt('pending'),
+		4 => gTxt('live'),
+		5 => gTxt('sticky'),
+	);
+
+	if ($event=='list') {
+		require_privs('article');
+
+		if(!$step or !in_array($step, array('list_change_pageby','list_list','list_multi_edit','list_list'))){
+			list_list();
+		} else $step();
+	}
+
+//--------------------------------------------------------------
+
+	function list_list($message = '', $post = '')
+	{
+		global $statuses, $comments_disabled_after, $step, $txp_user;
+
+		pagetop(gTxt('tab_list'), $message);
+
+		extract(get_prefs());
+
+		extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
+
+		$sesutats = array_flip($statuses);
+
+		$dir = ($dir == 'desc') ? 'desc' : 'asc';
+
+		switch ($sort)
+		{
+			case 'id':
+				$sort_sql = 'ID '.$dir;
+			break;
+
+			case 'posted':
+				$sort_sql = 'Posted '.$dir;
+			break;
+
+			case 'title':
+				$sort_sql = 'Title '.$dir.', Posted desc';
+			break;
+
+			case 'section':
+				$sort_sql = 'Section '.$dir.', Posted desc';
+			break;
+
+			case 'category1':
+				$sort_sql = 'Category1 '.$dir.', Posted desc';
+			break;
+
+			case 'category2':
+				$sort_sql = 'Category2 '.$dir.', Posted desc';
+			break;
+
+			case 'status':
+				$sort_sql = 'Status '.$dir.', Posted desc';
+			break;
+
+			case 'author':
+				$sort_sql = 'AuthorID '.$dir.', Posted desc';
+			break;
+
+			case 'comments':
+				$sort_sql = 'comments_count '.$dir.', Posted desc';
+			break;
+
+			default:
+				$dir = 'desc';
+				$sort_sql = 'Posted '.$dir;
+			break;
+		}
+
+		$switch_dir = ($dir == 'desc') ? 'asc' : 'desc';
+
+		$criteria = 1;
+
+		if ($search_method and $crit)
+		{
+			$crit_escaped = doSlash($crit);
+
+			$critsql = array(
+				'id'         => "ID = '$crit_escaped'",
+				'title_body' => "Title rlike '$crit_escaped' or Body rlike '$crit_escaped'",
+				'section'		 => "Section rlike '$crit_escaped'",
+				'categories' => "Category1 rlike '$crit_escaped' or Category2 rlike '$crit_escaped'",
+				'status'		 => "Status = '".(@$sesutats[gTxt($crit_escaped)])."'",
+				'author'		 => "AuthorID rlike '$crit_escaped'",
+			);
+
+			if (array_key_exists($search_method, $critsql))
+			{
+				$criteria = $critsql[$search_method];
+				$limit = 500;
+			}
+
+			else
+			{
+				$search_method = '';
+				$crit = '';
+			}
+		}
+
+		else
+		{
+			$search_method = '';
+			$crit = '';
+		}
+
+		$total = safe_count('textpattern', "$criteria");
+
+		if ($total < 1)
+		{
+			if ($criteria != 1)
+			{
+				echo n.list_search_form($crit, $search_method).
+					n.graf(gTxt('no_results_found'), ' style="text-align: center;"');
+			}
+
+			else
+			{
+				echo graf(gTxt('no_articles_recorded'), ' style="text-align: center;"');
+			}
+
+			return;
+		}
+
+		$limit = max(@$article_list_pageby, 15);
+
+		list($page, $offset, $numPages) = pager($total, $limit, $page);
+
+		echo n.list_search_form($crit, $search_method);
+
+		$rs = safe_rows_start('*, unix_timestamp(Posted) as posted', 'textpattern',
+			"$criteria order by $sort_sql limit $offset, $limit"
+		);
+
+		if ($rs)
+		{
+			$total_comments = array();
+
+			// fetch true comment count, not the public comment count
+			// maybe we should have another row in the db?
+			$rs2 = safe_rows_start('parentid, count(*) as num', 'txp_discuss', "1 group by parentid order by parentid");
+
+			if ($rs2)
+			{
+				while ($a = nextRow($rs2))
+				{
+					$pid = $a['parentid'];
+					$num = $a['num'];
+	
+					$total_comments[$pid] = $num;
+				}
+			}
+
+			echo n.n.'<form name="longform" method="post" action="index.php" onsubmit="return verify(\''.gTxt('are_you_sure').'\')">'.
+
+				n.startTable('list','','','','90%').
+				n.tr(
+					n.column_head('ID', 'id', 'list', true, $switch_dir, $crit, $search_method).
+					column_head('posted', 'posted', 'list', true, $switch_dir, $crit, $search_method).
+					column_head('title', 'title', 'list', true, $switch_dir, $crit, $search_method).
+					column_head('section', 'section', 'list', true, $switch_dir, $crit, $search_method).
+					column_head('category1', 'category1', 'list', true, $switch_dir, $crit, $search_method, 'articles_detail').
+					column_head('category2', 'category2', 'list', true, $switch_dir, $crit, $search_method, 'articles_detail').
+					column_head('status', 'status', 'list', true, $switch_dir, $crit, $search_method).
+					column_head('author', 'author', 'list', true, $switch_dir, $crit, $search_method).
+					column_head('comments', 'comments', 'list', true, $switch_dir, $crit, $search_method, 'articles_detail').
+					hCell()
+				);
+
+			include_once txpath.'/publish/taghandlers.php';
+
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				if (empty($Title))
+				{
+					$Title = '<em>'.eLink('article', 'edit', 'ID', $ID, gTxt('untitled')).'</em>';
+				}
+
+				else
+				{
+					$Title = eLink('article', 'edit', 'ID', $ID, $Title);
+				}
+
+				$Category1 = ($Category1) ? '<span title="'.htmlspecialchars(fetch_category_title($Category1)).'">'.$Category1.'</span>' : '';
+				$Category2 = ($Category2) ? '<span title="'.htmlspecialchars(fetch_category_title($Category2)).'">'.$Category2.'</span>' : '';
+
+				$manage = n.'<ul class="articles_detail">'.
+						n.t.'<li>'.eLink('article', 'edit', 'ID', $ID, gTxt('edit')).'</li>'.
+						( ($Status == 4 or $Status == 5) ? n.t.'<li><a href="'.permlinkurl($a).'">'.gTxt('view').'</a></li>' : '' ).
+						n.'</ul>';
+
+				$Status = !empty($Status) ? $statuses[$Status] : '';
+
+				$comments = gTxt('none');
+
+				if (isset($total_comments[$ID]) and $total_comments[$ID] > 0)
+				{
+					$comments = href(gTxt('manage'), 'index.php?event=discuss'.a.'step=list'.a.'search_method=parent'.a.'crit='.$ID).
+						' ('.$total_comments[$ID].')';
+				}
+
+				$comment_status = ($Annotate) ? gTxt('on') : gTxt('off');
+
+				if ($comments_disabled_after)
+				{
+					$lifespan = $comments_disabled_after * 86400;
+					$time_since = time() - $posted;
+
+					if ($time_since > $lifespan)
+					{
+						$comment_status = gTxt('expired');
+					}
+				}
+
+				$comments = n.'<ul>'.
+					n.t.'<li>'.$comment_status.'</li>'.
+					n.t.'<li>'.$comments.'</li>'.
+					n.'</ul>';
+
+				echo n.n.tr(
+
+					n.td(eLink('article', 'edit', 'ID', $ID, $ID).$manage).
+
+					td(
+						safe_strftime('%d %b %Y %I:%M %p', $posted)
+					).
+
+					td($Title).
+
+					td(
+						'<span title="'.htmlspecialchars(fetch_section_title($Section)).'">'.$Section.'</span>'
+					, 75).
+
+					td($Category1, 100, "articles_detail").
+					td($Category2, 100, "articles_detail").
+					td(($a['Status'] < 4 ? $Status : '<a href="'.permlinkurl($a).'">'.$Status.'</a>'), 50).
+
+					td(
+						'<span title="'.htmlspecialchars(get_author_name($AuthorID)).'">'.$AuthorID.'</span>'
+					).
+
+					td($comments, 50, "articles_detail").
+
+					td((
+						(  ($a['Status'] >= 4 and has_privs('article.edit.published'))
+						or ($a['Status'] >= 4 and $AuthorID == $txp_user 
+											     and has_privs('article.edit.own.published'))
+						or ($a['Status'] < 4 and has_privs('article.edit'))
+						or ($a['Status'] < 4 and $AuthorID == $txp_user and has_privs('article.edit.own'))
+						)  
+						? fInput('checkbox', 'selected[]', $ID)
+						: '&nbsp;'
+					))
+				);
+			}
+
+			echo n.n.tr(
+				tda(
+					toggle_box('articles_detail'),
+					' colspan="2" style="text-align: left; border: none;"'
+				).
+
+				tda(
+					select_buttons().
+					list_multiedit_form($page, $sort, $dir, $crit, $search_method)
+				,' colspan="9" style="text-align: right; border: none;"')
+			).
+
+			n.endTable().
+			n.'</form>'.
+
+			n.nav_form('list', $page, $numPages, $sort, $dir, $crit, $search_method).
+
+			n.pageby_form('list', $article_list_pageby);
+		}
+	}
+
+// -------------------------------------------------------------
+	function list_change_pageby() 
+	{
+		event_change_pageby('article');
+		list_list();
+	}
+
+// -------------------------------------------------------------
+
+	function list_search_form($crit, $method)
+	{
+		$methods =	array(
+			'id'				 => gTxt('ID'),
+			'title_body' => gTxt('title_body'),
+			'section'		 => gTxt('section'),
+			'categories' => gTxt('categories'),
+			'status'		 => gTxt('status'),
+			'author'		 => gTxt('author')
+		);
+
+		return search_form('list', 'list', $crit, $methods, $method, 'title_body');
+	}
+
+// -------------------------------------------------------------
+
+	function list_multiedit_form($page, $sort, $dir, $crit, $search_method)
+	{
+		$methods = array(
+			'changesection'   => gTxt('changesection'),
+			'changecategory1' => gTxt('changecategory1'),
+			'changecategory2' => gTxt('changecategory2'),
+			'changestatus'    => gTxt('changestatus'),
+			'changecomments'  => gTxt('changecomments'),
+			'changeauthor'    => gTxt('changeauthor'),
+			'delete'          => gTxt('delete'),
+		);
+
+		return event_multiedit_form('list', $methods, $page, $sort, $dir, $crit, $search_method);
+	}
+
+// -------------------------------------------------------------
+
+	function list_multi_edit()
+	{
+		global $txp_user;
+
+		$selected = ps('selected');
+
+		if (!$selected)
+		{
+			return list_list();
+		}
+
+		$method = ps('edit_method');
+		$changed = false;
+		$ids = array();
+
+		if ($method == 'delete')
+		{
+			if (!has_privs('article.delete'))
+			{
+				$allowed = array();
+
+				if (has_privs('article.delete.own'))
+				{
+					foreach ($selected as $id)
+					{
+						$id = assert_int($id);
+						$author = safe_field('AuthorID', 'textpattern', "ID = $id");
+
+						if ($author == $txp_user)
+						{
+							$allowed[] = $id;
+						}
+					}
+				}
+
+				$selected = $allowed;
+			}
+
+			foreach ($selected as $id)
+			{
+				$id = assert_int($id);
+
+				if (safe_delete('textpattern', "ID = $id"))
+				{
+					$ids[] = $id;
+				}
+			}
+
+			$changed = join(', ', $ids);
+		}
+
+		else
+		{
+			$selected = array_map('assert_int', $selected);  
+			$selected = safe_rows('ID, AuthorID, Status', 'textpattern', 
+									  'ID in ('. implode(',',$selected) .')');
+
+			$allowed = array();
+			foreach ($selected as $item)
+			{
+				if ( ($item['Status'] >= 4 and has_privs('article.edit.published'))
+				  or ($item['Status'] >= 4 and $item['AuthorID'] == $txp_user and has_privs('article.edit.own.published'))
+				  or ($item['Status'] < 4 and has_privs('article.edit'))
+				  or ($item['Status'] < 4 and $item['AuthorID'] == $txp_user and has_privs('article.edit.own')))
+				{
+					$allowed[] = $item['ID'];
+				}
+			}
+
+			$selected = $allowed; unset($allowed);
+
+			switch ($method)
+			{
+				// change author
+				case 'changeauthor':
+
+					$key = 'AuthorID';
+					$val = has_privs('article.edit') ? ps('AuthorID') : '';
+
+					// do not allow to be set to an empty value
+					if (!$val)
+					{
+						$selected = array();
+					}
+
+				break;
+
+				// change category1
+				case 'changecategory1':
+					$key = 'Category1';
+					$val = ps('Category1');
+				break;
+
+				// change category2
+				case 'changecategory2':
+					$key = 'Category2';
+					$val = ps('Category2');
+				break;
+
+				// change comments
+				case 'changecomments':
+					$key = 'Annotate';
+					$val = (int) ps('Annotate');
+				break;
+
+				// change section
+				case 'changesection':
+
+					$key = 'Section';
+					$val = ps('Section');
+
+					// do not allow to be set to an empty value
+					if (!$val)
+					{
+						$selected = array();
+					}
+
+				break;
+
+				// change status
+				case 'changestatus':
+
+					$key = 'Status';
+					$val = ps('Status');
+					if (!has_privs('article.publish') && $val>=4) $val = 3;
+
+					// do not allow to be set to an empty value
+					if (!$val)
+					{
+						$selected = array();
+					}
+
+				break;
+
+				default:
+					$key = '';
+					$val = '';
+				break;
+			}
+
+			if ($selected and $key)
+			{
+				foreach ($selected as $id)
+				{
+					if (safe_update('textpattern', "$key = '".doSlash($val)."'", "ID = $id"))
+					{
+						$ids[] = $id;
+					}
+				}
+
+				$changed = join(', ', $ids);
+			}
+		}
+
+		if ($changed)
+		{
+			return list_list(
+				messenger('article', $changed, (($method == 'delete') ? 'deleted' : 'modified' ))
+			);
+		}
+
+		return list_list();
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_log.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_log.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_log.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,295 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of
+	the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_log.php $
+$LastChangedRevision: 1919 $
+
+*/
+	if (!defined('txpinterface'))
+	{
+		die('txpinterface is undefined.');
+	}
+
+	if ($event == 'log')
+	{
+		require_privs('log');
+
+		$available_steps = array(
+			'log_change_pageby',
+			'log_multi_edit'
+		);
+
+		if (!$step or !in_array($step, $available_steps))
+		{
+			log_list();
+		}
+
+		else
+		{
+			$step();
+		}
+	}
+
+
+//-------------------------------------------------------------
+
+	function log_list($message = '') 
+	{
+		pagetop(gTxt('visitor_logs'), $message);
+
+		extract(get_prefs());
+
+		extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
+
+		$expire_logs_after = assert_int($expire_logs_after);
+
+		safe_delete('txp_log', "time < date_sub(now(), interval $expire_logs_after day)");
+
+		$dir = ($dir == 'desc') ? 'desc' : 'asc';
+
+		switch ($sort)
+		{
+			case 'time':
+				$sort_sql = 'time '.$dir;
+			break;
+
+			case 'ip':
+				$sort_sql = 'ip '.$dir;
+			break;
+
+			case 'host':
+				$sort_sql = 'host '.$dir;
+			break;
+
+			case 'page':
+				$sort_sql = 'page '.$dir;
+			break;
+
+			case 'refer':
+				$sort_sql = 'refer '.$dir;
+			break;
+
+			case 'method':
+				$sort_sql = 'method '.$dir;
+			break;
+
+			case 'status':
+				$sort_sql = 'status '.$dir;
+			break;
+
+			default:
+				$dir = 'desc';
+				$sort_sql = 'time '.$dir;
+			break;
+		}
+
+		$switch_dir = ($dir == 'desc') ? 'asc' : 'desc';
+
+		$criteria = 1;
+
+		if ($search_method and $crit)
+		{
+			$crit_escaped = doSlash($crit);
+
+			$critsql = array(
+				'ip'     => "ip like '%$crit_escaped%'",
+				'host'   => "host like '%$crit_escaped%'",
+				'page'   => "page like '%$crit_escaped%'",
+				'refer'  => "refer like '%$crit_escaped%'",
+				'method' => "method like '%$crit_escaped%'",
+				'status' => "status like '%$crit_escaped%'"
+			);
+
+			if (array_key_exists($search_method, $critsql))
+			{
+				$criteria = $critsql[$search_method];
+				$limit = 500;
+			}
+
+			else
+			{
+				$search_method = '';
+				$crit = '';
+			}
+		}
+
+		else
+		{
+			$search_method = '';
+			$crit = '';
+		}
+
+		$total = safe_count('txp_log', "$criteria");
+
+		if ($total < 1)
+		{
+			if ($criteria != 1)
+			{
+				echo n.log_search_form($crit, $search_method).
+					n.graf(gTxt('no_results_found'), ' style="text-align: center;"');
+			}
+
+			else
+			{
+				echo graf(gTxt('no_refers_recorded'), ' style="text-align: center;"');
+			}
+
+			return;
+		}
+ 
+		$limit = max(@$log_list_pageby, 15);
+
+		list($page, $offset, $numPages) = pager($total, $limit, $page);
+
+		echo n.log_search_form($crit, $search_method);
+
+		$rs = safe_rows_start('*, unix_timestamp(time) as uTime', 'txp_log',
+			"$criteria order by $sort_sql limit $offset, $limit");
+
+		if ($rs)
+		{
+			echo n.n.'<form action="index.php" method="post" name="longform" onsubmit="return verify(\''.gTxt('are_you_sure').'\')">'.
+
+				startTable('list','','','','90%').
+
+				n.tr(
+					n.column_head('time', 'time', 'log', true, $switch_dir, $crit, $search_method).
+					column_head('IP', 'ip', 'log', true, $switch_dir, $crit, $search_method, 'log_detail').
+					column_head('host', 'host', 'log', true, $switch_dir, $crit, $search_method).
+					column_head('page', 'page', 'log', true, $switch_dir, $crit, $search_method).
+					column_head('referrer', 'refer', 'log', true, $switch_dir, $crit, $search_method).
+					column_head('method', 'method', 'log', true, $switch_dir, $crit, $search_method, 'log_detail').
+					column_head('status', 'status', 'log', true, $switch_dir, $crit, $search_method, 'log_detail').
+					hCell()
+				);
+
+			while ($a = nextRow($rs))
+			{
+				extract($a, EXTR_PREFIX_ALL, 'log');
+
+				if ($log_refer)
+				{
+					$log_refer = htmlspecialchars('http://'.$log_refer);
+
+					$log_refer = '<a href="'.$log_refer.'" target="_blank">'.soft_wrap($log_refer, 30).'</a>';
+				}
+
+				if ($log_page)
+				{
+					$log_page = htmlspecialchars($log_page);
+
+					$log_page = '<a href="'.$log_page.'" target="_blank">'.
+						soft_wrap(
+							preg_replace('/\/$/','', substr($log_page, 1))
+						, 30).
+						'</a>';
+
+					if ($log_method == 'POST')
+					{
+						$log_page = '<strong>'.$log_page.'</strong>';
+					}
+				}
+
+				echo tr(
+
+					n.td(
+						safe_strftime('%d %b %Y %I:%M:%S %p', $log_uTime)
+					, 85).
+
+					td($log_ip, 20, 'log_detail').
+
+					td(soft_wrap($log_host, 30)).
+
+					td($log_page).
+					td($log_refer).
+					td($log_method, 50, 'log_detail').
+					td($log_status, 50, 'log_detail').
+
+					td(
+						fInput('checkbox', 'selected[]', $log_id)
+					)
+
+				);
+			}
+
+			echo n.n.tr(
+				tda(
+					toggle_box('log_detail'),
+					' colspan="2" style="text-align: left; border: none;"'
+				).
+				tda(
+					select_buttons().
+					log_multiedit_form($page, $sort, $dir, $crit, $search_method)
+				, ' colspan="6" style="text-align: right; border: none;"')
+			).
+
+			n.endTable().
+			'</form>'.
+
+			n.nav_form('log', $page, $numPages, $sort, $dir, $crit, $search_method).
+
+			n.pageby_form('log', $log_list_pageby);
+		} 
+	}
+
+//-------------------------------------------------------------
+
+	function log_search_form($crit, $method)
+	{
+		$methods =	array(
+			'ip'     => gTxt('IP'),
+			'host'	 => gTxt('host'),
+			'page'   => gTxt('page'),
+			'refer'	 => gTxt('referrer'),
+			'method' => gTxt('method'),
+			'status' => gTxt('status')
+		);
+
+		return search_form('log', 'log_list', $crit, $methods, $method, 'page');
+	}
+
+//-------------------------------------------------------------
+
+	function log_change_pageby() 
+	{
+		event_change_pageby('log');
+		log_list();
+	}
+
+// -------------------------------------------------------------
+
+	function log_multiedit_form($page, $sort, $dir, $crit, $search_method) 
+	{
+		$methods = array(
+			'delete' => gTxt('delete')
+		);
+
+		return event_multiedit_form('log', $methods, $page, $sort, $dir, $crit, $search_method);
+	}
+
+// -------------------------------------------------------------
+
+	function log_multi_edit() 
+	{
+		$deleted = event_multi_edit('txp_log', 'id');
+
+		if ($deleted)
+		{
+			$message = gTxt('logs_deleted', array('{list}' => $deleted));
+
+			return log_list($message);
+		}
+
+		return log_list();
+	}
+	
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_page.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_page.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_page.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,268 @@
+<?php
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_page.php $
+$LastChangedRevision: 1913 $
+
+*/
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	if ($event == 'page') {
+		require_privs('page');		
+
+		if(!$step or !in_array($step, array('page_edit','page_save','page_delete','div_edit','div_save','page_list'))){
+			page_edit();
+		} else $step();
+	}
+	
+//-------------------------------------------------------------
+	function page_edit($message='')
+	{
+		global $step;
+		pagetop(gTxt('edit_pages'),$message);
+		extract(gpsa(array('name','div','newname','copy')));
+		$name = (!$name or $step=='page_delete') ? 'default' : $name;
+		$name = ( $copy && trim(preg_replace('/[<>&"\']/', '', $newname)) ) ? $newname : $name;
+
+		echo 
+			startTable('edit').
+			tr(
+				tda(
+
+					n.hed(
+						gTxt('tagbuilder')
+					, 2).
+
+					n.n.hed(
+						'<a href="#article-tags" onclick="toggleDisplay(\'article-tags\'); return false;">'.gTxt('page_article_hed').'</a>'
+					, 3, ' class="plain"').
+						n.'<div id="article-tags">'.taglinks('page_article').'</div>'.
+
+					n.n.hed('<a href="#article-nav-tags" onclick="toggleDisplay(\'article-nav-tags\'); return false;">'.gTxt('page_article_nav_hed').'</a>'
+					, 3, ' class="plain"').
+						n.'<div id="article-nav-tags" style="display: none;">'.taglinks('page_article_nav').'</div>'.
+
+					n.n.hed('<a href="#nav-tags" onclick="toggleDisplay(\'nav-tags\'); return false;">'.gTxt('page_nav_hed').'</a>'
+					, 3, ' class="plain"').
+						n.'<div id="nav-tags" style="display: none;">'.taglinks('page_nav').'</div>'.
+
+					n.n.hed('<a href="#xml-tags" onclick="toggleDisplay(\'xml-tags\'); return false;">'.gTxt('page_xml_hed').'</a>'
+					, 3, ' class="plain"').
+						n.'<div id="xml-tags" style="display: none;">'.taglinks('page_xml').'</div>'.
+
+					n.n.hed('<a href="#misc-tags" onclick="toggleDisplay(\'misc-tags\'); return false;">'.gTxt('page_misc_hed').'</a>'
+					, 3, ' class="plain"').
+						n.'<div id="misc-tags" style="display: none;">'.taglinks('page_misc').'</div>'.
+
+					n.n.hed('<a href="#file-tags" onclick="toggleDisplay(\'file-tags\'); return false;">'.gTxt('page_file_hed').'</a>'
+					, 3, ' class="plain"').
+						n.'<div id="file-tags" style="display: none;">'.taglinks('page_file').'</div>'
+
+				,' class="column"').
+
+				tda(
+					page_edit_form($name)
+				, ' class="column"').
+
+				tda(
+					hed(gTxt('all_pages'), 2).
+					page_list($name)
+				, ' class="column"')
+			).
+
+			endTable();
+	}
+
+// -------------------------------------------------------------
+	#deprecated
+	function div_edit() 
+	{
+		return page_edit();
+	}
+
+//-------------------------------------------------------------
+	function page_edit_form($name) 
+	{
+		global $step;
+		if ($step=='div_edit') {
+			list($html_array,$html,$start_pos,$stop_pos) = extract_div();
+			$html_array = serialize($html_array);
+			$outstep = 'div_save';
+		} else {
+			$html = safe_field('user_html','txp_page',"name='".doSlash($name)."'");
+			$outstep = 'page_save';
+		}
+
+		$divline = ($step == 'div_edit') ? graf(gTxt('you_are_editing_div').sp.strong($div)) : '';
+
+		$out[] = '<p>'.gTxt('you_are_editing_page').sp.strong($name).$divline.br.
+					'<textarea id="html" class="code" name="html" cols="84" rows="36">'.htmlspecialchars($html).'</textarea>'.br.
+					n.fInput('submit','save',gTxt('save'),'publish').
+					n.eInput('page').
+					n.sInput($outstep).
+					n.hInput('name',$name);
+				
+			if($step=='div_edit') {
+				$out[] = 
+					n.hInput('html_array',$html_array).
+				  	n.hInput('start_pos',$start_pos).
+				  	n.hInput('stop_pos',$stop_pos).
+				  	n.hInput('name',$name);
+			} else {
+				$out[] = 
+						n.'<label for="copy-page">'.gTxt('copy_page_as').'</label>'.sp.
+						n.fInput('text', 'newname', '', 'edit', '', '', '', '', 'copy-page').
+						n.fInput('submit','copy',gTxt('copy'),'smallerbox').'</p>'; 
+			}
+		return form(join('',$out));
+	}
+
+//-------------------------------------------------------------
+	function page_list($current)
+	{
+		$rs = safe_rows_start("name", "txp_page", "name != '' order by name");			
+		while ($a = nextRow($rs)) {
+			extract($a);
+			$dlink = ($name!='default') ? dLink('page','page_delete','name',$name) :'';
+			$link  = eLink('page', '', 'name', $name, $name);
+			$out[] = ($current == $name) 
+			?	tr(td($name).td($dlink))
+			:	tr(td($link).td($dlink));
+		}
+		return startTable('list').join(n,$out).endTable();
+	}
+	
+//-------------------------------------------------------------
+
+	function page_delete()
+	{
+		$name = doSlash(ps('name'));
+
+		if ($name == 'default')
+		{
+			return page_edit();
+		}
+
+		safe_delete('txp_page', "name = '$name'");
+
+		$message = gTxt('page_deleted', array('{name}' => $name));
+
+		page_edit($message);
+	}
+
+// -------------------------------------------------------------
+
+	function page_save()
+	{
+		extract(doSlash(gpsa(array('name', 'html', 'copy'))));
+
+		if ($copy)
+		{
+			$newname = doSlash(trim(preg_replace('/[<>&"\']/', '', gps('newname'))));
+			if ($newname and safe_field('name', 'txp_page', "name = '$newname'"))
+			{
+				$message = gTxt('page_already_exists', array('{name}' => $newname));
+			}
+			elseif ($newname) 
+			{
+				safe_insert('txp_page', "name = '$newname', user_html = '$html'");
+				update_lastmod();
+ 
+				$message = gTxt('page_created', array('{name}' => $newname));
+			}
+			else 
+			{
+				$message = gTxt('page_name_invalid');
+			}
+
+ 			page_edit($message);
+		}
+
+		else
+		{
+			safe_update('txp_page', "user_html = '$html'", "name = '$name'");
+
+			update_lastmod();
+
+			$message = gTxt('page_updated', array('{name}' => $name));
+
+			page_edit($message);
+		}
+	}
+
+//-------------------------------------------------------------
+	function taglinks($type) 
+	{
+		return popTagLinks($type);
+	}
+
+// -------------------------------------------------------------
+	#deprecated
+	function extract_div() 
+	{
+		extract(doSlash(gpsa(array('name','div'))));
+		$name = (!$name) ? 'default' : $name;
+		$html = safe_field('user_html','txp_page',"name='$name'");
+		
+		$goodlevel = (preg_match("/<div id=\"container\"/i",$html)) ? 2 : 1;
+		
+		if ($div) {
+		
+			$html_array = preg_split("/(<.*>)/U",$html,-1,PREG_SPLIT_DELIM_CAPTURE);
+						
+			$level = 0;
+			$count = -1;
+			$indiv = false;
+			foreach($html_array as $a) {
+				$count++;
+				if(preg_match("/^<div/i",$a)) $level++;
+				if(preg_match("/^<div id=\"$div\"/i",$a)) {
+					$indiv = true;
+					$start_pos = $count;
+				}
+
+				if ($indiv) $thediv[] = $a;
+
+#				print n.$count.': '.$level.': '.$a;
+
+				if($level==$goodlevel && preg_match("/^<\/div/i",$a) && $indiv) {
+					$indiv = false;
+					$stop_pos = $count;
+				}
+				if(preg_match("/^<\/div/i",$a)) $level--;
+			}
+			return array($html_array,join('',$thediv),$start_pos,$stop_pos);
+		}
+	}
+	
+// -------------------------------------------------------------
+	#deprecated
+	function div_save()
+	{
+		extract(gpsa(array('html_array', 'html', 'start_pos', 'stop_pos', 'name')));
+
+		$html_array = unserialize($html_array);
+
+		$repl_array = preg_split("/(<.*>)/U", $html, -1, PREG_SPLIT_DELIM_CAPTURE);
+
+		array_splice($html_array, $start_pos, ($stop_pos - $start_pos) + 1, $repl_array);
+
+		$html = doSlash(join('', $html_array));
+
+		safe_update('txp_page', "user_html = '$html'", "name = '".doSlash($name)."'");
+
+		$message = gTxt('page_updated', array('{name}' => $name));
+
+		page_edit($message);
+
+		// print_r($html_array);
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_plugin.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_plugin.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_plugin.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,354 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_plugin.php $
+$LastChangedRevision: 1917 $
+
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	if ($event == 'plugin') {
+		require_privs('plugin');		
+
+		if(!$step or !in_array($step, array('plugin_delete','plugin_edit','plugin_help','plugin_list','plugin_install','plugin_save','plugin_verify','switch_status'))){
+			plugin_list();
+		} else $step();
+	}
+	
+// -------------------------------------------------------------
+
+	function plugin_list($message = '')
+	{	
+		pagetop(gTxt('edit_plugins'), $message);
+
+		echo n.n.startTable('list').
+			tr(
+				tda(
+					plugin_form()
+				,' colspan="8" style="height: 30px; border: none;"')
+			);
+
+		$rs = safe_rows_start('*, md5(code) as md5', 'txp_plugin', "1 order by name");
+
+		if ($rs and numRows($rs) > 0)
+		{
+			echo assHead('plugin', 'author', 'version', 'plugin_modified', 'description', 'active', 'help', '', '');
+
+			while ($a = nextRow($rs))
+			{
+				foreach ($a as $key => $value) {
+					$$key = htmlspecialchars($value);
+				}
+				// Fix up the description for clean cases
+				$description = preg_replace(array('#&lt;br /&gt;#',
+												  '#&lt;(/?(a|b|i|em|strong))&gt;#',
+												  '#&lt;a href=&quot;(https?|\.|\/|ftp)([A-Za-z0-9:/?.=_]+?)&quot;&gt;#'),
+											array('<br />','<$1>','<a href="$1$2">'),
+											$description);
+
+				$help = !empty($help) ?
+					'<a href="?event=plugin'.a.'step=plugin_help'.a.'name='.$name.'">'.gTxt('view').'</a>' :
+					gTxt('none');
+
+				// modified?
+				$modified = (strtolower($md5) != strtolower($code_md5));
+
+				echo tr(
+
+					n.td($name).
+
+					td(
+						href($author, $author_uri)
+					).
+
+					td($version, 10).
+					td($modified ? gTxt('yes') : '').
+					td($description, 260).
+
+					td(
+						status_link($status, $name, yes_no($status))
+					,30).
+
+					td($help).
+
+					td(
+						eLink('plugin', 'plugin_edit', 'name', $name, gTxt('edit'))
+					).
+
+					td(
+						dLink('plugin', 'plugin_delete', 'name', $name)
+					,30)
+				);
+
+				unset($name, $page, $deletelink);
+			}
+		}
+
+		echo endTable();
+	}
+	
+// -------------------------------------------------------------
+
+	function switch_status()
+	{
+		extract(gpsa(array('name', 'status')));
+
+		$change = ($status) ? 0 : 1;
+
+		safe_update('txp_plugin', "status = $change", "name = '".doSlash($name)."'");
+
+		$message = gTxt('plugin_updated', array('{name}' => $name));
+
+		plugin_list($message);
+	}
+
+// -------------------------------------------------------------
+  function plugin_edit()
+  {
+		$name = gps('name');
+		pagetop(gTxt('edit_plugins'));
+		echo plugin_edit_form($name);
+  }
+
+  
+// -------------------------------------------------------------
+	function plugin_help() 
+	{
+		$name = gps('name');
+		pagetop(gTxt('plugin_help'));
+		$help = ($name) ? safe_field('help','txp_plugin',"name = '".doSlash($name)."'") : '';
+		echo 
+		startTable('edit')
+		.	tr(tda($help,' width="600"'))
+		.	endTable();
+		
+	}
+
+// -------------------------------------------------------------
+	function plugin_edit_form($name='') 
+	{
+		$sub = fInput('submit','',gTxt('save'),'publish');
+		$code = ($name) ? fetch('code','txp_plugin','name',$name) : '';
+		$thing = ($code)
+		?	$code
+		:	'';
+		$textarea = '<textarea id="plugin-code" class="code" name="code" rows="28" cols="90">'.htmlspecialchars($thing).'</textarea>';
+
+		return 
+		form(startTable('edit')
+		.	tr(td($textarea))
+		.	tr(td($sub))
+#		.	tr(td($help))
+		.	endTable().sInput('plugin_save').eInput('plugin').hInput('name',$name));
+	}
+
+// -------------------------------------------------------------  
+
+	function plugin_save()
+	{
+		extract(doSlash(gpsa(array('name', 'code'))));
+
+		safe_update('txp_plugin', "code = '$code'", "name = '$name'");
+
+		$message = gTxt('plugin_saved', array('{name}' => $name));
+
+		plugin_list($message);
+	}
+
+// -------------------------------------------------------------
+
+	function plugin_delete()
+	{
+		$name = doSlash(ps('name'));
+
+		safe_delete('txp_plugin', "name = '$name'");
+
+		$message = gTxt('plugin_deleted', array('{name}' => $name));
+
+		plugin_list($message);
+	}
+
+// -------------------------------------------------------------
+	function status_link($status,$name,$linktext)
+	{
+		$out = '<a href="index.php?';
+		$out .= 'event=plugin&#38;step=switch_status&#38;status='.
+			$status.'&#38;name='.urlencode($name).'"';
+		$out .= '>'.$linktext.'</a>';
+		return $out;
+	}
+
+// -------------------------------------------------------------
+	function plugin_verify() 
+	{	
+
+		if (ps('txt_plugin')) {
+			$plugin = join("\n", file($_FILES['theplugin']['tmp_name']));
+		} else {
+			$plugin = ps('plugin');	
+		}
+
+		$plugin = preg_replace('@.*\$plugin=\'([\w=+/]+)\'.*@s', '$1', $plugin);
+		$plugin = preg_replace('/^#.*$/m', '', $plugin);
+
+		if(isset($plugin)) {
+			$plugin_encoded = $plugin;
+			$plugin = base64_decode($plugin);
+			if (strncmp($plugin,"\x1F\x8B",2)===0)
+				$plugin = gzinflate(substr($plugin, 10));
+
+			if ($plugin = @unserialize($plugin))
+			{ 
+				if(is_array($plugin)){
+					extract($plugin);
+					$source = '';
+					if (isset($help_raw) && empty($plugin['allow_html_help'])) {
+						include_once txpath.'/lib/classTextile.php';
+						$textile = new Textile();
+						$help_source = $textile->TextileRestricted($help_raw, 0, 0);
+					} else {
+						$help_source= highlight_string($help, true);
+					}
+					$source.= highlight_string('<?php'.$plugin['code'].'?>', true);
+					$sub = fInput('submit','',gTxt('install'),'publish');
+		
+					pagetop(gTxt('edit_plugins'));
+					echo 
+					form(
+						hed(gTxt('previewing_plugin'), 3).
+						tag($source, 'div', ' id="preview-plugin" class="code"').
+						hed(gTxt('plugin_help').':', 3).
+						tag($help_source, 'div', ' id="preview-help" class="code"').
+						$sub.
+						sInput('plugin_install').
+						eInput('plugin').
+						hInput('plugin64', $plugin_encoded)
+					, 'margin: 0 auto; width: 65%;');
+					return;
+				}
+			}
+		}
+		plugin_list(gTxt('bad_plugin_code'));
+
+	}
+	
+// -------------------------------------------------------------
+	function plugin_install() 
+	{	
+
+		$plugin = ps('plugin64');	
+
+		$plugin = preg_replace('@.*\$plugin=\'([\w=+/]+)\'.*@s', '$1', $plugin);
+		$plugin = preg_replace('/^#.*$/m', '', $plugin);
+
+		if(trim($plugin)) {
+
+			$plugin = base64_decode($plugin);
+			if (strncmp($plugin,"\x1F\x8B",2)===0)
+				$plugin = gzinflate(substr($plugin, 10));
+
+			if ($plugin = unserialize($plugin)) {
+
+				if(is_array($plugin)){
+
+					extract($plugin);
+					if (empty($type)) $type = 0;
+					$type = assert_int($type);
+
+					$exists = fetch('name','txp_plugin','name',$name);
+
+					if (isset($help_raw) && empty($plugin['allow_html_help'])) {
+							// default: help is in Textile format
+							include_once txpath.'/lib/classTextile.php';
+							$textile = new Textile();
+							$help = $textile->TextileRestricted($help_raw, 0, 0);
+					}
+
+					if ($exists) {
+						$rs = safe_update(
+						   "txp_plugin",
+							"status      = 0,
+							type         = $type,
+							author       = '".doSlash($author)."',
+							author_uri   = '".doSlash($author_uri)."',
+							version      = '".doSlash($version)."',
+							description  = '".doSlash($description)."',
+							help         = '".doSlash($help)."',
+							code         = '".doSlash($code)."',
+							code_restore = '".doSlash($code)."',
+							code_md5     = '".doSlash($md5)."'",
+							"name        = '".doSlash($name)."'"
+						);
+
+					} else {
+
+						$rs = safe_insert(
+						   "txp_plugin",
+						   "name         = '".doSlash($name)."',
+							status       = 0,
+							type         = $type,
+							author       = '".doSlash($author)."',
+							author_uri   = '".doSlash($author_uri)."',
+							version      = '".doSlash($version)."',
+							description  = '".doSlash($description)."',
+							help         = '".doSlash($help)."',
+							code         = '".doSlash($code)."',
+							code_restore = '".doSlash($code)."',
+							code_md5     = '".doSlash($md5)."'"
+						);
+					}
+
+					if ($rs and $code)
+					{
+						$message = gTxt('plugin_installed', array('{name}' => escape_output($name)));
+
+						plugin_list($message);
+					}
+
+					else
+					{
+						$message = gTxt('plugin_install_failed', array('{name}' => escape_output($name)));
+
+						plugin_list($message);
+					}
+				}
+			}
+
+			else
+			{
+				plugin_list(gTxt('bad_plugin_code'));
+			}
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function plugin_form() 
+	{
+		return n.n.form(
+			graf(
+			tag(gTxt('install_plugin'), 'span', ' style="vertical-align: top;"').sp.
+
+			'<textarea id="plugin-install" class="code" name="plugin" cols="62" rows="1"></textarea>'.sp.
+
+			tag(
+				popHelp('install_plugin').sp.
+				fInput('submit', 'install_new', gTxt('upload'), 'smallerbox')
+		   , 'span', ' style="vertical-align: 6px;"').
+
+				eInput('plugin').
+				sInput('plugin_verify')
+			)
+		, 'text-align: center;');
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_prefs.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_prefs.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_prefs.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,843 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_prefs.php $
+$LastChangedRevision: 1946 $
+
+*/
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+//-------------------------------------------------------------
+
+	include_once txpath.'/lib/txplib_update.php';
+
+	if ($event == 'prefs') {
+		require_privs('prefs');
+
+		if(!$step or !in_array($step, array('advanced_prefs','prefs_save','advanced_prefs_save','get_language','list_languages','prefs_list'))){
+			prefs_list();
+		} else $step();
+	}
+
+// -------------------------------------------------------------
+	function prefs_save() 
+	{
+		$prefnames = safe_column("name", "txp_prefs", "prefs_id = 1");
+
+		$post = doSlash(stripPost());
+
+		foreach($prefnames as $prefname) {
+			if (isset($post[$prefname])) {
+ 				if ($prefname == 'lastmod') {
+					safe_update("txp_prefs","val=now()", "name='lastmod'");
+				} else {
+					if($prefname == 'siteurl') {
+						$post[$prefname] = str_replace("http://",'',$post[$prefname]);
+						$post[$prefname] = rtrim($post[$prefname],"/");
+					}
+					safe_update(
+						"txp_prefs", 
+						"val = '".$post[$prefname]."'",
+						"name = '".doSlash($prefname)."' and prefs_id = 1"
+					);
+				}
+			}			
+		}
+		
+		prefs_list(gTxt('preferences_saved'));		
+	}
+
+// -------------------------------------------------------------
+
+	function prefs_list($message = '')
+	{
+		global $textarray;
+
+		echo pagetop(gTxt('edit_preferences'), $message);
+
+		extract(get_prefs());
+
+		$locale = setlocale(LC_ALL, $locale);
+		$textarray = load_lang($language);
+
+		echo n.n.'<form method="post" action="index.php">'.
+
+			n.n.startTable('list').
+
+			n.n.tr(
+				tdcs(
+					hed(gTxt('site_prefs'), 1)
+				, 3)
+			).
+
+			n.n.tr(
+				tdcs(
+					sLink('prefs', 'prefs_list', gTxt('site_prefs'), 'navlink-active').sp.
+					sLink('prefs', 'advanced_prefs', gTxt('advanced_preferences'), 'navlink').sp.
+					sLink('prefs', 'list_languages', gTxt('manage_languages'), 'navlink')
+				, '3')
+			);
+
+		$evt_list = safe_column('event', 'txp_prefs', "type = 0 and prefs_id = 1 group by 'event' order by event desc");
+
+		foreach ($evt_list as $event)
+		{
+			$rs = safe_rows_start('*', 'txp_prefs', "type = 0 and prefs_id = 1 and event = '".doSlash($event)."' order by position");
+
+			$cur_evt = '';
+
+			while ($a = nextRow($rs))
+			{
+				if ($a['event'] != $cur_evt)
+				{
+					$cur_evt = $a['event'];
+
+					if ($cur_evt == 'comments' && !$use_comments)
+					{
+						continue;
+					}
+
+					echo n.n.tr(
+						tdcs(
+							hed(gTxt($a['event']), 2, ' class="pref-heading"')
+						, 3)
+					);
+				}
+
+				if ($cur_evt == 'comments' && !$use_comments)
+				{
+					continue;
+				}
+
+				// Skip old settings that don't have an input type
+				if (!is_callable($a['html']))
+				{
+					continue;
+				}
+
+				$label = ($a['html'] != 'yesnoradio') ?
+					'<label for="'.$a['name'].'">'.gTxt($a['name']).'</label>' :
+					gTxt($a['name']);
+
+				$out = tda($label, ' style="text-align: right; vertical-align: middle;"');
+
+				if ($a['html'] == 'text_input')
+				{
+					$out.= td(
+						pref_func('text_input', $a['name'], $a['val'], 20)
+					);
+				}
+
+				else
+				{
+					$out.= td(pref_func($a['html'], $a['name'], $a['val']));
+				}
+
+				$out.= tda(popHelp($a['name']), ' style="vertical-align: middle;"');
+
+				echo tr($out);
+			}
+		}
+
+		echo n.n.tr(
+			tda(
+				fInput('submit', 'Submit', gTxt('save_button'), 'publish').
+				n.sInput('prefs_save').
+				n.eInput('prefs').
+				n.hInput('prefs_id', '1').
+				n.hInput('lastmod', 'now()')
+			, ' colspan="3" class="noline"')
+		).
+
+		n.n.endTable().
+
+		n.n.'</form>';
+
+		$check_updates = gps('check_updates');
+
+		if ($check_updates)
+		{
+			$updates = checkUpdates();
+
+			if (is_array($updates))
+			{
+				$out = join(br, $updates);
+			}
+
+			else{
+				$out = $updates;
+			}
+
+			echo n.n.startTable('edit').
+
+				n.n.tr(
+					tda($out)
+				).
+
+				n.n.endTable();
+		}
+
+		else
+		{
+			echo form(
+				graf(
+					'<strong>'.gTxt('check_for_txp_updates').'</strong>'.sp.
+					n.'<input type="submit" name="check_updates" value="'.gTxt('go').'" class="publish" />'.
+					n.eInput('prefs').
+					n.sInput('prefs_list')
+				)
+			, 'text-align: center;');
+		}
+	}
+
+//-------------------------------------------------------------
+
+	function pref_func($func, $name, $val, $size = '')
+	{
+		$func = (is_callable('pref_'.$func) ? 'pref_'.$func : $func);
+
+		return call_user_func($func, $name, $val, $size);
+	}
+
+//-------------------------------------------------------------
+
+	function text_input($name, $val, $size = '')
+	{
+		return fInput('text', $name, $val, 'edit', '', '', $size, '', $name);
+	}
+
+//-------------------------------------------------------------
+
+	function gmtoffset_select($name, $val)
+	{
+		// Standard time zones as compiled by H.M. Nautical Almanac Office, June 2004
+		// http://aa.usno.navy.mil/faq/docs/world_tzones.html
+		$tz = array(
+			-12, -11, -10, -9.5, -9, -8.5, -8, -7, -6, -5, -4, -3.5, -3, -2, -1,
+			0,
+			+1, +2, +3, +3.5, +4, +4.5, +5, +5.5, +6, +6.5, +7, +8, +9, +9.5, +10, +10.5, +11, +11.5, +12, +13, +14,
+		);
+
+		$vals = array();
+
+		foreach ($tz as $z)
+		{
+			$sign = ($z >= 0 ? '+' : '');
+			$label = sprintf("GMT %s%02d:%02d", $sign, $z, abs($z - (int)$z) * 60);
+
+			$vals[sprintf("%s%d", $sign, $z * 3600)] = $label;
+		}
+
+		return selectInput($name, $vals, $val, '', '', $name);
+	}
+
+
+//-------------------------------------------------------------
+
+	function logging($name, $val)
+	{
+		$vals = array(
+			'all'		=> gTxt('all_hits'),
+			'refer' => gTxt('referrers_only'),
+			'none'	=> gTxt('none')
+		);
+
+		return selectInput($name, $vals, $val, '', '', $name);
+	}
+
+//-------------------------------------------------------------
+
+	function permlinkmodes($name, $val)
+	{
+		$vals = array(
+			'messy'										=> gTxt('messy'),
+			'id_title'								=> gTxt('id_title'),
+			'section_id_title'				=> gTxt('section_id_title'),
+			'year_month_day_title'		=> gTxt('year_month_day_title'),
+			'section_title'						=> gTxt('section_title'),
+			'title_only'							=> gTxt('title_only'),
+			// 'category_subcategory' => gTxt('category_subcategory')
+		);
+
+		return selectInput($name, $vals, $val, '', '', $name);
+	}
+
+//-------------------------------------------------------------
+
+	function urlmodes($name, $val)
+	{
+		$vals = array(
+			'0' => gTxt('messy'),
+			'1' => gTxt('clean')
+		);
+
+		return selectInput($name, $vals, $val, '', '', $name);
+	}
+
+//-------------------------------------------------------------
+
+	function commentmode($name, $val)
+	{
+		$vals = array(
+			'0' => gTxt('nopopup'),
+			'1' => gTxt('popup')
+		);
+
+		return selectInput($name, $vals, $val, '', '', $name);
+	}
+
+//-------------------------------------------------------------
+
+	function weeks($name, $val)
+	{
+		$weeks = gTxt('weeks');
+
+		$vals = array(
+			'0' => gTxt('never'),
+			7		=> '1 '.gTxt('week'),
+			14	=> '2 '.$weeks,
+			21	=> '3 '.$weeks,
+			28	=> '4 '.$weeks,
+			35	=> '5 '.$weeks,
+			42	=> '6 '.$weeks
+		);
+
+		return selectInput($name, $vals, $val, '', '', $name);
+	}
+
+//-------------------------------------------------------------
+
+	function languages($name, $val)
+	{
+		$installed_langs = safe_column('lang', 'txp_lang', "1 = 1 group by lang");
+
+		$vals = array();
+
+		foreach ($installed_langs as $lang)
+		{
+			$vals[$lang] = safe_field('data', 'txp_lang', "name = '".doSlash($lang)."' AND lang = '".doSlash($lang)."'");
+
+			if (trim($vals[$lang]) == '')
+			{
+				$vals[$lang] = $lang;
+			}
+		}
+
+		asort($vals);
+		reset($vals);
+
+		$out = n.'<select id="'.$name.'" name="'.$name.'" class="list">';
+
+		foreach ($vals as $avalue => $alabel)
+		{
+			$selected = ($avalue == $val || $alabel == $val) ?
+				' selected="selected"' :
+				'';
+
+			$out .= n.t.'<option value="'.htmlspecialchars($avalue).'"'.$selected.'>'.$alabel.'</option>'.n;
+		}
+
+		$out .= n.'</select>';
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function dateformats($name, $val)
+	{
+		$dayname = '%A';
+		$dayshort = '%a';
+		$daynum = is_numeric(strftime('%e')) ? '%e' : '%d';
+		$daynumlead = '%d';
+		$daynumord = is_numeric(substr(trim(strftime('%Oe')), 0, 1)) ? '%Oe' : $daynum;
+		$monthname = '%B';
+		$monthshort = '%b';
+		$monthnum = '%m';
+		$year = '%Y';
+		$yearshort = '%y';
+		$time24 = '%H:%M';
+		$time12 = strftime('%p') ? '%I:%M %p' : $time24;
+		$date = strftime('%x') ? '%x' : '%Y-%m-%d';
+
+		$formats = array(
+			"$monthshort $daynumord, $time12",
+			"$daynum.$monthnum.$yearshort",
+			"$daynumord $monthname, $time12",
+			"$yearshort.$monthnum.$daynumlead, $time12",
+			"$dayshort $monthshort $daynumord, $time12",
+			"$dayname $monthname $daynumord, $year",
+			"$monthshort $daynumord",
+			"$daynumord $monthname $yearshort",
+			"$daynumord $monthnum $year - $time24",
+			"$daynumord $monthname $year",
+			"$daynumord $monthname $year, $time24",
+			"$daynumord. $monthname $year",
+			"$daynumord. $monthname $year, $time24",
+			"$year-$monthnum-$daynumlead",
+			"$year-$daynumlead-$monthnum",
+			"$date $time12",
+			"$date",
+			"$time24",
+			"$time12",
+			"$year-$monthnum-$daynumlead $time24",
+		);
+
+		$ts = time();
+
+		$vals = array();
+
+		foreach ($formats as $f)
+		{
+			if ($d = safe_strftime($f, $ts))
+			{
+				$vals[$f] = $d;
+			}
+		}
+
+		$vals['since'] = 'hrs/days ago';
+
+		return selectInput($name, array_unique($vals), $val, '', '', $name);
+	}
+//-------------------------------------------------------------
+
+	function prod_levels($name, $val)
+	{
+		$vals = array(
+			'debug'		=> gTxt('production_debug'),
+			'testing' => gTxt('production_test'),
+			'live'		=> gTxt('production_live'),
+		);
+
+		return selectInput($name, $vals, $val, '', '', $name);
+	}
+
+//-------------------------------------------------------------
+
+	function advanced_prefs($message = '')
+	{
+		global $textarray;
+
+		// this means new language strings and new help entries
+		echo pagetop(gTxt('advanced_preferences'), $message).
+
+			n.n.'<form method="post" action="index.php">'.
+
+			n.n.startTable('list').
+
+			n.n.tr(
+				tdcs(
+					hed(gTxt('advanced_preferences'), 1)
+				, 3)
+			).
+
+			n.n.tr(
+				tdcs(
+					sLink('prefs', 'prefs_list', gTxt('site_prefs'), 'navlink').sp.
+					sLink('prefs', 'advanced_prefs', gTxt('advanced_preferences'), 'navlink-active').sp.
+					sLink('prefs', 'list_languages', gTxt('manage_languages'), 'navlink')
+				, '3')
+			);
+
+		$rs = safe_rows_start('*', 'txp_prefs', "type = 1 and prefs_id = 1 order by event, position");
+
+		$cur_evt = '';
+
+		while ($a = nextRow($rs))
+		{
+			if ($a['event']!= $cur_evt)
+			{
+				$cur_evt = $a['event'];
+
+				echo n.n.tr(
+					tdcs(
+						hed(gTxt($a['event']), 2, ' class="pref-heading"')
+					, 3)
+				);
+			}
+
+				$label = ($a['html'] != 'yesnoradio') ?
+					'<label for="'.$a['name'].'">'.gTxt($a['name']).'</label>' :
+					gTxt($a['name']);
+
+			$out = tda($label, ' style="text-align: right; vertical-align: middle;"');
+
+			if ($a['html'] == 'text_input')
+			{
+				$look_for = array('expire_logs_after', 'max_url_len', 'time_offset', 'rss_how_many', 'logs_expire');
+
+				$size = in_array($a['name'], $look_for) ? 3 : 20;
+
+				$out.= td(
+					pref_func('text_input', $a['name'], $a['val'], $size)
+				);
+			}
+
+			else
+			{
+				if (is_callable($a['html']))
+				{
+					$out.= td(
+						pref_func($a['html'], $a['name'], $a['val'])
+					);
+				}
+
+				else
+				{
+					$out.= td($a['val']);
+				}
+			}
+
+			$out .= tda(
+				popHelp($a['name'])
+			, ' style="vertical-align: middle;"');
+
+			echo n.n.tr($out);
+		}
+
+		echo n.n.tr(
+			tda(
+				fInput('submit', 'Submit', gTxt('save_button'), 'publish').
+				sInput('advanced_prefs_save').
+				eInput('prefs').
+				hInput('prefs_id', '1').
+				hInput('lastmod', 'now()')
+			, ' colspan="3" class="noline"')
+		).
+
+		n.n.endTable().
+
+		n.n.'</form>';
+	}
+
+//-------------------------------------------------------------
+	function real_max_upload_size($user_max) 
+	{
+		// The minimum of the candidates, is the real max. possible size
+		$candidates = array($user_max,
+							ini_get('post_max_size'), 
+							ini_get('upload_max_filesize'));
+		$real_max = null;
+		foreach ($candidates as $item)
+		{
+			$val = trim($item);
+			$modifier = strtolower( substr($val, -1) );
+			switch($modifier) {
+				// The 'G' modifier is available since PHP 5.1.0
+				case 'g': $val *= 1024;
+				case 'm': $val *= 1024;
+				case 'k': $val *= 1024;
+			}
+			if ($val > 1) {
+				if (is_null($real_max)) 
+					$real_max = $val;
+				elseif ($val < $real_max)
+					$real_max = $val;
+			}
+		}
+		return $real_max;
+	}
+
+//-------------------------------------------------------------
+	function advanced_prefs_save()
+	{
+		$prefnames = safe_column("name", "txp_prefs", "prefs_id = 1 AND type = 1");
+		
+		$post = doSlash(stripPost());
+
+		if (empty($post['tempdir']))
+			$post['tempdir'] = doSlash(find_temp_dir());
+
+		if (!empty($post['file_max_upload_size']))
+			$post['file_max_upload_size'] = real_max_upload_size($post['file_max_upload_size']);
+
+		foreach($prefnames as $prefname) {
+			if (isset($post[$prefname])) {
+					safe_update(
+						"txp_prefs", 
+						"val = '".$post[$prefname]."'",
+						"name = '".doSlash($prefname)."' and prefs_id = 1"
+					);
+			}			
+		}
+		
+		advanced_prefs(gTxt('preferences_saved'));	
+	}
+	
+//-------------------------------------------------------------
+	# RPC install/update languages
+	function list_languages($message='')
+	{
+		global $prefs, $locale, $txpcfg, $textarray;
+		require_once txpath.'/lib/IXRClass.php';
+
+		// Select and save active language
+		if (!$message && ps('step')=='list_languages' && ps('language'))
+		{
+				$locale = doSlash(getlocale(ps('language')));
+				safe_update("txp_prefs","val='".doSlash(ps('language'))."'", "name='language'");
+				safe_update("txp_prefs","val='". $locale ."'", "name='locale'");
+				$textarray = load_lang(doSlash(ps('language')));
+				$locale = setlocale(LC_ALL, $locale);
+				$message = gTxt('preferences_saved');
+		}
+		$active_lang = safe_field('val','txp_prefs',"name='language'");
+		$lang_form = tda(  form(gTxt('active_language').'&nbsp;&nbsp;'.
+								languages('language',$active_lang).'&nbsp;&nbsp;'.
+								fInput('submit','Submit',gTxt('save_button'),'').
+								eInput('prefs').sInput('list_languages')
+							,'display:inline;')
+						,' style="text-align:center" colspan="3"');
+		
+
+		$client = new IXR_Client(RPC_SERVER);
+		#$client->debug = true;
+
+		$available_lang = array();
+		$rpc_connect = false;$show_files = false;
+
+		# Get items from RPC
+		@set_time_limit(90);
+		if (gps('force')!='file' && $client->query('tups.listLanguages',$prefs['blog_uid']))
+		{
+			$rpc_connect = true;
+			$response = $client->getResponse();
+			foreach ($response as $language)
+				$available_lang[$language['language']]['rpc_lastmod'] = gmmktime($language['lastmodified']->hour,$language['lastmodified']->minute,$language['lastmodified']->second,$language['lastmodified']->month,$language['lastmodified']->day,$language['lastmodified']->year);
+		} elseif (gps('force')!='file') 
+		{
+			$msg = gTxt('rpc_connect_error')."<!--".$client->getErrorCode().' '.$client->getErrorMessage()."-->";
+		}
+
+		# Get items from Filesystem
+		$files = get_lang_files();
+		if (gps('force')=='file' || !$rpc_connect) 
+			$show_files = true;
+		if ( $show_files && is_array($files) && !empty($files) )
+		{
+			foreach ($files as $file)
+			{
+				if ($fp = @fopen(txpath.DS.'lang'.DS.$file,'r'))
+				{
+					$name = str_replace('.txt','',$file);
+					$firstline = fgets($fp, 4069);
+					fclose($fp);
+					if (strpos($firstline,'#@version') !== false) 
+						@list($fversion,$ftime) = explode(';',trim(substr($firstline,strpos($firstline,' ',1))));
+					else 
+						$fversion = $ftime = NULL;
+					$available_lang[$name]['file_note'] = (isset($fversion)) ? $fversion : 0;
+					$available_lang[$name]['file_lastmod'] = (isset($ftime)) ? $ftime : 0;
+				}
+			}
+		}
+		# Get installed items from the database
+		# I'm affraid we need a value here for the language itself, not for each one of the rows
+		$rows = safe_rows('lang, UNIX_TIMESTAMP(MAX(lastmod)) as lastmod','txp_lang',"1 GROUP BY lang ORDER BY lastmod DESC");
+		foreach ($rows as $language)
+		{
+			$available_lang[$language['lang']]['db_lastmod'] = $language['lastmod'];
+		}
+
+		$list = '';
+		# Show the language table 
+		foreach ($available_lang as $langname => $langdat)
+		{
+			$file_updated = ( isset($langdat['db_lastmod']) && @$langdat['file_lastmod'] > $langdat['db_lastmod']);
+			$rpc_updated = ( @$langdat['rpc_lastmod'] > @$langdat['db_lastmod']);
+			$rpc_install = tda( strong(eLink('prefs','get_language','lang_code',$langname,(isset($langdat['db_lastmod'])) 
+										? gTxt('update') : gTxt('install'),'updating',isset($langdat['db_lastmod']) )).
+								br.safe_strftime($prefs['archive_dateformat'],@$langdat['rpc_lastmod'])
+							,(isset($langdat['db_lastmod'])) 
+								? ' style="color:red;text-align:center;background-color:#FFFFCC;"'
+								: ' style="color:#667;vertical-align:middle;text-align:center"');
+			$list.= tr (
+				# Lang-Name & Date
+				tda(gTxt($langname).
+					 tag( ( isset($langdat['db_lastmod']) ) 
+							? br.'&nbsp;'.safe_strftime($prefs['archive_dateformat'],$langdat['db_lastmod'])
+							: ''
+						, 'span',' style="color:#aaa;font-style:italic"')
+					, (isset($langdat['db_lastmod']) && $rpc_updated) #tda attribute
+							? ' nowrap="nowrap" style="color:red;background-color:#FFFFCC;"' 
+							: ' nowrap="nowrap" style="vertical-align:middle"' ).n.
+				# RPC - Info
+				(  ($rpc_updated) 
+					? $rpc_install 
+					: tda( (isset($langdat['rpc_lastmod'])) ? gTxt('updated') : '-'
+						,' style="vertical-align:middle;text-align:center"')
+				).n.
+				# File - Info
+				( ($show_files)
+					?	tda( tag( ( isset($langdat['file_lastmod']) ) 
+									? eLink('prefs','get_language','lang_code',$langname,($file_updated) ? gTxt('update') : gTxt('install'),'force','file').
+											br.'&nbsp;'.safe_strftime($prefs['archive_dateformat'],$langdat['file_lastmod'])
+									: ' &nbsp; '  # No File available
+								, 'span', ($file_updated) ? ' style="color:#667;"' : ' style="color:#aaa;font-style:italic"' )
+							, ' class="langfile" style="text-align:center;vertical-align:middle"').n
+					:   '')
+			).n.n;
+		}
+
+
+		// Output Table + Content
+		pagetop(gTxt('update_languages'),$message);
+		if (isset($msg) && $msg)
+			echo tag ($msg,'p',' style="text-align:center;color:red;width:50%;margin: 2em auto"' );
+
+		echo startTable('list'),				
+
+		tr(
+			tdcs(
+				hed(gTxt('manage_languages'), 1)
+			, 3)
+		),
+
+		tr(
+			tdcs(
+				sLink('prefs', 'prefs_list', gTxt('site_prefs'), 'navlink').sp.
+				sLink('prefs','advanced_prefs',gTxt('advanced_preferences'),'navlink').sp.
+				sLink('prefs', 'list_languages', gTxt('manage_languages'), 'navlink-active')
+			, '3')
+		),
+
+		tr(tda('&nbsp;',' colspan="3" style="font-size:0.25em"')),
+		tr( $lang_form ),
+		tr(tda('&nbsp;',' colspan="3" style="font-size:0.25em"')),
+		tr(tda(gTxt('language')).tda(gTxt('from_server')).( ($show_files) ? tda(gTxt('from_file')) : '' ), ' style="font-weight:bold"');
+		echo $list;
+		if (!$show_files)
+		{
+			$linktext =  gTxt('from_file').' ('.gTxt('experts_only').')';
+			echo tr(tda('&nbsp;',' colspan="3" style="font-size:0.25em"')).
+				 tr(tda(strong(eLink('prefs','list_languages','force','file',$linktext)),' colspan="3" style="text-align:center"') );
+		} elseif (gps('force')=='file')	{
+			echo tr(tda('&nbsp;',' colspan="3" style="font-size:0.25em"')).
+				 tr(tda(sLink('prefs','list_languages',strong(gTxt('from_server'))),' colspan="3" style="text-align:center"') );
+		}
+		echo endTable();
+
+		$install_langfile = gTxt('install_langfile', array(
+			'{url}' => strong('<a href="'.RPC_SERVER.'/lang/">'.RPC_SERVER.'/lang/</a>')
+		));
+
+		if ( $install_langfile == 'install_langfile')
+			$install_langfile = 'To install new languages from file you can download them from <b><a href="'.RPC_SERVER.'/lang/">'.RPC_SERVER.'/lang/</a></b> and place them inside your ./textpattern/lang/ directory.';
+		echo tag( $install_langfile ,'p',' style="text-align:center;width:50%;margin: 2em auto"' );
+
+	}
+	
+//-------------------------------------------------------------
+	function get_language()
+	{
+		global $prefs, $txpcfg, $textarray;
+		require_once txpath.'/lib/IXRClass.php';
+		$lang_code = gps('lang_code');		
+
+		$client = new IXR_Client(RPC_SERVER);
+//		$client->debug = true;
+		
+		@set_time_limit(90);
+		if (gps('force')=='file' || !$client->query('tups.getLanguage',$prefs['blog_uid'],$lang_code))
+		{
+			if ( (gps('force')=='file' || gps('updating')!=='1') && install_language_from_file($lang_code) )
+			{
+				if (defined('LANG')) 
+					$textarray = load_lang(LANG);
+				return list_languages(gTxt($lang_code).sp.gTxt('updated'));
+			}else{
+
+				$install_langfile = gTxt('install_langfile', array(
+					'{url}' => strong('<a href="'.RPC_SERVER.'/lang/">'.RPC_SERVER.'/lang/</a>')
+				));
+
+				if ( $install_langfile == 'install_langfile')
+					$install_langfile = 'To install new languages from file you can download them from <b><a href="'.RPC_SERVER.'/lang/">'.RPC_SERVER.'/lang/</a></b> and place them inside your ./textpattern/lang/ directory.';
+				pagetop(gTxt('installing_language'));
+				echo tag( gTxt('rpc_connect_error')."<!--".$client->getErrorCode().' '.$client->getErrorMessage()."-->" 
+						 ,'p',' style="text-align:center;color:red;width:50%;margin: 2em auto"' );
+				echo tag( $install_langfile ,'p',' style="text-align:center;width:50%;margin: 2em auto"' );
+			}			
+		}else {
+			$response = $client->getResponse();
+			$lang_struct = unserialize($response);
+			function install_lang_key(&$value, $key)
+			{
+				extract(gpsa(array('lang_code','updating')));
+				$exists = safe_field('name','txp_lang',"name='".doSlash($value['name'])."' AND lang='".doSlash($lang_code)."'");				
+				$q = "name='".doSlash($value['name'])."', event='".doSlash($value['event'])."', data='".doSlash($value['data'])."', lastmod='".doSlash(strftime('%Y%m%d%H%M%S',$value['uLastmod']))."'";
+
+				if ($exists)
+				{
+					$value['ok'] = safe_update('txp_lang',$q,"lang='".doSlash($lang_code)."' AND name='".doSlash($value['name'])."'");
+				}else{
+					$value['ok'] = safe_insert('txp_lang',$q.", lang='".doSlash($lang_code)."'");
+				}
+			}			
+			array_walk($lang_struct,'install_lang_key');
+			$size = count($lang_struct);
+			$errors = 0;
+			for($i=0; $i < $size ; $i++)
+			{
+				$errors += ( !$lang_struct[$i]['ok'] );
+			}
+			if (defined('LANG')) 
+				$textarray = load_lang(LANG);
+			$msg = gTxt($lang_code).sp.gTxt('updated');
+			if ($errors > 0) 
+				$msg .= sprintf(" (%s errors, %s ok)",$errors, ($size-$errors));
+			return list_languages($msg);
+		}		
+	}
+	
+// ----------------------------------------------------------------------
+
+function get_lang_files()
+{
+	global $txpcfg;
+	
+	$dirlist = array();
+	
+	$lang_dir = txpath.DS.'lang'.DS;
+
+	if (!is_dir($lang_dir))
+	{
+		trigger_error('Lang directory is not a directory: '.$lang_dir, E_USER_WARNING);
+		return $dirlist;
+	}
+	
+	if (chdir($lang_dir)) {
+		if (function_exists('glob')){
+			$g_array = glob("*.txt");
+		}else {
+			# filter .txt only files here?
+			$dh = opendir($lang_dir);
+			$g_array = array();
+			while (false !== ($filename = readdir($dh))) {
+				if (strstr($filename, '.txt'))
+					$g_array[] = $filename;
+			}
+			closedir($dh);
+			
+		}
+		# build an array of lang-codes => filemtimes
+		if ($g_array) {
+			foreach ($g_array as $lang_name) {
+				if (is_file($lang_name)) {
+					$dirlist[substr($lang_name,0,5)] = @filemtime($lang_name);
+				}
+			}
+		}
+	}
+	return $g_array;
+}
+	
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_preview.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_preview.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_preview.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,12 @@
+<?php
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_preview.php $
+$LastChangedRevision: 1238 $
+*/
+if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+include 'publish.php';
+
+textpattern();
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_section.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_section.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_section.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,317 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance ofthe Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_section.php $
+$LastChangedRevision: 1891 $
+
+*/
+
+	if (!defined('txpinterface')) die('txpinterface is undefined.');
+
+	if ($event == 'section') {
+		require_privs('section');		
+
+		if(!$step or !function_exists($step) or !in_array($step, array('sec_section_list','section_create','section_delete','section_save'))){
+			sec_section_list();
+		} else $step();
+	}
+
+// -------------------------------------------------------------
+
+	function sec_section_list($message = '')
+	{
+		global $wlink;
+
+		pagetop(gTxt('sections'), $message);
+
+		$default = safe_row('page, css', 'txp_section', "name = 'default'");
+
+		$pages = safe_column('name', 'txp_page', "1 = 1");
+		$styles = safe_column('name', 'txp_css', "1 = 1");
+
+		echo n.n.startTable('list').
+
+			n.n.tr(
+				tda(
+					n.n.hed(gTxt('section_head').sp.popHelp('section_category'), 1).
+
+					n.n.form(
+						fInput('text', 'name', '', 'edit', '', '', 10).
+						fInput('submit', '', gTxt('create'), 'smallerbox').
+						eInput('section').
+						sInput('section_create')
+					)
+				, ' colspan="3"')
+			).
+
+			n.n.tr(
+				td(gTxt('default')).
+
+				td(
+					form(
+						'<table>'.
+
+						tr(
+							fLabelCell(gTxt('uses_page').':').
+							td(
+								selectInput('page', $pages, $default['page']).sp.popHelp('section_uses_page')
+							, '', 'noline')
+						).
+
+						tr(
+							fLabelCell(gTxt('uses_style').':') .
+							td(
+								selectInput('css', $styles, $default['css']).sp.popHelp('section_uses_css')
+							, '', 'noline')
+						).
+
+						tr(
+							tda(
+								fInput('submit', '', gTxt('save_button'), 'smallerbox').
+								eInput('section').
+								sInput('section_save').
+								hInput('name','default')
+							, ' colspan="2" class="noline"')
+						).
+
+						endTable()
+					)
+				).
+
+				td()
+			);
+
+		$rs = safe_rows_start('*', 'txp_section', "name != 'default' order by name");
+
+		if ($rs)
+		{
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				echo n.n.tr(
+					n.td($name).
+
+					n.td(
+						form(
+							'<table>'.
+
+							n.n.tr(
+								fLabelCell(gTxt('section_name').':').
+								fInputCell('name', $name, 1, 20)
+							).
+
+							n.n.tr(
+								fLabelCell(gTxt('section_longtitle').':').
+								fInputCell('title', $title, 1, 20)
+							).
+
+							n.n.tr(
+								fLabelCell(gTxt('uses_page').':').
+								td(
+									selectInput('page', $pages, $page).sp.popHelp('section_uses_page')
+								, '', 'noline')
+							).
+
+							n.n.tr(
+								fLabelCell(gTxt('uses_style').':').
+								td(
+									selectInput('css', $styles, $css).sp.popHelp('section_uses_css')
+								, '', 'noline')
+							).
+
+							n.n.tr(
+								fLabelCell(gTxt('selected_by_default').'?').
+								td(
+									yesnoradio('is_default', $is_default, '', $name).sp.popHelp('section_is_default')
+								, '', 'noline')
+							).
+
+							n.n.tr(
+								fLabelCell(gTxt('on_front_page').'?').
+								td(
+									yesnoradio('on_frontpage', $on_frontpage, '', $name).sp.popHelp('section_on_frontpage')
+								, '', 'noline')
+							).
+
+							n.n.tr(
+								fLabelCell(gTxt('syndicate').'?') .
+								td(
+									yesnoradio('in_rss', $in_rss, '', $name).sp.popHelp('section_syndicate')
+								, '', 'noline')
+							).
+
+							n.n.tr(
+								fLabelCell(gTxt('include_in_search').'?').
+								td(
+									yesnoradio('searchable', $searchable, '', $name).sp.popHelp('section_searchable')
+								, '', 'noline')
+							).
+
+							n.n.tr(
+								tda(
+									fInput('submit', '', gTxt('save_button'), 'smallerbox').
+									eInput('section').
+									sInput('section_save').
+									hInput('old_name', $name)
+								, ' colspan="2" class="noline"')
+							).
+
+							endTable()
+						)
+					).
+
+					td(
+						dLink('section', 'section_delete', 'name', $name, '', 'type', 'section')
+					)
+				);
+			}
+		}
+
+		echo n.n.endTable();
+	}
+
+//-------------------------------------------------------------
+	function section_create() 
+	{
+		global $txpcfg;
+		$name = ps('name');
+		
+		//Prevent non url chars on section names
+		include_once txpath.'/lib/classTextile.php';
+		$textile = new Textile();
+		$title = $textile->TextileThis($name,1);
+		$name = sanitizeForUrl($name);
+		
+		$chk = fetch('name','txp_section','name',$name);
+
+		if (!$chk)
+		{
+			if ($name)
+			{
+				$rs = safe_insert(
+				   "txp_section",
+				   "name         = '".doSlash($name) ."',
+					title        = '".doSlash($title)."', 
+					page         = 'default',
+					css          = 'default',
+					is_default   = 0,
+					in_rss       = 1,
+					on_frontpage = 1"
+				);
+
+				if ($rs)
+				{
+					update_lastmod();
+
+					$message = gTxt('section_created', array('{name}' => $name));
+
+					sec_section_list($message);
+				}
+			}
+
+			else
+			{
+				sec_section_list();
+			}
+		}
+
+		else
+		{
+			$message = gTxt('section_name_already_exists', array('{name}' => $name));
+
+			sec_section_list($message);
+		}
+	}
+
+//-------------------------------------------------------------
+
+	function section_save()
+	{
+		global $txpcfg;
+
+		extract(doSlash(psa(array('page','css','old_name'))));
+		extract(psa(array('name', 'title')));
+
+		if (empty($title))
+		{
+			$title = $name;
+		}
+
+		// Prevent non url chars on section names
+		include_once txpath.'/lib/classTextile.php';
+
+		$textile = new Textile();
+		$title = doSlash($textile->TextileThis($title,1));
+		$name  = doSlash(sanitizeForUrl($name));
+
+		if ($old_name && (strtolower($name) != strtolower($old_name)))
+		{
+			if (safe_field('name', 'txp_section', "name='$name'"))
+			{
+				$message = gTxt('section_name_already_exists', array('{name}' => $name));
+
+				sec_section_list($message);
+				return;
+			}
+		}
+
+		if ($name == 'default')
+		{
+			safe_update('txp_section', "page = '$page', css = '$css'", "name = 'default'");
+
+			update_lastmod();
+		}
+
+		else
+		{
+			extract(array_map('assert_int',psa(array('is_default','on_frontpage','in_rss','searchable'))));
+			// note this means 'selected by default' not 'default page'
+			if ($is_default)
+			{
+				safe_update("txp_section", "is_default = 0", "name != '$old_name'");
+			}
+	
+			safe_update('txp_section', "
+				name         = '$name',
+				title        = '$title',
+				page         = '$page',
+				css          = '$css',
+				is_default   = $is_default,
+				on_frontpage = $on_frontpage,
+				in_rss       = $in_rss,
+				searchable   = $searchable
+			", "name = '$old_name'");
+
+			safe_update('textpattern', "Section = '$name'", "Section = '$old_name'");
+
+			update_lastmod();
+		}
+
+		$message = gTxt('section_updated', array('{name}' => $name));
+
+		sec_section_list($message);
+	}
+
+// -------------------------------------------------------------
+
+	function section_delete() 
+	{
+		$name = ps('name');
+
+		safe_delete('txp_section', "name = '".doSlash($name)."'");
+
+		$message = gTxt('section_deleted', array('{name}' => $name));
+
+		sec_section_list($message);
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/include/txp_tag.php
===================================================================
--- trunk/www.openmoko.com/textpattern/include/txp_tag.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/include/txp_tag.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3706 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/include/txp_tag.php $
+$LastChangedRevision: 1915 $
+
+*/
+
+if (!defined('txpinterface'))
+{
+	die('txpinterface is undefined.');
+}
+
+// -------------------------------------------------------------
+
+?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+	<title>Txp &#8250; <?php echo gTxt('build'); ?></title>
+	<link rel="stylesheet" type="text/css" href="textpattern.css" />
+</head>
+<body id="tag-event">
+<?php
+
+	$tag_name = gps('tag_name');
+
+	$functname = 'tag_'.$tag_name;
+
+	if (function_exists($functname))
+	{
+		$endform = n.tr(
+			td().
+			td(
+				fInput('submit', '', gTxt('build'), 'smallerbox')
+			)
+		).
+		n.endTable().
+		n.eInput('tag').
+		n.sInput('build').
+		n.hInput('tag_name', $tag_name);
+
+		echo $functname($tag_name);
+	}
+
+?>
+
+</body>
+</html>
+<?php
+
+/*
+
+begin generic functions
+
+*/
+
+// -------------------------------------------------------------
+
+	function tagRow($label, $thing)
+	{
+		return n.n.tr(
+			n.fLabelCell($label).
+			n.td($thing)
+		);
+	}
+
+// -------------------------------------------------------------
+
+	function tb($tag, $atts_list = array(), $thing = '')
+	{
+		$atts = array();
+
+		foreach ($atts_list as $att => $val)
+		{
+			if ($val or $val === '0')
+			{
+				$atts[] = ' '.$att.'="'.$val.'"';
+			}
+		}
+
+		$atts = ($atts) ? join('', $atts) : '';
+
+		return !empty($thing) ?
+			'<txp:'.$tag.$atts.'>'.$thing.'</txp:'.$tag.'>' :
+			'<txp:'.$tag.$atts.' />';
+	}
+
+// -------------------------------------------------------------
+
+	function tbd($tag, $thing)
+	{
+		return '<txp:'.$tag.'>'.$thing.'</txp:'.$tag.'>';
+	}
+
+// -------------------------------------------------------------
+
+	function tdb($thing)
+	{
+		return n.graf(text_area('tag', '100', '300', $thing), ' id="tagbuilder-output"');
+	}
+
+//--------------------------------------------------------------
+
+	function key_input($name, $var)
+	{
+		return '<textarea name="'.$name.'" style="width: 120px; height: 50px;">'.$var.'</textarea>';
+	}
+
+//--------------------------------------------------------------
+
+	function input_id($id)
+	{
+		return fInput('text', 'id', $id, 'edit', '', '', 6);
+	}
+
+//--------------------------------------------------------------
+
+	function input_time($time)
+	{
+		return fInput('text', 'time', $time, 'edit', '', '', 6);
+	}
+
+//--------------------------------------------------------------
+
+	function input_limit($limit)
+	{
+		return fInput('text', 'limit', $limit, 'edit', '', '', 2);
+	}
+
+//--------------------------------------------------------------
+
+	function input_offset($offset)
+	{
+		return fInput('text', 'offset', $offset, 'edit', '', '', 2);
+	}
+
+//--------------------------------------------------------------
+
+	function input_tag($name, $val)
+	{
+		return fInput('text', $name, $val, 'edit', '', '', 6);
+	}
+
+//--------------------------------------------------------------
+
+	function yesno_pop($select_name, $val)
+	{
+		$vals = array(
+			'y' => gTxt('yes'),
+			'n' => gTxt('no')
+		);
+
+		return ' '.selectInput($select_name, $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function yesno2_pop($select_name, $val)
+	{
+		$vals = array(
+			1 => gTxt('yes'),
+			0 => gTxt('no'),
+		);
+
+		return ' '.selectInput($select_name, $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function status_pop($val)
+	{
+		$vals = array(
+			4 => gTxt('live'),
+			5 => gTxt('sticky'),
+			3 => gTxt('pending'),
+			1 => gTxt('draft'),
+			2 => gTxt('hidden'),
+		);
+
+		return ' '.selectInput('status', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function section_pop($select_name, $val)
+	{
+		$vals = array();
+
+		$rs = safe_rows_start('name, title', 'txp_section', "name != 'default' order by name");
+
+		if ($rs and numRows($rs) > 0)
+		{
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				$vals[$name] = $title;
+			}
+
+			return ' '.selectInput($select_name, $vals, $val, true);
+		}
+
+		return gTxt('no_sections_available');
+	}
+
+//--------------------------------------------------------------
+
+	function type_pop($val)
+	{
+		$vals = array(
+			'article' => gTxt('article'),
+			'link'		=> gTxt('link'),
+			'image'		=> gTxt('image'),
+			'file'		=> gTxt('file'),
+		);
+
+		return ' '.selectInput('type', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function feed_flavor_pop($val)
+	{
+		$vals = array(
+			'atom' => 'Atom 1.0',
+			'rss'	 => 'RSS 2.0'
+		);
+
+		return ' '.selectInput('flavor', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function feed_format_pop($val)
+	{
+		$vals = array(
+			'a'		 => '<a href...',
+			'link' => '<link rel...',
+		);
+
+		return ' '.selectInput('format', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function article_category_pop($val)
+	{
+		$vals = getTree('root','article');
+
+		if ($vals)
+		{
+			return ' '.treeSelectInput('category', $vals, $val);
+		}
+
+		return gTxt('no_categories_available');
+	}
+
+//--------------------------------------------------------------
+
+	function link_category_pop($val)
+	{
+		$vals = getTree('root','link');
+
+		if ($vals)
+		{
+			return ' '.treeSelectInput('parent', $vals, $val);
+		}
+
+		return gTxt('no_categories_available');
+	}
+
+//--------------------------------------------------------------
+
+	function file_category_pop($val)
+	{
+		$vals = getTree('root','file');
+
+		if ($vals)
+		{
+			return ' '.treeSelectInput('category', $vals, $val);
+		}
+
+		return gTxt('no_categories_available');
+	}
+
+//--------------------------------------------------------------
+
+	function match_pop($val)
+	{
+		$vals = array(
+			'Category1,Category2'	=> gTxt('category1').' '.gTxt('and').' '.gTxt('category2'),
+			'Category1'						=> gTxt('category1'),
+			'Category2'						=> gTxt('category2')
+		);
+
+		return ' '.selectInput('match', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function author_pop($val)
+	{
+		$vals = array();
+
+		$rs = safe_rows_start('name', 'txp_users', '1 = 1 order by name');
+
+		if ($rs)
+		{
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				$vals[$name] = $name;
+			}
+
+			return ' '.selectInput('author', $vals, $val, true);
+		}
+	}
+
+//--------------------------------------------------------------
+
+	function sort_pop($val)
+	{
+		$asc = ' ('.gTxt('ascending').')';
+		$desc = ' ('.gTxt('descending').')';
+
+		$vals = array(
+			'Title asc'			 => gTxt('tag_title').$asc,
+			'Title desc'		 => gTxt('tag_title').$desc,
+			'Posted asc'		 => gTxt('tag_posted').$asc,
+			'Posted desc'		 => gTxt('tag_posted').$desc,
+			'LastMod asc'		 => gTxt('last_modification').$asc,
+			'LastMod desc'	 => gTxt('last_modification').$desc,
+			'Section asc'		 => gTxt('section').$asc,
+			'Section desc'	 => gTxt('section').$desc,
+			'Category1 asc'	 => gTxt('category1').$asc,
+			'Category1 desc' => gTxt('category1').$desc,
+			'Category2 asc'	 => gTxt('category2').$asc,
+			'Category2 desc' => gTxt('category2').$desc,
+			'rand()'				 => gTxt('random')
+		);
+
+		return ' '.selectInput('sort', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function discuss_sort_pop($val)
+	{
+		$asc = ' ('.gTxt('ascending').')';
+		$desc = ' ('.gTxt('descending').')';
+
+		$vals = array(
+			'posted asc'	=> gTxt('posted').$asc,
+			'posted desc'	=> gTxt('posted').$desc,
+		);
+
+		return ' '.selectInput('sort', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function pgonly_pop($val)
+	{
+		$vals = array(
+			'1' => gTxt('yes'),
+			'0' => gTxt('no')
+		);
+
+		return ' '.selectInput('pgonly', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function form_pop($select_name, $type = '', $val)
+	{
+		$vals = array();
+
+		$type = ($type) ? "type = '".doSlash($type)."'" : '1 = 1';
+
+		$rs = safe_rows_start('name', 'txp_form', "$type order by name");
+
+		if ($rs and numRows($rs) > 0)
+		{
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				$vals[$name] = $name;
+			}
+
+			return ' '.selectInput($select_name, $vals, $val, true);
+		}
+
+		return gTxt('no_forms_available');
+	}
+
+//--------------------------------------------------------------
+
+	function css_pop($val)
+	{
+		$vals = array();
+
+		$rs = safe_rows_start('name', 'txp_css', "1 = 1 order by name");
+
+		if ($rs)
+		{
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				$vals[$name] = $name;
+			}
+
+			return ' '.selectInput('n', $vals, $val, true);
+		}
+
+		return false;
+	}
+
+//--------------------------------------------------------------
+
+	function css_format_pop($val)
+	{
+		$vals = array(
+			'link' => '<link rel...',
+			'url'	 => 'css.php?...'
+		);
+
+		return ' '.selectInput('format', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+	function escape_pop($val)
+	{
+		$vals = array(
+			'html' => 'html',
+		);
+
+		return ' '.selectInput('escape', $vals, $val, true);
+	}
+
+//--------------------------------------------------------------
+
+/*
+
+begin tag builder functions
+
+*/
+
+// -------------------------------------------------------------
+
+	function tag_article()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'allowoverride',
+			'form',
+			'limit',
+			'listform',
+			'offset',
+			'pageby',
+			'pgonly',
+			'searchall',
+			'searchsticky',
+			'sort',
+			'status',
+			'time'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('status',
+				status_pop($status)).
+
+			tagRow('time',
+				input_time($time)).
+
+			tagRow('searchall',
+				yesno2_pop('searchall', $searchall)).
+
+			tagRow('searchsticky',
+				yesno2_pop('searchsticky', $searchsticky)).
+
+			tagRow('limit',
+				input_limit($limit)).
+
+			tagRow('offset',
+				input_offset($offset)).
+
+			tagRow('pageby',
+				fInput('text', 'pageby', $pageby, 'edit', '', '', 2)).
+
+			tagRow('sort',
+				sort_pop($sort)).
+
+			tagRow('pgonly',
+				pgonly_pop($pgonly)).
+
+			tagRow('allowoverride',
+				yesno2_pop('allowoverride', $allowoverride)).
+
+			tagRow('form',
+				form_pop('form', 'article', $form)).
+
+			tagRow('listform',
+				form_pop('listform', 'article', $listform)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_article_custom()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'allowoverride',
+			'author',
+			'category',
+			'excerpted',
+			'form',
+			'id',
+			'keywords',
+			'limit',
+			'listform',
+			'month',
+			'offset',
+			'pgonly',
+			'section',
+			'sort',
+			'status',
+			'time'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('id',
+				input_id($id)).
+
+			tagRow('status',
+				status_pop($status)).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('category',
+				article_category_pop($category)).
+
+			tagRow('time',
+				input_time($time)).
+
+			tagRow('month',
+				fInput('text', 'month', $month, 'edit', '', '', 7). ' ('.gTxt('yyyy-mm').')') .
+
+			tagRow('keywords',
+				key_input('keywords', $keywords)).
+
+			tagRow('has_excerpt',
+				yesno_pop('excerpted', $excerpted)).
+
+			tagRow('author',
+				author_pop($author)).
+
+			tagRow('sort',
+				sort_pop($sort)).
+
+			tagRow('limit',
+				input_limit($limit)).
+
+			tagRow('offset',
+				input_offset($offset)).
+
+			tagRow('pgonly',
+				pgonly_pop($pgonly)).
+
+			tagRow('allowoverride',
+				yesno2_pop('allowoverride', $allowoverride)).
+
+			tagRow('form',
+				form_pop('form', 'article', $form)).
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_email()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'email',
+			'linktext',
+			'title'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('email_address',
+				fInput('text', 'email', $email, 'edit', '', '', 20)).
+
+			tagRow('tooltip',
+				fInput('text', 'title', $title, 'edit', '', '', 20)).
+
+			tagRow('link_text',
+				fInput('text', 'linktext', $linktext, 'edit', '', '', 20)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_page_title()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array('separator'));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('title_separator',
+				fInput('text', 'separator', $separator, 'edit', '', '', 4)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_linklist()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'break',
+			'category',
+			'form',
+			'label',
+			'labeltag',
+			'limit',
+			'sort',
+			'wraptag',
+		));
+
+		$asc = ' ('.gTxt('ascending').')';
+		$desc = ' ('.gTxt('descending').')';
+
+		$sorts = array(
+			'linksort asc'	=> gTxt('name').$asc,
+			'linksort desc' => gTxt('name').$desc,
+			'category asc'	=> gTxt('category').$asc,
+			'category desc' => gTxt('category').$desc,
+			'date asc'			=> gTxt('date').$asc,
+			'date desc'			=> gTxt('date').$desc,
+			'rand()'				=> gTxt('random')
+		);
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('category',
+				link_category_pop($category)).
+
+			tagRow('limit',
+				input_limit($limit)).
+
+			tagRow('sort',
+				' '.selectInput('sort', $sorts, $sort)).
+
+			tagRow('label',
+				fInput('text', 'label', $label, 'edit', '', '', 20)).
+
+			tagRow('labeltag',
+				input_tag('labeltag', $labeltag)).
+
+			tagRow('form',
+				form_pop('form', 'link', $form)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('break',
+				input_tag('break', $break)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		echo $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_section_list()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'active_class',
+			'break',
+			'class',
+			'default_title',
+			'exclude',
+			'include_default',
+			'label',
+			'labeltag',
+			'sections',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('include_default',
+				yesno2_pop('include_default', $include_default)).
+
+			tagRow('default_title',
+				fInput('text', 'default_title', $default_title, 'edit', '', '', 20)).
+
+			tagRow('sections',
+				fInput('text', 'sections', $sections, 'edit', '', '', 20)).
+
+			tagRow('exclude',
+				fInput('text', 'exclude', $exclude, 'edit', '', '', 20)).
+
+			tagRow('label',
+				fInput('text', 'label', $label, 'edit', '', '', 20)).
+
+			tagRow('labeltag',
+				input_tag('labeltag', $labeltag)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 14)).
+
+			tagRow('active_class',
+				fInput('text', 'active_class', $active_class, 'edit', '', '', 14)).
+
+			tagRow('break',
+				input_tag('break', $break)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		echo $out;
+
+	}
+
+// -------------------------------------------------------------
+
+	function tag_category_list()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'active_class',
+			'break',
+			'categories',
+			'class',
+			'exclude',
+			'label',
+			'labeltag',
+			'parent',
+			'section',
+			'this_section',
+			'type',
+			'wraptag',
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('type',
+				type_pop($type)).
+
+			tagRow('parent',
+				fInput('text', 'parent', $parent, 'edit', '', '', 20)).
+
+			tagRow('categories',
+				fInput('text', 'categories', $categories, 'edit', '', '', 20)).
+
+			tagRow('exclude',
+				fInput('text', 'exclude', $exclude, 'edit', '', '', 20)).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('this_section',
+				yesno2_pop('this_section', $this_section)).
+
+			tagRow('label',
+				fInput('text', 'label', ($label ? $label : gTxt('categories')), 'edit', '', '', 20)).
+
+			tagRow('labeltag',
+				input_tag('labeltag', $labeltag)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 14)).
+
+			tagRow('active_class',
+				fInput('text', 'active_class', $active_class, 'edit', '', '', 14)).
+
+			tagRow('break',
+				input_tag('break', $break)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		echo $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_recent_articles()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'break',
+			'category',
+			'label',
+			'labeltag',
+			'limit',
+			'section',
+			'sort',
+			'wraptag',
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('category',
+				article_category_pop($category)).
+
+			tagRow('sort',
+				sort_pop($sort)).
+
+			tagRow('limit',
+				fInput('text', 'limit', $limit, 'edit', '', '', 2)).
+
+			tagRow('label',
+				fInput('text', 'label', ($label ? $label : gTxt('recent_articles')), 'edit', '', '', 20)).
+
+			tagRow('labeltag',
+				input_tag('labeltag', $labeltag)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('break',
+				input_tag('break', $break)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_related_articles()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'break',
+			'class',
+			'label',
+			'labeltag',
+			'limit',
+			'match',
+			'section',
+			'sort',
+			'wraptag',
+		));
+
+		extract($atts);
+
+		$label = (!$label) ? 'Related Articles' : $label;
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('match',
+				match_pop($match)).
+
+			tagRow('sort',
+				sort_pop($sort)).
+
+			tagRow('limit',
+				fInput('text', 'limit', $limit, 'edit', '', '', 2)).
+
+			tagRow('label',
+				fInput('text', 'label', $label, 'edit', '', '', 20)).
+
+			tagRow('labeltag',
+				input_tag('labeltag', $labeltag)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 20)).
+
+			tagRow('break',
+				input_tag('break', $break)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_recent_comments()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'break',
+			'class',
+			'label',
+			'labeltag',
+			'limit',
+			'sort',
+			'wraptag',
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('sort',
+				discuss_sort_pop($sort)).
+
+			tagRow('limit',
+				fInput('text', 'limit', $limit, 'edit', '', '', 2)).
+
+			tagRow('label',
+				fInput('text', 'label', ($label ? $label : gTxt('recent_comments')), 'edit', '', '', 20)).
+
+			tagRow('labeltag',
+				input_tag('labeltag', $labeltag)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 5)).
+
+			tagRow('break',
+				input_tag('break', $break)).
+
+		$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_output_form()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'form'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('form',
+				form_pop('form', 'misc', $form)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_popup()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'label',
+			'section',
+			'this_section',
+			'type',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$types = array(
+			'c' => gTxt('Category'),
+			's' => gTxt('Section')
+		);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('type',
+				' '.selectInput('type', $types, $type, true)).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('this_section',
+				yesno2_pop('this_section', $this_section)).
+
+			tagRow('label',
+				fInput('text', 'label', ($label ? $label : gTxt('browse')), 'edit', '', '', 25)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_password_protect()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'login',
+			'pass'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('login',
+				fInput('text', 'login', $login, 'edit', '', '', 25)).
+
+			tagRow('password',
+				fInput('text', 'pass', $pass, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_search_input()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'button',
+			'class',
+			'form',
+			'label',
+			'section',
+			'size',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('button_text',
+				fInput('text', 'button', $button, 'edit', '', '', 25)).
+
+			tagRow('input_size',
+				fInput('text', 'size', $size, 'edit', '', '', 2)).
+
+			tagRow('label',
+				fInput('text', 'label', ($label ? $label : gTxt('search')), 'edit', '', '', 25)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			tagRow('form',
+				form_pop('form', 'misc', $form)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_category1()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'link',
+			'title',
+			'section',
+			'this_section',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('title',
+				yesno2_pop('title', $title)).
+
+			tagRow('link_to_this_category',
+				yesno_pop('link', $link)).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('this_section',
+				yesno2_pop('this_section', $this_section)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_category2()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'link',
+			'title',
+			'section',
+			'this_section',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('title',
+				yesno2_pop('title', $title)).
+
+			tagRow('link_to_this_category',
+				yesno_pop('link', $link)).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('this_section',
+				yesno2_pop('this_section', $this_section)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+
+// -------------------------------------------------------------
+
+	function tag_section()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'link',
+			'name',
+			'title',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('name',
+				section_pop('name', $tag_name)).
+
+			tagRow('link_to_this_section',
+				yesno_pop('link', $link)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_author()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'link',
+			'section',
+			'this_section'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('link_to_this_author',
+				yesno_pop('link', $link)).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('this_section',
+				yesno2_pop('this_section', $this_section)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_link_to_home()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+		));
+
+		extract($atts);
+
+		$thing = gps('thing');
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('link_text',
+				fInput('text', 'thing', ($thing ? $thing : gTxt('tag_home')), 'edit', '', '', 25)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_link_to_prev()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'showalways',
+		));
+
+		extract($atts);
+
+		$thing = gps('thing');
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('link_text',
+				fInput('text', 'thing', ($thing ? $thing : '<txp:prev_title />'), 'edit', '', '', 25)).
+
+			tagRow('showalways',
+				yesno_pop('showalways', $showalways)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_link_to_next()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'showalways',
+		));
+
+		extract($atts);
+
+		$thing = gps('thing');
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('link_text',
+				fInput('text', 'thing', ($thing ? $thing : '<txp:next_title />'), 'edit', '', '', 25)).
+
+			tagRow('showalways',
+				yesno_pop('showalways', $showalways)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_feed_link()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'category',
+			'flavor',
+			'format',
+			'label',
+			'limit',
+			'section',
+			'title',
+			'wraptag',
+		));
+
+		extract($atts);
+
+		$label = $label ? $label : 'XML';
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('flavor',
+				feed_flavor_pop($flavor)).
+
+			tagRow('format',
+				feed_format_pop($format)).
+
+			tagRow('section',
+				section_pop('section', $section)).
+
+			tagRow('category',
+				article_category_pop($section)).
+
+			tagRow('limit',
+				input_limit($limit)).
+
+			tagRow('label',
+				fInput('text', 'label', $label, 'edit', '', '', 25)).
+
+			tagRow('title',
+				fInput('text', 'title', $title, 'edit', '', '', 25)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_link_feed_link()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'category',
+			'flavor',
+			'format',
+			'label',
+			'limit',
+			'title',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$label = (!$label) ? 'XML' : $label;
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('flavor',
+				feed_flavor_pop($flavor)).
+
+			tagRow('format',
+				feed_format_pop($format)).
+
+			tagRow('category',
+				link_category_pop($category)).
+
+			tagRow('limit',
+				fInput('text', 'limit', $limit, 'edit', '', '', 2)).
+
+			tagRow('label',
+				fInput('text', 'label', $label, 'edit', '', '', 25)).
+
+			tagRow('title',
+				fInput('text', 'title', $title, 'edit', '', '', 25)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_permlink()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'id',
+			'style',
+			'title'
+		));
+
+		extract($atts);
+
+		$thing = gps('thing');
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('id',
+				input_id($id)).
+
+			tagRow('link_text',
+				fInput('text', 'thing', ($thing ? $thing : '<txp:title />'), 'edit', '', '', 25)).
+
+			tagRow('title',
+				fInput('text', 'title', $title, 'edit', '', '', 25)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			tagRow('inline_style',
+				fInput('text', 'style', $style, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts, $thing));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_newer()
+	{
+		global $step, $endform, $tag_name;
+
+		$thing = gps('thing');
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('link_text',
+				fInput('text', 'thing', ($thing ? $thing : '<txp:text item="newer" />'), 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, array(), $thing));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_older()
+	{
+		global $step, $endform, $tag_name;
+
+		$thing = gps('thing');
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('link_text',
+				fInput('text', 'thing', ($thing ? $thing : '<txp:text item="older" />'), 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, array(), $thing));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_next_title()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_sitename()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_site_slogan()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_prev_title()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_article_image()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'align',
+			'class',
+			'escape',
+			'html_id',
+			'style',
+			'thumbnail',
+			'wraptag',
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('use_thumbnail',
+				yesno2_pop('thumbnail', $thumbnail)).
+
+			tagRow('escape',
+				escape_pop($escape)).
+
+			tagRow('html_id',
+				fInput('text', 'html_id', $html_id, 'edit', '', '', 25)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			tagRow('inline_style',
+				fInput('text', 'style', $style, 'edit', '', '', 25)).
+
+			tagRow('align',
+				fInput('text', 'align', $align, 'edit', '', '', 25)).
+
+			tagRow('wraptag',
+				fInput('text', 'wraptag', $wraptag, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_css()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'format',
+			'media',
+			'n',
+			'rel',
+			'title'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('n',
+				css_pop($n)).
+
+			tagRow('format',
+				css_format_pop($format)).
+
+			tagRow('media',
+				fInput('text', 'media', $media, 'edit', '', '', 25)).
+
+			tagRow('rel',
+				fInput('text', 'rel', $rel, 'edit', '', '', 25)).
+
+			tagRow('title',
+				fInput('text', 'title', $title, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_body()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_excerpt()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_title()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_link()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'rel'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('rel',
+				fInput('text', 'rel', $rel, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_linkdesctitle()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'rel'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('rel',
+				fInput('text', 'rel', $rel, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_link_description()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'escape',
+			'label',
+			'labeltag',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('escape',
+				escape_pop($escape)).
+
+			tagRow('label',
+				fInput('text', 'label', $label, 'edit', '', '', 25)).
+
+			tagRow('labeltag',
+				input_tag('labeltag', $labeltag)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_link_name()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'escape',
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('escape',
+				escape_pop($escape)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_link_category()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'label',
+			'labeltag',
+			'title',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('title',
+				yesno2_pop('title', $title)).
+
+			tagRow('label',
+				fInput('text', 'label', $label, 'edit', '', '', 25)).
+
+			tagRow('labeltag',
+				input_tag('labeltag', $labeltag)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_link_date()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'format',
+			'gmt',
+			'lang'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('time_format',
+				fInput('text', 'format', $format, 'edit', '', '', 25)).
+
+			tagRow('gmt',
+				yesno2_pop('gmt', $gmt)).
+
+			tagRow('locale',
+				fInput('text', 'lang', $lang, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_posted()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'format',
+			'gmt',
+			'lang'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('time_format',
+				fInput('text', 'format', $format, 'edit', '', '', 25)).
+
+			tagRow('gmt',
+				yesno2_pop('gmt', $gmt)).
+
+			tagRow('locale',
+				fInput('text', 'lang', $lang, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comments_invite()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'showcount',
+			'textonly',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('textonly',
+				yesno2_pop('textonly', $textonly)).
+
+			tagRow('showcount',
+				yesno2_pop('showcount', $showcount)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_permlink()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_time()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'format',
+			'gmt',
+			'lang'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('time_format',
+				fInput('text', 'format', $format, 'edit', '', '', 25)).
+
+			tagRow('gmt',
+				yesno2_pop('gmt', $gmt)).
+
+			tagRow('locale',
+				fInput('text', 'lang', $lang, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_name()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'link'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('comment_name_link',
+				yesno2_pop('link', $link)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_email()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_web()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_message()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_email_input()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_message_input()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_name_input()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_preview()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_remember()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_submit()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comment_web_input()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comments()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'break',
+			'breakclass',
+			'class',
+			'id',
+			'form',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('id',
+				input_id($id)).
+
+			tagRow('form',
+				form_pop('form', 'comment', $form)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			tagRow('break',
+				input_tag('break', $break)).
+
+			tagRow('breakclass',
+				fInput('text', 'breakclass', $breakclass, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comments_form()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'id',
+			'isize',
+			'form',
+			'msgcols',
+			'msgrows',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('id',
+				input_id($id)).
+
+			tagRow('isize',
+				fInput('text', 'isize', $isize, 'edit', '', '', 2)).
+
+			tagRow('msgcols',
+				fInput('text', 'msgcols', $msgcols, 'edit', '', '', 2)).
+
+			tagRow('msgrows',
+				fInput('text', 'msgrows', $msgrows, 'edit', '', '', 2)).
+
+			tagRow('form',
+				form_pop('form', 'comment', $form)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_comments_preview()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'id',
+			'form',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('id',
+				input_id($id)).
+
+			tagRow('form',
+				form_pop('form', 'comment', $form)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_search_result_title()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_search_result_excerpt()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'hilight',
+			'limit'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('hilight',
+				input_tag('hilight', $hilight)).
+
+			tagRow('hilight_limit',
+				input_limit($limit)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_search_result_url()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_search_result_date()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'format',
+			'gmt',
+			'lang'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('time_format',
+				fInput('text', 'format', $format, 'edit', '', '', 25)).
+
+			tagRow('gmt',
+				yesno2_pop('gmt', $gmt)).
+
+			tagRow('locale',
+				fInput('text', 'lang', $lang, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_lang()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_breadcrumb()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'label',
+			'link',
+			'linkclass',
+			'sep',
+			'title',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('breadcrumb_separator',
+				fInput('text', 'sep', $sep, 'edit', '', '', 4)).
+
+			tagRow('breadcrumb_linked',
+				yesno_pop('link', $link)).
+
+			tagRow('linkclass',
+				fInput('text', 'linkclass', $linkclass, 'edit', '', '', 25)).
+
+			tagRow('label',
+				fInput('text', 'label', $label, 'edit', '', '', 25)).
+
+			tagRow('title',
+				fInput('text', 'title', $title, 'edit', '', '', 25)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_image()
+	{
+		global $step, $endform, $tag_name, $img_dir;
+
+		$atts = gpsa(array(
+			'class',
+			'escape',
+			'html_id',
+			'style',
+			'wraptag',
+
+			'alt',
+			'caption',
+			'h',
+			'id',
+			'w',
+		));
+
+		extract($atts);
+
+		$ext = gps('ext');
+		$type = gps('type');
+
+		$types = array(
+			'textile'			=> 'Textile',
+			'textpattern' => 'Textpattern',
+			'xhtml'				=> 'XHTML'
+		);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('type',
+				''.selectInput('type', $types, ($type ? $type : 'textpattern'), true)).
+
+			tagRow('escape',
+				escape_pop($escape)).
+
+			tagRow('html_id',
+				fInput('text', 'html_id', $html_id, 'edit', '', '', 25)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			tagRow('inline_style',
+				fInput('text', 'style', $style, 'edit', '', '', 25)).
+
+			tagRow('wraptag',
+				fInput('text', 'wraptag', $wraptag, 'edit', '', '', 25)).
+
+			hInput('id', $id).
+			hInput('ext', $ext).
+			hInput('w', $w).
+			hInput('h', $h).
+			hInput('alt', $alt).
+			hInput('caption', $caption).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			if ($escape == 'html')
+			{
+				$alt = str_replace('&', '&#38;', escape_output($alt));
+				$caption = str_replace('&', '&#38;', escape_output($caption));
+			}
+
+			$url = hu.$img_dir.'/'.$id.$ext;
+
+			switch ($type)
+			{
+				case 'textile':
+					$alt = ($alt) ? ' ('.$alt.')' : '';
+
+					$out .= tdb('!'.$url.$alt.'!');
+				break;
+
+				case 'xhtml':
+					$alt     = ($alt)     ? ' alt="'.$alt.'"' : '';
+					$caption = ($caption) ? ' title="'.$caption.'"' : '';
+					$class   = ($class)   ? ' class="'.$class.'"' : '';
+					$html_id = ($html_id) ? ' id="'.$html_id.'"' : '';
+					$style   = ($style)   ? ' style="'.$style.'"' : '';
+
+					$out .= tdb(
+						($wraptag ? "<$wraptag>" : '').
+						'<img src="'.$url.'" width="'.$w.'" height="'.$h.'"'.$alt.$caption.$html_id.$class.$style.' />'.
+						($wraptag ? "</$wraptag>" : '')
+					);
+				break;
+
+				case 'textpattern':
+				default:
+
+					$atts = array(
+						'class'   => $class, 
+						'html_id' => $html_id, 
+						'id'      => $id, 
+						'style'   => $style,
+						'wraptag' => $wraptag
+					);
+
+					$out .= tdb(tb($tag_name, $atts));
+				break;
+			}
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'form',
+			'id'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('id',
+				input_id($id)).
+
+			tagRow('form',
+				form_pop('form', 'file', $form)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download_list()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'break',
+			'category',
+			'form',
+			'label',
+			'labeltag',
+			'limit',
+			'sort',
+			'wraptag',
+		));
+
+		$asc = ' ('.gTxt('ascending').')';
+		$desc = ' ('.gTxt('descending').')';
+
+		$sorts = array(
+			'filename asc'	 => gTxt('name').$asc,
+			'filename desc'	 => gTxt('name').$desc,
+			'downloads asc'	 => gTxt('download_count').$asc,
+			'downloads desc' => gTxt('download_count').$desc,
+			'rand()'				 => 'Random'
+		);
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(tdcs(hed(gTxt('tag_'.$tag_name),3),2) ).
+
+			tagRow('category',
+				file_category_pop($category)).
+
+			tagRow('sort',
+				' '.selectInput('sort', $sorts, $sort, true)).
+
+			tagRow('limit',
+				input_limit($limit)).
+
+			tagRow('label',
+				fInput('text', 'label', $label, 'edit', '', '', 25)).
+
+			tagRow('labeltag',
+				input_tag('labeltag', $labeltag)).
+
+			tagRow('wraptag',
+				input_tag('wraptag',$wraptag)).
+
+			tagRow('break',
+				input_tag('break',$break)).
+
+			tagRow('form',
+				form_pop('form','file',$form)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		echo $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download_created()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'format'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('time_format',
+				fInput('text', 'format', $format, 'edit', '', '', 15)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download_modified()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'format'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('time_format',
+				fInput('text', 'format', $format, 'edit', '', '', 15)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download_size()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'decimals',
+			'format'
+		));
+
+		$formats = array(
+			'b'	 => 'Bytes',
+			'kb' => 'Kilobytes',
+			'mb' => 'Megabytes',
+			'gb' => 'Gigabytes',
+			'tb' => 'Terabytes',
+			'pb' => 'Petabytes'
+		);
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(hed(gTxt('tag_'.$tag_name), 3)
+			, 2)
+			).
+
+			tagRow('size_format',
+				' '.selectInput('format', $formats, $format, true)).
+
+			tagRow('decimals',
+				fInput('text', 'decimals', $decimals, 'edit', '', '', 4)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download_link()
+	{
+		global $step, $endform, $tag_name, $permlink_mode;
+
+		$atts = gpsa(array(
+			'filename',
+			'id'
+		));
+
+		extract($atts);
+
+		$thing = gps('thing');
+
+		$type = gps('type');
+		$description = gps('description');
+
+		$types = array(
+			'textile'			=> 'Textile',
+			'textpattern' => 'Textpattern',
+			'xhtml'				=> 'XHTML'
+		);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('type',
+				''.selectInput('type', $types, ($type ? $type : 'textpattern'), true)).
+
+			tagRow('id',
+				input_id($id)).
+
+			tagRow('filename',
+				fInput('text', 'filename', $filename, 'edit', '', '', 25)).
+
+			tagRow('link_text',
+				fInput('text', 'thing', ($thing ? $thing : $filename), 'edit', '', '', 25)).
+
+			tagRow('description',
+				'<textarea name="description" cols="22" rows="3">'.$description.'</textarea>').
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$description = str_replace('&', '&#38;', escape_output($description));
+
+			$url = ($permlink_mode == 'messy') ?
+				hu.'index.php?s=file_download'.a.'id='.$id:
+				hu.'file_download/'.$id;
+
+			switch ($type)
+			{
+				case 'textile':
+					$thing = ($thing) ? $thing : $filename;
+					$description = ($description) ? ' ('.$description.')' : '';
+
+					$out .= tdb('"'.$thing.$description.'":'.$url);
+				break;
+
+				case 'xhtml':
+					$thing = ($thing) ? $thing : $filename;
+					$description = ($description) ? ' title="'.$description.'"' : '';
+
+					$out .= tdb('<a href="'.$url.'"'.$description.'>'.$thing.'</a>');
+				break;
+
+				case 'textpattern':
+				default:
+					$atts = array('id' => $id);
+					$thing = ($thing) ? $thing : '<txp:file_download_name />';
+
+					$out .= tdb(tb($tag_name, $atts, $thing));
+				break;
+			}
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download_name()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download_downloads()
+	{
+		global $step, $endform, $tag_name;
+
+		return form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			n.endTable()
+		).
+
+		tdb(tb($tag_name));
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download_category()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'escape',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('escape',
+				escape_pop($escape)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function tag_file_download_description()
+	{
+		global $step, $endform, $tag_name;
+
+		$atts = gpsa(array(
+			'class',
+			'escape',
+			'wraptag'
+		));
+
+		extract($atts);
+
+		$out = form(
+			startTable('tagbuilder').
+
+			tr(
+				tdcs(
+					hed(gTxt('tag_'.$tag_name), 3)
+				, 2)
+			).
+
+			tagRow('escape',
+				escape_pop($escape)).
+
+			tagRow('wraptag',
+				input_tag('wraptag', $wraptag)).
+
+			tagRow('class',
+				fInput('text', 'class', $class, 'edit', '', '', 25)).
+
+			$endform
+		);
+
+		if ($step == 'build')
+		{
+			$out .= tdb(tb($tag_name, $atts));
+		}
+
+		return $out;
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/index.php
===================================================================
--- trunk/www.openmoko.com/textpattern/index.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/index.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,121 @@
+<?php
+
+/*
+	This is Textpattern
+
+	Copyright 2005 by Dean Allen
+	www.textpattern.com
+	All rights reserved
+
+	Use of this software indicates acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/index.php $
+$LastChangedRevision: 1948 $
+
+*/
+	if (@ini_get('register_globals'))
+		foreach ( $_REQUEST as $name => $value )
+			unset($$name);
+
+	define("txpath", dirname(__FILE__));
+	define("txpinterface", "admin");
+
+	$thisversion = '4.0.4';
+	$txp_using_svn = false; // set false for releases
+
+	// NOTE: to use constants from our openmoko_common_cfg.php in config.php
+ 	// we have to make sure it gets loaded before config.php is used.
+	require_once '../../openmoko_common_cfg.php';
+
+	ob_start(NULL, 2048);
+	if (!@include './config.php') { 
+		ob_end_clean();
+		include txpath.'/setup/index.php';
+		exit();
+	} else ob_end_clean();
+
+	header("Content-type: text/html; charset=utf-8");
+	if (isset($_POST['form_preview'])) {
+		include txpath.'/publish.php';
+		textpattern();
+		exit;
+	}
+	
+	error_reporting(E_ALL);
+	@ini_set("display_errors","1");
+
+	include_once txpath.'/lib/constants.php';
+	include txpath.'/lib/txplib_db.php';
+	include txpath.'/lib/txplib_forms.php';
+	include txpath.'/lib/txplib_html.php';
+	include txpath.'/lib/txplib_misc.php';
+	include txpath.'/lib/admin_config.php';
+
+	$microstart = getmicrotime();
+
+	 if ($connected && safe_query("describe `".PFX."textpattern`")) {
+
+		$dbversion = safe_field('val','txp_prefs',"name = 'version'");
+
+		$prefs = get_prefs();
+		extract($prefs);
+
+		if (empty($siteurl))
+			$siteurl = $_SERVER['HTTP_HOST'] . rtrim(dirname(dirname($_SERVER['SCRIPT_NAME'])), '/');
+		if (empty($path_to_site))
+			updateSitePath(dirname(dirname(__FILE__)));
+	
+		define("LANG",$language);
+		//i18n: define("LANG","en-gb");
+		define('txp_version', $thisversion);
+		if ( !defined(  'PROTOCOL'))
+			define( 'PROTOCOL', ( strtolower( serverSet( 'HTTPS')) == 'on' ? 'https://' : 'http://'));
+		define("hu",PROTOCOL.$siteurl.'/');
+		// v1.0 experimental relative url global
+		define("rhu",preg_replace("/https?:\/\/.+(\/.*)\/?$/U","$1",hu));
+
+		if (!empty($locale)) setlocale(LC_ALL, $locale);
+		$textarray = load_lang(LANG);
+	
+		include txpath.'/include/txp_auth.php';
+		doAuth();
+
+		$event = (gps('event') ? gps('event') : 'article');
+		$step = gps('step');
+		
+		if (!$dbversion or ($dbversion != $thisversion) or $txp_using_svn)
+		{
+			define('TXP_UPDATE', 1);
+			include txpath.'/update/_update.php';
+		}
+
+		if (!empty($admin_side_plugins) and gps('event') != 'plugin')
+			load_plugins(1);
+
+		include txpath.'/lib/txplib_head.php';
+
+		// ugly hack, for the people that don't update their admin_config.php
+		// Get rid of this when we completely remove admin_config and move privs to db
+		if ($event == 'list') 		
+			require_privs('article'); 
+		else 
+			require_privs($event);
+
+		callback_event($event, $step, 1);
+
+		$inc = txpath . '/include/txp_'.$event.'.php';
+		if (is_readable($inc))
+			include($inc);
+	
+		callback_event($event, $step, 0);
+
+		$microdiff = (getmicrotime() - $microstart);
+		echo n.comment(gTxt('runtime').': '.substr($microdiff,0,6));
+
+		end_page();
+
+	} else {
+		txp_die('DB-Connect was succesful, but the textpattern-table was not found.',
+				'503 Service Unavailable');
+	}
+?>

Added: trunk/www.openmoko.com/textpattern/lang/README
===================================================================
--- trunk/www.openmoko.com/textpattern/lang/README	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lang/README	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,19 @@
+LANGUAGE FILES
+
+All language strings used by Textpattern are stored in the database 
+as of 1.0RC4 (and later). You can change your language by selecting from 
+the installed languages in "admin -> preferences". To install additional 
+languages, go to "admin -> preferences -> Install Language". The 
+preferred and default method of installation is to query a remote server 
+(at textpattern.com) to ensure that you always get the most recent 
+set of languages in their most recent state.
+
+In case your computer is not connected to the Internet, the fallback method
+is to install from the files that are in the /textpattern/lang directory. 
+Please be aware that these files may be outdated and newer language strings 
+may be missing. 
+
+If you are interested in translating Textpattern into your own language, we
+would like to hear from you on our forums at http://www.textpattern.com/. 
+
+

Added: trunk/www.openmoko.com/textpattern/lang/en-gb.txt
===================================================================
--- trunk/www.openmoko.com/textpattern/lang/en-gb.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lang/en-gb.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,794 @@
+#@version 4.0.1;1127915659
+#@admin
+add_new_author => Add new author
+and_mailed_to => and mailed to
+a_message_will_be_sent_with_login => A message will be sent with login information
+a_new_password_will_be_mailed => A new password will be e-mailed
+change_email_address => Change your email address
+change_password => Change your password
+copy_editor => Copy Editor
+could_not_mail => Could not mail
+could_not_update_author => Could not update author
+designer => Designer
+error_adding_new_author => Error adding new author
+freelancer => Freelancer
+greeting => Dear
+log_in_at => Login at
+mail_it => Mail it to me
+managing_editor => Managing Editor
+new_email => New email
+new_password => New password
+password_changed => Password changed
+password_sent_to => Password sent to
+privileges => Privileges
+publisher => Publisher
+real_name => Real Name
+reset_author_password => Reset author password
+site_administration => Site Administration
+staff_writer => Staff writer
+writer => Writer
+your_login_info => Your login info
+your_login_is => Your login is
+your_new_password => Your new password
+your_password_is => Your password is
+you_have_been_registered => You have been registered as a contributor to the site
+#@article
+advanced_options => Advanced Options
+article_deleted => Article deleted!
+article_image => Article image
+article_posted => Article posted
+article_saved => Article saved
+article_saved_draft => Article saved as draft
+article_saved_hidden => Article saved as hidden
+article_saved_pending => Article saved as pending
+or_publish_at => or publish at
+override_default_form => Override form
+pending => Pending
+reset_time => Reset time to now
+set_to_now => Set timestamp to now
+url_title => URL-only title
+url_title_is_blank => (URL-only title was left blank)
+url_title_is_multiple => (The same URL-only title is used by {count} different articles)
+#@category
+article_category => Article category
+article_category_name => Article category name
+article_category_title => Article category title
+article_head => Article Categories
+file_category_name => File Category name
+file_category_title => File Category title
+file_head => File Categories
+image_category_name => Image Category name
+image_category_title => Image category title
+image_head => Image Categories
+link_category_name => Link Category name
+link_category_title => Link Category title
+link_head => Link Categories
+parent => Parent
+#@common
+are_you_sure => Are you sure?
+auth_required => Authorisation required
+bad_cookie => Bad cookie
+confirm_delete_popup => Really delete?
+cookies_must_be_enabled => Browser cookies must be enabled to use Textpattern.
+could_not_log_in => Could not log in with that name/password
+delete_selected => Delete selected
+draft => Draft
+file_max_upload_size => Max Upload File Size (bytes)
+hidden => Hidden
+image_category => Category
+link_category => Link category
+logged_in_as => Logged in as
+login_name => Login
+login_to_textpattern => Log in to Textpattern
+logout => Log out
+log_in => log in
+log_in_button => Log in
+password => password
+per_page => per page
+range => Range
+restricted_area => Restricted area
+save_new => Save New
+sort_value => Sort Value
+stay_logged_in => Remain logged in with this browser
+sticky => Sticky
+structure => Structure
+tab_admin => admin
+tab_comments => comments
+tab_content => content
+tab_diagnostics => diagnostics
+tab_extensions => extensions
+tab_file => files
+tab_forms => forms
+tab_image => images
+tab_import => import
+tab_link => links
+tab_list => articles
+tab_logs => logs
+tab_organise => organise
+tab_pages => pages
+tab_plugins => plugins
+tab_preferences => preferences
+tab_presentation => presentation
+tab_sections => sections
+tab_site_admin => site admin
+tab_style => style
+tab_view_site => view site
+tab_write => write
+thumbnail => Thumb
+title_body => Title & Body
+upload_err_form_size => File exceeds the maximum size specified in textpattern's preferences
+upload_err_ini_size => File exceeds the upload_max_filesize directive in php.ini
+upload_err_no_file => No file was specified
+upload_err_partial => File was only partially uploaded
+upload_file => Upload file
+use_textile => Use Textile
+viewsite => View Site
+visible => Visible
+with_selected => With selected:
+#@css
+add_declaration => add declaration
+add_new_selector => Add new selector
+all_stylesheets => All stylesheets
+bulkload_existing_css => Create or load new CSS
+cannot_delete_default_css => CSS default cannot be deleted
+copy_css_as => Copy style sheet as:
+create_new_css => Create new CSS
+css_mode => CSS Mode
+css_property_value => Property : Value
+css_selector => Selector
+delete_declaration => Delete this declaration
+delete_entire_selector => Delete entire selector
+delete_this_declaration => Delete this declaration
+edit_css => edit CSS
+edit_css_file => edit CSS file
+edit_css_in_form => Edit in CSS editor
+edit_raw_css => Edit raw CSS
+name_for_this_style => Name for this style
+property => Property
+save_css_as => Save style sheet as:
+save_this_declaration => Save this declaration
+save_this_selector => Save this selector
+selector => Selector
+style_sheet => Style sheet
+style_sheet_saved => Style sheet saved
+you_are_editing_css => You are editing CSS
+#@diag
+all_checks_passed => All checks passed!
+apache_modules => Apache modules
+apache_version => Apache version
+cleanurl_only_apache => Clean URLs are only supported for apache, use at your own risk
+detail => Detail
+diagnostic_info => Diagnostic info
+dir_not_writable => {dirtype} is not writable
+dns_lookup_fails => Web Domain DNS lookup fails
+document_root => Document root
+file_uploads_disabled => File uploads are disabled
+high => high
+htaccess_contents => .htaccess file contents
+htaccess_missing => .htaccess file is missing
+img_dir_read_only => Image directory is read-only
+is_inaccessible => is inaccessible
+low => low
+magic_quotes => Magic quotes
+missing_files => Missing files
+mod_rewrite_missing => Apache module mod_rewrite is not installed
+old_placeholder => Old placeholder file is in the way
+os_version => Operating System
+path_to_site_inacc => path_to_site is inaccessible
+php_extensions => PHP extensions
+php_sapi_mode => PHP mode
+php_version => PHP version
+preflight_check => Pre-flight check
+register_globals => Register globals
+server => Server
+server_time => Server time
+site_trailing_slash => Site URL has a trailing slash
+still_exists => still exists
+txp_path => Textpattern path
+txp_version => Textpattern version
+web_domain => Site URL
+#@discuss
+ban => Ban
+cant_ban_blank_ip => Can't ban a blank IP address!
+confirm_comment_deletion => confirm comment deletion
+displayed_comments => Displayed comments
+edit_comment => edit comment
+hide_comment => Hide comment
+list_banned_ips => List banned IPs
+no_comments_recorded => No comments recorded yet
+no_ips_banned => No IPs have been banned
+unban => Unban
+#@file
+download => download
+downloads => Downloads
+existing_file => Existing file:
+file => File
+file_already_exists => already exists
+file_category => File Category
+file_delete_failed => Failed to delete file
+file_dir_not_writeable => Warning: cannot write to file directory<br /> {filedir}. <br />Please change file permissions to 777.
+file_download_count => Download Count
+file_name => Filename
+file_not_found => File not found
+file_relink => Upload/Assign File
+file_status => File Status
+file_status_missing => Missing
+file_status_ok => Ok
+file_upload_failed => Failed to upload file
+invalid_filename => Invalid filename
+invalid_id => Invalid ID
+linked_to_file => Linked record to file
+permissions => Permissions
+private => Private
+public => Public
+reset => reset
+reset_file_count_failure => Failed to reset file count
+reset_file_count_success => Successfully reset file count
+#@form
+all_forms => All forms
+create_new_form => Create new form
+delete_form_confirmation => confirm form deletion
+edit_forms => edit forms
+form_name => Form name (required)
+form_type => Form type (required)
+list_forms => list forms
+you_are_editing_form => You are editing form
+#@image
+cannot_write_directory => Cannot write to directory
+choose_either_width_height_or_both => Indicate width, height, or both
+create_thumbnail => Create thumbnail
+image_name => Image name
+image_save_error => there was a problem saving image data
+img_dir_not_writeable => Warning: cannot write to image directory<br /> {imgdir}. <br />Please change file permissions to 777.
+invalid_width_or_height => Invalid width or height
+keep_square_pixels => Crop
+not_saved => <strong>not</strong> saved!
+only_graphic_files_allowed =>  .jpg, .gif, .png or .swf graphic files allowed
+replace_image => Replace image
+save_these_settings_as_default => Save settings as default
+thumb_height => Height
+thumb_width => Width
+upload_category => Category
+upload_dir_perms => directory permissions must be 777
+upload_thumbnail => Upload thumbnail
+#@import
+continue => Continue
+database_stuff => Database Data
+import_blogid => Weblog ID
+import_database => Database name
+import_file_not_found => Import file not found. <br />Please name the file import.txt and place it in /textpattern/include/import/
+import_host => Mysql host
+import_invite => Default comments invite
+import_login => Mysql user
+import_password => Mysql password
+import_section => Section to import into
+import_status => Default article status
+import_wpprefix => Tables prefix (if any)
+select_tool => Import from
+txp_import => Import content from other publishing tools
+#@link
+edit_links => edit links
+linkcategory => Link Categories
+links => Links
+linktext => linktext
+link_name => Link Name
+link_saved => Link saved
+link_text => Link text
+#@log
+logs => Logs
+no_refers_recorded => No referrers recorded yet
+referrer => Referrer
+visitor_logs => visitor logs
+#@page
+all_pages => All pages
+copy_page_as => Copy page as:
+delete_page_confirmation => confirm page deletion
+edit_page => edit page
+edit_pages => edit page template
+page_article_hed => Article output
+page_article_nav_hed => Article navigation
+page_misc_hed => Miscellaneous
+page_nav_hed => Site navigation
+page_xml_hed => XML feeds
+you_are_editing_div => You are editing div
+you_are_editing_page => You are editing page template
+#@plugin
+bad_plugin_code => Badly formed or empty plugin code
+broken_plugin => broken
+edit_plugins => edit plugins
+install => Install
+install_plugin => Install plugin
+old_plugin => Old-style (text file) plugin installer
+plugin => Plugin
+plugins => Plugins
+plugin_help => Plugin help
+previewing_plugin => Previewing plugin:
+#@prefs
+active_language => Currently active language
+admin_side_plugins => Use admin side plugins?
+advanced_preferences => Advanced preferences
+allow_article_php_scripting => Allow PHP on articles?
+allow_form_override => Allow form override?
+allow_page_php_scripting => Allow PHP on pages?
+all_hits => All hits
+archive_dateformat => Archive date format
+archive_date_case => Archive date case
+archive_dir => Archive directory
+articles_use_excerpts => Articles use excerpts?
+attach_titles_to_permalinks => Attach titles to permalinks?
+category_subcategory => /category/subcategory
+check_for_txp_updates => Check Textpattern Updates
+clean => /clean/
+comments_are_ol => Present comments as a numbered list?
+comments_auto_append => Automatically append comments to articles?
+comments_dateformat => Comments date format
+comments_default_invite => Default invite
+comments_disabled_after => Disabled after
+comments_disallow_images => Disallow user images
+comments_mode => Comments mode
+comments_moderate => Moderate comments
+comments_on_default => On by default?
+comments_require_email => Comments require user email?
+comments_require_name => Comments require user name?
+comments_sendmail => Mail comments to author
+comment_means_site_updated => New comment means site updated?
+comment_nofollow => Use nofollow on comments?
+convert_linebreaks => Convert linebreaks
+custom_10_set => Custom field 10 name
+custom_1_set => Custom field 1 name
+custom_2_set => Custom field 2 name
+custom_3_set => Custom field 3 name
+custom_4_set => Custom field 4 name
+custom_5_set => Custom field 5 name
+custom_6_set => Custom field 6 name
+custom_7_set => Custom field 7 name
+custom_8_set => Custom field 8 name
+custom_9_set => Custom field 9 name
+czech => Čeština
+danish => Dansk
+dutch => Nederlands
+edit_preferences => Edit preferences
+edit_raw_css_by_default => Edit raw CSS by default?
+english_gb => English (GB)
+english_us => English (US)
+expire_logs_after => Expire logs after
+file_base_path => File Upload Path
+finnish => Finnish
+french => Français
+from_file => Install from file
+from_server => Install from remote server
+gmtoffset => Time Zone
+id_title => /id/title
+img_dir => Image directory
+include_email_atom => Include email in atom feeds?
+install_langfile => To install new languages from file you can download them from {url} and place them inside your ./textpattern/lang/ directory.
+install_language => Install language
+is_dst => Daylight Savings
+language => Language
+leave_text_untouched => Leave text untouched
+locale => Locale
+logging => Logging
+logs_expire => Expire logs after
+manage_languages => Manage languages
+max_url_len => Max URL length
+mentions => Mentions
+messy => ?=messy
+never_display_email => Never display email?
+new_textpattern_version_available => There is a completely new Textpattern version available. Do you want to try it?
+norwegian => Norwegian
+no_popup => current window
+override_emailcharset => Use ISO-8859-1 for e-mails? (default is utf-8)
+page_mode => Page mode
+path_from_root => Subdirectory (if any)
+path_to_site_missing => $path_to_site is not set (update index.php)
+permalink_title_format => Permalink title-like-this (default is TitleLikeThis)
+permlink_mode => Permanent link mode
+ping_textpattern_com => Ping textpattern.com?
+ping_weblogsdotcom => Update Ping-o-matic
+polish => Polish
+portuguese => Portuguese
+preferences_saved => Preferences saved
+prefs => Prefs
+problem_connecting_rpc_server => There is a problem trying to connect to the RPC server. Please, try again later.
+production_debug => Debugging
+production_live => Live
+production_status => Production Status
+production_test => Testing
+record_mentions => Record mentions
+referrers_only => Referrers only
+rpc_connect_error => Can't connect to remote server to check for updated language files. Please try again later.
+rss_how_many => How many articles on RSS?
+russian => Russian
+scots => Scots
+section_id_title => /section/id/title
+section_title => /section/title
+send_lastmod => Send Last-Modified header
+show_article_category_count => Show article count on Categories?
+show_comment_count_in_feed => Show comment count in feeds?
+site_prefs => Site Preferences
+spam_blacklists => Spam blacklists (comma separated)
+spanish => Español
+swedish => Swedish
+syndicate_body_or_excerpt => Syndicate excerpt? (default is body)
+tagalog => Tagalog
+tempdir => Temp folder
+textile_links => Textile links description by default?
+thai => Thai
+timeoffset => Time offset (hours)
+title_only => /title
+updated_branch_version_available => There is an updated version of this Textpattern branch available
+update_languages => Update languages
+urls_to_ping => URLs to ping (comma separated)
+url_mode => URL mode
+use_comments => Accept comments
+use_dns => Use DNS?
+use_mail_on_feeds_id => Use mail on feeds id?
+use_plugins => Use plugins?
+year_month_day_title => /year/month/day/title
+#@public
+404_not_found => 404 - The requested page was not found.
+active => Active
+add => Add
+admin => Admin
+ago => ago
+all => All
+already_exists => already exists
+alt_text => Alt text
+article => article
+articles => Articles
+articles_found => articles found
+article_found => article found
+ascending => Ascending
+author => Author
+authors => Authors
+a_few_seconds => a few seconds
+blockquote => Blockquote
+bulleted_list => Bulleted list
+caption => Caption
+categories => Categories
+categorize => Categorise
+category => Category
+category1 => Cat. 1
+category2 => Cat. 2
+change => change
+check_html => Check HTML
+citation => citation
+comment => comment
+comments => Comments
+comments_closed => commenting closed for this article
+comments_on => comments on
+comments_permlink => Permanent link
+comment_comment => Comment
+comment_email => Email
+comment_email_required => Please enter a valid email address
+comment_invitation => Invitation
+comment_moderated => Your comment is pending moderation. It will appear after it has been approved.
+comment_name => Name
+comment_name_required => Please enter your name
+comment_posted => Thank you for adding your comment.
+comment_received => [{site}] comment received: {title}
+comment_recorded => A comment on your post "{title}" was recorded.
+comment_required => You must enter a comment
+comment_web => Web
+contact => Contact
+copy => Copy
+create => Create
+created => created
+create_new => Create new
+cs-cz => Čeština
+css => css
+custom => custom
+da-dk => Dansk
+date => Date
+dateformat => Date format
+date_case => Date case
+day => day
+days => days
+de-de => Deutsch
+default => Default
+delete => Delete
+deleted => deleted
+deleted_text => deleted text
+descending => Descending
+description => Description
+edit => edit
+el-gr => Ελληνικά
+email => email
+email_address => Email address
+emphasis => emphasis
+en-gb => English (GB)
+en-us => English (US)
+english => English
+es-es => Español
+et-ee => Eesti
+excerpt => Excerpt
+experts_only => experts only
+extensions => Extensions
+fi-fi => Suomi
+forget => Forget
+form => Form
+form_not_found => Form not found
+form_not_specified => No form name specified
+forms => Forms
+fr-fr => Français
+go => go
+go_to => Go to
+header => header
+host => Host
+hour => hour
+hours => hours
+hr => horizontal rule
+HTML => HTML
+hyperlink => hyperlink
+image => image
+imageurl => imageurl
+inserted_text => inserted text
+is-is => Íslenska(Icelandic)
+it-it => Italiano
+ja-jp => 日本語
+keywords => Keywords
+label => Label
+last_modification => Last Modification
+linebreak => line break
+list => List
+list_articles => List Articles
+list_categories => list categories
+list_discussions => list comments
+list_links => list links
+live => Live
+lowercase => lowercase
+lv-lv => Latviešu
+manual => Manual
+message => Message
+message_deleted => Message deleted
+message_preview => Message Preview
+message_saved => Message saved
+minute => minute
+minutes => minutes
+modified_by => Last modified by
+month => Month
+more => More
+name => name
+never => never
+next => next
+nl-nl => Nederlands
+no => no
+no-no => Norsk
+none => None
+nopopup => nopopup
+numeric_list => Numeric list
+off => off
+older => older
+on => on
+only_articles_can_be_previewed => NB: only article forms can be previewed.
+page => Page
+pages => Pages
+paragraph => paragraph
+permanent_link => Permanent link to this article
+permlink => Permanent link
+plugin_load_error => A problem occured while loading the plugin:
+plugin_load_error_above => The above errors were caused by the plugin:
+popup => popup
+post => Post
+posted => Posted
+posted_by => Posted by
+prev => prev
+preview => preview
+pt-pt => Português
+publish => Publish
+published_at => Published at
+recently => Recently
+recent_articles => Recent Articles
+recent_posts => Recent Posts
+remember => Remember
+revert => Revert
+ru-ru => Русский
+save => Save
+saved => saved
+save_button => Save
+search => Search
+search_results => Search results
+select => select
+selected => selected
+site => Site
+sitename => Site name
+siteurl => Site URL
+site_slogan => Site tagline
+sk-sk => Slovenčina
+status => Status
+strong => strong
+submit => Submit
+subscript => subscript
+superscript => superscript
+sv-se => Svenska
+syndicate => Syndicate
+tag_error => An error occurred in the following tag:
+textile_help => Textile Help
+text_conversion => Text conversion
+text_handling => Text handling
+th-th => ไทย
+time => Time
+title => Title
+tooltip => Link tooltip
+type => Type
+undefined => Undefined
+unknown_section => Unknown section
+unknown_tag => Unknown tag
+untitled => Untitled
+updated => updated
+upload => Upload
+uploaded => uploaded
+url => URL
+value => Value
+version => Version
+view => View
+website => website
+week => week
+weeks => weeks
+yes => yes
+your_branch_is_updated => You have the most updated version of this Textpattern branch
+your_ip_is_blacklisted_by => Your IP address has been blacklisted by
+you_have_been_banned => You have been banned from commenting.
+yyyy-mm => yyyy-mm
+zh-cn => 中文(简体)
+zh-tw => 中文(繁體)
+#@section
+delete_section_confirmation => confirm section deletion
+edit_sections => edit sections
+include_in_search => Include in site search
+on_front_page => On front page
+section => Section
+sections => Sections
+section_head => Site Sections
+section_longtitle => Section title
+section_name => Section name
+section_name_already_exists => Section name already exists
+selected_by_default => Selected by default
+style => Style
+uses_page => Uses page
+uses_style => Uses style
+#@setup
+about_to_create => You are about to create and populate database tables.
+already_installed => Looks like Textpattern is already installed. If you want to make a clean install, please remove <code>config.php</code> from your <code>/textpattern/</code> directory and try again.
+before_you_proceed => Before you proceed
+checking_database => Checking database connection...
+choose_password => Choose a password
+confirm_site_path => Please confirm the following path
+create_config => create a file called <code>config.php</code> in the <code>/textpattern/</code> directory and paste the following inside:
+db_cant_connect => Can't connect to database
+db_connected => Connected
+db_doesnt_exist => Database {dbname} doesn't exist
+db_must_exist => Note that the database you specify must exist; Textpattern won’t create it for you.
+did_it => I did it
+errors_during_install => There were {num} errors during the installation. You can ask for help in the Textpattern forums.
+full_path_to_txp => Full server path to Textpattern
+mysql_database => MySQL database
+mysql_login => MySQL login
+mysql_password => MySQL password
+mysql_server => MySQL server
+my_site => My Site
+my_slogan => My pithy slogan
+need_details => Inevitably, we need a few details
+please_enter_url => Please enter the web-reachable address of your site
+prefix_bad_characters => The table prefix {dbprefix} contains characters that are not allowed.<br /> The first character must match one of <b>a-zA-Z_</b> and all following characters must match one of <b>a-zA-Z0-9_</b>
+prefix_warning => (Use ONLY if you require multiple installations in one database)
+setup_comment_invite => Comment
+setup_login => Choose a login name (basic characters and spaces only please)
+site_path => Site path
+site_url => Site URL
+table_prefix => Table prefix
+thanks => Thank you.
+thanks_for_interest => Thank you for your interest in Textpattern.
+that_went_well => That went well. Database tables were created and populated.
+using_db => Using {dbname}
+warn_mail_unavailable => Your php installation is missing the mail() function. Therefore no emails can be sent from textpattern, which limits certain functionality.
+welcome_to_textpattern => Welcome to Textpattern
+your_email => Your email address
+your_full_name => Your full name
+you_can_access => You should be able to access the <a href="index.php">main interface</a> with the login and password you chose.
+#@tag
+article_divider => Article divider
+breadcrumb_linked => Link breadcrumbs?
+breadcrumb_separator => Breadcrumbs separator
+break => Break
+build => Build Tag
+button_text => Button text
+comments_form => Form
+comment_form => Comment form
+file_download_tags => File downloads
+flavour => Flavour
+has_excerpt => Has excerpt
+input_size => Input size
+limit => Limit
+link_to_this_author => Link to a list of other articles by this author?
+link_to_this_category => Link to a list of other articles in this category?
+link_to_this_section => Link to a list of other articles in this section?
+listform => List form
+newer => newer
+next_page_link => Next page link
+page_file_hed => File downloads
+search_input_form => Search input
+search_results_form => Search results
+sort_by => Sort by
+sort_direction => Sort direction
+tag => Tag
+tags => Tags
+tag_article => Articles (single or list)
+tag_article_custom => Articles (custom list)
+tag_article_image => Article image
+tag_author => Author
+tag_body => Body
+tag_body_excerpt => Body excerpt
+tag_breadcrumb => Breadcrumb
+tag_category1 => Category 1
+tag_category2 => Category 2
+tag_category_list => Category list
+tag_comments_invite => Comments invite
+tag_comment_email_input => Email input
+tag_comment_message_input => Message input
+tag_comment_name => Comment name
+tag_comment_name_input => Name input
+tag_comment_permlink => Permanent link
+tag_comment_preview => Preview button
+tag_comment_remember => Remember details checkbox
+tag_comment_submit => Submit button
+tag_comment_time => Time
+tag_comment_web_input => Web input
+tag_css => CSS link (head)
+tag_email => Email link (spam-proof)
+tag_excerpt => Excerpt
+tag_feed_link => Feed to articles
+tag_file_download => File download form
+tag_file_download_category => Category
+tag_file_download_created => Created time
+tag_file_download_downloads => Download count
+tag_file_download_id => ID
+tag_file_download_link => Link
+tag_file_download_list => File list
+tag_file_download_modified => Modified time
+tag_file_download_name => Name
+tag_file_download_size => Size
+tag_home => Home
+tag_inline_ => Inline at end
+tag_lang => Language
+tag_link => Link only
+tag_linkdesctitle => Link, title=Description
+tag_linklist => List of links
+tag_link_description => Description only
+tag_link_feed_link => Feed to links
+tag_link_text => Link text only
+tag_link_to_home => Link to home page
+tag_link_to_next => Link to next article
+tag_link_to_prev => Link to previous article
+tag_message => Message
+tag_name => Commenter name
+tag_newer => Link to newer articles
+tag_next_article => Next article
+tag_next_title => Next article title
+tag_older => Link to older articles
+tag_output_form => Output form
+tag_page_title => Page title
+tag_paging_link => Next page link
+tag_password_protect => Password protection
+tag_permlink => Permanent link
+tag_popup => Popup list
+tag_posted => Posted
+tag_prev_article => Previous article
+tag_prev_title => Previous article title
+tag_recent_articles => Recent articles
+tag_recent_comments => Recent comments
+tag_related_articles => Related articles
+tag_search_input => Search input form
+tag_search_result_date => Result date
+tag_search_result_excerpt => Result excerpt
+tag_search_result_title => Result title
+tag_search_result_url => Result URL
+tag_section => Section
+tag_sitename => Site name
+tag_site_slogan => Site tagline
+tag_title => Title
+tag__inline => Inline at beginning
+text_or_tag => * text or tag here *
+title_separator => Sitename: Individual Article separator
+useful_tags => Useful tags
+wraptag => Wraptag

Added: trunk/www.openmoko.com/textpattern/lib/IXRClass.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/IXRClass.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/IXRClass.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,846 @@
+<?php
+
+/* 
+   IXR - The Inutio XML-RPC Library - (c) Incutio Ltd 2002
+   Version 1.61 - Simon Willison, 11th July 2003 (htmlentities -> htmlspecialchars)
+   Site:   http://scripts.incutio.com/xmlrpc/
+   Manual: http://scripts.incutio.com/xmlrpc/manual.php
+   Made available under the Artistic License: http://www.opensource.org/licenses/artistic-license.php
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/IXRClass.php $
+$LastChangedRevision: 765 $
+*/
+
+class IXR_Value {
+    var $data;
+    var $type;
+    function IXR_Value ($data, $type = false) {
+        $this->data = $data;
+        if (!$type) {
+            $type = $this->calculateType();
+        }
+        $this->type = $type;
+        if ($type == 'struct') {
+            /* Turn all the values in the array in to new IXR_Value objects */
+            foreach ($this->data as $key => $value) {
+                $this->data[$key] = new IXR_Value($value);
+            }
+        }
+        if ($type == 'array') {
+            for ($i = 0, $j = count($this->data); $i < $j; $i++) {
+                $this->data[$i] = new IXR_Value($this->data[$i]);
+            }
+        }
+    }
+    function calculateType() {
+        if ($this->data === true || $this->data === false) {
+            return 'boolean';
+        }
+        if (is_integer($this->data)) {
+            return 'int';
+        }
+        if (is_double($this->data)) {
+            return 'double';
+        }
+        // Deal with IXR object types base64 and date
+        if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {
+            return 'date';
+        }
+        if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
+            return 'base64';
+        }
+        // If it is a normal PHP object convert it in to a struct
+        if (is_object($this->data)) {
+            
+            $this->data = get_object_vars($this->data);
+            return 'struct';
+        }
+        if (!is_array($this->data)) {
+            return 'string';
+        }
+        /* We have an array - is it an array or a struct ? */
+        if ($this->isStruct($this->data)) {
+            return 'struct';
+        } else {
+            return 'array';
+        }
+    }
+    function getXml() {
+        /* Return XML for this value */
+        switch ($this->type) {
+            case 'boolean':
+                return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';
+                break;
+            case 'int':
+                return '<int>'.$this->data.'</int>';
+                break;
+            case 'double':
+                return '<double>'.$this->data.'</double>';
+                break;
+            case 'string':
+                return '<string>'.htmlspecialchars($this->data).'</string>';
+                break;
+            case 'array':
+                $return = '<array><data>'."\n";
+                foreach ($this->data as $item) {
+                    $return .= '  <value>'.$item->getXml()."</value>\n";
+                }
+                $return .= '</data></array>';
+                return $return;
+                break;
+            case 'struct':
+                $return = '<struct>'."\n";
+                foreach ($this->data as $name => $value) {
+                    $return .= "  <member><name>$name</name><value>";
+                    $return .= $value->getXml()."</value></member>\n";
+                }
+                $return .= '</struct>';
+                return $return;
+                break;
+            case 'date':
+            case 'base64':
+                return $this->data->getXml();
+                break;
+        }
+        return false;
+    }
+    function isStruct($array) {
+        /* Nasty function to check if an array is a struct or not */
+        $expected = 0;
+        foreach ($array as $key => $value) {
+            if ((string)$key != (string)$expected) {
+                return true;
+            }
+            $expected++;
+        }
+        return false;
+    }
+}
+
+
+class IXR_Message {
+    var $message;
+    var $messageType;  // methodCall / methodResponse / fault
+    var $faultCode;
+    var $faultString;
+    var $methodName;
+    var $params;
+    // Current variable stacks
+    var $_arraystructs = array();   // The stack used to keep track of the current array/struct
+    var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array
+    var $_currentStructName = array();  // A stack as well
+    var $_param;
+    var $_value;
+    var $_currentTag;
+    var $_currentTagContents;
+    // The XML parser
+    var $_parser;
+    function IXR_Message ($message) {
+        $this->message = $message;
+    }
+    function parse() {
+        // first remove the XML declaration
+        $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message);
+        if (trim($this->message) == '') {
+            return false;
+        }
+        $this->_parser = xml_parser_create();
+        // Set XML parser to take the case of tags in to account
+        xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
+        // Set XML parser callback functions
+        xml_set_object($this->_parser, $this);
+        xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
+        xml_set_character_data_handler($this->_parser, 'cdata');
+        if (!xml_parse($this->_parser, $this->message)) {
+            /* die(sprintf('XML error: %s at line %d',
+                xml_error_string(xml_get_error_code($this->_parser)),
+                xml_get_current_line_number($this->_parser))); */
+            return false;
+        }
+        xml_parser_free($this->_parser);
+        // Grab the error messages, if any
+        if ($this->messageType == 'fault') {
+            $this->faultCode = $this->params[0]['faultCode'];
+            $this->faultString = $this->params[0]['faultString'];
+        }
+        return true;
+    }
+    function tag_open($parser, $tag, $attr) {
+        $this->currentTag = $tag;
+        switch($tag) {
+            case 'methodCall':
+            case 'methodResponse':
+            case 'fault':
+                $this->messageType = $tag;
+                break;
+            /* Deal with stacks of arrays and structs */
+            case 'data':    // data is to all intents and puposes more interesting than array
+                $this->_arraystructstypes[] = 'array';
+                $this->_arraystructs[] = array();
+                break;
+            case 'struct':
+                $this->_arraystructstypes[] = 'struct';
+                $this->_arraystructs[] = array();
+                break;
+        }
+    }
+    function cdata($parser, $cdata) {
+        $this->_currentTagContents .= $cdata;
+    }
+    function tag_close($parser, $tag) {
+        $valueFlag = false;
+        switch($tag) {
+            case 'int':
+            case 'i4':
+                $value = (int)trim($this->_currentTagContents);
+                $this->_currentTagContents = '';
+                $valueFlag = true;
+                break;
+            case 'double':
+                $value = (double)trim($this->_currentTagContents);
+                $this->_currentTagContents = '';
+                $valueFlag = true;
+                break;
+            case 'string':
+                $value = (string)trim($this->_currentTagContents);
+                $this->_currentTagContents = '';
+                $valueFlag = true;
+                break;
+            case 'dateTime.iso8601':
+                $value = new IXR_Date(trim($this->_currentTagContents));
+                // $value = $iso->getTimestamp();
+                $this->_currentTagContents = '';
+                $valueFlag = true;
+                break;
+            case 'value':
+                // "If no type is indicated, the type is string."
+                if (trim($this->_currentTagContents) != '') {
+                    $value = (string)$this->_currentTagContents;
+                    $this->_currentTagContents = '';
+                    $valueFlag = true;
+                }
+                break;
+            case 'boolean':
+                $value = (boolean)trim($this->_currentTagContents);
+                $this->_currentTagContents = '';
+                $valueFlag = true;
+                break;
+            case 'base64':
+                $value = base64_decode($this->_currentTagContents);
+                $this->_currentTagContents = '';
+                $valueFlag = true;
+                break;
+            /* Deal with stacks of arrays and structs */
+            case 'data':
+            case 'struct':
+                $value = array_pop($this->_arraystructs);
+                array_pop($this->_arraystructstypes);
+                $valueFlag = true;
+                break;
+            case 'member':
+                array_pop($this->_currentStructName);
+                break;
+            case 'name':
+                $this->_currentStructName[] = trim($this->_currentTagContents);
+                $this->_currentTagContents = '';
+                break;
+            case 'methodName':
+                $this->methodName = trim($this->_currentTagContents);
+                $this->_currentTagContents = '';
+                break;
+        }
+        if ($valueFlag) {
+            /*
+            if (!is_array($value) && !is_object($value)) {
+                $value = trim($value);
+            }
+            */
+            if (count($this->_arraystructs) > 0) {
+                // Add value to struct or array
+                if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') {
+                    // Add to struct
+                    $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value;
+                } else {
+                    // Add to array
+                    $this->_arraystructs[count($this->_arraystructs)-1][] = $value;
+                }
+            } else {
+                // Just add as a paramater
+                $this->params[] = $value;
+            }
+        }
+    }       
+}
+
+
+class IXR_Server {
+    var $data;
+    var $callbacks = array();
+    var $message;
+    var $capabilities;
+    function IXR_Server($callbacks = false, $data = false) {
+        $this->setCapabilities();
+        if ($callbacks) {
+            $this->callbacks = $callbacks;
+        }
+        $this->setCallbacks();
+        $this->serve($data);
+    }
+    function serve($data = false) {
+        if (!$data) {
+            global $HTTP_RAW_POST_DATA;
+            if (!$HTTP_RAW_POST_DATA) {
+               die('XML-RPC server accepts POST requests only.');
+            }
+            $data = $HTTP_RAW_POST_DATA;
+        }
+        $this->message = new IXR_Message($data);
+        if (!$this->message->parse()) {
+            $this->error(-32700, 'parse error. not well formed');
+        }
+        if ($this->message->messageType != 'methodCall') {
+            $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');
+        }
+        $result = $this->call($this->message->methodName, $this->message->params);
+        // Is the result an error?
+        if (is_a($result, 'IXR_Error')) {
+            $this->error($result);
+        }
+        // Encode the result
+        $r = new IXR_Value($result);
+        $resultxml = $r->getXml();
+        // Create the XML
+        $xml = <<<EOD
+<methodResponse>
+  <params>
+    <param>
+      <value>
+        $resultxml
+      </value>
+    </param>
+  </params>
+</methodResponse>
+
+EOD;
+        // Send it
+        $this->output($xml);
+    }
+    function call($methodname, $args) {
+        if (!$this->hasMethod($methodname)) {
+            return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');
+        }
+        $method = $this->callbacks[$methodname];
+        // Perform the callback and send the response
+        if (count($args) == 1) {
+            // If only one paramater just send that instead of the whole array
+            $args = $args[0];
+        }
+        // Are we dealing with a function or a method?
+        if (substr($method, 0, 5) == 'this:') {
+            // It's a class method - check it exists
+            $method = substr($method, 5);
+            if (!method_exists($this, $method)) {
+                return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');
+            }
+            // Call the method
+            $result = $this->$method($args);
+        } else {
+            // It's a function - does it exist?
+            if (!function_exists($method)) {
+                return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
+            }
+            // Call the function
+            $result = $method($args);
+        }
+        return $result;
+    }
+
+    function error($error, $message = false) {
+        // Accepts either an error object or an error code and message
+        if ($message && !is_object($error)) {
+            $error = new IXR_Error($error, $message);
+        }
+        $this->output($error->getXml());
+    }
+    function output($xml) {
+        $xml = '<?xml version="1.0" encoding="utf-8" ?>'."\n".$xml;
+		if ( (@strpos($_SERVER["HTTP_ACCEPT_ENCODING"],'gzip') !== false) && extension_loaded('zlib') && 
+			ini_get("zlib.output_compression") == 0 && ini_get('output_handler') != 'ob_gzhandler' && !headers_sent()) 
+		{
+			$xml = gzencode($xml,7,FORCE_GZIP);
+			header("Content-Encoding: gzip");
+		}
+        $length = strlen($xml);
+        header('Connection: close');
+        header('Content-Length: '.$length);
+        header('Content-Type: text/xml');
+        header('Date: '.date('r'));
+        echo $xml;
+        exit;
+    }
+    function hasMethod($method) {
+        return in_array($method, array_keys($this->callbacks));
+    }
+    function setCapabilities() {
+        // Initialises capabilities array
+        $this->capabilities = array(
+            'xmlrpc' => array(
+                'specUrl' => 'http://www.xmlrpc.com/spec',
+                'specVersion' => 1
+            ),
+            'faults_interop' => array(
+                'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php',
+                'specVersion' => 20010516
+            ),
+            'system.multicall' => array(
+                'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208',
+                'specVersion' => 1
+            ),
+        );   
+    }
+    function getCapabilities($args) {
+        return $this->capabilities;
+    }
+    function setCallbacks() {
+        $this->callbacks['system.getCapabilities'] = 'this:getCapabilities';
+        $this->callbacks['system.listMethods'] = 'this:listMethods';
+        $this->callbacks['system.multicall'] = 'this:multiCall';
+    }
+    function listMethods($args) {
+        // Returns a list of methods - uses array_reverse to ensure user defined
+        // methods are listed before server defined methods
+        return array_reverse(array_keys($this->callbacks));
+    }
+    function multiCall($methodcalls) {
+        // See http://www.xmlrpc.com/discuss/msgReader$1208
+        $return = array();
+        foreach ($methodcalls as $call) {
+            $method = $call['methodName'];
+            $params = $call['params'];
+            if ($method == 'system.multicall') {
+                $result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden');
+            } else {
+                $result = $this->call($method, $params);
+            }
+            if (is_a($result, 'IXR_Error')) {
+                $return[] = array(
+                    'faultCode' => $result->code,
+                    'faultString' => $result->message
+                );
+            } else {
+                $return[] = array($result);
+            }
+        }
+        return $return;
+    }
+}
+
+class IXR_Request {
+    var $method;
+    var $args;
+    var $xml;
+    function IXR_Request($method, $args) {
+        $this->method = $method;
+        $this->args = $args;
+        $this->xml = <<<EOD
+<?xml version="1.0"?>
+<methodCall>
+<methodName>{$this->method}</methodName>
+<params>
+
+EOD;
+        foreach ($this->args as $arg) {
+            $this->xml .= '<param><value>';
+            $v = new IXR_Value($arg);
+            $this->xml .= $v->getXml();
+            $this->xml .= "</value></param>\n";
+        }
+        $this->xml .= '</params></methodCall>';
+    }
+    function getLength() {
+        return strlen($this->xml);
+    }
+    function getXml() {
+        return $this->xml;
+    }
+}
+
+
+class IXR_Client {
+    var $server;
+    var $port;
+    var $path;
+    var $useragent;
+    var $response;
+    var $message = false;
+    var $debug = false;
+    // Storage place for an error message
+    var $error = false;
+    function IXR_Client($server, $path = false, $port = 80) {
+        if (!$path) {
+            // Assume we have been given a URL instead
+            $bits = parse_url($server);
+            $this->server = $bits['host'];
+            $this->port = isset($bits['port']) ? $bits['port'] : 80;
+            $this->path = isset($bits['path']) ? $bits['path'] : '/';
+            // Make absolutely sure we have a path
+            if (!$this->path) {
+                $this->path = '/';
+            }
+        } else {
+            $this->server = $server;
+            $this->path = $path;
+            $this->port = $port;
+        }
+        $this->useragent = 'The Incutio XML-RPC PHP Library';
+    }
+    function query() {
+        $args = func_get_args();
+        $method = array_shift($args);
+        $request = new IXR_Request($method, $args);
+        $length = $request->getLength();
+        $xml = $request->getXml();
+        $r = "\r\n";
+        $request  = "POST {$this->path} HTTP/1.0$r";
+        $request .= "Host: {$this->server}$r";
+        $request .= "Content-Type: text/xml$r";
+        $request .= "User-Agent: {$this->useragent}$r";
+		// Accept gzipped response if zlib and if php4.3+ (fgets turned binary safe)
+		if ( extension_loaded('zlib') && preg_match('#^(4\.[3-9])|([5-9])#',phpversion()) ) 
+			$request .= "Accept-Encoding: gzip$r";
+        $request .= "Content-length: {$length}$r$r";
+        $request .= $xml;
+        // Now send the request
+        if ($this->debug) {
+            echo '<pre>'.htmlspecialchars($request)."\n</pre>\n\n";
+        }
+		// This is to find out when the script unexpectedly dies due to fsockopen
+		ob_start(NULL, 2048);
+		echo "Trying to connect to an RPC Server...";
+        $fp = (is_callable('fsockopen')) ? fsockopen($this->server, $this->port, $errno, $errstr, 45) : false;
+		ob_end_clean();
+        if (!$fp) {
+            $this->error = new IXR_Error(-32300, 'transport error - could not open socket ('.$errstr.')');
+            return false;
+        }
+        fputs($fp, $request);
+        $contents = '';
+        $gotFirstLine = false;
+        $gettingHeaders = true;
+		$is_gzipped = false;
+        while (!feof($fp)) {
+            $line = fgets($fp, 4096);
+            if (!$gotFirstLine) {
+                // Check line for '200'
+                if (strstr($line, '200') === false) {
+                    $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200');
+                    return false;
+                }
+                $gotFirstLine = true;
+            }
+            if ($gettingHeaders && trim($line) == '') {
+                $gettingHeaders = false;
+				continue;
+            }
+            if (!$gettingHeaders) {
+		        // We do a binary comparison of the first two bytes, see
+		        // rfc1952, to check wether the content is gzipped.
+				if ( ($contents=='') && (strncmp($line,"\x1F\x8B",2)===0)) 
+					$is_gzipped = true;
+                $contents .= ($is_gzipped) ? $line : trim($line)."\n";
+            }
+        }
+		# if gzipped, strip the 10 byte header, and pass it to gzinflate (rfc1952)
+		if ($is_gzipped) 
+		{
+			$contents = gzinflate(substr($contents, 10));
+			//simulate trim() for each line; don't know why, but it won't work otherwise
+			$contents = preg_replace('#^[\x20\x09\x0A\x0D\x00\x0B]*(.*)[\x20\x09\x0A\x0D\x00\x0B]*$#m','\\1',$contents);
+		}
+        if ($this->debug) {
+            echo '<pre>'.htmlspecialchars($contents)."\n</pre>\n\n";
+        }
+        // Now parse what we've got back
+        $this->message = new IXR_Message($contents);
+        if (!$this->message->parse()) {
+            // XML error
+            $this->error = new IXR_Error(-32700, 'parse error. not well formed');
+            return false;
+        }
+        // Is the message a fault?
+        if ($this->message->messageType == 'fault') {
+            $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);
+            return false;
+        }
+        // Message must be OK
+        return true;
+    }
+    function getResponse() {
+        // methodResponses can only have one param - return that
+        return $this->message->params[0];
+    }
+    function isError() {
+        return (is_object($this->error));
+    }
+    function getErrorCode() {
+        return $this->error->code;
+    }
+    function getErrorMessage() {
+        return $this->error->message;
+    }
+}
+
+
+class IXR_Error {
+    var $code;
+    var $message;
+    function IXR_Error($code, $message) {
+        $this->code = $code;
+        $this->message = $message;
+    }
+    function getXml() {
+        $xml = <<<EOD
+<methodResponse>
+  <fault>
+    <value>
+      <struct>
+        <member>
+          <name>faultCode</name>
+          <value><int>{$this->code}</int></value>
+        </member>
+        <member>
+          <name>faultString</name>
+          <value><string>{$this->message}</string></value>
+        </member>
+      </struct>
+    </value>
+  </fault>
+</methodResponse> 
+
+EOD;
+        return $xml;
+    }
+}
+
+
+class IXR_Date {
+    var $year;
+    var $month;
+    var $day;
+    var $hour;
+    var $minute;
+    var $second;
+    function IXR_Date($time) {
+        // $time can be a PHP timestamp or an ISO one
+        if (is_numeric($time)) {
+            $this->parseTimestamp($time);
+        } else {
+            $this->parseIso($time);
+        }
+    }
+    function parseTimestamp($timestamp) {
+        $this->year = date('Y', $timestamp);
+        $this->month = date('m', $timestamp);
+        $this->day = date('d', $timestamp);
+        $this->hour = date('H', $timestamp);
+        $this->minute = date('i', $timestamp);
+        $this->second = date('s', $timestamp);
+    }
+    function parseIso($iso) {
+        $this->year = substr($iso, 0, 4);
+        $this->month = substr($iso, 4, 2); 
+        $this->day = substr($iso, 6, 2);
+        $this->hour = substr($iso, 9, 2);
+        $this->minute = substr($iso, 12, 2);
+        $this->second = substr($iso, 15, 2);
+    }
+    function getIso() {
+        return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second;
+    }
+    function getXml() {
+        return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
+    }
+    function getTimestamp() {
+        return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
+    }
+}
+
+
+class IXR_Base64 {
+    var $data;
+    function IXR_Base64($data) {
+        $this->data = $data;
+    }
+    function getXml() {
+        return '<base64>'.base64_encode($this->data).'</base64>';
+    }
+}
+
+
+class IXR_IntrospectionServer extends IXR_Server {
+    var $signatures;
+    var $help;
+    function IXR_IntrospectionServer() {
+        $this->setCallbacks();
+        $this->setCapabilities();
+        $this->capabilities['introspection'] = array(
+            'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html',
+            'specVersion' => 1
+        );
+        $this->addCallback(
+            'system.methodSignature', 
+            'this:methodSignature', 
+            array('array', 'string'), 
+            'Returns an array describing the return type and required parameters of a method'
+        );
+        $this->addCallback(
+            'system.getCapabilities', 
+            'this:getCapabilities', 
+            array('struct'), 
+            'Returns a struct describing the XML-RPC specifications supported by this server'
+        );
+        $this->addCallback(
+            'system.listMethods', 
+            'this:listMethods', 
+            array('array'), 
+            'Returns an array of available methods on this server'
+        );
+        $this->addCallback(
+            'system.methodHelp', 
+            'this:methodHelp', 
+            array('string', 'string'), 
+            'Returns a documentation string for the specified method'
+        );
+    }
+    function addCallback($method, $callback, $args, $help) {
+        $this->callbacks[$method] = $callback;
+        $this->signatures[$method] = $args;
+        $this->help[$method] = $help;
+    }
+    function call($methodname, $args) {
+        // Make sure it's in an array
+        if ($args && !is_array($args)) {
+            $args = array($args);
+        }
+        // Over-rides default call method, adds signature check
+        if (!$this->hasMethod($methodname)) {
+            return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.');
+        }
+        $method = $this->callbacks[$methodname];
+        $signature = $this->signatures[$methodname];
+        $returnType = array_shift($signature);
+        // Check the number of arguments
+        if (count($args) != count($signature)) {
+            // print 'Num of args: '.count($args).' Num in signature: '.count($signature);
+            return new IXR_Error(-32602, 'server error. wrong number of method parameters');
+        }
+        // Check the argument types
+        $ok = true;
+        $argsbackup = $args;
+        for ($i = 0, $j = count($args); $i < $j; $i++) {
+            $arg = array_shift($args);
+            $type = array_shift($signature);
+            switch ($type) {
+                case 'int':
+                case 'i4':
+                    if (is_array($arg) || !is_int($arg)) {
+                        $ok = false;
+                    }
+                    break;
+                case 'base64':
+                case 'string':
+                    if (!is_string($arg)) {
+                        $ok = false;
+                    }
+                    break;
+                case 'boolean':
+                    if ($arg !== false && $arg !== true) {
+                        $ok = false;
+                    }
+                    break;
+                case 'float':
+                case 'double':
+                    if (!is_float($arg)) {
+                        $ok = false;
+                    }
+                    break;
+                case 'date':
+                case 'dateTime.iso8601':
+                    if (!is_a($arg, 'IXR_Date')) {
+                        $ok = false;
+                    }
+                    break;
+            }
+            if (!$ok) {
+                return new IXR_Error(-32602, 'server error. invalid method parameters');
+            }
+        }
+        // It passed the test - run the "real" method call
+        return parent::call($methodname, $argsbackup);
+    }
+    function methodSignature($method) {
+        if (!$this->hasMethod($method)) {
+            return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.');
+        }
+        // We should be returning an array of types
+        $types = $this->signatures[$method];
+        $return = array();
+        foreach ($types as $type) {
+            switch ($type) {
+                case 'string':
+                    $return[] = 'string';
+                    break;
+                case 'int':
+                case 'i4':
+                    $return[] = 42;
+                    break;
+                case 'double':
+                    $return[] = 3.1415;
+                    break;
+                case 'dateTime.iso8601':
+                    $return[] = new IXR_Date(time());
+                    break;
+                case 'boolean':
+                    $return[] = true;
+                    break;
+                case 'base64':
+                    $return[] = new IXR_Base64('base64');
+                    break;
+                case 'array':
+                    $return[] = array('array');
+                    break;
+                case 'struct':
+                    $return[] = array('struct' => 'struct');
+                    break;
+            }
+        }
+        return $return;
+    }
+    function methodHelp($method) {
+        return $this->help[$method];
+    }
+}
+
+
+class IXR_ClientMulticall extends IXR_Client {
+    var $calls = array();
+    function IXR_ClientMulticall($server, $path = false, $port = 80) {
+        parent::IXR_Client($server, $path, $port);
+        $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
+    }
+    function addCall() {
+        $args = func_get_args();
+        $methodName = array_shift($args);
+        $struct = array(
+            'methodName' => $methodName,
+            'params' => $args
+        );
+        $this->calls[] = $struct;
+    }
+    function query() {
+        // Prepare multicall, then call the parent::query() method
+        return parent::query('system.multicall', $this->calls);
+    }
+}
+
+?>

Added: trunk/www.openmoko.com/textpattern/lib/admin_config.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/admin_config.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/admin_config.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,220 @@
+<?php
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ 
+                (M O S T L Y)  D E P R E C A T E D  AS  OF  1.0RC4
+
+ *	IMPORTANT:  Most settings in this file  (all that is in  $txpac)  have moved 
+	into the  Database. This file remains here  mainly for  not breaking updates 
+ *	for people that are coming from older revisions (up to and including 1.0RC3)! 
+	If you would like to change any of these settings, you can do so in Advanced 
+ *	Preferences	of your Textpattern admin panel.
+	
+ *	Only the Permission-Settings at the bottom this file are still actively used,
+	and these will be moved to the db before the next release 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/admin_config.php $
+$LastChangedRevision: 1747 $
+ 
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+
+// Textpattern admin options
+// unless stated otherwise, 0 = false, 1 = true
+$txpac = array(
+// -------------------------------------------------------------
+// bypass the Txp CSS editor entirely
+
+	'edit_raw_css_by_default'     => 1,
+
+
+// -------------------------------------------------------------
+// php scripts on page templates will be parsed 
+
+	'allow_page_php_scripting'    => 1,
+
+// -------------------------------------------------------------
+// php scripts in article bodies will be parsed 
+
+	'allow_article_php_scripting' => 1,
+
+// -------------------------------------------------------------
+// use Textile on link titles and descriptions 
+
+	'textile_links'               => 0,
+
+
+// -------------------------------------------------------------
+// in the article categories listing in the organise tab
+
+	'show_article_category_count' => 1,
+
+
+// -------------------------------------------------------------
+// xml feeds display comment count as part of article title
+
+	'show_comment_count_in_feed'  => 1,
+
+
+// -------------------------------------------------------------
+// include articles or full excerpts in feeds
+// 0 = full article body
+// 1 = excerpt
+		
+	'syndicate_body_or_excerpt'   => 1,
+
+
+// -------------------------------------------------------------
+// include (encoded) author email in atom feeds
+		
+	'include_email_atom'          => 1,
+	
+
+// -------------------------------------------------------------
+// each comment received updates the site Last-Modified header 
+
+	'comment_means_site_updated'  => 1,
+
+
+// -------------------------------------------------------------
+// comment email addresses are encoded to hide from spambots
+// but if you never want to see them at all, set this to 1
+
+	'never_display_email'         => 0,
+
+
+// -------------------------------------------------------------
+// comments must enter name and/or email address
+
+	'comments_require_name'       => 1,
+	'comments_require_email'      => 1,
+
+
+// -------------------------------------------------------------
+// show 'excerpt' pane in write tab
+
+	'articles_use_excerpts'       => 1,
+
+
+// -------------------------------------------------------------
+// show form overrides on article-by-article basis
+
+	'allow_form_override'         => 1,
+
+
+// -------------------------------------------------------------
+// whether or not to attach article titles to permalinks
+// e.g., /article/313/IAteACheeseSandwich
+
+	'attach_titles_to_permalinks' => 1,
+
+
+// -------------------------------------------------------------
+// if attaching titles to permalinks, which format?
+// 0 = SuperStudlyCaps
+// 1 = hyphenated-lower-case
+
+	'permalink_title_format'      => 1,
+
+
+// -------------------------------------------------------------
+// number of days after which logfiles are purged
+		
+	'expire_logs_after'           => 7,
+
+
+// -------------------------------------------------------------
+// plugins on or off
+		
+	'use_plugins'                 => 1,
+
+// -------------------------------------------------------------
+// use custom fields for articles - must be in 'quotes', and 
+// must contain no spaces
+		
+	'custom_1_set'                => 'custom1',
+	'custom_2_set'                => 'custom2',
+	'custom_3_set'                => '',
+	'custom_4_set'                => '',
+	'custom_5_set'                => '',
+	'custom_6_set'                => '',
+	'custom_7_set'                => '',
+	'custom_8_set'                => '',
+	'custom_9_set'                => '',
+	'custom_10_set'               => '',
+
+// -------------------------------------------------------------
+// ping textpattern.com when an article is published
+		
+	'ping_textpattern_com'        => 1,
+
+// -------------------------------------------------------------
+// use DNS lookups in referrer log
+		
+	'use_dns'        => 1,
+
+// -------------------------------------------------------------
+// load plugins in the admin interface
+		
+	'admin_side_plugins'        => 1,
+
+// -------------------------------------------------------------
+// use rel="nofollow" on comment links
+		
+	'comment_nofollow'        => 1,
+	
+// -------------------------------------------------------------
+// use encoded email on atom feeds id, instead of domain name
+// (if you plan to move this install to another domain, you should use this)
+		
+	'use_mail_on_feeds_id'	   =>0,
+
+// -------------------------------------------------------------
+// maximum url length before it should be considered malicious
+		
+	'max_url_len'               => 200,
+
+// -------------------------------------------------------------
+// Spam DNS RBLs
+
+	'spam_blacklists'          => 'sbl.spamhaus.org',
+
+);
+
+// -------------------------------------------------------------
+
+$txp_permissions = array(
+	'admin'                       => '1,2,3,4,5,6',
+	'admin.edit'                => '1',
+	'admin.list'                  => '1,2,3',
+	'article.delete.own'          => '1,2,3,4',
+	'article.delete'              => '1,2',
+	'article.edit'                => '1,2,3',
+	'article.edit.published'      => '1,2,3',
+	'article.edit.own'            => '1,2,3,4,5,6',
+	'article.edit.own.published'  => '1,2,3,4',
+	'article.publish'             => '1,2,3,4',
+	'article.php'                 => '1,2',
+	'article'                     => '1,2,3,4,5,6',
+	'list'                        => '1,2,3,4,5,6', //likely the same as for article.
+	'category'                    => '1,2,3',
+	'css'                         => '1,2,6',
+	'diag'                        => '1,2',
+	'discuss'                     => '1,2,3',
+	'file'                        => '1,2,3,4,6',
+	'form'                        => '1,2,3,6',
+	'image'                       => '1,2,3,4,6',
+	'import'                      => '1,2',
+	'link'                        => '1,2,3',
+	'log'                         => '1,2,3', // more?
+	'page'                        => '1,2,3,6',
+	'plugin'                      => '1,2',
+	'prefs'                       => '1,2',
+	'section'                     => '1,2,3,6',
+	'tab.admin'                   => '1,2,3,4,5,6',
+	'tab.content'                 => '1,2,3,4,5,6',
+	'tab.extensions'              => '1,2',
+	'tab.presentation'            => '1,2,3,6',
+	'tag'                         => '1,2,3,4,5,6',
+);
+
+?>
\ No newline at end of file

Added: trunk/www.openmoko.com/textpattern/lib/class.thumb.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/class.thumb.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/class.thumb.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,430 @@
+<?php
+/**
+ * class wet_thumb
+ * @author	C. Erdmann
+ * @see		<a href="http://www.cerdmann.de/thumb">http://www.cerdmann.de/thumb</a>
+ * @author	Robert Wetzlmayr
+ *
+ * refactored from function.thumb.php by C. Erdmann, which contained the following credit & licensing terms:
+ * ===
+ * Smarty plugin "Thumb"
+ * Purpose: creates cached thumbnails
+ * Home: http://www.cerdmann.com/thumb/
+ * Copyright (C) 2005 Christoph Erdmann
+ * 
+ * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 
+ * -------------------------------------------------------------
+ * Author:   Christoph Erdmann (CE) <smarty at cerdmann.com>
+ * Internet: http://www.cerdmann.com
+ *
+ * Author: Benjamin Fleckenstein (BF)
+ * Internet: http://www.benjaminfleckenstein.de
+ *
+ * Author: Marcus Gueldenmeister (MG)
+ * Internet: http://www.gueldenmeister.de/marcus/
+ *
+ * Author: Andreas Bösch (AB)
+ *
+ */
+ 
+/* changelog:
+ * 2005-07-24	wet	initial release
+ * 2005-07-27	wet	extracted file based thumbs as wet_thumb class
+ */
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/class.thumb.php $
+$LastChangedRevision: 1955 $
+*/
+
+$verbose = false;
+
+
+class wet_thumb {
+    var $width;      // The width of your thumbnail. The height (if not set) will be automatically calculated.
+    var $height;	// The height of your thumbnail. The width (if not set) will be automatically calculated.
+    var $longside;	// Set the longest side of the image if width, height and shortside is not set.
+    var $shortside;	// Set the shortest side of the image if width, height and longside is not set.
+    var $extrapolate;  // Set to »false« if your source image is smaller than the calculated thumb and you do not want the image to get extrapolated.
+    var $crop;	// If set to »true«, image will be cropped in the center to destination width and height params, while keeping aspect ratio. Otherwise the image will get resized.
+    var $sharpen;	// Set to »false« if you don’t want to use the Unsharp-Mask. Thumbnail creation will be faster, but quality is reduced.
+    var $hint; 	// If set to »false« the image will not have a lens-icon.
+    var $addgreytohint; // Set to »false« to get no lightgrey bottombar.
+    var $quality;	// JPEG image quality (0...100, defaults to 80).
+    // link related params
+    var $linkurl;    // Set to your target URL (a href="linkurl")
+    var $html;       // Will be inserted in the image-tag
+   
+    var $types = array('','.gif','.jpg','.png');
+    var $_SRC;
+    var $_DST;
+
+    /**
+     * constructor
+     */
+    function wet_thumb(  ) {        
+	$this->extrapolate = false;
+	$this->crop = true;
+	$this->sharpen = true;
+	$this->hint = true;
+	$this->addgreytohint = true;
+	$this->quality = 80;
+	$this->html = " alt=\"\" title=\"\" ";
+	$this->link = true;
+    }
+    
+    /**
+     * write thumbnail file
+     * @param	infile	image file name
+     * @param	outfile	array of thumb file names (1...n)
+     * @return	boolean, true indicates success
+     */
+    function write( $infile, $outfile ) {
+        global $verbose;
+        
+        if( $verbose )echo "writing thumb nail...";
+        
+	### Info über Source (SRC) holen
+	$temp = getimagesize($infile);
+
+	$this->_SRC['file']		= $infile;
+	$this->_SRC['width']		= $temp[0];
+	$this->_SRC['height']		= $temp[1];
+	$this->_SRC['type']		= $temp[2]; // 1=GIF, 2=JPG, 3=PNG, SWF=4
+	$this->_SRC['string']		= $temp[3];
+	$this->_SRC['filename'] 	= basename($infile);
+	//$this->_SRC['modified'] 	= filemtime($infile);
+
+	//Prüfen ob das Orginalbild hoch oder querformatig ist
+	if ($this->_SRC['width'] >= $this->_SRC['height']) {
+	    $this->_SRC['format'] = 'landscape';
+	} else {
+	    $this->_SRC['format'] = 'portrait';
+	}
+
+	### Info über Destination (DST) holen
+	if (is_numeric($this->width) AND empty($this->height)) {
+		$this->_DST['width']	= $this->width;
+		$this->_DST['height']	= round($this->width/($this->_SRC['width']/$this->_SRC['height']));
+	}
+	elseif (is_numeric($this->height) AND empty($this->width)) {
+		$this->_DST['height']	= $this->height;
+		$this->_DST['width']	= round($this->height/($this->_SRC['height']/$this->_SRC['width']));
+	}
+	elseif (is_numeric($this->width) AND is_numeric($this->height)) {
+		$this->_DST['width']	= $this->width;
+		$this->_DST['height']	= $this->height;
+	}
+	elseif (is_numeric($this->longside) AND empty($this->shortside)) {
+	    // Das Größenverhältnis soll erhalten bleiben egal ob das Bild hoch oder querformatig ist.
+	    // Hier wurde die lange Seite angegeben
+	    if ($this->_SRC['format'] == 'portrait') {
+		$this->_DST['height']	= $this->longside;
+		$this->_DST['width']	= round($this->longside/($this->_SRC['height']/$this->_SRC['width']));
+	    }
+	    else {
+		$this->_DST['width']	= $this->longside;
+		$this->_DST['height']	= round($longside/($this->_SRC['width']/$this->_SRC['height']));
+	    }
+        }
+	elseif (is_numeric($this->shortside)) {
+	    // Das Größenverhältnis soll erhalten bleiben egal ob das Bild hoch oder querformatig ist.
+	    // aber hier wurde die kurze Seite angeben.
+	    if ($this->_SRC['format'] == 'portrait') {
+		$this->_DST['width']	= $this->shortside;
+		$this->_DST['height']	= round($this->shortside/($this->_SRC['width']/$this->_SRC['height']));
+	    }
+	    else {
+		$this->_DST['height']	= $this->shortside;
+		$this->_DST['width']	= round($this->shortside/($this->_SRC['height']/$this->_SRC['width']));
+	    }
+        }
+        else { // default dimensions
+            $this->width = 100;
+            $this->_DST['width'] = $this->width;
+            $this->_DST['height'] = round($this->width/($this->_SRC['width']/$this->_SRC['height']));
+        }
+
+
+	// Wenn das Ursprungsbild kleiner als das Ziel-Bild ist, soll nicht hochskaliert werden
+	if ($this->extrapolate === false && $this->_DST['height'] > $this->_SRC['height'] &&
+					    $this->_DST['width'] > $this->_SRC['width']) {
+	    $this->_DST['width'] = $this->_SRC['width'];
+	    $this->_DST['height'] = $this->_SRC['height'];
+	}
+
+	$this->_DST['type'] = $this->_SRC['type']; 
+	$this->_DST['file'] = $outfile;
+
+	// SRC einlesen
+	if ($this->_SRC['type'] == 1)	$this->_SRC['image'] = imagecreatefromgif($this->_SRC['file']);
+	elseif ($this->_SRC['type'] == 2)	$this->_SRC['image'] = imagecreatefromjpeg($this->_SRC['file']);
+	elseif ($this->_SRC['type'] == 3)	$this->_SRC['image'] = imagecreatefrompng($this->_SRC['file']);
+
+	// Soll beschnitten werden?
+	$off_w = 0;
+	$off_h = 0;
+	if($this->crop != false) {
+	    if($this->_SRC['height'] < $this->_SRC['width']) {
+		$ratio = (double)($this->_SRC['height'] / $this->_DST['height']);
+		$cpyWidth = round($this->_DST['width'] * $ratio);
+		if ($cpyWidth > $this->_SRC['width']) {           		
+		    $ratio = (double)($this->_SRC['width'] / $this->_DST['width']);
+		    $cpyWidth = $this->_SRC['width'];
+		    $cpyHeight = round($this->_DST['height'] * $ratio);
+		    $off_w = 0;
+		    $off_h = round(($this->_SRC['height'] - $cpyHeight) / 2);                              
+		    $this->_SRC['height'] = $cpyHeight;
+		}
+		else {           		
+		    $cpyHeight = $this->_SRC['height'];
+		    $off_w = round(($this->_SRC['width'] - $cpyWidth) / 2);
+		    $off_h = 0;               
+		    $this->_SRC['width']= $cpyWidth;
+		}
+	    }
+	    else {
+		$ratio = (double)($this->_SRC['width'] / $this->_DST['width']);
+		$cpyHeight = round($this->_DST['height'] * $ratio);
+		if ($cpyHeight > $this->_SRC['height']) {
+		    $ratio = (double)($this->_SRC['height'] / $this->_DST['height']);
+		    $cpyHeight = $this->_SRC['height'];
+		    $cpyWidth = round($this->_DST['width'] * $ratio);
+		    $off_w = round(($this->_SRC['width'] - $cpyWidth) / 2);
+		    $off_h = 0;               
+		    $this->_SRC['width']= $cpyWidth;               
+		}
+		else {
+		    $cpyWidth = $this->_SRC['width'];
+		    $off_w = 0;
+		    $off_h = round(($this->_SRC['height'] - $cpyHeight) / 2);               
+		    $this->_SRC['height'] = $cpyHeight;               
+		}
+	    }		
+	}
+
+	// DST erstellen
+	$this->_DST['image'] = imagecreatetruecolor($this->_DST['width'], $this->_DST['height']);
+	imagecopyresampled($this->_DST['image'], $this->_SRC['image'], 0, 0, $off_w, $off_h, $this->_DST['width'], $this->_DST['height'], $this->_SRC['width'], $this->_SRC['height']);
+	if ($this->sharpen === true) {
+	    $this->_DST['image'] = UnsharpMask($this->_DST['image'],80,.5,3);
+	}
+
+        // finally: the real dimensions
+        $this->height =  $this->_DST['height'];
+        $this->width =  $this->_DST['width'];
+
+	// Soll eine Lupe eingefügt werden?
+	if ( $this->hint === true) {
+	    //Soll der weiße Balken wirklich hinzugefügt werden?
+	    if ( $this->addgreytohint === true ) {
+		$trans = imagecolorallocatealpha($this->_DST['image'], 255, 255, 255, 25);
+		imagefilledrectangle($this->_DST['image'], 0, $this->_DST['height']-9, $this->_DST['width'], $this->_DST['height'], $trans);
+	    }
+
+	    $magnifier = imagecreatefromstring(gzuncompress(base64_decode("eJzrDPBz5+WS4mJgYOD19HAJAtLcIMzBBiRXrilXA1IsxU6eIRxAUMOR0gHkcxZ4RBYD1QiBMOOlu3V/gIISJa4RJc5FqYklmfl5CiGZuakMBoZ6hkZ6RgYGJs77ex2BalRBaoLz00rKE4tSGXwTk4vyc1NTMhMV3DKLUsvzi7KLFXwjFEAa2svWnGdgYPTydHEMqZhTOsE++1CAyNHzm2NZjgau+dAmXlAwoatQmOld3t/NPxlLMvY7sovPzXHf7re05BPzjpQTMkZTPjm1HlHkv6clYWK43Zt16rcDjdZ/3j2cd7qD4/HHH3GaprFrw0QZDHicORXl2JsPsveVTDz//L3N+WpxJ5Hff+10Tjdd2/Vi17vea79Om5w9zzyne9GLnWGrN8atby/ayXPOsu2w4quvVtxNCVVz5nAf3nDpZckBCedpqSc28WTOWnT7rZNXZSlPvFybie9EFc6y3bIMCn3JAoJ+kyyfn9qWq+LZ9Las26Jv482cDRE6Ci0B6gVbo2oj9KabzD8vyMK4ZMqMs2kSvW4chz88SXNzmeGjtj1QZK9M3HHL8L7HITX3t19//VVY8CYDg9Kvy2vDXu+6mGGxNOiltMPsjn/t9eJr0ja/FOdi5TyQ9Lz3fOqstOr99/dnro2vZ1jy76D/vYivPsBoYPB09XNZ55TQBAAJjs5s</body>")));
+	    imagealphablending($this->_DST['image'], true);
+	    imagecopy($this->_DST['image'], $magnifier, $this->_DST['width']-15, $this->_DST['height']-14, 0, 0, 11, 11);
+	    imagedestroy($magnifier);
+	}
+
+        if ($verbose ) echo "... saving image ...";        
+	
+        if ($this->_DST['type'] == 1)	{
+	    imagetruecolortopalette($this->_DST['image'], false, 256);
+		if ( function_exists ('imagegif') ) {
+			imagegif($this->_DST['image'], $this->_DST['file']);
+		} else {
+			imagedestroy($this->_DST['image']);
+			imagedestroy($this->_SRC['image']);
+			return false;
+		}
+	}
+	elseif ($this->_DST['type'] == 2) {
+	    imagejpeg($this->_DST['image'], $this->_DST['file'], $this->quality);
+	}
+	elseif ($this->_DST['type'] == 3) {
+	    imagepng($this->_DST['image'], $this->_DST['file']);
+	}
+	
+        if ($verbose ) echo "... image successfully saved ...";
+        
+	imagedestroy($this->_DST['image']);
+	imagedestroy($this->_SRC['image']);
+	return true;
+    }
+    
+    /**
+     * return a reference to the the thumbnailimage as a HTML <a> or <img> tag
+     * @param	aslink	return an anchor tag to the source image
+     * @param	aspopup	open link in new window
+     * @return	string with suitable HTML markup
+     */
+    function asTag( $aslink = true, $aspopup = false  )
+    {
+        $imgtag = "<img src=\"" . $this->_DST['file']. "\" " .
+                    $this->html . " " .
+                    "width=\"".$this->width."\" " .
+                    "height=\"".$this->height."\" " .
+                    "/>";
+                    
+        if ( $aslink === true ) {
+            return "<a href=\"" . ((empty($this->linkurl)) ? $this->_SRC['file'] : $this->linkurl) . "\" " .
+                    (($aspopup === true) ? "target=\"_blank\"" : "") . ">" .
+                    $imgtag .
+                    "</a>";
+        }
+        else {
+            return $imgtag;
+        }    
+    }
+}
+/**
+ * class txp_thumb: wrapper for wet_thumb interfacing the TxP repository
+ */ 
+class txp_thumb extends wet_thumb {
+    
+    var $m_ext;
+    var $m_id;
+    
+    /***
+     * constructor
+     * @param	$id	image id
+     */
+    function txp_thumb ($id) {
+        $id = assert_int($id);
+        $rs = safe_row('*', 'txp_image', 'id = '.$id.' limit 1');
+        if ($rs) {
+	    // dmp ($rs);
+            extract($rs);
+            $this->m_ext = $ext;
+            $this->m_id = $id;
+        }
+        $this->wet_thumb(); // construct base class instance
+    }
+    
+    /**
+     * create thumbnail image from source image
+     * @return	boolean, true indicates success
+     */
+    function write( ) {
+        if ( !isset($this->m_ext) ) return false;
+        
+        if ( parent::write ( IMPATH.$this->m_id.$this->m_ext, IMPATH.$this->m_id.'t'.$this->m_ext ) ) {
+	    safe_update('txp_image', 'thumbnail = 1', 'id = '.$this->m_id);
+	    return true;
+	}
+	return false;
+    }
+   
+}
+
+
+/**
+ * wet image manipulation tools
+ */ 
+
+/* change log:
+ *  2005-07-27  wet     initial creation
+ */
+
+/**
+ * Unsharp mask algorithm by Torstein Hønsi 2003 (thoensi_at_netcom_dot_no)
+ * Christoph Erdmann: changed it a little, cause i could not reproduce the
+ * darker blurred image, now it is up to 15% faster with same results
+ * @param   img     image as a ressource
+ * @param   amount  filter parameter
+ * @param   radius  filter parameter
+ * @param   treshold    filter parameter
+ * @return  sharpened image as a ressource
+ *
+ * 
+ * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
+*/
+
+function UnsharpMask($img, $amount, $radius, $threshold)    {
+    // Attempt to calibrate the parameters to Photoshop:
+    if ($amount > 500) $amount = 500;
+    $amount = $amount * 0.016;
+    if ($radius > 50) $radius = 50;
+    $radius = $radius * 2;
+    if ($threshold > 255) $threshold = 255;
+    
+    $radius = abs(round($radius)); 	// Only integers make sense.
+    if ($radius == 0) {	return $img; imagedestroy($img); break;	}
+    $w = imagesx($img); $h = imagesy($img);
+    $imgCanvas = $img;
+    $imgCanvas2 = $img;
+    $imgBlur = imagecreatetruecolor($w, $h);
+    
+    // Gaussian blur matrix:
+    //	1	2	1		
+    //	2	4	2		
+    //	1	2	1		
+    
+    // Move copies of the image around one pixel at the time and merge them with weight
+    // according to the matrix. The same matrix is simply repeated for higher radii.
+    for ($i = 0; $i < $radius; $i++)
+            {
+            imagecopy      ($imgBlur, $imgCanvas, 0, 0, 1, 1, $w - 1, $h - 1); // up left
+            imagecopymerge ($imgBlur, $imgCanvas, 1, 1, 0, 0, $w, $h, 50); // down right
+            imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left
+            imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 1, $w, $h - 1, 25); // up right
+            imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left
+            imagecopymerge ($imgBlur, $imgCanvas, 1, 0, 0, 0, $w, $h, 25); // right
+            imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 20 ); // up
+            imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 16.666667); // down
+            imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 0, $w, $h, 50); // center
+            }
+    $imgCanvas = $imgBlur;	
+            
+    // Calculate the difference between the blurred pixels and the original
+    // and set the pixels
+    for ($x = 0; $x < $w; $x++) { // each row
+        for ($y = 0; $y < $h; $y++) { // each pixel
+            $rgbOrig = ImageColorAt($imgCanvas2, $x, $y);
+            $rOrig = (($rgbOrig >> 16) & 0xFF);
+            $gOrig = (($rgbOrig >> 8) & 0xFF);
+            $bOrig = ($rgbOrig & 0xFF);
+            $rgbBlur = ImageColorAt($imgCanvas, $x, $y);
+            $rBlur = (($rgbBlur >> 16) & 0xFF);
+            $gBlur = (($rgbBlur >> 8) & 0xFF);
+            $bBlur = ($rgbBlur & 0xFF);
+    
+            // When the masked pixels differ less from the original
+            // than the threshold specifies, they are set to their original value.
+            $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig;
+            $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig;
+            $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig;
+            
+            if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) {
+                $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew);
+                ImageSetPixel($img, $x, $y, $pixCol);
+            }
+        }
+    }
+    return $img;
+}
+
+
+
+
+
+/**
+ * @todo
+ * TxP tag wrappers
+ * <txp:wet_thumb />
+ * attributes (reflecting txp_thumb object properties):
+ *  id: image id
+ *  width: integer
+ *  height: integer
+ *  shortside: integer
+ *  longside: integer
+ *  link: "true"|"false"
+ *  window: "true"|"false"
+ *  hint: "true"|"false"
+ */

Added: trunk/www.openmoko.com/textpattern/lib/classTextile.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/classTextile.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/classTextile.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1132 @@
+<?php
+
+/**
+ * Example: get XHTML from a given Textile-markup string ($string)
+ *
+ *        $textile = new Textile;
+ *        echo $textile->TextileThis($string);
+ *
+ */
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/classTextile.php $
+$LastChangedRevision: 1943 $
+*/
+
+/*
+
+_____________
+T E X T I L E
+
+A Humane Web Text Generator
+
+Version 2.0
+
+Copyright (c) 2003-2004, Dean Allen <dean at textism.com>
+All rights reserved.
+
+Thanks to Carlo Zottmann <carlo at g-blog.net> for refactoring
+Textile's procedural code into a class framework
+
+Additions and fixes Copyright (c) 2006 Alex Shiels http://thresholdstate.com/
+
+_____________
+L I C E N S E
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+  this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name Textile nor the names of its contributors may be used to
+  endorse or promote products derived from this software without specific
+  prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+_________
+U S A G E
+
+Block modifier syntax:
+
+    Header: h(1-6).
+    Paragraphs beginning with 'hn. ' (where n is 1-6) are wrapped in header tags.
+    Example: h1. Header... -> <h1>Header...</h1>
+
+    Paragraph: p. (also applied by default)
+    Example: p. Text -> <p>Text</p>
+
+    Blockquote: bq.
+    Example: bq. Block quotation... -> <blockquote>Block quotation...</blockquote>
+
+    Blockquote with citation: bq.:http://citation.url
+    Example: bq.:http://textism.com/ Text...
+    ->  <blockquote cite="http://textism.com">Text...</blockquote>
+
+    Footnote: fn(1-100).
+    Example: fn1. Footnote... -> <p id="fn1">Footnote...</p>
+
+    Numeric list: #, ##
+    Consecutive paragraphs beginning with # are wrapped in ordered list tags.
+    Example: <ol><li>ordered list</li></ol>
+
+    Bulleted list: *, **
+    Consecutive paragraphs beginning with * are wrapped in unordered list tags.
+    Example: <ul><li>unordered list</li></ul>
+
+Phrase modifier syntax:
+
+           _emphasis_   ->   <em>emphasis</em>
+           __italic__   ->   <i>italic</i>
+             *strong*   ->   <strong>strong</strong>
+             **bold**   ->   <b>bold</b>
+         ??citation??   ->   <cite>citation</cite>
+       -deleted text-   ->   <del>deleted</del>
+      +inserted text+   ->   <ins>inserted</ins>
+        ^superscript^   ->   <sup>superscript</sup>
+          ~subscript~   ->   <sub>subscript</sub>
+               @code@   ->   <code>computer code</code>
+          %(bob)span%   ->   <span class="bob">span</span>
+
+        ==notextile==   ->   leave text alone (do not format)
+
+       "linktext":url   ->   <a href="url">linktext</a>
+ "linktext(title)":url  ->   <a href="url" title="title">linktext</a>
+
+           !imageurl!   ->   <img src="imageurl" />
+  !imageurl(alt text)!  ->   <img src="imageurl" alt="alt text" />
+    !imageurl!:linkurl  ->   <a href="linkurl"><img src="imageurl" /></a>
+
+ABC(Always Be Closing)  ->   <acronym title="Always Be Closing">ABC</acronym>
+
+
+Table syntax:
+
+    Simple tables:
+
+        |a|simple|table|row|
+        |And|Another|table|row|
+
+        |_. A|_. table|_. header|_.row|
+        |A|simple|table|row|
+
+    Tables with attributes:
+
+        table{border:1px solid black}.
+        {background:#ddd;color:red}. |{}| | | |
+
+
+Applying Attributes:
+
+    Most anywhere Textile code is used, attributes such as arbitrary css style,
+    css classes, and ids can be applied. The syntax is fairly consistent.
+
+    The following characters quickly alter the alignment of block elements:
+
+        <  ->  left align    ex. p<. left-aligned para
+        >  ->  right align       h3>. right-aligned header 3
+        =  ->  centred           h4=. centred header 4
+        <> ->  justified         p<>. justified paragraph
+
+    These will change vertical alignment in table cells:
+
+        ^  ->  top         ex. |^. top-aligned table cell|
+        -  ->  middle          |-. middle aligned|
+        ~  ->  bottom          |~. bottom aligned cell|
+
+    Plain (parentheses) inserted between block syntax and the closing dot-space
+    indicate classes and ids:
+
+        p(hector). paragraph -> <p class="hector">paragraph</p>
+
+        p(#fluid). paragraph -> <p id="fluid">paragraph</p>
+
+        (classes and ids can be combined)
+        p(hector#fluid). paragraph -> <p class="hector" id="fluid">paragraph</p>
+
+    Curly {brackets} insert arbitrary css style
+
+        p{line-height:18px}. paragraph -> <p style="line-height:18px">paragraph</p>
+
+        h3{color:red}. header 3 -> <h3 style="color:red">header 3</h3>
+
+    Square [brackets] insert language attributes
+
+        p[no]. paragraph -> <p lang="no">paragraph</p>
+
+        %[fr]phrase% -> <span lang="fr">phrase</span>
+
+    Usually Textile block element syntax requires a dot and space before the block
+    begins, but since lists don't, they can be styled just using braces
+
+        #{color:blue} one  ->  <ol style="color:blue">
+        # big                   <li>one</li>
+        # list                  <li>big</li>
+                                <li>list</li>
+                               </ol>
+
+    Using the span tag to style a phrase
+
+        It goes like this, %{color:red}the fourth the fifth%
+              -> It goes like this, <span style="color:red">the fourth the fifth</span>
+
+*/
+
+// define these before including this file to override the standard glyphs
+ at define('txt_quote_single_open',  '&#8216;');
+ at define('txt_quote_single_close', '&#8217;');
+ at define('txt_quote_double_open',  '&#8220;');
+ at define('txt_quote_double_close', '&#8221;');
+ at define('txt_apostrophe',         '&#8217;');
+ at define('txt_prime',              '&#8242;');
+ at define('txt_prime_double',       '&#8243;');
+ at define('txt_ellipsis',           '&#8230;');
+ at define('txt_emdash',             '&#8212;');
+ at define('txt_endash',             '&#8211;');
+ at define('txt_dimension',          '&#215;');
+ at define('txt_trademark',          '&#8482;');
+ at define('txt_registered',         '&#174;');
+ at define('txt_copyright',          '&#169;');
+
+class Textile
+{
+    var $hlgn;
+    var $vlgn;
+    var $clas;
+    var $lnge;
+    var $styl;
+    var $cspn;
+    var $rspn;
+    var $a;
+    var $s;
+    var $c;
+    var $pnct;
+    var $rel;
+    var $fn;
+    
+    var $shelf = array();
+    var $restricted = false;
+    var $noimage = false;
+    var $lite = false;
+    var $url_schemes = array();
+    var $glyph = array();
+    
+    var $ver = '2.0.0';
+    var $rev = '$Rev: 1943 $';
+
+// -------------------------------------------------------------
+    function Textile()
+    {
+        $this->hlgn = "(?:\<(?!>)|(?<!<)\>|\<\>|\=|[()]+(?! ))";
+        $this->vlgn = "[\-^~]";
+        $this->clas = "(?:\([^)]+\))";
+        $this->lnge = "(?:\[[^]]+\])";
+        $this->styl = "(?:\{[^}]+\})";
+        $this->cspn = "(?:\\\\\d+)";
+        $this->rspn = "(?:\/\d+)";
+        $this->a = "(?:{$this->hlgn}|{$this->vlgn})*";
+        $this->s = "(?:{$this->cspn}|{$this->rspn})*";
+        $this->c = "(?:{$this->clas}|{$this->styl}|{$this->lnge}|{$this->hlgn})*";
+
+        $this->pnct = '[\!"#\$%&\'()\*\+,\-\./:;<=>\?@\[\\\]\^_`{\|}\~]';
+        $this->urlch = '[\w"$\-_.+!*\'(),";\/?:@=&%#{}|\\^~\[\]`]';
+
+        $this->url_schemes = array('http','https','ftp','mailto');
+
+        $this->btag = array('bq', 'bc', 'notextile', 'pre', 'h[1-6]', 'fn\d+', 'p');
+
+        $this->glyph = array(
+           'quote_single_open'  => txt_quote_single_open,
+           'quote_single_close' => txt_quote_single_close,
+           'quote_double_open'  => txt_quote_double_open,
+           'quote_double_close' => txt_quote_double_close,
+           'apostrophe'         => txt_apostrophe,
+           'prime'              => txt_prime,
+           'prime_double'       => txt_prime_double,
+           'ellipsis'           => txt_ellipsis,
+           'emdash'             => txt_emdash,
+           'endash'             => txt_endash,
+           'dimension'          => txt_dimension,
+           'trademark'          => txt_trademark,
+           'registered'         => txt_registered,
+           'copyright'          => txt_copyright,
+        );
+
+
+    }
+
+// -------------------------------------------------------------
+    function TextileThis($text, $lite='', $encode='', $noimage='', $strict='', $rel='')
+    {
+        if ($rel)
+           $this->rel = ' rel="'.$rel.'" ';
+        $this->lite = $lite;
+        $this->noimage = $noimage;
+
+        if ($encode) {
+         $text = $this->incomingEntities($text);
+            $text = str_replace("x%x%", "&#38;", $text);
+            return $text;
+        } else {
+
+            if(!$strict) {
+                $text = $this->cleanWhiteSpace($text);
+            }
+
+            $text = $this->getRefs($text);
+
+            if (!$lite) {
+                $text = $this->block($text);
+            }
+
+            $text = $this->retrieve($text);
+
+                // just to be tidy
+            $text = str_replace("<br />", "<br />\n", $text);
+
+            return $text;
+        }
+    }
+
+// -------------------------------------------------------------
+    function TextileRestricted($text, $lite=1, $noimage=1, $rel='nofollow')
+    {
+        $this->restricted = true;
+        $this->lite = $lite;
+        $this->noimage = $noimage;
+        if ($rel)
+           $this->rel = ' rel="'.$rel.'" ';
+
+            // escape any raw html
+            $text = $this->encode_html($text, 0);
+
+            $text = $this->cleanWhiteSpace($text);
+            $text = $this->getRefs($text);
+
+            if ($lite) {
+                $text = $this->blockLite($text);
+            }
+            else {
+                $text = $this->block($text);
+            }
+
+            $text = $this->retrieve($text);
+
+                // just to be tidy
+            $text = str_replace("<br />", "<br />\n", $text);
+
+            return $text;
+    }
+
+// -------------------------------------------------------------
+    function pba($in, $element = "") // "parse block attributes"
+    {
+        $style = '';
+        $class = '';
+        $lang = '';
+        $colspan = '';
+        $rowspan = '';
+        $id = '';
+        $atts = '';
+
+        if (!empty($in)) {
+            $matched = $in;
+            if ($element == 'td') {
+                if (preg_match("/\\\\(\d+)/", $matched, $csp)) $colspan = $csp[1];
+                if (preg_match("/\/(\d+)/", $matched, $rsp)) $rowspan = $rsp[1];
+            }
+
+            if ($element == 'td' or $element == 'tr') {
+                if (preg_match("/($this->vlgn)/", $matched, $vert))
+                    $style[] = "vertical-align:" . $this->vAlign($vert[1]) . ";";
+            }
+
+            if (preg_match("/\{([^}]*)\}/", $matched, $sty)) {
+                $style[] = rtrim($sty[1], ';') . ';';
+                $matched = str_replace($sty[0], '', $matched);
+            }
+
+            if (preg_match("/\[([^]]+)\]/U", $matched, $lng)) {
+                $lang = $lng[1];
+                $matched = str_replace($lng[0], '', $matched);
+            }
+
+            if (preg_match("/\(([^()]+)\)/U", $matched, $cls)) {
+                $class = $cls[1];
+                $matched = str_replace($cls[0], '', $matched);
+            }
+
+            if (preg_match("/([(]+)/", $matched, $pl)) {
+                $style[] = "padding-left:" . strlen($pl[1]) . "em;";
+                $matched = str_replace($pl[0], '', $matched);
+            }
+
+            if (preg_match("/([)]+)/", $matched, $pr)) {
+                // $this->dump($pr);
+                $style[] = "padding-right:" . strlen($pr[1]) . "em;";
+                $matched = str_replace($pr[0], '', $matched);
+            }
+
+            if (preg_match("/($this->hlgn)/", $matched, $horiz))
+                $style[] = "text-align:" . $this->hAlign($horiz[1]) . ";";
+
+            if (preg_match("/^(.*)#(.*)$/", $class, $ids)) {
+                $id = $ids[2];
+                $class = $ids[1];
+            }
+
+            if ($this->restricted)
+                return ($lang)    ? ' lang="'    . $lang            .'"':'';
+
+            return join('',array(
+                ($style)   ? ' style="'   . join("", $style) .'"':'',
+                ($class)   ? ' class="'   . $class           .'"':'',
+                ($lang)    ? ' lang="'    . $lang            .'"':'',
+                ($id)      ? ' id="'      . $id              .'"':'',
+                ($colspan) ? ' colspan="' . $colspan         .'"':'',
+                ($rowspan) ? ' rowspan="' . $rowspan         .'"':''
+            ));
+        }
+        return '';
+    }
+
+// -------------------------------------------------------------
+    function hasRawText($text)
+    {
+        // checks whether the text has text not already enclosed by a block tag
+        $r = trim(preg_replace('@<(p|blockquote|div|form|table|ul|ol|pre|h\d)[^>]*?>.*</\1>@s', '', trim($text)));
+        $r = trim(preg_replace('@<(hr|br)[^>]*?/>@', '', $r));
+        return '' != $r;
+    }
+
+// -------------------------------------------------------------
+    function table($text)
+    {
+        $text = $text . "\n\n";
+        return preg_replace_callback("/^(?:table(_?{$this->s}{$this->a}{$this->c})\. ?\n)?^({$this->a}{$this->c}\.? ?\|.*\|)\n\n/smU",
+           array(&$this, "fTable"), $text);
+    }
+
+// -------------------------------------------------------------
+    function fTable($matches)
+    {
+        $tatts = $this->pba($matches[1], 'table');
+
+        foreach(preg_split("/\|$/m", $matches[2], -1, PREG_SPLIT_NO_EMPTY) as $row) {
+            if (preg_match("/^($this->a$this->c\. )(.*)/m", ltrim($row), $rmtch)) {
+                $ratts = $this->pba($rmtch[1], 'tr');
+                $row = $rmtch[2];
+            } else $ratts = '';
+
+                $cells = array();
+            foreach(explode("|", $row) as $cell) {
+                $ctyp = "d";
+                if (preg_match("/^_/", $cell)) $ctyp = "h";
+                if (preg_match("/^(_?$this->s$this->a$this->c\. )(.*)/", $cell, $cmtch)) {
+                    $catts = $this->pba($cmtch[1], 'td');
+                    $cell = $cmtch[2];
+                } else $catts = '';
+
+                $cell = $this->graf($this->span($cell));
+
+                if (trim($cell) != '')
+                    $cells[] = "\t\t\t<t$ctyp$catts>$cell</t$ctyp>";
+            }
+            $rows[] = "\t\t<tr$ratts>\n" . join("\n", $cells) . ($cells ? "\n" : "") . "\t\t</tr>";
+            unset($cells, $catts);
+        }
+        return "\t<table$tatts>\n" . join("\n", $rows) . "\n\t</table>\n\n";
+    }
+
+// -------------------------------------------------------------
+    function lists($text)
+    {
+        return preg_replace_callback("/^([#*]+$this->c .*)$(?![^#*])/smU", array(&$this, "fList"), $text);
+    }
+
+// -------------------------------------------------------------
+    function fList($m)
+    {
+        $text = explode("\n", $m[0]);
+        foreach($text as $line) {
+            $nextline = next($text);
+            if (preg_match("/^([#*]+)($this->a$this->c) (.*)$/s", $line, $m)) {
+                list(, $tl, $atts, $content) = $m;
+                $nl = '';
+                if (preg_match("/^([#*]+)\s.*/", $nextline, $nm))
+                	$nl = $nm[1];
+                if (!isset($lists[$tl])) {
+                    $lists[$tl] = true;
+                    $atts = $this->pba($atts);
+                    $line = "\t<" . $this->lT($tl) . "l$atts>\n\t\t<li>" . $this->graf($content);
+                } else {
+                    $line = "\t\t<li>" . $this->graf($content);
+                }
+
+                if(strlen($nl) <= strlen($tl)) $line .= "</li>";
+                foreach(array_reverse($lists) as $k => $v) {
+                    if(strlen($k) > strlen($nl)) {
+                        $line .= "\n\t</" . $this->lT($k) . "l>";
+                        if(strlen($k) > 1)
+                            $line .= "</li>";
+                        unset($lists[$k]);
+                    }
+                }
+            }
+            $out[] = $line;
+        }
+        return join("\n", $out);
+    }
+
+// -------------------------------------------------------------
+    function lT($in)
+    {
+        return preg_match("/^#+/", $in) ? 'o' : 'u';
+    }
+
+// -------------------------------------------------------------
+    function doPBr($in)
+    {
+        return preg_replace_callback('@<(p)([^>]*?)>(.*)(</\1>)@s', array(&$this, 'doBr'), $in);
+    }
+
+// -------------------------------------------------------------
+    function doBr($m)
+    {
+        $content = preg_replace("@(.+)(?<!<br>|<br />)\n(?![#*\s|])@", '$1<br />', $m[3]);
+        return '<'.$m[1].$m[2].'>'.$content.$m[4];
+    }
+
+// -------------------------------------------------------------
+    function block($text)
+    {
+        $find = $this->btag;
+        $tre = join('|', $find);
+
+        $text = explode("\n\n", $text);
+
+        $tag = 'p';
+        $atts = $cite = $graf = $ext  = '';
+
+        foreach($text as $line) {
+            $anon = 0;
+            if (preg_match("/^($tre)($this->a$this->c)\.(\.?)(?::(\S+))? (.*)$/s", $line, $m)) {
+                // last block was extended, so close it
+                if ($ext)
+                    $out[count($out)-1] .= $c1;
+                // new block
+                list(,$tag,$atts,$ext,$cite,$graf) = $m;
+                list($o1, $o2, $content, $c2, $c1) = $this->fBlock(array(0,$tag,$atts,$ext,$cite,$graf));
+
+                // leave off c1 if this block is extended, we'll close it at the start of the next block
+                if ($ext)
+                    $line = $o1.$o2.$content.$c2;
+                else
+                    $line = $o1.$o2.$content.$c2.$c1;
+            }
+            else {
+                // anonymous block
+                $anon = 1;
+                if ($ext or !preg_match('/^ /', $line)) {
+                    list($o1, $o2, $content, $c2, $c1) = $this->fBlock(array(0,$tag,$atts,$ext,$cite,$line));
+                    // skip $o1/$c1 because this is part of a continuing extended block
+                    if ($tag == 'p' and !$this->hasRawText($content)) {
+                        $line = $content;
+                    }
+                    else {
+                        $line = $o2.$content.$c2;
+                    }
+                }
+                else {
+                   $line = $this->graf($line);
+                }
+            }
+
+            $line = $this->doPBr($line);
+            $line = preg_replace('/<br>/', '<br />', $line);
+
+            if ($ext and $anon)
+                $out[count($out)-1] .= "\n".$line;
+            else
+                $out[] = $line;
+
+            if (!$ext) {
+                $tag = 'p';
+                $atts = '';
+                $cite = '';
+                $graf = '';
+            }
+        }
+        if ($ext) $out[count($out)-1] .= $c1;
+        return join("\n\n", $out);
+    }
+
+
+
+// -------------------------------------------------------------
+    function fBlock($m)
+    {
+        // $this->dump($m);
+        list(, $tag, $atts, $ext, $cite, $content) = $m;
+        $atts = $this->pba($atts);
+
+        $o1 = $o2 = $c2 = $c1 = '';
+
+        if (preg_match("/fn(\d+)/", $tag, $fns)) {
+            $tag = 'p';
+            $fnid = empty($this->fn[$fns[1]]) ? $fns[1] : $this->fn[$fns[1]];
+            $atts .= ' id="fn' . $fnid . '"';
+            if (strpos($atts, 'class=') === false)
+                $atts .= ' class="footnote"';
+            $content = '<sup>' . $fns[1] . '</sup> ' . $content;
+        }
+
+        if ($tag == "bq") {
+            $cite = $this->checkRefs($cite);
+            $cite = ($cite != '') ? ' cite="' . $cite . '"' : '';
+            $o1 = "\t<blockquote$cite$atts>\n";
+            $o2 = "\t\t<p$atts>";
+            $c2 = "</p>";
+            $c1 = "\n\t</blockquote>";
+        }
+        elseif ($tag == 'bc') {
+            $o1 = "<pre$atts>";
+            $o2 = "<code$atts>";
+            $c2 = "</code>";
+            $c1 = "</pre>";
+            $content = $this->shelve($this->encode_html(rtrim($content, "\n")."\n"));
+        }
+        elseif ($tag == 'notextile') {
+            $content = $this->shelve($content);
+            $o1 = $o2 = '';
+            $c1 = $c2 = '';
+        }
+        elseif ($tag == 'pre') {
+            $content = $this->shelve($this->encode_html(rtrim($content, "\n")."\n"));
+            $o1 = "<pre$atts>";
+            $o2 = $c2 = '';
+            $c1 = "</pre>";
+        }
+        else {
+            $o2 = "\t<$tag$atts>";
+            $c2 = "</$tag>";
+          }
+
+        $content = $this->graf($content);
+
+        return array($o1, $o2, $content, $c2, $c1);
+    }
+
+// -------------------------------------------------------------
+    function graf($text)
+    {
+        // handle normal paragraph text
+        if (!$this->lite) {
+            $text = $this->noTextile($text);
+            $text = $this->code($text);
+        }
+
+        $text = $this->links($text);
+        if (!$this->noimage)
+            $text = $this->image($text);
+
+        if (!$this->lite) {
+            $text = $this->lists($text);
+            $text = $this->table($text);
+        }
+
+        $text = $this->span($text);
+        $text = $this->footnoteRef($text);
+        $text = $this->glyphs($text);
+        return rtrim($text, "\n");
+    }
+
+// -------------------------------------------------------------
+    function span($text)
+    {
+        $qtags = array('\*\*','\*','\?\?','-','__','_','%','\+','~','\^');
+        $pnct = ".,\"'?!;:";
+
+        foreach($qtags as $f) {
+            $text = preg_replace_callback("/
+                (?:^|(?<=[\s>$pnct])|([{[]))
+                ($f)(?!$f)
+                ({$this->c})
+                (?::(\S+))?
+                ([^\s$f]+|\S[^$f\n]*[^\s$f\n])
+                ([$pnct]*)
+                $f
+                (?:$|([\]}])|(?=[[:punct:]]{1,2}|\s))
+            /x", array(&$this, "fSpan"), $text);
+        }
+        return $text;
+    }
+
+// -------------------------------------------------------------
+    function fSpan($m)
+    {
+        $qtags = array(
+            '*'  => 'strong',
+            '**' => 'b',
+            '??' => 'cite',
+            '_'  => 'em',
+            '__' => 'i',
+            '-'  => 'del',
+            '%'  => 'span',
+            '+'  => 'ins',
+            '~'  => 'sub',
+            '^'  => 'sup',
+        );
+
+        list(,, $tag, $atts, $cite, $content, $end) = $m;
+        $tag = $qtags[$tag];
+        $atts = $this->pba($atts);
+        $atts .= ($cite != '') ? 'cite="' . $cite . '"' : '';
+
+        $out = "<$tag$atts>$content$end</$tag>";
+
+//      $this->dump($out);
+
+        return $out;
+
+    }
+
+// -------------------------------------------------------------
+    function links($text)
+    {
+        return preg_replace_callback('/
+            (?:^|(?<=[\s>.$pnct\(])|([{[])) # $pre
+            "                            # start
+            (' . $this->c . ')           # $atts
+            ([^"]+)                      # $text
+            \s?
+            (?:\(([^)]+)\)(?="))?        # $title
+            ":
+            ('.$this->urlch.'+)          # $url
+            (\/)?                        # $slash
+            ([^\w\/;]*)                  # $post
+            (?:([\]}])|(?=\s|$|\)))
+        /Ux', array(&$this, "fLink"), $text);
+    }
+
+// -------------------------------------------------------------
+    function fLink($m)
+    {
+        list(, $pre, $atts, $text, $title, $url, $slash, $post) = $m;
+
+        $url = $this->checkRefs($url);
+
+        $atts = $this->pba($atts);
+        $atts .= ($title != '') ? ' title="' . $this->encode_html($title) . '"' : '';
+
+        if (!$this->noimage)
+            $text = $this->image($text);
+
+        $text = $this->span($text);
+        $text = $this->glyphs($text);
+
+        $url = $this->relURL($url);
+
+        $out = '<a href="' . $this->encode_html($url . $slash) . '"' . $atts . $this->rel . '>' . $text . '</a>' . $post;
+
+        // $this->dump($out);
+        return $this->shelve($out);
+
+    }
+
+// -------------------------------------------------------------
+    function getRefs($text)
+    {
+        return preg_replace_callback("/(?<=^|\s)\[(.+)\]((?:http:\/\/|\/)\S+)(?=\s|$)/U",
+            array(&$this, "refs"), $text);
+    }
+
+// -------------------------------------------------------------
+    function refs($m)
+    {
+        list(, $flag, $url) = $m;
+        $this->urlrefs[$flag] = $url;
+        return '';
+    }
+
+// -------------------------------------------------------------
+    function checkRefs($text)
+    {
+        return (isset($this->urlrefs[$text])) ? $this->urlrefs[$text] : $text;
+    }
+
+// -------------------------------------------------------------
+    function relURL($url)
+    {
+        $parts = parse_url($url);
+        if ((empty($parts['scheme']) or @$parts['scheme'] == 'http') and
+             empty($parts['host']) and
+             preg_match('/^\w/', @$parts['path']))
+            $url = hu.$url;
+        if ($this->restricted and !empty($parts['scheme']) and
+              !in_array($parts['scheme'], $this->url_schemes))
+            return '#';
+        return $url;
+    }
+
+// -------------------------------------------------------------
+    function image($text)
+    {
+        return preg_replace_callback("/
+            (?:[[{])?          # pre
+            \!                 # opening !
+            (\<|\=|\>)??       # optional alignment atts
+            ($this->c)         # optional style,class atts
+            (?:\. )?           # optional dot-space
+            ([^\s(!]+)         # presume this is the src
+            \s?                # optional space
+            (?:\(([^\)]+)\))?  # optional title
+            \!                 # closing
+            (?::(\S+))?        # optional href
+            (?:[\]}]|(?=\s|$)) # lookahead: space or end of string
+        /Ux", array(&$this, "fImage"), $text);
+    }
+
+// -------------------------------------------------------------
+    function fImage($m)
+    {
+        list(, $algn, $atts, $url) = $m;
+        $atts  = $this->pba($atts);
+        $atts .= ($algn != '')  ? ' align="' . $this->iAlign($algn) . '"' : '';
+        $atts .= (isset($m[4])) ? ' title="' . $m[4] . '"' : '';
+        $atts .= (isset($m[4])) ? ' alt="'   . $m[4] . '"' : ' alt=""';
+        $size = @getimagesize($url);
+        if ($size) $atts .= " $size[3]";
+
+        $href = (isset($m[5])) ? $this->checkRefs($m[5]) : '';
+        $url = $this->checkRefs($url);
+
+        $url = $this->relURL($url);
+
+        $out = array(
+            ($href) ? '<a href="' . $href . '">' : '',
+            '<img src="' . $url . '"' . $atts . ' />',
+            ($href) ? '</a>' : ''
+        );
+
+        return join('',$out);
+    }
+
+// -------------------------------------------------------------
+    function code($text)
+    {
+        $text = $this->doSpecial($text, '<code>', '</code>', 'fCode');
+        $text = $this->doSpecial($text, '@', '@', 'fCode');
+        $text = $this->doSpecial($text, '<pre>', '</pre>', 'fPre');
+        return $text;
+    }
+
+// -------------------------------------------------------------
+    function fCode($m)
+    {
+      @list(, $before, $text, $after) = $m;
+      if ($this->restricted)
+          // $text is already escaped
+            return $before.$this->shelve('<code>'.$text.'</code>').$after;
+      else
+            return $before.$this->shelve('<code>'.$this->encode_html($text).'</code>').$after;
+    }
+
+// -------------------------------------------------------------
+    function fPre($m)
+    {
+      @list(, $before, $text, $after) = $m;
+      if ($this->restricted)
+          // $text is already escaped
+            return $before.'<pre>'.$this->shelve($text).'</pre>'.$after;
+      else
+            return $before.'<pre>'.$this->shelve($this->encode_html($text)).'</pre>'.$after;
+    }
+// -------------------------------------------------------------
+    function shelve($val)
+    {
+        $i = uniqid(rand());
+        $this->shelf[$i] = $val;
+        return $i;
+    }
+
+// -------------------------------------------------------------
+    function retrieve($text)
+    {
+        if (is_array($this->shelf))
+            do {
+                $old = $text;
+                $text = strtr($text, $this->shelf);
+             } while ($text != $old);
+
+        return $text;
+    }
+
+// -------------------------------------------------------------
+// NOTE: deprecated
+    function incomingEntities($text)
+    {
+        return preg_replace("/&(?![#a-z0-9]+;)/i", "x%x%", $text);
+    }
+
+// -------------------------------------------------------------
+// NOTE: deprecated
+    function encodeEntities($text)
+    {
+        return (function_exists('mb_encode_numericentity'))
+        ?    $this->encode_high($text)
+        :    htmlentities($text, ENT_NOQUOTES, "utf-8");
+    }
+
+// -------------------------------------------------------------
+// NOTE: deprecated
+    function fixEntities($text)
+    {
+        /*  de-entify any remaining angle brackets or ampersands */
+        return str_replace(array("&gt;", "&lt;", "&amp;"),
+            array(">", "<", "&"), $text);
+    }
+
+// -------------------------------------------------------------
+    function cleanWhiteSpace($text)
+    {
+        $out = str_replace("\r\n", "\n", $text);
+        $out = preg_replace("/\n{3,}/", "\n\n", $out);
+        $out = preg_replace("/\n *\n/", "\n\n", $out);
+        $out = preg_replace('/"$/', "\" ", $out);
+        return $out;
+    }
+
+// -------------------------------------------------------------
+    function doSpecial($text, $start, $end, $method='fSpecial')
+    {
+      return preg_replace_callback('/(^|\s|[[({>])'.preg_quote($start, '/').'(.*?)'.preg_quote($end, '/').'(\s|$|[\])}])?/ms',
+            array(&$this, $method), $text);
+    }
+
+// -------------------------------------------------------------
+    function fSpecial($m)
+    {
+        // A special block like notextile or code
+      @list(, $before, $text, $after) = $m;
+        return $before.$this->shelve($this->encode_html($text)).$after;
+    }
+
+// -------------------------------------------------------------
+    function noTextile($text)
+    {
+         $text = $this->doSpecial($text, '<notextile>', '</notextile>', 'fTextile');
+         return $this->doSpecial($text, '==', '==', 'fTextile');
+
+    }
+
+// -------------------------------------------------------------
+    function fTextile($m)
+    {
+        @list(, $before, $notextile, $after) = $m;
+        #$notextile = str_replace(array_keys($modifiers), array_values($modifiers), $notextile);
+        return $before.$this->shelve($notextile).$after;
+    }
+
+// -------------------------------------------------------------
+    function footnoteRef($text)
+    {
+        return preg_replace('/\b\[([0-9]+)\](\s)?/Ue',
+            '$this->footnoteID(\'\1\',\'\2\')', $text);
+    }
+
+// -------------------------------------------------------------
+    function footnoteID($id, $t)
+    {
+        if (empty($this->fn[$id]))
+            $this->fn[$id] = uniqid(rand());
+        $fnid = $this->fn[$id];
+        return '<sup class="footnote"><a href="#fn'.$fnid.'">'.$id.'</a></sup>'.$t;
+    }
+
+// -------------------------------------------------------------
+    function glyphs($text)
+    {
+        // fix: hackish
+        $text = preg_replace('/"\z/', "\" ", $text);
+        $pnc = '[[:punct:]]';
+
+        $glyph_search = array(
+            '/(\w)\'(\w)/',                                      // apostrophe's
+            '/(\s)\'(\d+\w?)\b(?!\')/',                          // back in '88
+            '/(\S)\'(?=\s|'.$pnc.'|<|$)/',                       //  single closing
+            '/\'/',                                              //  single opening
+            '/(\S)\"(?=\s|'.$pnc.'|<|$)/',                       //  double closing
+            '/"/',                                               //  double opening
+            '/\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/',        //  3+ uppercase acronym
+            '/\b([A-Z][A-Z\'\-]+[A-Z])(?=[\s.,\)>])/',           //  3+ uppercase
+            '/\b( )?\.{3}/',                                     //  ellipsis
+            '/(\s?)--(\s?)/',                                    //  em dash
+            '/\s-(?:\s|$)/',                                     //  en dash
+            '/(\d+)( ?)x( ?)(?=\d+)/',                           //  dimension sign
+            '/\b ?[([]TM[])]/i',                                 //  trademark
+            '/\b ?[([]R[])]/i',                                  //  registered
+            '/\b ?[([]C[])]/i',                                  //  copyright
+         );
+
+        extract($this->glyph, EXTR_PREFIX_ALL, 'txt');
+
+        $glyph_replace = array(
+            '$1'.$txt_apostrophe.'$2',           // apostrophe's
+            '$1'.$txt_apostrophe.'$2',           // back in '88
+            '$1'.$txt_quote_single_close,        //  single closing
+            $txt_quote_single_open,              //  single opening
+            '$1'.$txt_quote_double_close,        //  double closing
+            $txt_quote_double_open,              //  double opening
+            '<acronym title="$2">$1</acronym>',  //  3+ uppercase acronym
+            '<span class="caps">$1</span>',      //  3+ uppercase
+            '$1'.$txt_ellipsis,                  //  ellipsis
+            '$1'.$txt_emdash.'$2',               //  em dash
+            ' '.$txt_endash.' ',                 //  en dash
+            '$1$2'.$txt_dimension.'$3',          //  dimension sign
+            $txt_trademark,                      //  trademark
+            $txt_registered,                     //  registered
+            $txt_copyright,                      //  copyright
+         );
+
+         $text = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
+         foreach($text as $line) {
+             if (!preg_match("/<.*>/", $line)) {
+                 $line = preg_replace($glyph_search, $glyph_replace, $line);
+             }
+              $glyph_out[] = $line;
+         }
+         return join('', $glyph_out);
+    }
+
+// -------------------------------------------------------------
+    function iAlign($in)
+    {
+        $vals = array(
+            '<' => 'left',
+            '=' => 'center',
+            '>' => 'right');
+        return (isset($vals[$in])) ? $vals[$in] : '';
+    }
+
+// -------------------------------------------------------------
+    function hAlign($in)
+    {
+        $vals = array(
+            '<'  => 'left',
+            '='  => 'center',
+            '>'  => 'right',
+            '<>' => 'justify');
+        return (isset($vals[$in])) ? $vals[$in] : '';
+    }
+
+// -------------------------------------------------------------
+    function vAlign($in)
+    {
+        $vals = array(
+            '^' => 'top',
+            '-' => 'middle',
+            '~' => 'bottom');
+        return (isset($vals[$in])) ? $vals[$in] : '';
+    }
+
+// -------------------------------------------------------------
+// NOTE: deprecated
+    function encode_high($text, $charset = "UTF-8")
+    {
+        return mb_encode_numericentity($text, $this->cmap(), $charset);
+    }
+
+// -------------------------------------------------------------
+// NOTE: deprecated
+    function decode_high($text, $charset = "UTF-8")
+    {
+        return mb_decode_numericentity($text, $this->cmap(), $charset);
+    }
+
+// -------------------------------------------------------------
+// NOTE: deprecated
+    function cmap()
+    {
+        $f = 0xffff;
+        $cmap = array(
+            0x0080, 0xffff, 0, $f);
+        return $cmap;
+    }
+
+// -------------------------------------------------------------
+    function encode_html($str, $quotes=1)
+    {
+        $a = array(
+            '&' => '&#38;',
+            '<' => '&#60;',
+            '>' => '&#62;',
+        );
+        if ($quotes) $a = $a + array(
+            "'" => '&#39;',
+            '"' => '&#34;',
+        );
+
+        return strtr($str, $a);
+    }
+
+// -------------------------------------------------------------
+    function textile_popup_help($name, $helpvar, $windowW, $windowH)
+    {
+        return ' <a target="_blank" href="http://www.textpattern.com/help/?item=' . $helpvar . '" onclick="window.open(this.href, \'popupwindow\', \'width=' . $windowW . ',height=' . $windowH . ',scrollbars,resizable\'); return false;">' . $name . '</a><br />';
+
+        return $out;
+    }
+
+// -------------------------------------------------------------
+// NOTE: deprecated
+    function txtgps($thing)
+    {
+        if (isset($_POST[$thing])) {
+            if (get_magic_quotes_gpc()) {
+                return stripslashes($_POST[$thing]);
+            }
+            else {
+                return $_POST[$thing];
+            }
+        }
+        else {
+            return '';
+        }
+    }
+
+// -------------------------------------------------------------
+// NOTE: deprecated
+    function dump()
+    {
+        foreach (func_get_args() as $a)
+            echo "\n<pre>",(is_array($a)) ? print_r($a) : $a, "</pre>\n";
+    }
+
+// -------------------------------------------------------------
+
+    function blockLite($text)
+    {
+        $this->btag = array('bq', 'p');
+        return $this->block($text."\n\n");
+    }
+
+
+} // end class
+
+?>

Added: trunk/www.openmoko.com/textpattern/lib/constants.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/constants.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/constants.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,31 @@
+<?php
+/*
+$HeadURL: $
+$LastChangedRevision: $
+*/
+
+$old_level = error_reporting(E_ALL ^ (E_NOTICE));
+
+define('TXP_DEBUG', 0);
+
+define('SPAM', -1);
+define('MODERATE', 0);
+define('VISIBLE', 1);
+define('RELOAD', -99);
+
+define('RPC_SERVER', 'http://rpc.textpattern.com');
+
+define('LEAVE_TEXT_UNTOUCHED', 0);
+define('USE_TEXTILE', 1);
+define('CONVERT_LINEBREAKS', 2);
+
+if (defined('DIRECTORY_SEPARATOR'))
+	define('DS', DIRECTORY_SEPARATOR);
+else
+	define ('DS', (is_windows() ? '\\' : '/'));
+
+define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());
+
+
+error_reporting($old_level);unset($old_level);
+?>
\ No newline at end of file

Added: trunk/www.openmoko.com/textpattern/lib/i18n-ascii.txt
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/i18n-ascii.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/i18n-ascii.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,609 @@
+; global transliteration
+[default]
+À = "A"
+Á = "A"
+Â = "A"
+Ã = "A"
+Ä = "Ae"
+Ã… = "A"
+Æ = "A"
+Ä€ = "A"
+Ä„ = "A"
+Ä‚ = "A"
+Ç = "C"
+Ć = "C"
+Č = "C"
+Ĉ = "C"
+ÄŠ = "C"
+ÄŽ = "D"
+Đ = "D"
+È = "E"
+É = "E"
+Ê = "E"
+Ë = "E"
+Ä’ = "E"
+Ę = "E"
+Äš = "E"
+Ä” = "E"
+Ä– = "E"
+Ĝ = "G"
+Äž = "G"
+Ä  = "G"
+Ä¢ = "G"
+Ĥ = "H"
+Ħ = "H"
+Ì = "I"
+Í = "I"
+ÃŽ = "I"
+Ï = "I"
+Ī = "I"
+Ĩ = "I"
+Ĭ = "I"
+Ä® = "I"
+Ä° = "I"
+IJ = "IJ"
+Ä´ = "J"
+Ķ = "K"
+Ľ = "K"
+Ĺ = "K"
+Ä» = "K"
+Ä¿ = "K"
+Ł = "L"
+Ñ = "N"
+Ń = "N"
+Ň = "N"
+Å… = "N"
+ÅŠ = "N"
+Ã’ = "O"
+Ó = "O"
+Ô = "O"
+Õ = "O"
+Ö = "Oe"
+Ø = "O"
+Ō = "O"
+Ő = "O"
+ÅŽ = "O"
+Å’ = "OE"
+Å” = "R"
+Ř = "R"
+Å– = "R"
+Åš = "S"
+Åž = "S"
+Ŝ = "S"
+Ș = "S"
+Å  = "S"
+Ť = "T"
+Å¢ = "T"
+Ŧ = "T"
+Èš = "T"
+Ù = "U"
+Ú = "U"
+Û = "U"
+Ü = "Ue"
+Ū = "U"
+Å® = "U"
+Å° = "U"
+Ŭ = "U"
+Ũ = "U"
+Ų = "U"
+Å´ = "W"
+Ŷ = "Y"
+Ÿ = "Y"
+Ý = "Y"
+Ź = "Z"
+Å» = "Z"
+Ž = "Z"
+à = "a"
+á = "a"
+â = "a"
+ã = "a"
+ä = "ae"
+ā = "a"
+Ä… = "a"
+ă = "a"
+Ã¥ = "a"
+æ = "ae"
+ç = "c"
+ć = "c"
+č = "c"
+ĉ = "c"
+Ä‹ = "c"
+ď = "d"
+Ä‘ = "d"
+è = "e"
+é = "e"
+ê = "e"
+ë = "e"
+Ä“ = "e"
+Ä™ = "e"
+Ä› = "e"
+Ä• = "e"
+Ä— = "e"
+Æ’ = "f"
+ĝ = "g"
+ÄŸ = "g"
+Ä¡ = "g"
+Ä£ = "g"
+Ä¥ = "h"
+ħ = "h"
+ì = "i"
+í = "i"
+î = "i"
+ï = "i"
+Ä« = "i"
+Ä© = "i"
+Ä­ = "i"
+į = "i"
+ı = "i"
+ij = "ij"
+ĵ = "j"
+Ä· = "k"
+ĸ = "k"
+Å‚ = "l"
+ľ = "l"
+ĺ = "l"
+ļ = "l"
+Å€ = "l"
+ñ = "n"
+Å„ = "n"
+ň = "n"
+ņ = "n"
+ʼn = "n"
+Å‹ = "n"
+ò = "o"
+ó = "o"
+ô = "o"
+õ = "o"
+ö = "oe"
+ø = "o"
+ō = "o"
+Å‘ = "o"
+ŏ = "o"
+Å“ = "oe"
+Å• = "r"
+Å™ = "r"
+Å— = "r"
+Å› = "s"
+Å¡ = "s"
+Å¥ = "t"
+ù = "u"
+ú = "u"
+û = "u"
+ü = "ue"
+Å« = "u"
+ů = "u"
+ű = "u"
+Å­ = "u"
+Å© = "u"
+ų = "u"
+ŵ = "w"
+ÿ = "y"
+ý = "y"
+Å· = "y"
+ż = "z"
+ź = "z"
+ž = "z"
+ß = "ss"
+Å¿ = "ss"
+Α = "A"
+Ά = "A"
+Ἀ = "A"
+Ἁ = "A"
+Ἂ = "A"
+Ἃ = "A"
+Ἄ = "A"
+Ἅ = "A"
+Ἆ = "A"
+Ἇ = "A"
+ᾈ = "A"
+ᾉ = "A"
+ᾊ = "A"
+ᾋ = "A"
+ᾌ = "A"
+ᾍ = "A"
+ᾎ = "A"
+ᾏ = "A"
+Ᾰ = "A"
+á¾¹ = "A"
+Ὰ = "A"
+á¾» = "A"
+á¾¼ = "A"
+Î’ = "B"
+Γ = "G"
+Δ = "D"
+Ε = "E"
+Έ = "E"
+Ἐ = "E"
+á¼™ = "E"
+Ἒ = "E"
+á¼› = "E"
+Ἔ = "E"
+Ἕ = "E"
+Έ = "E"
+Ὲ = "E"
+Ζ = "Z"
+Η = "I"
+Ή = "I"
+Ἠ = "I"
+Ἡ = "I"
+Ἢ = "I"
+Ἣ = "I"
+Ἤ = "I"
+á¼­ = "I"
+á¼® = "I"
+Ἧ = "I"
+ᾘ = "I"
+á¾™ = "I"
+ᾚ = "I"
+á¾› = "I"
+ᾜ = "I"
+ᾝ = "I"
+ᾞ = "I"
+ᾟ = "I"
+á¿Š = "I"
+á¿‹ = "I"
+ῌ = "I"
+Θ = "TH"
+Ι = "I"
+Ί = "I"
+Ϊ = "I"
+Ἰ = "I"
+á¼¹ = "I"
+Ἲ = "I"
+á¼» = "I"
+á¼¼ = "I"
+á¼½ = "I"
+á¼¾ = "I"
+Ἷ = "I"
+Ῐ = "I"
+á¿™ = "I"
+á¿š = "I"
+á¿› = "I"
+Κ = "K"
+Λ = "L"
+Μ = "M"
+Ν = "N"
+Ξ = "KS"
+Ο = "O"
+Ό = "O"
+Ὀ = "O"
+Ὁ = "O"
+Ὂ = "O"
+Ὃ = "O"
+Ὄ = "O"
+Ὅ = "O"
+Ὸ = "O"
+Ό = "O"
+Π = "P"
+Ρ = "R"
+Ῥ = "R"
+Σ = "S"
+Τ = "T"
+Î¥ = "Y"
+ÎŽ = "Y"
+Ϋ = "Y"
+á½™ = "Y"
+á½› = "Y"
+Ὕ = "Y"
+Ὗ = "Y"
+Ῠ = "Y"
+á¿© = "Y"
+Ὺ = "Y"
+á¿« = "Y"
+Φ = "F"
+Χ = "X"
+Ψ = "PS"
+Ω = "O"
+Ώ = "O"
+Ὠ = "O"
+Ὡ = "O"
+Ὢ = "O"
+Ὣ = "O"
+Ὤ = "O"
+á½­ = "O"
+á½® = "O"
+Ὧ = "O"
+ᾨ = "O"
+ᾩ = "O"
+ᾪ = "O"
+ᾫ = "O"
+ᾬ = "O"
+á¾­ = "O"
+á¾® = "O"
+ᾯ = "O"
+Ὼ = "O"
+á¿» = "O"
+ῼ = "O"
+α = "a"
+ά = "a"
+á¼€ = "a"
+ἁ = "a"
+ἂ = "a"
+ἃ = "a"
+ἄ = "a"
+á¼… = "a"
+ἆ = "a"
+ἇ = "a"
+á¾€ = "a"
+ᾁ = "a"
+ᾂ = "a"
+ᾃ = "a"
+ᾄ = "a"
+á¾… = "a"
+ᾆ = "a"
+ᾇ = "a"
+á½° = "a"
+á½± = "a"
+á¾° = "a"
+á¾± = "a"
+á¾² = "a"
+á¾³ = "a"
+á¾´ = "a"
+ᾶ = "a"
+á¾· = "a"
+β = "b"
+γ = "g"
+δ = "d"
+ε = "e"
+έ = "e"
+ἐ = "e"
+ἑ = "e"
+á¼’ = "e"
+ἓ = "e"
+á¼” = "e"
+ἕ = "e"
+á½² = "e"
+á½³ = "e"
+ζ = "z"
+η = "i"
+ή = "i"
+á¼  = "i"
+ἡ = "i"
+á¼¢ = "i"
+á¼£ = "i"
+ἤ = "i"
+á¼¥ = "i"
+ἦ = "i"
+ἧ = "i"
+ᾐ = "i"
+ᾑ = "i"
+á¾’ = "i"
+ᾓ = "i"
+á¾” = "i"
+ᾕ = "i"
+á¾– = "i"
+á¾— = "i"
+á½´ = "i"
+á½µ = "i"
+á¿‚ = "i"
+ῃ = "i"
+á¿„ = "i"
+ῆ = "i"
+ῇ = "i"
+θ = "th"
+ι = "i"
+ί = "i"
+ÏŠ = "i"
+ΐ = "i"
+á¼° = "i"
+á¼± = "i"
+á¼² = "i"
+á¼³ = "i"
+á¼´ = "i"
+á¼µ = "i"
+ἶ = "i"
+á¼· = "i"
+ὶ = "i"
+á½· = "i"
+ῐ = "i"
+á¿‘ = "i"
+á¿’ = "i"
+á¿“ = "i"
+á¿– = "i"
+á¿— = "i"
+κ = "k"
+λ = "l"
+μ = "m"
+ν = "n"
+ξ = "ks"
+ο = "o"
+ό = "o"
+á½€ = "o"
+ὁ = "o"
+ὂ = "o"
+ὃ = "o"
+ὄ = "o"
+á½… = "o"
+ὸ = "o"
+á½¹ = "o"
+Ï€ = "p"
+ρ = "r"
+ῤ = "r"
+á¿¥ = "r"
+σ = "s"
+Ï‚ = "s"
+Ï„ = "t"
+Ï… = "y"
+ύ = "y"
+Ï‹ = "y"
+ΰ = "y"
+ὐ = "y"
+ὑ = "y"
+á½’ = "y"
+ὓ = "y"
+á½” = "y"
+ὕ = "y"
+á½– = "y"
+á½— = "y"
+ὺ = "y"
+á½» = "y"
+á¿  = "y"
+á¿¡ = "y"
+á¿¢ = "y"
+á¿£ = "y"
+ῦ = "y"
+ῧ = "y"
+φ = "f"
+χ = "x"
+ψ = "ps"
+ω = "o"
+ÏŽ = "o"
+á½  = "o"
+ὡ = "o"
+á½¢ = "o"
+á½£ = "o"
+ὤ = "o"
+á½¥ = "o"
+ὦ = "o"
+ὧ = "o"
+á¾  = "o"
+ᾡ = "o"
+á¾¢ = "o"
+á¾£ = "o"
+ᾤ = "o"
+á¾¥ = "o"
+ᾦ = "o"
+ᾧ = "o"
+á½¼ = "o"
+á½½ = "o"
+ῲ = "o"
+ῳ = "o"
+á¿´ = "o"
+ῶ = "o"
+á¿· = "o"
+¨ = ""
+Î… = ""
+᾿ = ""
+῾ = ""
+῍ = ""
+῝ = ""
+á¿Ž = ""
+á¿ž = ""
+῏ = ""
+á¿Ÿ = ""
+á¿€ = ""
+῁ = ""
+΄ = ""
+á¿® = ""
+` = ""
+á¿­ = ""
+ͺ = ""
+á¾½ = ""
+А = "A"
+Б = "B"
+Ð’ = "V"
+Г = "G"
+Д = "D"
+Е = "E"
+Ё = "E"
+Ж = "ZH"
+З = "Z"
+И = "I"
+Й = "I"
+К = "K"
+Л = "L"
+М = "M"
+Н = "N"
+О = "O"
+П = "P"
+Р = "R"
+С = "S"
+Т = "T"
+У = "U"
+Ф = "F"
+Ð¥ = "KH"
+Ц = "TS"
+Ч = "CH"
+Ш = "SH"
+Щ = "SHCH"
+Ы = "Y"
+Э = "E"
+Ю = "YU"
+Я = "YA"
+а = "A"
+б = "B"
+в = "V"
+г = "G"
+д = "D"
+е = "E"
+Ñ‘ = "E"
+ж = "ZH"
+з = "Z"
+и = "I"
+й = "I"
+к = "K"
+л = "L"
+м = "M"
+н = "N"
+о = "O"
+п = "P"
+Ñ€ = "R"
+с = "S"
+Ñ‚ = "T"
+у = "U"
+Ñ„ = "F"
+Ñ… = "KH"
+ц = "TS"
+ч = "CH"
+ш = "SH"
+щ = "SHCH"
+Ñ‹ = "Y"
+э = "E"
+ÑŽ = "YU"
+я = "YA"
+Ъ = ""
+ÑŠ = ""
+Ь = ""
+ь = ""
+
+ð = "d"
+Ð = "D"
+þ = "th"
+Þ = "TH"
+
+; Georgian
+ა = "a"
+ბ = "b"
+გ = "g"
+დ = "d"
+ე = "e"
+ვ = "v"
+ზ = "z"
+თ = "t"
+ი = "i"
+კ = "k"
+ლ = "l"
+მ = "m"
+ნ = "n"
+ო = "o"
+პ = "p"
+ჟ = "zh"
+რ = "r"
+ს = "s"
+ტ = "t"
+უ = "u"
+ფ = "p"
+ქ = "k"
+ღ = "gh"
+ყ = "q"
+შ = "sh"
+ჩ = "ch"
+ც = "ts"
+ძ = "dz"
+წ = "ts"
+ჭ = "ch"
+ხ = "kh"
+ჯ = "j"
+ჰ = "h"
+
+; language-specific overrides
+[fi-fi]
+ä = "a"
+ö = "o"
+ü = "u"
+Ä = "A"
+Ö = "O"
+
+[is-is]
+Æ = "AE"
+

Added: trunk/www.openmoko.com/textpattern/lib/taglib.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/taglib.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/taglib.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,124 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/taglib.php $
+$LastChangedRevision: 1535 $
+*/
+
+$article_tags = array(
+	'permlink',
+	'posted',
+	'title',
+	'body',
+	'excerpt',
+	'section',
+	'category1',
+	'category2',
+	'article_image',
+	'comments_invite',
+	'author',
+);
+
+$link_tags = array(
+	'link',
+	'linkdesctitle',
+	'link_name',
+	'link_description',
+	'link_category',
+	'link_date'
+);
+
+$comment_tags = array(
+	'comments',
+	'comments_form',
+	'comments_preview',
+);
+
+$comment_details_tags = array(
+	'comment_permlink',
+	'comment_name',
+	'comment_email',
+	'comment_web',
+	'comment_time',
+	'comment_message',
+);
+
+$comment_form_tags = array(
+	'comment_name_input',
+	'comment_email_input',
+	'comment_web_input',
+	'comment_message_input',
+	'comment_remember',
+	'comment_preview',
+	'comment_submit',
+);
+
+$search_result_tags = array(
+	'search_result_title',
+	'search_result_excerpt',
+	'search_result_date',
+	'search_result_url',
+);
+
+$file_download_tags = array(
+	'file_download_link',
+	'file_download_name',
+	'file_download_description',
+	'file_download_category',
+	'file_download_created',
+	'file_download_modified',
+	'file_download_size',
+	'file_download_downloads',
+);
+
+$page_article_tags = array(
+	'article',
+	'article_custom',
+);
+
+$page_article_nav_tags = array(
+	'prev_title',
+	'next_title',
+	'link_to_prev',
+	'link_to_next',
+	'older',
+	'newer',
+);
+
+$page_nav_tags = array(
+	'link_to_home',
+	'section_list',
+	'category_list',
+	'popup',
+	'recent_articles',
+	'recent_comments',
+	'related_articles',
+	'search_input',
+);
+
+$page_xml_tags = array(
+	'feed_link',
+	'link_feed_link',
+);
+
+$page_misc_tags = array(
+	'page_title',
+	'css',
+	'sitename',
+	'site_slogan',
+	'breadcrumb',
+	'search_input',
+	'email',
+	'linklist',
+	'password_protect',
+	'output_form',
+	'lang',
+);
+
+$page_file_tags = array(
+	'file_download_list',
+	'file_download',
+	'file_download_link',
+);
+
+?>
\ No newline at end of file

Added: trunk/www.openmoko.com/textpattern/lib/txplib_db.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/txplib_db.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/txplib_db.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,476 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/txplib_db.php $
+$LastChangedRevision: 1879 $
+*/
+
+if (!defined('PFX')) {
+	if (!empty($txpcfg['table_prefix'])) {
+		define ("PFX",$txpcfg['table_prefix']);
+	} else define ("PFX",'');
+}
+
+set_magic_quotes_runtime(0);
+
+class DB {
+	function DB()
+	{
+		global $txpcfg;
+
+		$this->host = $txpcfg['host'];
+		$this->db	= $txpcfg['db'];
+		$this->user = $txpcfg['user'];
+		$this->pass = $txpcfg['pass'];
+
+		$this->link = @mysql_connect($this->host, $this->user, $this->pass);
+		if (!$this->link) die(db_down());
+
+		$this->version = mysql_get_server_info();
+
+		if (!$this->link) {
+			$GLOBALS['connected'] = false;
+		} else $GLOBALS['connected'] = true;
+		@mysql_select_db($this->db) or die(db_down());
+
+		$version = $this->version;
+		// be backwardscompatible
+		if ( isset($txpcfg['dbcharset']) && (intval($version[0]) >= 5 || preg_match('#^4\.[1-9]#',$version)) )
+			mysql_query("SET NAMES ". $txpcfg['dbcharset']);
+	}
+}
+$DB = new DB;
+
+//-------------------------------------------------------------
+	function safe_pfx($table) {
+		$name = PFX.$table;
+		if (preg_match('@[^\w._$]@', $name))
+			return '`'.$name.'`';
+		return $name;
+	}
+
+//-------------------------------------------------------------
+	function safe_pfx_j($table)
+	{
+		$ts = array();
+		foreach (explode(',', $table) as $t) {
+			$name = PFX.trim($t);
+			if (preg_match('@[^\w._$]@', $name))
+				$ts[] = "`$name`".(PFX ? " as `$t`" : '');
+			else
+				$ts[] = "$name".(PFX ? " as $t" : '');
+		}
+		return join(', ', $ts);
+	}
+
+//-------------------------------------------------------------
+	function safe_query($q='',$debug='',$unbuf='')
+	{
+		global $DB,$txpcfg, $qcount, $qtime, $production_status;
+		$method = (!$unbuf) ? 'mysql_query' : 'mysql_unbuffered_query';
+		if (!$q) return false;
+		if ($debug or TXP_DEBUG === 1) { 
+			dmp($q);
+			dmp(mysql_error());
+//			dmp(debug_backtrace());
+		}
+		$start = getmicrotime();
+		$result = $method($q,$DB->link);
+		$time = sprintf('%02.6f', getmicrotime() - $start);
+		@$qtime += $time;
+		@$qcount++;
+		if ($result === false and (txpinterface === 'admin' or @$production_status == 'debug' or @$production_status == 'testing')) {
+			$caller = ($production_status == 'debug') ? n . join("\n", get_caller()) : '';
+			trigger_error(mysql_error() . n . $q . $caller, E_USER_WARNING);
+		}
+
+		trace_add("[SQL ($time): $q]");
+
+		if(!$result) return false;
+		return $result;
+	}
+
+// -------------------------------------------------------------
+	function safe_delete($table, $where, $debug='')
+	{
+		$q = "delete from ".safe_pfx($table)." where $where";
+		if ($r = safe_query($q,$debug)) {
+			return true;
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function safe_update($table, $set, $where, $debug='') 
+	{
+		$q = "update ".safe_pfx($table)." set $set where $where";
+		if ($r = safe_query($q,$debug)) {
+			return true;
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function safe_insert($table,$set,$debug='') 
+	{
+		global $DB;
+		$q = "insert into ".safe_pfx($table)." set $set";
+		if ($r = safe_query($q,$debug)) {
+			$id = mysql_insert_id($DB->link);
+			return ($id === 0 ? true : $id);
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+// insert or update
+	function safe_upsert($table,$set,$where,$debug='') 
+	{
+		// FIXME: lock the table so this is atomic?
+		$r = safe_update($table, $set, $where, $debug);
+		if ($r and mysql_affected_rows())
+			return $r;
+		else
+			return safe_insert($table, join(', ', array($where, $set)), $debug);
+	}
+
+// -------------------------------------------------------------
+	function safe_alter($table, $alter, $debug='') 
+	{
+		$q = "alter table ".safe_pfx($table)." $alter";
+		if ($r = safe_query($q,$debug)) {
+			return true;
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function safe_optimize($table, $debug='') 
+	{
+		$q = "optimize table ".safe_pfx($table)."";
+		if ($r = safe_query($q,$debug)) {
+			return true;
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function safe_repair($table, $debug='') 
+	{
+		$q = "repair table ".safe_pfx($table)."";
+		if ($r = safe_query($q,$debug)) {
+			return true;
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function safe_field($thing, $table, $where, $debug='') 
+	{
+		$q = "select $thing from ".safe_pfx_j($table)." where $where";
+		$r = safe_query($q,$debug);
+		if (@mysql_num_rows($r) > 0) {
+			$f = mysql_result($r,0);
+			mysql_free_result($r);
+			return $f;
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function safe_column($thing, $table, $where, $debug='') 
+	{
+		$q = "select $thing from ".safe_pfx_j($table)." where $where";
+		$rs = getRows($q,$debug);
+		if ($rs) {
+			foreach($rs as $a) {
+				$v = array_shift($a);
+				$out[$v] = $v;
+			}
+			return $out;
+		}
+		return array();
+	}
+
+// -------------------------------------------------------------
+	function safe_row($things, $table, $where, $debug='') 
+	{
+		$q = "select $things from ".safe_pfx_j($table)." where $where";
+		$rs = getRow($q,$debug);
+		if ($rs) {
+			return $rs;
+		}
+		return array();
+	}
+
+
+// -------------------------------------------------------------
+	function safe_rows($things, $table, $where, $debug='') 
+	{
+		$q = "select $things from ".safe_pfx_j($table)." where $where";
+		$rs = getRows($q,$debug);
+		if ($rs) {
+			return $rs;
+		}
+		return array();
+	}
+
+// -------------------------------------------------------------
+	function safe_rows_start($things, $table, $where, $debug='') 
+	{
+		$q = "select $things from ".safe_pfx_j($table)." where $where";
+		return startRows($q,$debug);
+	}
+
+//-------------------------------------------------------------
+	function safe_count($table, $where, $debug='') 
+	{
+		return getThing("select count(*) from ".safe_pfx_j($table)." where $where",$debug);
+	}
+
+// -------------------------------------------------------------
+	function safe_show($thing, $table, $debug='') 
+	{
+		$q = "show $thing from ".safe_pfx($table)."";
+		$rs = getRows($q,$debug);
+		if ($rs) {
+			return $rs;
+		}
+		return array();
+	}
+
+
+//-------------------------------------------------------------
+	function fetch($col,$table,$key,$val,$debug='') 
+	{
+		$key = doSlash($key);
+		$val = (is_int($val)) ? $val : "'".doSlash($val)."'";
+		$q = "select $col from ".safe_pfx($table)." where `$key` = $val limit 1";
+		if ($r = safe_query($q,$debug)) {
+			$thing = (mysql_num_rows($r) > 0) ? mysql_result($r,0) : '';
+			mysql_free_result($r);
+			return $thing;
+		}
+		return false;
+	}
+
+//-------------------------------------------------------------
+	function getRow($query,$debug='') 
+	{
+		if ($r = safe_query($query,$debug)) {
+			$row = (mysql_num_rows($r) > 0) ? mysql_fetch_assoc($r) : false;
+			mysql_free_result($r);
+			return $row;
+		}
+		return false;
+	}
+
+//-------------------------------------------------------------
+	function getRows($query,$debug='') 
+	{
+		if ($r = safe_query($query,$debug)) {
+			if (mysql_num_rows($r) > 0) {
+				while ($a = mysql_fetch_assoc($r)) $out[] = $a; 
+				mysql_free_result($r);
+				return $out;
+			}
+		}
+		return false;
+	}
+
+//-------------------------------------------------------------
+	function startRows($query,$debug='')
+	{
+		return safe_query($query,$debug);
+	}
+
+//-------------------------------------------------------------
+	function nextRow($r)
+	{
+		$row = mysql_fetch_assoc($r);
+		if ($row === false)
+			mysql_free_result($r);
+		return $row;
+	}
+
+//-------------------------------------------------------------
+	function numRows($r)
+	{
+		return mysql_num_rows($r);
+	}
+
+//-------------------------------------------------------------
+	function getThing($query,$debug='') 
+	{
+		if ($r = safe_query($query,$debug)) {
+			$thing = (mysql_num_rows($r) != 0) ? mysql_result($r,0) : '';
+			mysql_free_result($r);
+			return $thing;
+		}
+		return false;
+	}
+
+//-------------------------------------------------------------
+	function getThings($query,$debug='') 
+	// return values of one column from multiple rows in an num indexed array
+	{
+		$rs = getRows($query,$debug);
+		if ($rs) {
+			foreach($rs as $a) $out[] = array_shift($a);
+			return $out;
+		}
+		return array();
+	}
+	
+//-------------------------------------------------------------
+	function getCount($table,$where,$debug='') 
+	{
+		return getThing("select count(*) from ".safe_pfx_j($table)." where $where",$debug);
+	}
+
+// -------------------------------------------------------------
+	function getTree($root, $type, $where='1=1')
+	{
+
+		$root = doSlash($root);
+		$type = doSlash($type);
+
+		$rs = safe_row(
+			"lft as l, rgt as r",
+			"txp_category",
+			"name='$root' and type = '$type'"
+		);
+
+		if (!$rs) return array();
+		extract($rs);
+
+		$out = array();
+		$right = array(); 
+
+		$rs = safe_rows_start(
+			"id, name, lft, rgt, parent, title",
+			"txp_category",
+			"lft between $l and $r and type = '$type' and name != 'root' and $where order by lft asc"
+		); 
+
+		while ($rs and $row = nextRow($rs)) {
+			extract($row);
+			while (count($right) > 0 && $right[count($right)-1] < $rgt) {
+				array_pop($right);
+			}
+
+			$out[] =
+				array(
+					'id' => $id,
+					'name' => $name,
+					'title' => $title,
+					'level' => count($right),
+					'children' => ($rgt - $lft - 1) / 2
+				);
+
+			$right[] = $rgt;
+		}
+		return($out);
+	}
+
+// -------------------------------------------------------------
+	function getTreePath($target, $type)
+	{
+
+		$rs = safe_row(
+			"lft as l, rgt as r",
+			"txp_category",
+			"name='".doSlash($target)."' and type = '".doSlash($type)."'"
+		);
+		if (!$rs) return array();
+		extract($rs);
+
+		$rs = safe_rows_start(
+			"*",
+			"txp_category",
+				"lft <= $l and rgt >= $r and type = '".doSlash($type)."' order by lft asc"
+		);
+
+		$out = array();
+		$right = array();
+
+		while ($rs and $row = nextRow($rs)) {
+			extract($row);
+			while (count($right) > 0 && $right[count($right)-1] < $rgt) {
+				array_pop($right);
+			}
+
+			$out[] =
+				array(
+					'id' => $id,
+					'name' => $name,
+					'title' => $title,
+					'level' => count($right),
+					'children' => ($rgt - $lft - 1) / 2
+				);
+
+			$right[] = $rgt;
+		}
+		return $out;
+	}
+
+// -------------------------------------------------------------
+	function rebuild_tree($parent, $left, $type)
+	{
+		$left  = assert_int($left);
+		$right = $left+1;
+
+		$parent = doSlash($parent);
+		$type   = doSlash($type);
+
+		$result = safe_column("name", "txp_category",
+			"parent='$parent' and type='$type' order by name");
+
+		foreach($result as $row) {
+			$right = rebuild_tree($row, $right, $type);
+		}
+
+		safe_update(
+			"txp_category",
+			"lft=$left, rgt=$right",
+			"name='$parent' and type='$type'"
+		);
+		return $right+1;
+	}
+
+//-------------------------------------------------------------
+	function get_prefs()
+	{
+		$r = safe_rows_start('name, val', 'txp_prefs', 'prefs_id=1');
+		if ($r) {
+			while ($a = nextRow($r)) {
+				$out[$a['name']] = $a['val'];
+			}
+			return $out;
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function db_down()
+	{
+		// 503 status might discourage search engines from indexing or caching the error message
+		header('Status: 503 Service Unavailable');
+		$error = mysql_error();
+		return <<<eod
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+	<title>Untitled</title>
+</head>
+<body>
+<p align="center" style="margin-top:4em">Database unavailable.</p>
+<!-- $error -->
+</body>
+</html>
+eod;
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/lib/txplib_forms.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/txplib_forms.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/txplib_forms.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,251 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/txplib_forms.php $
+$LastChangedRevision: 1887 $
+*/
+
+//-------------------------------------------------------------
+
+	function yesnoRadio($field, $var, $tabindex = '', $id = '')
+	{
+		$id = ($id) ? $id.'-'.$field : $field;
+
+		$vals = array(
+			'0' => gTxt('no'),
+			'1' => gTxt('yes')
+		);
+
+		foreach ($vals as $a => $b)
+		{
+			$out[] = '<input type="radio" id="'.$id.'-'.$a.'" name="'.$field.'" value="'.$a.'" class="radio"';
+			$out[] = ($a == $var) ? ' checked="checked"' : '';
+			$out[] = ($tabindex) ? ' tabindex="'.$tabindex.'"' : '';
+			$out[] = ' /><label for="'.$id.'-'.$a.'">'.$b.'</label> ';
+		}
+
+		return join('', $out);
+	}
+
+//-------------------------------------------------------------
+
+	function onoffRadio($field, $var, $tabindex = '', $id = '')
+	{
+		$id = ($id) ? $id.'-'.$field : $field;
+
+		$vals = array(
+			'0' => gTxt('off'),
+			'1' => gTxt('on')
+		);
+
+		foreach ($vals as $a => $b)
+		{
+			$out[] = '<input type="radio" id="'.$id.'-'.$a.'" name="'.$field.'" value="'.$a.'" class="radio"';
+			$out[] = ($a == $var) ? ' checked="checked"' : '';
+			$out[] = ($tabindex) ? ' tabindex="'.$tabindex.'"' : '';
+			$out[] = ' /><label for="'.$id.'-'.$a.'">'.$b.'</label> ';
+		}
+
+		return join('', $out);
+	}
+
+//-------------------------------------------------------------
+
+	function selectInput($name = '', $array = '', $value = '', $blank_first = '', $onchange = '', $select_id = '')
+	{
+		$out = array();
+
+		$selected = false;
+
+		foreach ($array as $avalue => $alabel)
+		{
+			if ($avalue == $value || $alabel == $value)
+			{
+				$sel = ' selected="selected"';
+				$selected = true;
+			}
+
+			else
+			{
+				$sel = '';
+			}
+
+			$out[] = n.t.'<option value="'.htmlspecialchars($avalue).'"'.$sel.'>'.htmlspecialchars($alabel).'</option>';
+		}
+
+		return '<select'.( $select_id ? ' id="'.$select_id.'"' : '' ).' name="'.$name.'" class="list"'.
+			($onchange == 1 ? ' onchange="submit(this.form);"' : $onchange).
+			'>'.
+			($blank_first ? n.t.'<option value=""'.($selected == false ? ' selected="selected"' : '').'></option>' : '').
+			( $out ? join('', $out) : '').
+			n.'</select>';
+	}
+
+//-------------------------------------------------------------
+
+	function treeSelectInput($select_name = '', $array = '', $value = '', $select_id = '')
+	{
+		$out = array();
+
+		$selected = false;
+
+		foreach ($array as $a)
+		{
+			if ($a['name'] == 'root')
+			{
+				continue;
+			}
+
+			extract($a);
+
+			if ($name == $value)
+			{
+				$sel = ' selected="selected"';
+				$selected = true;
+			}
+
+			else
+			{
+				$sel = '';
+			}
+
+			$sp = str_repeat(sp.sp, $level);
+
+			$out[] = n.t.'<option value="'.htmlspecialchars($name).'"'.$sel.'>'.$sp.htmlspecialchars($title).'</option>';
+		}
+
+		return n.'<select'.( $select_id ? ' id="'.$select_id.'" ' : '' ).' name="'.$select_name.'" class="list">'.
+			n.t.'<option value=""'.($selected == false ? ' selected="selected"' : '').'>&nbsp;</option>'.
+			( $out ? join('', $out) : '').
+			n.'</select>';
+	}
+
+//-------------------------------------------------------------
+	function fInput($type, 		          // generic form input
+					$name,
+					$value,
+					$class='',
+					$title='',
+					$onClick='',
+					$size='',
+					$tab='',
+					$id='') 
+	{
+		$o  = '<input type="'.$type.'" name="'.$name.'"'; 
+		$o .= ' value="'.cleanfInput($value).'"';
+		$o .= ($size)    ? ' size="'.$size.'"' : '';
+		$o .= ($class)   ? ' class="'.$class.'"' : '';
+		$o .= ($title)   ? ' title="'.$title.'"' : '';
+		$o .= ($onClick) ? ' onclick="'.$onClick.'"' : '';
+		$o .= ($tab)     ? ' tabindex="'.$tab.'"' : '';
+		$o .= ($id)      ? ' id="'.$id.'"' : '';
+		$o .= " />";
+		return $o;
+	}
+
+// -------------------------------------------------------------
+	function cleanfInput($text) 
+	{
+		return str_replace(
+			array('"',"'","<",">"),
+			array("&#34;","&#39;","&#60;","&#62;"),
+			$text
+		);
+	}
+
+//-------------------------------------------------------------
+	function hInput($name,$value)		// hidden form input
+	{
+		return fInput('hidden',$name,$value);
+	}
+
+//-------------------------------------------------------------
+	function sInput($step)				// hidden step input
+	{
+		return hInput('step',$step);
+	}
+	
+//-------------------------------------------------------------
+	function eInput($event)				// hidden event input
+	{
+		return hInput('event',$event);
+	}
+	
+//-------------------------------------------------------------
+
+	function checkbox($name, $value, $checked = '1', $tabindex = '', $id = '')
+	{
+		$o[] = '<input type="checkbox" name="'.$name.'" value="'.$value.'"';
+		$o[] = ($id) ? ' id="'.$id.'"' : '';
+		$o[] = ($checked == '1') ? ' checked="checked"' : '';
+		$o[] = ($tabindex) ? ' tabindex="'.$tabindex.'"' : '';
+		$o[] = ' class="checkbox" />';
+
+		return join('', $o);
+	}
+
+//-------------------------------------------------------------
+
+	function checkbox2($name, $value, $tabindex = '', $id = '')
+	{
+		$o[] = '<input type="checkbox" name="'.$name.'" value="1"';
+		$o[] = ($id) ? ' id="'.$id.'"' : '';
+		$o[] = ($value == '1') ? ' checked="checked"' : '';
+		$o[] = ($tabindex) ? ' tabindex="'.$tabindex.'"' : '';
+		$o[] = ' class="checkbox" />';
+
+		return join('', $o);
+	}
+
+//-------------------------------------------------------------
+
+	function radio($name, $value, $checked = '1', $id = '', $tabindex = '')
+	{
+		$o[] = '<input type="radio" name="'.$name.'" value="'.$value.'"';
+		$o[] = ($id) ? ' id="'.$id.'"' : '';
+		$o[] = ($checked == '1') ? ' checked="checked"' : '';
+		$o[] = ($tabindex) ? ' tabindex="'.$tabindex.'"' : '';
+		$o[] = ' class="radio" />';
+
+		return join('', $o);
+	}
+
+//-------------------------------------------------------------
+	function form($contents,$style='',$onsubmit='')
+	{	
+		$style = ($style) ? ' style="'.$style.'"' : '';
+		$onsubmit = ($onsubmit) ? ' onsubmit="return '.$onsubmit.'"' : '';
+		return "\n".'<form action="index.php" method="post"'.$style.$onsubmit.'>'.$contents.'</form>'."\n";
+	}
+
+// -------------------------------------------------------------
+	function fetch_editable($name,$event,$identifier,$id)
+	{	
+		$q = fetch($name,'txp_'.$event,$identifier,$id);
+		return htmlspecialchars($q);
+	}
+
+//-------------------------------------------------------------
+
+	function text_area($name, $h, $w, $thing = '', $id = '')
+	{
+		$id = ($id) ? ' id="'.$id.'"' : '';
+		return '<textarea'.$id.' name="'.$name.'" cols="40" rows="5" style="width:'.$w.'px; height:'.$h.'px;">'.$thing.'</textarea>';
+	}
+
+//-------------------------------------------------------------
+	function type_select($options)
+	{
+		return '<select name="type">'.n.type_options($options).'</select>'.n;
+	}
+
+//-------------------------------------------------------------
+	function type_options($array)
+	{
+		foreach($array as $a=>$b) {
+			$out[] = t.'<option value="'.$a.'">'.gTxt($b).'</option>'.n;
+		}
+		return join('',$out);
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/lib/txplib_head.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/txplib_head.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/txplib_head.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,316 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/txplib_head.php $
+$LastChangedRevision: 1887 $
+*/
+
+// -------------------------------------------------------------
+	function pagetop($pagetitle,$message="")
+	{
+		global $css_mode,$siteurl,$sitename,$txp_user,$event;
+		$area = gps('area');
+		$event = (!$event) ? 'article' : $event;
+		$bm = gps('bm');
+
+		$privs = safe_field("privs", "txp_users", "name = '".doSlash($txp_user)."'");
+		
+		$GLOBALS['privs'] = $privs;
+
+		$areas = areas();
+		foreach ($areas as $k=>$v) {
+			if (in_array($event, $v))
+				$area = $k;
+		}
+		
+	?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+			"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+	<head>
+	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+	<meta name="robots" content="noindex, nofollow" />
+	<title>Txp &#8250; <?php echo $sitename ?> &#8250; <?php echo $pagetitle?></title>
+	<link href="textpattern.css" rel="Stylesheet" type="text/css" />
+	<script type="text/javascript" src="textpattern.js"></script>
+	<script type="text/javascript">
+	<!--
+
+		var cookieEnabled = checkCookies();
+
+		if (!cookieEnabled)
+		{
+			confirm('<?php echo trim(gTxt('cookies_must_be_enabled')); ?>');
+		}	
+	
+<?php
+
+	if ($event == 'list')
+	{
+		$sarr = array("\n", '-');
+		$rarr = array('', '&#45;'); 
+
+		$sections = '';
+
+		$rs = safe_column('name', 'txp_section', "name != 'default'");
+
+		if ($rs)
+		{
+			$sections = str_replace($sarr, $rarr, addslashes(selectInput('Section', $rs, '', true)));
+		}
+
+		$category1 = '';
+		$category2 = '';
+
+		$rs = getTree('root', 'article');
+
+		if ($rs)
+		{
+			$category1 = str_replace($sarr, $rarr, addslashes(treeSelectInput('Category1', $rs, '')));
+			$category2 = str_replace($sarr, $rarr, addslashes(treeSelectInput('Category2', $rs, '')));
+		}
+
+		$statuses = str_replace($sarr, $rarr, addslashes(selectInput('Status', array(
+			1 => gTxt('draft'),
+			2 => gTxt('hidden'),
+			3 => gTxt('pending'),
+			4 => gTxt('live'),
+			5 => gTxt('sticky'),
+		), '', true)));
+
+		$comments_annotate = addslashes(onoffRadio('Annotate', safe_field('val', 'txp_prefs', "name = 'comments_on_default'")));
+
+		$authors = '';
+
+		$rs = safe_column('name', 'txp_users', "privs not in(0,6)");
+
+		if ($rs)
+		{
+			$authors = str_replace($sarr, $rarr, addslashes(selectInput('AuthorID', $rs, '', true)));
+		}
+
+		// output JavaScript
+?>
+		function poweredit(elm)
+		{
+			var something = elm.options[elm.selectedIndex].value;
+
+			// Add another chunk of HTML
+			var pjs = document.getElementById('js');
+
+			if (pjs == null)
+			{
+				var br = document.createElement('br');
+				elm.parentNode.appendChild(br);
+
+				pjs = document.createElement('P');
+				pjs.setAttribute('id','js');
+				elm.parentNode.appendChild(pjs);
+			}
+
+			if (pjs.style.display == 'none' || pjs.style.display == '')
+			{
+				pjs.style.display = 'block';
+			}
+
+			if (something != '')
+			{
+				switch (something)
+				{
+					case 'changesection':
+						var sections = '<?php echo $sections; ?>';
+						pjs.innerHTML = '<span><?php echo gTxt('section') ?>: '+sections+'</span>';
+					break;
+
+					case 'changecategory1':
+						var categories = '<?php echo $category1; ?>';
+						pjs.innerHTML = '<span><?php echo gTxt('category1') ?>: '+categories+'</span>';
+					break;
+
+					case 'changecategory2':
+						var categories = '<?php echo $category2; ?>';
+						pjs.innerHTML = '<span><?php echo gTxt('category2') ?>: '+categories+'</span>';
+					break;
+
+					case 'changestatus':
+						var statuses = '<?php echo $statuses; ?>';
+						pjs.innerHTML = '<span><?php echo gTxt('status') ?>: '+statuses+'</span>';
+					break;
+
+					case 'changecomments':
+						var comments = '<?php echo $comments_annotate; ?>';
+						pjs.innerHTML = '<span><?php echo gTxt('comments'); ?>: '+comments+'</span>';
+					break;
+
+					case 'changeauthor':
+						var authors = '<?php echo $authors; ?>';
+						pjs.innerHTML = '<span><?php echo gTxt('author'); ?>: '+authors+'</span>';
+					break;
+
+					default:
+						pjs.style.display = 'none';
+					break;
+				}
+			}
+
+			return false;
+		}
+
+		addEvent(window, 'load', cleanSelects);
+<?php
+	}
+?>
+	-->
+	</script>
+	</head>
+	<body>
+  <table cellpadding="0" cellspacing="0" width="100%" style="margin-bottom:2em">
+  <tr><td align="left" style="background:#FFCC33"><img src="txp_img/textpattern.gif" height="15" width="368" alt="textpattern" /></td><td style="background:#FFCC33" align="right"><?php echo navPop(1); ?></td></tr>
+  <tr><td align="center" class="tabs" colspan="2">
+ 		<?php
+ 		if (!$bm) {
+			echo '<table cellpadding="0" cellspacing="0" align="center"><tr>
+  <td valign="middle" style="width:368px">&nbsp;'.$message.'</td>',
+  			
+			has_privs('tab.content')
+			? areatab(gTxt('tab_content'), 'content', 'article', $area)
+			: '',
+			has_privs('tab.presentation')
+			?	areatab(gTxt('tab_presentation'), 'presentation', 'page', $area)
+			:	'',
+			has_privs('tab.admin')
+			?	areatab(gTxt('tab_admin'), 'admin', 'admin', $area)
+			:	'',
+			(has_privs('tab.extensions') and !empty($areas['extensions']))
+			?	areatab(gTxt('tab_extensions'), 'extensions', array_shift($areas['extensions']), $area)
+			:	'',
+
+			'<td class="tabdown"><a href="'.hu.'" class="plain" target="blank">'.gTxt('tab_view_site').'</a></td>',
+		 '</tr></table>',
+		
+		'</td></tr><tr><td align="center" class="tabs" colspan="2">
+			<table cellpadding="0" cellspacing="0" align="center"><tr>',
+				tabsort($area,$event),
+			'</tr></table>';
+		}
+		echo '</td></tr></table>';
+	}
+
+// -------------------------------------------------------------
+	function areatab($label,$event,$tarea,$area) 
+	{
+		$tc = ($area == $event) ? 'tabup' : 'tabdown';
+		$atts=' class="'.$tc.'" onclick="window.location.href=\'?event='.$tarea.'\'"';
+		$hatts=' href="?event='.$tarea.'" class="plain"';
+      	return tda(tag($label,'a',$hatts),$atts);
+	}
+
+// -------------------------------------------------------------
+	function tabber($label,$tabevent,$event) 
+	{		
+		$tc = ($event==$tabevent) ? 'tabup' : 'tabdown2';
+		$out = '<td class="'.$tc.'" onclick="window.location.href=\'?event='.$tabevent.'\'" ><a href="?event='.$tabevent.'" class="plain">'.$label.'</a></td>';
+      	return $out;
+	}
+
+// -------------------------------------------------------------
+	function tabsort($area,$event) 
+	{
+		$areas = areas();
+		foreach($areas[$area] as $a=>$b) {
+			if (has_privs($b)) {
+				$out[] = tabber($a,$b,$event,2);
+			}
+		}
+		return (empty($out) ? '' : join('',$out));
+	}
+
+// -------------------------------------------------------------
+	function areas() 
+	{
+		global $privs, $plugin_areas;
+		
+		$areas['content'] = array(
+			gTxt('tab_organise') => 'category',
+			gTxt('tab_write')    => 'article',
+			gTxt('tab_list')    =>  'list',
+			gTxt('tab_image')    => 'image',
+			gTxt('tab_file')	 => 'file',			
+			gTxt('tab_link')     => 'link',
+			gTxt('tab_comments') => 'discuss'
+		);
+		
+		$areas['presentation'] = array(
+			gTxt('tab_sections') => 'section',
+			gTxt('tab_pages')    => 'page',
+			gTxt('tab_forms')    => 'form',
+			gTxt('tab_style')    => 'css'
+		);
+
+		$areas['admin'] = array(
+			gTxt('tab_diagnostics') => 'diag',
+			gTxt('tab_preferences') => 'prefs',
+			gTxt('tab_site_admin')  => 'admin',
+			gTxt('tab_logs')        => 'log',
+			gTxt('tab_plugins')     => 'plugin',
+			gTxt('tab_import')      => 'import'
+		);	
+
+		$areas['extensions'] = array(
+		);
+
+		if (is_array($plugin_areas))
+			$areas = array_merge_recursive($areas, $plugin_areas);
+
+		return $areas;	
+	}
+
+// -------------------------------------------------------------
+
+	function navPop($inline = '')
+	{
+		$areas = areas();
+
+		$out = array();
+
+		foreach ($areas as $a => $b)
+		{
+			if (!has_privs( 'tab.'.$a))
+			{
+				continue;
+			}
+
+			if (count($b) > 0)
+			{
+				$out[] = n.t.'<optgroup label="'.gTxt('tab_'.$a).'">';
+
+				foreach ($b as $c => $d)
+				{
+					if (has_privs($d))
+					{
+						$out[] = n.t.t.'<option value="'.$d.'">'.$c.'</option>';
+					}
+				}
+
+				$out[] = n.t.'</optgroup>';
+			}
+		}
+
+		if ($out)
+		{
+			$style = ($inline) ? ' style="display: inline;"': '';
+
+			return '<form method="get" action="index.php"'.$style.'>'.
+				n.'<select name="event" onchange="submit(this.form);">'.
+				n.t.'<option>'.gTxt('go').'&#8230;</option>'.
+				join('', $out).
+				n.'</select>'.
+				n.'</form>';
+		}
+	}
+
+// -------------------------------------------------------------
+	function button($label,$link) 
+	{
+		return '<span style="margin-right:2em"><a href="?event='.$link.'" class="plain">'.$label.'</a></span>';
+	}
+?>

Added: trunk/www.openmoko.com/textpattern/lib/txplib_html.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/txplib_html.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/txplib_html.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,609 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/txplib_html.php $
+$LastChangedRevision: 1937 $
+*/
+	
+	define("t","\t");
+	define("n","\n");
+	define("br","<br />");
+	define("sp","&#160;");
+	define("a","&#38;");
+
+// -------------------------------------------------------------
+	function end_page()
+	{
+		global $txp_user,$event;
+		if($event!='tag') {
+			echo '<div style="text-align:center;margin:4em">',
+			navPop(),
+			'<a href="http://www.textpattern.com"><img src="txp_img/carver.gif" width="60" height="48" border="0" alt="" /></a>';
+			echo graf('Textpattern &#183; '.txp_version);
+			echo($txp_user)
+			?	graf(gTxt('logged_in_as').' '.$txp_user.br.
+					'<a href="index.php?logout=1">'.gTxt('logout').'</a>').'</div>'
+			:	'</div>';
+			echo n.'</body>'.n.'</html>';
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function column_head($value, $sort = '', $event = '', $is_link = '', $dir = '', $crit = '', $method = '', $class = '')
+	{
+		return column_multi_head( array(
+					array ('value' => $value, 'sort' => $sort, 'event' => $event, 'is_link' => $is_link,
+						   'dir' => $dir, 'crit' => $crit, 'method' => $method)
+				), $class);
+	}
+
+// -------------------------------------------------------------
+
+	function column_multi_head($head_items, $class='')
+	{
+		$o = n.t.'<th'.($class ? ' class="'.$class.'"' : '').'>';
+		$first_item = true;
+		foreach ($head_items as $item)
+		{
+			if (empty($item)) continue;
+			extract(lAtts(array(
+				'value'		=> '',
+				'sort'		=> '',
+				'event'		=> '',
+				'is_link'	=> '',
+				'dir'		=> '',
+				'crit'		=> '',
+				'method'	=> '',
+			),$item));	
+
+			$o .= ($first_item) ? '' : ', '; $first_item = false;
+
+			if ($is_link)
+			{
+				$o .= '<a href="index.php?step=list';
+
+				$o .= ($event) ? a."event=$event" : '';
+				$o .= ($sort) ? a."sort=$sort" : '';
+				$o .= ($dir) ? a."dir=$dir" : '';
+				$o .= ($crit) ? a."crit=$crit" : '';
+				$o .= ($method) ? a."search_method=$method" : '';
+
+				$o .= '">';
+			}
+
+			$o .= gTxt($value);
+
+			if ($is_link)
+			{
+				$o .= '</a>';
+			}
+		}
+		$o .= '</th>';
+
+		return $o;
+	}
+
+// -------------------------------------------------------------
+	function hCell($text="",$caption="")
+	{
+		$text = (!$text) ? sp : $text;
+		return tag($text,'th');
+	}
+	
+// -------------------------------------------------------------
+	function sLink($event,$step,$linktext,$class='')
+	{
+		$c = ($class) ? ' class="'.$class.'"' : '';
+		return '<a href="?event='.$event.a.'step='.$step.'"'.$c.'>'.$linktext.'</a>';
+	}
+
+// -------------------------------------------------------------
+	function eLink($event,$step='',$thing='',$value='',$linktext,$thing2='',$val2='')
+	{
+		return join('',array(
+			'<a href="?event='.$event,
+			($step) ? a.'step='.$step : '',
+			($thing) ? a.''.$thing.'='.urlencode($value) : '',
+			($thing2) ? a.''.$thing2.'='.urlencode($val2) : '',
+			'">'.escape_title($linktext).'</a>'
+		));
+	}
+
+// -------------------------------------------------------------
+	function wLink($event,$step='',$thing='',$value='')
+	{
+		return join('',array(
+			'<a href="index.php?event='.$event,
+			($step) ? a.'step='.$step : '',
+			($thing) ? a.''.$thing.'='.urlencode($value) : '',
+			'" class="dlink">'.sp.'!'.sp.'</a>'
+		));
+	}
+
+// -------------------------------------------------------------
+	function dLink($event,$step,$thing,$value,$verify='',$thing2='',$thing2val='',$get='')
+	{
+		if ($get) {
+			return join('',array(
+				'<a href="?event='.$event.a.'step='.$step.a.$thing.'='.urlencode($value),
+				($thing2) ? a.$thing2.'='.$thing2val : '',
+				'"',
+				' class="dlink"',
+				' onclick="return verify(\'',
+				($verify) ? gTxt($verify) : gTxt('confirm_delete_popup'),
+				'\')">&#215;</a>'
+			));
+		}
+
+		return join('',array(
+			'<form action="index.php" method="post" onsubmit="return confirm(\''.gTxt('confirm_delete_popup').'\');">',
+			fInput('submit','','&#215;','smallerbox'),
+			eInput($event).sInput($step),
+			hInput($thing,$value),
+			($thing2) ? hInput($thing2,$thing2val) : '',
+			'</form>'));
+	}
+
+// -------------------------------------------------------------
+	function aLink($event,$step,$thing,$value,$thing2,$value2)
+	{
+		$o = '<a href="?event='.$event.a.'step='.$step.
+			a.$thing.'='.urlencode($value).a.$thing2.'='.urlencode($value2).'"';
+		$o.= ' class="alink">+</a>';
+		return $o;
+	}
+
+// -------------------------------------------------------------
+	function prevnext_link($name,$event,$step,$id,$titling='')
+	{
+		return '<a href="?event='.$event.a.'step='.$step.a.'ID='.$id.
+			'" class="navlink" title="'.$titling.'">'.$name.'</a> ';
+	}
+
+// -------------------------------------------------------------
+
+	function PrevNextLink($event, $page, $label, $type, $sort = '', $dir = '', $crit = '', $method = '')
+	{
+		return '<a href="?event='.$event.a.'step=list'.a.'page='.$page.
+			($sort ? a.'sort='.$sort : '').
+			($dir ? a.'dir='.$dir : '').
+			($crit ? a.'crit='.$crit : '').
+			($method ? a.'method='.$method : '').
+			'" class="navlink">'.
+			($type == 'prev' ? '&#8249;'.sp.$label : $label.sp.'&#8250;').
+			'</a>';
+	}
+
+// -------------------------------------------------------------
+
+	function nav_form($event, $page, $numPages, $sort, $dir, $crit, $search_method)
+	{
+		if ($numPages > 1)
+		{
+			$option_list = array();
+	
+			for ($i = 1; $i <= $numPages; $i++)
+			{
+				if ($i == $page)
+				{
+					$option_list[] = '<option value="'.$i.'" selected="selected">'."$i/$numPages".'</option>';
+				}
+	
+				else
+				{
+					$option_list[] = '<option value="'.$i.'">'."$i/$numPages".'</option>';
+				}
+			}
+
+			$nav = array();
+
+			$nav[] = ($page > 1) ? 
+				PrevNextLink($event, $page - 1, gTxt('prev'), 'prev', $sort, $dir, $crit, $search_method).sp : 
+				tag('&#8249; '.gTxt('prev'), 'span', ' class="navlink-disabled"').sp;
+
+			$nav[] = '<select name="page" class="list" onchange="submit(this.form);">';
+			$nav[] = n.join(n, $option_list);
+			$nav[] = n.'</select>';
+			$nav[] = '<noscript> <input type="submit" value="'.gTxt('go').'" class="smallerbox" /></noscript>';
+
+			$nav[] = ($page != $numPages) ? 
+				sp.PrevNextLink($event, $page + 1, gTxt('next'), 'next', $sort, $dir, $crit, $search_method) : 
+				sp.tag(gTxt('next').' &#8250;', 'span', ' class="navlink-disabled"');
+
+			return '<form class="prev-next" method="get" action="index.php">'.
+				n.eInput($event).
+				( $sort ? n.hInput('sort', $sort).n.hInput('dir', $dir) : '' ).
+				( $crit ? n.hInput('crit', $crit).n.hInput('search_method', $search_method) : '' ).
+				join('', $nav).
+				'</form>';
+		}
+
+		else
+		{
+			return graf($page.'/'.$numPages, ' class="prev-next"');
+		}
+	}
+
+// -------------------------------------------------------------
+	function startSkelTable()
+	{
+		return 
+		'<table width="300" cellpadding="0" cellspacing="0" style="border:1px #ccc solid">';
+	}
+
+// -------------------------------------------------------------
+	function startTable($type,$align='',$class='',$p='',$w='')
+	{
+		if (!$p) $p = ($type=='edit') ? 3 : 0;
+		$align = (!$align) ? 'center' : $align;
+		$class = ($class) ? ' class="'.$class.'"' : '';
+		$width = ($w) ? ' width="'.$w.'"' : '';
+		return '<table cellpadding="'.$p.'" cellspacing="0" border="0" id="'.
+			$type.'" align="'.$align.'"'.$class.$width.'>'.n;
+	}
+	
+// -------------------------------------------------------------
+	function endTable ()
+	{
+		return n.'</table>'.n;
+	}
+	
+// -------------------------------------------------------------
+	function stackRows() 
+	{
+		foreach(func_get_args() as $a) { $o[] = tr($a); }
+		return join('',$o);
+	}
+	
+// -------------------------------------------------------------
+	function td($content='',$width='',$class='',$id='')
+	{
+		$content = (!$content) ? '&#160;' : $content;
+		$atts[] = ($width)  ? ' width="'.$width.'"' : '';
+		$atts[] = ($class)  ? ' class="'.$class.'"' : '';
+		$atts[] = ($id)  ? ' id="'.$id.'"' : '';
+		return t.tag($content,'td',join('',$atts)).n;
+	}
+
+// -------------------------------------------------------------
+	function tda($content,$atts='')
+	{
+		return tag($content,'td',$atts);
+	}
+
+// -------------------------------------------------------------
+	function tdtl($content,$atts='')
+	{
+		return tag($content,'td',' style="vertical-align:top;text-align:left;padding:8px"'.$atts);
+	}
+
+// -------------------------------------------------------------
+	function tr($content,$atts='')
+	{
+		return tag($content,'tr',$atts);
+	}
+
+// -------------------------------------------------------------
+	function tdcs($content,$span,$width="",$class='')
+	{
+		return join('',array(
+			t.'<td align="left" valign="top" colspan="'.$span.'"',
+			($width) ? ' width="'.$width.'"' : '',
+			($class) ? ' class="'.$class.'"' : '',
+			">$content</td>\n"
+		));
+	}
+
+// -------------------------------------------------------------
+	function tdrs($content,$span,$width="")
+	{
+		return join('',array(
+			t.'<td align="left" valign="top" rowspan="'.$span.'"',
+			($width) ? ' width="'.$width.'"' : '',">$content</td>".n
+		));
+	}
+
+// -------------------------------------------------------------
+
+	function fLabelCell($text, $help = '', $label_id = '') 
+	{
+		$help = ($help) ? popHelp($help) : '';
+
+		$cell = gTxt($text).' '.$help;
+
+		if ($label_id)
+		{
+			$cell = '<label for="'.$label_id.'">'.$cell.'</label>';
+		}
+
+		return tda($cell,' class="noline" style="text-align: right; vertical-align: middle;"');
+	}
+
+// -------------------------------------------------------------
+
+	function fInputCell($name, $var = '', $tabindex = '', $size = '', $help = '', $id = '') 
+	{
+		$pop = ($help) ? sp.popHelp($name) : '';
+
+		return tda(
+			fInput('text', $name, $var, 'edit', '', '', $size, $tabindex, $id).$pop
+		,' class="noline"');
+	}
+
+// -------------------------------------------------------------
+	function tag($content,$tag,$atts='') 
+	{
+		return ($content) ? '<'.$tag.$atts.'>'.$content.'</'.$tag.'>' : '';
+	}
+
+// -------------------------------------------------------------
+	function graf ($item,$atts='') 
+	{
+		return tag($item,'p',$atts);
+	}
+
+// -------------------------------------------------------------
+	function hed($item,$level,$atts='') 
+	{
+		return tag($item,'h'.$level,$atts);
+	}
+
+// -------------------------------------------------------------
+	function href($item,$href) 
+	{
+		return tag($item,'a',' href="'.$href.'"');
+	}
+
+// -------------------------------------------------------------
+	function strong($item)
+	{
+		return tag($item,'strong');
+	}	
+
+// -------------------------------------------------------------
+	function htmlPre($item)
+	{
+		return '<pre>'.tag($item,'code').'</pre>';
+	}	
+
+// -------------------------------------------------------------
+	function comment($item)
+	{
+		return '<!-- '.$item.' -->';
+	}	
+
+// -------------------------------------------------------------
+	function small($item)
+	{
+		return tag($item,'small');
+	}	
+
+// -------------------------------------------------------------
+	function assRow($array, $atts ='')
+	{
+		foreach($array as $a => $b) $o[] = tda($a,' width="'.$b.'"');
+		return tr(join(n.t,$o), $atts);
+	}
+	
+// -------------------------------------------------------------
+	function assHead()
+	{
+		$array = func_get_args();
+		foreach($array as $a) $o[] = hCell(gTxt($a));
+		return tr(join('',$o));
+	}
+
+// -------------------------------------------------------------
+
+	function popHelp($help_var, $width = '', $height = '') 
+	{
+		$lang = (LANG == 'cs-cz' || LANG == 'el-gr' || LANG == 'ja-jp') ? 
+			substr(LANG, 3, 2): substr(LANG, 0, 2);
+
+		return '<a target="_blank"'.
+			' href="http://rpc.textpattern.com/help/?item='.$help_var.a.'lang='.$lang.'"'.
+			' onclick="popWin(this.href'.
+			($width ? ', '.$width : '').
+			($height ? ', '.$height : '').
+			'); return false;" class="pophelp">?</a>';
+	}
+
+// -------------------------------------------------------------
+
+	function popHelpSubtle($help_var, $width = '', $height = '') 
+	{
+		$lang = (LANG == 'cs-cz' || LANG == 'el-gr' || LANG == 'ja-jp') ? 
+			substr(LANG, 3, 2): substr(LANG, 0, 2);
+
+		return '<a target="_blank"'.
+			' href="http://rpc.textpattern.com/help/?item='.$help_var.a.'lang='.$lang.'"'.
+			' onclick="popWin(this.href'.
+			($width ? ', '.$width : '').
+			($height ? ', '.$height : '').
+			'); return false;">?</a>';
+	}
+
+// -------------------------------------------------------------
+
+	function popTag($var, $text, $width = '', $height = '') 
+	{
+		return '<a target="_blank"'.
+			' href="?event=tag'.a.'tag_name='.$var.'"'.
+			' onclick="popWin(this.href'.
+			($width ? ', '.$width : '').
+			($height ? ', '.$height : '').
+			'); return false;">'.$text.'</a>';
+	}
+	
+// -------------------------------------------------------------
+
+	function popTagLinks($type) 
+	{
+		global $txpcfg;
+
+		include txpath.'/lib/taglib.php';
+
+		$arname = $type.'_tags';
+
+		$out = array();
+
+		$out[] = n.'<ul class="plain-list small">';
+
+		foreach ($$arname as $a)
+		{
+			$out[] = n.t.tag(popTag($a,gTxt('tag_'.$a)), 'li');
+		}
+
+		$out[] = n.'</ul>';
+
+		return join('', $out);
+	}
+
+//-------------------------------------------------------------
+	function messenger($thing,$thething,$action)
+	{
+		return gTxt($thing).' '.strong($thething).' '.gTxt($action);
+	}
+
+// -------------------------------------------------------------
+
+	function pageby_form($event, $val) 
+	{
+		$vals = array(
+			15  => 15, 
+			25  => 25, 
+			50  => 50,
+			100 => 100
+		);
+
+		$select_page = selectInput('qty', $vals, $val,'', 1);
+
+		// proper localisation
+		$page = str_replace('{page}', $select_page, gTxt('view_per_page'));
+
+		return form(
+			'<div style="margin: auto; text-align: center;">'.
+				$page.
+				eInput($event).
+				sInput($event.'_change_pageby').
+				'<noscript> <input type="submit" value="'.gTxt('go').'" class="smallerbox" /></noscript>'.
+			'</div>'
+		);
+	}
+// -------------------------------------------------------------
+
+	function upload_form($label, $pophelp, $step, $event, $id = '', $max_file_size = '1000000', $label_id = '', $class = 'upload-form')
+	{
+		global $sort, $dir, $page, $search_method, $crit;
+
+		$class = ($class) ? ' class="'.$class.'"' : '';
+
+		$label_id = ($label_id) ? $label_id : $event.'-upload';
+
+		return n.n.'<form'.$class.' method="post" enctype="multipart/form-data" action="index.php">'.
+			n.'<div>'.
+
+			(!empty($max_file_size)? n.hInput('MAX_FILE_SIZE', $max_file_size): '').
+			n.eInput($event).
+			n.sInput($step).
+			n.hInput('id', $id).
+
+			n.hInput('sort', $sort).
+			n.hInput('dir', $dir).
+			n.hInput('page', $page).
+			n.hInput('search_method', $search_method).
+			n.hInput('crit', $crit).
+
+			n.graf(
+				'<label for="'.$label_id.'">'.$label.'</label>'.sp.popHelp($pophelp).sp.
+					fInput('file', 'thefile', '', 'edit', '', '', '', '', $label_id).sp.
+					fInput('submit', '', gTxt('upload'), 'smallerbox')
+			).
+
+			n.'</div>'.
+			n.'</form>';
+	}
+
+//-------------------------------------------------------------
+
+	function search_form($event, $step, $crit, $methods, $method, $default_method)
+	{
+		$method = ($method) ? $method : $default_method;
+
+		return n.n.form(
+			graf(
+				'<label for="'.$event.'-search">'.gTxt('search').'</label>'.sp.
+				selectInput('search_method', $methods, $method, '', '', $event.'-search').sp.
+				fInput('text', 'crit', $crit, 'edit', '', '', '15').
+				eInput($event).
+				sInput($step).
+				fInput('submit', 'search', gTxt('go'), 'smallerbox')
+			)
+		, 'margin: auto; text-align: center;');
+	}
+
+//-------------------------------------------------------------
+
+	function pref_text($name, $val, $id = '')
+	{
+		$id = ($id) ? $id : $name;
+
+		$vals = array(
+			USE_TEXTILE          => gTxt('use_textile'),
+			CONVERT_LINEBREAKS   => gTxt('convert_linebreaks'),
+			LEAVE_TEXT_UNTOUCHED => gTxt('leave_text_untouched')
+		);
+
+		return selectInput($name, $vals, $val, '', '', $id);
+	}
+
+//-------------------------------------------------------------
+	function dom_attach($id, $content, $noscript='', $wraptag='div', $wraptagid='')
+	{
+
+		$c = addcslashes($content, "\r\n\"\'");
+		$c = preg_replace('@<(/?)script@', '\\x3c$1script', $c);
+		$js = <<<EOF
+var e = document.getElementById('{$id}');
+var n = document.createElement('{$wraptag}')
+n.innerHTML = '{$c}'
+n.setAttribute('id','{$wraptagid}');
+e.appendChild(n)
+EOF;
+
+		return script_js($js, $noscript);
+	}
+
+//-------------------------------------------------------------
+	function script_js($js, $noscript='')
+	{
+		$out = '<script type="text/javascript">'.n.
+			'<!--'.n.
+			trim($js).n.
+			'// -->'.n.
+			'</script>'.n;
+		if ($noscript)
+			$out .= '<noscript>'.n.
+				trim($noscript).n.
+				'</noscript>'.n;
+		return $out;
+	}
+
+//-------------------------------------------------------------
+	function toggle_box($classname, $form=0) {
+
+		$name = 'cb_toggle_'.$classname;
+		$i = 
+			'<input type="checkbox" name="'.$name.'" id="'.$name.'" value="1" '.
+			(cs('toggle_'.$classname) ? 'checked="checked" ' : '').
+			'class="checkbox" onclick="toggleClassRemember(\''.$classname.'\');" />'.
+			' <label for="'.$name.'">'.gTxt('detail_toggle').'</label> '.
+			script_js("setClassRemember('".$classname."');addEvent(window, 'load', function(){setClassRemember('".$classname."');});");
+		if ($form)
+			return n.form($i);
+		else
+			return n.$i;
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/lib/txplib_misc.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/txplib_misc.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/txplib_misc.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1898 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/txplib_misc.php $
+$LastChangedRevision: 1956 $
+*/
+
+// -------------------------------------------------------------
+	function doArray($in,$function)
+	{
+		return is_array($in) ? array_map($function,$in) : $function($in); 
+	}
+	
+// -------------------------------------------------------------
+	function doStrip($in)
+	{ 
+		return doArray($in,'stripslashes'); 
+	}
+
+// -------------------------------------------------------------
+	function doStripTags($in)
+	{ 
+		return doArray($in,'strip_tags'); 
+	}
+
+// -------------------------------------------------------------
+	function doDeEnt($in) 
+	{
+		return doArray($in,'deEntBrackets'); 
+	}
+
+// -------------------------------------------------------------
+	function deEntBrackets($in) 
+	{
+		$array = array(
+			'&#60;'  => '<',
+			'&lt;'   => '<',
+			'&#x3C;' => '<',
+			'&#62;'  => '>',
+			'&gt;'   => '>',
+			'&#x3E;' => '>'
+		);
+		
+		foreach($array as $k=>$v){
+			$in = preg_replace("/".preg_quote($k)."/i",$v, $in);
+		}
+		return $in;
+	}
+
+// -------------------------------------------------------------
+	function doSlash($in)
+	{
+		if(phpversion() >= "4.3.0") {
+			return doArray($in,'mysql_real_escape_string');
+		} else {
+			return doArray($in,'mysql_escape_string');
+		}
+	}
+
+// -------------------------------------------------------------
+	function doSpecial($in)
+	{
+		return doArray($in,'htmlspecialchars');
+	}
+
+// -------------------------------------------------------------
+	function escape_title($title)
+	{
+		return strtr($title,
+			array(
+				'<' => '&#60;',
+				'>' => '&#62;',
+				"'" => '&#39;',
+				'"' => '&#34;',
+			)
+		);
+	}
+
+// -------------------------------------------------------------
+	function escape_output($str)
+	{
+		# should be safe for xhtml and xml
+		return strtr($str,
+			array(
+				'&' => '&#38;',
+				'<' => '&#60;',
+				'>' => '&#62;',
+				"'" => '&#39;',
+				'"' => '&#34;',
+			)
+		);
+	}
+
+// -------------------------------------------------------------
+	function escape_tags($str)
+	{
+		return strtr($str,
+			array(
+				'<' => '&#60;',
+				'>' => '&#62;',
+			)
+		);
+	}
+
+// -------------------------------------------------------------
+	function escape_cdata($str)
+	{
+		return '<![CDATA['.str_replace(']]>', ']]]><![CDATA[]>', $str).']]>';
+	}
+
+//-------------------------------------------------------------
+	function gTxt($var, $atts=array())
+	{
+		global $textarray;
+		if(isset($textarray[strtolower($var)])) {
+			$out = $textarray[strtolower($var)];
+			return strtr($out, $atts);
+		}
+
+		if ($atts)
+			return $var.': '.join(', ', $atts);
+		return $var;
+	}
+
+// -------------------------------------------------------------
+    function dmp() 
+    {
+		$a = func_get_args();
+		echo "<pre>".n;
+		foreach ($a as $thing)
+			echo htmlspecialchars(is_scalar($thing) ? strval($thing) : var_export($thing, true)), n;
+		echo "</pre>".n;
+    }
+
+// -------------------------------------------------------------
+	function load_lang($lang)
+	{
+		global $txpcfg;
+
+		$installed = safe_field('name', 'txp_lang',"lang='".doSlash($lang)."' limit 1");
+
+		$lang_code = ($installed)? $lang : 'en-gb';
+
+		$rs = (txpinterface == 'admin')
+				? safe_rows_start('name, data','txp_lang',"lang='".doSlash($lang_code)."'")
+				: safe_rows_start('name, data','txp_lang',"lang='".doSlash($lang_code)."' AND ( event='public' OR event='common')");
+
+		$out = array();
+
+		if ($rs && mysql_num_rows($rs) > 0)
+		{
+			while ($a = nextRow($rs))
+			{
+				$out[$a['name']] = $a['data'];
+			}
+		}else{
+			#backward compatibility stuff. Remove when necessary.
+			$filename = is_file(txpath.'/lang/'.$lang.'.txt')
+			?	txpath.'/lang/'.$lang.'.txt'
+			:	txpath.'/lang/en-gb.txt';
+
+			$file = @fopen($filename, "r");
+			if ($file) {
+				while (!feof($file)) {
+					$line = fgets($file, 4096);
+				if($line[0]=='#') continue;
+				@list($name,$val) = explode(' => ',trim($line));
+				$out[$name] = $val;
+			 }
+				@fclose($filename);
+			}
+		}
+		
+		return $out;
+	}
+
+// -------------------------------------------------------------
+	function load_lang_dates($lang)
+	{
+		global $txpcfg;
+		$filename = is_file(txpath.'/lang/'.$lang.'_dates.txt')?
+			txpath.'/lang/'.$lang.'_dates.txt':
+			txpath.'/lang/en-gb_dates.txt';
+		$file = @file(txpath.'/lang/'.$lang.'_dates.txt','r');
+		if(is_array($file)) {
+			foreach($file as $line) {
+				if($line[0]=='#' || strlen($line) < 2) continue;
+				list($name,$val) = explode('=>',$line,2);
+				$out[trim($name)] = trim($val);
+			}
+			return $out;
+		} 
+		return false;
+	}
+// -------------------------------------------------------------
+
+	function load_lang_event($event)
+	{		
+		global $txpcfg;
+		$lang = LANG;
+				
+		$installed = safe_field('name', 'txp_lang',"lang='".doSlash($lang)."' limit 1");
+		
+		$lang_code = ($installed)? $lang : 'en-gb';
+				
+		$rs = safe_rows_start('name, data','txp_lang',"lang='".doSlash($lang_code)."' AND event='".doSlash($event)."'");		
+		
+		$out = array();
+		
+		if ($rs && !empty($rs))
+		{
+			while ($a = nextRow($rs))
+			{
+				$out[$a['name']] = $a['data']; 
+			}
+		}		
+		return ($out) ? $out : '';
+	}
+
+// -------------------------------------------------------------
+	function check_privs()
+	{
+		global $txp_user;
+		$privs = safe_field("privs", "txp_users", "name='".doSlash($txp_user)."'");
+		$args = func_get_args();
+		if(!in_array($privs,$args)) {
+			exit(pageTop('Restricted').'<p style="margin-top:3em;text-align:center">'.
+				gTxt('restricted_area').'</p>');
+		}
+	}
+
+// -------------------------------------------------------------
+	function add_privs($res, $perm = '1') // perm = '1,2,3'
+	{
+		global $txp_permissions;
+		// Don't let them override privs that exist
+		if (!isset($txp_permissions[$res]))
+			$txp_permissions[$res] = $perm;
+	}
+
+// -------------------------------------------------------------
+	function has_privs($res, $user='')
+	{
+		global $txp_user, $txp_permissions;
+
+		// If no user name is supplied, assume the current login name
+		if (empty($user))
+			$user = $txp_user;
+
+		$privs = safe_field("privs", "txp_users", "name='".doSlash($user)."'");
+		if (@$txp_permissions[$res])
+			$req = explode(',', $txp_permissions[$res]);
+		else
+			$req = array('1'); // The Publisher gets prived for anything
+		return in_array($privs, $req);
+	}
+
+// -------------------------------------------------------------
+	function require_privs($res, $user='')
+	{
+		if (!has_privs($res, $user))
+			exit(pageTop('Restricted').'<p style="margin-top:3em;text-align:center">'.
+				gTxt('restricted_area').'</p>');
+	}
+
+// -------------------------------------------------------------
+	function sizeImage($name) 
+	{
+		$size = @getimagesize($name);
+		return(is_array($size)) ? $size[3] : false;
+	}
+
+// -------------------------------------------------------------
+	function gps($thing) // checks GET and POST for a named variable, or creates it blank
+	{
+		if (isset($_GET[$thing])) {
+			if (MAGIC_QUOTES_GPC) {
+				return doStrip($_GET[$thing]);
+			} else {
+				return $_GET[$thing];
+			}
+		} elseif (isset($_POST[$thing])) {
+			if (MAGIC_QUOTES_GPC) {
+				return doStrip($_POST[$thing]);
+			} else {
+				return $_POST[$thing];
+			}
+		}
+		return '';
+	}
+
+// -------------------------------------------------------------
+	function gpsa($array) // performs gps() on an array of variable names
+	{
+		if(is_array($array)) {
+			foreach($array as $a) {
+				$out[$a] = gps($a);
+			}
+			return $out;
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function ps($thing) // checks POST for a named variable, or creates it blank
+	{
+		if (isset($_POST[$thing])) {
+			if (MAGIC_QUOTES_GPC) {
+				return doStrip($_POST[$thing]);
+			} else {
+				return $_POST[$thing];
+			}
+		}
+		return '';
+	}
+
+// -------------------------------------------------------------
+	function psa($array) // performs ps on an array of variable names
+	{
+		foreach($array as $a) {
+			$out[$a] = ps($a);
+		}
+		return $out;
+	}
+
+// -------------------------------------------------------------
+	function psas($array) // same as above, but does strip_tags on post values
+	{
+		foreach($array as $a) {
+			$out[$a] = strip_tags(ps($a));
+		}
+		return $out;
+	}
+	
+// -------------------------------------------------------------
+	function stripPost() 
+	{
+		if (isset($_POST)) {
+			if (MAGIC_QUOTES_GPC) {
+				return doStrip($_POST);
+			} else {
+				return $_POST;
+			}
+		}
+		return '';
+	}
+
+// -------------------------------------------------------------
+	function serverSet($thing) // Get a var from $_SERVER global array, or create it 
+	{
+		return (isset($_SERVER[$thing])) ? $_SERVER[$thing] : '';
+	}
+
+// -------------------------------------------------------------
+ 	function pcs($thing) //	Get a var from POST or COOKIE; if not, create it 
+	{
+		if (isset($_COOKIE["txp_".$thing])) {
+			if (MAGIC_QUOTES_GPC) {
+				return doStrip($_COOKIE["txp_".$thing]);
+			} else return $_COOKIE["txp_".$thing];
+		} elseif (isset($_POST[$thing])) {
+			if (MAGIC_QUOTES_GPC) {
+				return doStrip($_POST[$thing]);
+			} else return $_POST[$thing];
+		} 
+		return '';
+	}
+
+// -------------------------------------------------------------
+ 	function cs($thing) //	Get a var from COOKIE; if not, create it 
+	{
+		if (isset($_COOKIE[$thing])) {
+			if (MAGIC_QUOTES_GPC) {
+				return doStrip($_COOKIE[$thing]);
+			} else return $_COOKIE[$thing];
+		}
+		return '';
+	}
+
+// -------------------------------------------------------------
+	function yes_no($status) 
+	{
+		return ($status==0) ? (gTxt('no')) : (gTxt('yes'));
+	}
+	
+// -------------------------------------------------------------
+	function getmicrotime() { 
+    	list($usec, $sec) = explode(" ",microtime()); 
+    	return ((float)$usec + (float)$sec); 
+    }
+
+// -------------------------------------------------------------
+	function load_plugin($name)
+	{
+		global $plugins, $plugins_ver, $prefs, $txp_current_plugin;
+
+		if (is_array($plugins) and in_array($name,$plugins)) {
+			return true;
+		}
+		
+		if (!empty($prefs['plugin_cache_dir'])) {
+			$dir = rtrim($prefs['plugin_cache_dir'], '/') . '/';
+			# in case it's a relative path
+			if (!is_dir($dir))
+				$dir = rtrim(realpath(txpath.'/'.$dir), '/') . '/';
+			if (is_file($dir . $name . '.php')) {
+				$plugins[] = $name;
+				set_error_handler("pluginErrorHandler");
+				$txp_current_plugin = $name;
+				include($dir . $name . '.php');
+				$plugins_ver[$name] = @$plugin['version'];
+				restore_error_handler();
+				return true;
+			}
+		}
+							
+		$rs = safe_row("name,code,version","txp_plugin","status = 1 AND name='".doSlash($name)."'");
+		if ($rs) {
+			$plugins[] = $rs['name'];
+			$plugins_ver[$rs['name']] = $rs['version'];
+			
+			set_error_handler("pluginErrorHandler");
+			$txp_current_plugin = $rs['name'];
+			eval($rs['code']);
+			restore_error_handler();
+			
+			return true;	
+		}
+		
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function require_plugin($name)
+	{
+		if (!load_plugin($name))
+			trigger_error("Unable to include required plugin \"{$name}\"",E_USER_ERROR);
+	}
+	
+// -------------------------------------------------------------
+	function include_plugin($name)
+	{
+		if (!load_plugin($name))
+			trigger_error("Unable to include plugin \"{$name}\"",E_USER_WARNING);
+	}
+
+// -------------------------------------------------------------
+	function pluginErrorHandler($errno, $errstr, $errfile, $errline)
+	{
+		$error = array( E_WARNING => "Warning", E_NOTICE => "Notice", E_USER_ERROR => "User_Error", 
+						E_USER_WARNING => "User_Warning", E_USER_NOTICE => "User_Notice");
+
+		if (!($errno & error_reporting())) return;
+
+		global $txp_current_plugin, $production_status;
+		printf ("<pre>".gTxt('plugin_load_error').' <b>%s</b> -> <b>%s: %s on line %s</b></pre>',
+				$txp_current_plugin, $error[$errno], $errstr, $errline);
+		if ($production_status == 'debug')
+			print "\n<pre style=\"padding-left: 2em;\" class=\"backtrace\"><code>".escape_output(join("\n", get_caller(10)))."</code></pre>";
+	}
+
+// -------------------------------------------------------------
+	function tagErrorHandler($errno, $errstr, $errfile, $errline)
+	{
+		global $production_status;
+
+		$error = array( E_WARNING => "Warning", E_NOTICE => "Notice", E_USER_ERROR => "Textpattern Error", 
+						E_USER_WARNING => "Textpattern Warning", E_USER_NOTICE => "Textpattern Notice");
+
+		if (!($errno & error_reporting())) return;
+		if ($production_status == 'live') return;
+
+		global $txp_current_tag;
+		$errline = ($errstr === 'unknown_tag') ? '' : " on line $errline";
+		printf ("<pre>".gTxt('tag_error').' <b>%s</b> -> <b> %s: %s %s</b></pre>',
+				htmlspecialchars($txp_current_tag), $error[$errno], $errstr, $errline );
+		if ($production_status == 'debug')
+			print "\n<pre style=\"padding-left: 2em;\" class=\"backtrace\"><code>".escape_output(join("\n", get_caller(10)))."</code></pre>";
+	}
+
+// -------------------------------------------------------------
+   function load_plugins($type=NULL)
+   {
+		global $prefs,$plugins, $plugins_ver;
+		
+		if (!is_array($plugins)) $plugins = array();
+		
+		if (!empty($prefs['plugin_cache_dir'])) {
+			$dir = rtrim($prefs['plugin_cache_dir'], '/') . '/';
+			# allow a relative path
+			if (!is_dir($dir))
+				$dir = rtrim(realpath(txpath.'/'.$dir), '/') . '/';
+			$dh = @opendir($dir);
+			while ($dh and false !== ($f = @readdir($dh))) {
+				if ($f{0} != '.')
+					load_plugin(basename($f, '.php'));
+			}
+		}
+
+		$where = 'status = 1';
+		if ($type !== NULL)
+			$where .= (" and type='".doSlash($type)."'");
+
+		$rs = safe_rows("name, code, version", "txp_plugin", $where);
+		if ($rs) {
+			$old_error_handler = set_error_handler("pluginErrorHandler");
+			foreach($rs as $a) {
+				if (!in_array($a['name'],$plugins)) {
+					$plugins[] = $a['name'];
+					$plugins_ver[$a['name']] = $a['version'];
+					$GLOBALS['txp_current_plugin'] = $a['name'];
+					$eval_ok = eval($a['code']);
+					if ($eval_ok === FALSE) 
+						echo gTxt('plugin_load_error_above').strong($a['name']).n.br;
+					unset($GLOBALS['txp_current_plugin']);
+				}
+			}
+			restore_error_handler();
+		}
+   }
+
+// -------------------------------------------------------------
+   function register_callback($func, $event, $step='', $pre=0)
+	{
+		global $plugin_callback;
+
+		$plugin_callback[] = array('function'=>$func, 'event'=>$event, 'step'=>$step, 'pre'=>$pre);
+	}
+
+// -------------------------------------------------------------
+   function register_page_extension($func, $event, $step='', $top=0)
+	{
+		# For now this just does the same as register_callback
+		register_callback($func, $event, $step, $top);
+	}
+
+// -------------------------------------------------------------
+   function callback_event($event, $step='', $pre=0)
+	{
+		global $plugin_callback;
+
+		if (!is_array($plugin_callback))
+			return;
+		$return_value = '';
+		foreach ($plugin_callback as $c) {
+			if ($c['event'] == $event and (empty($c['step']) or $c['step'] == $step) and $c['pre'] == $pre) {
+				if (is_callable($c['function'])) {
+					$return_value .= call_user_func($c['function'], $event, $step);
+				}
+			}
+		}
+		return $return_value;
+	}
+
+// -------------------------------------------------------------
+	function register_tab($area, $event, $title) 
+	{
+		global $plugin_areas;
+		
+		$plugin_areas[$area][$title] = $event;
+	}
+
+// -------------------------------------------------------------
+	function getAtt($name, $default=NULL) { // thanks zem!
+		global $theseatts;
+		return isset($theseatts[$name]) ? $theseatts[$name] : $default;
+	}
+	
+// -------------------------------------------------------------
+		function gAtt(&$atts, $name, $default=NULL) {
+			return isset($atts[$name]) ? $atts[$name] : $default;
+		}
+
+// -------------------------------------------------------------
+		function lAtts($pairs, $atts, $warn=1) {
+			global $production_status;
+			foreach($pairs as $name => $default) {
+				$out[$name] = gAtt($atts,$name,$default);
+			}
+			if ($warn and ($production_status == 'debug' or $production_status == 'testing')) {
+				foreach (array_diff(array_keys($atts), array_keys($pairs)) as $a)
+					trigger_error(gTxt('unknown_attribute', array('{att}' => $a)));
+			}
+			return ($out) ? $out : false;
+		}
+
+// -------------------------------------------------------------
+	function select_buttons() 
+	{
+		return
+		gTxt('select').': '.
+		fInput('button','selall',gTxt('all'),'smallerboxsp','select all','selectall();').
+		fInput('button','selnone',gTxt('none'),'smallerboxsp','select none','deselectall();').
+		fInput('button','selrange',gTxt('range'),'smallerboxsp','select range','selectrange();');
+	}
+	
+// -------------------------------------------------------------
+	function stripSpace($text, $force=0) 
+	{
+		global $prefs;
+		if ($force or !empty($prefs['attach_titles_to_permalinks'])) {
+		
+			$text = sanitizeForUrl($text);
+			if ($prefs['permalink_title_format']) {
+				return strtolower($text);
+			} else {
+				return str_replace('-','',$text);
+			}
+		}
+	}
+
+// -------------------------------------------------------------
+	function sanitizeForUrl($text) 
+	{
+		// Remove names entities and tags
+		$text = preg_replace("/(^|&\S+;)|(<[^>]*>)/U","",dumbDown($text));
+		// Collapse spaces, minuses and non-words
+		$text = preg_replace('/[\s\-]+/', '-', trim(preg_replace('/[^\w\s\-]/', '', $text)));
+		// Remove all non-whitelisted characters
+		$text = preg_replace("/[^A-Za-z0-9\-_]/","",$text);
+		return $text;
+	}
+
+// -------------------------------------------------------------
+	function dumbDown($str, $lang=NULL) 
+	{
+		$array = array( // nasty, huh?. 
+			'&#192;'=>'A','&Agrave;'=>'A','&#193;'=>'A','&Aacute;'=>'A','&#194;'=>'A','&Acirc;'=>'A',
+			'&#195;'=>'A','&Atilde;'=>'A','&#196;'=>'Ae','&Auml;'=>'A','&#197;'=>'A','&Aring;'=>'A',
+			'&#198;'=>'Ae','&AElig;'=>'AE',			
+			'&#256;'=>'A','&#260;'=>'A','&#258;'=>'A',			
+			'&#199;'=>'C','&Ccedil;'=>'C','&#262;'=>'C','&#268;'=>'C','&#264;'=>'C','&#266;'=>'C',
+			'&#270;'=>'D','&#272;'=>'D','&#208;'=>'D','&ETH;'=>'D',			
+			'&#200;'=>'E','&Egrave;'=>'E','&#201;'=>'E','&Eacute;'=>'E','&#202;'=>'E','&Ecirc;'=>'E','&#203;'=>'E','&Euml;'=>'E',
+			'&#274;'=>'E','&#280;'=>'E','&#282;'=>'E','&#276;'=>'E','&#278;'=>'E',
+			'&#284;'=>'G','&#286;'=>'G','&#288;'=>'G','&#290;'=>'G',
+			'&#292;'=>'H','&#294;'=>'H',
+			'&#204;'=>'I','&Igrave;'=>'I','&#205;'=>'I','&Iacute;'=>'I','&#206;'=>'I','&Icirc;'=>'I','&#207;'=>'I','&Iuml;'=>'I',
+			'&#298;'=>'I','&#296;'=>'I','&#300;'=>'I','&#302;'=>'I','&#304;'=>'I',
+			'&#306;'=>'IJ',
+			'&#308;'=>'J',
+			'&#310;'=>'K',
+			'&#321;'=>'K','&#317;'=>'K','&#313;'=>'K','&#315;'=>'K','&#319;'=>'K',
+			'&#209;'=>'N','&Ntilde;'=>'N','&#323;'=>'N','&#327;'=>'N','&#325;'=>'N','&#330;'=>'N',
+			'&#210;'=>'O','&Ograve;'=>'O','&#211;'=>'O','&Oacute;'=>'O','&#212;'=>'O','&Ocirc;'=>'O','&#213;'=>'O','&Otilde;'=>'O',
+			'&#214;'=>'Oe','&Ouml;'=>'Oe',
+			'&#216;'=>'O','&Oslash;'=>'O','&#332;'=>'O','&#336;'=>'O','&#334;'=>'O',
+			'&#338;'=>'OE',
+			'&#340;'=>'R','&#344;'=>'R','&#342;'=>'R',
+			'&#346;'=>'S','&#352;'=>'S','&#350;'=>'S','&#348;'=>'S','&#536;'=>'S',
+			'&#356;'=>'T','&#354;'=>'T','&#358;'=>'T','&#538;'=>'T',
+			'&#217;'=>'U','&Ugrave;'=>'U','&#218;'=>'U','&Uacute;'=>'U','&#219;'=>'U','&Ucirc;'=>'U',
+			'&#220;'=>'Ue','&#362;'=>'U','&Uuml;'=>'Ue',
+			'&#366;'=>'U','&#368;'=>'U','&#364;'=>'U','&#360;'=>'U','&#370;'=>'U',
+			'&#372;'=>'W',
+			'&#221;'=>'Y','&Yacute;'=>'Y','&#374;'=>'Y','&#376;'=>'Y',
+			'&#377;'=>'Z','&#381;'=>'Z','&#379;'=>'Z',
+			'&#222;'=>'T','&THORN;'=>'T',			
+			'&#224;'=>'a','&#225;'=>'a','&#226;'=>'a','&#227;'=>'a','&#228;'=>'ae',
+			'&auml;'=>'ae',
+			'&#229;'=>'a','&#257;'=>'a','&#261;'=>'a','&#259;'=>'a','&aring;'=>'a',
+			'&#230;'=>'ae',
+			'&#231;'=>'c','&#263;'=>'c','&#269;'=>'c','&#265;'=>'c','&#267;'=>'c',
+			'&#271;'=>'d','&#273;'=>'d','&#240;'=>'d',
+			'&#232;'=>'e','&#233;'=>'e','&#234;'=>'e','&#235;'=>'e','&#275;'=>'e',
+			'&#281;'=>'e','&#283;'=>'e','&#277;'=>'e','&#279;'=>'e',
+			'&#402;'=>'f',
+			'&#285;'=>'g','&#287;'=>'g','&#289;'=>'g','&#291;'=>'g',
+			'&#293;'=>'h','&#295;'=>'h',
+			'&#236;'=>'i','&#237;'=>'i','&#238;'=>'i','&#239;'=>'i','&#299;'=>'i',
+			'&#297;'=>'i','&#301;'=>'i','&#303;'=>'i','&#305;'=>'i',
+			'&#307;'=>'ij',
+			'&#309;'=>'j',
+			'&#311;'=>'k','&#312;'=>'k',
+			'&#322;'=>'l','&#318;'=>'l','&#314;'=>'l','&#316;'=>'l','&#320;'=>'l',
+			'&#241;'=>'n','&#324;'=>'n','&#328;'=>'n','&#326;'=>'n','&#329;'=>'n',
+			'&#331;'=>'n',
+			'&#242;'=>'o','&#243;'=>'o','&#244;'=>'o','&#245;'=>'o','&#246;'=>'oe',
+			'&ouml;'=>'oe',
+			'&#248;'=>'o','&#333;'=>'o','&#337;'=>'o','&#335;'=>'o',
+			'&#339;'=>'oe',
+			'&#341;'=>'r','&#345;'=>'r','&#343;'=>'r',
+			'&#353;'=>'s',
+			'&#249;'=>'u','&#250;'=>'u','&#251;'=>'u','&#252;'=>'ue','&#363;'=>'u',
+			'&uuml;'=>'ue',
+			'&#367;'=>'u','&#369;'=>'u','&#365;'=>'u','&#361;'=>'u','&#371;'=>'u',
+			'&#373;'=>'w',
+			'&#253;'=>'y','&#255;'=>'y','&#375;'=>'y',
+			'&#382;'=>'z','&#380;'=>'z','&#378;'=>'z',
+			'&#254;'=>'t',
+			'&#223;'=>'ss',
+			'&#383;'=>'ss',
+			'&agrave;'=>'a','&aacute;'=>'a','&acirc;'=>'a','&atilde;'=>'a','&auml;'=>'ae',
+			'&aring;'=>'a','&aelig;'=>'ae','&ccedil;'=>'c','&eth;'=>'d',
+			'&egrave;'=>'e','&eacute;'=>'e','&ecirc;'=>'e','&euml;'=>'e',
+			'&igrave;'=>'i','&iacute;'=>'i','&icirc;'=>'i','&iuml;'=>'i',
+			'&ntilde;'=>'n',
+			'&ograve;'=>'o','&oacute;'=>'o','&ocirc;'=>'o','&otilde;'=>'o','&ouml;'=>'oe',
+			'&oslash;'=>'o',
+			'&ugrave;'=>'u','&uacute;'=>'u','&ucirc;'=>'u','&uuml;'=>'ue',
+			'&yacute;'=>'y','&yuml;'=>'y',
+			'&thorn;'=>'t',
+			'&szlig;'=>'ss'
+		);
+
+
+		if (is_file(txpath.'/lib/i18n-ascii.txt')) {
+			$i18n = parse_ini_file(txpath.'/lib/i18n-ascii.txt', true);
+			# load the global map
+			if (@is_array($i18n['default'])) {
+				$array = array_merge($array,$i18n['default']);
+				# language overrides
+				$lang = empty($lang) ? LANG : $lang;
+				if (@is_array($i18n[$lang]))
+					$array = array_merge($array,$i18n[$lang]);
+			}
+			# load an old file (no sections) just in case
+			else
+				$array = array_merge($array,$i18n);
+		}
+
+		return strtr($str, $array);
+	}
+
+// -------------------------------------------------------------
+	function clean_url($url)
+	{
+		return preg_replace("/\"|'|(?:\s.*$)/",'',$url);
+	}
+
+// -------------------------------------------------------------
+	function noWidow($str)
+	{
+		// replace the last space with a nbsp
+		return preg_replace('@[ ]+(\w+[[:punct:]]?)$@', '&#160;$1', $str);
+	}
+
+// -------------------------------------------------------------
+	function is_blacklisted($ip, $checks = '') 
+	{
+		global $prefs;
+		if (!$checks) $checks = explode(',', $prefs['spam_blacklists']);
+
+		$rip = join('.',array_reverse(explode(".",$ip)));
+		foreach ($checks as $a) {
+			$parts = explode(':', trim($a), 2);
+			$rbl   = $parts[0];
+			if (isset($parts[1])) {
+				foreach (explode(':', $parts[1]) as $code) {
+					$codes[] = strpos($code, '.') ? $code : '127.0.0.'.$code;
+				}
+			}
+			$hosts = @gethostbynamel($rip.'.'.$rbl);
+			if ($hosts and (!isset($codes) or array_intersect($hosts, $codes))) {
+				$listed[] = $rbl;
+			}
+		}
+		return (!empty($listed)) ? join(', ',$listed) : false;
+	}
+
+// -------------------------------------------------------------
+	function updateSitePath($here) 
+	{
+		$here = doSlash($here);
+		$rs = safe_field ("name",'txp_prefs',"name = 'path_to_site'");
+		if (!$rs) {
+			safe_insert("txp_prefs","prefs_id=1,name='path_to_site',val='$here'");
+		} else {
+			safe_update('txp_prefs',"val='$here'","name='path_to_site'");
+		}
+	}
+
+// -------------------------------------------------------------
+	function splat($text)
+	{
+		$atts = array();
+		if (preg_match_all('/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)/', $text, $match, PREG_SET_ORDER)) {
+			foreach ($match as $m) {
+				if (!empty($m[1]))
+					$atts[strtolower($m[1])] = stripcslashes($m[2]);
+				elseif (!empty($m[3]))
+					$atts[strtolower($m[3])] = stripcslashes($m[4]);
+				elseif (!empty($m[5]))
+					$atts[strtolower($m[5])] = stripcslashes($m[6]);
+			}
+		}
+		return $atts;
+	}
+
+// -------------------------------------------------------------
+	function maxMemUsage($message = 'none', $returnit = 0)
+	{
+		static $memory_top = 0;
+		static $memory_message;
+
+		if (is_callable('memory_get_usage'))
+		{
+			$memory_now = memory_get_usage();
+			if ($memory_now > $memory_top)
+			{
+				$memory_top = $memory_now;
+				$memory_message = $message;
+			}
+		}
+
+		if ($returnit != 0)
+		{
+			if (is_callable('memory_get_usage'))
+				return n.comment(sprintf('Memory: %sKb, %s',
+					ceil($memory_top/1024),$memory_message));
+			else
+				return n.comment('Memory: no info available');
+		}
+	}
+
+// -------------------------------------------------------------
+	function strip_rn($str)
+	{
+      return preg_replace('/[\r\n]/', ' ', $str);
+	}
+
+// -------------------------------------------------------------
+
+	function is_valid_email($address)
+	{
+		return preg_match('/^[\w._-]+@([\w-]+\.)+[\w-]+$/', $address);
+	}
+
+// -------------------------------------------------------------
+
+	function txpMail($to_address, $subject, $body, $reply_to = null)
+	{
+		global $txp_user, $prefs;
+
+		// Likely sending passwords
+		if (isset($txp_user))
+		{
+			extract(safe_row('RealName, email', 'txp_users', "name = '".doSlash($txp_user)."'"));
+		}
+
+		// Likely sending comments -> "to" equals "from"
+		else
+		{
+			extract(safe_row('RealName, email', 'txp_users', "email = '".doSlash($to_address)."'"));
+		}
+
+		if ($prefs['override_emailcharset'])
+		{
+			$charset = 'ISO-8599-1';
+
+			if (is_callable('utf8_decode'))
+			{
+				$RealName		= utf8_decode($RealName);
+				$subject		= utf8_decode($subject);
+				$body				= utf8_decode($body);
+				$to_address = utf8_decode($to_address);
+
+				if (!is_null($reply_to))
+				{
+					$reply_to = utf8_decode($reply_to);
+				}
+			}
+		}
+
+		else
+		{
+			$charset = 'UTF-8';
+		}
+
+		$RealName = encode_mailheader(strip_rn($RealName), 'phrase');
+		$subject = encode_mailheader(strip_rn($subject), 'text');
+		$email = strip_rn($email);
+
+		if (!is_null($reply_to))
+		{
+			$reply_to = strip_rn($reply_to);
+		}
+
+		if (!is_callable('mail'))
+		{
+			return false;
+		}
+
+		else
+		{
+			$sep = !is_windows() ? "\n" : "\r\n";
+
+			$body = str_replace("\r\n", "\n", $body);
+			$body = str_replace("\r", "\n", $body);
+			$body = str_replace("\n", $sep, $body);
+
+			return mail($to_address, $subject, $body,
+
+				"From: $RealName <$email>".
+				$sep.'Reply-To: '.( isset($reply_to) ? $reply_to : "$RealName <$email>" ).
+				$sep.'X-Mailer: Textpattern'.
+				$sep.'Content-Transfer-Encoding: 8bit'.
+				$sep.'Content-Type: text/plain; charset="'.$charset.'"'.
+				$sep
+			);
+		}
+	}
+
+// -------------------------------------------------------------
+	function encode_mailheader($string, $type)
+	{
+		global $prefs;
+		if (!strstr($string,'=?') and !preg_match('/[\x00-\x1F\x7F-\xFF]/', $string)) {
+			if ("phrase" == $type) {
+				if (preg_match('/[][()<>@,;:".\x5C]/', $string)) {
+					$string = '"'. strtr($string, array("\\" => "\\\\", '"' => '\"')) . '"';
+				} 
+			}
+			elseif ( "text" != $type) {
+				trigger_error( 'Unknown encode_mailheader type', E_USER_WARNING);
+			}
+			return $string;
+		}
+		if ($prefs['override_emailcharset']) {
+			$start = '=?ISO-8859-1?B?';
+			$pcre  = '/.{1,42}/s';
+		}
+		else {
+			$start = '=?UTF-8?B?';
+			$pcre  = '/.{1,45}(?=[\x00-\x7F\xC0-\xFF]|$)/s';
+		}
+		$end = '?=';
+		$sep = is_windows() ? "\r\n" : "\n";
+		preg_match_all($pcre, $string, $matches);
+		return $start . join($end.$sep.' '.$start, array_map('base64_encode',$matches[0])) . $end;
+	}
+
+// -------------------------------------------------------------
+	function stripPHP($in) 
+	{
+		return preg_replace("/".chr(60)."\?(?:php)?|\?".chr(62)."/i",'',$in);
+	}
+
+// -------------------------------------------------------------
+
+/**
+ * PEDRO:
+ * Helper functions for common textpattern event files actions.
+ * Code refactoring from original files. Intended to do easy and less error 
+ * prone the future build of new textpattern extensions, and to add new
+ * events to multiedit forms.
+ */
+
+ 	function event_category_popup($name, $cat = '', $id = '')
+	{
+		$arr = array('');
+		$rs = getTree('root', $name);
+
+		if ($rs)
+		{
+			return treeSelectInput('category', $rs, $cat, $id);
+		}
+
+		return false;
+	}
+
+// ------------------------------------------------------------- 	
+ 	function event_change_pageby($name) 
+	{
+		$qty = gps('qty');
+		safe_update('txp_prefs',"val='".doSlash($qty)."'","name='".doSlash($name).'_list_pageby'."'");
+		return;
+	}
+
+// -------------------------------------------------------------
+
+	function event_multiedit_form($name, $methods = null, $page, $sort, $dir, $crit, $search_method)
+	{
+		$method = ps('edit_method');
+
+		if ($methods === NULL)
+		{
+			$methods = array(
+				'delete' => gTxt('delete')
+			);
+		}
+
+		return '<label for="withselected">'.gTxt('with_selected').'</label>'.sp.
+			selectInput('edit_method', $methods, $method, 1, 
+				( ($name == 'list') ? ' id="withselected" onchange="poweredit(this); return false;"' : ' id="withselected"' )
+			).
+			n.eInput($name).
+			n.sInput($name.'_multi_edit').
+			n.hInput('page', $page).
+			( $sort ? n.hInput('sort', $sort).n.hInput('dir', $dir) : '' ).
+			( $crit ? n.hInput('crit', $crit).n.hInput('search_method', $search_method) : '' ).
+			n.fInput('submit', '', gTxt('go'), 'smallerbox');
+	}
+
+// -------------------------------------------------------------
+
+	function event_multi_edit($table, $id_key)
+	{
+		$method = ps('edit_method');
+		$selected = ps('selected');
+
+		if ($selected)
+		{
+			if ($method == 'delete')
+			{
+				foreach ($selected as $id)
+				{
+					$id = assert_int($id);
+
+					if (safe_delete($table, "$id_key = $id"))
+					{
+						$ids[] = $id;
+					}
+				}
+
+				return join(', ', $ids);
+			}
+		}
+
+		return '';
+	}
+
+// -------------------------------------------------------------
+	function since($stamp) 
+	{
+		$diff = (time() - $stamp);
+		if ($diff <= 3600) {
+			$mins = round($diff / 60);
+			$since = ($mins <= 1) 
+			?	($mins==1)
+				?	'1 '.gTxt('minute')
+				:	gTxt('a_few_seconds')
+			:	"$mins ".gTxt('minutes');
+		} else if (($diff <= 86400) && ($diff > 3600)) {
+			$hours = round($diff / 3600);
+			$since = ($hours <= 1) ? '1 '.gTxt('hour') : "$hours ".gTxt('hours');
+		} else if ($diff >= 86400) {
+			$days = round($diff / 86400);
+			$since = ($days <= 1) ? "1 ".gTxt('day') : "$days ".gTxt('days');
+		}
+		return $since.' '.gTxt('ago'); // sorry, this needs to be hacked until a truly multilingual version is done
+	}
+
+// -------------------------------------------------------------
+// Calculate the offset between the server local time and the
+// user's selected time zone
+	function tz_offset()
+	{	
+		global $gmtoffset, $is_dst;
+
+		extract(getdate());
+		$serveroffset = gmmktime(0,0,0,$mon,$mday,$year) - mktime(0,0,0,$mon,$mday,$year);
+		$offset = $gmtoffset - $serveroffset;
+		
+		return $offset + ($is_dst ? 3600 : 0);
+	}
+
+// -------------------------------------------------------------
+// Format a time, respecting the locale and local time zone,
+// and make sure the output string is safe for UTF-8
+	function safe_strftime($format, $time='', $gmt=0, $override_locale='')
+	{
+		global $locale;
+		$old_locale = $locale;
+
+		if (!$time)
+			$time = time();
+
+		# we could add some other formats here
+		if ($format == 'iso8601' or $format == 'w3cdtf') {
+			$format = '%Y-%m-%dT%H:%M:%SZ';
+			$gmt = 1;
+		}
+		elseif ($format == 'rfc822') {
+			$format = '%a, %d %b %Y %T GMT';
+			$gmt = 1;
+			$override_locale = 'en-gb';
+		}
+
+		if ($override_locale)
+			getlocale($override_locale);
+
+		if ($format == 'since')
+			$str = since($time);
+		elseif ($gmt)
+			$str = gmstrftime($format, $time);
+		else
+			$str = strftime($format, $time + tz_offset());
+
+		@list($lang, $charset) = explode('.', $locale);
+		if (empty($charset))
+			$charset = 'ISO-8859-1';
+		elseif (is_windows() and is_numeric($charset))
+			// Score -1 for consistent naming conventions
+			$charset = 'Windows-'.$charset;
+
+		if ($charset != 'UTF-8' and $format != 'since') {
+			$new = '';
+			if (is_callable('iconv')) 
+				$new = @iconv($charset, 'UTF-8', $str);
+
+			if ($new)
+				$str = $new;
+			elseif (is_callable('utf8_encode'))
+				$str = utf8_encode($str);
+		}
+
+		# revert to the old locale
+		if ($override_locale)
+			$locale = setlocale(LC_ALL, $old_locale);
+
+		return $str;
+	}
+
+// -------------------------------------------------------------
+// Convert a time string from the Textpattern time zone to GMT
+	function safe_strtotime($time_str)
+	{
+		return strtotime($time_str, time()+tz_offset()) - tz_offset();
+	}
+
+// -------------------------------------------------------------
+	function myErrorHandler($errno, $errstr, $errfile, $errline) 
+	{
+		# error_reporting() returns 0 when the '@' suppression
+		# operator is used
+		if (!error_reporting())
+			return;
+
+		echo '<pre>'.n.n."$errno: $errstr in $errfile at line $errline\n";
+		# Requires PHP 4.3
+		if (is_callable('debug_backtrace')) {
+			echo "Backtrace:\n";
+			$trace = debug_backtrace();
+			foreach($trace as $ent) {
+				if(isset($ent['file'])) echo $ent['file'].':';
+				if(isset($ent['function'])) {
+					echo $ent['function'].'(';
+					if(isset($ent['args'])) {
+						$args='';
+						foreach($ent['args'] as $arg) { $args.=$arg.','; }
+						echo rtrim($args,',');
+					}
+					echo ') ';
+				}
+				if(isset($ent['line'])) echo 'at line '.$ent['line'].' ';
+				if(isset($ent['file'])) echo 'in '.$ent['file'];
+				echo "\n";
+			}
+		}
+		echo "</pre>";
+	}
+
+// -------------------------------------------------------------
+	function find_temp_dir()
+	{
+		global $path_to_site, $img_dir;
+
+		if (is_windows()) {
+			$guess = array(txpath.DS.'tmp', getenv('TMP'), getenv('TEMP'), getenv('SystemRoot').DS.'Temp', 'C:'.DS.'Temp', $path_to_site.DS.$img_dir);
+			foreach ($guess as $k=>$v)
+				if (empty($v)) unset($guess[$k]);
+		}
+		else
+			$guess = array(txpath.DS.'tmp', '', DS.'tmp', $path_to_site.DS.$img_dir);
+
+		foreach ($guess as $dir) {
+			$tf = realpath(@tempnam($dir, 'txp_'));
+			if ($tf and file_exists($tf)) {
+				unlink($tf);
+				return dirname($tf);
+			}
+		}
+
+		return false;
+	}
+
+// -------------------------------------------------------------
+	function get_uploaded_file($f, $dest='')
+	{
+		global $tempdir;
+
+		if (!is_uploaded_file($f))
+			return false;
+
+		if ($dest) {
+			$newfile = $dest;
+		}
+		else {
+			$newfile = @tempnam($tempdir, 'txp_');
+			if (!$newfile)
+				return false;
+		}
+
+		# $newfile is created by tempnam(), but move_uploaded_file
+		# will overwrite it
+		if (move_uploaded_file($f, $newfile))
+			return $newfile;
+	}
+
+// --------------------------------------------------------------
+	function set_error_level($level)
+	{
+
+		if ($level == 'debug') {
+			error_reporting(E_ALL);
+		}
+		elseif ($level == 'live') {
+			// don't show errors on screen
+			error_reporting(E_ALL ^ (E_WARNING | E_NOTICE));
+			@ini_set("display_errors","1");
+		}
+		else {
+			// default is 'testing': display everything except notices
+			error_reporting(E_ALL ^ (E_NOTICE));
+		}
+	}
+
+	
+// -------------------------------------------------------------
+	function shift_uploaded_file($f, $dest)
+	{
+		// Rename might not work, but it's worth a try
+		if (@rename($f, $dest))
+			return true;
+
+		if (@copy($f, $dest)) {
+			unlink($f);
+			return true;
+		}
+	}
+// -------------------------------------------------------------
+	function upload_get_errormsg($err_code) 
+	{
+		$msg = '';
+		switch ($err_code)
+		{
+				// Value: 0; There is no error, the file uploaded with success. 
+			case UPLOAD_ERR_OK         : $msg = '';break; 
+				// Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini. 
+			case UPLOAD_ERR_INI_SIZE   : $msg = gTxt('upload_err_ini_size');break;
+				// Value: 2; The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form. 
+			case UPLOAD_ERR_FORM_SIZE  : $msg = gTxt('upload_err_form_size');break;
+				// Value: 3; The uploaded file was only partially uploaded. 
+			case UPLOAD_ERR_PARTIAL    : $msg = gTxt('upload_err_partial');break;
+				// Value: 4; No file was uploaded. 
+			case UPLOAD_ERR_NO_FILE    : $msg = gTxt('upload_err_no_file');break;
+     			// Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3. 
+			case UPLOAD_ERR_NO_TMP_DIR : $msg = gTxt('upload_err_tmp_dir');break;
+		}
+		return $msg;
+	}
+
+// -------------------------------------------------------------
+	function is_windows()
+	{
+		return (PHP_OS == 'WINNT' or PHP_OS == 'WIN32' or PHP_OS == 'Windows');
+	}
+
+// --------------------------------------------------------------
+	function build_file_path($base,$path)
+	{
+		$base = rtrim($base,'/\\');
+		$path = ltrim($path,'/\\');		
+		
+		return $base.DIRECTORY_SEPARATOR.$path;
+	}	
+	
+// --------------------------------------------------------------
+	function get_author_name($name)
+	{
+		static $authors = array();
+
+		if (isset($authors[$name]))
+			return $authors[$name];
+
+		$realname = fetch('RealName','txp_users','name',doSlash($name));
+		$authors[$name] = $realname;
+		return ($realname) ? $realname : $name;
+	}
+
+
+// --------------------------------------------------------------
+	function EvalElse($thing, $condition) 
+	{
+		$f = '@(</?txp:\S+\b.*(?:(?<!br )/)?'.chr(62).')@sU';
+
+		$parsed = preg_split($f, $thing, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
+
+		$tagpat = '@^<(/?)txp:(\w+).*?(/?)>$@';
+
+		$parts = array(0 => '', 1 => '');
+		$in = 0;
+		$level = 0;
+		foreach ($parsed as $chunk) {
+			if (preg_match($tagpat, $chunk, $m)) {
+				if ($m[2] == 'else' and $m[3] == '/' and $level == 0) {
+					$in = 1-$in;
+				}
+				elseif ($m[1] == '' and $m[3] == '') {
+					++$level;
+					$parts[$in] .= $chunk;
+				}
+				elseif ($m[1] == '/') {
+					--$level;
+					$parts[$in] .= $chunk;
+				}
+				else {
+					$parts[$in] .= $chunk;
+				}
+			}
+			else {
+				$parts[$in] .= $chunk;
+			}
+		}
+
+		global $txp_current_tag;
+		trace_add("[$txp_current_tag: ".($condition ? gTxt('true') : gTxt('false'))."]");
+		return ($condition ? $parts[0] : $parts[1]);
+	}
+
+// --------------------------------------------------------------
+	function fetch_form($name) 
+	{
+		static $forms = array();
+
+		if (isset($forms[$name]))
+			$f = $forms[$name];
+		else {
+			$row = safe_row('Form', 'txp_form',"name='".doSlash($name)."'");
+			if (!$row) {
+				trigger_error(gTxt('form_not_found').': '.$name);
+				return;
+			}
+			$f = $row['Form'];
+			$forms[$name] = $f;
+		}
+
+		trace_add('['.gTxt('form').': '.$name.']');
+		return $f;
+	}
+
+// --------------------------------------------------------------
+	function fetch_category_title($name, $type='article') 
+	{
+		static $cattitles = array();
+
+		if (isset($cattitles[$type][$name]))
+			return $cattitles[$type][$name];
+
+		$f = safe_field('title','txp_category',"name='".doSlash($name)."' and type='".doSlash($type)."'");
+		$cattitles[$type][$name] = $f;
+		return $f;
+	}
+
+// -------------------------------------------------------------
+	function fetch_section_title($name)
+	{
+		static $sectitles = array();
+
+		if (isset($sectitles[$name]))
+			return $sectitles[$name];
+
+		$f = safe_field('title','txp_section',"name='".doSlash($name)."'");
+		$sectitles[$name] = $f;
+		return $f;
+	}
+
+// -------------------------------------------------------------
+	function update_comments_count($id) 
+	{
+		$id = assert_int($id);
+		$thecount = safe_field('count(*)','txp_discuss','parentid='.$id.' and visible='.VISIBLE);
+		$thecount = assert_int($thecount);
+		$updated = safe_update('textpattern','comments_count='.$thecount,'ID='.$id);
+		return ($updated) ? true : false;
+	}
+
+// -------------------------------------------------------------
+	function clean_comment_counts($parentids) 
+	{
+		$parentids = array_map('assert_int',$parentids);
+		$rs = safe_rows_start('parentid, count(*) as thecount','txp_discuss','parentid IN ('.implode(',',$parentids).') AND visible='.VISIBLE.' group by parentid');
+		if (!$rs) return;
+
+		$updated = array();
+		while($a = nextRow($rs)) {
+			safe_update('textpattern',"comments_count=".$a['thecount'],"ID=".$a['parentid']);
+			$updated[] = $a['parentid'];
+		}
+		// We still need to update all those, that have zero comments left.
+		$leftover = array_diff($parentids, $updated);
+		if ($leftover)
+			safe_update('textpattern',"comments_count=0","ID IN (".implode(',',$leftover).")");
+	}
+
+// -------------------------------------------------------------
+	function markup_comment($msg)
+	{
+		global $prefs, $txpcfg;
+
+		include_once txpath.'/lib/classTextile.php';
+		$textile = new Textile();
+
+		extract($prefs);
+
+		$im = (!empty($comments_disallow_images)) ? 1 : '';
+		$msg = $textile->TextileRestricted($msg, 1, $im);
+
+		return $msg;
+	}
+
+//-------------------------------------------------------------
+	function update_lastmod() {
+		safe_update("txp_prefs", "val = now()", "name = 'lastmod'");
+	}
+
+//-------------------------------------------------------------
+	function get_lastmod($unix_ts=NULL) {
+		global $prefs;
+
+		if ($unix_ts === NULL)
+			$unix_ts = @strtotime($prefs['lastmod']);
+
+		# check for future articles that are now visible
+		if ($max_article = safe_field('unix_timestamp(Posted)', 'textpattern', "Posted <= now() and Status >= 4 order by Posted desc limit 1")) {
+			$unix_ts = max($unix_ts, $max_article);
+		}
+
+		return $unix_ts;
+	}
+
+//-------------------------------------------------------------
+	function handle_lastmod($unix_ts=NULL, $exit=1) {
+		global $prefs;
+		extract($prefs);
+
+		if($send_lastmod and $production_status == 'live') {
+			$unix_ts = get_lastmod($unix_ts);
+
+			# make sure lastmod isn't in the future
+			$unix_ts = min($unix_ts, time());
+			# or too far in the past (7 days)
+			$unix_ts = max($unix_ts, time() - 3600*24*7);
+
+			$last = safe_strftime('rfc822', $unix_ts, 1);
+			header("Last-Modified: $last");
+			header('Cache-Control: no-cache');
+
+			$hims = serverset('HTTP_IF_MODIFIED_SINCE');
+			if ($hims and @strtotime($hims) >= $unix_ts) {
+				log_hit('304');
+				if (!$exit)
+					return array('304', $last);
+				txp_status_header('304 Not Modified');
+#				header('Connection: close');
+				header('Content-Length: 0');
+				# discard all output
+				while (@ob_end_clean());
+				exit;
+			}
+
+			if (!$exit)
+				return array('200', $last);
+		}
+	}
+
+//-------------------------------------------------------------
+	function set_pref($name, $val, $event,  $type, $html='text_input')
+	{
+		extract(doSlash(func_get_args()));
+
+    	if (!safe_row("*", 'txp_prefs', "name = '$name'") ) {
+        	return safe_insert('txp_prefs', "
+				name  = '$name',
+				val   = '$val',
+				event = '$event',
+				html  = '$html',
+				type  = '$type',
+				prefs_id = 1"
+			);
+    	} else {
+        	return safe_update('txp_prefs', "val = '$val'","name like '$name'");
+    	}
+    	return false;
+	}
+
+// -------------------------------------------------------------
+	function txp_status_header($status='200 OK')
+	{
+		if (substr(php_sapi_name(), 0, 3) == 'cgi' and empty($_SERVER['FCGI_ROLE']) and empty($_ENV['FCGI_ROLE']))
+			header("Status: $status");
+		else
+			header("HTTP/1.1 $status");
+	}
+
+// -------------------------------------------------------------
+	function txp_die($msg, $status='503')
+	{
+		// 503 status might discourage search engines from indexing or caching the error message
+
+		//Make it possible to call this function as a tag, e.g. in an article <txp:txp_die status="410" />
+		if (is_array($msg))
+			extract(lAtts(array('msg' => '', 'status' => '503'),$msg));
+
+		// Intentionally incomplete - just the ones we're likely to use
+		$codes = array(
+			'200' => 'OK',
+			'301' => 'Moved Permanently',
+			'302' => 'Found',
+			'304' => 'Not Modified',
+			'307' => 'Temporary Redirect',
+			'401' => 'Unauthorized',
+			'403' => 'Forbidden',
+			'404' => 'Not Found',
+			'410' => 'Gone',
+			'414' => 'Request-URI Too Long',
+			'500' => 'Internal Server Error',
+			'501' => 'Not Implemented',
+			'503' => 'Service Unavailable',
+		);
+
+		if ($status) {
+			if (isset($codes[strval($status)]))
+				$status = strval($status) . ' ' . $codes[$status];
+
+			txp_status_header($status);
+		}
+
+		$code = '';
+		if ($status and $parts = @explode(' ', $status, 2)) {
+			$code = @$parts[0];
+		}
+
+		if (@$GLOBALS['connected']) {
+			$out = safe_field('user_html','txp_page',"name='error_".doSlash($code)."'");
+			if (empty($out))
+				$out = safe_field('user_html','txp_page',"name='error_default'");
+		}
+
+		if (empty($out))
+			$out = <<<eod
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+   <title>Textpattern Error: <txp:error_status /></title>
+</head>
+<body>
+<p align="center" style="margin-top:4em"><txp:error_message /></p>
+</body>
+</html>
+eod;
+
+		header("Content-type: text/html; charset=utf-8");
+
+		if (is_callable('parse')) {
+
+			$GLOBALS['txp_error_message'] = $msg;
+			$GLOBALS['txp_error_status'] = $status;
+			$GLOBALS['txp_error_code'] = $code;
+
+			die(parse($out));
+		}
+		else {
+			$out = preg_replace(array('@<txp:error_status[^>]*/>@', '@<txp:error_message[^>]*/>@'),
+				array($status, $msg),
+				$out);
+			die($out);		
+		}
+	}
+
+// -------------------------------------------------------------
+	function join_qs($q)
+	{
+		$qs = array();
+		foreach ($q as $k=>$v)
+			if ($v)
+				$qs[] = urlencode($k) . '=' . urlencode($v);
+
+		$str = join('&amp;', $qs);
+		return ($str ? '?'.$str : '');
+	}
+
+// -------------------------------------------------------------
+
+	function pagelinkurl($parts, $inherit = array())
+	{
+		global $permlink_mode;
+
+		// $inherit can be used to add parameters to an existing url, e.g:
+		// $url = pagelinkurl(array('pg'=>2), $pretext);
+		$keys = array_merge($inherit, $parts);
+
+		// can't use this to link to an article
+		if (isset($keys['id']))
+		{
+			unset($keys['id']);
+		}
+
+		if (@$keys['s'] == 'default')
+		{
+			unset($keys['s']);
+		}
+
+		if ($permlink_mode == 'messy')
+		{
+			return hu.'index.php'.join_qs($keys);
+		}
+
+		else
+		{
+			// all clean URL modes use the same schemes for list pages
+			$url = '';
+
+			if (!empty($keys['rss']))
+			{
+				$url = hu.'rss/';
+				unset($keys['rss']);
+				return $url.join_qs($keys);
+			}
+
+			elseif (!empty($keys['atom']))
+			{
+				$url = hu.'atom/';
+				unset($keys['atom']);
+				return $url.join_qs($keys);
+			}
+
+			elseif (!empty($keys['s']))
+			{
+				$url = hu.urlencode($keys['s']).'/';
+				unset($keys['s']);
+				return $url.join_qs($keys);
+			}
+
+			elseif (!empty($keys['author']))
+			{
+				$url = hu.strtolower(urlencode(gTxt('author'))).'/'.urlencode($keys['author']).'/';
+				unset($keys['author']);
+				return $url.join_qs($keys);
+			}
+
+			elseif (!empty($keys['c']))
+			{
+				$url = hu.strtolower(urlencode(gTxt('category'))).'/'.urlencode($keys['c']).'/';
+				unset($keys['c']);
+				return $url.join_qs($keys);
+			}
+
+			return hu.join_qs($keys);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function in_list($val, $list, $delim = ',')
+	{
+		$args = do_list($list, $delim);
+
+		return in_array($val, $args);
+	}
+
+// -------------------------------------------------------------
+
+	function do_list($list, $delim = ',')
+	{
+		$list = explode($delim, $list);
+
+		foreach ($list as $key => $value) {
+			$list[$key] = trim($value);
+		}
+
+		return $list;
+	}
+
+// -------------------------------------------------------------
+	function doQuote($val)
+	{
+		return "'$val'";
+	}
+
+// -------------------------------------------------------------
+	function quote_list($in)
+	{
+		$out = doSlash($in);
+		return doArray($out, 'doQuote');
+	}
+
+// -------------------------------------------------------------
+	function trace_add($msg)
+	{
+		global $production_status,$txptrace,$txptracelevel;
+
+		if (in_array($production_status, array('debug')))
+			 @$txptrace[] = str_repeat("\t", @$txptracelevel).$msg;
+	}
+
+//-------------------------------------------------------------
+	function article_push() {
+		global $thisarticle, $stack_article;
+		$stack_article[] = @$thisarticle;
+	}
+
+//-------------------------------------------------------------
+	function article_pop() {
+		global $thisarticle, $stack_article;
+		$thisarticle = array_pop($stack_article);
+	}
+// -------------------------------------------------------------
+
+	function relative_path($path, $pfx=NULL)
+	{
+		if ($pfx === NULL)
+			$pfx = dirname(txpath);
+		return preg_replace('@^/'.preg_quote(ltrim($pfx, '/'), '@').'/?@', '', $path);
+	}
+
+// -------------------------------------------------------------
+	function get_caller($num=1,$start=2)
+	{
+		$out = array();
+		if (!is_callable('debug_backtrace'))
+			return $out;
+
+		$bt = debug_backtrace();
+		for ($i=$start; $i< $num+$start; $i++) {
+			if (!empty($bt[$i])) {
+				$t = '';
+				if (!empty($bt[$i]['file']))
+					$t .= relative_path($bt[$i]['file']);
+				if (!empty($bt[$i]['line']))
+					$t .= ':'.$bt[$i]['line'];
+				if ($t)
+					$t .= ' ';
+				if (!empty($bt[$i]['class']))
+					$t .= $bt[$i]['class'];
+				if (!empty($bt[$i]['type']))
+					$t .= $bt[$i]['type'];
+				if (!empty($bt[$i]['function'])) {
+					$t .= $bt[$i]['function'];
+
+					if (!empty($bt[$i]['args']))
+						$t .= '('. at join(', ', $bt[$i]['args']).')';
+					else 
+						$t .= '()';
+				}
+				
+
+				$out[] = $t;
+			}
+		}
+		return $out;
+	}
+
+//-------------------------------------------------------------
+// function name is misleading but remains for legacy reasons
+// this actually sets the locale
+	function getlocale($lang) {
+		global $locale;
+
+		if (empty($locale))
+			$locale = @setlocale(LC_TIME, '0');
+
+		// Locale identifiers vary from system to system.  The
+		// following code will attempt to discover which identifiers
+		// are available.  We'll need to expand these lists to 
+		// improve support.
+		// ISO identifiers: http://www.w3.org/WAI/ER/IG/ert/iso639.htm
+		// Windows: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp
+		$guesses = array(
+			'ar-dz' => array('ar_DZ.UTF-8', 'ar_DZ', 'ara', 'ar', 'arabic', 'ar_DZ.ISO_8859-6'),
+			'bg-bg' => array('bg_BG.UTF-8', 'bg_BG', 'bg', 'bul', 'bulgarian', 'bg_BG.ISO8859-5'),
+			'ca-es' => array('ca_ES.UTF-8', 'ca_ES', 'cat', 'ca', 'catalan', 'ca_ES.ISO_8859-1'),
+			'cs-cz' => array('cs_CZ.UTF-8', 'cs_CZ', 'ces', 'cze', 'cs', 'csy', 'czech', 'cs_CZ.cs_CZ.ISO_8859-2'),
+			'da-dk' => array('da_DK.UTF-8', 'da_DK'),
+			'de-de' => array('de_DE.UTF-8', 'de_DE', 'de', 'deu', 'german', 'de_DE.ISO_8859-1'),
+			'en-gb' => array('en_GB.UTF-8', 'en_GB', 'en_UK', 'eng', 'en', 'english-uk', 'english', 'en_GB.ISO_8859-1'),
+			'en-us' => array('en_US.UTF-8', 'en_US', 'english-us', 'en_US.ISO_8859-1'),
+			'es-es' => array('es_ES.UTF-8', 'es_ES', 'esp', 'spanish', 'es_ES.ISO_8859-1'),
+			'et-ee' => array('et_EE.UTF-8', 'et_EE'),
+			'el-gr' => array('el_GR.UTF-8', 'el_GR', 'el', 'gre', 'greek', 'el_GR.ISO_8859-7'),
+			'fr-fr' => array('fr_FR.UTF-8', 'fr_FR', 'fra', 'fre', 'fr', 'french', 'fr_FR.ISO_8859-1'),
+			'fi-fi' => array('fi_FI.UTF-8', 'fi_FI', 'fin', 'fi', 'finnish', 'fi_FI.ISO_8859-1'),
+			'he_il' => array('he_IL.UTF-8', 'he_IL', 'heb', 'he', 'hebrew', 'he_IL.ISO_8859-8'),
+			'hu_hu' => array('hu_HU.UTF-8', 'hu_HU', 'hun', 'hu', 'hungarian', 'hu_HU.ISO8859-2'),
+			'id-id' => array('id_ID.UTF-8', 'id_ID', 'id', 'ind', 'indonesian','id_ID.ISO_8859-1'),
+			'is-is' => array('is_IS.UTF-8', 'is_IS'),
+			'it-it' => array('it_IT.UTF-8', 'it_IT', 'it', 'ita', 'italian', 'it_IT.ISO_8859-1'),
+			'ja-jp' => array('ja_JP.UTF-8', 'ja_JP', 'ja', 'jpn', 'japanese', 'ja_JP.ISO_8859-1'),
+			'lv-lv' => array('lv_LV.UTF-8', 'lv_LV'),
+			'no-no' => array('no_NO.UTF-8', 'no_NO', 'no', 'nor', 'norwegian', 'no_NO.ISO_8859-1'),
+			'nl-nl' => array('nl_NL.UTF-8', 'nl_NL', 'dut', 'nla', 'nl', 'nld', 'dutch', 'nl_NL.ISO_8859-1'),
+			'pl-pl' => array('pl_PL.UTF-8', 'pl_PL'),
+			'pt-pt' => array('pt_PT.UTF-8', 'pt_PT', 'por', 'portuguese', 'pt_PT.ISO_8859-1'),
+			'ro-ro' => array('ro_RO.UTF-8', 'ro_RO', 'ron', 'rum', 'ro', 'romanian', 'ro_RO.ISO8859-2'),
+			'ru-ru' => array('ru_RU.UTF-8', 'ru_RU', 'ru', 'rus', 'russian', 'ru_RU.ISO8859-5'),
+			'sk-sk' => array('sk_SK.UTF-8', 'sk_SK', 'sk', 'slo', 'slk', 'sky', 'slovak', 'sk_SK.ISO_8859-1'),
+			'sv-se' => array('sv_SE.UTF-8', 'sv_SE', 'sv', 'swe', 'sve', 'swedish', 'sv_SE.ISO_8859-1'),
+			'th-th' => array('th_TH.UTF-8', 'th_TH', 'th', 'tha', 'thai', 'th_TH.ISO_8859-11'),
+			'uk-ua' => array('uk_UA.UTF-8', 'uk_UA'),
+			'zh-cn' => array('zh_CN.UTF-8', 'zh_CN'),
+			'zh-tw' => array('zh_TW.UTF-8', 'zh_TW'),
+		);
+
+		if (!empty($guesses[$lang])) {
+			$l = @setlocale(LC_TIME, $guesses[$lang]);
+			if ($l !== false)
+				$locale = $l;
+		}
+		@setlocale(LC_TIME, $locale);
+
+		return $locale;
+	}
+
+//-------------------------------------------------------------
+	function assert_article() {
+		global $thisarticle;
+		if (empty($thisarticle))
+         trigger_error(gTxt('error_article_context'));
+	}
+
+//-------------------------------------------------------------
+	function assert_comment() {
+		global $thiscomment;
+		if (empty($thiscomment))
+         trigger_error(gTxt('error_comment_context'));
+	}
+
+//-------------------------------------------------------------
+	function assert_int($myvar) {
+		global $production_status;
+
+		if (is_numeric($myvar) and $myvar == intval($myvar)) {
+			return (int) $myvar;
+		}
+
+		if (($production_status == 'debug') || (txpinterface == 'admin')) {
+			trigger_error("<pre>Error: '".htmlspecialchars($myvar)."' is not an integer</pre>".
+						  "\n".'<pre style="padding-left: 2em;" class="backtrace"><code>'.
+						  escape_output(join("\n", get_caller(5,1))).'</code></pre>', E_USER_WARNING);
+		} else trigger_error("'".htmlspecialchars($myvar)."' is not an integer.", E_USER_WARNING);
+		return false;
+	}
+
+//-------------------------------------------------------------
+	function replace_relative_urls($html, $permalink='') {
+
+		global $siteurl;
+
+		# urls like "/foo/bar" - relative to the domain
+		if (serverSet('HTTP_HOST')) {
+			$html = preg_replace('@(<a[^>]+href=")/@','$1'.PROTOCOL.serverSet('HTTP_HOST').'/',$html);
+			$html = preg_replace('@(<img[^>]+src=")/@','$1'.PROTOCOL.serverSet('HTTP_HOST').'/',$html);
+		}
+		# "foo/bar" - relative to the textpattern root
+		$html = preg_replace('@(<a[^>]+href=")(?!http://)@','$1'.PROTOCOL.$siteurl.'/$2',$html);
+		$html = preg_replace('@(<img[^>]+src=")(?!http://)@','$1'.PROTOCOL.$siteurl.'/$2',$html);
+
+		if ($permalink)
+			$html = preg_replace("/href=\\\"#(.*)\"/","href=\"".$permalink."#\\1\"",$html);
+		return ($html);
+	}
+
+//-------------------------------------------------------------
+	function show_clean_test($pretext) {
+		echo @$pretext['req'].n;
+		var_export($pretext);
+	}
+
+//-------------------------------------------------------------
+
+	function pager($total, $limit, $page)
+	{
+		$num_pages = ceil($total / $limit);
+
+		$page = $page ? (int) $page : 1;
+
+		$page = min(max($page, 1), $num_pages);
+
+		$offset = max(($page - 1) * $limit, 0);
+
+		return array($page, $offset, $num_pages);
+	}
+
+//-------------------------------------------------------------
+// word-wrap a string using a zero width space
+	function soft_wrap($text, $width, $break='&#8203;')
+	{
+		return chunk_split($text, $width, $break);
+	}
+
+//-------------------------------------------------------------
+	function strip_prefix($str, $pfx) {
+		return preg_replace('/^'.preg_quote($pfx, '/').'/', '', $str);
+	}
+?>

Added: trunk/www.openmoko.com/textpattern/lib/txplib_update.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/txplib_update.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/txplib_update.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,126 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/lib/txplib_update.php $
+$LastChangedRevision: 1239 $
+*/
+
+//-------------------------------------------------------------
+function install_language_from_file($lang)
+{
+	$lang_file = txpath.'/lang/'.$lang.'.txt';
+	# first attempt with local file		
+	if (is_file($lang_file) && is_readable($lang_file))
+	{
+		$lang_file = txpath.'/lang/'.$lang.'.txt';
+		if (!is_file($lang_file) || !is_readable($lang_file)) return;
+		$file = @fopen($lang_file, "r");
+		if ($file) {
+			$lastmod = @filemtime($lang_file);
+			$lastmod = date('YmdHis',$lastmod);
+			$data = array();
+			$event = '';
+			
+			while (!feof($file)) {
+				$line = fgets($file, 4096);
+				# any line starting with #, not followed by @ is a simple comment
+				if($line[0]=='#' && $line[1]!='@' && $line[1]!='#') continue;
+				# if available use the lastmod time from the file
+				if (strpos($line,'#@version') === 0) 
+				{	# Looks like: "#@version id;unixtimestamp"
+					@list($fversion,$ftime) = explode(';',trim(substr($line,strpos($line,' ',1))));
+					$lastmod = date("YmdHis",min($ftime, time()));
+				}
+				# each language section should be prefixed by #@
+				if($line[0]=='#' && $line[1]=='@')
+				{
+					if (!empty($data)){
+						foreach ($data as $name => $value)
+						{
+							$value = addslashes($value);
+							$exists = mysql_query('SELECT name, lastmod FROM `'.PFX."txp_lang` WHERE `lang`='".$lang."' AND `name`='$name' AND `event`='$event'");
+							if ($exists) $exists = mysql_fetch_row($exists);
+							if ($exists[1])
+							{
+								mysql_query("UPDATE `".PFX."txp_lang` SET `lastmod`='$lastmod', `data`='$value' WHERE `lang`='".$lang."' AND `name`='$name' AND `event`='$event'");
+								echo mysql_error();
+							} else
+								mysql_query("INSERT DELAYED INTO `".PFX."txp_lang`  SET	`lang`='".$lang."', `name`='$name', `lastmod`='$lastmod', `event`='$event', `data`='$value'");
+								echo mysql_error();
+						}
+					}
+					# reset
+					$data = array();
+					$event = substr($line,2, (strlen($line)-2));
+					$event = rtrim($event);
+					continue;
+				}
+				 
+				@list($name,$val) = explode(' => ',trim($line));
+				$data[$name] = $val;
+			}
+			# remember to add the last one
+			if (!empty($data)){
+				foreach ($data as $name => $value)
+				{
+					 mysql_query("INSERT DELAYED INTO `".PFX."txp_lang`  SET `lang`='".$lang."', `name`='$name', `lastmod`='$lastmod', `event`='$event', `data`='$value'");
+				}
+			}
+			mysql_query("DELETE FROM `".PFX."txp_lang`  WHERE `lang`='".$lang."' AND `lastmod`>$lastmod");
+			@fclose($filename);
+			#delete empty fields if any
+			mysql_query("DELETE FROM `".PFX."txp_lang` WHERE `data`=''");
+			mysql_query("FLUSH TABLE `".PFX."txp_lang`");
+
+			return true;
+		}
+	}
+	return false;
+}
+
+//-------------------------------------------------------------
+# check for updates through xml-rpc
+function checkUpdates()
+{
+	require_once txpath.'/lib/IXRClass.php';
+	$client = new IXR_Client('http://rpc.textpattern.com');
+	$uid = safe_field('val','txp_prefs',"name='blog_uid'");
+	if (!$client->query('tups.getTXPVersion',$uid))
+	{
+		return gTxt('problem_connecting_rpc_server');
+	}else{
+		$msg = array();
+		$response = $client->getResponse();
+		if (is_array($response))
+		{
+			ksort($response);
+			$version = safe_field('val','txp_prefs',"name='version'");
+			$lversion = explode('.',$version);
+
+			$branch = substr($version,0,3);
+			foreach ($response as $key => $val)
+			{
+				$rversion = explode('.',$val);
+			
+				if ($key == 'txp_current_version_'.$branch)
+				{					
+					if (isset($lversion[2]) && isset($rversion[2]) && (intval($rversion[2])>intval($lversion[2])))
+					{
+						$msg[]= gTxt('updated_branch_version_available');
+					}else{
+						$msg[]= gTxt('your_branch_is_updated');
+					}
+				}else{
+					if (intval($rversion[0])>intval($lversion[0]) || intval($rversion[1])>intval($lversion[1]))
+					{
+						$msg[]= gTxt('new_textpattern_version_available').': '.$val;
+					}
+				}
+			}
+			return $msg;
+		}
+	}
+}
+
+
+?>

Added: trunk/www.openmoko.com/textpattern/lib/txplib_wrapper.php
===================================================================
--- trunk/www.openmoko.com/textpattern/lib/txplib_wrapper.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/lib/txplib_wrapper.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,665 @@
+<?php
+
+/**
+ * Textpattern Wrapper Class for Textpattern 4.0.x
+ * 
+ * Main goal for this class is to be used as a textpattern data wrapper by
+ * any code which needs to have access to the textpattern articles data,
+ * like XML-RPC, Atom, Moblogging or other external implementations.
+ * 
+ * @link http://txp.kusor.com/wrapper
+ * @author Pedro Palazon - http://kusor.net/
+ * @copyright 2005-2006 The Textpattern Development Team - http://textpattern.com
+ */
+
+# This class requires to include some Textpattern files in order to work properly.
+# See RPC Server implementation to view an example of the required files and predefined variables.
+
+include_once txpath.'/include/txp_auth.php';
+# Include constants.php?
+if (!defined('LEAVE_TEXT_UNTOUCHED')) define('LEAVE_TEXT_UNTOUCHED', 0);
+if (!defined('USE_TEXTILE')) define('USE_TEXTILE', 1);
+if (!defined('CONVERT_LINEBREAKS')) define('CONVERT_LINEBREAKS', 2);
+
+class TXP_Wrapper
+{
+	/**
+	 * @var string The current user
+	 * 
+	 * Remeber to use allways $this->txp_user when checking for permissions with this class
+	 */	
+	var $txp_user = null;
+	/**
+	 * @var boolean Is the user authenticated
+	 */	
+	var $loggedin = false;
+	/**
+	 * @var array Predefined Textpattern vars to be populated
+	 */	
+	var $vars = array(
+		'ID','Title','Title_html','Body','Body_html','Excerpt','Excerpt_html','textile_excerpt','Image',
+		'textile_body', 'Keywords','Status','Posted','Section','Category1','Category2',
+		'Annotate','AnnotateInvite','AuthorID','Posted','override_form',
+		'url_title','custom_1','custom_2','custom_3','custom_4','custom_5',
+		'custom_6','custom_7','custom_8','custom_9','custom_10'
+	);	
+	
+	//Class constructor
+	/**
+	 * Class constructor
+	 * @param string $txp_user the user login name
+	 * @param strign $txpass user password
+	 *
+	 * @see _validate
+	 */
+	function TXP_Wrapper($txp_user, $txpass = NULL)
+	{
+		if ($this->_validate($txp_user, $txpass))
+		{
+			$this->txp_user = $txp_user;
+			$this->loggedin = true;
+		}
+	}
+	
+	//Delete the article given the id
+	/**
+	 * Delete the article given the id
+	 * @param mixed(string|integer) $article_id the ID of the article to delete
+	 * @return boolean true on success deletion
+	 */
+	function deleteArticleID($article_id)
+	{
+		$article_id = assert_int($article_id);
+		if ($this->loggedin && has_privs('article.delete', $this->txp_user)) {
+			return safe_delete('textpattern', "ID = $article_id");
+		}
+		elseif ($this->loggedin && has_privs('article.delete.own', $this->txp_user))
+		{
+			$r = safe_field('ID', 'textpattern', "ID = $article_id AND AuthorID='".doSlash($this->txp_user)."'");
+			if ($r || has_privs('article.delete', $this->txp_user))
+			{
+				return safe_delete('textpattern', "ID = $article_id");
+			}			
+		}
+		return false;
+	}
+	
+	//Retrieves a list of articles matching the given criteria
+	/**
+	 * Retrieves a list of articles matching the given criteria
+	 * @param string $what SQL column names to retrieve
+	 * @param string $where SQL condition to match
+	 * @param string $offset SQL offset
+	 * @param string $limit SQL limit
+	 * @return mixed array on success, false on failure	 	 	 
+	 */
+	function getArticleList($what='*', $where='1', $offset='0', $limit='10')
+	{
+		
+		if ($this->loggedin && has_privs('article.edit.own', $this->txp_user))
+		{
+			$offset = assert_int($offset); 
+			$limit = assert_int($limit);
+			$where = doSlash($where);
+			$what = doSlash($what);
+			
+			if (has_privs('article.edit', $this->txp_user)) {
+				$rs = safe_rows_start($what, 'textpattern', $where." order by Posted desc LIMIT $offset, $limit");
+			}else{
+				$rs = safe_rows_start($what, 'textpattern', $where." AND AuthorID='".doSlash($this->txp_user)."' order by Posted desc LIMIT $offset, $limit");
+			}
+			$out = array();
+			if ($rs)
+			{
+				while ($a = nextRow($rs))
+				{
+					$out[]= $a;
+				}
+			}
+			return $out;
+		}
+		return false;
+	}
+	
+	//Retrieves an article matching the given criteria
+	/**
+	 * Retrieves an article matching the given criteria
+	 * @param string $what SQL column names to retrieve
+	 * @param string $where SQL condition to match	 
+	 * @return mixed array on success, false on failure	 
+	 */	
+	function getArticle($what='*', $where='1')
+	{
+		if ($this->loggedin && has_privs('article.edit.own', $this->txp_user))
+		{
+			// Higer user groups should be able to edit any article
+			if (has_privs('article.edit', $this->txp_user)) {
+				return safe_row(doSlash($what), 'textpattern', doSlash($where));
+			}else {
+				// While restricted users should be able to edit their own articles only
+				return safe_row(doSlash($what), 'textpattern', doSlash($where)." AND AuthorID='".doSlash($this->txp_user)."'");
+			}			
+		}
+		return false;
+	}
+	
+	//Same thing, but handy shortcut known the ID
+	/**
+	 * Same thing, but handy shortcut known the ID
+	 * @param mixed(string|integer) $article_id the ID of the article
+	 * @param string $what SQL column names to retrieve	 
+	 * @return mixed array on success, false on failure	 
+	 */	
+	function getArticleID($article_id, $what='*')
+	{
+		if ($this->loggedin && has_privs('article.edit.own', $this->txp_user))
+		{
+			$article_id = assert_int($article_id);
+			if (has_privs('article.edit', $this->txp_user)) {
+				return safe_row(doSlash($what), 'textpattern', "ID = $article_id");
+			}else{
+				return safe_row(doSlash($what), 'textpattern', "ID = $article_id AND AuthorID='".doSlash($this->txp_user)."'");
+			}
+		}
+		return false;
+	}
+	
+	//Updates an existing article
+	/**
+	 * Updates an existing article
+	 * @param array $params the article fields to update
+	 * @param mixed(string|integer) $article_id the ID of the article to update 
+	 * @return mixed integer article id on success, false on failure	 
+	 * @see _setArticle
+	 */	
+	function updateArticleID($article_id, $params)
+	{
+		$article_id = assert_int($article_id);
+
+		$r = safe_field('ID', 'textpattern', "AuthorID='".doSlash($this->txp_user)."' AND ID = $article_id");
+		
+		if ($this->loggedin && $r && has_privs('article.edit.own', $this->txp_user))
+		{	//Unprivileged user
+			//Check if can edit published arts
+			$r = assert_int($r);
+			$oldstatus = safe_field('Status', 'textpattern', "ID = $r");
+			if (($oldstatus=='4' || $oldstatus == '5') && !has_privs('article.edit.published', $this->txp_user)) return false;
+			//If can, let's go
+			return $this->_setArticle($params, $article_id);			
+		}
+		elseif ($this->loggedin && has_privs('article.edit', $this->txp_user))
+		{//Admin editing. Desires are behest.
+			return $this->_setArticle($params, $article_id);
+		}
+		
+		return false;
+	}
+	
+	//Creates a new article
+	/**
+	 * Creates a new article
+	 * @param array $params the article fields	 
+	 * @return mixed integer article id on success, false on failure
+	 * @see _setArticle
+	 */	
+	function newArticle($params)
+	{
+		if ($this->loggedin && has_privs('article', $this->txp_user))
+		{
+			//Prevent junior authors to publish articles
+			if (($params['Status']=='4' || $params['Status']=='5') && !has_privs('article.publish', $this->txp_user))
+			{				
+				$params['Status']='3';
+			}
+			
+			return $this->_setArticle($params);
+		}
+		return false;
+	}
+	
+	//Get full sections information
+	/**
+	 * Get full sections information
+	 * @return mixed array on success, false on failure	 	 
+	 */	
+	function getSectionsList()
+	{
+		if ($this->loggedin && has_privs('article', $this->txp_user))
+		{
+			return safe_rows('*', 'txp_section',"name!='default'");
+		}
+		return false;
+	}
+	
+	//Get one section
+	/**
+	 * Get one section
+	 * @param string $name the section name
+	 * @return mixed array on success, false on failure	 	 
+	 */	
+	function getSection($name)
+	{
+		if ($this->loggedin && has_privs('article', $this->txp_user))
+		{
+			$name = doSlash($name);
+			return safe_row('*', 'txp_section',"name='$name'");
+		}
+		return false;
+	}
+	
+	//Get full categories information
+	/**
+	 * Get full categories information
+	 * @return mixed array on success, false on failure	 	 
+	 */	
+	function getCategoryList()
+	{
+		if ($this->loggedin && has_privs('article', $this->txp_user))
+		{
+			return safe_rows('*', 'txp_category',"name!='root' AND type='article'");
+		}
+		return false;
+	}
+	/**
+	 * Get one category
+	 * @param string $name the category name
+	 * @return mixed array on success, false on failure	 	 
+	 */	
+	function getCategory($name)
+	{
+		if ($this->loggedin && has_privs('article', $this->txp_user))
+		{
+			$name = doSlash($name);
+			return safe_row('*', 'txp_category',"name='$name' AND type='article'");
+		}
+		return false;
+	}
+	/**
+	 * Same thing, but using category id
+	 * @param mixed(string|integer) $id category id	 
+	 * @return mixed array on success, false on failure	 	 
+	 */	
+	function getCategoryID($id)
+	{
+		if ($this->loggedin && has_privs('article', $this->txp_user))
+		{
+			$id = assert_int($id);
+			return safe_row('*', 'txp_category',"id = $id");
+		}
+		return false;
+	}
+	//Get full information for current user
+	/**
+	 * Get full information for current user
+	 * @return mixed array on success, false on failure	 	 
+	 */	
+	function getUser()
+	{
+		if ($this->loggedin)
+		{
+			return safe_row('*', 'txp_users',"name='$this->txp_user'");
+		}
+		return false;
+	}
+	
+	//Retrieves a template with the given name
+	/**
+	 * Retrieves a template with the given name
+	 * @param string $name the template name
+	 */	
+	function getTemplate($name)
+	{
+		if ($this->loggedin && has_privs('page', $this->txp_user))
+		{
+			$name = doSlash($name);
+			return safe_field('user_html', 'txp_page', "name='$name'");
+		}
+		return false;
+	}
+	//Updates a template with the given name
+	/**
+	 * Updates a template with the given name
+	 * @param string $name the template name
+	 * @param string $html the template contents
+	 * @return boolean true on success	 
+	 */	
+	function setTemplate($name, $html)
+	{
+		if ($this->loggedin && has_privs('page', $this->txp_user))
+		{
+			$name = doSlash($name);
+			$html = doSlash($html);
+			return safe_update('txp_page', "user_html='$html'", "name='$name'");
+		}
+	}
+	
+	// Intended to update article non content fields, like categories
+	// section or Keywords
+	/**
+	 * Intended to update article non content fields, like categories, section or Keywords
+	 * @param mixed(string|integer) $article_id the ID of the article to update	 
+	 * @param string $field the name of the field to update
+	 * @param mixed $value desired value for that field
+	 * @return boolean true on success
+	 */	
+	function updateArticleField($article_id, $field, $value)
+	{
+		$disallow = array('Body','Body_html','Title','Title_html','Excerpt',
+					'Excerpt_html','textile_excerpt','textile_body','LastMod',
+					'LastModID', 'feed_time', 'uid');
+		if ($this->loggedin && has_privs('article.edit', $this->txp_user) && !in_array(doSlash($field),$disallow))
+		{
+			$field = doSlash($field);
+			$value = doSlash($value);
+			
+			if($field == 'Posted') 
+			{
+				$value = strtotime($value)-tz_offset();
+				$value = "from_unixtime($value)";
+				$sql = "Posted = $value";
+			}elseif ($field == 'Status'){
+				$value = assert_int($value);
+				if (!has_privs('article.publish', $this->txp_user) && $value >=4) $value = 3;
+				$sql = "Status = $value";
+			}else{
+				$sql = "$field='$value'";
+			}
+			
+			
+			$sql.= ", LastMod = now(),
+					LastModID = '$this->txp_user'";
+			$article_id = assert_int($article_id);
+			$rs = safe_update('textpattern', $sql, "ID = $article_id");
+			//Do not update lastmod pref here. No new content at all.
+			return $rs;
+		}
+		return false; 
+	}	
+
+// -------------------------------------------------------------
+// Private. Real action takes place here.
+// -------------------------------------------------------------
+	/**
+	 * Executes the real action for @see udpateArticleId and @see newArticle
+	 * @param array $incoming containing the desired article fields
+	 * @param mixed(string|integer) $article_id the ID of the article to update
+	 * @return mixed integer article id on success, false otherwise
+	 * @access private	 
+	 */
+	function _setArticle($incoming, $article_id = null)
+	{
+		global $txpcfg;
+		
+		$prefs = get_prefs();
+		
+		extract($prefs);
+		
+		if ($article_id!==null) {
+			$article_id = assert_int($article_id);
+		}
+		
+		//All validation rules assumed to be passed before this point.
+		//Do content processing here
+		
+		$incoming = $this->_check_keys($incoming, 
+			array(
+				'AuthorID' => $this->txp_user,
+				'Annotate' => $comments_on_default,
+				'AnnotateInvite' => $comments_default_invite,
+				'textile_body' => $use_textile,
+				'textile_excerpt' => $use_textile
+			)
+		);
+		
+		
+		$incoming_with_markup = $this->textile_main_fields($incoming, $use_textile);
+		
+		$incoming['Title'] = $incoming_with_markup['Title'];
+		
+		if (empty($incoming['Body_html']) && !empty($incoming['Body']))
+		{			
+			$incoming['Body_html'] = $incoming_with_markup['Body_html'];
+		}
+
+		if (empty($incoming['Excerpt_html']) && !empty($incoming['Excerpt']))
+		{
+				$incoming['Excerpt_html'] = $incoming_with_markup['Excerpt_html'];
+		}
+		
+		unset($incoming_with_markup);
+
+		if (empty($incoming['Posted'])) {
+			if ($article_id===null) {
+				$when = (!$article_id)? 'now()': '';
+				$incoming['Posted'] = $when;
+			}else{
+				# do not override post time for existing articles unless Posted is present
+				unset($incoming['Posted']);
+			}
+		} else {
+			$when = strtotime($incoming['Posted'])-tz_offset();
+			$when = "from_unixtime($when)";
+		}
+		
+
+		if ($incoming['Title'] || $incoming['Body'] || $incoming['Excerpt']) {
+			//Build SQL then and run query
+			
+			//Prevent data erase if not defined on the update action
+			//but it was on the DB from a previous creation/edition time
+			if ($article_id){
+				
+				$old = safe_row('*','textpattern', "ID = $article_id");
+				//Status should be defined previously. Be sure of that.
+				if (!has_privs('article.publish', $this->txp_user) && $incoming['Status']==4 && $old['Status']!=4) $incoming['Status'] = 3;
+				
+				foreach ($old as $key=>$val)
+				{
+					 if (!isset($incoming[$key])) $incoming[$key] = $val;
+				}								
+				
+			}else{				
+
+				if (empty($incoming['url_title'])) $incoming['url_title'] = stripSpace($incoming['Title']);
+				//Status should be defined previously. Be sure of that.				
+				if (!has_privs('article.publish', $this->txp_user) && $incoming['Status']==4) $incoming['Status'] = 3;
+			}
+			
+			if (empty($incoming['Section']) && $article_id)
+			{
+				$incoming['Section'] = safe_field('Section','textpattern',"ID = $article_id");
+			}
+			
+			//Build the SQL query
+			$sql = array();
+			
+			foreach ($incoming as $key => $val)
+			{
+				if($key == 'Posted' && $val == 'now()')
+				{
+					$sql[]= "$key = $val";
+				}elseif ($key!='ID' && $key!='uid' && $key!='feed_time' && $key!='LastMod' && $key!='LastModID')
+				{
+					$sql[]= "$key = '".doSlash($val)."'";
+				}
+			}
+			$sql[]= 'LastMod = now()';
+			$sql[]= "LastModID = '".doSlash($this->txp_user)."'";			
+			if (!$article_id) $sql[]= "uid = '".doSlash(md5(uniqid(rand(),true)))."'";
+			if (!$article_id)
+			{
+				if (empty($incoming['Posted']))
+				{
+					$sql[]= "feed_time = curdate()";
+				}else{
+					$when = strtotime($incoming['Posted'])-tz_offset();
+					$when = strftime("%Y-%m-%d", $when);
+					$sql[]= "feed_time ='".doSlash($when)."'";
+				}
+			}
+			$sql = join(', ', $sql);			
+			
+			$rs = ($article_id)?
+			   	safe_update('textpattern', $sql, "ID = $article_id"):
+			   	safe_insert('textpattern', $sql);			   	
+			   		   			   										   
+		   $oldstatus = ($article_id)? $old['Status'] : '';
+		   
+		   if (!$article_id && $rs) $article_id = $rs;
+		   
+		   if (($incoming['Status']>=4 && !$article_id) || ($oldstatus!=4 && $article_id)) {	
+				safe_update("txp_prefs", "val = now()", "name = 'lastmod'");
+				//@$this->_sendPings();							
+		   }			   
+		   return $article_id;
+		}
+		
+		return false;
+	}
+	
+// -------------------------------------------------------------
+// Private
+// -------------------------------------------------------------
+
+	/**
+	 * Attemp to validates the user with the provided password
+	 * or takes it from the global scope, assuming the user is logged in
+	 * @param string $user login name of the user to validate
+	 * @param string(optional) $password for that user
+	 * @access private
+	 * @return boolean, true if user is logged in
+	 */
+	function _validate($user,$password = NULL) {
+    	
+		if ($password!==NULL)
+    	{			
+	    	$r = txp_validate($user, $password);
+    	}else{
+    		$r = true;
+    	}
+    	if ($r) {
+			// update the last access time
+			$safe_user = addslashes($user);
+			safe_update("txp_users", "last_access = now()", "name = '$safe_user'");
+			return true;
+    	}
+		return false;
+	}	
+	
+// -------------------------------------------------------------
+// Keep this apart for now. Maybe future changes ob this?
+// -------------------------------------------------------------
+// This is duplicated code from txp_article.php too
+
+	function _sendPings()
+	{
+		global $prefs, $txpcfg;
+		extract($prefs);
+		
+		include_once txpath.'/lib/IXRClass.php';
+					
+		if ($ping_textpattern_com) {
+			$tx_client = new IXR_Client('http://textpattern.com/xmlrpc/');
+			$tx_client->query('ping.Textpattern', $sitename, hu);
+		}
+
+		if ($ping_weblogsdotcom==1) {
+			$wl_client = new IXR_Client('http://rpc.pingomatic.com/');
+			$wl_client->query('weblogUpdates.ping', $sitename, hu);
+		}
+	}
+
+	/**
+	 * Check if the given parameters are the appropiated ones for the articles
+	 * @access private
+	 * @param $incoming array the incoming associative array
+	 * @param $default associative array containing default values for the desired keys
+	 * @return array properly striped off the fields which don't match the defined ones.
+	 */
+	function _check_keys($incoming, $default = array())
+	{				
+		
+		$out = array();
+		# strip off unsuited keys
+		foreach ($incoming as $key => $val)
+		{
+			if (in_array($key, $this->vars))
+			{
+				$out[$key] = $val;
+			}
+		}
+		
+		foreach ($this->vars as $def_key)
+		{
+			# Add those ones inexistent in the incoming array
+			if (!array_key_exists($def_key,$out))
+			{
+				$out[$def_key] = '';
+			}
+			# setup the provided default value, if any, only when the incoming value is empty
+			if (array_key_exists($def_key, $default) && $out[$def_key]!==0)
+			{
+				$out[$def_key] = $default[$def_key];
+			}
+		}
+		return $out;		
+	}
+	
+	/**
+	 * Apply textile to the main article fields
+	 * (duplicated from txp_article.php!)
+	 * @param array containing the $incoming vars array
+	 * @param global use_textile preference
+	 * @return array the same one containing the formatted fields
+	 */
+	
+	function textile_main_fields($incoming, $use_textile = 1)
+	{
+		global $txpcfg;
+		
+		include_once $txpcfg['txpath'].'/lib/classTextile.php';
+		$textile = new Textile();
+		
+		if (!empty($event) and $event == 'article') 
+		{
+			$incoming['Title_plain'] = $incoming['Title'];
+		}
+		
+		if ($incoming['textile_body'] == USE_TEXTILE) 
+		{
+			$incoming['Title'] = $textile->TextileThis($incoming['Title'],'',1);
+		}
+		
+		
+		$incoming['Body_html'] = TXP_Wrapper::format_field($incoming['Body'],$incoming['textile_body'],$textile);
+		
+		$incoming['Excerpt_html'] = TXP_Wrapper::format_field($incoming['Excerpt'],$incoming['textile_excerpt'],$textile);
+		
+		return $incoming;
+	}
+
+	# Try to avoid code duplication when formating fields.
+	/**
+	 * Apply markup to a given fields
+	 *
+	 * @param string $field raw field contents
+	 * @param integer $format format type to apply
+	 * @param object $textile instance
+	 * @return string html formated field
+	 */
+	
+	function format_field($field, $format,$textile)
+	{
+		switch ($format){
+			case LEAVE_TEXT_UNTOUCHED: $html = trim($field); break;
+			case CONVERT_LINEBREAKS: $html = nl2br(trim($field)); break;
+			case USE_TEXTILE:
+				$html = $textile->TextileThis($field);
+			break;
+		}
+		return $html;
+	}
+
+}
+
+?>

Added: trunk/www.openmoko.com/textpattern/license.txt
===================================================================
--- trunk/www.openmoko.com/textpattern/license.txt	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/license.txt	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,280 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+

Added: trunk/www.openmoko.com/textpattern/publish/atom.php
===================================================================
--- trunk/www.openmoko.com/textpattern/publish/atom.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/publish/atom.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,286 @@
+<?php
+
+/*
+	This is Textpattern
+	Copyright 2005 by Dean Allen - all rights reserved.
+
+	Use of this software denotes acceptance of the Textpattern license agreement
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/publish/atom.php $
+$LastChangedRevision: 1864 $
+
+*/
+
+
+// -------------------------------------------------------------
+	function atom()
+	{
+		global $thisarticle;
+		extract($GLOBALS['prefs']);
+		define("t_texthtml",' type="text/html"');
+		define("t_text",' type="text"');
+		define("t_html",' type="html"');
+		define("t_xhtml",' type="xhtml"');
+		define('t_appxhtml',' type="xhtml"');
+		define("r_relalt",' rel="alternate"');
+		define("r_relself",' rel="self"');
+
+		$area = doSlash(gps('area'));
+		extract(doSlash(gpsa(array('category','section','limit'))));
+
+		$last = fetch('unix_timestamp(val)','txp_prefs','name','lastmod');
+
+		$sitename .= ($section) ? ' - '.$section : '';
+		$sitename .= ($category) ? ' - '.$category : '';
+
+		$pub = safe_row("RealName, email", "txp_users", "privs=1");
+
+		$out[] = tag(escape_output($sitename),'title',t_text);
+		$out[] = tag(escape_output($site_slogan),'subtitle',t_text);
+		$out[] = '<link'.r_relself.' href="'.pagelinkurl(array('atom'=>1,'area'=>$area,'section'=>$section,'category'=>$category,'limit'=>$limit)).'" />';
+		$out[] = '<link'.r_relalt.t_texthtml.' href="'.hu.'" />';
+		$articles = array();
+
+		//Atom feeds with mail or domain name
+		$dn = explode('/',$siteurl);
+		$mail_or_domain = ($use_mail_on_feeds_id)? eE($blog_mail_uid):$dn[0];
+		$out[] = tag('tag:'.$mail_or_domain.','.$blog_time_uid.':'.$blog_uid.(($section)? '/'.$section:'').(($category)? '/'.$category:''),'id');
+
+		$out[] = tag('Textpattern','generator',
+			' uri="http://textpattern.com/" version="'.$version.'"');
+		$out[] = tag(safe_strftime("w3cdtf",$last),'updated');
+
+
+		$auth[] = tag($pub['RealName'],'name');
+		$auth[] = ($include_email_atom) ? tag(eE($pub['email']),'email') : '';
+		$auth[] = tag(hu,'uri');
+		
+		$out[] = tag(n.t.t.join(n.t.t,$auth).n,'author');
+
+		if (!$area or $area=='article') {
+			
+			$sfilter = ($section) ? "and Section = '".$section."'" : '';
+			$cfilter = ($category) 
+				? "and (Category1='".$category."' or Category2='".$category."')":'';
+			$limit = ($limit) ? $limit : $rss_how_many;
+			$limit = intval(min($limit,max(100,$rss_how_many)));
+
+			$frs = safe_column("name", "txp_section", "in_rss != '1'");
+
+			$query = array();
+			foreach($frs as $f) $query[] = "and Section != '".doSlash($f)."'";
+			$query[] = $sfilter;
+			$query[] = $cfilter;
+				
+			$rs = safe_rows_start(
+				"*, 
+				ID as thisid, 
+				unix_timestamp(Posted) as uPosted,
+				unix_timestamp(LastMod) as uLastMod",
+				"textpattern", 
+				"Status=4 and Posted <= now() ".
+					join(' ',$query).
+					"order by Posted desc limit $limit" 
+			);
+			if ($rs) {	
+				while ($a = nextRow($rs)) {
+
+					extract($a);
+					populateArticleData($a);
+					$cb = callback_event('atom_entry');
+					$e = array();
+
+					$a['posted'] = $uPosted;
+
+					if ($show_comment_count_in_feed)
+						$count = ($comments_count > 0) ? ' ['.$comments_count.']' : '';
+					else $count = '';
+
+					$thisauthor = get_author_name($AuthorID);
+
+					$e['thisauthor'] = tag(n.t.t.t.tag(htmlspecialchars($thisauthor),'name').n.t.t,'author');
+
+					$e['issued'] = tag(safe_strftime('w3cdtf',$uPosted),'published');
+					$e['modified'] = tag(safe_strftime('w3cdtf',$uLastMod),'updated');
+
+					$escaped_title = escape_output($Title);
+					$e['title'] = tag($escaped_title.$count,'title',t_html);
+
+					$permlink = permlinkurl($a);
+					$e['link'] = '<link'.r_relalt.t_texthtml.' href="'.$permlink.'" />';
+
+					$e['id'] = tag('tag:'.$mail_or_domain.','.$feed_time.':'.$blog_uid.'/'.$uid,'id');
+
+					$e['category1'] = (trim($Category1) ? '<category term="'.htmlspecialchars($Category1).'" />' : '');
+					$e['category2'] = (trim($Category2) ? '<category term="'.htmlspecialchars($Category2).'" />' : '');
+
+					$summary = trim(replace_relative_urls(parse($thisarticle['excerpt']), $permlink));
+					$content = trim(replace_relative_urls(parse($thisarticle['body']), $permlink));
+
+					if ($syndicate_body_or_excerpt) {
+						# short feed: use body as summary if there's no excerpt
+						if (!trim($summary))
+							$summary = $content;
+						$content = '';
+					}
+
+					if (trim($content))
+						$e['content'] = tag(n.escape_cdata($content).n,'content',t_html);
+
+					if (trim($summary))
+						$e['summary'] = tag(n.escape_cdata($summary).n,'summary',t_html);
+
+					$articles[$ID] = tag(n.t.t.join(n.t.t,$e).n.$cb,'entry');
+
+					$etags[$ID] = strtoupper(dechex(crc32($articles[$ID])));
+					$dates[$ID] = $uLastMod;
+				}
+			}
+		} elseif ($area=='link') {
+		
+			$cfilter = ($category) ? "category='".$category."'" : '1';
+			$limit = ($limit) ? $limit : $rss_how_many;
+			$limit = intval(min($limit,max(100,$rss_how_many)));
+		
+			$rs = safe_rows_start("*", "txp_link", "$cfilter order by date desc, id desc limit $limit");
+
+			if ($rs) {
+				while ($a = nextRow($rs)) {
+					extract($a);
+ 
+					$e['title'] = tag(htmlspecialchars($linkname),'title',t_html);
+					$e['content'] = tag(n.htmlspecialchars($description).n,'content',t_html);
+
+					$url = (preg_replace("/^\/(.*)/","https?://$siteurl/$1",$url));
+					$url = preg_replace("/&((?U).*)=/","&amp;\\1=",$url);
+					$e['link'] = '<link'.r_relalt.t_texthtml.' href="'.$url.'" />';
+
+					$e['issued'] = tag(safe_strftime('w3cdtf', strtotime($date)),'published');
+					$e['modified'] = tag(gmdate('Y-m-d\TH:i:s\Z',strtotime($date)),'updated');
+					$e['id'] = tag('tag:'.$mail_or_domain.','.$feed_time.':'.$id,'id');
+
+					$articles[$id] = tag(n.t.t.join(n.t.t,$e).n,'entry');
+
+					$etags[$id] = strtoupper(dechex(crc32($articles[$id])));
+					$dates[$id] = $date;
+
+				}
+			}
+		
+		}
+		if (!empty($articles)) {
+
+			//turn on compression if we aren't using it already
+			if (extension_loaded('zlib') && ini_get("zlib.output_compression") == 0 && ini_get('output_handler') != 'ob_gzhandler' && !headers_sent()) {
+				@ob_start("ob_gzhandler");
+			}
+
+			handle_lastmod();		  
+			$hims = serverset('HTTP_IF_MODIFIED_SINCE');
+			$imsd = ($hims) ? strtotime($hims) : 0;
+
+			if ($imsd >= $last) {
+				txp_status_header("304 Not Modified"); exit;
+			}
+			header("Last-Modified: ".gmdate('D, d M Y H:i:s \G\M\T',$last));
+
+			if (is_callable('apache_request_headers')) {
+				$headers = apache_request_headers();
+				if (isset($headers["A-IM"])) {
+					$canaim = strpos($headers["A-IM"], "feed");
+				} else {
+					$canaim = false;
+				}
+			} else {
+				$canaim = false;
+			}
+		  
+			$hinm = stripslashes(serverset('HTTP_IF_NONE_MATCH'));
+
+			$cutarticles = false;
+		
+			if ($canaim !== false) {
+				foreach($articles as $id=>$thing) {
+					if (strpos($hinm, $etags[$id])) {
+						unset($articles[$id]);
+						$cutarticles = true;
+						$cut_etag = true;
+					}
+
+					if ($dates[$id] < $imsd) {
+						unset($articles[$id]);
+						$cutarticles = true;
+						$cut_time = true;
+					}
+				}
+			}
+
+			if (isset($cut_etag) && isset($cut_time)) {
+				header("Vary: If-None-Match, If-Modified-Since");
+			} else if (isset($cut_etag)) {
+				header("Vary: If-None-Match");
+			} else if (isset($cut_time)) {
+				header("Vary: If-Modified-Since");
+			}
+
+			$etag = @join("-",$etags);
+
+			if (strstr($hinm, $etag)) {
+				header("HTTP/1.1 304 Not Modified"); exit;
+			}
+
+			if ($etag) header('ETag: "'.$etag.'"');
+
+			if ($cutarticles) {
+				//header("HTTP/1.1 226 IM Used"); 
+				//This should be used as opposed to 200, but Apache doesn't like it.
+				//http://intertwingly.net/blog/2004/09/11/Vary-ETag/ says that the status code should be 200.
+				header("Cache-Control: no-store, im");
+				header("IM: feed");
+			}
+		
+			$out = array_merge($out, $articles);
+
+			header('Content-type: application/atom+xml; charset=utf-8');
+			return chr(60).'?xml version="1.0" encoding="UTF-8"?'.chr(62).n.
+			'<feed xml:lang="'.$language.'" xmlns="http://www.w3.org/2005/Atom">'.join(n,$out).'</feed>';
+		}
+	}
+
+
+// DEPRECATED FUNCTIONS
+// these are included only for backwards compatibility with older plugins
+// see the above code for more appropriate ways of handling feed content
+
+	function safe_hed($toUnicode) {
+		
+		if (version_compare(phpversion(), "5.0.0", ">=")) {
+			$str =  html_entity_decode($toUnicode, ENT_QUOTES, "UTF-8");
+		} else {
+			$trans_tbl = get_html_translation_table(HTML_ENTITIES);
+			foreach($trans_tbl as $k => $v) {
+				$ttr[$v] = utf8_encode($k);
+			}
+			$str = strtr($toUnicode, $ttr);
+		}
+		return $str;
+	}
+
+  function fixup_for_feed($toFeed, $permalink) {
+
+	  // fix relative urls
+	  $txt = str_replace('href="/','href="'.hu.'/',$toFeed);
+	  $txt = preg_replace("/href=\\\"#(.*)\"/","href=\"".$permalink."#\\1\"",$txt);
+	 // This was removed as entities shouldn't be stripped in Atom feeds
+	 // when the content type is html. Leaving it commented out as a reminder.
+	  //$txt = safe_hed($txt);
+
+		// encode and entify
+		$txt = preg_replace(array('/</','/>/',"/'/",'/"/'), array('&#60;','&#62;','&#039;','&#34;'), $txt);
+		$txt = preg_replace("/&(?![#0-9]+;)/i",'&amp;', $txt);
+	 return $txt;
+
+  }
+
+
+?>

Added: trunk/www.openmoko.com/textpattern/publish/comment.php
===================================================================
--- trunk/www.openmoko.com/textpattern/publish/comment.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/publish/comment.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,566 @@
+<?php
+
+/*
+	This is Textpattern
+	Copyright 2005 by Dean Allen - all rights reserved.
+
+	Use of this software denotes acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/publish/comment.php $
+$LastChangedRevision: 1951 $
+
+*/
+
+// -------------------------------------------------------------
+	function fetchComments($id)
+	{
+		$rs = safe_rows(
+			"*, unix_timestamp(posted) as time", 
+			"txp_discuss", 'parentid='.intval($id).' and visible='.VISIBLE.' order by posted asc'
+		);
+
+		if ($rs) return $rs;
+	}
+
+// -------------------------------------------------------------
+	function discuss($id)
+	{
+		$rs = safe_row('*, unix_timestamp(Posted) as uPosted', 'textpattern', 'ID='.intval($id).' and Status >= 4');
+		if ($rs) {
+			populateArticleData($rs);
+			$result = parse(fetch_form('comments_display'));
+			return $result;
+		}
+
+		return '';
+	}
+
+
+// -------------------------------------------------------------
+	function getNextNonce($check_only = false)
+	{
+		static $nonce = '';
+		if (!$nonce && !$check_only)
+			$nonce = md5( uniqid( rand(), true ) );
+		return $nonce;
+	}
+	function getNextSecret($check_only = false)
+	{
+		static $secret = '';
+		if (!$secret && !$check_only)
+			$secret = md5( uniqid( rand(), true ) );
+		return $secret;
+	}
+
+	function commentForm($id, $atts=NULL) 
+	{
+		global $prefs;
+		extract($prefs);
+
+		extract(lAtts(array(
+			'isize'	  => '25',
+			'msgrows'   => '5',
+			'msgcols'   => '25',
+			'msgstyle'  => '',
+			'form'   => 'comment_form',
+		),$atts, 0));
+
+		$namewarn = false;
+		$emailwarn = false;
+		$commentwarn = false;
+		$name  = pcs('name');
+		$email = clean_url(pcs('email'));
+		$web   = clean_url(pcs('web'));
+		$n_message = 'message';
+
+		extract( doStripTags( doDeEnt ( psa( array(
+			'checkbox_type',
+			'remember',
+			'forget',
+			'parentid',
+			'preview',
+			'message',
+			'submit',
+			'backpage'
+		) ) ) ) );
+		if ($message == '')
+		{	//Second or later preview will have randomized message-field name
+			$in = getComment();
+			$message = doStripTags(doDeEnt($in['message']));
+		}
+		if ( $preview ) {
+			$name  = ps('name');
+			$email = clean_url(ps('email'));
+			$web   = clean_url(ps('web'));
+			$nonce = getNextNonce();
+			$secret = getNextSecret();
+			safe_insert("txp_discuss_nonce", "issue_time=now(), nonce='".doSlash($nonce)."', secret='".doSlash($secret)."'");
+			$n_message = md5('message'.$secret);
+
+			$namewarn = ($comments_require_name && !trim($name));
+			$emailwarn = ($comments_require_email && !trim($email));
+			$commentwarn = (!trim($message));
+
+			$evaluator =& get_comment_evaluator();
+			if ($namewarn) $evaluator -> add_estimate(RELOAD,1,gTxt('comment_name_required'));
+			if ($emailwarn) $evaluator -> add_estimate(RELOAD,1,gTxt('comment_email_required'));
+			if ($commentwarn) $evaluator -> add_estimate(RELOAD,1,gTxt('comment_required'));
+
+		}
+		else
+		{
+			$rememberCookie = cs('txp_remember');
+			if($rememberCookie === '')
+			{
+				$checkbox_type = 'remember';
+				$remember = 1;
+			}
+			else if($rememberCookie == 1)
+				$checkbox_type = 'forget';
+			else
+				$checkbox_type = 'remember';
+		}
+
+		// If the form fields are filled (anything other than blank), pages
+		// really should not be saved by a public cache. rfc2616/14.9.1
+		if ($name || $email || $web) {
+			header('Cache-Control: private');
+		}
+
+		$parentid = (!$parentid) ? $id : $parentid;
+
+		$url = $GLOBALS['pretext']['request_uri'];
+
+		// Experimental clean urls with only 404-error-document on apache
+		// possibly requires messy urls for POST requests.
+		if (defined('PARTLY_MESSY') and (PARTLY_MESSY))
+		{
+			$url = hu.'?id='.intval($parentid);
+		}
+
+		$out = '<form id="txpCommentInputForm" method="post" action="'.htmlspecialchars($url).'#cpreview">'.
+
+			# prevent XHTML Strict validation gotchas
+			n.'<div class="comments-wrapper">'.n.n;
+
+		$Form = fetch('Form', 'txp_form', 'name', $form);
+
+		$msgstyle = ($msgstyle ? ' style="'.$msgstyle.'"' : '');
+		$msgrows = ($msgrows and is_numeric($msgrows)) ? ' rows="'.intval($msgrows).'"' : '';
+		$msgcols = ($msgcols and is_numeric($msgcols)) ? ' cols="'.intval($msgcols).'"' : '';
+
+		$textarea = '<textarea id="message" name="'.$n_message.'"'.$msgcols.$msgrows.$msgstyle.
+			' class="txpCommentInputMessage'.(($commentwarn) ? ' comments_error"' : '"').
+			'>'.htmlspecialchars($message).'</textarea>';
+
+		$comment_submit_button = ($preview) ?	fInput('submit', 'submit', gTxt('submit'), 'button') :	'';
+
+		if ($checkbox_type == 'forget')
+		{
+			// inhibit default remember
+			if ($forget == 1)
+			{
+				destroyCookies();
+			}
+
+			$checkbox = checkbox('forget', 1, $forget, '', 'forget').' '.tag(gTxt('forget'), 'label', ' for="forget"');
+		}
+
+		else
+		{
+			// inhibit default remember
+			if ($remember != 1)
+			{
+				destroyCookies();
+			}
+
+			$checkbox = checkbox('remember', 1, $remember, '', 'remember').' '.tag(gTxt('remember'), 'label', ' for="remember"');
+		}
+
+		$checkbox .= ' '.hInput('checkbox_type', $checkbox_type);
+
+		$vals = array(
+			'comment_name_input'		=> fInput('text', 'name', htmlspecialchars($name), 'comment_name_input'.($namewarn ? ' comments_error' : ''), '', '', $isize, '', 'comment_name_input'),
+			'comment_email_input'		=> fInput('text', 'email', htmlspecialchars($email), 'comment_email_input'.($emailwarn ? ' comments_error' : ''), '', '', $isize, '', 'comment_email_input'),
+			'comment_web_input'			=> fInput('text', 'web', htmlspecialchars($web)	, 'comment_web_input', '', '', $isize, '', 'comment_web_input'),
+			'comment_message_input' 	=> $textarea.'<!-- plugin-place-holder -->',
+			'comment_remember'			=> $checkbox,
+			'comment_preview'			=> fInput('submit', 'preview', gTxt('preview'), 'button'),
+			'comment_submit'			=> $comment_submit_button
+		);
+
+		foreach ($vals as $a => $b)
+		{
+			$Form = str_replace('<txp:'.$a.' />', $b, $Form);
+		}
+
+		$form = parse($Form);
+
+		$out .= $form.
+			n.hInput('parentid', $parentid);
+
+		$split = rand(1, 31);
+
+		$out .= ($preview) ? n.hInput(substr($nonce, 0, $split), substr($nonce, $split)) : '';
+
+		$out .= (!$preview) ?
+			n.hInput('backpage', htmlspecialchars($url)) :
+			n.hInput('backpage', htmlspecialchars($backpage));
+
+		$out = str_replace( '<!-- plugin-place-holder -->', callback_event('comment.form'), $out);
+
+		$out .= n.n.'</div>'.n.'</form>';
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+	function popComments($id)
+	{
+		global $sitename,$s,$thisarticle;
+		$preview = gps('preview');
+		$h3 = ($preview) ? hed(gTxt('message_preview'),3) : '';
+		$discuss = discuss($id);
+		ob_start('parse');
+		$out = fetch_form('popup_comments');
+		$out = str_replace("<txp:popup_comments />",$discuss,$out);
+		
+		return $out;
+
+	}
+
+// -------------------------------------------------------------
+	function setCookies($name,$email,$web)
+	{
+		$cookietime = time() + (365*24*3600);
+		ob_start();
+		setcookie("txp_name",  $name,  $cookietime, "/");
+		setcookie("txp_email", $email, $cookietime, "/");
+		setcookie("txp_web",   $web,	 $cookietime, "/");
+		setcookie("txp_last",  date("H:i d/m/Y"),$cookietime,"/");
+		setcookie("txp_remember", '1', $cookietime, "/");
+	}
+
+// -------------------------------------------------------------
+	function destroyCookies() 
+	{
+		$cookietime = time()-3600;
+		ob_start();
+		setcookie("txp_name",  '', $cookietime, "/");
+		setcookie("txp_email", '', $cookietime, "/");
+		setcookie("txp_web",   '', $cookietime, "/");
+		setcookie("txp_last",  '', $cookietime, "/");
+		setcookie("txp_remember", '0', $cookietime + (365*25*3600), "/");
+	}
+
+// -------------------------------------------------------------
+	function getComment()
+	{
+		// comment spam filter plugins: call this function to fetch comment contents
+		
+		$c = psa( array(
+			'parentid',
+			'name',
+			'email',
+			'web',
+			'message',
+			'backpage',
+			'remember'
+		) );
+
+		$n = array();
+
+		foreach (stripPost() as $k => $v)
+		{
+			if (preg_match('#^[A-Fa-f0-9]{32}$#', $k.$v))
+			{
+				$n[] = doSlash($k.$v);
+			}
+		}
+
+		$c['nonce'] = '';
+		$c['secret'] = '';
+		if (!empty($n)) {
+			$rs = safe_row('nonce, secret', 'txp_discuss_nonce', "nonce in ('".join("','", $n)."')");
+			$c['nonce'] = $rs['nonce'];
+			$c['secret'] = $rs['secret'];
+		}
+		$c['message'] = ps(md5('message'.$c['secret']));
+		return $c;
+	}
+
+// -------------------------------------------------------------
+	function saveComment()
+	{
+		global $siteurl,$comments_moderate,$comments_sendmail,$txpcfg,
+			$comments_disallow_images,$prefs;
+
+		$ref = serverset('HTTP_REFERRER');
+		$in = getComment();
+		$evaluator =& get_comment_evaluator();
+
+		extract($in);
+
+		if (!checkCommentsAllowed($parentid))
+			txp_die ( gTxt('comments_closed'), '403');
+
+		$ip = serverset('REMOTE_ADDR');
+
+		if (!checkBan($ip)) 
+			txp_die(gTxt('you_have_been_banned'), '403');
+
+		$blacklisted = is_blacklisted($ip);
+		if ($blacklisted)
+			txp_die(gTxt('your_ip_is_blacklisted_by'.' '.$blacklisted), '403');
+
+		$web = clean_url($web);
+		$email = clean_url($email);
+		if ($remember == 1 || ps('checkbox_type') == 'forget' && ps('forget') != 1)
+			setCookies($name, $email, $web);
+		else
+			destroyCookies();
+
+		$name = doSlash(strip_tags(deEntBrackets($name)));
+		$web = doSlash(strip_tags(deEntBrackets($web)));
+		$email = doSlash(strip_tags(deEntBrackets($email)));
+
+		$message = trim($message);
+		$message2db = doSlash(markup_comment($message));
+
+		$isdup = safe_row("message,name", "txp_discuss", 
+			"name='$name' and message='$message2db' and ip='".doSlash($ip)."'");
+
+		if (   ($prefs['comments_require_name'] && !trim($name))
+			|| ($prefs['comments_require_email'] && !trim($email))
+			|| (!trim($message)))
+		{ 
+			$evaluator -> add_estimate(RELOAD,1); // The error-messages are added in the preview-code
+		}
+
+		if ($isdup) 
+			$evaluator -> add_estimate(RELOAD,1); // FIXME? Tell the user about dupe?
+
+		if ( ($evaluator->get_result() != RELOAD) && checkNonce($nonce) ) {
+			callback_event('comment.save');
+			$visible = $evaluator->get_result();
+			if ($visible != RELOAD) {
+				$parentid = assert_int($parentid);
+				$rs = safe_insert(
+					"txp_discuss",
+					"parentid  = $parentid,
+					 name		  = '$name',
+					 email	  = '$email',
+					 web		  = '$web',
+					 ip		  = '".doSlash($ip)."',
+					 message   = '$message2db',
+					 visible   = ".intval($visible).",
+					 posted	  = now()"
+				);
+				if ($rs) {
+					safe_update("txp_discuss_nonce", "used = 1", "nonce='".doSlash($nonce)."'");
+					if ($prefs['comment_means_site_updated']) {
+						update_lastmod();
+					}
+					if ($comments_sendmail) {
+						mail_comment($message,$name,$email,$web,$parentid, $rs);
+					}
+
+					$updated = update_comments_count($parentid);
+
+					$backpage = substr($backpage, 0, $prefs['max_url_len']);
+					$backpage = preg_replace("/[\x0a\x0d#].*$/s",'',$backpage);
+					$backpage .= ((strstr($backpage,'?')) ? '&' : '?') . 'commented='.(($visible==VISIBLE) ? '1' : '0');
+					$backpage = preg_replace("#(https?://[^/]+)/.*$#","$1",hu).$backpage;
+					txp_status_header('302 Found');
+					if($comments_moderate){
+						header('Location: '.$backpage.'#txpCommentInputForm');
+					}else{
+						header('Location: '.$backpage.'#c'.sprintf("%06s",$rs));
+					}
+					log_hit('302');
+					$evaluator->write_trace();
+					exit;
+				}
+			}
+		}
+		// Force another Preview
+		$_POST['preview'] = RELOAD;
+		//$evaluator->write_trace();
+	}
+
+// -------------------------------------------------------------
+	class comment_evaluation {
+		var $status;
+		var $message;
+		var $txpspamtrace = array();
+
+		function comment_evaluation() {
+			global $prefs;
+			extract(getComment());
+			$this->status = array( SPAM  => array(),
+								   MODERATE => array(),
+								   VISIBLE  => array(),
+								   RELOAD  => array()
+								);
+			$this->message = $this->status;
+			$this -> txpspamtrace[] = "Comment on $parentid by $name (".safe_strftime($prefs['archive_dateformat'],time()).")";
+			if ($prefs['comments_moderate'])
+				$this->status[MODERATE][]=0.5;
+			else
+				$this->status[VISIBLE][]=0.5;
+		}
+
+		function add_estimate($type = SPAM, $probability = 0.75, $msg='') {
+			global $production_status;
+
+			if (!array_key_exists($type, $this->status))
+				trigger_error(gTxt('unknown_spam_estimate'), E_USER_WARNING);
+
+			$this -> txpspamtrace[] = "   $type; ".max(0,min(1,$probability))."; $msg";
+			//FIXME trace is only viewable for RELOADS. Maybe add info to HTTP-Headers in debug-mode
+
+			$this->status[$type][] = max(0,min(1,$probability));
+			if (trim($msg)) $this->message[$type][] = $msg;
+		}
+
+		function get_result() {
+			$result = array();
+			foreach ($this->status as $key => $value)
+				$result[$key] = array_sum($value)/max(1,count($value));
+			arsort($result, SORT_NUMERIC);
+			reset($result);
+			return key($result);
+		}
+		function get_result_message() {
+			return $this->message[$this->get_result()];
+		}
+		function write_trace() {
+			global $prefs;
+			$file = $prefs['tempdir'].DS.'evaluator_trace.php';
+			if (!file_exists($file)) {
+				$fp = fopen($file,'wb');
+				if ($fp) 
+					fwrite($fp,"<?php return; ?>\n".
+					"This trace-file tracks saved comments. (created ".safe_strftime($prefs['archive_dateformat'],time()).")\n".
+					"Format is: Type; Probability; Message (Type can be -1 => spam, 0 => moderate, 1 => visible)\n\n");
+			} else {
+				$fp = fopen($file,'ab');
+			}
+			if ($fp) {
+				fwrite($fp, implode("\n", $this->txpspamtrace ));
+				fwrite($fp, "\n  RESULT: ".$this->get_result()."\n\n");
+				fclose($fp);
+			}
+		}
+	}
+
+	function &get_comment_evaluator() {
+	    static $instance; 
+	 
+	    // If the instance is not there, create one
+	    if(!isset($instance)) { 
+	        $instance = new comment_evaluation(); 
+	    } 
+	    return $instance; 
+	}
+
+// -------------------------------------------------------------
+	function checkNonce($nonce)
+	{
+		if (!$nonce && !preg_match('#^[a-zA-Z0-9]*$#',$nonce)) 
+			return false;
+			// delete expired nonces
+		safe_delete("txp_discuss_nonce", "issue_time < date_sub(now(),interval 10 minute)");
+			// check for nonce
+		return (safe_row("*", "txp_discuss_nonce", "nonce='".doSlash($nonce)."' and used = 0")) ? true : false;
+	}
+
+// -------------------------------------------------------------
+	function checkBan($ip)
+	{
+		return (!fetch("ip", "txp_discuss_ipban", "ip", $ip)) ? true : false;
+	}
+
+// -------------------------------------------------------------
+	function checkCommentsAllowed($id)
+	{
+		global $use_comments, $comments_disabled_after, $thisarticle;
+
+		$id = intval($id);
+
+		if (!$use_comments || !$id)
+			return false;
+
+		if (isset($thisarticle['thisid']) && ($thisarticle['thisid'] == $id) && isset($thisarticle['annotate']))
+		{
+			$Annotate = $thisarticle['annotate'];
+			$uPosted  = $thisarticle['posted'];
+		} 
+		else
+		{
+			extract(	
+				safe_row(
+					"Annotate,unix_timestamp(Posted) as uPosted",
+						"textpattern", "ID = $id"
+				)
+			);
+		}
+
+		if ($Annotate != 1)
+			return false;
+
+		if($comments_disabled_after) {		
+			$lifespan = ( $comments_disabled_after * 86400 );
+			$timesince = ( time() - $uPosted );
+			return ( $lifespan > $timesince );
+		}
+
+		return true;
+	}
+
+// -------------------------------------------------------------
+		function comments_help()
+	{
+		return ('<a id="txpCommentHelpLink" href="http://www.textpattern.com/help/?item=textile_comments" onclick="window.open(this.href, \'popupwindow\', \'width=300,height=400,scrollbars,resizable\'); return false;">'.gTxt('textile_help').'</a>');
+	}
+
+// -------------------------------------------------------------
+	function mail_comment($message, $cname, $cemail, $cweb, $parentid, $discussid) 
+	{
+		global $sitename;
+		$parentid = assert_int($parentid);
+		$discussid = assert_int($discussid);
+		$article = safe_row("Section, Posted, ID, url_title, AuthorID, Title", "textpattern", "ID = $parentid");
+		extract($article);
+		extract(safe_row("RealName, email", "txp_users", "name = '".doSlash($AuthorID)."'"));
+
+		$out = gTxt('greeting')." $RealName,\r\n\r\n";
+		$out .= str_replace('{title}',$Title,gTxt('comment_recorded'))."\r\n";
+		$out .= permlinkurl_id($parentid)."\r\n";
+		if (has_privs('discuss', $AuthorID))
+			$out .= hu.'textpattern/index.php?event=discuss&step=discuss_edit&discussid='.$discussid."\r\n";
+		$out .= "\r\n";
+		$out .= gTxt('comment_name').": $cname\r\n";
+		$out .= gTxt('comment_email').": $cemail\r\n";
+		$out .= gTxt('comment_web').": $cweb\r\n";
+		$out .= gTxt('comment_comment').": $message";
+
+		$subject = strtr(gTxt('comment_received'),array('{site}' => $sitename, '{title}' => $Title));
+
+		$success = txpMail($email, $subject, $out, $cemail);
+	}
+// -------------------------------------------------------------
+	# deprecated, use fInput instead
+	function input($type,$name,$val,$size='',$class='',$tab='',$chkd='') 
+	{
+		$o = array(
+			'<input type="'.$type.'" name="'.$name.'" id="'.$name.'" value="'.$val.'"',
+			($size)	? ' size="'.$size.'"'	  : '',
+			($class) ? ' class="'.$class.'"'	: '',
+			($tab)	 ? ' tabindex="'.$tab.'"'	: '',
+			($chkd)	? ' checked="checked"'	: '',
+			' />'.n
+		);
+		return join('',$o);
+	}
+?>

Added: trunk/www.openmoko.com/textpattern/publish/log.php
===================================================================
--- trunk/www.openmoko.com/textpattern/publish/log.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/publish/log.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,69 @@
+<?php
+
+/*
+	This is Textpattern
+	Copyright 2005 by Dean Allen - all rights reserved.
+
+	Use of this software denotes acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/publish/log.php $
+$LastChangedRevision: 1637 $
+
+*/
+
+
+// -------------------------------------------------------------
+	function log_hit($status)
+	{
+		global $nolog, $logging;
+		if(!isset($nolog) && $status != '404') {
+			if($logging == 'refer') {
+				logit('refer', $status);
+			} elseif ($logging == 'all') {
+				logit('', $status);
+			}
+		}
+	}
+
+// -------------------------------------------------------------
+	function logit($r='', $status='200')
+	{
+		global $siteurl, $prefs, $pretext;
+		$mydomain = str_replace('www.','',preg_quote($siteurl,"/"));
+		$out['uri'] = @$pretext['request_uri'];
+		$out['ref'] = clean_url(str_replace("http://","",serverSet('HTTP_REFERER')));
+		$host = $ip = serverSet('REMOTE_ADDR');
+
+		if (!empty($prefs['use_dns'])) {
+			// A crude rDNS cache
+			if ($h = safe_field('host', 'txp_log', "ip='".doSlash($ip)."' limit 1")) {
+				$host = $h;
+			}
+			else {
+				// Double-check the rDNS
+				$host = @gethostbyaddr(serverSet('REMOTE_ADDR'));
+				if ($host != $ip and @gethostbyname($host) != $ip)
+					$host = $ip;
+			}
+		}
+		$out['ip'] = $ip;
+		$out['host'] = $host;
+		$out['status'] = $status;
+		$out['method'] = serverSet('REQUEST_METHOD');
+		if (preg_match("/^[^\.]*\.?$mydomain/i", $out['ref'])) $out['ref'] = "";
+		
+		if ($r=='refer') {
+			if (trim($out['ref']) != "") { insert_logit($out); }
+		} else insert_logit($out);
+	}
+
+// -------------------------------------------------------------
+	function insert_logit($in) 
+	{	
+		global $DB;
+		$in = doSlash($in);
+		extract($in);
+		safe_insert("txp_log", "`time`=now(),page='$uri',ip='$ip',host='$host',refer='$ref',status='$status',method='$method'");
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/publish/rss.php
===================================================================
--- trunk/www.openmoko.com/textpattern/publish/rss.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/publish/rss.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,224 @@
+<?php
+
+/*
+	This is Textpattern
+	Copyright 2005 by Dean Allen - all rights reserved.
+
+	Use of this software denotes acceptance of the Textpattern license agreement
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/publish/rss.php $
+$LastChangedRevision: 1864 $
+
+*/
+
+
+// -------------------------------------------------------------
+	function rss()
+	{
+		global $prefs,$thisarticle;
+		extract($prefs);
+
+		extract(doSlash(gpsa(array('category','section','limit','area'))));
+
+		$area = gps('area');
+
+		$sitename .= ($section) ? ' - '.$section : '';
+		$sitename .= ($category) ? ' - '.$category : '';
+		$dn = explode('/',$siteurl);
+		$mail_or_domain = ($use_mail_on_feeds_id)? eE($blog_mail_uid):$dn[0];
+
+		$out[] = tag('http://textpattern.com/?v='.$version, 'generator');
+		$out[] = tag(doSpecial($sitename),'title');
+		$out[] = tag(hu,'link');
+		$out[] = tag(doSpecial($site_slogan),'description');
+		$last = fetch('unix_timestamp(val)','txp_prefs','name','lastmod');
+		$out[] = tag(safe_strftime('rfc822',$last),'pubDate');
+
+		$articles = array();
+
+		if (!$area or $area=='article') {
+
+			$sfilter = ($section) ? "and Section = '".$section."'" : '';
+			$cfilter = ($category)
+				? "and (Category1='".$category."' or Category2='".$category."')":'';
+			$limit = ($limit) ? $limit : $rss_how_many;
+			$limit = intval(min($limit,max(100,$rss_how_many)));
+
+			$frs = safe_column("name", "txp_section", "in_rss != '1'");
+			if ($frs) foreach($frs as $f) $query[] = "and Section != '".doSlash($f)."'";
+			$query[] = $sfilter;
+			$query[] = $cfilter;
+
+			$rs = safe_rows_start(
+				"*, unix_timestamp(Posted) as uPosted, ID as thisid",
+				"textpattern",
+				"Status = 4 ".join(' ',$query).
+				"and Posted < now() order by Posted desc limit $limit"
+			);
+
+			if($rs) {
+				while ($a = nextRow($rs)) {
+					extract($a);
+					populateArticleData($a);
+					
+					$cb = callback_event('rss_entry');
+
+					$a['posted'] = $uPosted;
+
+					$permlink = permlinkurl($a);
+					$summary = trim(replace_relative_urls(parse($thisarticle['excerpt']), $permlink));
+					$content = trim(replace_relative_urls(parse($thisarticle['body']), $permlink));
+
+					if ($syndicate_body_or_excerpt) {
+						# short feed: use body as summary if there's no excerpt
+						if (!trim($summary))
+							$summary = $content;
+						$content = '';
+					}
+
+					if ($show_comment_count_in_feed) {
+						$count = ($comments_count > 0) ? ' ['.$comments_count.']' : '';
+					} else $count = '';
+
+					$Title = escape_output(strip_tags($Title)).$count;
+
+					$thisauthor = get_author_name($AuthorID);
+
+					$item = tag($Title,'title').n.
+						(trim($summary) ? tag(n.escape_cdata($summary).n,'description').n : '').
+						(trim($content) ? tag(n.escape_cdata($content).n,'content:encoded').n : '').
+						tag($permlink,'link').n.
+						tag(safe_strftime('rfc822',$a['posted']),'pubDate').n.
+						tag(htmlspecialchars($thisauthor),'dc:creator').n.
+						tag('tag:'.$mail_or_domain.','.$feed_time.':'.$blog_uid.'/'.$uid,'guid', ' isPermaLink="false"').n.
+						$cb;
+
+
+
+					$articles[$ID] = tag($item,'item');
+
+					$etags[$ID] = strtoupper(dechex(crc32($articles[$ID])));
+					$dates[$ID] = $uPosted;
+
+				}
+
+			}
+		} elseif ($area=='link') {
+
+			$cfilter = ($category) ? "category='$category'" : '1';
+			$limit = ($limit) ? $limit : $rss_how_many;
+			$limit = intval(min($limit,max(100,$rss_how_many)));
+
+			$rs = safe_rows_start("*, unix_timestamp(date) as uDate", "txp_link", "$cfilter order by date desc limit $limit");
+
+			if ($rs) {
+				while ($a = nextRow($rs)) {
+					extract($a);
+					$item = 
+						tag(doSpecial($linkname),'title').n.
+						tag(doSpecial($description),'description').n.
+						tag(doSpecial($url),'link').n.
+						tag(safe_strftime('rfc822',$uDate),'pubDate');
+					$articles[$id] = tag($item,'item');
+
+					$etags[$id] = strtoupper(dechex(crc32($articles[$id])));
+					$dates[$id] = $date;
+				}
+
+			}
+		}
+		
+		  //turn on compression if we aren't using it already
+		if (extension_loaded('zlib') && ini_get("zlib.output_compression") == 0 && ini_get('output_handler') != 'ob_gzhandler' && !headers_sent()) {
+		  @ob_start("ob_gzhandler");
+		}
+
+		handle_lastmod();
+		$hims = serverset('HTTP_IF_MODIFIED_SINCE');
+		$imsd = ($hims) ? strtotime($hims) : 0;
+
+		if (is_callable('apache_request_headers')) {
+			$headers = apache_request_headers();
+			if (isset($headers["A-IM"])) {
+				$canaim = strpos($headers["A-IM"], "feed");
+			} else {
+				$canaim = false;
+			}
+		} else {
+			$canaim = false;
+		}
+
+		$hinm = stripslashes(serverset('HTTP_IF_NONE_MATCH'));
+
+		$cutarticles = false;
+
+		if ($canaim !== false) {
+			foreach($articles as $id=>$thing) {
+				if (strpos($hinm, $etags[$id]) !== false) {
+					unset($articles[$id]);
+					$cutarticles = true;
+					$cut_etag = true;
+				}
+
+				if ($dates[$id] < $imsd) {
+					unset($articles[$id]);
+					$cutarticles = true;
+					$cut_time = true;
+				}
+			}
+		}
+
+		if (isset($cut_etag) && isset($cut_time)) {
+			header("Vary: If-None-Match, If-Modified-Since");
+		} else if (isset($cut_etag)) {
+			header("Vary: If-None-Match");
+		} else if (isset($cut_time)) {
+			header("Vary: If-Modified-Since");
+		}
+
+
+		$etag = @join("-",$etags);
+
+		if (strstr($hinm, $etag)) {
+			header("HTTP/1.1 304 Not Modified"); exit;
+		}
+
+
+		if ($cutarticles) {
+			//header("HTTP/1.1 226 IM Used");
+			//This should be used as opposed to 200, but Apache doesn't like it.
+			//http://intertwingly.net/blog/2004/09/11/Vary-ETag/ says that the status code should be 200.
+			header("Cache-Control: no-store, im");
+			header("IM: feed");
+		}
+
+		$out = array_merge($out, $articles);
+
+
+		header("Content-Type: application/rss+xml; charset=utf-8");
+		if ($etag) header('ETag: "'.$etag.'"');
+		return
+			'<?xml version="1.0" encoding="utf-8"?>'.n.
+			'<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">'.n.
+			tag(join(n,$out),'channel').n.
+			'</rss>';
+	}
+
+
+// DEPRECATED FUNCTIONS
+// included for backwards compatibility with older plugins only
+	function rss_safe_hed($toUnicode) {
+
+		if (version_compare(phpversion(), "5.0.0", ">=")) {
+			$str =  html_entity_decode($toUnicode, ENT_QUOTES, "UTF-8");
+		} else {
+			$trans_tbl = get_html_translation_table(HTML_ENTITIES);
+			foreach($trans_tbl as $k => $v) {
+				$ttr[$v] = utf8_encode($k);
+			}
+			$str = strtr($toUnicode, $ttr);
+		}
+		return $str;
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/publish/search.php
===================================================================
--- trunk/www.openmoko.com/textpattern/publish/search.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/publish/search.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,102 @@
+<?php
+
+/*
+	This is Textpattern
+	Copyright 2005 by Dean Allen - all rights reserved.
+
+	Use of this software denotes acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/publish/search.php $
+$LastChangedRevision: 1748 $
+	
+*/
+
+
+// -------------------------------------------------------------
+// DEPRECATED
+// this is now performed by doArticles()
+	function search($q)
+	{
+		global $prefs;
+		$url = $prefs['siteurl'];
+		extract($prefs);
+		
+		$s_filter = filterSearch();
+
+		$form = fetch('form','txp_form','name','search_results');
+
+			// lose this eventually - only used if search_results form is missing
+		$form = (!$form) ? legacy_form() : $form;
+
+		$rs = safe_rows(
+			"*, ID as thisid, unix_timestamp(Posted) as posted, Title as title,
+			match (Title,Body) against ('$q') as score",
+			"textpattern",
+			"(Title rlike '$q' or Body rlike '$q') $s_filter
+			and Status = 4 and Posted <=now() order by score desc limit 40");
+		
+		if($rs) {
+			$result_rows = count($rs);
+			$text = ($result_rows == 1) ? gTxt('article_found') : gTxt('articles_found');
+		} else {
+			$result_rows = 0;
+			$text = gTxt('articles_found');
+		}
+
+		$results[] = graf($result_rows.' '.$text);
+		if($result_rows > 0) {
+			foreach($rs as $a) {
+				extract($a);
+								
+				$result_date = safe_strftime($archive_dateformat,$posted);
+				$uTitle = ($url_title) ? $url_title : stripSpace($Title);
+				$hurl = permlinkurl($a);
+				$result_url = '<a href="'.$hurl.'">'.$hurl.'</a>';
+				$result_title = '<a href="'.$hurl.'">'.$Title.'</a>';
+	
+				$result = preg_replace("/>\s*</","> <",$Body_html);
+				preg_match_all("/\s.{1,50}".preg_quote($q).".{1,50}\s/i",$result,$concat);
+						
+					$concat = join(" ... ",$concat[0]);
+					
+					$concat = strip_tags($concat);
+					$concat = preg_replace('/^[^>]+>/U',"",$concat);
+					$concat = preg_replace("/($q)/i","<strong>$1</strong>",$concat);
+					$result_excerpt = ($concat) ? "... ".$concat." ..." : '';
+
+					$glob['search_result_title']   = $result_title;
+					$glob['search_result_excerpt'] = $result_excerpt;
+					$glob['search_result_url']     = $result_url;
+					$glob['search_result_date']    = $result_date;
+
+					$GLOBALS['this_result'] = $glob;
+					
+					$thisresult = $form;
+
+					$results[] = parse($thisresult);
+			}
+		}
+		return (is_array($results)) ? join('',$results) : '';
+	}
+
+// -------------------------------------------------------------
+	function filterSearch() 
+	{
+		$rs = safe_column("name", "txp_section", "searchable != '1'");
+		if ($rs) {
+			foreach($rs as $name) $filters[] = "and Section != '".doSlash($name)."'";	
+			return join(' ',$filters);
+		}
+		return false;
+	}
+
+// -------------------------------------------------------------
+// DEPRECATED
+	function legacy_form() 
+	{	// lose this eventually
+		return '<h2><txp:search_result_title /></h2>
+<p><txp:search_result_excerpt /><br/>
+<small><txp:search_result_url /> &middot; <txp:search_result_date /></small></p>';
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/publish/taghandlers.php
===================================================================
--- trunk/www.openmoko.com/textpattern/publish/taghandlers.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/publish/taghandlers.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,3242 @@
+<?php
+
+/*
+	This is Textpattern
+	Copyright 2005 by Dean Allen - all rights reserved.
+
+	Use of this software denotes acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/publish/taghandlers.php $
+$LastChangedRevision: 1949 $
+
+*/
+
+// -------------------------------------------------------------
+
+	function page_title($atts)
+	{
+		global $sitename, $s, $c, $q, $pg, $id, $parentid;
+
+		extract(lAtts(array(
+			'separator' => ': ',
+		), $atts));
+
+		$out = $sitename;
+
+		if ($pg)
+		{
+			$out = $sitename.$separator.gTxt('page').' '.$pg;
+		}
+
+		if ($s and $s != 'default')
+		{
+			$out = $sitename.$separator.fetch_section_title($s);
+		}
+
+		if ($c)
+		{
+			$out = $sitename.$separator.fetch_category_title($c);
+		}
+
+		if ($q)
+		{
+			$out = $sitename.$separator.gTxt('search_results').
+				$separator.' '.$q;
+		}
+
+		if ($id)
+		{
+			$id = (int) $id;
+
+			$out = $sitename.$separator.
+				safe_field('Title', 'textpattern', "ID = $id");
+		}
+
+		if ($parentid)
+		{
+			$parent_id = (int) $parent_id;
+
+			$out = $sitename.$separator.gTxt('comments_on').' '.
+				safe_field('Title', 'textpattern', "ID = $parentid");
+		}
+
+		return escape_title($out);
+	}
+
+// -------------------------------------------------------------
+
+	function css($atts)
+	{
+		global $txp_error_code, $s;
+
+		extract(lAtts(array(
+			'format' => 'url',
+			'media'  => 'screen',
+			'n'      => '',
+			'rel'    => 'stylesheet',
+			'title'  => '',
+		), $atts));
+
+		if ($txp_error_code == '404')
+		{
+			$url = hu.'textpattern/css.php?n=default';
+		}
+	
+		elseif ($n)
+		{
+			$url = hu.'textpattern/css.php?n='.$n;
+		}
+
+		elseif ($s)
+		{
+			$url = hu.'textpattern/css.php?s='.$s;
+		}
+
+		else
+		{
+			$url = hu.'textpattern/css.php?n=default';
+		}
+
+		if ($format == 'link')
+		{
+			return '<link rel="'.$rel.'" type="text/css"'.
+				($media ? ' media="'.$media.'"' : '').
+				($title ? ' title="'.$title.'"' : '').
+				' href="'.$url.'" />';
+		}
+
+		return $url;
+	}
+
+// -------------------------------------------------------------
+
+	function image($atts)
+	{
+		global $img_dir;
+
+		static $cache = array();
+
+		extract(lAtts(array(
+			'align'		=> '', // remove in crockery
+			'class'		=> '',
+			'escape'	=> '',
+			'html_id' => '',
+			'id'			=> '',
+			'name'		=> '',
+			'style'		=> '', // remove in crockery?
+			'wraptag' => '',
+		), $atts));
+
+		if ($name)
+		{
+			if (isset($cache['n'][$name]))
+			{
+				$rs = $cache['n'][$name];
+			}
+
+			else
+			{
+				$name = doSlash($name);
+
+				$rs = safe_row('*', 'txp_image', "name = '$name' limit 1");
+
+				$cache['n'][$name] = $rs;
+			}
+		}
+
+		elseif ($id)
+		{
+			if (isset($cache['i'][$id]))
+			{
+				$rs = $cache['i'][$id];
+			}
+
+			else
+			{
+				$id = (int) $id;
+
+				$rs = safe_row('*', 'txp_image', "id = $id limit 1");
+
+				$cache['i'][$id] = $rs;
+			}
+		}
+
+		else
+		{
+			trigger_error(gTxt('unknown_image'));
+			return;
+		}
+
+		if ($rs)
+		{
+			extract($rs);
+
+			if ($escape == 'html')
+			{
+				$alt = escape_output($alt);
+				$caption = escape_output($caption);
+			}
+
+			$out = '<img src="'.hu.$img_dir.'/'.$id.$ext.'" width="'.$w.'" height="'.$h.'" alt="'.$alt.'"'.
+				($caption ? ' title="'.$caption.'"' : '').
+				( ($html_id and !$wraptag) ? ' id="'.$html_id.'"' : '' ).
+				( ($class and !$wraptag) ? ' class="'.$class.'"' : '' ).
+				($style ? ' style="'.$style.'"' : '').
+				($align ? ' align="'.$align.'"' : '').
+				' />';
+
+			return ($wraptag) ? doTag($out, $wraptag, $class, '', $html_id) : $out;
+		}
+
+		trigger_error(gTxt('unknown_image'));
+	}
+
+// -------------------------------------------------------------
+
+	function thumbnail($atts)
+	{
+		global $img_dir;
+
+		extract(lAtts(array(
+			'align'			=> '', // remove in crockery
+			'class'			=> '',
+			'escape'		=> '',
+			'html_id'		=> '',
+			'id'				=> '',
+			'name'			=> '',
+			'poplink'		=> '',
+			'style'			=> '', // remove in crockery?
+			'wraptag'		=> ''
+		), $atts));
+
+		if ($name)
+		{
+			$name = doSlash($name);
+
+			$rs = safe_row('*', 'txp_image', "name = '$name' limit 1");
+		}
+
+		elseif ($id)
+		{
+			$id = (int) $id;
+
+			$rs = safe_row('*', 'txp_image', "id = $id limit 1");
+		}
+
+		else
+		{
+			trigger_error(gTxt('unknown_image'));
+			return;
+		}
+
+		if ($rs)
+		{
+			extract($rs);
+
+			if ($thumbnail)
+			{
+				if ($escape == 'html')
+				{
+					$alt = escape_output($alt);
+					$caption = escape_output($caption);
+				}
+
+				$out = '<img src="'.hu.$img_dir.'/'.$id.'t'.$ext.'" alt="'.$alt.'"'.
+					($caption ? ' title="'.$caption.'"' : '').
+					( ($html_id and !$wraptag) ? ' id="'.$html_id.'"' : '' ).
+					( ($class and !$wraptag) ? ' class="'.$class.'"' : '' ).
+					($style ? ' style="'.$style.'"' : '').
+					($align ? ' align="'.$align.'"' : '').
+					' />';
+
+				if ($poplink)
+				{
+					$out = '<a href="'.hu.$img_dir.'/'.$id.$ext.'"'.
+						' onclick="window.open(this.href, \'popupwindow\', '.
+						'\'width='.$w.', height='.$h.', scrollbars, resizable\'); return false;">'.$out.'</a>';
+				}
+
+				return ($wraptag) ? doTag($out, $wraptag, $class, '', $html_id) : $out;
+			}
+
+		}
+
+		trigger_error(gTxt('unknown_image'));
+	}
+
+// -------------------------------------------------------------
+	function output_form($atts) 
+	{
+		extract(lAtts(array(
+			'form' => '',
+		), $atts));
+
+		if (!$form)
+			trigger_error(gTxt('form_not_specified'));
+		else
+			return parse(fetch_form($form));
+
+	}
+
+// -------------------------------------------------------------
+
+	function feed_link($atts)
+	{
+		global $s, $c;
+
+		extract(lAtts(array(
+			'category' => $c,
+			'flavor'   => 'rss',
+			'format'   => 'a',
+			'label'    => '',
+			'limit'    => '',
+			'section'  => ( $s == 'default' ? '' : $s),
+			'title'    => gTxt('rss_feed_title'),
+			'wraptag'  => '',
+		), $atts));
+
+		$url = pagelinkurl(array(
+			$flavor    => '1',
+			'section'  => $section,
+			'category' => $category,
+			'limit'    => $limit
+		));
+
+		if ($flavor == 'atom')
+		{
+			$title = ($title == gTxt('rss_feed_title')) ? gTxt('atom_feed_title') : $title;
+		}
+
+		$title = escape_output($title);
+
+		if ($format == 'link')
+		{
+			$type = ($flavor == 'atom') ? 'application/atom+xml' : 'application/rss+xml';
+
+			return '<link rel="alternate" type="'.$type.'" title="'.$title.'" href="'.$url.'" />';
+		}
+
+		$out = '<a href="'.$url.'" title="'.$title.'">'.$label.'</a>';
+
+		return ($wraptag) ? tag($out, $wraptag) : $out;
+	}
+
+// -------------------------------------------------------------
+
+	function link_feed_link($atts)
+	{
+		global $c;
+
+		extract(lAtts(array(
+			'category' => $c,
+			'flavor'   => 'rss',
+			'format'   => 'a',
+			'label'    => '',
+			'title'    => gTxt('rss_feed_title'),
+			'wraptag'  => '',
+		), $atts));
+
+		$url = pagelinkurl(array(
+			$flavor => '1',
+			'area'  =>'link',
+			'c'     => $category
+		));
+
+		if ($flavor == 'atom')
+		{
+			$title = ($title == gTxt('rss_feed_title')) ? gTxt('atom_feed_title') : $title;
+		}
+
+		$title = escape_output($title);
+
+		if ($format == 'link')
+		{
+			$type = ($flavor == 'atom') ? 'application/atom+xml' : 'application/rss+xml';
+
+			return '<link rel="alternate" type="'.$type.'" title="'.$title.'" href="'.$url.'" />';
+		}
+
+		$out = '<a href="'.$url.'" title="'.$title.'">'.$label.'</a>';
+
+		return ($wraptag) ? tag($out, $wraptag) : $out;
+	}
+
+// -------------------------------------------------------------
+
+	function linklist($atts)
+	{
+		global $thislink;
+
+		extract(lAtts(array(
+			'break'		 => '',
+			'category' => '',
+			'class'		 => __FUNCTION__,
+			'form'		 => 'plainlinks',
+			'label'		 => '',
+			'labeltag' => '',
+			'limit'		 => '',
+			'sort'		 => 'linksort asc',
+			'wraptag'	 => '',
+		), $atts));
+
+		$form = fetch_form($form);
+
+		$qparts = array(
+			($category) ? "category = '".doSlash($category)."'" : '1',
+			'order by '.doSlash($sort),
+			($limit) ? 'limit '.intval($limit) : ''
+		);
+
+		$rs = safe_rows_start('*, unix_timestamp(date) as uDate', 'txp_link', join(' ', $qparts));
+
+		if ($rs)
+		{
+			$out = array();
+
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				$thislink = array(
+					'linkname'    => $linkname,
+					'url'         => $url,
+					'description' => $description,
+					'date'        => $uDate,
+					'category'    => $category,
+				);
+
+				$out[] = parse($form);
+			}
+
+			if ($out)
+			{
+				return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
+			}
+		}
+
+		return false;
+	}
+
+// -------------------------------------------------------------
+
+	function tpt_link($atts)
+	{
+		global $thislink;
+
+		extract(lAtts(array(
+			'rel' => '',
+		), $atts));
+
+		return tag(
+			escape_output($thislink['linkname']), 'a',
+			($rel ? ' rel="'.$rel.'"' : '').
+			' href="'.doSpecial($thislink['url']).'"'
+		);
+	}
+
+// -------------------------------------------------------------
+
+	function linkdesctitle($atts)
+	{
+		global $thislink;
+
+		extract(lAtts(array(
+			'rel' => '',
+		), $atts));
+
+		$description = ($thislink['description']) ? 
+			' title="'.escape_output($thislink['description']).'"' : 
+			'';
+
+		return tag(
+			escape_output($thislink['linkname']), 'a',
+			($rel ? ' rel="'.$rel.'"' : '').
+			' href="'.doSpecial($thislink['url']).'"'.$description
+		);
+	}
+
+// -------------------------------------------------------------
+
+	function link_name($atts)
+	{
+		global $thislink;
+
+		extract(lAtts(array(
+			'escape'	 => '',
+		), $atts));
+
+		return ($escape == 'html') ? 
+			escape_output($thislink['linkname']) : 
+			$thislink['linkname'];
+	}
+
+// -------------------------------------------------------------
+
+	function link_url($atts)
+	{
+		global $thislink;
+
+		return $thislink['url'];
+	}
+
+// -------------------------------------------------------------
+
+	function link_description($atts)
+	{
+		global $thislink;
+
+		extract(lAtts(array(
+			'class'		 => '',
+			'escape'	 => '',
+			'label'		 => '',
+			'labeltag' => '',
+			'wraptag'	 => '',
+		), $atts));
+
+		if ($thislink['description'])
+		{
+			$description = ($escape == 'html') ?
+				escape_output($thislink['description']) :
+				$thislink['description'];
+
+			return doLabel($label, $labeltag).doTag($description, $wraptag, $class);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function link_date($atts)
+	{
+		global $thislink, $dateformat;
+
+		extract(lAtts(array(
+			'format' => $dateformat,
+			'gmt'		 => '',
+			'lang'	 => '',
+		), $atts));
+
+		return safe_strftime($format, $thislink['date'], $gmt, $lang);
+	}
+
+// -------------------------------------------------------------
+
+	function link_category($atts)
+	{
+		global $thislink;
+
+		extract(lAtts(array(
+			'class'		 => '',
+			'label'		 => '',
+			'labeltag' => '',
+			'title'		 => 0,
+			'wraptag'	 => '',
+		), $atts));
+
+		if ($thislink['category'])
+		{
+			$category = ($title) ?
+				fetch_category_title($thislink['category'], 'link') :
+				$thislink['category'];
+
+			return doLabel($label, $labeltag).doTag($category, $wraptag, $class);
+		}
+	}
+
+// -------------------------------------------------------------
+	function eE($txt) // convert email address into unicode entities
+	{
+		 for ($i=0;$i<strlen($txt);$i++) { 
+			  $ent[] = "&#".ord(substr($txt,$i,1)).";"; 
+		 } 
+		 if (!empty($ent)) return join('',$ent); 
+	}
+
+// -------------------------------------------------------------
+	function email($atts) // simple contact link
+	{
+		extract(lAtts(array(
+			'email'    => '',
+			'linktext' => gTxt('contact'),
+			'title'    => '',
+		),$atts));
+
+		if($email) {
+			$out  = array(
+				'<a href="'.eE('mailto:'.$email).'"',
+				($title) ? ' title="'.$title.'"' : '',
+				'>',
+				$linktext,
+				'</a>'
+			);
+			return join('',$out);
+		}
+		return '<txp:notice message="malformed email tag />"';
+	}
+	
+// -------------------------------------------------------------
+	function password_protect($atts)
+	{
+		ob_start();
+
+		extract(lAtts(array(
+			'login' => '',
+			'pass'  => '',
+		),$atts));
+
+		$au = serverSet('PHP_AUTH_USER');
+		$ap = serverSet('PHP_AUTH_PW');
+		if ($login && $pass) {
+			if (!$au || !$ap || $au!= $login || $ap!= $pass) {
+				header('WWW-Authenticate: Basic realm="Private"'); 
+				txp_die(gTxt('auth_required'), '401');
+			}
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function recent_articles($atts)
+	{
+		global $prefs;
+		extract(lAtts(array(
+			'break'    => br,
+			'category' => '',
+			'class'    => __FUNCTION__,
+			'label'    => gTxt('recent_articles'),
+			'labeltag' => '',
+			'limit'    => 10,
+			'section'  => '',
+			'sort'     => 'Posted desc',
+			'sortby'   => '',
+			'sortdir'  => '',
+			'wraptag'  => '',
+			'no_widow' => @$prefs['title_no_widow'],
+		), $atts));
+
+		// for backwards compatibility
+		// sortby and sortdir are deprecated
+		if ($sortby)
+		{
+			if (!$sortdir)
+			{
+				$sortdir = 'desc';
+			}
+
+			$sort = "$sortby $sortdir";
+		}
+
+		elseif ($sortdir)
+		{
+			$sort = "Posted $sortdir";
+		}
+
+		$categories = ($category) ? "and (Category1 = '".doSlash($category)."' or Category2 = '".doSlash($category)."')" : '';
+		$section = ($section) ? " and Section = '".doSlash($section)."'" : '';
+
+		$rs = safe_rows_start('*, id as thisid, unix_timestamp(Posted) as posted', 'textpattern', 
+			"Status = 4 $section $categories and Posted <= now() order by ".doSlash($sort).' limit 0,'.intval($limit));
+
+		if ($rs)
+		{
+			$out = array();
+
+			while ($a = nextRow($rs))
+			{
+				$a['Title'] = ($no_widow) ? noWidow(escape_title($a['Title'])) : escape_title($a['Title']);
+				$out[] = href($a['Title'], permlinkurl($a));
+			}
+
+			if ($out)
+			{
+				return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
+			}
+		}
+
+		return '';
+	}
+
+// -------------------------------------------------------------
+
+	function recent_comments($atts)
+	{
+		extract(lAtts(array(
+			'break'		 => br,
+			'class'		 => __FUNCTION__,
+			'label'		 => '',
+			'labeltag' => '',
+			'limit'		 => 10,
+			'sort'     => 'posted desc',
+			'wraptag'	 => '',
+		), $atts));
+
+		$rs = safe_rows_start('parentid, name, discussid', 'txp_discuss', 
+			'visible = '.VISIBLE.' order by '.doSlash($sort).' limit 0,'.intval($limit));
+
+		if ($rs)
+		{
+			$out = array();
+
+			while ($c = nextRow($rs))
+			{
+				$a = safe_row('*, ID as thisid, unix_timestamp(Posted) as posted', 
+					'textpattern', 'ID = '.intval($c['parentid']));
+
+				If ($a['Status'] >= 4)
+				{
+					$out[] = href(
+						$c['name'].' ('.escape_title($a['Title']).')', 
+						permlinkurl($a).'#c'.$c['discussid']
+					);
+				}
+			}
+
+			if ($out)
+			{
+				return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
+			}
+		}
+
+		return '';
+	}
+
+// -------------------------------------------------------------
+
+	function related_articles($atts)
+	{
+		global $thisarticle;
+
+		assert_article();
+
+		extract(lAtts(array(
+			'break'    => br,
+			'class'    => __FUNCTION__,
+			'label'    => '',
+			'labeltag' => '',
+			'limit'    => 10,
+			'match'    => 'Category1,Category2',
+			'section'  => '',
+			'sort'     => 'Posted desc',
+			'wraptag'  => '',
+		), $atts));
+
+		if (empty($thisarticle['category1']) and empty($thisarticle['category2']))
+		{
+			return;
+		}
+
+		$match = do_list($match);
+
+		if (!in_array('Category1', $match) and !in_array('Category2', $match))
+		{
+			return;
+		}
+
+		$id = $thisarticle['thisid'];
+
+		$cats = array();
+
+		if ($thisarticle['category1'])
+		{
+			$cats[] = doSlash($thisarticle['category1']);
+		}
+
+		if ($thisarticle['category2'])
+		{
+			$cats[] = doSlash($thisarticle['category2']);
+		}
+
+		$cats = join("','", $cats);
+
+		$categories = array();
+
+		if (in_array('Category1', $match))
+		{
+			$categories[] = "Category1 in('$cats')";
+		}
+
+		if (in_array('Category2', $match))
+		{
+			$categories[] = "Category2 in('$cats')";
+		}
+
+		$categories = 'and ('.join(' or ', $categories).')';
+
+		$section = ($section) ? " and Section = '".doSlash($section)."'" : '';
+
+		$rs = safe_rows_start('*, unix_timestamp(Posted) as posted', 'textpattern', 
+			'ID != '.intval($id)." and Status = 4 and Posted <= now() $categories $section order by ".doSlash($sort).' limit 0,'.intval($limit));
+	
+		if ($rs)
+		{
+			$out = array();
+
+			while ($a = nextRow($rs))
+			{
+				$out[] = href(escape_title($a['Title']), permlinkurl($a));
+			}
+
+			if ($out)
+			{
+				return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
+			}
+		}
+
+		return '';
+	}
+
+// -------------------------------------------------------------
+
+	function popup($atts)
+	{
+		global $s, $c;
+
+		extract(lAtts(array(
+			'label'        => gTxt('browse'),
+			'wraptag'      => '',
+			'section'      => '',
+			'this_section' => 0,
+			'type'         => 'c',
+		), $atts));
+
+		if ($type == 's')
+		{
+			$rs = safe_rows_start('name, title', 'txp_section', "name != 'default' order by name");
+		}
+
+		else
+		{
+			$rs = safe_rows_start('name, title', 'txp_category', "type = 'article' and name != 'root' order by name");
+		}
+
+		if ($rs)
+		{
+			$out = array();
+
+			$current = ($type == 's') ? $s : $c;
+
+			$sel = '';
+			$selected = false;
+
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				if ($name == $current)
+				{
+					$sel = ' selected="selected"';
+					$selected = true;
+				}
+
+				$out[] = '<option value="'.$name.'"'.$sel.'>'.htmlspecialchars($title).'</option>';
+
+				$sel = '';
+			}
+
+			if ($out)
+			{
+				$section = ($this_section) ? ( $s == 'default' ? '' : $s) : $section;
+
+				$out = n.'<select name="'.$type.'" onchange="submit(this.form);">'.
+					n.t.'<option value=""'.($selected ? '' : ' selected="selected"').'>&nbsp;</option>'.
+					n.t.join(n.t, $out).
+					n.'</select>';
+
+				if ($label)
+				{
+					$out = $label.br.$out;
+				}
+
+				if ($wraptag)
+				{
+					$out = tag($out, $wraptag);
+				}
+
+				return '<form method="get" action="'.hu.'">'.
+					'<div>'.
+					( ($section and $s) ? n.hInput('s', $section) : '').
+					n.$out.
+					n.'<noscript><div><input type="submit" value="'.gTxt('go').'" /></div></noscript>'.
+					n.'</div>'.
+					n.'</form>';
+			}
+		}
+	}
+
+// -------------------------------------------------------------
+// output href list of site categories
+
+	function category_list($atts)
+	{
+		global $s, $c;
+
+		extract(lAtts(array(
+			'active_class' => '',
+			'break'        => br,
+			'categories'   => '',
+			'class'        => __FUNCTION__,
+			'exclude'      => '',
+			'label'        => '',
+			'labeltag'     => '',
+			'parent'       => '',
+			'section'      => '',
+			'this_section' => 0,
+			'type'         => 'article',
+			'wraptag'      => '',
+		), $atts));
+
+		if ($categories)
+		{
+			$categories = do_list($categories);
+			$categories = join("','", doSlash($categories));
+
+			$rs = safe_rows_start('name, title', 'txp_category', 
+				"type = '".doSlash($type)."' and name in ('$categories') order by field(name, '$categories')");
+		}
+
+		else
+		{
+			if ($exclude)
+			{
+				$exclude = do_list($exclude);
+
+				$exclude = join("','", doSlash($exclude));
+
+				$exclude = "and name not in('$exclude')";
+			}
+
+			if ($parent)
+			{
+				$qs = safe_row('lft, rgt', 'txp_category', "name = '".doSlash($parent)."'");
+
+				if ($qs)
+				{
+					extract($qs);
+
+					$rs = safe_rows_start('name, title', 'txp_category', 
+						"(lft between $lft and $rgt) and type = '".doSlash($type)."' and name != 'default' $exclude order by lft asc");
+				}
+			}
+
+			else
+			{
+				$rs = safe_rows_start('name, title', 'txp_category', 
+					"type = '$type' and name not in('default','root') $exclude order by name");
+			}
+		}
+
+		if ($rs)
+		{
+			$out = array();
+
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				if ($name)
+				{
+					$section = ($this_section) ? ( $s == 'default' ? '' : $s ) : $section;
+
+					$out[] = tag(str_replace('& ', '&#38; ', $title), 'a', 
+						( ($active_class and ($c == $name)) ? ' class="'.$active_class.'"' : '' ).
+						' href="'.pagelinkurl(array('s' => $section, 'c' => $name)).'"'
+					);
+				}
+			}
+
+			if ($out)
+			{
+				return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
+			}			
+		}
+
+		return '';
+	}
+
+// -------------------------------------------------------------
+// output href list of site sections
+
+	function section_list($atts) 
+	{
+		global $sitename, $s;
+
+		extract(lAtts(array(
+			'active_class'    => '',
+			'break'           => br,
+			'class'           => __FUNCTION__,
+			'default_title'   => $sitename,
+			'exclude'         => '',
+			'include_default' => '',
+			'label'           => '',
+			'labeltag'        => '',
+			'sections'        => '',
+			'wraptag'         => '',
+		), $atts));
+
+		if ($sections)
+		{
+			$sections = do_list($sections);
+
+			$sections = join("','", doSlash($sections));
+
+			$rs = safe_rows_start('name, title', 'txp_section', "name in ('$sections') order by field(name, '$sections')");
+		}
+
+		else
+		{
+			if ($exclude)
+			{
+				$exclude = do_list($exclude);
+
+				$exclude = join("','", doSlash($exclude));
+				
+				$exclude = "and name not in('$exclude')";
+			}
+
+			$rs = safe_rows_start('name, title', 'txp_section', "name != 'default' $exclude order by name");
+		}
+
+		if ($rs)
+		{
+			$out = array();
+
+			while ($a = nextRow($rs))
+			{
+				extract($a);
+
+				$url = pagelinkurl(array('s' => $name));
+
+				$out[] = tag($title, 'a', 
+					( ($active_class and ($s == $name)) ? ' class="'.$active_class.'"' : '' ).
+					' href="'.$url.'"'
+				);
+			}
+
+			if ($out)
+			{
+				if ($include_default)
+				{
+					$out = array_merge(array(
+						tag($default_title,'a', 
+							( ($active_class and ($s == 'default')) ? ' class="'.$active_class.'"' : '' ).
+							' href="'.hu.'"'
+						)
+					), $out);
+				}
+
+				return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
+			}
+		}
+
+		return '';
+	}
+
+// -------------------------------------------------------------
+	function search_input($atts) // input form for search queries
+	{
+		global $q, $permlink_mode;
+		extract(lAtts(array(
+			'form'    => 'search_input',
+			'wraptag' => 'p',
+			'size'    => '15',
+			'label'   => gTxt('search'),
+			'button'  => '',
+			'section' => '',
+		),$atts));	
+
+		if ($form) {
+			$rs = fetch('form','txp_form','name',$form);
+			if ($rs) {
+				return $rs;
+			}
+		}
+
+		$sub = (!empty($button)) ? '<input type="submit" value="'.$button.'" />' : '';
+		$out = fInput('text','q',$q,'','','',$size);
+		$out = (!empty($label)) ? $label.br.$out.$sub : $out.$sub;
+		$out = ($wraptag) ? tag($out,$wraptag) : $out;
+	
+		if (!$section)
+			return '<form action="'.hu.'" method="get">'.$out.'</form>';
+
+		$url = pagelinkurl(array('s'=>$section));	
+		return '<form action="'.$url.'" method="get">'.$out.'</form>';
+	}
+
+// -------------------------------------------------------------
+// link to next article, if it exists
+
+	function link_to_next($atts, $thing)
+	{
+		global $id, $next_id, $next_title;
+
+		extract(lAtts(array(
+			'showalways' => 0,
+		), $atts));
+
+		if (intval($id) == 0)
+		{
+			global $thisarticle, $s;
+
+			extract(getNextPrev(
+				@$thisarticle['thisid'],
+				@strftime('%Y-%m-%d %H:%M:%S', $thisarticle['posted']),
+				@$s
+			));
+		}
+
+		if ($next_id)
+		{
+			$url = permlinkurl_id($next_id);
+
+			if ($thing)
+			{
+				$thing = parse($thing);
+
+				return '<a rel="next" href="'.$url.'"'.
+					($next_title != $thing ? ' title="'.$next_title.'"' : '').
+					'>'.$thing.'</a>';
+			}
+
+			return $url;
+		}
+
+		return ($showalways) ? parse($thing) : '';
+	}
+
+// -------------------------------------------------------------
+// link to next article, if it exists
+
+	function link_to_prev($atts, $thing) 
+	{
+		global $id, $prev_id, $prev_title;
+
+		extract(lAtts(array(
+			'showalways' => 0,
+		), $atts));
+
+		if (intval($id) == 0)
+		{
+			global $thisarticle, $s;
+
+			extract(getNextPrev(
+				$thisarticle['thisid'],
+				@strftime('%Y-%m-%d %H:%M:%S', $thisarticle['posted']), 
+				@$s
+			));
+		}
+
+		if ($prev_id)
+		{
+			$url = permlinkurl_id($prev_id);
+
+			if ($thing)
+			{
+				$thing = parse($thing);
+
+				return '<a rel="prev" href="'.$url.'"'.
+					($prev_title != $thing ? ' title="'.$prev_title.'"' : '').
+					'>'.$thing.'</a>';
+			}
+
+			return $url;
+		}
+
+		return ($showalways) ? parse($thing) : '';
+	}
+
+// -------------------------------------------------------------
+
+	function next_title()
+	{
+		return $GLOBALS['next_title'];
+	}
+
+// -------------------------------------------------------------
+
+	function prev_title()
+	{
+		return $GLOBALS['prev_title'];
+	}
+
+// -------------------------------------------------------------
+
+	function site_slogan()
+	{
+		return $GLOBALS['site_slogan'];
+	}
+
+// -------------------------------------------------------------
+	
+	function link_to_home($atts, $thing = false) 
+	{
+		extract(lAtts(array(
+			'class' => false,
+		), $atts));
+
+		if ($thing)
+		{
+			$class = ($class) ? ' class="'.$class.'"' : '';
+			return '<a rel="home" href="'.hu.'"'.$class.'>'.parse($thing).'</a>';
+		}
+
+		return hu;
+	}
+
+// -------------------------------------------------------------
+
+	function newer($atts, $thing = false, $match = '')
+	{
+		global $thispage, $pretext, $permlink_mode;
+
+		extract(lAtts(array(
+			'showalways' => 0,
+		), $atts));
+
+		$numPages = $thispage['numPages'];
+		$pg				= $thispage['pg'];
+
+		if ($numPages > 1 and $pg > 1)
+		{
+			$nextpg = ($pg - 1 == 1) ? 0 : ($pg - 1);
+
+			$url = pagelinkurl(array(
+				'pg'		 => $nextpg,
+				's'			 => @$pretext['s'],
+				'c'			 => @$pretext['c'],
+				'q'			 => @$pretext['q'],
+				'author' => @$pretext['author']
+			));
+
+			if ($thing)
+			{
+				return '<a href="'.$url.'"'.
+					(empty($title) ? '' : ' title="'.$title.'"').
+					'>'.parse($thing).'</a>';
+			}
+
+			return $url;
+		}
+
+		return ($showalways) ? parse($thing) : '';
+	}
+
+// -------------------------------------------------------------
+
+	function older($atts, $thing = false, $match = '')
+	{
+		global $thispage, $pretext, $permlink_mode;
+
+		extract(lAtts(array(
+			'showalways' => 0,
+		), $atts));
+
+		$numPages = $thispage['numPages'];
+		$pg				= $thispage['pg'];
+
+		if ($numPages > 1 and $pg != $numPages)
+		{
+			$nextpg = $pg + 1;
+
+			$url = pagelinkurl(array(
+				'pg'		 => $nextpg,
+				's'			 => @$pretext['s'],
+				'c'			 => @$pretext['c'],
+				'q'			 => @$pretext['q'],
+				'author' => @$pretext['author']
+			));
+
+			if ($thing)
+			{
+				return '<a href="'.$url.'"'.
+					(empty($title) ? '' : ' title="'.$title.'"').
+					'>'.parse($thing).'</a>';
+			}
+
+			return $url;
+		}
+
+		return ($showalways) ? parse($thing) : '';
+	}
+
+// -------------------------------------------------------------
+	function text($atts) 
+	{
+		extract(lAtts(array(
+			'item' => '',
+		),$atts));
+		return ($item) ? gTxt($item) : '';
+	}
+
+// -------------------------------------------------------------
+
+	function article_id()
+	{
+		global $thisarticle;
+
+		assert_article();
+
+		return $thisarticle['thisid'];
+	}
+
+// -------------------------------------------------------------
+
+	function if_article_id($atts, $thing)
+	{
+		global $thisarticle;
+
+		assert_article();
+
+		extract(lAtts(array(
+			'id' => '',
+		), $atts));
+
+		if ($id)
+		{
+			return parse(EvalElse($thing, in_list($thisarticle['thisid'], $id)));
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function posted($atts)
+	{
+		global $thisarticle, $id, $c, $pg, $dateformat, $archive_dateformat;
+
+		assert_article();
+
+		extract(lAtts(array(
+			'class'   => '',
+			'format'  => '',
+			'gmt'     => '',
+			'lang'    => '',
+			'wraptag' => '',
+		), $atts));
+
+		if ($format)
+		{
+			$out = safe_strftime($format, $thisarticle['posted'], $gmt, $lang);
+		}
+
+		else
+		{
+			if ($id or $c or $pg)
+			{
+				$out = safe_strftime($archive_dateformat, $thisarticle['posted']);
+			}
+
+			else
+			{
+				$out = safe_strftime($dateformat, $thisarticle['posted']);
+			}
+		}
+
+		return ($wraptag) ? doWrap($out, $wraptag, '', $class) : $out;
+	}
+
+// -------------------------------------------------------------
+
+	function comments_count($atts) 
+	{
+		global $thisarticle;
+
+		assert_article();
+
+		return $thisarticle['comments_count'];
+	}
+
+// -------------------------------------------------------------
+	function comments_invite($atts) 
+	{
+		global $thisarticle,$is_article_list;
+
+		assert_article();
+		
+		extract($thisarticle);
+		global $comments_mode;
+
+		if (!$comments_invite)
+			$comments_invite = @$GLOBALS['prefs']['comments_default_invite'];
+
+		extract(lAtts(array(
+			'class'		=> __FUNCTION__,
+			'showcount'	=> true,
+			'textonly'	=> false,
+			'showalways'=> false,  //FIXME in crockery. This is only for BC.
+			'wraptag'   => '',
+		), $atts));
+
+		$invite_return = '';
+		if (($annotate or $comments_count) && ($showalways or $is_article_list) ) {
+
+			$ccount = ($comments_count && $showcount) ?  ' ['.$comments_count.']' : '';
+			if ($textonly)
+				$invite_return = $comments_invite.$ccount;
+			else
+			{
+				if (!$comments_mode) {
+					$invite_return = doTag($comments_invite, 'a', $class, ' href="'.permlinkurl($thisarticle).'#'.gTxt('comment').'" '). $ccount;
+				} else {
+					$invite_return = "<a href=\"".hu."?parentid=$thisid\" onclick=\"window.open(this.href, 'popupwindow', 'width=500,height=500,scrollbars,resizable,status'); return false;\"".(($class) ? ' class="'.$class.'"' : '').'>'.$comments_invite.'</a> '.$ccount;
+				}
+			}
+			if ($wraptag) $invite_return = doTag($invite_return, $wraptag, $class);
+		}
+
+		return $invite_return;
+	}
+// -------------------------------------------------------------
+
+	function comments_form($atts)
+	{
+		global $thisarticle, $has_comments_preview, $pretext;
+
+		extract(lAtts(array(
+			'class'        => __FUNCTION__,
+			'form'         => 'comment_form',
+			'id'           => @$pretext['id'],
+			'isize'        => '25',
+			'msgcols'      => '25',
+			'msgrows'      => '5',
+			'msgstyle'     => '',
+			'show_preview' => empty($has_comments_preview),
+			'wraptag'      => '',
+		), $atts));
+
+		assert_article();
+
+		if (is_array($thisarticle)) extract($thisarticle);
+
+		if (@$thisid) $id = $thisid;
+
+		$out = '';
+		if ($id) {
+			if (!checkCommentsAllowed($id)) {
+				$out = graf(gTxt("comments_closed"));
+			} elseif (gps('commented')!=='') {
+				$out = gTxt("comment_posted");
+				if (gps('commented')==='0')
+					$out .= " ". gTxt("comment_moderated");
+				$out = graf($out, ' id="txpCommentInputForm"');
+			} else {
+				# display a comment preview if required
+				if (ps('preview') and $show_preview)
+					$out = comments_preview(array());
+				$out .= commentForm($id,$atts);
+			}
+
+			return (!$wraptag ? $out : doTag($out,$wraptag,$class) );
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function comments_error($atts)
+	{
+		extract(lAtts(array(
+			'break'		=> 'br',
+			'class'		=> __FUNCTION__,
+			'wraptag'	=> 'div',
+		), $atts));
+
+		$evaluator =& get_comment_evaluator();
+
+		$errors = $evaluator->get_result_message();
+
+		if ($errors)
+		{
+			return doWrap($errors, $wraptag, $break, $class);
+		}
+	}
+
+// -------------------------------------------------------------
+	function if_comments_error($atts, $thing)
+	{
+		$evaluator =& get_comment_evaluator();
+		return parse(EvalElse($thing,(count($evaluator -> get_result_message()) > 0)));
+	}
+
+// -------------------------------------------------------------
+	# DEPRECATED - provided only for backwards compatibility
+	# this functionality will be merged into comments_invite
+	# no point in having two tags for one functionality
+	function comments_annotateinvite($atts,$thing=NULL)
+	{
+		global $thisarticle, $pretext;
+
+		extract(lAtts(array(
+			'id'		   => @$pretext['id'],
+			'class'		=> __FUNCTION__,
+			'wraptag'	=> 'h3',
+		),$atts));
+
+		assert_article();
+		
+		if (is_array($thisarticle)) extract($thisarticle);
+
+		if (@$thisid) $id = $thisid;
+
+		if ($id) {
+			extract(
+				safe_row(
+					"Annotate,AnnotateInvite,unix_timestamp(Posted) as uPosted",
+						"textpattern", 'ID = '.intval($id)
+				)
+			);
+
+			if (!$thing)
+				$thing = $AnnotateInvite;
+
+			return (!$Annotate) ? '' : doTag($thing,$wraptag,$class,' id="'.gTxt('comment').'"');
+		}
+	}
+
+// -------------------------------------------------------------
+	function comments($atts)
+	{
+		global $thisarticle, $prefs, $pretext;
+		extract($prefs);
+
+		extract(lAtts(array(
+			'id'		   => @$pretext['id'],
+			'form'		=> 'comments',
+			'wraptag'	=> ($comments_are_ol ? 'ol' : ''),
+			'break'		=> ($comments_are_ol ? 'li' : 'div'),
+			'class'		=> __FUNCTION__,
+			'breakclass'=> '',
+		),$atts));	
+
+		assert_article();
+		
+		if (is_array($thisarticle)) extract($thisarticle);
+
+		if (@$thisid) $id = $thisid;
+
+		$Form = fetch_form($form);
+
+		$rs = safe_rows_start("*, unix_timestamp(posted) as time", "txp_discuss",
+			'parentid='.intval($id).' and visible='.VISIBLE.' order by posted asc');
+
+		$out = '';
+
+		if ($rs) {
+			$comments = array();
+
+			while($vars = nextRow($rs)) {
+				$GLOBALS['thiscomment'] = $vars;
+				$comments[] = parse($Form).n;
+				unset($GLOBALS['thiscomment']);
+			}
+
+			$out .= doWrap($comments,$wraptag,$break,$class,$breakclass);
+		}
+
+		return $out;
+	}
+	
+// -------------------------------------------------------------
+	function comments_preview($atts, $thing='', $me='')
+	{
+		global $thisarticle, $has_comments_preview;
+		if (!ps('preview'))
+			return;
+
+
+		extract(lAtts(array(
+			'id'		   => @$pretext['id'],
+			'form'		=> 'comments',
+			'wraptag'	=> '',
+			'class'		=> __FUNCTION__,
+		),$atts));
+
+
+		assert_article();
+		
+		if (is_array($thisarticle)) extract($thisarticle);
+
+		if (@$thisid) $id = $thisid;
+
+		$Form = fetch_form($form);
+
+		$preview = psas(array('name','email','web','message','parentid','remember'));
+		$preview['time'] = time();
+		$preview['discussid'] = 0;
+		if ($preview['message'] == '')
+		{
+			$in = getComment();
+			$preview['message'] = $in['message'];
+
+		}
+		$preview['message'] = markup_comment($preview['message']);
+
+		$GLOBALS['thiscomment'] = $preview;
+		$comments = parse($Form).n;
+		unset($GLOBALS['thiscomment']);
+		$out = doTag($comments,$wraptag,$class);
+		
+		# set a flag, to tell the comments_form tag that it doesn't have to show a preview
+		$has_comments_preview = true;
+
+		return $out;
+	}
+	
+// -------------------------------------------------------------
+	function if_comments_preview($atts, $thing)	
+	{
+		return parse(EvalElse($thing, ps('preview') && checkCommentsAllowed(gps('parentid')) ));
+	}
+
+// -------------------------------------------------------------
+	function comment_permlink($atts,$thing) 
+	{
+		global $thisarticle, $thiscomment;
+
+		assert_article();
+		
+		extract($thiscomment);
+		extract(lAtts(array(
+			'anchor' => empty($thiscomment['has_anchor_tag']),
+		),$atts));
+
+		$dlink = permlinkurl($thisarticle).'#c'.$discussid;
+		
+		$thing = parse($thing);
+
+		$name = ($anchor ? ' id="c'.$discussid.'"' : '');
+	
+		return tag($thing,'a',' href="'.$dlink.'"'.$name);
+	}
+
+// -------------------------------------------------------------
+	function comment_id($atts) 
+	{
+		global $thiscomment;
+
+		assert_comment();
+		
+		return $thiscomment['discussid'];
+	}
+
+// -------------------------------------------------------------
+
+	function comment_name($atts)
+	{
+		global $thiscomment, $prefs;
+
+		assert_comment();
+
+		extract($prefs);
+		extract($thiscomment);
+
+		extract(lAtts(array(
+			'link' => 1,
+		), $atts));
+
+		if ($link)
+		{
+			$web = str_replace('http://', '', $web);
+			$nofollow = (@$comment_nofollow ? ' rel="nofollow"' : '');
+
+			if ($web)
+			{
+				return '<a href="http://'.$web.'"'.$nofollow.'>'.$name.'</a>';
+			}
+
+			if ($email && !$never_display_email)
+			{
+				return '<a href="'.eE('mailto:'.$email).'"'.$nofollow.'>'.$name.'</a>';
+			}
+		}
+
+		return $name;
+	}
+
+// -------------------------------------------------------------
+	function comment_email($atts) 
+	{
+		global $thiscomment;
+
+		assert_comment();
+		
+		return $thiscomment['email'];
+	}
+
+// -------------------------------------------------------------
+	function comment_web($atts) 
+	{
+		global $thiscomment;
+		assert_comment();
+		
+		return $thiscomment['web'];
+	}
+
+// -------------------------------------------------------------
+
+	function comment_time($atts)
+	{
+		global $thiscomment, $comments_dateformat;
+
+		assert_comment();
+
+		extract(lAtts(array(
+			'format' => $comments_dateformat,
+			'gmt'		 => '',
+			'lang'	 => '',
+		), $atts));
+
+		return safe_strftime($format, $thiscomment['time'], $gmt, $lang);
+	}
+
+// -------------------------------------------------------------
+	function comment_message($atts) 
+	{
+		global $thiscomment;
+		assert_comment();
+		
+		return $thiscomment['message'];
+	}
+
+// -------------------------------------------------------------
+	function comment_anchor($atts) 
+	{
+		global $thiscomment;
+
+		assert_comment();
+		
+		$thiscomment['has_anchor_tag'] = 1;
+		return '<a id="c'.$thiscomment['discussid'].'"></a>';
+	}
+
+// -------------------------------------------------------------
+// DEPRECATED: the old comment message body tag
+	function message($atts) 
+	{
+		return comment_message($atts);
+	}
+
+// -------------------------------------------------------------
+
+	function author($atts)
+	{
+		global $thisarticle, $s;
+
+		assert_article();
+
+		extract(lAtts(array(
+			'link'				 => '',
+			'section'			 => '',
+			'this_section' => 0,
+		), $atts));
+
+		$author_name = get_author_name($thisarticle['authorid']);
+
+		$section = ($this_section) ? ( $s == 'default' ? '' : $s ) : $section;
+
+		return ($link) ?
+			href($author_name, pagelinkurl(array('s' => $section, 'author' => $author_name))) :
+			$author_name;
+	}
+
+// -------------------------------------------------------------
+
+	function if_author($atts, $thing)
+	{
+		global $author;		
+
+		extract(lAtts(array(
+			'name' => '',
+		), $atts));
+
+		if ($name)
+		{
+			return parse(EvalElse($thing, in_list($author, $name)));
+		}
+
+		return parse(EvalElse($thing, !empty($author)));
+	}
+
+// -------------------------------------------------------------
+
+	function if_article_author($atts, $thing)
+	{
+		global $thisarticle;
+
+		extract(lAtts(array(
+			'name' => '',
+		), $atts));
+
+		$author = $thisarticle['authorid'];
+
+		if ($name)
+		{
+			return parse(EvalElse($thing, in_list($author, $name)));
+		}
+
+		return parse(EvalElse($thing, !empty($author)));
+	}
+	
+// -------------------------------------------------------------
+
+function body($atts) 
+	{
+		global $thisarticle, $is_article_body;
+		assert_article();
+		
+		$is_article_body = 1;		
+		$out = parse($thisarticle['body']);
+		$is_article_body = 0;
+		return $out;
+	}	
+	
+// -------------------------------------------------------------
+	function title($atts) 
+	{
+		global $thisarticle, $prefs;
+		assert_article();
+		extract(lAtts(array(
+			'no_widow' => @$prefs['title_no_widow'],
+		), $atts));
+		
+		$t = escape_title($thisarticle['title']);
+		if ($no_widow)
+			$t = noWidow($t);
+		return $t;
+	}
+
+// -------------------------------------------------------------
+	function excerpt($atts) 
+	{
+		global $thisarticle, $is_article_body;
+		assert_article();
+		
+		$is_article_body = 1;		
+		$out = parse($thisarticle['excerpt']);
+		$is_article_body = 0;
+		return $out;
+	}
+
+// -------------------------------------------------------------
+
+	function category1($atts, $thing = '')
+	{
+		global $thisarticle, $s, $permlink_mode;
+
+		assert_article();
+
+		extract(lAtts(array(
+			'class'				 => '',
+			'link'				 => 0,
+			'title'				 => 0,
+			'section'			 => '',
+			'this_section' => 0,
+			'wraptag'			 => '',
+		), $atts));
+
+		if ($thisarticle['category1'])
+		{
+			$section = ($this_section) ? ( $s == 'default' ? '' : $s ) : $section;
+			$category = $thisarticle['category1'];
+
+			$label = ($title) ? fetch_category_title($category) : $category;
+
+			if ($thing)
+			{
+				$out = '<a'.
+					($permlink_mode != 'messy' ? ' rel="tag"' : '').
+					' href="'.pagelinkurl(array('s' => $section, 'c' => $category)).'"'.
+					($title ? ' title="'.$label.'"' : '').
+					'>'.parse($thing).'</a>';
+			}
+
+			elseif ($link)
+			{
+				$out = '<a'.
+					($permlink_mode != 'messy' ? ' rel="tag"' : '').
+					' href="'.pagelinkurl(array('s' => $section, 'c' => $category)).'">'.$label.'</a>';
+			}
+
+			else
+			{
+				$out = $label;
+			}
+
+			return doTag($out, $wraptag, $class);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function category2($atts, $thing = '')
+	{
+		global $thisarticle, $s, $permlink_mode;
+
+		assert_article();
+
+		extract(lAtts(array(
+			'class'				 => '',
+			'link'				 => 0,
+			'title'				 => 0,
+			'section'			 => '',
+			'this_section' => 0,
+			'wraptag'			 => '',
+		), $atts));
+
+		if ($thisarticle['category2'])
+		{
+			$section = ($this_section) ? ( $s == 'default' ? '' : $s ) : $section;
+			$category = $thisarticle['category2'];
+
+			$label = ($title) ? fetch_category_title($category) : $category;
+
+			if ($thing)
+			{
+				$out = '<a'.
+					($permlink_mode != 'messy' ? ' rel="tag"' : '').
+					' href="'.pagelinkurl(array('s' => $section, 'c' => $category)).'"'.
+					($title ? ' title="'.$label.'"' : '').
+					'>'.parse($thing).'</a>';
+			}
+
+			elseif ($link)
+			{
+				$out = '<a'.
+					($permlink_mode != 'messy' ? ' rel="tag"' : '').
+					' href="'.pagelinkurl(array('s' => $section, 'c' => $category)).'">'.$label.'</a>';
+			}
+
+			else
+			{
+				$out = $label;
+			}
+
+			return doTag($out, $wraptag, $class);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function category($atts, $thing = '')
+	{
+		global $s, $c;
+
+		extract(lAtts(array(
+			'class'				 => '',
+			'link'				 => 0,
+			'name'				 => '',
+			'section'			 => $s, // fixme in crockery
+			'this_section' => 0,
+			'title'				 => 0,
+			'type'				 => 'article',
+			'wraptag'			 => '',
+		), $atts));
+
+		$category = ($name) ? $name : $c;
+
+		if ($category)
+		{
+			$section = ($this_section) ? ( $s == 'default' ? '' : $s ) : $section;
+			$label = ($title) ? fetch_category_title($category, $type) : $category;
+
+			if ($thing)
+			{
+				$out = '<a href="'.pagelinkurl(array('s' => $section, 'c' => $category,)).'"'.
+					($title ? ' title="'.$label.'"' : '').
+					'>'.parse($thing).'</a>';
+			}
+
+			elseif ($link)
+			{
+				$out = href($label,
+					pagelinkurl(array('s' => $section, 'c' => $category))
+				);
+			}
+
+			else
+			{
+				$out = $label;
+			}
+
+			return doTag($out, $wraptag, $class);
+		}
+	}
+
+// -------------------------------------------------------------
+
+	function section($atts, $thing = '')
+	{
+		global $thisarticle, $s;
+
+		extract(lAtts(array(
+			'class'   => '',
+			'link'		=> 0,
+			'name'		=> '',
+			'title'		=> 0,
+			'wraptag' => '',
+		), $atts));
+
+		if ($name)
+		{
+			$sec = $name;
+		}
+
+		elseif (!empty($thisarticle['section']))
+		{
+			$sec = $thisarticle['section'];
+		}
+
+		else
+		{
+			$sec = $s;
+		}
+
+		if ($sec)
+		{
+			$label = ($title) ? fetch_section_title($sec) : $sec;
+
+			if ($thing)
+			{
+				$out = '<a href="'.pagelinkurl(array('s' => $sec)).'"'.
+					($title ? ' title="'.$label.'"' : '').
+					'>'.parse($thing).'</a>';
+			}
+
+			elseif ($link)
+			{
+				$out = href($label,
+					pagelinkurl(array('s' => $sec))
+				);
+			}
+
+			else
+			{
+				$out = $label;
+			}
+
+			return doTag($out, $wraptag, $class);
+		}
+	}
+
+// -------------------------------------------------------------
+	function keywords($atts) 
+	{
+		global $thisarticle;
+		assert_article();
+
+		return ($thisarticle['keywords']) ? $thisarticle['keywords'] : '';
+	}
+
+// -------------------------------------------------------------
+
+	function article_image($atts)
+	{
+		global $thisarticle, $img_dir;
+
+		assert_article();
+
+		extract(lAtts(array(
+			'align' 	  => '', // remove in crockery
+			'class'     => '',
+			'escape'    => '',
+			'html_id'   => '',
+			'style' 	  => '', // remove in crockery?
+			'thumbnail' => 0,
+			'wraptag'   => '',
+		), $atts));
+
+		if ($thisarticle['article_image'])
+		{
+			$image = $thisarticle['article_image'];
+		}
+
+		else
+		{
+			return;
+		}
+
+		if (is_numeric($image))
+		{
+			$rs = safe_row('*', 'txp_image', 'id = '.intval($image));
+
+			if ($rs)
+			{
+				if ($thumbnail)
+				{
+					if ($rs['thumbnail'])
+					{
+						extract($rs);
+
+						if ($escape == 'html')
+						{
+							$alt = escape_output($alt);
+							$caption = escape_output($caption);
+						}
+
+						$out = '<img src="'.hu.$img_dir.'/'.$id.'t'.$ext.'" alt="'.$alt.'"'.
+							($caption ? ' title="'.$caption.'"' : '').
+							( ($html_id and !$wraptag) ? ' id="'.$html_id.'"' : '' ).
+							( ($class and !$wraptag) ? ' class="'.$class.'"' : '' ).
+							($style ? ' style="'.$style.'"' : '').
+							($align ? ' align="'.$align.'"' : '').
+							' />';
+					}
+
+					else
+					{
+						return '';
+					}
+				}
+
+				else
+				{
+					extract($rs);
+
+					if ($escape == 'html')
+					{
+						$alt = escape_output($alt);
+						$caption = escape_output($caption);
+					}
+
+					$out = '<img src="'.hu.$img_dir.'/'.$id.$ext.'" width="'.$w.'" height="'.$h.'" alt="'.$alt.'"'.
+						($caption ? ' title="'.$caption.'"' : '').
+						( ($html_id and !$wraptag) ? ' id="'.$html_id.'"' : '' ).
+						( ($class and !$wraptag) ? ' class="'.$class.'"' : '' ).
+						($style ? ' style="'.$style.'"' : '').
+						($align ? ' align="'.$align.'"' : '').
+						' />';
+				}
+			}
+
+			else
+			{
+				trigger_error(gTxt('unknown_image'));
+				return;
+			}
+		}
+
+		else
+		{
+			$out = '<img src="'.$image.'" alt=""'.
+				( ($html_id and !$wraptag) ? ' id="'.$html_id.'"' : '' ).
+				( ($class and !$wraptag) ? ' class="'.$class.'"' : '' ).
+				($style ? ' style="'.$style.'"' : '').
+				($align ? ' align="'.$align.'"' : '').
+				' />';
+		}
+
+		return ($wraptag) ? doTag($out, $wraptag, $class, '', $html_id) : $out;
+	}
+
+// -------------------------------------------------------------
+	function search_result_title($atts)
+	{
+		return permlink($atts, '<txp:title />');
+	}
+
+// -------------------------------------------------------------
+	function search_result_excerpt($atts) 
+	{
+		global $thisarticle, $pretext;
+		extract(lAtts(array(
+			'hilight'     => 'strong',
+			'limit'       => 5,
+		),$atts));
+	
+		assert_article();	
+		extract($pretext);
+		extract($thisarticle);
+		
+		$result = preg_replace("/>\s*</","> <",$body);
+		preg_match_all("/(?:\s|^).{1,50}".preg_quote($q).".{1,50}(?:\s|$)/iu",$result,$concat);
+
+		$r = array();
+		for ($i=0; $i < min($limit, count($concat[0])); $i++)
+			$r[] = trim($concat[0][$i]);
+		$concat = join(" ...\n", $r);
+
+		$concat = strip_tags($concat);
+		$concat = preg_replace('/^[^>]+>/U',"",$concat);
+		$concat = preg_replace("/(".preg_quote($q).")/i","<$hilight>$1</$hilight>",$concat);
+		return ($concat) ? "... ".$concat." ..." : '';
+	}
+
+// -------------------------------------------------------------
+	function search_result_url($atts) 
+	{
+		global $thisarticle;
+		assert_article();
+		
+		$l = permlinkurl($thisarticle);
+		return permlink($atts, $l);
+	}
+
+// -------------------------------------------------------------
+	function search_result_date($atts) 
+	{
+		assert_article();
+		return posted($atts);
+	}
+
+// -------------------------------------------------------------
+	function search_result_count($atts)
+	{
+		global $thispage;
+		$t = @$thispage['grand_total'];
+		extract(lAtts(array(
+			'text'     => ($t == 1 ? gTxt('article_found') : gTxt('articles_found')),
+		),$atts));
+
+		return $t . ($text ? ' ' . $text : '');
+	}
+
+// -------------------------------------------------------------
+	function image_index($atts)
+	{
+		global $permlink_mode,$s,$c,$p,$txpcfg,$img_dir,$path_to_site;
+		extract(lAtts(array(
+			'label'    => '',
+			'break'    => br,
+			'wraptag'  => '',
+			'parent'   => '',
+			'type'    => 'article',
+			'class'    => __FUNCTION__,
+			'labeltag' => '',
+			'c' => doSlash($c), // Keep the option to override categories due to backward compatiblity
+		),$atts));
+		$c = doSlash($c);
+		
+		$rs = safe_rows_start("*", "txp_image","category='$c' and thumbnail=1 order by name");
+
+		if ($rs) {
+			$out = array();
+			while ($a = nextRow($rs)) {
+				extract($a);
+				$impath = $img_dir.'/'.$id.'t'.$ext;
+				$imginfo = getimagesize($path_to_site.'/'.$impath);
+				$dims = (!empty($imginfo[3])) ? ' '.$imginfo[3] : '';
+				$url = pagelinkurl(array('c'=>$c, 's'=>$s, 'p'=>$id));
+				$out[] = '<a href="'.$url.'">'.
+               '<img src="'.hu.$impath.'"'.$dims.' alt="'.$alt.'" />'.'</a>';
+
+			}
+			if (count($out)) {
+				return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
+			}	
+		}
+		return '';
+	}
+
+// -------------------------------------------------------------
+	function image_display($atts) 
+	{
+		if (is_array($atts)) extract($atts);
+		global $s,$c,$p,$img_dir;
+		if($p) {
+			$rs = safe_row("*", "txp_image", 'id='.intval($p).' limit 1');
+			if ($rs) {
+				extract($rs);
+				$impath = hu.$img_dir.'/'.$id.$ext;
+				return '<img src="'.$impath.
+					'" style="height:'.$h.'px;width:'.$w.'px" alt="'.$alt.'" />';
+			}
+		}
+	}
+
+// -------------------------------------------------------------
+	function if_comments($atts, $thing)	
+	{
+		global $thisarticle;
+		assert_article();
+
+		return parse(EvalElse($thing, ($thisarticle['comments_count'] > 0)));
+	}
+
+// -------------------------------------------------------------
+	function if_comments_allowed($atts, $thing)
+	{
+		global $thisarticle, $pretext;
+
+		$id = gAtt($atts,'id',gps('id'));
+		if ($thisarticle['thisid']) $id = $thisarticle['thisid'];
+		if (!$id && @$pretext['id']) $id = $pretext['id'];
+		return parse(EvalElse($thing, checkCommentsAllowed($id)));
+	}
+
+// -------------------------------------------------------------
+	function if_comments_disallowed($atts, $thing)
+	{
+		global $thisarticle, $pretext;
+
+		$id = gAtt($atts,'id',gps('id'));
+		if ($thisarticle['thisid']) $id = $thisarticle['thisid'];
+		if (!$id && @$pretext['id']) $id = $pretext['id'];
+		return parse(EvalElse($thing, !checkCommentsAllowed($id)));
+	}
+
+// -------------------------------------------------------------
+	function if_individual_article($atts, $thing)	
+	{
+		global $is_article_list;
+		return parse(EvalElse($thing, ($is_article_list == false)));
+	}
+
+// -------------------------------------------------------------
+	function if_article_list($atts, $thing)	
+	{
+		global $is_article_list;
+		return parse(EvalElse($thing, ($is_article_list == true)));
+	}
+
+// -------------------------------------------------------------
+	function meta_keywords() 
+	{
+		global $id_keywords;
+		return ($id_keywords)
+		?	'<meta name="keywords" content="'.$id_keywords.'" />'
+		:	'';
+	}
+
+// -------------------------------------------------------------
+	function meta_author() 
+	{
+		global $id_author;
+		return ($id_author)
+		?	'<meta name="author" content="'.$id_author.'" />'
+		:	'';
+	}
+
+// -------------------------------------------------------------
+
+	function doWrap($list, $wraptag, $break, $class = '', $breakclass = '', $atts = '', $breakatts = '', $id = '')
+	{
+		if (!$list)
+		{
+			return '';
+		}
+
+		if ($id)
+		{
+			$atts .= ' id="'.$id.'"';
+		}
+
+		if ($class)
+		{
+			$atts .= ' class="'.$class.'"';
+		}
+
+		$breakatts = ($breakclass) ? ' class="'.$breakclass.'"' : '';
+
+		// non-enclosing breaks
+		if (!preg_match('/^\w+$/', $break) or $break == 'br' or $break == 'hr')
+		{
+			if ($break == 'br' or $break == 'hr')
+			{
+				$break = "<$break $breakatts/>";
+			}
+
+			return ($wraptag) ?	tag(join($break.n, $list), $wraptag, $atts) :	join(n.$break, $list);
+		}
+
+		// enclosing breaks should be specified by name only, no '<' or '>'
+		if (($wraptag == 'ul' or $wraptag == 'ol') and empty($break))
+		{
+			$break = 'li';
+		}
+
+		return ($wraptag) ?
+			tag(n.t.tag(join("</$break>".n.t."<{$break}{$breakatts}>", $list), $break, $breakatts).n, $wraptag, $atts) :
+			tag(n.join("</$break>".n."<{$break}{$breakatts}>".n, $list).n, $break, $breakatts);
+	}
+
+// -------------------------------------------------------------
+
+	function doTag($content, $tag, $class = '', $atts = '', $id = '')
+	{
+		if ($id)
+		{
+			$atts .= ' id="'.$id.'"';
+		}
+
+		if ($class)
+		{
+			$atts .= ' class="'.$class.'"';
+		}
+
+		if (!$tag)
+		{
+			return $content;
+		}
+
+		return ($content) ? tag($content, $tag, $atts) : "<$tag $atts />";
+	}
+
+// -------------------------------------------------------------
+	function doLabel($label='', $labeltag='')
+	{
+		if ($label) {
+			return (empty($labeltag)? $label.'<br />' : tag($label, $labeltag));
+		}
+		return '';
+	}
+	
+// -------------------------------------------------------------
+
+	function permlink($atts, $thing = NULL)
+	{
+		global $thisarticle;
+
+		extract(lAtts(array(
+			'class' => '',
+			'id'		=> '',
+			'style' => '',
+			'title' => '',
+		), $atts));
+
+		if (!$id)
+		{
+			assert_article();
+		}
+
+		$url = ($id) ? permlinkurl_id($id) : permlinkurl($thisarticle);
+
+		if ($url)
+		{
+			if ($thing === NULL)
+			{
+				return $url;
+			}
+
+			if ($title == false and ($id == false or $id == $thisarticle['thisid']))
+			{
+				$title = gTxt('permanent_link');
+			}
+
+			return tag(parse($thing), 'a', ' rel="bookmark" href="'.$url.'"'.
+				($title ? ' title="'.$title.'"' : '').
+				($style ? ' style="'.$style.'"' : '').
+				($class ? ' class="'.$class.'"' : '')
+			);
+		}
+	}
+
+// -------------------------------------------------------------
+	function permlinkurl_id($ID)
+	{
+		$article = safe_row(
+			"*,ID as thisid, unix_timestamp(Posted) as posted",
+			"textpattern",
+			'ID='.intval($ID));
+		
+		return permlinkurl($article);
+	}
+
+// -------------------------------------------------------------
+	function permlinkurl($article_array) 
+	{
+		global $permlink_mode, $prefs;
+
+		if (isset($prefs['custom_url_func']) and is_callable($prefs['custom_url_func']))
+			return call_user_func($prefs['custom_url_func'], $article_array);
+
+		if (empty($article_array)) return;
+		
+		extract($article_array);
+		
+		if (!isset($title)) $title = $Title;
+		if (empty($url_title)) $url_title = stripSpace($title);
+		if (empty($section)) $section = $Section; // lame, huh?
+		if (empty($posted)) $posted = $Posted;
+		if (empty($thisid)) $thisid = $ID;
+
+		$section = urlencode($section);
+		$url_title = urlencode($url_title);
+		
+		switch($permlink_mode) {
+			case 'section_id_title':
+				if ($prefs['attach_titles_to_permalinks'])
+				{
+					return hu."$section/$thisid/$url_title";
+				}else{
+					return hu."$section/$thisid/";
+				}
+			case 'year_month_day_title':
+				list($y,$m,$d) = explode("-",date("Y-m-d",$posted));
+				return hu."$y/$m/$d/$url_title";
+			case 'id_title':
+				if ($prefs['attach_titles_to_permalinks'])
+				{
+					return hu."$thisid/$url_title";
+				}else{
+					return hu."$thisid/";
+				}
+			case 'section_title':
+				return hu."$section/$url_title";
+			case 'title_only':
+				return hu."$url_title";	
+			case 'messy':
+				return hu."index.php?id=$thisid";	
+		}
+	}
+	
+// -------------------------------------------------------------	
+	function lang($atts)
+	{
+		return LANG;
+	}
+
+// -------------------------------------------------------------
+	# DEPRECATED - provided only for backwards compatibility
+	function formatPermLink($ID,$Section)
+	{
+		return permlinkurl_id($ID);
+	}
+
+// -------------------------------------------------------------
+	# DEPRECATED - provided only for backwards compatibility
+	function formatCommentsInvite($AnnotateInvite,$Section,$ID)
+	{
+		global $comments_mode;
+
+		$dc = safe_count('txp_discuss','parentid='.intval($ID).' and visible='.VISIBLE);
+
+		$ccount = ($dc) ?  '['.$dc.']' : '';
+		if (!$comments_mode) {
+			return '<a href="'.permlinkurl_id($ID).'/#'.gTxt('comment').
+				'">'.$AnnotateInvite.'</a>'. $ccount;
+		} else {
+			return "<a href=\"".hu."?parentid=$ID\" onclick=\"window.open(this.href, 'popupwindow', 'width=500,height=500,scrollbars,resizable,status'); return false;\">".$AnnotateInvite.'</a> '.$ccount;
+		}
+
+	}
+// -------------------------------------------------------------
+	# DEPRECATED - provided only for backwards compatibility
+   function doPermlink($text, $plink, $Title, $url_title)
+	{
+		global $url_mode;
+		$Title = ($url_title) ? $url_title : stripSpace($Title);
+		$Title = ($url_mode) ? $Title : '';
+		return preg_replace("/<(txp:permlink)>(.*)<\/\\1>/sU",
+			"<a href=\"".$plink.$Title."\" title=\"".gTxt('permanent_link')."\">$2</a>",$text);
+	}
+
+// -------------------------------------------------------------
+	# DEPRECATED - provided only for backwards compatibility
+	function doArticleHref($ID,$Title,$url_title,$Section)
+	{
+		$conTitle = ($url_title) ? $url_title : stripSpace($Title);	
+		return ($GLOBALS['url_mode'])
+		?	tag($Title,'a',' href="'.hu.$Section.'/'.$ID.'/'.$conTitle.'"')
+		:	tag($Title,'a',' href="'.hu.'index.php?id='.$ID.'"');
+	}
+
+// -------------------------------------------------------------
+// Testing breadcrumbs
+	function breadcrumb($atts)
+	{
+		global $pretext,$thisarticle,$sitename;
+		
+		extract(lAtts(array(
+			'wraptag' => 'p',
+			'sep' => '&#160;&#187;&#160;',
+			'link' => 'y',
+			'label' => $sitename,
+			'title' => '',
+			'class' => '',
+			'linkclass' => 'noline',
+		),$atts));
+		$linked = ($link == 'y')? true: false; 		
+		if ($linked) $label = doTag($label,'a',$linkclass,' href="'.hu.'"');
+		
+		$content = array();
+		extract($pretext);
+		if(!empty($s) && $s!= 'default')
+		{ 
+			$section_title = ($title) ? fetch_section_title($s) : $s;
+			$section_title_html = escape_title($section_title);
+			$content[] = ($linked)? (
+					doTag($section_title_html,'a',$linkclass,' href="'.pagelinkurl(array('s'=>$s)).'"')
+				):$section_title_html;
+		}
+		
+		$category = empty($c)? '': $c;
+
+		foreach (getTreePath($category, 'article') as $cat) {
+			if ($cat['name'] != 'root') {
+				$category_title_html = $title ? escape_title($cat['title']) : $cat['name'];
+				$content[] = ($linked)? 
+					doTag($category_title_html,'a',$linkclass,' href="'.pagelinkurl(array('c'=>$cat['name'])).'"')
+						:$category_title_html;
+			}
+		}
+
+		//Add the label at the end, to prevent breadcrumb for home page
+		if (!empty($content)) $content = array_merge(array($label),$content);
+		//Add article title without link if we're on an individual archive page?
+		return doTag(join($sep, $content), $wraptag, $class);
+	}
+
+
+//------------------------------------------------------------------------
+
+	function if_excerpt($atts, $thing)
+	{
+	        global $thisarticle;
+           assert_article();
+	        # eval condition here. example for article excerpt
+	        $excerpt = trim($thisarticle['excerpt']);
+	        $condition = (!empty($excerpt))? true : false;
+	        return parse(EvalElse($thing, $condition));
+	}
+
+//--------------------------------------------------------------------------
+// Searches use default page. This tag allows you to use different templates if searching
+//--------------------------------------------------------------------------
+
+	function if_search($atts, $thing)
+	{
+		$searching = gps('q');
+		$condition = (!empty($searching))? true : false;
+		return parse(EvalElse($thing, $condition));
+	}
+
+//--------------------------------------------------------------------------
+	function if_category($atts, $thing)
+	{
+		global $c;
+
+		extract(lAtts(array(
+			'name' => '',
+		),$atts));
+
+		if (trim($name)) {
+			return parse(EvalElse($thing, in_list($c, $name)));
+		}
+
+		return parse(EvalElse($thing, !empty($c)));
+	}
+
+//--------------------------------------------------------------------------
+	function if_article_category($atts, $thing)
+	{
+		global $thisarticle;
+		assert_article();
+
+		extract(lAtts(array(
+			'name' => '',
+			'number' => '',
+		),$atts));
+
+		if ($number)
+			$cats = array($thisarticle['category' . $number]);
+		else
+			$cats = array_unique(array($thisarticle['category1'], $thisarticle['category2']));
+
+		sort($cats);
+		if ($name)
+			return parse(EvalElse($thing, (in_array($name, $cats))));
+
+		return parse(EvalElse($thing, (array_shift($cats) != '')));
+	}
+
+//--------------------------------------------------------------------------
+	function if_section($atts, $thing)
+	{
+		global $pretext;
+		extract($pretext);
+
+		extract(lAtts(array(
+			'name' => '',
+		),$atts));
+
+		$section = ($s == 'default' ? '' : $s);
+
+		if ($section)
+			return parse(EvalElse($thing, in_list($section, $name)));
+		else
+			return parse(EvalElse($thing, in_list('', $name) or in_list('default', $name)));
+
+	}
+
+//--------------------------------------------------------------------------
+	function if_article_section($atts, $thing)
+	{
+		global $thisarticle;
+		assert_article();
+
+		extract(lAtts(array(
+			'name' => '',
+		),$atts));
+
+		$section = $thisarticle['section'];
+
+		return parse(EvalElse($thing, in_list($section, $name)));
+	}
+
+//--------------------------------------------------------------------------
+	function php($atts, $thing)
+	{
+		global $is_article_body, $thisarticle, $prefs;
+
+		ob_start();
+		if (empty($is_article_body)) {
+			if (!empty($prefs['allow_page_php_scripting']))
+				eval($thing);
+			else
+				trigger_error(gTxt('php_code_disabled_page'));
+		}
+		else {
+			if (!empty($prefs['allow_article_php_scripting'])) {
+				if (has_privs('article.php', $thisarticle['authorid']))
+					eval($thing);
+				else
+					trigger_error(gTxt('php_code_forbidden_user'));
+			}
+			else
+				trigger_error(gTxt('php_code_disabled_article'));
+		}
+		return ob_get_clean();
+	}
+	
+//--------------------------------------------------------------------------
+	function custom_field($atts)
+	{
+		global $thisarticle, $prefs;
+		assert_article();
+		
+		extract(lAtts(array(
+			'name' => @$prefs['custom_1_set'],
+			'escape' => '',
+			'default' => '',
+		),$atts));
+
+		if (!empty($thisarticle[$name]))
+			$out = $thisarticle[$name];
+		else
+			$out = $default;
+
+		return ($escape == 'html' ? escape_output($out) : $out);
+	}	
+	
+//--------------------------------------------------------------------------
+	function if_custom_field($atts, $thing)
+	{
+		global $thisarticle, $prefs;
+		assert_article();
+		
+		extract(lAtts(array(
+			'name' => @$prefs['custom_1_set'],
+			'val' => NULL,
+		),$atts));
+
+		if ($val !== NULL)
+			$cond = (@$thisarticle[$name] == $val);
+		else
+			$cond = !empty($thisarticle[$name]);
+
+		return parse(EvalElse($thing, $cond));
+	}	
+
+// -------------------------------------------------------------
+	function site_url($atts) 
+	{
+		return hu;
+	}
+
+// -------------------------------------------------------------
+	function img($atts) 
+	{
+		extract(lAtts(array(
+			'src' => '',
+		), $atts));
+
+		$img = rtrim(hu, '/').'/'.ltrim($src, '/');
+
+		$out = '<img src="'.$img.'" />';
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+	function error_message($atts) 
+	{
+		return @$GLOBALS['txp_error_message'];
+	}
+
+// -------------------------------------------------------------
+	function error_status($atts) 
+	{
+		return @$GLOBALS['txp_error_status'];
+	}
+
+// -------------------------------------------------------------
+	function if_status($atts, $thing='') 
+	{
+		global $pretext;
+
+		extract(lAtts(array(
+			'status' => '200',
+		), $atts));
+
+		$page_status = !empty($GLOBALS['txp_error_code']) 
+			? $GLOBALS['txp_error_code'] 
+			: $pretext['status'];
+
+		return parse(EvalElse($thing, $status == $page_status));
+	}
+
+// -------------------------------------------------------------
+	function page_url($atts) 
+	{
+		global $pretext;
+
+		extract(lAtts(array(
+			'type' => 'request_uri',
+		), $atts));
+
+		return @htmlspecialchars($pretext[$type]);	
+	}
+
+// -------------------------------------------------------------
+	function if_different($atts, $thing) 
+	{
+		static $last;
+
+		$key = md5($thing);
+
+		$cond = EvalElse($thing, 1);
+
+		$out = parse($cond);
+		if (empty($last[$key]) or $out != $last[$key]) {
+			return $last[$key] = $out;
+		}
+		else
+			return parse(EvalElse($thing, 0));
+	}
+
+// -------------------------------------------------------------
+	function if_first_article($atts, $thing) 
+	{
+		global $thisarticle;
+		assert_article();
+		return parse(EvalElse($thing, !empty($thisarticle['is_first'])));
+	}
+
+// -------------------------------------------------------------
+	function if_last_article($atts, $thing) 
+	{
+		global $thisarticle;
+		assert_article();
+		return parse(EvalElse($thing, !empty($thisarticle['is_last'])));
+	}
+
+// -------------------------------------------------------------
+	function if_plugin($atts, $thing) 
+	{
+		global $plugins, $plugins_ver;
+		extract(lAtts(array(
+			'name'    => '',
+			'ver'     => '',
+		),$atts));	
+
+		return parse(EvalElse($thing, @in_array($name, $plugins) and (!$ver or version_compare($plugins_ver[$name], $ver) >= 0)));
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_list($atts)
+	{
+		global $thisfile;
+
+		extract(lAtts(array(
+			'break'		 => br,
+			'category' => '',
+			'class'		 => __FUNCTION__,
+			'form'		 => 'files',
+			'label'		 => '',
+			'labeltag' => '',
+			'limit'		 => '10',
+			'offset'	 => '0',
+			'sort'		 => 'filename asc',
+			'wraptag'	 => '',
+		), $atts));
+
+		$qparts = array(
+			($category) ? "category = '".doSlash($category)."'" : '1',
+			'order by '.doSlash($sort),
+			($limit) ? 'limit '.intval($offset).', '.intval($limit) : ''
+		);
+
+		$rs = safe_rows_start('id, filename, category, description, downloads', 'txp_file', join(' ', $qparts));
+
+		if ($rs)
+		{
+			$form = fetch_form($form);
+
+			$out = array();
+
+			while ($a = nextRow($rs))
+			{
+				$GLOBALS['thisfile'] = file_download_format_info($a);
+
+				$out[] = parse($form);
+
+				$GLOBALS['thisfile'] = '';
+			}
+
+			if ($out)
+			{
+				if ($wraptag == 'ul' or $wraptag == 'ol')
+				{
+					return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
+				}
+
+				return ($wraptag) ? tag(join($break, $out), $wraptag) : join(n, $out);
+			}
+		}
+		return '';
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download($atts)
+	{
+		global $thisfile;
+
+		extract(lAtts(array(
+			'filename' => '',
+			'form'		 => 'files',
+			'id'			 => '',
+		), $atts));
+
+		if (empty($thisfile))
+		{
+			if ($id)
+			{
+				$thisfile = fileDownloadFetchInfo('id = '.intval($id));
+			}
+
+			elseif ($filename)
+			{
+				$thisfile = fileDownloadFetchInfo("filename = '".doSlash($filename)."'");
+			}
+		}
+
+		if ($thisfile)
+		{
+			$form = fetch_form($form);
+
+			$out = parse($form);
+
+			unset($thisfile);
+
+			return $out;
+		}
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_link($atts, $thing)
+	{
+		global $thisfile, $permlink_mode;
+
+		extract(lAtts(array(
+			'filename' => '',
+			'id'			 => '',
+		), $atts));
+
+		$from_form = true;
+
+		if (empty($thisfile))
+		{
+			$from_form = false;
+
+			if ($id)
+			{
+				$thisfile = fileDownloadFetchInfo('id = '.intval($id));
+			}
+
+			elseif ($filename)
+			{
+				$thisfile = fileDownloadFetchInfo("filename = '".doSlash($filename)."'");
+			}
+		}
+
+		if ($thisfile)
+		{
+			$url = ($permlink_mode == 'messy') ?
+				hu.'index.php?s=file_download'.a.'id='.$thisfile['id'] :
+				hu.gTxt('file_download').'/'.$thisfile['id'];
+
+			$out = ($thing) ? href(parse($thing), $url) : $url;
+
+			// cleanup: this wasn't called from a form,
+			// so we don't want this value remaining
+			if ($from_form == false)
+			{
+				unset($thisfile);
+			}
+
+			return $out;
+		}
+	}
+
+//--------------------------------------------------------------------------
+
+	function fileDownloadFetchInfo($where)
+	{
+		$rs = safe_row('id, filename, category, description, downloads', 'txp_file', $where);
+
+		if ($rs)
+		{
+			return file_download_format_info($rs);
+		}
+
+		return false;
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_format_info($file)
+	{
+		global $file_base_path;
+
+		// get filesystem info
+		$filepath = build_file_path($file_base_path, $file['filename']);
+
+		if (file_exists($filepath))
+		{
+			$filesize = filesize($filepath);
+
+			if ($filesize !== false)
+			{
+				$file['size'] = $filesize;
+			}
+
+			$created = filectime($filepath);
+
+			if ($created !== false)
+			{
+				$file['created'] = $created;
+			}
+
+			$modified = filemtime($filepath);
+
+			if ($modified !== false)
+			{
+				$file['modified'] = $modified;
+			}
+		}
+
+		return $file;
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_size($atts)
+	{
+		global $thisfile;
+
+		extract(lAtts(array(
+			'decimals' => 2,
+			'format'	 => '',
+		), $atts));
+
+		if (is_numeric($decimals) and $decimals >= 0)
+		{
+			$decimals = intval($decimals);
+		}
+
+		else
+		{
+			$decimals = 2;
+		}
+
+		if ($thisfile['size'])
+		{
+			$size = $thisfile['size'];
+
+			if (!in_array($format, array('B','KB','MB','GB','PB')))
+			{
+				$divs = 0;
+
+				while ($size > 1024)
+				{
+					$size /= 1024;
+					$divs++;
+				}
+
+				switch ($divs)
+				{
+					case 1:
+						$format = 'KB';
+					break;
+
+					case 2:
+						$format = 'MB';
+					break;
+
+					case 3:
+						$format = 'GB';
+					break;
+
+					case 4:
+						$format = 'PB';
+					break;
+
+					case 0:
+					default:
+						$format = 'B';
+					break;
+				}
+			}
+
+			$size = $thisfile['size'];
+
+			switch ($format)
+			{
+				case 'KB':
+					$size /= 1024;
+				break;
+
+				case 'MB':
+					$size /= (1024*1024);
+				break;
+
+				case 'GB':
+					$size /= (1024*1024*1024);
+				break;
+
+				case 'PB':
+					$size /= (1024*1024*1024*1024);
+				break;
+
+				case 'B':
+				default:
+					// do nothing
+				break;
+			}
+
+			return number_format($size, $decimals).$format;
+		}
+
+		else
+		{
+			return '';
+		}
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_created($atts)
+	{
+		global $thisfile;
+
+		extract(lAtts(array(
+			'format' => '',
+		), $atts));
+
+		return fileDownloadFormatTime(array(
+			'ftime'	 => $thisfile['created'],
+			'format' => $format
+		));
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_modified($atts)
+	{
+		global $thisfile;
+
+		extract(lAtts(array(
+			'format' => '',
+		), $atts));
+
+		return fileDownloadFormatTime(array(
+			'ftime'	 => $thisfile['modified'],
+			'format' => $format
+		));
+	}
+
+//-------------------------------------------------------------------------
+// All the time related file_download tags in one
+// One Rule to rule them all... now using safe formats
+
+	function fileDownloadFormatTime($params)
+	{
+		global $prefs;
+
+		extract($params);
+
+		if (!empty($ftime))
+		{
+			return !empty($format) ?
+				safe_strftime($format, $ftime) : safe_strftime($prefs['archive_dateformat'], $ftime);
+		}
+		return '';
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_id($atts)
+	{
+		global $thisfile;
+		return $thisfile['id'];
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_name($atts)
+	{
+		global $thisfile;
+		return $thisfile['filename'];
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_category($atts)
+	{
+		global $thisfile;
+
+		extract(lAtts(array(
+			'class'   => '',
+			'escape'  => '',
+			'wraptag' => '',
+		), $atts));
+
+		if ($thisfile['category'])
+		{
+			$category = ($escape == 'html') ? 
+				escape_output($thisfile['category']) : $thisfile['category'];
+
+			return ($wraptag) ? doTag($category, $wraptag, $class) : $category;
+		}
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_downloads($atts)
+	{
+		global $thisfile;
+		return $thisfile['downloads'];
+	}
+
+//--------------------------------------------------------------------------
+
+	function file_download_description($atts)
+	{
+		global $thisfile;
+
+		extract(lAtts(array(
+			'class'   => '',
+			'escape'  => '',
+			'wraptag' => '',
+		), $atts));
+
+		if ($thisfile['description'])
+		{
+			$description = ($escape == 'html') ?
+				escape_output($thisfile['description']) : $thisfile['description'];
+
+			return ($wraptag) ? doTag($description, $wraptag, $class) : $description;
+		}
+	}
+
+?>

Added: trunk/www.openmoko.com/textpattern/publish.php
===================================================================
--- trunk/www.openmoko.com/textpattern/publish.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/publish.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,1115 @@
+<?php
+/*
+            _______________________________________
+   ________|                                       |_________
+  \        |                                       |        /
+   \       |              Textpattern              |       /
+    \      |                                       |      /
+    /      |_______________________________________|      \
+   /___________)                               (___________\
+
+	Copyright 2005 by Dean Allen 
+	All rights reserved.
+
+	Use of this software denotes acceptance of the Textpattern license agreement 
+
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/publish.php $
+$LastChangedRevision: 1945 $
+
+*/
+
+	if (!defined('txpath'))
+		define("txpath", dirname(__FILE__));
+	if (!defined("txpinterface"))	
+		die('If you just updated and expect to see your site here, please also update the files in your main installation directory.'.
+			' (Otherwise note that publish.php cannot be called directly.)');
+
+
+	include_once txpath.'/lib/constants.php';
+	include_once txpath.'/lib/txplib_db.php';
+	include_once txpath.'/lib/txplib_html.php';
+	include_once txpath.'/lib/txplib_forms.php';
+	include_once txpath.'/lib/txplib_misc.php';
+	include_once txpath.'/lib/admin_config.php';
+
+	include_once txpath.'/publish/taghandlers.php';
+	include_once txpath.'/publish/log.php';
+	include_once txpath.'/publish/comment.php';
+
+//	set_error_handler('myErrorHandler');
+
+	ob_start();
+
+    	// start the clock for runtime
+	$microstart = getmicrotime();
+
+		// check the size of the url request
+	bombShelter();
+
+		// get all prefs as an array
+ 	$prefs = get_prefs();
+
+ 		// add prefs to globals
+	extract($prefs);
+
+		// set a higher error level during initialization
+	set_error_level(@$production_status == 'live' ? 'testing' : @$production_status);
+
+		// use the current URL path if $siteurl is unknown
+	if (empty($siteurl))
+		$prefs['siteurl'] = $siteurl = $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/');
+	
+	if (empty($path_to_site))
+		updateSitePath(dirname(dirname(__FILE__)));
+
+	if (!defined( 'PROTOCOL'))
+		define( 'PROTOCOL', ( strtolower( serverSet( 'HTTPS')) == 'on' ? 'https://' : 'http://'));
+		
+		// v1.0: this should be the definitive http address of the site	
+	if (!defined('hu'))
+		define("hu",PROTOCOL.$siteurl.'/');
+	
+		// v1.0 experimental relative url global
+	if (!defined('rhu'))
+		define("rhu",preg_replace("/https?:\/\/.+(\/.*)\/?$/U","$1",hu));
+
+		// 1.0: a new $here variable in the top-level index.php 
+		// should let us know the server path to the live site
+		// let's save it to prefs
+	if (isset($here) and $path_to_site != $here) updateSitePath($here);
+
+		// 1.0 removed $doc_root variable from config, but we'll
+		// leave it here for a bit until plugins catch up
+	$txpcfg['doc_root'] = @$_SERVER['DOCUMENT_ROOT'];
+	// work around the IIS lobotomy
+	if (empty($txpcfg['doc_root']))
+		$txpcfg['doc_root'] = @$_SERVER['PATH_TRANSLATED'];
+
+	if (!defined('LANG'))
+		define("LANG",$language);
+	if (!empty($locale)) setlocale(LC_ALL, $locale);
+
+		//Initialize the current user
+	$txp_user = NULL;
+
+		//i18n: $textarray = load_lang('en-gb');
+	$textarray = load_lang(LANG);
+
+		// here come the plugins
+	if ($use_plugins) load_plugins();
+
+		// this step deprecated as of 1.0 : really only useful with old-style
+		// section placeholders, which passed $s='section_name'
+	$s = (empty($s)) ? '' : $s;
+
+	$pretext = !isset($pretext) ? array() : $pretext;
+	$pretext = array_merge($pretext, pretext($s,$prefs));
+	extract($pretext);
+	
+	// Now that everything is initialized, we can crank down error reporting
+	set_error_level($production_status);
+	
+	if (gps('parentid') && gps('submit')) {
+		saveComment();
+	} elseif (gps('parentid') and $comments_mode==1) { // popup comments?
+		header("Content-type: text/html; charset=utf-8");
+		exit(popComments(gps('parentid')));
+	}
+
+	// we are dealing with a download
+	if (@$s == 'file_download') {
+		if (!isset($file_error)) {
+
+				$fullpath = build_file_path($file_base_path,$filename);
+
+				if (is_file($fullpath)) {
+
+					// discard any error php messages
+					ob_clean();
+					$filesize = filesize($fullpath); $sent = 0;
+					header('Content-Description: File Download');
+					header('Content-Type: application/octet-stream');
+					header('Content-Length: ' . $filesize);
+					header('Content-Disposition: attachment; filename="' . basename($filename) . '"');
+					@ini_set("zlib.output_compression", "Off");
+					@set_time_limit(0);
+					@ignore_user_abort(true);
+					if ($file = fopen($fullpath, 'rb')) {
+						while(!feof($file) and (connection_status()==0)) {
+							echo fread($file, 1024*64); $sent+=(1024*64);
+							ob_flush();
+							flush();
+						}
+						fclose($file);
+						// record download
+						if ((connection_status()==0) and !connection_aborted() ) {
+							safe_update("txp_file", "downloads=downloads+1", 'id='.intval($id));
+						} else {
+							$pretext['request_uri'] .= ($sent >= $filesize) 
+								? '#aborted' 
+								: "#aborted-at-".floor($sent*100/$filesize)."%";
+							log_hit('200');
+						}
+					}
+				} else {
+					$file_error = 404;
+				}
+		}
+
+		// deal with error
+		if (isset($file_error)) {
+			switch($file_error) {
+			case 403:
+				header('HTTP/1.0 403 Forbidden');
+				break;
+			case 404:
+				header('HTTP/1.0 404 File Not Found');
+				break;
+			default:
+				header('HTTP/1.0 500 Internal Server Error');
+				break;
+			}
+		}
+
+		// download done
+		exit(0);
+	}
+
+
+	// send 304 Not Modified if appropriate
+	handle_lastmod();
+
+	// log the page view
+	log_hit($status);
+
+
+// -------------------------------------------------------------
+	function preText($s,$prefs)
+	{
+		extract($prefs);
+
+		callback_event('pretext');
+
+		if(gps('rss')) {
+			include txpath.'/publish/rss.php';
+			exit(rss());
+		}
+
+		if(gps('atom')) {
+			include txpath.'/publish/atom.php';
+			exit(atom());
+		}
+			// set messy variables
+		$out =  makeOut('id','s','c','q','pg','p','month','author');
+
+			// some useful vars for taghandlers, plugins
+		$out['request_uri'] = serverSet('REQUEST_URI');
+		$out['qs'] = serverSet('QUERY_STRING');
+			// IIS fix 
+		if (!$out['request_uri'] and serverSet('SCRIPT_NAME'))
+			$out['request_uri'] = serverSet('SCRIPT_NAME').( (serverSet('QUERY_STRING')) ? '?'.serverSet('QUERY_STRING') : '');
+			// another IIS fix
+		if (!$out['request_uri'] and serverSet('argv'))
+		{
+			$argv = serverSet('argv');
+			$out['request_uri'] = @substr($argv[0], strpos($argv[0], ';') + 1);
+		}
+
+			// define the useable url, minus any subdirectories.
+			// this is pretty fugly, if anyone wants to have a go at it - dean
+		$out['subpath'] = $subpath = preg_quote(preg_replace("/https?:\/\/.*(\/.*)/Ui","$1",hu),"/");
+		$out['req'] = $req = preg_replace("/^$subpath/i","/",$out['request_uri']);
+
+		$is_404 = 0;
+
+			// if messy vars exist, bypass url parsing
+		if (!$out['id'] && !$out['s'] && !(txpinterface=='css') &&! ( txpinterface=='admin') ) {
+			
+			// return clean URL test results for diagnostics
+			if (gps('txpcleantest') and serverSet('SERVER_ADDR') == serverSet('REMOTE_ADDR')) {
+				exit(show_clean_test($out));
+			}
+
+			extract(chopUrl($req));
+	
+				//first we sniff out some of the preset url schemes
+			if (!empty($u1)) {
+
+				switch($u1) {
+	
+					case 'atom':
+						include txpath.'/publish/atom.php'; exit(atom());
+
+					case 'rss':
+						include txpath.'/publish/rss.php'; exit(rss());
+
+					// urldecode(strtolower(urlencode())) looks ugly but is the only way to
+					// make it multibyte-safe without breaking backwards-compatibility
+					case urldecode(strtolower(urlencode(gTxt('section')))):
+						$out['s'] = (ckEx('section',$u2)) ? $u2 : ''; $is_404 = empty($out['s']); break;
+	
+					case urldecode(strtolower(urlencode(gTxt('category')))):
+						$out['c'] = (ckEx('category',$u2)) ? $u2 : ''; $is_404 = empty($out['c']); break;
+	
+					case urldecode(strtolower(urlencode(gTxt('author')))):
+						$out['author'] = (!empty($u2)) ? $u2 : ''; break;
+						// AuthorID gets resolved from Name further down
+	
+					case urldecode(strtolower(urlencode(gTxt('file_download')))):
+						$out['s'] = 'file_download';
+						$out['id'] = (!empty($u2)) ? $u2 : ''; break;
+					
+					case 'p':
+						$out['p'] = (is_numeric($u2)) ? $u2 : ''; break;
+					
+					default:
+						// then see if the prefs-defined permlink scheme is usable
+						switch ($permlink_mode) {
+			
+							case 'section_id_title': 
+								if (empty($u2)) {
+									$out['s'] = (ckEx('section',$u1)) ? $u1 : '';
+									$is_404 = empty($out['s']);
+								}
+								else {
+									$rs = lookupByIDSection($u2, $u1);
+									$out['s'] = @$rs['Section'];
+									$out['id'] = @$rs['ID'];
+									$is_404 = (empty($out['s']) or empty($out['id']));
+								}
+							break;
+			
+							case 'year_month_day_title':
+								if (empty($u2)) {
+									$out['s'] = (ckEx('section',$u1)) ? $u1 : '';
+									$is_404 = empty($out['s']);
+								}
+								elseif (empty($u4)){
+									$month = "$u1-$u2";
+									if (!empty($u3)) $month.= "-$u3";
+									if (preg_match('/\d+-\d+(?:-\d+)?/', $month)) {
+										$out['month'] = $month;
+										$out['s'] = 'default';
+									}
+									else {
+										$is_404 = 1;
+									}
+								}else{
+									$when = "$u1-$u2-$u3";
+									$rs = lookupByDateTitle($when,$u4);
+									$out['id'] = (!empty($rs['ID'])) ? $rs['ID'] : '';
+									$out['s'] = (!empty($rs['Section'])) ? $rs['Section'] : '';
+									$is_404 = (empty($out['s']) or empty($out['id']));
+								}
+							break;
+
+							case 'section_title': 
+								if (empty($u2)) {
+									$out['s'] = (ckEx('section',$u1)) ? $u1 : '';
+									$is_404 = empty($out['s']);
+								}
+								else {
+									$rs = lookupByTitleSection($u2,$u1);
+									$out['id'] = @$rs['ID'];
+									$out['s'] = @$rs['Section'];
+									$is_404 = (empty($out['s']) or empty($out['id']));
+								}
+							break;
+							
+							case 'title_only': 
+								$rs = lookupByTitle($u1);
+								$out['id'] = @$rs['ID'];
+								$out['s'] = (empty($rs['Section']) ? ckEx('section', $u1) : 
+										$rs['Section']);
+								$is_404 = empty($out['s']);
+							break;
+
+							case 'id_title': 		
+								if (is_numeric($u1) && ckExID($u1))
+								{
+									$rs = lookupByID($u1);
+									$out['id'] = (!empty($rs['ID'])) ? $rs['ID'] : '';
+									$out['s'] = (!empty($rs['Section'])) ? $rs['Section'] : '';
+									$is_404 = (empty($out['s']) or empty($out['id']));
+								}else{
+									# We don't want to miss the /section/ pages
+									$out['s']= ckEx('section',$u1)? $u1 : '';
+									$is_404 = empty($out['s']);
+								}
+							break;
+			
+						}
+				}
+			} else {
+				$out['s'] = 'default';
+			}
+		}
+		else {
+			// Messy mode, but prevent to get the id for file_downloads
+			if ($out['id'] && !$out['s']) {
+				$rs = lookupByID($out['id']);
+				$out['id'] = (!empty($rs['ID'])) ? $rs['ID'] : '';
+				$out['s'] = (!empty($rs['Section'])) ? $rs['Section'] : '';
+				$is_404 = (empty($out['s']) or empty($out['id']));
+			}
+		}
+
+		// Resolve AuthorID from Authorname
+		if ($out['author'])
+		{
+			$name = urldecode(strtolower(urlencode($out['author'])));
+		
+			$name = safe_field('name', 'txp_users', "RealName like '".doSlash($out['author'])."'");
+
+			if ($name)
+			{
+				$out['author'] = $name;
+			}
+
+			else
+			{
+				$out['author'] = '';
+				$is_404 = true;
+			}
+		}
+
+		// Stats: found or not
+		$out['status'] = ($is_404 ? '404' : '200');
+		
+		if ($out['s'] == 'file_download') {
+			// get id of potential filename
+			if (!is_numeric($out['id'])) {
+				$rs = safe_row("*", "txp_file", "filename='".doSlash($out['id'])."'");
+			} else {
+				$rs = safe_row("*", "txp_file", 'id='.intval($out['id']));
+			}
+
+			$out = ($rs)? array_merge($out, $rs) : array('s'=>'file_download','file_error'=> 404);
+			return $out;
+		}
+		
+		if (!$is_404)
+			$out['s'] = (empty($out['s'])) ? 'default' : $out['s'];
+		$s = $out['s'];
+		$id = $out['id'];
+
+		// hackish
+		global $is_article_list;
+		if(empty($id)) $is_article_list = true;
+
+			// by this point we should know the section, so grab its page and css
+		$rs = safe_row("*", "txp_section", "name = '".doSlash($s)."' limit 1");
+		$out['page'] = @$rs['page'];		
+
+		if(is_numeric($id)) {
+			$a = safe_row('*, unix_timestamp(Posted) as uPosted', 'textpattern', 'ID='.intval($id).' and Status = 4');
+			if ($a) {
+				$Posted             = @$a['Posted'];
+				$out['id_keywords'] = @$a['Keywords'];
+				$out['id_author']   = @$a['AuthorID'];
+				populateArticleData($a);
+
+				if ($np = getNextPrev($id, $Posted, $s))
+					$out = array_merge($out, $np);
+			}
+		}
+
+		$out['path_from_root'] = $path_from_root; // these are deprecated as of 1.0
+		$out['pfr']            = $path_from_root; // leaving them here for plugin compat
+
+		$out['path_to_site']   = $path_to_site;
+		$out['permlink_mode']  = $permlink_mode;
+		$out['sitename']       = htmlspecialchars($sitename);
+
+		return $out; 
+
+	}
+
+//	textpattern() is the function that assembles a page, based on
+//	the variables passed to it by pretext();
+
+// -------------------------------------------------------------
+	function textpattern() 
+	{
+		global $pretext,$microstart,$prefs,$qcount,$qtime,$production_status,$txptrace,$siteurl,$has_article_tag;
+
+		$has_article_tag = false;
+
+		callback_event('textpattern');
+
+		if ($pretext['status'] == '404')
+			txp_die(gTxt('404_not_found'), '404');
+
+		$html = safe_field('user_html','txp_page',"name='".doSlash($pretext['page'])."'");
+		if (!$html) 
+			txp_die(gTxt('unknown_section'), '404');
+
+		// useful for clean urls with error-handlers
+		txp_status_header('200 OK');
+
+		trace_add('['.gTxt('page').': '.$pretext['page'].']');
+		set_error_handler("tagErrorHandler");
+		$pretext['secondpass'] = false;
+		$html = parse($html);
+		$pretext['secondpass'] = true;
+		trace_add('[ ~~~ '.gTxt('secondpass').' ~~~ ]');
+		$html = parse($html); // the function so nice, he ran it twice
+		restore_error_handler();
+		$html = ($prefs['allow_page_php_scripting']) ? evalString($html) : $html;
+
+		// make sure the page has an article tag if necessary
+		if (!$has_article_tag and $production_status != 'live' and (!empty($pretext['id']) or !empty($pretext['c']) or !empty($pretext['q']) or !empty($pretext['pg'])))
+			trigger_error(gTxt('missing_article_tag', array('{page}' => $pretext['page'])));
+
+		header("Content-type: text/html; charset=utf-8");
+		echo $html;
+
+		if (in_array($production_status, array('debug', 'testing'))) {
+			$microdiff = (getmicrotime() - $microstart);
+			echo n,comment('Runtime:    '.substr($microdiff,0,6));
+			echo n,comment('Query time: '.$qtime);
+			echo n,comment('Queries: '.$qcount);
+			echo maxMemUsage('end of textpattern()',1);
+			if (!empty($txptrace) and is_array($txptrace))
+				echo n, comment('txp tag trace: '.n.join(n, $txptrace).n);
+		}
+	}
+
+// -------------------------------------------------------------
+	function output_css($s='',$n='')
+	{
+		if ($n) {
+			$cssname = $n;
+		} elseif ($s) {
+			$cssname = safe_field('css','txp_section',"name='".doSlash($s)."'");
+		}
+
+		$css = safe_field('css','txp_css',"name='".doSlash($cssname)."'");
+		if ($css) echo base64_decode($css);
+	}
+
+//	article() is called when parse() finds a <txp:article /> tag.
+//	If an $id has been established, we output a single article,
+//	otherwise, output a list.
+
+// -------------------------------------------------------------
+	function article($atts)
+	{
+		global $is_article_body, $has_article_tag;
+		if ($is_article_body) {
+			trigger_error(gTxt('article_tag_illegal_body'));
+			return '';
+		}
+		$has_article_tag = true;
+		return parseArticles($atts);
+	}
+
+// -------------------------------------------------------------
+	function doArticles($atts, $iscustom)
+	{	
+		global $pretext, $prefs, $txpcfg;
+		extract($pretext);
+		extract($prefs);
+		//getting attributes
+		$theAtts = lAtts(array(
+			'form'      => 'default',
+			'listform'  => '',
+			'searchform'=> '',
+			'limit'     => 10,
+			'pageby'    => '',
+			'category'  => '',
+			'section'   => '',
+			'excerpted' => '',
+			'author'    => '',
+			'sort'      => '',
+			'sortby'    => '',
+			'sortdir'   => '',
+			'month'     => '',
+			'keywords'  => '',
+			'frontpage' => '',
+			'id'        => '',
+			'time'      => 'past',
+			'status'    => '4',
+			'pgonly'    => 0,
+			'searchall' => 1,
+			'searchsticky' => 0,
+			'allowoverride' => (!$q and !$iscustom),
+			'offset'    => 0,
+		),$atts);		
+
+		// if an article ID is specified, treat it as a custom list
+		$iscustom = (!empty($theAtts['id'])) ? true : $iscustom;
+
+		//for the txp:article tag, some attributes are taken from globals;
+		//override them before extract
+		if (!$iscustom)
+		{
+			$theAtts['category'] = ($c)? $c : '';
+			$theAtts['section'] = ($s && $s!='default')? $s : '';
+			$theAtts['author'] = (!empty($author)? $author: '');
+			$theAtts['month'] = (!empty($month)? $month: '');
+			$theAtts['frontpage'] = ($s && $s=='default')? true: false;
+			$theAtts['excerpted'] = '';			
+		}
+		extract($theAtts);
+		
+		$pageby = (empty($pageby) ? $limit : $pageby);
+
+		// treat sticky articles differently wrt search filtering, etc
+		if (!is_numeric($status))
+			$status = getStatusNum($status);
+		$issticky = ($status == 5);
+			
+		//give control to search, if necesary
+		if($q && !$iscustom && !$issticky) {
+			include_once txpath.'/publish/search.php';
+			$s_filter = ($searchall ? filterSearch() : '');
+			$q = doSlash($q);
+			$match = ", match (Title,Body) against ('$q') as score";
+			$search = " and (Title rlike '$q' or Body rlike '$q') $s_filter";
+
+			// searchall=0 can be used to show search results for the current section only
+			if ($searchall) $section = '';
+			if (!$sort) $sort='score desc';
+		}
+		else {
+			$match = $search = '';
+			if (!$sort) $sort='Posted desc';
+		}
+
+		// for backwards compatibility
+		// sortby and sortdir are deprecated
+		if ($sortby)
+		{
+			if (!$sortdir)
+			{
+				$sortdir = 'desc';
+			}
+
+			$sort = "$sortby $sortdir";
+		}
+
+		elseif ($sortdir)
+		{
+			$sort = "Posted $sortdir";
+		}
+
+		//Building query parts
+		$frontpage = ($frontpage and !$q) ? filterFrontPage() : '';		
+		$category  = (!$category)  ? '' : " and ((Category1='".doSlash($category)."') or (Category2='".doSlash($category)."')) ";
+		$section   = (!$section)   ? '' : " and Section = '".doSlash($section)."'";
+		$excerpted = ($excerpted=='y')  ? " and Excerpt !=''" : '';
+		$author    = (!$author)    ? '' : " and AuthorID = '".doSlash($author)."'";
+		$month     = (!$month)     ? '' : " and Posted like '".doSlash($month)."%'";
+		$id        = (!$id)        ? '' : " and ID = '".intval($id)."'";
+		switch ($time) {
+			case 'any':
+				$time = ""; break;
+			case 'future':
+				$time = " and Posted > now()"; break;
+			default:
+				$time = " and Posted <= now()";
+		}
+		if (!is_numeric($status))
+			$status = getStatusNum($status);
+			
+		$custom = '';
+
+		// trying custom fields here
+		$customFields = getCustomFields();
+		
+		if ($customFields) {
+			foreach($customFields as $cField) {
+				if (isset($atts[$cField]))
+					$customPairs[$cField] = $atts[$cField];
+			}
+			if(!empty($customPairs)) {
+				$custom =  buildCustomSql($customFields,$customPairs);
+			} else $custom = '';
+		}
+
+		//Allow keywords for no-custom articles. That tagging mode, you know
+		if ($keywords) {
+			$keys = split(',',$keywords);
+			foreach ($keys as $key) {
+				$keyparts[] = " Keywords like '%".doSlash(trim($key))."%'";
+			}
+			$keywords = " and (" . join(' or ',$keyparts) . ")"; 
+		}
+
+		if ($q and $searchsticky)
+			$statusq = ' and Status >= 4';
+		elseif ($id)
+			$statusq = ' and Status >= 4';
+		else
+			$statusq = ' and Status = '.intval($status);
+
+		$where = "1" . $statusq. $time.
+			$search . $id . $category . $section . $excerpted . $month . $author . $keywords . $custom . $frontpage;
+
+		//do not paginate if we are on a custom list
+		if (!$iscustom and !$issticky)
+		{
+			$grand_total = safe_count('textpattern',$where);
+			$total = $grand_total - $offset;
+			$numPages = ceil($total/$pageby);  
+			$pg = (!$pg) ? 1 : $pg;
+			$pgoffset = $offset + (($pg - 1) * $pageby);	
+			// send paging info to txp:newer and txp:older
+			$pageout['pg']       = $pg;
+			$pageout['numPages'] = $numPages;
+			$pageout['s']        = $s;
+			$pageout['c']        = $c;
+			$pageout['grand_total'] = $grand_total;
+			$pageout['total']    = $total;
+
+			global $thispage;
+			if (empty($thispage))
+				$thispage = $pageout;
+			if ($pgonly)
+				return;
+		}else{
+			$pgoffset = $offset;
+		}
+
+		$rs = safe_rows_start("*, unix_timestamp(Posted) as uPosted".$match, 'textpattern', 
+		$where.' order by '.doSlash($sort).' limit '.intval($pgoffset).', '.intval($limit));
+		// get the form name
+		if ($q and !$iscustom and !$issticky)
+			$fname = ($searchform ? $searchform : 'search_results');
+		else
+			$fname = ($listform ? $listform : $form);
+
+		// fetch the form
+		if (gps('Form') and @constant('txpinterface') === 'admin')
+			$form = gps('Form');
+		else
+			$form = fetch_form($fname);
+
+		if ($rs) {
+			$count = 0;
+			
+			$articles = array();
+			while($a = nextRow($rs)) {
+				++$count;
+				populateArticleData($a);
+				global $thisarticle, $uPosted, $limit;
+				$thisarticle['is_first'] = ($count == 1);
+				$thisarticle['is_last'] = ($count == numRows($rs));
+				// define the article form
+				$article = ($allowoverride and $a['override_form']) 
+				?	fetch_form($a['override_form'])
+				:	$form;
+
+				$articles[] = parse($article);
+				
+				// sending these to paging_link(); Required?
+				$uPosted = $a['uPosted'];
+				$limit = $limit;
+
+				unset($GLOBALS['thisarticle']);
+				unset($GLOBALS['theseatts']);//Required?				
+			}
+
+			return join('',$articles);
+		}
+	}
+
+// -------------------------------------------------------------
+	function filterFrontPage() 
+	{
+        static $filterFrontPage;
+
+        if (isset($filterFrontPage)) return $filterFrontPage;
+
+		$rs = safe_column("name","txp_section", "on_frontpage != '1'");
+		if ($rs) {
+			foreach($rs as $name) $filters[] = "and Section != '".doSlash($name)."'";	
+			$filterFrontPage = join(' ',$filters);
+            return $filterFrontPage;
+		}
+        $filterFrontPage = false;
+		return $filterFrontPage;
+	}
+
+
+// -------------------------------------------------------------
+	function doArticle($atts) 
+	{
+		global $pretext,$prefs, $thisarticle;
+		extract($prefs);
+		extract($pretext);
+
+		extract(gpsa(array('parentid', 'preview')));
+
+		extract(lAtts(array(
+			'allowoverride' => '1',
+			'form'          => 'default',
+			'status'        => '4',
+		),$atts, 0));		
+
+		if ($status or empty($thisarticle) or $thisarticle['thisid'] != $id) {
+			$thisarticle = NULL;
+			if ($status and !is_numeric($status))
+				$status = getStatusNum($status);
+
+			$q_status = ($status ? 'and Status = '.intval($status) : 'and Status in (4,5)');
+
+			$rs = safe_row("*, unix_timestamp(Posted) as uPosted", 
+					"textpattern", 'ID = '.intval($id)." $q_status limit 1");
+
+			if ($rs) {
+				extract($rs);
+				populateArticleData($rs);
+			}
+		}
+
+		if (!empty($thisarticle)) {
+			extract($thisarticle);
+			$thisarticle['is_first'] = 1;
+			$thisarticle['is_last'] = 1;
+
+			$form = ($allowoverride and $override_form) ? $override_form : $form;
+
+			// define the article form
+			$article = fetch_form($form);
+
+			$article = parse($article);
+
+			if ($use_comments and $comments_auto_append) {
+				$f = fetch_form('comments_display');
+				$article .= parse($f);
+			}
+
+			
+			unset($GLOBALS['thisarticle']);	
+
+			return $article;
+		}
+}	
+
+// -------------------------------------------------------------
+	function article_custom($atts)
+	{
+		return parseArticles($atts, '1');
+	}
+
+// -------------------------------------------------------------
+	function parseArticles($atts, $iscustom = '')
+	{
+		global $pretext, $is_article_list;
+		$old_ial = $is_article_list;
+		$is_article_list = ($pretext['id'] && !$iscustom)? false : true;
+		article_push();
+		$r = ($is_article_list)? doArticles($atts, $iscustom) : doArticle($atts);
+		article_pop();
+		$is_article_list = $old_ial;
+
+		return $r;
+	}
+
+// -------------------------------------------------------------
+// Keep all the article tag-related values in one place,
+// in order to do easy bugfix and easily the addition of
+// new article tags.
+	function populateArticleData($rs)
+	{
+		extract($rs);
+
+		trace_add("[".gTxt('Article')." $ID]");
+		$out['thisid']          = $ID;
+		$out['posted']          = $uPosted;
+		$out['annotate']        = $Annotate;
+		$out['comments_invite'] = $AnnotateInvite;
+		$out['authorid']        = $AuthorID;
+		$out['title']           = $Title;
+		$out['url_title']       = $url_title;
+		$out['category1']       = $Category1;
+		$out['category2']       = $Category2;
+		$out['section']         = $Section;
+		$out['keywords']        = $Keywords;
+		$out['article_image']   = $Image;
+		$out['comments_count']  = $comments_count;
+		$out['body']            = $Body_html;
+		$out['excerpt']         = $Excerpt_html;
+		$out['override_form']		= $override_form;
+
+		$custom = getCustomFields();
+		if ($custom) {
+			foreach ($custom as $i => $name)
+				$out[$name] = $rs['custom_' . $i];
+		}
+		
+		global $thisarticle;
+		$thisarticle = $out;	
+	}
+
+// -------------------------------------------------------------
+	function getNeighbour($Posted, $s, $type) 
+	{
+		$type = ($type == '>') ? '>' : '<';
+		$q = array(
+			"select ID, Title, url_title, unix_timestamp(Posted) as uposted
+			from ".PFX."textpattern where Posted $type '".doSlash($Posted)."'",
+			($s!='' && $s!='default') ? "and Section = '".doSlash($s)."'" : filterFrontPage(),
+			'and Status=4 and Posted < now() order by Posted',
+			($type=='<') ? 'desc' : 'asc',
+			'limit 1'
+		);
+
+		$out = getRow(join(' ',$q));
+		return (is_array($out)) ? $out : '';
+	}
+
+// -------------------------------------------------------------
+	function getNextPrev($id, $Posted, $s)
+	{
+		static $next, $cache;
+
+		// If next/prev tags are placed before an article tag on a list page, we
+		// have to guess what the current article is
+		if (!$id) {
+			$current = safe_row('ID, Posted', 'textpattern', 
+				'1=1 '.
+				(($s!='' && $s!='default') ? "and Section = '".doSlash($s)."'" : filterFrontPage()).
+				'and Status=4 and Posted < now() order by Posted desc limit 1');
+			if ($current) {
+				$id = $current['ID'];
+				$Posted = $current['Posted'];
+			}
+		}
+
+		if (@isset($cache[$next[$id]]))
+			$thenext = $cache[$next[$id]];
+		else
+			$thenext            = getNeighbour($Posted,$s,'>');
+
+		$out['next_id']     = ($thenext) ? $thenext['ID'] : '';
+		$out['next_title']  = ($thenext) ? $thenext['Title'] : '';
+		$out['next_utitle'] = ($thenext) ? $thenext['url_title'] : '';
+		$out['next_posted'] = ($thenext) ? $thenext['uposted'] : '';
+
+		$theprev            = getNeighbour($Posted,$s,'<');
+		$out['prev_id']     = ($theprev) ? $theprev['ID'] : '';
+		$out['prev_title']  = ($theprev) ? $theprev['Title'] : '';
+		$out['prev_utitle'] = ($theprev) ? $theprev['url_title'] : '';
+		$out['prev_posted'] = ($theprev) ? $theprev['uposted'] : '';
+
+		if ($theprev) {
+			$cache[$theprev['ID']] = $theprev;
+			$next[$theprev['ID']] = $id;
+		}
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+	function lastMod() 
+	{
+		$last = safe_field("unix_timestamp(val)", "txp_prefs", "`name`='lastmod' and prefs_id=1");
+		return gmdate("D, d M Y H:i:s \G\M\T",$last);	
+	}
+
+// -------------------------------------------------------------
+	function parse($text)
+	{
+		$f = '/<txp:(\S+)\b(.*)(?:(?<!br )(\/))?'.chr(62).'(?(3)|(.+)<\/txp:\1>)/sU';
+		return preg_replace_callback($f, 'processTags', $text);
+	}
+
+// -------------------------------------------------------------
+
+	function processTags($matches)
+	{
+		global $pretext, $production_status, $txptrace, $txptracelevel, $txp_current_tag;
+
+		$tag = $matches[1];
+
+		$trouble_makers = array(
+			'link'
+		);
+
+		if (in_array($tag, $trouble_makers))
+		{
+			$tag = 'tpt_'.$tag;
+		}
+
+		$atts = isset($matches[2]) ? splat($matches[2]) : '';
+		$thing = isset($matches[4]) ? $matches[4] : null;
+
+		$old_tag = @$txp_current_tag;
+
+		$txp_current_tag = '<txp:'.$tag.
+			($atts ? $matches[2] : '').
+			($thing ? '>' : '/>');
+
+		trace_add($txp_current_tag);
+		@++$txptracelevel;
+
+		if ($production_status == 'debug')
+		{
+			maxMemUsage(trim($matches[0]));
+		}
+
+		$out = '';
+
+		if (function_exists($tag))
+		{
+			$out = $tag($atts, $thing, $matches[0]);
+		}
+
+		elseif (isset($pretext[$tag]))
+		{
+			$out = escape_output($pretext[$tag]);
+		}
+
+		else
+		{
+			trigger_error(gTxt('unknown_tag', array('{tag}' => $tag)), E_USER_WARNING);
+		}
+
+		@--$txptracelevel;
+
+		if (isset($matches[4]))
+		{
+			trace_add('</txp:'.$tag.'>');
+		}
+
+		$txp_current_tag = $old_tag;
+
+		return $out;
+	}
+
+// -------------------------------------------------------------
+	function bombShelter() // protection from those who'd bomb the site by GET
+	{
+		global $prefs;
+		$in = serverset('REQUEST_URI');
+		if (!empty($prefs['max_url_len']) and strlen($in) > $prefs['max_url_len']) exit('Nice try.');
+	}
+
+// -------------------------------------------------------------
+	function evalString($html)
+	{
+		global $prefs;
+		if (strpos($html, chr(60).'?php') !== false) {
+			trigger_error(gTxt('raw_php_deprecated'), E_USER_WARNING);
+			if (!empty($prefs['allow_raw_php_scripting']))
+				$html = eval(' ?'.chr(62).$html.chr(60).'?php ');
+			else
+				trigger_error(gTxt('raw_php_disabled'), E_USER_WARNING);
+		}
+		return $html;
+	}
+
+// -------------------------------------------------------------
+	function getCustomFields()
+	{
+		global $prefs;
+		$i = 0;
+		while ($i < 10) {
+			$i++;
+			if (!empty($prefs['custom_'.$i.'_set'])) {
+				$out[$i] = $prefs['custom_'.$i.'_set'];
+			}
+		}
+		return (!empty($out)) ? $out : false;
+	}
+	
+// -------------------------------------------------------------
+	function buildCustomSql($custom,$pairs)
+	{
+		if ($pairs) {
+			$pairs = doSlash($pairs);
+			foreach($pairs as $k => $v) {
+				if(in_array($k,$custom)) {
+					$no = array_keys($custom,$k);
+					# nb - use 'like' here to allow substring matches
+					$out[] = "and custom_".$no[0]." like '$v'";
+				}
+			}
+		}
+		return (!empty($out)) ? ' '.join(' ',$out).' ' : false; 
+	}
+
+// -------------------------------------------------------------
+	function getStatusNum($name) 
+	{
+		$labels = array('draft' => 1, 'hidden' => 2, 'pending' => 3, 'live' => 4, 'sticky' => 5);
+		$status = strtolower($name);
+		$num = empty($labels[$status]) ? 4 : $labels[$status];
+		return $num;
+	}
+	
+// -------------------------------------------------------------
+	function ckEx($table,$val,$debug='') 
+	{
+		return safe_field("name",'txp_'.$table,"`name` like '".doSlash($val)."' limit 1",$debug);
+	}
+
+// -------------------------------------------------------------
+	function ckExID($val,$debug='') 
+	{
+		return safe_row("ID,Section",'textpattern','ID = '.intval($val).' and Status >= 4 limit 1',$debug);
+	}
+
+// -------------------------------------------------------------
+	function lookupByTitle($val,$debug='') 
+	{
+		return safe_row("ID,Section",'textpattern',"url_title like '".doSlash($val)."' and Status >= 4 limit 1",$debug);
+	}
+// -------------------------------------------------------------
+	function lookupByTitleSection($val,$section,$debug='') 
+	{
+		return safe_row("ID,Section",'textpattern',"url_title like '".doSlash($val)."' AND Section='".doSlash($section)."' and Status >= 4 limit 1",$debug);
+	}	
+
+// -------------------------------------------------------------
+
+	function lookupByIDSection($id, $section, $debug = '') 
+	{
+		return safe_row('ID, Section', 'textpattern', 
+			'ID = '.intval($id)." and Section = '".doSlash($section)."' and Status >= 4 limit 1", $debug);
+	}	
+
+// -------------------------------------------------------------
+	function lookupByID($id,$debug='') 
+	{
+		return safe_row("ID,Section",'textpattern','ID = '.intval($id).' and Status >= 4 limit 1',$debug);
+	}
+
+// -------------------------------------------------------------
+	function lookupByDateTitle($when,$title,$debug='') 
+	{
+		return safe_row("ID,Section","textpattern",
+		"posted like '".doSlash($when)."%' and url_title like '".doSlash($title)."' and Status >= 4 limit 1");
+	}
+
+// -------------------------------------------------------------
+	function makeOut() 
+	{
+		foreach(func_get_args() as $a) {
+			$array[$a] = gps($a);
+		}
+		return $array;
+	}
+
+// -------------------------------------------------------------
+	function chopUrl($req) 
+	{
+		$req = strtolower($req);
+		//strip off query_string, if present
+		$qs = strpos($req,'?');
+		if ($qs) $req = substr($req, 0, $qs);
+		$req = preg_replace('/index\.php$/', '', $req);
+		$r = array_map('urldecode', explode('/',$req));
+		$o['u0'] = (!empty($r[0])) ? $r[0] : '';
+		$o['u1'] = (!empty($r[1])) ? $r[1] : '';
+		$o['u2'] = (!empty($r[2])) ? $r[2] : '';
+		$o['u3'] = (!empty($r[3])) ? $r[3] : '';
+		$o['u4'] = (!empty($r[4])) ? $r[4] : '';
+
+		return $o;
+	}
+	
+?>

Added: trunk/www.openmoko.com/textpattern/textpattern.css
===================================================================
--- trunk/www.openmoko.com/textpattern/textpattern.css	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/textpattern.css	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,553 @@
+/* base
+----------------------------------------------- */
+
+body, input, textarea, select {
+font: 11px Verdana, Arial, sans-serif;
+}
+
+body {
+margin: 0 0 20px 0;
+padding: 0;
+color: #000;
+background-color: #fff;
+}
+
+code, .code {
+font: 1.1em Monaco, "Courier New", monospace;
+}
+
+small, .small {
+font-size: 0.9em;
+}
+
+h1, h2, h3, p, ul, ol {
+margin: 0 0 10px 0;
+padding: 0;
+}
+
+h1, h2, h3 {
+font-family: Georgia, Times, serif;
+font-weight: normal;
+}
+
+h1 {
+font-size: 1.45em;
+}
+
+h2 {
+font-size: 1.3em;
+}
+
+h3 {
+font-size: 1.2em;
+}
+
+h3.plain {
+font: 1em Verdana, Arial, sans-serif;
+}
+
+p {
+line-height: 1.4em;
+}
+
+ul {
+list-style-type: circle;
+}
+
+li {
+margin: 0 0 5px 35px;
+padding: 0;
+}
+
+/* links
+----------------------------------------------- */
+
+h3 a {
+font-weight: bold;
+}
+
+a img {
+border: none;
+}
+
+a:link, a:visited, a:active {
+color: #963;
+background-color: transparent;
+text-decoration: none;
+}
+
+a:hover, a:focus {
+text-decoration: underline;
+}
+
+a.alink, a.dlink, a.pophelp {
+border-right: 1px solid #999;
+border-bottom: 1px solid #999;
+}
+
+a.alink {
+color: #00f;
+background-color: #eee;
+}
+
+a.dlink:hover, a.pophelp:hover {
+text-decoration: none;
+}
+
+a.dlink {
+color: #f00;
+background-color: #eee;
+}
+
+a.navlink {
+padding: 3px;
+color: #000;
+background-color: #ffc;
+border-right: 1px solid #ddd;
+border-bottom: 1px solid #ddd;
+border-left: 1px solid #f1f1f1;
+}
+
+a.navlink-active {
+padding: 3px;
+color: #000;
+border-right: 1px solid #ddd;
+border-bottom: 1px solid #ddd;
+border-left: 1px solid #f1f1f1;
+}
+
+a.plain, a.plain:visited, a.plain:active {
+color: #000;
+background-color: transparent;
+}
+
+a.pophelp {
+padding: 0 2px;
+font-weight: normal;
+color: #00f;
+background-color: #eee;
+}
+
+/* form elements
+----------------------------------------------- */
+
+fieldset {
+margin: 0 0 10px 0;
+padding: 5px;
+border: 1px solid #ddd;;
+}
+
+label {
+cursor: pointer;
+}
+
+input {
+font-size: 0.9em;
+}
+
+textarea {
+padding: 3px;
+line-height: 1.4em;
+background-color: #eee;
+}
+
+select {
+font-size: 0.9em;
+background-color: #eee;
+}
+
+form.upload-form {
+text-align: center;
+}
+
+input.cancel, input.delete,
+input.interbox, input.interbox2,
+input.navbox,
+input.publish, input.preview,
+input.smallbox, input.smallerbox, input.smallerboxsp,
+select {
+border-width: 1px;
+border-style: solid;
+border-color: #fff #999 #999 #fff;
+}
+
+input.cancel, input.delete,
+input.publish, input.preview {
+margin: 5px 10px 5px auto;
+padding: 5px;
+width: auto;
+}
+
+input.edit, input.list,
+textarea {
+border-width: 1px;
+border-style: solid;
+border-color: #999 #fff #fff #999;
+}
+
+input.edit {
+margin-top: 5px;
+padding: 1px;
+font-size: 1em;
+background-color: #eee;
+}
+
+input.interbox, input.interbox2,
+input.navbox,
+input.smallbox, input.smallerbox, input.smallerboxsp {
+padding: 3px 6px 4px 6px;
+}
+
+input.interbox, input.interbox2	 {
+padding-right: 4px;
+padding-left: 4px;
+}
+
+input.interbox2 {
+margin-left: 100px;
+}
+
+input.list {
+margin: 5px 5px auto auto;
+padding: 3px;
+background-color: #ddd;
+}
+
+input.navbox {
+margin-right: 10px;
+background-color: #eee;
+}
+
+input.publish {
+color: #fff;
+background-color: #900;
+border-width: 2px 1px 1px 2px;
+border-style: solid;
+border-color: #b00 #600 #600 #b00;
+}
+
+input.smallbox {
+margin-right: 10px;
+vertical-align: text-top;
+background-color: #ddd;
+}
+
+input.smallerbox {
+padding: 2px;
+background-color: #ddd;
+}
+
+input.smallerboxsp {
+margin-right: 10px;
+padding: 2px;
+background-color: #ddd;
+}
+
+/* table elements
+----------------------------------------------- */
+
+table, tr, th, td {
+vertical-align: top;
+}
+
+table.edit-table {
+margin-top: 2em;
+}
+
+td.column {
+padding: 10px;
+}
+
+td.declaration {
+padding: 0 3px;
+font-size: 0.9em;
+text-align: left;
+}
+
+td.selector, td.selector2 {
+padding: 6px 3px;
+text-align: left;
+border-top: 3px solid #fff;
+}
+
+td.selector2 {
+font-size: 0.9em;
+}
+
+table#edit td.noline,
+table#list td.noline	{
+vertical-align: middle;
+border: none;
+}
+
+table#list th, table#list td {
+padding: 3px 5px;
+text-align: left;
+border-bottom: 1px solid #ddd;
+}
+
+table#list td.noline {
+height: 30px;
+}
+
+table#list th {
+vertical-align: bottom;
+}
+
+table#list ul {
+margin-bottom: 0;
+list-style-type: none;
+}
+
+table#list li {
+margin: 0 0 2px 0;
+}
+
+/* other element overrides
+----------------------------------------------- */
+
+.ok {
+color: #008000;
+}
+
+.not-ok {
+color: #C40000;
+}
+
+.prev-next {
+margin: 15px 0;
+font-size: 0.9em;
+text-align: center;
+}
+
+span.navlink-disabled {
+padding: 3px;
+color: #999;
+background-color: #eee;
+border-right: 1px solid #ddd;
+border-bottom: 1px solid #ddd;
+border-left: 1px solid #f1f1f1;
+}
+
+p#js {
+margin-top: 10px;
+padding-right: 30px;
+display: none;
+}
+
+p#js span {
+padding: 10px;
+background-color: #ffc;
+}
+
+ul.plain-list {
+list-style-type: none;
+}
+
+ul.plain-list li {
+margin: 0 0 2px 0;
+}
+
+#warning {
+margin: 0 auto 15px auto;
+padding: 10px;
+width: 30em;
+text-align: center;
+background-color: #fff4f4;
+border: 2px solid #fdd;
+}
+
+/* global layout
+----------------------------------------------- */
+
+td.tabup, td.tabdown,
+td.tabup2, td.tabdown2 {
+padding-top: 6px;
+width: 124px;
+height: 25px;
+font-size: 0.9em;
+text-align: center;
+}
+
+td.tabdown {
+background: transparent url(txp_img/down.gif) no-repeat top left;
+cursor: pointer;
+}
+
+td.tabdown2 {
+background: transparent url(txp_img/down2.gif) no-repeat top left;
+cursor: pointer;
+}
+
+td.tabdown a {
+color: #000;
+background-color: transparent;
+border: 0;
+}
+
+td.tabs {
+height: 25px;
+text-align: center;
+background: transparent url(txp_img/tabshadow.gif) repeat-x top left;
+}
+
+td.tabs td {
+vertical-align: middle;
+}
+
+td.tabup, td.tabup2 {
+background: transparent url(txp_img/up.gif) no-repeat top left;
+}
+
+td.tabup a {
+cursor: default;
+}
+
+/* setup
+----------------------------------------------- */
+
+table#setup td {
+padding: 3px;
+vertical-align: middle;
+}
+
+/* organize
+----------------------------------------------- */
+
+td.categories p {
+margin: 6px auto 3px auto;
+padding-top: 3px;
+line-height: 1.6em;
+border-top: 1px solid #ddd;
+}
+
+/* write
+----------------------------------------------- */
+
+td#article-col-1 {
+width: 165px;
+}
+
+td#article-main {
+padding-left: 20px;
+width: 400px;
+}
+
+td#article-tabs {
+padding-top: 35px;
+width: 20px;
+}
+
+td#article-col-2 {
+padding-left: 10px;
+width: 200px;
+}
+
+textarea#body {
+width: 95%;
+height: 420px;
+}
+
+input#title {
+width: 90%;
+}
+
+textarea#excerpt {
+width: 95%;
+height: 75px;
+}
+
+textarea#keywords {
+width: 140px;
+height: 80px;
+}
+
+/* comments
+----------------------------------------------- */
+
+tr.spam td,
+tr.spam a {
+color: #666;
+background-color: #f1f1f1;
+}
+
+tr.moderate td,
+tr.moderate a {
+color: #900;
+background-color: #fff8f8;
+}
+
+tr.spam a, tr.moderate a {
+font-weight: bold;
+}
+
+/* pages, forms, style, plugins
+----------------------------------------------- */
+
+input.css {
+margin: 0;
+padding: 1px;
+background-color: #eee;
+border-width: 1px;
+border-style: solid;
+border-color: #999 #fff #fff #999;
+}
+
+textarea#html {
+margin-top: 6px;
+width: 99%;
+height: 500px;
+}
+
+textarea#form {
+margin-top: 6px;
+width: 99%;
+height: 500px;
+}
+
+textarea#css {
+width: 99%;
+height: 515px;
+}
+
+div#preview-plugin, div#preview-help {
+margin: 0 auto 10px auto;
+padding: 3px;
+height: 300px;
+overflow: auto;
+background-color: #efefef;
+}
+
+textarea#plugin-install {
+width: 90%;
+height: 30px;
+}
+
+/* tagbuilder
+----------------------------------------------- */
+
+body#tag-event {
+padding: 10px;
+border-top: 15px solid #fc3;
+}
+
+table#tagbuilder td {
+padding: 2px 5px;
+}
+
+p#tagbuilder-output {
+margin-top: 10px;
+text-align: center;
+}
+
+/* preferences
+----------------------------------------------- */
+
+h2.pref-heading {
+margin: 20px 0 0 0;
+}
+
+
+#edit  {
+	width: 90% !important;
+}
\ No newline at end of file

Added: trunk/www.openmoko.com/textpattern/textpattern.js
===================================================================
--- trunk/www.openmoko.com/textpattern/textpattern.js	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/textpattern.js	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,277 @@
+
+// -------------------------------------------------------------
+// admin-side "cookies required" warning
+
+function checkCookies()
+{
+	var date = new Date();
+
+	date.setTime(date.getTime() + (60 * 1000));
+
+	document.cookie = 'testcookie=enabled; expired='+date.toGMTString()+'; path=/';
+
+	cookieEnabled = (document.cookie.length > 2) ? true : false;
+
+	date.setTime(date.getTime() - (60 * 1000));
+
+	document.cookie = 'testcookie=; expires='+date.toGMTString()+'; path=/';
+
+	return cookieEnabled;
+}
+
+// -------------------------------------------------------------
+// auto-centering popup windows
+
+function popWin(url, width, height, options)
+{
+	var w = (width) ? width : 400;
+	var h = (height) ? height : 400;
+
+	var t = (screen.height) ? (screen.height - h) / 2 : 0;
+	var l =	 (screen.width) ? (screen.width - w) / 2 : 0;
+
+	var opt = (options) ? options : 'toolbar = no, location = no, directories = no, '+
+		'status = yes, menubar = no, scrollbars = yes, copyhistory = no, resizable = yes';
+
+	var popped = window.open(url, 'popupwindow',
+		'top = '+t+', left = '+l+', width = '+w+', height = '+h+',' + opt);
+
+	popped.focus();
+}
+
+// -------------------------------------------------------------
+// basic confirmation for potentially powerful choice 
+// (like deletion, for example)
+
+function verify(msg)
+{
+	return confirm(msg);
+}
+
+// -------------------------------------------------------------
+// multi-edit checkbox utils
+
+function selectall()
+{
+	var elem = window.document.longform.elements;
+	var cnt = elem.length;
+
+	for (var i = 0; i < cnt; i++)
+	{
+		if (elem[i].name == 'selected[]')
+		{
+			elem[i].checked = true;
+		}
+	}
+}
+
+function deselectall()
+{
+	var elem = window.document.longform.elements;
+	var cnt = elem.length;
+
+	for (var i = 0; i < cnt; i++)
+	{
+		if (elem[i].name == 'selected[]')
+		{
+			elem[i].checked = false;
+		}
+	}
+}
+
+function selectrange()
+{
+	var inrange = false;
+	var elem = window.document.longform.elements;
+	var cnt = elem.length;
+	
+	for (var i = 0; i < cnt; i++)
+	{
+		if (elem[i].name == 'selected[]')
+		{
+			if (elem[i].checked == true)
+			{
+				inrange = (!inrange) ? true : false;
+			}
+
+			if (inrange)
+			{
+				elem[i].checked = true;
+			}
+		}
+	}
+}
+
+// -------------------------------------------------------------
+// ?
+
+function cleanSelects()
+{
+	var withsel = document.getElementById('withselected');
+
+	if (withsel.options[withsel.selectedIndex].value != '')
+	{
+		return (withsel.selectedIndex = 0);
+	}
+}
+
+// -------------------------------------------------------------
+// event handling
+// By S.Andrew -- http://www.scottandrew.com/
+
+function addEvent(elm, evType, fn, useCapture)
+{
+	if (elm.addEventListener)
+	{
+		elm.addEventListener(evType, fn, useCapture);
+		return true;
+	}
+
+	else if (elm.attachEvent)
+	{
+		var r = elm.attachEvent('on' + evType, fn);
+		return r;
+	}
+
+	else
+	{
+		elm['on' + evType] = fn;
+	}
+}
+
+// -------------------------------------------------------------
+// cookie handling
+
+function setCookie(name, value, days)
+{
+	if (days)
+	{
+		var date = new Date();
+
+		date.setTime(date.getTime() + (days*24*60*60*1000));
+
+		var expires = '; expires=' + date.toGMTString();
+	}
+
+	else
+	{
+		var expires = '';
+	}
+
+	document.cookie = name + '=' + value + expires + '; path=/';
+}
+
+function getCookie(name)
+{
+	var nameEQ = name + '=';
+
+	var ca = document.cookie.split(';');
+
+	for (var i = 0; i < ca.length; i++)
+	{
+		var c = ca[i];
+
+		while (c.charAt(0)==' ')
+		{
+			c = c.substring(1, c.length);
+		}
+
+		if (c.indexOf(nameEQ) == 0)
+		{
+			return c.substring(nameEQ.length, c.length);
+		}
+	}
+
+	return null;
+}
+
+function deleteCookie(name)
+{
+	setCookie(name, '', -1);
+}
+
+// -------------------------------------------------------------
+
+function getElementsByClass (className)
+{
+	var all = document.all ? document.all : document.getElementsByTagName('*');
+	var elements = new Array();
+
+	for (var e = 0; e < all.length; e++)
+	{
+		if (all[e].className == className)
+		{
+			elements[elements.length] = all[e];
+		}
+	}
+
+	return elements;
+}
+
+// -------------------------------------------------------------
+// direct show/hide
+
+function toggleDisplay(id)
+{
+	if (!document.getElementById)
+	{
+		return false;
+	}
+
+	var obj = document.getElementById(id);
+
+	if (obj.style.display == 'none')
+	{
+		obj.style.display = 'block';
+	}
+
+	else
+	{
+		obj.style.display = 'none';
+	}
+}
+
+// -------------------------------------------------------------
+// show/hide matching elements
+
+function setClassDisplay(className, value)
+{
+	var elements = getElementsByClass(className);
+	var is_ie = (navigator.appName == 'Microsoft Internet Explorer');
+
+	for (var i = 0; i < elements.length; i++)
+	{
+		var tagname = elements[i].nodeName.toLowerCase();
+		var type = 'block';
+
+		if (tagname == 'td' || tagname == 'th')
+		{
+			type = (is_ie ? 'inline' : 'table-cell');
+		}
+
+		elements[i].style.display = (value== 1 ? type : 'none');
+	}
+}
+
+// -------------------------------------------------------------
+// toggle show/hide matching elements, and set a cookie to remember
+
+function toggleClassRemember(className)
+{
+	var v = getCookie('toggle_' + className);
+	v = (v == 1 ? 0 : 1);
+
+	setCookie('toggle_' + className, v, 365);
+
+	setClassDisplay(className, v);
+}
+
+// -------------------------------------------------------------
+// show/hide matching elements based on cookie value
+
+function setClassRemember(className)
+{
+	var v = getCookie('toggle_' + className);
+
+	setClassDisplay(className, v);
+}

Added: trunk/www.openmoko.com/textpattern/txp_img/carver.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/carver.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/down.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/down.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/down2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/down2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/htmldown.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/htmldown.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/htmlup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/htmlup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/previewdown.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/previewdown.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/previewup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/previewup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/tabs.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/tabs.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/tabshadow.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/tabshadow.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/textdown.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/textdown.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/textpattern.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/textpattern.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/texttabshadow.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/texttabshadow.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/textup.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/textup.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/txp_slug105x45.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/txp_slug105x45.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/txp_slug105x70.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/txp_slug105x70.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/up.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/up.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/txp_img/up2.gif
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/textpattern/txp_img/up2.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/textpattern/update/_to_1.0.0.php
===================================================================
--- trunk/www.openmoko.com/textpattern/update/_to_1.0.0.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/update/_to_1.0.0.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,697 @@
+<?php
+/*
+$HeadURL: http://svn.textpattern.com/current/textpattern/_update.php $
+$LastChangedRevision: 711 $
+*/
+	if (!defined('TXP_UPDATE'))
+		exit("Nothing here. You can't access this file directly.");
+
+	safe_delete("txp_category","name=''");
+	safe_delete("txp_category","name=' '");
+
+	$txpcat = getThings('describe `'.PFX.'txp_category`');
+
+	if (!in_array('id',$txpcat)) {
+		safe_alter('txp_category', 
+			'add `id` int(6) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST');
+	}
+
+	if (!in_array('parent',$txpcat)) {
+		safe_alter("txp_category", "add `parent` varchar(64) not null default ''");
+	}
+
+	if (!in_array('lft',$txpcat)) {
+		safe_alter("txp_category", "add `lft` int(6) not null default '0'");
+	}
+
+	if (!in_array('rgt',$txpcat)) {
+		safe_alter("txp_category", "add `rgt` int(6) not null default '0'");
+	}
+
+	if (in_array('level',$txpcat)) {
+		safe_alter("txp_category", "drop `level`");
+	}
+
+
+	$txp = getThings('describe `'.PFX.'textpattern`');
+
+	if (!in_array('Keywords',$txp)) {
+		safe_alter("textpattern", "add `Keywords` varchar(255) not null");
+	}
+	
+	if (in_array('Listing1',$txp) && !in_array('textile_body',$txp)) {
+		safe_alter("textpattern",
+						"change Listing1 textile_body INT(2) DEFAULT '1' NOT NULL");
+	}
+
+	if (in_array('Listing2',$txp) && !in_array('textile_excerpt',$txp)) {
+		safe_alter("textpattern",
+						"change Listing2 textile_excerpt INT(2) DEFAULT '1' NOT NULL");
+	}
+
+	if (!in_array('url_title',$txp)) {
+		safe_alter("textpattern", "add `url_title` varchar(255) not null");
+	}
+
+	if (!in_array('Excerpt',$txp)) {
+		safe_alter("textpattern", "add `Excerpt` mediumtext not null after `Body_html`");
+	}
+
+		// Excerpt_html added in 1.0
+	if (!in_array('Excerpt_html',$txp)) {
+		safe_alter("textpattern", "add `Excerpt_html` mediumtext not null after `Excerpt` ");
+	}
+
+		// comments count cache field
+	if (!in_array('comments_count',$txp)) {
+		safe_alter("textpattern", "add `comments_count` int(8) not null after `AnnotateInvite` ");
+	}
+
+	// custom fields added for g1.19
+
+	if (!in_array('custom_1',$txp)) {
+		safe_alter("textpattern", "add `custom_1` varchar(255) not null");
+	}
+
+	if (!in_array('custom_2',$txp)) {
+		safe_alter("textpattern", "add `custom_2` varchar(255) not null");
+	}
+
+	if (!in_array('custom_3',$txp)) {
+		safe_alter("textpattern", "add `custom_3` varchar(255) not null");
+	}
+
+	if (!in_array('custom_4',$txp)) {
+		safe_alter("textpattern", "add `custom_4` varchar(255) not null");
+	}
+
+	if (!in_array('custom_5',$txp)) {
+		safe_alter("textpattern", "add `custom_5` varchar(255) not null");
+	}
+
+	if (!in_array('custom_6',$txp)) {
+		safe_alter("textpattern", "add `custom_6` varchar(255) not null");
+	}
+
+	if (!in_array('custom_7',$txp)) {
+		safe_alter("textpattern", "add `custom_7` varchar(255) not null");
+	}
+
+	if (!in_array('custom_8',$txp)) {
+		safe_alter("textpattern", "add `custom_8` varchar(255) not null");
+	}
+
+	if (!in_array('custom_9',$txp)) {
+		safe_alter("textpattern", "add `custom_9` varchar(255) not null");
+	}
+
+	if (!in_array('custom_10',$txp)) {
+		safe_alter("textpattern", "add `custom_10` varchar(255) not null");
+	}
+
+
+
+	$txpsect = getThings('describe `'.PFX.'txp_section`');
+
+	if (!in_array('searchable',$txpsect)) {
+		safe_alter("txp_section", "add `searchable` int(2) not null default 1");
+	}
+
+	$txpuser = getThings('describe `'.PFX.'txp_users`');
+
+	if (!in_array('nonce',$txpuser)) {
+		safe_alter("txp_users", "add `nonce` varchar(64) not null");		
+	};
+
+
+	// 1.0rc: checking nonce in txp_users table
+
+	$txpusers = safe_rows_start('name, nonce','txp_users','1');
+	if ($txpusers) {
+		while ($a = nextRow($txpusers)) {
+			extract($a);
+			if (!$nonce){
+				$nonce = md5( uniqid( rand(), true ) );
+				safe_update('txp_users',"nonce='$nonce'", "name = '$name'");
+			}
+		}
+	}
+
+	// 1.0rc: expanding password field in txp_users
+	
+	safe_alter('txp_users',"CHANGE `pass` `pass` VARCHAR( 128 ) NOT NULL");
+
+	safe_alter('textpattern',"CHANGE `Body` `Body` MEDIUMTEXT NOT NULL");
+
+	safe_alter('textpattern',"CHANGE `Body_html` `Body_html` MEDIUMTEXT NOT NULL");
+
+	safe_alter('textpattern',"CHANGE `Excerpt` `Excerpt` TEXT NOT NULL");
+
+	$popcom = fetch("*",'txp_form','name',"popup_comments");
+	
+	if (!$popcom) {
+	
+		$popform = <<<eod
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+	<link rel="Stylesheet" href="<txp:css />" type="text/css" />
+	<title><txp:page_title /></title>
+</head>
+<body>
+<div style="text-align: left; padding: 1em; width:300px">
+
+	<txp:popup_comments />
+
+	</div>
+</body>
+</html>
+eod;
+		$popform = addslashes($popform);
+		safe_insert("txp_form","name='popup_comments',type='comment',Form='$popform'");
+	}
+	
+	safe_update("txp_category", "lft=0,rgt=0","name!='root'");
+
+	safe_delete("txp_category", "name='root'");
+
+	safe_update("txp_category", "parent='root'","parent = ''");
+
+	safe_insert("txp_category", "name='root',parent='',type='article',lft=1,rgt=0");
+	rebuild_tree('root',1,'article');
+
+	safe_insert("txp_category", "name='root',parent='',type='link',lft=1,rgt=0");
+	rebuild_tree('root',1,'link');
+
+	safe_insert("txp_category", "name='root',parent='',type='image',lft=1,rgt=0");
+	rebuild_tree('root',1,'image');
+
+	if (!safe_field('val','txp_prefs',"name='article_list_pageby'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='article_list_pageby',val=25");
+	}
+
+	if (!safe_field('val','txp_prefs',"name='link_list_pageby'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='link_list_pageby',val=25");
+	}
+
+	if (!safe_field('val','txp_prefs',"name='image_list_pageby'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='image_list_pageby',val=25");
+	}
+
+	if (!safe_field('val','txp_prefs',"name='log_list_pageby'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='log_list_pageby',val=25");
+	}
+
+	if (!safe_field('val','txp_prefs',"name='comment_list_pageby'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='comment_list_pageby',val=25");
+	}
+
+	if (!safe_field('val','txp_prefs',"name='permlink_mode'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='permlink_mode',val='section_id_title'");
+	}
+
+	if (!safe_field('val','txp_prefs',"name='comments_are_ol'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='comments_are_ol',val='1'");
+	}
+
+	if (!safe_field('name','txp_prefs',"name='path_to_site'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='path_to_site',val=''");
+	}
+
+	// 1.0: need to get non-manually set url-only titles into the textpattern table,
+	// so we can start using title as an url search option
+
+	$rs = mysql_query("select ID, Title from `".PFX."textpattern` where url_title like ''");
+	
+		while ($a = mysql_fetch_array($rs)){
+			extract($a);
+			$url_title = addslashes(stripSpace($Title,1));
+			safe_update("textpattern","url_title = '$url_title'","ID=$ID");
+		}
+
+		
+	// 1.0: properly i18n
+	//Change current language names by language codes
+		$lang = fetch('val','txp_prefs','name','language');
+		switch($lang){
+	 	case 'czech':
+	  		$rs = safe_update("txp_prefs", "val= 'cs-cs'", "name='language' AND val= 'czech'");
+	 	break;
+		case 'danish':
+			$rs = safe_update("txp_prefs", "val= 'da-da'", "name='language' AND val= 'danish'");
+		break;
+		case 'dutch':
+			$rs = safe_update("txp_prefs", "val= 'nl-nl'", "name='language' AND val= 'dutch'");
+		break;
+		case 'finish':
+			$rs = safe_update("txp_prefs", "val= 'fi-fi'", "name='language' AND val= 'finish'");
+		break;
+		case 'french':
+			$rs = safe_update("txp_prefs", "val= 'fr-fr'", "name='language' AND val= 'french'");
+		break;
+		case 'german':
+			$rs = safe_update("txp_prefs", "val= 'de-de'", "name='language' AND val= 'german'");
+		break;
+		case 'italian':
+			$rs = safe_update("txp_prefs", "val= 'it-it'", "name='language' AND val= 'italian'");
+		break;
+		case 'polish':
+			$rs = safe_update("txp_prefs", "val= 'pl-pl'", "name='language' AND val= 'polish'");
+		break;
+		case 'portuguese':
+			$rs = safe_update("txp_prefs", "val= 'pt-pt'", "name='language' AND val= 'portuguese'");
+		break;
+		case 'russian':
+			$rs = safe_update("txp_prefs", "val= 'ru-ru'", "name='language' AND val= 'russian'");
+		break;
+		case 'scotts':
+			//I'm not sure of this one
+			$rs = safe_update("txp_prefs", "val= 'gl-gl'", "name='language' AND 'val' = 'scotts'");
+		break;
+		case 'spanish':
+			$rs = safe_update("txp_prefs", "val= 'es-es'", "name='language' AND val= 'spanish'");
+		break;
+		case 'swedish':
+			$rs = safe_update("txp_prefs", "val= 'sv-sv'", "name='language' AND val= 'swedish'");
+		break;
+		case 'tagalog':
+			$rs = safe_update("txp_prefs", "val= 'tl-tl'", 	"name='language' AND val= 'tagalog'");
+		break;
+	        case 'english':
+	        default:
+			$rs = safe_update("txp_prefs", "val= 'en-gb'", "name='language' AND val= 'english'");
+		break;
+	}
+
+	// 1.0: new time zone offset
+	//If we check for a val, and the val is 0, this add another empty one
+	if (!safe_field('name','txp_prefs',"name='is_dst'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='is_dst',val=0");
+	}
+
+	// FIXME: this presupposes 'gmtoffset' won't be set at clean install (RC4+ probably will)
+
+	if (!safe_field('val','txp_prefs',"name='gmtoffset'")) {
+		$old_offset = safe_field('val', 'txp_prefs', "name='timeoffset'");
+		$serveroffset = gmmktime(0,0,0) - mktime(0,0,0);
+		$gmtoffset = sprintf("%+d", $serveroffset + $old_offset);
+		safe_insert('txp_prefs',"prefs_id=1,name='gmtoffset',val='$gmtoffset'");
+	}
+
+	// 1.0: locale support
+	if (!safe_field('val','txp_prefs',"name='locale'")) {
+		safe_insert('txp_prefs',"prefs_id=1,name='locale',val='en_GB'");
+	}
+
+	// 1.0: temp dir
+	if (!safe_field('val','txp_prefs',"name='tempdir'")) {
+		$tempdir = addslashes(find_temp_dir());
+		safe_insert('txp_prefs',"prefs_id=1,name='tempdir',val='$tempdir'");
+	}
+	
+	//non image file upload tab:
+	if (!safe_field('val', 'txp_prefs',"name='file_list_pageby'")){
+		safe_insert('txp_prefs',"val=25,name='file_list_pageby',prefs_id=1");
+	}
+	
+	// 1.0: max file upload size
+	if (!safe_field('val', 'txp_prefs',"name='file_max_upload_size'")){	
+		safe_insert('txp_prefs',"prefs_id=1,name='file_max_upload_size',val=2000000");
+	}
+
+	// 1.0: txp_file root cat
+	if (!safe_field('name', 'txp_category',"type='file' AND name='root'")){
+		safe_insert('txp_category',"name='root',type='file',lft=1,rgt=0");
+	}
+	rebuild_tree('root',1,'file');
+	
+	// 1.0: txp_file folder
+	if (!safe_field('val', 'txp_prefs',"name='file_base_path'")){
+		safe_insert('txp_prefs',"val='$tempdir',name='file_base_path',prefs_id=1");
+	}
+	
+	// 1.0: txp_file table
+	if (!safe_query("SELECT 1 FROM `".PFX."txp_file` LIMIT 0")) {
+		// do install
+		safe_query("CREATE TABLE `".PFX."txp_file` ( 
+				`id` int(11) NOT NULL auto_increment,
+				`filename` varchar( 255 ) NOT NULL default '',
+				`category` varchar( 255 ) NOT NULL default '',
+				`permissions` varchar( 32 ) NOT NULL DEFAULT '0',
+				`description` text NOT NULL default '',
+				`downloads` int(4) unsigned NOT NULL default '0',
+				PRIMARY KEY ( `id` ) ,
+				UNIQUE KEY `filename` ( `filename` ) 
+			) $tabletype PACK_KEYS=0 AUTO_INCREMENT=1 ");
+	}
+	
+	if (!safe_field('name', 'txp_form', "type='file'")){
+		safe_insert('txp_form',"
+			name='files',
+			type='file',
+			Form='<txp:text item=\"file\" />: \n<txp:file_download_link>\n<txp:file_download_name /> [<txp:file_download_size format=\"auto\" decimals=\"2\" />]\n</txp:file_download_link>\n<br />\n<txp:text item=\"category\" />: <txp:file_download_category /><br />\n<txp:text item=\"download\" />: <txp:file_download_downloads />'");
+	}
+	//eof: non image file upload tab
+
+	// 1.0: improved comment spam nonce
+	$txpnonce = getThings('describe `'.PFX.'txp_discuss_nonce`');
+	if (!in_array('secret', $txpnonce))
+		safe_alter('txp_discuss_nonce', "ADD `secret` varchar(255) NOT NULL default ''");
+
+	// 1.0: flag for admin-side plugins
+	$txpplugin = getThings('describe `'.PFX.'txp_plugin`');
+	if (!in_array('type', $txpplugin))
+		safe_alter('txp_plugin', "ADD `type` int(2) NOT NULL default '0'");
+
+	// 1.0: log status & method
+	$txplog = getThings('describe `'.PFX.'txp_log`');
+	if (!in_array('status', $txplog))
+		safe_alter('txp_log', "ADD `status` int NOT NULL default '200'");
+	if (!in_array('method', $txplog))
+		safe_alter('txp_log', "ADD `method` varchar(16) NOT NULL default 'GET'");
+	if (!in_array('ip', $txplog))
+		safe_alter('txp_log', "ADD `ip` varchar(16) NOT NULL default ''");
+
+	// 1.0: need to get Excerpt_html values into the textpattern table,
+	// so, catch empty ones and populate them
+	$rs = mysql_query("select ID, Excerpt, textile_excerpt from `".PFX."textpattern` where Excerpt_html like ''");
+	require_once txpath.'/lib/classTextile.php';
+	$textile = new Textile();
+	while ($a = @mysql_fetch_assoc($rs)){		
+		extract($a);		
+		$lite = ($textile_excerpt)? '' : 1;
+		$Excerpt_html = $textile->TextileThis($Excerpt,$lite);
+		safe_update("textpattern","Excerpt_html = '$Excerpt_html'","ID=$ID");
+	}
+	
+	//1.0 feed unique ids
+	//blog unique id
+	if (!safe_field('val','txp_prefs',"name='blog_uid'"))
+	{
+		$prefs['blog_uid'] = md5(uniqid(rand(),true));
+		safe_insert('txp_prefs',"name='blog_uid', val='".$prefs['blog_uid']."', prefs_id='1'");
+	}
+	if (!safe_field('name','txp_prefs',"name='blog_mail_uid'"))
+	{
+		$mail = safe_field('email', 'txp_users', "privs='1' LIMIT 1");
+		safe_insert('txp_prefs',"name='blog_mail_uid', val='$mail', prefs_id='1'");
+	}	
+	if (!safe_field('val','txp_prefs',"name='blog_time_uid'"))
+	{
+		safe_insert('txp_prefs',"name='blog_time_uid', val='".date("Y")."', prefs_id='1'");
+	}
+	//Articles unique id
+	if (!in_array('uid',$txp))
+	{
+		safe_alter('textpattern',"add `uid` varchar(32) not null");
+		safe_alter('textpattern',"add `feed_time` DATE not null DEFAULT '0000-00-00'");
+		
+		$rs = safe_rows_start('ID,Posted','textpattern','1');
+		if ($rs)
+		{
+			while ($a = nextRow($rs))
+			{
+				$feed_time = substr($a['Posted'],0,10);
+				safe_update('textpattern',"uid='".md5(uniqid(rand(),true))."', feed_time='$feed_time'","ID={$a['ID']}");
+			}
+		}
+	}
+
+	// 1.0: populate comments_count field
+
+		$rs = safe_rows_start('parentid, count(*) as thecount','txp_discuss','visible=1 group by parentid');
+		if ($rs) {
+			while ($a = nextRow($rs)) {
+				safe_update('textpattern',"comments_count=".$a['thecount'],"ID=".$a['parentid']);
+			}
+		}
+
+
+	
+	// 1.0: Human-friendly title for sections and categories, to solve i18n problems
+	if (!in_array('title',$txpsect)) {
+		safe_alter("txp_section", "add `title` varchar(255) not null default ''");
+	}
+	if (!in_array('title',$txpcat)) {
+		safe_alter("txp_category", "add `title` varchar(255) not null default ''");
+	}	
+	if (safe_count('txp_section', "title=''") > 0)
+		safe_update('txp_section', 'title=name', "title=''");
+	if (safe_count('txp_category', "title=''") > 0)
+		safe_update('txp_category', 'title=name', "title=''");
+
+	// 1.0: Unique key and 'type' field for the txp_prefs table
+	$has_prefs_idx = 0;
+	$rs = getRows('show index from `'.PFX.'txp_prefs`');
+	foreach ($rs as $row)
+		if ($row['Key_name'] == 'prefs_idx')
+			$has_prefs_idx = 1;
+	if (!$has_prefs_idx)
+		safe_query('alter ignore table `'.PFX.'txp_prefs` add unique prefs_idx(prefs_id,name)');
+		
+	$txpprefs = getThings('describe `'.PFX.'txp_prefs`');
+	if (!in_array('type', $txpprefs))
+		safe_alter('txp_prefs', "add `type` smallint unsigned not null default '2'");
+	# update the updated with default hidden type for old plugins prefs	
+	safe_alter('txp_prefs',"change `type` `type` smallint unsigned not null default '2'");
+	if (!in_array('event', $txpprefs))
+		safe_alter('txp_prefs', "add `event` varchar(12) not null default 'publish'");
+	if (!in_array('html', $txpprefs))
+		safe_alter('txp_prefs', "add `html` varchar(64) not null default ''");
+	if (!in_array('position', $txpprefs))
+	{
+		safe_alter('txp_prefs', "add `position` smallint unsigned not null default '0'");
+		
+		# add new column values to prefs
+			$prefs_new_cols = array(
+				'attach_titles_to_permalinks' => array('html' => 'yesnoradio', 'event'=> 'publish', 'type' => '1', 'position' => '1'),
+				'sitename' => array('html' => 'text_input', 'event'=> 'publish', 'type' => '0', 'position' => '1'),
+				'siteurl' => array('html' => 'text_input', 'event'=> 'publish', 'type' => '0', 'position' => '2'),
+				'site_slogan'  => array('html' =>'text_input', 'event' => 'publish', 'type' => '0', 'position' => '3'),
+				'language' => array('html' => 'languages','event'=> 'publish', 'type' => '0', 'position' => '4'),
+				'gmtoffset' => array('html' => 'gmtoffset_select','event'=> 'publish', 'type' =>  '0', 'position' => '5'),
+				'is_dst' => array('html' => 'yesnoradio','event'=> 'publish', 'type' => '0', 'position' => '6'),
+				'dateformat' => array('html' => 'dateformats','event'=> 'publish', 'type' => '0', 'position' => '7'),
+				'archive_dateformat' => array('html' => 'dateformats','event'=> 'publish', 'type' => '0', 'position' => '8'),
+				'permlink_mode' => array('html' => 'permlinkmodes','event'=> 'publish', 'type' => '0', 'position' => '9'),
+				'send_lastmod' => array('html' => 'yesnoradio','event'=> 'admin', 'type' => '1', 'position' => '0'),
+				'ping_weblogsdotcom' => array('html' => 'yesnoradio','event'=> 'publish', 'type' => '1', 'position' => '0'),
+				'use_comments' => array('html' => 'yesnoradio','event'=> 'publish', 'type' => '0', 'position' => '12'),
+				'logging' => array('html' => 'logging','event'=> 'publish', 'type' => '0', 'position' => '10'),
+				'use_textile' => array('html' => 'pref_text','event'=> 'publish', 'type' => '0', 'position' => '11'),
+				'tempdir' => array('html' => 'text_input','event'=> 'admin', 'type' => '1', 'position' => '0'),
+				'file_base_path' => array('html' => 'text_input','event'=> 'admin', 'type' => '1', 'position' => '0'),
+				'file_max_upload_size' => array('html' => 'text_input','event'=> 'admin', 'type' => '1', 'position' => '0'),		
+				'comments_moderate' => array('html' => 'yesnoradio','event'=> 'comments', 'type' => '0', 'position' => '13'),
+				'comments_on_default' => array('html' => 'yesnoradio','event'=> 'comments', 'type' => '0', 'position' => '14'),
+				'comments_are_ol' => array('html' => 'yesnoradio','event'=> 'comments', 'type' => '0', 'position' => '15'),
+				'comments_sendmail' => array('html' => 'yesnoradio','event'=> 'comments', 'type' => '0', 'position' => '16'),
+				'comments_disallow_images' => array('html' => 'yesnoradio','event'=> 'comments', 'type' => '0', 'position' => '17'),
+				'comments_default_invite' => array('html' => 'text_input','event'=> 'comments', 'type' => '0', 'position' => '18'),
+				'comments_dateformat' => array('html' => 'dateformats','event'=> 'comments', 'type' => '0', 'position' => '19'),
+				'comments_mode' => array('html' => 'commentmode','event'=> 'comments', 'type' => '0', 'position' => '20'),
+				'comments_disabled_after' => array('html' => 'weeks','event'=> 'comments', 'type' => '0', 'position' => '21'),
+				'img_dir' => array('html' => 'text_input','event'=> 'admin', 'type' => '1', 'position' => '0'),
+				'rss_how_many' => array('html' => 'text_input','event'=> 'admin', 'type' => '1', 'position' => '0'),
+			);
+			
+			foreach ($prefs_new_cols as $pref_key => $pref_val)
+			{
+				safe_update('txp_prefs', "html='$pref_val[html]',event='$pref_val[event]',type='$pref_val[type]', position='$pref_val[position]'", "name='$pref_key' AND prefs_id='1'");
+			}
+			
+			$prefs_hidden_rows = array('prefs_id','use_categories','use_sections','path_from_root','url_mode','record_mentions',
+			'locale','file_base_path','lastmod','version','path_to_site','dbupdatetime','timeoffset','article_list_pageby',
+			'blog_mail_uid','blog_time_uid','blog_uid','comment_list_pageby','file_list_pageby','image_list_pageby','link_list_pageby',
+			'log_list_pageby',);
+			
+			foreach ($prefs_hidden_rows as $hidden_pref)
+			{
+				safe_update('txp_prefs', "type='2'", "name='$hidden_pref' AND prefs_id='1'");
+			}
+			
+			global $txpac;
+			#advanced prefs
+			foreach ($txpac as $key => $val)
+			{
+				if (!in_array($key, array_keys($prefs)))
+				{
+					switch ($key)
+					{
+						case'custom_1_set':
+						case'custom_2_set':
+						case'custom_3_set':
+						case'custom_4_set':
+						case'custom_5_set':
+						case'custom_6_set':
+						case'custom_7_set':
+						case'custom_8_set':
+						case'custom_9_set':
+						case'custom_10_set':
+							$evt = 'custom';
+							$html = 'text_input';
+						break;
+						
+						case 'edit_raw_css_by_default':
+							$evt = 'css';
+							$html = 'yesnoradio';
+						break;
+						case 'spam_blacklists':
+						case 'expire_logs_after':
+						case 'max_url_len':
+							$html = 'text_input';
+							$evt = 'publish';
+						break;
+						case 'textile_links':
+							$html = 'yesnoradio';	
+							$evt = 'link';
+						break;
+						case 'show_article_category_count':
+							$html = 'yesnoradio';	
+							$evt = 'category';				
+						break;
+						case 'comments_require_name':
+						case 'comments_require_email':
+							$html = 'yesnoradio';	
+							$evt = 'comments';				
+						break;
+						default:
+							$html = 'yesnoradio';
+							$evt = 'publish';
+						break;				
+					}
+					safe_insert('txp_prefs',"val = '$val', name = '$key' , prefs_id ='1', type='1', html='$html', event='$evt'");
+				}
+			}		
+	}
+	
+	safe_alter('txp_prefs',"CHANGE `html` `html` VARCHAR( 64 ) DEFAULT 'text_input' NOT NULL");
+	safe_update('txp_prefs',"html='text_input'","html=''");
+		
+	if (!fetch('form','txp_form','name','search_results')) {
+		$form = <<<EOF
+<h3><txp:permlink><txp:title /></txp:permlink></h3>
+<p><txp:search_result_excerpt /><br/>
+<small><txp:permlink><txp:permlink /></txp:permlink> &middot;
+<txp:posted /></small></p>
+EOF;
+		safe_insert('txp_form', "name='search_results', type='article', Form='$form'");
+	}
+	
+	
+	if (!safe_query("SELECT 1 FROM `".PFX."txp_lang` LIMIT 0")) {
+		// do install
+		safe_query("CREATE TABLE `".PFX."txp_lang` (
+			`id` INT( 9 ) NOT NULL AUTO_INCREMENT ,
+			`lang` VARCHAR(16),
+			`name` VARCHAR(64),
+			`event` VARCHAR( 64 ) ,
+			`data` TINYTEXT,
+			`lastmod` timestamp,
+			PRIMARY KEY ( `id` ),
+			UNIQUE INDEX (`lang`,`name`),
+			INDEX (`lang`, `event`)
+			) $tabletype;");
+
+			require_once txpath.'/lib/IXRClass.php';		
+	
+			$client = new IXR_Client('http://rpc.textpattern.com');	
+
+			if (!$client->query('tups.getLanguage',$prefs['blog_uid'],LANG))
+			{				
+				echo '<p style="color:red">Error trying to install language. Please, try it again again.<br /> 
+				If problem connecting to the RPC server persists, you can go to <a href="http://rpc.textpattern.com/lang/">http://rpc.textpattern.com/lang/</a>, download the
+				desired language file and place it in the /lang/ directory of your textpattern install. You can then install the language from file.</p>';
+			}else {
+				$response = $client->getResponse();
+				$lang_struct = unserialize($response);
+				function install_lang_key($value, $key)
+				{			
+					$q = "name='$value[name]', event='$value[event]', data='$value[data]', lastmod='".strftime('%Y%m%d%H%M%S',$value['uLastmod'])."'";					
+					safe_insert('txp_lang',$q.", lang='".LANG."'");
+				}			
+				array_walk($lang_struct,'install_lang_key');
+			}		
+	}
+
+	$maxpos = safe_field('max(position)', 'txp_prefs', '1');
+	// 1.0: production_status setting to control error reporting
+	if (!safe_field('val','txp_prefs',"name='production_status'"))
+	{		
+		safe_insert('txp_prefs',"name='production_status', val='testing', prefs_id='1', type='0', position='".doSlash($maxpos)."', html='prod_levels'");
+	}
+	
+	# multiply position on prefs to allow easy reordering
+	if(intval($maxpos) < 100)
+	{
+		safe_update('txp_prefs','position = position*10','1');
+	}
+	# remove, remove
+	if (safe_field('name','txp_prefs',"name='logs_expire'"))
+	{
+		safe_delete('txp_prefs',"name='logs_expire'");
+	}	
+
+	// Let's make this visible in advanced prefs
+	safe_update('txp_prefs',"type = '1'","name = 'file_base_path'");
+
+	// 1.0: add option to override charset for emails (ISO-8559-1 instead of UTF-8)
+	if (!safe_field('name','txp_prefs',"name='override_emailcharset'"))
+	{		
+		safe_insert('txp_prefs',"name='override_emailcharset', val='0', prefs_id='1', type='1', event='admin', position='".doSlash($maxpos)."', html='yesnoradio'");
+	}
+
+
+	if (safe_field('val', 'txp_prefs', "name='comments_auto_append'") === false) {
+		safe_insert('txp_prefs',"val = '1', name = 'comments_auto_append' , prefs_id ='1', type='0', html='yesnoradio', event='comments', position='211'");
+
+		$form = <<<EOF
+<txp:comments />
+<txp:if_comments_allowed>
+<txp:comments_form />
+</txp:if_comments_allowed>
+EOF;
+		safe_insert('txp_form', "name='comments_display', type='article', Form='$form'");
+	}
+
+	// /tmp is bad for permanent storage of files, 
+	// if no files are uploaded yet, switch to the files directory in the top-txp dir.
+	if (!safe_count('txp_file',"1")){ 
+		$tempdir = find_temp_dir();
+		if ($tempdir == safe_field('val','txp_prefs',"name='file_base_path'"))
+			safe_update('txp_prefs',"val='".doSlash(dirname(txpath).DS.'files')."',prefs_id=1","name='file_base_path'");
+	}
+
+	// After this point the changes after RC4
+
+	// let's get the advanced fields in the right order
+	for ($i = 1; $i <= 10; $i++) {
+		safe_update("txp_prefs","position=$i","name='custom_${i}_set'");
+	}
+
+	// index ip column in txp_log
+
+		$ipidxset = false;
+		$i = safe_show('index','txp_log');
+		foreach ($i as $a => $b) {
+			if ($b['Column_name'] == 'ip') $ipidxset = true;
+		}
+		if (!$ipidxset) safe_query("alter table `".PFX."txp_log` ADD INDEX `ip` (`ip`)");
+
+	// Language selection moves to Manage languages, Hide it from prefs.
+	safe_update("txp_prefs", "type=2", "name='language'");
+
+	// Show gmt-selection in prefs
+	safe_update('txp_prefs',"type=0, html='gmtoffset_select', position=50","name='gmtoffset'");
+
+	if (!safe_field('name', 'txp_prefs', "prefs_id=1 and name='plugin_cache_dir'")) {
+		$maxpos = safe_field('max(position)', 'txp_prefs', '1');
+		safe_insert('txp_prefs',"name='plugin_cache_dir', val='', prefs_id='1', type='1', event='admin', position='".doSlash($maxpos)."', html='text_input'");
+	}
+
+	// update version
+	safe_delete('txp_prefs',"name = 'version'");
+	safe_insert('txp_prefs', "prefs_id=1, name='version',val='4.0', type='2'");
+?>

Added: trunk/www.openmoko.com/textpattern/update/_to_4.0.2.php
===================================================================
--- trunk/www.openmoko.com/textpattern/update/_to_4.0.2.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/update/_to_4.0.2.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,34 @@
+<?php
+/*
+$HeadURL: http://svn.textpattern.com/current/textpattern/_update.php $
+$LastChangedRevision: 711 $
+*/
+	if (!defined('TXP_UPDATE'))
+		exit("Nothing here. You can't access this file directly.");
+
+   if (!safe_field('name', 'txp_page', "name='error_default'")){
+		$error_default = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\r\n<head>\r\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n\r\n\t<title><txp:sitename />: <txp:error_status /></title>\r\n\r\n\t<txp:feed_link flavor=\"atom\" format=\"link\" label=\"Atom\" />\r\n\t<txp:feed_link flavor=\"rss\" format=\"link\" label=\"RSS\" />\r\n\r\n\t<txp:css format=\"link\" />\r\n</head>\r\n<body>\r\n\r\n<!-- accessibility -->\r\n<div id=\"accessibility\">\r\n\t<ul>\r\n\t\t<li><a href=\"#content\"><txp:text item=\"go_content\" /></a></li>\r\n\t\t<li><a href=\"#sidebar-1\"><txp:text item=\"go_nav\" /></a></li>\r\n\t\t<li><a href=\"#sidebar-2\"><txp:text item=\"go_search\" /></a></li>\r\n\t</ul>\r\n</div>\r\n\r\n<div id=\"container\">\r\n\r\n<!-- head -->\r\n\t<div id=\"head\">\r\n\t\t<h1><txp:link_to_home><txp:sitename /></txp:link_to_home></h1>\r\n\t\t<h2><txp:site_slogan /></h2>\r\n\t</div>\r\n\r\n<!-- left -->\r\n\t<div id=\"sidebar-1\">\r\n\t<txp:linklist wraptag=\"p\" />\r\n\t</div>\r\n\r\n<!-- right -->\r\n\t<div id=\"sidebar-2\">\r\n\t\t<txp:search_input wraptag=\"p\" />\r\n\r\n\t\t<txp:popup type=\"c\" wraptag=\"p\" />\r\n\r\n\t\t<p><txp:feed_link label=\"RSS\" /> / <txp:feed_link flavor=\"atom\" label=\"Atom\" /></p>\r\n\r\n\t\t<p><img src=\"<txp:site_url />textpattern/txp_img/txp_slug105x45.gif\" width=\"105\" height=\"45\" alt=\"Textpattern\" title=\"\" /></p>\r\n\t</div>\r\n\r\n<!-- center -->\r\n\t<div id=\"content\">\r\n\t\t<h3 style=\"font: 1.3em Georgia, Times, serif;\"><txp:error_status /></h3>\r\n\t\t<p><txp:error_message /></p>\r\n\t</div>\r\n\r\n<!-- footer -->\r\n\t<div id=\"foot\">&nbsp;</div>\r\n\r\n</div>\r\n\r\n</body>\r\n</html>";
+
+      safe_insert('txp_page',"
+         name='error_default',
+         user_html='".$error_default."'");
+   }
+   //take back use_textile
+   safe_update('txp_prefs',"html='pref_text'","name='use_textile'");
+   // ugly way to change somethign which could break BC:
+   // changed use_textile == 2 to convert breaks and 
+   // use_textile == 1 to use textile - the same than in 
+   // textile_body or textile_excerpt
+   if (safe_field('val','txp_prefs',"name='textile_updated'") === false) {
+   		   $ut = safe_field('val','txp_prefs',"name='use_textile'");
+   		   if ($ut == 1) {
+   		   		safe_update('txp_prefs',"val='2'","name='use_textile'");
+   		   }elseif ($ut == 2){
+   		   		safe_update('txp_prefs',"val='1'","name='use_textile'");
+   		   }
+   		   safe_insert('txp_prefs', "prefs_id=1, name='textile_updated',val='1', type='2'");
+   }
+
+
+
+?>

Added: trunk/www.openmoko.com/textpattern/update/_to_4.0.3.php
===================================================================
--- trunk/www.openmoko.com/textpattern/update/_to_4.0.3.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/update/_to_4.0.3.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,10 @@
+<?php
+/*
+$HeadURL: http://svn.textpattern.com/current/textpattern/_update.php $
+$LastChangedRevision: 711 $
+*/
+	if (!defined('TXP_UPDATE'))
+		exit("Nothing here. You can't access this file directly.");
+
+	safe_update('txp_form',"Form = CONCAT('<txp:comments_error wraptag=\"ul\" break=\"li\" />\r\n\r\n',Form)", "name LIKE 'comment_form'");
+?>

Added: trunk/www.openmoko.com/textpattern/update/_to_4.0.4.php
===================================================================
--- trunk/www.openmoko.com/textpattern/update/_to_4.0.4.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/update/_to_4.0.4.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,42 @@
+<?php
+
+/*
+$HeadURL: http://svn.textpattern.com/current/textpattern/_update.php $
+$LastChangedRevision: 711 $
+*/
+
+	if (!defined('TXP_UPDATE'))
+	{
+		exit("Nothing here. You can't access this file directly.");
+	}
+
+	if (!safe_field('name', 'txp_prefs', "name = 'allow_raw_php_scripting'"))
+	{
+		safe_insert('txp_prefs', "prefs_id = 1, name = 'allow_raw_php_scripting', val = '1', type = '1', html='yesnoradio'");
+	} else {
+		safe_update( 'txp_prefs', "html='yesnoradio'", "name='allow_raw_php_scripting'");
+	}
+
+	if (!safe_field('name', 'txp_prefs', "name = 'log_list_pageby'"))
+	{
+		safe_insert('txp_prefs', "prefs_id = 1, name = 'log_list_pageby', val = '25', type = 2, event = 'publish'");
+	}
+
+	// turn on lastmod handling, and reset the lastmod date
+	safe_update('txp_prefs', "val='1'", "name='send_lastmod' and prefs_id='1'");
+	update_lastmod();
+
+	// speed up article queries
+   $has_ss_idx = 0;
+   $rs = getRows('show index from `'.PFX.'textpattern`');
+   foreach ($rs as $row)
+      if ($row['Key_name'] == 'section_status_idx')
+         $has_ss_idx = 1;
+   if (!$has_ss_idx)
+      safe_query('alter ignore table `'.PFX.'textpattern` add index section_status_idx (Section,Status)');
+
+
+	if (!safe_field('name', 'txp_prefs', "name = 'title_no_widow'"))
+		safe_insert('txp_prefs', "prefs_id = 1, name = 'title_no_widow', val = '1', type = '1', html='yesnoradio'");
+
+?>

Added: trunk/www.openmoko.com/textpattern/update/_update.php
===================================================================
--- trunk/www.openmoko.com/textpattern/update/_update.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/update/_update.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,76 @@
+<?php
+/*
+$HeadURL: http://svn.textpattern.com/releases/4.0.4/source/textpattern/update/_update.php $
+$LastChangedRevision: 1791 $
+*/
+	if (!defined('TXP_UPDATE'))
+		exit("Nothing here. You can't access this file directly.");
+	global $txpcfg, $thisversion, $dbversion, $txp_using_svn, $dbupdatetime;
+
+	function newest_file() {
+		$newest = 0;
+		$dp = opendir(txpath.'/update/');
+		while (false !== ($file = readdir($dp))) 
+		{
+			if (strpos($file,"_") === 0)
+				$newest = max($newest, filemtime(txpath."/update/$file"));
+		}
+		closedir($dp);
+		return $newest;
+	}
+
+	if ( $txp_using_svn && (newest_file() <= $dbupdatetime) ) 
+		return;
+
+	@ignore_user_abort(1);
+	@set_time_limit(0);
+
+	//Use "ENGINE" if version of MySQL > (4.0.18 or 4.1.2)
+	// On 4.1 or greater use utf8-tables, if that is configures in config.php
+	$mysqlversion = mysql_get_server_info();
+	$tabletype = ( intval($mysqlversion[0]) >= 5 || preg_match('#^4\.(0\.[2-9]|(1[89]))|(1\.[2-9])#',$mysqlversion)) 
+					? " ENGINE=MyISAM "
+					: " TYPE=MyISAM ";
+	if ( isset($txpcfg['dbcharset']) && (intval($mysqlversion[0]) >= 5 || preg_match('#^4\.[1-9]#',$mysqlversion))) 
+	{
+		$tabletype .= " CHARACTER SET = ". $txpcfg['dbcharset'] ." ";
+	}
+
+	// Update to 4.0
+	if (( $dbversion == '' ) ||  
+		( strpos($dbversion, 'g1'   ) === 0) ||  
+		( strpos($dbversion, '1.0rc') === 0) )  
+	{  
+		if ((include txpath.DS.'update'.DS.'_to_1.0.0.php') !== false)
+			$dbversion = '4.0';
+	}  
+
+	if ( $dbversion !== '4.0.2' )
+	{  
+		if ((include txpath.DS.'update'.DS.'_to_4.0.2.php') !== false)
+			$dbversion = '4.0.2';
+	}
+
+	if ( $dbversion !== '4.0.3' )
+	{  
+		if ((include txpath.DS.'update'.DS.'_to_4.0.3.php') !== false)
+			$dbversion = '4.0.3';
+	}
+
+	if ( $dbversion !== '4.0.4' )
+	{  
+		if ((include txpath.DS.'update'.DS.'_to_4.0.4.php') !== false)
+			$dbversion = '4.0.4';
+	}
+
+	// keep track of updates for svn users
+	safe_delete('txp_prefs',"name = 'dbupdatetime'");
+	safe_insert('txp_prefs', "prefs_id=1, name='dbupdatetime',val='".max(newest_file(),time())."', type='2'");
+	// update version
+	safe_delete('txp_prefs',"name = 'version'");
+	safe_insert('txp_prefs', "prefs_id=1, name='version',val='$dbversion', type='2'");
+	// updated, baby. So let's get the fresh prefs and send them to languages
+	$event = 'prefs';
+	$step = 'list_languages';
+	$prefs = extract(get_prefs());
+?>

Added: trunk/www.openmoko.com/textpattern/update/index.html
===================================================================
--- trunk/www.openmoko.com/textpattern/update/index.html	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textpattern/update/index.html	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,9 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN "
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
+<html xmlns="http://www.w3.org/1999/xhtml"> 
+<head><title>Nothing here</title></head>
+<body> 
+	<p style="width:30em">Nothing here.
+	</p>
+</body> 
+</html>
\ No newline at end of file

Added: trunk/www.openmoko.com/textsize.php
===================================================================
--- trunk/www.openmoko.com/textsize.php	2007-05-23 15:05:04 UTC (rev 48)
+++ trunk/www.openmoko.com/textsize.php	2007-06-06 08:25:52 UTC (rev 49)
@@ -0,0 +1,22 @@
+<?php
+	$max_size = 3;
+	$normal_size = 0;
+
+	$action = isset($_GET['action']) ? $_GET['action'] : null;
+	$redirect_url = isset($_GET['redirect']) ? urldecode($_GET['redirect']) : null;
+	$current_size = isset($_COOKIE['openmoko_fontsize']) ? $_COOKIE['openmoko_fontsize'] : $normal_size;
+	
+	if ($action == 'decrease') {
+		if ($current_size>0) $current_size --;
+	} else {
+		if ($current_size<$max_size) $current_size ++;
+	}
+	
+	setcookie('openmoko_fontsize',$current_size);
+	
+	if (!$redirect_url) {
+		header('Location: '.PROTOCOL.OPENMOKO_WEB_HOST.OPENMOKO_WEB_WS_PATH);
+	} else {
+		header("Location: ".$redirect_url);
+	}	
+?>
\ No newline at end of file

Added: trunk/www.openmoko.com/uploaded_images/10.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/10.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/10t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/10t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/11.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/11.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/11t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/11t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/12.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/12.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/12t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/12t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/13.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/13.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/13t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/13t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/14.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/14.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/14t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/14t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/15.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/15.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/15t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/15t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/16.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/16.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/16t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/16t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/17.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/17.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/17t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/17t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/18.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/18.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/18t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/18t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/19.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/19.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/19t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/19t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/20.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/20.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/20t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/20t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/21.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/21.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/21t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/21t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/22.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/22.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/22t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/22t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/23.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/23.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/23t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/23t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/24.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/24.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/24t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/24t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/25.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/25.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/25t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/25t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/26.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/26.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/26t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/26t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/27.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/27.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/27t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/27t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/28.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/28.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/28t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/28t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/29.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/29.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/29t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/29t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/3.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/3.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/3t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/3t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/4.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/4.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/4t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/4t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/5.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/5.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/5t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/5t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/6.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/6.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/6t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/6t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/7.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/7.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/7t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/7t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/8.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/8.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/8t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/8t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/9.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/9.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www.openmoko.com/uploaded_images/9t.png
===================================================================
(Binary files differ)


Property changes on: trunk/www.openmoko.com/uploaded_images/9t.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream





More information about the webdesign-commitlog mailing list